summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4
Initial import
-rw-r--r--BSDmakefile33
-rw-r--r--BUGS7
-rw-r--r--COPYING339
-rw-r--r--Config.default1619
-rw-r--r--Config.in17
-rw-r--r--GNUmakefile29
-rw-r--r--LICENCE38
-rw-r--r--Makefile187
-rw-r--r--README39
-rw-r--r--TODO9
-rw-r--r--config/Config.in8
-rw-r--r--config/Kconfig-language.txt255
-rw-r--r--config/Makefile123
-rw-r--r--config/Makefile.in5
-rw-r--r--config/checklist.c377
-rw-r--r--config/colors.h161
-rw-r--r--config/conf.c601
-rw-r--r--config/confdata.c449
-rw-r--r--config/dialog.h196
-rw-r--r--config/expr.c1089
-rw-r--r--config/expr.h194
-rw-r--r--config/glob.c848
-rw-r--r--config/glob.h100
-rw-r--r--config/inputbox.c240
-rw-r--r--config/lex.backup1
-rw-r--r--config/lkc.h113
-rw-r--r--config/lkc_proto.h39
-rw-r--r--config/mconf.c717
-rw-r--r--config/menu.c436
-rw-r--r--config/menubox.c438
-rw-r--r--config/msgbox.c85
-rw-r--r--config/symbol.c782
-rw-r--r--config/textbox.c556
-rw-r--r--config/util.c375
-rw-r--r--config/yesno.c118
-rw-r--r--config/zconf.l387
-rw-r--r--config/zconf.output2133
-rw-r--r--config/zconf.y693
-rw-r--r--mk/build.mk182
-rw-r--r--mk/buildhlp.mk98
-rw-r--r--mk/cpu.mk23
-rw-r--r--mk/fetch.mk83
-rw-r--r--mk/image.mk69
-rw-r--r--mk/kernel-build.mk61
-rw-r--r--mk/kernel.mk77
-rw-r--r--mk/linux.mk11
-rw-r--r--mk/mirrors.mk147
-rw-r--r--mk/modules.mk1254
-rw-r--r--mk/package.mk212
-rw-r--r--mk/pkg-bottom.mk212
-rw-r--r--mk/rootfs.mk21
-rw-r--r--mk/split-cfg.mk10
-rw-r--r--mk/toolchain.mk6
-rw-r--r--mk/tools.mk6
-rw-r--r--mk/vars.mk120
-rw-r--r--package/6tunnel/Config.in13
-rw-r--r--package/6tunnel/Makefile29
-rw-r--r--package/6tunnel/ipkg/6tunnel.control4
-rw-r--r--package/Config.in489
-rw-r--r--package/Depends.mk391
-rw-r--r--package/Makefile450
-rw-r--r--package/aiccu/Config.in12
-rw-r--r--package/aiccu/Makefile36
-rw-r--r--package/aiccu/extra/common/dn_skipname.c51
-rw-r--r--package/aiccu/files/aiccu.init27
-rw-r--r--package/aiccu/ipkg/aiccu.conffiles1
-rw-r--r--package/aiccu/ipkg/aiccu.control5
-rw-r--r--package/aiccu/ipkg/aiccu.postinst3
-rw-r--r--package/aiccu/patches/patch-common_resolver_c30
-rw-r--r--package/aiccu/patches/patch-unix-console_Makefile27
-rw-r--r--package/aircrack-ng/Config.in16
-rw-r--r--package/aircrack-ng/Makefile35
-rw-r--r--package/aircrack-ng/ipkg/aircrack-ng.control5
-rw-r--r--package/aircrack-ng/patches/patch-src_airbase-ng_c189
-rw-r--r--package/aircrack-ng/patches/patch-src_aircrack-ng_c41
-rw-r--r--package/aircrack-ng/patches/patch-src_aircrack-ptw-lib_c21
-rw-r--r--package/aircrack-ng/patches/patch-src_aireplay-ng_c42
-rw-r--r--package/aircrack-ng/patches/patch-src_airodump-ng_c21
-rw-r--r--package/aircrack-ng/patches/patch-src_airtun-ng_c21
-rw-r--r--package/aircrack-ng/patches/patch-src_osdep_linux_c17
-rw-r--r--package/aircrack-ng/patches/patch-src_version_h11
-rw-r--r--package/alsa-lib/Config.in7
-rw-r--r--package/alsa-lib/Makefile31
-rw-r--r--package/alsa-lib/ipkg/alsa-lib.control4
-rw-r--r--package/alsa-lib/ipkg/alsa-lib.postinst4
-rw-r--r--package/alsa-utils/Config.in7
-rw-r--r--package/alsa-utils/Makefile31
-rw-r--r--package/alsa-utils/files/amixer.init30
-rw-r--r--package/alsa-utils/ipkg/alsa-utils.control4
-rw-r--r--package/alsa-utils/ipkg/alsa-utils.postinst4
-rw-r--r--package/alsa-utils/patches/patch-alsactl_init_parse_c21
-rw-r--r--package/apr-util/Config.in12
-rw-r--r--package/apr-util/Makefile31
-rw-r--r--package/apr-util/ipkg/apr-util.control5
-rw-r--r--package/apr-util/patches/patch-uri_Makefile_in19
-rw-r--r--package/apr-util/patches/uri_delim.patch21
-rw-r--r--package/apr/Config.in16
-rw-r--r--package/apr/Makefile54
-rw-r--r--package/apr/ipkg/apr.control4
-rw-r--r--package/arpd/Config.in11
-rw-r--r--package/arpd/Makefile32
-rw-r--r--package/arpd/ipkg/arpd.control5
-rw-r--r--package/arpd/patches/patch-Makefile_in12
-rw-r--r--package/arpd/patches/patch-arpd_c116
-rw-r--r--package/arpd/patches/patch-configure28
-rw-r--r--package/arpwatch/Config.in7
-rw-r--r--package/arpwatch/Makefile32
-rw-r--r--package/arpwatch/ipkg/arpwatch.conffiles1
-rw-r--r--package/arpwatch/ipkg/arpwatch.control5
-rw-r--r--package/asterisk/Config.in96
-rw-r--r--package/asterisk/Makefile237
-rw-r--r--package/asterisk/files/asterisk.init29
-rw-r--r--package/asterisk/files/modules.conf138
-rw-r--r--package/asterisk/ipkg/asterisk-chan-bluetooth.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-chan-bluetooth.control5
-rw-r--r--package/asterisk/ipkg/asterisk-chan-h323.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-chan-h323.control5
-rw-r--r--package/asterisk/ipkg/asterisk-chan-iax2.conffiles2
-rw-r--r--package/asterisk/ipkg/asterisk-chan-iax2.control5
-rw-r--r--package/asterisk/ipkg/asterisk-chan-mgcp.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-chan-mgcp.control5
-rw-r--r--package/asterisk/ipkg/asterisk-chan-misdn.control5
-rw-r--r--package/asterisk/ipkg/asterisk-chan-skinny.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-chan-skinny.control5
-rw-r--r--package/asterisk/ipkg/asterisk-codec-gsm.control5
-rw-r--r--package/asterisk/ipkg/asterisk-codec-speex.control5
-rw-r--r--package/asterisk/ipkg/asterisk-meetme.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-meetme.control5
-rw-r--r--package/asterisk/ipkg/asterisk-pbx-dundi.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-pbx-dundi.control5
-rw-r--r--package/asterisk/ipkg/asterisk-pgsql.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-pgsql.control5
-rw-r--r--package/asterisk/ipkg/asterisk-res-agi.control5
-rw-r--r--package/asterisk/ipkg/asterisk-sounds.control5
-rw-r--r--package/asterisk/ipkg/asterisk-sqlite.control5
-rw-r--r--package/asterisk/ipkg/asterisk-voicemail.conffiles1
-rw-r--r--package/asterisk/ipkg/asterisk-voicemail.control5
-rw-r--r--package/asterisk/ipkg/asterisk.conffiles21
-rw-r--r--package/asterisk/ipkg/asterisk.control5
-rw-r--r--package/asterisk/ipkg/asterisk.postinst3
-rw-r--r--package/asterisk/patches/patch-apps__moduleinfo13
-rw-r--r--package/asterisk/patches/patch-menuselect-tree13
-rw-r--r--package/asterisk/patches/patch-menuselect_example_menuselect-tree12
-rw-r--r--package/atftp/Config.in25
-rw-r--r--package/atftp/Makefile32
-rw-r--r--package/atftp/ipkg/atftp.control5
-rw-r--r--package/atftp/ipkg/atftpd.control5
-rwxr-xr-xpackage/atftp/ipkg/files/postinst8
-rw-r--r--package/atftp/patches/patch-stats_c14
-rw-r--r--package/atftp/patches/patch-test_Makefile152
-rw-r--r--package/atftp/patches/patch-tftp_c83
-rw-r--r--package/atftp/patches/patch-tftp_def_c11
-rw-r--r--package/atftp/patches/patch-tftp_def_h13
-rw-r--r--package/atftp/patches/patch-tftp_file_c64
-rw-r--r--package/atftp/patches/patch-tftpd_c20
-rw-r--r--package/autossh/Config.in9
-rw-r--r--package/autossh/Makefile32
-rw-r--r--package/autossh/ipkg/autossh.control5
-rw-r--r--package/avahi/Config.in44
-rw-r--r--package/avahi/Config.in.lib18
-rw-r--r--package/avahi/Makefile83
-rw-r--r--package/avahi/files/avahi-daemon.conf29
-rw-r--r--package/avahi/files/avahi-daemon.init25
-rw-r--r--package/avahi/files/service-http10
-rw-r--r--package/avahi/files/service-ssh9
-rw-r--r--package/avahi/ipkg/avahi-daemon.conffiles3
-rw-r--r--package/avahi/ipkg/avahi-daemon.control5
-rw-r--r--package/avahi/ipkg/avahi-daemon.postinst6
-rw-r--r--package/avahi/ipkg/avahi-dnsconfd.control5
-rw-r--r--package/avahi/ipkg/libavahi.control4
-rw-r--r--package/axtls/Config.in17
-rw-r--r--package/axtls/Config.in.lib11
-rw-r--r--package/axtls/Makefile43
-rw-r--r--package/axtls/files/axhttpd.init30
-rw-r--r--package/axtls/files/config102
-rw-r--r--package/axtls/ipkg/axhttpd.control5
-rw-r--r--package/axtls/ipkg/axhttpd.postinst3
-rw-r--r--package/axtls/ipkg/libaxtls.control5
-rw-r--r--package/axtls/patches/001-opt_flags.patch33
-rw-r--r--package/axtls/patches/patch-httpd_main_c21
-rw-r--r--package/base-files/Config.in16
-rw-r--r--package/base-files/Makefile72
-rw-r--r--package/base-files/files/etc/banner3
-rw-r--r--package/base-files/files/etc/functions.sh79
-rw-r--r--package/base-files/files/etc/group3
-rw-r--r--package/base-files/files/etc/hosts2
-rw-r--r--package/base-files/files/etc/init.d/boot27
-rw-r--r--package/base-files/files/etc/init.d/done4
-rwxr-xr-xpackage/base-files/files/etc/init.d/rcK21
-rwxr-xr-xpackage/base-files/files/etc/init.d/rcS10
-rw-r--r--package/base-files/files/etc/inittab4
-rw-r--r--package/base-files/files/etc/ipkg.conf3
-rw-r--r--package/base-files/files/etc/mdev.conf11
-rw-r--r--package/base-files/files/etc/modules1
-rw-r--r--package/base-files/files/etc/network/interfaces2
-rw-r--r--package/base-files/files/etc/passwd3
-rw-r--r--package/base-files/files/etc/profile12
-rw-r--r--package/base-files/files/etc/protocols45
-rw-r--r--package/base-files/files/etc/rc.conf3
-rw-r--r--package/base-files/files/etc/shadow3
-rw-r--r--package/base-files/files/etc/sysctl.conf0
-rwxr-xr-xpackage/base-files/files/init18
-rw-r--r--package/base-files/files/lib/mdev/init21
-rwxr-xr-xpackage/base-files/files/usr/share/udhcpc/default.script38
-rw-r--r--package/base-files/ipkg/base-files.conffiles13
-rw-r--r--package/base-files/ipkg/base-files.control3
-rw-r--r--package/bash/Config.in8
-rw-r--r--package/bash/Makefile27
-rw-r--r--package/bash/ipkg/bash.control4
-rw-r--r--package/bc/Config.in22
-rw-r--r--package/bc/Makefile31
-rw-r--r--package/bc/ipkg/bc.control4
-rw-r--r--package/bc/ipkg/dc.control4
-rw-r--r--package/bigreqsproto/Config.in6
-rw-r--r--package/bigreqsproto/Makefile20
-rw-r--r--package/bigreqsproto/ipkg/bigreqsproto.control4
-rw-r--r--package/bind/Config.in136
-rw-r--r--package/bind/Makefile92
-rw-r--r--package/bind/files/bind/db.012
-rw-r--r--package/bind/files/bind/db.12713
-rw-r--r--package/bind/files/bind/db.25512
-rw-r--r--package/bind/files/bind/db.local13
-rw-r--r--package/bind/files/bind/db.root45
-rw-r--r--package/bind/files/bind/named.conf.example45
-rw-r--r--package/bind/files/named.init27
-rw-r--r--package/bind/ipkg/bind-check.control5
-rw-r--r--package/bind/ipkg/bind-client.control5
-rw-r--r--package/bind/ipkg/bind-dig.control5
-rw-r--r--package/bind/ipkg/bind-dnssec.control5
-rw-r--r--package/bind/ipkg/bind-host.control6
-rw-r--r--package/bind/ipkg/bind-rndc.control5
-rw-r--r--package/bind/ipkg/bind-server.conffiles6
-rw-r--r--package/bind/ipkg/bind-server.control6
-rw-r--r--package/bind/ipkg/bind-server.postinst3
-rw-r--r--package/bind/ipkg/bind-tools.control5
-rw-r--r--package/bind/ipkg/libbind.control4
-rw-r--r--package/bind/patches/patch-lib_isc_unix_ifiter_ioctl_c14
-rw-r--r--package/binutils/Config.in8
-rw-r--r--package/binutils/Makefile36
-rw-r--r--package/binutils/ipkg/binutils.control4
-rw-r--r--package/bitlbee/Config.in15
-rw-r--r--package/bitlbee/Makefile68
-rw-r--r--package/bitlbee/files/bitlbee.init27
-rw-r--r--package/bitlbee/ipkg/bitlbee.conffiles2
-rw-r--r--package/bitlbee/ipkg/bitlbee.control5
-rw-r--r--package/bitlbee/ipkg/bitlbee.postinst3
-rw-r--r--package/bitlbee/patches/patch-configure40
-rw-r--r--package/bluez-firmware/Config.in10
-rw-r--r--package/bluez-firmware/Makefile28
-rw-r--r--package/bluez-firmware/ipkg/bluez-firmware.control5
-rw-r--r--package/bluez/Config.in10
-rw-r--r--package/bluez/Makefile47
-rw-r--r--package/bluez/files/bluez.init26
-rw-r--r--package/bluez/ipkg/bluez.control5
-rw-r--r--package/bluez/patches/patch-tools_hciattach_c19
-rw-r--r--package/bogofilter/Config.in26
-rw-r--r--package/bogofilter/Makefile47
-rw-r--r--package/bogofilter/ipkg/bogofilter.control4
-rw-r--r--package/bogofilter/patches/patch-config_in14
-rw-r--r--package/bogofilter/patches/patch-configure281
-rw-r--r--package/bridge-utils/Config.in10
-rw-r--r--package/bridge-utils/Makefile27
-rw-r--r--package/bridge-utils/ipkg/bridge-utils.control4
-rw-r--r--package/bridge-utils/patches/patch-libbridge_Makefile_in11
-rw-r--r--package/busybox/Config.in15
-rw-r--r--package/busybox/Makefile52
-rw-r--r--package/busybox/config/Config.in605
-rw-r--r--package/busybox/config/archival/Config.in300
-rw-r--r--package/busybox/config/console-tools/Config.in138
-rw-r--r--package/busybox/config/coreutils/Config.in827
-rw-r--r--package/busybox/config/debianutils/Config.in84
-rw-r--r--package/busybox/config/e2fsprogs/Config.in68
-rw-r--r--package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in67
-rw-r--r--package/busybox/config/editors/Config.in196
-rw-r--r--package/busybox/config/findutils/Config.in255
-rw-r--r--package/busybox/config/init/Config.in102
-rw-r--r--package/busybox/config/libbb/Config.in154
-rw-r--r--package/busybox/config/loginutils/Config.in283
-rw-r--r--package/busybox/config/mailutils/Config.in69
-rw-r--r--package/busybox/config/miscutils/Config.in552
-rw-r--r--package/busybox/config/modutils/Config.in230
-rw-r--r--package/busybox/config/networking/Config.in921
-rw-r--r--package/busybox/config/networking/udhcp/Config.in122
-rw-r--r--package/busybox/config/printutils/Config.in26
-rw-r--r--package/busybox/config/procps/Config.in200
-rw-r--r--package/busybox/config/runit/Config.in83
-rw-r--r--package/busybox/config/selinux/Config.in123
-rw-r--r--package/busybox/config/shell/Config.in344
-rw-r--r--package/busybox/config/sysklogd/Config.in118
-rw-r--r--package/busybox/config/util-linux/Config.in845
-rw-r--r--package/busybox/files/bridge.pre-up0
-rw-r--r--package/busybox/files/busybox.config665
-rw-r--r--package/busybox/files/crond.init27
-rw-r--r--package/busybox/files/inetd.init27
-rw-r--r--package/busybox/files/ipv671
-rw-r--r--package/busybox/files/ipv6.up0
-rw-r--r--package/busybox/files/network.init25
-rw-r--r--package/busybox/files/syslog.init28
-rw-r--r--package/busybox/files/vlan.pre-up0
-rw-r--r--package/busybox/ipkg/busybox.control4
-rw-r--r--package/busybox/ipkg/busybox.postinst6
-rw-r--r--package/busybox/patches/001-ipkg.patch13797
-rw-r--r--package/busybox/patches/002-find-empty.patch105
-rw-r--r--package/busybox/patches/patch-Makefile12
-rw-r--r--package/busybox/patches/patch-Makefile_flags21
-rw-r--r--package/busybox/patches/patch-include_libbb_h80
-rw-r--r--package/busybox/patches/patch-include_platform_h30
-rw-r--r--package/busybox/patches/patch-networking_traceroute_c12
-rw-r--r--package/busybox/patches/patch-networking_udhcp_dhcpd_c11
-rw-r--r--package/busybox/patches/patch-runit_runit_lib_h16
-rw-r--r--package/busybox/patches/patch-util-linux_fdisk_osf_c12
-rw-r--r--package/bwm/Config.in8
-rw-r--r--package/bwm/Makefile27
-rw-r--r--package/bwm/ipkg/bwm.control4
-rw-r--r--package/cbtt/Config.in18
-rw-r--r--package/cbtt/Makefile36
-rw-r--r--package/cbtt/ipkg/cbtt-mysql.control5
-rw-r--r--package/cbtt/ipkg/cbtt.control5
-rw-r--r--package/cbtt/patches/100-compile.patch57
-rw-r--r--package/cbtt/patches/patch-bnbt_h11
-rw-r--r--package/cfgfs/Config.in10
-rw-r--r--package/cfgfs/Makefile39
-rw-r--r--package/cfgfs/ipkg/cfgfs.control5
-rw-r--r--package/cfgfs/src/BSDmakefile32
-rw-r--r--package/cfgfs/src/LICENCE35
-rw-r--r--package/cfgfs/src/Makefile40
-rw-r--r--package/cfgfs/src/Makefile.inc45
-rw-r--r--package/cfgfs/src/adler.h60
-rw-r--r--package/cfgfs/src/bundled/README.LZO123
-rw-r--r--package/cfgfs/src/bundled/lzoconf.h413
-rw-r--r--package/cfgfs/src/bundled/lzodefs.h1545
-rw-r--r--package/cfgfs/src/bundled/minilzo.c3826
-rw-r--r--package/cfgfs/src/bundled/minilzo.h102
-rw-r--r--package/cfgfs/src/c_lzo1x1.c126
-rw-r--r--package/cfgfs/src/c_null.c78
-rw-r--r--package/cfgfs/src/c_zlib.c84
-rw-r--r--package/cfgfs/src/compress.c78
-rw-r--r--package/cfgfs/src/compress.h52
-rw-r--r--package/cfgfs/src/cpr_get.c63
-rw-r--r--package/cfgfs/src/cpr_list.c46
-rw-r--r--package/cfgfs/src/cpr_lsth.c41
-rw-r--r--package/cfgfs/src/defs.h34
-rw-r--r--package/cfgfs/src/ft_creat.c304
-rw-r--r--package/cfgfs/src/ft_dump.c135
-rw-r--r--package/cfgfs/src/ft_pack.c134
-rw-r--r--package/cfgfs/src/ft_packm.c71
-rw-r--r--package/cfgfs/src/fts.c1118
-rw-r--r--package/cfgfs/src/fts_debg.c51
-rw-r--r--package/cfgfs/src/fts_gnu.h137
-rw-r--r--package/cfgfs/src/fts_subs.c163
-rw-r--r--package/cfgfs/src/fts_subs.h37
-rw-r--r--package/cfgfs/src/fwcf.helper/Makefile51
-rw-r--r--package/cfgfs/src/fwcf.sh384
-rw-r--r--package/cfgfs/src/fwcf.txt434
-rw-r--r--package/cfgfs/src/header.c83
-rw-r--r--package/cfgfs/src/lib/Makefile28
-rw-r--r--package/cfgfs/src/minilzop.c178
-rw-r--r--package/cfgfs/src/minilzop.h19
-rw-r--r--package/cfgfs/src/mkfwcf/Makefile23
-rw-r--r--package/cfgfs/src/mkfwcf/mkfwcf.c109
-rw-r--r--package/cfgfs/src/mtd.c379
-rw-r--r--package/cfgfs/src/pack.h95
-rw-r--r--package/cfgfs/src/replace.c39
-rw-r--r--package/cfgfs/src/replace.h6
-rw-r--r--package/cfgfs/src/sys_bsd.c96
-rw-r--r--package/cfgfs/src/sys_linux.c61
-rw-r--r--package/cfgfs/src/sysdeps.h17
-rw-r--r--package/cfgfs/src/tool.c302
-rw-r--r--package/cfgfs/src/tool/Makefile59
-rw-r--r--package/cfgfs/src/unfwcf/Makefile28
-rw-r--r--package/cfgfs/src/unfwcf/unfwcf.c100
-rw-r--r--package/cfgfs/src/unwraps.c95
-rw-r--r--package/cfgfs/src/wraps.c103
-rw-r--r--package/cgilib/Config.in10
-rw-r--r--package/cgilib/Makefile26
-rw-r--r--package/cgilib/extra/m4/libtool.m47370
-rw-r--r--package/cgilib/extra/m4/ltoptions.m4368
-rw-r--r--package/cgilib/extra/m4/ltsugar.m4123
-rw-r--r--package/cgilib/extra/m4/ltversion.m423
-rw-r--r--package/cgilib/extra/m4/lt~obsolete.m492
-rw-r--r--package/cgilib/ipkg/cgilib.control7
-rw-r--r--package/cgilib/patches/patch-INSTALL277
-rw-r--r--package/cgilib/patches/patch-Makefile_in491
-rw-r--r--package/cgilib/patches/patch-cgi_c12
-rw-r--r--package/cgilib/patches/patch-configure8132
-rw-r--r--package/cgilib/patches/patch-depcomp153
-rw-r--r--package/cgilib/patches/patch-install-sh641
-rw-r--r--package/cgilib/patches/patch-ltmain_sh131
-rw-r--r--package/cgilib/patches/patch-missing185
-rw-r--r--package/chillispot/Config.in15
-rw-r--r--package/chillispot/Makefile31
-rw-r--r--package/chillispot/files/chilli.conf292
-rw-r--r--package/chillispot/files/chillispot.init25
-rw-r--r--package/chillispot/ipkg/chillispot.conffiles1
-rw-r--r--package/chillispot/ipkg/chillispot.control5
-rw-r--r--package/chillispot/ipkg/chillispot.postinst3
-rw-r--r--package/collectd/Config.in36
-rw-r--r--package/collectd/Makefile94
-rw-r--r--package/collectd/files/collectd.init27
-rw-r--r--package/collectd/ipkg/collectd.control5
-rw-r--r--package/collectd/ipkg/collectd.postinst3
-rw-r--r--package/collectd/patches/patch-src_Makefile_in12
-rw-r--r--package/collectd/patches/patch-src_libcollectdclient_Makefile_in12
-rw-r--r--package/comgt/Config.in11
-rw-r--r--package/comgt/Makefile29
-rw-r--r--package/comgt/files/dial.comgt26
-rw-r--r--package/comgt/files/setmode.comgt26
-rw-r--r--package/comgt/ipkg/comgt.control4
-rw-r--r--package/comgt/patches/patch-comgt_0_32_Makefile33
-rw-r--r--package/comgt/patches/patch-comgt_h14
-rw-r--r--package/compositeproto/Config.in6
-rw-r--r--package/compositeproto/Makefile20
-rw-r--r--package/cryptsetup/Config.in16
-rw-r--r--package/cryptsetup/Makefile32
-rw-r--r--package/cryptsetup/ipkg/cryptsetup.control5
-rw-r--r--package/cryptsetup/patches/patch-lib_libdevmapper_c14
-rw-r--r--package/cryptsetup/patches/patch-lib_utils_c16
-rw-r--r--package/ctorrent/Config.in29
-rwxr-xr-xpackage/ctorrent/Makefile36
-rw-r--r--package/ctorrent/ipkg/ctorrent.control4
-rw-r--r--package/ctorrent/patches/patch-btcontent_cpp16
-rw-r--r--package/ctorrent/patches/patch-btfiles_cpp16
-rw-r--r--package/cups/Config.in10
-rw-r--r--package/cups/Makefile77
-rw-r--r--package/cups/files/cupsd.init28
-rw-r--r--package/cups/files/etc/cups/classes.conf7
-rw-r--r--package/cups/files/etc/cups/client.conf9
-rw-r--r--package/cups/files/etc/cups/cupsd.conf34
-rw-r--r--package/cups/files/etc/cups/printers.conf23
-rw-r--r--package/cups/ipkg/cups.conffiles4
-rw-r--r--package/cups/ipkg/cups.control5
-rw-r--r--package/cups/ipkg/cups.postinst6
-rw-r--r--package/cups/patches/patch-Makefile12
-rw-r--r--package/cups/patches/patch-configure12
-rw-r--r--package/curl/Config.in26
-rw-r--r--package/curl/Makefile55
-rw-r--r--package/curl/ipkg/curl.control5
-rw-r--r--package/curl/ipkg/libcurl.control5
-rw-r--r--package/curl/patches/patch-configure24
-rw-r--r--package/cutter/Config.in10
-rwxr-xr-xpackage/cutter/Makefile26
-rw-r--r--package/cutter/ipkg/cutter.control5
-rw-r--r--package/cutter/patches/patch-cutter_c21
-rw-r--r--package/cxxtools/Config.in26
-rw-r--r--package/cxxtools/Makefile44
-rw-r--r--package/cxxtools/ipkg/cxxtools.control4
-rw-r--r--package/cxxtools/patches/patch-demo_Makefile_in67
-rw-r--r--package/cyrus-sasl/Config.in14
-rw-r--r--package/cyrus-sasl/Makefile74
-rw-r--r--package/cyrus-sasl/ipkg/libsasl2.control4
-rw-r--r--package/damageproto/Config.in6
-rw-r--r--package/damageproto/Makefile20
-rw-r--r--package/davfs2/Config.in43
-rw-r--r--package/davfs2/Makefile43
-rw-r--r--package/davfs2/ipkg/davfs2.conffiles2
-rw-r--r--package/davfs2/ipkg/davfs2.control4
-rw-r--r--package/davfs2/ipkg/davfs2.postinst5
-rw-r--r--package/davfs2/patches/patch-src_cache_c11
-rw-r--r--package/davfs2/patches/patch-src_dav_coda2_c11
-rw-r--r--package/davfs2/patches/patch-src_dav_coda3_c11
-rw-r--r--package/davfs2/patches/patch-src_dav_fuse5_c11
-rw-r--r--package/davfs2/patches/patch-src_dav_fuse7_c11
-rw-r--r--package/davfs2/patches/patch-src_kernel_interface_c31
-rw-r--r--package/davfs2/patches/patch-src_mount_davfs_c69
-rw-r--r--package/davfs2/patches/patch-src_umount_davfs_c12
-rw-r--r--package/davfs2/patches/patch-src_webdav_c55
-rw-r--r--package/dbus/Config.in10
-rw-r--r--package/dbus/Makefile47
-rw-r--r--package/dbus/files/dbus.init27
-rw-r--r--package/dbus/ipkg/dbus.control5
-rw-r--r--package/dbus/ipkg/dbus.postinst6
-rw-r--r--package/deco/Config.in10
-rw-r--r--package/deco/Makefile30
-rw-r--r--package/deco/ipkg/deco.control5
-rw-r--r--package/deco/patches/100-tty.c.patch11
-rw-r--r--package/device-mapper/Config.in6
-rw-r--r--package/device-mapper/Makefile43
-rw-r--r--package/device-mapper/ipkg/device-mapper.control4
-rw-r--r--package/device-mapper/patches/patch-lib_Makefile_in21
-rw-r--r--package/device-mapper/patches/patch-make_tmpl_in16
-rw-r--r--package/dhcp-forwarder/Config.in8
-rw-r--r--package/dhcp-forwarder/Makefile36
-rw-r--r--package/dhcp-forwarder/files/dhcp-fwd.init26
-rw-r--r--package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles1
-rw-r--r--package/dhcp-forwarder/ipkg/dhcp-forwarder.control4
-rw-r--r--package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst3
-rw-r--r--package/dhcp-forwarder/patches/00-big_endian.patch11
-rw-r--r--package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch35
-rw-r--r--package/dhcp/Config.in30
-rw-r--r--package/dhcp/Makefile37
-rw-r--r--package/dhcp/files/dhcpd.init27
-rw-r--r--package/dhcp/ipkg/dhcp-relay.control4
-rw-r--r--package/dhcp/ipkg/dhcp-server.control4
-rw-r--r--package/dhcp/ipkg/dhcp-server.postinst3
-rw-r--r--package/dhcp6/Config.in12
-rw-r--r--package/dhcp6/Makefile32
-rwxr-xr-xpackage/dhcp6/ipkg/dhcp6.control5
-rw-r--r--package/dhcp6/ipkg/files/conffiles4
-rw-r--r--package/dhcp6/patches/patch-client_Makefile58
-rw-r--r--package/dhcp6/patches/patch-client_clilib_c22
-rw-r--r--package/dhcp6/patches/patch-client_macros_h10
-rw-r--r--package/dhcp6/patches/patch-client_solicit_c12
-rw-r--r--package/dhcp6/patches/patch-server_Makefile38
-rw-r--r--package/dhcp6/patches/patch-server_macros_h10
-rw-r--r--package/dhcp6/patches/patch-server_reply_c21
-rw-r--r--package/digitemp/Config.in17
-rw-r--r--package/digitemp/Makefile26
-rw-r--r--package/digitemp/ipkg/digitemp.control5
-rw-r--r--package/digitemp/patches/001-Makefile.patch29
-rw-r--r--package/dnsmasq/Config.in11
-rw-r--r--package/dnsmasq/Makefile31
-rw-r--r--package/dnsmasq/files/dnsmasq.conf39
-rw-r--r--package/dnsmasq/files/dnsmasq.init26
-rw-r--r--package/dnsmasq/ipkg/dnsmasq.conffiles1
-rw-r--r--package/dnsmasq/ipkg/dnsmasq.control4
-rw-r--r--package/dnsmasq/ipkg/dnsmasq.postinst7
-rw-r--r--package/dnsmasq/patches/patch-src_config_h23
-rw-r--r--package/dosfstools/Config.in6
-rw-r--r--package/dosfstools/Makefile30
-rw-r--r--package/dosfstools/ipkg/dosfstools.control4
-rw-r--r--package/dovecot/Config.in10
-rw-r--r--package/dovecot/Makefile61
-rw-r--r--package/dovecot/files/dovecot.conf1153
-rw-r--r--package/dovecot/ipkg/dovecot.control4
-rw-r--r--package/dovecot/patches/patch-configure41
-rw-r--r--package/dovecot/patches/patch-src_plugins_quota_Makefile_in13
-rw-r--r--package/dropbear/Config.in14
-rw-r--r--package/dropbear/Makefile72
-rw-r--r--package/dropbear/files/dropbear.init43
-rw-r--r--package/dropbear/ipkg/dropbear.control4
-rw-r--r--package/dropbear/ipkg/dropbear.postinst3
-rw-r--r--package/dropbear/ipkg/dropbearconvert.control4
-rw-r--r--package/dropbear/patches/patch-cli-runopts_c22
-rw-r--r--package/dropbear/patches/patch-options_h24
-rw-r--r--package/dropbear/patches/patch-svr-authpubkey_c46
-rw-r--r--package/dsniff/Config.in13
-rw-r--r--package/dsniff/Makefile37
-rw-r--r--package/dsniff/ipkg/dsniff.control5
-rw-r--r--package/dsniff/patches/patch-Makefile_in32
-rw-r--r--package/dsniff/patches/patch-arp_c30
-rw-r--r--package/dsniff/patches/patch-arp_h11
-rw-r--r--package/dsniff/patches/patch-arpspoof_c12
-rw-r--r--package/dsniff/patches/patch-confdefs_h28
-rw-r--r--package/dsniff/patches/patch-configure104
-rw-r--r--package/dsniff/patches/patch-decode_c21
-rw-r--r--package/dsniff/patches/patch-dns_c681
-rw-r--r--package/dsniff/patches/patch-dsniff_services9
-rw-r--r--package/dsniff/patches/patch-msgsnarf_c11
-rw-r--r--package/dsniff/patches/patch-record_c151
-rw-r--r--package/dsniff/patches/patch-ssh_c46
-rw-r--r--package/dsniff/patches/patch-sshcrypto_c43
-rw-r--r--package/dsniff/patches/patch-sshow_c38
-rw-r--r--package/e2fsprogs/Config.in26
-rw-r--r--package/e2fsprogs/Makefile57
-rw-r--r--package/e2fsprogs/ipkg/e2fsprogs.control4
-rw-r--r--package/e2fsprogs/ipkg/libcom-err.control4
-rw-r--r--package/e2fsprogs/ipkg/libuuid.control4
-rw-r--r--package/e2fsprogs/patches/patch-misc_Makefile_in12
-rw-r--r--package/elinks/Config.in9
-rw-r--r--package/elinks/Makefile49
-rw-r--r--package/elinks/ipkg/elinks.control5
-rw-r--r--package/em28xx/Config.in9
-rw-r--r--package/em28xx/Makefile43
-rw-r--r--package/em28xx/ipkg/kmod-em28xx.control4
-rw-r--r--package/esound/Config.in10
-rw-r--r--package/esound/Makefile30
-rw-r--r--package/esound/files/esd.init24
-rw-r--r--package/esound/ipkg/esound.control6
-rw-r--r--package/esound/ipkg/esound.postinst3
-rw-r--r--package/esound/patches/patch-esd_c23
-rw-r--r--package/ether-wake/Config.in9
-rw-r--r--package/ether-wake/Makefile24
-rw-r--r--package/ether-wake/extra/ether-wake.c386
-rw-r--r--package/ether-wake/ipkg/ether-wake.control5
-rw-r--r--package/ethtool/Config.in8
-rw-r--r--package/ethtool/Makefile26
-rw-r--r--package/ethtool/ipkg/ethtool.control4
-rw-r--r--package/evieext/Config.in6
-rw-r--r--package/evieext/Makefile20
-rw-r--r--package/exmap/Config.in41
-rw-r--r--package/exmap/Makefile49
-rw-r--r--package/exmap/ipkg/exmap.control4
-rw-r--r--package/exmap/ipkg/exmapd.control4
-rw-r--r--package/exmap/ipkg/exmapserver.control4
-rw-r--r--package/exmap/ipkg/kmod-exmap.control4
-rw-r--r--package/exmap/patches/patch-Makefile_in12
-rw-r--r--package/exmap/patches/patch-kernel_exmap_c31
-rw-r--r--package/exmap/patches/patch-src_exmapd_c20
-rw-r--r--package/exmap/patches/patch-src_exmapserver_c22
-rw-r--r--package/expat/Config.in14
-rw-r--r--package/expat/Makefile27
-rw-r--r--package/expat/ipkg/libexpat.control4
-rw-r--r--package/expat/patches/001-destdir.patch44
-rw-r--r--package/ez-ipupdate/Config.in8
-rw-r--r--package/ez-ipupdate/Makefile32
-rw-r--r--package/ez-ipupdate/files/ez-ipupdate.conf10
-rw-r--r--package/ez-ipupdate/files/ez-ipupdate.init26
-rw-r--r--package/ez-ipupdate/ipkg/ez-ipupdate.conffiles1
-rw-r--r--package/ez-ipupdate/ipkg/ez-ipupdate.control4
-rw-r--r--package/ez-ipupdate/ipkg/ez-ipupdate.postinst3
-rw-r--r--package/ez-ipupdate/patches/patch-configure19
-rw-r--r--package/ez-ipupdate/patches/patch-example-dhs_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example-dyndns_conf27
-rw-r--r--package/ez-ipupdate/patches/patch-example-dyns_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example-easydns_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example-gnudip_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example-heipv6tb_conf27
-rw-r--r--package/ez-ipupdate/patches/patch-example-justlinux_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example-ods_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example-pgpow_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example-tzo_conf20
-rw-r--r--package/ez-ipupdate/patches/patch-example_conf9
-rw-r--r--package/ez-ipupdate/patches/patch-ez-ipupdate_c540
-rw-r--r--package/faad2/Config.in16
-rw-r--r--package/faad2/Makefile35
-rw-r--r--package/faad2/ipkg/libfaad2.control4
-rw-r--r--package/faad2/patches/patch-common_mp4ff_Makefile_am16
-rw-r--r--package/faad2/patches/patch-common_mp4ff_mp4ff_h12
-rw-r--r--package/faad2/patches/patch-configure_in11
-rw-r--r--package/faad2/patches/patch-frontend_Makefile_am12
-rw-r--r--package/fakeidentd/Config.in8
-rw-r--r--package/fakeidentd/Makefile31
-rw-r--r--package/fakeidentd/files/fakeidentd.init26
-rw-r--r--package/fakeidentd/ipkg/fakeidentd.control4
-rw-r--r--package/fakeidentd/ipkg/fakeidentd.postinst4
-rw-r--r--package/fbset/Config.in6
-rw-r--r--package/fbset/Makefile42
-rw-r--r--package/fbset/files/fb.modes1003
-rw-r--r--package/fbset/ipkg/fbset.control4
-rw-r--r--package/fetchmail/Config.in17
-rw-r--r--package/fetchmail/Makefile41
-rw-r--r--package/fetchmail/ipkg/fetchmail.control4
-rw-r--r--package/fetchmail/patches/patch-mxget_c127
-rw-r--r--package/ffmpeg/Config.in6
-rw-r--r--package/ffmpeg/Makefile56
-rw-r--r--package/ffmpeg/ipkg/ffmpeg.control4
-rw-r--r--package/file/Config.in14
-rw-r--r--package/file/Makefile32
-rw-r--r--package/file/ipkg/file.control4
-rw-r--r--package/fixesproto/Config.in6
-rw-r--r--package/fixesproto/Makefile20
-rw-r--r--package/flac/Config.in14
-rw-r--r--package/flac/Makefile30
-rw-r--r--package/flac/ipkg/libflac.control4
-rw-r--r--package/flac/patches/patch-configure12
-rw-r--r--package/flac/patches/patch-src_libFLAC_Makefile_in12
-rw-r--r--package/flac/patches/patch-src_libFLAC_lpc_c13
-rw-r--r--package/fontcacheproto/Config.in6
-rw-r--r--package/fontcacheproto/Makefile20
-rw-r--r--package/fontsproto/Config.in6
-rw-r--r--package/fontsproto/Makefile20
-rw-r--r--package/fping/Config.in15
-rw-r--r--package/fping/Makefile37
-rw-r--r--package/fping/ipkg/fping.control4
-rw-r--r--package/fprobe-ulog/Config.in10
-rw-r--r--package/fprobe-ulog/Makefile31
-rw-r--r--package/fprobe-ulog/ipkg/fprobe-ulog.control8
-rw-r--r--package/fprobe/Config.in10
-rw-r--r--package/fprobe/Makefile32
-rw-r--r--package/fprobe/ipkg/fprobe.control7
-rw-r--r--package/freeradius/Config.in153
-rw-r--r--package/freeradius/Makefile195
-rw-r--r--package/freeradius/files/clients.conf7
-rw-r--r--package/freeradius/files/radiusd.conf73
-rw-r--r--package/freeradius/files/radiusd.init27
-rw-r--r--package/freeradius/files/users1
-rw-r--r--package/freeradius/ipkg/freeradius-democerts.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-chap.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-detail.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-digest.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap-gtc.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap-md5.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap-mschapv2.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap-peap.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap-tls.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap-ttls.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap.conffiles1
-rw-r--r--package/freeradius/ipkg/freeradius-mod-eap.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-files.conffiles3
-rw-r--r--package/freeradius/ipkg/freeradius-mod-files.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-ldap.conffiles1
-rw-r--r--package/freeradius/ipkg/freeradius-mod-ldap.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-mschap.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-pap.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-preprocess.conffiles2
-rw-r--r--package/freeradius/ipkg/freeradius-mod-preprocess.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-realm.conffiles1
-rw-r--r--package/freeradius/ipkg/freeradius-mod-realm.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-sql-mysql.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-sql-pgsql.control5
-rw-r--r--package/freeradius/ipkg/freeradius-mod-sql.conffiles1
-rw-r--r--package/freeradius/ipkg/freeradius-mod-sql.control5
-rw-r--r--package/freeradius/ipkg/freeradius-utils.control5
-rw-r--r--package/freeradius/ipkg/freeradius.conffiles2
-rw-r--r--package/freeradius/ipkg/freeradius.control5
-rw-r--r--package/freeradius/ipkg/freeradius.postinst6
-rw-r--r--package/freeradius/patches/patch-share_dictionary210
-rw-r--r--package/freeradius/patches/patch-src_main_event_c14
-rw-r--r--package/freetype/Config.in24
-rw-r--r--package/freetype/Makefile28
-rw-r--r--package/freetype/ipkg/libfreetype.control16
-rw-r--r--package/frickin/Config.in10
-rw-r--r--package/frickin/Makefile27
-rw-r--r--package/frickin/files/frickin.init26
-rw-r--r--package/frickin/ipkg/frickin.control4
-rw-r--r--package/frickin/ipkg/frickin.postinst4
-rw-r--r--package/fuse/Config.in27
-rw-r--r--package/fuse/Makefile36
-rw-r--r--package/fuse/ipkg/fuse-utils.control5
-rw-r--r--package/fuse/ipkg/libfuse.control5
-rw-r--r--package/gatling/Config.in10
-rw-r--r--package/gatling/Makefile32
-rw-r--r--package/gatling/ipkg/gatling.control5
-rw-r--r--package/gatling/patches/patch-GNUmakefile15
-rw-r--r--package/gatling/patches/patch-gatling_c73
-rw-r--r--package/gcc/Config.in9
-rw-r--r--package/gcc/Makefile30
-rw-r--r--package/gcc/ipkg/gcc.control5
-rw-r--r--package/gdb/Config.in10
-rw-r--r--package/gdb/Makefile29
-rw-r--r--package/gdb/ipkg/gdb.control5
-rw-r--r--package/gdbserver/Config.in8
-rw-r--r--package/gdbserver/Makefile22
-rw-r--r--package/gdbserver/ipkg/gdbserver.control5
-rw-r--r--package/gettext/Config.in6
-rw-r--r--package/gettext/Makefile40
-rw-r--r--package/gettext/ipkg/gettext.control5
-rw-r--r--package/gkrellmd/Config.in9
-rw-r--r--package/gkrellmd/Makefile33
-rw-r--r--package/gkrellmd/files/gkrellmd.init26
-rw-r--r--package/gkrellmd/ipkg/gkrellmd.control5
-rw-r--r--package/gkrellmd/ipkg/gkrellmd.postinst3
-rw-r--r--package/glib/Config.in17
-rw-r--r--package/glib/Makefile55
-rw-r--r--package/glib/ipkg/glib1.control5
-rw-r--r--package/glib/patches/01-debian-9.patch18988
-rw-r--r--package/glib/patches/02-cross-compile-fix.patch210
-rw-r--r--package/glib/patches/03-use-glibconfig-sysdefs.patch31
-rw-r--r--package/glib/patches/04-gcc3.4-fix.patch22
-rw-r--r--package/glib2/Config.in7
-rw-r--r--package/glib2/Makefile40
-rw-r--r--package/glib2/ipkg/glib2.control5
-rw-r--r--package/glibc/Config.in9
-rw-r--r--package/glibc/Makefile34
-rw-r--r--package/glibc/ipkg/glibc.control4
-rw-r--r--package/gmediaserver/Config.in13
-rw-r--r--package/gmediaserver/Makefile37
-rw-r--r--package/gmediaserver/files/gmediaserver.init25
-rw-r--r--package/gmediaserver/ipkg/gmediaserver.control5
-rw-r--r--package/gmediaserver/ipkg/gmediaserver.postinst4
-rw-r--r--package/gmediaserver/patches/patch-src_main_c158
-rw-r--r--package/gmp/Config.in14
-rw-r--r--package/gmp/Makefile27
-rw-r--r--package/gmp/ipkg/libgmp.control4
-rw-r--r--package/gnutls/Config.in97
-rw-r--r--package/gnutls/Makefile44
-rw-r--r--package/gnutls/ipkg/gnutls-utils.control5
-rw-r--r--package/gnutls/ipkg/libgnutls-extra.control5
-rw-r--r--package/gnutls/ipkg/libgnutls-openssl.control5
-rw-r--r--package/gnutls/ipkg/libgnutls.control5
-rw-r--r--package/gnutls/ipkg/libgnutlsxx.control5
-rw-r--r--package/gpg/Config.in9
-rw-r--r--package/gpg/Makefile43
-rw-r--r--package/gpg/ipkg/gpg.control5
-rw-r--r--package/gpm/Config.in6
-rw-r--r--package/gpm/Makefile29
-rw-r--r--package/gpm/ipkg/gpm.control4
-rw-r--r--package/gpm/patches/patch-src_daemon_open_console_c12
-rw-r--r--package/gpm/patches/patch-src_synaptics_c15
-rw-r--r--package/gpsd/Config.in26
-rw-r--r--package/gpsd/Makefile40
-rw-r--r--package/gpsd/ipkg/gpsd-clients.control5
-rw-r--r--package/gpsd/ipkg/gpsd.control5
-rw-r--r--package/gpsd/patches/patch-gpsd_h24
-rw-r--r--package/gpsd/patches/patch-sirfflash_c12
-rw-r--r--package/gsm/Config.in30
-rw-r--r--package/gsm/Makefile31
-rw-r--r--package/gsm/ipkg/gsm-utils.control4
-rw-r--r--package/gsm/ipkg/libgsm.control4
-rw-r--r--package/gsm/patches/patch-Makefile244
-rw-r--r--package/gsm/patches/patch-inc_config_h42
-rw-r--r--package/gsm/patches/patch-inc_gsm_h25
-rw-r--r--package/gsm/patches/patch-inc_toast_h29
-rw-r--r--package/gsm/patches/patch-src_code_c14
-rw-r--r--package/gsm/patches/patch-src_debug_c29
-rw-r--r--package/gsm/patches/patch-src_toast_c69
-rw-r--r--package/haserl/Config.in9
-rw-r--r--package/haserl/Makefile27
-rw-r--r--package/haserl/ipkg/haserl.control4
-rw-r--r--package/haserl/patches/patch-src_haserl_c12
-rw-r--r--package/hdparm/Config.in12
-rw-r--r--package/hdparm/Makefile24
-rw-r--r--package/hdparm/ipkg/hdparm.control4
-rw-r--r--package/heimdal/Config.in63
-rw-r--r--package/heimdal/Makefile126
-rw-r--r--package/heimdal/files/heimdal.init30
-rw-r--r--package/heimdal/files/kadmind.acl1
-rw-r--r--package/heimdal/files/kdc.conf4
-rw-r--r--package/heimdal/files/krb5.conf25
-rw-r--r--package/heimdal/ipkg/heimdal-client-libs.control5
-rw-r--r--package/heimdal/ipkg/heimdal-libs.control5
-rw-r--r--package/heimdal/ipkg/heimdal-server.control4
-rw-r--r--package/heimdal/ipkg/heimdal-server.postinst8
-rw-r--r--package/heimdal/patches/patch-Makefile_am12
-rw-r--r--package/heimdal/patches/patch-Makefile_in25
-rw-r--r--package/heimdal/patches/patch-admin_Makefile_am12
-rw-r--r--package/heimdal/patches/patch-admin_Makefile_in12
-rw-r--r--package/heimdal/patches/patch-configure13
-rw-r--r--package/heimdal/patches/patch-include_Makefile_am22
-rw-r--r--package/heimdal/patches/patch-include_Makefile_in39
-rw-r--r--package/heimdal/patches/patch-kadmin_Makefile_am12
-rw-r--r--package/heimdal/patches/patch-kadmin_Makefile_in12
-rw-r--r--package/heimdal/patches/patch-kadmin_kadm_conn_c14
-rw-r--r--package/heimdal/patches/patch-kdc_kx509_c18
-rw-r--r--package/heimdal/patches/patch-kdc_process_c26
-rw-r--r--package/heimdal/patches/patch-kuser_Makefile_am12
-rw-r--r--package/heimdal/patches/patch-kuser_Makefile_in12
-rw-r--r--package/heimdal/patches/patch-lib_asn1_Makefile_am48
-rw-r--r--package/heimdal/patches/patch-lib_asn1_Makefile_in48
-rw-r--r--package/heimdal/patches/patch-lib_gssapi_Makefile_am25
-rw-r--r--package/heimdal/patches/patch-lib_gssapi_Makefile_in25
-rw-r--r--package/heimdal/patches/patch-lib_hdb_Makefile_am12
-rw-r--r--package/heimdal/patches/patch-lib_hdb_Makefile_in12
-rw-r--r--package/heimdal/patches/patch-lib_hx509_Makefile_am32
-rw-r--r--package/heimdal/patches/patch-lib_hx509_Makefile_in38
-rw-r--r--package/heimdal/patches/patch-lib_kadm5_Makefile_am12
-rw-r--r--package/heimdal/patches/patch-lib_kadm5_Makefile_in12
-rw-r--r--package/heimdal/patches/patch-lib_krb5_Makefile_am11
-rw-r--r--package/heimdal/patches/patch-lib_krb5_Makefile_in21
-rw-r--r--package/heimdal/patches/patch-lib_krb5_constants_c10
-rw-r--r--package/heimdal/patches/patch-lib_roken_Makefile_am14
-rw-r--r--package/heimdal/patches/patch-lib_roken_Makefile_in24
-rw-r--r--package/heimdal/patches/patch-lib_vers_Makefile_am13
-rw-r--r--package/heimdal/patches/patch-lib_vers_Makefile_in24
-rw-r--r--package/heimdal/patches/patch-tools_krb5-config_in23
-rw-r--r--package/heyu/Config.in8
-rw-r--r--package/heyu/Makefile31
-rw-r--r--package/heyu/files/x10.conf24
-rw-r--r--package/heyu/ipkg/files/heyu.conffiles1
-rw-r--r--package/heyu/ipkg/heyu.control6
-rw-r--r--package/heyu/patches/patch-tty_c12
-rw-r--r--package/hostapd/Config.in41
-rw-r--r--package/hostapd/Makefile35
-rw-r--r--package/hostapd/files/hostapd.conf23
-rw-r--r--package/hostapd/files/hostapd.config77
-rw-r--r--package/hostapd/ipkg/hostapd-utils.control5
-rw-r--r--package/hostapd/ipkg/hostapd.conffiles1
-rw-r--r--package/hostapd/ipkg/hostapd.control6
-rw-r--r--package/hostapd/patches/patch-hostapd_Makefile12
-rw-r--r--package/htpdate/Config.in8
-rw-r--r--package/htpdate/Makefile28
-rw-r--r--package/htpdate/files/htpdate.init26
-rw-r--r--package/htpdate/ipkg/htpdate.control4
-rw-r--r--package/htpdate/ipkg/htpdate.postinst4
-rw-r--r--package/htpdate/patches/patch-Makefile14
-rw-r--r--package/httping/Config.in21
-rw-r--r--package/httping/Makefile34
-rw-r--r--package/httping/ipkg/httping.control4
-rw-r--r--package/httping/patches/patch-Makefile14
-rw-r--r--package/httping/patches/patch-io_c12
-rw-r--r--package/httptunnel/Config.in9
-rw-r--r--package/httptunnel/Makefile27
-rw-r--r--package/httptunnel/ipkg/httptunnel.control4
-rw-r--r--package/icecast/Config.in17
-rw-r--r--package/icecast/Makefile40
-rw-r--r--package/icecast/ipkg/icecast.conffiles1
-rw-r--r--package/icecast/ipkg/icecast.control5
-rw-r--r--package/icecast/patches/patch-m4_xiph_curl_m412
-rw-r--r--package/id3lib/Config.in28
-rw-r--r--package/id3lib/Makefile42
-rw-r--r--package/id3lib/ipkg/id3lib.control4
-rw-r--r--package/id3lib/patches/patch-Makefile_in15
-rw-r--r--package/id3lib/patches/patch-configure12
-rw-r--r--package/id3lib/patches/patch-include_id3_id3lib_strings_h20
-rw-r--r--package/id3lib/patches/patch-include_id3_writers_h12
-rw-r--r--package/iftop/Config.in14
-rw-r--r--package/iftop/Makefile26
-rw-r--r--package/iftop/ipkg/iftop.control5
-rw-r--r--package/igmpproxy/Config.in9
-rw-r--r--package/igmpproxy/Makefile29
-rw-r--r--package/igmpproxy/ipkg/igmpproxy.control4
-rw-r--r--package/inputproto/Config.in6
-rw-r--r--package/inputproto/Makefile20
-rw-r--r--package/ipcad/Config.in12
-rw-r--r--package/ipcad/Makefile35
-rw-r--r--package/ipcad/ipkg/ipcad.conffiles1
-rw-r--r--package/ipcad/ipkg/ipcad.control6
-rw-r--r--package/ipcad/patches/patch-configure99
-rw-r--r--package/ipcad/patches/patch-loop-ipq_c11
-rw-r--r--package/iperf/Config.in13
-rw-r--r--package/iperf/Makefile33
-rw-r--r--package/iperf/ipkg/iperf.control5
-rw-r--r--package/iproute2/Config.in18
-rw-r--r--package/iproute2/Makefile48
-rw-r--r--package/iproute2/ipkg/ip.control4
-rw-r--r--package/iproute2/ipkg/tc.control5
-rw-r--r--package/iproute2/patches/patch-Makefile19
-rw-r--r--package/iproute2/patches/patch-ip_Makefile10
-rw-r--r--package/iproute2/patches/patch-ip_iptunnel_c17
-rw-r--r--package/ipsec-tools/Config.in11
-rw-r--r--package/ipsec-tools/Makefile40
-rw-r--r--package/ipsec-tools/ipkg/ipsec-tools.conffiles1
-rw-r--r--package/ipsec-tools/ipkg/ipsec-tools.control5
-rw-r--r--package/ipsec-tools/patches/patch-configure12
-rw-r--r--package/ipsec-tools/patches/patch-configure_ac12
-rw-r--r--package/ipsec-tools/patches/patch-src_racoon_cftoken_l12
-rw-r--r--package/ipsec-tools/patches/patch-src_racoon_crypto_openssl_c12
-rw-r--r--package/ipsec-tools/patches/patch-src_setkey_token_l12
-rw-r--r--package/ipset/Config.in9
-rw-r--r--package/ipset/Makefile30
-rw-r--r--package/ipset/ipkg/ipset.control5
-rw-r--r--package/ipset/patches/patch-kernel_ip_set_c12
-rw-r--r--package/iptables-snmp/Config.in10
-rw-r--r--package/iptables-snmp/Makefile27
-rw-r--r--package/iptables-snmp/ipkg/iptables-snmp.control5
-rw-r--r--package/iptables/Config.in42
-rw-r--r--package/iptables/Makefile65
-rw-r--r--package/iptables/files/l7/aim.pat27
-rw-r--r--package/iptables/files/l7/bittorrent.pat14
-rw-r--r--package/iptables/files/l7/edonkey-dl.pat8
-rw-r--r--package/iptables/files/l7/edonkey.pat29
-rw-r--r--package/iptables/files/l7/fasttrack.pat25
-rw-r--r--package/iptables/files/l7/ftp.pat34
-rw-r--r--package/iptables/files/l7/gnutella.pat36
-rw-r--r--package/iptables/files/l7/http.pat28
-rw-r--r--package/iptables/files/l7/ident.pat14
-rw-r--r--package/iptables/files/l7/irc.pat20
-rw-r--r--package/iptables/files/l7/jabber.pat24
-rw-r--r--package/iptables/files/l7/msnmessenger.pat15
-rw-r--r--package/iptables/files/l7/ntp.pat17
-rw-r--r--package/iptables/files/l7/pop3.pat50
-rw-r--r--package/iptables/files/l7/smtp.pat39
-rw-r--r--package/iptables/files/l7/ssl.pat15
-rw-r--r--package/iptables/files/l7/vnc.pat23
-rw-r--r--package/iptables/ipkg/ip6tables.control5
-rw-r--r--package/iptables/ipkg/iptables-extra.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-conntrack.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-extra.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-filter.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-imq.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-ipopt.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-ipsec.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-nat.control5
-rw-r--r--package/iptables/ipkg/iptables-mod-ulog.control5
-rw-r--r--package/iptables/ipkg/iptables-utils.control5
-rw-r--r--package/iptables/ipkg/iptables.control4
-rw-r--r--package/iptables/ipkg/iptables.postinst7
-rw-r--r--package/iptraf/Config.in13
-rw-r--r--package/iptraf/Makefile35
-rw-r--r--package/iptraf/ipkg/iptraf.control5
-rw-r--r--package/iptraf/patches/patch-src_Makefile21
-rw-r--r--package/iptraf/patches/patch-src_dirs_h11
-rw-r--r--package/iptraf/patches/patch-src_fltmgr_c12
-rw-r--r--package/iptraf/patches/patch-src_hostmon_c61
-rw-r--r--package/iptraf/patches/patch-src_ifaces_c12
-rw-r--r--package/iptraf/patches/patch-src_landesc_c21
-rw-r--r--package/iptraf/patches/patch-src_links_h11
-rw-r--r--package/iptraf/patches/patch-src_log_c12
-rw-r--r--package/iptraf/patches/patch-src_options_c22
-rw-r--r--package/iptraf/patches/patch-src_othptab_c33
-rw-r--r--package/iptraf/patches/patch-src_packet_c50
-rw-r--r--package/iptraf/patches/patch-src_promisc_c22
-rw-r--r--package/iptraf/patches/patch-src_rvnamed_h16
-rw-r--r--package/iptraf/patches/patch-src_tcptable_c12
-rw-r--r--package/iptraf/patches/patch-src_tcptable_h11
-rw-r--r--package/iptraf/patches/patch-support_Makefile24
-rw-r--r--package/irssi/Config.in18
-rw-r--r--package/irssi/Makefile42
-rw-r--r--package/irssi/ipkg/irssi.control4
-rw-r--r--package/iw/Config.in7
-rw-r--r--package/iw/Makefile27
-rw-r--r--package/iw/ipkg/iw.control4
-rw-r--r--package/jamvm/Config.in16
-rw-r--r--package/jamvm/Makefile36
-rw-r--r--package/jamvm/ipkg/jamvm.control5
-rw-r--r--package/jpeg/Config.in15
-rw-r--r--package/jpeg/Makefile34
-rw-r--r--package/jpeg/ipkg/libjpeg.control6
-rw-r--r--package/jpeg/patches/jpeg-6b-config_guess.patch2854
-rw-r--r--package/jpeg/patches/jpeg-6b-fix-makefile.patch12
-rw-r--r--package/kbproto/Config.in6
-rw-r--r--package/kbproto/Makefile20
-rw-r--r--package/kismet/Config.in67
-rw-r--r--package/kismet/Makefile57
-rw-r--r--package/kismet/files/ap_manuf79
-rw-r--r--package/kismet/files/client_manuf249
-rw-r--r--package/kismet/files/kismet.conf281
-rw-r--r--package/kismet/files/kismet_drone.conf121
-rw-r--r--package/kismet/files/kismet_ui.conf61
-rw-r--r--package/kismet/ipkg/kismet-client.conffiles4
-rw-r--r--package/kismet/ipkg/kismet-client.control9
-rw-r--r--package/kismet/ipkg/kismet-drone.conffiles1
-rw-r--r--package/kismet/ipkg/kismet-drone.control9
-rw-r--r--package/kismet/ipkg/kismet-server.conffiles3
-rw-r--r--package/kismet/ipkg/kismet-server.control9
-rw-r--r--package/kismet/ipkg/kismet.control9
-rw-r--r--package/kismet/patches/patch-Makefile_in12
-rw-r--r--package/knock/Config.in41
-rw-r--r--package/knock/Makefile33
-rw-r--r--package/knock/ipkg/knock.control5
-rw-r--r--package/knock/ipkg/knockd.conffiles1
-rw-r--r--package/knock/ipkg/knockd.control5
-rw-r--r--package/krb5/Config.in45
-rw-r--r--package/krb5/Makefile57
-rw-r--r--package/krb5/files/kadmind.acl1
-rw-r--r--package/krb5/files/kdc.conf13
-rw-r--r--package/krb5/files/krb5.conf16
-rw-r--r--package/krb5/files/krb5.init28
-rw-r--r--package/krb5/ipkg/krb5-libs.control5
-rw-r--r--package/krb5/ipkg/krb5-server.control4
-rw-r--r--package/krb5/ipkg/krb5-server.postinst8
-rw-r--r--package/krb5/patches/patch-src_Makefile_in11
-rw-r--r--package/krb5/patches/patch-src_include_stock_osconf_h34
-rw-r--r--package/krb5/patches/patch-src_lib_kadm5_Makefile_in12
-rw-r--r--package/krb5/patches/patch-src_lib_kadm5_clnt_Makefile_in12
-rw-r--r--package/krb5/patches/patch-src_lib_kadm5_srv_Makefile_in12
-rw-r--r--package/krb5/patches/patch-src_lib_kdb_Makefile_in12
-rw-r--r--package/krb5/patches/patch-src_lib_krb5_Makefile_in12
-rw-r--r--package/krb5/patches/patch-src_lib_rpc_Makefile_in12
-rw-r--r--package/l2tpns/Config.in12
-rw-r--r--package/l2tpns/Makefile32
-rw-r--r--package/l2tpns/ipkg/l2tpns.conffiles3
-rw-r--r--package/l2tpns/ipkg/l2tpns.control4
-rw-r--r--package/l2tpns/patches/01-honor_includes_remove_backtrace.patch128
-rw-r--r--package/lame/Config.in12
-rw-r--r--package/lame/Config.in.lib7
-rw-r--r--package/lame/Makefile29
-rw-r--r--package/lame/ipkg/lame.control5
-rw-r--r--package/lame/ipkg/liblame.control4
-rw-r--r--package/less/Config.in10
-rw-r--r--package/less/Makefile26
-rw-r--r--package/less/ipkg/less.control5
-rw-r--r--package/libICE/Config.in6
-rw-r--r--package/libICE/Makefile26
-rw-r--r--package/libICE/ipkg/libice.control4
-rw-r--r--package/libSM/Config.in6
-rw-r--r--package/libSM/Makefile26
-rw-r--r--package/libSM/ipkg/libsm.control4
-rw-r--r--package/libX11/Config.in7
-rw-r--r--package/libX11/Makefile30
-rw-r--r--package/libX11/ipkg/libx11.control4
-rw-r--r--package/libX11/patches/patch-src_util_Makefile_in21
-rw-r--r--package/libX11/patches/patch-src_util_Makefile_in.orig12
-rw-r--r--package/libXau/Config.in6
-rw-r--r--package/libXau/Makefile26
-rw-r--r--package/libXau/ipkg/libxau.control4
-rw-r--r--package/libXaw/Config.in6
-rw-r--r--package/libXaw/Makefile26
-rw-r--r--package/libXaw/ipkg/libxaw.control4
-rw-r--r--package/libXdmcp/Config.in6
-rw-r--r--package/libXdmcp/Makefile26
-rw-r--r--package/libXdmcp/ipkg/libxdmcp.control4
-rw-r--r--package/libXext/Config.in6
-rw-r--r--package/libXext/Makefile27
-rw-r--r--package/libXext/ipkg/libxext.control4
-rw-r--r--package/libXfont/Config.in6
-rw-r--r--package/libXfont/Makefile26
-rw-r--r--package/libXfont/ipkg/libxfont.control4
-rw-r--r--package/libXmu/Config.in6
-rw-r--r--package/libXmu/Makefile27
-rw-r--r--package/libXmu/ipkg/libxmu.control4
-rw-r--r--package/libXpm/Config.in6
-rw-r--r--package/libXpm/Makefile27
-rw-r--r--package/libXpm/ipkg/libxpm.control4
-rw-r--r--package/libXt/Config.in6
-rw-r--r--package/libXt/Makefile28
-rw-r--r--package/libXt/ipkg/libxt.control4
-rw-r--r--package/libXt/patches/patch-util_Makefile_in24
-rw-r--r--package/libXxf86dga/Config.in6
-rw-r--r--package/libXxf86dga/Makefile27
-rw-r--r--package/libXxf86dga/ipkg/libxxf86dga.control4
-rw-r--r--package/libao/Config.in10
-rw-r--r--package/libao/Makefile30
-rw-r--r--package/libao/ipkg/libao.control4
-rw-r--r--package/libart/Config.in12
-rw-r--r--package/libart/Makefile28
-rw-r--r--package/libart/ipkg/libart.control9
-rw-r--r--package/libart/patches/100-cross_compile_fix.patch15
-rw-r--r--package/libaudiofile/Config.in8
-rw-r--r--package/libaudiofile/Makefile28
-rw-r--r--package/libaudiofile/ipkg/libaudiofile.control4
-rw-r--r--package/libaudiofile/patches/001-audiofile-config-libdirs.patch13
-rw-r--r--package/libcli/Config.in11
-rwxr-xr-xpackage/libcli/Makefile26
-rwxr-xr-xpackage/libcli/ipkg/libcli.control5
-rw-r--r--package/libcli/patches/patch-Makefile23
-rw-r--r--package/libdaemon/Config.in19
-rw-r--r--package/libdaemon/Makefile28
-rw-r--r--package/libdaemon/ipkg/libdaemon.control4
-rw-r--r--package/libdb/Config.in15
-rw-r--r--package/libdb/Makefile80
-rw-r--r--package/libdb/ipkg/libdb.control4
-rw-r--r--package/libdnet/Config.in9
-rw-r--r--package/libdnet/Makefile30
-rw-r--r--package/libdnet/ipkg/libdnet.control4
-rw-r--r--package/libdnet/patches/libdnet-1.10-dnet_config.patch23
-rw-r--r--package/libelf/Config.in10
-rw-r--r--package/libelf/Makefile34
-rw-r--r--package/libelf/ipkg/libelf.control4
-rw-r--r--package/libevent/Config.in17
-rw-r--r--package/libevent/Makefile27
-rw-r--r--package/libevent/ipkg/libevent.control4
-rw-r--r--package/libevent/patches/patch-Makefile_in45
-rw-r--r--package/libevent/patches/patch-evdns_c11
-rw-r--r--package/libevent/patches/patch-event_c18
-rw-r--r--package/libffi/Config.in12
-rw-r--r--package/libffi/Makefile26
-rw-r--r--package/libffi/ipkg/libffi.control4
-rw-r--r--package/libffi/patches/patch-Makefile_am11
-rw-r--r--package/libffi/patches/patch-include_Makefile_am10
-rw-r--r--package/libfontenc/Config.in8
-rw-r--r--package/libfontenc/Makefile26
-rw-r--r--package/libfontenc/ipkg/libfontenc.control4
-rw-r--r--package/libgcrypt/Config.in15
-rw-r--r--package/libgcrypt/Makefile28
-rw-r--r--package/libgcrypt/ipkg/libgcrypt.control6
-rw-r--r--package/libgd/Config.in11
-rw-r--r--package/libgd/Makefile32
-rw-r--r--package/libgd/ipkg/libgd.control5
-rw-r--r--package/libgd/patches/patch-Makefile_in29
-rw-r--r--package/libgdbm/Config.in9
-rw-r--r--package/libgdbm/Makefile33
-rw-r--r--package/libgdbm/ipkg/libgdbm.control4
-rw-r--r--package/libgpg-error/Config.in12
-rw-r--r--package/libgpg-error/Makefile30
-rw-r--r--package/libgpg-error/ipkg/libgpg-error.control4
-rw-r--r--package/libgssglue/Config.in6
-rw-r--r--package/libgssglue/Makefile26
-rw-r--r--package/libgssglue/ipkg/libgssglue.control4
-rw-r--r--package/libiconv/Config.in13
-rw-r--r--package/libiconv/Makefile33
-rw-r--r--package/libiconv/ipkg/libiconv.control4
-rw-r--r--package/libid3tag/Config.in13
-rw-r--r--package/libid3tag/Makefile32
-rw-r--r--package/libid3tag/files/id3tag.pc11
-rw-r--r--package/libid3tag/ipkg/libid3tag.control5
-rw-r--r--package/liblzo/Config.in9
-rw-r--r--package/liblzo/Makefile29
-rw-r--r--package/liblzo/ipkg/liblzo.control4
-rw-r--r--package/libmad/Config.in12
-rw-r--r--package/libmad/Makefile43
-rw-r--r--package/libmad/files/mad.pc11
-rw-r--r--package/libmad/ipkg/libmad.control4
-rw-r--r--package/libnet/Config.in12
-rw-r--r--package/libnet/Makefile36
-rw-r--r--package/libnet/ipkg/libnet.control5
-rw-r--r--package/libnet/patches/500-debian-subset.patch28584
-rw-r--r--package/libnfsidmap/Config.in6
-rw-r--r--package/libnfsidmap/Makefile29
-rw-r--r--package/libnfsidmap/ipkg/libnfsidmap.control4
-rw-r--r--package/libnids/Config.in11
-rw-r--r--package/libnids/Makefile29
-rw-r--r--package/libnids/ipkg/libnids.control5
-rw-r--r--package/libnids/patches/configure.patch73
-rw-r--r--package/libnids/patches/no_asm_for_i386.patch12
-rw-r--r--package/libnl/Config.in6
-rw-r--r--package/libnl/Makefile27
-rw-r--r--package/libnl/ipkg/libnl.control4
-rw-r--r--package/libnl/patches/patch-include_netlink-types_h19
-rw-r--r--package/libnl/patches/patch-include_netlink_genl_mngt_h19
-rw-r--r--package/libnl/patches/patch-src_nl-list-caches_c11
-rw-r--r--package/libnl/patches/patch-src_utils_c11
-rw-r--r--package/libnl/patches/patch-src_utils_h11
-rw-r--r--package/libogg/Config.in9
-rw-r--r--package/libogg/Makefile26
-rw-r--r--package/libogg/ipkg/libogg.control4
-rw-r--r--package/libol/Config.in8
-rw-r--r--package/libol/Makefile26
-rw-r--r--package/libol/ipkg/libol.control4
-rw-r--r--package/libosip2/Config.in9
-rw-r--r--package/libosip2/Makefile30
-rw-r--r--package/libosip2/ipkg/libosip2.control5
-rw-r--r--package/libowfat/Config.in4
-rw-r--r--package/libowfat/Makefile28
-rw-r--r--package/libowfat/patches/patch-GNUmakefile12
-rw-r--r--package/libp11/Config.in8
-rw-r--r--package/libp11/Makefile26
-rw-r--r--package/libp11/ipkg/libp11.control5
-rw-r--r--package/libpcap/Config.in9
-rw-r--r--package/libpcap/Makefile35
-rw-r--r--package/libpcap/ipkg/libpcap.control4
-rw-r--r--package/libpciaccess/Config.in6
-rw-r--r--package/libpciaccess/Makefile26
-rw-r--r--package/libpciaccess/ipkg/libpciaccess.control4
-rw-r--r--package/libpciaccess/patches/patch-configure_ac16
-rw-r--r--package/libpng/Config.in10
-rw-r--r--package/libpng/Makefile26
-rw-r--r--package/libpng/ipkg/libpng.control5
-rw-r--r--package/libpri/Config.in10
-rw-r--r--package/libpri/Makefile26
-rw-r--r--package/libpri/ipkg/libpri.control5
-rw-r--r--package/libpri/patches/patch-Makefile12
-rw-r--r--package/libpthread/Config.in7
-rw-r--r--package/libpthread/Makefile25
-rw-r--r--package/libpthread/ipkg/libpthread.control4
-rw-r--r--package/librpcsecgss/Config.in6
-rw-r--r--package/librpcsecgss/Makefile28
-rw-r--r--package/librpcsecgss/files/librpcsecgss.pc.in.gssglue12
-rw-r--r--package/librpcsecgss/files/librpcsecgss.pc.in.heimdal12
-rw-r--r--package/librpcsecgss/ipkg/librpcsecgss.control4
-rw-r--r--package/librpcsecgss/patches/patch-configure_in25
-rw-r--r--package/libshout/Config.in16
-rw-r--r--package/libshout/Makefile28
-rw-r--r--package/libshout/ipkg/libshout.control5
-rw-r--r--package/libsigc++/Config.in8
-rw-r--r--package/libsigc++/Makefile27
-rw-r--r--package/libsigc++/ipkg/libsigc++.control5
-rw-r--r--package/libsigc++/patches/patch-Makefile_in12
-rw-r--r--package/libstdcxx/Config.in7
-rw-r--r--package/libstdcxx/Makefile20
-rw-r--r--package/libstdcxx/ipkg/libstdcxx.control5
-rw-r--r--package/libtasn1/Config.in9
-rw-r--r--package/libtasn1/Makefile30
-rw-r--r--package/libtasn1/ipkg/libtasn1.control4
-rw-r--r--package/libtasn1/patches/patch-configure14
-rw-r--r--package/libthread_db/Config.in7
-rw-r--r--package/libthread_db/Makefile25
-rw-r--r--package/libthread_db/ipkg/libthread-db.control4
-rw-r--r--package/libtiff/Config.in8
-rw-r--r--package/libtiff/Makefile29
-rw-r--r--package/libtiff/ipkg/libtiff.control4
-rw-r--r--package/libtirpc/Config.in9
-rw-r--r--package/libtirpc/Makefile31
-rw-r--r--package/libtirpc/files/netconfig7
-rw-r--r--package/libtirpc/ipkg/libtirpc.control4
-rw-r--r--package/libtirpc/patches/patch-Makefile_am10
-rw-r--r--package/libtirpc/patches/patch-src_Makefile_am20
-rw-r--r--package/libtirpc/patches/patch-src_rpc_soc_c41
-rw-r--r--package/libtool/Config.in14
-rw-r--r--package/libtool/Makefile26
-rw-r--r--package/libtool/ipkg/libltdl.control4
-rw-r--r--package/libtool/patches/01-force_dlopen_deplibs.patch14
-rw-r--r--package/libtorrent/Config.in10
-rw-r--r--package/libtorrent/Makefile27
-rw-r--r--package/libtorrent/ipkg/libtorrent.control5
-rw-r--r--package/libtorrent/patches/patch-rak_functional_h11
-rw-r--r--package/libtorrent/patches/patch-src_data_chunk_cc11
-rw-r--r--package/libtorrent/patches/patch-src_data_chunk_list_h11
-rw-r--r--package/libtorrent/patches/patch-src_net_address_list_cc12
-rw-r--r--package/libtorrent/patches/patch-src_torrent_data_file_list_iterator_h11
-rw-r--r--package/libtorrent/patches/patch-src_torrent_exceptions_cc11
-rw-r--r--package/libtorrent/patches/patch-src_torrent_tracker_list_h11
-rw-r--r--package/libtorrent/patches/patch-src_utils_diffie_hellman_cc11
-rw-r--r--package/libupnp/Config.in13
-rw-r--r--package/libupnp/Makefile31
-rw-r--r--package/libupnp/ipkg/libupnp.control5
-rw-r--r--package/libupnp/patches/patch-configure_ac11
-rw-r--r--package/libusb/Config.in9
-rw-r--r--package/libusb/Makefile27
-rw-r--r--package/libusb/ipkg/libusb.control4
-rw-r--r--package/libusb/patches/no-libusbpp.patch114
-rw-r--r--package/libvorbis/Config.in20
-rw-r--r--package/libvorbis/Makefile34
-rw-r--r--package/libvorbis/ipkg/libvorbis.control4
-rw-r--r--package/libvorbis/ipkg/libvorbisenc.control4
-rw-r--r--package/libvorbis/patches/patch-Makefile_in12
-rw-r--r--package/libvorbisidec/Config.in12
-rw-r--r--package/libvorbisidec/Makefile32
-rw-r--r--package/libvorbisidec/ipkg/libvorbisidec.control4
-rw-r--r--package/libxkbfile/Config.in6
-rw-r--r--package/libxkbfile/Makefile26
-rw-r--r--package/libxkbfile/ipkg/libxkbfile.control4
-rw-r--r--package/libxml2/Config.in11
-rw-r--r--package/libxml2/Makefile55
-rw-r--r--package/libxml2/ipkg/libxml2.control5
-rw-r--r--package/libxslt/Config.in10
-rw-r--r--package/libxslt/Makefile35
-rw-r--r--package/libxslt/ipkg/libxslt.control5
-rw-r--r--package/lighttpd/Config.in113
-rw-r--r--package/lighttpd/Makefile104
-rw-r--r--package/lighttpd/files/lighttpd.conf217
-rw-r--r--package/lighttpd/files/lighttpd.init25
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-accesslog.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-alias.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-auth.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-cgi.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-evasive.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-expire.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-fastcgi.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-proxy.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-redirect.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-rewrite.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-setenv.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-simple-vhost.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-ssi.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-status.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-usertrack.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd-mod-webdav.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd.conffiles1
-rw-r--r--package/lighttpd/ipkg/lighttpd.control5
-rw-r--r--package/lighttpd/ipkg/lighttpd.postinst4
-rw-r--r--package/lighttpd/patches/500-configure_cross.patch24
-rw-r--r--package/links/Config.in10
-rw-r--r--package/links/Makefile33
-rw-r--r--package/links/ipkg/links.control4
-rw-r--r--package/linux-atm/Config.in20
-rw-r--r--package/linux-atm/Makefile33
-rw-r--r--package/linux-atm/files/br2684.hotplug19
-rw-r--r--package/linux-atm/ipkg/br2684ctl.control4
-rw-r--r--package/linux-atm/ipkg/linux-atm.control4
-rw-r--r--package/linux-atm/patches/000-debian_16.patch35073
-rw-r--r--package/linux-atm/patches/010-header_stupidity.patch13
-rw-r--r--package/linux-atm/patches/100-br2684.patch488
-rw-r--r--package/linux-atm/patches/200-no_libfl.patch193
-rw-r--r--package/linux-atm/patches/300-no_autotools.patch22686
-rw-r--r--package/logrotate/Config.in10
-rw-r--r--package/logrotate/Makefile29
-rw-r--r--package/logrotate/files/logrotate.conf30
-rw-r--r--package/logrotate/ipkg/logrotate.control6
-rw-r--r--package/logrotate/patches/patch-Makefile21
-rw-r--r--package/logrotate/patches/patch-config_c59
-rw-r--r--package/logrotate/patches/patch-logrotate_828
-rw-r--r--package/logrotate/patches/patch-logrotate_c429
-rw-r--r--package/logrotate/patches/patch-logrotate_h19
-rw-r--r--package/lrzsz/Config.in11
-rw-r--r--package/lrzsz/Makefile35
-rw-r--r--package/lrzsz/ipkg/lrzsz.control5
-rw-r--r--package/ltp/Config.in16
-rw-r--r--package/ltp/Makefile30
-rw-r--r--package/ltp/ipkg/ltp.control4
-rw-r--r--package/ltp/patches/patch-Makefile20
-rw-r--r--package/ltp/patches/patch-runltp22
-rw-r--r--package/ltp/patches/patch-testcases_kernel_syscalls_Makefile13
-rw-r--r--package/ltp/patches/patch-testcases_misc_math_Makefile10
-rw-r--r--package/ltp/patches/patch-testcases_misc_math_float_Makefile18
-rw-r--r--package/lua/Config.in111
-rw-r--r--package/lua/Makefile62
-rw-r--r--package/lua/ipkg/liblua.control4
-rw-r--r--package/lua/ipkg/lua-examples.control5
-rw-r--r--package/lua/ipkg/lua.control5
-rw-r--r--package/lua/ipkg/luac.control5
-rw-r--r--package/lua/patches/lua-5.0.2-config.patch31
-rw-r--r--package/lua/patches/lua-5.0.2-soname.patch14
-rw-r--r--package/lvm/Config.in6
-rw-r--r--package/lvm/Makefile34
-rw-r--r--package/lvm/ipkg/lvm.control4
-rw-r--r--package/lvm/patches/patch-tools_Makefile_in29
-rw-r--r--package/lynx/Config.in11
-rw-r--r--package/lynx/Makefile103
-rw-r--r--package/lynx/ipkg/lynx.control5
-rw-r--r--package/lynx/patches/patch-config_hin17
-rw-r--r--package/lynx/patches/patch-lynx_cfg236
-rw-r--r--package/lynx/patches/patch-makefile_in22
-rw-r--r--package/lynx/patches/patch-samples_lynx_lss15
-rw-r--r--package/lynx/patches/patch-src_LYUtils_c15
-rw-r--r--package/lynx/patches/patch-userdefs_h65
-rw-r--r--package/mac80211/Config.in28
-rw-r--r--package/mac80211/Makefile108
-rw-r--r--package/mac80211/ipkg/kmod-mac80211-ath5k.control4
-rw-r--r--package/mac80211/ipkg/kmod-mac80211-rt61.control4
-rw-r--r--package/mac80211/ipkg/kmod-mac80211.control4
-rw-r--r--package/macchanger/Config.in8
-rwxr-xr-xpackage/macchanger/Makefile25
-rwxr-xr-xpackage/macchanger/ipkg/macchanger.control6
-rw-r--r--package/madplay/Config.in12
-rw-r--r--package/madplay/Makefile38
-rw-r--r--package/madplay/ipkg/madplay.control6
-rw-r--r--package/maradns/Config.in10
-rw-r--r--package/maradns/Makefile42
-rw-r--r--package/maradns/files/maradns.init29
-rw-r--r--package/maradns/files/mararc15
-rw-r--r--package/maradns/files/sample.ptr11
-rw-r--r--package/maradns/files/sample.zone24
-rw-r--r--package/maradns/ipkg/maradns.conffiles1
-rw-r--r--package/maradns/ipkg/maradns.control8
-rw-r--r--package/maradns/ipkg/maradns.postinst3
-rw-r--r--package/maradns/patches/cross-compile-fix.patch12
-rw-r--r--package/mc/Config.in9
-rw-r--r--package/mc/Makefile50
-rw-r--r--package/mc/ipkg/mc.control5
-rw-r--r--package/mc/patches/patch-lib_mc_ext_in92
-rw-r--r--package/mc/patches/patch-lib_mc_lib378
-rw-r--r--package/mc/patches/patch-lib_mc_menu17
-rw-r--r--package/mc/patches/patch-src_key_c13
-rw-r--r--package/mc/patches/patch-src_main_c13
-rw-r--r--package/mc/patches/patch-vfs_extfs_iso9660_in31
-rw-r--r--package/mgetty/Config.in7
-rw-r--r--package/mgetty/Makefile113
-rw-r--r--package/mgetty/ipkg/mgetty.control4
-rw-r--r--package/mgetty/patches/mgetty.patch98
-rw-r--r--package/miau/Config.in12
-rw-r--r--package/miau/Makefile35
-rwxr-xr-xpackage/miau/files/miau.init28
-rw-r--r--package/miau/files/miaurc587
-rw-r--r--package/miau/ipkg/miau.conffiles1
-rw-r--r--package/miau/ipkg/miau.control6
-rw-r--r--package/miau/ipkg/miau.postinst4
-rw-r--r--package/miax/Config.in12
-rw-r--r--package/miax/Makefile30
-rw-r--r--package/miax/ipkg/miax.control5
-rw-r--r--package/miax/patches/01-cross.patch24
-rw-r--r--package/microperl/Config.in7
-rw-r--r--package/microperl/Makefile31
-rw-r--r--package/microperl/ipkg/microperl.control4
-rw-r--r--package/mini_httpd/Config.in66
-rw-r--r--package/mini_httpd/Makefile63
-rw-r--r--package/mini_httpd/files/mini_httpd-ssl.conf7
-rw-r--r--package/mini_httpd/files/mini_httpd.conf5
-rw-r--r--package/mini_httpd/files/mini_httpd.init25
-rw-r--r--package/mini_httpd/files/mini_httpd.pem29
-rw-r--r--package/mini_httpd/ipkg/mini-httpd-htpasswd.control4
-rw-r--r--package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles2
-rw-r--r--package/mini_httpd/ipkg/mini-httpd-matrixssl.control5
-rw-r--r--package/mini_httpd/ipkg/mini-httpd-matrixssl.postinst3
-rw-r--r--package/mini_httpd/ipkg/mini-httpd-openssl.conffiles2
-rw-r--r--package/mini_httpd/ipkg/mini-httpd-openssl.control5
-rw-r--r--package/mini_httpd/ipkg/mini-httpd-openssl.postinst3
-rw-r--r--package/mini_httpd/ipkg/mini-httpd.conffiles1
-rw-r--r--package/mini_httpd/ipkg/mini-httpd.control5
-rw-r--r--package/mini_httpd/ipkg/mini-httpd.postinst3
-rw-r--r--package/mini_httpd/patches/patch-Makefile78
-rw-r--r--package/mini_httpd/patches/patch-mini_httpd_c96
-rw-r--r--package/mini_sendmail/Config.in12
-rw-r--r--package/mini_sendmail/Makefile29
-rw-r--r--package/mini_sendmail/ipkg/mini-sendmail.control4
-rw-r--r--package/mini_sendmail/patches/500-flags.patch15
-rw-r--r--package/miredo/Config.in35
-rw-r--r--package/miredo/Makefile55
-rw-r--r--package/miredo/files/miredo-server.init25
-rw-r--r--package/miredo/files/miredo.init25
-rw-r--r--package/miredo/ipkg/miredo-server.control5
-rw-r--r--package/miredo/ipkg/miredo-server.postinst3
-rw-r--r--package/miredo/ipkg/miredo.conffiles1
-rw-r--r--package/miredo/ipkg/miredo.control5
-rw-r--r--package/miredo/ipkg/miredo.postinst3
-rw-r--r--package/miredo/patches/patch-libteredo_maintain_c19
-rw-r--r--package/mksh/Config.in31
-rw-r--r--package/mksh/Makefile34
-rw-r--r--package/mksh/ipkg/mksh.conffiles1
-rw-r--r--package/mksh/ipkg/mksh.control4
-rw-r--r--package/mksh/patches/patch-dot_mkshrc36
-rw-r--r--package/moc/Config.in13
-rw-r--r--package/moc/Makefile35
-rw-r--r--package/moc/ipkg/moc.control5
-rw-r--r--package/monit/Config.in17
-rw-r--r--package/monit/Makefile40
-rw-r--r--package/monit/files/monit.init20
-rw-r--r--package/monit/ipkg/monit-nossl.conffiles1
-rw-r--r--package/monit/ipkg/monit-nossl.control5
-rw-r--r--package/monit/ipkg/monit.conffiles1
-rw-r--r--package/monit/ipkg/monit.control4
-rw-r--r--package/motion/Config.in10
-rw-r--r--package/motion/Makefile30
-rw-r--r--package/motion/ipkg/motion.control5
-rw-r--r--package/motion/patches/01-ffmpeg.patch38
-rw-r--r--package/motion/patches/02-honor_cppflags.patch20
-rw-r--r--package/mpd/Config.in96
-rw-r--r--package/mpd/Makefile94
-rw-r--r--package/mpd/files/mpd.conf18
-rw-r--r--package/mpd/files/mpd.init26
-rw-r--r--package/mpd/ipkg/mpd.conffiles1
-rw-r--r--package/mpd/ipkg/mpd.control5
-rw-r--r--package/mpd/ipkg/mpd.postinst6
-rw-r--r--package/mpfr/Config.in6
-rw-r--r--package/mpfr/Makefile19
-rw-r--r--package/mpfr/ipkg/mpfr.control4
-rw-r--r--package/mplayer/Config.in16
-rw-r--r--package/mplayer/Makefile86
-rw-r--r--package/mplayer/ipkg/mplayer.control5
-rw-r--r--package/mplayer/patches/patch-configure39
-rw-r--r--package/mplayer/patches/patch-loader_win32_c11
-rw-r--r--package/mrd6/Config.in15
-rw-r--r--package/mrd6/Makefile31
-rw-r--r--package/mrd6/files/mrd6.conf14
-rw-r--r--package/mrd6/files/mrd6.init25
-rw-r--r--package/mrd6/ipkg/mrd6.control6
-rw-r--r--package/mrd6/ipkg/mrd6.postinst3
-rw-r--r--package/mrd6/patches/patch-src_Makefile75
-rw-r--r--package/mt-daapd/Config.in31
-rw-r--r--package/mt-daapd/Makefile40
-rw-r--r--package/mt-daapd/files/mt-daapd.init26
-rw-r--r--package/mt-daapd/ipkg/mt-daapd.conffiles2
-rw-r--r--package/mt-daapd/ipkg/mt-daapd.control5
-rw-r--r--package/mt-daapd/ipkg/mt-daapd.postinst3
-rw-r--r--package/mtr/Config.in18
-rw-r--r--package/mtr/Makefile28
-rw-r--r--package/mtr/ipkg/mtr.control15
-rw-r--r--package/mtr/patches/501-dns.patch511
-rw-r--r--package/mtr/patches/patch-Makefile763
-rw-r--r--package/mtr/patches/patch-curses_c21
-rw-r--r--package/mtr/patches/patch-report_c30
-rw-r--r--package/mutt/Config.in11
-rw-r--r--package/mutt/Makefile39
-rw-r--r--package/mutt/ipkg/mutt.control5
-rw-r--r--package/mutt/patches/patch-Makefile_in21
-rw-r--r--package/mysql/Config.in19
-rw-r--r--package/mysql/Makefile84
-rw-r--r--package/mysql/ipkg/libmysqlclient.control5
-rw-r--r--package/mysql/patches/patch-configure743
-rw-r--r--package/mysql/patches/patch-include_my_global_h59
-rw-r--r--package/nano/Config.in18
-rw-r--r--package/nano/Makefile48
-rw-r--r--package/nano/files/nanorc1
-rw-r--r--package/nano/ipkg/nano.conffiles1
-rw-r--r--package/nano/ipkg/nano.control5
-rw-r--r--package/ncurses/Config.in16
-rw-r--r--package/ncurses/Makefile70
-rw-r--r--package/ncurses/ipkg/libncurses.control4
-rw-r--r--package/ncurses/patches/patch-misc_run_tic_in12
-rw-r--r--package/ndisc/Config.in45
-rw-r--r--package/ndisc/Makefile35
-rw-r--r--package/ndisc/extra/rdnssd/strverscmp.c131
-rw-r--r--package/ndisc/ipkg/ndisc6.control4
-rw-r--r--package/ndisc/ipkg/rdisc6.control4
-rw-r--r--package/ndisc/ipkg/tcptraceroute6.control4
-rw-r--r--package/ndisc/patches/patch-rdnssd_Makefile_am13
-rw-r--r--package/ndisc/patches/patch-rdnssd_Makefile_in30
-rw-r--r--package/ndisc/patches/patch-rdnssd_icmp_c20
-rw-r--r--package/ndisc/patches/patch-rdnssd_rdnssd_c78
-rw-r--r--package/ndisc/patches/patch-rdnssd_rdnssd_c.orig61
-rw-r--r--package/ndisc/patches/patch-src_addrinfo_c21
-rw-r--r--package/ndisc/patches/patch-src_ndisc_c35
-rw-r--r--package/ndisc/patches/patch-src_ndisc_c.orig20
-rw-r--r--package/ndisc/patches/patch-src_tcpspray_c48
-rw-r--r--package/ndisc/patches/patch-src_tcpspray_c.orig31
-rw-r--r--package/ndisc/patches/patch-src_tcptraceroute_c20
-rw-r--r--package/ndisc/patches/patch-src_trace-tcp_c11
-rw-r--r--package/ndisc/patches/patch-src_trace-udp_c11
-rw-r--r--package/ndisc/patches/patch-src_traceroute_c128
-rw-r--r--package/ndisc/patches/patch-src_traceroute_c.orig128
-rw-r--r--package/ndisc/patches/patch-src_traceroute_h26
-rw-r--r--package/ndisc/patches/patch-src_traceroute_h.orig26
-rw-r--r--package/neon/Config.in31
-rw-r--r--package/neon/Makefile29
-rw-r--r--package/neon/ipkg/neon.control5
-rw-r--r--package/net-snmp/Config.in52
-rw-r--r--package/net-snmp/Makefile117
-rw-r--r--package/net-snmp/files/snmpd.conf14
-rw-r--r--package/net-snmp/files/snmpd.default1
-rw-r--r--package/net-snmp/files/snmpd.init27
-rw-r--r--package/net-snmp/ipkg/libnetsnmp.control4
-rw-r--r--package/net-snmp/ipkg/snmp-utils.control5
-rw-r--r--package/net-snmp/ipkg/snmpd.conffiles1
-rw-r--r--package/net-snmp/ipkg/snmpd.control5
-rw-r--r--package/net-snmp/ipkg/snmpd.postinst3
-rw-r--r--package/netperf/Config.in6
-rw-r--r--package/netperf/Makefile34
-rw-r--r--package/netperf/files/netserver.init26
-rw-r--r--package/netperf/ipkg/netperf.control4
-rw-r--r--package/netperf/ipkg/netperf.postinst3
-rw-r--r--package/netperf/patches/01-netperf-2.3pl1-openwrt.patch39
-rw-r--r--package/netstat-nat/Config.in13
-rw-r--r--package/netstat-nat/Makefile26
-rw-r--r--package/netstat-nat/ipkg/netstat-nat.control7
-rw-r--r--package/nfs-utils/Config.in43
-rw-r--r--package/nfs-utils/Makefile77
-rw-r--r--package/nfs-utils/files/idmapd.conf14
-rw-r--r--package/nfs-utils/files/nfsd.exports10
-rw-r--r--package/nfs-utils/files/nfsd.init48
-rw-r--r--package/nfs-utils/files/rpc3
-rw-r--r--package/nfs-utils/ipkg/nfs-utils.control4
-rw-r--r--package/nfs-utils/ipkg/nfs-utils.postinst9
-rw-r--r--package/nfs-utils/patches/patch-aclocal_kerberos5_m4138
-rw-r--r--package/nfs-utils/patches/patch-support_nfs_nfs_mntent_c30
-rw-r--r--package/nfs-utils/patches/patch-tools_Makefile_am11
-rw-r--r--package/nfs-utils/patches/patch-tools_Makefile_in21
-rw-r--r--package/nfs-utils/patches/patch-utils_mount_error_c12
-rw-r--r--package/nfs-utils/patches/patch-utils_mountd_cache_c75
-rw-r--r--package/nfs-utils/patches/patch-utils_mountd_fsloc_c12
-rw-r--r--package/nmap/Config.in30
-rw-r--r--package/nmap/Makefile50
-rw-r--r--package/nmap/ipkg/nmap.control4
-rw-r--r--package/nmap/patches/patch-configure99
-rw-r--r--package/nmap/patches/patch-nmap_dns_h13
-rw-r--r--package/nmap/patches/patch-output_cc12
-rw-r--r--package/nmap/patches/patch-traceroute_cc16
-rw-r--r--package/nocatsplash/Config.in12
-rw-r--r--package/nocatsplash/Makefile30
-rw-r--r--package/nocatsplash/ipkg/nocatsplash.conffiles1
-rw-r--r--package/nocatsplash/ipkg/nocatsplash.control10
-rw-r--r--package/nocatsplash/patches/openwrt-firewall.patch19
-rw-r--r--package/ntfs-3g/Config.in6
-rw-r--r--package/ntfs-3g/Makefile32
-rw-r--r--package/ntfs-3g/ipkg/kmod-fs-ntfs-3g.control4
-rw-r--r--package/ntpclient/Config.in10
-rw-r--r--package/ntpclient/Makefile28
-rw-r--r--package/ntpclient/ipkg/ntpclient.control4
-rw-r--r--package/ntpclient/patches/patch-ntpclient_c21
-rw-r--r--package/nut/Config.in239
-rw-r--r--package/nut/Makefile117
-rw-r--r--package/nut/files/ups.conf104
-rw-r--r--package/nut/files/upsd.conf42
-rw-r--r--package/nut/files/upsd.init30
-rw-r--r--package/nut/ipkg/nut.conffiles2
-rw-r--r--package/nut/ipkg/nut.control4
-rw-r--r--package/nut/ipkg/nut.postinst4
-rw-r--r--package/obexftp/Config.in8
-rw-r--r--package/obexftp/Makefile33
-rw-r--r--package/obexftp/ipkg/obexftp.control5
-rw-r--r--package/olsrd/Config.in36
-rw-r--r--package/olsrd/Makefile58
-rw-r--r--package/olsrd/files/olsrd.init22
-rw-r--r--package/olsrd/files/olsrd_secure_key1
-rw-r--r--package/olsrd/ipkg/olsrd-mod-dot-draw.control5
-rw-r--r--package/olsrd/ipkg/olsrd-mod-dyn-gw.control5
-rw-r--r--package/olsrd/ipkg/olsrd-mod-httpinfo.control5
-rw-r--r--package/olsrd/ipkg/olsrd-mod-nameservice.control5
-rw-r--r--package/olsrd/ipkg/olsrd-mod-power.control5
-rw-r--r--package/olsrd/ipkg/olsrd-mod-secure.conffiles1
-rw-r--r--package/olsrd/ipkg/olsrd-mod-secure.control5
-rw-r--r--package/olsrd/ipkg/olsrd-mod-tas.control5
-rw-r--r--package/olsrd/ipkg/olsrd.conffiles1
-rw-r--r--package/olsrd/ipkg/olsrd.control8
-rw-r--r--package/olsrd/ipkg/olsrd.postinst3
-rw-r--r--package/olsrd/patches/patch-make_Makefile_linux12
-rw-r--r--package/opencdk/Config.in21
-rw-r--r--package/opencdk/Makefile33
-rw-r--r--package/opencdk/ipkg/libopencdk.control5
-rw-r--r--package/opencdk/patches/patch-configure14
-rw-r--r--package/openct/Config.in8
-rw-r--r--package/openct/Makefile39
-rw-r--r--package/openct/ipkg/openct.control5
-rw-r--r--package/openldap/Config.in33
-rw-r--r--package/openldap/Config.in.lib15
-rw-r--r--package/openldap/Makefile82
-rw-r--r--package/openldap/files/slapd.conf30
-rw-r--r--package/openldap/files/slapd.init28
-rw-r--r--package/openldap/ipkg/libopenldap.conffiles1
-rw-r--r--package/openldap/ipkg/libopenldap.control5
-rw-r--r--package/openldap/ipkg/openldap-slapd.control5
-rw-r--r--package/openldap/ipkg/openldap-slapd.postinst5
-rw-r--r--package/openldap/ipkg/openldap-utils.control5
-rw-r--r--package/openntpd/Config.in9
-rw-r--r--package/openntpd/Makefile35
-rw-r--r--package/openntpd/extra/openbsd-compat/port-linux.c107
-rw-r--r--package/openntpd/files/ntpd.conf8
-rw-r--r--package/openntpd/files/ntpd.init27
-rw-r--r--package/openntpd/ipkg/openntpd.conffiles1
-rw-r--r--package/openntpd/ipkg/openntpd.control7
-rw-r--r--package/openntpd/ipkg/openntpd.postinst7
-rw-r--r--package/openntpd/patches/patch-client_c17
-rw-r--r--package/openntpd/patches/patch-configure_ac18
-rw-r--r--package/openntpd/patches/patch-defines_h17
-rw-r--r--package/openntpd/patches/patch-ntpd_h47
-rw-r--r--package/openntpd/patches/patch-openbsd-compat_Makefile_in15
-rw-r--r--package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h18
-rw-r--r--package/openobex/Config.in9
-rw-r--r--package/openobex/Makefile27
-rw-r--r--package/openobex/ipkg/openobex.control4
-rw-r--r--package/opensc/Config.in6
-rw-r--r--package/opensc/Makefile33
-rw-r--r--package/opensc/ipkg/opensc.control4
-rw-r--r--package/opensc/patches/patch-src_Makefile_in14
-rw-r--r--package/opensips/Config.in196
-rw-r--r--package/opensips/Makefile111
-rw-r--r--package/opensips/files/opensips.cfg174
-rw-r--r--package/opensips/files/opensips.init26
-rw-r--r--package/opensips/ipkg/opensips-mod-acc.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-auth-db.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-auth-radius.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-auth.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-avp-radius.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-avp_radius.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-avpops.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-dispatcher.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-diversion.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-flatstore.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-gflags.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-group-radius.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-group.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-group_radius.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-lcr.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-mediaproxy.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-msilo.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-mysql.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-nathelper.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-options.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-pdt.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-permissions.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-pike.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-sms.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-speeddial.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uac-redirect.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uac.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uac_redirect.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uri-db.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uri-radius.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uri.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uri_db.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-uri_radius.control5
-rw-r--r--package/opensips/ipkg/opensips-mod-xlog.control5
-rw-r--r--package/opensips/ipkg/opensips.conffiles1
-rw-r--r--package/opensips/ipkg/opensips.control4
-rw-r--r--package/opensips/ipkg/opensips.postinst3
-rw-r--r--package/openssh/Config.in140
-rw-r--r--package/openssh/Makefile83
-rw-r--r--package/openssh/files/sshd.init47
-rw-r--r--package/openssh/files/sshd_config113
-rw-r--r--package/openssh/ipkg/openssh-client-utils.control5
-rw-r--r--package/openssh/ipkg/openssh-client.conffiles1
-rw-r--r--package/openssh/ipkg/openssh-client.control5
-rw-r--r--package/openssh/ipkg/openssh-server.conffiles1
-rw-r--r--package/openssh/ipkg/openssh-server.control4
-rw-r--r--package/openssh/ipkg/openssh-server.postinst5
-rw-r--r--package/openssh/ipkg/openssh-sftp-client.control5
-rw-r--r--package/openssh/ipkg/openssh-sftp-server.control5
-rw-r--r--package/openssh/patches/patch-cipher_c35
-rw-r--r--package/openssh/patches/patch-configure12
-rw-r--r--package/openssh/patches/patch-mac_c14
-rw-r--r--package/openssh/patches/patch-myproposal_h45
-rw-r--r--package/openssh/patches/patch-openbsd-compat_port-tun_c12
-rw-r--r--package/openssl-pkcs11/Config.in7
-rw-r--r--package/openssl-pkcs11/Makefile31
-rw-r--r--package/openssl-pkcs11/ipkg/openssl-pkcs11.control4
-rw-r--r--package/openssl-pkcs11/patches/patch-configure60
-rw-r--r--package/openssl/Config.in41
-rw-r--r--package/openssl/Makefile70
-rw-r--r--package/openssl/cert.pem4625
-rw-r--r--package/openssl/ipkg/ca-certificates.conffiles1
-rw-r--r--package/openssl/ipkg/ca-certificates.control4
-rw-r--r--package/openssl/ipkg/libopenssl.control5
-rw-r--r--package/openssl/ipkg/openssl-util.conffiles1
-rw-r--r--package/openssl/ipkg/openssl-util.control5
-rw-r--r--package/openssl/patches/ocf.patch1197
-rw-r--r--package/openssl/patches/patch-Configure11
-rw-r--r--package/openssl/patches/patch-Makefile_shared19
-rw-r--r--package/openssl/patches/patch-apps_speed_c16
-rw-r--r--package/openssl/patches/patch-util_shlib_wrap_sh17
-rw-r--r--package/openswan/Config.in10
-rw-r--r--package/openswan/Makefile59
-rw-r--r--package/openswan/files/openswan.init27
-rw-r--r--package/openswan/ipkg/openswan.conffiles1
-rw-r--r--package/openswan/ipkg/openswan.control5
-rw-r--r--package/openswan/ipkg/openswan.postinst3
-rw-r--r--package/openswan/patches/patch-lib_libdns_Makefile10
-rw-r--r--package/openswan/patches/patch-lib_libopenswan_alg_info_c12
-rw-r--r--package/openswan/patches/patch-programs_ikeping_ikeping_c12
-rw-r--r--package/openvpn/Config.in64
-rw-r--r--package/openvpn/Makefile86
-rw-r--r--package/openvpn/files/openvpn.conf11
-rw-r--r--package/openvpn/files/openvpn.init29
-rw-r--r--package/openvpn/files/serial1
-rw-r--r--package/openvpn/ipkg/openvpn-easy-rsa.control5
-rw-r--r--package/openvpn/ipkg/openvpn.control4
-rw-r--r--package/openvpn/ipkg/openvpn.postinst3
-rw-r--r--package/openvpn/patches/easy-rsa.patch218
-rw-r--r--package/oprofile/Config.in9
-rw-r--r--package/oprofile/Makefile28
-rw-r--r--package/oprofile/ipkg/oprofile.control5
-rw-r--r--package/osiris/Config.in18
-rw-r--r--package/osiris/Makefile42
-rw-r--r--package/osiris/files/osirisd.init27
-rw-r--r--package/osiris/ipkg/osirisd.control5
-rw-r--r--package/osiris/ipkg/osirisd.postinst3
-rw-r--r--package/osiris/patches/patch-configure32
-rw-r--r--package/osiris/patches/patch-src_libosiris_Makefile_in41
-rw-r--r--package/osiris/patches/patch-src_libosiris_configuration_c27
-rw-r--r--package/osiris/patches/patch-src_libosiris_configuration_h13
-rw-r--r--package/osiris/patches/patch-src_libosiris_filter_c35
-rw-r--r--package/osiris/patches/patch-src_libosiris_filter_h23
-rw-r--r--package/osiris/patches/patch-src_libosiris_ssl_utilities_c30
-rw-r--r--package/osiris/patches/patch-src_libosiris_ssl_utilities_h14
-rw-r--r--package/osiris/patches/patch-src_libosiris_utilities_c13
-rw-r--r--package/osiris/patches/patch-src_osirisd_scanner_c33
-rw-r--r--package/osiris/patches/patch-src_osirismd_md_control_c16
-rw-r--r--package/owfs/Config.in13
-rw-r--r--package/owfs/Makefile38
-rw-r--r--package/owfs/ipkg/owfs.control5
-rw-r--r--package/p910nd/Config.in15
-rw-r--r--package/p910nd/Makefile31
-rw-r--r--package/p910nd/files/p910nd.init26
-rw-r--r--package/p910nd/ipkg/p910nd.control4
-rw-r--r--package/p910nd/ipkg/p910nd.postinst4
-rw-r--r--package/p910nd/patches/100-Makefile.patch15
-rw-r--r--package/p910nd/patches/200-p910nd-0.7.patch309
-rw-r--r--package/palantir/Config.in12
-rw-r--r--package/palantir/Makefile37
-rw-r--r--package/palantir/ipkg/palantir.conffiles1
-rw-r--r--package/palantir/ipkg/palantir.control5
-rw-r--r--package/parprouted/Config.in13
-rw-r--r--package/parprouted/Makefile30
-rwxr-xr-xpackage/parprouted/files/parprouted.default1
-rw-r--r--package/parprouted/files/parprouted.init26
-rw-r--r--package/parprouted/ipkg/parprouted.control5
-rw-r--r--package/parprouted/ipkg/parprouted.postinst4
-rw-r--r--package/parprouted/patches/parprouted.patch33
-rw-r--r--package/pciutils/Config.in8
-rw-r--r--package/pciutils/Makefile31
-rw-r--r--package/pciutils/ipkg/pciutils.control4
-rw-r--r--package/pciutils/patches/patch-lib_configure11
-rw-r--r--package/pcre/Config.in15
-rw-r--r--package/pcre/Makefile37
-rw-r--r--package/pcre/ipkg/libpcre.control4
-rw-r--r--package/php/Config.in115
-rw-r--r--package/php/Makefile167
-rw-r--r--package/php/files/php.ini561
-rw-r--r--package/php/files/php.init28
-rw-r--r--package/php/ipkg/php-cgi.conffiles1
-rw-r--r--package/php/ipkg/php-cgi.control6
-rw-r--r--package/php/ipkg/php-cli.conffiles1
-rw-r--r--package/php/ipkg/php-cli.control6
-rw-r--r--package/php/ipkg/php-fastcgi.conffiles1
-rw-r--r--package/php/ipkg/php-fastcgi.control6
-rw-r--r--package/php/ipkg/php-fastcgi.postinst4
-rw-r--r--package/php/ipkg/php-mod-curl.control5
-rw-r--r--package/php/ipkg/php-mod-ftp.control5
-rw-r--r--package/php/ipkg/php-mod-gd.control5
-rw-r--r--package/php/ipkg/php-mod-gmp.control5
-rw-r--r--package/php/ipkg/php-mod-ldap.control5
-rw-r--r--package/php/ipkg/php-mod-mysql.control5
-rw-r--r--package/php/ipkg/php-mod-openssl.control5
-rw-r--r--package/php/ipkg/php-mod-pcre.control5
-rw-r--r--package/php/ipkg/php-mod-pgsql.control5
-rw-r--r--package/php/ipkg/php-mod-session.control5
-rw-r--r--package/php/ipkg/php-mod-sockets.control5
-rw-r--r--package/php/ipkg/php-mod-sqlite.control5
-rw-r--r--package/php/ipkg/php-mod-xml.control5
-rw-r--r--package/picocom/Config.in15
-rw-r--r--package/picocom/Makefile25
-rw-r--r--package/picocom/ipkg/picocom.control4
-rw-r--r--package/pipacs/Config.in7
-rw-r--r--package/pipacs/Makefile29
-rw-r--r--package/pipacs/ipkg/pipacs.control5
-rw-r--r--package/pipacs/src/Makefile15
-rw-r--r--package/pipacs/src/parser.c907
-rw-r--r--package/pipacs/src/parser.h60
-rw-r--r--package/pipacs/src/pipacs.c589
-rw-r--r--package/pixman/Config.in6
-rw-r--r--package/pixman/Makefile26
-rw-r--r--package/pixman/ipkg/pixman.control4
-rw-r--r--package/pmacct/Config.in200
-rw-r--r--package/pmacct/Makefile171
-rw-r--r--package/pmacct/files/nfacctd.conf28
-rw-r--r--package/pmacct/files/nfacctd.init25
-rw-r--r--package/pmacct/files/pmacctd.conf26
-rw-r--r--package/pmacct/files/pmacctd.init25
-rw-r--r--package/pmacct/ipkg/nfacctd-custom.control6
-rw-r--r--package/pmacct/ipkg/nfacctd-mysql.control6
-rw-r--r--package/pmacct/ipkg/nfacctd-pgsql.control6
-rw-r--r--package/pmacct/ipkg/nfacctd-sqlite.control6
-rw-r--r--package/pmacct/ipkg/nfacctd.conffiles1
-rw-r--r--package/pmacct/ipkg/nfacctd.control6
-rw-r--r--package/pmacct/ipkg/nfacctd.postinst4
-rw-r--r--package/pmacct/ipkg/pmacct-client.control5
-rw-r--r--package/pmacct/ipkg/pmacctd-custom.control6
-rw-r--r--package/pmacct/ipkg/pmacctd-mysql.control6
-rw-r--r--package/pmacct/ipkg/pmacctd-pgsql.control6
-rw-r--r--package/pmacct/ipkg/pmacctd-sqlite.control6
-rw-r--r--package/pmacct/ipkg/pmacctd.conffiles1
-rw-r--r--package/pmacct/ipkg/pmacctd.control6
-rw-r--r--package/pmacct/ipkg/pmacctd.postinst4
-rw-r--r--package/popt/Config.in14
-rw-r--r--package/popt/Makefile26
-rw-r--r--package/popt/ipkg/libpopt.control4
-rw-r--r--package/portmap/Config.in14
-rw-r--r--package/portmap/Makefile40
-rw-r--r--package/portmap/files/portmap.init27
-rw-r--r--package/portmap/ipkg/portmap.control4
-rw-r--r--package/portmap/ipkg/portmap.postinst5
-rw-r--r--package/portmap/patches/patch-pmap_check_c16
-rw-r--r--package/portsentry/Config.in9
-rw-r--r--package/portsentry/Makefile30
-rw-r--r--package/portsentry/ipkg/portsentry.conffiles1
-rw-r--r--package/portsentry/ipkg/portsentry.control4
-rw-r--r--package/portsentry/patches/100-conf_location.patch11
-rw-r--r--package/portsentry/patches/101-postsentry_c.patch12
-rw-r--r--package/postgresql/Config.in31
-rw-r--r--package/postgresql/Makefile62
-rw-r--r--package/postgresql/ipkg/libpq.control4
-rw-r--r--package/postgresql/ipkg/pgsql-cli.control5
-rw-r--r--package/ppp/Config.in52
-rw-r--r--package/ppp/Makefile106
-rw-r--r--package/ppp/files/etc/ppp/chap-secrets1
-rw-r--r--package/ppp/files/etc/ppp/filter23
-rwxr-xr-xpackage/ppp/files/etc/ppp/ip-down9
-rwxr-xr-xpackage/ppp/files/etc/ppp/ip-down.d/umts7
-rwxr-xr-xpackage/ppp/files/etc/ppp/ip-up9
-rwxr-xr-xpackage/ppp/files/etc/ppp/ip-up.d/if-rename17
-rwxr-xr-xpackage/ppp/files/etc/ppp/ip-up.d/umts7
-rw-r--r--package/ppp/files/etc/ppp/options1
-rw-r--r--package/ppp/files/etc/ppp/peers/dsl12
-rw-r--r--package/ppp/files/etc/ppp/templates/dsl9
-rw-r--r--package/ppp/files/etc/ppp/templates/umts11
-rwxr-xr-xpackage/ppp/files/poff14
-rwxr-xr-xpackage/ppp/files/pon8
-rwxr-xr-xpackage/ppp/files/ppp.pre-up0
-rw-r--r--package/ppp/ipkg/ppp-mod-chat.control5
-rw-r--r--package/ppp/ipkg/ppp-mod-pppdump.control5
-rw-r--r--package/ppp/ipkg/ppp-mod-pppoa.control5
-rw-r--r--package/ppp/ipkg/ppp-mod-pppoe.control5
-rw-r--r--package/ppp/ipkg/ppp-mod-pppstats.control5
-rw-r--r--package/ppp/ipkg/ppp-mod-pppumts.control5
-rw-r--r--package/ppp/ipkg/ppp-mod-radius.conffiles10
-rw-r--r--package/ppp/ipkg/ppp-mod-radius.control5
-rw-r--r--package/ppp/ipkg/ppp.conffiles2
-rw-r--r--package/ppp/ipkg/ppp.control5
-rw-r--r--package/ppp/patches/010-use_target_for_configuration.patch20
-rw-r--r--package/ppp/patches/100-debian_close_dev_ppp.patch34
-rw-r--r--package/ppp/patches/200-makefile.patch44
-rw-r--r--package/ppp/patches/201-mppe_mppc_1.1.patch1587
-rw-r--r--package/ppp/patches/203-no_strip.patch86
-rw-r--r--package/ppp/patches/204-opt_flags.patch26
-rw-r--r--package/ppp/patches/206-radius_config.patch39
-rw-r--r--package/ppp/patches/208-no_exponential_timeout.patch28
-rw-r--r--package/ppp/patches/209-compensate_time_change.patch82
-rw-r--r--package/ppp/patches/320-use_target_ar.patch24
-rw-r--r--package/ppp/utils/pfc.c51
-rw-r--r--package/pptp/Config.in11
-rw-r--r--package/pptp/Makefile30
-rw-r--r--package/pptp/files/ifup.pptp45
-rw-r--r--package/pptp/files/options.pptp6
-rw-r--r--package/pptp/ipkg/pptp.conffiles1
-rw-r--r--package/pptp/ipkg/pptp.control5
-rw-r--r--package/pptpd/Config.in11
-rw-r--r--package/pptpd/Makefile36
-rw-r--r--package/pptpd/files/options.pptpd23
-rw-r--r--package/pptpd/files/pptpd.conf5
-rw-r--r--package/pptpd/files/pptpd.init28
-rw-r--r--package/pptpd/ipkg/pptpd.conffiles2
-rw-r--r--package/pptpd/ipkg/pptpd.control5
-rw-r--r--package/pptpd/ipkg/pptpd.postinst3
-rw-r--r--package/pptpd/patches/bad-pqueue-debug.patch20
-rw-r--r--package/pptpd/patches/patch-ctrlpacket_c15
-rw-r--r--package/pptpd/patches/pptpgre-use-debug-option.patch35
-rw-r--r--package/privoxy/Config.in17
-rw-r--r--package/privoxy/Makefile35
-rw-r--r--package/privoxy/extra/config.h.in664
-rw-r--r--package/privoxy/extra/configure11272
-rw-r--r--package/privoxy/ipkg/privoxy.control5
-rw-r--r--package/privoxy/patches/patch-GNUmakefile_in153
-rw-r--r--package/privoxy/patches/patch-configure_in12
-rw-r--r--package/procmail/Config.in11
-rw-r--r--package/procmail/Makefile27
-rw-r--r--package/procmail/extra/Makefile.new19
-rw-r--r--package/procmail/ipkg/procmail.control4
-rw-r--r--package/procmail/patches/patch-autoconf_h29
-rw-r--r--package/procps/Config.in17
-rw-r--r--package/procps/Makefile43
-rw-r--r--package/procps/ipkg/procps.control4
-rw-r--r--package/procps/killall25
-rw-r--r--package/procps/patches/patch-Makefile63
-rw-r--r--package/procps/patches/patch-proc_module_mk33
-rw-r--r--package/procps/patches/patch-ps_module_mk16
-rw-r--r--package/procps/patches/patch-sysctl_c21
-rw-r--r--package/ptunnel/Config.in14
-rw-r--r--package/ptunnel/Makefile29
-rw-r--r--package/ptunnel/ipkg/ptunnel.control5
-rw-r--r--package/quagga/Config.in69
-rw-r--r--package/quagga/Makefile66
-rw-r--r--package/quagga/files/quagga.init327
-rw-r--r--package/quagga/ipkg/quagga-bgpd.control6
-rw-r--r--package/quagga/ipkg/quagga-ospf6d.control6
-rw-r--r--package/quagga/ipkg/quagga-ospfd.control6
-rw-r--r--package/quagga/ipkg/quagga-ripd.control6
-rw-r--r--package/quagga/ipkg/quagga-ripngd.control6
-rw-r--r--package/quagga/ipkg/quagga-vtysh.control6
-rw-r--r--package/quagga/ipkg/quagga.control6
-rw-r--r--package/quagga/ipkg/quagga.postinst16
-rw-r--r--package/raddump/Config.in11
-rwxr-xr-xpackage/raddump/Makefile27
-rwxr-xr-xpackage/raddump/ipkg/raddump.control6
-rw-r--r--package/radiusclient-ng/Config.in27
-rw-r--r--package/radiusclient-ng/Makefile33
-rw-r--r--package/radiusclient-ng/ipkg/libradiusclient-ng.control4
-rw-r--r--package/radiusclient-ng/ipkg/radiusclient-ng.control5
-rw-r--r--package/radiusclient-ng/patches/01-cross_compile.patch13
-rw-r--r--package/radvd/Config.in11
-rw-r--r--package/radvd/Makefile43
-rw-r--r--package/radvd/files/radvd.conf22
-rw-r--r--package/radvd/files/radvd.init29
-rw-r--r--package/radvd/ipkg/radvd.conffiles1
-rw-r--r--package/radvd/ipkg/radvd.control5
-rw-r--r--package/radvd/ipkg/radvd.postinst3
-rw-r--r--package/radvd/patches/no-libfl.patch12
-rw-r--r--package/randrproto/Config.in6
-rw-r--r--package/randrproto/Makefile20
-rw-r--r--package/rarpd/Config.in14
-rw-r--r--package/rarpd/Makefile36
-rw-r--r--package/rarpd/files/rarpd.init25
-rw-r--r--package/rarpd/ipkg/rarpd.control5
-rw-r--r--package/rarpd/ipkg/rarpd.postinst4
-rw-r--r--package/rdate/Config.in7
-rw-r--r--package/rdate/Makefile32
-rw-r--r--package/rdate/ipkg/rdate.control4
-rw-r--r--package/rdate/ipkg/rdate.postinst4
-rw-r--r--package/rdate/rdate.init21
-rw-r--r--package/rdate/rdate.ip-up4
-rw-r--r--package/readline/Config.in21
-rw-r--r--package/readline/Makefile29
-rw-r--r--package/readline/ipkg/libreadline.control5
-rw-r--r--package/reaim/Config.in9
-rw-r--r--package/reaim/Makefile28
-rw-r--r--package/reaim/files/reaim.init33
-rw-r--r--package/reaim/ipkg/reaim.control5
-rw-r--r--package/reaim/ipkg/reaim.postinst4
-rw-r--r--package/reaim/patches/501-cross_compile-install.patch16
-rw-r--r--package/renderproto/Config.in6
-rw-r--r--package/renderproto/Makefile20
-rw-r--r--package/resourceproto/Config.in6
-rw-r--r--package/resourceproto/Makefile20
-rw-r--r--package/rp-pppoe/Config.in50
-rw-r--r--package/rp-pppoe/Makefile60
-rw-r--r--package/rp-pppoe/files/pppoe-client.init26
-rw-r--r--package/rp-pppoe/files/pppoe-relay.init26
-rw-r--r--package/rp-pppoe/files/pppoe-server.init26
-rw-r--r--package/rp-pppoe/ipkg/pppoe-client.conffiles1
-rw-r--r--package/rp-pppoe/ipkg/pppoe-client.control5
-rw-r--r--package/rp-pppoe/ipkg/pppoe-client.postinst3
-rw-r--r--package/rp-pppoe/ipkg/pppoe-relay.control4
-rw-r--r--package/rp-pppoe/ipkg/pppoe-relay.postinst5
-rw-r--r--package/rp-pppoe/ipkg/pppoe-server.conffiles1
-rw-r--r--package/rp-pppoe/ipkg/pppoe-server.control5
-rw-r--r--package/rp-pppoe/ipkg/pppoe-sniff.control4
-rw-r--r--package/rp-pppoe/ipkg/rules169
-rw-r--r--package/rp-pppoe/ipkg/version1
-rw-r--r--package/rp-pppoe/patches/patch-src_configure12
-rw-r--r--package/rrdcollect/Config.in33
-rw-r--r--package/rrdcollect/Makefile49
-rw-r--r--package/rrdcollect/files/rrd.conf381
-rw-r--r--package/rrdcollect/files/rrd.sh288
-rw-r--r--package/rrdcollect/files/rrdcollect.conf33
-rw-r--r--package/rrdcollect/files/rrdcollect.init34
-rw-r--r--package/rrdcollect/ipkg/rrdcollect-example.conffiles2
-rw-r--r--package/rrdcollect/ipkg/rrdcollect-example.control10
-rw-r--r--package/rrdcollect/ipkg/rrdcollect.control5
-rw-r--r--package/rrdcollect/ipkg/rrdcollect.postinst3
-rw-r--r--package/rrdcollect/patches/rrdcollect-scan.patch66
-rw-r--r--package/rrdtool/Config.in66
-rw-r--r--package/rrdtool/Makefile46
-rw-r--r--package/rrdtool/ipkg/librrd.control14
-rw-r--r--package/rrdtool/ipkg/rrdcgi.control15
-rw-r--r--package/rrdtool/ipkg/rrdtool.control14
-rw-r--r--package/rrdtool/patches/patch-configure21
-rw-r--r--package/rrs/Config.in48
-rw-r--r--package/rrs/Makefile67
-rw-r--r--package/rrs/ipkg/rrs-nossl.control5
-rw-r--r--package/rrs/ipkg/rrs.control5
-rw-r--r--package/rrs/patches/rrs-1.70-shell.patch12
-rw-r--r--package/rsync/Config.in10
-rw-r--r--package/rsync/Makefile26
-rw-r--r--package/rsync/ipkg/rsync.control5
-rw-r--r--package/rtorrent/Config.in11
-rw-r--r--package/rtorrent/Makefile27
-rw-r--r--package/rtorrent/ipkg/rtorrent.control5
-rw-r--r--package/rtorrent/patches/patch-configure_ac11
-rw-r--r--package/rtorrent/patches/patch-rak_functional_h12
-rw-r--r--package/rtorrent/patches/patch-src_command_ui_cc12
-rw-r--r--package/rtorrent/patches/patch-src_display_text_element_value_cc12
-rw-r--r--package/rtorrent/patches/patch-src_rpc_parse_cc11
-rw-r--r--package/ruby/Config.in7
-rw-r--r--package/ruby/Makefile38
-rw-r--r--package/ruby/ipkg/ruby.control4
-rw-r--r--package/ruby/patches/100-makefile-in.patch11
-rw-r--r--package/ruby/patches/patch-lib_fileutils_rb12
-rw-r--r--package/samba/Config.in62
-rw-r--r--package/samba/Makefile69
-rw-r--r--package/samba/files/samba.init29
-rw-r--r--package/samba/files/smb.conf17
-rw-r--r--package/samba/ipkg/samba-client.control4
-rw-r--r--package/samba/ipkg/samba-passwd.control4
-rw-r--r--package/samba/ipkg/samba.conffiles1
-rw-r--r--package/samba/ipkg/samba.control5
-rw-r--r--package/samba/ipkg/samba.postinst3
-rw-r--r--package/samba/ipkg/swat.control5
-rw-r--r--package/samba/ipkg/swat.postinst6
-rw-r--r--package/samba/patches/patch-source_client_mtab_c11
-rw-r--r--package/samba/patches/patch-source_configure198
-rw-r--r--package/samba/patches/patch-source_registry_reg_perfcount_c21
-rw-r--r--package/sane-backends/Config.in654
-rw-r--r--package/sane-backends/Makefile170
-rw-r--r--package/sane-backends/ipkg/sane-backend-abaton.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-abaton.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-abaton.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-agfafocus.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-agfafocus.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-agfafocus.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-apple.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-apple.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-apple.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-artec-eplus48u.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-artec-eplus48u.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-artec-eplus48u.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-artec.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-artec.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-artec.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-as6e.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-as6e.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-avision.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-avision.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-avision.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-bh.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-bh.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-bh.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-canon.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-canon.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-canon.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-canon630u.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-canon630u.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-canon630u.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-coolscan.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-coolscan.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-coolscan.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-coolscan2.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-coolscan2.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-coolscan2.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-dc25.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-dc25.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-dc25.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-dmc.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-dmc.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-dmc.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-epson.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-epson.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-epson.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-fujitsu.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-fujitsu.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-fujitsu.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-genesys.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-genesys.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-genesys.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-gt68xx.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-gt68xx.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-gt68xx.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp3500.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp3500.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp4200.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp4200.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp4200.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp5400.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp5400.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-hp5400.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-ibm.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-ibm.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-ibm.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-leo.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-leo.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-leo.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-lexmark.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-lexmark.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-lexmark.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-ma1509.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-ma1509.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-ma1509.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-matsushita.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-matsushita.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-matsushita.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-microtek.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-microtek.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-microtek.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-microtek2.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-microtek2.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-microtek2.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek-usb.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek-usb.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek-usb.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek-usb2.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek-usb2.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-mustek.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-nec.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-nec.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-nec.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-net.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-net.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-net.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-niash.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-niash.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-pie.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-pie.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-pie.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-pixma.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-pixma.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-plustek-pp.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-plustek-pp.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-plustek-pp.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-plustek.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-plustek.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-plustek.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-qcam.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-qcam.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-qcam.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-ricoh.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-ricoh.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-ricoh.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-s9036.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-s9036.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-s9036.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-sceptre.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-sceptre.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-sceptre.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-sharp.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-sharp.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-sharp.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-sm3600.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-sm3600.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-sm3840.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-sm3840.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-sm3840.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-snapscan.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-snapscan.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-snapscan.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-sp15c.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-sp15c.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-sp15c.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-st400.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-st400.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-st400.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-stv680.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-stv680.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-stv680.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-tamarack.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-tamarack.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-tamarack.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco1.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco1.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco1.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco2.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco2.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco2.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco3.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco3.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-teco3.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-test.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-test.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-test.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-u12.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-u12.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-u12.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax-pp.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax-pp.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax-pp.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax1220u.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax1220u.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-umax1220u.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backend-v4l.conffiles1
-rw-r--r--package/sane-backends/ipkg/sane-backend-v4l.control5
-rw-r--r--package/sane-backends/ipkg/sane-backend-v4l.postinst2
-rw-r--r--package/sane-backends/ipkg/sane-backends.conffiles2
-rw-r--r--package/sane-backends/ipkg/sane-backends.control5
-rw-r--r--package/sane-backends/patches/patch-Makefile_in12
-rw-r--r--package/sane-backends/patches/patch-backend_microtek_c11
-rw-r--r--package/sane-backends/patches/patch-backend_pixma_bjnp_c22
-rw-r--r--package/sane-backends/patches/patch-backend_pixma_common_h13
-rw-r--r--package/sane-backends/patches/patch-backend_pixma_imageclass_c12
-rw-r--r--package/sane-backends/patches/patch-backend_sm3600-scanutil_c11
-rw-r--r--package/sane-backends/patches/patch-backend_umax1220u-common_c12
-rw-r--r--package/scanlogd/Config.in14
-rw-r--r--package/scanlogd/Makefile39
-rw-r--r--package/scanlogd/files/scanlogd.init26
-rw-r--r--package/scanlogd/ipkg/scanlogd.control5
-rw-r--r--package/scanlogd/ipkg/scanlogd.postinst36
-rw-r--r--package/scdp/Config.in12
-rw-r--r--package/scdp/Makefile27
-rw-r--r--package/scdp/ipkg/scdp.control5
-rw-r--r--package/screen/Config.in11
-rw-r--r--package/screen/Makefile27
-rw-r--r--package/screen/ipkg/screen.control5
-rw-r--r--package/screen/patches/patch-Makefile336
-rw-r--r--package/screen/patches/patch-ansi_c32
-rw-r--r--package/screen/patches/patch-attacher_c15
-rw-r--r--package/screen/patches/patch-configure490
-rw-r--r--package/screen/patches/patch-fileio_c39
-rw-r--r--package/screen/patches/patch-help_c15
-rw-r--r--package/screen/patches/patch-process_c39
-rw-r--r--package/screen/patches/patch-pty_c16
-rw-r--r--package/screen/patches/patch-sched_h21
-rw-r--r--package/screen/patches/patch-screen_c30
-rw-r--r--package/screen/patches/patch-termcap_c12
-rw-r--r--package/screen/patches/patch-tty_sh21
-rw-r--r--package/screen/patches/patch-utmp_c12
-rw-r--r--package/screen/patches/patch-window_c33
-rw-r--r--package/scrnsaverproto/Config.in6
-rw-r--r--package/scrnsaverproto/Makefile20
-rw-r--r--package/scsi-spin/Config.in9
-rw-r--r--package/scsi-spin/Makefile27
-rw-r--r--package/scsi-spin/files/scsi-spin.c420
-rw-r--r--package/scsi-spin/ipkg/scsi-spin.control4
-rw-r--r--package/ser2net/Config.in10
-rw-r--r--package/ser2net/Makefile28
-rw-r--r--package/ser2net/ipkg/ser2net.conffiles1
-rw-r--r--package/ser2net/ipkg/ser2net.control5
-rw-r--r--package/serdisplib/Config.in10
-rw-r--r--package/serdisplib/Makefile28
-rw-r--r--package/serdisplib/ipkg/serdisplib.control4
-rw-r--r--package/serdisplib/patches/patch-Makefile_in12
-rw-r--r--package/serdisplib/patches/patch-configure22
-rw-r--r--package/serdisplib/patches/patch-src_Makefile_in12
-rw-r--r--package/setpwc/Config.in9
-rw-r--r--package/setpwc/Makefile26
-rw-r--r--package/setpwc/ipkg/setpwc.control4
-rw-r--r--package/setserial/Config.in13
-rw-r--r--package/setserial/Makefile25
-rw-r--r--package/setserial/ipkg/setserial.control4
-rw-r--r--package/shat/Config.in10
-rw-r--r--package/shat/Makefile27
-rw-r--r--package/shat/ipkg/shat.control4
-rw-r--r--package/shorewall-common/Config.in40
-rw-r--r--package/shorewall-common/Makefile58
-rw-r--r--package/shorewall-common/files/downstrip7
-rw-r--r--package/shorewall-common/files/shorewall.init33
-rw-r--r--package/shorewall-common/ipkg/shorewall-common.conffiles33
-rw-r--r--package/shorewall-common/ipkg/shorewall-common.control5
-rw-r--r--package/shorewall-common/ipkg/shorewall-common.postinst6
-rw-r--r--package/shorewall-common/ipkg/shorewall-common.prerm8
-rw-r--r--package/shorewall-common/patches/patch-install_sh98
-rw-r--r--package/shorewall-common/patches/patch-shorewall_conf12
-rw-r--r--package/shorewall-shell/Config.in8
-rw-r--r--package/shorewall-shell/Makefile35
-rw-r--r--package/shorewall-shell/files/downstrip7
-rw-r--r--package/shorewall-shell/ipkg/shorewall-shell.control5
-rw-r--r--package/siproxd/Config.in12
-rw-r--r--package/siproxd/Makefile31
-rw-r--r--package/siproxd/files/siproxd.init25
-rw-r--r--package/siproxd/ipkg/siproxd.conffiles2
-rw-r--r--package/siproxd/ipkg/siproxd.control5
-rw-r--r--package/siproxd/ipkg/siproxd.postinst3
-rw-r--r--package/siproxd/patches/patch-configure18
-rw-r--r--package/sipsak/Config.in12
-rw-r--r--package/sipsak/Makefile29
-rw-r--r--package/sipsak/ipkg/sipsak.control5
-rw-r--r--package/sispmctl/Config.in9
-rw-r--r--package/sispmctl/Makefile26
-rw-r--r--package/sispmctl/ipkg/sispmctl.control5
-rw-r--r--package/slurm/Config.in15
-rw-r--r--package/slurm/Makefile30
-rw-r--r--package/slurm/ipkg/slurm.control6
-rw-r--r--package/slurm/patches/no_host_ncurses.patch67
-rw-r--r--package/snort-wireless/Config.in17
-rw-r--r--package/snort-wireless/Makefile49
-rw-r--r--package/snort-wireless/files/snort-wireless.init27
-rw-r--r--package/snort-wireless/ipkg/snort-wireless.conffiles2
-rw-r--r--package/snort-wireless/ipkg/snort-wireless.control6
-rw-r--r--package/snort-wireless/ipkg/snort-wireless.postinst4
-rw-r--r--package/snort-wireless/patches/500-no-config-search.patch35
-rw-r--r--package/snort-wireless/patches/750-lightweight-config.patch178
-rw-r--r--package/snort/Config.in18
-rw-r--r--package/snort/Makefile48
-rw-r--r--package/snort/files/snort.init21
-rw-r--r--package/snort/ipkg/snort.conffiles2
-rw-r--r--package/snort/ipkg/snort.control6
-rw-r--r--package/snort/ipkg/snort.postinst4
-rw-r--r--package/socat/Config.in18
-rw-r--r--package/socat/Makefile32
-rw-r--r--package/socat/ipkg/socat.control11
-rw-r--r--package/socat/patches/501-honor_ldflags.patch13
-rw-r--r--package/speex/Config.in24
-rw-r--r--package/speex/Makefile28
-rw-r--r--package/speex/ipkg/libspeex.control4
-rw-r--r--package/sqlite/Config.in75
-rw-r--r--package/sqlite/Makefile37
-rw-r--r--package/sqlite/ipkg/libsqlite.control4
-rw-r--r--package/sqlite/ipkg/sqlite-cli.control5
-rw-r--r--package/squid/Config.in93
-rw-r--r--package/squid/Makefile173
-rw-r--r--package/squid/ipkg/squid-mod-basic-auth-getpwnam.control5
-rw-r--r--package/squid/ipkg/squid-mod-basic-auth-ncsa.control5
-rw-r--r--package/squid/ipkg/squid-mod-basic-auth-smb.control5
-rw-r--r--package/squid/ipkg/squid-mod-basic-auth-winbind.control5
-rw-r--r--package/squid/ipkg/squid-mod-digest-auth-password.control5
-rw-r--r--package/squid/ipkg/squid-mod-external-acl-ip-user.control5
-rw-r--r--package/squid/ipkg/squid-mod-external-acl-unix-group.control5
-rw-r--r--package/squid/ipkg/squid-mod-external-acl-winbind-group.control5
-rw-r--r--package/squid/ipkg/squid-mod-ntlm-auth-fakeauth.control5
-rw-r--r--package/squid/ipkg/squid-mod-ntlm-auth-smb-auth.control5
-rw-r--r--package/squid/ipkg/squid-mod-ntlm-auth-winbind-auth.control5
-rw-r--r--package/squid/ipkg/squid.conffiles2
-rw-r--r--package/squid/ipkg/squid.control5
-rw-r--r--package/squid/patches/patch-configure20
-rw-r--r--package/squid/patches/patch-include_config_h48
-rw-r--r--package/squid/patches/patch-lib_util_c22
-rw-r--r--package/squid/patches/patch-src_Makefile_in19
-rw-r--r--package/srelay/Config.in9
-rw-r--r--package/srelay/Makefile30
-rw-r--r--package/srelay/files/srelay.conf2
-rw-r--r--package/srelay/files/srelay.init26
-rw-r--r--package/srelay/ipkg/srelay.conffiles1
-rw-r--r--package/srelay/ipkg/srelay.control4
-rw-r--r--package/srelay/ipkg/srelay.postinst4
-rw-r--r--package/srelay/patches/01-cross_compile.patch12
-rw-r--r--package/ssltunnel/Config.in11
-rw-r--r--package/ssltunnel/Makefile30
-rw-r--r--package/ssltunnel/ipkg/ssltunnel.control5
-rw-r--r--package/ssltunnel/patches/patch-client_ntlmauth_c11
-rw-r--r--package/ssmtp/Config.in13
-rw-r--r--package/ssmtp/Makefile30
-rw-r--r--package/ssmtp/ipkg/ssmtp.conffiles2
-rw-r--r--package/ssmtp/ipkg/ssmtp.control4
-rw-r--r--package/ssmtp/patches/500-debian-subset-2.61-2.patch248
-rw-r--r--package/ssmtp/patches/901-strftime_space_padding.patch12
-rw-r--r--package/strace/Config.in11
-rw-r--r--package/strace/Makefile26
-rw-r--r--package/strace/ipkg/strace.control4
-rw-r--r--package/strace/patches/patch-config_h_in15
-rw-r--r--package/strace/patches/patch-configure26
-rw-r--r--package/strace/patches/patch-configure_ac18
-rw-r--r--package/strace/patches/patch-process_c109
-rw-r--r--package/strace/patches/patch-signal_c42
-rw-r--r--package/strace/patches/patch-syscall_c81
-rw-r--r--package/strace/patches/patch-util_c53
-rw-r--r--package/stress/Config.in12
-rw-r--r--package/stress/Makefile26
-rw-r--r--package/stress/ipkg/stress.control4
-rw-r--r--package/strongswan/Config.in10
-rw-r--r--package/strongswan/Makefile28
-rw-r--r--package/strongswan/files/strongswan.init26
-rw-r--r--package/strongswan/ipkg/strongswan.control5
-rw-r--r--package/subversion/Config.in23
-rw-r--r--package/subversion/Makefile61
-rw-r--r--package/subversion/files/svnserve.init36
-rw-r--r--package/subversion/ipkg/subversion.control4
-rw-r--r--package/subversion/ipkg/subversion.postinst4
-rw-r--r--package/swconfig/Config.in8
-rw-r--r--package/swconfig/Makefile30
-rw-r--r--package/swconfig/ipkg/swconfig.control4
-rw-r--r--package/swconfig/src/Makefile12
-rw-r--r--package/swconfig/src/cli.c255
-rw-r--r--package/swconfig/src/swlib.c614
-rw-r--r--package/swconfig/src/swlib.h213
-rw-r--r--package/syslog-ng/Config.in32
-rw-r--r--package/syslog-ng/Makefile34
-rw-r--r--package/syslog-ng/files/syslog-ng.conf16
-rw-r--r--package/syslog-ng/files/syslog-ng.init30
-rw-r--r--package/syslog-ng/ipkg/syslog-ng.conffiles1
-rw-r--r--package/syslog-ng/ipkg/syslog-ng.control5
-rw-r--r--package/syslog-ng/ipkg/syslog-ng.postinst3
-rw-r--r--package/syslog-ng/patches/patch-Makefile_in12
-rw-r--r--package/syslog-ng/patches/patch-configure21
-rw-r--r--package/syslog-ng/patches/patch-src_Makefile_in12
-rw-r--r--package/syslog-ng/patches/patch-src_cfg-lex_c14
-rw-r--r--package/sysstat/Config.in11
-rw-r--r--package/sysstat/Makefile35
-rw-r--r--package/sysstat/files/CONFIG45
-rw-r--r--package/sysstat/ipkg/sysstat.control4
-rw-r--r--package/sysstat/patches/patch-Makefile79
-rw-r--r--package/tar/Config.in8
-rw-r--r--package/tar/Makefile28
-rw-r--r--package/tar/ipkg/tar.control4
-rw-r--r--package/tcl/Config.in8
-rw-r--r--package/tcl/Makefile38
-rw-r--r--package/tcl/ipkg/tcl.control4
-rw-r--r--package/tcp_wrappers/Config.in15
-rw-r--r--package/tcp_wrappers/Makefile43
-rw-r--r--package/tcp_wrappers/ipkg/libwrap.control4
-rw-r--r--package/tcp_wrappers/patches/debian-subset.patch936
-rw-r--r--package/tcp_wrappers/patches/opt_cflags.patch12
-rw-r--r--package/tcpdump/Config.in10
-rw-r--r--package/tcpdump/Makefile34
-rw-r--r--package/tcpdump/ipkg/tcpdump.control5
-rw-r--r--package/tcpdump/patches/patch-print-enc_c19
-rw-r--r--package/tinc/Config.in13
-rw-r--r--package/tinc/Makefile31
-rw-r--r--package/tinc/ipkg/tinc.control5
-rw-r--r--package/tinc/patches/patch-src_linux_device_c21
-rw-r--r--package/tinc/patches/patch-src_net_setup_c20
-rw-r--r--package/tinyproxy/Config.in30
-rw-r--r--package/tinyproxy/Makefile44
-rw-r--r--package/tinyproxy/files/tinyproxy.init26
-rw-r--r--package/tinyproxy/ipkg/tinyproxy.control5
-rw-r--r--package/tinyproxy/ipkg/tinyproxy.postinst3
-rw-r--r--package/tmsnc/Config.in7
-rw-r--r--package/tmsnc/Makefile31
-rw-r--r--package/tmsnc/ipkg/tmsnc.control8
-rw-r--r--package/tntnet/Config.in37
-rw-r--r--package/tntnet/Makefile67
-rw-r--r--package/tntnet/files/mime.conf22
-rw-r--r--package/tntnet/files/tntnet.conf49
-rw-r--r--package/tntnet/files/tntnet.properties31
-rw-r--r--package/tntnet/ipkg/tntnet.conffiles3
-rw-r--r--package/tntnet/ipkg/tntnet.control4
-rw-r--r--package/tntnet/ipkg/tntnet.postinst6
-rw-r--r--package/tor/Config.in18
-rw-r--r--package/tor/Makefile41
-rw-r--r--package/tor/files/tor.init27
-rw-r--r--package/tor/files/torrc136
-rw-r--r--package/tor/ipkg/tor.conffiles1
-rw-r--r--package/tor/ipkg/tor.control5
-rw-r--r--package/tor/ipkg/tor.postinst24
-rw-r--r--package/tor/patches/patch-configure12
-rw-r--r--package/tor/patches/patch-src_common_util_h12
-rw-r--r--package/trafshow/Config.in9
-rw-r--r--package/trafshow/Makefile30
-rw-r--r--package/trafshow/ipkg/trafshow.control5
-rw-r--r--package/trafshow/patches/patch-domain_resolver_c680
-rw-r--r--package/ttcp/Config.in7
-rw-r--r--package/ttcp/Makefile26
-rw-r--r--package/ttcp/ipkg/ttcp.control4
-rw-r--r--package/ttcp/ttcp.c2374
-rw-r--r--package/uclibc++/Config.in8
-rw-r--r--package/uclibc++/Makefile36
-rw-r--r--package/uclibc++/files/config57
-rw-r--r--package/uclibc++/files/config.mips57
-rw-r--r--package/uclibc++/files/config.x8657
-rw-r--r--package/uclibc++/ipkg/uclibc++.control4
-rw-r--r--package/uclibc++/patches/patch-bin_Makefile12
-rw-r--r--package/uclibc++/patches/patch-fstream_eof15
-rw-r--r--package/uclibc++/patches/patch-include_locale19
-rw-r--r--package/uclibc++/patches/patch-include_string17
-rw-r--r--package/uclibc++/patches/patch-src_string_cpp17
-rw-r--r--package/uclibc/Config.in9
-rw-r--r--package/uclibc/Makefile38
-rw-r--r--package/uclibc/ipkg/uclibc.conffiles1
-rw-r--r--package/uclibc/ipkg/uclibc.control4
-rw-r--r--package/udev/Config.in11
-rw-r--r--package/udev/Makefile48
-rw-r--r--package/udev/ipkg/udev.conffiles1
-rw-r--r--package/udev/ipkg/udev.control4
-rw-r--r--package/udev/patches/01-no_debug.patch21
-rw-r--r--package/udp-broadcast-relay/Config.in12
-rw-r--r--package/udp-broadcast-relay/Makefile26
-rw-r--r--package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control4
-rw-r--r--package/udp-broadcast-relay/patches/patch-main_c32
-rw-r--r--package/ulogd/Config.in48
-rw-r--r--package/ulogd/Makefile92
-rw-r--r--package/ulogd/files/ulogd.init22
-rw-r--r--package/ulogd/ipkg/ulogd-mod-extra.control5
-rw-r--r--package/ulogd/ipkg/ulogd-mod-mysql.control5
-rw-r--r--package/ulogd/ipkg/ulogd-mod-pcap.control5
-rw-r--r--package/ulogd/ipkg/ulogd-mod-pgsql.control5
-rw-r--r--package/ulogd/ipkg/ulogd-mod-sqlite.control5
-rw-r--r--package/ulogd/ipkg/ulogd.conffiles1
-rw-r--r--package/ulogd/ipkg/ulogd.control4
-rw-r--r--package/ulogd/ipkg/ulogd.postinst3
-rw-r--r--package/ulogd/patches/patch-Rules_make_in12
-rw-r--r--package/ulogd/patches/patch-libipulog_Makefile_in12
-rw-r--r--package/ulogd/patches/patch-mysql_Makefile_in12
-rw-r--r--package/updatedd/Config.in67
-rw-r--r--package/updatedd/Makefile52
-rw-r--r--package/updatedd/ipkg/updatedd-mod-changeip.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-dyndns.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-eurodyndns.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-hn.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-noip.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-ods.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-ovh.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-regfish.control4
-rw-r--r--package/updatedd/ipkg/updatedd-mod-tzo.control4
-rw-r--r--package/updatedd/ipkg/updatedd.control4
-rw-r--r--package/usbutils/Config.in15
-rw-r--r--package/usbutils/Makefile29
-rw-r--r--package/usbutils/ipkg/lsusb.control5
-rw-r--r--package/ussp-push/Config.in9
-rw-r--r--package/ussp-push/Makefile29
-rw-r--r--package/ussp-push/ipkg/ussp-push.control5
-rw-r--r--package/ussp-push/patches/patch-src_obex_socket_c21
-rw-r--r--package/ustl/Config.in13
-rw-r--r--package/ustl/Makefile33
-rw-r--r--package/ustl/files/Common.mk74
-rw-r--r--package/ustl/files/config.h286
-rw-r--r--package/ustl/ipkg/ustl.control4
-rw-r--r--package/ustl/patches/01-install-DESTDIR.patch56
-rw-r--r--package/ustl/patches/02-install_path.patch12
-rw-r--r--package/util-linux/Config.in38
-rw-r--r--package/util-linux/Makefile40
-rw-r--r--package/util-linux/ipkg/fdisk.control5
-rw-r--r--package/util-linux/ipkg/losetup.control5
-rw-r--r--package/util-linux/ipkg/swap-utils.control5
-rw-r--r--package/util-linux/patches/patch-MCONFIG69
-rw-r--r--package/util-linux/patches/patch-disk-utils_fsck_cramfs_c11
-rw-r--r--package/util-linux/patches/patch-fdisk_cfdisk_c12
-rw-r--r--package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c54
-rw-r--r--package/util-linux/patches/patch-fdisk_llseek_c11
-rw-r--r--package/util-linux/patches/patch-fdisk_sfdisk_c68
-rw-r--r--package/util-linux/patches/patch-fdisk_sfdisk_c.orig12
-rw-r--r--package/util-linux/patches/patch-misc-utils_logger_c12
-rw-r--r--package/util-linux/patches/patch-misc-utils_namei_c12
-rw-r--r--package/util-linux/patches/patch-misc-utils_whereis_c20
-rw-r--r--package/util-linux/patches/patch-mount_mntent_c30
-rw-r--r--package/util-linux/patches/patch-mount_mount_by_label_c12
-rw-r--r--package/util-linux/patches/patch-mount_mount_c17
-rw-r--r--package/util-linux/patches/patch-mount_sundries_c12
-rw-r--r--package/util-linux/patches/patch-mount_umount_c12
-rw-r--r--package/util-linux/patches/patch-text-utils_colcrt_c14
-rw-r--r--package/util-linux/patches/patch-text-utils_display_c12
-rw-r--r--package/util-linux/patches/patch-text-utils_parse_c34
-rw-r--r--package/valgrind/Config.in6
-rw-r--r--package/valgrind/Makefile33
-rw-r--r--package/valgrind/ipkg/valgrind.control4
-rw-r--r--package/vgp/Config.in12
-rwxr-xr-xpackage/vgp/Makefile26
-rwxr-xr-xpackage/vgp/ipkg/vgp.control5
-rw-r--r--package/videoproto/Config.in6
-rw-r--r--package/videoproto/Makefile20
-rw-r--r--package/vilistextum/Config.in23
-rw-r--r--package/vilistextum/Makefile29
-rw-r--r--package/vilistextum/ipkg/vilistextum.control4
-rw-r--r--package/vilistextum/patches/patch-tests_check_entities8
-rw-r--r--package/vilistextum/patches/patch-tests_check_tags8
-rw-r--r--package/vim/Config.in11
-rw-r--r--package/vim/Makefile64
-rw-r--r--package/vim/ipkg/vim.control5
-rw-r--r--package/vnc-reflector/Config.in14
-rw-r--r--package/vnc-reflector/Makefile30
-rwxr-xr-xpackage/vnc-reflector/ipkg/vnc-reflector.control5
-rw-r--r--package/vnstat/Config.in11
-rw-r--r--package/vnstat/Makefile27
-rw-r--r--package/vnstat/ipkg/vnstat.control4
-rw-r--r--package/vpnc/Config.in9
-rw-r--r--package/vpnc/Makefile36
-rwxr-xr-xpackage/vpnc/files/vpnc-route30
-rwxr-xr-xpackage/vpnc/files/vpnc-script118
-rw-r--r--package/vpnc/files/vpnc.conf8
-rw-r--r--package/vpnc/ipkg/vpnc.conffiles4
-rwxr-xr-xpackage/vpnc/ipkg/vpnc.control6
-rw-r--r--package/vpnc/patches/patch-Makefile51
-rw-r--r--package/vpnc/patches/patch-config_c12
-rw-r--r--package/vrrpd/Config.in13
-rw-r--r--package/vrrpd/Makefile32
-rw-r--r--package/vrrpd/files/vrrpd.init25
-rw-r--r--package/vrrpd/ipkg/vrrpd.control4
-rw-r--r--package/vrrpd/ipkg/vrrpd.postinst4
-rw-r--r--package/vsftpd/Config.in9
-rw-r--r--package/vsftpd/Makefile33
-rw-r--r--package/vsftpd/files/vsftpd.conf17
-rw-r--r--package/vsftpd/files/vsftpd.init26
-rw-r--r--package/vsftpd/ipkg/vsftpd.conffiles1
-rw-r--r--package/vsftpd/ipkg/vsftpd.control5
-rw-r--r--package/vsftpd/ipkg/vsftpd.postinst3
-rw-r--r--package/vsftpd/patches/patch-Makefile59
-rw-r--r--package/vtun/Config.in12
-rw-r--r--package/vtun/Makefile34
-rw-r--r--package/vtun/ipkg/vtun.conffiles1
-rw-r--r--package/vtun/ipkg/vtun.control5
-rw-r--r--package/vtun/patches/patch-configure144
-rw-r--r--package/watchdog/Config.in7
-rw-r--r--package/watchdog/Makefile35
-rw-r--r--package/watchdog/files/watchdog.init27
-rw-r--r--package/watchdog/ipkg/watchdog.conffiles1
-rw-r--r--package/watchdog/ipkg/watchdog.control4
-rw-r--r--package/watchdog/ipkg/watchdog.postinst3
-rw-r--r--package/watchdog/patches/01-fstab-sys_siglist.patch11
-rw-r--r--package/watchdog/patches/patch-src_mntent_c21
-rw-r--r--package/watchdog/patches/patch-src_umount_c12
-rw-r--r--package/wccpd/Config.in11
-rw-r--r--package/wccpd/Makefile30
-rw-r--r--package/wccpd/ipkg/wccpd.control4
-rw-r--r--package/wdfs/Config.in14
-rw-r--r--package/wdfs/Makefile26
-rw-r--r--package/wdfs/ipkg/wdfs.control5
-rw-r--r--package/weechat/Config.in26
-rw-r--r--package/weechat/Makefile49
-rw-r--r--package/weechat/ipkg/weechat.control4
-rw-r--r--package/weechat/patches/patch-src_gui_curses_Makefile_in12
-rw-r--r--package/wifidog/Config.in13
-rw-r--r--package/wifidog/Makefile37
-rw-r--r--package/wifidog/files/wifidog.conf177
-rw-r--r--package/wifidog/files/wifidog.init26
-rw-r--r--package/wifidog/ipkg/wifidog.conffiles1
-rw-r--r--package/wifidog/ipkg/wifidog.control8
-rw-r--r--package/wifidog/ipkg/wifidog.postinst3
-rw-r--r--package/wifidog/patches/patch-libhttpd_api_c211
-rw-r--r--package/wifidog/patches/patch-libhttpd_ip_acl_c30
-rw-r--r--package/wifidog/patches/patch-libhttpd_protocol_c48
-rw-r--r--package/wireless-firmware/Config.in11
-rw-r--r--package/wireless-firmware/Makefile27
-rw-r--r--package/wireless-firmware/ipkg/wireless-firmware-rt61.control4
-rw-r--r--package/wireless-tools/Config.in6
-rw-r--r--package/wireless-tools/Makefile38
-rw-r--r--package/wireless-tools/ipkg/wireless-tools.control4
-rw-r--r--package/wireless-tools/patches/debian-2.patch35
-rw-r--r--package/wol/Config.in10
-rw-r--r--package/wol/Makefile32
-rw-r--r--package/wol/ipkg/wol.control4
-rw-r--r--package/wondershaper/Config.in10
-rw-r--r--package/wondershaper/Makefile26
-rw-r--r--package/wondershaper/files/wondershaper.init25
-rw-r--r--package/wondershaper/ipkg/wondershaper.conffiles1
-rw-r--r--package/wondershaper/ipkg/wondershaper.control5
-rw-r--r--package/wondershaper/ipkg/wondershaper.postinst3
-rw-r--r--package/wondershaper/patches/01-change-default.patch217
-rw-r--r--package/wpa_supplicant/Config.in30
-rw-r--r--package/wpa_supplicant/Makefile35
-rw-r--r--package/wpa_supplicant/files/config16
-rw-r--r--package/wpa_supplicant/ipkg/wpa-supplicant.control5
-rw-r--r--package/wpa_supplicant/patches/patch-Makefile13
-rw-r--r--package/wput/Config.in9
-rw-r--r--package/wput/Makefile30
-rw-r--r--package/wput/ipkg/wput.control4
-rw-r--r--package/xcmiscproto/Config.in6
-rw-r--r--package/xcmiscproto/Makefile20
-rw-r--r--package/xcmiscproto/ipkg/xcmiscproto.control4
-rw-r--r--package/xextproto/Config.in6
-rw-r--r--package/xextproto/Makefile20
-rw-r--r--package/xf86dga/Config.in6
-rw-r--r--package/xf86dga/Makefile20
-rw-r--r--package/xf86dgaproto/Config.in6
-rw-r--r--package/xf86dgaproto/Makefile20
-rw-r--r--package/xfsprogs/Config.in8
-rw-r--r--package/xfsprogs/Makefile32
-rw-r--r--package/xfsprogs/ipkg/xfsprogs.control5
-rw-r--r--package/xfsprogs/patches/patch-configure_in20
-rw-r--r--package/xfsprogs/patches/patch-copy_xfs_copy_c80
-rw-r--r--package/xfsprogs/patches/patch-include_builddefs_in35
-rw-r--r--package/xfsprogs/patches/patch-include_buildmacros12
-rw-r--r--package/xfsprogs/patches/patch-libhandle_Makefile12
-rw-r--r--package/xfsprogs/patches/patch-libxfs_linux_c38
-rw-r--r--package/xinetd/Config.in9
-rw-r--r--package/xinetd/Makefile35
-rw-r--r--package/xinetd/files/xinetd.conf6
-rw-r--r--package/xinetd/files/xinetd.init26
-rw-r--r--package/xinetd/ipkg/xinetd.conffiles1
-rw-r--r--package/xinetd/ipkg/xinetd.control4
-rw-r--r--package/xinetd/ipkg/xinetd.postinst3
-rw-r--r--package/xinetd/patches/ar.patch72
-rw-r--r--package/xinetd/patches/destdir.patch28
-rw-r--r--package/xinetd/patches/xinetd-2.3.13-gcc4-1.patch33
-rw-r--r--package/xorg-server/Config.in8
-rw-r--r--package/xorg-server/Makefile51
-rw-r--r--package/xorg-server/ipkg/xorg-server.control4
-rw-r--r--package/xproto/Config.in6
-rw-r--r--package/xproto/Makefile20
-rw-r--r--package/xtrans/Config.in6
-rw-r--r--package/xtrans/Makefile20
-rw-r--r--package/xtrans/ipkg/xtrans.control4
-rw-r--r--package/zlib/Config.in9
-rw-r--r--package/zlib/Makefile40
-rw-r--r--package/zlib/ipkg/zlib.control4
-rw-r--r--package/zlib/patches/patch-Makefile_in20
-rw-r--r--package/zlib/patches/patch-configure38
-rw-r--r--package/zsh/Config.in9
-rw-r--r--package/zsh/Makefile26
-rw-r--r--package/zsh/ipkg/zsh.control4
-rw-r--r--rules.mk49
-rwxr-xr-xscripts/config.guess1548
-rwxr-xr-xscripts/config.sub1695
-rw-r--r--scripts/create-busybox.sh25
-rwxr-xr-xscripts/create-image.sh169
-rwxr-xr-xscripts/install.sh208
-rw-r--r--scripts/ipkg1198
-rw-r--r--scripts/ipkg-build253
-rw-r--r--scripts/ipkg-make-index.sh23
-rwxr-xr-xscripts/make11
-rw-r--r--scripts/make-ipkg-dir.sh20
-rw-r--r--scripts/md5sum11
-rw-r--r--scripts/patch.sh67
-rw-r--r--scripts/rstrip.sh61
-rw-r--r--scripts/scan-pkgs.sh100
-rw-r--r--scripts/scan-tools.sh279
-rwxr-xr-xscripts/sed11
-rw-r--r--scripts/split-cfg.sh89
-rw-r--r--scripts/strip-script.sh38
-rwxr-xr-xscripts/tar11
-rw-r--r--scripts/update-patches179
-rw-r--r--target/Config.in325
-rw-r--r--target/Makefile88
-rw-r--r--target/alix1c/Makefile26
-rw-r--r--target/alix1c/device.mk7
-rw-r--r--target/alix1c/files/etc/fstab2
-rw-r--r--target/alix1c/files/etc/inittab4
-rw-r--r--target/alix1c/files/etc/mdev.conf17
-rw-r--r--target/alix1c/kernel.config1119
-rw-r--r--target/alix1c/uclibc.config241
-rw-r--r--target/foxboard/Makefile38
-rw-r--r--target/foxboard/device.mk7
-rw-r--r--target/foxboard/files/etc/mdev.conf10
-rw-r--r--target/foxboard/kernel.config815
-rw-r--r--target/foxboard/patches/cris.patch5751
-rw-r--r--target/foxboard/patches/mtd-root.patch62
-rwxr-xr-xtarget/foxboard/tools/boot_linux512
-rw-r--r--target/foxboard/tools/e100boot/Makefile26
-rw-r--r--target/foxboard/tools/mkfimage/Makefile4
-rwxr-xr-xtarget/foxboard/tools/mkfimage/mkfimagebin0 -> 11901 bytes
-rw-r--r--target/foxboard/tools/mkfimage/mkfimage.c72
-rw-r--r--target/foxboard/tools/rules.mk9
-rw-r--r--target/foxboard/tools/squashfs/Makefile27
-rw-r--r--target/foxboard/uclibc.config241
-rw-r--r--target/ibm-x40/Makefile19
-rw-r--r--target/ibm-x40/device.mk7
-rw-r--r--target/ibm-x40/files/etc/inittab4
-rw-r--r--target/ibm-x40/files/etc/mdev.conf14
-rw-r--r--target/ibm-x40/kernel.config946
-rw-r--r--target/ibm-x40/uclibc.config241
-rw-r--r--target/linux/Config.in16
-rw-r--r--target/linux/config/Config.in.block246
-rw-r--r--target/linux/config/Config.in.bluetooth120
-rw-r--r--target/linux/config/Config.in.crypto536
-rw-r--r--target/linux/config/Config.in.debug53
-rw-r--r--target/linux/config/Config.in.fs201
-rw-r--r--target/linux/config/Config.in.fsnet139
-rw-r--r--target/linux/config/Config.in.input41
-rw-r--r--target/linux/config/Config.in.ipvs118
-rw-r--r--target/linux/config/Config.in.isdn44
-rw-r--r--target/linux/config/Config.in.kernel82
-rw-r--r--target/linux/config/Config.in.leds14
-rw-r--r--target/linux/config/Config.in.lib42
-rw-r--r--target/linux/config/Config.in.misc77
-rw-r--r--target/linux/config/Config.in.multimedia113
-rw-r--r--target/linux/config/Config.in.netdevice191
-rw-r--r--target/linux/config/Config.in.netfilter456
-rw-r--r--target/linux/config/Config.in.network232
-rw-r--r--target/linux/config/Config.in.nls555
-rw-r--r--target/linux/config/Config.in.pcmcia32
-rw-r--r--target/linux/config/Config.in.sched337
-rw-r--r--target/linux/config/Config.in.usb264
-rw-r--r--target/linux/kernel.control5
-rw-r--r--target/linux/patches/2.6.28/ocf.patch23661
-rw-r--r--target/linux/patches/2.6.28/sunrpc-kallsym-deactivated.patch13
-rw-r--r--target/linux/patches/cygwin-compat.patch66
-rw-r--r--target/linux/patches/freebsd-compat.patch11
-rw-r--r--target/linux/patches/ocf.patch23653
-rw-r--r--target/linux/patches/swconfig.patch1075
-rw-r--r--target/linux/patches/yaffs2.patch15068
-rw-r--r--target/qemu-cris/Makefile35
-rw-r--r--target/qemu-cris/device.mk7
-rw-r--r--target/qemu-cris/files/etc/mdev.conf13
-rw-r--r--target/qemu-cris/kernel.config751
-rw-r--r--target/qemu-cris/patches/cris.patch91
-rw-r--r--target/qemu-cris/tools/mkfimage/Makefile4
-rw-r--r--target/qemu-cris/tools/mkfimage/mkfimage.c72
-rw-r--r--target/qemu-cris/tools/rules.mk9
-rw-r--r--target/qemu-cris/uclibc.config241
-rw-r--r--target/qemu-mips/Makefile30
-rw-r--r--target/qemu-mips/device.mk7
-rw-r--r--target/qemu-mips/files/etc/mdev.conf11
-rw-r--r--target/qemu-mips/kernel.config902
-rw-r--r--target/qemu-mips/patches/io_map_base.patch52
-rw-r--r--target/qemu-mips/uclibc.config250
-rw-r--r--target/qemu-x86/Makefile28
-rw-r--r--target/qemu-x86/device.mk7
-rw-r--r--target/qemu-x86/files/etc/inittab4
-rw-r--r--target/qemu-x86/files/etc/mdev.conf17
-rw-r--r--target/qemu-x86/kernel.config1091
-rw-r--r--target/qemu-x86/uclibc.config241
-rw-r--r--target/rb411/Makefile28
-rw-r--r--target/rb411/device.mk7
-rw-r--r--target/rb411/files/etc/mdev.conf10
-rw-r--r--target/rb411/kernel.config1035
-rw-r--r--target/rb411/patches/ar71xx.patch9913
-rw-r--r--target/rb411/uclibc.config233
-rw-r--r--target/rb433/Makefile28
-rw-r--r--target/rb433/device.mk7
-rw-r--r--target/rb433/files/etc/mdev.conf10
-rw-r--r--target/rb433/kernel.config1031
-rw-r--r--target/rb433/patches/ar71xx.patch9913
-rw-r--r--target/rb433/patches/ip175-switch.patch1364
-rw-r--r--target/rb433/uclibc.config233
-rw-r--r--target/rb532/Makefile29
-rw-r--r--target/rb532/device.mk7
-rw-r--r--target/rb532/files/etc/mdev.conf11
-rw-r--r--target/rb532/kernel.config1025
-rw-r--r--target/rb532/uclibc.config250
-rw-r--r--target/rescue-x86/Makefile19
-rw-r--r--target/rescue-x86/device.mk7
-rw-r--r--target/rescue-x86/files/etc/inittab4
-rw-r--r--target/rescue-x86/files/etc/mdev.conf14
-rw-r--r--target/rescue-x86/kernel.config1006
-rw-r--r--target/rescue-x86/uclibc.config241
-rw-r--r--target/rescue-x86_64/Makefile19
-rw-r--r--target/rescue-x86_64/device.mk7
-rw-r--r--target/rescue-x86_64/files/etc/inittab4
-rw-r--r--target/rescue-x86_64/files/etc/mdev.conf14
-rw-r--r--target/rescue-x86_64/kernel.config1121
-rw-r--r--target/rescue-x86_64/uclibc.config240
-rw-r--r--target/zaurus/Makefile19
-rw-r--r--target/zaurus/device.mk8
-rw-r--r--target/zaurus/files/etc/mdev.conf11
-rw-r--r--target/zaurus/kernel.config1971
-rw-r--r--target/zaurus/uclibc.config244
-rw-r--r--toolchain/Makefile92
-rw-r--r--toolchain/binutils/Makefile43
-rw-r--r--toolchain/binutils/Makefile.inc11
-rw-r--r--toolchain/gcc/Makefile100
-rw-r--r--toolchain/gcc/Makefile.inc11
-rw-r--r--toolchain/gcc/patches/arm-softfloat-libgcc.patch29
-rw-r--r--toolchain/gdb/Config.in8
-rw-r--r--toolchain/gdb/Makefile47
-rw-r--r--toolchain/gdb/Makefile.inc11
-rw-r--r--toolchain/glibc/Makefile99
-rw-r--r--toolchain/glibc/Makefile.inc10
-rw-r--r--toolchain/glibc/patches/binutils.patch12
-rw-r--r--toolchain/glibc/patches/gcc43.patch18
-rw-r--r--toolchain/glibc/patches/i586-chk.patch15
-rw-r--r--toolchain/glibc/patches/install-extra.patch84
-rw-r--r--toolchain/glibc/patches/make-install-lib.patch17
-rw-r--r--toolchain/gmp/Makefile32
-rw-r--r--toolchain/gmp/Makefile.inc12
-rw-r--r--toolchain/kernel-headers/Makefile32
-rw-r--r--toolchain/kernel-headers/files/cryptodev.h478
-rw-r--r--toolchain/kernel-headers/patches/cleankernel.patch11
-rw-r--r--toolchain/kernel-headers/patches/etrax-header.patch68
-rw-r--r--toolchain/mpfr/Makefile33
-rw-r--r--toolchain/mpfr/Makefile.inc11
-rw-r--r--toolchain/rules.mk7
-rw-r--r--toolchain/uClibc/Makefile72
-rw-r--r--toolchain/uClibc/Makefile.inc11
2881 files changed, 385468 insertions, 0 deletions
diff --git a/BSDmakefile b/BSDmakefile
new file mode 100644
index 000000000..7e64bb03b
--- /dev/null
+++ b/BSDmakefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+TOPDIR= ${.CURDIR}
+PWD= ${.CURDIR}
+
+.if defined(package) && !empty(package)
+subdir:= package/${package}
+. if !make(clean)
+_subdir_dep:= ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
+. endif
+.endif
+
+.if defined(subdir) && !empty(subdir)
+_subdir:= ${.TARGETS}
+${.TARGETS}: _subdir
+
+_subdir: ${_subdir_dep}
+ @if test x"$$(umask 2>/dev/null | sed 's/00*22/OK/')" != x"OK"; then \
+ echo >&2 Error: you must build with “umask 022â€, sorry.; \
+ exit 1; \
+ fi
+ cd ${.CURDIR}/${subdir} && TOPDIR=${.CURDIR} DEVELOPER=1 \
+ gmake VERBOSE=1 ${.MFLAGS} ${_subdir}
+
+. include "${.CURDIR}/prereq.mk"
+. include "${.CURDIR}/mk/split-cfg.mk"
+.else
+. include "${.CURDIR}/prereq.mk"
+. include "${.CURDIR}/Makefile"
+.endif
diff --git a/BUGS b/BUGS
new file mode 100644
index 000000000..4ed83a61c
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,7 @@
+- lvm package and device-mapper combine and shared
+- use kmod-template for external kernel modules
+- optimize iptables package (libdirs depending on choosen kernel features)
+- checksum for toolchain packages
+- network scripts for wireless client / ap
+- x11 support completion
+- disable platforms zaurus / qemu etrax
diff --git a/COPYING b/COPYING
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/Config.default b/Config.default
new file mode 100644
index 000000000..1672c50c2
--- /dev/null
+++ b/Config.default
@@ -0,0 +1,1619 @@
+#
+# Automatically generated make config: don't edit
+#
+MODULES=y
+ADK_HAVE_DOT_CONFIG=y
+ADK_alix1c=y
+ADK_DEVICE="alix1c"
+
+#
+# Target system
+#
+ADK_LINUX_X86_ALIX1C=y
+# ADK_LINUX_CRIS_FOXBOARD is not set
+# ADK_LINUX_MIPS_RB411 is not set
+# ADK_LINUX_MIPS_RB433 is not set
+# ADK_LINUX_MIPS_RB532 is not set
+# ADK_LINUX_XSCALE_ZAURUS is not set
+# ADK_LINUX_X86_IBM_X40 is not set
+# ADK_LINUX_QEMU is not set
+ADK_KERNEL_NETWORK_FILESYSTEMS=y
+# ADK_KERNEL_IP_PNP is not set
+# ADK_KERNEL_IP_PNP_DHCP is not set
+# ADK_KERNEL_NFS_FS is not set
+# ADK_KERNEL_NFS_V3 is not set
+# ADK_KERNEL_ROOT_NFS is not set
+# ADK_KERNEL_LOCKD is not set
+# ADK_KERNEL_NFS_COMMON is not set
+# ADK_KERNEL_SUNRPC is not set
+ADK_KERNEL_EXT2_FS=y
+ADK_TARGET_LIB_UCLIBC=y
+# ADK_TARGET_LIB_GLIBC is not set
+# ADK_TARGET_ROOTFS_INITRAMFS is not set
+# ADK_TARGET_ROOTFS_SQUASHFS is not set
+# ADK_TARGET_ROOTFS_YAFFS is not set
+# ADK_TARGET_ROOTFS_NFSROOT is not set
+ADK_TARGET_ROOTFS_EXT2_CF=y
+# ADK_TARGET_ROOTFS_EXT2 is not set
+# ADK_SSP is not set
+# ADK_CXX is not set
+# ADK_IPV6 is not set
+# ADK_XORG is not set
+
+#
+# Package selection
+#
+
+#
+# Package categories
+#
+
+#
+# Applications
+#
+
+#
+# Basesystem
+#
+ADK_PACKAGE_BASE_FILES=y
+ADK_PACKAGE_CONFIG_IN_ETC=y
+ADK_PACKAGE_BUSYBOX=y
+
+#
+# Busybox Configuration
+#
+BUSYBOX_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# BUSYBOX_DESKTOP is not set
+# BUSYBOX_EXTRA_COMPAT is not set
+# BUSYBOX_FEATURE_ASSUME_UNICODE is not set
+BUSYBOX_FEATURE_BUFFERS_USE_MALLOC=y
+# BUSYBOX_FEATURE_BUFFERS_GO_ON_STACK is not set
+# BUSYBOX_FEATURE_BUFFERS_GO_IN_BSS is not set
+BUSYBOX_SHOW_USAGE=y
+BUSYBOX_FEATURE_VERBOSE_USAGE=y
+BUSYBOX_FEATURE_COMPRESS_USAGE=y
+# BUSYBOX_FEATURE_INSTALLER is not set
+# BUSYBOX_LOCALE_SUPPORT is not set
+BUSYBOX_GETOPT_LONG=y
+BUSYBOX_FEATURE_DEVPTS=y
+# BUSYBOX_FEATURE_CLEAN_UP is not set
+# BUSYBOX_FEATURE_PIDFILE is not set
+BUSYBOX_FEATURE_SUID=y
+# BUSYBOX_FEATURE_SUID_CONFIG is not set
+# BUSYBOX_FEATURE_PREFER_APPLETS is not set
+BUSYBOX_BUSYBOX_EXEC_PATH="/proc/self/exe"
+BUSYBOX_FEATURE_SYSLOG=y
+# BUSYBOX_FEATURE_HAVE_RPC is not set
+
+#
+# Build Options
+#
+BUSYBOX_LFS=y
+BUSYBOX_CROSS_COMPILER_PREFIX=""
+
+#
+# Debugging Options
+#
+# BUSYBOX_DEBUG is not set
+# BUSYBOX_WERROR is not set
+BUSYBOX_NO_DEBUG_LIB=y
+# BUSYBOX_DMALLOC is not set
+# BUSYBOX_EFENCE is not set
+BUSYBOX_INCLUDE_SUSv2=y
+
+#
+# Installation Options
+#
+# BUSYBOX_INSTALL_NO_USR is not set
+BUSYBOX_INSTALL_APPLET_SYMLINKS=y
+# BUSYBOX_INSTALL_APPLET_HARDLINKS is not set
+# BUSYBOX_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# BUSYBOX_INSTALL_APPLET_DONT is not set
+BUSYBOX_PREFIX="@IDIR@"
+
+#
+# Busybox Library Tuning
+#
+BUSYBOX_PASSWORD_MINLEN=6
+BUSYBOX_MD5_SIZE_VS_SPEED=2
+# BUSYBOX_FEATURE_FAST_TOP is not set
+# BUSYBOX_FEATURE_ETC_NETWORKS is not set
+BUSYBOX_FEATURE_EDITING=y
+BUSYBOX_FEATURE_EDITING_MAX_LEN=1024
+# BUSYBOX_FEATURE_EDITING_VI is not set
+BUSYBOX_FEATURE_EDITING_HISTORY=15
+# BUSYBOX_FEATURE_EDITING_SAVEHISTORY is not set
+BUSYBOX_FEATURE_TAB_COMPLETION=y
+# BUSYBOX_FEATURE_USERNAME_COMPLETION is not set
+# BUSYBOX_FEATURE_EDITING_FANCY_PROMPT is not set
+# BUSYBOX_FEATURE_VERBOSE_CP_MESSAGE is not set
+BUSYBOX_FEATURE_COPYBUF_KB=4
+BUSYBOX_MONOTONIC_SYSCALL=y
+BUSYBOX_IOCTL_HEX2STR_ERROR=y
+# BUSYBOX_FEATURE_HWIB is not set
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# BUSYBOX_FEATURE_SEAMLESS_LZMA is not set
+# BUSYBOX_FEATURE_SEAMLESS_BZ2 is not set
+# BUSYBOX_FEATURE_SEAMLESS_GZ is not set
+# BUSYBOX_FEATURE_SEAMLESS_Z is not set
+# BUSYBOX_AR is not set
+BUSYBOX_BUNZIP2=y
+# BUSYBOX_BZIP2 is not set
+BUSYBOX_CPIO=y
+# BUSYBOX_FEATURE_CPIO_O is not set
+# BUSYBOX_DPKG is not set
+# BUSYBOX_DPKG_DEB is not set
+BUSYBOX_GUNZIP=y
+BUSYBOX_GZIP=y
+BUSYBOX_IPKG=y
+# BUSYBOX_RPM2CPIO is not set
+# BUSYBOX_RPM is not set
+BUSYBOX_TAR=y
+# BUSYBOX_UNCOMPRESS is not set
+# BUSYBOX_UNLZMA is not set
+BUSYBOX_UNZIP=y
+
+#
+# Coreutils
+#
+BUSYBOX_BASENAME=y
+# BUSYBOX_CAL is not set
+BUSYBOX_CAT=y
+# BUSYBOX_CATV is not set
+BUSYBOX_CHGRP=y
+BUSYBOX_CHMOD=y
+BUSYBOX_CHOWN=y
+BUSYBOX_CHROOT=y
+BUSYBOX_CKSUM=y
+BUSYBOX_COMM=y
+BUSYBOX_CP=y
+BUSYBOX_CUT=y
+BUSYBOX_DATE=y
+BUSYBOX_FEATURE_DATE_ISOFMT=y
+BUSYBOX_DD=y
+BUSYBOX_FEATURE_DD_SIGNAL_HANDLING=y
+BUSYBOX_FEATURE_DD_IBS_OBS=y
+BUSYBOX_DF=y
+BUSYBOX_FEATURE_DF_FANCY=y
+BUSYBOX_DIRNAME=y
+BUSYBOX_DOS2UNIX=y
+BUSYBOX_UNIX2DOS=y
+BUSYBOX_DU=y
+BUSYBOX_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+BUSYBOX_ECHO=y
+BUSYBOX_FEATURE_FANCY_ECHO=y
+BUSYBOX_ENV=y
+# BUSYBOX_FEATURE_ENV_LONG_OPTIONS is not set
+# BUSYBOX_EXPAND is not set
+BUSYBOX_EXPR=y
+# BUSYBOX_EXPR_MATH_SUPPORT_64 is not set
+BUSYBOX_FALSE=y
+# BUSYBOX_FOLD is not set
+BUSYBOX_HEAD=y
+BUSYBOX_FEATURE_FANCY_HEAD=y
+# BUSYBOX_HOSTID is not set
+BUSYBOX_ID=y
+# BUSYBOX_INSTALL is not set
+# BUSYBOX_LENGTH is not set
+BUSYBOX_LN=y
+# BUSYBOX_LOGNAME is not set
+BUSYBOX_LS=y
+BUSYBOX_FEATURE_LS_FILETYPES=y
+BUSYBOX_FEATURE_LS_FOLLOWLINKS=y
+BUSYBOX_FEATURE_LS_RECURSIVE=y
+BUSYBOX_FEATURE_LS_SORTFILES=y
+BUSYBOX_FEATURE_LS_TIMESTAMPS=y
+BUSYBOX_FEATURE_LS_USERNAME=y
+# BUSYBOX_FEATURE_LS_COLOR is not set
+BUSYBOX_MD5SUM=y
+BUSYBOX_MKDIR=y
+# BUSYBOX_FEATURE_MKDIR_LONG_OPTIONS is not set
+BUSYBOX_MKFIFO=y
+BUSYBOX_MKNOD=y
+BUSYBOX_MV=y
+# BUSYBOX_FEATURE_MV_LONG_OPTIONS is not set
+BUSYBOX_NICE=y
+BUSYBOX_NOHUP=y
+# BUSYBOX_OD is not set
+# BUSYBOX_PRINTENV is not set
+BUSYBOX_PRINTF=y
+BUSYBOX_PWD=y
+BUSYBOX_READLINK=y
+BUSYBOX_FEATURE_READLINK_FOLLOW=y
+# BUSYBOX_REALPATH is not set
+BUSYBOX_RM=y
+# BUSYBOX_RMDIR is not set
+BUSYBOX_SEQ=y
+BUSYBOX_SHA1SUM=y
+BUSYBOX_SLEEP=y
+# BUSYBOX_FEATURE_FANCY_SLEEP is not set
+BUSYBOX_SORT=y
+BUSYBOX_FEATURE_SORT_BIG=y
+# BUSYBOX_SPLIT is not set
+# BUSYBOX_STAT is not set
+BUSYBOX_STTY=y
+# BUSYBOX_SUM is not set
+BUSYBOX_SYNC=y
+# BUSYBOX_TAC is not set
+BUSYBOX_TAIL=y
+# BUSYBOX_FEATURE_FANCY_TAIL is not set
+BUSYBOX_TEE=y
+# BUSYBOX_FEATURE_TEE_USE_BLOCK_IO is not set
+BUSYBOX_TEST=y
+# BUSYBOX_FEATURE_TEST_64 is not set
+BUSYBOX_TOUCH=y
+BUSYBOX_TR=y
+BUSYBOX_FEATURE_TR_CLASSES=y
+# BUSYBOX_FEATURE_TR_EQUIV is not set
+BUSYBOX_TRUE=y
+# BUSYBOX_TTY is not set
+BUSYBOX_UNAME=y
+# BUSYBOX_UNEXPAND is not set
+BUSYBOX_UNIQ=y
+# BUSYBOX_USLEEP is not set
+# BUSYBOX_UUDECODE is not set
+# BUSYBOX_UUENCODE is not set
+BUSYBOX_WC=y
+# BUSYBOX_FEATURE_WC_LARGE is not set
+BUSYBOX_WHO=y
+# BUSYBOX_WHOAMI is not set
+BUSYBOX_YES=y
+
+#
+# Common options for cp and mv
+#
+BUSYBOX_FEATURE_PRESERVE_HARDLINKS=y
+
+#
+# Common options for ls, more and telnet
+#
+BUSYBOX_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+BUSYBOX_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum
+#
+BUSYBOX_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+# BUSYBOX_CHVT is not set
+BUSYBOX_CLEAR=y
+# BUSYBOX_DEALLOCVT is not set
+# BUSYBOX_DUMPKMAP is not set
+# BUSYBOX_KBD_MODE is not set
+# BUSYBOX_LOADFONT is not set
+# BUSYBOX_LOADKMAP is not set
+# BUSYBOX_OPENVT is not set
+BUSYBOX_RESET=y
+# BUSYBOX_RESIZE is not set
+# BUSYBOX_SETCONSOLE is not set
+# BUSYBOX_SETFONT is not set
+# BUSYBOX_SETKEYCODES is not set
+# BUSYBOX_SETLOGCONS is not set
+# BUSYBOX_SHOWKEY is not set
+
+#
+# Debian Utilities
+#
+BUSYBOX_MKTEMP=y
+# BUSYBOX_PIPE_PROGRESS is not set
+BUSYBOX_RUN_PARTS=y
+# BUSYBOX_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+# BUSYBOX_FEATURE_RUN_PARTS_FANCY is not set
+# BUSYBOX_START_STOP_DAEMON is not set
+BUSYBOX_WHICH=y
+
+#
+# Editors
+#
+BUSYBOX_AWK=y
+BUSYBOX_FEATURE_AWK_LIBM=y
+# BUSYBOX_CMP is not set
+BUSYBOX_DIFF=y
+BUSYBOX_FEATURE_DIFF_BINARY=y
+BUSYBOX_FEATURE_DIFF_DIR=y
+# BUSYBOX_FEATURE_DIFF_MINIMAL is not set
+# BUSYBOX_ED is not set
+# BUSYBOX_PATCH is not set
+BUSYBOX_SED=y
+BUSYBOX_VI=y
+BUSYBOX_FEATURE_VI_MAX_LEN=4096
+BUSYBOX_FEATURE_VI_8BIT=y
+BUSYBOX_FEATURE_VI_COLON=y
+BUSYBOX_FEATURE_VI_YANKMARK=y
+BUSYBOX_FEATURE_VI_SEARCH=y
+BUSYBOX_FEATURE_VI_USE_SIGNALS=y
+BUSYBOX_FEATURE_VI_DOT_CMD=y
+BUSYBOX_FEATURE_VI_READONLY=y
+BUSYBOX_FEATURE_VI_SETOPTS=y
+BUSYBOX_FEATURE_VI_SET=y
+BUSYBOX_FEATURE_VI_WIN_RESIZE=y
+BUSYBOX_FEATURE_VI_OPTIMIZE_CURSOR=y
+BUSYBOX_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+BUSYBOX_FIND=y
+BUSYBOX_FEATURE_FIND_PRINT0=y
+BUSYBOX_FEATURE_FIND_MTIME=y
+BUSYBOX_FEATURE_FIND_MMIN=y
+BUSYBOX_FEATURE_FIND_PERM=y
+BUSYBOX_FEATURE_FIND_TYPE=y
+BUSYBOX_FEATURE_FIND_XDEV=y
+BUSYBOX_FEATURE_FIND_MAXDEPTH=y
+BUSYBOX_FEATURE_FIND_NEWER=y
+BUSYBOX_FEATURE_FIND_INUM=y
+BUSYBOX_FEATURE_FIND_EXEC=y
+BUSYBOX_FEATURE_FIND_USER=y
+BUSYBOX_FEATURE_FIND_GROUP=y
+BUSYBOX_FEATURE_FIND_NOT=y
+BUSYBOX_FEATURE_FIND_DEPTH=y
+BUSYBOX_FEATURE_FIND_PAREN=y
+BUSYBOX_FEATURE_FIND_SIZE=y
+BUSYBOX_FEATURE_FIND_PRUNE=y
+BUSYBOX_FEATURE_FIND_EMPTY=y
+BUSYBOX_FEATURE_FIND_DELETE=y
+BUSYBOX_FEATURE_FIND_PATH=y
+BUSYBOX_FEATURE_FIND_REGEX=y
+BUSYBOX_GREP=y
+BUSYBOX_FEATURE_GREP_EGREP_ALIAS=y
+BUSYBOX_FEATURE_GREP_FGREP_ALIAS=y
+BUSYBOX_FEATURE_GREP_CONTEXT=y
+BUSYBOX_XARGS=y
+# BUSYBOX_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# BUSYBOX_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# BUSYBOX_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# BUSYBOX_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+
+#
+# Init Utilities
+#
+BUSYBOX_INIT=y
+BUSYBOX_FEATURE_USE_INITTAB=y
+BUSYBOX_FEATURE_KILL_REMOVED=y
+BUSYBOX_FEATURE_KILL_DELAY=0
+# BUSYBOX_FEATURE_INIT_SCTTY is not set
+BUSYBOX_FEATURE_INIT_SYSLOG=y
+# BUSYBOX_FEATURE_EXTRA_QUIET is not set
+# BUSYBOX_FEATURE_INIT_COREDUMPS is not set
+# BUSYBOX_FEATURE_INITRD is not set
+BUSYBOX_HALT=y
+# BUSYBOX_MESG is not set
+
+#
+# Login/Password Management Utilities
+#
+BUSYBOX_FEATURE_SHADOWPASSWDS=y
+BUSYBOX_USE_BB_PWD_GRP=y
+BUSYBOX_USE_BB_SHADOW=y
+BUSYBOX_USE_BB_CRYPT=y
+BUSYBOX_ADDGROUP=y
+# BUSYBOX_FEATURE_ADDUSER_TO_GROUP is not set
+BUSYBOX_DELGROUP=y
+# BUSYBOX_FEATURE_DEL_USER_FROM_GROUP is not set
+# BUSYBOX_FEATURE_CHECK_NAMES is not set
+BUSYBOX_ADDUSER=y
+# BUSYBOX_FEATURE_ADDUSER_LONG_OPTIONS is not set
+BUSYBOX_DELUSER=y
+BUSYBOX_GETTY=y
+BUSYBOX_FEATURE_UTMP=y
+BUSYBOX_FEATURE_WTMP=y
+BUSYBOX_LOGIN=y
+# BUSYBOX_LOGIN_SCRIPTS is not set
+BUSYBOX_FEATURE_NOLOGIN=y
+BUSYBOX_FEATURE_SECURETTY=y
+BUSYBOX_PASSWD=y
+BUSYBOX_FEATURE_PASSWD_WEAK_CHECK=y
+# BUSYBOX_CRYPTPW is not set
+# BUSYBOX_CHPASSWD is not set
+BUSYBOX_SU=y
+BUSYBOX_FEATURE_SU_SYSLOG=y
+BUSYBOX_FEATURE_SU_CHECKS_SHELLS=y
+# BUSYBOX_SULOGIN is not set
+# BUSYBOX_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+# BUSYBOX_CHATTR is not set
+# BUSYBOX_FSCK is not set
+# BUSYBOX_LSATTR is not set
+
+#
+# Linux Module Utilities
+#
+BUSYBOX_DEFAULT_MODULES_DIR="/lib/modules"
+BUSYBOX_DEFAULT_DEPMOD_FILE="modules.dep"
+# BUSYBOX_MODPROBE_SMALL is not set
+BUSYBOX_INSMOD=y
+BUSYBOX_RMMOD=y
+BUSYBOX_LSMOD=y
+# BUSYBOX_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+# BUSYBOX_MODPROBE is not set
+# BUSYBOX_DEPMOD is not set
+
+#
+# Options common to multiple modutils
+#
+# BUSYBOX_FEATURE_2_4_MODULES is not set
+BUSYBOX_FEATURE_CHECK_TAINTED_MODULE=y
+
+#
+# Linux System Utilities
+#
+BUSYBOX_BLKID=y
+BUSYBOX_DMESG=y
+BUSYBOX_FEATURE_DMESG_PRETTY=y
+# BUSYBOX_FBSET is not set
+# BUSYBOX_FDFLUSH is not set
+# BUSYBOX_FDFORMAT is not set
+BUSYBOX_FDISK=y
+BUSYBOX_FDISK_SUPPORT_LARGE_DISKS=y
+BUSYBOX_FEATURE_FDISK_WRITABLE=y
+# BUSYBOX_FEATURE_AIX_LABEL is not set
+# BUSYBOX_FEATURE_SGI_LABEL is not set
+# BUSYBOX_FEATURE_SUN_LABEL is not set
+# BUSYBOX_FEATURE_OSF_LABEL is not set
+# BUSYBOX_FEATURE_FDISK_ADVANCED is not set
+# BUSYBOX_FINDFS is not set
+# BUSYBOX_FREERAMDISK is not set
+# BUSYBOX_FSCK_MINIX is not set
+# BUSYBOX_MKFS_MINIX is not set
+# BUSYBOX_GETOPT is not set
+BUSYBOX_HEXDUMP=y
+# BUSYBOX_FEATURE_HEXDUMP_REVERSE is not set
+# BUSYBOX_HD is not set
+BUSYBOX_HWCLOCK=y
+# BUSYBOX_FEATURE_HWCLOCK_LONG_OPTIONS is not set
+BUSYBOX_FEATURE_HWCLOCK_ADJTIME_FHS=y
+BUSYBOX_IPCRM=y
+BUSYBOX_IPCS=y
+BUSYBOX_LOSETUP=y
+BUSYBOX_MDEV=y
+BUSYBOX_FEATURE_MDEV_CONF=y
+BUSYBOX_FEATURE_MDEV_RENAME=y
+BUSYBOX_FEATURE_MDEV_RENAME_REGEXP=y
+BUSYBOX_FEATURE_MDEV_EXEC=y
+BUSYBOX_FEATURE_MDEV_LOAD_FIRMWARE=y
+# BUSYBOX_MKSWAP is not set
+BUSYBOX_MORE=y
+BUSYBOX_FEATURE_USE_TERMIOS=y
+BUSYBOX_VOLUMEID=y
+# BUSYBOX_FEATURE_VOLUMEID_EXT is not set
+# BUSYBOX_FEATURE_VOLUMEID_REISERFS is not set
+# BUSYBOX_FEATURE_VOLUMEID_FAT is not set
+# BUSYBOX_FEATURE_VOLUMEID_HFS is not set
+# BUSYBOX_FEATURE_VOLUMEID_JFS is not set
+BUSYBOX_FEATURE_VOLUMEID_XFS=y
+# BUSYBOX_FEATURE_VOLUMEID_NTFS is not set
+# BUSYBOX_FEATURE_VOLUMEID_ISO9660 is not set
+# BUSYBOX_FEATURE_VOLUMEID_UDF is not set
+# BUSYBOX_FEATURE_VOLUMEID_LUKS is not set
+# BUSYBOX_FEATURE_VOLUMEID_LINUXSWAP is not set
+# BUSYBOX_FEATURE_VOLUMEID_CRAMFS is not set
+# BUSYBOX_FEATURE_VOLUMEID_ROMFS is not set
+# BUSYBOX_FEATURE_VOLUMEID_SYSV is not set
+# BUSYBOX_FEATURE_VOLUMEID_OCFS2 is not set
+# BUSYBOX_FEATURE_VOLUMEID_LINUXRAID is not set
+BUSYBOX_MOUNT=y
+# BUSYBOX_FEATURE_MOUNT_FAKE is not set
+# BUSYBOX_FEATURE_MOUNT_VERBOSE is not set
+BUSYBOX_FEATURE_MOUNT_HELPERS=y
+BUSYBOX_FEATURE_MOUNT_LABEL=y
+# BUSYBOX_FEATURE_MOUNT_NFS is not set
+# BUSYBOX_FEATURE_MOUNT_CIFS is not set
+BUSYBOX_FEATURE_MOUNT_FLAGS=y
+BUSYBOX_FEATURE_MOUNT_FSTAB=y
+# BUSYBOX_PIVOT_ROOT is not set
+BUSYBOX_RDATE=y
+# BUSYBOX_RDEV is not set
+# BUSYBOX_READPROFILE is not set
+# BUSYBOX_RTCWAKE is not set
+# BUSYBOX_SCRIPT is not set
+# BUSYBOX_SETARCH is not set
+# BUSYBOX_SWAPONOFF is not set
+# BUSYBOX_SWITCH_ROOT is not set
+BUSYBOX_UMOUNT=y
+# BUSYBOX_FEATURE_UMOUNT_ALL is not set
+
+#
+# Common options for mount/umount
+#
+BUSYBOX_FEATURE_MOUNT_LOOP=y
+# BUSYBOX_FEATURE_MTAB_SUPPORT is not set
+
+#
+# Miscellaneous Utilities
+#
+# BUSYBOX_ADJTIMEX is not set
+# BUSYBOX_BBCONFIG is not set
+# BUSYBOX_CHAT is not set
+# BUSYBOX_CHRT is not set
+BUSYBOX_CROND=y
+# BUSYBOX_FEATURE_CROND_D is not set
+# BUSYBOX_FEATURE_CROND_CALL_SENDMAIL is not set
+BUSYBOX_CRONTAB=y
+# BUSYBOX_DC is not set
+# BUSYBOX_DEVFSD is not set
+# BUSYBOX_FEATURE_DEVFS is not set
+# BUSYBOX_DEVMEM is not set
+# BUSYBOX_EJECT is not set
+# BUSYBOX_FBSPLASH is not set
+# BUSYBOX_INOTIFYD is not set
+# BUSYBOX_LAST is not set
+BUSYBOX_LESS=y
+BUSYBOX_FEATURE_LESS_MAXLINES=9999999
+# BUSYBOX_FEATURE_LESS_BRACKETS is not set
+# BUSYBOX_FEATURE_LESS_FLAGS is not set
+# BUSYBOX_FEATURE_LESS_DASHCMD is not set
+# BUSYBOX_FEATURE_LESS_MARKS is not set
+# BUSYBOX_FEATURE_LESS_REGEXP is not set
+BUSYBOX_FEATURE_LESS_WINCH=y
+# BUSYBOX_HDPARM is not set
+# BUSYBOX_MAKEDEVS is not set
+# BUSYBOX_MAN is not set
+# BUSYBOX_MICROCOM is not set
+# BUSYBOX_MOUNTPOINT is not set
+# BUSYBOX_MT is not set
+# BUSYBOX_RAIDAUTORUN is not set
+# BUSYBOX_READAHEAD is not set
+# BUSYBOX_RUNLEVEL is not set
+# BUSYBOX_RX is not set
+# BUSYBOX_SETSID is not set
+# BUSYBOX_STRINGS is not set
+# BUSYBOX_TASKSET is not set
+# BUSYBOX_TIME is not set
+# BUSYBOX_TTYSIZE is not set
+# BUSYBOX_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+# BUSYBOX_FEATURE_IPV6 is not set
+# BUSYBOX_VERBOSE_RESOLUTION_ERRORS is not set
+BUSYBOX_ARP=y
+BUSYBOX_ARPING=y
+# BUSYBOX_BRCTL is not set
+# BUSYBOX_DNSD is not set
+# BUSYBOX_ETHER_WAKE is not set
+# BUSYBOX_FAKEIDENTD is not set
+# BUSYBOX_FTPGET is not set
+# BUSYBOX_FTPPUT is not set
+BUSYBOX_HOSTNAME=y
+# BUSYBOX_HTTPD is not set
+BUSYBOX_IFCONFIG=y
+BUSYBOX_FEATURE_IFCONFIG_STATUS=y
+# BUSYBOX_FEATURE_IFCONFIG_SLIP is not set
+# BUSYBOX_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+BUSYBOX_FEATURE_IFCONFIG_HW=y
+BUSYBOX_FEATURE_IFCONFIG_BROADCAST_PLUS=y
+# BUSYBOX_IFENSLAVE is not set
+BUSYBOX_IFUPDOWN=y
+BUSYBOX_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
+BUSYBOX_FEATURE_IFUPDOWN_IP=y
+BUSYBOX_FEATURE_IFUPDOWN_IP_BUILTIN=y
+BUSYBOX_FEATURE_IFUPDOWN_IPV4=y
+# BUSYBOX_FEATURE_IFUPDOWN_MAPPING is not set
+# BUSYBOX_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
+# BUSYBOX_INETD is not set
+BUSYBOX_IP=y
+BUSYBOX_FEATURE_IP_ADDRESS=y
+BUSYBOX_FEATURE_IP_LINK=y
+BUSYBOX_FEATURE_IP_ROUTE=y
+# BUSYBOX_FEATURE_IP_TUNNEL is not set
+# BUSYBOX_FEATURE_IP_RULE is not set
+# BUSYBOX_FEATURE_IP_SHORT_FORMS is not set
+# BUSYBOX_FEATURE_IP_RARE_PROTOCOLS is not set
+# BUSYBOX_IPCALC is not set
+# BUSYBOX_NAMEIF is not set
+BUSYBOX_NC=y
+BUSYBOX_NC_SERVER=y
+# BUSYBOX_NC_EXTRA is not set
+BUSYBOX_NETSTAT=y
+# BUSYBOX_FEATURE_NETSTAT_WIDE is not set
+BUSYBOX_FEATURE_NETSTAT_PRG=y
+BUSYBOX_NSLOOKUP=y
+BUSYBOX_PING=y
+BUSYBOX_FEATURE_FANCY_PING=y
+# BUSYBOX_PSCAN is not set
+BUSYBOX_ROUTE=y
+# BUSYBOX_SLATTACH is not set
+BUSYBOX_TELNET=y
+BUSYBOX_FEATURE_TELNET_TTYPE=y
+BUSYBOX_FEATURE_TELNET_AUTOLOGIN=y
+# BUSYBOX_TELNETD is not set
+# BUSYBOX_TFTP is not set
+# BUSYBOX_TFTPD is not set
+BUSYBOX_TRACEROUTE=y
+BUSYBOX_FEATURE_TRACEROUTE_VERBOSE=y
+# BUSYBOX_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+BUSYBOX_FEATURE_TRACEROUTE_USE_ICMP=y
+# BUSYBOX_APP_UDHCPD is not set
+BUSYBOX_APP_UDHCPC=y
+BUSYBOX_FEATURE_UDHCPC_ARPING=y
+# BUSYBOX_FEATURE_UDHCP_PORT is not set
+# BUSYBOX_UDHCP_DEBUG is not set
+# BUSYBOX_FEATURE_UDHCP_RFC3397 is not set
+BUSYBOX_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
+BUSYBOX_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
+# BUSYBOX_VCONFIG is not set
+BUSYBOX_WGET=y
+# BUSYBOX_FEATURE_WGET_STATUSBAR is not set
+BUSYBOX_FEATURE_WGET_AUTHENTICATION=y
+# BUSYBOX_FEATURE_WGET_LONG_OPTIONS is not set
+# BUSYBOX_ZCIP is not set
+# BUSYBOX_TCPSVD is not set
+# BUSYBOX_UDPSVD is not set
+
+#
+# Print Utilities
+#
+# BUSYBOX_LPD is not set
+# BUSYBOX_LPR is not set
+# BUSYBOX_LPQ is not set
+
+#
+# Mail Utilities
+#
+# BUSYBOX_MAKEMIME is not set
+# BUSYBOX_POPMAILDIR is not set
+# BUSYBOX_REFORMIME is not set
+# BUSYBOX_SENDMAIL is not set
+
+#
+# Process Utilities
+#
+BUSYBOX_FREE=y
+BUSYBOX_FUSER=y
+BUSYBOX_KILL=y
+BUSYBOX_KILLALL=y
+# BUSYBOX_KILLALL5 is not set
+# BUSYBOX_NMETER is not set
+# BUSYBOX_PGREP is not set
+BUSYBOX_PIDOF=y
+# BUSYBOX_FEATURE_PIDOF_SINGLE is not set
+BUSYBOX_FEATURE_PIDOF_OMIT=y
+BUSYBOX_PKILL=y
+BUSYBOX_PS=y
+# BUSYBOX_FEATURE_PS_WIDE is not set
+# BUSYBOX_RENICE is not set
+BUSYBOX_BB_SYSCTL=y
+BUSYBOX_TOP=y
+BUSYBOX_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+BUSYBOX_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
+# BUSYBOX_FEATURE_TOP_SMP_CPU is not set
+# BUSYBOX_FEATURE_TOP_DECIMALS is not set
+# BUSYBOX_FEATURE_TOP_SMP_PROCESS is not set
+# BUSYBOX_FEATURE_TOPMEM is not set
+BUSYBOX_UPTIME=y
+BUSYBOX_WATCH=y
+
+#
+# Runit Utilities
+#
+# BUSYBOX_RUNSV is not set
+# BUSYBOX_RUNSVDIR is not set
+# BUSYBOX_SV is not set
+# BUSYBOX_SVLOGD is not set
+# BUSYBOX_CHPST is not set
+# BUSYBOX_SETUIDGID is not set
+# BUSYBOX_ENVUIDGID is not set
+# BUSYBOX_ENVDIR is not set
+# BUSYBOX_SOFTLIMIT is not set
+
+#
+# Shells
+#
+BUSYBOX_FEATURE_SH_IS_ASH=y
+# BUSYBOX_FEATURE_SH_IS_HUSH is not set
+# BUSYBOX_FEATURE_SH_IS_MSH is not set
+# BUSYBOX_FEATURE_SH_IS_NONE is not set
+BUSYBOX_ASH=y
+
+#
+# Ash Shell Options
+#
+BUSYBOX_ASH_BASH_COMPAT=y
+BUSYBOX_ASH_JOB_CONTROL=y
+# BUSYBOX_ASH_READ_NCHARS is not set
+# BUSYBOX_ASH_READ_TIMEOUT is not set
+BUSYBOX_ASH_ALIAS=y
+BUSYBOX_ASH_MATH_SUPPORT=y
+# BUSYBOX_ASH_MATH_SUPPORT_64 is not set
+BUSYBOX_ASH_GETOPTS=y
+BUSYBOX_ASH_BUILTIN_ECHO=y
+BUSYBOX_ASH_BUILTIN_PRINTF=y
+BUSYBOX_ASH_BUILTIN_TEST=y
+# BUSYBOX_ASH_CMDCMD is not set
+# BUSYBOX_ASH_MAIL is not set
+BUSYBOX_ASH_OPTIMIZE_FOR_SIZE=y
+# BUSYBOX_ASH_RANDOM_SUPPORT is not set
+# BUSYBOX_ASH_EXPAND_PRMT is not set
+# BUSYBOX_HUSH is not set
+# BUSYBOX_LASH is not set
+# BUSYBOX_MSH is not set
+
+#
+# Bourne Shell Options
+#
+# BUSYBOX_FEATURE_SH_EXTRA_QUIET is not set
+# BUSYBOX_CTTYHACK is not set
+
+#
+# System Logging Utilities
+#
+BUSYBOX_SYSLOGD=y
+# BUSYBOX_FEATURE_ROTATE_LOGFILE is not set
+# BUSYBOX_FEATURE_REMOTE_LOG is not set
+# BUSYBOX_FEATURE_SYSLOGD_DUP is not set
+BUSYBOX_FEATURE_IPC_SYSLOG=y
+BUSYBOX_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
+BUSYBOX_LOGREAD=y
+BUSYBOX_FEATURE_LOGREAD_REDUCED_LOCKING=y
+BUSYBOX_KLOGD=y
+BUSYBOX_LOGGER=y
+ADK_PACKAGE_UCLIBC=y
+ADK_PACKAGE_CFGFS=y
+
+#
+# Bluetooth
+#
+# ADK_PACKAGE_BLUEZ_FIRMWARE is not set
+# ADK_PACKAGE_BLUEZ is not set
+# ADK_PACKAGE_MIAX is not set
+# ADK_PACKAGE_OBEXFTP is not set
+# ADK_PACKAGE_OPENOBEX is not set
+# ADK_PACKAGE_USSP_PUSH is not set
+
+#
+# Browser
+#
+# ADK_PACKAGE_LINKS is not set
+# ADK_PACKAGE_ELINKS is not set
+# ADK_PACKAGE_LYNX is not set
+
+#
+# Debugging / Analyzing
+#
+# ADK_COMPILE_EXMAP is not set
+# ADK_PACKAGE_EXMAP is not set
+# ADK_PACKAGE_EXMAPD is not set
+# ADK_PACKAGE_EXMAPSERVER is not set
+# ADK_PACKAGE_KMOD_EXMAP is not set
+# ADK_PACKAGE_GDB is not set
+# ADK_PACKAGE_GDBSERVER is not set
+# ADK_PACKAGE_STRACE is not set
+# ADK_PACKAGE_VALGRIND is not set
+
+#
+# Editors / Pager
+#
+# ADK_PACKAGE_LESS is not set
+# ADK_PACKAGE_NANO is not set
+# ADK_PACKAGE_VIM is not set
+
+#
+# Filesystem utilities
+#
+# ADK_PACKAGE_DEVICE_MAPPER is not set
+# ADK_PACKAGE_DOSFSTOOLS is not set
+# ADK_PACKAGE_E2FSPROGS is not set
+# ADK_COMPILE_FUSE is not set
+# ADK_PACKAGE_FUSE_UTILS is not set
+# ADK_PACKAGE_FDISK is not set
+# ADK_PACKAGE_LOSETUP is not set
+# ADK_PACKAGE_SWAP_UTILS is not set
+# ADK_PACKAGE_WDFS is not set
+# ADK_PACKAGE_XFSPROGS is not set
+
+#
+# Mail
+#
+# ADK_PACKAGE_DOVECOT is not set
+# ADK_PACKAGE_FETCHMAIL is not set
+# ADK_PACKAGE_MINI_SENDMAIL is not set
+# ADK_PACKAGE_MUTT is not set
+# ADK_PACKAGE_PROCMAIL is not set
+# ADK_PACKAGE_SSMTP is not set
+# ADK_PACKAGE_VILISTEXTUM is not set
+
+#
+# Misc
+#
+# ADK_PACKAGE_COLLECTD is not set
+# ADK_PACKAGE_DECO is not set
+# ADK_PACKAGE_DIGITEMP is not set
+# ADK_PACKAGE_GPM is not set
+# ADK_PACKAGE_LOGROTATE is not set
+# ADK_PACKAGE_MC is not set
+# ADK_PACKAGE_MGETTY is not set
+# ADK_PACKAGE_MONIT is not set
+# ADK_PACKAGE_MOTION is not set
+# ADK_PACKAGE_OSIRISD is not set
+# ADK_COMPILE_RRDTOOL is not set
+# ADK_PACKAGE_LIBRRD is not set
+# ADK_PACKAGE_RRDCGI is not set
+# ADK_PACKAGE_RRDTOOL is not set
+# ADK_PACKAGE_SANE_BACKENDS is not set
+# ADK_PACKAGE_SCREEN is not set
+# ADK_PACKAGE_SCSI_SPIN is not set
+# ADK_PACKAGE_SER2NET is not set
+# ADK_PACKAGE_SYSLOG_NG is not set
+# ADK_PACKAGE_TAR is not set
+
+#
+# Multimedia
+#
+# ADK_PACKAGE_ALSA_UTILS is not set
+# ADK_PACKAGE_ESOUND is not set
+# ADK_PACKAGE_ICECAST is not set
+# ADK_COMPILE_LAME is not set
+# ADK_PACKAGE_LAME is not set
+# ADK_PACKAGE_MADPLAY is not set
+# ADK_PACKAGE_MPD is not set
+# ADK_PACKAGE_MPLAYER is not set
+# ADK_PACKAGE_MT_DAAPD is not set
+# ADK_PACKAGE_PALANTIR is not set
+# ADK_PACKAGE_SETPWC is not set
+
+#
+# Shells
+#
+# ADK_PACKAGE_BASH is not set
+# ADK_PACKAGE_MKSH is not set
+# ADK_PACKAGE_ZSH is not set
+
+#
+# Security
+#
+# ADK_PACKAGE_CRYPTSETUP is not set
+# ADK_PACKAGE_GPG is not set
+# ADK_COMPILE_HEIMDAL is not set
+# ADK_COMPILE_KRB5 is not set
+# ADK_PACKAGE_OPENCT is not set
+# ADK_PACKAGE_OPENSC is not set
+ADK_COMPILE_OPENSSL=y
+ADK_PACKAGE_LIBOPENSSL=y
+# ADK_PACKAGE_OPENSSL_UTIL is not set
+# ADK_PACKAGE_CA_CERTS is not set
+# ADK_PACKAGE_OPENSSL_PKCS11 is not set
+
+#
+# Serial communications & terminal emulation
+#
+# ADK_PACKAGE_HEYU is not set
+# ADK_PACKAGE_LRZSZ is not set
+# ADK_PACKAGE_PICOCOM is not set
+# ADK_PACKAGE_SERDISPLIB is not set
+# ADK_PACKAGE_SETSERIAL is not set
+
+#
+# Telephony
+#
+# ADK_PACKAGE_ASTERISK is not set
+# ADK_PACKAGE_OPENSIPS is not set
+
+#
+# Utilities
+#
+# ADK_PACKAGE_BC is not set
+# ADK_PACKAGE_DC is not set
+# ADK_PACKAGE_COMGT is not set
+# ADK_PACKAGE_FBSET is not set
+# ADK_PACKAGE_FILE is not set
+# ADK_PACKAGE_HDPARM is not set
+# ADK_PACKAGE_LSUSB is not set
+# ADK_PACKAGE_PCIUTILS is not set
+# ADK_PACKAGE_PROCPS_META is not set
+# ADK_PACKAGE_PROCPS is not set
+# ADK_PACKAGE_SISPMCTL is not set
+# ADK_PACKAGE_STRESS is not set
+# ADK_PACKAGE_SYSSTAT is not set
+# ADK_PACKAGE_UDEV is not set
+# ADK_PACKAGE_WATCHDOG is not set
+
+#
+# Networking
+#
+
+#
+# Analyze / Debugging / Monitoring
+#
+# ADK_PACKAGE_BWM is not set
+# ADK_PACKAGE_DSNIFF is not set
+# ADK_PACKAGE_ETHTOOL is not set
+# ADK_PACKAGE_FPING is not set
+# ADK_PACKAGE_FPROBE is not set
+# ADK_PACKAGE_FPROBE_ULOG is not set
+# ADK_PACKAGE_HTTPING is not set
+# ADK_PACKAGE_IFTOP is not set
+# ADK_PACKAGE_IPCAD is not set
+# ADK_PACKAGE_IPTRAF is not set
+# ADK_PACKAGE_MTR is not set
+# ADK_PACKAGE_NETPERF is not set
+# ADK_PACKAGE_SIPSAK is not set
+# ADK_PACKAGE_SLURM is not set
+# ADK_PACKAGE_TCPDUMP is not set
+# ADK_PACKAGE_TTCP is not set
+
+#
+# DNS / DHCP
+#
+# ADK_PACKAGE_ATFTP is not set
+# ADK_PACKAGE_ATFTPD is not set
+# ADK_PACKAGE_AVAHI_DAEMON is not set
+# ADK_COMPILE_BIND is not set
+# ADK_DUMMY_BIND is not set
+# ADK_PACKAGE_DHCP_RELAY is not set
+# ADK_PACKAGE_DHCP_SERVER is not set
+# ADK_PACKAGE_DHCP_FORWARDER is not set
+# ADK_PACKAGE_DNSMASQ is not set
+# ADK_PACKAGE_EZIPUPDATE is not set
+# ADK_PACKAGE_MARADNS is not set
+# ADK_PACKAGE_UPDATEDD is not set
+
+#
+# HTTP / FTP
+#
+# ADK_PACKAGE_GATLING is not set
+# ADK_PACKAGE_LIGHTTPD is not set
+# ADK_PACKAGE_MINI_HTTPD is not set
+# ADK_PACKAGE_MINI_HTTPD_HTPASSWD is not set
+# ADK_PACKAGE_MINI_HTTPD_OPENSSL is not set
+# ADK_PACKAGE_VSFTPD is not set
+# ADK_PACKAGE_WPUT is not set
+
+#
+# IRC / ICQ / JABBER
+#
+# ADK_PACKAGE_BITLBEE is not set
+# ADK_PACKAGE_IRSSI is not set
+# ADK_PACKAGE_MIAU is not set
+# ADK_PACKAGE_REAIM is not set
+# ADK_PACKAGE_TMSNC is not set
+
+#
+# Firewall / Routing / Bridging
+#
+# ADK_PACKAGE_ARPD is not set
+# ADK_PACKAGE_BRIDGE_UTILS is not set
+# ADK_PACKAGE_CUTTER is not set
+# ADK_PACKAGE_ETHER_WAKE is not set
+# ADK_COMPILE_IPROUTE2 is not set
+# ADK_PACKAGE_IP is not set
+# ADK_PACKAGE_TC is not set
+# ADK_PACKAGE_IPSET is not set
+# ADK_PACKAGE_IPTABLES is not set
+# ADK_PACKAGE_IP6TABLES is not set
+# ADK_PACKAGE_IPTABLES_SNMP is not set
+# ADK_PACKAGE_KNOCK is not set
+# ADK_PACKAGE_KNOCKD is not set
+# ADK_PACKAGE_LINUX_ATM is not set
+# ADK_PACKAGE_MACCHANGER is not set
+# ADK_PACKAGE_NETSTAT_NAT is not set
+# ADK_PACKAGE_ULOGD is not set
+# ADK_PACKAGE_SHOREWALL is not set
+# ADK_PACKAGE_WOL is not set
+# ADK_PACKAGE_WONDERSHAPER is not set
+# ADK_PACKAGE_VRRPD is not set
+
+#
+# Misc
+#
+# ADK_PACKAGE_CUPS is not set
+# ADK_PACKAGE_FAKEIDENTD is not set
+# ADK_PACKAGE_GKRELLMD is not set
+# ADK_COMPILE_NET_SNMP is not set
+# ADK_PACKAGE_LIBNETSNMP is not set
+# ADK_PACKAGE_SNMP_UTILS is not set
+# ADK_PACKAGE_SNMPD is not set
+# ADK_PACKAGE_NUT is not set
+# ADK_COMPILE_OPENLDAP is not set
+# ADK_PACKAGE_P910ND is not set
+# ADK_PACKAGE_PIPACS is not set
+# ADK_PACKAGE_PORTMAP is not set
+# ADK_PACKAGE_RARPD is not set
+# ADK_PACKAGE_RSYNC is not set
+# ADK_PACKAGE_SCDP is not set
+# ADK_PACKAGE_SHAT is not set
+# ADK_PACKAGE_SOCAT is not set
+# ADK_PACKAGE_SUBVERSION is not set
+# ADK_PACKAGE_UDP_BROADCAST_RELAY is not set
+# ADK_PACKAGE_VGP is not set
+# ADK_PACKAGE_VNSTAT is not set
+# ADK_PACKAGE_VTUN is not set
+# ADK_PACKAGE_WCCPD is not set
+# ADK_PACKAGE_XINETD is not set
+
+#
+# Network Filesystems
+#
+# ADK_PACKAGE_DAVFS2 is not set
+# ADK_PACKAGE_NFS_UTILS is not set
+# ADK_PACKAGE_SAMBA is not set
+# ADK_PACKAGE_SAMBA_CLIENT is not set
+# ADK_PACKAGE_SAMBA_PASSWD is not set
+
+#
+# NTP
+#
+# ADK_PACKAGE_HTPDATE is not set
+# ADK_PACKAGE_NTPCLIENT is not set
+# ADK_PACKAGE_OPENNTPD is not set
+# ADK_PACKAGE_RDATE is not set
+
+#
+# P2P
+#
+
+#
+# PPP / PPTP / RADIUS
+#
+# ADK_PACKAGE_FREERADIUS is not set
+# ADK_PACKAGE_PPP is not set
+# ADK_PACKAGE_PPTP is not set
+# ADK_PACKAGE_PPTPD is not set
+# ADK_PACKAGE_PPPOE_CLIENT is not set
+# ADK_PACKAGE_PPPOE_RELAY is not set
+# ADK_PACKAGE_PPPOE_SERVER is not set
+# ADK_PACKAGE_PPPOE_SNIFF is not set
+# ADK_PACKAGE_RADDUMP is not set
+
+#
+# Proxy
+#
+# ADK_PACKAGE_IGMPPROXY is not set
+# ADK_PACKAGE_FRICKIN is not set
+# ADK_PACKAGE_PARPROUTED is not set
+# ADK_PACKAGE_PRIVOXY is not set
+# ADK_PACKAGE_SIPROXD is not set
+# ADK_PACKAGE_SQUID is not set
+# ADK_PACKAGE_SRELAY is not set
+# ADK_PACKAGE_TINYPROXY is not set
+# ADK_PACKAGE_TOR is not set
+# ADK_PACKAGE_VNC_REFLECTOR is not set
+
+#
+# Security
+#
+# ADK_PACKAGE_ARPWATCH is not set
+# ADK_PACKAGE_AUTOSSH is not set
+# ADK_PACKAGE_AXHTTPD is not set
+ADK_PACKAGE_DROPBEAR=y
+# ADK_PACKAGE_DBCONVERT is not set
+# ADK_PACKAGE_HTTPTUNNEL is not set
+# ADK_PACKAGE_L2TPNS is not set
+# ADK_COMPILE_OPENSSH is not set
+# ADK_PACKAGE_OPENSWAN is not set
+# ADK_PACKAGE_OPENVPN is not set
+# ADK_PACKAGE_PORTSENTRY is not set
+# ADK_PACKAGE_PTUNNEL is not set
+# ADK_PACKAGE_SCANLOGD is not set
+# ADK_PACKAGE_SNORT is not set
+# ADK_PACKAGE_SSLTUNNEL is not set
+# ADK_PACKAGE_TINC is not set
+# ADK_PACKAGE_VPNC is not set
+
+#
+# Wireless
+#
+# ADK_PACKAGE_AIRCRACK_NG is not set
+# ADK_PACKAGE_CHILLISPOT is not set
+# ADK_PACKAGE_HOSTAPD is not set
+# ADK_PACKAGE_IW is not set
+# ADK_PACKAGE_NOCATSPLASH is not set
+# ADK_PACKAGE_OLSRD is not set
+# ADK_PACKAGE_SNORT_WIRELESS is not set
+# ADK_PACKAGE_WIFIDOG is not set
+# ADK_DOWNLOAD_WIRELESS_FIRMWARE is not set
+# ADK_PACKAGE_WIRELESS_FIRMWARE_RT61 is not set
+# ADK_PACKAGE_WIRELESS_TOOLS is not set
+# ADK_PACKAGE_WPA_SUPPLICANT is not set
+
+#
+# Programming
+#
+# ADK_PACKAGE_BINUTILS is not set
+# ADK_PACKAGE_HASERL is not set
+# ADK_PACKAGE_JAMVM is not set
+# ADK_PACKAGE_LIBLUA is not set
+# ADK_PACKAGE_LUA is not set
+# ADK_PACKAGE_LUAC is not set
+# ADK_PACKAGE_LUA_EXAMPLES is not set
+# ADK_PACKAGE_MICROPERL is not set
+
+#
+# php.............................. PHP Hypertext preprocessor
+#
+# ADK_COMPILE_PHP is not set
+# ADK_PACKAGE_PHP_CLI is not set
+ADK_PACKAGE_PHP_FASTCGI=y
+# ADK_PACKAGE_RUBY is not set
+# ADK_PACKAGE_LIBFFI is not set
+# ADK_PACKAGE_TCL is not set
+
+#
+# Libraries
+#
+# ADK_PACKAGE_ALSA_LIB is not set
+# ADK_PACKAGE_APR is not set
+# ADK_PACKAGE_APR_UTIL is not set
+# ADK_PACKAGE_LIBAVAHI is not set
+# ADK_PACKAGE_LIBAXTLS is not set
+# ADK_PACKAGE_CGILIB is not set
+# ADK_PACKAGE_DBUS is not set
+# ADK_PACKAGE_GETTEXT is not set
+# ADK_PACKAGE_GLIB1 is not set
+# ADK_PACKAGE_GLIB2 is not set
+# ADK_PACKAGE_LIBAO is not set
+# ADK_PACKAGE_LIBAUDIOFILE is not set
+# ADK_PACKAGE_LIBART is not set
+# ADK_PACKAGE_LIBCLI is not set
+# ADK_PACKAGE_LIBCURL is not set
+# ADK_PACKAGE_LIBDAEMON is not set
+# ADK_PACKAGE_LIBDB is not set
+# ADK_PACKAGE_LIBDNET is not set
+# ADK_PACKAGE_LIBELF is not set
+# ADK_PACKAGE_LIBEVENT is not set
+# ADK_PACKAGE_LIBEXPAT is not set
+# ADK_PACKAGE_LIBFAAD2 is not set
+# ADK_PACKAGE_LIBFLAC is not set
+# ADK_PACKAGE_LIBFREETYPE is not set
+# ADK_PACKAGE_LIBGCRYPT is not set
+# ADK_PACKAGE_LIBGD is not set
+# ADK_PACKAGE_LIBGDBM is not set
+# ADK_PACKAGE_LIBGSSGLUE is not set
+# ADK_PACKAGE_LIBGMP is not set
+# ADK_PACKAGE_LIBGNUTLS is not set
+# ADK_PACKAGE_LIBGPG_ERROR is not set
+# ADK_PACKAGE_LIBGSM is not set
+# ADK_PACKAGE_LIBICONV is not set
+# ADK_PACKAGE_LIBID3TAG is not set
+# ADK_PACKAGE_LIBJPEG is not set
+# ADK_PACKAGE_LIBLAME is not set
+# ADK_PACKAGE_MPFR is not set
+# ADK_PACKAGE_LIBLTDL is not set
+# ADK_PACKAGE_LIBLZO is not set
+# ADK_PACKAGE_LIBMAD is not set
+# ADK_PACKAGE_LIBNCURSES is not set
+# ADK_PACKAGE_NEON is not set
+# ADK_PACKAGE_LIBNET is not set
+# ADK_PACKAGE_LIBNFSIDMAP is not set
+# ADK_PACKAGE_LIBNIDS is not set
+# ADK_PACKAGE_LIBNL is not set
+# ADK_PACKAGE_LIBOGG is not set
+# ADK_PACKAGE_LIBOL is not set
+# ADK_PACKAGE_LIBOPENCDK is not set
+# ADK_PACKAGE_LIBOSIP2 is not set
+# ADK_COMPILE_LIBOWFAT is not set
+# ADK_PACKAGE_LIBP11 is not set
+# ADK_PACKAGE_LIBPCAP is not set
+# ADK_PACKAGE_LIBPRI is not set
+# ADK_PACKAGE_LIBPCRE is not set
+# ADK_PACKAGE_LIBPNG is not set
+# ADK_PACKAGE_LIBPOPT is not set
+# ADK_PACKAGE_LIBPQ is not set
+# ADK_PACKAGE_LIBPTHREAD is not set
+# ADK_PACKAGE_LIBTHREAD_DB is not set
+# ADK_PACKAGE_RADIUSCLIENT_NG is not set
+# ADK_PACKAGE_LIBRADIUSCLIENT_NG is not set
+# ADK_PACKAGE_LIBREADLINE is not set
+# ADK_PACKAGE_LIBSASL2 is not set
+# ADK_PACKAGE_LIBSPEEX is not set
+# ADK_PACKAGE_LIBSQLITE is not set
+# ADK_PACKAGE_LIBRPCSECGSS is not set
+# ADK_PACKAGE_LIBSHOUT is not set
+# ADK_PACKAGE_LIBTASN1 is not set
+# ADK_PACKAGE_LIBTIFF is not set
+# ADK_PACKAGE_LIBTIRPC is not set
+# ADK_PACKAGE_LIBUPNP is not set
+# ADK_PACKAGE_LIBUSB is not set
+# ADK_PACKAGE_LIBVORBIS is not set
+# ADK_PACKAGE_LIBVORBISENC is not set
+# ADK_PACKAGE_LIBVORBISIDEC is not set
+# ADK_PACKAGE_LIBWRAP is not set
+# ADK_PACKAGE_LIBXML2 is not set
+# ADK_PACKAGE_LIBXSLT is not set
+ADK_PACKAGE_ZLIB=y
+
+#
+# Kernel configuration
+#
+
+#
+# Block devices support
+#
+# ADK_KERNEL_MD is not set
+# ADK_KERNEL_SWAP is not set
+# ADK_KERNEL_LBD is not set
+# ADK_KERNEL_BLK_DEV_IO_TRACE is not set
+# ADK_KERNEL_LSF is not set
+# ADK_KERNEL_IOSCHED_AS is not set
+# ADK_KERNEL_IOSCHED_DEADLINE is not set
+# ADK_KERNEL_IOSCHED_CFQ is not set
+ADK_KERNEL_SCSI=y
+# ADK_KPACKAGE_KMOD_BLK_DEV_LOOP is not set
+# ADK_KPACKAGE_KMOD_BLK_DEV_NBD is not set
+# ADK_KPACKAGE_KMOD_BLK_DEV_MD is not set
+# ADK_KPACKAGE_KMOD_BLK_DEV_DM is not set
+
+#
+# Filesystems support
+#
+# ADK_KERNEL_EXT3_FS_XATTR is not set
+ADK_KERNEL_FAT_DEFAULT_CODEPAGE=850
+ADK_KERNEL_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# ADK_KPACKAGE_KMOD_EXT3_FS is not set
+# ADK_KPACKAGE_KMOD_HFSPLUS_FS is not set
+# ADK_PACKAGE_KMOD_FS_NTFS_3G is not set
+# ADK_KPACKAGE_KMOD_NTFS_FS is not set
+# ADK_KERNEL_FAT_FS is not set
+# ADK_KPACKAGE_KMOD_VFAT_FS is not set
+# ADK_KPACKAGE_KMOD_XFS_FS is not set
+# ADK_KPACKAGE_KMOD_FUSE_FS is not set
+# ADK_KERNEL_JOLIET is not set
+# ADK_KPACKAGE_KMOD_ISO9660_FS is not set
+# ADK_KPACKAGE_KMOD_UDF_FS is not set
+# ADK_KPACKAGE_KMOD_CIFS is not set
+# ADK_KPACKAGE_KMOD_CODA_FS is not set
+# ADK_KERNEL_NFS_V4 is not set
+# ADK_KERNEL_RPCSEC_GSS_KRB5 is not set
+# ADK_KPACKAGE_KMOD_NFS_FS is not set
+# ADK_KERNEL_NFSD_V3 is not set
+# ADK_KPACKAGE_KMOD_SUNRPC is not set
+# ADK_KPACKAGE_KMOD_SUNRPC_GSS is not set
+# ADK_KPACKAGE_KMOD_RPCSEC_GSS_KRB5 is not set
+
+#
+# Native Language support
+#
+ADK_KERNEL_NLS_DEFAULT="iso8859-1"
+# ADK_KPACKAGE_KMOD_NLS is not set
+
+#
+# Network devices support
+#
+ADK_KERNEL_NET_ETHERNET=y
+ADK_KERNEL_MII=y
+ADK_KERNEL_NET_PCI=y
+# ADK_KERNEL_NETDEV_1000 is not set
+
+#
+# Ethernet card support
+#
+# ADK_KPACKAGE_KMOD_NE2K_PCI is not set
+# ADK_KPACKAGE_KMOD_E100 is not set
+# ADK_KPACKAGE_KMOD_E1000 is not set
+# ADK_KERNEL_WIRELESS is not set
+# ADK_KERNEL_WIRELESS_EXT is not set
+# ADK_KERNEL_MAC80211_LEDS is not set
+# ADK_KERNEL_WLAN_80211 is not set
+# ADK_KERNEL_RT2X00 is not set
+# ADK_MOD_KERNEL_CFG80211 is not set
+# ADK_MOD_KERNEL_MAC80211 is not set
+
+#
+# Wireless card support
+#
+# ADK_KPACKAGE_KMOD_MAC80211 is not set
+# ADK_KPACKAGE_KMOD_RT2X00 is not set
+# ADK_PACKAGE_KMOD_MAC80211 is not set
+
+#
+# USB support
+#
+ADK_KERNEL_USB_DEVICEFS=y
+# ADK_KERNEL_USB_LIBUSUAL is not set
+# ADK_KERNEL_USB_SERIAL is not set
+ADK_KPACKAGE_KMOD_USB=y
+# ADK_KPACKAGE_KMOD_USB_UHCI_HCD is not set
+ADK_KPACKAGE_KMOD_USB_OHCI_HCD=y
+# ADK_KPACKAGE_KMOD_USB_ISP116X_HCD is not set
+# ADK_KPACKAGE_KMOD_USB_SL811_HCD is not set
+ADK_KPACKAGE_KMOD_USB_EHCI_HCD=y
+ADK_PACKAGE_KMOD_USB_CONTROLLER=y
+# ADK_KPACKAGE_KMOD_USB_ACM is not set
+# ADK_KPACKAGE_KMOD_USB_PEGASUS is not set
+# ADK_KPACKAGE_KMOD_USB_PRINTER is not set
+# ADK_KPACKAGE_KMOD_USB_SERIAL is not set
+# ADK_KPACKAGE_KMOD_USB_STORAGE is not set
+# ADK_KPACKAGE_KMOD_USB_ATM is not set
+# ADK_KPACKAGE_KMOD_USB_USBNET is not set
+# ADK_KPACKAGE_KMOD_USB_SISUSBVGA is not set
+
+#
+# Input devices
+#
+# ADK_KERNEL_INPUT is not set
+# ADK_KERNEL_INPUT_KEYBOARD is not set
+# ADK_KERNEL_HID_SUPPORT is not set
+# ADK_KERNEL_HID is not set
+# ADK_KPACKAGE_KMOD_USB_HID is not set
+# ADK_KPACKAGE_KMOD_KEYBOARD_ATKBD is not set
+# ADK_KPACKAGE_KMOD_INPUT_MOUSEDEV is not set
+
+#
+# PCMCIA/CardBus support
+#
+# ADK_KERNEL_CARDBUS is not set
+# ADK_KPACKAGE_KMOD_PCCARD is not set
+
+#
+# Network support
+#
+ADK_KERNEL_INET=y
+ADK_KERNEL_IP_FIB_HASH=y
+ADK_KERNEL_SYN_COOKIES=y
+# ADK_KERNEL_IP_PNP_BOOTP is not set
+# ADK_KERNEL_IP_PNP_RARP is not set
+# ADK_KERNEL_NET_IPGRE_BROADCAST is not set
+# ADK_KERNEL_PPP_ASYNC is not set
+# ADK_KERNEL_SLHC is not set
+# ADK_KERNEL_IMQ is not set
+# ADK_KERNEL_LLC is not set
+# ADK_KPACKAGE_KMOD_BRIDGE is not set
+# ADK_KPACKAGE_KMOD_NET_IPIP is not set
+# ADK_KPACKAGE_KMOD_NET_IPGRE is not set
+# ADK_KPACKAGE_KMOD_PPP is not set
+# ADK_KPACKAGE_KMOD_TUN is not set
+# ADK_KPACKAGE_KMOD_BONDING is not set
+
+#
+# QoS and/or fair queueing
+#
+# ADK_KERNEL_NET_SCH_CSZ is not set
+# ADK_KERNEL_NET_SCH_NETEM is not set
+# ADK_KERNEL_NET_QOS is not set
+# ADK_KERNEL_NET_ESTIMATOR is not set
+# ADK_KERNEL_NET_SCHED is not set
+
+#
+# Queueing/Scheduling
+#
+# ADK_KPACKAGE_KMOD_NET_SCH_CBQ is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_HTB is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_HFSC is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_PRIO is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_RED is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_SFQ is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_TBF is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_GRED is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_DSMARK is not set
+# ADK_KPACKAGE_KMOD_NET_SCH_INGRESS is not set
+
+#
+# Classification
+#
+# ADK_KERNEL_NET_CLS is not set
+# ADK_KPACKAGE_KMOD_NET_CLS_TCINDEX is not set
+# ADK_KPACKAGE_KMOD_NET_CLS_ROUTE4 is not set
+# ADK_KPACKAGE_KMOD_NET_CLS_FW is not set
+# ADK_KPACKAGE_KMOD_NET_CLS_U32 is not set
+
+#
+# Actions
+#
+# ADK_KERNEL_NET_CLS_ACT is not set
+
+#
+# Netfilter (Firewall/Filtering)
+#
+# ADK_KERNEL_NETFILTER is not set
+# ADK_KERNEL_NETFILTER_ADVANCED is not set
+# ADK_KERNEL_NETFILTER_XTABLES is not set
+# ADK_KERNEL_NETFILTER_DEBUG is not set
+# ADK_KERNEL_IP_NF_MATCH_LAYER7_DEBUG is not set
+# ADK_KERNEL_IP_NF_TARGET_MIRROR is not set
+# ADK_KERNEL_IP_NF_NAT_SNMP_BASIC is not set
+# ADK_KERNEL_IP_NF_TARGET_DSCP is not set
+# ADK_KERNEL_IP_NF_TARGET_MARK is not set
+# ADK_KERNEL_IP_NF_TARGET_CLASSIFY is not set
+# ADK_KERNEL_IP_NF_TARGET_IMQ is not set
+# ADK_KERNEL_IP_NF_TARGET_CONNMARK is not set
+# ADK_KERNEL_IP_NF_ARPTABLES is not set
+# ADK_KERNEL_IP_NF_COMPAT_IPCHAINS is not set
+# ADK_KERNEL_IP_NF_COMPAT_IPFWADM is not set
+# ADK_KERNEL_IP6_NF_QUEUE is not set
+# ADK_KERNEL_IP6_NF_IPTABLES is not set
+# ADK_KERNEL_IP_ROUTE_FWMARK is not set
+# ADK_KERNEL_IP_NF_QUEUE is not set
+# ADK_KERNEL_IP_NF_MATCH_TIME is not set
+# ADK_KERNEL_IP_NF_MATCH_CONDITION is not set
+# ADK_KERNEL_IP_NF_MATCH_DSCP is not set
+# ADK_KERNEL_IP_NF_MATCH_AH_ESP is not set
+# ADK_KERNEL_IP_NF_MATCH_LENGTH is not set
+# ADK_KERNEL_IP_NF_MATCH_HELPER is not set
+# ADK_KPACKAGE_KMOD_IP_NF_MATCH_STATE is not set
+# ADK_KPACKAGE_KMOD_NETFILTER_XT_MATCH_STATE is not set
+# ADK_KPACKAGE_KMOD_IP_NF_MATCH_CONNTRACK is not set
+# ADK_KERNEL_IP_NF_MATCH_CONNMARK is not set
+# ADK_KERNEL_IP_NF_MATCH_UNCLEAN is not set
+# ADK_KERNEL_IP_NF_MATCH_STRING is not set
+
+#
+# Core Netfilter Configuration
+#
+# ADK_KPACKAGE_KMOD_NF_CONNTRACK is not set
+# ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_CLASSIFY is not set
+# ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_CONNMARK is not set
+# ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_MARK is not set
+# ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_NFQUEUE is not set
+
+#
+# IP: Netfilter Configuration
+#
+# ADK_KPACKAGE_KMOD_NF_CONNTRACK_IPV4 is not set
+# ADK_KPACKAGE_KMOD_IP_NF_IPTABLES is not set
+
+#
+# IPVS support
+#
+# ADK_KPACKAGE_KMOD_IP_VS is not set
+
+#
+# Multimedia devices support
+#
+# ADK_KERNEL_SND_TIMER is not set
+# ADK_KERNEL_SND_PCM is not set
+# ADK_KERNEL_SND_HWDEP is not set
+# ADK_KERNEL_SND_MIXER_OSS is not set
+# ADK_KERNEL_SND_PCM_OSS is not set
+# ADK_KPACKAGE_KMOD_SOUND is not set
+# ADK_KPACKAGE_KMOD_SND is not set
+# ADK_KPACKAGE_KMOD_VIDEO_DEV is not set
+# ADK_KPACKAGE_KMOD_USB_PWC is not set
+
+#
+# Crypto kernel modules
+#
+# ADK_KERNEL_CRYPTO is not set
+# ADK_KERNEL_CRYPTO_HW is not set
+# ADK_KERNEL_OCF_FIPS is not set
+# ADK_KERNEL_OCF_CRYPTODEV is not set
+# ADK_KERNEL_OCF_OCF is not set
+
+#
+# Hardware cryptography
+#
+
+#
+# Hardware crypto devices
+#
+# ADK_KPACKAGE_KMOD_CRYPTO_DEV_GEODE is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_DEV_HIFN_795X is not set
+
+#
+# OpenBSD Cryptographic framework
+#
+# ADK_KPACKAGE_KMOD_OCF_HIFN is not set
+# ADK_KPACKAGE_KMOD_OCF_SAFE is not set
+
+#
+# Software cryptography
+#
+
+#
+# Crypto core / Block and Hash modes
+#
+# ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_AEAD is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_MANAGER is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_HASH is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_BLKCIPHER is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_CBC is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_ECB is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_HMAC is not set
+
+#
+# Digest algorithms
+#
+# ADK_KPACKAGE_KMOD_CRYPTO_MD4 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_MD5 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_SHA1 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_SHA256 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_SHA512 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_WP512 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_TGR192 is not set
+
+#
+# Cipher algoritms
+#
+# ADK_KPACKAGE_KMOD_CRYPTO_AES is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_ANUBIS is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_ARC4 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_BLOWFISH is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_CAMELLIA is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_CAST5 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_CAST6 is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_DES is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_FCRYPT is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_KHAZAD is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_SERPENT is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_TEA is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_TWOFISH is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_NULL is not set
+
+#
+# Compression
+#
+# ADK_KPACKAGE_KMOD_CRYPTO_DEFLATE is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_LZO is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_MICHAEL_MIC is not set
+# ADK_KPACKAGE_KMOD_CRYPTO_CRC32C is not set
+
+#
+# Bluetooth
+#
+# ADK_KPACKAGE_KMOD_BT is not set
+
+#
+# ISDN
+#
+# ADK_KERNEL_ISDN is not set
+# ADK_KERNEL_ISDN_I4L is not set
+# ADK_KERNEL_ISDN_DRV_AVMB1_VERBOSE_REASON is not set
+# ADK_KERNEL_CAPI_AVM is not set
+# ADK_KERNEL_CAPI_EICON is not set
+# ADK_KERNEL_HFCMULTI_PCIMEM is not set
+# ADK_KERNEL_ISDN_CAPI_MIDDLEWARE is not set
+# ADK_KERNEL_ISDN_CAPI_CAPI20 is not set
+# ADK_KPACKAGE_KMOD_ISDN_CAPI is not set
+
+#
+# Miscellaneous devices support
+#
+
+#
+# LEDS driver support
+#
+# ADK_KERNEL_NEW_LEDS is not set
+# ADK_KPACKAGE_KMOD_LEDS_CLASS is not set
+# ADK_KERNEL_WATCHDOG is not set
+# ADK_KPACKAGE_KMOD_SOFT_WATCHDOG is not set
+# ADK_KPACKAGE_KMOD_WD1100 is not set
+# ADK_KPACKAGE_KMOD_PARPORT is not set
+# ADK_KPACKAGE_KMOD_FW_LOADER is not set
+# ADK_KPACKAGE_KMOD_EEPROM_93CX6 is not set
+
+#
+# Library Routines
+#
+# ADK_KERNEL_CRC32 is not set
+# ADK_KPACKAGE_KMOD_CRC_ITU_T is not set
+# ADK_KPACKAGE_KMOD_CRC32 is not set
+# ADK_KPACKAGE_KMOD_LIBCRC32C is not set
+# ADK_KPACKAGE_KMOD_CRC_CCITT is not set
+
+#
+# Kernel debugging
+#
+# ADK_KERNEL_DEBUG_KERNEL is not set
+# ADK_KERNEL_DEBUG_INFO is not set
+# ADK_KERNEL_KGDB is not set
+# ADK_KERNEL_KGDB_SERIAL_CONSOLE is not set
+# ADK_KERNEL_FRAME_POINTER is not set
+ADK_KERNEL_MAGIC_SYSRQ=y
+# ADK_KERNEL_DEBUG_FS is not set
+# ADK_KERNEL_DEBUG_WITH_KGDB is not set
diff --git a/Config.in b/Config.in
new file mode 100644
index 000000000..9128520e8
--- /dev/null
+++ b/Config.in
@@ -0,0 +1,17 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+mainmenu "OpenADK Configuration"
+
+config MODULES
+ bool
+ default y
+
+config ADK_HAVE_DOT_CONFIG
+ bool
+ default y
+
+source "target/Config.in"
+source "package/Config.in"
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 000000000..182ac083e
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,29 @@
+# $Id: GNUmakefile 255 2008-12-11 16:20:28Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+TOPDIR:= $(shell pwd)
+PWD:= ${TOPDIR}
+
+ifneq (${package},)
+subdir:= package/${package}
+_subdir_dep:= ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
+endif
+
+ifneq (${subdir},)
+${MAKECMDGOALS}: _subdir
+
+_subdir: ${_subdir_dep}
+ @if test x"$$(umask 2>/dev/null | sed 's/00*22/OK/')" != x"OK"; then \
+ echo >&2 Error: you must build with “umask 022â€, sorry.; \
+ exit 1; \
+ fi
+ cd ${subdir} && TOPDIR=${TOPDIR} DEVELOPER=1 \
+ make VERBOSE=1 ${MAKEFLAGS} ${MAKECMDGOALS}
+
+include prereq.mk
+include mk/split-cfg.mk
+else
+include Makefile
+endif
diff --git a/LICENCE b/LICENCE
new file mode 100644
index 000000000..869eaaf63
--- /dev/null
+++ b/LICENCE
@@ -0,0 +1,38 @@
+$Id$
+
+OpenADK is Copyright © 2008 Waldemar Brodkorb
+All rights reserved.
+
+This licence file covers all of the OpenADK meta distribution
+source code (including Makefiles and documentation).
+
+Binary firmware images are composed of the meta distribution
+OpenADK and downloaded distfiles from third party sources,
+which may be covered by various differing licence terms, but
+since the firmware image only aggregates differently licenced
+packages on the same medium we believe it is redistributable
+as long as the licences of the different packages are honoured.
+
+
+OpenADK itself is developed by Waldemar Brodkorb and covered
+by the GNU General Public License, Version 2 or later, as shown
+in the file COPYING in this directory. Individual files may be
+covered by the LGPL or BSD-style licences instead. OpenADK also
+contains tools that are possibly covered by non-GPL-compatible,
+but OSD/DFSG-compliant, licences. Specifically, some of these
+components may require acknowledgements to be displayed in the
+advertising materials; these are listed here:
+‣ This product includes material provided by Thorsten Glaser.
+
+OpenADK is based upon several other projects which are listed
+below, in no particular order. If you think you should be li-
+sted here but we have forgotten you, please forgive and drop
+us an email.
+
+
+• The FreeWRT Project
+• The OpenWrt Project
+• uClibc Buildroot
+• The MirOS Project and contributors
+
+────────────────────────────────────────────────────────────────────────
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..4d0f2f153
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,187 @@
+# $Id: Makefile 420 2009-05-08 19:31:15Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+GMAKE?= $(PWD)/scripts/make
+GMAKE_FMK= ${GMAKE} -f $(PWD)/mk/build.mk
+GMAKE_INV= ${GMAKE_FMK} --no-print-directory
+
+all: .prereq_done
+ @${GMAKE_INV} all
+
+v: .prereq_done
+ @(echo; echo "Build started on $$(LC_ALL=C LANGUAGE=C date)"; \
+ set -x; ${GMAKE_FMK} VERBOSE=1 all) 2>&1 | tee -a make.log
+
+help:
+ @echo ' switch DEV=device - Backup current config and copy old saved device config'
+ @echo 'Cleaning targets:'
+ @echo ' clean - Remove bin and build_dir directories'
+ @echo ' cleandevice - Same as "clean", but also remove toolchain for device'
+ @echo ' cleandir - Same as "clean", but also remove all built toolchains'
+ @echo ' cleankernel - Remove kernel dir'
+ @echo ' distclean - Same as "cleandir", but also remove downloaded'
+ @echo ' distfiles and .config'
+ @echo ''
+ @echo 'Configuration targets:'
+ @echo ' config - Update current config utilising a line-oriented program'
+ @echo ' menuconfig - Update current config utilising a menu based program'
+ @echo ' (default when .config does not exist)'
+ @echo ' oldconfig - Update current config utilising a provided .configs base'
+ @echo ' wconfig - Same as "oldconfig", but also writes out hidden symbols'
+ @echo ' allmodconfig - New config selecting all packages as modules when possible'
+ @echo ' allconfig - New config selecting all packages when possible'
+ @echo ' allnoconfig - New config where all options are answered with no'
+ @echo ''
+ @echo 'Help targets:'
+ @echo ' help - Print this help text'
+ @echo ' pkg-help - Print help about selectively compiling single packages'
+ @echo ' dev-help - Print help for developers / package maintainers'
+ @echo ''
+ @echo 'Other generic targets:'
+ @echo ' all - Build everything as specified in .config'
+ @echo ' (default if .config exists)'
+ @echo ' v - Same as "all" but with logging to make.log enabled'
+
+pkg-help:
+ @echo 'Package specific targets (use with "package=<pkg-name>" parameter):'
+ @echo ' fetch - Download the necessary distfile'
+ @echo ' extract - Same as "fetch", but also extract the distfile'
+ @echo ' patch - Same as "extract", but also patch the source'
+ @echo ' build - Same as "patch", but also build the binaries'
+ @echo ' fake - Same as "build", but also install the binaries'
+ @echo ' package - Same as "fake", but also create the ipkg package'
+ @echo ' clean - Deinstall and remove the build area'
+ @echo ' distclean - Same as "clean", but also remove the distfiles'
+ @echo ''
+ @echo 'Short package rebuilding guide:'
+ @echo ' run "make package=<pkgname> clean" to remove all generated binaries'
+ @echo ' run "make package=<pkgname> package" to build everything and create the ipkg'
+ @echo ''
+ @echo 'This does not automatically resolve package dependencies!'
+
+dev-help:
+ @echo 'Fast way of updating package patches:'
+ @echo ' run "make package=<pkgname> clean" to start with a good base'
+ @echo ' run "make package=<pkgname> patch" to fetch, unpack and patch the source'
+ @echo ' edit the package sources at build_dir/w-<pkgname>-*/<pkgname>-<version>'
+ @echo ' run "make package=<pkgname> update-patches to regenerate patch files'
+ @echo ''
+ @echo 'All changed patches will be opened with your $$EDITOR,'
+ @echo 'so you can add a description and verify the modifications.'
+
+clean: .prereq_done
+ -@rm -f nohup.out
+ @${GMAKE_INV} clean
+
+config: .prereq_done
+ @${GMAKE_INV} _config W=
+
+oldconfig: .prereq_done
+ @${GMAKE_INV} _config W=-o
+
+wconfig: .prereq_done
+ @${GMAKE_INV} _config W=-A
+
+download: .prereq_done
+ @${GMAKE_INV} toolchain/download
+ @${GMAKE_INV} package/download
+
+cleankernel: .prereq_done
+ -@${GMAKE_INV} cleankernel
+
+cleandir: .prereq_done
+ -@${GMAKE_INV} clean cleandir
+ @-rm -f make.log .prereq_done
+
+cleandevice: .prereq_done
+ -@${GMAKE_INV} clean cleandevice
+ @-rm -f make.log
+
+distclean: .prereq_done
+ -@${GMAKE_INV} clean cleandir distclean
+ @-rm -f make.log .prereq_done
+
+image: .prereq_done
+ @${GMAKE_INV} image
+
+switch: .prereq_done
+ @${GMAKE_INV} switch
+
+image_clean: .prereq_done
+ @${GMAKE_INV} image_clean
+
+menuconfig: .prereq_done
+ @${GMAKE_INV} menuconfig
+
+allnoconfig: .prereq_done
+ @${GMAKE_INV} _config W=-n
+
+allconfig: .prereq_done
+ @${GMAKE_INV} _mconfig W=-y RCONFIG=Config.in
+
+allmodconfig: .prereq_done
+ @${GMAKE_INV} _mconfig W=-o RCONFIG=Config.in
+
+package_index: .prereq_done
+ @${GMAKE_INV} package_index
+
+world: .prereq_done
+ @${GMAKE_INV} world
+
+prereq:
+ @rm -f .prereq_done
+ @${MAKE} .prereq_done --no-print-directory
+
+prereq-noerror:
+ @rm -f .prereq_done
+ @${MAKE} .prereq_done NO_ERROR=1
+
+NO_ERROR=0
+.prereq_done:
+ @-rm -rf .prereq_done
+ @if ! bash --version 2>&1 | fgrep 'GNU bash' >/dev/null 2>&1; then \
+ echo "GNU bash needs to be installed."; \
+ exit 1; \
+ fi
+ @if test x"$$(umask 2>/dev/null | sed 's/00*22/OK/')" != x"OK"; then \
+ echo >&2 Error: you must build with umask 022, sorry.; \
+ exit 1; \
+ fi
+ @echo "TOPDIR:=$$(readlink -nf . 2>/dev/null || pwd -P)" >prereq.mk
+ @echo "BASH:=$$(which bash)" >>prereq.mk
+ @if [ -z "$$(which gmake)" ]; then \
+ echo "GMAKE:=$$(which make)" >>prereq.mk ;\
+ else \
+ echo "GMAKE:=$$(which gmake)" >>prereq.mk ;\
+ fi
+ @echo "GNU_HOST_NAME:=$$(${CC} -dumpmachine)" >>prereq.mk
+ @echo "HOST_ARCH:=$$(${CC} -dumpmachine | sed -e s'/-.*//' \
+ -e 's/sparc.*/sparc/' \
+ -e 's/arm.*/arm/g' \
+ -e 's/m68k.*/m68k/' \
+ -e 's/ppc/powerpc/g' \
+ -e 's/v850.*/v850/g' \
+ -e 's/sh[234]/sh/' \
+ -e 's/mips-.*/mips/' \
+ -e 's/mipsel-.*/mipsel/' \
+ -e 's/cris.*/cris/' \
+ -e 's/i[3-9]86/i386/' \
+ )" >>prereq.mk
+ @echo 'HOSTCC:=${CC}' >>prereq.mk
+ @echo 'HOSTCFLAGS:=-O2 -fwrapv' >>prereq.mk
+ @echo 'LANGUAGE:=C' >>prereq.mk
+ @echo 'LC_ALL:=C' >>prereq.mk
+ @echo 'MAKE:=$${GMAKE}' >>prereq.mk
+ @echo "OStype:=$$(env uname)" >>prereq.mk
+ @echo "_PATH:=$$PATH" >>prereq.mk
+ @echo "PATH:=\$${TOPDIR}/scripts:$$PATH" >>prereq.mk
+ @echo "SHELL:=$$(which bash)" >>prereq.mk
+ @env NO_ERROR=${NO_ERROR} BASH="$$(which bash)" \
+ CC='${CC}' CPPFLAGS='${CPPFLAGS}' \
+ bash scripts/scan-tools.sh
+ @echo '===> Prerequisites checked successfully.'
+ @touch $@
+
+.PHONY: prereq prereq-noerror
diff --git a/README b/README
new file mode 100644
index 000000000..894427b91
--- /dev/null
+++ b/README
@@ -0,0 +1,39 @@
+OpenADK - A GNU/Linux construction kit
+======================================
+
+This is a menu based buildsystem for your home made embedded Linux system.
+
+Before you can start you need to install some tools:
+- bash
+- gcc
+- binutils
+- GNU make
+- GNU tar
+- GNU awk
+- GNU sed
+- patch
+- gzip
+- bzip2
+- cpio
+- wget
+- flex
+- bison
+- file
+- unzip
+- autoconf
+- automake
+- zlib-dev / libz-dev
+- libncurses5-dev
+- libc-dev
+
+There is a check for the required versions of these tools in advance, though
+(to re-issue the checks, use "make prereq").
+
+Please use "make menuconfig" to choose your embedded system and configure like you
+want to.
+
+Simply running 'make' will build the firmware for your embedded system. The
+buildsystem will download all sources, build the toolchain, the kernel and all
+applications.
+
+Sunshine!
diff --git a/TODO b/TODO
new file mode 100644
index 000000000..8be6be32a
--- /dev/null
+++ b/TODO
@@ -0,0 +1,9 @@
+- eglibc support
+- glibc 2.10 support
+- rescue initramfs image (more archs, generic kernel config )
+ - replace ibm x40
+ - usb boot via stick
+- kernel 2.6.29.3
+- bind isc 9.6.1
+- asterisk 1.6
+- gcc 4.4.0
diff --git a/config/Config.in b/config/Config.in
new file mode 100644
index 000000000..9a7778310
--- /dev/null
+++ b/config/Config.in
@@ -0,0 +1,8 @@
+#
+
+config ADK_PACKAGE_CONFIG
+ bool"config"
+ default n
+ help
+ Add help text here.
+
diff --git a/config/Kconfig-language.txt b/config/Kconfig-language.txt
new file mode 100644
index 000000000..493749b32
--- /dev/null
+++ b/config/Kconfig-language.txt
@@ -0,0 +1,255 @@
+Introduction
+------------
+
+The configuration database is collection of configuration options
+organized in a tree structure:
+
+ +- Code maturity level options
+ | +- Prompt for development and/or incomplete code/drivers
+ +- General setup
+ | +- Networking support
+ | +- System V IPC
+ | +- BSD Process Accounting
+ | +- Sysctl support
+ +- Loadable module support
+ | +- Enable loadable module support
+ | +- Set version information on all module symbols
+ | +- Kernel module loader
+ +- ...
+
+Every entry has its own dependencies. These dependencies are used
+to determine the visible of an entry. Any child entry is only
+visible if its parent entry is also visible.
+
+Menu entries
+------------
+
+Most entries define a config option, all other entries help to organize
+them. A single configuration option is defined like this:
+
+config MODVERSIONS
+ bool "Set version information on all module symbols"
+ depends MODULES
+ help
+ Usually, modules have to be recompiled whenever you switch to a new
+ kernel. ...
+
+Every line starts with a key word and can be followed by multiple
+arguments. "config" starts a new config entry. The following lines
+define attributes for this config option. Attributes can be the type of
+the config option, input prompt, dependencies, help text and default
+values. A config option can be defined multiple times with the same
+name, but every definition can have only a single input prompt and the
+type must not conflict.
+
+Menu attributes
+---------------
+
+A menu entry can have a number of attributes. Not all of them are
+applicable everywhere (see syntax).
+
+- type definition: "bool"/"tristate"/"string"/"hex"/"integer"
+ Every config option must have a type. There are only two basic types:
+ tristate and string, the other types base on these two. The type
+ definition optionally accepts an input prompt, so these two examples
+ are equivalent:
+
+ bool "Networking support"
+ and
+ bool
+ prompt "Networking support"
+
+- input prompt: "prompt" <prompt> ["if" <expr>]
+ Every menu entry can have at most one prompt, which is used to display
+ to the user. Optionally dependencies only for this prompt can be added
+ with "if".
+
+- default value: "default" <symbol> ["if" <expr>]
+ A config option can have any number of default values. If multiple
+ default values are visible, only the first defined one is active.
+ Default values are not limited to the menu entry, where they are
+ defined, this means the default can be defined somewhere else or be
+ overriden by an earlier definition.
+ The default value is only assigned to the config symbol if no other
+ value was set by the user (via the input prompt above). If an input
+ prompt is visible the default value is presented to the user and can
+ be overridden by him.
+ Optionally dependencies only for this default value can be added with
+ "if".
+
+- dependencies: "depends on"/"requires" <expr>
+ This defines a dependency for this menu entry. If multiple
+ dependencies are defined they are connected with '&&'. Dependencies
+ are applied to all other options within this menu entry (which also
+ accept "if" expression), so these two examples are equivalent:
+
+ bool "foo" if BAR
+ default y if BAR
+ and
+ depends on BAR
+ bool "foo"
+ default y
+
+- help text: "help"
+ This defines a help text. The end of the help text is determined by
+ the level indentation, this means it ends at the first line which has
+ a smaller indentation than the first line of the help text.
+
+
+Menu dependencies
+-----------------
+
+Dependencies define the visibility of a menu entry and can also reduce
+the input range of tristate symbols. The tristate logic used in the
+expressions uses one more state than normal boolean logic to express the
+module state. Dependency expressions have the following syntax:
+
+<expr> ::= <symbol> (1)
+ <symbol> '=' <symbol> (2)
+ <symbol> '!=' <symbol> (3)
+ '(' <expr> ')' (4)
+ '!' <expr> (5)
+ <expr> '||' <expr> (6)
+ <expr> '&&' <expr> (7)
+
+Expressions are listed in decreasing order of precedence.
+
+(1) Convert the symbol into an expression. Boolean and tristate symbols
+ are simply converted into the respective expression values. All
+ other symbol types result in 'n'.
+(2) If the values of both symbols are equal, it returns 'y',
+ otherwise 'n'.
+(3) If the values of both symbols are equal, it returns 'n',
+ otherwise 'y'.
+(4) Returns the value of the expression. Used to override precedence.
+(5) Returns the result of (2-/expr/).
+(6) Returns the result of min(/expr/, /expr/).
+(7) Returns the result of max(/expr/, /expr/).
+
+An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
+respectively for calculations). A menu entry becomes visible when it's
+expression evaluates to 'm' or 'y'.
+
+There are two type of symbols: constant and nonconstant symbols.
+Nonconstant symbols are the most common ones and are defined with the
+'config' statement. Nonconstant symbols consist entirely of alphanumeric
+characters or underscores.
+Constant symbols are only part of expressions. Constant symbols are
+always surrounded by single or double quotes. Within the quote any
+other character is allowed and the quotes can be escaped using '\'.
+
+Menu structure
+--------------
+
+The position of a menu entry in the tree is determined in two ways. First
+it can be specified explicitely:
+
+menu "Network device support"
+ depends NET
+
+config NETDEVICES
+ ...
+
+endmenu
+
+All entries within the "menu" ... "endmenu" block become a submenu of
+"Network device support". All subentries inherit the dependencies from
+the menu entry, e.g. this means the dependency "NET" is added to the
+dependency list of the config option NETDEVICES.
+
+The other way to generate the menu structure is done by analyzing the
+dependencies. If a menu entry somehow depends on the previous entry, it
+can be made a submenu of it. First the the previous (parent) symbol must
+be part of the dependency list and then one of these two condititions
+must be true:
+- the child entry must become invisible, if the parent is set to 'n'
+- the child entry must only be visible, if the parent is visible
+
+config MODULES
+ bool "Enable loadable module support"
+
+config MODVERSIONS
+ bool "Set version information on all module symbols"
+ depends MODULES
+
+comment "module support disabled"
+ depends !MODULES
+
+MODVERSIONS directly depends on MODULES, this means it's only visible if
+MODULES is different from 'n'. The comment on the other hand is always
+visible when MODULES it's visible (the (empty) dependency of MODULES is
+also part of the comment dependencies).
+
+
+Kconfig syntax
+--------------
+
+The configuration file describes a series of menu entries, where every
+line starts with a keyword (except help texts). The following keywords
+end a menu entry:
+- config
+- choice/endchoice
+- comment
+- menu/endmenu
+- if/endif
+- source
+The first four also start the definition of a menu entry.
+
+config:
+
+ "config" <symbol>
+ <config options>
+
+This defines a config symbol <symbol> and accepts any of above
+attributes as options.
+
+choices:
+
+ "choice"
+ <choice options>
+ <choice block>
+ "endchoice"
+
+This defines a choice group and accepts any of above attributes as
+options. A choice can only be of type bool or tristate, while a boolean
+choice only allows a single config entry to be selected, a tristate
+choice also allows any number of config entries to be set to 'm'. This
+can be used if multiple drivers for a single hardware exists and only a
+single driver can be compiled/loaded into the kernel, but all drivers
+can be compiled as modules.
+A choice accepts another option "optional", which allows to set the
+choice to 'n' and no entry needs to be selected.
+
+comment:
+
+ "comment" <prompt>
+ <comment options>
+
+This defines a comment which is displayed to the user during the
+configuration process and is also echoed to the output files. The only
+possible options are dependencies.
+
+menu:
+
+ "menu" <prompt>
+ <menu options>
+ <menu block>
+ "endmenu"
+
+This defines a menu block, see "Menu structure" above for more
+information. The only possible options are dependencies.
+
+if:
+
+ "if" <expr>
+ <if block>
+ "endif"
+
+This defines an if block. The dependency expression <expr> is appended
+to all enclosed menu entries.
+
+source:
+
+ "source" <prompt>
+
+This reads the specified configuration file. This file is always parsed.
diff --git a/config/Makefile b/config/Makefile
new file mode 100644
index 000000000..278f98849
--- /dev/null
+++ b/config/Makefile
@@ -0,0 +1,123 @@
+# $Id: Makefile 185 2008-10-28 12:24:05Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+CP=cp -fpR
+
+all: ncurses conf mconf
+
+LIBS= -lncurses
+ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h))
+HOSTNCURSES+= -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"
+else
+ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h))
+HOSTNCURSES+= -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
+else
+ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h))
+HOSTCFLAGS+= -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses.h>"
+else
+ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h))
+HOSTCFLAGS+= -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"
+else
+ifeq (/usr/pkg/include/ncurses.h, $(wildcard /usr/pkg/include/ncurses.h))
+HOSTCFLAGS+= -I/usr/pkg/include -DCURSES_LOC="<ncurses.h>"
+LIBS+= -L/usr/pkg/lib -Wl,-rpath -Wl,/usr/pkg/lib
+else
+ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h))
+HOSTNCURSES+= -DCURSES_LOC="<ncurses.h>"
+else
+HOSTNCURSES+= -DCURSES_LOC="<curses.h>"
+endif
+endif
+endif
+endif
+endif
+endif
+
+CONF_SRC =conf.c
+MCONF_SRC =mconf.c checklist.c menubox.c textbox.c yesno.c inputbox.c util.c msgbox.c
+SHARED_SRC=zconf.tab.c glob.c
+SHARED_DEPS:=lkc.h lkc_proto.h lkc_defs.h expr.h zconf.tab.h glob.h
+CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
+MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
+SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
+
+conf: $(CONF_OBJS) $(SHARED_OBJS)
+ $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
+
+mconf: $(MCONF_OBJS) $(SHARED_OBJS)
+ $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ $(LIBS)
+
+$(CONF_OBJS): %.o : %.c $(SHARED_DEPS)
+ $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
+
+$(MCONF_OBJS): %.o : %.c $(SHARED_DEPS)
+ $(HOSTCC) $(HOSTCFLAGS) $(HOSTNCURSES) -I. -c $< -o $@
+
+glob.o: glob.c $(SHARED_DEPS)
+ $(HOSTCC) $(HOSTCFLAGS) -I. -c glob.c -o $@
+
+lkc_defs.h: lkc_proto.h
+ @sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
+
+###
+# The following requires flex/bison
+# By default we use the _shipped versions, uncomment the
+# following line if you are modifying the flex/bison src.
+LKC_GENPARSER:= 1
+
+ifdef LKC_GENPARSER
+
+%.tab.c %.tab.h: %.y
+ bison -t -d -v -b $* -p $(notdir $*) $<
+
+lex.%.c: %.l
+ flex -P$(notdir $*) -o$@ $<
+
+lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
+ $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
+
+zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS)
+ $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
+
+else
+
+lex.zconf.o: lex.zconf.c $(SHARED_DEPS)
+ $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
+
+lex.zconf.c: lex.zconf.c_shipped
+ $(CP) lex.zconf.c_shipped lex.zconf.c
+
+zconf.tab.o: zconf.tab.c lex.zconf.c confdata.c expr.c symbol.c menu.c $(SHARED_DEPS)
+ $(HOSTCC) $(HOSTCFLAGS) -I. -c $< -o $@
+
+zconf.tab.c: zconf.tab.c_shipped
+ $(CP) zconf.tab.c_shipped zconf.tab.c
+
+zconf.tab.h: zconf.tab.h_shipped
+ $(CP) zconf.tab.h_shipped zconf.tab.h
+endif
+
+.PHONY: ncurses
+
+ncurses:
+ @echo "int main(void) { return -1; }" > lxtemp.c
+ @if $(HOSTCC) $(HOSTCFLAGS) lxtemp.c $(LIBS) ; then \
+ rm -f lxtemp.c a.out; \
+ else \
+ rm -f lxtemp.c; \
+ printf '\007'; \
+ echo ">> Unable to find the Ncurses libraries." ;\
+ echo ">>" ;\
+ echo ">> You must have Ncurses installed in order" ;\
+ echo ">> to use 'make menuconfig'" ;\
+ echo ;\
+ exit 1 ;\
+ fi
+
+clean:
+ rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \
+ conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h
diff --git a/config/Makefile.in b/config/Makefile.in
new file mode 100644
index 000000000..0b3ac40a9
--- /dev/null
+++ b/config/Makefile.in
@@ -0,0 +1,5 @@
+ifeq ($(strip $(ADK_PACKAGE_CONFIG)),y)
+TARGETS+=config
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/config/checklist.c b/config/checklist.c
new file mode 100644
index 000000000..ec5a9ad68
--- /dev/null
+++ b/config/checklist.c
@@ -0,0 +1,377 @@
+/*
+ * checklist.c -- implements the checklist box
+ *
+ * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension
+ * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two
+ * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dialog.h"
+
+static int list_width, check_x, item_x, checkflag;
+
+/*
+ * Print list item
+ */
+static void
+print_item (WINDOW * win, const char *item, int status,
+ int choice, int selected)
+{
+ int i;
+
+ /* Clear 'residue' of last item */
+ wattrset (win, menubox_attr);
+ wmove (win, choice, 0);
+ for (i = 0; i < list_width; i++)
+ waddch (win, ' ');
+
+ wmove (win, choice, check_x);
+ wattrset (win, selected ? check_selected_attr : check_attr);
+ if (checkflag == FLAG_CHECK)
+ wprintw (win, "[%c]", status ? 'X' : ' ');
+ else
+ wprintw (win, "(%c)", status ? 'X' : ' ');
+
+#if 0
+ wattrset (win, selected ? tag_selected_attr : tag_attr);
+ mvwaddch(win, choice, item_x, item[0]);
+ wattrset (win, selected ? item_selected_attr : item_attr);
+ waddstr (win, (char *)item+1);
+#else
+ wattrset (win, selected ? item_selected_attr : item_attr);
+ waddstr (win, item);
+#endif
+ if (selected) {
+ wmove (win, choice, check_x+1);
+ wrefresh (win);
+ }
+}
+
+/*
+ * Print the scroll indicators.
+ */
+static void
+print_arrows (WINDOW * win, int choice, int item_no, int scroll,
+ int y, int x, int height)
+{
+ wmove(win, y, x);
+
+ if (scroll > 0) {
+ wattrset (win, uarrow_attr);
+ waddch (win, ACS_UARROW);
+ waddstr (win, "(-)");
+ }
+ else {
+ wattrset (win, menubox_attr);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ }
+
+ y = y + height + 1;
+ wmove(win, y, x);
+
+ if ((height < item_no) && (scroll + choice < item_no - 1)) {
+ wattrset (win, darrow_attr);
+ waddch (win, ACS_DARROW);
+ waddstr (win, "(+)");
+ }
+ else {
+ wattrset (win, menubox_border_attr);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ }
+}
+
+/*
+ * Display the termination buttons
+ */
+static void
+print_buttons( WINDOW *dialog, int height, int width, int selected)
+{
+ int x = width / 2 - 11;
+ int y = height - 2;
+
+ print_button (dialog, "Select", y, x, selected == 0);
+ print_button (dialog, " Help ", y, x + 14, selected == 1);
+
+ wmove(dialog, y, x+1 + 14*selected);
+ wrefresh (dialog);
+}
+
+/*
+ * Display a dialog box with a list of options that can be turned on or off
+ * The `flag' parameter is used to select between radiolist and checklist.
+ */
+int
+dialog_checklist (const char *title, const char *prompt, int height, int width,
+ int list_height, int item_no, struct dialog_list_item ** items,
+ int flag)
+
+{
+ int i, x, y, box_x, box_y;
+ int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status;
+ WINDOW *dialog, *list;
+
+ checkflag = flag;
+
+ /* Allocate space for storing item on/off status */
+ if ((status = malloc (sizeof (int) * item_no)) == NULL) {
+ endwin ();
+ fprintf (stderr,
+ "\nCan't allocate memory in dialog_checklist().\n");
+ exit (-1);
+ }
+
+ /* Initializes status */
+ for (i = 0; i < item_no; i++) {
+ status[i] = (items[i]->selected == 1); /* ON */
+ if ((!choice && status[i]) || items[i]->selected == 2) /* SELECTED */
+ choice = i + 1;
+ }
+ if (choice)
+ choice--;
+
+ max_choice = MIN (list_height, item_no);
+
+ /* center dialog box on screen */
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ draw_shadow (stdscr, y, x, height, width);
+
+ dialog = newwin (height, width, y, x);
+ keypad (dialog, TRUE);
+
+ draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
+ wattrset (dialog, border_attr);
+ mvwaddch (dialog, height-3, 0, ACS_LTEE);
+ for (i = 0; i < width - 2; i++)
+ waddch (dialog, ACS_HLINE);
+ wattrset (dialog, dialog_attr);
+ waddch (dialog, ACS_RTEE);
+
+ if (title != NULL && strlen(title) >= width-2 ) {
+ /* truncate long title -- mec */
+ char * title2 = malloc(width-2+1);
+ memcpy( title2, title, width-2 );
+ title2[width-2] = '\0';
+ title = title2;
+ }
+
+ if (title != NULL) {
+ wattrset (dialog, title_attr);
+ mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
+ waddstr (dialog, (char *)title);
+ waddch (dialog, ' ');
+ }
+
+ wattrset (dialog, dialog_attr);
+ print_autowrap (dialog, prompt, width - 2, 1, 3);
+
+ list_width = width - 6;
+ box_y = height - list_height - 5;
+ box_x = (width - list_width) / 2 - 1;
+
+ /* create new window for the list */
+ list = subwin (dialog, list_height, list_width, y+box_y+1, x+box_x+1);
+
+ keypad (list, TRUE);
+
+ /* draw a box around the list items */
+ draw_box (dialog, box_y, box_x, list_height + 2, list_width + 2,
+ menubox_border_attr, menubox_attr);
+
+ /* Find length of longest item in order to center checklist */
+ check_x = 0;
+ for (i = 0; i < item_no; i++)
+ check_x = MAX (check_x, + strlen (items[i]->name) + 4);
+
+ check_x = (list_width - check_x) / 2;
+ item_x = check_x + 4;
+
+ if (choice >= list_height) {
+ scroll = choice - list_height + 1;
+ choice -= scroll;
+ }
+
+ /* Print the list */
+ for (i = 0; i < max_choice; i++) {
+ print_item (list, items[scroll + i]->name,
+ status[i+scroll], i, i == choice);
+ }
+
+ print_arrows(dialog, choice, item_no, scroll,
+ box_y, box_x + check_x + 5, list_height);
+
+ print_buttons(dialog, height, width, 0);
+
+ wnoutrefresh (list);
+ wnoutrefresh (dialog);
+ doupdate ();
+
+ while (key != ESC) {
+ key = wgetch (dialog);
+
+ for (i = 0; i < max_choice; i++)
+ if (toupper(key) == toupper(items[scroll + i]->name[0]))
+ break;
+
+
+ if ( i < max_choice || key == KEY_UP || key == KEY_DOWN ||
+ key == '+' || key == '-' ) {
+ if (key == KEY_UP || key == '-') {
+ if (!choice) {
+ if (!scroll)
+ continue;
+ /* Scroll list down */
+ if (list_height > 1) {
+ /* De-highlight current first item */
+ print_item (list, items[scroll]->name,
+ status[scroll], 0, FALSE);
+ scrollok (list, TRUE);
+ wscrl (list, -1);
+ scrollok (list, FALSE);
+ }
+ scroll--;
+ print_item (list, items[scroll]->name,
+ status[scroll], 0, TRUE);
+ wnoutrefresh (list);
+
+ print_arrows(dialog, choice, item_no, scroll,
+ box_y, box_x + check_x + 5, list_height);
+
+ wrefresh (dialog);
+
+ continue; /* wait for another key press */
+ } else
+ i = choice - 1;
+ } else if (key == KEY_DOWN || key == '+') {
+ if (choice == max_choice - 1) {
+ if (scroll + choice >= item_no - 1)
+ continue;
+ /* Scroll list up */
+ if (list_height > 1) {
+ /* De-highlight current last item before scrolling up */
+ print_item (list, items[scroll + max_choice - 1]->name,
+ status[scroll + max_choice - 1],
+ max_choice - 1, FALSE);
+ scrollok (list, TRUE);
+ scroll (list);
+ scrollok (list, FALSE);
+ }
+ scroll++;
+ print_item (list, items[scroll + max_choice - 1]->name,
+ status[scroll + max_choice - 1],
+ max_choice - 1, TRUE);
+ wnoutrefresh (list);
+
+ print_arrows(dialog, choice, item_no, scroll,
+ box_y, box_x + check_x + 5, list_height);
+
+ wrefresh (dialog);
+
+ continue; /* wait for another key press */
+ } else
+ i = choice + 1;
+ }
+ if (i != choice) {
+ /* De-highlight current item */
+ print_item (list, items[scroll + choice]->name,
+ status[scroll + choice], choice, FALSE);
+ /* Highlight new item */
+ choice = i;
+ print_item (list, items[scroll + choice]->name,
+ status[scroll + choice], choice, TRUE);
+ wnoutrefresh (list);
+ wrefresh (dialog);
+ }
+ continue; /* wait for another key press */
+ }
+ switch (key) {
+ case 'H':
+ case 'h':
+ case '?':
+ for (i = 0; i < item_no; i++)
+ items[i]->selected = 0;
+ items[scroll + choice]->selected = 1;
+ delwin (dialog);
+ free (status);
+ return 1;
+ case TAB:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ button = ((key == KEY_LEFT ? --button : ++button) < 0)
+ ? 1 : (button > 1 ? 0 : button);
+
+ print_buttons(dialog, height, width, button);
+ wrefresh (dialog);
+ break;
+ case 'S':
+ case 's':
+ case ' ':
+ case '\n':
+ if (!button) {
+ if (flag == FLAG_CHECK) {
+ status[scroll + choice] = !status[scroll + choice];
+ wmove (list, choice, check_x);
+ wattrset (list, check_selected_attr);
+ wprintw (list, "[%c]", status[scroll + choice] ? 'X' : ' ');
+ } else {
+ if (!status[scroll + choice]) {
+ for (i = 0; i < item_no; i++)
+ status[i] = 0;
+ status[scroll + choice] = 1;
+ for (i = 0; i < max_choice; i++)
+ print_item (list, items[scroll + i]->name,
+ status[scroll + i], i, i == choice);
+ }
+ }
+ wnoutrefresh (list);
+ wrefresh (dialog);
+
+ for (i = 0; i < item_no; i++) {
+ items[i]->selected = status[i];
+ }
+ } else {
+ for (i = 0; i < item_no; i++)
+ items[i]->selected = 0;
+ items[scroll + choice]->selected = 1;
+ }
+ delwin (dialog);
+ free (status);
+ return button;
+ case 'X':
+ case 'x':
+ key = ESC;
+ case ESC:
+ break;
+ }
+
+ /* Now, update everything... */
+ doupdate ();
+ }
+
+
+ delwin (dialog);
+ free (status);
+ return -1; /* ESC pressed */
+}
diff --git a/config/colors.h b/config/colors.h
new file mode 100644
index 000000000..d34dd37c6
--- /dev/null
+++ b/config/colors.h
@@ -0,0 +1,161 @@
+/*
+ * colors.h -- color attribute definitions
+ *
+ * AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+/*
+ * Default color definitions
+ *
+ * *_FG = foreground
+ * *_BG = background
+ * *_HL = highlight?
+ */
+#define SCREEN_FG COLOR_CYAN
+#define SCREEN_BG COLOR_BLUE
+#define SCREEN_HL TRUE
+
+#define SHADOW_FG COLOR_BLACK
+#define SHADOW_BG COLOR_BLACK
+#define SHADOW_HL TRUE
+
+#define DIALOG_FG COLOR_BLACK
+#define DIALOG_BG COLOR_WHITE
+#define DIALOG_HL FALSE
+
+#define TITLE_FG COLOR_YELLOW
+#define TITLE_BG COLOR_WHITE
+#define TITLE_HL TRUE
+
+#define BORDER_FG COLOR_WHITE
+#define BORDER_BG COLOR_WHITE
+#define BORDER_HL TRUE
+
+#define BUTTON_ACTIVE_FG COLOR_WHITE
+#define BUTTON_ACTIVE_BG COLOR_BLUE
+#define BUTTON_ACTIVE_HL TRUE
+
+#define BUTTON_INACTIVE_FG COLOR_BLACK
+#define BUTTON_INACTIVE_BG COLOR_WHITE
+#define BUTTON_INACTIVE_HL FALSE
+
+#define BUTTON_KEY_ACTIVE_FG COLOR_WHITE
+#define BUTTON_KEY_ACTIVE_BG COLOR_BLUE
+#define BUTTON_KEY_ACTIVE_HL TRUE
+
+#define BUTTON_KEY_INACTIVE_FG COLOR_RED
+#define BUTTON_KEY_INACTIVE_BG COLOR_WHITE
+#define BUTTON_KEY_INACTIVE_HL FALSE
+
+#define BUTTON_LABEL_ACTIVE_FG COLOR_YELLOW
+#define BUTTON_LABEL_ACTIVE_BG COLOR_BLUE
+#define BUTTON_LABEL_ACTIVE_HL TRUE
+
+#define BUTTON_LABEL_INACTIVE_FG COLOR_BLACK
+#define BUTTON_LABEL_INACTIVE_BG COLOR_WHITE
+#define BUTTON_LABEL_INACTIVE_HL TRUE
+
+#define INPUTBOX_FG COLOR_BLACK
+#define INPUTBOX_BG COLOR_WHITE
+#define INPUTBOX_HL FALSE
+
+#define INPUTBOX_BORDER_FG COLOR_BLACK
+#define INPUTBOX_BORDER_BG COLOR_WHITE
+#define INPUTBOX_BORDER_HL FALSE
+
+#define SEARCHBOX_FG COLOR_BLACK
+#define SEARCHBOX_BG COLOR_WHITE
+#define SEARCHBOX_HL FALSE
+
+#define SEARCHBOX_TITLE_FG COLOR_YELLOW
+#define SEARCHBOX_TITLE_BG COLOR_WHITE
+#define SEARCHBOX_TITLE_HL TRUE
+
+#define SEARCHBOX_BORDER_FG COLOR_WHITE
+#define SEARCHBOX_BORDER_BG COLOR_WHITE
+#define SEARCHBOX_BORDER_HL TRUE
+
+#define POSITION_INDICATOR_FG COLOR_YELLOW
+#define POSITION_INDICATOR_BG COLOR_WHITE
+#define POSITION_INDICATOR_HL TRUE
+
+#define MENUBOX_FG COLOR_BLACK
+#define MENUBOX_BG COLOR_WHITE
+#define MENUBOX_HL FALSE
+
+#define MENUBOX_BORDER_FG COLOR_WHITE
+#define MENUBOX_BORDER_BG COLOR_WHITE
+#define MENUBOX_BORDER_HL TRUE
+
+#define ITEM_FG COLOR_BLACK
+#define ITEM_BG COLOR_WHITE
+#define ITEM_HL FALSE
+
+#define ITEM_SELECTED_FG COLOR_WHITE
+#define ITEM_SELECTED_BG COLOR_BLUE
+#define ITEM_SELECTED_HL TRUE
+
+#define TAG_FG COLOR_YELLOW
+#define TAG_BG COLOR_WHITE
+#define TAG_HL TRUE
+
+#define TAG_SELECTED_FG COLOR_YELLOW
+#define TAG_SELECTED_BG COLOR_BLUE
+#define TAG_SELECTED_HL TRUE
+
+#define TAG_KEY_FG COLOR_YELLOW
+#define TAG_KEY_BG COLOR_WHITE
+#define TAG_KEY_HL TRUE
+
+#define TAG_KEY_SELECTED_FG COLOR_YELLOW
+#define TAG_KEY_SELECTED_BG COLOR_BLUE
+#define TAG_KEY_SELECTED_HL TRUE
+
+#define CHECK_FG COLOR_BLACK
+#define CHECK_BG COLOR_WHITE
+#define CHECK_HL FALSE
+
+#define CHECK_SELECTED_FG COLOR_WHITE
+#define CHECK_SELECTED_BG COLOR_BLUE
+#define CHECK_SELECTED_HL TRUE
+
+#define UARROW_FG COLOR_GREEN
+#define UARROW_BG COLOR_WHITE
+#define UARROW_HL TRUE
+
+#define DARROW_FG COLOR_GREEN
+#define DARROW_BG COLOR_WHITE
+#define DARROW_HL TRUE
+
+/* End of default color definitions */
+
+#define C_ATTR(x,y) ((x ? A_BOLD : 0) | COLOR_PAIR((y)))
+#define COLOR_NAME_LEN 10
+#define COLOR_COUNT 8
+
+/*
+ * Global variables
+ */
+
+typedef struct {
+ char name[COLOR_NAME_LEN];
+ int value;
+} color_names_st;
+
+extern color_names_st color_names[];
+extern int color_table[][3];
diff --git a/config/conf.c b/config/conf.c
new file mode 100644
index 000000000..08e2895d8
--- /dev/null
+++ b/config/conf.c
@@ -0,0 +1,601 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/stat.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+extern int output_mode;
+
+static void conf(struct menu *menu);
+static void check_conf(struct menu *menu);
+
+enum {
+ ask_all,
+ ask_new,
+ ask_silent,
+ set_default,
+ set_yes,
+ set_mod,
+ ask_mod,
+ set_no,
+ set_random
+} input_mode = ask_all;
+char *defconfig_file;
+
+static int indent = 1;
+static int valid_stdin = 1;
+static int conf_cnt;
+static int press_enter = 0;
+static char line[128];
+static struct menu *rootEntry;
+
+static char nohelp_text[] = "Sorry, no help available for this option yet.\n";
+
+static void strip(char *str)
+{
+ char *p = str;
+ int l;
+
+ while ((isspace(*p)))
+ p++;
+ l = strlen(p);
+ if (p != str)
+ memmove(str, p, l + 1);
+ if (!l)
+ return;
+ p = str + l - 1;
+ while ((isspace(*p)))
+ *p-- = 0;
+}
+
+static void check_stdin(void)
+{
+ if (!valid_stdin && input_mode == ask_silent && !press_enter) {
+ printf("aborted!\n\n");
+ printf("Console input/output is redirected. ");
+ printf("Run 'make oldconfig' to update configuration.\n\n");
+ exit(1);
+ }
+}
+
+static void conf_askvalue(struct symbol *sym, const char *def)
+{
+ enum symbol_type type = sym_get_type(sym);
+ tristate val;
+
+ if (!sym_has_value(sym))
+ printf("(NEW) ");
+
+ line[0] = '\n';
+ line[1] = 0;
+
+ if (!sym_is_changable(sym)) {
+ printf("%s\n", def);
+ line[0] = '\n';
+ line[1] = 0;
+ return;
+ }
+
+ switch (input_mode) {
+ case ask_new:
+ case ask_silent:
+ if (sym_has_value(sym) ||
+ (output_mode && !(sym->flags & SYMBOL_WRITE))) {
+ printf("%s\n", def);
+ return;
+ }
+ check_stdin();
+ case ask_all:
+ fflush(stdout);
+ fgets(line, 128, stdin);
+ return;
+ case set_default:
+ printf("%s\n", def);
+ return;
+ default:
+ break;
+ }
+
+ switch (type) {
+ case S_INT:
+ case S_HEX:
+ case S_STRING:
+ printf("%s\n", def);
+ return;
+ default:
+ ;
+ }
+ switch (input_mode) {
+ case set_yes:
+ if (sym_tristate_within_range(sym, yes)) {
+ line[0] = 'y';
+ line[1] = '\n';
+ line[2] = 0;
+ break;
+ }
+ case ask_mod:
+ case set_mod:
+ if (type == S_TRISTATE) {
+ if (sym_tristate_within_range(sym, mod)) {
+ line[0] = 'm';
+ line[1] = '\n';
+ line[2] = 0;
+ break;
+ }
+ } else {
+ if (sym_tristate_within_range(sym, yes)) {
+ line[0] = 'y';
+ line[1] = '\n';
+ line[2] = 0;
+ break;
+ }
+ }
+ case set_no:
+ if (sym_tristate_within_range(sym, no)) {
+ line[0] = 'n';
+ line[1] = '\n';
+ line[2] = 0;
+ break;
+ }
+ case set_random:
+ do {
+ val = (tristate)(random() % 3);
+ } while (!sym_tristate_within_range(sym, val));
+ switch (val) {
+ case no: line[0] = 'n'; break;
+ case mod: line[0] = 'm'; break;
+ case yes: line[0] = 'y'; break;
+ }
+ line[1] = '\n';
+ line[2] = 0;
+ break;
+ default:
+ break;
+ }
+ printf("%s", line);
+}
+
+int conf_string(struct menu *menu)
+{
+ struct symbol *sym = menu->sym;
+ const char *def, *help;
+
+ while (1) {
+ printf("%*s%s ", indent - 1, "", menu->prompt->text);
+ printf("(%s) ", sym->name);
+ def = sym_get_string_value(sym);
+ if (sym_get_string_value(sym))
+ printf("[%s] ", def);
+ conf_askvalue(sym, def);
+ switch (line[0]) {
+ case '\n':
+ break;
+ case '?':
+ /* print help */
+ if (line[1] == '\n') {
+ help = nohelp_text;
+ if (menu->sym->help)
+ help = menu->sym->help;
+ printf("\n%s\n", menu->sym->help);
+ def = NULL;
+ break;
+ }
+ default:
+ line[strlen(line)-1] = 0;
+ def = line;
+ }
+ if (def && sym_set_string_value(sym, def))
+ return 0;
+ }
+}
+
+static int conf_sym(struct menu *menu)
+{
+ struct symbol *sym = menu->sym;
+ int type;
+ tristate oldval, newval;
+ const char *help;
+
+ while (1) {
+ printf("%*s%s ", indent - 1, "", menu->prompt->text);
+ if (sym->name)
+ printf("(%s) ", sym->name);
+ type = sym_get_type(sym);
+ putchar('[');
+ oldval = sym_get_tristate_value(sym);
+ switch (oldval) {
+ case no:
+ putchar('N');
+ break;
+ case mod:
+ putchar('M');
+ break;
+ case yes:
+ putchar('Y');
+ break;
+ }
+ if (oldval != no && sym_tristate_within_range(sym, no))
+ printf("/n");
+ if (oldval != mod && sym_tristate_within_range(sym, mod))
+ printf("/m");
+ if (oldval != yes && sym_tristate_within_range(sym, yes))
+ printf("/y");
+ if (sym->help)
+ printf("/?");
+ printf("] ");
+ conf_askvalue(sym, sym_get_string_value(sym));
+ strip(line);
+
+ switch (line[0]) {
+ case 'n':
+ case 'N':
+ newval = no;
+ if (!line[1] || !strcmp(&line[1], "o"))
+ break;
+ continue;
+ case 'm':
+ case 'M':
+ newval = mod;
+ if (!line[1])
+ break;
+ continue;
+ case 'y':
+ case 'Y':
+ newval = yes;
+ if (!line[1] || !strcmp(&line[1], "es"))
+ break;
+ continue;
+ case 0:
+ newval = oldval;
+ break;
+ case '?':
+ goto help;
+ default:
+ continue;
+ }
+ if (sym_set_tristate_value(sym, newval))
+ return 0;
+help:
+ help = nohelp_text;
+ if (sym->help)
+ help = sym->help;
+ printf("\n%s\n", help);
+ }
+}
+
+static int conf_choice(struct menu *menu)
+{
+ struct symbol *sym, *def_sym;
+ struct menu *child;
+ int type;
+ bool is_new;
+
+ sym = menu->sym;
+ type = sym_get_type(sym);
+ is_new = !sym_has_value(sym);
+ if (sym_is_changable(sym)) {
+ conf_sym(menu);
+ sym_calc_value(sym);
+ switch (sym_get_tristate_value(sym)) {
+ case no:
+ return 1;
+ case mod:
+ return 0;
+ case yes:
+ break;
+ }
+ } else {
+ switch (sym_get_tristate_value(sym)) {
+ case no:
+ return 1;
+ case mod:
+ printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
+ return 0;
+ case yes:
+ break;
+ }
+ }
+
+ while (1) {
+ int cnt, def;
+
+ printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
+ def_sym = sym_get_choice_value(sym);
+ cnt = def = 0;
+ line[0] = '0';
+ line[1] = 0;
+ for (child = menu->list; child; child = child->next) {
+ if (!menu_is_visible(child))
+ continue;
+ if (!child->sym) {
+ printf("%*c %s\n", indent, '*', menu_get_prompt(child));
+ continue;
+ }
+ cnt++;
+ if (child->sym == def_sym) {
+ def = cnt;
+ printf("%*c", indent, '>');
+ } else
+ printf("%*c", indent, ' ');
+ printf(" %d. %s", cnt, menu_get_prompt(child));
+ if (child->sym->name)
+ printf(" (%s)", child->sym->name);
+ if (!sym_has_value(child->sym))
+ printf(" (NEW)");
+ printf("\n");
+ }
+ printf("%*schoice", indent - 1, "");
+ if (cnt == 1) {
+ printf("[1]: 1\n");
+ goto conf_childs;
+ }
+ printf("[1-%d", cnt);
+ if (sym->help)
+ printf("?");
+ printf("]: ");
+ switch (input_mode) {
+ case ask_new:
+ case ask_silent:
+ if (!is_new) {
+ cnt = def;
+ printf("%d\n", cnt);
+ break;
+ }
+ check_stdin();
+ case ask_all:
+ fflush(stdout);
+ fgets(line, 128, stdin);
+ strip(line);
+ if (line[0] == '?') {
+ printf("\n%s\n", menu->sym->help ?
+ menu->sym->help : nohelp_text);
+ continue;
+ }
+ if (!line[0])
+ cnt = def;
+ else if (isdigit(line[0]))
+ cnt = atoi(line);
+ else
+ continue;
+ break;
+ case set_random:
+ def = (random() % cnt) + 1;
+ case set_default:
+ case set_yes:
+ case set_mod:
+ case set_no:
+ case ask_mod:
+ cnt = def;
+ printf("%d\n", cnt);
+ break;
+ }
+
+ conf_childs:
+ for (child = menu->list; child; child = child->next) {
+ if (!child->sym || !menu_is_visible(child))
+ continue;
+ if (!--cnt)
+ break;
+ }
+ if (!child)
+ continue;
+ if (line[strlen(line) - 1] == '?') {
+ printf("\n%s\n", child->sym->help ?
+ child->sym->help : nohelp_text);
+ continue;
+ }
+ sym_set_choice_value(sym, child->sym);
+ if (child->list) {
+ indent += 2;
+ conf(child->list);
+ indent -= 2;
+ }
+ return 1;
+ }
+}
+
+static void conf(struct menu *menu)
+{
+ struct symbol *sym;
+ struct property *prop;
+ struct menu *child;
+
+ if (!menu_is_visible(menu))
+ return;
+
+ sym = menu->sym;
+ prop = menu->prompt;
+ if (prop) {
+ const char *prompt;
+
+ switch (prop->type) {
+ case P_MENU:
+ if (input_mode == ask_silent && rootEntry != menu) {
+ check_conf(menu);
+ return;
+ }
+ case P_COMMENT:
+ prompt = menu_get_prompt(menu);
+ if (prompt)
+ printf("%*c\n%*c %s\n%*c\n",
+ indent, '*',
+ indent, '*', prompt,
+ indent, '*');
+ default:
+ ;
+ }
+ }
+
+ if (!sym)
+ goto conf_childs;
+
+ if (sym_is_choice(sym)) {
+ conf_choice(menu);
+ if (sym->curr.tri != mod)
+ return;
+ goto conf_childs;
+ }
+
+ switch (sym->type) {
+ case S_INT:
+ case S_HEX:
+ case S_STRING:
+ conf_string(menu);
+ break;
+ default:
+ conf_sym(menu);
+ break;
+ }
+
+conf_childs:
+ if (sym)
+ indent += 2;
+ for (child = menu->list; child; child = child->next)
+ conf(child);
+ if (sym)
+ indent -= 2;
+}
+
+static void check_conf(struct menu *menu)
+{
+ struct symbol *sym;
+ struct menu *child;
+
+ if (!menu_is_visible(menu))
+ return;
+
+ sym = menu->sym;
+ if (sym) {
+ if (sym_is_changable(sym) && !sym_has_value(sym)) {
+ if (!conf_cnt++)
+ printf("*\n* Restart config...\n*\n");
+ rootEntry = menu_get_parent_menu(menu);
+ conf(rootEntry);
+ }
+ if (sym_is_choice(sym) && sym_get_tristate_value(sym) != mod)
+ return;
+ }
+
+ for (child = menu->list; child; child = child->next)
+ check_conf(child);
+}
+
+int main(int ac, char **av)
+{
+ int i = 1;
+ const char *name;
+ struct stat tmpstat;
+
+ if (ac > i && av[i][0] == '-') {
+ switch (av[i++][1]) {
+ case 'A':
+ output_mode = 1;
+ /* FALLTHROUGH */
+ case 'o':
+ input_mode = ask_new;
+ break;
+ case 'a':
+ input_mode = ask_new;
+ press_enter = 1;
+ break;
+ case 's':
+ input_mode = ask_silent;
+ valid_stdin = isatty(0) && isatty(1) && isatty(2);
+ break;
+ case 'd':
+ input_mode = set_default;
+ break;
+ case 'D':
+ input_mode = set_default;
+ defconfig_file = av[i++];
+ if (!defconfig_file) {
+ printf("%s: No default config file specified\n",
+ av[0]);
+ exit(1);
+ }
+ break;
+ case 'n':
+ input_mode = set_no;
+ break;
+ case 'M':
+ input_mode = ask_mod;
+ break;
+ case 'm':
+ input_mode = set_mod;
+ break;
+ case 'y':
+ input_mode = set_yes;
+ break;
+ case 'r':
+ input_mode = set_random;
+ srandom(time(NULL));
+ break;
+ case 'h':
+ case '?':
+ printf("%s [-o|-s] config\n", av[0]);
+ exit(0);
+ }
+ }
+ name = av[i];
+ if (!name) {
+ printf("%s: configuration file missing\n", av[0]);
+ }
+ conf_parse(name);
+ //zconfdump(stdout);
+ switch (input_mode) {
+ case set_default:
+ if (!defconfig_file)
+ defconfig_file = conf_get_default_confname();
+ if (conf_read(defconfig_file)) {
+ printf("***\n"
+ "*** Can't find default configuration \"%s\"!\n"
+ "***\n", defconfig_file);
+ exit(1);
+ }
+ break;
+ case ask_silent:
+ if (stat(".config", &tmpstat)) {
+ printf("***\n"
+ "*** You have not yet configured OpenADK!\n"
+ "***\n"
+ "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
+ "*** \"make menuconfig\" or \"make config\").\n"
+ "***\n");
+ exit(1);
+ }
+ case ask_all:
+ case ask_new:
+ case ask_mod:
+ conf_read(NULL);
+ break;
+ default:
+ break;
+ }
+
+ if (input_mode != ask_silent) {
+ rootEntry = &rootmenu;
+ conf(&rootmenu);
+ if (input_mode == ask_all) {
+ input_mode = ask_silent;
+ valid_stdin = 1;
+ }
+ }
+ do {
+ conf_cnt = 0;
+ check_conf(&rootmenu);
+ } while (conf_cnt);
+ if (conf_write(NULL)) {
+ fprintf(stderr, "\n*** Error during writing of the OpenADK configuration.\n\n");
+ return 1;
+ }
+ return 0;
+}
diff --git a/config/confdata.c b/config/confdata.c
new file mode 100644
index 000000000..3bebe2c22
--- /dev/null
+++ b/config/confdata.c
@@ -0,0 +1,449 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <sys/stat.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+int output_mode = 0;
+
+const char conf_def_filename[] = ".config";
+
+const char conf_defname[] = "Config.default";
+
+const char *conf_confnames[] = {
+ ".config",
+ conf_defname,
+ NULL,
+};
+
+static char *conf_expand_value(const char *in)
+{
+ struct symbol *sym;
+ const char *src;
+ static char res_value[SYMBOL_MAXLENGTH];
+ char *dst, name[SYMBOL_MAXLENGTH];
+
+ res_value[0] = 0;
+ dst = name;
+ while ((src = strchr(in, '$'))) {
+ strncat(res_value, in, src - in);
+ src++;
+ dst = name;
+ while (isalnum(*src) || *src == '_')
+ *dst++ = *src++;
+ *dst = 0;
+ sym = sym_lookup(name, 0);
+ sym_calc_value(sym);
+ strcat(res_value, sym_get_string_value(sym));
+ in = src;
+ }
+ strcat(res_value, in);
+
+ return res_value;
+}
+
+char *conf_get_default_confname(void)
+{
+ struct stat buf;
+ static char fullname[PATH_MAX+1];
+ char *env, *name;
+
+ name = conf_expand_value(conf_defname);
+ env = getenv(SRCTREE);
+ if (env) {
+ sprintf(fullname, "%s/%s", env, name);
+ if (!stat(fullname, &buf))
+ return fullname;
+ }
+ return name;
+}
+
+int conf_read(const char *name)
+{
+ FILE *in = NULL;
+ char line[2048];
+ char *p, *p2;
+ int lineno = 0;
+ struct symbol *sym;
+ struct property *prop;
+ struct expr *e;
+ int i;
+
+ if (name) {
+ in = zconf_fopen(name);
+ } else {
+ const char **names = conf_confnames;
+ while ((name = *names++)) {
+ name = conf_expand_value(name);
+ in = zconf_fopen(name);
+ if (in) {
+ printf("#\n"
+ "# using defaults found in %s\n"
+ "#\n", name);
+ break;
+ }
+ }
+ }
+
+ if (!in)
+ return 1;
+
+ for_all_symbols(i, sym) {
+ sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED;
+ sym->flags &= ~SYMBOL_VALID;
+ switch (sym->type) {
+ case S_INT:
+ case S_HEX:
+ case S_STRING:
+ if (sym->user.val)
+ free(sym->user.val);
+ default:
+ sym->user.val = NULL;
+ sym->user.tri = no;
+ }
+ }
+
+ while (fgets(line, sizeof(line), in)) {
+ lineno++;
+ sym = NULL;
+ switch (line[0]) {
+ case '#':
+ if (line[1]!=' ')
+ continue;
+ p = strchr(line + 2, ' ');
+ if (!p)
+ continue;
+ *p++ = 0;
+ if (strncmp(p, "is not set", 10))
+ continue;
+ sym = sym_find(line + 2);
+ if (!sym) {
+ fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line + 2);
+ break;
+ }
+ switch (sym->type) {
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ sym->user.tri = no;
+ sym->flags &= ~SYMBOL_NEW;
+ break;
+ default:
+ ;
+ }
+ break;
+
+ case 'A' ... 'Z':
+ p = strchr(line, '=');
+ if (!p)
+ continue;
+ *p++ = 0;
+ p2 = strchr(p, '\n');
+ if (p2)
+ *p2 = 0;
+ sym = sym_find(line);
+ if (!sym) {
+ fprintf(stderr, "%s:%d: trying to assign nonexistent symbol %s\n", name, lineno, line);
+ break;
+ }
+ switch (sym->type) {
+ case S_TRISTATE:
+ if (p[0] == 'm') {
+ sym->user.tri = mod;
+ sym->flags &= ~SYMBOL_NEW;
+ break;
+ }
+ case S_BOOLEAN:
+ if (p[0] == 'y') {
+ sym->user.tri = yes;
+ sym->flags &= ~SYMBOL_NEW;
+ break;
+ }
+ if (p[0] == 'n') {
+ sym->user.tri = no;
+ sym->flags &= ~SYMBOL_NEW;
+ break;
+ }
+ break;
+ case S_STRING:
+ if (*p++ != '"')
+ break;
+ for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) {
+ if (*p2 == '"') {
+ *p2 = 0;
+ break;
+ }
+ memmove(p2, p2 + 1, strlen(p2));
+ }
+ if (!p2) {
+ fprintf(stderr, "%s:%d: invalid string found\n", name, lineno);
+ exit(1);
+ }
+ case S_INT:
+ case S_HEX:
+ if (sym_string_valid(sym, p)) {
+ sym->user.val = strdup(p);
+ sym->flags &= ~SYMBOL_NEW;
+ } else {
+ fprintf(stderr, "%s:%d: symbol value '%s' invalid for %s\n", name, lineno, p, sym->name);
+ exit(1);
+ }
+ break;
+ default:
+ ;
+ }
+ break;
+ case '\n':
+ break;
+ default:
+ continue;
+ }
+ if (sym && sym_is_choice_value(sym)) {
+ struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
+ switch (sym->user.tri) {
+ case no:
+ break;
+ case mod:
+ if (cs->user.tri == yes)
+ /* warn? */;
+ break;
+ case yes:
+ if (cs->user.tri != no)
+ /* warn? */;
+ cs->user.val = sym;
+ break;
+ }
+ cs->user.tri = E_OR(cs->user.tri, sym->user.tri);
+ cs->flags &= ~SYMBOL_NEW;
+ }
+ }
+ fclose(in);
+
+ if (modules_sym)
+ sym_calc_value(modules_sym);
+ for_all_symbols(i, sym) {
+ sym_calc_value(sym);
+ if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
+ if (sym->visible == no)
+ sym->flags |= SYMBOL_NEW;
+ switch (sym->type) {
+ case S_STRING:
+ case S_INT:
+ case S_HEX:
+ if (!sym_string_within_range(sym, sym->user.val))
+ sym->flags |= SYMBOL_NEW;
+ default:
+ break;
+ }
+ }
+ if (!sym_is_choice(sym))
+ continue;
+ prop = sym_get_choice_prop(sym);
+ for (e = prop->expr; e; e = e->left.expr)
+ if (e->right.sym->visible != no)
+ sym->flags |= e->right.sym->flags & SYMBOL_NEW;
+ }
+
+ sym_change_count = 1;
+
+ return 0;
+}
+
+int conf_write(const char *name)
+{
+ FILE *out, *out_h;
+ struct symbol *sym;
+ struct menu *menu;
+ const char *basename;
+ char dirname[128], tmpname[128], newname[128];
+ int type, l;
+ const char *str;
+
+ dirname[0] = 0;
+ if (name && name[0]) {
+ struct stat st;
+ char *slash;
+
+ if (!stat(name, &st) && S_ISDIR(st.st_mode)) {
+ strcpy(dirname, name);
+ strcat(dirname, "/");
+ basename = conf_def_filename;
+ } else if ((slash = strrchr(name, '/'))) {
+ int size = slash - name + 1;
+ memcpy(dirname, name, size);
+ dirname[size] = 0;
+ if (slash[1])
+ basename = slash + 1;
+ else
+ basename = conf_def_filename;
+ } else
+ basename = name;
+ } else
+ basename = conf_def_filename;
+
+ sprintf(newname, "%s.tmpconfig.%d", dirname, getpid());
+ out = fopen(newname, "w");
+ if (!out)
+ return 1;
+ out_h = NULL;
+ if (!name) {
+ out_h = fopen(".tmpconfig.h", "w");
+ if (!out_h)
+ return 1;
+ }
+ fprintf(out, "#\n"
+ "# Automatically generated make config: don't edit\n"
+ "#\n");
+ if (out_h) {
+ fprintf(out_h, "/*\n"
+ " * Automatically generated header file: don't edit\n"
+ " */\n\n"
+ "#define AUTOCONF_INCLUDED\n\n"
+ "/* Version Number */\n"
+ "#define BB_VER \"%s\"\n"
+ "#define BB_BT \"%s\"\n",
+ getenv("VERSION"),
+ getenv("BUILDTIME"));
+ if (getenv("EXTRA_VERSION"))
+ fprintf(out_h, "#define BB_EXTRA_VERSION \"%s\"\n",
+ getenv("EXTRA_VERSION"));
+ fprintf(out_h, "\n");
+ }
+
+ if (!sym_change_count)
+ sym_clear_all_valid();
+
+ menu = rootmenu.list;
+ while (menu) {
+ sym = menu->sym;
+ if (!sym) {
+ if (!menu_is_visible(menu))
+ goto next;
+ str = menu_get_prompt(menu);
+ fprintf(out, "\n"
+ "#\n"
+ "# %s\n"
+ "#\n", str);
+ if (out_h)
+ fprintf(out_h, "\n"
+ "/*\n"
+ " * %s\n"
+ " */\n", str);
+ } else if (!(sym->flags & SYMBOL_CHOICE)) {
+ sym_calc_value(sym);
+ if (!(sym->flags & SYMBOL_WRITE) && !output_mode)
+ goto next;
+ sym->flags &= ~SYMBOL_WRITE;
+ type = sym->type;
+ if (type == S_TRISTATE) {
+ sym_calc_value(modules_sym);
+ if (modules_sym->curr.tri == no)
+ type = S_BOOLEAN;
+ }
+ switch (type) {
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ switch (sym_get_tristate_value(sym)) {
+ case no:
+ fprintf(out, "# %s is not set\n", sym->name);
+ if (out_h)
+ fprintf(out_h, "#undef %s\n", sym->name);
+ break;
+ case mod:
+ fprintf(out, "%s=m\n", sym->name);
+#if 0
+ if (out_h)
+ fprintf(out_h, "#define %s_MODULE 1\n", sym->name);
+#endif
+ break;
+ case yes:
+ fprintf(out, "%s=y\n", sym->name);
+ if (out_h)
+ fprintf(out_h, "#define %s 1\n", sym->name);
+ break;
+ }
+ break;
+ case S_STRING:
+ // fix me
+ str = sym_get_string_value(sym);
+ fprintf(out, "%s=\"", sym->name);
+ if (out_h)
+ fprintf(out_h, "#define %s \"", sym->name);
+ do {
+ l = strcspn(str, "\"\\");
+ if (l) {
+ fwrite(str, l, 1, out);
+ if (out_h)
+ fwrite(str, l, 1, out_h);
+ }
+ str += l;
+ while (*str == '\\' || *str == '"') {
+ fprintf(out, "\\%c", *str);
+ if (out_h)
+ fprintf(out_h, "\\%c", *str);
+ str++;
+ }
+ } while (*str);
+ fputs("\"\n", out);
+ if (out_h)
+ fputs("\"\n", out_h);
+ break;
+ case S_HEX:
+ str = sym_get_string_value(sym);
+ if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
+ fprintf(out, "%s=%s\n", sym->name, str);
+ if (out_h)
+ fprintf(out_h, "#define %s 0x%s\n", sym->name, str);
+ break;
+ }
+ case S_INT:
+ str = sym_get_string_value(sym);
+ fprintf(out, "%s=%s\n", sym->name, str);
+ if (out_h)
+ fprintf(out_h, "#define %s %s\n", sym->name, str);
+ break;
+ }
+ }
+
+ next:
+ if (menu->list) {
+ menu = menu->list;
+ continue;
+ }
+ if (menu->next)
+ menu = menu->next;
+ else while ((menu = menu->parent)) {
+ if (menu->next) {
+ menu = menu->next;
+ break;
+ }
+ }
+ }
+ fclose(out);
+ if (out_h) {
+ fclose(out_h);
+ rename(".tmpconfig.h", "include/config.h");
+ file_write_dep(NULL);
+ }
+ if (!name || basename != conf_def_filename) {
+ if (!name)
+ name = conf_def_filename;
+ sprintf(tmpname, "%s.old", name);
+ rename(name, tmpname);
+ }
+ sprintf(tmpname, "%s%s", dirname, basename);
+ if (rename(newname, tmpname))
+ return 1;
+
+ sym_change_count = 0;
+
+ return 0;
+}
diff --git a/config/dialog.h b/config/dialog.h
new file mode 100644
index 000000000..6486cc8f7
--- /dev/null
+++ b/config/dialog.h
@@ -0,0 +1,196 @@
+
+/*
+ * dialog.h -- common declarations for all dialog modules
+ *
+ * AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef CURSES_LOC
+#include CURSES_LOC
+
+/*
+ * Colors in ncurses 1.9.9e do not work properly since foreground and
+ * background colors are OR'd rather than separately masked. This version
+ * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible
+ * with standard curses. The simplest fix (to make this work with standard
+ * curses) uses the wbkgdset() function, not used in the original hack.
+ * Turn it off if we're building with 1.9.9e, since it just confuses things.
+ */
+#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE)
+#define OLD_NCURSES 1
+#undef wbkgdset
+#define wbkgdset(w,p) /*nothing*/
+#else
+#define OLD_NCURSES 0
+#endif
+
+#define TR(params) _tracef params
+
+#define ESC 27
+#define TAB 9
+#define MAX_LEN 2048
+#define BUF_SIZE (10*1024)
+#define MIN(x,y) (x < y ? x : y)
+#define MAX(x,y) (x > y ? x : y)
+
+
+#ifndef ACS_ULCORNER
+#define ACS_ULCORNER '+'
+#endif
+#ifndef ACS_LLCORNER
+#define ACS_LLCORNER '+'
+#endif
+#ifndef ACS_URCORNER
+#define ACS_URCORNER '+'
+#endif
+#ifndef ACS_LRCORNER
+#define ACS_LRCORNER '+'
+#endif
+#ifndef ACS_HLINE
+#define ACS_HLINE '-'
+#endif
+#ifndef ACS_VLINE
+#define ACS_VLINE '|'
+#endif
+#ifndef ACS_LTEE
+#define ACS_LTEE '+'
+#endif
+#ifndef ACS_RTEE
+#define ACS_RTEE '+'
+#endif
+#ifndef ACS_UARROW
+#define ACS_UARROW '^'
+#endif
+#ifndef ACS_DARROW
+#define ACS_DARROW 'v'
+#endif
+
+/*
+ * Attribute names
+ */
+#define screen_attr attributes[0]
+#define shadow_attr attributes[1]
+#define dialog_attr attributes[2]
+#define title_attr attributes[3]
+#define border_attr attributes[4]
+#define button_active_attr attributes[5]
+#define button_inactive_attr attributes[6]
+#define button_key_active_attr attributes[7]
+#define button_key_inactive_attr attributes[8]
+#define button_label_active_attr attributes[9]
+#define button_label_inactive_attr attributes[10]
+#define inputbox_attr attributes[11]
+#define inputbox_border_attr attributes[12]
+#define searchbox_attr attributes[13]
+#define searchbox_title_attr attributes[14]
+#define searchbox_border_attr attributes[15]
+#define position_indicator_attr attributes[16]
+#define menubox_attr attributes[17]
+#define menubox_border_attr attributes[18]
+#define item_attr attributes[19]
+#define item_selected_attr attributes[20]
+#define tag_attr attributes[21]
+#define tag_selected_attr attributes[22]
+#define tag_key_attr attributes[23]
+#define tag_key_selected_attr attributes[24]
+#define check_attr attributes[25]
+#define check_selected_attr attributes[26]
+#define uarrow_attr attributes[27]
+#define darrow_attr attributes[28]
+
+/* number of attributes */
+#define ATTRIBUTE_COUNT 29
+
+/*
+ * Global variables
+ */
+extern bool use_colors;
+
+extern chtype attributes[];
+#endif
+
+extern char *backtitle;
+
+struct dialog_list_item {
+ char *name;
+ int namelen;
+ char *tag;
+ int selected; /* Set to 1 by dialog_*() function. */
+};
+
+/*
+ * Function prototypes
+ */
+
+void init_dialog (void);
+void end_dialog (void);
+void dialog_clear (void);
+#ifdef CURSES_LOC
+void attr_clear (WINDOW * win, int height, int width, chtype attr);
+void color_setup (void);
+void print_autowrap (WINDOW * win, const char *prompt, int width, int y, int x);
+void print_button (WINDOW * win, const char *label, int y, int x, int selected);
+void draw_box (WINDOW * win, int y, int x, int height, int width, chtype box,
+ chtype border);
+void draw_shadow (WINDOW * win, int y, int x, int height, int width);
+#endif
+
+int first_alpha (const char *string, const char *exempt);
+int dialog_yesno (const char *title, const char *prompt, int height, int width);
+int dialog_msgbox (const char *title, const char *prompt, int height,
+ int width, int pause);
+int dialog_textbox (const char *title, const char *file, int height, int width);
+int dialog_menu (const char *title, const char *prompt, int height, int width,
+ int menu_height, const char *choice, int item_no,
+ struct dialog_list_item ** items);
+int dialog_checklist (const char *title, const char *prompt, int height,
+ int width, int list_height, int item_no,
+ struct dialog_list_item ** items, int flag);
+extern unsigned char dialog_input_result[];
+int dialog_inputbox (const char *title, const char *prompt, int height,
+ int width, const char *init);
+
+struct dialog_list_item *first_sel_item(int item_no,
+ struct dialog_list_item ** items);
+
+/*
+ * This is the base for fictitious keys, which activate
+ * the buttons.
+ *
+ * Mouse-generated keys are the following:
+ * -- the first 32 are used as numbers, in addition to '0'-'9'
+ * -- the lowercase are used to signal mouse-enter events (M_EVENT + 'o')
+ * -- uppercase chars are used to invoke the button (M_EVENT + 'O')
+ */
+#ifdef CURSES_LOC
+#define M_EVENT (KEY_MAX+1)
+#endif
+
+
+/*
+ * The `flag' parameter in checklist is used to select between
+ * radiolist and checklist
+ */
+#define FLAG_CHECK 1
+#define FLAG_RADIO 0
diff --git a/config/expr.c b/config/expr.c
new file mode 100644
index 000000000..10f45232b
--- /dev/null
+++ b/config/expr.c
@@ -0,0 +1,1089 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+#define DEBUG_EXPR 0
+
+struct expr *expr_alloc_symbol(struct symbol *sym)
+{
+ struct expr *e = malloc(sizeof(*e));
+ memset(e, 0, sizeof(*e));
+ e->type = E_SYMBOL;
+ e->left.sym = sym;
+ return e;
+}
+
+struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
+{
+ struct expr *e = malloc(sizeof(*e));
+ memset(e, 0, sizeof(*e));
+ e->type = type;
+ e->left.expr = ce;
+ return e;
+}
+
+struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)
+{
+ struct expr *e = malloc(sizeof(*e));
+ memset(e, 0, sizeof(*e));
+ e->type = type;
+ e->left.expr = e1;
+ e->right.expr = e2;
+ return e;
+}
+
+struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)
+{
+ struct expr *e = malloc(sizeof(*e));
+ memset(e, 0, sizeof(*e));
+ e->type = type;
+ e->left.sym = s1;
+ e->right.sym = s2;
+ return e;
+}
+
+struct expr *expr_alloc_and(struct expr *e1, struct expr *e2)
+{
+ if (!e1)
+ return e2;
+ return e2 ? expr_alloc_two(E_AND, e1, e2) : e1;
+}
+
+struct expr *expr_alloc_or(struct expr *e1, struct expr *e2)
+{
+ if (!e1)
+ return e2;
+ return e2 ? expr_alloc_two(E_OR, e1, e2) : e1;
+}
+
+struct expr *expr_copy(struct expr *org)
+{
+ struct expr *e;
+
+ if (!org)
+ return NULL;
+
+ e = malloc(sizeof(*org));
+ memcpy(e, org, sizeof(*org));
+ switch (org->type) {
+ case E_SYMBOL:
+ e->left = org->left;
+ break;
+ case E_NOT:
+ e->left.expr = expr_copy(org->left.expr);
+ break;
+ case E_EQUAL:
+ case E_UNEQUAL:
+ e->left.sym = org->left.sym;
+ e->right.sym = org->right.sym;
+ break;
+ case E_AND:
+ case E_OR:
+ case E_CHOICE:
+ e->left.expr = expr_copy(org->left.expr);
+ e->right.expr = expr_copy(org->right.expr);
+ break;
+ default:
+ printf("can't copy type %d\n", e->type);
+ free(e);
+ e = NULL;
+ break;
+ }
+
+ return e;
+}
+
+void expr_free(struct expr *e)
+{
+ if (!e)
+ return;
+
+ switch (e->type) {
+ case E_SYMBOL:
+ break;
+ case E_NOT:
+ expr_free(e->left.expr);
+ return;
+ case E_EQUAL:
+ case E_UNEQUAL:
+ break;
+ case E_OR:
+ case E_AND:
+ expr_free(e->left.expr);
+ expr_free(e->right.expr);
+ break;
+ default:
+ printf("how to free type %d?\n", e->type);
+ break;
+ }
+ free(e);
+}
+
+static int trans_count;
+
+#define e1 (*ep1)
+#define e2 (*ep2)
+
+static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct expr **ep2)
+{
+ if (e1->type == type) {
+ __expr_eliminate_eq(type, &e1->left.expr, &e2);
+ __expr_eliminate_eq(type, &e1->right.expr, &e2);
+ return;
+ }
+ if (e2->type == type) {
+ __expr_eliminate_eq(type, &e1, &e2->left.expr);
+ __expr_eliminate_eq(type, &e1, &e2->right.expr);
+ return;
+ }
+ if (e1->type == E_SYMBOL && e2->type == E_SYMBOL &&
+ e1->left.sym == e2->left.sym && (e1->left.sym->flags & (SYMBOL_YES|SYMBOL_NO)))
+ return;
+ if (!expr_eq(e1, e2))
+ return;
+ trans_count++;
+ expr_free(e1); expr_free(e2);
+ switch (type) {
+ case E_OR:
+ e1 = expr_alloc_symbol(&symbol_no);
+ e2 = expr_alloc_symbol(&symbol_no);
+ break;
+ case E_AND:
+ e1 = expr_alloc_symbol(&symbol_yes);
+ e2 = expr_alloc_symbol(&symbol_yes);
+ break;
+ default:
+ ;
+ }
+}
+
+void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
+{
+ if (!e1 || !e2)
+ return;
+ switch (e1->type) {
+ case E_OR:
+ case E_AND:
+ __expr_eliminate_eq(e1->type, ep1, ep2);
+ default:
+ ;
+ }
+ if (e1->type != e2->type) switch (e2->type) {
+ case E_OR:
+ case E_AND:
+ __expr_eliminate_eq(e2->type, ep1, ep2);
+ default:
+ ;
+ }
+ e1 = expr_eliminate_yn(e1);
+ e2 = expr_eliminate_yn(e2);
+}
+
+#undef e1
+#undef e2
+
+int expr_eq(struct expr *e1, struct expr *e2)
+{
+ int res, old_count;
+
+ if (e1->type != e2->type)
+ return 0;
+ switch (e1->type) {
+ case E_EQUAL:
+ case E_UNEQUAL:
+ return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym;
+ case E_SYMBOL:
+ return e1->left.sym == e2->left.sym;
+ case E_NOT:
+ return expr_eq(e1->left.expr, e2->left.expr);
+ case E_AND:
+ case E_OR:
+ e1 = expr_copy(e1);
+ e2 = expr_copy(e2);
+ old_count = trans_count;
+ expr_eliminate_eq(&e1, &e2);
+ res = (e1->type == E_SYMBOL && e2->type == E_SYMBOL &&
+ e1->left.sym == e2->left.sym);
+ expr_free(e1);
+ expr_free(e2);
+ trans_count = old_count;
+ return res;
+ case E_CHOICE:
+ case E_RANGE:
+ case E_NONE:
+ /* panic */;
+ }
+
+ if (DEBUG_EXPR) {
+ expr_fprint(e1, stdout);
+ printf(" = ");
+ expr_fprint(e2, stdout);
+ printf(" ?\n");
+ }
+
+ return 0;
+}
+
+struct expr *expr_eliminate_yn(struct expr *e)
+{
+ struct expr *tmp;
+
+ if (e) switch (e->type) {
+ case E_AND:
+ e->left.expr = expr_eliminate_yn(e->left.expr);
+ e->right.expr = expr_eliminate_yn(e->right.expr);
+ if (e->left.expr->type == E_SYMBOL) {
+ if (e->left.expr->left.sym == &symbol_no) {
+ expr_free(e->left.expr);
+ expr_free(e->right.expr);
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_no;
+ e->right.expr = NULL;
+ return e;
+ } else if (e->left.expr->left.sym == &symbol_yes) {
+ free(e->left.expr);
+ tmp = e->right.expr;
+ *e = *(e->right.expr);
+ free(tmp);
+ return e;
+ }
+ }
+ if (e->right.expr->type == E_SYMBOL) {
+ if (e->right.expr->left.sym == &symbol_no) {
+ expr_free(e->left.expr);
+ expr_free(e->right.expr);
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_no;
+ e->right.expr = NULL;
+ return e;
+ } else if (e->right.expr->left.sym == &symbol_yes) {
+ free(e->right.expr);
+ tmp = e->left.expr;
+ *e = *(e->left.expr);
+ free(tmp);
+ return e;
+ }
+ }
+ break;
+ case E_OR:
+ e->left.expr = expr_eliminate_yn(e->left.expr);
+ e->right.expr = expr_eliminate_yn(e->right.expr);
+ if (e->left.expr->type == E_SYMBOL) {
+ if (e->left.expr->left.sym == &symbol_no) {
+ free(e->left.expr);
+ tmp = e->right.expr;
+ *e = *(e->right.expr);
+ free(tmp);
+ return e;
+ } else if (e->left.expr->left.sym == &symbol_yes) {
+ expr_free(e->left.expr);
+ expr_free(e->right.expr);
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_yes;
+ e->right.expr = NULL;
+ return e;
+ }
+ }
+ if (e->right.expr->type == E_SYMBOL) {
+ if (e->right.expr->left.sym == &symbol_no) {
+ free(e->right.expr);
+ tmp = e->left.expr;
+ *e = *(e->left.expr);
+ free(tmp);
+ return e;
+ } else if (e->right.expr->left.sym == &symbol_yes) {
+ expr_free(e->left.expr);
+ expr_free(e->right.expr);
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_yes;
+ e->right.expr = NULL;
+ return e;
+ }
+ }
+ break;
+ default:
+ ;
+ }
+ return e;
+}
+
+/*
+ * bool FOO!=n => FOO
+ */
+struct expr *expr_trans_bool(struct expr *e)
+{
+ if (!e)
+ return NULL;
+ switch (e->type) {
+ case E_AND:
+ case E_OR:
+ case E_NOT:
+ e->left.expr = expr_trans_bool(e->left.expr);
+ e->right.expr = expr_trans_bool(e->right.expr);
+ break;
+ case E_UNEQUAL:
+ // FOO!=n -> FOO
+ if (e->left.sym->type == S_TRISTATE) {
+ if (e->right.sym == &symbol_no) {
+ e->type = E_SYMBOL;
+ e->right.sym = NULL;
+ }
+ }
+ break;
+ default:
+ ;
+ }
+ return e;
+}
+
+/*
+ * e1 || e2 -> ?
+ */
+struct expr *expr_join_or(struct expr *e1, struct expr *e2)
+{
+ struct expr *tmp;
+ struct symbol *sym1, *sym2;
+
+ if (expr_eq(e1, e2))
+ return expr_copy(e1);
+ if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT)
+ return NULL;
+ if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT)
+ return NULL;
+ if (e1->type == E_NOT) {
+ tmp = e1->left.expr;
+ if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL)
+ return NULL;
+ sym1 = tmp->left.sym;
+ } else
+ sym1 = e1->left.sym;
+ if (e2->type == E_NOT) {
+ if (e2->left.expr->type != E_SYMBOL)
+ return NULL;
+ sym2 = e2->left.expr->left.sym;
+ } else
+ sym2 = e2->left.sym;
+ if (sym1 != sym2)
+ return NULL;
+ if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE)
+ return NULL;
+ if (sym1->type == S_TRISTATE) {
+ if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+ ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
+ (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
+ // (a='y') || (a='m') -> (a!='n')
+ return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
+ }
+ if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+ ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
+ (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
+ // (a='y') || (a='n') -> (a!='m')
+ return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
+ }
+ if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
+ ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
+ (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
+ // (a='m') || (a='n') -> (a!='y')
+ return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
+ }
+ }
+ if (sym1->type == S_BOOLEAN && sym1 == sym2) {
+ if ((e1->type == E_NOT && e1->left.expr->type == E_SYMBOL && e2->type == E_SYMBOL) ||
+ (e2->type == E_NOT && e2->left.expr->type == E_SYMBOL && e1->type == E_SYMBOL))
+ return expr_alloc_symbol(&symbol_yes);
+ }
+
+ if (DEBUG_EXPR) {
+ printf("optimize (");
+ expr_fprint(e1, stdout);
+ printf(") || (");
+ expr_fprint(e2, stdout);
+ printf(")?\n");
+ }
+ return NULL;
+}
+
+struct expr *expr_join_and(struct expr *e1, struct expr *e2)
+{
+ struct expr *tmp;
+ struct symbol *sym1, *sym2;
+
+ if (expr_eq(e1, e2))
+ return expr_copy(e1);
+ if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT)
+ return NULL;
+ if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT)
+ return NULL;
+ if (e1->type == E_NOT) {
+ tmp = e1->left.expr;
+ if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL)
+ return NULL;
+ sym1 = tmp->left.sym;
+ } else
+ sym1 = e1->left.sym;
+ if (e2->type == E_NOT) {
+ if (e2->left.expr->type != E_SYMBOL)
+ return NULL;
+ sym2 = e2->left.expr->left.sym;
+ } else
+ sym2 = e2->left.sym;
+ if (sym1 != sym2)
+ return NULL;
+ if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE)
+ return NULL;
+
+ if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
+ (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
+ // (a) && (a='y') -> (a='y')
+ return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+
+ if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
+ (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
+ // (a) && (a!='n') -> (a)
+ return expr_alloc_symbol(sym1);
+
+ if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) ||
+ (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod))
+ // (a) && (a!='m') -> (a='y')
+ return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+
+ if (sym1->type == S_TRISTATE) {
+ if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
+ // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+ sym2 = e1->right.sym;
+ if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
+ return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
+ : expr_alloc_symbol(&symbol_no);
+ }
+ if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
+ // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
+ sym2 = e2->right.sym;
+ if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
+ return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
+ : expr_alloc_symbol(&symbol_no);
+ }
+ if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+ ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
+ (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes)))
+ // (a!='y') && (a!='n') -> (a='m')
+ return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod);
+
+ if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+ ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
+ (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes)))
+ // (a!='y') && (a!='m') -> (a='n')
+ return expr_alloc_comp(E_EQUAL, sym1, &symbol_no);
+
+ if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
+ ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
+ (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod)))
+ // (a!='m') && (a!='n') -> (a='m')
+ return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);
+
+ if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
+ (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) ||
+ (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) ||
+ (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes))
+ return NULL;
+ }
+
+ if (DEBUG_EXPR) {
+ printf("optimize (");
+ expr_fprint(e1, stdout);
+ printf(") && (");
+ expr_fprint(e2, stdout);
+ printf(")?\n");
+ }
+ return NULL;
+}
+
+static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct expr **ep2)
+{
+#define e1 (*ep1)
+#define e2 (*ep2)
+ struct expr *tmp;
+
+ if (e1->type == type) {
+ expr_eliminate_dups1(type, &e1->left.expr, &e2);
+ expr_eliminate_dups1(type, &e1->right.expr, &e2);
+ return;
+ }
+ if (e2->type == type) {
+ expr_eliminate_dups1(type, &e1, &e2->left.expr);
+ expr_eliminate_dups1(type, &e1, &e2->right.expr);
+ return;
+ }
+ if (e1 == e2)
+ return;
+
+ switch (e1->type) {
+ case E_OR: case E_AND:
+ expr_eliminate_dups1(e1->type, &e1, &e1);
+ default:
+ ;
+ }
+
+ switch (type) {
+ case E_OR:
+ tmp = expr_join_or(e1, e2);
+ if (tmp) {
+ expr_free(e1); expr_free(e2);
+ e1 = expr_alloc_symbol(&symbol_no);
+ e2 = tmp;
+ trans_count++;
+ }
+ break;
+ case E_AND:
+ tmp = expr_join_and(e1, e2);
+ if (tmp) {
+ expr_free(e1); expr_free(e2);
+ e1 = expr_alloc_symbol(&symbol_yes);
+ e2 = tmp;
+ trans_count++;
+ }
+ break;
+ default:
+ ;
+ }
+#undef e1
+#undef e2
+}
+
+static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct expr **ep2)
+{
+#define e1 (*ep1)
+#define e2 (*ep2)
+ struct expr *tmp, *tmp1, *tmp2;
+
+ if (e1->type == type) {
+ expr_eliminate_dups2(type, &e1->left.expr, &e2);
+ expr_eliminate_dups2(type, &e1->right.expr, &e2);
+ return;
+ }
+ if (e2->type == type) {
+ expr_eliminate_dups2(type, &e1, &e2->left.expr);
+ expr_eliminate_dups2(type, &e1, &e2->right.expr);
+ }
+ if (e1 == e2)
+ return;
+
+ switch (e1->type) {
+ case E_OR:
+ expr_eliminate_dups2(e1->type, &e1, &e1);
+ // (FOO || BAR) && (!FOO && !BAR) -> n
+ tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
+ tmp2 = expr_copy(e2);
+ tmp = expr_extract_eq_and(&tmp1, &tmp2);
+ if (expr_is_yes(tmp1)) {
+ expr_free(e1);
+ e1 = expr_alloc_symbol(&symbol_no);
+ trans_count++;
+ }
+ expr_free(tmp2);
+ expr_free(tmp1);
+ expr_free(tmp);
+ break;
+ case E_AND:
+ expr_eliminate_dups2(e1->type, &e1, &e1);
+ // (FOO && BAR) || (!FOO || !BAR) -> y
+ tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
+ tmp2 = expr_copy(e2);
+ tmp = expr_extract_eq_or(&tmp1, &tmp2);
+ if (expr_is_no(tmp1)) {
+ expr_free(e1);
+ e1 = expr_alloc_symbol(&symbol_yes);
+ trans_count++;
+ }
+ expr_free(tmp2);
+ expr_free(tmp1);
+ expr_free(tmp);
+ break;
+ default:
+ ;
+ }
+#undef e1
+#undef e2
+}
+
+struct expr *expr_eliminate_dups(struct expr *e)
+{
+ int oldcount;
+ if (!e)
+ return e;
+
+ oldcount = trans_count;
+ while (1) {
+ trans_count = 0;
+ switch (e->type) {
+ case E_OR: case E_AND:
+ expr_eliminate_dups1(e->type, &e, &e);
+ expr_eliminate_dups2(e->type, &e, &e);
+ default:
+ ;
+ }
+ if (!trans_count)
+ break;
+ e = expr_eliminate_yn(e);
+ }
+ trans_count = oldcount;
+ return e;
+}
+
+struct expr *expr_transform(struct expr *e)
+{
+ struct expr *tmp;
+
+ if (!e)
+ return NULL;
+ switch (e->type) {
+ case E_EQUAL:
+ case E_UNEQUAL:
+ case E_SYMBOL:
+ case E_CHOICE:
+ break;
+ default:
+ e->left.expr = expr_transform(e->left.expr);
+ e->right.expr = expr_transform(e->right.expr);
+ }
+
+ switch (e->type) {
+ case E_EQUAL:
+ if (e->left.sym->type != S_BOOLEAN)
+ break;
+ if (e->right.sym == &symbol_no) {
+ e->type = E_NOT;
+ e->left.expr = expr_alloc_symbol(e->left.sym);
+ e->right.sym = NULL;
+ break;
+ }
+ if (e->right.sym == &symbol_mod) {
+ printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name);
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_no;
+ e->right.sym = NULL;
+ break;
+ }
+ if (e->right.sym == &symbol_yes) {
+ e->type = E_SYMBOL;
+ e->right.sym = NULL;
+ break;
+ }
+ break;
+ case E_UNEQUAL:
+ if (e->left.sym->type != S_BOOLEAN)
+ break;
+ if (e->right.sym == &symbol_no) {
+ e->type = E_SYMBOL;
+ e->right.sym = NULL;
+ break;
+ }
+ if (e->right.sym == &symbol_mod) {
+ printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name);
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_yes;
+ e->right.sym = NULL;
+ break;
+ }
+ if (e->right.sym == &symbol_yes) {
+ e->type = E_NOT;
+ e->left.expr = expr_alloc_symbol(e->left.sym);
+ e->right.sym = NULL;
+ break;
+ }
+ break;
+ case E_NOT:
+ switch (e->left.expr->type) {
+ case E_NOT:
+ // !!a -> a
+ tmp = e->left.expr->left.expr;
+ free(e->left.expr);
+ free(e);
+ e = tmp;
+ e = expr_transform(e);
+ break;
+ case E_EQUAL:
+ case E_UNEQUAL:
+ // !a='x' -> a!='x'
+ tmp = e->left.expr;
+ free(e);
+ e = tmp;
+ e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
+ break;
+ case E_OR:
+ // !(a || b) -> !a && !b
+ tmp = e->left.expr;
+ e->type = E_AND;
+ e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
+ tmp->type = E_NOT;
+ tmp->right.expr = NULL;
+ e = expr_transform(e);
+ break;
+ case E_AND:
+ // !(a && b) -> !a || !b
+ tmp = e->left.expr;
+ e->type = E_OR;
+ e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
+ tmp->type = E_NOT;
+ tmp->right.expr = NULL;
+ e = expr_transform(e);
+ break;
+ case E_SYMBOL:
+ if (e->left.expr->left.sym == &symbol_yes) {
+ // !'y' -> 'n'
+ tmp = e->left.expr;
+ free(e);
+ e = tmp;
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_no;
+ break;
+ }
+ if (e->left.expr->left.sym == &symbol_mod) {
+ // !'m' -> 'm'
+ tmp = e->left.expr;
+ free(e);
+ e = tmp;
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_mod;
+ break;
+ }
+ if (e->left.expr->left.sym == &symbol_no) {
+ // !'n' -> 'y'
+ tmp = e->left.expr;
+ free(e);
+ e = tmp;
+ e->type = E_SYMBOL;
+ e->left.sym = &symbol_yes;
+ break;
+ }
+ break;
+ default:
+ ;
+ }
+ break;
+ default:
+ ;
+ }
+ return e;
+}
+
+int expr_contains_symbol(struct expr *dep, struct symbol *sym)
+{
+ if (!dep)
+ return 0;
+
+ switch (dep->type) {
+ case E_AND:
+ case E_OR:
+ return expr_contains_symbol(dep->left.expr, sym) ||
+ expr_contains_symbol(dep->right.expr, sym);
+ case E_SYMBOL:
+ return dep->left.sym == sym;
+ case E_EQUAL:
+ case E_UNEQUAL:
+ return dep->left.sym == sym ||
+ dep->right.sym == sym;
+ case E_NOT:
+ return expr_contains_symbol(dep->left.expr, sym);
+ default:
+ ;
+ }
+ return 0;
+}
+
+bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
+{
+ if (!dep)
+ return false;
+
+ switch (dep->type) {
+ case E_AND:
+ return expr_depends_symbol(dep->left.expr, sym) ||
+ expr_depends_symbol(dep->right.expr, sym);
+ case E_SYMBOL:
+ return dep->left.sym == sym;
+ case E_EQUAL:
+ if (dep->left.sym == sym) {
+ if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod)
+ return true;
+ }
+ break;
+ case E_UNEQUAL:
+ if (dep->left.sym == sym) {
+ if (dep->right.sym == &symbol_no)
+ return true;
+ }
+ break;
+ default:
+ ;
+ }
+ return false;
+}
+
+struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
+{
+ struct expr *tmp = NULL;
+ expr_extract_eq(E_AND, &tmp, ep1, ep2);
+ if (tmp) {
+ *ep1 = expr_eliminate_yn(*ep1);
+ *ep2 = expr_eliminate_yn(*ep2);
+ }
+ return tmp;
+}
+
+struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
+{
+ struct expr *tmp = NULL;
+ expr_extract_eq(E_OR, &tmp, ep1, ep2);
+ if (tmp) {
+ *ep1 = expr_eliminate_yn(*ep1);
+ *ep2 = expr_eliminate_yn(*ep2);
+ }
+ return tmp;
+}
+
+void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
+{
+#define e1 (*ep1)
+#define e2 (*ep2)
+ if (e1->type == type) {
+ expr_extract_eq(type, ep, &e1->left.expr, &e2);
+ expr_extract_eq(type, ep, &e1->right.expr, &e2);
+ return;
+ }
+ if (e2->type == type) {
+ expr_extract_eq(type, ep, ep1, &e2->left.expr);
+ expr_extract_eq(type, ep, ep1, &e2->right.expr);
+ return;
+ }
+ if (expr_eq(e1, e2)) {
+ *ep = *ep ? expr_alloc_two(type, *ep, e1) : e1;
+ expr_free(e2);
+ if (type == E_AND) {
+ e1 = expr_alloc_symbol(&symbol_yes);
+ e2 = expr_alloc_symbol(&symbol_yes);
+ } else if (type == E_OR) {
+ e1 = expr_alloc_symbol(&symbol_no);
+ e2 = expr_alloc_symbol(&symbol_no);
+ }
+ }
+#undef e1
+#undef e2
+}
+
+struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym)
+{
+ struct expr *e1, *e2;
+
+ if (!e) {
+ e = expr_alloc_symbol(sym);
+ if (type == E_UNEQUAL)
+ e = expr_alloc_one(E_NOT, e);
+ return e;
+ }
+ switch (e->type) {
+ case E_AND:
+ e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym);
+ e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym);
+ if (sym == &symbol_yes)
+ e = expr_alloc_two(E_AND, e1, e2);
+ if (sym == &symbol_no)
+ e = expr_alloc_two(E_OR, e1, e2);
+ if (type == E_UNEQUAL)
+ e = expr_alloc_one(E_NOT, e);
+ return e;
+ case E_OR:
+ e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym);
+ e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym);
+ if (sym == &symbol_yes)
+ e = expr_alloc_two(E_OR, e1, e2);
+ if (sym == &symbol_no)
+ e = expr_alloc_two(E_AND, e1, e2);
+ if (type == E_UNEQUAL)
+ e = expr_alloc_one(E_NOT, e);
+ return e;
+ case E_NOT:
+ return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym);
+ case E_UNEQUAL:
+ case E_EQUAL:
+ if (type == E_EQUAL) {
+ if (sym == &symbol_yes)
+ return expr_copy(e);
+ if (sym == &symbol_mod)
+ return expr_alloc_symbol(&symbol_no);
+ if (sym == &symbol_no)
+ return expr_alloc_one(E_NOT, expr_copy(e));
+ } else {
+ if (sym == &symbol_yes)
+ return expr_alloc_one(E_NOT, expr_copy(e));
+ if (sym == &symbol_mod)
+ return expr_alloc_symbol(&symbol_yes);
+ if (sym == &symbol_no)
+ return expr_copy(e);
+ }
+ break;
+ case E_SYMBOL:
+ return expr_alloc_comp(type, e->left.sym, sym);
+ case E_CHOICE:
+ case E_RANGE:
+ case E_NONE:
+ /* panic */;
+ }
+ return NULL;
+}
+
+tristate expr_calc_value(struct expr *e)
+{
+ tristate val1, val2;
+ const char *str1, *str2;
+
+ if (!e)
+ return yes;
+
+ switch (e->type) {
+ case E_SYMBOL:
+ sym_calc_value(e->left.sym);
+ return e->left.sym->curr.tri;
+ case E_AND:
+ val1 = expr_calc_value(e->left.expr);
+ val2 = expr_calc_value(e->right.expr);
+ return E_AND(val1, val2);
+ case E_OR:
+ val1 = expr_calc_value(e->left.expr);
+ val2 = expr_calc_value(e->right.expr);
+ return E_OR(val1, val2);
+ case E_NOT:
+ val1 = expr_calc_value(e->left.expr);
+ return E_NOT(val1);
+ case E_EQUAL:
+ sym_calc_value(e->left.sym);
+ sym_calc_value(e->right.sym);
+ str1 = sym_get_string_value(e->left.sym);
+ str2 = sym_get_string_value(e->right.sym);
+ return !strcmp(str1, str2) ? yes : no;
+ case E_UNEQUAL:
+ sym_calc_value(e->left.sym);
+ sym_calc_value(e->right.sym);
+ str1 = sym_get_string_value(e->left.sym);
+ str2 = sym_get_string_value(e->right.sym);
+ return !strcmp(str1, str2) ? no : yes;
+ default:
+ printf("expr_calc_value: %d?\n", e->type);
+ return no;
+ }
+}
+
+int expr_compare_type(enum expr_type t1, enum expr_type t2)
+{
+#if 0
+ return 1;
+#else
+ if (t1 == t2)
+ return 0;
+ switch (t1) {
+ case E_EQUAL:
+ case E_UNEQUAL:
+ if (t2 == E_NOT)
+ return 1;
+ case E_NOT:
+ if (t2 == E_AND)
+ return 1;
+ case E_AND:
+ if (t2 == E_OR)
+ return 1;
+ case E_OR:
+ if (t2 == E_CHOICE)
+ return 1;
+ case E_CHOICE:
+ if (t2 == 0)
+ return 1;
+ default:
+ return -1;
+ }
+ printf("[%dgt%d?]", t1, t2);
+ return 0;
+#endif
+}
+
+void expr_print(struct expr *e, void (*fn)(void *, const char *), void *data, int prevtoken)
+{
+ if (!e) {
+ fn(data, "y");
+ return;
+ }
+
+ if (expr_compare_type(prevtoken, e->type) > 0)
+ fn(data, "(");
+ switch (e->type) {
+ case E_SYMBOL:
+ if (e->left.sym->name)
+ fn(data, e->left.sym->name);
+ else
+ fn(data, "<choice>");
+ break;
+ case E_NOT:
+ fn(data, "!");
+ expr_print(e->left.expr, fn, data, E_NOT);
+ break;
+ case E_EQUAL:
+ fn(data, e->left.sym->name);
+ fn(data, "=");
+ fn(data, e->right.sym->name);
+ break;
+ case E_UNEQUAL:
+ fn(data, e->left.sym->name);
+ fn(data, "!=");
+ fn(data, e->right.sym->name);
+ break;
+ case E_OR:
+ expr_print(e->left.expr, fn, data, E_OR);
+ fn(data, " || ");
+ expr_print(e->right.expr, fn, data, E_OR);
+ break;
+ case E_AND:
+ expr_print(e->left.expr, fn, data, E_AND);
+ fn(data, " && ");
+ expr_print(e->right.expr, fn, data, E_AND);
+ break;
+ case E_CHOICE:
+ fn(data, e->right.sym->name);
+ if (e->left.expr) {
+ fn(data, " ^ ");
+ expr_print(e->left.expr, fn, data, E_CHOICE);
+ }
+ break;
+ case E_RANGE:
+ fn(data, "[");
+ fn(data, e->left.sym->name);
+ fn(data, " ");
+ fn(data, e->right.sym->name);
+ fn(data, "]");
+ break;
+ default:
+ {
+ char buf[32];
+ sprintf(buf, "<unknown type %d>", e->type);
+ fn(data, buf);
+ break;
+ }
+ }
+ if (expr_compare_type(prevtoken, e->type) > 0)
+ fn(data, ")");
+}
+
+static void expr_print_file_helper(void *data, const char *str)
+{
+ fwrite(str, strlen(str), 1, data);
+}
+
+void expr_fprint(struct expr *e, FILE *out)
+{
+ expr_print(e, expr_print_file_helper, out, E_NONE);
+}
diff --git a/config/expr.h b/config/expr.h
new file mode 100644
index 000000000..3010013b2
--- /dev/null
+++ b/config/expr.h
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#ifndef EXPR_H
+#define EXPR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+struct file {
+ struct file *next;
+ struct file *parent;
+ char *name;
+ int lineno;
+ int flags;
+};
+
+#define FILE_BUSY 0x0001
+#define FILE_SCANNED 0x0002
+#define FILE_PRINTED 0x0004
+
+typedef enum tristate {
+ no, mod, yes
+} tristate;
+
+enum expr_type {
+ E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL, E_RANGE
+};
+
+union expr_data {
+ struct expr *expr;
+ struct symbol *sym;
+};
+
+struct expr {
+ enum expr_type type;
+ union expr_data left, right;
+};
+
+#define E_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2))
+#define E_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2))
+#define E_NOT(dep) (2-(dep))
+
+struct expr_value {
+ struct expr *expr;
+ tristate tri;
+};
+
+struct symbol_value {
+ void *val;
+ tristate tri;
+};
+
+enum symbol_type {
+ S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING, S_OTHER
+};
+
+struct symbol {
+ struct symbol *next;
+ char *name;
+ char *help;
+ enum symbol_type type;
+ struct symbol_value curr, user;
+ tristate visible;
+ int flags;
+ struct property *prop;
+ struct expr *dep, *dep2;
+ struct expr_value rev_dep;
+ struct expr_value rev_dep_inv;
+};
+
+#define for_all_symbols(i, sym) for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
+
+#define SYMBOL_YES 0x0001
+#define SYMBOL_MOD 0x0002
+#define SYMBOL_NO 0x0004
+#define SYMBOL_CONST 0x0007
+#define SYMBOL_CHECK 0x0008
+#define SYMBOL_CHOICE 0x0010
+#define SYMBOL_CHOICEVAL 0x0020
+#define SYMBOL_PRINTED 0x0040
+#define SYMBOL_VALID 0x0080
+#define SYMBOL_OPTIONAL 0x0100
+#define SYMBOL_WRITE 0x0200
+#define SYMBOL_CHANGED 0x0400
+#define SYMBOL_NEW 0x0800
+#define SYMBOL_AUTO 0x1000
+#define SYMBOL_CHECKED 0x2000
+#define SYMBOL_CHECK_DONE 0x4000
+#define SYMBOL_WARNED 0x8000
+
+#define SYMBOL_MAXLENGTH 256
+#define SYMBOL_HASHSIZE 257
+#define SYMBOL_HASHMASK 0xff
+
+enum prop_type {
+ P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU, P_DEFAULT, P_CHOICE, P_SELECT, P_SELECTNOT, P_RANGE
+};
+
+struct property {
+ struct property *next;
+ struct symbol *sym;
+ enum prop_type type;
+ const char *text;
+ struct expr_value visible;
+ struct expr *expr;
+ struct menu *menu;
+ struct file *file;
+ int lineno;
+};
+
+#define for_all_properties(sym, st, tok) \
+ for (st = sym->prop; st; st = st->next) \
+ if (st->type == (tok))
+#define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT)
+#define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE)
+#define for_all_prompts(sym, st) \
+ for (st = sym->prop; st; st = st->next) \
+ if (st->text)
+
+struct menu {
+ struct menu *next;
+ struct menu *parent;
+ struct menu *list;
+ struct symbol *sym;
+ struct property *prompt;
+ struct expr *dep;
+ unsigned int flags;
+ //char *help;
+ struct file *file;
+ int lineno;
+ void *data;
+};
+
+#define MENU_CHANGED 0x0001
+#define MENU_ROOT 0x0002
+
+#ifndef SWIG
+
+extern struct file *file_list;
+extern struct file *current_file;
+struct file *lookup_file(const char *name);
+
+extern struct symbol symbol_yes, symbol_no, symbol_mod;
+extern struct symbol *modules_sym;
+extern int cdebug;
+struct expr *expr_alloc_symbol(struct symbol *sym);
+struct expr *expr_alloc_one(enum expr_type type, struct expr *ce);
+struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2);
+struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2);
+struct expr *expr_alloc_and(struct expr *e1, struct expr *e2);
+struct expr *expr_alloc_or(struct expr *e1, struct expr *e2);
+struct expr *expr_copy(struct expr *org);
+void expr_free(struct expr *e);
+int expr_eq(struct expr *e1, struct expr *e2);
+void expr_eliminate_eq(struct expr **ep1, struct expr **ep2);
+tristate expr_calc_value(struct expr *e);
+struct expr *expr_eliminate_yn(struct expr *e);
+struct expr *expr_trans_bool(struct expr *e);
+struct expr *expr_eliminate_dups(struct expr *e);
+struct expr *expr_transform(struct expr *e);
+int expr_contains_symbol(struct expr *dep, struct symbol *sym);
+bool expr_depends_symbol(struct expr *dep, struct symbol *sym);
+struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
+struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
+void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);
+struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym);
+
+void expr_fprint(struct expr *e, FILE *out);
+
+static inline int expr_is_yes(struct expr *e)
+{
+ return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes);
+}
+
+static inline int expr_is_no(struct expr *e)
+{
+ return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no);
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EXPR_H */
diff --git a/config/glob.c b/config/glob.c
new file mode 100644
index 000000000..b8928b1b6
--- /dev/null
+++ b/config/glob.c
@@ -0,0 +1,848 @@
+/* $OpenBSD: glob.c,v 1.25 2005/08/08 08:05:34 espie Exp $ */
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * glob(3) -- a superset of the one defined in POSIX 1003.2.
+ *
+ * The [!...] convention to negate a range is supported (SysV, Posix, ksh).
+ *
+ * Optional extra services, controlled by flags not defined by POSIX:
+ *
+ * GLOB_QUOTE:
+ * Escaping convention: \ inhibits any special meaning the following
+ * character might have (except \ at end of string is retained).
+ * GLOB_MAGCHAR:
+ * Set in gl_flags if pattern contained a globbing character.
+ * GLOB_NOMAGIC:
+ * Same as GLOB_NOCHECK, but it will only append pattern if it did
+ * not contain any magic characters. [Used in csh style globbing]
+ * GLOB_ALTDIRFUNC:
+ * Use alternately specified directory access functions.
+ * GLOB_TILDE:
+ * expand ~user/foo to the /home/dir/of/user/foo
+ * GLOB_BRACE:
+ * expand {1,2}{a,b} to 1a 1b 2a 2b
+ * gl_matchc:
+ * Number of matches in the current invocation of glob.
+ */
+
+#ifdef __APPLE__
+#include <sys/param.h>
+#include <sys/stat.h>
+
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <glob.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define DOLLAR '$'
+#define DOT '.'
+#define EOS '\0'
+#define LBRACKET '['
+#define NOT '!'
+#define QUESTION '?'
+#define QUOTE '\\'
+#define RANGE '-'
+#define RBRACKET ']'
+#define SEP '/'
+#define STAR '*'
+#define TILDE '~'
+#define UNDERSCORE '_'
+#define LBRACE '{'
+#define RBRACE '}'
+#define SLASH '/'
+#define COMMA ','
+
+#ifndef DEBUG
+
+#define M_QUOTE 0x8000
+#define M_PROTECT 0x4000
+#define M_MASK 0xffff
+#define M_ASCII 0x00ff
+
+typedef u_short Char;
+
+#else
+
+#define M_QUOTE 0x80
+#define M_PROTECT 0x40
+#define M_MASK 0xff
+#define M_ASCII 0x7f
+
+typedef char Char;
+
+#endif
+
+
+#define CHAR(c) ((Char)((c)&M_ASCII))
+#define META(c) ((Char)((c)|M_QUOTE))
+#define M_ALL META('*')
+#define M_END META(']')
+#define M_NOT META('!')
+#define M_ONE META('?')
+#define M_RNG META('-')
+#define M_SET META('[')
+#define ismeta(c) (((c)&M_QUOTE) != 0)
+
+
+static int compare(const void *, const void *);
+static int g_Ctoc(const Char *, char *, u_int);
+static int g_lstat(Char *, struct stat *, glob_t *);
+static DIR *g_opendir(Char *, glob_t *);
+static const Char *g_strchr(const Char *, int);
+static int g_stat(Char *, struct stat *, glob_t *);
+static int glob0(const Char *, glob_t *);
+static int glob1(Char *, Char *, glob_t *, size_t *);
+static int glob2(Char *, Char *, Char *, Char *, Char *, Char *,
+ glob_t *, size_t *);
+static int glob3(Char *, Char *, Char *, Char *, Char *, Char *,
+ Char *, Char *, glob_t *, size_t *);
+static int globextend(const Char *, glob_t *, size_t *);
+static const Char *
+ globtilde(const Char *, Char *, size_t, glob_t *);
+static int globexp1(const Char *, glob_t *);
+static int globexp2(const Char *, const Char *, glob_t *, int *);
+static int match(Char *, Char *, Char *);
+#ifdef DEBUG
+static void qprintf(const char *, Char *);
+#endif
+
+int
+glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
+ glob_t *pglob)
+{
+ const u_char *patnext;
+ int c;
+ Char *bufnext, *bufend, patbuf[MAXPATHLEN];
+
+ patnext = (const u_char *) pattern;
+ if (!(flags & GLOB_APPEND)) {
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ if (!(flags & GLOB_DOOFFS))
+ pglob->gl_offs = 0;
+ }
+ pglob->gl_flags = flags & ~GLOB_MAGCHAR;
+ pglob->gl_errfunc = errfunc;
+ pglob->gl_matchc = 0;
+
+ bufnext = patbuf;
+ bufend = bufnext + MAXPATHLEN - 1;
+ if (flags & GLOB_NOESCAPE)
+ while (bufnext < bufend && (c = *patnext++) != EOS)
+ *bufnext++ = c;
+ else {
+ /* Protect the quoted characters. */
+ while (bufnext < bufend && (c = *patnext++) != EOS)
+ if (c == QUOTE) {
+ if ((c = *patnext++) == EOS) {
+ c = QUOTE;
+ --patnext;
+ }
+ *bufnext++ = c | M_PROTECT;
+ } else
+ *bufnext++ = c;
+ }
+ *bufnext = EOS;
+
+ if (flags & GLOB_BRACE)
+ return globexp1(patbuf, pglob);
+ else
+ return glob0(patbuf, pglob);
+}
+
+/*
+ * Expand recursively a glob {} pattern. When there is no more expansion
+ * invoke the standard globbing routine to glob the rest of the magic
+ * characters
+ */
+static int
+globexp1(const Char *pattern, glob_t *pglob)
+{
+ const Char* ptr = pattern;
+ int rv;
+
+ /* Protect a single {}, for find(1), like csh */
+ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
+ return glob0(pattern, pglob);
+
+ while ((ptr = g_strchr(ptr, LBRACE)) != NULL)
+ if (!globexp2(ptr, pattern, pglob, &rv))
+ return rv;
+
+ return glob0(pattern, pglob);
+}
+
+
+/*
+ * Recursive brace globbing helper. Tries to expand a single brace.
+ * If it succeeds then it invokes globexp1 with the new pattern.
+ * If it fails then it tries to glob the rest of the pattern and returns.
+ */
+static int
+globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv)
+{
+ int i;
+ Char *lm, *ls;
+ const Char *pe, *pm, *pl;
+ Char patbuf[MAXPATHLEN];
+
+ /* copy part up to the brace */
+ for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
+ ;
+ *lm = EOS;
+ ls = lm;
+
+ /* Find the balanced brace */
+ for (i = 0, pe = ++ptr; *pe; pe++)
+ if (*pe == LBRACKET) {
+ /* Ignore everything between [] */
+ for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++)
+ ;
+ if (*pe == EOS) {
+ /*
+ * We could not find a matching RBRACKET.
+ * Ignore and just look for RBRACE
+ */
+ pe = pm;
+ }
+ } else if (*pe == LBRACE)
+ i++;
+ else if (*pe == RBRACE) {
+ if (i == 0)
+ break;
+ i--;
+ }
+
+ /* Non matching braces; just glob the pattern */
+ if (i != 0 || *pe == EOS) {
+ *rv = glob0(patbuf, pglob);
+ return 0;
+ }
+
+ for (i = 0, pl = pm = ptr; pm <= pe; pm++) {
+ switch (*pm) {
+ case LBRACKET:
+ /* Ignore everything between [] */
+ for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++)
+ ;
+ if (*pm == EOS) {
+ /*
+ * We could not find a matching RBRACKET.
+ * Ignore and just look for RBRACE
+ */
+ pm = pl;
+ }
+ break;
+
+ case LBRACE:
+ i++;
+ break;
+
+ case RBRACE:
+ if (i) {
+ i--;
+ break;
+ }
+ /* FALLTHROUGH */
+ case COMMA:
+ if (i && *pm == COMMA)
+ break;
+ else {
+ /* Append the current string */
+ for (lm = ls; (pl < pm); *lm++ = *pl++)
+ ;
+
+ /*
+ * Append the rest of the pattern after the
+ * closing brace
+ */
+ for (pl = pe + 1; (*lm++ = *pl++) != EOS; )
+ ;
+
+ /* Expand the current pattern */
+#ifdef DEBUG
+ qprintf("globexp2:", patbuf);
+#endif
+ *rv = globexp1(patbuf, pglob);
+
+ /* move after the comma, to the next string */
+ pl = pm + 1;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ *rv = 0;
+ return 0;
+}
+
+
+
+/*
+ * expand tilde from the passwd file.
+ */
+static const Char *
+globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
+{
+ struct passwd *pwd;
+ char *h;
+ const Char *p;
+ Char *b, *eb;
+
+ if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
+ return pattern;
+
+ /* Copy up to the end of the string or / */
+ eb = &patbuf[patbuf_len - 1];
+ for (p = pattern + 1, h = (char *) patbuf;
+ h < (char *)eb && *p && *p != SLASH; *h++ = *p++)
+ ;
+
+ *h = EOS;
+
+#if 0
+ if (h == (char *)eb)
+ return what;
+#endif
+
+ if (((char *) patbuf)[0] == EOS) {
+ /*
+ * handle a plain ~ or ~/ by expanding $HOME
+ * first and then trying the password file
+ */
+ if (issetugid() != 0 || (h = getenv("HOME")) == NULL) {
+ if ((pwd = getpwuid(getuid())) == NULL)
+ return pattern;
+ else
+ h = pwd->pw_dir;
+ }
+ } else {
+ /*
+ * Expand a ~user
+ */
+ if ((pwd = getpwnam((char*) patbuf)) == NULL)
+ return pattern;
+ else
+ h = pwd->pw_dir;
+ }
+
+ /* Copy the home directory */
+ for (b = patbuf; b < eb && *h; *b++ = *h++)
+ ;
+
+ /* Append the rest of the pattern */
+ while (b < eb && (*b++ = *p++) != EOS)
+ ;
+ *b = EOS;
+
+ return patbuf;
+}
+
+
+/*
+ * The main glob() routine: compiles the pattern (optionally processing
+ * quotes), calls glob1() to do the real pattern matching, and finally
+ * sorts the list (unless unsorted operation is requested). Returns 0
+ * if things went well, nonzero if errors occurred. It is not an error
+ * to find no matches.
+ */
+static int
+glob0(const Char *pattern, glob_t *pglob)
+{
+ const Char *qpatnext;
+ int c, err, oldpathc;
+ Char *bufnext, patbuf[MAXPATHLEN];
+ size_t limit = 0;
+
+ qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob);
+ oldpathc = pglob->gl_pathc;
+ bufnext = patbuf;
+
+ /* We don't need to check for buffer overflow any more. */
+ while ((c = *qpatnext++) != EOS) {
+ switch (c) {
+ case LBRACKET:
+ c = *qpatnext;
+ if (c == NOT)
+ ++qpatnext;
+ if (*qpatnext == EOS ||
+ g_strchr(qpatnext+1, RBRACKET) == NULL) {
+ *bufnext++ = LBRACKET;
+ if (c == NOT)
+ --qpatnext;
+ break;
+ }
+ *bufnext++ = M_SET;
+ if (c == NOT)
+ *bufnext++ = M_NOT;
+ c = *qpatnext++;
+ do {
+ *bufnext++ = CHAR(c);
+ if (*qpatnext == RANGE &&
+ (c = qpatnext[1]) != RBRACKET) {
+ *bufnext++ = M_RNG;
+ *bufnext++ = CHAR(c);
+ qpatnext += 2;
+ }
+ } while ((c = *qpatnext++) != RBRACKET);
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ *bufnext++ = M_END;
+ break;
+ case QUESTION:
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ *bufnext++ = M_ONE;
+ break;
+ case STAR:
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ /* collapse adjacent stars to one,
+ * to avoid exponential behavior
+ */
+ if (bufnext == patbuf || bufnext[-1] != M_ALL)
+ *bufnext++ = M_ALL;
+ break;
+ default:
+ *bufnext++ = CHAR(c);
+ break;
+ }
+ }
+ *bufnext = EOS;
+#ifdef DEBUG
+ qprintf("glob0:", patbuf);
+#endif
+
+ if ((err = glob1(patbuf, patbuf+MAXPATHLEN-1, pglob, &limit)) != 0)
+ return(err);
+
+ /*
+ * If there was no match we are going to append the pattern
+ * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
+ * and the pattern did not contain any magic characters
+ * GLOB_NOMAGIC is there just for compatibility with csh.
+ */
+ if (pglob->gl_pathc == oldpathc) {
+ if ((pglob->gl_flags & GLOB_NOCHECK) ||
+ ((pglob->gl_flags & GLOB_NOMAGIC) &&
+ !(pglob->gl_flags & GLOB_MAGCHAR)))
+ return(globextend(pattern, pglob, &limit));
+ else
+ return(GLOB_NOMATCH);
+ }
+ if (!(pglob->gl_flags & GLOB_NOSORT))
+ qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
+ pglob->gl_pathc - oldpathc, sizeof(char *), compare);
+ return(0);
+}
+
+static int
+compare(const void *p, const void *q)
+{
+ return(strcmp(*(char *const *)p, *(char *const *)q));
+}
+
+static int
+glob1(Char *pattern, Char *pattern_last, glob_t *pglob, size_t *limitp)
+{
+ Char pathbuf[MAXPATHLEN];
+
+ /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */
+ if (*pattern == EOS)
+ return(0);
+ return(glob2(pathbuf, pathbuf+MAXPATHLEN-1,
+ pathbuf, pathbuf+MAXPATHLEN-1,
+ pattern, pattern_last, pglob, limitp));
+}
+
+/*
+ * The functions glob2 and glob3 are mutually recursive; there is one level
+ * of recursion for each segment in the pattern that contains one or more
+ * meta characters.
+ */
+static int
+glob2(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend_last,
+ Char *pattern, Char *pattern_last, glob_t *pglob, size_t *limitp)
+{
+ struct stat sb;
+ Char *p, *q;
+ int anymeta;
+
+ /*
+ * Loop over pattern segments until end of pattern or until
+ * segment with meta character found.
+ */
+ for (anymeta = 0;;) {
+ if (*pattern == EOS) { /* End of pattern? */
+ *pathend = EOS;
+ if (g_lstat(pathbuf, &sb, pglob))
+ return(0);
+
+ if (((pglob->gl_flags & GLOB_MARK) &&
+ pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) ||
+ (S_ISLNK(sb.st_mode) &&
+ (g_stat(pathbuf, &sb, pglob) == 0) &&
+ S_ISDIR(sb.st_mode)))) {
+ if (pathend+1 > pathend_last)
+ return (1);
+ *pathend++ = SEP;
+ *pathend = EOS;
+ }
+ ++pglob->gl_matchc;
+ return(globextend(pathbuf, pglob, limitp));
+ }
+
+ /* Find end of next segment, copy tentatively to pathend. */
+ q = pathend;
+ p = pattern;
+ while (*p != EOS && *p != SEP) {
+ if (ismeta(*p))
+ anymeta = 1;
+ if (q+1 > pathend_last)
+ return (1);
+ *q++ = *p++;
+ }
+
+ if (!anymeta) { /* No expansion, do next segment. */
+ pathend = q;
+ pattern = p;
+ while (*pattern == SEP) {
+ if (pathend+1 > pathend_last)
+ return (1);
+ *pathend++ = *pattern++;
+ }
+ } else
+ /* Need expansion, recurse. */
+ return(glob3(pathbuf, pathbuf_last, pathend,
+ pathend_last, pattern, pattern_last,
+ p, pattern_last, pglob, limitp));
+ }
+ /* NOTREACHED */
+}
+
+static int
+glob3(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend_last,
+ Char *pattern, Char *pattern_last __attribute__((unused)), Char *restpattern,
+ Char *restpattern_last, glob_t *pglob, size_t *limitp)
+{
+ struct dirent *dp;
+ DIR *dirp;
+ int err;
+ char buf[MAXPATHLEN];
+
+ /*
+ * The readdirfunc declaration can't be prototyped, because it is
+ * assigned, below, to two functions which are prototyped in glob.h
+ * and dirent.h as taking pointers to differently typed opaque
+ * structures.
+ */
+ struct dirent *(*readdirfunc)(void *);
+
+ if (pathend > pathend_last)
+ return (1);
+ *pathend = EOS;
+ errno = 0;
+
+ if ((dirp = g_opendir(pathbuf, pglob)) == NULL) {
+ /* TODO: don't call for ENOENT or ENOTDIR? */
+ if (pglob->gl_errfunc) {
+ if (g_Ctoc(pathbuf, buf, sizeof(buf)))
+ return(GLOB_ABORTED);
+ if (pglob->gl_errfunc(buf, errno) ||
+ pglob->gl_flags & GLOB_ERR)
+ return(GLOB_ABORTED);
+ }
+ return(0);
+ }
+
+ err = 0;
+
+ /* Search directory for matching names. */
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ readdirfunc = pglob->gl_readdir;
+ else
+ readdirfunc = (struct dirent *(*)(void *))readdir;
+ while ((dp = (*readdirfunc)(dirp))) {
+ u_char *sc;
+ Char *dc;
+
+ /* Initial DOT must be matched literally. */
+ if (dp->d_name[0] == DOT && *pattern != DOT)
+ continue;
+ dc = pathend;
+ sc = (u_char *) dp->d_name;
+ while (dc < pathend_last && (*dc++ = *sc++) != EOS)
+ ;
+ if (dc >= pathend_last) {
+ *dc = EOS;
+ err = 1;
+ break;
+ }
+
+ if (!match(pathend, pattern, restpattern)) {
+ *pathend = EOS;
+ continue;
+ }
+ err = glob2(pathbuf, pathbuf_last, --dc, pathend_last,
+ restpattern, restpattern_last, pglob, limitp);
+ if (err)
+ break;
+ }
+
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ (*pglob->gl_closedir)(dirp);
+ else
+ closedir(dirp);
+ return(err);
+}
+
+
+/*
+ * Extend the gl_pathv member of a glob_t structure to accommodate a new item,
+ * add the new item, and update gl_pathc.
+ *
+ * This assumes the BSD realloc, which only copies the block when its size
+ * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic
+ * behavior.
+ *
+ * Return 0 if new item added, error code if memory couldn't be allocated.
+ *
+ * Invariant of the glob_t structure:
+ * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and
+ * gl_pathv points to (gl_offs + gl_pathc + 1) items.
+ */
+static int
+globextend(const Char *path, glob_t *pglob, size_t *limitp)
+{
+ char **pathv;
+ int i;
+ u_int newsize, len;
+ char *copy;
+ const Char *p;
+
+ newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
+ pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) :
+ malloc(newsize);
+ if (pathv == NULL) {
+ if (pglob->gl_pathv) {
+ free(pglob->gl_pathv);
+ pglob->gl_pathv = NULL;
+ }
+ return(GLOB_NOSPACE);
+ }
+
+ if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
+ /* first time around -- clear initial gl_offs items */
+ pathv += pglob->gl_offs;
+ for (i = pglob->gl_offs; --i >= 0; )
+ *--pathv = NULL;
+ }
+ pglob->gl_pathv = pathv;
+
+ for (p = path; *p++;)
+ ;
+ len = (size_t)(p - path);
+ *limitp += len;
+ if ((copy = malloc(len)) != NULL) {
+ if (g_Ctoc(path, copy, len)) {
+ free(copy);
+ return(GLOB_NOSPACE);
+ }
+ pathv[pglob->gl_offs + pglob->gl_pathc++] = copy;
+ }
+ pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
+
+ if ((pglob->gl_flags & GLOB_LIMIT) &&
+ newsize + *limitp >= ARG_MAX) {
+ errno = 0;
+ return(GLOB_NOSPACE);
+ }
+
+ return(copy == NULL ? GLOB_NOSPACE : 0);
+}
+
+
+/*
+ * pattern matching function for filenames. Each occurrence of the *
+ * pattern causes a recursion level.
+ */
+static int
+match(Char *name, Char *pat, Char *patend)
+{
+ int ok, negate_range;
+ Char c, k;
+
+ while (pat < patend) {
+ c = *pat++;
+ switch (c & M_MASK) {
+ case M_ALL:
+ if (pat == patend)
+ return(1);
+ do {
+ if (match(name, pat, patend))
+ return(1);
+ } while (*name++ != EOS);
+ return(0);
+ case M_ONE:
+ if (*name++ == EOS)
+ return(0);
+ break;
+ case M_SET:
+ ok = 0;
+ if ((k = *name++) == EOS)
+ return(0);
+ if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS)
+ ++pat;
+ while (((c = *pat++) & M_MASK) != M_END)
+ if ((*pat & M_MASK) == M_RNG) {
+ if (c <= k && k <= pat[1])
+ ok = 1;
+ pat += 2;
+ } else if (c == k)
+ ok = 1;
+ if (ok == negate_range)
+ return(0);
+ break;
+ default:
+ if (*name++ != c)
+ return(0);
+ break;
+ }
+ }
+ return(*name == EOS);
+}
+
+/* Free allocated data belonging to a glob_t structure. */
+void
+globfree(glob_t *pglob)
+{
+ int i;
+ char **pp;
+
+ if (pglob->gl_pathv != NULL) {
+ pp = pglob->gl_pathv + pglob->gl_offs;
+ for (i = pglob->gl_pathc; i--; ++pp)
+ if (*pp)
+ free(*pp);
+ free(pglob->gl_pathv);
+ pglob->gl_pathv = NULL;
+ }
+}
+
+static DIR *
+g_opendir(Char *str, glob_t *pglob)
+{
+ char buf[MAXPATHLEN];
+
+ if (!*str)
+ strlcpy(buf, ".", sizeof buf);
+ else {
+ if (g_Ctoc(str, buf, sizeof(buf)))
+ return(NULL);
+ }
+
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_opendir)(buf));
+
+ return(opendir(buf));
+}
+
+static int
+g_lstat(Char *fn, struct stat *sb, glob_t *pglob)
+{
+ char buf[MAXPATHLEN];
+
+ if (g_Ctoc(fn, buf, sizeof(buf)))
+ return(-1);
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_lstat)(buf, sb));
+ return(lstat(buf, sb));
+}
+
+static int
+g_stat(Char *fn, struct stat *sb, glob_t *pglob)
+{
+ char buf[MAXPATHLEN];
+
+ if (g_Ctoc(fn, buf, sizeof(buf)))
+ return(-1);
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_stat)(buf, sb));
+ return(stat(buf, sb));
+}
+
+static const Char *
+g_strchr(const Char *str, int ch)
+{
+ do {
+ if (*str == ch)
+ return (str);
+ } while (*str++);
+ return (NULL);
+}
+
+static int
+g_Ctoc(const Char *str, char *buf, u_int len)
+{
+
+ while (len--) {
+ if ((*buf++ = *str++) == EOS)
+ return (0);
+ }
+ return (1);
+}
+
+#ifdef DEBUG
+static void
+qprintf(const char *str, Char *s)
+{
+ Char *p;
+
+ (void)printf("%s:\n", str);
+ for (p = s; *p; p++)
+ (void)printf("%c", CHAR(*p));
+ (void)printf("\n");
+ for (p = s; *p; p++)
+ (void)printf("%c", *p & M_PROTECT ? '"' : ' ');
+ (void)printf("\n");
+ for (p = s; *p; p++)
+ (void)printf("%c", ismeta(*p) ? '_' : ' ');
+ (void)printf("\n");
+}
+#endif
+#endif
diff --git a/config/glob.h b/config/glob.h
new file mode 100644
index 000000000..15ade2a04
--- /dev/null
+++ b/config/glob.h
@@ -0,0 +1,100 @@
+/* $OpenBSD: glob.h,v 1.9 2004/10/07 16:56:11 millert Exp $ */
+/* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */
+
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)glob.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef __APPLE__
+#include_next <glob.h>
+#else
+#ifndef _GLOB_H_
+#define _GLOB_H_
+
+#include <sys/cdefs.h>
+
+struct stat;
+typedef struct {
+ int gl_pathc; /* Count of total paths so far. */
+ int gl_matchc; /* Count of paths matching pattern. */
+ int gl_offs; /* Reserved at beginning of gl_pathv. */
+ int gl_flags; /* Copy of flags parameter to glob. */
+ char **gl_pathv; /* List of paths matching pattern. */
+ /* Copy of errfunc parameter to glob. */
+ int (*gl_errfunc)(const char *, int);
+
+ /*
+ * Alternate filesystem access methods for glob; replacement
+ * versions of closedir(3), readdir(3), opendir(3), stat(2)
+ * and lstat(2).
+ */
+ void (*gl_closedir)(void *);
+ struct dirent *(*gl_readdir)(void *);
+ void *(*gl_opendir)(const char *);
+ int (*gl_lstat)(const char *, struct stat *);
+ int (*gl_stat)(const char *, struct stat *);
+} glob_t;
+
+/* Flags */
+#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
+#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
+#define GLOB_ERR 0x0004 /* Return on error. */
+#define GLOB_MARK 0x0008 /* Append / to matching directories. */
+#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
+#define GLOB_NOSORT 0x0020 /* Don't sort. */
+#define GLOB_NOESCAPE 0x1000 /* Disable backslash escaping. */
+
+#ifndef _POSIX_SOURCE
+#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
+#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
+#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
+#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
+#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
+#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
+#define GLOB_LIMIT 0x2000 /* Limit pattern match output to ARG_MAX */
+#endif
+
+/* Error values returned by glob(3) */
+#define GLOB_NOSPACE (-1) /* Malloc call failed. */
+#define GLOB_ABORTED (-2) /* Unignored error. */
+#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK not set. */
+#define GLOB_NOSYS (-4) /* Function not supported. */
+#define GLOB_ABEND GLOB_ABORTED
+
+__BEGIN_DECLS
+int glob(const char *, int, int (*)(const char *, int), glob_t *);
+void globfree(glob_t *);
+__END_DECLS
+
+#endif /* !_GLOB_H_ */
+#endif
diff --git a/config/inputbox.c b/config/inputbox.c
new file mode 100644
index 000000000..8c4c1ce99
--- /dev/null
+++ b/config/inputbox.c
@@ -0,0 +1,240 @@
+/*
+ * inputbox.c -- implements the input box
+ *
+ * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dialog.h"
+
+unsigned char dialog_input_result[MAX_LEN + 1];
+
+/*
+ * Print the termination buttons
+ */
+static void
+print_buttons(WINDOW *dialog, int height, int width, int selected)
+{
+ int x = width / 2 - 11;
+ int y = height - 2;
+
+ print_button (dialog, " Ok ", y, x, selected==0);
+ print_button (dialog, " Help ", y, x + 14, selected==1);
+
+ wmove(dialog, y, x+1+14*selected);
+ wrefresh(dialog);
+}
+
+/*
+ * Display a dialog box for inputing a string
+ */
+int
+dialog_inputbox (const char *title, const char *prompt, int height, int width,
+ const char *init)
+{
+ int i, x, y, box_y, box_x, box_width;
+ int input_x = 0, scroll = 0, key = 0, button = -1;
+ char *instr = (char*)dialog_input_result;
+ WINDOW *dialog;
+
+ /* center dialog box on screen */
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+
+ draw_shadow (stdscr, y, x, height, width);
+
+ dialog = newwin (height, width, y, x);
+ keypad (dialog, TRUE);
+
+ draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
+ wattrset (dialog, border_attr);
+ mvwaddch (dialog, height-3, 0, ACS_LTEE);
+ for (i = 0; i < width - 2; i++)
+ waddch (dialog, ACS_HLINE);
+ wattrset (dialog, dialog_attr);
+ waddch (dialog, ACS_RTEE);
+
+ if (title != NULL && strlen(title) >= width-2 ) {
+ /* truncate long title -- mec */
+ char * title2 = malloc(width-2+1);
+ memcpy( title2, title, width-2 );
+ title2[width-2] = '\0';
+ title = title2;
+ }
+
+ if (title != NULL) {
+ wattrset (dialog, title_attr);
+ mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
+ waddstr (dialog, (char *)title);
+ waddch (dialog, ' ');
+ }
+
+ wattrset (dialog, dialog_attr);
+ print_autowrap (dialog, prompt, width - 2, 1, 3);
+
+ /* Draw the input field box */
+ box_width = width - 6;
+ getyx (dialog, y, x);
+ box_y = y + 2;
+ box_x = (width - box_width) / 2;
+ draw_box (dialog, y + 1, box_x - 1, 3, box_width + 2,
+ border_attr, dialog_attr);
+
+ print_buttons(dialog, height, width, 0);
+
+ /* Set up the initial value */
+ wmove (dialog, box_y, box_x);
+ wattrset (dialog, inputbox_attr);
+
+ if (!init)
+ instr[0] = '\0';
+ else
+ strcpy (instr, init);
+
+ input_x = strlen (instr);
+
+ if (input_x >= box_width) {
+ scroll = input_x - box_width + 1;
+ input_x = box_width - 1;
+ for (i = 0; i < box_width - 1; i++)
+ waddch (dialog, instr[scroll + i]);
+ } else
+ waddstr (dialog, instr);
+
+ wmove (dialog, box_y, box_x + input_x);
+
+ wrefresh (dialog);
+
+ while (key != ESC) {
+ key = wgetch (dialog);
+
+ if (button == -1) { /* Input box selected */
+ switch (key) {
+ case TAB:
+ case KEY_UP:
+ case KEY_DOWN:
+ break;
+ case KEY_LEFT:
+ continue;
+ case KEY_RIGHT:
+ continue;
+ case KEY_BACKSPACE:
+ case 127:
+ if (input_x || scroll) {
+ wattrset (dialog, inputbox_attr);
+ if (!input_x) {
+ scroll = scroll < box_width - 1 ?
+ 0 : scroll - (box_width - 1);
+ wmove (dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++)
+ waddch (dialog, instr[scroll + input_x + i] ?
+ instr[scroll + input_x + i] : ' ');
+ input_x = strlen (instr) - scroll;
+ } else
+ input_x--;
+ instr[scroll + input_x] = '\0';
+ mvwaddch (dialog, box_y, input_x + box_x, ' ');
+ wmove (dialog, box_y, input_x + box_x);
+ wrefresh (dialog);
+ }
+ continue;
+ default:
+ if (key < 0x100 && isprint (key)) {
+ if (scroll + input_x < MAX_LEN) {
+ wattrset (dialog, inputbox_attr);
+ instr[scroll + input_x] = key;
+ instr[scroll + input_x + 1] = '\0';
+ if (input_x == box_width - 1) {
+ scroll++;
+ wmove (dialog, box_y, box_x);
+ for (i = 0; i < box_width - 1; i++)
+ waddch (dialog, instr[scroll + i]);
+ } else {
+ wmove (dialog, box_y, input_x++ + box_x);
+ waddch (dialog, key);
+ }
+ wrefresh (dialog);
+ } else
+ flash (); /* Alarm user about overflow */
+ continue;
+ }
+ }
+ }
+ switch (key) {
+ case 'O':
+ case 'o':
+ delwin (dialog);
+ return 0;
+ case 'H':
+ case 'h':
+ delwin (dialog);
+ return 1;
+ case KEY_UP:
+ case KEY_LEFT:
+ switch (button) {
+ case -1:
+ button = 1; /* Indicates "Cancel" button is selected */
+ print_buttons(dialog, height, width, 1);
+ break;
+ case 0:
+ button = -1; /* Indicates input box is selected */
+ print_buttons(dialog, height, width, 0);
+ wmove (dialog, box_y, box_x + input_x);
+ wrefresh (dialog);
+ break;
+ case 1:
+ button = 0; /* Indicates "OK" button is selected */
+ print_buttons(dialog, height, width, 0);
+ break;
+ }
+ break;
+ case TAB:
+ case KEY_DOWN:
+ case KEY_RIGHT:
+ switch (button) {
+ case -1:
+ button = 0; /* Indicates "OK" button is selected */
+ print_buttons(dialog, height, width, 0);
+ break;
+ case 0:
+ button = 1; /* Indicates "Cancel" button is selected */
+ print_buttons(dialog, height, width, 1);
+ break;
+ case 1:
+ button = -1; /* Indicates input box is selected */
+ print_buttons(dialog, height, width, 0);
+ wmove (dialog, box_y, box_x + input_x);
+ wrefresh (dialog);
+ break;
+ }
+ break;
+ case ' ':
+ case '\n':
+ delwin (dialog);
+ return (button == -1 ? 0 : button);
+ case 'X':
+ case 'x':
+ key = ESC;
+ case ESC:
+ break;
+ }
+ }
+
+ delwin (dialog);
+ return -1; /* ESC pressed */
+}
diff --git a/config/lex.backup b/config/lex.backup
new file mode 100644
index 000000000..afb1b53c7
--- /dev/null
+++ b/config/lex.backup
@@ -0,0 +1 @@
+No backing up.
diff --git a/config/lkc.h b/config/lkc.h
new file mode 100644
index 000000000..dd040f7a8
--- /dev/null
+++ b/config/lkc.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#ifndef LKC_H
+#define LKC_H
+
+#include "expr.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef LKC_DIRECT_LINK
+#define P(name,type,arg) extern type name arg
+#else
+#include "lkc_defs.h"
+#define P(name,type,arg) extern type (*name ## _p) arg
+#endif
+#include "lkc_proto.h"
+#undef P
+
+#define SRCTREE "srctree"
+
+int zconfparse(void);
+void zconfdump(FILE *out);
+
+extern int zconfdebug;
+void zconf_starthelp(void);
+FILE *zconf_fopen(const char *name);
+void zconf_initscan(const char *name);
+void zconf_nextfile(const char *name);
+int zconf_lineno(void);
+char *zconf_curname(void);
+
+/* confdata.c */
+extern const char conf_def_filename[];
+extern char conf_filename[];
+
+char *conf_get_default_confname(void);
+
+/* kconfig_load.c */
+void kconfig_load(void);
+
+/* menu.c */
+void menu_init(void);
+void menu_add_menu(void);
+void menu_end_menu(void);
+void menu_add_entry(struct symbol *sym);
+void menu_end_entry(void);
+void menu_add_dep(struct expr *dep);
+struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);
+void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
+void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
+void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
+void menu_finalize(struct menu *parent);
+void menu_set_type(int type);
+struct file *file_lookup(const char *name);
+int file_write_dep(const char *name);
+
+extern struct menu *current_entry;
+extern struct menu *current_menu;
+
+/* symbol.c */
+void sym_init(void);
+void sym_clear_all_valid(void);
+void sym_set_changed(struct symbol *sym);
+struct symbol *sym_check_deps(struct symbol *sym);
+struct property *prop_alloc(enum prop_type type, struct symbol *sym);
+struct symbol *prop_get_symbol(struct property *prop);
+
+static inline tristate sym_get_tristate_value(struct symbol *sym)
+{
+ return sym->curr.tri;
+}
+
+
+static inline struct symbol *sym_get_choice_value(struct symbol *sym)
+{
+ return (struct symbol *)sym->curr.val;
+}
+
+static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
+{
+ return sym_set_tristate_value(chval, yes);
+}
+
+static inline bool sym_is_choice(struct symbol *sym)
+{
+ return sym->flags & SYMBOL_CHOICE ? true : false;
+}
+
+static inline bool sym_is_choice_value(struct symbol *sym)
+{
+ return sym->flags & SYMBOL_CHOICEVAL ? true : false;
+}
+
+static inline bool sym_is_optional(struct symbol *sym)
+{
+ return sym->flags & SYMBOL_OPTIONAL ? true : false;
+}
+
+static inline bool sym_has_value(struct symbol *sym)
+{
+ return sym->flags & SYMBOL_NEW ? false : true;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LKC_H */
diff --git a/config/lkc_proto.h b/config/lkc_proto.h
new file mode 100644
index 000000000..97c79178e
--- /dev/null
+++ b/config/lkc_proto.h
@@ -0,0 +1,39 @@
+
+/* confdata.c */
+P(conf_parse,void,(const char *name));
+P(conf_read,int,(const char *name));
+P(conf_write,int,(const char *name));
+
+/* menu.c */
+P(rootmenu,struct menu,);
+
+P(menu_is_visible,bool,(struct menu *menu));
+P(menu_get_prompt,const char *,(struct menu *menu));
+P(menu_get_root_menu,struct menu *,(struct menu *menu));
+P(menu_get_parent_menu,struct menu *,(struct menu *menu));
+
+/* symbol.c */
+P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
+P(sym_change_count,int,);
+
+P(sym_lookup,struct symbol *,(const char *name, int isconst));
+P(sym_find,struct symbol *,(const char *name));
+P(sym_type_name,const char *,(enum symbol_type type));
+P(sym_calc_value,void,(struct symbol *sym));
+P(sym_get_type,enum symbol_type,(struct symbol *sym));
+P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri));
+P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri));
+P(sym_toggle_tristate_value,tristate,(struct symbol *sym));
+P(sym_string_valid,bool,(struct symbol *sym, const char *newval));
+P(sym_string_within_range,bool,(struct symbol *sym, const char *str));
+P(sym_set_string_value,bool,(struct symbol *sym, const char *newval));
+P(sym_is_changable,bool,(struct symbol *sym));
+P(sym_get_choice_prop,struct property *,(struct symbol *sym));
+P(sym_get_default_prop,struct property *,(struct symbol *sym));
+P(sym_get_string_value,const char *,(struct symbol *sym));
+
+P(prop_get_type_name,const char *,(enum prop_type type));
+
+/* expr.c */
+P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2));
+P(expr_print,void,(struct expr *e, void (*fn)(void *, const char *), void *data, int prevtoken));
diff --git a/config/mconf.c b/config/mconf.c
new file mode 100644
index 000000000..878554245
--- /dev/null
+++ b/config/mconf.c
@@ -0,0 +1,717 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ *
+ * Introduced single menu mode (show all sub-menus in one large tree).
+ * 2002-11-06 Petr Baudis <pasky@ucw.cz>
+ *
+ * Directly use liblxdialog library routines.
+ * 2002-11-14 Petr Baudis <pasky@ucw.cz>
+ */
+
+#include <sys/ioctl.h>
+#include <sys/wait.h>
+#include <sys/termios.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include "dialog.h"
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+static char menu_backtitle[128];
+static const char menu_instructions[] =
+ "Arrow keys navigate the menu. "
+ "<Enter> selects submenus --->. "
+ "Highlighted letters are hotkeys. "
+ "Pressing <Y> selectes a feature, while <N> will exclude a feature. "
+ "Press <Esc><Esc> to exit, <?> for Help. "
+ "Legend: [*] feature is selected [ ] feature is excluded",
+radiolist_instructions[] =
+ "Use the arrow keys to navigate this window or "
+ "press the hotkey of the item you wish to select "
+ "followed by the <SPACE BAR>. "
+ "Press <?> for additional information about this option.",
+inputbox_instructions_int[] =
+ "Please enter a decimal value. "
+ "Fractions will not be accepted. "
+ "Use the <TAB> key to move from the input field to the buttons below it.",
+inputbox_instructions_hex[] =
+ "Please enter a hexadecimal value. "
+ "Use the <TAB> key to move from the input field to the buttons below it.",
+inputbox_instructions_string[] =
+ "Please enter a string value. "
+ "Use the <TAB> key to move from the input field to the buttons below it.",
+setmod_text[] =
+ "This feature depends on another which has been configured as a module.\n"
+ "As a result, this feature will be built as a module.",
+nohelp_text[] =
+ "There is no help available for this option.\n",
+load_config_text[] =
+ "Enter the name of the configuration file you wish to load. "
+ "Accept the name shown to restore the configuration you "
+ "last retrieved. Leave blank to abort.",
+load_config_help[] =
+ "\n"
+ "For various reasons, one may wish to keep several different OpenADK\n"
+ "configurations available on a single machine.\n"
+ "\n"
+ "If you have saved a previous configuration in a file other than the\n"
+ "OpenADK's default, entering the name of the file here will allow you\n"
+ "to modify that configuration.\n"
+ "\n"
+ "If you are uncertain, then you have probably never used alternate\n"
+ "configuration files. You should therefor leave this blank to abort.\n",
+save_config_text[] =
+ "Enter a filename to which this configuration should be saved "
+ "as an alternate. Leave blank to abort.",
+save_config_help[] =
+ "\n"
+ "For various reasons, one may wish to keep different OpenADK\n"
+ "configurations available on a single machine.\n"
+ "\n"
+ "Entering a file name here will allow you to later retrieve, modify\n"
+ "and use the current configuration as an alternate to whatever\n"
+ "configuration options you have selected at that time.\n"
+ "\n"
+ "If you are uncertain what all this means then you should probably\n"
+ "leave this blank.\n",
+top_menu_help[] =
+ "\n"
+ "Use the Up/Down arrow keys (cursor keys) to highlight the item\n"
+ "you wish to change or submenu wish to select and press <Enter>.\n"
+ "Submenus are designated by \"--->\".\n"
+ "\n"
+ "Shortcut: Press the option's highlighted letter (hotkey).\n"
+ "\n"
+ "You may also use the <PAGE UP> and <PAGE DOWN> keys to scroll\n"
+ "unseen options into view.\n"
+;
+
+static char filename[PATH_MAX+1] = ".config";
+static int indent = 0;
+static struct termios ios_org;
+static int rows, cols;
+struct menu *current_menu;
+static int child_count;
+static int single_menu_mode;
+
+static struct dialog_list_item *items[16384]; /* FIXME: This ought to be dynamic. */
+static int item_no;
+
+static void conf(struct menu *menu);
+static void conf_choice(struct menu *menu);
+static void conf_string(struct menu *menu);
+static void conf_load(void);
+static void conf_save(void);
+static void show_textbox(const char *title, const char *text, int r, int c);
+static void show_helptext(const char *title, const char *text);
+static void show_help(struct menu *menu);
+static void show_readme(void);
+
+static void init_wsize(void)
+{
+ struct winsize ws;
+ char *env;
+
+ if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
+ rows = 24;
+ cols = 80;
+ } else {
+ rows = ws.ws_row;
+ cols = ws.ws_col;
+ if (!rows) {
+ env = getenv("LINES");
+ if (env)
+ rows = atoi(env);
+ if (!rows)
+ rows = 24;
+ }
+ if (!cols) {
+ env = getenv("COLUMNS");
+ if (env)
+ cols = atoi(env);
+ if (!cols)
+ cols = 80;
+ }
+ }
+
+ if (rows < 19 || cols < 80) {
+ fprintf(stderr, "Your display is too small to run Menuconfig!\n");
+ fprintf(stderr, "It must be at least 19 lines by 80 columns.\n");
+ exit(1);
+ }
+
+ rows -= 4;
+ cols -= 5;
+}
+
+static void cinit(void)
+{
+ item_no = 0;
+}
+
+static void cmake(void)
+{
+ items[item_no] = malloc(sizeof(struct dialog_list_item));
+ memset(items[item_no], 0, sizeof(struct dialog_list_item));
+ items[item_no]->tag = malloc(32); items[item_no]->tag[0] = 0;
+ items[item_no]->name = malloc(512); items[item_no]->name[0] = 0;
+ items[item_no]->namelen = 0;
+ item_no++;
+}
+
+static int cprint_name(const char *fmt, ...)
+{
+ va_list ap;
+ int res;
+
+ if (!item_no)
+ cmake();
+ va_start(ap, fmt);
+ res = vsnprintf(items[item_no - 1]->name + items[item_no - 1]->namelen,
+ 512 - items[item_no - 1]->namelen, fmt, ap);
+ if (res > 0)
+ items[item_no - 1]->namelen += res;
+ va_end(ap);
+
+ return res;
+}
+
+static int cprint_tag(const char *fmt, ...)
+{
+ va_list ap;
+ int res;
+
+ if (!item_no)
+ cmake();
+ va_start(ap, fmt);
+ res = vsnprintf(items[item_no - 1]->tag, 32, fmt, ap);
+ va_end(ap);
+
+ return res;
+}
+
+static void cdone(void)
+{
+ int i;
+
+ for (i = 0; i < item_no; i++) {
+ free(items[i]->tag);
+ free(items[i]->name);
+ free(items[i]);
+ }
+
+ item_no = 0;
+}
+
+static void build_conf(struct menu *menu)
+{
+ struct symbol *sym;
+ struct property *prop;
+ struct menu *child;
+ int type, tmp, doint = 2;
+ tristate val;
+ char ch;
+
+ if (!menu_is_visible(menu))
+ return;
+
+ sym = menu->sym;
+ prop = menu->prompt;
+ if (!sym) {
+ if (prop && menu != current_menu) {
+ const char *prompt = menu_get_prompt(menu);
+ switch (prop->type) {
+ case P_MENU:
+ child_count++;
+ cmake();
+ cprint_tag("m%p", menu);
+
+ if (single_menu_mode) {
+ cprint_name("%s%*c%s",
+ menu->data ? "-->" : "++>",
+ indent + 1, ' ', prompt);
+ } else {
+ cprint_name(" %*c%s --->", indent + 1, ' ', prompt);
+ }
+
+ if (single_menu_mode && menu->data)
+ goto conf_childs;
+ return;
+ default:
+ if (prompt) {
+ child_count++;
+ cmake();
+ cprint_tag(":%p", menu);
+ cprint_name("---%*c%s", indent + 1, ' ', prompt);
+ }
+ }
+ } else
+ doint = 0;
+ goto conf_childs;
+ }
+
+ cmake();
+ type = sym_get_type(sym);
+ if (sym_is_choice(sym)) {
+ struct symbol *def_sym = sym_get_choice_value(sym);
+ struct menu *def_menu = NULL;
+
+ child_count++;
+ for (child = menu->list; child; child = child->next) {
+ if (menu_is_visible(child) && child->sym == def_sym)
+ def_menu = child;
+ }
+
+ val = sym_get_tristate_value(sym);
+ if (sym_is_changable(sym)) {
+ cprint_tag("t%p", menu);
+ switch (type) {
+ case S_BOOLEAN:
+ cprint_name("[%c]", val == no ? ' ' : '*');
+ break;
+ case S_TRISTATE:
+ switch (val) {
+ case yes: ch = '*'; break;
+ case mod: ch = 'M'; break;
+ default: ch = ' '; break;
+ }
+ cprint_name("<%c>", ch);
+ break;
+ }
+ } else {
+ cprint_tag("%c%p", def_menu ? 't' : ':', menu);
+ cprint_name(" ");
+ }
+
+ cprint_name("%*c%s", indent + 1, ' ', menu_get_prompt(menu));
+ if (val == yes) {
+ if (def_menu) {
+ cprint_name(" (%s)", menu_get_prompt(def_menu));
+ cprint_name(" --->");
+ if (def_menu->list) {
+ indent += 2;
+ build_conf(def_menu);
+ indent -= 2;
+ }
+ }
+ return;
+ }
+ } else {
+ if (menu == current_menu) {
+ cprint_tag(":%p", menu);
+ cprint_name("---%*c%s", indent + 1, ' ', menu_get_prompt(menu));
+ goto conf_childs;
+ }
+
+ child_count++;
+ val = sym_get_tristate_value(sym);
+ if (sym_is_choice_value(sym) && val == yes) {
+ cprint_tag(":%p", menu);
+ cprint_name(" ");
+ } else {
+ switch (type) {
+ case S_BOOLEAN:
+ cprint_tag("t%p", menu);
+ if (sym_is_changable(sym))
+ cprint_name("[%c]", val == no ? ' ' : '*');
+ else
+ cprint_name(val == no ? "_ _" : "-+-");
+ break;
+ case S_TRISTATE:
+ cprint_tag("t%p", menu);
+ switch (val) {
+ case yes: ch = '*'; break;
+ case mod: ch = 'M'; break;
+ default: ch = ' '; break;
+ }
+ if (sym_is_changable(sym))
+ cprint_name("<%c>", ch);
+ else
+ cprint_name(val == no ? "_ _" : "-+-");
+ break;
+ default:
+ cprint_tag("s%p", menu);
+ tmp = cprint_name("(%s)", sym_get_string_value(sym));
+ tmp = indent - tmp + 4;
+ if (tmp < 0)
+ tmp = 0;
+ cprint_name("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
+ (sym_has_value(sym) || !sym_is_changable(sym)) ?
+ "" : " (NEW)");
+ goto conf_childs;
+ }
+ }
+ cprint_name("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
+ (sym_has_value(sym) || !sym_is_changable(sym)) ?
+ "" : " (NEW)");
+ if (menu->prompt->type == P_MENU) {
+ cprint_name(" --->");
+ return;
+ }
+ }
+
+conf_childs:
+ indent += doint;
+ for (child = menu->list; child; child = child->next)
+ build_conf(child);
+ indent -= doint;
+}
+
+static void conf(struct menu *menu)
+{
+ struct dialog_list_item *active_item = NULL;
+ struct menu *submenu;
+ const char *prompt = menu_get_prompt(menu);
+ struct symbol *sym;
+ char active_entry[40];
+ int stat, type;
+
+ unlink("lxdialog.scrltmp");
+ active_entry[0] = 0;
+ while (1) {
+ indent = 0;
+ child_count = 0;
+ current_menu = menu;
+ cdone(); cinit();
+ build_conf(menu);
+ if (!child_count)
+ break;
+ if (menu == &rootmenu) {
+ cmake(); cprint_tag(":"); cprint_name("--- ");
+ cmake(); cprint_tag("L"); cprint_name("Load an Alternate Configuration File");
+ cmake(); cprint_tag("S"); cprint_name("Save Configuration to an Alternate File");
+ }
+ dialog_clear();
+ stat = dialog_menu(prompt ? prompt : "Main Menu",
+ menu_instructions, rows, cols, rows - 10,
+ active_entry, item_no, items);
+ if (stat < 0)
+ return;
+
+ if (stat == 1 || stat == 255)
+ break;
+
+ active_item = first_sel_item(item_no, items);
+ if (!active_item)
+ continue;
+ active_item->selected = 0;
+ strncpy(active_entry, active_item->tag, sizeof(active_entry));
+ active_entry[sizeof(active_entry)-1] = 0;
+ type = active_entry[0];
+ if (!type)
+ continue;
+
+ sym = NULL;
+ submenu = NULL;
+ if (sscanf(active_entry + 1, "%p", &submenu) == 1)
+ sym = submenu->sym;
+
+ switch (stat) {
+ case 0:
+ switch (type) {
+ case 'm':
+ if (single_menu_mode)
+ submenu->data = (void *) (long) !submenu->data;
+ else
+ conf(submenu);
+ break;
+ case 't':
+ if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)
+ conf_choice(submenu);
+ else if (submenu->prompt->type == P_MENU)
+ conf(submenu);
+ break;
+ case 's':
+ conf_string(submenu);
+ break;
+ case 'L':
+ conf_load();
+ break;
+ case 'S':
+ conf_save();
+ break;
+ }
+ break;
+ case 2:
+ if (sym)
+ show_help(submenu);
+ else
+ show_readme();
+ break;
+ case 3:
+ if (type == 't') {
+ if (sym_set_tristate_value(sym, yes))
+ break;
+ if (sym_set_tristate_value(sym, mod))
+ show_textbox(NULL, setmod_text, 6, 74);
+ }
+ break;
+ case 4:
+ if (type == 't')
+ sym_set_tristate_value(sym, no);
+ break;
+ case 5:
+ if (type == 't')
+ sym_set_tristate_value(sym, mod);
+ break;
+ case 6:
+ if (type == 't')
+ sym_toggle_tristate_value(sym);
+ else if (type == 'm')
+ conf(submenu);
+ break;
+ }
+ }
+}
+
+static void show_textbox(const char *title, const char *text, int r, int c)
+{
+ int fd;
+
+ fd = creat(".help.tmp", 0777);
+ write(fd, text, strlen(text));
+ close(fd);
+ while (dialog_textbox(title, ".help.tmp", r, c) < 0)
+ ;
+ unlink(".help.tmp");
+}
+
+static void show_helptext(const char *title, const char *text)
+{
+ show_textbox(title, text, rows, cols);
+}
+
+static void show_help(struct menu *menu)
+{
+ const char *help;
+ char *helptext;
+ struct symbol *sym = menu->sym;
+
+ help = sym->help;
+ if (!help)
+ help = nohelp_text;
+ if (sym->name) {
+ helptext = malloc(strlen(sym->name) + strlen(help) + 16);
+ sprintf(helptext, "%s:\n\n%s", sym->name, help);
+ show_helptext(menu_get_prompt(menu), helptext);
+ free(helptext);
+ } else
+ show_helptext(menu_get_prompt(menu), help);
+}
+
+static void show_readme(void)
+{
+ show_helptext("Help", top_menu_help);
+}
+
+static void conf_choice(struct menu *menu)
+{
+ const char *prompt = menu_get_prompt(menu);
+ struct menu *child;
+ struct symbol *active;
+
+ active = sym_get_choice_value(menu->sym);
+ while (1) {
+ current_menu = menu;
+ cdone(); cinit();
+ for (child = menu->list; child; child = child->next) {
+ if (!menu_is_visible(child))
+ continue;
+ cmake();
+ cprint_tag("%p", child);
+ cprint_name("%s", menu_get_prompt(child));
+ if (child->sym == sym_get_choice_value(menu->sym))
+ items[item_no - 1]->selected = 1; /* ON */
+ else if (child->sym == active)
+ items[item_no - 1]->selected = 2; /* SELECTED */
+ else
+ items[item_no - 1]->selected = 0; /* OFF */
+ }
+
+ switch (dialog_checklist(prompt ? prompt : "Main Menu",
+ radiolist_instructions, 15, 70, 6,
+ item_no, items, FLAG_RADIO)) {
+ case 0:
+ if (sscanf(first_sel_item(item_no, items)->tag, "%p", &child) != 1)
+ break;
+ sym_set_tristate_value(child->sym, yes);
+ return;
+ case 1:
+ if (sscanf(first_sel_item(item_no, items)->tag, "%p", &child) == 1) {
+ show_help(child);
+ active = child->sym;
+ } else
+ show_help(menu);
+ break;
+ case 255:
+ return;
+ }
+ }
+}
+
+static void conf_string(struct menu *menu)
+{
+ const char *prompt = menu_get_prompt(menu);
+
+ while (1) {
+ char *heading;
+
+ switch (sym_get_type(menu->sym)) {
+ case S_INT:
+ heading = (char *) inputbox_instructions_int;
+ break;
+ case S_HEX:
+ heading = (char *) inputbox_instructions_hex;
+ break;
+ case S_STRING:
+ heading = (char *) inputbox_instructions_string;
+ break;
+ default:
+ heading = "Internal mconf error!";
+ /* panic? */;
+ }
+
+ switch (dialog_inputbox(prompt ? prompt : "Main Menu",
+ heading, 10, 75,
+ sym_get_string_value(menu->sym))) {
+ case 0:
+ if (sym_set_string_value(menu->sym, (const char*)dialog_input_result))
+ return;
+ show_textbox(NULL, "You have made an invalid entry.", 5, 43);
+ break;
+ case 1:
+ show_help(menu);
+ break;
+ case 255:
+ return;
+ }
+ }
+}
+
+static void conf_load(void)
+{
+ while (1) {
+ switch (dialog_inputbox(NULL, load_config_text, 11, 55,
+ filename)) {
+ case 0:
+ if (!dialog_input_result[0])
+ return;
+ if (!conf_read((const char*)dialog_input_result))
+ return;
+ show_textbox(NULL, "File does not exist!", 5, 38);
+ break;
+ case 1:
+ show_helptext("Load Alternate Configuration", load_config_help);
+ break;
+ case 255:
+ return;
+ }
+ }
+}
+
+static void conf_save(void)
+{
+ while (1) {
+ switch (dialog_inputbox(NULL, save_config_text, 11, 55,
+ filename)) {
+ case 0:
+ if (!dialog_input_result[0])
+ return;
+ if (!conf_write((const char*)dialog_input_result))
+ return;
+ show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60);
+ break;
+ case 1:
+ show_helptext("Save Alternate Configuration", save_config_help);
+ break;
+ case 255:
+ return;
+ }
+ }
+}
+
+static void conf_cleanup(void)
+{
+ tcsetattr(1, TCSAFLUSH, &ios_org);
+ unlink(".help.tmp");
+}
+
+static void winch_handler(int sig)
+{
+ struct winsize ws;
+
+ if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
+ rows = 24;
+ cols = 80;
+ } else {
+ rows = ws.ws_row;
+ cols = ws.ws_col;
+ }
+
+ if (rows < 19 || cols < 80) {
+ end_dialog();
+ fprintf(stderr, "Your display is too small to run Menuconfig!\n");
+ fprintf(stderr, "It must be at least 19 lines by 80 columns.\n");
+ exit(1);
+ }
+
+ rows -= 4;
+ cols -= 5;
+
+}
+
+int main(int ac, char **av)
+{
+ int stat;
+ char *mode;
+ struct symbol *sym;
+
+ conf_parse(av[1]);
+ conf_read(NULL);
+
+ sym = sym_lookup("VERSION", 0);
+ sym_calc_value(sym);
+ snprintf(menu_backtitle, 128, "OpenADK v%s Configuration",
+ sym_get_string_value(sym));
+
+ mode = getenv("MENUCONFIG_MODE");
+ if (mode) {
+ if (!strcasecmp(mode, "single_menu"))
+ single_menu_mode = 1;
+ }
+
+ tcgetattr(1, &ios_org);
+ atexit(conf_cleanup);
+ init_wsize();
+ init_dialog();
+ signal(SIGWINCH, winch_handler);
+ conf(&rootmenu);
+ end_dialog();
+
+ /* Restart dialog to act more like when lxdialog was still separate */
+ init_dialog();
+ do {
+ stat = dialog_yesno(NULL,
+ "Do you wish to save your new OpenADK configuration?", 5, 60);
+ } while (stat < 0);
+ end_dialog();
+
+ if (stat == 0) {
+ conf_write(NULL);
+ printf("\n\n*** End of OpenADK configuration.\n");
+ } else
+ printf("\n\nYour OpenADK configuration changes were NOT saved.\n\n");
+
+ return 0;
+}
diff --git a/config/menu.c b/config/menu.c
new file mode 100644
index 000000000..f6e6200ce
--- /dev/null
+++ b/config/menu.c
@@ -0,0 +1,436 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+struct menu rootmenu;
+struct menu *current_menu, *current_entry;
+static struct menu **last_entry_ptr;
+
+struct file *file_list;
+struct file *current_file;
+
+static void menu_warn(struct menu *menu, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ fprintf(stderr, "%s:%d:warning: ", menu->file->name, menu->lineno);
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+}
+
+static void prop_warn(struct property *prop, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ fprintf(stderr, "%s:%d:warning: ", prop->file->name, prop->lineno);
+ vfprintf(stderr, fmt, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+}
+
+void menu_init(void)
+{
+ current_entry = current_menu = &rootmenu;
+ last_entry_ptr = &rootmenu.list;
+}
+
+void menu_add_entry(struct symbol *sym)
+{
+ struct menu *menu;
+
+ menu = malloc(sizeof(*menu));
+ memset(menu, 0, sizeof(*menu));
+ menu->sym = sym;
+ menu->parent = current_menu;
+ menu->file = current_file;
+ menu->lineno = zconf_lineno();
+
+ *last_entry_ptr = menu;
+ last_entry_ptr = &menu->next;
+ current_entry = menu;
+}
+
+void menu_end_entry(void)
+{
+}
+
+void menu_add_menu(void)
+{
+ current_menu = current_entry;
+ last_entry_ptr = &current_entry->list;
+}
+
+void menu_end_menu(void)
+{
+ last_entry_ptr = &current_menu->next;
+ current_menu = current_menu->parent;
+}
+
+struct expr *menu_check_dep(struct expr *e)
+{
+ if (!e)
+ return e;
+
+ switch (e->type) {
+ case E_NOT:
+ e->left.expr = menu_check_dep(e->left.expr);
+ break;
+ case E_OR:
+ case E_AND:
+ e->left.expr = menu_check_dep(e->left.expr);
+ e->right.expr = menu_check_dep(e->right.expr);
+ break;
+ case E_SYMBOL:
+ /* change 'm' into 'm' && MODULES */
+ if (e->left.sym == &symbol_mod)
+ return expr_alloc_and(e, expr_alloc_symbol(modules_sym));
+ break;
+ default:
+ break;
+ }
+ return e;
+}
+
+void menu_add_dep(struct expr *dep)
+{
+ current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
+}
+
+void menu_set_type(int type)
+{
+ struct symbol *sym = current_entry->sym;
+
+ if (sym->type == type)
+ return;
+ if (sym->type == S_UNKNOWN) {
+ sym->type = type;
+ return;
+ }
+ menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'\n",
+ sym->name ? sym->name : "<choice>",
+ sym_type_name(sym->type), sym_type_name(type));
+}
+
+struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep)
+{
+ struct property *prop = prop_alloc(type, current_entry->sym);
+
+ prop->menu = current_entry;
+ prop->text = prompt;
+ prop->expr = expr;
+ prop->visible.expr = menu_check_dep(dep);
+
+ if (prompt) {
+ if (current_entry->prompt)
+ menu_warn(current_entry, "prompt redefined\n");
+ current_entry->prompt = prop;
+ }
+
+ return prop;
+}
+
+void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
+{
+ menu_add_prop(type, prompt, NULL, dep);
+}
+
+void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)
+{
+ menu_add_prop(type, NULL, expr, dep);
+}
+
+void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
+{
+ menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep);
+}
+
+void sym_check_prop(struct symbol *sym)
+{
+ struct property *prop;
+ struct symbol *sym2;
+ for (prop = sym->prop; prop; prop = prop->next) {
+ switch (prop->type) {
+ case P_DEFAULT:
+ if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
+ prop->expr->type != E_SYMBOL)
+ prop_warn(prop,
+ "default for config symbol '%'"
+ " must be a single symbol", sym->name);
+ break;
+ case P_SELECT:
+ case P_SELECTNOT:
+ sym2 = prop_get_symbol(prop);
+ if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
+ prop_warn(prop,
+ "config symbol '%s' uses select, but is "
+ "not boolean or tristate", sym->name);
+ else if (sym2->type == S_UNKNOWN)
+ prop_warn(prop,
+ "'select' used by config symbol '%s' "
+ "refer to undefined symbol '%s'",
+ sym->name, sym2->name);
+ else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
+ prop_warn(prop,
+ "'%s' has wrong type. 'select' only "
+ "accept arguments of boolean and "
+ "tristate type", sym2->name);
+ break;
+ case P_RANGE:
+ if (sym->type != S_INT && sym->type != S_HEX)
+ prop_warn(prop, "range is only allowed "
+ "for int or hex symbols");
+ if (!sym_string_valid(sym, prop->expr->left.sym->name) ||
+ !sym_string_valid(sym, prop->expr->right.sym->name))
+ prop_warn(prop, "range is invalid");
+ break;
+ default:
+ ;
+ }
+ }
+}
+
+void menu_finalize(struct menu *parent)
+{
+ struct menu *menu, *last_menu;
+ struct symbol *sym;
+ struct property *prop;
+ struct expr *parentdep, *basedep, *dep, *dep2, **ep;
+
+ sym = parent->sym;
+ if (parent->list) {
+ if (sym && sym_is_choice(sym)) {
+ /* find the first choice value and find out choice type */
+ for (menu = parent->list; menu; menu = menu->next) {
+ if (menu->sym) {
+ current_entry = parent;
+ menu_set_type(menu->sym->type);
+ current_entry = menu;
+ menu_set_type(sym->type);
+ break;
+ }
+ }
+ parentdep = expr_alloc_symbol(sym);
+ } else if (parent->prompt)
+ parentdep = parent->prompt->visible.expr;
+ else
+ parentdep = parent->dep;
+
+ for (menu = parent->list; menu; menu = menu->next) {
+ basedep = expr_transform(menu->dep);
+ basedep = expr_alloc_and(expr_copy(parentdep), basedep);
+ basedep = expr_eliminate_dups(basedep);
+ menu->dep = basedep;
+ if (menu->sym)
+ prop = menu->sym->prop;
+ else
+ prop = menu->prompt;
+ for (; prop; prop = prop->next) {
+ if (prop->menu != menu)
+ continue;
+ dep = expr_transform(prop->visible.expr);
+ dep = expr_alloc_and(expr_copy(basedep), dep);
+ dep = expr_eliminate_dups(dep);
+ if (menu->sym && menu->sym->type != S_TRISTATE)
+ dep = expr_trans_bool(dep);
+ prop->visible.expr = dep;
+ if (prop->type == P_SELECT) {
+ struct symbol *es = prop_get_symbol(prop);
+ es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr,
+ expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
+ } else if (prop->type == P_SELECTNOT) {
+ struct symbol *es = prop_get_symbol(prop);
+ es->rev_dep_inv.expr = expr_alloc_or(es->rev_dep_inv.expr,
+ expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
+ }
+ }
+ }
+ for (menu = parent->list; menu; menu = menu->next)
+ menu_finalize(menu);
+ } else if (sym) {
+ basedep = parent->prompt ? parent->prompt->visible.expr : NULL;
+ basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no);
+ basedep = expr_eliminate_dups(expr_transform(basedep));
+ last_menu = NULL;
+ for (menu = parent->next; menu; menu = menu->next) {
+ dep = menu->prompt ? menu->prompt->visible.expr : menu->dep;
+ if (!expr_contains_symbol(dep, sym))
+ break;
+ if (expr_depends_symbol(dep, sym))
+ goto next;
+ dep = expr_trans_compare(dep, E_UNEQUAL, &symbol_no);
+ dep = expr_eliminate_dups(expr_transform(dep));
+ dep2 = expr_copy(basedep);
+ expr_eliminate_eq(&dep, &dep2);
+ expr_free(dep);
+ if (!expr_is_yes(dep2)) {
+ expr_free(dep2);
+ break;
+ }
+ expr_free(dep2);
+ next:
+ menu_finalize(menu);
+ menu->parent = parent;
+ last_menu = menu;
+ }
+ if (last_menu) {
+ parent->list = parent->next;
+ parent->next = last_menu->next;
+ last_menu->next = NULL;
+ }
+ }
+ for (menu = parent->list; menu; menu = menu->next) {
+ if (sym && sym_is_choice(sym) && menu->sym) {
+ menu->sym->flags |= SYMBOL_CHOICEVAL;
+ if (!menu->prompt)
+ menu_warn(menu, "choice value must have a prompt");
+ for (prop = menu->sym->prop; prop; prop = prop->next) {
+ if (prop->type == P_PROMPT && prop->menu != menu) {
+ prop_warn(prop, "choice values "
+ "currently only support a "
+ "single prompt");
+ }
+ if (prop->type == P_DEFAULT)
+ prop_warn(prop, "defaults for choice "
+ "values not supported");
+ }
+ current_entry = menu;
+ menu_set_type(sym->type);
+ menu_add_symbol(P_CHOICE, sym, NULL);
+ prop = sym_get_choice_prop(sym);
+ for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr)
+ ;
+ *ep = expr_alloc_one(E_CHOICE, NULL);
+ (*ep)->right.sym = menu->sym;
+ }
+ if (menu->list && (!menu->prompt || !menu->prompt->text)) {
+ for (last_menu = menu->list; ; last_menu = last_menu->next) {
+ last_menu->parent = parent;
+ if (!last_menu->next)
+ break;
+ }
+ last_menu->next = menu->next;
+ menu->next = menu->list;
+ menu->list = NULL;
+ }
+ }
+
+ if (sym && !(sym->flags & SYMBOL_WARNED)) {
+ if (sym->type == S_UNKNOWN)
+ menu_warn(parent, "config symbol defined "
+ "without type\n");
+
+ if (sym_is_choice(sym) && !parent->prompt)
+ menu_warn(parent, "choice must have a prompt\n");
+
+ /* Check properties connected to this symbol */
+ sym_check_prop(sym);
+ sym->flags |= SYMBOL_WARNED;
+ }
+
+ if (sym && !sym_is_optional(sym) && parent->prompt) {
+ sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
+ expr_alloc_and(parent->prompt->visible.expr,
+ expr_alloc_symbol(&symbol_mod)));
+ }
+}
+
+bool menu_is_visible(struct menu *menu)
+{
+ struct menu *child;
+ struct symbol *sym;
+ tristate visible;
+
+ if (!menu->prompt)
+ return false;
+ sym = menu->sym;
+ if (sym) {
+ sym_calc_value(sym);
+ visible = menu->prompt->visible.tri;
+ } else
+ visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr);
+
+ if (visible != no)
+ return true;
+ if (!sym || sym_get_tristate_value(menu->sym) == no)
+ return false;
+
+ for (child = menu->list; child; child = child->next)
+ if (menu_is_visible(child))
+ return true;
+ return false;
+}
+
+const char *menu_get_prompt(struct menu *menu)
+{
+ if (menu->prompt)
+ return menu->prompt->text;
+ else if (menu->sym)
+ return menu->sym->name;
+ return NULL;
+}
+
+struct menu *menu_get_root_menu(struct menu *menu)
+{
+ return &rootmenu;
+}
+
+struct menu *menu_get_parent_menu(struct menu *menu)
+{
+ enum prop_type type;
+
+ for (; menu != &rootmenu; menu = menu->parent) {
+ type = menu->prompt ? menu->prompt->type : 0;
+ if (type == P_MENU)
+ break;
+ }
+ return menu;
+}
+
+struct file *file_lookup(const char *name)
+{
+ struct file *file;
+
+ for (file = file_list; file; file = file->next) {
+ if (!strcmp(name, file->name))
+ return file;
+ }
+
+ file = malloc(sizeof(*file));
+ memset(file, 0, sizeof(*file));
+ file->name = strdup(name);
+ file->next = file_list;
+ file_list = file;
+ return file;
+}
+
+int file_write_dep(const char *name)
+{
+ struct file *file;
+ FILE *out;
+
+ if (!name)
+ name = ".config.cmd";
+ out = fopen(".config.tmp", "w");
+ if (!out)
+ return 1;
+ fprintf(out, "deps_config := \\\n");
+ for (file = file_list; file; file = file->next) {
+ if (file->next)
+ fprintf(out, "\t%s \\\n", file->name);
+ else
+ fprintf(out, "\t%s\n", file->name);
+ }
+ fprintf(out, "\n.config include/config.h: $(deps_config)\n\n$(deps_config):\n");
+ fclose(out);
+ rename(".config.tmp", name);
+ return 0;
+}
+
diff --git a/config/menubox.c b/config/menubox.c
new file mode 100644
index 000000000..c2fd755b4
--- /dev/null
+++ b/config/menubox.c
@@ -0,0 +1,438 @@
+/*
+ * menubox.c -- implements the menu box
+ *
+ * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * Changes by Clifford Wolf (god@clifford.at)
+ *
+ * [ 1998-06-13 ]
+ *
+ * *) A bugfix for the Page-Down problem
+ *
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * to the first position in the menu box. Now lxdialog is a bit
+ * smarter and works more like other menu systems (just have a look at
+ * it).
+ *
+ * *) Formerly if I selected something my scrolling would be broken because
+ * lxdialog is re-invoked by the Menuconfig shell script, can't
+ * remember the last scrolling position, and just sets it so that the
+ * cursor is at the bottom of the box. Now it writes the temporary file
+ * lxdialog.scrltmp which contains this information. The file is
+ * deleted by lxdialog if the user leaves a submenu or enters a new
+ * one, but it would be nice if Menuconfig could make another "rm -f"
+ * just to be sure. Just try it out - you will recognise a difference!
+ *
+ * [ 1998-06-14 ]
+ *
+ * *) Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files
+ * and menus change their size on the fly.
+ *
+ * *) If for some reason the last scrolling position is not saved by
+ * lxdialog, it sets the scrolling so that the selected item is in the
+ * middle of the menu box, not at the bottom.
+ *
+ * 02 January 1999, Michael Elizabeth Chastain (mec@shout.net)
+ * Reset 'scroll' to 0 if the value from lxdialog.scrltmp is bogus.
+ * This fixes a bug in Menuconfig where using ' ' to descend into menus
+ * would leave mis-synchronized lxdialog.scrltmp files lying around,
+ * fscanf would read in 'scroll', and eventually that value would get used.
+ */
+
+#include "dialog.h"
+
+static int menu_width, item_x;
+
+/*
+ * Print menu item
+ */
+static void
+print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey)
+{
+ int j;
+ char menu_item[menu_width+1];
+
+ strncpy(menu_item, item, menu_width);
+ menu_item[menu_width] = 0;
+ j = first_alpha(menu_item, "YyNnMm");
+
+ /* Clear 'residue' of last item */
+ wattrset (win, menubox_attr);
+ wmove (win, choice, 0);
+#if OLD_NCURSES
+ {
+ int i;
+ for (i = 0; i < menu_width; i++)
+ waddch (win, ' ');
+ }
+#else
+ wclrtoeol(win);
+#endif
+ wattrset (win, selected ? item_selected_attr : item_attr);
+ mvwaddstr (win, choice, item_x, menu_item);
+#if 0
+ if (hotkey) {
+ wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
+ mvwaddch(win, choice, item_x+j, menu_item[j]);
+ }
+#endif
+ if (selected) {
+ wmove (win, choice, item_x+1);
+ wrefresh (win);
+ }
+}
+
+/*
+ * Print the scroll indicators.
+ */
+static void
+print_arrows (WINDOW * win, int item_no, int scroll,
+ int y, int x, int height)
+{
+ int cur_y, cur_x;
+
+ getyx(win, cur_y, cur_x);
+
+ wmove(win, y, x);
+
+ if (scroll > 0) {
+ wattrset (win, uarrow_attr);
+ waddch (win, ACS_UARROW);
+ waddstr (win, "(-)");
+ }
+ else {
+ wattrset (win, menubox_attr);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ }
+
+ y = y + height + 1;
+ wmove(win, y, x);
+
+ if ((height < item_no) && (scroll + height < item_no)) {
+ wattrset (win, darrow_attr);
+ waddch (win, ACS_DARROW);
+ waddstr (win, "(+)");
+ }
+ else {
+ wattrset (win, menubox_border_attr);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ waddch (win, ACS_HLINE);
+ }
+
+ wmove(win, cur_y, cur_x);
+}
+
+/*
+ * Display the termination buttons.
+ */
+static void
+print_buttons (WINDOW *win, int height, int width, int selected)
+{
+ int x = width / 2 - 16;
+ int y = height - 2;
+
+ print_button (win, "Select", y, x, selected == 0);
+ print_button (win, " Exit ", y, x + 12, selected == 1);
+ print_button (win, " Help ", y, x + 24, selected == 2);
+
+ wmove(win, y, x+1+12*selected);
+ wrefresh (win);
+}
+
+/*
+ * Display a menu for choosing among a number of options
+ */
+int
+dialog_menu (const char *title, const char *prompt, int height, int width,
+ int menu_height, const char *current, int item_no,
+ struct dialog_list_item ** items)
+{
+ int i, j, x, y, box_x, box_y;
+ int key = 0, button = 0, scroll = 0, choice = 0, first_item = 0, max_choice;
+ WINDOW *dialog, *menu;
+ FILE *f;
+
+ max_choice = MIN (menu_height, item_no);
+
+ /* center dialog box on screen */
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ draw_shadow (stdscr, y, x, height, width);
+
+ dialog = newwin (height, width, y, x);
+ keypad (dialog, TRUE);
+
+ draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
+ wattrset (dialog, border_attr);
+ mvwaddch (dialog, height - 3, 0, ACS_LTEE);
+ for (i = 0; i < width - 2; i++)
+ waddch (dialog, ACS_HLINE);
+ wattrset (dialog, dialog_attr);
+ wbkgdset (dialog, dialog_attr & A_COLOR);
+ waddch (dialog, ACS_RTEE);
+
+ if (title != NULL && strlen(title) >= width-2 ) {
+ /* truncate long title -- mec */
+ char * title2 = malloc(width-2+1);
+ memcpy( title2, title, width-2 );
+ title2[width-2] = '\0';
+ title = title2;
+ }
+
+ if (title != NULL) {
+ wattrset (dialog, title_attr);
+ mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
+ waddstr (dialog, (char *)title);
+ waddch (dialog, ' ');
+ }
+
+ wattrset (dialog, dialog_attr);
+ print_autowrap (dialog, prompt, width - 2, 1, 3);
+
+ menu_width = width - 6;
+ box_y = height - menu_height - 5;
+ box_x = (width - menu_width) / 2 - 1;
+
+ /* create new window for the menu */
+ menu = subwin (dialog, menu_height, menu_width,
+ y + box_y + 1, x + box_x + 1);
+ keypad (menu, TRUE);
+
+ /* draw a box around the menu items */
+ draw_box (dialog, box_y, box_x, menu_height + 2, menu_width + 2,
+ menubox_border_attr, menubox_attr);
+
+ /*
+ * Find length of longest item in order to center menu.
+ * Set 'choice' to default item.
+ */
+ item_x = 0;
+ for (i = 0; i < item_no; i++) {
+ item_x = MAX (item_x, MIN(menu_width, strlen (items[i]->name) + 2));
+ if (strcmp(current, items[i]->tag) == 0) choice = i;
+ }
+
+ item_x = (menu_width - item_x) / 2;
+
+ /* get the scroll info from the temp file */
+ if ( (f=fopen("lxdialog.scrltmp","r")) != NULL ) {
+ if ( (fscanf(f,"%d\n",&scroll) == 1) && (scroll <= choice) &&
+ (scroll+max_choice > choice) && (scroll >= 0) &&
+ (scroll+max_choice <= item_no) ) {
+ first_item = scroll;
+ choice = choice - scroll;
+ fclose(f);
+ } else {
+ scroll=0;
+ remove("lxdialog.scrltmp");
+ fclose(f);
+ f=NULL;
+ }
+ }
+ if ( (choice >= max_choice) || (f==NULL && choice >= max_choice/2) ) {
+ if (choice >= item_no-max_choice/2)
+ scroll = first_item = item_no-max_choice;
+ else
+ scroll = first_item = choice - max_choice/2;
+ choice = choice - scroll;
+ }
+
+ /* Print the menu */
+ for (i=0; i < max_choice; i++) {
+ print_item (menu, items[first_item + i]->name, i, i == choice,
+ (items[first_item + i]->tag[0] != ':'));
+ }
+
+ wnoutrefresh (menu);
+
+ print_arrows(dialog, item_no, scroll,
+ box_y, box_x+item_x+1, menu_height);
+
+ print_buttons (dialog, height, width, 0);
+ wmove (menu, choice, item_x+1);
+ wrefresh (menu);
+
+ while (key != ESC) {
+ key = wgetch(menu);
+
+ if (key < 256 && isalpha(key)) key = tolower(key);
+
+ if (strchr("ynm", key))
+ i = max_choice;
+ else {
+ for (i = choice+1; i < max_choice; i++) {
+ j = first_alpha(items[scroll + i]->name, "YyNnMm>");
+ if (key == tolower(items[scroll + i]->name[j]))
+ break;
+ }
+ if (i == max_choice)
+ for (i = 0; i < max_choice; i++) {
+ j = first_alpha(items[scroll + i]->name, "YyNnMm>");
+ if (key == tolower(items[scroll + i]->name[j]))
+ break;
+ }
+ }
+
+ if (i < max_choice ||
+ key == KEY_UP || key == KEY_DOWN ||
+ key == '-' || key == '+' ||
+ key == KEY_PPAGE || key == KEY_NPAGE) {
+
+ print_item (menu, items[scroll + choice]->name, choice, FALSE,
+ (items[scroll + choice]->tag[0] != ':'));
+
+ if (key == KEY_UP || key == '-') {
+ if (choice < 2 && scroll) {
+ /* Scroll menu down */
+ scrollok (menu, TRUE);
+ wscrl (menu, -1);
+ scrollok (menu, FALSE);
+
+ scroll--;
+
+ print_item (menu, items[scroll]->name, 0, FALSE,
+ (items[scroll]->tag[0] != ':'));
+ } else
+ choice = MAX(choice - 1, 0);
+
+ } else if (key == KEY_DOWN || key == '+') {
+
+ print_item (menu, items[scroll + choice]->name, choice, FALSE,
+ (items[scroll + choice]->tag[0] != ':'));
+
+ if ((choice > max_choice-3) &&
+ (scroll + max_choice < item_no)
+ ) {
+ /* Scroll menu up */
+ scrollok (menu, TRUE);
+ scroll (menu);
+ scrollok (menu, FALSE);
+
+ scroll++;
+
+ print_item (menu, items[scroll + max_choice - 1]->name,
+ max_choice-1, FALSE,
+ (items[scroll + max_choice - 1]->tag[0] != ':'));
+ } else
+ choice = MIN(choice+1, max_choice-1);
+
+ } else if (key == KEY_PPAGE) {
+ scrollok (menu, TRUE);
+ for (i=0; (i < max_choice); i++) {
+ if (scroll > 0) {
+ wscrl (menu, -1);
+ scroll--;
+ print_item (menu, items[scroll]->name, 0, FALSE,
+ (items[scroll]->tag[0] != ':'));
+ } else {
+ if (choice > 0)
+ choice--;
+ }
+ }
+ scrollok (menu, FALSE);
+
+ } else if (key == KEY_NPAGE) {
+ for (i=0; (i < max_choice); i++) {
+ if (scroll+max_choice < item_no) {
+ scrollok (menu, TRUE);
+ scroll(menu);
+ scrollok (menu, FALSE);
+ scroll++;
+ print_item (menu, items[scroll + max_choice - 1]->name,
+ max_choice-1, FALSE,
+ (items[scroll + max_choice - 1]->tag[0] != ':'));
+ } else {
+ if (choice+1 < max_choice)
+ choice++;
+ }
+ }
+
+ } else
+ choice = i;
+
+ print_item (menu, items[scroll + choice]->name, choice, TRUE,
+ (items[scroll + choice]->tag[0] != ':'));
+
+ print_arrows(dialog, item_no, scroll,
+ box_y, box_x+item_x+1, menu_height);
+
+ wnoutrefresh (dialog);
+ wrefresh (menu);
+
+ continue; /* wait for another key press */
+ }
+
+ switch (key) {
+ case KEY_LEFT:
+ case TAB:
+ case KEY_RIGHT:
+ button = ((key == KEY_LEFT ? --button : ++button) < 0)
+ ? 2 : (button > 2 ? 0 : button);
+
+ print_buttons(dialog, height, width, button);
+ wrefresh (menu);
+ break;
+ case ' ':
+ case 's':
+ case 'y':
+ case 'n':
+ case 'm':
+ /* save scroll info */
+ if ( (f=fopen("lxdialog.scrltmp","w")) != NULL ) {
+ fprintf(f,"%d\n",scroll);
+ fclose(f);
+ }
+ delwin (dialog);
+ items[scroll + choice]->selected = 1;
+ switch (key) {
+ case 's': return 3;
+ case 'y': return 3;
+ case 'n': return 4;
+ case 'm': return 5;
+ case ' ': return 6;
+ }
+ return 0;
+ case 'h':
+ case '?':
+ button = 2;
+ case '\n':
+ delwin (dialog);
+ items[scroll + choice]->selected = 1;
+
+ remove("lxdialog.scrltmp");
+ return button;
+ case 'e':
+ case 'x':
+ key = ESC;
+ case ESC:
+ break;
+ }
+ }
+
+ delwin (dialog);
+ remove("lxdialog.scrltmp");
+ return -1; /* ESC pressed */
+}
diff --git a/config/msgbox.c b/config/msgbox.c
new file mode 100644
index 000000000..93692e1fb
--- /dev/null
+++ b/config/msgbox.c
@@ -0,0 +1,85 @@
+/*
+ * msgbox.c -- implements the message box and info box
+ *
+ * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dialog.h"
+
+/*
+ * Display a message box. Program will pause and display an "OK" button
+ * if the parameter 'pause' is non-zero.
+ */
+int
+dialog_msgbox (const char *title, const char *prompt, int height, int width,
+ int pause)
+{
+ int i, x, y, key = 0;
+ WINDOW *dialog;
+
+ /* center dialog box on screen */
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ draw_shadow (stdscr, y, x, height, width);
+
+ dialog = newwin (height, width, y, x);
+ keypad (dialog, TRUE);
+
+ draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
+
+ if (title != NULL && strlen(title) >= width-2 ) {
+ /* truncate long title -- mec */
+ char * title2 = malloc(width-2+1);
+ memcpy( title2, title, width-2 );
+ title2[width-2] = '\0';
+ title = title2;
+ }
+
+ if (title != NULL) {
+ wattrset (dialog, title_attr);
+ mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
+ waddstr (dialog, (char *)title);
+ waddch (dialog, ' ');
+ }
+ wattrset (dialog, dialog_attr);
+ print_autowrap (dialog, prompt, width - 2, 1, 2);
+
+ if (pause) {
+ wattrset (dialog, border_attr);
+ mvwaddch (dialog, height - 3, 0, ACS_LTEE);
+ for (i = 0; i < width - 2; i++)
+ waddch (dialog, ACS_HLINE);
+ wattrset (dialog, dialog_attr);
+ waddch (dialog, ACS_RTEE);
+
+ print_button (dialog, " Ok ",
+ height - 2, width / 2 - 4, TRUE);
+
+ wrefresh (dialog);
+ while (key != ESC && key != '\n' && key != ' ' &&
+ key != 'O' && key != 'o' && key != 'X' && key != 'x')
+ key = wgetch (dialog);
+ } else {
+ key = '\n';
+ wrefresh (dialog);
+ }
+
+ delwin (dialog);
+ return key == ESC ? -1 : 0;
+}
diff --git a/config/symbol.c b/config/symbol.c
new file mode 100644
index 000000000..b9d2c3d2a
--- /dev/null
+++ b/config/symbol.c
@@ -0,0 +1,782 @@
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <ctype.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/utsname.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+extern int output_mode;
+
+struct symbol symbol_yes = {
+ .name = "y",
+ .curr = { "y", yes },
+ .flags = SYMBOL_YES|SYMBOL_VALID,
+}, symbol_mod = {
+ .name = "m",
+ .curr = { "m", mod },
+ .flags = SYMBOL_MOD|SYMBOL_VALID,
+}, symbol_no = {
+ .name = "n",
+ .curr = { "n", no },
+ .flags = SYMBOL_NO|SYMBOL_VALID,
+}, symbol_empty = {
+ .name = "",
+ .curr = { "", no },
+ .flags = SYMBOL_VALID,
+};
+
+int sym_change_count;
+struct symbol *modules_sym;
+tristate modules_val;
+
+void sym_add_default(struct symbol *sym, const char *def)
+{
+ struct property *prop = prop_alloc(P_DEFAULT, sym);
+
+ prop->expr = expr_alloc_symbol(sym_lookup(def, 1));
+}
+
+void sym_init(void)
+{
+ struct symbol *sym;
+ char *p;
+ static bool inited = false;
+
+ if (inited)
+ return;
+ inited = true;
+
+ sym = sym_lookup("VERSION", 0);
+ sym->type = S_STRING;
+ sym->flags |= SYMBOL_AUTO;
+ p = getenv("VERSION");
+ if (p)
+ sym_add_default(sym, p);
+
+ sym = sym_lookup("TARGET_ARCH", 0);
+ sym->type = S_STRING;
+ sym->flags |= SYMBOL_AUTO;
+ p = getenv("TARGET_ARCH");
+ if (p)
+ sym_add_default(sym, p);
+
+}
+
+enum symbol_type sym_get_type(struct symbol *sym)
+{
+ enum symbol_type type = sym->type;
+
+ if (type == S_TRISTATE) {
+ if (sym_is_choice_value(sym) && sym->visible == yes)
+ type = S_BOOLEAN;
+ else if (modules_val == no)
+ type = S_BOOLEAN;
+ }
+ return type;
+}
+
+const char *sym_type_name(enum symbol_type type)
+{
+ switch (type) {
+ case S_BOOLEAN:
+ return "boolean";
+ case S_TRISTATE:
+ return "tristate";
+ case S_INT:
+ return "integer";
+ case S_HEX:
+ return "hex";
+ case S_STRING:
+ return "string";
+ case S_UNKNOWN:
+ return "unknown";
+ case S_OTHER:
+ break;
+ }
+ return "???";
+}
+
+struct property *sym_get_choice_prop(struct symbol *sym)
+{
+ struct property *prop;
+
+ for_all_choices(sym, prop)
+ return prop;
+ return NULL;
+}
+
+struct property *sym_get_default_prop(struct symbol *sym)
+{
+ struct property *prop;
+
+ for_all_defaults(sym, prop) {
+ prop->visible.tri = expr_calc_value(prop->visible.expr);
+ if (prop->visible.tri != no || output_mode)
+ return prop;
+ }
+ return NULL;
+}
+
+struct property *sym_get_range_prop(struct symbol *sym)
+{
+ struct property *prop;
+
+ for_all_properties(sym, prop, P_RANGE) {
+ prop->visible.tri = expr_calc_value(prop->visible.expr);
+ if (prop->visible.tri != no)
+ return prop;
+ }
+ return NULL;
+}
+
+static void sym_calc_visibility(struct symbol *sym)
+{
+ struct property *prop;
+ tristate tri;
+ bool deselected = false;
+
+ /* any prompt visible? */
+ tri = no;
+ for_all_prompts(sym, prop) {
+ prop->visible.tri = expr_calc_value(prop->visible.expr);
+ tri = E_OR(tri, prop->visible.tri);
+ }
+ if (tri == mod && (sym->type != S_TRISTATE || modules_val == no))
+ tri = yes;
+ if (sym->rev_dep_inv.expr && (expr_calc_value(sym->rev_dep_inv.expr) == yes)) {
+ tri = no;
+ deselected = true;
+ }
+ if (sym->visible != tri) {
+ sym->visible = tri;
+ sym_set_changed(sym);
+ }
+ if (sym_is_choice_value(sym) || deselected)
+ return;
+ tri = no;
+ if (sym->rev_dep.expr)
+ tri = expr_calc_value(sym->rev_dep.expr);
+ if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
+ tri = yes;
+ if (sym->rev_dep.tri != tri) {
+ sym->rev_dep.tri = tri;
+ sym_set_changed(sym);
+ }
+}
+
+static struct symbol *sym_calc_choice(struct symbol *sym)
+{
+ struct symbol *def_sym;
+ struct property *prop;
+ struct expr *e;
+
+ /* is the user choice visible? */
+ def_sym = sym->user.val;
+ if (def_sym) {
+ sym_calc_visibility(def_sym);
+ if (def_sym->visible != no)
+ return def_sym;
+ }
+
+ /* any of the defaults visible? */
+ for_all_defaults(sym, prop) {
+ prop->visible.tri = expr_calc_value(prop->visible.expr);
+ if (prop->visible.tri == no)
+ continue;
+ def_sym = prop_get_symbol(prop);
+ sym_calc_visibility(def_sym);
+ if (def_sym->visible != no)
+ return def_sym;
+ }
+
+ /* just get the first visible value */
+ prop = sym_get_choice_prop(sym);
+ for (e = prop->expr; e; e = e->left.expr) {
+ def_sym = e->right.sym;
+ sym_calc_visibility(def_sym);
+ if (def_sym->visible != no)
+ return def_sym;
+ }
+
+ /* no choice? reset tristate value */
+ sym->curr.tri = no;
+ return NULL;
+}
+
+void sym_calc_value(struct symbol *sym)
+{
+ struct symbol_value newval, oldval;
+ struct property *prop;
+ struct expr *e;
+
+ if (!sym)
+ return;
+
+ if (sym->flags & SYMBOL_VALID)
+ return;
+ sym->flags |= SYMBOL_VALID;
+
+ oldval = sym->curr;
+
+ switch (sym->type) {
+ case S_INT:
+ case S_HEX:
+ case S_STRING:
+ newval = symbol_empty.curr;
+ break;
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ newval = symbol_no.curr;
+ break;
+ default:
+ sym->curr.val = sym->name;
+ sym->curr.tri = no;
+ return;
+ }
+ if (!sym_is_choice_value(sym))
+ sym->flags &= ~SYMBOL_WRITE;
+
+ sym_calc_visibility(sym);
+
+ /* set default if recursively called */
+ sym->curr = newval;
+
+ switch (sym_get_type(sym)) {
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ if (sym_is_choice_value(sym) && sym->visible == yes) {
+ prop = sym_get_choice_prop(sym);
+ newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no;
+ } else if (sym->rev_dep_inv.expr && (expr_calc_value(sym->rev_dep_inv.expr) == yes)) {
+ newval.tri = no;
+ } else if (E_OR(sym->visible, sym->rev_dep.tri) != no) {
+ sym->flags |= SYMBOL_WRITE;
+ if (sym_has_value(sym))
+ newval.tri = sym->user.tri;
+ else if (!sym_is_choice(sym)) {
+ prop = sym_get_default_prop(sym);
+ if (prop)
+ newval.tri = expr_calc_value(prop->expr);
+ }
+ newval.tri = E_OR(E_AND(newval.tri, sym->visible), sym->rev_dep.tri);
+ } else if (!sym_is_choice(sym)) {
+ prop = sym_get_default_prop(sym);
+ if (prop) {
+ sym->flags |= SYMBOL_WRITE;
+ newval.tri = expr_calc_value(prop->expr);
+ }
+ }
+ if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
+ newval.tri = yes;
+ break;
+ case S_STRING:
+ case S_HEX:
+ case S_INT:
+ if (sym->visible != no) {
+ sym->flags |= SYMBOL_WRITE;
+ if (sym_has_value(sym)) {
+ newval.val = sym->user.val;
+ break;
+ }
+ }
+ prop = sym_get_default_prop(sym);
+ if (prop) {
+ struct symbol *ds = prop_get_symbol(prop);
+ if (ds) {
+ sym->flags |= SYMBOL_WRITE;
+ sym_calc_value(ds);
+ newval.val = ds->curr.val;
+ }
+ }
+ break;
+ default:
+ ;
+ }
+
+ sym->curr = newval;
+ if (sym_is_choice(sym) && newval.tri == yes)
+ sym->curr.val = sym_calc_choice(sym);
+
+ if (memcmp(&oldval, &sym->curr, sizeof(oldval)))
+ sym_set_changed(sym);
+ if (modules_sym == sym)
+ modules_val = modules_sym->curr.tri;
+
+ if (sym_is_choice(sym)) {
+ int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE);
+ prop = sym_get_choice_prop(sym);
+ for (e = prop->expr; e; e = e->left.expr) {
+ e->right.sym->flags |= flags;
+ if (flags & SYMBOL_CHANGED)
+ sym_set_changed(e->right.sym);
+ }
+ }
+}
+
+void sym_clear_all_valid(void)
+{
+ struct symbol *sym;
+ int i;
+
+ for_all_symbols(i, sym)
+ sym->flags &= ~SYMBOL_VALID;
+ sym_change_count++;
+ if (modules_sym)
+ sym_calc_value(modules_sym);
+}
+
+void sym_set_changed(struct symbol *sym)
+{
+ struct property *prop;
+
+ sym->flags |= SYMBOL_CHANGED;
+ for (prop = sym->prop; prop; prop = prop->next) {
+ if (prop->menu)
+ prop->menu->flags |= MENU_CHANGED;
+ }
+}
+
+void sym_set_all_changed(void)
+{
+ struct symbol *sym;
+ int i;
+
+ for_all_symbols(i, sym)
+ sym_set_changed(sym);
+}
+
+bool sym_tristate_within_range(struct symbol *sym, tristate val)
+{
+ int type = sym_get_type(sym);
+
+ if (sym->visible == no)
+ return false;
+
+ if (type != S_BOOLEAN && type != S_TRISTATE)
+ return false;
+
+ if (type == S_BOOLEAN && val == mod)
+ return false;
+ if (sym->visible <= sym->rev_dep.tri)
+ return false;
+ if (sym_is_choice_value(sym) && sym->visible == yes)
+ return val == yes;
+ return val >= sym->rev_dep.tri && val <= sym->visible;
+}
+
+bool sym_set_tristate_value(struct symbol *sym, tristate val)
+{
+ tristate oldval = sym_get_tristate_value(sym);
+
+ if (oldval != val && !sym_tristate_within_range(sym, val))
+ return false;
+
+ if (sym->flags & SYMBOL_NEW) {
+ sym->flags &= ~SYMBOL_NEW;
+ sym_set_changed(sym);
+ }
+ if (sym_is_choice_value(sym) && val == yes) {
+ struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
+
+ cs->user.val = sym;
+ cs->flags &= ~SYMBOL_NEW;
+ }
+
+ sym->user.tri = val;
+ if (oldval != val) {
+ sym_clear_all_valid();
+ if (sym == modules_sym)
+ sym_set_all_changed();
+ }
+
+ return true;
+}
+
+tristate sym_toggle_tristate_value(struct symbol *sym)
+{
+ tristate oldval, newval;
+
+ oldval = newval = sym_get_tristate_value(sym);
+ do {
+ switch (newval) {
+ case no:
+ newval = mod;
+ break;
+ case mod:
+ newval = yes;
+ break;
+ case yes:
+ newval = no;
+ break;
+ }
+ if (sym_set_tristate_value(sym, newval))
+ break;
+ } while (oldval != newval);
+ return newval;
+}
+
+bool sym_string_valid(struct symbol *sym, const char *str)
+{
+ char ch;
+
+ switch (sym->type) {
+ case S_STRING:
+ return true;
+ case S_INT:
+ ch = *str++;
+ if (ch == '-')
+ ch = *str++;
+ if (!isdigit(ch))
+ return false;
+ if (ch == '0' && *str != 0)
+ return false;
+ while ((ch = *str++)) {
+ if (!isdigit(ch))
+ return false;
+ }
+ return true;
+ case S_HEX:
+ if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))
+ str += 2;
+ ch = *str++;
+ do {
+ if (!isxdigit(ch))
+ return false;
+ } while ((ch = *str++));
+ return true;
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ switch (str[0]) {
+ case 'y': case 'Y':
+ case 'm': case 'M':
+ case 'n': case 'N':
+ return true;
+ }
+ return false;
+ default:
+ return false;
+ }
+}
+
+bool sym_string_within_range(struct symbol *sym, const char *str)
+{
+ struct property *prop;
+ int val;
+
+ switch (sym->type) {
+ case S_STRING:
+ return sym_string_valid(sym, str);
+ case S_INT:
+ if (!sym_string_valid(sym, str))
+ return false;
+ prop = sym_get_range_prop(sym);
+ if (!prop)
+ return true;
+ val = strtol(str, NULL, 10);
+ return val >= strtol(prop->expr->left.sym->name, NULL, 10) &&
+ val <= strtol(prop->expr->right.sym->name, NULL, 10);
+ case S_HEX:
+ if (!sym_string_valid(sym, str))
+ return false;
+ prop = sym_get_range_prop(sym);
+ if (!prop)
+ return true;
+ val = strtol(str, NULL, 16);
+ return val >= strtol(prop->expr->left.sym->name, NULL, 16) &&
+ val <= strtol(prop->expr->right.sym->name, NULL, 16);
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ switch (str[0]) {
+ case 'y': case 'Y':
+ return sym_tristate_within_range(sym, yes);
+ case 'm': case 'M':
+ return sym_tristate_within_range(sym, mod);
+ case 'n': case 'N':
+ return sym_tristate_within_range(sym, no);
+ }
+ return false;
+ default:
+ return false;
+ }
+}
+
+bool sym_set_string_value(struct symbol *sym, const char *newval)
+{
+ const char *oldval;
+ char *val;
+ int size;
+
+ switch (sym->type) {
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ switch (newval[0]) {
+ case 'y': case 'Y':
+ return sym_set_tristate_value(sym, yes);
+ case 'm': case 'M':
+ return sym_set_tristate_value(sym, mod);
+ case 'n': case 'N':
+ return sym_set_tristate_value(sym, no);
+ }
+ return false;
+ default:
+ ;
+ }
+
+ if (!sym_string_within_range(sym, newval))
+ return false;
+
+ if (sym->flags & SYMBOL_NEW) {
+ sym->flags &= ~SYMBOL_NEW;
+ sym_set_changed(sym);
+ }
+
+ oldval = sym->user.val;
+ size = strlen(newval) + 1;
+ if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) {
+ size += 2;
+ sym->user.val = val = malloc(size);
+ *val++ = '0';
+ *val++ = 'x';
+ } else if (!oldval || strcmp(oldval, newval))
+ sym->user.val = val = malloc(size);
+ else
+ return true;
+
+ strcpy(val, newval);
+ free((void *)oldval);
+ sym_clear_all_valid();
+
+ return true;
+}
+
+const char *sym_get_string_value(struct symbol *sym)
+{
+ tristate val;
+
+ switch (sym->type) {
+ case S_BOOLEAN:
+ case S_TRISTATE:
+ val = sym_get_tristate_value(sym);
+ switch (val) {
+ case no:
+ return "n";
+ case mod:
+ return "m";
+ case yes:
+ return "y";
+ }
+ break;
+ default:
+ ;
+ }
+ return (const char *)sym->curr.val;
+}
+
+bool sym_is_changable(struct symbol *sym)
+{
+ return sym->visible > sym->rev_dep.tri;
+}
+
+struct symbol *sym_lookup(const char *name, int isconst)
+{
+ struct symbol *symbol;
+ const char *ptr;
+ char *new_name;
+ int hash = 0;
+
+ if (name) {
+ if (name[0] && !name[1]) {
+ switch (name[0]) {
+ case 'y': return &symbol_yes;
+ case 'm': return &symbol_mod;
+ case 'n': return &symbol_no;
+ }
+ }
+ for (ptr = name; *ptr; ptr++)
+ hash += *ptr;
+ hash &= 0xff;
+
+ for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
+ if (!strcmp(symbol->name, name)) {
+ if ((isconst && symbol->flags & SYMBOL_CONST) ||
+ (!isconst && !(symbol->flags & SYMBOL_CONST)))
+ return symbol;
+ }
+ }
+ new_name = strdup(name);
+ } else {
+ new_name = NULL;
+ hash = 256;
+ }
+
+ symbol = malloc(sizeof(*symbol));
+ memset(symbol, 0, sizeof(*symbol));
+ symbol->name = new_name;
+ symbol->type = S_UNKNOWN;
+ symbol->flags = SYMBOL_NEW;
+ if (isconst)
+ symbol->flags |= SYMBOL_CONST;
+
+ symbol->next = symbol_hash[hash];
+ symbol_hash[hash] = symbol;
+
+ return symbol;
+}
+
+struct symbol *sym_find(const char *name)
+{
+ struct symbol *symbol = NULL;
+ const char *ptr;
+ int hash = 0;
+
+ if (!name)
+ return NULL;
+
+ if (name[0] && !name[1]) {
+ switch (name[0]) {
+ case 'y': return &symbol_yes;
+ case 'm': return &symbol_mod;
+ case 'n': return &symbol_no;
+ }
+ }
+ for (ptr = name; *ptr; ptr++)
+ hash += *ptr;
+ hash &= 0xff;
+
+ for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
+ if (!strcmp(symbol->name, name) &&
+ !(symbol->flags & SYMBOL_CONST))
+ break;
+ }
+
+ return symbol;
+}
+
+struct symbol *sym_check_deps(struct symbol *sym);
+
+static struct symbol *sym_check_expr_deps(struct expr *e)
+{
+ struct symbol *sym;
+
+ if (!e)
+ return NULL;
+ switch (e->type) {
+ case E_OR:
+ case E_AND:
+ sym = sym_check_expr_deps(e->left.expr);
+ if (sym)
+ return sym;
+ return sym_check_expr_deps(e->right.expr);
+ case E_NOT:
+ return sym_check_expr_deps(e->left.expr);
+ case E_EQUAL:
+ case E_UNEQUAL:
+ sym = sym_check_deps(e->left.sym);
+ if (sym)
+ return sym;
+ return sym_check_deps(e->right.sym);
+ case E_SYMBOL:
+ return sym_check_deps(e->left.sym);
+ default:
+ break;
+ }
+ printf("Oops! How to check %d?\n", e->type);
+ return NULL;
+}
+
+struct symbol *sym_check_deps(struct symbol *sym)
+{
+ struct symbol *sym2;
+ struct property *prop;
+
+ if (sym->flags & SYMBOL_CHECK_DONE)
+ return NULL;
+ if (sym->flags & SYMBOL_CHECK) {
+ printf("Warning! Found recursive dependency: %s", sym->name);
+ return sym;
+ }
+
+ sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED);
+ sym2 = sym_check_expr_deps(sym->rev_dep.expr);
+ if (sym2)
+ goto out;
+
+ for (prop = sym->prop; prop; prop = prop->next) {
+ if (prop->type == P_CHOICE || prop->type == P_SELECT || prop->type == P_SELECTNOT)
+ continue;
+ sym2 = sym_check_expr_deps(prop->visible.expr);
+ if (sym2)
+ goto out;
+ if (prop->type != P_DEFAULT || sym_is_choice(sym))
+ continue;
+ sym2 = sym_check_expr_deps(prop->expr);
+ if (sym2)
+ goto out;
+ }
+out:
+ if (sym2)
+ printf(" %s", sym->name);
+ sym->flags &= ~SYMBOL_CHECK;
+ return sym2;
+}
+
+struct property *prop_alloc(enum prop_type type, struct symbol *sym)
+{
+ struct property *prop;
+ struct property **propp;
+
+ prop = malloc(sizeof(*prop));
+ memset(prop, 0, sizeof(*prop));
+ prop->type = type;
+ prop->sym = sym;
+ prop->file = current_file;
+ prop->lineno = zconf_lineno();
+
+ /* append property to the prop list of symbol */
+ if (sym) {
+ for (propp = &sym->prop; *propp; propp = &(*propp)->next)
+ ;
+ *propp = prop;
+ }
+
+ return prop;
+}
+
+struct symbol *prop_get_symbol(struct property *prop)
+{
+ if (prop->expr && (prop->expr->type == E_SYMBOL ||
+ prop->expr->type == E_CHOICE))
+ return prop->expr->left.sym;
+ return NULL;
+}
+
+const char *prop_get_type_name(enum prop_type type)
+{
+ switch (type) {
+ case P_PROMPT:
+ return "prompt";
+ case P_COMMENT:
+ return "comment";
+ case P_MENU:
+ return "menu";
+ case P_DEFAULT:
+ return "default";
+ case P_CHOICE:
+ return "choice";
+ case P_SELECT:
+ case P_SELECTNOT:
+ return "select";
+ case P_RANGE:
+ return "range";
+ case P_UNKNOWN:
+ break;
+ }
+ return "unknown";
+}
diff --git a/config/textbox.c b/config/textbox.c
new file mode 100644
index 000000000..a5a460b5c
--- /dev/null
+++ b/config/textbox.c
@@ -0,0 +1,556 @@
+/*
+ * textbox.c -- implements the text box
+ *
+ * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dialog.h"
+
+static void back_lines (int n);
+static void print_page (WINDOW * win, int height, int width);
+static void print_line (WINDOW * win, int row, int width);
+static char *get_line (void);
+static void print_position (WINDOW * win, int height, int width);
+
+static int hscroll, fd, file_size, bytes_read;
+static int begin_reached = 1, end_reached, page_length;
+static char *buf, *page;
+
+/*
+ * Display text from a file in a dialog box.
+ */
+int
+dialog_textbox (const char *title, const char *file, int height, int width)
+{
+ int i, x, y, cur_x, cur_y, fpos, key = 0;
+ int passed_end;
+ char search_term[MAX_LEN + 1];
+ WINDOW *dialog, *text;
+
+ search_term[0] = '\0'; /* no search term entered yet */
+
+ /* Open input file for reading */
+ if ((fd = open (file, O_RDONLY)) == -1) {
+ endwin ();
+ fprintf (stderr,
+ "\nCan't open input file in dialog_textbox().\n");
+ exit (-1);
+ }
+ /* Get file size. Actually, 'file_size' is the real file size - 1,
+ since it's only the last byte offset from the beginning */
+ if ((file_size = lseek (fd, 0, SEEK_END)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError getting file size in dialog_textbox().\n");
+ exit (-1);
+ }
+ /* Restore file pointer to beginning of file after getting file size */
+ if (lseek (fd, 0, SEEK_SET) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer in dialog_textbox().\n");
+ exit (-1);
+ }
+ /* Allocate space for read buffer */
+ if ((buf = malloc (BUF_SIZE + 1)) == NULL) {
+ endwin ();
+ fprintf (stderr, "\nCan't allocate memory in dialog_textbox().\n");
+ exit (-1);
+ }
+ if ((bytes_read = read (fd, buf, BUF_SIZE)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError reading file in dialog_textbox().\n");
+ exit (-1);
+ }
+ buf[bytes_read] = '\0'; /* mark end of valid data */
+ page = buf; /* page is pointer to start of page to be displayed */
+
+ /* center dialog box on screen */
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+
+ draw_shadow (stdscr, y, x, height, width);
+
+ dialog = newwin (height, width, y, x);
+ keypad (dialog, TRUE);
+
+ /* Create window for text region, used for scrolling text */
+ text = subwin (dialog, height - 4, width - 2, y + 1, x + 1);
+ wattrset (text, dialog_attr);
+ wbkgdset (text, dialog_attr & A_COLOR);
+
+ keypad (text, TRUE);
+
+ /* register the new window, along with its borders */
+ draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
+
+ wattrset (dialog, border_attr);
+ mvwaddch (dialog, height-3, 0, ACS_LTEE);
+ for (i = 0; i < width - 2; i++)
+ waddch (dialog, ACS_HLINE);
+ wattrset (dialog, dialog_attr);
+ wbkgdset (dialog, dialog_attr & A_COLOR);
+ waddch (dialog, ACS_RTEE);
+
+ if (title != NULL && strlen(title) >= width-2 ) {
+ /* truncate long title -- mec */
+ char * title2 = malloc(width-2+1);
+ memcpy( title2, title, width-2 );
+ title2[width-2] = '\0';
+ title = title2;
+ }
+
+ if (title != NULL) {
+ wattrset (dialog, title_attr);
+ mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
+ waddstr (dialog, (char *)title);
+ waddch (dialog, ' ');
+ }
+ print_button (dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
+ wnoutrefresh (dialog);
+ getyx (dialog, cur_y, cur_x); /* Save cursor position */
+
+ /* Print first page of text */
+ attr_clear (text, height - 4, width - 2, dialog_attr);
+ print_page (text, height - 4, width - 2);
+ print_position (dialog, height, width);
+ wmove (dialog, cur_y, cur_x); /* Restore cursor position */
+ wrefresh (dialog);
+
+ while ((key != ESC) && (key != '\n')) {
+ key = wgetch (dialog);
+ switch (key) {
+ case 'E': /* Exit */
+ case 'e':
+ case 'X':
+ case 'x':
+ delwin (dialog);
+ free (buf);
+ close (fd);
+ return 0;
+ case 'g': /* First page */
+ case KEY_HOME:
+ if (!begin_reached) {
+ begin_reached = 1;
+ /* First page not in buffer? */
+ if ((fpos = lseek (fd, 0, SEEK_CUR)) == -1) {
+ endwin ();
+ fprintf (stderr,
+ "\nError moving file pointer in dialog_textbox().\n");
+ exit (-1);
+ }
+ if (fpos > bytes_read) { /* Yes, we have to read it in */
+ if (lseek (fd, 0, SEEK_SET) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer in "
+ "dialog_textbox().\n");
+ exit (-1);
+ }
+ if ((bytes_read = read (fd, buf, BUF_SIZE)) == -1) {
+ endwin ();
+ fprintf (stderr,
+ "\nError reading file in dialog_textbox().\n");
+ exit (-1);
+ }
+ buf[bytes_read] = '\0';
+ }
+ page = buf;
+ print_page (text, height - 4, width - 2);
+ print_position (dialog, height, width);
+ wmove (dialog, cur_y, cur_x); /* Restore cursor position */
+ wrefresh (dialog);
+ }
+ break;
+ case 'G': /* Last page */
+ case KEY_END:
+
+ end_reached = 1;
+ /* Last page not in buffer? */
+ if ((fpos = lseek (fd, 0, SEEK_CUR)) == -1) {
+ endwin ();
+ fprintf (stderr,
+ "\nError moving file pointer in dialog_textbox().\n");
+ exit (-1);
+ }
+ if (fpos < file_size) { /* Yes, we have to read it in */
+ if (lseek (fd, -BUF_SIZE, SEEK_END) == -1) {
+ endwin ();
+ fprintf (stderr,
+ "\nError moving file pointer in dialog_textbox().\n");
+ exit (-1);
+ }
+ if ((bytes_read = read (fd, buf, BUF_SIZE)) == -1) {
+ endwin ();
+ fprintf (stderr,
+ "\nError reading file in dialog_textbox().\n");
+ exit (-1);
+ }
+ buf[bytes_read] = '\0';
+ }
+ page = buf + bytes_read;
+ back_lines (height - 4);
+ print_page (text, height - 4, width - 2);
+ print_position (dialog, height, width);
+ wmove (dialog, cur_y, cur_x); /* Restore cursor position */
+ wrefresh (dialog);
+ break;
+ case 'K': /* Previous line */
+ case 'k':
+ case KEY_UP:
+ if (!begin_reached) {
+ back_lines (page_length + 1);
+
+ /* We don't call print_page() here but use scrolling to ensure
+ faster screen update. However, 'end_reached' and
+ 'page_length' should still be updated, and 'page' should
+ point to start of next page. This is done by calling
+ get_line() in the following 'for' loop. */
+ scrollok (text, TRUE);
+ wscrl (text, -1); /* Scroll text region down one line */
+ scrollok (text, FALSE);
+ page_length = 0;
+ passed_end = 0;
+ for (i = 0; i < height - 4; i++) {
+ if (!i) {
+ /* print first line of page */
+ print_line (text, 0, width - 2);
+ wnoutrefresh (text);
+ } else
+ /* Called to update 'end_reached' and 'page' */
+ get_line ();
+ if (!passed_end)
+ page_length++;
+ if (end_reached && !passed_end)
+ passed_end = 1;
+ }
+
+ print_position (dialog, height, width);
+ wmove (dialog, cur_y, cur_x); /* Restore cursor position */
+ wrefresh (dialog);
+ }
+ break;
+ case 'B': /* Previous page */
+ case 'b':
+ case KEY_PPAGE:
+ if (begin_reached)
+ break;
+ back_lines (page_length + height - 4);
+ print_page (text, height - 4, width - 2);
+ print_position (dialog, height, width);
+ wmove (dialog, cur_y, cur_x);
+ wrefresh (dialog);
+ break;
+ case 'J': /* Next line */
+ case 'j':
+ case KEY_DOWN:
+ if (!end_reached) {
+ begin_reached = 0;
+ scrollok (text, TRUE);
+ scroll (text); /* Scroll text region up one line */
+ scrollok (text, FALSE);
+ print_line (text, height - 5, width - 2);
+ wnoutrefresh (text);
+ print_position (dialog, height, width);
+ wmove (dialog, cur_y, cur_x); /* Restore cursor position */
+ wrefresh (dialog);
+ }
+ break;
+ case KEY_NPAGE: /* Next page */
+ case ' ':
+ if (end_reached)
+ break;
+
+ begin_reached = 0;
+ print_page (text, height - 4, width - 2);
+ print_position (dialog, height, width);
+ wmove (dialog, cur_y, cur_x);
+ wrefresh (dialog);
+ break;
+ case '0': /* Beginning of line */
+ case 'H': /* Scroll left */
+ case 'h':
+ case KEY_LEFT:
+ if (hscroll <= 0)
+ break;
+
+ if (key == '0')
+ hscroll = 0;
+ else
+ hscroll--;
+ /* Reprint current page to scroll horizontally */
+ back_lines (page_length);
+ print_page (text, height - 4, width - 2);
+ wmove (dialog, cur_y, cur_x);
+ wrefresh (dialog);
+ break;
+ case 'L': /* Scroll right */
+ case 'l':
+ case KEY_RIGHT:
+ if (hscroll >= MAX_LEN)
+ break;
+ hscroll++;
+ /* Reprint current page to scroll horizontally */
+ back_lines (page_length);
+ print_page (text, height - 4, width - 2);
+ wmove (dialog, cur_y, cur_x);
+ wrefresh (dialog);
+ break;
+ case ESC:
+ break;
+ }
+ }
+
+ delwin (dialog);
+ free (buf);
+ close (fd);
+ return 1; /* ESC pressed */
+}
+
+/*
+ * Go back 'n' lines in text file. Called by dialog_textbox().
+ * 'page' will be updated to point to the desired line in 'buf'.
+ */
+static void
+back_lines (int n)
+{
+ int i, fpos;
+
+ begin_reached = 0;
+ /* We have to distinguish between end_reached and !end_reached
+ since at end of file, the line is not ended by a '\n'.
+ The code inside 'if' basically does a '--page' to move one
+ character backward so as to skip '\n' of the previous line */
+ if (!end_reached) {
+ /* Either beginning of buffer or beginning of file reached? */
+ if (page == buf) {
+ if ((fpos = lseek (fd, 0, SEEK_CUR)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer in "
+ "back_lines().\n");
+ exit (-1);
+ }
+ if (fpos > bytes_read) { /* Not beginning of file yet */
+ /* We've reached beginning of buffer, but not beginning of
+ file yet, so read previous part of file into buffer.
+ Note that we only move backward for BUF_SIZE/2 bytes,
+ but not BUF_SIZE bytes to avoid re-reading again in
+ print_page() later */
+ /* Really possible to move backward BUF_SIZE/2 bytes? */
+ if (fpos < BUF_SIZE / 2 + bytes_read) {
+ /* No, move less then */
+ if (lseek (fd, 0, SEEK_SET) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer in "
+ "back_lines().\n");
+ exit (-1);
+ }
+ page = buf + fpos - bytes_read;
+ } else { /* Move backward BUF_SIZE/2 bytes */
+ if (lseek (fd, -(BUF_SIZE / 2 + bytes_read), SEEK_CUR)
+ == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer "
+ "in back_lines().\n");
+ exit (-1);
+ }
+ page = buf + BUF_SIZE / 2;
+ }
+ if ((bytes_read = read (fd, buf, BUF_SIZE)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError reading file in back_lines().\n");
+ exit (-1);
+ }
+ buf[bytes_read] = '\0';
+ } else { /* Beginning of file reached */
+ begin_reached = 1;
+ return;
+ }
+ }
+ if (*(--page) != '\n') { /* '--page' here */
+ /* Something's wrong... */
+ endwin ();
+ fprintf (stderr, "\nInternal error in back_lines().\n");
+ exit (-1);
+ }
+ }
+ /* Go back 'n' lines */
+ for (i = 0; i < n; i++)
+ do {
+ if (page == buf) {
+ if ((fpos = lseek (fd, 0, SEEK_CUR)) == -1) {
+ endwin ();
+ fprintf (stderr,
+ "\nError moving file pointer in back_lines().\n");
+ exit (-1);
+ }
+ if (fpos > bytes_read) {
+ /* Really possible to move backward BUF_SIZE/2 bytes? */
+ if (fpos < BUF_SIZE / 2 + bytes_read) {
+ /* No, move less then */
+ if (lseek (fd, 0, SEEK_SET) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer "
+ "in back_lines().\n");
+ exit (-1);
+ }
+ page = buf + fpos - bytes_read;
+ } else { /* Move backward BUF_SIZE/2 bytes */
+ if (lseek (fd, -(BUF_SIZE / 2 + bytes_read),
+ SEEK_CUR) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer"
+ " in back_lines().\n");
+ exit (-1);
+ }
+ page = buf + BUF_SIZE / 2;
+ }
+ if ((bytes_read = read (fd, buf, BUF_SIZE)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError reading file in "
+ "back_lines().\n");
+ exit (-1);
+ }
+ buf[bytes_read] = '\0';
+ } else { /* Beginning of file reached */
+ begin_reached = 1;
+ return;
+ }
+ }
+ } while (*(--page) != '\n');
+ page++;
+}
+
+/*
+ * Print a new page of text. Called by dialog_textbox().
+ */
+static void
+print_page (WINDOW * win, int height, int width)
+{
+ int i, passed_end = 0;
+
+ page_length = 0;
+ for (i = 0; i < height; i++) {
+ print_line (win, i, width);
+ if (!passed_end)
+ page_length++;
+ if (end_reached && !passed_end)
+ passed_end = 1;
+ }
+ wnoutrefresh (win);
+}
+
+/*
+ * Print a new line of text. Called by dialog_textbox() and print_page().
+ */
+static void
+print_line (WINDOW * win, int row, int width)
+{
+ int y, x;
+ char *line;
+
+ line = get_line ();
+ line += MIN (strlen (line), hscroll); /* Scroll horizontally */
+ wmove (win, row, 0); /* move cursor to correct line */
+ waddch (win, ' ');
+ waddnstr (win, line, MIN (strlen (line), width - 2));
+
+ getyx (win, y, x);
+ /* Clear 'residue' of previous line */
+#if OLD_NCURSES
+ {
+ int i;
+ for (i = 0; i < width - x; i++)
+ waddch (win, ' ');
+ }
+#else
+ wclrtoeol(win);
+#endif
+}
+
+/*
+ * Return current line of text. Called by dialog_textbox() and print_line().
+ * 'page' should point to start of current line before calling, and will be
+ * updated to point to start of next line.
+ */
+static char *
+get_line (void)
+{
+ int i = 0, fpos;
+ static char line[MAX_LEN + 1];
+
+ end_reached = 0;
+ while (*page != '\n') {
+ if (*page == '\0') {
+ /* Either end of file or end of buffer reached */
+ if ((fpos = lseek (fd, 0, SEEK_CUR)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer in "
+ "get_line().\n");
+ exit (-1);
+ }
+ if (fpos < file_size) { /* Not end of file yet */
+ /* We've reached end of buffer, but not end of file yet,
+ so read next part of file into buffer */
+ if ((bytes_read = read (fd, buf, BUF_SIZE)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError reading file in get_line().\n");
+ exit (-1);
+ }
+ buf[bytes_read] = '\0';
+ page = buf;
+ } else {
+ if (!end_reached)
+ end_reached = 1;
+ break;
+ }
+ } else if (i < MAX_LEN)
+ line[i++] = *(page++);
+ else {
+ /* Truncate lines longer than MAX_LEN characters */
+ if (i == MAX_LEN)
+ line[i++] = '\0';
+ page++;
+ }
+ }
+ if (i <= MAX_LEN)
+ line[i] = '\0';
+ if (!end_reached)
+ page++; /* move pass '\n' */
+
+ return line;
+}
+
+/*
+ * Print current position
+ */
+static void
+print_position (WINDOW * win, int height, int width)
+{
+ int fpos, percent;
+
+ if ((fpos = lseek (fd, 0, SEEK_CUR)) == -1) {
+ endwin ();
+ fprintf (stderr, "\nError moving file pointer in print_position().\n");
+ exit (-1);
+ }
+ wattrset (win, position_indicator_attr);
+ wbkgdset (win, position_indicator_attr & A_COLOR);
+ percent = !file_size ?
+ 100 : ((fpos - bytes_read + page - buf) * 100) / file_size;
+ wmove (win, height - 3, width - 9);
+ wprintw (win, "(%3d%%)", percent);
+}
diff --git a/config/util.c b/config/util.c
new file mode 100644
index 000000000..0a2f82757
--- /dev/null
+++ b/config/util.c
@@ -0,0 +1,375 @@
+/*
+ * util.c
+ *
+ * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dialog.h"
+
+
+/* use colors by default? */
+bool use_colors = 1;
+
+char *backtitle = NULL;
+
+const char *dialog_result;
+
+/*
+ * Attribute values, default is for mono display
+ */
+chtype attributes[] =
+{
+ A_NORMAL, /* screen_attr */
+ A_NORMAL, /* shadow_attr */
+ A_NORMAL, /* dialog_attr */
+ A_BOLD, /* title_attr */
+ A_NORMAL, /* border_attr */
+ A_REVERSE, /* button_active_attr */
+ A_DIM, /* button_inactive_attr */
+ A_REVERSE, /* button_key_active_attr */
+ A_BOLD, /* button_key_inactive_attr */
+ A_REVERSE, /* button_label_active_attr */
+ A_NORMAL, /* button_label_inactive_attr */
+ A_NORMAL, /* inputbox_attr */
+ A_NORMAL, /* inputbox_border_attr */
+ A_NORMAL, /* searchbox_attr */
+ A_BOLD, /* searchbox_title_attr */
+ A_NORMAL, /* searchbox_border_attr */
+ A_BOLD, /* position_indicator_attr */
+ A_NORMAL, /* menubox_attr */
+ A_NORMAL, /* menubox_border_attr */
+ A_NORMAL, /* item_attr */
+ A_REVERSE, /* item_selected_attr */
+ A_BOLD, /* tag_attr */
+ A_REVERSE, /* tag_selected_attr */
+ A_BOLD, /* tag_key_attr */
+ A_REVERSE, /* tag_key_selected_attr */
+ A_BOLD, /* check_attr */
+ A_REVERSE, /* check_selected_attr */
+ A_BOLD, /* uarrow_attr */
+ A_BOLD /* darrow_attr */
+};
+
+
+#include "colors.h"
+
+/*
+ * Table of color values
+ */
+int color_table[][3] =
+{
+ {SCREEN_FG, SCREEN_BG, SCREEN_HL},
+ {SHADOW_FG, SHADOW_BG, SHADOW_HL},
+ {DIALOG_FG, DIALOG_BG, DIALOG_HL},
+ {TITLE_FG, TITLE_BG, TITLE_HL},
+ {BORDER_FG, BORDER_BG, BORDER_HL},
+ {BUTTON_ACTIVE_FG, BUTTON_ACTIVE_BG, BUTTON_ACTIVE_HL},
+ {BUTTON_INACTIVE_FG, BUTTON_INACTIVE_BG, BUTTON_INACTIVE_HL},
+ {BUTTON_KEY_ACTIVE_FG, BUTTON_KEY_ACTIVE_BG, BUTTON_KEY_ACTIVE_HL},
+ {BUTTON_KEY_INACTIVE_FG, BUTTON_KEY_INACTIVE_BG, BUTTON_KEY_INACTIVE_HL},
+ {BUTTON_LABEL_ACTIVE_FG, BUTTON_LABEL_ACTIVE_BG, BUTTON_LABEL_ACTIVE_HL},
+ {BUTTON_LABEL_INACTIVE_FG, BUTTON_LABEL_INACTIVE_BG,
+ BUTTON_LABEL_INACTIVE_HL},
+ {INPUTBOX_FG, INPUTBOX_BG, INPUTBOX_HL},
+ {INPUTBOX_BORDER_FG, INPUTBOX_BORDER_BG, INPUTBOX_BORDER_HL},
+ {SEARCHBOX_FG, SEARCHBOX_BG, SEARCHBOX_HL},
+ {SEARCHBOX_TITLE_FG, SEARCHBOX_TITLE_BG, SEARCHBOX_TITLE_HL},
+ {SEARCHBOX_BORDER_FG, SEARCHBOX_BORDER_BG, SEARCHBOX_BORDER_HL},
+ {POSITION_INDICATOR_FG, POSITION_INDICATOR_BG, POSITION_INDICATOR_HL},
+ {MENUBOX_FG, MENUBOX_BG, MENUBOX_HL},
+ {MENUBOX_BORDER_FG, MENUBOX_BORDER_BG, MENUBOX_BORDER_HL},
+ {ITEM_FG, ITEM_BG, ITEM_HL},
+ {ITEM_SELECTED_FG, ITEM_SELECTED_BG, ITEM_SELECTED_HL},
+ {TAG_FG, TAG_BG, TAG_HL},
+ {TAG_SELECTED_FG, TAG_SELECTED_BG, TAG_SELECTED_HL},
+ {TAG_KEY_FG, TAG_KEY_BG, TAG_KEY_HL},
+ {TAG_KEY_SELECTED_FG, TAG_KEY_SELECTED_BG, TAG_KEY_SELECTED_HL},
+ {CHECK_FG, CHECK_BG, CHECK_HL},
+ {CHECK_SELECTED_FG, CHECK_SELECTED_BG, CHECK_SELECTED_HL},
+ {UARROW_FG, UARROW_BG, UARROW_HL},
+ {DARROW_FG, DARROW_BG, DARROW_HL},
+}; /* color_table */
+
+/*
+ * Set window to attribute 'attr'
+ */
+void
+attr_clear (WINDOW * win, int height, int width, chtype attr)
+{
+ int i, j;
+
+ wattrset (win, attr);
+ for (i = 0; i < height; i++) {
+ wmove (win, i, 0);
+ for (j = 0; j < width; j++)
+ waddch (win, ' ');
+ }
+ touchwin (win);
+}
+
+void dialog_clear (void)
+{
+ attr_clear (stdscr, LINES, COLS, screen_attr);
+ /* Display background title if it exists ... - SLH */
+ if (backtitle != NULL) {
+ int i;
+
+ wattrset (stdscr, screen_attr);
+ mvwaddstr (stdscr, 0, 1, (char *)backtitle);
+ wmove (stdscr, 1, 1);
+ for (i = 1; i < COLS - 1; i++)
+ waddch (stdscr, ACS_HLINE);
+ }
+ wnoutrefresh (stdscr);
+}
+
+/*
+ * Do some initialization for dialog
+ */
+void
+init_dialog (void)
+{
+ initscr (); /* Init curses */
+ keypad (stdscr, TRUE);
+ cbreak ();
+ noecho ();
+
+
+ if (use_colors) /* Set up colors */
+ color_setup ();
+
+
+ dialog_clear ();
+}
+
+/*
+ * Setup for color display
+ */
+void
+color_setup (void)
+{
+ int i;
+
+ if (has_colors ()) { /* Terminal supports color? */
+ start_color ();
+
+ /* Initialize color pairs */
+ for (i = 0; i < ATTRIBUTE_COUNT; i++)
+ init_pair (i + 1, color_table[i][0], color_table[i][1]);
+
+ /* Setup color attributes */
+ for (i = 0; i < ATTRIBUTE_COUNT; i++)
+ attributes[i] = C_ATTR (color_table[i][2], i + 1);
+ }
+}
+
+/*
+ * End using dialog functions.
+ */
+void
+end_dialog (void)
+{
+ endwin ();
+}
+
+
+/*
+ * Print a string of text in a window, automatically wrap around to the
+ * next line if the string is too long to fit on one line. Newline
+ * characters '\n' are replaced by spaces. We start on a new line
+ * if there is no room for at least 4 nonblanks following a double-space.
+ */
+void
+print_autowrap (WINDOW * win, const char *prompt, int width, int y, int x)
+{
+ int newl, cur_x, cur_y;
+ int i, prompt_len, room, wlen;
+ char tempstr[MAX_LEN + 1], *word, *sp, *sp2;
+
+ strcpy (tempstr, prompt);
+
+ prompt_len = strlen(tempstr);
+
+ /*
+ * Remove newlines
+ */
+ for(i=0; i<prompt_len; i++) {
+ if(tempstr[i] == '\n') tempstr[i] = ' ';
+ }
+
+ if (prompt_len <= width - x * 2) { /* If prompt is short */
+ wmove (win, y, (width - prompt_len) / 2);
+ waddstr (win, tempstr);
+ } else {
+ cur_x = x;
+ cur_y = y;
+ newl = 1;
+ word = tempstr;
+ while (word && *word) {
+ sp = index(word, ' ');
+ if (sp)
+ *sp++ = 0;
+
+ /* Wrap to next line if either the word does not fit,
+ or it is the first word of a new sentence, and it is
+ short, and the next word does not fit. */
+ room = width - cur_x;
+ wlen = strlen(word);
+ if (wlen > room ||
+ (newl && wlen < 4 && sp && wlen+1+strlen(sp) > room
+ && (!(sp2 = index(sp, ' ')) || wlen+1+(sp2-sp) > room))) {
+ cur_y++;
+ cur_x = x;
+ }
+ wmove (win, cur_y, cur_x);
+ waddstr (win, word);
+ getyx (win, cur_y, cur_x);
+ cur_x++;
+ if (sp && *sp == ' ') {
+ cur_x++; /* double space */
+ while (*++sp == ' ');
+ newl = 1;
+ } else
+ newl = 0;
+ word = sp;
+ }
+ }
+}
+
+/*
+ * Print a button
+ */
+void
+print_button (WINDOW * win, const char *label, int y, int x, int selected)
+{
+ int i, temp;
+
+ wmove (win, y, x);
+ wattrset (win, selected ? button_active_attr : button_inactive_attr);
+ waddstr (win, "<");
+ temp = strspn (label, " ");
+ label += temp;
+ wattrset (win, selected ? button_label_active_attr
+ : button_label_inactive_attr);
+ for (i = 0; i < temp; i++)
+ waddch (win, ' ');
+ wattrset (win, selected ? button_key_active_attr
+ : button_key_inactive_attr);
+ waddch (win, label[0]);
+ wattrset (win, selected ? button_label_active_attr
+ : button_label_inactive_attr);
+ waddstr (win, (char *)label + 1);
+ wattrset (win, selected ? button_active_attr : button_inactive_attr);
+ waddstr (win, ">");
+ wmove (win, y, x + temp + 1);
+}
+
+/*
+ * Draw a rectangular box with line drawing characters
+ */
+void
+draw_box (WINDOW * win, int y, int x, int height, int width,
+ chtype box, chtype border)
+{
+ int i, j;
+
+ wattrset (win, 0);
+ for (i = 0; i < height; i++) {
+ wmove (win, y + i, x);
+ for (j = 0; j < width; j++)
+ if (!i && !j)
+ waddch (win, border | ACS_ULCORNER);
+ else if (i == height - 1 && !j)
+ waddch (win, border | ACS_LLCORNER);
+ else if (!i && j == width - 1)
+ waddch (win, box | ACS_URCORNER);
+ else if (i == height - 1 && j == width - 1)
+ waddch (win, box | ACS_LRCORNER);
+ else if (!i)
+ waddch (win, border | ACS_HLINE);
+ else if (i == height - 1)
+ waddch (win, box | ACS_HLINE);
+ else if (!j)
+ waddch (win, border | ACS_VLINE);
+ else if (j == width - 1)
+ waddch (win, box | ACS_VLINE);
+ else
+ waddch (win, box | ' ');
+ }
+}
+
+/*
+ * Draw shadows along the right and bottom edge to give a more 3D look
+ * to the boxes
+ */
+void
+draw_shadow (WINDOW * win, int y, int x, int height, int width)
+{
+ int i;
+
+ if (has_colors ()) { /* Whether terminal supports color? */
+ wattrset (win, shadow_attr);
+ wmove (win, y + height, x + 2);
+ for (i = 0; i < width; i++)
+ waddch (win, winch (win) & A_CHARTEXT);
+ for (i = y + 1; i < y + height + 1; i++) {
+ wmove (win, i, x + width);
+ waddch (win, winch (win) & A_CHARTEXT);
+ waddch (win, winch (win) & A_CHARTEXT);
+ }
+ wnoutrefresh (win);
+ }
+}
+
+/*
+ * Return the position of the first alphabetic character in a string.
+ */
+int
+first_alpha(const char *string, const char *exempt)
+{
+ int i, in_paren=0, c;
+
+ for (i = 0; i < strlen(string); i++) {
+ c = tolower(string[i]);
+
+ if (strchr("<[(", c)) ++in_paren;
+ if (strchr(">])", c) && in_paren > 0) --in_paren;
+
+ if ((! in_paren) && isalpha(c) &&
+ strchr(exempt, c) == 0)
+ return i;
+ }
+
+ return 0;
+}
+
+/*
+ * Get the first selected item in the dialog_list_item list.
+ */
+struct dialog_list_item *
+first_sel_item(int item_no, struct dialog_list_item ** items)
+{
+ int i;
+
+ for (i = 0; i < item_no; i++) {
+ if (items[i]->selected)
+ return items[i];
+ }
+
+ return NULL;
+}
diff --git a/config/yesno.c b/config/yesno.c
new file mode 100644
index 000000000..11fcc25f5
--- /dev/null
+++ b/config/yesno.c
@@ -0,0 +1,118 @@
+/*
+ * yesno.c -- implements the yes/no box
+ *
+ * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk)
+ * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "dialog.h"
+
+/*
+ * Display termination buttons
+ */
+static void
+print_buttons(WINDOW *dialog, int height, int width, int selected)
+{
+ int x = width / 2 - 10;
+ int y = height - 2;
+
+ print_button (dialog, " Yes ", y, x, selected == 0);
+ print_button (dialog, " No ", y, x + 13, selected == 1);
+
+ wmove(dialog, y, x+1 + 13*selected );
+ wrefresh (dialog);
+}
+
+/*
+ * Display a dialog box with two buttons - Yes and No
+ */
+int
+dialog_yesno (const char *title, const char *prompt, int height, int width)
+{
+ int i, x, y, key = 0, button = 0;
+ WINDOW *dialog;
+
+ /* center dialog box on screen */
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ draw_shadow (stdscr, y, x, height, width);
+
+ dialog = newwin (height, width, y, x);
+ keypad (dialog, TRUE);
+
+ draw_box (dialog, 0, 0, height, width, dialog_attr, border_attr);
+ wattrset (dialog, border_attr);
+ mvwaddch (dialog, height-3, 0, ACS_LTEE);
+ for (i = 0; i < width - 2; i++)
+ waddch (dialog, ACS_HLINE);
+ wattrset (dialog, dialog_attr);
+ waddch (dialog, ACS_RTEE);
+
+ if (title != NULL && strlen(title) >= width-2 ) {
+ /* truncate long title -- mec */
+ char * title2 = malloc(width-2+1);
+ memcpy( title2, title, width-2 );
+ title2[width-2] = '\0';
+ title = title2;
+ }
+
+ if (title != NULL) {
+ wattrset (dialog, title_attr);
+ mvwaddch (dialog, 0, (width - strlen(title))/2 - 1, ' ');
+ waddstr (dialog, (char *)title);
+ waddch (dialog, ' ');
+ }
+
+ wattrset (dialog, dialog_attr);
+ print_autowrap (dialog, prompt, width - 2, 1, 3);
+
+ print_buttons(dialog, height, width, 0);
+
+ while (key != ESC) {
+ key = wgetch (dialog);
+ switch (key) {
+ case 'Y':
+ case 'y':
+ delwin (dialog);
+ return 0;
+ case 'N':
+ case 'n':
+ delwin (dialog);
+ return 1;
+
+ case TAB:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ button = ((key == KEY_LEFT ? --button : ++button) < 0)
+ ? 1 : (button > 1 ? 0 : button);
+
+ print_buttons(dialog, height, width, button);
+ wrefresh (dialog);
+ break;
+ case ' ':
+ case '\n':
+ delwin (dialog);
+ return button;
+ case ESC:
+ break;
+ }
+ }
+
+ delwin (dialog);
+ return -1; /* ESC pressed */
+}
diff --git a/config/zconf.l b/config/zconf.l
new file mode 100644
index 000000000..3a4947a88
--- /dev/null
+++ b/config/zconf.l
@@ -0,0 +1,387 @@
+%option backup nostdinit noyywrap never-interactive full ecs
+%option 8bit backup nodefault perf-report perf-report
+%x COMMAND HELP STRING PARAM
+%{
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <glob.h>
+
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+
+#define START_STRSIZE 16
+
+char *text;
+static char *text_ptr;
+static int text_size, text_asize;
+
+struct buffer {
+ struct buffer *parent;
+ YY_BUFFER_STATE state;
+};
+
+struct buffer *current_buf;
+
+static int last_ts, first_ts;
+
+static void zconf_endhelp(void);
+static struct buffer *zconf_endfile(void);
+
+void new_string(void)
+{
+ text = malloc(START_STRSIZE);
+ text_asize = START_STRSIZE;
+ text_ptr = text;
+ text_size = 0;
+ *text_ptr = 0;
+}
+
+void append_string(const char *str, int size)
+{
+ int new_size = text_size + size + 1;
+ if (new_size > text_asize) {
+ text = realloc(text, new_size);
+ text_asize = new_size;
+ text_ptr = text + text_size;
+ }
+ memcpy(text_ptr, str, size);
+ text_ptr += size;
+ text_size += size;
+ *text_ptr = 0;
+}
+
+void alloc_string(const char *str, int size)
+{
+ text = malloc(size + 1);
+ memcpy(text, str, size);
+ text[size] = 0;
+}
+%}
+
+ws [ \n\t]
+n [A-Za-z0-9_]
+
+%%
+ int str = 0;
+ int ts, i;
+
+[ \t]*#.*\n current_file->lineno++;
+[ \t]*#.*
+
+[ \t]*\n current_file->lineno++; return T_EOL;
+
+[ \t]+ {
+ BEGIN(COMMAND);
+}
+
+. {
+ unput(yytext[0]);
+ BEGIN(COMMAND);
+}
+
+
+<COMMAND>{
+ "mainmenu" BEGIN(PARAM); return T_MAINMENU;
+ "menu" BEGIN(PARAM); return T_MENU;
+ "endmenu" BEGIN(PARAM); return T_ENDMENU;
+ "source" BEGIN(PARAM); return T_SOURCE;
+ "choice" BEGIN(PARAM); return T_CHOICE;
+ "endchoice" BEGIN(PARAM); return T_ENDCHOICE;
+ "comment" BEGIN(PARAM); return T_COMMENT;
+ "config" BEGIN(PARAM); return T_CONFIG;
+ "menuconfig" BEGIN(PARAM); return T_MENUCONFIG;
+ "help" BEGIN(PARAM); return T_HELP;
+ "if" BEGIN(PARAM); return T_IF;
+ "endif" BEGIN(PARAM); return T_ENDIF;
+ "depends" BEGIN(PARAM); return T_DEPENDS;
+ "requires" BEGIN(PARAM); return T_REQUIRES;
+ "optional" BEGIN(PARAM); return T_OPTIONAL;
+ "default" BEGIN(PARAM); return T_DEFAULT;
+ "prompt" BEGIN(PARAM); return T_PROMPT;
+ "tristate" BEGIN(PARAM); return T_TRISTATE;
+ "def_tristate" BEGIN(PARAM); return T_DEF_TRISTATE;
+ "bool" BEGIN(PARAM); return T_BOOLEAN;
+ "boolean" BEGIN(PARAM); return T_BOOLEAN;
+ "def_bool" BEGIN(PARAM); return T_DEF_BOOLEAN;
+ "def_boolean" BEGIN(PARAM); return T_DEF_BOOLEAN;
+ "int" BEGIN(PARAM); return T_INT;
+ "hex" BEGIN(PARAM); return T_HEX;
+ "string" BEGIN(PARAM); return T_STRING;
+ "select" BEGIN(PARAM); return T_SELECT;
+ "enable" BEGIN(PARAM); return T_SELECT;
+ "range" BEGIN(PARAM); return T_RANGE;
+ {n}+ {
+ alloc_string(yytext, yyleng);
+ zconflval.string = text;
+ return T_WORD;
+ }
+ .
+ \n current_file->lineno++; BEGIN(INITIAL);
+}
+
+<PARAM>{
+ "&&" return T_AND;
+ "||" return T_OR;
+ "(" return T_OPEN_PAREN;
+ ")" return T_CLOSE_PAREN;
+ "!" return T_NOT;
+ "=" return T_EQUAL;
+ "!=" return T_UNEQUAL;
+ "if" return T_IF;
+ "on" return T_ON;
+ \"|\' {
+ str = yytext[0];
+ new_string();
+ BEGIN(STRING);
+ }
+ \n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
+ --- /* ignore */
+ ({n}|[-/.])+ {
+ alloc_string(yytext, yyleng);
+ zconflval.string = text;
+ return T_WORD;
+ }
+ #.* /* comment */
+ \\\n current_file->lineno++;
+ .
+ <<EOF>> {
+ BEGIN(INITIAL);
+ }
+}
+
+<STRING>{
+ [^'"\\\n]+/\n {
+ append_string(yytext, yyleng);
+ zconflval.string = text;
+ return T_WORD_QUOTE;
+ }
+ [^'"\\\n]+ {
+ append_string(yytext, yyleng);
+ }
+ \\.?/\n {
+ append_string(yytext + 1, yyleng - 1);
+ zconflval.string = text;
+ return T_WORD_QUOTE;
+ }
+ \\.? {
+ append_string(yytext + 1, yyleng - 1);
+ }
+ \'|\" {
+ if (str == yytext[0]) {
+ BEGIN(PARAM);
+ zconflval.string = text;
+ return T_WORD_QUOTE;
+ } else
+ append_string(yytext, 1);
+ }
+ \n {
+ printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
+ current_file->lineno++;
+ BEGIN(INITIAL);
+ return T_EOL;
+ }
+ <<EOF>> {
+ BEGIN(INITIAL);
+ }
+}
+
+<HELP>{
+ [ \t]+ {
+ ts = 0;
+ for (i = 0; i < yyleng; i++) {
+ if (yytext[i] == '\t')
+ ts = (ts & ~7) + 8;
+ else
+ ts++;
+ }
+ last_ts = ts;
+ if (first_ts) {
+ if (ts < first_ts) {
+ zconf_endhelp();
+ return T_HELPTEXT;
+ }
+ ts -= first_ts;
+ while (ts > 8) {
+ append_string(" ", 8);
+ ts -= 8;
+ }
+ append_string(" ", ts);
+ }
+ }
+ [ \t]*\n/[^ \t\n] {
+ current_file->lineno++;
+ zconf_endhelp();
+ return T_HELPTEXT;
+ }
+ [ \t]*\n {
+ current_file->lineno++;
+ append_string("\n", 1);
+ }
+ [^ \t\n].* {
+ append_string(yytext, yyleng);
+ if (!first_ts)
+ first_ts = last_ts;
+ }
+ <<EOF>> {
+ zconf_endhelp();
+ return T_HELPTEXT;
+ }
+}
+
+<<EOF>> {
+ if (current_buf) {
+ zconf_endfile();
+ return T_EOF;
+ }
+ fclose(yyin);
+ yyterminate();
+}
+
+%%
+void zconf_starthelp(void)
+{
+ new_string();
+ last_ts = first_ts = 0;
+ BEGIN(HELP);
+}
+
+static void zconf_endhelp(void)
+{
+ zconflval.string = text;
+ BEGIN(INITIAL);
+}
+
+
+/*
+ * Try to open specified file with following names:
+ * ./name
+ * $(srctree)/name
+ * The latter is used when srctree is separate from objtree
+ * when compiling the kernel.
+ * Return NULL if file is not found.
+ */
+FILE *zconf_fopen(const char *name)
+{
+ char *env, fullname[PATH_MAX+1];
+ FILE *f;
+
+ f = fopen(name, "r");
+ if (!f && name[0] != '/') {
+ env = getenv(SRCTREE);
+ if (env) {
+ sprintf(fullname, "%s/%s", env, name);
+ f = fopen(fullname, "r");
+ }
+ }
+ return f;
+}
+
+void zconf_initscan(const char *name)
+{
+ yyin = zconf_fopen(name);
+ if (!yyin) {
+ printf("can't find file %s\n", name);
+ exit(1);
+ }
+
+ current_buf = malloc(sizeof(*current_buf));
+ memset(current_buf, 0, sizeof(*current_buf));
+
+ current_file = file_lookup(name);
+ current_file->lineno = 1;
+ current_file->flags = FILE_BUSY;
+}
+
+void zconf_nextfile(const char *name)
+{
+ size_t i;
+ int retval;
+ glob_t files;
+ char *filename;
+ struct file *file;
+ struct buffer *buf;
+
+ retval = glob(name, GLOB_ERR | GLOB_MARK, NULL, &files);
+ if (retval == GLOB_NOSPACE || retval == GLOB_ABORTED || retval == GLOB_NOMATCH) {
+ printf("%s:%d: glob failed: %s \"%s\"\n", zconf_curname(), zconf_lineno(),
+ retval == GLOB_NOSPACE ? "failed to allocate memory" :
+ retval == GLOB_ABORTED ? "read error" : "no match",
+ name);
+ exit(1);
+ }
+
+ for (i = files.gl_pathc-1; i != (size_t)-1; --i) {
+ filename = files.gl_pathv[i];
+
+ file = file_lookup(filename);
+ buf = malloc(sizeof(*buf));
+ memset(buf, 0, sizeof(*buf));
+ current_buf->state = YY_CURRENT_BUFFER;
+ zconfin = zconf_fopen(filename);
+ if (!zconfin) {
+ printf("%s:%d: can't open file \"%s\"\n",
+ zconf_curname(), zconf_lineno(), filename);
+ exit(1);
+ }
+ zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
+ buf->parent = current_buf;
+ current_buf = buf;
+
+ if (file->flags & FILE_BUSY) {
+ printf("recursive scan (%s)?\n", filename);
+ exit(1);
+ }
+ if (file->flags & FILE_SCANNED) {
+ printf("file %s already scanned?\n", filename);
+ exit(1);
+ }
+ file->flags |= FILE_BUSY;
+ file->lineno = 1;
+ file->parent = current_file;
+ current_file = file;
+ }
+}
+
+static struct buffer *zconf_endfile(void)
+{
+ struct buffer *parent;
+
+ current_file->flags |= FILE_SCANNED;
+ current_file->flags &= ~FILE_BUSY;
+ current_file = current_file->parent;
+
+ parent = current_buf->parent;
+ if (parent) {
+ fclose(yyin);
+ yy_delete_buffer(YY_CURRENT_BUFFER);
+ yy_switch_to_buffer(parent->state);
+ }
+ free(current_buf);
+ current_buf = parent;
+
+ return parent;
+}
+
+int zconf_lineno(void)
+{
+ if (current_buf)
+ return current_file->lineno - 1;
+ else
+ return 0;
+}
+
+char *zconf_curname(void)
+{
+ if (current_buf)
+ return current_file->name;
+ else
+ return "<none>";
+}
diff --git a/config/zconf.output b/config/zconf.output
new file mode 100644
index 000000000..a4d86e975
--- /dev/null
+++ b/config/zconf.output
@@ -0,0 +1,2133 @@
+State 52 conflicts: 1 shift/reduce
+State 53 conflicts: 1 shift/reduce
+State 54 conflicts: 1 shift/reduce
+State 55 conflicts: 10 shift/reduce
+State 56 conflicts: 12 shift/reduce
+State 57 conflicts: 1 shift/reduce
+State 58 conflicts: 13 shift/reduce
+State 59 conflicts: 1 shift/reduce
+
+
+Grammar
+
+ 0 $accept: input $end
+
+ 1 input: /* empty */
+ 2 | input block
+
+ 3 block: common_block
+ 4 | choice_stmt
+ 5 | menu_stmt
+ 6 | T_MAINMENU prompt nl_or_eof
+ 7 | T_ENDMENU
+ 8 | T_ENDIF
+ 9 | T_ENDCHOICE
+ 10 | error nl_or_eof
+
+ 11 common_block: if_stmt
+ 12 | comment_stmt
+ 13 | config_stmt
+ 14 | menuconfig_stmt
+ 15 | source_stmt
+ 16 | nl_or_eof
+
+ 17 config_entry_start: T_CONFIG T_WORD T_EOL
+
+ 18 config_stmt: config_entry_start config_option_list
+
+ 19 menuconfig_entry_start: T_MENUCONFIG T_WORD T_EOL
+
+ 20 menuconfig_stmt: menuconfig_entry_start config_option_list
+
+ 21 config_option_list: /* empty */
+ 22 | config_option_list config_option
+ 23 | config_option_list depends
+ 24 | config_option_list help
+ 25 | config_option_list T_EOL
+
+ 26 config_option: T_TRISTATE prompt_stmt_opt T_EOL
+ 27 | T_DEF_TRISTATE expr if_expr T_EOL
+ 28 | T_BOOLEAN prompt_stmt_opt T_EOL
+ 29 | T_DEF_BOOLEAN expr if_expr T_EOL
+ 30 | T_INT prompt_stmt_opt T_EOL
+ 31 | T_HEX prompt_stmt_opt T_EOL
+ 32 | T_STRING prompt_stmt_opt T_EOL
+ 33 | T_PROMPT prompt if_expr T_EOL
+ 34 | T_DEFAULT expr if_expr T_EOL
+ 35 | T_SELECT T_WORD if_expr T_EOL
+ 36 | T_SELECT T_NOT T_WORD if_expr T_EOL
+ 37 | T_RANGE symbol symbol if_expr T_EOL
+
+ 38 choice: T_CHOICE T_EOL
+
+ 39 choice_entry: choice choice_option_list
+
+ 40 choice_end: end
+
+ 41 choice_stmt: choice_entry choice_block choice_end
+ 42 | choice_entry choice_block
+
+ 43 choice_option_list: /* empty */
+ 44 | choice_option_list choice_option
+ 45 | choice_option_list depends
+ 46 | choice_option_list help
+ 47 | choice_option_list T_EOL
+
+ 48 choice_option: T_PROMPT prompt if_expr T_EOL
+ 49 | T_TRISTATE prompt_stmt_opt T_EOL
+ 50 | T_BOOLEAN prompt_stmt_opt T_EOL
+ 51 | T_OPTIONAL T_EOL
+ 52 | T_DEFAULT T_WORD if_expr T_EOL
+
+ 53 choice_block: /* empty */
+ 54 | choice_block common_block
+
+ 55 if: T_IF expr T_EOL
+
+ 56 if_end: end
+
+ 57 if_stmt: if if_block if_end
+ 58 | if if_block
+
+ 59 if_block: /* empty */
+ 60 | if_block common_block
+ 61 | if_block menu_stmt
+ 62 | if_block choice_stmt
+
+ 63 menu: T_MENU prompt T_EOL
+
+ 64 menu_entry: menu depends_list
+
+ 65 menu_end: end
+
+ 66 menu_stmt: menu_entry menu_block menu_end
+ 67 | menu_entry menu_block
+
+ 68 menu_block: /* empty */
+ 69 | menu_block common_block
+ 70 | menu_block menu_stmt
+ 71 | menu_block choice_stmt
+ 72 | menu_block error T_EOL
+
+ 73 source: T_SOURCE prompt T_EOL
+
+ 74 source_stmt: source
+
+ 75 comment: T_COMMENT prompt T_EOL
+
+ 76 comment_stmt: comment depends_list
+
+ 77 help_start: T_HELP T_EOL
+
+ 78 help: help_start T_HELPTEXT
+
+ 79 depends_list: /* empty */
+ 80 | depends_list depends
+ 81 | depends_list T_EOL
+
+ 82 depends: T_DEPENDS T_ON expr T_EOL
+ 83 | T_DEPENDS expr T_EOL
+ 84 | T_REQUIRES expr T_EOL
+
+ 85 prompt_stmt_opt: /* empty */
+ 86 | prompt if_expr
+
+ 87 prompt: T_WORD
+ 88 | T_WORD_QUOTE
+
+ 89 end: T_ENDMENU nl_or_eof
+ 90 | T_ENDCHOICE nl_or_eof
+ 91 | T_ENDIF nl_or_eof
+
+ 92 nl_or_eof: T_EOL
+ 93 | T_EOF
+
+ 94 if_expr: /* empty */
+ 95 | T_IF expr
+
+ 96 expr: symbol
+ 97 | symbol T_EQUAL symbol
+ 98 | symbol T_UNEQUAL symbol
+ 99 | T_OPEN_PAREN expr T_CLOSE_PAREN
+ 100 | T_NOT expr
+ 101 | expr T_OR expr
+ 102 | expr T_AND expr
+
+ 103 symbol: T_WORD
+ 104 | T_WORD_QUOTE
+
+
+Terminals, with rules where they appear
+
+$end (0) 0
+error (256) 10 72
+T_MAINMENU (258) 6
+T_MENU (259) 63
+T_ENDMENU (260) 7 89
+T_SOURCE (261) 73
+T_CHOICE (262) 38
+T_ENDCHOICE (263) 9 90
+T_COMMENT (264) 75
+T_CONFIG (265) 17
+T_MENUCONFIG (266) 19
+T_HELP (267) 77
+T_HELPTEXT (268) 78
+T_IF (269) 55 95
+T_ENDIF (270) 8 91
+T_DEPENDS (271) 82 83
+T_REQUIRES (272) 84
+T_OPTIONAL (273) 51
+T_PROMPT (274) 33 48
+T_DEFAULT (275) 34 52
+T_TRISTATE (276) 26 49
+T_DEF_TRISTATE (277) 27
+T_BOOLEAN (278) 28 50
+T_DEF_BOOLEAN (279) 29
+T_STRING (280) 32
+T_INT (281) 30
+T_HEX (282) 31
+T_WORD (283) 17 19 35 36 52 87 103
+T_WORD_QUOTE (284) 88 104
+T_UNEQUAL (285) 98
+T_EOF (286) 93
+T_EOL (287) 17 19 25 26 27 28 29 30 31 32 33 34 35 36 37 38 47 48 49
+ 50 51 52 55 63 72 73 75 77 81 82 83 84 92
+T_CLOSE_PAREN (288) 99
+T_OPEN_PAREN (289) 99
+T_ON (290) 82
+T_SELECT (291) 35 36
+T_RANGE (292) 37
+T_OR (293) 101
+T_AND (294) 102
+T_EQUAL (295) 97
+T_NOT (296) 36 100
+
+
+Nonterminals, with rules where they appear
+
+$accept (42)
+ on left: 0
+input (43)
+ on left: 1 2, on right: 0 2
+block (44)
+ on left: 3 4 5 6 7 8 9 10, on right: 2
+common_block (45)
+ on left: 11 12 13 14 15 16, on right: 3 54 60 69
+config_entry_start (46)
+ on left: 17, on right: 18
+config_stmt (47)
+ on left: 18, on right: 13
+menuconfig_entry_start (48)
+ on left: 19, on right: 20
+menuconfig_stmt (49)
+ on left: 20, on right: 14
+config_option_list (50)
+ on left: 21 22 23 24 25, on right: 18 20 22 23 24 25
+config_option (51)
+ on left: 26 27 28 29 30 31 32 33 34 35 36 37, on right: 22
+choice (52)
+ on left: 38, on right: 39
+choice_entry (53)
+ on left: 39, on right: 41 42
+choice_end (54)
+ on left: 40, on right: 41
+choice_stmt (55)
+ on left: 41 42, on right: 4 62 71
+choice_option_list (56)
+ on left: 43 44 45 46 47, on right: 39 44 45 46 47
+choice_option (57)
+ on left: 48 49 50 51 52, on right: 44
+choice_block (58)
+ on left: 53 54, on right: 41 42 54
+if (59)
+ on left: 55, on right: 57 58
+if_end (60)
+ on left: 56, on right: 57
+if_stmt (61)
+ on left: 57 58, on right: 11
+if_block (62)
+ on left: 59 60 61 62, on right: 57 58 60 61 62
+menu (63)
+ on left: 63, on right: 64
+menu_entry (64)
+ on left: 64, on right: 66 67
+menu_end (65)
+ on left: 65, on right: 66
+menu_stmt (66)
+ on left: 66 67, on right: 5 61 70
+menu_block (67)
+ on left: 68 69 70 71 72, on right: 66 67 69 70 71 72
+source (68)
+ on left: 73, on right: 74
+source_stmt (69)
+ on left: 74, on right: 15
+comment (70)
+ on left: 75, on right: 76
+comment_stmt (71)
+ on left: 76, on right: 12
+help_start (72)
+ on left: 77, on right: 78
+help (73)
+ on left: 78, on right: 24 46
+depends_list (74)
+ on left: 79 80 81, on right: 64 76 80 81
+depends (75)
+ on left: 82 83 84, on right: 23 45 80
+prompt_stmt_opt (76)
+ on left: 85 86, on right: 26 28 30 31 32 49 50
+prompt (77)
+ on left: 87 88, on right: 6 33 48 63 73 75 86
+end (78)
+ on left: 89 90 91, on right: 40 56 65
+nl_or_eof (79)
+ on left: 92 93, on right: 6 10 16 89 90 91
+if_expr (80)
+ on left: 94 95, on right: 27 29 33 34 35 36 37 48 52 86
+expr (81)
+ on left: 96 97 98 99 100 101 102, on right: 27 29 34 55 82 83 84
+ 95 99 100 101 102
+symbol (82)
+ on left: 103 104, on right: 37 96 97 98
+
+
+state 0
+
+ 0 $accept: . input $end
+
+ $default reduce using rule 1 (input)
+
+ input go to state 1
+
+
+state 1
+
+ 0 $accept: input . $end
+ 2 input: input . block
+
+ $end shift, and go to state 2
+ error shift, and go to state 3
+ T_MAINMENU shift, and go to state 4
+ T_MENU shift, and go to state 5
+ T_ENDMENU shift, and go to state 6
+ T_SOURCE shift, and go to state 7
+ T_CHOICE shift, and go to state 8
+ T_ENDCHOICE shift, and go to state 9
+ T_COMMENT shift, and go to state 10
+ T_CONFIG shift, and go to state 11
+ T_MENUCONFIG shift, and go to state 12
+ T_IF shift, and go to state 13
+ T_ENDIF shift, and go to state 14
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ block go to state 17
+ common_block go to state 18
+ config_entry_start go to state 19
+ config_stmt go to state 20
+ menuconfig_entry_start go to state 21
+ menuconfig_stmt go to state 22
+ choice go to state 23
+ choice_entry go to state 24
+ choice_stmt go to state 25
+ if go to state 26
+ if_stmt go to state 27
+ menu go to state 28
+ menu_entry go to state 29
+ menu_stmt go to state 30
+ source go to state 31
+ source_stmt go to state 32
+ comment go to state 33
+ comment_stmt go to state 34
+ nl_or_eof go to state 35
+
+
+state 2
+
+ 0 $accept: input $end .
+
+ $default accept
+
+
+state 3
+
+ 10 block: error . nl_or_eof
+
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ nl_or_eof go to state 36
+
+
+state 4
+
+ 6 block: T_MAINMENU . prompt nl_or_eof
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ prompt go to state 39
+
+
+state 5
+
+ 63 menu: T_MENU . prompt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ prompt go to state 40
+
+
+state 6
+
+ 7 block: T_ENDMENU .
+
+ $default reduce using rule 7 (block)
+
+
+state 7
+
+ 73 source: T_SOURCE . prompt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ prompt go to state 41
+
+
+state 8
+
+ 38 choice: T_CHOICE . T_EOL
+
+ T_EOL shift, and go to state 42
+
+
+state 9
+
+ 9 block: T_ENDCHOICE .
+
+ $default reduce using rule 9 (block)
+
+
+state 10
+
+ 75 comment: T_COMMENT . prompt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ prompt go to state 43
+
+
+state 11
+
+ 17 config_entry_start: T_CONFIG . T_WORD T_EOL
+
+ T_WORD shift, and go to state 44
+
+
+state 12
+
+ 19 menuconfig_entry_start: T_MENUCONFIG . T_WORD T_EOL
+
+ T_WORD shift, and go to state 45
+
+
+state 13
+
+ 55 if: T_IF . expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 50
+ symbol go to state 51
+
+
+state 14
+
+ 8 block: T_ENDIF .
+
+ $default reduce using rule 8 (block)
+
+
+state 15
+
+ 93 nl_or_eof: T_EOF .
+
+ $default reduce using rule 93 (nl_or_eof)
+
+
+state 16
+
+ 92 nl_or_eof: T_EOL .
+
+ $default reduce using rule 92 (nl_or_eof)
+
+
+state 17
+
+ 2 input: input block .
+
+ $default reduce using rule 2 (input)
+
+
+state 18
+
+ 3 block: common_block .
+
+ $default reduce using rule 3 (block)
+
+
+state 19
+
+ 18 config_stmt: config_entry_start . config_option_list
+
+ $default reduce using rule 21 (config_option_list)
+
+ config_option_list go to state 52
+
+
+state 20
+
+ 13 common_block: config_stmt .
+
+ $default reduce using rule 13 (common_block)
+
+
+state 21
+
+ 20 menuconfig_stmt: menuconfig_entry_start . config_option_list
+
+ $default reduce using rule 21 (config_option_list)
+
+ config_option_list go to state 53
+
+
+state 22
+
+ 14 common_block: menuconfig_stmt .
+
+ $default reduce using rule 14 (common_block)
+
+
+state 23
+
+ 39 choice_entry: choice . choice_option_list
+
+ $default reduce using rule 43 (choice_option_list)
+
+ choice_option_list go to state 54
+
+
+state 24
+
+ 41 choice_stmt: choice_entry . choice_block choice_end
+ 42 | choice_entry . choice_block
+
+ $default reduce using rule 53 (choice_block)
+
+ choice_block go to state 55
+
+
+state 25
+
+ 4 block: choice_stmt .
+
+ $default reduce using rule 4 (block)
+
+
+state 26
+
+ 57 if_stmt: if . if_block if_end
+ 58 | if . if_block
+
+ $default reduce using rule 59 (if_block)
+
+ if_block go to state 56
+
+
+state 27
+
+ 11 common_block: if_stmt .
+
+ $default reduce using rule 11 (common_block)
+
+
+state 28
+
+ 64 menu_entry: menu . depends_list
+
+ $default reduce using rule 79 (depends_list)
+
+ depends_list go to state 57
+
+
+state 29
+
+ 66 menu_stmt: menu_entry . menu_block menu_end
+ 67 | menu_entry . menu_block
+
+ $default reduce using rule 68 (menu_block)
+
+ menu_block go to state 58
+
+
+state 30
+
+ 5 block: menu_stmt .
+
+ $default reduce using rule 5 (block)
+
+
+state 31
+
+ 74 source_stmt: source .
+
+ $default reduce using rule 74 (source_stmt)
+
+
+state 32
+
+ 15 common_block: source_stmt .
+
+ $default reduce using rule 15 (common_block)
+
+
+state 33
+
+ 76 comment_stmt: comment . depends_list
+
+ $default reduce using rule 79 (depends_list)
+
+ depends_list go to state 59
+
+
+state 34
+
+ 12 common_block: comment_stmt .
+
+ $default reduce using rule 12 (common_block)
+
+
+state 35
+
+ 16 common_block: nl_or_eof .
+
+ $default reduce using rule 16 (common_block)
+
+
+state 36
+
+ 10 block: error nl_or_eof .
+
+ $default reduce using rule 10 (block)
+
+
+state 37
+
+ 87 prompt: T_WORD .
+
+ $default reduce using rule 87 (prompt)
+
+
+state 38
+
+ 88 prompt: T_WORD_QUOTE .
+
+ $default reduce using rule 88 (prompt)
+
+
+state 39
+
+ 6 block: T_MAINMENU prompt . nl_or_eof
+
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ nl_or_eof go to state 60
+
+
+state 40
+
+ 63 menu: T_MENU prompt . T_EOL
+
+ T_EOL shift, and go to state 61
+
+
+state 41
+
+ 73 source: T_SOURCE prompt . T_EOL
+
+ T_EOL shift, and go to state 62
+
+
+state 42
+
+ 38 choice: T_CHOICE T_EOL .
+
+ $default reduce using rule 38 (choice)
+
+
+state 43
+
+ 75 comment: T_COMMENT prompt . T_EOL
+
+ T_EOL shift, and go to state 63
+
+
+state 44
+
+ 17 config_entry_start: T_CONFIG T_WORD . T_EOL
+
+ T_EOL shift, and go to state 64
+
+
+state 45
+
+ 19 menuconfig_entry_start: T_MENUCONFIG T_WORD . T_EOL
+
+ T_EOL shift, and go to state 65
+
+
+state 46
+
+ 103 symbol: T_WORD .
+
+ $default reduce using rule 103 (symbol)
+
+
+state 47
+
+ 104 symbol: T_WORD_QUOTE .
+
+ $default reduce using rule 104 (symbol)
+
+
+state 48
+
+ 99 expr: T_OPEN_PAREN . expr T_CLOSE_PAREN
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 66
+ symbol go to state 51
+
+
+state 49
+
+ 100 expr: T_NOT . expr
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 67
+ symbol go to state 51
+
+
+state 50
+
+ 55 if: T_IF expr . T_EOL
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_EOL shift, and go to state 68
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+
+state 51
+
+ 96 expr: symbol .
+ 97 | symbol . T_EQUAL symbol
+ 98 | symbol . T_UNEQUAL symbol
+
+ T_UNEQUAL shift, and go to state 71
+ T_EQUAL shift, and go to state 72
+
+ $default reduce using rule 96 (expr)
+
+
+state 52
+
+ 18 config_stmt: config_entry_start config_option_list .
+ 22 config_option_list: config_option_list . config_option
+ 23 | config_option_list . depends
+ 24 | config_option_list . help
+ 25 | config_option_list . T_EOL
+
+ T_HELP shift, and go to state 73
+ T_DEPENDS shift, and go to state 74
+ T_REQUIRES shift, and go to state 75
+ T_PROMPT shift, and go to state 76
+ T_DEFAULT shift, and go to state 77
+ T_TRISTATE shift, and go to state 78
+ T_DEF_TRISTATE shift, and go to state 79
+ T_BOOLEAN shift, and go to state 80
+ T_DEF_BOOLEAN shift, and go to state 81
+ T_STRING shift, and go to state 82
+ T_INT shift, and go to state 83
+ T_HEX shift, and go to state 84
+ T_EOL shift, and go to state 85
+ T_SELECT shift, and go to state 86
+ T_RANGE shift, and go to state 87
+
+ T_EOL [reduce using rule 18 (config_stmt)]
+ $default reduce using rule 18 (config_stmt)
+
+ config_option go to state 88
+ help_start go to state 89
+ help go to state 90
+ depends go to state 91
+
+
+state 53
+
+ 20 menuconfig_stmt: menuconfig_entry_start config_option_list .
+ 22 config_option_list: config_option_list . config_option
+ 23 | config_option_list . depends
+ 24 | config_option_list . help
+ 25 | config_option_list . T_EOL
+
+ T_HELP shift, and go to state 73
+ T_DEPENDS shift, and go to state 74
+ T_REQUIRES shift, and go to state 75
+ T_PROMPT shift, and go to state 76
+ T_DEFAULT shift, and go to state 77
+ T_TRISTATE shift, and go to state 78
+ T_DEF_TRISTATE shift, and go to state 79
+ T_BOOLEAN shift, and go to state 80
+ T_DEF_BOOLEAN shift, and go to state 81
+ T_STRING shift, and go to state 82
+ T_INT shift, and go to state 83
+ T_HEX shift, and go to state 84
+ T_EOL shift, and go to state 85
+ T_SELECT shift, and go to state 86
+ T_RANGE shift, and go to state 87
+
+ T_EOL [reduce using rule 20 (menuconfig_stmt)]
+ $default reduce using rule 20 (menuconfig_stmt)
+
+ config_option go to state 88
+ help_start go to state 89
+ help go to state 90
+ depends go to state 91
+
+
+state 54
+
+ 39 choice_entry: choice choice_option_list .
+ 44 choice_option_list: choice_option_list . choice_option
+ 45 | choice_option_list . depends
+ 46 | choice_option_list . help
+ 47 | choice_option_list . T_EOL
+
+ T_HELP shift, and go to state 73
+ T_DEPENDS shift, and go to state 74
+ T_REQUIRES shift, and go to state 75
+ T_OPTIONAL shift, and go to state 92
+ T_PROMPT shift, and go to state 93
+ T_DEFAULT shift, and go to state 94
+ T_TRISTATE shift, and go to state 95
+ T_BOOLEAN shift, and go to state 96
+ T_EOL shift, and go to state 97
+
+ T_EOL [reduce using rule 39 (choice_entry)]
+ $default reduce using rule 39 (choice_entry)
+
+ choice_option go to state 98
+ help_start go to state 89
+ help go to state 99
+ depends go to state 100
+
+
+state 55
+
+ 41 choice_stmt: choice_entry choice_block . choice_end
+ 42 | choice_entry choice_block .
+ 54 choice_block: choice_block . common_block
+
+ T_ENDMENU shift, and go to state 101
+ T_SOURCE shift, and go to state 7
+ T_ENDCHOICE shift, and go to state 102
+ T_COMMENT shift, and go to state 10
+ T_CONFIG shift, and go to state 11
+ T_MENUCONFIG shift, and go to state 12
+ T_IF shift, and go to state 13
+ T_ENDIF shift, and go to state 103
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ T_ENDMENU [reduce using rule 42 (choice_stmt)]
+ T_SOURCE [reduce using rule 42 (choice_stmt)]
+ T_ENDCHOICE [reduce using rule 42 (choice_stmt)]
+ T_COMMENT [reduce using rule 42 (choice_stmt)]
+ T_CONFIG [reduce using rule 42 (choice_stmt)]
+ T_MENUCONFIG [reduce using rule 42 (choice_stmt)]
+ T_IF [reduce using rule 42 (choice_stmt)]
+ T_ENDIF [reduce using rule 42 (choice_stmt)]
+ T_EOF [reduce using rule 42 (choice_stmt)]
+ T_EOL [reduce using rule 42 (choice_stmt)]
+ $default reduce using rule 42 (choice_stmt)
+
+ common_block go to state 104
+ config_entry_start go to state 19
+ config_stmt go to state 20
+ menuconfig_entry_start go to state 21
+ menuconfig_stmt go to state 22
+ choice_end go to state 105
+ if go to state 26
+ if_stmt go to state 27
+ source go to state 31
+ source_stmt go to state 32
+ comment go to state 33
+ comment_stmt go to state 34
+ end go to state 106
+ nl_or_eof go to state 35
+
+
+state 56
+
+ 57 if_stmt: if if_block . if_end
+ 58 | if if_block .
+ 60 if_block: if_block . common_block
+ 61 | if_block . menu_stmt
+ 62 | if_block . choice_stmt
+
+ T_MENU shift, and go to state 5
+ T_ENDMENU shift, and go to state 101
+ T_SOURCE shift, and go to state 7
+ T_CHOICE shift, and go to state 8
+ T_ENDCHOICE shift, and go to state 102
+ T_COMMENT shift, and go to state 10
+ T_CONFIG shift, and go to state 11
+ T_MENUCONFIG shift, and go to state 12
+ T_IF shift, and go to state 13
+ T_ENDIF shift, and go to state 103
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ T_MENU [reduce using rule 58 (if_stmt)]
+ T_ENDMENU [reduce using rule 58 (if_stmt)]
+ T_SOURCE [reduce using rule 58 (if_stmt)]
+ T_CHOICE [reduce using rule 58 (if_stmt)]
+ T_ENDCHOICE [reduce using rule 58 (if_stmt)]
+ T_COMMENT [reduce using rule 58 (if_stmt)]
+ T_CONFIG [reduce using rule 58 (if_stmt)]
+ T_MENUCONFIG [reduce using rule 58 (if_stmt)]
+ T_IF [reduce using rule 58 (if_stmt)]
+ T_ENDIF [reduce using rule 58 (if_stmt)]
+ T_EOF [reduce using rule 58 (if_stmt)]
+ T_EOL [reduce using rule 58 (if_stmt)]
+ $default reduce using rule 58 (if_stmt)
+
+ common_block go to state 107
+ config_entry_start go to state 19
+ config_stmt go to state 20
+ menuconfig_entry_start go to state 21
+ menuconfig_stmt go to state 22
+ choice go to state 23
+ choice_entry go to state 24
+ choice_stmt go to state 108
+ if go to state 26
+ if_end go to state 109
+ if_stmt go to state 27
+ menu go to state 28
+ menu_entry go to state 29
+ menu_stmt go to state 110
+ source go to state 31
+ source_stmt go to state 32
+ comment go to state 33
+ comment_stmt go to state 34
+ end go to state 111
+ nl_or_eof go to state 35
+
+
+state 57
+
+ 64 menu_entry: menu depends_list .
+ 80 depends_list: depends_list . depends
+ 81 | depends_list . T_EOL
+
+ T_DEPENDS shift, and go to state 74
+ T_REQUIRES shift, and go to state 75
+ T_EOL shift, and go to state 112
+
+ T_EOL [reduce using rule 64 (menu_entry)]
+ $default reduce using rule 64 (menu_entry)
+
+ depends go to state 113
+
+
+state 58
+
+ 66 menu_stmt: menu_entry menu_block . menu_end
+ 67 | menu_entry menu_block .
+ 69 menu_block: menu_block . common_block
+ 70 | menu_block . menu_stmt
+ 71 | menu_block . choice_stmt
+ 72 | menu_block . error T_EOL
+
+ error shift, and go to state 114
+ T_MENU shift, and go to state 5
+ T_ENDMENU shift, and go to state 101
+ T_SOURCE shift, and go to state 7
+ T_CHOICE shift, and go to state 8
+ T_ENDCHOICE shift, and go to state 102
+ T_COMMENT shift, and go to state 10
+ T_CONFIG shift, and go to state 11
+ T_MENUCONFIG shift, and go to state 12
+ T_IF shift, and go to state 13
+ T_ENDIF shift, and go to state 103
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ $end reduce using rule 67 (menu_stmt)
+ error [reduce using rule 67 (menu_stmt)]
+ T_MAINMENU reduce using rule 67 (menu_stmt)
+ T_MENU [reduce using rule 67 (menu_stmt)]
+ T_ENDMENU [reduce using rule 67 (menu_stmt)]
+ T_SOURCE [reduce using rule 67 (menu_stmt)]
+ T_CHOICE [reduce using rule 67 (menu_stmt)]
+ T_ENDCHOICE [reduce using rule 67 (menu_stmt)]
+ T_COMMENT [reduce using rule 67 (menu_stmt)]
+ T_CONFIG [reduce using rule 67 (menu_stmt)]
+ T_MENUCONFIG [reduce using rule 67 (menu_stmt)]
+ T_IF [reduce using rule 67 (menu_stmt)]
+ T_ENDIF [reduce using rule 67 (menu_stmt)]
+ T_EOF [reduce using rule 67 (menu_stmt)]
+ T_EOL [reduce using rule 67 (menu_stmt)]
+
+ common_block go to state 115
+ config_entry_start go to state 19
+ config_stmt go to state 20
+ menuconfig_entry_start go to state 21
+ menuconfig_stmt go to state 22
+ choice go to state 23
+ choice_entry go to state 24
+ choice_stmt go to state 116
+ if go to state 26
+ if_stmt go to state 27
+ menu go to state 28
+ menu_entry go to state 29
+ menu_end go to state 117
+ menu_stmt go to state 118
+ source go to state 31
+ source_stmt go to state 32
+ comment go to state 33
+ comment_stmt go to state 34
+ end go to state 119
+ nl_or_eof go to state 35
+
+
+state 59
+
+ 76 comment_stmt: comment depends_list .
+ 80 depends_list: depends_list . depends
+ 81 | depends_list . T_EOL
+
+ T_DEPENDS shift, and go to state 74
+ T_REQUIRES shift, and go to state 75
+ T_EOL shift, and go to state 112
+
+ T_EOL [reduce using rule 76 (comment_stmt)]
+ $default reduce using rule 76 (comment_stmt)
+
+ depends go to state 113
+
+
+state 60
+
+ 6 block: T_MAINMENU prompt nl_or_eof .
+
+ $default reduce using rule 6 (block)
+
+
+state 61
+
+ 63 menu: T_MENU prompt T_EOL .
+
+ $default reduce using rule 63 (menu)
+
+
+state 62
+
+ 73 source: T_SOURCE prompt T_EOL .
+
+ $default reduce using rule 73 (source)
+
+
+state 63
+
+ 75 comment: T_COMMENT prompt T_EOL .
+
+ $default reduce using rule 75 (comment)
+
+
+state 64
+
+ 17 config_entry_start: T_CONFIG T_WORD T_EOL .
+
+ $default reduce using rule 17 (config_entry_start)
+
+
+state 65
+
+ 19 menuconfig_entry_start: T_MENUCONFIG T_WORD T_EOL .
+
+ $default reduce using rule 19 (menuconfig_entry_start)
+
+
+state 66
+
+ 99 expr: T_OPEN_PAREN expr . T_CLOSE_PAREN
+ 101 | expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_CLOSE_PAREN shift, and go to state 120
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+
+state 67
+
+ 100 expr: T_NOT expr .
+ 101 | expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ $default reduce using rule 100 (expr)
+
+
+state 68
+
+ 55 if: T_IF expr T_EOL .
+
+ $default reduce using rule 55 (if)
+
+
+state 69
+
+ 101 expr: expr T_OR . expr
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 121
+ symbol go to state 51
+
+
+state 70
+
+ 102 expr: expr T_AND . expr
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 122
+ symbol go to state 51
+
+
+state 71
+
+ 98 expr: symbol T_UNEQUAL . symbol
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+
+ symbol go to state 123
+
+
+state 72
+
+ 97 expr: symbol T_EQUAL . symbol
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+
+ symbol go to state 124
+
+
+state 73
+
+ 77 help_start: T_HELP . T_EOL
+
+ T_EOL shift, and go to state 125
+
+
+state 74
+
+ 82 depends: T_DEPENDS . T_ON expr T_EOL
+ 83 | T_DEPENDS . expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_ON shift, and go to state 126
+ T_NOT shift, and go to state 49
+
+ expr go to state 127
+ symbol go to state 51
+
+
+state 75
+
+ 84 depends: T_REQUIRES . expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 128
+ symbol go to state 51
+
+
+state 76
+
+ 33 config_option: T_PROMPT . prompt if_expr T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ prompt go to state 129
+
+
+state 77
+
+ 34 config_option: T_DEFAULT . expr if_expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 130
+ symbol go to state 51
+
+
+state 78
+
+ 26 config_option: T_TRISTATE . prompt_stmt_opt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ $default reduce using rule 85 (prompt_stmt_opt)
+
+ prompt_stmt_opt go to state 131
+ prompt go to state 132
+
+
+state 79
+
+ 27 config_option: T_DEF_TRISTATE . expr if_expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 133
+ symbol go to state 51
+
+
+state 80
+
+ 28 config_option: T_BOOLEAN . prompt_stmt_opt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ $default reduce using rule 85 (prompt_stmt_opt)
+
+ prompt_stmt_opt go to state 134
+ prompt go to state 132
+
+
+state 81
+
+ 29 config_option: T_DEF_BOOLEAN . expr if_expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 135
+ symbol go to state 51
+
+
+state 82
+
+ 32 config_option: T_STRING . prompt_stmt_opt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ $default reduce using rule 85 (prompt_stmt_opt)
+
+ prompt_stmt_opt go to state 136
+ prompt go to state 132
+
+
+state 83
+
+ 30 config_option: T_INT . prompt_stmt_opt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ $default reduce using rule 85 (prompt_stmt_opt)
+
+ prompt_stmt_opt go to state 137
+ prompt go to state 132
+
+
+state 84
+
+ 31 config_option: T_HEX . prompt_stmt_opt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ $default reduce using rule 85 (prompt_stmt_opt)
+
+ prompt_stmt_opt go to state 138
+ prompt go to state 132
+
+
+state 85
+
+ 25 config_option_list: config_option_list T_EOL .
+
+ $default reduce using rule 25 (config_option_list)
+
+
+state 86
+
+ 35 config_option: T_SELECT . T_WORD if_expr T_EOL
+ 36 | T_SELECT . T_NOT T_WORD if_expr T_EOL
+
+ T_WORD shift, and go to state 139
+ T_NOT shift, and go to state 140
+
+
+state 87
+
+ 37 config_option: T_RANGE . symbol symbol if_expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+
+ symbol go to state 141
+
+
+state 88
+
+ 22 config_option_list: config_option_list config_option .
+
+ $default reduce using rule 22 (config_option_list)
+
+
+state 89
+
+ 78 help: help_start . T_HELPTEXT
+
+ T_HELPTEXT shift, and go to state 142
+
+
+state 90
+
+ 24 config_option_list: config_option_list help .
+
+ $default reduce using rule 24 (config_option_list)
+
+
+state 91
+
+ 23 config_option_list: config_option_list depends .
+
+ $default reduce using rule 23 (config_option_list)
+
+
+state 92
+
+ 51 choice_option: T_OPTIONAL . T_EOL
+
+ T_EOL shift, and go to state 143
+
+
+state 93
+
+ 48 choice_option: T_PROMPT . prompt if_expr T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ prompt go to state 144
+
+
+state 94
+
+ 52 choice_option: T_DEFAULT . T_WORD if_expr T_EOL
+
+ T_WORD shift, and go to state 145
+
+
+state 95
+
+ 49 choice_option: T_TRISTATE . prompt_stmt_opt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ $default reduce using rule 85 (prompt_stmt_opt)
+
+ prompt_stmt_opt go to state 146
+ prompt go to state 132
+
+
+state 96
+
+ 50 choice_option: T_BOOLEAN . prompt_stmt_opt T_EOL
+
+ T_WORD shift, and go to state 37
+ T_WORD_QUOTE shift, and go to state 38
+
+ $default reduce using rule 85 (prompt_stmt_opt)
+
+ prompt_stmt_opt go to state 147
+ prompt go to state 132
+
+
+state 97
+
+ 47 choice_option_list: choice_option_list T_EOL .
+
+ $default reduce using rule 47 (choice_option_list)
+
+
+state 98
+
+ 44 choice_option_list: choice_option_list choice_option .
+
+ $default reduce using rule 44 (choice_option_list)
+
+
+state 99
+
+ 46 choice_option_list: choice_option_list help .
+
+ $default reduce using rule 46 (choice_option_list)
+
+
+state 100
+
+ 45 choice_option_list: choice_option_list depends .
+
+ $default reduce using rule 45 (choice_option_list)
+
+
+state 101
+
+ 89 end: T_ENDMENU . nl_or_eof
+
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ nl_or_eof go to state 148
+
+
+state 102
+
+ 90 end: T_ENDCHOICE . nl_or_eof
+
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ nl_or_eof go to state 149
+
+
+state 103
+
+ 91 end: T_ENDIF . nl_or_eof
+
+ T_EOF shift, and go to state 15
+ T_EOL shift, and go to state 16
+
+ nl_or_eof go to state 150
+
+
+state 104
+
+ 54 choice_block: choice_block common_block .
+
+ $default reduce using rule 54 (choice_block)
+
+
+state 105
+
+ 41 choice_stmt: choice_entry choice_block choice_end .
+
+ $default reduce using rule 41 (choice_stmt)
+
+
+state 106
+
+ 40 choice_end: end .
+
+ $default reduce using rule 40 (choice_end)
+
+
+state 107
+
+ 60 if_block: if_block common_block .
+
+ $default reduce using rule 60 (if_block)
+
+
+state 108
+
+ 62 if_block: if_block choice_stmt .
+
+ $default reduce using rule 62 (if_block)
+
+
+state 109
+
+ 57 if_stmt: if if_block if_end .
+
+ $default reduce using rule 57 (if_stmt)
+
+
+state 110
+
+ 61 if_block: if_block menu_stmt .
+
+ $default reduce using rule 61 (if_block)
+
+
+state 111
+
+ 56 if_end: end .
+
+ $default reduce using rule 56 (if_end)
+
+
+state 112
+
+ 81 depends_list: depends_list T_EOL .
+
+ $default reduce using rule 81 (depends_list)
+
+
+state 113
+
+ 80 depends_list: depends_list depends .
+
+ $default reduce using rule 80 (depends_list)
+
+
+state 114
+
+ 72 menu_block: menu_block error . T_EOL
+
+ T_EOL shift, and go to state 151
+
+
+state 115
+
+ 69 menu_block: menu_block common_block .
+
+ $default reduce using rule 69 (menu_block)
+
+
+state 116
+
+ 71 menu_block: menu_block choice_stmt .
+
+ $default reduce using rule 71 (menu_block)
+
+
+state 117
+
+ 66 menu_stmt: menu_entry menu_block menu_end .
+
+ $default reduce using rule 66 (menu_stmt)
+
+
+state 118
+
+ 70 menu_block: menu_block menu_stmt .
+
+ $default reduce using rule 70 (menu_block)
+
+
+state 119
+
+ 65 menu_end: end .
+
+ $default reduce using rule 65 (menu_end)
+
+
+state 120
+
+ 99 expr: T_OPEN_PAREN expr T_CLOSE_PAREN .
+
+ $default reduce using rule 99 (expr)
+
+
+state 121
+
+ 101 expr: expr . T_OR expr
+ 101 | expr T_OR expr .
+ 102 | expr . T_AND expr
+
+ T_AND shift, and go to state 70
+
+ $default reduce using rule 101 (expr)
+
+
+state 122
+
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+ 102 | expr T_AND expr .
+
+ $default reduce using rule 102 (expr)
+
+
+state 123
+
+ 98 expr: symbol T_UNEQUAL symbol .
+
+ $default reduce using rule 98 (expr)
+
+
+state 124
+
+ 97 expr: symbol T_EQUAL symbol .
+
+ $default reduce using rule 97 (expr)
+
+
+state 125
+
+ 77 help_start: T_HELP T_EOL .
+
+ $default reduce using rule 77 (help_start)
+
+
+state 126
+
+ 82 depends: T_DEPENDS T_ON . expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 152
+ symbol go to state 51
+
+
+state 127
+
+ 83 depends: T_DEPENDS expr . T_EOL
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_EOL shift, and go to state 153
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+
+state 128
+
+ 84 depends: T_REQUIRES expr . T_EOL
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_EOL shift, and go to state 154
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+
+state 129
+
+ 33 config_option: T_PROMPT prompt . if_expr T_EOL
+
+ T_IF shift, and go to state 155
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 156
+
+
+state 130
+
+ 34 config_option: T_DEFAULT expr . if_expr T_EOL
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_IF shift, and go to state 155
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 157
+
+
+state 131
+
+ 26 config_option: T_TRISTATE prompt_stmt_opt . T_EOL
+
+ T_EOL shift, and go to state 158
+
+
+state 132
+
+ 86 prompt_stmt_opt: prompt . if_expr
+
+ T_IF shift, and go to state 155
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 159
+
+
+state 133
+
+ 27 config_option: T_DEF_TRISTATE expr . if_expr T_EOL
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_IF shift, and go to state 155
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 160
+
+
+state 134
+
+ 28 config_option: T_BOOLEAN prompt_stmt_opt . T_EOL
+
+ T_EOL shift, and go to state 161
+
+
+state 135
+
+ 29 config_option: T_DEF_BOOLEAN expr . if_expr T_EOL
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_IF shift, and go to state 155
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 162
+
+
+state 136
+
+ 32 config_option: T_STRING prompt_stmt_opt . T_EOL
+
+ T_EOL shift, and go to state 163
+
+
+state 137
+
+ 30 config_option: T_INT prompt_stmt_opt . T_EOL
+
+ T_EOL shift, and go to state 164
+
+
+state 138
+
+ 31 config_option: T_HEX prompt_stmt_opt . T_EOL
+
+ T_EOL shift, and go to state 165
+
+
+state 139
+
+ 35 config_option: T_SELECT T_WORD . if_expr T_EOL
+
+ T_IF shift, and go to state 155
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 166
+
+
+state 140
+
+ 36 config_option: T_SELECT T_NOT . T_WORD if_expr T_EOL
+
+ T_WORD shift, and go to state 167
+
+
+state 141
+
+ 37 config_option: T_RANGE symbol . symbol if_expr T_EOL
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+
+ symbol go to state 168
+
+
+state 142
+
+ 78 help: help_start T_HELPTEXT .
+
+ $default reduce using rule 78 (help)
+
+
+state 143
+
+ 51 choice_option: T_OPTIONAL T_EOL .
+
+ $default reduce using rule 51 (choice_option)
+
+
+state 144
+
+ 48 choice_option: T_PROMPT prompt . if_expr T_EOL
+
+ T_IF shift, and go to state 155
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 169
+
+
+state 145
+
+ 52 choice_option: T_DEFAULT T_WORD . if_expr T_EOL
+
+ T_IF shift, and go to state 155
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 170
+
+
+state 146
+
+ 49 choice_option: T_TRISTATE prompt_stmt_opt . T_EOL
+
+ T_EOL shift, and go to state 171
+
+
+state 147
+
+ 50 choice_option: T_BOOLEAN prompt_stmt_opt . T_EOL
+
+ T_EOL shift, and go to state 172
+
+
+state 148
+
+ 89 end: T_ENDMENU nl_or_eof .
+
+ $default reduce using rule 89 (end)
+
+
+state 149
+
+ 90 end: T_ENDCHOICE nl_or_eof .
+
+ $default reduce using rule 90 (end)
+
+
+state 150
+
+ 91 end: T_ENDIF nl_or_eof .
+
+ $default reduce using rule 91 (end)
+
+
+state 151
+
+ 72 menu_block: menu_block error T_EOL .
+
+ $default reduce using rule 72 (menu_block)
+
+
+state 152
+
+ 82 depends: T_DEPENDS T_ON expr . T_EOL
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_EOL shift, and go to state 173
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+
+state 153
+
+ 83 depends: T_DEPENDS expr T_EOL .
+
+ $default reduce using rule 83 (depends)
+
+
+state 154
+
+ 84 depends: T_REQUIRES expr T_EOL .
+
+ $default reduce using rule 84 (depends)
+
+
+state 155
+
+ 95 if_expr: T_IF . expr
+
+ T_WORD shift, and go to state 46
+ T_WORD_QUOTE shift, and go to state 47
+ T_OPEN_PAREN shift, and go to state 48
+ T_NOT shift, and go to state 49
+
+ expr go to state 174
+ symbol go to state 51
+
+
+state 156
+
+ 33 config_option: T_PROMPT prompt if_expr . T_EOL
+
+ T_EOL shift, and go to state 175
+
+
+state 157
+
+ 34 config_option: T_DEFAULT expr if_expr . T_EOL
+
+ T_EOL shift, and go to state 176
+
+
+state 158
+
+ 26 config_option: T_TRISTATE prompt_stmt_opt T_EOL .
+
+ $default reduce using rule 26 (config_option)
+
+
+state 159
+
+ 86 prompt_stmt_opt: prompt if_expr .
+
+ $default reduce using rule 86 (prompt_stmt_opt)
+
+
+state 160
+
+ 27 config_option: T_DEF_TRISTATE expr if_expr . T_EOL
+
+ T_EOL shift, and go to state 177
+
+
+state 161
+
+ 28 config_option: T_BOOLEAN prompt_stmt_opt T_EOL .
+
+ $default reduce using rule 28 (config_option)
+
+
+state 162
+
+ 29 config_option: T_DEF_BOOLEAN expr if_expr . T_EOL
+
+ T_EOL shift, and go to state 178
+
+
+state 163
+
+ 32 config_option: T_STRING prompt_stmt_opt T_EOL .
+
+ $default reduce using rule 32 (config_option)
+
+
+state 164
+
+ 30 config_option: T_INT prompt_stmt_opt T_EOL .
+
+ $default reduce using rule 30 (config_option)
+
+
+state 165
+
+ 31 config_option: T_HEX prompt_stmt_opt T_EOL .
+
+ $default reduce using rule 31 (config_option)
+
+
+state 166
+
+ 35 config_option: T_SELECT T_WORD if_expr . T_EOL
+
+ T_EOL shift, and go to state 179
+
+
+state 167
+
+ 36 config_option: T_SELECT T_NOT T_WORD . if_expr T_EOL
+
+ T_IF shift, and go to state 155
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 180
+
+
+state 168
+
+ 37 config_option: T_RANGE symbol symbol . if_expr T_EOL
+
+ T_IF shift, and go to state 155
+
+ $default reduce using rule 94 (if_expr)
+
+ if_expr go to state 181
+
+
+state 169
+
+ 48 choice_option: T_PROMPT prompt if_expr . T_EOL
+
+ T_EOL shift, and go to state 182
+
+
+state 170
+
+ 52 choice_option: T_DEFAULT T_WORD if_expr . T_EOL
+
+ T_EOL shift, and go to state 183
+
+
+state 171
+
+ 49 choice_option: T_TRISTATE prompt_stmt_opt T_EOL .
+
+ $default reduce using rule 49 (choice_option)
+
+
+state 172
+
+ 50 choice_option: T_BOOLEAN prompt_stmt_opt T_EOL .
+
+ $default reduce using rule 50 (choice_option)
+
+
+state 173
+
+ 82 depends: T_DEPENDS T_ON expr T_EOL .
+
+ $default reduce using rule 82 (depends)
+
+
+state 174
+
+ 95 if_expr: T_IF expr .
+ 101 expr: expr . T_OR expr
+ 102 | expr . T_AND expr
+
+ T_OR shift, and go to state 69
+ T_AND shift, and go to state 70
+
+ $default reduce using rule 95 (if_expr)
+
+
+state 175
+
+ 33 config_option: T_PROMPT prompt if_expr T_EOL .
+
+ $default reduce using rule 33 (config_option)
+
+
+state 176
+
+ 34 config_option: T_DEFAULT expr if_expr T_EOL .
+
+ $default reduce using rule 34 (config_option)
+
+
+state 177
+
+ 27 config_option: T_DEF_TRISTATE expr if_expr T_EOL .
+
+ $default reduce using rule 27 (config_option)
+
+
+state 178
+
+ 29 config_option: T_DEF_BOOLEAN expr if_expr T_EOL .
+
+ $default reduce using rule 29 (config_option)
+
+
+state 179
+
+ 35 config_option: T_SELECT T_WORD if_expr T_EOL .
+
+ $default reduce using rule 35 (config_option)
+
+
+state 180
+
+ 36 config_option: T_SELECT T_NOT T_WORD if_expr . T_EOL
+
+ T_EOL shift, and go to state 184
+
+
+state 181
+
+ 37 config_option: T_RANGE symbol symbol if_expr . T_EOL
+
+ T_EOL shift, and go to state 185
+
+
+state 182
+
+ 48 choice_option: T_PROMPT prompt if_expr T_EOL .
+
+ $default reduce using rule 48 (choice_option)
+
+
+state 183
+
+ 52 choice_option: T_DEFAULT T_WORD if_expr T_EOL .
+
+ $default reduce using rule 52 (choice_option)
+
+
+state 184
+
+ 36 config_option: T_SELECT T_NOT T_WORD if_expr T_EOL .
+
+ $default reduce using rule 36 (config_option)
+
+
+state 185
+
+ 37 config_option: T_RANGE symbol symbol if_expr T_EOL .
+
+ $default reduce using rule 37 (config_option)
diff --git a/config/zconf.y b/config/zconf.y
new file mode 100644
index 000000000..e1f1c151c
--- /dev/null
+++ b/config/zconf.y
@@ -0,0 +1,693 @@
+%{
+/*
+ * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
+ * Released under the terms of the GNU GPL v2.0.
+ */
+
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+
+#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
+
+#define PRINTD 0x0001
+#define DEBUG_PARSE 0x0002
+
+int cdebug = PRINTD;
+
+extern int zconflex(void);
+static void zconfprint(const char *err, ...);
+static void zconferror(const char *err);
+static bool zconf_endtoken(int token, int starttoken, int endtoken);
+
+struct symbol *symbol_hash[257];
+
+#define YYERROR_VERBOSE
+%}
+%expect 40
+
+%union
+{
+ int token;
+ char *string;
+ struct symbol *symbol;
+ struct expr *expr;
+ struct menu *menu;
+}
+
+%token T_MAINMENU
+%token T_MENU
+%token T_ENDMENU
+%token T_SOURCE
+%token T_CHOICE
+%token T_ENDCHOICE
+%token T_COMMENT
+%token T_CONFIG
+%token T_MENUCONFIG
+%token T_HELP
+%token <string> T_HELPTEXT
+%token T_IF
+%token T_ENDIF
+%token T_DEPENDS
+%token T_REQUIRES
+%token T_OPTIONAL
+%token T_PROMPT
+%token T_DEFAULT
+%token T_TRISTATE
+%token T_DEF_TRISTATE
+%token T_BOOLEAN
+%token T_DEF_BOOLEAN
+%token T_STRING
+%token T_INT
+%token T_HEX
+%token <string> T_WORD
+%token <string> T_WORD_QUOTE
+%token T_UNEQUAL
+%token T_EOF
+%token T_EOL
+%token T_CLOSE_PAREN
+%token T_OPEN_PAREN
+%token T_ON
+%token T_SELECT
+%token T_RANGE
+
+%left T_OR
+%left T_AND
+%left T_EQUAL T_UNEQUAL
+%nonassoc T_NOT
+
+%type <string> prompt
+%type <string> source
+%type <symbol> symbol
+%type <expr> expr
+%type <expr> if_expr
+%type <token> end
+
+%{
+#define LKC_DIRECT_LINK
+#include "lkc.h"
+%}
+%%
+input: /* empty */
+ | input block
+;
+
+block: common_block
+ | choice_stmt
+ | menu_stmt
+ | T_MAINMENU prompt nl_or_eof
+ | T_ENDMENU { zconfprint("unexpected 'endmenu' statement"); }
+ | T_ENDIF { zconfprint("unexpected 'endif' statement"); }
+ | T_ENDCHOICE { zconfprint("unexpected 'endchoice' statement"); }
+ | error nl_or_eof { zconfprint("syntax error"); yyerrok; }
+;
+
+common_block:
+ if_stmt
+ | comment_stmt
+ | config_stmt
+ | menuconfig_stmt
+ | source_stmt
+ | nl_or_eof
+;
+
+
+/* config/menuconfig entry */
+
+config_entry_start: T_CONFIG T_WORD T_EOL
+{
+ struct symbol *sym = sym_lookup($2, 0);
+ sym->flags |= SYMBOL_OPTIONAL;
+ menu_add_entry(sym);
+ printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), $2);
+};
+
+config_stmt: config_entry_start config_option_list
+{
+ menu_end_entry();
+ printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
+};
+
+menuconfig_entry_start: T_MENUCONFIG T_WORD T_EOL
+{
+ struct symbol *sym = sym_lookup($2, 0);
+ sym->flags |= SYMBOL_OPTIONAL;
+ menu_add_entry(sym);
+ printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), $2);
+};
+
+menuconfig_stmt: menuconfig_entry_start config_option_list
+{
+ if (current_entry->prompt)
+ current_entry->prompt->type = P_MENU;
+ else
+ zconfprint("warning: menuconfig statement without prompt");
+ menu_end_entry();
+ printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
+};
+
+config_option_list:
+ /* empty */
+ | config_option_list config_option
+ | config_option_list depends
+ | config_option_list help
+ | config_option_list T_EOL
+;
+
+config_option: T_TRISTATE prompt_stmt_opt T_EOL
+{
+ menu_set_type(S_TRISTATE);
+ printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_DEF_TRISTATE expr if_expr T_EOL
+{
+ menu_add_expr(P_DEFAULT, $2, $3);
+ menu_set_type(S_TRISTATE);
+ printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_BOOLEAN prompt_stmt_opt T_EOL
+{
+ menu_set_type(S_BOOLEAN);
+ printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_DEF_BOOLEAN expr if_expr T_EOL
+{
+ menu_add_expr(P_DEFAULT, $2, $3);
+ menu_set_type(S_BOOLEAN);
+ printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_INT prompt_stmt_opt T_EOL
+{
+ menu_set_type(S_INT);
+ printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_HEX prompt_stmt_opt T_EOL
+{
+ menu_set_type(S_HEX);
+ printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_STRING prompt_stmt_opt T_EOL
+{
+ menu_set_type(S_STRING);
+ printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_PROMPT prompt if_expr T_EOL
+{
+ menu_add_prompt(P_PROMPT, $2, $3);
+ printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_DEFAULT expr if_expr T_EOL
+{
+ menu_add_expr(P_DEFAULT, $2, $3);
+ printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_SELECT T_WORD if_expr T_EOL
+{
+ menu_add_symbol(P_SELECT, sym_lookup($2, 0), $3);
+ printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_SELECT T_NOT T_WORD if_expr T_EOL
+{
+ menu_add_symbol(P_SELECTNOT, sym_lookup($3, 0), $4);
+ printd(DEBUG_PARSE, "%s:%d:selectnot\n", zconf_curname(), zconf_lineno());
+};
+
+config_option: T_RANGE symbol symbol if_expr T_EOL
+{
+ menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4);
+ printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
+};
+
+/* choice entry */
+
+choice: T_CHOICE T_EOL
+{
+ struct symbol *sym = sym_lookup(NULL, 0);
+ sym->flags |= SYMBOL_CHOICE;
+ menu_add_entry(sym);
+ menu_add_expr(P_CHOICE, NULL, NULL);
+ printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
+};
+
+choice_entry: choice choice_option_list
+{
+ menu_end_entry();
+ menu_add_menu();
+};
+
+choice_end: end
+{
+ if (zconf_endtoken($1, T_CHOICE, T_ENDCHOICE)) {
+ menu_end_menu();
+ printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
+ }
+};
+
+choice_stmt:
+ choice_entry choice_block choice_end
+ | choice_entry choice_block
+{
+ printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
+ zconfnerrs++;
+};
+
+choice_option_list:
+ /* empty */
+ | choice_option_list choice_option
+ | choice_option_list depends
+ | choice_option_list help
+ | choice_option_list T_EOL
+;
+
+choice_option: T_PROMPT prompt if_expr T_EOL
+{
+ menu_add_prompt(P_PROMPT, $2, $3);
+ printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
+};
+
+choice_option: T_TRISTATE prompt_stmt_opt T_EOL
+{
+ menu_set_type(S_TRISTATE);
+ printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
+};
+
+choice_option: T_BOOLEAN prompt_stmt_opt T_EOL
+{
+ menu_set_type(S_BOOLEAN);
+ printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
+};
+
+choice_option: T_OPTIONAL T_EOL
+{
+ current_entry->sym->flags |= SYMBOL_OPTIONAL;
+ printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
+};
+
+choice_option: T_DEFAULT T_WORD if_expr T_EOL
+{
+ menu_add_symbol(P_DEFAULT, sym_lookup($2, 0), $3);
+ printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
+};
+
+choice_block:
+ /* empty */
+ | choice_block common_block
+;
+
+/* if entry */
+
+if: T_IF expr T_EOL
+{
+ printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
+ menu_add_entry(NULL);
+ menu_add_dep($2);
+ menu_end_entry();
+ menu_add_menu();
+};
+
+if_end: end
+{
+ if (zconf_endtoken($1, T_IF, T_ENDIF)) {
+ menu_end_menu();
+ printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
+ }
+};
+
+if_stmt:
+ if if_block if_end
+ | if if_block
+{
+ printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
+ zconfnerrs++;
+};
+
+if_block:
+ /* empty */
+ | if_block common_block
+ | if_block menu_stmt
+ | if_block choice_stmt
+;
+
+/* menu entry */
+
+menu: T_MENU prompt T_EOL
+{
+ menu_add_entry(NULL);
+ menu_add_prop(P_MENU, $2, NULL, NULL);
+ printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
+};
+
+menu_entry: menu depends_list
+{
+ menu_end_entry();
+ menu_add_menu();
+};
+
+menu_end: end
+{
+ if (zconf_endtoken($1, T_MENU, T_ENDMENU)) {
+ menu_end_menu();
+ printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
+ }
+};
+
+menu_stmt:
+ menu_entry menu_block menu_end
+ | menu_entry menu_block
+{
+ printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
+ zconfnerrs++;
+};
+
+menu_block:
+ /* empty */
+ | menu_block common_block
+ | menu_block menu_stmt
+ | menu_block choice_stmt
+ | menu_block error T_EOL { zconfprint("invalid menu option"); yyerrok; }
+;
+
+source: T_SOURCE prompt T_EOL
+{
+ $$ = $2;
+ printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), $2);
+};
+
+source_stmt: source
+{
+ zconf_nextfile($1);
+};
+
+/* comment entry */
+
+comment: T_COMMENT prompt T_EOL
+{
+ menu_add_entry(NULL);
+ menu_add_prop(P_COMMENT, $2, NULL, NULL);
+ printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
+};
+
+comment_stmt: comment depends_list
+{
+ menu_end_entry();
+};
+
+/* help option */
+
+help_start: T_HELP T_EOL
+{
+ printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
+ zconf_starthelp();
+};
+
+help: help_start T_HELPTEXT
+{
+ current_entry->sym->help = $2;
+};
+
+/* depends option */
+
+depends_list: /* empty */
+ | depends_list depends
+ | depends_list T_EOL
+;
+
+depends: T_DEPENDS T_ON expr T_EOL
+{
+ menu_add_dep($3);
+ printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
+}
+ | T_DEPENDS expr T_EOL
+{
+ menu_add_dep($2);
+ printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
+}
+ | T_REQUIRES expr T_EOL
+{
+ menu_add_dep($2);
+ printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
+};
+
+/* prompt statement */
+
+prompt_stmt_opt:
+ /* empty */
+ | prompt if_expr
+{
+ menu_add_prop(P_PROMPT, $1, NULL, $2);
+};
+
+prompt: T_WORD
+ | T_WORD_QUOTE
+;
+
+end: T_ENDMENU nl_or_eof { $$ = T_ENDMENU; }
+ | T_ENDCHOICE nl_or_eof { $$ = T_ENDCHOICE; }
+ | T_ENDIF nl_or_eof { $$ = T_ENDIF; }
+;
+
+nl_or_eof:
+ T_EOL | T_EOF;
+
+if_expr: /* empty */ { $$ = NULL; }
+ | T_IF expr { $$ = $2; }
+;
+
+expr: symbol { $$ = expr_alloc_symbol($1); }
+ | symbol T_EQUAL symbol { $$ = expr_alloc_comp(E_EQUAL, $1, $3); }
+ | symbol T_UNEQUAL symbol { $$ = expr_alloc_comp(E_UNEQUAL, $1, $3); }
+ | T_OPEN_PAREN expr T_CLOSE_PAREN { $$ = $2; }
+ | T_NOT expr { $$ = expr_alloc_one(E_NOT, $2); }
+ | expr T_OR expr { $$ = expr_alloc_two(E_OR, $1, $3); }
+ | expr T_AND expr { $$ = expr_alloc_two(E_AND, $1, $3); }
+;
+
+symbol: T_WORD { $$ = sym_lookup($1, 0); free($1); }
+ | T_WORD_QUOTE { $$ = sym_lookup($1, 1); free($1); }
+;
+
+%%
+
+void conf_parse(const char *name)
+{
+ struct symbol *sym;
+ int i;
+
+ zconf_initscan(name);
+
+ sym_init();
+ menu_init();
+ modules_sym = sym_lookup("MODULES", 0);
+ rootmenu.prompt = menu_add_prop(P_MENU, "OpenADK Configuration", NULL, NULL);
+
+ //zconfdebug = 1;
+ zconfparse();
+ if (zconfnerrs)
+ exit(1);
+ menu_finalize(&rootmenu);
+ for_all_symbols(i, sym) {
+ if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym))
+ printf("\n");
+ else
+ sym->flags |= SYMBOL_CHECK_DONE;
+ }
+
+ sym_change_count = 1;
+}
+
+const char *zconf_tokenname(int token)
+{
+ switch (token) {
+ case T_MENU: return "menu";
+ case T_ENDMENU: return "endmenu";
+ case T_CHOICE: return "choice";
+ case T_ENDCHOICE: return "endchoice";
+ case T_IF: return "if";
+ case T_ENDIF: return "endif";
+ }
+ return "<token>";
+}
+
+static bool zconf_endtoken(int token, int starttoken, int endtoken)
+{
+ if (token != endtoken) {
+ zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
+ zconfnerrs++;
+ return false;
+ }
+ if (current_menu->file != current_file) {
+ zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
+ zconfprint("location of the '%s'", zconf_tokenname(starttoken));
+ zconfnerrs++;
+ return false;
+ }
+ return true;
+}
+
+static void zconfprint(const char *err, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
+ va_start(ap, err);
+ vfprintf(stderr, err, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
+
+static void zconferror(const char *err)
+{
+ fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
+}
+
+void print_quoted_string(FILE *out, const char *str)
+{
+ const char *p;
+ int len;
+
+ putc('"', out);
+ while ((p = strchr(str, '"'))) {
+ len = p - str;
+ if (len)
+ fprintf(out, "%.*s", len, str);
+ fputs("\\\"", out);
+ str = p + 1;
+ }
+ fputs(str, out);
+ putc('"', out);
+}
+
+void print_symbol(FILE *out, struct menu *menu)
+{
+ struct symbol *sym = menu->sym;
+ struct property *prop;
+
+ if (sym_is_choice(sym))
+ fprintf(out, "choice\n");
+ else
+ fprintf(out, "config %s\n", sym->name);
+ switch (sym->type) {
+ case S_BOOLEAN:
+ fputs(" boolean\n", out);
+ break;
+ case S_TRISTATE:
+ fputs(" tristate\n", out);
+ break;
+ case S_STRING:
+ fputs(" string\n", out);
+ break;
+ case S_INT:
+ fputs(" integer\n", out);
+ break;
+ case S_HEX:
+ fputs(" hex\n", out);
+ break;
+ default:
+ fputs(" ???\n", out);
+ break;
+ }
+ for (prop = sym->prop; prop; prop = prop->next) {
+ if (prop->menu != menu)
+ continue;
+ switch (prop->type) {
+ case P_PROMPT:
+ fputs(" prompt ", out);
+ print_quoted_string(out, prop->text);
+ if (!expr_is_yes(prop->visible.expr)) {
+ fputs(" if ", out);
+ expr_fprint(prop->visible.expr, out);
+ }
+ fputc('\n', out);
+ break;
+ case P_DEFAULT:
+ fputs( " default ", out);
+ expr_fprint(prop->expr, out);
+ if (!expr_is_yes(prop->visible.expr)) {
+ fputs(" if ", out);
+ expr_fprint(prop->visible.expr, out);
+ }
+ fputc('\n', out);
+ break;
+ case P_CHOICE:
+ fputs(" #choice value\n", out);
+ break;
+ default:
+ fprintf(out, " unknown prop %d!\n", prop->type);
+ break;
+ }
+ }
+ if (sym->help) {
+ int len = strlen(sym->help);
+ while (sym->help[--len] == '\n')
+ sym->help[len] = 0;
+ fprintf(out, " help\n%s\n", sym->help);
+ }
+ fputc('\n', out);
+}
+
+void zconfdump(FILE *out)
+{
+ struct property *prop;
+ struct symbol *sym;
+ struct menu *menu;
+
+ menu = rootmenu.list;
+ while (menu) {
+ if ((sym = menu->sym))
+ print_symbol(out, menu);
+ else if ((prop = menu->prompt)) {
+ switch (prop->type) {
+ case P_COMMENT:
+ fputs("\ncomment ", out);
+ print_quoted_string(out, prop->text);
+ fputs("\n", out);
+ break;
+ case P_MENU:
+ fputs("\nmenu ", out);
+ print_quoted_string(out, prop->text);
+ fputs("\n", out);
+ break;
+ default:
+ ;
+ }
+ if (!expr_is_yes(prop->visible.expr)) {
+ fputs(" depends ", out);
+ expr_fprint(prop->visible.expr, out);
+ fputc('\n', out);
+ }
+ fputs("\n", out);
+ }
+
+ if (menu->list)
+ menu = menu->list;
+ else if (menu->next)
+ menu = menu->next;
+ else while ((menu = menu->parent)) {
+ if (menu->prompt && menu->prompt->type == P_MENU)
+ fputs("\nendmenu\n", out);
+ if (menu->next) {
+ menu = menu->next;
+ break;
+ }
+ }
+ }
+}
+
+#include "lex.zconf.c"
+#include "confdata.c"
+#include "expr.c"
+#include "symbol.c"
+#include "menu.c"
diff --git a/mk/build.mk b/mk/build.mk
new file mode 100644
index 000000000..b08b97273
--- /dev/null
+++ b/mk/build.mk
@@ -0,0 +1,182 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+TOPDIR=$(shell pwd)
+export TOPDIR
+
+ifneq ($(shell umask 2>/dev/null | sed 's/0*022/OK/'),OK)
+$(error your umask is not 022)
+endif
+
+CONFIG_CONFIG_IN = Config.in
+CONFIG = config
+
+noconfig_targets:= menuconfig \
+ _config \
+ _mconfig \
+ tags
+
+MAKECLEAN_SYMBOLS= ADK_TARGET_LIB_UCLIBC ADK_TARGET_LIB_GLIBC ADK_SSP ADK_IPV6 ADK_CXX
+POSTCONFIG= -@\
+ if [ -f .config.old ];then \
+ if [ -d .cfg ];then \
+ what=cleandevice; \
+ for symbol in ${MAKECLEAN_SYMBOLS}; do \
+ newval=$$(grep -e "^$$symbol=" -e "^\# $$symbol " .config); \
+ oldval=$$(cat .cfg/"$$symbol" 2>&-); \
+ [[ $$newval = $$oldval ]] && continue; \
+ echo; \
+ echo >&2 "WARNING: Toolchain related options have changed, 'make" \
+ "$$what' might be required!"; \
+ break; \
+ done; \
+ fi; \
+ if [ "$$(grep ^BUSYBOX .config|md5sum)" != "$$(grep ^BUSYBOX .config.old|md5sum)" ];then \
+ if [ -f build_$(CPU_ARCH)/w-busybox*/busybox*/.configure_done ];then \
+ rm build_$(CPU_ARCH)/w-busybox*/busybox*/.configure_done; \
+ fi; \
+ fi; \
+ fi
+
+# Pull in the user's configuration file
+ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
+-include $(TOPDIR)/.config
+endif
+
+ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
+include $(TOPDIR)/rules.mk
+include ${TOPDIR}/mk/split-cfg.mk
+
+all: world
+
+.NOTPARALLEL:
+.PHONY: all world clean cleandevice cleandir distclean image_clean
+
+world: $(DISTDIR) $(BUILD_DIR) $(TARGET_DIR) $(PACKAGE_DIR) ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
+ ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
+ $(MAKE) -f mk/build.mk toolchain/install target/config-prepare target/compile package/compile root_clean package/install package_index target/install
+
+package_index:
+ -cd ${PACKAGE_DIR} && \
+ ${BASH} ${TOPDIR}/scripts/ipkg-make-index.sh . >Packages
+
+$(DISTDIR):
+ mkdir -p $(DISTDIR)
+
+$(BUILD_DIR):
+ mkdir -p $(BUILD_DIR)
+
+$(TARGET_DIR):
+ mkdir -p $(TARGET_DIR)
+
+$(PACKAGE_DIR):
+ mkdir -p ${PACKAGE_DIR}/.stamps
+
+${STAGING_DIR} ${STAGING_DIR}/etc ${STAGING_TOOLS}:
+ mkdir -p ${STAGING_DIR}/{bin,etc,include,lib,usr} \
+ ${STAGING_TOOLS}/{bin,lib}
+ cd ${STAGING_DIR}/usr; ln -s ../include include
+
+${STAGING_DIR}/etc/ipkg.conf: ${STAGING_DIR}/etc
+ echo "dest root /" >${STAGING_DIR}/etc/ipkg.conf
+ echo "option offline_root ${TARGET_DIR}" >>$(STAGING_DIR)/etc/ipkg.conf
+
+package/%: ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG ${STAGING_DIR}/etc/ipkg.conf
+ $(MAKE) -C package $(patsubst package/%,%,$@)
+
+target/%: ${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG
+ $(MAKE) -C target $(patsubst target/%,%,$@)
+
+toolchain/%: ${STAGING_DIR}
+ $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
+
+image:
+ $(MAKE) -C target image
+
+switch:
+ echo "Saving configuration for device: ${DEVICE}"
+ cp .config .config.${DEVICE}
+ if [ -f .config.${DEV} ];then cp .config.${DEV} .config; \
+ cp .config.${DEV} .config.old; \
+ echo "Setting configuration to device: ${DEV}"; \
+ else echo "No old device config found";mv .config .config.bak;fi
+
+#############################################################
+#
+# Cleanup and misc junk
+#
+#############################################################
+root_clean:
+ @$(TRACE) root_clean
+ rm -rf $(TARGET_DIR)
+
+clean:
+ @$(TRACE) clean
+ $(MAKE) -C $(CONFIG) clean
+ rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) ${TOPDIR}/.cfg
+ rm -f ${TOPDIR}/package/*/info.mk
+
+cleankernel:
+ @$(TRACE) cleankernel
+ rm -rf $(TOOLCHAIN_BUILD_DIR)/linux* $(BUILD_DIR)/linux
+
+cleandir:
+ @$(TRACE) cleandir
+ $(MAKE) -C $(CONFIG) clean
+ rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) ${TOPDIR}/.cfg
+ rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
+ rm -f .tmpconfig.h ${TOPDIR}/package/*/info.mk
+
+cleandevice:
+ @$(TRACE) cleandevice
+ $(MAKE) -C $(CONFIG) clean
+ rm -rf $(BUILD_DIR) $(BIN_DIR) $(TARGET_DIR) ${TOPDIR}/.cfg
+ rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT)
+ rm -f .tmpconfig.h ${TOPDIR}/package/*/info.mk
+
+distclean:
+ @$(TRACE) distclean
+ $(MAKE) -C $(CONFIG) clean
+ rm -rf $(BUILD_DIR_PFX) $(BIN_DIR_PFX) $(TARGET_DIR_PFX) $(DISTDIR) ${TOPDIR}/.cfg
+ rm -rf $(TOOLCHAIN_BUILD_DIR_PFX) $(STAGING_PARENT_PFX) $(TOOLS_BUILD_DIR)
+ rm -f .config* .tmpconfig.h ${TOPDIR}/package/*/info.mk
+
+else # ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
+
+include $(TOPDIR)/prereq.mk
+
+all: menuconfig
+ @echo "Start the build with \"make\" or with \"make v\" to be verbose"
+
+# configuration
+# ---------------------------------------------------------------------------
+
+$(CONFIG)/conf:
+ @$(MAKE) -C $(CONFIG) conf
+
+$(CONFIG)/mconf:
+ @$(MAKE) -C $(CONFIG)
+
+menuconfig: $(CONFIG)/mconf
+ @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
+ ${POSTCONFIG}
+
+_config: $(CONFIG)/conf
+ -@touch .config
+ @$(CONFIG)/conf ${W} $(CONFIG_CONFIG_IN) >/dev/null
+ ${POSTCONFIG}
+
+.NOTPARALLEL: _mconfig
+_mconfig: ${CONFIG}/conf _mconfig2 _config
+_mconfig2: ${CONFIG}/conf
+ @${CONFIG}/conf -M ${RCONFIG} >/dev/null
+
+distclean:
+ @$(MAKE) -C $(CONFIG) clean
+ rm -rf $(BUILD_DIR) $(TOOLS_BUILD_DIR) $(BIN_DIR) $(DISTDIR) ${TOPDIR}/.cfg
+ rm -rf $(TOOLCHAIN_BUILD_DIR) $(STAGING_PARENT) $(TARGET_DIR)
+ rm -f .config* .tmpconfig.h ${TOPDIR}/package/*/info.mk
+
+endif # ifeq ($(strip $(ADK_HAVE_DOT_CONFIG)),y)
diff --git a/mk/buildhlp.mk b/mk/buildhlp.mk
new file mode 100644
index 000000000..b6b70d67d
--- /dev/null
+++ b/mk/buildhlp.mk
@@ -0,0 +1,98 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+ifneq ($(strip ${MASTER_SITES}),)
+ifeq ($(strip ${DISTFILES}),)
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
+endif
+endif
+
+# This is where all package operation is done in
+WRKDIR?= ${WRKDIR_BASE}/w-${PKG_NAME}-${PKG_VERSION}-${PKG_RELEASE}
+# This is where source code is extracted and patched
+WRKDIST?= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}
+# This is where the configure script is seeked (localed)
+WRKSRC?= ${WRKDIST}
+# This is where configure, make and make install (fake) run from
+WRKBUILD?= ${WRKSRC}
+# This is where make install (fake) writes to
+WRKINST?= ${WRKDIR}/fake-${ARCH}/root
+
+ifeq ($(strip ${NO_CHECKSUM}),)
+_CHECKSUM_COOKIE= ${WRKDIR}/.checksum_done
+else
+_CHECKSUM_COOKIE=
+endif
+
+post-extract:
+
+ifeq ($(strip ${NO_DISTFILES}),1)
+${WRKDIST}/.extract_done:
+ rm -rf ${WRKDIST} ${WRKSRC} ${WRKBUILD}
+ mkdir -p ${WRKDIR} ${WRKDIST}
+ ${MAKE} do-extract
+ @${MAKE} post-extract
+ touch $@
+
+fetch refetch checksum do-extract:
+
+__use_generic_patch_target:=42
+else ifneq ($(strip ${DISTFILES}),)
+include ${TOPDIR}/mk/fetch.mk
+
+${WRKDIST}/.extract_done: ${_CHECKSUM_COOKIE}
+ifeq (${_CHECKSUM_COOKIE},)
+ rm -rf ${WRKDIST} ${WRKSRC} ${WRKBUILD}
+endif
+ ${EXTRACT_CMD}
+ @${MAKE} post-extract
+ touch $@
+
+__use_generic_patch_target:=42
+else ifeq ($(strip ${_IN_PACKAGE}),1)
+$(warning This package does not use the generic extraction and patch target; it's most likely to fail.)
+endif
+
+ifeq ($(strip ${__use_generic_patch_target}),42)
+post-patch:
+${WRKDIST}/.prepared: ${WRKDIST}/.extract_done
+ [ ! -d ./patches ] || ${PREVENT_PATCH} ${PATCH} ${WRKDIST} ./patches \
+ '{patch-!(*.orig),*.patch}' $(MAKE_TRACE)
+ [ ! -d ./extra ] || (cd extra; $(PREVENT_PATCH) cp -Rp . ${WRKDIST}/) \
+ $(MAKE_TRACE)
+ @${MAKE} post-patch $(MAKE_TRACE)
+ touch $@
+endif
+
+update-patches:
+ @test ! -d ${WRKDIR}.orig || rm -rf ${WRKDIR}.orig
+ @test ! -d ${WRKDIR}.orig
+ifeq ($(strip ${_IN_PACKAGE})$(strip ${_IN_CVTC}),1)
+ @$(MAKE) -s V=0 patch WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1
+else
+ @$(MAKE) -s V=0 prepare WRKDIR=${WRKDIR}.orig PREVENT_PATCH=: NO_CHECKSUM=1
+endif
+ @# restore config.sub/config.guess
+ @for i in $$(find ${WRKDIR} -name config.sub);do \
+ if [ -f $$i.bak ];then \
+ mv $$i.bak $$i; \
+ fi;\
+ done
+ @for i in $$(find ${WRKDIR} -name config.guess);do \
+ if [ -f $$i.bak ];then \
+ mv $$i.bak $$i; \
+ fi;\
+ done
+ @toedit=$$(WRKDIST='${WRKDIST}' CURDIR=$$(pwd) \
+ PATCH_LIST='patch-* *.patch' WRKDIR1='${WRKDIR}' \
+ ${BASH} ${TOPDIR}/scripts/update-patches); \
+ if [[ -n $$toedit && $$toedit != FAIL ]]; then \
+ echo -n 'edit patches: '; read i; \
+ cd patches && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit; \
+ fi; \
+ rm -rf ${WRKDIR}.orig; \
+ [[ $$toedit != FAIL ]]
+
+.PHONY: update-patches
diff --git a/mk/cpu.mk b/mk/cpu.mk
new file mode 100644
index 000000000..8eb047bc9
--- /dev/null
+++ b/mk/cpu.mk
@@ -0,0 +1,23 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+#
+# optimization configure options for CPU features
+
+ifeq ($(DEVICE),alix1c)
+CONFIGURE_CPU_OPTS:= --disable-ssse3 \
+ --disable-sse \
+ --enable-amd3dnow \
+ --enable-amd3dnowext \
+ --enable-mmx \
+ --enable-mmx2
+else
+CONFIGURE_CPU_OPTS:= --disable-ssse3 \
+ --disable-sse \
+ --disable-mmxext \
+ --disable-amd3dnow \
+ --disable-amd3dnowext \
+ --disable-mmx \
+ --disable-mmx2
+endif
diff --git a/mk/fetch.mk b/mk/fetch.mk
new file mode 100644
index 000000000..c4625ccee
--- /dev/null
+++ b/mk/fetch.mk
@@ -0,0 +1,83 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+#-
+
+ifneq ($(strip ${DIST_SUBDIR}),)
+FULLDISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
+else
+FULLDISTDIR?= ${DISTDIR}
+endif
+
+FULLDISTFILES= $(patsubst %,${FULLDISTDIR}/%,${DISTFILES})
+
+FETCH_STYLE?= auto
+#pre-fetch:
+do-fetch:
+#post-fetch:
+fetch:
+# @${MAKE} pre-fetch
+ifneq ($(filter auto,${FETCH_STYLE}),)
+ ${MAKE} ${FULLDISTFILES}
+else
+ ${MAKE} do-fetch
+endif
+# @${MAKE} post-fetch
+
+refetch:
+ -rm -f ${FULLDISTFILES}
+ ${MAKE} fetch
+
+# XXX for now
+_CHECKSUM_COOKIE?= ${WRKDIR}/.checksum_done
+checksum: ${_CHECKSUM_COOKIE}
+ifeq ($(strip ${NO_CHECKSUM}),)
+${_CHECKSUM_COOKIE}: ${FULLDISTFILES}
+ rm -rf ${WRKDIR}
+ @OK=n; \
+ (md5sum ${FULLDISTFILES}; echo exit) | while read sum name; do \
+ if [[ $$sum = exit ]]; then \
+ [[ $$OK = n ]] && echo >&2 "==> No distfile found!" || :; \
+ [[ $$OK = 1 ]] || exit 1; \
+ break; \
+ fi; \
+ if [[ $$sum = "$(strip ${PKG_MD5SUM})" ]]; then \
+ [[ $$OK = 0 ]] || OK=1; \
+ continue; \
+ fi; \
+ echo >&2 "==> Checksum mismatch for $${name##*/} (MD5)"; \
+ echo >&2 ":---> should be '$(strip ${PKG_MD5SUM})'"; \
+ echo >&2 ":---> really is '$$sum'"; \
+ OK=0; \
+ done
+ mkdir -p ${WRKDIR}
+ touch ${_CHECKSUM_COOKIE}
+endif
+
+# GNU make's poor excuse for loops
+define FETCH_template
+$(1):
+ @fullname='$(1)'; \
+ subname=$$$${fullname##$${DISTDIR}/}; \
+ filename=$$$${fullname##*/}; \
+ i='$${LOCAL_DISTDIR}'; \
+ if [[ -n $$$$i && -e $$$$i/$$$$subname ]]; then \
+ cd "$$$$i"; \
+ echo pax -rw "$$$$subname" '$${DISTDIR}/'; \
+ exec pax -rw "$$$$subname" '$${DISTDIR}/'; \
+ fi; \
+ mkdir -p "$$$${fullname%%/$$$$filename}"; \
+ cd "$$$${fullname%%/$$$$filename}"; \
+ for site in $${MASTER_SITES} $${MASTER_SITE_BACKUP}; do \
+ : echo "$${FETCH_CMD} $$$$site$$$$filename"; \
+ rm -f "$$$$filename"; \
+ if $${FETCH_CMD} $$$$site$$$$filename; then \
+ : check the size here; \
+ [[ ! -e $$$$filename ]] || exit 0; \
+ fi; \
+ done; \
+ exit 1
+endef
+
+$(foreach distfile,${FULLDISTFILES},$(eval $(call FETCH_template,$(distfile))))
diff --git a/mk/image.mk b/mk/image.mk
new file mode 100644
index 000000000..4388dcaad
--- /dev/null
+++ b/mk/image.mk
@@ -0,0 +1,69 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+imageprepare: kernel-install image-prepare-post
+
+image-prepare-post:
+ rng=/dev/arandom; test -e $$rng || rng=/dev/urandom; \
+ dd if=$$rng bs=512 count=1 >>${TARGET_DIR}/etc/.rnd 2>/dev/null; \
+ chmod 600 ${TARGET_DIR}/etc/.rnd
+ # Sanity checks
+ @cd ${TARGET_DIR}; ls=; ln=; li=; x=1; md5sum $$(find . -type f) | \
+ sed -e "s/*//" | \
+ while read sum name; do \
+ inode=$$(ls -i "$$name"); \
+ echo "$$sum $${inode%% *} $$name"; \
+ done | sort | while read sum inode name; do \
+ if [[ $$sum = $$ls ]]; then \
+ [[ $$li = $$inode ]] && continue; \
+ case $$x in \
+ 1) echo 'WARNING: duplicate files found' \
+ 'in filesystem! Please fix them.' >&2; \
+ echo -n "> $$ln "; \
+ ;; \
+ 2) echo -n "> $$ln "; \
+ ;; \
+ 3) echo -n ' '; \
+ ;; \
+ esac; \
+ echo -n "$$name"; \
+ x=3; \
+ else \
+ case $$x in \
+ 3) echo; \
+ x=2; \
+ ;; \
+ esac; \
+ fi; \
+ ls=$$sum; \
+ ln=$$name; \
+ li=$$inode; \
+ done
+ chmod 4511 ${TARGET_DIR}/bin/busybox
+ chmod 1777 ${TARGET_DIR}/tmp
+
+INITRAMFS= ${DEVICE}-${ARCH}-${FS}
+ROOTFSSQUASHFS= ${DEVICE}-${ARCH}-${FS}.fimage
+ROOTFSTARBALL= ${DEVICE}-${ARCH}-${FS}.tar.gz
+
+${BIN_DIR}/${ROOTFSTARBALL}: ${TARGET_DIR}
+ cd ${TARGET_DIR}; tar -cf - --owner=0 --group=0 . | gzip -n9 >$@
+
+${BIN_DIR}/${INITRAMFS}: ${TARGET_DIR}
+ cd ${TARGET_DIR}; find . | sed -n '/^\.\//s///p' | sort | \
+ cpio -R 0:0 --quiet -oC512 -Mdist -Hnewc | gzip -n9 >$@
+
+${BIN_DIR}/${ROOTFSSQUASHFS}: ${TARGET_DIR}
+ PATH='${TARGET_PATH}' \
+ mksquashfs ${TARGET_DIR} ${BUILD_DIR}/root.squashfs \
+ -nopad -noappend -root-owned -le $(MAKE_TRACE)
+ # padding of images is required
+ cat ${BIN_DIR}/${DEVICE}-${ARCH}-kernel ${BUILD_DIR}/root.squashfs > \
+ ${BUILD_DIR}/${ROOTFSSQUASHFS}
+ dd if=${BUILD_DIR}/${ROOTFSSQUASHFS} of=${BIN_DIR}/${ROOTFSSQUASHFS} \
+ bs=4063232 conv=sync $(MAKE_TRACE)
+
+imageclean:
+ rm -f $(BIN_DIR)/$(DEVICE)-*
diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk
new file mode 100644
index 000000000..c07e34c23
--- /dev/null
+++ b/mk/kernel-build.mk
@@ -0,0 +1,61 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/linux.mk
+include ${TOPDIR}/mk/buildhlp.mk
+
+KERNEL_IDIR:=$(LINUX_BUILD_DIR)/kernel-ipkg
+
+$(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION)/.patched:
+ $(TRACE) target/$(DEVICE)-kernel-patch
+ $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../linux/patches *.patch $(MAKE_TRACE)
+ $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../linux/patches/$(KERNEL_VERSION) *.patch $(MAKE_TRACE)
+ $(PATCH) $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) ../$(DEVICE)/patches *.patch $(MAKE_TRACE)
+ touch $@
+
+$(LINUX_DIR)/.prepared: $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION)/.patched
+ $(TRACE) target/$(DEVICE)-kernel-prepare
+ ln -sf $(TOOLCHAIN_BUILD_DIR)/linux-$(KERNEL_VERSION) $(LINUX_DIR)
+ mkdir -p $(LINUX_BUILD_DIR)/kmod-control
+ touch $@
+
+$(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig
+ $(TRACE) target/$(DEVICE)-kernel-configure
+ for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done $(MAKE_TRACE)
+ $(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/.config
+ echo N | $(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" oldconfig $(MAKE_TRACE)
+ $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" prepare scripts $(MAKE_TRACE)
+ touch -c $(LINUX_DIR)/.config
+
+$(LINUX_DIR)/vmlinux: $(LINUX_DIR)/.config
+ $(TRACE) target/$(DEVICE)-kernel-compile
+ $(MAKE) -C $(LINUX_DIR) V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) CC="$(TARGET_CC)" $(MAKE_TRACE)
+ $(TRACE) target/$(DEVICE)-kernel-modules-install
+ rm -rf $(LINUX_BUILD_DIR)/modules
+ $(MAKE) -C "$(LINUX_DIR)" V=1 CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(ARCH) DEPMOD=true INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules modules_install $(MAKE_TRACE)
+ $(TRACE) target/$(DEVICE)-create-packages
+ $(MAKE) $(KERNEL_IPKG) $(TARGETS)
+ touch -c $(LINUX_DIR)/vmlinux
+
+$(KERNEL_IPKG):
+ $(TRACE) target/$(DEVICE)-create-kernel-package
+ rm -rf $(KERNEL_IDIR)
+ @mkdir -p $(KERNEL_IDIR)/etc
+ ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh ${KERNEL_IDIR} \
+ ../linux/kernel.control ${DEVICE}-${KERNEL_VERSION} ${ARCH}
+ $(IPKG_BUILD) $(KERNEL_IDIR) $(PACKAGE_DIR) $(MAKE_TRACE)
+
+prepare:
+compile: $(LINUX_DIR)/vmlinux
+install: compile
+ifneq ($(strip $(INSTALL_TARGETS)),)
+ $(TRACE) target/${DEVICE}-modules-install
+ $(IPKG) install $(INSTALL_TARGETS) $(MAKE_TRACE)
+endif
+
+clean:
+ rm -rf $(LINUX_BUILD_DIR)
+ rm -f $(TARGETS)
diff --git a/mk/kernel.mk b/mk/kernel.mk
new file mode 100644
index 000000000..06f3ebde2
--- /dev/null
+++ b/mk/kernel.mk
@@ -0,0 +1,77 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+
+LINUX_KMOD_SUFFIX=ko
+MODULES_SUBDIR := lib/modules/$(KERNEL_VERSION)
+LINUX_BUILD_DIR := $(BUILD_DIR)/linux-$(ARCH)-$(DEVICE)
+KMOD_BUILD_DIR := $(LINUX_BUILD_DIR)/linux-modules
+MODULES_DIR := $(LINUX_BUILD_DIR)/modules/$(MODULES_SUBDIR)
+TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
+
+KERNEL_IPKG:=$(PACKAGE_DIR)/kernel_$(DEVICE)-$(KERNEL_VERSION)_$(ARCH).ipk
+INSTALL_TARGETS:= $(KERNEL_IPKG)
+NOINSTALL_TARGETS:=
+TARGETS:=
+
+# KMOD_template
+#
+# Adds a target for creating a package containing
+# the specified (kernel-provided) modules.
+# Parameters:
+# 1: the config symbol name (without leading 'ADK_[K,]PACKAGE_KMOD_')
+# this _must_ be equal to the kernel config symbol name
+# 2: the name for the package, should be unique
+# 3: actual modules to add; absolute path inside $(MODULES_DIR)
+# OMIT THE KERNEL-SPECIFIC EXTENSION!
+# 4: order of module loading at system startup; the modules in $(3) are (in their order)
+# added to this file, if $(6) is non-empty
+# 5: the kmod packages this package depends on
+#
+define KMOD_template
+
+IDEPENDK_$(1):=kernel ($(DEVICE)-$(KERNEL_VERSION)) $(foreach pkg,$(5),", $(pkg)")
+
+PKG_$(1) := $(PACKAGE_DIR)/kmod-$(2)_$(DEVICE)-$(KERNEL_VERSION)-$(KERNEL_RELEASE)_$(ARCH).ipk
+I_$(1) := $(KMOD_BUILD_DIR)/ipkg/$(2)
+
+ifeq ($$(ADK_KPACKAGE_KMOD_$(1)),m)
+TARGETS+=$$(PKG_$(1))
+endif
+ifeq ($$(ADK_KPACKAGE_KMOD_$(1)),y)
+TARGETS+=$$(PKG_$(1))
+INSTALL_TARGETS+=$$(PKG_$(1))
+endif
+
+$$(PKG_$(1)):
+ rm -rf $$(I_$(1))
+ echo "Package: kmod-$(2)" > $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
+ echo "Priority: optional" >> $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
+ echo "Section: sys" >> $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
+ echo "Description: kernel module $(2)" >> $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control
+ ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh $$(I_$(1)) \
+ $(LINUX_BUILD_DIR)/kmod-control/kmod-$(2).control \
+ $(DEVICE)-$(KERNEL_VERSION)-$(KERNEL_RELEASE) $(ARCH)
+ echo "Depends: $$(IDEPENDK_$(1))" >> $$(I_$(1))/CONTROL/control
+ifneq ($(strip $(3)),)
+ mkdir -p $$(I_$(1))/lib/modules/$(KERNEL_VERSION)
+ $(CP) $(foreach mod,$(3),$(mod).$(LINUX_KMOD_SUFFIX)) $$(I_$(1))/lib/modules/$(KERNEL_VERSION)
+ifneq ($(4),)
+ mkdir -p $$(I_$(1))/etc/modules.d
+ for module in $(notdir $(3)); do \
+ echo $$$$module >> $$(I_$(1))/etc/modules.d/$(4)-$(2); \
+ done
+ echo "#!/bin/sh" >> $$(I_$(1))/CONTROL/postinst
+ echo "if [ -z \"\$$$${IPKG_INSTROOT}\" ]; then" >> $$(I_$(1))/CONTROL/postinst
+ echo ". /etc/functions.sh" >> $$(I_$(1))/CONTROL/postinst
+ echo "load_modules /etc/modules.d/$(4)-$(2)" >> $$(I_$(1))/CONTROL/postinst
+ echo "fi" >> $$(I_$(1))/CONTROL/postinst
+ chmod 0755 $$(I_$(1))/CONTROL/postinst
+endif
+endif
+ $(IPKG_BUILD) $$(I_$(1)) $(PACKAGE_DIR) $(MAKE_TRACE)
+endef
+
+include $(BUILD_DIR)/.kernelconfig
diff --git a/mk/linux.mk b/mk/linux.mk
new file mode 100644
index 000000000..e9d17e231
--- /dev/null
+++ b/mk/linux.mk
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= linux
+PKG_VERSION:= $(KERNEL_VERSION)
+PKG_RELEASE:= $(KERNEL_RELEASE)
+PKG_MD5SUM= $(KERNEL_MD5SUM)
+DISTFILES= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
+MASTER_SITES= ${MASTER_SITE_KERNEL:=kernel/v2.6/}
diff --git a/mk/mirrors.mk b/mk/mirrors.mk
new file mode 100644
index 000000000..bbf41417a
--- /dev/null
+++ b/mk/mirrors.mk
@@ -0,0 +1,147 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+MASTER_SITE_BACKUP?= ${MASTER_SITE_OPENADK}
+
+MASTER_SITE_OPENADK?= \
+ http://www.openadk.org/distfiles/ \
+
+MASTER_SITE_MIRBSD?= \
+ http://www.mirbsd.org/MirOS/distfiles/ \
+ http://pub.allbsd.org/MirOS/distfiles/ \
+
+MASTER_SITE_KERNEL?= \
+ http://www.de.kernel.org/pub/linux/ \
+ http://www.fi.kernel.org/pub/linux/ \
+ http://www.fr.kernel.org/pub/linux/ \
+ http://www.kernel.org/pub/linux/ \
+
+MASTER_SITE_XORG?= \
+ http://ftp.gwdg.de/pub/x11/x.org/pub/X11R7.4/src/everything/ \
+ http://xorg.freedesktop.org/releases/X11R7.4/src/everything/ \
+ http://xorg.freedesktop.org/releases/individual/lib/ \
+
+MASTER_SITE_GNU?= \
+ http://ftp.gnu.org/gnu/ \
+ ftp://ftp.gnu.org/gnu/ \
+ ftp://ftp.funet.fi/pub/gnu/prep/ \
+ ftp://mirrors.usc.edu/pub/gnu/ \
+ ftp://ftp.cs.tu-berlin.de/pub/gnu/ \
+ ftp://aeneas.mit.edu/pub/gnu/ \
+ ftp://mirrors.dotsrc.org/gnu/ \
+ ftp://ftp.wustl.edu/pub/gnu/ \
+ ftp://ftp.kddilabs.jp/GNU/ \
+ ftp://ftp.mirror.ac.uk/sites/ftp.gnu.org/gnu/ \
+ ftp://sunsite.org.uk/package/gnu/ \
+ ftp://ftp.informatik.hu-berlin.de/pub/gnu/ \
+ ftp://ftp.rediris.es/mirror/gnu/gnu/ \
+ ftp://ftp.cs.univ-paris8.fr/mirrors/ftp.gnu.org/ \
+ ftp://ftp.chg.ru/pub/gnu/ \
+ ftp://ftp.uvsq.fr/pub/gnu/ \
+ ftp://ftp.sunet.se/pub/gnu/ \
+
+MASTER_SITE_SOURCEFORGE?= \
+ http://easynews.dl.sourceforge.net/sourceforge/ \
+ http://puzzle.dl.sourceforge.net/sourceforge/ \
+ http://optusnet.dl.sourceforge.net/sourceforge/ \
+ http://heanet.dl.sourceforge.net/sourceforge/ \
+ http://jaist.dl.sourceforge.net/sourceforge/ \
+ http://nchc.dl.sourceforge.net/sourceforge/ \
+ http://switch.dl.sourceforge.net/sourceforge/ \
+ http://kent.dl.sourceforge.net/sourceforge/ \
+ http://internap.dl.sourceforge.net/sourceforge/ \
+ http://mesh.dl.sourceforge.net/sourceforge/ \
+ http://ovh.dl.sourceforge.net/sourceforge/ \
+ http://surfnet.dl.sourceforge.net/sourceforge/ \
+ http://ufpr.dl.sourceforge.net/sourceforge/ \
+
+MASTER_SITE_MYSQL?= \
+ ftp://ftp.fu-berlin.de/unix/databases/mysql/ \
+ http://sunsite.informatik.rwth-aachen.de/mysql/ \
+ http://mysql.easynet.be/ \
+ http://mysql.blic.net/ \
+ http://mysql.online.bg/ \
+ http://mysql.mirrors.cybercity.dk/ \
+ http://mirrors.dotsrc.org/mysql/ \
+ http://mysql.tonnikala.org/ \
+ ftp://ftp.inria.fr/pub/MySQL/ \
+ http://mirrors.ircam.fr/pub/mysql/ \
+ http://mirrors.ee.teiath.gr/mysql/ \
+ http://mysql.sote.hu/ \
+ http://mysql.mirrors.crysys.hit.bme.hu/ \
+ http://na.mirror.garr.it/mirrors/MySQL/ \
+ http://mysql.bst.lt/ \
+ http://mysql.proserve.nl/ \
+ http://mirror.hostfuss.com/mysql/ \
+ http://mysql.mirrors.webazilla.nl/ \
+ http://mirror.dinpris.com/mysql/ \
+ http://mysql.nfsi.pt/ \
+ http://lisa.gov.pt/ftp/mysql/ \
+ ftp://mirrors.fibernet.ro/1/MySQL/ \
+ http://mysql.ran.ro/ \
+ http://mysql.directnet.ru/ \
+ ftp://ftp.dn.ru/pub/MySQL/ \
+ http://mysql.dn.ru/ \
+ http://mysql.mix.su/ \
+ http://www.fastmirrors.org/mysql/ \
+ http://mirrors.bevc.net/mysql/ \
+ http://www.wsection.com/mysql/ \
+ http://mysql.paknet.org/ \
+ http://mysql.rediris.es/ \
+ http://mysql.dataphone.se/ \
+ http://mirror.switch.ch/ftp/mirror/mysql/ \
+ ftp://ftp.solnet.ch/mirror/mysql/ \
+ http://mysql.net.ua/ \
+ ftp://ftp.tlk-l.net/pub/mirrors/mysql.com/ \
+ http://mysql.infocom.ua/ \
+ http://www.mirrorservice.org/sites/ftp.mysql.com/ \
+ http://mirrors.dedipower.com/www.mysql.com/ \
+ http://www.mirror.ac.uk/mirror/www.mysql.org/ \
+ http://mysql.mirror.rafal.ca/ \
+ http://mysql.serenitynet.com/ \
+ ftp://mirror.mcs.anl.gov/pub/mysql/ \
+ http://mirror.services.wisc.edu/mysql/ \
+ http://mysql.orst.edu/ \
+ http://mysql.he.net/ \
+ http://mysql.mirrors.pair.com/ \
+ http://mysql.mirror.redwire.net/ \
+ http://mysql.mirrors.hoobly.com/ \
+ http://mirror.trouble-free.net/mysql_mirror/ \
+ http://mirrors.24-7-solutions.net/pub/mysql/ \
+ http://www.stathy.com/mysql/ \
+ http://mirror.x10.com/mirror/mysql/ \
+ http://mysql.localhost.net.ar/ \
+ http://mirrors.uol.com.br/pub/mysql/ \
+ http://mysql.vision.cl/ \
+ http://mysql.tecnoera.com/ \
+ http://mysql.mirrors.arminco.com/ \
+ http://mysqlmirror.netandhost.in/ \
+ http://mirror.mysql-partners-jp.biz/ \
+ http://ftp.iij.ad.jp/pub/db/mysql/ \
+ http://mysql.oss.eznetsols.org/ \
+ http://mysql.holywar.net/ \
+ http://mysql.new21.com/ \
+ http://mysql.byungsoo.net/ \
+ http://mysql.isu.edu.tw/ \
+ http://mysql.cdpa.nsysu.edu.tw/ \
+ http://mysql.cs.pu.edu.tw/ \
+ http://ftp.stu.edu.tw/pub/Unix/Database/Mysql/ \
+ http://mysql.ntu.edu.tw/ \
+ http://mysql.planetmirror.com/ \
+ http://mysql.mirrors.ilisys.com.au/ \
+ http://mysql.inspire.net.nz/ \
+ http://mysql.mirror.ac.za/ \
+
+MASTER_SITE_GNOME+= \
+ ftp://ftp.acc.umu.se/pub/GNOME/sources/ \
+ ftp://ftp.rpmfind.net/linux/gnome.org/sources/ \
+ ftp://ftp.unina.it/pub/linux/GNOME/sources/ \
+ ftp://ftp.belnet.be/mirror/ftp.gnome.org/sources/ \
+ ftp://ftp.dit.upm.es/linux/gnome/sources/ \
+ ftp://ftp.dataplus.se/pub/linux/gnome/sources/ \
+ ftp://ftp.cse.buffalo.edu/pub/Gnome/sources/ \
+ ftp://ftp.linux.org.uk/mirrors/ftp.gnome.org/sources/ \
+ ftp://ftp.gnome.org/pub/GNOME/sources/ \
+
diff --git a/mk/modules.mk b/mk/modules.mk
new file mode 100644
index 000000000..5283d1ed7
--- /dev/null
+++ b/mk/modules.mk
@@ -0,0 +1,1254 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+#
+# Ethernet network devices
+#
+$(eval $(call KMOD_template,NE2K_PCI,ne2k-pci,\
+ $(MODULES_DIR)/kernel/drivers/net/8390 \
+ $(MODULES_DIR)/kernel/drivers/net/ne2k-pci \
+,20))
+
+$(eval $(call KMOD_template,E100,e100,\
+ $(MODULES_DIR)/kernel/drivers/net/e100 \
+,20))
+
+$(eval $(call KMOD_template,E1000,e1000,\
+ $(MODULES_DIR)/kernel/drivers/net/e1000/e1000 \
+,20))
+
+#
+# Wireless network devices
+#
+$(eval $(call KMOD_template,MAC80211,mac80211,\
+ $(MODULES_DIR)/kernel/net/wireless/cfg80211 \
+ $(MODULES_DIR)/kernel/net/mac80211/mac80211 \
+,15, kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-ecb kmod-crc32))
+
+$(eval $(call KMOD_template,ATH5K,mac80211-ath5k,\
+ $(MODULES_DIR)/kernel/drivers/net/wireless/ath5k/ath5k \
+,20, kmod-led-class))
+
+$(eval $(call KMOD_template,RT2X00,mac80211-rt2x00,\
+ $(MODULES_DIR)/kernel/drivers/net/wireless/rt2x00/rt2x00lib \
+ $(MODULES_DIR)/kernel/drivers/net/wireless/rt2x00/rt2x00pci \
+,17))
+
+$(eval $(call KMOD_template,RT2400PCI,mac80211-rt2400pci,\
+ $(MODULES_DIR)/kernel/drivers/net/wireless/rt2x00/rt2400pci \
+,20, kmod-led-class kmod-mac80211-rt2x00))
+
+$(eval $(call KMOD_template,RT2500PCI,mac80211-rt2500pci,\
+ $(MODULES_DIR)/kernel/drivers/net/wireless/rt2x00/rt2500pci \
+,20, kmod-led-class kmod-mac80211-rt2x00))
+
+$(eval $(call KMOD_template,RT61PCI,mac80211-rt61pci,\
+ $(MODULES_DIR)/kernel/drivers/net/wireless/rt2x00/rt61pci \
+,20, kmod-led-class kmod-mac80211-rt2x00))
+
+#
+# Networking
+#
+$(eval $(call KMOD_template,ATM,atm,\
+ $(MODULES_DIR)/kernel/net/atm/atm \
+,50))
+
+$(eval $(call KMOD_template,BRIDGE,bridge,\
+ $(MODULES_DIR)/kernel/net/llc/llc \
+ $(MODULES_DIR)/kernel/net/bridge/bridge \
+,10))
+
+$(eval $(call KMOD_template,NET_IPGRE,gre,\
+ $(MODULES_DIR)/kernel/net/ipv4/ip_gre \
+,50))
+
+$(eval $(call KMOD_template,NET_IPIP,ipip,\
+ $(MODULES_DIR)/kernel/net/ipv4/tunnel4 \
+ $(MODULES_DIR)/kernel/net/ipv4/ipip \
+,60))
+
+$(eval $(call KMOD_template,IPV6,ipv6,\
+ $(MODULES_DIR)/kernel/net/ipv6/ipv6 \
+,20))
+
+$(eval $(call KMOD_template,IPV6_SIT,ipv6-sit,\
+ $(MODULES_DIR)/kernel/net/ipv6/sit \
+,25))
+
+$(eval $(call KMOD_template,PPP,ppp,\
+ $(MODULES_DIR)/kernel/drivers/net/slhc \
+ $(MODULES_DIR)/kernel/drivers/net/ppp_generic \
+ $(MODULES_DIR)/kernel/drivers/net/ppp_async \
+ $(MODULES_DIR)/kernel/drivers/net/pppox \
+,50))
+
+$(eval $(call KMOD_template,MPPE,mppe,\
+ $(MODULES_DIR)/kernel/drivers/net/ppp_mppe_mppc \
+,55))
+
+$(eval $(call KMOD_template,PPPOATM,pppoatm,\
+ $(MODULES_DIR)/kernel/net/atm/pppoatm \
+,60))
+
+$(eval $(call KMOD_template,PPPOE,pppoe,\
+ $(MODULES_DIR)/kernel/drivers/net/pppoe \
+,60))
+
+$(eval $(call KMOD_template,TUN,tun,\
+ $(MODULES_DIR)/kernel/drivers/net/tun \
+,20))
+
+$(eval $(call KMOD_template,BONDING,bonding,\
+ $(MODULES_DIR)/kernel/drivers/net/bonding/bonding \
+,20))
+
+#
+# Traffic scheduling
+#
+$(eval $(call KMOD_template,NET_SCH_CBQ,net-sched-cbq,\
+ $(MODULES_DIR)/kernel/net/sched/sch_cbq \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_HTB,net-sched-htb,\
+ $(MODULES_DIR)/kernel/net/sched/sch_htb \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_HFSC,net-sched-hfsc,\
+ $(MODULES_DIR)/kernel/net/sched/sch_hfsc \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_ATM,net-sched-atm,\
+ $(MODULES_DIR)/kernel/net/sched/sch_atm \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_PRIO,net-sched-prio,\
+ $(MODULES_DIR)/kernel/net/sched/sch_prio \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_RED,net-sched-red,\
+ $(MODULES_DIR)/kernel/net/sched/sch_red \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_SFQ,net-sched-sfq,\
+ $(MODULES_DIR)/kernel/net/sched/sch_sfq \
+,40))
+
+# busybox netapps crash, when module loaded
+#$(eval $(call KMOD_template,NET_SCH_TEQL,net-sched-teql,\
+# $(MODULES_DIR)/kernel/net/sched/sch_teql \
+#,40))
+
+$(eval $(call KMOD_template,NET_SCH_TBF,net-sched-tbf,\
+ $(MODULES_DIR)/kernel/net/sched/sch_tbf \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_GRED,net-sched-gred,\
+ $(MODULES_DIR)/kernel/net/sched/sch_gred \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_DSMARK,net-sched-dsmark,\
+ $(MODULES_DIR)/kernel/net/sched/sch_dsmark \
+,40))
+
+$(eval $(call KMOD_template,NET_SCH_INGRESS,net-sched-ingress,\
+ $(MODULES_DIR)/kernel/net/sched/sch_ingress \
+,40))
+
+#
+# classifications
+#
+$(eval $(call KMOD_template,NET_CLS_BASIC,net-cls-basic,\
+ $(MODULES_DIR)/kernel/net/sched/cls_basic \
+,40))
+
+$(eval $(call KMOD_template,NET_CLS_TCINDEX,net-cls-tcindex,\
+ $(MODULES_DIR)/kernel/net/sched/cls_tcindex \
+,40))
+
+$(eval $(call KMOD_template,NET_CLS_ROUTE4,net-cls-route,\
+ $(MODULES_DIR)/kernel/net/sched/cls_route \
+,40))
+
+$(eval $(call KMOD_template,NET_CLS_FW,net-cls-fw,\
+ $(MODULES_DIR)/kernel/net/sched/cls_fw \
+,40))
+
+$(eval $(call KMOD_template,NET_CLS_U32,net-cls-u32,\
+ $(MODULES_DIR)/kernel/net/sched/cls_u32 \
+,40))
+
+#
+# actions
+#
+$(eval $(call KMOD_template,NET_ACT_POLICE,net-act-police,\
+ $(MODULES_DIR)/kernel/net/sched/act_police \
+,45))
+
+$(eval $(call KMOD_template,NET_ACT_GACT,net-act-gact,\
+ $(MODULES_DIR)/kernel/net/sched/act_gact \
+,45))
+
+$(eval $(call KMOD_template,NET_ACT_MIRRED,net-act-mirred,\
+ $(MODULES_DIR)/kernel/net/sched/act_mirred \
+,45))
+
+$(eval $(call KMOD_template,NET_ACT_IPT,net-act-ipt,\
+ $(MODULES_DIR)/kernel/net/sched/act_ipt \
+,45))
+
+$(eval $(call KMOD_template,NET_ACT_PEDIT,net-act-pedit,\
+ $(MODULES_DIR)/kernel/net/sched/act_pedit \
+,45))
+
+##
+## Filtering / Firewalling
+##
+#
+# Netfilter Core
+#
+$(eval $(call KMOD_template,NETFILTER_XT_TARGET_CLASSIFY,nf-classify,\
+ $(MODULES_DIR)/kernel/net/netfilter/xt_CLASSIFY \
+,50))
+
+$(eval $(call KMOD_template,NETFILTER_XT_TARGET_CONNMARK,nf-connmark,\
+ $(MODULES_DIR)/kernel/net/netfilter/xt_CONNMARK \
+,50))
+
+$(eval $(call KMOD_template,NETFILTER_XT_TARGET_MARK,nf-mark,\
+ $(MODULES_DIR)/kernel/net/netfilter/xt_MARK \
+,50))
+
+$(eval $(call KMOD_template,NETFILTER_XT_TARGET_NFQUEUE,nf-queue,\
+ $(MODULES_DIR)/kernel/net/netfilter/xt_NFQUEUE \
+,50))
+
+$(eval $(call KMOD_template,NETFILTER_XT_TARGET_NOTRACK,nf-notrack,\
+ $(MODULES_DIR)/kernel/net/netfilter/xt_NOTRACK \
+,50))
+
+#
+# IP: Netfilter
+#
+$(eval $(call KMOD_template,NF_CONNTRACK,nf-conntrack,\
+ $(MODULES_DIR)/kernel/net/netfilter/nf_conntrack \
+,50))
+
+$(eval $(call KMOD_template,NF_CONNTRACK_IPV4,nf-conntrack-ipv4,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/nf_defrag_ipv4 \
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/nf_conntrack_ipv4 \
+,51))
+
+$(eval $(call KMOD_template,IP_NF_FTP,nf-ip-conntrack-ftp,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_ftp \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_IRC,nf-ip-conntrack-irc,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_irc \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_NETBIOS_NS,nf-ip-conntrack-netbios-ns,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_netbios_ns \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_TFTP,nf-ip-conntrack-tftp,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_tftp \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_AMANDA,nf-ip-conntrack-amanda,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_amanda \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_PPTP,nf-ip-conntrack-pptp,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_pptp \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_H323,nf-ip-conntrack-h323,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_h323 \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_SIP,nf-ip-conntrack-sip,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_conntrack_sip \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_IPTABLES,nf-ip-iptables,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_tables \
+,50))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_IPRANGE,nf-ip-match-iprange,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_iprange \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_TOS,nf-ip-match-tos,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_tos \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_RECENT,nf-ip-match-recent,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_recent \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_ECN,nf-ip-match-ecn,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_ecn \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_AH,nf-ip-match-ah,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_ah \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_TTL,nf-ip-match-ttl,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_ttl \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_OWNER,nf-ip-match-owner,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_owner \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_ADDRTYPE,nf-ip-match-addrtype,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_addrtype \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_HASHLIMIT,nf-ip-match-hashlimit,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_hashlimit \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_STATE,nf-ip-match-state,\
+ $(MODULES_DIR)/kernel/net/netfilter/xt_state \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_MATCH_MULTIPORT,nf-ip-match-multiport,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_multiport \
+,55))
+
+#
+# Filtering
+#
+$(eval $(call KMOD_template,IP_NF_FILTER,nf-ip-filter,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/iptable_filter \
+,55))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_REJECT,nf-ip-target-reject,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_REJECT \
+,60))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_LOG,nf-ip-target-log,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_LOG \
+,60))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_ULOG,nf-ip-target-ulog,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_ULOG \
+,60))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_TCPMSS,nf-ip-target-tcpmss,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_TCPMSS \
+,60))
+
+$(eval $(call KMOD_template,NF_NAT,nf-nat,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/nf_nat \
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/iptable_nat \
+,60))
+
+$(eval $(call KMOD_template,IP_NF_PPTP,nf-ip-nat-pptp,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_pptp \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_TFTP,nf-ip-nat-tftp,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_tftp \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_FTP,nf-ip-nat-ftp,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_ftp \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_IRC,nf-ip-nat-irc,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_irc \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_AMANDA,nf-ip-nat-amanda,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_amanda \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_SIP,nf-ip-nat-sip,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_sip \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_H323,nf-ip-nat-h323,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ip_nat_h323 \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_MASQUERADE,nf-ip-target-masquerade,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_MASQUERADE \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_REDIRECT,nf-ip-target-redirect,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_REDIRECT \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_NETMAP,nf-ip-target-netmap,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_NETMAP \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_SAME,nf-ip-target-same,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_SAME \
+,65))
+
+#
+# Mangle
+#
+$(eval $(call KMOD_template,IP_NF_MANGLE,nf-ip-mangle,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/iptable_mangle \
+,60))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_TOS,nf-ip-target-tos,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_TOS \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_ECN,nf-ip-target-ecn,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_ECN \
+,65))
+
+$(eval $(call KMOD_template,IP_NF_TARGET_TTL,nf-ip-target-ttl,\
+ $(MODULES_DIR)/kernel/net/ipv4/netfilter/ipt_TTL \
+,65))
+
+#
+# IPVS
+#
+
+IPVSPATH=$(MODULES_DIR)/kernel/net/netfilter/ipvs
+
+$(eval $(call KMOD_template,IP_VS,ip-vs,\
+ $(IPVSPATH)/ip_vs \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_RR,ip-vs-rr,\
+ $(IPVSPATH)/ip_vs_rr \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_WRR,ip-vs-wrr,\
+ $(IPVSPATH)/ip_vs_wrr \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_LC,ip-vs-lc,\
+ $(IPVSPATH)/ip_vs_lc \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_WLC,ip-vs-wlc,\
+ $(IPVSPATH)/ip_vs_wlc \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_LBLC,ip-vs-lblc,\
+ $(IPVSPATH)/ip_vs_lblc \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_LBLCR,ip-vs-lblcr,\
+ $(IPVSPATH)/ip_vs_lblcr \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_DH,ip-vs-dh,\
+ $(IPVSPATH)/ip_vs_dh \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_SH,ip-vs-sh,\
+ $(IPVSPATH)/ip_vs_sh \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_SED,ip-vs-sed,\
+ $(IPVSPATH)/ip_vs_sed \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_NQ,ip-vs-nq,\
+ $(IPVSPATH)/ip_vs_nq \
+,55))
+
+$(eval $(call KMOD_template,IP_VS_FTP,ip-vs-ftp,\
+ $(IPVSPATH)/ip_vs_ftp \
+,55))
+
+#
+# Block devices
+#
+$(eval $(call KMOD_template,BLK_DEV_LOOP,loop,\
+ $(MODULES_DIR)/kernel/drivers/block/loop \
+,20))
+
+$(eval $(call KMOD_template,BLK_DEV_NBD,nbd,\
+ $(MODULES_DIR)/kernel/drivers/block/nbd \
+,20))
+
+$(eval $(call KMOD_template,SCSI,scsi,\
+ $(MODULES_DIR)/kernel/drivers/scsi/scsi_wait_scan \
+,20))
+
+$(eval $(call KMOD_template,BLK_DEV_SD,scsi-disk,\
+ $(MODULES_DIR)/kernel/drivers/scsi/sd_mod \
+,25))
+
+$(eval $(call KMOD_template,BLK_DEV_SR,scsi-cdrom,\
+ $(MODULES_DIR)/kernel/drivers/cdrom/cdrom \
+ $(MODULES_DIR)/kernel/drivers/scsi/sr_mod \
+,25))
+
+#
+# RAID
+#
+$(eval $(call KMOD_template,BLK_DEV_MD,md,\
+ $(MODULES_DIR)/kernel/drivers/md/md-mod \
+,30))
+
+$(eval $(call KMOD_template,MD_RAID0,md-raid0,\
+ $(MODULES_DIR)/kernel/drivers/md/raid0 \
+,35))
+
+$(eval $(call KMOD_template,MD_RAID1,md-raid1,\
+ $(MODULES_DIR)/kernel/drivers/md/raid1 \
+,35))
+
+$(eval $(call KMOD_template,MD_RAID456,md-raid456,\
+ $(MODULES_DIR)/kernel/drivers/md/raid456 \
+,35))
+
+#
+# Device Mapper
+#
+$(eval $(call KMOD_template,BLK_DEV_DM,dm-mod,\
+ $(MODULES_DIR)/kernel/drivers/md/dm-mod \
+,35))
+
+$(eval $(call KMOD_template,DM_CRYPT,dm-crypt,\
+ $(MODULES_DIR)/kernel/drivers/md/dm-crypt \
+,40))
+
+$(eval $(call KMOD_template,DM_MIRROR,dm-mirror,\
+ $(MODULES_DIR)/kernel/drivers/md/dm-mirror \
+,40))
+
+$(eval $(call KMOD_template,DM_SNAPSHOT,dm-snapshot,\
+ $(MODULES_DIR)/kernel/drivers/md/dm-snapshot \
+,40))
+
+
+#
+# Crypto
+#
+
+$(eval $(call KMOD_template,CRYPTO_DEV_GEODE,crypto-hw-geode,\
+ $(MODULES_DIR)/kernel/drivers/crypto/geode-aes \
+,10))
+
+$(eval $(call KMOD_template,CRYPTO_ALGAPI,crypto-algapi,\
+ $(MODULES_DIR)/kernel/crypto/crypto_algapi \
+,03))
+
+$(eval $(call KMOD_template,CRYPTO_AEAD,crypto-aead,\
+ $(MODULES_DIR)/kernel/crypto/aead \
+,04))
+
+$(eval $(call KMOD_template,CRYPTO_BLKCIPHER,crypto-blkcipher,\
+ $(MODULES_DIR)/kernel/crypto/crypto_blkcipher \
+ $(MODULES_DIR)/kernel/crypto/rng \
+ $(MODULES_DIR)/kernel/crypto/krng \
+ $(MODULES_DIR)/kernel/crypto/eseqiv \
+ $(MODULES_DIR)/kernel/crypto/chainiv \
+,05))
+
+$(eval $(call KMOD_template,CRYPTO_HASH,crypto-hash,\
+ $(MODULES_DIR)/kernel/crypto/crypto_hash \
+,05))
+
+$(eval $(call KMOD_template,CRYPTO_MANAGER,crypto-manager,\
+ $(MODULES_DIR)/kernel/crypto/cryptomgr \
+,06))
+
+$(eval $(call KMOD_template,CRYPTO_HMAC,crypto-hmac,\
+ $(MODULES_DIR)/kernel/crypto/hmac \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_NULL,crypto-null,\
+ $(MODULES_DIR)/kernel/crypto/crypto_null \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_MD4,crypto-md4,\
+ $(MODULES_DIR)/kernel/crypto/md4 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_MD5,crypto-md5,\
+ $(MODULES_DIR)/kernel/crypto/md5 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_SHA1,crypto-sha1,\
+ $(MODULES_DIR)/kernel/crypto/sha1_generic \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_SHA256,crypto-sha256,\
+ $(MODULES_DIR)/kernel/crypto/sha256_generic \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_SHA512,crypto-sha512,\
+ $(MODULES_DIR)/kernel/crypto/sha512_generic \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_WP512,crypto-whirlpool,\
+ $(MODULES_DIR)/kernel/crypto/wp512 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_TGR192,crypto-tiger,\
+ $(MODULES_DIR)/kernel/crypto/tgr192 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_ECB,crypto-ecb,\
+ $(MODULES_DIR)/kernel/crypto/ecb \
+,10))
+
+$(eval $(call KMOD_template,CRYPTO_CBC,crypto-cbc,\
+ $(MODULES_DIR)/kernel/crypto/cbc \
+,10))
+
+$(eval $(call KMOD_template,CRYPTO_DES,crypto-des,\
+ $(MODULES_DIR)/kernel/crypto/des_generic \
+,10))
+
+$(eval $(call KMOD_template,CRYPTO_BLOWFISH,crypto-blowfish,\
+ $(MODULES_DIR)/kernel/crypto/blowfish \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_TWOFISH,crypto-twofish,\
+ $(MODULES_DIR)/kernel/crypto/twofish_common \
+ $(MODULES_DIR)/kernel/crypto/twofish \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_TWOFISH_586,crypto-twofish-i586,\
+ $(MODULES_DIR)/kernel/arch/x86/crypto/twofish-i586 \
+,12))
+
+$(eval $(call KMOD_template,CRYPTO_SERPENT,crypto-serpent,\
+ $(MODULES_DIR)/kernel/crypto/serpent \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_AES,crypto-aes,\
+ $(MODULES_DIR)/kernel/crypto/aes_generic \
+,10))
+
+$(eval $(call KMOD_template,CRYPTO_AES_586,crypto-aes-i586,\
+ $(MODULES_DIR)/kernel/arch/x86/crypto/aes-i586 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_CAST5,crypto-cast5,\
+ $(MODULES_DIR)/kernel/crypto/cast5 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_CAST6,crypto-cast6,\
+ $(MODULES_DIR)/kernel/crypto/cast6 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_TEA,crypto-tea,\
+ $(MODULES_DIR)/kernel/crypto/tea \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_ARC4,crypto-arc4,\
+ $(MODULES_DIR)/kernel/crypto/arc4 \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_KHAZAD,crypto-khazad,\
+ $(MODULES_DIR)/kernel/crypto/khazad \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_ANUBIS,crypto-anubis,\
+ $(MODULES_DIR)/kernel/crypto/anubis \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_CAMELLIA,crypto-camellia,\
+ $(MODULES_DIR)/kernel/crypto/camellia \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_FCRYPT,crypto-fcrypt,\
+ $(MODULES_DIR)/kernel/crypto/fcrypt \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_DEFLATE,crypto-deflate,\
+ $(MODULES_DIR)/kernel/crypto/deflate \
+,10))
+
+$(eval $(call KMOD_template,CRYPTO_LZO,crypto-lzo,\
+ $(MODULES_DIR)/kernel/crypto/lzo \
+,10))
+
+$(eval $(call KMOD_template,CRYPTO_MICHAEL_MIC,crypto-michael-mic,\
+ $(MODULES_DIR)/kernel/crypto/michael_mic \
+,11))
+
+$(eval $(call KMOD_template,CRYPTO_CRC32C,crypto-crc32c,\
+ $(MODULES_DIR)/kernel/crypto/crc32c \
+,11))
+
+$(eval $(call KMOD_template,OCF_CRYPTOSOFT,cryptodev-cryptosoft,\
+ ${MODULES_DIR}/kernel/crypto/ocf/cryptosoft \
+,12))
+
+$(eval $(call KMOD_template,OCF_SAFE,cryptodev-safe,\
+ ${MODULES_DIR}/kernel/crypto/ocf/safe/safe \
+,12))
+
+$(eval $(call KMOD_template,OCF_IXP4XX,cryptodev-ixp4xx,\
+ ${MODULES_DIR}/kernel/crypto/ocf/ixp4xx/ixp4xx \
+,12))
+
+$(eval $(call KMOD_template,OCF_HIFN,cryptodev-hifn,\
+ ${MODULES_DIR}/kernel/crypto/ocf/hifn/hifn7751 \
+,12))
+
+$(eval $(call KMOD_template,OCF_TALITOS,cryptodev-talitos,\
+ ${MODULES_DIR}/kernel/crypto/ocf/talitos/talitos \
+,12))
+
+#
+# Filesystems
+#
+$(eval $(call KMOD_template,CIFS,fs-cifs,\
+ $(MODULES_DIR)/kernel/fs/cifs/cifs \
+,30))
+
+$(eval $(call KMOD_template,CODA_FS,fs-coda,\
+ $(MODULES_DIR)/kernel/fs/coda/coda \
+,30))
+
+ifneq ($(ADK_KERNEL_EXT2_FS),y)
+$(eval $(call KMOD_template,EXT2_FS,fs-ext2,\
+ $(MODULES_DIR)/kernel/fs/ext2/ext2 \
+,30))
+endif
+
+$(eval $(call KMOD_template,EXT3_FS,fs-ext3,\
+ $(MODULES_DIR)/kernel/fs/jbd/jbd \
+ $(MODULES_DIR)/kernel/fs/ext3/ext3 \
+,30))
+
+$(eval $(call KMOD_template,FUSE_FS,fs-fuse,\
+ $(MODULES_DIR)/kernel/fs/fuse/fuse \
+,30))
+
+$(eval $(call KMOD_template,HFSPLUS_FS,fs-hfsplus,\
+ $(MODULES_DIR)/kernel/fs/hfsplus/hfsplus \
+,30))
+
+$(eval $(call KMOD_template,SUNRPC,fs-rpc,\
+ $(MODULES_DIR)/kernel/net/sunrpc/sunrpc \
+,24))
+
+$(eval $(call KMOD_template,SUNRPC_GSS,fs-rpcgss,\
+ $(MODULES_DIR)/kernel/net/sunrpc/auth_gss/auth_rpcgss \
+,25))
+
+$(eval $(call KMOD_template,RPCSEC_GSS_KRB5,fs-rpcsec-krb5,\
+ $(MODULES_DIR)/kernel/net/sunrpc/auth_gss/rpcsec_gss_krb5 \
+,26))
+
+ifneq ($(ADK_KERNEL_NFS_FS),y)
+$(eval $(call KMOD_template,NFS_FS,fs-nfs,\
+ $(MODULES_DIR)/kernel/fs/lockd/lockd \
+ $(MODULES_DIR)/kernel/fs/nfs/nfs \
+,30))
+endif
+
+$(eval $(call KMOD_template,EXPORTFS,fs-exportfs,\
+ $(MODULES_DIR)/kernel/fs/exportfs/exportfs \
+,20))
+
+$(eval $(call KMOD_template,NFSD,fs-nfsd,\
+ $(MODULES_DIR)/kernel/fs/nfsd/nfsd \
+,30))
+
+$(eval $(call KMOD_template,NTFS_FS,fs-ntfs,\
+ $(MODULES_DIR)/kernel/fs/ntfs/ntfs \
+,30))
+
+$(eval $(call KMOD_template,VFAT_FS,fs-vfat,\
+ $(MODULES_DIR)/kernel/fs/fat/fat \
+ $(MODULES_DIR)/kernel/fs/fat/vfat \
+,30))
+
+$(eval $(call KMOD_template,XFS_FS,fs-xfs,\
+ $(MODULES_DIR)/kernel/fs/xfs/xfs \
+,30))
+
+$(eval $(call KMOD_template,YAFFS_FS,fs-yaffs,\
+ $(MODULES_DIR)/kernel/fs/yaffs2/yaffs \
+,30))
+
+$(eval $(call KMOD_template,REISERFS_FS,fs-reiserfs,\
+ $(MODULES_DIR)/kernel/fs/reiserfs/reiserfs \
+,30))
+
+$(eval $(call KMOD_template,ISO9660_FS,fs-iso9660,\
+ $(MODULES_DIR)/kernel/fs/isofs/isofs \
+,30))
+
+$(eval $(call KMOD_template,UDF_FS,fs-udf,\
+ $(MODULES_DIR)/kernel/fs/udf/udf \
+,30))
+
+#
+# Multimedia
+#
+$(eval $(call KMOD_template,SOUND,soundcore,\
+ $(MODULES_DIR)/kernel/sound/soundcore \
+,30))
+
+$(eval $(call KMOD_template,SND,sound-alsa,\
+ $(MODULES_DIR)/kernel/sound/core/snd-page-alloc \
+ $(MODULES_DIR)/kernel/sound/core/snd \
+ $(MODULES_DIR)/kernel/sound/core/snd-timer \
+ $(MODULES_DIR)/kernel/sound/core/snd-pcm \
+,40))
+
+$(eval $(call KMOD_template,SND_OSSEMUL,sound-alsa-oss-emul,\
+ $(MODULES_DIR)/kernel/sound/core/oss/snd-mixer-oss \
+ $(MODULES_DIR)/kernel/sound/core/oss/snd-pcm-oss \
+,45))
+
+$(eval $(call KMOD_template,SND_AC97_CODEC,sound-alsa-ac97-codec,\
+ $(MODULES_DIR)/kernel/sound/ac97_bus \
+ $(MODULES_DIR)/kernel/sound/pci/ac97/snd-ac97-codec \
+,50))
+
+$(eval $(call KMOD_template,SND_VIA82XX,sound-alsa-via82xx,\
+ $(MODULES_DIR)/kernel/sound/drivers/mpu401/snd-mpu401-uart \
+ $(MODULES_DIR)/kernel/sound/pci/snd-via82xx \
+,55))
+
+$(eval $(call KMOD_template,SND_CS5535AUDIO,sound-alsa-cs5535,\
+ $(MODULES_DIR)/kernel/sound/pci/cs5535audio/snd-cs5535audio \
+,55))
+
+$(eval $(call KMOD_template,VIDEODEV,videodev,\
+ $(MODULES_DIR)/kernel/drivers/media/video/videodev \
+,65))
+
+$(eval $(call KMOD_template,PWC,pwc,\
+ $(MODULES_DIR)/kernel/drivers/usb/pwc \
+,70))
+
+
+#
+# PCMCIA/CardBus
+#
+
+$(eval $(call KMOD_template,PCCARD,pccard,\
+ $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia_core \
+,40))
+
+$(eval $(call KMOD_template,PCMCIA,pcmcia,\
+ $(MODULES_DIR)/kernel/drivers/pcmcia/pcmcia \
+,50))
+
+$(eval $(call KMOD_template,CARDBUS,cardbus,\
+ $(MODULES_DIR)/kernel/drivers/pcmcia/rsrc_nonstatic \
+ $(MODULES_DIR)/kernel/drivers/pcmcia/yenta_socket \
+,50))
+
+$(eval $(call KMOD_template,PCMCIA_SERIAL_CS,pcmcia-serial,\
+ $(MODULES_DIR)/kernel/drivers/serial/serial_cs \
+,55))
+
+#
+# Input
+#
+
+$(eval $(call KMOD_template,KEYBOARD_ATKBD,input-keyboard,\
+ $(MODULES_DIR)/kernel/drivers/input/keyboard/atkbd \
+,45))
+
+$(eval $(call KMOD_template,INPUT_MOUSEDEV,input-mouse,\
+ $(MODULES_DIR)/kernel/drivers/input/mousedev \
+,45))
+
+#
+# USB
+#
+USB_CORE_MODULE = drivers/usb/core/usbcore
+USB_OHCI_MODULE = drivers/usb/host/ohci-hcd
+USB_UHCI_MODULE = drivers/usb/host/uhci-hcd
+USB_OHCI_SYMBOL = USB_OHCI_HCD
+USB_UHCI_SYMBOL = USB_UHCI_HCD
+
+ifeq ($(ADK_LINUX_CRIS_FOXBOARD),)
+$(eval $(call KMOD_template,USB,usb-core,\
+ $(MODULES_DIR)/kernel/$(USB_CORE_MODULE) \
+,50))
+endif
+
+$(eval $(call KMOD_template,$(USB_OHCI_SYMBOL),usb-ohci,\
+ $(MODULES_DIR)/kernel/$(USB_OHCI_MODULE) \
+,60))
+
+$(eval $(call KMOD_template,$(USB_UHCI_SYMBOL),usb-uhci,\
+ $(MODULES_DIR)/kernel/$(USB_UHCI_MODULE) \
+,60))
+
+$(eval $(call KMOD_template,USB_EHCI_HCD,usb-ehci,\
+ $(MODULES_DIR)/kernel/drivers/usb/host/ehci-hcd \
+,60))
+
+USB_ACM_MODULES = drivers/usb/class/cdc-acm
+USB_PRINTER_MODULES = drivers/usb/class/usblp
+
+$(eval $(call KMOD_template,USB_ACM,usb-acm,\
+ $(foreach mod,$(USB_ACM_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,70))
+
+$(eval $(call KMOD_template,USB_HID,usb-hid,\
+ $(MODULES_DIR)/kernel/drivers/hid/usbhid/usbhid \
+,60))
+
+$(eval $(call KMOD_template,USB_PRINTER,usb-printer,\
+ $(foreach mod,$(USB_PRINTER_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,60))
+
+$(eval $(call KMOD_template,USB_SERIAL,usb-serial,\
+ $(MODULES_DIR)/kernel/drivers/usb/serial/usbserial \
+,60))
+
+$(eval $(call KMOD_template,USB_SERIAL_BELKIN,usb-serial-belkin,\
+ $(MODULES_DIR)/kernel/drivers/usb/serial/belkin_sa \
+,61))
+
+$(eval $(call KMOD_template,USB_SERIAL_FTDI_SIO,usb-serial-ftdi,\
+ $(MODULES_DIR)/kernel/drivers/usb/serial/ftdi_sio \
+,61))
+
+$(eval $(call KMOD_template,USB_SERIAL_MCT_U232,usb-serial-mct-u232,\
+ $(MODULES_DIR)/kernel/drivers/usb/serial/mct_u232 \
+,61))
+
+$(eval $(call KMOD_template,USB_SERIAL_PL2303,usb-serial-pl2303,\
+ $(MODULES_DIR)/kernel/drivers/usb/serial/pl2303 \
+,61))
+
+$(eval $(call KMOD_template,USB_SERIAL_VISOR,usb-serial-visor,\
+ $(MODULES_DIR)/kernel/drivers/usb/serial/visor \
+,61))
+
+$(eval $(call KMOD_template,USB_STORAGE,usb-storage,\
+ $(MODULES_DIR)/kernel/drivers/usb/storage/usb-storage \
+,65))
+
+$(eval $(call KMOD_template,USB_PEGASUS,usb-pegasus,\
+ $(MODULES_DIR)/kernel/drivers/net/usb/pegasus \
+,65))
+
+#
+# Bluetooth
+#
+BLUETOOTH_PREFIX = BT
+BLUETOOTH = bluetooth
+
+$(eval $(call KMOD_template,$(BLUETOOTH_PREFIX),bluetooth,\
+ $(MODULES_DIR)/kernel/net/bluetooth/$(BLUETOOTH) \
+,70))
+
+$(eval $(call KMOD_template,$(BLUETOOTH_PREFIX)_HCIUSB,bluetooth-hci-usb,\
+ $(MODULES_DIR)/kernel/drivers/bluetooth/hci_usb \
+,75))
+
+$(eval $(call KMOD_template,$(BLUETOOTH_PREFIX)_HCIUART,bluetooth-hci-uart,\
+ $(MODULES_DIR)/kernel/drivers/bluetooth/hci_uart \
+,75))
+
+$(eval $(call KMOD_template,$(BLUETOOTH_PREFIX)_L2CAP,bluetooth-l2cap,\
+ $(MODULES_DIR)/kernel/net/bluetooth/l2cap \
+,80))
+
+$(eval $(call KMOD_template,$(BLUETOOTH_PREFIX)_SCO,bluetooth-sco,\
+ $(MODULES_DIR)/kernel/net/bluetooth/sco \
+,85))
+
+$(eval $(call KMOD_template,$(BLUETOOTH_PREFIX)_BNEP,bluetooth-bnep,\
+ $(MODULES_DIR)/kernel/net/bluetooth/bnep/bnep \
+,85))
+
+$(eval $(call KMOD_template,$(BLUETOOTH_PREFIX)_RFCOMM,bluetooth-rfcomm,\
+ $(MODULES_DIR)/kernel/net/bluetooth/rfcomm/rfcomm \
+,85))
+
+#
+# Misc devices
+#
+SOFTDOG_MODULES = drivers/char/watchdog/softdog
+
+$(eval $(call KMOD_template,SOFTDOG,softdog,\
+ $(foreach mod,$(SOFTDOG_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,95))
+
+$(eval $(call KMOD_template,FW_LOADER,fw-loader,\
+ $(MODULES_DIR)/kernel/drivers/base/firmware_class \
+,01))
+
+$(eval $(call KMOD_template,EEPROM_93CX6,eeprom-93cx6,\
+ $(MODULES_DIR)/kernel/drivers/misc/eeprom/eeprom_93cx6 \
+,05))
+
+$(eval $(call KMOD_template,LEDS_CLASS,led-class,\
+ $(MODULES_DIR)/kernel/drivers/leds/led-class \
+,05))
+
+#
+# NLS
+#
+$(eval $(call KMOD_template,NLS,nls-base,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_base \
+,10))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_437,nls-cp437,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp437 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_737,nls-cp737,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp737 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_775,nls-cp775,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp775 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_850,nls-cp850,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp850 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_852,nls-cp852,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp852 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_857,nls-cp857,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp857 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_860,nls-cp860,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp860 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_861,nls-cp861,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp861 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_862,nls-cp862,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp862 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_863,nls-cp863,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp863 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_864,nls-cp864,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp864 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_865,nls-cp865,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp865 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_866,nls-cp866,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp866 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_869,nls-cp869,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp869 \
+,20))
+
+NLS_CODEPAGE_874_MODULES := fs/nls/nls_cp874
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_874,nls-cp874,\
+ $(foreach mod,$(NLS_CODEPAGE_874_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,20))
+
+NLS_CODEPAGE_932_MODULES := fs/nls/nls_cp932
+NLS_CODEPAGE_932_MODULES += fs/nls/nls_euc-jp
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_932,nls-cp932,\
+ $(foreach mod,$(NLS_CODEPAGE_932_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,20))
+
+NLS_CODEPAGE_936_MODULES := fs/nls/nls_cp936
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_936,nls-cp936,\
+ $(foreach mod,$(NLS_CODEPAGE_936_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,20))
+
+NLS_CODEPAGE_949_MODULES := fs/nls/nls_cp949
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_949,nls-cp949,\
+ $(foreach mod,$(NLS_CODEPAGE_949_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,20))
+
+NLS_CODEPAGE_950_MODULES := fs/nls/nls_cp950
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_950,nls-cp950,\
+ $(foreach mod,$(NLS_CODEPAGE_950_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_1250,nls-cp1250,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp1250 \
+,20))
+
+$(eval $(call KMOD_template,NLS_CODEPAGE_1251,nls-cp1251,\
+ $(MODULES_DIR)/kernel/fs/nls/nls_cp1251 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ASCII,nls-ascii, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_ascii \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_1,nls-iso8859-1, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-1 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_2,nls-iso8859-2, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-2 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_3,nls-iso8859-3, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-3 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_4,nls-iso8859-4, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-4 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_5,nls-iso8859-5, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-5 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_6,nls-iso8859-6, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-6 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_7,nls-iso8859-7, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-7 \
+,20))
+
+NLS_ISO8859_8_MODULES := fs/nls/nls_cp1255
+
+$(eval $(call KMOD_template,NLS_ISO8859_8,nls-iso8859-8, \
+ $(foreach mod,$(NLS_ISO8859_8_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_9,nls-iso8859-9, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-9 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_13,nls-iso8859-13, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-13 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_14,nls-iso8859-14, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-14 \
+,20))
+
+$(eval $(call KMOD_template,NLS_ISO8859_15,nls-iso8859-15, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_iso8859-15 \
+,20))
+
+$(eval $(call KMOD_template,NLS_KOI8_R,nls-koi8-r, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_koi8-r \
+,20))
+
+$(eval $(call KMOD_template,NLS_KOI8_U,nls-koi8-u, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_koi8-u \
+ $(MODULES_DIR)/kernel/fs/nls/nls_koi8-ru \
+,20))
+
+$(eval $(call KMOD_template,NLS_UTF8,nls-utf8, \
+ $(MODULES_DIR)/kernel/fs/nls/nls_utf8 \
+,20))
+
+# ISDN
+ISDN_MODULES=drivers/isdn/i4l/isdn
+
+$(eval $(call KMOD_template,ISDN,isdn, \
+ $(foreach mod,$(ISDN_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,60))
+
+$(eval $(call KMOD_template,ISDN_CAPI,isdn-capi, \
+ $(MODULES_DIR)/kernel/drivers/isdn/capi/kernelcapi \
+ $(MODULES_DIR)/kernel/drivers/isdn/capi/capi \
+,60))
+
+$(eval $(call KMOD_template,SLHC,slhc, \
+ $(MODULES_DIR)/kernel/drivers/net/slhc \
+,65))
+
+$(eval $(call KMOD_template,HISAX,hisax, \
+ $(MODULES_DIR)/kernel/drivers/isdn/hisax/hisax \
+,70))
+
+MISDN_MODULES=drivers/isdn/hardware/mISDN/mISDN_core
+MISDN_MODULES+=drivers/isdn/hardware/mISDN/mISDN_l1
+MISDN_MODULES+=drivers/isdn/hardware/mISDN/mISDN_l2
+MISDN_MODULES+=drivers/isdn/hardware/mISDN/mISDN_dsp
+MISDN_MODULES+=drivers/isdn/hardware/mISDN/mISDN_dtmf
+MISDN_MODULES+=drivers/isdn/hardware/mISDN/mISDN_isac
+MISDN_MODULES+=drivers/isdn/hardware/mISDN/mISDN_x25dte
+MISDN_MODULES+=drivers/isdn/hardware/mISDN/l3udss1
+
+$(eval $(call KMOD_template,MISDN_DRV,misdn, \
+ $(foreach mod, $(MISDN_MODULES),$(MODULES_DIR)/kernel/$(mod)) \
+,75))
+
+$(eval $(call KMOD_template,MISDN_AVM_FRITZ,misdn-avm, \
+ $(MODULES_DIR)/kernel/drivers/isdn/hardware/mISDN/avmfritz \
+,80))
+
+$(eval $(call KMOD_template,MISDN_HFCPCI,misdn-hfc-pci, \
+ $(MODULES_DIR)/kernel/drivers/isdn/hardware/mISDN/hfcpci \
+,80))
+
+$(eval $(call KMOD_template,MISDN_HFCMULTI,misdn-hfc-multi, \
+ $(MODULES_DIR)/kernel/drivers/isdn/hardware/mISDN/hfcmulti \
+,80))
+
+$(eval $(call KMOD_template,MISDN_HFCMINI,misdn-hfc-minipci, \
+ $(MODULES_DIR)/kernel/drivers/isdn/hardware/mISDN/hfcsmini \
+,80))
+
+$(eval $(call KMOD_template,MISDN_XHFC,misdn-xhfc, \
+ $(MODULES_DIR)/kernel/drivers/isdn/hardware/mISDN/xhfc \
+,80))
+
+$(eval $(call KMOD_template,MISDN_SPEEDFAX,misdn-speedfax, \
+ $(MODULES_DIR)/kernel/drivers/isdn/hardware/mISDN/sedlfax \
+,80))
+
+# Library modules
+$(eval $(call KMOD_template,CRC_CCITT,crc-ccitt, \
+ $(MODULES_DIR)/kernel/lib/crc-ccitt \
+,01))
+
+$(eval $(call KMOD_template,CRC_ITU_T,crc-itu-t, \
+ $(MODULES_DIR)/kernel/lib/crc-itu-t \
+,01))
+
+$(eval $(call KMOD_template,CRC32,crc32, \
+ $(MODULES_DIR)/kernel/lib/crc32 \
+,01))
+
+$(eval $(call KMOD_template,LIBCRC32C,libcrc32c, \
+ $(MODULES_DIR)/kernel/lib/libcrc32c \
+,01))
+
+#
+# parallel port support
+
+$(eval $(call KMOD_template,LP,lp,\
+ $(MODULES_DIR)/kernel/drivers/char/lp \
+,60))
+
+$(eval $(call KMOD_template,PPDEV,ppdev,\
+ $(MODULES_DIR)/kernel/drivers/char/ppdev \
+,60))
+
+$(eval $(call KMOD_template,PARPORT,parport,\
+ $(MODULES_DIR)/kernel/drivers/parport/parport \
+,50))
+
+$(eval $(call KMOD_template,PLIP,plip,\
+ $(MODULES_DIR)/kernel/drivers/net/plip \
+,51))
diff --git a/mk/package.mk b/mk/package.mk
new file mode 100644
index 000000000..8b5d547b8
--- /dev/null
+++ b/mk/package.mk
@@ -0,0 +1,212 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+all: build-all-ipkgs
+
+TCFLAGS:= ${TARGET_CFLAGS}
+TCXXFLAGS:= ${TARGET_CFLAGS}
+TCPPFLAGS:= ${TARGET_CPPFLAGS}
+ifneq ($(DEBUG),1)
+TCPPFLAGS+= -DNDEBUG
+endif
+TLDFLAGS:= ${TARGET_LDFLAGS} -Wl,-rpath -Wl,/usr/lib \
+ -Wl,-rpath-link -Wl,${STAGING_DIR}/usr/lib \
+ -L${STAGING_DIR}/lib -L${STAGING_DIR}/usr/lib
+ifeq ($(DEBUG),1)
+CONFIGURE_ARGS+= --enable-debug
+else
+CONFIGURE_ARGS+= --disable-debug
+endif
+ifeq ($(ADK_IPV6),y)
+CONFIGURE_ARGS+= --enable-ipv6
+else
+CONFIGURE_ARGS+= --disable-ipv6
+endif
+CONFIGURE_ENV+= ${TARGET_CONFIGURE_OPTS} \
+ ${HOST_CONFIGURE_OPTS} \
+ CC='${TARGET_CC}' CXX='${TARGET_CXX}' \
+ CFLAGS='$(strip ${TCFLAGS})' \
+ CXXFLAGS='$(strip ${TCXXFLAGS})' \
+ CPPFLAGS='$(strip ${TCPPFLAGS})' \
+ LDFLAGS='$(strip ${TLDFLAGS})' \
+ PKG_CONFIG_PATH='${STAGING_DIR}/usr/lib/pkgconfig' \
+ PKG_CONFIG_LIBDIR=/dev/null \
+ CONFIG_SHELL='$(strip ${SHELL})' \
+ ac_cv_func_realloc_0_nonnull=yes \
+ ac_cv_func_malloc_0_nonnull=yes
+MAKE_FILE?= Makefile
+# this is environment for 'make all' and 'make install'
+MAKE_ENV?=
+# this is arguments for 'make all' and 'make install'
+XAKE_FLAGS?=
+# this is arguments for 'make all' ONLY
+MAKE_FLAGS?=
+# this is arguments for 'make install' ONLY
+FAKE_FLAGS?=
+ALL_TARGET?= all
+INSTALL_TARGET?= install
+MAKE_ENV+= PATH='${TARGET_PATH}' \
+ ${HOST_CONFIGURE_OPTS} \
+ WRKDIR='${WRKDIR}' WRKDIST='${WRKDIST}' \
+ WRKSRC='${WRKSRC}' WRKBUILD='${WRKBUILD}' \
+ PKG_CONFIG_PATH='${STAGING_DIR}/usr/lib/pkgconfig' \
+ PKG_CONFIG_LIBDIR=/dev/null \
+ CC='${TARGET_CC}' CXX='${TARGET_CXX}' \
+ AR='${TARGET_CROSS}ar' RANLIB='${TARGET_CROSS}ranlib' \
+ NM='${TARGET_CROSS}nm' \
+ CFLAGS='$(strip ${TCFLAGS})' \
+ CXXFLAGS='$(strip ${TCXXFLAGS})' \
+ CPPFLAGS='$(strip ${TCPPFLAGS})' \
+ LDFLAGS='$(strip ${TLDFLAGS})'
+MAKE_FLAGS+= ${XAKE_FLAGS}
+FAKE_FLAGS+= ${XAKE_FLAGS}
+
+ifeq ($(strip ${WRKDIR_BSD}),)
+WRKDIR_BASE:= ${BUILD_DIR}
+else
+WRKDIR_BASE:= $(shell pwd)
+endif
+
+_EXTRACT_COOKIE= ${WRKDIST}/.extract_done
+_PATCH_COOKIE= ${WRKDIST}/.prepared
+_CONFIGURE_COOKIE= ${WRKBUILD}/.configure_done
+_BUILD_COOKIE= ${WRKBUILD}/.build_done
+_FAKE_COOKIE= ${WRKINST}/.fake_done
+_IPKGS_COOKIE= ${PACKAGE_DIR}/.stamps/${PKG_NAME}${PKG_VERSION}-${PKG_RELEASE}
+
+_IN_PACKAGE:= 1
+include ${TOPDIR}/mk/buildhlp.mk
+-include info.mk
+
+# defined in buildhlp.mk ('extract' can fail, use 'patch' then)
+extract: ${_EXTRACT_COOKIE}
+patch: ${_PATCH_COOKIE}
+
+# defined below (will be moved to pkg-bottom.mk!)
+configure: ${_CONFIGURE_COOKIE}
+build: ${_BUILD_COOKIE}
+fake: ${_FAKE_COOKIE}
+
+# our recursive build entry point
+build-all-ipkgs: ${_IPKGS_COOKIE}
+
+define PKG_template
+IPKG_$(1)= $(PACKAGE_DIR)/$(2)_$(3)_$(4).ipk
+IDIR_$(1)= $(WRKDIR)/fake-${ARCH}/ipkg-$(2)
+ifneq (${ADK_PACKAGE_$(1)}${DEVELOPER},)
+ALL_IPKGS+= $$(IPKG_$(1))
+ALL_IDIRS+= $${IDIR_$(1)}
+endif
+INFO_$(1)= $(IPKG_STATE_DIR)/info/$(2).list
+
+ifeq ($(ADK_PACKAGE_$(1)),y)
+install-targets: $$(INFO_$(1))
+endif
+
+IDEPEND_$(1):= $$(strip $(5))
+
+_ALL_CONTROLS+= $$(IDIR_$(1))/CONTROL/control
+ICONTROL_$(1)?= ipkg/$(2).control
+$$(IDIR_$(1))/CONTROL/control: ${_PATCH_COOKIE}
+ ${BASH} ${SCRIPT_DIR}/make-ipkg-dir.sh $${IDIR_$(1)} $${ICONTROL_$(1)} $(3) $(4)
+ @adeps='$$(strip $${IDEPEND_$(1)})'; if [[ -n $$$$adeps ]]; then \
+ comma=; \
+ deps=; \
+ last=; \
+ for dep in $$$$adeps; do \
+ if [[ $$$$last = kernel && $$$$dep = \(* ]]; then \
+ deps="$$$$deps $$$$dep"; \
+ else \
+ deps="$$$$deps$$$$comma$$$$dep"; \
+ fi; \
+ comma=", "; \
+ last=$$$$dep; \
+ done; \
+ echo "Depends: $$$$deps" >>$${IDIR_$(1)}/CONTROL/control; \
+ fi
+ for file in conffiles preinst postinst prerm postrm; do \
+ [ ! -f ./ipkg/$(2).$$$$file ] || cp ./ipkg/$(2).$$$$file $$(IDIR_$(1))/CONTROL/$$$$file; \
+ done
+ifneq ($(strip $${ICONTROL_ADDON_$(1)}),)
+ echo $${ICONTROL_ADDON_$(1)} >> $${IDIR_$(1)}/CONTROL/control
+endif
+
+$$(IPKG_$(1)): $$(IDIR_$(1))/CONTROL/control $${_FAKE_COOKIE}
+ifneq ($(DEBUG),1)
+ $${RSTRIP} $${IDIR_$(1)} $(MAKE_TRACE)
+endif
+ cd $${IDIR_$(1)}; for script in etc/init.d/*; do \
+ [[ -e $$$$script ]] || continue; \
+ chmod 0755 "$$$$script"; \
+ done
+ @mkdir -p $${PACKAGE_DIR} '$${STAGING_PARENT}/pkg' \
+ '$${STAGING_DIR}/scripts'
+ @if test -s '$${STAGING_PARENT}/pkg/$(1)'; then \
+ cd '$${STAGING_DIR}'; \
+ while read fn; do \
+ rm -f "$$$$fn"; \
+ done <'$${STAGING_PARENT}/pkg/$(1)'; \
+ fi
+ @rm -f '$${STAGING_PARENT}/pkg/$(1)'
+ @cd $${IDIR_$(1)}; \
+ x=$$$$(find tmp var -mindepth 1 2>/dev/null); if [[ -n $$$$x ]]; then \
+ echo 'WARNING: $${IPKG_$(1)} installs files into a' \
+ 'ramdisk location:' >&2; \
+ echo "$$$$x" | sed 's/^/- /' >&2; \
+ fi; \
+ if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libthread-db" ];then \
+ find lib \( -name lib\*.so\* -o -name lib\*.a \) \
+ -exec echo 'WARNING: $${IPKG_$(1)} installs files in /lib -' \
+ ' fix this!' >&2 \; -quit 2>/dev/null; fi; \
+ find usr ! -type d 2>/dev/null | \
+ grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' | \
+ tee '$${STAGING_PARENT}/pkg/$(1)' | \
+ cpio -apdlmu --quiet '$${STAGING_DIR}'
+ @cd '$${STAGING_DIR}'; grep 'usr/lib/.*\.la$$$$' \
+ '$${STAGING_PARENT}/pkg/$(1)' | while read fn; do \
+ chmod u+w $$$$fn; \
+ printf '%s\nwq\n' '/^libdir='\''*/s##&${STAGING_DIR}#' | \
+ ed -s $$$$fn; \
+ done; grep 'usr/s*bin/' '$${STAGING_PARENT}/pkg/$(1)' | \
+ while read fn; do \
+ b="$$$$(dd if="$$$$fn" bs=2 count=1 2>/dev/null)"; \
+ [[ $$$$b = '#!' ]] || continue; \
+ cp "$$$$fn" scripts/; \
+ echo "scripts/$$$$(basename "$$$$fn")" \
+ >>'$${STAGING_PARENT}/pkg/$(1)'; \
+ done
+ $${IPKG_BUILD} $${IDIR_$(1)} $${PACKAGE_DIR} $(MAKE_TRACE)
+
+clean-targets: clean-dev-$(1)
+
+clean-dev-$(1):
+ @if test -s '$${STAGING_PARENT}/pkg/$(1)'; then \
+ cd '$${STAGING_DIR}'; \
+ while read fn; do \
+ rm -f "$$$$fn"; \
+ done <'$${STAGING_PARENT}/pkg/$(1)'; \
+ fi
+ @rm -f '$${STAGING_PARENT}/pkg/$(1)'
+
+$$(INFO_$(1)): $$(IPKG_$(1))
+ $(IPKG) install $$(IPKG_$(1))
+endef
+
+install-targets:
+install:
+ @$(CMD_TRACE) "installing... "
+ @$(MAKE) install-targets $(MAKE_TRACE)
+
+clean-targets:
+clean:
+ @$(CMD_TRACE) "cleaning... "
+ @$(MAKE) clean-targets $(MAKE_TRACE)
+ rm -rf ${WRKDIR} ${ALL_IPKGS} ${PACKAGE_DIR}/.stamps/${PKG_NAME}*
+
+distclean: clean
+ rm -f ${FULLDISTFILES}
+
+.PHONY: all refetch extract patch configure \
+ build fake package install clean build-all-ipkgs
diff --git a/mk/pkg-bottom.mk b/mk/pkg-bottom.mk
new file mode 100644
index 000000000..c5ac91df3
--- /dev/null
+++ b/mk/pkg-bottom.mk
@@ -0,0 +1,212 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+#-
+# Comments:
+# * pre/do/post-foo are always defined here, but empty. This is so
+# that we can call it (BSD make has .if target(foo) but GNU not)
+# and it won't error out.
+# * ${_foo_COOKIE} are the actual targets
+# * default is "manual" -> define a do-foo: target in the Makefile
+# * if you have a style -> define a pre-foo: and post-foo: if they
+# are required, but the do-foo: magic is done here
+# * we want to use styles (configure:gnu, build/install:auto), for
+# making the Makefiles of the packages more clear
+
+#--- configure
+pre-configure:
+do-configure:
+post-configure:
+${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE}
+ mkdir -p ${WRKBUILD}
+ @${MAKE} pre-configure $(MAKE_TRACE)
+
+ifneq ($(filter autotool,${CONFIGURE_STYLE}),)
+ cd ${WRKBUILD}; \
+ autoreconf -vif $(MAKE_TRACE)
+endif
+ifneq ($(filter autoconf,${CONFIGURE_STYLE}),)
+ cd ${WRKBUILD}; \
+ autoconf $(MAKE_TRACE)
+endif
+ifneq ($(filter gnu,${CONFIGURE_STYLE}),)
+ @$(CMD_TRACE) "configuring... "
+ @cd ${WRKBUILD}; \
+ for i in $$(find . -name config.sub);do \
+ if [ -f $$i ]; then \
+ ${CP} $$i $$i.bak; \
+ ${CP} ${SCRIPT_DIR}/config.sub $$i; \
+ fi; \
+ done; \
+ for i in $$(find . -name config.guess);do \
+ if [ -f $$i ]; then \
+ ${CP} $$i $$i.bak; \
+ ${CP} ${SCRIPT_DIR}/config.guess $$i; \
+ fi; \
+ done;
+ cd ${WRKBUILD}; rm -f config.{cache,status}; \
+ env ${CONFIGURE_ENV} \
+ ${BASH} ${WRKSRC}/configure \
+ --build=${GNU_HOST_NAME} \
+ --host=${GNU_TARGET_NAME} \
+ --target=${GNU_TARGET_NAME} \
+ --program-prefix= \
+ --program-suffix= \
+ --prefix=/usr \
+ --datadir=/usr/share \
+ --mandir=/usr/share/man \
+ --libexecdir=/usr/sbin \
+ --localstatedir=/var \
+ --sysconfdir=/etc \
+ --disable-nls \
+ --enable-shared \
+ --enable-static \
+ --disable-dependency-tracking \
+ --disable-libtool-lock \
+ ${CONFIGURE_ARGS} $(MAKE_TRACE)
+else ifeq ($(filter-out manual,${CONFIGURE_STYLE}),)
+ env ${CONFIGURE_ENV} ${MAKE} do-configure $(MAKE_TRACE)
+else
+ @echo "Invalid CONFIGURE_STYLE '${CONFIGURE_STYLE}'" >&2
+ @exit 1
+endif
+ @${MAKE} post-configure $(MAKE_TRACE)
+ touch $@
+
+#--- build
+pre-build:
+do-build:
+post-build:
+${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE}
+ @env ${MAKE_ENV} ${MAKE} pre-build $(MAKE_TRACE)
+ @$(CMD_TRACE) "compiling... "
+ifneq ($(filter auto,${BUILD_STYLE}),)
+ cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
+ ${MAKEJOBS} ${MAKE_FLAGS} ${ALL_TARGET} $(MAKE_TRACE)
+else ifneq ($(filter manual,${BUILD_STYLE}),)
+ env ${MAKE_ENV} ${MAKE} do-build $(MAKE_TRACE)
+else ifeq ($(strip ${BUILD_STYLE}),)
+ env ${MAKE_ENV} ${MAKE} do-build $(MAKE_TRACE)
+else
+ @echo "Invalid BUILD_STYLE '${BUILD_STYLE}'" >&2
+ @exit 1
+endif
+ @env ${MAKE_ENV} ${MAKE} post-build $(MAKE_TRACE)
+ touch $@
+
+#--- fake
+pre-install:
+do-install:
+post-install:
+${_FAKE_COOKIE}: ${_BUILD_COOKIE}
+ -rm -f ${_ALL_CONTROLS}
+ @mkdir -p '${STAGING_PARENT}/pkg' ${WRKINST} '${STAGING_DIR}/scripts'
+ @${MAKE} ${_ALL_CONTROLS} $(MAKE_TRACE)
+ @env ${MAKE_ENV} ${MAKE} pre-install $(MAKE_TRACE)
+ifneq ($(filter auto,${INSTALL_STYLE}),)
+ cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
+ DESTDIR='${WRKINST}' ${FAKE_FLAGS} ${INSTALL_TARGET} $(MAKE_TRACE)
+else ifneq ($(filter manual,${INSTALL_STYLE}),)
+ env ${MAKE_ENV} ${MAKE} do-install $(MAKE_TRACE)
+else ifeq ($(strip ${INSTALL_STYLE}),)
+ env ${MAKE_ENV} ${MAKE} do-install $(MAKE_TRACE)
+else
+ @echo "Invalid INSTALL_STYLE '${INSTALL_STYLE}'" >&2
+ @exit 1
+endif
+ifneq ($(filter confprog,${INSTALL_STYLE}),)
+ for a in ${WRKINST}/usr/{bin/*-config,lib/pkgconfig/*.pc}; do \
+ [[ -e $$a ]] || continue; \
+ $(SED) "s,^prefix=.*,prefix=${STAGING_DIR}/usr," $$a; \
+ done
+endif
+ @env ${MAKE_ENV} ${MAKE} post-install $(MAKE_TRACE)
+ @if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \
+ cd '${STAGING_DIR}'; \
+ while read fn; do \
+ rm -f "$$fn"; \
+ done <'${STAGING_PARENT}/pkg/${PKG_NAME}'; \
+ fi
+ @rm -f '${STAGING_PARENT}/pkg/${PKG_NAME}'
+ @cd ${WRKINST}; \
+ if [ "${PKG_NAME}" != "uClibc" -a "${PKG_NAME}" != "glibc" -a "${PKG_NAME}" != "libpthread" -a "${PKG_NAME}" != "libstdcxx" -a "${PKG_NAME}" != "libthread-db" ];then \
+ find lib \( -name lib\*.so\* -o -name lib\*.a \) \
+ -exec echo 'WARNING: ${PKG_NAME} installs files in /lib -' \
+ ' fix this!' >&2 \; -quit 2>/dev/null; fi;\
+ find usr ! -type d 2>/dev/null | \
+ grep -v -e '^usr/share' -e '^usr/man' -e '^usr/info' | \
+ tee '${STAGING_PARENT}/pkg/${PKG_NAME}' | \
+ cpio -apdlmu --quiet '${STAGING_DIR}'
+ @cd '${STAGING_DIR}'; grep 'usr/lib/.*\.la$$' \
+ '${STAGING_PARENT}/pkg/${PKG_NAME}' | while read fn; do \
+ chmod u+w $$fn; \
+ $(SED) "s,\(^libdir='\| \|-L\|^dependency_libs='\)/usr/lib,\1$(STAGING_DIR)/usr/lib,g" $$fn; \
+ done; grep 'usr/s*bin/' '${STAGING_PARENT}/pkg/${PKG_NAME}' | \
+ while read fn; do \
+ b="$$(dd if="$$fn" bs=2 count=1 2>/dev/null)"; \
+ [[ $$b = '#!' ]] || continue; \
+ cp "$$fn" scripts/; \
+ echo "scripts/$$(basename "$$fn")" \
+ >>'${STAGING_PARENT}/pkg/${PKG_NAME}'; \
+ done
+ touch $@
+
+#--- package
+${_IPKGS_COOKIE}:
+ @clean=0; \
+ for f in ${ALL_IPKGS}; do \
+ [[ -e $$f ]] && clean=1; \
+ done; \
+ [[ $$clean = 0 ]] || ${MAKE} clean
+ exec ${MAKE} package
+
+package: ${ALL_IPKGS}
+ @cd ${WRKDIR}/fake-${ARCH} || exit 1; \
+ y=; sp=; for x in ${ALL_IDIRS}; do \
+ y="$$y$$sp$${x#$(WRKDIR)/fake-${ARCH}/}"; \
+ sp=' '; \
+ done; ls=; ln=; x=1; [[ -z $$y ]] || \
+ md5sum $$(find $$y -type f) | sed -e "s/*//" | \
+ while read sum name; do \
+ inode=$$(ls -i "$$name"); \
+ echo "$$sum $${inode%% *} $$name"; \
+ done | sort | while read sum inode name; do \
+ if [[ $$sum = $$ls ]]; then \
+ [[ $$li = $$inode ]] && continue; \
+ case $$x in \
+ 1) echo 'WARNING: duplicate files found in' \
+ 'package "${PKG_NAME}"! Fix them.' >&2; \
+ echo -n "> $$ln "; \
+ ;; \
+ 2) echo -n "> $$ln "; \
+ ;; \
+ 3) echo -n ' '; \
+ ;; \
+ esac; \
+ echo -n "$$name"; \
+ x=3; \
+ else \
+ case $$x in \
+ 3) echo; \
+ x=2; \
+ ;; \
+ esac; \
+ fi; \
+ ls=$$sum; \
+ ln=$$name; \
+ li=$$inode; \
+ done
+ touch ${_IPKGS_COOKIE}
+
+#--- clean
+clean-targets: clean-dev-generic
+
+clean-dev-generic:
+ @if test -s '${STAGING_PARENT}/pkg/${PKG_NAME}'; then \
+ cd '${STAGING_DIR}'; \
+ while read fn; do \
+ rm -f "$$fn"; \
+ done <'${STAGING_PARENT}/pkg/${PKG_NAME}'; \
+ fi
+ @rm -f '${STAGING_PARENT}/pkg/${PKG_NAME}'
diff --git a/mk/rootfs.mk b/mk/rootfs.mk
new file mode 100644
index 000000000..e23769979
--- /dev/null
+++ b/mk/rootfs.mk
@@ -0,0 +1,21 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+define rootfs_template
+ifeq ($(ADK_TARGET_ROOTFS_$(2)),y)
+FS:=$(1)
+FS_CMDLINE:=$(3)
+endif
+endef
+
+$(eval $(call rootfs_template,ext2-cf,EXT2_CF))
+$(eval $(call rootfs_template,ext2-mmc,EXT2_MMC))
+$(eval $(call rootfs_template,ext2,EXT2))
+$(eval $(call rootfs_template,initramfs,INITRAMFS))
+$(eval $(call rootfs_template,squashfs,SQUASHFS))
+$(eval $(call rootfs_template,yaffs,YAFFS))
+$(eval $(call rootfs_template,nfsroot,NFSROOT,root=/dev/nfs ip=dhcp))
+
+export FS
diff --git a/mk/split-cfg.mk b/mk/split-cfg.mk
new file mode 100644
index 000000000..0aa5acba1
--- /dev/null
+++ b/mk/split-cfg.mk
@@ -0,0 +1,10 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+#-
+# must work with both BSD and GNU make
+
+${TOPDIR}/.cfg/ADK_HAVE_DOT_CONFIG: ${TOPDIR}/.config \
+ ${TOPDIR}/mk/split-cfg.mk ${TOPDIR}/scripts/split-cfg.sh
+ ${BASH} ${TOPDIR}/scripts/split-cfg.sh '${TOPDIR}'
diff --git a/mk/toolchain.mk b/mk/toolchain.mk
new file mode 100644
index 000000000..2701736ca
--- /dev/null
+++ b/mk/toolchain.mk
@@ -0,0 +1,6 @@
+prepare: ${WRKDIST}/.prepared $(WRKBUILD)/.headers
+configure: ${WRKBUILD}/.configure_done
+compile: $(WRKBUILD)/.compiled
+install: $(WRKBUILD)/.installed
+clean:
+ rm -rf $(WRKDIR)
diff --git a/mk/tools.mk b/mk/tools.mk
new file mode 100644
index 000000000..429e741c2
--- /dev/null
+++ b/mk/tools.mk
@@ -0,0 +1,6 @@
+prepare: ${WRKDIST}/.prepared
+configure: ${WRKBUILD}/.configure_done
+compile: $(WRKBUILD)/.compiled
+install: $(WRKBUILD)/.installed
+clean:
+ rm -rf $(WRKDIR)
diff --git a/mk/vars.mk b/mk/vars.mk
new file mode 100644
index 000000000..93f40be23
--- /dev/null
+++ b/mk/vars.mk
@@ -0,0 +1,120 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+CP= cp -fpR
+INSTALL_DIR= install -d -m0755
+INSTALL_DATA= install -m0644
+INSTALL_BIN= install -m0755
+INSTALL_SCRIPT= install -m0755
+MAKEFLAGS= $(EXTRA_MAKEFLAGS)
+BUILD_USER= $(shell id -un)
+BUILD_GROUP= $(shell id -gn)
+ifeq ($(DEBUG),1)
+TARGET_DEBUGGING:= -g -O0 -fno-omit-frame-pointer
+else
+TARGET_DEBUGGING:= -fomit-frame-pointer
+endif
+ifeq ($(ADK_SSP),y)
+TARGET_SSP:= -fstack-protector-all
+endif
+TARGET_CFLAGS:= $(TARGET_OPTIMIZATION) $(TARGET_CFLAGS_ARCH) $(TARGET_DEBUGGING) $(TARGET_SSP)
+
+BASE_DIR:= $(TOPDIR)
+DISTDIR?= ${BASE_DIR}/dl
+BUILD_DIR:= ${BASE_DIR}/build_${CPU_ARCH}
+BUILD_DIR_PFX:= $(BASE_DIR)/build_*
+STAGING_PARENT:= ${BASE_DIR}/cross_${CPU_ARCH}
+STAGING_PARENT_PFX:= ${BASE_DIR}/cross_*
+STAGING_TOOLS:= ${STAGING_PARENT}/host
+STAGING_DIR:= ${STAGING_PARENT}/target
+TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${CPU_ARCH}
+TOOLCHAIN_BUILD_DIR_PFX=$(BASE_DIR)/toolchain_build_*
+TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build
+SCRIPT_DIR:= $(BASE_DIR)/scripts
+BIN_DIR:= $(BASE_DIR)/bin_${DEVICE}
+BIN_DIR_PFX:= $(BASE_DIR)/bin_*
+PACKAGE_DIR:= $(BIN_DIR)/packages
+TARGET_DIR:= $(BASE_DIR)/root_${DEVICE}
+TARGET_DIR_PFX:= $(BASE_DIR)/root_*
+TARGET_PATH= ${SCRIPT_DIR}:${STAGING_TOOLS}/bin:${STAGING_DIR}/scripts:${_PATH}
+ifeq ($(ADK_TARGET_LIB_GLIBC),y)
+REAL_GNU_TARGET_NAME= $(CPU_ARCH)-linux-gnu
+GNU_TARGET_NAME= $(CPU_ARCH)-linux
+KERNEL_CROSS:= $(STAGING_TOOLS)/bin/$(CPU_ARCH)-linux-gnu-
+TARGET_CROSS:= $(STAGING_TOOLS)/bin/$(CPU_ARCH)-linux-gnu-
+else
+REAL_GNU_TARGET_NAME= $(CPU_ARCH)-linux-uclibc
+GNU_TARGET_NAME= $(CPU_ARCH)-linux
+KERNEL_CROSS:= $(STAGING_TOOLS)/bin/$(CPU_ARCH)-linux-uclibc-
+TARGET_CROSS:= $(STAGING_TOOLS)/bin/$(CPU_ARCH)-linux-uclibc-
+endif
+TOOLCHAIN_SYSROOT:= $(TOOLCHAIN_BUILD_DIR)/libc_dev
+TARGET_COMPILER_PREFIX?=${TARGET_CROSS}
+TARGET_CC:= ${TARGET_COMPILER_PREFIX}gcc
+TARGET_CXX:= ${TARGET_COMPILER_PREFIX}g++
+TARGET_CPPFLAGS+= -I${STAGING_DIR}/usr/include
+TARGET_LDFLAGS+= -Wl,-O2
+PATCH= ${BASH} $(SCRIPT_DIR)/patch.sh
+SED:= sed -i -e
+LINUX_DIR:= $(BUILD_DIR)/linux
+
+TARGET_CONFIGURE_OPTS= PATH='${TARGET_PATH}' \
+ AR=$(TARGET_CROSS)ar \
+ AS=$(TARGET_CROSS)as \
+ LD=$(TARGET_CROSS)ld \
+ NM=$(TARGET_CROSS)nm \
+ CC="$(TARGET_CC)" \
+ GCC="$(TARGET_CC)" \
+ CXX="$(TARGET_CXX)" \
+ RANLIB=$(TARGET_CROSS)ranlib
+HOST_CONFIGURE_OPTS= CC_FOR_BUILD='${HOSTCC}' \
+ CFLAGS_FOR_BUILD='${HOSTCFLAGS}' \
+ CPPFLAGS_FOR_BUILD='${HOSTCPPFLAGS}' \
+ LDFLAGS_FOR_BUILD='${HOSTLDFLAGS}'
+
+# invoke ipkg-build with some default options
+IPKG_BUILD:= PATH='${TARGET_PATH}' ${BASH} \
+ ${TOPDIR}/scripts/ipkg-build -c -o 0 -g 0
+# where to build (and put) .ipk packages
+IPKG_TARGET_DIR:= $(PACKAGE_DIR)
+IPKG:= IPKG_TMP=$(BUILD_DIR)/tmp \
+ IPKG_INSTROOT=$(TARGET_DIR) \
+ IPKG_CONF_DIR=$(STAGING_DIR)/etc \
+ IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
+ ${BASH} ${SCRIPT_DIR}/ipkg -force-defaults -force-depends
+IPKG_STATE_DIR:= $(TARGET_DIR)/usr/lib/ipkg
+
+RSTRIP:= prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh
+
+EXTRACT_CMD= mkdir -p ${WRKDIR}; \
+ cd ${WRKDIR} && \
+ for file in ${FULLDISTFILES}; do case $$file in \
+ *.cpio) \
+ cat $$file | cpio -i -d --quiet ;; \
+ *.tar) \
+ tar -xf $$file ;; \
+ *.cpio.Z | *.cpio.gz | *.cgz | *.mcz) \
+ gzip -dc $$file | cpio -i -d --quiet ;; \
+ *.tar.Z | *.tar.gz | *.taz | *.tgz) \
+ gzip -dc $$file | tar -xf - ;; \
+ *.cpio.bz2 | *.cbz) \
+ bzip2 -dc $$file | cpio -i -d --quiet ;; \
+ *.tar.bz2 | *.tbz | *.tbz2) \
+ bzip2 -dc $$file | tar -xf - ;; \
+ *.zip) \
+ unzip -d ${WRKDIR} $$file ;; \
+ *) \
+ echo "Cannot extract '$$file'" >&2; \
+ false ;; \
+ esac; done
+
+ifeq ($(VERBOSE),1)
+QUIET:=
+else
+QUIET:= --quiet
+endif
+FETCH_CMD?= wget -t1 --timeout=30 $(QUIET)
+
+include $(TOPDIR)/mk/mirrors.mk
diff --git a/package/6tunnel/Config.in b/package/6tunnel/Config.in
new file mode 100644
index 000000000..53b69c2d5
--- /dev/null
+++ b/package/6tunnel/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_6TUNNEL
+ prompt "6tunnel........................... IPv4 / IPv6 tunnel proxy"
+ depends on ADK_IPV6
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_IPV6
+ help
+ 6tunnel allows you to use services provided by IPv6 hosts with IPv4-only
+ applications and vice-versa. It can bind to any of your IPv4 (default)
+ or IPv6 addresses and forward all data to IPv4 or IPv6 (default) host.
+
+ http://toxygen.net/6tunnel/
+
diff --git a/package/6tunnel/Makefile b/package/6tunnel/Makefile
new file mode 100644
index 000000000..d66c2bd95
--- /dev/null
+++ b/package/6tunnel/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= 6tunnel
+PKG_VERSION:= 0.11rc1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b325fa9d238e32195fbb3fc3646b0d28
+MASTER_SITES:= http://toxygen.net/6tunnel/
+WRKDIST= ${WRKDIR}/$(PKG_NAME)-0.11
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,6TUNNEL,6tunnel,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_path_STRIP=$(STRIP) \
+ ac_cv_func_vsnprintf=yes
+ALL_TARGET= default
+BUILD_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_6TUNNEL)/usr/sbin
+ $(INSTALL_BIN) $(WRKBUILD)/6tunnel $(IDIR_6TUNNEL)/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/6tunnel/ipkg/6tunnel.control b/package/6tunnel/ipkg/6tunnel.control
new file mode 100644
index 000000000..ea4978572
--- /dev/null
+++ b/package/6tunnel/ipkg/6tunnel.control
@@ -0,0 +1,4 @@
+Package: 6tunnel
+Priority: optional
+Section: net
+Description: An IPv4/IPv6 tunnel proxy
diff --git a/package/Config.in b/package/Config.in
new file mode 100644
index 000000000..2f2dad1ec
--- /dev/null
+++ b/package/Config.in
@@ -0,0 +1,489 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+menu "Package selection"
+
+comment "Package categories"
+
+
+menu "Applications"
+
+menu "Basesystem"
+source "package/base-files/Config.in"
+source "package/busybox/Config.in"
+source "package/uclibc/Config.in"
+source "package/cfgfs/Config.in"
+source "package/glibc/Config.in"
+endmenu
+
+menu "Bluetooth"
+source "package/bluez-firmware/Config.in"
+source "package/bluez/Config.in"
+source "package/miax/Config.in"
+source "package/obexftp/Config.in"
+source "package/openobex/Config.in"
+source "package/ussp-push/Config.in"
+endmenu
+
+menu "Browser"
+source "package/links/Config.in"
+source "package/elinks/Config.in"
+source "package/lynx/Config.in"
+endmenu
+
+menu "Debugging / Analyzing"
+source "package/exmap/Config.in"
+source "package/gdb/Config.in"
+source "package/gdbserver/Config.in"
+source "package/oprofile/Config.in"
+source "package/strace/Config.in"
+source "package/valgrind/Config.in"
+endmenu
+
+menu "Editors / Pager"
+source "package/less/Config.in"
+source "package/nano/Config.in"
+source "package/vim/Config.in"
+endmenu
+
+menu "Filesystem utilities"
+source "package/device-mapper/Config.in"
+source "package/dosfstools/Config.in"
+source "package/e2fsprogs/Config.in"
+source "package/fuse/Config.in"
+source "package/lvm/Config.in"
+source "package/util-linux/Config.in"
+source "package/wdfs/Config.in"
+source "package/xfsprogs/Config.in"
+endmenu
+
+
+menu "Mail"
+source "package/bogofilter/Config.in"
+source "package/dovecot/Config.in"
+source "package/fetchmail/Config.in"
+source "package/mini_sendmail/Config.in"
+source "package/mutt/Config.in"
+source "package/procmail/Config.in"
+source "package/ssmtp/Config.in"
+source "package/vilistextum/Config.in"
+endmenu
+
+menu "Misc"
+source "package/collectd/Config.in"
+source "package/deco/Config.in"
+source "package/digitemp/Config.in"
+source "package/gpm/Config.in"
+source "package/gpsd/Config.in"
+source "package/logrotate/Config.in"
+source "package/mc/Config.in"
+source "package/mgetty/Config.in"
+source "package/monit/Config.in"
+source "package/motion/Config.in"
+source "package/mysql/Config.in"
+source "package/osiris/Config.in"
+source "package/rrdtool/Config.in"
+source "package/rrdcollect/Config.in"
+source "package/sane-backends/Config.in"
+source "package/screen/Config.in"
+source "package/scsi-spin/Config.in"
+source "package/ser2net/Config.in"
+source "package/syslog-ng/Config.in"
+source "package/tar/Config.in"
+endmenu
+
+menu "Multimedia"
+source "package/alsa-utils/Config.in"
+source "package/esound/Config.in"
+source "package/ffmpeg/Config.in"
+source "package/gmediaserver/Config.in"
+source "package/icecast/Config.in"
+source "package/lame/Config.in"
+source "package/madplay/Config.in"
+source "package/moc/Config.in"
+source "package/mpd/Config.in"
+source "package/mplayer/Config.in"
+source "package/mt-daapd/Config.in"
+source "package/palantir/Config.in"
+source "package/setpwc/Config.in"
+endmenu
+
+menu "Shells"
+source "package/bash/Config.in"
+source "package/mksh/Config.in"
+source "package/zsh/Config.in"
+endmenu
+
+menu "Security"
+source "package/cryptsetup/Config.in"
+source "package/gpg/Config.in"
+source "package/heimdal/Config.in"
+source "package/krb5/Config.in"
+source "package/openct/Config.in"
+source "package/opensc/Config.in"
+source "package/openssl/Config.in" # libopenssl
+source "package/openssl-pkcs11/Config.in"
+endmenu
+
+menu "Serial communications & terminal emulation"
+source "package/heyu/Config.in"
+source "package/lrzsz/Config.in"
+source "package/picocom/Config.in"
+source "package/serdisplib/Config.in"
+source "package/setserial/Config.in"
+endmenu
+
+menu "Telephony"
+source "package/asterisk/Config.in"
+source "package/opensips/Config.in"
+endmenu
+
+menu "Utilities"
+source "package/bc/Config.in"
+source "package/comgt/Config.in"
+source "package/fbset/Config.in"
+source "package/file/Config.in"
+source "package/hdparm/Config.in"
+source "package/usbutils/Config.in" # lsusb
+source "package/pciutils/Config.in"
+source "package/procps/Config.in"
+source "package/sispmctl/Config.in"
+source "package/stress/Config.in"
+source "package/sysstat/Config.in"
+source "package/udev/Config.in"
+source "package/watchdog/Config.in"
+endmenu
+
+
+endmenu
+
+menu "Networking"
+
+menu "Analyze / Debugging / Monitoring"
+source "package/bwm/Config.in"
+source "package/dsniff/Config.in"
+source "package/ethtool/Config.in"
+source "package/fping/Config.in"
+source "package/fprobe/Config.in"
+source "package/fprobe-ulog/Config.in"
+source "package/httping/Config.in"
+source "package/iftop/Config.in"
+source "package/ipcad/Config.in"
+source "package/iperf/Config.in"
+source "package/iptraf/Config.in"
+source "package/mtr/Config.in"
+source "package/netperf/Config.in"
+source "package/nmap/Config.in"
+source "package/sipsak/Config.in"
+source "package/slurm/Config.in"
+source "package/tcpdump/Config.in"
+#source "package/trafshow/Config.in"
+source "package/ttcp/Config.in"
+endmenu
+
+menu "DNS / DHCP"
+source "package/atftp/Config.in"
+source "package/avahi/Config.in"
+source "package/bind/Config.in"
+source "package/dhcp/Config.in"
+source "package/dhcp-forwarder/Config.in"
+source "package/dnsmasq/Config.in"
+source "package/ez-ipupdate/Config.in"
+source "package/maradns/Config.in"
+source "package/updatedd/Config.in"
+endmenu
+
+menu "HTTP / FTP"
+source "package/gatling/Config.in"
+source "package/lighttpd/Config.in"
+source "package/mini_httpd/Config.in"
+source "package/tntnet/Config.in"
+source "package/vsftpd/Config.in"
+source "package/wput/Config.in"
+endmenu
+
+menu "IPv6"
+depends ADK_IPV6
+source "package/6tunnel/Config.in"
+source "package/aiccu/Config.in"
+source "package/dhcp6/Config.in"
+source "package/miredo/Config.in"
+source "package/mrd6/Config.in"
+source "package/ndisc/Config.in"
+source "package/radvd/Config.in"
+endmenu
+
+
+menu "IRC / ICQ / JABBER"
+source "package/bitlbee/Config.in"
+source "package/irssi/Config.in"
+source "package/miau/Config.in"
+source "package/reaim/Config.in"
+source "package/tmsnc/Config.in"
+endmenu
+
+
+menu "Firewall / Routing / Bridging"
+source "package/arpd/Config.in"
+source "package/bridge-utils/Config.in"
+source "package/cutter/Config.in"
+source "package/ether-wake/Config.in"
+source "package/iproute2/Config.in"
+source "package/ipset/Config.in"
+source "package/iptables/Config.in"
+source "package/iptables-snmp/Config.in"
+source "package/knock/Config.in"
+source "package/linux-atm/Config.in"
+source "package/macchanger/Config.in"
+source "package/netstat-nat/Config.in"
+source "package/quagga/Config.in"
+source "package/ulogd/Config.in"
+source "package/shorewall-common/Config.in"
+source "package/shorewall-shell/Config.in"
+source "package/wol/Config.in"
+source "package/wondershaper/Config.in"
+source "package/vrrpd/Config.in"
+endmenu
+
+menu "Misc"
+source "package/cups/Config.in"
+source "package/fakeidentd/Config.in"
+source "package/gkrellmd/Config.in"
+source "package/net-snmp/Config.in"
+source "package/nut/Config.in"
+source "package/openldap/Config.in"
+source "package/p910nd/Config.in"
+source "package/pipacs/Config.in"
+#source "package/pmacct/Config.in"
+source "package/portmap/Config.in"
+source "package/rarpd/Config.in"
+source "package/rrs/Config.in"
+source "package/rsync/Config.in"
+source "package/scdp/Config.in"
+source "package/shat/Config.in"
+source "package/socat/Config.in"
+source "package/subversion/Config.in"
+source "package/swconfig/Config.in"
+source "package/udp-broadcast-relay/Config.in"
+source "package/vgp/Config.in"
+source "package/vnstat/Config.in"
+source "package/vtun/Config.in"
+source "package/wccpd/Config.in"
+source "package/xinetd/Config.in"
+endmenu
+
+menu "Network Filesystems"
+source "package/davfs2/Config.in"
+source "package/nfs-utils/Config.in"
+source "package/samba/Config.in"
+endmenu
+
+menu "NTP"
+source "package/htpdate/Config.in"
+source "package/ntpclient/Config.in"
+source "package/openntpd/Config.in"
+source "package/rdate/Config.in"
+endmenu
+
+menu "P2P"
+source "package/cbtt/Config.in"
+source "package/ctorrent/Config.in"
+source "package/rtorrent/Config.in"
+endmenu
+
+menu "PPP / PPTP / RADIUS"
+source "package/freeradius/Config.in"
+source "package/ppp/Config.in"
+source "package/pptp/Config.in"
+source "package/pptpd/Config.in"
+source "package/rp-pppoe/Config.in"
+source "package/raddump/Config.in"
+endmenu
+
+menu "Proxy"
+source "package/igmpproxy/Config.in"
+source "package/frickin/Config.in"
+source "package/parprouted/Config.in"
+source "package/privoxy/Config.in"
+source "package/siproxd/Config.in"
+source "package/squid/Config.in"
+source "package/srelay/Config.in"
+source "package/tinyproxy/Config.in"
+source "package/tor/Config.in"
+source "package/vnc-reflector/Config.in"
+endmenu
+
+menu "Security"
+source "package/arpwatch/Config.in"
+source "package/autossh/Config.in"
+source "package/axtls/Config.in"
+source "package/dropbear/Config.in"
+source "package/httptunnel/Config.in"
+source "package/ipsec-tools/Config.in"
+source "package/l2tpns/Config.in"
+source "package/openssh/Config.in"
+source "package/openswan/Config.in"
+source "package/openvpn/Config.in"
+source "package/portsentry/Config.in"
+source "package/ptunnel/Config.in"
+source "package/scanlogd/Config.in"
+source "package/snort/Config.in"
+source "package/ssltunnel/Config.in"
+source "package/tinc/Config.in"
+source "package/vpnc/Config.in"
+endmenu
+
+menu "Wireless"
+source "package/aircrack-ng/Config.in"
+source "package/chillispot/Config.in"
+source "package/hostapd/Config.in"
+source "package/iw/Config.in"
+source "package/kismet/Config.in"
+source "package/nocatsplash/Config.in"
+source "package/olsrd/Config.in"
+source "package/snort-wireless/Config.in"
+source "package/wifidog/Config.in"
+source "package/wireless-firmware/Config.in"
+source "package/wireless-tools/Config.in"
+source "package/wpa_supplicant/Config.in"
+endmenu
+
+endmenu
+
+menu "Programming"
+source "package/binutils/Config.in"
+source "package/cxxtools/Config.in"
+#source "package/gcc/Config.in"
+source "package/haserl/Config.in"
+source "package/jamvm/Config.in"
+source "package/lua/Config.in"
+source "package/microperl/Config.in"
+source "package/php/Config.in"
+source "package/ruby/Config.in"
+source "package/libffi/Config.in"
+source "package/tcl/Config.in"
+endmenu
+
+
+
+menu "Libraries"
+source "package/alsa-lib/Config.in"
+source "package/apr/Config.in"
+source "package/apr-util/Config.in"
+source "package/avahi/Config.in.lib"
+source "package/axtls/Config.in.lib"
+source "package/cgilib/Config.in"
+source "package/dbus/Config.in"
+source "package/gettext/Config.in"
+source "package/glib/Config.in"
+source "package/glib2/Config.in"
+source "package/id3lib/Config.in"
+source "package/libao/Config.in"
+source "package/libaudiofile/Config.in"
+source "package/libart/Config.in"
+source "package/libcli/Config.in"
+source "package/curl/Config.in" # libcurl
+source "package/libdaemon/Config.in"
+source "package/libdb/Config.in"
+source "package/libdnet/Config.in"
+source "package/libelf/Config.in"
+source "package/libevent/Config.in"
+source "package/expat/Config.in" # libexpat
+source "package/faad2/Config.in" # libfaad2
+source "package/flac/Config.in" # libflac
+source "package/freetype/Config.in" # libfreetype
+source "package/libgcrypt/Config.in"
+source "package/libgd/Config.in"
+source "package/libgdbm/Config.in"
+source "package/libgssglue/Config.in"
+source "package/gmp/Config.in" # libgmp
+source "package/gnutls/Config.in" ## libgnutls
+source "package/libgpg-error/Config.in"
+source "package/gsm/Config.in" # libgsm
+source "package/libiconv/Config.in"
+source "package/libid3tag/Config.in"
+source "package/jpeg/Config.in" # libjpeg
+source "package/lame/Config.in.lib" # libltdl
+source "package/mpfr/Config.in"
+source "package/libtool/Config.in" # libltdl
+source "package/openldap/Config.in.lib"
+source "package/liblzo/Config.in"
+source "package/libmad/Config.in"
+source "package/ncurses/Config.in" # libncurses
+source "package/neon/Config.in"
+source "package/libnet/Config.in"
+source "package/libnfsidmap/Config.in"
+source "package/libnids/Config.in"
+source "package/libnl/Config.in"
+source "package/libogg/Config.in"
+source "package/libol/Config.in"
+source "package/opencdk/Config.in" # libopencdk
+source "package/libosip2/Config.in"
+source "package/libowfat/Config.in"
+source "package/libp11/Config.in"
+source "package/libpcap/Config.in"
+source "package/libpri/Config.in"
+source "package/pcre/Config.in" # libpcre
+source "package/libpng/Config.in"
+source "package/popt/Config.in" # libpopt
+source "package/postgresql/Config.in" # libpq
+source "package/libpthread/Config.in"
+source "package/libthread_db/Config.in"
+source "package/radiusclient-ng/Config.in" #libradiusclient-ng
+source "package/readline/Config.in" # libreadline
+source "package/cyrus-sasl/Config.in" # libsasl2
+source "package/speex/Config.in" # libspeex
+source "package/sqlite/Config.in" # libsqlite
+source "package/librpcsecgss/Config.in"
+source "package/libshout/Config.in"
+source "package/libsigc++/Config.in"
+source "package/libstdcxx/Config.in"
+source "package/libtasn1/Config.in"
+source "package/libtiff/Config.in"
+source "package/libtirpc/Config.in"
+source "package/libtorrent/Config.in"
+source "package/libupnp/Config.in"
+source "package/libusb/Config.in"
+source "package/libvorbis/Config.in"
+source "package/libvorbisidec/Config.in"
+source "package/tcp_wrappers/Config.in"
+source "package/libxml2/Config.in"
+source "package/libxslt/Config.in"
+source "package/uclibc++/Config.in"
+source "package/ustl/Config.in"
+source "package/zlib/Config.in"
+endmenu
+
+menu "X"
+depends ADK_XORG
+source "package/xorg-server/Config.in"
+
+menu "X Libraries"
+source "package/libICE/Config.in"
+source "package/libSM/Config.in"
+source "package/libX11/Config.in"
+source "package/libXdmcp/Config.in"
+source "package/libXext/Config.in"
+source "package/libXfont/Config.in"
+source "package/libfontenc/Config.in"
+source "package/libpciaccess/Config.in"
+source "package/libxkbfile/Config.in"
+source "package/libXau/Config.in"
+source "package/libXaw/Config.in"
+source "package/libXmu/Config.in"
+source "package/libXpm/Config.in"
+source "package/libXt/Config.in"
+source "package/pixman/Config.in"
+source "package/xf86dga/Config.in"
+source "package/xproto/Config.in"
+endmenu
+endmenu
+
+endmenu
+
+menu "Kernel configuration"
+source "target/linux/Config.in"
+endmenu
+
diff --git a/package/Depends.mk b/package/Depends.mk
new file mode 100644
index 000000000..70650cccc
--- /dev/null
+++ b/package/Depends.mk
@@ -0,0 +1,391 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+aircrack-ng-compile: openssl-compile libpcap-compile
+apr-util-compile: expat-compile apr-compile
+arpd-compile: libpcap-compile libdnet-compile libevent-compile
+arpwatch-compile: libpcap-compile
+atftp-compile: readline-compile ncurses-compile
+avahi-compile: libdaemon-compile expat-compile libgdbm-compile
+bind-compile: openssl-compile
+bitlbee-compile: libiconv-compile openssl-compile glib2-compile
+bluez-compile: libusb-compile dbus-compile
+bogofilter-compile: libiconv-compile libdb-compile
+ifeq (${ADK_COMPILE_CBTT_WITH_UCLIBCXX},y)
+cbtt-compile: uclibc++-compile
+endif
+cbtt-compile: mysql-compile zlib-compile
+collectd-compile: libpthread-compile
+cryptsetup-compile: libgcrypt-compile popt-compile e2fsprogs-compile device-mapper-compile
+ifeq (${ADK_COMPILE_CTORRENT_WITH_UCLIBCXX},y)
+ctorrent-compile: uclibc++-compile
+endif
+ctorrent-compile: openssl-compile
+cups-compile: zlib-compile
+curl-compile: openssl-compile zlib-compile
+cxxtools-compile: libiconv-compile
+ifeq (${ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX},y)
+cxxtools-compile: uclibc++-compile
+endif
+cyrus-sasl-compile: openssl-compile
+ifneq (${ADK_PACKAGE_DAVFS2_FUSE}${ADK_PACKAGE_DAVFS2_BOTH},)
+davfs2-compile: fuse-compile
+endif
+davfs2-compile: libiconv-compile neon-compile
+dbus-compile: expat-compile
+deco-compile: ncurses-compile
+dhcp6-compile: ncurses-compile
+digitemp-compile: libusb-compile
+dsniff-compile: libnids-compile openssl-compile libgdbm-compile
+elinks-compile: openssl-compile
+esound-compile: libaudiofile-compile
+ettercap-compile: pcap-compile libnet-compile
+exmap-compile: glib2-compile readline-compile
+fprobe-compile: libpcap-compile
+freetype-compile: zlib-compile
+gatling-compile: libowfat-compile libiconv-compile
+gcc-compile: gmp-compile mpfr-compile
+gdb-compile: ncurses-compile readline-compile
+gettext-compile: libiconv-compile libpthread-compile
+gkrellmd-compile: glib-compile
+glib2-compile: gettext-compile libiconv-compile
+gmediaserver-compile: id3lib-compile libupnp-compile
+gnutls-compile: libgcrypt-compile liblzo-compile libtasn1-compile opencdk-compile zlib-compile
+ifeq (${ADK_COMPILE_GPSD_WITH_UCLIBCXX},y)
+gpsd-compile: uclibc++-compile
+endif
+gpsd-compile: ncurses-compile
+ifeq (${ADK_COMPILE_HEIMDAL_WITH_DB_BDB},y)
+heimdal-compile: libdb-compile
+endif
+ifeq (${ADK_COMPILE_HEIMDAL_WITH_DB_LDAP},y)
+heimdal-compile: openldap-compile
+endif
+heimdal-compile: openssl-compile ncurses-compile
+httping-compile: openssl-compile
+icecast-compile: curl-compile libvorbis-compile libxml2-compile libxslt-compile
+ifeq (${ADK_COMPILE_ID3LIB_WITH_UCLIBCXX},y)
+id3lib-compile: uclibc++-compile
+endif
+id3lib-compile: zlib-compile libiconv-compile
+iftop-compile: libpcap-compile libpthread-compile ncurses-compile
+ipcad-compile: libpcap-compile
+ifeq (${ADK_COMPILE_IPERF_WITH_UCLIBCXX},y)
+iperf-compile: uclibc++-compile
+endif
+ipsec-tools-compile: openssl-compile
+iptables-snmp-compile: net-snmp-compile
+iptraf-compile: ncurses-compile
+irssi-compile: glib2-compile ncurses-compile
+iw-compile: libnl-compile
+jamvm-compile: libffi-compile zlib-compile
+ifeq (${ADK_COMPILE_KISMET_WITH_UCLIBCXX},y)
+kismet-compile: uclibc++-compile
+endif
+kismet-compile: libpcap-compile ncurses-compile
+knock-compile: libpcap-compile
+krb5-compile: ncurses-compile
+l2tpns-compile: libcli-compile
+less-compile: ncurses-compile
+libgcrypt-compile: libgpg-error-compile
+libgd-compile: libpng-compile jpeg-compile
+libid3tag-compile: zlib-compile
+libnet-compile: libpcap-compile
+libnids-compile: libnet-compile
+libp11-compile: openssl-compile libtool-compile
+libpng-compile: zlib-compile
+libshout-compile: libvorbis-compile
+libtorrent-compile: openssl-compile libsigc++-compile
+libvorbis-compile: libogg-compile
+libfontenc-compile: xproto-compile zlib-compile
+libSM-compile: libICE-compile
+libXt-compile: libSM-compile
+libXmu-compile: libXt-compile
+libXaw-compile: libXext-compile libXmu-compile libXpm-compile
+libX11-compile: xproto-compile xextproto-compile xtrans-compile libXdmcp-compile \
+ libXau-compile libXaw-compile xcmiscproto-compile bigreqsproto-compile kbproto-compile \
+ inputproto-compile
+libXfont-compile: freetype-compile fontcacheproto-compile fontsproto-compile libfontenc-compile
+libxml2-compile: zlib-compile
+libxslt-compile: libxml2-compile
+ifeq (${ADK_COMPILE_LIGHTTPD_WITH_OPENSSL},y)
+lighttpd-compile: openssl-compile
+endif
+lighttpd-compile: pcre-compile libxml2-compile sqlite-compile
+links-compile: openssl-compile libpng-compile jpeg-compile gpm-compile
+logrotate-compile: popt-compile
+lynx-compile: ncurses-compile openssl-compile
+madplay-compile: libid3tag-compile libmad-compile
+maradns-compile: libpthread-compile
+mc-compile: glib-compile ncurses-compile
+miax-compile: bluez-compile
+ifeq (${ADK_COMPILE_MIREDO_WITH_UCLIBCXX},y)
+miredo-compile: uclibc++-compile
+endif
+moc-compile: libvorbis-compile curl-compile libmad-compile flac-compile ffmpeg-compile
+monit-compile: openssl-compile
+ifeq (${ADK_COMPILE_MRD6_WITH_UCLIBCXX},y)
+mrd6-compile: uclibc++-compile
+endif
+mt-daapd-compile: libgdbm-compile libid3tag-compile
+mtr-compile: ncurses-compile
+mutt-compile: ncurses-compile openssl-compile
+mysql-compile: ncurses-compile zlib-compile
+nano-compile: ncurses-compile
+neon-compile: libpthread-compile libxml2-compile openssl-compile zlib-compile
+net-snmp-compile: libelf-compile
+ifeq (${ADK_COMPILE_NFS_UTILS_WITH_KRB5},y)
+nfs-utils-compile: libnfsidmap-compile krb5-compile libevent-compile libgssglue-compile librpcsecgss-compile
+endif
+ifeq (${ADK_COMPILE_NFS_UTILS_WITH_HEIMDAL},y)
+nfs-utils-compile: libnfsidmap-compile heimdal-compile libevent-compile librpcsecgss-compile
+endif
+ifeq (${ADK_IPV6},y)
+nfs-utils-compile: libtirpc-compile
+endif
+ifeq (${ADK_COMPILE_NMAP_WITH_UCLIBCXX},y)
+nmap-compile: uclibc++-compile
+endif
+nmap-compile: pcre-compile libpcap-compile
+nocatsplash-compile: glib-compile
+obexftp-compile: openobex-compile libiconv-compile
+opencdk-compile: libgcrypt-compile libgpg-error-compile zlib-compile
+openct-compile: libtool-compile libusb-compile
+openldap-compile: cyrus-sasl-compile openssl-compile libdb-compile
+opensips-compile: openssl-compile
+ifeq (${ADK_COMPILE_OPENSSH_WITH_KRB5},y)
+openssh-compile: krb5-compile
+endif
+ifeq (${ADK_COMPILE_OPENSSH_WITH_HEIMDAL},y)
+openssh-compile: heimdal-compile
+endif
+openssh-compile: zlib-compile openssl-compile
+openssl-compile: zlib-compile
+openssl-pkcs11-compile: libp11-compile
+openswan-compile: gmp-compile
+oprofile-compile: popt-compile
+osiris-compile: openssl-compile
+palantir-compile: jpeg-compile
+pciutils-compile: zlib-compile
+ifneq ($(strip ${ADK_PACKAGE_PORTMAP_LIBWRAP}),)
+portmap-compile: tcp_wrappers-compile
+endif
+postgresql-compile: zlib-compile
+privoxy-compile: pcre-compile
+procps-compile: ncurses-compile
+ptunnel-compile: libpcap-compile
+quagga-compile: readline-compile ncurses-compile
+raddump-compile: openssl-compile libpcap-compile
+radiusclient-ng-compile: openssl-compile
+rarpd-compile: libnet-compile
+readline-compile: ncurses-compile
+rrdcollect-compile: rrdtool-compile
+rrdtool-compile: libxml2-compile cgilib-compile freetype-compile libart-compile libpng-compile
+rsync-compile: popt-compile
+rtorrent-compile: ncurses-compile libtorrent-compile curl-compile
+sane-backends-compile: libpthread-compile libusb-compile
+scanlogd-compile: libpcap-compile libnids-compile libnet-compile
+scdp-compile: libnet-compile
+screen-compile: ncurses-compile
+serdisplib-compile: libgd-compile libusb-compile
+siproxd-compile: libosip2-compile
+sipsak-compile: openssl-compile
+sispmctl-compile: libusb-compile
+snort-compile: libnet-compile libpcap-compile pcre-compile
+snort-wireless-compile: libnet-compile libpcap-compile pcre-compile
+socat-compile: openssl-compile
+sqlite-compile: ncurses-compile readline-compile
+squid-compile: openssl-compile
+ssltunnel-compile: openssl-compile ppp-compile
+subversion-compile: apr-util-compile expat-compile apr-compile zlib-compile libiconv-compile
+swconfig-compile: libnl-compile
+syslog-ng-compile: libol-compile tcp_wrappers-compile
+tcpdump-compile: libpcap-compile
+tinc-compile: zlib-compile openssl-compile liblzo-compile
+tntnet-compile: cxxtools-compile zlib-compile
+ifneq (${ADK_COMPILE_TNTNET_WITH_OPENSSL},)
+tntnet-compile: openssl-compile
+else ifneq (${ADK_COMPILE_TNTNET_WITH_GNUTLS},)
+tntnet-compile: gnutls-compile
+endif
+tor-compile: libevent-compile openssl-compile zlib-compile
+trafshow: ncurses-compile libpcap-compile
+usbutils-compile: libusb-compile
+ussp-push-compile: openobex-compile
+vilistextum-compile: libiconv-compile
+vim-compile: ncurses-compile
+vnc-reflector-compile: jpeg-compile zlib-compile
+vpnc-compile: libgcrypt-compile libgpg-error-compile
+vtun-compile: zlib-compile openssl-compile liblzo-compile
+wdfs-compile: openssl-compile fuse-compile neon-compile glib2-compile
+weechat-compile: ncurses-compile gnutls-compile lua-compile libiconv-compile
+wknock-compile: libpcap-compile
+ifeq (${ADK_COMPILE_WPA_SUPPLICANT_WITH_OPENSSL},y)
+wpa_supplicant-compile: openssl-compile
+endif
+wx200d-compile: postgresql-compile
+xfsprogs-compile: e2fsprogs-compile
+libXxf86dga-compile: xf86dgaproto-compile
+xf86dga-compile: libXxf86dga-compile
+xorg-server-compile: libX11-compile randrproto-compile renderproto-compile fixesproto-compile \
+ damageproto-compile scrnsaverproto-compile resourceproto-compile \
+ fontsproto-compile videoproto-compile compositeproto-compile \
+ evieext-compile libxkbfile-compile libXfont-compile pixman-compile \
+ libpciaccess-compile openssl-compile xf86dga-compile
+
+ifeq ($(ADK_PACKAGE_APR_THREADING),y)
+apr-compile: libpthread-compile
+endif
+
+asterisk-compile: ncurses-compile openssl-compile zlib-compile curl-compile popt-compile
+ifneq ($(ADK_PACKAGE_ASTERISK_CHAN_BLUETOOTH),)
+asterisk-compile: bluez-compile
+endif
+ifneq ($(ADK_PACKAGE_ASTERISK_CODEC_SPEEX),)
+asterisk-compile: speex-compile
+endif
+ifneq ($(ADK_PACKAGE_ASTERISK_PGSQL),)
+asterisk-compile: postgresql-compile
+endif
+ifneq ($(ADK_PACKAGE_ASTERISK_MYSQL),)
+asterisk-compile: mysql-compile
+endif
+ifneq ($(ADK_PACKAGE_ASTERISK_SQLITE),)
+asterisk-compile: sqlite-compile
+endif
+
+
+freeradius-compile: libtool-compile openssl-compile
+ifneq ($(ADK_PACKAGE_FREERADIUS_MOD_LDAP),)
+freeradius-compile: openldap-compile
+endif
+ifneq ($(ADK_PACKAGE_FREERADIUS_MOD_SQL_MYSQL),)
+freeradius-compile: mysql-compile
+endif
+ifneq ($(ADK_PACKAGE_FREERADIUS_MOD_SQL_PGSQL),)
+freeradius-compile: postgresql-compile
+endif
+
+hostapd-compile: libnl-compile openssl-compile
+
+ifneq ($(ADK_PACKAGE_MINI_HTTPD_OPENSSL),)
+mini_httpd-compile: openssl-compile
+endif
+
+ifneq ($(ADK_PACKAGE_MOTION),)
+motion-compile: jpeg-compile
+endif
+
+mplayer-compile: alsa-lib-compile libmad-compile libvorbis-compile faad2-compile ncurses-compile zlib-compile
+
+mpd-compile: alsa-lib-compile glib2-compile curl-compile
+ifneq ($(ADK_PACKAGE_MPD_MP3),)
+mpd-compile: libid3tag-compile libmad-compile
+endif
+ifneq ($(ADK_PACKAGE_MPD_MP4),)
+mpd-compile: libfaad2
+endif
+ifneq ($(ADK_COMPILE_MPD_WITH_OGG),)
+mpd-compile: libvorbis-compile
+endif
+ifneq ($(ADK_COMPILE_MPD_WITH_TREMOR),)
+mpd-compile: libvorbisidec-compile
+endif
+ifneq ($(ADK_PACKAGE_MPD_FLAC),)
+mpd-compile: flac-compile
+endif
+ifneq ($(ADK_COMPILE_MPD_WITH_SHOUT),)
+mpd-compile: lame-compile
+endif
+
+ifneq (${ADK_PACKAGE_NUT_SSL},)
+nut-compile: openssl-compile
+endif
+ifneq (${ADK_PACKAGE_NUT_USB},)
+nut-compile: libusb-compile
+endif
+ifneq (${ADK_PACKAGE_NUT_SNMP},)
+nut-compile: net-snmp-compile
+endif
+
+ifeq ($(ADK_PACKAGE_LIBOPENSSL),y)
+openvpn-compile: openssl-compile
+endif
+ifeq ($(ADK_PACKAGE_OPENVPN_LZO),y)
+openvpn-compile: liblzo-compile
+endif
+
+php-compile: openssl-compile zlib-compile
+ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
+php-compile: curl-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
+php-compile: libgd-compile libpng-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
+php-compile: gmp-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
+php-compile: openldap-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
+php-compile: mysql-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
+php-compile: pcre-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
+php-compile: postgresql-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
+php-compile: sqlite-compile
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
+php-compile: expat-compile
+endif
+
+pmacct-compile: libpcap-compile
+ifneq ($(ADK_COMPILE_PMACCT_MYSQL),)
+pmacct-compile: mysql-compile
+endif
+ifneq ($(ADK_COMPILE_PMACCT_PGSQL),)
+pmacct-compile: postgresql-compile
+endif
+ifneq ($(ADK_COMPILE_PMACCT_SQLITE),)
+pmacct-compile: sqlite-compile
+endif
+
+ifeq (${ADK_COMPILE_RRS_WITH_UCLIBCXX},y)
+rrs-compile: uclibc++-compile
+endif
+rrs-compile: zlib-compile
+ifneq ($(ADK_PACKAGE_RRS),)
+rrs-compile: openssl-compile
+endif
+
+ifneq ($(ADK_PACKAGE_SUBVERSION_NEON),)
+subversion-compile: neon-compile
+endif
+
+ulogd-compile: iptables-compile
+ifneq ($(ADK_PACKAGE_ULOGD_MOD_MYSQL),)
+ulogd-compile: mysql-compile
+endif
+ifneq ($(ADK_PACKAGE_ULOGD_MOD_PCAP),)
+ulogd-compile: libpcap-compile
+endif
+ifneq ($(ADK_PACKAGE_ULOGD_MOD_PGSQL),)
+ulogd-compile: postgresql-compile
+endif
+ifneq ($(ADK_PACKAGE_ULOGD_MOD_SQLITE),)
+ulogd-compile: sqlite-compile
+endif
+ifeq (${ADK_PACKAGE_FETCHMAIL_SSL},y)
+fetchmail-compile: openssl-compile
+endif
+ifeq (${ADK_PACKAGE_IRSSI_SSL},y)
+irssi-compile: openssl-compile
+endif
+
diff --git a/package/Makefile b/package/Makefile
new file mode 100644
index 000000000..2cecd6d2d
--- /dev/null
+++ b/package/Makefile
@@ -0,0 +1,450 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+# Main makefile for the packages
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/package/Depends.mk
+
+ifneq (${ADK_PACKAGE_CGILIB},)
+ADK_COMPILE_CGILIB=${ADK_PACKAGE_CGILIB}
+else
+ifneq (${ADK_COMPILE_RRDTOOL},)
+ADK_COMPILE_CGILIB=m
+else
+ADK_COMPILE_CGILIB=
+endif
+endif
+
+package-$(ADK_PACKAGE_6TUNNEL) += 6tunnel
+package-$(ADK_PACKAGE_AICCU) += aiccu
+package-$(ADK_PACKAGE_AIRCRACK_NG) += aircrack-ng
+package-$(ADK_PACKAGE_ALSA_LIB) += alsa-lib
+package-$(ADK_PACKAGE_ALSA_UTILS) += alsa-utils
+package-$(ADK_PACKAGE_APR) += apr
+package-$(ADK_PACKAGE_APR_UTIL) += apr-util
+package-$(ADK_PACKAGE_ARPD) += arpd
+package-$(ADK_PACKAGE_ARPWATCH) += arpwatch
+package-$(ADK_PACKAGE_ASTERISK) += asterisk
+package-$(ADK_COMPILE_ATFTP) += atftp
+package-$(ADK_PACKAGE_AUTOSSH) += autossh
+package-$(ADK_COMPILE_AVAHI) += avahi
+package-$(ADK_COMPILE_AXTLS) += axtls
+package-$(ADK_PACKAGE_BASH) += bash
+package-$(ADK_COMPILE_BC) += bc
+package-$(ADK_PACKAGE_CFGFS) += cfgfs
+package-$(ADK_PACKAGE_BIGREQSPROTO) += bigreqsproto
+package-$(ADK_COMPILE_BIND) += bind
+package-$(ADK_PACKAGE_BINUTILS) += binutils
+package-$(ADK_PACKAGE_BITLBEE) += bitlbee
+package-$(ADK_PACKAGE_BOGOFILTER) += bogofilter
+package-$(ADK_PACKAGE_BLUEZ_FIRMWARE) += bluez-firmware
+package-$(ADK_PACKAGE_BLUEZ) += bluez
+package-$(ADK_PACKAGE_BRIDGE_UTILS) += bridge-utils
+package-$(ADK_PACKAGE_BUSYBOX) += busybox
+package-$(ADK_PACKAGE_BWM) += bwm
+package-$(ADK_PACKAGE_CBTT) += cbtt
+package-$(ADK_COMPILE_CGILIB) += cgilib
+package-$(ADK_PACKAGE_CHILLISPOT) += chillispot
+package-$(ADK_PACKAGE_CLICK) += click
+package-$(ADK_PACKAGE_COLLECTD) += collectd
+package-$(ADK_PACKAGE_COMGT) += comgt
+package-$(ADK_PACKAGE_COMPOSITEPROTO) += compositeproto
+package-$(ADK_PACKAGE_CTORRENT) += ctorrent
+package-$(ADK_PACKAGE_CUPS) += cups
+package-$(ADK_COMPILE_CURL) += curl
+package-$(ADK_PACKAGE_CUTTER) += cutter
+package-$(ADK_PACKAGE_CRYPTSETUP) += cryptsetup
+package-$(ADK_COMPILE_CYRUS_SASL) += cyrus-sasl
+package-$(ADK_PACKAGE_CXXTOOLS) += cxxtools
+package-$(ADK_PACKAGE_DAMAGEPROTO) += damageproto
+package-$(ADK_PACKAGE_DAVFS2) += davfs2
+package-$(ADK_PACKAGE_DBUS) += dbus
+package-$(ADK_PACKAGE_DECO) += deco
+package-$(ADK_PACKAGE_DEVICE_MAPPER) += device-mapper
+package-$(ADK_COMPILE_DHCP) += dhcp
+package-$(ADK_PACKAGE_DHCP_FORWARDER) += dhcp-forwarder
+package-$(ADK_PACKAGE_DHCP6) += dhcp6
+package-$(ADK_PACKAGE_DIGITEMP) += digitemp
+package-$(ADK_PACKAGE_DNSMASQ) += dnsmasq
+package-$(ADK_PACKAGE_DOSFSTOOLS) += dosfstools
+package-$(ADK_PACKAGE_DOVECOT) += dovecot
+package-$(ADK_PACKAGE_DROPBEAR) += dropbear
+package-$(ADK_PACKAGE_DSNIFF) += dsniff
+package-$(ADK_PACKAGE_E2FSPROGS) += e2fsprogs
+package-$(ADK_PACKAGE_LIBUUID) += e2fsprogs
+package-$(ADK_PACKAGE_ELINKS) += elinks
+package-$(ADK_PACKAGE_ESOUND) += esound
+package-$(ADK_PACKAGE_ETHER_WAKE) += ether-wake
+package-$(ADK_PACKAGE_ETHTOOL) += ethtool
+package-$(ADK_PACKAGE_EVIEEXT) += evieext
+package-$(ADK_COMPILE_EXPAT) += expat
+package-$(ADK_COMPILE_EXMAP) += exmap
+package-$(ADK_PACKAGE_EZIPUPDATE) += ez-ipupdate
+package-$(ADK_COMPILE_FAAD2) += faad2
+package-$(ADK_PACKAGE_FAKEIDENTD) += fakeidentd
+package-$(ADK_PACKAGE_FBSET) += fbset
+package-$(ADK_PACKAGE_FETCHMAIL) += fetchmail
+package-$(ADK_PACKAGE_FFMPEG) += ffmpeg
+package-$(ADK_PACKAGE_FILE) += file
+package-$(ADK_PACKAGE_FIXESPROTO) += fixesproto
+package-$(ADK_COMPILE_FLAC) += flac
+package-$(ADK_PACKAGE_FONTSPROTO) += fontsproto
+package-$(ADK_PACKAGE_FONTCACHEPROTO) += fontcacheproto
+package-$(ADK_PACKAGE_FPING) += fping
+package-$(ADK_PACKAGE_FPROBE) += fprobe
+package-$(ADK_PACKAGE_FPROBE_ULOG) += fprobe-ulog
+package-$(ADK_PACKAGE_FREERADIUS) += freeradius
+package-$(ADK_COMPILE_FREETYPE) += freetype
+package-$(ADK_PACKAGE_FRICKIN) += frickin
+package-$(ADK_COMPILE_FUSE) += fuse
+package-$(ADK_PACKAGE_GATLING) += gatling
+package-$(ADK_PACKAGE_GCC) += gcc
+package-$(ADK_PACKAGE_GDB) += gdb
+package-$(ADK_PACKAGE_GDBSERVER) += gdbserver
+package-$(ADK_PACKAGE_GETTEXT) += gettext
+package-$(ADK_PACKAGE_GKRELLMD) += gkrellmd
+package-$(ADK_COMPILE_GLIB) += glib
+package-$(ADK_PACKAGE_GLIB2) += glib2
+ifeq (${ADK_TARGET_LIB_GLIBC},y)
+package-$(ADK_PACKAGE_GLIBC) += glibc
+endif
+package-$(ADK_PACKAGE_GMEDIASERVER) += gmediaserver
+package-$(ADK_COMPILE_GMP) += gmp
+package-$(ADK_COMPILE_GNUTLS) += gnutls
+package-$(ADK_PACKAGE_GPG) += gpg
+package-$(ADK_PACKAGE_GPM) += gpm
+package-$(ADK_PACKAGE_GPSD) += gpsd
+package-$(ADK_COMPILE_GSM) += gsm
+package-$(ADK_PACKAGE_HASERL) += haserl
+package-$(ADK_PACKAGE_HDPARM) += hdparm
+package-$(ADK_COMPILE_HEIMDAL) += heimdal
+package-$(ADK_PACKAGE_HEYU) += heyu
+package-$(ADK_COMPILE_HOSTAPD) += hostapd
+package-$(ADK_PACKAGE_HTPDATE) += htpdate
+package-$(ADK_PACKAGE_HTTPING) += httping
+package-$(ADK_PACKAGE_HTTPTUNNEL) += httptunnel
+package-$(ADK_PACKAGE_ICECAST) += icecast
+package-$(ADK_PACKAGE_ID3LIB) += id3lib
+package-$(ADK_PACKAGE_IFTOP) += iftop
+package-$(ADK_PACKAGE_IGMPPROXY) += igmpproxy
+package-$(ADK_PACKAGE_INPUTPROTO) += inputproto
+package-$(ADK_PACKAGE_IPCAD) += ipcad
+package-$(ADK_PACKAGE_IPERF) += iperf
+package-$(ADK_COMPILE_IPROUTE2) += iproute2
+package-$(ADK_PACKAGE_IPSEC_TOOLS) += ipsec-tools
+package-$(ADK_PACKAGE_IPSET) += ipset
+package-$(ADK_COMPILE_IPTABLES) += iptables
+package-$(ADK_PACKAGE_IPTABLES_SNMP) += iptables-snmp
+package-$(ADK_PACKAGE_IPTRAF) += iptraf
+package-$(ADK_PACKAGE_IRSSI) += irssi
+package-$(ADK_PACKAGE_IW) += iw
+package-$(ADK_PACKAGE_JAMVM) += jamvm
+package-$(ADK_COMPILE_JPEG) += jpeg
+package-$(ADK_PACKAGE_KBPROTO) += kbproto
+package-$(ADK_COMPILE_KISMET) += kismet
+package-$(ADK_COMPILE_KNOCK) += knock
+package-$(ADK_COMPILE_KRB5) += krb5
+package-$(ADK_PACKAGE_L2TPNS) += l2tpns
+package-$(ADK_COMPILE_LAME) += lame
+package-$(ADK_PACKAGE_LESS) += less
+package-$(ADK_PACKAGE_LIBAO) += libao
+package-$(ADK_PACKAGE_LIBART) += libart
+package-$(ADK_PACKAGE_LIBAUDIOFILE) += libaudiofile
+package-$(ADK_PACKAGE_LIBCLI) += libcli
+package-$(ADK_PACKAGE_LIBDAEMON) += libdaemon
+package-$(ADK_COMPILE_DB) += libdb
+package-$(ADK_PACKAGE_LIBDNET) += libdnet
+package-$(ADK_PACKAGE_LIBELF) += libelf
+package-$(ADK_PACKAGE_LIBEVENT) += libevent
+package-$(ADK_PACKAGE_LIBFFI) += libffi
+package-$(ADK_PACKAGE_LIBFONTENC) += libfontenc
+package-$(ADK_PACKAGE_LIBGCRYPT) += libgcrypt
+package-$(ADK_PACKAGE_LIBGD) += libgd
+package-$(ADK_PACKAGE_LIBGDBM) += libgdbm
+package-$(ADK_PACKAGE_LIBGPG_ERROR) += libgpg-error
+package-$(ADK_PACKAGE_LIBGSSGLUE) += libgssglue
+package-$(ADK_PACKAGE_LIBICONV) += libiconv
+package-$(ADK_PACKAGE_LIBID3TAG) += libid3tag
+package-$(ADK_PACKAGE_LIBLZO) += liblzo
+package-$(ADK_PACKAGE_LIBMAD) += libmad
+package-$(ADK_PACKAGE_LIBNET) += libnet
+package-$(ADK_PACKAGE_LIBNFSIDMAP) += libnfsidmap
+package-$(ADK_PACKAGE_LIBNIDS) += libnids
+package-$(ADK_PACKAGE_LIBNL) += libnl
+package-$(ADK_PACKAGE_LIBOGG) += libogg
+package-$(ADK_PACAKGE_LIBOL) += libol
+package-$(ADK_PACKAGE_LIBOSIP2) += libosip2
+package-$(ADK_COMPILE_LIBOWFAT) += libowfat
+package-$(ADK_PACKAGE_LIBP11) += libp11
+package-$(ADK_PACKAGE_LIBPCAP) += libpcap
+package-$(ADK_PACKAGE_LIBPCIACCESS) += libpciaccess
+package-$(ADK_PACKAGE_LIBPNG) += libpng
+package-$(ADK_PACKAGE_LIBPRI) += libpri
+package-$(ADK_PACKAGE_LIBPTHREAD) += libpthread
+package-$(ADK_COMPILE_LIBSHOUT) += libshout
+package-$(ADK_PACKAGE_LIBSIGCXX) += libsigc++
+package-$(ADK_PACKAGE_LIBSTDCXX) += libstdcxx
+package-$(ADK_PACKAGE_LIBRPCSECGSS) += librpcsecgss
+package-$(ADK_PACKAGE_LIBTASN1) += libtasn1
+package-$(ADK_PACKAGE_LIBTHREAD_DB) += libthread_db
+package-$(ADK_PACKAGE_LIBTIFF) += libtiff
+package-$(ADK_PACKAGE_LIBTIRPC) += libtirpc
+package-$(ADK_PACKAGE_LIBTORRENT) += libtorrent
+package-$(ADK_COMPILE_LIBTOOL) += libtool
+package-$(ADK_PACKAGE_LIBUPNP) += libupnp
+package-$(ADK_PACKAGE_LIBUSB) += libusb
+package-$(ADK_PACKAGE_LIBVORBIS) += libvorbis
+package-$(ADK_PACKAGE_LIBVORBISIDEC) += libvorbisidec
+package-$(ADK_PACKAGE_LIBICE) += libICE
+package-$(ADK_PACKAGE_LIBSM) += libSM
+package-$(ADK_PACKAGE_LIBX11) += libX11
+package-$(ADK_PACKAGE_LIBXAU) += libXau
+package-$(ADK_PACKAGE_LIBXAW) += libXaw
+package-$(ADK_PACKAGE_LIBXPM) += libXpm
+package-$(ADK_PACKAGE_LIBXDMCP) += libXdmcp
+package-$(ADK_PACKAGE_LIBXEXT) += libXext
+package-$(ADK_PACKAGE_LIBXFONT) += libXfont
+package-$(ADK_PACKAGE_LIBXKBFILE) += libxkbfile
+package-$(ADK_PACKAGE_LIBXML2) += libxml2
+package-$(ADK_PACKAGE_LIBXMU) += libXmu
+package-$(ADK_PACKAGE_LIBXSLT) += libxslt
+package-$(ADK_PACKAGE_LIBXT) += libXt
+package-$(ADK_PACKAGE_LIGHTTPD) += lighttpd
+package-$(ADK_PACKAGE_LINKS) += links
+package-$(ADK_PACKAGE_LINUX_ATM) += linux-atm
+package-$(ADK_PACKAGE_LOGROTATE) += logrotate
+package-$(ADK_PACKAGE_LRZSZ) += lrzsz
+package-${ADK_PACKAGE_LYNX} += lynx
+package-$(ADK_COMPILE_LUA) += lua
+package-$(ADK_PACKAGE_LVM) += lvm
+package-$(ADK_PACKAGE_MACCHANGER) += macchanger
+package-$(ADK_PACKAGE_MADPLAY) += madplay
+package-$(ADK_PACKAGE_MARADNS) += maradns
+package-$(ADK_PACKAGE_MGETTY) += mgetty
+package-$(ADK_PACKAGE_MC) += mc
+package-$(ADK_PACKAGE_MIAU) += miau
+package-$(ADK_PACKAGE_MIAX) += miax
+package-$(ADK_PACKAGE_MICROPERL) += microperl
+package-$(ADK_COMPILE_MINI_HTTPD) += mini_httpd
+package-$(ADK_PACKAGE_MINI_SENDMAIL) += mini_sendmail
+package-$(ADK_COMPILE_MIREDO) += miredo
+package-$(ADK_PACKAGE_MKSH) += mksh
+package-$(ADK_PACKAGE_MOC) += moc
+package-$(ADK_PACKAGE_MONIT) += monit
+package-$(ADK_PACKAGE_MOTION) += motion
+package-$(ADK_PACKAGE_MPD) += mpd
+package-$(ADK_PACKAGE_MPFR) += mpfr
+package-$(ADK_PACKAGE_MPLAYER) += mplayer
+package-$(ADK_PACKAGE_MRD6) += mrd6
+package-$(ADK_PACKAGE_MT_DAAPD) += mt-daapd
+package-$(ADK_PACKAGE_MTD) += mtd
+package-$(ADK_PACKAGE_MTR) += mtr
+package-$(ADK_PACKAGE_MUTT) += mutt
+package-$(ADK_COMPILE_MYSQL) += mysql
+package-$(ADK_PACKAGE_NANO) += nano
+package-$(ADK_COMPILE_NCURSES) += ncurses
+package-$(ADK_PACKAGE_NUT) += nut
+package-$(ADK_PACKAGE_LIBNCURSES) += ncurses
+package-$(ADK_COMPILE_NDISC6) += ndisc
+package-$(ADK_PACKAGE_NEON) += neon
+package-$(ADK_COMPILE_NET_SNMP) += net-snmp
+package-$(ADK_PACKAGE_NETPERF) += netperf
+package-$(ADK_PACKAGE_NETSTAT_NAT) += netstat-nat
+package-$(ADK_PACKAGE_NFS_UTILS) += nfs-utils
+package-$(ADK_PACKAGE_NFS_KERNEL_NFSD) += nfs-utils
+package-$(ADK_PACKAGE_NMAP) += nmap
+package-$(ADK_PACKAGE_NOCATSPLASH) += nocatsplash
+package-$(ADK_PACKAGE_NTPCLIENT) += ntpclient
+package-$(ADK_PACKAGE_OBEXFTP) += obexftp
+package-$(ADK_PACKAGE_OLSRD) += olsrd
+package-$(ADK_COMPILE_OPENCDK) += opencdk
+package-$(ADK_PACKAGE_OPENCT) += openct
+package-$(ADK_PACKAGE_OPENOBEX) += openobex
+package-$(ADK_COMPILE_OPENLDAP) += openldap
+package-$(ADK_PACKAGE_OPENNTPD) += openntpd
+package-$(ADK_PACKAGE_OPENSC) += opensc
+package-$(ADK_PACKAGE_OPENSIPS) += opensips
+package-$(ADK_COMPILE_OPENSSH) += openssh
+package-$(ADK_COMPILE_OPENSSL) += openssl
+package-$(ADK_PACKAGE_OPENSSL_PKCS11) += openssl-pkcs11
+package-$(ADK_PACKAGE_OPENSWAN) += openswan
+package-$(ADK_PACKAGE_OPENVPN) += openvpn
+package-$(ADK_PACKAGE_OPROFILE) += oprofile
+package-$(ADK_COMPILE_OSIRIS) += osiris
+package-$(ADK_PACKAGE_OWFS) += owfs
+package-$(ADK_PACKAGE_P910ND) += p910nd
+package-$(ADK_PACKAGE_PALANTIR) += palantir
+package-$(ADK_PACKAGE_PARPROUTED) += parprouted
+package-$(ADK_PACKAGE_PCIUTILS) += pciutils
+package-$(ADK_COMPILE_PCRE) += pcre
+package-$(ADK_COMPILE_PHP) += php
+package-$(ADK_PACKAGE_PICOCOM) += picocom
+package-$(ADK_PACKAGE_PIPACS) += pipacs
+package-$(ADK_PACKAGE_PIXMAN) += pixman
+package-$(ADK_COMPILE_PMACCT) += pmacct
+package-$(ADK_COMPILE_POPT) += popt
+package-$(ADK_PACKAGE_PORTMAP) += portmap
+package-$(ADK_PACKAGE_PORTSENTRY) += portsentry
+package-$(ADK_COMPILE_POSTGRESQL) += postgresql
+package-$(ADK_PACKAGE_PPP) += ppp
+package-$(ADK_PACKAGE_PPTP) += pptp
+package-$(ADK_PACKAGE_PPTPD) += pptpd
+package-$(ADK_PACKAGE_PRIVOXY) += privoxy
+package-$(ADK_PACKAGE_PROCMAIL) += procmail
+package-$(ADK_PACKAGE_PROCPS) += procps
+package-$(ADK_PACKAGE_PTUNNEL) += ptunnel
+package-$(ADK_PACKAGE_QUAGGA) += quagga
+package-$(ADK_COMPILE_RADIUSCLIENT_NG) += radiusclient-ng
+package-$(ADK_PACKAGE_RADDUMP) += raddump
+package-$(ADK_PACKAGE_RADVD) += radvd
+package-$(ADK_PACKAGE_RANDRPROTO) += randrproto
+package-$(ADK_PACKAGE_RARPD) += rarpd
+package-$(ADK_PACKAGE_RDATE) += rdate
+package-$(ADK_COMPILE_READLINE) += readline
+package-$(ADK_PACKAGE_REAIM) += reaim
+package-$(ADK_PACKAGE_RENDERPROTO) += renderproto
+package-$(ADK_PACKAGE_RESOURCEPROTO) += resourceproto
+package-$(ADK_COMPILE_RP_PPPOE) += rp-pppoe
+package-$(ADK_PACKAGE_RRDCOLLECT) += rrdcollect
+package-$(ADK_COMPILE_RRDTOOL) += rrdtool
+package-$(ADK_PACKAGE_RUBY) += ruby
+package-$(ADK_COMPILE_RRS) += rrs
+package-$(ADK_PACKAGE_RSYNC) += rsync
+package-$(ADK_PACKAGE_RTORRENT) += rtorrent
+package-$(ADK_COMPILE_SAMBA) += samba
+package-$(ADK_PACKAGE_SANE_BACKENDS) += sane-backends
+package-$(ADK_PACKAGE_SCANLOGD) += scanlogd
+package-$(ADK_PACKAGE_SCDP) += scdp
+package-$(ADK_PACKAGE_SCREEN) += screen
+package-$(ADK_PACKAGE_SCRNSAVERPROTO) += scrnsaverproto
+package-$(ADK_PACKAGE_SCSI_SPIN) += scsi-spin
+package-$(ADK_PACKAGE_SER2NET) += ser2net
+package-$(ADK_PACKAGE_SERDISPLIB) += serdisplib
+package-$(ADK_PACKAGE_SETPWC) += setpwc
+package-$(ADK_PACKAGE_SETSERIAL) += setserial
+package-$(ADK_PACKAGE_SHAT) += shat
+package-$(ADK_PACKAGE_SHOREWALL) += shorewall-common
+package-${ADK_PACKAGE_SHOREWALL_SHELL} += shorewall-shell
+package-$(ADK_PACKAGE_SIPROXD) += siproxd
+package-$(ADK_PACKAGE_SIPSAK) += sipsak
+package-$(ADK_PACKAGE_SISPMCTL) += sispmctl
+package-$(ADK_PACKAGE_SLURM) += slurm
+package-$(ADK_COMPILE_SNORT) += snort
+package-$(ADK_COMPILE_SNORT_WIRELESS) += snort-wireless
+package-$(ADK_PACKAGE_SOCAT) += socat
+package-$(ADK_COMPILE_SPEEX) += speex
+package-$(ADK_COMPILE_SQLITE) += sqlite
+package-$(ADK_PACKAGE_SQUID) += squid
+package-$(ADK_PACKAGE_SRELAY) += srelay
+package-$(ADK_PACKAGE_SSLTUNNEL) += ssltunnel
+package-$(ADK_PACKAGE_SSMTP) += ssmtp
+package-$(ADK_PACKAGE_STRACE) += strace
+package-$(ADK_PACKAGE_STRESS) += stress
+package-$(ADK_PACKAGE_STRONGSWAN) += strongswan
+package-$(ADK_PACKAGE_SUBVERSION) += subversion
+package-$(ADK_PACKAGE_SWCONFIG) += swconfig
+package-$(ADK_PACKAGE_SYSLOG_NG) += syslog-ng
+package-$(ADK_PACKAGE_SYSSTAT) += sysstat
+package-${ADK_PACKAGE_TCL} += tcl
+package-$(ADK_PACKAGE_LIBWRAP) += tcp_wrappers
+package-$(ADK_PACKAGE_TAR) += tar
+package-$(ADK_PACKAGE_TCPDUMP) += tcpdump
+package-$(ADK_PACKAGE_TINC) += tinc
+package-$(ADK_PACKAGE_TINYPROXY) += tinyproxy
+package-$(ADK_PACKAGE_TMSNC) += tmsnc
+package-$(ADK_PACKAGE_TNTNET) += tntnet
+package-$(ADK_PACKAGE_TOR) += tor
+package-$(ADK_PACKAGE_TRAFSHOW) += trafshow
+package-$(ADK_PACKAGE_TTCP) += ttcp
+ifneq (${ADK_TARGET_LIB_GLIBC},y)
+package-$(ADK_PACKAGE_UCLIBC) += uclibc
+package-$(ADK_PACKAGE_UCLIBCXX) += uclibc++
+endif
+package-$(ADK_PACKAGE_UDEV) += udev
+package-$(ADK_PACKAGE_UDP_BROADCAST_RELAY) += udp-broadcast-relay
+package-$(ADK_PACKAGE_ULOGD) += ulogd
+package-$(ADK_PACKAGE_UPDATEDD) += updatedd
+package-$(ADK_COMPILE_USBUTILS) += usbutils
+package-$(ADK_PACKAGE_USSP_PUSH) += ussp-push
+package-$(ADK_PACKAGE_USTL) += ustl
+package-$(ADK_COMPILE_UTIL_LINUX) += util-linux
+package-$(ADK_PACKAGE_VALGRIND) += valgrind
+package-$(ADK_PACKAGE_VGP) += vgp
+package-$(ADK_PACKAGE_VIDEOPROTO) += videoproto
+package-$(ADK_PACKAGE_VILISTEXTUM) += vilistextum
+package-$(ADK_PACKAGE_VIM) += vim
+package-$(ADK_PACKAGE_VNC_REFLECTOR) += vnc-reflector
+package-$(ADK_PACKAGE_VNSTAT) += vnstat
+package-$(ADK_PACKAGE_VPNC) += vpnc
+package-$(ADK_PACKAGE_VRRPD) += vrrpd
+package-$(ADK_PACKAGE_VSFTPD) += vsftpd
+package-$(ADK_PACKAGE_VTUN) += vtun
+package-$(ADK_PACKAGE_WATCHDOG) += watchdog
+package-$(ADK_PACKAGE_WCCPD) += wccpd
+package-$(ADK_PACKAGE_WDFS) += wdfs
+package-$(ADK_PACKAGE_WEECHAT) += weechat
+package-$(ADK_PACKAGE_WIFIDOG) += wifidog
+package-$(ADK_DOWNLOAD_WIRELESS_FIRMWARE) += wireless-firmware
+package-$(ADK_PACKAGE_WIRELESS_TOOLS) += wireless-tools
+package-$(ADK_PACKAGE_WOL) += wol
+package-$(ADK_PACKAGE_WONDERSHAPER) += wondershaper
+package-$(ADK_PACKAGE_WPA_SUPPLICANT) += wpa_supplicant
+package-$(ADK_PACKAGE_WPUT) += wput
+package-$(ADK_PACKAGE_XFSPROGS) += xfsprogs
+package-$(ADK_PACKAGE_XINETD) += xinetd
+package-$(ADK_PACKAGE_XCMISCPROTO) += xcmiscproto
+package-$(ADK_PACKAGE_XEXTPROTO) += xextproto
+package-$(ADK_PACKAGE_XF86DGA) += xf86dga
+package-$(ADK_PACKAGE_XF86DGAPROTO) += xf86dgaproto
+package-$(ADK_PACKAGE_XPROTO) += xproto
+package-$(ADK_PACKAGE_XORG_SERVER) += xorg-server
+package-$(ADK_PACKAGE_XTRANS) += xtrans
+package-$(ADK_PACKAGE_ZLIB) += zlib
+package-$(ADK_PACKAGE_ZSH) += zsh
+# kernel addon packages
+package-$(ADK_PACKAGE_KMOD_EM28XX) += em28xx
+package-$(ADK_PACKAGE_KMOD_MAC80211) += mac80211
+package-$(ADK_PACKAGE_KMOD_FS_NTFS_3G) += ntfs-3g
+
+DOWNLOAD:=$(patsubst %,%-download,$(package-y) $(package-m))
+COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
+INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
+
+all: compile
+clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m) base-files)
+compile: base-files-compile $(COMPILE_PACKAGES)
+install: base-files-install $(INSTALL_PACKAGES)
+download: $(DOWNLOAD)
+
+$(COMPILE_PACKAGES): base-files-compile
+$(INSTALL_PACKAGES): base-files-install
+
+$(TARGET_DIR):
+ mkdir -p $(TARGET_DIR)
+
+%-download:
+ $(START_TRACE) "package/$(patsubst %-download,%,$@)-download: "
+ $(MAKE) -C $(patsubst %-download,%,$@) fetch
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
+
+%-compile:
+ $(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "
+ $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-ipkgs
+ $(CMD_TRACE) " done"
+ $(END_TRACE)
+
+%-install: %-compile
+ @$(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
+ @$(MAKE) -C $(patsubst %-install,%,$@) install
+ @$(CMD_TRACE) " done"
+ @$(END_TRACE)
+
+%-clean:
+ @$(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
+ @$(MAKE) -C $(patsubst %-clean,%,$@) clean
+ @$(CMD_TRACE) " done"
+ @$(END_TRACE)
diff --git a/package/aiccu/Config.in b/package/aiccu/Config.in
new file mode 100644
index 000000000..202d3c1c6
--- /dev/null
+++ b/package/aiccu/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_AICCU
+ prompt "aiccu............................. SixXS Automatic IPv6 Connectivity Client Utility"
+ depends on ADK_IPV6
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_IPV6
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ SixXS Automatic IPv6 Connectivity Client Utility
+
+ For more information about SixXS check http://www.sixxs.net/
+
diff --git a/package/aiccu/Makefile b/package/aiccu/Makefile
new file mode 100644
index 000000000..948f8eab2
--- /dev/null
+++ b/package/aiccu/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= aiccu
+PKG_VERSION:= 20070115
+PKG_RELEASE:= 7
+PKG_MD5SUM:= c9bcc83644ed788e22a7c3f3d4021350
+
+MASTER_SITES:= http://www.sixxs.net/archive/sixxs/aiccu/unix/
+DISTFILES:= $(PKG_NAME)_$(PKG_VERSION).tar.gz
+
+WRKDIST= ${WRKDIR}/$(PKG_NAME)
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,AICCU,aiccu,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+TCFLAGS+= -D_REENTRANT -D_GNU_SOURCE -DAICCU_CONSOLE \
+ -D_LINUX -DHAS_IFHEAD -DAICCU_TYPE=\"linux\"
+TLDFLAGS+= -lpthread -lresolv
+BUILD_STYLE= auto
+MAKE_FLAGS+= CC='${TARGET_CC}' CFLAGS='${TCFLAGS}' LDFLAGS='${TLDFLAGS}'
+
+do-install:
+ $(INSTALL_DIR) $(IDIR_AICCU)/usr/sbin
+ $(INSTALL_DIR) $(IDIR_AICCU)/etc/init.d
+ $(INSTALL_BIN) $(WRKBUILD)/unix-console/aiccu $(IDIR_AICCU)/usr/sbin/
+ $(INSTALL_BIN) ./files/aiccu.init \
+ $(IDIR_AICCU)/etc/init.d/aiccu
+ $(INSTALL_DATA) $(WRKBUILD)/doc/aiccu.conf $(IDIR_AICCU)/etc/aiccu.conf
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/aiccu/extra/common/dn_skipname.c b/package/aiccu/extra/common/dn_skipname.c
new file mode 100644
index 000000000..f2219f335
--- /dev/null
+++ b/package/aiccu/extra/common/dn_skipname.c
@@ -0,0 +1,51 @@
+#include <errno.h>
+#include <resolv.h>
+
+/* Ripped from glibc 2.4 sources. */
+
+/*
+ * ns_name_skip(ptrptr, eom)
+ * Advance *ptrptr to skip over the compressed name it points at.
+ * return:
+ * 0 on success, -1 (with errno set) on failure.
+ */
+int ns_name_skip(const u_char **ptrptr, const u_char *eom)
+{
+ const u_char *cp;
+ u_int n;
+
+ cp = *ptrptr;
+ while (cp < eom && (n = *cp++) != 0)
+ {
+ /* Check for indirection. */
+ switch (n & NS_CMPRSFLGS) {
+ case 0: /* normal case, n == len */
+ cp += n;
+ continue;
+ case NS_CMPRSFLGS: /* indirection */
+ cp++;
+ break;
+ default: /* illegal type */
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ break;
+ }
+ if (cp > eom)
+ {
+ errno = EMSGSIZE;
+ return (-1);
+ }
+ *ptrptr = cp;
+ return (0);
+}
+
+int dn_skipname(const u_char *ptr, const u_char *eom)
+{
+ const u_char *saveptr = ptr;
+
+ if(ns_name_skip(&ptr, eom) == -1)
+ return (-1);
+ return (ptr - saveptr);
+}
+
diff --git a/package/aiccu/files/aiccu.init b/package/aiccu/files/aiccu.init
new file mode 100644
index 000000000..e678664bf
--- /dev/null
+++ b/package/aiccu/files/aiccu.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${aiccu:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ aiccu start
+ ;;
+stop)
+ aiccu stop
+ ;;
+
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/aiccu/ipkg/aiccu.conffiles b/package/aiccu/ipkg/aiccu.conffiles
new file mode 100644
index 000000000..79c42f998
--- /dev/null
+++ b/package/aiccu/ipkg/aiccu.conffiles
@@ -0,0 +1 @@
+/etc/aiccu.conf
diff --git a/package/aiccu/ipkg/aiccu.control b/package/aiccu/ipkg/aiccu.control
new file mode 100644
index 000000000..98bc6f1ba
--- /dev/null
+++ b/package/aiccu/ipkg/aiccu.control
@@ -0,0 +1,5 @@
+Package: aiccu
+Priority: optional
+Section: net
+Depends: kmod-ipv6, libpthread
+Description: SixXS Automatic IPv6 Connectivity Client Utility
diff --git a/package/aiccu/ipkg/aiccu.postinst b/package/aiccu/ipkg/aiccu.postinst
new file mode 100644
index 000000000..e6d0f0d9a
--- /dev/null
+++ b/package/aiccu/ipkg/aiccu.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf aiccu aiccu NO
diff --git a/package/aiccu/patches/patch-common_resolver_c b/package/aiccu/patches/patch-common_resolver_c
new file mode 100644
index 000000000..b0ec0d99c
--- /dev/null
+++ b/package/aiccu/patches/patch-common_resolver_c
@@ -0,0 +1,30 @@
+$Id$
+--- aiccu.orig/common/resolver.c Sun Jul 23 14:54:51 2006
++++ aiccu/common/resolver.c Mon Jun 25 13:18:22 2007
+@@ -26,7 +26,7 @@
+
+ int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
+ {
+-#ifdef _LINUX
++#if defined(_LINUX) && !defined(__UCLIBC__)
+ struct __res_state res;
+ #endif
+ unsigned char answer[8192];
+@@ -38,7 +38,7 @@ int getrrs(const char *label, int rrtype
+ uint16_t type = 0, class = 0;
+ uint32_t ttl = 0;
+
+-#ifdef _LINUX
++#if defined(_LINUX) && !defined(__UCLIBC__)
+ memset(&res, 0, sizeof(res));
+ res.options = RES_DEBUG;
+ res_ninit(&res);
+@@ -47,7 +47,7 @@ int getrrs(const char *label, int rrtype
+ #endif
+
+ memset(answer, 0, sizeof(answer));
+-#ifdef _LINUX
++#if defined(_LINUX) && !defined(__UCLIBC__)
+ ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
+ #else
+ ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
diff --git a/package/aiccu/patches/patch-unix-console_Makefile b/package/aiccu/patches/patch-unix-console_Makefile
new file mode 100644
index 000000000..fe7f87f20
--- /dev/null
+++ b/package/aiccu/patches/patch-unix-console_Makefile
@@ -0,0 +1,27 @@
+$Id$
+--- aiccu.orig/unix-console/Makefile Mon Jan 15 11:04:04 2007
++++ aiccu/unix-console/Makefile Mon Jun 25 13:19:42 2007
+@@ -10,9 +10,9 @@
+ # $Date: 2007-01-15 11:04:27 $
+ # **********************************************************/
+
+-SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c
++SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ../common/dn_skipname.c
+ INCS = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h
+-OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o
++OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ../common/dn_skipname.o
+
+ # New features not fully implemented and thus disabled for now
+ #CFLAGS += -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE
+@@ -145,11 +145,6 @@ all: aiccu
+
+ aiccu: $(OBJS) ${SRCS} ${INCS}
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)
+-ifeq ($(shell echo $(CFLAGS) | grep -c "DEBUG"),0)
+-ifeq ($(shell echo "$(RPM_OPT_FLAGS)" | wc -c),1)
+- strip $@
+-endif
+-endif
+
+ clean:
+ $(RM) -f $(OBJS) aiccu
diff --git a/package/aircrack-ng/Config.in b/package/aircrack-ng/Config.in
new file mode 100644
index 000000000..81c8425f3
--- /dev/null
+++ b/package/aircrack-ng/Config.in
@@ -0,0 +1,16 @@
+config ADK_PACKAGE_AIRCRACK_NG
+ prompt "aircrack-ng....................... A set of tools for auditing wireless networks"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ aircrack-ng is a set of tools for auditing wireless networks:
+
+ * aircrack-ng: a program that cracks WEP and WPA (bruteforce) keys
+ * airdecap-ng: decrypts WEP or WPA encrypted capture files with known key
+ * airmon-ng: responsible for placing different cards in monitor mode
+ * aireplay-ng: responsible for packet injection
+ * airodump-ng: places all air traffic into .cap file and shows information on networks
+ http://www.aircrack-ng.org
diff --git a/package/aircrack-ng/Makefile b/package/aircrack-ng/Makefile
new file mode 100644
index 000000000..8245d5a52
--- /dev/null
+++ b/package/aircrack-ng/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= aircrack-ng
+PKG_VERSION:= 1.0-rc3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 37884de939af82eab60d3e7d165b40ad
+MASTER_SITES:= http://download.aircrack-ng.org/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,AIRCRACK_NG,aircrack-ng,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS) -Wall" \
+ CROSS="$(TARGET_CROSS)" OSNAME="Linux" \
+ prefix="/usr"
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_AIRCRACK_NG)/usr/bin
+ $(INSTALL_DIR) $(IDIR_AIRCRACK_NG)/usr/sbin
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/aircrack-ng $(IDIR_AIRCRACK_NG)/usr/bin/
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/airdecap-ng $(IDIR_AIRCRACK_NG)/usr/bin/
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/packetforge-ng $(IDIR_AIRCRACK_NG)/usr/bin/
+ $(INSTALL_BIN) $(WRKINST)/usr/sbin/aireplay-ng $(IDIR_AIRCRACK_NG)/usr/sbin/
+ $(INSTALL_BIN) $(WRKINST)/usr/sbin/airodump-ng $(IDIR_AIRCRACK_NG)/usr/sbin/
+ $(INSTALL_BIN) $(WRKINST)/usr/sbin/airtun-ng $(IDIR_AIRCRACK_NG)/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/aircrack-ng/ipkg/aircrack-ng.control b/package/aircrack-ng/ipkg/aircrack-ng.control
new file mode 100644
index 000000000..4e0ed40e7
--- /dev/null
+++ b/package/aircrack-ng/ipkg/aircrack-ng.control
@@ -0,0 +1,5 @@
+Package: aircrack-ng
+Priority: optional
+Section: net
+Depends: libpthread, libopenssl, libpcap
+Description: A set of tools for auditing wireless networks
diff --git a/package/aircrack-ng/patches/patch-src_airbase-ng_c b/package/aircrack-ng/patches/patch-src_airbase-ng_c
new file mode 100644
index 000000000..87aa03985
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_airbase-ng_c
@@ -0,0 +1,189 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/airbase-ng.c 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/airbase-ng.c 2009-05-01 15:54:30.000000000 +0200
+@@ -627,7 +627,7 @@ int addFrag(unsigned char* packet, unsig
+ if(rFragment == NULL)
+ return -1;
+
+- bzero(frame, 4096);
++ memset(frame, 0, 4096);
+ memcpy(frame, packet, len);
+
+ z = ( ( frame[1] & 3 ) != 3 ) ? 24 : 30;
+@@ -1683,7 +1683,7 @@ int intercept(uchar* packet, int length)
+ uchar K[128];
+ int z=0;
+
+- bzero(buf, 4096);
++ memset(buf, 0, 4096);
+
+ z = ( ( packet[1] & 3 ) != 3 ) ? 24 : 30;
+
+@@ -1784,7 +1784,7 @@ int packet_xmit(uchar* packet, int lengt
+
+ if((opt.external & EXT_OUT))
+ {
+- bzero(buf, 4096);
++ memset(buf, 0, 4096);
+ memcpy(buf+14, h80211, length2);
+ //mark it as outgoing packet
+ buf[12] = 0xFF;
+@@ -1823,7 +1823,7 @@ int packet_xmit_external(uchar* packet,
+ if(length < 40 || length > 3000)
+ return 1;
+
+- bzero(buf, 4096);
++ memset(buf, 0, 4096);
+ if(memcmp(packet, buf, 11) != 0)
+ {
+ // printf("wrong header...\n");
+@@ -2099,13 +2099,13 @@ int addCF(uchar* packet, int length)
+ if(opt.cf_count >= 100)
+ return 1;
+
+- bzero(clear, 4096);
+- bzero(final, 4096);
+- bzero(flip, 4096);
+- bzero(frag1, 128);
+- bzero(frag2, 128);
+- bzero(frag3, 128);
+- bzero(keystream, 128);
++ memset(clear, 0, 4096);
++ memset(final, 0, 4096);
++ memset(flip, 0, 4096);
++ memset(frag1, 0, 128);
++ memset(frag2, 0, 128);
++ memset(frag3, 0, 128);
++ memset(keystream, 0, 128);
+
+ switch( packet[1] & 3 )
+ {
+@@ -2364,7 +2364,7 @@ int addarp(uchar* packet, int length)
+ if(opt.nb_arp >= opt.ringbuffer)
+ return -1;
+
+- bzero(flip, 4096);
++ memset(flip, 0, 4096);
+
+ flip[49-z-4] ^= ((rand() % 255)+1); //flip random bits in last byte of sender MAC
+ flip[53-z-4] ^= ((rand() % 255)+1); //flip random bits in last byte of sender IP
+@@ -2519,7 +2519,7 @@ int packet_recv(uchar* packet, int lengt
+ struct ST_info *st_prv = NULL;
+
+ reasso = 0; fixed = 0;
+- bzero(essid, 256);
++ memset(essid, 0, 256);
+
+ pthread_mutex_lock( &mx_cap );
+ if(opt.record_data)
+@@ -2643,7 +2643,7 @@ int packet_recv(uchar* packet, int lengt
+ st_cur->ssid_length[i] = 0;
+ }
+
+- bzero(st_cur->essid, 256);
++ memset(st_cur->essid, 0, 256);
+ st_cur->essid_length = 0;
+
+ st_cur->wpatype = 0;
+@@ -2769,7 +2769,7 @@ int packet_recv(uchar* packet, int lengt
+ len += 8;
+
+ //eapol
+- bzero(h80211+len, 99);
++ memset(h80211+len, 0, 99);
+ h80211[len] = 0x01;//version
+ h80211[len+1] = 0x03;//type
+ h80211[len+2] = 0x00;
+@@ -2818,7 +2818,7 @@ int packet_recv(uchar* packet, int lengt
+ h80211[len+7] = 0x00;
+ h80211[len+8] = 0x20; //keylen
+
+- bzero(h80211+len+9, 90);
++ memset(h80211+len+9, 0, 90);
+ memcpy(h80211+len+17, st_cur->wpa.anonce, 32);
+
+ len+=99;
+@@ -2944,7 +2944,7 @@ int packet_recv(uchar* packet, int lengt
+ if(length < 60)
+ {
+ trailer = 60 - length;
+- bzero(h80211 + length, trailer);
++ memset(h80211 + length, 0, trailer);
+ length += trailer;
+ }
+
+@@ -2961,7 +2961,7 @@ int packet_recv(uchar* packet, int lengt
+ {
+ if( opt.promiscuous || !opt.f_essid || gotESSID((char*)tag, len) == 1)
+ {
+- bzero(essid, 256);
++ memset(essid, 0, 256);
+ memcpy(essid, tag, len);
+
+ /* store probes */
+@@ -3355,11 +3355,11 @@ skip_probe:
+ printf("\n");
+ }
+
+- bzero(st_cur->essid, 256);
++ memset(st_cur->essid, 0, 256);
+ memcpy(st_cur->essid, essid, 255);
+ st_cur->essid_length = strlen(essid);
+
+- bzero(essid, 256);
++ memset(essid, 0, 256);
+
+ /* either specified or determined */
+ if( (opt.sendeapol && ( opt.wpa1type || opt.wpa2type ) ) || (st_cur->wpatype && st_cur->wpahash) )
+@@ -3391,7 +3391,7 @@ skip_probe:
+ len += 8;
+
+ //eapol
+- bzero(h80211+len, 99);
++ memset(h80211+len, 0, 99);
+ h80211[len] = 0x01;//version
+ h80211[len+1] = 0x03;//type
+ h80211[len+2] = 0x00;
+@@ -3440,7 +3440,7 @@ skip_probe:
+ h80211[len+7] = 0x00;
+ h80211[len+8] = 0x20; //keylen
+
+- bzero(h80211+len+9, 90);
++ memset(h80211+len+9, 0, 90);
+ memcpy(h80211+len+17, st_cur->wpa.anonce, 32);
+
+ len+=99;
+@@ -3729,7 +3729,7 @@ int cfrag_fuzz(unsigned char *packet, in
+ else
+ smac = packet + 24;
+
+- bzero(overlay, 4096);
++ memset(overlay, 0, 4096);
+
+ smac[4] ^= rnd[0];
+ smac[5] ^= rnd[1];
+@@ -3902,19 +3902,19 @@ int main( int argc, char *argv[] )
+ memset( &apc, 0, sizeof( struct AP_conf ));
+
+ rESSID = (pESSID_t) malloc(sizeof(struct ESSID_list));
+- bzero(rESSID, sizeof(struct ESSID_list));
++ memset(rESSID, 0, sizeof(struct ESSID_list));
+
+ rFragment = (pFrag_t) malloc(sizeof(struct Fragment_list));
+- bzero(rFragment, sizeof(struct Fragment_list));
++ memset(rFragment, 0, sizeof(struct Fragment_list));
+
+ rClient = (pMAC_t) malloc(sizeof(struct MAC_list));
+- bzero(rClient, sizeof(struct MAC_list));
++ memset(rClient, 0, sizeof(struct MAC_list));
+
+ rBSSID = (pMAC_t) malloc(sizeof(struct MAC_list));
+- bzero(rBSSID, sizeof(struct MAC_list));
++ memset(rBSSID, 0, sizeof(struct MAC_list));
+
+ rCF = (pCF_t) malloc(sizeof(struct CF_packet));
+- bzero(rCF, sizeof(struct CF_packet));
++ memset(rCF, 0, sizeof(struct CF_packet));
+
+ pthread_mutex_init( &mx_cf, NULL );
+ pthread_mutex_init( &mx_cap, NULL );
diff --git a/package/aircrack-ng/patches/patch-src_aircrack-ng_c b/package/aircrack-ng/patches/patch-src_aircrack-ng_c
new file mode 100644
index 000000000..a852fd762
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_aircrack-ng_c
@@ -0,0 +1,41 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/aircrack-ng.c 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/aircrack-ng.c 2009-05-01 15:53:30.000000000 +0200
+@@ -245,7 +245,7 @@ void clean_exit(int ret)
+ int child_pid;
+
+ char tmpbuf[128];
+- bzero(tmpbuf, 128);
++ memset(tmpbuf, 0, 128);
+
+ if(ret && !opt.is_quiet)
+ {
+@@ -738,7 +738,7 @@ void read_thread( void *arg )
+ memset( &rb, 0, sizeof( rb ) );
+ ap_cur = NULL;
+
+- bzero(&pfh, sizeof(struct pcap_file_header));
++ memset(&pfh, 0, sizeof(struct pcap_file_header));
+
+ if( ( buffer = (uchar *) malloc( 65536 ) ) == NULL )
+ {
+@@ -1401,8 +1401,8 @@ void read_thread( void *arg )
+ dlen -=6;
+ }
+
+- bzero(weight, sizeof(weight));
+- bzero(clear, sizeof(clear));
++ memset(weight, 0, sizeof(weight));
++ memset(clear, 0, sizeof(clear));
+
+ /* calculate keystream */
+ k = known_clear(clear, &clearsize, weight, h80211, dlen);
+@@ -4525,7 +4525,7 @@ int main( int argc, char *argv[] )
+
+ /*
+ all_ivs = malloc( (256*256*256) * sizeof(used_iv));
+- bzero(all_ivs, (256*256*256)*sizeof(used_iv));
++ memset(all_ivs, 0, (256*256*256)*sizeof(used_iv));
+ */
+
+ forceptw = 0;
diff --git a/package/aircrack-ng/patches/patch-src_aircrack-ptw-lib_c b/package/aircrack-ng/patches/patch-src_aircrack-ptw-lib_c
new file mode 100644
index 000000000..a6f2505af
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_aircrack-ptw-lib_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/aircrack-ptw-lib.c 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/aircrack-ptw-lib.c 2009-05-01 15:52:04.000000000 +0200
+@@ -454,7 +454,7 @@ int PTW_computeKey(PTW_attackstate * sta
+ {
+ // Try the original klein attack first
+ for (i = 0; i < keylen; i++) {
+- bzero(&table[i][0], sizeof(PTW_tableentry) * n);
++ memset(&table[i][0], 0, sizeof(PTW_tableentry) * n);
+ for (j = 0; j < n; j++) {
+ table[i][j].b = j;
+ }
+@@ -602,7 +602,7 @@ PTW_attackstate * PTW_newattackstate() {
+ if (state == NULL) {
+ return NULL;
+ }
+- bzero(state, sizeof(PTW_attackstate));
++ memset(state, 0, sizeof(PTW_attackstate));
+ for (i = 0; i < PTW_KEYHSBYTES; i++) {
+ for (k = 0; k < n; k++) {
+ state->table[i][k].b = k;
diff --git a/package/aircrack-ng/patches/patch-src_aireplay-ng_c b/package/aircrack-ng/patches/patch-src_aireplay-ng_c
new file mode 100644
index 000000000..66a92b0cc
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_aireplay-ng_c
@@ -0,0 +1,42 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/aireplay-ng.c 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/aireplay-ng.c 2009-05-01 15:52:04.000000000 +0200
+@@ -2908,7 +2908,7 @@ add_arp:
+ return( 1 );
+ }
+
+- bzero(flip, 4096);
++ memset(flip, 0, 4096);
+
+ // flip[49-24-4] ^= ((rand() % 255)+1); //flip random bits in last byte of sender MAC
+ // flip[53-24-4] ^= ((rand() % 255)+1); //flip random bits in last byte of sender IP
+@@ -3086,13 +3086,13 @@ read_packets:
+ break;
+ }
+
+- bzero(clear, 4096);
+- bzero(final, 4096);
+- bzero(flip, 4096);
+- bzero(frag1, 128);
+- bzero(frag2, 128);
+- bzero(frag3, 128);
+- bzero(keystream, 128);
++ memset(clear, 0, 4096);
++ memset(final, 0, 4096);
++ memset(flip, 0, 4096);
++ memset(frag1, 0, 128);
++ memset(frag2, 0, 128);
++ memset(frag3, 0, 128);
++ memset(keystream, 0, 128);
+
+ /* check if it's a potential ARP request */
+
+@@ -3378,7 +3378,7 @@ int do_attack_chopchop( void )
+ if( opt.r_smac_set == 1 )
+ {
+ //handle picky APs (send one valid packet before all the invalid ones)
+- bzero(packet, sizeof(packet));
++ memset(packet, 0, sizeof(packet));
+
+ memcpy( packet, NULL_DATA, 24 );
+ memcpy( packet + 4, "\xFF\xFF\xFF\xFF\xFF\xFF", 6 );
diff --git a/package/aircrack-ng/patches/patch-src_airodump-ng_c b/package/aircrack-ng/patches/patch-src_airodump-ng_c
new file mode 100644
index 000000000..989f0274d
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_airodump-ng_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/airodump-ng.c 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/airodump-ng.c 2009-05-01 15:52:04.000000000 +0200
+@@ -4325,7 +4325,7 @@ int detect_frequencies(struct wif *wi)
+ printf("Checking available frequencies, this could take few seconds.\n");
+
+ frequencies = (int*) malloc((max_freq_num+1) * sizeof(int)); //field for frequencies supported
+- bzero(frequencies, (max_freq_num+1) * sizeof(int));
++ memset(frequencies, 0, (max_freq_num+1) * sizeof(int));
+ for(freq=start_freq; freq<=end_freq; freq+=5)
+ {
+ if(wi_set_freq(wi, freq) == 0)
+@@ -4388,7 +4388,7 @@ int rearrange_frequencies()
+ pos = 0;
+
+ freqs = malloc(sizeof(int) * (count + 1));
+- bzero(freqs, sizeof(int) * (count + 1));
++ memset(freqs, 0, sizeof(int) * (count + 1));
+ round_done = 0;
+
+ while(left > 0)
diff --git a/package/aircrack-ng/patches/patch-src_airtun-ng_c b/package/aircrack-ng/patches/patch-src_airtun-ng_c
new file mode 100644
index 000000000..4723eaf1a
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_airtun-ng_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/airtun-ng.c 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/airtun-ng.c 2009-05-01 15:52:04.000000000 +0200
+@@ -222,7 +222,7 @@ int addFrag(unsigned char* packet, unsig
+ if(rFragment == NULL)
+ return -1;
+
+- bzero(frame, 4096);
++ memset(frame, 0, 4096);
+ memcpy(frame, packet, len);
+
+ z = ( ( frame[1] & 3 ) != 3 ) ? 24 : 30;
+@@ -1029,7 +1029,7 @@ int main( int argc, char *argv[] )
+ memset( &dev, 0, sizeof( dev ) );
+
+ rFragment = (pFrag_t) malloc(sizeof(struct Fragment_list));
+- bzero(rFragment, sizeof(struct Fragment_list));
++ memset(rFragment, 0, sizeof(struct Fragment_list));
+
+ opt.r_nbpps = 100;
+ opt.tods = 0;
diff --git a/package/aircrack-ng/patches/patch-src_osdep_linux_c b/package/aircrack-ng/patches/patch-src_osdep_linux_c
new file mode 100644
index 000000000..691af6d9f
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_osdep_linux_c
@@ -0,0 +1,17 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/osdep/linux.c 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/osdep/linux.c 2009-05-01 15:52:04.000000000 +0200
+@@ -1639,11 +1639,11 @@ static int do_linux_open(struct wif *wi,
+
+ //use name in buf as new iface and set original iface as main iface
+ dev->main_if = (char*) malloc(strlen(iface)+1);
+- bzero(dev->main_if, strlen(iface)+1);
++ memset(dev->main_if, 0, strlen(iface)+1);
+ strncpy(dev->main_if, iface, strlen(iface));
+
+ iface=(char*)malloc(strlen(buf)+1);
+- bzero(iface, strlen(buf)+1);
++ memset(iface, 0, strlen(buf)+1);
+ strncpy(iface, buf, strlen(buf));
+ }
+
diff --git a/package/aircrack-ng/patches/patch-src_version_h b/package/aircrack-ng/patches/patch-src_version_h
new file mode 100644
index 000000000..fca57354b
--- /dev/null
+++ b/package/aircrack-ng/patches/patch-src_version_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- aircrack-ng-1.0-rc3.orig/src/version.h 2009-03-26 22:01:02.000000000 +0100
++++ aircrack-ng-1.0-rc3/src/version.h 2009-05-01 15:56:37.000000000 +0200
+@@ -1,6 +1,7 @@
+ #define _MAJ 1
+ #define _MIN 0
+ #define _SUB_MIN 0
++#define _REVISION 1
+ #define _BETA 0
+ #define _RC 3
+ #define WEBSITE "http://www.aircrack-ng.org"
diff --git a/package/alsa-lib/Config.in b/package/alsa-lib/Config.in
new file mode 100644
index 000000000..6276ba489
--- /dev/null
+++ b/package/alsa-lib/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_ALSA_LIB
+ prompt "alsa-lib............................ alsa library"
+ tristate
+ default n
+ help
+
+ http://www.alsa-project.org/
diff --git a/package/alsa-lib/Makefile b/package/alsa-lib/Makefile
new file mode 100644
index 000000000..74c857a10
--- /dev/null
+++ b/package/alsa-lib/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= alsa-lib
+PKG_VERSION:= 1.0.19
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 73db3666c211e5fb023bb77450cf430d
+MASTER_SITES:= ftp://ftp.task.gda.pl/pub/linux/misc/alsa/lib/ \
+ ftp://ftp.alsa-project.org/pub/lib/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ALSA_LIB,alsa-lib,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-python
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ALSA_LIB}/usr/lib
+ ${INSTALL_DIR} ${IDIR_ALSA_LIB}/usr/share/alsa
+ ${CP} ${WRKINST}/usr/lib/libasound.so.* ${IDIR_ALSA_LIB}/usr/lib/
+ ${CP} ${WRKINST}/usr/share/alsa/* ${IDIR_ALSA_LIB}/usr/share/alsa/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/alsa-lib/ipkg/alsa-lib.control b/package/alsa-lib/ipkg/alsa-lib.control
new file mode 100644
index 000000000..480bb0dae
--- /dev/null
+++ b/package/alsa-lib/ipkg/alsa-lib.control
@@ -0,0 +1,4 @@
+Package: alsa-lib
+Priority: optional
+Section: libs
+Description: ALSA sound library
diff --git a/package/alsa-lib/ipkg/alsa-lib.postinst b/package/alsa-lib/ipkg/alsa-lib.postinst
new file mode 100644
index 000000000..848959231
--- /dev/null
+++ b/package/alsa-lib/ipkg/alsa-lib.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+gid=$(get_next_gid)
+add_group audio $gid
diff --git a/package/alsa-utils/Config.in b/package/alsa-utils/Config.in
new file mode 100644
index 000000000..64fc5ab94
--- /dev/null
+++ b/package/alsa-utils/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_ALSA_UTILS
+ prompt "alsa-utils........................ ALSA utilities / mixer"
+ tristate
+ default n
+ help
+
+ http://www.alsa-project.org/
diff --git a/package/alsa-utils/Makefile b/package/alsa-utils/Makefile
new file mode 100644
index 000000000..6359b9ea0
--- /dev/null
+++ b/package/alsa-utils/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= alsa-utils
+PKG_VERSION:= 1.0.19
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 5ff0379c707c1a29083233edc9ab4e06
+MASTER_SITES:= ftp://ftp.task.gda.pl/pub/linux/misc/alsa/utils/ \
+ ftp://ftp.alsa-project.org/pub/utils/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ALSA_UTILS,alsa-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-alsamixer
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ALSA_UTILS}/etc/init.d
+ ${INSTALL_BIN} ./files/amixer.init ${IDIR_ALSA_UTILS}/etc/init.d/amixer
+ ${INSTALL_DIR} ${IDIR_ALSA_UTILS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/amixer ${IDIR_ALSA_UTILS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/alsa-utils/files/amixer.init b/package/alsa-utils/files/amixer.init
new file mode 100644
index 000000000..5d5aa6e2b
--- /dev/null
+++ b/package/alsa-utils/files/amixer.init
@@ -0,0 +1,30 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${amixer:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ amixer set Master on
+ amixer set PCM on
+ amixer set Master 75%
+ amixer set PCM 75%
+ ;;
+stop)
+ amixer set Master off
+ amixer set PCM off
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/alsa-utils/ipkg/alsa-utils.control b/package/alsa-utils/ipkg/alsa-utils.control
new file mode 100644
index 000000000..88e38c96c
--- /dev/null
+++ b/package/alsa-utils/ipkg/alsa-utils.control
@@ -0,0 +1,4 @@
+Package: alsa-utils
+Priority: optional
+Section: libs
+Description: ALSA utilities
diff --git a/package/alsa-utils/ipkg/alsa-utils.postinst b/package/alsa-utils/ipkg/alsa-utils.postinst
new file mode 100644
index 000000000..f18dbf62a
--- /dev/null
+++ b/package/alsa-utils/ipkg/alsa-utils.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf amixer
+
diff --git a/package/alsa-utils/patches/patch-alsactl_init_parse_c b/package/alsa-utils/patches/patch-alsactl_init_parse_c
new file mode 100644
index 000000000..fca7eedd9
--- /dev/null
+++ b/package/alsa-utils/patches/patch-alsactl_init_parse_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- alsa-utils-1.0.19.orig/alsactl/init_parse.c 2009-01-19 12:17:19.000000000 +0100
++++ alsa-utils-1.0.19/alsactl/init_parse.c 2009-05-09 04:56:45.000000000 +0200
+@@ -381,7 +381,7 @@ static int set_ctl_value(struct space *s
+ snd_ctl_elem_value_set_integer(space->ctl_value, idx, val);
+ } else if (items > 2 && value[items-2] == 'd' && value[items-1] == 'B') {
+ val = strtol(value, NULL, 0) * 100;
+- if ((pos2 = index(value, '.')) != NULL) {
++ if ((pos2 = strchr(value, '.')) != NULL) {
+ if (isdigit(*(pos2-1)) && isdigit(*(pos2-2))) {
+ if (val < 0)
+ val -= strtol(pos2 + 1, NULL, 0);
+@@ -1253,7 +1253,7 @@ static char *new_root_dir(const char *fi
+
+ res = strdup(filename);
+ if (res) {
+- tmp = rindex(res, '/');
++ tmp = strrchr(res, '/');
+ if (tmp)
+ *tmp = '\0';
+ }
diff --git a/package/apr-util/Config.in b/package/apr-util/Config.in
new file mode 100644
index 000000000..c691fe035
--- /dev/null
+++ b/package/apr-util/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_APR_UTIL
+ prompt "apr-util.......................... Apache Portable Runtime (utils)"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBEXPAT
+ select ADK_PACKAGE_APR
+ help
+ Apache Portable Runtime
+
+ http://apr.apache.org
+
+
diff --git a/package/apr-util/Makefile b/package/apr-util/Makefile
new file mode 100644
index 000000000..64c7c33a3
--- /dev/null
+++ b/package/apr-util/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= apr-util
+PKG_VERSION:= 0.9.15
+PKG_RELEASE:= 1
+PKG_MD5SUM:= dc772ae295f49ddb8ee8e69a9716c53b
+MASTER_SITES:= http://apache.mirror.clusters.cc/apr/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,APR_UTIL,$(PKG_NAME),${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-berkeley-db
+CONFIGURE_ARGS+= --with-apr=${STAGING_DIR}/usr
+CONFIGURE_ARGS+= --with-expat=${STAGING_DIR}/usr
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= apr_builddir=${STAGING_DIR}/usr/share/build \
+ apr_builders=${STAGING_DIR}/usr/share/build
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_APR_UTIL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libaprutil-0.so* ${IDIR_APR_UTIL}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/apr-util/ipkg/apr-util.control b/package/apr-util/ipkg/apr-util.control
new file mode 100644
index 000000000..45af346d3
--- /dev/null
+++ b/package/apr-util/ipkg/apr-util.control
@@ -0,0 +1,5 @@
+Package: apr-util
+Priority: optional
+Section: lib
+Description: Apache Portable Runtime
+Depends: libexpat, apr
diff --git a/package/apr-util/patches/patch-uri_Makefile_in b/package/apr-util/patches/patch-uri_Makefile_in
new file mode 100644
index 000000000..670623ad0
--- /dev/null
+++ b/package/apr-util/patches/patch-uri_Makefile_in
@@ -0,0 +1,19 @@
+$Id$
+--- apr-util-0.9.13.orig/uri/Makefile.in 2004-11-25 00:45:40.000000000 +0100
++++ apr-util-0.9.13/uri/Makefile.in 2007-02-07 12:55:37.000000000 +0100
+@@ -3,7 +3,7 @@ VPATH = @srcdir@
+ INCLUDES = @APRUTIL_PRIV_INCLUDES@ @APR_INCLUDES@ @APRUTIL_INCLUDES@ -I.
+
+ TARGETS = uri_delims.h apr_uri.lo
+-CLEAN_TARGETS = gen_uri_delims uri_delims.h
++CLEAN_TARGETS = gen_uri_delims
+
+ # bring in rules.mk for standard functionality
+ @INCLUDE_RULES@
+@@ -13,6 +13,3 @@ gen_uri_delims: $(gen_uri_delims_OBJECTS
+ $(LINK) $(EXTRA_LDFLAGS) $(gen_uri_delims_OBJECTS) $(EXTRA_LIBS)
+
+ apr_uri.lo: uri_delims.h apr_uri.c
+-
+-uri_delims.h: gen_uri_delims
+- ./gen_uri_delims > uri_delims.h
diff --git a/package/apr-util/patches/uri_delim.patch b/package/apr-util/patches/uri_delim.patch
new file mode 100644
index 000000000..04ca4e1d8
--- /dev/null
+++ b/package/apr-util/patches/uri_delim.patch
@@ -0,0 +1,21 @@
+diff -Nur apr-util-0.9.13/uri/uri_delims.h build_mipsel/w-apr-util-0.9.13-1/apr-util-0.9.13/uri/uri_delims.h
+--- apr-util-0.9.13/uri/uri_delims.h 1970-01-01 01:00:00.000000000 +0100
++++ build_mipsel/w-apr-util-0.9.13-1/apr-util-0.9.13/uri/uri_delims.h 2007-02-07 13:06:56.000000000 +0100
+@@ -0,0 +1,16 @@
++/* this file is automatically generated by gen_uri_delims, do not edit */
++static const unsigned char uri_delims[256] = {
++ T_NUL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,T_HASH,0,0,0,0,
++ 0,0,0,0,0,0,0,T_SLASH,0,0,0,0,0,0,0,0,0,0,T_COLON,0,
++ 0,0,0,T_QUESTION,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
++};
+
diff --git a/package/apr/Config.in b/package/apr/Config.in
new file mode 100644
index 000000000..0cee1afbc
--- /dev/null
+++ b/package/apr/Config.in
@@ -0,0 +1,16 @@
+config ADK_PACKAGE_APR
+ prompt "apr............................... Apache Portable Runtime"
+ tristate
+ default n
+ help
+ Apache Portable Runtime
+
+ http://apr.apache.org
+
+config ADK_PACKAGE_APR_THREADING
+ prompt " Enable threading support"
+ bool
+ default n
+ depends ADK_PACKAGE_APR
+ help
+ Enable threading support in APR.
diff --git a/package/apr/Makefile b/package/apr/Makefile
new file mode 100644
index 000000000..7903f4cf8
--- /dev/null
+++ b/package/apr/Makefile
@@ -0,0 +1,54 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= apr
+PKG_VERSION:= 0.9.17
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ca1e22d98081a03a33c2a0b8684eb192
+MASTER_SITES:= http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/${PKG_NAME}/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,APR,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_setpgrp_void=no
+CONFIGURE_ENV+= ac_cv_sizeof_size_t=4
+CONFIGURE_ENV+= ac_cv_sizeof_ssize_t=4
+CONFIGURE_ENV+= ac_cv_file__dev_zero=yes
+CONFIGURE_ENV+= apr_cv_process_shared_works=no
+CONFIGURE_ARGS+= --with-devrandom=/dev/urandom
+
+ifeq (${ADK_PACKAGE_APR_THREADING},y)
+CONFIGURE_ARGS+= --enable-threads
+else
+CONFIGURE_ARGS+= --disable-threads
+endif
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_APR}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libapr-0.so* ${IDIR_APR}/usr/lib/
+
+ ${INSTALL_DIR} ${STAGING_DIR}/usr/share/build
+ ${CP} ${WRKINST}/usr/share/build/* ${STAGING_DIR}/usr/share/build/
+
+ # we need to patch paths to get apr-util compiling
+ printf '%s\n%s\n%s\n%s\n%s\nwq\n' \
+ '/^installbuilddir="/s##&${STAGING_DIR}/#' \
+ '/^libdir="/s##&${STAGING_DIR}/#' \
+ '/^datadir="/s##&${STAGING_DIR}/#' \
+ '/^includedir="/s##&${STAGING_DIR}/#' \
+ '/^bindir="/s##&${STAGING_DIR}/#' | \
+ ed -s ${WRKINST}/usr/bin/apr-config
+ifeq (${ADK_PACKAGE_APR_THREADING},y)
+ echo 'Depends: libpthread' >> ${IDIR_APR}/CONTROL/control
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/apr/ipkg/apr.control b/package/apr/ipkg/apr.control
new file mode 100644
index 000000000..8ea0e5e73
--- /dev/null
+++ b/package/apr/ipkg/apr.control
@@ -0,0 +1,4 @@
+Package: apr
+Priority: optional
+Section: lib
+Description: Apache Portable Runtime
diff --git a/package/arpd/Config.in b/package/arpd/Config.in
new file mode 100644
index 000000000..3f1068ca3
--- /dev/null
+++ b/package/arpd/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_ARPD
+ prompt "arpd.............................. A daemon to fake ARP replies"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBDNET
+ select ADK_PACKAGE_LIBEVENT
+ help
+ Generates ARP responses for (locally unused) IP addresses
+
+ http://www.honeyd.org/tools.php
diff --git a/package/arpd/Makefile b/package/arpd/Makefile
new file mode 100644
index 000000000..7ac0c03f7
--- /dev/null
+++ b/package/arpd/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= arpd
+PKG_VERSION:= 0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e2911fa9de1b92ef50deda1489ae944d
+MASTER_SITES:= http://niels.xtdnet.nl/honeyd/
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ARPD,arpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-libdnet=${STAGING_DIR}/usr \
+ --with-libevent=${STAGING_DIR}/usr \
+ --with-libpcap=${STAGING_DIR}/usr
+BUILD_STYLE= auto
+MAKE_FLAGS+= CCOPT="${TARGET_CFLAGS}" \
+ INCLS="-I. -I${STAGING_DIR}/usr/include" \
+ LIBS="-L${STAGING_DIR}/usr/lib -lpcap -ldnet -levent"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ARPD}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/arpd ${IDIR_ARPD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/arpd/ipkg/arpd.control b/package/arpd/ipkg/arpd.control
new file mode 100644
index 000000000..249263e12
--- /dev/null
+++ b/package/arpd/ipkg/arpd.control
@@ -0,0 +1,5 @@
+Package: arpd
+Priority: optional
+Section: net
+Depends: libpcap, libdnet, libevent
+Description: Generates ARP responses for IP address ranges
diff --git a/package/arpd/patches/patch-Makefile_in b/package/arpd/patches/patch-Makefile_in
new file mode 100644
index 000000000..e8ea3031a
--- /dev/null
+++ b/package/arpd/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- arpd.orig/Makefile.in 2003-02-09 19:31:27.000000000 +0100
++++ arpd/Makefile.in 2007-01-22 21:28:27.000000000 +0100
+@@ -154,7 +154,7 @@ $(srcdir)/config.h.in: $(srcdir)/stamp-h
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
+ $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+- cd $(top_srcdir) && $(AUTOHEADER)
++ #cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+ mostlyclean-hdr:
diff --git a/package/arpd/patches/patch-arpd_c b/package/arpd/patches/patch-arpd_c
new file mode 100644
index 000000000..5ac57ebeb
--- /dev/null
+++ b/package/arpd/patches/patch-arpd_c
@@ -0,0 +1,116 @@
+$Id$
+--- arpd.orig/arpd.c 2003-02-09 05:20:40.000000000 +0100
++++ arpd/arpd.c 2007-01-21 00:39:05.000000000 +0100
+@@ -70,7 +70,7 @@ static int arpd_sig;
+ static void
+ usage(void)
+ {
+- fprintf(stderr, "Usage: arpd [-d] [-i interface] [net]\n");
++ fprintf(stderr, "Usage: arpd [-d] [-i interface] [-a 'pcap_expr'] [{host|net|range} ...]\n");
+ exit(1);
+ }
+
+@@ -182,7 +182,7 @@ arpd_expandips(int naddresses, char **ad
+ }
+
+ static void
+-arpd_init(char *dev, int naddresses, char **addresses)
++arpd_init(char *dev, char *and_pcap_exp, int naddresses, char **addresses)
+ {
+ struct bpf_program fcode;
+ char filter[1024], ebuf[PCAP_ERRBUF_SIZE], *dst;
+@@ -214,9 +214,13 @@ arpd_init(char *dev, int naddresses, cha
+ errx(1, "bad interface configuration: not IP or Ethernet");
+ arpd_ifent.intf_addr.addr_bits = IP_ADDR_BITS;
+
+- snprintf(filter, sizeof(filter), "arp %s%s%s and not ether src %s",
++ snprintf(filter, sizeof(filter), "arp %s%s%s and not ether src %s%s%s%s",
+ dst ? "and (" : "", dst ? dst : "", dst ? ")" : "",
+- addr_ntoa(&arpd_ifent.intf_link_addr));
++ addr_ntoa(&arpd_ifent.intf_link_addr),
++ and_pcap_exp ? " and (" : "",
++ and_pcap_exp ? and_pcap_exp : "",
++ and_pcap_exp ? ")" : ""
++ );
+
+ if ((arpd_pcap = pcap_open_live(dev, 128, 0, 500, ebuf)) == NULL)
+ errx(1, "pcap_open_live: %s", ebuf);
+@@ -265,7 +269,7 @@ arpd_send(eth_t *eth, int op,
+ spa->addr_ip, tha->addr_eth, tpa->addr_ip);
+
+ if (op == ARP_OP_REQUEST) {
+- syslog(LOG_DEBUG, __FUNCTION__ ": who-has %s tell %s",
++ syslog(LOG_DEBUG, "%s: who-has %s tell %s", __FUNCTION__,
+ addr_ntoa(tpa), addr_ntoa(spa));
+ } else if (op == ARP_OP_REPLY) {
+ syslog(LOG_INFO, "arp reply %s is-at %s",
+@@ -282,7 +286,7 @@ arpd_lookup(struct addr *addr)
+ int error;
+
+ if (addr_cmp(addr, &arpd_ifent.intf_addr) == 0) {
+- syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
++ syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__,
+ addr_ntoa(addr), addr_ntoa(&arpd_ifent.intf_link_addr));
+ return (0);
+ }
+@@ -291,10 +295,10 @@ arpd_lookup(struct addr *addr)
+ error = arp_get(arpd_arp, &arpent);
+
+ if (error == -1) {
+- syslog(LOG_DEBUG, __FUNCTION__ ": no entry for %s",
++ syslog(LOG_DEBUG, "%s: no entry for %s", __FUNCTION__,
+ addr_ntoa(addr));
+ } else {
+- syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
++ syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__,
+ addr_ntoa(addr), addr_ntoa(&arpent.arp_ha));
+ }
+ return (error);
+@@ -423,7 +427,7 @@ arpd_recv_cb(u_char *u, const struct pca
+ if ((req = SPLAY_FIND(tree, &arpd_reqs, &tmp)) != NULL) {
+ addr_pack(&src.arp_ha, ADDR_TYPE_ETH, ETH_ADDR_BITS,
+ ethip->ar_sha, ETH_ADDR_LEN);
+- syslog(LOG_DEBUG, __FUNCTION__ ": %s at %s",
++ syslog(LOG_DEBUG, "%s: %s at %s", __FUNCTION__,
+ addr_ntoa(&req->pa), addr_ntoa(&src.arp_ha));
+
+ /* This address is claimed */
+@@ -465,14 +469,14 @@ main(int argc, char *argv[])
+ {
+ struct event recv_ev;
+ extern int (*event_sigcb)(void);
+- char *dev;
++ char *dev, *and_pcap_exp;
+ int c, debug;
+ FILE *fp;
+
+ dev = NULL;
+ debug = 0;
+
+- while ((c = getopt(argc, argv, "di:h?")) != -1) {
++ while ((c = getopt(argc, argv, "a:di:h?")) != -1) {
+ switch (c) {
+ case 'd':
+ debug = 1;
+@@ -480,6 +484,9 @@ main(int argc, char *argv[])
+ case 'i':
+ dev = optarg;
+ break;
++ case 'a':
++ and_pcap_exp = optarg;
++ break;
+ default:
+ usage();
+ break;
+@@ -489,9 +496,9 @@ main(int argc, char *argv[])
+ argv += optind;
+
+ if (argc == 0)
+- arpd_init(dev, 0, NULL);
++ arpd_init(dev, and_pcap_exp, 0, NULL);
+ else
+- arpd_init(dev, argc, argv);
++ arpd_init(dev, and_pcap_exp, argc, argv);
+
+ if ((fp = fopen(PIDFILE, "w")) == NULL)
+ err(1, "fopen");
diff --git a/package/arpd/patches/patch-configure b/package/arpd/patches/patch-configure
new file mode 100644
index 000000000..8e2dd6e82
--- /dev/null
+++ b/package/arpd/patches/patch-configure
@@ -0,0 +1,28 @@
+$Id$
+--- arpd.orig/configure 2003-02-09 19:31:28.000000000 +0100
++++ arpd/configure 2007-01-21 00:51:54.000000000 +0100
+@@ -2205,12 +2205,12 @@ echo "${ECHO_T}no" >&6
+ *)
+ echo "$as_me:2206: result: $withval" >&5
+ echo "${ECHO_T}$withval" >&6
+- if test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
++ if test -f $withval/include/event.h; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ EVENTINC="-I$withval/include"
+ EVENTLIB="-L$withval/lib -levent"
+- elif test -f $withval/event.h -a -f $withval/libevent.a; then
++ elif test -f $withval/event.h; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ EVENTINC="-I$withval"
+@@ -2258,8 +2258,7 @@ echo "${ECHO_T}$withval" >&6
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ PCAPINC="-I$withval -I$withval/bpf"
+ PCAPLIB="-L$withval -lpcap"
+- elif test -f $withval/include/pcap.h -a \
+- -f $withval/include/net/bpf.h; then
++ elif test -f $withval/include/pcap.h; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ PCAPINC="-I$withval/include"
diff --git a/package/arpwatch/Config.in b/package/arpwatch/Config.in
new file mode 100644
index 000000000..96cd0b3e4
--- /dev/null
+++ b/package/arpwatch/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_ARPWATCH
+ prompt "arpwatch.......................... Ethernet station activity monitor"
+ tristate
+ default n
+ help
+ Ethernet monitor program for keeping track of ethernet/ip address pairings
+
diff --git a/package/arpwatch/Makefile b/package/arpwatch/Makefile
new file mode 100644
index 000000000..a32974cbc
--- /dev/null
+++ b/package/arpwatch/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= arpwatch
+PKG_VERSION:= 2.1a15
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cebfeb99c4a7c2a6cee2564770415fe7
+MASTER_SITES:= ftp://ftp.ee.lbl.gov/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,ARPWATCH,arpwatch,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+MAKE_FLAGS+= ARPDIR=/etc/arpwatch \
+ CCOPT="$(TARGET_CFLAGS)" \
+ INCLS="-I. -I$(STAGING_DIR)/usr/include" \
+ LIBS="-L$(STAGING_DIR)/usr/lib -lpcap"
+
+do-install:
+ $(INSTALL_DIR) $(IDIR_ARPWATCH)/usr/sbin
+ $(INSTALL_DIR) $(IDIR_ARPWATCH)/etc/arpwatch
+ $(INSTALL_BIN) $(WRKBUILD)/arpwatch $(IDIR_ARPWATCH)/usr/sbin/
+ $(INSTALL_BIN) $(WRKBUILD)/arpsnmp $(IDIR_ARPWATCH)/usr/sbin/
+ $(INSTALL_DATA) $(WRKBUILD)/arp.dat $(IDIR_ARPWATCH)/etc/arpwatch/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/arpwatch/ipkg/arpwatch.conffiles b/package/arpwatch/ipkg/arpwatch.conffiles
new file mode 100644
index 000000000..9b9d8b3f6
--- /dev/null
+++ b/package/arpwatch/ipkg/arpwatch.conffiles
@@ -0,0 +1 @@
+/etc/arpwatch/arp.dat
diff --git a/package/arpwatch/ipkg/arpwatch.control b/package/arpwatch/ipkg/arpwatch.control
new file mode 100644
index 000000000..a72088153
--- /dev/null
+++ b/package/arpwatch/ipkg/arpwatch.control
@@ -0,0 +1,5 @@
+Package: arpwatch
+Priority: optional
+Section: net
+Description: Ethernet monitor program for keeping track of ethernet/ip address pairings
+Depends: libpcap
diff --git a/package/asterisk/Config.in b/package/asterisk/Config.in
new file mode 100644
index 000000000..70c88064f
--- /dev/null
+++ b/package/asterisk/Config.in
@@ -0,0 +1,96 @@
+config ADK_PACKAGE_ASTERISK
+ bool "asterisk................... Telephony server"
+ select ADK_PACKAGE_LIBCURL
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBPTHREAD
+ default n
+
+menu "asterisk-modules.................. Additional modules for Asterisk"
+depends on ADK_PACKAGE_ASTERISK
+
+config ADK_PACKAGE_ASTERISK_CHAN_MGCP
+ prompt "asterisk-chan-mgcp.............. Media Gateway Control Protocol implementation"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ Media Gateway Control Protocol implementation for Asterisk
+
+config ADK_PACKAGE_ASTERISK_CHAN_SKINNY
+ prompt "asterisk-chan-skinny............ Skinny Client Control Protocol implementation"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ Skinny Client Control Protocol implementation for Asterisk
+
+config ADK_PACKAGE_ASTERISK_CHAN_IAX2
+ prompt "asterisk-chan-iax2.............. Support for the Inter Asterisk Protocol"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ IAX2 allows trunking communication channels together.
+
+ Contains:
+ * chan_iax2.so
+
+config ADK_PACKAGE_ASTERISK_CODEC_SPEEX
+ prompt "asterisk-codec-speex............ Speex/PCM16 Codec Translator"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ select ADK_PACKAGE_LIBSPEEX
+ help
+ The Speex speech compression codec for Asterisk
+
+config ADK_PACKAGE_ASTERISK_CODEC_GSM
+ prompt "asterisk-codec-gsm.............. GSM Codec"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ The GSM codec for Asterisk
+
+config ADK_PACKAGE_ASTERISK_PBX_DUNDI
+ prompt "asterisk-pbx-dundi.............. Distributed Universal Number Discovery (DUNDi) support"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ Distributed Universal Number Discovery (DUNDi) support for Asterisk
+
+config ADK_PACKAGE_ASTERISK_RES_AGI
+ prompt "asterisk-res-agi................ Asterisk Gateway Interface module"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ Asterisk Gateway Interface module
+
+config ADK_PACKAGE_ASTERISK_PGSQL
+ prompt "asterisk-pgsql.................. PostgreSQL modules"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ select ADK_PACKAGE_LIBPQ
+ help
+ PostgreSQL modules for Asterisk
+
+config ADK_PACKAGE_ASTERISK_SOUNDS
+ prompt "asterisk-sounds................. Sound files"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ Sound files for Asterisk
+
+config ADK_PACKAGE_ASTERISK_VOICEMAIL
+ prompt "asterisk-voicemail.............. Voicemail support"
+ tristate
+ default n
+ depends ADK_PACKAGE_ASTERISK
+ help
+ Voicemail related modules for Asterisk
+
+endmenu
diff --git a/package/asterisk/Makefile b/package/asterisk/Makefile
new file mode 100644
index 000000000..87e187380
--- /dev/null
+++ b/package/asterisk/Makefile
@@ -0,0 +1,237 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= asterisk
+PKG_VERSION:= 1.4.24.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2b74744350f420b3a94d5323c489426f
+MASTER_SITES:= http://downloads.digium.com/pub/telephony/asterisk/releases/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,ASTERISK,asterisk,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_PGSQL,asterisk-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_VOICEMAIL,asterisk-voicemail,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_SOUNDS,asterisk-sounds,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_CHAN_MGCP,asterisk-chan-mgcp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_CHAN_SKINNY,asterisk-chan-skinny,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_CHAN_IAX2,asterisk-chan-iax2,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_CODEC_SPEEX,asterisk-codec-speex,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_CODEC_GSM,asterisk-codec-gsm,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_PBX_DUNDI,asterisk-pbx-dundi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ASTERISK_RES_AGI,asterisk-res-agi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+SUB_INSTALLS-y:=
+SUB_INSTALLS-m:=
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_PGSQL}+= asterisk-pgsql-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_VOICEMAIL}+= asterisk-voicemail-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_SOUNDS}+= asterisk-sounds-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CHAN_MGCP}+= asterisk-chan-mgcp-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CHAN_SKINNY}+= asterisk-chan-skinny-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CHAN_IAX2}+= asterisk-chan-iax2-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CODEC_SPEEX}+= asterisk-codec-speex-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_CODEC_GSM}+= asterisk-codec-gsm-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_PBX_DUNDI}+= asterisk-pbx-dundi-install
+SUB_INSTALLS-${ADK_PACKAGE_ASTERISK_RES_AGI}+= asterisk-res-agi-install
+
+CONFIGURE_ARGS= --with-z=${STAGING_DIR}/usr \
+ --with-ncurses=${STAGING_DIR}/usr \
+ --with-ssl=${STAGING_DIR}/usr \
+ --without-zaptel \
+ --without-tonezone \
+ --without-asound \
+ --without-curses \
+ --without-gnutls \
+ --without-h323 \
+ --without-iksemel \
+ --without-imap \
+ --without-kde \
+ --without-nbs \
+ --without-netsnmp \
+ --without-newt \
+ --without-odbc \
+ --without-osptk \
+ --without-oss \
+ --without-pri \
+ --without-pwlib \
+ --without-qt \
+ --without-tds \
+ --without-termcap \
+ --without-tinfo \
+ --without-vpb
+ifneq (${ADK_PACKAGE_ASTERISK_CODEC_GSM},)
+CONFIGURE_ARGS+= --with-gsm=internal
+else
+CONFIGURE_ARGS+= --without-gsm
+endif
+ifneq (${ADK_PACKAGE_ASTERISK_CODEC_SPEEX},)
+CONFIGURE_ARGS+= --with-speex=${STAGING_DIR}/usr
+EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/speex
+endif
+ifneq (${ADK_PACKAGE_ASTERISK_FORMAT_VORBIS},)
+CONFIGURE_ARGS+= --with-ogg=${STAGING_DIR}/usr \
+ --with-vorbis=${STAGING_DIR}/usr
+TLDFLAGS+= -logg
+endif
+ifneq (${ADK_PACKAGE_ASTERISK_RADIUS},)
+CONFIGURE_ARGS+= --with-radius=${STAGING_DIR}/usr
+endif
+ifneq (${ADK_PACKAGE_ASTERISK_GNUTLS},)
+CONFIGURE_ARGS+= --with-gnutls=${STAGING_DIR}/usr
+endif
+ifneq (${ADK_PACKAGE_ASTERISK_CURL},)
+CONFIGURE_ARGS+= --with-curl=${STAGING_DIR}/usr
+else
+CONFIGURE_ARGS+= --without-curl
+endif
+ifneq (${ADK_PACKAGE_ASTERISK_PGSQL},)
+CONFIGURE_ARGS+= --with-postgres=${STAGING_DIR}/usr
+else
+CONFIGURE_ARGS+= --without-postgres
+endif
+ifneq (${ADK_PACKAGE_LIBPOPT},)
+CONFIGURE_ARGS+= --with-popt=${STAGING_DIR}/usr
+else
+CONFIGURE_ARGS+= --without-popt
+endif
+CONFIGURE_ARGS+= --without-misdn \
+ --without-isdnnet \
+ --without-suppserv
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= STRIP=${STRIP}
+BUILD_STYLE:= auto
+MAKE_ENV= ASTCFLAGS="${TCPPFLAGS} ${TCFLAGS}" \
+ ASTLDFLAGS="${TLDFLAGS}"
+MAKE_FLAGS+= DESTDIR="$(WRKINST)" \
+ OPTIMIZE="${TARGET_OPTIMIZATION}" \
+ CXX="${TARGET_CC}" \
+ STRIP="${TARGET_CROSS}strip" \
+ NOISY_BUILD=1
+ALL_TARGET:= all install samples
+
+pre-configure:
+ rm ${WRKBUILD}/apps/app_followme.c
+ cd "$(WRKBUILD)/menuselect"; ./configure
+
+post-build:
+ cd ${WRKBUILD}/sounds ; \
+ tar xzf asterisk-core-sounds-en-gsm-1.4.14.tar.gz ; \
+ rm asterisk-core-sounds-en-gsm-1.4.9.tar.gz ; \
+ tar xzf asterisk-moh-freeplay-wav.tar.gz ; \
+ rm asterisk-moh-freeplay-wav.tar.gz
+ @echo
+ @echo "---------------> have to install ${SUB_INSTALLS-m} ${SUB_INSTALLS-y} <-------------------------"
+ @echo
+
+do-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
+ $(CP) $(WRKINST)/* $(IDIR_ASTERISK)
+ rm -rf $(IDIR_ASTERISK)/usr/sbin/astgenkey
+ rm -rf $(IDIR_ASTERISK)/usr/bin
+ rm -rf $(IDIR_ASTERISK)/usr/share
+ rm -rf $(IDIR_ASTERISK)/usr/include
+ rm -rf $(IDIR_ASTERISK)/var
+ (cd $(IDIR_ASTERISK)/usr/lib/asterisk; \
+ rm -rf agi-bin; \
+ rm -rf images; \
+ rm -rf keys/*; \
+ rm -rf mohmp3/*.mp3; \
+ rm -rf sounds/*; \
+ cd modules; \
+ rm -rf *adsi* *festival* *modem* *meetme* *oss* *phone* *intercom* \
+ *mp3* *nbscat* *mysql* *postgres* *pgsql* *voicemail* *speex* \
+ *zapateller* *jpeg*; \
+ rm -f chan_bluetooth.so ; \
+ rm -f chan_h323.so ; \
+ rm -f chan_mgcp.so ; \
+ rm -f chan_skinny.so ; \
+ rm -f {codec,format}_ilbc.so ; \
+ rm -f codec_gsm.so ; \
+ rm -f codec_lpc10.so ; \
+ rm -f pbx_dundi.so ; \
+ rm -f res_agi.so ; \
+ )
+ (cd $(IDIR_ASTERISK)/etc/asterisk; \
+ rm -f *odbc* *mysql* *postgres* *pgsql* *voicemail* *adsi* *oss* *alsa* \
+ *festival* *modem* *meetme* *phone* *tds* *vofr* *rpt* *vpb* \
+ *zapata*; \
+ rm -f bluetooth.conf ; \
+ rm -f mgcp.conf ; \
+ rm -f skinny.conf ; \
+ rm -f dundi.conf ; \
+ )
+ ${INSTALL_DATA} ./files/modules.conf $(IDIR_ASTERISK)/etc/asterisk/
+ $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(WRKINST)/etc/asterisk/musiconhold.conf
+ ${INSTALL_DIR} $(IDIR_ASTERISK)/etc/init.d
+ ${INSTALL_BIN} ./files/asterisk.init $(IDIR_ASTERISK)/etc/init.d/asterisk
+
+asterisk-pgsql-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_PGSQL)/etc/asterisk
+ ${INSTALL_DATA} $(WRKBUILD)/configs/cdr_pgsql.conf.sample $(IDIR_ASTERISK_PGSQL)/etc/asterisk/cdr_pgsql.conf
+ ${INSTALL_DIR} $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules
+ ${INSTALL_BIN} $(WRKBUILD)/cdr/cdr_pgsql.so $(IDIR_ASTERISK_PGSQL)/usr/lib/asterisk/modules/
+
+asterisk-sounds-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds
+ $(CP) $(WRKBUILD)/sounds/* $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/
+ rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/*.mp3
+ rm -f $(IDIR_ASTERISK_SOUNDS)/usr/lib/asterisk/sounds/vm-*
+
+asterisk-voicemail-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk
+ ${INSTALL_DIR} $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules
+ ${INSTALL_DATA} $(WRKBUILD)/configs/voicemail.conf.sample $(IDIR_ASTERISK_VOICEMAIL)/etc/asterisk/voicemail.conf
+ ${CP} $(WRKBUILD)/apps/*voicemail.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
+ ${INSTALL_BIN} $(WRKBUILD)/res/res_adsi.so $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/modules/
+ install -d -m0755 $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/sounds
+ $(CP) $(WRKBUILD)/sounds/vm-*.gsm $(IDIR_ASTERISK_VOICEMAIL)/usr/lib/asterisk/sounds/
+
+asterisk-chan-mgcp-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_MGCP)/etc/asterisk
+ ${INSTALL_DATA} $(WRKBUILD)/configs/mgcp.conf.sample $(IDIR_ASTERISK_CHAN_MGCP)/etc/asterisk/mgcp.conf
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_MGCP)/usr/lib/asterisk/modules
+ ${INSTALL_BIN} $(WRKBUILD)/channels/chan_mgcp.so $(IDIR_ASTERISK_CHAN_MGCP)/usr/lib/asterisk/modules/
+
+asterisk-chan-skinny-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_SKINNY)/etc/asterisk
+ ${INSTALL_DATA} $(WRKBUILD)/configs/skinny.conf.sample $(IDIR_ASTERISK_CHAN_SKINNY)/etc/asterisk/skinny.conf
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_SKINNY)/usr/lib/asterisk/modules
+ ${INSTALL_BIN} $(WRKBUILD)/channels/chan_skinny.so $(IDIR_ASTERISK_CHAN_SKINNY)/usr/lib/asterisk/modules/
+
+asterisk-chan-iax2-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_IAX2)/etc/asterisk
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CHAN_IAX2)/usr/lib/asterisk/modules
+ ${INSTALL_DATA} $(WRKBUILD)/configs/iax.conf.sample $(IDIR_ASTERISK_CHAN_IAX2)/etc/asterisk/iax.conf
+ ${INSTALL_DATA} $(WRKBUILD)/configs/iaxprov.conf.sample $(IDIR_ASTERISK_CHAN_IAX2)/etc/asterisk/iaxprov.conf
+ ${INSTALL_BIN} $(WRKBUILD)/channels/chan_iax2.so $(IDIR_ASTERISK_CHAN_IAX2)/usr/lib/asterisk/modules/
+
+asterisk-codec-speex-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules
+ install -m0755 $(WRKBUILD)/codecs/codec_speex.so $(IDIR_ASTERISK_CODEC_SPEEX)/usr/lib/asterisk/modules/
+
+asterisk-codec-gsm-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_CODEC_GSM)/usr/lib/asterisk/modules/
+ ${INSTALL_BIN} $(WRKBUILD)/codecs/codec_gsm.so $(IDIR_ASTERISK_CODEC_GSM)/usr/lib/asterisk/modules/
+
+asterisk-pbx-dundi-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk
+ ${INSTALL_DATA} $(WRKBUILD)/configs/dundi.conf.sample $(IDIR_ASTERISK_PBX_DUNDI)/etc/asterisk/dundi.conf
+ ${INSTALL_DIR} $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules
+ ${INSTALL_BIN} $(WRKBUILD)/pbx/pbx_dundi.so $(IDIR_ASTERISK_PBX_DUNDI)/usr/lib/asterisk/modules/
+
+asterisk-res-agi-install:
+ ${INSTALL_DIR} $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/agi-bin
+ ${INSTALL_DIR} $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/modules
+ ${INSTALL_BIN} $(WRKBUILD)/res/res_agi.so $(IDIR_ASTERISK_RES_AGI)/usr/lib/asterisk/modules/
+
+asterisk-meetme-install:
+ ${INSTALL_DIR} ${IDIR_ASTERISK_MEETME}/etc/asterisk/
+ ${INSTALL_DIR} ${IDIR_ASTERISK_MEETME}/usr/lib/asterisk/modules
+ ${INSTALL_DATA} ${WRKBUILD}/configs/meetme.conf.sample ${IDIR_ASTERISK_MEETME}/etc/asterisk/meetme.conf
+ ${INSTALL_BIN} ${WRKBUILD}/apps/app_meetme.so ${IDIR_ASTERISK_MEETME}/usr/lib/asterisk/modules
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/asterisk/files/asterisk.init b/package/asterisk/files/asterisk.init
new file mode 100644
index 000000000..fcbb52612
--- /dev/null
+++ b/package/asterisk/files/asterisk.init
@@ -0,0 +1,29 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${asterisk:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/run ] || mkdir -p /var/run
+ [ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
+ [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
+ /usr/sbin/asterisk
+ ;;
+stop)
+ [ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) >/dev/null 2>&1
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/asterisk/files/modules.conf b/package/asterisk/files/modules.conf
new file mode 100644
index 000000000..1d6f35400
--- /dev/null
+++ b/package/asterisk/files/modules.conf
@@ -0,0 +1,138 @@
+;
+; Asterisk configuration file
+;
+; Module Loader configuration file
+;
+
+[modules]
+autoload=yes
+;
+; Any modules that need to be loaded before the Asterisk core has been
+; initialized (just after the logger has been initialized) can be loaded
+; using 'preload'. This will frequently be needed if you wish to map all
+; module configuration files into Realtime storage, since the Realtime
+; driver will need to be loaded before the modules using those configuration
+; files are initialized.
+;
+; An example of loading ODBC support would be:
+;preload => res_odbc.so
+;preload => res_config_odbc.so
+;
+noload => res_config_mysql.so ;
+;
+; load => res_features.so ; Call Parking Resource
+noload => res_indications.so ; Indications Configuration
+noload => res_monitor.so ; Call Monitoring Resource
+; load => res_musiconhold.so ; Music On Hold Resource
+noload => cdr_csv.so ; Comma Separated Values CDR Backend
+noload => cdr_custom.so ; Customizable Comma Separated Values CDR Backend
+noload => cdr_manager.so ; Asterisk Call Manager CDR Backend
+noload => cdr_mysql.so ; MySQL CDR Backend
+noload => cdr_pgsql.so ; PostgreSQL CDR Backend
+noload => cdr_sqlite.so ; SQLite CDR Backend
+noload => chan_agent.so ; Agent Proxy Channel
+; load => chan_iax2.so ; Inter Asterisk eXchange (Ver 2)
+; load => chan_local.so ; Local Proxy Channel
+; load => chan_sip.so ; Session Initiation Protocol (SIP)
+noload => codec_a_mu.so ; A-law and Mulaw direct Coder/Decoder
+noload => codec_adpcm.so ; Adaptive Differential PCM Coder/Decoder
+noload => codec_alaw.so ; A-law Coder/Decoder
+noload => codec_g726.so ; ITU G.726-32kbps G726 Transcoder
+; load => codec_gsm.so ; GSM/PCM16 (signed linear) Codec Translation
+; load => codec_ulaw.so ; Mu-law Coder/Decoder
+noload => codec_speex.so ; Speex/PCM16 (signed linear) Codec Translator
+noload => format_au.so ; Sun Microsystems AU format (signed linear)
+noload => format_g723.so ; G.723.1 Simple Timestamp File Format
+noload => format_g726.so ; Raw G.726 (16/24/32/40kbps) data
+noload => format_g729.so ; Raw G729 data
+; load => format_gsm.so ; Raw GSM data
+noload => format_h263.so ; Raw h263 data
+noload => format_jpeg.so ; JPEG (Joint Picture Experts Group) Image
+; load => format_pcm.so ; Raw uLaw 8khz Audio support (PCM)
+noload => format_pcm_alaw.so ; Raw aLaw 8khz PCM Audio support
+noload => format_sln.so ; Raw Signed Linear Audio support (SLN)
+noload => format_vox.so ; Dialogic VOX (ADPCM) File Format
+; load => format_wav.so ; Microsoft WAV format (8000hz Signed Line
+; load => format_wav_gsm.so ; Microsoft WAV format (Proprietary GSM)
+noload => app_alarmreceiver.so ; Alarm Receiver Application
+noload => app_authenticate.so ; Authentication Application
+noload => app_cdr.so ; Make sure asterisk doesn't save CDR
+noload => app_chanisavail.so ; Check if channel is available
+noload => app_chanspy.so ; Listen in on any channel
+noload => app_controlplayback.so ; Control Playback Application
+noload => app_cut.so ; Cuts up variables
+noload => app_db.so ; Database access functions
+; load => app_dial.so ; Dialing Application
+noload => app_dictate.so ; Virtual Dictation Machine Application
+noload => app_directory.so ; Extension Directory
+noload => app_directed_pickup.so ; Directed Call Pickup Support
+noload => app_disa.so ; DISA (Direct Inward System Access) Application
+noload => app_dumpchan.so ; Dump channel variables Application
+; load => app_echo.so ; Simple Echo Application
+noload => app_enumlookup.so ; ENUM Lookup
+noload => app_eval.so ; Reevaluates strings
+noload => app_exec.so ; Executes applications
+noload => app_externalivr.so ; External IVR application interface
+noload => app_forkcdr.so ; Fork The CDR into 2 seperate entities
+noload => app_getcpeid.so ; Get ADSI CPE ID
+noload => app_groupcount.so ; Group Management Routines
+noload => app_ices.so ; Encode and Stream via icecast and ices
+noload => app_image.so ; Image Transmission Application
+noload => app_lookupblacklist.so ; Look up Caller*ID name/number from black
+noload => app_lookupcidname.so ; Look up CallerID Name from local databas
+; load => app_macro.so ; Extension Macros
+noload => app_math.so ; A simple math Application
+noload => app_md5.so ; MD5 checksum Application
+; load => app_milliwatt.so ; Digital Milliwatt (mu-law) Test Application
+noload => app_mixmonitor.so ; Record a call and mix the audio during the recording
+noload => app_parkandannounce.so ; Call Parking and Announce Application
+; load => app_playback.so ; Trivial Playback Application
+noload => app_privacy.so ; Require phone number to be entered, if n
+noload => app_queue.so ; True Call Queueing
+noload => app_random.so ; Random goto
+noload => app_read.so ; Read Variable Application
+noload => app_readfile.so ; Read in a file
+noload => app_realtime.so ; Realtime Data Lookup/Rewrite
+noload => app_record.so ; Trivial Record Application
+; load => app_sayunixtime.so ; Say time
+noload => app_senddtmf.so ; Send DTMF digits Application
+noload => app_sendtext.so ; Send Text Applications
+noload => app_setcallerid.so ; Set CallerID Application
+noload => app_setcdruserfield.so ; CDR user field apps
+noload => app_setcidname.so ; Set CallerID Name
+noload => app_setcidnum.so ; Set CallerID Number
+noload => app_setrndis.so ; Set RDNIS Number
+noload => app_settransfercapability.so ; Set ISDN Transfer Capability
+noload => app_sms.so ; SMS/PSTN handler
+noload => app_softhangup.so ; Hangs up the requested channel
+noload => app_sql_mysql.so ; Simple MySQL Interface
+noload => app_sql_postgres.so ; Simple PostgreSQL Interface
+noload => app_stack.so ; Stack Routines
+noload => app_system.so ; Generic System() application
+noload => app_talkdetect.so ; Playback with Talk Detection
+noload => app_test.so ; Interface Test Application
+noload => app_transfer.so ; Transfer
+noload => app_txtcidname.so ; TXTCIDName
+noload => app_url.so ; Send URL Applications
+noload => app_userevent.so ; Custom User Event Application
+; load => app_verbose.so ; Send verbose output
+noload => app_waitforring.so ; Waits until first ring after time
+noload => app_waitforsilence.so ; Wait For Silence Application
+noload => app_while.so ; While Loops and Conditional Execution
+noload => pbx_ael.so ; Asterisk Extension Language Compiler
+; load => pbx_config.so ; Text Extension Configuration
+noload => pbx_functions.so ; Builtin dialplan functions
+noload => pbx_loopback.so ; Loopback Switch
+noload => pbx_realtime.so ; Realtime Switch
+noload => pbx_spool.so ; Outgoing Spool Support
+noload => pbx_wilcalu.so ; Wil Cal U (Auto Dialer)
+noload => func_callerid.so ; Caller ID related dialplan functions
+noload => func_enum.so ; ENUM Functions
+noload => func_uri.so ; URI encoding / decoding functions
+
+;
+; Module names listed in "global" section will have symbols globally
+; exported to modules loaded after them.
+;
+[global]
+chan_modem.so=no
diff --git a/package/asterisk/ipkg/asterisk-chan-bluetooth.conffiles b/package/asterisk/ipkg/asterisk-chan-bluetooth.conffiles
new file mode 100644
index 000000000..40a085235
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-bluetooth.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/bluetooth.conf
diff --git a/package/asterisk/ipkg/asterisk-chan-bluetooth.control b/package/asterisk/ipkg/asterisk-chan-bluetooth.control
new file mode 100644
index 000000000..c79d038bb
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-bluetooth.control
@@ -0,0 +1,5 @@
+Package: asterisk-chan-bluetooth
+Priority: optional
+Section: net
+Description: Bluetooth HandsFreeProfile support for Asterisk
+Depends: asterisk, bluez-libs
diff --git a/package/asterisk/ipkg/asterisk-chan-h323.conffiles b/package/asterisk/ipkg/asterisk-chan-h323.conffiles
new file mode 100644
index 000000000..fc0858a61
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-h323.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/h323.conf
diff --git a/package/asterisk/ipkg/asterisk-chan-h323.control b/package/asterisk/ipkg/asterisk-chan-h323.control
new file mode 100644
index 000000000..f3a18ba99
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-h323.control
@@ -0,0 +1,5 @@
+Package: asterisk-chan-h323
+Priority: optional
+Section: net
+Description: H.323 support for Asterisk
+Depends: asterisk, libpthread, uclibc++
diff --git a/package/asterisk/ipkg/asterisk-chan-iax2.conffiles b/package/asterisk/ipkg/asterisk-chan-iax2.conffiles
new file mode 100644
index 000000000..f46a87327
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-iax2.conffiles
@@ -0,0 +1,2 @@
+/etc/asterisk/iax.conf
+/etc/asterisk/iaxprov.conf
diff --git a/package/asterisk/ipkg/asterisk-chan-iax2.control b/package/asterisk/ipkg/asterisk-chan-iax2.control
new file mode 100644
index 000000000..55f71f446
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-iax2.control
@@ -0,0 +1,5 @@
+Package: asterisk-chan-iax2
+Priority: optional
+Section: net
+Description: Asterisk Channel for the Inter Asterisk Protocol
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-chan-mgcp.conffiles b/package/asterisk/ipkg/asterisk-chan-mgcp.conffiles
new file mode 100644
index 000000000..40a81df8e
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-mgcp.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/mgcp.conf
diff --git a/package/asterisk/ipkg/asterisk-chan-mgcp.control b/package/asterisk/ipkg/asterisk-chan-mgcp.control
new file mode 100644
index 000000000..78ea3b649
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-mgcp.control
@@ -0,0 +1,5 @@
+Package: asterisk-chan-mgcp
+Priority: optional
+Section: net
+Description: a Media Gateway Control Protocol implementation for Asterisk
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-chan-misdn.control b/package/asterisk/ipkg/asterisk-chan-misdn.control
new file mode 100644
index 000000000..bcc7f384e
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-misdn.control
@@ -0,0 +1,5 @@
+Package: asterisk-chan-misdn
+Priority: optional
+Section: net
+Depends: asterisk
+Description: Asterisk Channel for the mISDN ISDN systems
diff --git a/package/asterisk/ipkg/asterisk-chan-skinny.conffiles b/package/asterisk/ipkg/asterisk-chan-skinny.conffiles
new file mode 100644
index 000000000..eaf9b6def
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-skinny.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/skinny.conf
diff --git a/package/asterisk/ipkg/asterisk-chan-skinny.control b/package/asterisk/ipkg/asterisk-chan-skinny.control
new file mode 100644
index 000000000..3933e33db
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-chan-skinny.control
@@ -0,0 +1,5 @@
+Package: asterisk-chan-skinny
+Priority: optional
+Section: net
+Description: a Skinny Client Control Protocol implementation for Asterisk
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-codec-gsm.control b/package/asterisk/ipkg/asterisk-codec-gsm.control
new file mode 100644
index 000000000..f26044d2b
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-codec-gsm.control
@@ -0,0 +1,5 @@
+Package: asterisk-codec-gsm
+Priority: optional
+Section: net
+Description: a GSM Codec Translator for Asterisk
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-codec-speex.control b/package/asterisk/ipkg/asterisk-codec-speex.control
new file mode 100644
index 000000000..61eb088f7
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-codec-speex.control
@@ -0,0 +1,5 @@
+Package: asterisk-codec-speex
+Priority: optional
+Section: net
+Description: a Speex/PCM16 Codec Translator for Asterisk
+Depends: asterisk, libspeex
diff --git a/package/asterisk/ipkg/asterisk-meetme.conffiles b/package/asterisk/ipkg/asterisk-meetme.conffiles
new file mode 100644
index 000000000..1caab1d4d
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-meetme.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/meetme.conf
diff --git a/package/asterisk/ipkg/asterisk-meetme.control b/package/asterisk/ipkg/asterisk-meetme.control
new file mode 100644
index 000000000..8b031d210
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-meetme.control
@@ -0,0 +1,5 @@
+Package: asterisk-meetme
+Priority: optional
+Section: net
+Description: MeetMe support files for asterisk
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-pbx-dundi.conffiles b/package/asterisk/ipkg/asterisk-pbx-dundi.conffiles
new file mode 100644
index 000000000..ab116b5d1
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-pbx-dundi.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/dundi.conf
diff --git a/package/asterisk/ipkg/asterisk-pbx-dundi.control b/package/asterisk/ipkg/asterisk-pbx-dundi.control
new file mode 100644
index 000000000..6579e2594
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-pbx-dundi.control
@@ -0,0 +1,5 @@
+Package: asterisk-pbx-dundi
+Priority: optional
+Section: net
+Description: Distributed Universal Number Discovery (DUNDi) support for Asterisk
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-pgsql.conffiles b/package/asterisk/ipkg/asterisk-pgsql.conffiles
new file mode 100644
index 000000000..8b5cffe40
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-pgsql.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/cdr_pgsql.conf
diff --git a/package/asterisk/ipkg/asterisk-pgsql.control b/package/asterisk/ipkg/asterisk-pgsql.control
new file mode 100644
index 000000000..beece08a5
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-pgsql.control
@@ -0,0 +1,5 @@
+Package: asterisk-pgsql
+Priority: optional
+Section: net
+Description: PostgreSQL modules for Asterisk
+Depends: asterisk, libpq, zlib
diff --git a/package/asterisk/ipkg/asterisk-res-agi.control b/package/asterisk/ipkg/asterisk-res-agi.control
new file mode 100644
index 000000000..44f7170aa
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-res-agi.control
@@ -0,0 +1,5 @@
+Package: asterisk-res-agi
+Priority: optional
+Section: net
+Description: Asterisk Gateway Interface module
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-sounds.control b/package/asterisk/ipkg/asterisk-sounds.control
new file mode 100644
index 000000000..a63bbef10
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-sounds.control
@@ -0,0 +1,5 @@
+Package: asterisk-sounds
+Priority: optional
+Section: net
+Description: a sounds collection for Asterisk
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk-sqlite.control b/package/asterisk/ipkg/asterisk-sqlite.control
new file mode 100644
index 000000000..3968dd19d
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-sqlite.control
@@ -0,0 +1,5 @@
+Package: asterisk-sqlite
+Priority: optional
+Section: net
+Description: SQLite modules for Asterisk
+Depends: asterisk, libsqlite
diff --git a/package/asterisk/ipkg/asterisk-voicemail.conffiles b/package/asterisk/ipkg/asterisk-voicemail.conffiles
new file mode 100644
index 000000000..1c80f057a
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-voicemail.conffiles
@@ -0,0 +1 @@
+/etc/asterisk/voicemail.conf
diff --git a/package/asterisk/ipkg/asterisk-voicemail.control b/package/asterisk/ipkg/asterisk-voicemail.control
new file mode 100644
index 000000000..c7b51311c
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk-voicemail.control
@@ -0,0 +1,5 @@
+Package: asterisk-voicemail
+Priority: optional
+Section: net
+Description: VoiceMail related modules for Asterisk
+Depends: asterisk
diff --git a/package/asterisk/ipkg/asterisk.conffiles b/package/asterisk/ipkg/asterisk.conffiles
new file mode 100644
index 000000000..5f805dedb
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk.conffiles
@@ -0,0 +1,21 @@
+/etc/asterisk/asterisk.conf
+/etc/asterisk/agents.conf
+/etc/asterisk/alarmreceiver.conf
+/etc/asterisk/cdr_manager.conf
+/etc/asterisk/codecs.conf
+/etc/asterisk/enum.conf
+/etc/asterisk/extconfig.conf
+/etc/asterisk/extensions.conf
+/etc/asterisk/features.conf
+/etc/asterisk/iax.conf
+/etc/asterisk/iaxprov.conf
+/etc/asterisk/indications.conf
+/etc/asterisk/logger.conf
+/etc/asterisk/manager.conf
+/etc/asterisk/modules.conf
+/etc/asterisk/musiconhold.conf
+/etc/asterisk/osp.conf
+/etc/asterisk/privacy.conf
+/etc/asterisk/queues.conf
+/etc/asterisk/rtp.conf
+/etc/asterisk/sip.conf
diff --git a/package/asterisk/ipkg/asterisk.control b/package/asterisk/ipkg/asterisk.control
new file mode 100644
index 000000000..13075d791
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk.control
@@ -0,0 +1,5 @@
+Package: asterisk
+Priority: optional
+Section: net
+Depends: libncurses, libpthread
+Description: An open source PBX
diff --git a/package/asterisk/ipkg/asterisk.postinst b/package/asterisk/ipkg/asterisk.postinst
new file mode 100644
index 000000000..1186b2645
--- /dev/null
+++ b/package/asterisk/ipkg/asterisk.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf asterisk asterisk NO
diff --git a/package/asterisk/patches/patch-apps__moduleinfo b/package/asterisk/patches/patch-apps__moduleinfo
new file mode 100644
index 000000000..efbdcae4a
--- /dev/null
+++ b/package/asterisk/patches/patch-apps__moduleinfo
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- asterisk-1.4.24.1.orig/apps/.moduleinfo 2009-04-02 19:44:22.000000000 +0200
++++ asterisk-1.4.24.1/apps/.moduleinfo 2009-05-12 16:07:52.000000000 +0200
+@@ -56,9 +56,6 @@
+ <member name="app_flash" displayname="Flash channel application" remove_on_change="apps/app_flash.o apps/app_flash.so">
+ <depend>dahdi</depend>
+ </member>
+-<member name="app_followme" displayname="Find-Me/Follow-Me Application" remove_on_change="apps/app_followme.o apps/app_followme.so">
+- <depend>chan_local</depend>
+-</member>
+ <member name="app_forkcdr" displayname="Fork The CDR into 2 separate entities" remove_on_change="apps/app_forkcdr.o apps/app_forkcdr.so">
+ </member>
+ <member name="app_getcpeid" displayname="Get ADSI CPE ID" remove_on_change="apps/app_getcpeid.o apps/app_getcpeid.so">
diff --git a/package/asterisk/patches/patch-menuselect-tree b/package/asterisk/patches/patch-menuselect-tree
new file mode 100644
index 000000000..98c18ec08
--- /dev/null
+++ b/package/asterisk/patches/patch-menuselect-tree
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- asterisk-1.4.24.1.orig/menuselect-tree 2009-04-02 19:44:31.000000000 +0200
++++ asterisk-1.4.24.1/menuselect-tree 2009-05-12 16:07:12.000000000 +0200
+@@ -59,9 +59,6 @@
+ <member name="app_flash" displayname="Flash channel application" remove_on_change="apps/app_flash.o apps/app_flash.so">
+ <depend>dahdi</depend>
+ </member>
+-<member name="app_followme" displayname="Find-Me/Follow-Me Application" remove_on_change="apps/app_followme.o apps/app_followme.so">
+- <depend>chan_local</depend>
+-</member>
+ <member name="app_forkcdr" displayname="Fork The CDR into 2 separate entities" remove_on_change="apps/app_forkcdr.o apps/app_forkcdr.so">
+ </member>
+ <member name="app_getcpeid" displayname="Get ADSI CPE ID" remove_on_change="apps/app_getcpeid.o apps/app_getcpeid.so">
diff --git a/package/asterisk/patches/patch-menuselect_example_menuselect-tree b/package/asterisk/patches/patch-menuselect_example_menuselect-tree
new file mode 100644
index 000000000..6c58cc33d
--- /dev/null
+++ b/package/asterisk/patches/patch-menuselect_example_menuselect-tree
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- asterisk-1.4.24.1.orig/menuselect/example_menuselect-tree 2006-08-19 22:55:53.000000000 +0200
++++ asterisk-1.4.24.1/menuselect/example_menuselect-tree 2009-05-12 16:07:32.000000000 +0200
+@@ -45,8 +45,6 @@
+ <member name="app_flash" displayname="Flash zap trunk application" remove_on_change="apps/app_flash.o apps/app_flash.so">
+ <depend>zaptel</depend>
+ </member>
+- <member name="app_followme" displayname="Find-Me/Follow-Me Application" remove_on_change="apps/app_followme.o apps/app_followme.so">
+- </member>
+ <member name="app_forkcdr" displayname="Fork The CDR into 2 separate entities." remove_on_change="apps/app_forkcdr.o apps/app_forkcdr.so">
+ </member>
+ <member name="app_getcpeid" displayname="Get ADSI CPE ID" remove_on_change="apps/app_getcpeid.o apps/app_getcpeid.so">
diff --git a/package/atftp/Config.in b/package/atftp/Config.in
new file mode 100644
index 000000000..11e1c02b2
--- /dev/null
+++ b/package/atftp/Config.in
@@ -0,0 +1,25 @@
+#menu "atftp............................. TFTP implementation"
+
+config ADK_COMPILE_ATFTP
+ tristate
+ default n
+ depends ADK_PACKAGE_ATFTP || ADK_PACKAGE_ATFTPD
+ select ADK_PACKAGE_LIBREADLINE
+
+config ADK_PACKAGE_ATFTP
+ prompt "atftp............................. TFTP client"
+ tristate
+ default n
+ select ADK_COMPILE_ATFTP
+ help
+ TFTP client
+
+config ADK_PACKAGE_ATFTPD
+ prompt "atftpd............................ TFTP server"
+ tristate
+ default n
+ select ADK_COMPILE_ATFTP
+ help
+ TFTP server
+
+#endmenu
diff --git a/package/atftp/Makefile b/package/atftp/Makefile
new file mode 100644
index 000000000..ac49f0794
--- /dev/null
+++ b/package/atftp/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= atftp
+PKG_VERSION:= 0.7
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 3b27365772d918050b2251d98a9c7c82
+MASTER_SITES:= ftp://ftp.mamalinux.com/pub/atftp/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,ATFTP,atftp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,ATFTPD,atftpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+MAKE_FLAGS+= CFLAGS="${TCFLAGS} -Wall -D_REENTRANT -fno-inline"
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ # atftp client
+ $(INSTALL_DIR) $(IDIR_ATFTP)/usr/bin
+ $(INSTALL_BIN) $(WRKBUILD)/atftp $(IDIR_ATFTP)/usr/bin
+ # atftp server
+ $(INSTALL_DIR) $(IDIR_ATFTPD)/usr/sbin
+ $(INSTALL_BIN) $(WRKBUILD)/atftpd $(IDIR_ATFTPD)/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/atftp/ipkg/atftp.control b/package/atftp/ipkg/atftp.control
new file mode 100644
index 000000000..83b1858c4
--- /dev/null
+++ b/package/atftp/ipkg/atftp.control
@@ -0,0 +1,5 @@
+Package: atftp
+Priority: optional
+Section: net
+Description: tftp client
+Depends: libreadline, libncurses
diff --git a/package/atftp/ipkg/atftpd.control b/package/atftp/ipkg/atftpd.control
new file mode 100644
index 000000000..94f49f3f7
--- /dev/null
+++ b/package/atftp/ipkg/atftpd.control
@@ -0,0 +1,5 @@
+Package: atftpd
+Priority: optional
+Section: net
+Description: tftp server
+Depends: libreadline, libpcre
diff --git a/package/atftp/ipkg/files/postinst b/package/atftp/ipkg/files/postinst
new file mode 100755
index 000000000..35a2c3b36
--- /dev/null
+++ b/package/atftp/ipkg/files/postinst
@@ -0,0 +1,8 @@
+#!/usr/bin/env mksh
+grep -q '^tftp[[:space:]]*69/tcp' ${IPKG_INSTROOT}/etc/services 2>/dev/null
+if [ $? -ne 0 ]; then
+ echo "tftp 69/tcp" >>${IPKG_INSTROOT}/etc/services
+ echo "tftp 69/udp" >>${IPKG_INSTROOT}/etc/services
+ echo "tftp-mcast 1758/tcp" >>${IPKG_INSTROOT}/etc/services
+ echo "tftp-mcast 1758/udp" >>${IPKG_INSTROOT}/etc/services
+fi
diff --git a/package/atftp/patches/patch-stats_c b/package/atftp/patches/patch-stats_c
new file mode 100644
index 000000000..290b53292
--- /dev/null
+++ b/package/atftp/patches/patch-stats_c
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- atftp-0.7.orig/stats.c 2002-03-27 04:02:12.000000000 +0100
++++ atftp-0.7/stats.c 2008-10-09 12:08:47.000000000 +0200
+@@ -157,8 +157,8 @@ void stats_print(void)
+
+ logger(LOG_INFO, " Load measurements:");
+ logger(LOG_INFO, " User: %8.3fs Sys:%8.3fs",
+- (double)(s_stats.tms.tms_utime) / CLK_TCK,
+- (double)(s_stats.tms.tms_stime) / CLK_TCK);
++ (double)(s_stats.tms.tms_utime) / CLOCKS_PER_SEC,
++ (double)(s_stats.tms.tms_stime) / CLOCKS_PER_SEC);
+ logger(LOG_INFO, " Total:%8.3fs CPU:%8.3f%%",
+ (double)(tmp.tv_sec + tmp.tv_usec * 1e-6),
+ (double)(s_stats.tms.tms_utime + s_stats.tms.tms_stime) /
diff --git a/package/atftp/patches/patch-test_Makefile b/package/atftp/patches/patch-test_Makefile
new file mode 100644
index 000000000..097b3a5e3
--- /dev/null
+++ b/package/atftp/patches/patch-test_Makefile
@@ -0,0 +1,152 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- atftp-0.7.orig/test/Makefile 2004-03-16 02:53:37.000000000 +0100
++++ atftp-0.7/test/Makefile 2008-10-09 11:58:55.000000000 +0200
+@@ -13,9 +13,9 @@
+ # PARTICULAR PURPOSE.
+
+
+-srcdir = .
+-top_srcdir = ..
+-
++srcdir = /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/test
++top_srcdir = /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7
++VPATH = /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/test
+ pkgdatadir = $(datadir)/atftp
+ pkglibdir = $(libdir)/atftp
+ pkgincludedir = $(includedir)/atftp
+@@ -33,7 +33,7 @@ POST_INSTALL = :
+ NORMAL_UNINSTALL = :
+ PRE_UNINSTALL = :
+ POST_UNINSTALL = :
+-host_triplet = i686-pc-linux-gnu
++host_triplet = i586-pc-linux-gnu
+ subdir = test
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+@@ -46,24 +46,24 @@ CONFIG_CLEAN_FILES =
+ SOURCES =
+ DIST_SOURCES =
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+-ACLOCAL = ${SHELL} /home/jp/projets/sources/atftp/atftp-0.7/atftp/missing --run aclocal-1.8
+-AMDEP_FALSE = #
+-AMDEP_TRUE =
+-AMTAR = ${SHELL} /home/jp/projets/sources/atftp/atftp-0.7/atftp/missing --run tar
+-AUTOCONF = ${SHELL} /home/jp/projets/sources/atftp/atftp-0.7/atftp/missing --run autoconf
+-AUTOHEADER = ${SHELL} /home/jp/projets/sources/atftp/atftp-0.7/atftp/missing --run autoheader
+-AUTOMAKE = ${SHELL} /home/jp/projets/sources/atftp/atftp-0.7/atftp/missing --run automake-1.8
++ACLOCAL = ${SHELL} /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/missing --run aclocal-1.8
++AMDEP_FALSE =
++AMDEP_TRUE = #
++AMTAR = ${SHELL} /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/missing --run tar
++AUTOCONF = ${SHELL} /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/missing --run autoconf
++AUTOHEADER = ${SHELL} /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/missing --run autoheader
++AUTOMAKE = ${SHELL} /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/missing --run automake-1.8
+ AWK = gawk
+-CC = gcc
+-CCDEPMODE = depmode=gcc3
++CC = /home/wbrodkorb/adk-glibc/cross_x86/host/bin/i586-linux-gnu-gcc
++CCDEPMODE = depmode=none
+ CFLAGS = -g -Wall -D_REENTRANT -O2
+-CPP = gcc -E
+-CPPFLAGS =
++CPP = /home/wbrodkorb/adk-glibc/cross_x86/host/bin/i586-linux-gnu-gcc -E
++CPPFLAGS = -isystem /home/wbrodkorb/adk-glibc/cross_x86/target/include -isystem /home/wbrodkorb/adk-glibc/cross_x86/target/usr/include -DNDEBUG
+ CYGPATH_W = echo
+ DEFS = -DHAVE_CONFIG_H
+ DEPDIR = .deps
+-ECHO_C =
+-ECHO_N = -n
++ECHO_C = \c
++ECHO_N =
+ ECHO_T =
+ EGREP = grep -E
+ EXEEXT =
+@@ -71,17 +71,17 @@ INSTALL_DATA = ${INSTALL} -m 644
+ INSTALL_PROGRAM = ${INSTALL}
+ INSTALL_SCRIPT = ${INSTALL}
+ INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+-ISODATE = 2004-03-15
+-LDFLAGS =
++ISODATE = 2008-10-09
++LDFLAGS = -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/home/wbrodkorb/adk-glibc/cross_x86/target/usr/lib -L/home/wbrodkorb/adk-glibc/cross_x86/target/lib -L/home/wbrodkorb/adk-glibc/cross_x86/target/usr/lib
+ LIBOBJS =
+-LIBPCRE = -lpcre
++LIBPCRE =
+ LIBPTHREAD = -lpthread
+ LIBREADLINE = -lreadline
+ LIBS =
+-LIBTERMCAP =
+-LIBWRAP = -lnsl -lwrap
++LIBTERMCAP = -lncurses
++LIBWRAP =
+ LTLIBOBJS =
+-MAKEINFO = ${SHELL} /home/jp/projets/sources/atftp/atftp-0.7/atftp/missing --run makeinfo
++MAKEINFO = ${SHELL} /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/missing --run makeinfo
+ OBJEXT = o
+ PACKAGE = atftp
+ PACKAGE_BUGREPORT =
+@@ -90,46 +90,46 @@ PACKAGE_STRING =
+ PACKAGE_TARNAME =
+ PACKAGE_VERSION =
+ PATH_SEPARATOR = :
+-PLATFORM = pc-i686-linux-gnu
++PLATFORM = pc-i586-linux-gnu
+ SET_MAKE =
+ SHELL = /bin/sh
+-STRIP =
++STRIP = i586-linux-strip
+ VERSION = 0.7
+-ac_ct_CC = gcc
++ac_ct_CC =
+ ac_ct_STRIP =
+-am__fastdepCC_FALSE = #
+-am__fastdepCC_TRUE =
++am__fastdepCC_FALSE =
++am__fastdepCC_TRUE = #
+ am__include = include
+ am__leading_dot = .
+ am__quote =
+ bindir = ${exec_prefix}/bin
+ build = i686-pc-linux-gnu
+-build_alias =
++build_alias = i686-linux-gnu
+ build_cpu = i686
+ build_os = linux-gnu
+ build_vendor = pc
+-datadir = ${prefix}/share
++datadir = /usr/share
+ exec_prefix = ${prefix}
+-host = i686-pc-linux-gnu
+-host_alias =
+-host_cpu = i686
++host = i586-pc-linux-gnu
++host_alias = i586-linux
++host_cpu = i586
+ host_os = linux-gnu
+ host_vendor = pc
+ includedir = ${prefix}/include
+ infodir = ${prefix}/info
+-install_sh = /home/jp/projets/sources/atftp/atftp-0.7/atftp/install-sh
++install_sh = /home/wbrodkorb/adk-glibc/build_x86/w-atftp-0.7-2/atftp-0.7/install-sh
+ libdir = ${exec_prefix}/lib
+-libexecdir = ${exec_prefix}/libexec
+-localstatedir = ${prefix}/var
+-mandir = ${prefix}/man
++libexecdir = /usr/lib
++localstatedir = /var
++mandir = /usr/share/man
+ mkdir_p = mkdir -p -- .
+ oldincludedir = /usr/include
+-prefix = /usr/local
+-program_transform_name = s,x,x,
++prefix = /usr
++program_transform_name = s,$$,,;s,^,,
+ sbindir = ${exec_prefix}/sbin
+ sharedstatedir = ${prefix}/com
+-sysconfdir = ${prefix}/etc
+-target_alias =
++sysconfdir = /etc
++target_alias = i586-linux
+ TESTS = test.sh
+ CLEANFILES = *~
+ all: all-am
diff --git a/package/atftp/patches/patch-tftp_c b/package/atftp/patches/patch-tftp_c
new file mode 100644
index 000000000..392302bd7
--- /dev/null
+++ b/package/atftp/patches/patch-tftp_c
@@ -0,0 +1,83 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- atftp-0.7.orig/tftp.c 2004-03-16 00:55:56.000000000 +0100
++++ atftp-0.7/tftp.c 2008-10-09 11:58:48.000000000 +0200
+@@ -409,7 +409,7 @@ int process_cmd(int argc, char **argv)
+ int set_peer(int argc, char **argv)
+ {
+ struct hostent *host; /* for host name lookup */
+- struct servent *sp; /* server entry for tftp service */
++ int port = htons(69);
+
+ /* sanity check */
+ if ((argc < 2) || (argc > 3))
+@@ -418,13 +418,6 @@ int set_peer(int argc, char **argv)
+ return ERR;
+ }
+
+- /* get the server entry */
+- sp = getservbyname("tftp", "udp");
+- if (sp == 0) {
+- fprintf(stderr, "tftp: udp/tftp, unknown service.\n");
+- return ERR;
+- }
+-
+ /* look up the host */
+ host = gethostbyname(argv[1]);
+ /* if valid, update s_inn structure */
+@@ -437,7 +430,7 @@ int set_peer(int argc, char **argv)
+ Strncpy(data.hostname, host->h_name,
+ sizeof(data.hostname));
+ data.hostname[sizeof(data.hostname)-1] = 0;
+- data.sa_peer.sin_port = sp->s_port;
++ data.sa_peer.sin_port = port;
+ }
+ else
+ {
+@@ -448,17 +441,17 @@ int set_peer(int argc, char **argv)
+ /* get the server port */
+ if (argc == 3)
+ {
+- sp->s_port = htons(atoi(argv[2]));
+- if (sp->s_port < 0)
++ port = htons(atoi(argv[2]));
++ if (port < 0)
+ {
+ fprintf(stderr, "%s: bad port number.\n", argv[2]);
+ data.connected = 0;
+ return ERR;
+ }
+- data.sa_peer.sin_port = sp->s_port;
++ data.sa_peer.sin_port = port;
+ }
+ /* copy port number to data structure */
+- data.port = ntohs(sp->s_port);
++ data.port = ntohs(port);
+
+ data.connected = 1;
+ return OK;
+@@ -974,6 +967,7 @@ int tftp_cmd_line_options(int argc, char
+ { "tftp-timeout", 1, NULL, 'T'},
+ { "mode", 1, NULL, 'M'},
+ { "option", 1, NULL, 'O'},
++ { "retry", 1, NULL, 'R'},
+ #if 1
+ { "timeout", 1, NULL, 't'},
+ { "blksize", 1, NULL, 'b'},
+@@ -993,11 +987,16 @@ int tftp_cmd_line_options(int argc, char
+ };
+
+ /* Support old argument until 0.8 */
+- while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:sm",
++ while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:smR:",
+ options, &option_index)) != EOF)
+ {
+ switch (c)
+ {
++ case 'R':
++ snprintf(string, sizeof(string), "option retry %s", optarg);
++ make_arg(string, &ac, &av);
++ process_cmd(ac, av);
++ break;
+ case 'g':
+ interactive = 0;
+ if ((action == PUT) || (action == MGET))
diff --git a/package/atftp/patches/patch-tftp_def_c b/package/atftp/patches/patch-tftp_def_c
new file mode 100644
index 000000000..dc94e8c10
--- /dev/null
+++ b/package/atftp/patches/patch-tftp_def_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- atftp-0.7.orig/tftp_def.c 2004-02-13 04:16:09.000000000 +0100
++++ atftp-0.7/tftp_def.c 2008-10-09 11:58:48.000000000 +0200
+@@ -37,6 +37,7 @@ struct tftp_opt tftp_default_options[OPT
+ { "timeout", "5", 0, 1 }, /* 2348, 2349, 2090. */
+ { "blksize", "512", 0, 1 }, /* This is the default option */
+ { "multicast", "", 0, 1 }, /* structure */
++ { "retry", "5", 0, 1 },
+ { "", "", 0, 0}
+ };
+
diff --git a/package/atftp/patches/patch-tftp_def_h b/package/atftp/patches/patch-tftp_def_h
new file mode 100644
index 000000000..cd602d978
--- /dev/null
+++ b/package/atftp/patches/patch-tftp_def_h
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- atftp-0.7.orig/tftp_def.h 2004-02-13 04:16:09.000000000 +0100
++++ atftp-0.7/tftp_def.h 2008-10-09 11:58:48.000000000 +0200
+@@ -40,7 +40,8 @@
+ #define OPT_TIMEOUT 3
+ #define OPT_BLKSIZE 4
+ #define OPT_MULTICAST 5
+-#define OPT_NUMBER 7
++#define OPT_RETRY 6
++#define OPT_NUMBER 8
+
+ #define OPT_SIZE 12
+ #define VAL_SIZE MAXLEN
diff --git a/package/atftp/patches/patch-tftp_file_c b/package/atftp/patches/patch-tftp_file_c
new file mode 100644
index 000000000..b071b1cf7
--- /dev/null
+++ b/package/atftp/patches/patch-tftp_file_c
@@ -0,0 +1,64 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- atftp-0.7.orig/tftp_file.c 2004-02-13 04:16:09.000000000 +0100
++++ atftp-0.7/tftp_file.c 2008-10-09 11:58:48.000000000 +0200
+@@ -123,6 +123,7 @@ int tftp_receive_file(struct client_data
+ struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer;
+ FILE *fp = NULL; /* the local file pointer */
+ int number_of_timeout = 0;
++ int num_retry = atoi(data->tftp_options[OPT_RETRY].value);
+ int convert = 0; /* if true, do netascii convertion */
+
+ int oacks = 0; /* count OACK for improved error checking */
+@@ -141,7 +142,7 @@ int tftp_receive_file(struct client_data
+
+ int prev_block_number = 0; /* needed to support netascii convertion */
+ int temp = 0;
+-
++
+ data->file_size = 0;
+ tftp_cancel = 0;
+ from.sin_addr.s_addr = 0;
+@@ -288,7 +289,7 @@ int tftp_receive_file(struct client_data
+ case GET_TIMEOUT:
+ number_of_timeout++;
+ fprintf(stderr, "timeout: retrying...\n");
+- if (number_of_timeout > NB_OF_RETRY)
++ if ((num_retry > 0) && (number_of_timeout > num_retry))
+ state = S_ABORT;
+ else
+ state = timeout_state;
+@@ -325,7 +326,7 @@ int tftp_receive_file(struct client_data
+ number_of_timeout++;
+ fprintf(stderr, "tftp: packet discard <%s:%d>.\n",
+ inet_ntoa(from.sin_addr), ntohs(from.sin_port));
+- if (number_of_timeout > NB_OF_RETRY)
++ if ((num_retry > 0) && (number_of_timeout > num_retry))
+ state = S_ABORT;
+ break;
+ case ERR:
+@@ -614,6 +615,7 @@ int tftp_send_file(struct client_data *d
+ struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer;
+ FILE *fp; /* the local file pointer */
+ int number_of_timeout = 0;
++ int num_retry = atoi(data->tftp_options[OPT_RETRY].value);
+ struct stat file_stat;
+ int convert = 0; /* if true, do netascii convertion */
+ char string[MAXLEN];
+@@ -751,7 +753,7 @@ int tftp_send_file(struct client_data *d
+ case GET_TIMEOUT:
+ number_of_timeout++;
+ fprintf(stderr, "timeout: retrying...\n");
+- if (number_of_timeout > NB_OF_RETRY)
++ if ((num_retry > 0) && (number_of_timeout > num_retry))
+ state = S_ABORT;
+ else
+ state = timeout_state;
+@@ -797,7 +799,7 @@ int tftp_send_file(struct client_data *d
+ number_of_timeout++;
+ fprintf(stderr, "tftp: packet discard <%s:%d>.\n",
+ inet_ntoa(from.sin_addr), ntohs(from.sin_port));
+- if (number_of_timeout > NB_OF_RETRY)
++ if ((num_retry > 0) && (number_of_timeout > num_retry))
+ state = S_ABORT;
+ break;
+ case ERR:
diff --git a/package/atftp/patches/patch-tftpd_c b/package/atftp/patches/patch-tftpd_c
new file mode 100644
index 000000000..93568d91a
--- /dev/null
+++ b/package/atftp/patches/patch-tftpd_c
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- atftp-0.7.orig/tftpd.c 2004-02-27 03:05:26.000000000 +0100
++++ atftp-0.7/tftpd.c 2008-10-09 11:58:48.000000000 +0200
+@@ -230,14 +230,8 @@ int main(int argc, char **argv)
+
+ /* find the port */
+ if (tftpd_port == 0)
+- {
+- if ((serv = getservbyname("tftp", "udp")) == NULL)
+- {
+- logger(LOG_ERR, "atftpd: udp/tftp, unknown service");
+- exit(1);
+- }
+- tftpd_port = ntohs(serv->s_port);
+- }
++ tftpd_port = htons(69);
++
+ /* initialise sockaddr_in structure */
+ memset(&sa, 0, sizeof(sa));
+ sa.sin_family = AF_INET;
diff --git a/package/autossh/Config.in b/package/autossh/Config.in
new file mode 100644
index 000000000..5f72059f0
--- /dev/null
+++ b/package/autossh/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_AUTOSSH
+ prompt "autossh........................... Auto handle ssh tunnels"
+ tristate
+ default n
+ help
+ autossh is a program to start a copy of ssh and monitor it,
+ restarting it as necessary should it die or stop passing traffic.
+
+ http://www.harding.motd.ca/autossh/
diff --git a/package/autossh/Makefile b/package/autossh/Makefile
new file mode 100644
index 000000000..0363f8855
--- /dev/null
+++ b/package/autossh/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= autossh
+PKG_VERSION:= 1.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0e7ec62eeca5d1b197f3ef2d0f0d417f
+MASTER_SITES:= http://www.harding.motd.ca/autossh/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tgz
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,AUTOSSH,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+TCFLAGS+= -Wall -DSSH_PATH=\\\"/usr/bin/ssh\\\"\ \
+ -DVER=\\\"$(PKG_VERSION)\\\"\"
+MAKE_FLAGS+= CC="$(TARGET_CC)" BINDIR=/usr/bin MANDIR=/usr/man
+BUILD_STYLE= auto
+
+do-configure:
+ cp $(WRKBUILD)/Makefile.linux $(WRKBUILD)/Makefile
+
+do-install:
+ echo $(CC)
+ $(INSTALL_DIR) $(IDIR_AUTOSSH)/usr/bin
+ $(INSTALL_BIN) $(WRKBUILD)/autossh $(IDIR_AUTOSSH)/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/autossh/ipkg/autossh.control b/package/autossh/ipkg/autossh.control
new file mode 100644
index 000000000..2916e3851
--- /dev/null
+++ b/package/autossh/ipkg/autossh.control
@@ -0,0 +1,5 @@
+Package: autossh
+Priority: optional
+Section: net
+Depends: openssh-client
+Description: Autossh client
diff --git a/package/avahi/Config.in b/package/avahi/Config.in
new file mode 100644
index 000000000..b64b0e33d
--- /dev/null
+++ b/package/avahi/Config.in
@@ -0,0 +1,44 @@
+config ADK_COMPILE_AVAHI
+ tristate
+ default n
+ depends ADK_PACKAGE_AVAHI_DAEMON || ADK_PACKAGE_AVAHI_DNSCONFD || ADK_PACKAGE_LIBAVAHI
+
+config ADK_PACKAGE_AVAHI_DAEMON
+ prompt "avahi-daemon...................... An mDNS/DNS-SD (ZeroConf) implementation (daemon)"
+ tristate
+ default n
+ select ADK_COMPILE_AVAHI
+ select ADK_PACKAGE_LIBAVAHI
+ select ADK_PACKAGE_LIBDAEMON
+ help
+ Avahi is a system which facilitates service discovery on a local network --
+ this means that you can plug your laptop or computer into a network and
+ instantly be able to view other people who you can chat with, find printers
+ to print to or find files being shared. This kind of technology is already
+ found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
+ and is very convenient.
+
+ http://www.freedesktop.org/Software/Avahi
+
+ This package contains an mDNS/DNS-SD daemon.
+
+config ADK_PACKAGE_AVAHI_DNSCONFD
+ prompt "avahi-dnsconfd.................. Unicast DNS server from mDNS/DNS-SD config daemon"
+ tristate
+ default n
+ select ADK_COMPILE_AVAHI
+ depends ADK_PACKAGE_AVAHI_DAEMON
+ help
+ Avahi is a system which facilitates service discovery on a local network --
+ this means that you can plug your laptop or computer into a network and
+ instantly be able to view other people who you can chat with, find printers
+ to print to or find files being shared. This kind of technology is already
+ found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
+ and is very convenient.
+
+ http://www.freedesktop.org/Software/Avahi
+
+ This package contains an Unicast DNS server from mDNS/DNS-SD configuration
+ daemon, which may be used to configure conventional DNS servers using mDNS
+ in a DHCP-like fashion. Especially useful on IPv6.
+
diff --git a/package/avahi/Config.in.lib b/package/avahi/Config.in.lib
new file mode 100644
index 000000000..abfbdc426
--- /dev/null
+++ b/package/avahi/Config.in.lib
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_LIBAVAHI
+ prompt "libavahi.......................... An mDNS/DNS-SD (ZeroConf) implementation (library)"
+ tristate
+ default n
+ select ADK_COMPILE_AVAHI
+ help
+ Avahi is a system which facilitates service discovery on a local network --
+ this means that you can plug your laptop or computer into a network and
+ instantly be able to view other people who you can chat with, find printers
+ to print to or find files being shared. This kind of technology is already
+ found in MacOS X (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf')
+ and is very convenient.
+
+ http://www.freedesktop.org/Software/Avahi
+
+ This package contains the mDNS/DNS-SD shared libraries, used by other programs.
+
+
diff --git a/package/avahi/Makefile b/package/avahi/Makefile
new file mode 100644
index 000000000..f950db29b
--- /dev/null
+++ b/package/avahi/Makefile
@@ -0,0 +1,83 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= avahi
+PKG_VERSION:= 0.6.16
+PKG_RELEASE:= 6
+PKG_MD5SUM:= 3cbc460bbd55bae35f7b57443c063640
+MASTER_SITES:= http://avahi.org/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,AVAHI_DAEMON,avahi-daemon,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,AVAHI_DNSCONFD,avahi-dnsconfd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBAVAHI,libavahi,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TCFLAGS+= -DNDEBUG
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes \
+ ac_cv_func_memcmp_working=yes
+CONFIGURE_ARGS+= --disable-glib \
+ --disable-qt3 \
+ --disable-qt4 \
+ --disable-gtk \
+ --disable-dbus \
+ --enable-expat \
+ --enable-libdaemon \
+ --disable-python \
+ --disable-pygtk \
+ --disable-python-dbus \
+ --disable-mono \
+ --disable-monodoc \
+ --disable-doxygen-doc \
+ --disable-doxygen-dot \
+ --disable-doxygen-man \
+ --disable-doxygen-rtf \
+ --disable-doxygen-xml \
+ --disable-doxygen-chm \
+ --disable-doxygen-chi \
+ --disable-doxygen-html \
+ --disable-doxygen-ps \
+ --disable-doxygen-pdf \
+ --disable-xmltoman \
+ --with-distro=none \
+ --with-avahi-user=avahi \
+ --with-avahi-group=avahi
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+#XXX maybe unneeded?
+#XAKE_FLAGS+= PKG_CONFIG_PATH=${STAGING_DIR}/usr/lib/pkgconfig
+
+post-install:
+ # avahi daemon
+ ${INSTALL_DIR} ${IDIR_AVAHI_DAEMON}/etc/avahi
+ ${INSTALL_DATA} ./files/avahi-daemon.conf ${IDIR_AVAHI_DAEMON}/etc/avahi/
+ ${INSTALL_DIR} ${IDIR_AVAHI_DAEMON}/etc/avahi/services
+ ${INSTALL_DATA} ./files/service-http \
+ ${IDIR_AVAHI_DAEMON}/etc/avahi/services/http.service
+ ${INSTALL_DATA} ./files/service-ssh \
+ ${IDIR_AVAHI_DAEMON}/etc/avahi/services/ssh.service
+ ${INSTALL_DIR} ${IDIR_AVAHI_DAEMON}/etc/init.d
+ ${INSTALL_BIN} ./files/avahi-daemon.init \
+ ${IDIR_AVAHI_DAEMON}/etc/init.d/avahi-daemon
+ ${INSTALL_DIR} ${IDIR_AVAHI_DAEMON}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/avahi-daemon ${IDIR_AVAHI_DAEMON}/usr/sbin/
+ # avahi dnsconfd
+ ${INSTALL_DIR} ${IDIR_AVAHI_DNSCONFD}/etc/avahi
+ ${CP} ${WRKINST}/etc/avahi/avahi-dnsconfd.action \
+ ${IDIR_AVAHI_DNSCONFD}/etc/avahi/
+ ${INSTALL_DIR} ${IDIR_AVAHI_DNSCONFD}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/avahi-dnsconfd ${IDIR_AVAHI_DNSCONFD}/usr/sbin/
+ # libavahi
+ ${INSTALL_DIR} ${IDIR_LIBAVAHI}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libavahi-common.so.* ${IDIR_LIBAVAHI}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/libavahi-core.so.* ${IDIR_LIBAVAHI}/usr/lib/
+ ${SED} 's,-I$$(includedir),,g' ${WRKINST}/usr/lib/pkgconfig/avahi-core.pc
+ ${SED} 's,-L$$(libdir),,g' ${WRKINST}/usr/lib/pkgconfig/avahi-core.pc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/avahi/files/avahi-daemon.conf b/package/avahi/files/avahi-daemon.conf
new file mode 100644
index 000000000..a5ff88619
--- /dev/null
+++ b/package/avahi/files/avahi-daemon.conf
@@ -0,0 +1,29 @@
+[server]
+#host-name=foo
+#domain-name=local
+use-ipv4=yes
+use-ipv6=no
+check-response-ttl=no
+use-iff-running=no
+enable-dbus=no
+
+[publish]
+publish-addresses=yes
+publish-hinfo=yes
+publish-workstation=no
+publish-domain=yes
+#publish-dns-servers=192.168.1.1
+#publish-resolv-conf-dns-servers=yes
+
+[reflector]
+enable-reflector=no
+reflect-ipv=no
+
+[rlimits]
+#rlimit-as=
+rlimit-core=0
+rlimit-data=4194304
+rlimit-fsize=0
+rlimit-nofile=30
+rlimit-stack=4194304
+rlimit-nproc=1
diff --git a/package/avahi/files/avahi-daemon.init b/package/avahi/files/avahi-daemon.init
new file mode 100644
index 000000000..06d0863fc
--- /dev/null
+++ b/package/avahi/files/avahi-daemon.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+ autostart)
+ test x"${avahi:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+ start)
+ avahi-daemon -D
+ ;;
+ stop)
+ avahi-daemon -k
+ ;;
+ restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 { start | stop | reload }"
+ exit 1
+esac
+exit $?
diff --git a/package/avahi/files/service-http b/package/avahi/files/service-http
new file mode 100644
index 000000000..8e0d3a513
--- /dev/null
+++ b/package/avahi/files/service-http
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
+<service-group>
+ <name replace-wildcards="yes">Web Server on %h</name>
+ <service>
+ <type>_http._tcp</type>
+ <port>80</port>
+ <txt-record>path=/index.html</txt-record>
+ </service>
+</service-group>
diff --git a/package/avahi/files/service-ssh b/package/avahi/files/service-ssh
new file mode 100644
index 000000000..b41580378
--- /dev/null
+++ b/package/avahi/files/service-ssh
@@ -0,0 +1,9 @@
+<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
+<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
+<service-group>
+ <name replace-wildcards="yes">Secure Shell on %h</name>
+ <service>
+ <type>_ssh._tcp</type>
+ <port>22</port>
+ </service>
+</service-group>
diff --git a/package/avahi/ipkg/avahi-daemon.conffiles b/package/avahi/ipkg/avahi-daemon.conffiles
new file mode 100644
index 000000000..46379ed96
--- /dev/null
+++ b/package/avahi/ipkg/avahi-daemon.conffiles
@@ -0,0 +1,3 @@
+/etc/avahi/avahi-daemon.conf
+/etc/avahi/services/http.service
+/etc/avahi/services/ssh.service
diff --git a/package/avahi/ipkg/avahi-daemon.control b/package/avahi/ipkg/avahi-daemon.control
new file mode 100644
index 000000000..f68a690fe
--- /dev/null
+++ b/package/avahi/ipkg/avahi-daemon.control
@@ -0,0 +1,5 @@
+Package: avahi-daemon
+Priority: optional
+Section: net
+Depends: libavahi, libdaemon, libexpat
+Description: an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) implementation (daemon)
diff --git a/package/avahi/ipkg/avahi-daemon.postinst b/package/avahi/ipkg/avahi-daemon.postinst
new file mode 100644
index 000000000..0e3e13912
--- /dev/null
+++ b/package/avahi/ipkg/avahi-daemon.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+gid=$(get_next_gid)
+add_group avahi $gid
+add_user avahi $(get_next_uid) $gid /tmp
+add_rcconf avahi avahi NO
diff --git a/package/avahi/ipkg/avahi-dnsconfd.control b/package/avahi/ipkg/avahi-dnsconfd.control
new file mode 100644
index 000000000..1213a0e7b
--- /dev/null
+++ b/package/avahi/ipkg/avahi-dnsconfd.control
@@ -0,0 +1,5 @@
+Package: avahi-dnsconfd
+Priority: optional
+Section: net
+Depends: libavahi, libdaemon, avahi-daemon
+Description: an Unicast DNS server from mDNS/DNS-SD configuration daemon
diff --git a/package/avahi/ipkg/libavahi.control b/package/avahi/ipkg/libavahi.control
new file mode 100644
index 000000000..4912296bc
--- /dev/null
+++ b/package/avahi/ipkg/libavahi.control
@@ -0,0 +1,4 @@
+Package: libavahi
+Priority: optional
+Section: libs
+Description: an DNS-SD over mDNS (aka RendezVous/Bonjour/ZeroConf) implementation (library)
diff --git a/package/axtls/Config.in b/package/axtls/Config.in
new file mode 100644
index 000000000..5d1459da9
--- /dev/null
+++ b/package/axtls/Config.in
@@ -0,0 +1,17 @@
+config ADK_COMPILE_AXTLS
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBAXTLS || ADK_PACKAGE_AXHTTPD
+
+config ADK_PACKAGE_AXHTTPD
+ prompt "axhttpd........................... small embedded webserver"
+ tristate
+ default n
+ select ADK_COMPILE_AXTLS
+ select ADK_PACKAGE_LIBAXTLS
+ help
+ axhttpd is a small embedded web server using the axTLS library.
+
+ http://www.axtls.co.nr/
+
+
diff --git a/package/axtls/Config.in.lib b/package/axtls/Config.in.lib
new file mode 100644
index 000000000..d7b64aa44
--- /dev/null
+++ b/package/axtls/Config.in.lib
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_LIBAXTLS
+ prompt "libaxtls.......................... Embedded client/server TLSv1 SSL library"
+ tristate
+ default n
+ select ADK_COMPILE_AXTLS
+ help
+ Embedded client/server TLSv1 SSL library
+
+ http://www.axtls.co.nr/
+
+
diff --git a/package/axtls/Makefile b/package/axtls/Makefile
new file mode 100644
index 000000000..2ac2611a3
--- /dev/null
+++ b/package/axtls/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= axtls
+PKG_VERSION:= 1.1.0
+PKG_RELEASE:= 8
+PKG_MD5SUM:= 4a834edc93f46fdca4f9c93ec665376e
+DISTFILES:= axTLS-${PKG_VERSION}.tar.gz
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=axtls/}
+WRKDIST= ${WRKDIR}/axTLS
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBAXTLS,libaxtls,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,AXHTTPD,axhttpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+BUILD_STYLE= auto
+XAKE_FLAGS+= STRIP='' \
+ CC='${TARGET_CC}' \
+ OPT_CFLAGS='${TARGET_CFLAGS}' \
+ OPT_LDFLAGS=""
+
+do-configure:
+ ${CP} ./files/config ${WRKBUILD}/config/.config
+ ${MAKE} -C ${WRKBUILD} oldconfig
+
+do-install:
+ # axtls library
+ ${INSTALL_DIR} ${IDIR_LIBAXTLS}/usr/lib
+ $(CP) $(WRKBUILD)/_stage/libaxtls.so.* $(IDIR_LIBAXTLS)/usr/lib/
+ # awhttpd server
+ ${INSTALL_DIR} ${IDIR_AXHTTPD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_AXHTTPD}/www
+ ${INSTALL_DIR} ${IDIR_AXHTTPD}/usr/sbin
+ ${INSTALL_BIN} $(WRKBUILD)/_stage/axhttpd $(IDIR_AXHTTPD)/usr/sbin/
+ $(INSTALL_BIN) ./files/axhttpd.init \
+ $(IDIR_AXHTTPD)/etc/init.d/axhttpd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/axtls/files/axhttpd.init b/package/axtls/files/axhttpd.init
new file mode 100644
index 000000000..70ccc48d5
--- /dev/null
+++ b/package/axtls/files/axhttpd.init
@@ -0,0 +1,30 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${axhttpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ if [ ! -d /www -a ! -h /www ]; then
+ echo "axhttpd not started. create /www first"
+ exit 0
+ fi
+ /usr/sbin/axhttpd >>/var/log/axhttpd.access
+ ;;
+stop)
+ killall axhttpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/axtls/files/config b/package/axtls/files/config
new file mode 100644
index 000000000..caa5dc35a
--- /dev/null
+++ b/package/axtls/files/config
@@ -0,0 +1,102 @@
+#
+# Automatically generated make config: don't edit
+#
+HAVE_DOT_CONFIG=y
+CONFIG_PLATFORM_LINUX=y
+# CONFIG_PLATFORM_CYGWIN is not set
+# CONFIG_PLATFORM_SOLARIS is not set
+# CONFIG_PLATFORM_WIN32 is not set
+
+#
+# General Configuration
+#
+PREFIX="/usr"
+CONFIG_DEBUG=y
+# CONFIG_VISUAL_STUDIO_6_0 is not set
+# CONFIG_VISUAL_STUDIO_7_0 is not set
+# CONFIG_VISUAL_STUDIO_8_0 is not set
+CONFIG_VISUAL_STUDIO_6_0_BASE=""
+CONFIG_VISUAL_STUDIO_7_0_BASE=""
+CONFIG_VISUAL_STUDIO_8_0_BASE=""
+CONFIG_EXTRA_CFLAGS_OPTIONS=""
+CONFIG_EXTRA_LDFLAGS_OPTIONS=""
+
+#
+# SSL Library
+#
+# CONFIG_SSL_SERVER_ONLY is not set
+# CONFIG_SSL_CERT_VERIFICATION is not set
+CONFIG_SSL_ENABLE_CLIENT=y
+# CONFIG_SSL_FULL_MODE is not set
+# CONFIG_SSL_SKELETON_MODE is not set
+# CONFIG_SSL_PROT_LOW is not set
+CONFIG_SSL_PROT_MEDIUM=y
+# CONFIG_SSL_PROT_HIGH is not set
+CONFIG_SSL_USE_DEFAULT_KEY=y
+CONFIG_SSL_ENABLE_V23_HANDSHAKE=y
+CONFIG_SSL_HAS_PEM=y
+CONFIG_SSL_USE_PKCS12=y
+CONFIG_SSL_EXPIRY_TIME=24
+CONFIG_X509_MAX_CA_CERTS=4
+CONFIG_SSL_MAX_CERTS=2
+# CONFIG_SSLCTX_MUTEXING is not set
+CONFIG_USE_DEV_URANDOM=y
+# CONFIG_WIN32_USE_CRYPTO_LIB is not set
+# CONFIG_PERFORMANCE_TESTING is not set
+# CONFIG_SSL_TEST is not set
+CONFIG_AXHTTPD=y
+
+#
+# Axhttpd Configuration
+#
+# CONFIG_HTTP_STATIC_BUILD is not set
+CONFIG_HTTP_HTTPS_PORT=443
+CONFIG_HTTP_SESSION_CACHE_SIZE=5
+CONFIG_HTTP_WEBROOT="/www"
+CONFIG_HTTP_PORT=80
+CONFIG_HTTP_TIMEOUT=0
+CONFIG_HTTP_HAS_CGI=y
+CONFIG_HTTP_CGI_EXTENSION=".cgi"
+CONFIG_HTTP_DIRECTORIES=y
+# CONFIG_HTTP_PERM_CHECK is not set
+# CONFIG_HTTP_HAS_IPV6 is not set
+CONFIG_HTTP_ALL_MIME_TYPES=y
+CONFIG_HTTP_VERBOSE=y
+CONFIG_HTTP_IS_DAEMON=y
+
+#
+# Language Bindings
+#
+# CONFIG_BINDINGS is not set
+# CONFIG_CSHARP_BINDINGS is not set
+# CONFIG_VBNET_BINDINGS is not set
+CONFIG_DOT_NET_FRAMEWORK_BASE=""
+# CONFIG_JAVA_BINDINGS is not set
+CONFIG_JAVA_HOME=""
+# CONFIG_PERL_BINDINGS is not set
+CONFIG_PERL_CORE=""
+CONFIG_PERL_LIB=""
+
+#
+# Samples
+#
+# CONFIG_SAMPLES is not set
+# CONFIG_C_SAMPLES is not set
+# CONFIG_CSHARP_SAMPLES is not set
+# CONFIG_VBNET_SAMPLES is not set
+# CONFIG_JAVA_SAMPLES is not set
+# CONFIG_PERL_SAMPLES is not set
+
+#
+# BigInt Options
+#
+# CONFIG_BIGINT_CLASSICAL is not set
+# CONFIG_BIGINT_MONTGOMERY is not set
+CONFIG_BIGINT_BARRETT=y
+# CONFIG_BIGINT_CRT is not set
+# CONFIG_BIGINT_KARATSUBA is not set
+MUL_KARATSUBA_THRESH=0
+SQU_KARATSUBA_THRESH=0
+# CONFIG_BIGINT_SLIDING_WINDOW is not set
+# CONFIG_BIGINT_SQUARE is not set
+# CONFIG_BIGINT_CHECK_ON is not set
diff --git a/package/axtls/ipkg/axhttpd.control b/package/axtls/ipkg/axhttpd.control
new file mode 100644
index 000000000..e19f3fc4c
--- /dev/null
+++ b/package/axtls/ipkg/axhttpd.control
@@ -0,0 +1,5 @@
+Package: axhttpd
+Priority: optional
+Section: net
+Depends: libaxtls
+Description: small embedded webserver
diff --git a/package/axtls/ipkg/axhttpd.postinst b/package/axtls/ipkg/axhttpd.postinst
new file mode 100644
index 000000000..d19a62e8a
--- /dev/null
+++ b/package/axtls/ipkg/axhttpd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf axhttpd
diff --git a/package/axtls/ipkg/libaxtls.control b/package/axtls/ipkg/libaxtls.control
new file mode 100644
index 000000000..b9c9d4be4
--- /dev/null
+++ b/package/axtls/ipkg/libaxtls.control
@@ -0,0 +1,5 @@
+Package: libaxtls
+Priority: optional
+Section: libs
+Description: an embedded client/server TLSv1 SSL implementation
+Depends:
diff --git a/package/axtls/patches/001-opt_flags.patch b/package/axtls/patches/001-opt_flags.patch
new file mode 100644
index 000000000..a27b3a449
--- /dev/null
+++ b/package/axtls/patches/001-opt_flags.patch
@@ -0,0 +1,33 @@
+diff -ruN axTLS-0.95-old/config/makefile.conf axTLS-0.95-new/config/makefile.conf
+--- axTLS-0.95-old/config/makefile.conf 2006-02-28 02:50:28.000000000 +0100
++++ axTLS-0.95-new/config/makefile.conf 2006-05-18 22:24:02.000000000 +0200
+@@ -87,20 +87,23 @@
+ endif
+
+ ifdef CONFIG_DEBUG
+-CFLAGS += -g
++OPT_CFLAGS = -g
+ else
+-LDFLAGS += -s
++OPT_LDFLAGS = -s
+ ifdef CONFIG_PLATFORM_SOLARIS
+-CFLAGS += -O
++OPT_CFLAGS = -O
+ else
+-CFLAGS += -O3
++OPT_CFLAGS = -O3
+ endif
+
+ endif # CONFIG_DEBUG
+ endif # WIN32
+
+-CFLAGS+=$(subst ",, $(strip $(CONFIG_EXTRA_CFLAGS_OPTIONS)))
+-LDFLAGS+=$(subst ",, $(strip $(CONFIG_EXTRA_LDFLAGS_OPTIONS)))
++EXTRA_CFLAGS=$(subst ",, $(strip $(CONFIG_EXTRA_CFLAGS_OPTIONS)))
++EXTRA_LDFLAGS=$(subst ",, $(strip $(CONFIG_EXTRA_LDFLAGS_OPTIONS)))
++
++CFLAGS += $(OPT_CFLAGS) $(EXTRA_CFLAGS)
++LDFLAGS += $(OPT_LDFLAGS) $(EXTRA_LDFLAGS)
+
+ endif # not 'clean'
+
diff --git a/package/axtls/patches/patch-httpd_main_c b/package/axtls/patches/patch-httpd_main_c
new file mode 100644
index 000000000..b4017803e
--- /dev/null
+++ b/package/axtls/patches/patch-httpd_main_c
@@ -0,0 +1,21 @@
+$Id$
+--- axTLS.orig/httpd/main.c 2007-01-31 22:35:53.000000000 +0100
++++ axTLS/httpd/main.c 2007-02-10 12:15:20.000000000 +0100
+@@ -98,11 +98,12 @@ int main(int argc, char *argv[])
+ WSADATA wsaData;
+ WSAStartup(wVersionRequested,&wsaData);
+ #else
+- if (getuid() == 0) /* change our uid if we are root */
+- {
+- setgid(32767);
+- setuid(32767);
+- }
++ /* we can't bind to port 80/443 if we are nobody ?! */
++ //if (getuid() == 0) /* change our uid if we are root */
++ //{
++ // setgid(32767);
++ // setuid(32767);
++ //}
+
+ signal(SIGQUIT, die);
+ signal(SIGPIPE, SIG_IGN);
diff --git a/package/base-files/Config.in b/package/base-files/Config.in
new file mode 100644
index 000000000..8312e2ee2
--- /dev/null
+++ b/package/base-files/Config.in
@@ -0,0 +1,16 @@
+config ADK_PACKAGE_BASE_FILES
+ prompt "base-files........................... basic filesystem layout"
+ bool
+ default y
+ help
+ Basic filesystem layout.
+
+config ADK_PACKAGE_CONFIG_IN_ETC
+ prompt ".config in /etc...................... include gzipped version of .config in image"
+ bool
+ default y
+ help
+ Copy the configuration file (.config) to the image. The
+ file will be found in /etc/adkconfig.gz. This takes about
+ 7kBytes of file system space. From this file you can always rebuild
+ the image from source.
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
new file mode 100644
index 000000000..8d07473d7
--- /dev/null
+++ b/package/base-files/Makefile
@@ -0,0 +1,72 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/rootfs.mk
+
+PKG_NAME:= base-files
+PKG_VERSION:= 1.0
+PKG_RELEASE:= 5
+WRKDIST= ${WRKDIR}/base-files
+NO_DISTFILES:= 1
+ifeq ($(CPU_ARCH),x86_64)
+PKG_ID= x86-64-${FS}
+else
+PKG_ID= ${DEVICE}-${FS}
+endif
+WRKDIR= ${WRKDIR_BASE}/w-${PKG_NAME}-${PKG_VERSION}-${PKG_RELEASE}-${PKG_ID}
+ICONTROL_BASE_FILES= ipkg/base-files.control
+ICONTROL_ADDON_BASE_FILES= "Package: base-files-${PKG_ID}"
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,BASE_FILES,base-files-${PKG_ID},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-install:
+ $(CP) ./files/* $(IDIR_BASE_FILES)
+ $(CP) $(TOPDIR)/target/$(DEVICE)/files/* $(IDIR_BASE_FILES)
+ typeset -i REV; \
+ if fgrep xml .svn/entries >/dev/null 2>&1; then \
+ let REV="$$(sed -n '/revision=/s/^.*"\([0-9]*\)".*$$/\1/p' \
+ .svn/entries)"; \
+ else \
+ let REV="$$(head -n 4 .svn/entries | tail -1)"; \
+ fi; ${SED} 's,$$R,'$$REV,g $(IDIR_BASE_FILES)/etc/banner
+ $(SED) 's,@TARGET@,$(DEVICE),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
+ $(SED) 's,@VERSION@,$(ADK_VERSION),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
+ echo /bin/sh >${IDIR_BASE_FILES}/etc/shells
+ echo /bin/ash >>${IDIR_BASE_FILES}/etc/shells
+ifneq (${ADK_PACKAGE_BASH},)
+ echo /bin/bash >>${IDIR_BASE_FILES}/etc/shells
+endif
+ifneq (${ADK_PACKAGE_MKSH},)
+ echo /bin/mksh >>${IDIR_BASE_FILES}/etc/shells
+endif
+ifneq (${ADK_PACKAGE_ZSH},)
+ echo /bin/zsh >>${IDIR_BASE_FILES}/etc/shells
+endif
+ mkdir -p $(IDIR_BASE_FILES)/dev
+ mkdir -p $(IDIR_BASE_FILES)/boot
+ mkdir -p $(IDIR_BASE_FILES)/root
+ mkdir -p $(IDIR_BASE_FILES)/sys
+ mkdir -p $(IDIR_BASE_FILES)/etc/crontabs
+ mkdir -p $(IDIR_BASE_FILES)/mnt
+ mkdir -p $(IDIR_BASE_FILES)/proc
+ mkdir -p $(IDIR_BASE_FILES)/tmp
+ mkdir -p $(IDIR_BASE_FILES)/usr/lib
+ mkdir -p $(IDIR_BASE_FILES)/usr/bin
+ chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
+ ln -sf ../tmp/resolv.conf $(IDIR_BASE_FILES)/etc/resolv.conf
+ ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
+ rm -rf $(IDIR_BASE_FILES)/var
+ ln -sf tmp $(IDIR_BASE_FILES)/var
+ -find $(IDIR_BASE_FILES) -type d -name CVS | xargs rm -rf
+ -find $(IDIR_BASE_FILES) -type d -name .svn | xargs rm -rf
+ -find $(IDIR_BASE_FILES) -name '.#*' | xargs rm -f
+ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
+ gzip -9c ${TOPDIR}/.config >$(IDIR_BASE_FILES)/etc/adkconfig.gz
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/base-files/files/etc/banner b/package/base-files/files/etc/banner
new file mode 100644
index 000000000..bdee76e22
--- /dev/null
+++ b/package/base-files/files/etc/banner
@@ -0,0 +1,3 @@
+
+ Linux created with OpenADK
+ --- build from revision $R ---
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh
new file mode 100644
index 000000000..4d225b882
--- /dev/null
+++ b/package/base-files/files/etc/functions.sh
@@ -0,0 +1,79 @@
+# newline
+N="
+"
+
+append() {
+ local var="$1"
+ local value="$2"
+ local sep="${3:- }"
+
+ eval "export -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
+}
+
+load_modules() {
+ (sed "s,^[^#][^[:space:]]*,insmod /lib/modules/$(uname -r)/&.ko," $* | sh 2>&- || :)
+}
+
+user_exists() {
+ grep -q "^$1:" $IPKG_INSTROOT/etc/passwd 2>&-
+}
+
+group_exists() {
+ grep -q "^$1:" $IPKG_INSTROOT/etc/group 2>&-
+}
+
+service_exists() {
+ grep -q "^$1[[:space:]]*$2" $IPKG_INSTROOT/etc/services 2>&-
+}
+
+rcconf_exists() {
+ grep -q "^#*$1=" $IPKG_INSTROOT/etc/rc.conf 2>&-
+}
+
+add_user() {
+ user_exists $1 || {
+ echo "adding user $1 to /etc/passwd"
+ echo "$1:x:$2:${3:-$2}:$1:${4:-/tmp}:${5:-/bin/false}" \
+ >>$IPKG_INSTROOT/etc/passwd
+ }
+}
+
+add_group() {
+ group_exists $1 || {
+ echo "adding group $1 to /etc/group"
+ echo "$1:x:$2:$3" >>$IPKG_INSTROOT/etc/group
+ }
+}
+
+add_service() {
+ service_exists $1 $2 || {
+ echo "adding service $1 to /etc/services"
+ printf '%s\t%s\n' "$1" "$2" >>$IPKG_INSTROOT/etc/services
+ }
+}
+
+add_rcconf() {
+ rcconf_exists ${2-$1} || {
+ echo "adding service ${2-$1} to /etc/rc.conf"
+ printf '%s\t\t# %s\n' "${2:-$1}=${3:-NO}" "$1" \
+ >>$IPKG_INSTROOT/etc/rc.conf
+ }
+}
+
+get_next_uid() {
+ uid=1
+ while grep "^[^:]*:[^:]*:$uid:" $IPKG_INSTROOT/etc/passwd \
+ >/dev/null 2>&1; do
+ let uid++
+ done
+ echo $uid
+}
+
+get_next_gid() {
+ gid=1
+ while grep "^[^:]*:[^:]*:$gid:" $IPKG_INSTROOT/etc/group \
+ >/dev/null 2>&1; do
+ let gid++
+ done
+ echo $gid
+}
diff --git a/package/base-files/files/etc/group b/package/base-files/files/etc/group
new file mode 100644
index 000000000..1f444a8bf
--- /dev/null
+++ b/package/base-files/files/etc/group
@@ -0,0 +1,3 @@
+root:x:0:
+admin:x:100:
+nogroup:x:65534:
diff --git a/package/base-files/files/etc/hosts b/package/base-files/files/etc/hosts
new file mode 100644
index 000000000..87d837fc7
--- /dev/null
+++ b/package/base-files/files/etc/hosts
@@ -0,0 +1,2 @@
+::1 localhost
+127.0.0.1 localhost
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
new file mode 100644
index 000000000..c81d7ea65
--- /dev/null
+++ b/package/base-files/files/etc/init.d/boot
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 10
+[[ $1 = autostart ]] || exit 0
+
+. /etc/functions.sh
+
+mkdir -p /var/log
+mkdir -p /var/run
+touch /var/log/lastlog
+touch /var/log/wtmp
+ln -s /var/tmp /tmp
+
+echo 0 > /proc/sys/kernel/printk
+
+HOSTNAME=
+[[ -s /etc/hostname ]] && HOSTNAME=$(cat /etc/hostname)
+HOSTNAME=${HOSTNAME%%.*}
+echo ${HOSTNAME:=linux} >/proc/sys/kernel/hostname
+
+chown 0:0 /tmp; chmod 1777 /tmp
+
+load_modules /etc/modules
+for f in /etc/modules.d/*; do
+ [[ -e $f ]] && load_modules /etc/modules.d/*
+ break
+done
+exit 0
diff --git a/package/base-files/files/etc/init.d/done b/package/base-files/files/etc/init.d/done
new file mode 100644
index 000000000..018d52a43
--- /dev/null
+++ b/package/base-files/files/etc/init.d/done
@@ -0,0 +1,4 @@
+#!/bin/sh
+#FWINIT 98
+[[ $1 = autostart ]] && sysctl -p >&-
+exit 0
diff --git a/package/base-files/files/etc/init.d/rcK b/package/base-files/files/etc/init.d/rcK
new file mode 100755
index 000000000..3cf210fa7
--- /dev/null
+++ b/package/base-files/files/etc/init.d/rcK
@@ -0,0 +1,21 @@
+#!/bin/sh
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+busybox reboot -d 60 -f & # just in case…
+{
+ [[ -f /proc/diag/led/power ]] && echo f >/proc/diag/led/power
+ test -e /etc/rc.shutdown && (/bin/sh /etc/rc.shutdown) 2>&1
+ grep '^#FWINIT ' /etc/init.d/* | \
+ sort -rnk2 | \
+ while read line; do
+ shebang=$(sed -n '1s/^#![ ]*//p' ${line%%:*})
+ case $shebang in
+ *[\ \ ]*) shebang=\'$(echo X"$shebang" | sed \
+ -e 's/^X//' -e "s/'/'\\\\''/g" \
+ -e 's/^\([^ ][^ ]*\)[ ]*$/\1/' \
+ -e 's/^\([^ ][^ ]*\)[ ][ ]*\(..*\)$/\1 \2/' \
+ -e 's/^\([^ ][^ ]*\) /\1'\'' '\''/')\' ;;
+ esac
+ ${shebang:-/bin/sh} ${line%%:*} autostop 2>&1
+ done
+ [[ -f /proc/diag/led/power ]] && echo 0 >/proc/diag/led/power
+} | logger -s -p 6 -t ''
diff --git a/package/base-files/files/etc/init.d/rcS b/package/base-files/files/etc/init.d/rcS
new file mode 100755
index 000000000..f9c47e425
--- /dev/null
+++ b/package/base-files/files/etc/init.d/rcS
@@ -0,0 +1,10 @@
+#!/bin/sh
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+{
+ grep '^#FWINIT ' /etc/init.d/* | \
+ sort -nk2 | \
+ while read line; do
+ /bin/sh ${line%%:*} autostart 2>&1
+ done
+ test -e /etc/init.d/boot.local && (/bin/sh /etc/init.d/boot.local) 2>&1
+} | logger -s -p 6 -t '' &
diff --git a/package/base-files/files/etc/inittab b/package/base-files/files/etc/inittab
new file mode 100644
index 000000000..960ea77d8
--- /dev/null
+++ b/package/base-files/files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS
+::shutdown:/etc/init.d/rcK
+ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100
+
diff --git a/package/base-files/files/etc/ipkg.conf b/package/base-files/files/etc/ipkg.conf
new file mode 100644
index 000000000..6f3a8be2d
--- /dev/null
+++ b/package/base-files/files/etc/ipkg.conf
@@ -0,0 +1,3 @@
+src openadk http://waldemar-brodkorb.de/openadk/downloads/@TARGET@/packages
+dest root /
+dest ram /tmp
diff --git a/package/base-files/files/etc/mdev.conf b/package/base-files/files/etc/mdev.conf
new file mode 100644
index 000000000..61b818523
--- /dev/null
+++ b/package/base-files/files/etc/mdev.conf
@@ -0,0 +1,11 @@
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+console 0:0 0600
+kmem 0:0 000
+mem 0:0 0640
+port 0:0 0640
+ptmx 0:0 666
+tty 0:0 0660
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/package/base-files/files/etc/modules b/package/base-files/files/etc/modules
new file mode 100644
index 000000000..014f40f2b
--- /dev/null
+++ b/package/base-files/files/etc/modules
@@ -0,0 +1 @@
+# add modules to load on startup here
diff --git a/package/base-files/files/etc/network/interfaces b/package/base-files/files/etc/network/interfaces
new file mode 100644
index 000000000..f1bd92ed2
--- /dev/null
+++ b/package/base-files/files/etc/network/interfaces
@@ -0,0 +1,2 @@
+auto lo
+iface lo inet loopback
diff --git a/package/base-files/files/etc/passwd b/package/base-files/files/etc/passwd
new file mode 100644
index 000000000..87eee84af
--- /dev/null
+++ b/package/base-files/files/etc/passwd
@@ -0,0 +1,3 @@
+root:x:0:0:root:/root:/bin/sh
+admin:x:100:100:admin:/tmp:/bin/sh
+nobody:*:65534:65534:nobody:/var:/bin/false
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
new file mode 100644
index 000000000..55002b01f
--- /dev/null
+++ b/package/base-files/files/etc/profile
@@ -0,0 +1,12 @@
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+if [[ $(id -u) = 0 ]]; then
+ export PS1='# '
+else
+ export PS1='$ '
+fi
+export HOME=/tmp
+cat /etc/banner 2>&-
+[ -x /usr/bin/less ] || alias less=more
+[ -x /usr/bin/vim ] || alias vim=vi
+[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
+[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 /lib/ld.so "$@"; }
diff --git a/package/base-files/files/etc/protocols b/package/base-files/files/etc/protocols
new file mode 100644
index 000000000..dfe58ed22
--- /dev/null
+++ b/package/base-files/files/etc/protocols
@@ -0,0 +1,45 @@
+ip 0 IP
+icmp 1 ICMP
+igmp 2 IGMP
+ggp 3 GGP
+ipencap 4 IP-ENCAP
+st 5 ST
+tcp 6 TCP
+egp 8 EGP
+igp 9 IGP
+pup 12 PUP
+udp 17 UDP
+hmp 20 HMP
+xns-idp 22 XNS-IDP
+rdp 27 RDP
+iso-tp4 29 ISO-TP4
+xtp 36 XTP
+ddp 37 DDP
+idpr-cmtp 38 IDPR-CMTP
+ipv6 41 IPv6
+ipv6-route 43 IPv6-Route
+ipv6-frag 44 IPv6-Frag
+idrp 45 IDRP
+rsvp 46 RSVP
+gre 47 GRE
+esp 50 IPSEC-ESP
+ah 51 IPSEC-AH
+skip 57 SKIP
+ipv6-icmp 58 IPv6-ICMP
+ipv6-nonxt 59 IPv6-NoNxt
+ipv6-opts 60 IPv6-Opts
+rspf 73 RSPF CPHB
+vmtp 81 VMTP
+eigrp 88 EIGRP
+ospf 89 OSPFIGP
+ax.25 93 AX.25
+ipip 94 IPIP
+etherip 97 ETHERIP
+encap 98 ENCAP
+pim 103 PIM
+ipcomp 108 IPCOMP
+vrrp 112 VRRP
+l2tp 115 L2TP
+isis 124 ISIS
+sctp 132 SCTP
+fc 133 FC
diff --git a/package/base-files/files/etc/rc.conf b/package/base-files/files/etc/rc.conf
new file mode 100644
index 000000000..024007589
--- /dev/null
+++ b/package/base-files/files/etc/rc.conf
@@ -0,0 +1,3 @@
+# set variables service=YES|NO (YES to enable, NO to disable)
+# set variables service_flags="X" (NO to disable the service)
+# note: for flags, X can be empty
diff --git a/package/base-files/files/etc/shadow b/package/base-files/files/etc/shadow
new file mode 100644
index 000000000..3683d71ea
--- /dev/null
+++ b/package/base-files/files/etc/shadow
@@ -0,0 +1,3 @@
+root:$1$8sJkb6fV$46vEIu5ntmbUuljmr55zY/:14191:0:::::
+admin:$1$8sJkb6fV$46vEIu5ntmbUuljmr55zY/:14191:0:::::
+nobody:*:9797:0:::::
diff --git a/package/base-files/files/etc/sysctl.conf b/package/base-files/files/etc/sysctl.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/package/base-files/files/etc/sysctl.conf
diff --git a/package/base-files/files/init b/package/base-files/files/init
new file mode 100755
index 000000000..567993cbb
--- /dev/null
+++ b/package/base-files/files/init
@@ -0,0 +1,18 @@
+#!/bin/sh
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+mount -nt proc proc /proc
+mount -o nosuid,nodev,noexec -t sysfs sysfs /sys
+mount none /tmp -t tmpfs -o size=2M
+mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
+mount -o nosuid,size=64k,mode=0755 -t tmpfs mdev /dev
+mkdir /dev/pts /dev/shm
+mount -o nosuid,noexec -t devpts devpts /dev/pts
+exec 0<>/dev/console >&0 2>&0
+echo >/dev/mdev.seq
+echo "/sbin/mdev" >/proc/sys/kernel/hotplug
+mdev -s
+mount -o remount,rw /
+cat /etc/.rnd >/dev/urandom 2>&1
+[ -f /etc/fstab ] && mount -a
+[ -x /sbin/cfgfs ] && { cfgfs setup; mount -o remount,ro /;}
+exec /sbin/init
diff --git a/package/base-files/files/lib/mdev/init b/package/base-files/files/lib/mdev/init
new file mode 100644
index 000000000..d2ae13e9c
--- /dev/null
+++ b/package/base-files/files/lib/mdev/init
@@ -0,0 +1,21 @@
+#!/bin/sh
+if [ "$ACTION" == "add" ];then
+ if [ "$DEVPATH" == "/bus/usb" ];then
+ mount -t usbfs usbfs /proc/bus/usb
+ fi
+fi
+if [ "$SUBSYSTEM" == "firmware" ];then
+ logger "Firmware load for $FIRMWARE requested"
+ if [ "$ACTION" == "add" ];then
+ if [ -e "/lib/firmware/$FIRMWARE" ];then
+ logger "Firmware loading ..."
+ echo 1 > /sys$DEVPATH/loading
+ cat "/lib/firmware/$FIRMWARE" > /sys$DEVPATH/data
+ echo 0 > /sys$DEVPATH/loading
+ logger "finished."
+ else
+ logger "Firmware file $FIRMWARE not found"
+ echo -1 > /sys$DEVPATH/loading
+ fi
+ fi
+fi
diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script
new file mode 100755
index 000000000..02e4a7a3c
--- /dev/null
+++ b/package/base-files/files/usr/share/udhcpc/default.script
@@ -0,0 +1,38 @@
+#!/bin/sh
+if [[ -z $1 ]]; then
+ echo "Error: should be run by udhcpc"
+ exit 1
+fi
+
+RESOLV_CONF=/tmp/resolv.conf
+
+case $1 in
+(deconfig)
+ ip addr flush $interface
+ ;;
+(renew|bound)
+ ip addr add $ip/${mask:-24} brd + dev $interface
+
+ if [[ -n $router ]]; then
+ echo "deleting routers"
+ while ip route del default >&- 2>&-; do :; done
+
+ for i in $router; do
+ echo "adding router $i"
+ ip route add to default via $i
+ done
+ fi
+
+ echo -n >$RESOLV_CONF
+ ${domain:+echo search $domain} >>$RESOLV_CONF
+ for i in $dns; do
+ echo "adding dns $i"
+ echo "nameserver $i" >>$RESOLV_CONF
+ done
+
+ # user rules
+ [ -f /etc/udhcpc.user ] && . /etc/udhcpc.user
+;;
+esac
+
+exit $?
diff --git a/package/base-files/ipkg/base-files.conffiles b/package/base-files/ipkg/base-files.conffiles
new file mode 100644
index 000000000..2495e2ee4
--- /dev/null
+++ b/package/base-files/ipkg/base-files.conffiles
@@ -0,0 +1,13 @@
+/etc/banner
+/etc/group
+/etc/hosts
+/etc/ipkg.conf
+/etc/modules
+/etc/passwd
+/etc/profile
+/etc/protocols
+/etc/sysctl.conf
+/etc/network/interfaces
+/etc/rc.conf
+/etc/sysctl.conf
+/etc/shadow
diff --git a/package/base-files/ipkg/base-files.control b/package/base-files/ipkg/base-files.control
new file mode 100644
index 000000000..00e2d7746
--- /dev/null
+++ b/package/base-files/ipkg/base-files.control
@@ -0,0 +1,3 @@
+Priority: base
+Section: base
+Description: basic filesystem structure and scripts
diff --git a/package/bash/Config.in b/package/bash/Config.in
new file mode 100644
index 000000000..db966be01
--- /dev/null
+++ b/package/bash/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_BASH
+ prompt "bash.............................. GNU Bourne-Again SHell"
+ tristate
+ default n
+ help
+ GNU Bourne-Again SHell
+
+ http://www.gnu.org/software/bash/
diff --git a/package/bash/Makefile b/package/bash/Makefile
new file mode 100644
index 000000000..3b348d753
--- /dev/null
+++ b/package/bash/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= bash
+PKG_VERSION:= 4.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a90a1b5a6db4838483f05438e05e8eb9
+MASTER_SITES:= http://ftp.gnu.org/gnu/bash/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,BASH,bash,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+XAKE_FLAGS+= LIBS_FOR_BUILD=''
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_BASH)/bin
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/bash $(IDIR_BASH)/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bash/ipkg/bash.control b/package/bash/ipkg/bash.control
new file mode 100644
index 000000000..46acdcdbc
--- /dev/null
+++ b/package/bash/ipkg/bash.control
@@ -0,0 +1,4 @@
+Package: bash
+Priority: optional
+Section: shells
+Description: bash shell
diff --git a/package/bc/Config.in b/package/bc/Config.in
new file mode 100644
index 000000000..cae451a06
--- /dev/null
+++ b/package/bc/Config.in
@@ -0,0 +1,22 @@
+config ADK_COMPILE_BC
+ tristate
+ depends ADK_PACKAGE_BC || ADK_PACKAGE_DC
+ default n
+
+config ADK_PACKAGE_BC
+ prompt "bc................................ Arbitrary precision calculator language"
+ tristate
+ default n
+ select ADK_COMPILE_BC
+ help
+ bc is a language that supports arbitrary precision numbers with
+ interactive execution of statements.
+
+config ADK_PACKAGE_DC
+ prompt "dc................................ Arbitrary precision calculator"
+ tristate
+ default n
+ select ADK_COMPILE_BC
+ help
+ dc is a reverse-polish desk calculator which supports unlimited
+ precision arithmetic.
diff --git a/package/bc/Makefile b/package/bc/Makefile
new file mode 100644
index 000000000..f48912f7f
--- /dev/null
+++ b/package/bc/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bc
+PKG_VERSION:= 1.06
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d44b5dddebd8a7a7309aea6c36fda117
+MASTER_SITES:= http://ftp.gnu.org/pub/gnu/bc/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BC,bc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,DC,dc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ # bc
+ ${INSTALL_DIR} ${IDIR_BC}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/bc/bc ${IDIR_BC}/usr/bin/bc
+ # dc
+ ${INSTALL_DIR} ${IDIR_DC}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/dc/dc ${IDIR_DC}/usr/bin/dc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bc/ipkg/bc.control b/package/bc/ipkg/bc.control
new file mode 100644
index 000000000..e22ed5b7c
--- /dev/null
+++ b/package/bc/ipkg/bc.control
@@ -0,0 +1,4 @@
+Package: bc
+Priority: optional
+Section: util
+Description: An arbitrary precision calculator language
diff --git a/package/bc/ipkg/dc.control b/package/bc/ipkg/dc.control
new file mode 100644
index 000000000..1ef852500
--- /dev/null
+++ b/package/bc/ipkg/dc.control
@@ -0,0 +1,4 @@
+Package: dc
+Priority: optional
+Section: util
+Description: An arbitrary precision calculator
diff --git a/package/bigreqsproto/Config.in b/package/bigreqsproto/Config.in
new file mode 100644
index 000000000..2c061f882
--- /dev/null
+++ b/package/bigreqsproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_BIGREQSPROTO
+ prompt "bigreqsproto.......................... X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/bigreqsproto/Makefile b/package/bigreqsproto/Makefile
new file mode 100644
index 000000000..6ee40f266
--- /dev/null
+++ b/package/bigreqsproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= bigreqsproto
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d43f7faa2aac2f0206ea19f031494af1
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bigreqsproto/ipkg/bigreqsproto.control b/package/bigreqsproto/ipkg/bigreqsproto.control
new file mode 100644
index 000000000..f5fa1d66b
--- /dev/null
+++ b/package/bigreqsproto/ipkg/bigreqsproto.control
@@ -0,0 +1,4 @@
+Package: bigreqsproto
+Priority: optional
+Section: x11
+Description: Xproto headers
diff --git a/package/bind/Config.in b/package/bind/Config.in
new file mode 100644
index 000000000..b9eef008a
--- /dev/null
+++ b/package/bind/Config.in
@@ -0,0 +1,136 @@
+config ADK_COMPILE_BIND
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+
+config ADK_DUMMY_BIND
+ prompt "bind.............................. A DNS server implementation"
+ tristate
+ default n
+
+config ADK_PACKAGE_BIND_TOOLS
+ prompt "bind-tools........................ Bind administration tools"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ dig, host, nsupdate, dnssec-keygen, dnssec-signzone, named-checkconf,
+ named-checkzone, rndc, rndc-confgen
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+config ADK_PACKAGE_BIND_RNDC
+ prompt "bind-rndc......................... Bind administration tools (rndc & rndc-confgen only)"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ rndc, rndc-confgen
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+config ADK_PACKAGE_BIND_CHECK
+ prompt "bind-check........................ Bind administration tools (named-checkconf & named-checkzone only)"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ named-checkconf, named-checkzone
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+config ADK_PACKAGE_BIND_DNSSEC
+ prompt "bind-dnssec....................... Bind administration tools (dnssec-keygen & dnssec-signzone only)"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ dnssec-keygen, dnssec-signzone
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+config ADK_PACKAGE_BIND_HOST
+ prompt "bind-host......................... A simple DNS client"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ host
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+config ADK_PACKAGE_BIND_DIG
+ prompt "bind-dig.......................... A DNS client"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ dig
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+
+config ADK_PACKAGE_BIND_CLIENT
+ prompt "bind-client....................... A dynamic DNS client"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ A DNS dynamic client (nsupdate)
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+config ADK_PACKAGE_BIND_SERVER
+ prompt "bind-server....................... A DNS server"
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ select ADK_PACKAGE_LIBBIND
+ help
+ A DNS server (named)
+
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
+
+config ADK_PACKAGE_LIBBIND
+ prompt "libbind........................... Support library for the bind tools and dns server/client."
+ tristate
+ default n
+ depends ADK_DUMMY_BIND
+ select ADK_COMPILE_BIND
+ help
+ http://www.isc.org/sw/bind/
+
+ Depends: libopenssl
+
diff --git a/package/bind/Makefile b/package/bind/Makefile
new file mode 100644
index 000000000..e186966d3
--- /dev/null
+++ b/package/bind/Makefile
@@ -0,0 +1,92 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bind
+PKG_VERSION:= 9.4.1
+PKG_RELEASE:= 4
+PKG_MD5SUM:= 09b54d35036cb0423b2e618f21766285
+MASTER_SITES:= ftp://ftp.isc.org/isc/bind9/${PKG_VERSION}/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BIND_SERVER,bind-server,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BIND_CLIENT,bind-client,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBBIND,libbind,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BIND_TOOLS,bind-tools,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BIND_RNDC,bind-rndc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BIND_CHECK,bind-check,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BIND_DNSSEC,bind-dnssec,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BIND_HOST,bind-host,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BIND_DIG,bind-dig,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= BUILD_CC="${TARGET_CC}"
+CONFIGURE_ARGS+= --with-randomdev=/dev/urandom \
+ --disable-threads \
+ --with-openssl=${STAGING_DIR}/usr/ \
+ --with-libtool
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+pre-build:
+ ${MAKE} -C ${WRKBUILD}/lib/dns \
+ BUILD_CC="${HOSTCC}" \
+ CC="${HOSTCC}" \
+ CFLAGS='${HOSTCFLAGS}' \
+ gen
+
+post-install:
+ # bind server
+ ${INSTALL_DIR} ${IDIR_BIND_SERVER}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_BIND_SERVER}/etc/init.d
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/named ${IDIR_BIND_SERVER}/usr/sbin/
+ ${CP} ./files/bind ${IDIR_BIND_SERVER}/etc
+ ${INSTALL_BIN} ./files/named.init \
+ ${IDIR_BIND_SERVER}/etc/init.d/named
+ find ${IDIR_BIND_SERVER}/etc/bind -name ".svn" | xargs rm -rf
+ # nsupdate
+ ${INSTALL_DIR} ${IDIR_BIND_CLIENT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/nsupdate ${IDIR_BIND_CLIENT}/usr/bin/
+ # bind all tools
+ ${INSTALL_DIR} ${IDIR_BIND_TOOLS}/usr/bin
+ ${INSTALL_DIR} ${IDIR_BIND_TOOLS}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/dig ${IDIR_BIND_TOOLS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/host ${IDIR_BIND_TOOLS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dnssec-keygen ${IDIR_BIND_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dnssec-signzone ${IDIR_BIND_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/named-checkconf ${IDIR_BIND_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/named-checkzone ${IDIR_BIND_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/rndc ${IDIR_BIND_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/rndc-confgen ${IDIR_BIND_TOOLS}/usr/sbin/
+ # rndc
+ ${INSTALL_DIR} ${IDIR_BIND_RNDC}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/rndc ${IDIR_BIND_RNDC}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/rndc-confgen ${IDIR_BIND_RNDC}/usr/sbin/
+ # bind check
+ ${INSTALL_DIR} ${IDIR_BIND_CHECK}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/named-checkconf ${IDIR_BIND_CHECK}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/named-checkzone ${IDIR_BIND_CHECK}/usr/sbin/
+ # dnsec tools
+ ${INSTALL_DIR} ${IDIR_BIND_DNSSEC}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dnssec-keygen ${IDIR_BIND_DNSSEC}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dnssec-signzone ${IDIR_BIND_DNSSEC}/usr/sbin/
+ # host
+ ${INSTALL_DIR} ${IDIR_BIND_HOST}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/host ${IDIR_BIND_HOST}/usr/bin/
+ # dig
+ ${INSTALL_DIR} ${IDIR_BIND_DIG}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/dig ${IDIR_BIND_DIG}/usr/bin/
+ # bind lib
+ ${INSTALL_DIR} ${IDIR_LIBBIND}/usr/lib
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/libbind9.so.30 ${IDIR_LIBBIND}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/libdns.so.32 ${IDIR_LIBBIND}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/libisccc.so.30 ${IDIR_LIBBIND}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/libisccfg.so.30 ${IDIR_LIBBIND}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/libisc.so.32 ${IDIR_LIBBIND}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/liblwres.so.30 ${IDIR_LIBBIND}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bind/files/bind/db.0 b/package/bind/files/bind/db.0
new file mode 100644
index 000000000..e3aabdbee
--- /dev/null
+++ b/package/bind/files/bind/db.0
@@ -0,0 +1,12 @@
+;
+; BIND reverse data file for broadcast zone
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
diff --git a/package/bind/files/bind/db.127 b/package/bind/files/bind/db.127
new file mode 100644
index 000000000..cd05bef14
--- /dev/null
+++ b/package/bind/files/bind/db.127
@@ -0,0 +1,13 @@
+;
+; BIND reverse data file for local loopback interface
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
+1.0.0 IN PTR localhost.
diff --git a/package/bind/files/bind/db.255 b/package/bind/files/bind/db.255
new file mode 100644
index 000000000..e3aabdbee
--- /dev/null
+++ b/package/bind/files/bind/db.255
@@ -0,0 +1,12 @@
+;
+; BIND reverse data file for broadcast zone
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
diff --git a/package/bind/files/bind/db.local b/package/bind/files/bind/db.local
new file mode 100644
index 000000000..66b489235
--- /dev/null
+++ b/package/bind/files/bind/db.local
@@ -0,0 +1,13 @@
+;
+; BIND data file for local loopback interface
+;
+$TTL 604800
+@ IN SOA localhost. root.localhost. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS localhost.
+@ IN A 127.0.0.1
diff --git a/package/bind/files/bind/db.root b/package/bind/files/bind/db.root
new file mode 100644
index 000000000..01c20f047
--- /dev/null
+++ b/package/bind/files/bind/db.root
@@ -0,0 +1,45 @@
+
+; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net.
+;; global options: printcmd
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944
+;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
+
+;; QUESTION SECTION:
+;. IN NS
+
+;; ANSWER SECTION:
+. 518400 IN NS A.ROOT-SERVERS.NET.
+. 518400 IN NS B.ROOT-SERVERS.NET.
+. 518400 IN NS C.ROOT-SERVERS.NET.
+. 518400 IN NS D.ROOT-SERVERS.NET.
+. 518400 IN NS E.ROOT-SERVERS.NET.
+. 518400 IN NS F.ROOT-SERVERS.NET.
+. 518400 IN NS G.ROOT-SERVERS.NET.
+. 518400 IN NS H.ROOT-SERVERS.NET.
+. 518400 IN NS I.ROOT-SERVERS.NET.
+. 518400 IN NS J.ROOT-SERVERS.NET.
+. 518400 IN NS K.ROOT-SERVERS.NET.
+. 518400 IN NS L.ROOT-SERVERS.NET.
+. 518400 IN NS M.ROOT-SERVERS.NET.
+
+;; ADDITIONAL SECTION:
+A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4
+B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201
+C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12
+D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90
+E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10
+F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241
+G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4
+H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53
+I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17
+J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30
+K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129
+L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12
+M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33
+
+;; Query time: 81 msec
+;; SERVER: 198.41.0.4#53(a.root-servers.net.)
+;; WHEN: Sun Feb 1 11:27:14 2004
+;; MSG SIZE rcvd: 436
+
diff --git a/package/bind/files/bind/named.conf.example b/package/bind/files/bind/named.conf.example
new file mode 100644
index 000000000..162454955
--- /dev/null
+++ b/package/bind/files/bind/named.conf.example
@@ -0,0 +1,45 @@
+// This is the primary configuration file for the BIND DNS server named.
+
+options {
+ directory "/tmp";
+
+ // If your ISP provided one or more IP addresses for stable
+ // nameservers, you probably want to use them as forwarders.
+ // Uncomment the following block, and insert the addresses replacing
+ // the all-0's placeholder.
+
+ // forwarders {
+ // 0.0.0.0;
+ // };
+
+ auth-nxdomain no; # conform to RFC1035
+};
+
+// prime the server with knowledge of the root servers
+zone "." {
+ type hint;
+ file "/etc/bind/db.root";
+};
+
+// be authoritative for the localhost forward and reverse zones, and for
+// broadcast zones as per RFC 1912
+
+zone "localhost" {
+ type master;
+ file "/etc/bind/db.local";
+};
+
+zone "127.in-addr.arpa" {
+ type master;
+ file "/etc/bind/db.127";
+};
+
+zone "0.in-addr.arpa" {
+ type master;
+ file "/etc/bind/db.0";
+};
+
+zone "255.in-addr.arpa" {
+ type master;
+ file "/etc/bind/db.255";
+};
diff --git a/package/bind/files/named.init b/package/bind/files/named.init
new file mode 100644
index 000000000..1838eefee
--- /dev/null
+++ b/package/bind/files/named.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+ autostart)
+ test x"${named:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+ start)
+ if [ -f /etc/bind/named.conf ]; then
+ named -c /etc/bind/named.conf
+ fi
+ ;;
+ stop)
+ killall named
+ ;;
+ restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/bind/ipkg/bind-check.control b/package/bind/ipkg/bind-check.control
new file mode 100644
index 000000000..ba90d8274
--- /dev/null
+++ b/package/bind/ipkg/bind-check.control
@@ -0,0 +1,5 @@
+Package: bind-check
+Priority: optional
+Section: net
+Description: named-checkconf & named-checkzone utilities
+Depends: libopenssl libbind
diff --git a/package/bind/ipkg/bind-client.control b/package/bind/ipkg/bind-client.control
new file mode 100644
index 000000000..fa20c18a3
--- /dev/null
+++ b/package/bind/ipkg/bind-client.control
@@ -0,0 +1,5 @@
+Package: bind-client
+Priority: optional
+Section: net
+Description: dynamic dns client
+Depends: libopenssl libbind
diff --git a/package/bind/ipkg/bind-dig.control b/package/bind/ipkg/bind-dig.control
new file mode 100644
index 000000000..e91e30066
--- /dev/null
+++ b/package/bind/ipkg/bind-dig.control
@@ -0,0 +1,5 @@
+Package: bind-dig
+Priority: optional
+Section: net
+Description: dig utility
+Depends: libopenssl libbind
diff --git a/package/bind/ipkg/bind-dnssec.control b/package/bind/ipkg/bind-dnssec.control
new file mode 100644
index 000000000..c7c213617
--- /dev/null
+++ b/package/bind/ipkg/bind-dnssec.control
@@ -0,0 +1,5 @@
+Package: bind-dnssec
+Priority: optional
+Section: net
+Description: dnssec-keygen & dnssec-signzone utilities
+Depends: libopenssl libbind
diff --git a/package/bind/ipkg/bind-host.control b/package/bind/ipkg/bind-host.control
new file mode 100644
index 000000000..20440381a
--- /dev/null
+++ b/package/bind/ipkg/bind-host.control
@@ -0,0 +1,6 @@
+Package: bind-host
+Priority: optional
+Section: net
+Description: host utility
+Depends: libopenssl libbind
+
diff --git a/package/bind/ipkg/bind-rndc.control b/package/bind/ipkg/bind-rndc.control
new file mode 100644
index 000000000..a0eee7ebb
--- /dev/null
+++ b/package/bind/ipkg/bind-rndc.control
@@ -0,0 +1,5 @@
+Package: bind-rndc
+Priority: optional
+Section: net
+Description: rndc & rndc-confgen utilities
+Depends: libopenssl libbind
diff --git a/package/bind/ipkg/bind-server.conffiles b/package/bind/ipkg/bind-server.conffiles
new file mode 100644
index 000000000..c4cfe37d5
--- /dev/null
+++ b/package/bind/ipkg/bind-server.conffiles
@@ -0,0 +1,6 @@
+/etc/bind/named.conf.example
+/etc/bind/db.0
+/etc/bind/db.127
+/etc/bind/db.255
+/etc/bind/db.local
+/etc/bind/db.root
diff --git a/package/bind/ipkg/bind-server.control b/package/bind/ipkg/bind-server.control
new file mode 100644
index 000000000..73b10d2f2
--- /dev/null
+++ b/package/bind/ipkg/bind-server.control
@@ -0,0 +1,6 @@
+Package: bind-server
+Priority: optional
+Section: net
+Description: popular dns server
+Depends: libopenssl libbind
+Conflicts: dnsmasq
diff --git a/package/bind/ipkg/bind-server.postinst b/package/bind/ipkg/bind-server.postinst
new file mode 100644
index 000000000..bca89fd22
--- /dev/null
+++ b/package/bind/ipkg/bind-server.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf named named NO
diff --git a/package/bind/ipkg/bind-tools.control b/package/bind/ipkg/bind-tools.control
new file mode 100644
index 000000000..623d0a547
--- /dev/null
+++ b/package/bind/ipkg/bind-tools.control
@@ -0,0 +1,5 @@
+Package: bind-tools
+Priority: optional
+Section: net
+Description: dig, host, nslookup, nsupdate, dnssec-keygen, dnssec-signzone, named-checkconf, named-checkzone, rndc, rndc-confgen
+Depends: libopenssl libbind
diff --git a/package/bind/ipkg/libbind.control b/package/bind/ipkg/libbind.control
new file mode 100644
index 000000000..5b4e86674
--- /dev/null
+++ b/package/bind/ipkg/libbind.control
@@ -0,0 +1,4 @@
+Package: libbind
+Priority: optional
+Section: libs
+Description: Support library for the bind tools and dns server/client.
diff --git a/package/bind/patches/patch-lib_isc_unix_ifiter_ioctl_c b/package/bind/patches/patch-lib_isc_unix_ifiter_ioctl_c
new file mode 100644
index 000000000..adb2aa906
--- /dev/null
+++ b/package/bind/patches/patch-lib_isc_unix_ifiter_ioctl_c
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- bind-9.4.1.orig/lib/isc/unix/ifiter_ioctl.c 2006-02-04 00:51:38.000000000 +0100
++++ bind-9.4.1/lib/isc/unix/ifiter_ioctl.c 2008-10-08 14:56:12.000000000 +0200
+@@ -479,8 +479,8 @@ linux_if_inet6_current(isc_interfaceiter
+ for (i = 0; i < 16; i++) {
+ unsigned char byte;
+ static const char hex[] = "0123456789abcdef";
+- byte = ((index(hex, address[i * 2]) - hex) << 4) |
+- (index(hex, address[i * 2 + 1]) - hex);
++ byte = ((strchr(hex, address[i * 2]) - hex) << 4) |
++ (strchr(hex, address[i * 2 + 1]) - hex);
+ addr6.s6_addr[i] = byte;
+ }
+ iter->current.af = AF_INET6;
diff --git a/package/binutils/Config.in b/package/binutils/Config.in
new file mode 100644
index 000000000..a6f9fbf43
--- /dev/null
+++ b/package/binutils/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_BINUTILS
+ prompt "binutils.......................... binary utilities (assembler,strip,nm,..)"
+ tristate
+ default n
+ help
+ binary utilities
+
+ http://www.gnu.org/binutils
diff --git a/package/binutils/Makefile b/package/binutils/Makefile
new file mode 100644
index 000000000..10f71c805
--- /dev/null
+++ b/package/binutils/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+include ${TOPDIR}/toolchain/binutils/Makefile.inc
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BINUTILS,binutils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-werror
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-patch:
+ ${PREVENT_PATCH} ${PATCH} ${WRKDIST} \
+ ${TOPDIR}/toolchain/binutils/${BINUTILS_VERSION} \*.patch
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_BINUTILS}/usr/lib
+ $(CP) ${WRKINST}/usr/lib/*.so ${IDIR_BINUTILS}/usr/lib
+ ${INSTALL_DIR} ${IDIR_BINUTILS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/nm ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/size ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ar ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/as ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ld ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/strip ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/objdump ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/objcopy ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ranlib ${IDIR_BINUTILS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/readelf ${IDIR_BINUTILS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/binutils/ipkg/binutils.control b/package/binutils/ipkg/binutils.control
new file mode 100644
index 000000000..bf98f2634
--- /dev/null
+++ b/package/binutils/ipkg/binutils.control
@@ -0,0 +1,4 @@
+Package: binutils
+Priority: optional
+Section: comp
+Description: binary utilities
diff --git a/package/bitlbee/Config.in b/package/bitlbee/Config.in
new file mode 100644
index 000000000..086b6e800
--- /dev/null
+++ b/package/bitlbee/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_BITLBEE
+ prompt "bitlbee........................... IRC gateway to IM chat networks"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_GLIB2
+ select ADK_PACKAGE_LIBICONV
+ help
+
+ BitlBee is an IRC daemon that can talk to instant messaging
+ networks and acts as a gateway. Users can connect to the
+ server with any normal IRC client and see their 'buddy list'
+ in #bitlbee.
+
+ http://www.bitlbee.org/
diff --git a/package/bitlbee/Makefile b/package/bitlbee/Makefile
new file mode 100644
index 000000000..7e08a34a0
--- /dev/null
+++ b/package/bitlbee/Makefile
@@ -0,0 +1,68 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bitlbee
+PKG_VERSION:= 1.2.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2b1674d98804970809de3da3edf0bed2
+MASTER_SITES:= http://get.bitlbee.org/src/ \
+ http://get.bitlbee.be/src/ \
+ http://get.us.bitlbee.org/src/ \
+ http://ftp.snt.utwente.nl/pub/software/bitlbee/src/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BITLBEE,bitlbee,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+ifeq ($(ADK_IPV6),y)
+IPV6+= --ipv6=1
+else
+IPV6+= --ipv6=0
+endif
+
+do-configure:
+ (cd $(WRKBUILD); \
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+ LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
+ STAGING_DIR="$(STAGING_DIR)" \
+ STRIP="$(STRIP)" \
+ ./configure \
+ --prefix=/usr/ \
+ --bindir=/usr/sbin/ \
+ --etcdir=/etc/bitlbee/ \
+ --datadir=/usr/share/bitlbee/ \
+ --config=/var/lib/bitlbee/ \
+ --arch=Linux \
+ --cpu="${ARCH}" \
+ --debug=0 \
+ --strip=1 \
+ --ssl=openssl \
+ --target=${REAL_GNU_TARGET_NAME} \
+ ${IPV6} \
+ );
+
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+INSTALL_TARGET= install-etc install-bin
+
+post-configure:
+ @echo 'CFLAGS+="-I${STAGING_DIR}/usr/include/iconv"' >> \
+ ${WRKBUILD}/Makefile.settings
+ @echo 'LFLAGS+="-L${STAGING_DIR}/usr/lib/iconv"' >> \
+ ${WRKBUILD}/Makefile.settings
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_BITLBEE}/etc/bitlbee
+ ${INSTALL_DIR} ${IDIR_BITLBEE}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_BITLBEE}/usr/sbin
+ ${INSTALL_DATA} ${WRKINST}/etc/bitlbee/* ${IDIR_BITLBEE}/etc/bitlbee
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/bitlbee ${IDIR_BITLBEE}/usr/sbin
+ ${INSTALL_BIN} ./files/bitlbee.init \
+ ${IDIR_BITLBEE}/etc/init.d/bitlbee
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bitlbee/files/bitlbee.init b/package/bitlbee/files/bitlbee.init
new file mode 100644
index 000000000..3ff950a9c
--- /dev/null
+++ b/package/bitlbee/files/bitlbee.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${bitlbee:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p /var/lib/bitlbee
+ bitlbee -D
+ ;;
+stop)
+ killall bitlbee
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/bitlbee/ipkg/bitlbee.conffiles b/package/bitlbee/ipkg/bitlbee.conffiles
new file mode 100644
index 000000000..2ccc958d5
--- /dev/null
+++ b/package/bitlbee/ipkg/bitlbee.conffiles
@@ -0,0 +1,2 @@
+/etc/bitlbee/motd.txt
+/etc/bitlbee/bitlbee.conf
diff --git a/package/bitlbee/ipkg/bitlbee.control b/package/bitlbee/ipkg/bitlbee.control
new file mode 100644
index 000000000..37ca895c8
--- /dev/null
+++ b/package/bitlbee/ipkg/bitlbee.control
@@ -0,0 +1,5 @@
+Package: bitlbee
+Priority: optional
+Section: net
+Depends: glib2, libopenssl, libiconv
+Description: IRC gateway to IM chat networks
diff --git a/package/bitlbee/ipkg/bitlbee.postinst b/package/bitlbee/ipkg/bitlbee.postinst
new file mode 100644
index 000000000..a8e3b2ec4
--- /dev/null
+++ b/package/bitlbee/ipkg/bitlbee.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf bitlbee
diff --git a/package/bitlbee/patches/patch-configure b/package/bitlbee/patches/patch-configure
new file mode 100644
index 000000000..9f13c535c
--- /dev/null
+++ b/package/bitlbee/patches/patch-configure
@@ -0,0 +1,40 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- bitlbee-1.2.3.orig/configure 2008-09-06 14:33:13.000000000 +0200
++++ bitlbee-1.2.3/configure 2008-10-08 16:07:32.000000000 +0200
+@@ -19,7 +19,6 @@ libevent='/usr/'
+ pidfile='/var/run/bitlbee.pid'
+ ipcsocket='/var/run/bitlbee.sock'
+ pcdir='$prefix/lib/pkgconfig'
+-systemlibdirs="/lib /usr/lib /usr/local/lib"
+
+ msn=1
+ jabber=1
+@@ -137,12 +136,8 @@ EOF
+
+
+ if [ -n "$target" ]; then
+- PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
+- export PKG_CONFIG_LIBDIR
+- PATH=/usr/$target/bin:$PATH
+- CC=$target-cc
++ CC=$target-gcc
+ LD=$target-ld
+- systemlibdirs="/usr/$target/lib"
+ fi
+
+
+@@ -348,14 +343,6 @@ fi;
+
+ echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings
+
+-for i in $systemlibdirs; do
+- if [ -f $i/libresolv.a ]; then
+- echo '#define HAVE_RESOLV_A' >> config.h
+- echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings
+- break
+- fi
+-done
+-
+ STORAGES="text xml"
+
+ if [ "$ldap" = "auto" ]; then
diff --git a/package/bluez-firmware/Config.in b/package/bluez-firmware/Config.in
new file mode 100644
index 000000000..15aed3102
--- /dev/null
+++ b/package/bluez-firmware/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_BLUEZ_FIRMWARE
+ prompt "bluez-firmware.................... Bluetooth firmware files"
+ tristate
+ default n
+ select ADK_PACKAGE_BLUEZ
+ help
+ Bluez firmware files for BCM2033 USB adapters.
+
+ http://www.bluez.org
+
diff --git a/package/bluez-firmware/Makefile b/package/bluez-firmware/Makefile
new file mode 100644
index 000000000..1d0b5b5aa
--- /dev/null
+++ b/package/bluez-firmware/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bluez-firmware
+PKG_VERSION:= 1.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1cc3cefad872e937e05de5a0a2b390dd
+MASTER_SITES:= http://bluez.sourceforge.net/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BLUEZ_FIRMWARE,bluez-firmware,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --libdir=/lib
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_BLUEZ_FIRMWARE}/lib/firmware
+ ${CP} ${WRKINST}/lib/firmware/BCM* \
+ ${IDIR_BLUEZ_FIRMWARE}/lib/firmware
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bluez-firmware/ipkg/bluez-firmware.control b/package/bluez-firmware/ipkg/bluez-firmware.control
new file mode 100644
index 000000000..4b5a794ff
--- /dev/null
+++ b/package/bluez-firmware/ipkg/bluez-firmware.control
@@ -0,0 +1,5 @@
+Package: bluez-firmware
+Priority: optional
+Section: bluetooth
+Description: Bluez firmware for BCM2033
+Depends: kmod-bluetooth, bluez-libs, bluez-utils
diff --git a/package/bluez/Config.in b/package/bluez/Config.in
new file mode 100644
index 000000000..3bb4c4a37
--- /dev/null
+++ b/package/bluez/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_BLUEZ
+ prompt "bluez............................. Bluetooth library and tools"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_BT
+ help
+ Bluez libs and apps.
+
+ http://bluez.org
+
diff --git a/package/bluez/Makefile b/package/bluez/Makefile
new file mode 100644
index 000000000..7e9c4b89e
--- /dev/null
+++ b/package/bluez/Makefile
@@ -0,0 +1,47 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bluez
+PKG_VERSION:= 4.12
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e599d7f4ed7e022c85e485934f29a340
+MASTER_SITES:= ${MASTER_SITE_KERNEL:=bluetooth/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BLUEZ,bluez,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-tools \
+ --enable-alsa \
+ --enable-usb \
+ --enable-bccmd \
+ --enable-hidd \
+ --enable-pand \
+ --enable-dund \
+ --disable-cups
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_BLUEZ}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libbluetooth.so.* ${IDIR_BLUEZ}/usr/lib/
+ ${INSTALL_DIR} $(IDIR_BLUEZ)/etc/dbus-1/system.d
+ ${INSTALL_DIR} ${IDIR_BLUEZ}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_BLUEZ}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_BLUEZ}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/* ${IDIR_BLUEZ}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_BLUEZ}/etc/bluetooth
+ ${CP} ${WRKINST}/etc/bluetooth/rfcomm.conf \
+ ${IDIR_BLUEZ}/etc/bluetooth/
+ $(INSTALL_DATA) $(WRKINST)/etc/dbus-1/system.d/bluetooth.conf \
+ $(IDIR_BLUEZ)/etc/dbus-1/system.d
+ ${INSTALL_DIR} ${IDIR_BLUEZ}/etc/init.d
+ ${INSTALL_BIN} ./files/bluez.init \
+ ${IDIR_BLUEZ}/etc/init.d/bluez
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bluez/files/bluez.init b/package/bluez/files/bluez.init
new file mode 100644
index 000000000..20c128ad0
--- /dev/null
+++ b/package/bluez/files/bluez.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 90
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${bluez:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ bluetoothd
+ ;;
+stop)
+ killall bluetoothd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/bluez/ipkg/bluez.control b/package/bluez/ipkg/bluez.control
new file mode 100644
index 000000000..0b32376ad
--- /dev/null
+++ b/package/bluez/ipkg/bluez.control
@@ -0,0 +1,5 @@
+Package: bluez
+Priority: optional
+Section: net
+Description: Bluez libs and apps
+Depends: kmod-bluetooth
diff --git a/package/bluez/patches/patch-tools_hciattach_c b/package/bluez/patches/patch-tools_hciattach_c
new file mode 100644
index 000000000..ae8f70f57
--- /dev/null
+++ b/package/bluez/patches/patch-tools_hciattach_c
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- bluez-4.12.orig/tools/hciattach.c 2008-08-05 23:14:56.000000000 +0200
++++ bluez-4.12/tools/hciattach.c 2009-05-12 18:14:29.000000000 +0200
+@@ -107,6 +107,7 @@ static int uart_speed(int s)
+ return B57600;
+ case 115200:
+ return B115200;
++#if 0
+ case 230400:
+ return B230400;
+ case 460800:
+@@ -125,6 +126,7 @@ static int uart_speed(int s)
+ return B1500000;
+ case 2000000:
+ return B2000000;
++#endif
+ #ifdef B2500000
+ case 2500000:
+ return B2500000;
diff --git a/package/bogofilter/Config.in b/package/bogofilter/Config.in
new file mode 100644
index 000000000..1dfb7d2d5
--- /dev/null
+++ b/package/bogofilter/Config.in
@@ -0,0 +1,26 @@
+config ADK_PACKAGE_BOGOFILTER
+ prompt "bogofilter........................ Mail (spam) filter utility"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBDB
+ select ADK_PACKAGE_LIBICONV
+ help
+ Filters mail, must be trained.
+
+ http://bogofilter.sourceforge.net
+
+
+config ADK_PACKAGE_BOGOFILTER_BOGOUTIL
+ prompt " include bogoutil in firmware image and package file"
+ bool
+ default n
+ depends ADK_PACKAGE_BOGOFILTER
+
+config ADK_PACKAGE_BOGOFILTER_BOGOTUNE
+ prompt " include bogotune in firmware image and package file"
+ bool
+ default n
+ depends ADK_PACKAGE_BOGOFILTER
+
+
diff --git a/package/bogofilter/Makefile b/package/bogofilter/Makefile
new file mode 100644
index 000000000..d9f015ccc
--- /dev/null
+++ b/package/bogofilter/Makefile
@@ -0,0 +1,47 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bogofilter
+PKG_VERSION:= 1.1.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a816f509324ccb9946a4d89fefe525e1
+MASTER_SITES:= http://ftp.debian.org/debian/pool/main/b/bogofilter/
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BOGOFILTER,bogofilter,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_c_bigendian=no \
+ ac_cv_sizeof_off_t=8 \
+ ac_cv_sizeof_int=4 \
+ ac_cv_sizeof_long=4 \
+ LIBS="-liconv"
+CONFIGURE_ARGS+= --without-libsqlite3-prefix \
+ --without-libqdbm-prefix \
+ --with-included-gsl \
+ --with-libdb-prefix=${STAGING_DIR}/usr \
+ --disable-transactions
+# --without-libdb-prefix
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+PKG_DEPENDS:= libdb libiconv
+
+post-install:
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_BOGOFILTER}/CONTROL/control
+ ${INSTALL_DIR} ${IDIR_BOGOFILTER}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/${PKG_NAME} ${IDIR_BOGOFILTER}/usr/bin/
+ifeq (${ADK_PACKAGE_BOGOFILTER_BOGOUTIL},y)
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/bogoutil ${IDIR_BOGOFILTER}/usr/bin/
+endif
+ifeq (${ADK_PACKAGE_BOGOFILTER_BOGOTUNE},y)
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/bogotune ${IDIR_BOGOFILTER}/usr/bin/
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bogofilter/ipkg/bogofilter.control b/package/bogofilter/ipkg/bogofilter.control
new file mode 100644
index 000000000..ef205f2d7
--- /dev/null
+++ b/package/bogofilter/ipkg/bogofilter.control
@@ -0,0 +1,4 @@
+Package: bogofilter
+Priority: optional
+Section: mail
+Description: Mail filter
diff --git a/package/bogofilter/patches/patch-config_in b/package/bogofilter/patches/patch-config_in
new file mode 100644
index 000000000..11648db39
--- /dev/null
+++ b/package/bogofilter/patches/patch-config_in
@@ -0,0 +1,14 @@
+$Id$
+--- bogofilter-1.1.3.orig/config.in 2006-12-03 05:17:24.000000000 +0100
++++ bogofilter-1.1.3/config.in 2007-03-29 19:28:01.000000000 +0200
+@@ -51,10 +51,6 @@
+ /* Have suitable db.h header */
+ #undef HAVE_DB_H
+
+-/* Define to 1 if you have the declaration of `db_create', and to 0 if you
+- don't. */
+-#undef HAVE_DECL_DB_CREATE
+-
+ /* Define to 1 if you have the declaration of `getopt', and to 0 if you don't.
+ */
+ #undef HAVE_DECL_GETOPT
diff --git a/package/bogofilter/patches/patch-configure b/package/bogofilter/patches/patch-configure
new file mode 100644
index 000000000..165de8409
--- /dev/null
+++ b/package/bogofilter/patches/patch-configure
@@ -0,0 +1,281 @@
+$Id$
+--- bogofilter-1.1.3.orig/configure 2006-12-03 05:17:15.000000000 +0100
++++ bogofilter-1.1.3/configure 2007-03-29 19:27:35.000000000 +0200
+@@ -13464,238 +13464,55 @@ echo "${ECHO_T}$LIBDB" >&6; }
+
+ saveLIBS="$LIBS"
+ LIBS="$LIBS $LIBDB"
+- { echo "$as_me:$LINENO: checking if a program can be linked against Berkeley DB and run" >&5
+-echo $ECHO_N "checking if a program can be linked against Berkeley DB and run... $ECHO_C" >&6; }
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
++# AC_MSG_CHECKING(if a program can be linked against Berkeley DB and run)
++# AC_RUN_IFELSE(
++# AC_LANG_PROGRAM([[
+ #ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+ #endif
+ #include <db.h>
++# ]], [[
++#return 0;
++# ]]),,
++# [AC_MSG_RESULT(no)
++# AC_MSG_ERROR([Cannot run a program linked against libdb.
++#Did you adjust your library search path to include your libdb?])],)
++# AC_MSG_RESULT(yes)
+
+-int
+-main ()
+-{
+-
+-return 0;
+-
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest$ac_exeext
+-if { (ac_try="$ac_link"
+-case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- :
+-else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-( exit $ac_status )
+-{ echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
+- { { echo "$as_me:$LINENO: error: Cannot run a program linked against libdb.
+-Did you adjust your library search path to include your libdb?" >&5
+-echo "$as_me: error: Cannot run a program linked against libdb.
+-Did you adjust your library search path to include your libdb?" >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
+-
+- { echo "$as_me:$LINENO: checking if Berkeley DB header and library versions match" >&5
+-echo $ECHO_N "checking if Berkeley DB header and library versions match... $ECHO_C" >&6; }
+- rm -r -f bfadtestdir
+- mkdir bfadtestdir
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+- #include <stdlib.h>
+- #include <stdio.h>
++# dnl check if header and library of DB library match
++# dnl ignore if cross compiling
++# AC_MSG_CHECKING(if Berkeley DB header and library versions match)
++# rm -r -f bfadtestdir
++# mkdir bfadtestdir
++# AC_RUN_IFELSE(
++# AC_LANG_PROGRAM([[
++# #include <stdlib.h>
++# #include <stdio.h>
+ #ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+ #endif
+- #include <db.h>
+-
+-int
+-main ()
+-{
+-
+- int maj, min;
+- (void)db_version(&maj, &min, 0);
+- (void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n",
+- DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min);
+- if (maj != DB_VERSION_MAJOR) exit(1);
+- if (min != DB_VERSION_MINOR) exit(1);
+- exit(0);
+-
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest$ac_exeext
+-if { (ac_try="$ac_link"
+-case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- :
+-else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-( exit $ac_status )
+-{ echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
+- { { echo "$as_me:$LINENO: error: db.h header file and db library version do not match." >&5
+-echo "$as_me: error: db.h header file and db library version do not match." >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
+- { echo "$as_me:$LINENO: checking whether db_create is declared" >&5
+-echo $ECHO_N "checking whether db_create is declared... $ECHO_C" >&6; }
+-if test "${ac_cv_have_decl_db_create+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-#ifdef HAVE_INTTYPES_H
++# #include <db.h>
++# ]], [[
++# int maj, min;
++# (void)db_version(&maj, &min, 0);
++# (void)fprintf(stderr, "headers: %d.%d, library: %d.%d\n",
++# DB_VERSION_MAJOR, DB_VERSION_MINOR, maj, min);
++# if (maj != DB_VERSION_MAJOR) exit(1);
++# if (min != DB_VERSION_MINOR) exit(1);
++# exit(0);
++# ]]),,
++# [AC_MSG_RESULT(no)
++# AC_MSG_ERROR(db.h header file and db library version do not match.)],)
++# AC_MSG_RESULT(yes)
++# AC_CHECK_DECLS(db_create,,
++# AC_MSG_ERROR([[Can not locate a suitable Berkeley DB db.h header file.
++#Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory.
++#You can download Berkeley DB 4.3.x from http://www.sleepycat.com/]]),
++# [[#ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+ #endif
+-#include <db.h>
+-
+-
+-int
+-main ()
+-{
+-#ifndef db_create
+- (void) db_create;
+-#endif
+-
+- ;
+- return 0;
+-}
+-_ACEOF
+-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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_compile") 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && {
+- test -z "$ac_c_werror_flag" ||
+- test ! -s conftest.err
+- } && test -s conftest.$ac_objext; then
+- ac_cv_have_decl_db_create=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+- ac_cv_have_decl_db_create=no
+-fi
+-
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_db_create" >&5
+-echo "${ECHO_T}$ac_cv_have_decl_db_create" >&6; }
+-if test $ac_cv_have_decl_db_create = yes; then
+-
+-cat >>confdefs.h <<_ACEOF
+-#define HAVE_DECL_DB_CREATE 1
+-_ACEOF
+-
+-
+-else
+- cat >>confdefs.h <<_ACEOF
+-#define HAVE_DECL_DB_CREATE 0
+-_ACEOF
+-
+-{ { echo "$as_me:$LINENO: error: Can not locate a suitable Berkeley DB db.h header file.
+-Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory.
+-You can download Berkeley DB 4.3.x from http://www.sleepycat.com/" >&5
+-echo "$as_me: error: Can not locate a suitable Berkeley DB db.h header file.
+-Use --with-libdb-prefix=PATH to specify the path to a v3+ install directory.
+-You can download Berkeley DB 4.3.x from http://www.sleepycat.com/" >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+-
+-
++#include <db.h>]]
++# )
+ { echo "$as_me:$LINENO: checking if Berkeley DB supports shared environments" >&5
+ echo $ECHO_N "checking if Berkeley DB supports shared environments... $ECHO_C" >&6; }
+ if test "x$enable_dbshared_test" != xno && test "x$USE_TRANSACTIONS" != xNO ; then
diff --git a/package/bridge-utils/Config.in b/package/bridge-utils/Config.in
new file mode 100644
index 000000000..c09f338bd
--- /dev/null
+++ b/package/bridge-utils/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_BRIDGE_UTILS
+ prompt "bridge-utils...................... Ethernet bridging configuration utility"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_BRIDGE
+ help
+ Manage ethernet bridging; a way to connect networks together to
+ form a larger network.
+
+ http://bridge.sourceforge.net/
diff --git a/package/bridge-utils/Makefile b/package/bridge-utils/Makefile
new file mode 100644
index 000000000..724d016aa
--- /dev/null
+++ b/package/bridge-utils/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bridge-utils
+PKG_VERSION:= 1.0.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 9b7dc52656f5cbec846a7ba3299f73bd
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=bridge/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BRIDGE_UTILS,bridge-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-linux-headers=${LINUX_DIR}
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_BRIDGE_UTILS}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/brctl ${IDIR_BRIDGE_UTILS}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bridge-utils/ipkg/bridge-utils.control b/package/bridge-utils/ipkg/bridge-utils.control
new file mode 100644
index 000000000..da38f85e9
--- /dev/null
+++ b/package/bridge-utils/ipkg/bridge-utils.control
@@ -0,0 +1,4 @@
+Package: bridge-utils
+Priority: optional
+Section: net
+Description: Ethernet bridging tools
diff --git a/package/bridge-utils/patches/patch-libbridge_Makefile_in b/package/bridge-utils/patches/patch-libbridge_Makefile_in
new file mode 100644
index 000000000..f44737750
--- /dev/null
+++ b/package/bridge-utils/patches/patch-libbridge_Makefile_in
@@ -0,0 +1,11 @@
+--- bridge-utils-0.9.6/libbridge/Makefile.in.dist 2004-03-01 20:55:52.000000000 -0600
++++ bridge-utils-0.9.6/libbridge/Makefile.in 2004-03-01 20:56:23.000000000 -0600
+@@ -5,7 +5,7 @@
+ RANLIB=@RANLIB@
+
+ CC=@CC@
+-CFLAGS = -Wall -g $(KERNEL_HEADERS)
++CFLAGS = -Wall -g @CFLAGS@ $(KERNEL_HEADERS)
+
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
diff --git a/package/busybox/Config.in b/package/busybox/Config.in
new file mode 100644
index 000000000..15da6729a
--- /dev/null
+++ b/package/busybox/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_BUSYBOX
+ prompt "busybox.............................. The Swiss Army Knife"
+ bool
+ default y
+ help
+ The Swiss Army Knife of embedded Linux. It slices, it dices, it
+ makes Julian Fries.
+
+ http://busybox.net/
+
+ Most people will answer Y.
+
+menu "Busybox Configuration"
+source "package/busybox/config/Config.in"
+endmenu
diff --git a/package/busybox/Makefile b/package/busybox/Makefile
new file mode 100644
index 000000000..107009c1a
--- /dev/null
+++ b/package/busybox/Makefile
@@ -0,0 +1,52 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= busybox
+PKG_VERSION:= 1.13.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6f86b4aa466f4b492c9468ba9500976a
+MASTER_SITES:= http://www.busybox.net/downloads/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,BUSYBOX,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+#rebuild:
+# @rm $(WRKBUILD)/.configure_done
+
+do-configure:
+ grep BUSYBOX_ $(TOPDIR)/.config|sed -e 's/BUSYBOX_/CONFIG_/' > \
+ ${WRKBUILD}/.config
+ $(SED) 's@IDIR@${WRKINST}' ${WRKBUILD}/.config
+ yes '' | \
+ $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS)" IPKG_ARCH="$(ARCH)" \
+ ARCH="$(ARCH)" -C $(WRKBUILD) oldconfig
+
+do-build:
+ $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \
+ IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" -C $(WRKBUILD)
+
+do-install: ${TOPDIR}/.config
+ $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \
+ IPKG_ARCH="$(ARCH)" ARCH="$(ARCH)" -C $(WRKBUILD) install
+ifeq ($(DEBUG),1)
+ ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
+ $(IDIR_BUSYBOX)/bin/busybox
+endif
+ $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
+ $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d/
+ $(INSTALL_BIN) ./files/syslog.init \
+ $(IDIR_BUSYBOX)/etc/init.d/syslog
+ $(INSTALL_BIN) ./files/network.init \
+ $(IDIR_BUSYBOX)/etc/init.d/network
+ $(INSTALL_BIN) ./files/crond.init \
+ $(IDIR_BUSYBOX)/etc/init.d/crond
+ ${INSTALL_BIN} files/inetd.init \
+ ${IDIR_BUSYBOX}/etc/init.d/inetd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/busybox/config/Config.in b/package/busybox/config/Config.in
new file mode 100644
index 000000000..b8894d4c5
--- /dev/null
+++ b/package/busybox/config/Config.in
@@ -0,0 +1,605 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+# mainmenu "BusyBox Configuration"
+
+config BUSYBOX_HAVE_DOT_CONFIG
+ bool
+ default y
+
+menu "Busybox Settings"
+
+menu "General Configuration"
+
+config BUSYBOX_DESKTOP
+ bool "Enable options for full-blown desktop systems"
+ default n
+ help
+ Enable options and features which are not essential.
+ Select this only if you plan to use busybox on full-blown
+ desktop machine with common Linux distro, not on an embedded box.
+
+config BUSYBOX_EXTRA_COMPAT
+ bool "Provide compatible behavior for rare corner cases (bigger code)"
+ default n
+ help
+ This option makes grep, sed etc handle rare corner cases
+ (embedded NUL bytes and such). This makes code bigger and uses
+ some GNU extensions in libc. You probably only need this option
+ if you plan to run busybox on desktop.
+
+config BUSYBOX_FEATURE_ASSUME_UNICODE
+ bool "Assume that 1:1 char/glyph correspondence is not true"
+ default n
+ help
+ This makes various applets aware that one byte is not
+ one character on screen.
+
+ Busybox aims to eventually work correctly with Unicode displays.
+ Any older encodings are not guaranteed to work.
+ Probably by the time when busybox will be fully Unicode-clean,
+ other encodings will be mainly of historic interest.
+
+choice
+ prompt "Buffer allocation policy"
+ default FEATURE_BUFFERS_USE_MALLOC
+ help
+ There are 3 ways BusyBox can handle buffer allocations:
+ - Use malloc. This costs code size for the call to xmalloc.
+ - Put them on stack. For some very small machines with limited stack
+ space, this can be deadly. For most folks, this works just fine.
+ - Put them in BSS. This works beautifully for computers with a real
+ MMU (and OS support), but wastes runtime RAM for uCLinux. This
+ behavior was the only one available for BusyBox versions 0.48 and
+ earlier.
+
+config BUSYBOX_FEATURE_BUFFERS_USE_MALLOC
+ bool "Allocate with Malloc"
+
+config BUSYBOX_FEATURE_BUFFERS_GO_ON_STACK
+ bool "Allocate on the Stack"
+
+config BUSYBOX_FEATURE_BUFFERS_GO_IN_BSS
+ bool "Allocate in the .bss section"
+
+endchoice
+
+config BUSYBOX_SHOW_USAGE
+ bool "Show terse applet usage messages"
+ default y
+ help
+ All BusyBox applets will show help messages when invoked with
+ wrong arguments. You can turn off printing these terse usage
+ messages if you say no here.
+ This will save you up to 7k.
+
+config BUSYBOX_FEATURE_VERBOSE_USAGE
+ bool "Show verbose applet usage messages"
+ default y
+ select BUSYBOX_SHOW_USAGE
+ help
+ All BusyBox applets will show more verbose help messages when
+ busybox is invoked with --help. This will add a lot of text to the
+ busybox binary. In the default configuration, this will add about
+ 13k, but it can add much more depending on your configuration.
+
+config BUSYBOX_FEATURE_COMPRESS_USAGE
+ bool "Store applet usage messages in compressed form"
+ default y
+ depends on BUSYBOX_SHOW_USAGE
+ help
+ Store usage messages in compressed form, uncompress them on-the-fly
+ when <applet> --help is called.
+
+ If you have a really tiny busybox with few applets enabled (and
+ bunzip2 isn't one of them), the overhead of the decompressor might
+ be noticeable. Also, if you run executables directly from ROM
+ and have very little memory, this might not be a win. Otherwise,
+ you probably want this.
+
+config BUSYBOX_FEATURE_INSTALLER
+ bool "Support --install [-s] to install applet links at runtime"
+ default n
+ help
+ Enable 'busybox --install [-s]' support. This will allow you to use
+ busybox at runtime to create hard links or symlinks for all the
+ applets that are compiled into busybox.
+
+config BUSYBOX_LOCALE_SUPPORT
+ bool "Enable locale support (system needs locale for this to work)"
+ default n
+ help
+ Enable this if your system has locale support and you would like
+ busybox to support locale settings.
+
+config BUSYBOX_GETOPT_LONG
+ bool "Support for --long-options"
+ default y
+ help
+ Enable this if you want busybox applets to use the gnu --long-option
+ style, in addition to single character -a -b -c style options.
+
+config BUSYBOX_FEATURE_DEVPTS
+ bool "Use the devpts filesystem for Unix98 PTYs"
+ default y
+ help
+ Enable if you want BusyBox to use Unix98 PTY support. If enabled,
+ busybox will use /dev/ptmx for the master side of the pseudoterminal
+ and /dev/pts/<number> for the slave side. Otherwise, BSD style
+ /dev/ttyp<number> will be used. To use this option, you should have
+ devpts mounted.
+
+config BUSYBOX_FEATURE_CLEAN_UP
+ bool "Clean up all memory before exiting (usually not needed)"
+ default n
+ help
+ As a size optimization, busybox normally exits without explicitly
+ freeing dynamically allocated memory or closing files. This saves
+ space since the OS will clean up for us, but it can confuse debuggers
+ like valgrind, which report tons of memory and resource leaks.
+
+ Don't enable this unless you have a really good reason to clean
+ things up manually.
+
+config BUSYBOX_FEATURE_PIDFILE
+ bool "Support writing pidfiles"
+ default n
+ help
+ This option makes some applets (e.g. crond, syslogd, inetd) write
+ a pidfile in /var/run. Some applications rely on them.
+
+config BUSYBOX_FEATURE_SUID
+ bool "Support for SUID/SGID handling"
+ default y
+ help
+ With this option you can install the busybox binary belonging
+ to root with the suid bit set, and it will automatically drop
+ priviledges for applets that don't need root access.
+
+ If you are really paranoid and don't want to do this, build two
+ busybox binaries with different applets in them (and the appropriate
+ symlinks pointing to each binary), and only set the suid bit on the
+ one that needs it. The applets currently marked to need the suid bit
+ are:
+
+ crontab, dnsd, findfs, ipcrm, ipcs, login, passwd, ping, su,
+ traceroute, vlock.
+
+config BUSYBOX_FEATURE_SUID_CONFIG
+ bool "Runtime SUID/SGID configuration via /etc/busybox.conf"
+ default n if FEATURE_SUID
+ depends on BUSYBOX_FEATURE_SUID
+ help
+ Allow the SUID / SGID state of an applet to be determined at runtime
+ by checking /etc/busybox.conf. (This is sort of a poor man's sudo.)
+ The format of this file is as follows:
+
+ <applet> = [Ssx-][Ssx-][x-] (<username>|<uid>).(<groupname>|<gid>)
+
+ An example might help:
+
+ [SUID]
+ su = ssx root.0 # applet su can be run by anyone and runs with
+ # euid=0/egid=0
+ su = ssx # exactly the same
+
+ mount = sx- root.disk # applet mount can be run by root and members
+ # of group disk and runs with euid=0
+
+ cp = --- # disable applet cp for everyone
+
+ The file has to be owned by user root, group root and has to be
+ writeable only by root:
+ (chown 0.0 /etc/busybox.conf; chmod 600 /etc/busybox.conf)
+ The busybox executable has to be owned by user root, group
+ root and has to be setuid root for this to work:
+ (chown 0.0 /bin/busybox; chmod 4755 /bin/busybox)
+
+ Robert 'sandman' Griebl has more information here:
+ <url: http://www.softforge.de/bb/suid.html >.
+
+config BUSYBOX_FEATURE_SUID_CONFIG_QUIET
+ bool "Suppress warning message if /etc/busybox.conf is not readable"
+ default y
+ depends on BUSYBOX_FEATURE_SUID_CONFIG
+ help
+ /etc/busybox.conf should be readable by the user needing the SUID,
+ check this option to avoid users to be notified about missing
+ permissions.
+
+#config BUSYBOX_SELINUX
+# bool "Support NSA Security Enhanced Linux"
+# default n
+# help
+# Enable support for SELinux in applets ls, ps, and id. Also provide
+# the option of compiling in SELinux applets.
+#
+# If you do not have a complete SELinux userland installed, this stuff
+# will not compile. Go visit
+# http://www.nsa.gov/selinux/index.html
+# to download the necessary stuff to allow busybox to compile with
+# this option enabled. Specifially, libselinux 1.28 or better is
+# directly required by busybox. If the installation is located in a
+# non-standard directory, provide it by invoking make as follows:
+# CFLAGS=-I<libselinux-include-path> \
+# LDFLAGS=-L<libselinux-lib-path> \
+# make
+#
+# Most people will leave this set to 'N'.
+
+config BUSYBOX_FEATURE_PREFER_APPLETS
+ bool "exec prefers applets"
+ default n
+ help
+ This is an experimental option which directs applets about to
+ call 'exec' to try and find an applicable busybox applet before
+ searching the PATH. This is typically done by exec'ing
+ /proc/self/exe.
+ This may affect shell, find -exec, xargs and similar applets.
+ They will use applets even if /bin/<applet> -> busybox link
+ is missing (or is not a link to busybox). However, this causes
+ problems in chroot jails without mounted /proc and with ps/top
+ (command name can be shown as 'exe' for applets started this way).
+
+config BUSYBOX_BUSYBOX_EXEC_PATH
+ string "Path to BusyBox executable"
+ default "/proc/self/exe"
+ help
+ When Busybox applets need to run other busybox applets, BusyBox
+ sometimes needs to exec() itself. When the /proc filesystem is
+ mounted, /proc/self/exe always points to the currently running
+ executable. If you haven't got /proc, set this to wherever you
+ want to run BusyBox from.
+
+# These are auto-selected by other options
+
+config BUSYBOX_FEATURE_SYSLOG
+ bool #No description makes it a hidden option
+ default n
+ #help
+ # This option is auto-selected when you select any applet which may
+ # send its output to syslog. You do not need to select it manually.
+
+config BUSYBOX_FEATURE_HAVE_RPC
+ bool #No description makes it a hidden option
+ default n
+ #help
+ # This is automatically selected if any of enabled applets need it.
+ # You do not need to select it manually.
+
+endmenu
+
+menu 'Build Options'
+
+#config BUSYBOX_STATIC
+# bool "Build BusyBox as a static binary (no shared libs)"
+# default n
+# help
+# If you want to build a static BusyBox binary, which does not
+# use or require any shared libraries, then enable this option.
+# This can cause BusyBox to be considerably larger, so you should
+# leave this option false unless you have a good reason (i.e.
+# your target platform does not support shared libraries, or
+# you are building an initrd which doesn't need anything but
+# BusyBox, etc).
+#
+# Most people will leave this set to 'N'.
+#
+#config BUSYBOX_PIE
+# bool "Build BusyBox as a position independent executable"
+# default n
+# depends on !BUSYBOX_STATIC
+# help
+# (TODO: what is it and why/when is it useful?)
+# Most people will leave this set to 'N'.
+#
+#config BUSYBOX_NOMMU
+# bool "Force NOMMU build"
+# default n
+# help
+# Busybox tries to detect whether architecture it is being
+# built against supports MMU or not. If this detection fails,
+# or if you want to build NOMMU version of busybox for testing,
+# you may force NOMMU build here.
+#
+# Most people will leave this set to 'N'.
+
+# PIE can be made to work with BUILD_LIBBUSYBOX, but currently
+# build system does not support that
+#config BUSYBOX_BUILD_LIBBUSYBOX
+# bool "Build shared libbusybox"
+# default n
+# depends on !BUSYBOX_FEATURE_PREFER_APPLETS && !BUSYBOX_PIE && !BUSYBOX_STATIC
+# help
+# Build a shared library libbusybox.so.N.N.N which contains all
+# busybox code.
+#
+# This feature allows every applet to be built as a tiny
+# separate executable. Enabling it for "one big busybox binary"
+# approach serves no purpose and increases code size.
+# You should almost certainly say "no" to this.
+
+### config FEATURE_FULL_LIBBUSYBOX
+### bool "Feature-complete libbusybox"
+### default n if !FEATURE_SHARED_BUSYBOX
+### depends on BUSYBOX_BUILD_LIBBUSYBOX
+### help
+### Build a libbusybox with the complete feature-set, disregarding
+### the actually selected config.
+###
+### Normally, libbusybox will only contain the features which are
+### used by busybox itself. If you plan to write a separate
+### standalone application which uses libbusybox say 'Y'.
+###
+### Note: libbusybox is GPL, not LGPL, and exports no stable API that
+### might act as a copyright barrier. We can and will modify the
+### exported function set between releases (even minor version number
+### changes), and happily break out-of-tree features.
+###
+### Say 'N' if in doubt.
+
+#config BUSYBOX_FEATURE_INDIVIDUAL
+# bool "Produce a binary for each applet, linked against libbusybox"
+# default y
+# depends on BUSYBOX_BUILD_LIBBUSYBOX
+# help
+# If your CPU architecture doesn't allow for sharing text/rodata
+# sections of running binaries, but allows for runtime dynamic
+# libraries, this option will allow you to reduce memory footprint
+# when you have many different applets running at once.
+#
+# If your CPU architecture allows for sharing text/rodata,
+# having single binary is more optimal.
+#
+# Each applet will be a tiny program, dynamically linked
+# against libbusybox.so.N.N.N.
+#
+# You need to have a working dynamic linker.
+
+#config BUSYBOX_FEATURE_SHARED_BUSYBOX
+# bool "Produce additional busybox binary linked against libbusybox"
+# default y
+# depends on BUSYBOX_BUILD_LIBBUSYBOX
+# help
+# Build busybox, dynamically linked against libbusybox.so.N.N.N.
+#
+# You need to have a working dynamic linker.
+
+### config BUILD_AT_ONCE
+### bool "Compile all sources at once"
+### default n
+### help
+### Normally each source-file is compiled with one invocation of
+### the compiler.
+### If you set this option, all sources are compiled at once.
+### This gives the compiler more opportunities to optimize which can
+### result in smaller and/or faster binaries.
+###
+### Setting this option will consume alot of memory, e.g. if you
+### enable all applets with all features, gcc uses more than 300MB
+### RAM during compilation of busybox.
+###
+### This option is most likely only beneficial for newer compilers
+### such as gcc-4.1 and above.
+###
+### Say 'N' unless you know what you are doing.
+
+config BUSYBOX_LFS
+ bool "Build with Large File Support (for accessing files > 2 GB)"
+ default y
+ select BUSYBOX_FDISK_SUPPORT_LARGE_DISKS
+ help
+ If you want to build BusyBox with large file support, then enable
+ this option. This will have no effect if your kernel or your C
+ library lacks large file support for large files. Some of the
+ programs that can benefit from large file support include dd, gzip,
+ cp, mount, tar, and many others. If you want to access files larger
+ than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'.
+
+config BUSYBOX_CROSS_COMPILER_PREFIX
+ string "Cross Compiler prefix"
+ default ""
+ help
+ If you want to build BusyBox with a cross compiler, then you
+ will need to set this to the cross-compiler prefix, for example,
+ "i386-uclibc-".
+
+ Note that CROSS_COMPILE environment variable or
+ "make CROSS_COMPILE=xxx ..." will override this selection.
+
+ Native builds leave this empty.
+
+endmenu
+
+menu 'Debugging Options'
+
+config BUSYBOX_DEBUG
+ bool "Build BusyBox with extra Debugging symbols"
+ default n
+ help
+ Say Y here if you wish to examine BusyBox internals while applets are
+ running. This increases the size of the binary considerably, and
+ should only be used when doing development. If you are doing
+ development and want to debug BusyBox, answer Y.
+
+ Most people should answer N.
+
+config BUSYBOX_DEBUG_PESSIMIZE
+ bool "Disable compiler optimizations"
+ default n
+ depends on BUSYBOX_DEBUG
+ help
+ The compiler's optimization of source code can eliminate and reorder
+ code, resulting in an executable that's hard to understand when
+ stepping through it with a debugger. This switches it off, resulting
+ in a much bigger executable that more closely matches the source
+ code.
+
+# triggers problems on cris with __attribute__((packed))
+#config BUSYBOX_WERROR
+# bool "Abort compilation on any warning"
+# default n
+# help
+# Selecting this will add -Werror to gcc command line.
+#
+# Most people should answer N.
+
+choice
+ prompt "Additional debugging library"
+ default NO_DEBUG_LIB
+ help
+ Using an additional debugging library will make BusyBox become
+ considerable larger and will cause it to run more slowly. You
+ should always leave this option disabled for production use.
+
+ dmalloc support:
+ ----------------
+ This enables compiling with dmalloc ( http://dmalloc.com/ )
+ which is an excellent public domain mem leak and malloc problem
+ detector. To enable dmalloc, before running busybox you will
+ want to properly set your environment, for example:
+ export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
+ The 'debug=' value is generated using the following command
+ dmalloc -p log-stats -p log-non-free -p log-bad-space \
+ -p log-elapsed-time -p check-fence -p check-heap \
+ -p check-lists -p check-blank -p check-funcs -p realloc-copy \
+ -p allow-free-null
+
+ Electric-fence support:
+ -----------------------
+ This enables compiling with Electric-fence support. Electric
+ fence is another very useful malloc debugging library which uses
+ your computer's virtual memory hardware to detect illegal memory
+ accesses. This support will make BusyBox be considerable larger
+ and run slower, so you should leave this option disabled unless
+ you are hunting a hard to find memory problem.
+
+
+config BUSYBOX_NO_DEBUG_LIB
+ bool "None"
+
+config BUSYBOX_DMALLOC
+ bool "Dmalloc"
+
+config BUSYBOX_EFENCE
+ bool "Electric-fence"
+
+endchoice
+
+config BUSYBOX_INCLUDE_SUSv2
+ bool "Enable obsolete features removed before SUSv3?"
+ default y
+ help
+ This option will enable backwards compatibility with SuSv2,
+ specifically, old-style numeric options ('command -1 <file>')
+ will be supported in head, tail, and fold. (Note: should
+ affect renice too.)
+
+### config PARSE
+### bool "Uniform config file parser debugging applet: parse"
+
+endmenu
+
+menu 'Installation Options'
+
+config BUSYBOX_INSTALL_NO_USR
+ bool "Don't use /usr"
+ default n
+ help
+ Disable use of /usr. Don't activate this option if you don't know
+ that you really want this behaviour.
+
+choice
+ prompt "Applets links"
+ default INSTALL_APPLET_SYMLINKS
+ help
+ Choose how you install applets links.
+
+config BUSYBOX_INSTALL_APPLET_SYMLINKS
+ bool "as soft-links"
+ help
+ Install applets as soft-links to the busybox binary. This needs some
+ free inodes on the filesystem, but might help with filesystem
+ generators that can't cope with hard-links.
+
+config BUSYBOX_INSTALL_APPLET_HARDLINKS
+ bool "as hard-links"
+ help
+ Install applets as hard-links to the busybox binary. This might
+ count on a filesystem with few inodes.
+
+config BUSYBOX_INSTALL_APPLET_SCRIPT_WRAPPERS
+ bool "as script wrappers"
+ help
+ Install applets as script wrappers that call the busybox binary.
+
+config BUSYBOX_INSTALL_APPLET_DONT
+ bool "not installed"
+ depends on BUSYBOX_FEATURE_INSTALLER || BUSYBOX_FEATURE_SH_STANDALONE || BUSYBOX_FEATURE_PREFER_APPLETS
+ help
+ Do not install applet links. Useful when using the -install feature
+ or a standalone shell for rescue purposes.
+
+endchoice
+
+choice
+ prompt "/bin/sh applet link"
+ default INSTALL_SH_APPLET_SYMLINK
+ depends on BUSYBOX_INSTALL_APPLET_SCRIPT_WRAPPERS
+ help
+ Choose how you install /bin/sh applet link.
+
+config BUSYBOX_INSTALL_SH_APPLET_SYMLINK
+ bool "as soft-link"
+ help
+ Install /bin/sh applet as soft-link to the busybox binary.
+
+config BUSYBOX_INSTALL_SH_APPLET_HARDLINK
+ bool "as hard-link"
+ help
+ Install /bin/sh applet as hard-link to the busybox binary.
+
+config BUSYBOX_INSTALL_SH_APPLET_SCRIPT_WRAPPER
+ bool "as script wrapper"
+ help
+ Install /bin/sh applet as script wrapper that call the busybox
+ binary.
+
+endchoice
+
+config BUSYBOX_PREFIX
+ string "BusyBox installation prefix"
+ default "@IDIR@"
+ help
+ Define your directory to install BusyBox files/subdirs in.
+
+endmenu
+
+source package/busybox/config/libbb/Config.in
+
+endmenu
+
+comment "Applets"
+
+source package/busybox/config/archival/Config.in
+source package/busybox/config/coreutils/Config.in
+source package/busybox/config/console-tools/Config.in
+source package/busybox/config/debianutils/Config.in
+source package/busybox/config/editors/Config.in
+source package/busybox/config/findutils/Config.in
+source package/busybox/config/init/Config.in
+source package/busybox/config/loginutils/Config.in
+source package/busybox/config/e2fsprogs/Config.in
+source package/busybox/config/modutils/Config.in
+source package/busybox/config/util-linux/Config.in
+source package/busybox/config/miscutils/Config.in
+source package/busybox/config/networking/Config.in
+source package/busybox/config/printutils/Config.in
+source package/busybox/config/mailutils/Config.in
+source package/busybox/config/procps/Config.in
+source package/busybox/config/runit/Config.in
+source package/busybox/config/selinux/Config.in
+source package/busybox/config/shell/Config.in
+source package/busybox/config/sysklogd/Config.in
diff --git a/package/busybox/config/archival/Config.in b/package/busybox/config/archival/Config.in
new file mode 100644
index 000000000..0242dea05
--- /dev/null
+++ b/package/busybox/config/archival/Config.in
@@ -0,0 +1,300 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Archival Utilities"
+
+config BUSYBOX_FEATURE_SEAMLESS_LZMA
+ bool "Make tar, rpm, modprobe etc understand .lzma data"
+ default n
+ help
+ Make tar, rpm, modprobe etc understand .lzma data.
+
+config BUSYBOX_FEATURE_SEAMLESS_BZ2
+ bool "Make tar, rpm, modprobe etc understand .bz2 data"
+ default n
+ help
+ Make tar, rpm, modprobe etc understand .bz2 data.
+
+config BUSYBOX_FEATURE_SEAMLESS_GZ
+ bool "Make tar, rpm, modprobe etc understand .gz data"
+ default n
+ help
+ Make tar, rpm, modprobe etc understand .gz data.
+
+config BUSYBOX_FEATURE_SEAMLESS_Z
+ bool "Make tar and gunzip understand .Z data"
+ default n
+ help
+ Make tar and gunzip understand .Z data.
+
+config BUSYBOX_AR
+ bool "ar"
+ default n
+ help
+ ar is an archival utility program used to create, modify, and
+ extract contents from archives. An archive is a single file holding
+ a collection of other files in a structure that makes it possible to
+ retrieve the original individual files (called archive members).
+ The original files' contents, mode (permissions), timestamp, owner,
+ and group are preserved in the archive, and can be restored on
+ extraction.
+
+ The stored filename is limited to 15 characters. (for more information
+ see long filename support).
+ ar has 60 bytes of overheads for every stored file.
+
+ This implementation of ar can extract archives, it cannot create or
+ modify them.
+ On an x86 system, the ar applet adds about 1K.
+
+ Unless you have a specific application which requires ar, you should
+ probably say N here.
+
+config BUSYBOX_FEATURE_AR_LONG_FILENAMES
+ bool "Support for long filenames (not need for debs)"
+ default n
+ depends on BUSYBOX_AR
+ help
+ By default the ar format can only store the first 15 characters of
+ the filename, this option removes that limitation.
+ It supports the GNU ar long filename method which moves multiple long
+ filenames into a the data section of a new ar entry.
+
+config BUSYBOX_BUNZIP2
+ bool "bunzip2"
+ default y
+ help
+ bunzip2 is a compression utility using the Burrows-Wheeler block
+ sorting text compression algorithm, and Huffman coding. Compression
+ is generally considerably better than that achieved by more
+ conventional LZ77/LZ78-based compressors, and approaches the
+ performance of the PPM family of statistical compressors.
+
+ Unless you have a specific application which requires bunzip2, you
+ should probably say N here.
+
+config BUSYBOX_BZIP2
+ bool "bzip2"
+ default n
+ help
+ bzip2 is a compression utility using the Burrows-Wheeler block
+ sorting text compression algorithm, and Huffman coding. Compression
+ is generally considerably better than that achieved by more
+ conventional LZ77/LZ78-based compressors, and approaches the
+ performance of the PPM family of statistical compressors.
+
+ Unless you have a specific application which requires bzip2, you
+ should probably say N here.
+
+config BUSYBOX_CPIO
+ bool "cpio"
+ default y
+ help
+ cpio is an archival utility program used to create, modify, and
+ extract contents from archives.
+ cpio has 110 bytes of overheads for every stored file.
+
+ This implementation of cpio can extract cpio archives created in the
+ "newc" or "crc" format, it cannot create or modify them.
+
+ Unless you have a specific application which requires cpio, you
+ should probably say N here.
+
+config BUSYBOX_FEATURE_CPIO_O
+ bool "Support for archive creation"
+ default n
+ depends on BUSYBOX_CPIO
+ help
+ This implementation of cpio can create cpio archives in the "newc"
+ format only.
+
+config BUSYBOX_DPKG
+ bool "dpkg"
+ default n
+ select BUSYBOX_FEATURE_SEAMLESS_GZ
+ help
+ dpkg is a medium-level tool to install, build, remove and manage
+ Debian packages.
+
+ This implementation of dpkg has a number of limitations,
+ you should use the official dpkg if possible.
+
+config BUSYBOX_DPKG_DEB
+ bool "dpkg_deb"
+ default n
+ select BUSYBOX_FEATURE_SEAMLESS_GZ
+ help
+ dpkg-deb unpacks and provides information about Debian archives.
+
+ This implementation of dpkg-deb cannot pack archives.
+
+ Unless you have a specific application which requires dpkg-deb,
+ say N here.
+
+config BUSYBOX_FEATURE_DPKG_DEB_EXTRACT_ONLY
+ bool "Extract only (-x)"
+ default n
+ depends on BUSYBOX_DPKG_DEB
+ help
+ This reduces dpkg-deb to the equivalent of
+ "ar -p <deb> data.tar.gz | tar -zx". However it saves space as none
+ of the extra dpkg-deb, ar or tar options are needed, they are linked
+ to internally.
+
+config BUSYBOX_GUNZIP
+ bool "gunzip"
+ default y
+ help
+ gunzip is used to decompress archives created by gzip.
+ You can use the `-t' option to test the integrity of
+ an archive, without decompressing it.
+
+config BUSYBOX_GZIP
+ bool "gzip"
+ default y
+ help
+ gzip is used to compress files.
+ It's probably the most widely used UNIX compression program.
+
+config BUSYBOX_IPKG
+ bool "ipkg"
+ default y
+ select BUSYBOX_MD5SUM
+ select BUSYBOX_WGET
+ help
+ ipkg is the itsy package management system.
+
+config BUSYBOX_RPM2CPIO
+ bool "rpm2cpio"
+ default n
+ help
+ Converts an RPM file into a CPIO archive.
+
+config BUSYBOX_RPM
+ bool "rpm"
+ default n
+ help
+ Mini RPM applet - queries and extracts RPM packages.
+
+config BUSYBOX_TAR
+ bool "tar"
+ default y
+ help
+ tar is an archiving program. It's commonly used with gzip to
+ create compressed archives. It's probably the most widely used
+ UNIX archive program.
+
+if TAR
+
+config BUSYBOX_FEATURE_TAR_CREATE
+ bool "Enable archive creation"
+ default y
+ depends on BUSYBOX_TAR
+ help
+ If you enable this option you'll be able to create
+ tar archives using the `-c' option.
+
+config BUSYBOX_FEATURE_TAR_AUTODETECT
+ bool "Autodetect gz/bz2 compressed tarballs"
+ default n
+ depends on BUSYBOX_FEATURE_SEAMLESS_Z || BUSYBOX_FEATURE_SEAMLESS_GZ || BUSYBOX_FEATURE_SEAMLESS_BZ2 || BUSYBOX_FEATURE_SEAMLESS_LZMA
+ help
+ With this option tar can automatically detect gzip/bzip2 compressed
+ tarballs. Currently it works only on files (not pipes etc).
+
+config BUSYBOX_FEATURE_TAR_FROM
+ bool "Enable -X (exclude from) and -T (include from) options)"
+ default y
+ depends on BUSYBOX_TAR
+ help
+ If you enable this option you'll be able to specify
+ a list of files to include or exclude from an archive.
+
+config BUSYBOX_FEATURE_TAR_OLDGNU_COMPATIBILITY
+ bool "Support for old tar header format"
+ default N
+ depends on BUSYBOX_TAR
+ help
+ This option is required to unpack archives created in
+ the old GNU format; help to kill this old format by
+ repacking your ancient archives with the new format.
+
+config BUSYBOX_FEATURE_TAR_OLDSUN_COMPATIBILITY
+ bool "Enable untarring of tarballs with checksums produced by buggy Sun tar"
+ default N
+ depends on BUSYBOX_TAR
+ help
+ This option is required to unpack archives created by some old
+ version of Sun's tar (it was calculating checksum using signed
+ arithmetic). It is said to be fixed in newer Sun tar, but "old"
+ tarballs still exist.
+
+config BUSYBOX_FEATURE_TAR_GNU_EXTENSIONS
+ bool "Support for GNU tar extensions (long filenames)"
+ default y
+ depends on BUSYBOX_TAR
+ help
+ With this option busybox supports GNU long filenames and
+ linknames.
+
+config BUSYBOX_FEATURE_TAR_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_TAR && BUSYBOX_GETOPT_LONG
+ help
+ Enable use of long options, increases size by about 400 Bytes
+
+config BUSYBOX_FEATURE_TAR_UNAME_GNAME
+ bool "Enable use of user and group names"
+ default n
+ depends on BUSYBOX_TAR
+ help
+ Enables use of user and group names in tar. This affects contents
+ listings (-t) and preserving permissions when unpacking (-p).
+ +200 bytes.
+
+endif #tar
+
+config BUSYBOX_UNCOMPRESS
+ bool "uncompress"
+ default n
+ help
+ uncompress is used to decompress archives created by compress.
+ Not much used anymore, replaced by gzip/gunzip.
+
+config BUSYBOX_UNLZMA
+ bool "unlzma"
+ default n
+ help
+ unlzma is a compression utility using the Lempel-Ziv-Markov chain
+ compression algorithm, and range coding. Compression
+ is generally considerably better than that achieved by the bzip2
+ compressors.
+
+ The BusyBox unlzma applet is limited to de-compression only.
+ On an x86 system, this applet adds about 4K.
+
+ Unless you have a specific application which requires unlzma, you
+ should probably say N here.
+
+config BUSYBOX_FEATURE_LZMA_FAST
+ bool "Optimize unlzma for speed"
+ default n
+ depends on BUSYBOX_UNLZMA
+ help
+ This option reduces decompression time by about 33% at the cost of
+ a 2K bigger binary.
+
+config BUSYBOX_UNZIP
+ bool "unzip"
+ default y
+ help
+ unzip will list or extract files from a ZIP archive,
+ commonly found on DOS/WIN systems. The default behavior
+ (with no options) is to extract the archive into the
+ current directory. Use the `-d' option to extract to a
+ directory of your choice.
+
+endmenu
diff --git a/package/busybox/config/console-tools/Config.in b/package/busybox/config/console-tools/Config.in
new file mode 100644
index 000000000..3f5a98c84
--- /dev/null
+++ b/package/busybox/config/console-tools/Config.in
@@ -0,0 +1,138 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Console Utilities"
+
+config BUSYBOX_CHVT
+ bool "chvt"
+ default n
+ help
+ This program is used to change to another terminal.
+ Example: chvt 4 (change to terminal /dev/tty4)
+
+config BUSYBOX_CLEAR
+ bool "clear"
+ default y
+ help
+ This program clears the terminal screen.
+
+config BUSYBOX_DEALLOCVT
+ bool "deallocvt"
+ default n
+ help
+ This program deallocates unused virtual consoles.
+
+config BUSYBOX_DUMPKMAP
+ bool "dumpkmap"
+ default n
+ help
+ This program dumps the kernel's keyboard translation table to
+ stdout, in binary format. You can then use loadkmap to load it.
+
+config BUSYBOX_KBD_MODE
+ bool "kbd_mode"
+ default n
+ help
+ This program reports and sets keyboard mode.
+
+config BUSYBOX_LOADFONT
+ bool "loadfont"
+ default n
+ help
+ This program loads a console font from standard input.
+
+config BUSYBOX_LOADKMAP
+ bool "loadkmap"
+ default n
+ help
+ This program loads a keyboard translation table from
+ standard input.
+
+config BUSYBOX_OPENVT
+ bool "openvt"
+ default n
+ help
+ This program is used to start a command on an unused
+ virtual terminal.
+
+config BUSYBOX_RESET
+ bool "reset"
+ default y
+ help
+ This program is used to reset the terminal screen, if it
+ gets messed up.
+
+config BUSYBOX_RESIZE
+ bool "resize"
+ default n
+ help
+ This program is used to (re)set the width and height of your current
+ terminal.
+
+config BUSYBOX_FEATURE_RESIZE_PRINT
+ bool "Print environment variables"
+ default n
+ depends on BUSYBOX_RESIZE
+ help
+ Prints the newly set size (number of columns and rows) of
+ the terminal.
+ E.g.:
+ COLUMNS=80;LINES=44;export COLUMNS LINES;
+
+config BUSYBOX_SETCONSOLE
+ bool "setconsole"
+ default n
+ help
+ This program redirects the system console to another device,
+ like the current tty while logged in via telnet.
+
+config BUSYBOX_FEATURE_SETCONSOLE_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_SETCONSOLE && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the setconsole applet.
+
+config BUSYBOX_SETFONT
+ bool "setfont"
+ default n
+ help
+ Allows to load console screen map. Useful for i18n.
+
+config BUSYBOX_FEATURE_SETFONT_TEXTUAL_MAP
+ bool "Support reading textual screen maps"
+ default n
+ depends on BUSYBOX_SETFONT
+ help
+ Support reading textual screen maps.
+
+config BUSYBOX_DEFAULT_SETFONT_DIR
+ string "Default directory for console-tools files"
+ default ""
+ depends on BUSYBOX_SETFONT
+ help
+ Directory to use if setfont's params are simple filenames
+ (not /path/to/file or ./file). Default is "" (no default directory).
+
+config BUSYBOX_SETKEYCODES
+ bool "setkeycodes"
+ default n
+ help
+ This program loads entries into the kernel's scancode-to-keycode
+ map, allowing unusual keyboards to generate usable keycodes.
+
+config BUSYBOX_SETLOGCONS
+ bool "setlogcons"
+ default n
+ help
+ This program redirects the output console of kernel messages.
+
+config BUSYBOX_SHOWKEY
+ bool "showkey"
+ default n
+ help
+ Shows keys pressed.
+
+endmenu
diff --git a/package/busybox/config/coreutils/Config.in b/package/busybox/config/coreutils/Config.in
new file mode 100644
index 000000000..cd7a14083
--- /dev/null
+++ b/package/busybox/config/coreutils/Config.in
@@ -0,0 +1,827 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Coreutils"
+
+config BUSYBOX_BASENAME
+ bool "basename"
+ default y
+ help
+ basename is used to strip the directory and suffix from filenames,
+ leaving just the filename itself. Enable this option if you wish
+ to enable the 'basename' utility.
+
+config BUSYBOX_CAL
+ bool "cal"
+ default n
+ help
+ cal is used to display a monthly calender.
+
+config BUSYBOX_CAT
+ bool "cat"
+ default y
+ help
+ cat is used to concatenate files and print them to the standard
+ output. Enable this option if you wish to enable the 'cat' utility.
+
+config BUSYBOX_CATV
+ bool "catv"
+ default n
+ help
+ Display nonprinting characters as escape sequences (like some
+ implementations' cat -v option).
+
+config BUSYBOX_CHGRP
+ bool "chgrp"
+ default y
+ help
+ chgrp is used to change the group ownership of files.
+
+config BUSYBOX_CHMOD
+ bool "chmod"
+ default y
+ help
+ chmod is used to change the access permission of files.
+
+config BUSYBOX_CHOWN
+ bool "chown"
+ default y
+ help
+ chown is used to change the user and/or group ownership
+ of files.
+
+config BUSYBOX_CHROOT
+ bool "chroot"
+ default y
+ help
+ chroot is used to change the root directory and run a command.
+ The default command is `/bin/sh'.
+
+config BUSYBOX_CKSUM
+ bool "cksum"
+ default y
+ help
+ cksum is used to calculate the CRC32 checksum of a file.
+
+config BUSYBOX_COMM
+ bool "comm"
+ default n
+ help
+ comm is used to compare two files line by line and return
+ a three-column output.
+
+config BUSYBOX_CP
+ bool "cp"
+ default y
+ help
+ cp is used to copy files and directories.
+
+config BUSYBOX_CUT
+ bool "cut"
+ default y
+ help
+ cut is used to print selected parts of lines from
+ each file to stdout.
+
+config BUSYBOX_DATE
+ bool "date"
+ default y
+ help
+ date is used to set the system date or display the
+ current time in the given format.
+
+config BUSYBOX_FEATURE_DATE_ISOFMT
+ bool "Enable ISO date format output (-I)"
+ default y
+ depends on BUSYBOX_DATE
+ help
+ Enable option (-I) to output an ISO-8601 compliant
+ date/time string.
+
+config BUSYBOX_DD
+ bool "dd"
+ default y
+ help
+ dd copies a file (from standard input to standard output,
+ by default) using specific input and output blocksizes,
+ while optionally performing conversions on it.
+
+config BUSYBOX_FEATURE_DD_SIGNAL_HANDLING
+ bool "Enable DD signal handling for status reporting"
+ default y
+ depends on BUSYBOX_DD
+ help
+ sending a SIGUSR1 signal to a running `dd' process makes it
+ print to standard error the number of records read and written
+ so far, then to resume copying.
+
+ $ dd if=/dev/zero of=/dev/null&
+ $ pid=$! kill -USR1 $pid; sleep 1; kill $pid
+ 10899206+0 records in 10899206+0 records out
+
+config BUSYBOX_FEATURE_DD_IBS_OBS
+ bool "Enable ibs, obs and conv options"
+ default y
+ depends on BUSYBOX_DD
+ help
+ Enables support for writing a certain number of bytes in and out,
+ at a time, and performing conversions on the data stream.
+
+config BUSYBOX_DF
+ bool "df"
+ default y
+ help
+ df reports the amount of disk space used and available
+ on filesystems.
+
+config BUSYBOX_FEATURE_DF_FANCY
+ bool "Enable -a, -i, -B"
+ default y
+ depends on BUSYBOX_DF
+ help
+ This option enables -a, -i and -B.
+
+config BUSYBOX_DIRNAME
+ bool "dirname"
+ default y
+ help
+ dirname is used to strip a non-directory suffix from
+ a file name.
+
+config BUSYBOX_DOS2UNIX
+ bool "dos2unix/unix2dos"
+ default y
+ help
+ dos2unix is used to convert a text file from DOS format to
+ UNIX format, and vice versa.
+
+config BUSYBOX_UNIX2DOS
+ bool
+ default y
+ depends on BUSYBOX_DOS2UNIX
+ help
+ unix2dos is used to convert a text file from UNIX format to
+ DOS format, and vice versa.
+
+config BUSYBOX_DU
+ bool "du (default blocksize of 512 bytes)"
+ default y
+ help
+ du is used to report the amount of disk space used
+ for specified files.
+
+config BUSYBOX_FEATURE_DU_DEFAULT_BLOCKSIZE_1K
+ bool "Use a default blocksize of 1024 bytes (1K)"
+ default y
+ depends on BUSYBOX_DU
+ help
+ Use a blocksize of (1K) instead of the default 512b.
+
+config BUSYBOX_ECHO
+ bool "echo (basic SuSv3 version taking no options)"
+ default y
+ help
+ echo is used to print a specified string to stdout.
+
+# this entry also appears in shell/Config.in, next to the echo builtin
+config BUSYBOX_FEATURE_FANCY_ECHO
+ bool "Enable echo options (-n and -e)"
+ default y
+ depends on BUSYBOX_ECHO || BUSYBOX_ASH_BUILTIN_ECHO
+ help
+ This adds options (-n and -e) to echo.
+
+config BUSYBOX_ENV
+ bool "env"
+ default y
+ help
+ env is used to set an environment variable and run
+ a command; without options it displays the current
+ environment.
+
+config BUSYBOX_FEATURE_ENV_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_ENV && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the env applet.
+
+config BUSYBOX_EXPAND
+ bool "expand"
+ default n
+ help
+ By default, convert all tabs to spaces.
+
+config BUSYBOX_FEATURE_EXPAND_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_EXPAND && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the expand applet.
+
+config BUSYBOX_EXPR
+ bool "expr"
+ default y
+ help
+ expr is used to calculate numbers and print the result
+ to standard output.
+
+config BUSYBOX_EXPR_MATH_SUPPORT_64
+ bool "Extend Posix numbers support to 64 bit"
+ default n
+ depends on BUSYBOX_EXPR
+ help
+ Enable 64-bit math support in the expr applet. This will make
+ the applet slightly larger, but will allow computation with very
+ large numbers.
+
+config BUSYBOX_FALSE
+ bool "false"
+ default y
+ help
+ false returns an exit code of FALSE (1).
+
+config BUSYBOX_FOLD
+ bool "fold"
+ default n
+ help
+ Wrap text to fit a specific width.
+
+config BUSYBOX_HEAD
+ bool "head"
+ default y
+ help
+ head is used to print the first specified number of lines
+ from files.
+
+config BUSYBOX_FEATURE_FANCY_HEAD
+ bool "Enable head options (-c, -q, and -v)"
+ default y
+ depends on BUSYBOX_HEAD
+ help
+ This enables the head options (-c, -q, and -v).
+
+config BUSYBOX_HOSTID
+ bool "hostid"
+ default n
+ help
+ hostid prints the numeric identifier (in hexadecimal) for
+ the current host.
+
+config BUSYBOX_ID
+ bool "id"
+ default y
+ help
+ id displays the current user and group ID names.
+
+config BUSYBOX_INSTALL
+ bool "install"
+ default n
+ help
+ Copy files and set attributes.
+
+config BUSYBOX_FEATURE_INSTALL_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_INSTALL && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the install applet.
+
+config BUSYBOX_LENGTH
+ bool "length"
+ default n
+ help
+ length is used to print out the length of a specified string.
+
+config BUSYBOX_LN
+ bool "ln"
+ default y
+ help
+ ln is used to create hard or soft links between files.
+
+config BUSYBOX_LOGNAME
+ bool "logname"
+ default n
+ help
+ logname is used to print the current user's login name.
+
+config BUSYBOX_LS
+ bool "ls"
+ default y
+ help
+ ls is used to list the contents of directories.
+
+config BUSYBOX_FEATURE_LS_FILETYPES
+ bool "Enable filetyping options (-p and -F)"
+ default y
+ depends on BUSYBOX_LS
+ help
+ Enable the ls options (-p and -F).
+
+config BUSYBOX_FEATURE_LS_FOLLOWLINKS
+ bool "Enable symlinks dereferencing (-L)"
+ default y
+ depends on BUSYBOX_LS
+ help
+ Enable the ls option (-L).
+
+config BUSYBOX_FEATURE_LS_RECURSIVE
+ bool "Enable recursion (-R)"
+ default y
+ depends on BUSYBOX_LS
+ help
+ Enable the ls option (-R).
+
+config BUSYBOX_FEATURE_LS_SORTFILES
+ bool "Sort the file names"
+ default y
+ depends on BUSYBOX_LS
+ help
+ Allow ls to sort file names alphabetically.
+
+config BUSYBOX_FEATURE_LS_TIMESTAMPS
+ bool "Show file timestamps"
+ default y
+ depends on BUSYBOX_LS
+ help
+ Allow ls to display timestamps for files.
+
+config BUSYBOX_FEATURE_LS_USERNAME
+ bool "Show username/groupnames"
+ default y
+ depends on BUSYBOX_LS
+ help
+ Allow ls to display username/groupname for files.
+
+config BUSYBOX_FEATURE_LS_COLOR
+ bool "Allow use of color to identify file types"
+ default n
+ depends on BUSYBOX_LS && BUSYBOX_GETOPT_LONG
+ help
+ This enables the --color option to ls.
+
+config BUSYBOX_FEATURE_LS_COLOR_IS_DEFAULT
+ bool "Produce colored ls output by default"
+ default n
+ depends on BUSYBOX_FEATURE_LS_COLOR
+ help
+ Saying yes here will turn coloring on by default,
+ even if no "--color" option is given to the ls command.
+ This is not recommended, since the colors are not
+ configurable, and the output may not be legible on
+ many output screens.
+
+config BUSYBOX_MD5SUM
+ bool "md5sum"
+ default y
+ help
+ md5sum is used to print or check MD5 checksums.
+
+config BUSYBOX_MKDIR
+ bool "mkdir"
+ default y
+ help
+ mkdir is used to create directories with the specified names.
+
+config BUSYBOX_FEATURE_MKDIR_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_MKDIR && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the mkdir applet.
+
+config BUSYBOX_MKFIFO
+ bool "mkfifo"
+ default y
+ help
+ mkfifo is used to create FIFOs (named pipes).
+ The `mknod' program can also create FIFOs.
+
+config BUSYBOX_MKNOD
+ bool "mknod"
+ default y
+ help
+ mknod is used to create FIFOs or block/character special
+ files with the specified names.
+
+config BUSYBOX_MV
+ bool "mv"
+ default y
+ help
+ mv is used to move or rename files or directories.
+
+config BUSYBOX_FEATURE_MV_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_MV && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the mv applet.
+
+config BUSYBOX_NICE
+ bool "nice"
+ default y
+ help
+ nice runs a program with modified scheduling priority.
+
+config BUSYBOX_NOHUP
+ bool "nohup"
+ default y
+ help
+ run a command immune to hangups, with output to a non-tty.
+
+config BUSYBOX_OD
+ bool "od"
+ default n
+ help
+ od is used to dump binary files in octal and other formats.
+
+config BUSYBOX_PRINTENV
+ bool "printenv"
+ default n
+ help
+ printenv is used to print all or part of environment.
+
+config BUSYBOX_PRINTF
+ bool "printf"
+ default y
+ help
+ printf is used to format and print specified strings.
+ It's similar to `echo' except it has more options.
+
+config BUSYBOX_PWD
+ bool "pwd"
+ default y
+ help
+ pwd is used to print the current directory.
+
+config BUSYBOX_READLINK
+ bool "readlink"
+ default y
+ help
+ This program reads a symbolic link and returns the name
+ of the file it points to
+
+config BUSYBOX_FEATURE_READLINK_FOLLOW
+ bool "Enable canonicalization by following all symlinks (-f)"
+ default y
+ depends on BUSYBOX_READLINK
+ help
+ Enable the readlink option (-f).
+
+config BUSYBOX_REALPATH
+ bool "realpath"
+ default n
+ help
+ Return the canonicalized absolute pathname.
+ This isn't provided by GNU shellutils, but where else does it belong.
+
+config BUSYBOX_RM
+ bool "rm"
+ default y
+ help
+ rm is used to remove files or directories.
+
+config BUSYBOX_RMDIR
+ bool "rmdir"
+ default n
+ help
+ rmdir is used to remove empty directories.
+
+config BUSYBOX_FEATURE_RMDIR_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_RMDIR && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the rmdir applet, including
+ --ignore-fail-on-non-empty for compatibility with GNU rmdir.
+
+config BUSYBOX_SEQ
+ bool "seq"
+ default y
+ help
+ print a sequence of numbers
+
+config BUSYBOX_SHA1SUM
+ bool "sha1sum"
+ default y
+ help
+ Compute and check SHA1 message digest
+
+config BUSYBOX_SLEEP
+ bool "sleep"
+ default y
+ help
+ sleep is used to pause for a specified number of seconds.
+ It comes in 3 versions:
+ - small: takes one integer parameter
+ - fancy: takes multiple integer arguments with suffixes:
+ sleep 1d 2h 3m 15s
+ - fancy with fractional numbers:
+ sleep 2.3s 4.5h sleeps for 16202.3 seconds
+ Last one is "the most compatible" with coreutils sleep,
+ but it adds around 1k of code.
+
+config BUSYBOX_FEATURE_FANCY_SLEEP
+ bool "Enable multiple arguments and s/m/h/d suffixes"
+ default n
+ depends on BUSYBOX_SLEEP
+ help
+ Allow sleep to pause for specified minutes, hours, and days.
+
+config BUSYBOX_FEATURE_FLOAT_SLEEP
+ bool "Enable fractional arguments"
+ default n
+ depends on BUSYBOX_FEATURE_FANCY_SLEEP
+ help
+ Allow for fractional numeric parameters.
+
+config BUSYBOX_SORT
+ bool "sort"
+ default y
+ help
+ sort is used to sort lines of text in specified files.
+
+config BUSYBOX_FEATURE_SORT_BIG
+ bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)"
+ default n
+ depends on BUSYBOX_SORT
+ help
+ Without this, sort only supports -r, -u, and an integer version
+ of -n. Selecting this adds sort keys, floating point support, and
+ more. This adds a little over 3k to a nonstatic build on x86.
+
+ The SuSv3 sort standard is available at:
+ http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html
+
+config BUSYBOX_SPLIT
+ bool "split"
+ default n
+ help
+ split a file into pieces.
+
+config BUSYBOX_FEATURE_SPLIT_FANCY
+ bool "Fancy extensions"
+ default n
+ depends on BUSYBOX_SPLIT
+ help
+ Add support for features not required by SUSv3.
+ Supports additional suffixes 'b' for 512 bytes,
+ 'g' for 1GiB for the -b option.
+
+config BUSYBOX_STAT
+ bool "stat"
+ default n
+ help
+ display file or filesystem status.
+
+config BUSYBOX_FEATURE_STAT_FORMAT
+ bool "Enable custom formats (-c)"
+ default n
+ depends on BUSYBOX_STAT
+ help
+ Without this, stat will not support the '-c format' option where
+ users can pass a custom format string for output. This adds about
+ 7k to a nonstatic build on amd64.
+
+config BUSYBOX_STTY
+ bool "stty"
+ default y
+ help
+ stty is used to change and print terminal line settings.
+
+config BUSYBOX_SUM
+ bool "sum"
+ default n
+ help
+ checksum and count the blocks in a file
+
+config BUSYBOX_SYNC
+ bool "sync"
+ default y
+ help
+ sync is used to flush filesystem buffers.
+
+config BUSYBOX_TAC
+ bool "tac"
+ default n
+ help
+ tac is used to concatenate and print files in reverse.
+
+config BUSYBOX_TAIL
+ bool "tail"
+ default y
+ help
+ tail is used to print the last specified number of lines
+ from files.
+
+config BUSYBOX_FEATURE_FANCY_TAIL
+ bool "Enable extra tail options (-q, -s, and -v)"
+ default n
+ depends on BUSYBOX_TAIL
+ help
+ The options (-q, -s, and -v) are provided by GNU tail, but
+ are not specific in the SUSv3 standard.
+
+config BUSYBOX_TEE
+ bool "tee"
+ default y
+ help
+ tee is used to read from standard input and write
+ to standard output and files.
+
+config BUSYBOX_FEATURE_TEE_USE_BLOCK_IO
+ bool "Enable block I/O (larger/faster) instead of byte I/O"
+ default n
+ depends on BUSYBOX_TEE
+ help
+ Enable this option for a faster tee, at expense of size.
+
+config BUSYBOX_TEST
+ bool "test"
+ default y
+ help
+ test is used to check file types and compare values,
+ returning an appropriate exit code. The bash shell
+ has test built in, ash can build it in optionally.
+
+config BUSYBOX_FEATURE_TEST_64
+ bool "Extend test to 64 bit"
+ default n
+ depends on BUSYBOX_TEST || BUSYBOX_ASH_BUILTIN_TEST
+ help
+ Enable 64-bit support in test.
+
+config BUSYBOX_TOUCH
+ bool "touch"
+ default y
+ help
+ touch is used to create or change the access and/or
+ modification timestamp of specified files.
+
+config BUSYBOX_TR
+ bool "tr"
+ default y
+ help
+ tr is used to squeeze, and/or delete characters from standard
+ input, writing to standard output.
+
+config BUSYBOX_FEATURE_TR_CLASSES
+ bool "Enable character classes (such as [:upper:])"
+ default y
+ depends on BUSYBOX_TR
+ help
+ Enable character classes, enabling commands such as:
+ tr [:upper:] [:lower:] to convert input into lowercase.
+
+config BUSYBOX_FEATURE_TR_EQUIV
+ bool "Enable equivalence classes"
+ default n
+ depends on BUSYBOX_TR
+ help
+ Enable equivalence classes, which essentially add the enclosed
+ character to the current set. For instance, tr [=a=] xyz would
+ replace all instances of 'a' with 'xyz'. This option is mainly
+ useful for cases when no other way of expressing a character
+ is possible.
+
+config BUSYBOX_TRUE
+ bool "true"
+ default y
+ help
+ true returns an exit code of TRUE (0).
+
+config BUSYBOX_TTY
+ bool "tty"
+ default n
+ help
+ tty is used to print the name of the current terminal to
+ standard output.
+
+config BUSYBOX_UNAME
+ bool "uname"
+ default y
+ help
+ uname is used to print system information.
+
+config BUSYBOX_UNEXPAND
+ bool "unexpand"
+ default n
+ help
+ By default, convert only leading sequences of blanks to tabs.
+
+config BUSYBOX_FEATURE_UNEXPAND_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_UNEXPAND && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the unexpand applet.
+
+config BUSYBOX_UNIQ
+ bool "uniq"
+ default y
+ help
+ uniq is used to remove duplicate lines from a sorted file.
+
+config BUSYBOX_USLEEP
+ bool "usleep"
+ default n
+ help
+ usleep is used to pause for a specified number of microseconds.
+
+config BUSYBOX_UUDECODE
+ bool "uudecode"
+ default n
+ help
+ uudecode is used to decode a uuencoded file.
+
+config BUSYBOX_UUENCODE
+ bool "uuencode"
+ default n
+ help
+ uuencode is used to uuencode a file.
+
+config BUSYBOX_WC
+ bool "wc"
+ default y
+ help
+ wc is used to print the number of bytes, words, and lines,
+ in specified files.
+
+config BUSYBOX_FEATURE_WC_LARGE
+ bool "Support very large files in wc"
+ default n
+ depends on BUSYBOX_WC
+ help
+ Use "unsigned long long" in wc for count variables.
+
+config BUSYBOX_WHO
+ bool "who"
+ default y
+ select BUSYBOX_FEATURE_UTMP
+ help
+ who is used to show who is logged on.
+
+config BUSYBOX_WHOAMI
+ bool "whoami"
+ default n
+ help
+ whoami is used to print the username of the current
+ user id (same as id -un).
+
+config BUSYBOX_YES
+ bool "yes"
+ default y
+ help
+ yes is used to repeatedly output a specific string, or
+ the default string `y'.
+
+comment "Common options for cp and mv"
+ depends on BUSYBOX_CP || BUSYBOX_MV
+
+config BUSYBOX_FEATURE_PRESERVE_HARDLINKS
+ bool "Preserve hard links"
+ default y
+ depends on BUSYBOX_CP || BUSYBOX_MV
+ help
+ Allow cp and mv to preserve hard links.
+
+comment "Common options for ls, more and telnet"
+ depends on BUSYBOX_LS || BUSYBOX_MORE || BUSYBOX_TELNET
+
+config BUSYBOX_FEATURE_AUTOWIDTH
+ bool "Calculate terminal & column widths"
+ default y
+ depends on BUSYBOX_LS || BUSYBOX_MORE || BUSYBOX_TELNET
+ help
+ This option allows utilities such as 'ls', 'more' and 'telnet'
+ to determine the width of the screen, which can allow them to
+ display additional text or avoid wrapping text onto the next line.
+ If you leave this disabled, your utilities will be especially
+ primitive and will be unable to determine the current screen width.
+
+comment "Common options for df, du, ls"
+ depends on BUSYBOX_DF || BUSYBOX_DU || BUSYBOX_LS
+
+config BUSYBOX_FEATURE_HUMAN_READABLE
+ bool "Support for human readable output (example 13k, 23M, 235G)"
+ default y
+ depends on BUSYBOX_DF || BUSYBOX_DU || BUSYBOX_LS
+ help
+ Allow df, du, and ls to have human readable output.
+
+comment "Common options for md5sum, sha1sum"
+ depends on BUSYBOX_MD5SUM || BUSYBOX_SHA1SUM
+
+config BUSYBOX_FEATURE_MD5_SHA1_SUM_CHECK
+ bool "Enable -c, -s and -w options"
+ default y
+ depends on BUSYBOX_MD5SUM || BUSYBOX_SHA1SUM
+ help
+ Enabling the -c options allows files to be checked
+ against pre-calculated hash values.
+
+ -s and -w are useful options when verifying checksums.
+
+endmenu
diff --git a/package/busybox/config/debianutils/Config.in b/package/busybox/config/debianutils/Config.in
new file mode 100644
index 000000000..218422312
--- /dev/null
+++ b/package/busybox/config/debianutils/Config.in
@@ -0,0 +1,84 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Debian Utilities"
+
+config BUSYBOX_MKTEMP
+ bool "mktemp"
+ default y
+ help
+ mktemp is used to create unique temporary files
+
+config BUSYBOX_PIPE_PROGRESS
+ bool "pipe_progress"
+ default n
+ help
+ Display a dot to indicate pipe activity.
+
+config BUSYBOX_RUN_PARTS
+ bool "run-parts"
+ default y
+ help
+ run-parts is a utility designed to run all the scripts in a directory.
+
+ It is useful to set up a directory like cron.daily, where you need to
+ execute all the scripts in that directory.
+
+ In this implementation of run-parts some features (such as report
+ mode) are not implemented.
+
+ Unless you know that run-parts is used in some of your scripts
+ you can safely say N here.
+
+config BUSYBOX_FEATURE_RUN_PARTS_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_RUN_PARTS && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the run-parts applet.
+
+config BUSYBOX_FEATURE_RUN_PARTS_FANCY
+ bool "Support additional arguments"
+ default n
+ depends on BUSYBOX_RUN_PARTS
+ help
+ Support additional options:
+ -l --list print the names of the all matching files (not
+ limited to executables), but don't actually run them.
+
+config BUSYBOX_START_STOP_DAEMON
+ bool "start-stop-daemon"
+ default n
+ help
+ start-stop-daemon is used to control the creation and
+ termination of system-level processes, usually the ones
+ started during the startup of the system.
+
+config BUSYBOX_FEATURE_START_STOP_DAEMON_FANCY
+ bool "Support additional arguments"
+ default n
+ depends on BUSYBOX_START_STOP_DAEMON
+ help
+ Support additional arguments.
+ -o|--oknodo ignored since we exit with 0 anyway
+ -v|--verbose
+ -N|--nicelevel N
+
+config BUSYBOX_FEATURE_START_STOP_DAEMON_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_START_STOP_DAEMON && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the start-stop-daemon applet.
+
+config BUSYBOX_WHICH
+ bool "which"
+ default y
+ help
+ which is used to find programs in your PATH and
+ print out their pathnames.
+
+endmenu
+
diff --git a/package/busybox/config/e2fsprogs/Config.in b/package/busybox/config/e2fsprogs/Config.in
new file mode 100644
index 000000000..ac3850e63
--- /dev/null
+++ b/package/busybox/config/e2fsprogs/Config.in
@@ -0,0 +1,68 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Linux Ext2 FS Progs"
+
+config BUSYBOX_CHATTR
+ bool "chattr"
+ default n
+ help
+ chattr changes the file attributes on a second extended file system.
+
+### config E2FSCK
+### bool "e2fsck"
+### default n
+### help
+### e2fsck is used to check Linux second extended file systems (ext2fs).
+### e2fsck also supports ext2 filesystems countaining a journal (ext3).
+### The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also
+### provided.
+
+config BUSYBOX_FSCK
+ bool "fsck"
+ default n
+ help
+ fsck is used to check and optionally repair one or more filesystems.
+ In actuality, fsck is simply a front-end for the various file system
+ checkers (fsck.fstype) available under Linux.
+
+config BUSYBOX_LSATTR
+ bool "lsattr"
+ default n
+ help
+ lsattr lists the file attributes on a second extended file system.
+
+### config MKE2FS
+### bool "mke2fs"
+### default n
+### help
+### mke2fs is used to create an ext2/ext3 filesystem. The normal compat
+### symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided.
+
+### config TUNE2FS
+### bool "tune2fs"
+### default n
+### help
+### tune2fs allows the system administrator to adjust various tunable
+### filesystem parameters on Linux ext2/ext3 filesystems.
+
+### config E2LABEL
+### bool "e2label"
+### default n
+### depends on BUSYBOX_TUNE2FS
+### help
+### e2label will display or change the filesystem label on the ext2
+### filesystem located on device.
+
+### NB: this one is now provided by util-linux/volume_id/*
+### config FINDFS
+### bool "findfs"
+### default n
+### depends on BUSYBOX_TUNE2FS
+### help
+### findfs will search the disks in the system looking for a filesystem
+### which has a label matching label or a UUID equal to uuid.
+
+endmenu
diff --git a/package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in b/package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in
new file mode 100644
index 000000000..f07b54c3d
--- /dev/null
+++ b/package/busybox/config/e2fsprogs/old_e2fsprogs/Config.in
@@ -0,0 +1,67 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Linux Ext2 FS Progs"
+
+config BUSYBOX_CHATTR
+ bool "chattr"
+ default n
+ help
+ chattr changes the file attributes on a second extended file system.
+
+config BUSYBOX_E2FSCK
+ bool "e2fsck"
+ default n
+ help
+ e2fsck is used to check Linux second extended file systems (ext2fs).
+ e2fsck also supports ext2 filesystems countaining a journal (ext3).
+ The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also
+ provided.
+
+config BUSYBOX_FSCK
+ bool "fsck"
+ default n
+ help
+ fsck is used to check and optionally repair one or more filesystems.
+ In actuality, fsck is simply a front-end for the various file system
+ checkers (fsck.fstype) available under Linux.
+
+config BUSYBOX_LSATTR
+ bool "lsattr"
+ default n
+ help
+ lsattr lists the file attributes on a second extended file system.
+
+config BUSYBOX_MKE2FS
+ bool "mke2fs"
+ default n
+ help
+ mke2fs is used to create an ext2/ext3 filesystem. The normal compat
+ symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided.
+
+config BUSYBOX_TUNE2FS
+ bool "tune2fs"
+ default n
+ help
+ tune2fs allows the system administrator to adjust various tunable
+ filesystem parameters on Linux ext2/ext3 filesystems.
+
+config BUSYBOX_E2LABEL
+ bool "e2label"
+ default n
+ depends on BUSYBOX_TUNE2FS
+ help
+ e2label will display or change the filesystem label on the ext2
+ filesystem located on device.
+
+config BUSYBOX_FINDFS
+ bool "findfs"
+ default n
+ depends on BUSYBOX_TUNE2FS
+ help
+ findfs will search the disks in the system looking for a filesystem
+ which has a label matching label or a UUID equal to uuid.
+
+endmenu
diff --git a/package/busybox/config/editors/Config.in b/package/busybox/config/editors/Config.in
new file mode 100644
index 000000000..cce9675df
--- /dev/null
+++ b/package/busybox/config/editors/Config.in
@@ -0,0 +1,196 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Editors"
+
+config BUSYBOX_AWK
+ bool "awk"
+ default y
+ help
+ Awk is used as a pattern scanning and processing language. This is
+ the BusyBox implementation of that programming language.
+
+config BUSYBOX_FEATURE_AWK_LIBM
+ bool "Enable math functions (requires libm)"
+ default y
+ depends on BUSYBOX_AWK
+ help
+ Enable math functions of the Awk programming language.
+ NOTE: This will require libm to be present for linking.
+
+config BUSYBOX_CMP
+ bool "cmp"
+ default n
+ help
+ cmp is used to compare two files and returns the result
+ to standard output.
+
+config BUSYBOX_DIFF
+ bool "diff"
+ default y
+ help
+ diff compares two files or directories and outputs the
+ differences between them in a form that can be given to
+ the patch command.
+
+config BUSYBOX_FEATURE_DIFF_BINARY
+ bool "Enable checks for binary files"
+ default y
+ depends on BUSYBOX_DIFF
+ help
+ This option enables support for checking for binary files
+ before a comparison is carried out.
+
+config BUSYBOX_FEATURE_DIFF_DIR
+ bool "Enable directory support"
+ default y
+ depends on BUSYBOX_DIFF
+ help
+ This option enables support for directory and subdirectory
+ comparison.
+
+config BUSYBOX_FEATURE_DIFF_MINIMAL
+ bool "Enable -d option to find smaller sets of changes"
+ default n
+ depends on BUSYBOX_DIFF
+ help
+ Enabling this option allows the use of -d to make diff
+ try hard to find the smallest possible set of changes.
+
+config BUSYBOX_ED
+ bool "ed"
+ default n
+ help
+ The original 1970's Unix text editor, from the days of teletypes.
+ Small, simple, evil. Part of SUSv3. If you're not already using
+ this, you don't need it.
+
+config BUSYBOX_PATCH
+ bool "patch"
+ default n
+ help
+ Apply a unified diff formatted patch.
+
+config BUSYBOX_SED
+ bool "sed"
+ default y
+ help
+ sed is used to perform text transformations on a file
+ or input from a pipeline.
+
+config BUSYBOX_VI
+ bool "vi"
+ default y
+ help
+ 'vi' is a text editor. More specifically, it is the One True
+ text editor <grin>. It does, however, have a rather steep
+ learning curve. If you are not already comfortable with 'vi'
+ you may wish to use something else.
+
+config BUSYBOX_FEATURE_VI_MAX_LEN
+ int "Maximum screen width in vi"
+ range 256 16384
+ default 4096
+ depends on BUSYBOX_VI
+ help
+ Contrary to what you may think, this is not eating much.
+ Make it smaller than 4k only if you are very limited on memory.
+
+config BUSYBOX_FEATURE_VI_8BIT
+ bool "Allow vi to display 8-bit chars (otherwise shows dots)"
+ default y
+ depends on BUSYBOX_VI
+ help
+ If your terminal can display characters with high bit set,
+ you may want to enable this. Note: vi is not Unicode-capable.
+ If your terminal combines several 8-bit bytes into one character
+ (as in Unicode mode), this will not work properly.
+
+config BUSYBOX_FEATURE_VI_COLON
+ bool "Enable \":\" colon commands (no \"ex\" mode)"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Enable a limited set of colon commands for vi. This does not
+ provide an "ex" mode.
+
+config BUSYBOX_FEATURE_VI_YANKMARK
+ bool "Enable yank/put commands and mark cmds"
+ default y
+ depends on BUSYBOX_VI
+ help
+ This will enable you to use yank and put, as well as mark in
+ busybox vi.
+
+config BUSYBOX_FEATURE_VI_SEARCH
+ bool "Enable search and replace cmds"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Select this if you wish to be able to do search and replace in
+ busybox vi.
+
+config BUSYBOX_FEATURE_VI_USE_SIGNALS
+ bool "Catch signals"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Selecting this option will make busybox vi signal aware. This will
+ make busybox vi support SIGWINCH to deal with Window Changes, catch
+ Ctrl-Z and Ctrl-C and alarms.
+
+config BUSYBOX_FEATURE_VI_DOT_CMD
+ bool "Remember previous cmd and \".\" cmd"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Make busybox vi remember the last command and be able to repeat it.
+
+config BUSYBOX_FEATURE_VI_READONLY
+ bool "Enable -R option and \"view\" mode"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Enable the read-only command line option, which allows the user to
+ open a file in read-only mode.
+
+config BUSYBOX_FEATURE_VI_SETOPTS
+ bool "Enable set-able options, ai ic showmatch"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Enable the editor to set some (ai, ic, showmatch) options.
+
+config BUSYBOX_FEATURE_VI_SET
+ bool "Support for :set"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Support for ":set".
+
+config BUSYBOX_FEATURE_VI_WIN_RESIZE
+ bool "Handle window resize"
+ default y
+ depends on BUSYBOX_VI
+ help
+ Make busybox vi behave nicely with terminals that get resized.
+
+config BUSYBOX_FEATURE_VI_OPTIMIZE_CURSOR
+ bool "Optimize cursor movement"
+ default y
+ depends on BUSYBOX_VI
+ help
+ This will make the cursor movement faster, but requires more memory
+ and it makes the applet a tiny bit larger.
+
+config BUSYBOX_FEATURE_ALLOW_EXEC
+ bool "Allow vi and awk to execute shell commands"
+ default y
+ depends on BUSYBOX_VI || BUSYBOX_AWK
+ help
+ Enables vi and awk features which allows user to execute
+ shell commands (using system() C call).
+
+endmenu
diff --git a/package/busybox/config/findutils/Config.in b/package/busybox/config/findutils/Config.in
new file mode 100644
index 000000000..6e428c887
--- /dev/null
+++ b/package/busybox/config/findutils/Config.in
@@ -0,0 +1,255 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Finding Utilities"
+
+config BUSYBOX_FIND
+ bool "find"
+ default y
+ help
+ find is used to search your system to find specified files.
+
+config BUSYBOX_FEATURE_FIND_PRINT0
+ bool "Enable -print0 option"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Causes output names to be separated by a null character
+ rather than a newline. This allows names that contain
+ newlines and other whitespace to be more easily
+ interpreted by other programs.
+
+config BUSYBOX_FEATURE_FIND_MTIME
+ bool "Enable modified time matching (-mtime option)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Allow searching based on the modification time of
+ files, in days.
+
+config BUSYBOX_FEATURE_FIND_MMIN
+ bool "Enable modified time matching (-mmin option)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Allow searching based on the modification time of
+ files, in minutes.
+
+config BUSYBOX_FEATURE_FIND_PERM
+ bool "Enable permissions matching (-perm option)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Enable searching based on file permissions.
+
+config BUSYBOX_FEATURE_FIND_TYPE
+ bool "Enable filetype matching (-type option)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Enable searching based on file type (file,
+ directory, socket, device, etc.).
+
+config BUSYBOX_FEATURE_FIND_XDEV
+ bool "Enable 'stay in filesystem' option (-xdev)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ This option allows find to restrict searches to a single filesystem.
+
+config BUSYBOX_FEATURE_FIND_MAXDEPTH
+ bool "Enable -maxdepth N option"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ This option enables -maxdepth N option.
+
+config BUSYBOX_FEATURE_FIND_NEWER
+ bool "Enable -newer option for comparing file mtimes"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the 'find -newer' option for finding any files which have
+ a modified time that is more recent than the specified FILE.
+
+config BUSYBOX_FEATURE_FIND_INUM
+ bool "Enable inode number matching (-inum option)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the 'find -inum' option for searching by inode number.
+
+config BUSYBOX_FEATURE_FIND_EXEC
+ bool "Enable -exec option allowing execution of commands"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the 'find -exec' option for executing commands based upon
+ the files matched.
+
+config BUSYBOX_FEATURE_FIND_USER
+ bool "Enable username/uid matching (-user option)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the 'find -user' option for searching by username or uid.
+
+config BUSYBOX_FEATURE_FIND_GROUP
+ bool "Enable group/gid matching (-group option)"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the 'find -group' option for searching by group name or gid.
+
+config BUSYBOX_FEATURE_FIND_NOT
+ bool "Enable the 'not' (!) operator"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the '!' operator to invert the test results.
+ If 'Enable full-blown desktop' is enabled, then will also support
+ the non-POSIX notation '-not'.
+
+config BUSYBOX_FEATURE_FIND_DEPTH
+ bool "Enable the -depth option"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Process each directory's contents before the directory itself.
+
+config BUSYBOX_FEATURE_FIND_PAREN
+ bool "Enable parens in options"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Enable usage of parens '(' to specify logical order of arguments.
+
+config BUSYBOX_FEATURE_FIND_SIZE
+ bool "Enable -size option allowing matching for file size"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the 'find -size' option for searching by file size.
+
+config BUSYBOX_FEATURE_FIND_PRUNE
+ bool "Enable -prune option allowing to exclude subdirectories"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ If the file is a directory, dont descend into it. Useful for
+ exclusion .svn and CVS directories.
+
+config BUSYBOX_FEATURE_FIND_EMPTY
+ bool "Enable -empty option matching empty files and directories"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ Support the 'find -empty' option for searching empty files
+ and directories.
+
+config BUSYBOX_FEATURE_FIND_DELETE
+ bool "Enable -delete option allowing to delete files"
+ default y
+ depends on BUSYBOX_FIND && BUSYBOX_FEATURE_FIND_DEPTH
+ help
+ Support the 'find -delete' option for deleting files and directories.
+ WARNING: This option can do much harm if used wrong. Busybox will not
+ try to protect the user from doing stupid things. Use with care.
+
+config BUSYBOX_FEATURE_FIND_PATH
+ bool "Enable -path option allowing to match pathname patterns"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ The -path option matches whole pathname instead of just filename.
+
+config BUSYBOX_FEATURE_FIND_REGEX
+ bool "Enable -regex: match pathname to regex"
+ default y
+ depends on BUSYBOX_FIND
+ help
+ The -regex option matches whole pathname against regular expression.
+
+config BUSYBOX_FEATURE_FIND_CONTEXT
+ bool "Enable -context option for matching security context"
+ default n
+ depends on BUSYBOX_FIND && BUSYBOX_SELINUX
+ help
+ Support the 'find -context' option for matching security context.
+
+config BUSYBOX_GREP
+ bool "grep"
+ default y
+ help
+ grep is used to search files for a specified pattern.
+
+config BUSYBOX_FEATURE_GREP_EGREP_ALIAS
+ bool "Support extended regular expressions (egrep & grep -E)"
+ default y
+ depends on BUSYBOX_GREP
+ help
+ Enabled support for extended regular expressions. Extended
+ regular expressions allow for alternation (foo|bar), grouping,
+ and various repetition operators.
+
+config BUSYBOX_FEATURE_GREP_FGREP_ALIAS
+ bool "Alias fgrep to grep -F"
+ default y
+ depends on BUSYBOX_GREP
+ help
+ fgrep sees the search pattern as a normal string rather than
+ regular expressions.
+ grep -F is always builtin, this just creates the fgrep alias.
+
+config BUSYBOX_FEATURE_GREP_CONTEXT
+ bool "Enable before and after context flags (-A, -B and -C)"
+ default y
+ depends on BUSYBOX_GREP
+ help
+ Print the specified number of leading (-B) and/or trailing (-A)
+ context surrounding our matching lines.
+ Print the specified number of context lines (-C).
+
+config BUSYBOX_XARGS
+ bool "xargs"
+ default y
+ help
+ xargs is used to execute a specified command on
+ every item from standard input.
+
+config BUSYBOX_FEATURE_XARGS_SUPPORT_CONFIRMATION
+ bool "Enable prompt and confirmation option -p"
+ default n
+ depends on BUSYBOX_XARGS
+ help
+ Support prompt the user about whether to run each command
+ line and read a line from the terminal.
+
+config BUSYBOX_FEATURE_XARGS_SUPPORT_QUOTES
+ bool "Enable support single and double quotes and backslash"
+ default n
+ depends on BUSYBOX_XARGS
+ help
+ Default xargs unsupport single and double quotes
+ and backslash for can use aruments with spaces.
+
+config BUSYBOX_FEATURE_XARGS_SUPPORT_TERMOPT
+ bool "Enable support options -x"
+ default n
+ depends on BUSYBOX_XARGS
+ help
+ Enable support exit if the size (see the -s or -n option)
+ is exceeded.
+
+config BUSYBOX_FEATURE_XARGS_SUPPORT_ZERO_TERM
+ bool "Enable null terminated option -0"
+ default n
+ depends on BUSYBOX_XARGS
+ help
+ Enable input filenames are terminated by a null character
+ instead of by whitespace, and the quotes and backslash
+ are not special.
+
+endmenu
diff --git a/package/busybox/config/init/Config.in b/package/busybox/config/init/Config.in
new file mode 100644
index 000000000..348509fb9
--- /dev/null
+++ b/package/busybox/config/init/Config.in
@@ -0,0 +1,102 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Init Utilities"
+
+config BUSYBOX_INIT
+ bool "init"
+ default y
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ init is the first program run when the system boots.
+
+config BUSYBOX_FEATURE_USE_INITTAB
+ bool "Support reading an inittab file"
+ default y
+ depends on BUSYBOX_INIT
+ help
+ Allow init to read an inittab file when the system boot.
+
+config BUSYBOX_FEATURE_KILL_REMOVED
+ bool "Support killing processes that have been removed from inittab"
+ default y
+ depends on BUSYBOX_FEATURE_USE_INITTAB
+ help
+ When respawn entries are removed from inittab and a SIGHUP is
+ sent to init, this feature will kill the processes that have
+ been removed.
+
+config BUSYBOX_FEATURE_KILL_DELAY
+ int "How long to wait between TERM and KILL (0 - send TERM only)" if FEATURE_KILL_REMOVED
+ range 0 1024
+ default 0
+ help
+ With nonzero setting, init sends TERM, forks, child waits N
+ seconds, sends KILL and exits. Setting it too high is unwise
+ (child will hang around for too long and can actually kill
+ wrong process!)
+
+config BUSYBOX_FEATURE_INIT_SCTTY
+ bool "Run commands with leading dash with controlling tty"
+ default n
+ depends on BUSYBOX_INIT
+ help
+ If this option is enabled, init will try to give a controlling
+ tty to any command which has leading hyphen (often it's "-/bin/sh").
+ More precisely, init will do "ioctl(STDIN_FILENO, TIOCSCTTY, 0)".
+ If device attached to STDIN_FILENO can be a ctty but is not yet
+ a ctty for other session, it will become this process' ctty.
+ This is not the traditional init behavour, but is often what you want
+ in an embedded system where the console is only accessed during
+ development or for maintenance.
+ NB: using cttyhack applet may work better.
+
+config BUSYBOX_FEATURE_INIT_SYSLOG
+ bool "Enable init to write to syslog"
+ default y
+ depends on BUSYBOX_INIT
+
+config BUSYBOX_FEATURE_EXTRA_QUIET
+ bool "Be _extra_ quiet on boot"
+ default n
+ depends on BUSYBOX_INIT
+ help
+ Prevent init from logging some messages to the console during boot.
+
+config BUSYBOX_FEATURE_INIT_COREDUMPS
+ bool "Support dumping core for child processes (debugging only)"
+ default n
+ depends on BUSYBOX_INIT
+ help
+ If this option is enabled and the file /.init_enable_core
+ exists, then init will call setrlimit() to allow unlimited
+ core file sizes. If this option is disabled, processes
+ will not generate any core files.
+
+config BUSYBOX_FEATURE_INITRD
+ bool "Support running init from within an initrd (not initramfs)"
+ default n
+ depends on BUSYBOX_INIT
+ help
+ Legacy support for running init under the old-style initrd. Allows
+ the name linuxrc to act as init, and it doesn't assume init is PID 1.
+
+ This does not apply to initramfs, which runs /init as PID 1 and
+ requires no special support.
+
+config BUSYBOX_HALT
+ bool "poweroff, halt, and reboot"
+ default y
+ help
+ Stop all processes and either halt, reboot, or power off the system.
+
+config BUSYBOX_MESG
+ bool "mesg"
+ default n
+ help
+ Mesg controls access to your terminal by others. It is typically
+ used to allow or disallow other users to write to your terminal
+
+endmenu
diff --git a/package/busybox/config/libbb/Config.in b/package/busybox/config/libbb/Config.in
new file mode 100644
index 000000000..db139538e
--- /dev/null
+++ b/package/busybox/config/libbb/Config.in
@@ -0,0 +1,154 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Busybox Library Tuning"
+
+config BUSYBOX_PASSWORD_MINLEN
+ int "Minimum password length"
+ default 6
+ range 5 32
+ help
+ Minimum allowable password length.
+
+config BUSYBOX_MD5_SIZE_VS_SPEED
+ int "MD5: Trade Bytes for Speed"
+ default 2
+ range 0 3
+ help
+ Trade binary size versus speed for the md5sum algorithm.
+ Approximate values running uClibc and hashing
+ linux-2.4.4.tar.bz2 were:
+ user times (sec) text size (386)
+ 0 (fastest) 1.1 6144
+ 1 1.4 5392
+ 2 3.0 5088
+ 3 (smallest) 5.1 4912
+
+config BUSYBOX_FEATURE_FAST_TOP
+ bool "Faster /proc scanning code (+100 bytes)"
+ default n
+ help
+ This option makes top (and ps) ~20% faster (or 20% less CPU hungry),
+ but code size is slightly bigger.
+
+config BUSYBOX_FEATURE_ETC_NETWORKS
+ bool "Support for /etc/networks"
+ default n
+ help
+ Enable support for network names in /etc/networks. This is
+ a rarely used feature which allows you to use names
+ instead of IP/mask pairs in route command.
+
+config BUSYBOX_FEATURE_EDITING
+ bool "Command line editing"
+ default y
+ help
+ Enable line editing (mainly for shell command line).
+
+config BUSYBOX_FEATURE_EDITING_MAX_LEN
+ int "Maximum length of input"
+ range 128 8192
+ default 1024
+ depends on BUSYBOX_FEATURE_EDITING
+ help
+ Line editing code uses on-stack buffers for storage.
+ You may want to decrease this parameter if your target machine
+ benefits from smaller stack usage.
+
+config BUSYBOX_FEATURE_EDITING_VI
+ bool "vi-style line editing commands"
+ default n
+ depends on BUSYBOX_FEATURE_EDITING
+ help
+ Enable vi-style line editing. In shells, this mode can be
+ turned on and off with "set -o vi" and "set +o vi".
+
+config BUSYBOX_FEATURE_EDITING_HISTORY
+ int "History size"
+ range 0 99999
+ default 15
+ depends on BUSYBOX_FEATURE_EDITING
+ help
+ Specify command history size.
+
+config BUSYBOX_FEATURE_EDITING_SAVEHISTORY
+ bool "History saving"
+ default n
+ depends on BUSYBOX_ASH && BUSYBOX_FEATURE_EDITING
+ help
+ Enable history saving in ash shell.
+
+config BUSYBOX_FEATURE_TAB_COMPLETION
+ bool "Tab completion"
+ default y
+ depends on BUSYBOX_FEATURE_EDITING
+ help
+ Enable tab completion.
+
+config BUSYBOX_FEATURE_USERNAME_COMPLETION
+ bool "Username completion"
+ default n
+ depends on BUSYBOX_FEATURE_TAB_COMPLETION
+ help
+ Enable username completion.
+
+config BUSYBOX_FEATURE_EDITING_FANCY_PROMPT
+ bool "Fancy shell prompts"
+ default n
+ depends on BUSYBOX_FEATURE_EDITING
+ help
+ Setting this option allows for prompts to use things like \w and
+ \$ and escape codes.
+
+config BUSYBOX_FEATURE_VERBOSE_CP_MESSAGE
+ bool "Give more precise messages when copy fails (cp, mv etc)"
+ default n
+ help
+ Error messages with this feature enabled:
+ $ cp file /does_not_exist/file
+ cp: cannot create '/does_not_exist/file': Path does not exist
+ $ cp file /vmlinuz/file
+ cp: cannot stat '/vmlinuz/file': Path has non-directory component
+ If this feature is not enabled, they will be, respectively:
+ cp: cannot remove '/does_not_exist/file': No such file or directory
+ cp: cannot stat '/vmlinuz/file': Not a directory
+ respectively.
+ This will cost you ~60 bytes.
+
+config BUSYBOX_FEATURE_COPYBUF_KB
+ int "Copy buffer size, in kilobytes"
+ range 1 1024
+ default 4
+ help
+ Size of buffer used by cp, mv, install etc.
+ Buffers which are 4 kb or less will be allocated on stack.
+ Bigger buffers will be allocated with mmap, with fallback to 4 kb
+ stack buffer if mmap fails.
+
+config BUSYBOX_MONOTONIC_SYSCALL
+ bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
+ default y
+ help
+ Use clock_gettime(CLOCK_MONOTONIC) syscall for measuring
+ time intervals (time, ping, traceroute etc need this).
+ Probably requires Linux 2.6+. If not selected, gettimeofday
+ will be used instead (which gives wrong results if date/time
+ is reset).
+
+config BUSYBOX_IOCTL_HEX2STR_ERROR
+ bool "Use ioctl names rather than hex values in error messages"
+ default y
+ help
+ Use ioctl names rather than hex values in error messages
+ (e.g. VT_DISALLOCATE rather than 0x5608). If disabled this
+ saves about 1400 bytes.
+
+config BUSYBOX_FEATURE_HWIB
+ bool "Support infiniband HW"
+ default n
+ help
+ Support for printing infiniband addresses in
+ network applets.
+endmenu
diff --git a/package/busybox/config/loginutils/Config.in b/package/busybox/config/loginutils/Config.in
new file mode 100644
index 000000000..35f89670d
--- /dev/null
+++ b/package/busybox/config/loginutils/Config.in
@@ -0,0 +1,283 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Login/Password Management Utilities"
+
+config BUSYBOX_FEATURE_SHADOWPASSWDS
+ bool "Support for shadow passwords"
+ default y
+ help
+ Build support for shadow password in /etc/shadow. This file is only
+ readable by root and thus the encrypted passwords are no longer
+ publicly readable.
+
+config BUSYBOX_USE_BB_PWD_GRP
+ bool "Use internal password and group functions rather than system functions"
+ default y
+ help
+ If you leave this disabled, busybox will use the system's password
+ and group functions. And if you are using the GNU C library
+ (glibc), you will then need to install the /etc/nsswitch.conf
+ configuration file and the required /lib/libnss_* libraries in
+ order for the password and group functions to work. This generally
+ makes your embedded system quite a bit larger.
+
+ Enabling this option will cause busybox to directly access the
+ system's /etc/password, /etc/group files (and your system will be
+ smaller, and I will get fewer emails asking about how glibc NSS
+ works). When this option is enabled, you will not be able to use
+ PAM to access remote LDAP password servers and whatnot. And if you
+ want hostname resolution to work with glibc, you still need the
+ /lib/libnss_* libraries.
+
+ If you need to use glibc's nsswitch.conf mechanism
+ (e.g. if user/group database is NOT stored in /etc/passwd etc),
+ you must NOT use this option.
+
+ If you enable this option, it will add about 1.5k.
+
+config BUSYBOX_USE_BB_SHADOW
+ bool "Use internal shadow password functions"
+ default y
+ depends on BUSYBOX_USE_BB_PWD_GRP && BUSYBOX_FEATURE_SHADOWPASSWDS
+ help
+ If you leave this disabled, busybox will use the system's shadow
+ password handling functions. And if you are using the GNU C library
+ (glibc), you will then need to install the /etc/nsswitch.conf
+ configuration file and the required /lib/libnss_* libraries in
+ order for the shadow password functions to work. This generally
+ makes your embedded system quite a bit larger.
+
+ Enabling this option will cause busybox to directly access the
+ system's /etc/shadow file when handling shadow passwords. This
+ makes your system smaller (and I will get fewer emails asking about
+ how glibc NSS works). When this option is enabled, you will not be
+ able to use PAM to access shadow passwords from remote LDAP
+ password servers and whatnot.
+
+config BUSYBOX_USE_BB_CRYPT
+ bool "Use internal DES and MD5 crypt functions"
+ default y
+ help
+ Busybox has internal DES and MD5 crypt functions.
+ They produce results which are identical to corresponding
+ standard C library functions.
+
+ If you leave this disabled, busybox will use the system's
+ crypt functions. Most C libraries use large (~70k)
+ static buffers there, and also combine them with more general
+ DES encryption/decryption.
+
+ For busybox, having large static buffers is undesirable,
+ especially on NOMMU machines. Busybox also doesn't need
+ DES encryption/decryption and can do with smaller code.
+
+ If you enable this option, it will add about 4.8k of code
+ if you are building dynamically linked executable.
+ In static build, it makes code _smaller_ by about 1.2k,
+ and likely many kilobytes less of bss.
+
+config BUSYBOX_ADDGROUP
+ bool "addgroup"
+ default y
+ help
+ Utility for creating a new group account.
+
+config BUSYBOX_FEATURE_ADDUSER_TO_GROUP
+ bool "Support for adding users to groups"
+ default n
+ depends on BUSYBOX_ADDGROUP
+ help
+ If called with two non-option arguments,
+ addgroup will add an existing user to an
+ existing group.
+
+config BUSYBOX_DELGROUP
+ bool "delgroup"
+ default y
+ help
+ Utility for deleting a group account.
+
+config BUSYBOX_FEATURE_DEL_USER_FROM_GROUP
+ bool "Support for removing users from groups"
+ default n
+ depends on BUSYBOX_DELGROUP
+ help
+ If called with two non-option arguments, deluser
+ or delgroup will remove an user from a specified group.
+
+config BUSYBOX_FEATURE_CHECK_NAMES
+ bool "Enable sanity check on user/group names in adduser and addgroup"
+ default n
+ depends on BUSYBOX_ADDUSER || BUSYBOX_ADDGROUP
+ help
+ Enable sanity check on user and group names in adduser and addgroup.
+ To avoid problems, the user or group name should consist only of
+ letters, digits, underscores, periods, at signs and dashes,
+ and not start with a dash (as defined by IEEE Std 1003.1-2001).
+ For compatibility with Samba machine accounts "$" is also supported
+ at the end of the user or group name.
+
+config BUSYBOX_ADDUSER
+ bool "adduser"
+ default y
+ help
+ Utility for creating a new user account.
+
+config BUSYBOX_FEATURE_ADDUSER_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_ADDUSER && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the adduser applet.
+
+config BUSYBOX_DELUSER
+ bool "deluser"
+ default y
+ help
+ Utility for deleting a user account.
+
+config BUSYBOX_GETTY
+ bool "getty"
+ default y
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ getty lets you log in on a tty, it is normally invoked by init.
+
+config BUSYBOX_FEATURE_UTMP
+ bool "Support utmp file"
+ depends on BUSYBOX_GETTY || BUSYBOX_LOGIN || BUSYBOX_SU || BUSYBOX_WHO
+ default y
+ help
+ The file /var/run/utmp is used to track who is currently logged in.
+
+config BUSYBOX_FEATURE_WTMP
+ bool "Support wtmp file"
+ depends on BUSYBOX_GETTY || BUSYBOX_LOGIN || BUSYBOX_SU || BUSYBOX_LAST
+ default y
+ select BUSYBOX_FEATURE_UTMP
+ help
+ The file /var/run/wtmp is used to track when user's have logged into
+ and logged out of the system.
+
+config BUSYBOX_LOGIN
+ bool "login"
+ default y
+ select BUSYBOX_FEATURE_SUID
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ login is used when signing onto a system.
+
+ Note that Busybox binary must be setuid root for this applet to
+ work properly.
+
+#config BUSYBOX_PAM
+# bool "Support for PAM (Pluggable Authentication Modules)"
+# default n
+# depends on BUSYBOX_LOGIN
+# help
+# Use PAM in login(1) instead of direct access to password database.
+
+config BUSYBOX_LOGIN_SCRIPTS
+ bool "Support for login scripts"
+ depends on BUSYBOX_LOGIN
+ default n
+ help
+ Enable this if you want login to execute $LOGIN_PRE_SUID_SCRIPT
+ just prior to switching from root to logged-in user.
+
+config BUSYBOX_FEATURE_NOLOGIN
+ bool "Support for /etc/nologin"
+ default y
+ depends on BUSYBOX_LOGIN
+ help
+ The file /etc/nologin is used by (some versions of) login(1).
+ If it exists, non-root logins are prohibited.
+
+config BUSYBOX_FEATURE_SECURETTY
+ bool "Support for /etc/securetty"
+ default y
+ depends on BUSYBOX_LOGIN
+ help
+ The file /etc/securetty is used by (some versions of) login(1).
+ The file contains the device names of tty lines (one per line,
+ without leading /dev/) on which root is allowed to login.
+
+config BUSYBOX_PASSWD
+ bool "passwd"
+ default y
+ select BUSYBOX_FEATURE_SUID
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ passwd changes passwords for user and group accounts. A normal user
+ may only change the password for his/her own account, the super user
+ may change the password for any account. The administrator of a group
+ may change the password for the group.
+
+ Note that Busybox binary must be setuid root for this applet to
+ work properly.
+
+config BUSYBOX_FEATURE_PASSWD_WEAK_CHECK
+ bool "Check new passwords for weakness"
+ default y
+ depends on BUSYBOX_PASSWD
+ help
+ With this option passwd will refuse new passwords which are "weak".
+
+config BUSYBOX_CRYPTPW
+ bool "cryptpw"
+ default n
+ help
+ Applet for crypting a string.
+
+config BUSYBOX_CHPASSWD
+ bool "chpasswd"
+ default n
+ help
+ chpasswd reads a file of user name and password pairs from
+ standard input and uses this information to update a group of
+ existing users.
+
+config BUSYBOX_SU
+ bool "su"
+ default y
+ select BUSYBOX_FEATURE_SUID
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ su is used to become another user during a login session.
+ Invoked without a username, su defaults to becoming the super user.
+
+ Note that Busybox binary must be setuid root for this applet to
+ work properly.
+
+config BUSYBOX_FEATURE_SU_SYSLOG
+ bool "Enable su to write to syslog"
+ default y
+ depends on BUSYBOX_SU
+
+config BUSYBOX_FEATURE_SU_CHECKS_SHELLS
+ bool "Enable su to check user's shell to be listed in /etc/shells"
+ depends on BUSYBOX_SU
+ default y
+
+config BUSYBOX_SULOGIN
+ bool "sulogin"
+ default n
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ sulogin is invoked when the system goes into single user
+ mode (this is done through an entry in inittab).
+
+config BUSYBOX_VLOCK
+ bool "vlock"
+ default n
+ select BUSYBOX_FEATURE_SUID
+ help
+ Build the "vlock" applet which allows you to lock (virtual) terminals.
+
+ Note that Busybox binary must be setuid root for this applet to
+ work properly.
+
+endmenu
diff --git a/package/busybox/config/mailutils/Config.in b/package/busybox/config/mailutils/Config.in
new file mode 100644
index 000000000..3dc52ed14
--- /dev/null
+++ b/package/busybox/config/mailutils/Config.in
@@ -0,0 +1,69 @@
+menu "Mail Utilities"
+
+config BUSYBOX_MAKEMIME
+ bool "makemime"
+ default n
+ help
+ Create MIME-formatted messages.
+
+config BUSYBOX_FEATURE_MIME_CHARSET
+ string "Default charset"
+ default "us-ascii"
+ depends on BUSYBOX_MAKEMIME || BUSYBOX_REFORMIME || BUSYBOX_SENDMAIL
+ help
+ Default charset of the message.
+
+config BUSYBOX_POPMAILDIR
+ bool "popmaildir"
+ default n
+ help
+ Simple yet powerful POP3 mail popper. Delivers content
+ of remote mailboxes to local Maildir.
+
+config BUSYBOX_FEATURE_POPMAILDIR_DELIVERY
+ bool "Allow message filters and custom delivery program"
+ default n
+ depends on BUSYBOX_POPMAILDIR
+ help
+ Allow to use a custom program to filter the content
+ of the message before actual delivery (-F "prog [args...]").
+ Allow to use a custom program for message actual delivery
+ (-M "prog [args...]").
+
+config BUSYBOX_REFORMIME
+ bool "reformime"
+ default n
+ help
+ Parse MIME-formatted messages.
+
+config BUSYBOX_FEATURE_REFORMIME_COMPAT
+ bool "Accept and ignore options other than -x and -X"
+ default y
+ depends on BUSYBOX_REFORMIME
+ help
+ Accept (for compatibility only) and ignore options
+ other than -x and -X.
+
+config BUSYBOX_SENDMAIL
+ bool "sendmail"
+ default n
+ help
+ Barebones sendmail.
+
+config BUSYBOX_FEATURE_SENDMAIL_MAILX
+ bool "Allow to specify subject, attachments, their charset etc"
+ default y
+ depends on BUSYBOX_SENDMAIL
+ help
+ Allow to specify subject, attachments and their charset.
+ Allow to use custom connection helper.
+
+config BUSYBOX_FEATURE_SENDMAIL_MAILXX
+ bool "Allow to specify Cc: addresses and some additional headers"
+ default n
+ depends on BUSYBOX_FEATURE_SENDMAIL_MAILX
+ help
+ Allow to specify Cc: addresses and some additional headers:
+ Errors-To:
+
+endmenu
diff --git a/package/busybox/config/miscutils/Config.in b/package/busybox/config/miscutils/Config.in
new file mode 100644
index 000000000..c7281edc5
--- /dev/null
+++ b/package/busybox/config/miscutils/Config.in
@@ -0,0 +1,552 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Miscellaneous Utilities"
+
+config BUSYBOX_ADJTIMEX
+ bool "adjtimex"
+ default n
+ help
+ Adjtimex reads and optionally sets adjustment parameters for
+ the Linux clock adjustment algorithm.
+
+config BUSYBOX_BBCONFIG
+ bool "bbconfig"
+ default n
+ help
+ The bbconfig applet will print the config file with which
+ busybox was built.
+
+config BUSYBOX_CHAT
+ bool "chat"
+ default n
+ help
+ Simple chat utility.
+
+config BUSYBOX_FEATURE_CHAT_NOFAIL
+ bool "Enable NOFAIL expect strings"
+ depends on BUSYBOX_CHAT
+ default y
+ help
+ When enabled expect strings which are started with a dash trigger
+ no-fail mode. That is when expectation is not met within timeout
+ the script is not terminated but sends next SEND string and waits
+ for next EXPECT string. This allows to compose far more flexible
+ scripts.
+
+config BUSYBOX_FEATURE_CHAT_TTY_HIFI
+ bool "Force STDIN to be a TTY"
+ depends on BUSYBOX_CHAT
+ default n
+ help
+ Original chat always treats STDIN as a TTY device and sets for it
+ so-called raw mode. This option turns on such behaviour.
+
+config BUSYBOX_FEATURE_CHAT_IMPLICIT_CR
+ bool "Enable implicit Carriage Return"
+ depends on BUSYBOX_CHAT
+ default y
+ help
+ When enabled make chat to terminate all SEND strings with a "\r"
+ unless "\c" is met anywhere in the string.
+
+config BUSYBOX_FEATURE_CHAT_SWALLOW_OPTS
+ bool "Swallow options"
+ depends on BUSYBOX_CHAT
+ default n
+ help
+ Busybox chat require no options. To make it not fail when used
+ in place of original chat (which has a bunch of options) turn
+ this on.
+
+config BUSYBOX_FEATURE_CHAT_SEND_ESCAPES
+ bool "Support weird SEND escapes"
+ depends on BUSYBOX_CHAT
+ default n
+ help
+ Original chat uses some escape sequences in SEND arguments which
+ are not sent to device but rather performs special actions.
+ E.g. "\K" means to send a break sequence to device.
+ "\d" delays execution for a second, "\p" -- for a 1/100 of second.
+ Before turning this option on think twice: do you really need them?
+
+config BUSYBOX_FEATURE_CHAT_VAR_ABORT_LEN
+ bool "Support variable-length ABORT conditions"
+ depends on BUSYBOX_CHAT
+ default n
+ help
+ Original chat uses fixed 50-bytes length ABORT conditions. Say N here.
+
+config BUSYBOX_FEATURE_CHAT_CLR_ABORT
+ bool "Support revoking of ABORT conditions"
+ depends on BUSYBOX_CHAT
+ default n
+ help
+ Support CLR_ABORT directive.
+
+config BUSYBOX_CHRT
+ bool "chrt"
+ default n
+ help
+ manipulate real-time attributes of a process.
+ This requires sched_{g,s}etparam support in your libc.
+
+config BUSYBOX_CROND
+ bool "crond"
+ default y
+ select BUSYBOX_FEATURE_SUID
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ Crond is a background daemon that parses individual crontab
+ files and executes commands on behalf of the users in question.
+ This is a port of dcron from slackware. It uses files of the
+ format /var/spool/cron/crontabs/<username> files, for example:
+ $ cat /var/spool/cron/crontabs/root
+ # Run daily cron jobs at 4:40 every day:
+ 40 4 * * * /etc/cron/daily > /dev/null 2>&1
+
+config BUSYBOX_FEATURE_CROND_D
+ bool "Support option -d to redirect output to stderr"
+ depends on BUSYBOX_CROND
+ default n
+ help
+ -d sets loglevel to 0 (most verbose) and directs all output to stderr.
+
+config BUSYBOX_FEATURE_CROND_CALL_SENDMAIL
+ bool "Using /usr/sbin/sendmail?"
+ default n
+ depends on BUSYBOX_CROND
+ help
+ Support calling /usr/sbin/sendmail for send cmd outputs.
+
+config BUSYBOX_CRONTAB
+ bool "crontab"
+ default y
+ select BUSYBOX_FEATURE_SUID
+ help
+ Crontab manipulates the crontab for a particular user. Only
+ the superuser may specify a different user and/or crontab directory.
+ Note that Busybox binary must be setuid root for this applet to
+ work properly.
+
+config BUSYBOX_DC
+ bool "dc"
+ default n
+ help
+ Dc is a reverse-polish desk calculator which supports unlimited
+ precision arithmetic.
+
+config BUSYBOX_FEATURE_DC_LIBM
+ bool "Enable power and exp functions (requires libm)"
+ default n
+ depends on BUSYBOX_DC
+ help
+ Enable power and exp functions.
+ NOTE: This will require libm to be present for linking.
+
+config BUSYBOX_DEVFSD
+ bool "devfsd (obsolete)"
+ default n
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ This is deprecated, and will be removed at the end of 2008.
+
+ Provides compatibility with old device names on a devfs systems.
+ You should set it to true if you have devfs enabled.
+ The following keywords in devsfd.conf are supported:
+ "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE",
+ "PERMISSIONS", "EXECUTE", "COPY", "IGNORE",
+ "MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT".
+
+ But only if they are written UPPERCASE!!!!!!!!
+
+config BUSYBOX_DEVFSD_MODLOAD
+ bool "Adds support for MODLOAD keyword in devsfd.conf"
+ default n
+ depends on BUSYBOX_DEVFSD
+ help
+ This actually doesn't work with busybox modutils but needs
+ the external modutils.
+
+config BUSYBOX_DEVFSD_FG_NP
+ bool "Enables the -fg and -np options"
+ default n
+ depends on BUSYBOX_DEVFSD
+ help
+ -fg Run the daemon in the foreground.
+ -np Exit after parsing the configuration file.
+ Do not poll for events.
+
+config BUSYBOX_DEVFSD_VERBOSE
+ bool "Increases logging (and size)"
+ default n
+ depends on BUSYBOX_DEVFSD
+ help
+ Increases logging to stderr or syslog.
+
+config BUSYBOX_FEATURE_DEVFS
+ bool "Use devfs names for all devices (obsolete)"
+ default n
+ help
+ This is obsolete and will be going away at the end of 2008..
+
+ This tells busybox to look for names like /dev/loop/0 instead of
+ /dev/loop0. If your /dev directory has normal names instead of
+ devfs names, you don't want this.
+
+config BUSYBOX_DEVMEM
+ bool "devmem"
+ default n
+ help
+ devmem is a small program that reads and writes from physical
+ memory using /dev/mem.
+
+config BUSYBOX_EJECT
+ bool "eject"
+ default n
+ help
+ Used to eject cdroms. (defaults to /dev/cdrom)
+
+config BUSYBOX_FEATURE_EJECT_SCSI
+ bool "SCSI support"
+ default n
+ depends on BUSYBOX_EJECT
+ help
+ Add the -s option to eject, this allows to eject SCSI-Devices and
+ usb-storage devices.
+
+config BUSYBOX_FBSPLASH
+ bool "fbsplash"
+ default n
+ help
+ Shows splash image and progress bar on framebuffer device.
+ Can be used during boot phase of an embedded device. ~2kb.
+ Usage:
+ - use kernel option 'vga=xxx' or otherwise enable fb device.
+ - put somewhere fbsplash.cfg file and an image in .ppm format.
+ - $ setsid fbsplash [params] &
+ -c: hide cursor
+ -d /dev/fbN: framebuffer device (if not /dev/fb0)
+ -s path_to_image_file (can be "-" for stdin)
+ -i path_to_cfg_file (can be "-" for stdin)
+ -f path_to_fifo (can be "-" for stdin)
+ - if you want to run it only in presence of kernel parameter:
+ grep -q "fbsplash=on" </proc/cmdline && BUSYBOX_setsid fbsplash [params] &
+ - commands for fifo:
+ "NN" (ASCII decimal number) - percentage to show on progress bar
+ "exit" - well you guessed it
+
+config BUSYBOX_INOTIFYD
+ bool "inotifyd"
+ default n
+ help
+ Simple inotify daemon. Reports filesystem changes. Requires
+ kernel >= 2.6.13
+
+config BUSYBOX_LAST
+ bool "last"
+ default n
+ select BUSYBOX_FEATURE_WTMP
+ help
+ 'last' displays a list of the last users that logged into the system.
+
+choice
+ prompt "Choose last implementation"
+ depends on BUSYBOX_LAST
+ default FEATURE_LAST_SMALL
+
+config BUSYBOX_FEATURE_LAST_SMALL
+ bool "small"
+ help
+ This is a small version of last with just the basic set of
+ features.
+
+config BUSYBOX_FEATURE_LAST_FANCY
+ bool "huge"
+ help
+ 'last' displays detailed information about the last users that
+ logged into the system (mimics sysvinit last). +900 bytes.
+endchoice
+
+config BUSYBOX_LESS
+ bool "less"
+ default y
+ help
+ 'less' is a pager, meaning that it displays text files. It possesses
+ a wide array of features, and is an improvement over 'more'.
+
+config BUSYBOX_FEATURE_LESS_MAXLINES
+ int "Max number of input lines less will try to eat"
+ default 9999999
+ depends on BUSYBOX_LESS
+
+config BUSYBOX_FEATURE_LESS_BRACKETS
+ bool "Enable bracket searching"
+ default n
+ depends on BUSYBOX_LESS
+ help
+ This option adds the capability to search for matching left and right
+ brackets, facilitating programming.
+
+config BUSYBOX_FEATURE_LESS_FLAGS
+ bool "Enable extra flags"
+ default n
+ depends on BUSYBOX_LESS
+ help
+ The extra flags provided do the following:
+
+ The -M flag enables a more sophisticated status line.
+ The -m flag enables a simpler status line with a percentage.
+
+config BUSYBOX_FEATURE_LESS_DASHCMD
+ bool "Enable flag changes ('-' command)"
+ default n
+ depends on BUSYBOX_LESS
+ help
+ This enables the ability to change command-line flags within
+ less itself ('-' keyboard command).
+
+config BUSYBOX_FEATURE_LESS_MARKS
+ bool "Enable marks"
+ default n
+ depends on BUSYBOX_LESS
+ help
+ Marks enable positions in a file to be stored for easy reference.
+
+config BUSYBOX_FEATURE_LESS_REGEXP
+ bool "Enable regular expressions"
+ default n
+ depends on BUSYBOX_LESS
+ help
+ Enable regular expressions, allowing complex file searches.
+
+config BUSYBOX_FEATURE_LESS_LINENUMS
+ bool "Enable dynamic switching of line numbers"
+ default n
+ depends on BUSYBOX_FEATURE_LESS_DASHCMD
+ help
+ Enable "-N" command.
+
+config BUSYBOX_FEATURE_LESS_WINCH
+ bool "Enable automatic resizing on window size changes"
+ default y
+ depends on BUSYBOX_LESS
+ help
+ Makes less track window size changes.
+
+config BUSYBOX_HDPARM
+ bool "hdparm"
+ default n
+ help
+ Get/Set hard drive parameters. Primarily intended for ATA
+ drives. Adds about 13k (or around 30k if you enable the
+ FEATURE_HDPARM_GET_IDENTITY option)....
+
+config BUSYBOX_FEATURE_HDPARM_GET_IDENTITY
+ bool "Support obtaining detailed information directly from drives"
+ default y
+ depends on BUSYBOX_HDPARM
+ help
+ Enables the -I and -i options to obtain detailed information
+ directly from drives about their capabilities and supported ATA
+ feature set. If no device name is specified, hdparm will read
+ identify data from stdin. Enabling this option will add about 16k...
+
+config BUSYBOX_FEATURE_HDPARM_HDIO_SCAN_HWIF
+ bool "Register an IDE interface (DANGEROUS)"
+ default n
+ depends on BUSYBOX_HDPARM
+ help
+ Enables the 'hdparm -R' option to register an IDE interface.
+ This is dangerous stuff, so you should probably say N.
+
+config BUSYBOX_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF
+ bool "Un-register an IDE interface (DANGEROUS)"
+ default n
+ depends on BUSYBOX_HDPARM
+ help
+ Enables the 'hdparm -U' option to un-register an IDE interface.
+ This is dangerous stuff, so you should probably say N.
+
+config BUSYBOX_FEATURE_HDPARM_HDIO_DRIVE_RESET
+ bool "Perform device reset (DANGEROUS)"
+ default n
+ depends on BUSYBOX_HDPARM
+ help
+ Enables the 'hdparm -w' option to perform a device reset.
+ This is dangerous stuff, so you should probably say N.
+
+config BUSYBOX_FEATURE_HDPARM_HDIO_TRISTATE_HWIF
+ bool "Tristate device for hotswap (DANGEROUS)"
+ default n
+ depends on BUSYBOX_HDPARM
+ help
+ Enables the 'hdparm -x' option to tristate device for hotswap,
+ and the '-b' option to get/set bus state. This is dangerous
+ stuff, so you should probably say N.
+
+config BUSYBOX_FEATURE_HDPARM_HDIO_GETSET_DMA
+ bool "Get/set using_dma flag (DANGEROUS)"
+ default n
+ depends on BUSYBOX_HDPARM
+ help
+ Enables the 'hdparm -d' option to get/set using_dma flag.
+ This is dangerous stuff, so you should probably say N.
+
+config BUSYBOX_MAKEDEVS
+ bool "makedevs"
+ default n
+ help
+ 'makedevs' is a utility used to create a batch of devices with
+ one command.
+ .
+ There are two choices for command line behaviour, the interface
+ as used by LEAF/Linux Router Project, or a device table file.
+ .
+ 'leaf' is traditionally what busybox follows, it allows multiple
+ devices of a particluar type to be created per command.
+ e.g. /dev/hda[0-9]
+ Device properties are passed as command line arguments.
+ .
+ 'table' reads device properties from a file or stdin, allowing
+ a batch of unrelated devices to be made with one command.
+ User/group names are allowed as an alternative to uid/gid.
+
+choice
+ prompt "Choose makedevs behaviour"
+ depends on BUSYBOX_MAKEDEVS
+ default FEATURE_MAKEDEVS_TABLE
+
+config BUSYBOX_FEATURE_MAKEDEVS_LEAF
+ bool "leaf"
+
+config BUSYBOX_FEATURE_MAKEDEVS_TABLE
+ bool "table"
+
+endchoice
+
+config BUSYBOX_MAN
+ bool "man"
+ default n
+ help
+ Format and display manual pages.
+
+config BUSYBOX_MICROCOM
+ bool "microcom"
+ default n
+ help
+ The poor man's minicom utility for chatting with serial port devices.
+
+config BUSYBOX_MOUNTPOINT
+ bool "mountpoint"
+ default n
+ help
+ mountpoint checks if the directory is a mountpoint.
+
+config BUSYBOX_MT
+ bool "mt"
+ default n
+ help
+ mt is used to control tape devices. You can use the mt utility
+ to advance or rewind a tape past a specified number of archive
+ files on the tape.
+
+config BUSYBOX_RAIDAUTORUN
+ bool "raidautorun"
+ default n
+ help
+ raidautorun tells the kernel md driver to
+ search and start RAID arrays.
+
+config BUSYBOX_READAHEAD
+ bool "readahead"
+ default n
+ depends on BUSYBOX_LFS
+ help
+ Preload the files listed on the command line into RAM cache so that
+ subsequent reads on these files will not block on disk I/O.
+
+ This applet just calls the readahead(2) system call on each file.
+ It is mainly useful in system startup scripts to preload files
+ or executables before they are used. When used at the right time
+ (in particular when a CPU bound process is running) it can
+ significantly speed up system startup.
+
+ As readahead(2) blocks until each file has been read, it is best to
+ run this applet as a background job.
+
+config BUSYBOX_RUNLEVEL
+ bool "runlevel"
+ default n
+ help
+ find the current and previous system runlevel.
+
+ This applet uses utmp but does not rely on busybox supporing
+ utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc.
+
+config BUSYBOX_RX
+ bool "rx"
+ default n
+ help
+ Receive files using the Xmodem protocol.
+
+config BUSYBOX_SETSID
+ bool "setsid"
+ default n
+ help
+ setsid runs a program in a new session
+
+config BUSYBOX_STRINGS
+ bool "strings"
+ default n
+ help
+ strings prints the printable character sequences for each file
+ specified.
+
+#config BUSYBOX_TASKSET
+# bool "taskset"
+# default n
+# help
+# Retrieve or set a processes's CPU affinity.
+# This requires sched_{g,s}etaffinity support in your libc.
+
+#config BUSYBOX_FEATURE_TASKSET_FANCY
+# bool "Fancy output"
+# default y
+# depends on BUSYBOX_TASKSET
+# help
+# Add code for fancy output. This merely silences a compiler-warning
+# and adds about 135 Bytes. May be needed for machines with alot
+# of CPUs.
+
+config BUSYBOX_TIME
+ bool "time"
+ default n
+ help
+ The time command runs the specified program with the given arguments.
+ When the command finishes, time writes a message to standard output
+ giving timing statistics about this program run.
+
+config BUSYBOX_TTYSIZE
+ bool "ttysize"
+ default n
+ help
+ A replacement for "stty size". Unlike stty, can report only width,
+ only height, or both, in any order. It also does not complain on
+ error, but returns default 80x24.
+ Usage in shell scripts: width=`ttysize w`.
+
+config BUSYBOX_WATCHDOG
+ bool "watchdog"
+ default n
+ help
+ The watchdog utility is used with hardware or software watchdog
+ device drivers. It opens the specified watchdog device special file
+ and periodically writes a magic character to the device. If the
+ watchdog applet ever fails to write the magic character within a
+ certain amount of time, the watchdog device assumes the system has
+ hung, and will cause the hardware to reboot.
+
+endmenu
diff --git a/package/busybox/config/modutils/Config.in b/package/busybox/config/modutils/Config.in
new file mode 100644
index 000000000..f168c7e30
--- /dev/null
+++ b/package/busybox/config/modutils/Config.in
@@ -0,0 +1,230 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Linux Module Utilities"
+
+config BUSYBOX_DEFAULT_MODULES_DIR
+ string "Default directory containing modules"
+ default "/lib/modules"
+ help
+ Directory that contains kernel modules.
+ Defaults to "/lib/modules"
+
+config BUSYBOX_DEFAULT_DEPMOD_FILE
+ string "Default name of modules.dep"
+ default "modules.dep"
+ help
+ Filename that contains kernel modules dependencies.
+ Defaults to "modules.dep"
+
+config BUSYBOX_MODPROBE_SMALL
+ bool "Simplified modutils"
+ default n
+ help
+ Simplified modutils.
+
+ With this option modprobe does not require modules.dep file
+ and does not use /etc/modules.conf file.
+ It scans module files in /lib/modules/`uname -r` and
+ determines dependencies and module alias names on the fly.
+ This may make module loading slower, most notably
+ when one needs to load module by alias (this requires
+ scanning through module _bodies_).
+
+ At the first attempt to load a module by alias modprobe
+ will try to generate modules.dep.bb file in order to speed up
+ future loads by alias. Failure to do so (read-only /lib/modules,
+ etc) is not reported, and future modprobes will be slow too.
+
+ NB: modules.dep.bb file format is not compatible
+ with modules.dep file as created/used by standard module tools.
+
+ Additional module parameters can be stored in
+ /etc/modules/$module_name files.
+
+ Apart from modprobe, other utilities are also provided:
+ - insmod is an alias to modprobe
+ - rmmod is an alias to modprobe -r
+ - depmod generates modules.dep.bb
+
+ As of 2008-07, this code is experimental. It is 14kb smaller
+ than "non-small" modutils.
+
+config BUSYBOX_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
+ bool "Accept module options on modprobe command line"
+ default n
+ depends on BUSYBOX_MODPROBE_SMALL
+ help
+ Allow insmod and modprobe take module options from command line.
+ N.B. Very bloaty.
+
+config BUSYBOX_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED
+ bool "Skip loading of already loaded modules"
+ default n
+ depends on BUSYBOX_MODPROBE_SMALL
+ help
+ Check if the module is already loaded.
+ N.B. It's racy.
+
+config BUSYBOX_INSMOD
+ bool "insmod"
+ default y
+ depends on !BUSYBOX_MODPROBE_SMALL
+ help
+ insmod is used to load specified modules in the running kernel.
+
+config BUSYBOX_RMMOD
+ bool "rmmod"
+ default y
+ depends on !BUSYBOX_MODPROBE_SMALL
+ help
+ rmmod is used to unload specified modules from the kernel.
+
+config BUSYBOX_LSMOD
+ bool "lsmod"
+ default y
+ depends on !BUSYBOX_MODPROBE_SMALL
+ help
+ lsmod is used to display a list of loaded modules.
+
+config BUSYBOX_FEATURE_LSMOD_PRETTY_2_6_OUTPUT
+ bool "Pretty output"
+ default n
+ depends on BUSYBOX_LSMOD
+ help
+ This option makes output format of lsmod adjusted to
+ the format of module-init-tools for Linux kernel 2.6.
+ Increases size somewhat.
+
+config BUSYBOX_MODPROBE
+ bool "modprobe"
+ default n
+ depends on !BUSYBOX_MODPROBE_SMALL
+ help
+ Handle the loading of modules, and their dependencies on a high
+ level.
+
+ Note that in the state, modprobe does not understand multiple
+ module options from the configuration file. See option below.
+
+config BUSYBOX_FEATURE_MODPROBE_BLACKLIST
+ bool
+ prompt "Blacklist support"
+ default n
+ depends on BUSYBOX_MODPROBE
+ help
+ Say 'y' here to enable support for the 'blacklist' command in
+ modprobe.conf. This prevents the alias resolver to resolve
+ blacklisted modules. This is useful if you want to prevent your
+ hardware autodetection scripts to load modules like evdev, frame
+ buffer drivers etc.
+
+config BUSYBOX_DEPMOD
+ bool "depmod"
+ default n
+ depends on !BUSYBOX_MODPROBE_SMALL
+ help
+ depmod generates modules.dep (and potentially modules.alias
+ and modules.symbols) that contain dependency information
+ for modprobe.
+
+comment "Options common to multiple modutils"
+
+config BUSYBOX_FEATURE_2_4_MODULES
+ bool "Support version 2.2/2.4 Linux kernels"
+ default n
+ depends on BUSYBOX_INSMOD || BUSYBOX_RMMOD || BUSYBOX_LSMOD
+ help
+ Support module loading for 2.2.x and 2.4.x Linux kernels.
+ This increases size considerably. Say N unless you plan
+ to run ancient kernels.
+
+config BUSYBOX_FEATURE_INSMOD_VERSION_CHECKING
+ bool "Enable module version checking"
+ default n
+ depends on BUSYBOX_FEATURE_2_4_MODULES && (BUSYBOX_INSMOD || BUSYBOX_MODPROBE)
+ help
+ Support checking of versions for modules. This is used to
+ ensure that the kernel and module are made for each other.
+
+config BUSYBOX_FEATURE_INSMOD_KSYMOOPS_SYMBOLS
+ bool "Add module symbols to kernel symbol table"
+ default n
+ depends on BUSYBOX_FEATURE_2_4_MODULES && (BUSYBOX_INSMOD || BUSYBOX_MODPROBE)
+ help
+ By adding module symbols to the kernel symbol table, Oops messages
+ occuring within kernel modules can be properly debugged. By enabling
+ this feature, module symbols will always be added to the kernel symbol
+ table for properly debugging support. If you are not interested in
+ Oops messages from kernel modules, say N.
+
+config BUSYBOX_FEATURE_INSMOD_LOADINKMEM
+ bool "In kernel memory optimization (uClinux only)"
+ default n
+ depends on BUSYBOX_FEATURE_2_4_MODULES && (BUSYBOX_INSMOD || BUSYBOX_MODPROBE)
+ help
+ This is a special uClinux only memory optimization that lets insmod
+ load the specified kernel module directly into kernel space, reducing
+ memory usage by preventing the need for two copies of the module
+ being loaded into memory.
+
+config BUSYBOX_FEATURE_INSMOD_LOAD_MAP
+ bool "Enable insmod load map (-m) option"
+ default n
+ depends on BUSYBOX_FEATURE_2_4_MODULES && BUSYBOX_INSMOD
+ help
+ Enabling this, one would be able to get a load map
+ output on stdout. This makes kernel module debugging
+ easier.
+ If you don't plan to debug kernel modules, you
+ don't need this option.
+
+config BUSYBOX_FEATURE_INSMOD_LOAD_MAP_FULL
+ bool "Symbols in load map"
+ default y
+ depends on BUSYBOX_FEATURE_INSMOD_LOAD_MAP && !BUSYBOX_MODPROBE_SMALL
+ help
+ Without this option, -m will only output section
+ load map. With this option, -m will also output
+ symbols load map.
+
+config BUSYBOX_FEATURE_CHECK_TAINTED_MODULE
+ bool "Support tainted module checking with new kernels"
+ default y
+ depends on !BUSYBOX_MODPROBE_SMALL
+ help
+ Support checking for tainted modules. These are usually binary
+ only modules that will make the linux-kernel list ignore your
+ support request.
+ This option is required to support GPLONLY modules.
+
+config BUSYBOX_FEATURE_MODUTILS_ALIAS
+ bool "Support for module.aliases file"
+ default y
+ depends on BUSYBOX_DEPMOD || BUSYBOX_MODPROBE
+ help
+ Generate and parse modules.alias containing aliases for bus
+ identifiers:
+ alias pcmcia:m*c*f03fn*pfn*pa*pb*pc*pd* parport_cs
+
+ and aliases for logical modules names e.g.:
+ alias padlock_aes aes
+ alias aes_i586 aes
+ alias aes_generic aes
+
+ Say Y if unsure.
+
+config BUSYBOX_FEATURE_MODUTILS_SYMBOLS
+ bool "Support for module.symbols file"
+ default y
+ depends on BUSYBOX_DEPMOD || BUSYBOX_MODPROBE
+ help
+ Generate and parse modules.symbols containing aliases for
+ symbol_request() kernel calls, such as:
+ alias symbol:usb_sg_init usbcore
+
+ Say Y if unsure.
+
+endmenu
diff --git a/package/busybox/config/networking/Config.in b/package/busybox/config/networking/Config.in
new file mode 100644
index 000000000..3bd3e1e8f
--- /dev/null
+++ b/package/busybox/config/networking/Config.in
@@ -0,0 +1,921 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Networking Utilities"
+
+config BUSYBOX_FEATURE_IPV6
+ bool "Enable IPv6 support"
+ default n
+ help
+ Enable IPv6 support in busybox.
+ This adds IPv6 support in the networking applets.
+
+config BUSYBOX_FEATURE_PREFER_IPV4_ADDRESS
+ bool "Preferentially use IPv4 addresses from DNS queries"
+ default y
+ depends on BUSYBOX_FEATURE_IPV6
+ help
+ Use IPv4 address of network host if it has one.
+
+ If this option is off, the first returned address will be used.
+ This may cause problems when your DNS server is IPv6-capable and
+ is returning IPv6 host addresses too. If IPv6 address
+ precedes IPv4 one in DNS reply, busybox network applets
+ (e.g. wget) will use IPv6 address. On an IPv6-incapable host
+ or network applets will fail to connect to the host
+ using IPv6 address.
+
+config BUSYBOX_VERBOSE_RESOLUTION_ERRORS
+ bool "Verbose resolution errors"
+ default n
+ help
+ Enable if you are not satisfied with simplistic
+ "can't resolve 'hostname.com'" and want to know more.
+ This may increase size of your executable a bit.
+
+config BUSYBOX_ARP
+ bool "arp"
+ default y
+ help
+ Manipulate the system ARP cache.
+
+config BUSYBOX_ARPING
+ bool "arping"
+ default y
+ help
+ Ping hosts by ARP packets.
+
+config BUSYBOX_BRCTL
+ bool "brctl"
+ default n
+ help
+ Manage ethernet bridges.
+ Supports addbr/delbr and addif/delif.
+
+config BUSYBOX_FEATURE_BRCTL_FANCY
+ bool "Fancy options"
+ default n
+ depends on BUSYBOX_BRCTL
+ help
+ Add support for extended option like:
+ setageing, setfd, sethello, setmaxage,
+ setpathcost, setportprio, setbridgeprio,
+ stp
+ This adds about 600 bytes.
+
+config BUSYBOX_FEATURE_BRCTL_SHOW
+ bool "Support show, showmac and showstp"
+ default n
+ depends on BUSYBOX_BRCTL && BUSYBOX_FEATURE_BRCTL_FANCY
+ help
+ Add support for option which prints the current config:
+ showmacs, showstp, show
+
+config BUSYBOX_DNSD
+ bool "dnsd"
+ default n
+ help
+ Small and static DNS server daemon.
+
+config BUSYBOX_ETHER_WAKE
+ bool "ether-wake"
+ default n
+ help
+ Send a magic packet to wake up sleeping machines.
+
+config BUSYBOX_FAKEIDENTD
+ bool "fakeidentd"
+ default n
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ fakeidentd listens on the ident port and returns a predefined
+ fake value on any query.
+
+config BUSYBOX_FTPGET
+ bool "ftpget"
+ default n
+ help
+ Retrieve a remote file via FTP.
+
+config BUSYBOX_FTPPUT
+ bool "ftpput"
+ default n
+ help
+ Store a remote file via FTP.
+
+config BUSYBOX_FEATURE_FTPGETPUT_LONG_OPTIONS
+ bool "Enable long options in ftpget/ftpput"
+ default n
+ depends on BUSYBOX_GETOPT_LONG && (BUSYBOX_FTPGET || BUSYBOX_FTPPUT)
+ help
+ Support long options for the ftpget/ftpput applet.
+
+config BUSYBOX_HOSTNAME
+ bool "hostname"
+ default y
+ help
+ Show or set the system's host name.
+
+config BUSYBOX_HTTPD
+ bool "httpd"
+ default n
+ help
+ Serve web pages via an HTTP server.
+
+config BUSYBOX_FEATURE_HTTPD_RANGES
+ bool "Support 'Ranges:' header"
+ default n
+ depends on BUSYBOX_HTTPD
+ help
+ Makes httpd emit "Accept-Ranges: bytes" header and understand
+ "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted
+ downloads, seeking in multimedia players etc.
+
+config BUSYBOX_FEATURE_HTTPD_USE_SENDFILE
+ bool "Use sendfile system call"
+ default n
+ depends on BUSYBOX_HTTPD
+ help
+ When enabled, httpd will use the kernel sendfile() function
+ instead of read/write loop.
+
+config BUSYBOX_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP
+ bool "Support reloading of global config file on HUP signal"
+ default n
+ depends on BUSYBOX_HTTPD
+ help
+ This option enables processing of SIGHUP to reload cached
+ configuration settings.
+
+config BUSYBOX_FEATURE_HTTPD_SETUID
+ bool "Enable -u <user> option"
+ default n
+ depends on BUSYBOX_HTTPD
+ help
+ This option allows the server to run as a specific user
+ rather than defaulting to the user that starts the server.
+ Use of this option requires special privileges to change to a
+ different user.
+
+config BUSYBOX_FEATURE_HTTPD_BASIC_AUTH
+ bool "Enable Basic http Authentication"
+ default y
+ depends on BUSYBOX_HTTPD
+ help
+ Utilizes password settings from /etc/httpd.conf for basic
+ authentication on a per url basis.
+
+config BUSYBOX_FEATURE_HTTPD_AUTH_MD5
+ bool "Support MD5 crypted passwords for http Authentication"
+ default n
+ depends on BUSYBOX_FEATURE_HTTPD_BASIC_AUTH
+ help
+ Enables basic per URL authentication from /etc/httpd.conf
+ using md5 passwords.
+
+config BUSYBOX_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES
+ bool "Support loading additional MIME types at run-time"
+ default n
+ depends on BUSYBOX_HTTPD
+ help
+ This option enables support for additional MIME types at
+ run-time to be specified in the configuration file.
+
+config BUSYBOX_FEATURE_HTTPD_CGI
+ bool "Support Common Gateway Interface (CGI)"
+ default y
+ depends on BUSYBOX_HTTPD
+ help
+ This option allows scripts and executables to be invoked
+ when specific URLs are requested.
+
+config BUSYBOX_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR
+ bool "Support for running scripts through an interpreter"
+ default n
+ depends on BUSYBOX_FEATURE_HTTPD_CGI
+ help
+ This option enables support for running scripts through an
+ interpreter. Turn this on if you want PHP scripts to work
+ properly. You need to supply an additional line in your httpd
+ config file:
+ *.php:/path/to/your/php
+
+config BUSYBOX_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
+ bool "Set REMOTE_PORT environment variable for CGI"
+ default n
+ depends on BUSYBOX_FEATURE_HTTPD_CGI
+ help
+ Use of this option can assist scripts in generating
+ references that contain a unique port number.
+
+config BUSYBOX_FEATURE_HTTPD_ENCODE_URL_STR
+ bool "Enable -e option (useful for CGIs written as shell scripts)"
+ default y
+ depends on BUSYBOX_HTTPD
+ help
+ This option allows html encoding of arbitrary strings for display
+ by the browser. Output goes to stdout.
+ For example, httpd -e "<Hello World>" produces
+ "&#60Hello&#32World&#62".
+
+config BUSYBOX_FEATURE_HTTPD_ERROR_PAGES
+ bool "Support for custom error pages"
+ default n
+ depends on BUSYBOX_HTTPD
+ help
+ This option allows you to define custom error pages in
+ the configuration file instead of the default HTTP status
+ error pages. For instance, if you add the line:
+ E404:/path/e404.html
+ in the config file, the server will respond the specified
+ '/path/e404.html' file instead of the terse '404 NOT FOUND'
+ message.
+
+config BUSYBOX_FEATURE_HTTPD_PROXY
+ bool "Support for reverse proxy"
+ default n
+ depends on BUSYBOX_HTTPD
+ help
+ This option allows you to define URLs that will be forwarded
+ to another HTTP server. To setup add the following line to the
+ configuration file
+ P:/url/:http://hostname[:port]/new/path/
+ Then a request to /url/myfile will be forwarded to
+ http://hostname[:port]/new/path/myfile.
+
+config BUSYBOX_IFCONFIG
+ bool "ifconfig"
+ default y
+ help
+ Ifconfig is used to configure the kernel-resident network interfaces.
+
+config BUSYBOX_FEATURE_IFCONFIG_STATUS
+ bool "Enable status reporting output (+7k)"
+ default y
+ depends on BUSYBOX_IFCONFIG
+ help
+ If ifconfig is called with no arguments it will display the status
+ of the currently active interfaces.
+
+config BUSYBOX_FEATURE_IFCONFIG_SLIP
+ bool "Enable slip-specific options \"keepalive\" and \"outfill\""
+ default n
+ depends on BUSYBOX_IFCONFIG
+ help
+ Allow "keepalive" and "outfill" support for SLIP. If you're not
+ planning on using serial lines, leave this unchecked.
+
+config BUSYBOX_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ
+ bool "Enable options \"mem_start\", \"io_addr\", and \"irq\""
+ default n
+ depends on BUSYBOX_IFCONFIG
+ help
+ Allow the start address for shared memory, start address for I/O,
+ and/or the interrupt line used by the specified device.
+
+config BUSYBOX_FEATURE_IFCONFIG_HW
+ bool "Enable option \"hw\" (ether only)"
+ default y
+ depends on BUSYBOX_IFCONFIG
+ help
+ Set the hardware address of this interface, if the device driver
+ supports this operation. Currently, we only support the 'ether'
+ class.
+
+config BUSYBOX_FEATURE_IFCONFIG_BROADCAST_PLUS
+ bool "Set the broadcast automatically"
+ default y
+ depends on BUSYBOX_IFCONFIG
+ help
+ Setting this will make ifconfig attempt to find the broadcast
+ automatically if the value '+' is used.
+
+config BUSYBOX_IFENSLAVE
+ bool "ifenslave"
+ default n
+ help
+ Userspace application to bind several interfaces
+ to a logical interface (use with kernel bonding driver).
+
+config BUSYBOX_IFUPDOWN
+ bool "ifupdown"
+ default y
+ help
+ Activate or deactivate the specified interfaces. This applet makes
+ use of either "ifconfig" and "route" or the "ip" command to actually
+ configure network interfaces. Therefore, you will probably also want
+ to enable either IFCONFIG and ROUTE, or enable
+ FEATURE_IFUPDOWN_IP and the various IP options. Of
+ course you could use non-busybox versions of these programs, so
+ against my better judgement (since this will surely result in plenty
+ of support questions on the mailing list), I do not force you to
+ enable these additional options. It is up to you to supply either
+ "ifconfig", "route" and "run-parts" or the "ip" command, either
+ via busybox or via standalone utilities.
+
+config BUSYBOX_IFUPDOWN_IFSTATE_PATH
+ string "Absolute path to ifstate file"
+ default "/var/run/ifstate"
+ depends on BUSYBOX_IFUPDOWN
+ help
+ ifupdown keeps state information in a file called ifstate.
+ Typically it is located in /var/run/ifstate, however
+ some distributions tend to put it in other places
+ (debian, for example, uses /etc/network/run/ifstate).
+ This config option defines location of ifstate.
+
+config BUSYBOX_FEATURE_IFUPDOWN_IP
+ bool "Use ip applet"
+ default y
+ depends on BUSYBOX_IFUPDOWN
+ help
+ Use the iproute "ip" command to implement "ifup" and "ifdown", rather
+ than the default of using the older 'ifconfig' and 'route' utilities.
+
+config BUSYBOX_FEATURE_IFUPDOWN_IP_BUILTIN
+ bool "Use busybox ip applet"
+ default y
+ depends on BUSYBOX_FEATURE_IFUPDOWN_IP
+ select BUSYBOX_IP
+ select BUSYBOX_FEATURE_IP_ADDRESS
+ select BUSYBOX_FEATURE_IP_LINK
+ select BUSYBOX_FEATURE_IP_ROUTE
+ help
+ Use the busybox iproute "ip" applet to implement "ifupdown".
+
+ If left disabled, you must install the full-blown iproute2
+ utility or the "ifup" and "ifdown" applets will not work.
+
+config BUSYBOX_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN
+ bool "Use busybox ifconfig and route applets"
+ default n
+ depends on BUSYBOX_IFUPDOWN && !BUSYBOX_FEATURE_IFUPDOWN_IP
+ select BUSYBOX_IFCONFIG
+ select BUSYBOX_ROUTE
+ help
+ Use the busybox iproute "ifconfig" and "route" applets to
+ implement the "ifup" and "ifdown" utilities.
+
+ If left disabled, you must install the full-blown ifconfig
+ and route utilities, or the "ifup" and "ifdown" applets will not
+ work.
+
+config BUSYBOX_FEATURE_IFUPDOWN_IPV4
+ bool "Support for IPv4"
+ default y
+ depends on BUSYBOX_IFUPDOWN
+ help
+ If you want ifup/ifdown to talk IPv4, leave this on.
+
+config BUSYBOX_FEATURE_IFUPDOWN_IPV6
+ bool "Support for IPv6"
+ default n
+ depends on BUSYBOX_IFUPDOWN && BUSYBOX_FEATURE_IPV6
+ help
+ If you need support for IPv6, turn this option on.
+
+### UNUSED
+###config FEATURE_IFUPDOWN_IPX
+### bool "Support for IPX"
+### default n
+### depends on BUSYBOX_IFUPDOWN
+### help
+### If this option is selected you can use busybox to work with IPX
+### networks.
+
+config BUSYBOX_FEATURE_IFUPDOWN_MAPPING
+ bool "Enable mapping support"
+ default n
+ depends on BUSYBOX_IFUPDOWN
+ help
+ This enables support for the "mapping" stanza, unless you have
+ a weird network setup you don't need it.
+
+config BUSYBOX_FEATURE_IFUPDOWN_EXTERNAL_DHCP
+ bool "Support for external dhcp clients"
+ default n
+ depends on BUSYBOX_IFUPDOWN
+ help
+ This enables support for the external dhcp clients. Clients are
+ tried in the following order: dhcpcd, dhclient, pump and udhcpc.
+ Otherwise, if udhcpc applet is enabled, it is used.
+ Otherwise, ifup/ifdown will have no support for DHCP.
+
+config BUSYBOX_INETD
+ bool "inetd"
+ default n
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ Internet superserver daemon
+
+config BUSYBOX_FEATURE_INETD_SUPPORT_BUILTIN_ECHO
+ bool "Support echo service"
+ default y
+ depends on BUSYBOX_INETD
+ help
+ Echo received data internal inetd service
+
+config BUSYBOX_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
+ bool "Support discard service"
+ default y
+ depends on BUSYBOX_INETD
+ help
+ Internet /dev/null internal inetd service
+
+config BUSYBOX_FEATURE_INETD_SUPPORT_BUILTIN_TIME
+ bool "Support time service"
+ default y
+ depends on BUSYBOX_INETD
+ help
+ Return 32 bit time since 1900 internal inetd service
+
+config BUSYBOX_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME
+ bool "Support daytime service"
+ default y
+ depends on BUSYBOX_INETD
+ help
+ Return human-readable time internal inetd service
+
+config BUSYBOX_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN
+ bool "Support chargen service"
+ default y
+ depends on BUSYBOX_INETD
+ help
+ Familiar character generator internal inetd service
+
+config BUSYBOX_FEATURE_INETD_RPC
+ bool "Support RPC services"
+ default n
+ depends on BUSYBOX_INETD
+ select BUSYBOX_FEATURE_HAVE_RPC
+ help
+ Support Sun-RPC based services
+
+config BUSYBOX_IP
+ bool "ip"
+ default y
+ help
+ The "ip" applet is a TCP/IP interface configuration and routing
+ utility. You generally don't need "ip" to use busybox with
+ TCP/IP.
+
+config BUSYBOX_FEATURE_IP_ADDRESS
+ bool "ip address"
+ default y
+ depends on BUSYBOX_IP
+ help
+ Address manipulation support for the "ip" applet.
+
+config BUSYBOX_FEATURE_IP_LINK
+ bool "ip link"
+ default y
+ depends on BUSYBOX_IP
+ help
+ Configure network devices with "ip".
+
+config BUSYBOX_FEATURE_IP_ROUTE
+ bool "ip route"
+ default y
+ depends on BUSYBOX_IP
+ help
+ Add support for routing table management to "ip".
+
+config BUSYBOX_FEATURE_IP_TUNNEL
+ bool "ip tunnel"
+ default n
+ depends on BUSYBOX_IP
+ help
+ Add support for tunneling commands to "ip".
+
+config BUSYBOX_FEATURE_IP_RULE
+ bool "ip rule"
+ default n
+ depends on BUSYBOX_IP
+ help
+ Add support for rule commands to "ip".
+
+config BUSYBOX_FEATURE_IP_SHORT_FORMS
+ bool "Support short forms of ip commands"
+ default n
+ depends on BUSYBOX_IP
+ help
+ Also support short-form of ip <OBJECT> commands:
+ ip addr -> ipaddr
+ ip link -> iplink
+ ip route -> iproute
+ ip tunnel -> iptunnel
+ ip rule -> iprule
+
+ Say N unless you desparately need the short form of the ip
+ object commands.
+
+config BUSYBOX_FEATURE_IP_RARE_PROTOCOLS
+ bool "Support displaying rarely used link types"
+ default n
+ depends on BUSYBOX_IP
+ help
+ If you are not going to use links of type "frad", "econet",
+ "bif" etc, you probably don't need to enable this.
+ Ethernet, wireless, infrared, ppp/slip, ip tunnelling
+ link types are supported without this option selected.
+
+config BUSYBOX_IPADDR
+ bool
+ default y
+ depends on BUSYBOX_FEATURE_IP_SHORT_FORMS && BUSYBOX_FEATURE_IP_ADDRESS
+
+config BUSYBOX_IPLINK
+ bool
+ default y
+ depends on BUSYBOX_FEATURE_IP_SHORT_FORMS && BUSYBOX_FEATURE_IP_LINK
+
+config BUSYBOX_IPROUTE
+ bool
+ default y
+ depends on BUSYBOX_FEATURE_IP_SHORT_FORMS && BUSYBOX_FEATURE_IP_ROUTE
+
+config BUSYBOX_IPTUNNEL
+ bool
+ default y
+ depends on BUSYBOX_FEATURE_IP_SHORT_FORMS && BUSYBOX_FEATURE_IP_TUNNEL
+
+config BUSYBOX_IPRULE
+ bool
+ default y
+ depends on BUSYBOX_FEATURE_IP_SHORT_FORMS && BUSYBOX_FEATURE_IP_RULE
+
+config BUSYBOX_IPCALC
+ bool "ipcalc"
+ default n
+ help
+ ipcalc takes an IP address and netmask and calculates the
+ resulting broadcast, network, and host range.
+
+config BUSYBOX_FEATURE_IPCALC_FANCY
+ bool "Fancy IPCALC, more options, adds 1 kbyte"
+ default y
+ depends on BUSYBOX_IPCALC
+ help
+ Adds the options hostname, prefix and silent to the output of
+ "ipcalc".
+
+config BUSYBOX_FEATURE_IPCALC_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_IPCALC && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the ipcalc applet.
+
+config BUSYBOX_NAMEIF
+ bool "nameif"
+ default n
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ nameif is used to rename network interface by its MAC address.
+ Renamed interfaces MUST be in the down state.
+ It is possible to use a file (default: /etc/mactab)
+ with list of new interface names and MACs.
+ Maximum interface name length: IFNAMSIZ = 16
+ File fields are separated by space or tab.
+ File format:
+ # Comment
+ new_interface_name XX:XX:XX:XX:XX:XX
+
+config BUSYBOX_FEATURE_NAMEIF_EXTENDED
+ bool "Extended nameif"
+ default n
+ depends on BUSYBOX_NAMEIF
+ help
+ This extends the nameif syntax to support the bus_info and driver
+ checks. The syntax is compatible to the normal nameif.
+ File format:
+ new_interface_name driver=asix bus=usb-0000:00:08.2-3
+ new_interface_name bus=usb-0000:00:08.2-3 00:80:C8:38:91:B5
+ new_interface_name mac=00:80:C8:38:91:B5
+ new_interface_name 00:80:C8:38:91:B5
+
+config BUSYBOX_NC
+ bool "nc"
+ default y
+ help
+ A simple Unix utility which reads and writes data across network
+ connections.
+
+config BUSYBOX_NC_SERVER
+ bool "Netcat server options (-l)"
+ default y
+ depends on BUSYBOX_NC
+ help
+ Allow netcat to act as a server.
+
+config BUSYBOX_NC_EXTRA
+ bool "Netcat extensions (-eiw and filename)"
+ default n
+ depends on BUSYBOX_NC
+ help
+ Add -e (support for executing the rest of the command line after
+ making or receiving a successful connection), -i (delay interval for
+ lines sent), -w (timeout for initial connection).
+
+config BUSYBOX_NETSTAT
+ bool "netstat"
+ default y
+ help
+ netstat prints information about the Linux networking subsystem.
+
+config BUSYBOX_FEATURE_NETSTAT_WIDE
+ bool "Enable wide netstat output"
+ default n
+ depends on BUSYBOX_NETSTAT
+ help
+ Add support for wide columns. Useful when displaying IPv6 addresses
+ (-W option).
+
+config BUSYBOX_FEATURE_NETSTAT_PRG
+ bool "Enable PID/Program name output"
+ default y
+ depends on BUSYBOX_NETSTAT
+ help
+ Add support for -p flag to print out PID and program name.
+ +700 bytes of code.
+
+config BUSYBOX_NSLOOKUP
+ bool "nslookup"
+ default y
+ help
+ nslookup is a tool to query Internet name servers.
+
+config BUSYBOX_PING
+ bool "ping"
+ default y
+ help
+ ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to
+ elicit an ICMP ECHO_RESPONSE from a host or gateway.
+
+config BUSYBOX_PING6
+ bool "ping6"
+ default n
+ depends on BUSYBOX_FEATURE_IPV6 && BUSYBOX_PING
+ help
+ This will give you a ping that can talk IPv6.
+
+config BUSYBOX_FEATURE_FANCY_PING
+ bool "Enable fancy ping output"
+ default y
+ depends on BUSYBOX_PING
+ help
+ Make the output from the ping applet include statistics, and at the
+ same time provide full support for ICMP packets.
+
+config BUSYBOX_PSCAN
+ bool "pscan"
+ default n
+ help
+ Simple network port scanner.
+
+config BUSYBOX_ROUTE
+ bool "route"
+ default y
+ help
+ Route displays or manipulates the kernel's IP routing tables.
+
+config BUSYBOX_SLATTACH
+ bool "slattach"
+ default n
+ help
+ slattach is a small utility to attach network interfaces to serial
+ lines.
+
+#config TC
+# bool "tc"
+# default n
+# help
+# show / manipulate traffic control settings
+#
+#config FEATURE_TC_INGRESS
+# def_bool n
+# depends on BUSYBOX_TC
+
+config BUSYBOX_TELNET
+ bool "telnet"
+ default y
+ help
+ Telnet is an interface to the TELNET protocol, but is also commonly
+ used to test other simple protocols.
+
+config BUSYBOX_FEATURE_TELNET_TTYPE
+ bool "Pass TERM type to remote host"
+ default y
+ depends on BUSYBOX_TELNET
+ help
+ Setting this option will forward the TERM environment variable to the
+ remote host you are connecting to. This is useful to make sure that
+ things like ANSI colors and other control sequences behave.
+
+config BUSYBOX_FEATURE_TELNET_AUTOLOGIN
+ bool "Pass USER type to remote host"
+ default y
+ depends on BUSYBOX_TELNET
+ help
+ Setting this option will forward the USER environment variable to the
+ remote host you are connecting to. This is useful when you need to
+ log into a machine without telling the username (autologin). This
+ option enables `-a' and `-l USER' arguments.
+
+config BUSYBOX_TELNETD
+ bool "telnetd"
+ default n
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ A daemon for the TELNET protocol, allowing you to log onto the host
+ running the daemon. Please keep in mind that the TELNET protocol
+ sends passwords in plain text. If you can't afford the space for an
+ SSH daemon and you trust your network, you may say 'y' here. As a
+ more secure alternative, you should seriously consider installing the
+ very small Dropbear SSH daemon instead:
+ http://matt.ucc.asn.au/dropbear/dropbear.html
+
+ Note that for busybox telnetd to work you need several things:
+ First of all, your kernel needs:
+ UNIX98_PTYS=y
+ DEVPTS_FS=y
+
+ Next, you need a /dev/pts directory on your root filesystem:
+
+ $ ls -ld /dev/pts
+ drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/
+
+ Next you need the pseudo terminal master multiplexer /dev/ptmx:
+
+ $ ls -la /dev/ptmx
+ crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx
+
+ Any /dev/ttyp[0-9]* files you may have can be removed.
+ Next, you need to mount the devpts filesystem on /dev/pts using:
+
+ mount -t devpts devpts /dev/pts
+
+ You need to be sure that Busybox has LOGIN and
+ FEATURE_SUID enabled. And finally, you should make
+ certain that Busybox has been installed setuid root:
+
+ chown root.root /bin/busybox
+ chmod 4755 /bin/busybox
+
+ with all that done, telnetd _should_ work....
+
+
+config BUSYBOX_FEATURE_TELNETD_STANDALONE
+ bool "Support standalone telnetd (not inetd only)"
+ default n
+ depends on BUSYBOX_TELNETD
+ help
+ Selecting this will make telnetd able to run standalone.
+
+config BUSYBOX_TFTP
+ bool "tftp"
+ default n
+ help
+ This enables the Trivial File Transfer Protocol client program. TFTP
+ is usually used for simple, small transfers such as a root image
+ for a network-enabled bootloader.
+
+config BUSYBOX_TFTPD
+ bool "tftpd"
+ default n
+ help
+ This enables the Trivial File Transfer Protocol server program.
+ It expects that stdin is a datagram socket and a packet
+ is already pending on it. It will exit after one transfer.
+ In other words: it should be run from inetd in nowait mode,
+ or from udpsvd. Example: "udpsvd -E 0 69 tftpd DIR"
+
+config BUSYBOX_FEATURE_TFTP_GET
+ bool "Enable \"get\" command"
+ default y
+ depends on BUSYBOX_TFTP || BUSYBOX_TFTPD
+ help
+ Add support for the GET command within the TFTP client. This allows
+ a client to retrieve a file from a TFTP server.
+ Also enable upload support in tftpd, if tftpd is selected.
+
+config BUSYBOX_FEATURE_TFTP_PUT
+ bool "Enable \"put\" command"
+ default y
+ depends on BUSYBOX_TFTP || BUSYBOX_TFTPD
+ help
+ Add support for the PUT command within the TFTP client. This allows
+ a client to transfer a file to a TFTP server.
+ Also enable download support in tftpd, if tftpd is selected.
+
+config BUSYBOX_FEATURE_TFTP_BLOCKSIZE
+ bool "Enable \"blksize\" protocol option"
+ default n
+ depends on BUSYBOX_TFTP || BUSYBOX_TFTPD
+ help
+ Allow tftp to specify block size, and tftpd to understand
+ "blksize" option.
+
+config BUSYBOX_TFTP_DEBUG
+ bool "Enable debug"
+ default n
+ depends on BUSYBOX_TFTP
+ help
+ Enable debug settings for tftp. This is useful if you're running
+ into problems with tftp as the protocol doesn't help you much when
+ you run into problems.
+
+config BUSYBOX_TRACEROUTE
+ bool "traceroute"
+ default y
+ help
+ Utility to trace the route of IP packets
+
+config BUSYBOX_FEATURE_TRACEROUTE_VERBOSE
+ bool "Enable verbose output"
+ default y
+ depends on BUSYBOX_TRACEROUTE
+ help
+ Add some verbosity to traceroute. This includes amongst other things
+ hostnames and ICMP response types.
+
+config BUSYBOX_FEATURE_TRACEROUTE_SOURCE_ROUTE
+ bool "Enable loose source route"
+ default n
+ depends on BUSYBOX_TRACEROUTE
+ help
+ Add option to specify a loose source route gateway
+ (8 maximum).
+
+config BUSYBOX_FEATURE_TRACEROUTE_USE_ICMP
+ bool "Use ICMP instead of UDP"
+ default y
+ depends on BUSYBOX_TRACEROUTE
+ help
+ Add feature to allow for ICMP ECHO instead of UDP datagrams.
+
+source package/busybox/config/networking/udhcp/Config.in
+
+config BUSYBOX_VCONFIG
+ bool "vconfig"
+ default n
+ help
+ Creates, removes, and configures VLAN interfaces
+
+config BUSYBOX_WGET
+ bool "wget"
+ default y
+ help
+ wget is a utility for non-interactive download of files from HTTP,
+ HTTPS, and FTP servers.
+
+config BUSYBOX_FEATURE_WGET_STATUSBAR
+ bool "Enable a nifty process meter (+2k)"
+ default n
+ depends on BUSYBOX_WGET
+ help
+ Enable the transfer progress bar for wget transfers.
+
+config BUSYBOX_FEATURE_WGET_AUTHENTICATION
+ bool "Enable HTTP authentication"
+ default y
+ depends on BUSYBOX_WGET
+ help
+ Support authenticated HTTP transfers.
+
+config BUSYBOX_FEATURE_WGET_LONG_OPTIONS
+ bool "Enable long options"
+ default n
+ depends on BUSYBOX_WGET && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the wget applet.
+
+config BUSYBOX_ZCIP
+ bool "zcip"
+ default n
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ ZCIP provides ZeroConf IPv4 address selection, according to RFC 3927.
+ It's a daemon that allocates and defends a dynamically assigned
+ address on the 169.254/16 network, requiring no system administrator.
+
+ See http://www.zeroconf.org for further details, and "zcip.script"
+ in the busybox examples.
+
+config BUSYBOX_TCPSVD
+ bool "tcpsvd"
+ default n
+ help
+ tcpsvd listens on a TCP port and runs a program for each new
+ connection.
+
+config BUSYBOX_UDPSVD
+ bool "udpsvd"
+ default n
+ help
+ udpsvd listens on an UDP port and runs a program for each new
+ connection.
+
+endmenu
diff --git a/package/busybox/config/networking/udhcp/Config.in b/package/busybox/config/networking/udhcp/Config.in
new file mode 100644
index 000000000..0e507ce75
--- /dev/null
+++ b/package/busybox/config/networking/udhcp/Config.in
@@ -0,0 +1,122 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+config BUSYBOX_APP_UDHCPD
+ bool "udhcp server (udhcpd)"
+ default n
+ help
+ udhcpd is a DHCP server geared primarily toward embedded systems,
+ while striving to be fully functional and RFC compliant.
+
+config BUSYBOX_APP_DHCPRELAY
+ bool "dhcprelay"
+ default n
+ depends on BUSYBOX_APP_UDHCPD
+ help
+ dhcprelay listens for dhcp requests on one or more interfaces
+ and forwards these requests to a different interface or dhcp
+ server.
+
+config BUSYBOX_APP_DUMPLEASES
+ bool "Lease display utility (dumpleases)"
+ default n
+ depends on BUSYBOX_APP_UDHCPD
+ help
+ dumpleases displays the leases written out by the udhcpd server.
+ Lease times are stored in the file by time remaining in lease, or
+ by the absolute time that it expires in seconds from epoch.
+
+config BUSYBOX_FEATURE_UDHCPD_WRITE_LEASES_EARLY
+ bool "Rewrite the lease file at every new acknowledge"
+ default n
+ depends on BUSYBOX_APP_UDHCPD
+ help
+ If selected, udhcpd will write a new file with leases every
+ time a new lease has been accepted, thus eliminating the need
+ to send SIGUSR1 for the initial writing or updating. Any timed
+ rewriting remains undisturbed
+
+config BUSYBOX_DHCPD_LEASES_FILE
+ string "Absolute path to lease file"
+ default "/var/lib/misc/udhcpd.leases"
+ depends on BUSYBOX_APP_UDHCPD
+ help
+ udhcpd stores addresses in a lease file. This is the absolute path
+ of the file. Normally it is safe to leave it untouched.
+
+config BUSYBOX_APP_UDHCPC
+ bool "udhcp client (udhcpc)"
+ default y
+ help
+ udhcpc is a DHCP client geared primarily toward embedded systems,
+ while striving to be fully functional and RFC compliant.
+
+ The udhcp client negotiates a lease with the DHCP server and
+ runs a script when a lease is obtained or lost.
+
+config BUSYBOX_FEATURE_UDHCPC_ARPING
+ bool "Verify that the offered address is free, using ARP ping"
+ default y
+ depends on BUSYBOX_APP_UDHCPC
+ help
+ If selected, udhcpc will send ARP probes and make sure
+ the offered address is really not in use by anyone. The client
+ will DHCPDECLINE the offer if the address is in use,
+ and restart the discover process.
+
+config BUSYBOX_FEATURE_UDHCP_PORT
+ bool "Enable '-P port' option for udhcpd and udhcpc"
+ default n
+ depends on BUSYBOX_APP_UDHCPD || BUSYBOX_APP_UDHCPC
+ help
+ At the cost of ~300 bytes, enables -P port option.
+ This feature is typically not needed.
+
+config BUSYBOX_UDHCP_DEBUG
+ bool "Compile udhcp with noisy debugging messages"
+ default n
+ depends on BUSYBOX_APP_UDHCPD || BUSYBOX_APP_UDHCPC
+ help
+ If selected, udhcpd will output extra debugging output.
+
+config BUSYBOX_FEATURE_UDHCP_RFC3397
+ bool "Support for RFC3397 domain search (experimental)"
+ default n
+ depends on BUSYBOX_APP_UDHCPD || BUSYBOX_APP_UDHCPC
+ help
+ If selected, both client and server will support passing of domain
+ search lists via option 119, specified in RFC3397.
+
+config BUSYBOX_UDHCPC_DEFAULT_SCRIPT
+ string "Absolute path to config script"
+ default "/usr/share/udhcpc/default.script"
+ depends on BUSYBOX_APP_UDHCPC
+ help
+ This script is called after udhcpc receives an answer. See
+ examples/udhcp for a working example. Normally it is safe
+ to leave this untouched.
+
+config BUSYBOX_UDHCPC_SLACK_FOR_BUGGY_SERVERS
+ int "DHCP options slack buffer size"
+ default 80
+ range 0 924
+ depends on BUSYBOX_APP_UDHCPD || BUSYBOX_APP_UDHCPC
+ help
+ Some buggy DHCP servers send DHCP offer packets with option
+ field larger than we expect (which might also be considered a
+ buffer overflow attempt). These packets are normally discarded.
+ If circumstances beyond your control force you to support such
+ servers, this may help. The upper limit (924) makes dhcpc accept
+ even 1500 byte packets (maximum-sized ethernet packets).
+
+ This option does not make dhcp[cd] emit non-standard
+ sized packets.
+
+ Known buggy DHCP servers:
+ 3Com OfficeConnect Remote 812 ADSL Router:
+ seems to confuse maximum allowed UDP packet size with
+ maximum size of entire IP packet, and sends packets which are
+ 28 bytes too large.
+ Seednet (ISP) VDSL: sends packets 2 bytes too large.
diff --git a/package/busybox/config/printutils/Config.in b/package/busybox/config/printutils/Config.in
new file mode 100644
index 000000000..41d0f9c2b
--- /dev/null
+++ b/package/busybox/config/printutils/Config.in
@@ -0,0 +1,26 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Print Utilities"
+
+config BUSYBOX_LPD
+ bool "lpd"
+ default n
+ help
+ lpd is a print spooling daemon.
+
+config BUSYBOX_LPR
+ bool "lpr"
+ default n
+ help
+ lpr sends files (or standard input) to a print spooling daemon.
+
+config BUSYBOX_LPQ
+ bool "lpq"
+ default n
+ help
+ lpq is a print spool queue examination and manipulation program.
+
+endmenu
diff --git a/package/busybox/config/procps/Config.in b/package/busybox/config/procps/Config.in
new file mode 100644
index 000000000..1674c0cd7
--- /dev/null
+++ b/package/busybox/config/procps/Config.in
@@ -0,0 +1,200 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Process Utilities"
+
+config BUSYBOX_FREE
+ bool "free"
+ default y
+ help
+ free displays the total amount of free and used physical and swap
+ memory in the system, as well as the buffers used by the kernel.
+ The shared memory column should be ignored; it is obsolete.
+
+config BUSYBOX_FUSER
+ bool "fuser"
+ default y
+ help
+ fuser lists all PIDs (Process IDs) that currently have a given
+ file open. fuser can also list all PIDs that have a given network
+ (TCP or UDP) port open.
+
+config BUSYBOX_KILL
+ bool "kill"
+ default y
+ help
+ The command kill sends the specified signal to the specified
+ process or process group. If no signal is specified, the TERM
+ signal is sent.
+
+config BUSYBOX_KILLALL
+ bool "killall"
+ default y
+ depends on BUSYBOX_KILL
+ help
+ killall sends a signal to all processes running any of the
+ specified commands. If no signal name is specified, SIGTERM is
+ sent.
+
+config BUSYBOX_KILLALL5
+ bool "killall5"
+ default n
+ depends on BUSYBOX_KILL
+
+config BUSYBOX_NMETER
+ bool "nmeter"
+ default n
+ help
+ Prints selected system stats continuously, one line per update.
+
+config BUSYBOX_PGREP
+ bool "pgrep"
+ default n
+ help
+ Look for processes by name.
+
+config BUSYBOX_PIDOF
+ bool "pidof"
+ default y
+ help
+ Pidof finds the process id's (pids) of the named programs. It prints
+ those id's on the standard output.
+
+config BUSYBOX_FEATURE_PIDOF_SINGLE
+ bool "Enable argument for single shot (-s)"
+ default n
+ depends on BUSYBOX_PIDOF
+ help
+ Support argument '-s' for returning only the first pid found.
+
+config BUSYBOX_FEATURE_PIDOF_OMIT
+ bool "Enable argument for omitting pids (-o)"
+ default y
+ depends on BUSYBOX_PIDOF
+ help
+ Support argument '-o' for omitting the given pids in output.
+ The special pid %PPID can be used to name the parent process
+ of the pidof, in other words the calling shell or shell script.
+
+config BUSYBOX_PKILL
+ bool "pkill"
+ default y
+ help
+ Send signals to processes by name.
+
+config BUSYBOX_PS
+ bool "ps"
+ default y
+ help
+ ps gives a snapshot of the current processes.
+
+config BUSYBOX_FEATURE_PS_WIDE
+ bool "Enable argument for wide output (-w)"
+ default n
+ depends on BUSYBOX_PS
+ help
+ Support argument 'w' for wide output.
+ If given once, 132 chars are printed and given more than
+ one, the length is unlimited.
+
+config BUSYBOX_FEATURE_PS_TIME
+ bool "Enable time and elapsed time output"
+ default n
+ depends on BUSYBOX_PS && BUSYBOX_DESKTOP
+ help
+ Support -o time and -o etime output specifiers.
+
+config BUSYBOX_FEATURE_PS_UNUSUAL_SYSTEMS
+ bool "Support Linux prior to 2.4.0 and non-ELF systems"
+ default n
+ depends on BUSYBOX_FEATURE_PS_TIME
+ help
+ Include support for measuring HZ on old kernels and non-ELF systems
+ (if you are on Linux 2.4.0+ and use ELF, you don't need this)
+
+config BUSYBOX_RENICE
+ bool "renice"
+ default n
+ help
+ Renice alters the scheduling priority of one or more running
+ processes.
+
+config BUSYBOX_BB_SYSCTL
+ bool "sysctl"
+ default y
+ help
+ Configure kernel parameters at runtime.
+
+config BUSYBOX_TOP
+ bool "top"
+ default y
+ help
+ The top program provides a dynamic real-time view of a running
+ system.
+
+config BUSYBOX_FEATURE_TOP_CPU_USAGE_PERCENTAGE
+ bool "Show CPU per-process usage percentage"
+ default y
+ depends on BUSYBOX_TOP
+ help
+ Make top display CPU usage for each process.
+ This adds about 2k.
+
+config BUSYBOX_FEATURE_TOP_CPU_GLOBAL_PERCENTS
+ bool "Show CPU global usage percentage"
+ default y
+ depends on BUSYBOX_FEATURE_TOP_CPU_USAGE_PERCENTAGE
+ help
+ Makes top display "CPU: NN% usr NN% sys..." line.
+ This adds about 0.5k.
+
+config BUSYBOX_FEATURE_TOP_SMP_CPU
+ bool "SMP CPU usage display ('c' key)"
+ default n
+ depends on BUSYBOX_FEATURE_TOP_CPU_GLOBAL_PERCENTS
+ help
+ Allow 'c' key to switch between individual/cumulative CPU stats
+ This adds about 0.5k.
+
+config BUSYBOX_FEATURE_TOP_DECIMALS
+ bool "Show 1/10th of a percent in CPU/mem statistics"
+ default n
+ depends on BUSYBOX_FEATURE_TOP_CPU_USAGE_PERCENTAGE
+ help
+ Show 1/10th of a percent in CPU/mem statistics.
+ This adds about 0.3k.
+
+config BUSYBOX_FEATURE_TOP_SMP_PROCESS
+ bool "Show CPU process runs on ('j' field)"
+ default n
+ depends on BUSYBOX_TOP
+ help
+ Show CPU where process was last found running on.
+ This is the 'j' field.
+
+config BUSYBOX_FEATURE_TOPMEM
+ bool "Topmem command ('s' key)"
+ default n
+ depends on BUSYBOX_TOP
+ help
+ Enable 's' in top (gives lots of memory info).
+
+config BUSYBOX_UPTIME
+ bool "uptime"
+ default y
+ help
+ uptime gives a one line display of the current time, how long
+ the system has been running, how many users are currently logged
+ on, and the system load averages for the past 1, 5, and 15 minutes.
+
+config BUSYBOX_WATCH
+ bool "watch"
+ default y
+ help
+ watch is used to execute a program periodically, showing
+ output to the screen.
+
+
+endmenu
diff --git a/package/busybox/config/runit/Config.in b/package/busybox/config/runit/Config.in
new file mode 100644
index 000000000..d228df397
--- /dev/null
+++ b/package/busybox/config/runit/Config.in
@@ -0,0 +1,83 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Runit Utilities"
+
+config BUSYBOX_RUNSV
+ bool "runsv"
+ default n
+ help
+ runsv starts and monitors a service and optionally an appendant log
+ service.
+
+config BUSYBOX_RUNSVDIR
+ bool "runsvdir"
+ default n
+ help
+ runsvdir starts a runsv process for each subdirectory, or symlink to
+ a directory, in the services directory dir, up to a limit of 1000
+ subdirectories, and restarts a runsv process if it terminates.
+
+config BUSYBOX_FEATURE_RUNSVDIR_LOG
+ bool "Enable scrolling argument log"
+ depends on BUSYBOX_RUNSVDIR
+ default n
+ help
+ Enable feature where second parameter of runsvdir holds last error
+ message (viewable via top/ps). Otherwise (feature is off
+ or no parameter), error messages go to stderr only.
+
+config BUSYBOX_SV
+ bool "sv"
+ default n
+ help
+ sv reports the current status and controls the state of services
+ monitored by the runsv supervisor.
+
+config BUSYBOX_SV_DEFAULT_SERVICE_DIR
+ string "Default directory for services"
+ default "/var/service"
+ depends on BUSYBOX_SV
+ help
+ Default directory for services.
+ Defaults to "/var/service"
+
+config BUSYBOX_SVLOGD
+ bool "svlogd"
+ default n
+ help
+ svlogd continuously reads log data from its standard input, optionally
+ filters log messages, and writes the data to one or more automatically
+ rotated logs.
+
+config BUSYBOX_CHPST
+ bool "chpst"
+ default n
+ help
+ chpst changes the process state according to the given options, and
+ execs specified program.
+
+config BUSYBOX_SETUIDGID
+ bool "setuidgid"
+ help
+ Sets soft resource limits as specified by options
+
+config BUSYBOX_ENVUIDGID
+ bool "envuidgid"
+ help
+ Sets $UID to account's uid and $GID to account's gid
+
+config BUSYBOX_ENVDIR
+ bool "envdir"
+ help
+ Sets various environment variables as specified by files
+ in the given directory
+
+config BUSYBOX_SOFTLIMIT
+ bool "softlimit"
+ help
+ Sets soft resource limits as specified by options
+
+endmenu
diff --git a/package/busybox/config/selinux/Config.in b/package/busybox/config/selinux/Config.in
new file mode 100644
index 000000000..ddb0247ba
--- /dev/null
+++ b/package/busybox/config/selinux/Config.in
@@ -0,0 +1,123 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "SELinux Utilities"
+ depends on BUSYBOX_SELINUX
+
+config BUSYBOX_CHCON
+ bool "chcon"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to change the security context of file.
+
+config BUSYBOX_FEATURE_CHCON_LONG_OPTIONS
+ bool "Enable long options"
+ default y
+ depends on BUSYBOX_CHCON && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the chcon applet.
+
+config BUSYBOX_GETENFORCE
+ bool "getenforce"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to get the current mode of SELinux.
+
+config BUSYBOX_GETSEBOOL
+ bool "getsebool"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to get SELinux boolean values.
+
+config BUSYBOX_LOAD_POLICY
+ bool "load_policy"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to load SELinux policy.
+
+config BUSYBOX_MATCHPATHCON
+ bool "matchpathcon"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to get default security context of the
+ specified path from the file contexts configuration.
+
+config BUSYBOX_RESTORECON
+ bool "restorecon"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to relabel files. The feature is almost
+ the same as setfiles, but usage is a little different.
+
+config BUSYBOX_RUNCON
+ bool "runcon"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to run command in speficied security context.
+
+config BUSYBOX_FEATURE_RUNCON_LONG_OPTIONS
+ bool "Enable long options"
+ default y
+ depends on BUSYBOX_RUNCON && BUSYBOX_GETOPT_LONG
+ help
+ Support long options for the runcon applet.
+
+config BUSYBOX_SELINUXENABLED
+ bool "selinuxenabled"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support for this command to be used within shell scripts
+ to determine if selinux is enabled.
+
+config BUSYBOX_SETENFORCE
+ bool "setenforce"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to modify the mode SELinux is running in.
+
+config BUSYBOX_SETFILES
+ bool "setfiles"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support to modify to relabel files.
+ Notice: If you built libselinux with -D_FILE_OFFSET_BITS=64,
+ (It is default in libselinux's Makefile), you _must_ enable
+ CONFIG_LFS.
+
+config BUSYBOX_FEATURE_SETFILES_CHECK_OPTION
+ bool "Enable check option"
+ default n
+ depends on BUSYBOX_SETFILES
+ help
+ Support "-c" option (check the validity of the contexts against
+ the specified binary policy) for setfiles. Requires libsepol.
+
+config BUSYBOX_SETSEBOOL
+ bool "setsebool"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Enable support for change boolean.
+ semanage and -P option is not supported yet.
+
+config BUSYBOX_SESTATUS
+ bool "sestatus"
+ default n
+ depends on BUSYBOX_SELINUX
+ help
+ Displays the status of SELinux.
+
+endmenu
+
diff --git a/package/busybox/config/shell/Config.in b/package/busybox/config/shell/Config.in
new file mode 100644
index 000000000..459bbc62b
--- /dev/null
+++ b/package/busybox/config/shell/Config.in
@@ -0,0 +1,344 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Shells"
+
+choice
+ prompt "Choose your default shell"
+ default FEATURE_SH_IS_ASH
+ help
+ Choose a shell. The ash shell is the most bash compatible
+ and full featured one.
+
+config BUSYBOX_FEATURE_SH_IS_ASH
+ select BUSYBOX_ASH
+ bool "ash"
+
+config BUSYBOX_FEATURE_SH_IS_HUSH
+ select BUSYBOX_HUSH
+ bool "hush"
+
+####config FEATURE_SH_IS_LASH
+#### select LASH
+#### bool "lash"
+
+config BUSYBOX_FEATURE_SH_IS_MSH
+ select BUSYBOX_MSH
+ bool "msh"
+
+config BUSYBOX_FEATURE_SH_IS_NONE
+ bool "none"
+
+endchoice
+
+config BUSYBOX_ASH
+ bool "ash"
+ default y
+ help
+ Tha 'ash' shell adds about 60k in the default configuration and is
+ the most complete and most pedantically correct shell included with
+ busybox. This shell is actually a derivative of the Debian 'dash'
+ shell (by Herbert Xu), which was created by porting the 'ash' shell
+ (written by Kenneth Almquist) from NetBSD.
+
+comment "Ash Shell Options"
+ depends on BUSYBOX_ASH
+
+config BUSYBOX_ASH_BASH_COMPAT
+ bool "bash-compatible extensions"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable bash-compatible extensions.
+
+config BUSYBOX_ASH_JOB_CONTROL
+ bool "Job control"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable job control in the ash shell.
+
+config BUSYBOX_ASH_READ_NCHARS
+ bool "'read -n N' and 'read -s' support"
+ default n
+ depends on BUSYBOX_ASH
+ help
+ 'read -n N' will return a value after N characters have been read.
+ 'read -s' will read without echoing the user's input.
+
+config BUSYBOX_ASH_READ_TIMEOUT
+ bool "'read -t S' support"
+ default n
+ depends on BUSYBOX_ASH
+ help
+ 'read -t S' will return a value after S seconds have passed.
+ This implementation will allow fractional seconds, expressed
+ as a decimal fraction, e.g. 'read -t 2.5 foo'.
+
+config BUSYBOX_ASH_ALIAS
+ bool "alias support"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable alias support in the ash shell.
+
+config BUSYBOX_ASH_MATH_SUPPORT
+ bool "Posix math support"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable math support in the ash shell.
+
+config BUSYBOX_ASH_MATH_SUPPORT_64
+ bool "Extend Posix math support to 64 bit"
+ default n
+ depends on BUSYBOX_ASH_MATH_SUPPORT
+ help
+ Enable 64-bit math support in the ash shell. This will make
+ the shell slightly larger, but will allow computation with very
+ large numbers.
+
+config BUSYBOX_ASH_GETOPTS
+ bool "Builtin getopt to parse positional parameters"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable getopts builtin in the ash shell.
+
+config BUSYBOX_ASH_BUILTIN_ECHO
+ bool "Builtin version of 'echo'"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable support for echo, builtin to ash.
+
+config BUSYBOX_ASH_BUILTIN_PRINTF
+ bool "Builtin version of 'printf'"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable support for printf, builtin to ash.
+
+config BUSYBOX_ASH_BUILTIN_TEST
+ bool "Builtin version of 'test'"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Enable support for test, builtin to ash.
+
+config BUSYBOX_ASH_CMDCMD
+ bool "'command' command to override shell builtins"
+ default n
+ depends on BUSYBOX_ASH
+ help
+ Enable support for the ash 'command' builtin, which allows
+ you to run the specified command with the specified arguments,
+ even when there is an ash builtin command with the same name.
+
+config BUSYBOX_ASH_MAIL
+ bool "Check for new mail on interactive shells"
+ default n
+ depends on BUSYBOX_ASH
+ help
+ Enable "check for new mail" in the ash shell.
+
+config BUSYBOX_ASH_OPTIMIZE_FOR_SIZE
+ bool "Optimize for size instead of speed"
+ default y
+ depends on BUSYBOX_ASH
+ help
+ Compile ash for reduced size at the price of speed.
+
+config BUSYBOX_ASH_RANDOM_SUPPORT
+ bool "Pseudorandom generator and variable $RANDOM"
+ default n
+ depends on BUSYBOX_ASH
+ help
+ Enable pseudorandom generator and dynamic variable "$RANDOM".
+ Each read of "$RANDOM" will generate a new pseudorandom value.
+ You can reset the generator by using a specified start value.
+ After "unset RANDOM" then generator will switch off and this
+ variable will no longer have special treatment.
+
+config BUSYBOX_ASH_EXPAND_PRMT
+ bool "Expand prompt string"
+ default n
+ depends on BUSYBOX_ASH
+ help
+ "PS#" may be contain volatile content, such as backquote commands.
+ This option recreates the prompt string from the environment
+ variable each time it is displayed.
+
+config BUSYBOX_HUSH
+ bool "hush"
+ default n
+ help
+ hush is a very small shell (just 18k) and it has fairly complete
+ Bourne shell grammar. It even handles all the normal flow control
+ options such as if/then/elif/else/fi, for/in/do/done, while loops,
+ case/esac.
+
+ It uses only vfork, so it can be used on uClinux systems.
+
+ It does not handle select, functions, here documents ( <<
+ word ), arithmetic expansion, aliases, brace expansion, tilde
+ expansion, &> and >& redirection of stdout+stderr, etc.
+
+config BUSYBOX_HUSH_HELP
+ bool "help builtin"
+ default n
+ depends on BUSYBOX_HUSH
+ help
+ Enable help builtin in hush. Code size + ~1 kbyte.
+
+config BUSYBOX_HUSH_INTERACTIVE
+ bool "Interactive mode"
+ default y
+ depends on BUSYBOX_HUSH
+ help
+ Enable interactive mode (prompt and command editing).
+ Without this, hush simply reads and executes commands
+ from stdin just like a shell script from the file.
+ No prompt, no PS1/PS2 magic shell variables.
+
+config BUSYBOX_HUSH_JOB
+ bool "Job control"
+ default n
+ depends on BUSYBOX_HUSH_INTERACTIVE
+ help
+ Enable job control: Ctrl-Z backgrounds, Ctrl-C interrupts current
+ command (not entire shell), fg/bg builtins work. Without this option,
+ "cmd &" still works by simply spawning a process and immediately
+ prompting for next command (or executing next command in a script),
+ but no separate process group is formed.
+
+config BUSYBOX_HUSH_TICK
+ bool "Process substitution"
+ default n
+ depends on BUSYBOX_HUSH
+ help
+ Enable process substitution `command` and $(command) in hush.
+
+config BUSYBOX_HUSH_IF
+ bool "Support if/then/elif/else/fi"
+ default n
+ depends on BUSYBOX_HUSH
+ help
+ Enable if/then/elif/else/fi in hush.
+
+config BUSYBOX_HUSH_LOOPS
+ bool "Support for, while and until loops"
+ default n
+ depends on BUSYBOX_HUSH
+ help
+ Enable for, while and until loops in hush.
+ As of 2008-07, break and continue statements are not supported.
+
+config BUSYBOX_HUSH_CASE
+ bool "Support case ... esac statement"
+ default n
+ depends on BUSYBOX_HUSH
+ help
+ Enable case ... esac statement in hush. +400 bytes.
+
+config BUSYBOX_LASH
+ bool "lash"
+ default n
+ select BUSYBOX_HUSH
+ help
+ lash is deprecated and will be removed, please migrate to hush.
+
+config BUSYBOX_MSH
+ bool "msh"
+ default n
+ help
+ The minix shell (adds just 30k) is quite complete and handles things
+ like for/do/done, case/esac and all the things you expect a Bourne
+ shell to do. It is not always pedantically correct about Bourne
+ shell grammar (try running the shell testscript "tests/sh.testcases"
+ on it and compare vs bash) but for most things it works quite well.
+ It uses only vfork, so it can be used on uClinux systems.
+
+comment "Bourne Shell Options"
+ depends on BUSYBOX_MSH || BUSYBOX_LASH || BUSYBOX_HUSH || BUSYBOX_ASH
+
+config BUSYBOX_FEATURE_SH_EXTRA_QUIET
+ bool "Hide message on interactive shell startup"
+ default n
+ depends on BUSYBOX_MSH || BUSYBOX_LASH || BUSYBOX_HUSH || BUSYBOX_ASH
+ help
+ Remove the busybox introduction when starting a shell.
+
+config BUSYBOX_FEATURE_SH_STANDALONE
+ bool "Standalone shell"
+ default n
+ depends on (BUSYBOX_MSH || BUSYBOX_LASH || BUSYBOX_HUSH || BUSYBOX_ASH) && BUSYBOX_FEATURE_PREFER_APPLETS
+ help
+ This option causes busybox shells to use busybox applets
+ in preference to executables in the PATH whenever possible. For
+ example, entering the command 'ifconfig' into the shell would cause
+ busybox to use the ifconfig busybox applet. Specifying the fully
+ qualified executable name, such as '/sbin/ifconfig' will still
+ execute the /sbin/ifconfig executable on the filesystem. This option
+ is generally used when creating a statically linked version of busybox
+ for use as a rescue shell, in the event that you screw up your system.
+
+ This is implemented by re-execing /proc/self/exe (typically)
+ with right parameters. Some selected applets ("NOFORK" applets)
+ can even be executed without creating new process.
+ Instead, busybox will call <applet>_main() internally.
+
+ However, this causes problems in chroot jails without mounted /proc
+ and with ps/top (command name can be shown as 'exe' for applets
+ started this way).
+# untrue?
+# Note that this will *also* cause applets to take precedence
+# over shell builtins of the same name. So turning this on will
+# eliminate any performance gained by turning on the builtin "echo"
+# and "test" commands in ash.
+# untrue?
+# Note that when using this option, the shell will attempt to directly
+# run '/bin/busybox'. If you do not have the busybox binary sitting in
+# that exact location with that exact name, this option will not work at
+# all.
+
+config BUSYBOX_FEATURE_SH_NOFORK
+ bool "Run 'nofork' applets directly"
+ default n
+ depends on (BUSYBOX_MSH || BUSYBOX_LASH || BUSYBOX_HUSH || BUSYBOX_ASH) && BUSYBOX_FEATURE_PREFER_APPLETS
+ help
+ This option causes busybox shells [currently only ash]
+ to not execute typical fork/exec/wait sequence, but call <applet>_main
+ directly, if possible. (Sometimes it is not possible: for example,
+ this is not possible in pipes).
+
+ This will be done only for some applets (those which are marked
+ NOFORK in include/applets.h).
+
+ This may significantly speed up some shell scripts.
+
+ This feature is relatively new. Use with care.
+
+config BUSYBOX_CTTYHACK
+ bool "cttyhack"
+ default n
+ help
+ One common problem reported on the mailing list is "can't access tty;
+ job control turned off" error message which typically appears when
+ one tries to use shell with stdin/stdout opened to /dev/console.
+ This device is special - it cannot be a controlling tty.
+
+ Proper solution is to use correct device instead of /dev/console.
+
+ cttyhack provides "quick and dirty" solution to this problem.
+ It analyzes stdin with various ioctls, trying to determine whether
+ it is a /dev/ttyN or /dev/ttySN (virtual terminal or serial line).
+ If it detects one, it closes stdin/out/err and reopens that device.
+ Then it executes given program. Usage example for /etc/inittab
+ (for busybox init):
+
+ ::respawn:/bin/cttyhack /bin/sh
+
+endmenu
diff --git a/package/busybox/config/sysklogd/Config.in b/package/busybox/config/sysklogd/Config.in
new file mode 100644
index 000000000..282de7bee
--- /dev/null
+++ b/package/busybox/config/sysklogd/Config.in
@@ -0,0 +1,118 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "System Logging Utilities"
+
+config BUSYBOX_SYSLOGD
+ bool "syslogd"
+ default y
+ help
+ The syslogd utility is used to record logs of all the
+ significant events that occur on a system. Every
+ message that is logged records the date and time of the
+ event, and will generally also record the name of the
+ application that generated the message. When used in
+ conjunction with klogd, messages from the Linux kernel
+ can also be recorded. This is terribly useful,
+ especially for finding what happened when something goes
+ wrong. And something almost always will go wrong if
+ you wait long enough....
+
+config BUSYBOX_FEATURE_ROTATE_LOGFILE
+ bool "Rotate message files"
+ default n
+ depends on BUSYBOX_SYSLOGD
+ help
+ This enables syslogd to rotate the message files
+ on his own. No need to use an external rotatescript.
+
+config BUSYBOX_FEATURE_REMOTE_LOG
+ bool "Remote Log support"
+ default n
+ depends on BUSYBOX_SYSLOGD
+ help
+ When you enable this feature, the syslogd utility can
+ be used to send system log messages to another system
+ connected via a network. This allows the remote
+ machine to log all the system messages, which can be
+ terribly useful for reducing the number of serial
+ cables you use. It can also be a very good security
+ measure to prevent system logs from being tampered with
+ by an intruder.
+
+config BUSYBOX_FEATURE_SYSLOGD_DUP
+ bool "Support -D (drop dups) option"
+ default n
+ depends on BUSYBOX_SYSLOGD
+ help
+ Option -D instructs syslogd to drop consecutive messages
+ which are totally the same.
+
+config BUSYBOX_FEATURE_IPC_SYSLOG
+ bool "Circular Buffer support"
+ default y
+ depends on BUSYBOX_SYSLOGD
+ help
+ When you enable this feature, the syslogd utility will
+ use a circular buffer to record system log messages.
+ When the buffer is filled it will continue to overwrite
+ the oldest messages. This can be very useful for
+ systems with little or no permanent storage, since
+ otherwise system logs can eventually fill up your
+ entire filesystem, which may cause your system to
+ break badly.
+
+config BUSYBOX_FEATURE_IPC_SYSLOG_BUFFER_SIZE
+ int "Circular buffer size in Kbytes (minimum 4KB)"
+ default 16
+ range 4 2147483647
+ depends on BUSYBOX_FEATURE_IPC_SYSLOG
+ help
+ This option sets the size of the circular buffer
+ used to record system log messages.
+
+config BUSYBOX_LOGREAD
+ bool "logread"
+ default y
+ depends on BUSYBOX_FEATURE_IPC_SYSLOG
+ help
+ If you enabled Circular Buffer support, you almost
+ certainly want to enable this feature as well. This
+ utility will allow you to read the messages that are
+ stored in the syslogd circular buffer.
+
+config BUSYBOX_FEATURE_LOGREAD_REDUCED_LOCKING
+ bool "Double buffering"
+ default y
+ depends on BUSYBOX_LOGREAD
+ help
+ 'logread' ouput to slow serial terminals can have
+ side effects on syslog because of the semaphore.
+ This option make logread to double buffer copy
+ from circular buffer, minimizing semaphore
+ contention at some minor memory expense.
+
+config BUSYBOX_KLOGD
+ bool "klogd"
+ default y
+ help
+ klogd is a utility which intercepts and logs all
+ messages from the Linux kernel and sends the messages
+ out to the 'syslogd' utility so they can be logged. If
+ you wish to record the messages produced by the kernel,
+ you should enable this option.
+
+config BUSYBOX_LOGGER
+ bool "logger"
+ default y
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ The logger utility allows you to send arbitrary text
+ messages to the system log (i.e. the 'syslogd' utility) so
+ they can be logged. This is generally used to help locate
+ problems that occur within programs and scripts.
+
+endmenu
+
diff --git a/package/busybox/config/util-linux/Config.in b/package/busybox/config/util-linux/Config.in
new file mode 100644
index 000000000..3f67b0b8e
--- /dev/null
+++ b/package/busybox/config/util-linux/Config.in
@@ -0,0 +1,845 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+menu "Linux System Utilities"
+
+config BUSYBOX_BLKID
+ bool "blkid"
+ default y
+ select BUSYBOX_VOLUMEID
+ help
+ Lists labels and UUIDs of all filesystems.
+ WARNING:
+ With all submodules selected, it will add ~8k to busybox.
+
+config BUSYBOX_DMESG
+ bool "dmesg"
+ default y
+ help
+ dmesg is used to examine or control the kernel ring buffer. When the
+ Linux kernel prints messages to the system log, they are stored in
+ the kernel ring buffer. You can use dmesg to print the kernel's ring
+ buffer, clear the kernel ring buffer, change the size of the kernel
+ ring buffer, and change the priority level at which kernel messages
+ are also logged to the system console. Enable this option if you
+ wish to enable the 'dmesg' utility.
+
+config BUSYBOX_FEATURE_DMESG_PRETTY
+ bool "Pretty dmesg output"
+ default y
+ depends on BUSYBOX_DMESG
+ help
+ If you wish to scrub the syslog level from the output, say 'Y' here.
+ The syslog level is a string prefixed to every line with the form
+ "<#>".
+
+ With this option you will see:
+ # dmesg
+ Linux version 2.6.17.4 .....
+ BIOS-provided physical RAM map:
+ BIOS-e820: 0000000000000000 - 000000000009f000 (usable)
+
+ Without this option you will see:
+ # dmesg
+ <5>Linux version 2.6.17.4 .....
+ <6>BIOS-provided physical RAM map:
+ <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable)
+
+config BUSYBOX_FBSET
+ bool "fbset"
+ default n
+ help
+ fbset is used to show or change the settings of a Linux frame buffer
+ device. The frame buffer device provides a simple and unique
+ interface to access a graphics display. Enable this option
+ if you wish to enable the 'fbset' utility.
+
+config BUSYBOX_FEATURE_FBSET_FANCY
+ bool "Turn on extra fbset options"
+ default n
+ depends on BUSYBOX_FBSET
+ help
+ This option enables extended fbset options, allowing one to set the
+ framebuffer size, color depth, etc. interface to access a graphics
+ display. Enable this option if you wish to enable extended fbset
+ options.
+
+config BUSYBOX_FEATURE_FBSET_READMODE
+ bool "Turn on fbset readmode support"
+ default n
+ depends on BUSYBOX_FBSET
+ help
+ This option allows fbset to read the video mode database stored by
+ default as /etc/fb.modes, which can be used to set frame buffer
+ device to pre-defined video modes.
+
+config BUSYBOX_FDFLUSH
+ bool "fdflush"
+ default n
+ help
+ fdflush is only needed when changing media on slightly-broken
+ removable media drives. It is used to make Linux believe that a
+ hardware disk-change switch has been actuated, which causes Linux to
+ forget anything it has cached from the previous media. If you have
+ such a slightly-broken drive, you will need to run fdflush every time
+ you change a disk. Most people have working hardware and can safely
+ leave this disabled.
+
+config BUSYBOX_FDFORMAT
+ bool "fdformat"
+ default n
+ help
+ fdformat is used to low-level format a floppy disk.
+
+config BUSYBOX_FDISK
+ bool "fdisk"
+ default y
+ help
+ The fdisk utility is used to divide hard disks into one or more
+ logical disks, which are generally called partitions. This utility
+ can be used to list and edit the set of partitions or BSD style
+ 'disk slices' that are defined on a hard drive.
+
+config BUSYBOX_FDISK_SUPPORT_LARGE_DISKS
+ bool "Support over 4GB disks"
+ default y
+ depends on BUSYBOX_FDISK
+ help
+ Enable this option to support large disks > 4GB.
+
+config BUSYBOX_FEATURE_FDISK_WRITABLE
+ bool "Write support"
+ default y
+ depends on BUSYBOX_FDISK
+ help
+ Enabling this option allows you to create or change a partition table
+ and write those changes out to disk. If you leave this option
+ disabled, you will only be able to view the partition table.
+
+config BUSYBOX_FEATURE_AIX_LABEL
+ bool "Support AIX disklabels"
+ default n
+ depends on BUSYBOX_FDISK && BUSYBOX_FEATURE_FDISK_WRITABLE
+ help
+ Enabling this option allows you to create or change AIX disklabels.
+ Most people can safely leave this option disabled.
+
+config BUSYBOX_FEATURE_SGI_LABEL
+ bool "Support SGI disklabels"
+ default n
+ depends on BUSYBOX_FDISK && BUSYBOX_FEATURE_FDISK_WRITABLE
+ help
+ Enabling this option allows you to create or change SGI disklabels.
+ Most people can safely leave this option disabled.
+
+config BUSYBOX_FEATURE_SUN_LABEL
+ bool "Support SUN disklabels"
+ default n
+ depends on BUSYBOX_FDISK && BUSYBOX_FEATURE_FDISK_WRITABLE
+ help
+ Enabling this option allows you to create or change SUN disklabels.
+ Most people can safely leave this option disabled.
+
+config BUSYBOX_FEATURE_OSF_LABEL
+ bool "Support BSD disklabels"
+ default n
+ depends on BUSYBOX_FDISK && BUSYBOX_FEATURE_FDISK_WRITABLE
+ help
+ Enabling this option allows you to create or change BSD disklabels
+ and define and edit BSD disk slices.
+
+config BUSYBOX_FEATURE_FDISK_ADVANCED
+ bool "Support expert mode"
+ default n
+ depends on BUSYBOX_FDISK && BUSYBOX_FEATURE_FDISK_WRITABLE
+ help
+ Enabling this option allows you to do terribly unsafe things like
+ define arbitrary drive geometry, move the beginning of data in a
+ partition, and similarly evil things. Unless you have a very good
+ reason you would be wise to leave this disabled.
+
+config BUSYBOX_FINDFS
+ bool "findfs"
+ default n
+ select BUSYBOX_VOLUMEID
+ help
+ Prints the name of a filesystem with given label or UUID.
+ WARNING:
+ With all submodules selected, it will add ~8k to busybox.
+
+config BUSYBOX_FREERAMDISK
+ bool "freeramdisk"
+ default n
+ help
+ Linux allows you to create ramdisks. This utility allows you to
+ delete them and completely free all memory that was used for the
+ ramdisk. For example, if you boot Linux into a ramdisk and later
+ pivot_root, you may want to free the memory that is allocated to the
+ ramdisk. If you have no use for freeing memory from a ramdisk, leave
+ this disabled.
+
+config BUSYBOX_FSCK_MINIX
+ bool "fsck_minix"
+ default n
+ help
+ The minix filesystem is a nice, small, compact, read-write filesystem
+ with little overhead. It is not a journaling filesystem however and
+ can experience corruption if it is not properly unmounted or if the
+ power goes off in the middle of a write. This utility allows you to
+ check for and attempt to repair any corruption that occurs to a minix
+ filesystem.
+
+config BUSYBOX_MKFS_MINIX
+ bool "mkfs_minix"
+ default n
+ help
+ The minix filesystem is a nice, small, compact, read-write filesystem
+ with little overhead. If you wish to be able to create minix
+ filesystems this utility will do the job for you.
+
+comment "Minix filesystem support"
+ depends on BUSYBOX_FSCK_MINIX || BUSYBOX_MKFS_MINIX
+
+config BUSYBOX_FEATURE_MINIX2
+ bool "Support Minix fs v2 (fsck_minix/mkfs_minix)"
+ default y
+ depends on BUSYBOX_FSCK_MINIX || BUSYBOX_MKFS_MINIX
+ help
+ If you wish to be able to create version 2 minix filesystems, enable
+ this. If you enabled 'mkfs_minix' then you almost certainly want to
+ be using the version 2 filesystem support.
+
+config BUSYBOX_GETOPT
+ bool "getopt"
+ default n
+ help
+ The getopt utility is used to break up (parse) options in command
+ lines to make it easy to write complex shell scripts that also check
+ for legal (and illegal) options. If you want to write horribly
+ complex shell scripts, or use some horribly complex shell script
+ written by others, this utility may be for you. Most people will
+ wisely leave this disabled.
+
+config BUSYBOX_HEXDUMP
+ bool "hexdump"
+ default y
+ help
+ The hexdump utility is used to display binary data in a readable
+ way that is comparable to the output from most hex editors.
+
+config BUSYBOX_FEATURE_HEXDUMP_REVERSE
+ bool "Support -R, reverse of 'hexdump -Cv'"
+ default n
+ depends on BUSYBOX_HEXDUMP
+ help
+ The hexdump utility is used to display binary data in an ascii
+ readable way. This option creates binary data from an ascii input.
+ NB: this option is non-standard. It's unwise to use it in scripts
+ aimed to be portable.
+
+config BUSYBOX_HD
+ bool "hd"
+ default n
+ select BUSYBOX_HEXDUMP
+ help
+ hd is an alias to hexdump -C.
+
+config BUSYBOX_HWCLOCK
+ bool "hwclock"
+ default n
+ help
+ The hwclock utility is used to read and set the hardware clock
+ on a system. This is primarily used to set the current time on
+ shutdown in the hardware clock, so the hardware will keep the
+ correct time when Linux is _not_ running.
+
+config BUSYBOX_FEATURE_HWCLOCK_LONG_OPTIONS
+ bool "Support long options (--hctosys,...)"
+ default n
+ depends on BUSYBOX_HWCLOCK && BUSYBOX_GETOPT_LONG
+ help
+ By default, the hwclock utility only uses short options. If you
+ are overly fond of its long options, such as --hctosys, --utc, etc)
+ then enable this option.
+
+config BUSYBOX_FEATURE_HWCLOCK_ADJTIME_FHS
+ bool "Use FHS /var/lib/hwclock/adjtime"
+ default y
+ depends on BUSYBOX_HWCLOCK
+ help
+ Starting with FHS 2.3, the adjtime state file is supposed to exist
+ at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish
+ to use the FHS behavior, answer Y here, otherwise answer N for the
+ classic /etc/adjtime path.
+
+ pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO
+
+config BUSYBOX_IPCRM
+ bool "ipcrm"
+ default y
+ select BUSYBOX_FEATURE_SUID
+ help
+ The ipcrm utility allows the removal of System V interprocess
+ communication (IPC) objects and the associated data structures
+ from the system.
+
+config BUSYBOX_IPCS
+ bool "ipcs"
+ default y
+ select BUSYBOX_FEATURE_SUID
+ help
+ The ipcs utility is used to provide information on the currently
+ allocated System V interprocess (IPC) objects in the system.
+
+config BUSYBOX_LOSETUP
+ bool "losetup"
+ default y
+ help
+ losetup is used to associate or detach a loop device with a regular
+ file or block device, and to query the status of a loop device. This
+ version does not currently support enabling data encryption.
+
+config BUSYBOX_MDEV
+ bool "mdev"
+ default y
+ help
+ mdev is a mini-udev implementation for dynamically creating device
+ nodes in the /dev directory.
+
+ For more information, please see docs/mdev.txt
+
+config BUSYBOX_FEATURE_MDEV_CONF
+ bool "Support /etc/mdev.conf"
+ default y
+ depends on BUSYBOX_MDEV
+ help
+ Add support for the mdev config file to control ownership and
+ permissions of the device nodes.
+
+ For more information, please see docs/mdev.txt
+
+config BUSYBOX_FEATURE_MDEV_RENAME
+ bool "Support subdirs/symlinks"
+ default y
+ depends on BUSYBOX_FEATURE_MDEV_CONF
+ help
+ Add support for renaming devices and creating symlinks.
+
+ For more information, please see docs/mdev.txt
+
+config BUSYBOX_FEATURE_MDEV_RENAME_REGEXP
+ bool "Support regular expressions substitutions when renaming device"
+ default y
+ depends on BUSYBOX_FEATURE_MDEV_RENAME
+ help
+ Add support for regular expressions substitutions when renaming
+ device.
+
+config BUSYBOX_FEATURE_MDEV_EXEC
+ bool "Support command execution at device addition/removal"
+ default y
+ depends on BUSYBOX_FEATURE_MDEV_CONF
+ help
+ This adds support for an optional field to /etc/mdev.conf for
+ executing commands when devices are created/removed.
+
+ For more information, please see docs/mdev.txt
+
+config BUSYBOX_FEATURE_MDEV_LOAD_FIRMWARE
+ bool "Support loading of firmwares"
+ default y
+ depends on BUSYBOX_MDEV
+ help
+ Some devices need to load firmware before they can be usable.
+
+ These devices will request userspace look up the files in
+ /lib/firmware/ and if it exists, send it to the kernel for
+ loading into the hardware.
+
+config BUSYBOX_MKSWAP
+ bool "mkswap"
+ default n
+ help
+ The mkswap utility is used to configure a file or disk partition as
+ Linux swap space. This allows Linux to use the entire file or
+ partition as if it were additional RAM, which can greatly increase
+ the capability of low-memory machines. This additional memory is
+ much slower than real RAM, but can be very helpful at preventing your
+ applications being killed by the Linux out of memory (OOM) killer.
+ Once you have created swap space using 'mkswap' you need to enable
+ the swap space using the 'swapon' utility.
+
+config BUSYBOX_FEATURE_MKSWAP_V0
+ bool "Version 0 support"
+ default n
+ depends on BUSYBOX_MKSWAP
+# depends on BUSYBOX_MKSWAP && BUSYBOX_DEPRECATED
+ help
+ Enable support for the old v0 style.
+ If your kernel is older than 2.1.117, then v0 support is the
+ only option.
+
+config BUSYBOX_MORE
+ bool "more"
+ default y
+ help
+ more is a simple utility which allows you to read text one screen
+ sized page at a time. If you want to read text that is larger than
+ the screen, and you are using anything faster than a 300 baud modem,
+ you will probably find this utility very helpful. If you don't have
+ any need to reading text files, you can leave this disabled.
+
+config BUSYBOX_FEATURE_USE_TERMIOS
+ bool "Use termios to manipulate the screen"
+ default y
+ depends on BUSYBOX_MORE || BUSYBOX_TOP
+ help
+ This option allows utilities such as 'more' and 'top' to determine
+ the size of the screen. If you leave this disabled, your utilities
+ that display things on the screen will be especially primitive and
+ will be unable to determine the current screen size, and will be
+ unable to move the cursor.
+
+config BUSYBOX_VOLUMEID
+ bool #No description makes it a hidden option
+ default n
+
+config BUSYBOX_FEATURE_VOLUMEID_EXT
+ bool "Ext filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_REISERFS
+ bool "Reiser filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_FAT
+ bool "fat filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_HFS
+ bool "hfs filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_JFS
+ bool "jfs filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+### config FEATURE_VOLUMEID_UFS
+### bool "ufs filesystem"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_XFS
+ bool "xfs filesystem"
+ default y
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_NTFS
+ bool "ntfs filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_ISO9660
+ bool "iso9660 filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_UDF
+ bool "udf filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_LUKS
+ bool "luks filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_LINUXSWAP
+ bool "linux swap filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+### config FEATURE_VOLUMEID_LVM
+### bool "lvm"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_CRAMFS
+ bool "cramfs filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+### config FEATURE_VOLUMEID_HPFS
+### bool "hpfs filesystem"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_ROMFS
+ bool "romfs filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_SYSV
+ bool "sysv filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+### config FEATURE_VOLUMEID_MINIX
+### bool "minix filesystem"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+### These only detect partition tables - not used (yet?)
+### config FEATURE_VOLUMEID_MAC
+### bool "mac filesystem"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+###
+### config FEATURE_VOLUMEID_MSDOS
+### bool "msdos filesystem"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_OCFS2
+ bool "ocfs2 filesystem"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+### config FEATURE_VOLUMEID_HIGHPOINTRAID
+### bool "highpoint raid"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+### config FEATURE_VOLUMEID_ISWRAID
+### bool "intel raid"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+### config FEATURE_VOLUMEID_LSIRAID
+### bool "lsi raid"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+### config FEATURE_VOLUMEID_VIARAID
+### bool "via raid"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+### config FEATURE_VOLUMEID_SILICONRAID
+### bool "silicon raid"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+### config FEATURE_VOLUMEID_NVIDIARAID
+### bool "nvidia raid"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+### config FEATURE_VOLUMEID_PROMISERAID
+### bool "promise raid"
+### default n
+### depends on BUSYBOX_VOLUMEID
+### help
+### TODO
+
+config BUSYBOX_FEATURE_VOLUMEID_LINUXRAID
+ bool "linuxraid"
+ default n
+ depends on BUSYBOX_VOLUMEID
+ help
+ TODO
+
+config BUSYBOX_MOUNT
+ bool "mount"
+ default y
+ help
+ All files and filesystems in Unix are arranged into one big directory
+ tree. The 'mount' utility is used to graft a filesystem onto a
+ particular part of the tree. A filesystem can either live on a block
+ device, or it can be accessible over the network, as is the case with
+ NFS filesystems. Most people using BusyBox will also want to enable
+ the 'mount' utility.
+
+config BUSYBOX_FEATURE_MOUNT_FAKE
+ bool "Support option -f"
+ default n
+ depends on BUSYBOX_MOUNT
+ help
+ Enable support for faking a file system mount.
+
+config BUSYBOX_FEATURE_MOUNT_VERBOSE
+ bool "Support option -v"
+ default n
+ depends on BUSYBOX_MOUNT
+ help
+ Enable multi-level -v[vv...] verbose messages. Useful if you
+ debug mount problems and want to see what is exactly passed
+ to the kernel.
+
+config BUSYBOX_FEATURE_MOUNT_HELPERS
+ bool "Support mount helpers"
+ default y
+ depends on BUSYBOX_MOUNT
+ help
+ Enable mounting of virtual file systems via external helpers.
+ E.g. "mount obexfs#-b00.11.22.33.44.55 /mnt" will in effect call
+ "obexfs -b00.11.22.33.44.55 /mnt"
+ Also "mount -t sometype [-o opts] fs /mnt" will try
+ "sometype [-o opts] fs /mnt" if simple mount syscall fails.
+ The idea is to use such virtual filesystems in /etc/fstab.
+
+config BUSYBOX_FEATURE_MOUNT_LABEL
+ bool "Support specifiying devices by label or UUID"
+ default y
+ depends on BUSYBOX_MOUNT
+ select BUSYBOX_VOLUMEID
+ help
+ This allows for specifying a device by label or uuid, rather than by
+ name. This feature utilizes the same functionality as blkid/findfs.
+
+config BUSYBOX_FEATURE_MOUNT_NFS
+ bool "Support mounting NFS file systems"
+ default n
+ depends on BUSYBOX_MOUNT
+ select BUSYBOX_FEATURE_HAVE_RPC
+ select BUSYBOX_FEATURE_SYSLOG
+ help
+ Enable mounting of NFS file systems.
+
+config BUSYBOX_FEATURE_MOUNT_CIFS
+ bool "Support mounting CIFS/SMB file systems"
+ default n
+ depends on BUSYBOX_MOUNT
+ help
+ Enable support for samba mounts.
+
+config BUSYBOX_FEATURE_MOUNT_FLAGS
+ depends on BUSYBOX_MOUNT
+ bool "Support lots of -o flags in mount"
+ default y
+ help
+ Without this, mount only supports ro/rw/remount. With this, it
+ supports nosuid, suid, dev, nodev, exec, noexec, sync, async, atime,
+ noatime, diratime, nodiratime, loud, bind, move, shared, slave,
+ private, unbindable, rshared, rslave, rprivate, and runbindable.
+
+config BUSYBOX_FEATURE_MOUNT_FSTAB
+ depends on BUSYBOX_MOUNT
+ bool "Support /etc/fstab and -a"
+ default y
+ help
+ Support mount all and looking for files in /etc/fstab.
+
+config BUSYBOX_PIVOT_ROOT
+ bool "pivot_root"
+ default n
+ help
+ The pivot_root utility swaps the mount points for the root filesystem
+ with some other mounted filesystem. This allows you to do all sorts
+ of wild and crazy things with your Linux system and is far more
+ powerful than 'chroot'.
+
+ Note: This is for initrd in linux 2.4. Under initramfs (introduced
+ in linux 2.6) use switch_root instead.
+
+config BUSYBOX_RDATE
+ bool "rdate"
+ default y
+ help
+ The rdate utility allows you to synchronize the date and time of your
+ system clock with the date and time of a remote networked system using
+ the RFC868 protocol, which is built into the inetd daemon on most
+ systems.
+
+config BUSYBOX_RDEV
+ bool "rdev"
+ default n
+ help
+ Print the device node associated with the filesystem mounted at '/'.
+
+config BUSYBOX_READPROFILE
+ bool "readprofile"
+ default n
+ help
+ This allows you to parse /proc/profile for basic profiling.
+
+config BUSYBOX_RTCWAKE
+ bool "rtcwake"
+ default n
+ help
+ Enter a system sleep state until specified wakeup time.
+
+config BUSYBOX_SCRIPT
+ bool "script"
+ default n
+ help
+ The script makes typescript of terminal session.
+
+config BUSYBOX_SETARCH
+ bool "setarch"
+ default n
+ help
+ The linux32 utility is used to create a 32bit environment for the
+ specified program (usually a shell). It only makes sense to have
+ this util on a system that supports both 64bit and 32bit userland
+ (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...).
+
+config BUSYBOX_SWAPONOFF
+ bool "swaponoff"
+ default n
+ help
+ This option enables both the 'swapon' and the 'swapoff' utilities.
+ Once you have created some swap space using 'mkswap', you also need
+ to enable your swap space with the 'swapon' utility. The 'swapoff'
+ utility is used, typically at system shutdown, to disable any swap
+ space. If you are not using any swap space, you can leave this
+ option disabled.
+
+config BUSYBOX_FEATURE_SWAPON_PRI
+ bool "Support priority option -p"
+ default n
+ depends on BUSYBOX_SWAPONOFF
+ help
+ Enable support for setting swap device priority in swapon.
+
+config BUSYBOX_SWITCH_ROOT
+ bool "switch_root"
+ default n
+ help
+ The switch_root utility is used from initramfs to select a new
+ root device. Under initramfs, you have to use this instead of
+ pivot_root. (Stop reading here if you don't care why.)
+
+ Booting with initramfs extracts a gzipped cpio archive into rootfs
+ (which is a variant of ramfs/tmpfs). Because rootfs can't be moved
+ or unmounted*, pivot_root will not work from initramfs. Instead,
+ switch_root deletes everything out of rootfs (including itself),
+ does a mount --move that overmounts rootfs with the new root, and
+ then execs the specified init program.
+
+ * Because the Linux kernel uses rootfs internally as the starting
+ and ending point for searching through the kernel's doubly linked
+ list of active mount points. That's why.
+
+config BUSYBOX_UMOUNT
+ bool "umount"
+ default y
+ help
+ When you want to remove a mounted filesystem from its current mount
+ point, for example when you are shutting down the system, the
+ 'umount' utility is the tool to use. If you enabled the 'mount'
+ utility, you almost certainly also want to enable 'umount'.
+
+config BUSYBOX_FEATURE_UMOUNT_ALL
+ bool "Support option -a"
+ default n
+ depends on BUSYBOX_UMOUNT
+ help
+ Support -a option to unmount all currently mounted filesystems.
+
+comment "Common options for mount/umount"
+ depends on BUSYBOX_MOUNT || BUSYBOX_UMOUNT
+
+config BUSYBOX_FEATURE_MOUNT_LOOP
+ bool "Support loopback mounts"
+ default y
+ depends on BUSYBOX_MOUNT || BUSYBOX_UMOUNT
+ help
+ Enabling this feature allows automatic mounting of files (containing
+ filesystem images) via the linux kernel's loopback devices.
+ The mount command will detect you are trying to mount a file instead
+ of a block device, and transparently associate the file with a
+ loopback device. The umount command will also free that loopback
+ device.
+
+ You can still use the 'losetup' utility (to manually associate files
+ with loop devices) if you need to do something advanced, such as
+ specify an offset or cryptographic options to the loopback device.
+ (If you don't want umount to free the loop device, use "umount -D".)
+
+config BUSYBOX_FEATURE_MTAB_SUPPORT
+ bool "Support for the old /etc/mtab file"
+ default n
+ depends on BUSYBOX_MOUNT || BUSYBOX_UMOUNT
+ select BUSYBOX_FEATURE_MOUNT_FAKE
+ help
+ Historically, Unix systems kept track of the currently mounted
+ partitions in the file "/etc/mtab". These days, the kernel exports
+ the list of currently mounted partitions in "/proc/mounts", rendering
+ the old mtab file obsolete. (In modern systems, /etc/mtab should be
+ a symlink to /proc/mounts.)
+
+ The only reason to have mount maintain an /etc/mtab file itself is if
+ your stripped-down embedded system does not have a /proc directory.
+ If you must use this, keep in mind it's inherently brittle (for
+ example a mount under chroot won't update it), can't handle modern
+ features like separate per-process filesystem namespaces, requires
+ that your /etc directory be writeable, tends to get easily confused
+ by --bind or --move mounts, won't update if you rename a directory
+ that contains a mount point, and so on. (In brief: avoid.)
+
+ About the only reason to use this is if you've removed /proc from
+ your kernel.
+
+endmenu
diff --git a/package/busybox/files/bridge.pre-up b/package/busybox/files/bridge.pre-up
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/package/busybox/files/bridge.pre-up
diff --git a/package/busybox/files/busybox.config b/package/busybox/files/busybox.config
new file mode 100644
index 000000000..55be09532
--- /dev/null
+++ b/package/busybox/files/busybox.config
@@ -0,0 +1,665 @@
+# Busybox version: 1.4.2
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+CONFIG_NITPICK=y
+# CONFIG_DESKTOP is not set
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_SHOW_USAGE=y
+CONFIG_FEATURE_VERBOSE_USAGE=y
+# CONFIG_FEATURE_COMPRESS_USAGE is not set
+# CONFIG_FEATURE_INSTALLER is not set
+# CONFIG_LOCALE_SUPPORT is not set
+CONFIG_GETOPT_LONG=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+CONFIG_FEATURE_SUID=y
+CONFIG_FEATURE_SYSLOG=y
+# CONFIG_FEATURE_SUID_CONFIG is not set
+# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
+CONFIG_FEATURE_HAVE_RPC=y
+# CONFIG_SELINUX is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_FULL_LIBBUSYBOX is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+# CONFIG_BUILD_AT_ONCE is not set
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_NO_DEBUG_LIB is not set
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+CONFIG_INCLUDE_SUSv2=y
+
+#
+# Installation Options
+#
+# CONFIG_INSTALL_NO_USR is not set
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+CONFIG_PREFIX="@IDIR@"
+
+#
+# Busybox Library Tuning
+#
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SIZE_VS_SPEED=1
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# CONFIG_AR is not set
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_BUNZIP2 is not set
+# CONFIG_CPIO is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+CONFIG_GUNZIP=y
+CONFIG_FEATURE_GUNZIP_UNCOMPRESS=y
+CONFIG_GZIP=y
+CONFIG_IPKG=y
+# CONFIG_RPM2CPIO is not set
+# CONFIG_RPM is not set
+CONFIG_TAR=y
+CONFIG_FEATURE_TAR_CREATE=y
+# CONFIG_FEATURE_TAR_BZIP2 is not set
+# CONFIG_FEATURE_TAR_LZMA is not set
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_GZIP=y
+# CONFIG_FEATURE_TAR_COMPRESS is not set
+# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_UNZIP is not set
+
+#
+# Common options for cpio and tar
+#
+# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
+# CONFIG_FEATURE_DEB_TAR_GZ is not set
+# CONFIG_FEATURE_DEB_TAR_BZ2 is not set
+# CONFIG_FEATURE_DEB_TAR_LZMA is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+# CONFIG_CAL is not set
+CONFIG_CAT=y
+# CONFIG_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+CONFIG_CHROOT=y
+CONFIG_CKSUM=y
+CONFIG_CMP=y
+CONFIG_COMM=y
+CONFIG_CP=y
+CONFIG_CUT=y
+CONFIG_DATE=y
+CONFIG_FEATURE_DATE_ISOFMT=y
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+CONFIG_FEATURE_DD_IBS_OBS=y
+CONFIG_DF=y
+# CONFIG_DIFF is not set
+# CONFIG_FEATURE_DIFF_BINARY is not set
+# CONFIG_FEATURE_DIFF_DIR is not set
+# CONFIG_FEATURE_DIFF_MINIMAL is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+# CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+# CONFIG_EXPR_MATH_SUPPORT_64 is not set
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+CONFIG_HEAD=y
+CONFIG_FEATURE_FANCY_HEAD=y
+CONFIG_HOSTID=y
+CONFIG_ID=y
+CONFIG_INSTALL=y
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+CONFIG_LENGTH=y
+CONFIG_LN=y
+# CONFIG_LOGNAME is not set
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+CONFIG_MKDIR=y
+# CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+CONFIG_NOHUP=y
+# CONFIG_OD is not set
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+# CONFIG_REALPATH is not set
+CONFIG_RM=y
+CONFIG_RMDIR=y
+CONFIG_SEQ=y
+# CONFIG_SHA1SUM is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
+CONFIG_TEST=y
+# CONFIG_FEATURE_TEST_64 is not set
+CONFIG_TOUCH=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+CONFIG_TRUE=y
+# CONFIG_TTY is not set
+CONFIG_UNAME=y
+CONFIG_UNIQ=y
+# CONFIG_USLEEP is not set
+# CONFIG_UUDECODE is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WATCH=y
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+CONFIG_WHO=y
+# CONFIG_WHOAMI is not set
+CONFIG_YES=y
+
+#
+# Common options for cp and mv
+#
+CONFIG_FEATURE_PRESERVE_HARDLINKS=y
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+# CONFIG_CHVT is not set
+CONFIG_CLEAR=y
+# CONFIG_DEALLOCVT is not set
+# CONFIG_DUMPKMAP is not set
+# CONFIG_LOADFONT is not set
+# CONFIG_LOADKMAP is not set
+# CONFIG_OPENVT is not set
+CONFIG_RESET=y
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+# CONFIG_SETCONSOLE is not set
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+
+#
+# Debian Utilities
+#
+CONFIG_MKTEMP=y
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_RUN_PARTS=y
+# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+# CONFIG_START_STOP_DAEMON is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+CONFIG_AWK=y
+CONFIG_FEATURE_AWK_MATH=y
+CONFIG_ED=y
+# CONFIG_PATCH is not set
+CONFIG_SED=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+CONFIG_FEATURE_VI_DOT_CMD=y
+CONFIG_FEATURE_VI_READONLY=y
+CONFIG_FEATURE_VI_SETOPTS=y
+CONFIG_FEATURE_VI_SET=y
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
+CONFIG_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_NEWER=y
+CONFIG_FEATURE_FIND_INUM=y
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+CONFIG_FEATURE_GREP_FGREP_ALIAS=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
+CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
+CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
+CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
+
+#
+# Init Utilities
+#
+CONFIG_INIT=y
+# CONFIG_DEBUG_INIT is not set
+CONFIG_FEATURE_USE_INITTAB=y
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_EXTRA_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_FEATURE_INITRD is not set
+CONFIG_HALT=y
+CONFIG_MESG=y
+
+#
+# Login/Password Management Utilities
+#
+CONFIG_FEATURE_SHADOWPASSWDS=y
+CONFIG_USE_BB_SHADOW=y
+CONFIG_USE_BB_PWD_GRP=y
+# CONFIG_ADDGROUP is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_DELUSER is not set
+# CONFIG_GETTY is not set
+CONFIG_FEATURE_UTMP=y
+# CONFIG_FEATURE_WTMP is not set
+# CONFIG_LOGIN is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_SECURETTY is not set
+CONFIG_PASSWD=y
+CONFIG_FEATURE_PASSWD_WEAK_CHECK=y
+CONFIG_SU=y
+CONFIG_FEATURE_SU_SYSLOG=y
+CONFIG_FEATURE_SU_CHECKS_SHELLS=y
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+# CONFIG_CHATTR is not set
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+
+#
+# Linux Module Utilities
+#
+CONFIG_INSMOD=y
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_RMMOD=y
+CONFIG_LSMOD=y
+CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
+CONFIG_MODPROBE=y
+# CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS is not set
+# CONFIG_FEATURE_MODPROBE_FANCY_ALIAS is not set
+
+#
+# Options common to multiple modutils
+#
+# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set
+# CONFIG_FEATURE_2_4_MODULES is not set
+CONFIG_FEATURE_2_6_MODULES=y
+# CONFIG_FEATURE_QUERY_MODULE_INTERFACE is not set
+
+#
+# Linux System Utilities
+#
+CONFIG_DMESG=y
+CONFIG_FEATURE_DMESG_PRETTY=y
+# CONFIG_FBSET is not set
+# CONFIG_FEATURE_FBSET_FANCY is not set
+# CONFIG_FEATURE_FBSET_READMODE is not set
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_GETOPT is not set
+CONFIG_HEXDUMP=y
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
+CONFIG_IPCRM=y
+CONFIG_IPCS=y
+CONFIG_LOSETUP=y
+CONFIG_MDEV=y
+CONFIG_FEATURE_MDEV_CONF=y
+CONFIG_FEATURE_MDEV_EXEC=y
+CONFIG_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_V0 is not set
+CONFIG_MORE=y
+CONFIG_FEATURE_USE_TERMIOS=y
+CONFIG_MOUNT=y
+CONFIG_FEATURE_MOUNT_NFS=y
+CONFIG_FEATURE_MOUNT_CIFS=y
+CONFIG_FEATURE_MOUNT_FLAGS=y
+CONFIG_FEATURE_MOUNT_FSTAB=y
+CONFIG_PIVOT_ROOT=y
+# CONFIG_RDATE is not set
+# CONFIG_READPROFILE is not set
+# CONFIG_SETARCH is not set
+CONFIG_SWAPONOFF=y
+CONFIG_SWITCH_ROOT=y
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+CONFIG_CROND=y
+# CONFIG_DEBUG_CROND_OPTION is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_CRONTAB=y
+# CONFIG_DC is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_EJECT is not set
+# CONFIG_LAST is not set
+# CONFIG_LESS is not set
+# CONFIG_FEATURE_LESS_MAXLINES is not set
+# CONFIG_FEATURE_LESS_BRACKETS is not set
+# CONFIG_FEATURE_LESS_FLAGS is not set
+# CONFIG_FEATURE_LESS_FLAGCS is not set
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_NMETER is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RUNLEVEL is not set
+CONFIG_RX=y
+CONFIG_STRINGS=y
+# CONFIG_SETSID is not set
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_TIME is not set
+CONFIG_WATCHDOG=y
+
+#
+# Networking Utilities
+#
+CONFIG_FEATURE_IPV6=y
+CONFIG_ARP=y
+CONFIG_ARPING=y
+# CONFIG_DNSD is not set
+CONFIG_ETHER_WAKE=y
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
+CONFIG_IFUPDOWN=y
+CONFIG_FEATURE_IFUPDOWN_IP=y
+CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
+# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+# CONFIG_FEATURE_IFUPDOWN_IPX is not set
+# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set
+CONFIG_INETD=y
+CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO=y
+CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD=y
+CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME=y
+CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME=y
+CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN=y
+CONFIG_FEATURE_INETD_RPC=y
+CONFIG_IP=y
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_TUNNEL=y
+CONFIG_FEATURE_IP_RULE=y
+# CONFIG_FEATURE_IP_SHORT_FORMS is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_NAMEIF is not set
+CONFIG_NC=y
+CONFIG_NC_SERVER=y
+CONFIG_NC_EXTRA=y
+CONFIG_NETSTAT=y
+CONFIG_NSLOOKUP=y
+CONFIG_PING=y
+CONFIG_FEATURE_FANCY_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING6=y
+CONFIG_ROUTE=y
+CONFIG_TELNET=y
+CONFIG_FEATURE_TELNET_TTYPE=y
+# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set
+CONFIG_TELNETD=y
+CONFIG_FEATURE_TELNETD_STANDALONE=y
+CONFIG_TFTP=y
+CONFIG_FEATURE_TFTP_GET=y
+CONFIG_FEATURE_TFTP_PUT=y
+CONFIG_FEATURE_TFTP_BLOCKSIZE=y
+CONFIG_DEBUG_TFTP=y
+CONFIG_TRACEROUTE=y
+CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
+CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE=y
+CONFIG_FEATURE_TRACEROUTE_USE_ICMP=y
+# CONFIG_APP_UDHCPD is not set
+# CONFIG_APP_DHCPRELAY is not set
+# CONFIG_APP_DUMPLEASES is not set
+CONFIG_APP_UDHCPC=y
+# CONFIG_FEATURE_UDHCP_SYSLOG is not set
+# CONFIG_FEATURE_UDHCP_DEBUG is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_IP6_LITERAL=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+# CONFIG_ZCIP is not set
+
+#
+# Process Utilities
+#
+CONFIG_FREE=y
+CONFIG_FUSER=y
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+CONFIG_KILLALL5=y
+CONFIG_PIDOF=y
+CONFIG_FEATURE_PIDOF_SINGLE=y
+CONFIG_FEATURE_PIDOF_OMIT=y
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_RENICE=y
+CONFIG_BB_SYSCTL=y
+CONFIG_TOP=y
+CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+CONFIG_UPTIME=y
+
+#
+# Shells
+#
+# CONFIG_FEATURE_SH_IS_ASH is not set
+# CONFIG_FEATURE_SH_IS_HUSH is not set
+# CONFIG_FEATURE_SH_IS_LASH is not set
+# CONFIG_FEATURE_SH_IS_MSH is not set
+CONFIG_FEATURE_SH_IS_NONE=y
+# CONFIG_ASH is not set
+# CONFIG_ASH_JOB_CONTROL is not set
+# CONFIG_ASH_READ_NCHARS is not set
+# CONFIG_ASH_READ_TIMEOUT is not set
+# CONFIG_ASH_ALIAS is not set
+# CONFIG_ASH_MATH_SUPPORT is not set
+# CONFIG_ASH_MATH_SUPPORT_64 is not set
+# CONFIG_ASH_GETOPTS is not set
+# CONFIG_ASH_BUILTIN_ECHO is not set
+# CONFIG_ASH_BUILTIN_TEST is not set
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_ASH_MAIL is not set
+# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+# CONFIG_ASH_EXPAND_PRMT is not set
+# CONFIG_HUSH is not set
+# CONFIG_LASH is not set
+# CONFIG_MSH is not set
+# CONFIG_FEATURE_SH_EXTRA_QUIET is not set
+# CONFIG_FEATURE_SH_STANDALONE_SHELL is not set
+# CONFIG_FEATURE_COMMAND_EDITING is not set
+# CONFIG_FEATURE_COMMAND_EDITING_VI is not set
+# CONFIG_FEATURE_COMMAND_HISTORY is not set
+# CONFIG_FEATURE_COMMAND_SAVEHISTORY is not set
+# CONFIG_FEATURE_COMMAND_TAB_COMPLETION is not set
+# CONFIG_FEATURE_COMMAND_USERNAME_COMPLETION is not set
+# CONFIG_FEATURE_SH_FANCY_PROMPT is not set
+
+#
+# System Logging Utilities
+#
+CONFIG_SYSLOGD=y
+CONFIG_FEATURE_ROTATE_LOGFILE=y
+CONFIG_FEATURE_REMOTE_LOG=y
+CONFIG_FEATURE_IPC_SYSLOG=y
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_KLOGD=y
+CONFIG_LOGGER=y
+
+#
+# Runit Utilities
+#
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_SV is not set
+# CONFIG_SVLOGD is not set
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
diff --git a/package/busybox/files/crond.init b/package/busybox/files/crond.init
new file mode 100644
index 000000000..c0b9da9e4
--- /dev/null
+++ b/package/busybox/files/crond.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${crond:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p /var/spool/cron
+ crond -c /etc/crontabs
+ ;;
+stop)
+ kill $(pidof crond|cut -d ' ' -f 3)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/busybox/files/inetd.init b/package/busybox/files/inetd.init
new file mode 100644
index 000000000..ad0527e6a
--- /dev/null
+++ b/package/busybox/files/inetd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 41
+. /etc/rc.conf
+case $1 in
+autostart)
+ test x"$inetd" = x"NO" && exit 0
+ test -e /etc/inetd.conf || exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/inetd
+ ;;
+autostop)
+ ;;
+stop)
+ killall inetd
+ ;;
+restart)
+ sh $0 stop
+ exec sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/busybox/files/ipv6 b/package/busybox/files/ipv6
new file mode 100644
index 000000000..837106519
--- /dev/null
+++ b/package/busybox/files/ipv6
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+ipv6_up() {
+ env | grep -q IF_IPV6_ || return 0
+
+ # IPV6-FLUSH
+ if [ "$IF_IPV6_FLUSH" == "1" ] || [ "$IF_IPV6_FLUSH" == "yes" ] || [ "$IF_IPV6_FLUSH" == "YES" ]
+ then
+ ip -6 addr flush $IFACE
+ logger -t IPv6 "deactivated IPv6 for interface $IFACE"
+ fi
+ # IPV6-AUTOCONF
+ if [ "$IF_IPV6_AUTOCONF" == "1" ] || [ "$IF_IPV6_AUTOCONF" == "yes" ] || [ "$IF_IPV6_AUTOCONF" == "YES" ]
+ then
+ echo 1 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
+ logger -t IPv6 "autoconf enabled for $IFACE"
+ fi
+ if [ "$IF_IPV6_AUTOCONF" == "0" ] || [ "$IF_IPV6_AUTOCONF" == "no" ] || [ "$IF_IPV6_AUTOCONF" == "NO" ]
+ then
+ echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
+ logger -t IPv6 "autoconf disabled for $IFACE"
+ fi
+ # IPV6-ACCEPT-RA
+ if [ "$IF_IPV6_ACCEPT_RA" == "1" ] || [ "$IF_IPV6_ACCEPT_RA" == "yes" ] || [ "$IF_IPV6_ACCEPT_RA" == "YES" ]
+ then
+
+ echo 1 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
+ logger -t IPv6 "accept-ra enabled for $IFACE"
+ fi
+ if [ "$IF_IPV6_ACCEPT_RA" == "0" ] || [ "$IF_IPV6_ACCEPT_RA" == "no" ] || [ "$IF_IPV6_ACCEPT_RA" == "NO" ]
+ then
+ echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
+ logger -t IPv6 "accept-ra disabled for $IFACE"
+ fi
+ # IPV6-ACCEPT-REDIRECTS
+ if [ "$IF_IPV6_ACCEPT_REDIRECTS" == "1" ] || [ "$IF_IPV6_ACCEPT_REDIRECTS" == "yes" ] || [ "$IF_IPV6_ACCEPT_REDIRECTS" == "YES" ]
+ then
+
+ echo 1 > /proc/sys/net/ipv6/conf/$IFACE/accept_redirects
+ logger -t IPv6 "accept-redirects enabled for $IFACE"
+ fi
+ if [ "$IF_IPV6_ACCEPT_REDIRECTS" == "0" ] || [ "$IF_IPV6_ACCEPT_REDIRECTS" == "no" ] || [ "$IF_IPV6_ACCEPT_REDIRECTS" == "NO" ]
+ then
+ echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_redirects
+ logger -t IPv6 "accept-redirects disabled for $IFACE"
+ fi
+ # IPV6-FORWARDING
+ if [ "$IF_IPV6_FORWARDING" == "1" ] || [ "$IF_IPV6_FORWARDING" == "yes" ] || [ "$IF_IPV6_FORWARDING" == "YES" ]
+ then
+
+ echo 1 > /proc/sys/net/ipv6/conf/$IFACE/forwarding
+ logger -t IPv6 "forwarding enabled for $IFACE"
+ fi
+ if [ "$IF_IPV6_FORWARDING" == "0" ] || [ "$IF_IPV6_FORWARDING" == "no" ] || [ "$IF_IPV6_FORWARDING" == "NO" ]
+ then
+ echo 0 > /proc/sys/net/ipv6/conf/$IFACE/forwarding
+ logger -t IPv6 "forwarding disabled for $IFACE"
+ fi
+ # IPV6-USE-TEMPADDR
+ if [ "$IF_IPV6_USE_TEMPADDR" == "1" ] || [ "$IF_IPV6_USE_TEMPADDR" == "yes" ] || [ "$IF_IPV6_USE_TEMPADDR" == "YES" ]
+ then
+
+ echo 1 > /proc/sys/net/ipv6/conf/$IFACE/use_tempaddr
+ logger -t IPv6 "use_tempaddr enabled for $IFACE"
+ fi
+ if [ "$IF_IPV6_USE_TEMPADDR" == "0" ] || [ "$IF_IPV6_USE_TEMPADDR" == "no" ] || [ "$IF_IPV6_USE_TEMPADDR" == "NO" ]
+ then
+ echo 0 > /proc/sys/net/ipv6/conf/$IFACE/use_tempaddr
+ logger -t IPv6 "use_tempaddr disabled for $IFACE"
+ fi
+}
diff --git a/package/busybox/files/ipv6.up b/package/busybox/files/ipv6.up
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/package/busybox/files/ipv6.up
diff --git a/package/busybox/files/network.init b/package/busybox/files/network.init
new file mode 100644
index 000000000..0f3d4edad
--- /dev/null
+++ b/package/busybox/files/network.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 40
+. /etc/rc.conf
+case $1 in
+autostart)
+ test x"${network:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/network/interfaces ] || exit 1
+ ifup -a
+ ;;
+autostop|stop)
+ ifdown -a
+ ;;
+restart)
+ sh $0 stop
+ exec sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/busybox/files/syslog.init b/package/busybox/files/syslog.init
new file mode 100644
index 000000000..e06283480
--- /dev/null
+++ b/package/busybox/files/syslog.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#FWINIT 05
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $syslogd_flags = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ syslogd $syslogd_flags
+ klogd
+ ;;
+stop)
+ killall klogd
+ killall syslogd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/busybox/files/vlan.pre-up b/package/busybox/files/vlan.pre-up
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/package/busybox/files/vlan.pre-up
diff --git a/package/busybox/ipkg/busybox.control b/package/busybox/ipkg/busybox.control
new file mode 100644
index 000000000..e7fc84a29
--- /dev/null
+++ b/package/busybox/ipkg/busybox.control
@@ -0,0 +1,4 @@
+Package: busybox
+Priority: optional
+Section: net
+Description: Core utilities for embedded Linux systems
diff --git a/package/busybox/ipkg/busybox.postinst b/package/busybox/ipkg/busybox.postinst
new file mode 100644
index 000000000..97e83b766
--- /dev/null
+++ b/package/busybox/ipkg/busybox.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf network network YES
+add_rcconf crond crond NO
+add_rcconf 'use "-C16" normally, "NO" to disable' syslogd_flags '-C16'
+add_rcconf inetd
diff --git a/package/busybox/patches/001-ipkg.patch b/package/busybox/patches/001-ipkg.patch
new file mode 100644
index 000000000..1d10696c6
--- /dev/null
+++ b/package/busybox/patches/001-ipkg.patch
@@ -0,0 +1,13797 @@
+diff -Nur busybox-1.12.1.orig/archival/Config.in busybox-1.12.1/archival/Config.in
+--- busybox-1.12.1.orig/archival/Config.in 2008-09-28 20:04:15.000000000 +0200
++++ busybox-1.12.1/archival/Config.in 2008-10-23 11:41:37.000000000 +0200
+@@ -157,6 +157,14 @@
+ gzip is used to compress files.
+ It's probably the most widely used UNIX compression program.
+
++config IPKG
++ bool "ipkg"
++ default n
++ select MD5SUM
++ select WGET
++ help
++ ipkg is the itsy package management system.
++
+ config RPM2CPIO
+ bool "rpm2cpio"
+ default n
+diff -Nur busybox-1.12.1.orig/archival/dpkg.c busybox-1.12.1/archival/dpkg.c
+--- busybox-1.12.1.orig/archival/dpkg.c 2008-09-28 20:04:15.000000000 +0200
++++ busybox-1.12.1/archival/dpkg.c 2008-10-23 11:53:33.000000000 +0200
+@@ -1481,16 +1481,7 @@
+ return ar_handle->sub_archive->buffer;
+ }
+
+-static void FAST_FUNC data_extract_all_prefix(archive_handle_t *archive_handle)
+-{
+- char *name_ptr = archive_handle->file_header->name;
+-
+- name_ptr += strspn(name_ptr, "./");
+- if (name_ptr[0] != '\0') {
+- archive_handle->file_header->name = xasprintf("%s%s", archive_handle->buffer, name_ptr);
+- data_extract_all(archive_handle);
+- }
+-}
++/* remove data_extract_all_prefix */
+
+ static void unpack_package(deb_file_t *deb_file)
+ {
+diff -Nur busybox-1.12.1.orig/archival/ipkg.c busybox-1.12.1/archival/ipkg.c
+--- busybox-1.12.1.orig/archival/ipkg.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/ipkg.c 2008-10-23 12:14:28.000000000 +0200
+@@ -0,0 +1,28 @@
++/* ipkg.c - the itsy package management system
++
++ Florina Boor
++
++ Copyright (C) 2003 kernel concepts
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ ipkg command line frontend using libipkg
++
++*/
++
++#include "libbb.h"
++#include "libipkg/libipkg.h"
++
++int ipkg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
++int ipkg_main(int argc, char **argv)
++{
++ return ipkg_op(argc, argv);
++}
+diff -Nur busybox-1.12.1.orig/archival/Kbuild busybox-1.12.1/archival/Kbuild
+--- busybox-1.12.1.orig/archival/Kbuild 2008-09-28 20:04:15.000000000 +0200
++++ busybox-1.12.1/archival/Kbuild 2008-10-23 11:41:37.000000000 +0200
+@@ -16,6 +16,7 @@
+ lib-$(CONFIG_DPKG_DEB) += dpkg_deb.o
+ lib-$(CONFIG_GUNZIP) += bbunzip.o
+ lib-$(CONFIG_GZIP) += gzip.o bbunzip.o
++lib-$(CONFIG_IPKG) += ipkg.o
+ lib-$(CONFIG_RPM2CPIO) += rpm2cpio.o
+ lib-$(CONFIG_RPM) += rpm.o
+ lib-$(CONFIG_TAR) += tar.o
+diff -Nur busybox-1.12.1.orig/archival/libipkg/args.c busybox-1.12.1/archival/libipkg/args.c
+--- busybox-1.12.1.orig/archival/libipkg/args.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/args.c 2008-10-23 15:00:11.000000000 +0200
+@@ -0,0 +1,242 @@
++/* args.c - parse command-line args
++
++ Carl D. Worth
++
++ Copyright 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++ */
++
++#include <getopt.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
++#include "ipkg.h"
++#include "ipkg_message.h"
++
++#include "args.h"
++#include "sprintf_alloc.h"
++
++#include "libbb.h"
++
++
++static void print_version(void);
++
++enum long_args_opt
++{
++ ARGS_OPT_FORCE_DEFAULTS = 129,
++ ARGS_OPT_FORCE_DEPENDS,
++ ARGS_OPT_FORCE_OVERWRITE,
++ ARGS_OPT_FORCE_DOWNGRADE,
++ ARGS_OPT_FORCE_REINSTALL,
++ ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES,
++ ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES,
++ ARGS_OPT_FORCE_SPACE,
++ ARGS_OPT_NOACTION,
++ ARGS_OPT_NODEPS,
++ ARGS_OPT_VERBOSE_WGET,
++ ARGS_OPT_VERBOSITY,
++ ARGS_OPT_MULTIPLE_PROVIDERS
++};
++
++int args_init(args_t *args)
++{
++ const char *conf_file_dir;
++
++ memset(args, 0, sizeof(args_t));
++
++ args->dest = ARGS_DEFAULT_DEST;
++
++ conf_file_dir = getenv("IPKG_CONF_DIR");
++ if (conf_file_dir == NULL || conf_file_dir[0] == '\0') {
++ conf_file_dir = ARGS_DEFAULT_CONF_FILE_DIR;
++ }
++ sprintf_alloc(&args->conf_file, "%s/%s", conf_file_dir,
++ ARGS_DEFAULT_CONF_FILE_NAME);
++
++ args->force_defaults = ARGS_DEFAULT_FORCE_DEFAULTS;
++ args->force_depends = ARGS_DEFAULT_FORCE_DEPENDS;
++ args->force_overwrite = ARGS_DEFAULT_FORCE_OVERWRITE;
++ args->force_downgrade = ARGS_DEFAULT_FORCE_DOWNGRADE;
++ args->force_reinstall = ARGS_DEFAULT_FORCE_REINSTALL;
++ args->force_removal_of_dependent_packages = ARGS_DEFAULT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES;
++ args->force_removal_of_essential_packages = ARGS_DEFAULT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES;
++ args->noaction = ARGS_DEFAULT_NOACTION;
++ args->nodeps = ARGS_DEFAULT_NODEPS;
++ args->verbose_wget = ARGS_DEFAULT_VERBOSE_WGET;
++ args->verbosity = ARGS_DEFAULT_VERBOSITY;
++ args->offline_root = ARGS_DEFAULT_OFFLINE_ROOT;
++ args->offline_root_pre_script_cmd = ARGS_DEFAULT_OFFLINE_ROOT_PRE_SCRIPT_CMD;
++ args->offline_root_post_script_cmd = ARGS_DEFAULT_OFFLINE_ROOT_POST_SCRIPT_CMD;
++ args->multiple_providers = 0;
++ args->nocheckfordirorfile = 0;
++ args->noreadfeedsfile = 0;
++
++ return 1;
++}
++
++void args_deinit(args_t *args)
++{
++ free(args->conf_file);
++ args->conf_file = NULL;
++}
++
++int args_parse(args_t *args, int argc, char *argv[])
++{
++ int c;
++ int option_index = 0;
++ int parse_err = 0;
++ static struct option long_options[] = {
++ {"query-all", 0, 0, 'A'},
++ {"conf-file", 1, 0, 'f'},
++ {"conf", 1, 0, 'f'},
++ {"dest", 1, 0, 'd'},
++ {"force-defaults", 0, 0, ARGS_OPT_FORCE_DEFAULTS},
++ {"force_defaults", 0, 0, ARGS_OPT_FORCE_DEFAULTS},
++ {"force-depends", 0, 0, ARGS_OPT_FORCE_DEPENDS},
++ {"force_depends", 0, 0, ARGS_OPT_FORCE_DEPENDS},
++ {"force-overwrite", 0, 0, ARGS_OPT_FORCE_OVERWRITE},
++ {"force_overwrite", 0, 0, ARGS_OPT_FORCE_OVERWRITE},
++ {"force_downgrade", 0, 0, ARGS_OPT_FORCE_DOWNGRADE},
++ {"force-downgrade", 0, 0, ARGS_OPT_FORCE_DOWNGRADE},
++ {"force-reinstall", 0, 0, ARGS_OPT_FORCE_REINSTALL},
++ {"force_reinstall", 0, 0, ARGS_OPT_FORCE_REINSTALL},
++ {"force-space", 0, 0, ARGS_OPT_FORCE_SPACE},
++ {"force_space", 0, 0, ARGS_OPT_FORCE_SPACE},
++ {"recursive", 0, 0,
++ ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES},
++ {"force-removal-of-dependent-packages", 0, 0,
++ ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES},
++ {"force_removal_of_dependent_packages", 0, 0,
++ ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES},
++ {"force-removal-of-essential-packages", 0, 0,
++ ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
++ {"force_removal_of_essential_packages", 0, 0,
++ ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
++ {"multiple-providers", 0, 0, ARGS_OPT_MULTIPLE_PROVIDERS},
++ {"multiple_providers", 0, 0, ARGS_OPT_MULTIPLE_PROVIDERS},
++ {"noaction", 0, 0, ARGS_OPT_NOACTION},
++ {"nodeps", 0, 0, ARGS_OPT_NODEPS},
++ {"offline", 1, 0, 'o'},
++ {"offline-root", 1, 0, 'o'},
++ {"test", 0, 0, ARGS_OPT_NOACTION},
++ {"tmp-dir", 1, 0, 't'},
++ {"verbose-wget", 0, 0, ARGS_OPT_VERBOSE_WGET},
++ {"verbose_wget", 0, 0, ARGS_OPT_VERBOSE_WGET},
++ {"verbosity", 2, 0, 'V'},
++ {"version", 0, 0, 'v'},
++ {0, 0, 0, 0}
++ };
++
++ while (1) {
++ c = getopt_long_only(argc, argv, "Ad:f:no:t:vV:", long_options, &option_index);
++ if (c == -1)
++ break;
++
++ switch (c) {
++ case 'A':
++ args->query_all = 1;
++ break;
++ case 'd':
++ args->dest = optarg;
++ break;
++ case 'f':
++ free(args->conf_file);
++ args->conf_file = strdup(optarg);
++ break;
++ case 'o':
++ args->offline_root = optarg;
++ break;
++ case 'n':
++ args->noaction = 1;
++ break;
++ case 't':
++ args->tmp_dir = strdup(optarg);
++ break;
++ case 'v':
++ print_version();
++ exit(0);
++ case 'V':
++ case ARGS_OPT_VERBOSITY:
++ if (optarg)
++ args->verbosity = atoi(optarg);
++ else
++ args->verbosity += 1;
++ break;
++ case ARGS_OPT_FORCE_DEFAULTS:
++ args->force_defaults = 1;
++ break;
++ case ARGS_OPT_FORCE_DEPENDS:
++ args->force_depends = 1;
++ break;
++ case ARGS_OPT_FORCE_OVERWRITE:
++ args->force_overwrite = 1;
++ break;
++ case ARGS_OPT_FORCE_DOWNGRADE:
++ args->force_downgrade = 1;
++ break;
++ case ARGS_OPT_FORCE_REINSTALL:
++ args->force_reinstall = 1;
++ break;
++ case ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES:
++ args->force_removal_of_essential_packages = 1;
++ break;
++ case ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES:
++ args->force_removal_of_dependent_packages = 1;
++ break;
++ case ARGS_OPT_FORCE_SPACE:
++ args->force_space = 1;
++ break;
++ case ARGS_OPT_VERBOSE_WGET:
++ args->verbose_wget = 1;
++ break;
++ case ARGS_OPT_MULTIPLE_PROVIDERS:
++ args->multiple_providers = 1;
++ break;
++ case ARGS_OPT_NODEPS:
++ args->nodeps = 1;
++ break;
++ case ARGS_OPT_NOACTION:
++ args->noaction = 1;
++ break;
++ case ':':
++ parse_err++;
++ break;
++ case '?':
++ parse_err++;
++ break;
++ default:
++ bb_error_msg("Confusion: getopt_long returned %d\n", c);
++ }
++ }
++
++ if (parse_err) {
++ return -parse_err;
++ } else {
++ return optind;
++ }
++}
++
++void args_usage(const char *complaint)
++{
++ if (complaint) {
++ bb_error_msg("%s\n", complaint);
++ }
++ print_version();
++ bb_show_usage();
++ exit(1);
++}
++
++static void print_version(void)
++{
++ bb_error_msg("version %s\n", IPKG_VERSION);
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/args.h busybox-1.12.1/archival/libipkg/args.h
+--- busybox-1.12.1.orig/archival/libipkg/args.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/args.h 2008-10-23 14:59:44.000000000 +0200
+@@ -0,0 +1,72 @@
++/* args.h - parse command-line args
++
++ Carl D. Worth
++
++ Copyright 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++*/
++
++#ifndef ARGS_H
++#define ARGS_H
++
++struct args
++{
++ char *conf_file;
++ char *dest;
++ char *tmp_dir;
++ int force_defaults;
++ int force_depends;
++ int force_overwrite;
++ int force_downgrade;
++ int force_reinstall;
++ int force_removal_of_essential_packages;
++ int force_removal_of_dependent_packages;
++ int force_space;
++ int noaction;
++ int nodeps;
++ int multiple_providers;
++ int query_all;
++ int verbose_wget;
++ int verbosity;
++ int nocheckfordirorfile;
++ int noreadfeedsfile;
++ char *offline_root;
++ char *offline_root_pre_script_cmd;
++ char *offline_root_post_script_cmd;
++};
++typedef struct args args_t;
++
++#define ARGS_DEFAULT_CONF_FILE_DIR "/etc"
++#define ARGS_DEFAULT_CONF_FILE_NAME "ipkg.conf"
++#define ARGS_DEFAULT_DEST NULL
++#define ARGS_DEFAULT_FORCE_DEFAULTS 0
++#define ARGS_DEFAULT_FORCE_DEPENDS 0
++#define ARGS_DEFAULT_FORCE_OVERWRITE 0
++#define ARGS_DEFAULT_FORCE_DOWNGRADE 0
++#define ARGS_DEFAULT_FORCE_REINSTALL 0
++#define ARGS_DEFAULT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES 0
++#define ARGS_DEFAULT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES 0
++#define ARGS_DEFAULT_FORCE_SPACE 0
++#define ARGS_DEFAULT_OFFLINE_ROOT NULL
++#define ARGS_DEFAULT_OFFLINE_ROOT_PRE_SCRIPT_CMD NULL
++#define ARGS_DEFAULT_OFFLINE_ROOT_POST_SCRIPT_CMD NULL
++#define ARGS_DEFAULT_NOACTION 0
++#define ARGS_DEFAULT_NODEPS 0
++#define ARGS_DEFAULT_VERBOSE_WGET 0
++#define ARGS_DEFAULT_VERBOSITY 1
++
++int args_init(args_t *args);
++void args_deinit(args_t *args);
++int args_parse(args_t *args, int argc, char *argv[]);
++void args_usage(const char *complaint);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/conffile.c busybox-1.12.1/archival/libipkg/conffile.c
+--- busybox-1.12.1.orig/archival/libipkg/conffile.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/conffile.c 2008-10-23 12:48:24.000000000 +0200
+@@ -0,0 +1,65 @@
++/* conffile.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include <string.h>
++#include <stdlib.h>
++
++#include "libbb.h"
++#include "ipkg.h"
++#include "ipkg_message.h"
++
++#include "conffile.h"
++#include "file_util.h"
++#include "sprintf_alloc.h"
++
++int conffile_init(conffile_t *conffile, const char *file_name, const uint8_t *md5sum)
++{
++ return nv_pair_init(conffile, file_name, (char *)md5sum);
++}
++
++void conffile_deinit(conffile_t *conffile)
++{
++ nv_pair_deinit(conffile);
++}
++
++int conffile_has_been_modified(ipkg_conf_t *conf, conffile_t *conffile)
++{
++ uint8_t *md5sum;
++ char *filename = conffile->name;
++ char *root_filename;
++ int ret;
++
++ if (conffile->value == NULL) {
++ ipkg_message(conf, IPKG_NOTICE, "%s: conffile %s has no md5sum\n", __FUNCTION__, conffile->name);
++ return 1;
++ }
++
++ root_filename = root_filename_alloc(conf, filename);
++
++ md5sum = file_md5sum_alloc(root_filename);
++
++ ret = strcmp((char *)md5sum, conffile->value);
++ if (ret) {
++ ipkg_message(conf, IPKG_NOTICE, "%s: conffile %s: \t\nold md5=%s \t\nnew md5=%s\n", __FUNCTION__,
++ conffile->name, md5sum, conffile->value);
++ }
++
++ free(root_filename);
++ free(md5sum);
++
++ return ret;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/conffile.h busybox-1.12.1/archival/libipkg/conffile.h
+--- busybox-1.12.1.orig/archival/libipkg/conffile.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/conffile.h 2008-10-23 12:40:12.000000000 +0200
+@@ -0,0 +1,30 @@
++/* conffile.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef CONFFILE_H
++#define CONFFILE_H
++
++#include "nv_pair.h"
++
++typedef struct nv_pair conffile_t;
++
++int conffile_init(conffile_t *conffile, const char *file_name, const uint8_t *md5sum);
++void conffile_deinit(conffile_t *conffile);
++int conffile_has_been_modified(struct ipkg_conf *conf, conffile_t *conffile);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/conffile_list.c busybox-1.12.1/archival/libipkg/conffile_list.c
+--- busybox-1.12.1.orig/archival/libipkg/conffile_list.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/conffile_list.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,47 @@
++/* conffile_list.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "conffile_list.h"
++
++int conffile_list_init(conffile_list_t *list)
++{
++ return nv_pair_list_init(list);
++}
++
++void conffile_list_deinit(conffile_list_t *list)
++{
++ nv_pair_list_deinit(list);
++}
++
++conffile_t *conffile_list_append(conffile_list_t *list, const char *file_name,
++ const char *md5sum)
++{
++ return nv_pair_list_append(list, file_name, md5sum);
++}
++
++int conffile_list_push(conffile_list_t *list, conffile_t *data)
++{
++ return nv_pair_list_push(list, data);
++}
++
++conffile_list_elt_t *conffile_list_pop(conffile_list_t *list)
++{
++ return nv_pair_list_pop(list);
++}
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/conffile_list.h busybox-1.12.1/archival/libipkg/conffile_list.h
+--- busybox-1.12.1.orig/archival/libipkg/conffile_list.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/conffile_list.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,36 @@
++/* conffile_list.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef CONFFILE_LIST_H
++#define CONFFILE_LIST_H
++
++#include "conffile.h"
++#include "nv_pair_list.h"
++
++typedef struct nv_pair_list_elt conffile_list_elt_t;
++typedef struct nv_pair_list conffile_list_t;
++
++int conffile_list_init(conffile_list_t *list);
++void conffile_list_deinit(conffile_list_t *list);
++
++conffile_t *conffile_list_append(conffile_list_t *list, const char *name,
++ const char *root_dir);
++int conffile_list_push(conffile_list_t *list, conffile_t *data);
++conffile_list_elt_t *conffile_list_pop(conffile_list_t *list);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/file_util.c busybox-1.12.1/archival/libipkg/file_util.c
+--- busybox-1.12.1.orig/archival/libipkg/file_util.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/file_util.c 2008-10-23 12:34:37.000000000 +0200
+@@ -0,0 +1,132 @@
++/* file_util.c - convenience routines for common stat operations
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <sys/types.h>
++#include <sys/stat.h>
++
++#include "sprintf_alloc.h"
++#include "file_util.h"
++#include "libbb.h"
++#undef strlen
++
++int file_exists(const char *file_name)
++{
++ int err;
++ struct stat stat_buf;
++
++ err = stat(file_name, &stat_buf);
++ if (err == 0) {
++ return 1;
++ } else {
++ return 0;
++ }
++}
++
++int file_is_dir(const char *file_name)
++{
++ int err;
++ struct stat stat_buf;
++
++ err = stat(file_name, &stat_buf);
++ if (err) {
++ return 0;
++ }
++
++ return S_ISDIR(stat_buf.st_mode);
++}
++
++/* read a single line from a file, stopping at a newline or EOF.
++ If a newline is read, it will appear in the resulting string.
++ Return value is a malloc'ed char * which should be freed at
++ some point by the caller.
++
++ Return value is NULL if the file is at EOF when called.
++*/
++#define FILE_READ_LINE_BUF_SIZE 1024
++char *file_read_line_alloc(FILE *file)
++{
++ char buf[FILE_READ_LINE_BUF_SIZE];
++ int buf_len;
++ char *line = NULL;
++ int line_size = 0;
++
++ memset(buf, 0, FILE_READ_LINE_BUF_SIZE);
++ while (fgets(buf, FILE_READ_LINE_BUF_SIZE, file)) {
++ buf_len = strlen(buf);
++ if (line) {
++ line_size += buf_len;
++ line = realloc(line, line_size);
++ if (line == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ break;
++ }
++ strcat(line, buf);
++ } else {
++ line_size = buf_len + 1;
++ line = strdup(buf);
++ }
++ if (buf[buf_len - 1] == '\n') {
++ break;
++ }
++ }
++
++ return line;
++}
++
++int file_move(const char *src, const char *dest)
++{
++ int err;
++
++ err = rename(src, dest);
++
++ if (err && errno == EXDEV) {
++ err = file_copy(src, dest);
++ unlink(src);
++ } else if (err) {
++ fprintf(stderr, "%s: ERROR: failed to rename %s to %s: %s\n",
++ __FUNCTION__, src, dest, strerror(errno));
++ }
++
++ return err;
++}
++
++/* I put these here to keep libbb dependencies from creeping all over
++ the ipkg code */
++int file_copy(const char *src, const char *dest)
++{
++ int err;
++
++ err = copy_file(src, dest, FILEUTILS_FORCE | FILEUTILS_PRESERVE_STATUS);
++ if (err) {
++ fprintf(stderr, "%s: ERROR: failed to copy %s to %s\n",
++ __FUNCTION__, src, dest);
++ }
++
++ return err;
++}
++
++int file_mkdir_hier(char *path, long mode)
++{
++ return bb_make_directory(path, mode, FILEUTILS_RECUR);
++}
++
++uint8_t *file_md5sum_alloc(const char *file_name)
++{
++ return hash_file(file_name, HASH_MD5);
++}
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/file_util.h busybox-1.12.1/archival/libipkg/file_util.h
+--- busybox-1.12.1.orig/archival/libipkg/file_util.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/file_util.h 2008-10-23 12:30:58.000000000 +0200
+@@ -0,0 +1,29 @@
++/* file_util.h - convenience routines for common file operations
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef FILE_UTIL_H
++#define FILE_UTIL_H
++
++int file_exists(const char *file_name);
++int file_is_dir(const char *file_name);
++char *file_read_line_alloc(FILE *file);
++int file_move(const char *src, const char *dest);
++int file_copy(const char *src, const char *dest);
++int file_mkdir_hier(char *path, long mode);
++uint8_t *file_md5sum_alloc(const char *file_name);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/hash_table.c busybox-1.12.1/archival/libipkg/hash_table.c
+--- busybox-1.12.1.orig/archival/libipkg/hash_table.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/hash_table.c 2008-10-23 16:12:57.000000000 +0200
+@@ -0,0 +1,155 @@
++/* hash.c - hash tables for ipkg
++
++ Steven M. Ayer, Jamey Hicks
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include <errno.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include "hash_table.h"
++#include "ipkg_message.h"
++
++
++static int hash_index(hash_table_t *hash, const char *pkg_name);
++static int rotating(const char *key, int len, int prime);
++
++static int hash_index(hash_table_t *hash, const char *pkg_name)
++{
++ return rotating(pkg_name, strlen(pkg_name), hash->n_entries);
++}
++
++static int rotating(const char *key, int len, int prime)
++{
++ unsigned int hash, i;
++ for (hash=len, i=0; i<len; ++i)
++ hash = (hash<<4)^(hash>>28)^key[i];
++ return (hash % prime);
++}
++
++
++/*
++ * this is an open table keyed by strings
++ */
++int hash_table_init(const char *name, hash_table_t *hash, int len)
++{
++ static int primes_table[] = {
++ 379, 761, 983, 1423, 2711, 3361, 3931, 4679, 5519, 6701, 9587,
++ 19471, 23143, 33961, 46499, 49727, 99529, 0
++ };
++ int *picker;
++
++ if (hash->entries != NULL) {
++ /* we have been here already */
++ return 0;
++ }
++
++ hash->name = name;
++ hash->entries = NULL;
++ hash->n_entries = 0;
++ hash->hash_entry_key = NULL;
++
++ picker = primes_table;
++ while(*picker && (*picker++ < len));
++ if(!*picker)
++ fprintf(stderr, "%s: primes table might not be big enough (! << %d)\n", __FUNCTION__, len);
++ --picker;
++
++ hash->n_entries = *picker;
++ hash->entries = (hash_entry_t *)calloc(hash->n_entries, sizeof(hash_entry_t));
++ if (hash->entries == NULL) {
++ fprintf(stderr, "%s: Out of memory.\n", __FUNCTION__);
++ return ENOMEM;
++ }
++ return 0;
++}
++
++void hash_table_deinit(hash_table_t *hash)
++{
++ free(hash->entries);
++ hash->entries = NULL;
++ hash->n_entries = 0;
++}
++
++void *hash_table_get(hash_table_t *hash, const char *key)
++{
++ int ndx= hash_index(hash, key);
++ hash_entry_t *hash_entry = hash->entries + ndx;
++ while (hash_entry)
++ {
++ if (hash_entry->key)
++ {
++ if (strcmp(key, hash_entry->key) == 0) {
++ // ipkg_message(NULL, IPKG_DEBUG, "Function: %s. Key found for '%s' \n", __FUNCTION__, key);
++ return hash_entry->data;
++ }
++ }
++ hash_entry = hash_entry->next;
++ }
++ return NULL;
++}
++
++int hash_table_insert(hash_table_t *hash, const char *key, void *value)
++{
++ int ndx= hash_index(hash, key);
++ hash_entry_t *hash_entry = hash->entries + ndx;
++ if (0) ipkg_message(NULL, IPKG_DEBUG2, "Function: %s. Inserting in hash for '%s' \n", __FUNCTION__, key);
++ if (hash_entry->key) {
++ if (strcmp(hash_entry->key, key) == 0) {
++ /* alread in table, update the value */
++ if (0) ipkg_message(NULL, IPKG_DEBUG2, "Function: %s. Value already in hash for '%s' \n", __FUNCTION__, key);
++ hash_entry->data = value;
++ return 0;
++ } else {
++ /*
++ * if this is a collision, we have to go to the end of the ll,
++ * then add a new entry
++ * before we can hook up the value
++ */
++ if (0) ipkg_message(NULL, IPKG_DEBUG2, "Function: %s. Value already in hash by collision for '%s' \n", __FUNCTION__, key);
++ while (hash_entry->next)
++ hash_entry = hash_entry->next;
++ hash_entry->next = (hash_entry_t *)malloc(sizeof(hash_entry_t));
++ if (!hash_entry->next) {
++ return -ENOMEM;
++ }
++ hash_entry = hash_entry->next;
++ hash_entry->next = NULL;
++ }
++ }
++ hash->n_elements++;
++ hash_entry->key = strdup(key);
++ hash_entry->data = value;
++
++ return 0;
++}
++
++
++void hash_table_foreach(hash_table_t *hash, void (*f)(const char *key, void *entry, void *data), void *data)
++{
++ int i;
++ if (!hash || !f)
++ return;
++
++ for (i = 0; i < hash->n_entries; i++) {
++ hash_entry_t *hash_entry = (hash->entries + i);
++ do {
++ if(hash_entry->key) {
++ f(hash_entry->key, hash_entry->data, data);
++ }
++ } while((hash_entry = hash_entry->next));
++ }
++}
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/hash_table.h busybox-1.12.1/archival/libipkg/hash_table.h
+--- busybox-1.12.1.orig/archival/libipkg/hash_table.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/hash_table.h 2008-10-23 16:13:18.000000000 +0200
+@@ -0,0 +1,44 @@
++/* hash.h - hash tables for ipkg
++
++ Steven M. Ayer, Jamey Hicks
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef _HASH_TABLE_H_
++#define _HASH_TABLE_H_
++
++typedef struct hash_entry hash_entry_t;
++typedef struct hash_table hash_table_t;
++
++struct hash_entry {
++ const char * key;
++ void * data;
++ struct hash_entry * next;
++};
++
++struct hash_table {
++ const char *name;
++ hash_entry_t * entries;
++ int n_entries; /* number of buckets */
++ int n_elements;
++ const char * (*hash_entry_key)(void * data);
++};
++
++int hash_table_init(const char *name, hash_table_t *hash, int len);
++void hash_table_deinit(hash_table_t *hash);
++void *hash_table_get(hash_table_t *hash, const char *key);
++int hash_table_insert(hash_table_t *hash, const char *key, void *value);
++void hash_table_foreach(hash_table_t *hash, void (*f)(const char *key, void *entry, void *data), void *data);
++
++#endif /* _HASH_TABLE_H_ */
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_cmd.c busybox-1.12.1/archival/libipkg/ipkg_cmd.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_cmd.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_cmd.c 2008-10-23 15:06:37.000000000 +0200
+@@ -0,0 +1,1433 @@
++/* ipkg_cmd.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include <string.h>
++
++#include "ipkg.h"
++#include <libgen.h>
++#include <glob.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <signal.h>
++#include <stdio.h>
++#include <dirent.h>
++
++#include "ipkg_conf.h"
++#include "ipkg_cmd.h"
++#include "ipkg_message.h"
++#include "pkg.h"
++#include "pkg_dest.h"
++#include "pkg_parse.h"
++#include "sprintf_alloc.h"
++#include "pkg.h"
++#include "file_util.h"
++#include "str_util.h"
++#include "unarchive.h"
++
++#include <fnmatch.h>
++
++
++#include "ipkg_download.h"
++#include "ipkg_install.h"
++#include "ipkg_upgrade.h"
++#include "ipkg_remove.h"
++#include "ipkg_configure.h"
++#include "ipkg_message.h"
++
++#ifdef IPKG_LIB
++#include "libipkg.h"
++static void *p_userdata = NULL;
++#endif
++
++static int ipkg_update_cmd(ipkg_conf_t *conf);
++static int ipkg_upgrade_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_list_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_info_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_status_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_install_pending_cmd(ipkg_conf_t *conf);
++static int ipkg_install_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_list_installed_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_remove_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_purge_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_flag_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_files_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_search_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_download_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_depends_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_whatdepends_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_whatdepends_recursively_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_whatsuggests_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_whatrecommends_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_whatprovides_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_whatconflicts_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_whatreplaces_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_compare_versions_cmd(ipkg_conf_t *conf, int argc, char **argv);
++static int ipkg_print_architecture_cmd(ipkg_conf_t *conf);
++static int ipkg_configure_cmd(ipkg_conf_t *conf, int argc, char **argv);
++
++/* XXX: CLEANUP: The usage strings should be incorporated into this
++ array for easier maintenance */
++static ipkg_cmd_t cmds[] = {
++ {"update", 0, (ipkg_cmd_fun_t)ipkg_update_cmd},
++ {"upgrade", 0, (ipkg_cmd_fun_t)ipkg_upgrade_cmd},
++ {"list", 0, (ipkg_cmd_fun_t)ipkg_list_cmd},
++ {"list_installed", 0, (ipkg_cmd_fun_t)ipkg_list_installed_cmd},
++ {"info", 0, (ipkg_cmd_fun_t)ipkg_info_cmd},
++ {"flag", 1, (ipkg_cmd_fun_t)ipkg_flag_cmd},
++ {"status", 0, (ipkg_cmd_fun_t)ipkg_status_cmd},
++ {"install_pending", 0, (ipkg_cmd_fun_t)ipkg_install_pending_cmd},
++ {"install", 1, (ipkg_cmd_fun_t)ipkg_install_cmd},
++ {"remove", 1, (ipkg_cmd_fun_t)ipkg_remove_cmd},
++ {"purge", 1, (ipkg_cmd_fun_t)ipkg_purge_cmd},
++ {"configure", 0, (ipkg_cmd_fun_t)ipkg_configure_cmd},
++ {"files", 1, (ipkg_cmd_fun_t)ipkg_files_cmd},
++ {"search", 1, (ipkg_cmd_fun_t)ipkg_search_cmd},
++ {"download", 1, (ipkg_cmd_fun_t)ipkg_download_cmd},
++ {"compare_versions", 1, (ipkg_cmd_fun_t)ipkg_compare_versions_cmd},
++ {"compare-versions", 1, (ipkg_cmd_fun_t)ipkg_compare_versions_cmd},
++ {"print-architecture", 0, (ipkg_cmd_fun_t)ipkg_print_architecture_cmd},
++ {"print_architecture", 0, (ipkg_cmd_fun_t)ipkg_print_architecture_cmd},
++ {"print-installation-architecture", 0, (ipkg_cmd_fun_t)ipkg_print_architecture_cmd},
++ {"print_installation_architecture", 0, (ipkg_cmd_fun_t)ipkg_print_architecture_cmd},
++ {"depends", 1, (ipkg_cmd_fun_t)ipkg_depends_cmd},
++ {"whatdepends", 1, (ipkg_cmd_fun_t)ipkg_whatdepends_cmd},
++ {"whatdependsrec", 1, (ipkg_cmd_fun_t)ipkg_whatdepends_recursively_cmd},
++ {"whatrecommends", 1, (ipkg_cmd_fun_t)ipkg_whatrecommends_cmd},
++ {"whatsuggests", 1, (ipkg_cmd_fun_t)ipkg_whatsuggests_cmd},
++ {"whatprovides", 1, (ipkg_cmd_fun_t)ipkg_whatprovides_cmd},
++ {"whatreplaces", 1, (ipkg_cmd_fun_t)ipkg_whatreplaces_cmd},
++ {"whatconflicts", 1, (ipkg_cmd_fun_t)ipkg_whatconflicts_cmd},
++};
++
++int ipkg_state_changed;
++static void write_status_files_if_changed(ipkg_conf_t *conf)
++{
++ if (ipkg_state_changed && !conf->noaction) {
++ ipkg_message(conf, IPKG_INFO,
++ " writing status file\n");
++ ipkg_conf_write_status_files(conf);
++ pkg_write_changed_filelists(conf);
++ } else {
++ ipkg_message(conf, IPKG_NOTICE, "Nothing to be done\n");
++ }
++}
++
++
++static int num_cmds = sizeof(cmds) / sizeof(ipkg_cmd_t);
++
++ipkg_cmd_t *ipkg_cmd_find(const char *name)
++{
++ int i;
++ ipkg_cmd_t *cmd;
++
++ for (i=0; i < num_cmds; i++) {
++ cmd = &cmds[i];
++ if (strcmp(name, cmd->name) == 0) {
++ return cmd;
++ }
++ }
++
++ return NULL;
++}
++
++#ifdef IPKG_LIB
++int ipkg_cmd_exec(ipkg_cmd_t *cmd, ipkg_conf_t *conf, int argc, const char **argv, void *userdata)
++{
++ int result;
++ p_userdata = userdata;
++
++
++ result = (cmd->fun)(conf, argc, argv);
++ if ( result == 0 ) {
++ ipkg_message(conf, IPKG_NOTICE, "Done.\n");
++ } else {
++ ipkg_message(conf, IPKG_NOTICE, "An error ocurred, return value: %d.\n", result);
++
++ }
++ if ( error_list ) {
++ reverse_error_list(&error_list);
++
++ ipkg_message(conf, IPKG_NOTICE, "Collected errors:\n");
++ /* Here we print the errors collected and free the list */
++ while (error_list != NULL) {
++ ipkg_message(conf, IPKG_NOTICE, "%s",error_list->errmsg);
++ error_list = error_list->next;
++
++ }
++ free_error_list(&error_list);
++
++ }
++
++ p_userdata = NULL;
++ return result;
++}
++#else
++int ipkg_cmd_exec(ipkg_cmd_t *cmd, ipkg_conf_t *conf, int argc, const char **argv)
++{
++ return (cmd->fun)(conf, argc, argv);
++}
++#endif
++
++static int ipkg_update_cmd(ipkg_conf_t *conf)
++{
++ int err;
++ int failures;
++ char *lists_dir;
++ pkg_src_list_elt_t *iter;
++ pkg_src_t *src;
++
++
++ sprintf_alloc(&lists_dir, "%s", conf->restrict_to_default_dest ? conf->default_dest->lists_dir : conf->lists_dir);
++
++ if (! file_is_dir(lists_dir)) {
++ if (file_exists(lists_dir)) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s: ERROR: %s exists, but is not a directory\n",
++ __FUNCTION__, lists_dir);
++ free(lists_dir);
++ return EINVAL;
++ }
++ err = file_mkdir_hier(lists_dir, 0755);
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s: ERROR: failed to make directory %s: %s\n",
++ __FUNCTION__, lists_dir, strerror(errno));
++ free(lists_dir);
++ return EINVAL;
++ }
++ }
++
++ failures = 0;
++ for (iter = conf->pkg_src_list.head; iter; iter = iter->next) {
++ char *url, *list_file_name;
++
++ src = iter->data;
++
++ if (src->extra_data) /* debian style? */
++ sprintf_alloc(&url, "%s/%s/%s", src->value, src->extra_data,
++ src->gzip ? "Packages.gz" : "Packages");
++ else
++ sprintf_alloc(&url, "%s/%s", src->value, src->gzip ? "Packages.gz" : "Packages");
++
++ sprintf_alloc(&list_file_name, "%s/%s", lists_dir, src->name);
++ if (src->gzip) {
++ char *tmp;
++ char *tmp_file_name;
++ FILE *in, *out;
++
++ tmp = strdup ("/tmp/ipkg.XXXXXX");
++
++ if (mkdtemp (tmp) == NULL) {
++ perror ("mkdtemp");
++ failures++;
++ continue;
++ }
++
++ sprintf_alloc (&tmp_file_name, "%s/%s.gz", tmp, src->name);
++ err = ipkg_download(conf, url, tmp_file_name);
++ if (err == 0) {
++ ipkg_message (conf, IPKG_NOTICE, "Inflating %s\n", url);
++ in = fopen (tmp_file_name, "r");
++ out = fopen (list_file_name, "w");
++ if (in && out) {
++ inflate_unzip_result res;
++ inflate_unzip (&res, 0x8000, fileno(in), fileno(out));
++ } else
++ err = 1;
++ if (in)
++ fclose (in);
++ if (out)
++ fclose (out);
++ unlink (tmp_file_name);
++ rmdir (tmp);
++ free (tmp);
++ }
++ } else
++ err = ipkg_download(conf, url, list_file_name);
++ if (err) {
++ failures++;
++ } else {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Updated list of available packages in %s\n",
++ list_file_name);
++ }
++ free(url);
++ free(list_file_name);
++ }
++ free(lists_dir);
++
++#ifdef CONFIG_CLEAR_SW_INSTALL_FLAG
++#warning here
++ /* clear SW_INSTALL on any package where state is SS_NOT_INSTALLED.
++ * this is a hack to work around poor bookkeeping in old ipkg upgrade code
++ * -Jamey 3/1/03
++ */
++ {
++ int i;
++ int changed = 0;
++ pkg_vec_t *available = pkg_vec_alloc();
++ pkg_hash_fetch_available(&conf->pkg_hash, available);
++ ipkg_message(conf, IPKG_DEBUG, "Clearing SW_INSTALL for SS_NOT_INSTALLED packages.\n");
++ for (i = 0; i < available->len; i++) {
++ pkg_t *pkg = available->pkgs[i];
++ if (pkg->state_want == SW_INSTALL && pkg->state_status == SS_NOT_INSTALLED) {
++ ipkg_message(conf, IPKG_DEBUG, "Clearing SW_INSTALL on package %s.\n", pkg->name);
++ pkg->state_want = SW_UNKNOWN;
++ changed = 1;
++ }
++ }
++ pkg_vec_free(available);
++ if (changed) {
++ write_status_files_if_changed(conf);
++ }
++ }
++#endif
++
++ return failures;
++}
++
++
++/* scan the args passed and cache the local filenames of the packages */
++int ipkg_multiple_files_scan(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i;
++ int err;
++
++ /*
++ * First scan through package names/urls
++ * For any urls, download the packages and install in database.
++ * For any files, install package info in database.
++ */
++ for (i = 0; i < argc; i ++) {
++ char *filename = argv [i];
++ //char *tmp = basename (tmp);
++ //int tmplen = strlen (tmp);
++
++ //if (strcmp (tmp + (tmplen - strlen (IPKG_PKG_EXTENSION)), IPKG_PKG_EXTENSION) != 0)
++ // continue;
++ //if (strcmp (tmp + (tmplen - strlen (DPKG_PKG_EXTENSION)), DPKG_PKG_EXTENSION) != 0)
++ // continue;
++
++ ipkg_message(conf, IPKG_DEBUG2, "Debug mfs: %s \n",filename );
++
++ err = ipkg_prepare_url_for_install(conf, filename, &argv[i]);
++ if (err)
++ return err;
++ }
++ return 0;
++}
++
++struct ipkg_intercept
++{
++ char *oldpath;
++ char *statedir;
++};
++
++typedef struct ipkg_intercept *ipkg_intercept_t;
++ipkg_intercept_t ipkg_prep_intercepts(void);
++
++ipkg_intercept_t ipkg_prep_intercepts(void)
++{
++ ipkg_intercept_t ctx;
++ char *newpath;
++ int gen;
++
++ ctx = malloc (sizeof (*ctx));
++ ctx->oldpath = strdup (getenv ("PATH"));
++
++ sprintf_alloc (&newpath, "%s/ipkg/intercept:%s", IPKGLIBDIR, ctx->oldpath);
++ setenv ("PATH", newpath, 1);
++ free (newpath);
++
++ gen = 0;
++ retry:
++ sprintf_alloc (&ctx->statedir, "/tmp/ipkg-intercept-%d-%d", getpid (), gen);
++ if (mkdir (ctx->statedir, 0770) < 0) {
++ if (errno == EEXIST) {
++ free (ctx->statedir);
++ gen++;
++ goto retry;
++ }
++ perror (ctx->statedir);
++ return NULL;
++ }
++ setenv ("IPKG_INTERCEPT_DIR", ctx->statedir, 1);
++ return ctx;
++}
++
++int ipkg_finalize_intercepts(ipkg_intercept_t ctx);
++
++int ipkg_finalize_intercepts(ipkg_intercept_t ctx)
++{
++ char *cmd;
++ DIR *dir;
++ int err = 0;
++
++ setenv ("PATH", ctx->oldpath, 1);
++ free (ctx->oldpath);
++
++ dir = opendir (ctx->statedir);
++ if (dir) {
++ struct dirent *de;
++ while (de = readdir (dir), de != NULL) {
++ char *path;
++
++ if (de->d_name[0] == '.')
++ continue;
++
++ sprintf_alloc (&path, "%s/%s", ctx->statedir, de->d_name);
++ if (access (path, X_OK) == 0) {
++ if (system (path)) {
++ err = errno;
++ perror (de->d_name);
++ }
++ }
++ free (path);
++ }
++ } else
++ perror (ctx->statedir);
++
++ sprintf_alloc (&cmd, "rm -rf %s", ctx->statedir);
++ system (cmd);
++ free (cmd);
++
++ free (ctx->statedir);
++ free (ctx);
++
++ return err;
++}
++
++int ipkg_configure_packages(ipkg_conf_t *conf, char *pkg_name)
++{
++ pkg_vec_t *all;
++ int i;
++ pkg_t *pkg;
++ ipkg_intercept_t ic;
++ int r, err = 0;
++
++ ipkg_message(conf, IPKG_INFO,
++ "Configuring unpacked packages\n");
++ fflush( stdout );
++
++ all = pkg_vec_alloc();
++ pkg_hash_fetch_available(&conf->pkg_hash, all);
++
++ ic = ipkg_prep_intercepts();
++
++ for(i = 0; i < all->len; i++) {
++ pkg = all->pkgs[i];
++
++ if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
++ continue;
++
++ if (pkg->state_status == SS_UNPACKED) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Configuring %s\n", pkg->name);
++ fflush( stdout );
++ r = ipkg_configure(conf, pkg);
++ if (r == 0) {
++ pkg->state_status = SS_INSTALLED;
++ pkg->parent->state_status = SS_INSTALLED;
++ pkg->state_flag &= ~SF_PREFER;
++ } else {
++ if (!err)
++ err = r;
++ }
++ }
++ }
++
++ r = ipkg_finalize_intercepts (ic);
++ if (r && !err)
++ err = r;
++
++ pkg_vec_free(all);
++ return err;
++}
++
++static void sigint_handler(int sig)
++{
++ signal(sig, SIG_DFL);
++ ipkg_message(NULL, IPKG_NOTICE,
++ "ipkg: interrupted. writing out status database\n");
++ write_status_files_if_changed(global_conf);
++ exit(128 + sig);
++}
++
++static int ipkg_install_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i;
++ char *arg;
++ int err=0;
++
++ global_conf = conf;
++ signal(SIGINT, sigint_handler);
++
++ /*
++ * Now scan through package names and install
++ */
++ for (i=0; i < argc; i++) {
++ arg = argv[i];
++
++ ipkg_message(conf, IPKG_DEBUG2, "Debug install_cmd: %s \n",arg );
++ err = ipkg_prepare_url_for_install(conf, arg, &argv[i]);
++ if (err != EINVAL && err != 0)
++ return err;
++ }
++ pkg_info_preinstall_check(conf);
++
++ for (i=0; i < argc; i++) {
++ arg = argv[i];
++ if (conf->multiple_providers)
++ err = ipkg_install_multi_by_name(conf, arg);
++ else{
++ err = ipkg_install_by_name(conf, arg);
++ }
++ if (err == IPKG_PKG_HAS_NO_CANDIDATE) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Cannot find package %s.\n"
++ "Check the spelling or perhaps run 'ipkg update'\n",
++ arg);
++ }
++ }
++
++ /* recheck to verify that all dependences are satisfied */
++ if (0) ipkg_satisfy_all_dependences(conf);
++
++ ipkg_configure_packages(conf, NULL);
++
++ write_status_files_if_changed(conf);
++
++ return err;
++}
++
++static int ipkg_upgrade_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i;
++ pkg_t *pkg;
++ int err;
++
++ global_conf = conf;
++ signal(SIGINT, sigint_handler);
++
++ if (argc) {
++ for (i=0; i < argc; i++) {
++ char *arg = argv[i];
++
++ err = ipkg_prepare_url_for_install(conf, arg, &arg);
++ if (err != EINVAL && err != 0)
++ return err;
++ }
++ pkg_info_preinstall_check(conf);
++
++ for (i=0; i < argc; i++) {
++ char *arg = argv[i];
++ if (conf->restrict_to_default_dest) {
++ pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
++ argv[i],
++ conf->default_dest);
++ if (pkg == NULL) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Package %s not installed in %s\n",
++ argv[i], conf->default_dest->name);
++ continue;
++ }
++ } else {
++ pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash,
++ argv[i]);
++ }
++ if (pkg)
++ ipkg_upgrade_pkg(conf, pkg);
++ else {
++ ipkg_install_by_name(conf, arg);
++ }
++ }
++ } else {
++ pkg_vec_t *installed = pkg_vec_alloc();
++
++ pkg_info_preinstall_check(conf);
++
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
++ for (i = 0; i < installed->len; i++) {
++ pkg = installed->pkgs[i];
++ ipkg_upgrade_pkg(conf, pkg);
++ }
++ pkg_vec_free(installed);
++ }
++
++ /* recheck to verify that all dependences are satisfied */
++ if (0) ipkg_satisfy_all_dependences(conf);
++
++ ipkg_configure_packages(conf, NULL);
++
++ write_status_files_if_changed(conf);
++
++ return 0;
++}
++
++static int ipkg_download_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i, err;
++ char *arg;
++ pkg_t *pkg;
++
++ pkg_info_preinstall_check(conf);
++ for (i = 0; i < argc; i++) {
++ arg = argv[i];
++
++ pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, arg);
++ if (pkg == NULL) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Cannot find package %s.\n"
++ "Check the spelling or perhaps run 'ipkg update'\n",
++ arg);
++ continue;
++ }
++
++ err = ipkg_download_pkg(conf, pkg, ".");
++
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Failed to download %s\n", pkg->name);
++ } else {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Downloaded %s as %s\n",
++ pkg->name, pkg->local_filename);
++ }
++ }
++
++ return 0;
++}
++
++
++static int ipkg_list_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i ;
++ pkg_vec_t *available;
++ pkg_t *pkg;
++ char desc_short[IPKG_LIST_DESCRIPTION_LENGTH];
++ char *newline;
++ char *pkg_name = NULL;
++ char *version_str;
++
++ if (argc > 0) {
++ pkg_name = argv[0];
++ }
++ available = pkg_vec_alloc();
++ pkg_hash_fetch_available(&conf->pkg_hash, available);
++ for (i=0; i < available->len; i++) {
++ pkg = available->pkgs[i];
++ /* if we have package name or pattern and pkg does not match, then skip it */
++ if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
++ continue;
++ if (pkg->description) {
++ strncpy(desc_short, pkg->description, IPKG_LIST_DESCRIPTION_LENGTH);
++ } else {
++ desc_short[0] = '\0';
++ }
++ desc_short[IPKG_LIST_DESCRIPTION_LENGTH - 1] = '\0';
++ newline = strchr(desc_short, '\n');
++ if (newline) {
++ *newline = '\0';
++ }
++#ifndef IPKG_LIB
++ printf("%s - %s\n", pkg->name, desc_short);
++#else
++ if (ipkg_cb_list) {
++ version_str = pkg_version_str_alloc(pkg);
++ ipkg_cb_list(pkg->name,desc_short,
++ version_str,
++ pkg->state_status,
++ p_userdata);
++ free(version_str);
++ }
++#endif
++ }
++ pkg_vec_free(available);
++
++ return 0;
++}
++
++
++static int ipkg_list_installed_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i ;
++ pkg_vec_t *available;
++ pkg_t *pkg;
++ char desc_short[IPKG_LIST_DESCRIPTION_LENGTH];
++ char *newline;
++ char *pkg_name = NULL;
++ char *version_str;
++
++ if (argc > 0) {
++ pkg_name = argv[0];
++ }
++ available = pkg_vec_alloc();
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, available);
++ for (i=0; i < available->len; i++) {
++ pkg = available->pkgs[i];
++ /* if we have package name or pattern and pkg does not match, then skip it */
++ if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
++ continue;
++ if (pkg->description) {
++ strncpy(desc_short, pkg->description, IPKG_LIST_DESCRIPTION_LENGTH);
++ } else {
++ desc_short[0] = '\0';
++ }
++ desc_short[IPKG_LIST_DESCRIPTION_LENGTH - 1] = '\0';
++ newline = strchr(desc_short, '\n');
++ if (newline) {
++ *newline = '\0';
++ }
++#ifndef IPKG_LIB
++ printf("%s - %s\n", pkg->name, desc_short);
++#else
++ if (ipkg_cb_list) {
++ version_str = pkg_version_str_alloc(pkg);
++ ipkg_cb_list(pkg->name,desc_short,
++ version_str,
++ pkg->state_status,
++ p_userdata);
++ free(version_str);
++ }
++#endif
++ }
++
++ return 0;
++}
++
++static int ipkg_info_status_cmd(ipkg_conf_t *conf, int argc, char **argv, int installed_only)
++{
++ int i;
++ pkg_vec_t *available;
++ pkg_t *pkg;
++ char *pkg_name = NULL;
++ char **pkg_fields = NULL;
++ int n_fields = 0;
++ char *buff ; // = (char *)malloc(1);
++
++ if (argc > 0) {
++ pkg_name = argv[0];
++ }
++ if (argc > 1) {
++ pkg_fields = &argv[1];
++ n_fields = argc - 1;
++ }
++
++ available = pkg_vec_alloc();
++ if (installed_only)
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, available);
++ else
++ pkg_hash_fetch_available(&conf->pkg_hash, available);
++ for (i=0; i < available->len; i++) {
++ pkg = available->pkgs[i];
++ if (pkg_name && fnmatch(pkg_name, pkg->name, 0)) {
++ continue;
++ }
++#ifndef IPKG_LIB
++ if (n_fields) {
++ for (j = 0; j < n_fields; j++)
++ pkg_print_field(pkg, stdout, pkg_fields[j]);
++ } else {
++ pkg_print_info(pkg, stdout);
++ }
++#else
++
++ buff = pkg_formatted_info(pkg);
++ if ( buff ) {
++ if (ipkg_cb_status) ipkg_cb_status(pkg->name,
++ pkg->state_status,
++ buff,
++ p_userdata);
++/*
++ We should not forget that actually the pointer is allocated.
++ We need to free it :) ( Thanks florian for seeing the error )
++*/
++ free(buff);
++ }
++#endif
++ if (conf->verbosity > 1) {
++ conffile_list_elt_t *iter;
++ for (iter = pkg->conffiles.head; iter; iter = iter->next) {
++ conffile_t *cf = iter->data;
++ int modified = conffile_has_been_modified(conf, cf);
++ ipkg_message(conf, IPKG_NOTICE, "conffile=%s md5sum=%s modified=%d\n",
++ cf->name, cf->value, modified);
++ }
++ }
++ }
++#ifndef IPKG_LIB
++ if (buff)
++ free(buff);
++#endif
++ pkg_vec_free(available);
++
++ return 0;
++}
++
++static int ipkg_info_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_info_status_cmd(conf, argc, argv, 0);
++}
++
++static int ipkg_status_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_info_status_cmd(conf, argc, argv, 1);
++}
++
++static int ipkg_configure_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++
++ int err;
++ if (argc > 0) {
++ char *pkg_name = NULL;
++
++ pkg_name = argv[0];
++
++ err = ipkg_configure_packages (conf, pkg_name);
++
++ } else {
++ err = ipkg_configure_packages (conf, NULL);
++ }
++
++ write_status_files_if_changed(conf);
++
++ return err;
++}
++
++static int ipkg_install_pending_cmd(ipkg_conf_t *conf)
++{
++ int i, err;
++ char *globpattern;
++ glob_t globbuf;
++
++ sprintf_alloc(&globpattern, "%s/*" IPKG_PKG_EXTENSION, conf->pending_dir);
++ err = glob(globpattern, 0, NULL, &globbuf);
++ free(globpattern);
++ if (err) {
++ return 0;
++ }
++
++ ipkg_message(conf, IPKG_NOTICE,
++ "The following packages in %s will now be installed.\n",
++ conf->pending_dir);
++ for (i = 0; i < globbuf.gl_pathc; i++) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "%s%s", i == 0 ? "" : " ", globbuf.gl_pathv[i]);
++ }
++ ipkg_message(conf, IPKG_NOTICE, "\n");
++ for (i = 0; i < globbuf.gl_pathc; i++) {
++ err = ipkg_install_from_file(conf, globbuf.gl_pathv[i]);
++ if (err == 0) {
++ err = unlink(globbuf.gl_pathv[i]);
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s: ERROR: failed to unlink %s: %s\n",
++ __FUNCTION__, globbuf.gl_pathv[i], strerror(err));
++ return err;
++ }
++ }
++ }
++ globfree(&globbuf);
++
++ return err;
++}
++
++static int ipkg_remove_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i,a,done;
++ pkg_t *pkg;
++ pkg_t *pkg_to_remove;
++ pkg_vec_t *available;
++ char *pkg_name = NULL;
++ global_conf = conf;
++ signal(SIGINT, sigint_handler);
++
++// ENH: Add the "no pkg removed" just in case.
++
++ done = 0;
++
++ available = pkg_vec_alloc();
++ pkg_info_preinstall_check(conf);
++ if ( argc > 0 ) {
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, available);
++ for (i=0; i < argc; i++) {
++ pkg_name = malloc(strlen(argv[i])+2);
++ strcpy(pkg_name,argv[i]);
++ for (a=0; a < available->len; a++) {
++ pkg = available->pkgs[a];
++ if (pkg_name && fnmatch(pkg_name, pkg->name, 0)) {
++ continue;
++ }
++ if (conf->restrict_to_default_dest) {
++ pkg_to_remove = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
++ pkg->name,
++ conf->default_dest);
++ } else {
++ pkg_to_remove = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, pkg->name );
++ }
++
++ if (pkg == NULL) {
++ ipkg_message(conf, IPKG_ERROR, "Package %s is not installed.\n", pkg->name);
++ continue;
++ }
++ if (pkg->state_status == SS_NOT_INSTALLED) { // Added the control, so every already removed package could be skipped
++ ipkg_message(conf, IPKG_ERROR, "Package seems to be %s not installed (STATUS = NOT_INSTALLED).\n", pkg->name);
++ continue;
++ }
++ ipkg_remove_pkg(conf, pkg_to_remove,0);
++ done = 1;
++ }
++ free (pkg_name);
++ }
++ pkg_vec_free(available);
++ } else {
++ pkg_vec_t *installed_pkgs = pkg_vec_alloc();
++ int flagged_pkg_count = 0;
++ int removed;
++
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, installed_pkgs);
++
++ for (i = 0; i < installed_pkgs->len; i++) {
++ pkg = installed_pkgs->pkgs[i];
++ if (pkg->state_flag & SF_USER) {
++ flagged_pkg_count++;
++ } else {
++ if (!pkg_has_installed_dependents(pkg, NULL))
++ ipkg_message(conf, IPKG_NOTICE, "Non-user leaf package: %s\n", pkg->name);
++ }
++ }
++ if (!flagged_pkg_count) {
++ ipkg_message(conf, IPKG_NOTICE, "No packages flagged as installed by user, \n"
++ "so refusing to uninstall unflagged non-leaf packages\n");
++ return 0;
++ }
++
++ /* find packages not flagged SF_USER (i.e., installed to
++ * satisfy a dependence) and not having any dependents, and
++ * remove them */
++ do {
++ removed = 0;
++ for (i = 0; i < installed_pkgs->len; i++) {
++ pkg = installed_pkgs->pkgs[i];
++ if (!(pkg->state_flag & SF_USER)
++ && !pkg_has_installed_dependents(pkg, NULL)) {
++ removed++;
++ ipkg_message(conf, IPKG_NOTICE, "Removing non-user leaf package %s\n");
++ ipkg_remove_pkg(conf, pkg,0);
++ done = 1;
++ }
++ }
++ } while (removed);
++ pkg_vec_free(installed_pkgs);
++ }
++
++ if ( done == 0 )
++ ipkg_message(conf, IPKG_NOTICE, "No packages removed.\n");
++
++ write_status_files_if_changed(conf);
++ return 0;
++}
++
++static int ipkg_purge_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i;
++ pkg_t *pkg;
++
++ global_conf = conf;
++ signal(SIGINT, sigint_handler);
++
++ pkg_info_preinstall_check(conf);
++
++ for (i=0; i < argc; i++) {
++ if (conf->restrict_to_default_dest) {
++ pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
++ argv[i],
++ conf->default_dest);
++ } else {
++ pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, argv[i]);
++ }
++
++ if (pkg == NULL) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Package %s is not installed.\n", argv[i]);
++ continue;
++ }
++ ipkg_purge_pkg(conf, pkg);
++ }
++
++ write_status_files_if_changed(conf);
++ return 0;
++}
++
++static int ipkg_flag_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i;
++ pkg_t *pkg;
++ char *flags = argv[0];
++
++ global_conf = conf;
++ signal(SIGINT, sigint_handler);
++
++ for (i=1; i < argc; i++) {
++ if (conf->restrict_to_default_dest) {
++ pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
++ argv[i],
++ conf->default_dest);
++ } else {
++ pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, argv[i]);
++ }
++
++ if (pkg == NULL) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Package %s is not installed.\n", argv[i]);
++ continue;
++ }
++ if (( strcmp(flags,"hold")==0)||( strcmp(flags,"noprune")==0)||
++ ( strcmp(flags,"user")==0)||( strcmp(flags,"ok")==0)) {
++ pkg->state_flag = pkg_state_flag_from_str(flags);
++ }
++/* pb_ asked this feature 03292004 */
++/* Actually I will use only this two, but this is an open for various status */
++ if (( strcmp(flags,"installed")==0)||( strcmp(flags,"unpacked")==0)){
++ pkg->state_status = pkg_state_status_from_str(flags);
++ }
++ ipkg_state_changed++;
++ ipkg_message(conf, IPKG_NOTICE,
++ "Setting flags for package %s to %s\n",
++ pkg->name, flags);
++ }
++
++ write_status_files_if_changed(conf);
++ return 0;
++}
++
++static int ipkg_files_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ pkg_t *pkg;
++ str_list_t *installed_files;
++ str_list_elt_t *iter;
++ char *pkg_version;
++ size_t buff_len = 8192;
++ size_t used_len;
++ char *buff ;
++
++ buff = (char *)malloc(buff_len);
++ if ( buff == NULL ) {
++ fprintf( stderr,"%s: Unable to allocate memory \n",__FUNCTION__);
++ return ENOMEM;
++ }
++
++ if (argc < 1) {
++ return EINVAL;
++ }
++
++ pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash,
++ argv[0]);
++ if (pkg == NULL) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Package %s not installed.\n", argv[0]);
++ return 0;
++ }
++
++ installed_files = pkg_get_installed_files(pkg);
++ pkg_version = pkg_version_str_alloc(pkg);
++
++#ifndef IPKG_LIB
++ printf("Package %s (%s) is installed on %s and has the following files:\n",
++ pkg->name, pkg_version, pkg->dest->name);
++ for (iter = installed_files->head; iter; iter = iter->next) {
++ puts(iter->data);
++ }
++#else
++ if (buff) {
++ try_again:
++ used_len = snprintf(buff, buff_len, "Package %s (%s) is installed on %s and has the following files:\n",
++ pkg->name, pkg_version, pkg->dest->name) + 1;
++ if (used_len > buff_len) {
++ buff_len *= 2;
++ buff = realloc (buff, buff_len);
++ goto try_again;
++ }
++ for (iter = installed_files->head; iter; iter = iter->next) {
++ used_len += strlen (iter->data) + 1;
++ while (buff_len <= used_len) {
++ buff_len *= 2;
++ buff = realloc (buff, buff_len);
++ }
++ strncat(buff, iter->data, buff_len);
++ strncat(buff, "\n", buff_len);
++ }
++ if (ipkg_cb_list) ipkg_cb_list(pkg->name,
++ buff,
++ pkg_version_str_alloc(pkg),
++ pkg->state_status,
++ p_userdata);
++ free(buff);
++ }
++#endif
++
++ free(pkg_version);
++ pkg_free_installed_files(pkg);
++
++ return 0;
++}
++
++static int ipkg_depends_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++
++ if (argc > 0) {
++ pkg_vec_t *available_pkgs = pkg_vec_alloc();
++ const char *rel_str = "depends on";
++ int i;
++
++ pkg_info_preinstall_check(conf);
++
++ if (conf->query_all)
++ pkg_hash_fetch_available(&conf->pkg_hash, available_pkgs);
++ else
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, available_pkgs);
++ for (i = 0; i < argc; i++) {
++ const char *target = argv[i];
++ int j;
++
++ ipkg_message(conf, IPKG_ERROR, "target=%s\n", target);
++
++ for (j = 0; j < available_pkgs->len; j++) {
++ pkg_t *pkg = available_pkgs->pkgs[j];
++ if (fnmatch(target, pkg->name, 0) == 0) {
++ int k;
++ int count = pkg->depends_count + pkg->pre_depends_count;
++ ipkg_message(conf, IPKG_ERROR, "What %s (arch=%s) %s\n",
++ target, pkg->architecture, rel_str);
++ for (k = 0; k < count; k++) {
++ compound_depend_t *cdepend = &pkg->depends[k];
++ int l;
++ for (l = 0; l < cdepend->possibility_count; l++) {
++ depend_t *possibility = cdepend->possibilities[l];
++ ipkg_message(conf, IPKG_ERROR, " %s", possibility->pkg->name);
++ if (conf->verbosity > 0) {
++ // char *ver = abstract_pkg_version_str_alloc(possibility->pkg);
++ ipkg_message(conf, IPKG_NOTICE, " %s", possibility->version);
++ if (possibility->version) {
++ const char *typestr = NULL;
++ switch (possibility->constraint) {
++ case NONE: typestr = "none"; break;
++ case EARLIER: typestr = "<"; break;
++ case EARLIER_EQUAL: typestr = "<="; break;
++ case EQUAL: typestr = "="; break;
++ case LATER_EQUAL: typestr = ">="; break;
++ case LATER: typestr = ">"; break;
++ }
++ ipkg_message(conf, IPKG_NOTICE, " (%s %s)", typestr, possibility->version);
++ }
++ // free(ver);
++ }
++ ipkg_message(conf, IPKG_ERROR, "\n");
++ }
++ }
++ }
++ }
++ }
++ pkg_vec_free(available_pkgs);
++ }
++ return 0;
++}
++
++enum what_field_type {
++ WHATDEPENDS,
++ WHATCONFLICTS,
++ WHATPROVIDES,
++ WHATREPLACES,
++ WHATRECOMMENDS,
++ WHATSUGGESTS
++};
++
++static int ipkg_what_depends_conflicts_cmd(ipkg_conf_t *conf, enum what_field_type what_field_type, int recursive, int argc, char **argv)
++{
++
++ if (argc > 0) {
++ pkg_vec_t *available_pkgs = pkg_vec_alloc();
++ const char *rel_str = NULL;
++ int i;
++ int changed;
++
++ switch (what_field_type) {
++ case WHATDEPENDS: rel_str = "depends on"; break;
++ case WHATCONFLICTS: rel_str = "conflicts with"; break;
++ case WHATSUGGESTS: rel_str = "suggests"; break;
++ case WHATRECOMMENDS: rel_str = "recommends"; break;
++ case WHATPROVIDES: rel_str = "provides"; break;
++ case WHATREPLACES: rel_str = "replaces"; break;
++ }
++
++ if (conf->query_all)
++ pkg_hash_fetch_available(&conf->pkg_hash, available_pkgs);
++ else
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, available_pkgs);
++
++ /* mark the root set */
++ pkg_vec_clear_marks(available_pkgs);
++ ipkg_message(conf, IPKG_NOTICE, "Root set:\n");
++ for (i = 0; i < argc; i++) {
++ const char *dependee_pattern = argv[i];
++ pkg_vec_mark_if_matches(available_pkgs, dependee_pattern);
++ }
++ for (i = 0; i < available_pkgs->len; i++) {
++ pkg_t *pkg = available_pkgs->pkgs[i];
++ if (pkg->state_flag & SF_MARKED) {
++ /* mark the parent (abstract) package */
++ pkg_mark_provides(pkg);
++ ipkg_message(conf, IPKG_NOTICE, " %s\n", pkg->name);
++ }
++ }
++
++ ipkg_message(conf, IPKG_NOTICE, "What %s root set\n", rel_str);
++ do {
++ int j;
++ changed = 0;
++
++ for (j = 0; j < available_pkgs->len; j++) {
++ pkg_t *pkg = available_pkgs->pkgs[j];
++ int k;
++ int count = ((what_field_type == WHATCONFLICTS)
++ ? pkg->conflicts_count
++ : pkg->pre_depends_count + pkg->depends_count + pkg->recommends_count + pkg->suggests_count);
++ /* skip this package if it is already marked */
++ if (pkg->parent->state_flag & SF_MARKED) {
++ continue;
++ }
++ for (k = 0; k < count; k++) {
++ compound_depend_t *cdepend =
++ (what_field_type == WHATCONFLICTS) ? &pkg->conflicts[k] : &pkg->depends[k];
++ int l;
++ for (l = 0; l < cdepend->possibility_count; l++) {
++ depend_t *possibility = cdepend->possibilities[l];
++ if (possibility->pkg->state_flag & SF_MARKED) {
++ /* mark the depending package so we won't visit it again */
++ pkg->state_flag |= SF_MARKED;
++ pkg_mark_provides(pkg);
++ changed++;
++
++ ipkg_message(conf, IPKG_NOTICE, " %s", pkg->name);
++ if (conf->verbosity > 0) {
++ char *ver = pkg_version_str_alloc(pkg);
++ ipkg_message(conf, IPKG_NOTICE, " %s", ver);
++ ipkg_message(conf, IPKG_NOTICE, "\t%s %s", rel_str, possibility->pkg->name);
++ if (possibility->version) {
++ const char *typestr = NULL;
++ switch (possibility->constraint) {
++ case NONE: typestr = "none"; break;
++ case EARLIER: typestr = "<"; break;
++ case EARLIER_EQUAL: typestr = "<="; break;
++ case EQUAL: typestr = "="; break;
++ case LATER_EQUAL: typestr = ">="; break;
++ case LATER: typestr = ">"; break;
++ }
++ ipkg_message(conf, IPKG_NOTICE, " (%s %s)", typestr, possibility->version);
++ }
++ free(ver);
++ if (!pkg_dependence_satisfiable(possibility))
++ ipkg_message(conf, IPKG_NOTICE, " unsatisfiable");
++ }
++ ipkg_message(conf, IPKG_NOTICE, "\n");
++ goto next_package;
++ }
++ }
++ }
++ next_package:
++ ;
++ }
++ } while (changed && recursive);
++ pkg_vec_free(available_pkgs);
++ }
++
++ return 0;
++}
++
++int pkg_mark_provides(pkg_t *pkg)
++{
++ int provides_count = pkg->provides_count;
++ abstract_pkg_t **provides = pkg->provides;
++ int i;
++ pkg->parent->state_flag |= SF_MARKED;
++ for (i = 0; i < provides_count; i++) {
++ provides[i]->state_flag |= SF_MARKED;
++ }
++ return 0;
++}
++
++static int ipkg_whatdepends_recursively_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_what_depends_conflicts_cmd(conf, WHATDEPENDS, 1, argc, argv);
++}
++static int ipkg_whatdepends_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_what_depends_conflicts_cmd(conf, WHATDEPENDS, 0, argc, argv);
++}
++
++static int ipkg_whatsuggests_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_what_depends_conflicts_cmd(conf, WHATSUGGESTS, 0, argc, argv);
++}
++
++static int ipkg_whatrecommends_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_what_depends_conflicts_cmd(conf, WHATRECOMMENDS, 0, argc, argv);
++}
++
++static int ipkg_whatconflicts_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_what_depends_conflicts_cmd(conf, WHATCONFLICTS, 0, argc, argv);
++}
++
++static int ipkg_what_provides_replaces_cmd(ipkg_conf_t *conf, enum what_field_type what_field_type, int argc, char **argv)
++{
++
++ if (argc > 0) {
++ pkg_vec_t *available_pkgs = pkg_vec_alloc();
++ const char *rel_str = (what_field_type == WHATPROVIDES ? "provides" : "replaces");
++ int i;
++
++ pkg_info_preinstall_check(conf);
++
++ if (conf->query_all)
++ pkg_hash_fetch_available(&conf->pkg_hash, available_pkgs);
++ else
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, available_pkgs);
++ for (i = 0; i < argc; i++) {
++ const char *target = argv[i];
++ int j;
++
++ ipkg_message(conf, IPKG_ERROR, "What %s %s\n",
++ rel_str, target);
++ for (j = 0; j < available_pkgs->len; j++) {
++ pkg_t *pkg = available_pkgs->pkgs[j];
++ int k;
++ int count = (what_field_type == WHATPROVIDES) ? pkg->provides_count : pkg->replaces_count;
++ for (k = 0; k < count; k++) {
++ abstract_pkg_t *apkg =
++ ((what_field_type == WHATPROVIDES)
++ ? pkg->provides[k]
++ : pkg->replaces[k]);
++ if (fnmatch(target, apkg->name, 0) == 0) {
++ ipkg_message(conf, IPKG_ERROR, " %s", pkg->name);
++ if (strcmp(target, apkg->name) != 0)
++ ipkg_message(conf, IPKG_ERROR, "\t%s %s\n", rel_str, apkg->name);
++ ipkg_message(conf, IPKG_ERROR, "\n");
++ }
++ }
++ }
++ }
++ pkg_vec_free(available_pkgs);
++ }
++ return 0;
++}
++
++static int ipkg_whatprovides_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_what_provides_replaces_cmd(conf, WHATPROVIDES, argc, argv);
++}
++
++static int ipkg_whatreplaces_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ return ipkg_what_provides_replaces_cmd(conf, WHATREPLACES, argc, argv);
++}
++
++static int ipkg_search_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ int i;
++
++ pkg_vec_t *installed;
++ pkg_t *pkg;
++ str_list_t *installed_files;
++ str_list_elt_t *iter;
++ char *installed_file;
++
++ if (argc < 1) {
++ return EINVAL;
++ }
++
++ installed = pkg_vec_alloc();
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
++
++ for (i=0; i < installed->len; i++) {
++ pkg = installed->pkgs[i];
++
++ installed_files = pkg_get_installed_files(pkg);
++
++ for (iter = installed_files->head; iter; iter = iter->next) {
++ installed_file = iter->data;
++ if (fnmatch(argv[0], installed_file, 0)==0) {
++#ifndef IPKG_LIB
++ printf("%s: %s\n", pkg->name, installed_file);
++#else
++ if (ipkg_cb_list) ipkg_cb_list(pkg->name,
++ installed_file,
++ pkg_version_str_alloc(pkg),
++ pkg->state_status, p_userdata);
++#endif
++ }
++ }
++
++ pkg_free_installed_files(pkg);
++ }
++
++ /* XXX: CLEANUP: It's not obvious from the name of
++ pkg_hash_fetch_all_installed that we need to call
++ pkg_vec_free to avoid a memory leak. */
++ pkg_vec_free(installed);
++
++ return 0;
++}
++
++static int ipkg_compare_versions_cmd(ipkg_conf_t *conf, int argc, char **argv)
++{
++ if (argc == 3) {
++ /* this is a bit gross */
++ struct pkg p1, p2;
++ parseVersion(&p1, argv[0]);
++ parseVersion(&p2, argv[2]);
++ return pkg_version_satisfied(&p1, &p2, argv[1]);
++ } else {
++ ipkg_message(conf, IPKG_ERROR,
++ "ipkg compare_versions <v1> <op> <v2>\n"
++ "<op> is one of <= >= << >> =\n");
++ return -1;
++ }
++}
++
++#ifndef HOST_CPU_STR
++#define HOST_CPU_STR__(X) #X
++#define HOST_CPU_STR_(X) HOST_CPU_STR__(X)
++#define HOST_CPU_STR HOST_CPU_STR_(HOST_CPU_FOO)
++#endif
++
++static int ipkg_print_architecture_cmd(ipkg_conf_t *conf)
++{
++ nv_pair_list_elt_t *l;
++
++ l = conf->arch_list.head;
++ while (l) {
++ nv_pair_t *nv = l->data;
++ printf("arch %s %s\n", nv->name, nv->value);
++ l = l->next;
++ }
++ return 0;
++}
++
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_cmd.h busybox-1.12.1/archival/libipkg/ipkg_cmd.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_cmd.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_cmd.h 2008-10-23 13:46:55.000000000 +0200
+@@ -0,0 +1,46 @@
++/* ipkg_cmd.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_CMD_H
++#define IPKG_CMD_H
++
++typedef int (*ipkg_cmd_fun_t)(ipkg_conf_t *conf, int argc, const char **argv);
++
++struct ipkg_cmd
++{
++ const char *name;
++ int requires_args;
++ ipkg_cmd_fun_t fun;
++};
++typedef struct ipkg_cmd ipkg_cmd_t;
++
++ipkg_cmd_t *ipkg_cmd_find(const char *name);
++#ifdef IPKG_LIB
++int ipkg_cmd_exec(ipkg_cmd_t *cmd, ipkg_conf_t *conf, int argc,
++ const char **argv, void *userdata);
++#else
++int ipkg_cmd_exec(ipkg_cmd_t *cmd, ipkg_conf_t *conf, int argc, const char **argv);
++#endif
++int ipkg_multiple_files_scan (ipkg_conf_t *conf, int argc, char *argv[]);
++/* install any packges with state_want == SW_INSTALL */
++int ipkg_install_wanted_packages(ipkg_conf_t *conf);
++/* ensure that all dependences are satisfied */
++int ipkg_configure_packages(ipkg_conf_t *conf, char *pkg_name);
++
++int pkg_mark_provides(pkg_t *pkg);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_conf.c busybox-1.12.1/archival/libipkg/ipkg_conf.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_conf.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_conf.c 2008-10-23 13:45:16.000000000 +0200
+@@ -0,0 +1,711 @@
++/* ipkg_conf.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include <glob.h>
++
++#include "ipkg.h"
++#include "ipkg_conf.h"
++
++#include "xregex.h"
++#include "sprintf_alloc.h"
++#include "ipkg_conf.h"
++#include "ipkg_message.h"
++#include "file_util.h"
++#include "str_util.h"
++#include "xsystem.h"
++
++
++ipkg_conf_t *global_conf;
++
++static int ipkg_conf_parse_file(ipkg_conf_t *conf, const char *filename,
++ pkg_src_list_t *pkg_src_list,
++ nv_pair_list_t *tmp_dest_nv_pair_list,
++ char **tmp_lists_dir);
++static int ipkg_init_options_array(const ipkg_conf_t *conf, ipkg_option_t **options);
++static int ipkg_conf_set_option(const ipkg_option_t *options,
++ const char *name, const char *value);
++static int ipkg_conf_set_default_dest(ipkg_conf_t *conf,
++ const char *default_dest_name);
++static int set_and_load_pkg_src_list(ipkg_conf_t *conf,
++ pkg_src_list_t *nv_pair_list);
++static int set_and_load_pkg_dest_list(ipkg_conf_t *conf,
++ nv_pair_list_t *nv_pair_list, char * lists_dir);
++
++int ipkg_init_options_array(const ipkg_conf_t *conf, ipkg_option_t **options)
++{
++ ipkg_option_t tmp[] = {
++ { "force_defaults", IPKG_OPT_TYPE_BOOL, &conf->force_defaults },
++ { "force_depends", IPKG_OPT_TYPE_BOOL, &conf->force_depends },
++ { "force_overwrite", IPKG_OPT_TYPE_BOOL, &conf->force_overwrite },
++ { "force_downgrade", IPKG_OPT_TYPE_BOOL, &conf->force_downgrade },
++ { "force_reinstall", IPKG_OPT_TYPE_BOOL, &conf->force_reinstall },
++ { "force_space", IPKG_OPT_TYPE_BOOL, &conf->force_space },
++ { "ftp_proxy", IPKG_OPT_TYPE_STRING, &conf->ftp_proxy },
++ { "http_proxy", IPKG_OPT_TYPE_STRING, &conf->http_proxy },
++ { "multiple_providers", IPKG_OPT_TYPE_BOOL, &conf->multiple_providers },
++ { "no_proxy", IPKG_OPT_TYPE_STRING, &conf->no_proxy },
++ { "test", IPKG_OPT_TYPE_INT, &conf->noaction },
++ { "noaction", IPKG_OPT_TYPE_INT, &conf->noaction },
++ { "nodeps", IPKG_OPT_TYPE_BOOL, &conf->nodeps },
++ { "offline_root", IPKG_OPT_TYPE_STRING, &conf->offline_root },
++ { "offline_root_post_script_cmd", IPKG_OPT_TYPE_STRING, &conf->offline_root_post_script_cmd },
++ { "offline_root_pre_script_cmd", IPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd },
++ { "proxy_passwd", IPKG_OPT_TYPE_STRING, &conf->proxy_passwd },
++ { "proxy_user", IPKG_OPT_TYPE_STRING, &conf->proxy_user },
++ { "query-all", IPKG_OPT_TYPE_BOOL, &conf->query_all },
++ { "verbose-wget", IPKG_OPT_TYPE_BOOL, &conf->verbose_wget },
++ { "verbosity", IPKG_OPT_TYPE_BOOL, &conf->verbosity },
++ { NULL }
++ };
++
++ *options = (ipkg_option_t *)malloc(sizeof(tmp));
++ if ( options == NULL ){
++ fprintf(stderr,"%s: Unable to allocate memory\n",__FUNCTION__);
++ return -1;
++ }
++
++ memcpy(*options, tmp, sizeof(tmp));
++ return 0;
++};
++
++static void ipkg_conf_override_string(char **conf_str, char *arg_str)
++{
++ if (arg_str) {
++ if (*conf_str) {
++ free(*conf_str);
++ }
++ *conf_str = strdup(arg_str);
++ }
++}
++
++static void ipkg_conf_free_string(char **conf_str)
++{
++ if (*conf_str) {
++ free(*conf_str);
++ *conf_str = NULL;
++ }
++}
++
++int ipkg_conf_init(ipkg_conf_t *conf, const args_t *args)
++{
++ int err;
++ char *tmp_dir_base;
++ nv_pair_list_t tmp_dest_nv_pair_list;
++ char * lists_dir =NULL;
++ glob_t globbuf;
++ const char *etc_ipkg_conf_pattern = "/etc/ipkg/*.conf";
++ char *pending_dir =NULL;
++
++ memset(conf, 0, sizeof(ipkg_conf_t));
++
++ pkg_src_list_init(&conf->pkg_src_list);
++
++ nv_pair_list_init(&tmp_dest_nv_pair_list);
++ pkg_dest_list_init(&conf->pkg_dest_list);
++
++ nv_pair_list_init(&conf->arch_list);
++
++ conf->restrict_to_default_dest = 0;
++ conf->default_dest = NULL;
++
++
++ if (args->tmp_dir)
++ tmp_dir_base = args->tmp_dir;
++ else
++ tmp_dir_base = getenv("TMPDIR");
++ sprintf_alloc(&conf->tmp_dir, "%s/%s",
++ tmp_dir_base ? tmp_dir_base : IPKG_CONF_DEFAULT_TMP_DIR_BASE,
++ IPKG_CONF_TMP_DIR_SUFFIX);
++ conf->tmp_dir = mkdtemp(conf->tmp_dir);
++ if (conf->tmp_dir == NULL) {
++ fprintf(stderr, "%s: Failed to create temporary directory `%s': %s\n",
++ __FUNCTION__, conf->tmp_dir, strerror(errno));
++ return errno;
++ }
++
++ conf->force_depends = 0;
++ conf->force_defaults = 0;
++ conf->force_overwrite = 0;
++ conf->force_downgrade = 0;
++ conf->force_reinstall = 0;
++ conf->force_space = 0;
++ conf->force_removal_of_essential_packages = 0;
++ conf->force_removal_of_dependent_packages = 0;
++ conf->nodeps = 0;
++ conf->verbose_wget = 0;
++ conf->offline_root = NULL;
++ conf->offline_root_pre_script_cmd = NULL;
++ conf->offline_root_post_script_cmd = NULL;
++ conf->multiple_providers = 0;
++ conf->verbosity = 1;
++ conf->noaction = 0;
++
++ conf->http_proxy = NULL;
++ conf->ftp_proxy = NULL;
++ conf->no_proxy = NULL;
++ conf->proxy_user = NULL;
++ conf->proxy_passwd = NULL;
++
++ pkg_hash_init("pkg-hash", &conf->pkg_hash, IPKG_CONF_DEFAULT_HASH_LEN);
++ hash_table_init("file-hash", &conf->file_hash, IPKG_CONF_DEFAULT_HASH_LEN);
++ hash_table_init("obs-file-hash", &conf->obs_file_hash, IPKG_CONF_DEFAULT_HASH_LEN);
++ lists_dir=(char *)malloc(1);
++ lists_dir[0]='\0';
++ if (args->conf_file) {
++ struct stat stat_buf;
++ err = stat(args->conf_file, &stat_buf);
++ if (err == 0)
++ if (ipkg_conf_parse_file(conf, args->conf_file,
++ &conf->pkg_src_list, &tmp_dest_nv_pair_list,&lists_dir)<0) {
++ /* Memory leakage from ipkg_conf_parse-file */
++ return -1;
++ }
++
++ }
++
++ /* if (!lists_dir ){*/
++ if (strlen(lists_dir)<=1 ){
++ lists_dir = realloc(lists_dir,strlen(IPKG_CONF_LISTS_DIR)+2);
++ sprintf (lists_dir,"%s",IPKG_CONF_LISTS_DIR);
++ }
++
++ if (args->offline_root) {
++ char *tmp = malloc(strlen(lists_dir) + strlen(args->offline_root) + 1);
++ sprintf_alloc(&tmp, "%s/%s",args->offline_root,lists_dir);
++ free(lists_dir);
++ lists_dir = tmp;
++ }
++
++ pending_dir = malloc(strlen(lists_dir)+strlen("/pending")+5);
++ snprintf(pending_dir,strlen(lists_dir)+strlen("/pending") ,"%s%s",lists_dir,"/pending");
++
++ conf->lists_dir = strdup(lists_dir);
++ conf->pending_dir = strdup(pending_dir);
++
++ if (args->offline_root)
++ sprintf_alloc(&etc_ipkg_conf_pattern, "%s/etc/ipkg/*.conf", args->offline_root);
++ memset(&globbuf, 0, sizeof(globbuf));
++ err = glob(etc_ipkg_conf_pattern, 0, NULL, &globbuf);
++ if (!err) {
++ int i;
++ for (i = 0; i < globbuf.gl_pathc; i++) {
++ if (globbuf.gl_pathv[i])
++ if ( ipkg_conf_parse_file(conf, globbuf.gl_pathv[i],
++ &conf->pkg_src_list, &tmp_dest_nv_pair_list,&lists_dir)<0) {
++ /* Memory leakage from ipkg_conf_parse-file */
++ return -1;
++ }
++ }
++ }
++ globfree(&globbuf);
++
++ /* if no architectures were defined, then default all, noarch, and host architecture */
++ if (nv_pair_list_empty(&conf->arch_list)) {
++ nv_pair_list_append(&conf->arch_list, "all", "1");
++ nv_pair_list_append(&conf->arch_list, "noarch", "1");
++ nv_pair_list_append(&conf->arch_list, HOST_CPU_STR, "10");
++ }
++
++ /* Even if there is no conf file, we'll need at least one dest. */
++ if (tmp_dest_nv_pair_list.head == NULL) {
++ nv_pair_list_append(&tmp_dest_nv_pair_list,
++ IPKG_CONF_DEFAULT_DEST_NAME,
++ IPKG_CONF_DEFAULT_DEST_ROOT_DIR);
++ }
++
++ /* After parsing the file, set options from command-line, (so that
++ command-line arguments take precedence) */
++ /* XXX: CLEANUP: The interaction between args.c and ipkg_conf.c
++ really needs to be cleaned up. There is so much duplication
++ right now it is ridiculous. Maybe ipkg_conf_t should just save
++ a pointer to args_t (which could then not be freed), rather
++ than duplicating every field here? */
++ if (args->force_depends) {
++ conf->force_depends = 1;
++ }
++ if (args->force_defaults) {
++ conf->force_defaults = 1;
++ }
++ if (args->force_overwrite) {
++ conf->force_overwrite = 1;
++ }
++ if (args->force_downgrade) {
++ conf->force_downgrade = 1;
++ }
++ if (args->force_reinstall) {
++ conf->force_reinstall = 1;
++ }
++ if (args->force_removal_of_dependent_packages) {
++ conf->force_removal_of_dependent_packages = 1;
++ }
++ if (args->force_removal_of_essential_packages) {
++ conf->force_removal_of_essential_packages = 1;
++ }
++ if (args->nodeps) {
++ conf->nodeps = 1;
++ }
++ if (args->noaction) {
++ conf->noaction = 1;
++ }
++ if (args->query_all) {
++ conf->query_all = 1;
++ }
++ if (args->verbose_wget) {
++ conf->verbose_wget = 1;
++ }
++ if (args->multiple_providers) {
++ conf->multiple_providers = 1;
++ }
++ if (args->verbosity != conf->verbosity) {
++ conf->verbosity = args->verbosity;
++ }
++
++ ipkg_conf_override_string(&conf->offline_root,
++ args->offline_root);
++ ipkg_conf_override_string(&conf->offline_root_pre_script_cmd,
++ args->offline_root_pre_script_cmd);
++ ipkg_conf_override_string(&conf->offline_root_post_script_cmd,
++ args->offline_root_post_script_cmd);
++
++/* Pigi: added a flag to disable the checking of structures if the command does not need to
++ read anything from there.
++*/
++ if ( !(args->nocheckfordirorfile)){
++ /* need to run load the source list before dest list -Jamey */
++ if ( !(args->noreadfeedsfile))
++ set_and_load_pkg_src_list(conf, &conf->pkg_src_list);
++
++ /* Now that we have resolved conf->offline_root, we can commit to
++ the directory names for the dests and load in all the package
++ lists. */
++ set_and_load_pkg_dest_list(conf, &tmp_dest_nv_pair_list,lists_dir);
++
++ if (args->dest) {
++ err = ipkg_conf_set_default_dest(conf, args->dest);
++ if (err) {
++ return err;
++ }
++ }
++ }
++ nv_pair_list_deinit(&tmp_dest_nv_pair_list);
++ free(lists_dir);
++ free(pending_dir);
++
++ return 0;
++}
++
++void ipkg_conf_deinit(ipkg_conf_t *conf)
++{
++#ifdef IPKG_DEBUG_NO_TMP_CLEANUP
++#error
++ fprintf(stderr, "%s: Not cleaning up %s since ipkg compiled "
++ "with IPKG_DEBUG_NO_TMP_CLEANUP\n",
++ __FUNCTION__, conf->tmp_dir);
++#else
++ int err;
++
++ err = rmdir(conf->tmp_dir);
++ if (err) {
++ if (errno == ENOTEMPTY) {
++ char *cmd;
++ sprintf_alloc(&cmd, "rm -fr %s\n", conf->tmp_dir);
++ err = xsystem(cmd);
++ free(cmd);
++ }
++ if (err)
++ fprintf(stderr, "WARNING: Unable to remove temporary directory: %s: %s\n", conf->tmp_dir, strerror(errno));
++ }
++#endif /* IPKG_DEBUG_NO_TMP_CLEANUP */
++
++ free(conf->tmp_dir); /*XXX*/
++
++ pkg_src_list_deinit(&conf->pkg_src_list);
++ pkg_dest_list_deinit(&conf->pkg_dest_list);
++ nv_pair_list_deinit(&conf->arch_list);
++ if (&conf->pkg_hash)
++ pkg_hash_deinit(&conf->pkg_hash);
++ if (&conf->file_hash)
++ hash_table_deinit(&conf->file_hash);
++ if (&conf->obs_file_hash)
++ hash_table_deinit(&conf->obs_file_hash);
++
++ ipkg_conf_free_string(&conf->offline_root);
++ ipkg_conf_free_string(&conf->offline_root_pre_script_cmd);
++ ipkg_conf_free_string(&conf->offline_root_post_script_cmd);
++
++ if (conf->verbosity > 1) {
++ int i;
++ hash_table_t *hashes[] = {
++ &conf->pkg_hash,
++ &conf->file_hash,
++ &conf->obs_file_hash };
++ for (i = 0; i < 3; i++) {
++ hash_table_t *hash = hashes[i];
++ int c = 0;
++ int n_conflicts = 0;
++ int j;
++ for (j = 0; j < hash->n_entries; j++) {
++ int len = 0;
++ hash_entry_t *e = &hash->entries[j];
++ if (e->next)
++ n_conflicts++;
++ while (e && e->key) {
++ len++;
++ e = e->next;
++ }
++ if (len > c)
++ c = len;
++ }
++ ipkg_message(conf, IPKG_DEBUG, "hash_table[%s] n_buckets=%d n_elements=%d max_conflicts=%d n_conflicts=%d\n",
++ hash->name, hash->n_entries, hash->n_elements, c, n_conflicts);
++ hash_table_deinit(hash);
++ }
++ }
++}
++
++static int ipkg_conf_set_default_dest(ipkg_conf_t *conf,
++ const char *default_dest_name)
++{
++ pkg_dest_list_elt_t *iter;
++ pkg_dest_t *dest;
++
++ for (iter = conf->pkg_dest_list.head; iter; iter = iter->next) {
++ dest = iter->data;
++ if (strcmp(dest->name, default_dest_name) == 0) {
++ conf->default_dest = dest;
++ conf->restrict_to_default_dest = 1;
++ return 0;
++ }
++ }
++
++ fprintf(stderr, "ERROR: Unknown dest name: `%s'\n", default_dest_name);
++
++ return 1;
++}
++
++static int set_and_load_pkg_src_list(ipkg_conf_t *conf, pkg_src_list_t *pkg_src_list)
++{
++ pkg_src_list_elt_t *iter;
++ pkg_src_t *src;
++ char *list_file;
++
++ for (iter = pkg_src_list->head; iter; iter = iter->next) {
++ src = iter->data;
++ if (src == NULL) {
++ continue;
++ }
++
++ sprintf_alloc(&list_file, "%s/%s",
++ conf->restrict_to_default_dest ? conf->default_dest->lists_dir : conf->lists_dir,
++ src->name);
++
++ if (file_exists(list_file)) {
++ pkg_hash_add_from_file(conf, list_file, src, NULL, 0);
++ }
++ free(list_file);
++ }
++
++ return 0;
++}
++
++static int set_and_load_pkg_dest_list(ipkg_conf_t *conf, nv_pair_list_t *nv_pair_list, char *lists_dir )
++{
++ nv_pair_list_elt_t *iter;
++ nv_pair_t *nv_pair;
++ pkg_dest_t *dest;
++ char *root_dir;
++
++ for (iter = nv_pair_list->head; iter; iter = iter->next) {
++ nv_pair = iter->data;
++
++ if (conf->offline_root) {
++ sprintf_alloc(&root_dir, "%s%s", conf->offline_root, nv_pair->value);
++ } else {
++ root_dir = strdup(nv_pair->value);
++ }
++ dest = pkg_dest_list_append(&conf->pkg_dest_list, nv_pair->name, root_dir, lists_dir);
++ free(root_dir);
++ if (dest == NULL) {
++ continue;
++ }
++ if (conf->default_dest == NULL) {
++ conf->default_dest = dest;
++ }
++ if (file_exists(dest->status_file_name)) {
++ pkg_hash_add_from_file(conf, dest->status_file_name,
++ NULL, dest, 1);
++ }
++ }
++
++ return 0;
++}
++
++static int ipkg_conf_parse_file(ipkg_conf_t *conf, const char *filename,
++ pkg_src_list_t *pkg_src_list,
++ nv_pair_list_t *tmp_dest_nv_pair_list,
++ char **lists_dir)
++{
++ ipkg_option_t * options;
++ FILE *file = fopen(filename, "r");
++ regex_t valid_line_re, comment_re;
++#define regmatch_size 12
++ regmatch_t regmatch[regmatch_size];
++
++ if (ipkg_init_options_array(conf, &options)<0)
++ return ENOMEM;
++
++ if (file == NULL) {
++ fprintf(stderr, "%s: failed to open %s: %s\n",
++ __FUNCTION__, filename, strerror(errno));
++ free(options);
++ return errno;
++ }
++ ipkg_message(conf, IPKG_NOTICE, "loading conf file %s\n", filename);
++
++ xregcomp(&comment_re,
++ "^[[:space:]]*(#.*|[[:space:]]*)$",
++ REG_EXTENDED);
++ xregcomp(&valid_line_re, "^[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))([[:space:]]+([^[:space:]]+))?[[:space:]]*$", REG_EXTENDED);
++
++ while(1) {
++ int line_num = 0;
++ char *line;
++ char *type, *name, *value, *extra;
++
++ line = file_read_line_alloc(file);
++ line_num++;
++ if (line == NULL) {
++ break;
++ }
++
++ str_chomp(line);
++
++ if (regexec(&comment_re, line, 0, 0, 0) == 0) {
++ goto NEXT_LINE;
++ }
++
++ if (regexec(&valid_line_re, line, regmatch_size, regmatch, 0) == REG_NOMATCH) {
++ str_chomp(line);
++ fprintf(stderr, "%s:%d: Ignoring invalid line: `%s'\n",
++ filename, line_num, line);
++ goto NEXT_LINE;
++ }
++
++ /* This has to be so ugly to deal with optional quotation marks */
++ if (regmatch[2].rm_so > 0) {
++ type = strndup(line + regmatch[2].rm_so,
++ regmatch[2].rm_eo - regmatch[2].rm_so);
++ } else {
++ type = strndup(line + regmatch[3].rm_so,
++ regmatch[3].rm_eo - regmatch[3].rm_so);
++ }
++ if (regmatch[5].rm_so > 0) {
++ name = strndup(line + regmatch[5].rm_so,
++ regmatch[5].rm_eo - regmatch[5].rm_so);
++ } else {
++ name = strndup(line + regmatch[6].rm_so,
++ regmatch[6].rm_eo - regmatch[6].rm_so);
++ }
++ if (regmatch[8].rm_so > 0) {
++ value = strndup(line + regmatch[8].rm_so,
++ regmatch[8].rm_eo - regmatch[8].rm_so);
++ } else {
++ value = strndup(line + regmatch[9].rm_so,
++ regmatch[9].rm_eo - regmatch[9].rm_so);
++ }
++ extra = NULL;
++ if (regmatch[11].rm_so > 0) {
++ extra = strndup (line + regmatch[11].rm_so,
++ regmatch[11].rm_eo - regmatch[11].rm_so);
++ }
++
++ /* We use the tmp_dest_nv_pair_list below instead of
++ conf->pkg_dest_list because we might encounter an
++ offline_root option later and that would invalidate the
++ directories we would have computed in
++ pkg_dest_list_init. (We do a similar thing with
++ tmp_src_nv_pair_list for sake of symmetry.) */
++ if (strcmp(type, "option") == 0) {
++ ipkg_conf_set_option(options, name, value);
++ } else if (strcmp(type, "src") == 0) {
++ if (!nv_pair_list_find((nv_pair_list_t *)pkg_src_list, name)) {
++ pkg_src_list_append (pkg_src_list, name, value, extra, 0);
++ } else {
++ ipkg_message(conf, IPKG_ERROR, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
++ name, value);
++ }
++ } else if (strcmp(type, "src/gz") == 0) {
++ if (!nv_pair_list_find((nv_pair_list_t *)pkg_src_list, name)) {
++ pkg_src_list_append (pkg_src_list, name, value, extra, 1);
++ } else {
++ ipkg_message(conf, IPKG_ERROR, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
++ name, value);
++ }
++ } else if (strcmp(type, "dest") == 0) {
++ nv_pair_list_append(tmp_dest_nv_pair_list, name, value);
++ } else if (strcmp(type, "lists_dir") == 0) {
++ *lists_dir = realloc(*lists_dir,strlen(value)+1);
++ if (*lists_dir == NULL) {
++ ipkg_message(conf, IPKG_ERROR, "ERROR: Not enough memory\n");
++ free(options);
++ return EINVAL;
++ }
++ sprintf (*lists_dir,"%s",value);
++ } else if (strcmp(type, "arch") == 0) {
++ ipkg_message(conf, IPKG_INFO, "supported arch %s priority (%s)\n", name, value);
++ if (!value) {
++ ipkg_message(conf, IPKG_NOTICE, "defaulting architecture %s priority to 10\n", name);
++ value = strdup("10");
++ }
++ nv_pair_list_append(&conf->arch_list, strdup(name), strdup(value));
++ } else {
++ fprintf(stderr, "WARNING: Ignoring unknown configuration "
++ "parameter: %s %s %s\n", type, name, value);
++ free(options);
++ return EINVAL;
++ }
++
++ free(type);
++ free(name);
++ free(value);
++ if (extra)
++ free (extra);
++
++ NEXT_LINE:
++ free(line);
++ }
++
++ free(options);
++ regfree(&comment_re);
++ regfree(&valid_line_re);
++ fclose(file);
++
++ return 0;
++}
++
++static int ipkg_conf_set_option(const ipkg_option_t *options,
++ const char *name, const char *value)
++{
++ int i = 0;
++ while (options[i].name) {
++ if (strcmp(options[i].name, name) == 0) {
++ switch (options[i].type) {
++ case IPKG_OPT_TYPE_BOOL:
++ *((int *)options[i].value) = 1;
++ return 0;
++ case IPKG_OPT_TYPE_INT:
++ if (value) {
++ *((int *)options[i].value) = atoi(value);
++ return 0;
++ } else {
++ printf("%s: Option %s need an argument\n",
++ __FUNCTION__, name);
++ return EINVAL;
++ }
++ case IPKG_OPT_TYPE_STRING:
++ if (value) {
++ *((char **)options[i].value) = strdup(value);
++ return 0;
++ } else {
++ printf("%s: Option %s need an argument\n",
++ __FUNCTION__, name);
++ return EINVAL;
++ }
++ }
++ }
++ i++;
++ }
++
++ fprintf(stderr, "%s: Unrecognized option: %s=%s\n",
++ __FUNCTION__, name, value);
++ return EINVAL;
++}
++
++int ipkg_conf_write_status_files(ipkg_conf_t *conf)
++{
++ pkg_dest_list_elt_t *iter;
++ pkg_dest_t *dest;
++ pkg_vec_t *all;
++ pkg_t *pkg;
++ register int i;
++ int err;
++
++ if (conf->noaction)
++ return 0;
++ for (iter = conf->pkg_dest_list.head; iter; iter = iter->next) {
++ dest = iter->data;
++ dest->status_file = fopen(dest->status_file_tmp_name, "w");
++ if (dest->status_file == NULL) {
++ fprintf(stderr, "%s: Can't open status file: %s for writing: %s\n",
++ __FUNCTION__, dest->status_file_name, strerror(errno));
++ }
++ }
++
++ all = pkg_vec_alloc();
++ pkg_hash_fetch_available(&conf->pkg_hash, all);
++
++ for(i = 0; i < all->len; i++) {
++ pkg = all->pkgs[i];
++ /* We don't need most uninstalled packages in the status file */
++ if (pkg->state_status == SS_NOT_INSTALLED
++ && (pkg->state_want == SW_UNKNOWN
++ || pkg->state_want == SW_DEINSTALL
++ || pkg->state_want == SW_PURGE)) {
++ continue;
++ }
++ if (!pkg) {
++ fprintf(stderr, "Null package\n");
++ }
++ if (pkg->dest == NULL) {
++ fprintf(stderr, "%s: ERROR: Can't write status for "
++ "package %s since it has a NULL dest\n",
++ __FUNCTION__, pkg->name);
++ continue;
++ }
++ if (pkg->dest->status_file) {
++ pkg_print_status(pkg, pkg->dest->status_file);
++ }
++ }
++
++ pkg_vec_free(all);
++
++ for (iter = conf->pkg_dest_list.head; iter; iter = iter->next) {
++ dest = iter->data;
++ if (dest->status_file) {
++ err = ferror(dest->status_file);
++ fclose(dest->status_file);
++ dest->status_file = NULL;
++ if (!err) {
++ file_move(dest->status_file_tmp_name, dest->status_file_name);
++ } else {
++ fprintf(stderr, "%s: ERROR: An error has occurred writing %s, "
++ "retaining old %s\n", __FUNCTION__,
++ dest->status_file_tmp_name, dest->status_file_name);
++ }
++ }
++ }
++
++ return 0;
++}
++
++
++char *root_filename_alloc(ipkg_conf_t *conf, char *filename)
++{
++ char *root_filename;
++ sprintf_alloc(&root_filename, "%s%s", (conf->offline_root ? conf->offline_root : ""), filename);
++ return root_filename;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_conf.h busybox-1.12.1/archival/libipkg/ipkg_conf.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_conf.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_conf.h 2008-10-23 13:41:34.000000000 +0200
+@@ -0,0 +1,107 @@
++/* ipkg_conf.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_CONF_H
++#define IPKG_CONF_H
++
++typedef struct ipkg_conf ipkg_conf_t;
++
++#include "hash_table.h"
++#include "ipkg.h"
++#include "args.h"
++#include "pkg.h"
++#include "pkg_hash.h"
++#include "pkg_src_list.h"
++#include "pkg_dest_list.h"
++#include "nv_pair_list.h"
++
++#define IPKG_CONF_DEFAULT_TMP_DIR_BASE "/tmp"
++#define IPKG_CONF_TMP_DIR_SUFFIX "ipkg-XXXXXX"
++#define IPKG_CONF_LISTS_DIR IPKG_STATE_DIR_PREFIX "/lists"
++#define IPKG_CONF_PENDING_DIR IPKG_STATE_DIR_PREFIX "/pending"
++
++/* In case the config file defines no dest */
++#define IPKG_CONF_DEFAULT_DEST_NAME "root"
++#define IPKG_CONF_DEFAULT_DEST_ROOT_DIR "/"
++
++#define IPKG_CONF_DEFAULT_HASH_LEN 1024
++
++struct ipkg_conf
++{
++ pkg_src_list_t pkg_src_list;
++ pkg_dest_list_t pkg_dest_list;
++ nv_pair_list_t arch_list;
++
++ int restrict_to_default_dest;
++ pkg_dest_t *default_dest;
++
++ char *tmp_dir;
++ char *lists_dir;
++ char *pending_dir;
++
++ /* options */
++ int force_depends;
++ int force_defaults;
++ int force_overwrite;
++ int force_downgrade;
++ int force_reinstall;
++ int force_space;
++ int force_removal_of_dependent_packages;
++ int force_removal_of_essential_packages;
++ int nodeps; /* do not follow dependences */
++ int verbose_wget;
++ int multiple_providers;
++ char *offline_root;
++ char *offline_root_pre_script_cmd;
++ char *offline_root_post_script_cmd;
++ int query_all;
++ int verbosity;
++ int noaction;
++
++ /* proxy options */
++ char *http_proxy;
++ char *ftp_proxy;
++ char *no_proxy;
++ char *proxy_user;
++ char *proxy_passwd;
++
++ hash_table_t pkg_hash;
++ hash_table_t file_hash;
++ hash_table_t obs_file_hash;
++};
++
++enum ipkg_option_type {
++ IPKG_OPT_TYPE_BOOL,
++ IPKG_OPT_TYPE_INT,
++ IPKG_OPT_TYPE_STRING
++};
++typedef enum ipkg_option_type ipkg_option_type_t;
++
++typedef struct ipkg_option ipkg_option_t;
++struct ipkg_option {
++ const char *name;
++ const ipkg_option_type_t type;
++ const void *value;
++};
++
++int ipkg_conf_init(ipkg_conf_t *conf, const args_t *args);
++void ipkg_conf_deinit(ipkg_conf_t *conf);
++
++int ipkg_conf_write_status_files(ipkg_conf_t *conf);
++char *root_filename_alloc(ipkg_conf_t *conf, char *filename);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_configure.c busybox-1.12.1/archival/libipkg/ipkg_configure.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_configure.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_configure.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,40 @@
++/* ipkg_configure.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "ipkg_configure.h"
++
++int ipkg_configure(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ int err;
++
++ /* DPKG_INCOMPATIBILITY:
++ dpkg actually does some conffile handling here, rather than at the
++ end of ipkg_install(). Do we care? */
++ /* DPKG_INCOMPATIBILITY:
++ dpkg actually includes a version number to this script call */
++ err = pkg_run_script(conf, pkg, "postinst", "configure");
++ if (err) {
++ printf("ERROR: %s.postinst returned %d\n", pkg->name, err);
++ return err;
++ }
++
++ ipkg_state_changed++;
++ return 0;
++}
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_configure.h busybox-1.12.1/archival/libipkg/ipkg_configure.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_configure.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_configure.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,25 @@
++/* ipkg_configure.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_CONFIGURE_H
++#define IPKG_CONFIGURE_H
++
++#include "ipkg_conf.h"
++
++int ipkg_configure(ipkg_conf_t *ipkg_conf, pkg_t *pkg);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_download.c busybox-1.12.1/archival/libipkg/ipkg_download.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_download.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_download.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,195 @@
++/* ipkg_download.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include "ipkg_download.h"
++#include "ipkg_message.h"
++
++#include "sprintf_alloc.h"
++#include "xsystem.h"
++#include "file_util.h"
++#include "str_util.h"
++
++int ipkg_download(ipkg_conf_t *conf, const char *src, const char *dest_file_name)
++{
++ int err = 0;
++
++ char *src_basec = strdup(src);
++ char *src_base = basename(src_basec);
++ char *tmp_file_location;
++ char *cmd;
++
++ ipkg_message(conf,IPKG_NOTICE,"Downloading %s\n", src);
++
++ fflush(stdout);
++
++ if (str_starts_with(src, "file:")) {
++ int ret;
++ const char *file_src = src + 5;
++ ipkg_message(conf,IPKG_INFO,"Copying %s to %s...", file_src, dest_file_name);
++ ret = file_copy(src + 5, dest_file_name);
++ ipkg_message(conf,IPKG_INFO,"Done.\n");
++ return ret;
++ }
++
++ sprintf_alloc(&tmp_file_location, "%s/%s", conf->tmp_dir, src_base);
++ err = unlink(tmp_file_location);
++ if (err && errno != ENOENT) {
++ ipkg_message(conf,IPKG_ERROR, "%s: ERROR: failed to unlink %s: %s\n",
++ __FUNCTION__, tmp_file_location, strerror(errno));
++ free(tmp_file_location);
++ return errno;
++ }
++
++ if (conf->http_proxy) {
++ ipkg_message(conf,IPKG_DEBUG,"Setting environment variable: http_proxy = %s\n", conf->http_proxy);
++ setenv("http_proxy", conf->http_proxy, 1);
++ }
++ if (conf->ftp_proxy) {
++ ipkg_message(conf,IPKG_DEBUG,"Setting environment variable: ftp_proxy = %s\n", conf->ftp_proxy);
++ setenv("ftp_proxy", conf->ftp_proxy, 1);
++ }
++ if (conf->no_proxy) {
++ ipkg_message(conf,IPKG_DEBUG,"Setting environment variable: no_proxy = %s\n", conf->no_proxy);
++ setenv("no_proxy", conf->no_proxy, 1);
++ }
++
++ /* XXX: BUG rewrite to use execvp or else busybox's internal wget -Jamey 7/23/2002 */
++ sprintf_alloc(&cmd, "wget --passive-ftp %s %s%s %s%s %s -P %s %s",
++ (conf->http_proxy || conf->ftp_proxy) ? "--proxy=on" : "",
++ conf->proxy_user ? "--proxy-user=" : "",
++ conf->proxy_user ? conf->proxy_user : "",
++ conf->proxy_passwd ? "--proxy-passwd=" : "",
++ conf->proxy_passwd ? conf->proxy_passwd : "",
++ conf->verbose_wget ? "" : "-q",
++ conf->tmp_dir,
++ src);
++ err = xsystem(cmd);
++ if (err) {
++ if (err != -1) {
++ ipkg_message(conf,IPKG_ERROR, "%s: ERROR: Command failed with return value %d: `%s'\n",
++ __FUNCTION__, err, cmd);
++ }
++ unlink(tmp_file_location);
++ free(tmp_file_location);
++ free(src_basec);
++ free(cmd);
++ return EINVAL;
++ }
++ free(cmd);
++
++ err = file_move(tmp_file_location, dest_file_name);
++
++ free(tmp_file_location);
++ free(src_basec);
++
++ if (err) {
++ return err;
++ }
++
++ return 0;
++}
++
++int ipkg_download_pkg(ipkg_conf_t *conf, pkg_t *pkg, const char *dir)
++{
++ int err;
++ char *url;
++
++ if (pkg->src == NULL) {
++ ipkg_message(conf,IPKG_ERROR, "ERROR: Package %s (parent %s) is not available from any configured src.\n",
++ pkg->name, pkg->parent->name);
++ return -1;
++ }
++
++ sprintf_alloc(&url, "%s/%s", pkg->src->value, pkg->filename);
++
++ /* XXX: BUG: The pkg->filename might be something like
++ "../../foo.ipk". While this is correct, and exactly what we
++ want to use to construct url above, here we actually need to
++ use just the filename part, without any directory. */
++ sprintf_alloc(&pkg->local_filename, "%s/%s", dir, pkg->filename);
++
++ err = ipkg_download(conf, url, pkg->local_filename);
++ free(url);
++
++ return err;
++}
++
++/*
++ * Downloads file from url, installs in package database, return package name.
++ */
++int ipkg_prepare_url_for_install(ipkg_conf_t *conf, const char *url, char **namep)
++{
++ int err = 0;
++ pkg_t *pkg;
++ pkg = pkg_new();
++ if (pkg == NULL)
++ return ENOMEM;
++
++ if (str_starts_with(url, "http://")
++ || str_starts_with(url, "ftp://")) {
++ char *tmp_file;
++ char *file_basec = strdup(url);
++ char *file_base = basename(file_basec);
++
++ sprintf_alloc(&tmp_file, "%s/%s", conf->tmp_dir, file_base);
++ err = ipkg_download(conf, url, tmp_file);
++ if (err)
++ return err;
++
++ err = pkg_init_from_file(pkg, tmp_file);
++ if (err)
++ return err;
++ pkg->local_filename = strdup(tmp_file);
++
++ free(tmp_file);
++ free(file_basec);
++
++ } else if (strcmp(&url[strlen(url) - 4], IPKG_PKG_EXTENSION) == 0
++ || strcmp(&url[strlen(url) - 4], DPKG_PKG_EXTENSION) == 0) {
++
++ err = pkg_init_from_file(pkg, url);
++ if (err)
++ return err;
++ pkg->local_filename = strdup(url);
++ ipkg_message(conf, IPKG_DEBUG2, "Package %s provided by hand (%s).\n", pkg->name,pkg->local_filename);
++ pkg->provided_by_hand = 1;
++
++ } else {
++ pkg_deinit(pkg);
++ free(pkg);
++ return 0;
++ }
++
++ if (!pkg->architecture) {
++ ipkg_message(conf, IPKG_ERROR, "Package %s has no Architecture defined.\n", pkg->name);
++ return -EINVAL;
++ }
++
++ pkg->dest = conf->default_dest;
++ pkg->state_want = SW_INSTALL;
++ pkg->state_flag |= SF_PREFER;
++ pkg = hash_insert_pkg(&conf->pkg_hash, pkg, 1,conf);
++ if ( pkg == NULL ){
++ fprintf(stderr, "%s : This should never happen. Report this Bug in bugzilla please \n ",__FUNCTION__);
++ return 0;
++ }
++ if (namep) {
++ *namep = strdup(pkg->name);
++ }
++ return 0;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_download.h busybox-1.12.1/archival/libipkg/ipkg_download.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_download.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_download.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,30 @@
++/* ipkg_download.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_DOWNLOAD_H
++#define IPKG_DOWNLOAD_H
++
++#include "ipkg_conf.h"
++
++int ipkg_download(ipkg_conf_t *conf, const char *src, const char *dest_file_name);
++int ipkg_download_pkg(ipkg_conf_t *conf, pkg_t *pkg, const char *dir);
++/*
++ * Downloads file from url, installs in package database, return package name.
++ */
++int ipkg_prepare_url_for_install(ipkg_conf_t *conf, const char *url, char **namep);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg.h busybox-1.12.1/archival/libipkg/ipkg.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg.h 2008-10-23 13:40:24.000000000 +0200
+@@ -0,0 +1,66 @@
++/* ipkg.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_H
++#define IPKG_H
++
++#include "libbb.h"
++
++#include "ipkg_includes.h"
++#include "ipkg_conf.h"
++#include "ipkg_message.h"
++
++#define IPKG_PKG_EXTENSION ".ipk"
++#define DPKG_PKG_EXTENSION ".deb"
++
++#define IPKG_LEGAL_PKG_NAME_CHARS "abcdefghijklmnopqrstuvwxyz0123456789.+-"
++#define IPKG_PKG_VERSION_SEP_CHAR '_'
++
++#define IPKG_STATE_DIR_PREFIX IPKGLIBDIR"/ipkg"
++#define IPKG_LISTS_DIR_SUFFIX "lists"
++#define IPKG_INFO_DIR_SUFFIX "info"
++#define IPKG_STATUS_FILE_SUFFIX "status"
++
++#define IPKG_BACKUP_SUFFIX "-ipkg.backup"
++
++#define IPKG_LIST_DESCRIPTION_LENGTH 128
++
++#define IPKG_VERSION "1.00"
++
++
++enum ipkg_error {
++ IPKG_SUCCESS = 0,
++ IPKG_PKG_DEPS_UNSATISFIED,
++ IPKG_PKG_IS_ESSENTIAL,
++ IPKG_PKG_HAS_DEPENDENTS,
++ IPKG_PKG_HAS_NO_CANDIDATE
++};
++typedef enum ipkg_error ipkg_error_t;
++
++extern int ipkg_state_changed;
++
++
++struct errlist {
++ char * errmsg;
++ struct errlist * next;
++} ;
++
++extern struct errlist* error_list;
++
++extern ipkg_conf_t *global_conf;
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_includes.h busybox-1.12.1/archival/libipkg/ipkg_includes.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_includes.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_includes.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,79 @@
++#ifndef IPKG_INCLUDES_H
++#define IPKG_INCLUDES_H
++
++/* Define to 1 if you have the <memory.h> header file. */
++#define HAVE_MEMORY_H 1
++
++/* Define to 1 if you have the <regex.h> header file. */
++#define HAVE_REGEX_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 <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 <sys/stat.h> header file. */
++#define HAVE_SYS_STAT_H 1
++
++/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
++#define HAVE_SYS_WAIT_H 1
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#define HAVE_UNISTD_H 1
++
++/* Define to 1 if you have the ANSI C header files. */
++#define STDC_HEADERS 1
++
++
++#include <stdio.h>
++
++#if STDC_HEADERS
++# include <stdlib.h>
++# include <stdarg.h>
++# include <stddef.h>
++# include <ctype.h>
++# include <errno.h>
++#else
++# if HAVE_STDLIB_H
++# include <stdlib.h>
++# endif
++#endif
++
++#if HAVE_REGEX_H
++# include <regex.h>
++#endif
++
++#if HAVE_STRING_H
++# if !STDC_HEADERS && HAVE_MEMORY_H
++# include <memory.h>
++# endif
++/* XXX: What's the right way to pick up GNU's strndup declaration? */
++# if __GNUC__
++# define __USE_GNU 1
++# endif
++# include <string.h>
++# undef __USE_GNU
++#endif
++
++#if HAVE_STRINGS_H
++# include <strings.h>
++#endif
++
++#if HAVE_SYS_STAT_H
++# include <sys/stat.h>
++#endif
++
++#if HAVE_SYS_WAIT_H
++# include <sys/wait.h>
++#endif
++
++#if HAVE_UNISTD_H
++# include <sys/types.h>
++# include <unistd.h>
++#endif
++
++#endif /* IPKG_INCLUDES_H */
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_install.c busybox-1.12.1/archival/libipkg/ipkg_install.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_install.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_install.c 2008-10-23 15:07:04.000000000 +0200
+@@ -0,0 +1,1982 @@
++/* ipkg_install.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <errno.h>
++#include <dirent.h>
++#include <glob.h>
++#include <time.h>
++#include <signal.h>
++typedef void (*sighandler_t)(int);
++
++#include "pkg.h"
++#include "pkg_hash.h"
++#include "pkg_extract.h"
++
++#include "ipkg_install.h"
++#include "ipkg_configure.h"
++#include "ipkg_download.h"
++#include "ipkg_remove.h"
++
++#include "ipkg_utils.h"
++#include "ipkg_message.h"
++
++#include "sprintf_alloc.h"
++#include "file_util.h"
++#include "str_util.h"
++#include "xsystem.h"
++#include "user.h"
++
++int satisfy_dependencies_for(ipkg_conf_t *conf, pkg_t *pkg);
++static int verify_pkg_installable(ipkg_conf_t *conf, pkg_t *pkg);
++static int unpack_pkg_control_files(ipkg_conf_t *conf, pkg_t *pkg);
++
++/*
++static int prerm_upgrade_old_pkg(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int prerm_upgrade_old_pkg_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int prerm_deconfigure_conflictors(ipkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *conflictors);
++static int prerm_deconfigure_conflictors_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *conflictors);
++static int preinst_configure_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int check_data_file_clashes_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int postrm_upgrade_old_pkg(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int remove_disappeared(ipkg_conf_t *conf, pkg_t *pkg);
++static int postrm_upgrade_old_pkg_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++*/
++static int preinst_configure(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int check_data_file_clashes(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int check_data_file_clashes_change(ipkg_conf_t *conf, pkg_t *pkg);
++static int backup_modified_conffiles(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int backup_modified_conffiles_unwind(pkg_t *pkg, pkg_t *old_pkg);
++
++static int remove_obsolesced_files(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int install_maintainer_scripts(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg);
++static int install_data_files(ipkg_conf_t *conf, pkg_t *pkg);
++static int resolve_conffiles(ipkg_conf_t *conf, pkg_t *pkg);
++
++static int cleanup_temporary_files(ipkg_conf_t *conf, pkg_t *pkg);
++
++static int user_prefers_old_conffile(const char *file, const char *backup);
++
++static char *backup_filename_alloc(const char *file_name);
++static int backup_make_backup(ipkg_conf_t *conf, const char *file_name);
++static int backup_exists_for(const char *file_name);
++static int backup_remove(const char *file_name);
++
++int pkg_get_installed_replacees(pkg_t *pkg, pkg_vec_t *installed_replacees);
++int pkg_remove_installed_replacees(ipkg_conf_t *conf, pkg_vec_t *replacees);
++int pkg_remove_installed_replacees_unwind(ipkg_conf_t *conf, pkg_vec_t *replacees);
++
++int ipkg_install_from_file(ipkg_conf_t *conf, const char *filename)
++{
++ int err, cmp;
++ pkg_t *pkg, *old;
++ char *old_version, *new_version;
++
++ pkg = pkg_new();
++ if (pkg == NULL) {
++ return ENOMEM;
++ }
++
++ err = pkg_init_from_file(pkg, filename);
++ if (err) {
++ return err;
++ }
++
++ if (!pkg->architecture) {
++ ipkg_message(conf, IPKG_ERROR, "Package %s has no Architecture defined.\n", pkg->name);
++ return -EINVAL;
++ }
++
++ /* XXX: CLEANUP: hash_insert_pkg has a nasty side effect of possibly
++ freeing the pkg that we pass in. It might be nice to clean this up
++ if possible. */
++ pkg = hash_insert_pkg(&conf->pkg_hash, pkg, 1,conf);
++ old = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, pkg->name);
++
++ pkg->local_filename = strdup(filename);
++
++ if (old) {
++ old_version = pkg_version_str_alloc(old);
++ new_version = pkg_version_str_alloc(pkg);
++
++ cmp = pkg_compare_versions(old, pkg);
++ if ( (conf->force_downgrade==1) && (cmp > 0) ){ /* We've been asked to allow downgrade and version is precedent */
++ cmp = -1 ; /* then we force ipkg to downgrade */
++ /* We need to use a value < 0 because in the 0 case we are asking to */
++ /* reinstall, and some check could fail asking the "force-reinstall" option */
++ }
++ if (cmp > 0) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Not downgrading package %s on %s from %s to %s.\n",
++ old->name, old->dest->name, old_version, new_version);
++ pkg->state_want = SW_DEINSTALL;
++ pkg->state_flag |= SF_OBSOLETE;
++ free(old_version);
++ free(new_version);
++ return 0;
++ } else {
++ free(old_version);
++ free(new_version);
++ }
++ }
++
++ ipkg_message(conf, IPKG_DEBUG2,"Function: %s calling ipkg_install_pkg \n",__FUNCTION__);
++ return ipkg_install_pkg(conf, pkg,0);
++}
++
++ipkg_error_t ipkg_install_by_name(ipkg_conf_t *conf, const char *pkg_name)
++{
++ int cmp;
++ pkg_t *old, *new;
++ char *old_version, *new_version;
++
++ ipkg_message(conf, IPKG_DEBUG2, " Getting old from pkg_hash_fetch \n" );
++ old = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, pkg_name);
++ if ( old )
++ ipkg_message(conf, IPKG_DEBUG2, " Old versions from pkg_hash_fetch %s \n", old->version );
++
++ ipkg_message(conf, IPKG_DEBUG2, " Getting new from pkg_hash_fetch \n" );
++ new = pkg_hash_fetch_best_installation_candidate_by_name(conf, pkg_name);
++ if ( new )
++ ipkg_message(conf, IPKG_DEBUG2, " New versions from pkg_hash_fetch %s \n", new->version );
++
++/* Pigi Basically here is broken the version stuff.
++ What's happening is that nothing provide the version to differents
++ functions, so the returned struct is always the latest.
++ That's why the install by name don't work.
++*/
++ ipkg_message(conf, IPKG_DEBUG2, " Versions from pkg_hash_fetch in %s ", __FUNCTION__ );
++
++ if ( old )
++ ipkg_message(conf, IPKG_DEBUG2, " old %s ", old->version );
++ if ( new )
++ ipkg_message(conf, IPKG_DEBUG2, " new %s ", new->version );
++ ipkg_message(conf, IPKG_DEBUG2, " \n");
++
++ if (new == NULL) {
++ return IPKG_PKG_HAS_NO_CANDIDATE;
++ }
++
++ new->state_flag |= SF_USER;
++ if (old) {
++ old_version = pkg_version_str_alloc(old);
++ new_version = pkg_version_str_alloc(new);
++
++ cmp = pkg_compare_versions(old, new);
++ if ( (conf->force_downgrade==1) && (cmp > 0) ){ /* We've been asked to allow downgrade and version is precedent */
++ ipkg_message(conf, IPKG_DEBUG, " Forcing downgrade \n");
++ cmp = -1 ; /* then we force ipkg to downgrade */
++ /* We need to use a value < 0 because in the 0 case we are asking to */
++ /* reinstall, and some check could fail asking the "force-reinstall" option */
++ }
++ ipkg_message(conf, IPKG_DEBUG,
++ "Comparing visible versions of pkg %s:"
++ "\n\t%s is installed "
++ "\n\t%s is available "
++ "\n\t%d was comparison result\n",
++ pkg_name, old_version, new_version, cmp);
++ if (cmp == 0 && !conf->force_reinstall) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Package %s (%s) installed in %s is up to date.\n",
++ old->name, old_version, old->dest->name);
++ free(old_version);
++ free(new_version);
++ return 0;
++ } else if (cmp > 0) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Not downgrading package %s on %s from %s to %s.\n",
++ old->name, old->dest->name, old_version, new_version);
++ free(old_version);
++ free(new_version);
++ return 0;
++ } else if (cmp < 0) {
++ new->dest = old->dest;
++ old->state_want = SW_DEINSTALL; /* Here probably the problem for bug 1277 */
++ }
++ }
++
++ /* XXX: CLEANUP: The error code of ipkg_install_by_name is really
++ supposed to be an ipkg_error_t, but ipkg_install_pkg could
++ return any kind of integer, (might be errno from a syscall,
++ etc.). This is a real mess and will need to be cleaned up if
++ anyone ever wants to make a nice libipkg. */
++
++ ipkg_message(conf, IPKG_DEBUG2,"Function: %s calling ipkg_install_pkg \n",__FUNCTION__);
++ return ipkg_install_pkg(conf, new,0);
++}
++
++ipkg_error_t ipkg_install_multi_by_name(ipkg_conf_t *conf, const char *pkg_name)
++{
++ abstract_pkg_vec_t *providers = pkg_hash_fetch_all_installation_candidates (&conf->pkg_hash, pkg_name);
++ int i;
++ ipkg_error_t err;
++ abstract_pkg_t *ppkg ;
++
++ if (providers == NULL)
++ return IPKG_PKG_HAS_NO_CANDIDATE;
++
++ for (i = 0; i < providers->len; i++) {
++ ppkg = abstract_pkg_vec_get(providers, i);
++ ipkg_message(conf, IPKG_DEBUG2,"Function: %s calling ipkg_install_by_name %d \n",__FUNCTION__, i);
++ err = ipkg_install_by_name(conf, ppkg->name);
++ if (err)
++ return err;
++/* XXX Maybe ppkg should be freed ? */
++ }
++ return 0;
++}
++
++/*
++ * Walk dependence graph starting with pkg, collect packages to be
++ * installed into pkgs_needed, in dependence order.
++ */
++int pkg_mark_dependencies_for_installation(ipkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *pkgs_needed)
++{
++ int i, err;
++ pkg_vec_t *depends = pkg_vec_alloc();
++ char **unresolved = NULL;
++ int ndepends;
++
++ ndepends = pkg_hash_fetch_unsatisfied_dependencies(conf,
++ pkg, depends,
++ &unresolved);
++
++ if (unresolved) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s: Cannot satisfy the following dependencies for %s:\n\t",
++ conf->force_depends ? "Warning" : "ERROR", pkg->name);
++ while (*unresolved) {
++ ipkg_message(conf, IPKG_ERROR, " %s", *unresolved);
++ unresolved++;
++ }
++ ipkg_message(conf, IPKG_ERROR, "\n");
++ if (! conf->force_depends) {
++ ipkg_message(conf, IPKG_INFO,
++ "This could mean that your package list is out of date or that the packages\n"
++ "mentioned above do not yet exist (try 'ipkg update'). To proceed in spite\n"
++ "of this problem try again with the '-force-depends' option.\n");
++ pkg_vec_free(depends);
++ return IPKG_PKG_DEPS_UNSATISFIED;
++ }
++ }
++
++ if (ndepends <= 0) {
++ pkg_vec_free(depends);
++ return 0;
++ }
++
++ for (i = 0; i < depends->len; i++) {
++ pkg_t *dep = depends->pkgs[i];
++ /* The package was uninstalled when we started, but another
++ dep earlier in this loop may have depended on it and pulled
++ it in, so check first. */
++ if ((dep->state_status != SS_INSTALLED)
++ && (dep->state_status != SS_UNPACKED)
++ && (dep->state_want != SW_INSTALL)) {
++
++ /* Mark packages as to-be-installed */
++ dep->state_want = SW_INSTALL;
++
++ /* Dependencies should be installed the same place as pkg */
++ if (dep->dest == NULL) {
++ dep->dest = pkg->dest;
++ }
++
++ err = pkg_mark_dependencies_for_installation(conf, dep, pkgs_needed);
++ if (err) {
++ pkg_vec_free(depends);
++ return err;
++ }
++ }
++ }
++ if (pkgs_needed)
++ pkg_vec_insert(pkgs_needed, pkg);
++
++ pkg_vec_free(depends);
++
++ return 0;
++}
++
++int name_mark_dependencies_for_installation(ipkg_conf_t *conf, const char *pkg_name, pkg_vec_t *pkgs_needed)
++{
++ int cmp;
++ pkg_t *old, *new;
++ char *old_version, *new_version;
++
++ old = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, pkg_name);
++
++ new = pkg_hash_fetch_best_installation_candidate_by_name(conf, pkg_name);
++ if (new == NULL) {
++ return IPKG_PKG_HAS_NO_CANDIDATE;
++ }
++ if (old) {
++ old_version = pkg_version_str_alloc(old);
++ new_version = pkg_version_str_alloc(new);
++
++ cmp = pkg_compare_versions(old, new);
++ if ( (conf->force_downgrade==1) && (cmp > 0) ){ /* We've been asked to allow downgrade and version is precedent */
++ ipkg_message(conf, IPKG_DEBUG, " Forcing downgrade ");
++ cmp = -1 ; /* then we force ipkg to downgrade */
++ /* We need to use a value < 0 because in the 0 case we are asking to */
++ /* reinstall, and some check could fail asking the "force-reinstall" option */
++ }
++ ipkg_message(conf, IPKG_DEBUG,
++ "comparing visible versions of pkg %s:"
++ "\n\t%s is installed "
++ "\n\t%s is available "
++ "\n\t%d was comparison result\n",
++ pkg_name, old_version, new_version, cmp);
++ if (cmp == 0 && !conf->force_reinstall) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Package %s (%s) installed in %s is up to date.\n",
++ old->name, old_version, old->dest->name);
++ free(old_version);
++ free(new_version);
++ return 0;
++ } else if (cmp > 0) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Not downgrading package %s on %s from %s to %s.\n",
++ old->name, old->dest->name, old_version, new_version);
++ free(old_version);
++ free(new_version);
++ return 0;
++ } else if (cmp < 0) {
++ new->dest = old->dest;
++ old->state_want = SW_DEINSTALL;
++ old->state_flag |= SF_OBSOLETE;
++ }
++ }
++ return pkg_mark_dependencies_for_installation(conf, new, pkgs_needed);
++}
++
++
++
++int satisfy_dependencies_for(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ int i, err;
++ pkg_vec_t *depends = pkg_vec_alloc();
++ pkg_t *dep;
++ char **unresolved = NULL;
++ int ndepends;
++
++ ndepends = pkg_hash_fetch_unsatisfied_dependencies(conf,
++ pkg, depends,
++ &unresolved);
++
++ if (unresolved) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s: Cannot satisfy the following dependencies for %s:\n\t",
++ conf->force_depends ? "Warning" : "ERROR", pkg->name);
++ while (*unresolved) {
++ ipkg_message(conf, IPKG_ERROR, " %s", *unresolved);
++ unresolved++;
++ }
++ ipkg_message(conf, IPKG_ERROR, "\n");
++ if (! conf->force_depends) {
++ ipkg_message(conf, IPKG_INFO,
++ "This could mean that your package list is out of date or that the packages\n"
++ "mentioned above do not yet exist (try 'ipkg update'). To proceed in spite\n"
++ "of this problem try again with the '-force-depends' option.\n");
++ pkg_vec_free(depends);
++ return IPKG_PKG_DEPS_UNSATISFIED;
++ }
++ }
++
++ if (ndepends <= 0) {
++ return 0;
++ }
++
++ /* Mark packages as to-be-installed */
++ for (i=0; i < depends->len; i++) {
++ /* Dependencies should be installed the same place as pkg */
++ if (depends->pkgs[i]->dest == NULL) {
++ depends->pkgs[i]->dest = pkg->dest;
++ }
++ depends->pkgs[i]->state_want = SW_INSTALL;
++ }
++
++ for (i = 0; i < depends->len; i++) {
++ dep = depends->pkgs[i];
++ /* The package was uninstalled when we started, but another
++ dep earlier in this loop may have depended on it and pulled
++ it in, so check first. */
++ if ((dep->state_status != SS_INSTALLED)
++ && (dep->state_status != SS_UNPACKED)) {
++ ipkg_message(conf, IPKG_DEBUG2,"Function: %s calling ipkg_install_pkg \n",__FUNCTION__);
++ err = ipkg_install_pkg(conf, dep,0);
++ if (err) {
++ pkg_vec_free(depends);
++ return err;
++ }
++ }
++ }
++
++ pkg_vec_free(depends);
++
++ return 0;
++}
++
++
++/* check all packages have their dependences satisfied, e.g., in case an upgraded package split */
++int ipkg_satisfy_all_dependences(ipkg_conf_t *conf)
++{
++ if (conf->nodeps == 0) {
++ int i;
++ pkg_vec_t *installed = pkg_vec_alloc();
++ pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
++ for (i = 0; i < installed->len; i++) {
++ pkg_t *pkg = installed->pkgs[i];
++ satisfy_dependencies_for(conf, pkg);
++ }
++ pkg_vec_free(installed);
++ }
++ return 0;
++}
++
++
++
++static int check_conflicts_for(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ int i;
++ pkg_vec_t *conflicts = NULL;
++ int level;
++ const char *prefix;
++ if (conf->force_depends) {
++ level = IPKG_NOTICE;
++ prefix = "Warning";
++ } else {
++ level = IPKG_ERROR;
++ prefix = "ERROR";
++ }
++
++ if (!conf->force_depends)
++ conflicts = (pkg_vec_t *)pkg_hash_fetch_conflicts(pkg);
++
++ if (conflicts) {
++ ipkg_message(conf, level,
++ "%s: The following packages conflict with %s:\n\t", prefix, pkg->name);
++ i = 0;
++ while (i < conflicts->len)
++ ipkg_message(conf, level, " %s", conflicts->pkgs[i++]->name);
++ ipkg_message(conf, level, "\n");
++ pkg_vec_free(conflicts);
++ return IPKG_PKG_DEPS_UNSATISFIED;
++ }
++ return 0;
++}
++
++static int update_file_ownership(ipkg_conf_t *conf, pkg_t *new_pkg, pkg_t *old_pkg)
++{
++ str_list_t *new_list = pkg_get_installed_files(new_pkg);
++ str_list_elt_t *iter;
++
++ for (iter = new_list->head; iter; iter = iter->next) {
++ char *new_file = iter->data;
++ pkg_t *owner = file_hash_get_file_owner(conf, new_file);
++ if (!new_file)
++ ipkg_message(conf, IPKG_ERROR, "Null new_file for new_pkg=%s\n", new_pkg->name);
++ if (!owner || (owner == old_pkg))
++ file_hash_set_file_owner(conf, new_file, new_pkg);
++ }
++ if (old_pkg) {
++ str_list_t *old_list = pkg_get_installed_files(old_pkg);
++ for (iter = old_list->head; iter; iter = iter->next) {
++ char *old_file = iter->data;
++ pkg_t *owner = file_hash_get_file_owner(conf, old_file);
++ if (owner == old_pkg) {
++ /* obsolete */
++ hash_table_insert(&conf->obs_file_hash, old_file, old_pkg);
++ }
++ }
++ }
++ return 0;
++}
++
++static int verify_pkg_installable(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ /* XXX: FEATURE: Anything else needed here? Maybe a check on free space? */
++
++ /* sma 6.20.02: yup; here's the first bit */
++ /*
++ * XXX: BUG easy for cworth
++ * 1) please point the call below to the correct current root destination
++ * 2) we need to resolve how to check the required space for a pending pkg,
++ * my diddling with the .ipk file size below isn't going to cut it.
++ * 3) return a proper error code instead of 1
++ */
++ int comp_size, blocks_available;
++
++ if (!conf->force_space && pkg->installed_size != NULL) {
++ blocks_available = get_available_blocks(conf->default_dest->root_dir);
++
++ comp_size = strtoul(pkg->installed_size, NULL, 0);
++ /* round up a blocks count without doing fancy-but-slow casting jazz */
++ comp_size = (int)((comp_size + 1023) / 1024);
++
++ if (comp_size >= blocks_available) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Only have %d available blocks on filesystem %s, pkg %s needs %d\n",
++ blocks_available, conf->default_dest->root_dir, pkg->name, comp_size);
++ return ENOSPC;
++ }
++ }
++ return 0;
++}
++
++static int unpack_pkg_control_files(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ int err;
++ char *conffiles_file_name;
++ char *root_dir;
++ FILE *conffiles_file;
++
++ sprintf_alloc(&pkg->tmp_unpack_dir, "%s/%s-XXXXXX", conf->tmp_dir, pkg->name);
++
++ pkg->tmp_unpack_dir = mkdtemp(pkg->tmp_unpack_dir);
++ if (pkg->tmp_unpack_dir == NULL) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s: Failed to create temporary directory '%s': %s\n",
++ __FUNCTION__, pkg->tmp_unpack_dir, strerror(errno));
++ return errno;
++ }
++
++ err = pkg_extract_control_files_to_dir(pkg, pkg->tmp_unpack_dir);
++ if (err) {
++ return err;
++ }
++
++ /* XXX: CLEANUP: There might be a cleaner place to read in the
++ conffiles. Seems like I should be able to get everything to go
++ through pkg_init_from_file. If so, maybe it would make sense to
++ move all of unpack_pkg_control_files to that function. */
++
++ /* Don't need to re-read conffiles if we already have it */
++ if (pkg->conffiles.head) {
++ return 0;
++ }
++
++ sprintf_alloc(&conffiles_file_name, "%s/conffiles", pkg->tmp_unpack_dir);
++ if (! file_exists(conffiles_file_name)) {
++ free(conffiles_file_name);
++ return 0;
++ }
++
++ conffiles_file = fopen(conffiles_file_name, "r");
++ if (conffiles_file == NULL) {
++ fprintf(stderr, "%s: failed to open %s: %s\n",
++ __FUNCTION__, conffiles_file_name, strerror(errno));
++ free(conffiles_file_name);
++ return errno;
++ }
++ free(conffiles_file_name);
++
++ while (1) {
++ char *cf_name;
++ char *cf_name_in_dest;
++
++ cf_name = file_read_line_alloc(conffiles_file);
++ if (cf_name == NULL) {
++ break;
++ }
++ str_chomp(cf_name);
++ if (cf_name[0] == '\0') {
++ continue;
++ }
++
++ /* Prepend dest->root_dir to conffile name.
++ Take pains to avoid multiple slashes. */
++ root_dir = pkg->dest->root_dir;
++ if (conf->offline_root)
++ /* skip the offline_root prefix */
++ root_dir = pkg->dest->root_dir + strlen(conf->offline_root);
++ sprintf_alloc(&cf_name_in_dest, "%s%s", root_dir,
++ cf_name[0] == '/' ? (cf_name + 1) : cf_name);
++
++ /* Can't get an md5sum now, (file isn't extracted yet).
++ We'll wait until resolve_conffiles */
++ conffile_list_append(&pkg->conffiles, cf_name_in_dest, NULL);
++
++ free(cf_name);
++ free(cf_name_in_dest);
++ }
++
++ fclose(conffiles_file);
++
++ return 0;
++}
++
++/* returns number of installed replacees */
++int pkg_get_installed_replacees(pkg_t *pkg, pkg_vec_t *installed_replacees)
++{
++ abstract_pkg_t **replaces = pkg->replaces;
++ int replaces_count = pkg->replaces_count;
++ int i, j;
++ for (i = 0; i < replaces_count; i++) {
++ abstract_pkg_t *ab_pkg = replaces[i];
++ pkg_vec_t *pkg_vec = ab_pkg->pkgs;
++ if (pkg_vec) {
++ for (j = 0; j < pkg_vec->len; j++) {
++ pkg_t *replacee = pkg_vec->pkgs[j];
++ if (!pkg_conflicts(pkg, replacee))
++ continue;
++ if (replacee->state_status == SS_INSTALLED) {
++ pkg_vec_insert(installed_replacees, replacee);
++ }
++ }
++ }
++ }
++ return installed_replacees->len;
++}
++
++int pkg_remove_installed_replacees(ipkg_conf_t *conf, pkg_vec_t *replacees)
++{
++ int i;
++ int replaces_count = replacees->len;
++ for (i = 0; i < replaces_count; i++) {
++ pkg_t *replacee = replacees->pkgs[i];
++ int err;
++ replacee->state_flag |= SF_REPLACE; /* flag it so remove won't complain */
++ err = ipkg_remove_pkg(conf, replacee,0);
++ if (err)
++ return err;
++ }
++ return 0;
++}
++
++/* to unwind the removal: make sure they are installed */
++int pkg_remove_installed_replacees_unwind(ipkg_conf_t *conf, pkg_vec_t *replacees)
++{
++ int i, err;
++ int replaces_count = replacees->len;
++ for (i = 0; i < replaces_count; i++) {
++ pkg_t *replacee = replacees->pkgs[i];
++ if (replacee->state_status != SS_INSTALLED) {
++ ipkg_message(conf, IPKG_DEBUG2,"Function: %s calling ipkg_install_pkg \n",__FUNCTION__);
++ err = ipkg_install_pkg(conf, replacee,0);
++ if (err)
++ return err;
++ }
++ }
++ return 0;
++}
++
++int caught_sigint = 0;
++static void ipkg_install_pkg_sigint_handler(int sig)
++{
++ caught_sigint = sig;
++}
++
++/* compares versions of pkg and old_pkg, returns 0 if OK to proceed with installation of pkg, 1 otherwise */
++static int ipkg_install_check_downgrade(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg, int message)
++{
++ if (old_pkg) {
++ char message_out[15];
++ char *old_version = pkg_version_str_alloc(old_pkg);
++ char *new_version = pkg_version_str_alloc(pkg);
++ int cmp = pkg_compare_versions(old_pkg, pkg);
++ int rc = 0;
++
++ memset(message_out,'\x0',15);
++ strncpy (message_out,"Upgrading ",strlen("Upgrading "));
++ if ( (conf->force_downgrade==1) && (cmp > 0) ){ /* We've been asked to allow downgrade and version is precedent */
++ cmp = -1 ; /* then we force ipkg to downgrade */
++ strncpy (message_out,"Downgrading ",strlen("Downgrading ")); /* We need to use a value < 0 because in the 0 case we are asking to */
++ /* reinstall, and some check could fail asking the "force-reinstall" option */
++ }
++
++ if (cmp > 0) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Not downgrading package %s on %s from %s to %s.\n",
++ old_pkg->name, old_pkg->dest->name, old_version, new_version);
++ rc = 1;
++ } else if (cmp < 0) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "%s%s on %s from %s to %s...\n",
++ message_out, pkg->name, old_pkg->dest->name, old_version, new_version);
++ pkg->dest = old_pkg->dest;
++ rc = 0;
++ } else /* cmp == 0 */ {
++ if (conf->force_reinstall) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Reinstalling %s (%s) on %s...\n",
++ pkg->name, new_version, old_pkg->dest->name);
++ pkg->dest = old_pkg->dest;
++ rc = 0;
++ } else {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Not installing %s (%s) on %s -- already installed.\n",
++ pkg->name, new_version, old_pkg->dest->name);
++ rc = 1;
++ }
++ }
++ free(old_version);
++ free(new_version);
++ return rc;
++ } else {
++ char message_out[15], *version ;
++ memset(message_out,'\x0',15);
++ if ( message )
++ strncpy( message_out,"Upgrading ",strlen("Upgrading ") );
++ else
++ strncpy( message_out,"Installing ",strlen("Installing ") );
++ version = pkg_version_str_alloc(pkg);
++
++ ipkg_message(conf, IPKG_NOTICE,
++ "%s%s (%s) to %s...\n", message_out,
++ pkg->name, version, pkg->dest->name);
++ free(version);
++ return 0;
++ }
++}
++
++/* and now the meat... */
++int ipkg_install_pkg(ipkg_conf_t *conf, pkg_t *pkg, int from_upgrade)
++{
++ int err = 0;
++ int message = 0;
++ pkg_t *old_pkg = NULL;
++ pkg_vec_t *replacees;
++ abstract_pkg_t *ab_pkg = NULL;
++ int old_state_flag;
++ uint8_t *file_md5;
++
++
++ if ( from_upgrade )
++ message = 1; /* Coming from an upgrade, and should change the output message */
++
++ if (!pkg) {
++ ipkg_message(conf, IPKG_ERROR,
++ "INTERNAL ERROR: null pkg passed to ipkg_install_pkg\n");
++ return -EINVAL;
++ }
++
++ ipkg_message(conf, IPKG_DEBUG2, "Function: %s calling pkg_arch_supported %s \n", __FUNCTION__, __FUNCTION__);
++
++ if (!pkg_arch_supported(conf, pkg)) {
++ ipkg_message(conf, IPKG_ERROR, "INTERNAL ERROR: architecture %s for pkg %s is unsupported.\n",
++ pkg->architecture, pkg->name);
++ return -EINVAL;
++ }
++ if (pkg->state_status == SS_INSTALLED && conf->force_reinstall == 0 && conf->nodeps == 0) {
++ err = satisfy_dependencies_for(conf, pkg);
++ if (err) { return err; }
++
++ ipkg_message(conf, IPKG_NOTICE,
++ "Package %s is already installed in %s.\n",
++ pkg->name, pkg->dest->name);
++ return 0;
++ }
++
++ if (pkg->dest == NULL) {
++ pkg->dest = conf->default_dest;
++ }
++
++ old_pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash, pkg->name);
++
++ err = ipkg_install_check_downgrade(conf, pkg, old_pkg, message);
++ if (err) { return err; }
++
++ pkg->state_want = SW_INSTALL;
++ if (old_pkg){
++ old_pkg->state_want = SW_DEINSTALL; /* needed for check_data_file_clashes of dependences */
++ }
++
++
++ /* Abhaya: conflicts check */
++ err = check_conflicts_for(conf, pkg);
++ if (err) { return err; }
++
++ /* this setup is to remove the upgrade scenario in the end when
++ installing pkg A, A deps B & B deps on A. So both B and A are
++ installed. Then A's installation is started resulting in an
++ uncecessary upgrade */
++ if (pkg->state_status == SS_INSTALLED
++ && conf->force_reinstall == 0) return 0;
++
++ err = verify_pkg_installable(conf, pkg);
++ if (err) { return err; }
++
++ if (pkg->local_filename == NULL) {
++ err = ipkg_download_pkg(conf, pkg, conf->tmp_dir);
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Failed to download %s. Perhaps you need to run 'ipkg update'?\n",
++ pkg->name);
++ return err;
++ }
++ }
++
++/* Check for md5 values */
++ if (pkg->md5sum)
++ {
++ file_md5 = file_md5sum_alloc(pkg->local_filename);
++ if (strcmp((char *)file_md5, pkg->md5sum))
++ {
++ ipkg_message(conf, IPKG_ERROR,
++ "Package %s md5sum mismatch. Either the ipkg or the package index are corrupt. Try 'ipkg update'.\n",
++ pkg->name);
++ free(file_md5);
++ return err;
++ }
++ free(file_md5);
++ }
++
++ if (pkg->tmp_unpack_dir == NULL) {
++ unpack_pkg_control_files(conf, pkg);
++ }
++
++ /* We should update the filelist here, so that upgrades of packages that split will not fail. -Jamey 27-MAR-03 */
++/* Pigi: check if it will pass from here when replacing. It seems to fail */
++/* That's rather strange that files don't change owner. Investigate !!!!!!*/
++ err = update_file_ownership(conf, pkg, old_pkg);
++ if (err) { return err; }
++
++ if (conf->nodeps == 0) {
++ err = satisfy_dependencies_for(conf, pkg);
++ if (err) { return err; }
++ }
++
++ replacees = pkg_vec_alloc();
++ pkg_get_installed_replacees(pkg, replacees);
++
++ /* this next section we do with SIGINT blocked to prevent inconsistency between ipkg database and filesystem */
++ {
++ sigset_t newset, oldset;
++ sighandler_t old_handler = NULL;
++ int use_signal = 0;
++ caught_sigint = 0;
++ if (use_signal) {
++ old_handler = signal(SIGINT, ipkg_install_pkg_sigint_handler);
++ } else {
++ sigemptyset(&newset);
++ sigaddset(&newset, SIGINT);
++ sigprocmask(SIG_BLOCK, &newset, &oldset);
++ }
++
++ ipkg_state_changed++;
++ pkg->state_flag |= SF_FILELIST_CHANGED;
++
++ /* XXX: BUG: we really should treat replacement more like an upgrade
++ * Instead, we're going to remove the replacees
++ */
++ err = pkg_remove_installed_replacees(conf, replacees);
++ if (err) goto UNWIND_REMOVE_INSTALLED_REPLACEES;
++
++ /*
++ err = prerm_upgrade_old_pkg(conf, pkg, old_pkg);
++ if (err) goto UNWIND_PRERM_UPGRADE_OLD_PKG;
++
++ err = prerm_deconfigure_conflictors(conf, pkg, replacees);
++ if (err) goto UNWIND_PRERM_DECONFIGURE_CONFLICTORS;
++ */
++
++ err = preinst_configure(conf, pkg, old_pkg);
++ /*
++ if (err) goto UNWIND_PREINST_CONFIGURE;
++ */
++
++ err = backup_modified_conffiles(conf, pkg, old_pkg);
++ if (err) goto UNWIND_BACKUP_MODIFIED_CONFFILES;
++
++ err = check_data_file_clashes(conf, pkg, old_pkg);
++ /*
++ if (err) goto UNWIND_CHECK_DATA_FILE_CLASHES;
++
++ err = postrm_upgrade_old_pkg(conf, pkg, old_pkg);
++ if (err) goto UNWIND_POSTRM_UPGRADE_OLD_PKG;
++ */
++
++ if (conf->noaction) return 0;
++
++ /* point of no return: no unwinding after this */
++ if (old_pkg && !conf->force_reinstall) {
++ old_pkg->state_want = SW_DEINSTALL;
++
++ if (old_pkg->state_flag & SF_NOPRUNE) {
++ ipkg_message(conf, IPKG_INFO,
++ " not removing obsolesced files because package marked noprune\n");
++ } else {
++ ipkg_message(conf, IPKG_INFO,
++ " removing obsolesced files\n");
++ remove_obsolesced_files(conf, pkg, old_pkg);
++ }
++ /* removing files from old package, to avoid ghost files */
++ remove_data_files_and_list(conf, old_pkg);
++/* Pigi : It should be better to remove also maintainer and postrem scripts here, just in case*/
++ remove_maintainer_scripts_except_postrm(conf, old_pkg);
++ remove_postrm(conf, old_pkg);
++/* Pigi */
++
++ }
++
++
++ ipkg_message(conf, IPKG_INFO,
++ " installing maintainer scripts\n");
++ install_maintainer_scripts(conf, pkg, old_pkg);
++
++ /* the following just returns 0
++ remove_disappeared(conf, pkg);
++ */
++
++ ipkg_message(conf, IPKG_INFO,
++ " installing data files\n");
++ install_data_files(conf, pkg);
++
++/* read comments from function for detail but I will execute this here as all other tests are ok.*/
++ err = check_data_file_clashes_change(conf, pkg);
++
++ ipkg_message(conf, IPKG_INFO,
++ " resolving conf files\n");
++ resolve_conffiles(conf, pkg);
++
++ pkg->state_status = SS_UNPACKED;
++ old_state_flag = pkg->state_flag;
++ pkg->state_flag &= ~SF_PREFER;
++ ipkg_message(conf, IPKG_DEBUG, " pkg=%s old_state_flag=%x state_flag=%x\n", pkg->name, old_state_flag, pkg->state_flag);
++
++ if (old_pkg && !conf->force_reinstall) {
++ old_pkg->state_status = SS_NOT_INSTALLED;
++ }
++
++ time(&pkg->installed_time);
++
++ ipkg_message(conf, IPKG_INFO,
++ " cleanup temp files\n");
++ cleanup_temporary_files(conf, pkg);
++
++ ab_pkg = pkg->parent;
++ if (ab_pkg)
++ ab_pkg->state_status = pkg->state_status;
++
++ ipkg_message(conf, IPKG_INFO, "Done.\n");
++
++ if (use_signal)
++ signal(SIGINT, old_handler);
++ else
++ sigprocmask(SIG_UNBLOCK, &newset, &oldset);
++
++ return 0;
++
++
++ /*
++ UNWIND_POSTRM_UPGRADE_OLD_PKG:
++ postrm_upgrade_old_pkg_unwind(conf, pkg, old_pkg);
++ UNWIND_CHECK_DATA_FILE_CLASHES:
++ check_data_file_clashes_unwind(conf, pkg, old_pkg);
++ */
++ UNWIND_BACKUP_MODIFIED_CONFFILES:
++ backup_modified_conffiles_unwind(pkg, old_pkg);
++ /*
++ UNWIND_PREINST_CONFIGURE:
++ preinst_configure_unwind(conf, pkg, old_pkg);
++ UNWIND_PRERM_DECONFIGURE_CONFLICTORS:
++ prerm_deconfigure_conflictors_unwind(conf, pkg, replacees);
++ UNWIND_PRERM_UPGRADE_OLD_PKG:
++ prerm_upgrade_old_pkg_unwind(conf, pkg, old_pkg);
++ */
++ UNWIND_REMOVE_INSTALLED_REPLACEES:
++ pkg_remove_installed_replacees_unwind(conf, replacees);
++
++ ipkg_message(conf, IPKG_INFO,
++ " cleanup temp files\n");
++ cleanup_temporary_files(conf, pkg);
++
++ ipkg_message(conf, IPKG_INFO,
++ "Failed.\n");
++ if (use_signal)
++ signal(SIGINT, old_handler);
++ else
++ sigprocmask(SIG_UNBLOCK, &newset, &oldset);
++
++ return err;
++ }
++}
++
++/*
++static int prerm_upgrade_old_pkg(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ DPKG_INCOMPATIBILITY:
++ dpkg does some things here that we don't do yet. Do we care?
++
++ 1. If a version of the package is already installed, call
++ old-prerm upgrade new-version
++ 2. If the script runs but exits with a non-zero exit status
++ new-prerm failed-upgrade old-version
++ Error unwind, for both the above cases:
++ old-postinst abort-upgrade new-version
++ return 0;
++}
++*/
++
++/*
++static int prerm_upgrade_old_pkg_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ DPKG_INCOMPATIBILITY:
++ dpkg does some things here that we don't do yet. Do we care?
++ (See prerm_upgrade_old_package for details)
++
++ return 0;
++}
++*/
++
++/*
++static int prerm_deconfigure_conflictors(ipkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *conflictors)
++{
++ DPKG_INCOMPATIBILITY:
++ dpkg does some things here that we don't do yet. Do we care?
++ 2. If a 'conflicting' package is being removed at the same time:
++ 1. If any packages depended on that conflicting package and
++ --auto-deconfigure is specified, call, for each such package:
++ deconfigured's-prerm deconfigure \
++ in-favour package-being-installed version \
++ removing conflicting-package version
++ Error unwind:
++ deconfigured's-postinst abort-deconfigure \
++ in-favour package-being-installed-but-failed version \
++ removing conflicting-package version
++
++ The deconfigured packages are marked as requiring
++ configuration, so that if --install is used they will be
++ configured again if possible.
++ 2. To prepare for removal of the conflicting package, call:
++ conflictor's-prerm remove in-favour package new-version
++ Error unwind:
++ conflictor's-postinst abort-remove in-favour package new-version
++ return 0;
++}
++*/
++
++/*
++static int prerm_deconfigure_conflictors_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_vec_t *conflictors)
++{
++ DPKG_INCOMPATIBILITY: dpkg does some things here that we don't
++ do yet. Do we care? (See prerm_deconfigure_conflictors for
++ details)
++ return 0;
++}
++*/
++
++static int preinst_configure(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ int err;
++ char *preinst_args;
++
++ if (old_pkg) {
++ char *old_version = pkg_version_str_alloc(old_pkg);
++ sprintf_alloc(&preinst_args, "upgrade %s", old_version);
++ free(old_version);
++ } else if (pkg->state_status == SS_CONFIG_FILES) {
++ char *pkg_version = pkg_version_str_alloc(pkg);
++ sprintf_alloc(&preinst_args, "install %s", pkg_version);
++ free(pkg_version);
++ } else {
++ preinst_args = strdup("install");
++ }
++
++ err = pkg_run_script(conf, pkg, "preinst", preinst_args);
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Aborting installation of %s\n", pkg->name);
++ return 1;
++ }
++
++ free(preinst_args);
++
++ return 0;
++}
++
++/*
++static int preinst_configure_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ DPKG_INCOMPATIBILITY:
++ dpkg does the following error unwind, should we?
++ pkg->postrm abort-upgrade old-version
++ OR pkg->postrm abort-install old-version
++ OR pkg->postrm abort-install
++ return 0;
++}
++*/
++
++static int backup_modified_conffiles(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ int err;
++ conffile_list_elt_t *iter;
++ conffile_t *cf;
++
++ if (conf->noaction) return 0;
++
++ /* Backup all modified conffiles */
++ if (old_pkg) {
++ for (iter = old_pkg->conffiles.head; iter; iter = iter->next) {
++ char *cf_name;
++
++ cf = iter->data;
++ cf_name = root_filename_alloc(conf, cf->name);
++
++ /* Don't worry if the conffile is just plain gone */
++ if (file_exists(cf_name) && conffile_has_been_modified(conf, cf)) {
++ err = backup_make_backup(conf, cf_name);
++ if (err) {
++ return err;
++ }
++ }
++ free(cf_name);
++ }
++ }
++
++ /* Backup all conffiles that were not conffiles in old_pkg */
++ for (iter = pkg->conffiles.head; iter; iter = iter->next) {
++ char *cf_name;
++ cf = iter->data;
++ cf_name = root_filename_alloc(conf, cf->name);
++ /* Ignore if this was a conffile in old_pkg as well */
++ if (pkg_get_conffile(old_pkg, cf->name)) {
++ continue;
++ }
++
++ if (file_exists(cf_name) && (! backup_exists_for(cf_name))) {
++ err = backup_make_backup(conf, cf_name);
++ if (err) {
++ return err;
++ }
++ }
++ free(cf_name);
++ }
++
++ return 0;
++}
++
++static int backup_modified_conffiles_unwind(pkg_t *pkg, pkg_t *old_pkg)
++{
++ conffile_list_elt_t *iter;
++
++ if (old_pkg) {
++ for (iter = old_pkg->conffiles.head; iter; iter = iter->next) {
++ backup_remove(iter->data->name);
++ }
++ }
++
++ for (iter = pkg->conffiles.head; iter; iter = iter->next) {
++ backup_remove(iter->data->name);
++ }
++
++ return 0;
++}
++
++
++static int check_data_file_clashes(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ /* DPKG_INCOMPATIBILITY:
++ ipkg takes a slightly different approach than dpkg at this
++ point. dpkg installs each file in the new package while
++ creating a backup for any file that is replaced, (so that it
++ can unwind if necessary). To avoid complexity and redundant
++ storage, ipkg doesn't do any installation until later, (at the
++ point at which dpkg removes the backups.
++
++ But, we do have to check for data file clashes, since after
++ installing a package with a file clash, removing either of the
++ packages involved in the clash has the potential to break the
++ other package.
++ */
++ str_list_t *files_list;
++ str_list_elt_t *iter;
++
++ int clashes = 0;
++
++ files_list = pkg_get_installed_files(pkg);
++ for (iter = files_list->head; iter; iter = iter->next) {
++ char *root_filename;
++ char *filename = iter->data;
++ root_filename = root_filename_alloc(conf, filename);
++ if (file_exists(root_filename) && (! file_is_dir(root_filename))) {
++ pkg_t *owner;
++ pkg_t *obs;
++ /* Pre-existing conffiles are OK */
++ /* @@@@ should have way to check that it is a conffile -Jamey */
++ if (backup_exists_for(root_filename)) {
++ continue;
++ }
++
++ /* Pre-existing files are OK if force-overwrite was asserted. */
++ if (conf->force_overwrite) {
++ /* but we need to change who owns this file */
++ file_hash_set_file_owner(conf, filename, pkg);
++ continue;
++ }
++
++ owner = file_hash_get_file_owner(conf, filename);
++
++ /* Pre-existing files are OK if owned by the pkg being upgraded. */
++ if (owner && old_pkg) {
++ if (strcmp(owner->name, old_pkg->name) == 0) {
++ continue;
++ }
++ }
++
++ /* Pre-existing files are OK if owned by a package replaced by new pkg. */
++ if (owner) {
++ ipkg_message(conf, IPKG_DEBUG2, "Checking for replaces for %s in package %s\n", filename, owner->name);
++ if (pkg_replaces(pkg, owner)) {
++ continue;
++ }
++/* If the file that would be installed is owned by the same package, ( as per a reinstall or similar )
++ then it's ok to overwrite. */
++ if (strcmp(owner->name,pkg->name)==0){
++ ipkg_message(conf, IPKG_INFO, "Replacing pre-existing file %s owned by package %s\n", filename, owner->name);
++ continue;
++ }
++ }
++
++ /* Pre-existing files are OK if they are obsolete */
++ obs = hash_table_get(&conf->obs_file_hash, filename);
++ if (obs) {
++ ipkg_message(conf, IPKG_INFO, "Pre-exiting file %s is obsolete. obs_pkg=%s\n", filename, obs->name);
++ continue;
++ }
++
++ /* We have found a clash. */
++ ipkg_message(conf, IPKG_ERROR,
++ "Package %s wants to install file %s\n"
++ "\tBut that file is already provided by package ",
++ pkg->name, filename);
++ if (owner) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s\n", owner->name);
++ } else {
++ ipkg_message(conf, IPKG_ERROR,
++ "<no package>\nPlease move this file out of the way and try again.\n");
++ }
++ clashes++;
++ }
++ free(root_filename);
++ }
++ pkg_free_installed_files(pkg);
++
++ return clashes;
++}
++
++static int check_data_file_clashes_change(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ /* Basically that's the worst hack I could do to be able to change ownership of
++ file list, but, being that we have no way to unwind the mods, due to structure
++ of hash table, probably is the quickest hack too, whishing it would not slow-up thing too much.
++ What we do here is change the ownership of file in hash if a replace ( or similar events
++ happens )
++ Only the action that are needed to change name should be considered.
++ @@@ To change after 1.0 release.
++ */
++ str_list_t *files_list;
++ str_list_elt_t *iter;
++
++ int clashes = 0;
++
++ files_list = pkg_get_installed_files(pkg);
++ for (iter = files_list->head; iter; iter = iter->next) {
++ char *root_filename;
++ char *filename = iter->data;
++ root_filename = root_filename_alloc(conf, filename);
++ if (file_exists(root_filename) && (! file_is_dir(root_filename))) {
++ pkg_t *owner;
++
++ if (conf->force_overwrite) {
++ /* but we need to change who owns this file */
++ file_hash_set_file_owner(conf, filename, pkg);
++ continue;
++ }
++
++ owner = file_hash_get_file_owner(conf, filename);
++
++ /* Pre-existing files are OK if owned by a package replaced by new pkg. */
++ if (owner) {
++ if (pkg_replaces(pkg, owner)) {
++/* It's now time to change the owner of that file.
++ It has been "replaced" from the new "Replaces", then I need to inform lists file about that. */
++ ipkg_message(conf, IPKG_INFO, "Replacing pre-existing file %s owned by package %s\n", filename, owner->name);
++ file_hash_set_file_owner(conf, filename, pkg);
++ continue;
++ }
++ }
++
++ }
++ free(root_filename);
++ }
++ pkg_free_installed_files(pkg);
++
++ return clashes;
++}
++
++/*
++static int check_data_file_clashes_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ Nothing to do since check_data_file_clashes doesn't change state
++ return 0;
++}
++*/
++
++/*
++static int postrm_upgrade_old_pkg(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ DPKG_INCOMPATIBILITY: dpkg does the following here, should we?
++ 1. If the package is being upgraded, call
++ old-postrm upgrade new-version
++ 2. If this fails, attempt:
++ new-postrm failed-upgrade old-version
++ Error unwind, for both cases:
++ old-preinst abort-upgrade new-version
++ return 0;
++}
++*/
++
++/*
++static int postrm_upgrade_old_pkg_unwind(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ DPKG_INCOMPATIBILITY:
++ dpkg does some things here that we don't do yet. Do we care?
++ (See postrm_upgrade_old_pkg for details)
++ return 0;
++}
++*/
++
++static int remove_obsolesced_files(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ int err;
++ str_list_t *old_files;
++ str_list_elt_t *of;
++ str_list_t *new_files;
++ str_list_elt_t *nf;
++
++ if (old_pkg == NULL) {
++ return 0;
++ }
++
++ old_files = pkg_get_installed_files(old_pkg);
++ new_files = pkg_get_installed_files(pkg);
++
++ for (of = old_files->head; of; of = of->next) {
++ pkg_t *owner;
++ char *old, *new;
++ old = of->data;
++ for (nf = new_files->head; nf; nf = nf->next) {
++ new = nf->data;
++ if (strcmp(old, new) == 0) {
++ goto NOT_OBSOLETE;
++ }
++ }
++ if (file_is_dir(old)) {
++ continue;
++ }
++ owner = file_hash_get_file_owner(conf, old);
++ if (owner != old_pkg) {
++ /* in case obsolete file no longer belongs to old_pkg */
++ continue;
++ }
++
++ /* old file is obsolete */
++ ipkg_message(conf, IPKG_INFO,
++ " removing obsolete file %s\n", old);
++ if (!conf->noaction) {
++ err = unlink(old);
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR, " Warning: remove %s failed: %s\n", old,
++ strerror(errno));
++ }
++ }
++
++ NOT_OBSOLETE:
++ ;
++ }
++
++ pkg_free_installed_files(old_pkg);
++ pkg_free_installed_files(pkg);
++
++ return 0;
++}
++
++static int remove_obsolete_maintainer_scripts(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ int i;
++ int err = 0;
++ char *globpattern;
++ glob_t globbuf;
++ if (0) {
++ if (!pkg->dest) {
++ ipkg_message(conf, IPKG_ERROR, "%s: no dest for package %s\n", __FUNCTION__, pkg->name);
++ return -1;
++ }
++ sprintf_alloc(&globpattern, "%s/%s.*", pkg->dest->info_dir, pkg->name);
++ err = glob(globpattern, 0, NULL, &globbuf);
++ free(globpattern);
++ if (err) {
++ return err;
++ }
++ /* XXXX this should perhaps only remove the ones that are not overwritten in new package. Jamey 11/11/2003 */
++ for (i = 0; i < globbuf.gl_pathc; i++) {
++ ipkg_message(conf, IPKG_DEBUG, "Removing control file %s from old_pkg %s\n",
++ globbuf.gl_pathv[i], old_pkg->name);
++ if (!conf->noaction)
++ unlink(globbuf.gl_pathv[i]);
++ }
++ globfree(&globbuf);
++ }
++ return err;
++}
++
++static int install_maintainer_scripts(ipkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
++{
++ int ret;
++ char *prefix;
++
++ if (old_pkg)
++ remove_obsolete_maintainer_scripts(conf, pkg, old_pkg);
++ sprintf_alloc(&prefix, "%s.", pkg->name);
++ ret = pkg_extract_control_files_to_dir_with_prefix(pkg,
++ pkg->dest->info_dir,
++ prefix);
++ free(prefix);
++ return ret;
++}
++
++/*
++static int remove_disappeared(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ DPKG_INCOMPATIBILITY:
++ This is a fairly sophisticated dpkg operation. Shall we
++ skip it?
++
++ Any packages all of whose files have been overwritten during the
++ installation, and which aren't required for dependencies, are
++ considered to have been removed. For each such package
++ 1. disappearer's-postrm disappear overwriter overwriter-version
++ 2. The package's maintainer scripts are removed
++ 3. It is noted in the status database as being in a sane state,
++ namely not installed (any conffiles it may have are ignored,
++ rather than being removed by dpkg). Note that disappearing
++ packages do not have their prerm called, because dpkg doesn't
++ know in advance that the package is going to vanish.
++
++
++ return 0;
++}
++*/
++
++static int install_data_files(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ int err;
++
++ /* ipkg takes a slightly different approach to data file backups
++ than dpkg. Rather than removing backups at this point, we
++ actually do the data file installation now. See comments in
++ check_data_file_clashes() for more details. */
++
++ ipkg_message(conf, IPKG_INFO,
++ " extracting data files to %s\n", pkg->dest->root_dir);
++ err = pkg_extract_data_files_to_dir(pkg, pkg->dest->root_dir);
++ if (err) {
++ return err;
++ }
++
++ /* XXX: BUG or FEATURE : We are actually loosing the Essential flag,
++ so we can't save ourself from removing important packages
++ At this point we (should) have extracted the .control file, so it
++ would be a good idea to reload the data in it, and set the Essential
++ state in *pkg. From now on the Essential is back in status file and
++ we can protect again.
++ We should operate this way:
++ fopen the file ( pkg->dest->root_dir/pkg->name.control )
++ check for "Essential" in it
++ set the value in pkg->essential.
++ This new routine could be useful also for every other flag
++ Pigi: 16/03/2004 */
++ set_flags_from_control(conf, pkg) ;
++
++ ipkg_message(conf, IPKG_DEBUG, " Calling pkg_write_filelist from %s\n", __FUNCTION__);
++ err = pkg_write_filelist(conf, pkg);
++ if (err)
++ return err;
++
++ /* XXX: FEATURE: ipkg should identify any files which existed
++ before installation and which were overwritten, (see
++ check_data_file_clashes()). What it must do is remove any such
++ files from the filelist of the old package which provided the
++ file. Otherwise, if the old package were removed at some point
++ it would break the new package. Removing the new package will
++ also break the old one, but this cannot be helped since the old
++ package's file has already been deleted. This is the importance
++ of check_data_file_clashes(), and only allowing ipkg to install
++ a clashing package with a user force. */
++
++ return 0;
++}
++
++static int resolve_conffiles(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ conffile_list_elt_t *iter;
++ conffile_t *cf;
++ char *cf_backup;
++ uint8_t *md5sum;
++
++
++ if (conf->noaction) return 0;
++
++ for (iter = pkg->conffiles.head; iter; iter = iter->next) {
++ char *root_filename;
++ cf = iter->data;
++ root_filename = root_filename_alloc(conf, cf->name);
++
++ /* Might need to initialize the md5sum for each conffile */
++ if (cf->value == NULL) {
++ cf->value = (char *)file_md5sum_alloc(root_filename);
++ }
++
++ if (!file_exists(root_filename)) {
++ free(root_filename);
++ continue;
++ }
++
++ cf_backup = backup_filename_alloc(root_filename);
++
++
++ if (file_exists(cf_backup)) {
++ /* Let's compute md5 to test if files are changed */
++ md5sum = file_md5sum_alloc(cf_backup);
++ if (strcmp( cf->value, (char *)md5sum) != 0 ) {
++ if (conf->force_defaults
++ || user_prefers_old_conffile(cf->name, cf_backup) ) {
++ rename(cf_backup, root_filename);
++ }
++ }
++ unlink(cf_backup);
++ free(md5sum);
++ }
++
++ free(cf_backup);
++ free(root_filename);
++ }
++
++ return 0;
++}
++
++static int user_prefers_old_conffile(const char *file_name, const char *backup)
++{
++ char *response;
++ const char *short_file_name;
++
++ short_file_name = strrchr(file_name, '/');
++ if (short_file_name) {
++ short_file_name++;
++ } else {
++ short_file_name = file_name;
++ }
++
++ while (1) {
++ response = get_user_response(" Configuration file '%s'\n"
++ " ==> File on system created by you or by a script.\n"
++ " ==> File also in package provided by package maintainer.\n"
++ " What would you like to do about it ? Your options are:\n"
++ " Y or I : install the package maintainer's version\n"
++ " N or O : keep your currently-installed version\n"
++#ifdef CONFIG_DIFF
++ " D : show the differences between the versions\n"
++#endif
++ " The default action is to keep your current version.\n"
++ " *** %s (Y/I/N/O"
++#ifdef CONFIG_DIFF
++ "/D"
++#endif
++ ") [default=N] ? ", file_name, short_file_name);
++ if (strcmp(response, "y") == 0
++ || strcmp(response, "i") == 0
++ || strcmp(response, "yes") == 0) {
++ free(response);
++ return 0;
++ }
++
++#ifdef CONFIG_DIFF
++ if (strcmp(response, "d") == 0) {
++ char *cmd;
++
++ free(response);
++ /* XXX: BUG rewrite to use exec or busybox's internal diff */
++ sprintf_alloc(&cmd, "diff -u %s %s", backup, file_name);
++ xsystem(cmd);
++ free(cmd);
++ printf(" [Press ENTER to continue]\n");
++ response = file_read_line_alloc(stdin);
++ free(response);
++ continue;
++ }
++#endif
++
++ free(response);
++ return 1;
++ }
++}
++
++/* XXX: CLEANUP: I'd like to move all of the code for
++ creating/cleaning pkg->tmp_unpack_dir directly into pkg.c. (Then,
++ it would make sense to cleanup pkg->tmp_unpack_dir directly from
++ pkg_deinit for example). */
++static int cleanup_temporary_files(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ DIR *tmp_dir;
++ struct dirent *dirent;
++ char *tmp_file;
++
++#ifdef IPKG_DEBUG_NO_TMP_CLEANUP
++#error
++ ipkg_message(conf, IPKG_DEBUG,
++ "%s: Not cleaning up %s since ipkg compiled with IPKG_DEBUG_NO_TMP_CLEANUP\n",
++ __FUNCTION__, pkg->tmp_unpack_dir);
++ return 0;
++#endif
++
++ if (pkg->tmp_unpack_dir && file_is_dir(pkg->tmp_unpack_dir)) {
++ tmp_dir = opendir(pkg->tmp_unpack_dir);
++ if (tmp_dir) {
++ while (1) {
++ dirent = readdir(tmp_dir);
++ if (dirent == NULL) {
++ break;
++ }
++ sprintf_alloc(&tmp_file, "%s/%s",
++ pkg->tmp_unpack_dir, dirent->d_name);
++ if (! file_is_dir(tmp_file)) {
++ unlink(tmp_file);
++ }
++ free(tmp_file);
++ }
++ closedir(tmp_dir);
++ rmdir(pkg->tmp_unpack_dir);
++ free(pkg->tmp_unpack_dir);
++ pkg->tmp_unpack_dir = NULL;
++ }
++ }
++
++ ipkg_message(conf, IPKG_INFO, "cleanup_temporary_files: pkg=%s local_filename=%s tmp_dir=%s\n",
++ pkg->name, pkg->local_filename, conf->tmp_dir);
++ if (pkg->local_filename && strncmp(pkg->local_filename, conf->tmp_dir, strlen(conf->tmp_dir)) == 0) {
++ unlink(pkg->local_filename);
++ free(pkg->local_filename);
++ pkg->local_filename = NULL;
++ }
++
++ return 0;
++}
++
++static char *backup_filename_alloc(const char *file_name)
++{
++ char *backup;
++
++ sprintf_alloc(&backup, "%s%s", file_name, IPKG_BACKUP_SUFFIX);
++
++ return backup;
++}
++
++int backup_make_backup(ipkg_conf_t *conf, const char *file_name)
++{
++ int err;
++ char *backup;
++
++ backup = backup_filename_alloc(file_name);
++ err = file_copy(file_name, backup);
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR,
++ "%s: Failed to copy %s to %s\n",
++ __FUNCTION__, file_name, backup);
++ }
++
++ free(backup);
++
++ return err;
++}
++
++static int backup_exists_for(const char *file_name)
++{
++ int ret;
++ char *backup;
++
++ backup = backup_filename_alloc(file_name);
++
++ ret = file_exists(backup);
++
++ free(backup);
++
++ return ret;
++}
++
++static int backup_remove(const char *file_name)
++{
++ char *backup;
++
++ backup = backup_filename_alloc(file_name);
++ unlink(backup);
++ free(backup);
++
++ return 0;
++}
++
++
++
++#ifdef CONFIG_IPKG_PROCESS_ACTIONS
++
++int ipkg_remove_packages(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_remove)
++{
++ /* first, remove the packages that need removing */
++ for (i = 0 ; i < pkgs_to_remove->len; i++ ) {
++ pkg_t *pkg = pkgs_to_remove->pkgs[i];
++ err = ipkg_remove_pkg(conf, pkg,0);
++ if (err) return err;
++ }
++ return 0;
++}
++
++int ipkg_process_actions_sanity_check(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_remove, pkg_vec_t *pkgs_superseded, pkg_vec_t *pkgs_to_install)
++{
++ int i;
++ /* now one more pass checking on the ones that need to be installed */
++ for (i = 0 ; i < pkgs_to_install->len; i++ ) {
++ pkg_t *pkg = pkgs_to_install->pkgs[i];
++ if (pkg->dest == NULL)
++ pkg->dest = conf->default_dest;
++
++ pkg->state_want = SW_INSTALL;
++
++ /* Abhaya: conflicts check */
++ err = check_conflicts_for(conf, pkg);
++ if (err) { return err; }
++ }
++ return 0;
++}
++
++int ipkg_process_actions_unpack_packages(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_remove, pkg_vec_t *pkgs_to_install)
++{
++ int i;
++ /* now one more pass checking on the ones that need to be installed */
++ for (i = 0 ; i < pkgs_to_install->len; i++ ) {
++ pkg_t *pkg = pkgs_to_install->pkgs[i];
++
++ /* XXX: FEATURE: Need to really support Provides/Replaces: here at some point */
++ pkg_vec_t *replacees = pkg_vec_alloc();
++ pkg_get_installed_replacees(pkg, replacees);
++
++ /* XXX: BUG: we really should treat replacement more like an upgrade
++ * Instead, we're going to remove the replacees
++ */
++ err = pkg_remove_installed_replacees(conf, replacees);
++ if (err) return err;
++ pkg->state_flag |= SF_REMOVED_REPLACEES;
++ }
++ return 0;
++}
++
++int ipkg_process_actions_unpack_packages(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_remove, pkg_vec_t *pkgs_to_install)
++{
++ int i;
++ /* now one more pass checking on the ones that need to be installed */
++ for (i = 0 ; i < pkgs_to_install->len; i++ ) {
++ pkg_t *pkg = pkgs_to_install->pkgs[i];
++ if (pkg->local_filename == NULL) {
++ err = ipkg_download_pkg(conf, pkg, conf->tmp_dir);
++ if (err) {
++ ipkg_message(conf, IPKG_ERROR,
++ "Failed to download %s. Perhaps you need to run 'ipkg update'?\n",
++ pkg->name);
++ return err;
++ }
++ }
++ if (pkg->tmp_unpack_dir == NULL) {
++ err = unpack_pkg_control_files(conf, pkg);
++ if (err) return err;
++ }
++ }
++ return 0;
++}
++
++int ipkg_process_actions_prerm(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_install)
++{
++ int i;
++ /* now one more pass checking on the ones that need to be installed */
++ for (i = 0 ; i < pkgs_to_install->len; i++ ) {
++ pkg_t *pkg = pkgs_to_install->pkgs[i];
++ pkg_t *old_pkg = pkg->old_pkg;
++
++ err = prerm_upgrade_old_pkg(conf, pkg, old_pkg);
++ if (err) return err;
++
++ err = prerm_deconfigure_conflictors(conf, pkg, replacees);
++ if (err) return err;
++
++ err = preinst_configure(conf, pkg, old_pkg);
++ if (err) return err;
++
++ err = backup_modified_conffiles(conf, pkg, old_pkg);
++ if (err) return err;
++
++ err = postrm_upgrade_old_pkg(conf, pkg, old_pkg);
++ if (err) return err;
++ }
++ return 0;
++}
++
++int ipkg_process_actions_install(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_install)
++{
++ int i;
++ /* now one more pass checking on the ones that need to be installed */
++ for (i = 0 ; i < pkgs_to_install->len; i++ ) {
++ pkg_t *pkg = pkgs_to_install->pkgs[i];
++ pkg_t *old_pkg = pkg->old_pkg;
++
++ if (old_pkg) {
++ old_pkg->state_want = SW_DEINSTALL;
++
++ if (old_pkg->state_flag & SF_NOPRUNE) {
++ ipkg_message(conf, IPKG_INFO,
++ " not removing obsolesced files because package marked noprune\n");
++ } else {
++ ipkg_message(conf, IPKG_INFO,
++ " removing obsolesced files\n");
++ remove_obsolesced_files(conf, pkg, old_pkg);
++ }
++ }
++
++ ipkg_message(conf, IPKG_INFO,
++ " installing maintainer scripts\n");
++ install_maintainer_scripts(conf, pkg, old_pkg);
++
++ /* the following just returns 0 */
++ remove_disappeared(conf, pkg);
++
++ ipkg_message(conf, IPKG_INFO,
++ " installing data files\n");
++ install_data_files(conf, pkg);
++
++ ipkg_message(conf, IPKG_INFO,
++ " resolving conf files\n");
++ resolve_conffiles(conf, pkg);
++
++ pkg->state_status = SS_UNPACKED;
++
++ if (old_pkg) {
++ old_pkg->state_status = SS_NOT_INSTALLED;
++ }
++
++ time(&pkg->installed_time);
++
++ ipkg_message(conf, IPKG_INFO,
++ " cleanup temp files\n");
++ cleanup_temporary_files(conf, pkg);
++
++ if (pkg->parent)
++ pkg->parent->state_status = pkg->state_status;
++ }
++ return 0;
++}
++
++int ipkg_process_actions_unwind_prerm(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_install)
++{
++ int i;
++ /* now one more pass checking on the ones that need to be installed */
++ for (i = 0 ; i < pkgs_to_install->len; i++ ) {
++ pkg_t *pkg = pkgs_to_install->pkgs[i];
++ pkg_t *old_pkg = pkg->old_pkg;
++
++ if (old_pkg) {
++ if (old_pkg->state_flags & SF_POSTRM_UPGRADE)
++ postrm_upgrade_old_pkg_unwind(conf, pkg, old_pkg);
++ if (old_pkg->state_flags & SF_CHECK_DATA_FILE_CLASHES)
++ check_data_file_clashes_unwind(conf, pkg, old_pkg);
++ if (old_pkg->state_flags & SF_BACKUP_MODIFIED_CONFFILES)
++ backup_modified_conffiles_unwind(pkg, old_pkg);
++ */
++ if (old_pkg->state_flags & SF_PREINST_CONFIGURE)
++ preinst_configure_unwind(conf, pkg, old_pkg);
++ if (old_pkg->state_flags & SF_DECONFIGURE_CONFLICTORS)
++ prerm_deconfigure_conflictors_unwind(conf, pkg, replacees);
++ if (old_pkg->state_flags & SF_PRERM_UPGRADE)
++ prerm_upgrade_old_pkg_unwind(conf, pkg, old_pkg);
++ */
++
++ if (old_pkg->state_flags & SF_REMOVED_REPLACEES)
++ remove_installed_replacees_unwind(conf, pkg, old_pkg);
++
++ }
++ }
++ return 0;
++}
++
++/*
++ * Perform all the actions.
++ *
++ * pkgs_to_remove are packages marked for removal.
++ * pkgs_superseded are the old packages being replaced by upgrades.
++ *
++ * Assumes pkgs_to_install includes all dependences, recursively, sorted in installable order.
++ */
++int ipkg_process_actions(ipkg_conf_t *conf, pkg_vec_t *pkgs_to_remove, pkg_vec_t *pkgs_superseded, pkg_vec_t *pkgs_to_install)
++{
++ int err;
++ int i;
++
++ err = ipkg_remove_packages(conf, pkgs_to_remove);
++ if (err) return err;
++
++ err = ipkg_process_actions_sanity_check(conf, pkgs_superseded, pkgs_to_install);
++ if (err) return err;
++
++ err = ipkg_process_actions_remove_replacees(conf, pkgs_to_install);
++ if (err) goto UNWIND;
++
++ /* @@@@ look at ipkg_install_pkg for handling replacements */
++ err = ipkg_process_actions_unpack_packages(conf, pkgs_to_install);
++ if (err) goto UNWIND;
++
++ /*
++ * Now that we have the packages unpacked, we can look for data
++ * file clashes. First, we mark the files from the superseded
++ * packages as obsolete. Then we scan the files in
++ * pkgs_to_install, and only complain about clashes with
++ * non-obsolete files.
++ */
++
++ err = ipkg_process_actions_check_data_file_clashes(conf, pkgs_superseded, pkgs_to_install);
++ if (err) goto UNWIND;
++
++ /* this was before checking data file clashes */
++ err = ipkg_process_actions_prerm(conf, pkgs_superseded, pkgs_to_install);
++ if (err) goto UNWIND;
++
++ /* point of no return: no unwinding after this */
++ err = ipkg_process_actions_install(conf, pkgs_to_install);
++ if (err) return err;
++
++ ipkg_message(conf, IPKG_INFO, "Done.\n");
++ return 0;
++
++ UNWIND:
++ ipkg_process_actions_unwind(conf, pkgs_to_install);
++
++ ipkg_message(conf, IPKG_INFO,
++ " cleanup temp files\n");
++ cleanup_temporary_files(conf, pkg);
++
++ ipkg_message(conf, IPKG_INFO,
++ "Failed.\n");
++ return err;
++}
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_install.h busybox-1.12.1/archival/libipkg/ipkg_install.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_install.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_install.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,35 @@
++/* ipkg_install.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_INSTALL_H
++#define IPKG_INSTALL_H
++
++#include "pkg.h"
++#include "ipkg_conf.h"
++
++ipkg_error_t ipkg_install_by_name(ipkg_conf_t *conf, const char *pkg_name);
++ipkg_error_t ipkg_install_multi_by_name(ipkg_conf_t *conf, const char *pkg_name);
++int ipkg_install_from_file(ipkg_conf_t *conf, const char *filename);
++int ipkg_install_pkg(ipkg_conf_t *conf, pkg_t *pkg,int from_upgrading);
++int satisfy_dependencies_for(ipkg_conf_t *conf, pkg_t *pkg);
++
++int ipkg_satisfy_all_dependences(ipkg_conf_t *conf);
++
++int pkg_mark_dependencies_for_installation(ipkg_conf_t *conf, pkg_t *pkg_name, pkg_vec_t *pkgs_needed);
++int name_mark_dependencies_for_installation(ipkg_conf_t *conf, const char *pkg_name, pkg_vec_t *pkgs_needed);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_message.c busybox-1.12.1/archival/libipkg/ipkg_message.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_message.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_message.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,61 @@
++/* ipkg_message.c - the itsy package management system
++
++ Copyright (C) 2003 Daniele Nicolodi <daniele@grinta.net>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++
++#include "ipkg.h"
++#include "ipkg_conf.h"
++#include "ipkg_message.h"
++
++#ifndef IPKG_LIB
++
++void
++ipkg_message (ipkg_conf_t * conf, message_level_t level, char *fmt, ...)
++{
++ va_list ap;
++
++ if (conf && (conf->verbosity < level))
++ {
++ return;
++ }
++ else
++ {
++
++ va_start (ap, fmt);
++ vprintf (fmt, ap);
++ va_end (ap);
++ }
++}
++
++#else
++
++#include "libipkg.h"
++
++//#define ipkg_message(conf, level, fmt, arg...) ipkg_cb_message(conf, level, fmt, ## arg)
++
++void
++ipkg_message (ipkg_conf_t * conf, message_level_t level, const char *fmt, ...)
++{
++ va_list ap;
++ char ts[256];
++
++ if (ipkg_cb_message)
++ {
++ va_start (ap, fmt);
++ vsnprintf (ts,256,fmt, ap);
++ va_end (ap);
++ ipkg_cb_message(conf,level,ts);
++ }
++}
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_message.h busybox-1.12.1/archival/libipkg/ipkg_message.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_message.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_message.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,32 @@
++/* ipkg_message.h - the itsy package management system
++
++ Copyright (C) 2003 Daniele Nicolodi <daniele@grinta.net>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef _IPKG_MESSAGE_H_
++#define _IPKG_MESSAGE_H_
++
++#include "ipkg.h"
++#include "ipkg_conf.h"
++
++typedef enum {
++ IPKG_ERROR, /* error conditions */
++ IPKG_NOTICE, /* normal but significant condition */
++ IPKG_INFO, /* informational message */
++ IPKG_DEBUG, /* debug level message */
++ IPKG_DEBUG2, /* more debug level message */
++} message_level_t;
++
++extern void ipkg_message(ipkg_conf_t *conf, message_level_t level, const char *fmt, ...);
++
++#endif /* _IPKG_MESSAGE_H_ */
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_remove.c busybox-1.12.1/archival/libipkg/ipkg_remove.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_remove.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_remove.c 2008-10-23 14:42:08.000000000 +0200
+@@ -0,0 +1,385 @@
++/* ipkg_remove.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include "ipkg_message.h"
++
++#include <glob.h>
++
++#include "ipkg_remove.h"
++
++#include "file_util.h"
++#include "sprintf_alloc.h"
++#include "str_util.h"
++
++#include "ipkg_cmd.h"
++
++int ipkg_remove_dependent_pkgs (ipkg_conf_t *conf, pkg_t *pkg, abstract_pkg_t **dependents);
++
++/*
++ * Returns number of the number of packages depending on the packages provided by this package.
++ * Every package implicitly provides itself.
++ */
++int pkg_has_installed_dependents(pkg_t *pkg, abstract_pkg_t *** pdependents)
++{
++ int nprovides = pkg->provides_count;
++ abstract_pkg_t **provides = pkg->provides;
++ int n_installed_dependents = 0;
++ int i;
++ for (i = 0; i <= nprovides; i++) {
++ abstract_pkg_t *providee = provides[i];
++ abstract_pkg_t **dependers = providee->depended_upon_by;
++ abstract_pkg_t *dep_ab_pkg;
++ if (dependers == NULL)
++ continue;
++ while ((dep_ab_pkg = *dependers++) != NULL) {
++ if (dep_ab_pkg->state_status == SS_INSTALLED){
++ n_installed_dependents++;
++ }
++ }
++
++ }
++ /* if caller requested the set of installed dependents */
++ if (pdependents) {
++ int p = 0;
++ abstract_pkg_t **dependents = (abstract_pkg_t **)malloc((n_installed_dependents+1)*sizeof(abstract_pkg_t *));
++
++ if ( dependents == NULL ){
++ fprintf(stderr,"%s Unable to allocate memory. REPORT THIS BUG IN BUGZILLA PLEASE\n", __FUNCTION__);
++ return -1;
++ }
++
++ *pdependents = dependents;
++ for (i = 0; i <= nprovides; i++) {
++ abstract_pkg_t *providee = provides[i];
++ abstract_pkg_t **dependers = providee->depended_upon_by;
++ abstract_pkg_t *dep_ab_pkg;
++ if (dependers == NULL)
++ continue;
++ while ((dep_ab_pkg = *dependers++) != NULL) {
++ if (dep_ab_pkg->state_status == SS_INSTALLED && !(dep_ab_pkg->state_flag & SF_MARKED)) {
++ dependents[p++] = dep_ab_pkg;
++ dep_ab_pkg->state_flag |= SF_MARKED;
++ }
++ }
++ }
++ dependents[p] = NULL;
++ /* now clear the marks */
++ for (i = 0; i < p; i++) {
++ abstract_pkg_t *dep_ab_pkg = dependents[i];
++ dep_ab_pkg->state_flag &= ~SF_MARKED;
++ }
++ }
++ return n_installed_dependents;
++}
++
++int ipkg_remove_dependent_pkgs (ipkg_conf_t *conf, pkg_t *pkg, abstract_pkg_t **dependents)
++{
++ int i;
++ int a;
++ int count;
++ pkg_vec_t *dependent_pkgs = pkg_vec_alloc();
++ abstract_pkg_t * ab_pkg;
++
++ if((ab_pkg = pkg->parent) == NULL){
++ fprintf(stderr, "%s: unable to get dependent pkgs. pkg %s isn't in hash table\n",
++ __FUNCTION__, pkg->name);
++ return 0;
++ }
++
++ if (dependents == NULL)
++ return 0;
++
++ // here i am using the dependencies_checked
++ if (ab_pkg->dependencies_checked == 2) // variable to make out whether this package
++ return 0; // has already been encountered in the process
++ // of marking packages for removal - Karthik
++ ab_pkg->dependencies_checked = 2;
++
++ i = 0;
++ count = 1;
++ while (dependents [i] != NULL) {
++ abstract_pkg_t *dep_ab_pkg = dependents[i];
++
++ if (dep_ab_pkg->dependencies_checked == 2){
++ i++;
++ continue;
++ }
++ if (dep_ab_pkg->state_status == SS_INSTALLED) {
++ for (a = 0; a < dep_ab_pkg->pkgs->len; a++) {
++ pkg_t *dep_pkg = dep_ab_pkg->pkgs->pkgs[a];
++ if (dep_pkg->state_status == SS_INSTALLED) {
++ pkg_vec_insert(dependent_pkgs, dep_pkg);
++ count++;
++ }
++ }
++ }
++ i++;
++ /* 1 - to keep track of visited ab_pkgs when checking for possiblility of a broken removal of pkgs.
++ * 2 - to keep track of pkgs whose deps have been checked alrdy - Karthik */
++ }
++
++ if (count == 1)
++ return 0;
++
++
++ for (i = 0; i < dependent_pkgs->len; i++) {
++ int err = ipkg_remove_pkg(conf, dependent_pkgs->pkgs[i],0);
++ if (err)
++ return err;
++ }
++ return 0;
++}
++
++static int user_prefers_removing_dependents(ipkg_conf_t *conf, pkg_t *pkg, abstract_pkg_t **dependents)
++{
++ abstract_pkg_t *dep_ab_pkg;
++ ipkg_message(conf, IPKG_ERROR, "Package %s is depended upon by packages:\n", pkg->name);
++ while ((dep_ab_pkg = *dependents++) != NULL) {
++ if (dep_ab_pkg->state_status == SS_INSTALLED)
++ ipkg_message(conf, IPKG_ERROR, "\t%s\n", dep_ab_pkg->name);
++ }
++ ipkg_message(conf, IPKG_ERROR, "These might cease to work if package %s is removed.\n\n", pkg->name);
++ ipkg_message(conf, IPKG_ERROR, "");
++ ipkg_message(conf, IPKG_ERROR, "You can force removal of this package with -force-depends.\n");
++ ipkg_message(conf, IPKG_ERROR, "You can force removal of this package and its dependents\n");
++ ipkg_message(conf, IPKG_ERROR, "with -force-removal-of-dependent-packages or -recursive\n");
++ ipkg_message(conf, IPKG_ERROR, "or by setting option force_removal_of_dependent_packages\n");
++ ipkg_message(conf, IPKG_ERROR, "in ipkg.conf.\n");
++ return 0;
++}
++
++int ipkg_remove_pkg(ipkg_conf_t *conf, pkg_t *pkg,int message)
++{
++/* Actually, when "message == 1" I have been called from an upgrade, and not from a normal remove
++ thus I wan't check for essential, as I'm upgrading.
++ I hope it won't break anything :)
++*/
++ int err;
++ abstract_pkg_t *parent_pkg = NULL;
++
++ if (pkg->essential && !message) {
++ if (conf->force_removal_of_essential_packages) {
++ fprintf(stderr, "WARNING: Removing essential package %s under your coercion.\n"
++ "\tIf your system breaks, you get to keep both pieces\n",
++ pkg->name);
++ } else {
++ fprintf(stderr, "ERROR: Refusing to remove essential package %s.\n"
++ "\tRemoving an essential package may lead to an unusable system, but if\n"
++ "\tyou enjoy that kind of pain, you can force ipkg to proceed against\n"
++ "\tits will with the option: -force-removal-of-essential-packages\n",
++ pkg->name);
++ return IPKG_PKG_IS_ESSENTIAL;
++ }
++ }
++
++ if ((parent_pkg = pkg->parent) == NULL)
++ return 0;
++
++ /* only attempt to remove dependent installed packages if
++ * force_depends is not specified or the package is being
++ * replaced.
++ */
++ if (!conf->force_depends
++ && !(pkg->state_flag & SF_REPLACE)) {
++ abstract_pkg_t **dependents;
++ int has_installed_dependents =
++ pkg_has_installed_dependents(pkg, &dependents);
++
++ if (has_installed_dependents) {
++ /*
++ * if this package is depended up by others, then either we should
++ * not remove it or we should remove it and all of its dependents
++ */
++
++ if (!conf->force_removal_of_dependent_packages
++ && !user_prefers_removing_dependents(conf, pkg, dependents)) {
++ return IPKG_PKG_HAS_DEPENDENTS;
++ }
++
++ /* remove packages depending on this package - Karthik */
++ err = ipkg_remove_dependent_pkgs (conf, pkg, dependents);
++ free(dependents);
++ if (err) return err;
++ }
++ }
++
++ if ( message==0 ){
++ printf("Removing package %s from %s...\n", pkg->name, pkg->dest->name);
++ fflush(stdout);
++ }
++ pkg->state_flag |= SF_FILELIST_CHANGED;
++
++ pkg->state_want = SW_DEINSTALL;
++ ipkg_state_changed++;
++
++ pkg_run_script(conf, pkg, "prerm", "remove");
++
++ /* DPKG_INCOMPATIBILITY: dpkg is slightly different here. It
++ maintains an empty filelist rather than deleting it. That seems
++ like a big pain, and I don't see that that should make a big
++ difference, but for anyone who wants tighter compatibility,
++ feel free to fix this. */
++ remove_data_files_and_list(conf, pkg);
++
++ pkg_run_script(conf, pkg, "postrm", "remove");
++
++ remove_maintainer_scripts_except_postrm(conf, pkg);
++
++ /* Aman Gupta - Since ipkg is made for handheld devices with limited
++ * space, it doesn't make sense to leave extra configurations, files,
++ * and maintainer scripts left around. So, we make remove like purge,
++ * and take out all the crap :) */
++
++ remove_postrm(conf, pkg);
++ pkg->state_status = SS_NOT_INSTALLED;
++
++ if (parent_pkg)
++ parent_pkg->state_status = SS_NOT_INSTALLED;
++
++ return 0;
++}
++
++int ipkg_purge_pkg(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ ipkg_remove_pkg(conf, pkg,0);
++ return 0;
++}
++
++int remove_data_files_and_list(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ str_list_t installed_dirs;
++ str_list_t *installed_files;
++ str_list_elt_t *iter;
++ char *file_name;
++ conffile_t *conffile;
++ int removed_a_dir;
++ pkg_t *owner;
++
++ str_list_init(&installed_dirs);
++ installed_files = pkg_get_installed_files(pkg);
++
++ for (iter = installed_files->head; iter; iter = iter->next) {
++ file_name = iter->data;
++
++ if (file_is_dir(file_name)) {
++ str_list_append(&installed_dirs, strdup(file_name));
++ continue;
++ }
++
++ conffile = pkg_get_conffile(pkg, file_name);
++ if (conffile) {
++ /* XXX: QUESTION: Is this right? I figure we only need to
++ save the conffile if it has been modified. Is that what
++ dpkg does? Or does dpkg preserve all conffiles? If so,
++ this seems like a better thing to do to conserve
++ space. */
++ if (conffile_has_been_modified(conf, conffile)) {
++ printf(" not deleting modified conffile %s\n", file_name);
++ fflush(stdout);
++ continue;
++ }
++ }
++
++ ipkg_message(conf, IPKG_INFO, " deleting %s (noaction=%d)\n", file_name, conf->noaction);
++ if (!conf->noaction)
++ unlink(file_name);
++ }
++
++ if (!conf->noaction) {
++ do {
++ removed_a_dir = 0;
++ for (iter = installed_dirs.head; iter; iter = iter->next) {
++ file_name = iter->data;
++
++ if (rmdir(file_name) == 0) {
++ ipkg_message(conf, IPKG_INFO, " deleting %s\n", file_name);
++ removed_a_dir = 1;
++ str_list_remove(&installed_dirs, &iter);
++ }
++ }
++ } while (removed_a_dir);
++ }
++
++ pkg_free_installed_files(pkg);
++ /* We have to remove the file list now, so that
++ find_pkg_owning_file does not always just report this package */
++ pkg_remove_installed_files_list(conf, pkg);
++
++ /* Don't print warning for dirs that are provided by other packages */
++ for (iter = installed_dirs.head; iter; iter = iter->next) {
++ file_name = iter->data;
++
++ owner = file_hash_get_file_owner(conf, file_name);
++ if (owner) {
++ free(iter->data);
++ iter->data = NULL;
++ str_list_remove(&installed_dirs, &iter);
++ }
++ }
++
++ /* cleanup */
++ for (iter = installed_dirs.head; iter; iter = iter->next) {
++ free(iter->data);
++ iter->data = NULL;
++ }
++ str_list_deinit(&installed_dirs);
++
++ return 0;
++}
++
++int remove_maintainer_scripts_except_postrm(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ int i, err;
++ char *globpattern;
++ glob_t globbuf;
++
++ if (conf->noaction) return 0;
++
++ sprintf_alloc(&globpattern, "%s/%s.*",
++ pkg->dest->info_dir, pkg->name);
++ err = glob(globpattern, 0, NULL, &globbuf);
++ free(globpattern);
++ if (err) {
++ return 0;
++ }
++
++ for (i = 0; i < globbuf.gl_pathc; i++) {
++ if (str_ends_with(globbuf.gl_pathv[i], ".postrm")) {
++ continue;
++ }
++ ipkg_message(conf, IPKG_INFO, " deleting %s\n", globbuf.gl_pathv[i]);
++ unlink(globbuf.gl_pathv[i]);
++ }
++ globfree(&globbuf);
++
++ return 0;
++}
++
++int remove_postrm(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ char *postrm_file_name;
++
++ if (conf->noaction) return 0;
++
++ sprintf_alloc(&postrm_file_name, "%s/%s.postrm",
++ pkg->dest->info_dir, pkg->name);
++ unlink(postrm_file_name);
++ free(postrm_file_name);
++
++ return 0;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_remove.h busybox-1.12.1/archival/libipkg/ipkg_remove.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_remove.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_remove.h 2008-10-23 14:42:20.000000000 +0200
+@@ -0,0 +1,33 @@
++/* ipkg_remove.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_REMOVE_H
++#define IPKG_REMOVE_H
++
++#include "pkg.h"
++#include "ipkg_conf.h"
++
++int ipkg_remove_pkg(ipkg_conf_t *conf, pkg_t *pkg,int message);
++int ipkg_purge_pkg(ipkg_conf_t *conf, pkg_t *pkg);
++int possible_broken_removal_of_packages (ipkg_conf_t *conf, pkg_t *pkg);
++int pkg_has_installed_dependents(pkg_t *pkg, abstract_pkg_t *** pdependents);
++int remove_data_files_and_list(ipkg_conf_t *conf, pkg_t *pkg);
++int remove_maintainer_scripts_except_postrm (ipkg_conf_t *conf, pkg_t *pkg);
++int remove_postrm (ipkg_conf_t *conf, pkg_t *pkg);
++
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_upgrade.c busybox-1.12.1/archival/libipkg/ipkg_upgrade.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_upgrade.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_upgrade.c 2008-10-23 14:43:14.000000000 +0200
+@@ -0,0 +1,79 @@
++/* ipkg_upgrade.c - the itsy package management system
++
++ Carl D. Worth
++ Copyright (C) 2001 University of Southern California
++
++ Copyright (C) 2003 Daniele Nicolodi <daniele@grinta.net>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include "ipkg_install.h"
++#include "ipkg_message.h"
++
++int ipkg_upgrade_pkg(ipkg_conf_t *conf, pkg_t *old);
++
++int ipkg_upgrade_pkg(ipkg_conf_t *conf, pkg_t *old)
++{
++ pkg_t *new;
++ int cmp;
++ char *old_version, *new_version;
++
++ if (old->state_flag & SF_HOLD) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Not upgrading package %s which is marked "
++ "hold (flags=%#x)\n", old->name, old->state_flag);
++ return 0;
++ }
++
++ new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name);
++ if (new == NULL) {
++ old_version = pkg_version_str_alloc(old);
++ ipkg_message(conf, IPKG_NOTICE,
++ "Assuming locally installed package %s (%s) "
++ "is up to date.\n", old->name, old_version);
++ free(old_version);
++ return 0;
++ }
++
++ old_version = pkg_version_str_alloc(old);
++ new_version = pkg_version_str_alloc(new);
++
++ cmp = pkg_compare_versions(old, new);
++ ipkg_message(conf, IPKG_DEBUG,
++ "comparing visible versions of pkg %s:"
++ "\n\t%s is installed "
++ "\n\t%s is available "
++ "\n\t%d was comparison result\n",
++ old->name, old_version, new_version, cmp);
++ if (cmp == 0) {
++ ipkg_message(conf, IPKG_INFO,
++ "Package %s (%s) installed in %s is up to date.\n",
++ old->name, old_version, old->dest->name);
++ free(old_version);
++ free(new_version);
++ return 0;
++ } else if (cmp > 0) {
++ ipkg_message(conf, IPKG_NOTICE,
++ "Not downgrading package %s on %s from %s to %s.\n",
++ old->name, old->dest->name, old_version, new_version);
++ free(old_version);
++ free(new_version);
++ return 0;
++ } else if (cmp < 0) {
++ new->dest = old->dest;
++ old->state_want = SW_DEINSTALL;
++ }
++
++ new->state_flag |= SF_USER;
++ return ipkg_install_pkg(conf, new,1);
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_upgrade.h busybox-1.12.1/archival/libipkg/ipkg_upgrade.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_upgrade.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_upgrade.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,18 @@
++/* ipkg_upgrade.c - the itsy package management system
++
++ Copyright (C) 2003 Daniele Nicolodi <daniele@grinta.net>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++int ipkg_upgrade_pkg(ipkg_conf_t *conf, pkg_t *old);
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_utils.c busybox-1.12.1/archival/libipkg/ipkg_utils.c
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_utils.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_utils.c 2008-10-23 14:44:05.000000000 +0200
+@@ -0,0 +1,185 @@
++/* ipkg_utils.c - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <errno.h>
++#include <ctype.h>
++#include <sys/vfs.h>
++
++#include "ipkg_utils.h"
++#include "pkg.h"
++#include "pkg_hash.h"
++
++void push_error_list(struct errlist ** errors, char * msg);
++void reverse_error_list(struct errlist **errors);
++void free_error_list(struct errlist **errors);
++
++struct errlist* error_list;
++
++int get_available_blocks(char * filesystem)
++{
++ struct statfs sfs;
++
++ if(statfs(filesystem, &sfs)){
++ fprintf(stderr, "bad statfs\n");
++ return 0;
++ }
++ /* fprintf(stderr, "reported fs type %x\n", sfs.f_type); */
++ return ((sfs.f_bavail * sfs.f_bsize) / 1024);
++}
++
++char **read_raw_pkgs_from_file(const char *file_name)
++{
++ FILE *fp;
++ char **ret;
++
++ if(!(fp = fopen(file_name, "r"))){
++ fprintf(stderr, "can't get %s open for read\n", file_name);
++ return NULL;
++ }
++
++ ret = read_raw_pkgs_from_stream(fp);
++
++ fclose(fp);
++
++ return ret;
++}
++
++char **read_raw_pkgs_from_stream(FILE *fp)
++{
++ char **raw = NULL, *buf, *scout;
++ int count = 0;
++ size_t size = 512;
++
++ buf = malloc (size);
++
++ while (fgets(buf, size, fp)) {
++ while (strlen (buf) == (size - 1)
++ && buf[size-2] != '\n') {
++ size_t o = size - 1;
++ size *= 2;
++ buf = realloc (buf, size);
++ if (fgets (buf + o, size - o, fp) == NULL)
++ break;
++ }
++
++ if(!(count % 50))
++ raw = realloc(raw, (count + 50) * sizeof(char *));
++
++ if((scout = strchr(buf, '\n')))
++ *scout = '\0';
++
++ raw[count++] = strdup(buf);
++ }
++
++ raw = realloc(raw, (count + 1) * sizeof(char *));
++ raw[count] = NULL;
++
++ free (buf);
++
++ return raw;
++}
++
++/* something to remove whitespace, a hash pooper */
++char *trim_alloc(char *line)
++{
++ char *new;
++ char *dest, *src, *end;
++
++ new = malloc(strlen(line) + 1);
++ if ( new == NULL ){
++ fprintf(stderr,"%s: Unable to allocate memory\n",__FUNCTION__);
++ return NULL;
++ }
++ dest = new, src = line, end = line + (strlen(line) - 1);
++
++ /* remove it from the front */
++ while(src &&
++ isspace(*src) &&
++ *src)
++ src++;
++ /* and now from the back */
++ while((end > src) &&
++ isspace(*end))
++ end--;
++ end++;
++ *end = '\0';
++ strcpy(new, src);
++ /* this does from the first space
++ * blasting away any versions stuff in depends
++ while(src &&
++ !isspace(*src) &&
++ *src)
++ *dest++ = *src++;
++ *dest = '\0';
++ */
++
++ return new;
++}
++
++int line_is_blank(const char *line)
++{
++ const char *s;
++
++ for (s = line; *s; s++) {
++ if (!isspace(*s))
++ return 0;
++ }
++ return 1;
++}
++
++void push_error_list(struct errlist ** errors, char * msg){
++ struct errlist *err_lst_tmp;
++
++
++ err_lst_tmp = malloc ( sizeof (err_lst_tmp) );
++ err_lst_tmp->errmsg=strdup(msg) ;
++ err_lst_tmp->next = *errors;
++ *errors = err_lst_tmp;
++}
++
++
++void reverse_error_list(struct errlist **errors){
++ struct errlist *result=NULL;
++ struct errlist *current= *errors;
++ struct errlist *next;
++
++ while ( current != NULL ) {
++ next = current->next;
++ current->next=result;
++ result=current;
++ current=next;
++ }
++ *errors=result;
++
++}
++
++
++void free_error_list(struct errlist **errors){
++ struct errlist *current = *errors;
++
++ while (current != NULL) {
++ free(current->errmsg);
++ current = (*errors)->next;
++ free(*errors);
++ *errors = current;
++ }
++
++
++}
++
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/ipkg_utils.h busybox-1.12.1/archival/libipkg/ipkg_utils.h
+--- busybox-1.12.1.orig/archival/libipkg/ipkg_utils.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/ipkg_utils.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,29 @@
++/* ipkg_utils.h - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKG_UTILS_H
++#define IPKG_UTILS_H
++
++#include "pkg.h"
++
++int get_available_blocks(char * filesystem);
++char **read_raw_pkgs_from_file(const char *file_name);
++char **read_raw_pkgs_from_stream(FILE *fp);
++char *trim_alloc(char * line);
++int line_is_blank(const char *line);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/Kbuild busybox-1.12.1/archival/libipkg/Kbuild
+--- busybox-1.12.1.orig/archival/libipkg/Kbuild 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/Kbuild 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,60 @@
++# Makefile for busybox
++#
++# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
++# Copyright (C) 2006 OpenWrt.org
++#
++# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
++
++LIBIPKG_CORE_OBJS:= \
++ args.o \
++ libipkg.o \
++ user.o \
++
++LIBIPKG_CMD_OBJS:= \
++ ipkg_cmd.o \
++ ipkg_configure.o \
++ ipkg_download.o \
++ ipkg_install.o \
++ ipkg_remove.o \
++ ipkg_upgrade.o \
++
++LIBIPKG_DB_OBJS:= \
++ hash_table.o \
++ ipkg_conf.o \
++ ipkg_utils.o \
++ pkg.o \
++ pkg_depends.o \
++ pkg_extract.o \
++ pkg_hash.o \
++ pkg_parse.o \
++ pkg_vec.o \
++
++LIBIPKG_LIST_OBJS:= \
++ conffile.o \
++ conffile_list.o \
++ nv_pair.o \
++ nv_pair_list.o \
++ pkg_dest.o \
++ pkg_dest_list.o \
++ pkg_src.o \
++ pkg_src_list.o \
++ str_list.o \
++ void_list.o \
++
++LIBIPKG_UTIL_OBJS:= \
++ file_util.o \
++ ipkg_message.o \
++ str_util.o \
++ xsystem.o \
++
++lib-y :=
++lib-$(CONFIG_IPKG) += $(LIBIPKG_CORE_OBJS)
++lib-$(CONFIG_IPKG) += $(LIBIPKG_CMD_OBJS)
++lib-$(CONFIG_IPKG) += $(LIBIPKG_DB_OBJS)
++lib-$(CONFIG_IPKG) += $(LIBIPKG_LIST_OBJS)
++lib-$(CONFIG_IPKG) += $(LIBIPKG_UTIL_OBJS)
++
++ifeq ($(strip $(IPKG_ARCH)),)
++IPKG_ARCH:=$(TARGET_ARCH)
++endif
++CFLAGS += -DIPKG_LIB -DIPKGLIBDIR="\"/usr/lib\"" -DHOST_CPU_STR="\"$(IPKG_ARCH)\""
+diff -Nur busybox-1.12.1.orig/archival/libipkg/libipkg.c busybox-1.12.1/archival/libipkg/libipkg.c
+--- busybox-1.12.1.orig/archival/libipkg/libipkg.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/libipkg.c 2008-10-23 14:59:01.000000000 +0200
+@@ -0,0 +1,532 @@
++/* ipkglib.c - the itsy package management system
++
++ Florina Boor
++
++ Copyright (C) 2003 kernel concepts
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifdef IPKG_LIB
++
++#include "ipkg.h"
++#include "ipkg_includes.h"
++#include "libipkg.h"
++
++#include "args.h"
++#include "ipkg_conf.h"
++#include "ipkg_cmd.h"
++#include "file_util.h"
++
++int ipkg_file_what(args_t *args, const char *file, const char* command);
++int default_ipkg_message_callback(ipkg_conf_t *conf, message_level_t level,
++ char *msg);
++int default_ipkg_list_callback(char *name, char *desc, char *version);
++int default_ipkg_files_callback(char *desc);
++int default_ipkg_status_callback(char *desc);
++char* default_ipkg_response_callback(char *question);
++
++
++ipkg_message_callback ipkg_cb_message = NULL;
++ipkg_response_callback ipkg_cb_response = NULL;
++ipkg_status_callback ipkg_cb_status = NULL;
++ipkg_list_callback ipkg_cb_list = NULL;
++
++
++int
++ipkg_init (ipkg_message_callback mcall,
++ ipkg_response_callback rcall,
++ args_t * args)
++{
++ ipkg_cb_message = mcall;
++ ipkg_cb_response = rcall;
++
++ args_init (args);
++
++ return 0;
++}
++
++
++int
++ipkg_deinit (args_t * args)
++{
++ args_deinit (args);
++ ipkg_cb_message = NULL;
++ ipkg_cb_response = NULL;
++
++ /* place other cleanup stuff here */
++
++ return 0;
++}
++
++
++int
++ipkg_packages_list(args_t *args,
++ const char *packages,
++ ipkg_list_callback cblist,
++ void *userdata)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ ipkg_cb_list = cblist;
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("list");
++ if (packages)
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &packages, userdata);
++ else
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 0, NULL, userdata);
++ ipkg_cb_list = NULL;
++ ipkg_conf_deinit (&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_packages_status(args_t *args,
++ const char *packages,
++ ipkg_status_callback cbstatus,
++ void *userdata)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ ipkg_cb_status = cbstatus;
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("status");
++ if (packages)
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &packages, userdata);
++ else
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 0, NULL, userdata);
++
++ ipkg_cb_status = NULL;
++ ipkg_conf_deinit (&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_packages_info(args_t *args,
++ const char *packages,
++ ipkg_status_callback cbstatus,
++ void *userdata)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ ipkg_cb_status = cbstatus;
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("info");
++ if (packages)
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &packages, userdata);
++ else
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 0, NULL, userdata);
++
++ ipkg_cb_status = NULL;
++ ipkg_conf_deinit (&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_packages_install (args_t * args, const char *name)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ /* this error should be handled in application */
++ if (!name || !strlen (name))
++ return (-1);
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("install");
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &name, NULL);
++
++ ipkg_conf_deinit(&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_packages_remove(args_t *args, const char *name, int purge)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ /* this error should be handled in application */
++ if (!name || !strlen (name))
++ return (-1);
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ if (purge)
++ cmd = ipkg_cmd_find ("purge");
++ else
++ cmd = ipkg_cmd_find ("remove");
++
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &name, NULL);
++
++ ipkg_conf_deinit(&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_lists_update(args_t *args)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("update");
++
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 0, NULL, NULL);
++
++ ipkg_conf_deinit(&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_packages_upgrade(args_t *args)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("upgrade");
++
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 0, NULL, NULL);
++
++ ipkg_conf_deinit(&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_packages_download (args_t * args, const char *name)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ /* this error should be handled in application */
++ if (!name || !strlen (name))
++ return (-1);
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("download");
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &name, NULL);
++
++ ipkg_conf_deinit(&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_package_files(args_t *args,
++ const char *name,
++ ipkg_list_callback cblist,
++ void *userdata)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ /* this error should be handled in application */
++ if (!name || !strlen (name))
++ return (-1);
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ ipkg_cb_list = cblist;
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("files");
++
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &name, userdata);
++
++ ipkg_cb_list = NULL;
++ ipkg_conf_deinit(&ipkg_conf);
++ return (err);
++}
++
++
++int
++ipkg_file_search(args_t *args,
++ const char *file,
++ ipkg_list_callback cblist,
++ void *userdata)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ /* this error should be handled in application */
++ if (!file || !strlen (file))
++ return (-1);
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ ipkg_cb_list = cblist;
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find ("search");
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &file, userdata);
++
++ ipkg_cb_list = NULL;
++ ipkg_conf_deinit(&ipkg_conf);
++ return(err);
++}
++
++
++int
++ipkg_file_what(args_t *args, const char *file, const char* command)
++{
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ int err;
++
++ /* this error should be handled in application */
++ if (!file || !strlen (file))
++ return (-1);
++
++ err = ipkg_conf_init (&ipkg_conf, args);
++ if (err)
++ {
++ return err;
++ }
++
++ /* we need to do this because of static declarations,
++ * maybe a good idea to change */
++ cmd = ipkg_cmd_find (command);
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, 1, &file, NULL);
++
++ ipkg_conf_deinit(&ipkg_conf);
++ return(err);
++}
++
++#define ipkg_package_whatdepends(args,file) ipkg_file_what(args,file,"whatdepends")
++#define ipkg_package_whatrecommends(args, file) ipkg_file_what(args,file,"whatrecommends")
++#define ipkg_package_whatprovides(args, file) ipkg_file_what(args,file,"whatprovides")
++#define ipkg_package_whatconflicts(args, file) ipkg_file_what(args,file,"whatconflicts")
++#define ipkg_package_whatreplaces(args, file) ipkg_file_what(args,file,"whatreplaces")
++
++
++int default_ipkg_message_callback(ipkg_conf_t *conf, message_level_t level,
++ char *msg)
++{
++ if (conf && (conf->verbosity < level)) {
++ return 0;
++ } else {
++#ifdef IPKG_LIB
++ if ( level == IPKG_ERROR ){
++ push_error_list(&error_list, msg);
++// printf(msg);
++ } else
++#endif
++ printf(msg);
++ }
++ return 0;
++}
++
++int default_ipkg_list_callback(char *name, char *desc, char *version)
++{
++ if (desc)
++ printf("%s - %s - %s\n", name, version, desc);
++ else
++ printf("%s - %s\n", name, version);
++ return 0;
++}
++
++int default_ipkg_files_callback(char *desc)
++{
++ if (desc)
++ printf("%s\n", desc);
++ return 0;
++}
++
++int default_ipkg_status_callback(char *desc)
++{
++ printf("%s\n", desc);
++ return 0;
++}
++
++char* default_ipkg_response_callback(char *question)
++{
++ char *response = NULL;
++ printf(question);
++ fflush(stdout);
++ do {
++ response = (char *)file_read_line_alloc(stdin);
++ } while (response == NULL);
++ return response;
++}
++
++/* This is used for backward compatibility */
++int
++ipkg_op (int argc, char *argv[])
++{
++ int err, optind_;
++ args_t args;
++ char *cmd_name;
++ ipkg_cmd_t *cmd;
++ ipkg_conf_t ipkg_conf;
++ const char *message = "ipkg must have one sub-command argument";
++
++ args_init (&args);
++
++ optind_ = args_parse (&args, argc, argv);
++ if (optind_ == argc || optind_ < 0)
++ {
++ args_usage(message);
++ }
++
++ cmd_name = argv[optind_++];
++/* Pigi: added a flag to disable the checking of structures if the command does not need to
++ read anything from there.
++*/
++ if ( !strcmp(cmd_name,"print-architecture") ||
++ !strcmp(cmd_name,"print_architecture") ||
++ !strcmp(cmd_name,"print-installation-architecture") ||
++ !strcmp(cmd_name,"print_installation_architecture") )
++ args.nocheckfordirorfile = 1;
++
++/* Pigi: added a flag to disable the reading of feed files if the command does not need to
++ read anything from there.
++*/
++ if ( !strcmp(cmd_name,"flag") ||
++ !strcmp(cmd_name,"configure") ||
++ !strcmp(cmd_name,"remove") ||
++ !strcmp(cmd_name,"files") ||
++ !strcmp(cmd_name,"search") ||
++ !strcmp(cmd_name,"compare_versions") ||
++ !strcmp(cmd_name,"compare-versions") ||
++ !strcmp(cmd_name,"list_installed") ||
++ !strcmp(cmd_name,"list-installed") ||
++ !strcmp(cmd_name,"status") )
++ args.noreadfeedsfile = 1;
++
++
++ err = ipkg_conf_init (&ipkg_conf, &args);
++ if (err)
++ {
++ return err;
++ }
++
++ args_deinit (&args);
++
++ ipkg_cb_message = default_ipkg_message_callback;
++ ipkg_cb_response = default_ipkg_response_callback;
++ ipkg_cb_status = (ipkg_status_callback)default_ipkg_status_callback;
++ if ( strcmp(cmd_name, "files")==0)
++ ipkg_cb_list = (ipkg_list_callback)default_ipkg_files_callback;
++ else
++ ipkg_cb_list = (ipkg_list_callback)default_ipkg_list_callback;
++
++ cmd = ipkg_cmd_find (cmd_name);
++ if (cmd == NULL)
++ {
++ fprintf (stderr, "%s: unknown sub-command %s\n", argv[0],
++ cmd_name);
++ args_usage (NULL);
++ }
++
++ if (cmd->requires_args && optind_ == argc)
++ {
++ fprintf (stderr,
++ "%s: the ``%s'' command requires at least one argument\n",
++ __FUNCTION__, cmd_name);
++ args_usage (NULL);
++ }
++
++ err = ipkg_cmd_exec (cmd, &ipkg_conf, argc - optind_, (const char **) (argv + optind_), NULL);
++
++ ipkg_conf_deinit (&ipkg_conf);
++
++ return err;
++}
++
++#endif /* IPKG_LIB */
+diff -Nur busybox-1.12.1.orig/archival/libipkg/libipkg.h busybox-1.12.1/archival/libipkg/libipkg.h
+--- busybox-1.12.1.orig/archival/libipkg/libipkg.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/libipkg.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,87 @@
++/* ipkglib.h - the itsy package management system
++
++ Florian Boor <florian.boor@kernelconcepts.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef IPKGLIB_H
++#define IPKGLIB_H
++
++#ifdef IPKG_LIB
++
++#include "ipkg_conf.h"
++#include "ipkg_message.h"
++
++#include "args.h"
++#include "pkg.h"
++
++typedef int (*ipkg_message_callback)(ipkg_conf_t *conf, message_level_t level,
++ char *msg);
++typedef int (*ipkg_list_callback)(char *name, char *desc, char *version,
++ pkg_state_status_t status, void *userdata);
++typedef int (*ipkg_status_callback)(char *name, int istatus, char *desc,
++ void *userdata);
++typedef char* (*ipkg_response_callback)(char *question);
++
++extern int ipkg_op(int argc, char *argv[]); /* ipkglib.c */
++extern int ipkg_init (ipkg_message_callback mcall,
++ ipkg_response_callback rcall,
++ args_t * args);
++
++extern int ipkg_deinit (args_t *args);
++extern int ipkg_packages_list(args_t *args,
++ const char *packages,
++ ipkg_list_callback cblist,
++ void *userdata);
++extern int ipkg_packages_status(args_t *args,
++ const char *packages,
++ ipkg_status_callback cbstatus,
++ void *userdata);
++extern int ipkg_packages_info(args_t *args,
++ const char *packages,
++ ipkg_status_callback cbstatus,
++ void *userdata);
++extern int ipkg_packages_install(args_t *args, const char *name);
++extern int ipkg_packages_remove(args_t *args, const char *name, int purge);
++extern int ipkg_lists_update(args_t *args);
++extern int ipkg_packages_upgrade(args_t *args);
++extern int ipkg_packages_download(args_t *args, const char *name);
++extern int ipkg_package_files(args_t *args,
++ const char *name,
++ ipkg_list_callback cblist,
++ void *userdata);
++extern int ipkg_file_search(args_t *args,
++ const char *file,
++ ipkg_list_callback cblist,
++ void *userdata);
++extern int ipkg_package_whatdepends(args_t *args, const char *file);
++extern int ipkg_package_whatrecommends(args_t *args, const char *file);
++extern int ipkg_package_whatprovides(args_t *args, const char *file);
++extern int ipkg_package_whatconflicts(args_t *args, const char *file);
++extern int ipkg_package_whatreplaces(args_t *args, const char *file);
++
++extern ipkg_message_callback ipkg_cb_message; /* ipkglib.c */
++extern ipkg_response_callback ipkg_cb_response;
++extern ipkg_status_callback ipkg_cb_status;
++extern ipkg_list_callback ipkg_cb_list;
++extern void push_error_list(struct errlist **errors,char * msg);
++extern void reverse_error_list(struct errlist **errors);
++extern void free_error_list(struct errlist **errors);
++
++#else
++
++extern int ipkg_op(int argc, char *argv[]);
++
++#endif
++
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/nv_pair.c busybox-1.12.1/archival/libipkg/nv_pair.c
+--- busybox-1.12.1.orig/archival/libipkg/nv_pair.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/nv_pair.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,40 @@
++/* nv_pair.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "nv_pair.h"
++#include "str_util.h"
++
++int nv_pair_init(nv_pair_t *nv_pair, const char *name, const char *value)
++{
++ nv_pair->name = str_dup_safe(name);
++ nv_pair->value = str_dup_safe(value);
++
++ return 0;
++}
++
++void nv_pair_deinit(nv_pair_t *nv_pair)
++{
++ free(nv_pair->name);
++ nv_pair->name = NULL;
++
++ free(nv_pair->value);
++ nv_pair->value = NULL;
++}
++
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/nv_pair.h busybox-1.12.1/archival/libipkg/nv_pair.h
+--- busybox-1.12.1.orig/archival/libipkg/nv_pair.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/nv_pair.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,32 @@
++/* nv_pair.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef NV_PAIR_H
++#define NV_PAIR_H
++
++typedef struct nv_pair nv_pair_t;
++struct nv_pair
++{
++ char *name;
++ char *value;
++};
++
++int nv_pair_init(nv_pair_t *nv_pair, const char *name, const char *value);
++void nv_pair_deinit(nv_pair_t *nv_pair);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/nv_pair_list.c busybox-1.12.1/archival/libipkg/nv_pair_list.c
+--- busybox-1.12.1.orig/archival/libipkg/nv_pair_list.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/nv_pair_list.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,98 @@
++/* nv_pair_list.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "nv_pair.h"
++#include "void_list.h"
++#include "nv_pair_list.h"
++
++int nv_pair_list_elt_init(nv_pair_list_elt_t *elt, nv_pair_t *data)
++{
++ return void_list_elt_init((void_list_elt_t *) elt, data);
++}
++
++void nv_pair_list_elt_deinit(nv_pair_list_elt_t *elt)
++{
++ void_list_elt_deinit((void_list_elt_t *) elt);
++}
++
++int nv_pair_list_init(nv_pair_list_t *list)
++{
++ return void_list_init((void_list_t *) list);
++}
++
++void nv_pair_list_deinit(nv_pair_list_t *list)
++{
++ nv_pair_list_elt_t *iter;
++ nv_pair_t *nv_pair;
++
++ for (iter = list->head; iter; iter = iter->next) {
++ nv_pair = iter->data;
++ nv_pair_deinit(nv_pair);
++
++ /* malloced in nv_pair_list_append */
++ free(nv_pair);
++ iter->data = NULL;
++ }
++ void_list_deinit((void_list_t *) list);
++}
++
++nv_pair_t *nv_pair_list_append(nv_pair_list_t *list, const char *name, const char *value)
++{
++ int err;
++
++ /* freed in nv_pair_list_deinit */
++ nv_pair_t *nv_pair = malloc(sizeof(nv_pair_t));
++
++ if (nv_pair == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ nv_pair_init(nv_pair, name, value);
++
++ err = void_list_append((void_list_t *) list, nv_pair);
++ if (err) {
++ return NULL;
++ }
++
++ return nv_pair;
++}
++
++int nv_pair_list_push(nv_pair_list_t *list, nv_pair_t *data)
++{
++ return void_list_push((void_list_t *) list, data);
++}
++
++nv_pair_list_elt_t *nv_pair_list_pop(nv_pair_list_t *list)
++{
++ return (nv_pair_list_elt_t *) void_list_pop((void_list_t *) list);
++}
++
++char *nv_pair_list_find(nv_pair_list_t *list, char *name)
++{
++ nv_pair_list_elt_t *iter;
++ nv_pair_t *nv_pair;
++
++ for (iter = list->head; iter; iter = iter->next) {
++ nv_pair = iter->data;
++ if (strcmp(nv_pair->name, name) == 0) {
++ return nv_pair->value;
++ }
++ }
++ return NULL;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/nv_pair_list.h busybox-1.12.1/archival/libipkg/nv_pair_list.h
+--- busybox-1.12.1.orig/archival/libipkg/nv_pair_list.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/nv_pair_list.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,60 @@
++/* nv_pair_list.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef NV_PAIR_LIST_H
++#define NV_PAIR_LIST_H
++
++#include "nv_pair.h"
++#include "void_list.h"
++
++typedef struct nv_pair_list_elt nv_pair_list_elt_t;
++struct nv_pair_list_elt
++{
++ nv_pair_list_elt_t *next;
++ nv_pair_t *data;
++};
++
++typedef struct nv_pair_list nv_pair_list_t;
++struct nv_pair_list
++{
++ nv_pair_list_elt_t pre_head;
++ nv_pair_list_elt_t *head;
++ nv_pair_list_elt_t *tail;
++};
++
++static inline int nv_pair_list_empty(nv_pair_list_t *list)
++{
++ if (list->head == NULL)
++ return 1;
++ else
++ return 0;
++}
++
++int nv_pair_list_elt_init(nv_pair_list_elt_t *elt, nv_pair_t *data);
++void nv_pair_list_elt_deinit(nv_pair_list_elt_t *elt);
++
++int nv_pair_list_init(nv_pair_list_t *list);
++void nv_pair_list_deinit(nv_pair_list_t *list);
++
++nv_pair_t *nv_pair_list_append(nv_pair_list_t *list,
++ const char *name, const char *value);
++int nv_pair_list_push(nv_pair_list_t *list, nv_pair_t *data);
++nv_pair_list_elt_t *nv_pair_list_pop(nv_pair_list_t *list);
++char *nv_pair_list_find(nv_pair_list_t *list, char *name);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg.c busybox-1.12.1/archival/libipkg/pkg.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg.c 2008-10-23 15:02:19.000000000 +0200
+@@ -0,0 +1,1757 @@
++/* pkg.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <ctype.h>
++#include <string.h>
++#include <errno.h>
++
++#include "pkg.h"
++
++#include "pkg_parse.h"
++#include "pkg_extract.h"
++#include "ipkg_message.h"
++#include "ipkg_utils.h"
++
++#include "sprintf_alloc.h"
++#include "file_util.h"
++#include "str_util.h"
++#include "xsystem.h"
++#include "ipkg_conf.h"
++
++int pkg_get_arch_priority(ipkg_conf_t *conf, const char *archname);
++void pkg_write_filelist_helper(const char *key, void *entry_, void *data_);
++
++typedef struct enum_map enum_map_t;
++struct enum_map
++{
++ int value;
++ const char *str;
++};
++
++static const enum_map_t pkg_state_want_map[] = {
++ { SW_UNKNOWN, "unknown"},
++ { SW_INSTALL, "install"},
++ { SW_DEINSTALL, "deinstall"},
++ { SW_PURGE, "purge"}
++};
++
++static const enum_map_t pkg_state_flag_map[] = {
++ { SF_OK, "ok"},
++ { SF_REINSTREQ, "reinstreq"},
++ { SF_HOLD, "hold"},
++ { SF_REPLACE, "replace"},
++ { SF_NOPRUNE, "noprune"},
++ { SF_PREFER, "prefer"},
++ { SF_OBSOLETE, "obsolete"},
++ { SF_USER, "user"},
++};
++
++static const enum_map_t pkg_state_status_map[] = {
++ { SS_NOT_INSTALLED, "not-installed" },
++ { SS_UNPACKED, "unpacked" },
++ { SS_HALF_CONFIGURED, "half-configured" },
++ { SS_INSTALLED, "installed" },
++ { SS_HALF_INSTALLED, "half-installed" },
++ { SS_CONFIG_FILES, "config-files" },
++ { SS_POST_INST_FAILED, "post-inst-failed" },
++ { SS_REMOVAL_FAILED, "removal-failed" }
++};
++
++static int verrevcmp(const char *val, const char *ref);
++
++
++pkg_t *pkg_new(void)
++{
++ pkg_t *pkg;
++
++ pkg = malloc(sizeof(pkg_t));
++ if (pkg == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++
++ pkg_init(pkg);
++
++ return pkg;
++}
++
++int pkg_init(pkg_t *pkg)
++{
++ memset(pkg, 0, sizeof(pkg_t));
++ pkg->name = NULL;
++ pkg->epoch = 0;
++ pkg->version = NULL;
++ pkg->revision = NULL;
++ pkg->familiar_revision = NULL;
++ pkg->dest = NULL;
++ pkg->src = NULL;
++ pkg->architecture = NULL;
++ pkg->maintainer = NULL;
++ pkg->section = NULL;
++ pkg->description = NULL;
++ pkg->state_want = SW_UNKNOWN;
++ pkg->state_flag = SF_OK;
++ pkg->state_status = SS_NOT_INSTALLED;
++ pkg->depends_str = NULL;
++ pkg->provides_str = NULL;
++ pkg->depends_count = 0;
++ pkg->depends = NULL;
++ pkg->suggests_str = NULL;
++ pkg->recommends_str = NULL;
++ pkg->suggests_count = 0;
++ pkg->recommends_count = 0;
++
++ /* Abhaya: added init for conflicts fields */
++ pkg->conflicts = NULL;
++ pkg->conflicts_count = 0;
++
++ /* added for replaces. Jamey 7/23/2002 */
++ pkg->replaces = NULL;
++ pkg->replaces_count = 0;
++
++ pkg->pre_depends_count = 0;
++ pkg->pre_depends_str = NULL;
++ pkg->provides_count = 0;
++ pkg->provides = NULL;
++ pkg->filename = NULL;
++ pkg->local_filename = NULL;
++ pkg->tmp_unpack_dir = NULL;
++ pkg->md5sum = NULL;
++ pkg->size = NULL;
++ pkg->installed_size = NULL;
++ pkg->priority = NULL;
++ pkg->source = NULL;
++ conffile_list_init(&pkg->conffiles);
++ pkg->installed_files = NULL;
++ pkg->installed_files_ref_cnt = 0;
++ pkg->essential = 0;
++ pkg->provided_by_hand = 0;
++
++ return 0;
++}
++
++void pkg_deinit(pkg_t *pkg)
++{
++ free(pkg->name);
++ pkg->name = NULL;
++ pkg->epoch = 0;
++ free(pkg->version);
++ pkg->version = NULL;
++ /* revision and familiar_revision share storage with version, so
++ don't free */
++ pkg->revision = NULL;
++ pkg->familiar_revision = NULL;
++ /* owned by ipkg_conf_t */
++ pkg->dest = NULL;
++ /* owned by ipkg_conf_t */
++ pkg->src = NULL;
++ free(pkg->architecture);
++ pkg->architecture = NULL;
++ free(pkg->maintainer);
++ pkg->maintainer = NULL;
++ free(pkg->section);
++ pkg->section = NULL;
++ free(pkg->description);
++ pkg->description = NULL;
++ pkg->state_want = SW_UNKNOWN;
++ pkg->state_flag = SF_OK;
++ pkg->state_status = SS_NOT_INSTALLED;
++ free(pkg->depends_str);
++ pkg->depends_str = NULL;
++ free(pkg->provides_str);
++ pkg->provides_str = NULL;
++ pkg->depends_count = 0;
++ /* XXX: CLEANUP: MEMORY_LEAK: how to free up pkg->depends ? */
++ pkg->pre_depends_count = 0;
++ free(pkg->pre_depends_str);
++ pkg->pre_depends_str = NULL;
++ pkg->provides_count = 0;
++ /* XXX: CLEANUP: MEMORY_LEAK: how to free up pkg->provides ? */
++ /* XXX: CLEANUP: MEMORY_LEAK: how to free up pkg->suggests ? */
++ free(pkg->filename);
++ pkg->filename = NULL;
++ free(pkg->local_filename);
++ pkg->local_filename = NULL;
++ /* CLEANUP: It'd be nice to pullin the cleanup function from
++ ipkg_install.c here. See comment in
++ ipkg_install.c:cleanup_temporary_files */
++ free(pkg->tmp_unpack_dir);
++ pkg->tmp_unpack_dir = NULL;
++ free(pkg->md5sum);
++ pkg->md5sum = NULL;
++ free(pkg->size);
++ pkg->size = NULL;
++ free(pkg->installed_size);
++ pkg->installed_size = NULL;
++ free(pkg->priority);
++ pkg->priority = NULL;
++ free(pkg->source);
++ pkg->source = NULL;
++ conffile_list_deinit(&pkg->conffiles);
++ /* XXX: QUESTION: Is forcing this to 1 correct? I suppose so,
++ since if they are calling deinit, they should know. Maybe do an
++ assertion here instead? */
++ pkg->installed_files_ref_cnt = 1;
++ pkg_free_installed_files(pkg);
++ pkg->essential = 0;
++}
++
++int pkg_init_from_file(pkg_t *pkg, const char *filename)
++{
++ int err;
++ char **raw;
++ FILE *control_file;
++
++ err = pkg_init(pkg);
++ if (err) { return err; }
++
++ pkg->local_filename = strdup(filename);
++
++ control_file = tmpfile();
++ err = pkg_extract_control_file_to_stream(pkg, control_file);
++ if (err) { return err; }
++
++ rewind(control_file);
++ raw = read_raw_pkgs_from_stream(control_file);
++ pkg_parse_raw(pkg, &raw, NULL, NULL);
++
++ fclose(control_file);
++
++ return 0;
++}
++
++/* Merge any new information in newpkg into oldpkg */
++/* XXX: CLEANUP: This function shouldn't actually modify anything in
++ newpkg, but should leave it usable. This rework is so that
++ pkg_hash_insert doesn't clobber the pkg that you pass into it. */
++/*
++ * uh, i thought that i had originally written this so that it took
++ * two pkgs and returned a new one? we can do that again... -sma
++ */
++int pkg_merge(pkg_t *oldpkg, pkg_t *newpkg, int set_status)
++{
++ if (oldpkg == newpkg) {
++ return 0;
++ }
++
++ if (!oldpkg->src)
++ oldpkg->src = newpkg->src;
++ if (!oldpkg->dest)
++ oldpkg->dest = newpkg->dest;
++ if (!oldpkg->architecture)
++ oldpkg->architecture = str_dup_safe(newpkg->architecture);
++ if (!oldpkg->arch_priority)
++ oldpkg->arch_priority = newpkg->arch_priority;
++ if (!oldpkg->section)
++ oldpkg->section = str_dup_safe(newpkg->section);
++ if(!oldpkg->maintainer)
++ oldpkg->maintainer = str_dup_safe(newpkg->maintainer);
++ if(!oldpkg->description)
++ oldpkg->description = str_dup_safe(newpkg->description);
++ if (set_status) {
++ /* merge the state_flags from the new package */
++ oldpkg->state_want = newpkg->state_want;
++ oldpkg->state_status = newpkg->state_status;
++ oldpkg->state_flag = newpkg->state_flag;
++ } else {
++ if (oldpkg->state_want == SW_UNKNOWN)
++ oldpkg->state_want = newpkg->state_want;
++ if (oldpkg->state_status == SS_NOT_INSTALLED)
++ oldpkg->state_status = newpkg->state_status;
++ oldpkg->state_flag |= newpkg->state_flag;
++ }
++
++ if (!oldpkg->depends_str && !oldpkg->pre_depends_str && !oldpkg->recommends_str && !oldpkg->suggests_str) {
++ oldpkg->depends_str = newpkg->depends_str;
++ newpkg->depends_str = NULL;
++ oldpkg->depends_count = newpkg->depends_count;
++ newpkg->depends_count = 0;
++
++ oldpkg->depends = newpkg->depends;
++ newpkg->depends = NULL;
++
++ oldpkg->pre_depends_str = newpkg->pre_depends_str;
++ newpkg->pre_depends_str = NULL;
++ oldpkg->pre_depends_count = newpkg->pre_depends_count;
++ newpkg->pre_depends_count = 0;
++
++ oldpkg->recommends_str = newpkg->recommends_str;
++ newpkg->recommends_str = NULL;
++ oldpkg->recommends_count = newpkg->recommends_count;
++ newpkg->recommends_count = 0;
++
++ oldpkg->suggests_str = newpkg->suggests_str;
++ newpkg->suggests_str = NULL;
++ oldpkg->suggests_count = newpkg->suggests_count;
++ newpkg->suggests_count = 0;
++ }
++
++ if (!oldpkg->provides_str) {
++ oldpkg->provides_str = newpkg->provides_str;
++ newpkg->provides_str = NULL;
++ oldpkg->provides_count = newpkg->provides_count;
++ newpkg->provides_count = 0;
++
++ oldpkg->provides = newpkg->provides;
++ newpkg->provides = NULL;
++ }
++
++ if (!oldpkg->conflicts_str) {
++ oldpkg->conflicts_str = newpkg->conflicts_str;
++ newpkg->conflicts_str = NULL;
++ oldpkg->conflicts_count = newpkg->conflicts_count;
++ newpkg->conflicts_count = 0;
++
++ oldpkg->conflicts = newpkg->conflicts;
++ newpkg->conflicts = NULL;
++ }
++
++ if (!oldpkg->replaces_str) {
++ oldpkg->replaces_str = newpkg->replaces_str;
++ newpkg->replaces_str = NULL;
++ oldpkg->replaces_count = newpkg->replaces_count;
++ newpkg->replaces_count = 0;
++
++ oldpkg->replaces = newpkg->replaces;
++ newpkg->replaces = NULL;
++ }
++
++ if (!oldpkg->filename)
++ oldpkg->filename = str_dup_safe(newpkg->filename);
++ if (0)
++ fprintf(stdout, "pkg=%s old local_filename=%s new local_filename=%s\n",
++ oldpkg->name, oldpkg->local_filename, newpkg->local_filename);
++ if (!oldpkg->local_filename)
++ oldpkg->local_filename = str_dup_safe(newpkg->local_filename);
++ if (!oldpkg->tmp_unpack_dir)
++ oldpkg->tmp_unpack_dir = str_dup_safe(newpkg->tmp_unpack_dir);
++ if (!oldpkg->md5sum)
++ oldpkg->md5sum = str_dup_safe(newpkg->md5sum);
++ if (!oldpkg->size)
++ oldpkg->size = str_dup_safe(newpkg->size);
++ if (!oldpkg->installed_size)
++ oldpkg->installed_size = str_dup_safe(newpkg->installed_size);
++ if (!oldpkg->priority)
++ oldpkg->priority = str_dup_safe(newpkg->priority);
++ if (!oldpkg->source)
++ oldpkg->source = str_dup_safe(newpkg->source);
++ if (oldpkg->conffiles.head == NULL){
++ oldpkg->conffiles = newpkg->conffiles;
++ conffile_list_init(&newpkg->conffiles);
++ }
++ if (!oldpkg->installed_files){
++ oldpkg->installed_files = newpkg->installed_files;
++ oldpkg->installed_files_ref_cnt = newpkg->installed_files_ref_cnt;
++ newpkg->installed_files = NULL;
++ }
++ if (!oldpkg->essential)
++ oldpkg->essential = newpkg->essential;
++
++ return 0;
++}
++
++abstract_pkg_t *abstract_pkg_new(void)
++{
++ abstract_pkg_t * ab_pkg;
++
++ ab_pkg = malloc(sizeof(abstract_pkg_t));
++
++ if (ab_pkg == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++
++ if ( abstract_pkg_init(ab_pkg) < 0 )
++ return NULL;
++
++ return ab_pkg;
++}
++
++int abstract_pkg_init(abstract_pkg_t *ab_pkg)
++{
++ memset(ab_pkg, 0, sizeof(abstract_pkg_t));
++
++ ab_pkg->provided_by = abstract_pkg_vec_alloc();
++ if (ab_pkg->provided_by==NULL){
++ return -1;
++ }
++ ab_pkg->dependencies_checked = 0;
++ ab_pkg->state_status = SS_NOT_INSTALLED;
++
++ return 0;
++}
++
++void set_flags_from_control(ipkg_conf_t *conf, pkg_t *pkg){
++ char * temp_str;
++ char **raw =NULL;
++ char **raw_start=NULL;
++
++ temp_str = (char *) malloc (strlen(pkg->dest->info_dir)+strlen(pkg->name)+12);
++ if (temp_str == NULL ){
++ ipkg_message(conf, IPKG_INFO, "Out of memory in %s\n", __FUNCTION__);
++ return;
++ }
++ sprintf( temp_str,"%s/%s.control",pkg->dest->info_dir,pkg->name);
++
++ raw = raw_start = read_raw_pkgs_from_file(temp_str);
++ if (raw == NULL ){
++ ipkg_message(conf, IPKG_ERROR, "Unable to open the control file in %s\n", __FUNCTION__);
++ return;
++ }
++
++ while(*raw){
++ if (!pkg_valorize_other_field(pkg, &raw ) == 0) {
++ ipkg_message(conf, IPKG_DEBUG, "unable to read control file for %s. May be empty\n", pkg->name);
++ }
++ }
++ raw = raw_start;
++ while (*raw) {
++ if (raw!=NULL)
++ free(*raw++);
++ }
++
++ free(raw_start);
++ free(temp_str);
++
++ return ;
++
++}
++
++char * pkg_formatted_info(pkg_t *pkg )
++{
++ char *line;
++ char * buff;
++
++ buff = malloc(8192);
++ if (buff == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++
++ buff[0] = '\0';
++
++ line = pkg_formatted_field(pkg, "Package");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Version");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Depends");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Recommends");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Suggests");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Provides");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Replaces");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Conflicts");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Status");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Section");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Essential"); /* @@@@ should be removed in future release. *//* I do not agree with this Pigi*/
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Architecture");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Maintainer");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "MD5sum");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Size");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Filename");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Conffiles");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Source");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Description");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ line = pkg_formatted_field(pkg, "Installed-Time");
++ strncat(buff ,line, strlen(line));
++ free(line);
++
++ return buff;
++}
++
++char * pkg_formatted_field(pkg_t *pkg, const char *field )
++{
++ static size_t LINE_LEN = 128;
++ char * temp = (char *)malloc(1);
++ int len = 0;
++ int flag_provide_false = 0;
++
++/*
++ Pigi: After some discussion with Florian we decided to modify the full procedure in
++ dynamic memory allocation. This should avoid any other segv in this area ( except for bugs )
++*/
++
++ if (strlen(field) < PKG_MINIMUM_FIELD_NAME_LEN) {
++ goto UNKNOWN_FMT_FIELD;
++ }
++
++ temp[0]='\0';
++
++ switch (field[0])
++ {
++ case 'a':
++ case 'A':
++ if (strcasecmp(field, "Architecture") == 0) {
++ /* Architecture */
++ if (pkg->architecture) {
++ temp = (char *)realloc(temp,strlen(pkg->architecture)+17);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->architecture)+17), "Architecture: %s\n", pkg->architecture);
++ }
++ } else {
++ goto UNKNOWN_FMT_FIELD;
++ }
++ break;
++ case 'c':
++ case 'C':
++ if (strcasecmp(field, "Conffiles") == 0) {
++ /* Conffiles */
++ conffile_list_elt_t *iter;
++ char confstr_[LINE_LEN];
++
++ if (pkg->conffiles.head == NULL) {
++ return temp;
++ }
++
++ len = 14 ;
++ for (iter = pkg->conffiles.head; iter; iter = iter->next) {
++ if (iter->data->name && iter->data->value) {
++ len = len + (strlen(iter->data->name)+strlen(iter->data->value)+5);
++ }
++ }
++ temp = (char *)realloc(temp,len);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ strncpy(temp, "Conffiles:\n", 12);
++ for (iter = pkg->conffiles.head; iter; iter = iter->next) {
++ if (iter->data->name && iter->data->value) {
++ snprintf(confstr_, LINE_LEN, "%s %s\n", iter->data->name, iter->data->value);
++ strncat(temp, confstr_, strlen(confstr_));
++ }
++ }
++ } else if (strcasecmp(field, "Conflicts") == 0) {
++ int i;
++
++ if (pkg->conflicts_count) {
++ char conflictstr[LINE_LEN];
++ len = 14 ;
++ for(i = 0; i < pkg->conflicts_count; i++) {
++ len = len + (strlen(pkg->conflicts_str[i])+5);
++ }
++ temp = (char *)realloc(temp,len);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ strncpy(temp, "Conflicts:", 11);
++ for(i = 0; i < pkg->conflicts_count; i++) {
++ snprintf(conflictstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->conflicts_str[i]);
++ strncat(temp, conflictstr, strlen(conflictstr));
++ }
++ strncat(temp, "\n", strlen("\n"));
++ }
++ } else {
++ goto UNKNOWN_FMT_FIELD;
++ }
++ break;
++ case 'd':
++ case 'D':
++ if (strcasecmp(field, "Depends") == 0) {
++ /* Depends */
++ int i;
++
++ if (pkg->depends_count) {
++ char depstr[LINE_LEN];
++ len = 14 ;
++ for(i = 0; i < pkg->depends_count; i++) {
++ len = len + (strlen(pkg->depends_str[i])+4);
++ }
++ temp = (char *)realloc(temp,len);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ strncpy(temp, "Depends:", 10);
++ for(i = 0; i < pkg->depends_count; i++) {
++ snprintf(depstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->depends_str[i]);
++ strncat(temp, depstr, strlen(depstr));
++ }
++ strncat(temp, "\n", strlen("\n"));
++ }
++ } else if (strcasecmp(field, "Description") == 0) {
++ /* Description */
++ if (pkg->description) {
++ temp = (char *)realloc(temp,strlen(pkg->description)+16);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->description)+16), "Description: %s\n", pkg->description);
++ }
++ } else {
++ goto UNKNOWN_FMT_FIELD;
++ }
++ break;
++ case 'e':
++ case 'E': {
++ /* Essential */
++ if (pkg->essential) {
++ temp = (char *)realloc(temp,16);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (16), "Essential: yes\n");
++ }
++ }
++ break;
++ case 'f':
++ case 'F': {
++ /* Filename */
++ if (pkg->filename) {
++ temp = (char *)realloc(temp,strlen(pkg->filename)+12);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->filename)+12), "Filename: %s\n", pkg->filename);
++ }
++ }
++ break;
++ case 'i':
++ case 'I': {
++ if (strcasecmp(field, "Installed-Size") == 0) {
++ /* Installed-Size */
++ temp = (char *)realloc(temp,strlen(pkg->installed_size)+17);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->installed_size)+17), "Installed-Size: %s\n", pkg->installed_size);
++ } else if (strcasecmp(field, "Installed-Time") == 0 && pkg->installed_time) {
++ temp = (char *)realloc(temp,29);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, 29, "Installed-Time: %lu\n", pkg->installed_time);
++ }
++ }
++ break;
++ case 'm':
++ case 'M': {
++ /* Maintainer | MD5sum */
++ if (strcasecmp(field, "Maintainer") == 0) {
++ /* Maintainer */
++ if (pkg->maintainer) {
++ temp = (char *)realloc(temp,strlen(pkg->maintainer)+14);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->maintainer)+14), "maintainer: %s\n", pkg->maintainer);
++ }
++ } else if (strcasecmp(field, "MD5sum") == 0) {
++ /* MD5sum */
++ if (pkg->md5sum) {
++ temp = (char *)realloc(temp,strlen(pkg->md5sum)+11);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->md5sum)+11), "MD5Sum: %s\n", pkg->md5sum);
++ }
++ } else {
++ goto UNKNOWN_FMT_FIELD;
++ }
++ }
++ break;
++ case 'p':
++ case 'P': {
++ if (strcasecmp(field, "Package") == 0) {
++ /* Package */
++ temp = (char *)realloc(temp,strlen(pkg->name)+11);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->name)+11), "Package: %s\n", pkg->name);
++ } else if (strcasecmp(field, "Priority") == 0) {
++ /* Priority */
++ temp = (char *)realloc(temp,strlen(pkg->priority)+12);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->priority)+12), "Priority: %s\n", pkg->priority);
++ } else if (strcasecmp(field, "Provides") == 0) {
++ /* Provides */
++ int i;
++
++ if (pkg->provides_count) {
++ /* Here we check if the ipkg_internal_use_only is used, and we discard it.*/
++ for ( i=0; i < pkg->provides_count; i++ ){
++ if (strstr(pkg->provides_str[i],"ipkg_internal_use_only")!=NULL) {
++ memset (pkg->provides_str[i],'\x0',strlen(pkg->provides_str[i])); /* Pigi clear my trick flag, just in case */
++ flag_provide_false = 1;
++ }
++ }
++ if ( !flag_provide_false || /* Pigi there is not my trick flag */
++ ((flag_provide_false) && (pkg->provides_count > 1))){ /* Pigi There is, but we also have others Provides */
++ char provstr[LINE_LEN];
++ len = 15;
++ for(i = 0; i < pkg->provides_count; i++) {
++ len = len + (strlen(pkg->provides_str[i])+5);
++ }
++ temp = (char *)realloc(temp,len);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ strncpy(temp, "Provides:", 12);
++ for(i = 0; i < pkg->provides_count; i++) {
++ if (strlen(pkg->provides_str[i])>0){;
++ snprintf(provstr, LINE_LEN, "%s %s", i == 1 ? "" : ",", pkg->provides_str[i]);
++ strncat(temp, provstr, strlen(provstr));
++ }
++ }
++ strncat(temp, "\n", strlen("\n"));
++ }
++ }
++ } else {
++ goto UNKNOWN_FMT_FIELD;
++ }
++ }
++ break;
++ case 'r':
++ case 'R': {
++ int i;
++ /* Replaces | Recommends*/
++ if (strcasecmp (field, "Replaces") == 0) {
++ if (pkg->replaces_count) {
++ char replstr[LINE_LEN];
++ len = 14;
++ for (i = 0; i < pkg->replaces_count; i++) {
++ len = len + (strlen(pkg->replaces_str[i])+5);
++ }
++ temp = (char *)realloc(temp,len);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ strncpy(temp, "Replaces:", 12);
++ for (i = 0; i < pkg->replaces_count; i++) {
++ snprintf(replstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->replaces_str[i]);
++ strncat(temp, replstr, strlen(replstr));
++ }
++ strncat(temp, "\n", strlen("\n"));
++ }
++ } else if (strcasecmp (field, "Recommends") == 0) {
++ if (pkg->recommends_count) {
++ char recstr[LINE_LEN];
++ len = 15;
++ for(i = 0; i < pkg->recommends_count; i++) {
++ len = len + (strlen( pkg->recommends_str[i])+5);
++ }
++ temp = (char *)realloc(temp,len);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ strncpy(temp, "Recommends:", 13);
++ for(i = 0; i < pkg->recommends_count; i++) {
++ snprintf(recstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->recommends_str[i]);
++ strncat(temp, recstr, strlen(recstr));
++ }
++ strncat(temp, "\n", strlen("\n"));
++ }
++ } else {
++ goto UNKNOWN_FMT_FIELD;
++ }
++ }
++ break;
++ case 's':
++ case 'S': {
++ /* Section | Size | Source | Status | Suggests */
++ if (strcasecmp(field, "Section") == 0) {
++ /* Section */
++ if (pkg->section) {
++ temp = (char *)realloc(temp,strlen(pkg->section)+11);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->section)+11), "Section: %s\n", pkg->section);
++ }
++ } else if (strcasecmp(field, "Size") == 0) {
++ /* Size */
++ if (pkg->size) {
++ temp = (char *)realloc(temp,strlen(pkg->size)+8);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->size)+8), "Size: %s\n", pkg->size);
++ }
++ } else if (strcasecmp(field, "Source") == 0) {
++ /* Source */
++ if (pkg->source) {
++ temp = (char *)realloc(temp,strlen(pkg->source)+10);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(pkg->source)+10), "Source: %s\n", pkg->source);
++ }
++ } else if (strcasecmp(field, "Status") == 0) {
++ /* Status */
++ /* Benjamin Pineau note: we should avoid direct usage of
++ * strlen(arg) without keeping "arg" for later free()
++ */
++ char *pflag=pkg_state_flag_to_str(pkg->state_flag);
++ char *pstat=pkg_state_status_to_str(pkg->state_status);
++ char *pwant=pkg_state_want_to_str(pkg->state_want);
++
++ size_t sum_of_sizes = (size_t) ( strlen(pwant)+ strlen(pflag)+ strlen(pstat) + 12 );
++ temp = (char *)realloc(temp,sum_of_sizes);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, sum_of_sizes , "Status: %s %s %s\n", pwant, pflag, pstat);
++ free(pflag);
++ free(pwant);
++ if(pstat) /* pfstat can be NULL if ENOMEM */
++ free(pstat);
++ } else if (strcasecmp(field, "Suggests") == 0) {
++ if (pkg->suggests_count) {
++ int i;
++ char sugstr[LINE_LEN];
++ len = 13;
++ for(i = 0; i < pkg->suggests_count; i++) {
++ len = len + (strlen(pkg->suggests_str[i])+5);
++ }
++ temp = (char *)realloc(temp,len);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ strncpy(temp, "Suggests:", 10);
++ for(i = 0; i < pkg->suggests_count; i++) {
++ snprintf(sugstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->suggests_str[i]);
++ strncat(temp, sugstr, strlen(sugstr));
++ }
++ strncat(temp, "\n", strlen("\n"));
++ }
++ } else {
++ goto UNKNOWN_FMT_FIELD;
++ }
++ }
++ break;
++ case 'v':
++ case 'V': {
++ /* Version */
++ char *version = pkg_version_str_alloc(pkg);
++ temp = (char *)realloc(temp,strlen(version)+14);
++ if ( temp == NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ temp[0]='\0';
++ snprintf(temp, (strlen(version)+12), "Version: %s\n", version);
++ free(version);
++ }
++ break;
++ default:
++ goto UNKNOWN_FMT_FIELD;
++ }
++
++ if ( strlen(temp)<2 ) {
++ temp[0]='\0';
++ }
++ return temp;
++
++ UNKNOWN_FMT_FIELD:
++ fprintf(stderr, "%s: ERROR: Unknown field name: %s\n", __FUNCTION__, field);
++ if ( strlen(temp)<2 ) {
++ temp[0]='\0';
++ }
++
++ return temp;
++}
++
++void pkg_print_info(pkg_t *pkg, FILE *file)
++{
++ char * buff;
++ if (pkg == NULL) {
++ return;
++ }
++
++ buff = pkg_formatted_info(pkg);
++ if ( buff == NULL )
++ return;
++ if (strlen(buff)>2){
++ fwrite(buff, 1, strlen(buff), file);
++ }
++ free(buff);
++}
++
++void pkg_print_status(pkg_t * pkg, FILE * file)
++{
++ if (pkg == NULL) {
++ return;
++ }
++
++ /* XXX: QUESTION: Do we actually want more fields here? The
++ original idea was to save space by installing only what was
++ needed for actual computation, (package, version, status,
++ essential, conffiles). The assumption is that all other fields
++ can be found in th available file.
++
++ But, someone proposed the idea to make it possible to
++ reconstruct a .ipk from an installed package, (ie. for beaming
++ from one handheld to another). So, maybe we actually want a few
++ more fields here, (depends, suggests, etc.), so that that would
++ be guaranteed to work even in the absence of more information
++ from the available file.
++
++ 28-MAR-03: kergoth and I discussed this yesterday. We think
++ the essential info needs to be here for all installed packages
++ because they may not appear in the Packages files on various
++ feeds. Furthermore, one should be able to install from URL or
++ local storage without requiring a Packages file from any feed.
++ -Jamey
++ */
++ pkg_print_field(pkg, file, "Package");
++ pkg_print_field(pkg, file, "Version");
++ pkg_print_field(pkg, file, "Depends");
++ pkg_print_field(pkg, file, "Recommends");
++ pkg_print_field(pkg, file, "Suggests");
++ pkg_print_field(pkg, file, "Provides");
++ pkg_print_field(pkg, file, "Replaces");
++ pkg_print_field(pkg, file, "Conflicts");
++ pkg_print_field(pkg, file, "Status");
++ pkg_print_field(pkg, file, "Essential"); /* @@@@ should be removed in future release. */
++ pkg_print_field(pkg, file, "Architecture");
++ pkg_print_field(pkg, file, "Conffiles");
++ pkg_print_field(pkg, file, "Installed-Time");
++ fputs("\n", file);
++}
++
++void pkg_print_field(pkg_t *pkg, FILE *file, const char *field)
++{
++ char *buff;
++ if (strlen(field) < PKG_MINIMUM_FIELD_NAME_LEN) {
++ fprintf(stderr, "%s: ERROR: Unknown field name: %s\n",
++ __FUNCTION__, field);
++ }
++ buff = pkg_formatted_field(pkg, field);
++ if (strlen(buff)>2) {
++ fprintf(file, "%s", buff);
++ fflush(file);
++ }
++ free(buff);
++ return;
++}
++
++/*
++ * libdpkg - Debian packaging suite library routines
++ * vercmp.c - comparison of version numbers
++ *
++ * Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
++ */
++int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg)
++{
++ int r;
++
++ if (pkg->epoch > ref_pkg->epoch) {
++ return 1;
++ }
++
++ if (pkg->epoch < ref_pkg->epoch) {
++ return -1;
++ }
++
++ r = verrevcmp(pkg->version, ref_pkg->version);
++ if (r) {
++ return r;
++ }
++
++#ifdef USE_DEBVERSION
++ r = verrevcmp(pkg->revision, ref_pkg->revision);
++ if (r) {
++ return r;
++ }
++
++ r = verrevcmp(pkg->familiar_revision, ref_pkg->familiar_revision);
++#endif
++
++ return r;
++}
++
++int verrevcmp(const char *val, const char *ref)
++{
++ int vc, rc;
++ long vl, rl;
++ const char *vp, *rp;
++ const char *vsep, *rsep;
++
++ if (!val) val= "";
++ if (!ref) ref= "";
++ for (;;) {
++ vp= val; while (*vp && !isdigit(*vp)) vp++;
++ rp= ref; while (*rp && !isdigit(*rp)) rp++;
++ for (;;) {
++ vc= (val == vp) ? 0 : *val++;
++ rc= (ref == rp) ? 0 : *ref++;
++ if (!rc && !vc) break;
++ if (vc && !isalpha(vc)) vc += 256; /* assumes ASCII character set */
++ if (rc && !isalpha(rc)) rc += 256;
++ if (vc != rc) return vc - rc;
++ }
++ val= vp;
++ ref= rp;
++ vl=0; if (isdigit(*vp)) vl= strtol(val,(char**)&val,10);
++ rl=0; if (isdigit(*rp)) rl= strtol(ref,(char**)&ref,10);
++ if (vl != rl) return vl - rl;
++
++ vc = *val;
++ rc = *ref;
++ vsep = strchr(".-", vc);
++ rsep = strchr(".-", rc);
++ if (vsep && !rsep) return -1;
++ if (!vsep && rsep) return +1;
++
++ if (!*val && !*ref) return 0;
++ if (!*val) return -1;
++ if (!*ref) return +1;
++ }
++}
++
++int pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op)
++{
++ int r;
++
++ r = pkg_compare_versions(it, ref);
++
++ if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) {
++ return r <= 0;
++ }
++
++ if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0) {
++ return r >= 0;
++ }
++
++ if (strcmp(op, "<<") == 0) {
++ return r < 0;
++ }
++
++ if (strcmp(op, ">>") == 0) {
++ return r > 0;
++ }
++
++ if (strcmp(op, "=") == 0) {
++ return r == 0;
++ }
++
++ fprintf(stderr, "unknown operator: %s", op);
++ return 0;
++}
++
++int pkg_name_version_and_architecture_compare(pkg_t *p1, pkg_t *p2)
++{
++ const pkg_t *a = *(const pkg_t **)p1;
++ const pkg_t *b = *(const pkg_t **)p2;
++ int namecmp;
++ int vercmp;
++ if (!a->name || !b->name) {
++ fprintf(stderr, "pkg_name_version_and_architecture_compare: a=%p a->name=%p b=%p b->name=%p\n",
++ a, a->name, b, b->name);
++ return 0;
++ }
++
++ namecmp = strcmp(a->name, b->name);
++ if (namecmp)
++ return namecmp;
++ vercmp = pkg_compare_versions(a, b);
++ if (vercmp)
++ return vercmp;
++ if (!a->arch_priority || !b->arch_priority) {
++ fprintf(stderr, "pkg_name_version_and_architecture_compare: a=%p a->arch_priority=%i b=%p b->arch_priority=%i\n",
++ a, a->arch_priority, b, b->arch_priority);
++ return 0;
++ }
++ if (a->arch_priority > b->arch_priority)
++ return 1;
++ if (a->arch_priority < b->arch_priority)
++ return -1;
++ return 0;
++}
++
++int abstract_pkg_name_compare(abstract_pkg_t *p1, abstract_pkg_t *p2)
++{
++ const abstract_pkg_t *a = *(const abstract_pkg_t **)p1;
++ const abstract_pkg_t *b = *(const abstract_pkg_t **)p2;
++ if (!a->name || !b->name) {
++ fprintf(stderr, "abstract_pkg_name_compare: a=%p a->name=%p b=%p b->name=%p\n",
++ a, a->name, b, b->name);
++ return 0;
++ }
++ return strcmp(a->name, b->name);
++}
++
++
++char *pkg_version_str_alloc(pkg_t *pkg)
++{
++ char *complete_version;
++ char *epoch_str;
++#ifdef USE_DEBVERSION
++ char *revision_str;
++ char *familiar_revision_str;
++#endif
++
++ if (pkg->epoch) {
++ sprintf_alloc(&epoch_str, "%lu:", (unsigned long)pkg->epoch);
++ } else {
++ epoch_str = strdup("");
++ }
++
++#ifdef USE_DEBVERSION
++ if (pkg->revision && strlen(pkg->revision)) {
++ sprintf_alloc(&revision_str, "-%s", pkg->revision);
++ } else {
++ revision_str = strdup("");
++ }
++
++ if (pkg->familiar_revision && strlen(pkg->familiar_revision)) {
++ sprintf_alloc(&familiar_revision_str, "-fam%s", pkg->familiar_revision);
++ } else {
++ familiar_revision_str = strdup("");
++ }
++#endif
++
++#ifdef USE_DEBVERSION
++ sprintf_alloc(&complete_version, "%s%s%s%s",
++ epoch_str, pkg->version, revision_str, familiar_revision_str);
++#else
++ sprintf_alloc(&complete_version, "%s%s",
++ epoch_str, pkg->version);
++#endif
++
++ free(epoch_str);
++#ifdef USE_DEBVERSION
++ free(revision_str);
++ free(familiar_revision_str);
++#endif
++
++ return complete_version;
++}
++
++str_list_t *pkg_get_installed_files(pkg_t *pkg)
++{
++ int err;
++ char *list_file_name = NULL;
++ FILE *list_file = NULL;
++ char *line;
++ char *installed_file_name;
++ int rootdirlen;
++
++ pkg->installed_files_ref_cnt++;
++
++ if (pkg->installed_files) {
++ return pkg->installed_files;
++ }
++
++ pkg->installed_files = str_list_alloc();
++ if (pkg->installed_files == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++
++ /* For uninstalled packages, get the file list firectly from the package.
++ For installed packages, look at the package.list file in the database.
++ */
++ if (pkg->state_status == SS_NOT_INSTALLED || pkg->dest == NULL) {
++ if (pkg->local_filename == NULL) {
++ return pkg->installed_files;
++ }
++ /* XXX: CLEANUP: Maybe rewrite this to avoid using a temporary
++ file. In other words, change deb_extract so that it can
++ simply return the file list as a char *[] rather than
++ insisting on writing in to a FILE * as it does now. */
++ list_file = tmpfile();
++ err = pkg_extract_data_file_names_to_stream(pkg, list_file);
++ if (err) {
++ fclose(list_file);
++ fprintf(stderr, "%s: Error extracting file list from %s: %s\n",
++ __FUNCTION__, pkg->local_filename, strerror(err));
++ return pkg->installed_files;
++ }
++ rewind(list_file);
++ } else {
++ sprintf_alloc(&list_file_name, "%s/%s.list",
++ pkg->dest->info_dir, pkg->name);
++ if (! file_exists(list_file_name)) {
++ free(list_file_name);
++ return pkg->installed_files;
++ }
++
++ list_file = fopen(list_file_name, "r");
++ if (list_file == NULL) {
++ fprintf(stderr, "WARNING: Cannot open %s: %s\n",
++ list_file_name, strerror(errno));
++ free(list_file_name);
++ return pkg->installed_files;
++ }
++ free(list_file_name);
++ }
++
++ rootdirlen = strlen( pkg->dest->root_dir );
++ while (1) {
++ char *file_name;
++
++ line = file_read_line_alloc(list_file);
++ if (line == NULL) {
++ break;
++ }
++ str_chomp(line);
++ file_name = line;
++
++ /* Take pains to avoid uglies like "/./" in the middle of file_name. */
++ if( strncmp( pkg->dest->root_dir,
++ file_name,
++ rootdirlen ) ) {
++ if (*file_name == '.') {
++ file_name++;
++ }
++ if (*file_name == '/') {
++ file_name++;
++ }
++
++ /* Freed in pkg_free_installed_files */
++ sprintf_alloc(&installed_file_name, "%s%s", pkg->dest->root_dir, file_name);
++ } else {
++ // already contains root_dir as header -> ABSOLUTE
++ sprintf_alloc(&installed_file_name, "%s", file_name);
++ }
++ str_list_append(pkg->installed_files, installed_file_name);
++ free(line);
++ }
++
++ fclose(list_file);
++
++ return pkg->installed_files;
++}
++
++/* XXX: CLEANUP: This function and it's counterpart,
++ (pkg_get_installed_files), do not match our init/deinit naming
++ convention. Nor the alloc/free convention. But, then again, neither
++ of these conventions currrently fit the way these two functions
++ work. */
++int pkg_free_installed_files(pkg_t *pkg)
++{
++ str_list_elt_t *iter;
++
++ pkg->installed_files_ref_cnt--;
++ if (pkg->installed_files_ref_cnt > 0) {
++ return 0;
++ }
++
++ if (pkg->installed_files) {
++
++ for (iter = pkg->installed_files->head; iter; iter = iter->next) {
++ /* malloced in pkg_get_installed_files */
++ free (iter->data);
++ iter->data = NULL;
++ }
++
++ str_list_deinit(pkg->installed_files);
++ }
++
++ pkg->installed_files = NULL;
++
++ return 0;
++}
++
++int pkg_remove_installed_files_list(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ int err;
++ char *list_file_name;
++
++ //I don't think pkg_free_installed_files should be called here. Jamey
++ //pkg_free_installed_files(pkg);
++
++ sprintf_alloc(&list_file_name, "%s/%s.list",
++ pkg->dest->info_dir, pkg->name);
++ if (!conf->noaction) {
++ err = unlink(list_file_name);
++ free(list_file_name);
++
++ if (err) {
++ return errno;
++ }
++ }
++ return 0;
++}
++
++conffile_t *pkg_get_conffile(pkg_t *pkg, const char *file_name)
++{
++ conffile_list_elt_t *iter;
++ conffile_t *conffile;
++
++ if (pkg == NULL) {
++ return NULL;
++ }
++
++ for (iter = pkg->conffiles.head; iter; iter = iter->next) {
++ conffile = iter->data;
++
++ if (strcmp(conffile->name, file_name) == 0) {
++ return conffile;
++ }
++ }
++
++ return NULL;
++}
++
++int pkg_run_script(ipkg_conf_t *conf, pkg_t *pkg,
++ const char *script, const char *args)
++{
++ int err;
++ char *path;
++ char *cmd;
++
++ /* XXX: FEATURE: When conf->offline_root is set, we should run the
++ maintainer script within a chroot environment. */
++
++ /* Installed packages have scripts in pkg->dest->info_dir, uninstalled packages
++ have scripts in pkg->tmp_unpack_dir. */
++ if (pkg->state_status == SS_INSTALLED || pkg->state_status == SS_UNPACKED) {
++ if (pkg->dest == NULL) {
++ fprintf(stderr, "%s: ERROR: installed package %s has a NULL dest\n",
++ __FUNCTION__, pkg->name);
++ return EINVAL;
++ }
++ sprintf_alloc(&path, "%s/%s.%s", pkg->dest->info_dir, pkg->name, script);
++ } else {
++ if (pkg->tmp_unpack_dir == NULL) {
++ fprintf(stderr, "%s: ERROR: uninstalled package %s has a NULL tmp_unpack_dir\n",
++ __FUNCTION__, pkg->name);
++ return EINVAL;
++ }
++ sprintf_alloc(&path, "%s/%s", pkg->tmp_unpack_dir, script);
++ }
++
++ ipkg_message(conf, IPKG_INFO, "Running script %s\n", path);
++ if (conf->noaction) return 0;
++
++ /* XXX: CLEANUP: There must be a better way to handle maintainer
++ scripts when running with offline_root mode and/or a dest other
++ than '/'. I've been playing around with some clever chroot
++ tricks and I might come up with something workable. */
++ if (conf->offline_root) {
++ setenv("IPKG_OFFLINE_ROOT", conf->offline_root, 1);
++ }
++
++ setenv("PKG_ROOT",
++ pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1);
++
++ if (! file_exists(path)) {
++ free(path);
++ return 0;
++ }
++
++ if (conf->offline_root) {
++ fprintf(stderr, "(offline root mode: not running %s.%s)\n", pkg->name, script);
++ free(path);
++ return 0;
++ }
++
++ sprintf_alloc(&cmd, "%s %s", path, args);
++ free(path);
++
++ err = xsystem(cmd);
++ free(cmd);
++
++ if (err) {
++ fprintf(stderr, "%s script returned status %d\n", script, err);
++ return err;
++ }
++
++ return 0;
++}
++
++char *pkg_state_want_to_str(pkg_state_want_t sw)
++{
++ int i;
++
++ for (i=0; i < ARRAY_SIZE(pkg_state_want_map); i++) {
++ if (pkg_state_want_map[i].value == sw) {
++ return strdup(pkg_state_want_map[i].str);
++ }
++ }
++
++ fprintf(stderr, "%s: ERROR: Illegal value for state_want: %d\n",
++ __FUNCTION__, sw);
++ return strdup("<STATE_WANT_UNKNOWN>");
++}
++
++pkg_state_want_t pkg_state_want_from_str(char *str)
++{
++ int i;
++
++ for (i=0; i < ARRAY_SIZE(pkg_state_want_map); i++) {
++ if (strcmp(str, pkg_state_want_map[i].str) == 0) {
++ return pkg_state_want_map[i].value;
++ }
++ }
++
++ fprintf(stderr, "%s: ERROR: Illegal value for state_want string: %s\n",
++ __FUNCTION__, str);
++ return SW_UNKNOWN;
++}
++
++char *pkg_state_flag_to_str(pkg_state_flag_t sf)
++{
++ int i;
++ int len = 3; /* ok\000 is minimum */
++ char *str = NULL;
++
++ /* clear the temporary flags before converting to string */
++ sf &= SF_NONVOLATILE_FLAGS;
++
++ if (sf == 0) {
++ return strdup("ok");
++ } else {
++
++ for (i=0; i < ARRAY_SIZE(pkg_state_flag_map); i++) {
++ if (sf & pkg_state_flag_map[i].value) {
++ len += strlen(pkg_state_flag_map[i].str) + 1;
++ }
++ }
++ str = malloc(len);
++ if ( str == NULL ) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ str[0] = 0;
++ for (i=0; i < ARRAY_SIZE(pkg_state_flag_map); i++) {
++ if (sf & pkg_state_flag_map[i].value) {
++ strcat(str, pkg_state_flag_map[i].str);
++ strcat(str, ",");
++ }
++ }
++ len = strlen(str);
++ str[len-1] = 0; /* squash last comma */
++ return str;
++ }
++}
++
++pkg_state_flag_t pkg_state_flag_from_str(char *str)
++{
++ int i;
++ int sf = SF_OK;
++
++ if (strcmp(str, "ok") == 0) {
++ return SF_OK;
++ }
++ for (i=0; i < ARRAY_SIZE(pkg_state_flag_map); i++) {
++ const char *sfname = pkg_state_flag_map[i].str;
++ int sfname_len = strlen(sfname);
++ if (strncmp(str, sfname, sfname_len) == 0) {
++ sf |= pkg_state_flag_map[i].value;
++ str += sfname_len;
++ if (str[0] == ',') {
++ str++;
++ } else {
++ break;
++ }
++ }
++ }
++
++ return sf;
++}
++
++char *pkg_state_status_to_str(pkg_state_status_t ss)
++{
++ int i;
++
++ for (i=0; i < ARRAY_SIZE(pkg_state_status_map); i++) {
++ if (pkg_state_status_map[i].value == ss) {
++ return strdup(pkg_state_status_map[i].str);
++ }
++ }
++
++ fprintf(stderr, "%s: ERROR: Illegal value for state_status: %d\n",
++ __FUNCTION__, ss);
++ return strdup("<STATE_STATUS_UNKNOWN>");
++}
++
++pkg_state_status_t pkg_state_status_from_str(char *str)
++{
++ int i;
++
++ for (i=0; i < ARRAY_SIZE(pkg_state_status_map); i++) {
++ if (strcmp(str, pkg_state_status_map[i].str) == 0) {
++ return pkg_state_status_map[i].value;
++ }
++ }
++
++ fprintf(stderr, "%s: ERROR: Illegal value for state_status string: %s\n",
++ __FUNCTION__, str);
++ return SS_NOT_INSTALLED;
++}
++
++int pkg_arch_supported(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ nv_pair_list_elt_t *l;
++
++ if (!pkg->architecture)
++ return 1;
++
++ l = conf->arch_list.head;
++
++ while (l) {
++ nv_pair_t *nv = l->data;
++ if (strcmp(nv->name, pkg->architecture) == 0) {
++ ipkg_message(conf, IPKG_DEBUG, "arch %s (priority %s) supported for pkg %s\n", nv->name, nv->value, pkg->name);
++ return 1;
++ }
++ l = l->next;
++ }
++
++ ipkg_message(conf, IPKG_DEBUG, "arch %s unsupported for pkg %s\n", pkg->architecture, pkg->name);
++ return 0;
++}
++
++int pkg_get_arch_priority(ipkg_conf_t *conf, const char *archname)
++{
++ nv_pair_list_elt_t *l;
++
++ l = conf->arch_list.head;
++
++ while (l) {
++ nv_pair_t *nv = l->data;
++ if (strcmp(nv->name, archname) == 0) {
++ int priority = strtol(nv->value, NULL, 0);
++ return priority;
++ }
++ l = l->next;
++ }
++ return 0;
++}
++
++int pkg_info_preinstall_check(ipkg_conf_t *conf)
++{
++ int i;
++ hash_table_t *pkg_hash = &conf->pkg_hash;
++ pkg_vec_t *available_pkgs = pkg_vec_alloc();
++ pkg_vec_t *installed_pkgs = pkg_vec_alloc();
++
++ ipkg_message(conf, IPKG_INFO, "pkg_info_preinstall_check: updating arch priority for each package\n");
++ pkg_hash_fetch_available(pkg_hash, available_pkgs);
++ /* update arch_priority for each package */
++ for (i = 0; i < available_pkgs->len; i++) {
++ pkg_t *pkg = available_pkgs->pkgs[i];
++ int arch_priority = 1;
++ if (!pkg)
++ continue;
++ // ipkg_message(conf, IPKG_DEBUG2, " package %s version=%s arch=%p:", pkg->name, pkg->version, pkg->architecture);
++ if (pkg->architecture)
++ arch_priority = pkg_get_arch_priority(conf, pkg->architecture);
++ else
++ ipkg_message(conf, IPKG_ERROR, "pkg_info_preinstall_check: no architecture for package %s\n", pkg->name);
++ // ipkg_message(conf, IPKG_DEBUG2, "%s arch_priority=%d\n", pkg->architecture, arch_priority);
++ pkg->arch_priority = arch_priority;
++ }
++
++ for (i = 0; i < available_pkgs->len; i++) {
++ pkg_t *pkg = available_pkgs->pkgs[i];
++ if (!pkg->arch_priority && (pkg->state_flag || (pkg->state_want != SW_UNKNOWN))) {
++ /* clear flags and want for any uninstallable package */
++ ipkg_message(conf, IPKG_NOTICE, "Clearing state_want and state_flag for pkg=%s (arch_priority=%d flag=%d want=%d)\n",
++ pkg->name, pkg->arch_priority, pkg->state_flag, pkg->state_want);
++ pkg->state_want = SW_UNKNOWN;
++ pkg->state_flag = 0;
++ }
++ }
++ pkg_vec_free(available_pkgs);
++
++ /* update the file owner data structure */
++ ipkg_message(conf, IPKG_INFO, "pkg_info_preinstall_check: update file owner list\n");
++ pkg_hash_fetch_all_installed(pkg_hash, installed_pkgs);
++ for (i = 0; i < installed_pkgs->len; i++) {
++ pkg_t *pkg = installed_pkgs->pkgs[i];
++ str_list_t *installed_files = pkg_get_installed_files(pkg); /* this causes installed_files to be cached */
++ str_list_elt_t *iter;
++ if (installed_files == NULL) {
++ ipkg_message(conf, IPKG_ERROR, "No installed files for pkg %s\n", pkg->name);
++ break;
++ }
++ for (iter = installed_files->head; iter; iter = iter->next) {
++ char *installed_file = iter->data;
++ // ipkg_message(conf, IPKG_DEBUG2, "pkg %s: file=%s\n", pkg->name, installed_file);
++ file_hash_set_file_owner(conf, installed_file, pkg);
++ }
++ }
++ pkg_vec_free(installed_pkgs);
++
++ return 0;
++}
++
++struct pkg_write_filelist_data {
++ ipkg_conf_t *conf;
++ pkg_t *pkg;
++ FILE *stream;
++};
++
++void pkg_write_filelist_helper(const char *key, void *entry_, void *data_)
++{
++ struct pkg_write_filelist_data *data = data_;
++ pkg_t *entry = entry_;
++ if (entry == data->pkg) {
++ fprintf(data->stream, "%s\n", key);
++ }
++}
++
++int pkg_write_filelist(ipkg_conf_t *conf, pkg_t *pkg)
++{
++ struct pkg_write_filelist_data data;
++ char *list_file_name = NULL;
++ int err = 0;
++
++ if (!pkg) {
++ ipkg_message(conf, IPKG_ERROR, "Null pkg\n");
++ return -EINVAL;
++ }
++ ipkg_message(conf, IPKG_INFO,
++ " creating %s.list file\n", pkg->name);
++ sprintf_alloc(&list_file_name, "%s/%s.list", pkg->dest->info_dir, pkg->name);
++ if (!list_file_name) {
++ ipkg_message(conf, IPKG_ERROR, "Failed to alloc list_file_name\n");
++ return -ENOMEM;
++ }
++ ipkg_message(conf, IPKG_INFO,
++ " creating %s file for pkg %s\n", list_file_name, pkg->name);
++ data.stream = fopen(list_file_name, "w");
++ if (!data.stream) {
++ ipkg_message(conf, IPKG_ERROR, "Could not open %s for writing: %s\n",
++ list_file_name, strerror(errno));
++ return errno;
++ }
++ data.pkg = pkg;
++ data.conf = conf;
++ hash_table_foreach(&conf->file_hash, pkg_write_filelist_helper, &data);
++ fclose(data.stream);
++ free(list_file_name);
++
++ return err;
++}
++
++int pkg_write_changed_filelists(ipkg_conf_t *conf)
++{
++ pkg_vec_t *installed_pkgs = pkg_vec_alloc();
++ hash_table_t *pkg_hash = &conf->pkg_hash;
++ int i;
++ int err;
++ if (conf->noaction)
++ return 0;
++
++ ipkg_message(conf, IPKG_INFO, "%s: saving changed filelists\n", __FUNCTION__);
++ pkg_hash_fetch_all_installed(pkg_hash, installed_pkgs);
++ for (i = 0; i < installed_pkgs->len; i++) {
++ pkg_t *pkg = installed_pkgs->pkgs[i];
++ if (pkg->state_flag & SF_FILELIST_CHANGED) {
++ ipkg_message(conf, IPKG_DEBUG, "Calling pkg_write_filelist for pkg=%s from %s\n", pkg->name, __FUNCTION__);
++ err = pkg_write_filelist(conf, pkg);
++ if (err)
++ ipkg_message(conf, IPKG_NOTICE, "pkg_write_filelist pkg=%s returned %d\n", pkg->name, err);
++ }
++ }
++ return 0;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_depends.c busybox-1.12.1/archival/libipkg/pkg_depends.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_depends.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_depends.c 2008-10-23 15:05:10.000000000 +0200
+@@ -0,0 +1,1032 @@
++/* pkg_depends.c - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <errno.h>
++#include <ctype.h>
++
++#include "pkg.h"
++#include "ipkg_utils.h"
++#include "pkg_hash.h"
++#include "ipkg_message.h"
++#include "pkg_parse.h"
++#include "hash_table.h"
++
++static int parseDepends(compound_depend_t *compound_depend, hash_table_t * hash, char * depend_str);
++static depend_t * depend_init(void);
++static void depend_deinit(depend_t *d);
++static char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx);
++static char ** merge_unresolved(char ** oldstuff, char ** newstuff);
++static int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg);
++int is_pkg_a_replaces(pkg_t *pkg_scout,pkg_t *pkg);
++
++static int pkg_installed_and_constraint_satisfied(pkg_t *pkg, void *cdata)
++{
++ depend_t *depend = (depend_t *)cdata;
++ if ((pkg->state_status == SS_INSTALLED || pkg->state_status == SS_UNPACKED) && version_constraints_satisfied(depend, pkg))
++ return 1;
++ else
++ return 0;
++}
++
++static int pkg_constraint_satisfied(pkg_t *pkg, void *cdata)
++{
++ depend_t *depend = (depend_t *)cdata;
++#if 0
++ pkg_t * temp = pkg_new();
++ int comparison;
++ parseVersion(temp, depend->version);
++ comparison = pkg_compare_versions(pkg, temp);
++ free(temp);
++
++ fprintf(stderr, "%s: pkg=%s pkg->version=%s constraint=%p type=%d version=%s comparison=%d satisfied=%d\n",
++ __FUNCTION__, pkg->name, pkg->version,
++ depend, depend->constraint, depend->version,
++ comparison, version_constraints_satisfied(depend, pkg));
++#endif
++ if (version_constraints_satisfied(depend, pkg))
++ return 1;
++ else
++ return 0;
++}
++
++/* returns ndependences or negative error value */
++int pkg_hash_fetch_unsatisfied_dependencies(ipkg_conf_t *conf, pkg_t * pkg,
++ pkg_vec_t *unsatisfied, char *** unresolved)
++{
++ pkg_t * satisfier_entry_pkg;
++ register int i, j, k, l;
++ int count, found;
++ char ** the_lost;
++ abstract_pkg_t * ab_pkg;
++
++ /*
++ * this is a setup to check for redundant/cyclic dependency checks,
++ * which are marked at the abstract_pkg level
++ */
++ if (!(ab_pkg = pkg->parent)) {
++ fprintf(stderr, "%s:%d: something terribly wrong with pkg %s\n", __FUNCTION__, __LINE__, pkg->name);
++ *unresolved = NULL;
++ return 0;
++ }
++ if (ab_pkg->dependencies_checked) { /* avoid duplicate or cyclic checks */
++ *unresolved = NULL;
++ return 0;
++ } else {
++ ab_pkg->dependencies_checked = 1; /* mark it for subsequent visits */
++ }
++ /**/
++
++ count = pkg->pre_depends_count + pkg->depends_count + pkg->recommends_count + pkg->suggests_count;
++ if (!count){
++ *unresolved = NULL;
++ return 0;
++ }
++
++ the_lost = NULL;
++
++ /* foreach dependency */
++ for (i = 0; i < count; i++) {
++ compound_depend_t * compound_depend = &pkg->depends[i];
++ depend_t ** possible_satisfiers = compound_depend->possibilities;;
++ found = 0;
++ satisfier_entry_pkg = NULL;
++
++ if (compound_depend->type == GREEDY_DEPEND) {
++ /* foreach possible satisfier */
++ for (j = 0; j < compound_depend->possibility_count; j++) {
++ /* foreach provided_by, which includes the abstract_pkg itself */
++ abstract_pkg_t *abpkg = possible_satisfiers[j]->pkg;
++ abstract_pkg_vec_t *ab_provider_vec = abpkg->provided_by;
++ int nposs = ab_provider_vec->len;
++ abstract_pkg_t **ab_providers = ab_provider_vec->pkgs;
++ for (l = 0; l < nposs; l++) {
++ pkg_vec_t *test_vec = ab_providers[l]->pkgs;
++ /* if no depends on this one, try the first package that Provides this one */
++ if (!test_vec){ /* no pkg_vec hooked up to the abstract_pkg! (need another feed?) */
++ continue;
++ }
++
++ /* cruise this possiblity's pkg_vec looking for an installed version */
++ for (k = 0; k < test_vec->len; k++) {
++ pkg_t *pkg_scout = test_vec->pkgs[k];
++ /* not installed, and not already known about? */
++ if ((pkg_scout->state_want != SW_INSTALL)
++ && !pkg_scout->parent->dependencies_checked
++ && !is_pkg_in_pkg_vec(unsatisfied, pkg_scout)) {
++ char ** newstuff = NULL;
++ int rc;
++ pkg_vec_t *tmp_vec = pkg_vec_alloc ();
++ /* check for not-already-installed dependencies */
++ rc = pkg_hash_fetch_unsatisfied_dependencies(conf,
++ pkg_scout,
++ tmp_vec,
++ &newstuff);
++ if (newstuff == NULL) {
++ int ok = 1;
++ for (i = 0; i < rc; i++) {
++ pkg_t *p = tmp_vec->pkgs[i];
++ if (p->state_want == SW_INSTALL)
++ continue;
++ ipkg_message(conf, IPKG_DEBUG, "not installing %s due to requirement for %s\n", pkg_scout->name, p->name);
++ ok = 0;
++ break;
++ }
++ pkg_vec_free (tmp_vec);
++ if (ok) {
++ /* mark this one for installation */
++ ipkg_message(conf, IPKG_NOTICE, "Adding satisfier for greedy dependence: %s\n", pkg_scout->name);
++ pkg_vec_insert(unsatisfied, pkg_scout);
++ }
++ } else {
++ ipkg_message(conf, IPKG_DEBUG, "not installing %s due to broken depends \n", pkg_scout->name);
++ free (newstuff);
++ }
++ }
++ }
++ }
++ }
++
++ continue;
++ }
++
++ /* foreach possible satisfier, look for installed package */
++ for (j = 0; j < compound_depend->possibility_count; j++) {
++ /* foreach provided_by, which includes the abstract_pkg itself */
++ depend_t *dependence_to_satisfy = possible_satisfiers[j];
++ abstract_pkg_t *satisfying_apkg = possible_satisfiers[j]->pkg;
++ pkg_t *satisfying_pkg =
++ pkg_hash_fetch_best_installation_candidate(conf, satisfying_apkg,
++ pkg_installed_and_constraint_satisfied,
++ dependence_to_satisfy, 1);
++ /* Being that I can't test constraing in pkg_hash, I will test it here */
++ if (satisfying_pkg != NULL) {
++ if (!pkg_installed_and_constraint_satisfied ( satisfying_pkg,dependence_to_satisfy)) {
++ satisfying_pkg = NULL;
++ }
++ }
++ ipkg_message(conf, IPKG_DEBUG, "%s:%d: satisfying_pkg=%p \n", __FILE__, __LINE__, satisfying_pkg);
++ if (satisfying_pkg != NULL) {
++ found = 1;
++ break;
++ }
++
++ }
++ /* if nothing installed matches, then look for uninstalled satisfier */
++ if (!found) {
++ /* foreach possible satisfier, look for installed package */
++ for (j = 0; j < compound_depend->possibility_count; j++) {
++ /* foreach provided_by, which includes the abstract_pkg itself */
++ depend_t *dependence_to_satisfy = possible_satisfiers[j];
++ abstract_pkg_t *satisfying_apkg = possible_satisfiers[j]->pkg;
++ pkg_t *satisfying_pkg =
++ pkg_hash_fetch_best_installation_candidate(conf, satisfying_apkg,
++ pkg_constraint_satisfied,
++ dependence_to_satisfy, 1);
++ /* Being that I can't test constraing in pkg_hash, I will test it here too */
++ if (satisfying_pkg != NULL) {
++ if (!pkg_constraint_satisfied ( satisfying_pkg,dependence_to_satisfy)) {
++ satisfying_pkg = NULL;
++ }
++ }
++
++ /* user request overrides package recommendation */
++ if (satisfying_pkg != NULL
++ && (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST)
++ && (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) {
++ ipkg_message (conf, IPKG_NOTICE, "%s: ignoring recommendation for %s at user request\n",
++ pkg->name, satisfying_pkg->name);
++ continue;
++ }
++
++ ipkg_message(conf, IPKG_DEBUG, "%s:%d: satisfying_pkg=%p\n", __FILE__, __LINE__, satisfying_pkg);
++ if (satisfying_pkg != NULL) {
++ satisfier_entry_pkg = satisfying_pkg;
++ break;
++ }
++ }
++ }
++
++ /* we didn't find one, add something to the unsatisfied vector */
++ if (!found) {
++ if (!satisfier_entry_pkg) {
++ /* failure to meet recommendations is not an error */
++ if (compound_depend->type != RECOMMEND && compound_depend->type != SUGGEST)
++ the_lost = add_unresolved_dep(pkg, the_lost, i);
++ else
++ ipkg_message (conf, IPKG_NOTICE, "%s: unsatisfied recommendation for %s\n",
++ pkg->name, compound_depend->possibilities[0]->pkg->name);
++ }
++ else {
++ if (compound_depend->type == SUGGEST) {
++ /* just mention it politely */
++ ipkg_message (conf, IPKG_NOTICE, "package %s suggests installing %s\n",
++ pkg->name, satisfier_entry_pkg->name);
++ } else {
++ char ** newstuff = NULL;
++
++ if (satisfier_entry_pkg != pkg &&
++ !is_pkg_in_pkg_vec(unsatisfied, satisfier_entry_pkg)) {
++ pkg_vec_insert(unsatisfied, satisfier_entry_pkg);
++ pkg_hash_fetch_unsatisfied_dependencies(conf,
++ satisfier_entry_pkg,
++ unsatisfied,
++ &newstuff);
++ the_lost = merge_unresolved(the_lost, newstuff);
++ }
++ }
++ }
++ }
++ }
++ *unresolved = the_lost;
++
++ return unsatisfied->len;
++}
++
++/*checking for conflicts !in replaces
++ If a packages conflicts with another but is also replacing it, I should not consider it a
++ really conflicts
++ returns 0 if conflicts <> replaces or 1 if conflicts == replaces
++*/
++int is_pkg_a_replaces(pkg_t *pkg_scout,pkg_t *pkg)
++{
++ int i ;
++ int replaces_count = pkg->replaces_count;
++ abstract_pkg_t **replaces;
++
++ if (pkg->replaces_count==0) // No replaces, it's surely a conflict
++ return 0;
++
++ replaces = pkg->replaces;
++
++ for (i = 0; i < replaces_count; i++) {
++ if (strcmp(pkg_scout->name,pkg->replaces[i]->name)==0) { // Found
++ ipkg_message(NULL, IPKG_DEBUG2, "Seems I've found a replace %s %s \n",pkg_scout->name,pkg->replaces[i]->name);
++ return 1;
++ }
++ }
++ return 0;
++
++}
++
++
++/* Abhaya: added support for conflicts */
++pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
++{
++ pkg_vec_t * installed_conflicts, * test_vec;
++ compound_depend_t * conflicts;
++ depend_t ** possible_satisfiers;
++ depend_t * possible_satisfier;
++ register int i, j, k;
++ int count;
++ abstract_pkg_t * ab_pkg;
++ pkg_t **pkg_scouts;
++ pkg_t *pkg_scout;
++
++ /*
++ * this is a setup to check for redundant/cyclic dependency checks,
++ * which are marked at the abstract_pkg level
++ */
++ if(!(ab_pkg = pkg->parent)){
++ fprintf(stderr, "dependency check error. pkg %s isn't in hash table\n", pkg->name);
++ return (pkg_vec_t *)NULL;
++ }
++
++ conflicts = pkg->conflicts;
++ if(!conflicts){
++ return (pkg_vec_t *)NULL;
++ }
++ installed_conflicts = pkg_vec_alloc();
++
++ count = pkg->conflicts_count;
++
++
++
++ /* foreach conflict */
++ for(i = 0; i < pkg->conflicts_count; i++){
++
++ possible_satisfiers = conflicts->possibilities;
++
++ /* foreach possible satisfier */
++ for(j = 0; j < conflicts->possibility_count; j++){
++ possible_satisfier = possible_satisfiers[j];
++ if (!possible_satisfier)
++ fprintf(stderr, "%s:%d: possible_satisfier is null\n", __FUNCTION__, __LINE__);
++ if (!possible_satisfier->pkg)
++ fprintf(stderr, "%s:%d: possible_satisfier->pkg is null\n", __FUNCTION__, __LINE__);
++ test_vec = possible_satisfier->pkg->pkgs;
++ if (test_vec) {
++ /* pkg_vec found, it is an actual package conflict
++ * cruise this possiblity's pkg_vec looking for an installed version */
++ pkg_scouts = test_vec->pkgs;
++ for(k = 0; k < test_vec->len; k++){
++ pkg_scout = pkg_scouts[k];
++ if (!pkg_scout) {
++ fprintf(stderr, "%s: null pkg scout\n", __FUNCTION__);
++ continue;
++ }
++ if ((pkg_scout->state_status == SS_INSTALLED || pkg_scout->state_want == SW_INSTALL) &&
++ version_constraints_satisfied(possible_satisfier, pkg_scout) && !is_pkg_a_replaces(pkg_scout,pkg)){
++ if (!is_pkg_in_pkg_vec(installed_conflicts, pkg_scout)){
++ pkg_vec_insert(installed_conflicts, pkg_scout);
++ }
++ }
++ }
++ }
++ }
++ conflicts++;
++ }
++
++ if (installed_conflicts->len)
++ return installed_conflicts;
++ pkg_vec_free(installed_conflicts);
++ return (pkg_vec_t *)NULL;
++}
++
++int version_constraints_satisfied(depend_t * depends, pkg_t * pkg)
++{
++ pkg_t * temp;
++ int comparison;
++
++ if(depends->constraint == NONE)
++ return 1;
++
++ temp = pkg_new();
++
++ parseVersion(temp, depends->version);
++
++ comparison = pkg_compare_versions(pkg, temp);
++
++ free(temp);
++
++ if((depends->constraint == EARLIER) &&
++ (comparison < 0))
++ return 1;
++ else if((depends->constraint == LATER) &&
++ (comparison > 0))
++ return 1;
++ else if(comparison == 0)
++ return 1;
++ else if((depends->constraint == LATER_EQUAL) &&
++ (comparison >= 0))
++ return 1;
++ else if((depends->constraint == EARLIER_EQUAL) &&
++ (comparison <= 0))
++ return 1;
++
++ return 0;
++}
++
++int pkg_dependence_satisfiable(depend_t *depend)
++{
++ abstract_pkg_t *apkg = depend->pkg;
++ abstract_pkg_vec_t *provider_apkgs = apkg->provided_by;
++ int n_providers = provider_apkgs->len;
++ abstract_pkg_t **apkgs = provider_apkgs->pkgs;
++ pkg_vec_t *pkg_vec;
++ int n_pkgs ;
++ int i;
++ int j;
++
++ for (i = 0; i < n_providers; i++) {
++ abstract_pkg_t *papkg = apkgs[i];
++ pkg_vec = papkg->pkgs;
++ if (pkg_vec) {
++ n_pkgs = pkg_vec->len;
++ for (j = 0; j < n_pkgs; j++) {
++ pkg_t *pkg = pkg_vec->pkgs[j];
++ if (version_constraints_satisfied(depend, pkg)) {
++ return 1;
++ }
++ }
++ }
++ }
++ return 0;
++}
++
++int pkg_dependence_satisfied(depend_t *depend)
++{
++ abstract_pkg_t *apkg = depend->pkg;
++ abstract_pkg_vec_t *provider_apkgs = apkg->provided_by;
++ int n_providers = provider_apkgs->len;
++ abstract_pkg_t **apkgs = provider_apkgs->pkgs;
++ int i;
++ int n_pkgs;
++ int j;
++
++ for (i = 0; i < n_providers; i++) {
++ abstract_pkg_t *papkg = apkgs[i];
++ pkg_vec_t *pkg_vec = papkg->pkgs;
++ if (pkg_vec) {
++ n_pkgs = pkg_vec->len;
++ for (j = 0; j < n_pkgs; j++) {
++ pkg_t *pkg = pkg_vec->pkgs[j];
++ if (version_constraints_satisfied(depend, pkg)) {
++ if (pkg->state_status == SS_INSTALLED || pkg->state_status == SS_UNPACKED)
++ return 1;
++ }
++ }
++ }
++ }
++ return 0;
++}
++
++static int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg)
++{
++ register int i;
++ pkg_t ** pkgs = vec->pkgs;
++
++ for(i = 0; i < vec->len; i++)
++ if((strcmp(pkg->name, (*(pkgs + i))->name) == 0)
++ && (pkg_compare_versions(pkg, *(pkgs + i)) == 0)
++ && (strcmp(pkg->architecture, (*(pkgs + i))->architecture) == 0))
++ return 1;
++ return 0;
++}
++
++
++#ifdef DeadCode
++/**
++ * pkg_has_common_provides returns 1 if pkg and replacee both provide
++ * the same abstract package and 0 otherwise.
++ */
++int pkg_has_common_provides(pkg_t *pkg, pkg_t *replacee)
++{
++ abstract_pkg_t **provides = pkg->provides;
++ int provides_count = pkg->provides_count;
++ abstract_pkg_t **replacee_provides = replacee->provides;
++ int replacee_provides_count = replacee->provides_count;
++ int i, j;
++ for (i = 0; i < provides_count; i++) {
++ abstract_pkg_t *apkg = provides[i];
++ for (j = 0; j < replacee_provides_count; j++) {
++ abstract_pkg_t *replacee_apkg = replacee_provides[i];
++ if (apkg == replacee_apkg)
++ return 1;
++ }
++ }
++ return 0;
++}
++#endif
++
++/**
++ * pkg_provides_abstract returns 1 if pkg->provides contains providee
++ * and 0 otherwise.
++ */
++int pkg_provides_abstract(pkg_t *pkg, abstract_pkg_t *providee)
++{
++ abstract_pkg_t **provides = pkg->provides;
++ int provides_count = pkg->provides_count;
++ int i;
++ for (i = 0; i < provides_count; i++) {
++ if (provides[i] == providee)
++ return 1;
++ }
++ return 0;
++}
++
++/**
++ * pkg_replaces returns 1 if pkg->replaces contains one of replacee's provides and 0
++ * otherwise.
++ */
++int pkg_replaces(pkg_t *pkg, pkg_t *replacee)
++{
++ abstract_pkg_t **replaces = pkg->replaces;
++ int replaces_count = pkg->replaces_count;
++ /* abstract_pkg_t **replacee_provides = pkg->provides;
++ int replacee_provides_count = pkg->provides_count; */
++ int i, j;
++ for (i = 0; i < replaces_count; i++) {
++ abstract_pkg_t *abstract_replacee = replaces[i];
++ for (j = 0; j < replaces_count; j++) {
++ /* ipkg_message(NULL, IPKG_DEBUG2, "Searching pkg-name %s repprovname %s absrepname %s \n",
++ pkg->name,replacee->provides[j]->name, abstract_replacee->name); */
++ if (replacee->provides[j] == abstract_replacee)
++ return 1;
++ }
++ }
++ return 0;
++}
++
++
++/**
++ * pkg_conflicts_abstract returns 1 if pkg->conflicts contains conflictee and 0
++ * otherwise.
++ */
++int pkg_conflicts_abstract(pkg_t *pkg, abstract_pkg_t *conflictee)
++{
++ compound_depend_t *conflicts = pkg->conflicts;
++ int conflicts_count = pkg->conflicts_count;
++ int i, j;
++ for (i = 0; i < conflicts_count; i++) {
++ int possibility_count = conflicts[i].possibility_count;
++ struct depend **possibilities = conflicts[i].possibilities;
++ for (j = 0; j < possibility_count; j++) {
++ if (possibilities[j]->pkg == conflictee) {
++ return 1;
++ }
++ }
++ }
++ return 0;
++}
++
++/**
++ * pkg_conflicts returns 1 if pkg->conflicts contains one of
++ * conflictee's provides and 0 otherwise.
++ */
++int pkg_conflicts(pkg_t *pkg, pkg_t *conflictee)
++{
++ compound_depend_t *conflicts = pkg->conflicts;
++ int conflicts_count = pkg->conflicts_count;
++ abstract_pkg_t **conflictee_provides = conflictee->provides;
++ int conflictee_provides_count = conflictee->provides_count;
++ int i, j, k;
++ int possibility_count;
++ struct depend **possibilities;
++ abstract_pkg_t *possibility ;
++
++ for (i = 0; i < conflicts_count; i++) {
++ possibility_count = conflicts[i].possibility_count;
++ possibilities = conflicts[i].possibilities;
++ for (j = 0; j < possibility_count; j++) {
++ possibility = possibilities[j]->pkg;
++ for (k = 0; k < conflictee_provides_count; k++) {
++ if (possibility == conflictee_provides[k]) {
++ return 1;
++ }
++ }
++ }
++ }
++ return 0;
++}
++
++static char ** merge_unresolved(char ** oldstuff, char ** newstuff)
++{
++ int oldlen = 0, newlen = 0;
++ char ** result;
++ register int i, j;
++
++ if(!newstuff)
++ return oldstuff;
++
++ while(oldstuff && oldstuff[oldlen]) oldlen++;
++ while(newstuff && newstuff[newlen]) newlen++;
++
++ result = (char **)realloc(oldstuff, sizeof(char *) * (oldlen + newlen + 1));
++ if (result == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++
++ for(i = oldlen, j = 0; i < (oldlen + newlen); i++, j++)
++ *(result + i) = *(newstuff + j);
++
++ *(result + i) = NULL;
++
++ return result;
++}
++
++/*
++ * a kinda kludgy way to back out depends str from two different arrays (reg'l'r 'n pre)
++ * this is null terminated, no count is carried around
++ */
++char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx)
++{
++ int count;
++ char ** resized;
++ char *depend_str = pkg_depend_str(pkg, ref_ndx);
++
++ count = 0;
++ while(the_lost && the_lost[count]) count++;
++
++ count++; /* need one to hold the null */
++ resized = (char **)realloc(the_lost, sizeof(char *) * (count + 1));
++ if (resized == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ resized[count - 1] = strdup(depend_str);
++ resized[count] = NULL;
++
++ return resized;
++}
++
++void printDepends(pkg_t * pkg)
++{
++ register int i, j;
++ compound_depend_t * depend;
++ int count;
++
++ count = pkg->pre_depends_count + pkg->depends_count;
++
++ depend = pkg->depends;
++ if(!depend){
++ fprintf(stderr, "Depends pointer is NULL\n");
++ return;
++ }
++ for(i = 0; i < count; i++){
++ fprintf(stderr, "%s has %d possibilities:\n",
++ (depend->type == GREEDY_DEPEND) ? "Greedy-Depend" : ((depend->type == DEPEND) ? "Depend" : "Pre-Depend"),
++ depend->possibility_count);
++ for(j = 0; j < depend->possibility_count; j++)
++ fprintf(stderr, "\t%s version %s (%d)\n",
++ depend->possibilities[j]->pkg->name,
++ depend->possibilities[j]->version,
++ depend->possibilities[j]->constraint);
++ depend++;
++ }
++}
++
++int buildProvides(hash_table_t * hash, abstract_pkg_t * ab_pkg, pkg_t * pkg)
++{
++ register int i, j;
++
++ /* every pkg provides itself */
++ abstract_pkg_vec_insert(ab_pkg->provided_by, ab_pkg);
++
++ if (!pkg->provides_count)
++ return 0;
++
++ pkg->provides = (abstract_pkg_t **)malloc(sizeof(abstract_pkg_t *) * (pkg->provides_count + 1));
++ if (pkg->provides == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return -1 ;
++ }
++ pkg->provides[0] = ab_pkg;
++
++ // if (strcmp(ab_pkg->name, pkg->name))
++ // fprintf(stderr, __FUNCTION__ ": ab_pkg=%s pkg=%s\n", ab_pkg->name, pkg->name);
++
++ for(i = 0; i < pkg->provides_count; i++){
++ abstract_pkg_t *provided_abpkg = ensure_abstract_pkg_by_name(hash, pkg->provides_str[i]);
++
++ pkg->provides[i+1] = provided_abpkg;
++
++ j = 0;
++ abstract_pkg_vec_insert(provided_abpkg->provided_by, ab_pkg);
++ }
++ return 0;
++}
++
++/* Abhaya: added conflicts support */
++int buildConflicts(hash_table_t * hash, pkg_t * pkg)
++{
++ register int i;
++ compound_depend_t * conflicts;
++
++ if (!pkg->conflicts_count)
++ return 0;
++
++ conflicts = pkg->conflicts = malloc(sizeof(compound_depend_t) *
++ pkg->conflicts_count);
++ if (conflicts == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return -1;
++ }
++ for (i = 0; i < pkg->conflicts_count; i++) {
++ conflicts->type = CONFLICTS;
++ parseDepends(conflicts, hash,
++ pkg->conflicts_str[i]);
++#if 0
++ for (j = 0; j < conflicts->possibility_count; j++) {
++ depend_t *possibility = conflicts->possibilities[j];
++ abstract_pkg_t *conflicting_apkg = possibility->pkg;
++ pkg_add_conflict_pair(ab_pkg, conflicting_apkg);
++ }
++#endif
++ conflicts++;
++ }
++ return 0;
++}
++
++int buildReplaces(hash_table_t * hash, abstract_pkg_t * ab_pkg, pkg_t * pkg)
++{
++ register int i, j;
++
++ if (!pkg->replaces_count)
++ return 0;
++
++ pkg->replaces = (abstract_pkg_t **)malloc(sizeof(abstract_pkg_t *) * pkg->replaces_count);
++ if (pkg->replaces == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return -1;
++ }
++
++ // if (strcmp(ab_pkg->name, pkg->name))
++ // fprintf(stderr, __FUNCTION__ ": ab_pkg=%s pkg=%s\n", ab_pkg->name, pkg->name);
++
++ for(i = 0; i < pkg->replaces_count; i++){
++ abstract_pkg_t *old_abpkg = ensure_abstract_pkg_by_name(hash, pkg->replaces_str[i]);
++
++ pkg->replaces[i] = old_abpkg;
++
++ j = 0;
++ if (!old_abpkg->replaced_by)
++ old_abpkg->replaced_by = abstract_pkg_vec_alloc();
++ if ( old_abpkg->replaced_by == NULL ){
++ return -1;
++ }
++ /* if a package pkg both replaces and conflicts old_abpkg,
++ * then add it to the replaced_by vector so that old_abpkg
++ * will be upgraded to ab_pkg automatically */
++ if (pkg_conflicts_abstract(pkg, old_abpkg))
++ abstract_pkg_vec_insert(old_abpkg->replaced_by, ab_pkg);
++ }
++ return 0;
++}
++
++int buildDepends(hash_table_t * hash, pkg_t * pkg)
++{
++ int count;
++ register int i;
++ compound_depend_t * depends;
++
++ if(!(count = pkg->pre_depends_count + pkg->depends_count + pkg->recommends_count + pkg->suggests_count))
++ return 0;
++
++ if (0 && pkg->pre_depends_count)
++ fprintf(stderr, "pkg=%s pre_depends_count=%d depends_count=%d\n",
++ pkg->name, pkg->pre_depends_count, pkg->depends_count);
++ depends = pkg->depends = malloc(sizeof(compound_depend_t) * count);
++ if (depends == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return -1;
++ }
++
++
++ for(i = 0; i < pkg->pre_depends_count; i++){
++ parseDepends(depends, hash, pkg->pre_depends_str[i]);
++ if (0 && pkg->pre_depends_count)
++ fprintf(stderr, " pre_depends_str=%s depends=%p possibility_count=%x\n",
++ pkg->pre_depends_str[i], depends, depends->possibility_count);
++ depends->type = PREDEPEND;
++ depends++;
++ }
++
++ for(i = 0; i < pkg->recommends_count; i++){
++ parseDepends(depends, hash, pkg->recommends_str[i]);
++ if (0 && pkg->recommends_count)
++ fprintf(stderr, " recommends_str=%s depends=%p possibility_count=%x\n",
++ pkg->recommends_str[i], depends, depends->possibility_count);
++ depends->type = RECOMMEND;
++ depends++;
++ }
++
++ for(i = 0; i < pkg->suggests_count; i++){
++ parseDepends(depends, hash, pkg->suggests_str[i]);
++ if (0 && pkg->suggests_count)
++ fprintf(stderr, " suggests_str=%s depends=%p possibility_count=%x\n",
++ pkg->suggests_str[i], depends, depends->possibility_count);
++ depends->type = SUGGEST;
++ depends++;
++ }
++
++ for(i = 0; i < pkg->depends_count; i++){
++ parseDepends(depends, hash, pkg->depends_str[i]);
++ if (0 && pkg->depends_count)
++ fprintf(stderr, " depends_str=%s depends=%p possibility_count=%x\n",
++ pkg->depends_str[i], depends, depends->possibility_count);
++ depends++;
++ }
++ return 0;
++}
++
++/*
++ * pkg_depend_string: returns the depends string specified by index_.
++ * All 4 kinds of dependences: dependence, pre-dependence, recommend, and suggest are number starting from 0.
++ * [0,npredepends) -> returns pre_depends_str[index_]
++ * [npredepends,npredepends+nrecommends) -> returns recommends_str[index_]
++ * [npredepends+nrecommends,npredepends+nrecommends+nsuggests) -> returns recommends_str[index_]
++ * [npredepends+nrecommends+nsuggests,npredepends+nrecommends+nsuggests+ndepends) -> returns depends_str[index_]
++ */
++char *pkg_depend_str(pkg_t *pkg, int index_)
++{
++ if (index_ < pkg->pre_depends_count) {
++ return pkg->pre_depends_str[index_];
++ }
++ index_ -= pkg->pre_depends_count;
++
++ if (index_ < pkg->recommends_count) {
++ return pkg->recommends_str[index_];
++ }
++ index_ -= pkg->recommends_count;
++
++ if (index_ < pkg->suggests_count) {
++ return pkg->suggests_str[index_];
++ }
++ index_ -= pkg->suggests_count;
++
++ if (index_ < pkg->depends_count) {
++ return pkg->depends_str[index_];
++ }
++ fprintf(stderr, "pkg_depend_str: index_ %d out of range for pkg=%s\n", index_, pkg->name);
++ return NULL;
++}
++
++void freeDepends(pkg_t *pkg)
++{
++ int i;
++
++ if (pkg == NULL || pkg->depends == NULL) {
++ return;
++ }
++
++ fprintf(stderr, "Freeing depends=%p\n", pkg->depends);
++ for (i=0; i < pkg->depends->possibility_count; i++) {
++ depend_deinit(pkg->depends->possibilities[i]);
++ }
++ free(pkg->depends->possibilities);
++ free(pkg->depends);
++ pkg->depends = NULL;
++}
++
++void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg)
++{
++ compound_depend_t * depends;
++ int count, othercount;
++ register int i, j;
++ abstract_pkg_t * ab_depend;
++ abstract_pkg_t ** temp;
++
++ count = pkg->pre_depends_count + pkg->depends_count;
++ depends = pkg->depends;
++
++ if (0 && pkg->pre_depends_count)
++ fprintf(stderr, "pkg=%s pre_depends_count=%d depends_count=%d\n",
++ pkg->name, pkg->pre_depends_count, pkg->depends_count);
++ for (i = 0; i < count; i++) {
++ if (0 && pkg->pre_depends_count)
++ fprintf(stderr, " i=%d possibility_count=%x depends=%p\n", i, depends->possibility_count, depends);
++ for (j = 0; j < depends->possibility_count; j++){
++ ab_depend = depends->possibilities[j]->pkg;
++ if(!ab_depend->depended_upon_by)
++ ab_depend->depended_upon_by = (abstract_pkg_t **)calloc(1, sizeof(abstract_pkg_t *));
++
++ temp = ab_depend->depended_upon_by;
++ othercount = 1;
++ while(*temp){
++ temp++;
++ othercount++;
++ }
++ *temp = ab_pkg;
++
++ ab_depend->depended_upon_by = (abstract_pkg_t **)realloc(ab_depend->depended_upon_by,
++ (othercount + 1) * sizeof(abstract_pkg_t *));
++ /* the array may have moved */
++ temp = ab_depend->depended_upon_by + othercount;
++ *temp = NULL;
++ }
++ depends++;
++ }
++}
++
++static depend_t * depend_init(void)
++{
++ depend_t * d = (depend_t *)malloc(sizeof(depend_t));
++ if ( d==NULL ){
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ d->constraint = NONE;
++ d->version = NULL;
++ d->pkg = NULL;
++
++ return d;
++}
++
++static void depend_deinit(depend_t *d)
++{
++ free(d);
++}
++
++static int parseDepends(compound_depend_t *compound_depend,
++ hash_table_t * hash, char * depend_str)
++{
++ char * pkg_name, buffer[2048];
++ int num_of_ors = 0;
++ register int i;
++ register char * src, * dest;
++ depend_t ** possibilities;
++
++ /* first count the number of ored possibilities for satisfying dependency */
++ src = depend_str;
++ while(*src)
++ if(*src++ == '|')
++ num_of_ors++;
++
++ compound_depend->type = DEPEND;
++
++ compound_depend->possibility_count = num_of_ors + 1;
++ possibilities = (depend_t **)malloc(sizeof(depend_t *) * (num_of_ors + 1));
++ if (!possibilities)
++ return -ENOMEM;
++ compound_depend->possibilities = possibilities;
++
++ src = depend_str;
++ for(i = 0; i < num_of_ors + 1; i++){
++ possibilities[i] = depend_init();
++ if (!possibilities[i])
++ return -ENOMEM;
++ /* gobble up just the name first */
++ dest = buffer;
++ while(*src &&
++ !isspace(*src) &&
++ (*src != '(') &&
++ (*src != '*') &&
++ (*src != '|'))
++ *dest++ = *src++;
++ *dest = '\0';
++ pkg_name = trim_alloc(buffer);
++ if (pkg_name == NULL )
++ return -ENOMEM;
++
++ /* now look at possible version info */
++
++ /* skip to next chars */
++ if(isspace(*src))
++ while(*src && isspace(*src)) src++;
++
++ /* extract constraint and version */
++ if(*src == '('){
++ src++;
++ if(!strncmp(src, "<<", 2)){
++ possibilities[i]->constraint = EARLIER;
++ src += 2;
++ }
++ else if(!strncmp(src, "<=", 2)){
++ possibilities[i]->constraint = EARLIER_EQUAL;
++ src += 2;
++ }
++ else if(!strncmp(src, ">=", 2)){
++ possibilities[i]->constraint = LATER_EQUAL;
++ src += 2;
++ }
++ else if(!strncmp(src, ">>", 2)){
++ possibilities[i]->constraint = LATER;
++ src += 2;
++ }
++ else if(!strncmp(src, "=", 1)){
++ possibilities[i]->constraint = EQUAL;
++ src++;
++ }
++ /* should these be here to support deprecated designations; dpkg does */
++ else if(!strncmp(src, "<", 1)){
++ possibilities[i]->constraint = EARLIER_EQUAL;
++ src++;
++ }
++ else if(!strncmp(src, ">", 1)){
++ possibilities[i]->constraint = LATER_EQUAL;
++ src++;
++ }
++
++ /* now we have any constraint, pass space to version string */
++ while(isspace(*src)) src++;
++
++ /* this would be the version string */
++ dest = buffer;
++ while(*src && *src != ')')
++ *dest++ = *src++;
++ *dest = '\0';
++
++ possibilities[i]->version = trim_alloc(buffer);
++ /* fprintf(stderr, "let's print the depends version string:");
++ fprintf(stderr, "version %s\n", possibilities[i]->version);*/
++ if (possibilities[i]->version == NULL )
++ return -ENOMEM;
++
++
++ }
++ /* hook up the dependency to its abstract pkg */
++ possibilities[i]->pkg = ensure_abstract_pkg_by_name(hash, pkg_name);
++
++ free(pkg_name);
++
++ /* now get past the ) and any possible | chars */
++ while(*src &&
++ (isspace(*src) ||
++ (*src == ')') ||
++ (*src == '|')))
++ src++;
++ if (*src == '*')
++ {
++ compound_depend->type = GREEDY_DEPEND;
++ src++;
++ }
++ }
++
++ return 0;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_depends.h busybox-1.12.1/archival/libipkg/pkg_depends.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_depends.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_depends.h 2008-10-23 15:05:54.000000000 +0200
+@@ -0,0 +1,105 @@
++/* pkg_depends.h - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_DEPENDS_H
++#define PKG_DEPENDS_H
++
++#include "pkg.h"
++#include "pkg_hash.h"
++
++enum depend_type {
++ PREDEPEND,
++ DEPEND,
++ CONFLICTS,
++ GREEDY_DEPEND,
++ RECOMMEND,
++ SUGGEST
++};
++typedef enum depend_type depend_type_t;
++
++enum version_constraint {
++ NONE,
++ EARLIER,
++ EARLIER_EQUAL,
++ EQUAL,
++ LATER_EQUAL,
++ LATER
++};
++typedef enum version_constraint version_constraint_t;
++
++struct depend{
++ version_constraint_t constraint;
++ char * version;
++ abstract_pkg_t * pkg;
++};
++typedef struct depend depend_t;
++
++struct compound_depend{
++ depend_type_t type;
++ int possibility_count;
++ struct depend ** possibilities;
++};
++typedef struct compound_depend compound_depend_t;
++
++#include "hash_table.h"
++
++int buildProvides(hash_table_t * hash, abstract_pkg_t * ab_pkg, pkg_t * pkg);
++int buildConflicts(hash_table_t * hash, pkg_t * pkg);
++int buildReplaces(hash_table_t * hash, abstract_pkg_t * ab_pkg, pkg_t * pkg);
++int buildDepends(hash_table_t * hash, pkg_t * pkg);
++
++/**
++ * pkg_has_common_provides returns 1 if pkg and replacee both provide
++ * the same abstract package and 0 otherwise.
++ */
++int pkg_has_common_provides(pkg_t *pkg, pkg_t *replacee);
++
++/**
++ * pkg_provides returns 1 if pkg->provides contains providee and 0
++ * otherwise.
++ */
++int pkg_provides_abstract(pkg_t *pkg, abstract_pkg_t *providee);
++
++/**
++ * pkg_replaces returns 1 if pkg->replaces contains one of replacee's provides and 0
++ * otherwise.
++ */
++int pkg_replaces(pkg_t *pkg, pkg_t *replacee);
++
++/**
++ * pkg_conflicts_abstract returns 1 if pkg->conflicts contains conflictee provides and 0
++ * otherwise.
++ */
++int pkg_conflicts_abstract(pkg_t *pkg, abstract_pkg_t *conflicts);
++
++/**
++ * pkg_conflicts returns 1 if pkg->conflicts contains one of conflictee's provides and 0
++ * otherwise.
++ */
++int pkg_conflicts(pkg_t *pkg, pkg_t *conflicts);
++
++char *pkg_depend_str(pkg_t *pkg, int index_);
++void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg);
++void freeDepends(pkg_t *pkg);
++void printDepends(pkg_t * pkg);
++int version_constraints_satisfied(depend_t * depends, pkg_t * pkg);
++int pkg_hash_fetch_unsatisfied_dependencies(ipkg_conf_t *conf, pkg_t * pkg, pkg_vec_t *depends, char *** unresolved);
++pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg);
++int pkg_dependence_satisfiable(depend_t *depend);
++int pkg_dependence_satisfied(depend_t *depend);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_dest.c busybox-1.12.1/archival/libipkg/pkg_dest.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_dest.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_dest.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,92 @@
++/* pkg_dest.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "pkg_dest.h"
++#include "file_util.h"
++#include "str_util.h"
++#include "sprintf_alloc.h"
++
++int pkg_dest_init(pkg_dest_t *dest, const char *name, const char *root_dir,const char * lists_dir)
++{
++ dest->name = strdup(name);
++
++ /* Guarantee that dest->root_dir ends with a '/' */
++ if (str_ends_with(root_dir, "/")) {
++ dest->root_dir = strdup(root_dir);
++ } else {
++ sprintf_alloc(&dest->root_dir, "%s/", root_dir);
++ }
++ file_mkdir_hier(dest->root_dir, 0755);
++
++ sprintf_alloc(&dest->ipkg_dir, "%s%s",
++ dest->root_dir, IPKG_STATE_DIR_PREFIX);
++ file_mkdir_hier(dest->ipkg_dir, 0755);
++
++ if (str_starts_with (lists_dir, "/"))
++ sprintf_alloc(&dest->lists_dir, "%s", lists_dir);
++ else
++ sprintf_alloc(&dest->lists_dir, "/%s", lists_dir);
++
++ file_mkdir_hier(dest->lists_dir, 0755);
++
++ sprintf_alloc(&dest->info_dir, "%s/%s",
++ dest->ipkg_dir, IPKG_INFO_DIR_SUFFIX);
++ file_mkdir_hier(dest->info_dir, 0755);
++
++ sprintf_alloc(&dest->status_file_name, "%s/%s",
++ dest->ipkg_dir, IPKG_STATUS_FILE_SUFFIX);
++
++ sprintf_alloc(&dest->status_file_tmp_name, "%s/%s.tmp",
++ dest->ipkg_dir, IPKG_STATUS_FILE_SUFFIX);
++
++ dest->status_file = NULL;
++
++ return 0;
++}
++
++void pkg_dest_deinit(pkg_dest_t *dest)
++{
++ free(dest->name);
++ dest->name = NULL;
++
++ free(dest->root_dir);
++ dest->root_dir = NULL;
++
++ free(dest->ipkg_dir);
++ dest->ipkg_dir = NULL;
++
++ free(dest->lists_dir);
++ dest->lists_dir = NULL;
++
++ free(dest->info_dir);
++ dest->info_dir = NULL;
++
++ free(dest->status_file_name);
++ dest->status_file_name = NULL;
++
++ free(dest->status_file_tmp_name);
++ dest->status_file_tmp_name = NULL;
++
++ if (dest->status_file) {
++ fclose(dest->status_file);
++ }
++ dest->status_file = NULL;
++
++ dest->root_dir = NULL;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_dest.h busybox-1.12.1/archival/libipkg/pkg_dest.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_dest.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_dest.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,38 @@
++/* pkg_dest.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_DEST_H
++#define PKG_DEST_H
++
++typedef struct pkg_dest pkg_dest_t;
++struct pkg_dest
++{
++ char *name;
++ char *root_dir;
++ char *ipkg_dir;
++ char *lists_dir;
++ char *info_dir;
++ char *status_file_name;
++ char *status_file_tmp_name;
++ FILE *status_file;
++};
++
++int pkg_dest_init(pkg_dest_t *dest, const char *name, const char *root_dir,const char *lists_dir);
++void pkg_dest_deinit(pkg_dest_t *dest);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_dest_list.c busybox-1.12.1/archival/libipkg/pkg_dest_list.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_dest_list.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_dest_list.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,85 @@
++/* pkg_dest_list.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "pkg_dest.h"
++#include "void_list.h"
++#include "pkg_dest_list.h"
++
++int pkg_dest_list_elt_init(pkg_dest_list_elt_t *elt, pkg_dest_t *data)
++{
++ return void_list_elt_init((void_list_elt_t *) elt, data);
++}
++
++void pkg_dest_list_elt_deinit(pkg_dest_list_elt_t *elt)
++{
++ void_list_elt_deinit((void_list_elt_t *) elt);
++}
++
++int pkg_dest_list_init(pkg_dest_list_t *list)
++{
++ return void_list_init((void_list_t *) list);
++}
++
++void pkg_dest_list_deinit(pkg_dest_list_t *list)
++{
++ pkg_dest_list_elt_t *iter;
++ pkg_dest_t *pkg_dest;
++
++ for (iter = list->head; iter; iter = iter->next) {
++ pkg_dest = iter->data;
++ pkg_dest_deinit(pkg_dest);
++
++ /* malloced in pkg_dest_list_append */
++ free(pkg_dest);
++ iter->data = NULL;
++ }
++ void_list_deinit((void_list_t *) list);
++}
++
++pkg_dest_t *pkg_dest_list_append(pkg_dest_list_t *list, const char *name,
++ const char *root_dir,const char *lists_dir)
++{
++ int err;
++ pkg_dest_t *pkg_dest;
++
++ /* freed in plg_dest_list_deinit */
++ pkg_dest = malloc(sizeof(pkg_dest_t));
++ if (pkg_dest == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++
++ pkg_dest_init(pkg_dest, name, root_dir,lists_dir);
++ err = void_list_append((void_list_t *) list, pkg_dest);
++ if (err) {
++ return NULL;
++ }
++
++ return pkg_dest;
++}
++
++int pkg_dest_list_push(pkg_dest_list_t *list, pkg_dest_t *data)
++{
++ return void_list_push((void_list_t *) list, data);
++}
++
++pkg_dest_list_elt_t *pkg_dest_list_pop(pkg_dest_list_t *list)
++{
++ return (pkg_dest_list_elt_t *) void_list_pop((void_list_t *) list);
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_dest_list.h busybox-1.12.1/archival/libipkg/pkg_dest_list.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_dest_list.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_dest_list.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,50 @@
++/* pkg_dest_list.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_DEST_LIST_H
++#define PKG_DEST_LIST_H
++
++#include "pkg_dest.h"
++
++typedef struct pkg_dest_list_elt pkg_dest_list_elt_t;
++struct pkg_dest_list_elt
++{
++ pkg_dest_list_elt_t *next;
++ pkg_dest_t *data;
++};
++
++typedef struct pkg_dest_list pkg_dest_list_t;
++struct pkg_dest_list
++{
++ pkg_dest_list_elt_t pre_head;
++ pkg_dest_list_elt_t *head;
++ pkg_dest_list_elt_t *tail;
++};
++
++int pkg_dest_list_elt_init(pkg_dest_list_elt_t *elt, pkg_dest_t *data);
++void pkg_dest_list_elt_deinit(pkg_dest_list_elt_t *elt);
++
++int pkg_dest_list_init(pkg_dest_list_t *list);
++void pkg_dest_list_deinit(pkg_dest_list_t *list);
++
++pkg_dest_t *pkg_dest_list_append(pkg_dest_list_t *list, const char *name,
++ const char *root_dir,const char* lists_dir);
++int pkg_dest_list_push(pkg_dest_list_t *list, pkg_dest_t *data);
++pkg_dest_list_elt_t *pkg_dest_list_pop(pkg_dest_list_t *list);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_extract.c busybox-1.12.1/archival/libipkg/pkg_extract.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_extract.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_extract.c 2008-10-23 15:21:22.000000000 +0200
+@@ -0,0 +1,225 @@
++/* pkg_extract.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <errno.h>
++#include <fcntl.h>
++#include <stdio.h>
++
++#include "pkg_extract.h"
++
++#include "libbb.h"
++#include "file_util.h"
++#include "sprintf_alloc.h"
++#include "unarchive.h"
++
++#define IPKG_CONTROL_ARCHIVE "control.tar.gz"
++#define IPKG_DATA_ARCHIVE "data.tar.gz"
++#define IPKG_CONTROL_FILE "control"
++
++static void extract_ipkg_file_to_dir(pkg_t *pkg, const char *dir, const char *filename)
++{
++ archive_handle_t *archive;
++ char *path;
++
++ sprintf_alloc(&path, "%s/", dir);
++ archive = init_handle();
++ archive->src_fd = xopen(pkg->local_filename, O_RDONLY);
++ archive->filter = filter_accept_list;
++ llist_add_to(&(archive->accept), (char *)filename);
++ archive->buffer = path;
++ archive->action_data = data_extract_all_prefix;
++ archive->ah_flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
++ while( get_header_tar_gz(archive) == EXIT_SUCCESS );
++ close(archive->src_fd);
++ free(archive->accept);
++ free(archive);
++ free(path);
++}
++
++static void FAST_FUNC data_extract_file_name_to_buffer(archive_handle_t *archive)
++{
++ unsigned int size = strlen(archive->file_header->name) + 2;
++
++ if (archive->buffer == NULL) {
++ archive->buffer = xmalloc(size);
++ strcpy(archive->buffer, archive->file_header->name);
++ } else {
++ size += strlen(archive->buffer);
++ archive->buffer = xrealloc(archive->buffer, size);
++ strcat(archive->buffer, archive->file_header->name);
++ }
++ strcat(archive->buffer, "\n");
++ data_skip(archive);
++}
++
++int pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream)
++{
++ archive_handle_t *archive;
++ char *name;
++ const char *filename = "./" IPKG_CONTROL_FILE;
++
++ extract_ipkg_file_to_dir(pkg, global_conf->tmp_dir, "./" IPKG_CONTROL_ARCHIVE);
++ sprintf_alloc(&name, "%s/%s", global_conf->tmp_dir, IPKG_CONTROL_ARCHIVE);
++ archive = init_handle();
++ archive->src_fd = xopen(name, O_RDONLY);
++ archive->filter = filter_accept_list;
++ llist_add_to(&(archive->accept), (char *)filename);
++ archive->action_data = data_extract_to_buffer;
++ while( get_header_tar_gz(archive) == EXIT_SUCCESS );
++ close(archive->src_fd);
++ fputs(archive->buffer, stream);
++ free(archive->buffer);
++ free(archive->accept);
++ free(archive);
++ free(name);
++
++ return 0;
++}
++
++int pkg_extract_control_files_to_dir(pkg_t *pkg, const char *dir)
++{
++ return pkg_extract_control_files_to_dir_with_prefix(pkg, dir, "");
++}
++
++int pkg_extract_control_files_to_dir_with_prefix(pkg_t *pkg, const char *dir, const char *prefix)
++{
++ archive_handle_t *archive;
++ char *name;
++ char *path;
++
++ extract_ipkg_file_to_dir(pkg, global_conf->tmp_dir, "./" IPKG_CONTROL_ARCHIVE);
++ sprintf_alloc(&name, "%s/%s", global_conf->tmp_dir, IPKG_CONTROL_ARCHIVE);
++ sprintf_alloc(&path, "%s/%s", dir, prefix);
++ archive = init_handle();
++ archive->src_fd = xopen(name, O_RDONLY);
++ archive->filter = filter_accept_all;
++ archive->buffer = path;
++ archive->action_data = data_extract_all_prefix;
++ archive->ah_flags |= ARCHIVE_CREATE_LEADING_DIRS | ARCHIVE_PRESERVE_DATE | ARCHIVE_EXTRACT_UNCONDITIONAL;
++ while( get_header_tar_gz(archive) == EXIT_SUCCESS );
++ close(archive->src_fd);
++ free(archive);
++ free(path);
++ free(name);
++
++ return 0;
++}
++
++int pkg_extract_data_files_to_dir(pkg_t *pkg, const char *dir)
++{
++ archive_handle_t *archive;
++ char *name;
++ char *path;
++
++ extract_ipkg_file_to_dir(pkg, global_conf->tmp_dir, "./" IPKG_DATA_ARCHIVE);
++ sprintf_alloc(&name, "%s/%s", global_conf->tmp_dir, IPKG_DATA_ARCHIVE);
++ sprintf_alloc(&path, "%s/", dir);
++ archive = init_handle();
++ archive->src_fd = xopen(name, O_RDONLY);
++ archive->filter = filter_accept_all;
++ archive->buffer = path;
++ archive->action_data = data_extract_all_prefix;
++ archive->ah_flags |= ARCHIVE_CREATE_LEADING_DIRS | ARCHIVE_PRESERVE_DATE | ARCHIVE_EXTRACT_UNCONDITIONAL;
++ while( get_header_tar_gz(archive) == EXIT_SUCCESS );
++ close(archive->src_fd);
++ free(archive);
++ free(path);
++ free(name);
++
++ return 0;
++}
++
++int pkg_extract_data_file_names_to_file(pkg_t *pkg, const char *file_name)
++{
++ int err=0;
++ char *line, *data_file;
++ FILE *file;
++ FILE *tmp;
++
++ file = fopen(file_name, "w");
++ if (file == NULL) {
++ fprintf(stderr, "%s: ERROR: Failed to open %s for writing.\n",
++ __FUNCTION__, file_name);
++ return EINVAL;
++ }
++
++ tmp = tmpfile();
++ if (pkg->installed_files) {
++ str_list_elt_t *elt;
++ for (elt = pkg->installed_files->head; elt; elt = elt->next) {
++ fprintf(file, "%s\n", elt->data);
++ }
++ } else {
++ err = pkg_extract_data_file_names_to_stream(pkg, tmp);
++ if (err) {
++ fclose(file);
++ fclose(tmp);
++ return err;
++ }
++
++ /* Fixup data file names by removing the initial '.' */
++ rewind(tmp);
++ while (1) {
++ line = file_read_line_alloc(tmp);
++ if (line == NULL) {
++ break;
++ }
++
++ data_file = line;
++ if (*data_file == '.') {
++ data_file++;
++ }
++
++ if (*data_file != '/') {
++ fputs("/", file);
++ }
++
++ /* I have no idea why, but this is what dpkg does */
++ if (strcmp(data_file, "/\n") == 0) {
++ fputs("/.\n", file);
++ } else {
++ fputs(data_file, file);
++ }
++ }
++ }
++ fclose(tmp);
++ fclose(file);
++
++ return err;
++}
++
++int pkg_extract_data_file_names_to_stream(pkg_t *pkg, FILE *file)
++{
++ archive_handle_t *archive;
++ char *name;
++
++ extract_ipkg_file_to_dir(pkg, global_conf->tmp_dir, "./" IPKG_DATA_ARCHIVE);
++ sprintf_alloc(&name, "%s/%s", global_conf->tmp_dir, IPKG_DATA_ARCHIVE);
++ archive = init_handle();
++ archive->src_fd = xopen(name, O_RDONLY);
++ archive->filter = filter_accept_all;
++ archive->action_data = data_extract_file_name_to_buffer;
++ while( get_header_tar_gz(archive) == EXIT_SUCCESS );
++ close(archive->src_fd);
++ fputs(archive->buffer, file);
++ free(archive->buffer);
++ free(archive);
++ free(name);
++
++ return 0;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_extract.h busybox-1.12.1/archival/libipkg/pkg_extract.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_extract.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_extract.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,32 @@
++/* pkg_extract.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_EXTRACT_H
++#define PKG_EXTRACT_H
++
++#include "pkg.h"
++
++int pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream);
++int pkg_extract_control_files_to_dir(pkg_t *pkg, const char *dir);
++int pkg_extract_control_files_to_dir_with_prefix(pkg_t *pkg,
++ const char *dir,
++ const char *prefix);
++int pkg_extract_data_files_to_dir(pkg_t *pkg, const char *dir);
++int pkg_extract_data_file_names_to_file(pkg_t *pkg, const char *file_name);
++int pkg_extract_data_file_names_to_stream(pkg_t *pkg, FILE *file);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg.h busybox-1.12.1/archival/libipkg/pkg.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg.h 2008-10-23 15:27:11.000000000 +0200
+@@ -0,0 +1,229 @@
++/* pkg.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_H
++#define PKG_H
++
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
++
++#include "pkg_vec.h"
++#include "str_list.h"
++#include "pkg_src.h"
++#include "pkg_dest.h"
++#include "ipkg_conf.h"
++#include "conffile_list.h"
++
++struct ipkg_conf;
++
++/* I think "Size" is currently the shortest field name */
++#define PKG_MINIMUM_FIELD_NAME_LEN 4
++
++enum pkg_state_want
++{
++ SW_UNKNOWN = 1,
++ SW_INSTALL,
++ SW_DEINSTALL,
++ SW_PURGE,
++ SW_LAST_STATE_WANT
++};
++typedef enum pkg_state_want pkg_state_want_t;
++
++enum pkg_state_flag
++{
++ SF_OK = 0,
++ SF_REINSTREQ = 1,
++ SF_HOLD = 2, /* do not upgrade version */
++ SF_REPLACE = 4, /* replace this package */
++ SF_NOPRUNE = 8, /* do not remove obsolete files */
++ SF_PREFER = 16, /* prefer this version */
++ SF_OBSOLETE = 32, /* old package in upgrade pair */
++ SF_MARKED = 64, /* temporary mark */
++ SF_FILELIST_CHANGED = 128, /* needs filelist written */
++ SF_USER = 256,
++ SF_LAST_STATE_FLAG
++};
++typedef enum pkg_state_flag pkg_state_flag_t;
++#define SF_NONVOLATILE_FLAGS (SF_HOLD|SF_NOPRUNE|SF_PREFER|SF_OBSOLETE|SF_USER)
++
++enum pkg_state_status
++{
++ SS_NOT_INSTALLED = 1,
++ SS_UNPACKED,
++ SS_HALF_CONFIGURED,
++ SS_INSTALLED,
++ SS_HALF_INSTALLED,
++ SS_CONFIG_FILES,
++ SS_POST_INST_FAILED,
++ SS_REMOVAL_FAILED,
++ SS_LAST_STATE_STATUS
++};
++typedef enum pkg_state_status pkg_state_status_t;
++
++struct abstract_pkg{
++ char * name;
++ int dependencies_checked;
++ pkg_vec_t * pkgs;
++ pkg_state_status_t state_status;
++ pkg_state_flag_t state_flag;
++ struct abstract_pkg ** depended_upon_by; /* @@@@ this should be abstract_pkg_vec_t -Jamey */
++ abstract_pkg_vec_t * provided_by;
++ abstract_pkg_vec_t * replaced_by;
++};
++
++#include "pkg_depends.h"
++
++/* XXX: CLEANUP: I'd like to clean up pkg_t in several ways:
++
++ The 3 version fields should go into a single version struct. (This
++ is especially important since, currently, pkg->version can easily
++ be mistaken for pkg_verson_str_alloc(pkg) although they are very
++ distinct. This has been the source of multiple bugs.
++
++ The 3 state fields could possibly also go into their own struct.
++
++ All fields which deal with lists of packages, (Depends,
++ Pre-Depends, Provides, Suggests, Recommends, Enhances), should each
++ be handled by a single struct in pkg_t
++
++ All string fields for which there is a small set of possible
++ values, (section, maintainer, architecture, maybe version?), that
++ are reused among different packages -- for all such packages we
++ should move from "char *"s to some atom datatype to share data
++ storage and use less memory. We might even do reference counting,
++ but probably not since most often we only create new pkg_t structs,
++ we don't often free them. */
++struct pkg
++{
++ char *name;
++ unsigned long epoch;
++ char *version;
++ char *revision;
++ char *familiar_revision;
++ pkg_src_t *src;
++ pkg_dest_t *dest;
++ char *architecture;
++ char *section;
++ char *maintainer;
++ char *description;
++ pkg_state_want_t state_want;
++ pkg_state_flag_t state_flag;
++ pkg_state_status_t state_status;
++ char **depends_str;
++ int depends_count;
++ char **pre_depends_str;
++ int pre_depends_count;
++ char **recommends_str;
++ int recommends_count;
++ char **suggests_str;
++ int suggests_count;
++ compound_depend_t * depends;
++
++ /* Abhaya: new conflicts */
++ char **conflicts_str;
++ compound_depend_t * conflicts;
++ int conflicts_count;
++
++ char **replaces_str;
++ int replaces_count;
++ abstract_pkg_t ** replaces;
++
++ char **provides_str;
++ int provides_count;
++ abstract_pkg_t ** provides;
++
++ abstract_pkg_t *parent;
++
++ pkg_t *old_pkg; /* during upgrade, points from installee to previously installed */
++
++ char *filename;
++ char *local_filename;
++ char *url;
++ char *tmp_unpack_dir;
++ char *md5sum;
++ char *size;
++ char *installed_size;
++ char *priority;
++ char *source;
++ conffile_list_t conffiles;
++ time_t installed_time;
++ /* As pointer for lazy evaluation */
++ str_list_t *installed_files;
++ /* XXX: CLEANUP: I'd like to perhaps come up with a better
++ mechanism to avoid the problem here, (which is that the
++ installed_files list was being freed from an inner loop while
++ still being used within an outer loop. */
++ int installed_files_ref_cnt;
++ int essential;
++ int arch_priority;
++/* Adding this flag, to "force" ipkg to choose a "provided_by_hand" package, if there are multiple choice */
++ int provided_by_hand;
++};
++
++pkg_t *pkg_new(void);
++int pkg_init(pkg_t *pkg);
++void pkg_deinit(pkg_t *pkg);
++int pkg_init_from_file(pkg_t *pkg, const char *filename);
++abstract_pkg_t *abstract_pkg_new(void);
++int abstract_pkg_init(abstract_pkg_t *ab_pkg);
++
++/*
++ * merges fields from newpkg into oldpkg.
++ * Forcibly sets oldpkg state_status, state_want and state_flags if set_status is nonzero
++ */
++int pkg_merge(pkg_t *oldpkg, pkg_t *newpkg, int set_status);
++
++char *pkg_version_str_alloc(pkg_t *pkg);
++
++int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg);
++int pkg_name_version_and_architecture_compare(pkg_t *a, pkg_t *b);
++int abstract_pkg_name_compare(abstract_pkg_t *a, abstract_pkg_t *b);
++
++char * pkg_formatted_info(pkg_t *pkg );
++char * pkg_formatted_field(pkg_t *pkg, const char *field );
++
++void set_flags_from_control(ipkg_conf_t *conf, pkg_t *pkg);
++
++void pkg_print_info(pkg_t *pkg, FILE *file);
++void pkg_print_status(pkg_t * pkg, FILE * file);
++void pkg_print_field(pkg_t *pkg, FILE *file, const char *field);
++str_list_t *pkg_get_installed_files(pkg_t *pkg);
++int pkg_free_installed_files(pkg_t *pkg);
++int pkg_remove_installed_files_list(ipkg_conf_t *conf, pkg_t *pkg);
++conffile_t *pkg_get_conffile(pkg_t *pkg, const char *file_name);
++int pkg_run_script(struct ipkg_conf *conf, pkg_t *pkg,
++ const char *script, const char *args);
++
++/* enum mappings */
++char *pkg_state_want_to_str(pkg_state_want_t sw);
++pkg_state_want_t pkg_state_want_from_str(char *str);
++char *pkg_state_flag_to_str(pkg_state_flag_t sf);
++pkg_state_flag_t pkg_state_flag_from_str(char *str);
++char *pkg_state_status_to_str(pkg_state_status_t ss);
++pkg_state_status_t pkg_state_status_from_str(char *str);
++
++int pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op);
++
++int pkg_arch_supported(ipkg_conf_t *conf, pkg_t *pkg);
++int pkg_info_preinstall_check(ipkg_conf_t *conf);
++int pkg_free_installed_files(pkg_t *pkg);
++
++int pkg_write_filelist(ipkg_conf_t *conf, pkg_t *pkg);
++int pkg_write_changed_filelists(ipkg_conf_t *conf);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_hash.c busybox-1.12.1/archival/libipkg/pkg_hash.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_hash.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_hash.c 2008-10-23 16:21:09.000000000 +0200
+@@ -0,0 +1,623 @@
++/* ipkg_hash.c - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <errno.h>
++#include <ctype.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include "hash_table.h"
++#include "pkg.h"
++#include "ipkg_message.h"
++#include "pkg_vec.h"
++#include "pkg_hash.h"
++#include "pkg_parse.h"
++#include "ipkg_utils.h"
++
++static abstract_pkg_t * add_new_abstract_pkg_by_name(hash_table_t * hash, const char * pkg_name);
++
++/*
++ * this will talk to both feeds-lists files and installed status files
++ * example api:
++ *
++ * hash_table_t hash;
++ * pkg_hash_init(name, &hash, 1000);
++ * pkg_hash_add_from_file(<feed filename>);
++ *
++ * the query function is just there as a shell to prove to me that this
++ * sort of works, but isn't far from doing something useful
++ *
++ * -sma, 12/21/01
++ * modified: CDW 3 Jan. 2002
++ */
++
++
++
++int pkg_hash_init(const char *name, hash_table_t *hash, int len)
++{
++ return hash_table_init(name, hash, len);
++}
++
++void pkg_hash_deinit(hash_table_t *hash)
++{
++ hash_table_deinit(hash);
++}
++
++
++/* Find the default arch for a given package status file if none is given. */
++static char *pkg_get_default_arch(ipkg_conf_t *conf)
++{
++ nv_pair_list_elt_t *l;
++ const char *def_arch = HOST_CPU_STR; /* Default arch */
++ int def_prio = 0; /* Other archs override this */
++
++ l = conf->arch_list.head;
++
++ while (l) {
++ nv_pair_t *nv = l->data;
++ int priority = strtol(nv->value, NULL, 0);
++
++ /* Check if this arch has higher priority, and is valid */
++ if ((priority > def_prio) &&
++ (strcmp(nv->name, "all")) && (strcmp(nv->name, "noarch"))) {
++ /* Our new default */
++ def_prio = priority;
++ def_arch = nv->name;
++ }
++ l = l->next;
++ }
++
++ return strdup(def_arch);
++}
++
++int pkg_hash_add_from_file(ipkg_conf_t *conf, const char *file_name,
++ pkg_src_t *src, pkg_dest_t *dest, int is_status_file)
++{
++ hash_table_t *hash = &conf->pkg_hash;
++ char **raw;
++ char **raw_start;
++ pkg_t *pkg;
++
++ raw = raw_start = read_raw_pkgs_from_file(file_name);
++ if (!raw)
++ return -ENOMEM;
++
++ while(*raw){ /* don't worry, we'll increment raw in the parsing function */
++ pkg = pkg_new();
++ if (!pkg)
++ return -ENOMEM;
++
++ if (pkg_parse_raw(pkg, &raw, src, dest) == 0) {
++ if (!pkg->architecture) {
++ char *version_str = pkg_version_str_alloc(pkg);
++ pkg->architecture = pkg_get_default_arch(conf);
++ ipkg_message(conf, IPKG_ERROR, "Package %s version %s has no architecture specified, defaulting to %s.\n",
++ pkg->name, version_str, pkg->architecture);
++ free(version_str);
++ }
++ hash_insert_pkg(hash, pkg, is_status_file,conf);
++ } else {
++ free(pkg);
++ }
++ }
++
++ /* XXX: CLEANUP: I'd like a cleaner interface for cleaning up
++ memory after read_raw_pkgs_from_file */
++ raw = raw_start;
++ while (*raw) {
++ free(*raw++);
++ }
++ free(raw_start);
++ return 0;
++}
++
++abstract_pkg_t * abstract_pkg_fetch_by_name(hash_table_t * hash, const char * pkg_name)
++{
++ return (abstract_pkg_t *)hash_table_get(hash, pkg_name);
++}
++
++abstract_pkg_vec_t *pkg_hash_fetch_all_installation_candidates(hash_table_t *hash, const char *name)
++{
++ abstract_pkg_t *apkg = abstract_pkg_fetch_by_name(hash, name);
++ if (apkg)
++ return NULL;
++ return apkg->provided_by;
++}
++
++
++pkg_t *pkg_hash_fetch_best_installation_candidate(ipkg_conf_t *conf, abstract_pkg_t *apkg,
++ int (*constraint_fcn)(pkg_t *pkg, void *cdata), void *cdata, int quiet)
++{
++ int i;
++ int nprovides = 0;
++ int nmatching = 0;
++ pkg_vec_t *matching_pkgs = pkg_vec_alloc();
++ abstract_pkg_vec_t *matching_apkgs = abstract_pkg_vec_alloc();
++ abstract_pkg_vec_t *provided_apkg_vec;
++ abstract_pkg_t **provided_apkgs;
++ abstract_pkg_vec_t *providers = abstract_pkg_vec_alloc();
++ pkg_t *latest_installed_parent = NULL;
++ pkg_t *latest_matching = NULL;
++ pkg_t *held_pkg = NULL;
++ pkg_t *good_pkg_by_name = NULL;
++
++ if (matching_apkgs == NULL || providers == NULL ||
++ apkg == NULL || apkg->provided_by == NULL || (apkg->provided_by->len == 0))
++ return NULL;
++
++ ipkg_message(conf, IPKG_DEBUG, "best installation candidate for %s\n", apkg->name);
++
++ provided_apkg_vec = apkg->provided_by;
++ nprovides = provided_apkg_vec->len;
++ provided_apkgs = provided_apkg_vec->pkgs;
++ if (nprovides > 1)
++ ipkg_message(conf, IPKG_DEBUG, " apkg=%s nprovides=%d\n", apkg->name, nprovides);
++
++ /* accumulate all the providers */
++ for (i = 0; i < nprovides; i++) {
++ abstract_pkg_t *provider_apkg = provided_apkgs[i];
++ ipkg_message(conf, IPKG_DEBUG, " adding %s to providers\n", provider_apkg->name);
++ abstract_pkg_vec_insert(providers, provider_apkg);
++ }
++ nprovides = providers->len;
++
++ for (i = 0; i < nprovides; i++) {
++ abstract_pkg_t *provider_apkg = abstract_pkg_vec_get(providers, i);
++ abstract_pkg_t *replacement_apkg = NULL;
++ pkg_vec_t *vec;
++
++ if (provider_apkg->replaced_by && provider_apkg->replaced_by->len) {
++ replacement_apkg = provider_apkg->replaced_by->pkgs[0];
++ if (provider_apkg->replaced_by->len > 1) {
++ ipkg_message(conf, IPKG_NOTICE, "Multiple replacers for %s, using first one (%s)\n",
++ provider_apkg->name, replacement_apkg->name);
++ }
++ }
++
++ if (replacement_apkg)
++ ipkg_message(conf, IPKG_DEBUG, " replacement_apkg=%s for provider_apkg=%s\n",
++ replacement_apkg->name, provider_apkg->name);
++
++ if (replacement_apkg && (replacement_apkg != provider_apkg)) {
++ if (abstract_pkg_vec_contains(providers, replacement_apkg))
++ continue;
++ else
++ provider_apkg = replacement_apkg;
++ }
++
++ if (!(vec = provider_apkg->pkgs)) {
++ ipkg_message(conf, IPKG_DEBUG, " no pkgs for provider_apkg %s\n", provider_apkg->name);
++ continue;
++ }
++
++
++ /* now check for supported architecture */
++ {
++ int max_count = 0;
++ int j;
++
++ /* count packages matching max arch priority and keep track of last one */
++ for (j = 0; j < vec->len; j++) {
++ pkg_t *maybe = vec->pkgs[j];
++ ipkg_message(conf, IPKG_DEBUG, " %s arch=%s arch_priority=%d version=%s \n",
++ maybe->name, maybe->architecture, maybe->arch_priority, maybe->version);
++ if (maybe->arch_priority > 0) {
++ max_count++;
++ abstract_pkg_vec_insert(matching_apkgs, maybe->parent);
++ pkg_vec_insert(matching_pkgs, maybe);
++ }
++ }
++ }
++ }
++
++ if (matching_pkgs->len > 1)
++ pkg_vec_sort(matching_pkgs, pkg_name_version_and_architecture_compare);
++ if (matching_apkgs->len > 1)
++ abstract_pkg_vec_sort(matching_pkgs, abstract_pkg_name_compare);
++
++/* Here it is usefull, if ( matching_apkgs->len > 1 ), to test if one of this matching packages has the same name of the
++ needed package. In this case, I would return it for install, otherwise I will continue with the procedure */
++/* The problem is what to do when there are more than a mathing package, with the same name and several version ?
++ Until now I always got the latest, but that breaks the downgrade option.
++ If I stop at the first one, I would probably miss the new ones
++ Maybe the way is to have some kind of flag somewhere, to see if the package been asked to install is from a file,
++ or from a Packages feed.
++ It it is from a file it always need to be checked whatever version I have in feeds or everywhere, according to force-down or whatever options*/
++/*Pigi*/
++
++ for (i = 0; i < matching_pkgs->len; i++) {
++ pkg_t *matching = matching_pkgs->pkgs[i];
++ if (constraint_fcn(matching, cdata)) { /* We found it */
++ ipkg_message(conf, IPKG_DEBUG, " Found a valid candidate for the install: %s %s \n", matching->name, matching->version) ;
++ good_pkg_by_name = matching;
++ if ( matching->provided_by_hand == 1 ) /* It has been provided by hand, so it is what user want */
++ break;
++ }
++ }
++
++
++ for (i = 0; i < matching_pkgs->len; i++) {
++ pkg_t *matching = matching_pkgs->pkgs[i];
++ latest_matching = matching;
++ if (matching->parent->state_status == SS_INSTALLED || matching->parent->state_status == SS_UNPACKED)
++ latest_installed_parent = matching;
++ if (matching->state_flag & (SF_HOLD|SF_PREFER)) {
++ if (held_pkg)
++ ipkg_message(conf, IPKG_ERROR, "Multiple packages (%s and %s) providing same name marked HOLD or PREFER. Using latest.\n",
++ held_pkg->name, matching->name);
++ held_pkg = matching;
++ }
++ }
++
++ if (!good_pkg_by_name && !held_pkg && !latest_installed_parent && matching_apkgs->len > 1 && !quiet) {
++ ipkg_message(conf, IPKG_ERROR, "Package=%s, %d matching providers\n",
++ apkg->name, matching_apkgs->len);
++ for (i = 0; i < matching_apkgs->len; i++) {
++ abstract_pkg_t *matching = matching_apkgs->pkgs[i];
++ ipkg_message(conf, IPKG_ERROR, " %s\n", matching->name);
++ }
++ ipkg_message(conf, IPKG_ERROR, "Please select one with ipkg install or ipkg flag prefer\n");
++ }
++
++ if (matching_apkgs->len > 1 && conf->verbosity > 1) {
++ ipkg_message(conf, IPKG_NOTICE, "%s: for apkg=%s, %d matching pkgs\n",
++ __FUNCTION__, apkg->name, matching_pkgs->len);
++ for (i = 0; i < matching_pkgs->len; i++) {
++ pkg_t *matching = matching_pkgs->pkgs[i];
++ ipkg_message(conf, IPKG_INFO, " %s %s %s\n",
++ matching->name, matching->version, matching->architecture);
++ }
++ }
++
++ nmatching = matching_apkgs->len;
++
++ pkg_vec_free(matching_pkgs);
++ abstract_pkg_vec_free(matching_apkgs);
++ abstract_pkg_vec_free(providers);
++
++ if (good_pkg_by_name) { /* We found a good candidate, we will install it */
++ return good_pkg_by_name;
++ }
++ if (held_pkg) {
++ ipkg_message(conf, IPKG_INFO, " using held package %s\n", held_pkg->name);
++ return held_pkg;
++ }
++ if (latest_installed_parent) {
++ ipkg_message(conf, IPKG_INFO, " using latest version of installed package %s\n", latest_installed_parent->name);
++ return latest_installed_parent;
++ }
++ if (nmatching > 1) {
++ ipkg_message(conf, IPKG_INFO, " no matching pkg out of matching_apkgs=%d\n", nmatching);
++ return NULL;
++ }
++ if (latest_matching) {
++ ipkg_message(conf, IPKG_INFO, " using latest matching %s %s %s\n",
++ latest_matching->name, latest_matching->version, latest_matching->architecture);
++ return latest_matching;
++ }
++ return NULL;
++}
++
++static int pkg_name_constraint_fcn(pkg_t *pkg, void *cdata)
++{
++ const char *name = (const char *)cdata;
++ if (strcmp(pkg->name, name) == 0)
++ return 1;
++ else
++ return 0;
++}
++
++pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(ipkg_conf_t *conf, const char *name)
++{
++ hash_table_t *hash = &conf->pkg_hash;
++ abstract_pkg_t *apkg = NULL;
++
++ if (!(apkg = abstract_pkg_fetch_by_name(hash, name)))
++ return NULL;
++
++ return pkg_hash_fetch_best_installation_candidate(conf, apkg, pkg_name_constraint_fcn, apkg->name, 0);
++}
++
++
++pkg_t * pkg_hash_fetch_by_name_version(hash_table_t *hash,
++ const char *pkg_name,
++ const char * version)
++{
++ pkg_vec_t * vec;
++ register int i;
++ char *version_str = NULL;
++
++ if(!(vec = pkg_vec_fetch_by_name(hash, pkg_name)))
++ return NULL;
++
++ for(i = 0; i < vec->len; i++) {
++ version_str = pkg_version_str_alloc(vec->pkgs[i]);
++ if(!strcmp(version_str, version)) {
++ free(version_str);
++ break;
++ }
++ free(version_str);
++ }
++
++ if(i == vec->len)
++ return NULL;
++
++ return vec->pkgs[i];
++}
++
++pkg_t *pkg_hash_fetch_installed_by_name_dest(hash_table_t *hash,
++ const char *pkg_name,
++ pkg_dest_t *dest)
++{
++ pkg_vec_t * vec;
++ register int i;
++
++ if(!(vec = pkg_vec_fetch_by_name(hash, pkg_name))) {
++ return NULL;
++ }
++
++ for(i = 0; i < vec->len; i++)
++ if((vec->pkgs[i]->state_status == SS_INSTALLED || vec->pkgs[i]->state_status == SS_UNPACKED) && vec->pkgs[i]->dest == dest) {
++ return vec->pkgs[i];
++ }
++ return NULL;
++}
++
++pkg_t *pkg_hash_fetch_installed_by_name(hash_table_t *hash,
++ const char *pkg_name)
++{
++ pkg_vec_t * vec;
++ register int i;
++
++ if(!(vec = pkg_vec_fetch_by_name(hash, pkg_name))){
++ return NULL;
++ }
++
++ for(i = 0; i < vec->len; i++)
++ if (vec->pkgs[i]->state_status == SS_INSTALLED || vec->pkgs[i]->state_status == SS_UNPACKED){
++ return vec->pkgs[i];
++ }
++
++ return NULL;
++}
++
++pkg_vec_t *pkg_vec_fetch_by_name(hash_table_t *hash, const char *pkg_name)
++{
++ abstract_pkg_t * ab_pkg;
++
++ if(!(ab_pkg = abstract_pkg_fetch_by_name(hash, pkg_name))){
++ return NULL;
++ }
++
++ if (ab_pkg->pkgs) {
++ return ab_pkg->pkgs;
++ } else if (ab_pkg->provided_by) {
++ abstract_pkg_t *abpkg = abstract_pkg_vec_get(ab_pkg->provided_by, 0);
++ if (abpkg != NULL){
++ return abpkg->pkgs;
++ } else {
++ return ab_pkg->pkgs;
++ }
++ } else {
++ return NULL;
++ }
++}
++
++static int pkg_compare_names(const void *p1, const void *p2)
++{
++ const pkg_t *pkg1 = *(const pkg_t **)p1;
++ const pkg_t *pkg2 = *(const pkg_t **)p2;
++ if (pkg1->name == NULL)
++ return 1;
++ if (pkg2->name == NULL)
++ return -1;
++ return(strcmp(pkg1->name, pkg2->name));
++}
++
++
++static void pkg_hash_fetch_available_helper(const char *pkg_name, void *entry, void *data)
++{
++ int j;
++ const char *name;
++ abstract_pkg_t *ab_pkg = (abstract_pkg_t *)entry;
++ pkg_vec_t *all = (pkg_vec_t *)data;
++ pkg_vec_t *pkg_vec = ab_pkg->pkgs;
++ name = pkg_name;
++ if (pkg_vec) {
++ for (j = 0; j < pkg_vec->len; j++) {
++ pkg_t *pkg = pkg_vec->pkgs[j];
++ pkg_vec_insert(all, pkg);
++ }
++ }
++}
++
++void pkg_hash_fetch_available(hash_table_t *hash, pkg_vec_t *all)
++{
++ hash_table_foreach(hash, pkg_hash_fetch_available_helper, all);
++ qsort(all->pkgs, all->len, sizeof(pkg_t *), pkg_compare_names);
++}
++
++static void pkg_hash_fetch_all_installed_helper(const char *pkg_name, void *entry, void *data)
++{
++ const char *name;
++ abstract_pkg_t *ab_pkg = (abstract_pkg_t *)entry;
++ pkg_vec_t *all = (pkg_vec_t *)data;
++ pkg_vec_t *pkg_vec = ab_pkg->pkgs;
++ int j;
++ name = pkg_name;
++ if (pkg_vec) {
++ for (j = 0; j < pkg_vec->len; j++) {
++ pkg_t *pkg = pkg_vec->pkgs[j];
++ if (pkg->state_status == SS_INSTALLED || pkg->state_status == SS_UNPACKED) {
++ pkg_vec_insert(all, pkg);
++ }
++ }
++ }
++}
++void pkg_hash_fetch_all_installed(hash_table_t *hash, pkg_vec_t *all)
++{
++ hash_table_foreach(hash, pkg_hash_fetch_all_installed_helper, all);
++ qsort(all->pkgs, all->len, sizeof(void*), pkg_compare_names);
++}
++
++static void pkg_hash_dump_helper(const char *pkg_name, void *entry, void *data)
++{
++ int i;
++ pkg_t *pkg;
++ const char *name;
++ abstract_pkg_t *ab_pkg = (abstract_pkg_t *)entry;
++ ipkg_conf_t *conf = (ipkg_conf_t *)data;
++ abstract_pkg_t ** dependents = ab_pkg->depended_upon_by;
++ name = pkg_name;
++ fprintf(stdout, "%s\n", ab_pkg->name);
++ i = 0;
++ if (dependents != NULL)
++ while (dependents [i] != NULL)
++ printf ("\tdepended upon by - %s\n", dependents [i ++]->name);
++ dependents = ab_pkg->provided_by->pkgs;
++ i = 0;
++ if (dependents != NULL)
++ while (dependents [i] != NULL && i < ab_pkg->provided_by->len)
++ printf ("\tprovided by - %s\n", dependents [i ++]->name);
++ pkg = pkg_hash_fetch_best_installation_candidate_by_name (conf, ab_pkg->name);
++ if (pkg) {
++ i = 0;
++ while (i < pkg->depends_count)
++ printf ("\tdepends on - %s\n", pkg->depends_str [i ++]);
++ }
++}
++void pkg_hash_dump(hash_table_t *hash, void *data)
++{
++
++ printf ("\n\n+=+%s+=+\n\n", __FUNCTION__);
++ hash_table_foreach(hash, pkg_hash_dump_helper, data);
++ printf ("\n+=+%s+=+\n\n", __FUNCTION__);
++}
++
++abstract_pkg_t * ensure_abstract_pkg_by_name(hash_table_t * hash, const char * pkg_name)
++{
++ abstract_pkg_t * ab_pkg;
++
++ if(!(ab_pkg = abstract_pkg_fetch_by_name(hash, pkg_name)))
++ ab_pkg = add_new_abstract_pkg_by_name(hash, pkg_name);
++
++ return ab_pkg;
++}
++
++pkg_t *hash_insert_pkg(hash_table_t *hash, pkg_t *pkg, int set_status,ipkg_conf_t *conf)
++{
++ abstract_pkg_t * ab_pkg;
++ int arch_priority;
++
++ if(!pkg)
++ return pkg;
++
++ arch_priority = pkg->arch_priority;
++
++ if (buildDepends(hash, pkg)<0){
++ fprintf(stderr, "%s : This should never happen. Report this Bug in bugzilla please \n ",__FUNCTION__);
++ return NULL;
++ }
++ ab_pkg = ensure_abstract_pkg_by_name(hash, pkg->name);
++
++ if (set_status) {
++ if (pkg->state_status == SS_INSTALLED) {
++ ab_pkg->state_status = SS_INSTALLED;
++ } else if (pkg->state_status == SS_UNPACKED) {
++ ab_pkg->state_status = SS_UNPACKED;
++ }
++ }
++
++ if(!ab_pkg->pkgs)
++ ab_pkg->pkgs = pkg_vec_alloc();
++
++ /* pkg_vec_insert_merge might munge package, but it returns an unmunged pkg */
++ pkg = pkg_vec_insert_merge(ab_pkg->pkgs, pkg, set_status,conf );
++ pkg->parent = ab_pkg;
++
++ if (buildProvides(hash, ab_pkg, pkg)<0){
++ fprintf(stderr, "%s : This should never happen. Report this Bug in bugzilla please \n ",__FUNCTION__);
++ return NULL;
++ }
++ /* need to build the conflicts graph before replaces for correct calculation of replaced_by relation */
++ if (buildConflicts(hash, pkg)<0){
++ fprintf(stderr, "%s : This should never happen. Report this Bug in bugzilla please \n ",__FUNCTION__);
++ return NULL;
++ }
++ if (buildReplaces(hash, ab_pkg, pkg)<0) {
++ fprintf(stderr, "%s : This should never happen. Report this Bug in bugzilla please \n ",__FUNCTION__);
++ return NULL;
++ }
++
++ buildDependedUponBy(pkg, ab_pkg);
++ return pkg;
++}
++
++/*
++ * this will assume that we've already determined that
++ * the abstract pkg doesn't exist, 'cause we should know these things...
++ */
++static abstract_pkg_t * add_new_abstract_pkg_by_name(hash_table_t * hash, const char * pkg_name)
++{
++ abstract_pkg_t * ab_pkg;
++
++ ab_pkg = abstract_pkg_new();
++ if (ab_pkg == NULL) { return NULL; }
++
++ ab_pkg->name = strdup(pkg_name);
++ hash_table_insert(hash, pkg_name, ab_pkg);
++
++ return ab_pkg;
++}
++
++
++pkg_t *file_hash_get_file_owner(ipkg_conf_t *conf, const char *file_name)
++{
++ hash_table_t *file_hash = &conf->file_hash;
++
++ return hash_table_get(file_hash, file_name);
++}
++
++int file_hash_set_file_owner(ipkg_conf_t *conf, const char *file_name, pkg_t *owning_pkg)
++{
++ hash_table_t *file_hash = &conf->file_hash;
++ pkg_t *old_owning_pkg = hash_table_get(file_hash, file_name);
++ int file_name_len = strlen(file_name);
++
++ if (file_name[file_name_len -1] == '/')
++ return 0;
++
++ if (conf->offline_root) {
++ int len = strlen(conf->offline_root);
++ if (strncmp(file_name, conf->offline_root, len) == 0) {
++ file_name += len;
++ }
++ }
++
++ // ipkg_message(conf, IPKG_DEBUG2, "owning_pkg=%s filename=%s\n", owning_pkg->name, file_name);
++ hash_table_insert(file_hash, file_name, owning_pkg);
++ if (old_owning_pkg) {
++ str_list_remove_elt(old_owning_pkg->installed_files, file_name);
++ /* mark this package to have its filelist written */
++ old_owning_pkg->state_flag |= SF_FILELIST_CHANGED;
++ owning_pkg->state_flag |= SF_FILELIST_CHANGED;
++ }
++ return 0;
++}
++
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_hash.h busybox-1.12.1/archival/libipkg/pkg_hash.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_hash.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_hash.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,61 @@
++/* pkg_hash.h - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_HASH_H
++#define PKG_HASH_H
++
++#include "pkg.h"
++#include "pkg_vec.h"
++#include "hash_table.h"
++
++
++int pkg_hash_init(const char *name, hash_table_t *hash, int len);
++void pkg_hash_deinit(hash_table_t *hash);
++void pkg_hash_map(hash_table_t *hash, void (*f)(void *data, void *entry), void *data);
++
++void pkg_hash_dump(hash_table_t *hash, void *data);
++void pkg_hash_fetch_available(hash_table_t *hash, pkg_vec_t *available);
++
++int pkg_hash_add_from_file(ipkg_conf_t *conf, const char *file_name,
++ pkg_src_t *src, pkg_dest_t *dest, int is_status_file);
++pkg_t *hash_insert_pkg(hash_table_t *hash, pkg_t *pkg, int set_status,ipkg_conf_t *conf);
++
++abstract_pkg_t * ensure_abstract_pkg_by_name(hash_table_t * hash, const char * pkg_name);
++abstract_pkg_t * abstract_pkg_fetch_by_name(hash_table_t * hash, const char * pkg_name);
++pkg_vec_t *pkg_hash_fetch_by_name(hash_table_t *hash, const char *pkg_name);
++void pkg_hash_fetch_all_installed(hash_table_t *hash, pkg_vec_t *installed);
++pkg_t * pkg_hash_fetch_by_name_version(hash_table_t *hash,
++ const char *pkg_name,
++ const char * version);
++abstract_pkg_vec_t *pkg_hash_fetch_all_installation_candidates(hash_table_t *hash, const char *name);
++pkg_t *pkg_hash_fetch_best_installation_candidate(ipkg_conf_t *conf, abstract_pkg_t *apkg,
++ int (*constraint_fcn)(pkg_t *pkg, void *data), void *cdata, int quiet);
++pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(ipkg_conf_t *conf, const char *name);
++pkg_t *pkg_hash_fetch_installed_by_name(hash_table_t *hash,
++ const char *pkg_name);
++pkg_t *pkg_hash_fetch_installed_by_name_dest(hash_table_t *hash,
++ const char *pkg_name,
++ pkg_dest_t *dest);
++
++pkg_t *file_hash_get_file_owner(ipkg_conf_t *conf, const char *file_name);
++int file_hash_set_file_owner(ipkg_conf_t *conf, const char *file_name, pkg_t *pkg);
++
++/* XXX: shouldn't this go in pkg_vec.[ch]? */
++pkg_vec_t *pkg_vec_fetch_by_name(hash_table_t *hash, const char *pkg_name);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_parse.c busybox-1.12.1/archival/libipkg/pkg_parse.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_parse.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_parse.c 2008-10-23 15:49:10.000000000 +0200
+@@ -0,0 +1,368 @@
++/* pkg_parse.c - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <errno.h>
++#include <ctype.h>
++
++#include "pkg.h"
++#include "ipkg_utils.h"
++#include "pkg_parse.h"
++
++int alterProvidesLine(char *raw, char *temp);
++
++int isGenericFieldType(char * type, char * line)
++{
++ if(!strncmp(line, type, strlen(type)))
++ return 1;
++ return 0;
++}
++
++char * parseGenericFieldType(char * type, char * raw)
++{
++ char * field_value = raw + (strlen(type) + 1);
++ return trim_alloc(field_value);
++}
++
++void parseStatus(pkg_t *pkg, char * raw)
++{
++ char sw_str[64], sf_str[64], ss_str[64];
++
++ sscanf(raw, "Status: %s %s %s", sw_str, sf_str, ss_str);
++ pkg->state_want = pkg_state_want_from_str(sw_str);
++ pkg->state_flag = pkg_state_flag_from_str(sf_str);
++ pkg->state_status = pkg_state_status_from_str(ss_str);
++}
++
++char ** parseDependsString(char * raw, int * depends_count)
++{
++ char ** depends = NULL;
++ int line_count = 0;
++ char buff[2048], * dest;
++
++ while(raw && *raw && !isspace(*raw)) {
++ raw++;
++ }
++
++ if(line_is_blank(raw)){
++ *depends_count = line_count;
++ return NULL;
++ }
++ while(raw && *raw){
++ depends = (char **)realloc(depends, sizeof(char *) * (line_count + 1));
++
++ while(isspace(*raw)) raw++;
++
++ dest = buff;
++ while((*raw != ',') && *raw)
++ *dest++ = *raw++;
++
++ *dest = '\0';
++ depends[line_count] = trim_alloc(buff);
++ if(depends[line_count] ==NULL)
++ return NULL;
++ line_count++;
++ if(*raw == ',')
++ raw++;
++ }
++ *depends_count = line_count;
++ return depends;
++}
++
++void parseConffiles(pkg_t * pkg, char * raw)
++{
++ char file_name[1048], md5sum[1048]; /* please tell me there aren't any longer that 1k */
++
++ if(!strncmp(raw, "Conffiles:", 10))
++ raw += strlen("Conffiles:");
++
++ while(*raw && (sscanf(raw, "%s%s", file_name, md5sum) == 2)){
++ conffile_list_append(&pkg->conffiles, file_name, md5sum);
++ /* fprintf(stderr, "%s %s ", file_name, md5sum);*/
++ while (*raw && isspace(*raw)) {
++ raw++;
++ }
++ raw += strlen(file_name);
++ while (*raw && isspace(*raw)) {
++ raw++;
++ }
++ raw += strlen(md5sum);
++ }
++}
++
++int parseVersion(pkg_t *pkg, char *raw)
++{
++ char *colon, *eepochcolon;
++#ifdef USE_DEBVERSION
++ char *hyphen;
++#endif
++ unsigned long epoch;
++
++ if (!*raw) {
++ fprintf(stderr, "%s: ERROR: version string is empty", __FUNCTION__);
++ return EINVAL;
++ }
++
++ if (strncmp(raw, "Version:", 8) == 0) {
++ raw += 8;
++ }
++ while (*raw && isspace(*raw)) {
++ raw++;
++ }
++
++ colon= strchr(raw,':');
++ if (colon) {
++ epoch= strtoul(raw,&eepochcolon,10);
++ if (colon != eepochcolon) {
++ fprintf(stderr, "%s: ERROR: epoch in version is not number", __FUNCTION__);
++ return EINVAL;
++ }
++ if (!*++colon) {
++ fprintf(stderr, "%s: ERROR: nothing after colon in version number", __FUNCTION__);
++ return EINVAL;
++ }
++ raw= colon;
++ pkg->epoch= epoch;
++ } else {
++ pkg->epoch= 0;
++ }
++
++ pkg->revision = (char *)"";
++ pkg->familiar_revision = (char *)"";
++
++ pkg->version= malloc(strlen(raw)+1);
++ if ( pkg->version == NULL ) {
++ fprintf(stderr, "%s: out of memory \n", __FUNCTION__);
++ return ENOMEM;
++ }
++ strcpy(pkg->version, raw);
++
++#ifdef USE_DEBVERSION
++ hyphen= strrchr(pkg->version,'-');
++
++ if (hyphen) {
++ *hyphen++= 0;
++ if (strncmp("fam", hyphen, 3) == 0) {
++ pkg->familiar_revision=hyphen+3;
++ hyphen= strrchr(pkg->version,'-');
++ if (hyphen) {
++ *hyphen++= 0;
++ pkg->revision = hyphen;
++ }
++ } else {
++ pkg->revision = hyphen;
++ }
++ }
++#endif
++
++/*
++ fprintf(stderr,"Parsed version: %lu, %s, %s, %s\n",
++ pkg->epoch,
++ pkg->version,
++ pkg->revision,
++ pkg->familiar_revision);
++*/
++
++ return 0;
++}
++
++
++/* This code is needed to insert in first position the keyword for the aligning bug */
++
++int alterProvidesLine(char *raw, char *temp)
++{
++
++
++ if (!*raw) {
++ fprintf(stderr, "%s: ERROR: Provides string is empty", __FUNCTION__);
++ return -EINVAL;
++ }
++
++ if ( temp == NULL ) {
++ fprintf(stderr, "%s: out of memory \n", __FUNCTION__);
++ return -ENOMEM;
++ }
++
++ if (strncmp(raw, "Provides:", 9) == 0) {
++ raw += 9;
++ }
++ while (*raw && isspace(*raw)) {
++ raw++;
++ }
++
++ snprintf ( temp, 35, "Provides: ipkg_internal_use_only, "); /* First part of the line */
++ while (*raw) {
++ strncat( temp, raw++, 1);
++ }
++ return 0;
++
++}
++
++/* Some random thoughts from Carl:
++
++ This function could be considerably simplified if we just kept
++ an array of all the generic string-valued field names, and looped
++ through those looking for a match. Also, these fields could perhaps
++ be stored in the package as an array as well, (or, probably better,
++ as an nv_pair_list_t).
++
++ Fields which require special parsing or storage, (such as Depends:
++ and Status:) could be handled as they are now.
++*/
++/* XXX: FEATURE: The Suggests: field needs to be changed from a string
++ to a dependency list. And, since we already have
++ Depends/Pre-Depends and need to add Conflicts, Recommends, and
++ Enhances, perhaps we could generalize all of these and save some
++ code duplication.
++*/
++int pkg_parse_raw(pkg_t *pkg, char ***raw, pkg_src_t *src, pkg_dest_t *dest)
++{
++ int reading_conffiles, reading_description;
++ int pkg_false_provides=1;
++ char ** lines;
++ char * provide=NULL;
++
++ pkg->src = src;
++ pkg->dest = dest;
++
++ reading_conffiles = reading_description = 0;
++
++ for (lines = *raw; *lines; lines++) {
++ /* fprintf(stderr, "PARSING %s\n", *lines);*/
++ if(isGenericFieldType((char *)"Package:", *lines))
++ pkg->name = parseGenericFieldType((char *)"Package", *lines);
++ else if(isGenericFieldType((char *)"Architecture:", *lines))
++ pkg->architecture = parseGenericFieldType((char *)"Architecture", *lines);
++ else if(isGenericFieldType((char *)"Filename:", *lines))
++ pkg->filename = parseGenericFieldType((char *)"Filename", *lines);
++ else if(isGenericFieldType((char *)"Section:", *lines))
++ pkg->section = parseGenericFieldType((char *)"Section", *lines);
++ else if(isGenericFieldType((char *)"MD5sum:", *lines))
++ pkg->md5sum = parseGenericFieldType((char *)"MD5sum", *lines);
++ /* The old ipkg wrote out status files with the wrong case for MD5sum,
++ let's parse it either way */
++ else if(isGenericFieldType((char *)"MD5Sum:", *lines))
++ pkg->md5sum = parseGenericFieldType((char *)"MD5Sum", *lines);
++ else if(isGenericFieldType((char *)"Size:", *lines))
++ pkg->size = parseGenericFieldType((char *)"Size", *lines);
++ else if(isGenericFieldType((char *)"Source:", *lines))
++ pkg->source = parseGenericFieldType((char *)"Source", *lines);
++ else if(isGenericFieldType((char *)"Installed-Size:", *lines))
++ pkg->installed_size = parseGenericFieldType((char *)"Installed-Size", *lines);
++ else if(isGenericFieldType((char *)"Installed-Time:", *lines)) {
++ char *time_str = parseGenericFieldType((char *)"Installed-Time", *lines);
++ pkg->installed_time = strtoul(time_str, NULL, 0);
++ } else if(isGenericFieldType((char *)"Priority:", *lines))
++ pkg->priority = parseGenericFieldType((char *)"Priority", *lines);
++ else if(isGenericFieldType((char *)"Essential:", *lines)) {
++ char *essential_value;
++ essential_value = parseGenericFieldType((char *)"Essential", *lines);
++ if (strcmp(essential_value, "yes") == 0) {
++ pkg->essential = 1;
++ }
++ free(essential_value);
++ }
++ else if(isGenericFieldType((char *)"Status", *lines))
++ parseStatus(pkg, *lines);
++ else if(isGenericFieldType((char *)"Version", *lines))
++ parseVersion(pkg, *lines);
++ else if(isGenericFieldType((char *)"Maintainer", *lines))
++ pkg->maintainer = parseGenericFieldType((char *)"Maintainer", *lines);
++ else if(isGenericFieldType((char *)"Conffiles", *lines)){
++ parseConffiles(pkg, *lines);
++ reading_conffiles = 1;
++ }
++ else if(isGenericFieldType((char *)"Description", *lines)) {
++ pkg->description = parseGenericFieldType((char *)"Description", *lines);
++ reading_conffiles = 0;
++ reading_description = 1;
++ }
++
++ else if(isGenericFieldType((char *)"Provides", *lines)){
++/* Here we add the internal_use to align the off by one problem between provides_str and provides */
++ provide = (char * ) malloc(strlen(*lines)+ 35 ); /* Preparing the space for the new ipkg_internal_use_only */
++ if ( alterProvidesLine(*lines,provide) ){
++ return EINVAL;
++ }
++ pkg->provides_str = parseDependsString( provide, &pkg->provides_count);
++/* Let's try to hack a bit here.
++ The idea is that if a package has no Provides, we would add one generic, to permit the check of dependencies
++ in alot of other places. We will remove it before writing down the status database */
++ pkg_false_provides=0;
++ free(provide);
++ }
++
++ else if(isGenericFieldType((char *)"Depends", *lines))
++ pkg->depends_str = parseDependsString(*lines, &pkg->depends_count);
++ else if(isGenericFieldType((char *)"Pre-Depends", *lines))
++ pkg->pre_depends_str = parseDependsString(*lines, &pkg->pre_depends_count);
++ else if(isGenericFieldType((char *)"Recommends", *lines))
++ pkg->recommends_str = parseDependsString(*lines, &pkg->recommends_count);
++ else if(isGenericFieldType((char *)"Suggests", *lines))
++ pkg->suggests_str = parseDependsString(*lines, &pkg->suggests_count);
++ /* Abhaya: support for conflicts */
++ else if(isGenericFieldType((char *)"Conflicts", *lines))
++ pkg->conflicts_str = parseDependsString(*lines, &pkg->conflicts_count);
++ else if(isGenericFieldType((char *)"Replaces", *lines))
++ pkg->replaces_str = parseDependsString(*lines, &pkg->replaces_count);
++ else if(line_is_blank(*lines)) {
++ lines++;
++ break;
++ }
++ else if(**lines == ' '){
++ if(reading_description) {
++ /* we already know it's not blank, so the rest of description */
++ pkg->description = realloc(pkg->description,
++ strlen(pkg->description)
++ + 1 + strlen(*lines) + 1);
++ strcat(pkg->description, "\n");
++ strcat(pkg->description, (*lines));
++ }
++ else if(reading_conffiles)
++ parseConffiles(pkg, *lines);
++ }
++ }
++ *raw = lines;
++/* If the ipk has not a Provides line, we insert our false line */
++ if ( pkg_false_provides==1)
++ pkg->provides_str = parseDependsString ((char *)"Provides: ipkg_internal_use_only ", &pkg->provides_count);
++
++ if (pkg->name) {
++ return 0;
++ } else {
++ return EINVAL;
++ }
++}
++
++int pkg_valorize_other_field(pkg_t *pkg, char ***raw)
++{
++ char ** lines;
++
++ for (lines = *raw; *lines; lines++) {
++ if(isGenericFieldType((char *)"Essential:", *lines)) {
++ char *essential_value;
++ essential_value = parseGenericFieldType((char *)"Essential", *lines);
++ if (strcmp(essential_value, "yes") == 0) {
++ pkg->essential = 1;
++ }
++ free(essential_value);
++ }
++ }
++ *raw = lines;
++
++ return 0;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_parse.h busybox-1.12.1/archival/libipkg/pkg_parse.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_parse.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_parse.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,31 @@
++/* pkg_parse.h - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_PARSE_H
++#define PKG_PARSE_H
++
++int isGenericFieldType(char * type, char * line);
++char * parseGenericFieldType(char * type, char * raw);
++void parseStatus(pkg_t *pkg, char * raw);
++int parseVersion(pkg_t *pkg, char *raw);
++char ** parseDependsString(char * raw, int * depends_count);
++int parseVersion(pkg_t *pkg, char *raw);
++void parseConffiles(pkg_t * pkg, char * raw);
++int pkg_parse_raw(pkg_t *pkg, char ***raw, pkg_src_t *src, pkg_dest_t *dest);
++int pkg_valorize_other_field(pkg_t *pkg, char ***raw);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_src.c busybox-1.12.1/archival/libipkg/pkg_src.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_src.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_src.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,43 @@
++/* pkg_src.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "pkg_src.h"
++#include "str_util.h"
++
++int pkg_src_init(pkg_src_t *src, const char *name, const char *base_url, const char *extra_data, int gzip)
++{
++ src->gzip = gzip;
++ src->name = str_dup_safe (name);
++ src->value = str_dup_safe (base_url);
++ if (extra_data)
++ src->extra_data = str_dup_safe (extra_data);
++ else
++ src->extra_data = NULL;
++ return 0;
++}
++
++void pkg_src_deinit(pkg_src_t *src)
++{
++ free (src->name);
++ free (src->value);
++ if (src->extra_data)
++ free (src->extra_data);
++}
++
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_src.h busybox-1.12.1/archival/libipkg/pkg_src.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_src.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_src.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,34 @@
++/* pkg_src.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_SRC_H
++#define PKG_SRC_H
++
++#include "nv_pair.h"
++
++typedef struct
++{
++ char *name;
++ char *value;
++ char *extra_data;
++ int gzip;
++} pkg_src_t;
++
++int pkg_src_init(pkg_src_t *src, const char *name, const char *base_url, const char *extra_data, int gzip);
++void pkg_src_deinit(pkg_src_t *src);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_src_list.c busybox-1.12.1/archival/libipkg/pkg_src_list.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_src_list.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_src_list.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,75 @@
++/* pkg_src_list.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "pkg_src_list.h"
++#include "void_list.h"
++
++int pkg_src_list_init(pkg_src_list_t *list)
++{
++ return void_list_init((void_list_t *) list);
++}
++
++void pkg_src_list_deinit(pkg_src_list_t *list)
++{
++ pkg_src_list_elt_t *iter;
++ pkg_src_t *pkg_src;
++
++ for (iter = list->head; iter; iter = iter->next) {
++ pkg_src = iter->data;
++ pkg_src_deinit(pkg_src);
++
++ /* malloced in pkg_src_list_append */
++ free(pkg_src);
++ iter->data = NULL;
++ }
++ void_list_deinit((void_list_t *) list);
++}
++
++pkg_src_t *pkg_src_list_append(pkg_src_list_t *list,
++ const char *name, const char *base_url, const char *extra_data,
++ int gzip)
++{
++ int err;
++
++ /* freed in pkg_src_list_deinit */
++ pkg_src_t *pkg_src = malloc(sizeof(pkg_src_t));
++
++ if (pkg_src == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ pkg_src_init(pkg_src, name, base_url, extra_data, gzip);
++
++ err = void_list_append((void_list_t *) list, pkg_src);
++ if (err) {
++ return NULL;
++ }
++
++ return pkg_src;
++}
++
++int pkg_src_list_push(pkg_src_list_t *list, pkg_src_t *data)
++{
++ return void_list_push((void_list_t *) list, data);
++}
++
++pkg_src_list_elt_t *pkg_src_list_pop(pkg_src_list_t *list)
++{
++ return (pkg_src_list_elt_t *) void_list_pop((void_list_t *) list);
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_src_list.h busybox-1.12.1/archival/libipkg/pkg_src_list.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_src_list.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_src_list.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,57 @@
++/* pkg_src_list.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_SRC_LIST_H
++#define PKG_SRC_LIST_H
++
++#include "pkg_src.h"
++
++typedef struct pkg_src_list_elt pkg_src_list_elt_t;
++struct pkg_src_list_elt
++{
++ pkg_src_list_elt_t *next;
++ pkg_src_t *data;
++};
++
++typedef struct pkg_src_list pkg_src_list_t;
++struct pkg_src_list
++{
++ pkg_src_list_elt_t pre_head;
++ pkg_src_list_elt_t *head;
++ pkg_src_list_elt_t *tail;
++};
++
++static inline int pkg_src_list_empty(pkg_src_list_t *list)
++{
++ if (list->head == NULL)
++ return 1;
++ else
++ return 0;
++}
++
++int pkg_src_list_elt_init(pkg_src_list_elt_t *elt, nv_pair_t *data);
++void pkg_src_list_elt_deinit(pkg_src_list_elt_t *elt);
++
++int pkg_src_list_init(pkg_src_list_t *list);
++void pkg_src_list_deinit(pkg_src_list_t *list);
++
++pkg_src_t *pkg_src_list_append(pkg_src_list_t *list, const char *name, const char *root_dir, const char *extra_data, int gzip);
++int pkg_src_list_push(pkg_src_list_t *list, pkg_src_t *data);
++pkg_src_list_elt_t *pkg_src_list_pop(pkg_src_list_t *list);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_vec.c busybox-1.12.1/archival/libipkg/pkg_vec.c
+--- busybox-1.12.1.orig/archival/libipkg/pkg_vec.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_vec.c 2008-10-23 13:09:31.000000000 +0200
+@@ -0,0 +1,231 @@
++/* pkg_vec.c - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include <stdlib.h>
++#include <fnmatch.h>
++#include "libbb.h"
++#include "xregex.h"
++#include "ipkg.h"
++#include "pkg.h"
++
++pkg_vec_t * pkg_vec_alloc(void)
++{
++ pkg_vec_t * vec = (pkg_vec_t *)malloc(sizeof(pkg_vec_t));
++ if (!vec) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ vec->pkgs = NULL;
++ vec->len = 0;
++
++ return vec;
++}
++
++void pkg_vec_free(pkg_vec_t *vec)
++{
++ free(vec->pkgs);
++ free(vec);
++}
++
++/*
++ * assumption: all names in a vector are identical
++ * assumption: all version strings are trimmed,
++ * so identical versions have identical version strings,
++ * implying identical packages; let's marry these
++ */
++pkg_t *pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status,ipkg_conf_t *conf)
++{
++ int i;
++ int found = 0;
++
++ /* look for a duplicate pkg by name, version, and architecture */
++ for (i = 0; i < vec->len; i++){
++ ipkg_message(conf, IPKG_DEBUG2, "Function: %s. Found pkg=%s version=%s arch=%s cmp=%s version=%s arch=%s \n",
++ __FUNCTION__, pkg->name, pkg->version, pkg->architecture,
++ vec->pkgs[i]->name, vec->pkgs[i]->version,vec->pkgs[i]->architecture );
++ if ((strcmp(pkg->name, vec->pkgs[i]->name) == 0)
++ && (pkg_compare_versions(pkg, vec->pkgs[i]) == 0)
++ && (strcmp(pkg->architecture, vec->pkgs[i]->architecture) == 0)) {
++ found = 1;
++ ipkg_message(conf, IPKG_DEBUG2, "Function: %s. Found duplicate for pkg=%s version=%s arch=%s\n",
++ __FUNCTION__, pkg->name, pkg->version, pkg->architecture);
++ break;
++ }
++ }
++
++ /* we didn't find one, add it */
++ if (!found){
++ ipkg_message(conf, IPKG_DEBUG2, "Function: %s. Adding new pkg=%s version=%s arch=%s\n",
++ __FUNCTION__, pkg->name, pkg->version, pkg->architecture);
++
++ vec->pkgs = (pkg_t **)realloc(vec->pkgs, (vec->len + 1) * sizeof(pkg_t *));
++ vec->pkgs[vec->len] = pkg;
++ vec->len++;
++ return pkg;
++ }
++ /* update the one that we have */
++ else {
++ ipkg_message(conf, IPKG_DEBUG2, "Function: %s. calling pkg_merge for pkg=%s version=%s arch=%s",
++ __FUNCTION__, pkg->name, pkg->version, pkg->architecture);
++ if (set_status) {
++ /* this is from the status file, so need to merge with existing database */
++ ipkg_message(conf, IPKG_DEBUG2, " with set_status\n");
++ pkg_merge(vec->pkgs[i], pkg, set_status);
++ /* XXX: CLEANUP: It's not so polite to free something here
++ that was passed in from above. */
++ pkg_deinit(pkg);
++ free(pkg);
++ } else {
++ ipkg_message(conf, IPKG_DEBUG2, " WITHOUT set_status\n");
++ /* just overwrite the old one */
++ pkg_deinit(vec->pkgs[i]);
++ free(vec->pkgs[i]);
++ vec->pkgs[i] = pkg;
++ }
++ return vec->pkgs[i];
++ }
++}
++
++void pkg_vec_insert(pkg_vec_t *vec, const pkg_t *pkg)
++{
++ int i;
++ int found = 0;
++
++ /* look for a duplicate pkg by name, version, and architecture */
++ for (i = 0; i < vec->len; i++)
++ if ((strcmp(pkg->name, vec->pkgs[i]->name) == 0)
++ && (pkg_compare_versions(pkg, vec->pkgs[i]) == 0)
++ && (strcmp(pkg->architecture, vec->pkgs[i]->name) == 0)) {
++ found = 1;
++ break;
++ }
++
++ /* we didn't find one, add it */
++ if(!found){
++ vec->pkgs = (pkg_t **)realloc(vec->pkgs, (vec->len + 1) * sizeof(pkg_t *));
++ *(const pkg_t **)&vec->pkgs[vec->len] = pkg;
++ vec->len++;
++ }
++}
++
++int pkg_vec_contains(pkg_vec_t *vec, pkg_t *apkg)
++{
++ int i;
++ for (i = 0; i < vec->len; i++)
++ if (vec->pkgs[i] == apkg)
++ return 1;
++ return 0;
++}
++
++typedef int (*compare_fcn_t)(const void *, const void *);
++void pkg_vec_sort(pkg_vec_t *vec, int (*compar)(pkg_t *, pkg_t *))
++{
++ qsort(vec->pkgs, vec->len, sizeof(pkg_t *), (compare_fcn_t)compar);
++}
++
++int pkg_vec_clear_marks(pkg_vec_t *vec)
++{
++ int npkgs = vec->len;
++ int i;
++ for (i = 0; i < npkgs; i++) {
++ pkg_t *pkg = vec->pkgs[i];
++ pkg->state_flag &= ~SF_MARKED;
++ }
++ return 0;
++}
++
++int pkg_vec_mark_if_matches(pkg_vec_t *vec, const char *pattern)
++{
++ int matching_count = 0;
++ pkg_t **pkgs = vec->pkgs;
++ int npkgs = vec->len;
++ int i;
++ for (i = 0; i < npkgs; i++) {
++ pkg_t *pkg = pkgs[i];
++ if (fnmatch(pattern, pkg->name, 0)==0) {
++ pkg->state_flag |= SF_MARKED;
++ matching_count++;
++ }
++ }
++ return matching_count;
++}
++
++
++abstract_pkg_vec_t * abstract_pkg_vec_alloc(void)
++{
++ abstract_pkg_vec_t * vec ;
++ vec = (abstract_pkg_vec_t *)malloc(sizeof(abstract_pkg_vec_t));
++ if (!vec) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return NULL;
++ }
++ vec->pkgs = NULL;
++ vec->len = 0;
++
++ return vec;
++}
++
++void abstract_pkg_vec_free(abstract_pkg_vec_t *vec)
++{
++ free(vec->pkgs);
++ free(vec);
++}
++
++/*
++ * assumption: all names in a vector are unique
++ */
++void abstract_pkg_vec_insert(abstract_pkg_vec_t *vec, abstract_pkg_t *pkg)
++{
++ int i;
++
++ /* look for a duplicate pkg by name */
++ for(i = 0; i < vec->len; i++)
++ if (strcmp(pkg->name, vec->pkgs[i]->name) == 0)
++ break;
++
++ /* we didn't find one, add it */
++ if(i == vec->len){
++ vec->pkgs =
++ (abstract_pkg_t **)
++ realloc(vec->pkgs, (vec->len + 1) * sizeof(abstract_pkg_t *));
++ vec->pkgs[vec->len] = pkg;
++ vec->len++;
++ }
++}
++
++abstract_pkg_t * abstract_pkg_vec_get(abstract_pkg_vec_t *vec, int i)
++{
++ if (vec->len > i)
++ return vec->pkgs[i];
++ else
++ return NULL;
++}
++
++int abstract_pkg_vec_contains(abstract_pkg_vec_t *vec, abstract_pkg_t *apkg)
++{
++ int i;
++ for (i = 0; i < vec->len; i++)
++ if (vec->pkgs[i] == apkg)
++ return 1;
++ return 0;
++}
++
++void abstract_pkg_vec_sort(pkg_vec_t *vec, int (*compar)(abstract_pkg_t *, abstract_pkg_t *))
++{
++ qsort(vec->pkgs, vec->len, sizeof(pkg_t *), (compare_fcn_t)compar);
++}
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/pkg_vec.h busybox-1.12.1/archival/libipkg/pkg_vec.h
+--- busybox-1.12.1.orig/archival/libipkg/pkg_vec.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/pkg_vec.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,62 @@
++/* pkg_vec.h - the itsy package management system
++
++ Steven M. Ayer
++
++ Copyright (C) 2002 Compaq Computer Corporation
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef PKG_VEC_H
++#define PKG_VEC_H
++
++typedef struct pkg pkg_t;
++typedef struct abstract_pkg abstract_pkg_t;
++
++struct pkg_vec
++{
++ pkg_t **pkgs;
++ int len;
++};
++typedef struct pkg_vec pkg_vec_t;
++
++struct abstract_pkg_vec
++{
++ abstract_pkg_t **pkgs;
++ int len;
++};
++typedef struct abstract_pkg_vec abstract_pkg_vec_t;
++
++
++pkg_vec_t * pkg_vec_alloc(void);
++void pkg_vec_free(pkg_vec_t *vec);
++void marry_two_packages(pkg_t * newpkg, pkg_t * oldpkg);
++
++void pkg_vec_add(pkg_vec_t *vec, pkg_t *pkg);
++/* pkg_vec_insert_merge: might munge pkg.
++* returns the pkg that is in the pkg graph */
++pkg_t *pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status, ipkg_conf_t *conf);
++/* this one never munges pkg */
++void pkg_vec_insert(pkg_vec_t *vec, const pkg_t *pkg);
++int pkg_vec_contains(pkg_vec_t *vec, pkg_t *apkg);
++void pkg_vec_sort(pkg_vec_t *vec, int (*compar)(pkg_t *, pkg_t *));
++
++int pkg_vec_clear_marks(pkg_vec_t *vec);
++int pkg_vec_mark_if_matches(pkg_vec_t *vec, const char *pattern);
++
++abstract_pkg_vec_t * abstract_pkg_vec_alloc(void);
++void abstract_pkg_vec_free(abstract_pkg_vec_t *vec);
++void abstract_pkg_vec_insert(abstract_pkg_vec_t *vec, abstract_pkg_t *pkg);
++abstract_pkg_t * abstract_pkg_vec_get(abstract_pkg_vec_t *vec, int i);
++int abstract_pkg_vec_contains(abstract_pkg_vec_t *vec, abstract_pkg_t *apkg);
++void abstract_pkg_vec_sort(pkg_vec_t *vec, int (*compar)(abstract_pkg_t *, abstract_pkg_t *));
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/sprintf_alloc.h busybox-1.12.1/archival/libipkg/sprintf_alloc.h
+--- busybox-1.12.1.orig/archival/libipkg/sprintf_alloc.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/sprintf_alloc.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,25 @@
++/* sprintf_alloca.c -- like sprintf with memory allocation
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++*/
++
++#ifndef SPRINTF_ALLOC_H
++#define SPRINTF_ALLOC_H
++
++#include "libbb.h"
++
++#define sprintf_alloc(str, fmt, args...) *str = xasprintf(fmt, ## args)
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/str_list.c busybox-1.12.1/archival/libipkg/str_list.c
+--- busybox-1.12.1.orig/archival/libipkg/str_list.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/str_list.c 2008-10-23 15:53:09.000000000 +0200
+@@ -0,0 +1,76 @@
++/* str_list.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++#include "str_list.h"
++
++int str_list_elt_init(str_list_elt_t *elt, char *data)
++{
++ return void_list_elt_init((void_list_elt_t *) elt, data);
++}
++
++void str_list_elt_deinit(str_list_elt_t *elt)
++{
++ void_list_elt_deinit((void_list_elt_t *) elt);
++}
++
++str_list_t *str_list_alloc(void)
++{
++ str_list_t *list = (str_list_t *)malloc(sizeof(str_list_t));
++ if (list)
++ str_list_init(list);
++ return list;
++}
++
++int str_list_init(str_list_t *list)
++{
++ return void_list_init((void_list_t *) list);
++}
++
++void str_list_deinit(str_list_t *list)
++{
++ void_list_deinit((void_list_t *) list);
++}
++
++int str_list_append(str_list_t *list, char *data)
++{
++ return void_list_append((void_list_t *) list, data);
++}
++
++int str_list_push(str_list_t *list, char *data)
++{
++ return void_list_push((void_list_t *) list, data);
++}
++
++str_list_elt_t *str_list_pop(str_list_t *list)
++{
++ return (str_list_elt_t *) void_list_pop((void_list_t *) list);
++}
++
++str_list_elt_t *str_list_remove(str_list_t *list, str_list_elt_t **iter)
++{
++ return (str_list_elt_t *) void_list_remove((void_list_t *) list,
++ (void_list_elt_t **) iter);
++}
++
++char *str_list_remove_elt(str_list_t *list, const char *target_str)
++{
++ return (char *)void_list_remove_elt((void_list_t *) list,
++ (void *)target_str,
++ (void_list_cmp_t)strcmp);
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/str_list.h busybox-1.12.1/archival/libipkg/str_list.h
+--- busybox-1.12.1.orig/archival/libipkg/str_list.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/str_list.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,51 @@
++/* str_list.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef STR_LIST_H
++#define STR_LIST_H
++
++#include "void_list.h"
++
++typedef struct str_list_elt str_list_elt_t;
++struct str_list_elt
++{
++ str_list_elt_t *next;
++ char *data;
++};
++
++typedef struct xstr_list str_list_t;
++struct xstr_list
++{
++ str_list_elt_t pre_head;
++ str_list_elt_t *head;
++ str_list_elt_t *tail;
++};
++
++int str_list_elt_init(str_list_elt_t *elt, char *data);
++void str_list_elt_deinit(str_list_elt_t *elt);
++
++str_list_t *str_list_alloc(void);
++int str_list_init(str_list_t *list);
++void str_list_deinit(str_list_t *list);
++
++int str_list_append(str_list_t *list, char *data);
++int str_list_push(str_list_t *list, char *data);
++str_list_elt_t *str_list_pop(str_list_t *list);
++str_list_elt_t *str_list_remove(str_list_t *list, str_list_elt_t **iter);
++char *str_list_remove_elt(str_list_t *list, const char *target_str);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/str_util.c busybox-1.12.1/archival/libipkg/str_util.c
+--- busybox-1.12.1.orig/archival/libipkg/str_util.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/str_util.c 2008-10-23 16:01:50.000000000 +0200
+@@ -0,0 +1,69 @@
++/* str_utils.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++
++int str_starts_with(const char *str, const char *prefix);
++int str_ends_with(const char *str, const char *suffix);
++int str_chomp(char *str);
++int str_toupper(char *str);
++char *str_dup_safe(const char *str);
++
++int str_starts_with(const char *str, const char *prefix)
++{
++ return (strncmp(str, prefix, strlen(prefix)) == 0);
++}
++
++int str_ends_with(const char *str, const char *suffix)
++{
++ int suffix_len;
++ int str_len;
++
++ str_len = strlen(str);
++ suffix_len = strlen(suffix);
++
++ if (str_len < suffix_len) {
++ return 0;
++ }
++
++ return (strcmp(str + str_len - suffix_len, suffix) == 0);
++}
++
++int str_chomp(char *str)
++{
++ if (str[strlen(str) - 1] == '\n') {
++ str[strlen(str) - 1] = '\0';
++ return 1;
++ }
++ return 0;
++}
++
++int str_toupper(char *str)
++{
++ while (*str) {
++ *str = toupper(*str);
++ str++;
++ }
++
++ return 0;
++}
++
++char *str_dup_safe(const char *str)
++{
++ return str ? strdup(str) : NULL;
++}
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/str_util.h busybox-1.12.1/archival/libipkg/str_util.h
+--- busybox-1.12.1.orig/archival/libipkg/str_util.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/str_util.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,27 @@
++/* str_utils.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef STR_UTILS_H
++#define STR_UTILS_H
++
++int str_starts_with(const char *str, const char *prefix);
++int str_ends_with(const char *str, const char *suffix);
++int str_chomp(char *str);
++int str_toupper(char *str);
++char *str_dup_safe(const char *str);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/user.c busybox-1.12.1/archival/libipkg/user.c
+--- busybox-1.12.1.orig/archival/libipkg/user.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/user.c 2008-10-23 16:02:33.000000000 +0200
+@@ -0,0 +1,61 @@
++/* user.c - the itsy package management system
++
++ Jamey Hicks
++
++ Copyright (C) 2002 Hewlett Packard Company
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include <stdio.h>
++#include <stdarg.h>
++#include "libbb.h"
++#include "file_util.h"
++#include "str_util.h"
++#ifdef IPKG_LIB
++#include "libipkg.h"
++#endif
++
++char *get_user_response(const char *format, ...);
++
++
++#ifdef IPKG_LIB
++static char *question = NULL;
++static int question_len = 255;
++#endif
++char *get_user_response(const char *format, ...)
++{
++ int len = question_len;
++ va_list ap;
++ char *response;
++ va_start(ap, format);
++
++#ifndef IPKG_LIB
++ vprintf(format, ap);
++ do {
++ response = file_read_line_alloc(stdin);
++ } while (response == NULL);
++#else
++ do {
++ if (question == NULL || len > question_len) {
++ question = realloc(question, len + 1);
++ question_len = len;
++ }
++ len = vsnprintf(question,question_len,format,ap);
++ } while (len > question_len);
++ response = strdup(ipkg_cb_response(question));
++#endif
++ str_chomp(response);
++ str_tolower(response);
++
++ return response;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/user.h busybox-1.12.1/archival/libipkg/user.h
+--- busybox-1.12.1.orig/archival/libipkg/user.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/user.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,23 @@
++/* user.c - the itsy package management system
++
++ Jamey Hicks
++
++ Copyright (C) 2002 Hewlett Packard Company
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include <stdio.h>
++#include <stdarg.h>
++
++char *get_user_response(const char *format, ...);
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/void_list.c busybox-1.12.1/archival/libipkg/void_list.c
+--- busybox-1.12.1.orig/archival/libipkg/void_list.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/void_list.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,194 @@
++/* void_list.c - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <errno.h>
++
++#include "void_list.h"
++
++int void_list_elt_init(void_list_elt_t *elt, void *data)
++{
++ elt->next = NULL;
++ elt->data = data;
++
++ return 0;
++}
++
++void void_list_elt_deinit(void_list_elt_t *elt)
++{
++ void_list_elt_init(elt, NULL);
++}
++
++int void_list_init(void_list_t *list)
++{
++ void_list_elt_init(&list->pre_head, NULL);
++ list->head = NULL;
++ list->pre_head.next = list->head;
++ list->tail = NULL;
++
++ return 0;
++}
++
++void void_list_deinit(void_list_t *list)
++{
++ void_list_elt_t *elt;
++
++ while (list->head) {
++ elt = void_list_pop(list);
++ void_list_elt_deinit(elt);
++ /* malloced in void_list_append */
++ free(elt);
++ }
++}
++
++int void_list_append(void_list_t *list, void *data)
++{
++ void_list_elt_t *elt;
++
++ /* freed in void_list_deinit */
++ elt = malloc(sizeof(void_list_elt_t));
++ if (elt == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return ENOMEM;
++ }
++
++ void_list_elt_init(elt, data);
++
++ if (list->tail) {
++ list->tail->next = elt;
++ list->tail = elt;
++ } else {
++ list->head = elt;
++ list->pre_head.next = list->head;
++ list->tail = elt;
++ }
++
++ return 0;
++}
++
++int void_list_push(void_list_t *list, void *data)
++{
++ void_list_elt_t *elt;
++
++ elt = malloc(sizeof(void_list_elt_t));
++ if (elt == NULL) {
++ fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
++ return ENOMEM;
++ }
++
++ void_list_elt_init(elt, data);
++
++ elt->next = list->head;
++ list->head->next = elt;
++ if (list->tail == NULL) {
++ list->tail = list->head;
++ }
++
++ return 0;
++}
++
++void_list_elt_t *void_list_pop(void_list_t *list)
++{
++ void_list_elt_t *elt;
++
++ elt = list->head;
++
++ if (list->head) {
++ list->head = list->head->next;
++ list->pre_head.next = list->head;
++ if (list->head == NULL) {
++ list->tail = NULL;
++ }
++ }
++
++ return elt;
++}
++
++void *void_list_remove(void_list_t *list, void_list_elt_t **iter)
++{
++ void_list_elt_t *prior;
++ void_list_elt_t *old_elt;
++ void *old_data;
++
++ old_elt = *iter;
++ old_data = old_elt->data;
++
++ if (old_elt == list->head) {
++ prior = &list->pre_head;
++ void_list_pop(list);
++ } else {
++ for (prior = list->head; prior; prior = prior->next) {
++ if (prior->next == old_elt) {
++ break;
++ }
++ }
++ if (prior == NULL || prior->next != old_elt) {
++ fprintf(stderr, "%s: ERROR: element not found in list\n", __FUNCTION__);
++ return NULL;
++ }
++ prior->next = old_elt->next;
++
++ if (old_elt == list->tail) {
++ list->tail = prior;
++ }
++ }
++
++ void_list_elt_deinit(old_elt);
++ *iter = prior;
++
++ return old_data;
++}
++
++/* remove element containing elt data, using cmp(elt->data, target_data) == 0. */
++void *void_list_remove_elt(void_list_t *list, const void *target_data, void_list_cmp_t cmp)
++{
++ void_list_elt_t *prior;
++ void_list_elt_t *old_elt = NULL;
++ void *old_data = NULL;
++
++ /* first element */
++ if (list->head && list->head->data && (cmp(list->head->data, target_data) == 0)) {
++ old_elt = list->head;
++ old_data = list->head->data;
++ void_list_pop(list);
++ } else {
++ int found = 0;
++ for (prior = list->head; prior && prior->next; prior = prior->next) {
++ if (prior->next->data && (cmp(prior->next->data, target_data) == 0)) {
++ old_elt = prior->next;
++ old_data = old_elt->data;
++ found = 1;
++ break;
++ }
++ }
++ if (!found) {
++ return NULL;
++ }
++ prior->next = old_elt->next;
++
++ if (old_elt == list->tail) {
++ list->tail = prior;
++ }
++ }
++ if (old_elt)
++ void_list_elt_deinit(old_elt);
++
++ if (old_data)
++ return old_data;
++ else
++ return NULL;
++}
+diff -Nur busybox-1.12.1.orig/archival/libipkg/void_list.h busybox-1.12.1/archival/libipkg/void_list.h
+--- busybox-1.12.1.orig/archival/libipkg/void_list.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/void_list.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,59 @@
++/* void_list.h - the itsy package management system
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef VOID_LIST_H
++#define VOID_LIST_H
++
++typedef struct void_list_elt void_list_elt_t;
++struct void_list_elt
++{
++ void_list_elt_t *next;
++ void *data;
++};
++
++typedef struct void_list void_list_t;
++struct void_list
++{
++ void_list_elt_t pre_head;
++ void_list_elt_t *head;
++ void_list_elt_t *tail;
++};
++
++static inline int void_list_empty(void_list_t *list)
++{
++ if (list->head == NULL)
++ return 1;
++ else
++ return 0;
++}
++
++int void_list_elt_init(void_list_elt_t *elt, void *data);
++void void_list_elt_deinit(void_list_elt_t *elt);
++
++int void_list_init(void_list_t *list);
++void void_list_deinit(void_list_t *list);
++
++int void_list_append(void_list_t *list, void *data);
++int void_list_push(void_list_t *list, void *data);
++void_list_elt_t *void_list_pop(void_list_t *list);
++
++void *void_list_remove(void_list_t *list, void_list_elt_t **iter);
++/* remove element containing elt data, using cmp(elt->data, target_data) == 0. */
++typedef int (*void_list_cmp_t)(const void *, const void *);
++void *void_list_remove_elt(void_list_t *list, const void *target_data, void_list_cmp_t cmp);
++
++#endif
+diff -Nur busybox-1.12.1.orig/archival/libipkg/xsystem.c busybox-1.12.1/archival/libipkg/xsystem.c
+--- busybox-1.12.1.orig/archival/libipkg/xsystem.c 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/xsystem.c 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,64 @@
++/* xsystem.c - system(3) with error messages
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#include "ipkg.h"
++#include <sys/wait.h>
++
++#include "xsystem.h"
++
++/* XXX: FEATURE: I shouldn't actually use system(3) at all. I don't
++ really need the /bin/sh invocation which takes resources and
++ introduces security problems. I should switch all of this to a sort
++ of execl() or execv() interface/implementation.
++*/
++
++/* Like system(3), but with error messages printed if the fork fails
++ or if the child process dies due to an uncaught signal. Also, the
++ return value is a bit simpler:
++
++ -1 if there was any problem
++ Otherwise, the 8-bit return value of the program ala WEXITSTATUS
++ as defined in <sys/wait.h>.
++*/
++int xsystem(const char *cmd)
++{
++ int err;
++
++ err = system(cmd);
++
++ if (err == -1) {
++ fprintf(stderr, "%s: ERROR: fork failed before execution: `%s'\n",
++ __FUNCTION__, cmd);
++ return -1;
++ }
++
++ if (WIFSIGNALED(err)) {
++ fprintf(stderr, "%s: ERROR: Child process died due to signal %d: `%s'\n",
++ __FUNCTION__, WTERMSIG(err), cmd);
++ return -1;
++ }
++
++ if (WIFEXITED(err)) {
++ /* Normal child exit */
++ return WEXITSTATUS(err);
++ }
++
++ fprintf(stderr, "%s: ERROR: Received unintelligible return value from system: %d",
++ __FUNCTION__, err);
++ return -1;
++}
++
+diff -Nur busybox-1.12.1.orig/archival/libipkg/xsystem.h busybox-1.12.1/archival/libipkg/xsystem.h
+--- busybox-1.12.1.orig/archival/libipkg/xsystem.h 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.12.1/archival/libipkg/xsystem.h 2008-10-23 11:41:37.000000000 +0200
+@@ -0,0 +1,34 @@
++/* xsystem.h - system(3) with error messages
++
++ Carl D. Worth
++
++ Copyright (C) 2001 University of Southern California
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of the GNU General Public License as
++ published by the Free Software Foundation; either version 2, or (at
++ your option) any later version.
++
++ This program is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++*/
++
++#ifndef XSYSTEM_H
++#define XSYSTEM_H
++
++#include <stdlib.h>
++
++/* Like system(3), but with error messages printed if the fork fails
++ or if the child process dies due to an uncaught signal. Also, the
++ return value is a bit simpler:
++
++ -1 if there was any problem
++ Otherwise, the 8-bit return value of the program ala WEXITSTATUS
++ as defined in <sys/wait.h>.
++*/
++int xsystem(const char *cmd);
++
++#endif
++
+diff -Nur busybox-1.12.1.orig/archival/libunarchive/data_extract_all.c busybox-1.12.1/archival/libunarchive/data_extract_all.c
+--- busybox-1.12.1.orig/archival/libunarchive/data_extract_all.c 2008-09-28 20:04:15.000000000 +0200
++++ busybox-1.12.1/archival/libunarchive/data_extract_all.c 2008-10-23 11:53:34.000000000 +0200
+@@ -144,3 +144,16 @@
+ }
+ }
+ }
++
++extern void FAST_FUNC data_extract_all_prefix(archive_handle_t *archive_handle)
++{
++ char *name_ptr = archive_handle->file_header->name;
++
++ name_ptr += strspn(name_ptr, "./");
++ if (name_ptr[0] != '\0') {
++ archive_handle->file_header->name = xmalloc(strlen(archive_handle->buffer) + 1 + strlen(name_ptr) + 1);
++ strcpy(archive_handle->file_header->name, archive_handle->buffer);
++ strcat(archive_handle->file_header->name, name_ptr);
++ data_extract_all(archive_handle);
++ }
++}
+diff -Nur busybox-1.12.1.orig/archival/libunarchive/Kbuild busybox-1.12.1/archival/libunarchive/Kbuild
+--- busybox-1.12.1.orig/archival/libunarchive/Kbuild 2008-09-28 20:04:15.000000000 +0200
++++ busybox-1.12.1/archival/libunarchive/Kbuild 2008-10-23 16:28:14.000000000 +0200
+@@ -39,6 +39,7 @@
+ lib-$(CONFIG_DPKG) += $(DPKG_FILES)
+ lib-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
+ lib-$(CONFIG_GUNZIP) += decompress_unzip.o
++lib-$(CONFIG_IPKG) += open_transformer.o get_header_tar.o get_header_tar_gz.o
+ lib-$(CONFIG_RPM2CPIO) += decompress_unzip.o get_header_cpio.o
+ lib-$(CONFIG_RPM) += open_transformer.o decompress_unzip.o get_header_cpio.o
+ lib-$(CONFIG_TAR) += get_header_tar.o
+diff -Nur busybox-1.12.1.orig/coreutils/md5_sha1_sum.c busybox-1.12.1/coreutils/md5_sha1_sum.c
+--- busybox-1.12.1.orig/coreutils/md5_sha1_sum.c 2008-09-28 20:04:18.000000000 +0200
++++ busybox-1.12.1/coreutils/md5_sha1_sum.c 2008-10-23 11:41:37.000000000 +0200
+@@ -8,14 +8,12 @@
+
+ #include "libbb.h"
+
+-typedef enum { HASH_SHA1, HASH_MD5 } hash_algo_t;
+-
+ #define FLAG_SILENT 1
+ #define FLAG_CHECK 2
+ #define FLAG_WARN 4
+
+ /* This might be useful elsewhere */
+-static unsigned char *hash_bin_to_hex(unsigned char *hash_value,
++unsigned char *hash_bin_to_hex(unsigned char *hash_value,
+ unsigned hash_length)
+ {
+ /* xzalloc zero-terminates */
+@@ -24,7 +22,7 @@
+ return (unsigned char *)hex_value;
+ }
+
+-static uint8_t *hash_file(const char *filename, hash_algo_t hash_algo)
++uint8_t *hash_file(const char *filename, hash_algo_t hash_algo)
+ {
+ int src_fd, hash_len, count;
+ union _ctx_ {
+diff -Nur busybox-1.12.1.orig/include/applets.h busybox-1.12.1/include/applets.h
+--- busybox-1.12.1.orig/include/applets.h 2008-09-28 20:04:26.000000000 +0200
++++ busybox-1.12.1/include/applets.h 2008-10-23 11:41:37.000000000 +0200
+@@ -202,6 +202,7 @@
+ USE_IPCALC(APPLET(ipcalc, _BB_DIR_BIN, _BB_SUID_NEVER))
+ USE_IPCRM(APPLET(ipcrm, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
+ USE_IPCS(APPLET(ipcs, _BB_DIR_USR_BIN, _BB_SUID_ALWAYS))
++USE_IPKG(APPLET(ipkg, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+ USE_IPLINK(APPLET(iplink, _BB_DIR_BIN, _BB_SUID_NEVER))
+ USE_IPROUTE(APPLET(iproute, _BB_DIR_BIN, _BB_SUID_NEVER))
+ USE_IPRULE(APPLET(iprule, _BB_DIR_BIN, _BB_SUID_NEVER))
+diff -Nur busybox-1.12.1.orig/include/libbb.h busybox-1.12.1/include/libbb.h
+--- busybox-1.12.1.orig/include/libbb.h 2008-09-28 20:04:26.000000000 +0200
++++ busybox-1.12.1/include/libbb.h 2008-10-23 11:47:15.000000000 +0200
+@@ -1264,6 +1264,7 @@
+ extern const char bb_uuenc_tbl_std[];
+ void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC;
+
++typedef enum { HASH_SHA1, HASH_MD5 } hash_algo_t;
+ typedef struct sha1_ctx_t {
+ uint32_t count[2];
+ uint32_t hash[5];
+@@ -1272,6 +1273,8 @@
+ void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC;
+ void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC;
+ void *sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC;
++unsigned char *hash_bin_to_hex(unsigned char *hash_value, unsigned hash_length);
++uint8_t *hash_file(const char *filename, hash_algo_t hash_algo);
+
+ typedef struct md5_ctx_t {
+ uint32_t A;
+diff -Nur busybox-1.12.1.orig/include/unarchive.h busybox-1.12.1/include/unarchive.h
+--- busybox-1.12.1.orig/include/unarchive.h 2008-09-28 20:04:26.000000000 +0200
++++ busybox-1.12.1/include/unarchive.h 2008-10-23 11:48:04.000000000 +0200
+@@ -88,6 +88,7 @@
+
+ extern void data_skip(archive_handle_t *archive_handle) FAST_FUNC;
+ extern void data_extract_all(archive_handle_t *archive_handle) FAST_FUNC;
++extern void data_extract_all_prefix(archive_handle_t *archive_handle) FAST_FUNC;
+ extern void data_extract_to_stdout(archive_handle_t *archive_handle) FAST_FUNC;
+ extern void data_extract_to_buffer(archive_handle_t *archive_handle) FAST_FUNC;
+
+diff -Nur busybox-1.12.1.orig/include/usage.h busybox-1.12.1/include/usage.h
+--- busybox-1.12.1.orig/include/usage.h 2008-09-28 20:04:26.000000000 +0200
++++ busybox-1.12.1/include/usage.h 2008-10-23 11:41:37.000000000 +0200
+@@ -1419,6 +1419,82 @@
+ "$ ls -la /tmp/busybox*\n" \
+ "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
+
++#define ipkg_trivial_usage \
++ "[options]... sub-command [arguments]..."
++#define ipkg_full_usage \
++ "ipkg is an utility to install, remove and manage .ipk packages.\n" \
++ "\n" \
++ "Sub-commands:\n" \
++ "\nPackage Manipulation:\n" \
++ "\tupdate Update list of available packages\n" \
++ "\tupgrade Upgrade all installed packages to latest version\n" \
++ "\tinstall <pkg> Download and install <pkg> (and dependencies)\n" \
++ "\tinstall <file.ipk> Install package <file.ipk>\n" \
++ "\tconfigure [<pkg>] Configure unpacked packages\n" \
++ "\tremove <pkg|regexp> Remove package <pkg|packages following regexp>\n" \
++ "\tflag <flag> <pkg> ... Flag package(s) <pkg>\n" \
++ "\t <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation) \n" \
++ "\n" \
++ "Informational Commands:\n" \
++ "\tlist List available packages and descriptions\n" \
++ "\tlist_installed List all and only the installed packages and description \n" \
++ "\tfiles <pkg> List all files belonging to <pkg>\n" \
++ "\tsearch <file|regexp> Search for a package providing <file>\n" \
++ "\tinfo [pkg|regexp [<field>]] Display all/some info fields for <pkg> or all\n" \
++ "\tstatus [pkg|regexp [<field>]] Display all/some status fields for <pkg> or all\n" \
++ "\tdownload <pkg> Download <pkg> to current directory.\n" \
++ "\tcompare_versions <v1> <op> <v2>\n" \
++ "\t compare versions using <= < > >= = << >>\n" \
++ "\tprint_architecture prints the architecture.\n" \
++ "\tprint_installation_architecture\n" \
++ "\twhatdepends [-A] [pkgname|pat]+\n" \
++ "\twhatdependsrec [-A] [pkgname|pat]+\n" \
++ "\twhatprovides [-A] [pkgname|pat]+\n" \
++ "\twhatconflicts [-A] [pkgname|pat]+\n" \
++ "\twhatreplaces [-A] [pkgname|pat]+\n" \
++ "\t prints the installation architecture.\n" \
++ "\n" \
++ "\nOptions:\n" \
++ "\t-A Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts\n" \
++ "\t-V <level> Set verbosity level to <level>. If no value is\n" \
++ "\t--verbosity <level> provided increase verbosity by one. Verbosity levels:\n" \
++ "\t 0 errors only\n" \
++ "\t 1 normal messages (default)\n" \
++ "\t 2 informative messages\n" \
++ "\t 3 debug output\n" \
++ "\t-f <conf_file> Use <conf_file> as the ipkg configuration file\n" \
++ "\t-conf <conf_file> Default configuration file location\n" \
++ " is /etc/ipkg.conf\n" \
++ "\t-d <dest_name> Use <dest_name> as the the root directory for\n" \
++ "\t-dest <dest_name> package installation, removal, upgrading.\n" \
++ " <dest_name> should be a defined dest name from\n" \
++ " the configuration file, (but can also be a\n" \
++ " directory name in a pinch).\n" \
++ "\t-o <offline_root> Use <offline_root> as the root directory for\n" \
++ "\t-offline <offline_root> offline installation of packages.\n" \
++ "\t-verbose_wget more wget messages\n" \
++ "\n" \
++ "Force Options (use when ipkg is too smart for its own good):\n" \
++ "\t-force-depends Make dependency checks warnings instead of errors\n" \
++ "\t Install/remove package in spite of failed dependences\n" \
++ "\t-force-defaults Use default options for questions asked by ipkg.\n" \
++ " (no prompts). Note that this will not prevent\n" \
++ " package installation scripts from prompting.\n" \
++ "\t-force-reinstall Allow ipkg to reinstall a package.\n" \
++ "\t-force-overwrite Allow ipkg to overwrite files from another package during an install.\n" \
++ "\t-force-downgrade Allow ipkg to downgrade packages.\n" \
++ "\t-force_space Install even if there does not seem to be enough space.\n" \
++ "\t-noaction No action -- test only\n" \
++ "\t-nodeps Do not follow dependences\n" \
++ "\t-force-removal-of-dependent-packages\n" \
++ "\t-recursive Allow ipkg to remove package and all that depend on it.\n" \
++ "\t-test No action -- test only\n" \
++ "\t-t Specify tmp-dir.\n" \
++ "\t--tmp-dir Specify tmp-dir.\n" \
++ "\n" \
++ "\tregexp could be something like 'pkgname*' '*file*' or similar\n" \
++ "\teg: ipkg info 'libstd*' or ipkg search '*libop*' or ipkg remove 'libncur*'\n"
++
+ #define halt_trivial_usage \
+ "[-d delay] [-n] [-f]"
+ #define halt_full_usage "\n\n" \
+diff -Nur busybox-1.12.1.orig/Makefile busybox-1.12.1/Makefile
+--- busybox-1.12.1.orig/Makefile 2008-09-28 20:04:30.000000000 +0200
++++ busybox-1.12.1/Makefile 2008-10-23 11:41:37.000000000 +0200
+@@ -444,6 +444,7 @@
+
+ libs-y := \
+ archival/ \
++ archival/libipkg/ \
+ archival/libunarchive/ \
+ console-tools/ \
+ coreutils/ \
diff --git a/package/busybox/patches/002-find-empty.patch b/package/busybox/patches/002-find-empty.patch
new file mode 100644
index 000000000..4e0cc67fa
--- /dev/null
+++ b/package/busybox/patches/002-find-empty.patch
@@ -0,0 +1,105 @@
+diff -Nur busybox-1.12.3/findutils/Config.in busybox-1.12.3-find/findutils/Config.in
+--- busybox-1.12.3/findutils/Config.in 2008-09-28 20:04:28.000000000 +0200
++++ busybox-1.12.3-find/findutils/Config.in 2009-01-06 22:24:46.086215240 +0100
+@@ -81,6 +81,14 @@
+ help
+ Support the 'find -inum' option for searching by inode number.
+
++config FEATURE_FIND_EMPTY
++ bool "Enable -empty option matching empty files and directories"
++ default y
++ depends on FIND
++ help
++ Support the 'find -empty' option for searching empty files
++ and directories.
++
+ config FEATURE_FIND_EXEC
+ bool "Enable -exec option allowing execution of commands"
+ default y
+diff -Nur busybox-1.12.3/findutils/find.c busybox-1.12.3-find/findutils/find.c
+--- busybox-1.12.3/findutils/find.c 2008-09-28 20:04:28.000000000 +0200
++++ busybox-1.12.3-find/findutils/find.c 2009-01-06 23:33:53.201386585 +0100
+@@ -93,6 +93,7 @@
+ USE_FEATURE_FIND_CONTEXT(ACTS(context, security_context_t context;))
+ USE_FEATURE_FIND_PAREN( ACTS(paren, action ***subexpr;))
+ USE_FEATURE_FIND_PRUNE( ACTS(prune))
++USE_FEATURE_FIND_EMPTY( ACTS(empty))
+ USE_FEATURE_FIND_DELETE( ACTS(delete))
+ USE_FEATURE_FIND_EXEC( ACTS(exec, char **exec_argv; unsigned *subst_count; int exec_argc;))
+ USE_FEATURE_FIND_GROUP( ACTS(group, gid_t gid;))
+@@ -318,6 +319,34 @@
+ return exec_actions(ap->subexpr, fileName, statbuf);
+ }
+ #endif
++#if ENABLE_FEATURE_FIND_EMPTY
++ACTF(empty)
++{
++ DIR *d;
++ struct dirent *dp;
++ bool empty = TRUE;
++
++ if (S_ISDIR(statbuf->st_mode)) {
++ d = opendir(fileName);
++ if (d == NULL)
++ bb_simple_perror_msg(fileName);
++ for (dp = readdir(d); dp; dp = readdir(d)) {
++ if (dp->d_name[0] != '.' ||
++ (dp->d_name[1] != '\0' &&
++ (dp->d_name[1] != '.' ||
++ dp->d_name[2] != '\0'))) {
++ empty = FALSE;
++ break;
++ }
++ }
++ closedir(d);
++ return(empty);
++ } else if (S_ISREG(statbuf->st_mode))
++ return (statbuf->st_size == 0);
++ else
++ return FALSE;
++}
++#endif
+ #if ENABLE_FEATURE_FIND_SIZE
+ ACTF(size)
+ {
+@@ -459,6 +488,7 @@
+ USE_FEATURE_FIND_PRINT0( PARM_print0 ,)
+ USE_FEATURE_FIND_DEPTH( PARM_depth ,)
+ USE_FEATURE_FIND_PRUNE( PARM_prune ,)
++ USE_FEATURE_FIND_EMPTY( PARM_empty ,)
+ USE_FEATURE_FIND_DELETE( PARM_delete ,)
+ USE_FEATURE_FIND_EXEC( PARM_exec ,)
+ USE_FEATURE_FIND_PAREN( PARM_char_brace,)
+@@ -492,6 +522,7 @@
+ USE_FEATURE_FIND_PRINT0( "-print0\0" )
+ USE_FEATURE_FIND_DEPTH( "-depth\0" )
+ USE_FEATURE_FIND_PRUNE( "-prune\0" )
++ USE_FEATURE_FIND_EMPTY( "-empty\0" )
+ USE_FEATURE_FIND_DELETE( "-delete\0" )
+ USE_FEATURE_FIND_EXEC( "-exec\0" )
+ USE_FEATURE_FIND_PAREN( "(\0" )
+@@ -610,6 +641,12 @@
+ (void) ALLOC_ACTION(prune);
+ }
+ #endif
++#if ENABLE_FEATURE_FIND_EMPTY
++ else if (parm == PARM_empty) {
++ USE_FEATURE_FIND_NOT( invert_flag = 0; )
++ (void) ALLOC_ACTION(empty);
++ }
++#endif
+ #if ENABLE_FEATURE_FIND_DELETE
+ else if (parm == PARM_delete) {
+ need_print = 0;
+diff -Nur busybox-1.12.3/include/usage.h busybox-1.12.3-find/include/usage.h
+--- busybox-1.12.3/include/usage.h 2008-09-28 20:04:26.000000000 +0200
++++ busybox-1.12.3-find/include/usage.h 2009-01-07 00:07:49.832669156 +0100
+@@ -1140,6 +1140,8 @@
+ "\n -group NAME File belongs to group NAME (numeric group ID allowed)") \
+ USE_FEATURE_FIND_DEPTH( \
+ "\n -depth Process directory name after traversing it") \
++ USE_FEATURE_FIND_EMPTY( \
++ "\n -empty File or directory is empty") \
+ USE_FEATURE_FIND_SIZE( \
+ "\n -size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.))." \
+ "\n +/-N: file size is bigger/smaller than N") \
diff --git a/package/busybox/patches/patch-Makefile b/package/busybox/patches/patch-Makefile
new file mode 100644
index 000000000..45b8f75a9
--- /dev/null
+++ b/package/busybox/patches/patch-Makefile
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.13.4.orig/Makefile 2009-04-15 02:11:01.000000000 +0200
++++ busybox-1.13.4/Makefile 2009-05-06 20:30:25.953125000 +0200
+@@ -277,7 +277,7 @@ HOSTCXXFLAGS :=
+ # We need some generic definitions
+ include $(srctree)/scripts/Kbuild.include
+
+-HOSTCFLAGS += $(call hostcc-option,-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer,)
++HOSTCFLAGS += $(call hostcc-option,-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -DHOSTCOMPILE=1,)
+ HOSTCXXFLAGS += -O2
+
+ # For maximum performance (+ possibly random breakage, uncomment
diff --git a/package/busybox/patches/patch-Makefile_flags b/package/busybox/patches/patch-Makefile_flags
new file mode 100644
index 000000000..72eb6b709
--- /dev/null
+++ b/package/busybox/patches/patch-Makefile_flags
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.12.3.orig/Makefile.flags 2008-09-28 20:04:30.000000000 +0200
++++ busybox-1.12.3/Makefile.flags 2008-12-25 20:27:43.092824157 +0100
+@@ -46,15 +46,12 @@ CFLAGS += $(call cc-option,-falign-funct
+ # be fixed..
+ #CFLAGS += $(call cc-option,-Wconversion,)
+
+-ifneq ($(CONFIG_DEBUG),y)
+-CFLAGS += $(call cc-option,-Os,)
+-else
++ifeq ($(CONFIG_DEBUG),y)
+ CFLAGS += $(call cc-option,-g,)
++else
+ #CFLAGS += "-D_FORTIFY_SOURCE=2"
+ ifeq ($(CONFIG_DEBUG_PESSIMIZE),y)
+ CFLAGS += $(call cc-option,-O0,)
+-else
+-CFLAGS += $(call cc-option,-Os,)
+ endif
+ endif
+
diff --git a/package/busybox/patches/patch-include_libbb_h b/package/busybox/patches/patch-include_libbb_h
new file mode 100644
index 000000000..37c500bdc
--- /dev/null
+++ b/package/busybox/patches/patch-include_libbb_h
@@ -0,0 +1,80 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.13.4.orig/include/libbb.h 2009-04-15 02:09:42.000000000 +0200
++++ busybox-1.13.4/include/libbb.h 2009-05-09 02:06:09.000000000 +0200
+@@ -44,6 +44,7 @@
+ #define PATH_MAX 256
+ #endif
+
++#if !(defined __APPLE__ || defined __FreeBSD__)
+ #ifdef HAVE_MNTENT_H
+ #include <mntent.h>
+ #endif
+@@ -58,6 +59,7 @@
+ #include <selinux/flask.h>
+ #include <selinux/av_permissions.h>
+ #endif
++#endif
+
+ #if ENABLE_LOCALE_SUPPORT
+ #include <locale.h>
+@@ -71,9 +73,11 @@
+
+ #include <pwd.h>
+ #include <grp.h>
++#ifndef HOSTCOMPILE
+ #if ENABLE_FEATURE_SHADOWPASSWDS
+ # include <shadow.h>
+ #endif
++#endif
+
+ /* Some libc's forget to declare these, do it ourself */
+
+@@ -409,7 +413,9 @@ struct BUG_too_small {
+ char BUG_family_t_too_small[(0
+ | AF_UNSPEC
+ | AF_INET
++#ifndef HOSTCOMPILE
+ | AF_INET6
++#endif
+ | AF_UNIX
+ #ifdef AF_PACKET
+ | AF_PACKET
+@@ -810,7 +816,9 @@ enum {
+ # define bb_daemonize_or_rexec(flags, argv) bb_daemonize_or_rexec(flags)
+ # define bb_daemonize(flags) bb_daemonize_or_rexec(flags, bogus)
+ #else
++#ifndef HOSTCOMPILE
+ void re_exec(char **argv) NORETURN FAST_FUNC;
++#endif
+ void forkexit_or_rexec(char **argv) FAST_FUNC;
+ extern bool re_execed;
+ int BUG_fork_is_unavailable_on_nommu(void) FAST_FUNC;
+@@ -1003,10 +1011,12 @@ extern void run_applet_and_exit(const ch
+ extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC;
+ #endif
+
++#if !(defined __APPLE__ || defined __FreeBSD__)
+ #ifdef HAVE_MNTENT_H
+ extern int match_fstype(const struct mntent *mt, const char *fstypes) FAST_FUNC;
+ extern struct mntent *find_mount_point(const char *name, const char *table) FAST_FUNC;
+ #endif
++#endif
+ extern void erase_mtab(const char * name) FAST_FUNC;
+ extern unsigned int tty_baud_to_value(speed_t speed) FAST_FUNC;
+ extern speed_t tty_value_to_baud(unsigned int value) FAST_FUNC;
+@@ -1084,6 +1094,7 @@ extern void bb_do_delay(int seconds) FAS
+ extern void change_identity(const struct passwd *pw) FAST_FUNC;
+ extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) NORETURN FAST_FUNC;
+ extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) FAST_FUNC;
++#if !(defined __APPLE__ || defined __FreeBSD__)
+ #if ENABLE_SELINUX
+ extern void renew_current_security_context(void) FAST_FUNC;
+ extern void set_current_security_context(security_context_t sid) FAST_FUNC;
+@@ -1094,6 +1105,7 @@ extern void selinux_preserve_fcontext(in
+ #else
+ #define selinux_preserve_fcontext(fdesc) ((void)0)
+ #endif
++#endif
+ extern void selinux_or_die(void) FAST_FUNC;
+ extern int restricted_shell(const char *shell) FAST_FUNC;
+
diff --git a/package/busybox/patches/patch-include_platform_h b/package/busybox/patches/patch-include_platform_h
new file mode 100644
index 000000000..b3c9ffd7f
--- /dev/null
+++ b/package/busybox/patches/patch-include_platform_h
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.13.4.orig/include/platform.h 2008-11-09 18:28:17.000000000 +0100
++++ busybox-1.13.4/include/platform.h 2009-05-08 22:48:50.000000000 +0200
+@@ -116,7 +116,7 @@
+ # include <sex.h>
+ # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN)
+ # define __BYTE_ORDER BYTE_ORDER
+-#elif !defined __APPLE__
++#elif !(defined __APPLE__ || defined __FreeBSD__)
+ # include <byteswap.h>
+ # include <endian.h>
+ #endif
+@@ -162,7 +162,7 @@
+
+ /* ---- Networking ------------------------------------------ */
+
+-#ifndef __APPLE__
++#if !(defined __APPLE__ || defined __FreeBSD__)
+ # include <arpa/inet.h>
+ # ifndef __socklen_t_defined
+ typedef int socklen_t;
+@@ -210,7 +210,7 @@ __extension__ typedef unsigned long long
+ #define HAVE_FEATURES_H
+ #include <stdint.h>
+ #define HAVE_STDINT_H
+-#elif !defined __APPLE__
++#elif !(defined __APPLE__ || defined __FreeBSD__)
+ /* Largest integral types. */
+ #if __BIG_ENDIAN__
+ typedef long intmax_t;
diff --git a/package/busybox/patches/patch-networking_traceroute_c b/package/busybox/patches/patch-networking_traceroute_c
new file mode 100644
index 000000000..081bf9232
--- /dev/null
+++ b/package/busybox/patches/patch-networking_traceroute_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.13.4.orig/networking/traceroute.c 2008-11-09 18:27:59.000000000 +0100
++++ busybox-1.13.4/networking/traceroute.c 2009-05-12 16:26:08.000000000 +0200
+@@ -273,7 +273,7 @@ typedef struct outdata {
+ unsigned char seq; /* sequence number of this packet */
+ unsigned char ttl; /* ttl packet left with */
+ // UNUSED. Retaining to have the same packet size.
+- struct timeval tv_UNUSED PACKED; /* time packet left */
++ struct timeval tv_UNUSED; /* time packet left */
+ } outdata_t;
+
+ struct IFADDRLIST {
diff --git a/package/busybox/patches/patch-networking_udhcp_dhcpd_c b/package/busybox/patches/patch-networking_udhcp_dhcpd_c
new file mode 100644
index 000000000..26b6590c3
--- /dev/null
+++ b/package/busybox/patches/patch-networking_udhcp_dhcpd_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.13.4.orig/networking/udhcp/dhcpd.c 2008-11-09 18:27:58.000000000 +0100
++++ busybox-1.13.4/networking/udhcp/dhcpd.c 2009-05-12 16:32:40.000000000 +0200
+@@ -196,7 +196,6 @@ int udhcpd_main(int argc UNUSED_PARAM, c
+ if (lease) {
+ if (server_id) {
+ /* SELECTING State */
+- DEBUG("server_id = %08x", ntohl(server_id_align));
+ if (server_id_align == server_config.server && requested
+ && requested_align == lease->yiaddr
+ ) {
diff --git a/package/busybox/patches/patch-runit_runit_lib_h b/package/busybox/patches/patch-runit_runit_lib_h
new file mode 100644
index 000000000..da6327854
--- /dev/null
+++ b/package/busybox/patches/patch-runit_runit_lib_h
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.13.4.orig/runit/runit_lib.h 2008-11-09 18:28:19.000000000 +0100
++++ busybox-1.13.4/runit/runit_lib.h 2009-05-12 16:34:56.000000000 +0200
+@@ -88,9 +88,9 @@ extern unsigned pmatch(const char *, con
+ * runsv / supervise / sv stuff
+ */
+ typedef struct svstatus_t {
+- uint64_t time_be64 PACKED;
+- uint32_t time_nsec_be32 PACKED;
+- uint32_t pid_le32 PACKED;
++ uint64_t time_be64;
++ uint32_t time_nsec_be32;
++ uint32_t pid_le32;
+ uint8_t paused;
+ uint8_t want;
+ uint8_t got_term;
diff --git a/package/busybox/patches/patch-util-linux_fdisk_osf_c b/package/busybox/patches/patch-util-linux_fdisk_osf_c
new file mode 100644
index 000000000..75c8a858a
--- /dev/null
+++ b/package/busybox/patches/patch-util-linux_fdisk_osf_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- busybox-1.13.4.orig/util-linux/fdisk_osf.c 2008-11-09 18:28:22.000000000 +0100
++++ busybox-1.13.4/util-linux/fdisk_osf.c 2009-05-12 16:39:12.000000000 +0200
+@@ -45,7 +45,7 @@
+
+ #if defined(i386) || defined(__sparc__) || defined(__arm__) \
+ || defined(__m68k__) || defined(__mips__) || defined(__s390__) \
+- || defined(__sh__) || defined(__x86_64__)
++ || defined(__sh__) || defined(__x86_64__) || defined(__cris__)
+ #define BSD_LABELSECTOR 1
+ #define BSD_LABELOFFSET 0
+ #elif defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
diff --git a/package/bwm/Config.in b/package/bwm/Config.in
new file mode 100644
index 000000000..be25ed48a
--- /dev/null
+++ b/package/bwm/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_BWM
+ prompt "bwm............................... A very tiny BandWidth Monitor"
+ tristate
+ default n
+ help
+ Continually displays data transfer rates (received, transmitted, and
+ total) for each interface, measured in KiB/sec. Works by sampling
+ values from /proc/net/dev and calculating deltas.
diff --git a/package/bwm/Makefile b/package/bwm/Makefile
new file mode 100644
index 000000000..9d5fa7df0
--- /dev/null
+++ b/package/bwm/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= bwm
+PKG_VERSION:= 1.1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 51021a036acb92d2bda0c0c0483f9552
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz
+MASTER_SITES:= http://ftp.debian.org/debian/pool/main/b/bwm/
+WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}.orig
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,BWM,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${TARGET_CFLAGS} ${WRKBUILD}/bwm.c -o ${WRKBUILD}/bwm
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_BWM}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/bwm ${IDIR_BWM}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/bwm/ipkg/bwm.control b/package/bwm/ipkg/bwm.control
new file mode 100644
index 000000000..4851a2deb
--- /dev/null
+++ b/package/bwm/ipkg/bwm.control
@@ -0,0 +1,4 @@
+Package: bwm
+Priority: optional
+Section: net
+Description: A very tiny bandwidth monitor
diff --git a/package/cbtt/Config.in b/package/cbtt/Config.in
new file mode 100644
index 000000000..25b51c6da
--- /dev/null
+++ b/package/cbtt/Config.in
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_CBTT
+ prompt "cbtt.............................. a C BitTorrent Tracker"
+ tristate
+ default n
+ select ADK_PACKAGE_ZLIB
+ depends on ADK_CXX
+ help
+ A C BitTorrent Tracker
+
+config ADK_PACKAGE_CBTT_MYSQL
+ prompt "cbtt-mysql........................ a C BitTorrent Tracker (mysql)"
+ tristate
+ default n
+ select ADK_PACKAGE_ZLIB
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+ depends on ADK_CXX
+ help
+ A C BitTorrent Tracker
diff --git a/package/cbtt/Makefile b/package/cbtt/Makefile
new file mode 100644
index 000000000..a7119ff4b
--- /dev/null
+++ b/package/cbtt/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cbtt
+PKG_VERSION:= 20060211
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 19abea2817c49ccc9438e9671c402984
+DISTFILES:= ${PKG_NAME}80-${PKG_VERSION}-src.tar.gz
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=bnbtusermods/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}80-${PKG_VERSION}-src
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CBTT,cbtt,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,CBTT_MYSQL,cbtt-mysql,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+TLDFLAGS+= -shared -L. -L${STAGING_DIR}/usr/lib/mysql \
+ -lmysqlclient -lz -lpthread -lm -lgcc
+ifeq ($(ADK_TARGET_LIB_UCLIBCXX),y)
+TLDFLAGS+= -nodefaultlibs -lz -lpthread \
+ -luClibc++ -lc -lm -lgcc
+TCFLAGS+= -fno-builtin -nostdinc++
+endif
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_CBTT}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/bnbt ${IDIR_CBTT}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_CBTT_MYSQL}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/bnbtmysql ${IDIR_CBTT_MYSQL}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cbtt/ipkg/cbtt-mysql.control b/package/cbtt/ipkg/cbtt-mysql.control
new file mode 100644
index 000000000..ef8b52a32
--- /dev/null
+++ b/package/cbtt/ipkg/cbtt-mysql.control
@@ -0,0 +1,5 @@
+Package: cbtt-mysql
+Priority: optional
+Section: net
+Depends: zlib, libmysqlclient, uclibc++
+Description: Bittorrent tracker with mysql support
diff --git a/package/cbtt/ipkg/cbtt.control b/package/cbtt/ipkg/cbtt.control
new file mode 100644
index 000000000..bc8b844ad
--- /dev/null
+++ b/package/cbtt/ipkg/cbtt.control
@@ -0,0 +1,5 @@
+Package: cbtt
+Priority: optional
+Section: net
+Depends: zlib, uclibc++
+Description: Bittorrent tracker
diff --git a/package/cbtt/patches/100-compile.patch b/package/cbtt/patches/100-compile.patch
new file mode 100644
index 000000000..86fdb7ca2
--- /dev/null
+++ b/package/cbtt/patches/100-compile.patch
@@ -0,0 +1,57 @@
+diff -Nur cbtt80-20060211-src/Makefile cbtt80-20060211-src.patched/Makefile
+--- cbtt80-20060211-src.orig/Makefile 2006-02-07 18:44:58.000000000 +0100
++++ cbtt80-20060211-src/Makefile 2009-05-09 16:11:42.000000000 +0200
+@@ -1,10 +1,9 @@
+-SHELL = /bin/sh
+-SYSTEM = $(shell uname)
+-C++ = g++
++SHELL ?= /bin/bash
++SYSTEM = Linux
+ DFLAGS =
+-OFLAGS = -O2 -w
++#OFLAGS = -O2 -w
+ LFLAGS = -L. -lz
+-CFLAGS =
++CFLAGS ?=
+
+ ifeq ($(SYSTEM),Linux)
+ DFLAGS += -D__LINUX__
+@@ -30,6 +29,7 @@ CFLAGS =
+ endif
+
+ CFLAGS += $(OFLAGS) $(DFLAGS) -I.
++LDFLAGS += $(LFLAGS)
+
+ OBJS = atom.o base64.o bencode.o client.o config.o link.o md5.o server.o sha1.o sort.o tracker_admin.o tracker_comments.o tracker_file.o tracker_index.o tracker_info.o tracker_login.o tracker_signup.o tracker_stats.o tracker_torrent.o tracker_upload.o tracker_users.o util.o
+ OBJS_BNBT = bnbt.o tracker.o tracker_announce.o tracker_scrape.o
+@@ -40,19 +40,19 @@ PROGS = ./bnbt ./bnbtmysql
+ all: $(OBJS) $(OBJS_BNBT) $(OBJS_BNBTMYSQL) $(PROGS)
+
+ ./bnbt: $(OBJS) $(OBJS_BNBT)
+- $(C++) -o ./bnbt $(OBJS) $(OBJS_BNBT) $(LFLAGS)
++ $(CXX) -o ./bnbt $(OBJS) $(OBJS_BNBT) $(LDFLAGS)
+
+ ./bnbtmysql: $(OBJS) $(OBJS_BNBTMYSQL)
+- $(C++) -o ./bnbtmysql $(OBJS) $(OBJS_BNBTMYSQL) $(LFLAGS) -L/usr/lib/mysql -lmysqlclient
++ $(CXX) -o ./bnbtmysql $(OBJS) $(OBJS_BNBTMYSQL) $(LDFLAGS)
+
+ clean:
+ rm -f $(OBJS) $(OBJS_BNBT) $(OBJS_BNBTMYSQL) $(PROGS)
+
+ %.o: %.cpp
+- $(C++) -o $@ $(CFLAGS) -c $<
++ $(CXX) -o $@ $(CPPFLAGS) $(CFLAGS) -c $<
+
+ %.mysql.o: %.cpp
+- $(C++) -o $@ $(CFLAGS) -DBNBT_MYSQL -c $<
++ $(CXX) -o $@ $(CPPFLAGS) $(CFLAGS) -DBNBT_MYSQL -c $<
+
+ ./bnbt: $(OBJS) $(OBJS_BNBT)
+
+@@ -91,4 +91,4 @@ bnbt.mysql.o: bnbt.h bnbt_mysql.h config
+ bnbt_mysql.mysql.o: bnbt.h bnbt_mysql.h util.h
+ tracker.mysql.o: bnbt.h bnbt_mysql.h atom.h bencode.h config.h md5.h server.h sort.h tracker.h util.h
+ tracker_announce.mysql.o: bnbt.h bnbt_mysql.h atom.h bencode.h link.h tracker.h util.h
+-tracker_scrape.mysql.o: bnbt.h bnbt_mysql.h atom.h bencode.h tracker.h util.h
+\ No newline at end of file
++tracker_scrape.mysql.o: bnbt.h bnbt_mysql.h atom.h bencode.h tracker.h util.h
diff --git a/package/cbtt/patches/patch-bnbt_h b/package/cbtt/patches/patch-bnbt_h
new file mode 100644
index 000000000..6169a027c
--- /dev/null
+++ b/package/cbtt/patches/patch-bnbt_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cbtt80-20060211-src.orig/bnbt.h 2006-02-07 18:44:58.000000000 +0100
++++ cbtt80-20060211-src/bnbt.h 2009-05-09 16:17:54.000000000 +0200
+@@ -5,6 +5,7 @@
+ #ifndef BNBT_H
+ #define BNBT_H
+
++#include <string.h>
+ #include <stdio.h>
+ #include <time.h>
+
diff --git a/package/cfgfs/Config.in b/package/cfgfs/Config.in
new file mode 100644
index 000000000..78051901b
--- /dev/null
+++ b/package/cfgfs/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_CFGFS
+ prompt "cfgfs................................ compressed config filesystem"
+ tristate
+ select BUSYBOX_COMM
+ select BUSYBOX_MD5SUM
+ select BUSYBOX_FEATURE_SORT_BIG
+ depends on ADK_LINUX_X86_ALIX1C || ADK_LINUX_CRIS_FOXBOARD
+ default y
+ help
+ Adopted from FreeWRT fwcf
diff --git a/package/cfgfs/Makefile b/package/cfgfs/Makefile
new file mode 100644
index 000000000..4a521a1b4
--- /dev/null
+++ b/package/cfgfs/Makefile
@@ -0,0 +1,39 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cfgfs
+PKG_VERSION:= 1.0.6
+PKG_RELEASE:= 2
+WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CFGFS,cfgfs,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+
+do-configure:
+ mkdir -p ${WRKBUILD}
+ ${CP} ./src/* ${WRKBUILD}
+ ${TARGET_CC} ${TCPPFLAGS} ${TCFLAGS} -o ${WRKBUILD}/mtd ${WRKBUILD}/mtd.c
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_CFGFS}/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/fwcf.sh ${IDIR_CFGFS}/sbin/cfgfs
+ ${INSTALL_BIN} ${WRKBUILD}/fwcf.helper.out ${IDIR_CFGFS}/sbin/cfgfs.helper
+ifeq ($(ARCH),cris)
+ ${INSTALL_BIN} ${WRKBUILD}/mtd ${IDIR_CFGFS}/sbin/mtd
+ echo '#!/bin/sh' > ${IDIR_CFGFS}/sbin/cfgfs.write
+ echo 'mtd -F write - cfgfs' >> ${IDIR_CFGFS}/sbin/cfgfs.write
+else
+ echo '#!/bin/sh' > ${IDIR_CFGFS}/sbin/cfgfs.write
+ echo 'cat > /dev/sda2' >> ${IDIR_CFGFS}/sbin/cfgfs.write
+endif
+ chmod 755 ${IDIR_CFGFS}/sbin/cfgfs.write
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cfgfs/ipkg/cfgfs.control b/package/cfgfs/ipkg/cfgfs.control
new file mode 100644
index 000000000..8ae5a7917
--- /dev/null
+++ b/package/cfgfs/ipkg/cfgfs.control
@@ -0,0 +1,5 @@
+Package: cfgfs
+Priority: optional
+Section: base
+Description: compressed config filesystem
+
diff --git a/package/cfgfs/src/BSDmakefile b/package/cfgfs/src/BSDmakefile
new file mode 100644
index 000000000..4d3bf7a11
--- /dev/null
+++ b/package/cfgfs/src/BSDmakefile
@@ -0,0 +1,32 @@
+# $MirOS: contrib/hosted/fwcf/BSDmakefile,v 1.8 2007/03/13 18:14:30 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+ SUBDIR+= lib
+ SUBDIR+= mkfwcf
+ SUBDIR+= unfwcf
+ SUBDIR+= tool
+ SUBDIR+= fwcf.helper
+
+test: _SUBDIRUSE
+
+.include <bsd.own.mk>
+COPTS?= # for OpenBSD
+.if !${COPTS:M-fhonour-copts} || !${CFLAGS:M-fhonour-copts}
+CFLAGS+= ${COPTS}
+.endif
+
+gmake:
+ -rm -rf gmake_test
+ mkdir -p gmake_test
+ cd gmake_test && lndir -e gmake_test ${.CURDIR}
+ cd gmake_test && CC=${CC:Q} CFLAGS=${CFLAGS:M*:Q} gmake
+
+clean_gmake:
+ -rm -rf gmake_test
+
+.include <bsd.subdir.mk>
+
+clean cleandir: clean_gmake
diff --git a/package/cfgfs/src/LICENCE b/package/cfgfs/src/LICENCE
new file mode 100644
index 000000000..af7542c91
--- /dev/null
+++ b/package/cfgfs/src/LICENCE
@@ -0,0 +1,35 @@
+FWCF is licenced material and developed for the FreeWRT Project by
+the following authors and contributors:
+
+Copyright © 2006, 2007
+ Thorsten Glaser <tg@mirbsd.de> (initial author)
+
+For more information on FreeWRT please visit http://freewrt.org/
+
+Provided that these terms and disclaimer and all copyright notices
+are retained or reproduced in an accompanying document, permission
+is granted to deal in this work without restriction, including un-
+limited rights to use, publicly perform, distribute, sell, modify,
+merge, give away, or sublicence.
+
+This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+the utmost extent permitted by applicable law, neither express nor
+implied; without malicious intent or gross negligence. In no event
+may a licensor, author or contributor be held liable for indirect,
+direct, other damage, loss, or other issues arising in any way out
+of dealing in the work, even if advised of the possibility of such
+damage or existence of a defect, except proven that it results out
+of said person's immediate fault when using the work as intended.
+
+The initial author would really appreciate users to credit his na-
+me and that of the FreeWRT Project and/or add links to the CVS re-
+pository of the original source in derived works.
+
+The FWCF specification is licenced under different terms. Also the
+c_lzo1x plug-in is covered by the GNU General Public License, Ver-
+sion 1 or higher. The files in the bundled/ subdirectory are not a
+part of FWCF and covered by their own licenced. The version 1.0 of
+FWCF bundles MiniLZO from lzo-2.02 under the GPL 2 or higher only.
+
+⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼
+$MirOS: contrib/hosted/fwcf/LICENCE,v 1.5 2007/03/13 18:31:07 tg Exp $
diff --git a/package/cfgfs/src/Makefile b/package/cfgfs/src/Makefile
new file mode 100644
index 000000000..7ab068c69
--- /dev/null
+++ b/package/cfgfs/src/Makefile
@@ -0,0 +1,40 @@
+# $MirOS: contrib/hosted/fwcf/GNUmakefile,v 1.8 2007/03/09 23:09:34 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+SRCS+= tool.c
+SRCS+= sys_linux.c
+SRCS+= replace.c
+SRCS+= compress.c
+#SRCS+= fts_debg.c
+SRCS+= cpr_get.c
+SRCS+= cpr_list.c
+SRCS+= cpr_lsth.c
+SRCS+= ft_creat.c
+SRCS+= ft_pack.c
+SRCS+= ft_packm.c
+SRCS+= fts_subs.c
+SRCS+= header.c
+SRCS+= minilzop.c
+SRCS+= unwraps.c
+SRCS+= wraps.c
+
+# the compressor
+SRCS+= c_lzo1x1.c
+CPPFLAGS+= -Ibundled
+
+OBJS= ${SRCS:.c=.o}
+
+# build for the target
+CPPFLAGS+= -DSMALL -D__USE_GNU
+
+# missing in uClibc
+SRCS+= fts.c
+CPPFLAGS+= -I.
+
+all: fwcf.helper.out
+
+fwcf.helper.out: ${OBJS}
+ ${CC} -o $@ ${OBJS} ${LDFLAGS}
diff --git a/package/cfgfs/src/Makefile.inc b/package/cfgfs/src/Makefile.inc
new file mode 100644
index 000000000..82f7eb8f9
--- /dev/null
+++ b/package/cfgfs/src/Makefile.inc
@@ -0,0 +1,45 @@
+# $MirOS: contrib/hosted/fwcf/Makefile.inc,v 1.10 2007/05/08 21:52:53 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+__CRAZY= Yes
+MKC_DEBG= cpp
+
+UNAME_S!= uname -s
+
+.ifndef LIB
+. if exists(${.CURDIR}/../lib/${__objdir})
+DPADD+= ${.CURDIR}/../lib/${__objdir}/libfwcf.a
+LDADD+= -L${.CURDIR}/../lib/${__objdir} -lfwcf
+. else
+DPADD+= ${.CURDIR}/../lib/libfwcf.a
+LDADD+= -L${.CURDIR}/../lib -lfwcf
+. endif
+.endif
+
+CPPFLAGS+= -I${.CURDIR}/..
+.PATH: ${.CURDIR}/..
+
+test: .NOTMAIN all
+
+COMPRESSORS+= c_null.c
+COMPRESSORS+= c_zlib.c
+CPPFLAGS+= -DZCONST=const
+
+COMPRESSORS+= c_lzo1x1.c
+MKDEP+= -I${.CURDIR}/../bundled
+CFLAGS_c_lzo1x1.o+= -I${.CURDIR}/../bundled -Wno-undef
+_CFLADD+= c_lzo1x1.o
+
+.if make(test)
+CFLAGS_sys_bsd.o+= -DRND_DISABLE
+_CFLADD+= sys_bsd.o
+.endif
+
+.if ${UNAME_S} == "OpenBSD"
+. for _i in ${_CFLADD}
+CFLAGS+= ${CFLAGS_${_i}}
+. endfor
+.endif
diff --git a/package/cfgfs/src/adler.h b/package/cfgfs/src/adler.h
new file mode 100644
index 000000000..a1608705f
--- /dev/null
+++ b/package/cfgfs/src/adler.h
@@ -0,0 +1,60 @@
+/* $MirOS: contrib/hosted/fwcf/adler.h,v 1.10 2007/05/07 16:15:56 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006, 2007
+ * Thorsten Glaser <tg@mirbsd.de>
+ * The adler32 algorithm is
+ * Copyright (C) 1995 Mark Adler
+ *
+ * Provided that these terms and disclaimer and all copyright notices
+ * are retained or reproduced in an accompanying document, permission
+ * is granted to deal in this work without restriction, including un-
+ * limited rights to use, publicly perform, distribute, sell, modify,
+ * merge, give away, or sublicence.
+ *
+ * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+ * the utmost extent permitted by applicable law, neither express nor
+ * implied; without malicious intent or gross negligence. In no event
+ * may a licensor, author or contributor be held liable for indirect,
+ * direct, other damage, loss, or other issues arising in any way out
+ * of dealing in the work, even if advised of the possibility of such
+ * damage or existence of a defect, except proven that it results out
+ * of said person's immediate fault when using the work as intended.
+ *-
+ * See also:
+ * contrib/hosted/fwcf/adler.h
+ * src/lib/libc/hash/adh32.c
+ * src/kern/z/adler32s.c
+ * src/kern/z/adler32_i386.S
+ */
+
+#ifndef ADLER_H
+#define ADLER_H "$MirOS: contrib/hosted/fwcf/adler.h,v 1.10 2007/05/07 16:15:56 tg Exp $"
+
+/*
+ * ADLER-32 implementation
+ */
+
+#define ADLER_BASE 65521 /* largest prime smaller than 65536 */
+#define ADLER_NMAX 5552 /* largest n: 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+/* declare everything needed by the adler32 routine */
+#define ADLER_DECL unsigned s1 = 1, s2 = 0, n
+
+/* calculate the adler32 crc of the data pointed to
+ by the 'buffer' argument, size expected in 'len'
+ which is TRASHED; stores the result in s1 and s2 */
+#define ADLER_CALC(buffer) do { \
+ const uint8_t *adler_buf = (const uint8_t *)(buffer); \
+ while (len) { \
+ len -= (n = MIN(len, ADLER_NMAX)); \
+ while (n--) { \
+ s1 += *adler_buf++; \
+ s2 += s1; \
+ } \
+ s1 %= ADLER_BASE; \
+ s2 %= ADLER_BASE; \
+ } \
+ } while (0)
+
+#endif
diff --git a/package/cfgfs/src/bundled/README.LZO b/package/cfgfs/src/bundled/README.LZO
new file mode 100644
index 000000000..2601baed0
--- /dev/null
+++ b/package/cfgfs/src/bundled/README.LZO
@@ -0,0 +1,123 @@
+
+ ============================================================================
+ miniLZO -- mini subset of the LZO real-time data compression library
+ ============================================================================
+
+ Author : Markus Franz Xaver Johannes Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ Version : 2.02
+ Date : 17 Oct 2005
+
+ I've created miniLZO for projects where it is inconvenient to
+ include (or require) the full LZO source code just because you
+ want to add a little bit of data compression to your application.
+
+ miniLZO implements the LZO1X-1 compressor and both the standard and
+ safe LZO1X decompressor. Apart from fast compression it also useful
+ for situations where you want to use pre-compressed data files (which
+ must have been compressed with LZO1X-999).
+
+ miniLZO consists of one C source file and three header files:
+ minilzo.c
+ minilzo.h, lzoconf.h, lzodefs.h
+
+ To use miniLZO just copy these files into your source directory, add
+ minilzo.c to your Makefile and #include minilzo.h from your program.
+ Note: you also must distribute this file (`README.LZO') with your project.
+
+ minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and
+ the sources are about 30 kB when packed with zip - so there's no more
+ excuse that your application doesn't support data compression :-)
+
+ For more information, documentation, example programs and other support
+ files (like Makefiles and build scripts) please download the full LZO
+ package from
+ http://www.oberhumer.com/opensource/lzo/
+
+ Have fun,
+ Markus
+
+
+ P.S. minilzo.c is generated automatically from the LZO sources and
+ therefore functionality is completely identical
+
+
+ Appendix A: building miniLZO
+ ----------------------------
+ miniLZO is written such a way that it should compile and run
+ out-of-the-box on most machines.
+
+ If you are running on a very unusual architecture and lzo_init() fails then
+ you should first recompile with `-DLZO_DEBUG' to see what causes the failure.
+ The most probable case is something like `sizeof(char *) != sizeof(long)'.
+ After identifying the problem you can compile by adding some defines
+ like `-DSIZEOF_CHAR_P=8' to your Makefile.
+
+ The best solution is (of course) using Autoconf - if your project uses
+ Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler
+ flags when compiling minilzo.c. See the LZO distribution for an example
+ how to set up configure.in.
+
+
+ Appendix B: list of public functions available in miniLZO
+ ---------------------------------------------------------
+ Library initialization
+ lzo_init()
+
+ Compression
+ lzo1x_1_compress()
+
+ Decompression
+ lzo1x_decompress()
+ lzo1x_decompress_safe()
+
+ Checksum functions
+ lzo_adler32()
+
+ Version functions
+ lzo_version()
+ lzo_version_string()
+ lzo_version_date()
+
+ Portable (but slow) string functions
+ lzo_memcmp()
+ lzo_memcpy()
+ lzo_memmove()
+ lzo_memset()
+
+
+ Appendix C: suggested macros for `configure.in' when using Autoconf
+ -------------------------------------------------------------------
+ Checks for typedefs and structures
+ AC_CHECK_TYPE(ptrdiff_t,long)
+ AC_TYPE_SIZE_T
+ AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(int)
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(long long)
+ AC_CHECK_SIZEOF(__int64)
+ AC_CHECK_SIZEOF(void *)
+ AC_CHECK_SIZEOF(size_t)
+ AC_CHECK_SIZEOF(ptrdiff_t)
+
+ Checks for compiler characteristics
+ AC_C_CONST
+
+ Checks for library functions
+ AC_CHECK_FUNCS(memcmp memcpy memmove memset)
+
+
+ Appendix D: Copyright
+ ---------------------
+ LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005 Markus Franz Xaver Johannes Oberhumer
+
+ LZO and miniLZO are distributed under the terms of the GNU General
+ Public License (GPL). See the file COPYING.
+
+ Special licenses for commercial and other applications which
+ are not willing to accept the GNU General Public License
+ are available by contacting the author.
+
+
diff --git a/package/cfgfs/src/bundled/lzoconf.h b/package/cfgfs/src/bundled/lzoconf.h
new file mode 100644
index 000000000..7a745ad51
--- /dev/null
+++ b/package/cfgfs/src/bundled/lzoconf.h
@@ -0,0 +1,413 @@
+/* lzoconf.h -- configuration for the LZO real-time data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ The LZO library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+
+#ifndef __LZOCONF_H_INCLUDED
+#define __LZOCONF_H_INCLUDED
+
+#define LZO_VERSION 0x2020
+#define LZO_VERSION_STRING "2.02"
+#define LZO_VERSION_DATE "Oct 17 2005"
+
+/* internal Autoconf configuration file - only used when building LZO */
+#if defined(LZO_HAVE_CONFIG_H)
+# include <config.h>
+#endif
+#include <limits.h>
+#include <stddef.h>
+
+
+/***********************************************************************
+// LZO requires a conforming <limits.h>
+************************************************************************/
+
+#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+# error "invalid CHAR_BIT"
+#endif
+#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
+# error "check your compiler installation"
+#endif
+#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
+# error "your limits.h macros are broken"
+#endif
+
+/* get OS and architecture defines */
+#ifndef __LZODEFS_H_INCLUDED
+#include "lzodefs.h"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+// some core defines
+************************************************************************/
+
+#if !defined(LZO_UINT32_C)
+# if (UINT_MAX < LZO_0xffffffffL)
+# define LZO_UINT32_C(c) c ## UL
+# else
+# define LZO_UINT32_C(c) ((c) + 0U)
+# endif
+#endif
+
+/* memory checkers */
+#if !defined(__LZO_CHECKER)
+# if defined(__BOUNDS_CHECKING_ON)
+# define __LZO_CHECKER 1
+# elif defined(__CHECKER__)
+# define __LZO_CHECKER 1
+# elif defined(__INSURE__)
+# define __LZO_CHECKER 1
+# elif defined(__PURIFY__)
+# define __LZO_CHECKER 1
+# endif
+#endif
+
+
+/***********************************************************************
+// integral and pointer types
+************************************************************************/
+
+/* lzo_uint should match size_t */
+#if !defined(LZO_UINT_MAX)
+# if defined(LZO_ABI_LLP64) /* WIN64 */
+# if defined(LZO_OS_WIN64)
+ typedef unsigned __int64 lzo_uint;
+ typedef __int64 lzo_int;
+# else
+ typedef unsigned long long lzo_uint;
+ typedef long long lzo_int;
+# endif
+# define LZO_UINT_MAX 0xffffffffffffffffull
+# define LZO_INT_MAX 9223372036854775807LL
+# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
+# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */
+ typedef unsigned int lzo_uint;
+ typedef int lzo_int;
+# define LZO_UINT_MAX UINT_MAX
+# define LZO_INT_MAX INT_MAX
+# define LZO_INT_MIN INT_MIN
+# elif (ULONG_MAX >= LZO_0xffffffffL)
+ typedef unsigned long lzo_uint;
+ typedef long lzo_int;
+# define LZO_UINT_MAX ULONG_MAX
+# define LZO_INT_MAX LONG_MAX
+# define LZO_INT_MIN LONG_MIN
+# else
+# error "lzo_uint"
+# endif
+#endif
+
+/* Integral types with 32 bits or more. */
+#if !defined(LZO_UINT32_MAX)
+# if (UINT_MAX >= LZO_0xffffffffL)
+ typedef unsigned int lzo_uint32;
+ typedef int lzo_int32;
+# define LZO_UINT32_MAX UINT_MAX
+# define LZO_INT32_MAX INT_MAX
+# define LZO_INT32_MIN INT_MIN
+# elif (ULONG_MAX >= LZO_0xffffffffL)
+ typedef unsigned long lzo_uint32;
+ typedef long lzo_int32;
+# define LZO_UINT32_MAX ULONG_MAX
+# define LZO_INT32_MAX LONG_MAX
+# define LZO_INT32_MIN LONG_MIN
+# else
+# error "lzo_uint32"
+# endif
+#endif
+
+/* The larger type of lzo_uint and lzo_uint32. */
+#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
+# define lzo_xint lzo_uint
+#else
+# define lzo_xint lzo_uint32
+#endif
+
+/* Memory model that allows to access memory at offsets of lzo_uint. */
+#if !defined(__LZO_MMODEL)
+# if (LZO_UINT_MAX <= UINT_MAX)
+# define __LZO_MMODEL
+# elif defined(LZO_HAVE_MM_HUGE_PTR)
+# define __LZO_MMODEL_HUGE 1
+# define __LZO_MMODEL __huge
+# else
+# define __LZO_MMODEL
+# endif
+#endif
+
+/* no typedef here because of const-pointer issues */
+#define lzo_bytep unsigned char __LZO_MMODEL *
+#define lzo_charp char __LZO_MMODEL *
+#define lzo_voidp void __LZO_MMODEL *
+#define lzo_shortp short __LZO_MMODEL *
+#define lzo_ushortp unsigned short __LZO_MMODEL *
+#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
+#define lzo_int32p lzo_int32 __LZO_MMODEL *
+#define lzo_uintp lzo_uint __LZO_MMODEL *
+#define lzo_intp lzo_int __LZO_MMODEL *
+#define lzo_xintp lzo_xint __LZO_MMODEL *
+#define lzo_voidpp lzo_voidp __LZO_MMODEL *
+#define lzo_bytepp lzo_bytep __LZO_MMODEL *
+/* deprecated - use `lzo_bytep' instead of `lzo_byte *' */
+#define lzo_byte unsigned char __LZO_MMODEL
+
+typedef int lzo_bool;
+
+
+/***********************************************************************
+// function types
+************************************************************************/
+
+/* name mangling */
+#if !defined(__LZO_EXTERN_C)
+# ifdef __cplusplus
+# define __LZO_EXTERN_C extern "C"
+# else
+# define __LZO_EXTERN_C extern
+# endif
+#endif
+
+/* calling convention */
+#if !defined(__LZO_CDECL)
+# define __LZO_CDECL __lzo_cdecl
+#endif
+
+/* DLL export information */
+#if !defined(__LZO_EXPORT1)
+# define __LZO_EXPORT1
+#endif
+#if !defined(__LZO_EXPORT2)
+# define __LZO_EXPORT2
+#endif
+
+/* __cdecl calling convention for public C and assembly functions */
+#if !defined(LZO_PUBLIC)
+# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
+#endif
+#if !defined(LZO_EXTERN)
+# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
+#endif
+#if !defined(LZO_PRIVATE)
+# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL
+#endif
+
+/* function types */
+typedef int
+(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+typedef int
+(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+typedef int
+(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+typedef int
+(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len );
+
+typedef int
+(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem,
+ const lzo_bytep dict, lzo_uint dict_len );
+
+
+/* Callback interface. Currently only the progress indicator ("nprogress")
+ * is used, but this may change in a future release. */
+
+struct lzo_callback_t;
+typedef struct lzo_callback_t lzo_callback_t;
+#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
+
+/* malloc & free function types */
+typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
+ (lzo_callback_p self, lzo_uint items, lzo_uint size);
+typedef void (__LZO_CDECL *lzo_free_func_t)
+ (lzo_callback_p self, lzo_voidp ptr);
+
+/* a progress indicator callback function */
+typedef void (__LZO_CDECL *lzo_progress_func_t)
+ (lzo_callback_p, lzo_uint, lzo_uint, int);
+
+struct lzo_callback_t
+{
+ /* custom allocators (set to 0 to disable) */
+ lzo_alloc_func_t nalloc; /* [not used right now] */
+ lzo_free_func_t nfree; /* [not used right now] */
+
+ /* a progress indicator callback function (set to 0 to disable) */
+ lzo_progress_func_t nprogress;
+
+ /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress
+ * callbacks points back to this struct, so you are free to store
+ * some extra info in the following variables. */
+ lzo_voidp user1;
+ lzo_xint user2;
+ lzo_xint user3;
+};
+
+
+/***********************************************************************
+// error codes and prototypes
+************************************************************************/
+
+/* Error codes for the compression/decompression functions. Negative
+ * values are errors, positive values will be used for special but
+ * normal events.
+ */
+#define LZO_E_OK 0
+#define LZO_E_ERROR (-1)
+#define LZO_E_OUT_OF_MEMORY (-2) /* [not used right now] */
+#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
+#define LZO_E_INPUT_OVERRUN (-4)
+#define LZO_E_OUTPUT_OVERRUN (-5)
+#define LZO_E_LOOKBEHIND_OVERRUN (-6)
+#define LZO_E_EOF_NOT_FOUND (-7)
+#define LZO_E_INPUT_NOT_CONSUMED (-8)
+#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
+
+
+#ifndef lzo_sizeof_dict_t
+# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
+#endif
+
+/* lzo_init() should be the first function you call.
+ * Check the return code !
+ *
+ * lzo_init() is a macro to allow checking that the library and the
+ * compiler's view of various types are consistent.
+ */
+#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
+ (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
+ (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
+ (int)sizeof(lzo_callback_t))
+LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
+
+/* version functions (useful for shared libraries) */
+LZO_EXTERN(unsigned) lzo_version(void);
+LZO_EXTERN(const char *) lzo_version_string(void);
+LZO_EXTERN(const char *) lzo_version_date(void);
+LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
+LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
+
+/* string functions */
+LZO_EXTERN(int)
+lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
+LZO_EXTERN(lzo_voidp)
+lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
+LZO_EXTERN(lzo_voidp)
+lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
+LZO_EXTERN(lzo_voidp)
+lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
+
+/* checksum functions */
+LZO_EXTERN(lzo_uint32)
+lzo_adler32(lzo_uint32 _adler, const lzo_bytep _buf, lzo_uint _len);
+LZO_EXTERN(lzo_uint32)
+lzo_crc32(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len);
+LZO_EXTERN(const lzo_uint32p)
+lzo_get_crc32_table(void);
+
+/* misc. */
+LZO_EXTERN(int) _lzo_config_check(void);
+typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
+typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
+typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
+
+/* align a char pointer on a boundary that is a multiple of `size' */
+LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
+#define LZO_PTR_ALIGN_UP(_ptr,_size) \
+ ((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
+
+
+/***********************************************************************
+// deprecated macros - only for backward compatibility with LZO v1.xx
+************************************************************************/
+
+#if defined(LZO_CFG_COMPAT)
+
+#define __LZOCONF_H 1
+
+#if defined(LZO_ARCH_I086)
+# define __LZO_i386 1
+#elif defined(LZO_ARCH_I386)
+# define __LZO_i386 1
+#endif
+
+#if defined(LZO_OS_DOS16)
+# define __LZO_DOS 1
+# define __LZO_DOS16 1
+#elif defined(LZO_OS_DOS32)
+# define __LZO_DOS 1
+#elif defined(LZO_OS_WIN16)
+# define __LZO_WIN 1
+# define __LZO_WIN16 1
+#elif defined(LZO_OS_WIN32)
+# define __LZO_WIN 1
+#endif
+
+#define __LZO_CMODEL
+#define __LZO_DMODEL
+#define __LZO_ENTRY __LZO_CDECL
+#define LZO_EXTERN_CDECL LZO_EXTERN
+#define LZO_ALIGN LZO_PTR_ALIGN_UP
+
+#define lzo_compress_asm_t lzo_compress_t
+#define lzo_decompress_asm_t lzo_decompress_t
+
+#endif /* LZO_CFG_COMPAT */
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
+
+/* vim:set ts=4 et: */
diff --git a/package/cfgfs/src/bundled/lzodefs.h b/package/cfgfs/src/bundled/lzodefs.h
new file mode 100644
index 000000000..59d18a751
--- /dev/null
+++ b/package/cfgfs/src/bundled/lzodefs.h
@@ -0,0 +1,1545 @@
+/* lzodefs.h -- architecture, OS and compiler specific defines
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ The LZO library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+
+#ifndef __LZODEFS_H_INCLUDED
+#define __LZODEFS_H_INCLUDED 1
+
+#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
+# define __CYGWIN__ __CYGWIN32__
+#endif
+#if defined(__IBMCPP__) && !defined(__IBMC__)
+# define __IBMC__ __IBMCPP__
+#endif
+#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
+# define __INTEL_COMPILER __ICL
+#endif
+#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
+# define _ALL_SOURCE 1
+#endif
+#if defined(__mips__) && defined(__R5900__)
+# if !defined(__LONG_MAX__)
+# define __LONG_MAX__ 9223372036854775807L
+# endif
+#endif
+#if defined(__INTEL_COMPILER) && defined(__linux__)
+# pragma warning(disable: 193)
+#endif
+#if defined(__KEIL__) && defined(__C166__)
+# pragma warning disable = 322
+#elif 0 && defined(__C251__)
+# pragma warning disable = 322
+#endif
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if (_MSC_VER >= 1300)
+# pragma warning(disable: 4668)
+# endif
+#endif
+#if 0 && defined(__WATCOMC__)
+# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
+# pragma warning 203 9
+# endif
+#endif
+#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
+# pragma option -h
+#endif
+#if 0
+#define LZO_0xffffL 0xfffful
+#define LZO_0xffffffffL 0xfffffffful
+#else
+#define LZO_0xffffL 65535ul
+#define LZO_0xffffffffL 4294967295ul
+#endif
+#if (LZO_0xffffL == LZO_0xffffffffL)
+# error "your preprocessor is broken 1"
+#endif
+#if (16ul * 16384ul != 262144ul)
+# error "your preprocessor is broken 2"
+#endif
+#if 0
+#if (32767 >= 4294967295ul)
+# error "your preprocessor is broken 3"
+#endif
+#if (65535u >= 4294967295ul)
+# error "your preprocessor is broken 4"
+#endif
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
+# if !defined(MSDOS)
+# define MSDOS 1
+# endif
+# if !defined(_MSDOS)
+# define _MSDOS 1
+# endif
+#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX)
+# if (__VERSION == 520) && (MB_LEN_MAX == 1)
+# if !defined(__AZTEC_C__)
+# define __AZTEC_C__ __VERSION
+# endif
+# if !defined(__DOS__)
+# define __DOS__ 1
+# endif
+# endif
+#endif
+#endif
+#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL)
+# define ptrdiff_t long
+# define _PTRDIFF_T_DEFINED
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+# if defined(__AZTEC_C__) && defined(__DOS__)
+# define __LZO_RENAME_A 1
+# elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define __LZO_RENAME_A 1
+# elif (_MSC_VER < 700)
+# define __LZO_RENAME_B 1
+# endif
+# elif defined(__TSC__) && defined(__OS2__)
+# define __LZO_RENAME_A 1
+# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
+# define __LZO_RENAME_A 1
+# elif defined(__PACIFIC__) && defined(DOS)
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# endif
+# if defined(__LZO_RENAME_A)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# elif defined(__LZO_RENAME_B)
+# if !defined(__cdecl)
+# define __cdecl _cdecl
+# endif
+# if !defined(__far)
+# define __far _far
+# endif
+# if !defined(__huge)
+# define __huge _huge
+# endif
+# if !defined(__near)
+# define __near _near
+# endif
+# if !defined(__pascal)
+# define __pascal _pascal
+# endif
+# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# endif
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__AZTEC_C__) && defined(__DOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+#elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# endif
+# if (_MSC_VER < 700)
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# define LZO_BROKEN_SIZEOF 1
+# endif
+#elif defined(__PACIFIC__) && defined(DOS)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#elif defined(__TURBOC__) && defined(__MSDOS__)
+# if (__TURBOC__ < 0x0150)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# endif
+# if (__TURBOC__ < 0x0200)
+# define LZO_BROKEN_SIZEOF 1
+# endif
+# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# endif
+#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_SIZEOF 1
+#endif
+#endif
+#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#endif
+#define LZO_CPP_STRINGIZE(x) #x
+#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x)
+#define LZO_CPP_CONCAT2(a,b) a ## b
+#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b)
+#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c)
+#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d)
+#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e)
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o))
+#if 1 && defined(__cplusplus)
+# if !defined(__STDC_CONSTANT_MACROS)
+# define __STDC_CONSTANT_MACROS 1
+# endif
+# if !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS 1
+# endif
+#endif
+#if defined(__cplusplus)
+# define LZO_EXTERN_C extern "C"
+#else
+# define LZO_EXTERN_C extern
+#endif
+#if !defined(__LZO_OS_OVERRIDE)
+#if defined(LZO_OS_FREESTANDING)
+# define LZO_INFO_OS "freestanding"
+#elif defined(LZO_OS_EMBEDDED)
+# define LZO_INFO_OS "embedded"
+#elif defined(__CYGWIN__) && defined(__GNUC__)
+# define LZO_OS_CYGWIN 1
+# define LZO_INFO_OS "cygwin"
+#elif defined(__EMX__) && defined(__GNUC__)
+# define LZO_OS_EMX 1
+# define LZO_INFO_OS "emx"
+#elif defined(__BEOS__)
+# define LZO_OS_BEOS 1
+# define LZO_INFO_OS "beos"
+#elif defined(__Lynx__)
+# define LZO_OS_LYNXOS 1
+# define LZO_INFO_OS "lynxos"
+#elif defined(__OS400__)
+# define LZO_OS_OS400 1
+# define LZO_INFO_OS "os400"
+#elif defined(__QNX__)
+# define LZO_OS_QNX 1
+# define LZO_INFO_OS "qnx"
+#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__BORLANDC__) && defined(__DPMI16__)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+#elif defined(__ZTC__) && defined(DOS386)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__OS2__) || defined(__OS2V2__)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_OS216 1
+# define LZO_INFO_OS "os216"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_OS2 1
+# define LZO_INFO_OS "os2"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
+# define LZO_OS_WIN64 1
+# define LZO_INFO_OS "win64"
+#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__MWERKS__) && defined(__INTEL__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_WIN16 1
+# define LZO_INFO_OS "win16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WATCOMC__)
+# if defined(__NT__) && (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif defined(__NT__) && (__WATCOMC__ < 1100)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# else
+# error "please specify a target using the -bt compiler option"
+# endif
+#elif defined(__palmos__)
+# define LZO_OS_PALMOS 1
+# define LZO_INFO_OS "palmos"
+#elif defined(__TOS__) || defined(__atarist__)
+# define LZO_OS_TOS 1
+# define LZO_INFO_OS "tos"
+#elif defined(macintosh) && !defined(__ppc__)
+# define LZO_OS_MACCLASSIC 1
+# define LZO_INFO_OS "macclassic"
+#elif defined(__VMS)
+# define LZO_OS_VMS 1
+# define LZO_INFO_OS "vms"
+#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PS2 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "ps2"
+#elif (defined(__mips__) && defined(__psp__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PSP 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "psp"
+#else
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+#endif
+#if (LZO_OS_POSIX)
+# if defined(_AIX) || defined(__AIX__) || defined(__aix__)
+# define LZO_OS_POSIX_AIX 1
+# define LZO_INFO_OS_POSIX "aix"
+# elif defined(__FreeBSD__)
+# define LZO_OS_POSIX_FREEBSD 1
+# define LZO_INFO_OS_POSIX "freebsd"
+# elif defined(__hpux__) || defined(__hpux)
+# define LZO_OS_POSIX_HPUX 1
+# define LZO_INFO_OS_POSIX "hpux"
+# elif defined(__INTERIX)
+# define LZO_OS_POSIX_INTERIX 1
+# define LZO_INFO_OS_POSIX "interix"
+# elif defined(__IRIX__) || defined(__irix__)
+# define LZO_OS_POSIX_IRIX 1
+# define LZO_INFO_OS_POSIX "irix"
+# elif defined(__linux__) || defined(__linux)
+# define LZO_OS_POSIX_LINUX 1
+# define LZO_INFO_OS_POSIX "linux"
+# elif defined(__APPLE__) || defined(__MACOS__)
+# define LZO_OS_POSIX_MACOSX 1
+# define LZO_INFO_OS_POSIX "macosx"
+# elif defined(__NetBSD__)
+# define LZO_OS_POSIX_NETBSD 1
+# define LZO_INFO_OS_POSIX "netbsd"
+# elif defined(__OpenBSD__)
+# define LZO_OS_POSIX_OPENBSD 1
+# define LZO_INFO_OS_POSIX "openbsd"
+# elif defined(__osf__)
+# define LZO_OS_POSIX_OSF 1
+# define LZO_INFO_OS_POSIX "osf"
+# elif defined(__solaris__) || defined(__sun)
+# if defined(__SVR4) || defined(__svr4__)
+# define LZO_OS_POSIX_SOLARIS 1
+# define LZO_INFO_OS_POSIX "solaris"
+# else
+# define LZO_OS_POSIX_SUNOS 1
+# define LZO_INFO_OS_POSIX "sunos"
+# endif
+# elif defined(__ultrix__) || defined(__ultrix)
+# define LZO_OS_POSIX_ULTRIX 1
+# define LZO_INFO_OS_POSIX "ultrix"
+# else
+# define LZO_OS_POSIX_UNKNOWN 1
+# define LZO_INFO_OS_POSIX "unknown"
+# endif
+#endif
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (UINT_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
+# define LZO_CC_CILLY 1
+# define LZO_INFO_CC "Cilly"
+# if defined(__CILLY__)
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__CILLY__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
+# define LZO_CC_SDCC 1
+# define LZO_INFO_CC "sdcc"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(SDCC)
+#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
+# define LZO_INFO_CC "Pathscale C"
+# define LZO_INFO_CCVER __PATHSCALE__
+#elif defined(__INTEL_COMPILER)
+# define LZO_CC_INTELC 1
+# define LZO_INFO_CC "Intel C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__INTEL_COMPILER)
+#elif defined(__POCC__) && defined(_WIN32)
+# define LZO_CC_PELLESC 1
+# define LZO_INFO_CC "Pelles C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__POCC__)
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
+# define LZO_CC_LLVM 1
+# define LZO_INFO_CC "llvm-gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__AZTEC_C__)
+# define LZO_CC_AZTECC 1
+# define LZO_INFO_CC "Aztec C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__BORLANDC__)
+# define LZO_CC_BORLANDC 1
+# define LZO_INFO_CC "Borland C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__BORLANDC__)
+#elif defined(__DMC__) && defined(__SC__)
+# define LZO_CC_DMC 1
+# define LZO_INFO_CC "Digital Mars C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__DMC__)
+#elif defined(__DECC)
+# define LZO_CC_DECC 1
+# define LZO_INFO_CC "DEC C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__DECC)
+#elif defined(__HIGHC__)
+# define LZO_CC_HIGHC 1
+# define LZO_INFO_CC "MetaWare High C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__IBMC__)
+# define LZO_CC_IBMC 1
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__IBMC__)
+#elif defined(__KEIL__) && defined(__C166__)
+# define LZO_CC_KEILC 1
+# define LZO_INFO_CC "Keil C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__C166__)
+#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
+# define LZO_CC_LCCWIN32 1
+# define LZO_INFO_CC "lcc-win32"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__LCC__)
+# define LZO_CC_LCC 1
+# define LZO_INFO_CC "lcc"
+# if defined(__LCC_VERSION__)
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__LCC_VERSION__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(_MSC_VER)
+# define LZO_CC_MSC 1
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(_MSC_VER) "." LZO_CPP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(_MSC_VER)
+# endif
+#elif defined(__MWERKS__)
+# define LZO_CC_MWERKS 1
+# define LZO_INFO_CC "Metrowerks C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__MWERKS__)
+#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
+# define LZO_CC_NDPC 1
+# define LZO_INFO_CC "Microway NDP C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PACIFIC__)
+# define LZO_CC_PACIFICC 1
+# define LZO_INFO_CC "Pacific C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
+# define LZO_CC_PGI 1
+# define LZO_INFO_CC "Portland Group PGI C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PUREC__) && defined(__TOS__)
+# define LZO_CC_PUREC 1
+# define LZO_INFO_CC "Pure C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__PUREC__)
+#elif defined(__SC__) && defined(__ZTC__)
+# define LZO_CC_SYMANTECC 1
+# define LZO_INFO_CC "Symantec C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__SC__)
+#elif defined(__SUNPRO_C)
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CC "Sun C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__TINYC__)
+# define LZO_CC_TINYC 1
+# define LZO_INFO_CC "Tiny C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__TINYC__)
+#elif defined(__TSC__)
+# define LZO_CC_TOPSPEEDC 1
+# define LZO_INFO_CC "TopSpeed C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__TSC__)
+#elif defined(__WATCOMC__)
+# define LZO_CC_WATCOMC 1
+# define LZO_INFO_CC "Watcom C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__WATCOMC__)
+#elif defined(__TURBOC__)
+# define LZO_CC_TURBOC 1
+# define LZO_INFO_CC "Turbo C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__TURBOC__)
+#elif defined(__ZTC__)
+# define LZO_CC_ZORTECHC 1
+# define LZO_INFO_CC "Zortech C"
+# if (__ZTC__ == 0x310)
+# define LZO_INFO_CCVER "0x310"
+# else
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__ZTC__)
+# endif
+#else
+# define LZO_CC_UNKNOWN 1
+# define LZO_INFO_CC "unknown"
+# define LZO_INFO_CCVER "unknown"
+#endif
+#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
+# error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE)
+#if defined(LZO_ARCH_GENERIC)
+# define LZO_INFO_ARCH "generic"
+#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086 1
+# define LZO_ARCH_IA16 1
+# define LZO_INFO_ARCH "i086"
+#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+# define LZO_ARCH_AMD64 1
+# define LZO_INFO_ARCH "amd64"
+#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
+# define LZO_ARCH_ARM 1
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+#elif defined(__arm__) || defined(_M_ARM)
+# define LZO_ARCH_ARM 1
+# define LZO_INFO_ARCH "arm"
+#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
+# define LZO_ARCH_AVR 1
+# define LZO_INFO_ARCH "avr"
+#elif defined(__bfin__)
+# define LZO_ARCH_BLACKFIN 1
+# define LZO_INFO_ARCH "blackfin"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__)
+# define LZO_ARCH_C166 1
+# define LZO_INFO_ARCH "c166"
+#elif defined(__cris__)
+# define LZO_ARCH_CRIS 1
+# define LZO_INFO_ARCH "cris"
+#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_ARCH_H8300 1
+# define LZO_INFO_ARCH "h8300"
+#elif defined(__hppa__) || defined(__hppa)
+# define LZO_ARCH_HPPA 1
+# define LZO_INFO_ARCH "hppa"
+#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_CC_ZORTECHC && defined(__I86__))
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
+# define LZO_ARCH_IA64 1
+# define LZO_INFO_ARCH "ia64"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__)
+# define LZO_ARCH_M16C 1
+# define LZO_INFO_ARCH "m16c"
+#elif defined(__m32r__)
+# define LZO_ARCH_M32R 1
+# define LZO_INFO_ARCH "m32r"
+#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(_M_M68K)
+# define LZO_ARCH_M68K 1
+# define LZO_INFO_ARCH "m68k"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__)
+# define LZO_ARCH_MCS251 1
+# define LZO_INFO_ARCH "mcs251"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__)
+# define LZO_ARCH_MCS51 1
+# define LZO_INFO_ARCH "mcs51"
+#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
+# define LZO_ARCH_MIPS 1
+# define LZO_INFO_ARCH "mips"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC)
+# define LZO_ARCH_POWERPC 1
+# define LZO_INFO_ARCH "powerpc"
+#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
+# define LZO_ARCH_S390 1
+# define LZO_INFO_ARCH "s390"
+#elif defined(__sh__) || defined(_M_SH)
+# define LZO_ARCH_SH 1
+# define LZO_INFO_ARCH "sh"
+#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
+# define LZO_ARCH_SPARC 1
+# define LZO_INFO_ARCH "sparc"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
+# define LZO_ARCH_Z80 1
+# define LZO_INFO_ARCH "z80"
+#else
+# define LZO_ARCH_UNKNOWN 1
+# define LZO_INFO_ARCH "unknown"
+#endif
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2)
+# error "FIXME - missing define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
+# error "FIXME - missing WIN32 define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
+# error "FIXME - missing WIN64 define for CPU architecture"
+#endif
+#if (LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#endif
+#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM)
+# error "this should not happen"
+#endif
+#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086)
+# error "this should not happen"
+#endif
+#if (LZO_ARCH_I086)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_ARCH_I386)
+# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if !defined(__LZO_MM_OVERRIDE)
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+#endif
+#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
+# define LZO_MM_TINY 1
+#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
+# define LZO_MM_HUGE 1
+#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
+# define LZO_MM_SMALL 1
+#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
+# define LZO_MM_MEDIUM 1
+#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
+# define LZO_MM_COMPACT 1
+#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
+# define LZO_MM_LARGE 1
+#elif (LZO_CC_AZTECC)
+# if defined(_LARGE_CODE) && defined(_LARGE_DATA)
+# define LZO_MM_LARGE 1
+# elif defined(_LARGE_CODE)
+# define LZO_MM_MEDIUM 1
+# elif defined(_LARGE_DATA)
+# define LZO_MM_COMPACT 1
+# else
+# define LZO_MM_SMALL 1
+# endif
+#elif (LZO_CC_ZORTECHC && defined(__VCM__))
+# define LZO_MM_LARGE 1
+#else
+# error "unknown memory model"
+#endif
+#define LZO_HAVE_MM_HUGE_PTR 1
+#define LZO_HAVE_MM_HUGE_ARRAY 1
+#if (LZO_MM_TINY)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC)
+# undef LZO_HAVE_MM_HUGE_PTR
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_MSC && defined(_QC))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+# if (_MSC_VER < 600)
+# undef LZO_HAVE_MM_HUGE_PTR
+# endif
+#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR)
+# if (LZO_OS_DOS16)
+# error "this should not happen"
+# elif (LZO_CC_ZORTECHC)
+# else
+# error "this should not happen"
+# endif
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16)
+# define LZO_MM_AHSHIFT 12
+#elif (LZO_CC_WATCOMC)
+ extern unsigned char _HShift;
+# define LZO_MM_AHSHIFT ((unsigned) _HShift)
+#else
+# error "FIXME - implement LZO_MM_AHSHIFT"
+#endif
+#ifdef __cplusplus
+}
+#endif
+#elif (LZO_ARCH_C166)
+#if !defined(__MODEL__)
+# error "FIXME - C166 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - C166 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS251)
+#if !defined(__MODEL__)
+# error "FIXME - MCS251 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS251 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS51)
+#if !defined(__MODEL__)
+# error "FIXME - MCS51 __MODEL__"
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS51 __MODEL__"
+#endif
+#else
+# define LZO_MM_FLAT 1
+#endif
+#if (LZO_MM_FLAT)
+# define LZO_INFO_MM "flat"
+#elif (LZO_MM_TINY)
+# define LZO_INFO_MM "tiny"
+#elif (LZO_MM_SMALL)
+# define LZO_INFO_MM "small"
+#elif (LZO_MM_MEDIUM)
+# define LZO_INFO_MM "medium"
+#elif (LZO_MM_COMPACT)
+# define LZO_INFO_MM "compact"
+#elif (LZO_MM_LARGE)
+# define LZO_INFO_MM "large"
+#elif (LZO_MM_HUGE)
+# define LZO_INFO_MM "huge"
+#else
+# error "unknown memory model"
+#endif
+#endif
+#if defined(SIZEOF_SHORT)
+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#endif
+#if defined(SIZEOF_INT)
+# define LZO_SIZEOF_INT (SIZEOF_INT)
+#endif
+#if defined(SIZEOF_LONG)
+# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#endif
+#if defined(SIZEOF_LONG_LONG)
+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#endif
+#if defined(SIZEOF___INT16)
+# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
+#endif
+#if defined(SIZEOF___INT32)
+# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
+#endif
+#if defined(SIZEOF___INT64)
+# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
+#endif
+#if defined(SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#endif
+#if defined(SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#endif
+#if defined(SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#endif
+#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
+#if !defined(LZO_SIZEOF_SHORT)
+# if (USHRT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,7) == 1)
+# define LZO_SIZEOF_SHORT 1
+# elif (__LZO_LSR(USHRT_MAX,15) == 1)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,31) == 1)
+# define LZO_SIZEOF_SHORT 4
+# elif (__LZO_LSR(USHRT_MAX,63) == 1)
+# define LZO_SIZEOF_SHORT 8
+# elif (__LZO_LSR(USHRT_MAX,127) == 1)
+# define LZO_SIZEOF_SHORT 16
+# else
+# error "LZO_SIZEOF_SHORT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_INT)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_INT 2
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,7) == 1)
+# define LZO_SIZEOF_INT 1
+# elif (__LZO_LSR(UINT_MAX,15) == 1)
+# define LZO_SIZEOF_INT 2
+# elif (__LZO_LSR(UINT_MAX,31) == 1)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,63) == 1)
+# define LZO_SIZEOF_INT 8
+# elif (__LZO_LSR(UINT_MAX,127) == 1)
+# define LZO_SIZEOF_INT 16
+# else
+# error "LZO_SIZEOF_INT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG)
+# if (ULONG_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,7) == 1)
+# define LZO_SIZEOF_LONG 1
+# elif (__LZO_LSR(ULONG_MAX,15) == 1)
+# define LZO_SIZEOF_LONG 2
+# elif (__LZO_LSR(ULONG_MAX,31) == 1)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,63) == 1)
+# define LZO_SIZEOF_LONG 8
+# elif (__LZO_LSR(ULONG_MAX,127) == 1)
+# define LZO_SIZEOF_LONG 16
+# else
+# error "LZO_SIZEOF_LONG"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
+# if (LZO_CC_GNUC >= 0x030300ul)
+# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
+# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG
+# endif
+# endif
+# endif
+#endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+#if (LZO_ARCH_I086 && LZO_CC_DMC)
+#elif (LZO_CC_CILLY) && defined(__GNUC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64) && LZO_CC_MSC && (_MSC_VER >= 1400))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_OS_WIN64)
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_DMC))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_WIN32 && (LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_OS400) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2)
+#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define LZO_SIZEOF_LONG_LONG 8
+#endif
+#endif
+#endif
+#if defined(__cplusplus) && defined(LZO_CC_GNUC)
+# if (LZO_CC_GNUC < 0x020800ul)
+# undef LZO_SIZEOF_LONG_LONG
+# endif
+#endif
+#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if (LZO_ARCH_I086)
+# define __LZO_WORDSIZE 2
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+# define LZO_SIZEOF_VOID_P 2
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# error "LZO_MM"
+# endif
+#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
+# define __LZO_WORDSIZE 1
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430)
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 2
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define __LZO_WORDSIZE 2
+# define LZO_SIZEOF_VOID_P 2
+# endif
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4)
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT
+# endif
+#elif (LZO_ARCH_M16C)
+# define __LZO_WORDSIZE 2
+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define LZO_SIZEOF_VOID_P 2
+# endif
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_OS_OS400) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (LZO_OS_OS400)
+# define __LZO_WORDSIZE LZO_SIZEOF_LONG
+# define LZO_SIZEOF_VOID_P 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_VOID_P 8
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#else
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+#endif
+#endif
+#if !defined(LZO_WORDSIZE)
+# if defined(__LZO_WORDSIZE)
+# define LZO_WORDSIZE __LZO_WORDSIZE
+# else
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
+# endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
+#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
+# define LZO_SIZEOF_SIZE_T 2
+#else
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
+#if (LZO_ARCH_I086)
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE)
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE)
+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# define LZO_SIZEOF_PTRDIFF_T 4
+# else
+# define LZO_SIZEOF_PTRDIFF_T 2
+# endif
+# else
+# error "LZO_MM"
+# endif
+#else
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
+#endif
+#endif
+#if !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN) && !defined(LZO_ABI_NEUTRAL_ENDIAN)
+#if (LZO_ARCH_AMD64 || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_M68K || LZO_ARCH_S390)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#endif
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN)
+# error "this should not happen"
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "be"
+#elif defined(LZO_ABI_LITTLE_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "le"
+#elif defined(LZO_ABI_NEUTRAL_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "neutral"
+#endif
+#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_I8LP16 1
+# define LZO_INFO_ABI_PM "i8lp16"
+#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_ILP16 1
+# define LZO_INFO_ABI_PM "ilp16"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_ILP32 1
+# define LZO_INFO_ABI_PM "ilp32"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8)
+# define LZO_ABI_LLP64 1
+# define LZO_INFO_ABI_PM "llp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_LP64 1
+# define LZO_INFO_ABI_PM "lp64"
+#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_ILP64 1
+# define LZO_INFO_ABI_PM "ilp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_IP32L64 1
+# define LZO_INFO_ABI_PM "ip32l64"
+#endif
+#if !defined(__LZO_LIBC_OVERRIDE)
+#if defined(LZO_LIBC_NAKED)
+# define LZO_INFO_LIBC "naked"
+#elif defined(LZO_LIBC_FREESTANDING)
+# define LZO_INFO_LIBC "freestanding"
+#elif defined(LZO_LIBC_MOSTLY_FREESTANDING)
+# define LZO_INFO_LIBC "mfreestanding"
+#elif defined(LZO_LIBC_ISOC90)
+# define LZO_INFO_LIBC "isoc90"
+#elif defined(LZO_LIBC_ISOC99)
+# define LZO_INFO_LIBC "isoc99"
+#elif defined(__dietlibc__)
+# define LZO_LIBC_DIETLIBC 1
+# define LZO_INFO_LIBC "dietlibc"
+#elif defined(_NEWLIB_VERSION)
+# define LZO_LIBC_NEWLIB 1
+# define LZO_INFO_LIBC "newlib"
+#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
+# if defined(__UCLIBC_SUBLEVEL__)
+# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
+# else
+# define LZO_LIBC_UCLIBC 0x00090bL
+# endif
+# define LZO_INFO_LIBC "uclibc"
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
+# define LZO_INFO_LIBC "glibc"
+#elif (LZO_CC_MWERKS) && defined(__MSL__)
+# define LZO_LIBC_MSL __MSL__
+# define LZO_INFO_LIBC "msl"
+#else
+# define LZO_LIBC_DEFAULT 1
+# define LZO_INFO_LIBC "default"
+#endif
+#endif
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#else
+# define __lzo_gnuc_extension__
+#endif
+#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700))
+# define lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define lzo_alignof(e) __alignof(e)
+#endif
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_inline __inline__
+#elif (LZO_CC_DMC)
+# define __lzo_inline __inline
+#elif (LZO_CC_INTELC)
+# define __lzo_inline __inline
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405))
+# define __lzo_inline __inline
+#elif (LZO_CC_MSC && (_MSC_VER >= 900))
+# define __lzo_inline __inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define __lzo_inline inline
+#endif
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#endif
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# if defined(__cplusplus)
+# else
+# define __lzo_noinline __declspec(noinline)
+# endif
+#endif
+#if (defined(__lzo_forceinline) || defined(__lzo_noinline)) && !defined(__lzo_inline)
+# error "this should not happen"
+#endif
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && (LZO_OS_POSIX))
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#endif
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#if defined(__lzo_destructor) && !defined(__lzo_constructor)
+# error "this should not happen"
+#endif
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#else
+# define __lzo_likely(e) (e)
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(LZO_UNUSED)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC)
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNUSED(var) ((void) var)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_KEILC)
+# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];}
+# elif (LZO_CC_PACIFICC)
+# define LZO_UNUSED(var) ((void) sizeof(var))
+# elif (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED(var) ((void) var)
+# else
+# define LZO_UNUSED(var) ((void) &var)
+# endif
+#endif
+#if !defined(LZO_UNUSED_FUNC)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC)
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_LLVM)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_MSC)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_KEILC || LZO_CC_PELLESC)
+# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# elif (LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if (0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)];
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)];
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];}
+# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# else
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];}
+# endif
+#endif
+#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC)
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit
+# define __lzo_cdecl_main __cdecl
+# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_qsort __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_qsort _stdcall
+# else
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# elif (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+# else
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit __cdecl
+# define __lzo_cdecl_main __cdecl
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC)
+# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_sighandler __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_sighandler _stdcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
+# define __lzo_cdecl_sighandler __clrcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
+# if defined(_DLL)
+# define __lzo_cdecl_sighandler _far _cdecl _loadds
+# elif defined(_MT)
+# define __lzo_cdecl_sighandler _far _cdecl
+# else
+# define __lzo_cdecl_sighandler _cdecl
+# endif
+# else
+# define __lzo_cdecl_sighandler __cdecl
+# endif
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# define __lzo_cdecl cdecl
+#endif
+#if !defined(__lzo_cdecl)
+# define __lzo_cdecl
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
+# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul)))
+# else
+# define LZO_HAVE_WINDOWS_H 1
+# endif
+#endif
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# define LZO_OPT_UNALIGNED64 1
+#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB)
+#elif (LZO_ARCH_ARM)
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_CRIS)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_I386)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_IA64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_PREFER_POSTINC 1
+#elif (LZO_ARCH_M68K)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(__mc68020__) && !defined(__mcoldfire__)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_MIPS)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_POWERPC)
+# define LZO_OPT_PREFER_PREINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_S390)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# if (LZO_SIZEOF_SIZE_T == 8)
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_SH)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+#endif
+#if !defined(LZO_CFG_NO_INLINE_ASM)
+#if defined(LZO_CC_LLVM)
+# define LZO_CFG_NO_INLINE_ASM 1
+#endif
+#endif
+#if !defined(LZO_CFG_NO_UNALIGNED)
+#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_UNALIGNED 1
+#endif
+#endif
+#if defined(LZO_CFG_NO_UNALIGNED)
+# undef LZO_OPT_UNALIGNED16
+# undef LZO_OPT_UNALIGNED32
+# undef LZO_OPT_UNALIGNED64
+#endif
+#if defined(LZO_CFG_NO_INLINE_ASM)
+#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+# define LZO_ASM_SYNTAX_MSC 1
+#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#endif
+#if (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZO_ASM_CLOBBER "ax"
+#elif (LZO_CC_INTELC)
+# define __LZO_ASM_CLOBBER "memory"
+#else
+# define __LZO_ASM_CLOBBER "cc", "memory"
+#endif
+#endif
+#if defined(__LZO_INFOSTR_MM)
+#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM))
+# define __LZO_INFOSTR_MM ""
+#elif defined(LZO_INFO_MM)
+# define __LZO_INFOSTR_MM "." LZO_INFO_MM
+#else
+# define __LZO_INFOSTR_MM ""
+#endif
+#if defined(__LZO_INFOSTR_PM)
+#elif defined(LZO_INFO_ABI_PM)
+# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM
+#else
+# define __LZO_INFOSTR_PM ""
+#endif
+#if defined(__LZO_INFOSTR_ENDIAN)
+#elif defined(LZO_INFO_ABI_ENDIAN)
+# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN
+#else
+# define __LZO_INFOSTR_ENDIAN ""
+#endif
+#if defined(__LZO_INFOSTR_OSNAME)
+#elif defined(LZO_INFO_OS_CONSOLE)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE
+#elif defined(LZO_INFO_OS_POSIX)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX
+#else
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS
+#endif
+#if defined(__LZO_INFOSTR_LIBC)
+#elif defined(LZO_INFO_LIBC)
+# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC
+#else
+# define __LZO_INFOSTR_LIBC ""
+#endif
+#if defined(__LZO_INFOSTR_CCVER)
+#elif defined(LZO_INFO_CCVER)
+# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER
+#else
+# define __LZO_INFOSTR_CCVER ""
+#endif
+#define LZO_INFO_STRING \
+ LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \
+ " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER
+
+#endif /* already included */
+
+/* vim:set ts=4 et: */
diff --git a/package/cfgfs/src/bundled/minilzo.c b/package/cfgfs/src/bundled/minilzo.c
new file mode 100644
index 000000000..b21fcf39c
--- /dev/null
+++ b/package/cfgfs/src/bundled/minilzo.c
@@ -0,0 +1,3826 @@
+/* minilzo.c -- mini subset of the LZO real-time data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ The LZO library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+/*
+ * NOTE:
+ * the full LZO package can be found at
+ * http://www.oberhumer.com/opensource/lzo/
+ */
+
+#define __LZO_IN_MINILZO
+#define LZO_BUILD
+
+#if defined(LZO_CFG_FREESTANDING)
+# undef MINILZO_HAVE_CONFIG_H
+# define LZO_LIBC_FREESTANDING 1
+# define LZO_OS_FREESTANDING 1
+#endif
+
+#ifdef MINILZO_HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <limits.h>
+#include <stddef.h>
+#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS)
+
+#ifndef __LZODEFS_H_INCLUDED
+#define __LZODEFS_H_INCLUDED 1
+
+#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
+# define __CYGWIN__ __CYGWIN32__
+#endif
+#if defined(__IBMCPP__) && !defined(__IBMC__)
+# define __IBMC__ __IBMCPP__
+#endif
+#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
+# define __INTEL_COMPILER __ICL
+#endif
+#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
+# define _ALL_SOURCE 1
+#endif
+#if defined(__mips__) && defined(__R5900__)
+# if !defined(__LONG_MAX__)
+# define __LONG_MAX__ 9223372036854775807L
+# endif
+#endif
+#if defined(__INTEL_COMPILER) && defined(__linux__)
+# pragma warning(disable: 193)
+#endif
+#if defined(__KEIL__) && defined(__C166__)
+# pragma warning disable = 322
+#elif 0 && defined(__C251__)
+# pragma warning disable = 322
+#endif
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+# if (_MSC_VER >= 1300)
+# pragma warning(disable: 4668)
+# endif
+#endif
+#if 0 && defined(__WATCOMC__)
+# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
+# pragma warning 203 9
+# endif
+#endif
+#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
+# pragma option -h
+#endif
+#if 0
+#define LZO_0xffffL 0xfffful
+#define LZO_0xffffffffL 0xfffffffful
+#else
+#define LZO_0xffffL 65535ul
+#define LZO_0xffffffffL 4294967295ul
+#endif
+#if (LZO_0xffffL == LZO_0xffffffffL)
+# error "your preprocessor is broken 1"
+#endif
+#if (16ul * 16384ul != 262144ul)
+# error "your preprocessor is broken 2"
+#endif
+#if 0
+#if (32767 >= 4294967295ul)
+# error "your preprocessor is broken 3"
+#endif
+#if (65535u >= 4294967295ul)
+# error "your preprocessor is broken 4"
+#endif
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
+# if !defined(MSDOS)
+# define MSDOS 1
+# endif
+# if !defined(_MSDOS)
+# define _MSDOS 1
+# endif
+#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX)
+# if (__VERSION == 520) && (MB_LEN_MAX == 1)
+# if !defined(__AZTEC_C__)
+# define __AZTEC_C__ __VERSION
+# endif
+# if !defined(__DOS__)
+# define __DOS__ 1
+# endif
+# endif
+#endif
+#endif
+#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL)
+# define ptrdiff_t long
+# define _PTRDIFF_T_DEFINED
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+# if defined(__AZTEC_C__) && defined(__DOS__)
+# define __LZO_RENAME_A 1
+# elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define __LZO_RENAME_A 1
+# elif (_MSC_VER < 700)
+# define __LZO_RENAME_B 1
+# endif
+# elif defined(__TSC__) && defined(__OS2__)
+# define __LZO_RENAME_A 1
+# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410)
+# define __LZO_RENAME_A 1
+# elif defined(__PACIFIC__) && defined(DOS)
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# endif
+# if defined(__LZO_RENAME_A)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__far)
+# define __far far
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# if !defined(__near)
+# define __near near
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# if !defined(__huge)
+# define __huge huge
+# endif
+# elif defined(__LZO_RENAME_B)
+# if !defined(__cdecl)
+# define __cdecl _cdecl
+# endif
+# if !defined(__far)
+# define __far _far
+# endif
+# if !defined(__huge)
+# define __huge _huge
+# endif
+# if !defined(__near)
+# define __near _near
+# endif
+# if !defined(__pascal)
+# define __pascal _pascal
+# endif
+# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# if !defined(__cdecl)
+# define __cdecl cdecl
+# endif
+# if !defined(__pascal)
+# define __pascal pascal
+# endif
+# endif
+# undef __LZO_RENAME_A
+# undef __LZO_RENAME_B
+#endif
+#if (UINT_MAX == LZO_0xffffL)
+#if defined(__AZTEC_C__) && defined(__DOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+#elif defined(_MSC_VER) && defined(MSDOS)
+# if (_MSC_VER < 600)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# endif
+# if (_MSC_VER < 700)
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# define LZO_BROKEN_SIZEOF 1
+# endif
+#elif defined(__PACIFIC__) && defined(DOS)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#elif defined(__TURBOC__) && defined(__MSDOS__)
+# if (__TURBOC__ < 0x0150)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+# define LZO_BROKEN_INTEGRAL_PROMOTION 1
+# endif
+# if (__TURBOC__ < 0x0200)
+# define LZO_BROKEN_SIZEOF 1
+# endif
+# if (__TURBOC__ < 0x0400) && defined(__cplusplus)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# endif
+#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__)
+# define LZO_BROKEN_CDECL_ALT_SYNTAX 1
+# define LZO_BROKEN_SIZEOF 1
+#endif
+#endif
+#if defined(__WATCOMC__) && (__WATCOMC__ < 900)
+# define LZO_BROKEN_INTEGRAL_CONSTANTS 1
+#endif
+#define LZO_CPP_STRINGIZE(x) #x
+#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x)
+#define LZO_CPP_CONCAT2(a,b) a ## b
+#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c
+#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d
+#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e
+#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b)
+#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c)
+#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d)
+#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e)
+#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o))
+#if 1 && defined(__cplusplus)
+# if !defined(__STDC_CONSTANT_MACROS)
+# define __STDC_CONSTANT_MACROS 1
+# endif
+# if !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS 1
+# endif
+#endif
+#if defined(__cplusplus)
+# define LZO_EXTERN_C extern "C"
+#else
+# define LZO_EXTERN_C extern
+#endif
+#if !defined(__LZO_OS_OVERRIDE)
+#if defined(LZO_OS_FREESTANDING)
+# define LZO_INFO_OS "freestanding"
+#elif defined(LZO_OS_EMBEDDED)
+# define LZO_INFO_OS "embedded"
+#elif defined(__CYGWIN__) && defined(__GNUC__)
+# define LZO_OS_CYGWIN 1
+# define LZO_INFO_OS "cygwin"
+#elif defined(__EMX__) && defined(__GNUC__)
+# define LZO_OS_EMX 1
+# define LZO_INFO_OS "emx"
+#elif defined(__BEOS__)
+# define LZO_OS_BEOS 1
+# define LZO_INFO_OS "beos"
+#elif defined(__Lynx__)
+# define LZO_OS_LYNXOS 1
+# define LZO_INFO_OS "lynxos"
+#elif defined(__OS400__)
+# define LZO_OS_OS400 1
+# define LZO_INFO_OS "os400"
+#elif defined(__QNX__)
+# define LZO_OS_QNX 1
+# define LZO_INFO_OS "qnx"
+#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__BORLANDC__) && defined(__DPMI16__)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+#elif defined(__ZTC__) && defined(DOS386)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+#elif defined(__OS2__) || defined(__OS2V2__)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_OS216 1
+# define LZO_INFO_OS "os216"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_OS2 1
+# define LZO_INFO_OS "os2"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64)
+# define LZO_OS_WIN64 1
+# define LZO_INFO_OS "win64"
+#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__MWERKS__) && defined(__INTEL__)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_WIN16 1
+# define LZO_INFO_OS "win16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS))
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_OS_DOS32 1
+# define LZO_INFO_OS "dos32"
+# else
+# error "check your limits.h header"
+# endif
+#elif defined(__WATCOMC__)
+# if defined(__NT__) && (UINT_MAX == LZO_0xffffL)
+# define LZO_OS_DOS16 1
+# define LZO_INFO_OS "dos16"
+# elif defined(__NT__) && (__WATCOMC__ < 1100)
+# define LZO_OS_WIN32 1
+# define LZO_INFO_OS "win32"
+# else
+# error "please specify a target using the -bt compiler option"
+# endif
+#elif defined(__palmos__)
+# define LZO_OS_PALMOS 1
+# define LZO_INFO_OS "palmos"
+#elif defined(__TOS__) || defined(__atarist__)
+# define LZO_OS_TOS 1
+# define LZO_INFO_OS "tos"
+#elif defined(macintosh) && !defined(__ppc__)
+# define LZO_OS_MACCLASSIC 1
+# define LZO_INFO_OS "macclassic"
+#elif defined(__VMS)
+# define LZO_OS_VMS 1
+# define LZO_INFO_OS "vms"
+#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PS2 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "ps2"
+#elif (defined(__mips__) && defined(__psp__))
+# define LZO_OS_CONSOLE 1
+# define LZO_OS_CONSOLE_PSP 1
+# define LZO_INFO_OS "console"
+# define LZO_INFO_OS_CONSOLE "psp"
+#else
+# define LZO_OS_POSIX 1
+# define LZO_INFO_OS "posix"
+#endif
+#if (LZO_OS_POSIX)
+# if defined(_AIX) || defined(__AIX__) || defined(__aix__)
+# define LZO_OS_POSIX_AIX 1
+# define LZO_INFO_OS_POSIX "aix"
+# elif defined(__FreeBSD__)
+# define LZO_OS_POSIX_FREEBSD 1
+# define LZO_INFO_OS_POSIX "freebsd"
+# elif defined(__hpux__) || defined(__hpux)
+# define LZO_OS_POSIX_HPUX 1
+# define LZO_INFO_OS_POSIX "hpux"
+# elif defined(__INTERIX)
+# define LZO_OS_POSIX_INTERIX 1
+# define LZO_INFO_OS_POSIX "interix"
+# elif defined(__IRIX__) || defined(__irix__)
+# define LZO_OS_POSIX_IRIX 1
+# define LZO_INFO_OS_POSIX "irix"
+# elif defined(__linux__) || defined(__linux)
+# define LZO_OS_POSIX_LINUX 1
+# define LZO_INFO_OS_POSIX "linux"
+# elif defined(__APPLE__) || defined(__MACOS__)
+# define LZO_OS_POSIX_MACOSX 1
+# define LZO_INFO_OS_POSIX "macosx"
+# elif defined(__NetBSD__)
+# define LZO_OS_POSIX_NETBSD 1
+# define LZO_INFO_OS_POSIX "netbsd"
+# elif defined(__OpenBSD__)
+# define LZO_OS_POSIX_OPENBSD 1
+# define LZO_INFO_OS_POSIX "openbsd"
+# elif defined(__osf__)
+# define LZO_OS_POSIX_OSF 1
+# define LZO_INFO_OS_POSIX "osf"
+# elif defined(__solaris__) || defined(__sun)
+# if defined(__SVR4) || defined(__svr4__)
+# define LZO_OS_POSIX_SOLARIS 1
+# define LZO_INFO_OS_POSIX "solaris"
+# else
+# define LZO_OS_POSIX_SUNOS 1
+# define LZO_INFO_OS_POSIX "sunos"
+# endif
+# elif defined(__ultrix__) || defined(__ultrix)
+# define LZO_OS_POSIX_ULTRIX 1
+# define LZO_INFO_OS_POSIX "ultrix"
+# else
+# define LZO_OS_POSIX_UNKNOWN 1
+# define LZO_INFO_OS_POSIX "unknown"
+# endif
+#endif
+#endif
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (UINT_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
+# define LZO_CC_CILLY 1
+# define LZO_INFO_CC "Cilly"
+# if defined(__CILLY__)
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__CILLY__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__)
+# define LZO_CC_SDCC 1
+# define LZO_INFO_CC "sdcc"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(SDCC)
+#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
+# define LZO_INFO_CC "Pathscale C"
+# define LZO_INFO_CCVER __PATHSCALE__
+#elif defined(__INTEL_COMPILER)
+# define LZO_CC_INTELC 1
+# define LZO_INFO_CC "Intel C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__INTEL_COMPILER)
+#elif defined(__POCC__) && defined(_WIN32)
+# define LZO_CC_PELLESC 1
+# define LZO_INFO_CC "Pelles C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__POCC__)
+#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
+# define LZO_CC_LLVM 1
+# define LZO_INFO_CC "llvm-gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__GNUC__) && defined(__VERSION__)
+# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+# elif defined(__GNUC_MINOR__)
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+# else
+# define LZO_CC_GNUC (__GNUC__ * 0x10000L)
+# endif
+# define LZO_INFO_CC "gcc"
+# define LZO_INFO_CCVER __VERSION__
+#elif defined(__AZTEC_C__)
+# define LZO_CC_AZTECC 1
+# define LZO_INFO_CC "Aztec C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__AZTEC_C__)
+#elif defined(__BORLANDC__)
+# define LZO_CC_BORLANDC 1
+# define LZO_INFO_CC "Borland C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__BORLANDC__)
+#elif defined(__DMC__) && defined(__SC__)
+# define LZO_CC_DMC 1
+# define LZO_INFO_CC "Digital Mars C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__DMC__)
+#elif defined(__DECC)
+# define LZO_CC_DECC 1
+# define LZO_INFO_CC "DEC C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__DECC)
+#elif defined(__HIGHC__)
+# define LZO_CC_HIGHC 1
+# define LZO_INFO_CC "MetaWare High C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__IBMC__)
+# define LZO_CC_IBMC 1
+# define LZO_INFO_CC "IBM C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__IBMC__)
+#elif defined(__KEIL__) && defined(__C166__)
+# define LZO_CC_KEILC 1
+# define LZO_INFO_CC "Keil C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__C166__)
+#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL)
+# define LZO_CC_LCCWIN32 1
+# define LZO_INFO_CC "lcc-win32"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__LCC__)
+# define LZO_CC_LCC 1
+# define LZO_INFO_CC "lcc"
+# if defined(__LCC_VERSION__)
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__LCC_VERSION__)
+# else
+# define LZO_INFO_CCVER "unknown"
+# endif
+#elif defined(_MSC_VER)
+# define LZO_CC_MSC 1
+# define LZO_INFO_CC "Microsoft C"
+# if defined(_MSC_FULL_VER)
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(_MSC_VER) "." LZO_CPP_MACRO_EXPAND(_MSC_FULL_VER)
+# else
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(_MSC_VER)
+# endif
+#elif defined(__MWERKS__)
+# define LZO_CC_MWERKS 1
+# define LZO_INFO_CC "Metrowerks C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__MWERKS__)
+#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
+# define LZO_CC_NDPC 1
+# define LZO_INFO_CC "Microway NDP C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PACIFIC__)
+# define LZO_CC_PACIFICC 1
+# define LZO_INFO_CC "Pacific C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__PACIFIC__)
+#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
+# define LZO_CC_PGI 1
+# define LZO_INFO_CC "Portland Group PGI C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__PUREC__) && defined(__TOS__)
+# define LZO_CC_PUREC 1
+# define LZO_INFO_CC "Pure C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__PUREC__)
+#elif defined(__SC__) && defined(__ZTC__)
+# define LZO_CC_SYMANTECC 1
+# define LZO_INFO_CC "Symantec C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__SC__)
+#elif defined(__SUNPRO_C)
+# define LZO_CC_SUNPROC 1
+# define LZO_INFO_CC "Sun C"
+# define LZO_INFO_CCVER "unknown"
+#elif defined(__TINYC__)
+# define LZO_CC_TINYC 1
+# define LZO_INFO_CC "Tiny C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__TINYC__)
+#elif defined(__TSC__)
+# define LZO_CC_TOPSPEEDC 1
+# define LZO_INFO_CC "TopSpeed C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__TSC__)
+#elif defined(__WATCOMC__)
+# define LZO_CC_WATCOMC 1
+# define LZO_INFO_CC "Watcom C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__WATCOMC__)
+#elif defined(__TURBOC__)
+# define LZO_CC_TURBOC 1
+# define LZO_INFO_CC "Turbo C"
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__TURBOC__)
+#elif defined(__ZTC__)
+# define LZO_CC_ZORTECHC 1
+# define LZO_INFO_CC "Zortech C"
+# if (__ZTC__ == 0x310)
+# define LZO_INFO_CCVER "0x310"
+# else
+# define LZO_INFO_CCVER LZO_CPP_MACRO_EXPAND(__ZTC__)
+# endif
+#else
+# define LZO_CC_UNKNOWN 1
+# define LZO_INFO_CC "unknown"
+# define LZO_INFO_CCVER "unknown"
+#endif
+#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
+# error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
+#endif
+#if !defined(__LZO_ARCH_OVERRIDE)
+#if defined(LZO_ARCH_GENERIC)
+# define LZO_INFO_ARCH "generic"
+#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086 1
+# define LZO_ARCH_IA16 1
+# define LZO_INFO_ARCH "i086"
+#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+# define LZO_ARCH_ALPHA 1
+# define LZO_INFO_ARCH "alpha"
+#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+# define LZO_ARCH_AMD64 1
+# define LZO_INFO_ARCH "amd64"
+#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
+# define LZO_ARCH_ARM 1
+# define LZO_ARCH_ARM_THUMB 1
+# define LZO_INFO_ARCH "arm_thumb"
+#elif defined(__arm__) || defined(_M_ARM)
+# define LZO_ARCH_ARM 1
+# define LZO_INFO_ARCH "arm"
+#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__)
+# define LZO_ARCH_AVR 1
+# define LZO_INFO_ARCH "avr"
+#elif defined(__bfin__)
+# define LZO_ARCH_BLACKFIN 1
+# define LZO_INFO_ARCH "blackfin"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__)
+# define LZO_ARCH_C166 1
+# define LZO_INFO_ARCH "c166"
+#elif defined(__cris__)
+# define LZO_ARCH_CRIS 1
+# define LZO_INFO_ARCH "cris"
+#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define LZO_ARCH_H8300 1
+# define LZO_INFO_ARCH "h8300"
+#elif defined(__hppa__) || defined(__hppa)
+# define LZO_ARCH_HPPA 1
+# define LZO_INFO_ARCH "hppa"
+#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_CC_ZORTECHC && defined(__I86__))
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386)
+# define LZO_ARCH_I386 1
+# define LZO_ARCH_IA32 1
+# define LZO_INFO_ARCH "i386"
+#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
+# define LZO_ARCH_IA64 1
+# define LZO_INFO_ARCH "ia64"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__)
+# define LZO_ARCH_M16C 1
+# define LZO_INFO_ARCH "m16c"
+#elif defined(__m32r__)
+# define LZO_ARCH_M32R 1
+# define LZO_INFO_ARCH "m32r"
+#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(_M_M68K)
+# define LZO_ARCH_M68K 1
+# define LZO_INFO_ARCH "m68k"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__)
+# define LZO_ARCH_MCS251 1
+# define LZO_INFO_ARCH "mcs251"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__)
+# define LZO_ARCH_MCS51 1
+# define LZO_INFO_ARCH "mcs51"
+#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000)
+# define LZO_ARCH_MIPS 1
+# define LZO_INFO_ARCH "mips"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__)
+# define LZO_ARCH_MSP430 1
+# define LZO_INFO_ARCH "msp430"
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC)
+# define LZO_ARCH_POWERPC 1
+# define LZO_INFO_ARCH "powerpc"
+#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x)
+# define LZO_ARCH_S390 1
+# define LZO_INFO_ARCH "s390"
+#elif defined(__sh__) || defined(_M_SH)
+# define LZO_ARCH_SH 1
+# define LZO_INFO_ARCH "sh"
+#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8)
+# define LZO_ARCH_SPARC 1
+# define LZO_INFO_ARCH "sparc"
+#elif (UINT_MAX == LZO_0xffffL) && defined(__z80)
+# define LZO_ARCH_Z80 1
+# define LZO_INFO_ARCH "z80"
+#else
+# define LZO_ARCH_UNKNOWN 1
+# define LZO_INFO_ARCH "unknown"
+#endif
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2)
+# error "FIXME - missing define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
+# error "FIXME - missing WIN32 define for CPU architecture"
+#endif
+#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
+# error "FIXME - missing WIN64 define for CPU architecture"
+#endif
+#if (LZO_OS_OS216 || LZO_OS_WIN16)
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(BLX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
+# define LZO_ARCH_I086PM 1
+# define LZO_ARCH_IA16PM 1
+#endif
+#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM)
+# error "this should not happen"
+#endif
+#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086)
+# error "this should not happen"
+#endif
+#if (LZO_ARCH_I086)
+# if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if (LZO_ARCH_I386)
+# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
+# error "this should not happen"
+# endif
+# if (ULONG_MAX != LZO_0xffffffffL)
+# error "this should not happen"
+# endif
+#endif
+#if !defined(__LZO_MM_OVERRIDE)
+#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+#if (UINT_MAX != LZO_0xffffL)
+# error "this should not happen"
+#endif
+#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM)
+# define LZO_MM_TINY 1
+#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM)
+# define LZO_MM_HUGE 1
+#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL)
+# define LZO_MM_SMALL 1
+#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM)
+# define LZO_MM_MEDIUM 1
+#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM)
+# define LZO_MM_COMPACT 1
+#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL)
+# define LZO_MM_LARGE 1
+#elif (LZO_CC_AZTECC)
+# if defined(_LARGE_CODE) && defined(_LARGE_DATA)
+# define LZO_MM_LARGE 1
+# elif defined(_LARGE_CODE)
+# define LZO_MM_MEDIUM 1
+# elif defined(_LARGE_DATA)
+# define LZO_MM_COMPACT 1
+# else
+# define LZO_MM_SMALL 1
+# endif
+#elif (LZO_CC_ZORTECHC && defined(__VCM__))
+# define LZO_MM_LARGE 1
+#else
+# error "unknown memory model"
+#endif
+#define LZO_HAVE_MM_HUGE_PTR 1
+#define LZO_HAVE_MM_HUGE_ARRAY 1
+#if (LZO_MM_TINY)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC)
+# undef LZO_HAVE_MM_HUGE_PTR
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#elif (LZO_CC_MSC && defined(_QC))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+# if (_MSC_VER < 600)
+# undef LZO_HAVE_MM_HUGE_PTR
+# endif
+#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295))
+# undef LZO_HAVE_MM_HUGE_ARRAY
+#endif
+#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR)
+# if (LZO_OS_DOS16)
+# error "this should not happen"
+# elif (LZO_CC_ZORTECHC)
+# else
+# error "this should not happen"
+# endif
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC)
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295))
+ extern void __near __cdecl _AHSHIFT(void);
+# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT)
+#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16)
+# define LZO_MM_AHSHIFT 12
+#elif (LZO_CC_WATCOMC)
+ extern unsigned char _HShift;
+# define LZO_MM_AHSHIFT ((unsigned) _HShift)
+#else
+# error "FIXME - implement LZO_MM_AHSHIFT"
+#endif
+#ifdef __cplusplus
+}
+#endif
+#elif (LZO_ARCH_C166)
+#if !defined(__MODEL__)
+# error "FIXME - C166 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - C166 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS251)
+#if !defined(__MODEL__)
+# error "FIXME - MCS251 __MODEL__"
+#elif ((__MODEL__) == 0)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS251 __MODEL__"
+#endif
+#elif (LZO_ARCH_MCS51)
+#if !defined(__MODEL__)
+# error "FIXME - MCS51 __MODEL__"
+#elif ((__MODEL__) == 1)
+# define LZO_MM_SMALL 1
+#elif ((__MODEL__) == 2)
+# define LZO_MM_LARGE 1
+#elif ((__MODEL__) == 3)
+# define LZO_MM_TINY 1
+#elif ((__MODEL__) == 4)
+# define LZO_MM_XTINY 1
+#elif ((__MODEL__) == 5)
+# define LZO_MM_XSMALL 1
+#else
+# error "FIXME - MCS51 __MODEL__"
+#endif
+#else
+# define LZO_MM_FLAT 1
+#endif
+#if (LZO_MM_FLAT)
+# define LZO_INFO_MM "flat"
+#elif (LZO_MM_TINY)
+# define LZO_INFO_MM "tiny"
+#elif (LZO_MM_SMALL)
+# define LZO_INFO_MM "small"
+#elif (LZO_MM_MEDIUM)
+# define LZO_INFO_MM "medium"
+#elif (LZO_MM_COMPACT)
+# define LZO_INFO_MM "compact"
+#elif (LZO_MM_LARGE)
+# define LZO_INFO_MM "large"
+#elif (LZO_MM_HUGE)
+# define LZO_INFO_MM "huge"
+#else
+# error "unknown memory model"
+#endif
+#endif
+#if defined(SIZEOF_SHORT)
+# define LZO_SIZEOF_SHORT (SIZEOF_SHORT)
+#endif
+#if defined(SIZEOF_INT)
+# define LZO_SIZEOF_INT (SIZEOF_INT)
+#endif
+#if defined(SIZEOF_LONG)
+# define LZO_SIZEOF_LONG (SIZEOF_LONG)
+#endif
+#if defined(SIZEOF_LONG_LONG)
+# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG)
+#endif
+#if defined(SIZEOF___INT16)
+# define LZO_SIZEOF___INT16 (SIZEOF___INT16)
+#endif
+#if defined(SIZEOF___INT32)
+# define LZO_SIZEOF___INT32 (SIZEOF___INT32)
+#endif
+#if defined(SIZEOF___INT64)
+# define LZO_SIZEOF___INT64 (SIZEOF___INT64)
+#endif
+#if defined(SIZEOF_VOID_P)
+# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P)
+#endif
+#if defined(SIZEOF_SIZE_T)
+# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T)
+#endif
+#if defined(SIZEOF_PTRDIFF_T)
+# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T)
+#endif
+#define __LZO_LSR(x,b) (((x)+0ul) >> (b))
+#if !defined(LZO_SIZEOF_SHORT)
+# if (USHRT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,7) == 1)
+# define LZO_SIZEOF_SHORT 1
+# elif (__LZO_LSR(USHRT_MAX,15) == 1)
+# define LZO_SIZEOF_SHORT 2
+# elif (__LZO_LSR(USHRT_MAX,31) == 1)
+# define LZO_SIZEOF_SHORT 4
+# elif (__LZO_LSR(USHRT_MAX,63) == 1)
+# define LZO_SIZEOF_SHORT 8
+# elif (__LZO_LSR(USHRT_MAX,127) == 1)
+# define LZO_SIZEOF_SHORT 16
+# else
+# error "LZO_SIZEOF_SHORT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_INT)
+# if (UINT_MAX == LZO_0xffffL)
+# define LZO_SIZEOF_INT 2
+# elif (UINT_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,7) == 1)
+# define LZO_SIZEOF_INT 1
+# elif (__LZO_LSR(UINT_MAX,15) == 1)
+# define LZO_SIZEOF_INT 2
+# elif (__LZO_LSR(UINT_MAX,31) == 1)
+# define LZO_SIZEOF_INT 4
+# elif (__LZO_LSR(UINT_MAX,63) == 1)
+# define LZO_SIZEOF_INT 8
+# elif (__LZO_LSR(UINT_MAX,127) == 1)
+# define LZO_SIZEOF_INT 16
+# else
+# error "LZO_SIZEOF_INT"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG)
+# if (ULONG_MAX == LZO_0xffffffffL)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,7) == 1)
+# define LZO_SIZEOF_LONG 1
+# elif (__LZO_LSR(ULONG_MAX,15) == 1)
+# define LZO_SIZEOF_LONG 2
+# elif (__LZO_LSR(ULONG_MAX,31) == 1)
+# define LZO_SIZEOF_LONG 4
+# elif (__LZO_LSR(ULONG_MAX,63) == 1)
+# define LZO_SIZEOF_LONG 8
+# elif (__LZO_LSR(ULONG_MAX,127) == 1)
+# define LZO_SIZEOF_LONG 16
+# else
+# error "LZO_SIZEOF_LONG"
+# endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__)
+# if (LZO_CC_GNUC >= 0x030300ul)
+# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0)
+# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG
+# endif
+# endif
+# endif
+#endif
+#endif
+#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64)
+#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8)
+#if (LZO_ARCH_I086 && LZO_CC_DMC)
+#elif (LZO_CC_CILLY) && defined(__GNUC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif ((LZO_OS_WIN32 || LZO_OS_WIN64) && LZO_CC_MSC && (_MSC_VER >= 1400))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_OS_WIN64)
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_DMC))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__)))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI))
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_WIN32 && (LZO_CC_MSC))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100)))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64))
+# define LZO_SIZEOF___INT64 8
+#elif (LZO_OS_OS400) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_LONG_LONG 8
+#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2)
+#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define LZO_SIZEOF_LONG_LONG 8
+#endif
+#endif
+#endif
+#if defined(__cplusplus) && defined(LZO_CC_GNUC)
+# if (LZO_CC_GNUC < 0x020800ul)
+# undef LZO_SIZEOF_LONG_LONG
+# endif
+#endif
+#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG)
+# undef LZO_SIZEOF_LONG_LONG
+#endif
+#if !defined(LZO_SIZEOF_VOID_P)
+#if (LZO_ARCH_I086)
+# define __LZO_WORDSIZE 2
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM)
+# define LZO_SIZEOF_VOID_P 2
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# error "LZO_MM"
+# endif
+#elif (LZO_ARCH_AVR || LZO_ARCH_Z80)
+# define __LZO_WORDSIZE 1
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430)
+# define LZO_SIZEOF_VOID_P 2
+#elif (LZO_ARCH_H8300)
+# if defined(__NORMAL_MODE__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 2
+# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__)
+# define __LZO_WORDSIZE 4
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define __LZO_WORDSIZE 2
+# define LZO_SIZEOF_VOID_P 2
+# endif
+# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4)
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT
+# endif
+#elif (LZO_ARCH_M16C)
+# define __LZO_WORDSIZE 2
+# if defined(__m32c_cpu__) || defined(__m32cm_cpu__)
+# define LZO_SIZEOF_VOID_P 4
+# else
+# define LZO_SIZEOF_VOID_P 2
+# endif
+#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 4
+#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64)
+# define __LZO_WORDSIZE 8
+# define LZO_SIZEOF_VOID_P 8
+#elif (LZO_OS_OS400) && defined(__LLP64_IFC__)
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (LZO_OS_OS400)
+# define __LZO_WORDSIZE LZO_SIZEOF_LONG
+# define LZO_SIZEOF_VOID_P 16
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64)
+# define LZO_SIZEOF_VOID_P 8
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG
+#else
+# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG
+#endif
+#endif
+#if !defined(LZO_WORDSIZE)
+# if defined(__LZO_WORDSIZE)
+# define LZO_WORDSIZE __LZO_WORDSIZE
+# else
+# define LZO_WORDSIZE LZO_SIZEOF_VOID_P
+# endif
+#endif
+#if !defined(LZO_SIZEOF_SIZE_T)
+#if (LZO_ARCH_I086 || LZO_ARCH_M16C)
+# define LZO_SIZEOF_SIZE_T 2
+#else
+# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P
+#endif
+#endif
+#if !defined(LZO_SIZEOF_PTRDIFF_T)
+#if (LZO_ARCH_I086)
+# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE)
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P
+# elif (LZO_MM_COMPACT || LZO_MM_LARGE)
+# if (LZO_CC_BORLANDC || LZO_CC_TURBOC)
+# define LZO_SIZEOF_PTRDIFF_T 4
+# else
+# define LZO_SIZEOF_PTRDIFF_T 2
+# endif
+# else
+# error "LZO_MM"
+# endif
+#else
+# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T
+#endif
+#endif
+#if !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN) && !defined(LZO_ABI_NEUTRAL_ENDIAN)
+#if (LZO_ARCH_AMD64 || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif (LZO_ARCH_M68K || LZO_ARCH_S390)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__)
+# define LZO_ABI_BIG_ENDIAN 1
+#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__)
+# define LZO_ABI_LITTLE_ENDIAN 1
+#endif
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN)
+# error "this should not happen"
+#endif
+#if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "be"
+#elif defined(LZO_ABI_LITTLE_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "le"
+#elif defined(LZO_ABI_NEUTRAL_ENDIAN)
+# define LZO_INFO_ABI_ENDIAN "neutral"
+#endif
+#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_I8LP16 1
+# define LZO_INFO_ABI_PM "i8lp16"
+#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2)
+# define LZO_ABI_ILP16 1
+# define LZO_INFO_ABI_PM "ilp16"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_ILP32 1
+# define LZO_INFO_ABI_PM "ilp32"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8)
+# define LZO_ABI_LLP64 1
+# define LZO_INFO_ABI_PM "llp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_LP64 1
+# define LZO_INFO_ABI_PM "lp64"
+#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8)
+# define LZO_ABI_ILP64 1
+# define LZO_INFO_ABI_PM "ilp64"
+#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4)
+# define LZO_ABI_IP32L64 1
+# define LZO_INFO_ABI_PM "ip32l64"
+#endif
+#if !defined(__LZO_LIBC_OVERRIDE)
+#if defined(LZO_LIBC_NAKED)
+# define LZO_INFO_LIBC "naked"
+#elif defined(LZO_LIBC_FREESTANDING)
+# define LZO_INFO_LIBC "freestanding"
+#elif defined(LZO_LIBC_MOSTLY_FREESTANDING)
+# define LZO_INFO_LIBC "mfreestanding"
+#elif defined(LZO_LIBC_ISOC90)
+# define LZO_INFO_LIBC "isoc90"
+#elif defined(LZO_LIBC_ISOC99)
+# define LZO_INFO_LIBC "isoc99"
+#elif defined(__dietlibc__)
+# define LZO_LIBC_DIETLIBC 1
+# define LZO_INFO_LIBC "dietlibc"
+#elif defined(_NEWLIB_VERSION)
+# define LZO_LIBC_NEWLIB 1
+# define LZO_INFO_LIBC "newlib"
+#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__)
+# if defined(__UCLIBC_SUBLEVEL__)
+# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__)
+# else
+# define LZO_LIBC_UCLIBC 0x00090bL
+# endif
+# define LZO_INFO_LIBC "uclibc"
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100)
+# define LZO_INFO_LIBC "glibc"
+#elif (LZO_CC_MWERKS) && defined(__MSL__)
+# define LZO_LIBC_MSL __MSL__
+# define LZO_INFO_LIBC "msl"
+#else
+# define LZO_LIBC_DEFAULT 1
+# define LZO_INFO_LIBC "default"
+#endif
+#endif
+#if (LZO_CC_GNUC >= 0x020800ul)
+# define __lzo_gnuc_extension__ __extension__
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_gnuc_extension__ __extension__
+#else
+# define __lzo_gnuc_extension__
+#endif
+#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700))
+# define lzo_alignof(e) __alignof__(e)
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define lzo_alignof(e) __alignof(e)
+#endif
+#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295))
+#elif defined(__cplusplus)
+# define __lzo_inline inline
+#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550))
+# define __lzo_inline __inline
+#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI)
+# define __lzo_inline __inline__
+#elif (LZO_CC_DMC)
+# define __lzo_inline __inline
+#elif (LZO_CC_INTELC)
+# define __lzo_inline __inline
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405))
+# define __lzo_inline __inline
+#elif (LZO_CC_MSC && (_MSC_VER >= 900))
+# define __lzo_inline __inline
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
+# define __lzo_inline inline
+#endif
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# define __lzo_forceinline __forceinline
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_forceinline __inline__ __attribute__((__always_inline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_forceinline __forceinline
+#endif
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noinline __attribute__((__noinline__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1300))
+# define __lzo_noinline __declspec(noinline)
+#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# if defined(__cplusplus)
+# else
+# define __lzo_noinline __declspec(noinline)
+# endif
+#endif
+#if (defined(__lzo_forceinline) || defined(__lzo_noinline)) && !defined(__lzo_inline)
+# error "this should not happen"
+#endif
+#if (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && (LZO_OS_WIN32 || LZO_OS_WIN64))
+# define __lzo_noreturn __declspec(noreturn)
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && (LZO_OS_POSIX))
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_noreturn __attribute__((__noreturn__))
+#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
+# define __lzo_noreturn __declspec(noreturn)
+#endif
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_constructor __attribute__((__constructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_constructor __attribute__((__constructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_constructor __attribute__((__constructor__))
+#endif
+#if (LZO_CC_GNUC >= 0x030400ul)
+# define __lzo_destructor __attribute__((__destructor__,__used__))
+#elif (LZO_CC_GNUC >= 0x020700ul)
+# define __lzo_destructor __attribute__((__destructor__))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_destructor __attribute__((__destructor__))
+#endif
+#if defined(__lzo_destructor) && !defined(__lzo_constructor)
+# error "this should not happen"
+#endif
+#if (LZO_CC_GNUC >= 0x030200ul)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800))
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define __lzo_likely(e) (__builtin_expect(!!(e),1))
+# define __lzo_unlikely(e) (__builtin_expect(!!(e),0))
+#else
+# define __lzo_likely(e) (e)
+# define __lzo_unlikely(e) (e)
+#endif
+#if !defined(LZO_UNUSED)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED(var) ((void) &var)
+# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC)
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE)
+# define LZO_UNUSED(var) ((void) var)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED(var) if (&var) ; else
+# elif (LZO_CC_KEILC)
+# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];}
+# elif (LZO_CC_PACIFICC)
+# define LZO_UNUSED(var) ((void) sizeof(var))
+# elif (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED(var) ((void) var)
+# else
+# define LZO_UNUSED(var) ((void) &var)
+# endif
+#endif
+#if !defined(LZO_UNUSED_FUNC)
+# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600))
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC)
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_LLVM)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_UNUSED_FUNC(func) if (func) ; else
+# elif (LZO_CC_MSC)
+# define LZO_UNUSED_FUNC(func) ((void) &func)
+# elif (LZO_CC_KEILC || LZO_CC_PELLESC)
+# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];}
+# else
+# define LZO_UNUSED_FUNC(func) ((void) func)
+# endif
+#endif
+#if !defined(LZO_UNUSED_LABEL)
+# if (LZO_CC_WATCOMC) && defined(__cplusplus)
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# elif (LZO_CC_INTELC || LZO_CC_WATCOMC)
+# define LZO_UNUSED_LABEL(l) if (0) goto l
+# else
+# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER)
+# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC)
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)];
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)];
+# else
+# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)];
+# endif
+#endif
+#if !defined(LZO_COMPILE_TIME_ASSERT)
+# if (LZO_CC_AZTECC)
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];}
+# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_MSC && (_MSC_VER < 900))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295))
+# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break;
+# else
+# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];}
+# endif
+#endif
+#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC)
+# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC)
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit
+# define __lzo_cdecl_main __cdecl
+# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_qsort __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_qsort _stdcall
+# else
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# elif (LZO_CC_WATCOMC)
+# define __lzo_cdecl __cdecl
+# else
+# define __lzo_cdecl __cdecl
+# define __lzo_cdecl_atexit __cdecl
+# define __lzo_cdecl_main __cdecl
+# define __lzo_cdecl_qsort __cdecl
+# endif
+# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC)
+# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC))
+# define __lzo_cdecl_sighandler __pascal
+# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC))
+# define __lzo_cdecl_sighandler _stdcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE)
+# define __lzo_cdecl_sighandler __clrcall
+# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700))
+# if defined(_DLL)
+# define __lzo_cdecl_sighandler _far _cdecl _loadds
+# elif defined(_MT)
+# define __lzo_cdecl_sighandler _far _cdecl
+# else
+# define __lzo_cdecl_sighandler _cdecl
+# endif
+# else
+# define __lzo_cdecl_sighandler __cdecl
+# endif
+#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC))
+# define __lzo_cdecl cdecl
+#endif
+#if !defined(__lzo_cdecl)
+# define __lzo_cdecl
+#endif
+#if !defined(__lzo_cdecl_atexit)
+# define __lzo_cdecl_atexit
+#endif
+#if !defined(__lzo_cdecl_main)
+# define __lzo_cdecl_main
+#endif
+#if !defined(__lzo_cdecl_qsort)
+# define __lzo_cdecl_qsort
+#endif
+#if !defined(__lzo_cdecl_sighandler)
+# define __lzo_cdecl_sighandler
+#endif
+#if !defined(__lzo_cdecl_va)
+# define __lzo_cdecl_va __lzo_cdecl
+#endif
+#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64)
+# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000))
+# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__)
+# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul)))
+# else
+# define LZO_HAVE_WINDOWS_H 1
+# endif
+#endif
+#if (LZO_ARCH_ALPHA)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_AMD64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# define LZO_OPT_UNALIGNED64 1
+#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB)
+#elif (LZO_ARCH_ARM)
+# define LZO_OPT_AVOID_SHORT 1
+# define LZO_OPT_AVOID_USHORT 1
+#elif (LZO_ARCH_CRIS)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_I386)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+#elif (LZO_ARCH_IA64)
+# define LZO_OPT_AVOID_INT_INDEX 1
+# define LZO_OPT_AVOID_UINT_INDEX 1
+# define LZO_OPT_PREFER_POSTINC 1
+#elif (LZO_ARCH_M68K)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(__mc68020__) && !defined(__mcoldfire__)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_MIPS)
+# define LZO_OPT_AVOID_UINT_INDEX 1
+#elif (LZO_ARCH_POWERPC)
+# define LZO_OPT_PREFER_PREINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+# if defined(LZO_ABI_BIG_ENDIAN)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# endif
+#elif (LZO_ARCH_S390)
+# define LZO_OPT_UNALIGNED16 1
+# define LZO_OPT_UNALIGNED32 1
+# if (LZO_SIZEOF_SIZE_T == 8)
+# define LZO_OPT_UNALIGNED64 1
+# endif
+#elif (LZO_ARCH_SH)
+# define LZO_OPT_PREFER_POSTINC 1
+# define LZO_OPT_PREFER_PREDEC 1
+#endif
+#if !defined(LZO_CFG_NO_INLINE_ASM)
+#if defined(LZO_CC_LLVM)
+# define LZO_CFG_NO_INLINE_ASM 1
+#endif
+#endif
+#if !defined(LZO_CFG_NO_UNALIGNED)
+#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC)
+# define LZO_CFG_NO_UNALIGNED 1
+#endif
+#endif
+#if defined(LZO_CFG_NO_UNALIGNED)
+# undef LZO_OPT_UNALIGNED16
+# undef LZO_OPT_UNALIGNED32
+# undef LZO_OPT_UNALIGNED64
+#endif
+#if defined(LZO_CFG_NO_INLINE_ASM)
+#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+# define LZO_ASM_SYNTAX_MSC 1
+#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC))
+#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE))
+# define LZO_ASM_SYNTAX_GNUC 1
+#endif
+#if (LZO_ASM_SYNTAX_GNUC)
+#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul))
+# define __LZO_ASM_CLOBBER "ax"
+#elif (LZO_CC_INTELC)
+# define __LZO_ASM_CLOBBER "memory"
+#else
+# define __LZO_ASM_CLOBBER "cc", "memory"
+#endif
+#endif
+#if defined(__LZO_INFOSTR_MM)
+#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM))
+# define __LZO_INFOSTR_MM ""
+#elif defined(LZO_INFO_MM)
+# define __LZO_INFOSTR_MM "." LZO_INFO_MM
+#else
+# define __LZO_INFOSTR_MM ""
+#endif
+#if defined(__LZO_INFOSTR_PM)
+#elif defined(LZO_INFO_ABI_PM)
+# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM
+#else
+# define __LZO_INFOSTR_PM ""
+#endif
+#if defined(__LZO_INFOSTR_ENDIAN)
+#elif defined(LZO_INFO_ABI_ENDIAN)
+# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN
+#else
+# define __LZO_INFOSTR_ENDIAN ""
+#endif
+#if defined(__LZO_INFOSTR_OSNAME)
+#elif defined(LZO_INFO_OS_CONSOLE)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE
+#elif defined(LZO_INFO_OS_POSIX)
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX
+#else
+# define __LZO_INFOSTR_OSNAME LZO_INFO_OS
+#endif
+#if defined(__LZO_INFOSTR_LIBC)
+#elif defined(LZO_INFO_LIBC)
+# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC
+#else
+# define __LZO_INFOSTR_LIBC ""
+#endif
+#if defined(__LZO_INFOSTR_CCVER)
+#elif defined(LZO_INFO_CCVER)
+# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER
+#else
+# define __LZO_INFOSTR_CCVER ""
+#endif
+#define LZO_INFO_STRING \
+ LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \
+ " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER
+
+#endif
+
+#endif
+
+#undef LZO_HAVE_CONFIG_H
+#include "minilzo.h"
+
+#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2020)
+# error "version mismatch in miniLZO source files"
+#endif
+
+#ifdef MINILZO_HAVE_CONFIG_H
+# define LZO_HAVE_CONFIG_H
+#endif
+
+#ifndef __LZO_CONF_H
+#define __LZO_CONF_H
+
+#if !defined(__LZO_IN_MINILZO)
+#if defined(LZO_CFG_FREESTANDING)
+# define LZO_LIBC_FREESTANDING 1
+# define LZO_OS_FREESTANDING 1
+# define ACC_LIBC_FREESTANDING 1
+# define ACC_OS_FREESTANDING 1
+#endif
+#if defined(LZO_CFG_NO_UNALIGNED)
+# define ACC_CFG_NO_UNALIGNED 1
+#endif
+#if defined(LZO_HAVE_CONFIG_H)
+# define ACC_CONFIG_NO_HEADER 1
+#endif
+#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED)
+# error "include this file first"
+#endif
+#include "lzo/lzoconf.h"
+#endif
+
+#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED)
+# error "version mismatch"
+#endif
+
+#if (LZO_CC_BORLANDC && LZO_ARCH_I086)
+# pragma option -h
+#endif
+
+#if (LZO_CC_MSC && (_MSC_VER >= 1000))
+# pragma warning(disable: 4127 4701)
+#endif
+#if (LZO_CC_MSC && (_MSC_VER >= 1300))
+# pragma warning(disable: 4820)
+# pragma warning(disable: 4514 4710 4711)
+#endif
+
+#if defined(__LZO_MMODEL_HUGE) && (!LZO_HAVE_MM_HUGE_PTR)
+# error "this should not happen - check defines for __huge"
+#endif
+
+#if defined(__LZO_IN_MINILZO) || defined(LZO_CFG_FREESTANDING)
+#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+# define ACC_WANT_ACC_INCD_H 1
+# define ACC_WANT_ACC_INCE_H 1
+# define ACC_WANT_ACC_INCI_H 1
+#elif 1
+# include <string.h>
+#else
+# define ACC_WANT_ACC_INCD_H 1
+#endif
+
+#if (LZO_ARCH_I086)
+# define ACC_MM_AHSHIFT LZO_MM_AHSHIFT
+# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0])
+# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1])
+# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o)))
+#endif
+
+#if !defined(lzo_uintptr_t)
+# if defined(__LZO_MMODEL_HUGE)
+# define lzo_uintptr_t unsigned long
+# elif 1 && defined(LZO_OS_OS400) && (LZO_SIZEOF_VOID_P == 16)
+# define __LZO_UINTPTR_T_IS_POINTER 1
+ typedef char* lzo_uintptr_t;
+# define lzo_uintptr_t lzo_uintptr_t
+# elif (LZO_SIZEOF_SIZE_T == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t size_t
+# elif (LZO_SIZEOF_LONG == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t unsigned long
+# elif (LZO_SIZEOF_INT == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t unsigned int
+# elif (LZO_SIZEOF_LONG_LONG == LZO_SIZEOF_VOID_P)
+# define lzo_uintptr_t unsigned long long
+# else
+# define lzo_uintptr_t size_t
+# endif
+#endif
+LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+
+#if 1 && !defined(LZO_CFG_FREESTANDING)
+#if 1 && !defined(HAVE_STRING_H)
+#define HAVE_STRING_H 1
+#endif
+#if 1 && !defined(HAVE_MEMCMP)
+#define HAVE_MEMCMP 1
+#endif
+#if 1 && !defined(HAVE_MEMCPY)
+#define HAVE_MEMCPY 1
+#endif
+#if 1 && !defined(HAVE_MEMMOVE)
+#define HAVE_MEMMOVE 1
+#endif
+#if 1 && !defined(HAVE_MEMSET)
+#define HAVE_MEMSET 1
+#endif
+#endif
+
+#if 1 && defined(HAVE_STRING_H)
+#include <string.h>
+#endif
+
+#if defined(LZO_CFG_FREESTANDING)
+# undef HAVE_MEMCMP
+# undef HAVE_MEMCPY
+# undef HAVE_MEMMOVE
+# undef HAVE_MEMSET
+#endif
+
+#if !defined(HAVE_MEMCMP)
+# undef memcmp
+# define memcmp(a,b,c) lzo_memcmp(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memcmp(a,b,c) memcmp(a,b,c)
+#endif
+#if !defined(HAVE_MEMCPY)
+# undef memcpy
+# define memcpy(a,b,c) lzo_memcpy(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memcpy(a,b,c) memcpy(a,b,c)
+#endif
+#if !defined(HAVE_MEMMOVE)
+# undef memmove
+# define memmove(a,b,c) lzo_memmove(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memmove(a,b,c) memmove(a,b,c)
+#endif
+#if !defined(HAVE_MEMSET)
+# undef memset
+# define memset(a,b,c) lzo_memset(a,b,c)
+#elif !defined(__LZO_MMODEL_HUGE)
+# define lzo_memset(a,b,c) memset(a,b,c)
+#endif
+
+#undef NDEBUG
+#if defined(LZO_CFG_FREESTANDING)
+# undef LZO_DEBUG
+# define NDEBUG 1
+# undef assert
+# define assert(e) ((void)0)
+#else
+# if !defined(LZO_DEBUG)
+# define NDEBUG 1
+# endif
+# include <assert.h>
+#endif
+
+#if 0 && defined(__BOUNDS_CHECKING_ON)
+# include <unchecked.h>
+#else
+# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt
+# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr)
+#endif
+
+#if !defined(__lzo_inline)
+# define __lzo_inline
+#endif
+#if !defined(__lzo_forceinline)
+# define __lzo_forceinline
+#endif
+#if !defined(__lzo_noinline)
+# define __lzo_noinline
+#endif
+
+#if 1
+# define LZO_BYTE(x) ((unsigned char) (x))
+#else
+# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff))
+#endif
+
+#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b))
+#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b))
+#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c))
+#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c))
+
+#define lzo_sizeof(type) ((lzo_uint) (sizeof(type)))
+
+#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array))))
+
+#define LZO_SIZE(bits) (1u << (bits))
+#define LZO_MASK(bits) (LZO_SIZE(bits) - 1)
+
+#define LZO_LSIZE(bits) (1ul << (bits))
+#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1)
+
+#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits))
+#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1)
+
+#if !defined(DMUL)
+#if 0
+
+# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b)))
+#else
+# define DMUL(a,b) ((lzo_xint) ((a) * (b)))
+#endif
+#endif
+
+#if 1 && !defined(LZO_CFG_NO_UNALIGNED)
+#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
+# if (LZO_SIZEOF_SHORT == 2)
+# define LZO_UNALIGNED_OK_2
+# endif
+# if (LZO_SIZEOF_INT == 4)
+# define LZO_UNALIGNED_OK_4
+# endif
+#endif
+#endif
+
+#if defined(LZO_UNALIGNED_OK_2)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(short) == 2)
+#endif
+#if defined(LZO_UNALIGNED_OK_4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
+#elif defined(LZO_ALIGNED_OK_4)
+ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
+#endif
+
+#define MEMCPY8_DS(dest,src,len) \
+ lzo_memcpy(dest,src,len); dest += len; src += len
+
+#define BZERO8_PTR(s,l,n) \
+ lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
+
+#define MEMCPY_DS(dest,src,len) \
+ do *dest++ = *src++; while (--len > 0)
+
+__LZO_EXTERN_C int __lzo_init_done;
+__LZO_EXTERN_C const char __lzo_copyright[];
+LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
+
+#ifndef __LZO_PTR_H
+#define __LZO_PTR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(lzo_uintptr_t)
+# if defined(__LZO_MMODEL_HUGE)
+# define lzo_uintptr_t unsigned long
+# else
+# define lzo_uintptr_t acc_uintptr_t
+# ifdef __ACC_INTPTR_T_IS_POINTER
+# define __LZO_UINTPTR_T_IS_POINTER 1
+# endif
+# endif
+#endif
+
+#if (LZO_ARCH_I086)
+#define PTR(a) ((lzo_bytep) (a))
+#define PTR_ALIGNED_4(a) ((ACC_PTR_FP_OFF(a) & 3) == 0)
+#define PTR_ALIGNED2_4(a,b) (((ACC_PTR_FP_OFF(a) | ACC_PTR_FP_OFF(b)) & 3) == 0)
+#else
+#define PTR(a) ((lzo_uintptr_t) (a))
+#define PTR_LINEAR(a) PTR(a)
+#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0)
+#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0)
+#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0)
+#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0)
+#endif
+
+#define PTR_LT(a,b) (PTR(a) < PTR(b))
+#define PTR_GE(a,b) (PTR(a) >= PTR(b))
+#define PTR_DIFF(a,b) (PTR(a) - PTR(b))
+#define pd(a,b) ((lzo_uint) ((a)-(b)))
+
+LZO_EXTERN(lzo_uintptr_t)
+__lzo_ptr_linear(const lzo_voidp ptr);
+
+typedef union
+{
+ char a_char;
+ unsigned char a_uchar;
+ short a_short;
+ unsigned short a_ushort;
+ int a_int;
+ unsigned int a_uint;
+ long a_long;
+ unsigned long a_ulong;
+ lzo_int a_lzo_int;
+ lzo_uint a_lzo_uint;
+ lzo_int32 a_lzo_int32;
+ lzo_uint32 a_lzo_uint32;
+ ptrdiff_t a_ptrdiff_t;
+ lzo_uintptr_t a_lzo_uintptr_t;
+ lzo_voidp a_lzo_voidp;
+ void * a_void_p;
+ lzo_bytep a_lzo_bytep;
+ lzo_bytepp a_lzo_bytepp;
+ lzo_uintp a_lzo_uintp;
+ lzo_uint * a_lzo_uint_p;
+ lzo_uint32p a_lzo_uint32p;
+ lzo_uint32 * a_lzo_uint32_p;
+ unsigned char * a_uchar_p;
+ char * a_char_p;
+}
+lzo_full_align_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#define LZO_DETERMINISTIC
+
+#define LZO_DICT_USE_PTR
+#if 0 && (LZO_ARCH_I086)
+# undef LZO_DICT_USE_PTR
+#endif
+
+#if defined(LZO_DICT_USE_PTR)
+# define lzo_dict_t const lzo_bytep
+# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+#else
+# define lzo_dict_t lzo_uint
+# define lzo_dict_p lzo_dict_t __LZO_MMODEL *
+#endif
+
+#endif
+
+#if !defined(MINILZO_CFG_SKIP_LZO_PTR)
+
+LZO_PUBLIC(lzo_uintptr_t)
+__lzo_ptr_linear(const lzo_voidp ptr)
+{
+ lzo_uintptr_t p;
+
+#if (LZO_ARCH_I086)
+ p = (((lzo_uintptr_t)(ACC_PTR_FP_SEG(ptr))) << (16 - ACC_MM_AHSHIFT)) + (ACC_PTR_FP_OFF(ptr));
+#else
+ p = (lzo_uintptr_t) PTR_LINEAR(ptr);
+#endif
+
+ return p;
+}
+
+LZO_PUBLIC(unsigned)
+__lzo_align_gap(const lzo_voidp ptr, lzo_uint size)
+{
+#if defined(__LZO_UINTPTR_T_IS_POINTER)
+ size_t n = (size_t) ptr;
+ n = (((n + size - 1) / size) * size) - n;
+#else
+ lzo_uintptr_t p, n;
+ p = __lzo_ptr_linear(ptr);
+ n = (((p + size - 1) / size) * size) - p;
+#endif
+
+ assert(size > 0);
+ assert((long)n >= 0);
+ assert(n <= s);
+ return (unsigned)n;
+}
+
+#endif
+
+/* If you use the LZO library in a product, you *must* keep this
+ * copyright string in the executable of your product.
+ */
+
+const char __lzo_copyright[] =
+#if !defined(__LZO_IN_MINLZO)
+ LZO_VERSION_STRING;
+#else
+ "\r\n\n"
+ "LZO data compression library.\n"
+ "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Markus Franz Xaver Johannes Oberhumer\n"
+ "<markus@oberhumer.com>\n"
+ "http://www.oberhumer.com $\n\n"
+ "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n"
+ "$Built: " __DATE__ " " __TIME__ " $\n"
+ "$Info: " LZO_INFO_STRING " $\n";
+#endif
+
+LZO_PUBLIC(const lzo_bytep)
+lzo_copyright(void)
+{
+#if (LZO_OS_DOS16 && LZO_CC_TURBOC)
+ return (lzo_voidp) __lzo_copyright;
+#else
+ return (const lzo_bytep) __lzo_copyright;
+#endif
+}
+
+LZO_PUBLIC(unsigned)
+lzo_version(void)
+{
+ return LZO_VERSION;
+}
+
+LZO_PUBLIC(const char *)
+lzo_version_string(void)
+{
+ return LZO_VERSION_STRING;
+}
+
+LZO_PUBLIC(const char *)
+lzo_version_date(void)
+{
+ return LZO_VERSION_DATE;
+}
+
+LZO_PUBLIC(const lzo_charp)
+_lzo_version_string(void)
+{
+ return LZO_VERSION_STRING;
+}
+
+LZO_PUBLIC(const lzo_charp)
+_lzo_version_date(void)
+{
+ return LZO_VERSION_DATE;
+}
+
+#define LZO_BASE 65521u
+#define LZO_NMAX 5552
+
+#define LZO_DO1(buf,i) s1 += buf[i]; s2 += s1
+#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1);
+#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2);
+#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4);
+#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8);
+
+LZO_PUBLIC(lzo_uint32)
+lzo_adler32(lzo_uint32 adler, const lzo_bytep buf, lzo_uint len)
+{
+ lzo_uint32 s1 = adler & 0xffff;
+ lzo_uint32 s2 = (adler >> 16) & 0xffff;
+ unsigned k;
+
+ if (buf == NULL)
+ return 1;
+
+ while (len > 0)
+ {
+ k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX;
+ len -= k;
+ if (k >= 16) do
+ {
+ LZO_DO16(buf,0);
+ buf += 16;
+ k -= 16;
+ } while (k >= 16);
+ if (k != 0) do
+ {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k > 0);
+ s1 %= LZO_BASE;
+ s2 %= LZO_BASE;
+ }
+ return (s2 << 16) | s1;
+}
+
+#undef LZO_DO1
+#undef LZO_DO2
+#undef LZO_DO4
+#undef LZO_DO8
+#undef LZO_DO16
+
+#if !defined(MINILZO_CFG_SKIP_LZO_STRING)
+#undef lzo_memcmp
+#undef lzo_memcpy
+#undef lzo_memmove
+#undef lzo_memset
+#if !defined(__LZO_MMODEL_HUGE)
+# undef LZO_HAVE_MM_HUGE_PTR
+#endif
+#define lzo_hsize_t lzo_uint
+#define lzo_hvoid_p lzo_voidp
+#define lzo_hbyte_p lzo_bytep
+#define LZOLIB_PUBLIC(r,f) LZO_PUBLIC(r) f
+#define lzo_hmemcmp lzo_memcmp
+#define lzo_hmemcpy lzo_memcpy
+#define lzo_hmemmove lzo_memmove
+#define lzo_hmemset lzo_memset
+#define __LZOLIB_HMEMCPY_CH_INCLUDED 1
+#if !defined(LZOLIB_PUBLIC)
+# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f)
+#endif
+LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCMP)
+ const lzo_hbyte_p p1 = (const lzo_hbyte_p) s1;
+ const lzo_hbyte_p p2 = (const lzo_hbyte_p) s2;
+ if __lzo_likely(len > 0) do
+ {
+ int d = *p1 - *p2;
+ if (d != 0)
+ return d;
+ p1++; p2++;
+ } while __lzo_likely(--len > 0);
+ return 0;
+#else
+ return memcmp(s1, s2, len);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY)
+ lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
+ const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
+ if (len <= 0 || p1 == p2)
+ return dest;
+ do
+ *p1++ = *p2++;
+ while __lzo_likely(--len > 0);
+ return dest;
+#else
+ return memcpy(dest, src, len);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE)
+ lzo_hbyte_p p1 = (lzo_hbyte_p) dest;
+ const lzo_hbyte_p p2 = (const lzo_hbyte_p) src;
+ if (len <= 0 || p1 == p2)
+ return dest;
+ if (p1 < p2)
+ {
+ do
+ *p1++ = *p2++;
+ while __lzo_likely(--len > 0);
+ }
+ else
+ {
+ p1 += len;
+ p2 += len;
+ do
+ *--p1 = *--p2;
+ while __lzo_likely(--len > 0);
+ }
+ return dest;
+#else
+ return memmove(dest, src, len);
+#endif
+}
+LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int c, lzo_hsize_t len)
+{
+#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMSET)
+ lzo_hbyte_p p = (lzo_hbyte_p) s;
+ if __lzo_likely(len > 0) do
+ *p++ = (unsigned char) c;
+ while __lzo_likely(--len > 0);
+ return s;
+#else
+ return memset(s, c, len);
+#endif
+}
+#undef LZOLIB_PUBLIC
+#endif
+
+#if !defined(__LZO_IN_MINILZO)
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+
+ ACCCHK_ASSERT_IS_SIGNED_T(lzo_int)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint)
+
+ ACCCHK_ASSERT_IS_SIGNED_T(lzo_int32)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32)
+ ACCCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0)
+ ACCCHK_ASSERT(sizeof(lzo_uint32) >= 4)
+
+#if !defined(__LZO_UINTPTR_T_IS_POINTER)
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t)
+#endif
+ ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp))
+
+ ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint)
+ ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32))
+ ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint))
+ ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint))
+
+#endif
+#undef ACCCHK_ASSERT
+
+LZO_PUBLIC(int)
+_lzo_config_check(void)
+{
+ lzo_bool r = 1;
+ union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u;
+
+#if !defined(LZO_CFG_NO_CONFIG_CHECK)
+#if defined(LZO_ABI_BIG_ENDIAN)
+ u.l[0] = u.l[1] = 0; u.c[sizeof(lzo_xint) - 1] = 128;
+ r &= (u.l[0] == 128);
+#endif
+#if defined(LZO_ABI_LITTLE_ENDIAN)
+ u.l[0] = u.l[1] = 0; u.c[0] = 128;
+ r &= (u.l[0] == 128);
+#endif
+#if defined(LZO_UNALIGNED_OK_2)
+ u.l[0] = u.l[1] = 0;
+ r &= ((* (const lzo_ushortp) (const lzo_voidp) &u.c[1]) == 0);
+#endif
+#if defined(LZO_UNALIGNED_OK_4)
+ u.l[0] = u.l[1] = 0;
+ r &= ((* (const lzo_uint32p) (const lzo_voidp) &u.c[1]) == 0);
+#endif
+#endif
+
+ LZO_UNUSED(u);
+ return r == 1 ? LZO_E_OK : LZO_E_ERROR;
+}
+
+int __lzo_init_done = 0;
+
+LZO_PUBLIC(int)
+__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5,
+ int s6, int s7, int s8, int s9)
+{
+ int r;
+
+#if defined(__LZO_IN_MINILZO)
+#elif (LZO_CC_MSC && ((_MSC_VER) < 700))
+#else
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr)
+#endif
+#undef ACCCHK_ASSERT
+
+ __lzo_init_done = 1;
+
+ if (v == 0)
+ return LZO_E_ERROR;
+
+ r = (s1 == -1 || s1 == (int) sizeof(short)) &&
+ (s2 == -1 || s2 == (int) sizeof(int)) &&
+ (s3 == -1 || s3 == (int) sizeof(long)) &&
+ (s4 == -1 || s4 == (int) sizeof(lzo_uint32)) &&
+ (s5 == -1 || s5 == (int) sizeof(lzo_uint)) &&
+ (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) &&
+ (s7 == -1 || s7 == (int) sizeof(char *)) &&
+ (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) &&
+ (s9 == -1 || s9 == (int) sizeof(lzo_callback_t));
+ if (!r)
+ return LZO_E_ERROR;
+
+ r = _lzo_config_check();
+ if (r != LZO_E_OK)
+ return r;
+
+ return r;
+}
+
+#if !defined(__LZO_IN_MINILZO)
+
+#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD)
+
+#if 0
+BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment,
+ WORD wHeapSize, LPSTR lpszCmdLine )
+#else
+int __far __pascal LibMain ( int a, short b, short c, long d )
+#endif
+{
+ LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d);
+ return 1;
+}
+
+#endif
+
+#endif
+
+#define do_compress _lzo1x_1_do_compress
+
+#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS)
+
+#define LZO_NEED_DICT_H
+#define D_BITS 14
+#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5)
+#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
+
+#ifndef __LZO_CONFIG1X_H
+#define __LZO_CONFIG1X_H
+
+#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
+# define LZO1X
+#endif
+
+#if !defined(__LZO_IN_MINILZO)
+#include "lzo/lzo1x.h"
+#endif
+
+#define LZO_EOF_CODE
+#undef LZO_DETERMINISTIC
+
+#define M1_MAX_OFFSET 0x0400
+#ifndef M2_MAX_OFFSET
+#define M2_MAX_OFFSET 0x0800
+#endif
+#define M3_MAX_OFFSET 0x4000
+#define M4_MAX_OFFSET 0xbfff
+
+#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET)
+
+#define M1_MIN_LEN 2
+#define M1_MAX_LEN 2
+#define M2_MIN_LEN 3
+#ifndef M2_MAX_LEN
+#define M2_MAX_LEN 8
+#endif
+#define M3_MIN_LEN 3
+#define M3_MAX_LEN 33
+#define M4_MIN_LEN 3
+#define M4_MAX_LEN 9
+
+#define M1_MARKER 0
+#define M2_MARKER 64
+#define M3_MARKER 32
+#define M4_MARKER 16
+
+#ifndef MIN_LOOKAHEAD
+#define MIN_LOOKAHEAD (M2_MAX_LEN + 1)
+#endif
+
+#if defined(LZO_NEED_DICT_H)
+
+#ifndef LZO_HASH
+#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B
+#endif
+#define DL_MIN_LEN M2_MIN_LEN
+
+#ifndef __LZO_DICT_H
+#define __LZO_DICT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(D_BITS) && defined(DBITS)
+# define D_BITS DBITS
+#endif
+#if !defined(D_BITS)
+# error "D_BITS is not defined"
+#endif
+#if (D_BITS < 16)
+# define D_SIZE LZO_SIZE(D_BITS)
+# define D_MASK LZO_MASK(D_BITS)
+#else
+# define D_SIZE LZO_USIZE(D_BITS)
+# define D_MASK LZO_UMASK(D_BITS)
+#endif
+#define D_HIGH ((D_MASK >> 1) + 1)
+
+#if !defined(DD_BITS)
+# define DD_BITS 0
+#endif
+#define DD_SIZE LZO_SIZE(DD_BITS)
+#define DD_MASK LZO_MASK(DD_BITS)
+
+#if !defined(DL_BITS)
+# define DL_BITS (D_BITS - DD_BITS)
+#endif
+#if (DL_BITS < 16)
+# define DL_SIZE LZO_SIZE(DL_BITS)
+# define DL_MASK LZO_MASK(DL_BITS)
+#else
+# define DL_SIZE LZO_USIZE(DL_BITS)
+# define DL_MASK LZO_UMASK(DL_BITS)
+#endif
+
+#if (D_BITS != DL_BITS + DD_BITS)
+# error "D_BITS does not match"
+#endif
+#if (D_BITS < 8 || D_BITS > 18)
+# error "invalid D_BITS"
+#endif
+#if (DL_BITS < 8 || DL_BITS > 20)
+# error "invalid DL_BITS"
+#endif
+#if (DD_BITS < 0 || DD_BITS > 6)
+# error "invalid DD_BITS"
+#endif
+
+#if !defined(DL_MIN_LEN)
+# define DL_MIN_LEN 3
+#endif
+#if !defined(DL_SHIFT)
+# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN)
+#endif
+
+#define LZO_HASH_GZIP 1
+#define LZO_HASH_GZIP_INCREMENTAL 2
+#define LZO_HASH_LZO_INCREMENTAL_A 3
+#define LZO_HASH_LZO_INCREMENTAL_B 4
+
+#if !defined(LZO_HASH)
+# error "choose a hashing strategy"
+#endif
+
+#undef DM
+#undef DX
+
+#if (DL_MIN_LEN == 3)
+# define _DV2_A(p,shift1,shift2) \
+ (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2])
+# define _DV2_B(p,shift1,shift2) \
+ (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0])
+# define _DV3_B(p,shift1,shift2,shift3) \
+ ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0])
+#elif (DL_MIN_LEN == 2)
+# define _DV2_A(p,shift1,shift2) \
+ (( (lzo_xint)(p[0]) << shift1) ^ p[1])
+# define _DV2_B(p,shift1,shift2) \
+ (( (lzo_xint)(p[1]) << shift1) ^ p[2])
+#else
+# error "invalid DL_MIN_LEN"
+#endif
+#define _DV_A(p,shift) _DV2_A(p,shift,shift)
+#define _DV_B(p,shift) _DV2_B(p,shift,shift)
+#define DA2(p,s1,s2) \
+ (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0])
+#define DS2(p,s1,s2) \
+ (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0])
+#define DX2(p,s1,s2) \
+ (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0])
+#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0])
+#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0])
+#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0])
+#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s)))
+#define DM(v) DMS(v,0)
+
+#if (LZO_HASH == LZO_HASH_GZIP)
+# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT))
+
+#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL)
+# define __LZO_HASH_INCREMENTAL
+# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT)
+# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2])
+# define _DINDEX(dv,p) (dv)
+# define DVAL_LOOKAHEAD DL_MIN_LEN
+
+#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A)
+# define __LZO_HASH_INCREMENTAL
+# define DVAL_FIRST(dv,p) dv = _DV_A((p),5)
+# define DVAL_NEXT(dv,p) \
+ dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2])
+# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5)
+# define DVAL_LOOKAHEAD DL_MIN_LEN
+
+#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B)
+# define __LZO_HASH_INCREMENTAL
+# define DVAL_FIRST(dv,p) dv = _DV_B((p),5)
+# define DVAL_NEXT(dv,p) \
+ dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5)))
+# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5)
+# define DVAL_LOOKAHEAD DL_MIN_LEN
+
+#else
+# error "choose a hashing strategy"
+#endif
+
+#ifndef DINDEX
+#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS)
+#endif
+#if !defined(DINDEX1) && defined(D_INDEX1)
+#define DINDEX1 D_INDEX1
+#endif
+#if !defined(DINDEX2) && defined(D_INDEX2)
+#define DINDEX2 D_INDEX2
+#endif
+
+#if !defined(__LZO_HASH_INCREMENTAL)
+# define DVAL_FIRST(dv,p) ((void) 0)
+# define DVAL_NEXT(dv,p) ((void) 0)
+# define DVAL_LOOKAHEAD 0
+#endif
+
+#if !defined(DVAL_ASSERT)
+#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG)
+static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p)
+{
+ lzo_xint df;
+ DVAL_FIRST(df,(p));
+ assert(DINDEX(dv,p) == DINDEX(df,p));
+}
+#else
+# define DVAL_ASSERT(dv,p) ((void) 0)
+#endif
+#endif
+
+#if defined(LZO_DICT_USE_PTR)
+# define DENTRY(p,in) (p)
+# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex]
+#else
+# define DENTRY(p,in) ((lzo_uint) ((p)-(in)))
+# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex]
+#endif
+
+#if (DD_BITS == 0)
+
+# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in)
+# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in)
+# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in)
+
+#else
+
+# define UPDATE_D(dict,drun,dv,p,in) \
+ dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
+# define UPDATE_I(dict,drun,index,p,in) \
+ dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK
+# define UPDATE_P(ptr,drun,p,in) \
+ (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK
+
+#endif
+
+#if defined(LZO_DICT_USE_PTR)
+
+#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
+ (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset)
+
+#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
+ (BOUNDS_CHECKING_OFF_IN_EXPR(( \
+ m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \
+ PTR_LT(m_pos,in) || \
+ (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) <= 0 || \
+ m_off > max_offset )))
+
+#else
+
+#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
+ (m_off == 0 || \
+ ((m_off = pd(ip, in) - m_off) > max_offset) || \
+ (m_pos = (ip) - (m_off), 0) )
+
+#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
+ (pd(ip, in) <= m_off || \
+ ((m_off = pd(ip, in) - m_off) > max_offset) || \
+ (m_pos = (ip) - (m_off), 0) )
+
+#endif
+
+#if defined(LZO_DETERMINISTIC)
+# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET
+#else
+# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+#endif
+
+#endif
+
+#define DO_COMPRESS lzo1x_1_compress
+
+static __lzo_noinline lzo_uint
+do_compress ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ register const lzo_bytep ip;
+ lzo_bytep op;
+ const lzo_bytep const in_end = in + in_len;
+ const lzo_bytep const ip_end = in + in_len - M2_MAX_LEN - 5;
+ const lzo_bytep ii;
+ lzo_dict_p const dict = (lzo_dict_p) wrkmem;
+
+ op = out;
+ ip = in;
+ ii = ip;
+
+ ip += 4;
+ for (;;)
+ {
+ register const lzo_bytep m_pos;
+ lzo_uint m_off;
+ lzo_uint m_len;
+ lzo_uint dindex;
+
+ DINDEX1(dindex,ip);
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
+ goto literal;
+#if 1
+ if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
+ goto try_match;
+ DINDEX2(dindex,ip);
+#endif
+ GINDEX(m_pos,m_off,dict,dindex,in);
+ if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET))
+ goto literal;
+ if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3])
+ goto try_match;
+ goto literal;
+
+try_match:
+#if 1 && defined(LZO_UNALIGNED_OK_2)
+ if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
+#else
+ if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
+#endif
+ {
+ }
+ else
+ {
+ if __lzo_likely(m_pos[2] == ip[2])
+ {
+#if 0
+ if (m_off <= M2_MAX_OFFSET)
+ goto match;
+ if (lit <= 3)
+ goto match;
+ if (lit == 3)
+ {
+ assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
+ *op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
+ goto code_match;
+ }
+ if (m_pos[3] == ip[3])
+#endif
+ goto match;
+ }
+ else
+ {
+#if 0
+#if 0
+ if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3)
+#else
+ if (m_off <= M1_MAX_OFFSET && lit == 3)
+#endif
+ {
+ register lzo_uint t;
+
+ t = lit;
+ assert(op - 2 > out); op[-2] |= LZO_BYTE(t);
+ do *op++ = *ii++; while (--t > 0);
+ assert(ii == ip);
+ m_off -= 1;
+ *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
+ ip += 2;
+ goto match_done;
+ }
+#endif
+ }
+ }
+
+literal:
+ UPDATE_I(dict,0,dindex,ip,in);
+ ++ip;
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ continue;
+
+match:
+ UPDATE_I(dict,0,dindex,ip,in);
+ if (pd(ip,ii) > 0)
+ {
+ register lzo_uint t = pd(ip,ii);
+
+ if (t <= 3)
+ {
+ assert(op - 2 > out);
+ op[-2] |= LZO_BYTE(t);
+ }
+ else if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ register lzo_uint tt = t - 18;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ *op++ = 0;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ do *op++ = *ii++; while (--t > 0);
+ }
+
+ assert(ii == ip);
+ ip += 3;
+ if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ ||
+ m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++
+#ifdef LZO1Y
+ || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++
+ || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++
+#endif
+ )
+ {
+ --ip;
+ m_len = pd(ip, ii);
+ assert(m_len >= 3); assert(m_len <= M2_MAX_LEN);
+
+ if (m_off <= M2_MAX_OFFSET)
+ {
+ m_off -= 1;
+#if defined(LZO1X)
+ *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2));
+ *op++ = LZO_BYTE(m_off >> 3);
+#elif defined(LZO1Y)
+ *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2));
+ *op++ = LZO_BYTE(m_off >> 2);
+#endif
+ }
+ else if (m_off <= M3_MAX_OFFSET)
+ {
+ m_off -= 1;
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ goto m3_m4_offset;
+ }
+ else
+#if defined(LZO1X)
+ {
+ m_off -= 0x4000;
+ assert(m_off > 0); assert(m_off <= 0x7fff);
+ *op++ = LZO_BYTE(M4_MARKER |
+ ((m_off & 0x4000) >> 11) | (m_len - 2));
+ goto m3_m4_offset;
+ }
+#elif defined(LZO1Y)
+ goto m4_match;
+#endif
+ }
+ else
+ {
+ {
+ const lzo_bytep end = in_end;
+ const lzo_bytep m = m_pos + M2_MAX_LEN + 1;
+ while (ip < end && *m == *ip)
+ m++, ip++;
+ m_len = pd(ip, ii);
+ }
+ assert(m_len > M2_MAX_LEN);
+
+ if (m_off <= M3_MAX_OFFSET)
+ {
+ m_off -= 1;
+ if (m_len <= 33)
+ *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
+ else
+ {
+ m_len -= 33;
+ *op++ = M3_MARKER | 0;
+ goto m3_m4_len;
+ }
+ }
+ else
+ {
+#if defined(LZO1Y)
+m4_match:
+#endif
+ m_off -= 0x4000;
+ assert(m_off > 0); assert(m_off <= 0x7fff);
+ if (m_len <= M4_MAX_LEN)
+ *op++ = LZO_BYTE(M4_MARKER |
+ ((m_off & 0x4000) >> 11) | (m_len - 2));
+ else
+ {
+ m_len -= M4_MAX_LEN;
+ *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11));
+m3_m4_len:
+ while (m_len > 255)
+ {
+ m_len -= 255;
+ *op++ = 0;
+ }
+ assert(m_len > 0);
+ *op++ = LZO_BYTE(m_len);
+ }
+ }
+
+m3_m4_offset:
+ *op++ = LZO_BYTE((m_off & 63) << 2);
+ *op++ = LZO_BYTE(m_off >> 6);
+ }
+
+#if 0
+match_done:
+#endif
+ ii = ip;
+ if __lzo_unlikely(ip >= ip_end)
+ break;
+ }
+
+ *out_len = pd(op, out);
+ return pd(in_end,ii);
+}
+
+LZO_PUBLIC(int)
+DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+{
+ lzo_bytep op = out;
+ lzo_uint t;
+
+ if __lzo_unlikely(in_len <= M2_MAX_LEN + 5)
+ t = in_len;
+ else
+ {
+ t = do_compress(in,in_len,op,out_len,wrkmem);
+ op += *out_len;
+ }
+
+ if (t > 0)
+ {
+ const lzo_bytep ii = in + in_len - t;
+
+ if (op == out && t <= 238)
+ *op++ = LZO_BYTE(17 + t);
+ else if (t <= 3)
+ op[-2] |= LZO_BYTE(t);
+ else if (t <= 18)
+ *op++ = LZO_BYTE(t - 3);
+ else
+ {
+ lzo_uint tt = t - 18;
+
+ *op++ = 0;
+ while (tt > 255)
+ {
+ tt -= 255;
+ *op++ = 0;
+ }
+ assert(tt > 0);
+ *op++ = LZO_BYTE(tt);
+ }
+ do *op++ = *ii++; while (--t > 0);
+ }
+
+ *op++ = M4_MARKER | 1;
+ *op++ = 0;
+ *op++ = 0;
+
+ *out_len = pd(op, out);
+ return LZO_E_OK;
+}
+
+#endif
+
+#undef do_compress
+#undef DO_COMPRESS
+#undef LZO_HASH
+
+#undef LZO_TEST_OVERRUN
+#undef DO_DECOMPRESS
+#define DO_DECOMPRESS lzo1x_decompress
+
+#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS)
+
+#if defined(LZO_TEST_OVERRUN)
+# if !defined(LZO_TEST_OVERRUN_INPUT)
+# define LZO_TEST_OVERRUN_INPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_OUTPUT)
+# define LZO_TEST_OVERRUN_OUTPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define LZO_TEST_OVERRUN_LOOKBEHIND
+# endif
+#endif
+
+#undef TEST_IP
+#undef TEST_OP
+#undef TEST_LB
+#undef TEST_LBO
+#undef NEED_IP
+#undef NEED_OP
+#undef HAVE_TEST_IP
+#undef HAVE_TEST_OP
+#undef HAVE_NEED_IP
+#undef HAVE_NEED_OP
+#undef HAVE_ANY_IP
+#undef HAVE_ANY_OP
+
+#if defined(LZO_TEST_OVERRUN_INPUT)
+# if (LZO_TEST_OVERRUN_INPUT >= 1)
+# define TEST_IP (ip < ip_end)
+# endif
+# if (LZO_TEST_OVERRUN_INPUT >= 2)
+# define NEED_IP(x) \
+ if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_OUTPUT)
+# if (LZO_TEST_OVERRUN_OUTPUT >= 1)
+# define TEST_OP (op <= op_end)
+# endif
+# if (LZO_TEST_OVERRUN_OUTPUT >= 2)
+# undef TEST_OP
+# define NEED_OP(x) \
+ if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun
+#else
+# define TEST_LB(m_pos) ((void) 0)
+# define TEST_LBO(m_pos,o) ((void) 0)
+#endif
+
+#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
+# define TEST_IP (ip < ip_end)
+#endif
+
+#if defined(TEST_IP)
+# define HAVE_TEST_IP
+#else
+# define TEST_IP 1
+#endif
+#if defined(TEST_OP)
+# define HAVE_TEST_OP
+#else
+# define TEST_OP 1
+#endif
+
+#if defined(NEED_IP)
+# define HAVE_NEED_IP
+#else
+# define NEED_IP(x) ((void) 0)
+#endif
+#if defined(NEED_OP)
+# define HAVE_NEED_OP
+#else
+# define NEED_OP(x) ((void) 0)
+#endif
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
+# define HAVE_ANY_IP
+#endif
+#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
+# define HAVE_ANY_OP
+#endif
+
+#undef __COPY4
+#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
+
+#undef COPY4
+#if defined(LZO_UNALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4(dst,src)
+#elif defined(LZO_ALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src))
+#endif
+
+#if defined(DO_DECOMPRESS)
+LZO_PUBLIC(int)
+DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+#endif
+{
+ register lzo_bytep op;
+ register const lzo_bytep ip;
+ register lzo_uint t;
+#if defined(COPY_DICT)
+ lzo_uint m_off;
+ const lzo_bytep dict_end;
+#else
+ register const lzo_bytep m_pos;
+#endif
+
+ const lzo_bytep const ip_end = in + in_len;
+#if defined(HAVE_ANY_OP)
+ lzo_bytep const op_end = out + *out_len;
+#endif
+#if defined(LZO1Z)
+ lzo_uint last_m_off = 0;
+#endif
+
+ LZO_UNUSED(wrkmem);
+
+#if defined(COPY_DICT)
+ if (dict)
+ {
+ if (dict_len > M4_MAX_OFFSET)
+ {
+ dict += dict_len - M4_MAX_OFFSET;
+ dict_len = M4_MAX_OFFSET;
+ }
+ dict_end = dict + dict_len;
+ }
+ else
+ {
+ dict_len = 0;
+ dict_end = NULL;
+ }
+#endif
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ while (TEST_IP && TEST_OP)
+ {
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (PTR_ALIGNED2_4(op,ip))
+ {
+#endif
+ COPY4(op,ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ COPY4(op,ip);
+ op += 4; ip += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *ip++; while (--t > 0);
+ }
+ else
+ do *op++ = *ip++; while (--t > 0);
+ }
+#if !defined(LZO_UNALIGNED_OK_4)
+ }
+ else
+#endif
+#endif
+#if !defined(LZO_UNALIGNED_OK_4)
+ {
+ *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
+ do *op++ = *ip++; while (--t > 0);
+ }
+#endif
+
+first_literal_run:
+
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(3);
+ t = 3; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - (1 + M2_MAX_OFFSET);
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(3);
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+
+ do {
+match:
+ if (t >= 64)
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1X)
+ m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ m_off = t & 0x1f;
+ if (m_off >= 0x1c)
+ m_off = last_m_off;
+ else
+ {
+ m_off = 1 + (m_off << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+ }
+ t = (t >> 5) - 1;
+#endif
+#else
+#if defined(LZO1X)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 3;
+ m_pos -= *ip++ << 2;
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ {
+ lzo_uint off = t & 0x1f;
+ m_pos = op;
+ if (off >= 0x1c)
+ {
+ assert(last_m_off > 0);
+ m_pos -= last_m_off;
+ }
+ else
+ {
+ off = 1 + (off << 6) + (*ip++ >> 2);
+ m_pos -= off;
+ last_m_off = off;
+ }
+ }
+ t = (t >> 5) - 1;
+#endif
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+ goto copy_match;
+#endif
+ }
+ else if (t >= 32)
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#else
+#if defined(LZO1Z)
+ {
+ lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ m_pos = op - off;
+ last_m_off = off;
+ }
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos = op - 1;
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos = op - 1;
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#endif
+ ip += 2;
+ }
+ else if (t >= 16)
+ {
+#if defined(COPY_DICT)
+ m_off = (t & 8) << 11;
+#else
+ m_pos = op;
+ m_pos -= (t & 8) << 11;
+#endif
+ t &= 7;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off += (ip[0] << 6) + (ip[1] >> 2);
+#else
+ m_off += (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_off == 0)
+ goto eof_found;
+ m_off += 0x4000;
+#if defined(LZO1Z)
+ last_m_off = m_off;
+#endif
+#else
+#if defined(LZO1Z)
+ m_pos -= (ip[0] << 6) + (ip[1] >> 2);
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_pos == op)
+ goto eof_found;
+ m_pos -= 0x4000;
+#if defined(LZO1Z)
+ last_m_off = pd((const lzo_bytep)op, m_pos);
+#endif
+#endif
+ }
+ else
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(2);
+ t = 2; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = 1 + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - 1;
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(2);
+ *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+ }
+
+#if defined(COPY_DICT)
+
+ NEED_OP(t+3-1);
+ t += 3-1; COPY_DICT(t,m_off)
+
+#else
+
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
+ {
+ assert((op - m_pos) >= 4);
+#else
+ if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
+ {
+#endif
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *m_pos++; while (--t > 0);
+ }
+ else
+#endif
+ {
+copy_match:
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ do *op++ = *m_pos++; while (--t > 0);
+ }
+
+#endif
+
+match_done:
+#if defined(LZO1Z)
+ t = ip[-1] & 3;
+#else
+ t = ip[-2] & 3;
+#endif
+ if (t == 0)
+ break;
+
+match_next:
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+#if 0
+ do *op++ = *ip++; while (--t > 0);
+#else
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+#endif
+ t = *ip++;
+ } while (TEST_IP && TEST_OP);
+ }
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
+#endif
+
+eof_found:
+ assert(t == 1);
+ *out_len = pd(op, out);
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+
+#if defined(HAVE_NEED_IP)
+input_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_INPUT_OVERRUN;
+#endif
+
+#if defined(HAVE_NEED_OP)
+output_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_OUTPUT_OVERRUN;
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+lookbehind_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_LOOKBEHIND_OVERRUN;
+#endif
+}
+
+#endif
+
+#define LZO_TEST_OVERRUN
+#undef DO_DECOMPRESS
+#define DO_DECOMPRESS lzo1x_decompress_safe
+
+#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS_SAFE)
+
+#if defined(LZO_TEST_OVERRUN)
+# if !defined(LZO_TEST_OVERRUN_INPUT)
+# define LZO_TEST_OVERRUN_INPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_OUTPUT)
+# define LZO_TEST_OVERRUN_OUTPUT 2
+# endif
+# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define LZO_TEST_OVERRUN_LOOKBEHIND
+# endif
+#endif
+
+#undef TEST_IP
+#undef TEST_OP
+#undef TEST_LB
+#undef TEST_LBO
+#undef NEED_IP
+#undef NEED_OP
+#undef HAVE_TEST_IP
+#undef HAVE_TEST_OP
+#undef HAVE_NEED_IP
+#undef HAVE_NEED_OP
+#undef HAVE_ANY_IP
+#undef HAVE_ANY_OP
+
+#if defined(LZO_TEST_OVERRUN_INPUT)
+# if (LZO_TEST_OVERRUN_INPUT >= 1)
+# define TEST_IP (ip < ip_end)
+# endif
+# if (LZO_TEST_OVERRUN_INPUT >= 2)
+# define NEED_IP(x) \
+ if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_OUTPUT)
+# if (LZO_TEST_OVERRUN_OUTPUT >= 1)
+# define TEST_OP (op <= op_end)
+# endif
+# if (LZO_TEST_OVERRUN_OUTPUT >= 2)
+# undef TEST_OP
+# define NEED_OP(x) \
+ if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun
+# endif
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun
+# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun
+#else
+# define TEST_LB(m_pos) ((void) 0)
+# define TEST_LBO(m_pos,o) ((void) 0)
+#endif
+
+#if !defined(LZO_EOF_CODE) && !defined(TEST_IP)
+# define TEST_IP (ip < ip_end)
+#endif
+
+#if defined(TEST_IP)
+# define HAVE_TEST_IP
+#else
+# define TEST_IP 1
+#endif
+#if defined(TEST_OP)
+# define HAVE_TEST_OP
+#else
+# define TEST_OP 1
+#endif
+
+#if defined(NEED_IP)
+# define HAVE_NEED_IP
+#else
+# define NEED_IP(x) ((void) 0)
+#endif
+#if defined(NEED_OP)
+# define HAVE_NEED_OP
+#else
+# define NEED_OP(x) ((void) 0)
+#endif
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
+# define HAVE_ANY_IP
+#endif
+#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
+# define HAVE_ANY_OP
+#endif
+
+#undef __COPY4
+#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
+
+#undef COPY4
+#if defined(LZO_UNALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4(dst,src)
+#elif defined(LZO_ALIGNED_OK_4)
+# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src))
+#endif
+
+#if defined(DO_DECOMPRESS)
+LZO_PUBLIC(int)
+DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len,
+ lzo_bytep out, lzo_uintp out_len,
+ lzo_voidp wrkmem )
+#endif
+{
+ register lzo_bytep op;
+ register const lzo_bytep ip;
+ register lzo_uint t;
+#if defined(COPY_DICT)
+ lzo_uint m_off;
+ const lzo_bytep dict_end;
+#else
+ register const lzo_bytep m_pos;
+#endif
+
+ const lzo_bytep const ip_end = in + in_len;
+#if defined(HAVE_ANY_OP)
+ lzo_bytep const op_end = out + *out_len;
+#endif
+#if defined(LZO1Z)
+ lzo_uint last_m_off = 0;
+#endif
+
+ LZO_UNUSED(wrkmem);
+
+#if defined(COPY_DICT)
+ if (dict)
+ {
+ if (dict_len > M4_MAX_OFFSET)
+ {
+ dict += dict_len - M4_MAX_OFFSET;
+ dict_len = M4_MAX_OFFSET;
+ }
+ dict_end = dict + dict_len;
+ }
+ else
+ {
+ dict_len = 0;
+ dict_end = NULL;
+ }
+#endif
+
+ *out_len = 0;
+
+ op = out;
+ ip = in;
+
+ if (*ip > 17)
+ {
+ t = *ip++ - 17;
+ if (t < 4)
+ goto match_next;
+ assert(t > 0); NEED_OP(t); NEED_IP(t+1);
+ do *op++ = *ip++; while (--t > 0);
+ goto first_literal_run;
+ }
+
+ while (TEST_IP && TEST_OP)
+ {
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 15 + *ip++;
+ }
+ assert(t > 0); NEED_OP(t+3); NEED_IP(t+4);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (PTR_ALIGNED2_4(op,ip))
+ {
+#endif
+ COPY4(op,ip);
+ op += 4; ip += 4;
+ if (--t > 0)
+ {
+ if (t >= 4)
+ {
+ do {
+ COPY4(op,ip);
+ op += 4; ip += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *ip++; while (--t > 0);
+ }
+ else
+ do *op++ = *ip++; while (--t > 0);
+ }
+#if !defined(LZO_UNALIGNED_OK_4)
+ }
+ else
+#endif
+#endif
+#if !defined(LZO_UNALIGNED_OK_4)
+ {
+ *op++ = *ip++; *op++ = *ip++; *op++ = *ip++;
+ do *op++ = *ip++; while (--t > 0);
+ }
+#endif
+
+first_literal_run:
+
+ t = *ip++;
+ if (t >= 16)
+ goto match;
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(3);
+ t = 3; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - (1 + M2_MAX_OFFSET);
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(3);
+ *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+
+ do {
+match:
+ if (t >= 64)
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1X)
+ m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3);
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2);
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ m_off = t & 0x1f;
+ if (m_off >= 0x1c)
+ m_off = last_m_off;
+ else
+ {
+ m_off = 1 + (m_off << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+ }
+ t = (t >> 5) - 1;
+#endif
+#else
+#if defined(LZO1X)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 7;
+ m_pos -= *ip++ << 3;
+ t = (t >> 5) - 1;
+#elif defined(LZO1Y)
+ m_pos = op - 1;
+ m_pos -= (t >> 2) & 3;
+ m_pos -= *ip++ << 2;
+ t = (t >> 4) - 3;
+#elif defined(LZO1Z)
+ {
+ lzo_uint off = t & 0x1f;
+ m_pos = op;
+ if (off >= 0x1c)
+ {
+ assert(last_m_off > 0);
+ m_pos -= last_m_off;
+ }
+ else
+ {
+ off = 1 + (off << 6) + (*ip++ >> 2);
+ m_pos -= off;
+ last_m_off = off;
+ }
+ }
+ t = (t >> 5) - 1;
+#endif
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+ goto copy_match;
+#endif
+ }
+ else if (t >= 32)
+ {
+ t &= 31;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 31 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#else
+#if defined(LZO1Z)
+ {
+ lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2);
+ m_pos = op - off;
+ last_m_off = off;
+ }
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos = op - 1;
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos = op - 1;
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+#endif
+ ip += 2;
+ }
+ else if (t >= 16)
+ {
+#if defined(COPY_DICT)
+ m_off = (t & 8) << 11;
+#else
+ m_pos = op;
+ m_pos -= (t & 8) << 11;
+#endif
+ t &= 7;
+ if (t == 0)
+ {
+ NEED_IP(1);
+ while (*ip == 0)
+ {
+ t += 255;
+ ip++;
+ NEED_IP(1);
+ }
+ t += 7 + *ip++;
+ }
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off += (ip[0] << 6) + (ip[1] >> 2);
+#else
+ m_off += (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_off == 0)
+ goto eof_found;
+ m_off += 0x4000;
+#if defined(LZO1Z)
+ last_m_off = m_off;
+#endif
+#else
+#if defined(LZO1Z)
+ m_pos -= (ip[0] << 6) + (ip[1] >> 2);
+#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN)
+ m_pos -= (* (const lzo_ushortp) ip) >> 2;
+#else
+ m_pos -= (ip[0] >> 2) + (ip[1] << 6);
+#endif
+ ip += 2;
+ if (m_pos == op)
+ goto eof_found;
+ m_pos -= 0x4000;
+#if defined(LZO1Z)
+ last_m_off = pd((const lzo_bytep)op, m_pos);
+#endif
+#endif
+ }
+ else
+ {
+#if defined(COPY_DICT)
+#if defined(LZO1Z)
+ m_off = 1 + (t << 6) + (*ip++ >> 2);
+ last_m_off = m_off;
+#else
+ m_off = 1 + (t >> 2) + (*ip++ << 2);
+#endif
+ NEED_OP(2);
+ t = 2; COPY_DICT(t,m_off)
+#else
+#if defined(LZO1Z)
+ t = 1 + (t << 6) + (*ip++ >> 2);
+ m_pos = op - t;
+ last_m_off = t;
+#else
+ m_pos = op - 1;
+ m_pos -= t >> 2;
+ m_pos -= *ip++ << 2;
+#endif
+ TEST_LB(m_pos); NEED_OP(2);
+ *op++ = *m_pos++; *op++ = *m_pos;
+#endif
+ goto match_done;
+ }
+
+#if defined(COPY_DICT)
+
+ NEED_OP(t+3-1);
+ t += 3-1; COPY_DICT(t,m_off)
+
+#else
+
+ TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1);
+#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4)
+#if !defined(LZO_UNALIGNED_OK_4)
+ if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos))
+ {
+ assert((op - m_pos) >= 4);
+#else
+ if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4)
+ {
+#endif
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4 - (3 - 1);
+ do {
+ COPY4(op,m_pos);
+ op += 4; m_pos += 4; t -= 4;
+ } while (t >= 4);
+ if (t > 0) do *op++ = *m_pos++; while (--t > 0);
+ }
+ else
+#endif
+ {
+copy_match:
+ *op++ = *m_pos++; *op++ = *m_pos++;
+ do *op++ = *m_pos++; while (--t > 0);
+ }
+
+#endif
+
+match_done:
+#if defined(LZO1Z)
+ t = ip[-1] & 3;
+#else
+ t = ip[-2] & 3;
+#endif
+ if (t == 0)
+ break;
+
+match_next:
+ assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1);
+#if 0
+ do *op++ = *ip++; while (--t > 0);
+#else
+ *op++ = *ip++;
+ if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } }
+#endif
+ t = *ip++;
+ } while (TEST_IP && TEST_OP);
+ }
+
+#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
+ *out_len = pd(op, out);
+ return LZO_E_EOF_NOT_FOUND;
+#endif
+
+eof_found:
+ assert(t == 1);
+ *out_len = pd(op, out);
+ return (ip == ip_end ? LZO_E_OK :
+ (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN));
+
+#if defined(HAVE_NEED_IP)
+input_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_INPUT_OVERRUN;
+#endif
+
+#if defined(HAVE_NEED_OP)
+output_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_OUTPUT_OVERRUN;
+#endif
+
+#if defined(LZO_TEST_OVERRUN_LOOKBEHIND)
+lookbehind_overrun:
+ *out_len = pd(op, out);
+ return LZO_E_LOOKBEHIND_OVERRUN;
+#endif
+}
+
+#endif
+
+/***** End of minilzo.c *****/
+
diff --git a/package/cfgfs/src/bundled/minilzo.h b/package/cfgfs/src/bundled/minilzo.h
new file mode 100644
index 000000000..04bf4e140
--- /dev/null
+++ b/package/cfgfs/src/bundled/minilzo.h
@@ -0,0 +1,102 @@
+/* minilzo.h -- mini subset of the LZO real-time data compression library
+
+ This file is part of the LZO real-time data compression library.
+
+ Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+ Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
+ All Rights Reserved.
+
+ The LZO library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ The LZO library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with the LZO library; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Markus F.X.J. Oberhumer
+ <markus@oberhumer.com>
+ http://www.oberhumer.com/opensource/lzo/
+ */
+
+/*
+ * NOTE:
+ * the full LZO package can be found at
+ * http://www.oberhumer.com/opensource/lzo/
+ */
+
+
+#ifndef __MINILZO_H
+#define __MINILZO_H
+
+#define MINILZO_VERSION 0x2020
+
+#ifdef __LZOCONF_H
+# error "you cannot use both LZO and miniLZO"
+#endif
+
+#undef LZO_HAVE_CONFIG_H
+#include "lzoconf.h"
+
+#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
+# error "version mismatch in header files"
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/***********************************************************************
+//
+************************************************************************/
+
+/* Memory required for the wrkmem parameter.
+ * When the required size is 0, you can also pass a NULL pointer.
+ */
+
+#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
+#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
+#define LZO1X_MEM_DECOMPRESS (0)
+
+
+/* compression */
+LZO_EXTERN(int)
+lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem );
+
+/* decompression */
+LZO_EXTERN(int)
+lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+/* safe decompression with overrun testing */
+LZO_EXTERN(int)
+lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
+ lzo_bytep dst, lzo_uintp dst_len,
+ lzo_voidp wrkmem /* NOT USED */ );
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* already included */
+
diff --git a/package/cfgfs/src/c_lzo1x1.c b/package/cfgfs/src/c_lzo1x1.c
new file mode 100644
index 000000000..570f8673c
--- /dev/null
+++ b/package/cfgfs/src/c_lzo1x1.c
@@ -0,0 +1,126 @@
+/* $MirOS: contrib/hosted/fwcf/c_lzo1x1.c,v 1.5 2007/03/13 18:31:07 tg Exp $ */
+
+/*-
+ * MiniLZO (LZO1X-1) compression plug-in for FWCF
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 1, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+ * the utmost extent permitted by applicable law, neither express nor
+ * implied; without malicious intent or gross negligence. In no event
+ * may a licensor, author or contributor be held liable for indirect,
+ * direct, other damage, loss, or other issues arising in any way out
+ * of dealing in the work, even if advised of the possibility of such
+ * damage or existence of a defect, except proven that it results out
+ * of said person's immediate fault when using the work as intended.
+ */
+
+#include <sys/param.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "defs.h"
+#include "compress.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/c_lzo1x1.c,v 1.5 2007/03/13 18:31:07 tg Exp $");
+
+#define C_LZO1X1_T1(a,b) c_lzo1x1_ ## a ## _ ## b
+#define C_LZO1X1_T2(a,b) C_LZO1X1_T1(a,b)
+#define LZO_COMPILE_TIME_ASSERT_HEADER(e) \
+ extern int C_LZO1X1_T2(__LINE__,__lzo_cta)[1-2*!(e)];
+#define MINILZO_CFG_SKIP_LZO1X_DECOMPRESS 1
+#define MINILZO_CFG_SKIP_LZO_PTR 1
+#define MINILZO_CFG_SKIP_LZO_STRING 1
+#include "minilzo.c"
+
+static void c_lzo1x1_load(void) __attribute__((constructor));
+static int c_init(void);
+static int c_compress(char **, char *, size_t)
+ __attribute__((bounded (string, 2, 3)));
+static int c_decompress(char *, size_t, char *, size_t)
+ __attribute__((bounded (string, 1, 2)))
+ __attribute__((bounded (string, 3, 4)));
+
+static fwcf_compressor c_lzo1x1 = {
+ c_init, /* init */
+ c_compress, /* compress */
+ c_decompress, /* decompress */
+ "lzo1x1", /* name */
+ 0x10 /* code */
+};
+
+/* Work-memory needed for compression. Allocate memory in units
+ * of `lzo_align_t' (instead of `char') to make sure it is properly aligned.
+ */
+
+#define HEAP_ALLOC(var,size) \
+ lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
+
+static HEAP_ALLOC(wrkmem,LZO1X_1_MEM_COMPRESS);
+
+static void
+c_lzo1x1_load(void)
+{
+ if (compress_register(&c_lzo1x1))
+ fputs("warning: cannot register compressor 'lzo1x1'!\n", stderr);
+}
+
+static int
+c_init(void)
+{
+ return ((lzo_init() == LZO_E_OK) ? 0 : 1);
+}
+
+static int
+c_compress(char **dst, char *src, size_t len)
+{
+ lzo_bytep ldst;
+ lzo_uint ldlen = len + (len / 16) + 64 + 3;
+
+ if ((ldst = malloc(ldlen)) == NULL)
+ return (-1);
+#ifdef DEBUG
+ fprintf(stderr, "LZO1X-1 compress %lu bytes -> (%lu)",
+ (u_long)len, (u_long)ldlen);
+#endif
+ lzo1x_1_compress((lzo_bytep)src, len, ldst, &ldlen, wrkmem);
+#ifdef DEBUG
+ fprintf(stderr, " %lu bytes\n", (u_long)ldlen);
+#endif
+ *dst = (char *)ldst;
+ return (ldlen);
+}
+
+static int
+c_decompress(char *dst, size_t dstlen, char *src, size_t srclen)
+{
+ lzo_uint ldlen = dstlen;
+ int i;
+
+#ifdef DEBUG
+ fprintf(stderr, "LZO1X decompress %lu -> %lu bytes\n",
+ (u_long)srclen, (u_long)dstlen);
+#endif
+ if (((i = lzo1x_decompress_safe((lzo_bytep)src, srclen, (lzo_bytep)dst,
+ &ldlen, wrkmem)) == LZO_E_OK) || (i == LZO_E_INPUT_NOT_CONSUMED))
+ return (ldlen);
+#ifdef DEBUG
+ fprintf(stderr, "LZO1X decompress error code %d\n", i);
+#endif
+ return (-1);
+}
diff --git a/package/cfgfs/src/c_null.c b/package/cfgfs/src/c_null.c
new file mode 100644
index 000000000..4806ae261
--- /dev/null
+++ b/package/cfgfs/src/c_null.c
@@ -0,0 +1,78 @@
+/* $MirOS: contrib/hosted/fwcf/c_null.c,v 1.5 2006/09/23 23:46:35 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "defs.h"
+#include "compress.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/c_null.c,v 1.5 2006/09/23 23:46:35 tg Exp $");
+
+static void c_null_load(void) __attribute__((constructor));
+static int c_init(void);
+static int c_compress(char **, char *, size_t)
+ __attribute__((bounded (string, 2, 3)));
+static int c_decompress(char *, size_t, char *, size_t)
+ __attribute__((bounded (string, 1, 2)))
+ __attribute__((bounded (string, 3, 4)));
+
+static fwcf_compressor c_null = {
+ c_init, /* init */
+ c_compress, /* compress */
+ c_decompress, /* decompress */
+ "null", /* name */
+ 0 /* code */
+};
+
+static void
+c_null_load(void)
+{
+ if (compress_register(&c_null))
+ fputs("warning: cannot register compressor 'null'!\n", stderr);
+}
+
+static int
+c_init(void)
+{
+ return (0);
+}
+
+static int
+c_compress(char **dst, char *src, size_t len)
+{
+ if ((*dst = malloc(len)) == NULL)
+ return (-1);
+ memcpy(*dst, src, len);
+ return (len);
+}
+
+static int
+c_decompress(char *dst, size_t dstlen, char *src, size_t srclen)
+{
+ size_t len = MIN(srclen, dstlen);
+ memmove(dst, src, len);
+ return (len);
+}
diff --git a/package/cfgfs/src/c_zlib.c b/package/cfgfs/src/c_zlib.c
new file mode 100644
index 000000000..2285f2eeb
--- /dev/null
+++ b/package/cfgfs/src/c_zlib.c
@@ -0,0 +1,84 @@
+/* $MirOS: contrib/hosted/fwcf/c_zlib.c,v 1.4 2006/09/23 23:46:35 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <zlib.h>
+
+#include "defs.h"
+#include "compress.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/c_zlib.c,v 1.4 2006/09/23 23:46:35 tg Exp $");
+
+static void c_zlib_load(void) __attribute__((constructor));
+static int c_init(void);
+static int c_compress(char **, char *, size_t)
+ __attribute__((bounded (string, 2, 3)));
+static int c_decompress(char *, size_t, char *, size_t)
+ __attribute__((bounded (string, 1, 2)))
+ __attribute__((bounded (string, 3, 4)));
+
+static fwcf_compressor c_zlib = {
+ c_init, /* init */
+ c_compress, /* compress */
+ c_decompress, /* decompress */
+ "zlib", /* name */
+ 0x01 /* code */
+};
+
+static void
+c_zlib_load(void)
+{
+ if (compress_register(&c_zlib))
+ fputs("warning: cannot register compressor 'zlib'!\n", stderr);
+}
+
+static int
+c_init(void)
+{
+ return (0);
+}
+
+static int
+c_compress(char **dst, char *src, size_t len)
+{
+ uLongf dstlen;
+
+ if (dst == NULL)
+ return (-1);
+ dstlen = compressBound(len);
+ if ((*dst = malloc(dstlen)) == NULL)
+ return (-1);
+ return ((compress2((uint8_t *)*dst, &dstlen, (uint8_t *)src, len,
+ 9) == Z_OK) ? (int)dstlen : -1);
+}
+
+static int
+c_decompress(char *dst, size_t dstlen, char *src, size_t srclen)
+{
+ uLongf len = dstlen;
+
+ return ((uncompress((uint8_t *)dst, &len, (uint8_t *)src,
+ srclen) == Z_OK) ? (int)len : -1);
+}
diff --git a/package/cfgfs/src/compress.c b/package/cfgfs/src/compress.c
new file mode 100644
index 000000000..b75959c4e
--- /dev/null
+++ b/package/cfgfs/src/compress.c
@@ -0,0 +1,78 @@
+/* $MirOS: contrib/hosted/fwcf/compress.c,v 1.7 2006/09/23 23:46:35 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <stdlib.h>
+
+#include "defs.h"
+#include "compress.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/compress.c,v 1.7 2006/09/23 23:46:35 tg Exp $");
+
+static void compress_initialise(void);
+
+static fwcf_compressor *fwcf_compressors = NULL;
+
+int
+compress_register(fwcf_compressor *e)
+{
+ compress_initialise();
+ if (e == NULL)
+ return (1);
+
+ if ((e->init == NULL) || (e->compress == NULL) ||
+ (e->decompress == NULL) || (e->name == NULL))
+ return (1);
+ if (fwcf_compressors[e->code].name != NULL)
+ return (2);
+
+ fwcf_compressors[e->code] = *e;
+ return (0);
+}
+
+fwcf_compressor *
+compress_enumerate(void)
+{
+ int i;
+ fwcf_compressor *rv = NULL;
+
+ compress_initialise();
+ for (i = 0; i < 256; ++i)
+ if (fwcf_compressors[i].name != NULL) {
+ if (fwcf_compressors[i].code == i)
+ rv = fwcf_compressors;
+ else
+ errx(1, "fwcf compressor registry invalid");
+ }
+ return (rv);
+}
+
+static void
+compress_initialise(void)
+{
+ if (fwcf_compressors != NULL)
+ return;
+ if ((fwcf_compressors = calloc(256, sizeof (fwcf_compressor))) == NULL)
+ err(1, "calloc");
+}
diff --git a/package/cfgfs/src/compress.h b/package/cfgfs/src/compress.h
new file mode 100644
index 000000000..c421aca5c
--- /dev/null
+++ b/package/cfgfs/src/compress.h
@@ -0,0 +1,52 @@
+/* $MirOS: contrib/hosted/fwcf/compress.h,v 1.10 2007/03/09 22:35:13 tg Exp $ */
+
+/*
+ * This file is part of the FreeWRT project. FreeWRT is copyrighted
+ * material, please see the LICENCE file in the top-level directory
+ * or at http://www.freewrt.org/licence for details.
+ */
+
+#ifndef COMPRESS_H
+#define COMPRESS_H
+
+/* BEGIN of plug-in API description - hook yer proprietary modules here */
+
+/* returns 0 on success, -1 on failure */
+typedef int (*fwcf_compress_init_func)(void);
+/* in: *dst (malloc'd), src, size of source (max. INT_MAX) */
+/* returns size of destination on success, -1 on failure */
+typedef int (*fwcf_compress_work_func)(char **, char *, size_t)
+ __attribute__((bounded (string, 2, 3)));
+/* in: dst, max size of dst, src, size of source (max. INT_MAX) */
+/* returns size of destination on success, -1 on failure */
+typedef int (*fwcf_compress_rev_func)(char *, size_t, char *, size_t)
+ __attribute__((bounded (string, 1, 2)))
+ __attribute__((bounded (string, 3, 4)));
+
+typedef struct FWCF_COMPRESSOR {
+ fwcf_compress_init_func init;
+ fwcf_compress_work_func compress;
+ fwcf_compress_rev_func decompress;
+ const char *name;
+ uint8_t code;
+} fwcf_compressor;
+
+__BEGIN_DECLS
+/* 0=success 1=EINVAL 2=slot already used */
+int compress_register(fwcf_compressor *);
+__END_DECLS
+
+/* END of plug-in API description, version 1.0 */
+
+__BEGIN_DECLS
+/* low-level */
+fwcf_compressor *compress_enumerate(void);
+int compress_list(void);
+
+/* high-level */
+fwcf_compressor *compressor_get(uint8_t);
+int compressor_getbyname(const char *);
+int list_compressors(void);
+__END_DECLS
+
+#endif
diff --git a/package/cfgfs/src/cpr_get.c b/package/cfgfs/src/cpr_get.c
new file mode 100644
index 000000000..71e414130
--- /dev/null
+++ b/package/cfgfs/src/cpr_get.c
@@ -0,0 +1,63 @@
+/* $MirOS: contrib/hosted/fwcf/cpr_get.c,v 1.4 2007/03/09 22:35:13 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006, 2007
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "defs.h"
+#include "compress.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/cpr_get.c,v 1.4 2007/03/09 22:35:13 tg Exp $");
+
+fwcf_compressor *
+compressor_get(uint8_t algo)
+{
+ fwcf_compressor *list;
+
+ if ((list = compress_enumerate()) == NULL)
+ errx(1, "compress_enumerate");
+ if (list[algo].name == NULL)
+ errx(1, "compression algorithm %02Xh not loaded", algo);
+ if (list[algo].init())
+ errx(1, "cannot initialise %s compression", list[algo].name);
+
+ return (&(list[algo]));
+}
+
+int
+compressor_getbyname(const char *s)
+{
+ fwcf_compressor *cl;
+ int i;
+
+ if ((cl = compress_enumerate()) == NULL)
+ errx(1, "no compression algorithms found");
+
+ for (i = 1; i < 256; ++i)
+ if (cl[i].name != NULL)
+ if (!strcasecmp(cl[i].name, s))
+ return (i);
+ return (0);
+}
diff --git a/package/cfgfs/src/cpr_list.c b/package/cfgfs/src/cpr_list.c
new file mode 100644
index 000000000..aafdf590c
--- /dev/null
+++ b/package/cfgfs/src/cpr_list.c
@@ -0,0 +1,46 @@
+/* $MirOS: contrib/hosted/fwcf/cpr_list.c,v 1.4 2006/09/24 03:21:29 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <stdio.h>
+
+#include "defs.h"
+#include "compress.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/cpr_list.c,v 1.4 2006/09/24 03:21:29 tg Exp $");
+
+int
+compress_list(void)
+{
+ fwcf_compressor *cl;
+ int i;
+
+ if ((cl = compress_enumerate()) == NULL)
+ return (1);
+
+ for (i = 0; i < 256; ++i)
+ if (cl[i].name != NULL)
+ printf("%02Xh = %s%s\n", cl[i].code,
+ (i < 0xE0 ? "" : "PRIVATE "), cl[i].name);
+ return (0);
+}
diff --git a/package/cfgfs/src/cpr_lsth.c b/package/cfgfs/src/cpr_lsth.c
new file mode 100644
index 000000000..af5813b08
--- /dev/null
+++ b/package/cfgfs/src/cpr_lsth.c
@@ -0,0 +1,41 @@
+/* $MirOS: contrib/hosted/fwcf/cpr_lsth.c,v 1.3 2006/09/23 23:46:35 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <stdio.h>
+
+#include "defs.h"
+#include "compress.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/cpr_lsth.c,v 1.3 2006/09/23 23:46:35 tg Exp $");
+
+int
+list_compressors(void)
+{
+ int rv;
+
+ printf("List of registered compressors:\n");
+ if ((rv = compress_list()))
+ printf("No compressor registered!\n");
+ return (rv);
+}
diff --git a/package/cfgfs/src/defs.h b/package/cfgfs/src/defs.h
new file mode 100644
index 000000000..33a31c848
--- /dev/null
+++ b/package/cfgfs/src/defs.h
@@ -0,0 +1,34 @@
+/* $MirOS: contrib/hosted/fwcf/defs.h,v 1.7 2007/03/13 18:28:20 tg Exp $ */
+
+/*
+ * This file is part of the FreeWRT project. FreeWRT is copyrighted
+ * material, please see the LICENCE file in the top-level directory
+ * or at http://www.freewrt.org/licence for details.
+ */
+
+#ifndef DEFS_H
+#define DEFS_H
+
+#define DEF_FLASHBLOCK 65536 /* size of a flash block */
+#define DEF_FLASHPART 131072 /* size of the flash partition */
+
+#define FWCF_VER 0x01 /* major version of spec used */
+
+#ifndef __RCSID
+#define __RCSID(x) static const char __rcsid[] __attribute__((used)) = (x)
+#endif
+
+#ifndef BSD
+#define uint8_t u_int8_t
+#define uint16_t u_int16_t
+#define uint32_t u_int32_t
+#define uint64_t u_int64_t
+#endif
+
+#ifndef __dead
+#define __dead __attribute__((noreturn))
+#endif
+
+#include "replace.h" /* strlcpy/strlcat replacement for glibc */
+
+#endif
diff --git a/package/cfgfs/src/ft_creat.c b/package/cfgfs/src/ft_creat.c
new file mode 100644
index 000000000..5838f8647
--- /dev/null
+++ b/package/cfgfs/src/ft_creat.c
@@ -0,0 +1,304 @@
+/* $MirOS: contrib/hosted/fwcf/ft_creat.c,v 1.2 2006/09/23 23:21:04 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/ft_creat.c,v 1.2 2006/09/23 23:21:04 tg Exp $");
+
+static size_t ft_creat(char *);
+static void make_directory(char *, uint32_t, uint32_t, uint32_t, time_t);
+static void make_file(char *, uint8_t *, size_t);
+static void make_symlink(char *, uint8_t *, size_t);
+static void pop_directories(void);
+static void do_chown(char *, uid_t, gid_t);
+static void do_chmod(char *, mode_t);
+static void do_mtime(char *, time_t);
+static char *pfxname(const char *);
+
+static struct a_directory {
+ struct a_directory *next;
+ char *pathname;
+ uid_t owner;
+ gid_t group;
+ mode_t perms;
+ time_t mtime;
+} *directories;
+
+static char basename[PATH_MAX];
+static size_t basename_len;
+
+void
+ft_creatm(char *buf, const char *pathname)
+{
+ directories = NULL;
+ snprintf(basename, sizeof (basename), "%s/", pathname);
+ basename_len = strlen(basename);
+ while (*buf)
+ buf += ft_creat(buf);
+ if (directories != NULL)
+ pop_directories();
+}
+
+static size_t
+ft_creat(char *buf)
+{
+ uint8_t c, *p;
+ char *fname;
+ size_t i, type = 0, size = 0;
+ uint32_t x_uid = 0, x_gid = 0, x_mode = 0;
+ time_t x_mtime = 0;
+
+ i = strlen(buf) + 1;
+ p = (uint8_t *)buf + i;
+ fname = pfxname(buf);
+ while (*p)
+ switch (c = *p++) {
+ case 0x01:
+ /* block special device */
+ type = 1;
+ break;
+ case 0x02:
+ /* character special device */
+ type = 1;
+ break;
+ case 0x03:
+ /* symbolic link */
+ type = 2;
+ break;
+ case 0x04:
+ /* hard link */
+ type = 1;
+ break;
+ case 0x05:
+ /* directory */
+ type = 3;
+ break;
+ case 0x10:
+ /* modification time */
+ x_mtime = LOADD(p);
+ p += 4;
+ break;
+ case 'g':
+ case 'G':
+ x_gid = (c == 'g') ? *p : LOADD(p);
+ p += (c == 'g') ? 1 : 4;
+ break;
+ case 'i':
+ case 'I':
+ /* x_inode = (c == 'i') ? *p : LOADW(p); */
+ p += (c == 'i') ? 1 : 2;
+ break;
+ case 'm':
+ case 'M':
+ x_mode = (c == 'm') ? LOADW(p) : LOADD(p);
+ p += (c == 'm') ? 2 : 4;
+ break;
+ case 'u':
+ case 'U':
+ x_uid = (c == 'u') ? *p : LOADD(p);
+ p += (c == 'u') ? 1 : 4;
+ break;
+ case 's':
+ case 'S':
+ size = (c == 's') ? *p : LOADT(p);
+ p += (c == 's') ? 1 : 3;
+ break;
+ default:
+ errx(1, "unknown attribute %02Xh", c);
+ }
+ /* skip over final NUL byte */
+ ++p;
+
+ switch (type) {
+ case 1:
+ /* no data, not implemented */
+ if (size)
+ fputs("WARN: size not allowed, ignoring\n", stderr);
+ size = 0;
+ break;
+ case 2:
+ /* symbolic link */
+ make_symlink(fname, p, size);
+ x_mtime = 0;
+ x_mode = 0;
+ break;
+ case 3:
+ /* directory */
+ if (size)
+ fputs("WARN: size not allowed, ignoring\n", stderr);
+ size = 0;
+ make_directory(fname, x_mode, x_uid, x_gid, x_mtime);
+ goto notfile;
+ break;
+ case 0:
+ /* regular file */
+ make_file(fname, p, size);
+ break;
+ default:
+ abort();
+ }
+
+ if (x_uid || x_gid)
+ do_chown(fname, x_uid, x_gid);
+
+ if (x_mode)
+ do_chmod(fname, x_mode);
+
+ if (x_mtime)
+ do_mtime(fname, x_mtime);
+
+ notfile:
+ if (type != 3)
+ free(fname);
+
+ return ((p - (uint8_t *)buf) + size);
+}
+
+static void
+make_directory(char *n, uint32_t m, uint32_t u, uint32_t g, time_t t)
+{
+ struct a_directory *newdir;
+
+ if ((newdir = malloc(sizeof (struct a_directory))) == NULL)
+ err(1, "out of memory");
+
+ newdir->next = directories;
+ directories = newdir;
+
+ newdir->pathname = n;
+ newdir->owner = u;
+ newdir->group = g;
+ newdir->perms = m;
+ newdir->mtime = t;
+
+ if (mkdir(n, 0700))
+ if (errno != EEXIST)
+ warn("mkdir %s", n);
+}
+
+static void
+make_file(char *n, uint8_t *buf, size_t len)
+{
+ int fd;
+
+ unlink(n);
+
+ if ((fd = open(n, O_WRONLY | O_CREAT | O_TRUNC, 0700)) < 0) {
+ warn("open %s", n);
+ return;
+ }
+
+ if ((size_t)write(fd, buf, len) != len)
+ warn("could not write %lu bytes", (u_long)len);
+
+ if (close(fd))
+ warn("close");
+}
+
+static void
+make_symlink(char *n, uint8_t *buf, size_t len)
+{
+ char target[len + 1];
+
+ memcpy(target, buf, len);
+ target[len] = '\0';
+
+ unlink(n);
+
+ if (symlink(target, n))
+ warn("symlink %s -> %s", n, target);
+}
+
+static void
+pop_directories(void)
+{
+ struct a_directory *p;
+
+ while ((p = directories) != NULL) {
+ directories = p->next;
+
+ if (p->pathname == NULL)
+ warnx("pathname for a directory is NULL");
+ else {
+ do_chown(p->pathname, p->owner, p->group);
+ do_chmod(p->pathname, p->perms);
+ do_mtime(p->pathname, p->mtime);
+ free(p->pathname);
+ }
+ free(p);
+ }
+}
+
+static void
+do_chown(char *n, uid_t o, gid_t g)
+{
+ if (lchown(n, o, g))
+ warn("lchown %d:%d %s", (int)o, (int)g, n);
+}
+
+static void
+do_chmod(char *n, mode_t m)
+{
+ if (chmod(n, m & 07777))
+ warn("lchmod 0%o %s", m & 07777, n);
+}
+
+static void
+do_mtime(char *n, time_t t)
+{
+ struct timeval tv[2] = { {0,0}, {0,0} };
+
+ tv[1].tv_sec = t;
+ if (utimes(n, tv))
+ warn("utimes %d %s", (int)t, n);
+}
+
+static char *
+pfxname(const char *component)
+{
+ char *foo;
+ size_t len, x;
+
+ len = basename_len + (x = strlen(component) + /* NUL */ 1);
+ if ((foo = malloc(len)) == NULL)
+ err(1, "out of memory");
+ memcpy(foo, basename, basename_len);
+ if ((component[0] == '.') && (component[1] == '\0'))
+ foo[basename_len] = '\0';
+ else
+ memcpy(foo + basename_len, component, x);
+
+ return (foo);
+}
diff --git a/package/cfgfs/src/ft_dump.c b/package/cfgfs/src/ft_dump.c
new file mode 100644
index 000000000..ed702ba28
--- /dev/null
+++ b/package/cfgfs/src/ft_dump.c
@@ -0,0 +1,135 @@
+/* $MirOS: contrib/hosted/fwcf/ft_dump.c,v 1.5 2006/09/23 23:21:04 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/ft_dump.c,v 1.5 2006/09/23 23:21:04 tg Exp $");
+
+static int ft_dumpfile(char *);
+
+void
+ft_dump(char *buf)
+{
+ while (*buf)
+ buf += ft_dumpfile(buf);
+}
+
+static int
+ft_dumpfile(char *buf)
+{
+ uint8_t c;
+ int i, type = 0, size = 0;
+ uint8_t *p;
+ uint32_t x;
+
+ i = strlen(buf) + 1;
+ printf("\nNAME=%s\n", buf);
+ p = (uint8_t *)buf + i;
+ while (*p)
+ switch (c = *p++) {
+ case 0x01:
+ printf("BLOCK\n");
+ type = 1;
+ break;
+ case 0x02:
+ printf("CHARACTER\n");
+ type = 1;
+ break;
+ case 0x03:
+ printf("SYMLINK\n");
+ type = 2;
+ break;
+ case 0x04:
+ printf("HARDLINK\n");
+ type = 1;
+ break;
+ case 0x05:
+ printf("DIRECTORY\n");
+ type = 1;
+ break;
+ case 0x10:
+ {
+ time_t y = LOADD(p);
+ p += 4;
+ printf("MTIME=%d -> %s", (int)y, ctime(&y));
+ break;
+ }
+ case 'g':
+ case 'G':
+ case 'u':
+ case 'U':
+ x = (c & 0x20) ? *p : LOADD(p);
+ p += (c & 0x20) ? 1 : 4;
+ printf("%cID=%d\n", c & ~0x20, x);
+ break;
+ case 'i':
+ case 'I':
+ x = (c == 'i') ? *p : LOADW(p);
+ p += (c == 'i') ? 1 : 2;
+ printf("INODE=%d\n", x);
+ break;
+ case 'm':
+ case 'M':
+ x = (c == 'm') ? LOADW(p) : LOADD(p);
+ p += (c == 'm') ? 2 : 4;
+ printf("MODE=0%o\n", x);
+ break;
+ case 's':
+ case 'S':
+ x = (c == 's') ? *p : LOADT(p);
+ p += (c == 's') ? 1 : 3;
+ printf("SIZE=%d\n", size = x);
+ break;
+ default:
+ errx(1, "unknown attribute %02Xh", c);
+ }
+ ++p;
+ if (type == 2) {
+ char *target;
+
+ if ((target = malloc(size + 1)) == NULL)
+ err(1, "malloc");
+ memcpy(target, p, size);
+ target[size] = '\0';
+ printf("LINK_TARGET=%s\n", target);
+ free(target);
+ } else if (type == 1) {
+ if (size)
+ printf("WARN: size not allowed, ignoring\n");
+ size = 0;
+ } else {
+ printf("BEGIN DATA\n");
+ fflush(stdout);
+ write(STDOUT_FILENO, p, size);
+ printf("\nEND DATA\n");
+ }
+ return ((p - (uint8_t *)buf) + size);
+}
diff --git a/package/cfgfs/src/ft_pack.c b/package/cfgfs/src/ft_pack.c
new file mode 100644
index 000000000..5d04f8b5c
--- /dev/null
+++ b/package/cfgfs/src/ft_pack.c
@@ -0,0 +1,134 @@
+/* $MirOS: contrib/hosted/fwcf/ft_pack.c,v 1.7 2006/09/23 23:21:04 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "fts_subs.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/ft_pack.c,v 1.7 2006/09/23 23:21:04 tg Exp $");
+
+char *
+ft_pack(ftsf_entry *e)
+{
+ char f_header[4096], *hdrptr = f_header;
+ size_t hdrleft = sizeof (f_header), k;
+ char *f_data = NULL, *rv;
+ off_t e_size;
+
+ if (e == NULL)
+ return (NULL);
+ if ((e->etype != FTSF_FILE) && (e->etype != FTSF_SYMLINK) &&
+ (e->etype != FTSF_DIR))
+ return (NULL);
+
+ e_size = e->statp->st_size;
+
+ if ((k = strlcpy(hdrptr, e->pathname, hdrleft)) >= hdrleft)
+ return (NULL);
+ hdrptr += ++k;
+ hdrleft -= k;
+
+ if (e->etype == FTSF_SYMLINK) {
+ STOREB(0x03);
+ e->statp->st_mtime = 0;
+ e->statp->st_mode = 0;
+ } else if (e->etype == FTSF_DIR) {
+ STOREB(0x05);
+ e_size = 0;
+ }
+
+ if (e->statp->st_mtime) {
+ STOREB(0x10);
+ STORED(e->statp->st_mtime);
+ }
+
+ if (e->statp->st_gid > 0xFF) {
+ STOREB('G');
+ STORED(e->statp->st_gid);
+ } else if (e->statp->st_gid) {
+ STOREB('g');
+ STOREB(e->statp->st_gid);
+ }
+
+ if (e->statp->st_mode > 0xFFFF) {
+ STOREB('M');
+ STORED(e->statp->st_mode);
+ } else if (e->statp->st_mode) {
+ STOREB('m');
+ STOREW(e->statp->st_mode);
+ }
+
+ if (e->statp->st_uid > 0xFF) {
+ STOREB('U');
+ STORED(e->statp->st_uid);
+ } else if (e->statp->st_uid) {
+ STOREB('u');
+ STOREB(e->statp->st_uid);
+ }
+
+ /* e_size is zero for everything except files and symlinks */
+ if (e_size > 0xFF) {
+ STOREB('S');
+ STORET(e_size);
+ } else if (e_size) {
+ STOREB('s');
+ STOREB(e_size);
+ }
+
+ STOREB(0);
+
+ if (e_size) {
+ if ((f_data = malloc(e_size)) == NULL)
+ return (NULL);
+ if (asprintf(&rv, "%s/%s", ftsf_prefix, e->pathname) == -1)
+ return (NULL);
+ if (e->etype == FTSF_SYMLINK) {
+ if (readlink(rv, f_data, e_size) != e_size)
+ return (NULL);
+ } else {
+ int fd;
+
+ if ((fd = open(rv, O_RDONLY, 0)) < 0)
+ return (NULL);
+ if (read(fd, f_data, e_size) != e_size)
+ return (NULL);
+ close(fd);
+ }
+ free(rv);
+ }
+ k = sizeof (size_t) + (hdrptr - f_header) + e_size;
+ if ((rv = malloc(k)) == NULL)
+ return (NULL);
+ *(size_t *)rv = k;
+ memcpy(rv + sizeof (size_t), f_header, hdrptr - f_header);
+ memcpy(rv + sizeof (size_t) + (hdrptr - f_header), f_data, e_size);
+ return (rv);
+}
diff --git a/package/cfgfs/src/ft_packm.c b/package/cfgfs/src/ft_packm.c
new file mode 100644
index 000000000..5803bae5e
--- /dev/null
+++ b/package/cfgfs/src/ft_packm.c
@@ -0,0 +1,71 @@
+/* $MirOS: contrib/hosted/fwcf/ft_packm.c,v 1.4 2006/09/23 23:21:04 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "defs.h"
+#include "fts_subs.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/ft_packm.c,v 1.4 2006/09/23 23:21:04 tg Exp $");
+
+char *
+ft_packm(void)
+{
+ ftsf_entry e;
+ int i;
+ char *rv = NULL, *rv2, *afile;
+ size_t len = 1 + sizeof (size_t), k, pos = sizeof (size_t);
+
+ while ((i = ftsf_next(&e)) > 0) {
+ //ftsf_debugent(&e);
+ if ((e.etype != FTSF_FILE) && (e.etype != FTSF_SYMLINK) &&
+ (e.etype != FTSF_DIR))
+ continue;
+ if ((afile = ft_pack(&e)) == NULL)
+ errx(1, "cannot pack %s/%s", ftsf_prefix, e.pathname);
+ len += (k = *(size_t *)afile - sizeof (size_t));
+ if ((rv2 = realloc(rv, len)) == NULL) {
+ i = errno;
+ free(rv);
+ errno = i;
+ err(1, "malloc");
+ }
+ rv = rv2;
+ memcpy(rv + pos, afile + sizeof (size_t), k);
+ pos += k;
+ free(afile);
+ }
+ if (i < 0)
+ errx(1, "ft_packm failed in fts");
+ if (rv == NULL)
+ if ((rv = malloc(len)) == NULL)
+ err(1, "malloc");
+ rv[len - 1] = '\0';
+ *(size_t *)rv = len;
+ return (rv);
+}
diff --git a/package/cfgfs/src/fts.c b/package/cfgfs/src/fts.c
new file mode 100644
index 000000000..e271ed538
--- /dev/null
+++ b/package/cfgfs/src/fts.c
@@ -0,0 +1,1118 @@
+/*-
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__)
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
+#endif /* LIBC_SCCS and not lint */
+
+/* Hybrid of uClinux-dist/glibc/io/fts.c and MirBSD src/lib/libc/gen/fts.c */
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/statfs.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <errno.h>
+#ifdef __OpenBSD__
+#include <fts.h>
+#else
+#include "fts_gnu.h"
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "defs.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/fts.c,v 1.3 2007/07/02 14:50:21 tg Exp $");
+
+#define internal_function
+
+/* Largest alignment size needed, minus one.
+ Usually long double is the worst case. */
+#ifndef ALIGNBYTES
+#define ALIGNBYTES (__alignof__ (long double) - 1)
+#endif
+/* Align P to that size. */
+#ifndef ALIGN
+#define ALIGN(p) (((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
+#endif
+
+
+static FTSENT *fts_alloc __P((FTS *, const char *, int)) internal_function;
+static FTSENT *fts_build __P((FTS *, int)) internal_function;
+static void fts_lfree __P((FTSENT *)) internal_function;
+static void fts_load __P((FTS *, FTSENT *)) internal_function;
+static size_t fts_maxarglen __P((char * const *)) internal_function;
+static void fts_padjust __P((FTS *, FTSENT *)) internal_function;
+static int fts_palloc __P((FTS *, size_t)) internal_function;
+static FTSENT *fts_sort __P((FTS *, FTSENT *, int)) internal_function;
+static u_short fts_stat __P((FTS *, FTSENT *, int)) internal_function;
+static int fts_safe_changedir(FTS *, FTSENT *, int, char *);
+
+#ifndef MAX
+#define MAX(a, b) ({ __typeof__ (a) _a = (a); \
+ __typeof__ (b) _b = (b); \
+ _a > _b ? _a : _b; })
+#endif
+
+#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
+
+#define CLR(opt) (sp->fts_options &= ~(opt))
+#define ISSET(opt) (sp->fts_options & (opt))
+#define SET(opt) (sp->fts_options |= (opt))
+
+#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
+
+/* fts_build flags */
+#define BCHILD 1 /* fts_children */
+#define BNAMES 2 /* fts_children, names only */
+#define BREAD 3 /* fts_read */
+
+FTS *
+fts_open(argv, options, compar)
+ char * const *argv;
+ register int options;
+ int (*compar) __P((const FTSENT **, const FTSENT **));
+{
+ register FTS *sp;
+ register FTSENT *p, *root;
+ register int nitems;
+ FTSENT *parent, *tmp;
+ int len;
+
+ /* Options check. */
+ if (options & ~FTS_OPTIONMASK) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ /* Allocate/initialize the stream */
+ if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
+ return (NULL);
+ memset(sp, 0, sizeof(FTS));
+ sp->fts_compar = (int (*) __P((const void *, const void *))) compar;
+ sp->fts_options = options;
+
+ /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
+ if (ISSET(FTS_LOGICAL))
+ SET(FTS_NOCHDIR);
+
+ /*
+ * Start out with 1K of path space, and enough, in any case,
+ * to hold the user's paths.
+ */
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+ if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+ goto mem1;
+
+ /* Allocate/initialize root's parent. */
+ if ((parent = fts_alloc(sp, "", 0)) == NULL)
+ goto mem2;
+ parent->fts_level = FTS_ROOTPARENTLEVEL;
+
+ /* Allocate/initialize root(s). */
+ for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
+ /* Don't allow zero-length paths. */
+ if ((len = strlen(*argv)) == 0) {
+ errno = ENOENT;
+ goto mem3;
+ }
+
+ p = fts_alloc(sp, *argv, len);
+ p->fts_level = FTS_ROOTLEVEL;
+ p->fts_parent = parent;
+ p->fts_accpath = p->fts_name;
+ p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
+
+ /* Command-line "." and ".." are real directories. */
+ if (p->fts_info == FTS_DOT)
+ p->fts_info = FTS_D;
+
+ /*
+ * If comparison routine supplied, traverse in sorted
+ * order; otherwise traverse in the order specified.
+ */
+ if (compar) {
+ p->fts_link = root;
+ root = p;
+ } else {
+ p->fts_link = NULL;
+ if (root == NULL)
+ tmp = root = p;
+ else {
+ tmp->fts_link = p;
+ tmp = p;
+ }
+ }
+ }
+ if (compar && nitems > 1)
+ root = fts_sort(sp, root, nitems);
+
+ /*
+ * Allocate a dummy pointer and make fts_read think that we've just
+ * finished the node before the root(s); set p->fts_info to FTS_INIT
+ * so that everything about the "current" node is ignored.
+ */
+ if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
+ goto mem3;
+ sp->fts_cur->fts_link = root;
+ sp->fts_cur->fts_info = FTS_INIT;
+
+ /*
+ * If using chdir(2), grab a file descriptor pointing to dot to ensure
+ * that we can get back here; this could be avoided for some paths,
+ * but almost certainly not worth the effort. Slashes, symbolic links,
+ * and ".." are all fairly nasty problems. Note, if we can't get the
+ * descriptor we run anyway, just more slowly.
+ */
+ if (!ISSET(FTS_NOCHDIR)
+ && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
+ SET(FTS_NOCHDIR);
+
+ return (sp);
+
+mem3: fts_lfree(root);
+ free(parent);
+mem2: free(sp->fts_path);
+mem1: free(sp);
+ return (NULL);
+}
+
+static void
+internal_function
+fts_load(sp, p)
+ FTS *sp;
+ register FTSENT *p;
+{
+ register int len;
+ register char *cp;
+
+ /*
+ * Load the stream structure for the next traversal. Since we don't
+ * actually enter the directory until after the preorder visit, set
+ * the fts_accpath field specially so the chdir gets done to the right
+ * place and the user can access the first node. From fts_open it's
+ * known that the path will fit.
+ */
+ len = p->fts_pathlen = p->fts_namelen;
+ memmove(sp->fts_path, p->fts_name, len + 1);
+ if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
+ len = strlen(++cp);
+ memmove(p->fts_name, cp, len + 1);
+ p->fts_namelen = len;
+ }
+ p->fts_accpath = p->fts_path = sp->fts_path;
+ sp->fts_dev = p->fts_dev;
+}
+
+int
+fts_close(sp)
+ FTS *sp;
+{
+ register FTSENT *freep, *p;
+ int saved_errno;
+
+ /*
+ * This still works if we haven't read anything -- the dummy structure
+ * points to the root list, so we step through to the end of the root
+ * list which has a valid parent pointer.
+ */
+ if (sp->fts_cur) {
+ for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+ freep = p;
+ p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
+ free(freep);
+ }
+ free(p);
+ }
+
+ /* Free up child linked list, sort array, path buffer. */
+ if (sp->fts_child)
+ fts_lfree(sp->fts_child);
+ if (sp->fts_array)
+ free(sp->fts_array);
+ free(sp->fts_path);
+
+ /* Return to original directory, save errno if necessary. */
+ if (!ISSET(FTS_NOCHDIR)) {
+ saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
+ (void)close(sp->fts_rfd);
+
+ /* Set errno and return. */
+ if (saved_errno != 0) {
+ /* Free up the stream pointer. */
+ free(sp);
+ errno = saved_errno;
+ return (-1);
+ }
+ }
+
+ /* Free up the stream pointer. */
+ free(sp);
+ return (0);
+}
+
+/*
+ * Special case of "/" at the end of the path so that slashes aren't
+ * appended which would cause paths to be written as "....//foo".
+ */
+#define NAPPEND(p) \
+ (p->fts_path[p->fts_pathlen - 1] == '/' \
+ ? p->fts_pathlen - 1 : p->fts_pathlen)
+
+FTSENT *
+fts_read(sp)
+ register FTS *sp;
+{
+ register FTSENT *p, *tmp;
+ register int instr;
+ register char *t;
+ int saved_errno;
+
+ /* If finished or unrecoverable error, return NULL. */
+ if (sp->fts_cur == NULL || ISSET(FTS_STOP))
+ return (NULL);
+
+ /* Set current node pointer. */
+ p = sp->fts_cur;
+
+ /* Save and zero out user instructions. */
+ instr = p->fts_instr;
+ p->fts_instr = FTS_NOINSTR;
+
+ /* Any type of file may be re-visited; re-stat and re-turn. */
+ if (instr == FTS_AGAIN) {
+ p->fts_info = fts_stat(sp, p, 0);
+ return (p);
+ }
+
+ /*
+ * Following a symlink -- SLNONE test allows application to see
+ * SLNONE and recover. If indirecting through a symlink, have
+ * keep a pointer to current location. If unable to get that
+ * pointer, follow fails.
+ */
+ if (instr == FTS_FOLLOW &&
+ (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
+ p->fts_info = fts_stat(sp, p, 1);
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+ if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
+ p->fts_errno = errno;
+ p->fts_info = FTS_ERR;
+ } else
+ p->fts_flags |= FTS_SYMFOLLOW;
+ }
+ return (p);
+ }
+
+ /* Directory in pre-order. */
+ if (p->fts_info == FTS_D) {
+ /* If skipped or crossed mount point, do post-order visit. */
+ if (instr == FTS_SKIP ||
+ (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
+ if (p->fts_flags & FTS_SYMFOLLOW)
+ (void)close(p->fts_symfd);
+ if (sp->fts_child) {
+ fts_lfree(sp->fts_child);
+ sp->fts_child = NULL;
+ }
+ p->fts_info = FTS_DP;
+ return (p);
+ }
+
+ /* Rebuild if only read the names and now traversing. */
+ if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
+ CLR(FTS_NAMEONLY);
+ fts_lfree(sp->fts_child);
+ sp->fts_child = NULL;
+ }
+
+ /*
+ * Cd to the subdirectory.
+ *
+ * If have already read and now fail to chdir, whack the list
+ * to make the names come out right, and set the parent errno
+ * so the application will eventually get an error condition.
+ * Set the FTS_DONTCHDIR flag so that when we logically change
+ * directories back to the parent we don't do a chdir.
+ *
+ * If haven't read do so. If the read fails, fts_build sets
+ * FTS_STOP or the fts_info field of the node.
+ */
+ if (sp->fts_child != NULL) {
+ if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
+ p->fts_errno = errno;
+ p->fts_flags |= FTS_DONTCHDIR;
+ for (p = sp->fts_child; p != NULL;
+ p = p->fts_link)
+ p->fts_accpath =
+ p->fts_parent->fts_accpath;
+ }
+ } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
+ if (ISSET(FTS_STOP))
+ return (NULL);
+ return (p);
+ }
+ p = sp->fts_child;
+ sp->fts_child = NULL;
+ goto name;
+ }
+
+ /* Move to the next node on this level. */
+next: tmp = p;
+ if ((p = p->fts_link) != NULL) {
+ free(tmp);
+
+ /*
+ * If reached the top, return to the original directory (or
+ * the root of the tree), and load the paths for the next root.
+ */
+ if (p->fts_level == FTS_ROOTLEVEL) {
+ if (FCHDIR(sp, sp->fts_rfd)) {
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ fts_load(sp, p);
+ return (sp->fts_cur = p);
+ }
+
+ /*
+ * User may have called fts_set on the node. If skipped,
+ * ignore. If followed, get a file descriptor so we can
+ * get back if necessary.
+ */
+ if (p->fts_instr == FTS_SKIP)
+ goto next;
+ if (p->fts_instr == FTS_FOLLOW) {
+ p->fts_info = fts_stat(sp, p, 1);
+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+ if ((p->fts_symfd =
+ open(".", O_RDONLY, 0)) < 0) {
+ p->fts_errno = errno;
+ p->fts_info = FTS_ERR;
+ } else
+ p->fts_flags |= FTS_SYMFOLLOW;
+ }
+ p->fts_instr = FTS_NOINSTR;
+ }
+
+name: t = sp->fts_path + NAPPEND(p->fts_parent);
+ *t++ = '/';
+ memmove(t, p->fts_name, p->fts_namelen + 1);
+ return (sp->fts_cur = p);
+ }
+
+ /* Move up to the parent node. */
+ p = tmp->fts_parent;
+ free(tmp);
+
+ if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+ /*
+ * Done; free everything up and set errno to 0 so the user
+ * can distinguish between error and EOF.
+ */
+ free(p);
+ errno = 0;
+ return (sp->fts_cur = NULL);
+ }
+
+ /* NUL terminate the pathname. */
+ sp->fts_path[p->fts_pathlen] = '\0';
+
+ /*
+ * Return to the parent directory. If at a root node or came through
+ * a symlink, go back through the file descriptor. Otherwise, cd up
+ * one directory.
+ */
+ if (p->fts_level == FTS_ROOTLEVEL) {
+ if (FCHDIR(sp, sp->fts_rfd)) {
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ } else if (p->fts_flags & FTS_SYMFOLLOW) {
+ if (FCHDIR(sp, p->fts_symfd)) {
+ saved_errno = errno;
+ (void)close(p->fts_symfd);
+ errno = saved_errno;
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ (void)close(p->fts_symfd);
+ } else if (!(p->fts_flags & FTS_DONTCHDIR) &&
+ fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
+ SET(FTS_STOP);
+ return (NULL);
+ }
+ p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
+ return (sp->fts_cur = p);
+}
+
+/*
+ * Fts_set takes the stream as an argument although it's not used in this
+ * implementation; it would be necessary if anyone wanted to add global
+ * semantics to fts using fts_set. An error return is allowed for similar
+ * reasons.
+ */
+/* ARGSUSED */
+int
+fts_set(sp, p, instr)
+ FTS *sp;
+ FTSENT *p;
+ int instr;
+{
+ if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
+ instr != FTS_NOINSTR && instr != FTS_SKIP) {
+ errno = EINVAL;
+ return (1);
+ }
+ p->fts_instr = instr;
+ return (0);
+}
+
+FTSENT *
+fts_children(sp, instr)
+ register FTS *sp;
+ int instr;
+{
+ register FTSENT *p;
+ int fd;
+
+ if (instr != 0 && instr != FTS_NAMEONLY) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ /* Set current node pointer. */
+ p = sp->fts_cur;
+
+ /*
+ * Errno set to 0 so user can distinguish empty directory from
+ * an error.
+ */
+ errno = 0;
+
+ /* Fatal errors stop here. */
+ if (ISSET(FTS_STOP))
+ return (NULL);
+
+ /* Return logical hierarchy of user's arguments. */
+ if (p->fts_info == FTS_INIT)
+ return (p->fts_link);
+
+ /*
+ * If not a directory being visited in pre-order, stop here. Could
+ * allow FTS_DNR, assuming the user has fixed the problem, but the
+ * same effect is available with FTS_AGAIN.
+ */
+ if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
+ return (NULL);
+
+ /* Free up any previous child list. */
+ if (sp->fts_child != NULL)
+ fts_lfree(sp->fts_child);
+
+ if (instr == FTS_NAMEONLY) {
+ SET(FTS_NAMEONLY);
+ instr = BNAMES;
+ } else
+ instr = BCHILD;
+
+ /*
+ * If using chdir on a relative path and called BEFORE fts_read does
+ * its chdir to the root of a traversal, we can lose -- we need to
+ * chdir into the subdirectory, and we don't know where the current
+ * directory is, so we can't get back so that the upcoming chdir by
+ * fts_read will work.
+ */
+ if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
+ ISSET(FTS_NOCHDIR))
+ return (sp->fts_child = fts_build(sp, instr));
+
+ if ((fd = open(".", O_RDONLY, 0)) < 0)
+ return (NULL);
+ sp->fts_child = fts_build(sp, instr);
+ if (fchdir(fd))
+ return (NULL);
+ (void)close(fd);
+ return (sp->fts_child);
+}
+
+/*
+ * This is the tricky part -- do not casually change *anything* in here. The
+ * idea is to build the linked list of entries that are used by fts_children
+ * and fts_read. There are lots of special cases.
+ *
+ * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is
+ * set and it's a physical walk (so that symbolic links can't be directories),
+ * we can do things quickly. First, if it's a 4.4BSD file system, the type
+ * of the file is in the directory entry. Otherwise, we assume that the number
+ * of subdirectories in a node is equal to the number of links to the parent.
+ * The former skips all stat calls. The latter skips stat calls in any leaf
+ * directories and for any files after the subdirectories in the directory have
+ * been found, cutting the stat calls by about 2/3.
+ */
+static FTSENT *
+internal_function
+fts_build(sp, type)
+ register FTS *sp;
+ int type;
+{
+ register struct dirent *dp;
+ register FTSENT *p, *head;
+ register int nitems;
+ FTSENT *cur, *tail;
+ DIR *dirp;
+ void *oldaddr;
+ int cderrno, descend, len, level, maxlen, nlinks, saved_errno,
+ nostat, doadjust;
+ char *cp;
+
+ /* Set current node pointer. */
+ cur = sp->fts_cur;
+
+ /*
+ * Open the directory for reading. If this fails, we're done.
+ * If being called from fts_read, set the fts_info field.
+ */
+ if ((dirp = opendir(cur->fts_accpath)) == NULL) {
+ if (type == BREAD) {
+ cur->fts_info = FTS_DNR;
+ cur->fts_errno = errno;
+ }
+ return (NULL);
+ }
+
+ /*
+ * Nlinks is the number of possible entries of type directory in the
+ * directory if we're cheating on stat calls, 0 if we're not doing
+ * any stat calls at all, -1 if we're doing stats on everything.
+ */
+ if (type == BNAMES) {
+ nlinks = 0;
+ /* Be quiet about nostat, GCC. */
+ nostat = 0;
+ } else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
+ nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
+ nostat = 1;
+ } else {
+ nlinks = -1;
+ nostat = 0;
+ }
+
+#ifdef notdef
+ (void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink);
+ (void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n",
+ ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT));
+#endif
+ /*
+ * If we're going to need to stat anything or we want to descend
+ * and stay in the directory, chdir. If this fails we keep going,
+ * but set a flag so we don't chdir after the post-order visit.
+ * We won't be able to stat anything, but we can still return the
+ * names themselves. Note, that since fts_read won't be able to
+ * chdir into the directory, it will have to return different path
+ * names than before, i.e. "a/b" instead of "b". Since the node
+ * has already been visited in pre-order, have to wait until the
+ * post-order visit to return the error. There is a special case
+ * here, if there was nothing to stat then it's not an error to
+ * not be able to stat. This is all fairly nasty. If a program
+ * needed sorted entries or stat information, they had better be
+ * checking FTS_NS on the returned nodes.
+ */
+ cderrno = 0;
+ if (nlinks || type == BREAD) {
+ if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
+ if (nlinks && type == BREAD)
+ cur->fts_errno = errno;
+ cur->fts_flags |= FTS_DONTCHDIR;
+ descend = 0;
+ cderrno = errno;
+ (void)closedir(dirp);
+ dirp = NULL;
+ } else
+ descend = 1;
+ } else
+ descend = 0;
+
+ /*
+ * Figure out the max file name length that can be stored in the
+ * current path -- the inner loop allocates more path as necessary.
+ * We really wouldn't have to do the maxlen calculations here, we
+ * could do them in fts_read before returning the path, but it's a
+ * lot easier here since the length is part of the dirent structure.
+ *
+ * If not changing directories set a pointer so that can just append
+ * each new name into the path.
+ */
+ len = NAPPEND(cur);
+ if (ISSET(FTS_NOCHDIR)) {
+ cp = sp->fts_path + len;
+ *cp++ = '/';
+ } else {
+ /* GCC, you're too verbose. */
+ cp = NULL;
+ }
+ len++;
+ maxlen = sp->fts_pathlen - len;
+
+ level = cur->fts_level + 1;
+
+ /* Read the directory, attaching each entry to the `link' pointer. */
+ doadjust = 0;
+ for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
+ if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+ continue;
+
+ if ((p = fts_alloc(sp, dp->d_name, (int)_D_EXACT_NAMLEN (dp))) == NULL)
+ goto mem1;
+ if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
+ oldaddr = sp->fts_path;
+ if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
+ /*
+ * No more memory for path or structures. Save
+ * errno, free up the current structure and the
+ * structures already allocated.
+ */
+mem1: saved_errno = errno;
+ if (p)
+ free(p);
+ fts_lfree(head);
+ (void)closedir(dirp);
+ cur->fts_info = FTS_ERR;
+ SET(FTS_STOP);
+ errno = saved_errno;
+ return (NULL);
+ }
+ /* Did realloc() change the pointer? */
+ if (oldaddr != sp->fts_path) {
+ doadjust = 1;
+ if (ISSET(FTS_NOCHDIR))
+ cp = sp->fts_path + len;
+ }
+ maxlen = sp->fts_pathlen - len;
+ }
+
+ if (len + _D_EXACT_NAMLEN (dp) >= USHRT_MAX) {
+ /*
+ * In an FTSENT, fts_pathlen is a u_short so it is
+ * possible to wraparound here. If we do, free up
+ * the current structure and the structures already
+ * allocated, then error out with ENAMETOOLONG.
+ */
+ free(p);
+ fts_lfree(head);
+ (void)closedir(dirp);
+ cur->fts_info = FTS_ERR;
+ SET(FTS_STOP);
+ errno = ENAMETOOLONG;
+ return (NULL);
+ }
+ p->fts_level = level;
+ p->fts_parent = sp->fts_cur;
+ p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
+
+#if defined FTS_WHITEOUT && 0
+ if (dp->d_type == DT_WHT)
+ p->fts_flags |= FTS_ISW;
+#endif
+
+ if (cderrno) {
+ if (nlinks) {
+ p->fts_info = FTS_NS;
+ p->fts_errno = cderrno;
+ } else
+ p->fts_info = FTS_NSOK;
+ p->fts_accpath = cur->fts_accpath;
+ } else if (nlinks == 0
+#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
+ || (nostat &&
+ dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
+#endif
+ ) {
+ p->fts_accpath =
+ ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
+ p->fts_info = FTS_NSOK;
+ } else {
+ /* Build a file name for fts_stat to stat. */
+ if (ISSET(FTS_NOCHDIR)) {
+ p->fts_accpath = p->fts_path;
+ memmove(cp, p->fts_name, p->fts_namelen + 1);
+ } else
+ p->fts_accpath = p->fts_name;
+ /* Stat it. */
+ p->fts_info = fts_stat(sp, p, 0);
+
+ /* Decrement link count if applicable. */
+ if (nlinks > 0 && (p->fts_info == FTS_D ||
+ p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
+ --nlinks;
+ }
+
+ /* We walk in directory order so "ls -f" doesn't get upset. */
+ p->fts_link = NULL;
+ if (head == NULL)
+ head = tail = p;
+ else {
+ tail->fts_link = p;
+ tail = p;
+ }
+ ++nitems;
+ }
+ if (dirp)
+ (void)closedir(dirp);
+
+ /*
+ * If realloc() changed the address of the path, adjust the
+ * addresses for the rest of the tree and the dir list.
+ */
+ if (doadjust)
+ fts_padjust(sp, head);
+
+ /*
+ * If not changing directories, reset the path back to original
+ * state.
+ */
+ if (ISSET(FTS_NOCHDIR)) {
+ if (len == sp->fts_pathlen || nitems == 0)
+ --cp;
+ *cp = '\0';
+ }
+
+ /*
+ * If descended after called from fts_children or after called from
+ * fts_read and nothing found, get back. At the root level we use
+ * the saved fd; if one of fts_open()'s arguments is a relative path
+ * to an empty directory, we wind up here with no other way back. If
+ * can't get back, we're done.
+ */
+ if (descend && (type == BCHILD || !nitems) &&
+ (cur->fts_level == FTS_ROOTLEVEL ?
+ FCHDIR(sp, sp->fts_rfd) :
+ fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
+ cur->fts_info = FTS_ERR;
+ SET(FTS_STOP);
+ return (NULL);
+ }
+
+ /* If didn't find anything, return NULL. */
+ if (!nitems) {
+ if (type == BREAD)
+ cur->fts_info = FTS_DP;
+ return (NULL);
+ }
+
+ /* Sort the entries. */
+ if (sp->fts_compar && nitems > 1)
+ head = fts_sort(sp, head, nitems);
+ return (head);
+}
+
+static u_short
+internal_function
+fts_stat(sp, p, follow)
+ FTS *sp;
+ register FTSENT *p;
+ int follow;
+{
+ register FTSENT *t;
+ register dev_t dev;
+ register ino_t ino;
+ struct stat *sbp, sb;
+ int saved_errno;
+
+ /* If user needs stat info, stat buffer already allocated. */
+ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
+
+#if defined FTS_WHITEOUT && 0
+ /* check for whiteout */
+ if (p->fts_flags & FTS_ISW) {
+ if (sbp != &sb) {
+ memset(sbp, '\0', sizeof (*sbp));
+ sbp->st_mode = S_IFWHT;
+ }
+ return (FTS_W);
+ }
+#endif
+
+ /*
+ * If doing a logical walk, or application requested FTS_FOLLOW, do
+ * a stat(2). If that fails, check for a non-existent symlink. If
+ * fail, set the errno from the stat call.
+ */
+ if (ISSET(FTS_LOGICAL) || follow) {
+ if (stat(p->fts_accpath, sbp)) {
+ saved_errno = errno;
+ if (!lstat(p->fts_accpath, sbp)) {
+ errno = 0;
+ return (FTS_SLNONE);
+ }
+ p->fts_errno = saved_errno;
+ goto err;
+ }
+ } else if (lstat(p->fts_accpath, sbp)) {
+ p->fts_errno = errno;
+err: memset(sbp, 0, sizeof(struct stat));
+ return (FTS_NS);
+ }
+
+ if (S_ISDIR(sbp->st_mode)) {
+ /*
+ * Set the device/inode. Used to find cycles and check for
+ * crossing mount points. Also remember the link count, used
+ * in fts_build to limit the number of stat calls. It is
+ * understood that these fields are only referenced if fts_info
+ * is set to FTS_D.
+ */
+ dev = p->fts_dev = sbp->st_dev;
+ ino = p->fts_ino = sbp->st_ino;
+ p->fts_nlink = sbp->st_nlink;
+
+ if (ISDOT(p->fts_name))
+ return (FTS_DOT);
+
+ /*
+ * Cycle detection is done by brute force when the directory
+ * is first encountered. If the tree gets deep enough or the
+ * number of symbolic links to directories is high enough,
+ * something faster might be worthwhile.
+ */
+ for (t = p->fts_parent;
+ t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
+ if (ino == t->fts_ino && dev == t->fts_dev) {
+ p->fts_cycle = t;
+ return (FTS_DC);
+ }
+ return (FTS_D);
+ }
+ if (S_ISLNK(sbp->st_mode))
+ return (FTS_SL);
+ if (S_ISREG(sbp->st_mode))
+ return (FTS_F);
+ return (FTS_DEFAULT);
+}
+
+static FTSENT *
+internal_function
+fts_sort(sp, head, nitems)
+ FTS *sp;
+ FTSENT *head;
+ register int nitems;
+{
+ register FTSENT **ap, *p;
+
+ /*
+ * Construct an array of pointers to the structures and call qsort(3).
+ * Reassemble the array in the order returned by qsort. If unable to
+ * sort for memory reasons, return the directory entries in their
+ * current order. Allocate enough space for the current needs plus
+ * 40 so don't realloc one entry at a time.
+ */
+ if (nitems > sp->fts_nitems) {
+ sp->fts_nitems = nitems + 40;
+ if ((sp->fts_array = realloc(sp->fts_array,
+ (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
+ sp->fts_nitems = 0;
+ return (head);
+ }
+ }
+ for (ap = sp->fts_array, p = head; p; p = p->fts_link)
+ *ap++ = p;
+ qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+ for (head = *(ap = sp->fts_array); --nitems; ++ap)
+ ap[0]->fts_link = ap[1];
+ ap[0]->fts_link = NULL;
+ return (head);
+}
+
+static FTSENT *
+internal_function
+fts_alloc(sp, name, namelen)
+ FTS *sp;
+ const char *name;
+ register int namelen;
+{
+ register FTSENT *p;
+ size_t len;
+
+ /*
+ * The file name is a variable length array and no stat structure is
+ * necessary if the user has set the nostat bit. Allocate the FTSENT
+ * structure, the file name and the stat structure in one chunk, but
+ * be careful that the stat structure is reasonably aligned. Since the
+ * fts_name field is declared to be of size 1, the fts_name pointer is
+ * namelen + 2 before the first possible address of the stat structure.
+ */
+ len = sizeof(FTSENT) + namelen;
+ if (!ISSET(FTS_NOSTAT))
+ len += sizeof(struct stat) + ALIGNBYTES;
+ if ((p = malloc(len)) == NULL)
+ return (NULL);
+
+ /* Copy the name and guarantee NUL termination. */
+ memmove(p->fts_name, name, namelen);
+ p->fts_name[namelen] = '\0';
+
+ if (!ISSET(FTS_NOSTAT))
+ p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
+ p->fts_namelen = namelen;
+ p->fts_path = sp->fts_path;
+ p->fts_errno = 0;
+ p->fts_flags = 0;
+ p->fts_instr = FTS_NOINSTR;
+ p->fts_number = 0;
+ p->fts_pointer = NULL;
+ return (p);
+}
+
+static void
+internal_function
+fts_lfree(head)
+ register FTSENT *head;
+{
+ register FTSENT *p;
+
+ /* Free a linked list of structures. */
+ while ((p = head)) {
+ head = head->fts_link;
+ free(p);
+ }
+}
+
+/*
+ * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
+ * Most systems will allow creation of paths much longer than MAXPATHLEN, even
+ * though the kernel won't resolve them. Add the size (not just what's needed)
+ * plus 256 bytes so don't realloc the path 2 bytes at a time.
+ */
+static int
+internal_function
+fts_palloc(sp, more)
+ FTS *sp;
+ size_t more;
+{
+ sp->fts_pathlen += more + 256;
+ /*
+ * Check for possible wraparound. In an FTS, fts_pathlen is
+ * a signed int but in an FTSENT it is an unsigned short.
+ * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
+ */
+ if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) {
+ if (sp->fts_path)
+ free(sp->fts_path);
+ sp->fts_path = NULL;
+ errno = ENAMETOOLONG;
+ return (1);
+ }
+ sp->fts_path = realloc(sp->fts_path, sp->fts_pathlen);
+ return (sp->fts_path == NULL);
+}
+
+/*
+ * When the path is realloc'd, have to fix all of the pointers in structures
+ * already returned.
+ */
+static void
+internal_function
+fts_padjust(sp, head)
+ FTS *sp;
+ FTSENT *head;
+{
+ FTSENT *p;
+ char *addr = sp->fts_path;
+
+#define ADJUST(p) do { \
+ if ((p)->fts_accpath != (p)->fts_name) { \
+ (p)->fts_accpath = \
+ (char *)addr + ((p)->fts_accpath - (p)->fts_path); \
+ } \
+ (p)->fts_path = addr; \
+} while (0)
+ /* Adjust the current set of children. */
+ for (p = sp->fts_child; p; p = p->fts_link)
+ ADJUST(p);
+
+ /* Adjust the rest of the tree, including the current level. */
+ for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
+ ADJUST(p);
+ p = p->fts_link ? p->fts_link : p->fts_parent;
+ }
+}
+
+static size_t
+internal_function
+fts_maxarglen(argv)
+ char * const *argv;
+{
+ size_t len, max;
+
+ for (max = 0; *argv; ++argv)
+ if ((len = strlen(*argv)) > max)
+ max = len;
+ return (max + 1);
+}
+/*
+ * Change to dir specified by fd or p->fts_accpath without getting
+ * tricked by someone changing the world out from underneath us.
+ * Assumes p->fts_dev and p->fts_ino are filled in.
+ */
+static int
+fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
+{
+ int ret, oerrno, newfd;
+ struct stat sb;
+
+ newfd = fd;
+ if (ISSET(FTS_NOCHDIR))
+ return (0);
+ if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0)
+ return (-1);
+ if (fstat(newfd, &sb)) {
+ ret = -1;
+ goto bail;
+ }
+ if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
+ errno = ENOENT; /* disinformation */
+ ret = -1;
+ goto bail;
+ }
+ ret = fchdir(newfd);
+bail:
+ oerrno = errno;
+ if (fd < 0)
+ (void)close(newfd);
+ errno = oerrno;
+ return (ret);
+}
+
+#endif /* !OpenBSD/NetBSD/APPLE */
diff --git a/package/cfgfs/src/fts_debg.c b/package/cfgfs/src/fts_debg.c
new file mode 100644
index 000000000..c2a48af08
--- /dev/null
+++ b/package/cfgfs/src/fts_debg.c
@@ -0,0 +1,51 @@
+/* $MirOS: contrib/hosted/fwcf/fts_debg.c,v 1.2 2006/09/23 23:21:04 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
+#include "defs.h"
+#include "fts_subs.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/fts_debg.c,v 1.2 2006/09/23 23:21:04 tg Exp $");
+
+void
+ftsf_debugent(ftsf_entry *e)
+{
+ fprintf(stderr,
+ "%s @%08X %06o %2u %u %06llX %lu:%lu %s/\033[1m%s\033[0m%c\n",
+ (e->etype == FTSF_DIR ? "DIR" : e->etype == FTSF_FILE ? "REG" :
+ e->etype == FTSF_SYMLINK ? "SYM" : "OTH"),
+ (unsigned)e->statp->st_ino, (unsigned)e->statp->st_mode,
+ e->statp->st_nlink, (unsigned)e->statp->st_mtime,
+ (uint64_t)e->statp->st_size, (u_long)e->statp->st_uid,
+ (u_long)e->statp->st_gid, ftsf_prefix, e->pathname,
+ ((e->statp->st_mode & S_IFMT) == S_IFDIR ? '/' :
+ (e->statp->st_mode & S_IFMT) == S_IFIFO ? '|' :
+ (e->statp->st_mode & S_IFMT) == S_IFLNK ? '@' :
+ (e->statp->st_mode & S_IFMT) == S_IFSOCK ? '=' :
+ (e->statp->st_mode & S_IFMT) == S_IFBLK ? '&' :
+ (e->statp->st_mode & S_IFMT) == S_IFCHR ? '%' :
+ (e->statp->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) ? '*' : '_'));
+}
diff --git a/package/cfgfs/src/fts_gnu.h b/package/cfgfs/src/fts_gnu.h
new file mode 100644
index 000000000..08d45a085
--- /dev/null
+++ b/package/cfgfs/src/fts_gnu.h
@@ -0,0 +1,137 @@
+/** $MirOS: contrib/hosted/fwcf/fts_gnu.h,v 1.1 2006/09/24 00:28:32 tg Exp $ */
+/* $OpenBSD: fts.h,v 1.11 2005/06/17 20:36:55 millert Exp $ */
+/* $NetBSD: fts.h,v 1.5 1994/12/28 01:41:50 mycroft Exp $ */
+
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)fts.h 8.3 (Berkeley) 8/14/94
+ */
+
+#ifndef _FTS_H_
+#define _FTS_H_
+
+#include <features.h>
+#include <sys/types.h>
+
+/* The fts interface is incompatible with the LFS interface which
+ transparently uses the 64-bit file access functions on GNU OS. */
+#ifdef __USE_FILE_OFFSET64
+# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
+#endif
+
+struct _fts_private; /* implementation data */
+
+typedef struct {
+ struct _ftsent *fts_cur; /* current node */
+ struct _ftsent *fts_child; /* linked list of children */
+ struct _ftsent **fts_array; /* sort array */
+ dev_t fts_dev; /* starting device # */
+ char *fts_path; /* path for this descent */
+ int fts_rfd; /* fd for root */
+ size_t fts_pathlen; /* sizeof(path) */
+ int fts_nitems; /* elements in the sort array */
+ int (*fts_compar)(); /* compare function */
+
+#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */
+#define FTS_LOGICAL 0x0002 /* logical walk */
+#define FTS_NOCHDIR 0x0004 /* don't change directories */
+#define FTS_NOSTAT 0x0008 /* don't get stat info */
+#define FTS_PHYSICAL 0x0010 /* physical walk */
+#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
+#define FTS_XDEV 0x0040 /* don't cross devices */
+#define FTS_OPTIONMASK 0x00ff /* valid user option mask */
+
+#define FTS_NAMEONLY 0x1000 /* (private) child names only */
+#define FTS_STOP 0x2000 /* (private) unrecoverable error */
+ int fts_options; /* fts_open options, global flags */
+ struct _fts_private *fts_priv; /* Implementation data */
+} FTS;
+
+typedef struct _ftsent {
+ struct _ftsent *fts_cycle; /* cycle node */
+ struct _ftsent *fts_parent; /* parent directory */
+ struct _ftsent *fts_link; /* next file in directory */
+ long fts_number; /* local numeric value */
+ void *fts_pointer; /* local address value */
+ char *fts_accpath; /* access path */
+ char *fts_path; /* root path */
+ int fts_errno; /* errno for this node */
+ int fts_symfd; /* fd for symlink */
+ size_t fts_pathlen; /* strlen(fts_path) */
+ size_t fts_namelen; /* strlen(fts_name) */
+
+ ino_t fts_ino; /* inode */
+ dev_t fts_dev; /* device */
+ nlink_t fts_nlink; /* link count */
+
+#define FTS_ROOTPARENTLEVEL -1
+#define FTS_ROOTLEVEL 0
+ short fts_level; /* depth (-1 to N) */
+
+#define FTS_D 1 /* preorder directory */
+#define FTS_DC 2 /* directory that causes cycles */
+#define FTS_DEFAULT 3 /* none of the above */
+#define FTS_DNR 4 /* unreadable directory */
+#define FTS_DOT 5 /* dot or dot-dot */
+#define FTS_DP 6 /* postorder directory */
+#define FTS_ERR 7 /* error; errno is set */
+#define FTS_F 8 /* regular file */
+#define FTS_INIT 9 /* initialized only */
+#define FTS_NS 10 /* stat(2) failed */
+#define FTS_NSOK 11 /* no stat(2) requested */
+#define FTS_SL 12 /* symbolic link */
+#define FTS_SLNONE 13 /* symbolic link without target */
+ unsigned short fts_info; /* user flags for FTSENT structure */
+
+#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
+#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
+ unsigned short fts_flags; /* private flags for FTSENT structure */
+
+#define FTS_AGAIN 1 /* read node again */
+#define FTS_FOLLOW 2 /* follow symbolic link */
+#define FTS_NOINSTR 3 /* no instructions */
+#define FTS_SKIP 4 /* discard node */
+ unsigned short fts_instr; /* fts_set() instructions */
+
+ struct stat *fts_statp; /* stat(2) information */
+ char fts_name[1]; /* file name */
+} FTSENT;
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+FTSENT *fts_children(FTS *, int);
+int fts_close(FTS *);
+FTS *fts_open(char * const *, int,
+ int (*)(const FTSENT **, const FTSENT **));
+FTSENT *fts_read(FTS *);
+int fts_set(FTS *, FTSENT *, int);
+__END_DECLS
+
+#endif /* !_FTS_H_ */
diff --git a/package/cfgfs/src/fts_subs.c b/package/cfgfs/src/fts_subs.c
new file mode 100644
index 000000000..ec40219f8
--- /dev/null
+++ b/package/cfgfs/src/fts_subs.c
@@ -0,0 +1,163 @@
+/* $MirOS: contrib/hosted/fwcf/fts_subs.c,v 1.8 2007/07/02 14:53:03 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <err.h>
+#include <errno.h>
+#if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__)
+#include "fts_gnu.h"
+#else
+#include <fts.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+
+#include "defs.h"
+#define FTSF_INTERNALS
+#include "fts_subs.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/fts_subs.c,v 1.8 2007/07/02 14:53:03 tg Exp $");
+
+static FTS *handle;
+
+char ftsf_prefix[PATH_MAX];
+size_t ftsf_prefixlen;
+
+void
+ftsf_start(const char *root)
+{
+ char *paths[2];
+
+ if (handle != NULL) {
+ if (fts_close(handle))
+ warn("fts_close");
+ free(handle);
+ }
+
+ if (realpath(root, ftsf_prefix) == NULL)
+ err(1, "determine realpath for %s", root);
+ ftsf_prefixlen = strlen(ftsf_prefix) + 1;
+
+ paths[0] = ftsf_prefix;
+ paths[1] = NULL;
+
+ handle = fts_open(paths, FTS_NOCHDIR | FTS_PHYSICAL, NULL);
+
+ if (handle == NULL)
+ err(1, "fts_open on %s for %s", ftsf_prefix, root);
+}
+
+int
+ftsf_next(ftsf_entry *e)
+{
+ FTSENT *ent;
+ char *ename;
+
+ memset(e, 0, sizeof (ftsf_entry));
+
+ if (handle == NULL) {
+ warn("ftsf_next called before ftsf_open");
+ return (-1);
+ }
+
+ ftsf_continue:
+ if ((ent = fts_read(handle)) == NULL) {
+ if (errno == 0) {
+ if (fts_close(handle))
+ warn("fts_close");
+ handle = NULL;
+ return (0);
+ }
+ warn("fts_read");
+ if (fts_close(handle))
+ warn("fts_close");
+ handle = NULL;
+ return (-1);
+ }
+
+ ename = ent->fts_path;
+#if 0 /* debug */
+ if (asprintf(&ename, "accpath<%s> path<%s> name<%s>", ent->fts_accpath,
+ ent->fts_path, ent->fts_name) == -1)
+ err(1, "asprintf");
+#endif
+ if (strcmp(ename, ftsf_prefix)) {
+ if (strlcpy(e->pathname, ename + ftsf_prefixlen,
+ sizeof (e->pathname)) >= sizeof (e->pathname))
+ warn("truncating file name '%s' to '%s'", ename,
+ e->pathname);
+ } else
+ memcpy(e->pathname, ".", 2);
+
+ switch (ent->fts_info) {
+ case FTS_D:
+ e->etype = FTSF_DIR;
+ break;
+ case FTS_DNR:
+ warn("directory %s not readable, skipping: %s", ename,
+ strerror(ent->fts_errno));
+ /* FALLTHROUGH */
+ case FTS_DC:
+ case FTS_DOT:
+ case FTS_DP:
+ goto ftsf_continue;
+ case FTS_DEFAULT:
+ if (S_ISDIR(ent->fts_statp->st_mode))
+ e->etype = FTSF_DIR;
+ else if (S_ISREG(ent->fts_statp->st_mode))
+ e->etype = FTSF_FILE;
+ else if (S_ISLNK(ent->fts_statp->st_mode))
+ e->etype = FTSF_SYMLINK;
+ else
+ e->etype = FTSF_OTHER;
+ break;
+ case FTS_ERR:
+ warn("generic error condition %s on %s, skipping",
+ strerror(ent->fts_errno), ename);
+ goto ftsf_continue;
+ case FTS_F:
+ e->etype = FTSF_FILE;
+ break;
+ case FTS_NSOK:
+ ent->fts_errno = 0;
+ /* FALLTHROUGH */
+ case FTS_NS:
+ warn("skipping due to no stat(2) information on %s: %s",
+ ename, strerror(ent->fts_errno));
+ goto ftsf_continue;
+ case FTS_SL:
+ case FTS_SLNONE:
+ e->etype = FTSF_SYMLINK;
+ break;
+ default:
+ warn("unknown fts_info field for %s: %d, skipping",
+ ename, (int)ent->fts_info);
+ warn("ent->fts_errno = %d (%s)", ent->fts_errno,
+ strerror(ent->fts_errno));
+ goto ftsf_continue;
+ }
+
+ e->statp = ent->fts_statp;
+ return (1);
+}
diff --git a/package/cfgfs/src/fts_subs.h b/package/cfgfs/src/fts_subs.h
new file mode 100644
index 000000000..c7d2c10fc
--- /dev/null
+++ b/package/cfgfs/src/fts_subs.h
@@ -0,0 +1,37 @@
+/* $MirOS: contrib/hosted/fwcf/fts_subs.h,v 1.6 2006/09/26 10:25:03 tg Exp $ */
+
+/*
+ * This file is part of the FreeWRT project. FreeWRT is copyrighted
+ * material, please see the LICENCE file in the top-level directory
+ * or at http://www.freewrt.org/licence for details.
+ */
+
+#ifndef FTS_SUBS_H
+#define FTS_SUBS_H
+
+struct FTSF_ENTRY {
+ char pathname[MAXPATHLEN];
+ struct stat *statp;
+ enum {
+ FTSF_DIR,
+ FTSF_FILE,
+ FTSF_SYMLINK,
+ FTSF_OTHER
+ } etype;
+};
+#ifndef PACK_H
+typedef struct FTSF_ENTRY ftsf_entry;
+#endif
+
+#ifndef FTSF_INTERNALS
+extern const char ftsf_prefix[];
+#endif
+
+__BEGIN_DECLS
+void ftsf_start(const char *);
+/* returns -1 on error, 0 on empty, 1 on okay */
+int ftsf_next(ftsf_entry *);
+void ftsf_debugent(ftsf_entry *);
+__END_DECLS
+
+#endif
diff --git a/package/cfgfs/src/fwcf.helper/Makefile b/package/cfgfs/src/fwcf.helper/Makefile
new file mode 100644
index 000000000..882c0d486
--- /dev/null
+++ b/package/cfgfs/src/fwcf.helper/Makefile
@@ -0,0 +1,51 @@
+# $MirOS: contrib/hosted/fwcf/fwcf.helper/Makefile,v 1.9 2007/03/13 18:14:31 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+PROG= fwcf.helper
+SRCS= tool.c sys_bsd.c
+CFLAGS_tool.o+= -DSMALL
+_CFLADD+= tool.o
+NOMAN= Yes
+SRCS+= compress.c
+SRCS+= cpr_get.c
+SRCS+= cpr_list.c
+SRCS+= cpr_lsth.c
+SRCS+= ft_creat.c
+SRCS+= ft_pack.c
+SRCS+= ft_packm.c
+SRCS+= fts_subs.c
+SRCS+= header.c
+SRCS+= minilzop.c
+SRCS+= unwraps.c
+SRCS+= wraps.c
+CLEANFILES+= ${.CURDIR}/test.out ${.CURDIR}/test.nil
+
+LIB= # don't need, thanks
+
+.ifdef COMPRESSOR_ZLIB
+SRCS+= c_zlib.c
+DPADD+= ${LIBZ}
+LDADD+= -lz
+.else
+SRCS+= c_lzo1x1.c
+.endif
+
+test: ${PROG}
+ ./${PROG} -M ${.CURDIR}/../mkfwcf/CVS >${.CURDIR}/test.out
+ ./${PROG} -Me >${.CURDIR}/test.nil
+# ./${PROG} -U out.test <${.CURDIR}/../mkfwcf/test.out
+.ifdef COMPRESSOR_ZLIB
+ ./${PROG} -U out.tesz <${.CURDIR}/../mkfwcf/tesz.out
+.else
+ ./${PROG} -U out.tesL <${.CURDIR}/../mkfwcf/tesL.out
+.endif
+
+.include <bsd.prog.mk>
+
+clean cleandir: clean-local
+
+clean-local:
+ -rm -rf out.test out.tesz out.tesL
diff --git a/package/cfgfs/src/fwcf.sh b/package/cfgfs/src/fwcf.sh
new file mode 100644
index 000000000..ad75ee79e
--- /dev/null
+++ b/package/cfgfs/src/fwcf.sh
@@ -0,0 +1,384 @@
+#!/bin/sh
+#-
+# Copyright (c) 2006, 2007
+# Thorsten Glaser <tg@mirbsd.de>
+# Copyright (c) 2009
+# Waldemar Brodkorb <openadk@waldemar-brodkorb.de>
+#
+# Provided that these terms and disclaimer and all copyright notices
+# are retained or reproduced in an accompanying document, permission
+# is granted to deal in this work without restriction, including un-
+# limited rights to use, publicly perform, distribute, sell, modify,
+# merge, give away, or sublicence.
+#
+# This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+# the utmost extent permitted by applicable law, neither express nor
+# implied; without malicious intent or gross negligence. In no event
+# may a licensor, author or contributor be held liable for indirect,
+# direct, other damage, loss, or other issues arising in any way out
+# of dealing in the work, even if advised of the possibility of such
+# damage or existence of a defect, except proven that it results out
+# of said person's immediate fault when using the work as intended.
+#-
+# Possible return values:
+# 0 - everything ok
+# 1 - syntax error
+# 1 - no 'cfgfs' mtd/cf partition found
+# 1 - cfgfs erase: failed
+# 1 - cfgfs setup: already run
+# 3 - cfgfs setup: mount --bind problems
+# 4 - cfgfs setup: can't create or write to temporary filesystem
+# 5 - cfgfs setup: can't bind the tmpfs to /etc
+# 6 - cfgfs commit: cannot write to partition
+# 6 - cfgfs restore: cannot write to partition
+# 7 - cfgfs commit: won't write to flash because of unclean setup
+# 8 - cfgfs status: differences found
+# 9 - cfgfs status: old status file not found
+# 10 - cfgfs dump: failed
+# 11 - cfgfs commit: cfgfs setup not yet run (use -f to force)
+# 11 - cfgfs status: cfgfs setup not yet run
+# 12 - cfgfs restore: cannot read the backup
+# 255 - cfgfs erase: failed
+# 255 - internal error
+
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+wd=$(pwd)
+cd /
+what='Configuration Filesystem (cfgfs), Version 1.06'
+
+usage() {
+ cat >&2 <<EOF
+$what
+Usage:
+ { halt | poweroff | reboot } [-Ffn] [-d delay]
+ cfgfs { commit | erase | setup | status | dump | restore } [flags]
+EOF
+ exit 1
+}
+
+case $0 in
+(*cfgfs*) me=cfgfs ;;
+(*halt*) me=halt ;;
+(*poweroff*) me=poweroff ;;
+(*reboot*) me=reboot ;;
+(*) usage ;;
+esac
+
+if [[ $me != cfgfs ]]; then
+ integer dflag=0
+ dval=
+ integer fflag=0
+ integer nocfgfs=0
+ integer nflag=0
+ while getopts ":d:Ffn" ch; do
+ case $ch in
+ (d) dflag=1; dval=$OPTARG ;;
+ (F) nocfgfs=1 ;;
+ (f) fflag=1 ;;
+ (n) nflag=1 ;;
+ (*) usage ;;
+ esac
+ done
+ shift $((OPTIND - 1))
+
+ (( nocfgfs == 0 && fflag == 0 )) && if ! cfgfs status -q; then
+ echo "error: will not $me: unsaved changes in /etc found!"
+ echo "Either run 'cfgfs commit' before trying to $me"
+ echo "or retry with '$me -F${*+ }$*' to force a ${me}."
+ echo "Run 'cfgfs status' to see which files are changed."
+ exit 2
+ fi
+
+ (( fflag )) && me="$me -f"
+ (( nflag )) && me="$me -n"
+ (( dflag )) && me="$me -d '$dval'"
+ eval exec busybox $me
+fi
+
+case $1 in
+(commit|erase|setup|status|dump|restore) ;;
+(*) cat >&2 <<EOF
+$what
+Syntax:
+ $0 commit [-f]
+ $0 erase
+ $0 setup [-N]
+ $0 status [-rq]
+ $0 { dump | restore } [<filename>]
+EOF
+ exit 1 ;;
+esac
+
+uname=$(uname -m)
+if [[ "$uname" = "i586" ]];then
+ part=/dev/sda2
+else
+ part=/dev/mtd$(fgrep '"cfgfs"' /proc/mtd 2>/dev/null | sed 's/^mtd\([^:]*\):.*$/\1/')ro
+fi
+
+if [[ ! -e $part ]]; then
+ echo 'cfgfs: fatal error: no "cfgfs" partition found!'
+ exit 1
+fi
+
+if test $1 = erase; then
+ dd if="$part" 2>&1 | md5sum 2>&1 >/dev/urandom
+ cfgfs.helper -Me | cfgfs.write
+ exit $?
+fi
+
+if test $1 = setup; then
+ if test -e /tmp/.cfgfs; then
+ echo 'cfgfs: error: "cfgfs setup" already run!'
+ exit 1
+ fi
+ mkdir /tmp/.cfgfs
+ if test ! -d /tmp/.cfgfs; then
+ echo 'cfgfs: error: cannot create temporary directory!'
+ exit 4
+ fi
+ chown 0:0 /tmp/.cfgfs
+ chmod 700 /tmp/.cfgfs
+ mkdir /tmp/.cfgfs/root
+ mount --bind /etc /tmp/.cfgfs/root
+ mkdir /tmp/.cfgfs/temp
+ mount -t tmpfs -o size=960k cfgfs /tmp/.cfgfs/temp
+ (cd /tmp/.cfgfs/root; tar cf - .) | (cd /tmp/.cfgfs/temp; tar xpf -)
+ unclean=0
+ if [[ $1 = -N ]]; then
+ unclean=2
+ else
+ x=$(dd if="$part" bs=4 count=1 2>/dev/null)
+ [[ "$x" = "FWCF" ]] || cfgfs.helper -Me | cfgfs.write
+ if ! cfgfs.helper -U /tmp/.cfgfs/temp <"$part"; then
+ unclean=1
+ echo 'cfgfs: error: cannot extract'
+ echo unclean startup | logger -t 'cfgfs setup'
+ fi
+ if test -e /tmp/.cfgfs/temp/.cfgfs_deleted; then
+ while IFS= read -r file; do
+ rm -f "/tmp/.cfgfs/temp/$file"
+ done </tmp/.cfgfs/temp/.cfgfs_deleted
+ rm -f /tmp/.cfgfs/temp/.cfgfs_deleted
+ fi
+ fi
+ test $unclean = 0 || echo -n >/tmp/.cfgfs/temp/.cfgfs_unclean
+ rm -f /tmp/.cfgfs/temp/.cfgfs_done
+ if test -e /tmp/.cfgfs/temp/.cfgfs_done; then
+ echo 'cfgfs: fatal: this is not Kansas any more'
+ umount /tmp/.cfgfs/temp
+ umount /tmp/.cfgfs/root
+ rm -rf /tmp/.cfgfs
+ exit 3
+ fi
+ echo -n >/tmp/.cfgfs/temp/.cfgfs_done
+ if test ! -e /tmp/.cfgfs/temp/.cfgfs_done; then
+ echo 'cfgfs: fatal: cannot write to tmpfs'
+ umount /tmp/.cfgfs/temp
+ umount /tmp/.cfgfs/root
+ rm -rf /tmp/.cfgfs
+ exit 4
+ fi
+ chmod 755 /tmp/.cfgfs/temp
+ mount --bind /tmp/.cfgfs/temp /etc
+ if test ! -e /etc/.cfgfs_done; then
+ umount /etc
+ echo 'cfgfs: fatal: binding to /etc failed'
+ if test $unclean = 0; then
+ echo 'cfgfs: configuration is preserved' \
+ in /tmp/.cfgfs/temp
+ else
+ umount /tmp/.cfgfs/temp
+ fi
+ exit 5
+ fi
+ umount /tmp/.cfgfs/temp
+ echo complete, unclean=$unclean | logger -t 'cfgfs setup'
+ cd /etc
+ rm -f .rnd
+ find . -type f | grep -v -e '^./.cfgfs' -e '^./.rnd$' | sort | \
+ xargs md5sum | sed 's! ./! !' | \
+ cfgfs.helper -Z - /tmp/.cfgfs/status.asz
+ exit 0
+fi
+
+if test $1 = commit; then
+ umount /tmp/.cfgfs/temp >/dev/null 2>&1
+ if test ! -e /tmp/.cfgfs; then
+ cat >&2 <<-EOF
+ cfgfs: error: not yet initialised
+ explanation: "cfgfs setup" was not yet run
+ EOF
+ [[ $1 = -f ]] || exit 11
+ fi
+ if test -e /etc/.cfgfs_unclean; then
+ cat >&2 <<-EOF
+ cfgfs: error: unclean startup (or setup run with -N)!
+ explanation: during boot, the cfgfs filesystem could not
+ be extracted; saving the current /etc to flash will
+ result in data loss; to override this check, remove
+ the file /etc/.cfgfs_unclean and try again.
+ EOF
+ [[ $1 = -f ]] || exit 7
+ fi
+ mount -t tmpfs -o size=960k swap /tmp/.cfgfs/temp
+ (cd /etc; tar cf - .) | (cd /tmp/.cfgfs/temp; tar xpf -)
+ cd /tmp/.cfgfs/temp
+ find . -type f | grep -v -e '^./.cfgfs' -e '^./.rnd$' | sort | \
+ xargs md5sum | sed 's! ./! !' | \
+ cfgfs.helper -Z - /tmp/.cfgfs/status.asz
+ cd /tmp/.cfgfs/root
+ rm -f /tmp/.cfgfs/temp/.cfgfs_* /tmp/.cfgfs/temp/.rnd
+ find /tmp/.cfgfs/temp -type d -empty -delete
+ find . -type f | while read f; do
+ f=${f#./}
+ if [[ ! -e /tmp/.cfgfs/temp/$f ]]; then
+ [[ $f = .rnd ]] && continue
+ printf '%s\n' "$f" >>/tmp/.cfgfs/temp/.cfgfs_deleted
+ continue
+ fi
+ x=$(md5sum "$f" 2>/dev/null)
+ y=$(cd ../temp; md5sum "$f" 2>/dev/null)
+ [[ "$x" = "$y" ]] && rm "../temp/$f"
+ done
+ rv=0
+ if ! ( cfgfs.helper -M /tmp/.cfgfs/temp | cfgfs.write ); then
+ echo 'cfgfs: error: cannot write to $part!'
+ rv=6
+ fi
+ umount /tmp/.cfgfs/temp
+ exit $rv
+fi
+
+if test $1 = status; then
+ if test ! -e /tmp/.cfgfs; then
+ cat >&2 <<-EOF
+ cfgfs: error: not yet initialised
+ explanation: "cfgfs setup" was not yet run
+ EOF
+ [[ $1 = -f ]] || exit 11
+ fi
+ rm -f /tmp/.cfgfs/*_status /tmp/.cfgfs/*_files
+ rflag=0
+ q=printf # or : (true) if -q
+ shift
+ while getopts "rq" ch; do
+ case $ch in
+ (r) rflag=1 ;;
+ (q) q=: ;;
+ esac
+ done
+ shift $((OPTIND - 1))
+ if test $rflag = 1; then
+ f=/tmp/.cfgfs/rom_status
+ cd /tmp/.cfgfs/root
+ find . -type f | grep -v -e '^./.cfgfs' -e '^./.rnd$' | sort | \
+ xargs md5sum | sed 's! ./! !' >$f
+ else
+ f=/tmp/.cfgfs/status
+ cfgfs.helper -Zd $f.asz $f || rm -f $f
+ fi
+ if [[ ! -e $f ]]; then
+ echo 'cfgfs: error: old status file not found'
+ exit 9
+ fi
+ cd /etc
+ find . -type f | grep -v -e '^./.cfgfs' -e '^./.rnd$' | sort | \
+ xargs md5sum | sed 's! ./! !' >/tmp/.cfgfs/cur_status || exit 255
+ cd /tmp/.cfgfs
+ sed 's/^[0-9a-f]* //' <$f >old_files
+ sed 's/^[0-9a-f]* //' <cur_status >cur_files
+ # make *_status be of exactly the same length, for benefit of the
+ # while ... read <old, read <new loop below, and sort it
+ comm -23 old_files cur_files | while read name; do
+ echo "<NULL> $name" >>cur_status
+ done
+ comm -13 old_files cur_files | while read name; do
+ echo "<NULL> $name" >>$f
+ done
+ # this implementation of sort -o sucks: doesn't do in-place edits
+ sort -k2 -o sold_status $f
+ sort -k2 -o snew_status cur_status
+ gotany=0
+ while :; do
+ IFS=' ' read oldsum oldname <&3 || break
+ IFS=' ' read newsum newname <&4 || exit 255
+ [[ "$oldname" = "$newname" ]] || exit 255
+ [[ "$oldsum" = "$newsum" ]] && continue
+ [[ $gotany = 0 ]] && $q '%-32s %-32s %s\n' \
+ 'MD5 hash of old file' 'MD5 hash of new file' 'filename'
+ gotany=8
+ test $q = : && break
+ $q '%32s %32s %s\n' "$oldsum" "$newsum" "$oldname"
+ done 3<sold_status 4<snew_status
+ rm -f /tmp/.cfgfs/*_status /tmp/.cfgfs/*_files
+ exit $gotany
+fi
+
+if test $1 = dump; then
+ fn=$2
+ [[ -n $fn ]] || fn=-
+ rm -rf /tmp/.cfgfs.dump
+ mkdir -m 0700 /tmp/.cfgfs.dump
+ cd /tmp/.cfgfs.dump
+ if ! cat "$part" | cfgfs.helper -UD dump; then
+ cd /
+ rm -rf /tmp/.cfgfs.dump
+ exit 10
+ fi
+ dd if=/dev/urandom of=seed bs=256 count=1 >/dev/null 2>&1
+ tar -cf - dump seed | (cd "$wd"; cfgfs.helper -Z - $fn)
+ cd /
+ rm -rf /tmp/.cfgfs.dump
+ case $fn in
+ (-) echo "cfgfs: dump to standard output complete."
+ ;;
+ (*) echo "cfgfs: dump to '$fn' complete."
+ ls -l "$fn" >&2
+ ;;
+ esac
+ exit 0
+fi
+
+if test $1 = restore; then
+ if test -e /tmp/.cfgfs; then
+ echo 'cfgfs: warning: "cfgfs setup" already run!'
+ echo 'please reboot after restoring; in no event'
+ echo 'run "cfgfs commit" to prevent data loss'
+ echo -n >/etc/.cfgfs_unclean
+ fi
+ fn=$2
+ [[ -n $fn ]] || fn=-
+ rm -rf /tmp/.cfgfs.restore
+ mkdir -m 0700 /tmp/.cfgfs.restore
+ cd /tmp/.cfgfs.restore
+ if ! (cd "$wd"; cfgfs.helper -Zd "$fn") | tar -xf -; then
+ cd /
+ rm -rf /tmp/.cfgfs.restore
+ exit 12
+ fi
+ dd if=seed of=/dev/urandom bs=256 count=1 >/dev/null 2>&1
+ if test ! -e dump; then
+ echo 'cfgfs: error: invalid backup'
+ cd /
+ rm -rf /tmp/.cfgfs.restore
+ exit 12
+ fi
+ if ! ( cfgfs.helper -MD dump | cfgfs.write ); then
+ echo 'cfgfs: error: cannot write to $part!'
+ exit 6
+ fi
+ cd /
+ rm -rf /tmp/.cfgfs.restore
+ case $fn in
+ (-) echo "cfgfs: restore from standard output complete."
+ ;;
+ (*) echo "cfgfs: restore from '$fn' complete."
+ ls -l "$fn" >&2
+ ;;
+ esac
+ exit 0
+fi
+
+echo 'cfgfs: cannot be reached...'
+exit 255
diff --git a/package/cfgfs/src/fwcf.txt b/package/cfgfs/src/fwcf.txt
new file mode 100644
index 000000000..ba23af470
--- /dev/null
+++ b/package/cfgfs/src/fwcf.txt
@@ -0,0 +1,434 @@
+ FreeWRT Configuration Filesystem
+ â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
+
+ Specification Document
+
+ Version 1.04 - 2 July 2007
+
+
+Copyright © 2006, 2007
+ Thorsten Glaser <tg@mirbsd.de>
+
+Provided that these terms and disclaimer and all copyright notices
+are retained or reproduced in an accompanying document, permission
+is granted to deal in this work without restriction, including un-
+limited rights to use, publicly perform, distribute, sell, modify,
+merge, give away, or sublicence.
+
+Advertising materials mentioning features or use of this work must
+display the following acknowledgement:
+ This product includes material provided by Thorsten Glaser
+ for the FreeWRT Project.
+
+This work is provided “AS IS†and WITHOUT WARRANTY of any kind, to
+the utmost extent permitted by applicable law, neither express nor
+implied; without malicious intent or gross negligence. In no event
+may a licensor, author or contributor be held liable for indirect,
+direct, other damage, loss, or other issues arising in any way out
+of dealing in the work, even if advised of the possibility of such
+damage or existence of a defect, except proven that it results out
+of said person's immediate fault when using the work as intended.
+
+
+1. Abstract
+―――――――――――
+
+FreeWRT is an operating system for embedded devices. At the moment,
+it provides a uClibc/GNU/Linux-based operating environment for mips-
+based hardware routers, e.g. from Linksys or Asus.
+
+FreeWRT operates on flash memory and as such is under constraints to
+reduce the amount of write operations to the root filesystem, because
+flash memory has limited lifetime. Changing the file-based configura-
+tion in /etc, however, often requires a fair amount of write opera-
+tions; furthermore, usual reconfiguration operations change more than
+only one file, possibly erasing and re-writing the same flash memory
+block several times. In addition, in between these changes, the sy-
+stem is in an inconsistent state, and, if the configuration changes
+render the system unusable, a simple reboot will not be able to fix
+it, a full reflash and reconfiguration is required.
+
+My proposed implementation will present /etc as a memory filesystem,
+loaded at boot with the content of the underlying /etc from the de-
+fault root filesystem (usually on squashfs or jffs2), then populated
+with additional files read from a custom flash partition in the be-
+low documented format. Changes to /etc will never be reflected in the
+underlying root filesystem, and the fwcf partition is only updated by
+a userland programme to be run manually.
+
+
+2. Implementation details
+―――――――――――――――――――――――――
+
+The size of the flash partition has been set by the FreeWRT project
+to 128 KiB (usually two flash blocks). A custom flash map driver has
+been added to the FreeWRT kernel before the import of fwcf.
+
+The command-line utility will support three operations:
+• fwcf setup to be run by the rc bootup script early
+• fwcf commit similar to Cisco ‘write’
+• fwcf erase similar to Cisco ‘erase startup-config’
+• fwcf status NEW IN 1.03: check if commit is needed
+• fwcf dump NEW IN 1.03: make a backup of the fwcf filesystem
+• fwcf restore NEW IN 1.03: restore a previously made backup
+• halt \
+• poweroff > NEW IN 1.04: wrapper around busybox
+• reboot /
+
+This utility is implemented as rapid prototype as a shell script in
+ash, using one C helper programme. Later versions will be pure C.
+
+
+2.1. Operation of ‘fwcf setup’
+――――――――――――――――――――――――――――――
+
+This command will first remap the existing /etc (via ‘mount --bind’)
+to /tmp/.fwcf/root. Then, it will create a memory filesystem (tmpfs)
+at /tmp/.fwcf/temp and populate it with all files from /tmp/.fwcf/root.
+Now, the fwcf flash partition will be read, the format and checksum
+verified and data extracted to /tmp/.fwcf/temp, possibly overwriting
+pre-existing files†. Then, the /tmp/.fwcf/temp filesystem will be re-
+bound to /etc and, finally, the mountpoint at /tmp/.fwcf/temp unloaded.
+
+NEW IN 1.03: If /etc/.fwcf_deleted exists, the files listed in it,
+newline-separated, will be removed from and relative to /etc, then
+the file itself will be removed.
+
+Data from the end of the fwcf data in the flash partition to the
+end of the 64 KiB block the end of data resides in will be written
+to /dev/urandom.
+
+NEW IN 1.03: Afterwards, a sorted list of all files is given to the
+busybox md5sum applet, the output is stored as /tmp/.fwcf/status.asz
+
+If the “fwcf†mtd partition does not start with the four letters
+FWCF on invoking ‘fwcf setup’, it is erased (i.e. populated with
+an empty FWCF filesystem).
+
+NEW IN 1.03: If run with ‘-N’, it will not read out the data from
+flash and force an “unclean startupâ€, as described below.
+
+†) NEW IN 1.03: If this fails, but the “fwcf†mtd partition starts
+with FWCF, i.e. we cannot read the flash filesystem, possibly because
+it's from an incompatible format or unknown compressor, a flag file
+is created as /etc/.fwcf_unclean to prevent a following commit which
+would lead to data loss. The user must remove this file to override.
+
+
+2.2. Operation of ‘fwcf commit’
+―――――――――――――――――――――――――――――――
+
+A new memory filesystem (tmpfs) will be createt at /tmp/.fwcf/temp
+and populated with the data currently in /etc. Now, NEW IN 1.03,
+the /tmp/.fwcf/status.asz file is recreated. Then, ALSO NEW IN 1.03,
+files in /tmp/.fwcf/root but not in /tmp/.fwcf/temp will be listed
+in /tmp/.fwcf/temp/.fwcf_deleted, newline-separated. Now, all files
+with exactly the same content in /tmp/.fwcf/root will be removed
+from /tmp/.fwcf/temp. Any remaining files will be packed into the
+fwcf format documented below and written to the flash partition,
+padded to a multiple of 64 KiB with data read from /dev/urandom.
+
+Unclean setups, NEW IN 1.03, will prevent a commit, unless the
+file /etc/.fwcf_unclean is removed manually, or the ‘-f’ option
+is given.
+
+The first public release does only support directories, files
+and symbolic links, for simplicity. Stored hard links and other
+file types will be skipped, because their storage format is al-
+ready specified (as “reserved for future useâ€), and ignored. No
+inode or file-sequential-number information is read or written.
+
+
+2.3. Operation of ‘fwcf erase’
+――――――――――――――――――――――――――――――
+
+In theory, just writing a NUL byte to the beginning of the flash
+partition would suffice. However, this requires an mtd erase and
+flash operation of one entire flash block (usually 64 KiB), so an
+empty fwcf filesystem padded with random data to the next 64 KiB
+will be written instead, for the added benefit of improving the
+quality of the kernel PRNG even over total reconfigurations.
+
+
+2.4. Operation of ‘fwcf status’ (NEW IN 1.03)
+――――――――――――――――――――――――――――――― ┄┄┄┄┄┄┄┄┄┄┄┄┄
+
+For all files in /etc, the ‘md5sum’ busybox applet is run, output
+stored in a temporary file and compared against the saved values
+from ‘fwcf setup’. If the ‘-q’ flag is not given, the differences
+are shown as “<oldmd5><space><newmd5><space><file>â€, where the md5
+is expressed as shown by the busybox applet, or as padded¹ “<NULL>â€
+if the file does not exist on either side, where “old†is the status
+at fwcf setup time (or the /etc from the root fs, if ‘-r’ is given),
+and “new†is the status of the current (tmpfs) /etc. If there are
+no differences, the exit status is 0, non-0 otherwise.
+
+If the ‘-r’ flag is given, operation is done against the data that
+is stored in the ROM, without considering the contents of the FWCF
+filesystem, instead.
+
+¹) Every “MD5†value is padded to be 32 bytes long, at its left
+ side, with spaces (just to clarify).
+
+
+2.5. Operation of ‘fwcf dump’ (NEW IN 1.03)
+――――――――――――――――――――――――――――― ┄┄┄┄┄┄┄┄┄┄┄┄┄
+
+A dump of the data currently stored in flash (commit first if you
+have changed anything!) is dumped to the filename argument, or to
+standard output, if none is present.
+
+Note: dumps are a LZO1X compressed tarball of a 256-byte entropy
+seed (“seedâ€) and the contents of the “inner filesystem†in “aszâ€
+format (“dumpâ€), which is stored as .tar.asz itself. There is no
+version information, and this is by design.
+
+Implementation information: the fwcf helper tool has a new mo-
+de of operation in which it works as compressor/decompressor –
+the algorithm used is determined with the -C option on a build
+system, and at compile time (i.e. the only one compiled in) on
+the target system. That's a compromise relative to using gzip,
+because it makes dumps depend on the compression algorithms in
+use, but it's always LZO1X-1 in FreeWRT 1.03 and up, and no de-
+pendency on a 50+ KiB gzip binary is added; the .tar.asz enco-
+ded dump can be recompressed with the tool on the build system.
+
+While the dump itself is tar → compressed → asz encoded, “aszâ€
+itself is not a compressing format, just a storage container –
+which stores one octet stream, plus size and checksum informa-
+tion only. Because many compressors have no idea about the un-
+compressed size, the actual encoded data is prefixed by a lit-
+tle endian unsigned 32-bit integer of the uncompressed length;
+the resulting larger buffer is then passed to the asz encoder.
+
+
+2.6. Operation of ‘fwcf restore’ (NEW IN 1.03)
+―――――――――――――――――――――――――――――――― ┄┄┄┄┄┄┄┄┄┄┄┄┄
+
+A dump created with “fwcf dump†is expected to be read from the
+filename argument, or standard input, if none is present, and
+then written to flash.
+
+
+3. Structure of the fwcf data
+―――――――――――――――――――――――――――――
+
+All data is written in little-endian format.
+
+The fwcf data begins at offset 0 in the flash partition, with the
+magic bytes “FWCF†(0x46435746).
+
+The next doubleword (four bytes) is the “outer length†of the fwcf
+data, including the header (including the magic bytes and the length
+information itself) and the trailer (checksum), but not the padding;
+the length takes up the lower 24 bits of this doubleword. The upper
+8 bits are the (major) version of the specification adhered to, i.e.
+0x01 for this document. This information shall be true for all ver-
+sions of this specification in order to enable the fwcf command-line
+utility to perform as follows: it is not required to process any non-
+native versions of fwcf data, but even if reading a different version,
+the random data used for the padding should be written to /dev/urandom.
+
+The following information is dependent on the version of the speci-
+fication.
+
+The next doubleword (starting at offset 8) is the “inner length†of
+the compressed fwcf data (lower 24 bit), or'd with the identification
+number of the compression algorithm used (upper 8 bit). Note this ef-
+fectively limits both the uncompressed and the compressed size of an
+fwcf filesystem to 2²ⴠbytes = 16 MiB. Since the filesystem is de-
+signed for /etc, this limitation is not expected to be troublesome.
+
+After this, at offset 12, the compressed data starts. It is padded
+to the next 4-byte boundary with zeroes.
+
+The next doubleword is the ADLER-32 checksum (as defined by libz)
+of all previous data, starting from the magic bytes at offset 0,
+ending with the zero-padding of the compressed data. Note that this
+does not check the integrity of the data after decompressing; cur-
+rently we must trust the decompressor to check integrity and do a
+length check on the decompressed data returned by the plugin our-
+selves. The next major version of the specification may change that.
+
+
+4. Compression algorithm allocation
+―――――――――――――――――――――――――――――――――――
+
+An implementation is only required to be able to use exactly one of
+the compression algorithms defined below, but it is not required to
+implement a specific algorithm. Conversion might be achieved by un-
+and repacking the data, or using an fwcf implementation with multi-
+ple algorithms. Every implementation, however, is required to offer
+at least one of the non-private algorithms below.
+
+This draft of the specification offers two compression algorithms:
+
+0x00 = plain uncompressed data
+0x01 = zlib deflate compression as per http://www.zlib.net/
+0x10 = LZO1X as per http://www.oberhumer.com/opensource/lzo/
+
+Algorithm codes from 0xE0 to 0xFF are available for private use.
+
+
+5. Structure of the fwcf filesystem
+―――――――――――――――――――――――――――――――――――
+
+The compressed/inner data consists of a byte stream without padding
+applied, in the following format:
+
+entry ::= file-entry | NUL-byte
+
+file-entry ::= pathname NUL-byte attributes NUL-byte data
+
+attributes ::= attribute ( attribute )*
+
+The pathname is a POSIX pathname, i.e. can contain any character
+except NUL. Directories are separated with ‘/’ and automatically
+created by the extraction tool if required. If the first octet
+of the pathname is a NUL byte (i.e. it is of zero length), the
+end of the filesystem has been reached. Any data read afterwards
+MUST be discarded for security reasons.
+
+Attributes consist of a one-byte identifier, which is usually a
+letter, and a zero-to-multiple-bytes payload. If the identifier
+is a letter, its lowercase and uppercase forms denote the same
+attribute with a different payload length.
+
+The raw file data is not padded or aligned; its length is an at-
+tribute. Alternate streams / forks are not supported.
+
+
+6. Currently defined attributes
+―――――――――――――――――――――――――――――――
+
+0x01 this file is a block special device â‘ 
+ no payload
+ reserved for future use
+
+0x02 this file is a character special device â‘ 
+ no payload
+ reserved for future use
+
+0x03 this file is a symbolic link â‘¡
+ no payload
+
+0x04 this file is a hard link to another file â‘  â‘£
+ no payload
+ reserved for future use
+
+0x05 this file is a directory â‘£
+ no payload
+
+0x0D this file is deleted â‘ 
+ reserved for future use
+
+0x10 modification time of the entry
+ optional
+ ignored for symbolic links
+ payload length: 32 bit
+
+g/G group of the file (numeric GID)
+ optional
+ payload length: lowercase = 8 bit, uppercase = 32 bit
+
+i/I “inode†of the file ① ④
+ required if this file is a hard link source or target
+ optional (ignored) otherwise
+ payload length: lowercase = 8 bit, uppercase = 16 bit
+ reserved for future use
+
+m/M mode_t / permissions of the file â‘¢
+ optional
+ ignored for symbolic links
+ payload length: lowercase = 16 bit, uppercase = 32 bit
+
+o/O owner of the file (numeric UID)
+ optional
+ payload length: lowercase = 8 bit, uppercase = 32 bit
+
+s/S size of the file
+ for files and symbolic links: mandatory
+ for directories, device nodes and hard links: forbidden
+ payload length: lowercase = 8 bit, uppercase = 24 bit
+
+â‘  These identifiers are defined in this specification for future
+ use; implementations do not need to support them at this time.
+
+â‘¡ The name of the target is the data, thus, size is required.
+
+â‘¢ Defaults to 0 if not used (for security reasons), so labelling
+ it as “optional†is probably a farce ☺
+
+â‘£ Implementing hard links and directories is, of course, optional
+ for the writer.
+
+
+7. Miscellaneous
+――――――――――――――――
+
+The initial idea for a “configuration filesystem†based upon the
+Linux FUSE kernel module has been communicated to me by Waldemar
+Brodkorb, FreeWRT Project Founder. After a discussion with him I
+decided on the archive/userland tool layout outlined in sections
+1 and 2 above. For FreeWRT 1.0, it has been realised in shell.
+
+For now, nodes other than directories, files, and symbolic links
+are not supported.
+
+Development of FWCF is hosted in the CVS repository of the MirOS
+project. Anonymous read-only CVS access is available at the root
+“:ext:anoncvs@anoncvs.mirbsd.org:/cvs†using password “anoncvsâ€,
+SSH on port 22; module “fwcfâ€. CVSweb is also available, e.g. at
+http://cvs.mirbsd.de/contrib/hosted/fwcf/ or its mirrors.
+
+FWCF code is released under the same licence terms as the speci-
+fication, but without the advertising clause. The author however
+would really appreciate users to credit his name and that of the
+FreeWRT Project in derived works and/or links to the CVS reposi-
+tory of the original source.
+
+
+8. The “asz†file format (NEW IN 1.03)
+―――――――――――――――――――――――― ┄┄┄┄┄┄┄┄┄┄┄┄┄
+
+The “asz†format is intended for storing small arbitrary 8-bit
+data, and used in the “fwcf dump†and “fwcf restore†formats –
+the dump itself is a raw uncompressed “inner fwcf filesystemâ€,
+stored as “aszâ€, and the storage used by the dump/restore com-
+mands is a tarball, compressed with lzo1X1 (in the current im-
+plementation), the result stored, again, as “aszâ€.
+
+It almost looks like the “outer fwcf†format, except the start
+isn't a header but the ADLER-32 checksum double-word (2 unsig-
+ned 16-bit integer in LITTLE ENDIAN), i.e. without magic bytes
+to identify the format; followed by the length double-word – 1
+unsigned 32-bit integer in LITTLE ENDIAN – and finally the raw
+binary data. Only the lowest three octets of the length should
+be used because the current implementation malloc(3)s a buffer
+containing the whole data.
+
+
+9. Future directions
+――――――――――――――――――――
+
+The next major version of the FWCF filesystem specification is
+likely to contain the following changes:
+
+• An additional checksum (probably ADLER32 as well) shall be
+ placed inside the compressed portion, to be checked after
+ decompression. The idea of adding a random IV has not been
+ adopted because we pretty much want the same FWCF blocks,
+ except the random padding at the end, to be generated for
+ the same input data. (This is not guaranteed because fts()
+ may traverse the directory hierarchy differently.)
+• Revisit the current size limits and file types.
+• Implement a r̲e̲a̲l̲ file type “deletedâ€, replacing the hack
+ with the .fwcf_deleted file.
+
+These future directions have come up during or after the
+fwcf 1.00 release process, and from the discussion thereafter.
+They are provided as hint only and not part of the specifi-
+cation itself. They may change without notice.
+
+⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼⎼
+$MirOS: contrib/hosted/fwcf/fwcf.txt,v 1.37 2007/07/02 14:55:44 tg Exp $
diff --git a/package/cfgfs/src/header.c b/package/cfgfs/src/header.c
new file mode 100644
index 000000000..b3db0ce21
--- /dev/null
+++ b/package/cfgfs/src/header.c
@@ -0,0 +1,83 @@
+/* $MirOS: contrib/hosted/fwcf/header.c,v 1.7 2006/09/26 10:25:03 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef DEBUG_ADLER
+#include <zlib.h>
+#endif
+
+#include "defs.h"
+#include "adler.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/header.c,v 1.7 2006/09/26 10:25:03 tg Exp $"
+ "\t" ADLER_H);
+
+char *
+mkheader(char *f_header, size_t hdrsize, uint32_t outer_len,
+ uint32_t inner_len, uint8_t algo)
+{
+ char *hdrptr = f_header;
+ size_t hdrleft = hdrsize;
+
+#ifdef DEBUG
+ fprintf(stderr, "header: inner=%d outer=%d\n", inner_len & 0xFFFFFF,
+ outer_len & 0xFFFFFF);
+#endif
+
+ STOREB('F');
+ STOREB('W');
+ STOREB('C');
+ STOREB('F');
+
+ outer_len = (outer_len & 0xFFFFFF) | (FWCF_VER << 24);
+ STORED(outer_len);
+
+ inner_len = (inner_len & 0xFFFFFF) | (algo << 24);
+ STORED(inner_len);
+ return (hdrptr);
+}
+
+char *
+mktrailer(char *data, size_t len)
+{
+ char *hdrptr = data + len;
+ size_t hdrleft = 4;
+ ADLER_DECL;
+#ifdef DEBUG_ADLER
+ uint32_t adler = adler32(1, (uint8_t *)data, len);
+#endif
+
+ ADLER_CALC(data);
+#ifdef DEBUG_ADLER
+ if ((s1 != (adler & 0xFFFF)) || (s2 != (adler >> 16)))
+ errx(255, "adler32 implementation error: %04X%04X vs %08X",
+ s2, s1, adler);
+#endif
+ STOREW(s1);
+ STOREW(s2);
+ return (data);
+}
diff --git a/package/cfgfs/src/lib/Makefile b/package/cfgfs/src/lib/Makefile
new file mode 100644
index 000000000..85252b4cb
--- /dev/null
+++ b/package/cfgfs/src/lib/Makefile
@@ -0,0 +1,28 @@
+# $MirOS: contrib/hosted/fwcf/lib/Makefile,v 1.5 2007/03/13 18:14:31 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+LIB= fwcf
+NOPIC= Yes
+NOPROFILE= Yes # for OpenBSD
+SRCS+= compress.c
+SRCS+= cpr_get.c
+SRCS+= cpr_list.c
+SRCS+= cpr_lsth.c
+SRCS+= ft_creat.c
+SRCS+= ft_dump.c
+SRCS+= ft_pack.c
+SRCS+= ft_packm.c
+SRCS+= fts_debg.c
+SRCS+= fts_subs.c
+SRCS+= header.c
+SRCS+= minilzop.c
+SRCS+= unwraps.c
+SRCS+= wraps.c
+
+CFLAGS_header.o+= -DDEBUG_ADLER
+_CFLADD+= header.o
+
+.include <bsd.lib.mk>
diff --git a/package/cfgfs/src/minilzop.c b/package/cfgfs/src/minilzop.c
new file mode 100644
index 000000000..51935185c
--- /dev/null
+++ b/package/cfgfs/src/minilzop.c
@@ -0,0 +1,178 @@
+/* $MirOS: contrib/hosted/fwcf/minilzop.c,v 1.2 2007/03/09 22:25:45 tg Exp $ */
+
+/*-
+ * Copyright (c) 2007
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Provided that these terms and disclaimer and all copyright notices
+ * are retained or reproduced in an accompanying document, permission
+ * is granted to deal in this work without restriction, including un-
+ * limited rights to use, publicly perform, distribute, sell, modify,
+ * merge, give away, or sublicence.
+ *
+ * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+ * the utmost extent permitted by applicable law, neither express nor
+ * implied; without malicious intent or gross negligence. In no event
+ * may a licensor, author or contributor be held liable for indirect,
+ * direct, other damage, loss, or other issues arising in any way out
+ * of dealing in the work, even if advised of the possibility of such
+ * damage or existence of a defect, except proven that it results out
+ * of said person's immediate fault when using the work as intended.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "adler.h"
+#include "compress.h"
+#include "minilzop.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/minilzop.c,v 1.2 2007/03/09 22:25:45 tg Exp $");
+
+#define lodsw(s) __extension__({ \
+ const uint8_t *lodsw_buf = (const uint8_t *)(s);\
+ uint16_t lodsw_val; \
+ \
+ lodsw_val = lodsw_buf[0]; \
+ lodsw_val |= lodsw_buf[1] << 8; \
+ (lodsw_val); \
+ })
+#define lodsd(s) __extension__({ \
+ const uint8_t *lodsd_buf = (const uint8_t *)(s);\
+ uint32_t lodsd_val; \
+ \
+ lodsd_val = lodsd_buf[0]; \
+ lodsd_val |= lodsd_buf[1] << 8; \
+ lodsd_val |= lodsd_buf[2] << 16; \
+ lodsd_val |= lodsd_buf[3] << 24; \
+ (lodsd_val); \
+ })
+#define stosw(s,w) do { \
+ uint8_t *stosw_buf = (uint8_t *)(s); \
+ uint16_t stosw_val = (w); \
+ \
+ stosw_buf[0] = stosw_val & 0xFF; \
+ stosw_buf[1] = (stosw_val >> 8) & 0xFF; \
+ } while (0)
+#define stosd(s,dw) do { \
+ uint8_t *stosd_buf = (uint8_t *)(s); \
+ uint32_t stosd_val = (dw); \
+ \
+ stosd_buf[0] = stosd_val & 0xFF; \
+ stosd_buf[1] = (stosd_val >> 8) & 0xFF; \
+ stosd_buf[2] = (stosd_val >> 16) & 0xFF; \
+ stosd_buf[3] = (stosd_val >> 24) & 0xFF; \
+ } while (0)
+
+void
+read_aszdata(int dfd, char **dbuf, size_t *dlen)
+{
+ size_t len;
+ uint8_t hdrbuf[8];
+ ADLER_DECL;
+
+ if (read(dfd, hdrbuf, 8) != 8)
+ err(1, "short read");
+ *dlen = lodsd(hdrbuf + 4);
+ if ((*dbuf = malloc(*dlen)) == NULL)
+ err(255, "out of memory trying to allocate %zu bytes", *dlen);
+ if ((size_t)read(dfd, *dbuf, *dlen) != *dlen)
+ err(1, "short read");
+ len = 4;
+ ADLER_CALC(hdrbuf + 4);
+ len = *dlen;
+ ADLER_CALC(*dbuf);
+ if ((lodsw(hdrbuf) != s1) || (lodsw(hdrbuf + 2) != s2))
+ err(2, "checksum mismatch, size %zu,"
+ " want 0x%02X%02X%02X%02X got 0x%04X%04X", *dlen,
+ hdrbuf[3], hdrbuf[2], hdrbuf[1], hdrbuf[0], s2, s1);
+}
+
+void
+write_aszdata(int dfd, const char *dbuf, size_t dlen)
+{
+ size_t len;
+ uint8_t hdrbuf[8];
+ ADLER_DECL;
+
+ stosd(hdrbuf + 4, dlen);
+ len = 4;
+ ADLER_CALC(hdrbuf + 4);
+ len = dlen;
+ ADLER_CALC(dbuf);
+ stosw(hdrbuf, s1);
+ stosw(hdrbuf + 2, s2);
+ if (write(dfd, hdrbuf, 8) != 8)
+ err(1, "short write");
+ if ((size_t)write(dfd, dbuf, dlen) != dlen)
+ err(1, "short write");
+}
+
+int
+minilzop(int ifd, int ofd, int compr_alg, int decompress)
+{
+ size_t ilen, olen, n;
+ char *idata, *odata;
+
+#ifndef SMALL
+ fprintf(stderr, "minilzop: using algorithm %02X (%s)\n",
+ compr_alg, compressor_get(compr_alg)->name);
+#endif
+ if (decompress) {
+ read_aszdata(ifd, &idata, &ilen);
+ olen = lodsd(idata);
+ if ((odata = malloc(olen)) == NULL)
+ err(255, "out of memory trying to allocate %zu bytes",
+ olen);
+ if ((n = compressor_get(compr_alg)->decompress(odata, olen,
+ idata + 4, ilen - 4)) != olen)
+ errx(1, "size mismatch: decompressed %zu, want %zu",
+ n, olen);
+ free(idata);
+ idata = odata; /* save for later free(3) */
+ while (olen) {
+ if ((n = write(ofd, odata, olen)) == (size_t)-1)
+ err(1, "cannot write");
+ olen -= n;
+ odata += n;
+ }
+ free(idata);
+ } else {
+ size_t cc;
+
+ n = 16384;
+ idata = NULL;
+ ilen = 0;
+ slurp_file:
+ if ((idata = realloc(idata, (n <<= 1))) == NULL)
+ err(255, "out of memory trying to allocate %zu bytes",
+ n);
+ slurp_retry:
+ if ((cc = read(ifd, idata + ilen, n - ilen)) == (size_t)-1)
+ err(1, "cannot read");
+ ilen += cc;
+ if (cc > 0) {
+ if (ilen < n)
+ goto slurp_retry;
+ goto slurp_file;
+ }
+ if ((olen = compressor_get(compr_alg)->compress(&odata, idata,
+ ilen)) == (size_t)-1)
+ errx(1, "%s compression failed",
+ compressor_get(compr_alg)->name);
+ free(idata);
+ if ((idata = malloc(olen + 4)) == NULL)
+ err(255, "out of memory trying to allocate %zu bytes",
+ olen + 4);
+ stosd(idata, ilen);
+ memcpy(idata + 4, odata, olen);
+ write_aszdata(ofd, idata, olen + 4);
+ free(idata);
+ }
+ return (0);
+}
diff --git a/package/cfgfs/src/minilzop.h b/package/cfgfs/src/minilzop.h
new file mode 100644
index 000000000..8c23c674e
--- /dev/null
+++ b/package/cfgfs/src/minilzop.h
@@ -0,0 +1,19 @@
+/* $MirOS: contrib/hosted/fwcf/minilzop.h,v 1.1 2007/03/09 21:10:29 tg Exp $ */
+
+/*
+ * This file is part of the FreeWRT project. FreeWRT is copyrighted
+ * material, please see the LICENCE file in the top-level directory
+ * or at http://www.freewrt.org/licence for details.
+ */
+
+#ifndef MINILZOP_H
+#define MINILZOP_H
+
+__BEGIN_DECLS
+int minilzop(int ifd, int ofd, int compr_alg, int decompress);
+/* TODO: use the two below for the “outer filesystem†as well */
+void read_aszdata(int, char **, size_t *);
+void write_aszdata(int, const char *, size_t);
+__END_DECLS
+
+#endif
diff --git a/package/cfgfs/src/mkfwcf/Makefile b/package/cfgfs/src/mkfwcf/Makefile
new file mode 100644
index 000000000..35eed0cba
--- /dev/null
+++ b/package/cfgfs/src/mkfwcf/Makefile
@@ -0,0 +1,23 @@
+# $MirOS: contrib/hosted/fwcf/mkfwcf/Makefile,v 1.14 2006/09/26 10:25:06 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+PROG= mkfwcf
+SRCS= ${PROG}.c ${COMPRESSORS} sys_bsd.c
+NOMAN= yes
+DPADD+= ${LIBZ}
+LDADD+= -lz
+CLEANFILES+= ${.CURDIR}/test.out ${.CURDIR}/tesz.out ${.CURDIR}/tesL.out \
+ ${.CURDIR}/test.nil ${.CURDIR}/tesz.nil ${.CURDIR}/tesL.nil
+
+test: ${PROG}
+ ./${PROG} -o ${.CURDIR}/test.out ${.CURDIR}/CVS
+ ./${PROG} -C 1 -o ${.CURDIR}/tesz.out ${.CURDIR}/CVS
+ ./${PROG} -C 16 -o ${.CURDIR}/tesL.out ${.CURDIR}/CVS
+ ./${PROG} -eo ${.CURDIR}/test.nil
+ ./${PROG} -eC 1 -o ${.CURDIR}/tesz.nil
+ ./${PROG} -eC 16 -o ${.CURDIR}/tesL.nil
+
+.include <bsd.prog.mk>
diff --git a/package/cfgfs/src/mkfwcf/mkfwcf.c b/package/cfgfs/src/mkfwcf/mkfwcf.c
new file mode 100644
index 000000000..b4b80fb6e
--- /dev/null
+++ b/package/cfgfs/src/mkfwcf/mkfwcf.c
@@ -0,0 +1,109 @@
+/* $MirOS: contrib/hosted/fwcf/mkfwcf/mkfwcf.c,v 1.13 2006/09/24 20:35:00 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "compress.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/mkfwcf/mkfwcf.c,v 1.13 2006/09/24 20:35:00 tg Exp $");
+
+static int mkfwcf(int, const char *, int);
+static __dead void usage(void);
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ int fd = STDOUT_FILENO, docompress = 0, doempty = 0;
+ const char *file_root = NULL, *outfile = NULL;
+
+ while ((c = getopt(argc, argv, "C:celo:")) != -1)
+ switch (c) {
+ case 'C':
+ if (!(docompress = strtonum(optarg, 1, 255, NULL)))
+ usage();
+ break;
+ case 'c':
+ docompress = 1;
+ break;
+ case 'e':
+ doempty = 1;
+ break;
+ case 'l':
+ return (list_compressors());
+ case 'o':
+ outfile = optarg;
+ break;
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
+
+ if ((argc < 0) || (argc > 1))
+ usage();
+
+ if (argc && doempty)
+ usage();
+
+ if (argc)
+ file_root = *argv;
+
+ if (outfile != NULL)
+ if ((fd = open(outfile, O_WRONLY | O_CREAT | O_TRUNC,
+ 0666)) < 0)
+ err(1, "open %s", outfile);
+
+ if ((file_root == NULL) && !doempty)
+ if ((file_root = getcwd(NULL, 0)) == NULL)
+ err(1, "cannot determine current working directory");
+
+ return (mkfwcf(fd, doempty ? NULL : file_root, docompress));
+}
+
+static __dead void
+usage(void)
+{
+ extern const char *__progname;
+
+ fprintf(stderr, "Usage:\t%s [-e] [-c | -C <algorithm-number>] [-o <outfile>]"
+ "\n\t [<directory>]\n\t%s -l\n", __progname, __progname);
+ exit(1);
+}
+
+static int
+mkfwcf(int fd, const char *dir, int algo)
+{
+ size_t sz;
+ char *data;
+
+ data = fwcf_packm(dir, algo, &sz);
+ return ((size_t)write(fd, data, sz) == sz ? 0 : 1);
+}
diff --git a/package/cfgfs/src/mtd.c b/package/cfgfs/src/mtd.c
new file mode 100644
index 000000000..6812c5e31
--- /dev/null
+++ b/package/cfgfs/src/mtd.c
@@ -0,0 +1,379 @@
+/*
+ * mtd - simple memory technology device manipulation tool
+ *
+ * Copyright (c) 2006, 2007 Thorsten Glaser <tg@freewrt.org>
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@freewrt.org>,
+ * Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The code is based on the linux-mtd examples.
+ */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/syscall.h>
+#include <limits.h>
+#include <unistd.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <error.h>
+#include <err.h>
+#include <time.h>
+#include <string.h>
+
+#include <mtd/mtd-user.h>
+
+#define BUFSIZE (16 * 1024)
+#define MAX_ARGS 8
+
+#define DEBUG
+
+int mtd_check(char *);
+int mtd_unlock(const char *);
+int mtd_open(const char *, int);
+int mtd_erase(const char *);
+int mtd_write(int, const char *, int, bool);
+void usage(void) __attribute__((noreturn));
+
+char buf[BUFSIZE];
+int buflen;
+
+int
+mtd_check(char *mtd)
+{
+ struct mtd_info_user mtdInfo;
+ int fd;
+
+ fd = mtd_open(mtd, O_RDWR | O_SYNC);
+ if(fd < 0) {
+ fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+ return 0;
+ }
+
+ if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+ fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+ close(fd);
+ return 0;
+ }
+
+ close(fd);
+ return 1;
+}
+
+int
+mtd_unlock(const char *mtd)
+{
+ int fd;
+ struct mtd_info_user mtdInfo;
+ struct erase_info_user mtdLockInfo;
+
+ fd = mtd_open(mtd, O_RDWR | O_SYNC);
+ if(fd < 0) {
+ fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+ exit(1);
+ }
+
+ if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+ fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+ close(fd);
+ exit(1);
+ }
+
+ mtdLockInfo.start = 0;
+ mtdLockInfo.length = mtdInfo.size;
+ if(ioctl(fd, MEMUNLOCK, &mtdLockInfo)) {
+ close(fd);
+ return 0;
+ }
+
+ close(fd);
+ return 0;
+}
+
+int
+mtd_open(const char *mtd, int flags)
+{
+ FILE *fp;
+ char dev[PATH_MAX];
+ int i;
+
+ if ((fp = fopen("/proc/mtd", "r"))) {
+ while (fgets(dev, sizeof(dev), fp)) {
+ if (sscanf(dev, "mtd%d:", &i) && strstr(dev, mtd)) {
+ snprintf(dev, sizeof(dev), "/dev/mtd%d", i);
+ fclose(fp);
+ return open(dev, flags);
+ }
+ }
+ fclose(fp);
+ }
+
+ return open(mtd, flags);
+}
+
+int
+mtd_erase(const char *mtd)
+{
+ int fd;
+ struct mtd_info_user mtdInfo;
+ struct erase_info_user mtdEraseInfo;
+
+ fd = mtd_open(mtd, O_RDWR | O_SYNC);
+ if(fd < 0) {
+ fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+ exit(1);
+ }
+
+ if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+ fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+ close(fd);
+ exit(1);
+ }
+
+ mtdEraseInfo.length = mtdInfo.erasesize;
+
+ for (mtdEraseInfo.start = 0;
+ mtdEraseInfo.start < mtdInfo.size;
+ mtdEraseInfo.start += mtdInfo.erasesize) {
+
+ ioctl(fd, MEMUNLOCK, &mtdEraseInfo);
+ if(ioctl(fd, MEMERASE, &mtdEraseInfo)) {
+ fprintf(stderr, "Could not erase MTD device: %s\n", mtd);
+ close(fd);
+ exit(1);
+ }
+ }
+
+ close(fd);
+ return 0;
+
+}
+
+int
+mtd_write(int imagefd, const char *mtd, int quiet, bool do_erase)
+{
+ int fd, result;
+ size_t r, w, e;
+ struct mtd_info_user mtdInfo;
+ struct erase_info_user mtdEraseInfo;
+
+ fd = mtd_open(mtd, O_RDWR | O_SYNC);
+ if(fd < 0) {
+ fprintf(stderr, "Could not open mtd device: %s\n", mtd);
+ exit(1);
+ }
+
+ if(ioctl(fd, MEMGETINFO, &mtdInfo)) {
+ fprintf(stderr, "Could not get MTD device info from %s\n", mtd);
+ close(fd);
+ exit(1);
+ }
+
+ r = w = e = 0;
+ if (!quiet)
+ fprintf(stderr, " [ ]");
+
+ for (;;) {
+ /* buffer may contain data already (from trx check) */
+ r = buflen;
+ r += read(imagefd, buf + buflen, BUFSIZE - buflen);
+ w += r;
+
+ /* EOF */
+ if (r <= 0) break;
+
+ /* need to erase the next block before writing data to it */
+ while (do_erase && w > e) {
+ mtdEraseInfo.start = e;
+ mtdEraseInfo.length = mtdInfo.erasesize;
+
+ if (!quiet)
+ fprintf(stderr, "\b\b\b[e]");
+ /* erase the chunk */
+ if (ioctl (fd,MEMERASE,&mtdEraseInfo) < 0) {
+ fprintf(stderr, "Erasing mtd failed: %s\n", mtd);
+ exit(1);
+ }
+ e += mtdInfo.erasesize;
+ }
+
+ if (!quiet)
+ fprintf(stderr, "\b\b\b[w]");
+
+ if ((result = write(fd, buf, r)) < (ssize_t)r) {
+ if (result < 0) {
+ fprintf(stderr, "Error writing image.\n");
+ exit(1);
+ } else {
+ fprintf(stderr, "Insufficient space.\n");
+ exit(1);
+ }
+ }
+
+ buflen = 0;
+ }
+ if (!quiet)
+ fprintf(stderr, "\b\b\b\b");
+
+ close(fd);
+ return 0;
+}
+
+void
+usage(void)
+{
+ fprintf(stderr, "Usage: mtd [<options> ...] <command> [<arguments> ...] <device>\n\n"
+ "The device is in the format of mtdX (eg: mtd4) or its label.\n"
+ "mtd recognises these commands:\n"
+ " unlock unlock the device\n"
+ " erase erase all data on device\n"
+ " write <imagefile>|- write <imagefile> (use - for stdin) to device\n"
+ "Following options are available:\n"
+ " -q quiet mode (once: no [w] on writing,\n"
+ " twice: no status messages)\n"
+ " -e <device> erase <device> before executing the command\n\n"
+ "Example: To write linux.trx to mtd1 labeled as linux\n"
+ " mtd write linux.trx linux\n\n");
+ exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+ int ch, i, imagefd = -1, quiet, unlocked;
+ char *erase[MAX_ARGS], *device;
+ const char *imagefile = NULL;
+ enum {
+ CMD_ERASE,
+ CMD_WRITE,
+ CMD_UNLOCK
+ } cmd;
+
+ erase[0] = NULL;
+ buflen = 0;
+ quiet = 0;
+
+ while ((ch = getopt(argc, argv, "Fqe:")) != -1)
+ switch (ch) {
+ case 'F':
+ quiet = 1;
+ /* FALLTHROUGH */
+ case 'q':
+ quiet++;
+ break;
+ case 'e':
+ i = 0;
+ while ((erase[i] != NULL) && ((i + 1) < MAX_ARGS))
+ i++;
+
+ erase[i++] = optarg;
+ erase[i] = NULL;
+ break;
+
+ case '?':
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc < 2)
+ usage();
+
+ if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) {
+ cmd = CMD_UNLOCK;
+ device = argv[1];
+ } else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) {
+ cmd = CMD_ERASE;
+ device = argv[1];
+ } else if ((strcmp(argv[0], "write") == 0) && (argc == 3)) {
+ cmd = CMD_WRITE;
+ device = argv[2];
+
+ if (strcmp(argv[1], "-") == 0) {
+ imagefile = "<stdin>";
+ imagefd = 0;
+ } else {
+ imagefile = argv[1];
+ if ((imagefd = open(argv[1], O_RDONLY)) < 0) {
+ fprintf(stderr, "Couldn't open image file: %s!\n", imagefile);
+ exit(1);
+ }
+ }
+
+ if (!mtd_check(device)) {
+ fprintf(stderr, "Can't open device for writing!\n");
+ exit(1);
+ }
+ } else {
+ usage();
+ }
+
+ sync();
+
+ i = 0;
+ unlocked = 0;
+ while (erase[i] != NULL) {
+ if (quiet < 2)
+ fprintf(stderr, "Unlocking %s ...\n", erase[i]);
+ mtd_unlock(erase[i]);
+ if (quiet < 2)
+ fprintf(stderr, "Erasing %s ...\n", erase[i]);
+ mtd_erase(erase[i]);
+ if (strcmp(erase[i], device) == 0)
+ /* this means that <device> is unlocked and erased */
+ unlocked = 1;
+ i++;
+ }
+
+ if (!unlocked) {
+ if (quiet < 2)
+ fprintf(stderr, "Unlocking %s ...\n", device);
+ mtd_unlock(device);
+ }
+
+ switch (cmd) {
+ case CMD_UNLOCK:
+ break;
+ case CMD_ERASE:
+ if (unlocked) {
+ fprintf(stderr, "Already erased: %s\n", device);
+ break;
+ }
+ if (quiet < 2)
+ fprintf(stderr, "Erasing %s ...\n", device);
+ mtd_erase(device);
+ break;
+ case CMD_WRITE:
+ if (quiet < 2)
+ fprintf(stderr, "Writing from %s to %s ... ", imagefile, device);
+ mtd_write(imagefd, device, quiet, (unlocked == 0));
+ if (quiet < 2)
+ fprintf(stderr, "\n");
+ break;
+ }
+
+ sync();
+ return 0;
+}
diff --git a/package/cfgfs/src/pack.h b/package/cfgfs/src/pack.h
new file mode 100644
index 000000000..9dfb8233f
--- /dev/null
+++ b/package/cfgfs/src/pack.h
@@ -0,0 +1,95 @@
+/* $MirOS: contrib/hosted/fwcf/pack.h,v 1.13 2007/03/09 21:10:29 tg Exp $ */
+
+/*
+ * This file is part of the FreeWRT project. FreeWRT is copyrighted
+ * material, please see the LICENCE file in the top-level directory
+ * or at http://www.freewrt.org/licence for details.
+ */
+
+#ifndef PACK_H
+#define PACK_H
+
+struct FTSF_ENTRY;
+#ifndef FTS_SUBS_H
+typedef struct FTSF_ENTRY ftsf_entry;
+#endif
+
+/* XXX use macros from minilzop.h */
+
+#define STOREB(x) do { \
+ if (hdrleft < 1) \
+ return (NULL); \
+ *hdrptr++ = (x) & 0xFF; \
+ --hdrleft; \
+ } while (0)
+
+#define STOREW(x) do { \
+ if (hdrleft < 2) \
+ return (NULL); \
+ *hdrptr++ = (x) & 0xFF; \
+ *hdrptr++ = ((x) >> 8) & 0xFF; \
+ hdrleft -= 2; \
+ } while (0)
+
+#define STORET(x) do { \
+ if (hdrleft < 3) \
+ return (NULL); \
+ *hdrptr++ = (x) & 0xFF; \
+ *hdrptr++ = ((x) >> 8) & 0xFF; \
+ *hdrptr++ = ((x) >> 16) & 0xFF; \
+ hdrleft -= 3; \
+ } while (0)
+
+#define STORED(x) do { \
+ if (hdrleft < 4) \
+ return (NULL); \
+ *hdrptr++ = (x) & 0xFF; \
+ *hdrptr++ = ((x) >> 8) & 0xFF; \
+ *hdrptr++ = ((x) >> 16) & 0xFF; \
+ *hdrptr++ = ((x) >> 24) & 0xFF; \
+ hdrleft -= 4; \
+ } while (0)
+
+#define LOADW(x) __extension__({ \
+ uint8_t *lwbf = (uint8_t *)(x); \
+ uint32_t res = 0; \
+ res = (res << 8) | lwbf[1]; \
+ res = (res << 8) | lwbf[0]; \
+ res; \
+ })
+
+#define LOADT(x) __extension__({ \
+ uint8_t *lwbf = (uint8_t *)(x); \
+ uint32_t res = 0; \
+ res = (res << 8) | lwbf[2]; \
+ res = (res << 8) | lwbf[1]; \
+ res = (res << 8) | lwbf[0]; \
+ res; \
+ })
+
+#define LOADD(x) __extension__({ \
+ uint8_t *lwbf = (uint8_t *)(x); \
+ uint32_t res = 0; \
+ res = (res << 8) | lwbf[3]; \
+ res = (res << 8) | lwbf[2]; \
+ res = (res << 8) | lwbf[1]; \
+ res = (res << 8) | lwbf[0]; \
+ res; \
+ })
+
+__BEGIN_DECLS
+char *ft_pack(ftsf_entry *);
+char *ft_packm(void);
+
+char *mkheader(char *, size_t, uint32_t, uint32_t, uint8_t);
+char *mktrailer(char *, size_t);
+
+void ft_dump(char *);
+void ft_creatm(char *, const char *);
+
+char *fwcf_unpack(int, size_t *);
+char *fwcf_pack(char *, size_t, int, size_t *);
+char *fwcf_packm(const char *, int, size_t *);
+__END_DECLS
+
+#endif
diff --git a/package/cfgfs/src/replace.c b/package/cfgfs/src/replace.c
new file mode 100644
index 000000000..50f137b67
--- /dev/null
+++ b/package/cfgfs/src/replace.c
@@ -0,0 +1,39 @@
+#ifndef __UCLIBC__
+#include <stdlib.h>
+#include <string.h>
+/* like strncpy but does not 0 fill the buffer and always null
+ terminates. bufsize is the size of the destination buffer */
+size_t rep_strlcpy(char *d, const char *s, size_t bufsize)
+{
+ size_t len = strlen(s);
+ size_t ret = len;
+ if (bufsize <= 0) return 0;
+ if (len >= bufsize) len = bufsize-1;
+ memcpy(d, s, len);
+ d[len] = 0;
+ return ret;
+}
+
+/* like strncat but does not 0 fill the buffer and always null
+ terminates. bufsize is the length of the buffer, which should
+ be one more than the maximum resulting string length */
+size_t rep_strlcat(char *d, const char *s, size_t bufsize)
+{
+ size_t len1 = strlen(d);
+ size_t len2 = strlen(s);
+ size_t ret = len1 + len2;
+
+ if (len1+len2 >= bufsize) {
+ if (bufsize < (len1+1)) {
+ return ret;
+ }
+ len2 = bufsize - (len1+1);
+ }
+ if (len2 > 0) {
+ memcpy(d+len1, s, len2);
+ d[len1+len2] = 0;
+ }
+ return ret;
+}
+
+#endif
diff --git a/package/cfgfs/src/replace.h b/package/cfgfs/src/replace.h
new file mode 100644
index 000000000..80385f4a2
--- /dev/null
+++ b/package/cfgfs/src/replace.h
@@ -0,0 +1,6 @@
+#ifndef __UCLIBC__
+#define strlcpy rep_strlcpy
+size_t rep_strlcpy(char *d, const char *s, size_t bufsize);
+#define strlcat rep_strlcat
+size_t rep_strlcat(char *d, const char *s, size_t bufsize);
+#endif
diff --git a/package/cfgfs/src/sys_bsd.c b/package/cfgfs/src/sys_bsd.c
new file mode 100644
index 000000000..b37fd5637
--- /dev/null
+++ b/package/cfgfs/src/sys_bsd.c
@@ -0,0 +1,96 @@
+/* $MirOS: contrib/hosted/fwcf/sys_bsd.c,v 1.4 2007/03/13 18:14:30 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006, 2007
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Provided that these terms and disclaimer and all copyright notices
+ * are retained or reproduced in an accompanying document, permission
+ * is granted to deal in this work without restriction, including un-
+ * limited rights to use, publicly perform, distribute, sell, modify,
+ * merge, give away, or sublicence.
+ *
+ * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+ * the utmost extent permitted by applicable law, neither express nor
+ * implied; without malicious intent or gross negligence. In no event
+ * may a licensor, author or contributor be held liable for indirect,
+ * direct, other damage, loss, or other issues arising in any way out
+ * of dealing in the work, even if advised of the possibility of such
+ * damage or existence of a defect, except proven that it results out
+ * of said person's immediate fault when using the work as intended.
+ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "defs.h"
+#include "sysdeps.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/sys_bsd.c,v 1.4 2007/03/13 18:14:30 tg Exp $");
+
+void
+pull_rndata(uint8_t *buf, size_t n)
+{
+#ifdef RND_DISABLE
+ while (n--)
+ *buf++ = 0xF6;
+ *--buf = 0xFF;
+#else
+#ifdef RND_DEBUG
+ fprintf(stderr, "writing %ld bytes of entropy\n", n);
+ while (n > 4) {
+#else
+ while (n >= 4) {
+#endif
+ *(uint32_t *)buf = arc4random();
+#ifdef RND_DEBUG
+ *buf = 0xF6;
+#endif
+ buf += 4;
+ n -= 4;
+ }
+ while (n) {
+#ifdef RND_DEBUG
+ *buf++ = 0xF6;
+#else
+ *buf++ = arc4random() & 0xFF;
+#endif
+ n--;
+ }
+#ifdef RND_DEBUG
+ *--buf = 0xFF;
+#endif
+#endif
+}
+
+void
+push_rndata(uint8_t *buf, size_t n)
+{
+#ifdef RND_DEBUG
+ size_t i;
+#endif
+#ifdef __MirBSD__
+ arc4random_pushb(buf, n);
+#else
+ int fd;
+ uint32_t x;
+
+ arc4random_addrandom(buf, n);
+ x = arc4random();
+ if ((fd = open("/dev/arandom", O_WRONLY)) >= 0) {
+ write(fd, &x, 4);
+ close(fd);
+ } else
+ warn("cannot write to /dev/arandom");
+#endif
+#ifdef RND_DEBUG
+ printf("reading %ld bytes of entropy\n", n);
+ for (i = 0; i < n; ++i) {
+ printf(" %02X", buf[i]);
+ if ((i & 0xF) == 0xF)
+ putchar('\n');
+ }
+ putchar('\n');
+#endif
+}
diff --git a/package/cfgfs/src/sys_linux.c b/package/cfgfs/src/sys_linux.c
new file mode 100644
index 000000000..38283a44d
--- /dev/null
+++ b/package/cfgfs/src/sys_linux.c
@@ -0,0 +1,61 @@
+/* $MirOS: contrib/hosted/fwcf/sys_linux.c,v 1.3 2006/09/26 10:25:03 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "sysdeps.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/sys_linux.c,v 1.3 2006/09/26 10:25:03 tg Exp $");
+
+void
+pull_rndata(uint8_t *buf, size_t n)
+{
+ int fd;
+
+ if ((fd = open("/dev/urandom", O_RDONLY)) < 0) {
+ warn("Cannot open /dev/urandom for %sing", "read");
+ return;
+ }
+ if ((size_t)read(fd, buf, n) != n)
+ warn("Cannot read %lu bytes from /dev/urandom", (u_long)n);
+ close(fd);
+}
+
+void
+push_rndata(uint8_t *buf, size_t n)
+{
+ int fd;
+
+ if ((fd = open("/dev/urandom", O_WRONLY)) < 0) {
+ warn("Cannot open /dev/urandom for %sing", "writ");
+ return;
+ }
+ if ((size_t)write(fd, buf, n) != n)
+ warn("Cannot write %lu bytes to /dev/urandom", (u_long)n);
+ close(fd);
+}
diff --git a/package/cfgfs/src/sysdeps.h b/package/cfgfs/src/sysdeps.h
new file mode 100644
index 000000000..34313f58c
--- /dev/null
+++ b/package/cfgfs/src/sysdeps.h
@@ -0,0 +1,17 @@
+/* $MirOS: contrib/hosted/fwcf/sysdeps.h,v 1.2 2006/09/26 10:25:03 tg Exp $ */
+
+/*
+ * This file is part of the FreeWRT project. FreeWRT is copyrighted
+ * material, please see the LICENCE file in the top-level directory
+ * or at http://www.freewrt.org/licence for details.
+ */
+
+#ifndef SYSDEPS_H
+#define SYSDEPS_H
+
+__BEGIN_DECLS
+void pull_rndata(uint8_t *, size_t);
+void push_rndata(uint8_t *, size_t);
+__END_DECLS
+
+#endif
diff --git a/package/cfgfs/src/tool.c b/package/cfgfs/src/tool.c
new file mode 100644
index 000000000..3daf141cd
--- /dev/null
+++ b/package/cfgfs/src/tool.c
@@ -0,0 +1,302 @@
+/* $MirOS: contrib/hosted/fwcf/tool.c,v 1.7 2007/03/09 22:35:13 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006, 2007
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Provided that these terms and disclaimer and all copyright notices
+ * are retained or reproduced in an accompanying document, permission
+ * is granted to deal in this work without restriction, including un-
+ * limited rights to use, publicly perform, distribute, sell, modify,
+ * merge, give away, or sublicence.
+ *
+ * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+ * the utmost extent permitted by applicable law, neither express nor
+ * implied; without malicious intent or gross negligence. In no event
+ * may a licensor, author or contributor be held liable for indirect,
+ * direct, other damage, loss, or other issues arising in any way out
+ * of dealing in the work, even if advised of the possibility of such
+ * damage or existence of a defect, except proven that it results out
+ * of said person's immediate fault when using the work as intended.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "compress.h"
+#include "minilzop.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/tool.c,v 1.7 2007/03/09 22:35:13 tg Exp $");
+
+static __dead void usage(void);
+static int mkfwcf(int, const char *, int);
+static int unfwcf(int, const char *);
+#ifndef SMALL
+static int refwcf(int, int, int);
+#endif
+static int fsopen(const char *, int, int);
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ int mode = 0, doempty = 0;
+ int ifd, ofd;
+#ifdef SMALL
+ int calg = -1;
+#else
+ int calg = 0;
+ const char *infile = NULL, *outfile = NULL;
+#endif
+ const char *dfile = NULL;
+ const char *file_root = NULL;
+ fwcf_compressor *cl;
+
+#ifdef SMALL
+ while ((c = getopt(argc, argv, "D:delMUZ")) != -1)
+#else
+ while ((c = getopt(argc, argv, "C:cD:dei:lMo:RUZ")) != -1)
+#endif
+ switch (c) {
+#ifndef SMALL
+ case 'C':
+ if (!(calg = strtonum(optarg, 1, 255, NULL))
+ && !(calg = compressor_getbyname(optarg)))
+ usage();
+ break;
+ case 'c':
+ calg = -1;
+ break;
+#endif
+ case 'D':
+ if (doempty)
+ usage();
+ dfile = optarg;
+ break;
+ case 'd':
+ mode = (mode == 5 || mode == 6) ? 6 : 3;
+ break;
+ case 'e':
+ if (dfile != NULL)
+ usage();
+ doempty = 1;
+ break;
+#ifndef SMALL
+ case 'i':
+ infile = optarg;
+ break;
+#endif
+ case 'l':
+ return (list_compressors());
+ case 'M':
+ mode = 1;
+ break;
+#ifndef SMALL
+ case 'o':
+ outfile = optarg;
+ break;
+ case 'R':
+ mode = 4;
+ break;
+#endif
+ case 'U':
+ mode = 2;
+ break;
+ case 'Z':
+ mode = (mode == 3) ? 6 : 5;
+ break;
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
+
+ switch (mode) {
+ case 1:
+ if (argc != ((dfile == NULL) ? (1 - doempty) : 0))
+ usage();
+ break;
+ case 2:
+ if (argc != ((dfile == NULL) ? 1 : 0))
+ usage();
+ break;
+#ifndef SMALL
+ case 3:
+ case 4:
+ if (argc || doempty || (dfile != NULL))
+ usage();
+ break;
+#endif
+ case 5:
+ case 6:
+ if ((dfile != NULL) || doempty
+#ifndef SMALL
+ || infile || outfile
+#endif
+ )
+ usage();
+ break;
+ default:
+ usage();
+ }
+ if (argc)
+ file_root = *argv;
+
+ if (mode == 5 || mode == 6) {
+ ifd = fsopen(argc-- > 0 ? *argv++ : NULL,
+ O_RDONLY, STDIN_FILENO);
+ ofd = fsopen(argc-- > 0 ? *argv++ : NULL,
+ O_WRONLY | O_CREAT | O_TRUNC, STDOUT_FILENO);
+ if (argc > 0)
+ usage();
+#ifndef SMALL
+ if (calg == 0)
+ /* force host tool to compress even without -c */
+ calg = -1;
+#endif
+ goto get_calg;
+ }
+
+#ifdef SMALL
+ ifd = STDIN_FILENO;
+ ofd = STDOUT_FILENO;
+#else
+ ifd = fsopen(infile, O_RDONLY, STDIN_FILENO);
+ ofd = fsopen(outfile, O_WRONLY | O_CREAT | O_TRUNC, STDOUT_FILENO);
+#endif
+
+ if (mode == 2 && dfile != NULL) {
+ char *data;
+ size_t sz;
+ int dfd;
+
+ if ((data = fwcf_unpack(ifd, &sz)) == NULL)
+ return (1);
+ if ((dfd = fsopen(dfile, O_WRONLY | O_CREAT | O_TRUNC,
+ STDOUT_FILENO)) < 0)
+ err(1, "open %s", dfile);
+ write_aszdata(dfd, data, sz);
+ close(dfd);
+ free(data);
+ return (0);
+ }
+
+ if ((mode == 2) || (mode == 3))
+ return (unfwcf(ifd, (mode == 3) ? NULL : file_root));
+
+ get_calg:
+ if (calg == -1) {
+ if ((cl = compress_enumerate()) != NULL)
+ for (calg = 1; calg < 257; ++calg)
+ if (cl[calg & 0xFF].name != NULL)
+ break;
+
+ if ((cl == NULL) || (calg == 257))
+ errx(1, "no compression algorithms found");
+ calg &= 0xFF;
+ }
+
+ if (mode == 5 || mode == 6)
+ return (minilzop(ifd, ofd, calg, (mode == 6)));
+
+#ifndef SMALL
+ if (mode == 4)
+ return (refwcf(ifd, ofd, calg));
+#endif
+
+ if (dfile != NULL) {
+ char *udata, *data;
+ size_t sz, isz;
+ int dfd;
+
+ if ((dfd = fsopen(dfile, O_RDONLY, STDIN_FILENO)) < 0)
+ err(1, "open %s", dfile);
+ read_aszdata(dfd, &udata, &isz);
+ close(dfd);
+ data = fwcf_pack(udata, isz, calg, &sz);
+ isz = write(ofd, data, sz);
+ free(data);
+ return (isz == sz ? 0 : 1);
+ }
+
+ return (mkfwcf(ofd, doempty ? NULL : file_root, calg));
+}
+
+static __dead void
+usage(void)
+{
+ extern const char *__progname;
+
+ fprintf(stderr, "Usage:"
+#ifdef SMALL
+ " %s -M { -D <file> | -e | <directory> }"
+ "\n %s -U { -D <file> | <directory> }"
+ "\n %s -Z[d] [<infile> [<outfile>]]"
+ "\n %s -l\n", __progname, __progname, __progname, __progname);
+#else
+ " %s -M [-c | -C <compressor>] [-o <file>]"
+ "\n { -D <file> | -e | <directory> }"
+ "\n %s [-i <file>] -U { -D <file> | <directory> }"
+ "\n %s [-i <file>] -d"
+ "\n %s -R [-c | -C <compressor>] [-i <infile>] [-o <outfile>]"
+ "\n %s -Z[d] [-c | -C <compressor>] [<infile> [<outfile>]]"
+ "\n %s -l\n",
+ __progname, __progname, __progname, __progname, __progname,
+ __progname);
+#endif
+ exit(1);
+}
+
+static int
+mkfwcf(int fd, const char *dir, int algo)
+{
+ size_t sz;
+ char *data;
+
+ data = fwcf_packm(dir, algo, &sz);
+ return ((size_t)write(fd, data, sz) == sz ? 0 : 1);
+}
+
+static int
+unfwcf(int fd, const char *dir)
+{
+ char *udata;
+
+ if ((udata = fwcf_unpack(fd, NULL))) {
+#ifndef SMALL
+ if (dir == NULL)
+ ft_dump(udata);
+ else
+#endif
+ ft_creatm(udata, dir);
+ }
+ return (udata != NULL ? 0 : 1);
+}
+
+#ifndef SMALL
+static int
+refwcf(int ifd, int ofd, int algo)
+{
+ char *udata, *data;
+ size_t sz, isz;
+
+ if ((udata = fwcf_unpack(ifd, &isz)) == NULL)
+ return (1);
+ data = fwcf_pack(udata, isz, algo, &sz);
+ return ((size_t)write(ofd, data, sz) == sz ? 0 : 1);
+}
+#endif
+
+static int
+fsopen(const char *fn, int mode, int altfd)
+{
+ return (((fn == NULL) || (*fn == '\0') ||
+ ((fn[0] == '-') && (fn[1] == '\0'))) ? altfd :
+ open(fn, mode, 0666));
+}
diff --git a/package/cfgfs/src/tool/Makefile b/package/cfgfs/src/tool/Makefile
new file mode 100644
index 000000000..8ffa054a2
--- /dev/null
+++ b/package/cfgfs/src/tool/Makefile
@@ -0,0 +1,59 @@
+# $MirOS: contrib/hosted/fwcf/tool/Makefile,v 1.5 2007/02/28 22:59:38 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+PROG= fwcf_tool
+SRCS= tool.c ${COMPRESSORS} sys_bsd.c
+NOMAN= yes
+DPADD+= ${LIBZ}
+LDADD+= -lz
+CLEANFILES+= ${.CURDIR}/test_c.out ${.CURDIR}/tesz_c.out ${.CURDIR}/tesL_c.out \
+ ${.CURDIR}/test_c.nil ${.CURDIR}/tesz_c.nil ${.CURDIR}/tesL_c.nil \
+ ${.CURDIR}/test_d.out ${.CURDIR}/tesz_d.out ${.CURDIR}/tesL_d.out \
+ ${.CURDIR}/test_d.nil ${.CURDIR}/tesz_d.nil ${.CURDIR}/tesL_d.nil \
+ ${.CURDIR}/test_r.out ${.CURDIR}/tesz_r.out ${.CURDIR}/tesL_r.out \
+ ${.CURDIR}/test_r.nil ${.CURDIR}/tesz_r.nil ${.CURDIR}/tesL_r.nil \
+ ${.CURDIR}/dtest_d.out ${.CURDIR}/dtesz_d.out ${.CURDIR}/dtesL_d.out \
+ ${.CURDIR}/dtest_d.nil ${.CURDIR}/dtesz_d.nil ${.CURDIR}/dtesL_d.nil \
+ ${.CURDIR}/test_D.out ${.CURDIR}/test_D.cz
+
+test: ${PROG}
+ ./${PROG} -Mo ${.CURDIR}/test_c.out ${.CURDIR}/../mkfwcf/CVS
+ ./${PROG} -MC 1 -o ${.CURDIR}/tesz_c.out ${.CURDIR}/../mkfwcf/CVS
+ ./${PROG} -MC 0x10 -o ${.CURDIR}/tesL_c.out ${.CURDIR}/../mkfwcf/CVS
+ ./${PROG} -Meo ${.CURDIR}/test_c.nil
+ ./${PROG} -MeC 1 -o ${.CURDIR}/tesz_c.nil
+ ./${PROG} -MeC 16 -o ${.CURDIR}/tesL_c.nil
+ ./${PROG} -Ud <${.CURDIR}/test_c.out >${.CURDIR}/dtest_d.out
+ ./${PROG} -Ud <${.CURDIR}/tesz_c.out >${.CURDIR}/dtesz_d.out
+ ./${PROG} -Ud <${.CURDIR}/tesL_c.out >${.CURDIR}/dtesL_d.out
+ ./${PROG} -Ud <${.CURDIR}/test_c.nil >${.CURDIR}/dtest_d.nil
+ ./${PROG} -Ud <${.CURDIR}/tesz_c.nil >${.CURDIR}/dtesz_d.nil
+ ./${PROG} -Ud <${.CURDIR}/tesL_c.nil >${.CURDIR}/dtesL_d.nil
+ ./${PROG} -Ui ${.CURDIR}/test_c.out out.test
+ ./${PROG} -Ui ${.CURDIR}/tesz_c.out out.tesz
+ ./${PROG} -Ui ${.CURDIR}/tesL_c.out out.tesL
+.ifndef notyet
+ ./${PROG} -Ri ${.CURDIR}/tesz_c.out -o ${.CURDIR}/test_r.out
+ ./${PROG} -Ri ${.CURDIR}/tesz_c.nil -o ${.CURDIR}/test_r.nil
+ ./${PROG} -Rci ${.CURDIR}/test_c.out -o ${.CURDIR}/tesz_r.out
+ ./${PROG} -Rci ${.CURDIR}/test_c.nil -o ${.CURDIR}/tesz_r.nil
+ ./${PROG} -RC 0x10 -i ${.CURDIR}/tesz_c.out -o ${.CURDIR}/tesL_r.out
+ ./${PROG} -RC 16 -i ${.CURDIR}/test_c.nil -o ${.CURDIR}/tesL_r.nil
+.else
+ ./${PROG} -Ri ${.CURDIR}/test_c.out -o ${.CURDIR}/test_r.out
+ ./${PROG} -Ri ${.CURDIR}/test_c.nil -o ${.CURDIR}/test_r.nil
+ ./${PROG} -Rci ${.CURDIR}/tesz_c.out -o ${.CURDIR}/tesz_r.out
+ ./${PROG} -Rci ${.CURDIR}/tesz_c.nil -o ${.CURDIR}/tesz_r.nil
+.endif
+ ./${PROG} -UD ${.CURDIR}/test_D.out <${.CURDIR}/tesL_c.out
+ ./${PROG} -McD ${.CURDIR}/test_D.out >${.CURDIR}/test_D.cz
+
+.include <bsd.prog.mk>
+
+clean cleandir: clean-local
+
+clean-local:
+ -rm -rf out.test out.tesz out.tesL
diff --git a/package/cfgfs/src/unfwcf/Makefile b/package/cfgfs/src/unfwcf/Makefile
new file mode 100644
index 000000000..678482ad4
--- /dev/null
+++ b/package/cfgfs/src/unfwcf/Makefile
@@ -0,0 +1,28 @@
+# $MirOS: contrib/hosted/fwcf/unfwcf/Makefile,v 1.14 2006/09/26 10:25:06 tg Exp $
+#-
+# This file is part of the FreeWRT project. FreeWRT is copyrighted
+# material, please see the LICENCE file in the top-level directory
+# or at http://www.freewrt.org/licence for details.
+
+PROG= unfwcf
+SRCS= ${PROG}.c ${COMPRESSORS} sys_bsd.c
+NOMAN= yes
+DPADD+= ${LIBZ}
+LDADD+= -lz
+CLEANFILES+= ${.CURDIR}/test.out ${.CURDIR}/tesz.out \
+ ${.CURDIR}/test.nil ${.CURDIR}/tesz.nil
+
+test: ${PROG}
+ ./${PROG} -d <${.CURDIR}/../mkfwcf/test.out >${.CURDIR}/test.out
+ ./${PROG} -d <${.CURDIR}/../mkfwcf/tesz.out >${.CURDIR}/tesz.out
+ ./${PROG} -d <${.CURDIR}/../mkfwcf/test.nil >${.CURDIR}/test.nil
+ ./${PROG} -d <${.CURDIR}/../mkfwcf/tesz.nil >${.CURDIR}/tesz.nil
+ ./${PROG} -i ${.CURDIR}/../mkfwcf/test.out out.test
+ ./${PROG} -i ${.CURDIR}/../mkfwcf/tesz.out out.tesz
+
+.include <bsd.prog.mk>
+
+clean cleandir: clean-local
+
+clean-local:
+ -rm -rf out.test out.tesz
diff --git a/package/cfgfs/src/unfwcf/unfwcf.c b/package/cfgfs/src/unfwcf/unfwcf.c
new file mode 100644
index 000000000..839235695
--- /dev/null
+++ b/package/cfgfs/src/unfwcf/unfwcf.c
@@ -0,0 +1,100 @@
+/* $MirOS: contrib/hosted/fwcf/unfwcf/unfwcf.c,v 1.8 2006/09/24 20:35:01 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "compress.h"
+#include "pack.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/unfwcf/unfwcf.c,v 1.8 2006/09/24 20:35:01 tg Exp $");
+
+static int unfwcf(int, const char *);
+static __dead void usage(void);
+
+static int do_dump = 0;
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ int fd = STDIN_FILENO;
+ const char *file_root = NULL, *infile = NULL;
+
+ while ((c = getopt(argc, argv, "di:l")) != -1)
+ switch (c) {
+ case 'd':
+ do_dump = 1;
+ break;
+ case 'i':
+ infile = optarg;
+ break;
+ case 'l':
+ return (list_compressors());
+ default:
+ usage();
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (argc != (1 - do_dump))
+ usage();
+
+ file_root = *argv;
+
+ if (infile != NULL)
+ if ((fd = open(infile, O_RDONLY, 0)) < 0)
+ err(1, "open %s", infile);
+
+ return (unfwcf(fd, file_root));
+}
+
+static __dead void
+usage(void)
+{
+ extern const char *__progname;
+
+ fprintf(stderr, "Usage:\t%s [-i <infile>] <directory>"
+ "\n\t%s -d [-i <infile>]"
+ "\n\t%s -l\n", __progname, __progname, __progname);
+ exit(1);
+}
+
+static int
+unfwcf(int fd, const char *dir)
+{
+ char *udata;
+
+ if ((udata = fwcf_unpack(fd, NULL))) {
+ if (do_dump)
+ ft_dump(udata);
+ else
+ ft_creatm(udata, dir);
+ }
+ return (udata != NULL ? 0 : 1);
+}
diff --git a/package/cfgfs/src/unwraps.c b/package/cfgfs/src/unwraps.c
new file mode 100644
index 000000000..d03f297e3
--- /dev/null
+++ b/package/cfgfs/src/unwraps.c
@@ -0,0 +1,95 @@
+/* $MirOS: contrib/hosted/fwcf/unwraps.c,v 1.10 2006/09/26 10:25:03 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "adler.h"
+#include "compress.h"
+#include "pack.h"
+#include "sysdeps.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/unwraps.c,v 1.10 2006/09/26 10:25:03 tg Exp $");
+
+char *
+fwcf_unpack(int fd, size_t *inner)
+{
+ uint8_t c, hdrbuf[12];
+ size_t outer, x_inner, x, len, maxln;
+ char *cdata, *udata;
+ ADLER_DECL;
+
+ if (inner == NULL)
+ inner = &x_inner;
+
+ if (read(fd, hdrbuf, 12) != 12)
+ err(1, "read");
+
+ if (strncmp((const char *)hdrbuf, "FWCF", 4))
+ errx(1, "file format error");
+
+ outer = LOADT(hdrbuf + 4);
+ /* we don't need to support older versions, but specification
+ major 0 and 1 are compatible */
+ if (hdrbuf[7] > FWCF_VER)
+ errx(1, "wrong file version %02Xh", hdrbuf[7]);
+ *inner = LOADT(hdrbuf + 8);
+ c = hdrbuf[11];
+ maxln = ((outer + (DEF_FLASHBLOCK - 1)) / DEF_FLASHBLOCK)
+ * DEF_FLASHBLOCK;
+
+ if (((cdata = malloc(maxln)) == NULL) ||
+ ((udata = malloc(*inner)) == NULL))
+ err(1, "malloc");
+ memcpy(cdata, hdrbuf, 12);
+ if (read(fd, cdata + 12, maxln - 12) < (ssize_t)(outer - 12))
+ err(1, "read");
+
+ len = outer - 4;
+ ADLER_CALC(cdata);
+ if ((s1 != LOADW(cdata + outer - 4)) ||
+ (s2 != LOADW(cdata + outer - 2)))
+ errx(1, "crc mismatch: %02X%02X%02X%02X != %04X%04X",
+ (uint8_t)cdata[outer - 1], (uint8_t)cdata[outer - 2],
+ (uint8_t)cdata[outer - 3], (uint8_t)cdata[outer - 4],
+ s2, s1);
+
+ if ((x = compressor_get(c)->decompress(udata, *inner, cdata + 12,
+ outer - 16)) != *inner)
+ errx(1, "size mismatch: decompressed %lu, want %lu", (u_long)x,
+ (u_long)*inner);
+ push_rndata((uint8_t *)cdata + outer, maxln - outer);
+ free(cdata);
+#ifdef DEBUG
+ fprintf(stderr, "fwcf_unpack: decompressed outer %lu inner %lu\n",
+ (u_long)outer, (u_long)*inner);
+#endif
+ return (udata);
+}
diff --git a/package/cfgfs/src/wraps.c b/package/cfgfs/src/wraps.c
new file mode 100644
index 000000000..650474791
--- /dev/null
+++ b/package/cfgfs/src/wraps.c
@@ -0,0 +1,103 @@
+/* $MirOS: contrib/hosted/fwcf/wraps.c,v 1.7 2006/09/26 10:25:03 tg Exp $ */
+
+/*-
+ * Copyright (c) 2006
+ * Thorsten Glaser <tg@mirbsd.de>
+ *
+ * Licensee is hereby permitted to deal in this work without restric-
+ * tion, including unlimited rights to use, publicly perform, modify,
+ * merge, distribute, sell, give away or sublicence, provided all co-
+ * pyright notices above, these terms and the disclaimer are retained
+ * in all redistributions or reproduced in accompanying documentation
+ * or other materials provided with binary redistributions.
+ *
+ * Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
+ * express, or implied, to the maximum extent permitted by applicable
+ * law, without malicious intent or gross negligence; in no event may
+ * licensor, an author or contributor be held liable for any indirect
+ * or other damage, or direct damage except proven a consequence of a
+ * direct error of said person and intended use of this work, loss or
+ * other issues arising in any way out of its use, even if advised of
+ * the possibility of such damage or existence of a defect.
+ */
+
+#include <sys/param.h>
+#include <err.h>
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "defs.h"
+#include "adler.h"
+#include "compress.h"
+#include "fts_subs.h"
+#include "pack.h"
+#include "sysdeps.h"
+
+__RCSID("$MirOS: contrib/hosted/fwcf/wraps.c,v 1.7 2006/09/26 10:25:03 tg Exp $");
+
+char *
+fwcf_packm(const char *dir, int algo, size_t *dstsz)
+{
+ char empty_data = 0, *data, *f_data = NULL;
+ size_t i;
+
+ if (dir == NULL) {
+ data = &empty_data;
+ i = 1;
+ } else {
+ ftsf_start(dir);
+ data = (f_data = ft_packm()) + sizeof (size_t);
+ i = *(size_t *)f_data - sizeof (size_t);
+ }
+ data = fwcf_pack(data, i, algo, dstsz);
+ if (f_data != NULL)
+ free(f_data);
+ return (data);
+}
+
+char *
+fwcf_pack(char *odata, size_t i, int algo, size_t *dstsz)
+{
+ int j;
+ size_t k;
+ char *data, *cdata;
+
+ if (i > 0xFFFFFF)
+ errx(1, "inner size of %lu too large", (u_long)i);
+#ifdef DEBUG
+ fprintf(stderr, "fwcf_pack: algo %02X packing %lu\n", algo, (u_long)i);
+#endif
+
+ if ((j = compressor_get(algo)->compress(&cdata, odata, i)) == -1)
+ errx(1, "%s compression failed", compressor_get(algo)->name);
+
+ /* 12 bytes header, padding to 4-byte boundary, 4 bytes trailer */
+ k = ((j + 19) / 4) * 4;
+#if DEF_FLASHPART > 0xFFFFFF
+# error DEF_FLASHPART too large
+#endif
+ if (k > DEF_FLASHPART)
+ errx(1, "%lu bytes too large for flash partition of %lu KiB",
+ (u_long)k, DEF_FLASHPART / 1024UL);
+ /* padded to size of flash block */
+#if (DEF_FLASHBLOCK & 3)
+# error DEF_FLASHBLOCK must be dword-aligned
+#endif
+ *dstsz = ((k + (DEF_FLASHBLOCK - 1)) / DEF_FLASHBLOCK) * DEF_FLASHBLOCK;
+ if ((data = malloc(*dstsz)) == NULL)
+ err(1, "malloc");
+ mkheader(data, *dstsz, k, i, algo);
+ memcpy(data + 12, cdata, j);
+ free(cdata);
+ k = j + 12;
+ while (k & 3)
+ data[k++] = 0;
+ mktrailer(data, k);
+ k += 4;
+ pull_rndata((uint8_t *)data + k, *dstsz - k);
+ return (data);
+}
diff --git a/package/cgilib/Config.in b/package/cgilib/Config.in
new file mode 100644
index 000000000..40da2fc47
--- /dev/null
+++ b/package/cgilib/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_CGILIB
+ prompt "cgilib............................ Simple CGI Library"
+ tristate
+ default n
+ help
+ This library provides a simple programming API to the Common Gateway
+ Interface (CGI). It features HTTP Redirect, provides read access to
+ FORM variables, sets HTTP Cookies and reads them.
+
+ http://www.infodrom.org/projects/cgilib/
diff --git a/package/cgilib/Makefile b/package/cgilib/Makefile
new file mode 100644
index 000000000..dc0dc9337
--- /dev/null
+++ b/package/cgilib/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cgilib
+PKG_VERSION:= 0.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2c7053f58dfb06f7a80a112797ed7e86
+MASTER_SITES:= http://www.infodrom.org/projects/cgilib/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CGILIB,cgilib,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_CGILIB}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libcgi.so* ${IDIR_CGILIB}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cgilib/extra/m4/libtool.m4 b/package/cgilib/extra/m4/libtool.m4
new file mode 100644
index 000000000..2f42cf831
--- /dev/null
+++ b/package/cgilib/extra/m4/libtool.m4
@@ -0,0 +1,7370 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 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 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 56 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_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
+
+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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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
+_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_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])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
+_LT_PROG_ECHO_BACKSLASH
+
+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
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# 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'
+
+# 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_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 "X$][$1" | $Xsed -e "$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 "X$<var>" | $Xsed -e "$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'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+ ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_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])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+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) 2008 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.
+if test "$no_create" != yes; then
+ 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)
+fi
+])# 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_XSI_SHELLFNS
+
+ 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"
+
+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)],
+ [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
+
+
+# _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([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)])
+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], [])
+
+
+# _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 test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 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"
+ ])
+ 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" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# 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
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ _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=echo
+ _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
+# -----------------------
+# 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.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+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],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+[$]*
+_LT_EOF
+ exit 0
+fi
+
+# 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
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+ [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _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 __oline__ "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
+ ;;
+sparc*-*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*) 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"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+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 \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_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_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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/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;
+ ;;
+
+ 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"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$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 __oline__ "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
+
+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;
+ /* 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:__oline__: $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:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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
+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
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # 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 -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # 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; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+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=`$ECHO "X$lib" | $Xsed -e '\''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="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ 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
+ ;;
+ 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`'
+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
+ 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
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+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[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ # Handle Gentoo/FreeBSD as it was Linux
+ case $host_vendor in
+ gentoo)
+ version_type=linux ;;
+ *)
+ version_type=freebsd-$objformat ;;
+ esac
+
+ 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
+ ;;
+ 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
+ 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
+ ;;
+
+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'
+ ;;
+
+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)
+ 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
+ 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],
+ [shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # 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;/^$/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
+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([], [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
+
+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
+ 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_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [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.
+ if ( 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
+ ;;
+
+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]) 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)
+ 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_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_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.
+ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+ 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:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: $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:__oline__: 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_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-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
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ _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([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};"\
+" /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 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
+#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_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_save_LIBS"
+ CFLAGS="$lt_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
+
+_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_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)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+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)=
+ ;;
+ 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
+ ;;
+ 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)
+ 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*)
+ # IBM XL 8.0 on PPC
+ _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*)
+ # 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'
+ ;;
+
+ 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
+ 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)
+ 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'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # 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*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ _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)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # 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)=''
+ ;;
+ 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*)
+ _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_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+
+#
+# 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])
+
+#
+# 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_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'
+ 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
+ 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")) && ([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*)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+ 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_flag_spec_ld, $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
+ if test "$with_gnu_ld" = 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
+ *\ [[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.9.1, 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 modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_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(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/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+ 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
+ ;;
+
+ 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)
+ 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
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # 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; $ECHO \"$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]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ 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; $ECHO \"$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*)
+ # 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)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_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 $compiler_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 $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'
+ 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 $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
+ ;;
+
+ 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 $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
+
+ 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
+ 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")) && ([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
+ _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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
+ _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'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _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.
+ _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 `$ECHO "X$deplibs" | $Xsed -e '\''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(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ 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
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $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 -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 -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
+ _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 -a "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${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_flag_spec_ld, $1)='+b $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 -a "$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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$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*)
+ _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'
+ ;;
+ *)
+ _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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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"
+ AC_LINK_IFELSE(int foo(void) {},
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ )
+ LDFLAGS="$save_LDFLAGS"
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $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_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _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*
+ AC_MSG_RESULT([$_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_flag_spec_ld], [1],
+ [[If ld is used when linking, 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([], [fix_srcfile_path], [1],
+ [Fix the shell variable $srcfile for the compiler])
+_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([], [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_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+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
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _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],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+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_flag_spec_ld, $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(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_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++"}
+ 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 -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -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 "\-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
+ _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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
+ _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'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _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*)
+ # _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(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
+ ;;
+ 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
+ ;;
+
+ freebsd[[12]]*)
+ # 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*)
+ ;;
+
+ 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; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ 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 -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -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)
+ 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; $ECHO "X$list" | $Xsed'
+
+ _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 | $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 | $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 | $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 will 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; $ECHO \"$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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ xl*)
+ # 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; $ECHO \"$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='echo'
+
+ # 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=echo
+ 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${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 "\-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*)
+ # 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='echo'
+
+ # 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 -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 -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 "\-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 "\-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(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
+ 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_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
+# 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
+])
+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 $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 "$_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
+ ;;
+
+ *.$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
+
+# 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*)
+ # 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_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _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_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_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_flag_spec_ld, $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(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
+ CC=${F77-"f77"}
+ 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"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _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_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_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_flag_spec_ld, $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(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
+ CC=${FC-"f95"}
+ 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"
+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_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+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
+
+## 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"
+])# _LT_LANG_GCJ_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_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+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"
+])# _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_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_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"}, \
+ = c,a/b,, \
+ && 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_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[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 "X${1}" | $Xsed -e "$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 "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# 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 "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "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 "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e '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
+])
diff --git a/package/cgilib/extra/m4/ltoptions.m4 b/package/cgilib/extra/m4/ltoptions.m4
new file mode 100644
index 000000000..34151a3ba
--- /dev/null
+++ b/package/cgilib/extra/m4/ltoptions.m4
@@ -0,0 +1,368 @@
+# Helper functions for option handling. -*- 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 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], [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/package/cgilib/extra/m4/ltsugar.m4 b/package/cgilib/extra/m4/ltsugar.m4
new file mode 100644
index 000000000..9000a057d
--- /dev/null
+++ b/package/cgilib/extra/m4/ltsugar.m4
@@ -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/package/cgilib/extra/m4/ltversion.m4 b/package/cgilib/extra/m4/ltversion.m4
new file mode 100644
index 000000000..b8e154fe6
--- /dev/null
+++ b/package/cgilib/extra/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/package/cgilib/extra/m4/lt~obsolete.m4 b/package/cgilib/extra/m4/lt~obsolete.m4
new file mode 100644
index 000000000..637bb2066
--- /dev/null
+++ b/package/cgilib/extra/m4/lt~obsolete.m4
@@ -0,0 +1,92 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
+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])])
diff --git a/package/cgilib/ipkg/cgilib.control b/package/cgilib/ipkg/cgilib.control
new file mode 100644
index 000000000..eeed8be3a
--- /dev/null
+++ b/package/cgilib/ipkg/cgilib.control
@@ -0,0 +1,7 @@
+Package: cgilib
+Priority: optional
+Section: libs
+Description: Simple CGI Library.
+ This library provides a simple programming API to the Common Gateway
+ Interface (CGI). It features HTTP Redirect, provides read access to
+ FORM variables, sets HTTP Cookies and reads them.
diff --git a/package/cgilib/patches/patch-INSTALL b/package/cgilib/patches/patch-INSTALL
new file mode 100644
index 000000000..e2ce1ee71
--- /dev/null
+++ b/package/cgilib/patches/patch-INSTALL
@@ -0,0 +1,277 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/INSTALL 2009-02-08 15:13:57.000000000 +0100
++++ cgilib-0.7/INSTALL 2009-05-09 03:58:09.000000000 +0200
+@@ -1,56 +1,236 @@
+ Installation Instructions
+-=========================
++*************************
+
+-The version control system does not contain all files required to
+-compile this project. This is intentional.
++Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
++Software Foundation, Inc.
+
+-These files will be added before releasing a new version of the
+-package outside of the version control system.
++This file is free documentation; the Free Software Foundation gives
++unlimited permission to copy, distribute and modify it.
+
+-Compiling from Source
+----------------------
++Basic Installation
++==================
+
+-To compile this package you'll have to execute the following two
+-commands:
++These are generic installation instructions.
+
+-./configure
+-make
++ The `configure' shell script attempts to guess correct values for
++various system-dependent variables used during compilation. It uses
++those values to create a `Makefile' in each directory of the package.
++It may also create one or more `.h' files containing system-dependent
++definitions. Finally, it creates a shell script `config.status' that
++you can run in the future to recreate the current configuration, and a
++file `config.log' containing compiler output (useful mainly for
++debugging `configure').
+
+-Compiling from CVS
+-------------------
++ It can also use an optional file (typically called `config.cache'
++and enabled with `--cache-file=config.cache' or simply `-C') that saves
++the results of its tests to speed up reconfiguring. (Caching is
++disabled by default to prevent problems with accidental use of stale
++cache files.)
+
+-Before you can compile this project you'll have to install the
+-following packages:
++ If you need to do unusual things to compile the package, please try
++to figure out how `configure' could check whether to do them, and mail
++diffs or instructions to the address given in the `README' so they can
++be considered for the next release. If you are using the cache, and at
++some point `config.cache' contains results you don't want to keep, you
++may remove or edit it.
+
+- . autoconf
+- . automake
+- . libtool
++ The file `configure.ac' (or `configure.in') is used to create
++`configure' by a program called `autoconf'. You only need
++`configure.ac' if you want to change it or regenerate `configure' using
++a newer version of `autoconf'.
+
+-Once installed you'll have to execute the following commands:
++The simplest way to compile this package is:
+
+-aclocal
+-autoconf
+-libtoolize --force
+-automake --add-missing --foreign
++ 1. `cd' to the directory containing the package's source code and type
++ `./configure' to configure the package for your system. If you're
++ using `csh' on an old version of System V, you might need to type
++ `sh ./configure' instead to prevent `csh' from trying to execute
++ `configure' itself.
+
+-Now ./configure is generated and needs to be executed.
++ Running `configure' takes awhile. While running, it prints some
++ messages telling which features it is checking for.
+
+-Preparing a release
+--------------------
++ 2. Type `make' to compile the package.
+
+-After the final commit, edit configure.ac and adjust the package version.
+-Run the following commands:
++ 3. Optionally, type `make check' to run any self-tests that come with
++ the package.
+
+-aclocal
+-autoconf
+-libtoolize --force --copy
+-automake --copy --add-missing --foreign
++ 4. Type `make install' to install the programs and any data files and
++ documentation.
+
+-Before building the final release tarball some files may be removed.
++ 5. You can remove the program binaries and object files from the
++ source code directory by typing `make clean'. To also remove the
++ files that `configure' created (so you can compile the package for
++ a different kind of computer), type `make distclean'. There is
++ also a `make maintainer-clean' target, but that is intended mainly
++ for the package's developers. If you use it, you may have to get
++ all sorts of other programs in order to regenerate files that came
++ with the distribution.
+
+-After a normal build run, execute:
++Compilers and Options
++=====================
+
+-make distclean
+-rm -rf autom4te.cache
+-rm -f aclocal.m4
++Some systems require unusual options for compilation or linking that the
++`configure' script does not know about. Run `./configure --help' for
++details on some of the pertinent environment variables.
++
++ You can give `configure' initial values for configuration parameters
++by setting variables in the command line or in the environment. Here
++is an example:
++
++ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
++
++ *Note Defining Variables::, for more details.
++
++Compiling For Multiple Architectures
++====================================
++
++You can compile the package for more than one kind of computer at the
++same time, by placing the object files for each architecture in their
++own directory. To do this, you must use a version of `make' that
++supports the `VPATH' variable, such as GNU `make'. `cd' to the
++directory where you want the object files and executables to go and run
++the `configure' script. `configure' automatically checks for the
++source code in the directory that `configure' is in and in `..'.
++
++ If you have to use a `make' that does not support the `VPATH'
++variable, you have to compile the package for one architecture at a
++time in the source code directory. After you have installed the
++package for one architecture, use `make distclean' before reconfiguring
++for another architecture.
++
++Installation Names
++==================
++
++By default, `make install' installs the package's commands under
++`/usr/local/bin', include files under `/usr/local/include', etc. You
++can specify an installation prefix other than `/usr/local' by giving
++`configure' the option `--prefix=PREFIX'.
++
++ You can specify separate installation prefixes for
++architecture-specific files and architecture-independent files. If you
++pass the option `--exec-prefix=PREFIX' to `configure', the package uses
++PREFIX as the prefix for installing programs and libraries.
++Documentation and other data files still use the regular prefix.
++
++ In addition, if you use an unusual directory layout you can give
++options like `--bindir=DIR' to specify different values for particular
++kinds of files. Run `configure --help' for a list of the directories
++you can set and what kinds of files go in them.
++
++ If the package supports it, you can cause programs to be installed
++with an extra prefix or suffix on their names by giving `configure' the
++option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
++
++Optional Features
++=================
++
++Some packages pay attention to `--enable-FEATURE' options to
++`configure', where FEATURE indicates an optional part of the package.
++They may also pay attention to `--with-PACKAGE' options, where PACKAGE
++is something like `gnu-as' or `x' (for the X Window System). The
++`README' should mention any `--enable-' and `--with-' options that the
++package recognizes.
++
++ For packages that use the X Window System, `configure' can usually
++find the X include and library files automatically, but if it doesn't,
++you can use the `configure' options `--x-includes=DIR' and
++`--x-libraries=DIR' to specify their locations.
++
++Specifying the System Type
++==========================
++
++There may be some features `configure' cannot figure out automatically,
++but needs to determine by the type of machine the package will run on.
++Usually, assuming the package is built to be run on the _same_
++architectures, `configure' can figure that out, but if it prints a
++message saying it cannot guess the machine type, give it the
++`--build=TYPE' option. TYPE can either be a short name for the system
++type, such as `sun4', or a canonical name which has the form:
++
++ CPU-COMPANY-SYSTEM
++
++where SYSTEM can have one of these forms:
++
++ OS KERNEL-OS
++
++ See the file `config.sub' for the possible values of each field. If
++`config.sub' isn't included in this package, then this package doesn't
++need to know the machine type.
++
++ If you are _building_ compiler tools for cross-compiling, you should
++use the option `--target=TYPE' to select the type of system they will
++produce code for.
++
++ If you want to _use_ a cross compiler, that generates code for a
++platform different from the build platform, you should specify the
++"host" platform (i.e., that on which the generated programs will
++eventually be run) with `--host=TYPE'.
++
++Sharing Defaults
++================
++
++If you want to set default values for `configure' scripts to share, you
++can create a site shell script called `config.site' that gives default
++values for variables like `CC', `cache_file', and `prefix'.
++`configure' looks for `PREFIX/share/config.site' if it exists, then
++`PREFIX/etc/config.site' if it exists. Or, you can set the
++`CONFIG_SITE' environment variable to the location of the site script.
++A warning: not all `configure' scripts look for a site script.
++
++Defining Variables
++==================
++
++Variables not defined in a site shell script can be set in the
++environment passed to `configure'. However, some packages may run
++configure again during the build, and the customized values of these
++variables may be lost. In order to avoid this problem, you should set
++them in the `configure' command line, using `VAR=value'. For example:
++
++ ./configure CC=/usr/local2/bin/gcc
++
++causes the specified `gcc' to be used as the C compiler (unless it is
++overridden in the site shell script). Here is a another example:
++
++ /bin/bash ./configure CONFIG_SHELL=/bin/bash
++
++Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
++configuration-related scripts to be executed by `/bin/bash'.
++
++`configure' Invocation
++======================
++
++`configure' recognizes the following options to control how it operates.
++
++`--help'
++`-h'
++ Print a summary of the options to `configure', and exit.
++
++`--version'
++`-V'
++ Print the version of Autoconf used to generate the `configure'
++ script, and exit.
++
++`--cache-file=FILE'
++ Enable the cache: use and save the results of the tests in FILE,
++ traditionally `config.cache'. FILE defaults to `/dev/null' to
++ disable caching.
++
++`--config-cache'
++`-C'
++ Alias for `--cache-file=config.cache'.
++
++`--quiet'
++`--silent'
++`-q'
++ Do not print messages saying which checks are being made. To
++ suppress all normal output, redirect it to `/dev/null' (any error
++ messages will still be shown).
++
++`--srcdir=DIR'
++ Look for the package's source code in directory DIR. Usually
++ `configure' can determine that directory automatically.
++
++`configure' also accepts some other, not widely useful, options. Run
++`configure --help' for more details.
+
diff --git a/package/cgilib/patches/patch-Makefile_in b/package/cgilib/patches/patch-Makefile_in
new file mode 100644
index 000000000..540cf21a6
--- /dev/null
+++ b/package/cgilib/patches/patch-Makefile_in
@@ -0,0 +1,491 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/Makefile.in 2009-02-08 19:47:04.000000000 +0100
++++ cgilib-0.7/Makefile.in 2009-05-09 04:01:39.000000000 +0200
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.10.1 from Makefile.am.
++# Makefile.in generated by automake 1.9.6 from Makefile.am.
+ # @configure_input@
+
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++# 2003, 2004, 2005 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.
+@@ -32,11 +32,15 @@
+
+
+
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
+ VPATH = @srcdir@
+ pkgdatadir = $(datadir)/@PACKAGE@
+ pkglibdir = $(libdir)/@PACKAGE@
+ pkgincludedir = $(includedir)/@PACKAGE@
++top_builddir = .
+ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++INSTALL = @INSTALL@
+ install_sh_DATA = $(install_sh) -c -m 644
+ install_sh_PROGRAM = $(install_sh) -c
+ install_sh_SCRIPT = $(install_sh) -c
+@@ -51,17 +55,17 @@ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+ bin_PROGRAMS = cgitest$(EXEEXT) jumpto$(EXEEXT)
+-subdir = .
+ DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+- $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \
++ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+ config.guess config.sub depcomp install-sh ltmain.sh missing
++subdir = .
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(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
++ configure.lineno configure.status.lineno
+ mkinstalldirs = $(install_sh) -d
+ CONFIG_CLEAN_FILES =
+ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+@@ -78,9 +82,6 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
+ libcgi_la_LIBADD =
+ am_libcgi_la_OBJECTS = cgi.lo cookies.lo aux.lo
+ libcgi_la_OBJECTS = $(am_libcgi_la_OBJECTS)
+-libcgi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+- $(libcgi_la_LDFLAGS) $(LDFLAGS) -o $@
+ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+ PROGRAMS = $(bin_PROGRAMS)
+ am_cgitest_OBJECTS = cgitest.$(OBJEXT)
+@@ -89,18 +90,17 @@ cgitest_DEPENDENCIES = libcgi.la
+ am_jumpto_OBJECTS = cgitest.$(OBJEXT)
+ jumpto_OBJECTS = $(am_jumpto_OBJECTS)
+ jumpto_DEPENDENCIES = libcgi.la
+-DEFAULT_INCLUDES = -I.@am__isrc@
++DEFAULT_INCLUDES = -I. -I$(srcdir)
+ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ 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) --tag=CC --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 $@
++LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
++ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ SOURCES = $(libcgi_la_SOURCES) $(cgitest_SOURCES) $(jumpto_SOURCES)
+ DIST_SOURCES = $(libcgi_la_SOURCES) $(cgitest_SOURCES) \
+ $(jumpto_SOURCES)
+@@ -124,6 +124,8 @@ GZIP_ENV = --best
+ distuninstallcheck_listfiles = find . -type f -print
+ distcleancheck_listfiles = find . -type f -print
+ ACLOCAL = @ACLOCAL@
++AMDEP_FALSE = @AMDEP_FALSE@
++AMDEP_TRUE = @AMDEP_TRUE@
+ AMTAR = @AMTAR@
+ AR = @AR@
+ AUTOCONF = @AUTOCONF@
+@@ -152,7 +154,6 @@ EXEEXT = @EXEEXT@
+ F77 = @F77@
+ FFLAGS = @FFLAGS@
+ GREP = @GREP@
+-INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+@@ -164,7 +165,6 @@ LIBTOOL = @LIBTOOL@
+ LN_S = @LN_S@
+ LTLIBOBJS = @LTLIBOBJS@
+ MAKEINFO = @MAKEINFO@
+-MKDIR_P = @MKDIR_P@
+ NMEDIT = @NMEDIT@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+@@ -181,13 +181,13 @@ SHELL = @SHELL@
+ SO_VERSION = @SO_VERSION@
+ 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_CXX = @ac_ct_CXX@
+ ac_ct_F77 = @ac_ct_F77@
++am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
++am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
++am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
++am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+ am__include = @am__include@
+ am__leading_dot = @am__leading_dot@
+ am__quote = @am__quote@
+@@ -199,7 +199,6 @@ build_alias = @build_alias@
+ build_cpu = @build_cpu@
+ build_os = @build_os@
+ build_vendor = @build_vendor@
+-builddir = @builddir@
+ datadir = @datadir@
+ datarootdir = @datarootdir@
+ docdir = @docdir@
+@@ -227,11 +226,8 @@ program_transform_name = @program_transf
+ psdir = @psdir@
+ sbindir = @sbindir@
+ sharedstatedir = @sharedstatedir@
+-srcdir = @srcdir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+-top_builddir = @top_builddir@
+-top_srcdir = @top_srcdir@
+ lib_LTLIBRARIES = libcgi.la
+ libcgi_la_SOURCES = cgi.c cookies.c aux.c
+ libcgi_la_LDFLAGS = -version-info @SO_VERSION@
+@@ -245,56 +241,23 @@ all: all-am
+
+ .SUFFIXES:
+ .SUFFIXES: .c .lo .o .obj
+-am--refresh:
+- @:
+-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+- @for dep in $?; do \
+- case '$(am__configure_deps)' in \
+- *$$dep*) \
+- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+- cd $(srcdir) && $(AUTOMAKE) --foreign \
+- && exit 0; \
+- exit 1;; \
+- esac; \
+- done; \
+- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+- 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: $(am__configure_deps)
+- cd $(srcdir) && $(AUTOCONF)
+-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+- cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+- test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
++ test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
++ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
++ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ else :; fi; \
+ done
+
+ uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
++ @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
++ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
++ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ done
+
+ clean-libLTLIBRARIES:
+@@ -306,18 +269,18 @@ clean-libLTLIBRARIES:
+ rm -f "$${dir}/so_locations"; \
+ done
+ libcgi.la: $(libcgi_la_OBJECTS) $(libcgi_la_DEPENDENCIES)
+- $(libcgi_la_LINK) -rpath $(libdir) $(libcgi_la_OBJECTS) $(libcgi_la_LIBADD) $(LIBS)
++ $(LINK) -rpath $(libdir) $(libcgi_la_LDFLAGS) $(libcgi_la_OBJECTS) $(libcgi_la_LIBADD) $(LIBS)
+ install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
++ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
++ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
++ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+@@ -337,10 +300,10 @@ clean-binPROGRAMS:
+ done
+ cgitest$(EXEEXT): $(cgitest_OBJECTS) $(cgitest_DEPENDENCIES)
+ @rm -f cgitest$(EXEEXT)
+- $(LINK) $(cgitest_OBJECTS) $(cgitest_LDADD) $(LIBS)
++ $(LINK) $(cgitest_LDFLAGS) $(cgitest_OBJECTS) $(cgitest_LDADD) $(LIBS)
+ jumpto$(EXEEXT): $(jumpto_OBJECTS) $(jumpto_DEPENDENCIES)
+ @rm -f jumpto$(EXEEXT)
+- $(LINK) $(jumpto_OBJECTS) $(jumpto_LDADD) $(LIBS)
++ $(LINK) $(jumpto_LDFLAGS) $(jumpto_OBJECTS) $(jumpto_LDADD) $(LIBS)
+
+ mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+@@ -354,22 +317,22 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cookies.Plo@am__quote@
+
+ .c.o:
+-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
++@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ @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@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
++@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ @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@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
++@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ @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 $@ $<
+@@ -382,9 +345,10 @@ clean-libtool:
+
+ distclean-libtool:
+ -rm -f libtool
++uninstall-info-am:
+ install-man3: $(man3_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+- test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)"
++ test -z "$(man3dir)" || $(mkdir_p) "$(DESTDIR)$(man3dir)"
+ @list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+@@ -429,7 +393,7 @@ uninstall-man3:
+ done
+ install-man5: $(man5_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+- test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)"
++ test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)"
+ @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+@@ -474,7 +438,7 @@ uninstall-man5:
+ done
+ install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+- test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
++ test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+@@ -495,8 +459,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+- END { if (nonempty) { for (i in files) print i; }; }'`; \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+ tags: TAGS
+
+@@ -508,8 +472,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP
+ 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; }; }'`; \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+@@ -519,12 +483,13 @@ ctags: CTAGS
+ CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
++ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+- END { if (nonempty) { for (i in files) print i; }; }'`; \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+@@ -539,22 +504,23 @@ distclean-tags:
+
+ distdir: $(DISTFILES)
+ $(am__remove_distdir)
+- test -d $(distdir) || mkdir $(distdir)
+- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+- list='$(DISTFILES)'; \
+- dist_files=`for file in $$list; do echo $$file; done | \
+- sed -e "s|^$$srcdirstrip/||;t" \
+- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+- case $$dist_files in \
+- */*) $(MKDIR_P) `echo "$$dist_files" | \
+- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+- sort -u` ;; \
+- esac; \
+- for file in $$dist_files; do \
++ mkdir $(distdir)
++ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
++ list='$(DISTFILES)'; for file in $$list; do \
++ case $$file in \
++ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
++ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
++ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
++ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
++ dir="/$$dir"; \
++ $(mkdir_p) "$(distdir)$$dir"; \
++ else \
++ dir=''; \
++ fi; \
+ if test -d $$d/$$file; then \
+- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+@@ -568,7 +534,7 @@ distdir: $(DISTFILES)
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
++ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+ dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+@@ -578,10 +544,6 @@ dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+-dist-lzma: distdir
+- tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+- $(am__remove_distdir)
+-
+ dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+@@ -608,8 +570,6 @@ distcheck: dist
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+- *.tar.lzma*) \
+- unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+@@ -649,7 +609,7 @@ distcheck: dist
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
++ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+ distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+@@ -675,7 +635,7 @@ install-binPROGRAMS: install-libLTLIBRAR
+
+ installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(includedir)"; do \
+- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
++ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+ install: install-am
+ install-exec: install-exec-am
+@@ -725,20 +685,12 @@ info-am:
+
+ install-data-am: install-includeHEADERS install-man
+
+-install-dvi: install-dvi-am
+-
+ install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
+
+-install-html: install-html-am
+-
+ install-info: install-info-am
+
+ install-man: install-man3 install-man5
+
+-install-pdf: install-pdf-am
+-
+-install-ps: install-ps-am
+-
+ installcheck-am:
+
+ maintainer-clean: maintainer-clean-am
+@@ -762,31 +714,28 @@ ps: ps-am
+ ps-am:
+
+ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
+- uninstall-libLTLIBRARIES uninstall-man
++ uninstall-info-am uninstall-libLTLIBRARIES uninstall-man
+
+ uninstall-man: uninstall-man3 uninstall-man5
+
+-.MAKE: install-am install-strip
+-
+ .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
+ clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \
+- dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
++ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+- install-binPROGRAMS install-data install-data-am install-dvi \
+- install-dvi-am install-exec install-exec-am install-html \
+- install-html-am install-includeHEADERS install-info \
++ install-binPROGRAMS install-data install-data-am install-exec \
++ install-exec-am install-includeHEADERS install-info \
+ install-info-am install-libLTLIBRARIES install-man \
+- install-man3 install-man5 install-pdf install-pdf-am \
+- install-ps install-ps-am install-strip installcheck \
++ install-man3 install-man5 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 uninstall-am uninstall-binPROGRAMS \
+- uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+- uninstall-man uninstall-man3 uninstall-man5
++ uninstall-includeHEADERS uninstall-info-am \
++ uninstall-libLTLIBRARIES uninstall-man uninstall-man3 \
++ uninstall-man5
+
+ # 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.
diff --git a/package/cgilib/patches/patch-cgi_c b/package/cgilib/patches/patch-cgi_c
new file mode 100644
index 000000000..0e4052688
--- /dev/null
+++ b/package/cgilib/patches/patch-cgi_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/cgi.c 2009-01-11 22:59:16.000000000 +0100
++++ cgilib-0.7/cgi.c 2009-03-31 19:16:46.214155324 +0200
+@@ -327,7 +327,7 @@ s_cgi *cgiReadMultipart (char *boundary)
+ file->name = name;
+ file->type = type;
+ file->tmpfile = tmpfile;
+- if ((cp = rindex (fname, '/')) == NULL)
++ if ((cp = strrchr (fname, '/')) == NULL)
+ file->filename = fname;
+ else {
+ file->filename = strdup (++cp);
diff --git a/package/cgilib/patches/patch-configure b/package/cgilib/patches/patch-configure
new file mode 100644
index 000000000..3a682731e
--- /dev/null
+++ b/package/cgilib/patches/patch-configure
@@ -0,0 +1,8132 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/configure 2009-02-08 19:47:03.000000000 +0100
++++ cgilib-0.7/configure 2009-05-09 03:58:09.000000000 +0200
+@@ -1,9 +1,9 @@
+ #! /bin/sh
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated by GNU Autoconf 2.61.
++# Generated by GNU Autoconf 2.62.
+ #
+ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
++# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
+ ## --------------------- ##
+@@ -15,7 +15,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # 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
+@@ -37,17 +37,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
+ as_cr_digits='0123456789'
+ as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+-# The user is always right.
+-if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
+- echo "exit 0" >>conf$$.sh
+- chmod +x conf$$.sh
+- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+- PATH_SEPARATOR=';'
++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
++if (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
+- PATH_SEPARATOR=:
++ 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
+- rm -f conf$$.sh
++ 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
+
+ # Support unset when possible.
+@@ -63,8 +91,6 @@ fi
+ # 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.)
+-as_nl='
+-'
+ IFS=" "" $as_nl"
+
+ # Find who we are. Look in the path if we contain no directory separator.
+@@ -87,7 +113,7 @@ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+ fi
+
+@@ -100,17 +126,10 @@ PS2='> '
+ PS4='+ '
+
+ # NLS nuisances.
+-for as_var in \
+- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+- LC_TELEPHONE LC_TIME
+-do
+- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+- eval $as_var=C; export $as_var
+- else
+- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+- fi
+-done
++LC_ALL=C
++export LC_ALL
++LANGUAGE=C
++export LANGUAGE
+
+ # Required to use basename.
+ if expr a : '\(a\)' >/dev/null 2>&1 &&
+@@ -132,7 +151,7 @@ as_me=`$as_basename -- "$0" ||
+ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+-echo X/"$0" |
++$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+@@ -158,7 +177,7 @@ else
+ as_have_required=no
+ fi
+
+- if test $as_have_required = yes && (eval ":
++ if test $as_have_required = yes && (eval ":
+ (as_func_return () {
+ (exit \$1)
+ }
+@@ -240,7 +259,7 @@ IFS=$as_save_IFS
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # 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
+@@ -261,7 +280,7 @@ _ASEOF
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # 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
+@@ -341,10 +360,10 @@ fi
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+- done
+- export CONFIG_SHELL
+- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
++ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
++ done
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+ fi
+
+
+@@ -413,9 +432,10 @@ fi
+
+ test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+- echo Please tell autoconf@gnu.org about your system,
+- echo including any error possibly output before this
+- echo message
++ echo Please tell bug-autoconf@gnu.org about your system,
++ echo including any error possibly output before this message.
++ echo This can help us improve future autoconf versions.
++ echo Configuration will now proceed without shell functions.
+ }
+
+
+@@ -451,7 +471,7 @@ test \$exitcode = 0") || {
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+@@ -479,7 +499,6 @@ case `echo -n x` in
+ *)
+ ECHO_N='-n';;
+ esac
+-
+ if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+@@ -492,19 +511,22 @@ if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+ else
+ rm -f conf$$.dir
+- mkdir conf$$.dir
++ mkdir conf$$.dir 2>/dev/null
+ fi
+-echo >conf$$.file
+-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 ||
++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'
+-elif ln conf$$.file conf$$ 2>/dev/null; then
+- as_ln_s=ln
++ fi
+ else
+ as_ln_s='cp -p'
+ fi
+@@ -529,10 +551,10 @@ else
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+- test -d "$1/.";
++ test -d "$1/.";
+ else
+ case $1 in
+- -*)set "./$1";;
++ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+@@ -807,7 +829,6 @@ target_alias
+ INSTALL_PROGRAM
+ INSTALL_SCRIPT
+ INSTALL_DATA
+-am__isrc
+ CYGPATH_W
+ PACKAGE
+ VERSION
+@@ -875,6 +896,17 @@ SO_VERSION
+ LIBOBJS
+ LTLIBOBJS'
+ ac_subst_files=''
++ac_user_opts='
++enable_option_checking
++enable_dependency_tracking
++enable_shared
++enable_static
++enable_fast_install
++with_gnu_ld
++enable_libtool_lock
++with_pic
++with_tags
++'
+ ac_precious_vars='build_alias
+ host_alias
+ target_alias
+@@ -895,6 +927,8 @@ FFLAGS'
+ # 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
+@@ -993,13 +1027,21 @@ do
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+- eval enable_$ac_feature=no ;;
++ 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 ;;
+@@ -1012,13 +1054,21 @@ do
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+- eval enable_$ac_feature=\$ac_optarg ;;
++ 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- \
+@@ -1209,22 +1259,38 @@ do
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid package name: $ac_package" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+- eval with_$ac_package=\$ac_optarg ;;
++ 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_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
++ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid package name: $ac_package" >&2
++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
++ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+- eval with_$ac_package=no ;;
++ 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.
+@@ -1244,7 +1310,7 @@ do
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+- -*) { echo "$as_me: error: unrecognized option: $ac_option
++ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+ Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+@@ -1253,16 +1319,16 @@ Try \`$0 --help' for more information."
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
++ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
++ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
++ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+@@ -1271,22 +1337,38 @@ done
+
+ if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+- { echo "$as_me: error: missing argument to $ac_option" >&2
++ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+ fi
+
+-# Be sure to have absolute directory names.
++if test -n "$ac_unrecognized_opts"; then
++ case $enable_option_checking in
++ no) ;;
++ fatal) { $as_echo "$as_me: error: Unrecognized options: $ac_unrecognized_opts" >&2
++ { (exit 1); exit 1; }; } ;;
++ *) $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
+- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+ done
+
+@@ -1301,7 +1383,7 @@ target=$target_alias
+ if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
++ $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
+@@ -1317,10 +1399,10 @@ 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 .` ||
+- { echo "$as_me: error: Working directory cannot be determined" >&2
++ { $as_echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+ test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+- { echo "$as_me: error: pwd does not report name of working directory" >&2
++ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+@@ -1328,12 +1410,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+- ac_confdir=`$as_dirname -- "$0" ||
+-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$0" : 'X\(//\)[^/]' \| \
+- X"$0" : 'X\(//\)$' \| \
+- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+-echo X"$0" |
++ 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
+@@ -1360,12 +1442,12 @@ else
+ fi
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
++ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ ac_abs_confdir=`(
+- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
++ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+ # When building in place, set srcdir=.
+@@ -1414,9 +1496,9 @@ Configuration:
+
+ Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+- [$ac_default_prefix]
++ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+- [PREFIX]
++ [PREFIX]
+
+ By default, \`make install' will install all the files in
+ \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+@@ -1426,25 +1508,25 @@ 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/PACKAGE]
+- --htmldir=DIR html documentation [DOCDIR]
+- --dvidir=DIR dvi documentation [DOCDIR]
+- --pdfdir=DIR pdf documentation [DOCDIR]
+- --psdir=DIR ps documentation [DOCDIR]
++ --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/PACKAGE]
++ --htmldir=DIR html documentation [DOCDIR]
++ --dvidir=DIR dvi documentation [DOCDIR]
++ --pdfdir=DIR pdf documentation [DOCDIR]
++ --psdir=DIR ps documentation [DOCDIR]
+ _ACEOF
+
+ cat <<\_ACEOF
+@@ -1465,6 +1547,7 @@ if test -n "$ac_init_help"; then
+ 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]
+ --disable-dependency-tracking speeds up one-time build
+@@ -1508,15 +1591,17 @@ 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" || 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=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
++ 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/ ;;
+@@ -1552,7 +1637,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
++ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+@@ -1562,10 +1647,10 @@ test -n "$ac_init_help" && exit $ac_stat
+ if $ac_init_version; then
+ cat <<\_ACEOF
+ configure
+-generated by GNU Autoconf 2.61
++generated by GNU Autoconf 2.62
+
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
++2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ This configure script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it.
+ _ACEOF
+@@ -1576,7 +1661,7 @@ This file contains any messages produced
+ running configure, to aid debugging if configure makes a mistake.
+
+ It was created by $as_me, which was
+-generated by GNU Autoconf 2.61. Invocation command line was
++generated by GNU Autoconf 2.62. Invocation command line was
+
+ $ $0 $@
+
+@@ -1612,7 +1697,7 @@ for as_dir in $PATH
+ do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+- echo "PATH: $as_dir"
++ $as_echo "PATH: $as_dir"
+ done
+ IFS=$as_save_IFS
+
+@@ -1647,7 +1732,7 @@ do
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+@@ -1699,11 +1784,12 @@ _ASBOX
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
++ *_cv_*) { $as_echo "$as_me:$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= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+@@ -1733,9 +1819,9 @@ _ASBOX
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
++ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+- echo "$ac_var='\''$ac_val'\''"
++ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+@@ -1750,9 +1836,9 @@ _ASBOX
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
++ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+- echo "$ac_var='\''$ac_val'\''"
++ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+@@ -1768,8 +1854,8 @@ _ASBOX
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+- echo "$as_me: caught signal $ac_signal"
+- echo "$as_me: exit $exit_status"
++ $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 &&
+@@ -1811,21 +1897,24 @@ _ACEOF
+
+
+ # Let the site file select an alternate cache file if it wants to.
+-# Prefer explicitly selected file to automatically selected ones.
++# Prefer an explicitly selected file to automatically selected ones.
++ac_site_file1=NONE
++ac_site_file2=NONE
+ if test -n "$CONFIG_SITE"; then
+- set x "$CONFIG_SITE"
++ ac_site_file1=$CONFIG_SITE
+ elif test "x$prefix" != xNONE; then
+- set x "$prefix/share/config.site" "$prefix/etc/config.site"
++ ac_site_file1=$prefix/share/config.site
++ ac_site_file2=$prefix/etc/config.site
+ else
+- set x "$ac_default_prefix/share/config.site" \
+- "$ac_default_prefix/etc/config.site"
++ ac_site_file1=$ac_default_prefix/share/config.site
++ ac_site_file2=$ac_default_prefix/etc/config.site
+ fi
+-shift
+-for ac_site_file
++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
+- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+-echo "$as_me: loading site script $ac_site_file" >&6;}
++ { $as_echo "$as_me:$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
+@@ -1835,16 +1924,16 @@ 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
+- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+-echo "$as_me: loading cache $cache_file" >&6;}
++ { $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+-echo "$as_me: creating cache $cache_file" >&6;}
++ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
++$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+ fi
+
+@@ -1858,29 +1947,38 @@ for ac_var in $ac_precious_vars; do
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
++ { $as_echo "$as_me:$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)
+- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
++ { $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+-echo "$as_me: former value: $ac_old_val" >&2;}
+- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+-echo "$as_me: current value: $ac_new_val" >&2;}
+- ac_cache_corrupted=:
++ # 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:$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:$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:$LINENO: former value: \`$ac_old_val'" >&5
++$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
++ { $as_echo "$as_me:$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=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
++ *\'*) 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
+@@ -1890,10 +1988,10 @@ echo "$as_me: current value: $ac_new_v
+ fi
+ done
+ if $ac_cache_corrupted; then
+- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
++ { $as_echo "$as_me:$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_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
++$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+@@ -1921,8 +2019,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+-am__api_version='1.10'
+-
++am__api_version="1.9"
+ ac_aux_dir=
+ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+@@ -1940,8 +2037,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$s
+ fi
+ done
+ if test -z "$ac_aux_dir"; then
+- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
++$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+@@ -1967,11 +2064,12 @@ ac_configure="$SHELL $ac_aux_dir/configu
+ # 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.
+-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
++# Reject install programs that cannot install multiple files.
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for as_dir in $PATH
+@@ -2000,17 +2098,29 @@ case $as_dir/ in
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+- break 3
++ 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
+@@ -2023,8 +2133,8 @@ fi
+ INSTALL=$ac_install_sh
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+-echo "${ECHO_T}$INSTALL" >&6; }
++{ $as_echo "$as_me:$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.
+@@ -2034,8 +2144,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR
+
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+@@ -2058,9 +2168,9 @@ if (
+ # 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".
+- { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
++ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" >&5
+-echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
++$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+@@ -2071,26 +2181,23 @@ then
+ # Ok.
+ :
+ else
+- { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
++ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+ Check your system clock" >&5
+-echo "$as_me: error: newly created file is older than distributed files!
++$as_echo "$as_me: error: newly created file is older than distributed files!
+ Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+-{ echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
++{ $as_echo "$as_me:$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 $. echo might interpret backslashes.
++# Double any \ or $.
+ # By default was `s,x,x', remove it if useless.
+-cat <<\_ACEOF >conftest.sed
+-s/[\\$]/&&/g;s/;s,x,x,$//
+-_ACEOF
+-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+-rm -f conftest.sed
++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`
+@@ -2101,66 +2208,51 @@ if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+ else
+ am_missing_run=
+- { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
++$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+ fi
+
+-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+-if test -z "$MKDIR_P"; then
+- if test "${ac_cv_path_mkdir+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++ # We used to keeping the `.' as first argument, in order to
++ # allow $(mkdir_p) to be used without argument. As in
++ # $(mkdir_p) $(somedir)
++ # where $(somedir) is conditionally defined. However this is wrong
++ # for two reasons:
++ # 1. if the package is installed by a user who cannot write `.'
++ # make install will fail,
++ # 2. the above comment should most certainly read
++ # $(mkdir_p) $(DESTDIR)$(somedir)
++ # so it does not work when $(somedir) is undefined and
++ # $(DESTDIR) is not.
++ # To support the latter case, we have to write
++ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
++ # so the `.' trick is pointless.
++ mkdir_p='mkdir -p --'
+ 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"
++ # On NextStep and OpenStep, the `mkdir' command does not
++ # recognize any option. It will interpret all options as
++ # directories to create, and then abort because `.' already
++ # exists.
++ for d in ./-p ./--version;
++ do
++ test -d $d && rmdir $d
++ done
++ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
++ if test -f "$ac_aux_dir/mkinstalldirs"; then
++ mkdir_p='$(mkinstalldirs)'
+ 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"
++ mkdir_p='$(install_sh) -d'
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+-echo "${ECHO_T}$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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AWK+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+@@ -2173,7 +2265,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2184,22 +2276,23 @@ fi
+ fi
+ AWK=$ac_cv_prog_AWK
+ if test -n "$AWK"; then
+- { echo "$as_me:$LINENO: result: $AWK" >&5
+-echo "${ECHO_T}$AWK" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
++$as_echo "$AWK" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+ test -n "$AWK" && break
+ done
+
+-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.make <<\_ACEOF
+ SHELL = /bin/sh
+@@ -2216,12 +2309,12 @@ esac
+ rm -f conftest.make
+ fi
+ if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
++ { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+ SET_MAKE=
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+ fi
+
+@@ -2234,16 +2327,12 @@ else
+ 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
+- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
++# test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" &&
++ test -f $srcdir/config.status; then
++ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
++$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+- fi
+ fi
+
+ # test whether we have cygpath
+@@ -2286,7 +2375,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_ru
+
+ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
++install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+ # Installed binaries are usually stripped using `strip' when the user
+ # run `make install-strip'. However `strip' might not be the right
+@@ -2296,10 +2385,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_STRIP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+@@ -2312,7 +2401,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2323,11 +2412,11 @@ fi
+ fi
+ STRIP=$ac_cv_prog_STRIP
+ if test -n "$STRIP"; then
+- { echo "$as_me:$LINENO: result: $STRIP" >&5
+-echo "${ECHO_T}$STRIP" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
++$as_echo "$STRIP" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -2336,10 +2425,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -2352,7 +2441,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2363,11 +2452,11 @@ fi
+ fi
+ ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+ if test -n "$ac_ct_STRIP"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++$as_echo "$ac_ct_STRIP" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ if test "x$ac_ct_STRIP" = x; then
+@@ -2375,10 +2464,10 @@ fi
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -2390,7 +2479,7 @@ else
+ fi
+
+ fi
+-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
++INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+ # We need awk for the "check" target. The system "awk" is bad on
+ # some platforms.
+@@ -2414,10 +2503,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -2430,7 +2519,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2441,11 +2530,11 @@ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- { echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -2454,10 +2543,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -2470,7 +2559,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2481,11 +2570,11 @@ fi
+ fi
+ ac_ct_CC=$ac_cv_prog_ac_ct_CC
+ if test -n "$ac_ct_CC"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+-echo "${ECHO_T}$ac_ct_CC" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++$as_echo "$ac_ct_CC" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ if test "x$ac_ct_CC" = x; then
+@@ -2493,10 +2582,10 @@ fi
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -2511,10 +2600,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -2527,7 +2616,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2538,11 +2627,11 @@ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- { echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -2551,10 +2640,10 @@ fi
+ if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -2572,7 +2661,7 @@ do
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2595,11 +2684,11 @@ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- { echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -2610,10 +2699,10 @@ if test -z "$CC"; then
+ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CC+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+@@ -2626,7 +2715,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2637,11 +2726,11 @@ fi
+ fi
+ CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- { echo "$as_me:$LINENO: result: $CC" >&5
+-echo "${ECHO_T}$CC" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $CC" >&5
++$as_echo "$CC" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -2654,10 +2743,10 @@ if test -z "$CC"; then
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -2670,7 +2759,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -2681,11 +2770,11 @@ fi
+ fi
+ ac_ct_CC=$ac_cv_prog_ac_ct_CC
+ if test -n "$ac_ct_CC"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+-echo "${ECHO_T}$ac_ct_CC" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++$as_echo "$ac_ct_CC" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -2697,10 +2786,10 @@ done
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -2712,44 +2801,48 @@ fi
+ fi
+
+
+-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
++test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: no acceptable C compiler found in \$PATH
++$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+ See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Provide some information about the compiler.
+-echo "$as_me:$LINENO: checking for C compiler version" >&5
+-ac_compiler=`set X $ac_compile; echo $2`
++$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
++set X $ac_compile
++ac_compiler=$2
+ { (ac_try="$ac_compiler --version >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { (ac_try="$ac_compiler -v >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { (ac_try="$ac_compiler -V >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -2768,27 +2861,22 @@ main ()
+ }
+ _ACEOF
+ ac_clean_files_save=$ac_clean_files
+-ac_clean_files="$ac_clean_files a.out a.exe b.out"
++ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.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.
+-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+-#
+-# List of possible output files, starting from the most likely.
+-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+-# only as a last resort. b.out is created by i960 compilers.
+-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+-#
+-# The IRIX 6 linker writes into existing files which may not be
+-# executable, retaining their permissions. Remove them first so a
+-# subsequent execution test works.
++{ $as_echo "$as_me:$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 | *.o | *.obj ) ;;
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+ done
+@@ -2799,10 +2887,11 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; 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'
+@@ -2813,7 +2902,7 @@ 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 | *.o | *.obj )
++ *.$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
+@@ -2840,15 +2929,15 @@ else
+ ac_file=''
+ fi
+
+-{ echo "$as_me:$LINENO: result: $ac_file" >&5
+-echo "${ECHO_T}$ac_file" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
++$as_echo "$ac_file" >&6; }
+ if test -z "$ac_file"; then
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
++{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: C compiler cannot create executables
++$as_echo "$as_me: error: C compiler cannot create executables
+ See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ fi
+@@ -2857,8 +2946,8 @@ 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.
+-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
++$as_echo_n "checking whether the C compiler works... " >&6; }
+ # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+ # If not cross compiling, check that we can run a simple program.
+ if test "$cross_compiling" != yes; then
+@@ -2867,49 +2956,51 @@ if test "$cross_compiling" != yes; then
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
++ { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+ If you meant to cross compile, use \`--host'.
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run C compiled programs.
++$as_echo "$as_me: error: cannot run C compiled programs.
+ If you meant to cross compile, use \`--host'.
+ See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
++{ $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+
+-rm -f a.out a.exe conftest$ac_cv_exeext b.out
++rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.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.
+-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+-echo "${ECHO_T}$cross_compiling" >&6; }
++{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
++$as_echo_n "checking whether we are cross compiling... " >&6; }
++{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
++$as_echo "$cross_compiling" >&6; }
+
+-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+ # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+@@ -2918,31 +3009,31 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
+ 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 | *.o | *.obj ) ;;
++ *.$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
+- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
++ { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
++$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+ See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ rm -f conftest$ac_cv_exeext
+-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+-echo "${ECHO_T}$ac_cv_exeext" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
++$as_echo "$ac_cv_exeext" >&6; }
+
+ rm -f conftest.$ac_ext
+ EXEEXT=$ac_cv_exeext
+ ac_exeext=$EXEEXT
+-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -2965,40 +3056,41 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; 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 ) ;;
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+ done
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
++{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot compute suffix of object files: cannot compile
++$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+ See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ rm -f conftest.$ac_cv_objext conftest.$ac_ext
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+-echo "${ECHO_T}$ac_cv_objext" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
++$as_echo "$ac_cv_objext" >&6; }
+ OBJEXT=$ac_cv_objext
+ ac_objext=$OBJEXT
+-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -3024,20 +3116,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+@@ -3047,15 +3140,19 @@ rm -f core conftest.err conftest.$ac_obj
+ ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+-GCC=`test $ac_compiler_gnu = yes && echo yes`
++{ $as_echo "$as_me:$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
+-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+@@ -3082,20 +3179,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+@@ -3120,20 +3218,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+@@ -3159,20 +3258,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+@@ -3187,8 +3287,8 @@ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
++{ $as_echo "$as_me:$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
+@@ -3204,10 +3304,10 @@ else
+ CFLAGS=
+ fi
+ fi
+-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_cv_prog_cc_c89=no
+ ac_save_CC=$CC
+@@ -3278,20 +3378,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+@@ -3307,15 +3408,15 @@ fi
+ # AC_CACHE_VAL
+ case "x$ac_cv_prog_cc_c89" in
+ x)
+- { echo "$as_me:$LINENO: result: none needed" >&5
+-echo "${ECHO_T}none needed" >&6; } ;;
++ { $as_echo "$as_me:$LINENO: result: none needed" >&5
++$as_echo "none needed" >&6; } ;;
+ xno)
+- { echo "$as_me:$LINENO: result: unsupported" >&5
+-echo "${ECHO_T}unsupported" >&6; } ;;
++ { $as_echo "$as_me:$LINENO: result: unsupported" >&5
++$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
++ { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
++$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+ esac
+
+
+@@ -3336,8 +3437,8 @@ am__doit:
+ .PHONY: am__doit
+ END
+ # If we don't find an include directive, just comment out the code.
+-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+@@ -3364,8 +3465,8 @@ if test "$am__include" = "#"; then
+ fi
+
+
+-{ echo "$as_me:$LINENO: result: $_am_result" >&5
+-echo "${ECHO_T}$_am_result" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
++$as_echo "$_am_result" >&6; }
+ rm -f confinc confmf
+
+ # Check whether --enable-dependency-tracking was given.
+@@ -3377,7 +3478,9 @@ if test "x$enable_dependency_tracking" !
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ fi
+- if test "x$enable_dependency_tracking" != xno; then
++
++
++if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+ else
+@@ -3387,12 +3490,13 @@ fi
+
+
+
++
+ depcc="$CC" am_compiler_list=
+
+-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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
+@@ -3454,7 +3558,6 @@ else
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+@@ -3480,11 +3583,13 @@ else
+ fi
+
+ fi
+-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
++{ $as_echo "$as_me:$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
++
++
++if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+@@ -3508,11 +3613,12 @@ fi
+ # 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.
+-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
++# Reject install programs that cannot install multiple files.
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ for as_dir in $PATH
+@@ -3541,17 +3647,29 @@ case $as_dir/ in
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+- break 3
++ 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
+@@ -3564,8 +3682,8 @@ fi
+ INSTALL=$ac_install_sh
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+-echo "${ECHO_T}$INSTALL" >&6; }
++{ $as_echo "$as_me:$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.
+@@ -3649,34 +3767,34 @@ fi
+
+ # Make sure we can run config.sub.
+ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
++$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+-{ echo "$as_me:$LINENO: checking build system type" >&5
+-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking build system type" >&5
++$as_echo_n "checking build system type... " >&6; }
+ if test "${ac_cv_build+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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 &&
+- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
++$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
++$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+-echo "${ECHO_T}$ac_cv_build" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
++$as_echo "$ac_cv_build" >&6; }
+ case $ac_cv_build in
+ *-*-*) ;;
+-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+-echo "$as_me: error: invalid value of canonical build" >&2;}
++*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
++$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ build=$ac_cv_build
+@@ -3693,27 +3811,27 @@ IFS=$ac_save_IFS
+ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+-{ echo "$as_me:$LINENO: checking host system type" >&5
+-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking host system type" >&5
++$as_echo_n "checking host system type... " >&6; }
+ if test "${ac_cv_host+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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` ||
+- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
++$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+-echo "${ECHO_T}$ac_cv_host" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
++$as_echo "$ac_cv_host" >&6; }
+ case $ac_cv_host in
+ *-*-*) ;;
+-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+-echo "$as_me: error: invalid value of canonical host" >&2;}
++*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
++$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ host=$ac_cv_host
+@@ -3730,10 +3848,10 @@ IFS=$ac_save_IFS
+ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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 "${lt_cv_path_SED+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ # 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.
+@@ -3786,45 +3904,40 @@ fi
+
+ SED=$lt_cv_path_SED
+
+-{ echo "$as_me:$LINENO: result: $SED" >&5
+-echo "${ECHO_T}$SED" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $SED" >&5
++$as_echo "$SED" >&6; }
+
+-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+-if test "${ac_cv_path_GREP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- # Extract the first word of "grep ggrep" to use in msg output
+-if test -z "$GREP"; then
+-set dummy grep ggrep; ac_prog_name=$2
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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
++ # 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.
++ 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
+- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
++ $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"
+- echo 'GREP' >> "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
+ ac_count=`expr $ac_count + 1`
+@@ -3839,74 +3952,60 @@ case `"$ac_path_GREP" --version 2>&1` in
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+ esac
+
+-
+- $ac_path_GREP_found && break 3
++ $ac_path_GREP_found && break 3
++ done
+ done
+ done
+-
+-done
+ IFS=$as_save_IFS
+-
+-
+-fi
+-
+-GREP="$ac_cv_path_GREP"
+-if test -z "$GREP"; then
+- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
++ if test -z "$ac_cv_path_GREP"; then
++ { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
++$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+-fi
+-
++ fi
+ else
+ ac_cv_path_GREP=$GREP
+ fi
+
+-
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
++$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+-{ echo "$as_me:$LINENO: checking for egrep" >&5
+-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
++$as_echo_n "checking for egrep... " >&6; }
+ if test "${ac_cv_path_EGREP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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
+- # Extract the first word of "egrep" to use in msg output
+-if test -z "$EGREP"; then
+-set dummy egrep; ac_prog_name=$2
+-if test "${ac_cv_path_EGREP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-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
++ # 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.
++ 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
+- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
++ $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"
+- echo 'EGREP' >> "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
+ ac_count=`expr $ac_count + 1`
+@@ -3921,33 +4020,24 @@ case `"$ac_path_EGREP" --version 2>&1` i
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+ esac
+
+-
+- $ac_path_EGREP_found && break 3
++ $ac_path_EGREP_found && break 3
++ done
+ done
+ done
+-
+-done
+ IFS=$as_save_IFS
+-
+-
+-fi
+-
+-EGREP="$ac_cv_path_EGREP"
+-if test -z "$EGREP"; then
+- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
++ if test -z "$ac_cv_path_EGREP"; then
++ { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
++$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+-fi
+-
++ fi
+ else
+ ac_cv_path_EGREP=$EGREP
+ fi
+
+-
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
++$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+@@ -3962,8 +4052,8 @@ fi
+ ac_prog=ld
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+@@ -3992,14 +4082,14 @@ echo $ECHO_N "checking for ld used by $C
+ ;;
+ esac
+ elif test "$with_gnu_ld" = yes; then
+- { echo "$as_me:$LINENO: checking for GNU ld" >&5
+-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
++$as_echo_n "checking for GNU ld... " >&6; }
+ else
+- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+@@ -4029,19 +4119,19 @@ fi
+
+ LD="$lt_cv_path_LD"
+ if test -n "$LD"; then
+- { echo "$as_me:$LINENO: result: $LD" >&5
+-echo "${ECHO_T}$LD" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $LD" >&5
++$as_echo "$LD" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
++test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
++$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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
+@@ -4053,20 +4143,20 @@ case `$LD -v 2>&1 </dev/null` in
+ ;;
+ esac
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
++$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+ with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_ld_reload_flag='-r'
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
++{ $as_echo "$as_me:$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
+ "" | " "*) ;;
+@@ -4083,10 +4173,10 @@ case $host_os in
+ ;;
+ esac
+
+-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
++$as_echo_n "checking for BSD-compatible nm... " >&6; }
+ if test "${lt_cv_path_NM+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$NM"; then
+ # Let the user override the test.
+@@ -4132,25 +4222,25 @@ else
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
++$as_echo "$lt_cv_path_NM" >&6; }
+ NM="$lt_cv_path_NM"
+
+-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
++ { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+-echo "${ECHO_T}no, using $LN_S" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
++$as_echo "no, using $LN_S" >&6; }
+ fi
+
+-{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+-echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+ lt_cv_file_magic_test_file=
+@@ -4262,7 +4352,7 @@ linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+-netbsd* | netbsdelf*-gnu)
++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
+@@ -4333,8 +4423,8 @@ sysv5* | sco3.2v5* | sco5v6* | unixware*
+ esac
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
++{ $as_echo "$as_me:$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
+@@ -4368,7 +4458,7 @@ ia64-*-hpux*)
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+@@ -4383,11 +4473,11 @@ ia64-*-hpux*)
+ ;;
+ *-*-irix6*)
+ # Find out which ABI we are using.
+- echo '#line 4386 "configure"' > conftest.$ac_ext
++ echo '#line 4476 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+@@ -4425,7 +4515,7 @@ s390*-*linux*|sparc*-*linux*)
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+@@ -4475,10 +4565,10 @@ s390*-*linux*|sparc*-*linux*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+- { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+@@ -4507,26 +4597,30 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ lt_cv_cc_needs_belf=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_cc_needs_belf=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+@@ -4536,8 +4630,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
++{ $as_echo "$as_me:$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"
+@@ -4549,7 +4643,7 @@ sparc*-*solaris*)
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+@@ -4578,15 +4672,15 @@ 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
+-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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"
+@@ -4618,20 +4712,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+@@ -4655,13 +4750,14 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+@@ -4669,7 +4765,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
+ # Broken: success on invalid input.
+ continue
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+@@ -4694,8 +4790,8 @@ fi
+ else
+ ac_cv_prog_CPP=$CPP
+ fi
+-{ echo "$as_me:$LINENO: result: $CPP" >&5
+-echo "${ECHO_T}$CPP" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
++$as_echo "$CPP" >&6; }
+ ac_preproc_ok=false
+ for ac_c_preproc_warn_flag in '' yes
+ do
+@@ -4723,20 +4819,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+@@ -4760,13 +4857,14 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+@@ -4774,7 +4872,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
+ # Broken: success on invalid input.
+ continue
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+@@ -4790,9 +4888,9 @@ rm -f conftest.err conftest.$ac_ext
+ if $ac_preproc_ok; then
+ :
+ else
+- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
++ { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
++$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+ See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+@@ -4804,10 +4902,10 @@ ac_link='$CC -o conftest$ac_exeext $CFLA
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -4834,20 +4932,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+@@ -4939,37 +5038,40 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+ else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
++ $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
+
+ ( exit $ac_status )
+ ac_cv_header_stdc=no
+ fi
++rm -rf conftest.dSYM
+ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+
+
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
++$as_echo "$ac_cv_header_stdc" >&6; }
+ if test $ac_cv_header_stdc = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+@@ -4991,11 +5093,11 @@ fi
+ 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
++{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
++$as_echo_n "checking for $ac_header... " >&6; }
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -5013,20 +5115,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+@@ -5034,12 +5137,14 @@ fi
+
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-ac_res=`eval echo '${'$as_ac_Header'}'`
+- { echo "$as_me:$LINENO: result: $ac_res" >&5
+-echo "${ECHO_T}$ac_res" >&6; }
+-if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ac_res=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
++if test `eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+ _ACEOF
+
+ fi
+@@ -5050,20 +5155,21 @@ done
+
+ for ac_header in dlfcn.h
+ do
+-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+- { echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
++$as_echo_n "checking for $ac_header... " >&6; }
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ fi
+-ac_res=`eval echo '${'$as_ac_Header'}'`
+- { echo "$as_me:$LINENO: result: $ac_res" >&5
+-echo "${ECHO_T}$ac_res" >&6; }
++ac_res=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
+ else
+ # Is the header compilable?
+-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
++$as_echo_n "checking $ac_header usability... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -5079,32 +5185,33 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+ fi
+
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+-echo "${ECHO_T}$ac_header_compiler" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++$as_echo "$ac_header_compiler" >&6; }
+
+ # Is the header present?
+-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
++$as_echo_n "checking $ac_header presence... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -5118,69 +5225,72 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+ fi
+
+ rm -f conftest.err conftest.$ac_ext
+-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+-echo "${ECHO_T}$ac_header_preproc" >&6; }
++{ $as_echo "$as_me:$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: )
+- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
++$as_echo_n "checking for $ac_header... " >&6; }
+ if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+-ac_res=`eval echo '${'$as_ac_Header'}'`
+- { echo "$as_me:$LINENO: result: $ac_res" >&5
+-echo "${ECHO_T}$ac_res" >&6; }
++ac_res=`eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
+
+ fi
+-if test `eval echo '${'$as_ac_Header'}'` = yes; then
++if test `eval 'as_val=${'$as_ac_Header'}
++ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+ _ACEOF
+
+ fi
+@@ -5201,10 +5311,10 @@ if test -z "$CXX"; then
+ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_CXX+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+@@ -5217,7 +5327,7 @@ do
+ 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_CXX="$ac_tool_prefix$ac_prog"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -5228,11 +5338,11 @@ fi
+ fi
+ CXX=$ac_cv_prog_CXX
+ if test -n "$CXX"; then
+- { echo "$as_me:$LINENO: result: $CXX" >&5
+-echo "${ECHO_T}$CXX" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $CXX" >&5
++$as_echo "$CXX" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -5245,10 +5355,10 @@ if test -z "$CXX"; then
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+@@ -5261,7 +5371,7 @@ do
+ 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_CXX="$ac_prog"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -5272,11 +5382,11 @@ fi
+ fi
+ ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+ if test -n "$ac_ct_CXX"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+-echo "${ECHO_T}$ac_ct_CXX" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
++$as_echo "$ac_ct_CXX" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -5288,10 +5398,10 @@ done
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -5303,43 +5413,47 @@ fi
+ fi
+ fi
+ # Provide some information about the compiler.
+-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+-ac_compiler=`set X $ac_compile; echo $2`
++$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
++set X $ac_compile
++ac_compiler=$2
+ { (ac_try="$ac_compiler --version >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { (ac_try="$ac_compiler -v >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { (ac_try="$ac_compiler -V >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_cxx_compiler_gnu+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -5365,20 +5479,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+@@ -5388,15 +5503,19 @@ rm -f core conftest.err conftest.$ac_obj
+ ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
+-GXX=`test $ac_compiler_gnu = yes && echo yes`
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
++$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
++if test $ac_compiler_gnu = yes; then
++ GXX=yes
++else
++ GXX=
++fi
+ ac_test_CXXFLAGS=${CXXFLAGS+set}
+ ac_save_CXXFLAGS=$CXXFLAGS
+-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
++$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+ if test "${ac_cv_prog_cxx_g+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+@@ -5423,20 +5542,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cxx_g=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ CXXFLAGS=""
+@@ -5461,20 +5581,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+@@ -5500,20 +5621,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cxx_g=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+@@ -5528,8 +5650,8 @@ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
++$as_echo "$ac_cv_prog_cxx_g" >&6; }
+ if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+ elif test $ac_cv_prog_cxx_g = yes; then
+@@ -5553,10 +5675,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ depcc="$CXX" am_compiler_list=
+
+-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
++$as_echo_n "checking dependency style of $depcc... " >&6; }
+ if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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
+@@ -5618,7 +5740,6 @@ else
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+@@ -5644,11 +5765,13 @@ else
+ fi
+
+ fi
+-{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
++$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+ CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+- if
++
++
++if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+@@ -5669,11 +5792,11 @@ ac_cpp='$CXXCPP $CPPFLAGS'
+ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
++$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+ if test -z "$CXXCPP"; then
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+@@ -5705,20 +5828,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+@@ -5742,13 +5866,14 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+@@ -5756,7 +5881,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
+ # Broken: success on invalid input.
+ continue
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+@@ -5781,8 +5906,8 @@ fi
+ else
+ ac_cv_prog_CXXCPP=$CXXCPP
+ fi
+-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
+-echo "${ECHO_T}$CXXCPP" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
++$as_echo "$CXXCPP" >&6; }
+ ac_preproc_ok=false
+ for ac_cxx_preproc_warn_flag in '' yes
+ do
+@@ -5810,20 +5935,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+@@ -5847,13 +5973,14 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+@@ -5861,7 +5988,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
+ # Broken: success on invalid input.
+ continue
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+@@ -5877,9 +6004,9 @@ rm -f conftest.err conftest.$ac_ext
+ if $ac_preproc_ok; then
+ :
+ else
+- { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
++ { { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+ See \`config.log' for more details." >&5
+-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
++$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+ See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+@@ -5902,10 +6029,10 @@ if test -n "$ac_tool_prefix"; then
+ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_F77+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
+@@ -5918,7 +6045,7 @@ do
+ 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_F77="$ac_tool_prefix$ac_prog"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -5929,11 +6056,11 @@ fi
+ fi
+ F77=$ac_cv_prog_F77
+ if test -n "$F77"; then
+- { echo "$as_me:$LINENO: result: $F77" >&5
+-echo "${ECHO_T}$F77" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $F77" >&5
++$as_echo "$F77" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -5946,10 +6073,10 @@ if test -z "$F77"; then
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+@@ -5962,7 +6089,7 @@ do
+ 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_F77="$ac_prog"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -5973,11 +6100,11 @@ fi
+ fi
+ ac_ct_F77=$ac_cv_prog_ac_ct_F77
+ if test -n "$ac_ct_F77"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+-echo "${ECHO_T}$ac_ct_F77" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
++$as_echo "$ac_ct_F77" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -5989,10 +6116,10 @@ done
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -6003,37 +6130,41 @@ fi
+
+
+ # Provide some information about the compiler.
+-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+-ac_compiler=`set X $ac_compile; echo $2`
++$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
++set X $ac_compile
++ac_compiler=$2
+ { (ac_try="$ac_compiler --version >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { (ac_try="$ac_compiler -v >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { (ac_try="$ac_compiler -V >&5"
+ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ rm -f a.out
+
+@@ -6041,10 +6172,10 @@ rm -f a.out
+ # input file. (Note that this only needs to work for GNU compilers.)
+ ac_save_ext=$ac_ext
+ ac_ext=F
+-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
++$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+ if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+@@ -6060,20 +6191,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+@@ -6083,16 +6215,16 @@ rm -f core conftest.err conftest.$ac_obj
+ ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
++$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ ac_ext=$ac_save_ext
+ ac_test_FFLAGS=${FFLAGS+set}
+ ac_save_FFLAGS=$FFLAGS
+ FFLAGS=
+-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
++$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+ if test "${ac_cv_prog_f77_g+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ FFLAGS=-g
+ cat >conftest.$ac_ext <<_ACEOF
+@@ -6106,20 +6238,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_f77_g=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_prog_f77_g=no
+@@ -6128,8 +6261,8 @@ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
++$as_echo "$ac_cv_prog_f77_g" >&6; }
+ if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+ elif test $ac_cv_prog_f77_g = yes; then
+@@ -6146,7 +6279,11 @@ else
+ fi
+ fi
+
+-G77=`test $ac_compiler_gnu = yes && echo yes`
++if test $ac_compiler_gnu = yes; then
++ G77=yes
++else
++ G77=
++fi
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+@@ -6157,10 +6294,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+ # find the maximum length of command line arguments
+-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ i=0
+ teststring="ABCD"
+@@ -6269,11 +6406,11 @@ else
+ fi
+
+ if test -n $lt_cv_sys_max_cmd_len ; then
+- { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
++$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: none" >&5
+-echo "${ECHO_T}none" >&6; }
++ { $as_echo "$as_me:$LINENO: result: none" >&5
++$as_echo "none" >&6; }
+ fi
+
+
+@@ -6281,10 +6418,10 @@ fi
+
+
+ # Check for command to grab the raw symbol name followed by C symbol from nm.
+-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+
+ # These are sane defaults that work on at least a few old systems.
+@@ -6389,14 +6526,14 @@ EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo "$as_me:$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=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+@@ -6451,7 +6588,7 @@ EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+@@ -6486,17 +6623,17 @@ if test -z "$lt_cv_sys_global_symbol_pip
+ 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
+- { echo "$as_me:$LINENO: result: failed" >&5
+-echo "${ECHO_T}failed" >&6; }
++ { $as_echo "$as_me:$LINENO: result: failed" >&5
++$as_echo "failed" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: ok" >&5
+-echo "${ECHO_T}ok" >&6; }
++ { $as_echo "$as_me:$LINENO: result: ok" >&5
++$as_echo "ok" >&6; }
+ fi
+
+-{ echo "$as_me:$LINENO: checking for objdir" >&5
+-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
++$as_echo_n "checking for objdir... " >&6; }
+ if test "${lt_cv_objdir+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+@@ -6508,8 +6645,8 @@ else
+ fi
+ rmdir .libs 2>/dev/null
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+-echo "${ECHO_T}$lt_cv_objdir" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
++$as_echo "$lt_cv_objdir" >&6; }
+ objdir=$lt_cv_objdir
+
+
+@@ -6560,10 +6697,10 @@ with_gnu_ld="$lt_cv_prog_gnu_ld"
+ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+@@ -6576,7 +6713,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -6587,11 +6724,11 @@ fi
+ fi
+ AR=$ac_cv_prog_AR
+ if test -n "$AR"; then
+- { echo "$as_me:$LINENO: result: $AR" >&5
+-echo "${ECHO_T}$AR" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $AR" >&5
++$as_echo "$AR" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -6600,10 +6737,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -6616,7 +6753,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -6627,11 +6764,11 @@ fi
+ fi
+ ac_ct_AR=$ac_cv_prog_ac_ct_AR
+ if test -n "$ac_ct_AR"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+-echo "${ECHO_T}$ac_ct_AR" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
++$as_echo "$ac_ct_AR" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ if test "x$ac_ct_AR" = x; then
+@@ -6639,10 +6776,10 @@ fi
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -6656,10 +6793,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_RANLIB+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+@@ -6672,7 +6809,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -6683,11 +6820,11 @@ fi
+ fi
+ RANLIB=$ac_cv_prog_RANLIB
+ if test -n "$RANLIB"; then
+- { echo "$as_me:$LINENO: result: $RANLIB" >&5
+-echo "${ECHO_T}$RANLIB" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
++$as_echo "$RANLIB" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -6696,10 +6833,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -6712,7 +6849,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -6723,11 +6860,11 @@ fi
+ fi
+ ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+ if test -n "$ac_ct_RANLIB"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
++$as_echo "$ac_ct_RANLIB" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+@@ -6735,10 +6872,10 @@ fi
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -6752,10 +6889,10 @@ fi
+ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_STRIP+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+@@ -6768,7 +6905,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -6779,11 +6916,11 @@ fi
+ fi
+ STRIP=$ac_cv_prog_STRIP
+ if test -n "$STRIP"; then
+- { echo "$as_me:$LINENO: result: $STRIP" >&5
+-echo "${ECHO_T}$STRIP" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
++$as_echo "$STRIP" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -6792,10 +6929,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -6808,7 +6945,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -6819,11 +6956,11 @@ fi
+ fi
+ ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+ if test -n "$ac_ct_STRIP"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++$as_echo "$ac_ct_STRIP" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ if test "x$ac_ct_STRIP" = x; then
+@@ -6831,10 +6968,10 @@ fi
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -6899,10 +7036,10 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -
+ case $deplibs_check_method in
+ file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+- { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ case $MAGIC_CMD in
+ [\\/*] | ?:[\\/]*)
+@@ -6952,19 +7089,19 @@ fi
+
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if test -n "$MAGIC_CMD"; then
+- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+-echo "${ECHO_T}$MAGIC_CMD" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++$as_echo "$MAGIC_CMD" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: checking for file" >&5
+-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking for file" >&5
++$as_echo_n "checking for file... " >&6; }
+ if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ case $MAGIC_CMD in
+ [\\/*] | ?:[\\/]*)
+@@ -7014,11 +7151,11 @@ fi
+
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if test -n "$MAGIC_CMD"; then
+- { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+-echo "${ECHO_T}$MAGIC_CMD" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++$as_echo "$MAGIC_CMD" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ else
+@@ -7036,10 +7173,10 @@ esac
+ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+@@ -7052,7 +7189,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -7063,11 +7200,11 @@ fi
+ fi
+ DSYMUTIL=$ac_cv_prog_DSYMUTIL
+ if test -n "$DSYMUTIL"; then
+- { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+-echo "${ECHO_T}$DSYMUTIL" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
++$as_echo "$DSYMUTIL" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -7076,10 +7213,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -7092,7 +7229,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -7103,11 +7240,11 @@ fi
+ fi
+ ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+ if test -n "$ac_ct_DSYMUTIL"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+-echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
++$as_echo "$ac_ct_DSYMUTIL" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+@@ -7115,10 +7252,10 @@ fi
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -7132,10 +7269,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_NMEDIT+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+@@ -7148,7 +7285,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -7159,11 +7296,11 @@ fi
+ fi
+ NMEDIT=$ac_cv_prog_NMEDIT
+ if test -n "$NMEDIT"; then
+- { echo "$as_me:$LINENO: result: $NMEDIT" >&5
+-echo "${ECHO_T}$NMEDIT" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
++$as_echo "$NMEDIT" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+
+@@ -7172,10 +7309,10 @@ 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
+-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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.
+@@ -7188,7 +7325,7 @@ do
+ 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"
+- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+ done
+@@ -7199,11 +7336,11 @@ fi
+ fi
+ ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+ if test -n "$ac_ct_NMEDIT"; then
+- { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+-echo "${ECHO_T}$ac_ct_NMEDIT" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
++$as_echo "$ac_ct_NMEDIT" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+@@ -7211,10 +7348,10 @@ fi
+ else
+ case $cross_compiling:$ac_tool_warned in
+ yes:)
+-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
++{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&5
+-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
++$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+ whose name does not start with the host triplet. If you think this
+ configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ ac_tool_warned=yes ;;
+@@ -7226,10 +7363,10 @@ else
+ fi
+
+
+- { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+-echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+@@ -7247,12 +7384,12 @@ else
+ rm conftest.c
+ fi
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+-echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; }
+- { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+-echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
++$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+@@ -7279,33 +7416,37 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ lt_cv_ld_exported_symbols_list=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_ld_exported_symbols_list=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+-echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
++$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[0123])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+@@ -7417,10 +7558,10 @@ if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+@@ -7435,11 +7576,11 @@ else
+ -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:7438: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:7579: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:7442: \$? = $ac_status" >&5
++ echo "$as_me:7583: \$? = $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.
+@@ -7452,8 +7593,8 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
++{ $as_echo "$as_me:$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"
+@@ -7467,8 +7608,8 @@ lt_prog_compiler_wl=
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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,'
+@@ -7699,18 +7840,18 @@ echo $ECHO_N "checking for $compiler opt
+ esac
+ fi
+
+-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
++{ $as_echo "$as_me:$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
+
+-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+@@ -7725,11 +7866,11 @@ else
+ -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:7728: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:7869: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:7732: \$? = $ac_status" >&5
++ echo "$as_me:7873: \$? = $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.
+@@ -7742,8 +7883,8 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; }
++{ $as_echo "$as_me:$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
+@@ -7770,10 +7911,10 @@ esac
+ # Check to make sure the static flag actually works.
+ #
+ wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+@@ -7798,8 +7939,8 @@ else
+ LDFLAGS="$save_LDFLAGS"
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; }
++{ $as_echo "$as_me:$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
+ :
+@@ -7808,10 +7949,10 @@ else
+ fi
+
+
+-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_c_o=no
+ $rm -r conftest 2>/dev/null
+@@ -7829,11 +7970,11 @@ else
+ -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:7832: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:7973: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:7836: \$? = $ac_status" >&5
++ echo "$as_me:7977: \$? = $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
+@@ -7855,34 +7996,34 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
++{ $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: result: $hard_links" >&5
+-echo "${ECHO_T}$hard_links" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
++$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
++ { $as_echo "$as_me:$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
+
+-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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=
+@@ -8094,13 +8235,12 @@ EOF
+ $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
+- link_all_deplibs=no
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+@@ -8313,18 +8453,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -8339,12 +8482,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -8379,18 +8523,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -8405,12 +8552,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -8643,7 +8791,7 @@ if test -z "$aix_libpath"; then aix_libp
+ link_all_deplibs=yes
+ ;;
+
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+@@ -8862,8 +9010,8 @@ if test -z "$aix_libpath"; then aix_libp
+ esac
+ fi
+
+-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+-echo "${ECHO_T}$ld_shlibs" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
++$as_echo "$ld_shlibs" >&6; }
+ test "$ld_shlibs" = no && can_build_shared=no
+
+ #
+@@ -8883,15 +9031,15 @@ x|xyes)
+ # 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.
+- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
++$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+@@ -8909,7 +9057,7 @@ echo $ECHO_N "checking whether -lc shoul
+ if { (eval echo "$as_me:$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=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+@@ -8921,16 +9069,16 @@ echo $ECHO_N "checking whether -lc shoul
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
++$as_echo "$archive_cmds_need_lc" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+ esac
+
+-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
++$as_echo_n "checking dynamic linker characteristics... " >&6; }
+ library_names_spec=
+ libname_spec='lib$name'
+ soname_spec=
+@@ -9354,18 +9502,6 @@ linux* | k*bsd*-gnu)
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+-netbsdelf*-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
+- shlibpath_overrides_runpath=no
+- hardcode_into_libs=yes
+- dynamic_linker='NetBSD ld.elf_so'
+- ;;
+-
+ netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+@@ -9543,19 +9679,19 @@ uts4*)
+ dynamic_linker=no
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+-echo "${ECHO_T}$dynamic_linker" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
++$as_echo "$dynamic_linker" >&6; }
+ test "$dynamic_linker" = no && can_build_shared=no
+
+ if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+ fi
+
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+ if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+ fi
+@@ -9567,8 +9703,8 @@ if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+ fi
+
+-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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" || \
+@@ -9592,8 +9728,8 @@ else
+ # directories.
+ hardcode_action=unsupported
+ fi
+-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
+-echo "${ECHO_T}$hardcode_action" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
++$as_echo "$hardcode_action" >&6; }
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+@@ -9606,13 +9742,13 @@ fi
+
+ striplib=
+ old_striplib=
+-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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"
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
++ { $as_echo "$as_me:$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
+@@ -9620,16 +9756,16 @@ else
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
++ { $as_echo "$as_me:$LINENO: result: yes" >&5
++$as_echo "yes" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ ;;
+ esac
+ fi
+@@ -9661,10 +9797,10 @@ else
+
+ darwin*)
+ # if libdl is installed we need to link against it
+- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldl $LIBS"
+@@ -9696,32 +9832,36 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_lib_dl_dlopen=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
++$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+ if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+ else
+@@ -9735,10 +9875,10 @@ fi
+ ;;
+
+ *)
+- { echo "$as_me:$LINENO: checking for shl_load" >&5
+-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
++$as_echo_n "checking for shl_load... " >&6; }
+ if test "${ac_cv_func_shl_load+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -9791,38 +9931,42 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_func_shl_load=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_shl_load=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
++$as_echo "$ac_cv_func_shl_load" >&6; }
+ if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+ else
+- { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldld $LIBS"
+@@ -9854,39 +9998,43 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_lib_dld_shl_load=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_shl_load=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
++$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+ if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+ else
+- { echo "$as_me:$LINENO: checking for dlopen" >&5
+-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
++$as_echo_n "checking for dlopen... " >&6; }
+ if test "${ac_cv_func_dlopen+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -9939,38 +10087,42 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_func_dlopen=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_dlopen=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
++$as_echo "$ac_cv_func_dlopen" >&6; }
+ if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+ else
+- { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldl $LIBS"
+@@ -10002,39 +10154,43 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_lib_dl_dlopen=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
++$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+ if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+ else
+- { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lsvld $LIBS"
+@@ -10066,39 +10222,43 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_lib_svld_dlopen=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_svld_dlopen=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
++$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+ if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+ else
+- { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldld $LIBS"
+@@ -10130,32 +10290,36 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ ac_cv_lib_dld_dld_link=yes
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_dld_link=no
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
++$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+ if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+ fi
+@@ -10195,10 +10359,10 @@ fi
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+- { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+@@ -10206,7 +10370,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 10209 "configure"
++#line 10373 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10272,7 +10436,7 @@ EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+@@ -10290,15 +10454,15 @@ rm -fr conftest*
+
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
++{ $as_echo "$as_me:$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\"
+- { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+@@ -10306,7 +10470,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 10309 "configure"
++#line 10473 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -10372,7 +10536,7 @@ EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+@@ -10390,8 +10554,8 @@ rm -fr conftest*
+
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
++$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+@@ -10413,13 +10577,13 @@ fi
+
+
+ # Report which library types will actually be built
+-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+-echo "${ECHO_T}$can_build_shared" >&6; }
++{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
++$as_echo_n "checking if libtool supports shared libraries... " >&6; }
++{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
++$as_echo "$can_build_shared" >&6; }
+
+-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+@@ -10439,15 +10603,15 @@ aix[4-9]*)
+ fi
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+-echo "${ECHO_T}$enable_shared" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
++$as_echo "$enable_shared" >&6; }
+
+-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+-{ echo "$as_me:$LINENO: result: $enable_static" >&5
+-echo "${ECHO_T}$enable_static" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5
++$as_echo "$enable_static" >&6; }
+
+ # The else clause should only fire when bootstrapping the
+ # libtool distribution, otherwise you forgot to ship ltmain.sh
+@@ -10540,8 +10704,8 @@ if test -f "$ltmain"; then
+ cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+- { echo "$as_me:$LINENO: creating $ofile" >&5
+-echo "$as_me: creating $ofile" >&6;}
++ { $as_echo "$as_me:$LINENO: creating $ofile" >&5
++$as_echo "$as_me: creating $ofile" >&6;}
+
+ cat <<__EOF__ >> "$cfgfile"
+ #! $SHELL
+@@ -10953,18 +11117,18 @@ fi
+
+ if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
++$as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+- { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
++$as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+ else
+- { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
++ { $as_echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
++$as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+ fi
+ fi
+ if test -z "$LTCFLAGS"; then
+@@ -10981,16 +11145,16 @@ echo "$as_me: WARNING: using \`LTCC=$LTC
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+ "") ;;
+- *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+-echo "$as_me: error: invalid tag name: $tagname" >&2;}
++ *) { { $as_echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
++$as_echo "$as_me: error: invalid tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+- { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
++$as_echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+@@ -11133,8 +11297,8 @@ fi
+ ac_prog=ld
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+- { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+@@ -11163,14 +11327,14 @@ echo $ECHO_N "checking for ld used by $C
+ ;;
+ esac
+ elif test "$with_gnu_ld" = yes; then
+- { echo "$as_me:$LINENO: checking for GNU ld" >&5
+-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
++$as_echo_n "checking for GNU ld... " >&6; }
+ else
+- { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+@@ -11200,19 +11364,19 @@ fi
+
+ LD="$lt_cv_path_LD"
+ if test -n "$LD"; then
+- { echo "$as_me:$LINENO: result: $LD" >&5
+-echo "${ECHO_T}$LD" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $LD" >&5
++$as_echo "$LD" >&6; }
+ else
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
++ { $as_echo "$as_me:$LINENO: result: no" >&5
++$as_echo "no" >&6; }
+ fi
+-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
++test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
++$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $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
+@@ -11224,8 +11388,8 @@ case `$LD -v 2>&1 </dev/null` in
+ ;;
+ esac
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
++$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+ with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+@@ -11275,8 +11439,8 @@ else
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
++$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ ld_shlibs_CXX=yes
+ case $host_os in
+ aix3*)
+@@ -11393,18 +11557,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -11419,12 +11586,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -11460,18 +11628,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -11486,12 +11657,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -11894,7 +12066,7 @@ if test -z "$aix_libpath"; then aix_libp
+ ;;
+ esac
+ ;;
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+@@ -12221,8 +12393,8 @@ if test -z "$aix_libpath"; then aix_libp
+ ld_shlibs_CXX=no
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
++$as_echo "$ld_shlibs_CXX" >&6; }
+ test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+ GCC_CXX="$GXX"
+@@ -12241,7 +12413,7 @@ EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+@@ -12397,8 +12569,8 @@ lt_prog_compiler_wl_CXX=
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX=
+
+-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+@@ -12598,7 +12770,7 @@ echo $ECHO_N "checking for $compiler opt
+ ;;
+ esac
+ ;;
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+@@ -12681,18 +12853,18 @@ echo $ECHO_N "checking for $compiler opt
+ esac
+ fi
+
+-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
++$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+
+ #
+ # Check to make sure the PIC flag actually works.
+ #
+ if test -n "$lt_prog_compiler_pic_CXX"; then
+
+-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
++$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+ if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+@@ -12707,11 +12879,11 @@ else
+ -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:12710: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:12882: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:12714: \$? = $ac_status" >&5
++ echo "$as_me:12886: \$? = $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.
+@@ -12724,8 +12896,8 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
++$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+ if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+@@ -12752,10 +12924,10 @@ esac
+ # Check to make sure the static flag actually works.
+ #
+ wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_CXX+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+@@ -12780,8 +12952,8 @@ else
+ LDFLAGS="$save_LDFLAGS"
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
++$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+ if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+ :
+@@ -12790,10 +12962,10 @@ else
+ fi
+
+
+-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_CXX+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $rm -r conftest 2>/dev/null
+@@ -12811,11 +12983,11 @@ else
+ -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:12814: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:12986: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:12818: \$? = $ac_status" >&5
++ echo "$as_me:12990: \$? = $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
+@@ -12837,34 +13009,34 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
++$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+ hard_links="nottested"
+ if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: result: $hard_links" >&5
+-echo "${ECHO_T}$hard_links" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
++$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
++ { $as_echo "$as_me:$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
+
+-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
++$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+@@ -12883,17 +13055,14 @@ echo $ECHO_N "checking whether the $comp
+ cygwin* | mingw*)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ ;;
+- linux* | k*bsd*-gnu)
+- link_all_deplibs_CXX=no
+- ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+
+-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
++$as_echo "$ld_shlibs_CXX" >&6; }
+ test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+ #
+@@ -12913,15 +13082,15 @@ x|xyes)
+ # 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.
+- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
++$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+@@ -12939,7 +13108,7 @@ echo $ECHO_N "checking whether -lc shoul
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_CXX=no
+@@ -12951,16 +13120,16 @@ echo $ECHO_N "checking whether -lc shoul
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
++$as_echo "$archive_cmds_need_lc_CXX" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+ esac
+
+-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
++$as_echo_n "checking dynamic linker characteristics... " >&6; }
+ library_names_spec=
+ libname_spec='lib$name'
+ soname_spec=
+@@ -13332,18 +13501,6 @@ linux* | k*bsd*-gnu)
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+-netbsdelf*-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
+- shlibpath_overrides_runpath=no
+- hardcode_into_libs=yes
+- dynamic_linker='NetBSD ld.elf_so'
+- ;;
+-
+ netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+@@ -13521,19 +13678,19 @@ uts4*)
+ dynamic_linker=no
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+-echo "${ECHO_T}$dynamic_linker" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
++$as_echo "$dynamic_linker" >&6; }
+ test "$dynamic_linker" = no && can_build_shared=no
+
+ if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+ fi
+
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+ if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+ fi
+@@ -13545,8 +13702,8 @@ if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+ fi
+
+-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
++$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+ hardcode_action_CXX=
+ if test -n "$hardcode_libdir_flag_spec_CXX" || \
+ test -n "$runpath_var_CXX" || \
+@@ -13570,8 +13727,8 @@ else
+ # directories.
+ hardcode_action_CXX=unsupported
+ fi
+-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
++$as_echo "$hardcode_action_CXX" >&6; }
+
+ if test "$hardcode_action_CXX" = relink; then
+ # Fast installation is not supported
+@@ -14109,13 +14266,13 @@ done
+ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
+-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
+-echo "${ECHO_T}$can_build_shared" >&6; }
++{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
++$as_echo_n "checking if libtool supports shared libraries... " >&6; }
++{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
++$as_echo "$can_build_shared" >&6; }
+
+-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+@@ -14134,15 +14291,15 @@ aix[4-9]*)
+ fi
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
+-echo "${ECHO_T}$enable_shared" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
++$as_echo "$enable_shared" >&6; }
+
+-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+-{ echo "$as_me:$LINENO: result: $enable_static" >&5
+-echo "${ECHO_T}$enable_static" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5
++$as_echo "$enable_static" >&6; }
+
+ GCC_F77="$G77"
+ LD_F77="$LD"
+@@ -14151,8 +14308,8 @@ lt_prog_compiler_wl_F77=
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_static_F77=
+
+-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_F77='-Wl,'
+@@ -14383,18 +14540,18 @@ echo $ECHO_N "checking for $compiler opt
+ esac
+ fi
+
+-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
++$as_echo "$lt_prog_compiler_pic_F77" >&6; }
+
+ #
+ # Check to make sure the PIC flag actually works.
+ #
+ if test -n "$lt_prog_compiler_pic_F77"; then
+
+-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
++$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
+ if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_pic_works_F77=no
+ ac_outfile=conftest.$ac_objext
+@@ -14409,11 +14566,11 @@ else
+ -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:14412: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:14569: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:14416: \$? = $ac_status" >&5
++ echo "$as_me:14573: \$? = $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.
+@@ -14426,8 +14583,8 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
++$as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; }
+
+ if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+@@ -14454,10 +14611,10 @@ esac
+ # Check to make sure the static flag actually works.
+ #
+ wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_F77+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_static_works_F77=no
+ save_LDFLAGS="$LDFLAGS"
+@@ -14482,8 +14639,8 @@ else
+ LDFLAGS="$save_LDFLAGS"
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
++$as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; }
+
+ if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
+ :
+@@ -14492,10 +14649,10 @@ else
+ fi
+
+
+-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_F77+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_c_o_F77=no
+ $rm -r conftest 2>/dev/null
+@@ -14513,11 +14670,11 @@ else
+ -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:14516: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:14673: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:14520: \$? = $ac_status" >&5
++ echo "$as_me:14677: \$? = $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
+@@ -14539,34 +14696,34 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
++$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+ hard_links="nottested"
+ if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: result: $hard_links" >&5
+-echo "${ECHO_T}$hard_links" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
++$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
++ { $as_echo "$as_me:$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
+
+-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_F77=
+@@ -14778,13 +14935,12 @@ EOF
+ $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
+- link_all_deplibs_F77=no
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+@@ -14987,18 +15143,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -15013,12 +15172,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -15043,18 +15203,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -15069,12 +15232,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -15307,7 +15471,7 @@ if test -z "$aix_libpath"; then aix_libp
+ link_all_deplibs_F77=yes
+ ;;
+
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+@@ -15526,8 +15690,8 @@ if test -z "$aix_libpath"; then aix_libp
+ esac
+ fi
+
+-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
++$as_echo "$ld_shlibs_F77" >&6; }
+ test "$ld_shlibs_F77" = no && can_build_shared=no
+
+ #
+@@ -15547,15 +15711,15 @@ x|xyes)
+ # 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.
+- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
++$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+@@ -15573,7 +15737,7 @@ echo $ECHO_N "checking whether -lc shoul
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_F77=no
+@@ -15585,16 +15749,16 @@ echo $ECHO_N "checking whether -lc shoul
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
++$as_echo "$archive_cmds_need_lc_F77" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+ esac
+
+-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
++$as_echo_n "checking dynamic linker characteristics... " >&6; }
+ library_names_spec=
+ libname_spec='lib$name'
+ soname_spec=
+@@ -15966,18 +16130,6 @@ linux* | k*bsd*-gnu)
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+-netbsdelf*-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
+- shlibpath_overrides_runpath=no
+- hardcode_into_libs=yes
+- dynamic_linker='NetBSD ld.elf_so'
+- ;;
+-
+ netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+@@ -16155,19 +16307,19 @@ uts4*)
+ dynamic_linker=no
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+-echo "${ECHO_T}$dynamic_linker" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
++$as_echo "$dynamic_linker" >&6; }
+ test "$dynamic_linker" = no && can_build_shared=no
+
+ if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+ fi
+
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+ if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+ fi
+@@ -16179,8 +16331,8 @@ if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+ fi
+
+-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
++$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+ hardcode_action_F77=
+ if test -n "$hardcode_libdir_flag_spec_F77" || \
+ test -n "$runpath_var_F77" || \
+@@ -16204,8 +16356,8 @@ else
+ # directories.
+ hardcode_action_F77=unsupported
+ fi
+-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+-echo "${ECHO_T}$hardcode_action_F77" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
++$as_echo "$hardcode_action_F77" >&6; }
+
+ if test "$hardcode_action_F77" = relink; then
+ # Fast installation is not supported
+@@ -16715,10 +16867,10 @@ if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+@@ -16733,11 +16885,11 @@ else
+ -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:16736: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:16888: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:16740: \$? = $ac_status" >&5
++ echo "$as_me:16892: \$? = $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.
+@@ -16750,8 +16902,8 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
++{ $as_echo "$as_me:$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_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+@@ -16765,8 +16917,8 @@ lt_prog_compiler_wl_GCJ=
+ lt_prog_compiler_pic_GCJ=
+ lt_prog_compiler_static_GCJ=
+
+-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_GCJ='-Wl,'
+@@ -16997,18 +17149,18 @@ echo $ECHO_N "checking for $compiler opt
+ esac
+ fi
+
+-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
++$as_echo "$lt_prog_compiler_pic_GCJ" >&6; }
+
+ #
+ # Check to make sure the PIC flag actually works.
+ #
+ if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
++$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; }
+ if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_pic_works_GCJ=no
+ ac_outfile=conftest.$ac_objext
+@@ -17023,11 +17175,11 @@ else
+ -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:17026: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:17178: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+- echo "$as_me:17030: \$? = $ac_status" >&5
++ echo "$as_me:17182: \$? = $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.
+@@ -17040,8 +17192,8 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
++$as_echo "$lt_cv_prog_compiler_pic_works_GCJ" >&6; }
+
+ if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
+ case $lt_prog_compiler_pic_GCJ in
+@@ -17068,10 +17220,10 @@ esac
+ # Check to make sure the static flag actually works.
+ #
+ wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_GCJ+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_static_works_GCJ=no
+ save_LDFLAGS="$LDFLAGS"
+@@ -17096,8 +17248,8 @@ else
+ LDFLAGS="$save_LDFLAGS"
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
++$as_echo "$lt_cv_prog_compiler_static_works_GCJ" >&6; }
+
+ if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
+ :
+@@ -17106,10 +17258,10 @@ else
+ fi
+
+
+-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_GCJ+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_prog_compiler_c_o_GCJ=no
+ $rm -r conftest 2>/dev/null
+@@ -17127,11 +17279,11 @@ else
+ -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:17130: $lt_compile\"" >&5)
++ (eval echo "\"\$as_me:17282: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+- echo "$as_me:17134: \$? = $ac_status" >&5
++ echo "$as_me:17286: \$? = $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
+@@ -17153,34 +17305,34 @@ else
+ $rm conftest*
+
+ fi
+-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
++$as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; }
+
+
+ hard_links="nottested"
+ if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+- { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$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
+- { echo "$as_me:$LINENO: result: $hard_links" >&5
+-echo "${ECHO_T}$hard_links" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
++$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+- { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
++ { $as_echo "$as_me:$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
+
+-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$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_GCJ=
+@@ -17392,13 +17544,12 @@ EOF
+ $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
+- link_all_deplibs_GCJ=no
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+@@ -17611,18 +17762,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -17637,12 +17791,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -17677,18 +17832,21 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+@@ -17703,12 +17861,13 @@ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+@@ -17941,7 +18100,7 @@ if test -z "$aix_libpath"; then aix_libp
+ link_all_deplibs_GCJ=yes
+ ;;
+
+- netbsd* | netbsdelf*-gnu)
++ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+@@ -18160,8 +18319,8 @@ if test -z "$aix_libpath"; then aix_libp
+ esac
+ fi
+
+-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
++$as_echo "$ld_shlibs_GCJ" >&6; }
+ test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+ #
+@@ -18181,15 +18340,15 @@ x|xyes)
+ # 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.
+- { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
++ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
++$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+@@ -18207,7 +18366,7 @@ echo $ECHO_N "checking whether -lc shoul
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_GCJ=no
+@@ -18219,16 +18378,16 @@ echo $ECHO_N "checking whether -lc shoul
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+- { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
++ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
++$as_echo "$archive_cmds_need_lc_GCJ" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+ esac
+
+-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
++$as_echo_n "checking dynamic linker characteristics... " >&6; }
+ library_names_spec=
+ libname_spec='lib$name'
+ soname_spec=
+@@ -18600,18 +18759,6 @@ linux* | k*bsd*-gnu)
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+-netbsdelf*-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
+- shlibpath_overrides_runpath=no
+- hardcode_into_libs=yes
+- dynamic_linker='NetBSD ld.elf_so'
+- ;;
+-
+ netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+@@ -18789,19 +18936,19 @@ uts4*)
+ dynamic_linker=no
+ ;;
+ esac
+-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+-echo "${ECHO_T}$dynamic_linker" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
++$as_echo "$dynamic_linker" >&6; }
+ test "$dynamic_linker" = no && can_build_shared=no
+
+ if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+ fi
+
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+ if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+ fi
+@@ -18813,8 +18960,8 @@ if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+ fi
+
+-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
++{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
++$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+ hardcode_action_GCJ=
+ if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+ test -n "$runpath_var_GCJ" || \
+@@ -18838,8 +18985,8 @@ else
+ # directories.
+ hardcode_action_GCJ=unsupported
+ fi
+-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
++{ $as_echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
++$as_echo "$hardcode_action_GCJ" >&6; }
+
+ if test "$hardcode_action_GCJ" = relink; then
+ # Fast installation is not supported
+@@ -19762,8 +19909,8 @@ CC="$lt_save_CC"
+ ;;
+
+ *)
+- { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
++$as_echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+@@ -19782,8 +19929,8 @@ echo "$as_me: error: Unsupported tag nam
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+- { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
++ { { $as_echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
++$as_echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+@@ -19823,11 +19970,11 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtoo
+
+ for ac_func in strndup
+ do
+-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
++as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
++{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
++$as_echo_n "checking for $ac_func... " >&6; }
+ if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
++ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+@@ -19880,35 +20027,41 @@ case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+ esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
++eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+- } && test -s conftest$ac_exeext &&
+- $as_test_x conftest$ac_exeext; then
++ } && test -s conftest$ac_exeext && {
++ test "$cross_compiling" = yes ||
++ $as_test_x conftest$ac_exeext
++ }; then
+ eval "$as_ac_var=yes"
+ else
+- echo "$as_me: failed program was:" >&5
++ $as_echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+ fi
+
++rm -rf conftest.dSYM
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ fi
+-ac_res=`eval echo '${'$as_ac_var'}'`
+- { echo "$as_me:$LINENO: result: $ac_res" >&5
+-echo "${ECHO_T}$ac_res" >&6; }
+-if test `eval echo '${'$as_ac_var'}'` = yes; then
++ac_res=`eval 'as_val=${'$as_ac_var'}
++ $as_echo "$as_val"'`
++ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
++$as_echo "$ac_res" >&6; }
++if test `eval 'as_val=${'$as_ac_var'}
++ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+ _ACEOF
+
+ fi
+@@ -19944,11 +20097,12 @@ _ACEOF
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
++ *_cv_*) { $as_echo "$as_me:$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= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+@@ -19981,12 +20135,12 @@ echo "$as_me: WARNING: Cache variable $a
+ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+-echo "$as_me: updating cache $cache_file" >&6;}
++ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
++$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
++ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
++$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+ fi
+ rm -f confcache
+@@ -20003,6 +20157,12 @@ test "x$exec_prefix" = xNONE && exec_pre
+ # take arguments), then branch to the quote section. Otherwise,
+ # look for a macro that doesn't take arguments.
+ ac_script='
++:mline
++/\\$/{
++ N
++ s,\\\n,,
++ b mline
++}
+ t clear
+ :clear
+ s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+@@ -20032,7 +20192,7 @@ 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=`echo "$ac_i" | sed "$ac_script"`
++ 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.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+@@ -20044,33 +20204,34 @@ LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+- { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
++ { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+-echo "$as_me: error: conditional \"AMDEP\" was never defined.
++$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
++ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
++$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+- { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
++ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
++$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ : ${CONFIG_STATUS=./config.status}
++ac_write_fail=0
+ ac_clean_files_save=$ac_clean_files
+ ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+-echo "$as_me: creating $CONFIG_STATUS" >&6;}
+-cat >$CONFIG_STATUS <<_ACEOF
++{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
++$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
++cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ #! $SHELL
+ # Generated by $as_me.
+ # Run this file to recreate the current configuration.
+@@ -20083,7 +20244,7 @@ ac_cs_silent=false
+ SHELL=\${CONFIG_SHELL-$SHELL}
+ _ACEOF
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ ## --------------------- ##
+ ## M4sh Initialization. ##
+ ## --------------------- ##
+@@ -20093,7 +20254,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # 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
+@@ -20115,17 +20276,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE
+ as_cr_digits='0123456789'
+ as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+-# The user is always right.
+-if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
+- echo "exit 0" >>conf$$.sh
+- chmod +x conf$$.sh
+- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+- PATH_SEPARATOR=';'
++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
++if (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
+- PATH_SEPARATOR=:
++ 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
+- rm -f conf$$.sh
++ 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
+
+ # Support unset when possible.
+@@ -20141,8 +20330,6 @@ fi
+ # 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.)
+-as_nl='
+-'
+ IFS=" "" $as_nl"
+
+ # Find who we are. Look in the path if we contain no directory separator.
+@@ -20165,7 +20352,7 @@ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+ fi
+
+@@ -20178,17 +20365,10 @@ PS2='> '
+ PS4='+ '
+
+ # NLS nuisances.
+-for as_var in \
+- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+- LC_TELEPHONE LC_TIME
+-do
+- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+- eval $as_var=C; export $as_var
+- else
+- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+- fi
+-done
++LC_ALL=C
++export LC_ALL
++LANGUAGE=C
++export LANGUAGE
+
+ # Required to use basename.
+ if expr a : '\(a\)' >/dev/null 2>&1 &&
+@@ -20210,7 +20390,7 @@ as_me=`$as_basename -- "$0" ||
+ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+-echo X/"$0" |
++$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+@@ -20261,7 +20441,7 @@ $as_unset CDPATH
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+@@ -20289,7 +20469,6 @@ case `echo -n x` in
+ *)
+ ECHO_N='-n';;
+ esac
+-
+ if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+@@ -20302,19 +20481,22 @@ if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+ else
+ rm -f conf$$.dir
+- mkdir conf$$.dir
++ mkdir conf$$.dir 2>/dev/null
+ fi
+-echo >conf$$.file
+-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 ||
++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'
+-elif ln conf$$.file conf$$ 2>/dev/null; then
+- as_ln_s=ln
++ fi
+ else
+ as_ln_s='cp -p'
+ fi
+@@ -20339,10 +20521,10 @@ else
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+- test -d "$1/.";
++ test -d "$1/.";
+ else
+ case $1 in
+- -*)set "./$1";;
++ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+@@ -20365,7 +20547,7 @@ exec 6>&1
+ # values after options handling.
+ ac_log="
+ This file was extended by $as_me, which was
+-generated by GNU Autoconf 2.61. Invocation command line was
++generated by GNU Autoconf 2.62. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+@@ -20378,14 +20560,14 @@ on `(hostname || uname -n) 2>/dev/null |
+
+ _ACEOF
+
+-cat >>$CONFIG_STATUS <<_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ # Files that config.status was made for.
+ config_files="$ac_config_files"
+ config_commands="$ac_config_commands"
+
+ _ACEOF
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ ac_cs_usage="\
+ \`$as_me' instantiates files from templates according to the
+ current configuration.
+@@ -20398,7 +20580,7 @@ Usage: $0 [OPTIONS] [FILE]...
+ -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
++ instantiate the configuration file FILE
+
+ Configuration files:
+ $config_files
+@@ -20409,25 +20591,25 @@ $config_commands
+ Report bugs to <bug-autoconf@gnu.org>."
+
+ _ACEOF
+-cat >>$CONFIG_STATUS <<_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_cs_version="\\
+ config.status
+-configured by $0, generated by GNU Autoconf 2.61,
+- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
++configured by $0, generated by GNU Autoconf 2.62,
++ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+-Copyright (C) 2006 Free Software Foundation, Inc.
++Copyright (C) 2008 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
+-# If no file are specified by the user, then we need to provide default
+-# value. By we need to know if files were specified by the user.
++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
+@@ -20449,21 +20631,24 @@ do
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+- echo "$ac_cs_version"; exit ;;
++ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
++ case $ac_optarg in
++ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ esac
++ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+- echo "$ac_cs_usage"; exit ;;
++ $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.
+- -*) { echo "$as_me: error: unrecognized option: $1
++ -*) { $as_echo "$as_me: error: unrecognized option: $1
+ Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+@@ -20482,27 +20667,29 @@ if $ac_cs_silent; then
+ fi
+
+ _ACEOF
+-cat >>$CONFIG_STATUS <<_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ if \$ac_cs_recheck; then
+- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+- CONFIG_SHELL=$SHELL
++ 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 $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
++ exec "\$@"
+ fi
+
+ _ACEOF
+-cat >>$CONFIG_STATUS <<\_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
+- echo "$ac_log"
++ $as_echo "$ac_log"
+ } >&5
+
+ _ACEOF
+-cat >>$CONFIG_STATUS <<_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ #
+ # INIT-COMMANDS
+ #
+@@ -20510,7 +20697,7 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac
+
+ _ACEOF
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+ # Handling of arguments.
+ for ac_config_target in $ac_config_targets
+@@ -20519,8 +20706,8 @@ do
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
++ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
++$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ done
+@@ -20560,213 +20747,143 @@ $debug ||
+ (umask 077 && mkdir "$tmp")
+ } ||
+ {
+- echo "$me: cannot create a temporary directory in ." >&2
++ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+ }
+
+-#
+-# Set up the sed scripts for CONFIG_FILES section.
+-#
+-
+-# No need to generate the scripts if there are no CONFIG_FILES.
+-# This happens for instance when ./config.status config.h
++# 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
+
+-_ACEOF
+-
+-
+
+-ac_delim='%!_!# '
+-for ac_last_try in false false false false false :; do
+- cat >conf$$subs.sed <<_ACEOF
+-SHELL!$SHELL$ac_delim
+-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+-exec_prefix!$exec_prefix$ac_delim
+-prefix!$prefix$ac_delim
+-program_transform_name!$program_transform_name$ac_delim
+-bindir!$bindir$ac_delim
+-sbindir!$sbindir$ac_delim
+-libexecdir!$libexecdir$ac_delim
+-datarootdir!$datarootdir$ac_delim
+-datadir!$datadir$ac_delim
+-sysconfdir!$sysconfdir$ac_delim
+-sharedstatedir!$sharedstatedir$ac_delim
+-localstatedir!$localstatedir$ac_delim
+-includedir!$includedir$ac_delim
+-oldincludedir!$oldincludedir$ac_delim
+-docdir!$docdir$ac_delim
+-infodir!$infodir$ac_delim
+-htmldir!$htmldir$ac_delim
+-dvidir!$dvidir$ac_delim
+-pdfdir!$pdfdir$ac_delim
+-psdir!$psdir$ac_delim
+-libdir!$libdir$ac_delim
+-localedir!$localedir$ac_delim
+-mandir!$mandir$ac_delim
+-DEFS!$DEFS$ac_delim
+-ECHO_C!$ECHO_C$ac_delim
+-ECHO_N!$ECHO_N$ac_delim
+-ECHO_T!$ECHO_T$ac_delim
+-LIBS!$LIBS$ac_delim
+-build_alias!$build_alias$ac_delim
+-host_alias!$host_alias$ac_delim
+-target_alias!$target_alias$ac_delim
+-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+-INSTALL_DATA!$INSTALL_DATA$ac_delim
+-am__isrc!$am__isrc$ac_delim
+-CYGPATH_W!$CYGPATH_W$ac_delim
+-PACKAGE!$PACKAGE$ac_delim
+-VERSION!$VERSION$ac_delim
+-ACLOCAL!$ACLOCAL$ac_delim
+-AUTOCONF!$AUTOCONF$ac_delim
+-AUTOMAKE!$AUTOMAKE$ac_delim
+-AUTOHEADER!$AUTOHEADER$ac_delim
+-MAKEINFO!$MAKEINFO$ac_delim
+-install_sh!$install_sh$ac_delim
+-STRIP!$STRIP$ac_delim
+-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+-mkdir_p!$mkdir_p$ac_delim
+-AWK!$AWK$ac_delim
+-SET_MAKE!$SET_MAKE$ac_delim
+-am__leading_dot!$am__leading_dot$ac_delim
+-AMTAR!$AMTAR$ac_delim
+-am__tar!$am__tar$ac_delim
+-am__untar!$am__untar$ac_delim
+-CC!$CC$ac_delim
+-CFLAGS!$CFLAGS$ac_delim
+-LDFLAGS!$LDFLAGS$ac_delim
+-CPPFLAGS!$CPPFLAGS$ac_delim
+-ac_ct_CC!$ac_ct_CC$ac_delim
+-EXEEXT!$EXEEXT$ac_delim
+-OBJEXT!$OBJEXT$ac_delim
+-DEPDIR!$DEPDIR$ac_delim
+-am__include!$am__include$ac_delim
+-am__quote!$am__quote$ac_delim
+-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+-CCDEPMODE!$CCDEPMODE$ac_delim
+-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+-build!$build$ac_delim
+-build_cpu!$build_cpu$ac_delim
+-build_vendor!$build_vendor$ac_delim
+-build_os!$build_os$ac_delim
+-host!$host$ac_delim
+-host_cpu!$host_cpu$ac_delim
+-host_vendor!$host_vendor$ac_delim
+-host_os!$host_os$ac_delim
+-SED!$SED$ac_delim
+-GREP!$GREP$ac_delim
+-EGREP!$EGREP$ac_delim
+-LN_S!$LN_S$ac_delim
+-ECHO!$ECHO$ac_delim
+-AR!$AR$ac_delim
+-RANLIB!$RANLIB$ac_delim
+-DSYMUTIL!$DSYMUTIL$ac_delim
+-NMEDIT!$NMEDIT$ac_delim
+-CPP!$CPP$ac_delim
+-CXX!$CXX$ac_delim
+-CXXFLAGS!$CXXFLAGS$ac_delim
+-ac_ct_CXX!$ac_ct_CXX$ac_delim
+-CXXDEPMODE!$CXXDEPMODE$ac_delim
+-_ACEOF
+-
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+- break
+- elif $ac_last_try; then
+- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+- { (exit 1); exit 1; }; }
+- else
+- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+- fi
+-done
+-
+-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+-if test -n "$ac_eof"; then
+- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+- ac_eof=`expr $ac_eof + 1`
++ac_cr=' '
++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
+
+-cat >>$CONFIG_STATUS <<_ACEOF
+-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+-_ACEOF
+-sed '
+-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+-s/^/s,@/; s/!/@,|#_!!_#|/
+-:n
+-t n
+-s/'"$ac_delim"'$/,g/; t
+-s/$/\\/; p
+-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+-' >>$CONFIG_STATUS <conf$$subs.sed
+-rm -f conf$$subs.sed
+-cat >>$CONFIG_STATUS <<_ACEOF
+-CEOF$ac_eof
++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_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
++ { (exit 1); exit 1; }; }
++ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ ac_delim='%!_!# '
+ for ac_last_try in false false false false false :; do
+- cat >conf$$subs.sed <<_ACEOF
+-am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
+-am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
+-CXXCPP!$CXXCPP$ac_delim
+-F77!$F77$ac_delim
+-FFLAGS!$FFLAGS$ac_delim
+-ac_ct_F77!$ac_ct_F77$ac_delim
+-LIBTOOL!$LIBTOOL$ac_delim
+-SO_VERSION!$SO_VERSION$ac_delim
+-LIBOBJS!$LIBOBJS$ac_delim
+-LTLIBOBJS!$LTLIBOBJS$ac_delim
+-_ACEOF
++ . ./conf$$subs.sh ||
++ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
++ { (exit 1); exit 1; }; }
+
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 10; then
++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+ done
++rm -f conf$$subs.sh
+
+-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+-if test -n "$ac_eof"; then
+- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+- ac_eof=`expr $ac_eof + 1`
+-fi
++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 = ""
+
+-cat >>$CONFIG_STATUS <<_ACEOF
+-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
++}
++{
++ 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
+-sed '
+-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+-s/^/s,@/; s/!/@,|#_!!_#|/
+-:n
+-t n
+-s/'"$ac_delim"'$/,g/; t
+-s/$/\\/; p
+-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+-' >>$CONFIG_STATUS <conf$$subs.sed
+-rm -f conf$$subs.sed
+-cat >>$CONFIG_STATUS <<_ACEOF
+-:end
+-s/|#_!!_#|//g
+-CEOF$ac_eof
++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_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
++$as_echo "$as_me: error: could not setup config files machinery" >&2;}
++ { (exit 1); exit 1; }; }
+ _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
+@@ -20782,19 +20899,21 @@ s/^[^=]*=[ ]*$//
+ }'
+ fi
+
+-cat >>$CONFIG_STATUS <<\_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ fi # test -n "$CONFIG_FILES"
+
+
+-for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS
++eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
++shift
++for ac_tag
+ do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
++ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
++$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+@@ -20823,26 +20942,38 @@ echo "$as_me: error: Invalid tag $ac_tag
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
++ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
++$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+- ac_file_inputs="$ac_file_inputs $ac_f"
++ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
++ ac_file_inputs="$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 "`IFS=:
+- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
++ 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"
+- { echo "$as_me:$LINENO: creating $ac_file" >&5
+-echo "$as_me: creating $ac_file" >&6;}
++ { $as_echo "$as_me:$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";;
++ *:-:* | *:-) cat >"$tmp/stdin" \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
++ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+@@ -20852,7 +20983,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+-echo X"$ac_file" |
++$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+@@ -20878,7 +21009,7 @@ echo X"$ac_file" |
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+@@ -20887,7 +21018,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+-echo X"$as_dir" |
++$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+@@ -20908,17 +21039,17 @@ echo X"$as_dir" |
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+-echo "$as_me: error: cannot create directory $as_dir" >&2;}
++ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
++$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+ case "$ac_dir" in
+ .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *)
+- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
++ 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/ ;;
+@@ -20956,19 +21087,15 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
+ [\\/$]* | ?:[\\/]* ) 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
++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=
+
+-case `sed -n '/datarootdir/ {
++ac_sed_dataroot='
++/datarootdir/ {
+ p
+ q
+ }
+@@ -20977,13 +21104,14 @@ case `sed -n '/datarootdir/ {
+ /@infodir@/p
+ /@localedir@/p
+ /@mandir@/p
+-' $ac_file_inputs` in
++'
++case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+ *datarootdir*) ac_datarootdir_seen=yes;;
+ *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
++ { $as_echo "$as_me:$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
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+@@ -20997,15 +21125,16 @@ _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
+- sed "$ac_vpsub
++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
++ac_sed_extra="$ac_vpsub
+ $extrasub
+ _ACEOF
+-cat >>$CONFIG_STATUS <<\_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ :t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+-s&@configure_input@&$configure_input&;t t
++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
+@@ -21014,28 +21143,34 @@ 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
+-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
++"
++eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
++ { (exit 1); exit 1; }; }
+
+ 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"; } &&
+- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
++ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+ which seems to be undefined. Please make sure it is defined." >&5
+-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
++$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
++ -) cat "$tmp/out" && rm -f "$tmp/out";;
++ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
++ esac \
++ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
++$as_echo "$as_me: error: could not create $ac_file" >&2;}
++ { (exit 1); exit 1; }; }
+ ;;
+
+
+- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+-echo "$as_me: executing $ac_file commands" >&6;}
++ :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
++$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+@@ -21049,15 +21184,14 @@ echo "$as_me: executing $ac_file command
+ # 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
++ # So let's grep whole file.
++ if grep '^#.*generated by automake' $mf > /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 ||
+-echo X"$mf" |
++$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+@@ -21101,7 +21235,7 @@ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+-echo X"$file" |
++$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+@@ -21127,7 +21261,7 @@ echo X"$file" |
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+@@ -21136,7 +21270,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+-echo X"$as_dir" |
++$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+@@ -21157,8 +21291,8 @@ echo X"$as_dir" |
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+-echo "$as_me: error: cannot create directory $as_dir" >&2;}
++ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
++$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+@@ -21175,6 +21309,11 @@ _ACEOF
+ chmod +x $CONFIG_STATUS
+ ac_clean_files=$ac_clean_files_save
+
++test $ac_write_fail = 0 ||
++ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
++$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
++ { (exit 1); exit 1; }; }
++
+
+ # configure is writing to config.log, and then calls config.status.
+ # config.status does its own redirection, appending to config.log.
+@@ -21196,4 +21335,8 @@ if test "$no_create" != yes; then
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+ fi
++if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
++ { $as_echo "$as_me:$LINENO: WARNING: Unrecognized options: $ac_unrecognized_opts" >&5
++$as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;}
++fi
+
diff --git a/package/cgilib/patches/patch-depcomp b/package/cgilib/patches/patch-depcomp
new file mode 100644
index 000000000..236d65f31
--- /dev/null
+++ b/package/cgilib/patches/patch-depcomp
@@ -0,0 +1,153 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/depcomp 2009-02-08 19:47:04.000000000 +0100
++++ cgilib-0.7/depcomp 2009-05-09 03:58:09.000000000 +0200
+@@ -1,10 +1,9 @@
+ #! /bin/sh
+ # depcomp - compile a program generating dependencies as side-effects
+
+-scriptversion=2007-03-29.01
++scriptversion=2005-07-09.11
+
+-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
+-# Foundation, Inc.
++# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -92,20 +91,7 @@ gcc3)
+ ## gcc 3 implements dependency tracking that does exactly what
+ ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+ ## it if -MD -MP comes after the -MF stuff. Hmm.
+-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+-## the command line argument order; so add the flags where they
+-## appear in depend2.am. Note that the slowdown incurred here
+-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+- for arg
+- do
+- case $arg in
+- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+- *) set fnord "$@" "$arg" ;;
+- esac
+- shift # fnord
+- shift # $arg
+- done
+- "$@"
++ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+@@ -215,39 +201,34 @@ 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$//'`
++ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
++ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+- tmpdepfile1=$dir$base.u
+- tmpdepfile2=$base.u
+- tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+- tmpdepfile1=$dir$base.u
+- tmpdepfile2=$dir$base.u
+- tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+
++ if test -f "$tmpdepfile"; then :
++ else
++ stripped=`echo "$stripped" | sed 's,^.*/,,'`
++ tmpdepfile="$stripped.u"
++ fi
++
+ if test $stat -eq 0; then :
+ else
+- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
++ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+- do
+- test -f "$tmpdepfile" && break
+- done
+ if test -f "$tmpdepfile"; then
++ outname="$stripped.o"
+ # 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"
+- # That's a tab and a space in the [].
+- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
++ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
++ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+@@ -295,46 +276,6 @@ icc)
+ rm -f "$tmpdepfile"
+ ;;
+
+-hp2)
+- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+- # compilers, which have integrated preprocessors. The correct option
+- # to use with these is +Maked; it writes dependencies to a file named
+- # '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$//'`
+- if test "$libtool" = yes; then
+- tmpdepfile1=$dir$base.d
+- tmpdepfile2=$dir.libs/$base.d
+- "$@" -Wc,+Maked
+- else
+- tmpdepfile1=$dir$base.d
+- tmpdepfile2=$dir$base.d
+- "$@" +Maked
+- fi
+- stat=$?
+- if test $stat -eq 0; then :
+- else
+- rm -f "$tmpdepfile1" "$tmpdepfile2"
+- exit $stat
+- fi
+-
+- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+- do
+- test -f "$tmpdepfile" && break
+- done
+- if test -f "$tmpdepfile"; then
+- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+- # Add `dependent.h:' lines.
+- sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+- else
+- echo "#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'.
+@@ -347,13 +288,13 @@ tru64)
+
+ 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
++ # static library. This mecanism 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
++ # compilations output dependencies in 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
diff --git a/package/cgilib/patches/patch-install-sh b/package/cgilib/patches/patch-install-sh
new file mode 100644
index 000000000..a4ebbb915
--- /dev/null
+++ b/package/cgilib/patches/patch-install-sh
@@ -0,0 +1,641 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/install-sh 2009-02-08 19:47:04.000000000 +0100
++++ cgilib-0.7/install-sh 2009-05-09 03:58:09.000000000 +0200
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # install - install a program, script, or datafile
+
+-scriptversion=2006-12-25.00
++scriptversion=2005-05-14.22
+
+ # This originates from X11R5 (mit/util/scripts/install.sh), which was
+ # later released in X11R6 (xc/config/util/install.sh) with the
+@@ -39,68 +39,38 @@ scriptversion=2006-12-25.00
+ # when there is no Makefile.
+ #
+ # This script is compatible with the BSD install script, but was written
+-# from scratch.
+-
+-nl='
+-'
+-IFS=" "" $nl"
++# from scratch. It can only install one file at a time, a restriction
++# shared with many OS's install programs.
+
+ # set DOITPROG to echo to test this script
+
+ # Don't use :- since 4.3BSD and earlier shells don't like it.
+-doit=${DOITPROG-}
+-if test -z "$doit"; then
+- doit_exec=exec
+-else
+- doit_exec=$doit
+-fi
+-
+-# Put in absolute file names if you don't have them in your path;
+-# or use environment vars.
+-
+-chgrpprog=${CHGRPPROG-chgrp}
+-chmodprog=${CHMODPROG-chmod}
+-chownprog=${CHOWNPROG-chown}
+-cmpprog=${CMPPROG-cmp}
+-cpprog=${CPPROG-cp}
+-mkdirprog=${MKDIRPROG-mkdir}
+-mvprog=${MVPROG-mv}
+-rmprog=${RMPROG-rm}
+-stripprog=${STRIPPROG-strip}
+-
+-posix_glob='?'
+-initialize_posix_glob='
+- test "$posix_glob" != "?" || {
+- if (set -f) 2>/dev/null; then
+- posix_glob=
+- else
+- posix_glob=:
+- fi
+- }
+-'
++doit="${DOITPROG-}"
+
+-posix_mkdir=
++# put in absolute paths if you don't have them in your path; or use env. vars.
+
+-# Desired mode of installed file.
+-mode=0755
++mvprog="${MVPROG-mv}"
++cpprog="${CPPROG-cp}"
++chmodprog="${CHMODPROG-chmod}"
++chownprog="${CHOWNPROG-chown}"
++chgrpprog="${CHGRPPROG-chgrp}"
++stripprog="${STRIPPROG-strip}"
++rmprog="${RMPROG-rm}"
++mkdirprog="${MKDIRPROG-mkdir}"
+
+-chgrpcmd=
+-chmodcmd=$chmodprog
++chmodcmd="$chmodprog 0755"
+ chowncmd=
+-mvcmd=$mvprog
+-rmcmd="$rmprog -f"
++chgrpcmd=
+ stripcmd=
+-
++rmcmd="$rmprog -f"
++mvcmd="$mvprog"
+ src=
+ dst=
+ dir_arg=
+-dst_arg=
+-
+-copy_on_change=false
++dstarg=
+ no_target_directory=
+
+-usage="\
+-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
++usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+@@ -110,86 +80,81 @@ In the 2nd and 3rd, copy all SRCFILES to
+ In the 4th, create DIRECTORIES.
+
+ Options:
+- --help display this help and exit.
+- --version display version info and exit.
+-
+- -c (ignored)
+- -C install only if different (preserve the last data modification time)
+- -d create directories instead of installing files.
+- -g GROUP $chgrpprog installed files to GROUP.
+- -m MODE $chmodprog installed files to MODE.
+- -o USER $chownprog installed files to USER.
+- -s $stripprog installed files.
+- -t DIRECTORY install into DIRECTORY.
+- -T report an error if DSTFILE is a directory.
++-c (ignored)
++-d create directories instead of installing files.
++-g GROUP $chgrpprog installed files to GROUP.
++-m MODE $chmodprog installed files to MODE.
++-o USER $chownprog installed files to USER.
++-s $stripprog installed files.
++-t DIRECTORY install into DIRECTORY.
++-T report an error if DSTFILE is a directory.
++--help display this help and exit.
++--version display version info and exit.
+
+ Environment variables override the default commands:
+- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+- RMPROG STRIPPROG
++ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+ "
+
+-while test $# -ne 0; do
++while test -n "$1"; do
+ case $1 in
+- -c) ;;
+-
+- -C) copy_on_change=true;;
++ -c) shift
++ continue;;
+
+- -d) dir_arg=true;;
++ -d) dir_arg=true
++ shift
++ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+- shift;;
++ shift
++ shift
++ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+- -m) mode=$2
+- case $mode in
+- *' '* | *' '* | *'
+-'* | *'*'* | *'?'* | *'['*)
+- echo "$0: invalid mode: $mode" >&2
+- exit 1;;
+- esac
+- shift;;
++ -m) chmodcmd="$chmodprog $2"
++ shift
++ shift
++ continue;;
+
+ -o) chowncmd="$chownprog $2"
+- shift;;
++ shift
++ shift
++ continue;;
+
+- -s) stripcmd=$stripprog;;
++ -s) stripcmd=$stripprog
++ shift
++ continue;;
+
+- -t) dst_arg=$2
+- shift;;
++ -t) dstarg=$2
++ shift
++ shift
++ continue;;
+
+- -T) no_target_directory=true;;
++ -T) no_target_directory=true
++ shift
++ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+- --) shift
++ *) # When -d is used, all remaining arguments are directories to create.
++ # When -t is used, the destination is already specified.
++ test -n "$dir_arg$dstarg" && break
++ # Otherwise, the last argument is the destination. Remove it from $@.
++ for arg
++ do
++ if test -n "$dstarg"; then
++ # $@ is not empty: it contains at least $arg.
++ set fnord "$@" "$dstarg"
++ shift # fnord
++ fi
++ shift # arg
++ dstarg=$arg
++ done
+ break;;
+-
+- -*) echo "$0: invalid option: $1" >&2
+- exit 1;;
+-
+- *) break;;
+ esac
+- shift
+ done
+
+-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+- # When -d is used, all remaining arguments are directories to create.
+- # When -t is used, the destination is already specified.
+- # Otherwise, the last argument is the destination. Remove it from $@.
+- for arg
+- do
+- if test -n "$dst_arg"; then
+- # $@ is not empty: it contains at least $arg.
+- set fnord "$@" "$dst_arg"
+- shift # fnord
+- fi
+- shift # arg
+- dst_arg=$arg
+- done
+-fi
+-
+-if test $# -eq 0; then
++if test -z "$1"; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+@@ -199,47 +164,24 @@ if test $# -eq 0; then
+ exit 0
+ fi
+
+-if test -z "$dir_arg"; then
+- trap '(exit $?); exit' 1 2 13 15
+-
+- # Set umask so as not to create temps with too-generous modes.
+- # However, 'strip' requires both read and write access to temps.
+- case $mode in
+- # Optimize common cases.
+- *644) cp_umask=133;;
+- *755) cp_umask=22;;
+-
+- *[0-7])
+- if test -z "$stripcmd"; then
+- u_plus_rw=
+- else
+- u_plus_rw='% 200'
+- fi
+- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+- *)
+- if test -z "$stripcmd"; then
+- u_plus_rw=
+- else
+- u_plus_rw=,u+rw
+- fi
+- cp_umask=$mode$u_plus_rw;;
+- esac
+-fi
+-
+ for src
+ do
+ # Protect names starting with `-'.
+ case $src in
+- -*) src=./$src;;
++ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+- dstdir=$dst
+- test -d "$dstdir"
+- dstdir_status=$?
+- else
++ src=
+
++ if test -d "$dst"; then
++ mkdircmd=:
++ chmodcmd=
++ else
++ mkdircmd=$mkdirprog
++ fi
++ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+@@ -248,199 +190,71 @@ do
+ exit 1
+ fi
+
+- if test -z "$dst_arg"; then
++ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+- dst=$dst_arg
++ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+- -*) dst=./$dst;;
++ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+- echo "$0: $dst_arg: Is a directory" >&2
++ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+- dstdir=$dst
+- dst=$dstdir/`basename "$src"`
+- dstdir_status=0
+- else
+- # Prefer dirname, but fall back on a substitute if dirname fails.
+- dstdir=`
+- (dirname "$dst") 2>/dev/null ||
+- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$dst" : 'X\(//\)[^/]' \| \
+- X"$dst" : 'X\(//\)$' \| \
+- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+- echo X"$dst" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+- s//\1/
+- q
+- }
+- /^X\(\/\/\)[^/].*/{
+- s//\1/
+- q
+- }
+- /^X\(\/\/\)$/{
+- s//\1/
+- q
+- }
+- /^X\(\/\).*/{
+- s//\1/
+- q
+- }
+- s/.*/./; q'
+- `
+-
+- test -d "$dstdir"
+- dstdir_status=$?
++ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+- obsolete_mkdir_used=false
+-
+- if test $dstdir_status != 0; then
+- case $posix_mkdir in
+- '')
+- # Create intermediate dirs using mode 755 as modified by the umask.
+- # This is like FreeBSD 'install' as of 1997-10-28.
+- umask=`umask`
+- case $stripcmd.$umask in
+- # Optimize common cases.
+- *[2367][2367]) mkdir_umask=$umask;;
+- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+-
+- *[0-7])
+- mkdir_umask=`expr $umask + 22 \
+- - $umask % 100 % 40 + $umask % 20 \
+- - $umask % 10 % 4 + $umask % 2
+- `;;
+- *) mkdir_umask=$umask,go-w;;
+- esac
+-
+- # With -d, create the new directory with the user-specified mode.
+- # Otherwise, rely on $mkdir_umask.
+- if test -n "$dir_arg"; then
+- mkdir_mode=-m$mode
+- else
+- mkdir_mode=
+- fi
+-
+- posix_mkdir=false
+- case $umask in
+- *[123567][0-7][0-7])
+- # POSIX mkdir -p sets u+wx bits regardless of umask, which
+- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+- ;;
+- *)
+- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+-
+- if (umask $mkdir_umask &&
+- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+- then
+- if test -z "$dir_arg" || {
+- # Check for POSIX incompatibilities with -m.
+- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+- # other-writeable bit of parent directory when it shouldn't.
+- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+- ls_ld_tmpdir=`ls -ld "$tmpdir"`
+- case $ls_ld_tmpdir in
+- d????-?r-*) different_mode=700;;
+- d????-?--*) different_mode=755;;
+- *) false;;
+- esac &&
+- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+- }
+- }
+- then posix_mkdir=:
+- fi
+- rmdir "$tmpdir/d" "$tmpdir"
+- else
+- # Remove any dirs left behind by ancient mkdir implementations.
+- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+- fi
+- trap '' 0;;
+- esac;;
+- esac
++ # This sed command emulates the dirname command.
++ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+- if
+- $posix_mkdir && (
+- umask $mkdir_umask &&
+- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+- )
+- then :
+- else
++ # Make sure that the destination directory exists.
+
+- # The umask is ridiculous, or mkdir does not conform to POSIX,
+- # or it failed possibly due to a race condition. Create the
+- # directory the slow way, step by step, checking for races as we go.
++ # Skip lots of stat calls in the usual case.
++ if test ! -d "$dstdir"; then
++ defaultIFS='
++ '
++ IFS="${IFS-$defaultIFS}"
+
+- case $dstdir in
+- /*) prefix='/';;
+- -*) prefix='./';;
+- *) prefix='';;
+- esac
++ oIFS=$IFS
++ # Some sh's can't handle IFS=/ for some reason.
++ IFS='%'
++ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
++ shift
++ IFS=$oIFS
+
+- eval "$initialize_posix_glob"
++ pathcomp=
+
+- oIFS=$IFS
+- IFS=/
+- $posix_glob set -f
+- set fnord $dstdir
++ while test $# -ne 0 ; do
++ pathcomp=$pathcomp$1
+ shift
+- $posix_glob set +f
+- IFS=$oIFS
+-
+- prefixes=
+-
+- for d
+- do
+- test -z "$d" && continue
+-
+- prefix=$prefix$d
+- if test -d "$prefix"; then
+- prefixes=
+- else
+- if $posix_mkdir; then
+- (umask=$mkdir_umask &&
+- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+- # Don't fail if two instances are running concurrently.
+- test -d "$prefix" || exit 1
+- else
+- case $prefix in
+- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+- *) qprefix=$prefix;;
+- esac
+- prefixes="$prefixes '$qprefix'"
+- fi
+- fi
+- prefix=$prefix/
+- done
+-
+- if test -n "$prefixes"; then
+- # Don't fail if two instances are running concurrently.
+- (umask $mkdir_umask &&
+- eval "\$doit_exec \$mkdirprog $prefixes") ||
+- test -d "$dstdir" || exit 1
+- obsolete_mkdir_used=true
++ if test ! -d "$pathcomp"; then
++ $mkdirprog "$pathcomp"
++ # mkdir can fail with a `File exist' error in case several
++ # install-sh are creating the directory concurrently. This
++ # is OK.
++ test -d "$pathcomp" || exit
+ fi
+- fi
++ pathcomp=$pathcomp/
++ done
+ fi
+
+ if test -n "$dir_arg"; then
+- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
++ $doit $mkdircmd "$dst" \
++ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
++ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
++ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
++ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
++
+ else
++ dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+@@ -448,9 +262,10 @@ do
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
++ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
++ $doit $cpprog "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+@@ -458,59 +273,48 @@ do
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+-
+- # If -C, don't bother to copy if it wouldn't change the file.
+- if $copy_on_change &&
+- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+-
+- eval "$initialize_posix_glob" &&
+- $posix_glob set -f &&
+- set X $old && old=:$2:$4:$5:$6 &&
+- set X $new && new=:$2:$4:$5:$6 &&
+- $posix_glob set +f &&
+-
+- test "$old" = "$new" &&
+- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+- then
+- rm -f "$dsttmp"
+- else
+- # Rename the file to the real destination.
+- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
++ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
++ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
++ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
++ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+- # The rename failed, perhaps because mv can't rename something else
+- # to itself, or perhaps because mv is so ancient that it does not
+- # support -f.
+- {
+- # Now remove or move aside any old file at destination location.
+- # We try this two ways since rm can't unlink itself on some
+- # systems and the destination file might be busy for other
+- # reasons. In this case, the final cleanup might fail but the new
+- # file should still install successfully.
+- {
+- test ! -f "$dst" ||
+- $doit $rmcmd -f "$dst" 2>/dev/null ||
+- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+- } ||
+- { echo "$0: cannot unlink or rename $dst" >&2
+- (exit 1); exit 1
+- }
+- } &&
++ # Now rename the file to the real destination.
++ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
++ || {
++ # The rename failed, perhaps because mv can't rename something else
++ # to itself, or perhaps because mv is so ancient that it does not
++ # support -f.
+
+- # Now rename the file to the real destination.
+- $doit $mvcmd "$dsttmp" "$dst"
+- }
+- fi || exit 1
++ # Now remove or move aside any old file at destination location.
++ # We try this two ways since rm can't unlink itself on some
++ # systems and the destination file might be busy for other
++ # reasons. In this case, the final cleanup might fail but the new
++ # file should still install successfully.
++ {
++ if test -f "$dstdir/$dstfile"; then
++ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
++ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
++ || {
++ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
++ (exit 1); exit 1
++ }
++ else
++ :
++ fi
++ } &&
+
+- trap '' 0
+- fi
++ # Now rename the file to the real destination.
++ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
++ }
++ }
++ fi || { (exit 1); exit 1; }
+ done
+
++# The final little trick to "correctly" pass the exit status to the exit trap.
++{
++ (exit 0); exit 0
++}
++
+ # Local variables:
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
+ # time-stamp-start: "scriptversion="
diff --git a/package/cgilib/patches/patch-ltmain_sh b/package/cgilib/patches/patch-ltmain_sh
new file mode 100644
index 000000000..6eceb3560
--- /dev/null
+++ b/package/cgilib/patches/patch-ltmain_sh
@@ -0,0 +1,131 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/ltmain.sh 2008-04-29 23:33:55.000000000 +0200
++++ cgilib-0.7/ltmain.sh 2009-05-09 03:58:09.000000000 +0200
+@@ -43,8 +43,8 @@ EXIT_FAILURE=1
+
+ PROGRAM=ltmain.sh
+ PACKAGE=libtool
+-VERSION="1.5.26 Debian 1.5.26-4"
+-TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
++VERSION=1.5.26
++TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
+
+ # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+@@ -250,6 +250,20 @@ func_win32_libid ()
+ # arg is usually of the form 'gcc ...'
+ func_infer_tag ()
+ {
++ # FreeBSD-specific: where we install compilers with non-standard names
++ tag_compilers_CC="*cc cc* *gcc gcc*"
++ tag_compilers_CXX="*c++ c++* *g++ g++*"
++ base_compiler=`set -- "$@"; echo $1`
++
++ # If $tagname isn't set, then try to infer if the default "CC" tag applies
++ if test -z "$tagname"; then
++ for zp in $tag_compilers_CC; do
++ case $base_compiler in
++ $zp) tagname="CC"; break;;
++ esac
++ done
++ fi
++
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+@@ -290,7 +304,22 @@ func_infer_tag ()
+ break
+ ;;
+ esac
+- fi
++
++ # FreeBSD-specific: try compilers based on inferred tag
++ if test -z "$tagname"; then
++ eval "tag_compilers=\$tag_compilers_${z}"
++ if test -n "$tag_compilers"; then
++ for zp in $tag_compilers; do
++ case $base_compiler in
++ $zp) tagname=$z; break;;
++ esac
++ done
++ if test -n "$tagname"; then
++ break
++ fi
++ fi
++ fi
++ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+@@ -1651,6 +1680,7 @@ EOF
+ compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
++ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+@@ -2135,10 +2165,7 @@ EOF
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+- link)
+- libs="$deplibs %DEPLIBS%"
+- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+- ;;
++ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$pass" = dlopen; then
+@@ -2157,6 +2184,29 @@ EOF
+ else
+ compiler_flags="$compiler_flags $deplib"
+ fi
++
++ case $linkmode in
++ lib)
++ deplibs="$deplib $deplibs"
++ test "$pass" = conv && continue
++ newdependency_libs="$deplib $newdependency_libs"
++ ;;
++ prog)
++ if test "$pass" = conv; then
++ deplibs="$deplib $deplibs"
++ continue
++ fi
++ if test "$pass" = scan; then
++ deplibs="$deplib $deplibs"
++ else
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ fi
++ ;;
++ *)
++ ;;
++ esac # linkmode
++
+ continue
+ ;;
+ -l*)
+@@ -3272,11 +3322,6 @@ EOF
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+- *)
+- $echo "$modename: unknown library version type \`$version_type'" 1>&2
+- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+- exit $EXIT_FAILURE
+- ;;
+ esac
+ ;;
+ no)
+@@ -4788,6 +4833,9 @@ static const void *lt_preloaded_setup()
+ ;;
+ esac
+ ;;
++ *-*-freebsd*)
++ # FreeBSD doesn't need this...
++ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit $EXIT_FAILURE
diff --git a/package/cgilib/patches/patch-missing b/package/cgilib/patches/patch-missing
new file mode 100644
index 000000000..75fdcb564
--- /dev/null
+++ b/package/cgilib/patches/patch-missing
@@ -0,0 +1,185 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cgilib-0.7.orig/missing 2009-02-08 19:47:04.000000000 +0100
++++ cgilib-0.7/missing 2009-05-09 03:58:09.000000000 +0200
+@@ -1,9 +1,9 @@
+ #! /bin/sh
+ # Common stub for a few missing GNU programs while installing.
+
+-scriptversion=2006-05-10.23
++scriptversion=2005-06-08.21
+
+-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
++# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+ # Free Software Foundation, Inc.
+ # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+@@ -33,8 +33,6 @@ if test $# -eq 0; then
+ 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.
+@@ -46,7 +44,7 @@ fi
+
+ msg="missing on your system"
+
+-case $1 in
++case "$1" in
+ --run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+@@ -79,7 +77,6 @@ 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
+@@ -109,7 +106,7 @@ esac
+ # 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).
+-case $1 in
++case "$1" in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+@@ -138,7 +135,7 @@ esac
+
+ # If it does not exist, or fails to run (possibly an outdated version),
+ # try to emulate it.
+-case $1 in
++case "$1" in
+ aclocal*)
+ echo 1>&2 "\
+ WARNING: \`$1' is $msg. You should only need it if
+@@ -167,7 +164,7 @@ WARNING: \`$1' is $msg. You should only
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+- case $f in
++ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+@@ -195,8 +192,8 @@ WARNING: \`$1' is needed, but is $msg.
+ 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"`
++ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
++ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+@@ -217,25 +214,25 @@ WARNING: \`$1' $msg. You should only ne
+ 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
++ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+- case $LASTARG in
++ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+- if test -f "$SRCFILE"; then
++ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+- if test -f "$SRCFILE"; then
++ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+- if test ! -f y.tab.h; then
++ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+- if test ! -f y.tab.c; then
++ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+@@ -247,18 +244,18 @@ WARNING: \`$1' is $msg. You should only
+ 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
++ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+- case $LASTARG in
++ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+- if test -f "$SRCFILE"; then
++ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+- if test ! -f lex.yy.c; then
++ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+@@ -270,9 +267,11 @@ WARNING: \`$1' is $msg. You should only
+ \`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
++ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
++ if test -z "$file"; then
++ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
++ fi
++ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+@@ -290,17 +289,11 @@ WARNING: \`$1' is $msg. You should only
+ 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"`
++ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ 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`
++ 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
+@@ -324,13 +317,13 @@ WARNING: \`$1' is $msg. You should only
+ fi
+ firstarg="$1"
+ if shift; then
+- case $firstarg in
++ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+- case $firstarg in
++ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
diff --git a/package/chillispot/Config.in b/package/chillispot/Config.in
new file mode 100644
index 000000000..902ffb1db
--- /dev/null
+++ b/package/chillispot/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_CHILLISPOT
+ prompt "chillispot........................ Wireless LAN access point controller"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_TUN
+ help
+ ChilliSpot is an open source captive portal or wireless LAN
+ access point controller. It is used for authenticating users
+ of a wireless LAN. It supports web based login which is today's
+ standard for public HotSpots and it supports Wireless Protected
+ Access (WPA) which is the standard of the future. Authentication,
+ authorization and accounting (AAA) is handled by your favorite
+ radius server.
+
+ http://www.chillispot.org/
diff --git a/package/chillispot/Makefile b/package/chillispot/Makefile
new file mode 100644
index 000000000..9ad16b887
--- /dev/null
+++ b/package/chillispot/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= chillispot
+PKG_VERSION:= 1.1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 9d2597756af3fa14d7331b4a3651fc9b
+MASTER_SITES= http://www.chillispot.info/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CHILLISPOT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_CHILLISPOT}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_CHILLISPOT}/usr/sbin
+ ${INSTALL_BIN} ./files/chilli.conf \
+ ${IDIR_CHILLISPOT}/etc/
+ ${INSTALL_BIN} ./files/${PKG_NAME}.init \
+ ${IDIR_CHILLISPOT}/etc/init.d/chilli
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/chilli ${IDIR_CHILLISPOT}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/chillispot/files/chilli.conf b/package/chillispot/files/chilli.conf
new file mode 100644
index 000000000..e6712d89b
--- /dev/null
+++ b/package/chillispot/files/chilli.conf
@@ -0,0 +1,292 @@
+# Sample ChilliSpot configuration file
+
+#fg
+#debug
+
+# TAG: interval
+# Re-read configuration file at this interval. Will also cause new domain
+# name lookups to be performed. Value is given in seconds.
+#interval 3600
+
+# TAG: pidfile
+# File to store information about the process id of the program.
+# The program must have write access to this file/directory.
+#pidfile /var/run/chilli.pid
+
+# TAG: statedir
+# Directory to use for nonvolatile storage.
+# The program must have write access to this directory.
+# This tag is currently ignored
+#statedir ./
+
+
+# TUN parameters
+
+# TAG: net
+# IP network address of external packet data network
+# Used to allocate dynamic IP addresses and set up routing.
+# Normally you do not need to uncomment this tag.
+#net 192.168.182.0/24
+
+# TAG: dynip
+# Dynamic IP address pool
+# Used to allocate dynamic IP addresses to clients.
+# If not set it defaults to the net tag.
+# Do not uncomment this tag unless you are an experienced user!
+#dynip 192.168.182.0/24
+
+# TAG: statip
+# Static IP address pool
+# Used to allocate static IP addresses to clients.
+# Do not uncomment this tag unless you are an experienced user!
+#statip 192.168.182.0/24
+
+
+# TAG: dns1
+# Primary DNS server.
+# Will be suggested to the client.
+# If omitted the system default will be used.
+# Normally you do not need to uncomment this tag.
+#dns1 172.16.0.5
+
+# TAG: dns2
+# Secondary DNS server.
+# Will be suggested to the client.
+# If omitted the system default will be used.
+# Normally you do not need to uncomment this tag.
+#dns2 172.16.0.6
+
+# TAG: domain
+# Domain name
+# Will be suggested to the client.
+# Normally you do not need to uncomment this tag.
+#domain key.chillispot.org
+
+# TAG: ipup
+# Script executed after network interface has been brought up.
+# Executed with the following parameters: <devicename> <ip address>
+# <mask>
+# Normally you do not need to uncomment this tag.
+#ipup /etc/chilli.ipup
+
+# TAG: ipdown
+# Script executed after network interface has been taken down.
+# Executed with the following parameters: <devicename> <ip address>
+# <mask>
+# Normally you do not need to uncomment this tag.
+#ipdown /etc/chilli.ipdown
+
+# TAG: conup
+# Script executed after a user has been authenticated.
+# Executed with the following parameters: <devicename> <ip address>
+# <mask> <user ip address> <user mac address> <filter ID>
+# Normally you do not need to uncomment this tag.
+#conup /etc/chilli.conup
+
+# TAG: conup
+# Script executed after a user has disconnected.
+# Executed with the following parameters: <devicename> <ip address>
+# <mask> <user ip address> <user mac address> <filter ID>
+# Normally you do not need to uncomment this tag.
+#conup /etc/chilli.condown
+
+
+# Radius parameters
+
+# TAG: radiuslisten
+# IP address to listen to
+# Normally you do not need to uncomment this tag.
+radiuslisten 127.0.0.1
+
+# TAG: radiusserver1
+# IP address of radius server 1
+# For most installations you need to modify this tag.
+radiusserver1 localhost
+
+# TAG: radiusserver2
+# IP address of radius server 2
+# If you have only one radius server you should set radiusserver2 to the
+# same value as radiusserver1.
+# For most installations you need to modify this tag.
+radiusserver2 localhost
+
+# TAG: radiusauthport
+# Radius authentication port
+# The UDP port number to use for radius authentication requests.
+# The same port number is used for both radiusserver1 and radiusserver2.
+# Normally you do not need to uncomment this tag.
+#radiusauthport 1812
+
+# TAG: radiusacctport
+# Radius accounting port
+# The UDP port number to use for radius accounting requests.
+# The same port number is used for both radiusserver1 and radiusserver2.
+# Normally you do not need to uncomment this tag.
+#radiusacctport 1813
+
+# TAG: radiussecret
+# Radius shared secret for both servers
+# For all installations you should modify this tag.
+radiussecret testing123
+
+# TAG: radiusnasid
+# Radius NAS-Identifier
+# Normally you do not need to uncomment this tag.
+#radiusnasid nas01
+
+# TAG: radiusnasip
+# Radius NAS-IP-Address
+# Normally you do not need to uncomment this tag.
+#radiusnasip 127.0.0.1
+
+# TAG: radiuscalled
+# Radius Called-Station-ID
+# Normally you do not need to uncomment this tag.
+#radiuscalled 00133300
+
+# TAG: radiuslocationid
+# WISPr Location ID. Should be in the format: isocc=<ISO_Country_Code>,
+# cc=<E.164_Country_Code>,ac=<E.164_Area_Code>,network=<ssid/ZONE>
+# Normally you do not need to uncomment this tag.
+#radiuslocationid isocc=us,cc=1,ac=408,network=ACMEWISP_NewarkAirport
+
+# TAG: radiuslocationname
+# WISPr Location Name. Should be in the format:
+# <HOTSPOT_OPERATOR_NAME>,<LOCATION>
+# Normally you do not need to uncomment this tag.
+#radiuslocationname ACMEWISP,Gate_14_Terminal_C_of_Newark_Airport
+
+
+# Radius proxy parameters
+
+# TAG: proxylisten
+# IP address to listen to
+# Normally you do not need to uncomment this tag.
+#proxylisten 10.0.0.1
+
+# TAG: proxyport
+# UDP port to listen to.
+# If not specified a port will be selected by the system
+# Normally you do not need to uncomment this tag.
+#proxyport 1645
+
+# TAG: proxyclient
+# Client(s) from which we accept radius requests
+# Normally you do not need to uncomment this tag.
+#proxyclient 10.0.0.1/24
+
+# TAG: proxysecret
+# Radius proxy shared secret for all clients
+# If not specified defaults to radiussecret
+# Normally you do not need to uncomment this tag.
+#proxysecret testing123
+
+
+# Remote configuration management
+
+# TAG: confusername
+# If confusername is specified together with confpassword chillispot
+# will at regular intervals specified by the interval option query the
+# radius server for configuration information.
+# Normally you do not need to uncomment this tag.
+#confusername conf
+
+# TAG: confpassword
+# If confusername is specified together with confpassword chillispot
+# will at regular intervals specified by the interval option query the
+# radius server for configuration information.
+# Normally you do not need to uncomment this tag.
+#confpassword secret
+
+
+# DHCP Parameters
+
+# TAG: dhcpif
+# Ethernet interface to listen to.
+# This is the network interface which is connected to the access points.
+# In a typical configuration this tag should be set to eth1.
+dhcpif wlan0
+
+# TAG: dhcpmac
+# Use specified MAC address.
+# An address in the range 00:00:5E:00:02:00 - 00:00:5E:FF:FF:FF falls
+# within the IANA range of addresses and is not allocated for other
+# purposes.
+# Normally you do not need to uncomment this tag.
+#dhcpmac 00:00:5E:00:02:00
+
+# TAG: lease
+# Time before DHCP lease expires
+# Normally you do not need to uncomment this tag.
+#lease 600
+
+
+# Universal access method (UAM) parameters
+
+# TAG: uamserver
+# URL of web server handling authentication.
+uamserver https://192.168.182.1/hotspotlogin
+
+# TAG: uamhomepage
+# URL of welcome homepage.
+# Unauthenticated users will be redirected to this URL. If not specified
+# users will be redirected to the uamserver instead.
+# Normally you do not need to uncomment this tag.
+uamhomepage http://localhost
+
+# TAG: uamsecret
+# Shared between chilli and authentication web server
+#uamsecret ht2eb8ej6s4et3rg1ulp
+
+# TAG: uamlisten
+# IP address to listen to for authentication requests
+# Do not uncomment this tag unless you are an experienced user!
+#uamlisten 192.168.182.1
+
+# TAG: uamport
+# TCP port to listen to for authentication requests
+# Do not uncomment this tag unless you are an experienced user!
+#uamport 3990
+
+# TAG: uamallowed
+# Comma separated list of domain names, IP addresses or network segments
+# the client can access without first authenticating.
+# It is possible to specify this tag multiple times.
+# Normally you do not need to uncomment this tag.
+#uamallowed www.chillispot.org,10.11.12.0/24
+
+# TAG: uamanydns
+# If this flag is given unauthenticated users are allowed to use
+# any DNS server.
+# Normally you do not need to uncomment this tag.
+#uamanydns
+
+
+# MAC authentication
+
+# TAG: macauth
+# If this flag is given users will be authenticated only on their MAC
+# address.
+# Normally you do not need to uncomment this tag.
+#macauth
+
+# TAG: macallowed
+# List of MAC addresses.
+# The MAC addresses specified in this list will be authenticated only on
+# their MAC address.
+# This tag is ignored if the macauth tag is given.
+# It is possible to specify this tag multiple times.
+# Normally you do not need to uncomment this tag.
+#macallowed 00-0A-5E-AC-BE-51,00-30-1B-3C-32-E9
+
+# TAG: macpasswd
+# Password to use for MAC authentication.
+# Normally you do not need to uncomment this tag.
+#macpasswd password
+
+# TAG: macsuffix
+# Suffix to add to MAC address in order to form the username.
+# Normally you do not need to uncomment this tag.
+#macsuffix suffix
+
+
diff --git a/package/chillispot/files/chillispot.init b/package/chillispot/files/chillispot.init
new file mode 100644
index 000000000..c2a6cd489
--- /dev/null
+++ b/package/chillispot/files/chillispot.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${chillispot:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ chilli
+ ;;
+stop)
+ killall chilli
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/chillispot/ipkg/chillispot.conffiles b/package/chillispot/ipkg/chillispot.conffiles
new file mode 100644
index 000000000..08485167d
--- /dev/null
+++ b/package/chillispot/ipkg/chillispot.conffiles
@@ -0,0 +1 @@
+/etc/chilli.conf
diff --git a/package/chillispot/ipkg/chillispot.control b/package/chillispot/ipkg/chillispot.control
new file mode 100644
index 000000000..0bb2badb8
--- /dev/null
+++ b/package/chillispot/ipkg/chillispot.control
@@ -0,0 +1,5 @@
+Package: chillispot
+Priority: optional
+Section: net
+Depends: kmod-tun
+Description: ChilliSpot is a Wireless LAN Access Point Controller.
diff --git a/package/chillispot/ipkg/chillispot.postinst b/package/chillispot/ipkg/chillispot.postinst
new file mode 100644
index 000000000..20ad12d8c
--- /dev/null
+++ b/package/chillispot/ipkg/chillispot.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf chillispot chillispot NO
diff --git a/package/collectd/Config.in b/package/collectd/Config.in
new file mode 100644
index 000000000..f645ee403
--- /dev/null
+++ b/package/collectd/Config.in
@@ -0,0 +1,36 @@
+
+config ADK_PACKAGE_COLLECTD
+ prompt "collectd.......................... Lightweight system statistics collection daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ collectd is a small daemon which collects system information
+ every 10 seconds. The values are then sent to a multicast group
+ to be stored in RRD files by a server process.
+
+ http://verplant.org/collectd/
+
+config ADK_PACKAGE_COLLECTD_CPU
+ prompt "Enable cpu support"
+ bool
+ default y
+ depends ADK_PACKAGE_COLLECTD
+
+config ADK_PACKAGE_COLLECTD_LOAD
+ prompt "Enable load support"
+ bool
+ default y
+ depends ADK_PACKAGE_COLLECTD
+
+config ADK_PACKAGE_COLLECTD_MEMORY
+ prompt "Enable memory support"
+ bool
+ default y
+ depends ADK_PACKAGE_COLLECTD
+
+config ADK_PACKAGE_COLLECTD_PING
+ prompt "Enable ping support"
+ bool
+ default y
+ depends ADK_PACKAGE_COLLECTD
diff --git a/package/collectd/Makefile b/package/collectd/Makefile
new file mode 100644
index 000000000..75518ff04
--- /dev/null
+++ b/package/collectd/Makefile
@@ -0,0 +1,94 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= collectd
+PKG_VERSION:= 4.6.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 9eee46a6330780d6e6b41155b159f4f9
+MASTER_SITES:= http://verplant.org/collectd/files/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,COLLECTD,collectd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifneq (${ADK_PACKAGE_COLLECTD_CPU},y)
+DISABLE_CPU:=--disable-cpu
+endif
+ifneq (${ADK_PACKAGE_COLLECTD_LOAD},y)
+DISABLE_LOAD:=--disable-load
+endif
+ifneq (${ADK_PACKAGE_COLLECTD_MEMORY},y)
+DISABLE_MEMORY:=--disable-memory
+endif
+ifneq (${ADK_PACKAGE_COLLECTD_PING},y)
+DISABLE_PING:=--disable-ping
+endif
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-apache \
+ --disable-apcups \
+ --disable-apple_sensors \
+ --disable-ascent \
+ --disable-battery \
+ ${DISABLE_CPU} \
+ --disable-cpufreq \
+ --disable-disk \
+ --enable-csv \
+ --disable-df \
+ --disable-dns \
+ --disable-email \
+ --disable-entropy \
+ --disable-exec \
+ --disable-hddtemp \
+ --disable-interface \
+ --disable-iptables \
+ --disable-irq \
+ ${DISABLE_LOAD} \
+ --disable-mbmon \
+ --disable-memcached \
+ ${DISABLE_MEMORY} \
+ --disable-multimeter \
+ --disable-mysql \
+ --disable-postgresql \
+ --disable-powerdns \
+ --disable-network \
+ --disable-nginx \
+ --disable-nfs \
+ --disable-ntpd \
+ --disable-nut \
+ --disable-perl \
+ ${DISABLE_PING} \
+ --disable-processes \
+ --disable-sensors \
+ --disable-serial \
+ --disable-logfile \
+ --disable-swap \
+ --disable-syslog \
+ --disable-tape \
+ --disable-teamspeak2 \
+ --disable-thermal \
+ --disable-unixsock \
+ --disable-users \
+ --disable-vserver \
+ --enable-wireless \
+ --with-fp-layout=nothing \
+ --with-nan-emulation
+
+XAKE_FLAGS+= LIBS='-lm'
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_COLLECTD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_COLLECTD}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_COLLECTD}/usr/lib/collectd
+ ${INSTALL_BIN} ./files/collectd.init \
+ ${IDIR_COLLECTD}/etc/init.d/collectd
+ ${CP} ${WRKINST}/usr/sbin/collectd ${IDIR_COLLECTD}/usr/sbin/
+ ${CP} ${WRKINST}/usr/lib/collectd/*.so ${IDIR_COLLECTD}/usr/lib/collectd/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/collectd/files/collectd.init b/package/collectd/files/collectd.init
new file mode 100644
index 000000000..7d4f70b59
--- /dev/null
+++ b/package/collectd/files/collectd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${collectd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/lib/collectd ] || mkdir -p /var/lib/collectd
+ collectd
+ ;;
+stop)
+ killall collectd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/collectd/ipkg/collectd.control b/package/collectd/ipkg/collectd.control
new file mode 100644
index 000000000..790e0fdfb
--- /dev/null
+++ b/package/collectd/ipkg/collectd.control
@@ -0,0 +1,5 @@
+Package: collectd
+Priority: optional
+Section: console
+Description: System statistics collection daemon
+Depends: libpthread
diff --git a/package/collectd/ipkg/collectd.postinst b/package/collectd/ipkg/collectd.postinst
new file mode 100644
index 000000000..7e4416125
--- /dev/null
+++ b/package/collectd/ipkg/collectd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf collectd collectd NO
diff --git a/package/collectd/patches/patch-src_Makefile_in b/package/collectd/patches/patch-src_Makefile_in
new file mode 100644
index 000000000..d563de441
--- /dev/null
+++ b/package/collectd/patches/patch-src_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- collectd-4.6.2.orig/src/Makefile.in 2009-03-18 11:56:40.000000000 +0100
++++ collectd-4.6.2/src/Makefile.in 2009-05-09 16:28:02.000000000 +0200
+@@ -1340,7 +1340,7 @@ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ SUBDIRS = libcollectdclient $(am__append_1) $(am__append_2) \
+ $(am__append_3)
+-@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall -Werror
++@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall
+ AM_CPPFLAGS = -DPREFIX='"${prefix}"' \
+ -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \
+ -DLOCALSTATEDIR='"${localstatedir}"' \
diff --git a/package/collectd/patches/patch-src_libcollectdclient_Makefile_in b/package/collectd/patches/patch-src_libcollectdclient_Makefile_in
new file mode 100644
index 000000000..ba4d4c067
--- /dev/null
+++ b/package/collectd/patches/patch-src_libcollectdclient_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- collectd-4.6.2.orig/src/libcollectdclient/Makefile.in 2009-03-18 11:56:40.000000000 +0100
++++ collectd-4.6.2/src/libcollectdclient/Makefile.in 2009-05-09 16:29:33.000000000 +0200
+@@ -251,7 +251,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ AUTOMAKE_OPTIONS = foreign no-dependencies
+-@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall -Werror
++@COMPILER_IS_GCC_TRUE@AM_CFLAGS = -Wall
+ pkginclude_HEADERS = client.h lcc_features.h
+ lib_LTLIBRARIES = libcollectdclient.la
+ nodist_pkgconfig_DATA = libcollectdclient.pc
diff --git a/package/comgt/Config.in b/package/comgt/Config.in
new file mode 100644
index 000000000..4711c2195
--- /dev/null
+++ b/package/comgt/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_COMGT
+ prompt "comgt............................. Option/Vodafone 3G/GPRS control tool"
+ tristate
+ default n
+ help
+ Option GlobeTrotter GPRS/EDGE/3G/HSDPA and Vodafone 3G/GPRS datacard control tool
+
+ comgt is a scripting language interpreter useful for establishing communications
+ on serial lines and through PCMCIA modems as well as GPRS and 3G datacards.
+
+ http://www.pharscape.org/content/view/46/70/
diff --git a/package/comgt/Makefile b/package/comgt/Makefile
new file mode 100644
index 000000000..c9304dda8
--- /dev/null
+++ b/package/comgt/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= comgt
+PKG_VERSION:= 0.32
+PKG_RELEASE:= 1
+PKG_MD5SUM:= db2452680c3d953631299e331daf49ef
+DISTFILES:= ${PKG_NAME}.${PKG_VERSION}.tgz
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=comgt/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}.${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,COMGT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+ALL_TARGET= comgt
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_COMGT}/usr/bin
+ ${INSTALL_DIR} ${IDIR_COMGT}/etc/comgt
+ ${INSTALL_BIN} ${WRKBUILD}/comgt ${IDIR_COMGT}/usr/bin/comgt
+ ${INSTALL_DATA} ./files/dial.comgt ${IDIR_COMGT}/etc/comgt/dial.comgt
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/comgt/files/dial.comgt b/package/comgt/files/dial.comgt
new file mode 100644
index 000000000..de3327331
--- /dev/null
+++ b/package/comgt/files/dial.comgt
@@ -0,0 +1,26 @@
+# dial given number
+opengt
+ set com 115200n81
+ set senddelay 0.02
+ waitquiet 1 0.2
+ flash 0.1
+
+:start
+ print "Dialing '"+$env("NUMBER")+"'\n"
+ send "ATDT"+$env("NUMBER")+"^m"
+
+ waitfor 15 "CONNECT" "OK","ERR","ERROR"
+ if % = 0 goto continue
+ if % = 1 goto continue
+ if % = 2 goto senderror
+ if % = 3 goto senderror
+
+ print "Timeout dialing '"+$env("NUMBER")+"'\n"
+ exit 1
+
+:senderror
+ print "Error dialing '"+$env("NUMBER")+"'\n"
+ exit 1
+
+:continue
+ exit 0
diff --git a/package/comgt/files/setmode.comgt b/package/comgt/files/setmode.comgt
new file mode 100644
index 000000000..4ce0b5fa7
--- /dev/null
+++ b/package/comgt/files/setmode.comgt
@@ -0,0 +1,26 @@
+# set wwan mode from environment
+opengt
+ set com 115200n81
+ set senddelay 0.02
+ waitquiet 1 0.2
+ flash 0.1
+
+:start
+ print "Trying to set mode\n"
+ send $env("MODE")
+ send "^m"
+
+ waitfor 15 "OK","ERR","ERROR"
+ if % = 0 goto continue
+ if % = 1 goto modeerror
+ if % = 2 goto modeerror
+
+ print "Timeout setting WWAN mode!\n"
+ exit 1
+
+:modeerror
+ print "Error setting WWAN mode!\n"
+ exit 1
+
+:continue
+ exit 0
diff --git a/package/comgt/ipkg/comgt.control b/package/comgt/ipkg/comgt.control
new file mode 100644
index 000000000..fe2c1cd61
--- /dev/null
+++ b/package/comgt/ipkg/comgt.control
@@ -0,0 +1,4 @@
+Package: comgt
+Priority: optional
+Section: console
+Description: Option GlobeTrotter GPRS/EDGE/3G/HSDPA and Vodafone 3G/GPRS datacard control tool
diff --git a/package/comgt/patches/patch-comgt_0_32_Makefile b/package/comgt/patches/patch-comgt_0_32_Makefile
new file mode 100644
index 000000000..29a6dbfdc
--- /dev/null
+++ b/package/comgt/patches/patch-comgt_0_32_Makefile
@@ -0,0 +1,33 @@
+$Id$
+--- comgt.0.32.orig/Makefile 2006-10-20 16:49:46.000000000 +0200
++++ comgt.0.32/Makefile 2006-12-05 18:03:37.000000000 +0100
+@@ -23,8 +23,6 @@
+ #
+ #
+
+-LIB = -L/usr/local/lib
+-INC = -I/usr/local/include
+ EXE = /usr/local/bin
+ MAN = /usr/share/man/man1
+ CPROG = comgt
+@@ -33,9 +31,6 @@ SCRIPTSRC = ./scripts/
+ BIN = $(CPROG)
+ MANP = comgt.1 sigmon.1
+
+-CFLAGS = -c
+-LDFLAGS =
+-
+ all: $(BIN)
+
+ install:
+@@ -72,8 +67,8 @@ clean:
+
+
+ comgt: comgt.o
+- cc comgt.o $(LDFLAGS) -o comgt
++ $(CC) comgt.o $(LDFLAGS) -o comgt
+
+ comgt.o: comgt.c comgt.h
+- cc comgt.c $(CFLAGS)
++ $(CC) comgt.c -c $(CFLAGS)
+
diff --git a/package/comgt/patches/patch-comgt_h b/package/comgt/patches/patch-comgt_h
new file mode 100644
index 000000000..fe715df4f
--- /dev/null
+++ b/package/comgt/patches/patch-comgt_h
@@ -0,0 +1,14 @@
+$Id$
+--- comgt.0.32.orig/comgt.h 2006-10-20 16:49:46.000000000 +0200
++++ comgt.0.32/comgt.h 2006-12-06 13:10:54.000000000 +0100
+@@ -470,8 +470,8 @@ char _SETAPN_code[]=
+ if a=0 goto apnerror\n\
+ if a>32 goto apnerror\n\
+ :enterapn\n\
+- send \"AT+CGDCONT=1,\\\"IP\\\",\\\"\n\
+- send $c\n\
++ send \"AT+CGDCONT=1,\\\"IP\\\",\\\"\"\n\
++ send $x\n\
+ send \"\\\"^m\"\n\
+ waitfor 20 \"OK\",\"ERR\"\n\
+ if % = -1 goto timeerror\n\
diff --git a/package/compositeproto/Config.in b/package/compositeproto/Config.in
new file mode 100644
index 000000000..88d73d6b3
--- /dev/null
+++ b/package/compositeproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XPROTO
+ prompt "xproto................................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/compositeproto/Makefile b/package/compositeproto/Makefile
new file mode 100644
index 000000000..9438a34c7
--- /dev/null
+++ b/package/compositeproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= compositeproto
+PKG_VERSION:= 0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 33a79f6ba950bc5b41e077c951871bd5
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cryptsetup/Config.in b/package/cryptsetup/Config.in
new file mode 100644
index 000000000..db5d8a9ca
--- /dev/null
+++ b/package/cryptsetup/Config.in
@@ -0,0 +1,16 @@
+config ADK_PACKAGE_CRYPTSETUP
+ prompt "cryptsetup........................ LUKS cryptsetup tools"
+ tristate
+ select ADK_PACKAGE_LIBPOPT
+ select ADK_PACKAGE_LIBUUID
+ select ADK_PACKAGE_LIBGCRYPT
+ select ADK_PACKAGE_DEVICE_MAPPER
+ select ADK_KPACKAGE_KMOD_BLK_DEV_DM
+ select ADK_KPACKAGE_KMOD_DM_CRYPT
+ select ADK_KPACKAGE_KMOD_CRYPTO_SHA256
+ select ADK_KPACKAGE_KMOD_CRYPTO_AES
+ select ADK_KPACKAGE_KMOD_CRYPTO_CBC
+ default n
+ help
+ LUKS cryptsetup tools. You need to enable crypto kernel
+ modules to get a working setup (f.e. aes and sha256).
diff --git a/package/cryptsetup/Makefile b/package/cryptsetup/Makefile
new file mode 100644
index 000000000..f82509774
--- /dev/null
+++ b/package/cryptsetup/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cryptsetup
+PKG_VERSION:= 1.0.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 00d452eb7a76e39f5749545d48934a10
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://cryptsetup.googlecode.com/files/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CRYPTSETUP,cryptsetup,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --disable-static
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_CRYPTSETUP}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_CRYPTSETUP}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libcryptsetup.so.* \
+ ${IDIR_CRYPTSETUP}/usr/lib
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/cryptsetup \
+ ${IDIR_CRYPTSETUP}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cryptsetup/ipkg/cryptsetup.control b/package/cryptsetup/ipkg/cryptsetup.control
new file mode 100644
index 000000000..f23b5bf4d
--- /dev/null
+++ b/package/cryptsetup/ipkg/cryptsetup.control
@@ -0,0 +1,5 @@
+Package: cryptsetup
+Priority: optional
+Section: crypto
+Depends: libgcrypt, device-mapper, libuuid, libpopt
+Description: LUKS cryptsetup tools
diff --git a/package/cryptsetup/patches/patch-lib_libdevmapper_c b/package/cryptsetup/patches/patch-lib_libdevmapper_c
new file mode 100644
index 000000000..052241c92
--- /dev/null
+++ b/package/cryptsetup/patches/patch-lib_libdevmapper_c
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cryptsetup-1.0.6.orig/lib/libdevmapper.c 2007-10-25 09:11:19.000000000 +0200
++++ cryptsetup-1.0.6/lib/libdevmapper.c 2009-01-04 17:02:57.000000000 +0100
+@@ -192,7 +192,9 @@ static int dm_create_device(int reload,
+ options->flags |= CRYPT_FLAG_READONLY;
+
+ /* run udevsettle to avoid a race in libdevmapper causing busy dm devices */
+- run_udevsettle();
++ /* do not run on mdev based systems
++ run_udevsettle();
++ */
+
+ r = 0;
+
diff --git a/package/cryptsetup/patches/patch-lib_utils_c b/package/cryptsetup/patches/patch-lib_utils_c
new file mode 100644
index 000000000..665620528
--- /dev/null
+++ b/package/cryptsetup/patches/patch-lib_utils_c
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+
+* prevent segfault with uClibc
+ http://www.spinics.net/lists/dm-crypt/msg01187.html
+
+--- cryptsetup-1.0.6.orig/lib/utils.c 2007-12-01 17:29:27.000000000 +0100
++++ cryptsetup-1.0.6/lib/utils.c 2008-12-25 14:18:46.523091272 +0100
+@@ -27,6 +27,8 @@ static char *error=NULL;
+ void set_error_va(const char *fmt, va_list va)
+ {
+
++ if(!fmt) return;
++
+ if(error) {
+ free(error);
+ error=NULL;
diff --git a/package/ctorrent/Config.in b/package/ctorrent/Config.in
new file mode 100644
index 000000000..169546625
--- /dev/null
+++ b/package/ctorrent/Config.in
@@ -0,0 +1,29 @@
+config ADK_PACKAGE_CTORRENT
+ prompt "ctorrent.......................... console-based BitTorrent client"
+ tristate
+ default n
+ depends on ADK_CXX
+ help
+ CTorrent is a BitTorrent client written in the C programming language, known to
+ be a very robust and mature programming language, which produces fast and
+ optimized application.
+
+ http://www.rahul.net/dholmes/ctorrent/
+
+choice
+prompt "C++ library to use"
+depends on ADK_PACKAGE_CTORRENT
+default ADK_COMPILE_CTORRENT_WITH_STDCXX if ADK_TARGET_LIB_GLIBC
+default ADK_COMPILE_CTORRENT_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC
+
+config ADK_COMPILE_CTORRENT_WITH_STDCXX
+ bool "Standard C++ library"
+ select ADK_PACKAGE_LIBSTDCXX
+ help
+
+config ADK_COMPILE_CTORRENT_WITH_UCLIBCXX
+ bool "Embedded uClibc++ library"
+ select ADK_PACKAGE_UCLIBCXX
+ help
+
+endchoice
diff --git a/package/ctorrent/Makefile b/package/ctorrent/Makefile
new file mode 100755
index 000000000..964ae555a
--- /dev/null
+++ b/package/ctorrent/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ctorrent
+PKG_VERSION:= 1.3.4-dnh2
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 6635e2d0d0ee21faeb85d95cd93c137b
+MASTER_SITES:= http://www.rahul.net/dholmes/ctorrent/
+WRKDIST= ${WRKDIR}/${PKG_NAME}-dnh2
+ifeq ($(ADK_COMPILE_CTORRENT_WITH_UCLIBCXX),y)
+PKG_DEPEND:= uclibc++
+else
+PKG_DEPEND:= libstdcxx
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CTORRENT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH},${PKG_DEPEND}))
+
+ifeq ($(ADK_COMPILE_CTORRENT_WITH_UCLIBCXX),y)
+TCXXFLAGS+= -fno-builtin -fno-rtti -nostdinc++
+TLDFLAGS+= -lgcc_s -luClibc++ -lc -lm -nodefaultlibs
+endif
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_CTORRENT}
+ ${CP} ${WRKINST}/* ${IDIR_CTORRENT}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ctorrent/ipkg/ctorrent.control b/package/ctorrent/ipkg/ctorrent.control
new file mode 100644
index 000000000..0b7d1d59e
--- /dev/null
+++ b/package/ctorrent/ipkg/ctorrent.control
@@ -0,0 +1,4 @@
+Package: ctorrent
+Priority: optional
+Section: net
+Description: console-based BitTorrent client
diff --git a/package/ctorrent/patches/patch-btcontent_cpp b/package/ctorrent/patches/patch-btcontent_cpp
new file mode 100644
index 000000000..e402465f8
--- /dev/null
+++ b/package/ctorrent/patches/patch-btcontent_cpp
@@ -0,0 +1,16 @@
+$Id$
+--- ctorrent-dnh2.orig/btcontent.cpp 2006-01-02 03:40:49.000000000 +0100
++++ ctorrent-dnh2/btcontent.cpp 2007-01-22 23:43:50.000000000 +0100
+@@ -9,12 +9,8 @@
+ #else
+ #include <unistd.h>
+ #include <sys/param.h>
+-#if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBMD) || defined(HAVE_LIBCRYPTO)
+-#include <sha.h>
+-#elif defined(HAVE_LIBSSL)
+ #include <openssl/sha.h>
+ #endif
+-#endif
+
+ #include <time.h>
+ #include <sys/stat.h>
diff --git a/package/ctorrent/patches/patch-btfiles_cpp b/package/ctorrent/patches/patch-btfiles_cpp
new file mode 100644
index 000000000..e390083bb
--- /dev/null
+++ b/package/ctorrent/patches/patch-btfiles_cpp
@@ -0,0 +1,16 @@
+$Id$
+--- ctorrent-dnh2.orig/btfiles.cpp 2006-01-02 03:41:21.000000000 +0100
++++ ctorrent-dnh2/btfiles.cpp 2007-01-22 23:46:13.000000000 +0100
+@@ -8,12 +8,8 @@
+ #include <unistd.h>
+ #include <dirent.h>
+ #include <sys/param.h>
+-#if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBMD) || defined(HAVE_LIBCRYPTO)
+-#include <sha.h>
+-#elif defined(HAVE_LIBSSL)
+ #include <openssl/sha.h>
+ #endif
+-#endif
+
+ #include <time.h>
+ #include <sys/stat.h>
diff --git a/package/cups/Config.in b/package/cups/Config.in
new file mode 100644
index 000000000..662ff5a84
--- /dev/null
+++ b/package/cups/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_CUPS
+ prompt "cups.............................. Common UNIX Printing System"
+ tristate
+ select ADK_PACKAGE_ZLIB
+ select ADK_PACKAGE_LIBPTHREAD
+ default n
+ help
+ A printer spooling system for devices with USB or LP support
+
+ http://www.cups.org/
diff --git a/package/cups/Makefile b/package/cups/Makefile
new file mode 100644
index 000000000..4d045c77b
--- /dev/null
+++ b/package/cups/Makefile
@@ -0,0 +1,77 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cups
+PKG_VERSION:= 1.3.10
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 84fffe96b8537c81a463faccead80026
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}-source.tar.bz2
+MASTER_SITES:= http://ftp.rz.tu-bs.de/pub/mirror/ftp.easysw.com/ftp/pub/cups/${PKG_VERSION}/ \
+ ftp://ftp.easysw.com/pub/cups/${PKG_VERSION}/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CUPS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_sigset=no \
+ OPTIM=''
+CONFIGURE_ARGS+= --with-cups-user=root \
+ --with-cups-group=root \
+ --disable-ldap \
+ --disable-gssapi \
+ --disable-pam \
+ --disable-pap \
+ --disable-dbus \
+ --without-java \
+ --without-perl \
+ --without-python \
+ --without-php \
+ --disable-slp \
+ --disable-gnutls \
+ --disable-openssl \
+ --disable-cdsassl \
+ --disable-dbus \
+ --disable-ssl
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+FAKE_FLAGS+= DSTROOT="${WRKINST}" STRIP="/bin/true"
+XAKE_FLAGS+= OPTIM=''
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_CUPS}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_CUPS}/usr/share/doc/cups
+ ${INSTALL_DIR} ${IDIR_CUPS}/usr/bin
+ ${INSTALL_DIR} ${IDIR_CUPS}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_CUPS}/etc/cups
+ ${INSTALL_DIR} ${IDIR_CUPS}/usr/lib/cups/cgi-bin
+ ${INSTALL_DIR} ${IDIR_CUPS}/usr/lib/cups/daemon
+ ${INSTALL_DIR} ${IDIR_CUPS}/usr/share/cups/banners
+ ${INSTALL_DIR} ${IDIR_CUPS}/usr/share/cups/templates
+ ${CP} ${WRKINST}/etc/cups/* ${IDIR_CUPS}/etc/cups/
+ rm ${IDIR_CUPS}/etc/cups/cupsd.conf.default
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_CUPS}/usr/bin/
+ ${CP} ${WRKINST}/usr/share/doc/cups/index.html \
+ ${IDIR_CUPS}/usr/share/doc/cups/
+ ${CP} ${WRKINST}/usr/share/doc/cups/*.css \
+ ${IDIR_CUPS}/usr/share/doc/cups/
+ ${CP} ${WRKINST}/usr/share/doc/cups/images \
+ ${IDIR_CUPS}/usr/share/doc/cups/
+ rm -f ${IDIR_CUPS}/usr/bin/cups-config
+ ${CP} ${WRKINST}/usr/lib/libcups.so* ${IDIR_CUPS}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/cups/cgi-bin/* ${IDIR_CUPS}/usr/lib/cups/cgi-bin/
+ ${CP} ${WRKINST}/usr/lib/cups/daemon/* ${IDIR_CUPS}/usr/lib/cups/daemon/
+ ${CP} ${WRKINST}/usr/share/cups/banners/* \
+ ${IDIR_CUPS}/usr/share/cups/banners/
+ ${CP} ${WRKINST}/usr/share/cups/templates/*.tmpl \
+ ${IDIR_CUPS}/usr/share/cups/templates/
+ ${CP} ${WRKINST}/usr/sbin/* ${IDIR_CUPS}/usr/sbin/
+ ${CP} ./files/etc/cups/* ${IDIR_CUPS}/etc/cups/
+ ${INSTALL_BIN} ./files/cupsd.init \
+ ${IDIR_CUPS}/etc/init.d/cupsd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cups/files/cupsd.init b/package/cups/files/cupsd.init
new file mode 100644
index 000000000..d22f55c96
--- /dev/null
+++ b/package/cups/files/cupsd.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${cups:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/cache/cups ] || mkdir -p /var/cache/cups
+ [ -d /var/cups ] || mkdir -p /var/cups/tmp
+ [ -d /var/cups/spool/cups/tmp ] || mkdir -p /var/cups/spool/cups/tmp
+ /usr/sbin/cupsd -c /etc/cups/cupsd.conf
+ ;;
+stop)
+ killall cupsd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/cups/files/etc/cups/classes.conf b/package/cups/files/etc/cups/classes.conf
new file mode 100644
index 000000000..15afda75a
--- /dev/null
+++ b/package/cups/files/etc/cups/classes.conf
@@ -0,0 +1,7 @@
+########################################################################
+# #
+# This is a sample class configuration file. This file is included #
+# from the main configuration file (cups.conf) and lists all of the #
+# printer classes known to the system. #
+# #
+########################################################################
diff --git a/package/cups/files/etc/cups/client.conf b/package/cups/files/etc/cups/client.conf
new file mode 100644
index 000000000..c8d9f910e
--- /dev/null
+++ b/package/cups/files/etc/cups/client.conf
@@ -0,0 +1,9 @@
+########################################################################
+# #
+# This is the CUPS client configuration file. This file is used to #
+# define client-specific parameters, such as the default server or #
+# default encryption settings. #
+# #
+########################################################################
+
+Encryption Never
diff --git a/package/cups/files/etc/cups/cupsd.conf b/package/cups/files/etc/cups/cupsd.conf
new file mode 100644
index 000000000..89aa40c2a
--- /dev/null
+++ b/package/cups/files/etc/cups/cupsd.conf
@@ -0,0 +1,34 @@
+AccessLog syslog
+ErrorLog syslog
+LogLevel info
+PageLog syslog
+PreserveJobHistory No
+PreserveJobFiles No
+AutoPurgeJobs Yes
+MaxJobs 25
+MaxPrinterHistory 10
+RequestRoot /tmp/cups
+User cups
+Group cups
+RIPCache 512k
+TempDir /tmp/cups
+Port 631
+HostNameLookups Off
+KeepAlive On
+Browsing On
+BrowseProtocols cups
+
+<Location />
+AuthType Basic
+AuthClass System
+Order Allow,Deny
+Allow From All
+</Location>
+
+<Location /admin>
+AuthType Basic
+AuthClass System
+Order Allow,Deny
+Allow From All
+</Location>
+
diff --git a/package/cups/files/etc/cups/printers.conf b/package/cups/files/etc/cups/printers.conf
new file mode 100644
index 000000000..88bba1b13
--- /dev/null
+++ b/package/cups/files/etc/cups/printers.conf
@@ -0,0 +1,23 @@
+<DefaultPrinter USB>
+Info USB Printer
+Location
+DeviceURI usb:/dev/usb/lp0
+State Idle
+Accepting Yes
+JobSheets none none
+QuotaPeriod 0
+PageLimit 0
+KLimit 0
+</Printer>
+
+<Printer LP>
+Info Parallel Port Printer
+Location
+DeviceURI parallel:/dev/printers/0
+State Idle
+Accepting Yes
+JobSheets none none
+QuotaPeriod 0
+PageLimit 0
+KLimit 0
+</Printer>
diff --git a/package/cups/ipkg/cups.conffiles b/package/cups/ipkg/cups.conffiles
new file mode 100644
index 000000000..bed6faa3f
--- /dev/null
+++ b/package/cups/ipkg/cups.conffiles
@@ -0,0 +1,4 @@
+/etc/cups/classes.conf
+/etc/cups/client.conf
+/etc/cups/cupsd.conf
+/etc/cups/printers.conf
diff --git a/package/cups/ipkg/cups.control b/package/cups/ipkg/cups.control
new file mode 100644
index 000000000..de3d14250
--- /dev/null
+++ b/package/cups/ipkg/cups.control
@@ -0,0 +1,5 @@
+Package: cups
+Priority: optional
+Section: net
+Depends: zlib, libpthread
+Description: Common Unix Printing System
diff --git a/package/cups/ipkg/cups.postinst b/package/cups/ipkg/cups.postinst
new file mode 100644
index 000000000..fa191bee7
--- /dev/null
+++ b/package/cups/ipkg/cups.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+gid=$(get_next_gid)
+add_user cups $(get_next_uid) $gid /tmp
+add_group cups $gid
+add_rcconf cups cups NO
diff --git a/package/cups/patches/patch-Makefile b/package/cups/patches/patch-Makefile
new file mode 100644
index 000000000..663b989b9
--- /dev/null
+++ b/package/cups/patches/patch-Makefile
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cups-1.3.10.orig/Makefile 2009-03-12 22:34:21.000000000 +0100
++++ cups-1.3.10/Makefile 2009-05-09 22:41:42.000000000 +0200
+@@ -19,7 +19,7 @@ include Makedefs
+ # Directories to make...
+ #
+
+-DIRS = cups backend berkeley cgi-bin filter locale man monitor \
++DIRS = cups backend berkeley cgi-bin filter locale monitor \
+ notifier scheduler systemv test \
+ $(PHPDIR) \
+ conf data doc $(FONTS) ppd templates
diff --git a/package/cups/patches/patch-configure b/package/cups/patches/patch-configure
new file mode 100644
index 000000000..773a2da96
--- /dev/null
+++ b/package/cups/patches/patch-configure
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cups-1.3.10.orig/configure 2009-04-16 22:02:06.000000000 +0200
++++ cups-1.3.10/configure 2009-05-09 22:44:29.000000000 +0200
+@@ -9254,7 +9254,7 @@ if test "$libdir" = "\${exec_prefix}/lib
+ ;;
+ Linux*)
+ if test -d /usr/lib64; then
+- libdir="$exec_prefix/lib64"
++ libdir="$exec_prefix/lib"
+ fi
+ ;;
+ HP-UX*)
diff --git a/package/curl/Config.in b/package/curl/Config.in
new file mode 100644
index 000000000..a74a823e2
--- /dev/null
+++ b/package/curl/Config.in
@@ -0,0 +1,26 @@
+config ADK_COMPILE_CURL
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBCURL
+
+config ADK_PACKAGE_LIBCURL
+ prompt "libcurl........................... A client-side URL transfer library"
+ tristate
+ default n
+ select ADK_COMPILE_CURL
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ help
+ A client-side URL transfer library.
+
+ http://curl.haxx.se/
+
+config ADK_PACKAGE_CURL
+ prompt "curl............................ A client-side URL transfer tool"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBCURL
+ help
+ A client-side URL transfer tool.
+
+ http://curl.haxx.se/
diff --git a/package/curl/Makefile b/package/curl/Makefile
new file mode 100644
index 000000000..1d6f4855c
--- /dev/null
+++ b/package/curl/Makefile
@@ -0,0 +1,55 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= curl
+PKG_VERSION:= 7.19.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 35f51ac7bcff689b2d2d6e38a3c4d1ae
+MASTER_SITES:= http://curl.haxx.se/download/ \
+ http://www.mirrorspace.org/curl/ \
+ http://curl.mirror.internet.tp/download/ \
+ ftp://ftp.sunet.se/pub/www/utilities/curl/ \
+ ftp://ftp.planetmirror.com/pub/curl/ \
+ http://www.mirrormonster.com/curl/download/ \
+ http://curl.mirrors.cyberservers.net/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CURL,curl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBCURL,libcurl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-thread \
+ --enable-cookies \
+ --enable-crypto-auth \
+ --enable-nonblocking \
+ --enable-file \
+ --enable-ftp \
+ --enable-http \
+ --disable-ares \
+ --disable-dict \
+ --disable-gopher \
+ --disable-ldap \
+ --disable-manual \
+ --disable-sspi \
+ --disable-telnet \
+ --disable-verbose \
+ --with-random="/dev/urandom" \
+ --with-ssl="${STAGING_DIR}/usr" \
+ --without-ca-bundle \
+ --without-gnutls \
+ --without-libidn
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_CURL}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/curl ${IDIR_CURL}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_LIBCURL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libcurl.so.* ${IDIR_LIBCURL}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/curl/ipkg/curl.control b/package/curl/ipkg/curl.control
new file mode 100644
index 000000000..2678e0430
--- /dev/null
+++ b/package/curl/ipkg/curl.control
@@ -0,0 +1,5 @@
+Package: curl
+Priority: optional
+Section: net
+Description: a client-side URL transfer tool
+Depends: libcurl
diff --git a/package/curl/ipkg/libcurl.control b/package/curl/ipkg/libcurl.control
new file mode 100644
index 000000000..435a3192a
--- /dev/null
+++ b/package/curl/ipkg/libcurl.control
@@ -0,0 +1,5 @@
+Package: libcurl
+Priority: optional
+Section: libs
+Description: a client-side URL transfer library
+Depends: libopenssl, zlib
diff --git a/package/curl/patches/patch-configure b/package/curl/patches/patch-configure
new file mode 100644
index 000000000..d046721f0
--- /dev/null
+++ b/package/curl/patches/patch-configure
@@ -0,0 +1,24 @@
+$Id$
+
+ Don't do *THAT* for cross-compiling.
+
+--- curl-7.16.3.orig/configure 2007-06-25 11:18:41.000000000 +0200
++++ curl-7.16.3/configure 2007-08-02 17:44:28.000000000 +0200
+@@ -25783,17 +25783,6 @@ fi
+
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+-
+- if test "$OPENSSL_ENABLED" = "1"; then
+- if test -n "$LIB_OPENSSL"; then
+-
+- LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
+- export LD_LIBRARY_PATH
+- { echo "$as_me:$LINENO: Added $LIB_OPENSSL to LD_LIBRARY_PATH" >&5
+-echo "$as_me: Added $LIB_OPENSSL to LD_LIBRARY_PATH" >&6;}
+- fi
+- fi
+-
+ fi
+
+
diff --git a/package/cutter/Config.in b/package/cutter/Config.in
new file mode 100644
index 000000000..5d027b689
--- /dev/null
+++ b/package/cutter/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_CUTTER
+ prompt "cutter............................ allows an user to abort TCP/IP connections"
+ tristate
+ default n
+ help
+ "Cutter" is an open source program that allows Linux firewall
+ administrators to abort TCP/IP connections routed over the
+ firewall or router on which it is run.
+
+ http://www.lowth.com/cutter/
diff --git a/package/cutter/Makefile b/package/cutter/Makefile
new file mode 100755
index 000000000..68af7df76
--- /dev/null
+++ b/package/cutter/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cutter
+PKG_VERSION:= 1.03
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 50093db9b64277643969ee75b83ebbd1
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+MASTER_SITES:= http://www.lowth.com/cutter/software/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CUTTER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${WRKBUILD}/cutter.c -o ${WRKBUILD}/cutter
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_CUTTER}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/cutter ${IDIR_CUTTER}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cutter/ipkg/cutter.control b/package/cutter/ipkg/cutter.control
new file mode 100644
index 000000000..6c9169222
--- /dev/null
+++ b/package/cutter/ipkg/cutter.control
@@ -0,0 +1,5 @@
+Package: cutter
+Architecture: mipsel
+Section: net
+Description: "Cutter" is an open source program that allows Linux firewall administrators to abort TCP/IP connections routed over the firewall or router on which it is run.
+Priority: optional
diff --git a/package/cutter/patches/patch-cutter_c b/package/cutter/patches/patch-cutter_c
new file mode 100644
index 000000000..781c17401
--- /dev/null
+++ b/package/cutter/patches/patch-cutter_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cutter-1.03.orig/cutter.c 2005-04-30 09:01:03.000000000 +0200
++++ cutter-1.03/cutter.c 2008-10-09 11:32:40.000000000 +0200
+@@ -297,7 +297,7 @@ int send_rst(
+ pheader.placeholder=0;
+ pheader.protocol=IPPROTO_TCP;
+ pheader.tcp_length=htons(TCPHDR);
+- bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
++ memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
+ tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
+
+ /*
+@@ -419,7 +419,7 @@ int send_rst(
+ pheader.placeholder=0;
+ pheader.protocol=IPPROTO_TCP;
+ pheader.tcp_length=htons(TCPHDR);
+- bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
++ memcpy((char *)&pheader.tcp,(char *)&tpack.tcp,TCPHDR);
+ tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
+
+ i_result = sendto(raw_sock,&tpack,PACKETSIZE,0,(void*)&hisaddr,sizeof(hisaddr));
diff --git a/package/cxxtools/Config.in b/package/cxxtools/Config.in
new file mode 100644
index 000000000..bdc0168a7
--- /dev/null
+++ b/package/cxxtools/Config.in
@@ -0,0 +1,26 @@
+config ADK_PACKAGE_CXXTOOLS
+ prompt "cxxtools.......................... cxxtools"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBICONV
+ help
+ http://www.tntnet.org
+
+choice
+prompt "C++ library to use"
+depends on ADK_PACKAGE_CXXTOOLS
+default ADK_COMPILE_CXXTOOLS_WITH_STDCXX if ADK_TARGET_LIB_GLIBC
+default ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC
+
+config ADK_COMPILE_CXXTOOLS_WITH_STDCXX
+ bool "Standard C++ library"
+ select ADK_PACKAGE_LIBSTDCXX
+ help
+
+config ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX
+ bool "Embedded uClibc++ library"
+ select ADK_PACKAGE_UCLIBCXX
+ help
+
+endchoice
diff --git a/package/cxxtools/Makefile b/package/cxxtools/Makefile
new file mode 100644
index 000000000..42c2042c6
--- /dev/null
+++ b/package/cxxtools/Makefile
@@ -0,0 +1,44 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cxxtools
+PKG_VERSION:= 1.4.8
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 16ce92a83beb925fa5138fc9a52d55af
+MASTER_SITES:= http://www.tntnet.org/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,CXXTOOLS,cxxtools,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifeq (${ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX},y)
+TCXXFLAGS+= -fno-builtin -nostdinc++ -I${STAGING_DIR}/usr/include/uClibc++
+TLDFLAGS+= -luClibc++ -liconv -lm -nodefaultlibs
+DEPENDS= "libgcc, uclibc++, libiconv"
+else
+TLDFLAGS+= -liconv -shared
+DEPENDS= "libgcc, libiconv, libstdcxx"
+endif
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-libiconv-prefix='${STAGING_DIR}/usr'
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto confprog
+
+ifeq (${ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX},y)
+# add workaround because libtool tries to link libstdc++
+post-configure:
+ ${SED} 's#postdeps="-lstdc.*#postdeps=""#' \
+ ${WRKBUILD}/libtool
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_CXXTOOLS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libcxxtools.so.* ${IDIR_CXXTOOLS}/usr/lib/
+ echo Depends: ${DEPENDS} >>${IDIR_CXXTOOLS}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cxxtools/ipkg/cxxtools.control b/package/cxxtools/ipkg/cxxtools.control
new file mode 100644
index 000000000..130236235
--- /dev/null
+++ b/package/cxxtools/ipkg/cxxtools.control
@@ -0,0 +1,4 @@
+Package: cxxtools
+Priority: optional
+Section: net
+Description: cxxtools
diff --git a/package/cxxtools/patches/patch-demo_Makefile_in b/package/cxxtools/patches/patch-demo_Makefile_in
new file mode 100644
index 000000000..0fcb3bca3
--- /dev/null
+++ b/package/cxxtools/patches/patch-demo_Makefile_in
@@ -0,0 +1,67 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- cxxtools-1.4.8.orig/demo/Makefile.in 2008-05-26 19:51:34.000000000 +0200
++++ cxxtools-1.4.8/demo/Makefile.in 2009-04-28 22:29:02.476545131 +0200
+@@ -40,7 +40,7 @@ host_triplet = @host@
+ noinst_PROGRAMS = arg$(EXEEXT) arg-set$(EXEEXT) cgi$(EXEEXT) \
+ dir$(EXEEXT) dlloader$(EXEEXT) dynbuffer$(EXEEXT) \
+ getini$(EXEEXT) hd$(EXEEXT) httprequest$(EXEEXT) \
+- iconv$(EXEEXT) log$(EXEEXT) logbench$(EXEEXT) logsh$(EXEEXT) \
++ log$(EXEEXT) logbench$(EXEEXT) logsh$(EXEEXT) \
+ md5sum$(EXEEXT) mime$(EXEEXT) multifstream$(EXEEXT) \
+ netcat$(EXEEXT) netio$(EXEEXT) netmsg$(EXEEXT) \
+ pipestream$(EXEEXT) pool$(EXEEXT) signals$(EXEEXT) \
+@@ -96,10 +96,6 @@ am_httprequest_OBJECTS = httprequest.$(O
+ httprequest_OBJECTS = $(am_httprequest_OBJECTS)
+ httprequest_LDADD = $(LDADD)
+ httprequest_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la
+-am_iconv_OBJECTS = iconv.$(OBJEXT)
+-iconv_OBJECTS = $(am_iconv_OBJECTS)
+-iconv_LDADD = $(LDADD)
+-iconv_DEPENDENCIES = $(top_builddir)/src/libcxxtools.la
+ am_log_OBJECTS = log.$(OBJEXT)
+ log_OBJECTS = $(am_log_OBJECTS)
+ log_LDADD = $(LDADD)
+@@ -170,7 +166,7 @@ CXXLINK = $(LIBTOOL) --tag=CXX --mode=li
+ SOURCES = $(arg_SOURCES) $(arg_set_SOURCES) $(cgi_SOURCES) \
+ $(cxxlog_SOURCES) $(dir_SOURCES) $(dlloader_SOURCES) \
+ $(dynbuffer_SOURCES) $(getini_SOURCES) $(hd_SOURCES) \
+- $(httprequest_SOURCES) $(iconv_SOURCES) $(log_SOURCES) \
++ $(httprequest_SOURCES) $(log_SOURCES) \
+ $(logbench_SOURCES) $(logsh_SOURCES) $(md5sum_SOURCES) \
+ $(mime_SOURCES) $(multifstream_SOURCES) $(netcat_SOURCES) \
+ $(netio_SOURCES) $(netmsg_SOURCES) $(pipestream_SOURCES) \
+@@ -179,7 +175,7 @@ SOURCES = $(arg_SOURCES) $(arg_set_SOURC
+ DIST_SOURCES = $(arg_SOURCES) $(arg_set_SOURCES) $(cgi_SOURCES) \
+ $(cxxlog_SOURCES) $(dir_SOURCES) $(dlloader_SOURCES) \
+ $(dynbuffer_SOURCES) $(getini_SOURCES) $(hd_SOURCES) \
+- $(httprequest_SOURCES) $(iconv_SOURCES) $(log_SOURCES) \
++ $(httprequest_SOURCES) $(log_SOURCES) \
+ $(logbench_SOURCES) $(logsh_SOURCES) $(md5sum_SOURCES) \
+ $(mime_SOURCES) $(multifstream_SOURCES) $(netcat_SOURCES) \
+ $(netio_SOURCES) $(netmsg_SOURCES) $(pipestream_SOURCES) \
+@@ -319,7 +315,6 @@ dynbuffer_SOURCES = dynbuffer.cpp
+ getini_SOURCES = getini.cpp
+ hd_SOURCES = hd.cpp
+ httprequest_SOURCES = httprequest.cpp
+-iconv_SOURCES = iconv.cpp
+ log_SOURCES = log.cpp
+ logbench_SOURCES = logbench.cpp
+ logsh_SOURCES = logsh.cpp
+@@ -415,9 +410,6 @@ hd$(EXEEXT): $(hd_OBJECTS) $(hd_DEPENDEN
+ httprequest$(EXEEXT): $(httprequest_OBJECTS) $(httprequest_DEPENDENCIES)
+ @rm -f httprequest$(EXEEXT)
+ $(CXXLINK) $(httprequest_LDFLAGS) $(httprequest_OBJECTS) $(httprequest_LDADD) $(LIBS)
+-iconv$(EXEEXT): $(iconv_OBJECTS) $(iconv_DEPENDENCIES)
+- @rm -f iconv$(EXEEXT)
+- $(CXXLINK) $(iconv_LDFLAGS) $(iconv_OBJECTS) $(iconv_LDADD) $(LIBS)
+ log$(EXEEXT): $(log_OBJECTS) $(log_DEPENDENCIES)
+ @rm -f log$(EXEEXT)
+ $(CXXLINK) $(log_LDFLAGS) $(log_OBJECTS) $(log_LDADD) $(LIBS)
+@@ -477,7 +469,6 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getini.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hd.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httprequest.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logbench.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logsh.Po@am__quote@
diff --git a/package/cyrus-sasl/Config.in b/package/cyrus-sasl/Config.in
new file mode 100644
index 000000000..6a03bbfb4
--- /dev/null
+++ b/package/cyrus-sasl/Config.in
@@ -0,0 +1,14 @@
+config ADK_COMPILE_CYRUS_SASL
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBSASL2
+
+config ADK_PACKAGE_LIBSASL2
+ prompt "libsasl2.......................... General purpose authentication library"
+ tristate
+ default n
+ select ADK_COMPILE_CYRUS_SASL
+ help
+ A general purpose authentication library.
+
+ http://asg.web.cmu.edu/sasl/
diff --git a/package/cyrus-sasl/Makefile b/package/cyrus-sasl/Makefile
new file mode 100644
index 000000000..56a1d3838
--- /dev/null
+++ b/package/cyrus-sasl/Makefile
@@ -0,0 +1,74 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= cyrus-sasl
+PKG_VERSION:= 2.1.22
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 45dde9d19193ae9dd388eb68b2027bc9
+MASTER_SITES:= http://ftp.andrew.cmu.edu/pub/cyrus-mail/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBSASL2,libsasl2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-sample \
+ --enable-staticdlopen \
+ --disable-java \
+ --disable-alwaystrue \
+ --disable-checkapop \
+ --enable-cram \
+ --enable-digest \
+ --disable-otp \
+ --disable-srp \
+ --disable-srp-setpass \
+ --disable-krb4 \
+ --disable-gssapi \
+ --disable-gss_mutexes \
+ --enable-plain \
+ --enable-anon \
+ --disable-login \
+ --disable-ntlm \
+ --disable-sql \
+ --without-dblib \
+ --without-gdbm \
+ --with-devrandom="/dev/urandom" \
+ --without-pam \
+ --without-saslauthd \
+ --without-authdaemond \
+ --without-pwcheck \
+ --with-ipctype=unix \
+ --with-openssl="${STAGING_DIR}/usr" \
+ --without-des \
+ --without-opie \
+ --without-ldap \
+ --without-mysql \
+ --without-pgsql \
+ --without-sqlite \
+ --without-rc4 \
+ --without-dmalloc \
+ --without-sfio \
+ --disable-static
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+pre-build:
+ ${MAKE} -C ${WRKBUILD}/include \
+ CC="${HOSTCC}" \
+ LINK="${HOSTCC} -o makemd5 -lc" \
+ LIBS="" \
+ CFLAGS="" \
+ LDFLAGS="" \
+ CPPFLAGS="" \
+ makemd5
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBSASL2}/usr/lib/sasl2
+ ${CP} ${WRKINST}/usr/lib/libsasl2.so.* ${IDIR_LIBSASL2}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/sasl2/lib*.so.* ${IDIR_LIBSASL2}/usr/lib/sasl2/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/cyrus-sasl/ipkg/libsasl2.control b/package/cyrus-sasl/ipkg/libsasl2.control
new file mode 100644
index 000000000..82e0f0a48
--- /dev/null
+++ b/package/cyrus-sasl/ipkg/libsasl2.control
@@ -0,0 +1,4 @@
+Package: libsasl2
+Priority: optional
+Section: libs
+Description: a general purpose authentication library
diff --git a/package/damageproto/Config.in b/package/damageproto/Config.in
new file mode 100644
index 000000000..93fdbbffe
--- /dev/null
+++ b/package/damageproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_DAMAGEPROTO
+ prompt "damageproto............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/damageproto/Makefile b/package/damageproto/Makefile
new file mode 100644
index 000000000..6b7f45e7a
--- /dev/null
+++ b/package/damageproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= damageproto
+PKG_VERSION:= 1.1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= bce4477a6edd774dfca175ea46e1ba76
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/davfs2/Config.in b/package/davfs2/Config.in
new file mode 100644
index 000000000..d1f1c2a6d
--- /dev/null
+++ b/package/davfs2/Config.in
@@ -0,0 +1,43 @@
+config ADK_PACKAGE_DAVFS2
+ prompt "davfs2............................ WebDAV filesystem"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBICONV
+ select ADK_PACKAGE_NEON
+ help
+ WebDAV is an extension to HTTP that allows remote collaborative
+ authoring of Web resources, defined in RFC 2518.
+
+ davfs2 is a Linux file system driver that allows you to mount a
+ WebDAV server as a local file system, like a disk drive. This
+ way applications can access resources on a Web server without
+ knowing anything about HTTP or WebDAV.
+
+ davfs2 runs as a daemon in userspace. It uses the kernel file
+ system coda or fuse. To connect to the WebDAV
+ server it makes use of the neon library. Neon supports TLS/SSL
+ (using OpenSSL or GnuTLS) and access via proxy server.
+
+ davfs2 allows you to e.g.
+ * use a WebDAV server as workspace for a geographically
+ distributed work group.
+ * save documents on a WebDAV server and access and edit them
+ via internet from wherever you want.
+ * edit a web site in place, using your preferred development
+ tools.
+
+choice
+prompt "kernel filesystem interface"
+depends on ADK_PACKAGE_DAVFS2
+
+config ADK_PACKAGE_DAVFS2_FUSE
+ bool "use the FUSE filesystem interface"
+ select ADK_PACKAGE_FUSE_UTILS
+config ADK_PACKAGE_DAVFS2_CODA
+ bool "use the CODA filesystem interface"
+ select ADK_KPACKAGE_KMOD_CODA_FS
+config ADK_PACKAGE_DAVFS2_BOTH
+ bool "use both filesystem interfaces"
+ select ADK_PACKAGE_FUSE_UTILS
+ select ADK_KPACKAGE_KMOD_CODA_FS
+endchoice
diff --git a/package/davfs2/Makefile b/package/davfs2/Makefile
new file mode 100644
index 000000000..bb09a8b1e
--- /dev/null
+++ b/package/davfs2/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= davfs2
+PKG_VERSION= 1.3.3
+PKG_RELEASE= 1
+PKG_MD5SUM= 57def26e4d6d63527e01612d10fd0515
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=dav/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DAVFS2,davfs2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-neon
+CONFIGURE_ENV+= LIBS=-liconv
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+ifeq (${ADK_PACKAGE_DAVFS2_FUSE},y)
+DEPS= fuse-utils, kmod-fuse, libfuse, libiconv, neon
+else ifeq (${ADK_PACKAGE_DAVFS2_CODA},y)
+DEPS= kmod-fs-coda, libiconv, neon
+else
+DEPS= kmod-fs-coda, fuse-utils, kmod-fuse, libfuse, libiconv, neon
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DAVFS2}/etc/davfs2
+ ${INSTALL_DIR} ${IDIR_DAVFS2}/usr/sbin
+ $(CP) ${WRKINST}/etc/davfs2/{davfs2.conf,secrets} \
+ ${IDIR_DAVFS2}/etc/davfs2
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/mount.davfs \
+ ${IDIR_DAVFS2}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/umount.davfs \
+ ${IDIR_DAVFS2}/usr/sbin
+ echo 'Depends: ${DEPS}' >>${IDIR_DAVFS2}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/davfs2/ipkg/davfs2.conffiles b/package/davfs2/ipkg/davfs2.conffiles
new file mode 100644
index 000000000..c831d9d59
--- /dev/null
+++ b/package/davfs2/ipkg/davfs2.conffiles
@@ -0,0 +1,2 @@
+/etc/davfs2/davfs2.conf
+/etc/davfs2/secrets
diff --git a/package/davfs2/ipkg/davfs2.control b/package/davfs2/ipkg/davfs2.control
new file mode 100644
index 000000000..87d85e9df
--- /dev/null
+++ b/package/davfs2/ipkg/davfs2.control
@@ -0,0 +1,4 @@
+Package: davfs2
+Priority: optional
+Section: admin
+Description: WebDAV filesystem
diff --git a/package/davfs2/ipkg/davfs2.postinst b/package/davfs2/ipkg/davfs2.postinst
new file mode 100644
index 000000000..1d333c4a6
--- /dev/null
+++ b/package/davfs2/ipkg/davfs2.postinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+gid=$(get_next_gid)
+add_group davfs2 $gid
+add_user davfs2 $(get_next_uid) $gid /nonexistent
diff --git a/package/davfs2/patches/patch-src_cache_c b/package/davfs2/patches/patch-src_cache_c
new file mode 100644
index 000000000..ac8b0b4f1
--- /dev/null
+++ b/package/davfs2/patches/patch-src_cache_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- davfs2-1.3.3.orig/src/cache.c 2008-06-24 21:32:50.000000000 +0200
++++ davfs2-1.3.3/src/cache.c 2008-12-08 00:06:51.000000000 +0100
+@@ -23,7 +23,6 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <error.h>
diff --git a/package/davfs2/patches/patch-src_dav_coda2_c b/package/davfs2/patches/patch-src_dav_coda2_c
new file mode 100644
index 000000000..1ef269348
--- /dev/null
+++ b/package/davfs2/patches/patch-src_dav_coda2_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- davfs2-1.3.3.orig/src/dav_coda2.c 2008-02-02 23:23:45.000000000 +0100
++++ davfs2-1.3.3/src/dav_coda2.c 2008-12-08 00:07:35.000000000 +0100
+@@ -23,7 +23,6 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
diff --git a/package/davfs2/patches/patch-src_dav_coda3_c b/package/davfs2/patches/patch-src_dav_coda3_c
new file mode 100644
index 000000000..9a4bee68b
--- /dev/null
+++ b/package/davfs2/patches/patch-src_dav_coda3_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- davfs2-1.3.3.orig/src/dav_coda3.c 2008-02-02 23:24:10.000000000 +0100
++++ davfs2-1.3.3/src/dav_coda3.c 2008-12-08 00:08:00.000000000 +0100
+@@ -23,7 +23,6 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
diff --git a/package/davfs2/patches/patch-src_dav_fuse5_c b/package/davfs2/patches/patch-src_dav_fuse5_c
new file mode 100644
index 000000000..21c92b9a5
--- /dev/null
+++ b/package/davfs2/patches/patch-src_dav_fuse5_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- davfs2-1.3.3.orig/src/dav_fuse5.c 2008-04-05 20:36:06.000000000 +0200
++++ davfs2-1.3.3/src/dav_fuse5.c 2008-12-08 00:08:26.000000000 +0100
+@@ -23,7 +23,6 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <stddef.h>
diff --git a/package/davfs2/patches/patch-src_dav_fuse7_c b/package/davfs2/patches/patch-src_dav_fuse7_c
new file mode 100644
index 000000000..846f4a98a
--- /dev/null
+++ b/package/davfs2/patches/patch-src_dav_fuse7_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- davfs2-1.3.3.orig/src/dav_fuse7.c 2008-04-09 21:43:34.000000000 +0200
++++ davfs2-1.3.3/src/dav_fuse7.c 2008-12-08 00:08:32.000000000 +0100
+@@ -23,7 +23,6 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <stddef.h>
diff --git a/package/davfs2/patches/patch-src_kernel_interface_c b/package/davfs2/patches/patch-src_kernel_interface_c
new file mode 100644
index 000000000..15d5c909b
--- /dev/null
+++ b/package/davfs2/patches/patch-src_kernel_interface_c
@@ -0,0 +1,31 @@
+$Id$
+--- davfs2-1.3.3.orig/src/kernel_interface.c 2008-04-05 20:43:04.000000000 +0200
++++ davfs2-1.3.3/src/kernel_interface.c 2008-12-08 00:09:01.000000000 +0100
+@@ -23,7 +23,6 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <errno.h>
+ #include <error.h>
+ #include <fcntl.h>
+@@ -173,7 +172,8 @@ static int init_coda(int *dev, dav_run_m
+ }
+
+ if (*dev <= 0) {
+- system("/sbin/modprobe coda &>/dev/null");
++ system("/sbin/insmod coda");
++ sleep(1);
+ minor = 0;
+ while (*dev <= 0 && minor < MAX_CODADEVS) {
+ char *path;
+@@ -240,7 +240,8 @@ static int init_fuse(int *dev, dav_run_m
+
+ *dev = open(path, O_RDWR | O_NONBLOCK);
+ if (*dev <= 0) {
+- system("/sbin/modprobe fuse &>/dev/null");
++ system("/sbin/insmod fuse");
++ sleep(1);
+ *dev = open(path, O_RDWR | O_NONBLOCK);
+ }
+ if (*dev <= 0) {
diff --git a/package/davfs2/patches/patch-src_mount_davfs_c b/package/davfs2/patches/patch-src_mount_davfs_c
new file mode 100644
index 000000000..ba0c030f2
--- /dev/null
+++ b/package/davfs2/patches/patch-src_mount_davfs_c
@@ -0,0 +1,69 @@
+$Id$
+--- davfs2-1.3.3.orig/src/mount_davfs.c 2008-06-30 20:29:42.000000000 +0200
++++ davfs2-1.3.3/src/mount_davfs.c 2008-12-08 00:20:01.000000000 +0100
+@@ -23,12 +23,10 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <ctype.h>
+ #include <errno.h>
+ #include <error.h>
+ #include <fcntl.h>
+-#include <fstab.h>
+ #include <getopt.h>
+ #include <grp.h>
+ #include <limits.h>
+@@ -602,15 +600,18 @@ static char *check_double_mounts(dav_arg
+ free to choose them. They should be configured in davfs2.conf anyway. */
+ static void check_fstab(const dav_args *args) {
+
++#if 0
+ dav_args *n_args = new_args();
+ n_args->mopts = DAV_USER_MOPTS;
+
+ setfsent();
+ struct fstab *ft = getfsfile(mpoint);
+ if (ft == NULL)
++#endif
+ error(EXIT_FAILURE, 0, _("no entry for %s found in %s"), url,
+- _PATH_FSTAB);
++ "/etc/fstab");
+
++#if 0
+ if (strcmp(url, ft->fs_spec) != 0) {
+ char *fstab_url = decode_octal(ft->fs_spec);
+ if (strcmp(url, fstab_url) != 0)
+@@ -642,6 +643,7 @@ static void check_fstab(const dav_args *
+
+ endfsent();
+ delete_args(n_args);
++#endif
+ }
+
+
+@@ -661,7 +663,7 @@ static void check_mountpoint(dav_args *a
+ struct passwd *pw;
+
+ if (*mpoint != '/') {
+- char *mp = canonicalize_file_name(mpoint);
++ char *mp = realpath(mpoint, NULL);
+ if (mp == NULL)
+ error(EXIT_FAILURE, 0,
+ _("can't evaluate path of mount point %s"), mpoint);
+@@ -1754,6 +1756,7 @@ static dav_args *new_args(void) {
+
+ static void log_dbg_config(char *argv[], dav_args *args) {
+
++ /*
+ size_t len;
+ char * cmdline;
+ if (argz_create(argv, &cmdline, &len) == 0) {
+@@ -1761,6 +1764,7 @@ static void log_dbg_config(char *argv[],
+ syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), cmdline);
+ free(cmdline);
+ }
++ */
+
+ syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
+ "Configuration:");
diff --git a/package/davfs2/patches/patch-src_umount_davfs_c b/package/davfs2/patches/patch-src_umount_davfs_c
new file mode 100644
index 000000000..387476f39
--- /dev/null
+++ b/package/davfs2/patches/patch-src_umount_davfs_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- davfs2-1.3.3.orig/src/umount_davfs.c 2008-01-11 22:40:18.000000000 +0100
++++ davfs2-1.3.3/src/umount_davfs.c 2008-12-08 00:38:43.000000000 +0100
+@@ -114,7 +114,7 @@ int main(int argc, char *argv[]) {
+ if (optind < (argc - 1))
+ error(EXIT_FAILURE, 0, _("too many arguments"));
+
+- char *mpoint = canonicalize_file_name(argv[optind]);
++ char *mpoint = realpath(argv[optind], NULL);
+ if (mpoint == NULL)
+ mpoint = argv[optind];
+ if (mpoint == NULL || *mpoint != '/')
diff --git a/package/davfs2/patches/patch-src_webdav_c b/package/davfs2/patches/patch-src_webdav_c
new file mode 100644
index 000000000..35ad27492
--- /dev/null
+++ b/package/davfs2/patches/patch-src_webdav_c
@@ -0,0 +1,55 @@
+$Id$
+
+ cf. http://sourceforge.net/tracker/index.php?func=detail&aid=1594808&group_id=26275&atid=386747
+
+--- davfs2-1.3.3.orig/src/webdav.c 2008-06-28 19:20:07.000000000 +0200
++++ davfs2-1.3.3/src/webdav.c 2008-12-08 00:37:23.000000000 +0100
+@@ -23,7 +23,6 @@
+
+ #include "config.h"
+
+-#include <argz.h>
+ #include <errno.h>
+ #include <error.h>
+ #include <fcntl.h>
+@@ -34,6 +33,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#include <regex.h>
+ #include <time.h>
+ #include <unistd.h>
+
+@@ -406,6 +406,11 @@ void dav_init_webdav(const char *scheme,
+ suri = (ne_uri *) ne_calloc(sizeof(ne_uri));
+ ne_fill_server_uri(session, suri);
+
++ /* begin of GMX hack */
++ ne_server_capabilities caps;
++ ne_options(session, "/", &caps);
++ /* end of GMX hack */
++
+ if (use_locks) {
+ locks = ne_lockstore_create();
+ if (lock_owner == NULL) {
+@@ -1859,13 +1864,18 @@ static int ssl_verify(void *userdata, in
+ "or there might be a man-in-the-middle-attack.\n"));
+ printf(_("Accept certificate for this session? [y,N] "));
+ char *s = NULL;
++ regex_t *re;
+ size_t n = 0;
+ ssize_t len = 0;
+ len = getline(&s, &n, stdin);
+ if (len < 0)
+ abort();
+- if (rpmatch(s) < 1)
+- ret = -1;
++ if (regcomp(&re, "^[yY]", REG_EXTENDED) != 0) {
++ if (regexec(&re, s, (size_t)0, NULL, 0) < 1) {
++ regfree(&re);
++ ret = -1;
++ }
++ }
+ free(s);
+ }
+ }
diff --git a/package/dbus/Config.in b/package/dbus/Config.in
new file mode 100644
index 000000000..8e8ca33fc
--- /dev/null
+++ b/package/dbus/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_DBUS
+ prompt "dbus.............................. DBUS library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBEXPAT
+ help
+ DBUS library.
+
+ http://www.freedesktop.org/wiki/Software/dbus
+
diff --git a/package/dbus/Makefile b/package/dbus/Makefile
new file mode 100644
index 000000000..09219b38a
--- /dev/null
+++ b/package/dbus/Makefile
@@ -0,0 +1,47 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dbus
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 7
+PKG_MD5SUM:= 0552a9b54beb4a044951b7cdbc8fc855
+MASTER_SITES:= http://dbus.freedesktop.org/releases/dbus/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DBUS,dbus,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --disable-tests \
+ --disable-abstract-sockets \
+ --without-x \
+ --enable-checks \
+ --with-xml=expat \
+ --disable-dnotify \
+ --disable-kqueue \
+ --disable-xml-docs \
+ --disable-doxygen-docs
+CONFIGURE_ENV+= ac_cv_have_abstract_sockets=no
+BUILD_STYLE:= auto
+INSTALL_STYLE:= confprog auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DBUS}/etc
+ ${INSTALL_DIR} ${IDIR_DBUS}/usr/lib
+ ${INSTALL_DIR} ${IDIR_DBUS}/usr/bin
+ ${INSTALL_DIR} $(STAGING_DIR)/usr/include/dbus-1.0/dbus
+ ${CP} ${WRKINST}/etc/dbus-1 ${IDIR_DBUS}/etc/
+ ${CP} ${WRKINST}/usr/lib/libdbus-1.so.* ${IDIR_DBUS}/usr/lib/
+ $(CP) $(WRKINST)/usr/lib/dbus-1.0/include/dbus/dbus-arch-deps.h \
+ $(STAGING_DIR)/usr/include/dbus-1.0/dbus/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/dbus-daemon ${IDIR_DBUS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/dbus-launch ${IDIR_DBUS}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_DBUS}/etc/init.d
+ ${INSTALL_BIN} ./files/dbus.init \
+ ${IDIR_DBUS}/etc/init.d/dbus
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dbus/files/dbus.init b/package/dbus/files/dbus.init
new file mode 100644
index 000000000..dd1761271
--- /dev/null
+++ b/package/dbus/files/dbus.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${dbus:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p /var/run/dbus
+ dbus-daemon --config-file=/etc/dbus-1/system.conf
+ ;;
+stop)
+ killall dbus-daemon
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/dbus/ipkg/dbus.control b/package/dbus/ipkg/dbus.control
new file mode 100644
index 000000000..d1cecbd8a
--- /dev/null
+++ b/package/dbus/ipkg/dbus.control
@@ -0,0 +1,5 @@
+Package: dbus
+Priority: optional
+Section: net
+Description: DBUS library
+Depends: libexpat
diff --git a/package/dbus/ipkg/dbus.postinst b/package/dbus/ipkg/dbus.postinst
new file mode 100644
index 000000000..8dd0a50c8
--- /dev/null
+++ b/package/dbus/ipkg/dbus.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+gid=$(get_next_gid)
+add_group messagebus $gid
+add_user messagebus $(get_next_uid) $gid /var/run/dbus
+add_rcconf dbus dbus NO
diff --git a/package/deco/Config.in b/package/deco/Config.in
new file mode 100644
index 000000000..3bdde9a21
--- /dev/null
+++ b/package/deco/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_DECO
+ prompt "deco.............................. Text-based full featured file manager"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ A clone of Norton Commander for Unix. Text-based, full featured
+ file manager.
+
+ http://deco.sourceforge.net/
diff --git a/package/deco/Makefile b/package/deco/Makefile
new file mode 100644
index 000000000..0a7bb2619
--- /dev/null
+++ b/package/deco/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= deco
+PKG_VERSION:= 39
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f77f60e8be0cae1f814cba1ef61bf4d0
+DISTFILES:= ${PKG_NAME}${PKG_VERSION}.tgz
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=deco/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DECO,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_DECO}/usr/bin
+ ${INSTALL_DIR} ${IDIR_DECO}/usr/lib/deco
+ ${INSTALL_BIN} ${WRKBUILD}/deco ${IDIR_DECO}/usr/bin/deco
+ ${INSTALL_DATA} ${WRKBUILD}/profile ${IDIR_DECO}/usr/lib/deco/profile
+ ${INSTALL_DATA} ${WRKBUILD}/menu ${IDIR_DECO}/usr/lib/deco/menu
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/deco/ipkg/deco.control b/package/deco/ipkg/deco.control
new file mode 100644
index 000000000..f7e8c4348
--- /dev/null
+++ b/package/deco/ipkg/deco.control
@@ -0,0 +1,5 @@
+Package: deco
+Priority: optional
+Section: misc
+Depends: libncurses
+Description: Text-based, full featured file manager
diff --git a/package/deco/patches/100-tty.c.patch b/package/deco/patches/100-tty.c.patch
new file mode 100644
index 000000000..f37e4e2a6
--- /dev/null
+++ b/package/deco/patches/100-tty.c.patch
@@ -0,0 +1,11 @@
+--- src/tty.c 2005-09-25 00:23:41.671022039 -0700
++++ str_new/tty.c 2005-09-25 01:09:37.189119615 -0700
+@@ -14,7 +14,7 @@
+ #if HAVE_TERMIOS_H
+ # include <sys/termios.h>
+ # if HAVE_SYS_IOCTL_H
+-# include <sys/ioctl.h>
++/*# include <sys/ioctl.h>*/
+ # endif
+ # define HAVE_TERMIO_H 1
+ # define termio termios
diff --git a/package/device-mapper/Config.in b/package/device-mapper/Config.in
new file mode 100644
index 000000000..162b07794
--- /dev/null
+++ b/package/device-mapper/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_DEVICE_MAPPER
+ prompt "device-mapper..................... device mapper tool and lib"
+ tristate
+ default n
+ help
+ device mapper tool and libdevice mapper tool and lib
diff --git a/package/device-mapper/Makefile b/package/device-mapper/Makefile
new file mode 100644
index 000000000..1d97db9a3
--- /dev/null
+++ b/package/device-mapper/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= device-mapper
+PKG_VERSION:= 1.02.28
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c9ae0776994a419f9e1ba842164bb626
+DISTFILES:= ${PKG_NAME}.${PKG_VERSION}.tgz
+MASTER_SITES:= ftp://sources.redhat.com/pub/dm/
+
+WRKDIST= ${WRKDIR}/${PKG_NAME}.${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DEVICE_MAPPER,device-mapper,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifeq ($(DEBUG),1)
+CONFIGURE_ARGS+= --enable-debug
+else
+CONFIGURE_ARGS+= --disable-debug
+endif
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-user="" --with-group="" \
+ --with-optimisation="" \
+ --with-kernel-dir=${LINUX_DIR}
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+INSTALL_TARGET+= install_static_lib
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DEVICE_MAPPER}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_DEVICE_MAPPER}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libdevmapper.so* \
+ ${IDIR_DEVICE_MAPPER}/usr/lib
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dmsetup \
+ ${IDIR_DEVICE_MAPPER}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/device-mapper/ipkg/device-mapper.control b/package/device-mapper/ipkg/device-mapper.control
new file mode 100644
index 000000000..cb6cddad9
--- /dev/null
+++ b/package/device-mapper/ipkg/device-mapper.control
@@ -0,0 +1,4 @@
+Package: device-mapper
+Priority: optional
+Section: utils
+Description: device mapper tools and libs
diff --git a/package/device-mapper/patches/patch-lib_Makefile_in b/package/device-mapper/patches/patch-lib_Makefile_in
new file mode 100644
index 000000000..d20b9d5c9
--- /dev/null
+++ b/package/device-mapper/patches/patch-lib_Makefile_in
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- device-mapper.1.02.28.orig/lib/Makefile.in 2008-06-06 22:44:35.000000000 +0200
++++ device-mapper.1.02.28/lib/Makefile.in 2008-11-11 12:18:25.000000000 +0100
+@@ -76,7 +76,7 @@ install_static: install_@interface@_stat
+ $(LN_S) -f libdevmapper.a.$(LIB_VERSION) $(libdir)/libdevmapper.a
+
+ install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX)
+- $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
++ $(INSTALL) -D $(OWNER) $(GROUP) -m 755 $(STRIP) $< \
+ $(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
+
+ install_pkgconfig:
+@@ -84,7 +84,7 @@ install_pkgconfig:
+ $(usrlibdir)/pkgconfig/devmapper.pc
+
+ install_ioctl_static: ioctl/libdevmapper.a
+- $(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
++ $(INSTALL) -D $(OWNER) $(GROUP) -m 755 $(STRIP) $< \
+ $(libdir)/libdevmapper.a.$(LIB_VERSION)
+
+ $(VERSIONED_SHLIB): %.$(LIB_SUFFIX).$(LIB_VERSION): $(interface)/%.$(LIB_SUFFIX)
diff --git a/package/device-mapper/patches/patch-make_tmpl_in b/package/device-mapper/patches/patch-make_tmpl_in
new file mode 100644
index 000000000..69285fbe5
--- /dev/null
+++ b/package/device-mapper/patches/patch-make_tmpl_in
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- device-mapper.1.02.28.orig/make.tmpl.in 2008-06-06 22:44:35.000000000 +0200
++++ device-mapper.1.02.28/make.tmpl.in 2009-01-04 14:47:10.000000000 +0100
+@@ -25,10 +25,10 @@ MSGFMT = @MSGFMT@
+ LN_S = @LN_S@
+ LIBS = @LIBS@
+ DEFS += @DEFS@
+-CFLAGS += @CFLAGS@
++CFLAGS ?= @CFLAGS@
+ CLDFLAGS += @CLDFLAGS@
+ LDDEPS += @LDDEPS@
+-LDFLAGS += @LDFLAGS@
++LDFLAGS ?= @LDFLAGS@
+ LIB_SUFFIX = @LIB_SUFFIX@
+
+ # Setup directory variables
diff --git a/package/dhcp-forwarder/Config.in b/package/dhcp-forwarder/Config.in
new file mode 100644
index 000000000..cfe8f7d36
--- /dev/null
+++ b/package/dhcp-forwarder/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_DHCP_FORWARDER
+ prompt "dhcp-forwarder.................... DHCP relay agent"
+ tristate
+ default n
+ help
+ A DHCP relay agent
+
+ http://www.nongnu.org/dhcp-fwd/
diff --git a/package/dhcp-forwarder/Makefile b/package/dhcp-forwarder/Makefile
new file mode 100644
index 000000000..880e1a3cb
--- /dev/null
+++ b/package/dhcp-forwarder/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dhcp-forwarder
+PKG_VERSION:= 0.7
+PKG_RELEASE:= 12
+PKG_MD5SUM:= e7f876e615ebc3f96418f6477b4451e2
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://savannah.nongnu.org/download/dhcp-fwd/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DHCP_FORWARDER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull="yes"
+CONFIGURE_ARGS+= --disable-dietlibc
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= cfg_filename="/etc/dhcp-fwd.conf"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DHCP_FORWARDER}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_DHCP_FORWARDER}/usr/sbin
+ ${INSTALL_DATA} ${WRKBUILD}/contrib/dhcp-fwd.conf \
+ ${IDIR_DHCP_FORWARDER}/etc/
+ ${INSTALL_BIN} ./files/dhcp-fwd.init \
+ ${IDIR_DHCP_FORWARDER}/etc/init.d/dhcp-fwd
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dhcp-fwd \
+ ${IDIR_DHCP_FORWARDER}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dhcp-forwarder/files/dhcp-fwd.init b/package/dhcp-forwarder/files/dhcp-fwd.init
new file mode 100644
index 000000000..1481095fe
--- /dev/null
+++ b/package/dhcp-forwarder/files/dhcp-fwd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${dhcp-fwd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ dhcp-fwd
+ ;;
+stop)
+ killall dhcp-fwd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles b/package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles
new file mode 100644
index 000000000..70be85a8a
--- /dev/null
+++ b/package/dhcp-forwarder/ipkg/dhcp-forwarder.conffiles
@@ -0,0 +1 @@
+/etc/dhcp-fwd.conf
diff --git a/package/dhcp-forwarder/ipkg/dhcp-forwarder.control b/package/dhcp-forwarder/ipkg/dhcp-forwarder.control
new file mode 100644
index 000000000..9958ddb39
--- /dev/null
+++ b/package/dhcp-forwarder/ipkg/dhcp-forwarder.control
@@ -0,0 +1,4 @@
+Package: dhcp-forwarder
+Priority: optional
+Section: net
+Description: a DHCP relay agent
diff --git a/package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst b/package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst
new file mode 100644
index 000000000..9ba16f5b0
--- /dev/null
+++ b/package/dhcp-forwarder/ipkg/dhcp-forwarder.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf dhcp_fwd dhcp_fwd NO
diff --git a/package/dhcp-forwarder/patches/00-big_endian.patch b/package/dhcp-forwarder/patches/00-big_endian.patch
new file mode 100644
index 000000000..add157d3f
--- /dev/null
+++ b/package/dhcp-forwarder/patches/00-big_endian.patch
@@ -0,0 +1,11 @@
+--- dhcp-forwarder-0.7/src/dhcp.h 2004-06-22 03:46:56.000000000 -0700
++++ dhcp-forwarder-0.7-x/src/dhcp.h 2005-10-06 17:04:14.000000000 -0700
+@@ -89,7 +89,7 @@
+ optDHCP_COOKIE = 0x63538263u,
+ flgDHCP_BCAST = 0x0080u
+ #else
+- DHCP_COOKIE = 0x63825363u,
++ optDHCP_COOKIE = 0x63825363u,
+ flgDHCP_BCAST = 0x8000u
+ #endif
+ };
diff --git a/package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch b/package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch
new file mode 100644
index 000000000..ef8491330
--- /dev/null
+++ b/package/dhcp-forwarder/patches/01-getpwnmam_getgrnam.patch
@@ -0,0 +1,35 @@
+diff -pur dhcp-forwarder-0.7-orig/src/wrappers.h dhcp-forwarder-0.7-patched/src/wrappers.h
+--- dhcp-forwarder-0.7-orig/src/wrappers.h 2004-06-22 12:46:56.000000000 +0200
++++ dhcp-forwarder-0.7-patched/src/wrappers.h 2005-12-27 12:28:10.464289435 +0100
+@@ -65,7 +65,14 @@ Egetgrnam(char const *name)
+ /*@*/
+ {
+ /*@observer@*/struct group const *res = getgrnam(name);
+- FatalErrnoError(res==0, 1, "getgrnam()");
++
++ FatalErrnoError((res == NULL) && (errno != 0), 1, "getgrnam()");
++
++ if (res == NULL)
++ {
++ fprintf (stderr, "No such group: `%s'\n", name);
++ exit (1);
++ }
+
+ /*@-freshtrans@*/
+ /*@-mustfreefresh@*/
+@@ -80,7 +87,14 @@ Egetpwnam(char const *name)
+ /*@*/
+ {
+ struct passwd const *res = getpwnam(name);
+- FatalErrnoError(res==0, 1, "getpwnam()");
++
++ FatalErrnoError((res == NULL) && (errno != 0), 1, "getpwnam()");
++
++ if (res == NULL)
++ {
++ fprintf (stderr, "No such user: `%s'\n", name);
++ exit (1);
++ }
+
+ return res;
+ }
diff --git a/package/dhcp/Config.in b/package/dhcp/Config.in
new file mode 100644
index 000000000..37d2aa7b6
--- /dev/null
+++ b/package/dhcp/Config.in
@@ -0,0 +1,30 @@
+#menu "dhcp.............................. ISC DHCP (Dynamic Host Configuration Protocol) implementation"
+
+config ADK_COMPILE_DHCP
+ tristate
+ default n
+ depends ADK_PACKAGE_DHCP_RELAY || ADK_PACKAGE_DHCP_SERVER
+
+config ADK_PACKAGE_DHCP_RELAY
+ prompt "dhcp-relay........................ ISC DHCP relay"
+ tristate
+ default n
+ select ADK_COMPILE_DHCP
+ help
+ ISC (Internet Software Consortium) DHCP (Dynamic Host Configuration
+ Protocol) relay daemon.
+
+ http://www.isc.org/
+
+config ADK_PACKAGE_DHCP_SERVER
+ prompt "dhcp-server....................... ISC DHCP server"
+ tristate
+ default n
+ select ADK_COMPILE_DHCP
+ help
+ ISC (Internet Software Consortium) DHCP (Dynamic Host Configuration
+ Protocol) server daemon.
+
+ http://www.isc.org/
+
+#endmenu
diff --git a/package/dhcp/Makefile b/package/dhcp/Makefile
new file mode 100644
index 000000000..c2e49a0b6
--- /dev/null
+++ b/package/dhcp/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dhcp
+PKG_VERSION:= 3.0.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 426bfa1712ababaff4be6dadee9c1982
+MASTER_SITES:= ftp://ftp.isc.org/isc/dhcp/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DHCP_RELAY,dhcp-relay,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,DHCP_SERVER,dhcp-server,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-configure:
+ (cd ${WRKBUILD} ; \
+ ./configure --copts "${TARGET_CFLAGS}" linux-2.2 \
+ );
+
+MAKE_FLAGS+= RANLIB=${TARGET_CROSS}ranlib
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DHCP_RELAY}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/dhcrelay ${IDIR_DHCP_RELAY}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_DHCP_SERVER}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_DHCP_SERVER}/usr/sbin
+ ${INSTALL_BIN} ./files/dhcpd.init \
+ ${IDIR_DHCP_SERVER}/etc/init.d/dhcpd
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/dhcpd ${IDIR_DHCP_SERVER}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dhcp/files/dhcpd.init b/package/dhcp/files/dhcpd.init
new file mode 100644
index 000000000..31c182948
--- /dev/null
+++ b/package/dhcp/files/dhcpd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostart)
+ [[ $dhcpd_flags = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p /var/state/dhcp
+ touch /var/state/dhcp/dhcpd.leases
+ dhcpd $dhcpd_flags
+ ;;
+autostop|stop)
+ killall dhcpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/dhcp/ipkg/dhcp-relay.control b/package/dhcp/ipkg/dhcp-relay.control
new file mode 100644
index 000000000..fbd3d20b8
--- /dev/null
+++ b/package/dhcp/ipkg/dhcp-relay.control
@@ -0,0 +1,4 @@
+Package: dhcp-relay
+Priority: optional
+Section: net
+Description: ISC DHCP relay
diff --git a/package/dhcp/ipkg/dhcp-server.control b/package/dhcp/ipkg/dhcp-server.control
new file mode 100644
index 000000000..a9b86a183
--- /dev/null
+++ b/package/dhcp/ipkg/dhcp-server.control
@@ -0,0 +1,4 @@
+Package: dhcp-server
+Priority: optional
+Section: net
+Description: ISC DHCP server
diff --git a/package/dhcp/ipkg/dhcp-server.postinst b/package/dhcp/ipkg/dhcp-server.postinst
new file mode 100644
index 000000000..592120cdc
--- /dev/null
+++ b/package/dhcp/ipkg/dhcp-server.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf 'e.g. "eth0.1 eth1"' dhcpd_flags
diff --git a/package/dhcp6/Config.in b/package/dhcp6/Config.in
new file mode 100644
index 000000000..cbb5bccc4
--- /dev/null
+++ b/package/dhcp6/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_DHCP6
+ prompt "dhcp6............................. IPv6 DHCP server and client"
+ depends on ADK_IPV6
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ This is the first ever open source implementation of Dynamic
+ Host Configuration Protocol for IPv6 (DHCPv6) server and client
+ on Linux Operating System. The server provides leases
+ (durations or lifetimes) on IPv6 addresses to the clients who
+ request for it
diff --git a/package/dhcp6/Makefile b/package/dhcp6/Makefile
new file mode 100644
index 000000000..3aa5ddcc7
--- /dev/null
+++ b/package/dhcp6/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dhcp6
+PKG_VERSION:= 1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 86193dfa62137db3ea459543db4f1102
+DISTFILES:= dhcpv6-linux-${PKG_VERSION}.zip
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=dhcpv6-linux/}
+WRKDIST= ${WRKDIR}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DHCP6,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${MAKE} CC="${TARGET_CC}" STAGING_DIR=${STAGING_DIR} -C ${WRKBUILD}/server
+ ${MAKE} CC="${TARGET_CC}" STAGING_DIR=${STAGING_DIR} -C ${WRKBUILD}/client
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_DHCP6}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_DHCP6}/etc/dhcp{d6,6}
+ ${INSTALL_BIN} ${WRKBUILD}/client/cli ${IDIR_DHCP6}/usr/sbin/dhcp6client
+ ${INSTALL_BIN} ${WRKBUILD}/server/serv ${IDIR_DHCP6}/usr/sbin/dhcpd6
+ ${CP} ${WRKBUILD}/server/*.conf ${IDIR_DHCP6}/etc/dhcpd6/
+ ${CP} ${WRKBUILD}/client/*.conf ${IDIR_DHCP6}/etc/dhcp6/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dhcp6/ipkg/dhcp6.control b/package/dhcp6/ipkg/dhcp6.control
new file mode 100755
index 000000000..cc030a0e2
--- /dev/null
+++ b/package/dhcp6/ipkg/dhcp6.control
@@ -0,0 +1,5 @@
+Package: dhcp6
+Section: net
+Architecture: mipsel
+Priority: optional
+Description: This is the first ever open source implementation of Dynamic Host Configuration Protocol for IPv6 (DHCPv6) server and client on Linux Operating System. The server provides leases (durations or lifetimes) on IPv6 addresses to the clients who request for it.
diff --git a/package/dhcp6/ipkg/files/conffiles b/package/dhcp6/ipkg/files/conffiles
new file mode 100644
index 000000000..267baa94d
--- /dev/null
+++ b/package/dhcp6/ipkg/files/conffiles
@@ -0,0 +1,4 @@
+/etc/dhcpd6/dhcpd6.conf
+/etc/dhcpd6/leases6.conf
+/etc/dhcpd6/partial_leases6.conf
+/etc/dhcp6/sollicit.conf
diff --git a/package/dhcp6/patches/patch-client_Makefile b/package/dhcp6/patches/patch-client_Makefile
new file mode 100644
index 000000000..6004a355b
--- /dev/null
+++ b/package/dhcp6/patches/patch-client_Makefile
@@ -0,0 +1,58 @@
+$Id$
+--- w-dhcp6-1.0-1.orig/client/Makefile 2025-06-28 23:21:40.000000000 +0200
++++ w-dhcp6-1.0-1/client/Makefile 2008-10-20 13:29:40.000000000 +0200
+@@ -1,42 +1,40 @@
+-
+-CC = gcc
+ STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h states.h timer_val.h constants.h macros.h status_codes.h
+ OBJECT_FILES = client.o solicit.o clilib.o parse.o request.o decline.o renew.o rebind.o release.o
+ HEADER_FILES = solicit.h clilib.h parse.h request.h decline.h renew.h rebind.h release.h
+-
++IFLAGS = -I$(STAGING_DIR)/usr/include
+
+ dhcpv6_client : dhcpv6_client.c cli
+- $(CC) -g3 dhcpv6_client.c -o dhcpv6_client
++ $(CC) $(IFLAGS) dhcpv6_client.c -o dhcpv6_client
+
+ cli : $(OBJECT_FILES)
+- $(CC) -g3 $(OBJECT_FILES) -o cli -lncurses
++ $(CC) $(IFLAGS) $(OBJECT_FILES) -o cli -L$(STAGING_DIR)/usr/lib -lncurses
+
+ client.o : client.c $(STD_HEADERS) $(HEADER_FILES)
+- $(CC) -g3 -c client.c -o client.o
++ $(CC) $(IFLAGS) -c client.c -o client.o
+
+ release.o : release.c release.h clilib.h
+- $(CC) -g3 -c release.c -o release.o
++ $(CC) $(IFLAGS) -c release.c -o release.o
+
+ rebind.o : rebind.c rebind.h clilib.h
+- $(CC) -g3 -c rebind.c -o rebind.o
++ $(CC) $(IFLAGS) -c rebind.c -o rebind.o
+
+ renew.o : renew.c renew.h clilib.h
+- $(CC) -g3 -c renew.c -o renew.o
++ $(CC) $(IFLAGS) -c renew.c -o renew.o
+
+ request.o : request.c request.h clilib.h
+- $(CC) -g3 -c request.c -o request.o
++ $(CC) $(IFLAGS) -c request.c -o request.o
+
+ decline.o : decline.c decline.h clilib.h parse.h solicit.h
+- $(CC) -g3 -c decline.c -o decline.o
++ $(CC) $(IFLAGS) -c decline.c -o decline.o
+
+ solicit.o : solicit.c solicit.h clilib.h parse.h
+- $(CC) -g3 -c solicit.c -o solicit.o
++ $(CC) $(IFLAGS) -c solicit.c -o solicit.o
+
+ clilib.o : clilib.c clilib.h parse.h
+- $(CC) -g3 -c clilib.c -o clilib.o
++ $(CC) $(IFLAGS) -c clilib.c -o clilib.o
+
+ parse.o : parse.c parse.h clilib.h
+- $(CC) -g3 -c parse.c -o parse.o
++ $(CC) $(IFLAGS) -c parse.c -o parse.o
+
+ clean :
+ rm -f *.o cli dhcpv6_client
diff --git a/package/dhcp6/patches/patch-client_clilib_c b/package/dhcp6/patches/patch-client_clilib_c
new file mode 100644
index 000000000..a9f416fa6
--- /dev/null
+++ b/package/dhcp6/patches/patch-client_clilib_c
@@ -0,0 +1,22 @@
+$Id$
+--- w-dhcp6-1.0-1.orig/client/clilib.c Sat Jun 28 23:21:17 2025
++++ w-dhcp6-1.0-1/client/clilib.c Tue Jul 25 10:37:06 2006
+@@ -554,7 +554,7 @@ u_int8_t convert_character_to_hex (char
+
+ void generate_trans_id (u_int32_t *trans_id)
+ {
+- extern u_int32_t g_trans_id;
++ extern int g_trans_id;
+ time_t t;
+ srand (time (&t));
+ *trans_id = 0;
+@@ -890,9 +890,7 @@ void read_option (char *m, int index, in
+ break;
+
+ default :
+-#if DEBUG == 3
+ printf ("Unrecognized DUID type\n");
+-#endif
+ }
+
+ next_opt = (struct OPTIONS *) malloc (sizeof (struct OPTIONS));
diff --git a/package/dhcp6/patches/patch-client_macros_h b/package/dhcp6/patches/patch-client_macros_h
new file mode 100644
index 000000000..f918cd5fd
--- /dev/null
+++ b/package/dhcp6/patches/patch-client_macros_h
@@ -0,0 +1,10 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- w-dhcp6-1.0-1.orig/client/macros.h 2025-06-28 23:21:40.000000000 +0200
++++ w-dhcp6-1.0-1/client/macros.h 2008-10-20 15:31:08.000000000 +0200
+@@ -1,5 +1,5 @@
+ #define INITIALIZE_SOCKADDR(x){ \
+- bzero((char *) &(x), sizeof((x))); \
++ memset((char *) &(x), 0, sizeof((x))); \
+ (x).sin6_family = AF_INET6; \
+ (x).sin6_flowinfo = htonl(0); \
+ (x).sin6_scope_id = 0; \
diff --git a/package/dhcp6/patches/patch-client_solicit_c b/package/dhcp6/patches/patch-client_solicit_c
new file mode 100644
index 000000000..7214598f0
--- /dev/null
+++ b/package/dhcp6/patches/patch-client_solicit_c
@@ -0,0 +1,12 @@
+$Id$
+--- w-dhcp6-1.0-1.orig/client/solicit.c Sat Jun 28 23:21:17 2025
++++ w-dhcp6-1.0-1/client/solicit.c Tue Jul 25 10:37:07 2006
+@@ -18,7 +18,7 @@ struct DHCP_MESSAGE * create_solicit_mes
+ dhcp_message_ptr -> opt = add_client_id_option (interface_details);
+
+ opt_ptr = (struct OPTIONS *) dhcp_message_ptr -> opt;
+- (struct OPTIONS *) ((struct DUID *) opt_ptr -> opt_data) -> opt = add_ia_option (interface_details);
++ ((struct DUID *) opt_ptr -> opt_data) -> opt = add_ia_option (interface_details);
+ return dhcp_message_ptr;
+ }
+
diff --git a/package/dhcp6/patches/patch-server_Makefile b/package/dhcp6/patches/patch-server_Makefile
new file mode 100644
index 000000000..0ae2e4825
--- /dev/null
+++ b/package/dhcp6/patches/patch-server_Makefile
@@ -0,0 +1,38 @@
+$Id$
+--- w-dhcp6-1.0-1.orig/server/Makefile Fri Jun 28 14:49:42 2002
++++ w-dhcp6-1.0-1/server/Makefile Tue Jul 25 10:37:06 2006
+@@ -1,27 +1,26 @@
+-CC = gcc
+ STD_HEADERS = stdhead.h head.h struct.h options_type.h message_type.h macros.h status_codes.h constants.h
+ OBJECT_FILES = server.o lib.o advertise.o parse.o leases.o reply.o
+
+ serv: $(OBJECT_FILES)
+- $(CC) -g3 $(OBJECT_FILES) -o serv
++ $(CC) $(OBJECT_FILES) -o serv
+
+ lib.o: lib.c lib.h $(STD_HEADERS)
+- $(CC) -g3 -c lib.c -o lib.o
++ $(CC) -c lib.c -o lib.o
+
+ parse.o: parse.c parse.h $(STD_HEADERS)
+- $(CC) -g3 -c parse.c -o parse.o
++ $(CC) -c parse.c -o parse.o
+
+ leases.o: leases.c leases.h $(STD_HEADERS)
+- $(CC) -g3 -c leases.c -o leases.o
++ $(CC) -c leases.c -o leases.o
+
+ advertise.o: advertise.c advertise.h $(STD_HEADERS)
+- $(CC) -g3 -c advertise.c -o advertise.o
++ $(CC) -c advertise.c -o advertise.o
+
+ reply.o: reply.c reply.h $(STD_HEADERS)
+- $(CC) -g3 -c reply.c -o reply.o
++ $(CC) -c reply.c -o reply.o
+
+ server.o: server.c lib.h advertise.h reply.h leases.h parse.h $(STD_HEADERS)
+- $(CC) -g3 -c server.c -o server.o
++ $(CC) -c server.c -o server.o
+
+ clean:
+ rm -f *.o serv
diff --git a/package/dhcp6/patches/patch-server_macros_h b/package/dhcp6/patches/patch-server_macros_h
new file mode 100644
index 000000000..916e4c798
--- /dev/null
+++ b/package/dhcp6/patches/patch-server_macros_h
@@ -0,0 +1,10 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- w-dhcp6-1.0-1.orig/server/macros.h 2002-06-28 14:50:04.000000000 +0200
++++ w-dhcp6-1.0-1/server/macros.h 2008-10-20 15:30:53.000000000 +0200
+@@ -1,5 +1,5 @@
+ #define INITIALIZE_SOCKADDR(x){ \
+- bzero((char *) &(x), sizeof((x))); \
++ memset((char *) &(x), 0, sizeof((x))); \
+ (x).sin6_family = AF_INET6; \
+ (x).sin6_flowinfo = htonl(0); \
+ (x).sin6_scope_id = 0; \
diff --git a/package/dhcp6/patches/patch-server_reply_c b/package/dhcp6/patches/patch-server_reply_c
new file mode 100644
index 000000000..bafca5ae1
--- /dev/null
+++ b/package/dhcp6/patches/patch-server_reply_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- w-dhcp6-1.0-1.orig/server/reply.c 2002-06-28 14:50:04.000000000 +0200
++++ w-dhcp6-1.0-1/server/reply.c 2008-10-20 15:29:52.000000000 +0200
+@@ -147,7 +147,7 @@ struct DHCP_MESSAGE * create_dummy_reply
+ opt_ptr -> u_opt_len.opt_len = opt_src_ptr -> u_opt_len.opt_len;
+ ia_ptr = (struct IA *) malloc (sizeof (struct IA));
+ opt_ptr -> opt_data = ia_ptr;
+- bzero (ia_ptr, sizeof (struct IA));
++ memset (ia_ptr, 0, sizeof (struct IA));
+ ia_ptr -> u_iaid.iaid = ia_src_ptr -> u_iaid.iaid;
+
+ // set IAADDR option with values set to null
+@@ -159,7 +159,7 @@ struct DHCP_MESSAGE * create_dummy_reply
+ opt_ptr -> u_opt_len.opt_len = opt_src_ptr -> u_opt_len.opt_len;
+ iaaddr_ptr = (struct IA_ADDRESS *) malloc (sizeof (struct IA_ADDRESS));
+ opt_ptr -> opt_data = iaaddr_ptr;
+- bzero (iaaddr_ptr, sizeof (struct IA_ADDRESS));
++ memset (iaaddr_ptr, 0, sizeof (struct IA_ADDRESS));
+
+ return dhcp_message_ptr;
+ }
diff --git a/package/digitemp/Config.in b/package/digitemp/Config.in
new file mode 100644
index 000000000..2c1152661
--- /dev/null
+++ b/package/digitemp/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_DIGITEMP
+ prompt "digitemp.......................... Simple Tool to read 1-wire temperature sensors"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBUSB
+ help
+ DigiTemp is a simple to use program for reading values from
+ 1-wire devices. Its main use is for reading temperature
+ sensors, but it also reads counters, and understands the
+ 1-wire hubs with devices on different branches of the
+ network. DigiTemp now supports the following 1-wire
+ temperature sensors: DS18S20 (and DS1820), DS18B20, DS1822,
+ the DS2438 Smart Battery Monitor, DS2422 and DS2423
+ Counters, DS2409 MicroLAN Coupler (used in 1-wire hubs), and
+ the AAG TAI-8540 humidity sensor.
+
+ http://www.digitemp.com/
diff --git a/package/digitemp/Makefile b/package/digitemp/Makefile
new file mode 100644
index 000000000..841fa06e9
--- /dev/null
+++ b/package/digitemp/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= digitemp
+PKG_VERSION:= 3.3.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0b6cfb36d198767836de54d9fb11bbdb
+MASTER_SITES:= http://www.digitemp.com/software/linux/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DIGITEMP,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ALL_TARGET= ds2490
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_DIGITEMP}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/digitemp_DS2490 \
+ ${IDIR_DIGITEMP}/usr/sbin/digitemp_DS2490
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/digitemp/ipkg/digitemp.control b/package/digitemp/ipkg/digitemp.control
new file mode 100644
index 000000000..a1aff9b2c
--- /dev/null
+++ b/package/digitemp/ipkg/digitemp.control
@@ -0,0 +1,5 @@
+Package: digitemp
+Priority: optional
+Section: app
+Depends: libusb
+Description: DigiTemp is a simple to use program for reading values from 1-wire devices.
diff --git a/package/digitemp/patches/001-Makefile.patch b/package/digitemp/patches/001-Makefile.patch
new file mode 100644
index 000000000..a08164b86
--- /dev/null
+++ b/package/digitemp/patches/001-Makefile.patch
@@ -0,0 +1,29 @@
+--- digitemp-3.3.2.orig/Makefile 2004-02-04 15:17:10.000000000 +0100
++++ digitemp-3.3.2/Makefile 2006-08-16 20:17:27.000000000 +0200
+@@ -15,8 +15,6 @@
+
+ VERSION = 3.3.2
+
+-
+-CC = gcc
+ CFLAGS = -I./src -I./userial -O2 # -g -Wall
+ LIBS = -lm
+
+@@ -57,7 +55,7 @@
+ CFLAGS += -DLINUX
+
+ # Set LOCK to yes for serial port locking support
+- LOCK = yes
++ #LOCK = yes
+
+ endif
+
+@@ -123,7 +121,7 @@
+ $(CC) $(OBJS) $(ONEWIREOBJS) $(DS9097UOBJS) -o digitemp_DS9097U $(LIBS)
+
+ ds2490: $(OBJS) $(HDRS) $(ONEWIREOBJS) $(ONEWIREHDRS) $(DS2490OBJS)
+- $(CC) $(OBJS) $(ONEWIREOBJS) $(DS2490OBJS) -o digitemp_DS2490 $(LIBS)
++ $(CC) $(LDFLAGS) $(OBJS) $(ONEWIREOBJS) $(DS2490OBJS) -o digitemp_DS2490 $(LIBS)
+
+
+ # Clean up the object files and the sub-directory for distributions
diff --git a/package/dnsmasq/Config.in b/package/dnsmasq/Config.in
new file mode 100644
index 000000000..0fd2a5ce0
--- /dev/null
+++ b/package/dnsmasq/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_DNSMASQ
+ prompt "dnsmasq........................... Lightweight DNS and DHCP server"
+ tristate
+ default n
+ help
+ A lightweight DNS and DHCP server. It is intended to
+ provide coupled DNS and DHCP service to a LAN. Dnsmasq
+ supports static and dynamic DHCP leases and BOOTP/TFTP for
+ network booting of diskless machines.
+
+ http://www.thekelleys.org.uk/dnsmasq/
diff --git a/package/dnsmasq/Makefile b/package/dnsmasq/Makefile
new file mode 100644
index 000000000..11c9669a8
--- /dev/null
+++ b/package/dnsmasq/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dnsmasq
+PKG_VERSION:= 2.47
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4524081e56d0b935717d493e8e8d3e11
+MASTER_SITES:= http://thekelleys.org.uk/dnsmasq/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DNSMASQ,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE= manual
+MAKE_FLAGS+= BINDIR=/usr/sbin MANDIR=/usr/man COPTS="${TCFLAGS}"
+ifneq ($(ADK_IPV6),y)
+MAKE_FLAGS+= COPTS="${TCFLAGS} -DNO_IPV6"
+endif
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_DNSMASQ}/{etc/init.d,usr/sbin}
+ ${INSTALL_BIN} ${WRKBUILD}/src/dnsmasq ${IDIR_DNSMASQ}/usr/sbin/
+ ${INSTALL_DATA} files/dnsmasq.conf ${IDIR_DNSMASQ}/etc/dnsmasq.conf
+ ${INSTALL_BIN} files/dnsmasq.init ${IDIR_DNSMASQ}/etc/init.d/dnsmasq
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dnsmasq/files/dnsmasq.conf b/package/dnsmasq/files/dnsmasq.conf
new file mode 100644
index 000000000..086a0b7f7
--- /dev/null
+++ b/package/dnsmasq/files/dnsmasq.conf
@@ -0,0 +1,39 @@
+# filter what we send upstream
+user=dnsmasq
+domain-needed
+bogus-priv
+localise-queries
+
+# allow /etc/hosts and dhcp lookups via *.lan
+local=/lan/
+domain=lan
+expand-hosts
+
+# add more dhcp-range options for every subnet
+dhcp-range=192.168.1.129,192.168.1.254,255.255.255.0,72h
+interface=lo
+interface=eth0.0
+#interface=eth1
+interface=br0
+
+# Enable dnsmasq's built-in TFTP server
+#enable-tftp
+# Set the root directory for files available via TFTP.
+#tftp-root=/tftpboot
+
+dhcp-authoritative
+dhcp-leasefile=/tmp/dhcp.leases
+
+# use /etc/ethers for static hosts
+# <hwaddr> <ipaddr>
+#read-ethers
+
+# other useful options (0.0.0.0 means server itself)
+# default route(s):
+dhcp-option=3,0.0.0.0
+# DNS server(s):
+dhcp-option=6,0.0.0.0
+# NTP server(s):
+dhcp-option=42,0.0.0.0
+# WINS server(s):
+#dhcp-option=44,0.0.0.0
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
new file mode 100644
index 000000000..e92ad3acc
--- /dev/null
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+(autostop) ;;
+(autostart)
+ [[ $dns_dhcp = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/dnsmasq.conf ] || exit
+ /usr/sbin/dnsmasq
+ ;;
+(stop)
+ killall dnsmasq
+ ;;
+(restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+(*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/dnsmasq/ipkg/dnsmasq.conffiles b/package/dnsmasq/ipkg/dnsmasq.conffiles
new file mode 100644
index 000000000..e30eba8f6
--- /dev/null
+++ b/package/dnsmasq/ipkg/dnsmasq.conffiles
@@ -0,0 +1 @@
+/etc/dnsmasq.conf
diff --git a/package/dnsmasq/ipkg/dnsmasq.control b/package/dnsmasq/ipkg/dnsmasq.control
new file mode 100644
index 000000000..6f61edc65
--- /dev/null
+++ b/package/dnsmasq/ipkg/dnsmasq.control
@@ -0,0 +1,4 @@
+Package: dnsmasq
+Priority: essential
+Section: net
+Description: A lightweight DNS and DHCP server
diff --git a/package/dnsmasq/ipkg/dnsmasq.postinst b/package/dnsmasq/ipkg/dnsmasq.postinst
new file mode 100644
index 000000000..f2ff69e58
--- /dev/null
+++ b/package/dnsmasq/ipkg/dnsmasq.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+
+gid=$(get_next_gid)
+add_user dnsmasq $(get_next_uid) $gid /tmp
+add_group dnsmasq $gid
+add_rcconf dnsmasq dns_dhcp NO
diff --git a/package/dnsmasq/patches/patch-src_config_h b/package/dnsmasq/patches/patch-src_config_h
new file mode 100644
index 000000000..297097565
--- /dev/null
+++ b/package/dnsmasq/patches/patch-src_config_h
@@ -0,0 +1,23 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dnsmasq-2.47.orig/src/config.h 2009-02-05 13:14:24.000000000 +0100
++++ dnsmasq-2.47/src/config.h 2009-03-19 18:40:37.000000000 +0100
+@@ -45,7 +45,7 @@
+ # elif defined(__sun__) || defined (__sun)
+ # define LEASEFILE "/var/cache/dnsmasq.leases"
+ # else
+-# define LEASEFILE "/var/lib/misc/dnsmasq.leases"
++# define LEASEFILE "/tmp/dnsmasq.leases"
+ # endif
+ #endif
+
+@@ -282,8 +282,9 @@ typedef unsigned long in_addr_t;
+ /* We assume that systems which don't have IPv6
+ headers don't have ntop and pton either */
+
+-#if defined(INET6_ADDRSTRLEN) && defined(IPV6_V6ONLY) && !defined(NO_IPV6)
++#if defined(INET6_ADDRSTRLEN) && !defined(NO_IPV6)
+ # define HAVE_IPV6
++# define IPV6_V6ONLY 26
+ # define ADDRSTRLEN INET6_ADDRSTRLEN
+ # if defined(SOL_IPV6)
+ # define IPV6_LEVEL SOL_IPV6
diff --git a/package/dosfstools/Config.in b/package/dosfstools/Config.in
new file mode 100644
index 000000000..af9ea7902
--- /dev/null
+++ b/package/dosfstools/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_DOSFSTOOLS
+ prompt "dosfstools........................ Utilities to create and check MS-DOS FAT filesystems"
+ tristate
+ default n
+ help
+ Utilities to create and check MS-DOS FAT filesystems.
diff --git a/package/dosfstools/Makefile b/package/dosfstools/Makefile
new file mode 100644
index 000000000..36ce4187f
--- /dev/null
+++ b/package/dosfstools/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dosfstools
+PKG_VERSION:= 3.0.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 94c2ea84b191de958f765ee239457bd9
+MASTER_SITES:= http://www.daniel-baumann.ch/software/dosfstools/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DOSFSTOOLS,dosfstools,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= PREFIX="" \
+ OPTFLAGS="${TARGET_CFLAGS} -D_FILE_OFFSET_BITS=64"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DOSFSTOOLS}/sbin
+ ${CP} ${WRKINST}/sbin/dosfsck ${IDIR_DOSFSTOOLS}/sbin/
+ ${CP} ${WRKINST}/sbin/fsck.{msdos,vfat} ${IDIR_DOSFSTOOLS}/sbin/
+ ${CP} ${WRKINST}/sbin/mkdosfs ${IDIR_DOSFSTOOLS}/sbin/
+ ${CP} ${WRKINST}/sbin/mkfs.{msdos,vfat} ${IDIR_DOSFSTOOLS}/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dosfstools/ipkg/dosfstools.control b/package/dosfstools/ipkg/dosfstools.control
new file mode 100644
index 000000000..4ec52a01f
--- /dev/null
+++ b/package/dosfstools/ipkg/dosfstools.control
@@ -0,0 +1,4 @@
+Package: dosfstools
+Priority: optional
+Section: admin
+Description: Utilities to create and check MS-DOS FAT filesystems
diff --git a/package/dovecot/Config.in b/package/dovecot/Config.in
new file mode 100644
index 000000000..0baade464
--- /dev/null
+++ b/package/dovecot/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_DOVECOT
+ prompt "dovecot........................... an imap server"
+ tristate
+ default n
+ help
+ Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like
+ systems, written with security primarily in mind. Dovecot is an
+ excellent choice for both small and large installations. It's fast,
+ simple to set up, requires no special administration and it uses
+ very little memory.
diff --git a/package/dovecot/Makefile b/package/dovecot/Makefile
new file mode 100644
index 000000000..3e31c2f62
--- /dev/null
+++ b/package/dovecot/Makefile
@@ -0,0 +1,61 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dovecot
+PKG_VERSION:= 1.1.14
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 60b1deccc0ae77e5669060d2b1894e5e
+MASTER_SITES:= http://www.dovecot.org/releases/1.1/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DOVECOT,dovecot,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ignore_signed_size=1 \
+ have_rquota=no \
+ signed_size_t=no \
+ gmtime_max_time_t=32 \
+ fd_passing=yes \
+ lib_cv_va_copy=yes \
+ lib_cv___va_copy=yes \
+ lib_cv_va_val_copy=yes \
+ mmap_plays_with_write=yes \
+ i_cv_gmtime_max_time_t=31 \
+ i_cv_posix_fallocate_works=no \
+ i_cv_epoll_works=yes \
+ i_cv_signed_time_t=yes \
+ i_cv_mmap_plays_with_write=yes \
+ i_cv_signed_size_t=yes \
+ i_cv_c99_vsnprintf=yes \
+ i_cv_fd_passing=yes
+CONFIGURE_ARGS+= --with-notify=none \
+ --without-gssapi \
+ --without-pam \
+ --with-ioloop=epoll \
+ --with-ssl \
+ --with-moduledir=/usr/lib/dovecot/modules
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DOVECOT}/etc
+ ${INSTALL_DIR} ${IDIR_DOVECOT}/usr/sbin/dovecot
+ ${INSTALL_DATA} ./files/dovecot.conf ${IDIR_DOVECOT}/etc
+ ${INSTALL_DIR} ${IDIR_DOVECOT}/usr/lib/dovecot/modules/{imap,lda,pop3}
+ $(CP) ${WRKINST}/usr/lib/dovecot/modules/*.so \
+ ${IDIR_DOVECOT}/usr/lib/dovecot/modules/
+ $(CP) ${WRKINST}/usr/lib/dovecot/modules/imap/*.so \
+ ${IDIR_DOVECOT}/usr/lib/dovecot/modules/imap/
+ $(CP) ${WRKINST}/usr/lib/dovecot/modules/lda/*.so \
+ ${IDIR_DOVECOT}/usr/lib/dovecot/modules/lda/
+ $(CP) ${WRKINST}/usr/lib/dovecot/modules/pop3/*.so \
+ ${IDIR_DOVECOT}/usr/lib/dovecot/modules/pop3/
+ $(CP) ${WRKINST}/usr/sbin/dovecot/* \
+ ${IDIR_DOVECOT}/usr/sbin/dovecot/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dovecot/files/dovecot.conf b/package/dovecot/files/dovecot.conf
new file mode 100644
index 000000000..eb1a2cd01
--- /dev/null
+++ b/package/dovecot/files/dovecot.conf
@@ -0,0 +1,1153 @@
+## Dovecot configuration file
+
+# If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration
+
+# "dovecot -n" command gives a clean output of the changed settings. Use it
+# instead of copy&pasting this file when posting to the Dovecot mailing list.
+
+# '#' character and everything after it is treated as comments. Extra spaces
+# and tabs are ignored. If you want to use either of these explicitly, put the
+# value inside quotes, eg.: key = "# char and trailing whitespace "
+
+# Default values are shown for each setting, it's not required to uncomment
+# any of the lines. Exception to this are paths, they're just examples with
+# the real defaults being based on configure options. The paths listed here
+# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
+# --with-ssldir=/etc/ssl
+
+# Base directory where to store runtime data.
+#base_dir = /var/run/dovecot/
+
+# Protocols we want to be serving: imap imaps pop3 pop3s
+# If you only want to use dovecot-auth, you can set this to "none".
+protocols = imap imaps
+
+# A space separated list of IP or host addresses where to listen in for
+# connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
+# interfaces. Use "*, [::]" for listening both IPv4 and IPv6.
+#
+# If you want to specify ports for each service, you will need to configure
+# these settings inside the protocol imap/pop3 { ... } section, so you can
+# specify different ports for IMAP/POP3. For example:
+# protocol imap {
+# listen = *:10143
+# ssl_listen = *:10943
+# ..
+# }
+# protocol pop3 {
+# listen = *:10100
+# ..
+# }
+#listen = *
+
+# Disable LOGIN command and all other plaintext authentications unless
+# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
+# matches the local IP (ie. you're connecting from the same computer), the
+# connection is considered secure and plaintext authentication is allowed.
+#disable_plaintext_auth = yes
+
+# Should all IMAP and POP3 processes be killed when Dovecot master process
+# shuts down. Setting this to "no" means that Dovecot can be upgraded without
+# forcing existing client connections to close (although that could also be
+# a problem if the upgrade is eg. because of a security fix). This however
+# means that after master process has died, the client processes can't write
+# to log files anymore.
+#shutdown_clients = yes
+
+##
+## Logging
+##
+
+# Log file to use for error messages, instead of sending them to syslog.
+# /dev/stderr can be used to log into stderr.
+#log_path =
+
+# Log file to use for informational and debug messages.
+# Default is the same as log_path.
+#info_log_path =
+
+# Prefix for each line written to log file. % codes are in strftime(3)
+# format.
+#log_timestamp = "%b %d %H:%M:%S "
+
+# Syslog facility to use if you're logging to syslog. Usually if you don't
+# want to use "mail", you'll use local0..local7. Also other standard
+# facilities are supported.
+#syslog_facility = mail
+
+##
+## SSL settings
+##
+
+# IP or host address where to listen in for SSL connections. Defaults
+# to above if not specified.
+#ssl_listen =
+
+# Disable SSL/TLS support.
+#ssl_disable = no
+
+# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
+# dropping root privileges, so keep the key file unreadable by anyone but
+# root. Included doc/mkcert.sh can be used to easily generate self-signed
+# certificate, just make sure to update the domains in dovecot-openssl.cnf
+#ssl_cert_file = /etc/ssl/certs/dovecot.pem
+#ssl_key_file = /etc/ssl/private/dovecot.pem
+
+# If key file is password protected, give the password here. Alternatively
+# give it when starting dovecot with -p parameter. Since this file is often
+# world-readable, you may want to place this setting instead to a different
+# root owned 0600 file by using !include_try <path>.
+#ssl_key_password =
+
+# File containing trusted SSL certificate authorities. Set this only if you
+# intend to use ssl_verify_client_cert=yes. The CAfile should contain the
+# CA-certificate(s) followed by the matching CRL(s).
+#ssl_ca_file =
+
+# Request client to send a certificate. If you also want to require it, set
+# ssl_require_client_cert=yes in auth section.
+#ssl_verify_client_cert = no
+
+# Which field from certificate to use for username. commonName and
+# x500UniqueIdentifier are the usual choices. You'll also need to set
+# ssl_username_from_cert=yes.
+#ssl_cert_username_field = commonName
+
+# How often to regenerate the SSL parameters file. Generation is quite CPU
+# intensive operation. The value is in hours, 0 disables regeneration
+# entirely.
+#ssl_parameters_regenerate = 168
+
+# SSL ciphers to use
+#ssl_cipher_list = ALL:!LOW:!SSLv2
+
+# Show protocol level SSL errors.
+#verbose_ssl = no
+
+##
+## Login processes
+##
+
+# <doc/wiki/LoginProcess.txt>
+
+# Directory where authentication process places authentication UNIX sockets
+# which login needs to be able to connect to. The sockets are created when
+# running as root, so you don't have to worry about permissions. Note that
+# everything in this directory is deleted when Dovecot is started.
+#login_dir = /var/run/dovecot/login
+
+# chroot login process to the login_dir. Only reason not to do this is if you
+# wish to run the whole Dovecot without roots. <doc/wiki/Rootless.txt>
+#login_chroot = yes
+
+# User to use for the login process. Create a completely new user for this,
+# and don't use it anywhere else. The user must also belong to a group where
+# only it has access, it's used to control access for authentication process.
+# Note that this user is NOT used to access mails. <doc/wiki/UserIds.txt>
+#login_user = dovecot
+
+# Set max. process size in megabytes. If you don't use
+# login_process_per_connection you might need to grow this.
+#login_process_size = 64
+
+# Should each login be processed in it's own process (yes), or should one
+# login process be allowed to process multiple connections (no)? Yes is more
+# secure, espcially with SSL/TLS enabled. No is faster since there's no need
+# to create processes all the time.
+#login_process_per_connection = yes
+
+# Number of login processes to keep for listening new connections.
+#login_processes_count = 3
+
+# Maximum number of login processes to create. The listening process count
+# usually stays at login_processes_count, but when multiple users start logging
+# in at the same time more extra processes are created. To prevent fork-bombing
+# we check only once in a second if new processes should be created - if all
+# of them are used at the time, we double their amount until the limit set by
+# this setting is reached.
+#login_max_processes_count = 128
+
+# Maximum number of connections allowed per each login process. This setting
+# is used only if login_process_per_connection=no. Once the limit is reached,
+# the process notifies master so that it can create a new login process.
+#login_max_connections = 256
+
+# Greeting message for clients.
+#login_greeting = Dovecot ready.
+
+# Space-separated list of elements we want to log. The elements which have
+# a non-empty variable value are joined together to form a comma-separated
+# string.
+#login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
+
+# Login log format. %$ contains login_log_format_elements string, %s contains
+# the data we want to log.
+#login_log_format = %$: %s
+
+##
+## Mailbox locations and namespaces
+##
+
+# Location for users' mailboxes. This is the same as the old default_mail_env
+# setting. The default is empty, which means that Dovecot tries to find the
+# mailboxes automatically. This won't work if the user doesn't have any mail
+# yet, so you should explicitly tell Dovecot the full location.
+#
+# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
+# isn't enough. You'll also need to tell Dovecot where the other mailboxes are
+# kept. This is called the "root mail directory", and it must be the first
+# path given in the mail_location setting.
+#
+# There are a few special variables you can use, eg.:
+#
+# %u - username
+# %n - user part in user@domain, same as %u if there's no domain
+# %d - domain part in user@domain, empty if there's no domain
+# %h - home directory
+#
+# See doc/wiki/Variables.txt for full list. Some examples:
+#
+# mail_location = maildir:~/Maildir
+# mail_location = mbox:~/mail:INBOX=/var/mail/%u
+# mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
+#
+# <doc/wiki/MailLocation.txt>
+#
+#mail_location =
+
+# If you need to set multiple mailbox locations or want to change default
+# namespace settings, you can do it by defining namespace sections.
+# NOTE: Namespaces currently work ONLY with IMAP! POP3 and LDA currently ignore
+# namespaces completely, they use only the mail_location setting.
+#
+# You can have private, shared and public namespaces. The only difference
+# between them is how Dovecot announces them to client via NAMESPACE
+# extension. Shared namespaces are meant for user-owned mailboxes which are
+# shared to other users, while public namespaces are for more globally
+# accessible mailboxes.
+#
+# REMEMBER: If you add any namespaces, the default namespace must be added
+# explicitly, ie. mail_location does nothing unless you have a namespace
+# without a location setting. Default namespace is simply done by having a
+# namespace with empty prefix.
+#namespace private {
+ # Hierarchy separator to use. You should use the same separator for all
+ # namespaces or some clients get confused. '/' is usually a good one.
+ # The default however depends on the underlying mail storage format.
+ #separator =
+
+ # Prefix required to access this namespace. This needs to be different for
+ # all namespaces. For example "Public/".
+ #prefix =
+
+ # Physical location of the mailbox. This is in same format as
+ # mail_location, which is also the default for it.
+ #location =
+
+ # There can be only one INBOX, and this setting defines which namespace
+ # has it.
+ #inbox = no
+
+ # If namespace is hidden, it's not advertised to clients via NAMESPACE
+ # extension. You'll most likely also want to set list=no. This is mostly
+ # useful when converting from another server with different namespaces which
+ # you want to deprecate but still keep working. For example you can create
+ # hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
+ #hidden = yes
+
+ # Show the mailboxes under this namespace with LIST command. This makes the
+ # namespace visible for clients that don't support NAMESPACE extension.
+ #list = yes
+
+ # Namespace handles its own subscriptions. If set to "no", the parent
+ # namespace handles them (empty prefix should always have this as "yes")
+ #subscriptions = yes
+#}
+
+# System user and group used to access mails. If you use multiple, userdb
+# can override these by returning uid or gid fields. You can use either numbers
+# or names. <doc/wiki/UserIds>
+#mail_uid =
+#mail_gid =
+
+# Group to enable temporarily for privileged operations. Currently this is
+# used only with INBOX when either its initial creation or dotlocking fails.
+# Typically this is set to "mail" to give access to /var/mail.
+#mail_privileged_group =
+
+# Grant access to these supplementary groups for mail processes. Typically
+# these are used to set up access to shared mailboxes. Note that it may be
+# dangerous to set these if users can create symlinks (e.g. if "mail" group is
+# set here, ln -s /var/mail ~/mail/var could allow a user to delete others'
+# mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it).
+#mail_access_groups =
+
+# Allow full filesystem access to clients. There's no access checks other than
+# what the operating system does for the active UID/GID. It works with both
+# maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/
+# or ~user/.
+#mail_full_filesystem_access = no
+
+##
+## Mail processes
+##
+
+# Enable mail process debugging. This can help you figure out why Dovecot
+# isn't finding your mails.
+#mail_debug = no
+
+# Log prefix for mail processes. See doc/wiki/Variables.txt for list of
+# possible variables you can use.
+#mail_log_prefix = "%Us(%u): "
+
+# Max. number of lines a mail process is allowed to log per second before it's
+# throttled. 0 means unlimited. Typically there's no need to change this
+# unless you're using mail_log plugin, which may log a lot. This setting is
+# ignored while mail_debug=yes to avoid pointless throttling.
+#mail_log_max_lines_per_sec = 10
+
+# Don't use mmap() at all. This is required if you store indexes to shared
+# filesystems (NFS or clustered filesystem).
+#mmap_disable = no
+
+# Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
+# since version 3, so this should be safe to use nowadays by default.
+#dotlock_use_excl = yes
+
+# Don't use fsync() or fdatasync() calls. This makes the performance better
+# at the cost of potential data loss if the server (or the file server)
+# goes down.
+#fsync_disable = no
+
+# Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS caches
+# whenever needed. If you're using only a single mail server this isn't needed.
+#mail_nfs_storage = no
+# Mail index files also exist in NFS. Setting this to yes requires
+# mmap_disable=yes and fsync_disable=no.
+#mail_nfs_index = no
+
+# Locking method for index files. Alternatives are fcntl, flock and dotlock.
+# Dotlocking uses some tricks which may create more disk I/O than other locking
+# methods. NFS users: flock doesn't work, remember to change mmap_disable.
+#lock_method = fcntl
+
+# Drop all privileges before exec()ing the mail process. This is mostly
+# meant for debugging, otherwise you don't get core dumps. It could be a small
+# security risk if you use single UID for multiple users, as the users could
+# ptrace() each others processes then.
+#mail_drop_priv_before_exec = no
+
+# Show more verbose process titles (in ps). Currently shows user name and
+# IP address. Useful for seeing who are actually using the IMAP processes
+# (eg. shared mailboxes or if same uid is used for multiple accounts).
+#verbose_proctitle = no
+
+# Valid UID range for users, defaults to 500 and above. This is mostly
+# to make sure that users can't log in as daemons or other system users.
+# Note that denying root logins is hardcoded to dovecot binary and can't
+# be done even if first_valid_uid is set to 0.
+#first_valid_uid = 500
+#last_valid_uid = 0
+
+# Valid GID range for users, defaults to non-root/wheel. Users having
+# non-valid GID as primary group ID aren't allowed to log in. If user
+# belongs to supplementary groups with non-valid GIDs, those groups are
+# not set.
+#first_valid_gid = 1
+#last_valid_gid = 0
+
+# Maximum number of running mail processes. When this limit is reached,
+# new users aren't allowed to log in.
+#max_mail_processes = 512
+
+# Set max. process size in megabytes. Most of the memory goes to mmap()ing
+# files, so it shouldn't harm much even if this limit is set pretty high.
+#mail_process_size = 256
+
+# Maximum allowed length for mail keyword name. It's only forced when trying
+# to create new keywords.
+#mail_max_keyword_length = 50
+
+# ':' separated list of directories under which chrooting is allowed for mail
+# processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too).
+# This setting doesn't affect login_chroot, mail_chroot or auth chroot
+# settings.
+# WARNING: Never add directories here which local users can modify, that
+# may lead to root exploit. Usually this should be done only if you don't
+# allow shell access for users. <doc/wiki/Chrooting.txt>
+#valid_chroot_dirs =
+
+# Default chroot directory for mail processes. This can be overridden for
+# specific users in user database by giving /./ in user's home directory
+# (eg. /home/./user chroots into /home). Note that usually there is no real
+# need to do chrooting, Dovecot doesn't allow users to access files outside
+# their mail directory anyway. If your home directories are prefixed with
+# the chroot directory, append "/." to mail_chroot. <doc/wiki/Chrooting.txt>
+#mail_chroot =
+
+##
+## Mailbox handling optimizations
+##
+
+# The minimum number of mails in a mailbox before updates are done to cache
+# file. This allows optimizing Dovecot's behavior to do less disk writes at
+# the cost of more disk reads.
+#mail_cache_min_mail_count = 0
+
+# When IDLE command is running, mailbox is checked once in a while to see if
+# there are any new mails or other changes. This setting defines the minimum
+# time in seconds to wait between those checks. Dovecot can also use dnotify,
+# inotify and kqueue to find out immediately when changes occur.
+#mailbox_idle_check_interval = 30
+
+# Save mails with CR+LF instead of plain LF. This makes sending those mails
+# take less CPU, especially with sendfile() syscall with Linux and FreeBSD.
+# But it also creates a bit more disk I/O which may just make it slower.
+# Also note that if other software reads the mboxes/maildirs, they may handle
+# the extra CRs wrong and cause problems.
+#mail_save_crlf = no
+
+##
+## Maildir-specific settings
+##
+
+# By default LIST command returns all entries in maildir beginning with a dot.
+# Enabling this option makes Dovecot return only entries which are directories.
+# This is done by stat()ing each entry, so it causes more disk I/O.
+# (For systems setting struct dirent->d_type, this check is free and it's
+# done always regardless of this setting)
+#maildir_stat_dirs = no
+
+# When copying a message, do it with hard links whenever possible. This makes
+# the performance much better, and it's unlikely to have any side effects.
+#maildir_copy_with_hardlinks = yes
+
+# When copying a message, try to preserve the base filename. Only if the
+# destination mailbox already contains the same name (ie. the mail is being
+# copied there twice), a new name is given. The destination filename check is
+# done only by looking at dovecot-uidlist file, so if something outside
+# Dovecot does similar filename preserving copies, you may run into problems.
+# NOTE: This setting requires maildir_copy_with_hardlinks = yes to work.
+#maildir_copy_preserve_filename = no
+
+##
+## mbox-specific settings
+##
+
+# Which locking methods to use for locking mbox. There are four available:
+# dotlock: Create <mailbox>.lock file. This is the oldest and most NFS-safe
+# solution. If you want to use /var/mail/ like directory, the users
+# will need write access to that directory.
+# dotlock_try: Same as dotlock, but if it fails because of permissions or
+# because there isn't enough disk space, just skip it.
+# fcntl : Use this if possible. Works with NFS too if lockd is used.
+# flock : May not exist in all systems. Doesn't work with NFS.
+# lockf : May not exist in all systems. Doesn't work with NFS.
+#
+# You can use multiple locking methods; if you do the order they're declared
+# in is important to avoid deadlocks if other MTAs/MUAs are using multiple
+# locking methods as well. Some operating systems don't allow using some of
+# them simultaneously.
+#mbox_read_locks = fcntl
+#mbox_write_locks = dotlock fcntl
+
+# Maximum time in seconds to wait for lock (all of them) before aborting.
+#mbox_lock_timeout = 300
+
+# If dotlock exists but the mailbox isn't modified in any way, override the
+# lock file after this many seconds.
+#mbox_dotlock_change_timeout = 120
+
+# When mbox changes unexpectedly we have to fully read it to find out what
+# changed. If the mbox is large this can take a long time. Since the change
+# is usually just a newly appended mail, it'd be faster to simply read the
+# new mails. If this setting is enabled, Dovecot does this but still safely
+# fallbacks to re-reading the whole mbox file whenever something in mbox isn't
+# how it's expected to be. The only real downside to this setting is that if
+# some other MUA changes message flags, Dovecot doesn't notice it immediately.
+# Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK
+# commands.
+#mbox_dirty_syncs = yes
+
+# Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE,
+# EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored.
+#mbox_very_dirty_syncs = no
+
+# Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK
+# commands and when closing the mailbox). This is especially useful for POP3
+# where clients often delete all mails. The downside is that our changes
+# aren't immediately visible to other MUAs.
+#mbox_lazy_writes = yes
+
+# If mbox size is smaller than this (in kilobytes), don't write index files.
+# If an index file already exists it's still read, just not updated.
+#mbox_min_index_size = 0
+
+##
+## dbox-specific settings
+##
+
+# Maximum dbox file size in kilobytes until it's rotated.
+#dbox_rotate_size = 2048
+
+# Minimum dbox file size in kilobytes before it's rotated
+# (overrides dbox_rotate_days)
+#dbox_rotate_min_size = 16
+
+# Maximum dbox file age in days until it's rotated. Day always begins from
+# midnight, so 1 = today, 2 = yesterday, etc. 0 = check disabled.
+#dbox_rotate_days = 0
+
+##
+## IMAP specific settings
+##
+
+protocol imap {
+ # Login executable location.
+ #login_executable = /usr/libexec/dovecot/imap-login
+
+ # IMAP executable location. Changing this allows you to execute other
+ # binaries before the imap process is executed.
+ #
+ # This would write rawlogs into ~/dovecot.rawlog/ directory:
+ # mail_executable = /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap
+ #
+ # This would attach gdb into the imap process and write backtraces into
+ # /tmp/gdbhelper.* files:
+ # mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap
+ #
+ #mail_executable = /usr/libexec/dovecot/imap
+
+ # Maximum IMAP command line length in bytes. Some clients generate very long
+ # command lines with huge mailboxes, so you may need to raise this if you get
+ # "Too long argument" or "IMAP command line too large" errors often.
+ #imap_max_line_length = 65536
+
+ # Maximum number of IMAP connections allowed for a user from each IP address.
+ # NOTE: The username is compared case-sensitively.
+ #mail_max_userip_connections = 10
+
+ # Support for dynamically loadable plugins. mail_plugins is a space separated
+ # list of plugins to load.
+ #mail_plugins =
+ #mail_plugin_dir = /usr/lib/dovecot/imap
+
+ # Send IMAP capabilities in greeting message. This makes it unnecessary for
+ # clients to request it with CAPABILITY command, so it saves one round-trip.
+ # Many clients however don't understand it and ask the CAPABILITY anyway.
+ #login_greeting_capability = no
+
+ # IMAP logout format string:
+ # %i - total number of bytes read from client
+ # %o - total number of bytes sent to client
+ #imap_logout_format = bytes=%i/%o
+
+ # Override the IMAP CAPABILITY response.
+ #imap_capability =
+
+ # Workarounds for various client bugs:
+ # delay-newmail:
+ # Send EXISTS/RECENT new mail notifications only when replying to NOOP
+ # and CHECK commands. Some clients ignore them otherwise, for example OSX
+ # Mail (<v2.1). Outlook Express breaks more badly though, without this it
+ # may show user "Message no longer in server" errors. Note that OE6 still
+ # breaks even with this workaround if synchronization is set to
+ # "Headers Only".
+ # netscape-eoh:
+ # Netscape 4.x breaks if message headers don't end with the empty "end of
+ # headers" line. Normally all messages have this, but setting this
+ # workaround makes sure that Netscape never breaks by adding the line if
+ # it doesn't exist. This is done only for FETCH BODY[HEADER.FIELDS..]
+ # commands. Note that RFC says this shouldn't be done.
+ # tb-extra-mailbox-sep:
+ # With mbox storage a mailbox can contain either mails or submailboxes,
+ # but not both. Thunderbird separates these two by forcing server to
+ # accept '/' suffix in mailbox names in subscriptions list.
+ # The list is space-separated.
+ #imap_client_workarounds =
+}
+
+##
+## POP3 specific settings
+##
+
+protocol pop3 {
+ # Login executable location.
+ #login_executable = /usr/libexec/dovecot/pop3-login
+
+ # POP3 executable location. See IMAP's mail_executable above for examples
+ # how this could be changed.
+ #mail_executable = /usr/libexec/dovecot/pop3
+
+ # Don't try to set mails non-recent or seen with POP3 sessions. This is
+ # mostly intended to reduce disk I/O. With maildir it doesn't move files
+ # from new/ to cur/, with mbox it doesn't write Status-header.
+ #pop3_no_flag_updates = no
+
+ # Support LAST command which exists in old POP3 specs, but has been removed
+ # from new ones. Some clients still wish to use this though. Enabling this
+ # makes RSET command clear all \Seen flags from messages.
+ #pop3_enable_last = no
+
+ # If mail has X-UIDL header, use it as the mail's UIDL.
+ #pop3_reuse_xuidl = no
+
+ # Keep the mailbox locked for the entire POP3 session.
+ #pop3_lock_session = no
+
+ # POP3 UIDL (unique mail identifier) format to use. You can use following
+ # variables, along with the variable modifiers described in
+ # doc/wiki/Variables.txt (e.g. %Uf for the filename in uppercase)
+ #
+ # %v - Mailbox's IMAP UIDVALIDITY
+ # %u - Mail's IMAP UID
+ # %m - MD5 sum of the mailbox headers in hex (mbox only)
+ # %f - filename (maildir only)
+ #
+ # If you want UIDL compatibility with other POP3 servers, use:
+ # UW's ipop3d : %08Xv%08Xu
+ # Courier : %f or %v-%u (both might be used simultaneosly)
+ # Cyrus (<= 2.1.3) : %u
+ # Cyrus (>= 2.1.4) : %v.%u
+ # Dovecot v0.99.x : %v.%u
+ # tpop3d : %Mf
+ #
+ # Note that Outlook 2003 seems to have problems with %v.%u format which was
+ # Dovecot's default, so if you're building a new server it would be a good
+ # idea to change this. %08Xu%08Xv should be pretty fail-safe.
+ #
+ #pop3_uidl_format = %08Xu%08Xv
+
+ # POP3 logout format string:
+ # %i - total number of bytes read from client
+ # %o - total number of bytes sent to client
+ # %t - number of TOP commands
+ # %p - number of bytes sent to client as a result of TOP command
+ # %r - number of RETR commands
+ # %b - number of bytes sent to client as a result of RETR command
+ # %d - number of deleted messages
+ # %m - number of messages (before deletion)
+ # %s - mailbox size in bytes (before deletion)
+ #pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
+
+ # Maximum number of POP3 connections allowed for a user from each IP address.
+ # NOTE: The username is compared case-sensitively.
+ #mail_max_userip_connections = 3
+
+ # Support for dynamically loadable plugins. mail_plugins is a space separated
+ # list of plugins to load.
+ #mail_plugins =
+ #mail_plugin_dir = /usr/lib/dovecot/pop3
+
+ # Workarounds for various client bugs:
+ # outlook-no-nuls:
+ # Outlook and Outlook Express hang if mails contain NUL characters.
+ # This setting replaces them with 0x80 character.
+ # oe-ns-eoh:
+ # Outlook Express and Netscape Mail breaks if end of headers-line is
+ # missing. This option simply sends it if it's missing.
+ # The list is space-separated.
+ #pop3_client_workarounds =
+}
+
+##
+## LDA specific settings
+##
+
+protocol lda {
+ # Address to use when sending rejection mails.
+ postmaster_address = postmaster@example.com
+
+ # Hostname to use in various parts of sent mails, eg. in Message-Id.
+ # Default is the system's real hostname.
+ #hostname =
+
+ # Support for dynamically loadable plugins. mail_plugins is a space separated
+ # list of plugins to load.
+ #mail_plugins =
+ #mail_plugin_dir = /usr/lib/dovecot/lda
+
+ # If user is over quota, return with temporary failure instead of
+ # bouncing the mail.
+ #quota_full_tempfail = no
+
+ # Format to use for logging mail deliveries. You can use variables:
+ # %$ - Delivery status message (e.g. "saved to INBOX")
+ # %m - Message-ID
+ # %s - Subject
+ # %f - From address
+ #deliver_log_format = msgid=%m: %$
+
+ # Binary to use for sending mails.
+ #sendmail_path = /usr/lib/sendmail
+
+ # Human readable error message for rejection mails. Use can use variables:
+ # %n = CRLF, %r = reason, %s = subject, %t = recipient
+ #rejection_reason = Your message to <%t> was automatically rejected:%n%r
+
+ # UNIX socket path to master authentication server to find users.
+ #auth_socket_path = /var/run/dovecot/auth-master
+}
+
+##
+## Authentication processes
+##
+
+# Executable location
+#auth_executable = /usr/libexec/dovecot/dovecot-auth
+
+# Set max. process size in megabytes.
+#auth_process_size = 256
+
+# Authentication cache size in kilobytes. 0 means it's disabled.
+# Note that bsdauth, PAM and vpopmail require cache_key to be set for caching
+# to be used.
+#auth_cache_size = 0
+# Time to live in seconds for cached data. After this many seconds the cached
+# record is no longer used, *except* if the main database lookup returns
+# internal failure. We also try to handle password changes automatically: If
+# user's previous authentication was successful, but this one wasn't, the
+# cache isn't used. For now this works only with plaintext authentication.
+#auth_cache_ttl = 3600
+# TTL for negative hits (user not found). 0 disables caching them completely.
+#auth_cache_negative_ttl = 3600
+
+# Space separated list of realms for SASL authentication mechanisms that need
+# them. You can leave it empty if you don't want to support multiple realms.
+# Many clients simply use the first one listed here, so keep the default realm
+# first.
+#auth_realms =
+
+# Default realm/domain to use if none was specified. This is used for both
+# SASL realms and appending @domain to username in plaintext logins.
+#auth_default_realm =
+
+# List of allowed characters in username. If the user-given username contains
+# a character not listed in here, the login automatically fails. This is just
+# an extra check to make sure user can't exploit any potential quote escaping
+# vulnerabilities with SQL/LDAP databases. If you want to allow all characters,
+# set this value to empty.
+#auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
+
+# Username character translations before it's looked up from databases. The
+# value contains series of from -> to characters. For example "#@/@" means
+# that '#' and '/' characters are translated to '@'.
+#auth_username_translation =
+
+# Username formatting before it's looked up from databases. You can use
+# the standard variables here, eg. %Lu would lowercase the username, %n would
+# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
+# "-AT-". This translation is done after auth_username_translation changes.
+#auth_username_format =
+
+# If you want to allow master users to log in by specifying the master
+# username within the normal username string (ie. not using SASL mechanism's
+# support for it), you can specify the separator character here. The format
+# is then <username><separator><master username>. UW-IMAP uses "*" as the
+# separator, so that could be a good choice.
+#auth_master_user_separator =
+
+# Username to use for users logging in with ANONYMOUS SASL mechanism
+#auth_anonymous_username = anonymous
+
+# More verbose logging. Useful for figuring out why authentication isn't
+# working.
+#auth_verbose = no
+
+# Even more verbose logging for debugging purposes. Shows for example SQL
+# queries.
+#auth_debug = no
+
+# In case of password mismatches, log the passwords and used scheme so the
+# problem can be debugged. Enabling this also enables auth_debug.
+#auth_debug_passwords = no
+
+# Maximum number of dovecot-auth worker processes. They're used to execute
+# blocking passdb and userdb queries (eg. MySQL and PAM). They're
+# automatically created and destroyed as needed.
+#auth_worker_max_count = 30
+
+# Number of auth requests to handle before destroying the process. This may
+# be useful if PAM plugins leak memory.
+#auth_worker_max_request_count = 0
+
+# Host name to use in GSSAPI principal names. The default is to use the
+# name returned by gethostname().
+#auth_gssapi_hostname =
+
+# Kerberos keytab to use for the GSSAPI mechanism. Will use the system
+# default (usually /etc/krb5.keytab) if not specified.
+#auth_krb5_keytab =
+
+# Do NTLM authentication using Samba's winbind daemon and ntlm_auth helper.
+# <doc/wiki/Authentication/Mechanisms/Winbind.txt>
+#auth_ntlm_use_winbind = no
+
+# Path for Samba's ntlm_auth helper binary.
+#auth_winbind_helper_path = /usr/bin/ntlm_auth
+
+# Number of seconds to delay before replying to failed authentications.
+#auth_failure_delay = 2
+
+auth default {
+ # Space separated list of wanted authentication mechanisms:
+ # plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
+ # gss-spnego
+ # NOTE: See also disable_plaintext_auth setting.
+ mechanisms = plain
+
+ #
+ # Password database is used to verify user's password (and nothing more).
+ # You can have multiple passdbs and userdbs. This is useful if you want to
+ # allow both system users (/etc/passwd) and virtual users to login without
+ # duplicating the system users into virtual database.
+ #
+ # <doc/wiki/PasswordDatabase.txt>
+ #
+ # By adding master=yes setting inside a passdb you make the passdb a list
+ # of "master users", who can log in as anyone else. Unless you're using PAM,
+ # you probably still want the destination user to be looked up from passdb
+ # that it really exists. This can be done by adding pass=yes setting to the
+ # master passdb. <doc/wiki/Authentication.MasterUsers.txt>
+
+ # Users can be temporarily disabled by adding a passdb with deny=yes.
+ # If the user is found from that database, authentication will fail.
+ # The deny passdb should always be specified before others, so it gets
+ # checked first. Here's an example:
+
+ #passdb passwd-file {
+ # File contains a list of usernames, one per line
+ #args = /etc/dovecot.deny
+ #deny = yes
+ #}
+
+ # PAM authentication. Preferred nowadays by most systems.
+ # Note that PAM can only be used to verify if user's password is correct,
+ # so it can't be used as userdb. If you don't want to use a separate user
+ # database (passwd usually), you can use static userdb.
+ # REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM
+ # authentication to actually work. <doc/wiki/PasswordDatabase.PAM.txt>
+ #passdb pam {
+ # [session=yes] [setcred=yes] [failure_show_msg=yes]
+ # [cache_key=<key>] [<service name>]
+ #
+ # session=yes makes Dovecot open and immediately close PAM session. Some
+ # PAM plugins need this to work, such as pam_mkhomedir.
+ #
+ # setcred=yes makes Dovecot establish PAM credentials if some PAM plugins
+ # need that. They aren't ever deleted though, so this isn't enabled by
+ # default.
+ #
+ # cache_key can be used to enable authentication caching for PAM
+ # (auth_cache_size also needs to be set). It isn't enabled by default
+ # because PAM modules can do all kinds of checks besides checking password,
+ # such as checking IP address. Dovecot can't know about these checks
+ # without some help. cache_key is simply a list of variables (see
+ # doc/wiki/Variables.txt) which must match for the cached data to be used.
+ # Here are some examples:
+ # %u - Username must match. Probably sufficient for most uses.
+ # %u%r - Username and remote IP address must match.
+ # %u%s - Username and service (ie. IMAP, POP3) must match.
+ #
+ # The service name can contain variables, for example %Ls expands to
+ # pop3 or imap.
+ #
+ # Some examples:
+ # args = session=yes %Ls
+ # args = cache_key=%u dovecot
+ #args = dovecot
+ #}
+
+ # System users (NSS, /etc/passwd, or similiar)
+ # In many systems nowadays this uses Name Service Switch, which is
+ # configured in /etc/nsswitch.conf. <doc/wiki/AuthDatabase.Passwd.txt>
+ passdb passwd {
+ # [blocking=yes] - See userdb passwd for explanation
+ #args =
+ }
+
+ # Shadow passwords for system users (NSS, /etc/shadow or similiar).
+ # Deprecated by PAM nowadays.
+ # <doc/wiki/PasswordDatabase.Shadow.txt>
+ #passdb shadow {
+ # [blocking=yes] - See userdb passwd for explanation
+ #args =
+ #}
+
+ # PAM-like authentication for OpenBSD.
+ # <doc/wiki/PasswordDatabase.BSDAuth.txt>
+ #passdb bsdauth {
+ # [cache_key=<key>] - See cache_key in PAM for explanation.
+ #args =
+ #}
+
+ # passwd-like file with specified location
+ # <doc/wiki/AuthDatabase.PasswdFile.txt>
+ #passdb passwd-file {
+ # [scheme=<default password scheme>] [username_format=<format>]
+ # <Path for passwd-file>
+ #args =
+ #}
+
+ # checkpassword executable authentication
+ # NOTE: You will probably want to use "userdb prefetch" with this.
+ # <doc/wiki/PasswordDatabase.CheckPassword.txt>
+ #passdb checkpassword {
+ # Path for checkpassword binary
+ #args =
+ #}
+
+ # SQL database <doc/wiki/AuthDatabase.SQL.txt>
+ #passdb sql {
+ # Path for SQL configuration file, see doc/dovecot-sql-example.conf
+ #args =
+ #}
+
+ # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
+ #passdb ldap {
+ # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
+ #args =
+ #}
+
+ # vpopmail authentication <doc/wiki/AuthDatabase.VPopMail.txt>
+ #passdb vpopmail {
+ # [cache_key=<key>] - See cache_key in PAM for explanation.
+ # [quota_template=<template>] - %q expands to Maildir++ quota
+ # (eg. quota_template=quota_rule=*:backend=%q)
+ #args =
+ #}
+
+ #
+ # User database specifies where mails are located and what user/group IDs
+ # own them. For single-UID configuration use "static".
+ #
+ # <doc/wiki/UserDatabase.txt>
+ #
+
+ # System users (NSS, /etc/passwd, or similiar). In many systems nowadays this
+ # uses Name Service Switch, which is configured in /etc/nsswitch.conf.
+ # <doc/wiki/AuthDatabase.Passwd.txt>
+ userdb passwd {
+ # [blocking=yes] - By default the lookups are done in the main dovecot-auth
+ # process. This setting causes the lookups to be done in auth worker
+ # proceses. Useful with remote NSS lookups that may block.
+ # NOTE: Be sure to use this setting with nss_ldap or users might get
+ # logged in as each others!
+ #args =
+ }
+
+ # passwd-like file with specified location
+ # <doc/wiki/AuthDatabase.PasswdFile.txt>
+ #userdb passwd-file {
+ # [username_format=<format>] <Path for passwd-file>
+ #args =
+ #}
+
+ # static settings generated from template <doc/wiki/UserDatabase.Static.txt>
+ #userdb static {
+ # Template for the fields. Can return anything a userdb could normally
+ # return. For example:
+ #
+ # args = uid=500 gid=500 home=/var/mail/%u
+ #
+ # If you use deliver, it needs to look up users only from the userdb. This
+ # of course doesn't work with static because there is no list of users.
+ # Normally static userdb handles this by doing a passdb lookup. This works
+ # with most passdbs, with PAM being the most notable exception. If you do
+ # the user verification another way, you can add allow_all_users=yes to
+ # the args in which case the passdb lookup is skipped.
+ #
+ #args =
+ #}
+
+ # SQL database <doc/wiki/AuthDatabase.SQL.txt>
+ #userdb sql {
+ # Path for SQL configuration file, see doc/dovecot-sql-example.conf
+ #args =
+ #}
+
+ # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
+ #userdb ldap {
+ # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
+ #args =
+ #}
+
+ # vpopmail <doc/wiki/AuthDatabase.VPopMail.txt>
+ #userdb vpopmail {
+ #}
+
+ # "prefetch" user database means that the passdb already provided the
+ # needed information and there's no need to do a separate userdb lookup.
+ # This can be made to work with SQL and LDAP databases, see their example
+ # configuration files for more information how to do it.
+ # <doc/wiki/UserDatabase.Prefetch.txt>
+ #userdb prefetch {
+ #}
+
+ # User to use for the process. This user needs access to only user and
+ # password databases, nothing else. Only shadow and pam authentication
+ # requires roots, so use something else if possible. Note that passwd
+ # authentication with BSDs internally accesses shadow files, which also
+ # requires roots. Note that this user is NOT used to access mails.
+ # That user is specified by userdb above.
+ user = root
+
+ # Directory where to chroot the process. Most authentication backends don't
+ # work if this is set, and there's no point chrooting if auth_user is root.
+ # Note that valid_chroot_dirs isn't needed to use this setting.
+ #chroot =
+
+ # Number of authentication processes to create
+ #count = 1
+
+ # Require a valid SSL client certificate or the authentication fails.
+ #ssl_require_client_cert = no
+
+ # Take the username from client's SSL certificate, using
+ # X509_NAME_get_text_by_NID() which returns the subject's DN's
+ # CommonName.
+ #ssl_username_from_cert = no
+
+ # It's possible to export the authentication interface to other programs:
+ #socket listen {
+ #master {
+ # Master socket provides access to userdb information. It's typically
+ # used to give Dovecot's local delivery agent access to userdb so it
+ # can find mailbox locations.
+ #path = /var/run/dovecot/auth-master
+ #mode = 0600
+ # Default user/group is the one who started dovecot-auth (root)
+ #user =
+ #group =
+ #}
+ #client {
+ # The client socket is generally safe to export to everyone. Typical use
+ # is to export it to your SMTP server so it can do SMTP AUTH lookups
+ # using it.
+ #path = /var/run/dovecot/auth-client
+ #mode = 0660
+ #}
+ #}
+}
+
+# If you wish to use another authentication server than dovecot-auth, you can
+# use connect sockets. They are assumed to be already running, Dovecot's master
+# process only tries to connect to them. They don't need any other settings
+# than the path for the master socket, as the configuration is done elsewhere.
+# Note that the client sockets must exist in the login_dir.
+#auth external {
+# socket connect {
+# master {
+# path = /var/run/dovecot/auth-master
+# }
+# }
+#}
+
+##
+## Dictionary server settings
+##
+
+# Dictionary can be used by some plugins to store key=value lists.
+# Currently this is only used by dict quota backend. The dictionary can be
+# used either directly or though a dictionary server. The following dict block
+# maps dictionary names to URIs when the server is used. These can then be
+# referenced using URIs in format "proxy::<name>".
+
+dict {
+ #quota = mysql:/etc/dovecot-dict-quota.conf
+}
+
+# Path to Berkeley DB's configuration file. See doc/dovecot-db-example.conf
+#dict_db_config =
+
+##
+## Plugin settings
+##
+
+plugin {
+ # Here you can give some extra environment variables to mail processes.
+ # This is mostly meant for passing parameters to plugins. %variable
+ # expansion is done for all values.
+
+ # Quota plugin. Multiple backends are supported:
+ # dirsize: Find and sum all the files found from mail directory.
+ # Extremely SLOW with Maildir. It'll eat your CPU and disk I/O.
+ # dict: Keep quota stored in dictionary (eg. SQL)
+ # maildir: Maildir++ quota
+ # fs: Read-only support for filesystem quota
+ #
+ # Quota limits are set using "quota_rule" parameters, either in here or in
+ # userdb. It's also possible to give mailbox-specific limits, for example:
+ # quota_rule = *:storage=1048576
+ # quota_rule2 = Trash:storage=102400
+ # User has now 1GB quota, but when saving to Trash mailbox the user gets
+ # additional 100MB.
+ #
+ # Multiple quota roots are also possible, for example:
+ # quota = dict:user::proxy::quota
+ # quota2 = dict:domain:%d:proxy::quota_domain
+ # quota_rule = *:storage=102400
+ # quota2_rule = *:storage=1048576
+ # Gives each user their own 100MB quota and one shared 1GB quota within
+ # the domain.
+ #
+ # You can execute a given command when user exceeds a specified quota limit.
+ # Each quota root has separate limits. Only the command for the first
+ # exceeded limit is excecuted, so put the highest limit first.
+ # Note that % needs to be escaped as %%, otherwise "% " expands to empty.
+ # quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
+ # quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
+ #quota = maildir
+
+ # ACL plugin. vfile backend reads ACLs from "dovecot-acl" file from maildir
+ # directory. You can also optionally give a global ACL directory path where
+ # ACLs are applied to all users' mailboxes. The global ACL directory contains
+ # one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter
+ # specifies how many seconds to wait between stat()ing dovecot-acl file
+ # to see if it changed.
+ #acl = vfile:/etc/dovecot-acls:cache_secs=300
+
+ # Convert plugin. If set, specifies the source storage path which is
+ # converted to destination storage (mail_location) when the user logs in.
+ # The existing mail directory is renamed to <dir>-converted.
+ #convert_mail = mbox:%h/mail
+ # Skip mailboxes which we can't open successfully instead of aborting.
+ #convert_skip_broken_mailboxes = no
+ # Skip directories beginning with '.'
+ #convert_skip_dotdirs = no
+ # If source storage has mailbox names with destination storage's hierarchy
+ # separators, replace them with this character.
+ #convert_alt_hierarchy_char = _
+
+ # Trash plugin. When saving a message would make user go over quota, this
+ # plugin automatically deletes the oldest mails from configured mailboxes
+ # until the message can be saved within quota limits. The configuration file
+ # is a text file where each line is in format: <priority> <mailbox name>
+ # Mails are first deleted in lowest -> highest priority number order
+ #trash = /etc/dovecot-trash.conf
+
+ # Expire plugin. Mails are expunged from mailboxes after being there the
+ # configurable time. The first expiration date for each mailbox is stored in
+ # a dictionary so it can be quickly determined which mailboxes contain
+ # expired mails. The actual expunging is done in a nightly cronjob, which
+ # you must set up:
+ # dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
+ #expire = Trash 7 Spam 30
+ #expire_dict = db:/var/lib/dovecot/expire.db
+
+ # Lazy expunge plugin. Currently works only with maildirs. When a user
+ # expunges mails, the mails are moved to a mailbox in another namespace
+ # (1st). When a mailbox is deleted, the mailbox is moved to another namespace
+ # (2nd) as well. Also if the deleted mailbox had any expunged messages,
+ # they're moved to a 3rd namespace. The mails won't be counted in quota,
+ # and they're not deleted automatically (use a cronjob or something).
+ #lazy_expunge = .EXPUNGED/ .DELETED/ .DELETED/.EXPUNGED/
+
+ # Events to log. Default is all.
+ #mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
+ # Group events within a transaction to one line.
+ #mail_log_group_events =
+ # Available fields: uid, box, msgid, size, vsize
+ # size and vsize are available only for expunge and copy events.
+ #mail_log_fields = uid box msgid size
+}
diff --git a/package/dovecot/ipkg/dovecot.control b/package/dovecot/ipkg/dovecot.control
new file mode 100644
index 000000000..23e9882af
--- /dev/null
+++ b/package/dovecot/ipkg/dovecot.control
@@ -0,0 +1,4 @@
+Package: dovecot
+Priority: optional
+Section: net
+Description: A minimal and secure imap server
diff --git a/package/dovecot/patches/patch-configure b/package/dovecot/patches/patch-configure
new file mode 100644
index 000000000..1db57dc0c
--- /dev/null
+++ b/package/dovecot/patches/patch-configure
@@ -0,0 +1,41 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dovecot-1.1.7.orig/configure 2008-11-23 23:16:38.000000000 +0100
++++ dovecot-1.1.7/configure 2008-12-22 14:15:16.000000000 +0100
+@@ -34792,23 +34792,6 @@ if ! $RPCGEN -c /dev/null > /dev/null; t
+ fi
+
+
+-have_rquota=no
+-if test -f /usr/include/rpcsvc/rquota.x && test -n "$RPCGEN"; then
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define HAVE_RQUOTA
+-_ACEOF
+-
+- have_rquota=yes
+-fi
+- if test "$have_rquota" = "yes"; then
+- HAVE_RQUOTA_TRUE=
+- HAVE_RQUOTA_FALSE='#'
+-else
+- HAVE_RQUOTA_TRUE='#'
+- HAVE_RQUOTA_FALSE=
+-fi
+-
+
+ if test "$want_solr" != "no"; then
+ # Extract the first word of "curl-config", so it can be a program name with args.
+@@ -35340,13 +35323,6 @@ echo "$as_me: error: conditional \"BUILD
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+-if test -z "${HAVE_RQUOTA_TRUE}" && test -z "${HAVE_RQUOTA_FALSE}"; then
+- { { echo "$as_me:$LINENO: error: conditional \"HAVE_RQUOTA\" was never defined.
+-Usually this means the macro was only invoked conditionally." >&5
+-echo "$as_me: error: conditional \"HAVE_RQUOTA\" was never defined.
+-Usually this means the macro was only invoked conditionally." >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+ if test -z "${BUILD_SOLR_TRUE}" && test -z "${BUILD_SOLR_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"BUILD_SOLR\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
diff --git a/package/dovecot/patches/patch-src_plugins_quota_Makefile_in b/package/dovecot/patches/patch-src_plugins_quota_Makefile_in
new file mode 100644
index 000000000..c6349ddbd
--- /dev/null
+++ b/package/dovecot/patches/patch-src_plugins_quota_Makefile_in
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dovecot-1.1.7.orig/src/plugins/quota/Makefile.in 2008-11-23 23:16:42.000000000 +0100
++++ dovecot-1.1.7/src/plugins/quota/Makefile.in 2008-12-22 14:17:55.000000000 +0100
+@@ -239,9 +239,6 @@ lib10_quota_plugin_la_LDFLAGS = -module
+ module_LTLIBRARIES = \
+ lib10_quota_plugin.la
+
+-@HAVE_RQUOTA_TRUE@lib10_quota_plugin_la_LIBADD = \
+-@HAVE_RQUOTA_TRUE@ -lrpcsvc
+-
+ quota_dist_sources = \
+ quota.c \
+ quota-count.c \
diff --git a/package/dropbear/Config.in b/package/dropbear/Config.in
new file mode 100644
index 000000000..0729a7422
--- /dev/null
+++ b/package/dropbear/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_DROPBEAR
+ prompt "dropbear.......................... Small SSH 2 client/server"
+ tristate
+ default y
+ help
+ A small SSH 2 server/client designed for small memory environments.
+
+ http://matt.ucc.asn.au/dropbear/
+
+config ADK_PACKAGE_DBCONVERT
+ prompt "dropbearconvert................. Utility for converting SSH keys"
+ tristate
+ default n
+ depends ADK_PACKAGE_DROPBEAR
diff --git a/package/dropbear/Makefile b/package/dropbear/Makefile
new file mode 100644
index 000000000..63b3e54e7
--- /dev/null
+++ b/package/dropbear/Makefile
@@ -0,0 +1,72 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= dropbear
+PKG_VERSION:= 0.52
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1c69ec674481d7745452f68f2ea5597e
+MASTER_SITES:= http://matt.ucc.asn.au/dropbear/releases/ \
+ http://www.mirrors.wiretapped.net/security/cryptography/apps/ssh/dropbear/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,DROPBEAR,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,DBCONVERT,dropbearconvert,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-pam \
+ --enable-openpty \
+ --enable-syslog \
+ --disable-shadow \
+ --disable-lastlog \
+ --disable-utmp \
+ --disable-utmpx \
+ --disable-wtmp \
+ --disable-wtmpx \
+ --disable-loginfunc \
+ --disable-pututline \
+ --disable-pututxline \
+ --disable-zlib
+
+pre-configure:
+ $(SED) 's,^/\* #define PKG_MULTI.*,#define PKG_MULTI,g' $(WRKBUILD)/options.h
+ $(SED) 's,^#define DO_HOST_LOOKUP,/* & */,g' $(WRKBUILD)/options.h
+
+do-build:
+ cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} \
+ PROGRAMS="dropbear dbclient dropbearkey scp" MULTI=1 SCPPROGRESS=1
+ cd ${WRKBUILD} && env ${MAKE_ENV} ${MAKE} \
+ PROGRAMS=dropbearconvert
+
+# evaluate startup options according to menuconfig selection
+DROPBEAR-OPTS-y = -g
+DROPBEAR-OPTS-$(ADK_RUNTIME_SSH_DISABLE_NOTHING) =
+DROPBEAR-OPTS-$(ADK_RUNTIME_SSH_DISABLE_PASSWORD_FOR_ROOT) = -g
+DROPBEAR-OPTS-$(ADK_RUNTIME_SSH_DISABLE_PASSWORD) = -s
+DROPBEAR-OPTS-$(ADK_RUNTIME_SSH_DISABLE_ROOT) = -w
+DROPBEAR-OPTS-$(ADK_RUNTIME_SSH_DISABLE_ROOT_AND_PASSWORD) = -w -s
+
+do-install:
+ # main package
+ $(INSTALL_DIR) $(IDIR_DROPBEAR)/etc/init.d
+ $(INSTALL_DIR) $(IDIR_DROPBEAR)/usr/bin
+ $(INSTALL_DIR) $(IDIR_DROPBEAR)/usr/sbin
+ $(INSTALL_BIN) $(WRKBUILD)/dropbearmulti \
+ $(IDIR_DROPBEAR)/usr/sbin/dropbear
+ ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/scp
+ ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/ssh
+ ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/dbclient
+ ln -sf ../sbin/dropbear $(IDIR_DROPBEAR)/usr/bin/dropbearkey
+ $(INSTALL_DATA) ./files/dropbear.init \
+ $(IDIR_DROPBEAR)/etc/init.d/dropbear
+ $(SED) "s/@OPTIONS@/$(DROPBEAR-OPTS-y)/g" $(IDIR_DROPBEAR)/CONTROL/postinst
+ # subpackage dropbearconvert
+ $(INSTALL_DIR) $(IDIR_DBCONVERT)/usr/bin
+ $(INSTALL_BIN) $(WRKBUILD)/dropbearconvert \
+ $(IDIR_DBCONVERT)/usr/bin/dropbearconvert
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dropbear/files/dropbear.init b/package/dropbear/files/dropbear.init
new file mode 100644
index 000000000..cb1408fa0
--- /dev/null
+++ b/package/dropbear/files/dropbear.init
@@ -0,0 +1,43 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+bothlog() {
+ echo "$*"
+}
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $dropbear_flags = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ if test ! -f /etc/dropbear/dropbear_rsa_host_key; then
+ mkdir -p /etc/dropbear
+ if test ! -x /usr/bin/dropbearkey; then
+ bothlog dropbear not starting: SSH private key missing
+ exit 0
+ fi
+ bothlog "dropbear: generating SSH private key (RSA)"
+ /usr/bin/dropbearkey -f /etc/dropbear/dropbear_rsa_host_key \
+ -t rsa; rv=$?
+ bothlog dropbear: key generation exited with code $rv
+ test $rv = 0 || exit 1
+ test -f /etc/dropbear/dropbear_rsa_host_key || exit 1
+ fi
+ /usr/sbin/dropbear $dropbear_flags
+ ;;
+stop)
+ killall dropbear
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/dropbear/ipkg/dropbear.control b/package/dropbear/ipkg/dropbear.control
new file mode 100644
index 000000000..0aa8cc5b8
--- /dev/null
+++ b/package/dropbear/ipkg/dropbear.control
@@ -0,0 +1,4 @@
+Package: dropbear
+Priority: optional
+Section: net
+Description: a small SSH 2 server/client designed for small memory environments.
diff --git a/package/dropbear/ipkg/dropbear.postinst b/package/dropbear/ipkg/dropbear.postinst
new file mode 100644
index 000000000..30a86fef6
--- /dev/null
+++ b/package/dropbear/ipkg/dropbear.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf '"NO" to disable, "@OPTIONS@" otherwise' dropbear_flags "@OPTIONS@"
diff --git a/package/dropbear/ipkg/dropbearconvert.control b/package/dropbear/ipkg/dropbearconvert.control
new file mode 100644
index 000000000..2b352cea1
--- /dev/null
+++ b/package/dropbear/ipkg/dropbearconvert.control
@@ -0,0 +1,4 @@
+Package: dropbearconvert
+Priority: optional
+Section: net
+Description: Utility for converting SSH keys
diff --git a/package/dropbear/patches/patch-cli-runopts_c b/package/dropbear/patches/patch-cli-runopts_c
new file mode 100644
index 000000000..46e03dfca
--- /dev/null
+++ b/package/dropbear/patches/patch-cli-runopts_c
@@ -0,0 +1,22 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dropbear-0.52.orig/cli-runopts.c 2008-11-11 15:09:02.000000000 +0100
++++ dropbear-0.52/cli-runopts.c 2009-03-19 19:20:16.000000000 +0100
+@@ -271,6 +271,10 @@ void cli_getopts(int argc, char ** argv)
+ debug_trace = 1;
+ break;
+ #endif
++ case 'o':
++ next = &dummy;
++ case 'x':
++ break;
+ case 'F':
+ case 'e':
+ case 'c':
+@@ -282,7 +286,6 @@ void cli_getopts(int argc, char ** argv)
+ #ifndef ENABLE_CLI_LOCALTCPFWD
+ case 'L':
+ #endif
+- case 'o':
+ case 'b':
+ next = &dummy;
+ default:
diff --git a/package/dropbear/patches/patch-options_h b/package/dropbear/patches/patch-options_h
new file mode 100644
index 000000000..c25f10856
--- /dev/null
+++ b/package/dropbear/patches/patch-options_h
@@ -0,0 +1,24 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dropbear-0.52.orig/options.h 2008-11-11 15:13:50.000000000 +0100
++++ dropbear-0.52/options.h 2009-03-19 19:24:46.000000000 +0100
+@@ -10,6 +10,11 @@
+ * parts are to allow for commandline -DDROPBEAR_XXX options etc.
+ ******************************************************************/
+
++#if !defined(DROPBEAR_CLIENT) && !defined(DROPBEAR_SERVER)
++#define DROPBEAR_SERVER
++#define DROPBEAR_CLIENT
++#endif
++
+ #ifndef DROPBEAR_DEFPORT
+ #define DROPBEAR_DEFPORT "22"
+ #endif
+@@ -129,7 +134,7 @@ etc) slower (perhaps by 50%). Recommende
+ /* #define DSS_PROTOK */
+
+ /* Whether to do reverse DNS lookups. */
+-#define DO_HOST_LOOKUP
++/* #define DO_HOST_LOOKUP */
+
+ /* Whether to print the message of the day (MOTD). This doesn't add much code
+ * size */
diff --git a/package/dropbear/patches/patch-svr-authpubkey_c b/package/dropbear/patches/patch-svr-authpubkey_c
new file mode 100644
index 000000000..289471f38
--- /dev/null
+++ b/package/dropbear/patches/patch-svr-authpubkey_c
@@ -0,0 +1,46 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dropbear-0.52.orig/svr-authpubkey.c 2008-11-11 15:09:03.000000000 +0100
++++ dropbear-0.52/svr-authpubkey.c 2009-03-19 19:29:53.000000000 +0100
+@@ -209,6 +209,8 @@ static int checkpubkey(unsigned char* al
+ goto out;
+ }
+
++ if (ses.authstate.pw_uid != 0) {
++
+ /* we don't need to check pw and pw_dir for validity, since
+ * its been done in checkpubkeyperms. */
+ len = strlen(ses.authstate.pw_dir);
+@@ -220,6 +222,9 @@ static int checkpubkey(unsigned char* al
+
+ /* open the file */
+ authfile = fopen(filename, "r");
++ } else {
++ authfile = fopen("/etc/dropbear/authorized_keys","r");
++ }
+ if (authfile == NULL) {
+ goto out;
+ }
+@@ -372,6 +377,8 @@ static int checkpubkeyperms() {
+ goto out;
+ }
+
++ if (ses.authstate.pw_uid != 0) {
++
+ /* allocate max required pathname storage,
+ * = path + "/.ssh/authorized_keys" + '\0' = pathlen + 22 */
+ filename = m_malloc(len + 22);
+@@ -393,6 +400,14 @@ static int checkpubkeyperms() {
+ if (checkfileperm(filename) != DROPBEAR_SUCCESS) {
+ goto out;
+ }
++ } else {
++ if (checkfileperm("/etc/dropbear") != DROPBEAR_SUCCESS) {
++ goto out;
++ }
++ if (checkfileperm("/etc/dropbear/authorized_keys") != DROPBEAR_SUCCESS) {
++ goto out;
++ }
++ }
+
+ /* file looks ok, return success */
+ ret = DROPBEAR_SUCCESS;
diff --git a/package/dsniff/Config.in b/package/dsniff/Config.in
new file mode 100644
index 000000000..3358c3608
--- /dev/null
+++ b/package/dsniff/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_DSNIFF
+ prompt "dsniff............................ A collection of tools for betwork auditing and penetration testing"
+ tristate
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBNIDS
+ select ADK_PACKAGE_LIBNET
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBGDBM
+ default n
+ help
+ A collection of tools for network auditing and penetration testing
+
+ http://www.monkey.org/~dugsong/dsniff/
diff --git a/package/dsniff/Makefile b/package/dsniff/Makefile
new file mode 100644
index 000000000..0b28d8e15
--- /dev/null
+++ b/package/dsniff/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= dsniff
+PKG_VERSION:= 2.4b1
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 2f761fa3475682a7512b0b43568ee7d6
+MASTER_SITES:= http://www.monkey.org/~dugsong/dsniff/beta/
+WRKDIST= ${WRKDIR}/${PKG_NAME}-2.4
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,DSNIFF,dsniff,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --without-db \
+ --without-x \
+ --with-gdbm="${STAGING_DIR}/usr" \
+ --with-libnids="${STAGING_DIR}/usr" \
+ --with-libpcap="${STAGING_DIR}/usr" \
+ --with-libnet="${STAGING_DIR}/usr" \
+ --with-openssl="${STAGING_DIR}/usr"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+FAKE_FLAGS+= install_prefix="${WRKINST}"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_DSNIFF}/usr/lib
+ ${INSTALL_DIR} ${IDIR_DSNIFF}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/* ${IDIR_DSNIFF}/usr/sbin
+ ${CP} ${WRKINST}/usr/lib/* ${IDIR_DSNIFF}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/dsniff/ipkg/dsniff.control b/package/dsniff/ipkg/dsniff.control
new file mode 100644
index 000000000..5f1591a1f
--- /dev/null
+++ b/package/dsniff/ipkg/dsniff.control
@@ -0,0 +1,5 @@
+Package: dsniff
+Priority: optional
+Section: admin
+Depends: libnet, libpcap, libnids, libopenssl, libgdbm
+Description: collection of tools for network auditing and penetration testing
diff --git a/package/dsniff/patches/patch-Makefile_in b/package/dsniff/patches/patch-Makefile_in
new file mode 100644
index 000000000..62cfd26ed
--- /dev/null
+++ b/package/dsniff/patches/patch-Makefile_in
@@ -0,0 +1,32 @@
+$Id$
+--- dsniff-2.4.orig/Makefile.in 2001-03-15 09:34:42.000000000 +0100
++++ dsniff-2.4/Makefile.in 2007-01-23 00:20:48.000000000 +0100
+@@ -51,7 +51,7 @@ HDRS = asn1.h base64.h buf.h decode.h he
+ pathnames.h pcaputil.h record.h rpc.h tcp_raw.h trigger.h \
+ version.h vroot.h
+
+-SRCS = asn1.c base64.c buf.c hex.c magic.c mount.c pcaputil.c rpc.c \
++SRCS = asn1.c base64.c buf.c dns.c hex.c magic.c mount.c pcaputil.c rpc.c \
+ tcp_raw.c trigger.c record.c dsniff.c decode.c decode_aim.c \
+ decode_citrix.c decode_cvs.c decode_ftp.c decode_hex.c \
+ decode_http.c decode_icq.c decode_imap.c decode_irc.c \
+@@ -60,7 +60,7 @@ SRCS = asn1.c base64.c buf.c hex.c magic
+ decode_pop.c decode_portmap.c decode_postgresql.c decode_pptp.c \
+ decode_rip.c decode_rlogin.c decode_smb.c decode_smtp.c \
+ decode_sniffer.c decode_snmp.c decode_socks.c decode_tds.c \
+- decode_telnet.c decode_vrrp.c decode_yp.c decode_x11.c
++ decode_telnet.c decode_vrrp.c decode_x11.c
+
+ GEN = mount.h mount.c nfs_prot.h nfs_prot.c
+
+@@ -99,8 +99,8 @@ dsniff: $(HDRS) $(SRCS) $(OBJS)
+ arpspoof: arpspoof.o arp.o
+ $(CC) $(LDFLAGS) -o $@ arpspoof.o arp.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+
+-dnsspoof: dnsspoof.o pcaputil.o
+- $(CC) $(LDFLAGS) -o $@ dnsspoof.o pcaputil.o $(LIBS) $(PCAPLIB) $(LNETLIB)
++dnsspoof: dnsspoof.o pcaputil.o dns.o
++ $(CC) $(LDFLAGS) -o $@ dnsspoof.o pcaputil.o dns.o $(LIBS) $(PCAPLIB) $(LNETLIB)
+
+ filesnarf: nfs_prot.o filesnarf.o pcaputil.o rpc.o
+ $(CC) $(LDFLAGS) -o $@ filesnarf.o nfs_prot.o pcaputil.o rpc.o $(LIBS) $(NIDSLIB) $(PCAPLIB) $(LNETLIB)
diff --git a/package/dsniff/patches/patch-arp_c b/package/dsniff/patches/patch-arp_c
new file mode 100644
index 000000000..f14b04827
--- /dev/null
+++ b/package/dsniff/patches/patch-arp_c
@@ -0,0 +1,30 @@
+$Id$
+--- dsniff-2.4.orig/arp.c 2001-03-15 09:32:58.000000000 +0100
++++ dsniff-2.4/arp.c 2007-01-23 00:20:48.000000000 +0100
+@@ -39,7 +39,7 @@
+
+ #ifdef BSD
+ int
+-arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
++arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif)
+ {
+ int mib[6];
+ size_t len;
+@@ -91,7 +91,7 @@ arp_cache_lookup(in_addr_t ip, struct et
+ #endif
+
+ int
+-arp_cache_lookup(in_addr_t ip, struct ether_addr *ether)
++arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif)
+ {
+ int sock;
+ struct arpreq ar;
+@@ -99,7 +99,7 @@ arp_cache_lookup(in_addr_t ip, struct et
+
+ memset((char *)&ar, 0, sizeof(ar));
+ #ifdef __linux__
+- strncpy(ar.arp_dev, "eth0", sizeof(ar.arp_dev)); /* XXX - *sigh* */
++ strncpy(ar.arp_dev, lif, strlen(lif));
+ #endif
+ sin = (struct sockaddr_in *)&ar.arp_pa;
+ sin->sin_family = AF_INET;
diff --git a/package/dsniff/patches/patch-arp_h b/package/dsniff/patches/patch-arp_h
new file mode 100644
index 000000000..cfa1445ec
--- /dev/null
+++ b/package/dsniff/patches/patch-arp_h
@@ -0,0 +1,11 @@
+$Id$
+--- dsniff-2.4.orig/arp.h 2001-03-15 09:27:08.000000000 +0100
++++ dsniff-2.4/arp.h 2007-01-23 00:20:48.000000000 +0100
+@@ -11,6 +11,6 @@
+ #ifndef _ARP_H_
+ #define _ARP_H_
+
+-int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether);
++int arp_cache_lookup(in_addr_t ip, struct ether_addr *ether, const char *lif);
+
+ #endif /* _ARP_H_ */
diff --git a/package/dsniff/patches/patch-arpspoof_c b/package/dsniff/patches/patch-arpspoof_c
new file mode 100644
index 000000000..8f04ee1c1
--- /dev/null
+++ b/package/dsniff/patches/patch-arpspoof_c
@@ -0,0 +1,12 @@
+$Id$
+--- dsniff-2.4.orig/arpspoof.c 2001-03-15 09:32:58.000000000 +0100
++++ dsniff-2.4/arpspoof.c 2007-01-23 00:20:48.000000000 +0100
+@@ -113,7 +113,7 @@ arp_find(in_addr_t ip, struct ether_addr
+ int i = 0;
+
+ do {
+- if (arp_cache_lookup(ip, mac) == 0)
++ if (arp_cache_lookup(ip, mac, intf) == 0)
+ return (1);
+ #ifdef __linux__
+ /* XXX - force the kernel to arp. feh. */
diff --git a/package/dsniff/patches/patch-confdefs_h b/package/dsniff/patches/patch-confdefs_h
new file mode 100644
index 000000000..4f38843f8
--- /dev/null
+++ b/package/dsniff/patches/patch-confdefs_h
@@ -0,0 +1,28 @@
+$Id$
+--- dsniff-2.4.orig/confdefs.h 1970-01-01 00:00:00.000000000 +0100
++++ dsniff-2.4/confdefs.h 2007-01-23 00:20:53.000000000 +0100
+@@ -0,0 +1,24 @@
++
++#define X_DISPLAY_MISSING 1
++#define STDC_HEADERS 1
++#define HAVE_ERR_H 1
++#define HAVE_FCNTL_H 1
++#define HAVE_SYS_IOCTL_H 1
++#define HAVE_SYS_QUEUE_H 1
++#define HAVE_UNISTD_H 1
++#define HAVE_LIBGEN_H 1
++#define HAVE_MINMAX 1
++#define in_addr_t u_int32_t
++#define RETSIGTYPE void
++#define HAVE_STRFTIME 1
++#define HAVE_GETHOSTNAME 1
++#define HAVE_SOCKET 1
++#define HAVE_STRDUP 1
++#define HAVE_STRSTR 1
++#define HAVE_LIBNSL 1
++#define HAVE_DIRNAME 1
++#define HAVE_STRLCPY 1
++#define HAVE_STRLCAT 1
++#define HAVE_STRSEP 1
++#define HAVE_WARNX 1
++#define HAVE_ETHER_NTOA 1
diff --git a/package/dsniff/patches/patch-configure b/package/dsniff/patches/patch-configure
new file mode 100644
index 000000000..4808be06d
--- /dev/null
+++ b/package/dsniff/patches/patch-configure
@@ -0,0 +1,104 @@
+$Id$
+--- dsniff-2.4.orig/configure 2001-03-19 07:52:37.000000000 +0100
++++ dsniff-2.4/configure 2007-01-23 00:24:04.000000000 +0100
+@@ -16,6 +16,8 @@ ac_help="$ac_help
+ ac_help="$ac_help
+ --with-db=DIR use Berkeley DB (with --enable-compat185) in DIR"
+ ac_help="$ac_help
++ --with-gdbm=DIR use GNU DBM in DIR"
++ac_help="$ac_help
+ --with-libpcap=DIR use libpcap in DIR"
+ ac_help="$ac_help
+ --with-libnet=DIR use libnet in DIR"
+@@ -3031,7 +3033,7 @@ if test "${with_libpcap+set}" = set; the
+ PCAPINC="-I$withval -I$withval/bpf"
+ PCAPLIB="-L$withval -lpcap"
+ elif test -f $withval/include/pcap.h -a \
+- -f $withval/include/net/bpf.h -a \
++ -f $withval/include/pcap-bpf.h -a \
+ -f $withval/lib/libpcap.a; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+@@ -3059,7 +3061,40 @@ else
+
+ fi
+
++echo $ac_n "checking for libgdbm""... $ac_c" 1>&6
++echo "configure:3059: checking for libgdbm" >&5
++# Check whether --with-gdbm or --without-gdbm was given.
++if test "${with_gdbm+set}" = set; then
++ withval="$with_gdbm"
++ case "$withval" in
++ yes|no)
++ echo "$ac_t""no" 1>&6
++ ;;
++ *)
++ echo "$ac_t""$withval" 1>&6
++ if test -f $withval/include/gdbm.h -a -f $withval/lib/libgdbm.so; then
++ owd=`pwd`
++ if cd $withval; then withval=`pwd`; cd $owd; fi
++ DBINC="-I$withval/include"
++ DBLIB="-L$withval/lib -lgdbm"
++ else
++ { echo "configure: error: gdbm.h or libgdbm.so not found in $withval" 1>&2; exit 1; }
++ fi
++ ;;
++ esac
++else
++ if test -f ${prefix}/include/gdbm.h; then
++ LNETINC="-I${prefix}/include"
++ LNETLIB="-L${prefix}/lib -lgdbm"
++ elif test -f /usr/include/gdbm.h; then
++ LNETLIB="-lgdbm"
++ else
++ echo "$ac_t""no" 1>&6
++ { echo "configure: error: libgdbm not found" 1>&2; exit 1; }
++ fi
++ echo "$ac_t""yes" 1>&6
+
++fi
+
+
+ echo $ac_n "checking for libnet""... $ac_c" 1>&6
+@@ -3073,7 +3108,7 @@ if test "${with_libnet+set}" = set; then
+ ;;
+ *)
+ echo "$ac_t""$withval" 1>&6
+- if test -f $withval/include/libnet.h -a -f $withval/lib/libnet.a; then
++ if test -f $withval/include/libnet.h -a -f $withval/lib/libnet.so; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ if test -f $withval/bin/libnet-config; then
+@@ -3086,7 +3121,7 @@ if test "${with_libnet+set}" = set; then
+ LNETINC="-I$withval/include"
+ LNETLIB="-L$withval/lib -lnet"
+ else
+- { echo "configure: error: libnet.h or libnet.a not found in $withval" 1>&2; exit 1; }
++ { echo "configure: error: libnet.h or libnet.so not found in $withval" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
+@@ -3120,18 +3155,18 @@ if test "${with_libnids+set}" = set; the
+ ;;
+ *)
+ echo "$ac_t""$withval" 1>&6
+- if test -f $withval/src/nids.h -a -f $withval/src/libnids.a; then
++ if test -f $withval/include/nids.h -a -f $withval/lib/libnids.so; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+- NIDSINC="-I$withval/src"
+- NIDSLIB="-L$withval/src -lnids"
+- elif test -f $withval/include/nids.h -a -f $withval/lib/libnids.a; then
++ NIDSINC="-I$withval/include"
++ NIDSLIB="-L$withval/lib -lnids"
++ elif test -f $withval/include/nids.h -a -f $withval/lib/libnids.so; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ NIDSINC="-I$withval/include"
+ NIDSLIB="-L$withval/lib -lnids"
+ else
+- { echo "configure: error: nids.h or libnids.a not found in $withval" 1>&2; exit 1; }
++ { echo "configure: error: nids.h or libnids.so not found in $withval" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
diff --git a/package/dsniff/patches/patch-decode_c b/package/dsniff/patches/patch-decode_c
new file mode 100644
index 000000000..9709c8a5a
--- /dev/null
+++ b/package/dsniff/patches/patch-decode_c
@@ -0,0 +1,21 @@
+$Id$
+--- dsniff-2.4.orig/decode.c 2001-03-15 09:32:59.000000000 +0100
++++ dsniff-2.4/decode.c 2007-01-23 00:20:48.000000000 +0100
+@@ -51,8 +51,6 @@ extern int decode_irc(u_char *, int, u_c
+ extern int decode_portmap(u_char *, int, u_char *, int);
+ extern int decode_mountd(u_char *, int, u_char *, int);
+ extern int decode_vrrp(u_char *, int, u_char *, int);
+-extern int decode_ypserv(u_char *, int, u_char *, int);
+-extern int decode_yppasswd(u_char *, int, u_char *, int);
+
+ static struct decode decodes[] = {
+ { "hex", decode_hex },
+@@ -88,8 +86,6 @@ static struct decode decodes[] = {
+ { "irc", decode_irc },
+ { "portmap", decode_portmap },
+ { "mountd", decode_mountd },
+- { "ypserv", decode_ypserv },
+- { "yppasswd", decode_yppasswd },
+ { NULL }
+ };
+
diff --git a/package/dsniff/patches/patch-dns_c b/package/dsniff/patches/patch-dns_c
new file mode 100644
index 000000000..3e939d450
--- /dev/null
+++ b/package/dsniff/patches/patch-dns_c
@@ -0,0 +1,681 @@
+$Id$
+--- dsniff-2.4.orig/dns.c 1970-01-01 00:00:00.000000000 +0100
++++ dsniff-2.4/dns.c 2007-01-23 00:20:48.000000000 +0100
+@@ -0,0 +1,677 @@
++/*
++ * Copyright (c) 1985, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++/*
++ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies, and that
++ * the name of Digital Equipment Corporation not be used in advertising or
++ * publicity pertaining to distribution of the document or software without
++ * specific, written prior permission.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
++ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
++ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ * Copyright (c) 1996,1999 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ *
++ * DNS helper functions not implemented in uclibc
++ *
++ */
++
++
++#include <sys/types.h>
++#include <sys/param.h>
++#include <netinet/in.h>
++#include <arpa/nameser.h>
++#include <ctype.h>
++#include <resolv.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++
++static const char digits[] = "0123456789";
++
++/* Forward. */
++
++static int special(int);
++static int printable(int);
++static int dn_find(const u_char *, const u_char *,
++ const u_char * const *,
++ const u_char * const *);
++
++
++/*
++ * ns_name_ntop(src, dst, dstsiz)
++ * Convert an encoded domain name to printable ascii as per RFC1035.
++ * return:
++ * Number of bytes written to buffer, or -1 (with errno set)
++ * notes:
++ * The root is returned as "."
++ * All other domains are returned in non absolute form
++ */
++int
++ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
++ const u_char *cp;
++ char *dn, *eom;
++ u_char c;
++ u_int n;
++
++ cp = src;
++ dn = dst;
++ eom = dst + dstsiz;
++
++ while ((n = *cp++) != 0) {
++ if ((n & NS_CMPRSFLGS) != 0) {
++ /* Some kind of compression pointer. */
++ return (-1);
++ }
++ if (dn != dst) {
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = '.';
++ }
++ if (dn + n >= eom) {
++ return (-1);
++ }
++ for ((void)NULL; n > 0; n--) {
++ c = *cp++;
++ if (special(c)) {
++ if (dn + 1 >= eom) {
++ return (-1);
++ }
++ *dn++ = '\\';
++ *dn++ = (char)c;
++ } else if (!printable(c)) {
++ if (dn + 3 >= eom) {
++ return (-1);
++ }
++ *dn++ = '\\';
++ *dn++ = digits[c / 100];
++ *dn++ = digits[(c % 100) / 10];
++ *dn++ = digits[c % 10];
++ } else {
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = (char)c;
++ }
++ }
++ }
++ if (dn == dst) {
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = '.';
++ }
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = '\0';
++ return (dn - dst);
++}
++
++/*
++ * ns_name_pton(src, dst, dstsiz)
++ * Convert a ascii string into an encoded domain name as per RFC1035.
++ * return:
++ * -1 if it fails
++ * 1 if string was fully qualified
++ * 0 is string was not fully qualified
++ * notes:
++ * Enforces label and domain length limits.
++ */
++
++int
++ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
++ u_char *label, *bp, *eom;
++ int c, n, escaped;
++ char *cp;
++
++ escaped = 0;
++ bp = dst;
++ eom = dst + dstsiz;
++ label = bp++;
++
++ while ((c = *src++) != 0) {
++ if (escaped) {
++ if ((cp = strchr(digits, c)) != NULL) {
++ n = (cp - digits) * 100;
++ if ((c = *src++) == 0 ||
++ (cp = strchr(digits, c)) == NULL) {
++ return (-1);
++ }
++ n += (cp - digits) * 10;
++ if ((c = *src++) == 0 ||
++ (cp = strchr(digits, c)) == NULL) {
++ return (-1);
++ }
++ n += (cp - digits);
++ if (n > 255) {
++ return (-1);
++ }
++ c = n;
++ }
++ escaped = 0;
++ } else if (c == '\\') {
++ escaped = 1;
++ continue;
++ } else if (c == '.') {
++ c = (bp - label - 1);
++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
++ return (-1);
++ }
++ if (label >= eom) {
++ return (-1);
++ }
++ *label = c;
++ /* Fully qualified ? */
++ if (*src == '\0') {
++ if (c != 0) {
++ if (bp >= eom) {
++ return (-1);
++ }
++ *bp++ = '\0';
++ }
++ if ((bp - dst) > MAXCDNAME) {
++ return (-1);
++ }
++ return (1);
++ }
++ if (c == 0 || *src == '.') {
++ return (-1);
++ }
++ label = bp++;
++ continue;
++ }
++ if (bp >= eom) {
++ return (-1);
++ }
++ *bp++ = (u_char)c;
++ }
++ c = (bp - label - 1);
++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
++ return (-1);
++ }
++ if (label >= eom) {
++ return (-1);
++ }
++ *label = c;
++ if (c != 0) {
++ if (bp >= eom) {
++ return (-1);
++ }
++ *bp++ = 0;
++ }
++ if ((bp - dst) > MAXCDNAME) { /* src too big */
++ return (-1);
++ }
++ return (0);
++}
++
++/*
++ * ns_name_ntol(src, dst, dstsiz)
++ * Convert a network strings labels into all lowercase.
++ * return:
++ * Number of bytes written to buffer, or -1 (with errno set)
++ * notes:
++ * Enforces label and domain length limits.
++ */
++
++int
++ns_name_ntol(const u_char *src, u_char *dst, size_t dstsiz) {
++ const u_char *cp;
++ u_char *dn, *eom;
++ u_char c;
++ u_int n;
++
++ cp = src;
++ dn = dst;
++ eom = dst + dstsiz;
++
++ while ((n = *cp++) != 0) {
++ if ((n & NS_CMPRSFLGS) != 0) {
++ /* Some kind of compression pointer. */
++ return (-1);
++ }
++ *dn++ = n;
++ if (dn + n >= eom) {
++ return (-1);
++ }
++ for ((void)NULL; n > 0; n--) {
++ c = *cp++;
++ if (isupper(c))
++ *dn++ = tolower(c);
++ else
++ *dn++ = c;
++ }
++ }
++ *dn++ = '\0';
++ return (dn - dst);
++}
++
++/*
++ * ns_name_unpack(msg, eom, src, dst, dstsiz)
++ * Unpack a domain name from a message, source may be compressed.
++ * return:
++ * -1 if it fails, or consumed octets if it succeeds.
++ */
++int
++ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
++ u_char *dst, size_t dstsiz)
++{
++ const u_char *srcp, *dstlim;
++ u_char *dstp;
++ int n, len, checked;
++
++ len = -1;
++ checked = 0;
++ dstp = dst;
++ srcp = src;
++ dstlim = dst + dstsiz;
++ if (srcp < msg || srcp >= eom) {
++ return (-1);
++ }
++ /* Fetch next label in domain name. */
++ while ((n = *srcp++) != 0) {
++ /* Check for indirection. */
++ switch (n & NS_CMPRSFLGS) {
++ case 0:
++ /* Limit checks. */
++ if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
++ return (-1);
++ }
++ checked += n + 1;
++ *dstp++ = n;
++ memcpy(dstp, srcp, n);
++ dstp += n;
++ srcp += n;
++ break;
++
++ case NS_CMPRSFLGS:
++ if (srcp >= eom) {
++ return (-1);
++ }
++ if (len < 0)
++ len = srcp - src + 1;
++ srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
++ if (srcp < msg || srcp >= eom) { /* Out of range. */
++ return (-1);
++ }
++ checked += 2;
++ /*
++ * Check for loops in the compressed name;
++ * if we've looked at the whole message,
++ * there must be a loop.
++ */
++ if (checked >= eom - msg) {
++ return (-1);
++ }
++ break;
++
++ default:
++ return (-1); /* flag error */
++ }
++ }
++ *dstp = '\0';
++ if (len < 0)
++ len = srcp - src;
++ return (len);
++}
++
++/*
++ * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
++ * Pack domain name 'domain' into 'comp_dn'.
++ * return:
++ * Size of the compressed name, or -1.
++ * notes:
++ * 'dnptrs' is an array of pointers to previous compressed names.
++ * dnptrs[0] is a pointer to the beginning of the message. The array
++ * ends with NULL.
++ * 'lastdnptr' is a pointer to the end of the array pointed to
++ * by 'dnptrs'.
++ * Side effects:
++ * The list of pointers in dnptrs is updated for labels inserted into
++ * the message as we compress the name. If 'dnptr' is NULL, we don't
++ * try to compress names. If 'lastdnptr' is NULL, we don't update the
++ * list.
++ */
++int
++ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
++ const u_char **dnptrs, const u_char **lastdnptr)
++{
++ u_char *dstp;
++ const u_char **cpp, **lpp, *eob, *msg;
++ const u_char *srcp;
++ int n, l, first = 1;
++
++ srcp = src;
++ dstp = dst;
++ eob = dstp + dstsiz;
++ lpp = cpp = NULL;
++ if (dnptrs != NULL) {
++ if ((msg = *dnptrs++) != NULL) {
++ for (cpp = dnptrs; *cpp != NULL; cpp++)
++ (void)NULL;
++ lpp = cpp; /* end of list to search */
++ }
++ } else
++ msg = NULL;
++
++ /* make sure the domain we are about to add is legal */
++ l = 0;
++ do {
++ n = *srcp;
++ if ((n & NS_CMPRSFLGS) != 0) {
++ return (-1);
++ }
++ l += n + 1;
++ if (l > MAXCDNAME) {
++ return (-1);
++ }
++ srcp += n + 1;
++ } while (n != 0);
++
++ /* from here on we need to reset compression pointer array on error */
++ srcp = src;
++ do {
++ /* Look to see if we can use pointers. */
++ n = *srcp;
++ if (n != 0 && msg != NULL) {
++ l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
++ (const u_char * const *)lpp);
++ if (l >= 0) {
++ if (dstp + 1 >= eob) {
++ goto cleanup;
++ }
++ *dstp++ = (l >> 8) | NS_CMPRSFLGS;
++ *dstp++ = l % 256;
++ return (dstp - dst);
++ }
++ /* Not found, save it. */
++ if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
++ (dstp - msg) < 0x4000 && first) {
++ *cpp++ = dstp;
++ *cpp = NULL;
++ first = 0;
++ }
++ }
++ /* copy label to buffer */
++ if (n & NS_CMPRSFLGS) { /* Should not happen. */
++ goto cleanup;
++ }
++ if (dstp + 1 + n >= eob) {
++ goto cleanup;
++ }
++ memcpy(dstp, srcp, n + 1);
++ srcp += n + 1;
++ dstp += n + 1;
++ } while (n != 0);
++
++ if (dstp > eob) {
++cleanup:
++ if (msg != NULL)
++ *lpp = NULL;
++ return (-1);
++ }
++ return (dstp - dst);
++}
++
++/*
++ * ns_name_uncompress(msg, eom, src, dst, dstsiz)
++ * Expand compressed domain name to presentation format.
++ * return:
++ * Number of bytes read out of `src', or -1 (with errno set).
++ * note:
++ * Root domain returns as "." not "".
++ */
++int
++ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
++ char *dst, size_t dstsiz)
++{
++ u_char tmp[NS_MAXCDNAME];
++ int n;
++
++ if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
++ return (-1);
++ if (ns_name_ntop(tmp, dst, dstsiz) == -1)
++ return (-1);
++ return (n);
++}
++
++/*
++ * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
++ * Compress a domain name into wire format, using compression pointers.
++ * return:
++ * Number of bytes consumed in `dst' or -1 (with errno set).
++ * notes:
++ * 'dnptrs' is an array of pointers to previous compressed names.
++ * dnptrs[0] is a pointer to the beginning of the message.
++ * The list ends with NULL. 'lastdnptr' is a pointer to the end of the
++ * array pointed to by 'dnptrs'. Side effect is to update the list of
++ * pointers for labels inserted into the message as we compress the name.
++ * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
++ * is NULL, we don't update the list.
++ */
++int
++ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
++ const u_char **dnptrs, const u_char **lastdnptr)
++{
++ u_char tmp[NS_MAXCDNAME];
++
++ if (ns_name_pton(src, tmp, sizeof tmp) == -1)
++ return (-1);
++ return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
++}
++
++/*
++ * special(ch)
++ * Thinking in noninternationalized USASCII (per the DNS spec),
++ * is this characted special ("in need of quoting") ?
++ * return:
++ * boolean.
++ */
++static int
++special(int ch) {
++ switch (ch) {
++ case 0x22: /* '"' */
++ case 0x2E: /* '.' */
++ case 0x3B: /* ';' */
++ case 0x5C: /* '\\' */
++ /* Special modifiers in zone files. */
++ case 0x40: /* '@' */
++ case 0x24: /* '$' */
++ return (1);
++ default:
++ return (0);
++ }
++}
++
++/*
++ * printable(ch)
++ * Thinking in noninternationalized USASCII (per the DNS spec),
++ * is this character visible and not a space when printed ?
++ * return:
++ * boolean.
++ */
++static int
++printable(int ch) {
++ return (ch > 0x20 && ch < 0x7f);
++}
++
++/*
++ * Thinking in noninternationalized USASCII (per the DNS spec),
++ * convert this character to lower case if it's upper case.
++ */
++static int
++mklower(int ch) {
++ if (ch >= 0x41 && ch <= 0x5A)
++ return (ch + 0x20);
++ return (ch);
++}
++
++/*
++ * dn_find(domain, msg, dnptrs, lastdnptr)
++ * Search for the counted-label name in an array of compressed names.
++ * return:
++ * offset from msg if found, or -1.
++ * notes:
++ * dnptrs is the pointer to the first name on the list,
++ * not the pointer to the start of the message.
++ */
++static int
++dn_find(const u_char *domain, const u_char *msg,
++ const u_char * const *dnptrs,
++ const u_char * const *lastdnptr)
++{
++ const u_char *dn, *cp, *sp;
++ const u_char * const *cpp;
++ u_int n;
++
++ for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
++ sp = *cpp;
++ /*
++ * terminate search on:
++ * root label
++ * compression pointer
++ * unusable offset
++ */
++ while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 &&
++ (sp - msg) < 0x4000) {
++ dn = domain;
++ cp = sp;
++ while ((n = *cp++) != 0) {
++ /*
++ * check for indirection
++ */
++ switch (n & NS_CMPRSFLGS) {
++ case 0: /* normal case, n == len */
++ if (n != *dn++)
++ goto next;
++ for ((void)NULL; n > 0; n--)
++ if (mklower(*dn++) !=
++ mklower(*cp++))
++ goto next;
++ /* Is next root for both ? */
++ if (*dn == '\0' && *cp == '\0')
++ return (sp - msg);
++ if (*dn)
++ continue;
++ goto next;
++
++ case NS_CMPRSFLGS: /* indirection */
++ cp = msg + (((n & 0x3f) << 8) | *cp);
++ break;
++
++ default: /* illegal type */
++ return (-1);
++ }
++ }
++ next:
++ sp += *sp + 1;
++ }
++ }
++ return (-1);
++}
++
++/*
++ * Expand compressed domain name 'comp_dn' to full domain name.
++ * 'msg' is a pointer to the begining of the message,
++ * 'eomorig' points to the first location after the message,
++ * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
++ * Return size of compressed name or -1 if there was an error.
++ */
++int
++dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
++ char *dst, int dstsiz)
++{
++ int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
++
++ if (n > 0 && dst[0] == '.')
++ dst[0] = '\0';
++ return (n);
++}
++
++/*
++ * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
++ * Return the size of the compressed name or -1.
++ * 'length' is the size of the array pointed to by 'comp_dn'.
++ */
++int
++dn_comp(const char *src, u_char *dst, int dstsiz,
++ u_char **dnptrs, u_char **lastdnptr)
++{
++ return (ns_name_compress(src, dst, (size_t)dstsiz,
++ (const u_char **)dnptrs,
++ (const u_char **)lastdnptr));
++}
++
diff --git a/package/dsniff/patches/patch-dsniff_services b/package/dsniff/patches/patch-dsniff_services
new file mode 100644
index 000000000..7b4827426
--- /dev/null
+++ b/package/dsniff/patches/patch-dsniff_services
@@ -0,0 +1,9 @@
+$Id$
+--- dsniff-2.4.orig/dsniff.services 2000-12-15 21:10:58.000000000 +0100
++++ dsniff-2.4/dsniff.services 2007-01-23 00:20:48.000000000 +0100
+@@ -66,5 +66,3 @@ napster 8888/tcp
+ aim 9898/tcp
+ pcanywhere 65301/tcp
+ mountd 100005/rpc
+-ypserv 100004/rpc
+-yppasswd 100009/rpc
diff --git a/package/dsniff/patches/patch-msgsnarf_c b/package/dsniff/patches/patch-msgsnarf_c
new file mode 100644
index 000000000..4bdef8a83
--- /dev/null
+++ b/package/dsniff/patches/patch-msgsnarf_c
@@ -0,0 +1,11 @@
+$Id$
+--- dsniff-2.4.orig/msgsnarf.c 2001-03-15 09:33:04.000000000 +0100
++++ dsniff-2.4/msgsnarf.c 2007-01-23 00:20:48.000000000 +0100
+@@ -23,6 +23,7 @@
+ #include <nids.h>
+ #include <pcap.h>
+ #include <pcaputil.h>
++#include <time.h>
+
+ #include "buf.h"
+ #include "decode.h"
diff --git a/package/dsniff/patches/patch-record_c b/package/dsniff/patches/patch-record_c
new file mode 100644
index 000000000..cd63e0969
--- /dev/null
+++ b/package/dsniff/patches/patch-record_c
@@ -0,0 +1,151 @@
+$Id$
+--- dsniff-2.4.orig/record.c 2001-03-15 09:33:04.000000000 +0100
++++ dsniff-2.4/record.c 2007-01-23 00:20:48.000000000 +0100
+@@ -15,12 +15,7 @@
+ #include <stdio.h>
+ #include <time.h>
+ #include <md5.h>
+-#ifdef HAVE_DB_185_H
+-#define DB_LIBRARY_COMPATIBILITY_API
+-#include <db_185.h>
+-#elif HAVE_DB_H
+-#include <db.h>
+-#endif
++#include <gdbm.h>
+ #include <libnet.h>
+
+ #include "options.h"
+@@ -37,7 +32,7 @@ struct rec {
+ struct netobj data;
+ };
+
+-static DB *db;
++GDBM_FILE dbf;
+
+ static int
+ xdr_rec(XDR *xdrs, struct rec *rec)
+@@ -64,7 +59,6 @@ record_print(struct rec *rec)
+
+ tm = localtime(&rec->time);
+ strftime(tstr, sizeof(tstr), "%x %X", tm);
+-
+ srcp = libnet_host_lookup(rec->src, Opt_dns);
+ dstp = libnet_host_lookup(rec->dst, Opt_dns);
+
+@@ -89,10 +83,10 @@ record_print(struct rec *rec)
+ fflush(stdout);
+ }
+
+-static DBT *
++static datum
+ record_hash(struct rec *rec)
+ {
+- static DBT key;
++ static datum key;
+ static u_char hash[16];
+ MD5_CTX ctx;
+
+@@ -105,16 +99,16 @@ record_hash(struct rec *rec)
+ MD5Update(&ctx, rec->data.n_bytes, rec->data.n_len);
+ MD5Final(hash, &ctx);
+
+- key.data = hash;
+- key.size = sizeof(hash);
++ key.dptr = hash;
++ key.dsize = sizeof(hash);
+
+- return (&key);
++ return (key);
+ }
+
+ static int
+ record_save(struct rec *rec)
+ {
+- DBT *key, data;
++ datum key, data;
+ XDR xdrs;
+ u_char buf[2048];
+
+@@ -123,15 +117,15 @@ record_save(struct rec *rec)
+ if (!xdr_rec(&xdrs, rec))
+ return (0);
+
+- data.data = buf;
+- data.size = xdr_getpos(&xdrs);
++ data.dptr = buf;
++ data.dsize = xdr_getpos(&xdrs);
+
+ xdr_destroy(&xdrs);
+
+ key = record_hash(rec);
+
+- if (db->put(db, key, &data, R_NOOVERWRITE) == 0)
+- db->sync(db, 0);
++ if (gdbm_store(dbf, key, data, GDBM_INSERT) == 0)
++ gdbm_sync(dbf);
+
+ return (1);
+ }
+@@ -139,18 +133,22 @@ record_save(struct rec *rec)
+ void
+ record_dump(void)
+ {
+- DBT key, data;
++ datum nextkey, key, content;
+ XDR xdrs;
+ struct rec rec;
+
+- while (db->seq(db, &key, &data, R_NEXT) == 0) {
++ key = gdbm_firstkey(dbf);
++ while (key.dptr) {
++ nextkey = gdbm_nextkey(dbf, key);
++ content = gdbm_fetch(dbf, key);
+ memset(&rec, 0, sizeof(rec));
+- xdrmem_create(&xdrs, data.data, data.size, XDR_DECODE);
+-
++ xdrmem_create(&xdrs, content.dptr, content.dsize, XDR_DECODE);
+ if (xdr_rec(&xdrs, &rec)) {
+ record_print(&rec);
+ }
+ xdr_destroy(&xdrs);
++ free(key.dptr);
++ key = nextkey;
+ }
+ }
+
+@@ -158,16 +156,23 @@ int
+ record_init(char *file)
+ {
+ int flags, mode;
+-
++ // needed for gdbm_open, which does not have the option to create
++ // a database in memory
++ if(file == NULL) {
++ char *record_file = "/tmp/.dsniff.db";
++ file = record_file;
++ }
++
+ if (Opt_read) {
+- flags = O_RDONLY;
++ flags = GDBM_READER;
+ mode = 0;
+ }
+ else {
+- flags = O_RDWR|O_CREAT;
++ flags = GDBM_WRCREAT;
+ mode = S_IRUSR|S_IWUSR;
+ }
+- if ((db = dbopen(file, flags, mode, DB_BTREE, NULL)) == NULL)
++
++ if ((dbf = gdbm_open(file, 1024, flags, mode, NULL)) == NULL)
+ return (0);
+
+ return (1);
+@@ -206,6 +211,6 @@ record(in_addr_t src, in_addr_t dst, int
+ void
+ record_close(void)
+ {
+- db->close(db);
++ gdbm_close(dbf);
+ }
+
diff --git a/package/dsniff/patches/patch-ssh_c b/package/dsniff/patches/patch-ssh_c
new file mode 100644
index 000000000..2bf20f1f6
--- /dev/null
+++ b/package/dsniff/patches/patch-ssh_c
@@ -0,0 +1,46 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- dsniff-2.4.orig/ssh.c 2001-03-15 09:33:04.000000000 +0100
++++ dsniff-2.4/ssh.c 2009-05-09 23:17:07.000000000 +0200
+@@ -331,12 +331,14 @@ SSH_accept(SSH *ssh)
+ ssh->encrypt = des3_encrypt;
+ ssh->decrypt = des3_decrypt;
+ }
++#ifndef OPENSSL_NO_BF
+ else if (cipher == SSH_CIPHER_BLOWFISH) {
+ ssh->estate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
+ ssh->dstate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
+ ssh->encrypt = blowfish_encrypt;
+ ssh->decrypt = blowfish_decrypt;
+ }
++#endif
+
+ /* Send verification. */
+ msg[0] = SSH_SMSG_SUCCESS;
+@@ -461,18 +463,20 @@ SSH_connect(SSH *ssh)
+ return (-1);
+ }
+ /* Set cipher. */
+- if (cipher == SSH_CIPHER_BLOWFISH) {
+- ssh->estate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
+- ssh->dstate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
+- ssh->encrypt = blowfish_encrypt;
+- ssh->decrypt = blowfish_decrypt;
+- }
+- else if (cipher == SSH_CIPHER_3DES) {
++ if (cipher == SSH_CIPHER_3DES) {
+ ssh->estate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
+ ssh->dstate = des3_init(ssh->sesskey, sizeof(ssh->sesskey));
+ ssh->encrypt = des3_encrypt;
+ ssh->decrypt = des3_decrypt;
+ }
++#ifndef OPENSSL_NO_BF
++ else if (cipher == SSH_CIPHER_BLOWFISH) {
++ ssh->estate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
++ ssh->dstate = blowfish_init(ssh->sesskey,sizeof(ssh->sesskey));
++ ssh->encrypt = blowfish_encrypt;
++ ssh->decrypt = blowfish_decrypt;
++ }
++#endif
+ /* Get server response. */
+ if ((i = SSH_recv(ssh, pkt, sizeof(pkt))) <= 0) {
+ warn("SSH_recv");
diff --git a/package/dsniff/patches/patch-sshcrypto_c b/package/dsniff/patches/patch-sshcrypto_c
new file mode 100644
index 000000000..981aadb53
--- /dev/null
+++ b/package/dsniff/patches/patch-sshcrypto_c
@@ -0,0 +1,43 @@
+$Id$
+--- dsniff-2.4.orig/sshcrypto.c 2001-03-15 09:33:04.000000000 +0100
++++ dsniff-2.4/sshcrypto.c 2009-05-09 23:13:59.000000000 +0200
+@@ -14,6 +14,10 @@
+
+ #include <sys/types.h>
+ #include <openssl/ssl.h>
++#ifndef OPENSSL_NO_BF
++#include <openssl/blowfish.h>
++#endif
++#include <openssl/des.h>
+
+ #include <err.h>
+ #include <stdio.h>
+@@ -21,10 +25,12 @@
+
+ #include "sshcrypto.h"
+
++#ifndef OPENSSL_NO_BF
+ struct blowfish_state {
+ struct bf_key_st key;
+ u_char iv[8];
+ };
++#endif
+
+ struct des3_state {
+ des_key_schedule k1, k2, k3;
+@@ -106,6 +112,7 @@ swap_bytes(const u_char *src, u_char *ds
+ }
+ }
+
++#ifndef OPENSSL_NO_BF
+ void *
+ blowfish_init(u_char *sesskey, int len)
+ {
+@@ -143,6 +150,7 @@ blowfish_decrypt(u_char *src, u_char *ds
+ BF_DECRYPT);
+ swap_bytes(dst, dst, len);
+ }
++#endif
+
+ /* XXX - SSH1's weirdo 3DES... */
+ void *
diff --git a/package/dsniff/patches/patch-sshow_c b/package/dsniff/patches/patch-sshow_c
new file mode 100644
index 000000000..25e94ef1c
--- /dev/null
+++ b/package/dsniff/patches/patch-sshow_c
@@ -0,0 +1,38 @@
+$Id$
+--- dsniff-2.4.orig/sshow.c 2001-03-19 07:52:15.000000000 +0100
++++ dsniff-2.4/sshow.c 2008-10-10 14:53:48.000000000 +0200
+@@ -15,6 +15,7 @@
+
+ #include <sys/types.h>
+ #include <sys/times.h>
++#include <time.h>
+
+ #include <netinet/in_systm.h>
+ #include <netinet/in.h>
+@@ -222,7 +223,7 @@ client_to_server(struct tcp_stream *ts,
+ if (debug)
+ printf("- %s -> %s: DATA (%s bytes, %.2f seconds)\n",
+ s_saddr(ts), s_daddr(ts), s_range(plain_range),
+- (float)delay / CLK_TCK);
++ (float)delay / CLOCKS_PER_SEC);
+ if (debug > 1)
+ print_data(&ts->server, cipher_size);
+
+@@ -270,7 +271,7 @@ server_to_client(struct tcp_stream *ts,
+ if (debug)
+ printf("- %s <- %s: DATA (%s bytes, %.2f seconds)\n",
+ s_saddr(ts), s_daddr(ts), s_range(plain_range),
+- (float)delay / CLK_TCK);
++ (float)delay / CLOCKS_PER_SEC);
+ if (debug > 1)
+ print_data(&ts->client, cipher_size);
+
+@@ -299,7 +300,7 @@ server_to_client(struct tcp_stream *ts,
+
+ if (session->state == 1 &&
+ #ifdef USE_TIMING
+- now - get_history(session, 2)->timestamp >= CLK_TCK &&
++ now - get_history(session, 2)->timestamp >= CLOCKS_PER_SEC &&
+ #endif
+ session->protocol == 1 &&
+ (session->history.directions & 7) == 5 &&
diff --git a/package/e2fsprogs/Config.in b/package/e2fsprogs/Config.in
new file mode 100644
index 000000000..6638f88fc
--- /dev/null
+++ b/package/e2fsprogs/Config.in
@@ -0,0 +1,26 @@
+config ADK_PACKAGE_E2FSPROGS
+ prompt "e2fsprogs......................... Ext2/3 filesystem utilities"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBUUID
+ select ADK_PACKAGE_LIBCOM_ERR
+ help
+ This package contains essential ext2 filesystem utilities which consists of
+ e2fsck, mke2fs, debugfs, dumpe2fs, tune2fs, and most of the other core ext2
+ filesystem utilities.
+
+ http://e2fsprogs.sourceforge.net/
+
+config ADK_PACKAGE_LIBUUID
+ prompt "libuuid......................... UUID library"
+ depends ADK_PACKAGE_E2FSPROGS
+ tristate
+ default n
+ help
+
+config ADK_PACKAGE_LIBCOM_ERR
+ prompt "libcom_err...................... Common error library"
+ depends ADK_PACKAGE_E2FSPROGS
+ tristate
+ default n
+ help
diff --git a/package/e2fsprogs/Makefile b/package/e2fsprogs/Makefile
new file mode 100644
index 000000000..e62858527
--- /dev/null
+++ b/package/e2fsprogs/Makefile
@@ -0,0 +1,57 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= e2fsprogs
+PKG_VERSION:= 1.41.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b21d26fc46c584021dc9c444933ee1c2
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=e2fsprogs/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,E2FSPROGS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBUUID,libuuid,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBCOM_ERR,libcom-err,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-elf-shlibs \
+ --disable-tls \
+ --enable-dynamic-e2fsck
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+INSTALL_TARGET+= install-libs
+
+pre-build:
+ ${MAKE} -C ${WRKBUILD}/util \
+ BUILDCC="${HOSTCC}" \
+ CFLAGS="" \
+ LDFLAGS="" \
+ CPPFLAGS="" \
+ subst
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_E2FSPROGS}/usr/lib
+ ${INSTALL_DIR} ${IDIR_E2FSPROGS}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/e2fsck ${IDIR_E2FSPROGS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/mke2fs ${IDIR_E2FSPROGS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/tune2fs ${IDIR_E2FSPROGS}/usr/sbin/
+ ${CP} ${WRKINST}/usr/lib/lib{blkid,e2p,ext2fs}.so.* \
+ ${IDIR_E2FSPROGS}/usr/lib/
+ # subpackage libcom_err
+ ${INSTALL_DIR} ${IDIR_LIBCOM_ERR}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libcom_err.so.* \
+ ${IDIR_LIBCOM_ERR}/usr/lib/
+ # subpackage libuuid
+ ${INSTALL_DIR} ${IDIR_LIBUUID}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libuuid.so.* \
+ ${IDIR_LIBUUID}/usr/lib/
+ # install some headers explicitely
+ ${INSTALL_DIR} ${STAGING_DIR}/usr/include/uuid
+ ${CP} ${WRKBUILD}/lib/uuid/uuid.h \
+ ${STAGING_DIR}/usr/include/uuid
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/e2fsprogs/ipkg/e2fsprogs.control b/package/e2fsprogs/ipkg/e2fsprogs.control
new file mode 100644
index 000000000..73e023d45
--- /dev/null
+++ b/package/e2fsprogs/ipkg/e2fsprogs.control
@@ -0,0 +1,4 @@
+Package: e2fsprogs
+Priority: optional
+Section: admin
+Description: Ext2/3 filesystem utilities
diff --git a/package/e2fsprogs/ipkg/libcom-err.control b/package/e2fsprogs/ipkg/libcom-err.control
new file mode 100644
index 000000000..4e8d022e8
--- /dev/null
+++ b/package/e2fsprogs/ipkg/libcom-err.control
@@ -0,0 +1,4 @@
+Package: libcom-err
+Priority: optional
+Section: admin
+Description: Common error library
diff --git a/package/e2fsprogs/ipkg/libuuid.control b/package/e2fsprogs/ipkg/libuuid.control
new file mode 100644
index 000000000..b0f738801
--- /dev/null
+++ b/package/e2fsprogs/ipkg/libuuid.control
@@ -0,0 +1,4 @@
+Package: libuuid
+Priority: optional
+Section: admin
+Description: UUID library
diff --git a/package/e2fsprogs/patches/patch-misc_Makefile_in b/package/e2fsprogs/patches/patch-misc_Makefile_in
new file mode 100644
index 000000000..f79bd78d7
--- /dev/null
+++ b/package/e2fsprogs/patches/patch-misc_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- e2fsprogs-1.41.3.orig/misc/Makefile.in 2008-10-07 16:22:39.000000000 +0200
++++ e2fsprogs-1.41.3/misc/Makefile.in 2009-01-13 14:16:03.661864854 +0100
+@@ -113,7 +113,7 @@ tune2fs.static: $(TUNE2FS_OBJS) $(STATIC
+ blkid: $(BLKID_OBJS) $(DEPLIBBLKID) $(LIBEXT2FS)
+ @echo " LD $@"
+ @$(CC) $(ALL_LDFLAGS) -o blkid $(BLKID_OBJS) $(LIBBLKID) $(LIBINTL) \
+- $(LIBEXT2FS)
++ $(LIBEXT2FS) $(LIBCOM_ERR)
+
+ e2image: $(E2IMAGE_OBJS) $(DEPLIBS)
+ @echo " LD $@"
diff --git a/package/elinks/Config.in b/package/elinks/Config.in
new file mode 100644
index 000000000..d44e69e8f
--- /dev/null
+++ b/package/elinks/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_ELINKS
+ prompt "elinks............................ A text based web browser"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ An advanced text based web browser
+
+ http://elinks.or.cz/
diff --git a/package/elinks/Makefile b/package/elinks/Makefile
new file mode 100644
index 000000000..c2a8e485a
--- /dev/null
+++ b/package/elinks/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= elinks
+PKG_VERSION:= 0.11.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 11547e054d7afb1f5ac9e9f65728cc6a
+MASTER_SITES:= http://elinks.or.cz/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ELINKS,elinks,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= $(shell echo ac_cv_file_./features.conf | tr [:blank:]-/. _)=yes
+CONFIGURE_ENV+= $(shell echo ac_cv_file_${WRKBUILD}/features.conf | tr [:blank:]-/. _)=yes
+CONFIGURE_ARGS+= --enable-small \
+ --enable-256-colors \
+ --with-openssl='${STAGING_DIR}/usr' \
+ --disable-backtrace \
+ --disable-data \
+ --disable-formhist \
+ --disable-leds \
+ --disable-mailcap \
+ --disable-mouse \
+ --disable-smb \
+ --disable-uri-rewrite \
+ --disable-xbel \
+ --without-bzlib \
+ --without-gpm \
+ --without-idn \
+ --without-gnutls \
+ --without-libiconv \
+ --without-lua \
+ --without-spidermonkey \
+ --without-x \
+ --without-zlib
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC='${TARGET_CC}' LD='${TARGET_CROSS}ld'
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_ELINKS}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/src/elinks ${IDIR_ELINKS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/elinks/ipkg/elinks.control b/package/elinks/ipkg/elinks.control
new file mode 100644
index 000000000..bbcb216bc
--- /dev/null
+++ b/package/elinks/ipkg/elinks.control
@@ -0,0 +1,5 @@
+Package: elinks
+Priority: optional
+Section: text
+Description: An advanced text web browser
+Depends: libopenssl
diff --git a/package/em28xx/Config.in b/package/em28xx/Config.in
new file mode 100644
index 000000000..da85f5211
--- /dev/null
+++ b/package/em28xx/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_KMOD_EM28XX
+ prompt "kmod-em28xx...................... EM28xx driver"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_VIDEO_DEV
+ select ADK_KPACKAGE_KMOD_VIDEO_V4L1
+ help
+ Driver for EM28xx based TV cards
+
diff --git a/package/em28xx/Makefile b/package/em28xx/Makefile
new file mode 100644
index 000000000..887bcda70
--- /dev/null
+++ b/package/em28xx/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= em28xx
+PKG_VERSION:= 20081206
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8467a1b1d495fa712c8beb617ef5f5dd
+MASTER_SITES:= http://waldemar-brodkorb.de/openadk/distfiles/
+
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+
+$(eval $(call PKG_template,KMOD_EM28XX,kmod-em28xx,${KERNEL_VERSION}+${PKG_VERSION}-${DEVICE}-${PKG_RELEASE},${ARCH},kernel (${KERNEL_VERSION}-${DEVICE}-${KERNEL_RELEASE})))
+
+CONFIGURE_STYLE:= manual
+BUILD_STYLE:= manual
+
+EM28XX_MAKEOPTS= -C ${WRKBUILD} \
+ ARCH="${ARCH}" \
+ CROSS_COMPILE="${TARGET_CROSS}" \
+ TARGET="${HAL_TARGET}" \
+ TOOLPREFIX="${KERNEL_CROSS}" \
+ TOOLPATH="${KERNEL_CROSS}" \
+ KERNELPATH="${LINUX_DIR}" \
+ V=1
+
+
+do-build:
+ ${MAKE} ${EM28XX_MAKEOPTS} all
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_KMOD_EM28XX}/etc/modules.d/
+ ${INSTALL_DIR} ${IDIR_KMOD_EM28XX}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/*.ko \
+ ${IDIR_KMOD_EM28XX}/lib/modules/${KERNEL_VERSION}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/em28xx/ipkg/kmod-em28xx.control b/package/em28xx/ipkg/kmod-em28xx.control
new file mode 100644
index 000000000..6d525bf8b
--- /dev/null
+++ b/package/em28xx/ipkg/kmod-em28xx.control
@@ -0,0 +1,4 @@
+Package: kmod-em28xx
+Priority: optional
+Section: net
+Description: Driver for EM28xx based TV video cards
diff --git a/package/esound/Config.in b/package/esound/Config.in
new file mode 100644
index 000000000..42f9f77e4
--- /dev/null
+++ b/package/esound/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_ESOUND
+ prompt "esound............................ Enlightened Sound Daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBAUDIOFILE
+ help
+ Sound daemon can be used to play music via the network. For example
+ with Amarok. You need to connect a sound card to your embedded device.
+
+ http://www.tux.org/~ricdude/download.html
diff --git a/package/esound/Makefile b/package/esound/Makefile
new file mode 100644
index 000000000..f97d58be0
--- /dev/null
+++ b/package/esound/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= esound
+PKG_VERSION:= 0.2.38
+PKG_RELEASE:= 5
+PKG_MD5SUM:= 77c4e9805a017fba06552487df3c6662
+MASTER_SITES:= ftp://ftp.gnome.org/pub/gnome/sources/esound/0.2/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ESOUND,esound,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ESOUND}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_ESOUND}/usr/bin
+ ${INSTALL_DIR} ${IDIR_ESOUND}/usr/lib
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/esd ${IDIR_ESOUND}/usr/bin/
+ $(CP) $(WRKINST)/usr/lib/libesd.so.* $(IDIR_ESOUND)/usr/lib/
+ $(INSTALL_DATA) ./files/esd.init $(IDIR_ESOUND)/etc/init.d/esd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/esound/files/esd.init b/package/esound/files/esd.init
new file mode 100644
index 000000000..b6acdb5f3
--- /dev/null
+++ b/package/esound/files/esd.init
@@ -0,0 +1,24 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostart)
+ test x"${esd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ esd -d /dev/sound/dsp -public -tcp -nobeeps
+ ;;
+stop)
+ killall esd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit 0
diff --git a/package/esound/ipkg/esound.control b/package/esound/ipkg/esound.control
new file mode 100644
index 000000000..aa1a8f34d
--- /dev/null
+++ b/package/esound/ipkg/esound.control
@@ -0,0 +1,6 @@
+Package: esound
+Version: 0.2.8
+Section: net
+Priority: optional
+Depends: libaudiofile
+Description: Enlightened Sound Daemon
diff --git a/package/esound/ipkg/esound.postinst b/package/esound/ipkg/esound.postinst
new file mode 100644
index 000000000..866b0f83e
--- /dev/null
+++ b/package/esound/ipkg/esound.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf esd
diff --git a/package/esound/patches/patch-esd_c b/package/esound/patches/patch-esd_c
new file mode 100644
index 000000000..ebec477a1
--- /dev/null
+++ b/package/esound/patches/patch-esd_c
@@ -0,0 +1,23 @@
+$Id$
+
+ cast to double, to avoid sinf, patch from Sven Gugges
+
+--- esound-0.2.38.orig/esd.c 2007-05-03 22:28:35.000000000 +0200
++++ esound-0.2.38/esd.c 2007-05-19 17:21:23.000000000 +0200
+@@ -131,14 +131,14 @@ void set_audio_buffer( void *buf, esd_fo
+ {
+ case ESD_BITS8:
+ for ( i = 0 ; i < length ; i+=2 ) {
+- sample = sin( (float)(i+offset) * kf );
++ sample = sin( (double)(i+offset) * kf );
+ uc_buf[i] = 127 + magl * sample;
+ uc_buf[i+1] = 127 + magr * sample;
+ }
+ break;
+ case ESD_BITS16: /* assume same endianness */
+ for ( i = 0 ; i < length ; i+=2 ) {
+- sample = sin( (float)(i+offset) * kf );
++ sample = sin( (double)(i+offset) * kf );
+ ss_buf[i] = magl * sample;
+ ss_buf[i+1] = magr * sample;
+ }
diff --git a/package/ether-wake/Config.in b/package/ether-wake/Config.in
new file mode 100644
index 000000000..5ed105a55
--- /dev/null
+++ b/package/ether-wake/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_ETHER_WAKE
+ prompt "ether-wake........................ A Wake-On-LAN (WOL) client"
+ tristate
+ default n
+ help
+ A Wake-On-LAN (WOL) client,
+ This program sends a magic packet to wake up sleeping networked machines.
+
+ http://www.scyld.com/wakeonlan.html
diff --git a/package/ether-wake/Makefile b/package/ether-wake/Makefile
new file mode 100644
index 000000000..2eb244dc6
--- /dev/null
+++ b/package/ether-wake/Makefile
@@ -0,0 +1,24 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ether-wake
+PKG_VERSION:= 1.09
+PKG_RELEASE:= 1
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ETHER_WAKE,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${TARGET_CFLAGS} -o ${WRKBUILD}/${PKG_NAME} ${WRKBUILD}/${PKG_NAME}.c
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_ETHER_WAKE}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_ETHER_WAKE}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ether-wake/extra/ether-wake.c b/package/ether-wake/extra/ether-wake.c
new file mode 100644
index 000000000..4bee57f90
--- /dev/null
+++ b/package/ether-wake/extra/ether-wake.c
@@ -0,0 +1,386 @@
+/* ether-wake.c: Send a magic packet to wake up sleeping machines. */
+
+static char version_msg[] =
+"ether-wake.c: v1.09 11/12/2003 Donald Becker, http://www.scyld.com/";
+static char brief_usage_msg[] =
+"usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n"
+" Use '-u' to see the complete set of options.\n";
+static char usage_msg[] =
+"usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n"
+"\n"
+" This program generates and transmits a Wake-On-LAN (WOL)\n"
+" \"Magic Packet\", used for restarting machines that have been\n"
+" soft-powered-down (ACPI D3-warm state).\n"
+" It currently generates the standard AMD Magic Packet format, with\n"
+" an optional password appended.\n"
+"\n"
+" The single required parameter is the Ethernet MAC (station) address\n"
+" of the machine to wake.\n"
+" The MAC address may be found with the 'arp' program while the target\n"
+" machine is awake.\n"
+"\n"
+" Options:\n"
+" -b Send wake-up packet to the broadcast address.\n"
+" -D Increase the debug level.\n"
+" -i ifname Use interface IFNAME instead of the default 'eth0'.\n"
+" -p <pw> Append the four or six byte password PW to the packet.\n"
+" A password is only required for a few adapter types.\n"
+" The password may be specified in ethernet hex format\n"
+" or dotted decimal (Internet address)\n"
+" -p 00:22:44:66:88:aa\n"
+" -p 192.168.1.1\n";
+
+/*
+ This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet",
+ used for restarting machines that have been soft-powered-down
+ (ACPI D3-warm state). It currently generates the standard AMD Magic Packet
+ format, with an optional password appended.
+
+ This software may be used and distributed according to the terms
+ of the GNU Public License, incorporated herein by reference.
+ Contact the author for use under other terms.
+
+ This source file was originally part of the network tricks package, and
+ is now distributed to support the Scyld Beowulf system.
+ Copyright 1999-2003 Donald Becker and Scyld Computing Corporation.
+
+ The author may be reached as becker@scyld, or C/O
+ Scyld Computing Corporation
+ 914 Bay Ridge Road, Suite 220
+ Annapolis MD 21403
+
+ Notes:
+ On some systems dropping root capability allows the process to be
+ dumped, traced or debugged.
+ If someone traces this program, they get control of a raw socket.
+ Linux handles this safely, but beware when porting this program.
+
+ An alternative to needing 'root' is using a UDP broadcast socket, however
+ doing so only works with adapters configured for unicast+broadcast Rx
+ filter. That configuration consumes more power.
+*/
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <string.h>
+
+#if 0 /* Only exists on some versions. */
+#include <ioctls.h>
+#endif
+
+#include <sys/socket.h>
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <linux/if.h>
+
+#include <features.h>
+#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+#include <netpacket/packet.h>
+#include <net/ethernet.h>
+#else
+#include <asm/types.h>
+#include <linux/if_packet.h>
+#include <linux/if_ether.h>
+#endif
+#include <netdb.h>
+#include <netinet/ether.h>
+
+/* Grrr, no consistency between include versions.
+ Enable this if setsockopt() isn't declared with your library. */
+#if 0
+extern int setsockopt __P ((int __fd, int __level, int __optname,
+ __ptr_t __optval, int __optlen));
+#else /* New, correct head files. */
+#include <sys/socket.h>
+#endif
+
+u_char outpack[1000];
+int outpack_sz = 0;
+int debug = 0;
+u_char wol_passwd[6];
+int wol_passwd_sz = 0;
+
+static int opt_no_src_addr = 0, opt_broadcast = 0;
+
+static int get_dest_addr(const char *arg, struct ether_addr *eaddr);
+static int get_fill(unsigned char *pkt, struct ether_addr *eaddr);
+static int get_wol_pw(const char *optarg);
+
+int main(int argc, char *argv[])
+{
+ char *ifname = "eth0";
+ int one = 1; /* True, for socket options. */
+ int s; /* Raw socket */
+ int errflag = 0, verbose = 0, do_version = 0;
+ int perm_failure = 0;
+ int i, c, pktsize;
+#if defined(PF_PACKET)
+ struct sockaddr_ll whereto;
+#else
+ struct sockaddr whereto; /* who to wake up */
+#endif
+ struct ether_addr eaddr;
+
+ while ((c = getopt(argc, argv, "bDi:p:uvV")) != -1)
+ switch (c) {
+ case 'b': opt_broadcast++; break;
+ case 'D': debug++; break;
+ case 'i': ifname = optarg; break;
+ case 'p': get_wol_pw(optarg); break;
+ case 'u': printf(usage_msg); return 0;
+ case 'v': verbose++; break;
+ case 'V': do_version++; break;
+ case '?':
+ errflag++;
+ }
+ if (verbose || do_version)
+ printf("%s\n", version_msg);
+ if (errflag) {
+ fprintf(stderr, brief_usage_msg);
+ return 3;
+ }
+
+ if (optind == argc) {
+ fprintf(stderr, "Specify the Ethernet address as 00:11:22:33:44:55.\n");
+ return 3;
+ }
+
+ /* Note: PF_INET, SOCK_DGRAM, IPPROTO_UDP would allow SIOCGIFHWADDR to
+ work as non-root, but we need SOCK_PACKET to specify the Ethernet
+ destination address. */
+#if defined(PF_PACKET)
+ s = socket(PF_PACKET, SOCK_RAW, 0);
+#else
+ s = socket(AF_INET, SOCK_PACKET, SOCK_PACKET);
+#endif
+ if (s < 0) {
+ if (errno == EPERM)
+ fprintf(stderr, "ether-wake: This program must be run as root.\n");
+ else
+ perror("ether-wake: socket");
+ perm_failure++;
+ }
+ /* Don't revert if debugging allows a normal user to get the raw socket. */
+ setuid(getuid());
+
+ /* We look up the station address before reporting failure so that
+ errors may be reported even when run as a normal user.
+ */
+ if (get_dest_addr(argv[optind], &eaddr) != 0)
+ return 3;
+ if (perm_failure && ! debug)
+ return 2;
+
+ pktsize = get_fill(outpack, &eaddr);
+
+ /* Fill in the source address, if possible.
+ The code to retrieve the local station address is Linux specific. */
+ if (! opt_no_src_addr) {
+ struct ifreq if_hwaddr;
+ unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data;
+
+ strcpy(if_hwaddr.ifr_name, ifname);
+ if (ioctl(s, SIOCGIFHWADDR, &if_hwaddr) < 0) {
+ fprintf(stderr, "SIOCGIFHWADDR on %s failed: %s\n", ifname,
+ strerror(errno));
+ /* Magic packets still work if our source address is bogus, but
+ we fail just to be anal. */
+ return 1;
+ }
+ memcpy(outpack+6, if_hwaddr.ifr_hwaddr.sa_data, 6);
+
+ if (verbose) {
+ printf("The hardware address (SIOCGIFHWADDR) of %s is type %d "
+ "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x.\n", ifname,
+ if_hwaddr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1],
+ hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
+ }
+ }
+
+ if (wol_passwd_sz > 0) {
+ memcpy(outpack+pktsize, wol_passwd, wol_passwd_sz);
+ pktsize += wol_passwd_sz;
+ }
+
+ if (verbose > 1) {
+ printf("The final packet is: ");
+ for (i = 0; i < pktsize; i++)
+ printf(" %2.2x", outpack[i]);
+ printf(".\n");
+ }
+
+ /* This is necessary for broadcasts to work */
+ if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *)&one, sizeof(one)) < 0)
+ perror("setsockopt: SO_BROADCAST");
+
+#if defined(PF_PACKET)
+ {
+ struct ifreq ifr;
+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+ if (ioctl(s, SIOCGIFINDEX, &ifr) == -1) {
+ fprintf(stderr, "SIOCGIFINDEX on %s failed: %s\n", ifname,
+ strerror(errno));
+ return 1;
+ }
+ memset(&whereto, 0, sizeof(whereto));
+ whereto.sll_family = AF_PACKET;
+ whereto.sll_ifindex = ifr.ifr_ifindex;
+ /* The manual page incorrectly claims the address must be filled.
+ We do so because the code may change to match the docs. */
+ whereto.sll_halen = ETH_ALEN;
+ memcpy(whereto.sll_addr, outpack, ETH_ALEN);
+
+ }
+#else
+ whereto.sa_family = 0;
+ strcpy(whereto.sa_data, ifname);
+#endif
+
+ if ((i = sendto(s, outpack, pktsize, 0, (struct sockaddr *)&whereto,
+ sizeof(whereto))) < 0)
+ perror("sendto");
+ else if (debug)
+ printf("Sendto worked ! %d.\n", i);
+
+#ifdef USE_SEND
+ if (bind(s, (struct sockaddr *)&whereto, sizeof(whereto)) < 0)
+ perror("bind");
+ else if (send(s, outpack, 100, 0) < 0)
+ perror("send");
+#endif
+#ifdef USE_SENDMSG
+ {
+ struct msghdr msghdr = { 0,};
+ struct iovec iovector[1];
+ msghdr.msg_name = &whereto;
+ msghdr.msg_namelen = sizeof(whereto);
+ msghdr.msg_iov = iovector;
+ msghdr.msg_iovlen = 1;
+ iovector[0].iov_base = outpack;
+ iovector[0].iov_len = pktsize;
+ if ((i = sendmsg(s, &msghdr, 0)) < 0)
+ perror("sendmsg");
+ else if (debug)
+ printf("sendmsg worked, %d (%d).\n", i, errno);
+ }
+#endif
+
+ return 0;
+}
+
+/* Convert the host ID string to a MAC address.
+ The string may be a
+ Host name
+ IP address string
+ MAC address string
+*/
+
+static int get_dest_addr(const char *hostid, struct ether_addr *eaddr)
+{
+ struct ether_addr *eap;
+
+ eap = ether_aton(hostid);
+ if (eap) {
+ *eaddr = *eap;
+ if (debug)
+ fprintf(stderr, "The target station address is %s.\n",
+ ether_ntoa(eaddr));
+ } else {
+ (void)fprintf(stderr,
+ "ether-wake: The Magic Packet host address must be "
+ "specified as a station address, 00:11:22:33:44:55.\n");
+ return -1;
+ }
+ return 0;
+}
+
+
+static int get_fill(unsigned char *pkt, struct ether_addr *eaddr)
+{
+ int offset, i;
+ unsigned char *station_addr = eaddr->ether_addr_octet;
+
+ if (opt_broadcast)
+ memset(pkt+0, 0xff, 6);
+ else
+ memcpy(pkt, station_addr, 6);
+ memcpy(pkt+6, station_addr, 6);
+ pkt[12] = 0x08; /* Or 0x0806 for ARP, 0x8035 for RARP */
+ pkt[13] = 0x42;
+ offset = 14;
+
+ memset(pkt+offset, 0xff, 6);
+ offset += 6;
+
+ for (i = 0; i < 16; i++) {
+ memcpy(pkt+offset, station_addr, 6);
+ offset += 6;
+ }
+ if (debug) {
+ fprintf(stderr, "Packet is ");
+ for (i = 0; i < offset; i++)
+ fprintf(stderr, " %2.2x", pkt[i]);
+ fprintf(stderr, ".\n");
+ }
+ return offset;
+}
+
+static int get_wol_pw(const char *optarg)
+{
+ int passwd[6];
+ int byte_cnt;
+ int i;
+
+ byte_cnt = sscanf(optarg, "%2x:%2x:%2x:%2x:%2x:%2x",
+ &passwd[0], &passwd[1], &passwd[2],
+ &passwd[3], &passwd[4], &passwd[5]);
+ if (byte_cnt < 4)
+ byte_cnt = sscanf(optarg, "%d.%d.%d.%d",
+ &passwd[0], &passwd[1], &passwd[2], &passwd[3]);
+ if (byte_cnt < 4) {
+ fprintf(stderr, "Unable to read the Wake-On-LAN password.\n");
+ return 0;
+ }
+ printf(" The Magic packet password is %2.2x %2.2x %2.2x %2.2x (%d).\n",
+ passwd[0], passwd[1], passwd[2], passwd[3], byte_cnt);
+ for (i = 0; i < byte_cnt; i++)
+ wol_passwd[i] = passwd[i];
+ return wol_passwd_sz = byte_cnt;
+}
+
+#if 0
+{
+ to = (struct sockaddr_in *)&whereto;
+ to->sin_family = AF_INET;
+ if (inet_aton(target, &to->sin_addr)) {
+ hostname = target;
+ }
+ memset (&sa, 0, sizeof sa);
+ sa.sa_family = AF_INET;
+ strncpy (sa.sa_data, interface, sizeof sa.sa_data);
+ sendto (sock, buf, bufix + len, 0, &sa, sizeof sa);
+ strncpy (sa.sa_data, interface, sizeof sa.sa_data);
+#if 1
+ sendto (sock, buf, bufix + len, 0, &sa, sizeof sa);
+#else
+ bind (sock, &sa, sizeof sa);
+ connect();
+ send (sock, buf, bufix + len, 0);
+#endif
+}
+#endif
+
+
+/*
+ * Local variables:
+ * compile-command: "gcc -O -Wall -o ether-wake ether-wake.c"
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * c-indent-level: 4
+ * tab-width: 4
+ * End:
+ */
diff --git a/package/ether-wake/ipkg/ether-wake.control b/package/ether-wake/ipkg/ether-wake.control
new file mode 100644
index 000000000..2c736f150
--- /dev/null
+++ b/package/ether-wake/ipkg/ether-wake.control
@@ -0,0 +1,5 @@
+Package: ether-wake
+Priority: optional
+Section: net
+Description: A Wake-On-LAN (WOL) client,
+ send a magic packet to wake up sleeping networked machines.
diff --git a/package/ethtool/Config.in b/package/ethtool/Config.in
new file mode 100644
index 000000000..8ba4b4c59
--- /dev/null
+++ b/package/ethtool/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_ETHTOOL
+ prompt "ethtool........................... Display or change ethernet card settings"
+ tristate
+ default n
+ help
+ ethtool is used for querying settings of an ethernet device and changing them
+
+ http://sourceforge.net/projects/gkernel/
diff --git a/package/ethtool/Makefile b/package/ethtool/Makefile
new file mode 100644
index 000000000..6e809f20a
--- /dev/null
+++ b/package/ethtool/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ethtool
+PKG_VERSION:= 5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 5df7f165974e096e2de890e099f87a12
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=gkernel/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ETHTOOL,ethtool,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ETHTOOL}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/* ${IDIR_ETHTOOL}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ethtool/ipkg/ethtool.control b/package/ethtool/ipkg/ethtool.control
new file mode 100644
index 000000000..2cc3f065c
--- /dev/null
+++ b/package/ethtool/ipkg/ethtool.control
@@ -0,0 +1,4 @@
+Package: ethtool
+Priority: optional
+Section: net
+Description: Display or change ethernet card settings
diff --git a/package/evieext/Config.in b/package/evieext/Config.in
new file mode 100644
index 000000000..88d73d6b3
--- /dev/null
+++ b/package/evieext/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XPROTO
+ prompt "xproto................................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/evieext/Makefile b/package/evieext/Makefile
new file mode 100644
index 000000000..41b38cad3
--- /dev/null
+++ b/package/evieext/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= evieext
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cff7b68b228d255f582cb64879619a44
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/exmap/Config.in b/package/exmap/Config.in
new file mode 100644
index 000000000..18bd98582
--- /dev/null
+++ b/package/exmap/Config.in
@@ -0,0 +1,41 @@
+config ADK_COMPILE_EXMAP
+ tristate
+ default n
+
+config ADK_PACKAGE_EXMAP
+ prompt "exmap............................. exmap-console utility"
+ tristate
+ select ADK_COMPILE_EXMAP
+ select ADK_PACKAGE_GLIB2
+ select ADK_PACKAGE_LIBREADLINE
+ select ADK_PACKAGE_KMOD_EXMAP
+ default n
+ help
+ http://labs.o-hand.com/exmap-console/
+
+config ADK_PACKAGE_EXMAPD
+ prompt "exmapd............................ exmap daemon"
+ tristate
+ select ADK_COMPILE_EXMAP
+ select ADK_PACKAGE_GLIB2
+ select ADK_PACKAGE_LIBREADLINE
+ select ADK_PACKAGE_KMOD_EXMAP
+ default n
+ help
+ http://labs.o-hand.com/exmap-console/
+
+config ADK_PACKAGE_EXMAPSERVER
+ prompt "exmapserver....................... exmap server"
+ tristate
+ select ADK_COMPILE_EXMAP
+ select ADK_PACKAGE_GLIB2
+ select ADK_PACKAGE_LIBREADLINE
+ select ADK_PACKAGE_KMOD_EXMAP
+ default n
+ help
+ http://labs.o-hand.com/exmap-console/
+
+config ADK_PACKAGE_KMOD_EXMAP
+ tristate
+ default n
+ help
diff --git a/package/exmap/Makefile b/package/exmap/Makefile
new file mode 100644
index 000000000..78f0cf13e
--- /dev/null
+++ b/package/exmap/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= exmap
+PKG_VERSION:= 0.4.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 55aec784e214037e61400287a55b5426
+
+DISTFILES:= ${PKG_NAME}-console-${PKG_VERSION}.tgz
+MASTER_SITES:= http://labs.o-hand.com/sources/exmap-console/
+WRKDIST= ${WRKDIR}/${PKG_NAME}-console-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,EXMAP,exmap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,EXMAPD,exmapd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,EXMAPSERVER,exmapserver,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,KMOD_EXMAP,kmod-exmap,${KERNEL_VERSION}+${PKG_VERSION}-${DEVICE}-${PKG_RELEASE},${ARCH},kernel (${KERNEL_VERSION}-${DEVICE}-${KERNEL_RELEASE})))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --disable-doc
+CONFIGURE_ENV+= LIBS="-lncurses"
+BUILD_STYLE:= auto
+
+pre-build:
+ KERNEL_PATH=${LINUX_DIR} \
+ CROSS_COMPILE="${TARGET_CROSS}" \
+ V=1 ARCH="${ARCH}" KERNELVERSION="2.6" \
+ LDFLAGS="" \
+ $(MAKE) -C ${WRKBUILD}/kernel
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_KMOD_EXMAP}/etc/modules.d/
+ echo "exmap" > ${IDIR_KMOD_EXMAP}/etc/modules.d/90-exmap
+ ${INSTALL_DIR} ${IDIR_KMOD_EXMAP}/lib/modules/${KERNEL_VERSION}/
+ ${INSTALL_DATA} ${WRKBUILD}/kernel/exmap.ko \
+ ${IDIR_KMOD_EXMAP}/lib/modules/${KERNEL_VERSION}
+ ${INSTALL_DIR} ${IDIR_EXMAP}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/src/exmap ${IDIR_EXMAP}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_EXMAPD}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/src/exmapd ${IDIR_EXMAPD}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_EXMAPSERVER}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/src/exmapserver ${IDIR_EXMAPSERVER}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/exmap/ipkg/exmap.control b/package/exmap/ipkg/exmap.control
new file mode 100644
index 000000000..23c51313a
--- /dev/null
+++ b/package/exmap/ipkg/exmap.control
@@ -0,0 +1,4 @@
+Package: exmap
+Priority: optional
+Section: utils
+Description: memory analysing tool
diff --git a/package/exmap/ipkg/exmapd.control b/package/exmap/ipkg/exmapd.control
new file mode 100644
index 000000000..dbfe932a8
--- /dev/null
+++ b/package/exmap/ipkg/exmapd.control
@@ -0,0 +1,4 @@
+Package: exmapd
+Priority: optional
+Section: utils
+Description: memory analysing tool
diff --git a/package/exmap/ipkg/exmapserver.control b/package/exmap/ipkg/exmapserver.control
new file mode 100644
index 000000000..8d33fb53a
--- /dev/null
+++ b/package/exmap/ipkg/exmapserver.control
@@ -0,0 +1,4 @@
+Package: exmapserver
+Priority: optional
+Section: utils
+Description: memory analysing tool
diff --git a/package/exmap/ipkg/kmod-exmap.control b/package/exmap/ipkg/kmod-exmap.control
new file mode 100644
index 000000000..afae49276
--- /dev/null
+++ b/package/exmap/ipkg/kmod-exmap.control
@@ -0,0 +1,4 @@
+Package: kmod-exmap
+Priority: optional
+Section: utils
+Description: kernel module for a memory analysing tool
diff --git a/package/exmap/patches/patch-Makefile_in b/package/exmap/patches/patch-Makefile_in
new file mode 100644
index 000000000..cb3281aff
--- /dev/null
+++ b/package/exmap/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/Makefile.in 2007-02-26 12:44:02.000000000 +0100
++++ exmap-console-0.4.1/Makefile.in 2009-04-18 16:16:03.926793719 +0200
+@@ -155,7 +155,7 @@ sbindir = @sbindir@
+ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+-SUBDIRS = kernel src doc
++SUBDIRS = src
+ DISTCLEANFILES = *~ Makefile.in install-sh missing depcomp *.m4 config.log config.status Makefile
+ all: all-recursive
+
diff --git a/package/exmap/patches/patch-kernel_exmap_c b/package/exmap/patches/patch-kernel_exmap_c
new file mode 100644
index 000000000..8278e6510
--- /dev/null
+++ b/package/exmap/patches/patch-kernel_exmap_c
@@ -0,0 +1,31 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/kernel/exmap.c 2006-10-24 20:45:11.000000000 +0200
++++ exmap-console-0.4.1/kernel/exmap.c 2008-12-14 13:34:01.000000000 +0100
+@@ -392,7 +392,11 @@ int setup_from_pid(pid_t pid)
+ struct task_struct *tsk;
+ int errcode = -EINVAL;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++ tsk = find_task_by_vpid(pid);
++#else
+ tsk = find_task_by_pid(pid);
++#endif
+ if (tsk == NULL) {
+ printk (KERN_ALERT
+ "/proc/%s: can't find task for pid %d\n",
+@@ -507,7 +511,7 @@ int init_module ()
+ NULL);
+
+ if (exmap_proc_file == NULL) {
+- remove_proc_entry (PROCFS_NAME, &proc_root);
++ remove_proc_entry (PROCFS_NAME, NULL);
+ printk (KERN_ALERT "/proc/%s: could not initialize\n",
+ PROCFS_NAME);
+ return -ENOMEM;
+@@ -532,5 +536,5 @@ int init_module ()
+ void cleanup_module ()
+ {
+ printk (KERN_INFO "/proc/%s: remove\n", PROCFS_NAME);
+- remove_proc_entry (PROCFS_NAME, &proc_root);
++ remove_proc_entry (PROCFS_NAME, NULL);
+ }
diff --git a/package/exmap/patches/patch-src_exmapd_c b/package/exmap/patches/patch-src_exmapd_c
new file mode 100644
index 000000000..68921e5f4
--- /dev/null
+++ b/package/exmap/patches/patch-src_exmapd_c
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/src/exmapd.c 2006-12-11 08:50:23.000000000 +0100
++++ exmap-console-0.4.1/src/exmapd.c 2008-12-14 15:53:02.000000000 +0100
+@@ -257,6 +257,7 @@ main (int argc, char ** argv)
+ }
+
+ /* make sure that the exmap module is loaded */
++ /*
+ if (g_spawn_sync (NULL, (char**)&modp_args, NULL, G_SPAWN_SEARCH_PATH,
+ NULL, NULL, NULL, NULL, &modp_status, &error))
+ {
+@@ -268,7 +269,7 @@ main (int argc, char ** argv)
+ {
+ g_error ("Could not spawn modprobe: %s", error ? error->message : "");
+ }
+-
++ */
+ /* Initialise data for the timeout callback
+ *
+ * 4 == 3 + 1: 3 for the exec name + 2 params we feed exmap
diff --git a/package/exmap/patches/patch-src_exmapserver_c b/package/exmap/patches/patch-src_exmapserver_c
new file mode 100644
index 000000000..721ec2fa3
--- /dev/null
+++ b/package/exmap/patches/patch-src_exmapserver_c
@@ -0,0 +1,22 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- exmap-console-0.4.1.orig/src/exmapserver.c 2007-02-26 12:00:48.000000000 +0100
++++ exmap-console-0.4.1/src/exmapserver.c 2008-12-14 15:52:07.000000000 +0100
+@@ -532,9 +532,9 @@ main (int argc, char ** argv)
+ }
+ }
+
++ /* do not try to modprobe
+ if (getuid() == 0)
+ {
+- /* if running a root, we can make sure that the exmap module is loaded */
+ if (g_spawn_sync (NULL, (char**)&modp_args, NULL, G_SPAWN_SEARCH_PATH,
+ NULL, NULL, NULL, NULL, &modp_status, &error))
+ {
+@@ -548,6 +548,7 @@ main (int argc, char ** argv)
+ error ? error->message : "");
+ }
+ }
++ */
+
+ /* handle SIGPIPE */
+ struct sigaction sa;
diff --git a/package/expat/Config.in b/package/expat/Config.in
new file mode 100644
index 000000000..861777a94
--- /dev/null
+++ b/package/expat/Config.in
@@ -0,0 +1,14 @@
+config ADK_COMPILE_EXPAT
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBEXPAT
+
+config ADK_PACKAGE_LIBEXPAT
+ prompt "libexpat.......................... A fast, non-validating, stream-oriented XML parsing library"
+ tristate
+ default n
+ select ADK_COMPILE_EXPAT
+ help
+ A fast, non-validating, stream-oriented XML parsing library
+
+ http://expat.sourceforge.net/
diff --git a/package/expat/Makefile b/package/expat/Makefile
new file mode 100644
index 000000000..bebaaa6f2
--- /dev/null
+++ b/package/expat/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= expat
+PKG_VERSION:= 1.95.8
+PKG_RELEASE:= 1
+PKG_MD5SUM:= aff487543845a82fe262e6e2922b4c8e
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=expat/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBEXPAT,libexpat,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBEXPAT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libexpat.so.* ${IDIR_LIBEXPAT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/expat/ipkg/libexpat.control b/package/expat/ipkg/libexpat.control
new file mode 100644
index 000000000..9fe78fa63
--- /dev/null
+++ b/package/expat/ipkg/libexpat.control
@@ -0,0 +1,4 @@
+Package: libexpat
+Priority: optional
+Section: net
+Description: a fast, non-validating, stream-oriented XML parsing library
diff --git a/package/expat/patches/001-destdir.patch b/package/expat/patches/001-destdir.patch
new file mode 100644
index 000000000..0116f97f2
--- /dev/null
+++ b/package/expat/patches/001-destdir.patch
@@ -0,0 +1,44 @@
+diff -ruN expat-1.95.8-orig/Makefile.in expat-1.95.8-1/Makefile.in
+--- expat-1.95.8.orig/Makefile.in 2004-05-07 22:00:48.000000000 +0200
++++ expat-1.95.8/Makefile.in 2009-05-09 13:40:57.000000000 +0200
+@@ -34,6 +34,8 @@ man1dir = @mandir@/man1
+
+ top_builddir = .
+
++DESTDIR =
++
+
+ INSTALL = @INSTALL@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+@@ -73,22 +75,22 @@ check: tests/runtests
+ tests/runtests
+
+ install: xmlwf/xmlwf installlib
+- $(mkinstalldirs) $(bindir) $(man1dir)
+- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(bindir)/xmlwf
+- $(INSTALL_DATA) $(MANFILE) $(man1dir)
++ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
++ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf
++ $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir)
+
+ installlib: $(LIBRARY) $(APIHEADER)
+- $(mkinstalldirs) $(libdir) $(includedir)
+- $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY)
+- $(INSTALL_DATA) $(APIHEADER) $(includedir)
++ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
++ $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY)
++ $(INSTALL_DATA) $(APIHEADER) $(DESTDIR)$(includedir)
+
+ uninstall: uninstalllib
+- $(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf
++ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf
+ rm -f $(man1dir)/xmlwf.1
+
+ uninstalllib:
+- $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY)
+- rm -f $(includedir)/$(APIHEADER)
++ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY)
++ rm -f $(DESTDIR)$(includedir)/$(APIHEADER)
+
+ # for VPATH builds (invoked by configure)
+ mkdir-init:
diff --git a/package/ez-ipupdate/Config.in b/package/ez-ipupdate/Config.in
new file mode 100644
index 000000000..94ad32420
--- /dev/null
+++ b/package/ez-ipupdate/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_EZIPUPDATE
+ prompt "ez-ipupdate....................... Client for most dynamic DNS services"
+ tristate
+ default n
+ help
+ A client for many Dynamic DNS services.
+
+ http://ez-ipupdate.com/
diff --git a/package/ez-ipupdate/Makefile b/package/ez-ipupdate/Makefile
new file mode 100644
index 000000000..c7afd482a
--- /dev/null
+++ b/package/ez-ipupdate/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ez-ipupdate
+PKG_VERSION:= 3.0.11b8
+PKG_RELEASE:= 10
+PKG_MD5SUM:= 000211add4c4845ffa4211841bff4fb0
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz
+MASTER_SITES:= http://ftp.debian.org/debian/pool/main/e/ez-ipupdate/ \
+ http://ftp.de.debian.org/debian/pool/main/e/ez-ipupdate/
+
+include ${TOPDIR}/mk/package.mk
+
+${eval ${call PKG_template,EZIPUPDATE,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}}}
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_EZIPUPDATE}/etc
+ install -m0600 ./files/${PKG_NAME}.conf ${IDIR_EZIPUPDATE}/etc/
+ ${INSTALL_DIR} ${IDIR_EZIPUPDATE}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_EZIPUPDATE}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_EZIPUPDATE}/etc/init.d
+ ${INSTALL_SCRIPT} ./files/ez-ipupdate.init \
+ ${IDIR_EZIPUPDATE}/etc/init.d/ez-ipupdate
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ez-ipupdate/files/ez-ipupdate.conf b/package/ez-ipupdate/files/ez-ipupdate.conf
new file mode 100644
index 000000000..386040674
--- /dev/null
+++ b/package/ez-ipupdate/files/ez-ipupdate.conf
@@ -0,0 +1,10 @@
+service-type=zoneedit
+server=your.update.server
+user=myname:mypassword
+host=mydomain.com
+interface=ppp0
+quiet
+
+# Do not change the lines below
+cache-file=/tmp/ez-ipupdate.cache
+pid-file=/var/run/ez-ipupdate.pid
diff --git a/package/ez-ipupdate/files/ez-ipupdate.init b/package/ez-ipupdate/files/ez-ipupdate.init
new file mode 100644
index 000000000..36cfa7dd9
--- /dev/null
+++ b/package/ez-ipupdate/files/ez-ipupdate.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${ezipupdate:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/ez-ipupdate -c /etc/ez-ipupdate.conf -d
+ ;;
+stop)
+ killall ez-ipupdate
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/ez-ipupdate/ipkg/ez-ipupdate.conffiles b/package/ez-ipupdate/ipkg/ez-ipupdate.conffiles
new file mode 100644
index 000000000..3a9041e34
--- /dev/null
+++ b/package/ez-ipupdate/ipkg/ez-ipupdate.conffiles
@@ -0,0 +1 @@
+/etc/ez-ipupdate.conf
diff --git a/package/ez-ipupdate/ipkg/ez-ipupdate.control b/package/ez-ipupdate/ipkg/ez-ipupdate.control
new file mode 100644
index 000000000..1b7dff825
--- /dev/null
+++ b/package/ez-ipupdate/ipkg/ez-ipupdate.control
@@ -0,0 +1,4 @@
+Package: ez-ipupdate
+Priority: optional
+Section: net
+Description: a client for dynamic DNS services
diff --git a/package/ez-ipupdate/ipkg/ez-ipupdate.postinst b/package/ez-ipupdate/ipkg/ez-ipupdate.postinst
new file mode 100644
index 000000000..c8094c139
--- /dev/null
+++ b/package/ez-ipupdate/ipkg/ez-ipupdate.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf ezipupdate ezipupdate NO
diff --git a/package/ez-ipupdate/patches/patch-configure b/package/ez-ipupdate/patches/patch-configure
new file mode 100644
index 000000000..7227b9574
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-configure
@@ -0,0 +1,19 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/configure Thu Apr 17 17:38:52 2003
++++ ez-ipupdate-3.0.11b8/configure Tue Jul 31 12:33:09 2007
+@@ -1804,11 +1804,15 @@ echo "configure:1804: checking whether u
+ # Check whether --enable-debug or --disable-debug was given.
+ if test "${enable_debug+set}" = set; then
+ enableval="$enable_debug"
++ if test x"yes" = x"$enable_debug"; then
+ cat >> confdefs.h <<\EOF
+ #define DEBUG 1
+ EOF
+
+ echo "$ac_t""yes" 1>&6
++ else
++ echo "$ac_t""no" 1>&6
++ fi
+ else
+ echo "$ac_t""no" 1>&6
+ fi
diff --git a/package/ez-ipupdate/patches/patch-example-dhs_conf b/package/ez-ipupdate/patches/patch-example-dhs_conf
new file mode 100644
index 000000000..9e1c6b813
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-dhs_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-dhs.conf Sat Nov 18 23:01:45 2000
++++ ez-ipupdate-3.0.11b8/example-dhs.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -10,8 +10,8 @@ user=myuserid:mypassword
+ host=mydomain.whatever.com
+ interface=eth1
+
+-# if you use run-as ensure the user has permission to write this file
+-cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-dyndns_conf b/package/ez-ipupdate/patches/patch-example-dyndns_conf
new file mode 100644
index 000000000..08d4ed42b
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-dyndns_conf
@@ -0,0 +1,27 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-dyndns.conf Sat Nov 18 23:01:49 2000
++++ ez-ipupdate-3.0.11b8/example-dyndns.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -12,14 +12,9 @@ host=mydomain.whatever.com
+ interface=eth1
+ max-interval=2073600
+
+-# please create this file and ensure that the user that ez-ipupdate is running
+-# as has write permissions to it then uncomment this line, if you don't your
+-# dyndns account will probably get banned. if you run ez-ipupdate as root (bad
+-# idea, use "run-as-user") then you can just uncomment this line.
+-#cache-file=/etc/ez-ipupdate.cache.eth1
+-
+-# for the mean time we'll just use a cache file in the temp directory
+-cache-file=/tmp/ez-ipupdate.cache
++# if you don't use a cache file your dyndns account will probably get banned.
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-dyns_conf b/package/ez-ipupdate/patches/patch-example-dyns_conf
new file mode 100644
index 000000000..d2556cf51
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-dyns_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-dyns.conf Wed Nov 29 20:08:34 2000
++++ ez-ipupdate-3.0.11b8/example-dyns.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -10,8 +10,8 @@ user=myuserid:mypassword
+ host=myhost
+ #interface=eth1
+
+-# if you use run-as ensure the user has permission to write this file
+-#cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-easydns_conf b/package/ez-ipupdate/patches/patch-example-easydns_conf
new file mode 100644
index 000000000..472689f54
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-easydns_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-easydns.conf Sat Nov 18 23:00:48 2000
++++ ez-ipupdate-3.0.11b8/example-easydns.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -10,8 +10,8 @@ user=myuserid:mypassword
+ host=mydomain.whatever.com
+ interface=eth1
+
+-# if you use run-as ensure the user has permission to write this file
+-cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-gnudip_conf b/package/ez-ipupdate/patches/patch-example-gnudip_conf
new file mode 100644
index 000000000..14c6105b9
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-gnudip_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-gnudip.conf Sat Nov 18 23:02:14 2000
++++ ez-ipupdate-3.0.11b8/example-gnudip.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -14,8 +14,8 @@ max-interval=2073600
+ # any other value is ignored
+ #address=0.0.0.0
+
+-# if you use run-as ensure the user has permission to write this file
+-cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-heipv6tb_conf b/package/ez-ipupdate/patches/patch-example-heipv6tb_conf
new file mode 100644
index 000000000..7387b885f
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-heipv6tb_conf
@@ -0,0 +1,27 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-heipv6tb.conf Sat Jul 7 21:18:42 2001
++++ ez-ipupdate-3.0.11b8/example-heipv6tb.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -11,14 +11,9 @@ user=myuserid:mypassword
+ interface=eth1
+ max-interval=2073600
+
+-# please create this file and ensure that the user that ez-ipupdate is running
+-# as has write permissions to it then uncomment this line, if you don't your
+-# dyndns account will probably get banned. if you run ez-ipupdate as root (bad
+-# idea, use "run-as-user") then you can just uncomment this line.
+-#cache-file=/etc/ez-ipupdate.cache.eth1
+-
+-# for the mean time we'll just use a cache file in the temp directory
+-cache-file=/tmp/ez-ipupdate.cache
++# if you don't use a cache file your account will probably get banned.
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-justlinux_conf b/package/ez-ipupdate/patches/patch-example-justlinux_conf
new file mode 100644
index 000000000..a63fe2690
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-justlinux_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-justlinux.conf Sat Nov 18 23:02:22 2000
++++ ez-ipupdate-3.0.11b8/example-justlinux.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -10,8 +10,8 @@ user=myuserid:mypassword
+ host=mydomain.penguinpowered.com
+ interface=eth1
+
+-# if you use run-as ensure the user has permission to write this file
+-cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-ods_conf b/package/ez-ipupdate/patches/patch-example-ods_conf
new file mode 100644
index 000000000..1b9ee44d8
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-ods_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-ods.conf Sat Nov 18 23:02:24 2000
++++ ez-ipupdate-3.0.11b8/example-ods.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -10,8 +10,8 @@ user=myuserid:mypassword
+ host=mydomain.ods.org
+ interface=eth1
+
+-# if you use run-as ensure the user has permission to write this file
+-cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-pgpow_conf b/package/ez-ipupdate/patches/patch-example-pgpow_conf
new file mode 100644
index 000000000..1c2ea9f2c
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-pgpow_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-pgpow.conf Sat Nov 18 23:02:26 2000
++++ ez-ipupdate-3.0.11b8/example-pgpow.conf Tue Jul 31 12:33:09 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -10,8 +10,8 @@ user=myuserid:mypassword
+ host=mydomain.penguinpowered.com
+ interface=eth1
+
+-# if you use run-as ensure the user has permission to write this file
+-cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example-tzo_conf b/package/ez-ipupdate/patches/patch-example-tzo_conf
new file mode 100644
index 000000000..95719931f
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example-tzo_conf
@@ -0,0 +1,20 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example-tzo.conf Sat Nov 18 23:02:28 2000
++++ ez-ipupdate-3.0.11b8/example-tzo.conf Tue Jul 31 12:33:10 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
+@@ -14,8 +14,8 @@ host=mydomain.whatever.com
+ max-interval=2073600
+ interface=eth1
+
+-# if you use run-as ensure the user has permission to write this file
+-cache-file=/tmp/ez-ipupdate.cache
++run-as-user=ez-ipupd
++cache-file=/var/cache/ez-ipupdate/default-cache
+
+ # uncomment this once you have everything working how you want and you are
+ # ready to have ez-ipupdate running in the background all the time. to stop it
diff --git a/package/ez-ipupdate/patches/patch-example_conf b/package/ez-ipupdate/patches/patch-example_conf
new file mode 100644
index 000000000..c1b0055c5
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-example_conf
@@ -0,0 +1,9 @@
+$Id$
+--- ez-ipupdate-3.0.11b8.orig/example.conf Sat Jul 7 21:15:15 2001
++++ ez-ipupdate-3.0.11b8/example.conf Tue Jul 31 12:33:09 2007
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/ez-ipupdate -c
++#!/usr/sbin/ez-ipupdate -c
+ #
+ # example config file for ez-ipupdate
+ #
diff --git a/package/ez-ipupdate/patches/patch-ez-ipupdate_c b/package/ez-ipupdate/patches/patch-ez-ipupdate_c
new file mode 100644
index 000000000..15252b5a5
--- /dev/null
+++ b/package/ez-ipupdate/patches/patch-ez-ipupdate_c
@@ -0,0 +1,540 @@
+$Id$
+
+ cjb.net support by <tg@freewrt.org>
+
+--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c Mon Mar 11 23:31:25 2002
++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c Tue Jul 31 14:05:00 2007
+@@ -87,6 +87,10 @@
+ #define JUSTL_REQUEST "/bin/controlpanel/dyndns/jlc.pl"
+ #define JUSTL_VERSION "2.0"
+
++#define CJB_DEFAULT_SERVER "www.cjb.net"
++#define CJB_DEFAULT_PORT "80"
++#define CJB_REQUEST "/cgi-bin/dynip.cgi"
++
+ #define DYNS_DEFAULT_SERVER "www.dyns.cx"
+ #define DYNS_DEFAULT_PORT "80"
+ #define DYNS_REQUEST "/postscript.php"
+@@ -139,6 +143,9 @@
+ #if HAVE_SIGNAL_H
+ # include <signal.h>
+ #endif
++#if HAVE_TIME_H
++# include <time.h>
++#endif
+ #if HAVE_SYS_TIME_H
+ # include <sys/time.h>
+ #endif
+@@ -165,7 +172,7 @@
+ #endif
+
+
+-#if __linux__ || __SVR4 || __OpenBSD__ || __FreeBSD__ || __NetBSD__
++#if __GLIBC__ || __SVR4 || __OpenBSD__ || __FreeBSD__ || __NetBSD__
+ # define IF_LOOKUP 1
+ # include <sys/ioctl.h>
+ # include <net/if.h>
+@@ -325,6 +332,10 @@ int JUSTL_update_entry(void);
+ int JUSTL_check_info(void);
+ static char *JUSTL_fields_used[] = { "server", "user", "host", NULL };
+
++int CJB_update_entry(void);
++int CJB_check_info(void);
++static char *CJB_fields_used[] = { "server", "user", NULL };
++
+ int DYNS_update_entry(void);
+ int DYNS_check_info(void);
+ static char *DYNS_fields_used[] = { "server", "user", "host", NULL };
+@@ -474,6 +485,16 @@ struct service_t services[] = {
+ JUSTL_DEFAULT_PORT,
+ JUSTL_REQUEST
+ },
++ { "cjb.net",
++ { "cjb", 0, 0, },
++ NULL,
++ CJB_update_entry,
++ CJB_check_info,
++ CJB_fields_used,
++ CJB_DEFAULT_SERVER,
++ CJB_DEFAULT_PORT,
++ CJB_REQUEST
++ },
+ { "dyns",
+ { "dyns", 0, 0, },
+ NULL,
+@@ -640,7 +661,7 @@ void print_usage( void )
+ fprintf(stdout, " -q, --quiet \t\t\tbe quiet\n");
+ fprintf(stdout, " -r, --retrys <num>\t\tnumber of trys (default: 1)\n");
+ fprintf(stdout, " -R, --run-as-user <user>\tchange to <user> for running, be ware\n\t\t\t\tthat this can cause problems with handeling\n\t\t\t\tSIGHUP properly if that user can't read the\n\t\t\t\tconfig file. also it can't write it's pid file \n\t\t\t\tto a root directory\n");
+- fprintf(stdout, " -Q, --run-as-euser <user>\tchange to effective <user> for running, \n\t\t\t\tthis is NOT secure but it does solve the \n\t\t\t\tproblems with run-as-user and config files and \n\t\t\t\tpid files.\n");
++ fprintf(stdout, " -Q, --run-as-euser <user>\tchange to effective <user> for running, \n\t\t\t\tthis is NOT secure but it does solve the \n\t\t\t\tproblems with run-as-user and config files and \n\t\t\t\tpid files\n");
+ fprintf(stdout, " -s, --server <server[:port]>\tthe server to connect to\n");
+ fprintf(stdout, " -S, --service-type <server>\tthe type of service that you are using\n");
+ width = fprintf(stdout, "\t\t\t\ttry one of: ") + 4*7;
+@@ -682,7 +703,7 @@ void print_credits( void )
+
+ void print_signalhelp( void )
+ {
+- fprintf(stdout, "\nsignals are only really used when in daemon mode.\n\n");
++ fprintf(stdout, "\nsignals are only really used when in daemon mode\n\n");
+ fprintf(stdout, "signals: \n");
+ fprintf(stdout, " HUP\t\tcauses it to re-read its config file\n");
+ fprintf(stdout, " TERM\t\twake up and possibly perform an update\n");
+@@ -693,7 +714,7 @@ void print_signalhelp( void )
+ #if HAVE_SIGNAL_H
+ RETSIGTYPE sigint_handler(int sig)
+ {
+- char message[] = "interupted.\n";
++ char message[] = "interrupted\n";
+ close(client_sockfd);
+ write(2, message, sizeof(message)-1);
+
+@@ -704,6 +725,10 @@ RETSIGTYPE sigint_handler(int sig)
+ }
+ #endif
+
++#if HAVE_SYSLOG_H
++ closelog();
++#endif
++
+ exit(1);
+ }
+ RETSIGTYPE generic_sig_handler(int sig)
+@@ -798,7 +823,7 @@ void show_message(char *fmt, ...)
+ sprintf(buf, "message incomplete because your OS sucks: %s\n", fmt);
+ #endif
+
+- syslog(LOG_NOTICE, buf);
++ syslog(LOG_NOTICE, "%s", buf);
+ }
+ else
+ {
+@@ -1439,7 +1464,7 @@ int do_connect(int *sock, char *host, ch
+ if(!(options & OPT_QUIET))
+ {
+ fprintf(stderr,
+- "connected to %s (%s) on port %d.\n",
++ "connected to %s (%s) on port %d\n",
+ host,
+ inet_ntoa(address.sin_addr),
+ ntohs(address.sin_port));
+@@ -1683,7 +1708,7 @@ static int ODS_read_response(char *buf,
+ close(client_sockfd);
+ return(-1);
+ }
+- if(strstr(buf, "\r\n") > 0)
++ if(strstr(buf, "\n") != NULL)
+ {
+ break;
+ }
+@@ -1702,8 +1727,8 @@ int NULL_check_info(void)
+
+ if(options & OPT_DAEMON)
+ {
+- fprintf(stderr, "no compile time default service was set therefor you must "
+- "specify a service type.\n");
++ fprintf(stderr, "no compile time default service was set, you must "
++ "specify a service type\n");
+
+ return(-1);
+ }
+@@ -2039,7 +2064,7 @@ int DYNDNS_update_entry(void)
+ }
+ else if(strstr(buf, "\nnumhost") != NULL)
+ {
+- show_message("Too many or too few hosts found\n");
++ show_message("too many or too few hosts found\n");
+ retval = UPDATERES_SHUTDOWN;
+ }
+ else if(strstr(buf, "\ndnserr") != NULL)
+@@ -2051,17 +2076,17 @@ int DYNDNS_update_entry(void)
+ }
+ else if(strstr(buf, "\n911") != NULL)
+ {
+- show_message("Ahhhh! call 911!\n");
++ show_message("ahhhh! call 911!\n");
+ retval = UPDATERES_SHUTDOWN;
+ }
+ else if(strstr(buf, "\n999") != NULL)
+ {
+- show_message("Ahhhh! call 999!\n");
++ show_message("ahhhh! call 999!\n");
+ retval = UPDATERES_SHUTDOWN;
+ }
+ else if(strstr(buf, "\n!donator") != NULL)
+ {
+- show_message("a feature requested is only available to donators, please donate.\n", host);
++ show_message("a feature requested is only available to donators, please donate\n", host);
+ retval = UPDATERES_OK;
+ }
+ // this one should be last as it is a stupid string to signify waits
+@@ -2095,9 +2120,9 @@ int DYNDNS_update_entry(void)
+ sprintf(reason, "problem parsing reason for wait response");
+ }
+
+- show_message("Wait response received, waiting for %s before next update.\n",
++ show_message("wait response received, waiting for %s before next update\n",
+ format_time(howlong));
+- show_message("Wait response reason: %d\n", N_STR(reason));
++ show_message("wait response reason: %d\n", N_STR(reason));
+ sleep(howlong);
+ retval = UPDATERES_ERROR;
+ }
+@@ -3370,7 +3395,7 @@ int GNUDIP_check_info(void)
+ {
+ if(!(options & OPT_QUIET))
+ {
+- fprintf(stderr, "warning: for GNUDIP the \"address\" parpameter is only used if set to \"0.0.0.0\" thus making an offline request.\n");
++ fprintf(stderr, "warning: for GNUDIP the \"address\" parameter is only used if set to \"0.0.0.0\" thus making an offline request\n");
+ }
+ }
+
+@@ -3392,7 +3417,7 @@ int GNUDIP_update_entry(void)
+
+ // send an offline request if address 0.0.0.0 is used
+ // otherwise, we ignore the address and send an update request
+- gnudip_request[0] = strcmp(address, "0.0.0.0") == 0 ? '1' : '0';
++ gnudip_request[0] = address && strcmp(address, "0.0.0.0") == 0 ? '1' : '0';
+ gnudip_request[1] = '\0';
+
+ // find domainname
+@@ -3660,6 +3685,140 @@ int JUSTL_update_entry(void)
+ return(UPDATERES_OK);
+ }
+
++int CJB_check_info(void)
++{
++ char buf[BUFSIZ+1];
++
++ if(interface == NULL && address == NULL)
++ {
++ if(options & OPT_DAEMON)
++ {
++ fprintf(stderr, "you must provide either an interface or an address\n");
++ return(-1);
++ }
++ if(interface) { free(interface); }
++ printf("interface: ");
++ *buf = '\0';
++ fgets(buf, BUFSIZ, stdin);
++ chomp(buf);
++ option_handler(CMD_interface, buf);
++ }
++
++ warn_fields(service->fields_used);
++
++ return 0;
++}
++
++int CJB_update_entry(void)
++{
++ char buf[BUFFER_SIZE+1];
++ char *bp = buf;
++ int bytes;
++ int btot;
++ int ret;
++
++ buf[BUFFER_SIZE] = '\0';
++
++ if(do_connect((int*)&client_sockfd, server, port) != 0)
++ {
++ if(!(options & OPT_QUIET))
++ {
++ show_message("error connecting to %s:%s\n", server, port);
++ }
++ return(UPDATERES_ERROR);
++ }
++
++ snprintf(buf, BUFFER_SIZE, "GET %s?", request);
++ output(buf);
++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "username", user_name);
++ output(buf);
++ snprintf(buf, BUFFER_SIZE, "%s=%s", "password", password);
++ output(buf);
++#if 0
++ /* cjb does IP address autodetection */
++ snprintf(buf, BUFFER_SIZE, "&%s=%s", "ip", address);
++ output(buf);
++#endif
++ snprintf(buf, BUFFER_SIZE, " HTTP/1.0\015\012");
++ output(buf);
++ snprintf(buf, BUFFER_SIZE, "User-Agent: %s-%s %s [%s] (%s)\015\012",
++ "ez-update", VERSION, OS, (options & OPT_DAEMON) ? "daemon" : "", "by OpenADK");
++ output(buf);
++ snprintf(buf, BUFFER_SIZE, "\015\012");
++ output(buf);
++
++ bp = buf;
++ bytes = 0;
++ btot = 0;
++ while((bytes=read_input(bp, BUFFER_SIZE-btot)) > 0)
++ {
++ bp += bytes;
++ btot += bytes;
++ dprintf((stderr, "btot: %d\n", btot));
++ }
++ close(client_sockfd);
++ buf[btot] = '\0';
++
++ dprintf((stderr, "server output: %s\n", buf));
++
++ if(sscanf(buf, " HTTP/1.%*c %3d", &ret) != 1)
++ {
++ ret = -1;
++ }
++
++ switch(ret)
++ {
++ case -1:
++ if(!(options & OPT_QUIET))
++ {
++ show_message("strange server response, are you connecting to the right server?\n");
++ }
++ return(UPDATERES_ERROR);
++ break;
++
++ case 200:
++ if(strstr(buf, " updated ") != NULL)
++ {
++ if(!(options & OPT_QUIET))
++ {
++ printf("request successful\n");
++ }
++ }
++ else
++ {
++ show_message("error processing request\n");
++ if(!(options & OPT_QUIET))
++ {
++ fprintf(stderr, "server output: %s\n", buf);
++ }
++ return(UPDATERES_ERROR);
++ }
++ break;
++
++ case 401:
++ if(!(options & OPT_QUIET))
++ {
++ show_message("authentication failure\n");
++ }
++ return(UPDATERES_SHUTDOWN);
++ break;
++
++ default:
++ if(!(options & OPT_QUIET))
++ {
++ // reuse the auth buffer
++ *auth = '\0';
++ sscanf(buf, " HTTP/1.%*c %*3d %255[^\r\n]", auth);
++ show_message("unknown return code: %d\n", ret);
++ show_message("server response: %s\n", auth);
++ }
++ return(UPDATERES_ERROR);
++ break;
++ }
++
++ return(UPDATERES_OK);
++}
++
+ int DYNS_check_info(void)
+ {
+ char buf[BUFSIZ+1];
+@@ -3943,22 +4102,22 @@ int HN_update_entry(void)
+ break;
+
+ case 201:
+- show_message("Last update was less than %d seconds ago.\n", 300);
++ show_message("last update was less than %d seconds ago\n", 300);
+ return(UPDATERES_ERROR);
+ break;
+
+ case 202:
+- show_message("Server error.\n");
++ show_message("server error\n");
+ return(UPDATERES_ERROR);
+ break;
+
+ case 203:
+- show_message("Failure because account is frozen (by admin).\n");
++ show_message("failure because account is frozen (by admin)\n");
+ return(UPDATERES_SHUTDOWN);
+ break;
+
+ case 204:
+- show_message("Failure because account is locked (by user).\n");
++ show_message("failure because account is locked (by user)\n");
+ return(UPDATERES_SHUTDOWN);
+ break;
+
+@@ -4215,8 +4374,6 @@ int HEIPV6TB_update_entry(void)
+
+ switch(ret)
+ {
+- char *p;
+-
+ case -1:
+ if(!(options & OPT_QUIET))
+ {
+@@ -4349,7 +4506,7 @@ void handle_sig(int sig)
+ case SIGHUP:
+ if(config_file)
+ {
+- show_message("SIGHUP recieved, re-reading config file\n");
++ show_message("SIGHUP received, re-reading config file\n");
+ if(parse_conf_file(config_file, conf_commands) != 0)
+ {
+ show_message("error parsing config file \"%s\"\n", config_file);
+@@ -4384,6 +4541,7 @@ void handle_sig(int sig)
+
+ int main(int argc, char **argv)
+ {
++ char *tmp;
+ int ifresolve_warned = 0;
+ int i;
+ int retval = 1;
+@@ -4395,9 +4553,10 @@ int main(int argc, char **argv)
+ mcheck(NULL);
+ #endif
+
+- dprintf((stderr, "staring...\n"));
++ dprintf((stderr, "starting...\n"));
+
+- program_name = argv[0];
++ tmp = strrchr(argv[0], '/');
++ program_name = tmp ? tmp + 1 : argv[0];
+ options = 0;
+ *user = '\0';
+ timeout.tv_sec = DEFAULT_TIMEOUT;
+@@ -4417,7 +4576,7 @@ int main(int argc, char **argv)
+
+ if(!(options & OPT_QUIET) && !(options & OPT_DAEMON))
+ {
+- fprintf(stderr, "ez-ipupdate Version %s\nCopyright (C) 1998-2001 Angus Mackay.\n", VERSION);
++ fprintf(stderr, "%s Version %s\nCopyright (C) 1998-2001 Angus Mackay\n", program_name, VERSION);
+ }
+
+ dprintf((stderr, "options: 0x%04X\n", options));
+@@ -4434,7 +4593,7 @@ int main(int argc, char **argv)
+ {
+ if(service->check_info() != 0)
+ {
+- fprintf(stderr, "invalid data to perform requested action.\n");
++ fprintf(stderr, "invalid data to perform requested action\n");
+ exit(1);
+ }
+ }
+@@ -4456,13 +4615,13 @@ int main(int argc, char **argv)
+ dprintf((stderr, "user_name: %s\n", user_name));
+ dprintf((stderr, "password: %s\n", password));
+ }
+- if(*user_name == '\0')
++ if(*user_name == '\0' && !(options & OPT_DAEMON))
+ {
+ printf("user name: ");
+ fgets(user_name, sizeof(user_name), stdin);
+ chomp(user_name);
+ }
+- if(*password == '\0')
++ if(*password == '\0' && !(options & OPT_DAEMON))
+ {
+ strncpy(password, getpass("password: "), sizeof(password));
+ }
+@@ -4480,7 +4639,7 @@ int main(int argc, char **argv)
+
+ if(service->check_info() != 0)
+ {
+- fprintf(stderr, "invalid data to perform requested action.\n");
++ fprintf(stderr, "invalid data to perform requested action\n");
+ exit(1);
+ }
+
+@@ -4503,7 +4662,7 @@ int main(int argc, char **argv)
+
+ if(interface == NULL)
+ {
+- fprintf(stderr, "invalid data to perform requested action.\n");
++ fprintf(stderr, "invalid data to perform requested action\n");
+ fprintf(stderr, "you must provide an interface for daemon mode");
+ exit(1);
+ }
+@@ -4519,23 +4678,25 @@ int main(int argc, char **argv)
+ if(fork() > 0) { exit(0); } /* parent */
+ }
+
++# if HAVE_SYSLOG_H
++ openlog(program_name, LOG_PID, LOG_DAEMON );
++ //options |= OPT_QUIET;
++# endif
++ show_message("version %s, interface %s, host %s, server %s, service %s\n",
++ VERSION, N_STR(interface), N_STR(host), server, service->title);
++
+ #if HAVE_GETPID
+ if(pid_file && pid_file_create(pid_file) != 0)
+ {
+- fprintf(stderr, "exiting...\n");
++ show_message("could not create pid file %s (%s), exiting\n",
++ pid_file, strerror(errno));
++#if HAVE_SYSLOG_H
++ closelog();
++#endif
+ exit(1);
+ }
+ #endif
+
+-# if HAVE_SYSLOG_H
+- openlog(program_name, LOG_PID, LOG_USER );
+- options |= OPT_QUIET;
+-# endif
+- show_message("ez-ipupdate Version %s, Copyright (C) 1998-2001 Angus Mackay.\n",
+- VERSION);
+- show_message("%s started for interface %s host %s using server %s and service %s\n",
+- program_name, N_STR(interface), N_STR(host), server, service->title);
+-
+ memset(&sin, 0, sizeof(sin));
+
+ if(cache_file)
+@@ -4560,7 +4721,7 @@ int main(int argc, char **argv)
+ strftime(timebuf, sizeof(timebuf), "%Y/%m/%d %H:%M", ts);
+ show_message("got last update %s on %s from cache file\n", ipstr, timebuf);
+ }
+- else
++ else if(ipstr||ipdate)
+ {
+ show_message("malformed cache file: %s\n", cache_file);
+ }
+@@ -4647,7 +4808,7 @@ int main(int argc, char **argv)
+ }
+ else
+ {
+- show_message("failure to update %s->%s (%s)\n",
++ show_message("failed to update %s->%s (%s)\n",
+ interface, inet_ntoa(sin.sin_addr), N_STR(host));
+ memset(&sin, 0, sizeof(sin));
+
+@@ -4671,7 +4832,7 @@ int main(int argc, char **argv)
+ dprintf((stderr, "updateres: %d\n", updateres));
+ if(updateres == UPDATERES_SHUTDOWN)
+ {
+- show_message("shuting down updater for %s due to fatal error\n",
++ show_message("shutting down updater for %s due to fatal error\n",
+ N_STR(host));
+
+ if(notify_email && *notify_email != '\0')
+@@ -4711,7 +4872,7 @@ int main(int argc, char **argv)
+ #endif
+
+ #else
+- fprintf(stderr, "sorry, this mode is only available on platforms that the ");
++ fprintf(stderr, "sorry, this mode is only available on platforms where the ");
+ fprintf(stderr, "IP address \ncan be determined. feel free to hack the code");
+ fprintf(stderr, " though.\n");
+ exit(1);
+@@ -4799,7 +4960,7 @@ int main(int argc, char **argv)
+ }
+ else
+ {
+- show_message("could not resolve ip address for %s.\n", interface);
++ show_message("could not resolve ip address for %s\n", interface);
+ exit(1);
+ }
+ close(sock);
diff --git a/package/faad2/Config.in b/package/faad2/Config.in
new file mode 100644
index 000000000..21d3194c3
--- /dev/null
+++ b/package/faad2/Config.in
@@ -0,0 +1,16 @@
+config ADK_COMPILE_FAAD2
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBFAAD2
+
+config ADK_PACKAGE_LIBFAAD2
+ prompt "libfaad2.......................... MP4 decoding library"
+ tristate
+ select ADK_COMPILE_FAAD2
+ default n
+ help
+ FAAD2 is the fastest ISO AAC audio decoder available.
+ FAAD2 correctly decodes all MPEG-4 and MPEG-2 MAIN,
+ LOW, LTP, LD and ER object type AAC files.
+ http://www.audiocoding.com/faad2.html
+
diff --git a/package/faad2/Makefile b/package/faad2/Makefile
new file mode 100644
index 000000000..bedaaf8e9
--- /dev/null
+++ b/package/faad2/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= faad2
+PKG_VERSION:= 2.6.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 74e92df40c270f216a8305fc87603c8a
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=faac/}
+WRKDIST= ${WRKDIR}/faad2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBFAAD2,libfaad2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= autotool gnu
+CONFIGURE_ARGS+= --without-mpeg4ip \
+ --without-xmms
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+pre-install:
+ ${INSTALL_DIR} ${WRKINST}/usr/lib
+ ${INSTALL_DIR} ${WRKINST}/usr/include
+ ${CP} ${WRKBUILD}/common/mp4ff/libmp4ff.a ${WRKINST}/usr/lib
+ ${CP} ${WRKBUILD}/common/mp4ff/mp4ff.h ${WRKINST}/usr/include
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBFAAD2}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libfaad.so.* ${IDIR_LIBFAAD2}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/faad2/ipkg/libfaad2.control b/package/faad2/ipkg/libfaad2.control
new file mode 100644
index 000000000..81fa375f0
--- /dev/null
+++ b/package/faad2/ipkg/libfaad2.control
@@ -0,0 +1,4 @@
+Package: libfaad2
+Priority: optional
+Section: libs
+Description: A mp4 decoding library
diff --git a/package/faad2/patches/patch-common_mp4ff_Makefile_am b/package/faad2/patches/patch-common_mp4ff_Makefile_am
new file mode 100644
index 000000000..3e471d6de
--- /dev/null
+++ b/package/faad2/patches/patch-common_mp4ff_Makefile_am
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- faad2.orig/common/mp4ff/Makefile.am 2006-05-07 20:09:00.000000000 +0200
++++ faad2/common/mp4ff/Makefile.am 2009-01-11 17:15:38.138931843 +0100
+@@ -1,8 +1,9 @@
+-noinst_LTLIBRARIES = libmp4ff.la
++lib_LIBRARIES = libmp4ff.a
++include_HEADERS = mp4ff.h mp4ffint.h
+
+-libmp4ff_la_CFLAGS = -DUSE_TAGGING=1
++libmp4ff_a_CFLAGS = -DUSE_TAGGING=1
+
+-libmp4ff_la_SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \
++libmp4ff_a_SOURCES = mp4ff.c mp4atom.c mp4meta.c mp4sample.c mp4util.c \
+ mp4tagupdate.c mp4ff.h mp4ffint.h mp4ff_int_types.h \
+ drms.h drms.c drmstables.h
+
diff --git a/package/faad2/patches/patch-common_mp4ff_mp4ff_h b/package/faad2/patches/patch-common_mp4ff_mp4ff_h
new file mode 100644
index 000000000..cfca4f560
--- /dev/null
+++ b/package/faad2/patches/patch-common_mp4ff_mp4ff_h
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- faad2.orig/common/mp4ff/mp4ff.h 2007-11-01 13:33:29.000000000 +0100
++++ faad2/common/mp4ff/mp4ff.h 2009-01-11 16:52:07.174753204 +0100
+@@ -35,7 +35,7 @@
+ extern "C" {
+ #endif /* __cplusplus */
+
+-#include "mp4ff_int_types.h"
++#include <stdint.h>
+
+ /* file callback structure */
+ typedef struct
diff --git a/package/faad2/patches/patch-configure_in b/package/faad2/patches/patch-configure_in
new file mode 100644
index 000000000..be4b20530
--- /dev/null
+++ b/package/faad2/patches/patch-configure_in
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- faad2.orig/configure.in 2006-09-25 21:52:53.000000000 +0200
++++ faad2/configure.in 2009-01-08 16:50:34.056700106 +0100
+@@ -16,6 +16,7 @@ AC_SUBST(LIBTOOL_DEPS)
+
+ dnl Checks for programs.
+ AC_PROG_CC
++AC_PROG_CXX
+ AC_PROG_CPP
+ dnl disable for mpeg4ip plugin
+ dnl AC_PROG_CXX
diff --git a/package/faad2/patches/patch-frontend_Makefile_am b/package/faad2/patches/patch-frontend_Makefile_am
new file mode 100644
index 000000000..e0efa1aca
--- /dev/null
+++ b/package/faad2/patches/patch-frontend_Makefile_am
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- faad2.orig/frontend/Makefile.am 2006-05-07 20:09:00.000000000 +0200
++++ faad2/frontend/Makefile.am 2009-01-11 17:16:19.901544559 +0100
+@@ -4,7 +4,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(t
+ -I$(top_srcdir)/common/mp4ff
+
+ faad_LDADD = $(top_builddir)/libfaad/libfaad.la \
+- $(top_builddir)/common/mp4ff/libmp4ff.la
++ $(top_builddir)/common/mp4ff/libmp4ff.a
+
+ faad_SOURCES = main.c \
+ audio.c audio.h \
diff --git a/package/fakeidentd/Config.in b/package/fakeidentd/Config.in
new file mode 100644
index 000000000..68a8d33ff
--- /dev/null
+++ b/package/fakeidentd/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_FAKEIDENTD
+ prompt "fakeidentd........................ A static, secure identd."
+ tristate
+ default n
+ help
+ A static secure identd, only one source file.
+
+ http://www.guru-group.fi/~too/sw/releases/
diff --git a/package/fakeidentd/Makefile b/package/fakeidentd/Makefile
new file mode 100644
index 000000000..75760a250
--- /dev/null
+++ b/package/fakeidentd/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= fakeidentd
+PKG_VERSION:= 2.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ebf398bd1843a1fd8c71f5fcf4a6e4f7
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://distfiles.gentoo.org/distfiles/
+
+WRKDIST= ${WRKDIR}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FAKEIDENTD,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} -o ${WRKBUILD}/${PKG_NAME} ${WRKBUILD}/identd.c
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_FAKEIDENTD}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_FAKEIDENTD}/etc/init.d
+ ${INSTALL_BIN} ${WRKBUILD}/fakeidentd ${IDIR_FAKEIDENTD}/usr/sbin/
+ ${CP} ./files/${PKG_NAME}.init \
+ ${IDIR_FAKEIDENTD}/etc/init.d/${PKG_NAME}
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fakeidentd/files/fakeidentd.init b/package/fakeidentd/files/fakeidentd.init
new file mode 100644
index 000000000..284940a6e
--- /dev/null
+++ b/package/fakeidentd/files/fakeidentd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${fakeidentd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ fakeidentd ${fakeidentd_flags}
+ ;;
+stop)
+ killall fakeidentd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/fakeidentd/ipkg/fakeidentd.control b/package/fakeidentd/ipkg/fakeidentd.control
new file mode 100644
index 000000000..6c528b275
--- /dev/null
+++ b/package/fakeidentd/ipkg/fakeidentd.control
@@ -0,0 +1,4 @@
+Package: fakeidentd
+Description: A static, secure identd.
+Section: net
+Priority: optional
diff --git a/package/fakeidentd/ipkg/fakeidentd.postinst b/package/fakeidentd/ipkg/fakeidentd.postinst
new file mode 100644
index 000000000..1a65cf2cc
--- /dev/null
+++ b/package/fakeidentd/ipkg/fakeidentd.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf fakeidentd fakeidentd NO
+add_rcconf fakeidentd_flags fakeidentd_flags "username"
diff --git a/package/fbset/Config.in b/package/fbset/Config.in
new file mode 100644
index 000000000..9356fcd8d
--- /dev/null
+++ b/package/fbset/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_FBSET
+ prompt "fbset............................. framebuffer utility"
+ tristate
+ default n
+ help
+ http://users.telenet.be/geertu/Linux/fbdev/
diff --git a/package/fbset/Makefile b/package/fbset/Makefile
new file mode 100644
index 000000000..a53d60614
--- /dev/null
+++ b/package/fbset/Makefile
@@ -0,0 +1,42 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= fbset
+PKG_VERSION:= 2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e547cfcbb8c1a4f2a6b8ba4acb8b7164
+
+MASTER_SITES:= http://users.telenet.be/geertu/Linux/fbdev/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FBSET,fbset,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= manual
+INSTALL_STYLE:= manual
+
+do-build:
+ (cd ${WRKSRC} && bison -d modes.y)
+ (cd ${WRKSRC} && flex modes.l)
+ ${TARGET_CC} ${TARGET_CFLAGS} -I${WRKBUILD} -c -o \
+ ${WRKBUILD}/modes.tab.o ${WRKSRC}/modes.tab.c
+ ${TARGET_CC} ${TARGET_CFLAGS} -I${WRKBUILD} -c -o \
+ ${WRKBUILD}/lex.yy.o ${WRKSRC}/lex.yy.c
+ ${TARGET_CC} ${TARGET_CFLAGS} -I${WRKBUILD} -c -o \
+ ${WRKBUILD}/fbset.o ${WRKSRC}/fbset.c
+ ${TARGET_CC} ${TARGET_CFLAGS} -o ${WRKBUILD}/fbset \
+ ${WRKBUILD}/fbset.o \
+ ${WRKBUILD}/modes.tab.o \
+ ${WRKBUILD}/lex.yy.o
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_FBSET}/usr/bin
+ ${INSTALL_DIR} ${IDIR_FBSET}/etc
+ ${CP} ${WRKBUILD}/fbset ${IDIR_FBSET}/usr/bin
+ ${CP} ./files/fb.modes ${IDIR_FBSET}/etc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fbset/files/fb.modes b/package/fbset/files/fb.modes
new file mode 100644
index 000000000..e6a4fb7bf
--- /dev/null
+++ b/package/fbset/files/fb.modes
@@ -0,0 +1,1003 @@
+#
+# Sample video modes
+#
+# These data are based on the CRTC parameters in
+#
+# Mach64 Programmer's Guide, Appendix C
+# (C) 1998 ATI Technologies Inc.
+#
+# Kop: this are very generic modes and not only for ATI cards.
+#
+
+#
+# 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 640 480
+# Scan Frequency 31.469 kHz 59.94 Hz
+# Sync Width 3.813 us 0.064 ms
+# 12 chars 2 lines
+# Front Porch 0.636 us 0.318 ms
+# 2 chars 10 lines
+# Back Porch 1.907 us 1.048 ms
+# 6 chars 33 lines
+# Active Time 25.422 us 15.253 ms
+# 80 chars 480 lines
+# Blank Time 6.356 us 1.430 ms
+# 20 chars 45 lines
+# Polarity negative negative
+#
+
+mode "640x480-60"
+ # D: 25.175 MHz, H: 31.469 kHz, V: 59.94 Hz
+ geometry 640 480 640 480 8
+ timings 39722 48 16 33 10 96 2
+endmode
+
+#
+# 640x480, 72 Hz, Non-Interlaced (31.20 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 640 480
+# Scan Frequency 37.500 kHz 72.12 Hz
+# Sync Width 1.282 us 0.080 ms
+# 5 chars 3 lines
+# Front Porch 0.769 us 0.240 ms
+# 3 chars 9 lines
+# Back Porch 4.103 us 0.747 ms
+# 16 chars 28 lines
+# Active Time 20.513 us 12.800 ms
+# 80 chars 480 lines
+# Blank Time 6.154 us 1.067 ms
+# 24 chars 40 lines
+# Polarity negative negative
+#
+
+mode "640x480-72"
+ # D: 31.20 MHz, H: 37.500 kHz, V: 72.12 Hz
+ geometry 640 480 640 480 8
+ timings 32052 128 24 28 9 40 3
+endmode
+
+#
+# 640x480, 75 Hz, Non-Interlaced (31.50 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 640 480
+# Scan Frequency 37.500 kHz 75.00 Hz
+# Sync Width 2.032 us 0.080 ms
+# 8 chars 3 lines
+# Front Porch 0.508 us 0.027 ms
+# 2 chars 1 lines
+# Back Porch 3.810 us 0.427 ms
+# 15 chars 16 lines
+# Active Time 20.317 us 12.800 ms
+# 80 chars 480 lines
+# Blank Time 6.349 us 0.533 ms
+# 25 chars 20 lines
+# Polarity negative negative
+#
+
+mode "640x480-75"
+ # D: 31.50 MHz, H: 37.500 kHz, V: 75.00 Hz
+ geometry 640 480 640 480 8
+ timings 31747 120 16 16 1 64 3
+endmode
+
+#
+# 640x480, 90 Hz, Non-Interlaced (39.91 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 640 480
+# Scan Frequency 47.969 kHz 90.00 Hz
+# Sync Width 1.002 us 0.292 ms
+# 5 chars 14 lines
+# Front Porch 0.902 us 0.521 ms
+# 4 chars 25 lines
+# Back Porch 2.907 us 0.292 ms
+# 15 chars 14 lines
+# Active Time 16.036 us 10.007 ms
+# 80 chars 480 lines
+# Blank Time 4.811 us 1.105 ms
+# 24 chars 53 lines
+# Polarity negative negative
+#
+
+mode "640x480-90"
+ # D: 39.91 MHz, H: 47.969 kHz, V: 90.00 Hz
+ geometry 640 480 640 480 8
+ timings 25057 120 32 14 25 40 14
+endmode
+
+#
+# 640x480, 100 Hz, Non-Interlaced (44.90 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 640 480
+# Scan Frequency 52.948 kHz 99.71 Hz
+# Sync Width 2.851 us 0.227 ms
+# 16 chars 12 lines
+# Front Porch 0.801 us 0.416 ms
+# 4 chars 22 lines
+# Back Porch 0.981 us 0.322 ms
+# 6 chars 17 lines
+# Active Time 14.254 us 9.065 ms
+# 80 chars 480 lines
+# Blank Time 4.633 us 0.963 ms
+# 26 chars 51 lines
+# Polarity negative negative
+#
+
+mode "640x480-100"
+ # D: 44.90 MHz, H: 52.948 kHz, V: 99.71 Hz
+ geometry 640 480 640 480 8
+ timings 22272 48 32 17 22 128 12
+endmode
+
+
+#
+# 768x576, 75 Hz, Non-Interlaced (49.188 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 768 576
+# Scan Frequency 46.580 kHz 75.008 Hz
+# Sync Width us ms
+# chars lines
+# Front Porch us ms
+# chars lines
+# Back Porch us ms
+# chars lines
+# Active Time us ms
+# chars lines
+# Blank Time us ms
+# chars lines
+# Polarity negative negative
+#
+# This is a mode often used, because fbtv suggests this, since
+# this is the mode for "normal" TVs.
+#
+
+mode "768x576-75"
+ # D: 49.188 MHz, H: 46.580 kHz, V: 75.008 Hz
+ geometry 768 576 768 576 32
+ timings 20330 128 32 32 8 128 5
+endmode
+
+
+#
+# 800x600, 48 Hz, Interlaced (36.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 33.835 kHz 96.39 Hz
+# Sync Width 3.556 us 0.177 ms
+# 16 chars 12 lines
+# Front Porch 2.222 us 0.163 ms
+# 10 chars 11 lines
+# Back Porch 1.555 us 1.167 ms
+# 7 chars 79 lines
+# Active Time 22.222 us 8.867 ms
+# 100 chars 600 lines
+# Blank Time 7.333 us 1.507 ms
+# 33 chars 102 lines
+# Polarity positive positive
+#
+
+mode "800x600-48-lace"
+ # D: 36.00 MHz, H: 33.835 kHz, V: 96.39 Hz
+ geometry 800 600 800 600 8
+ timings 27778 56 80 79 11 128 12
+ laced true
+ hsync high
+ vsync high
+endmode
+
+#
+# 800x600, 56 Hz, Non-Interlaced (36.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 35.156 kHz 56.25 Hz
+# Sync Width 2.000 us 0.057 ms
+# 9 chars 2 lines
+# Front Porch 0.667 us 0.028 ms
+# 3 chars 1 lines
+# Back Porch 3.555 us 0.626 ms
+# 16 chars 22 lines
+# Active Time 22.222 us 17.067 ms
+# 100 chars 600 lines
+# Blank Time 6.222 us 0.711 ms
+# 28 chars 25 lines
+# Polarity positive positive
+#
+
+mode "800x600-56"
+ # D: 36.00 MHz, H: 35.156 kHz, V: 56.25 Hz
+ geometry 800 600 800 600 8
+ timings 27778 128 24 22 1 72 2
+ hsync high
+ vsync high
+endmode
+
+#
+# 800x600, 60 Hz, Non-Interlaced (40.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 37.879 kHz 60.32 Hz
+# Sync Width 3.200 us 0.106 ms
+# 16 chars 4 lines
+# Front Porch 1.000 us 0.026 ms
+# 5 chars 1 lines
+# Back Porch 2.200 us 0.607 ms
+# 11 chars 23 lines
+# Active Time 20.000 us 15.840 ms
+# 100 chars 600 lines
+# Blank Time 6.400 us 0.739 ms
+# 32 chars 28 lines
+# Polarity positive positive
+#
+
+mode "800x600-60"
+ # D: 40.00 MHz, H: 37.879 kHz, V: 60.32 Hz
+ geometry 800 600 800 600 8
+ timings 25000 88 40 23 1 128 4
+ hsync high
+ vsync high
+endmode
+
+#
+# 800x600, 70 Hz, Non-Interlaced (44.90 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 44.544 kHz 70.04 Hz
+# Sync Width 3.207 us 0.269 ms
+# 18 chars 12 lines
+# Front Porch 0.535 us 0.202 ms
+# 3 chars 9 lines
+# Back Porch 0.891 us 0.337 ms
+# 5 chars 15 lines
+# Active Time 17.817 us 13.470 ms
+# 100 chars 600 lines
+# Blank Time 4.633 us 0.808 ms
+# 26 chars 36 lines
+# Polarity positive negative
+#
+
+mode "800x600-70"
+ # D: 44.90 MHz, H: 44.544 kHz, V: 70.04 Hz
+ geometry 800 600 800 600 8
+ timings 22272 40 24 15 9 144 12
+ hsync high
+endmode
+
+#
+# 800x600, 72 Hz, Non-Interlaced (50.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 48.090 kHz 72.19 Hz
+# Sync Width 2.400 us 0.125 ms
+# 15 chars 6 lines
+# Front Porch 1.120 us 0.769 ms
+# 7 chars 37 lines
+# Back Porch 1.280 us 0.478 ms
+# 8 chars 23 lines
+# Active Time 16.000 us 12.477 ms
+# 100 chars 600 lines
+# Blank Time 4.800 us 1.372 ms
+# 30 chars 66 lines
+# Polarity positive positive
+#
+
+mode "800x600-72"
+ # D: 50.00 MHz, H: 48.090 kHz, V: 72.19 Hz
+ geometry 800 600 800 600 8
+ timings 20000 64 56 23 37 120 6
+ hsync high
+ vsync high
+endmode
+
+#
+# 800x600, 75 Hz, Non-Interlaced (49.50 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 46.875 kHz 75.00 Hz
+# Sync Width 1.616 us 0.064 ms
+# 10 chars 3 lines
+# Front Porch 0.323 us 0.021 ms
+# 2 chars 1 lines
+# Back Porch 3.232 us 0.448 ms
+# 20 chars 21 lines
+# Active Time 16.162 us 12.800 ms
+# 100 chars 600 lines
+# Blank Time 5.172 us 0.533 ms
+# 32 chars 25 lines
+# Polarity positive positive
+#
+
+mode "800x600-75"
+ # D: 49.50 MHz, H: 46.875 kHz, V: 75.00 Hz
+ geometry 800 600 800 600 8
+ timings 20203 160 16 21 1 80 3
+ hsync high
+ vsync high
+endmode
+
+#
+# 800x600, 90 Hz, Non-Interlaced (56.64 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 57.097 kHz 89.92 Hz
+# Sync Width 1.130 us 0.193 ms
+# 8 chars 11 lines
+# Front Porch 0.071 us 0.140 ms
+# 1 chars 8 lines
+# Back Porch 2.189 us 0.280 ms
+# 15 chars 16 lines
+# Active Time 14.124 us 10.508 ms
+# 100 chars 600 lines
+# Blank Time 3.390 us 0.613 ms
+# 24 chars 35 lines
+# Polarity positive positive
+#
+
+mode "800x600-90"
+ # D: 56.64 MHz, H: 57.097 kHz, V: 89.92 Hz
+ geometry 800 600 800 600 8
+ timings 17656 120 8 16 8 64 11
+ hsync high
+ vsync high
+endmode
+
+#
+# 800x600, 100 Hz, Non-Interlaced (67.50 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 800 600
+# Scan Frequency 62.500 kHz 100.00 Hz
+# Sync Width 0.948 us 0.064 ms
+# 8 chars 4 lines
+# Front Porch 0.000 us 0.112 ms
+# 0 chars 7 lines
+# Back Porch 3.200 us 0.224 ms
+# 27 chars 14 lines
+# Active Time 11.852 us 9.600 ms
+# 100 chars 600 lines
+# Blank Time 4.148 us 0.400 ms
+# 35 chars 25 lines
+# Polarity positive positive
+#
+
+mode "800x600-100"
+ # D: 67.50 MHz, H: 62.500 kHz, V: 100.00 Hz
+ geometry 800 600 800 600 8
+ timings 14815 216 0 14 7 64 4
+ hsync high
+ vsync high
+endmode
+
+#
+# 1024x768, 43 Hz, Interlaced (44.90 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 768
+# Scan Frequency 35.522 kHz 86.96 Hz
+# Sync Width 3.920 us 0.113 ms
+# 22 chars 8 lines
+# Front Porch 0.178 us 0.014 ms
+# 1 chars 1 lines
+# Back Porch 1.247 us 0.563 ms
+# 7 chars 40 lines
+# Active Time 22.806 us 10.810 ms
+# 128 chars 768 lines
+# Blank Time 5.345 us 0.690 ms
+# 30 chars 49 lines
+# Polarity positive positive
+#
+
+mode "1024x768-43-lace"
+ # D: 44.90 MHz, H: 35.522 kHz, V: 86.96 Hz
+ geometry 1024 768 1024 768 8
+ timings 22272 56 8 40 1 176 8
+ laced true
+ hsync high
+ vsync high
+endmode
+
+#
+# 1024x768, 60 Hz, Non-Interlaced (65.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 768
+# Scan Frequency 48.363 kHz 60.00 Hz
+# Sync Width 2.092 us 0.124 ms
+# 17 chars 6 lines
+# Front Porch 0.369 us 0.062 ms
+# 3 chars 3 lines
+# Back Porch 2.462 us 0.601 ms
+# 20 chars 29 lines
+# Active Time 15.754 us 15.880 ms
+# 128 chars 768 lines
+# Blank Time 4.923 us 0.786 ms
+# 40 chars 38 lines
+# Polarity negative negative
+#
+
+mode "1024x768-60"
+ # D: 65.00 MHz, H: 48.363 kHz, V: 60.00 Hz
+ geometry 1024 768 1024 768 8
+ timings 15385 160 24 29 3 136 6
+endmode
+
+#
+# 1024x768, 70 Hz, Non-Interlaced (75.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 768
+# Scan Frequency 56.476 kHz 70.07 Hz
+# Sync Width 1.813 us 0.106 ms
+# 17 chars 6 lines
+# Front Porch 0.320 us 0.053 ms
+# 3 chars 3 lines
+# Back Porch 1.921 us 0.514 ms
+# 18 chars 29 lines
+# Active Time 13.653 us 13.599 ms
+# 128 chars 768 lines
+# Blank Time 4.053 us 0.673 ms
+# 38 chars 38 lines
+# Polarity negative negative
+#
+
+mode "1024x768-70"
+ # D: 75.00 MHz, H: 56.476 kHz, V: 70.07 Hz
+ geometry 1024 768 1024 768 8
+ timings 13334 144 24 29 3 136 6
+endmode
+
+#
+# 1024x768, 72 Hz, Non-Interlaced (75.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 768
+# Scan Frequency 58.230 kHz 72.245 Hz
+# Sync Width 1.813 us 0.103 ms
+# 17 chars 6 lines
+# Front Porch 0.320 us 0.052 ms
+# 3 chars 3 lines
+# Back Porch 1.387 us 0.498 ms
+# 13 chars 29 lines
+# Active Time 13.653 us 13.189 ms
+# 128 chars 768 lines
+# Blank Time 3.520 us 0.653 ms
+# 33 chars 38 lines
+# Polarity negative negative
+#
+
+mode "1024x768-72"
+ # D: 75.00 MHz, H: 58.230 kHz, V: 72.245 Hz
+ geometry 1024 768 1024 768 8
+ timings 13334 104 24 29 3 136 6
+endmode
+
+#
+# 1024x768, 75 Hz, Non-Interlaced (78.75 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 768
+# Scan Frequency 60.023 kHz 75.03 Hz
+# Sync Width 1.219 us 0.050 ms
+# 12 chars 3 lines
+# Front Porch 0.203 us 0.017 ms
+# 2 chars 1 lines
+# Back Porch 2.235 us 0.466 ms
+# 22 chars 28 lines
+# Active Time 13.003 us 12.795 ms
+# 128 chars 768 lines
+# Blank Time 3.657 us 0.533 ms
+# 36 chars 32 lines
+# Polarity positive positive
+#
+
+mode "1024x768-75"
+ # D: 78.75 MHz, H: 60.023 kHz, V: 75.03 Hz
+ geometry 1024 768 1024 768 8
+ timings 12699 176 16 28 1 96 3
+ hsync high
+ vsync high
+endmode
+
+#
+# 1024x768, 90 Hz, Non-Interlaced (100.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 768
+# Scan Frequency 76.220 kHz 90.20 Hz
+# Sync Width 0.960 us 0.197 ms
+# 12 chars 15 lines
+# Front Porch 0.000 us 0.276 ms
+# 0 chars 21 lines
+# Back Porch 1.920 us 0.537 ms
+# 24 chars 41 lines
+# Active Time 10.240 us 10.076 ms
+# 128 chars 768 lines
+# Blank Time 2.880 us 1.010 ms
+# 36 chars 77 lines
+# Polarity negative negative
+#
+
+mode "1024x768-90"
+ # D: 100.0 MHz, H: 76.220 kHz, V: 90.20 Hz
+ geometry 1024 768 1024 768 8
+ timings 10000 192 0 41 21 96 15
+endmode
+
+#
+# 1024x768, 100 Hz, Non-Interlaced (110.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 768
+# Scan Frequency 79.023 kHz 99.78 Hz
+# Sync Width 0.800 us 0.101 ms
+# 11 chars 8 lines
+# Front Porch 0.000 us 0.000 ms
+# 0 chars 0 lines
+# Back Porch 2.545 us 0.202 ms
+# 35 chars 16 lines
+# Active Time 9.309 us 9.719 ms
+# 128 chars 768 lines
+# Blank Time 3.345 us 0.304 ms
+# 46 chars 24 lines
+# Polarity negative negative
+#
+
+mode "1024x768-100"
+ # D: 110.0 MHz, H: 79.023 kHz, V: 99.78 Hz
+ geometry 1024 768 1024 768 8
+ timings 9091 280 0 16 0 88 8
+endmode
+
+#
+# 1152x864, 43 Hz, Interlaced (65.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1152 864
+# Scan Frequency 45.904 kHz 87.02 Hz
+# Sync Width 1.969 us 0.098 ms
+# 16 chars 9 lines
+# Front Porch 1.062 us 0.850 ms
+# 9 chars 78 lines
+# Back Porch 1.031 us 1.133 ms
+# 8 chars 104 lines
+# Active Time 17.723 us 9.411 ms
+# 144 chars 864 lines
+# Blank Time 4.062 us 2.080 ms
+# 33 chars 191 lines
+# Polarity positive positive
+#
+
+mode "1152x864-43-lace"
+ # D: 65.0 MHz, H: 45.904 kHz, V: 87.02 Hz
+ geometry 1152 864 1152 864 8
+ timings 15385 64 72 104 78 128 9
+ laced true
+ hsync high
+ vsync high
+endmode
+
+#
+# 1152x864, 47 Hz, Interlaced (65.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1152 864
+# Scan Frequency 44.890 kHz 94.80 Hz
+# Sync Width 1.969 us 0.100 ms
+# 16 chars 9 lines
+# Front Porch 1.415 us 0.334 ms
+# 11 chars 30 lines
+# Back Porch 1.170 us 0.490 ms
+# 10 chars 44 lines
+# Active Time 17.723 us 9.624 ms
+# 144 chars 864 lines
+# Blank Time 4.554 us 0.924 ms
+# 37 chars 83 lines
+# Polarity positive positive
+#
+
+mode "1152x864-47-lace"
+ # D: 65.0 MHz, H: 44.890 kHz, V: 94.80 Hz
+ geometry 1152 864 1152 864 8
+ timings 15385 80 88 44 30 128 9
+ laced true
+ hsync high
+ vsync high
+endmode
+
+#
+# 1152x864, 60 Hz, Non-Interlaced (80.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1152 864
+# Scan Frequency 54.945 kHz 59.98 Hz
+# Sync Width 1.400 us 0.091 ms
+# 14 chars 5 lines
+# Front Porch 0.800 us 0.109 ms
+# 8 chars 6 lines
+# Back Porch 1.600 us 0.746 ms
+# 16 chars 41 lines
+# Active Time 14.400 us 15.725 ms
+# 144 chars 864 lines
+# Blank Time 3.800 us 0.946 ms
+# 38 chars 52 lines
+# Polarity positive positive
+#
+
+mode "1152x864-60"
+ # D: 80.0 MHz, H: 54.945 kHz, V: 59.98 Hz
+ geometry 1152 864 1152 864 8
+ timings 12500 128 64 41 6 112 5
+ hsync high
+ vsync high
+endmode
+
+#
+# 1152x864, 70 Hz, Non-Interlaced (100.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1152 864
+# Scan Frequency 66.138 kHz 69.99 Hz
+# Sync Width 1.520 us 0.166 ms
+# 19 chars 11 lines
+# Front Porch 0.390 us 0.197 ms
+# 5 chars 13 lines
+# Back Porch 1.690 us 0.862 ms
+# 21 chars 57 lines
+# Active Time 11.520 us 13.064 ms
+# 144 chars 864 lines
+# Blank Time 3.600 us 1.225 ms
+# 45 chars 81 lines
+# Polarity positive positive
+#
+
+mode "1152x864-70"
+ # D: 100.0 MHz, H: 66.138 kHz, V: 69.99 Hz
+ geometry 1152 864 1152 864 8
+ timings 10000 168 40 57 13 152 11
+ hsync high
+ vsync high
+endmode
+
+#
+# 1152x864, 75 Hz, Non-Interlaced (110.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1152 864
+# Scan Frequency 75.137 kHz 74.99 Hz
+# Sync Width 1.309 us 0.106 ms
+# 18 chars 8 lines
+# Front Porch 0.245 us 0.599 ms
+# 3 chars 45 lines
+# Back Porch 1.282 us 1.132 ms
+# 18 chars 85 lines
+# Active Time 10.473 us 11.499 ms
+# 144 chars 864 lines
+# Blank Time 2.836 us 1.837 ms
+# 39 chars 138 lines
+# Polarity positive positive
+#
+
+mode "1152x864-75"
+ # D: 110.0 MHz, H: 75.137 kHz, V: 74.99 Hz
+ geometry 1152 864 1152 864 8
+ timings 9091 144 24 85 45 144 8
+ hsync high
+ vsync high
+endmode
+
+#
+# 1152x864, 80 Hz, Non-Interlaced (110.0 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1152 864
+# Scan Frequency 76.389 kHz 79.74 Hz
+# Sync Width 1.018 us 0.092 ms
+# 14 chars 7 lines
+# Front Porch 0.127 us 0.393 ms
+# 2 chars 30 lines
+# Back Porch 1.473 us 0.747 ms
+# 20 chars 57 lines
+# Active Time 10.473 us 11.311 ms
+# 144 chars 864 lines
+# Blank Time 2.618 us 1.231 ms
+# 36 chars 94 lines
+# Polarity positive positive
+#
+
+mode "1152x864-80"
+ # D: 110.0 MHz, H: 76.389 kHz, V: 79.74 Hz
+ geometry 1152 864 1152 864 8
+ timings 9091 160 16 57 30 112 7
+ hsync high
+ vsync high
+endmode
+
+#
+# 1280x960, 75 Hz, Non-Interlaced (126.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1280 960
+# Scan Frequency 74.788 kHz 74.788 Hz
+# Sync Width 1.018 us 0.092 ms
+# 14 chars 7 lines
+# Front Porch 0.127 us 0.393 ms
+# 2 chars 30 lines
+# Back Porch 1.473 us 0.747 ms
+# 20 chars 57 lines
+# Active Time 10.473 us 11.311 ms
+# 144 chars 864 lines
+# Blank Time 2.618 us 1.231 ms
+# 36 chars 94 lines
+# Polarity positive positive
+#
+
+mode "1280x960-75-8"
+ # D: 125.644 MHz, H: 74.788 kHz, V: 74.788 Hz
+ geometry 1280 960 1280 960 8
+ timings 7959 224 32 36 1 144 3
+endmode
+
+mode "1280x960-75"
+ # D: 125.644 MHz, H: 74.788 kHz, V: 74.788 Hz
+ geometry 1280 960 1280 960 16
+ timings 7959 224 32 36 1 144 3
+endmode
+
+mode "1280x960-75-32"
+ # D: 125.644 MHz, H: 74.788 kHz, V: 74.788 Hz
+ geometry 1280 960 1280 960 32
+ timings 7959 224 32 36 1 144 3
+endmode
+
+
+#
+# 1280x1024, 43 Hz, Interlaced (80.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1024 1024
+# Scan Frequency 50.000 kHz 87.03 Hz
+# Sync Width 1.000 us 0.100 ms
+# 10 chars 10 lines
+# Front Porch 1.000 us 0.500 ms
+# 10 chars 50 lines
+# Back Porch 2.000 us 0.650 ms
+# 20 chars 65 lines
+# Active Time 16.000 us 10.240 ms
+# 160 chars 1024 lines
+# Blank Time 4.000 us 1.250 ms
+# 40 chars 125 lines
+# Polarity positive positive
+#
+
+mode "1280x1024-43-lace"
+ # D: 80.00 MHz, H: 50.000 kHz, V: 87.03 Hz
+ geometry 1024 1024 1024 1024 8
+ timings 12500 160 80 65 50 80 10
+ laced true
+ hsync high
+ vsync high
+endmode
+
+#
+# 1280x1024, 47 Hz, Interlaced (80.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1280 1024
+# Scan Frequency 50.000 kHz 94.97 Hz
+# Sync Width 1.000 us 0.100 ms
+# 10 chars 10 lines
+# Front Porch 1.000 us 0.010 ms
+# 10 chars 1 lines
+# Back Porch 2.000 us 0.180 ms
+# 20 chars 18 lines
+# Active Time 16.000 us 10.240 ms
+# 160 chars 1024 lines
+# Blank Time 4.000 us 0.290 ms
+# 40 chars 29 lines
+# Polarity positive positive
+#
+
+mode "1280x1024-47-lace"
+ # D: 80.00 MHz, H: 50.000 kHz, V: 94.97 Hz
+ geometry 1280 1024 1280 1024 8
+ timings 12500 160 80 18 1 80 10
+ laced true
+ hsync high
+ vsync high
+endmode
+
+#
+# 1280x1024, 60 Hz, Non-Interlaced (108.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1280 1024
+# Scan Frequency 63.981 kHz 60.02 Hz
+# Sync Width 1.037 us 0.047 ms
+# 14 chars 3 lines
+# Front Porch 0.444 us 0.015 ms
+# 6 chars 1 lines
+# Back Porch 2.297 us 0.594 ms
+# 31 chars 38 lines
+# Active Time 11.852 us 16.005 ms
+# 160 chars 1024 lines
+# Blank Time 3.778 us 0.656 ms
+# 51 chars 42 lines
+# Polarity positive positive
+#
+
+mode "1280x1024-60"
+ # D: 108.00 MHz, H: 63.981 kHz, V: 60.02 Hz
+ geometry 1280 1024 1280 1024 8
+ timings 9260 248 48 38 1 112 3
+ hsync high
+ vsync high
+endmode
+
+#
+# 1280x1024, 70 Hz, Non-Interlaced (126.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1280 1024
+# Scan Frequency 74.645 kHz 70.02 Hz
+# Sync Width 0.889 us 0.067 ms
+# 14 chars 5 lines
+# Front Porch 0.635 us 0.013 ms
+# 10 chars 1 lines
+# Back Porch 1.714 us 0.483 ms
+# 27 chars 36 lines
+# Active Time 10.159 us 13.718 ms
+# 160 chars 1024 lines
+# Blank Time 3.238 us 0.563 ms
+# 51 chars 42 lines
+# Polarity positive positive
+#
+
+mode "1280x1024-70"
+ # D: 126.00 MHz, H: 74.645 kHz, V: 70.02 Hz
+ geometry 1280 1024 1280 1024 8
+ timings 7937 216 80 36 1 112 5
+ hsync high
+ vsync high
+endmode
+
+#
+# 1280x1024, 74 Hz, Non-Interlaced (135.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1280 1024
+# Scan Frequency 78.855 kHz 74.11 Hz
+# Sync Width 1.067 us 0.380 ms
+# 18 chars 30 lines
+# Front Porch 0.237 us 0.000 ms
+# 4 chars 0 lines
+# Back Porch 1.896 us 0.127 ms
+# 32 chars 10 lines
+# Active Time 9.481 us 12.986 ms
+# 160 chars 1024 lines
+# Blank Time 3.200 us 0.507 ms
+# 54 chars 40 lines
+# Polarity positive positive
+#
+
+mode "1280x1024-74"
+ # D: 135.00 MHz, H: 78.855 kHz, V: 74.11 Hz
+ geometry 1280 1024 1280 1024 8
+ timings 7408 256 32 10 0 144 30
+ hsync high
+ vsync high
+endmode
+
+#
+# 1280x1024, 75 Hz, Non-Interlaced (135.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1280 1024
+# Scan Frequency 79.976 kHz 75.02 Hz
+# Sync Width 1.067 us 0.038 ms
+# 18 chars 3 lines
+# Front Porch 0.119 us 0.012 ms
+# 2 chars 1 lines
+# Back Porch 1.837 us 0.475 ms
+# 31 chars 38 lines
+# Active Time 9.481 us 12.804 ms
+# 160 chars 1024 lines
+# Blank Time 3.022 us 0.525 ms
+# 51 chars 42 lines
+# Polarity positive positive
+#
+
+mode "1280x1024-75"
+ # D: 134.880 MHz, H: 79.905 kHz, V: 74.958 Hz
+ geometry 1280 1024 1280 3264 8
+ timings 7414 232 64 38 1 112 3
+ hsync high
+ vsync high
+endmode
+
+#
+# 1600x1200, 60 Hz, Non-Interlaced (156.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1600 1200
+# Scan Frequency 76.200 kHz 60.00 Hz
+# Sync Width 1.026 us 0.105 ms
+# 20 chars 8 lines
+# Front Porch 0.205 us 0.131 ms
+# 4 chars 10 lines
+# Back Porch 1.636 us 0.682 ms
+# 32 chars 52 lines
+# Active Time 10.256 us 15.748 ms
+# 200 chars 1200 lines
+# Blank Time 2.872 us 0.866 ms
+# 56 chars 66 lines
+# Polarity negative negative
+#
+
+mode "1600x1200-60"
+ # D: 156.00 MHz, H: 76.200 kHz, V: 60.00 Hz
+ geometry 1600 1200 1600 1200 8
+ timings 6411 256 32 52 10 160 8
+endmode
+
+#
+# 1600x1200, 66 Hz, Non-Interlaced (172.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1600 1200
+# Scan Frequency 82.700 kHz 66.00 Hz
+# Sync Width 0.791 us 0.036 ms
+# 17 chars 3 lines
+# Front Porch 0.233 us 0.036 ms
+# 5 chars 3 lines
+# Back Porch 1.767 us 0.567 ms
+# 38 chars 47 lines
+# Active Time 9.302 us 14.512 ms
+# 200 chars 1200 lines
+# Blank Time 2.791 us 0.532 ms
+# 60 chars 44 lines
+# Polarity negative negative
+#
+
+mode "1600x1200-66"
+ # D: 172.00 MHz, H: 82.700 kHz, V: 66.00 Hz
+ geometry 1600 1200 1600 1200 8
+ timings 5814 304 40 47 3 136 3
+endmode
+
+#
+# 1600x1200, 76 Hz, Non-Interlaced (198.00 MHz dotclock)
+#
+# Horizontal Vertical
+# Resolution 1600 1200
+# Scan Frequency 95.200 kHz 76.00 Hz
+# Sync Width 0.687 us 0.052 ms
+# 17 chars 5 lines
+# Front Porch 0.202 us 0.032 ms
+# 5 chars 3 lines
+# Back Porch 1.535 us 0.441 ms
+# 38 chars 42 lines
+# Active Time 8.081 us 12.606 ms
+# 200 chars 1200 lines
+# Blank Time 2.424 us 0.525 ms
+# 60 chars 50 lines
+# Polarity negative negative
+#
+
+mode "1600x1200-76"
+ # D: 198.00 MHz, H: 95.200 kHz, V: 76.00 Hz
+ geometry 1600 1200 1600 1200 8
+ timings 5051 304 40 42 3 136 5
+endmode
+
diff --git a/package/fbset/ipkg/fbset.control b/package/fbset/ipkg/fbset.control
new file mode 100644
index 000000000..b449b1de7
--- /dev/null
+++ b/package/fbset/ipkg/fbset.control
@@ -0,0 +1,4 @@
+Package: fbset
+Priority: optional
+Section: net
+Description: framebuffer utility
diff --git a/package/fetchmail/Config.in b/package/fetchmail/Config.in
new file mode 100644
index 000000000..fa7f1bfe2
--- /dev/null
+++ b/package/fetchmail/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_FETCHMAIL
+ prompt "fetchmail......................... Remote mail retriever"
+ tristate
+ default n
+ help
+ Retrieves remote mail via POP/IMAP
+
+ Very useful in conjunction with mutt or pine.
+ Known to be full of security holes, beware.
+
+config ADK_PACKAGE_FETCHMAIL_SSL
+ bool " Enable SSL/TLS support"
+ depends ADK_PACKAGE_FETCHMAIL
+ select ADK_PACKAGE_LIBOPENSSL
+ default n
+ help
+ Enable this to be able to retrieve mails more securely.
diff --git a/package/fetchmail/Makefile b/package/fetchmail/Makefile
new file mode 100644
index 000000000..388afec92
--- /dev/null
+++ b/package/fetchmail/Makefile
@@ -0,0 +1,41 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= fetchmail
+PKG_VERSION:= 6.3.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 72c20ad2b9629f1a109668b05a84d823
+MASTER_SITES:= http://download.berlios.de/fetchmail/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FETCHMAIL,fetchmail,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_c_bigendian=no \
+ ac_cv_sizeof_off_t=8 \
+ ac_cv_sizeof_int=4 \
+ ac_cv_sizeof_long=4
+CONFIGURE_ARGS+= --without-hesiod
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+ifeq (${ADK_PACKAGE_FETCHMAIL_SSL},y)
+CONFIGURE_ARGS+= --with-ssl='${STAGING_DIR}/usr'
+PKG_DEPENDS:= openssl
+else
+CONFIGURE_ARGS+= --without-ssl
+PKG_DEPENDS:=
+endif
+
+post-install:
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_FETCHMAIL}/CONTROL/control
+ ${INSTALL_DIR} ${IDIR_FETCHMAIL}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/${PKG_NAME} ${IDIR_FETCHMAIL}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fetchmail/ipkg/fetchmail.control b/package/fetchmail/ipkg/fetchmail.control
new file mode 100644
index 000000000..1e2a464f9
--- /dev/null
+++ b/package/fetchmail/ipkg/fetchmail.control
@@ -0,0 +1,4 @@
+Package: fetchmail
+Priority: optional
+Section: text
+Description: Mail text client
diff --git a/package/fetchmail/patches/patch-mxget_c b/package/fetchmail/patches/patch-mxget_c
new file mode 100644
index 000000000..ee6d61576
--- /dev/null
+++ b/package/fetchmail/patches/patch-mxget_c
@@ -0,0 +1,127 @@
+$Id$
+--- fetchmail-6.3.8.orig/mxget.c 2006-03-14 11:00:02.000000000 +0100
++++ fetchmail-6.3.8/mxget.c 2008-04-07 23:56:13.000000000 +0200
+@@ -54,6 +54,123 @@
+ /* minimum possible size of MX record in packet */
+ #define MIN_MX_SIZE 8 /* corresp to "a.com 0" w/ terminating space */
+
++/* from bind9 package: */
++/*
++Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
++Copyright (C) 1996-2003 Internet Software Consortium.
++
++Permission to use, copy, modify, and distribute this software for any
++purpose with or without fee is hereby granted, provided that the above
++copyright notice and this permission notice appear in all copies.
++
++THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
++REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
++INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
++LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
++OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
++PERFORMANCE OF THIS SOFTWARE.
++
++$Id: COPYRIGHT,v 1.9.18.3 2007/01/08 02:41:59 marka Exp $
++
++Portions Copyright (C) 1996-2001 Nominum, Inc.
++
++Permission to use, copy, modify, and distribute this software for any
++purpose with or without fee is hereby granted, provided that the above
++copyright notice and this permission notice appear in all copies.
++
++THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
++WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
++ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
++OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++*/
++#define NS_TYPE_ELT 0x40 /*%< EDNS0 extended label
++type
++*/
++#define NS_CMPRSFLGS 0xc0 /*%< Flag bits indicating name compression. */
++#define DNS_LABELTYPE_BITSTRING 0x41
++static int
++labellen(const u_char *lp)
++{
++ int bitlen;
++ u_char l = *lp;
++
++ if ((l & NS_CMPRSFLGS) == NS_CMPRSFLGS) {
++ /* should be avoided by the caller */
++ return(-1);
++ }
++
++ if ((l & NS_CMPRSFLGS) == NS_TYPE_ELT) {
++ if (l == DNS_LABELTYPE_BITSTRING) {
++ if ((bitlen = *(lp + 1)) == 0)
++ bitlen = 256;
++ return((bitlen + 7 ) / 8 + 1);
++ }
++ return(-1); /*%< unknwon ELT */
++ }
++ return(l);
++}
++/*%
++ * Advance *ptrptr to skip over the compressed name it points at.
++ *
++ * return:
++ *\li 0 on success, -1 (with errno set) on failure.
++ */
++int
++ns_name_skip(const u_char **ptrptr, const u_char *eom)
++{
++ const u_char *cp;
++ u_int n;
++ int l;
++
++ cp = *ptrptr;
++ while (cp < eom && (n = *cp++) != 0) {
++ /* Check for indirection. */
++ switch (n & NS_CMPRSFLGS) {
++ case 0: /*%< normal case, n == len */
++ cp += n;
++ continue;
++ case NS_TYPE_ELT: /*%< EDNS0 extended label */
++ if ((l = labellen(cp - 1)) < 0) {
++// errno = EMSGSIZE; /*%< XXX */
++ return(-1);
++ }
++ cp += l;
++ continue;
++ case NS_CMPRSFLGS: /*%< indirection */
++ cp++;
++ break;
++ default: /*%< illegal type */
++// errno = EMSGSIZE;
++ return (-1);
++ }
++ break;
++ }
++ if (cp > eom) {
++// errno = EMSGSIZE;
++ return (-1);
++ }
++ *ptrptr = cp;
++ return (0);
++}
++
++/*%
++ * Skip over a compressed domain name. Return the size or -1.
++ */
++int
++dn_skipname(const u_char *ptr, const u_char *eom) {
++ const u_char *saveptr = ptr;
++
++ if (ns_name_skip(&ptr, eom) == -1)
++ return (-1);
++ return (ptr - saveptr);
++}
++/* End from Bind9 package */
++
++
+ struct mxentry *getmxrecords(const char *name)
+ /* get MX records for given host */
+ {
diff --git a/package/ffmpeg/Config.in b/package/ffmpeg/Config.in
new file mode 100644
index 000000000..9eebed177
--- /dev/null
+++ b/package/ffmpeg/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_FFMPEG
+ tristate "ffmpeg............................ audio/video multimedia library"
+ default n
+ help
+ cross-platform solution to record, convert and stream audio and video.
+ http://www.ffmpeg.org
diff --git a/package/ffmpeg/Makefile b/package/ffmpeg/Makefile
new file mode 100644
index 000000000..58b029276
--- /dev/null
+++ b/package/ffmpeg/Makefile
@@ -0,0 +1,56 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ffmpeg
+PKG_VERSION:= 0.5
+PKG_RELEASE:= 2
+PKG_MD5SUM:= be8503f15c3b81ba00eb8379ca8dcf33
+MASTER_SITES:= http://www.ffmpeg.org/releases/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FFMPEG,ffmpeg,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= manual
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+include ${TOPDIR}/mk/cpu.mk
+
+do-configure:
+ cd ${WRKBUILD}; \
+ env ${CONFIGURE_ENV} \
+ ${BASH} ${WRKSRC}/configure \
+ --prefix=/usr \
+ --arch=${CPU_ARCH} \
+ --enable-cross-compile \
+ --cross-prefix=${TARGET_CROSS} \
+ --cc=$(TARGET_CC) \
+ --host-cc=$(HOSTCC) \
+ --disable-debug \
+ --disable-stripping \
+ --enable-small \
+ --enable-shared \
+ --enable-static \
+ --disable-ffmpeg \
+ --disable-ffplay \
+ --disable-ffserver \
+ --disable-vhook \
+ --enable-gpl \
+ --enable-swscale \
+ --enable-postproc \
+ --enable-libfaad \
+ ${CONFIGURE_CPU_OPTS}
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_FFMPEG}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libavformat.so* ${IDIR_FFMPEG}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libavcodec.so* ${IDIR_FFMPEG}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libavutil.so* ${IDIR_FFMPEG}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ffmpeg/ipkg/ffmpeg.control b/package/ffmpeg/ipkg/ffmpeg.control
new file mode 100644
index 000000000..0389ef984
--- /dev/null
+++ b/package/ffmpeg/ipkg/ffmpeg.control
@@ -0,0 +1,4 @@
+Package: ffmpeg
+Priority: optional
+Section: sound
+Description: cross-platform solution to record, convert and stream audio and video
diff --git a/package/file/Config.in b/package/file/Config.in
new file mode 100644
index 000000000..7ff23c16f
--- /dev/null
+++ b/package/file/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_FILE
+ prompt "file.............................. a file type guesser"
+ tristate
+ default n
+ help
+
+ The file command is "a file type guesser", that is, a command-line
+ tool that tells you in words what kind of data a file contains. Unlike
+ most GUI systems, command-line UNIX systems - with this program
+ leading the charge - don't rely on filename extentions to tell you the
+ type of a file, but look at the file's actual contents. This is, of
+ course, more reliable, but requires a bit of I/O.
+
+ http://www.darwinsys.com/file/
diff --git a/package/file/Makefile b/package/file/Makefile
new file mode 100644
index 000000000..c4704c7a7
--- /dev/null
+++ b/package/file/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= file
+PKG_VERSION:= 4.26
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 74cd5466416136da30a4e69f74dbc7a0
+MASTER_SITES:= ftp://ftp.fu-berlin.de/unix/tools/file/ \
+ ftp://ftp.astron.com/pub/file/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FILE,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_FILE}/usr/bin
+ ${INSTALL_DIR} ${IDIR_FILE}/usr/lib
+ ${INSTALL_DIR} ${IDIR_FILE}/usr/share/file
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/file ${IDIR_FILE}/usr/bin
+ ${INSTALL_DATA} ${WRKINST}/usr/share/file/magic.mgc \
+ ${IDIR_FILE}/usr/share/file
+ ${CP} ${WRKINST}/usr/lib/libmagic.so.* ${IDIR_FILE}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/file/ipkg/file.control b/package/file/ipkg/file.control
new file mode 100644
index 000000000..f454a01d9
--- /dev/null
+++ b/package/file/ipkg/file.control
@@ -0,0 +1,4 @@
+Package: file
+Priority: optional
+Section: net
+Description: a file type guesser
diff --git a/package/fixesproto/Config.in b/package/fixesproto/Config.in
new file mode 100644
index 000000000..c463a557e
--- /dev/null
+++ b/package/fixesproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_FIXESPROTO
+ prompt "fixesproto............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/fixesproto/Makefile b/package/fixesproto/Makefile
new file mode 100644
index 000000000..8a11ab889
--- /dev/null
+++ b/package/fixesproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= fixesproto
+PKG_VERSION:= 4.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ed4af7fbf04a51aca684c259784520f3
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/flac/Config.in b/package/flac/Config.in
new file mode 100644
index 000000000..bef5c0876
--- /dev/null
+++ b/package/flac/Config.in
@@ -0,0 +1,14 @@
+config ADK_COMPILE_FLAC
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBFLAC
+
+config ADK_PACKAGE_LIBFLAC
+ prompt "libflac........................... Free Lossless Audio Codec library"
+ tristate
+ default n
+ select ADK_COMPILE_FLAC
+ help
+ Free Lossless Audio Codec library
+
+ http://flac.sourceforge.net/
diff --git a/package/flac/Makefile b/package/flac/Makefile
new file mode 100644
index 000000000..3f3d001cc
--- /dev/null
+++ b/package/flac/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= flac
+PKG_VERSION:= 1.2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 153c8b15a54da428d1f0fadc756c22c7
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=flac/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBFLAC,libflac,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-asm-optimizations \
+ --disable-xmms-plugin \
+ --disable-cpplibs \
+ --disable-ogg
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBFLAC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libFLAC.so* ${IDIR_LIBFLAC}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/flac/ipkg/libflac.control b/package/flac/ipkg/libflac.control
new file mode 100644
index 000000000..ea5079525
--- /dev/null
+++ b/package/flac/ipkg/libflac.control
@@ -0,0 +1,4 @@
+Package: libflac
+Priority: optional
+Section: libs
+Description: Free Lossless Audio Codec library
diff --git a/package/flac/patches/patch-configure b/package/flac/patches/patch-configure
new file mode 100644
index 000000000..830c77407
--- /dev/null
+++ b/package/flac/patches/patch-configure
@@ -0,0 +1,12 @@
+$Id$
+--- flac-1.2.1.orig/configure 2007-09-16 22:05:33.000000000 +0200
++++ flac-1.2.1/configure 2008-08-21 14:57:46.000000000 +0200
+@@ -23490,7 +23490,7 @@ else
+ CPPFLAGS="-DNDEBUG $CPPFLAGS"
+ if test "x$GCC" = xyes; then
+ CPPFLAGS="-DFLaC__INLINE=__inline__ $CPPFLAGS"
+- CFLAGS="-O3 -funroll-loops -finline-functions -Wall -W -Winline $CFLAGS"
++ CFLAGS="-finline-functions -Wall -W -Winline $CFLAGS"
+ fi
+ fi
+
diff --git a/package/flac/patches/patch-src_libFLAC_Makefile_in b/package/flac/patches/patch-src_libFLAC_Makefile_in
new file mode 100644
index 000000000..83c1eeacc
--- /dev/null
+++ b/package/flac/patches/patch-src_libFLAC_Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- flac-1.2.1.orig/src/libFLAC/Makefile.in 2007-09-16 22:05:12.000000000 +0200
++++ flac-1.2.1/src/libFLAC/Makefile.in 2008-08-21 14:54:37.000000000 +0200
+@@ -295,8 +295,6 @@ libFLAC_la_SOURCES = \
+ metadata_iterators.c \
+ metadata_object.c \
+ stream_decoder.c \
+- stream_encoder.c \
+- stream_encoder_framing.c \
+ window.c \
+ $(extra_ogg_sources)
+
diff --git a/package/flac/patches/patch-src_libFLAC_lpc_c b/package/flac/patches/patch-src_libFLAC_lpc_c
new file mode 100644
index 000000000..3bacabaa3
--- /dev/null
+++ b/package/flac/patches/patch-src_libFLAC_lpc_c
@@ -0,0 +1,13 @@
+$Id$
+--- flac-1.2.1.orig/src/libFLAC/lpc.c 2007-09-04 20:15:03.000000000 +0200
++++ flac-1.2.1/src/libFLAC/lpc.c 2008-08-20 15:45:13.000000000 +0200
+@@ -38,9 +38,7 @@
+ #include "FLAC/format.h"
+ #include "private/bitmath.h"
+ #include "private/lpc.h"
+-#if defined DEBUG || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE
+ #include <stdio.h>
+-#endif
+
+ #ifndef FLAC__INTEGER_ONLY_LIBRARY
+
diff --git a/package/fontcacheproto/Config.in b/package/fontcacheproto/Config.in
new file mode 100644
index 000000000..88d73d6b3
--- /dev/null
+++ b/package/fontcacheproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XPROTO
+ prompt "xproto................................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/fontcacheproto/Makefile b/package/fontcacheproto/Makefile
new file mode 100644
index 000000000..7107679d7
--- /dev/null
+++ b/package/fontcacheproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= fontcacheproto
+PKG_VERSION:= 0.1.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= dc8c34a8c3559bf3b008bcdf7ba5a743
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fontsproto/Config.in b/package/fontsproto/Config.in
new file mode 100644
index 000000000..6f267ea8a
--- /dev/null
+++ b/package/fontsproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_FONTSPROTO
+ prompt "fontsproto.............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/fontsproto/Makefile b/package/fontsproto/Makefile
new file mode 100644
index 000000000..e2ba9df3a
--- /dev/null
+++ b/package/fontsproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= fontsproto
+PKG_VERSION:= 2.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6c1efa12ae50262b45c91e9a120632b7
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fping/Config.in b/package/fping/Config.in
new file mode 100644
index 000000000..3fb258d1b
--- /dev/null
+++ b/package/fping/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_FPING
+ prompt "fping............................. A program to ping multiple hosts in parallel"
+ tristate
+ default n
+ help
+ fping is a ping(1) like program which uses the Internet Control Message Protocol
+ (ICMP) echo request to determine if a host is up. fping is different from ping in
+ that you can specify any number of hosts on the command line, or specify a file
+ containing the lists of hosts to ping. Instead of trying one host until it timeouts
+ or replies, fping will send out a ping packet and move on to the next host in a
+ round-robin fashion. If a host replies, it is noted and removed from the list of
+ hosts to check. If a host does not respond within a certain time limit and/or retry
+ limit it will be considered unreachable.
+
+ http://www.fping.com/
diff --git a/package/fping/Makefile b/package/fping/Makefile
new file mode 100644
index 000000000..ce14b9555
--- /dev/null
+++ b/package/fping/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= fping
+PKG_VERSION:= 2.4b2_to
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d5e8be59e307cef76bc479e1684df705
+DISTFILES:= ${PKG_NAME}.tar.gz
+MASTER_SITES:= http://fping.sourceforge.net/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FPING,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+
+do-build:
+ ${MAKE} -j1 CC="${TARGET_CC}" CFLAGS="${TARGET_CFLAGS}" -C ${WRKBUILD} clean ${PKG_NAME}
+ mv ${WRKBUILD}/${PKG_NAME} ${WRKBUILD}/${PKG_NAME}4
+ifeq ($(ADK_IPV6),y)
+ ${MAKE} -j1 CC="${TARGET_CC}" CFLAGS="${TARGET_CFLAGS} -DIPV6=1" -C ${WRKBUILD} clean ${PKG_NAME}
+ mv ${WRKBUILD}/${PKG_NAME} ${WRKBUILD}/${PKG_NAME}6
+
+endif
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_FPING}/usr/bin
+ ${CP} ${WRKBUILD}/${PKG_NAME}4 ${IDIR_FPING}/usr/bin/${PKG_NAME}
+ifeq ($(ADK_IPV6),y)
+ ${CP} ${WRKBUILD}/${PKG_NAME}6 ${IDIR_FPING}/usr/bin/
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fping/ipkg/fping.control b/package/fping/ipkg/fping.control
new file mode 100644
index 000000000..964c8dbf2
--- /dev/null
+++ b/package/fping/ipkg/fping.control
@@ -0,0 +1,4 @@
+Package: fping
+Priority: optional
+Section: net
+Description: A program to ping hosts in parallel
diff --git a/package/fprobe-ulog/Config.in b/package/fprobe-ulog/Config.in
new file mode 100644
index 000000000..990bf17bd
--- /dev/null
+++ b/package/fprobe-ulog/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_FPROBE_ULOG
+ prompt "fprobe-ulog....................... NetFlow probe (ulog-based)"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ A NetFlow probe obtaining packets through linux netfilter code
+ (iptables ULOG target).
+
+ http://fprobe.sourceforge.net/
diff --git a/package/fprobe-ulog/Makefile b/package/fprobe-ulog/Makefile
new file mode 100644
index 000000000..f553204ef
--- /dev/null
+++ b/package/fprobe-ulog/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= fprobe-ulog
+PKG_VERSION:= 1.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cdb2e4edc47e8a3d5479eeabfb979ebc
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=fprobe/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FPROBE_ULOG,fprobe-ulog,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-piddir=/var \
+ --with-membulk=index8 \
+ --with-hash=xor8
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_FPROBE_ULOG}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/fprobe-ulog \
+ ${IDIR_FPROBE_ULOG}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fprobe-ulog/ipkg/fprobe-ulog.control b/package/fprobe-ulog/ipkg/fprobe-ulog.control
new file mode 100644
index 000000000..ac1b35ed8
--- /dev/null
+++ b/package/fprobe-ulog/ipkg/fprobe-ulog.control
@@ -0,0 +1,8 @@
+Package: fprobe-ulog
+Priority: optional
+Section: net
+Depends: libpthread
+Description: NetFlow probe
+ networking tool obtaining packets through linux netfilter code
+ (iptables ULOG target) and emit it as NetFlow flows towards the
+ specified collector
diff --git a/package/fprobe/Config.in b/package/fprobe/Config.in
new file mode 100644
index 000000000..708f66d51
--- /dev/null
+++ b/package/fprobe/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_FPROBE
+ prompt "fprobe............................ NetFlow probe (libpcap-based)"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ A NetFlow probe using libpcap
+
+ http://fprobe.sourceforge.net/
diff --git a/package/fprobe/Makefile b/package/fprobe/Makefile
new file mode 100644
index 000000000..a2cb19b28
--- /dev/null
+++ b/package/fprobe/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= fprobe
+PKG_VERSION:= 1.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 65850d0470078269b33eee58cba77ac2
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=fprobe/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FPROBE,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-piddir=/var \
+ --with-pcap=${STAGING_DIR}/usr/include \
+ --with-libpcap=${STAGING_DIR}/usr/lib \
+ --with-membulk=index8 \
+ --with-hash=xor8 \
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_FPROBE}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/fprobe ${IDIR_FPROBE}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fprobe/ipkg/fprobe.control b/package/fprobe/ipkg/fprobe.control
new file mode 100644
index 000000000..97763667c
--- /dev/null
+++ b/package/fprobe/ipkg/fprobe.control
@@ -0,0 +1,7 @@
+Package: fprobe
+Priority: optional
+Section: net
+Depends: libpcap, libpthread
+Description: NetFlow probe
+ libpcap-based tool that collect network traffic data
+ and emit it as NetFlow flows towards the specified collector
diff --git a/package/freeradius/Config.in b/package/freeradius/Config.in
new file mode 100644
index 000000000..a7a2fa7c1
--- /dev/null
+++ b/package/freeradius/Config.in
@@ -0,0 +1,153 @@
+#menu "freeradius........................ A Flexible RADIUS server implementation"
+
+config ADK_PACKAGE_FREERADIUS
+ prompt "freeradius........................ Flexible RADIUS server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBLTDL
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ A flexible RADIUS server
+
+ http://www.freeradius.org/
+
+ Depends:
+ - libltdl
+ - libopenssl
+ - libpthread
+ - libmysqlclient (for MySQL support)
+ - libopenldap (for LDAP support)
+ - libpq (for PostgreSQL support)
+
+config ADK_PACKAGE_FREERADIUS_DEMOCERTS
+ prompt " freeradius-democerts.......... Demo certificates to test the server"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_CHAP
+ prompt " freeradius-mod-chap........... CHAP module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_DETAIL
+ prompt " freeradius-mod-detail......... Detailed accounting module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_DIGEST
+ prompt " freeradius-mod-digest......... Digest authentication"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_EAP
+ prompt " freeradius-mod-eap............ Base EAP module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_EAP_GTC
+ prompt " freeradius-mod-eap-gtc...... EAP/GTC module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS_MOD_EAP
+
+config ADK_PACKAGE_FREERADIUS_MOD_EAP_MD5
+ prompt " freeradius-mod-eap-md5...... EAP/MD5 module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS_MOD_EAP
+
+config ADK_PACKAGE_FREERADIUS_MOD_EAP_MSCHAPV2
+ prompt " freeradius-mod-eap-mschapv2. EAP/MS-CHAPv2 module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS_MOD_EAP
+
+config ADK_PACKAGE_FREERADIUS_MOD_EAP_PEAP
+ prompt " freeradius-mod-eap-peap..... EAP/PEAP module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS_MOD_EAP
+
+config ADK_PACKAGE_FREERADIUS_MOD_EAP_TLS
+ prompt " freeradius-mod-eap-tls...... EAP/TLS module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS_MOD_EAP
+
+config ADK_PACKAGE_FREERADIUS_MOD_EAP_TTLS
+ prompt " freeradius-mod-eap-ttls... EAP/TTLS module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS_MOD_EAP_TLS
+
+config ADK_PACKAGE_FREERADIUS_MOD_FILES
+ prompt " freeradius-mod-files.......... Module using local files for authorization"
+ tristate
+ default y
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_LDAP
+ prompt " freeradius-mod-ldap........... LDAP module"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENLDAP
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_MSCHAP
+ prompt " freeradius-mod-mschap......... MS-CHAP and MS-CHAPv2 module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_PAP
+ prompt " freeradius-mod-pap............ PAP module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_PREPROCESS
+ prompt " freeradius-mod-preprocess..... Request pre-processing module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_REALM
+ prompt " freeradius-mod-realm.......... Realms handling module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_SQL
+ prompt " freeradius-mod-sql............ Base SQL module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+config ADK_PACKAGE_FREERADIUS_MOD_SQL_MYSQL
+ prompt " freeradius-mod-sql-mysql.... MySQL module"
+ tristate
+ default n
+ depends on ADK_CXX
+ depends ADK_PACKAGE_FREERADIUS_MOD_SQL
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+
+config ADK_PACKAGE_FREERADIUS_MOD_SQL_PGSQL
+ prompt " freeradius-mod-sql-pgsql.... PostgreSQL module"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS_MOD_SQL
+ select ADK_PACKAGE_LIBPQ
+
+config ADK_PACKAGE_FREERADIUS_UTILS
+ prompt " freeradius-utils.............. Misc. client utilities"
+ tristate
+ default n
+ depends ADK_PACKAGE_FREERADIUS
+
+#endmenu
diff --git a/package/freeradius/Makefile b/package/freeradius/Makefile
new file mode 100644
index 000000000..fa9d232cf
--- /dev/null
+++ b/package/freeradius/Makefile
@@ -0,0 +1,195 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= freeradius
+PKG_VERSION:= 2.1.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 07837a2e78028a0fcf5fc3bb5ca292e9
+MASTER_SITES:= ftp://ftp.freeradius.org/pub/radius/ \
+ http://freeradius.portal-to-web.de/ \
+ ftp://ftp.uk.freeradius.org/pub/radius/
+
+DISTFILES:= ${PKG_NAME}-server-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/${PKG_NAME}-server-${PKG_VERSION}
+
+PKG_CONFIGURE_OPTIONS:=
+
+# disabled, problems exist when libldap is installed on hostsystem
+ifneq (${ADK_PACKAGE_FREERADIUS_MOD_LDAP},)
+PKG_CONFIGURE_LIBS+= -lcrypto -lssl
+PKG_CONFIGURE_OPTIONS+= \
+ --with-rlm_ldap-include-dir="${STAGING_DIR}/usr/include" \
+ --with-rlm_ldap-lib-dir="${STAGING_DIR}/usr/lib"
+else
+PKG_CONFIGURE_OPTIONS+= --without-rlm_ldap
+endif
+
+ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_MYSQL},)
+PKG_CONFIGURE_LIBS+= -lz
+PKG_CONFIGURE_OPTIONS+= \
+ --with-mysql-include-dir="${STAGING_DIR}/usr/include" \
+ --with-mysql-lib-dir="${STAGING_DIR}/usr/lib/mysql" \
+ --without-threads \
+ --with-rlm_sql
+else
+PKG_CONFIGURE_OPTIONS+= --without-rlm_sql_mysql
+endif
+ifneq (${ADK_PACKAGE_FREERADIUS_MOD_SQL_PGSQL},)
+PKG_CONFIGURE_OPTIONS+= \
+ --with-rlm_sql_postgresql-include-dir="${STAGING_DIR}/usr/include" \
+ --with-rlm_sql_postgresql-lib-dir="${STAGING_DIR}/usr/lib" \
+ --with-rlm_sql
+else
+PKG_CONFIGURE_OPTIONS+= --without-rlm_sql_postgresql
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+define PKG_mod_template
+
+INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
+
+${2}-install:
+ ${INSTALL_DIR} $${IDIR_${1}}/usr/lib/freeradius
+ for m in ${2}; do \
+ ${CP} ${WRKINST}/usr/lib/freeradius/$$$${m}{,-*}.so \
+ $${IDIR_${1}}/usr/lib/freeradius/ ; \
+ done
+ ${INSTALL_DIR} $${IDIR_${1}}/etc/freeradius
+ for f in ${3}; do \
+ ${CP} ${WRKINST}/etc/freeradius/$$$${f} \
+ $${IDIR_${1}}/etc/freeradius/ ; \
+ done
+endef
+
+$(eval $(call PKG_template,FREERADIUS,freeradius,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_DEMOCERTS,freeradius-democerts,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_CHAP,freeradius-mod-chap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_DETAIL,freeradius-mod-detail,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_DIGEST,freeradius-mod-digest,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_EAP,freeradius-mod-eap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_EAP_GTC,freeradius-mod-eap-gtc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_EAP_MD5,freeradius-mod-eap-md5,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_EAP_MSCHAPV2,freeradius-mod-eap-mschapv2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_EAP_PEAP,freeradius-mod-eap-peap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_EAP_TLS,freeradius-mod-eap-tls,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_EAP_TTLS,freeradius-mod-eap-ttls,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_FILES,freeradius-mod-files,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_LDAP,freeradius-mod-ldap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_MSCHAP,freeradius-mod-mschap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_PAP,freeradius-mod-pap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_PREPROCESS,freeradius-mod-preprocess,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_REALM,freeradius-mod-realm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_SQL,freeradius-mod-sql,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_SQL_MYSQL,freeradius-mod-sql-mysql,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_MOD_SQL_PGSQL,freeradius-mod-sql-pgsql,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,FREERADIUS_UTILS,freeradius-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_CHAP,rlm_chap,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_DETAIL,rlm_detail,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_DIGEST,rlm_digest,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP,libeap rlm_eap,eap.conf))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_GTC,rlm_eap_gtc,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_MD5,rlm_eap_md5,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_MSCHAPV2,rlm_eap_mschapv2,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_PEAP,rlm_eap_peap,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_TLS,rlm_eap_tls,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_EAP_TTLS,rlm_eap_ttls,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_FILES,rlm_files,acct_users preproxy_users users))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_MSCHAP,rlm_mschap,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_LDAP,rlm_ldap,ldap.attrmap))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_PAP,rlm_pap,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_PREPROCESS,rlm_preprocess,hints huntgroups))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_REALM,rlm_realm,proxy.conf))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL,rlm_sql,sql.conf))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_MYSQL,rlm_sql_mysql,))
+$(eval $(call PKG_mod_template,FREERADIUS_MOD_SQL_PGSQL,rlm_sql_postgresql,))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= ${PKG_CONFIGURE_OPTIONS} \
+ --with-openssl-includes=${STAGING_DIR}/usr/include \
+ --with-openssl-libraries=${STAGING_DIR}/usr/lib \
+ --enable-strict-dependencies \
+ --with-raddbdir=/etc/freeradius \
+ --without-edir \
+ --without-snmp \
+ --with-experimental-modules \
+ --without-rlm_attr-rewrite \
+ --without-rlm_checkval \
+ --without-rlm_counter \
+ --without-rlm_dbm \
+ --without-rlm_eap_sim \
+ --without-rlm_example \
+ --without-rlm_ippool \
+ --without-rlm_krb5 \
+ --without-rlm_otp \
+ --without-rlm_smsotp \
+ --without-rlm_pam \
+ --without-rlm_perl \
+ --without-rlm_python \
+ --without-rlm_radutmp \
+ --without-rlm_smb \
+ --without-rlm_sqlcounter \
+ --without-rlm_sql_db2 \
+ --without-rlm_sql_freetds \
+ --without-rlm_sql_iodbc \
+ --without-rlm_sql_oracle \
+ --without-rlm_sql_sybase \
+ --without-rlm_sql_unixodbc \
+ --without-rlm_sql_log \
+ --without-rlm_unix \
+ --without-rlm_eap_ikev2 \
+ --without-rlm_eap_tnc \
+ --without-rlm_opendirectory \
+ --without-rlm_sql_firebird \
+ --without-rlm_sql_sqlite \
+ --libdir=/usr/lib/freeradius \
+ --libexecdir=/usr/lib/freeradius
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+FAKE_FLAGS+= R="${WRKINST}" \
+ INSTALLSTRIP=""
+
+post-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
+ ${INSTALL_DIR} ${IDIR_FREERADIUS}/etc/init.d
+ install -m0755 ./files/radiusd.init \
+ ${IDIR_FREERADIUS}/etc/init.d/radiusd
+ ${INSTALL_DIR} ${IDIR_FREERADIUS}/etc/freeradius
+ ${CP} ./files/users ${IDIR_FREERADIUS}/etc/freeradius/
+ ${INSTALL_DATA} ./files/radiusd.conf ${IDIR_FREERADIUS}/etc/freeradius
+ ${INSTALL_DATA} ./files/clients.conf ${IDIR_FREERADIUS}/etc/freeradius
+ for f in dictionary; do \
+ ${CP} ${WRKINST}/etc/freeradius/$${f} \
+ ${IDIR_FREERADIUS}/etc/freeradius/ ; \
+ done
+ ${INSTALL_DIR} ${IDIR_FREERADIUS}/usr/share/freeradius
+ ${CP} ${WRKINST}/usr/share/freeradius/dictionary \
+ ${IDIR_FREERADIUS}/usr/share/freeradius/
+ for f in freeradius freeradius.internal rfc2865 rfc2866 rfc2867 rfc2868 rfc2869 rfc3162 rfc3576 rfc3580 rfc4072 rfc4372 rfc4675 rfc4679 rfc5176; do \
+ cp ${WRKINST}/usr/share/freeradius/dictionary.$${f} \
+ ${IDIR_FREERADIUS}/usr/share/freeradius/ ; \
+ done
+ ${INSTALL_DIR} ${IDIR_FREERADIUS}/usr/lib/freeradius
+ ${CP} ${WRKINST}/usr/lib/freeradius/libfreeradius-radius{,-*}.so \
+ ${IDIR_FREERADIUS}/usr/lib
+ ${INSTALL_DIR} ${IDIR_FREERADIUS}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/radiusd \
+ ${IDIR_FREERADIUS}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius
+ ${CP} ${WRKINST}/etc/freeradius/certs \
+ ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/
+ rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/README
+ rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/new*
+ rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/index*
+ rm -rf ${IDIR_FREERADIUS_DEMOCERTS}/etc/freeradius/certs/demoCA/serial*
+ ${INSTALL_DIR} ${IDIR_FREERADIUS_UTILS}/usr/bin
+ for f in radclient; do \
+ ${CP} ${WRKINST}/usr/bin/$${f} \
+ ${IDIR_FREERADIUS_UTILS}/usr/bin/ ; \
+ done
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/freeradius/files/clients.conf b/package/freeradius/files/clients.conf
new file mode 100644
index 000000000..6c136a197
--- /dev/null
+++ b/package/freeradius/files/clients.conf
@@ -0,0 +1,7 @@
+## clients.conf -- client configuration directives
+client localhost {
+ ipaddr = 127.0.0.1
+ secret = testing123
+ require_message_authenticator = no
+ nastype = other # localhost isn't usually a NAS...
+}
diff --git a/package/freeradius/files/radiusd.conf b/package/freeradius/files/radiusd.conf
new file mode 100644
index 000000000..b9a573f69
--- /dev/null
+++ b/package/freeradius/files/radiusd.conf
@@ -0,0 +1,73 @@
+## radiusd.conf -- FreeRADIUS server configuration file.
+name = radiusd
+
+prefix = /usr
+exec_prefix = ${prefix}
+sysconfdir = /etc
+localstatedir = /var
+sbindir = ${exec_prefix}/sbin
+logdir = ${localstatedir}/log/radius
+raddbdir = /etc/freeradius
+radacctdir = ${logdir}/radacct
+# Location of config and logfiles.
+confdir = ${raddbdir}
+run_dir = ${localstatedir}/run
+db_dir = ${raddbdir}
+libdir = /usr/lib/freeradius
+pidfile = ${run_dir}/${name}.pid
+user = radius
+group = radius
+#chroot = /path/to/chroot/directory
+
+max_request_time = 30
+cleanup_delay = 5
+max_requests = 1024
+
+listen {
+ type = auth
+ ipaddr = *
+ port = 1812
+}
+
+listen {
+ type = acct
+ ipaddr = *
+ port = 1813
+}
+
+hostname_lookups = no
+allow_core_dumps = no
+regular_expressions = yes
+extended_expressions = yes
+
+log {
+ destination = syslog
+ syslog_facility = daemon
+ stripped_names = no
+ auth = no
+ auth_badpass = no
+ auth_goodpass = no
+}
+
+checkrad = ${sbindir}/checkrad
+
+security {
+ max_attributes = 200
+ reject_delay = 1
+ status_server = yes
+}
+
+$INCLUDE clients.conf
+
+thread pool {
+ start_servers = 4
+ max_servers = 8
+ min_spare_servers = 3
+ max_spare_servers = 10
+ max_requests_per_server = 0
+}
+modules {
+}
+
+instantiate {
+}
diff --git a/package/freeradius/files/radiusd.init b/package/freeradius/files/radiusd.init
new file mode 100644
index 000000000..4e47678da
--- /dev/null
+++ b/package/freeradius/files/radiusd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${radiusd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/log/radius ] || mkdir -p /var/log/radius
+ radiusd
+ ;;
+stop)
+ killall radiusd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/freeradius/files/users b/package/freeradius/files/users
new file mode 100644
index 000000000..df78de04c
--- /dev/null
+++ b/package/freeradius/files/users
@@ -0,0 +1 @@
+steve Auth-Type := Local, User-Password == "testing123"
diff --git a/package/freeradius/ipkg/freeradius-democerts.control b/package/freeradius/ipkg/freeradius-democerts.control
new file mode 100644
index 000000000..c77c62a7a
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-democerts.control
@@ -0,0 +1,5 @@
+Package: freeradius-democerts
+Priority: optional
+Section: net
+Description: a set of certificates to test FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-chap.control b/package/freeradius/ipkg/freeradius-mod-chap.control
new file mode 100644
index 000000000..36f945345
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-chap.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-chap
+Priority: optional
+Section: net
+Description: a CHAP module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-detail.control b/package/freeradius/ipkg/freeradius-mod-detail.control
new file mode 100644
index 000000000..8254c0076
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-detail.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-detail
+Priority: optional
+Section: net
+Description: a detailed accounting module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-digest.control b/package/freeradius/ipkg/freeradius-mod-digest.control
new file mode 100644
index 000000000..aec524320
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-digest.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-digest
+Priority: optional
+Section: net
+Description: digest authentication for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-eap-gtc.control b/package/freeradius/ipkg/freeradius-mod-eap-gtc.control
new file mode 100644
index 000000000..16fd01a4b
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap-gtc.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-eap-gtc
+Priority: optional
+Section: net
+Description: an EAP/GTC module for FreeRADIUS
+Depends: freeradius, freeradius-mod-eap
diff --git a/package/freeradius/ipkg/freeradius-mod-eap-md5.control b/package/freeradius/ipkg/freeradius-mod-eap-md5.control
new file mode 100644
index 000000000..7c060b465
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap-md5.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-eap-md5
+Priority: optional
+Section: net
+Description: an EAP/MD5 module for FreeRADIUS
+Depends: freeradius, freeradius-mod-eap
diff --git a/package/freeradius/ipkg/freeradius-mod-eap-mschapv2.control b/package/freeradius/ipkg/freeradius-mod-eap-mschapv2.control
new file mode 100644
index 000000000..b4e23f483
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap-mschapv2.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-eap-mschapv2
+Priority: optional
+Section: net
+Description: an EAP/MS-CHAPv2 module for FreeRADIUS
+Depends: freeradius, freeradius-mod-eap
diff --git a/package/freeradius/ipkg/freeradius-mod-eap-peap.control b/package/freeradius/ipkg/freeradius-mod-eap-peap.control
new file mode 100644
index 000000000..cfd8aec7e
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap-peap.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-eap-peap
+Priority: optional
+Section: net
+Description: an EAP/PEAP module for FreeRADIUS
+Depends: freeradius, freeradius-mod-eap, freeradius-mod-eap-tls
diff --git a/package/freeradius/ipkg/freeradius-mod-eap-tls.control b/package/freeradius/ipkg/freeradius-mod-eap-tls.control
new file mode 100644
index 000000000..3f09ceb90
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap-tls.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-eap-tls
+Priority: optional
+Section: net
+Description: an EAP/TLS module for FreeRADIUS
+Depends: freeradius, freeradius-mod-eap
diff --git a/package/freeradius/ipkg/freeradius-mod-eap-ttls.control b/package/freeradius/ipkg/freeradius-mod-eap-ttls.control
new file mode 100644
index 000000000..84be74c4e
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap-ttls.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-eap-ttls
+Priority: optional
+Section: net
+Description: an EAP/TTLS module for FreeRADIUS
+Depends: freeradius, freeradius-mod-eap, freeradius-mod-eap-tls
diff --git a/package/freeradius/ipkg/freeradius-mod-eap.conffiles b/package/freeradius/ipkg/freeradius-mod-eap.conffiles
new file mode 100644
index 000000000..7e0e30e73
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap.conffiles
@@ -0,0 +1 @@
+/etc/freeradius/eap.conf
diff --git a/package/freeradius/ipkg/freeradius-mod-eap.control b/package/freeradius/ipkg/freeradius-mod-eap.control
new file mode 100644
index 000000000..f01a045e7
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-eap.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-eap
+Priority: optional
+Section: net
+Description: an EAP module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-files.conffiles b/package/freeradius/ipkg/freeradius-mod-files.conffiles
new file mode 100644
index 000000000..4fcd92bff
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-files.conffiles
@@ -0,0 +1,3 @@
+/etc/freeradius/acct_users
+/etc/freeradius/preproxy_users
+/etc/freeradius/users
diff --git a/package/freeradius/ipkg/freeradius-mod-files.control b/package/freeradius/ipkg/freeradius-mod-files.control
new file mode 100644
index 000000000..5126aa13c
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-files.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-files
+Priority: optional
+Section: net
+Description: a module for FreeRADIUS, using local files for authorization
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-ldap.conffiles b/package/freeradius/ipkg/freeradius-mod-ldap.conffiles
new file mode 100644
index 000000000..ada9fafc1
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-ldap.conffiles
@@ -0,0 +1 @@
+/etc/freeradius/ldap.attrmap
diff --git a/package/freeradius/ipkg/freeradius-mod-ldap.control b/package/freeradius/ipkg/freeradius-mod-ldap.control
new file mode 100644
index 000000000..7649e6ec9
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-ldap.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-ldap
+Priority: optional
+Section: net
+Description: an LDAP module for FreeRADIUS
+Depends: freeradius, libopenldap, libopenssl, libsasl2
diff --git a/package/freeradius/ipkg/freeradius-mod-mschap.control b/package/freeradius/ipkg/freeradius-mod-mschap.control
new file mode 100644
index 000000000..69edfd6f2
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-mschap.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-mschap
+Priority: optional
+Section: net
+Description: an MS-CHAP and MS-CHAPv2 module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-pap.control b/package/freeradius/ipkg/freeradius-mod-pap.control
new file mode 100644
index 000000000..e094b6a7c
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-pap.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-pap
+Priority: optional
+Section: net
+Description: a PAP module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-preprocess.conffiles b/package/freeradius/ipkg/freeradius-mod-preprocess.conffiles
new file mode 100644
index 000000000..b29cca816
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-preprocess.conffiles
@@ -0,0 +1,2 @@
+/etc/freeradius/hints
+/etc/freeradius/huntgroups
diff --git a/package/freeradius/ipkg/freeradius-mod-preprocess.control b/package/freeradius/ipkg/freeradius-mod-preprocess.control
new file mode 100644
index 000000000..7adc171a4
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-preprocess.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-preprocess
+Priority: optional
+Section: net
+Description: a request preprocessing module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-realm.conffiles b/package/freeradius/ipkg/freeradius-mod-realm.conffiles
new file mode 100644
index 000000000..a4d412612
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-realm.conffiles
@@ -0,0 +1 @@
+/etc/freeradius/proxy.conf
diff --git a/package/freeradius/ipkg/freeradius-mod-realm.control b/package/freeradius/ipkg/freeradius-mod-realm.control
new file mode 100644
index 000000000..3f84e3621
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-realm.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-realm
+Priority: optional
+Section: net
+Description: a realm module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-mod-sql-mysql.control b/package/freeradius/ipkg/freeradius-mod-sql-mysql.control
new file mode 100644
index 000000000..532cbd0e6
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-sql-mysql.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-sql-mysql
+Priority: optional
+Section: net
+Description: a MySQL module for FreeRADIUS
+Depends: freeradius, freeradius-mod-sql, libmysqlclient
diff --git a/package/freeradius/ipkg/freeradius-mod-sql-pgsql.control b/package/freeradius/ipkg/freeradius-mod-sql-pgsql.control
new file mode 100644
index 000000000..31e308045
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-sql-pgsql.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-sql-pgsql
+Priority: optional
+Section: net
+Description: a PostgreSQL module for FreeRADIUS
+Depends: freeradius, freeradius-mod-sql, libpq
diff --git a/package/freeradius/ipkg/freeradius-mod-sql.conffiles b/package/freeradius/ipkg/freeradius-mod-sql.conffiles
new file mode 100644
index 000000000..8ab119d07
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-sql.conffiles
@@ -0,0 +1 @@
+/etc/freeradius/sql.conf
diff --git a/package/freeradius/ipkg/freeradius-mod-sql.control b/package/freeradius/ipkg/freeradius-mod-sql.control
new file mode 100644
index 000000000..e4040acb8
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-mod-sql.control
@@ -0,0 +1,5 @@
+Package: freeradius-mod-sql
+Priority: optional
+Section: net
+Description: an SQL module for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius-utils.control b/package/freeradius/ipkg/freeradius-utils.control
new file mode 100644
index 000000000..b29c94dd3
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius-utils.control
@@ -0,0 +1,5 @@
+Package: freeradius-utils
+Priority: optional
+Section: net
+Description: some client utilities for FreeRADIUS
+Depends: freeradius
diff --git a/package/freeradius/ipkg/freeradius.conffiles b/package/freeradius/ipkg/freeradius.conffiles
new file mode 100644
index 000000000..56552e6c1
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius.conffiles
@@ -0,0 +1,2 @@
+/etc/freeradius/clients.conf
+/etc/freeradius/radiusd.conf
diff --git a/package/freeradius/ipkg/freeradius.control b/package/freeradius/ipkg/freeradius.control
new file mode 100644
index 000000000..329d329b1
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius.control
@@ -0,0 +1,5 @@
+Package: freeradius
+Priority: optional
+Section: net
+Description: a flexible RADIUS server
+Depends: libltdl, libopenssl, libpthread
diff --git a/package/freeradius/ipkg/freeradius.postinst b/package/freeradius/ipkg/freeradius.postinst
new file mode 100644
index 000000000..c65fa195f
--- /dev/null
+++ b/package/freeradius/ipkg/freeradius.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf radiusd radiusd NO
+gid=$(get_next_gid)
+add_group radius $gid
+add_user radius $(get_next_uid) $gid /usr/lib/radius
diff --git a/package/freeradius/patches/patch-share_dictionary b/package/freeradius/patches/patch-share_dictionary
new file mode 100644
index 000000000..49b472d43
--- /dev/null
+++ b/package/freeradius/patches/patch-share_dictionary
@@ -0,0 +1,210 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- freeradius-server-2.1.4.orig/share/dictionary 2009-03-11 03:26:50.000000000 +0100
++++ freeradius-server-2.1.4/share/dictionary 2009-04-29 21:42:22.287143645 +0200
+@@ -54,7 +54,7 @@
+ # this directive to the end of this file if you want to see the
+ # old names in the logfiles, INSTEAD OF the new names.
+ #
+-$INCLUDE dictionary.compat
++#$INCLUDE dictionary.compat
+
+ #
+ # Include the RFC dictionaries next.
+@@ -80,109 +80,109 @@ $INCLUDE dictionary.rfc5176
+ #
+ # Include vendor dictionaries after the standard ones.
+ #
+-$INCLUDE dictionary.3com
+-$INCLUDE dictionary.3gpp
+-$INCLUDE dictionary.3gpp2
+-$INCLUDE dictionary.acc
+-$INCLUDE dictionary.airespace
+-$INCLUDE dictionary.alcatel
+-$INCLUDE dictionary.alteon
+-$INCLUDE dictionary.alvarion
+-$INCLUDE dictionary.apc
+-$INCLUDE dictionary.aruba
+-$INCLUDE dictionary.azaire
+-$INCLUDE dictionary.ascend
+-$INCLUDE dictionary.bay
+-$INCLUDE dictionary.bintec
+-$INCLUDE dictionary.cablelabs
+-$INCLUDE dictionary.cabletron
+-$INCLUDE dictionary.cisco
++#$INCLUDE dictionary.3com
++#$INCLUDE dictionary.3gpp
++#$INCLUDE dictionary.3gpp2
++#$INCLUDE dictionary.acc
++#$INCLUDE dictionary.airespace
++#$INCLUDE dictionary.alcatel
++#$INCLUDE dictionary.alteon
++#$INCLUDE dictionary.alvarion
++#$INCLUDE dictionary.apc
++#$INCLUDE dictionary.aruba
++#$INCLUDE dictionary.azaire
++#$INCLUDE dictionary.ascend
++#$INCLUDE dictionary.bay
++#$INCLUDE dictionary.bintec
++#$INCLUDE dictionary.cablelabs
++#$INCLUDE dictionary.cabletron
++#$INCLUDE dictionary.cisco
+ #
+ # The Cisco VPN300 dictionary is the same as the altiga one.
+ # You shouldn't use both at the same time.
+ #
+ #$INCLUDE dictionary.cisco.vpn3000
+-$INCLUDE dictionary.cisco.vpn5000
+-$INCLUDE dictionary.cisco.bbsm
+-$INCLUDE dictionary.clavister
+-$INCLUDE dictionary.colubris
+-$INCLUDE dictionary.cosine
++#$INCLUDE dictionary.cisco.vpn5000
++#$INCLUDE dictionary.cisco.bbsm
++#$INCLUDE dictionary.clavister
++#$INCLUDE dictionary.colubris
++#$INCLUDE dictionary.cosine
+ #$INCLUDE dictionary.dhcp
+-$INCLUDE dictionary.digium
+-$INCLUDE dictionary.epygi
+-$INCLUDE dictionary.erx
+-$INCLUDE dictionary.ericsson
+-$INCLUDE dictionary.extreme
++#$INCLUDE dictionary.digium
++#$INCLUDE dictionary.epygi
++#$INCLUDE dictionary.erx
++#$INCLUDE dictionary.ericsson
++#$INCLUDE dictionary.extreme
+ $INCLUDE dictionary.freeradius
+-$INCLUDE dictionary.freeswitch
+-$INCLUDE dictionary.fortinet
+-$INCLUDE dictionary.foundry
+-$INCLUDE dictionary.gandalf
+-$INCLUDE dictionary.gemtek
+-$INCLUDE dictionary.h3c
+-$INCLUDE dictionary.hp
+-$INCLUDE dictionary.huawei
+-$INCLUDE dictionary.issanni
+-$INCLUDE dictionary.itk
+-$INCLUDE dictionary.ipunplugged
+-$INCLUDE dictionary.juniper
+-$INCLUDE dictionary.jradius
+-$INCLUDE dictionary.karlnet
+-$INCLUDE dictionary.lancom
+-$INCLUDE dictionary.livingston
+-$INCLUDE dictionary.localweb
+-$INCLUDE dictionary.lucent
+-$INCLUDE dictionary.manzara
+-$INCLUDE dictionary.merit
+-$INCLUDE dictionary.microsoft
+-$INCLUDE dictionary.mikrotik
+-$INCLUDE dictionary.navini
+-$INCLUDE dictionary.netscreen
+-$INCLUDE dictionary.networkphysics
+-$INCLUDE dictionary.nexans
+-$INCLUDE dictionary.ntua
+-$INCLUDE dictionary.nokia
++#$INCLUDE dictionary.freeswitch
++#$INCLUDE dictionary.fortinet
++#$INCLUDE dictionary.foundry
++#$INCLUDE dictionary.gandalf
++#$INCLUDE dictionary.gemtek
++#$INCLUDE dictionary.h3c
++#$INCLUDE dictionary.hp
++#$INCLUDE dictionary.huawei
++#$INCLUDE dictionary.issanni
++#$INCLUDE dictionary.itk
++#$INCLUDE dictionary.ipunplugged
++#$INCLUDE dictionary.juniper
++#$INCLUDE dictionary.jradius
++#$INCLUDE dictionary.karlnet
++#$INCLUDE dictionary.lancom
++#$INCLUDE dictionary.livingston
++#$INCLUDE dictionary.localweb
++#$INCLUDE dictionary.lucent
++#$INCLUDE dictionary.manzara
++#$INCLUDE dictionary.merit
++#$INCLUDE dictionary.microsoft
++#$INCLUDE dictionary.mikrotik
++#$INCLUDE dictionary.navini
++#$INCLUDE dictionary.netscreen
++#$INCLUDE dictionary.networkphysics
++#$INCLUDE dictionary.nexans
++#$INCLUDE dictionary.ntua
++#$INCLUDE dictionary.nokia
+ #
+ # Commented out because of attribute conflicts.
+ #
+ #$INCLUDE dictionary.nokia.conflict
+-$INCLUDE dictionary.nomadix
+-$INCLUDE dictionary.nortel
++#$INCLUDE dictionary.nomadix
++#$INCLUDE dictionary.nortel
+ #
+ # Commented out because of attribute conflicts.
+ #
+ #$INCLUDE dictionary.openser
+-$INCLUDE dictionary.packeteer
+-$INCLUDE dictionary.patton
+-$INCLUDE dictionary.propel
+-$INCLUDE dictionary.prosoft
+-$INCLUDE dictionary.quiconnect
+-$INCLUDE dictionary.quintum
+-$INCLUDE dictionary.redback
+-$INCLUDE dictionary.redcreek
+-$INCLUDE dictionary.riverstone
+-$INCLUDE dictionary.roaringpenguin
+-$INCLUDE dictionary.shasta
+-$INCLUDE dictionary.shiva
+-$INCLUDE dictionary.slipstream
+-$INCLUDE dictionary.sonicwall
+-$INCLUDE dictionary.springtide
+-$INCLUDE dictionary.starent
+-$INCLUDE dictionary.telebit
+-$INCLUDE dictionary.trapeze
+-$INCLUDE dictionary.tropos
+-$INCLUDE dictionary.t_systems_nova
+-$INCLUDE dictionary.usr
+-$INCLUDE dictionary.utstarcom
+-$INCLUDE dictionary.valemount
+-$INCLUDE dictionary.versanet
+-$INCLUDE dictionary.vqp
+-$INCLUDE dictionary.waverider
+-$INCLUDE dictionary.walabi
+-$INCLUDE dictionary.wimax
+-$INCLUDE dictionary.wispr
+-$INCLUDE dictionary.xedia
+-$INCLUDE dictionary.xylan
++#$INCLUDE dictionary.packeteer
++#$INCLUDE dictionary.patton
++#$INCLUDE dictionary.propel
++#$INCLUDE dictionary.prosoft
++#$INCLUDE dictionary.quiconnect
++#$INCLUDE dictionary.quintum
++#$INCLUDE dictionary.redback
++#$INCLUDE dictionary.redcreek
++#$INCLUDE dictionary.riverstone
++#$INCLUDE dictionary.roaringpenguin
++#$INCLUDE dictionary.shasta
++#$INCLUDE dictionary.shiva
++#$INCLUDE dictionary.slipstream
++#$INCLUDE dictionary.sonicwall
++#$INCLUDE dictionary.springtide
++#$INCLUDE dictionary.starent
++#$INCLUDE dictionary.telebit
++#$INCLUDE dictionary.trapeze
++#$INCLUDE dictionary.tropos
++#$INCLUDE dictionary.t_systems_nova
++#$INCLUDE dictionary.usr
++#$INCLUDE dictionary.utstarcom
++#$INCLUDE dictionary.valemount
++#$INCLUDE dictionary.versanet
++#$INCLUDE dictionary.vqp
++#$INCLUDE dictionary.waverider
++#$INCLUDE dictionary.walabi
++#$INCLUDE dictionary.wimax
++#$INCLUDE dictionary.wispr
++#$INCLUDE dictionary.xedia
++#$INCLUDE dictionary.xylan
+
+ #
+ # And finally the server internal attributes.
diff --git a/package/freeradius/patches/patch-src_main_event_c b/package/freeradius/patches/patch-src_main_event_c
new file mode 100644
index 000000000..c2067c04e
--- /dev/null
+++ b/package/freeradius/patches/patch-src_main_event_c
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- freeradius-server-2.1.4.orig/src/main/event.c 2009-03-11 03:26:50.000000000 +0100
++++ freeradius-server-2.1.4/src/main/event.c 2009-05-09 23:47:40.000000000 +0200
+@@ -1628,8 +1628,9 @@ static int originated_coa_request(REQUES
+ */
+ request->num_proxied_requests = 1;
+ request->num_proxied_responses = 0;
++#if defined(HAVE_PTHREAD_H)
+ request->child_pid = NO_SUCH_CHILD_PID;
+-
++#endif
+ update_event_timestamp(request->proxy, request->proxy_when.tv_sec);
+
+ request->child_state = REQUEST_PROXIED;
diff --git a/package/freetype/Config.in b/package/freetype/Config.in
new file mode 100644
index 000000000..f860e7ce0
--- /dev/null
+++ b/package/freetype/Config.in
@@ -0,0 +1,24 @@
+config ADK_COMPILE_FREETYPE
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBFREETYPE
+
+config ADK_PACKAGE_LIBFREETYPE
+ tristate "libfreetype....................... A free, high-quality and portable font engine"
+ default n
+ select ADK_COMPILE_FREETYPE
+ select ADK_PACKAGE_ZLIB
+ help
+ The FreeType project is a team of volunteers who develop free,
+ portable and high-quality software solutions for digital typography.
+ They specifically target embedded systems and focus on bringing small,
+ efficient and ubiquitous products.
+
+ The FreeType 2 library is their new software font engine. It has been
+ designed to provide the following important features:
+ * A universal and simple API to manage font files
+ * Support for several font formats through loadable modules
+ * High-quality anti-aliasing
+ * High portability & performance
+
+ http://www.freetype.org/
diff --git a/package/freetype/Makefile b/package/freetype/Makefile
new file mode 100644
index 000000000..0b8664e00
--- /dev/null
+++ b/package/freetype/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libfreetype
+PKG_VERSION:= 2.1.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ec1b903e4be5f073caa72458ea58c29c
+DISTFILES:= freetype-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=freetype/}
+WRKDIST= ${WRKDIR}/freetype-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBFREETYPE,libfreetype,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBFREETYPE}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libfreetype.so.* ${IDIR_LIBFREETYPE}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/freetype/ipkg/libfreetype.control b/package/freetype/ipkg/libfreetype.control
new file mode 100644
index 000000000..c1e0ec54c
--- /dev/null
+++ b/package/freetype/ipkg/libfreetype.control
@@ -0,0 +1,16 @@
+Package: libfreetype
+Priority: optional
+Section: libs
+Depends: zlib
+Description: A free, high-quality and portable font engine.
+ The FreeType project is a team of volunteers who develop free,
+ portable and high-quality software solutions for digital typography.
+ They specifically target embedded systems and focus on bringing small,
+ efficient and ubiquitous products.
+ .
+ The FreeType 2 library is their new software font engine. It has been
+ designed to provide the following important features:
+ * A universal and simple API to manage font files
+ * Support for several font formats through loadable modules
+ * High-quality anti-aliasing
+ * High portability & performance
diff --git a/package/frickin/Config.in b/package/frickin/Config.in
new file mode 100644
index 000000000..599703234
--- /dev/null
+++ b/package/frickin/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_FRICKIN
+ prompt "frickin........................... PPTP (Point-to-Point Tunneling Protocol) proxy"
+ tristate
+ default n
+ help
+ Frickin PPTP Proxy allows a Point-to-Point Tunneling Protocol (PPTP)
+ client to connect to a PPTP server through Network Address
+ Translation (NAT).
+
+ http://frickin.sourceforge.net/
diff --git a/package/frickin/Makefile b/package/frickin/Makefile
new file mode 100644
index 000000000..f8a97743d
--- /dev/null
+++ b/package/frickin/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= frickin
+PKG_VERSION:= 1.3
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 5b2e98da2310c71c703d4617b88a173f
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=frickin/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FRICKIN,frickin,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_FRICKIN}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_FRICKIN}/usr/sbin
+ ${INSTALL_BIN} ./files/frickin.init \
+ ${IDIR_FRICKIN}/etc/init.d/frickin
+ ${INSTALL_BIN} ${WRKBUILD}/frickin ${IDIR_FRICKIN}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/frickin/files/frickin.init b/package/frickin/files/frickin.init
new file mode 100644
index 000000000..2c3a117b3
--- /dev/null
+++ b/package/frickin/files/frickin.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${frickin:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ frickin ${frickin_flags}
+ ;;
+stop)
+ killall frickin
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/frickin/ipkg/frickin.control b/package/frickin/ipkg/frickin.control
new file mode 100644
index 000000000..a8b3fb4f0
--- /dev/null
+++ b/package/frickin/ipkg/frickin.control
@@ -0,0 +1,4 @@
+Package: frickin
+Priority: optional
+Section: net
+Description: PPTP (Point-to-Point Tunneling Protocol) proxy
diff --git a/package/frickin/ipkg/frickin.postinst b/package/frickin/ipkg/frickin.postinst
new file mode 100644
index 000000000..e7dfd069e
--- /dev/null
+++ b/package/frickin/ipkg/frickin.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf frickin frickin NO
+add_rcconf frickin_flags frickin_flags ""
diff --git a/package/fuse/Config.in b/package/fuse/Config.in
new file mode 100644
index 000000000..4841086d3
--- /dev/null
+++ b/package/fuse/Config.in
@@ -0,0 +1,27 @@
+config ADK_COMPILE_FUSE
+ tristate
+ default n
+
+config ADK_PACKAGE_FUSE_UTILS
+ prompt "fuse-utils........................ FUSE utilities"
+ tristate
+ default n
+ select ADK_COMPILE_FUSE
+ select ADK_KPACKAGE_KMOD_FUSE_FS
+ help
+ With FUSE it is possible to implement a fully functional
+ filesystem in a userspace program.
+
+ Features include:
+
+ * Simple library API
+ * Simple installation (no need to patch or recompile the kernel)
+ * Secure implementation
+ * Userspace - kernel interface is very efficient
+ * Usable by non privileged users
+ * Runs on Linux kernels 2.4.X and 2.6.X
+ * Has proven very stable over time
+
+ http://fuse.sourceforge.net/
+
+ This package contains the fusermount userland utility.
diff --git a/package/fuse/Makefile b/package/fuse/Makefile
new file mode 100644
index 000000000..2a8c89e2f
--- /dev/null
+++ b/package/fuse/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= fuse
+PKG_VERSION:= 2.7.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4879f06570d2225667534c37fea04213
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=${PKG_NAME}/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FUSE_UTILS,fuse-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-lib \
+ --disable-shared \
+ --enable-static \
+ --enable-util \
+ --enable-example \
+ --disable-auto-modprobe \
+ --disable-mtab \
+ --disable-kernel-module
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+XAKE_FLAGS+= ARCH='${KERNEL_ARCH}' \
+ CROSS_COMPILE='${TARGET_CROSS}'
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_FUSE_UTILS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/fusermount ${IDIR_FUSE_UTILS}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/fuse/ipkg/fuse-utils.control b/package/fuse/ipkg/fuse-utils.control
new file mode 100644
index 000000000..cfbd7bb18
--- /dev/null
+++ b/package/fuse/ipkg/fuse-utils.control
@@ -0,0 +1,5 @@
+Package: fuse-utils
+Priority: optional
+Section: admin
+Depends: kmod-fuse, libfuse
+Description: Filesystem in Userspace (utilities)
diff --git a/package/fuse/ipkg/libfuse.control b/package/fuse/ipkg/libfuse.control
new file mode 100644
index 000000000..9c3bcb504
--- /dev/null
+++ b/package/fuse/ipkg/libfuse.control
@@ -0,0 +1,5 @@
+Package: libfuse
+Priority: optional
+Section: libs
+Depends: libpthread
+Description: Filesystem in Userspace (library)
diff --git a/package/gatling/Config.in b/package/gatling/Config.in
new file mode 100644
index 000000000..715887855
--- /dev/null
+++ b/package/gatling/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_GATLING
+ prompt "gatling........................... non-forking FAST webserver"
+ tristate
+ default n
+ select ADK_COMPILE_LIBOWFAT
+ select ADK_PACKAGE_LIBICONV
+ help
+ gatling is a high-performance non-forking small webserver.
+
+ http://www.fefe.de/gatling/
diff --git a/package/gatling/Makefile b/package/gatling/Makefile
new file mode 100644
index 000000000..cac5c6ee0
--- /dev/null
+++ b/package/gatling/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= gatling
+PKG_VERSION= 0.8
+PKG_RELEASE= 1
+PKG_MD5SUM= 75e04c0821622ac7c35236bb2a50c31c
+
+MASTER_SITES= http://dl.fefe.de/
+DISTFILES= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GATLING,gatling,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+MAKE_FILE= GNUmakefile
+ALL_TARGET= gatling
+TCPPFLAGS+= -I${STAGING_DIR}/usr/include/owfat
+XAKE_FLAGS+= CC='${TARGET_CC}' \
+ CFLAGS='${TCPPFLAGS} ${TCFLAGS}' \
+ ZLIB=0 DIET= prefix='${WRKINST}/usr'
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_GATLING}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/gatling ${IDIR_GATLING}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gatling/ipkg/gatling.control b/package/gatling/ipkg/gatling.control
new file mode 100644
index 000000000..13bd592c6
--- /dev/null
+++ b/package/gatling/ipkg/gatling.control
@@ -0,0 +1,5 @@
+Package: gatling
+Priority: optional
+Section: net
+Description: non-forking webserver
+Depends: libiconv
diff --git a/package/gatling/patches/patch-GNUmakefile b/package/gatling/patches/patch-GNUmakefile
new file mode 100644
index 000000000..d95051e6e
--- /dev/null
+++ b/package/gatling/patches/patch-GNUmakefile
@@ -0,0 +1,15 @@
+$Id$
+--- gatling-0.8.orig/GNUmakefile Thu May 19 05:30:26 2005
++++ gatling-0.8/GNUmakefile Mon Jul 9 11:52:58 2007
+@@ -96,9 +96,10 @@ libiconv: tryiconv.c
+ dummy.c:
+ touch $@
+
++RANLIB?=ranlib
+ libsocketkludge.a: libsocket libiconv dummy.o
+ ar q $@ dummy.o
+- -ranlib $@
++ -${RANLIB} $@
+
+ LDLIBS+=`cat libsocket libiconv`
+
diff --git a/package/gatling/patches/patch-gatling_c b/package/gatling/patches/patch-gatling_c
new file mode 100644
index 000000000..cd70416de
--- /dev/null
+++ b/package/gatling/patches/patch-gatling_c
@@ -0,0 +1,73 @@
+$Id$
+--- gatling-0.8.orig/gatling.c 2005-05-20 17:32:27.000000000 +0200
++++ gatling-0.8/gatling.c 2007-07-06 17:55:56.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #include <sys/socket.h>
++#include <crypt.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <errno.h>
+@@ -865,24 +866,6 @@ static inline int issafe(unsigned char c
+ return (c!='"' && c!='%' && c>=' ' && c!='+');
+ }
+
+-unsigned long fmt_urlencoded(char* dest,const char* src,unsigned long len) {
+- register const unsigned char* s=(const unsigned char*) src;
+- unsigned long written=0,i;
+- for (i=0; i<len; ++i) {
+- if (!issafe(s[i])) {
+- if (dest) {
+- dest[written]='%';
+- dest[written+1]=fmt_tohex(s[i]>>4);
+- dest[written+2]=fmt_tohex(s[i]&15);
+- }
+- written+=3;
+- } else {
+- if (dest) dest[written]=s[i]; ++written;
+- }
+- }
+- return written;
+-}
+-
+ void catencoded(array* a,char* s) {
+ unsigned int len=str_len(s);
+ char* buf=alloca(fmt_urlencoded(0,s,len));
+@@ -1011,7 +994,7 @@ username2:password2
+ * authentication was OK or -1 if authentication is needed (the HTTP
+ * response was then already written to the iob). */
+ int http_dohtaccess(struct http_data* h) {
+- unsigned long filesize;
++ size_t filesize;
+ char* map;
+ char* s;
+ char* auth;
+@@ -1031,7 +1014,8 @@ int http_dohtaccess(struct http_data* h)
+ char* username,* password;
+ char* decoded;
+ int i;
+- unsigned long l,dl,ul;
++ unsigned long l,ul;
++ size_t dl;
+ auth+=6;
+ while (*auth==' ' || *auth=='\t') ++auth;
+ i=str_chr(auth,'\n');
+@@ -1103,7 +1087,7 @@ int64 http_openfile(struct http_data* h,
+ char* dir=0;
+ char* s;
+ char* args;
+- unsigned long i;
++ size_t i;
+ int64 fd;
+ int doesgzip,doesbzip2;
+
+@@ -2948,7 +2932,7 @@ void forkslave(int fd,buffer* in) {
+ j=str_chr(x,'\n'); if (j && x[j-1]=='\r') { --j; }
+ k=str_chr(x,' ');
+ if (k<j) {
+- unsigned long dl;
++ size_t dl;
+ remoteuser=alloca(20+k-j);
+ i=fmt_str(remoteuser,"REMOTE_USER=");
+ scan_base64(x+k+1,remoteuser+i,&dl);
diff --git a/package/gcc/Config.in b/package/gcc/Config.in
new file mode 100644
index 000000000..2d32d4491
--- /dev/null
+++ b/package/gcc/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_GCC
+ prompt "gcc.......................... GNU Compiler Collection"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBGMP
+ select ADK_PACKAGE_MPFR
+ help
+ GCC
+ http://www.gnu.org/gcc
diff --git a/package/gcc/Makefile b/package/gcc/Makefile
new file mode 100644
index 000000000..01eec05b4
--- /dev/null
+++ b/package/gcc/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+include ${TOPDIR}/toolchain/gcc/Makefile.inc
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GCC,gcc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-languages=c \
+ --enable-shared \
+ --disable-__cxa_atexit \
+ --with-gnu-ld \
+ --disable-libssp \
+ --disable-nls \
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-multilib
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GCC}/usr/lib
+ ${INSTALL_DIR} ${IDIR_GCC}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/gcc ${IDIR_GCC}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gcc/ipkg/gcc.control b/package/gcc/ipkg/gcc.control
new file mode 100644
index 000000000..a34298fec
--- /dev/null
+++ b/package/gcc/ipkg/gcc.control
@@ -0,0 +1,5 @@
+Package: gcc
+Priority: optional
+Section: comp
+Depends: libgmp, mpfr
+Description: gnu compiler
diff --git a/package/gdb/Config.in b/package/gdb/Config.in
new file mode 100644
index 000000000..8ca2081f9
--- /dev/null
+++ b/package/gdb/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_GDB
+ prompt "gdb............................... GNU debugger"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBTHREAD_DB
+ depends on !ADK_LINUX_CRIS_FOXBOARD
+ help
+ GDB is a program for debugging applications.
+
diff --git a/package/gdb/Makefile b/package/gdb/Makefile
new file mode 100644
index 000000000..dc4b736ff
--- /dev/null
+++ b/package/gdb/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+include ${TOPDIR}/toolchain/gdb/Makefile.inc
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GDB,gdb,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TCPPFLAGS+= -L${STAGING_DIR}/usr/lib -L${STAGING_DIR}/lib
+TLDFLAGS+= -L${STAGING_DIR}/usr/lib -L${STAGING_DIR}/lib
+TCFLAGS+= ${TCPPFLAGS} -fPIC
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --without-uiout --enable-gdbmi \
+ --disable-tui --disable-gdbtk --without-x \
+ --without-included-gettext --disable-sim \
+ --enable-threads --with-curses --disable-werror \
+ --enable-static
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= LDFLAGS='${TLDFLAGS}'
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GDB}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/gdb ${IDIR_GDB}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gdb/ipkg/gdb.control b/package/gdb/ipkg/gdb.control
new file mode 100644
index 000000000..43a0a8ad8
--- /dev/null
+++ b/package/gdb/ipkg/gdb.control
@@ -0,0 +1,5 @@
+Package: gdb
+Priority: optional
+Section: devel
+Depends: libthread_db
+Description: GNU Debugger
diff --git a/package/gdbserver/Config.in b/package/gdbserver/Config.in
new file mode 100644
index 000000000..a53d523d6
--- /dev/null
+++ b/package/gdbserver/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_GDBSERVER
+ prompt "gdbserver......................... Remote Server for the GNU Debugger"
+ tristate
+ select ADK_PACKAGE_LIBTHREAD_DB
+ default n
+ help
+ GDBSERVER is a program that allows you to run GDB on a different machine
+ than the one which is running the program being debugged.
diff --git a/package/gdbserver/Makefile b/package/gdbserver/Makefile
new file mode 100644
index 000000000..e4879a4cc
--- /dev/null
+++ b/package/gdbserver/Makefile
@@ -0,0 +1,22 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+include ${TOPDIR}/toolchain/gdb/Makefile.inc
+include ${TOPDIR}/mk/package.mk
+
+WRKSRC= ${WRKDIST}/gdb/gdbserver
+
+$(eval $(call PKG_template,GDBSERVER,gdbserver,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GDBSERVER}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/gdbserver ${IDIR_GDBSERVER}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gdbserver/ipkg/gdbserver.control b/package/gdbserver/ipkg/gdbserver.control
new file mode 100644
index 000000000..f0ab8da6c
--- /dev/null
+++ b/package/gdbserver/ipkg/gdbserver.control
@@ -0,0 +1,5 @@
+Package: gdbserver
+Priority: optional
+Section: devel
+Depends: libthread_db
+Description: Remote Server for the GNU Debugger
diff --git a/package/gettext/Config.in b/package/gettext/Config.in
new file mode 100644
index 000000000..86fd858bb
--- /dev/null
+++ b/package/gettext/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_GETTEXT
+ prompt "gettext........................... internationalisation library"
+ tristate
+ default n
+ help
+ GNU gettext
diff --git a/package/gettext/Makefile b/package/gettext/Makefile
new file mode 100644
index 000000000..dd50230af
--- /dev/null
+++ b/package/gettext/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= gettext
+PKG_VERSION= 0.16.1
+PKG_RELEASE= 1
+PKG_MD5SUM= 3d9ad24301c6d6b17ec30704a13fe127
+MASTER_SITES= ${MASTER_SITE_GNU:=gettext/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}/gettext-runtime
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GETTEXT,gettext,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-java \
+ --disable-native-java \
+ --disable-csharp \
+ --enable-nls \
+ --disable-libasprintf \
+ --enable-threads=posix \
+ --disable-openmp \
+ --with-libiconv-prefix='${STAGING_DIR}/usr' \
+ --with-included-gettext \
+ --without-emacs
+CONFIGURE_ENV+= nls_cv_use_gnu_gettext=yes \
+ ac_cv_gnu_library_2=no \
+ gt_use_preinstalled_gnugettext=no
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GETTEXT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/*.so.* ${IDIR_GETTEXT}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gettext/ipkg/gettext.control b/package/gettext/ipkg/gettext.control
new file mode 100644
index 000000000..f963cda74
--- /dev/null
+++ b/package/gettext/ipkg/gettext.control
@@ -0,0 +1,5 @@
+Package: gettext
+Priority: optional
+Section: libs
+Depends: libiconv, libpthread
+Description: internationalisation library
diff --git a/package/gkrellmd/Config.in b/package/gkrellmd/Config.in
new file mode 100644
index 000000000..836a64d4c
--- /dev/null
+++ b/package/gkrellmd/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_GKRELLMD
+ prompt "gkrellmd.......................... The GNU Krell Monitors Server"
+ tristate
+ default n
+ select ADK_PACKAGE_GLIB1
+ help
+ Gkrellmd Listens for connections from gkrellm clients. When a gkrellm
+ client connects to a gkrellmd server all builtin monitors collect
+ their data from the server.
diff --git a/package/gkrellmd/Makefile b/package/gkrellmd/Makefile
new file mode 100644
index 000000000..badc29b43
--- /dev/null
+++ b/package/gkrellmd/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= gkrellmd
+PKG_VERSION= 2.2.10
+PKG_RELEASE= 7
+PKG_MD5SUM= 518666ce4c2ef5a7db637683778fe18b
+MASTER_SITES= http://members.dslextreme.com/users/billw/gkrellm/
+DISTFILES= gkrellm-${PKG_VERSION}.tar.gz
+
+WRKDIST=${WRKDIR}/gkrellm-${PKG_VERSION}/server
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GKRELLMD,gkrellmd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+MAKE_FLAGS+= GLIB12_INCLUDE="-I${STAGING_DIR}/usr/include/glib-1.2 -I${STAGING_DIR}/usr/lib/glib/include" \
+ GLIB12_LIB="-L${STAGING_DIR}/usr/lib -lglib -lgmodule" \
+ glib12=1
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_GKRELLMD}/usr/bin
+ ${INSTALL_DIR} ${IDIR_GKRELLMD}/etc/init.d
+ ${INSTALL_BIN} ${WRKBUILD}/gkrellmd ${IDIR_GKRELLMD}/usr/bin/
+ ${INSTALL_DATA} ${WRKSRC}/gkrellmd.conf ${IDIR_GKRELLMD}/etc
+ ${INSTALL_BIN} ./files/gkrellmd.init ${IDIR_GKRELLMD}/etc/init.d/gkrellmd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gkrellmd/files/gkrellmd.init b/package/gkrellmd/files/gkrellmd.init
new file mode 100644
index 000000000..a5f3ccf1a
--- /dev/null
+++ b/package/gkrellmd/files/gkrellmd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${gkrellmd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ gkrellmd -d
+ ;;
+stop)
+ killall gkrellmd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/gkrellmd/ipkg/gkrellmd.control b/package/gkrellmd/ipkg/gkrellmd.control
new file mode 100644
index 000000000..13f70a4f1
--- /dev/null
+++ b/package/gkrellmd/ipkg/gkrellmd.control
@@ -0,0 +1,5 @@
+Package: gkrellmd
+Priority: optional
+Section: net
+Depends: glib1
+Description: The GNU Krell Monitors Server
diff --git a/package/gkrellmd/ipkg/gkrellmd.postinst b/package/gkrellmd/ipkg/gkrellmd.postinst
new file mode 100644
index 000000000..56b7b06cc
--- /dev/null
+++ b/package/gkrellmd/ipkg/gkrellmd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf gkrellmd gkrellmd NO
diff --git a/package/glib/Config.in b/package/glib/Config.in
new file mode 100644
index 000000000..7710e5aa1
--- /dev/null
+++ b/package/glib/Config.in
@@ -0,0 +1,17 @@
+config ADK_COMPILE_GLIB
+ tristate
+ depends ADK_PACKAGE_GLIB1
+
+config ADK_PACKAGE_GLIB1
+ prompt "glib1............................. The GLib library of C routines (v1.2)"
+ tristate
+ default n
+ select ADK_COMPILE_GLIB
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ GLib is a library containing many useful C routines for things such
+ as trees, hashes, and lists.
+
+ http://www.gtk.org/
+
+ Depends: libpthread
diff --git a/package/glib/Makefile b/package/glib/Makefile
new file mode 100644
index 000000000..2cf78d0f7
--- /dev/null
+++ b/package/glib/Makefile
@@ -0,0 +1,55 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= glib
+PKG_VERSION:= 1.2.10
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 6fe30dad87c77b91b632def29dd69ef9
+MASTER_SITES:= ftp://ftp.gtk.org/pub/gtk/v1.2/ \
+ http://ftp.gwdg.de/pub/misc/grafik/gimp/gtk/v1.2/ \
+ http://ftp.esat.net/mirrors/ftp.gimp.org/pub/gtk/v1.2/ \
+ http://www.mirrorservice.org/sites/ftp.gimp.org/pub/gtk/v1.2/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GLIB1,glib1,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= glib_cv_sizeof_gmutex=24 \
+ ac_cv_sizeof_char=1 \
+ ac_cv_sizeof_short=2 \
+ ac_cv_sizeof_int=4 \
+ ac_cv_sizeof_long=4 \
+ ac_cv_sizeof_long_long=8 \
+ ac_cv_sizeof_void_p=4 \
+ glib_cv_prog_cc_ansi_proto="no" \
+ glib_cv_has__inline="yes" \
+ glib_cv_has__inline__="yes" \
+ glib_cv_hasinline="yes" \
+ glib_cv_sane_realloc="yes" \
+ glib_cv_va_copy="no" \
+ glib_cv___va_copy="yes" \
+ glib_cv_va_val_copy="yes" \
+ glib_cv_rtldglobal_broken="no" \
+ glib_cv_uscore="no" \
+ ac_cv_func_getpwuid_r="yes" \
+ glib_cv_func_pthread_mutex_trylock_posix="yes" \
+ glib_cv_func_pthread_cond_timedwait_posix="yes" \
+ glib_cv_sizeof_gmutex="24" \
+ glib_cv_byte_contents_gmutex="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GLIB1}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libg{lib,module,thread}-1.2.so.* \
+ ${IDIR_GLIB1}/usr/lib/
+ # needed in staging_dir
+ ${INSTALL_DIR} ${WRKINST}/usr/include/glib-1.2
+ ${CP} ${WRKBUILD}/glibconfig-sysdefs.h ${WRKINST}/usr/include/glib-1.2/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/glib/ipkg/glib1.control b/package/glib/ipkg/glib1.control
new file mode 100644
index 000000000..def028d49
--- /dev/null
+++ b/package/glib/ipkg/glib1.control
@@ -0,0 +1,5 @@
+Package: glib1
+Priority: optional
+Section: libs
+Description: The GLib library of C routines
+Depends: libpthread
diff --git a/package/glib/patches/01-debian-9.patch b/package/glib/patches/01-debian-9.patch
new file mode 100644
index 000000000..20608c0e8
--- /dev/null
+++ b/package/glib/patches/01-debian-9.patch
@@ -0,0 +1,18988 @@
+--- glib1.2-1.2.10.orig/Makefile.in
++++ glib1.2-1.2.10/Makefile.in
+@@ -1,6 +1,6 @@
+-# Makefile.in generated automatically by automake 1.4 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
++# Copyright (C) 1994, 1995-8, 1999, 2001 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.
+@@ -64,8 +64,10 @@
+ AS = @AS@
+ CC = @CC@
+ DLLTOOL = @DLLTOOL@
++ECHO = @ECHO@
+ ENABLE_MEM_CHECK = @ENABLE_MEM_CHECK@
+ ENABLE_MEM_PROFILE = @ENABLE_MEM_PROFILE@
++EXEEXT = @EXEEXT@
+ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@
+ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@
+ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@
+@@ -90,8 +92,10 @@
+ MAINT = @MAINT@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
++OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ RANLIB = @RANLIB@
++STRIP = @STRIP@
+ VERSION = @VERSION@
+
+ AUTOMAKE_OPTIONS = 1.4
+@@ -154,18 +158,20 @@
+ gmain.lo gmem.lo gmessages.lo gmutex.lo gnode.lo gprimes.lo grel.lo \
+ gscanner.lo gslist.lo gstrfuncs.lo gstring.lo gtimer.lo gtree.lo \
+ gutils.lo
++noinst_PROGRAMS = testglib$(EXEEXT) testgdate$(EXEEXT) \
++testgdateparser$(EXEEXT)
+ PROGRAMS = $(noinst_PROGRAMS)
+
+ testglib_SOURCES = testglib.c
+-testglib_OBJECTS = testglib.o
++testglib_OBJECTS = testglib.$(OBJEXT)
+ testglib_DEPENDENCIES = libglib.la
+ testglib_LDFLAGS =
+ testgdate_SOURCES = testgdate.c
+-testgdate_OBJECTS = testgdate.o
++testgdate_OBJECTS = testgdate.$(OBJEXT)
+ testgdate_DEPENDENCIES = libglib.la
+ testgdate_LDFLAGS =
+ testgdateparser_SOURCES = testgdateparser.c
+-testgdateparser_OBJECTS = testgdateparser.o
++testgdateparser_OBJECTS = testgdateparser.$(OBJEXT)
+ testgdateparser_DEPENDENCIES = libglib.la
+ testgdateparser_LDFLAGS =
+ SCRIPTS = $(bin_SCRIPTS)
+@@ -180,22 +186,22 @@
+ HEADERS = $(glibinclude_HEADERS)
+
+ DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
+-Makefile.am Makefile.in NEWS acconfig.h acinclude.m4 aclocal.m4 \
+-config.guess config.h.in config.sub configure configure.in \
+-glib-config.in glib.pc.in glib.spec.in gmodule.pc.in gthread.pc.in \
+-install-sh ltconfig ltmain.sh missing mkinstalldirs
++Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 config.guess \
++config.h.in config.sub configure configure.in glib-config.in glib.pc.in \
++glib.spec.in gmodule.pc.in gthread.pc.in install-sh ltmain.sh missing \
++mkinstalldirs
+
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ SOURCES = $(libglib_la_SOURCES) testglib.c testgdate.c testgdateparser.c
+-OBJECTS = $(libglib_la_OBJECTS) testglib.o testgdate.o testgdateparser.o
++OBJECTS = $(libglib_la_OBJECTS) testglib.$(OBJEXT) testgdate.$(OBJEXT) testgdateparser.$(OBJEXT)
+
+ all: all-redirect
+ .SUFFIXES:
+-.SUFFIXES: .S .c .lo .o .s
++.SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
+
+@@ -203,7 +209,7 @@
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
++$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
+ cd $(srcdir) && $(ACLOCAL)
+
+ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+@@ -277,6 +283,11 @@
+ .c.o:
+ $(COMPILE) -c $<
+
++# FIXME: We should only use cygpath when building on Windows,
++# and only if it is available.
++.c.obj:
++ $(COMPILE) -c `cygpath -w $<`
++
+ .s.o:
+ $(COMPILE) -c $<
+
+@@ -285,6 +296,7 @@
+
+ mostlyclean-compile:
+ -rm -f *.o core *.core
++ -rm -f *.$(OBJEXT)
+
+ clean-compile:
+
+@@ -324,16 +336,16 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-testglib: $(testglib_OBJECTS) $(testglib_DEPENDENCIES)
+- @rm -f testglib
++testglib$(EXEEXT): $(testglib_OBJECTS) $(testglib_DEPENDENCIES)
++ @rm -f testglib$(EXEEXT)
+ $(LINK) $(testglib_LDFLAGS) $(testglib_OBJECTS) $(testglib_LDADD) $(LIBS)
+
+-testgdate: $(testgdate_OBJECTS) $(testgdate_DEPENDENCIES)
+- @rm -f testgdate
++testgdate$(EXEEXT): $(testgdate_OBJECTS) $(testgdate_DEPENDENCIES)
++ @rm -f testgdate$(EXEEXT)
+ $(LINK) $(testgdate_LDFLAGS) $(testgdate_OBJECTS) $(testgdate_LDADD) $(LIBS)
+
+-testgdateparser: $(testgdateparser_OBJECTS) $(testgdateparser_DEPENDENCIES)
+- @rm -f testgdateparser
++testgdateparser$(EXEEXT): $(testgdateparser_OBJECTS) $(testgdateparser_DEPENDENCIES)
++ @rm -f testgdateparser$(EXEEXT)
+ $(LINK) $(testgdateparser_LDFLAGS) $(testgdateparser_OBJECTS) $(testgdateparser_LDADD) $(LIBS)
+
+ install-binSCRIPTS: $(bin_SCRIPTS)
+@@ -463,7 +475,7 @@
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+- test "$$subdir" = "." && dot_seen=yes; \
++ test "$$subdir" != "." || dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+@@ -505,7 +517,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -575,35 +587,6 @@
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
+-garray.lo garray.o : garray.c glib.h glibconfig.h
+-gcache.lo gcache.o : gcache.c glib.h glibconfig.h
+-gcompletion.lo gcompletion.o : gcompletion.c glib.h glibconfig.h
+-gdataset.lo gdataset.o : gdataset.c glib.h glibconfig.h
+-gdate.lo gdate.o : gdate.c config.h glib.h glibconfig.h
+-gerror.lo gerror.o : gerror.c config.h glib.h glibconfig.h
+-ghash.lo ghash.o : ghash.c glib.h glibconfig.h
+-ghook.lo ghook.o : ghook.c glib.h glibconfig.h
+-giochannel.lo giochannel.o : giochannel.c config.h glib.h glibconfig.h
+-giounix.lo giounix.o : giounix.c glib.h glibconfig.h
+-glist.lo glist.o : glist.c glib.h glibconfig.h
+-gmain.lo gmain.o : gmain.c config.h glib.h glibconfig.h
+-gmem.lo gmem.o : gmem.c config.h glib.h glibconfig.h
+-gmessages.lo gmessages.o : gmessages.c config.h glib.h glibconfig.h
+-gmutex.lo gmutex.o : gmutex.c glib.h glibconfig.h
+-gnode.lo gnode.o : gnode.c glib.h glibconfig.h
+-gprimes.lo gprimes.o : gprimes.c glib.h glibconfig.h
+-grel.lo grel.o : grel.c glib.h glibconfig.h
+-gscanner.lo gscanner.o : gscanner.c config.h glib.h glibconfig.h
+-gslist.lo gslist.o : gslist.c glib.h glibconfig.h
+-gstrfuncs.lo gstrfuncs.o : gstrfuncs.c config.h glib.h glibconfig.h
+-gstring.lo gstring.o : gstring.c glib.h glibconfig.h
+-gtimer.lo gtimer.o : gtimer.c config.h glib.h glibconfig.h
+-gtree.lo gtree.o : gtree.c glib.h glibconfig.h
+-gutils.lo gutils.o : gutils.c config.h glibconfig.h glib.h
+-testgdate.o: testgdate.c glib.h glibconfig.h
+-testgdateparser.o: testgdateparser.c glib.h glibconfig.h
+-testglib.o: testglib.c glib.h glibconfig.h
+-
+ info-am:
+ info: info-recursive
+ dvi-am:
+--- glib1.2-1.2.10.orig/aclocal.m4
++++ glib1.2-1.2.10/aclocal.m4
+@@ -1,6 +1,6 @@
+-dnl aclocal.m4 generated automatically by aclocal 1.4
++dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+
+-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
++dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+ dnl with or without modifications, as long as this notice is preserved.
+@@ -10,135 +10,3114 @@
+ dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ dnl PARTICULAR PURPOSE.
+
++# Do all the work for Automake. 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.
+
+-# serial 40 AC_PROG_LIBTOOL
+-AC_DEFUN(AC_PROG_LIBTOOL,
+-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
++# serial 1
++
++dnl Usage:
++dnl AM_INIT_AUTOMAKE(package,version, [no-define])
++
++AC_DEFUN([AM_INIT_AUTOMAKE],
++[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
++AC_REQUIRE([AC_PROG_INSTALL])
++PACKAGE=[$1]
++AC_SUBST(PACKAGE)
++VERSION=[$2]
++AC_SUBST(VERSION)
++dnl test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
++ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
++fi
++ifelse([$3],,
++AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
++AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
++AC_REQUIRE([AM_SANITY_CHECK])
++AC_REQUIRE([AC_ARG_PROGRAM])
++dnl FIXME This is truly gross.
++missing_dir=`cd $ac_aux_dir && pwd`
++AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
++AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
++AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
++AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
++AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
++AC_REQUIRE([AC_PROG_MAKE_SET])])
++
++# Copyright 2002 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++
++# 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.
++AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
++
++# AM_SET_CURRENT_AUTOMAKE_VERSION
++# -------------------------------
++# Call AM_AUTOMAKE_VERSION so it can be traced.
++# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
++AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
++ [AM_AUTOMAKE_VERSION([1.4-p6])])
++
++#
++# Check to make sure that the build environment is sane.
++#
++
++AC_DEFUN([AM_SANITY_CHECK],
++[AC_MSG_CHECKING([whether build environment is sane])
++# Just in case
++sleep 1
++echo timestamp > conftestfile
++# 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 conftestfile 2> /dev/null`
++ if test "[$]*" = "X"; then
++ # -L didn't work.
++ set X `ls -t $srcdir/configure conftestfile`
++ fi
++ if test "[$]*" != "X $srcdir/configure conftestfile" \
++ && test "[$]*" != "X conftestfile $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" = conftestfile
++ )
++then
++ # Ok.
++ :
++else
++ AC_MSG_ERROR([newly created file is older than distributed files!
++Check your system clock])
++fi
++rm -f conftest*
++AC_MSG_RESULT(yes)])
++
++dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
++dnl The program must properly implement --version.
++AC_DEFUN([AM_MISSING_PROG],
++[AC_MSG_CHECKING(for working $2)
++# Run test in a subshell; some versions of sh will print an error if
++# an executable is not found, even if stderr is redirected.
++# Redirect stdin to placate older versions of autoconf. Sigh.
++if ($2 --version) < /dev/null > /dev/null 2>&1; then
++ $1=$2
++ AC_MSG_RESULT(found)
++else
++ $1="$3/missing $2"
++ AC_MSG_RESULT(missing)
++fi
++AC_SUBST($1)])
++
++# Like AC_CONFIG_HEADER, but automatically create stamp file.
++
++AC_DEFUN([AM_CONFIG_HEADER],
++[AC_PREREQ([2.12])
++AC_CONFIG_HEADER([$1])
++dnl When config.status generates a header, we must update the stamp-h file.
++dnl This file resides in the same directory as the config header
++dnl that is generated. We must strip everything past the first ":",
++dnl and everything past the last "/".
++AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
++ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
++<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
++<<am_indx=1
++for am_file in <<$1>>; do
++ case " <<$>>CONFIG_HEADERS " in
++ *" <<$>>am_file "*<<)>>
++ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
++ ;;
++ esac
++ am_indx=`expr "<<$>>am_indx" + 1`
++done<<>>dnl>>)
++changequote([,]))])
+
+-# Save cache, so that ltconfig can load it
+-AC_CACHE_SAVE
++# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+
+-# Actually configure libtool. ac_aux_dir is where install-sh is found.
+-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+-|| AC_MSG_ERROR([libtool configure failed])
++# serial 46 AC_PROG_LIBTOOL
+
+-# Reload cache, that may have been modified by ltconfig
+-AC_CACHE_LOAD
++AC_DEFUN([AC_PROG_LIBTOOL],
++[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+ # This can be used to rebuild libtool when needed
+-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
++LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+ # Always use our own libtool.
+ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+ AC_SUBST(LIBTOOL)dnl
+
+-# Redirect the config.log output again, so that the ltconfig log is not
+-# clobbered by the next message.
+-exec 5>>./config.log
++# Prevent multiple expansion
++define([AC_PROG_LIBTOOL], [])
+ ])
+
+-AC_DEFUN(AC_LIBTOOL_SETUP,
++AC_DEFUN([AC_LIBTOOL_SETUP],
+ [AC_PREREQ(2.13)dnl
+ AC_REQUIRE([AC_ENABLE_SHARED])dnl
+ AC_REQUIRE([AC_ENABLE_STATIC])dnl
+ AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_PROG_LD])dnl
++AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+ AC_REQUIRE([AC_PROG_NM])dnl
++AC_REQUIRE([LT_AC_PROG_SED])dnl
++
+ AC_REQUIRE([AC_PROG_LN_S])dnl
++AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
++AC_REQUIRE([AC_OBJEXT])dnl
++AC_REQUIRE([AC_EXEEXT])dnl
+ dnl
+
+-case "$target" in
+-NONE) lt_target="$host" ;;
+-*) lt_target="$target" ;;
++_LT_AC_PROG_ECHO_BACKSLASH
++# Only perform the check for file, if the check method requires it
++case $deplibs_check_method in
++file_magic*)
++ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
++ AC_PATH_MAGIC
++ fi
++ ;;
+ esac
+
+-# Check for any special flags to pass to ltconfig.
+-libtool_flags="--cache-file=$cache_file"
+-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+-[libtool_flags="$libtool_flags --enable-dlopen"])
++AC_CHECK_TOOL(RANLIB, ranlib, :)
++AC_CHECK_TOOL(STRIP, strip, :)
++
++ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+ ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+-[libtool_flags="$libtool_flags --enable-win32-dll"])
++enable_win32_dll=yes, enable_win32_dll=no)
++
+ AC_ARG_ENABLE(libtool-lock,
+ [ --disable-libtool-lock avoid locking (might break parallel builds)])
+-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
++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
++*-*-irix6*)
++ # Find out which ABI we are using.
++ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
++ if AC_TRY_EVAL(ac_compile); then
++ 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
++ 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_SAVE
++ AC_LANG_C
++ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
++ AC_LANG_RESTORE])
++ 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
++ ;;
++
++ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
++[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
++ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++ AC_CHECK_TOOL(AS, as, false)
++ AC_CHECK_TOOL(OBJDUMP, objdump, false)
++
++ # recent cygwin and mingw systems supply a stub DllMain which the user
++ # can override, but on older systems we have to supply one
++ AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
++ [AC_TRY_LINK([],
++ [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
++ DllMain (0, 0, 0);],
++ [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
++
++ case $host/$CC in
++ *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
++ # old mingw systems require "-dll" to link a DLL, while more recent ones
++ # require "-mdll"
++ SAVE_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -mdll"
++ AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
++ [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
++ CFLAGS="$SAVE_CFLAGS" ;;
++ *-*-cygwin* | *-*-pw32*)
++ # cygwin systems need to pass --dll to the linker, and not link
++ # crt.o which will require a WinMain@16 definition.
++ lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
++ esac
++ ;;
++ ])
++esac
++
++_LT_AC_LTCONFIG_HACK
++
++])
++
++# AC_LIBTOOL_HEADER_ASSERT
++# ------------------------
++AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
++[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
++ [lt_cv_func_assert_works],
++ [case $host in
++ *-*-solaris*)
++ if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
++ case `$CC --version 2>/dev/null` in
++ [[12]].*) lt_cv_func_assert_works=no ;;
++ *) lt_cv_func_assert_works=yes ;;
++ esac
++ fi
++ ;;
++ esac])
++
++if test "x$lt_cv_func_assert_works" = xyes; then
++ AC_CHECK_HEADERS(assert.h)
++fi
++])# AC_LIBTOOL_HEADER_ASSERT
++
++# _LT_AC_CHECK_DLFCN
++# --------------------
++AC_DEFUN([_LT_AC_CHECK_DLFCN],
++[AC_CHECK_HEADERS(dlfcn.h)
++])# _LT_AC_CHECK_DLFCN
++
++# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++# ---------------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
++[AC_REQUIRE([AC_CANONICAL_HOST])
++AC_REQUIRE([AC_PROG_NM])
++AC_REQUIRE([AC_OBJEXT])
++# Check for command to grab the raw symbol name followed by C symbol from nm.
++AC_MSG_CHECKING([command to parse $NM output])
++AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
++
++# 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]]*\)'
++
++# Transform the above into a raw symbol and a C symbol.
++symxfrm='\1 \2\3 \3'
++
++# Transform an extracted symbol line into a proper C declaration
++lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
++
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
++# Define system-specific variables.
++case $host_os in
++aix*)
++ symcode='[[BCDT]]'
++ ;;
++cygwin* | mingw* | pw32*)
++ symcode='[[ABCDGISTW]]'
++ ;;
++hpux*) # Its linker distinguishes data from code symbols
++ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++ ;;
++irix* | nonstopux*)
++ symcode='[[BCDEGRST]]'
++ ;;
++osf*)
++ symcode='[[BCDEGQRST]]'
++ ;;
++solaris* | sysv5*)
++ symcode='[[BDT]]'
++ ;;
++sysv4)
++ symcode='[[DFNSTU]]'
++ ;;
++esac
++
++# Handle CRLF in mingw tool chain
++opt_cr=
++case $host_os in
++mingw*)
++ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
++ ;;
++esac
++
++# If we're using GNU nm, then use its standard symbol codes.
++if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
++ symcode='[[ABCDGISTW]]'
++fi
++
++# Try without a prefix undercore, then with it.
++for ac_symprfx in "" "_"; do
++
++ # Write the raw and C identifiers.
++lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
++
++ # Check to see that the pipe works correctly.
++ pipe_works=no
++ rm -f conftest*
++ cat > conftest.$ac_ext <<EOF
++#ifdef __cplusplus
++extern "C" {
++#endif
++char nm_test_var;
++void nm_test_func(){}
++#ifdef __cplusplus
++}
++#endif
++int main(){nm_test_var='a';nm_test_func();return(0);}
++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 egrep ' nm_test_var$' "$nlist" >/dev/null; then
++ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
++ cat <<EOF > conftest.$ac_ext
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++EOF
++ # Now generate the symbol file.
++ eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
++
++ cat <<EOF >> conftest.$ac_ext
++#if defined (__STDC__) && __STDC__
++# define lt_ptr void *
++#else
++# define lt_ptr char *
++# define const
++#endif
++
++/* The mapping between symbol names and symbols. */
++const struct {
++ const char *name;
++ lt_ptr address;
++}
++lt_preloaded_symbols[[]] =
++{
++EOF
++ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
++ cat <<\EOF >> conftest.$ac_ext
++ {0, (lt_ptr) 0}
++};
++
++#ifdef __cplusplus
++}
++#endif
++EOF
++ # Now try linking the two files.
++ mv conftest.$ac_objext conftstm.$ac_objext
++ save_LIBS="$LIBS"
++ save_CFLAGS="$CFLAGS"
++ LIBS="conftstm.$ac_objext"
++ CFLAGS="$CFLAGS$no_builtin_flag"
++ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
++ pipe_works=yes
++ fi
++ LIBS="$save_LIBS"
++ CFLAGS="$save_CFLAGS"
++ else
++ echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
++ fi
++ else
++ echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
++ fi
++ else
++ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
++ fi
++ else
++ echo "$progname: failed program was:" >&AC_FD_CC
++ cat conftest.$ac_ext >&5
++ fi
++ rm -f 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
++])
++global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
++if test -z "$lt_cv_sys_global_symbol_pipe"; then
++ global_symbol_to_cdecl=
++ global_symbol_to_c_name_address=
++else
++ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
++ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
++fi
++if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
++then
++ AC_MSG_RESULT(failed)
++else
++ AC_MSG_RESULT(ok)
++fi
++]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++
++# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
++# ---------------------------------
++AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
++[# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
++
++# _LT_AC_PROG_ECHO_BACKSLASH
++# --------------------------
++# Add some code to the start of the generated configure script which
++# will find an echo command which doesn't interpret backslashes.
++AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
++[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
++ [AC_DIVERT_PUSH(NOTICE)])
++_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
++
++# Check that we are running under the correct shell.
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++case X$ECHO in
++X*--fallback-echo)
++ # Remove one level of quotation (which was required for Make).
++ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
++ ;;
++esac
++
++echo=${ECHO-echo}
++if test "X[$]1" = X--no-reexec; then
++ # Discard the --no-reexec flag, and continue.
++ shift
++elif test "X[$]1" = X--fallback-echo; then
++ # Avoid inline document here, it may be left over
++ :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
++ # Yippee, $echo works!
++ :
++else
++ # Restart under the correct shell.
++ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
++fi
++
++if test "X[$]1" = X--fallback-echo; then
++ # used as fallback echo
++ shift
++ cat <<EOF
++$*
++EOF
++ exit 0
++fi
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++if test -z "$ECHO"; then
++if test "X${echo_test_string+set}" != Xset; then
++# find a string as large as possible, as long as the shell can cope with it
++ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
++ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
++ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
++ echo_test_string="`eval $cmd`" &&
++ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
++ then
++ break
++ fi
++ done
++fi
++
++if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ :
++else
++ # The Solaris, AIX, and Digital Unix default echo programs unquote
++ # backslashes. This makes it impossible to quote backslashes using
++ # echo "$something" | sed 's/\\/\\\\/g'
++ #
++ # So, first we look for a working echo in the user's PATH.
++
++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for dir in $PATH /usr/ucb; do
++ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
++ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$dir/echo"
++ break
++ fi
++ done
++ IFS="$save_ifs"
++
++ if test "X$echo" = Xecho; then
++ # We didn't find a better echo, so look for alternatives.
++ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # This shell has a builtin print -r that does the trick.
++ echo='print -r'
++ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
++ test "X$CONFIG_SHELL" != X/bin/ksh; then
++ # If we have ksh, try running configure again with it.
++ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
++ export ORIGINAL_CONFIG_SHELL
++ CONFIG_SHELL=/bin/ksh
++ export CONFIG_SHELL
++ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
++ else
++ # Try using printf.
++ echo='printf %s\n'
++ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # Cool, printf works
++ :
++ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
++ export CONFIG_SHELL
++ SHELL="$CONFIG_SHELL"
++ export SHELL
++ echo="$CONFIG_SHELL [$]0 --fallback-echo"
++ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$CONFIG_SHELL [$]0 --fallback-echo"
++ else
++ # maybe with a smaller string...
++ prev=:
++
++ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
++ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
++ then
++ break
++ fi
++ prev="$cmd"
++ done
++
++ if test "$prev" != 'sed 50q "[$]0"'; then
++ echo_test_string=`eval $prev`
++ export echo_test_string
++ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
++ else
++ # Oops. We lost completely, so just stick with echo.
++ echo=echo
++ fi
++ fi
++ fi
++ fi
++fi
++fi
++
++# Copy echo and quote the copy suitably for passing to libtool from
++# the Makefile, instead of quoting the original, which is used later.
++ECHO=$echo
++if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
++ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
++fi
++
++AC_SUBST(ECHO)
++AC_DIVERT_POP
++])# _LT_AC_PROG_ECHO_BACKSLASH
++
++# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
++# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
++# ------------------------------------------------------------------
++AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
++[if test "$cross_compiling" = yes; then :
++ [$4]
++else
++ AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
++ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
++ lt_status=$lt_dlunknown
++ cat > conftest.$ac_ext <<EOF
++[#line __oline__ "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}]
++EOF
++ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 2>/dev/null
++ lt_status=$?
++ case x$lt_status in
++ x$lt_dlno_uscore) $1 ;;
++ x$lt_dlneed_uscore) $2 ;;
++ x$lt_unknown|x*) $3 ;;
++ esac
++ else :
++ # compilation failed
++ $3
++ fi
++fi
++rm -fr conftest*
++])# _LT_AC_TRY_DLOPEN_SELF
++
++# AC_LIBTOOL_DLOPEN_SELF
++# -------------------
++AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
++[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
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ lt_cv_dlopen="LoadLibrary"
++ lt_cv_dlopen_libs=
++ ;;
++
++ *)
++ 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="-dld"],
++ [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="-dld"])
++ ])
++ ])
++ ])
++ ])
++ ])
++ ;;
++ 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"
++ AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
++ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
++
++ save_LDFLAGS="$LDFLAGS"
++ 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_AC_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
++ LDFLAGS="$LDFLAGS $link_static_flag"
++ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
++ lt_cv_dlopen_self_static, [dnl
++ _LT_AC_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
++])# AC_LIBTOOL_DLOPEN_SELF
++
++AC_DEFUN([_LT_AC_LTCONFIG_HACK],
++[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed='sed -e s/^X//'
++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'
++
++# Constants:
++rm="rm -f"
++
++# Global variables:
++default_ofile=libtool
++can_build_shared=yes
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++ltmain="$ac_aux_dir/ltmain.sh"
++ofile="$default_ofile"
++with_gnu_ld="$lt_cv_prog_gnu_ld"
++need_locks="$enable_libtool_lock"
++
++old_CC="$CC"
++old_CFLAGS="$CFLAGS"
++
++# Set sane defaults for various variables
++test -z "$AR" && AR=ar
++test -z "$AR_FLAGS" && AR_FLAGS=cru
++test -z "$AS" && AS=as
++test -z "$CC" && CC=cc
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++test -z "$LD" && LD=ld
++test -z "$LN_S" && LN_S="ln -s"
++test -z "$MAGIC_CMD" && MAGIC_CMD=file
++test -z "$NM" && NM=nm
++test -z "$OBJDUMP" && OBJDUMP=objdump
++test -z "$RANLIB" && RANLIB=:
++test -z "$STRIP" && STRIP=:
++test -z "$ac_objext" && ac_objext=o
++
++if test x"$host" != x"$build"; then
++ ac_tool_prefix=${host_alias}-
++else
++ ac_tool_prefix=
++fi
++
++# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
++case $host_os in
++linux-gnu*) ;;
++linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
++esac
++
++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
++
++# Determine commands to create old-style static archives.
++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
++old_postinstall_cmds='chmod 644 $oldlib'
++old_postuninstall_cmds=
++
++if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++fi
++
++# Allow CC to be a program name with arguments.
++set dummy $CC
++compiler="[$]2"
++
++AC_MSG_CHECKING([for objdir])
++rm -f .libs 2>/dev/null
++mkdir .libs 2>/dev/null
++if test -d .libs; then
++ objdir=.libs
++else
++ # MS-DOS does not allow filenames that begin with a dot.
++ objdir=_libs
++fi
++rmdir .libs 2>/dev/null
++AC_MSG_RESULT($objdir)
++
++
++AC_ARG_WITH(pic,
++[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
++pic_mode="$withval", pic_mode=default)
++test -z "$pic_mode" && pic_mode=default
++
++# We assume here that the value for lt_cv_prog_cc_pic will not be cached
++# in isolation, and that seeing it set (from the cache) indicates that
++# the associated values are set (in the cache) correctly too.
++AC_MSG_CHECKING([for $compiler option to produce PIC])
++AC_CACHE_VAL(lt_cv_prog_cc_pic,
++[ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_shlib=
++ lt_cv_prog_cc_wl=
++ lt_cv_prog_cc_static=
++ lt_cv_prog_cc_no_builtin=
++ lt_cv_prog_cc_can_build_shared=$can_build_shared
++
++ if test "$GCC" = yes; then
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-static'
++
++ case $host_os in
++ aix*)
++ # Below there is a dirty hack to force normal static linking with -ldl
++ # The problem is because libdl dynamically linked with both libc and
++ # libC (AIX C++ library), which obviously doesn't included in libraries
++ # list by gcc. This cause undefined symbols with -static flags.
++ # This hack allows C programs to be linked with "-static -ldl", but
++ # not sure about C++ programs.
++ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
++ ;;
++ amigaos*)
++ # 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
++ ;;
++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++ # PIC is the default for these OSes.
++ ;;
++ darwin* | rhapsody*)
++ # PIC is the default on this platform
++ # Common symbols not allowed in MH_DYLIB files
++ lt_cv_prog_cc_pic='-fno-common'
++ ;;
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ lt_cv_prog_cc_pic=-Kconform_pic
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic='-fPIC'
++ ;;
++ esac
++ else
++ # PORTME Check for PIC flags for the system compiler.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ lt_cv_prog_cc_wl='-Wl,'
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ lt_cv_prog_cc_static='-Bstatic'
++ else
++ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ fi
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
++ lt_cv_prog_cc_pic='+Z'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ # PIC (with -KPIC) is the default.
++ ;;
++
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++
++ newsos6)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ osf3* | osf4* | osf5*)
++ # All OSF/1 code is PIC.
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ ;;
++
++ sco3.2v5*)
++ lt_cv_prog_cc_pic='-Kpic'
++ lt_cv_prog_cc_static='-dn'
++ lt_cv_prog_cc_shlib='-belf'
++ ;;
++
++ solaris*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ sunos4*)
++ lt_cv_prog_cc_pic='-PIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Qoption ld '
++ ;;
++
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ uts4*)
++ lt_cv_prog_cc_pic='-pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ sysv4*MP*)
++ if test -d /usr/nec ;then
++ lt_cv_prog_cc_pic='-Kconform_pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ fi
++ ;;
++
++ *)
++ lt_cv_prog_cc_can_build_shared=no
++ ;;
++ esac
++ fi
++])
++if test -z "$lt_cv_prog_cc_pic"; then
++ AC_MSG_RESULT([none])
++else
++ AC_MSG_RESULT([$lt_cv_prog_cc_pic])
++
++ # Check to make sure the pic_flag actually works.
++ AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
++ AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
++ AC_TRY_COMPILE([], [], [dnl
++ case $host_os in
++ hpux9* | hpux10* | hpux11*)
++ # On HP-UX, both CC and GCC only warn that PIC is supported... then
++ # they create non-PIC objects. So, if there were any warnings, we
++ # assume that PIC is not supported.
++ if test -s conftest.err; then
++ lt_cv_prog_cc_pic_works=no
++ else
++ lt_cv_prog_cc_pic_works=yes
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic_works=yes
++ ;;
++ esac
++ ], [dnl
++ lt_cv_prog_cc_pic_works=no
++ ])
++ CFLAGS="$save_CFLAGS"
++ ])
++
++ if test "X$lt_cv_prog_cc_pic_works" = Xno; then
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_can_build_shared=no
++ else
++ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
++ fi
++
++ AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
++fi
++
++# Check for any special shared library compilation flags.
++if test -n "$lt_cv_prog_cc_shlib"; then
++ AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
++ if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
++ else
++ AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
++ lt_cv_prog_cc_can_build_shared=no
++ fi
++fi
++
++AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
++AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
++ lt_cv_prog_cc_static_works=no
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
++ AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
++ LDFLAGS="$save_LDFLAGS"
++])
++
++# Belt *and* braces to stop my trousers falling down:
++test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
++AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
++
++pic_flag="$lt_cv_prog_cc_pic"
++special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
++wl="$lt_cv_prog_cc_wl"
++link_static_flag="$lt_cv_prog_cc_static"
++no_builtin_flag="$lt_cv_prog_cc_no_builtin"
++can_build_shared="$lt_cv_prog_cc_can_build_shared"
++
++
++# Check to see if options -o and -c are simultaneously supported by compiler
++AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
++AC_CACHE_VAL([lt_cv_compiler_c_o], [
++$rm -r conftest 2>/dev/null
++mkdir conftest
++cd conftest
++echo "int some_variable = 0;" > conftest.$ac_ext
++mkdir out
++# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
++# that will create temporary files in the current directory regardless of
++# the output directory. Thus, making CWD read-only will cause this test
++# to fail, enabling locking or at least warning the user not to do parallel
++# builds.
++chmod -w .
++save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
++compiler_c_o=no
++if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
++ if test -s out/conftest.err; then
++ lt_cv_compiler_c_o=no
++ else
++ lt_cv_compiler_c_o=yes
++ fi
++else
++ # Append any errors to the config.log.
++ cat out/conftest.err 1>&AC_FD_CC
++ lt_cv_compiler_c_o=no
++fi
++CFLAGS="$save_CFLAGS"
++chmod u+w .
++$rm conftest* out/*
++rmdir out
++cd ..
++rmdir conftest
++$rm -r conftest 2>/dev/null
++])
++compiler_c_o=$lt_cv_compiler_c_o
++AC_MSG_RESULT([$compiler_c_o])
++
++if test x"$compiler_c_o" = x"yes"; then
++ # Check to see if we can write to a .lo
++ AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
++ AC_CACHE_VAL([lt_cv_compiler_o_lo], [
++ lt_cv_compiler_o_lo=no
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -c -o conftest.lo"
++ save_objext="$ac_objext"
++ ac_objext=lo
++ AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ lt_cv_compiler_o_lo=no
++ else
++ lt_cv_compiler_o_lo=yes
++ fi
++ ])
++ ac_objext="$save_objext"
++ CFLAGS="$save_CFLAGS"
++ ])
++ compiler_o_lo=$lt_cv_compiler_o_lo
++ AC_MSG_RESULT([$compiler_o_lo])
++else
++ compiler_o_lo=no
++fi
++
++# Check to see if we can do hard links to lock some files if needed
++hard_links="nottested"
++if test "$compiler_c_o" = 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
++
++if test "$GCC" = yes; then
++ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
++ AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
++ echo "int some_variable = 0;" > conftest.$ac_ext
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
++ compiler_rtti_exceptions=no
++ AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ compiler_rtti_exceptions=no
++ else
++ compiler_rtti_exceptions=yes
++ fi
++ ])
++ CFLAGS="$save_CFLAGS"
++ AC_MSG_RESULT([$compiler_rtti_exceptions])
++
++ if test "$compiler_rtti_exceptions" = "yes"; then
++ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
++ else
++ no_builtin_flag=' -fno-builtin'
++ fi
++fi
++
++# See if the linker supports building shared libraries.
++AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
++
++allow_undefined_flag=
++no_undefined_flag=
++need_lib_prefix=unknown
++need_version=unknown
++# when you set need_version to no, make sure it does not cause -set_version
++# flags to be left without arguments
++archive_cmds=
++archive_expsym_cmds=
++old_archive_from_new_cmds=
++old_archive_from_expsyms_cmds=
++export_dynamic_flag_spec=
++whole_archive_flag_spec=
++thread_safe_flag_spec=
++hardcode_into_libs=no
++hardcode_libdir_flag_spec=
++hardcode_libdir_separator=
++hardcode_direct=no
++hardcode_minus_L=no
++hardcode_shlibpath_var=unsupported
++runpath_var=
++link_all_deplibs=unknown
++always_export_symbols=no
++export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
++# include_expsyms should be a list of space-separated symbols to be *always*
++# included in the symbol list
++include_expsyms=
++# exclude_expsyms can be an egrep regular expression 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_"
++# 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.
++extract_expsyms_cmds=
++
++case $host_os in
++cygwin* | mingw* | pw32*)
++ # 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
++ ;;
++openbsd*)
++ with_gnu_ld=no
++ ;;
++esac
++
++ld_shlibs=yes
++if test "$with_gnu_ld" = yes; then
++ # If archive_cmds runs LD, not CC, wlarc should be empty
++ wlarc='${wl}'
++
++ # See if GNU ld supports shared libraries.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ # On AIX, the GNU linker is very broken
++ # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
++ ld_shlibs=no
++ cat <<EOF 1>&2
++
++*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
++*** so that a non-GNU linker is found, and then restart.
++
++EOF
++ ;;
++
++ amigaos*)
++ 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
++
++ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++ # that the semantics of dynamic libraries on AmigaOS, at least up
++ # to version 4, is to share data among multiple programs linked
++ # with the same dynamic library. Since this doesn't match the
++ # behavior of shared libraries on other platforms, we can use
++ # them.
++ ld_shlibs=no
++ ;;
++
++ beos*)
++ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
++ allow_undefined_flag=unsupported
++ # Joseph Beckenbach <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*)
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec='-L$libdir'
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++
++ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
++ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
++ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
++ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
++ else $CC -o impgen impgen.c ; fi)~
++ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
++
++ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
++
++ # cygwin and mingw dlls have different entry points and sets of symbols
++ # to exclude.
++ # FIXME: what about values for MSVC?
++ dll_entry=__cygwin_dll_entry@12
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
++ case $host_os in
++ mingw*)
++ # mingw values
++ dll_entry=_DllMainCRTStartup@12
++ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
++ ;;
++ esac
++
++ # mingw and cygwin differ, and it's simplest to just exclude the union
++ # of the two symbol sets.
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
++
++ # recent cygwin and mingw systems supply a stub DllMain which the user
++ # can override, but on older systems we have to supply one (in ltdll.c)
++ if test "x$lt_cv_need_dllmain" = "xyes"; then
++ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
++ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
++ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
++ else
++ ltdll_obj=
++ ltdll_cmds=
++ fi
++
++ # Extract the symbol export list from an `--export-all' def file,
++ # then regenerate the def file from the symbol export list, so that
++ # the compiled dll only exports the symbol export list.
++ # Be careful not to strip the DATA tag left be newer dlltools.
++ export_symbols_cmds="$ltdll_cmds"'
++ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
++ sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
++
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is.
++ # If DATA tags from a recent dlltool are present, honour them!
++ 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;
++ _lt_hint=1;
++ cat $export_symbols | while read symbol; do
++ set dummy \$symbol;
++ case \[$]# in
++ 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
++ 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
++ *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
++ esac;
++ _lt_hint=`expr 1 + \$_lt_hint`;
++ done;
++ fi~
++ '"$ltdll_cmds"'
++ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
++ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
++ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
++ ;;
++
++ 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ fi
++ ;;
++
++ solaris* | sysv5*)
++ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
++ ld_shlibs=no
++ cat <<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.
++
++EOF
++ elif $LD --help 2>&1 | egrep ': 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
++ ;;
++
++ 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 | egrep ': 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" = yes; then
++ runpath_var=LD_RUN_PATH
++ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
++ export_dynamic_flag_spec='${wl}--export-dynamic'
++ case $host_os in
++ cygwin* | mingw* | pw32*)
++ # dlltool doesn't understand --whole-archive et. al.
++ whole_archive_flag_spec=
++ ;;
++ *)
++ # ancient GNU ld didn't support --whole-archive et. al.
++ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
++ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ else
++ whole_archive_flag_spec=
++ fi
++ ;;
++ esac
++ fi
++else
++ # PORTME fill in a description of your system's linker (not GNU ld)
++ 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 "$link_static_flag"; then
++ # Neither direct hardcoding nor static linking is supported with a
++ # broken collect2.
++ hardcode_direct=unsupported
++ fi
++ ;;
++
++ aix4* | aix5*)
++ 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]].*|aix5*)
++ 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.
++
++ hardcode_direct=yes
++ archive_cmds=''
++ hardcode_libdir_separator=':'
++ if test "$GCC" = yes; then
++ case $host_os in aix4.[[012]]|aix4.[[012]].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ # It fails to find uninstalled libraries when the uninstalled
++ # path is not listed in the libpath. Setting hardcode_minus_L
++ # to unsupported forces relinking
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++
++ shared_flag='-shared'
++ else
++ # not using gcc
++ if test "$host_cpu" = ia64; then
++ shared_flag='${wl}-G'
++ else
++ if test "$aix_use_runtimelinking" = yes; then
++ shared_flag='${wl}-G'
++ else
++ shared_flag='${wl}-bM:SRE'
++ fi
++ fi
++ fi
++
++ # It seems that -bexpall can do strange things, 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'
++ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
++ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ else
++ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Warning - without using the other run time loading flags,
++ # -berok will link without error, but may produce a broken library.
++ allow_undefined_flag='${wl}-berok'
++ # This is a bit strange, but is similar to how AIX traditionally builds
++ # it's shared libraries.
++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
++ fi
++ fi
++ ;;
++
++ amigaos*)
++ 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
++ # see comment about different semantics on the GNU ld section
++ ld_shlibs=no
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ # 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
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''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"`'
++ ;;
++
++ darwin* | rhapsody*)
++ case "$host_os" in
++ rhapsody* | darwin1.[[012]])
++ allow_undefined_flag='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ allow_undefined_flag='-flat_namespace -undefined suppress'
++ ;;
++ esac
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
++ # `"' quotes if we put them in here... so don't!
++ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
++ # We need to add '_' to the symbols in $export_symbols first
++ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ whole_archive_flag_spec='-all_load $convenience'
++ ;;
++
++ freebsd1*)
++ ld_shlibs=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*)
++ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ case $host_os in
++ hpux9*) 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' ;;
++ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
++ esac
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=yes
++ hardcode_minus_L=yes # Not in the search PATH, but as the default
++ # location of the library.
++ export_dynamic_flag_spec='${wl}-E'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ else
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ 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
++ ;;
++
++ openbsd*)
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ 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'
++ 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
++ ;;
++
++ 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ else
++ allow_undefined_flag=' -expect_unresolved \*'
++ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ fi
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++
++ osf4* | osf5*) # as osf3* with the addition of -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" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
++ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
++
++ #Both c and cxx compiler support -rpath directly
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ ;;
++
++ sco3.2v5*)
++ 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
++ export_dynamic_flag_spec='${wl}-Bexport'
++ ;;
++
++ solaris*)
++ # gcc --version < 3.0 without binutils cannot create self contained
++ # shared libraries reliably, requiring libgcc.a to resolve some of
++ # the object symbols generated in some cases. Libraries that use
++ # assert need libgcc.a to resolve __eprintf, for example. Linking
++ # a copy of libgcc.a into every shared library to guarantee resolving
++ # such symbols causes other problems: According to Tim Van Holder
++ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
++ # (to the application) exception stack for one thing.
++ no_undefined_flag=' -z defs'
++ if test "$GCC" = yes; then
++ case `$CC --version 2>/dev/null` in
++ [[12]].*)
++ cat <<EOF 1>&2
++
++*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
++*** create self contained shared libraries on Solaris systems, without
++*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
++*** -no-undefined support, which will at least allow you to build shared
++*** libraries. However, you may find that when you link such libraries
++*** into an application without using GCC, you have to manually add
++*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
++*** upgrade to a newer version of GCC. Another option is to rebuild your
++*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
++
++EOF
++ no_undefined_flag=
++ ;;
++ esac
++ fi
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_shlibpath_var=no
++ case $host_os in
++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
++ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
++ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
++ esac
++ 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'
++ ;;
++
++ sysv5*)
++ no_undefined_flag=' -z text'
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec=
++ hardcode_shlibpath_var=no
++ runpath_var='LD_RUN_PATH'
++ ;;
++
++ uts4*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ dgux*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ 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.2uw2*)
++ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_direct=yes
++ hardcode_minus_L=no
++ hardcode_shlibpath_var=no
++ hardcode_runpath_var=yes
++ runpath_var=LD_RUN_PATH
++ ;;
++
++ sysv5uw7* | unixware7*)
++ no_undefined_flag='${wl}-z ${wl}text'
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ else
++ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ fi
++ runpath_var='LD_RUN_PATH'
++ hardcode_shlibpath_var=no
++ ;;
++
++ *)
++ ld_shlibs=no
++ ;;
++ esac
++fi
++AC_MSG_RESULT([$ld_shlibs])
++test "$ld_shlibs" = no && can_build_shared=no
++
++# Check hardcoding attributes.
++AC_MSG_CHECKING([how to hardcode library paths into programs])
++hardcode_action=
++if test -n "$hardcode_libdir_flag_spec" || \
++ test -n "$runpath_var"; then
++
++ # We can hardcode non-existant 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 "$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
++AC_MSG_RESULT([$hardcode_action])
++
++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
++ AC_MSG_RESULT([no])
++fi
++
++reload_cmds='$LD$reload_flag -o $output$reload_objs'
++test -z "$deplibs_check_method" && deplibs_check_method=unknown
++
++# PORTME Fill in your ld.so characteristics
++AC_MSG_CHECKING([dynamic linker characteristics])
++library_names_spec=
++libname_spec='lib$name'
++soname_spec=
++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"
++sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
++
++case $host_os in
++aix3*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix $libname.a'
++ shlibpath_var=LIBPATH
++
++ # AIX has no versioning support, so we append a major version to the name.
++ soname_spec='${libname}${release}.so$major'
++ ;;
++
++aix4* | aix5*)
++ 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}.so$major ${libname}${release}.so$versuffix $libname.so'
++ 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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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}.so$major'
++ fi
++ shlibpath_var=LIBPATH
++ fi
++ hardcode_into_libs=yes
++ ;;
++
++amigaos*)
++ 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=`$echo "X$lib" | $Xsed -e '\''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'
++ ;;
++
++beos*)
++ library_names_spec='${libname}.so'
++ dynamic_linker="$host_os ld.so"
++ shlibpath_var=LIBRARY_PATH
++ ;;
++
++bsdi4*)
++ version_type=linux
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
++ export_dynamic_flag_spec=-rdynamic
++ # the default ld.so.conf also contains /usr/contrib/lib and
++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
++ # libtool to hard-code these into programs
++ ;;
++
++cygwin* | mingw* | pw32*)
++ version_type=windows
++ need_version=no
++ need_lib_prefix=no
++ case $GCC,$host_os in
++ yes,cygwin*)
++ library_names_spec='$libname.dll.a'
++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
++ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog .libs/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $rm \$dlpath'
++ ;;
++ yes,mingw*)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
++ ;;
++ yes,pw32*)
++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ ;;
++ *)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $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
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes.
++ library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
++ soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
++ shlibpath_overrides_runpath=yes
++ shlibpath_var=DYLD_LIBRARY_PATH
++ ;;
++
++freebsd1*)
++ dynamic_linker=no
++ ;;
++
++freebsd*-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU/FreeBSD ld.so'
++ ;;
++
++freebsd*)
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ version_type=freebsd-$objformat
++ case $version_type in
++ freebsd-elf*)
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
++ need_version=no
++ need_lib_prefix=no
++ ;;
++ freebsd-*)
++ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
++ need_version=yes
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_os in
++ freebsd2*)
++ shlibpath_overrides_runpath=yes
++ ;;
++ *)
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ ;;
++ esac
++ ;;
++
++gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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.
++ dynamic_linker="$host_os dld.sl"
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ shlibpath_var=SHLIB_PATH
++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
++ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
++ soname_spec='${libname}${release}.sl$major'
++ # HP-UX runs *really* slowly unless shared libraries are mode 555.
++ postinstall_cmds='chmod 555 $lib'
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ nonstopux*) version_type=nonstopux ;;
++ *) version_type=irix ;;
++ esac
++ need_lib_prefix=no
++ need_version=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
++ case $host_os in
++ irix5* | nonstopux*)
++ libsuff= shlibsuff=
++ ;;
++ *)
++ case $LD in # libtool.m4 will add one of these switches to LD
++ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
++ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
++ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
++ *) libsuff= shlibsuff= libmagic=never-match;;
++ esac
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
++ shlibpath_overrides_runpath=no
++ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
++ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
++ ;;
++
++# No shared lib support for Linux oldld, aout, or coff.
++linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
++ dynamic_linker=no
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # 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
++
++ # 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}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ dynamic_linker='NetBSD (a.out) ld.so'
++ else
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
++ soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=yes
++ ;;
++
++openbsd*)
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ 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
++ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++os2*)
++ libname_spec='$name'
++ need_lib_prefix=no
++ library_names_spec='$libname.dll $libname.a'
++ dynamic_linker='OS/2 ld.exe'
++ shlibpath_var=LIBPATH
++ ;;
++
++osf3* | osf4* | osf5*)
++ version_type=osf
++ need_version=no
++ need_lib_prefix=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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"
++ hardcode_into_libs=yes
++ ;;
++
++sco3.2v5*)
++ version_type=osf
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++solaris*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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}.so$versuffix ${libname}.so$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.2uw2* | sysv4.3* | sysv5*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_vendor in
++ sni)
++ shlibpath_overrides_runpath=no
++ need_lib_prefix=no
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ 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
++ ;;
++
++uts4*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++dgux*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++sysv4*MP*)
++ if test -d /usr/nec ;then
++ version_type=linux
++ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
++ soname_spec='$libname.so.$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ fi
++ ;;
++
++*)
++ dynamic_linker=no
++ ;;
++esac
++AC_MSG_RESULT([$dynamic_linker])
++test "$dynamic_linker" = no && can_build_shared=no
++
++# Report the final consequences.
++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
++ ;;
++
++aix4*)
++ 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])
++
++if test "$hardcode_action" = relink; 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
++
++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
++
++AC_LIBTOOL_DLOPEN_SELF
++
++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.
++ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
++ AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
++ [$rm conftest*
++ echo 'static int dummy;' > conftest.$ac_ext
++
++ if AC_TRY_EVAL(ac_compile); then
++ soname=conftest
++ lib=conftest
++ libobjs=conftest.$ac_objext
++ deplibs=
++ wl=$lt_cv_prog_cc_wl
++ compiler_flags=-v
++ linker_flags=-v
++ verstring=
++ output_objdir=.
++ libname=conftest
++ save_allow_undefined_flag=$allow_undefined_flag
++ allow_undefined_flag=
++ if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
++ then
++ lt_cv_archive_cmds_need_lc=no
++ else
++ lt_cv_archive_cmds_need_lc=yes
++ fi
++ allow_undefined_flag=$save_allow_undefined_flag
++ else
++ cat conftest.err 1>&5
++ fi])
++ AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
++ ;;
++ esac
++fi
++need_lc=${lt_cv_archive_cmds_need_lc-yes}
++
++# The second clause should only fire when bootstrapping the
++# libtool distribution, otherwise you forgot to ship ltmain.sh
++# with your package, and you will get complaints that there are
++# no rules to generate ltmain.sh.
++if test -f "$ltmain"; then
++ :
++else
++ # If there is no Makefile yet, we rely on a make rule to execute
++ # `config.status --recheck' to rerun these tests and create the
++ # libtool script then.
++ test -f Makefile && make "$ltmain"
++fi
++
++if test -f "$ltmain"; then
++ trap "$rm \"${ofile}T\"; exit 1" 1 2 15
++ $rm -f "${ofile}T"
++
++ echo creating $ofile
++
++ # Now quote all the things that may contain metacharacters while being
++ # careful not to overquote the AC_SUBSTed values. We take copies of the
++ # variables and quote the copies for generation of the libtool script.
++ for var in echo old_CC old_CFLAGS SED \
++ AR AR_FLAGS CC LD LN_S NM SHELL \
++ reload_flag reload_cmds wl \
++ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
++ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
++ library_names_spec soname_spec \
++ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
++ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
++ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
++ old_striplib striplib file_magic_cmd export_symbols_cmds \
++ deplibs_check_method allow_undefined_flag no_undefined_flag \
++ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
++ global_symbol_to_c_name_address \
++ hardcode_libdir_flag_spec hardcode_libdir_separator \
++ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
++ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
++
++ case $var in
++ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
++ old_postinstall_cmds | old_postuninstall_cmds | \
++ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
++ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
++ postinstall_cmds | postuninstall_cmds | \
++ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
++ # Double-quote double-evaled strings.
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
++ ;;
++ *)
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
++ ;;
++ esac
++ done
++
++ cat <<__EOF__ > "${ofile}T"
++#! $SHELL
++
++# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
++# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
++# NOTE: Changes made to this file will be lost: look at ltmain.sh.
++#
++# Copyright (C) 1996-2000 Free Software Foundation, Inc.
++# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# A sed that does not truncate output.
++SED=$lt_SED
++
++# Sed that helps us avoid accidentally triggering echo(1) options like -n.
++Xsed="${SED} -e s/^X//"
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++# ### BEGIN LIBTOOL CONFIG
++
++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++
++# Shell to use when invoking shell scripts.
++SHELL=$lt_SHELL
++
++# Whether or not to build shared libraries.
++build_libtool_libs=$enable_shared
++
++# Whether or not to build static libraries.
++build_old_libs=$enable_static
++
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$need_lc
++
++# Whether or not to optimize for fast installation.
++fast_install=$enable_fast_install
++
++# The host system.
++host_alias=$host_alias
++host=$host
++
++# An echo program that does not interpret backslashes.
++echo=$lt_echo
++
++# The archiver.
++AR=$lt_AR
++AR_FLAGS=$lt_AR_FLAGS
++
++# The default C compiler.
++CC=$lt_CC
++
++# Is the compiler the GNU C compiler?
++with_gcc=$GCC
++
++# The linker used to build libraries.
++LD=$lt_LD
++
++# Whether we need hard or soft links.
++LN_S=$lt_LN_S
++
++# A BSD-compatible nm program.
++NM=$lt_NM
++
++# A symbol stripping program
++STRIP=$STRIP
++
++# Used to examine libraries when file_magic_cmd begins "file"
++MAGIC_CMD=$MAGIC_CMD
++
++# Used on cygwin: DLL creation program.
++DLLTOOL="$DLLTOOL"
++
++# Used on cygwin: object dumper.
++OBJDUMP="$OBJDUMP"
++
++# Used on cygwin: assembler.
++AS="$AS"
++
++# The name of the directory that contains temporary libtool files.
++objdir=$objdir
++
++# How to create reloadable object files.
++reload_flag=$lt_reload_flag
++reload_cmds=$lt_reload_cmds
++
++# How to pass a linker flag through the compiler.
++wl=$lt_wl
++
++# Object file suffix (normally "o").
++objext="$ac_objext"
++
++# Old archive suffix (normally "a").
++libext="$libext"
++
++# Executable file suffix (normally "").
++exeext="$exeext"
++
++# Additional compiler flags for building library objects.
++pic_flag=$lt_pic_flag
++pic_mode=$pic_mode
++
++# Does compiler simultaneously support -c and -o options?
++compiler_c_o=$lt_compiler_c_o
++
++# Can we write directly to a .lo ?
++compiler_o_lo=$lt_compiler_o_lo
++
++# Must we lock files when doing compilation ?
++need_locks=$lt_need_locks
++
++# 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
++
++# 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
++
++# Compiler flag to prevent dynamic linking.
++link_static_flag=$lt_link_static_flag
++
++# Compiler flag to turn off builtin functions.
++no_builtin_flag=$lt_no_builtin_flag
++
++# 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
++
++# Compiler flag to generate thread-safe objects.
++thread_safe_flag_spec=$lt_thread_safe_flag_spec
++
++# Library versioning type.
++version_type=$version_type
++
++# 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
++
++# Commands used to build and install an old-style archive.
++RANLIB=$lt_RANLIB
++old_archive_cmds=$lt_old_archive_cmds
++old_postinstall_cmds=$lt_old_postinstall_cmds
++old_postuninstall_cmds=$lt_old_postuninstall_cmds
++
++# 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 and install a shared archive.
++archive_cmds=$lt_archive_cmds
++archive_expsym_cmds=$lt_archive_expsym_cmds
++postinstall_cmds=$lt_postinstall_cmds
++postuninstall_cmds=$lt_postuninstall_cmds
++
++# Commands to strip libraries.
++old_striplib=$lt_old_striplib
++striplib=$lt_striplib
++
++# 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
++
++# Flag that allows shared libraries with undefined symbols to be built.
++allow_undefined_flag=$lt_allow_undefined_flag
++
++# Flag that forces no undefined symbols.
++no_undefined_flag=$lt_no_undefined_flag
++
++# Commands used to finish a libtool library installation in a directory.
++finish_cmds=$lt_finish_cmds
++
++# Same as above, but a single script fragment to be evaled but not shown.
++finish_eval=$lt_finish_eval
++
++# Take the output of nm and produce a listing of raw symbols and C names.
++global_symbol_pipe=$lt_global_symbol_pipe
++
++# Transform the output of nm in a proper C declaration
++global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
++
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
++
++# This is the shared library runtime path variable.
++runpath_var=$runpath_var
++
++# This is the shared library path variable.
++shlibpath_var=$shlibpath_var
++
++# Is shlibpath searched before the hard-coded library search path?
++shlibpath_overrides_runpath=$shlibpath_overrides_runpath
++
++# How to hardcode a shared library path into an executable.
++hardcode_action=$hardcode_action
++
++# Whether we should hardcode library paths into libraries.
++hardcode_into_libs=$hardcode_into_libs
++
++# 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
++
++# 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.so during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct=$hardcode_direct
++
++# 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
++
++# Variables whose values should be saved in libtool wrapper scripts and
++# restored at relink time.
++variables_saved_for_relink="$variables_saved_for_relink"
++
++# Whether libtool must link a program against all its dependency libraries.
++link_all_deplibs=$link_all_deplibs
++
++# 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
++
++# Fix the shell variable \$srcfile for the compiler.
++fix_srcfile_path="$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
++
++# The commands to extract the exported symbol list from a shared archive.
++extract_expsyms_cmds=$lt_extract_expsyms_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
++
++# ### END LIBTOOL CONFIG
++
++__EOF__
++
++ case $host_os in
++ aix3*)
++ cat <<\EOF >> "${ofile}T"
++
++# 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
++EOF
++ ;;
++ esac
++
++ case $host_os in
++ cygwin* | mingw* | pw32* | os2*)
++ cat <<'EOF' >> "${ofile}T"
++ # This is a source program that is used to create dlls on Windows
++ # Don't remove nor modify the starting and closing comments
++# /* ltdll.c starts here */
++# #define WIN32_LEAN_AND_MEAN
++# #include <windows.h>
++# #undef WIN32_LEAN_AND_MEAN
++# #include <stdio.h>
++#
++# #ifndef __CYGWIN__
++# # ifdef __CYGWIN32__
++# # define __CYGWIN__ __CYGWIN32__
++# # endif
++# #endif
++#
++# #ifdef __cplusplus
++# extern "C" {
++# #endif
++# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
++# #ifdef __cplusplus
++# }
++# #endif
++#
++# #ifdef __CYGWIN__
++# #include <cygwin/cygwin_dll.h>
++# DECLARE_CYGWIN_DLL( DllMain );
++# #endif
++# HINSTANCE __hDllInstance_base;
++#
++# BOOL APIENTRY
++# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
++# {
++# __hDllInstance_base = hInst;
++# return TRUE;
++# }
++# /* ltdll.c ends here */
++ # This is a source program that is used to create import libraries
++ # on Windows for dlls which lack them. Don't remove nor modify the
++ # starting and closing comments
++# /* impgen.c starts here */
++# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
++#
++# This file is part of GNU libtool.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# */
++#
++# #include <stdio.h> /* for printf() */
++# #include <unistd.h> /* for open(), lseek(), read() */
++# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
++# #include <string.h> /* for strdup() */
++#
++# /* O_BINARY isn't required (or even defined sometimes) under Unix */
++# #ifndef O_BINARY
++# #define O_BINARY 0
++# #endif
++#
++# static unsigned int
++# pe_get16 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[2];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 2);
++# return b[0] + (b[1]<<8);
++# }
++#
++# static unsigned int
++# pe_get32 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[4];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 4);
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# static unsigned int
++# pe_as32 (ptr)
++# void *ptr;
++# {
++# unsigned char *b = ptr;
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# int
++# main (argc, argv)
++# int argc;
++# char *argv[];
++# {
++# int dll;
++# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
++# unsigned long export_rva, export_size, nsections, secptr, expptr;
++# unsigned long name_rvas, nexp;
++# unsigned char *expdata, *erva;
++# char *filename, *dll_name;
++#
++# filename = argv[1];
++#
++# dll = open(filename, O_RDONLY|O_BINARY);
++# if (dll < 1)
++# return 1;
++#
++# dll_name = filename;
++#
++# for (i=0; filename[i]; i++)
++# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
++# dll_name = filename + i +1;
++#
++# pe_header_offset = pe_get32 (dll, 0x3c);
++# opthdr_ofs = pe_header_offset + 4 + 20;
++# num_entries = pe_get32 (dll, opthdr_ofs + 92);
++#
++# if (num_entries < 1) /* no exports */
++# return 1;
++#
++# export_rva = pe_get32 (dll, opthdr_ofs + 96);
++# export_size = pe_get32 (dll, opthdr_ofs + 100);
++# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
++# secptr = (pe_header_offset + 4 + 20 +
++# pe_get16 (dll, pe_header_offset + 4 + 16));
++#
++# expptr = 0;
++# for (i = 0; i < nsections; i++)
++# {
++# char sname[8];
++# unsigned long secptr1 = secptr + 40 * i;
++# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
++# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
++# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
++# lseek(dll, secptr1, SEEK_SET);
++# read(dll, sname, 8);
++# if (vaddr <= export_rva && vaddr+vsize > export_rva)
++# {
++# expptr = fptr + (export_rva - vaddr);
++# if (export_rva + export_size > vaddr + vsize)
++# export_size = vsize - (export_rva - vaddr);
++# break;
++# }
++# }
++#
++# expdata = (unsigned char*)malloc(export_size);
++# lseek (dll, expptr, SEEK_SET);
++# read (dll, expdata, export_size);
++# erva = expdata - export_rva;
++#
++# nexp = pe_as32 (expdata+24);
++# name_rvas = pe_as32 (expdata+32);
++#
++# printf ("EXPORTS\n");
++# for (i = 0; i<nexp; i++)
++# {
++# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
++# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
++# }
++#
++# return 0;
++# }
++# /* impgen.c ends here */
+
+-# Some flags need to be propagated to the compiler or linker for good
+-# libtool support.
+-case "$lt_target" in
+-*-*-irix6*)
+- # Find out which ABI we are using.
+- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+- if AC_TRY_EVAL(ac_compile); then
+- case "`/usr/bin/file conftest.o`" in
+- *32-bit*)
+- LD="${LD-ld} -32"
+- ;;
+- *N32*)
+- LD="${LD-ld} -n32"
+- ;;
+- *64-bit*)
+- LD="${LD-ld} -64"
+- ;;
+- esac
+- fi
+- rm -rf conftest*
+- ;;
++EOF
++ ;;
++ esac
+
+-*-*-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_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+- 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
+- ;;
++ # 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" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
++
++ mv -f "${ofile}T" "$ofile" || \
++ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
++ chmod +x "$ofile"
++fi
+
+-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+-[*-*-cygwin* | *-*-mingw*)
+- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+- AC_CHECK_TOOL(AS, as, false)
+- AC_CHECK_TOOL(OBJDUMP, objdump, false)
+- ;;
+-])
+-esac
+-])
++])# _LT_AC_LTCONFIG_HACK
+
+ # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+-AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
++AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+
+ # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+-AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
++AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+
+ # AC_ENABLE_SHARED - implement the --enable-shared flag
+ # Usage: AC_ENABLE_SHARED[(DEFAULT)]
+ # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+ # `yes'.
+-AC_DEFUN(AC_ENABLE_SHARED, [dnl
+-define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_DEFUN([AC_ENABLE_SHARED],
++[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+ AC_ARG_ENABLE(shared,
+ changequote(<<, >>)dnl
+ << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+ changequote([, ])dnl
+ [p=${PACKAGE-default}
+-case "$enableval" in
++case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+@@ -157,21 +3136,22 @@
+ ])
+
+ # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+-AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_DEFUN([AC_DISABLE_SHARED],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_ENABLE_SHARED(no)])
+
+ # AC_ENABLE_STATIC - implement the --enable-static flag
+ # Usage: AC_ENABLE_STATIC[(DEFAULT)]
+ # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+ # `yes'.
+-AC_DEFUN(AC_ENABLE_STATIC, [dnl
+-define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_DEFUN([AC_ENABLE_STATIC],
++[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+ AC_ARG_ENABLE(static,
+ changequote(<<, >>)dnl
+ << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+ changequote([, ])dnl
+ [p=${PACKAGE-default}
+-case "$enableval" in
++case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+@@ -190,7 +3170,8 @@
+ ])
+
+ # AC_DISABLE_STATIC - set the default static flag to --disable-static
+-AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_DEFUN([AC_DISABLE_STATIC],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_ENABLE_STATIC(no)])
+
+
+@@ -198,14 +3179,14 @@
+ # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+ # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+ # `yes'.
+-AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
+-define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_DEFUN([AC_ENABLE_FAST_INSTALL],
++[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+ AC_ARG_ENABLE(fast-install,
+ changequote(<<, >>)dnl
+ << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+ changequote([, ])dnl
+ [p=${PACKAGE-default}
+-case "$enableval" in
++case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+@@ -223,29 +3204,120 @@
+ enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+ ])
+
+-# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+-AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
++AC_DEFUN([AC_DISABLE_FAST_INSTALL],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_ENABLE_FAST_INSTALL(no)])
+
++# AC_LIBTOOL_PICMODE - implement the --with-pic flag
++# Usage: AC_LIBTOOL_PICMODE[(MODE)]
++# Where MODE is either `yes' or `no'. If omitted, it defaults to
++# `both'.
++AC_DEFUN([AC_LIBTOOL_PICMODE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++pic_mode=ifelse($#,1,$1,default)])
++
++
++# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
++AC_DEFUN([AC_PATH_TOOL_PREFIX],
++[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_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++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="ifelse([$2], , $PATH, [$2])"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_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
++])
++
++
++# AC_PATH_MAGIC - find a file program which can recognise a shared library
++AC_DEFUN([AC_PATH_MAGIC],
++[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
++AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
++if test -z "$lt_cv_path_MAGIC_CMD"; then
++ if test -n "$ac_tool_prefix"; then
++ AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
++ else
++ MAGIC_CMD=:
++ fi
++fi
++])
++
++
+ # AC_PROG_LD - find the path to the GNU or non-GNU linker
+-AC_DEFUN(AC_PROG_LD,
++AC_DEFUN([AC_PROG_LD],
+ [AC_ARG_WITH(gnu-ld,
+ [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+ test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
+ ac_prog=ld
+-if test "$ac_cv_prog_gcc" = yes; then
++if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+- ac_prog=`($CC -print-prog-name=ld) 2>&5`
+- case "$ac_prog" in
++ 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.
+-changequote(,)dnl
+- [\\/]* | [A-Za-z]:[\\/]*)
+- re_direlt='/[^/][^/]*/\.\./'
+-changequote([,])dnl
++ [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
++ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+@@ -267,17 +3339,17 @@
+ else
+ AC_MSG_CHECKING([for non-GNU ld])
+ fi
+-AC_CACHE_VAL(ac_cv_path_LD,
++AC_CACHE_VAL(lt_cv_path_LD,
+ [if test -z "$LD"; then
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+- ac_cv_path_LD="$ac_dir/$ac_prog"
++ 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 GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
++ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+@@ -286,9 +3358,9 @@
+ done
+ IFS="$ac_save_ifs"
+ else
+- ac_cv_path_LD="$LD" # Let the user override the test with a path.
++ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+ fi])
+-LD="$ac_cv_path_LD"
++LD="$lt_cv_path_LD"
+ if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+ else
+@@ -298,56 +3370,255 @@
+ AC_PROG_LD_GNU
+ ])
+
+-AC_DEFUN(AC_PROG_LD_GNU,
+-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
++# AC_PROG_LD_GNU -
++AC_DEFUN([AC_PROG_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 ld's only accept -v.
+ if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+- ac_cv_prog_gnu_ld=yes
++ lt_cv_prog_gnu_ld=yes
+ else
+- ac_cv_prog_gnu_ld=no
++ lt_cv_prog_gnu_ld=no
+ fi])
++with_gnu_ld=$lt_cv_prog_gnu_ld
++])
++
++# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
++# -- PORTME Some linkers may need a different reload flag.
++AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
++[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
++test -n "$reload_flag" && reload_flag=" $reload_flag"
++])
++
++# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
++# -- PORTME fill in with the dynamic library characteristics
++AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
++[AC_CACHE_CHECK([how to recognise 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 egrep 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
++aix4* | aix5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++beos*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++bsdi4*)
++ 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* | mingw* | pw32*)
++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ lt_cv_file_magic_cmd='$OBJDUMP -f'
++ ;;
++
++darwin* | rhapsody*)
++ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
++ lt_cv_file_magic_cmd='/usr/bin/file -L'
++ case "$host_os" in
++ rhapsody* | darwin1.[[012]])
++ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
++ ;;
++ *) # Darwin 1.3 on
++ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
++ ;;
++ esac
++ ;;
++
++freebsd*)
++ 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)/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
++ ;;
++
++hpux10.20*|hpux11*)
++ 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_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=/usr/lib/libc.sl
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ irix5* | nonstopux*)
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
++ ;;
++ *)
++ case $LD in
++ *-32|*"-32 ") libmagic=32-bit;;
++ *-n32|*"-n32 ") libmagic=N32;;
++ *-64|*"-64 ") libmagic=64-bit;;
++ *) libmagic=never-match;;
++ esac
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
++ ;;
++ esac
++ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ case $host_cpu in
++ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
++ lt_cv_deplibs_check_method=pass_all ;;
++ *)
++ # glibc up to 2.1.1 does not perform some relocations on ARM
++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
++ esac
++ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
++ ;;
++
++netbsd*)
++ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
++ lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
++ else
++ lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
++ 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
++ ;;
++
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
++osf3* | osf4* | osf5*)
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
++ lt_cv_file_magic_test_file=/shlib/libc.so
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sco3.2v5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++solaris*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=/lib/libc.so
++ ;;
++
++sysv5uw[[78]]* | sysv4*uw2*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ 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
++ ;;
++ esac
++ ;;
++esac
+ ])
++file_magic_cmd=$lt_cv_file_magic_cmd
++deplibs_check_method=$lt_cv_deplibs_check_method
++])
++
+
+ # AC_PROG_NM - find the path to a BSD-compatible name lister
+-AC_DEFUN(AC_PROG_NM,
+-[AC_MSG_CHECKING([for BSD-compatible nm])
+-AC_CACHE_VAL(ac_cv_path_NM,
++AC_DEFUN([AC_PROG_NM],
++[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
++AC_MSG_CHECKING([for BSD-compatible nm])
++AC_CACHE_VAL(lt_cv_path_NM,
+ [if test -n "$NM"; then
+ # Let the user override the test.
+- ac_cv_path_NM="$NM"
++ lt_cv_path_NM="$NM"
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
++ tmp_nm=$ac_dir/${ac_tool_prefix}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
+- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -B"
++ # Tru64's nm complains that /dev/null is an invalid object file
++ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -B"
+ break
+- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -p"
++ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
++ 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
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
++ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+ fi])
+-NM="$ac_cv_path_NM"
++NM="$lt_cv_path_NM"
+ AC_MSG_RESULT([$NM])
+ ])
+
+ # AC_CHECK_LIBM - check for math library
+-AC_DEFUN(AC_CHECK_LIBM,
++AC_DEFUN([AC_CHECK_LIBM],
+ [AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ LIBM=
+-case "$lt_target" in
+-*-*-beos* | *-*-cygwin*)
++case $host in
++*-*-beos* | *-*-cygwin* | *-*-pw32*)
+ # These system don't have libm
+ ;;
+ *-ncr-sysv4.3*)
+@@ -361,33 +3632,41 @@
+ ])
+
+ # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl convenience library, adds --enable-ltdl-convenience to
+-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+-# '${top_builddir}/' (note the single quotes!) if your package is not
+-# flat, and, if you're not using automake, define top_builddir as
+-# appropriate in the Makefiles.
+-AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+- case "$enable_ltdl_convenience" in
++# the libltdl convenience library and LTDLINCL to the include flags for
++# the libltdl header and adds --enable-ltdl-convenience to the
++# configure arguments. Note that LIBLTDL and LTDLINCL are not
++# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
++# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
++# with '${top_builddir}/' and LTDLINCL will be prefixed with
++# '${top_srcdir}/' (note the single quotes!). If your package is not
++# flat and you're not using automake, define top_builddir and
++# top_srcdir appropriately in the Makefiles.
++AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
++ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
+ ])
+
+ # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl installable library, and adds --enable-ltdl-install to
+-# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+-# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+-# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+-# '${top_builddir}/' (note the single quotes!) if your package is not
+-# flat, and, if you're not using automake, define top_builddir as
+-# appropriate in the Makefiles.
++# the libltdl installable library and LTDLINCL to the include flags for
++# the libltdl header and adds --enable-ltdl-install to the configure
++# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
++# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
++# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
++# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
++# with '${top_srcdir}/' (note the single quotes!). If your package is
++# not flat and you're not using automake, define top_builddir and
++# top_srcdir appropriately in the Makefiles.
+ # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+-AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, main,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+@@ -398,148 +3677,124 @@
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+- LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+- INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
++ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+- INCLTDL=
++ LTDLINCL=
+ fi
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
+ ])
+
+-dnl old names
+-AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+-AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+-AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+-AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+-AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+-AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+-AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+-
+-dnl This is just to silence aclocal about the macro not being used
+-ifelse([AC_DISABLE_FAST_INSTALL])dnl
+-
+-# Do all the work for Automake. 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.
+-
+-# serial 1
+-
+-dnl Usage:
+-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+-
+-AC_DEFUN(AM_INIT_AUTOMAKE,
+-[AC_REQUIRE([AC_PROG_INSTALL])
+-PACKAGE=[$1]
+-AC_SUBST(PACKAGE)
+-VERSION=[$2]
+-AC_SUBST(VERSION)
+-dnl test to see if srcdir already configured
+-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+-fi
+-ifelse([$3],,
+-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+-AC_REQUIRE([AM_SANITY_CHECK])
+-AC_REQUIRE([AC_ARG_PROGRAM])
+-dnl FIXME This is truly gross.
+-missing_dir=`cd $ac_aux_dir && pwd`
+-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+-AC_REQUIRE([AC_PROG_MAKE_SET])])
+-
+-#
+-# Check to make sure that the build environment is sane.
+-#
+-
+-AC_DEFUN(AM_SANITY_CHECK,
+-[AC_MSG_CHECKING([whether build environment is sane])
+-# Just in case
+-sleep 1
+-echo timestamp > conftestfile
+-# 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 conftestfile 2> /dev/null`
+- if test "[$]*" = "X"; then
+- # -L didn't work.
+- set X `ls -t $srcdir/configure conftestfile`
+- fi
+- if test "[$]*" != "X $srcdir/configure conftestfile" \
+- && test "[$]*" != "X conftestfile $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
++# old names
++AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
++AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
++AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
++AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
++AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
++AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
++AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
++
++# This is just to silence aclocal about the macro not being used
++ifelse([AC_DISABLE_FAST_INSTALL])
++
++# 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. #
++# LT_AC_PROG_SED
++# --------------
++# Check for a fully-functional sed program, that truncates
++# as few characters as possible. Prefer GNU sed if found.
++AC_DEFUN([LT_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_executable_p="test -f"
++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
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ fi
++ done
++ done
++done
+
+- test "[$]2" = conftestfile
+- )
+-then
+- # Ok.
+- :
+-else
+- AC_MSG_ERROR([newly created file is older than distributed files!
+-Check your system clock])
+-fi
+-rm -f conftest*
+-AC_MSG_RESULT(yes)])
++ # Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
+
+-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+-dnl The program must properly implement --version.
+-AC_DEFUN(AM_MISSING_PROG,
+-[AC_MSG_CHECKING(for working $2)
+-# Run test in a subshell; some versions of sh will print an error if
+-# an executable is not found, even if stderr is redirected.
+-# Redirect stdin to placate older versions of autoconf. Sigh.
+-if ($2 --version) < /dev/null > /dev/null 2>&1; then
+- $1=$2
+- AC_MSG_RESULT(found)
++# Create a (secure) tmp directory for tmp files.
++: ${TMPDIR=/tmp}
++{
++ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=$TMPDIR/sed$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
++ { (exit 1); exit 1; }
++}
++ _max=0
++ _count=0
++ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
++ # along with /bin/sed that truncates output.
++ for _sed in $_sed_list /usr/xpg4/bin/sed; do
++ test ! -f ${_sed} && break
++ cat /dev/null > "$tmp/sed.in"
++ _count=0
++ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
++ # Check for GNU sed and select it if it is found.
++ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
++ lt_cv_path_SED=${_sed}
++ break
++ fi
++ while true; do
++ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
++ mv "$tmp/sed.tmp" "$tmp/sed.in"
++ cp "$tmp/sed.in" "$tmp/sed.nl"
++ echo >>"$tmp/sed.nl"
++ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
++ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
++ # 40000 chars as input seems more than enough
++ test $_count -gt 10 && break
++ _count=`expr $_count + 1`
++ if test $_count -gt $_max; then
++ _max=$_count
++ lt_cv_path_SED=$_sed
++ fi
++ done
++ done
++ rm -rf "$tmp"
++])
++if test "X$SED" != "X"; then
++ lt_cv_path_SED=$SED
+ else
+- $1="$3/missing $2"
+- AC_MSG_RESULT(missing)
++ SED=$lt_cv_path_SED
+ fi
+-AC_SUBST($1)])
+-
+-# Like AC_CONFIG_HEADER, but automatically create stamp file.
+-
+-AC_DEFUN(AM_CONFIG_HEADER,
+-[AC_PREREQ([2.12])
+-AC_CONFIG_HEADER([$1])
+-dnl When config.status generates a header, we must update the stamp-h file.
+-dnl This file resides in the same directory as the config header
+-dnl that is generated. We must strip everything past the first ":",
+-dnl and everything past the last "/".
+-AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+-ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+-<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+-<<am_indx=1
+-for am_file in <<$1>>; do
+- case " <<$>>CONFIG_HEADERS " in
+- *" <<$>>am_file "*<<)>>
+- echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+- ;;
+- esac
+- am_indx=`expr "<<$>>am_indx" + 1`
+-done<<>>dnl>>)
+-changequote([,]))])
++AC_MSG_RESULT([$SED])
++])
+
+ # Add --enable-maintainer-mode option to configure.
+ # From Jim Meyering
+
+ # serial 1
+
+-AC_DEFUN(AM_MAINTAINER_MODE,
++AC_DEFUN([AM_MAINTAINER_MODE],
+ [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+@@ -556,7 +3811,7 @@
+
+ # Define a conditional.
+
+-AC_DEFUN(AM_CONDITIONAL,
++AC_DEFUN([AM_CONDITIONAL],
+ [AC_SUBST($1_TRUE)
+ AC_SUBST($1_FALSE)
+ if $2; then
+@@ -585,7 +3840,7 @@
+ # program @code{ansi2knr}, which comes with Ghostscript.
+ # @end defmac
+
+-AC_DEFUN(AM_PROG_CC_STDC,
++AC_DEFUN([AM_PROG_CC_STDC],
+ [AC_REQUIRE([AC_PROG_CC])
+ AC_BEFORE([$0], [AC_C_INLINE])
+ AC_BEFORE([$0], [AC_C_CONST])
+--- glib1.2-1.2.10.orig/config.guess
++++ glib1.2-1.2.10/config.guess
+@@ -1,8 +1,10 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+-# Free Software Foundation, Inc.
+-#
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++
++timestamp='2003-05-09'
++
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+@@ -22,99 +24,262 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
+-# Written by Per Bothner <bothner@cygnus.com>.
+-# The master version of this file is at the FSF in /home/gd/gnu/lib.
+-# Please send patches to <autoconf-patches@gnu.org>.
++# Originally written by Per Bothner <per@bothner.com>.
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
+ #
+ # This script attempts to guess a canonical system name similar to
+ # config.sub. If it succeeds, it prints the system name on stdout, and
+ # exits with 0. Otherwise, it exits with 1.
+ #
+ # The plan is that this can be called by configure scripts if you
+-# don't specify an explicit system type (host/target name).
+-#
+-# Only a few systems have been added to this list; please add others
+-# (but try to keep the structure clean).
+-#
++# don't specify an explicit build system type.
+
+-# Use $HOST_CC if defined. $CC may point to a cross-compiler
+-if test x"$CC_FOR_BUILD" = x; then
+- if test x"$HOST_CC" != x; then
+- CC_FOR_BUILD="$HOST_CC"
+- else
+- if test x"$CC" != x; then
+- CC_FOR_BUILD="$CC"
+- else
+- CC_FOR_BUILD=cc
+- fi
+- fi
++me=`echo "$0" | sed -e 's,.*/,,'`
++
++usage="\
++Usage: $0 [OPTION]
++
++Output the configuration name of the system \`$me' is run on.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.guess ($timestamp)
++
++Originally written by Per Bothner.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
++Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit 0 ;;
++ --version | -v )
++ echo "$version" ; exit 0 ;;
++ --help | --h* | -h )
++ echo "$usage"; exit 0 ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help" >&2
++ exit 1 ;;
++ * )
++ break ;;
++ esac
++done
++
++if test $# != 0; then
++ echo "$me: too many arguments$help" >&2
++ exit 1
+ fi
+
++trap 'exit 1' 1 2 15
++
++# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
++# compiler to aid in system detection is discouraged as it requires
++# temporary files to be created and, as you can see below, it is a
++# headache to deal with in a portable fashion.
++
++# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
++# use `HOST_CC' if defined, but it is deprecated.
++
++# Portable tmp directory creation inspired by the Autoconf team.
++
++set_cc_for_build='
++trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
++trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
++: ${TMPDIR=/tmp} ;
++ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
++dummy=$tmp/dummy ;
++tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
++case $CC_FOR_BUILD,$HOST_CC,$CC in
++ ,,) echo "int x;" > $dummy.c ;
++ for c in cc gcc c89 c99 ; do
++ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
++ CC_FOR_BUILD="$c"; break ;
++ fi ;
++ done ;
++ if test x"$CC_FOR_BUILD" = x ; then
++ CC_FOR_BUILD=no_compiler_found ;
++ fi
++ ;;
++ ,,*) CC_FOR_BUILD=$CC ;;
++ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
++esac ;'
+
+ # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+-# (ghazi@noc.rutgers.edu 8/24/94.)
++# (ghazi@noc.rutgers.edu 1994-08-24)
+ if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+ fi
+
+ UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
++UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+-dummy=dummy-$$
+-trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
+-
+ # Note: order is significant - the case branches are not exclusive.
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
++ *:NetBSD:*:*)
++ # NetBSD (nbsd) targets should (where applicable) match one or
++ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
++ # switched to ELF, *-*-netbsd* would select the old
++ # object file format. This provides both forward
++ # compatibility and a consistent mechanism for selecting the
++ # object file format.
++ #
++ # Note: NetBSD doesn't particularly care about the vendor
++ # portion of the name. We always set it to "unknown".
++ sysctl="sysctl -n hw.machine_arch"
++ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
++ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
++ case "${UNAME_MACHINE_ARCH}" in
++ armeb) machine=armeb-unknown ;;
++ arm*) machine=arm-unknown ;;
++ sh3el) machine=shl-unknown ;;
++ sh3eb) machine=sh-unknown ;;
++ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
++ esac
++ # The Operating System including object format, if it has switched
++ # to ELF recently, or will in the future.
++ case "${UNAME_MACHINE_ARCH}" in
++ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
++ eval $set_cc_for_build
++ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
++ | grep __ELF__ >/dev/null
++ then
++ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
++ # Return netbsd for either. FIX?
++ os=netbsd
++ else
++ os=netbsdelf
++ fi
++ ;;
++ *)
++ os=netbsd
++ ;;
++ esac
++ # The OS release
++ # Debian GNU/NetBSD machines have a different userland, and
++ # thus, need a distinct triplet. However, they do not need
++ # kernel version information, so it can be replaced with a
++ # suitable tag, in the style of linux-gnu.
++ case "${UNAME_VERSION}" in
++ Debian*)
++ release='-gnu'
++ ;;
++ *)
++ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ ;;
++ esac
++ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
++ # contains redundant information, the shorter form:
++ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
++ echo "${machine}-${os}${release}"
++ exit 0 ;;
++ amiga:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ arc:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ hp300:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mac68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ macppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme88k:OpenBSD:*:*)
++ echo m88k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvmeppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ pmax:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sgi:OpenBSD:*:*)
++ echo mipseb-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sun3:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ wgrisc:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:OpenBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
++ # According to Compaq, /usr/sbin/psrinfo has been available on
++ # OSF/1 and Tru64 systems produced since 1995. I hope that
++ # covers most systems running today. This code pipes the CPU
++ # types through head -n 1, so we only detect the type of CPU 0.
++ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
++ case "$ALPHA_CPU_TYPE" in
++ "EV4 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "EV4.5 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "LCA4 (21066/21068)")
++ UNAME_MACHINE="alpha" ;;
++ "EV5 (21164)")
++ UNAME_MACHINE="alphaev5" ;;
++ "EV5.6 (21164A)")
++ UNAME_MACHINE="alphaev56" ;;
++ "EV5.6 (21164PC)")
++ UNAME_MACHINE="alphapca56" ;;
++ "EV5.7 (21164PC)")
++ UNAME_MACHINE="alphapca57" ;;
++ "EV6 (21264)")
++ UNAME_MACHINE="alphaev6" ;;
++ "EV6.7 (21264A)")
++ UNAME_MACHINE="alphaev67" ;;
++ "EV6.8CB (21264C)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8AL (21264B)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8CX (21264D)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.9A (21264/EV69A)")
++ UNAME_MACHINE="alphaev69" ;;
++ "EV7 (21364)")
++ UNAME_MACHINE="alphaev7" ;;
++ "EV7.9 (21364A)")
++ UNAME_MACHINE="alphaev79" ;;
++ esac
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+- cat <<EOF >$dummy.s
+- .globl main
+- .ent main
+-main:
+- .frame \$30,0,\$26,0
+- .prologue 0
+- .long 0x47e03d80 # implver $0
+- lda \$2,259
+- .long 0x47e20c21 # amask $2,$1
+- srl \$1,8,\$2
+- sll \$2,2,\$2
+- sll \$0,3,\$0
+- addl \$1,\$0,\$0
+- addl \$2,\$0,\$0
+- ret \$31,(\$26),1
+- .end main
+-EOF
+- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- ./$dummy
+- case "$?" in
+- 7)
+- UNAME_MACHINE="alpha"
+- ;;
+- 15)
+- UNAME_MACHINE="alphaev5"
+- ;;
+- 14)
+- UNAME_MACHINE="alphaev56"
+- ;;
+- 10)
+- UNAME_MACHINE="alphapca56"
+- ;;
+- 16)
+- UNAME_MACHINE="alphaev6"
+- ;;
+- esac
+- fi
+- rm -f $dummy.s $dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+@@ -127,34 +292,13 @@
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+- echo m68k-cbm-sysv4
++ echo m68k-unknown-sysv4
+ exit 0;;
+- amiga:NetBSD:*:*)
+- echo m68k-cbm-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- amiga:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+- arc64:OpenBSD:*:*)
+- echo mips64el-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- arc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- hkmips:OpenBSD:*:*)
+- echo mips-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- pmax:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sgi:OpenBSD:*:*)
+- echo mips-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- wgrisc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ *:[Mm]orph[Oo][Ss]:*:*)
++ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+@@ -162,10 +306,7 @@
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+- arm32:NetBSD:*:*)
+- echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+- exit 0 ;;
+- SR2?01:HI-UX/MPP:*:*)
++ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+@@ -179,6 +320,10 @@
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
++ DRS?6000:UNIX_SV:4.2*:7*)
++ case `/usr/bin/uname -p` in
++ sparc) echo sparc-icl-nx7 && exit 0 ;;
++ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+@@ -207,7 +352,7 @@
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
++ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+@@ -221,15 +366,9 @@
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+- atari*:NetBSD:*:*)
+- echo m68k-atari-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- atari*:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+- # "atarist" or "atariste" at least should have a processor
++ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+@@ -253,30 +392,9 @@
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+- sun3*:NetBSD:*:*)
+- echo m68k-sun-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sun3*:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mac68k:NetBSD:*:*)
+- echo m68k-apple-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mac68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvme68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvme88k:OpenBSD:*:*)
+- echo m88k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+- macppc:NetBSD:*:*)
+- echo powerpc-apple-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+@@ -290,8 +408,10 @@
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
++ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __cplusplus
++#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+ #else
+ int main (argc, argv) int argc; char *argv[]; {
+@@ -310,12 +430,20 @@
+ exit (-1);
+ }
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy \
+- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+- && rm $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c \
++ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
++ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
++ Motorola:PowerMAX_OS:*:*)
++ echo powerpc-motorola-powermax
++ exit 0 ;;
++ Motorola:*:4.3:PL8-*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
++ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+@@ -331,7 +459,7 @@
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
++ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+@@ -363,11 +491,20 @@
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+- i?86:AIX:*:*)
++ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
++ ia64:AIX:*:*)
++ if [ -x /usr/bin/oslevel ] ; then
++ IBM_REV=`/usr/bin/oslevel`
++ else
++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
++ fi
++ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
++ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
++ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+@@ -379,8 +516,7 @@
+ exit(0);
+ }
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+@@ -388,9 +524,9 @@
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+- *:AIX:*:4)
+- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+- if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
++ *:AIX:*:[45])
++ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
++ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+@@ -398,7 +534,7 @@
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+- IBM_REV=4.${UNAME_RELEASE}
++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+@@ -408,7 +544,7 @@
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
++ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+@@ -424,11 +560,30 @@
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+- sed 's/^ //' << EOF >$dummy.c
++ if [ -x /usr/bin/getconf ]; then
++ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
++ case "${sc_cpu_version}" in
++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
++ 532) # CPU_PA_RISC2_0
++ case "${sc_kernel_bits}" in
++ 32) HP_ARCH="hppa2.0n" ;;
++ 64) HP_ARCH="hppa2.0w" ;;
++ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
++ esac ;;
++ esac
++ fi
++ if [ "${HP_ARCH}" = "" ]; then
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++
++ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+@@ -459,13 +614,29 @@
+ exit (0);
+ }
+ EOF
+- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+- rm -f $dummy.c $dummy
++ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
++ test -z "$HP_ARCH" && HP_ARCH=hppa
++ fi ;;
+ esac
+- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++ if [ ${HP_ARCH} = "hppa2.0w" ]
++ then
++ # avoid double evaluation of $set_cc_for_build
++ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
++ then
++ HP_ARCH="hppa2.0w"
++ else
++ HP_ARCH="hppa64"
++ fi
++ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
++ ia64:HP-UX:*:*)
++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++ echo ia64-hp-hpux${HPUX_REV}
++ exit 0 ;;
+ 3050*:HI-UX:*:*)
++ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+@@ -491,8 +662,7 @@
+ exit (0);
+ }
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+@@ -501,7 +671,7 @@
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+- *9??*:MPE/iX:*:*)
++ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+@@ -510,7 +680,7 @@
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+- i?86:OSF1:*:*)
++ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+@@ -520,9 +690,6 @@
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+- hppa*:OpenBSD:*:*)
+- echo hppa-unknown-openbsd
+- exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+@@ -541,41 +708,34 @@
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+- CRAY*X-MP:*:*:*)
+- echo xmp-cray-unicos
+- exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+- echo ymp-cray-unicos${UNAME_RELEASE}
++ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
++ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
++ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+- echo t90-cray-unicos${UNAME_RELEASE}
++ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+- echo alpha-cray-unicosmk${UNAME_RELEASE}
++ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+- CRAY-2:*:*:*)
+- echo cray2-cray-unicos
+- exit 0 ;;
+- F300:UNIX_System_V:*:*)
++ CRAY*SV1:*:*:*)
++ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ *:UNICOS/mp:*:*)
++ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
++ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+- F301:UNIX_System_V:*:*)
+- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+- exit 0 ;;
+- hp3[0-9][05]:NetBSD:*:*)
+- echo m68k-hp-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- hp300:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
++ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+@@ -584,20 +744,19 @@
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+- *:FreeBSD:*:*)
+- if test -x /usr/bin/objformat; then
+- if test "elf" = "`/usr/bin/objformat`"; then
+- echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
+- exit 0
+- fi
+- fi
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+- exit 0 ;;
+- *:NetBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
+- exit 0 ;;
+- *:OpenBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
++ # Determine whether the default compiler uses glibc.
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #include <features.h>
++ #if __GLIBC__ >= 2
++ LIBC=gnu
++ #else
++ LIBC=
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
++ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+@@ -605,11 +764,20 @@
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
++ i*:PW*:*)
++ echo ${UNAME_MACHINE}-pc-pw32
++ exit 0 ;;
++ x86:Interix*:3*)
++ echo i586-pc-interix3
++ exit 0 ;;
++ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
++ echo i${UNAME_MACHINE}-pc-mks
++ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+- echo i386-pc-interix
++ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+@@ -623,201 +791,159 @@
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+- *:Linux:*:*)
+-
++ i*86:Minix:*:*)
++ echo ${UNAME_MACHINE}-pc-minix
++ exit 0 ;;
++ arm*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ ia64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ m68*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ mips:Linux:*:*)
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips
++ #undef mipsel
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mipsel
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips
++ #else
++ CPU=
++ #endif
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ ;;
++ mips64:Linux:*:*)
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips64
++ #undef mips64el
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mips64el
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips64
++ #else
++ CPU=
++ #endif
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ ;;
++ ppc:Linux:*:*)
++ echo powerpc-unknown-linux-gnu
++ exit 0 ;;
++ ppc64:Linux:*:*)
++ echo powerpc64-unknown-linux-gnu
++ exit 0 ;;
++ alpha:Linux:*:*)
++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++ EV5) UNAME_MACHINE=alphaev5 ;;
++ EV56) UNAME_MACHINE=alphaev56 ;;
++ PCA56) UNAME_MACHINE=alphapca56 ;;
++ PCA57) UNAME_MACHINE=alphapca56 ;;
++ EV6) UNAME_MACHINE=alphaev6 ;;
++ EV67) UNAME_MACHINE=alphaev67 ;;
++ EV68*) UNAME_MACHINE=alphaev68 ;;
++ esac
++ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ exit 0 ;;
++ parisc:Linux:*:* | hppa:Linux:*:*)
++ # Look for CPU level
++ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
++ PA7*) echo hppa1.1-unknown-linux-gnu ;;
++ PA8*) echo hppa2.0-unknown-linux-gnu ;;
++ *) echo hppa-unknown-linux-gnu ;;
++ esac
++ exit 0 ;;
++ parisc64:Linux:*:* | hppa64:Linux:*:*)
++ echo hppa64-unknown-linux-gnu
++ exit 0 ;;
++ s390:Linux:*:* | s390x:Linux:*:*)
++ echo ${UNAME_MACHINE}-ibm-linux
++ exit 0 ;;
++ sh*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ sparc:Linux:*:* | sparc64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ x86_64:Linux:*:*)
++ echo x86_64-unknown-linux-gnu
++ exit 0 ;;
++ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+- ld_help_string=`cd /; ld --help 2>&1`
+- ld_supported_emulations=`echo $ld_help_string \
+- | sed -ne '/supported emulations:/!d
++ # Set LC_ALL=C to ensure ld outputs messages in English.
++ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
++ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+- s/.*supported emulations: *//
++ s/.*supported targets: *//
+ s/ .*//
+ p'`
+- case "$ld_supported_emulations" in
+- *ia64)
+- echo "${UNAME_MACHINE}-unknown-linux"
+- exit 0
++ case "$ld_supported_targets" in
++ elf32-i386)
++ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+- i?86linux)
++ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+- exit 0
+- ;;
+- i?86coff)
++ exit 0 ;;
++ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+- exit 0
+- ;;
+- sparclinux)
+- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+- exit 0
+- ;;
+- armlinux)
+- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+- exit 0
+- ;;
+- elf32arm*)
+- echo "${UNAME_MACHINE}-unknown-linux-gnu"
+- exit 0
+- ;;
+- armelf_linux*)
+- echo "${UNAME_MACHINE}-unknown-linux-gnu"
+- exit 0
+- ;;
+- m68klinux)
+- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+- exit 0
+- ;;
+- elf32ppc)
+- # Determine Lib Version
+- cat >$dummy.c <<EOF
+-#include <features.h>
+-#if defined(__GLIBC__)
+-extern char __libc_version[];
+-extern char __libc_release[];
+-#endif
+-main(argc, argv)
+- int argc;
+- char *argv[];
+-{
+-#if defined(__GLIBC__)
+- printf("%s %s\n", __libc_version, __libc_release);
+-#else
+- printf("unkown\n");
+-#endif
+- return 0;
+-}
+-EOF
+- LIBC=""
+- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- ./$dummy | grep 1\.99 > /dev/null
+- if test "$?" = 0 ; then
+- LIBC="libc1"
+- fi
+- fi
+- rm -f $dummy.c $dummy
+- echo powerpc-unknown-linux-gnu${LIBC}
+- exit 0
+- ;;
++ exit 0 ;;
++ "")
++ # Either a pre-BFD a.out linker (linux-gnuoldld) or
++ # one that does not give us useful --help.
++ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
++ exit 0 ;;
+ esac
+-
+- if test "${UNAME_MACHINE}" = "alpha" ; then
+- sed 's/^ //' <<EOF >$dummy.s
+- .globl main
+- .ent main
+- main:
+- .frame \$30,0,\$26,0
+- .prologue 0
+- .long 0x47e03d80 # implver $0
+- lda \$2,259
+- .long 0x47e20c21 # amask $2,$1
+- srl \$1,8,\$2
+- sll \$2,2,\$2
+- sll \$0,3,\$0
+- addl \$1,\$0,\$0
+- addl \$2,\$0,\$0
+- ret \$31,(\$26),1
+- .end main
+-EOF
+- LIBC=""
+- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- ./$dummy
+- case "$?" in
+- 7)
+- UNAME_MACHINE="alpha"
+- ;;
+- 15)
+- UNAME_MACHINE="alphaev5"
+- ;;
+- 14)
+- UNAME_MACHINE="alphaev56"
+- ;;
+- 10)
+- UNAME_MACHINE="alphapca56"
+- ;;
+- 16)
+- UNAME_MACHINE="alphaev6"
+- ;;
+- esac
+-
+- objdump --private-headers $dummy | \
+- grep ld.so.1 > /dev/null
+- if test "$?" = 0 ; then
+- LIBC="libc1"
+- fi
+- fi
+- rm -f $dummy.s $dummy
+- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
+- elif test "${UNAME_MACHINE}" = "mips" ; then
+- cat >$dummy.c <<EOF
+-#ifdef __cplusplus
+- int main (int argc, char *argv[]) {
+-#else
+- int main (argc, argv) int argc; char *argv[]; {
+-#endif
+-#ifdef __MIPSEB__
+- printf ("%s-unknown-linux-gnu\n", argv[1]);
+-#endif
+-#ifdef __MIPSEL__
+- printf ("%sel-unknown-linux-gnu\n", argv[1]);
+-#endif
+- return 0;
+-}
+-EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
+- else
+- # Either a pre-BFD a.out linker (linux-gnuoldld)
+- # or one that does not give us useful --help.
+- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+- # If ld does not provide *any* "supported emulations:"
+- # that means it is gnuoldld.
+- echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+- test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+-
+- case "${UNAME_MACHINE}" in
+- i?86)
+- VENDOR=pc;
+- ;;
+- *)
+- VENDOR=unknown;
+- ;;
+- esac
+- # Determine whether the default compiler is a.out or elf
+- cat >$dummy.c <<EOF
+-#include <features.h>
+-#ifdef __cplusplus
+- int main (int argc, char *argv[]) {
+-#else
+- int main (argc, argv) int argc; char *argv[]; {
+-#endif
+-#ifdef __ELF__
+-# ifdef __GLIBC__
+-# if __GLIBC__ >= 2
+- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+-# else
+- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+-# endif
+-# else
+- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+-# endif
+-#else
+- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+-#endif
+- return 0;
+-}
++ # Determine whether the default compiler is a.out or elf
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #include <features.h>
++ #ifdef __ELF__
++ # ifdef __GLIBC__
++ # if __GLIBC__ >= 2
++ LIBC=gnu
++ # else
++ LIBC=gnulibc1
++ # endif
++ # else
++ LIBC=gnulibc1
++ # endif
++ #else
++ #ifdef __INTEL_COMPILER
++ LIBC=gnu
++ #else
++ LIBC=gnuaout
++ #endif
++ #endif
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
+- fi ;;
+-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+-# are messed up and put the nodename in both sysname and nodename.
+- i?86:DYNIX/ptx:4*:*)
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
++ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
++ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
++ ;;
++ i*86:DYNIX/ptx:4*:*)
++ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
++ # earlier versions are messed up and put the nodename in both
++ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+- i?86:UNIX_SV:4.2MP:2.*)
++ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+@@ -825,7 +951,24 @@
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
++ i*86:OS/2:*:*)
++ # If we were able to find `uname', then EMX Unix compatibility
++ # is probably installed.
++ echo ${UNAME_MACHINE}-pc-os2-emx
++ exit 0 ;;
++ i*86:XTS-300:*:STOP)
++ echo ${UNAME_MACHINE}-unknown-stop
++ exit 0 ;;
++ i*86:atheos:*:*)
++ echo ${UNAME_MACHINE}-unknown-atheos
++ exit 0 ;;
++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++ echo i386-unknown-lynxos${UNAME_RELEASE}
++ exit 0 ;;
++ i*86:*DOS:*:*)
++ echo ${UNAME_MACHINE}-pc-msdosdjgpp
++ exit 0 ;;
++ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+@@ -833,27 +976,26 @@
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+- i?86:*:5:7*)
+- # Fixed at (any) Pentium or better
+- UNAME_MACHINE=i586
+- if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
+- echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
+- else
+- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+- fi
++ i*86:*:5:[78]*)
++ case `/bin/uname -X | grep "^Machine"` in
++ *486*) UNAME_MACHINE=i486 ;;
++ *Pentium) UNAME_MACHINE=i586 ;;
++ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
++ esac
++ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+- i?86:*:3.2:*)
++ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
++ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
++ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
++ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
++ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
++ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+@@ -861,6 +1003,7 @@
+ fi
+ exit 0 ;;
+ pc:*:*:*)
++ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+@@ -882,9 +1025,15 @@
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
++ mc68k:UNIX:SYSTEM5:3.51m)
++ echo m68k-convergent-sysv
++ exit 0 ;;
++ M680?0:D-NIX:5.3:*)
++ echo m68k-diab-dnix
++ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
++ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+@@ -895,21 +1044,21 @@
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+- m68*:LynxOS:2.*:*)
++ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+- i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
+- echo i386-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
++ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
++ echo powerpc-unknown-lynxos${UNAME_RELEASE}
++ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+@@ -927,8 +1076,8 @@
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+- # says <Richard.M.Bartel@ccMail.Census.GOV>
++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+@@ -940,10 +1089,14 @@
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
++ *:VOS:*:*)
++ # From Paul.Green@stratus.com.
++ echo hppa1.1-stratus-vos
++ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+- news*:NEWS-OS:*:6*)
++ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+@@ -968,20 +1121,80 @@
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
++ SX-6:SUPER-UX:*:*)
++ echo sx6-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
++ *:Darwin:*:*)
++ case `uname -p` in
++ *86) UNAME_PROCESSOR=i686 ;;
++ powerpc) UNAME_PROCESSOR=powerpc ;;
++ esac
++ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
++ exit 0 ;;
++ *:procnto*:*:* | *:QNX:[0123456789]*:*)
++ UNAME_PROCESSOR=`uname -p`
++ if test "$UNAME_PROCESSOR" = "x86"; then
++ UNAME_PROCESSOR=i386
++ UNAME_MACHINE=pc
++ fi
++ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
++ exit 0 ;;
+ *:QNX:*:4*)
+- echo i386-qnx-qnx${UNAME_VERSION}
++ echo i386-pc-qnx
++ exit 0 ;;
++ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
++ echo nsr-tandem-nsk${UNAME_RELEASE}
++ exit 0 ;;
++ *:NonStop-UX:*:*)
++ echo mips-compaq-nonstopux
++ exit 0 ;;
++ BS2000:POSIX*:*:*)
++ echo bs2000-siemens-sysv
++ exit 0 ;;
++ DS/*:UNIX_System_V:*:*)
++ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
++ exit 0 ;;
++ *:Plan9:*:*)
++ # "uname -m" is not consistent, so use $cputype instead. 386
++ # is converted to i386 for consistency with other x86
++ # operating systems.
++ if test "$cputype" = "386"; then
++ UNAME_MACHINE=i386
++ else
++ UNAME_MACHINE="$cputype"
++ fi
++ echo ${UNAME_MACHINE}-unknown-plan9
++ exit 0 ;;
++ *:TOPS-10:*:*)
++ echo pdp10-unknown-tops10
++ exit 0 ;;
++ *:TENEX:*:*)
++ echo pdp10-unknown-tenex
++ exit 0 ;;
++ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
++ echo pdp10-dec-tops20
++ exit 0 ;;
++ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
++ echo pdp10-xkl-tops20
++ exit 0 ;;
++ *:TOPS-20:*:*)
++ echo pdp10-unknown-tops20
++ exit 0 ;;
++ *:ITS:*:*)
++ echo pdp10-unknown-its
+ exit 0 ;;
+ esac
+
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+ #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
++eval $set_cc_for_build
+ cat >$dummy.c <<EOF
+ #ifdef _SEQUENT_
+ # include <sys/types.h>
+@@ -1068,11 +1281,24 @@
+ #endif
+
+ #if defined (vax)
+-#if !defined (ultrix)
+- printf ("vax-dec-bsd\n"); exit (0);
+-#else
+- printf ("vax-dec-ultrix\n"); exit (0);
+-#endif
++# if !defined (ultrix)
++# include <sys/param.h>
++# if defined (BSD)
++# if BSD == 43
++ printf ("vax-dec-bsd4.3\n"); exit (0);
++# else
++# if BSD == 199006
++ printf ("vax-dec-bsd4.3reno\n"); exit (0);
++# else
++ printf ("vax-dec-bsd\n"); exit (0);
++# endif
++# endif
++# else
++ printf ("vax-dec-bsd\n"); exit (0);
++# endif
++# else
++ printf ("vax-dec-ultrix\n"); exit (0);
++# endif
+ #endif
+
+ #if defined (alliant) && defined (i860)
+@@ -1083,8 +1309,7 @@
+ }
+ EOF
+
+-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+-rm -f $dummy.c $dummy
++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+ # Apollos put the system type in the environment.
+
+@@ -1116,6 +1341,48 @@
+ esac
+ fi
+
+-#echo '(Unable to guess system type)' 1>&2
++cat >&2 <<EOF
++$0: unable to guess system type
++
++This script, last modified $timestamp, has failed to recognize
++the operating system you are using. It is advised that you
++download the most up to date version of the config scripts from
++
++ ftp://ftp.gnu.org/pub/gnu/config/
++
++If the version you run ($0) is already up to date, please
++send the following data and any information you think might be
++pertinent to <config-patches@gnu.org> in order to provide the needed
++information to handle your system.
++
++config.guess timestamp = $timestamp
++
++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`
++/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
++
++hostinfo = `(hostinfo) 2>/dev/null`
++/bin/universe = `(/bin/universe) 2>/dev/null`
++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
++/bin/arch = `(/bin/arch) 2>/dev/null`
++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
++
++UNAME_MACHINE = ${UNAME_MACHINE}
++UNAME_RELEASE = ${UNAME_RELEASE}
++UNAME_SYSTEM = ${UNAME_SYSTEM}
++UNAME_VERSION = ${UNAME_VERSION}
++EOF
+
+ exit 1
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+--- glib1.2-1.2.10.orig/config.sub
++++ glib1.2-1.2.10/config.sub
+@@ -1,6 +1,10 @@
+ #! /bin/sh
+-# Configuration validation subroutine script, version 1.1.
+-# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
++# Configuration validation subroutine script.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++
++timestamp='2003-05-09'
++
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+ # can handle that machine. It does not imply ALL GNU software can.
+@@ -25,6 +29,9 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
++#
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+ # If it is invalid, we print an error message on stderr and exit with code 1.
+@@ -45,30 +52,73 @@
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
+-if [ x$1 = x ]
+-then
+- echo Configuration name missing. 1>&2
+- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+- echo "or $0 ALIAS" 1>&2
+- echo where ALIAS is a recognized configuration type. 1>&2
+- exit 1
+-fi
++me=`echo "$0" | sed -e 's,.*/,,'`
+
+-# First pass through any local machine types.
+-case $1 in
+- *local*)
+- echo $1
+- exit 0
+- ;;
+- *)
+- ;;
++usage="\
++Usage: $0 [OPTION] CPU-MFR-OPSYS
++ $0 [OPTION] ALIAS
++
++Canonicalize a configuration name.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.sub ($timestamp)
++
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
++Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit 0 ;;
++ --version | -v )
++ echo "$version" ; exit 0 ;;
++ --help | --h* | -h )
++ echo "$usage"; exit 0 ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help"
++ exit 1 ;;
++
++ *local*)
++ # First pass through any local machine types.
++ echo $1
++ exit 0;;
++
++ * )
++ break ;;
++ esac
++done
++
++case $# in
++ 0) echo "$me: missing argument$help" >&2
++ exit 1;;
++ 1) ;;
++ *) echo "$me: too many arguments$help" >&2
++ exit 1;;
+ esac
+
+ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- linux-gnu*)
++ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -94,7 +144,7 @@
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple)
++ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+@@ -108,6 +158,14 @@
+ os=-vxworks
+ basic_machine=$1
+ ;;
++ -chorusos*)
++ os=-chorusos
++ basic_machine=$1
++ ;;
++ -chorusrdb)
++ os=-chorusrdb
++ basic_machine=$1
++ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+@@ -166,27 +224,62 @@
+ case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+- tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+- | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
+- | 580 | i960 | h8300 \
+- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
+- | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
+- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
+- | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
+- | mips64orion | mips64orionel | mipstx39 | mipstx39el \
+- | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
+- | mips64vr5000 | miprs64vr5000el | mcore \
+- | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
+- | thumb | d10v | fr30)
++ 1750a | 580 \
++ | a29k \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++ | clipper \
++ | d10v | d30v | dlx | dsp16xx \
++ | fr30 | frv \
++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | i370 | i860 | i960 | ia64 \
++ | ip2k \
++ | m32r | m68000 | m68k | m88k | mcore \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64el \
++ | mips64vr | mips64vrel \
++ | mips64orion | mips64orionel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipstx39 | mipstx39el \
++ | mn10200 | mn10300 \
++ | msp430 \
++ | ns16k | ns32k \
++ | openrisc | or32 \
++ | pdp10 | pdp11 | pj | pjl \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | pyramid \
++ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
++ | sh64 | sh64le \
++ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
++ | strongarm \
++ | tahoe | thumb | tic80 | tron \
++ | v850 | v850e \
++ | we32k \
++ | x86 | xscale | xstormy16 | xtensa \
++ | z8k)
++ basic_machine=$basic_machine-unknown
++ ;;
++ m6811 | m68hc11 | m6812 | m68hc12)
++ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
++ os=-none
+ ;;
+- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+- i[34567]86)
++ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+@@ -195,24 +288,60 @@
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+- # FIXME: clean up the formatting here.
+- vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
+- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+- | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
+- | xmp-* | ymp-* \
+- | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
+- | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
+- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
+- | clipper-* | orion-* \
+- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+- | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
+- | mips64el-* | mips64orion-* | mips64orionel-* \
+- | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
+- | mipstx39-* | mipstx39el-* | mcore-* \
+- | f301-* | armv*-* | t3e-* \
+- | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
+- | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
++ 580-* \
++ | a29k-* \
++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
++ | avr-* \
++ | bs2000-* \
++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
++ | clipper-* | cydra-* \
++ | d10v-* | d30v-* | dlx-* \
++ | elxsi-* \
++ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
++ | h8300-* | h8500-* \
++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++ | i*86-* | i860-* | i960-* | ia64-* \
++ | ip2k-* \
++ | m32r-* \
++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
++ | m88110-* | m88k-* | mcore-* \
++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
++ | mips16-* \
++ | mips64-* | mips64el-* \
++ | mips64vr-* | mips64vrel-* \
++ | mips64orion-* | mips64orionel-* \
++ | mips64vr4100-* | mips64vr4100el-* \
++ | mips64vr4300-* | mips64vr4300el-* \
++ | mips64vr5000-* | mips64vr5000el-* \
++ | mipsisa32-* | mipsisa32el-* \
++ | mipsisa32r2-* | mipsisa32r2el-* \
++ | mipsisa64-* | mipsisa64el-* \
++ | mipsisa64sb1-* | mipsisa64sb1el-* \
++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
++ | mipstx39-* | mipstx39el-* \
++ | msp430-* \
++ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
++ | orion-* \
++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++ | pyramid-* \
++ | romp-* | rs6000-* \
++ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
++ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
++ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
++ | tahoe-* | thumb-* \
++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++ | tron-* \
++ | v850-* | v850e-* | vax-* \
++ | we32k-* \
++ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
++ | xtensa-* \
++ | ymp-* \
++ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+@@ -244,19 +373,22 @@
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
++ amd64)
++ basic_machine=x86_64-pc
++ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+@@ -275,6 +407,10 @@
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
++ c90)
++ basic_machine=c90-cray
++ os=-unicos
++ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+@@ -295,27 +431,30 @@
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+- cray | ymp)
+- basic_machine=ymp-cray
+- os=-unicos
+- ;;
+- cray2)
+- basic_machine=cray2-cray
+- os=-unicos
+- ;;
+- [ctj]90-cray)
+- basic_machine=c90-cray
++ cray | j90)
++ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
++ cris | cris-* | etrax*)
++ basic_machine=cris-axis
++ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
++ decsystem10* | dec10*)
++ basic_machine=pdp10-dec
++ os=-tops10
++ ;;
++ decsystem20* | dec20*)
++ basic_machine=pdp10-dec
++ os=-tops20
++ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+@@ -357,6 +496,10 @@
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
++ go32)
++ basic_machine=i386-pc
++ os=-go32
++ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+@@ -432,19 +575,19 @@
+ basic_machine=i370-ibm
+ ;;
+ # I'm not sure what "Sysv32" means. Should this be sysv3.2?
+- i[34567]86v32)
++ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+- i[34567]86v4*)
++ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+- i[34567]86v)
++ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+- i[34567]86sol2)
++ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+@@ -456,17 +599,6 @@
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+- i386-go32 | go32)
+- basic_machine=i386-unknown
+- os=-go32
+- ;;
+- i386-mingw32 | mingw32)
+- basic_machine=i386-unknown
+- os=-mingw32
+- ;;
+- i386-qnx | qnx)
+- basic_machine=i386-qnx
+- ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+@@ -492,6 +624,10 @@
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
++ mingw32)
++ basic_machine=i386-pc
++ os=-mingw32
++ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+@@ -499,26 +635,26 @@
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+- mipsel*-linux*)
+- basic_machine=mipsel-unknown
+- os=-linux-gnu
+- ;;
+- mips*-linux*)
+- basic_machine=mips-unknown
+- os=-linux-gnu
+- ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
++ mmix*)
++ basic_machine=mmix-knuth
++ os=-mmixware
++ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
++ morphos)
++ basic_machine=powerpc-unknown
++ os=-morphos
++ ;;
+ msdos)
+- basic_machine=i386-unknown
++ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+@@ -582,13 +718,28 @@
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
++ nonstopux)
++ basic_machine=mips-compaq
++ os=-nonstopux
++ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
++ nv1)
++ basic_machine=nv1-cray
++ os=-unicosmp
++ ;;
++ nsr-tandem)
++ basic_machine=nsr-tandem
++ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
++ or32 | or32-*)
++ basic_machine=or32-unknown
++ os=-coff
++ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+@@ -611,45 +762,59 @@
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+- pc532 | pc532-*)
++ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+- pentium | p5 | k5 | k6 | nexen)
++ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+- pentiumpro | p6 | 6x86)
++ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2)
+- basic_machine=i786-pc
++ basic_machine=i686-pc
+ ;;
+- pentium-* | p5-* | k5-* | k6-* | nexen-*)
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+- pentiumpro-* | p6-* | 6x86-*)
++ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-*)
+- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+- power) basic_machine=rs6000-ibm
++ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+- ;;
++ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+- ;;
++ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
++ ppc64) basic_machine=powerpc64-unknown
++ ;;
++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
++ basic_machine=powerpc64le-unknown
++ ;;
++ ppc64le-* | powerpc64little-*)
++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
++ pw32)
++ basic_machine=i586-unknown
++ os=-pw32
++ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+@@ -660,10 +825,22 @@
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
++ s390 | s390-*)
++ basic_machine=s390-ibm
++ ;;
++ s390x | s390x-*)
++ basic_machine=s390x-ibm
++ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
++ sb1)
++ basic_machine=mipsisa64sb1-unknown
++ ;;
++ sb1el)
++ basic_machine=mipsisa64sb1el-unknown
++ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+@@ -671,7 +848,7 @@
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+- sparclite-wrs)
++ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+@@ -729,20 +906,48 @@
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
++ sv1)
++ basic_machine=sv1-cray
++ os=-unicos
++ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+- basic_machine=t3e-cray
++ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
++ t90)
++ basic_machine=t90-cray
++ os=-unicos
++ ;;
++ tic4x | c4x*)
++ basic_machine=tic4x-unknown
++ os=-coff
++ ;;
++ tic54x | c54x*)
++ basic_machine=tic54x-unknown
++ os=-coff
++ ;;
++ tic55x | c55x*)
++ basic_machine=tic55x-unknown
++ os=-coff
++ ;;
++ tic6x | c6x*)
++ basic_machine=tic6x-unknown
++ os=-coff
++ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ os=-tops20
++ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+@@ -767,8 +972,8 @@
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
+- ;;
++ basic_machine=f301-fujitsu
++ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+@@ -789,13 +994,13 @@
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+- xmp)
+- basic_machine=xmp-cray
+- os=-unicos
+- ;;
+- xps | xps100)
++ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
++ ymp)
++ basic_machine=ymp-cray
++ os=-unicos
++ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+@@ -816,13 +1021,6 @@
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+- mips)
+- if [ x$os = x-linux-gnu ]; then
+- basic_machine=mips-unknown
+- else
+- basic_machine=mips-mips
+- fi
+- ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+@@ -832,16 +1030,26 @@
+ vax)
+ basic_machine=vax-dec
+ ;;
++ pdp10)
++ # there are many clones, so DEC is not a safe bet
++ basic_machine=pdp10-unknown
++ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+- sparc | sparcv9)
++ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
++ basic_machine=sh-unknown
++ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
++ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+- cydra)
++ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+@@ -856,9 +1064,8 @@
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+- c4x*)
+- basic_machine=c4x-none
+- os=-coff
++ *-unknown)
++ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+@@ -916,14 +1123,34 @@
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+- | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
++ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
++ | -powermax* | -dnix*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
++ -qnx*)
++ case $basic_machine in
++ x86-* | i*86-*)
++ ;;
++ *)
++ os=-nto$os
++ ;;
++ esac
++ ;;
++ -nto-qnx*)
++ ;;
++ -nto*)
++ os=`echo $os | sed -e 's|nto|nto-qnx|'`
++ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+- | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
++ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+@@ -940,6 +1167,9 @@
+ -opened*)
+ os=-openedition
+ ;;
++ -wince*)
++ os=-wince
++ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+@@ -955,14 +1185,23 @@
+ -acis*)
+ os=-aos
+ ;;
++ -atheos*)
++ os=-atheos
++ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
++ -nova*)
++ os=-rtmk-nova
++ ;;
+ -ns2 )
+- os=-nextstep2
++ os=-nextstep2
++ ;;
++ -nsk*)
++ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+@@ -977,9 +1216,6 @@
+ -oss*)
+ os=-sysv3
+ ;;
+- -qnx)
+- os=-qnx4
+- ;;
+ -svr4)
+ os=-sysv4
+ ;;
+@@ -1001,8 +1237,14 @@
+ -xenix)
+ os=-xenix
+ ;;
+- -*mint | -*MiNT)
+- os=-mint
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ os=-mint
++ ;;
++ -aros*)
++ os=-aros
++ ;;
++ -kaos*)
++ os=-kaos
+ ;;
+ -none)
+ ;;
+@@ -1035,7 +1277,11 @@
+ arm*-semi)
+ os=-aout
+ ;;
+- pdp11-*)
++ # This must come before the *-dec entry.
++ pdp10-*)
++ os=-tops20
++ ;;
++ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+@@ -1062,6 +1308,9 @@
+ mips*-*)
+ os=-elf
+ ;;
++ or32-*)
++ os=-coff
++ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+@@ -1125,25 +1374,25 @@
+ *-next)
+ os=-nextstep3
+ ;;
+- *-gould)
++ *-gould)
+ os=-sysv
+ ;;
+- *-highlevel)
++ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+- *-sgi)
++ *-sgi)
+ os=-irix
+ ;;
+- *-siemens)
++ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+- f301-fujitsu)
++ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+@@ -1209,7 +1458,7 @@
+ -ptx*)
+ vendor=sequent
+ ;;
+- -vxsim* | -vxworks*)
++ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+@@ -1221,12 +1470,23 @@
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+- -*mint | -*MiNT)
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
++ -vos*)
++ vendor=stratus
++ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+ esac
+
+ echo $basic_machine$os
++exit 0
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+--- glib1.2-1.2.10.orig/configure
++++ glib1.2-1.2.10/configure
+@@ -38,9 +38,170 @@
+ --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
+ ac_help="$ac_help
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
++
++# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++
++
++# Check that we are running under the correct shell.
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++case X$ECHO in
++X*--fallback-echo)
++ # Remove one level of quotation (which was required for Make).
++ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
++ ;;
++esac
++
++echo=${ECHO-echo}
++if test "X$1" = X--no-reexec; then
++ # Discard the --no-reexec flag, and continue.
++ shift
++elif test "X$1" = X--fallback-echo; then
++ # Avoid inline document here, it may be left over
++ :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
++ # Yippee, $echo works!
++ :
++else
++ # Restart under the correct shell.
++ exec $SHELL "$0" --no-reexec ${1+"$@"}
++fi
++
++if test "X$1" = X--fallback-echo; then
++ # used as fallback echo
++ shift
++ cat <<EOF
++
++EOF
++ exit 0
++fi
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++if test -z "$ECHO"; then
++if test "X${echo_test_string+set}" != Xset; then
++# find a string as large as possible, as long as the shell can cope with it
++ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
++ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
++ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
++ echo_test_string="`eval $cmd`" &&
++ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
++ then
++ break
++ fi
++ done
++fi
++
++if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ :
++else
++ # The Solaris, AIX, and Digital Unix default echo programs unquote
++ # backslashes. This makes it impossible to quote backslashes using
++ # echo "$something" | sed 's/\\/\\\\/g'
++ #
++ # So, first we look for a working echo in the user's PATH.
++
++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for dir in $PATH /usr/ucb; do
++ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
++ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$dir/echo"
++ break
++ fi
++ done
++ IFS="$save_ifs"
++
++ if test "X$echo" = Xecho; then
++ # We didn't find a better echo, so look for alternatives.
++ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # This shell has a builtin print -r that does the trick.
++ echo='print -r'
++ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
++ test "X$CONFIG_SHELL" != X/bin/ksh; then
++ # If we have ksh, try running configure again with it.
++ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
++ export ORIGINAL_CONFIG_SHELL
++ CONFIG_SHELL=/bin/ksh
++ export CONFIG_SHELL
++ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
++ else
++ # Try using printf.
++ echo='printf %s\n'
++ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # Cool, printf works
++ :
++ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
++ export CONFIG_SHELL
++ SHELL="$CONFIG_SHELL"
++ export SHELL
++ echo="$CONFIG_SHELL $0 --fallback-echo"
++ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$CONFIG_SHELL $0 --fallback-echo"
++ else
++ # maybe with a smaller string...
++ prev=:
++
++ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
++ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
++ then
++ break
++ fi
++ prev="$cmd"
++ done
++
++ if test "$prev" != 'sed 50q "$0"'; then
++ echo_test_string=`eval $prev`
++ export echo_test_string
++ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
++ else
++ # Oops. We lost completely, so just stick with echo.
++ echo=echo
++ fi
++ fi
++ fi
++ fi
++fi
++fi
++
++# Copy echo and quote the copy suitably for passing to libtool from
++# the Makefile, instead of quoting the original, which is used later.
++ECHO=$echo
++if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
++ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
++fi
++
++
+ ac_help="$ac_help
+ --disable-libtool-lock avoid locking (might break parallel builds)"
+ ac_help="$ac_help
++ --with-pic try to use only PIC/non-PIC objects [default=use both]"
++ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
+ if test `expr $GLIB_MINOR_VERSION \% 2` = 1 ; then
+@@ -618,6 +779,7 @@
+ ac_config_sub=$ac_aux_dir/config.sub
+ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
++am__api_version="1.4"
+ # 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:
+@@ -630,7 +792,7 @@
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+ # ./install, which can be erroneously created by make from ./install.sh.
+ echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:634: checking for a BSD compatible install" >&5
++echo "configure:796: checking for a BSD compatible install" >&5
+ if test -z "$INSTALL"; then
+ if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -683,7 +845,7 @@
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+ echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+-echo "configure:687: checking whether build environment is sane" >&5
++echo "configure:849: checking whether build environment is sane" >&5
+ # Just in case
+ sleep 1
+ echo timestamp > conftestfile
+@@ -740,7 +902,7 @@
+ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+-echo "configure:744: checking whether ${MAKE-make} sets \${MAKE}" >&5
++echo "configure:906: checking whether ${MAKE-make} sets \${MAKE}" >&5
+ set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -778,21 +940,21 @@
+
+
+ missing_dir=`cd $ac_aux_dir && pwd`
+-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+-echo "configure:783: checking for working aclocal" >&5
++echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6
++echo "configure:945: checking for working aclocal-${am__api_version}" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+- ACLOCAL=aclocal
++if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
++ ACLOCAL=aclocal-${am__api_version}
+ echo "$ac_t""found" 1>&6
+ else
+- ACLOCAL="$missing_dir/missing aclocal"
++ ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
+ echo "$ac_t""missing" 1>&6
+ fi
+
+ echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+-echo "configure:796: checking for working autoconf" >&5
++echo "configure:958: checking for working autoconf" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -804,21 +966,21 @@
+ echo "$ac_t""missing" 1>&6
+ fi
+
+-echo $ac_n "checking for working automake""... $ac_c" 1>&6
+-echo "configure:809: checking for working automake" >&5
++echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6
++echo "configure:971: checking for working automake-${am__api_version}" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+-if (automake --version) < /dev/null > /dev/null 2>&1; then
+- AUTOMAKE=automake
++if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
++ AUTOMAKE=automake-${am__api_version}
+ echo "$ac_t""found" 1>&6
+ else
+- AUTOMAKE="$missing_dir/missing automake"
++ AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
+ echo "$ac_t""missing" 1>&6
+ fi
+
+ echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+-echo "configure:822: checking for working autoheader" >&5
++echo "configure:984: checking for working autoheader" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -831,7 +993,7 @@
+ fi
+
+ echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+-echo "configure:835: checking for working makeinfo" >&5
++echo "configure:997: checking for working makeinfo" >&5
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+@@ -871,11 +1033,164 @@
+ EOF
+
+
++# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++
++echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
++echo "configure:1049: checking for Cygwin environment" >&5
++if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 1054 "configure"
++#include "confdefs.h"
++
++int main() {
++
++#ifndef __CYGWIN__
++#define __CYGWIN__ __CYGWIN32__
++#endif
++return __CYGWIN__;
++; return 0; }
++EOF
++if { (eval echo configure:1065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ ac_cv_cygwin=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ ac_cv_cygwin=no
++fi
++rm -f conftest*
++rm -f conftest*
++fi
++
++echo "$ac_t""$ac_cv_cygwin" 1>&6
++CYGWIN=
++test "$ac_cv_cygwin" = yes && CYGWIN=yes
++echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
++echo "configure:1082: checking for mingw32 environment" >&5
++if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 1087 "configure"
++#include "confdefs.h"
++
++int main() {
++return __MINGW32__;
++; return 0; }
++EOF
++if { (eval echo configure:1094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ ac_cv_mingw32=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ ac_cv_mingw32=no
++fi
++rm -f conftest*
++rm -f conftest*
++fi
++
++echo "$ac_t""$ac_cv_mingw32" 1>&6
++MINGW32=
++test "$ac_cv_mingw32" = yes && MINGW32=yes
++echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
++echo "configure:1111: checking how to run the C preprocessor" >&5
++# On Suns, sometimes $CPP names a directory.
++if test -n "$CPP" && test -d "$CPP"; then
++ CPP=
++fi
++if test -z "$CPP"; then
++if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ # This must be in double quotes, not single quotes, because CPP may get
++ # substituted into the Makefile and "${CC-cc}" will confuse make.
++ CPP="${CC-cc} -E"
++ # On the NeXT, cc -E runs the code through the compiler's parser,
++ # not just through cpp.
++ cat > conftest.$ac_ext <<EOF
++#line 1126 "configure"
++#include "confdefs.h"
++#include <assert.h>
++Syntax Error
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ :
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ CPP="${CC-cc} -E -traditional-cpp"
++ cat > conftest.$ac_ext <<EOF
++#line 1143 "configure"
++#include "confdefs.h"
++#include <assert.h>
++Syntax Error
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ :
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ CPP="${CC-cc} -nologo -E"
++ cat > conftest.$ac_ext <<EOF
++#line 1160 "configure"
++#include "confdefs.h"
++#include <assert.h>
++Syntax Error
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:1166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ :
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ CPP=/lib/cpp
++fi
++rm -f conftest*
++fi
++rm -f conftest*
++fi
++rm -f conftest*
++ ac_cv_prog_CPP="$CPP"
++fi
++ CPP="$ac_cv_prog_CPP"
++else
++ ac_cv_prog_CPP="$CPP"
++fi
++echo "$ac_t""$CPP" 1>&6
++
+ # Check whether --enable-shared or --disable-shared was given.
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+-case "$enableval" in
++case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+@@ -898,7 +1213,7 @@
+ if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+-case "$enableval" in
++case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+@@ -921,7 +1236,7 @@
+ if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+-case "$enableval" in
++case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+@@ -947,7 +1262,7 @@
+ fi
+
+ echo $ac_n "checking host system type""... $ac_c" 1>&6
+-echo "configure:951: checking host system type" >&5
++echo "configure:1266: checking host system type" >&5
+
+ host_alias=$host
+ case "$host_alias" in
+@@ -968,7 +1283,7 @@
+ echo "$ac_t""$host" 1>&6
+
+ echo $ac_n "checking build system type""... $ac_c" 1>&6
+-echo "configure:972: checking build system type" >&5
++echo "configure:1287: checking build system type" >&5
+
+ build_alias=$build
+ case "$build_alias" in
+@@ -985,40 +1300,10 @@
+ build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ echo "$ac_t""$build" 1>&6
+
+-# Extract the first word of "ranlib", so it can be a program name with args.
+-set dummy ranlib; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:992: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- if test -n "$RANLIB"; then
+- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_RANLIB="ranlib"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+-fi
+-fi
+-RANLIB="$ac_cv_prog_RANLIB"
+-if test -n "$RANLIB"; then
+- echo "$ac_t""$RANLIB" 1>&6
+-else
+- echo "$ac_t""no" 1>&6
+-fi
+-
+ # Extract the first word of "gcc", so it can be a program name with args.
+ set dummy gcc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1022: checking for $ac_word" >&5
++echo "configure:1307: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1048,7 +1333,7 @@
+ # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1052: checking for $ac_word" >&5
++echo "configure:1337: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1099,7 +1384,7 @@
+ # Extract the first word of "cl", so it can be a program name with args.
+ set dummy cl; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1103: checking for $ac_word" >&5
++echo "configure:1388: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1131,7 +1416,7 @@
+ fi
+
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:1135: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++echo "configure:1420: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ ac_ext=c
+ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+@@ -1142,12 +1427,12 @@
+
+ cat > conftest.$ac_ext << EOF
+
+-#line 1146 "configure"
++#line 1431 "configure"
+ #include "confdefs.h"
+
+ main(){return(0);}
+ EOF
+-if { (eval echo configure:1151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+@@ -1173,12 +1458,12 @@
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:1177: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "configure:1462: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+ cross_compiling=$ac_cv_prog_cc_cross
+
+ echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:1182: checking whether we are using GNU C" >&5
++echo "configure:1467: checking whether we are using GNU C" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1187,7 +1472,7 @@
+ yes;
+ #endif
+ EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+ else
+ ac_cv_prog_gcc=no
+@@ -1206,7 +1491,7 @@
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:1210: checking whether ${CC-cc} accepts -g" >&5
++echo "configure:1495: checking whether ${CC-cc} accepts -g" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1246,12 +1531,18 @@
+ fi
+
+ ac_prog=ld
+-if test "$ac_cv_prog_gcc" = yes; then
++if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+-echo "configure:1253: checking for ld used by GCC" >&5
+- ac_prog=`($CC -print-prog-name=ld) 2>&5`
+- case "$ac_prog" in
++echo "configure:1538: checking for ld used by GCC" >&5
++ 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.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+@@ -1273,24 +1564,24 @@
+ esac
+ elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+-echo "configure:1277: checking for GNU ld" >&5
++echo "configure:1568: checking for GNU ld" >&5
+ else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+-echo "configure:1280: checking for non-GNU ld" >&5
++echo "configure:1571: checking for non-GNU ld" >&5
+ fi
+-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
++if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test -z "$LD"; then
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+- ac_cv_path_LD="$ac_dir/$ac_prog"
++ 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 GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+- if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
++ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+@@ -1299,11 +1590,11 @@
+ done
+ IFS="$ac_save_ifs"
+ else
+- ac_cv_path_LD="$LD" # Let the user override the test with a path.
++ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+ fi
+ fi
+
+-LD="$ac_cv_path_LD"
++LD="$lt_cv_path_LD"
+ if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
+ else
+@@ -1311,245 +1602,3880 @@
+ fi
+ test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+ echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+-echo "configure:1315: checking if the linker ($LD) is GNU ld" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
++echo "configure:1606: checking if the linker ($LD) is GNU ld" >&5
++if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+ if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+- ac_cv_prog_gnu_ld=yes
++ lt_cv_prog_gnu_ld=yes
+ else
+- ac_cv_prog_gnu_ld=no
++ lt_cv_prog_gnu_ld=no
+ fi
+ fi
+
+-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
++echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
++with_gnu_ld=$lt_cv_prog_gnu_ld
++
++
++echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
++echo "configure:1623: checking for $LD option to reload object files" >&5
++if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ lt_cv_ld_reload_flag='-r'
++fi
+
++echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
++reload_flag=$lt_cv_ld_reload_flag
++test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+ echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+-echo "configure:1331: checking for BSD-compatible nm" >&5
+-if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
++echo "configure:1635: checking for BSD-compatible nm" >&5
++if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test -n "$NM"; then
+ # Let the user override the test.
+- ac_cv_path_NM="$NM"
++ lt_cv_path_NM="$NM"
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
++ tmp_nm=$ac_dir/${ac_tool_prefix}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
+- if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -B"
++ # Tru64's nm complains that /dev/null is an invalid object file
++ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -B"
+ break
+- elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- ac_cv_path_NM="$ac_dir/nm -p"
++ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -p"
+ break
+ else
+- ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
++ 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
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
++ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
++fi
++fi
++
++NM="$lt_cv_path_NM"
++echo "$ac_t""$NM" 1>&6
++
++echo $ac_n "checking for a sed that does not truncate output""... $ac_c" 1>&6
++echo "configure:1673: checking for a sed that does not truncate output" >&5
++if eval "test \"`echo '$''{'lt_cv_path_SED'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ # 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_executable_p="test -f"
++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
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ fi
++ done
++ done
++done
++
++ # Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++: ${TMPDIR=/tmp}
++{
++ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=$TMPDIR/sed$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
++ { (exit 1); exit 1; }
++}
++ _max=0
++ _count=0
++ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
++ # along with /bin/sed that truncates output.
++ for _sed in $_sed_list /usr/xpg4/bin/sed; do
++ test ! -f ${_sed} && break
++ cat /dev/null > "$tmp/sed.in"
++ _count=0
++ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
++ # Check for GNU sed and select it if it is found.
++ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
++ lt_cv_path_SED=${_sed}
++ break
++ fi
++ while true; do
++ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
++ mv "$tmp/sed.tmp" "$tmp/sed.in"
++ cp "$tmp/sed.in" "$tmp/sed.nl"
++ echo >>"$tmp/sed.nl"
++ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
++ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
++ # 40000 chars as input seems more than enough
++ test $_count -gt 10 && break
++ _count=`expr $_count + 1`
++ if test $_count -gt $_max; then
++ _max=$_count
++ lt_cv_path_SED=$_sed
++ fi
++ done
++ done
++ rm -rf "$tmp"
++
++fi
++
++if test "X$SED" != "X"; then
++ lt_cv_path_SED=$SED
++else
++ SED=$lt_cv_path_SED
++fi
++echo "$ac_t""$SED" 1>&6
++
++echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
++echo "configure:1757: checking whether ln -s works" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ rm -f conftestdata
++if ln -s X conftestdata 2>/dev/null
++then
++ rm -f conftestdata
++ ac_cv_prog_LN_S="ln -s"
++else
++ ac_cv_prog_LN_S=ln
+ fi
+ fi
++LN_S="$ac_cv_prog_LN_S"
++if test "$ac_cv_prog_LN_S" = "ln -s"; then
++ echo "$ac_t""yes" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++echo $ac_n "checking how to recognise dependent libraries""... $ac_c" 1>&6
++echo "configure:1778: checking how to recognise dependent libraries" >&5
++if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&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 egrep 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
++aix4* | aix5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++beos*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++bsdi4*)
++ 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* | mingw* | pw32*)
++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ lt_cv_file_magic_cmd='$OBJDUMP -f'
++ ;;
++
++darwin* | rhapsody*)
++ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
++ lt_cv_file_magic_cmd='/usr/bin/file -L'
++ case "$host_os" in
++ rhapsody* | darwin1.[012])
++ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
++ ;;
++ *) # Darwin 1.3 on
++ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
++ ;;
++ esac
++ ;;
++
++freebsd*)
++ 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)/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
++ ;;
++
++hpux10.20*|hpux11*)
++ 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_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=/usr/lib/libc.sl
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ irix5* | nonstopux*)
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
++ ;;
++ *)
++ case $LD in
++ *-32|*"-32 ") libmagic=32-bit;;
++ *-n32|*"-n32 ") libmagic=N32;;
++ *-64|*"-64 ") libmagic=64-bit;;
++ *) libmagic=never-match;;
++ esac
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
++ ;;
++ esac
++ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ case $host_cpu in
++ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*)
++ lt_cv_deplibs_check_method=pass_all ;;
++ *)
++ # glibc up to 2.1.1 does not perform some relocations on ARM
++ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
++ esac
++ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
++ ;;
++
++netbsd*)
++ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
++ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
++ else
++ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
++ 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
++ ;;
++
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
++osf3* | osf4* | osf5*)
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
++ lt_cv_file_magic_test_file=/shlib/libc.so
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sco3.2v5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++solaris*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=/lib/libc.so
++ ;;
++
++sysv5uw[78]* | sysv4*uw2*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ 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
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
++file_magic_cmd=$lt_cv_file_magic_cmd
++deplibs_check_method=$lt_cv_deplibs_check_method
++
++echo $ac_n "checking for object suffix""... $ac_c" 1>&6
++echo "configure:1964: checking for object suffix" >&5
++if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ rm -f conftest*
++echo 'int i = 1;' > conftest.$ac_ext
++if { (eval echo configure:1970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ for ac_file in conftest.*; do
++ case $ac_file in
++ *.c) ;;
++ *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
++ esac
++ done
++else
++ { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
++fi
++rm -f conftest*
++fi
++
++echo "$ac_t""$ac_cv_objext" 1>&6
++OBJEXT=$ac_cv_objext
++ac_objext=$ac_cv_objext
++
++
++
++echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
++echo "configure:1990: checking for executable suffix" >&5
++if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
++ ac_cv_exeext=.exe
++else
++ rm -f conftest*
++ echo 'int main () { return 0; }' > conftest.$ac_ext
++ ac_cv_exeext=
++ if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
++ for file in conftest.*; do
++ case $file in
++ *.$ac_ext | *.c | *.o | *.obj) ;;
++ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
++ esac
++ done
++ else
++ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
++ fi
++ rm -f conftest*
++ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
++fi
++fi
++
++EXEEXT=""
++test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
++echo "$ac_t""${ac_cv_exeext}" 1>&6
++ac_exeext=$EXEEXT
++
++if test $host != $build; then
++ ac_tool_prefix=${host_alias}-
++else
++ ac_tool_prefix=
++fi
++
++
++
++
++# Check for command to grab the raw symbol name followed by C symbol from nm.
++echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
++echo "configure:2031: checking command to parse $NM output" >&5
++if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&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]*\)'
++
++# Transform the above into a raw symbol and a C symbol.
++symxfrm='\1 \2\3 \3'
++
++# Transform an extracted symbol line into a proper C declaration
++lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
++
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
++# Define system-specific variables.
++case $host_os in
++aix*)
++ symcode='[BCDT]'
++ ;;
++cygwin* | mingw* | pw32*)
++ symcode='[ABCDGISTW]'
++ ;;
++hpux*) # Its linker distinguishes data from code symbols
++ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++ ;;
++irix* | nonstopux*)
++ symcode='[BCDEGRST]'
++ ;;
++osf*)
++ symcode='[BCDEGQRST]'
++ ;;
++solaris* | sysv5*)
++ symcode='[BDT]'
++ ;;
++sysv4)
++ symcode='[DFNSTU]'
++ ;;
++esac
++
++# Handle CRLF in mingw tool chain
++opt_cr=
++case $host_os in
++mingw*)
++ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
++ ;;
++esac
++
++# If we're using GNU nm, then use its standard symbol codes.
++if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
++ symcode='[ABCDGISTW]'
++fi
++
++# Try without a prefix undercore, then with it.
++for ac_symprfx in "" "_"; do
++
++ # Write the raw and C identifiers.
++lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
++
++ # Check to see that the pipe works correctly.
++ pipe_works=no
++ rm -f conftest*
++ cat > conftest.$ac_ext <<EOF
++#ifdef __cplusplus
++extern "C" {
++#endif
++char nm_test_var;
++void nm_test_func(){}
++#ifdef __cplusplus
++}
++#endif
++int main(){nm_test_var='a';nm_test_func();return(0);}
++EOF
++
++ if { (eval echo configure:2114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ # Now try to grab the symbols.
++ nlist=conftest.nm
++ if { (eval echo configure:2117: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && 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 egrep ' nm_test_var$' "$nlist" >/dev/null; then
++ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
++ cat <<EOF > conftest.$ac_ext
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++EOF
++ # Now generate the symbol file.
++ eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
++
++ cat <<EOF >> conftest.$ac_ext
++#if defined (__STDC__) && __STDC__
++# define lt_ptr void *
++#else
++# define lt_ptr char *
++# define const
++#endif
++
++/* The mapping between symbol names and symbols. */
++const struct {
++ const char *name;
++ lt_ptr address;
++}
++lt_preloaded_symbols[] =
++{
++EOF
++ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
++ cat <<\EOF >> conftest.$ac_ext
++ {0, (lt_ptr) 0}
++};
++
++#ifdef __cplusplus
++}
++#endif
++EOF
++ # Now try linking the two files.
++ mv conftest.$ac_objext conftstm.$ac_objext
++ save_LIBS="$LIBS"
++ save_CFLAGS="$CFLAGS"
++ LIBS="conftstm.$ac_objext"
++ CFLAGS="$CFLAGS$no_builtin_flag"
++ if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest$ac_exeext; then
++ pipe_works=yes
++ fi
++ LIBS="$save_LIBS"
++ CFLAGS="$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 -f 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
++
++global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
++if test -z "$lt_cv_sys_global_symbol_pipe"; then
++ global_symbol_to_cdecl=
++ global_symbol_to_c_name_address=
++else
++ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
++ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
++fi
++if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
++then
++ echo "$ac_t""failed" 1>&6
++else
++ echo "$ac_t""ok" 1>&6
++fi
++
++for ac_hdr in dlfcn.h
++do
++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
++echo "configure:2217: checking for $ac_hdr" >&5
++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 2222 "configure"
++#include "confdefs.h"
++#include <$ac_hdr>
++EOF
++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
++{ (eval echo configure:2227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
++if test -z "$ac_err"; then
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=yes"
++else
++ echo "$ac_err" >&5
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_header_$ac_safe=no"
++fi
++rm -f conftest*
++fi
++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++ cat >> confdefs.h <<EOF
++#define $ac_tr_hdr 1
++EOF
++
++else
++ echo "$ac_t""no" 1>&6
++fi
++done
++
++
++
++
++
++
++# Only perform the check for file, if the check method requires it
++case $deplibs_check_method in
++file_magic*)
++ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
++ echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
++echo "configure:2263: checking for ${ac_tool_prefix}file" >&5
++if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ case $MAGIC_CMD in
++ /*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++ ;;
++ ?:/*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="/usr/bin:$PATH"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_save_MAGIC_CMD"
++ ;;
++esac
++fi
++
++MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++if test -n "$MAGIC_CMD"; then
++ echo "$ac_t""$MAGIC_CMD" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++if test -z "$lt_cv_path_MAGIC_CMD"; then
++ if test -n "$ac_tool_prefix"; then
++ echo $ac_n "checking for file""... $ac_c" 1>&6
++echo "configure:2325: checking for file" >&5
++if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ case $MAGIC_CMD in
++ /*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++ ;;
++ ?:/*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="/usr/bin:$PATH"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_save_MAGIC_CMD"
++ ;;
++esac
++fi
++
++MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++if test -n "$MAGIC_CMD"; then
++ echo "$ac_t""$MAGIC_CMD" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++ else
++ MAGIC_CMD=:
++ fi
++fi
++
++ fi
++ ;;
++esac
++
++# 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
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:2396: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ if test -n "$RANLIB"; then
++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="$PATH"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++fi
++fi
++RANLIB="$ac_cv_prog_RANLIB"
++if test -n "$RANLIB"; then
++ echo "$ac_t""$RANLIB" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++
++if test -z "$ac_cv_prog_RANLIB"; then
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "ranlib", so it can be a program name with args.
++set dummy ranlib; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:2428: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ if test -n "$RANLIB"; then
++ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="$PATH"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ ac_cv_prog_RANLIB="ranlib"
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
++fi
++fi
++RANLIB="$ac_cv_prog_RANLIB"
++if test -n "$RANLIB"; then
++ echo "$ac_t""$RANLIB" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++else
++ RANLIB=":"
++fi
++fi
++
++# 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
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:2463: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ if test -n "$STRIP"; then
++ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="$PATH"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++fi
++fi
++STRIP="$ac_cv_prog_STRIP"
++if test -n "$STRIP"; then
++ echo "$ac_t""$STRIP" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++
++if test -z "$ac_cv_prog_STRIP"; then
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "strip", so it can be a program name with args.
++set dummy strip; ac_word=$2
++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
++echo "configure:2495: checking for $ac_word" >&5
++if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ if test -n "$STRIP"; then
++ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="$PATH"
++ for ac_dir in $ac_dummy; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f $ac_dir/$ac_word; then
++ ac_cv_prog_STRIP="strip"
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
++fi
++fi
++STRIP="$ac_cv_prog_STRIP"
++if test -n "$STRIP"; then
++ echo "$ac_t""$STRIP" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++else
++ STRIP=":"
++fi
++fi
++
++
++enable_dlopen=no
++enable_win32_dll=no
++
++# Check whether --enable-libtool-lock or --disable-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
++*-*-irix6*)
++ # Find out which ABI we are using.
++ echo '#line 2544 "configure"' > conftest.$ac_ext
++ if { (eval echo configure:2545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ 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
++ rm -rf conftest*
++ ;;
++
++*-*-sco3.2v5*)
++ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
++ SAVE_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -belf"
++ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
++echo "configure:2566: checking whether the C compiler needs -belf" >&5
++if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++
++ ac_ext=c
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++
++ cat > conftest.$ac_ext <<EOF
++#line 2579 "configure"
++#include "confdefs.h"
++
++int main() {
++
++; return 0; }
++EOF
++if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ lt_cv_cc_needs_belf=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ lt_cv_cc_needs_belf=no
++fi
++rm -f conftest*
++ ac_ext=c
++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
++cross_compiling=$ac_cv_prog_cc_cross
++
++fi
++
++echo "$ac_t""$lt_cv_cc_needs_belf" 1>&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
++ ;;
++
++
++esac
++
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed='sed -e s/^X//'
++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'
++
++# Constants:
++rm="rm -f"
++
++# Global variables:
++default_ofile=libtool
++can_build_shared=yes
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++ltmain="$ac_aux_dir/ltmain.sh"
++ofile="$default_ofile"
++with_gnu_ld="$lt_cv_prog_gnu_ld"
++need_locks="$enable_libtool_lock"
++
++old_CC="$CC"
++old_CFLAGS="$CFLAGS"
++
++# Set sane defaults for various variables
++test -z "$AR" && AR=ar
++test -z "$AR_FLAGS" && AR_FLAGS=cru
++test -z "$AS" && AS=as
++test -z "$CC" && CC=cc
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++test -z "$LD" && LD=ld
++test -z "$LN_S" && LN_S="ln -s"
++test -z "$MAGIC_CMD" && MAGIC_CMD=file
++test -z "$NM" && NM=nm
++test -z "$OBJDUMP" && OBJDUMP=objdump
++test -z "$RANLIB" && RANLIB=:
++test -z "$STRIP" && STRIP=:
++test -z "$ac_objext" && ac_objext=o
++
++if test x"$host" != x"$build"; then
++ ac_tool_prefix=${host_alias}-
++else
++ ac_tool_prefix=
++fi
++
++# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
++case $host_os in
++linux-gnu*) ;;
++linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
++esac
++
++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
++
++# Determine commands to create old-style static archives.
++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
++old_postinstall_cmds='chmod 644 $oldlib'
++old_postuninstall_cmds=
++
++if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++fi
++
++# Allow CC to be a program name with arguments.
++set dummy $CC
++compiler="$2"
++
++echo $ac_n "checking for objdir""... $ac_c" 1>&6
++echo "configure:2706: checking for objdir" >&5
++rm -f .libs 2>/dev/null
++mkdir .libs 2>/dev/null
++if test -d .libs; then
++ objdir=.libs
++else
++ # MS-DOS does not allow filenames that begin with a dot.
++ objdir=_libs
++fi
++rmdir .libs 2>/dev/null
++echo "$ac_t""$objdir" 1>&6
++
++
++# Check whether --with-pic or --without-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
++
++# We assume here that the value for lt_cv_prog_cc_pic will not be cached
++# in isolation, and that seeing it set (from the cache) indicates that
++# the associated values are set (in the cache) correctly too.
++echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
++echo "configure:2733: checking for $compiler option to produce PIC" >&5
++if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_shlib=
++ lt_cv_prog_cc_wl=
++ lt_cv_prog_cc_static=
++ lt_cv_prog_cc_no_builtin=
++ lt_cv_prog_cc_can_build_shared=$can_build_shared
++
++ if test "$GCC" = yes; then
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-static'
++
++ case $host_os in
++ aix*)
++ # Below there is a dirty hack to force normal static linking with -ldl
++ # The problem is because libdl dynamically linked with both libc and
++ # libC (AIX C++ library), which obviously doesn't included in libraries
++ # list by gcc. This cause undefined symbols with -static flags.
++ # This hack allows C programs to be linked with "-static -ldl", but
++ # not sure about C++ programs.
++ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
++ ;;
++ amigaos*)
++ # 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
++ ;;
++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++ # PIC is the default for these OSes.
++ ;;
++ darwin* | rhapsody*)
++ # PIC is the default on this platform
++ # Common symbols not allowed in MH_DYLIB files
++ lt_cv_prog_cc_pic='-fno-common'
++ ;;
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ lt_cv_prog_cc_pic=-Kconform_pic
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic='-fPIC'
++ ;;
++ esac
++ else
++ # PORTME Check for PIC flags for the system compiler.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ lt_cv_prog_cc_wl='-Wl,'
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ lt_cv_prog_cc_static='-Bstatic'
++ else
++ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ fi
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
++ lt_cv_prog_cc_pic='+Z'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ # PIC (with -KPIC) is the default.
++ ;;
++
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++
++ newsos6)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ osf3* | osf4* | osf5*)
++ # All OSF/1 code is PIC.
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ ;;
++
++ sco3.2v5*)
++ lt_cv_prog_cc_pic='-Kpic'
++ lt_cv_prog_cc_static='-dn'
++ lt_cv_prog_cc_shlib='-belf'
++ ;;
++
++ solaris*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ sunos4*)
++ lt_cv_prog_cc_pic='-PIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Qoption ld '
++ ;;
++
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ uts4*)
++ lt_cv_prog_cc_pic='-pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ sysv4*MP*)
++ if test -d /usr/nec ;then
++ lt_cv_prog_cc_pic='-Kconform_pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ fi
++ ;;
++
++ *)
++ lt_cv_prog_cc_can_build_shared=no
++ ;;
++ esac
++ fi
++
++fi
++
++if test -z "$lt_cv_prog_cc_pic"; then
++ echo "$ac_t""none" 1>&6
++else
++ echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
++
++ # Check to make sure the pic_flag actually works.
++ echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
++echo "configure:2881: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
++ if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
++ cat > conftest.$ac_ext <<EOF
++#line 2888 "configure"
++#include "confdefs.h"
++
++int main() {
++
++; return 0; }
++EOF
++if { (eval echo configure:2895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ case $host_os in
++ hpux9* | hpux10* | hpux11*)
++ # On HP-UX, both CC and GCC only warn that PIC is supported... then
++ # they create non-PIC objects. So, if there were any warnings, we
++ # assume that PIC is not supported.
++ if test -s conftest.err; then
++ lt_cv_prog_cc_pic_works=no
++ else
++ lt_cv_prog_cc_pic_works=yes
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic_works=yes
++ ;;
++ esac
++
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ lt_cv_prog_cc_pic_works=no
++
++fi
++rm -f conftest*
++ CFLAGS="$save_CFLAGS"
++
++fi
++
++
++ if test "X$lt_cv_prog_cc_pic_works" = Xno; then
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_can_build_shared=no
++ else
++ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
++ fi
++
++ echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
++fi
++
++# Check for any special shared library compilation flags.
++if test -n "$lt_cv_prog_cc_shlib"; then
++ echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
++ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then :
++ else
++ echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
++ lt_cv_prog_cc_can_build_shared=no
++ fi
++fi
++
++echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
++echo "configure:2947: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
++if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ lt_cv_prog_cc_static_works=no
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
++ cat > conftest.$ac_ext <<EOF
++#line 2955 "configure"
++#include "confdefs.h"
++
++int main() {
++
++; return 0; }
++EOF
++if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ lt_cv_prog_cc_static_works=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++ LDFLAGS="$save_LDFLAGS"
++
++fi
++
++
++# Belt *and* braces to stop my trousers falling down:
++test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
++echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
++
++pic_flag="$lt_cv_prog_cc_pic"
++special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
++wl="$lt_cv_prog_cc_wl"
++link_static_flag="$lt_cv_prog_cc_static"
++no_builtin_flag="$lt_cv_prog_cc_no_builtin"
++can_build_shared="$lt_cv_prog_cc_can_build_shared"
++
++
++# Check to see if options -o and -c are simultaneously supported by compiler
++echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
++echo "configure:2989: checking if $compiler supports -c -o file.$ac_objext" >&5
++if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++
++$rm -r conftest 2>/dev/null
++mkdir conftest
++cd conftest
++echo "int some_variable = 0;" > conftest.$ac_ext
++mkdir out
++# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
++# that will create temporary files in the current directory regardless of
++# the output directory. Thus, making CWD read-only will cause this test
++# to fail, enabling locking or at least warning the user not to do parallel
++# builds.
++chmod -w .
++save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
++compiler_c_o=no
++if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
++ if test -s out/conftest.err; then
++ lt_cv_compiler_c_o=no
++ else
++ lt_cv_compiler_c_o=yes
++ fi
++else
++ # Append any errors to the config.log.
++ cat out/conftest.err 1>&5
++ lt_cv_compiler_c_o=no
++fi
++CFLAGS="$save_CFLAGS"
++chmod u+w .
++$rm conftest* out/*
++rmdir out
++cd ..
++rmdir conftest
++$rm -r conftest 2>/dev/null
++
++fi
++
++compiler_c_o=$lt_cv_compiler_c_o
++echo "$ac_t""$compiler_c_o" 1>&6
++
++if test x"$compiler_c_o" = x"yes"; then
++ # Check to see if we can write to a .lo
++ echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
++echo "configure:3037: checking if $compiler supports -c -o file.lo" >&5
++ if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++
++ lt_cv_compiler_o_lo=no
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -c -o conftest.lo"
++ save_objext="$ac_objext"
++ ac_objext=lo
++ cat > conftest.$ac_ext <<EOF
++#line 3048 "configure"
++#include "confdefs.h"
++
++int main() {
++int some_variable = 0;
++; return 0; }
++EOF
++if { (eval echo configure:3055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ lt_cv_compiler_o_lo=no
++ else
++ lt_cv_compiler_o_lo=yes
++ fi
++
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++ ac_objext="$save_objext"
++ CFLAGS="$save_CFLAGS"
++
++fi
++
++ compiler_o_lo=$lt_cv_compiler_o_lo
++ echo "$ac_t""$compiler_o_lo" 1>&6
++else
++ compiler_o_lo=no
++fi
++
++# Check to see if we can do hard links to lock some files if needed
++hard_links="nottested"
++if test "$compiler_c_o" = no && test "$need_locks" != no; then
++ # do not overwrite the value of need_locks provided by the user
++ echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
++echo "configure:3086: checking if we can lock with hard links" >&5
++ 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
++ echo "$ac_t""$hard_links" 1>&6
++ if test "$hard_links" = no; then
++ echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
++ need_locks=warn
++ fi
++else
++ need_locks=no
++fi
++
++if test "$GCC" = yes; then
++ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
++ echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
++echo "configure:3105: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
++ echo "int some_variable = 0;" > conftest.$ac_ext
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
++ compiler_rtti_exceptions=no
++ cat > conftest.$ac_ext <<EOF
++#line 3111 "configure"
++#include "confdefs.h"
++
++int main() {
++int some_variable = 0;
++; return 0; }
++EOF
++if { (eval echo configure:3118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ compiler_rtti_exceptions=no
++ else
++ compiler_rtti_exceptions=yes
++ fi
++
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++fi
++rm -f conftest*
++ CFLAGS="$save_CFLAGS"
++ echo "$ac_t""$compiler_rtti_exceptions" 1>&6
++
++ if test "$compiler_rtti_exceptions" = "yes"; then
++ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
++ else
++ no_builtin_flag=' -fno-builtin'
++ fi
++fi
++
++# See if the linker supports building shared libraries.
++echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
++echo "configure:3145: checking whether the linker ($LD) supports shared libraries" >&5
++
++allow_undefined_flag=
++no_undefined_flag=
++need_lib_prefix=unknown
++need_version=unknown
++# when you set need_version to no, make sure it does not cause -set_version
++# flags to be left without arguments
++archive_cmds=
++archive_expsym_cmds=
++old_archive_from_new_cmds=
++old_archive_from_expsyms_cmds=
++export_dynamic_flag_spec=
++whole_archive_flag_spec=
++thread_safe_flag_spec=
++hardcode_into_libs=no
++hardcode_libdir_flag_spec=
++hardcode_libdir_separator=
++hardcode_direct=no
++hardcode_minus_L=no
++hardcode_shlibpath_var=unsupported
++runpath_var=
++link_all_deplibs=unknown
++always_export_symbols=no
++export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
++# include_expsyms should be a list of space-separated symbols to be *always*
++# included in the symbol list
++include_expsyms=
++# exclude_expsyms can be an egrep regular expression 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_"
++# 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.
++extract_expsyms_cmds=
++
++case $host_os in
++cygwin* | mingw* | pw32*)
++ # 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
++ ;;
++openbsd*)
++ with_gnu_ld=no
++ ;;
++esac
++
++ld_shlibs=yes
++if test "$with_gnu_ld" = yes; then
++ # If archive_cmds runs LD, not CC, wlarc should be empty
++ wlarc='${wl}'
++
++ # See if GNU ld supports shared libraries.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ # On AIX, the GNU linker is very broken
++ # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
++ ld_shlibs=no
++ cat <<EOF 1>&2
++
++*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
++*** so that a non-GNU linker is found, and then restart.
++
++EOF
++ ;;
++
++ amigaos*)
++ 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
++
++ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++ # that the semantics of dynamic libraries on AmigaOS, at least up
++ # to version 4, is to share data among multiple programs linked
++ # with the same dynamic library. Since this doesn't match the
++ # behavior of shared libraries on other platforms, we can use
++ # them.
++ ld_shlibs=no
++ ;;
++
++ beos*)
++ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
++ allow_undefined_flag=unsupported
++ # Joseph Beckenbach <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*)
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec='-L$libdir'
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++
++ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
++ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
++ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
++ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
++ else $CC -o impgen impgen.c ; fi)~
++ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
++
++ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
++
++ # cygwin and mingw dlls have different entry points and sets of symbols
++ # to exclude.
++ # FIXME: what about values for MSVC?
++ dll_entry=__cygwin_dll_entry@12
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
++ case $host_os in
++ mingw*)
++ # mingw values
++ dll_entry=_DllMainCRTStartup@12
++ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
++ ;;
++ esac
++
++ # mingw and cygwin differ, and it's simplest to just exclude the union
++ # of the two symbol sets.
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
++
++ # recent cygwin and mingw systems supply a stub DllMain which the user
++ # can override, but on older systems we have to supply one (in ltdll.c)
++ if test "x$lt_cv_need_dllmain" = "xyes"; then
++ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
++ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
++ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
++ else
++ ltdll_obj=
++ ltdll_cmds=
++ fi
++
++ # Extract the symbol export list from an `--export-all' def file,
++ # then regenerate the def file from the symbol export list, so that
++ # the compiled dll only exports the symbol export list.
++ # Be careful not to strip the DATA tag left be newer dlltools.
++ export_symbols_cmds="$ltdll_cmds"'
++ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
++ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
++
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is.
++ # If DATA tags from a recent dlltool are present, honour them!
++ 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;
++ _lt_hint=1;
++ cat $export_symbols | while read symbol; do
++ set dummy \$symbol;
++ case \$# in
++ 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
++ 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
++ *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
++ esac;
++ _lt_hint=`expr 1 + \$_lt_hint`;
++ done;
++ fi~
++ '"$ltdll_cmds"'
++ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
++ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
++ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
++ ;;
++
++ 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ fi
++ ;;
++
++ solaris* | sysv5*)
++ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
++ ld_shlibs=no
++ cat <<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.
++
++EOF
++ elif $LD --help 2>&1 | egrep ': 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
++ ;;
++
++ 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 | egrep ': 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" = yes; then
++ runpath_var=LD_RUN_PATH
++ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
++ export_dynamic_flag_spec='${wl}--export-dynamic'
++ case $host_os in
++ cygwin* | mingw* | pw32*)
++ # dlltool doesn't understand --whole-archive et. al.
++ whole_archive_flag_spec=
++ ;;
++ *)
++ # ancient GNU ld didn't support --whole-archive et. al.
++ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
++ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ else
++ whole_archive_flag_spec=
++ fi
++ ;;
++ esac
++ fi
++else
++ # PORTME fill in a description of your system's linker (not GNU ld)
++ 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 "$link_static_flag"; then
++ # Neither direct hardcoding nor static linking is supported with a
++ # broken collect2.
++ hardcode_direct=unsupported
++ fi
++ ;;
++
++ aix4* | aix5*)
++ 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].*|aix5*)
++ 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.
++
++ hardcode_direct=yes
++ archive_cmds=''
++ hardcode_libdir_separator=':'
++ if test "$GCC" = yes; then
++ case $host_os in aix4.[012]|aix4.[012].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ # It fails to find uninstalled libraries when the uninstalled
++ # path is not listed in the libpath. Setting hardcode_minus_L
++ # to unsupported forces relinking
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++
++ shared_flag='-shared'
++ else
++ # not using gcc
++ if test "$host_cpu" = ia64; then
++ shared_flag='${wl}-G'
++ else
++ if test "$aix_use_runtimelinking" = yes; then
++ shared_flag='${wl}-G'
++ else
++ shared_flag='${wl}-bM:SRE'
++ fi
++ fi
++ fi
++
++ # It seems that -bexpall can do strange things, 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'
++ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
++ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ else
++ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Warning - without using the other run time loading flags,
++ # -berok will link without error, but may produce a broken library.
++ allow_undefined_flag='${wl}-berok'
++ # This is a bit strange, but is similar to how AIX traditionally builds
++ # it's shared libraries.
++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
++ fi
++ fi
++ ;;
++
++ amigaos*)
++ 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
++ # see comment about different semantics on the GNU ld section
++ ld_shlibs=no
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ # 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
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''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"`'
++ ;;
++
++ darwin* | rhapsody*)
++ case "$host_os" in
++ rhapsody* | darwin1.[012])
++ allow_undefined_flag='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ allow_undefined_flag='-flat_namespace -undefined suppress'
++ ;;
++ esac
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
++ # `"' quotes if we put them in here... so don't!
++ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
++ # We need to add '_' to the symbols in $export_symbols first
++ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ whole_archive_flag_spec='-all_load $convenience'
++ ;;
++
++ freebsd1*)
++ ld_shlibs=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*)
++ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ case $host_os in
++ hpux9*) 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' ;;
++ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
++ esac
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=yes
++ hardcode_minus_L=yes # Not in the search PATH, but as the default
++ # location of the library.
++ export_dynamic_flag_spec='${wl}-E'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ else
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ 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
++ ;;
++
++ openbsd*)
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ 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'
++ 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
++ ;;
++
++ 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ else
++ allow_undefined_flag=' -expect_unresolved \*'
++ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ fi
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++
++ osf4* | osf5*) # as osf3* with the addition of -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" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
++ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
++
++ #Both c and cxx compiler support -rpath directly
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ ;;
++
++ sco3.2v5*)
++ 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
++ export_dynamic_flag_spec='${wl}-Bexport'
++ ;;
++
++ solaris*)
++ # gcc --version < 3.0 without binutils cannot create self contained
++ # shared libraries reliably, requiring libgcc.a to resolve some of
++ # the object symbols generated in some cases. Libraries that use
++ # assert need libgcc.a to resolve __eprintf, for example. Linking
++ # a copy of libgcc.a into every shared library to guarantee resolving
++ # such symbols causes other problems: According to Tim Van Holder
++ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
++ # (to the application) exception stack for one thing.
++ no_undefined_flag=' -z defs'
++ if test "$GCC" = yes; then
++ case `$CC --version 2>/dev/null` in
++ [12].*)
++ cat <<EOF 1>&2
++
++*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
++*** create self contained shared libraries on Solaris systems, without
++*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
++*** -no-undefined support, which will at least allow you to build shared
++*** libraries. However, you may find that when you link such libraries
++*** into an application without using GCC, you have to manually add
++*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
++*** upgrade to a newer version of GCC. Another option is to rebuild your
++*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
++
++EOF
++ no_undefined_flag=
++ ;;
++ esac
++ fi
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_shlibpath_var=no
++ case $host_os in
++ solaris2.[0-5] | solaris2.[0-5].*) ;;
++ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
++ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
++ esac
++ 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'
++ ;;
++
++ sysv5*)
++ no_undefined_flag=' -z text'
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec=
++ hardcode_shlibpath_var=no
++ runpath_var='LD_RUN_PATH'
++ ;;
++
++ uts4*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ dgux*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ 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.2uw2*)
++ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_direct=yes
++ hardcode_minus_L=no
++ hardcode_shlibpath_var=no
++ hardcode_runpath_var=yes
++ runpath_var=LD_RUN_PATH
++ ;;
++
++ sysv5uw7* | unixware7*)
++ no_undefined_flag='${wl}-z ${wl}text'
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ else
++ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ fi
++ runpath_var='LD_RUN_PATH'
++ hardcode_shlibpath_var=no
++ ;;
++
++ *)
++ ld_shlibs=no
++ ;;
++ esac
++fi
++echo "$ac_t""$ld_shlibs" 1>&6
++test "$ld_shlibs" = no && can_build_shared=no
++
++# Check hardcoding attributes.
++echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
++echo "configure:3844: checking how to hardcode library paths into programs" >&5
++hardcode_action=
++if test -n "$hardcode_libdir_flag_spec" || \
++ test -n "$runpath_var"; then
++
++ # We can hardcode non-existant 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 "$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
++echo "$ac_t""$hardcode_action" 1>&6
++
++striplib=
++old_striplib=
++echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
++echo "configure:3872: checking whether stripping libraries is possible" >&5
++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"
++ echo "$ac_t""yes" 1>&6
++else
++ echo "$ac_t""no" 1>&6
++fi
++
++reload_cmds='$LD$reload_flag -o $output$reload_objs'
++test -z "$deplibs_check_method" && deplibs_check_method=unknown
++
++# PORTME Fill in your ld.so characteristics
++echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
++echo "configure:3886: checking dynamic linker characteristics" >&5
++library_names_spec=
++libname_spec='lib$name'
++soname_spec=
++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"
++sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
++
++case $host_os in
++aix3*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix $libname.a'
++ shlibpath_var=LIBPATH
++
++ # AIX has no versioning support, so we append a major version to the name.
++ soname_spec='${libname}${release}.so$major'
++ ;;
++
++aix4* | aix5*)
++ 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}.so$major ${libname}${release}.so$versuffix $libname.so'
++ 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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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}.so$major'
++ fi
++ shlibpath_var=LIBPATH
++ fi
++ hardcode_into_libs=yes
++ ;;
++
++amigaos*)
++ 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=`$echo "X$lib" | $Xsed -e '\''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'
++ ;;
++
++beos*)
++ library_names_spec='${libname}.so'
++ dynamic_linker="$host_os ld.so"
++ shlibpath_var=LIBRARY_PATH
++ ;;
++
++bsdi4*)
++ version_type=linux
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
++ export_dynamic_flag_spec=-rdynamic
++ # the default ld.so.conf also contains /usr/contrib/lib and
++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
++ # libtool to hard-code these into programs
++ ;;
++
++cygwin* | mingw* | pw32*)
++ version_type=windows
++ need_version=no
++ need_lib_prefix=no
++ case $GCC,$host_os in
++ yes,cygwin*)
++ library_names_spec='$libname.dll.a'
++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog .libs/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $rm \$dlpath'
++ ;;
++ yes,mingw*)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
++ ;;
++ yes,pw32*)
++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
++ ;;
++ *)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $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
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes.
++ library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
++ soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
++ shlibpath_overrides_runpath=yes
++ shlibpath_var=DYLD_LIBRARY_PATH
++ ;;
++
++freebsd1*)
++ dynamic_linker=no
++ ;;
++
++freebsd*-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU/FreeBSD ld.so'
++ ;;
++
++freebsd*)
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ version_type=freebsd-$objformat
++ case $version_type in
++ freebsd-elf*)
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
++ need_version=no
++ need_lib_prefix=no
++ ;;
++ freebsd-*)
++ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
++ need_version=yes
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_os in
++ freebsd2*)
++ shlibpath_overrides_runpath=yes
++ ;;
++ *)
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ ;;
++ esac
++ ;;
++
++gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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.
++ dynamic_linker="$host_os dld.sl"
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ shlibpath_var=SHLIB_PATH
++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
++ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
++ soname_spec='${libname}${release}.sl$major'
++ # HP-UX runs *really* slowly unless shared libraries are mode 555.
++ postinstall_cmds='chmod 555 $lib'
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ nonstopux*) version_type=nonstopux ;;
++ *) version_type=irix ;;
++ esac
++ need_lib_prefix=no
++ need_version=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
++ case $host_os in
++ irix5* | nonstopux*)
++ libsuff= shlibsuff=
++ ;;
++ *)
++ case $LD in # libtool.m4 will add one of these switches to LD
++ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
++ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
++ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
++ *) libsuff= shlibsuff= libmagic=never-match;;
++ esac
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
++ shlibpath_overrides_runpath=no
++ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
++ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
++ ;;
++
++# No shared lib support for Linux oldld, aout, or coff.
++linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
++ dynamic_linker=no
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # 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
++
++ # 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}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ dynamic_linker='NetBSD (a.out) ld.so'
++ else
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
++ soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=yes
++ ;;
++
++openbsd*)
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ 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
++ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++os2*)
++ libname_spec='$name'
++ need_lib_prefix=no
++ library_names_spec='$libname.dll $libname.a'
++ dynamic_linker='OS/2 ld.exe'
++ shlibpath_var=LIBPATH
++ ;;
++
++osf3* | osf4* | osf5*)
++ version_type=osf
++ need_version=no
++ need_lib_prefix=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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"
++ hardcode_into_libs=yes
++ ;;
++
++sco3.2v5*)
++ version_type=osf
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++solaris*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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}.so$versuffix ${libname}.so$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.2uw2* | sysv4.3* | sysv5*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_vendor in
++ sni)
++ shlibpath_overrides_runpath=no
++ need_lib_prefix=no
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ 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
++ ;;
++
++uts4*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++dgux*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++sysv4*MP*)
++ if test -d /usr/nec ;then
++ version_type=linux
++ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
++ soname_spec='$libname.so.$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ fi
++ ;;
++
++*)
++ dynamic_linker=no
++ ;;
++esac
++echo "$ac_t""$dynamic_linker" 1>&6
++test "$dynamic_linker" = no && can_build_shared=no
++
++# Report the final consequences.
++echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
++echo "configure:4310: checking if libtool supports shared libraries" >&5
++echo "$ac_t""$can_build_shared" 1>&6
++
++echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6
++echo "configure:4314: checking whether to build shared libraries" >&5
++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
++ ;;
++
++aix4*)
++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
++ test "$enable_shared" = yes && enable_static=no
++ fi
++ ;;
++esac
++echo "$ac_t""$enable_shared" 1>&6
++
++echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6
++echo "configure:4337: checking whether to build static libraries" >&5
++# Make sure either enable_shared or enable_static is yes.
++test "$enable_shared" = yes || enable_static=yes
++echo "$ac_t""$enable_static" 1>&6
++
++if test "$hardcode_action" = relink; 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
++
++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 "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
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ lt_cv_dlopen="LoadLibrary"
++ lt_cv_dlopen_libs=
++ ;;
++
++ *)
++ echo $ac_n "checking for shl_load""... $ac_c" 1>&6
++echo "configure:4378: checking for shl_load" >&5
++if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4383 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char shl_load(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char shl_load();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_shl_load) || defined (__stub___shl_load)
++choke me
++#else
++shl_load();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_shl_load=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_shl_load=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ lt_cv_dlopen="shl_load"
++else
++ echo "$ac_t""no" 1>&6
++echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
++echo "configure:4424: checking for shl_load in -ldld" >&5
++ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-ldld $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 4432 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char shl_load();
++
++int main() {
++shl_load()
++; return 0; }
++EOF
++if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
++else
++ echo "$ac_t""no" 1>&6
++echo $ac_n "checking for dlopen""... $ac_c" 1>&6
++echo "configure:4462: checking for dlopen" >&5
++if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ cat > conftest.$ac_ext <<EOF
++#line 4467 "configure"
++#include "confdefs.h"
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char dlopen(); below. */
++#include <assert.h>
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen();
++
++int main() {
++
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_dlopen) || defined (__stub___dlopen)
++choke me
++#else
++dlopen();
++#endif
++
++; return 0; }
++EOF
++if { (eval echo configure:4490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_func_dlopen=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_func_dlopen=no"
++fi
++rm -f conftest*
++fi
++
++if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ lt_cv_dlopen="dlopen"
++else
++ echo "$ac_t""no" 1>&6
++echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
++echo "configure:4508: checking for dlopen in -ldl" >&5
++ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-ldl $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 4516 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen();
++
++int main() {
++dlopen()
++; return 0; }
++EOF
++if { (eval echo configure:4527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
++else
++ echo "$ac_t""no" 1>&6
++echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
++echo "configure:4546: checking for dlopen in -lsvld" >&5
++ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-lsvld $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 4554 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen();
++
++int main() {
++dlopen()
++; return 0; }
++EOF
++if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
++else
++ echo "$ac_t""no" 1>&6
++echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
++echo "configure:4584: checking for dld_link in -ldld" >&5
++ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ ac_save_LIBS="$LIBS"
++LIBS="-ldld $LIBS"
++cat > conftest.$ac_ext <<EOF
++#line 4592 "configure"
++#include "confdefs.h"
++/* Override any gcc2 internal prototype to avoid an error. */
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dld_link();
++
++int main() {
++dld_link()
++; return 0; }
++EOF
++if { (eval echo configure:4603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=yes"
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ eval "ac_cv_lib_$ac_lib_var=no"
++fi
++rm -f conftest*
++LIBS="$ac_save_LIBS"
++
++fi
++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
++ echo "$ac_t""yes" 1>&6
++ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
++else
++ echo "$ac_t""no" 1>&6
++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"
++ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
++
++ save_LIBS="$LIBS"
++ LIBS="$lt_cv_dlopen_libs $LIBS"
++
++ echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
++echo "configure:4659: checking whether a program can dlopen itself" >&5
++if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&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 <<EOF
++#line 4669 "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}
++EOF
++ if { (eval echo configure:4730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;;
++ esac
++ else :
++ # compilation failed
++ lt_cv_dlopen_self=no
++ fi
++fi
++rm -fr conftest*
++
++
++fi
++
++echo "$ac_t""$lt_cv_dlopen_self" 1>&6
++
++ if test "x$lt_cv_dlopen_self" = xyes; then
++ LDFLAGS="$LDFLAGS $link_static_flag"
++ echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
++echo "configure:4753: checking whether a statically linked program can dlopen itself" >&5
++if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&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 <<EOF
++#line 4763 "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}
++EOF
++ if { (eval echo configure:4824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
++ esac
++ else :
++ # compilation failed
++ lt_cv_dlopen_self_static=no
++ fi
++fi
++rm -fr conftest*
++
++
++fi
++
++echo "$ac_t""$lt_cv_dlopen_self_static" 1>&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
++
++
++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.
++ echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
++echo "configure:4873: checking whether -lc should be explicitly linked in" >&5
++ if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++ $rm conftest*
++ echo 'static int dummy;' > conftest.$ac_ext
++
++ if { (eval echo configure:4880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ soname=conftest
++ lib=conftest
++ libobjs=conftest.$ac_objext
++ deplibs=
++ wl=$lt_cv_prog_cc_wl
++ compiler_flags=-v
++ linker_flags=-v
++ verstring=
++ output_objdir=.
++ libname=conftest
++ save_allow_undefined_flag=$allow_undefined_flag
++ allow_undefined_flag=
++ if { (eval echo configure:4893: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
++ then
++ lt_cv_archive_cmds_need_lc=no
++ else
++ lt_cv_archive_cmds_need_lc=yes
++ fi
++ allow_undefined_flag=$save_allow_undefined_flag
++ else
++ cat conftest.err 1>&5
++ fi
++fi
++
++ echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
++ ;;
++ esac
++fi
++need_lc=${lt_cv_archive_cmds_need_lc-yes}
++
++# The second clause should only fire when bootstrapping the
++# libtool distribution, otherwise you forgot to ship ltmain.sh
++# with your package, and you will get complaints that there are
++# no rules to generate ltmain.sh.
++if test -f "$ltmain"; then
++ :
++else
++ # If there is no Makefile yet, we rely on a make rule to execute
++ # `config.status --recheck' to rerun these tests and create the
++ # libtool script then.
++ test -f Makefile && make "$ltmain"
++fi
++
++if test -f "$ltmain"; then
++ trap "$rm \"${ofile}T\"; exit 1" 1 2 15
++ $rm -f "${ofile}T"
++
++ echo creating $ofile
++
++ # Now quote all the things that may contain metacharacters while being
++ # careful not to overquote the AC_SUBSTed values. We take copies of the
++ # variables and quote the copies for generation of the libtool script.
++ for var in echo old_CC old_CFLAGS SED \
++ AR AR_FLAGS CC LD LN_S NM SHELL \
++ reload_flag reload_cmds wl \
++ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
++ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
++ library_names_spec soname_spec \
++ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
++ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
++ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
++ old_striplib striplib file_magic_cmd export_symbols_cmds \
++ deplibs_check_method allow_undefined_flag no_undefined_flag \
++ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
++ global_symbol_to_c_name_address \
++ hardcode_libdir_flag_spec hardcode_libdir_separator \
++ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
++ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
++
++ case $var in
++ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
++ old_postinstall_cmds | old_postuninstall_cmds | \
++ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
++ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
++ postinstall_cmds | postuninstall_cmds | \
++ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
++ # Double-quote double-evaled strings.
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
++ ;;
++ *)
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
++ ;;
++ esac
++ done
++
++ cat <<__EOF__ > "${ofile}T"
++#! $SHELL
++
++# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
++# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
++# NOTE: Changes made to this file will be lost: look at ltmain.sh.
++#
++# Copyright (C) 1996-2000 Free Software Foundation, Inc.
++# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# A sed that does not truncate output.
++SED=$lt_SED
++
++# Sed that helps us avoid accidentally triggering echo(1) options like -n.
++Xsed="${SED} -e s/^X//"
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++# ### BEGIN LIBTOOL CONFIG
++
++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++
++# Shell to use when invoking shell scripts.
++SHELL=$lt_SHELL
++
++# Whether or not to build shared libraries.
++build_libtool_libs=$enable_shared
++
++# Whether or not to build static libraries.
++build_old_libs=$enable_static
++
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$need_lc
++
++# Whether or not to optimize for fast installation.
++fast_install=$enable_fast_install
++
++# The host system.
++host_alias=$host_alias
++host=$host
++
++# An echo program that does not interpret backslashes.
++echo=$lt_echo
++
++# The archiver.
++AR=$lt_AR
++AR_FLAGS=$lt_AR_FLAGS
++
++# The default C compiler.
++CC=$lt_CC
++
++# Is the compiler the GNU C compiler?
++with_gcc=$GCC
++
++# The linker used to build libraries.
++LD=$lt_LD
++
++# Whether we need hard or soft links.
++LN_S=$lt_LN_S
++
++# A BSD-compatible nm program.
++NM=$lt_NM
++
++# A symbol stripping program
++STRIP=$STRIP
++
++# Used to examine libraries when file_magic_cmd begins "file"
++MAGIC_CMD=$MAGIC_CMD
++
++# Used on cygwin: DLL creation program.
++DLLTOOL="$DLLTOOL"
++
++# Used on cygwin: object dumper.
++OBJDUMP="$OBJDUMP"
++
++# Used on cygwin: assembler.
++AS="$AS"
++
++# The name of the directory that contains temporary libtool files.
++objdir=$objdir
++
++# How to create reloadable object files.
++reload_flag=$lt_reload_flag
++reload_cmds=$lt_reload_cmds
++
++# How to pass a linker flag through the compiler.
++wl=$lt_wl
++
++# Object file suffix (normally "o").
++objext="$ac_objext"
++
++# Old archive suffix (normally "a").
++libext="$libext"
++
++# Executable file suffix (normally "").
++exeext="$exeext"
++
++# Additional compiler flags for building library objects.
++pic_flag=$lt_pic_flag
++pic_mode=$pic_mode
++
++# Does compiler simultaneously support -c and -o options?
++compiler_c_o=$lt_compiler_c_o
++
++# Can we write directly to a .lo ?
++compiler_o_lo=$lt_compiler_o_lo
++
++# Must we lock files when doing compilation ?
++need_locks=$lt_need_locks
++
++# 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
++
++# 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
++
++# Compiler flag to prevent dynamic linking.
++link_static_flag=$lt_link_static_flag
++
++# Compiler flag to turn off builtin functions.
++no_builtin_flag=$lt_no_builtin_flag
++
++# 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
++
++# Compiler flag to generate thread-safe objects.
++thread_safe_flag_spec=$lt_thread_safe_flag_spec
++
++# Library versioning type.
++version_type=$version_type
++
++# 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
++
++# Commands used to build and install an old-style archive.
++RANLIB=$lt_RANLIB
++old_archive_cmds=$lt_old_archive_cmds
++old_postinstall_cmds=$lt_old_postinstall_cmds
++old_postuninstall_cmds=$lt_old_postuninstall_cmds
++
++# Create an old-style archive from a shared archive.
++old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+-NM="$ac_cv_path_NM"
+-echo "$ac_t""$NM" 1>&6
++# Create a temporary old-style archive to link instead of a shared archive.
++old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+-echo "configure:1367: checking whether ln -s works" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- rm -f conftestdata
+-if ln -s X conftestdata 2>/dev/null
+-then
+- rm -f conftestdata
+- ac_cv_prog_LN_S="ln -s"
+-else
+- ac_cv_prog_LN_S=ln
+-fi
+-fi
+-LN_S="$ac_cv_prog_LN_S"
+-if test "$ac_cv_prog_LN_S" = "ln -s"; then
+- echo "$ac_t""yes" 1>&6
+-else
+- echo "$ac_t""no" 1>&6
+-fi
++# Commands used to build and install a shared archive.
++archive_cmds=$lt_archive_cmds
++archive_expsym_cmds=$lt_archive_expsym_cmds
++postinstall_cmds=$lt_postinstall_cmds
++postuninstall_cmds=$lt_postuninstall_cmds
+
++# Commands to strip libraries.
++old_striplib=$lt_old_striplib
++striplib=$lt_striplib
+
+-case "$target" in
+-NONE) lt_target="$host" ;;
+-*) lt_target="$target" ;;
+-esac
++# Method to check whether dependent libraries are shared objects.
++deplibs_check_method=$lt_deplibs_check_method
+
+-# Check for any special flags to pass to ltconfig.
+-libtool_flags="--cache-file=$cache_file"
+-test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+-test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+-test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+-test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+-test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
++# Command to use when deplibs_check_method == file_magic.
++file_magic_cmd=$lt_file_magic_cmd
+
++# Flag that allows shared libraries with undefined symbols to be built.
++allow_undefined_flag=$lt_allow_undefined_flag
+
+-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+-if test "${enable_libtool_lock+set}" = set; then
+- enableval="$enable_libtool_lock"
+- :
+-fi
++# Flag that forces no undefined symbols.
++no_undefined_flag=$lt_no_undefined_flag
+
+-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
++# Commands used to finish a libtool library installation in a directory.
++finish_cmds=$lt_finish_cmds
+
+-# Some flags need to be propagated to the compiler or linker for good
+-# libtool support.
+-case "$lt_target" in
+-*-*-irix6*)
+- # Find out which ABI we are using.
+- echo '#line 1416 "configure"' > conftest.$ac_ext
+- if { (eval echo configure:1417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- case "`/usr/bin/file conftest.o`" in
+- *32-bit*)
+- LD="${LD-ld} -32"
+- ;;
+- *N32*)
+- LD="${LD-ld} -n32"
+- ;;
+- *64-bit*)
+- LD="${LD-ld} -64"
+- ;;
+- esac
+- fi
+- rm -rf conftest*
+- ;;
++# Same as above, but a single script fragment to be evaled but not shown.
++finish_eval=$lt_finish_eval
+
+-*-*-sco3.2v5*)
+- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+- SAVE_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -belf"
+- echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+-echo "configure:1438: checking whether the C compiler needs -belf" >&5
+-if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 1443 "configure"
+-#include "confdefs.h"
++# Take the output of nm and produce a listing of raw symbols and C names.
++global_symbol_pipe=$lt_global_symbol_pipe
+
+-int main() {
++# Transform the output of nm in a proper C declaration
++global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:1450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- lt_cv_cc_needs_belf=yes
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- lt_cv_cc_needs_belf=no
+-fi
+-rm -f conftest*
+-fi
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
+
+-echo "$ac_t""$lt_cv_cc_needs_belf" 1>&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
+- ;;
++# This is the shared library runtime path variable.
++runpath_var=$runpath_var
+
++# This is the shared library path variable.
++shlibpath_var=$shlibpath_var
+
+-esac
++# Is shlibpath searched before the hard-coded library search path?
++shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
++# How to hardcode a shared library path into an executable.
++hardcode_action=$hardcode_action
+
+-# Save cache, so that ltconfig can load it
+-cat > confcache <<\EOF
+-# 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. It is not useful on other systems.
+-# If it contains results you don't want to keep, you may remove or edit it.
++# Whether we should hardcode library paths into libraries.
++hardcode_into_libs=$hardcode_into_libs
++
++# 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
++
++# 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.so during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct=$hardcode_direct
++
++# 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
++
++# Variables whose values should be saved in libtool wrapper scripts and
++# restored at relink time.
++variables_saved_for_relink="$variables_saved_for_relink"
++
++# Whether libtool must link a program against all its dependency libraries.
++link_all_deplibs=$link_all_deplibs
++
++# 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
++
++# Fix the shell variable \$srcfile for the compiler.
++fix_srcfile_path="$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
++
++# The commands to extract the exported symbol list from a shared archive.
++extract_expsyms_cmds=$lt_extract_expsyms_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
++
++# ### END LIBTOOL CONFIG
++
++__EOF__
++
++ case $host_os in
++ aix3*)
++ cat <<\EOF >> "${ofile}T"
++
++# 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
++EOF
++ ;;
++ esac
++
++ case $host_os in
++ cygwin* | mingw* | pw32* | os2*)
++ cat <<'EOF' >> "${ofile}T"
++ # This is a source program that is used to create dlls on Windows
++ # Don't remove nor modify the starting and closing comments
++# /* ltdll.c starts here */
++# #define WIN32_LEAN_AND_MEAN
++# #include <windows.h>
++# #undef WIN32_LEAN_AND_MEAN
++# #include <stdio.h>
+ #
+-# By default, configure uses ./config.cache as the cache file,
+-# creating it if it does not exist already. You can give configure
+-# the --cache-file=FILE option to use a different cache file; that is
+-# what configure does when it calls configure scripts in
+-# subdirectories, so they share the cache.
+-# Giving --cache-file=/dev/null disables caching, for debugging configure.
+-# config.status only pays attention to the cache file if you give it the
+-# --recheck option to rerun configure.
++# #ifndef __CYGWIN__
++# # ifdef __CYGWIN32__
++# # define __CYGWIN__ __CYGWIN32__
++# # endif
++# #endif
++#
++# #ifdef __cplusplus
++# extern "C" {
++# #endif
++# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
++# #ifdef __cplusplus
++# }
++# #endif
++#
++# #ifdef __CYGWIN__
++# #include <cygwin/cygwin_dll.h>
++# DECLARE_CYGWIN_DLL( DllMain );
++# #endif
++# HINSTANCE __hDllInstance_base;
++#
++# BOOL APIENTRY
++# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
++# {
++# __hDllInstance_base = hInst;
++# return TRUE;
++# }
++# /* ltdll.c ends here */
++ # This is a source program that is used to create import libraries
++ # on Windows for dlls which lack them. Don't remove nor modify the
++ # starting and closing comments
++# /* impgen.c starts here */
++# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
++#
++# This file is part of GNU libtool.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# */
++#
++# #include <stdio.h> /* for printf() */
++# #include <unistd.h> /* for open(), lseek(), read() */
++# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
++# #include <string.h> /* for strdup() */
++#
++# /* O_BINARY isn't required (or even defined sometimes) under Unix */
++# #ifndef O_BINARY
++# #define O_BINARY 0
++# #endif
++#
++# static unsigned int
++# pe_get16 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[2];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 2);
++# return b[0] + (b[1]<<8);
++# }
++#
++# static unsigned int
++# pe_get32 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[4];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 4);
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# static unsigned int
++# pe_as32 (ptr)
++# void *ptr;
++# {
++# unsigned char *b = ptr;
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# int
++# main (argc, argv)
++# int argc;
++# char *argv[];
++# {
++# int dll;
++# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
++# unsigned long export_rva, export_size, nsections, secptr, expptr;
++# unsigned long name_rvas, nexp;
++# unsigned char *expdata, *erva;
++# char *filename, *dll_name;
++#
++# filename = argv[1];
++#
++# dll = open(filename, O_RDONLY|O_BINARY);
++# if (dll < 1)
++# return 1;
++#
++# dll_name = filename;
++#
++# for (i=0; filename[i]; i++)
++# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
++# dll_name = filename + i +1;
++#
++# pe_header_offset = pe_get32 (dll, 0x3c);
++# opthdr_ofs = pe_header_offset + 4 + 20;
++# num_entries = pe_get32 (dll, opthdr_ofs + 92);
+ #
++# if (num_entries < 1) /* no exports */
++# return 1;
++#
++# export_rva = pe_get32 (dll, opthdr_ofs + 96);
++# export_size = pe_get32 (dll, opthdr_ofs + 100);
++# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
++# secptr = (pe_header_offset + 4 + 20 +
++# pe_get16 (dll, pe_header_offset + 4 + 16));
++#
++# expptr = 0;
++# for (i = 0; i < nsections; i++)
++# {
++# char sname[8];
++# unsigned long secptr1 = secptr + 40 * i;
++# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
++# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
++# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
++# lseek(dll, secptr1, SEEK_SET);
++# read(dll, sname, 8);
++# if (vaddr <= export_rva && vaddr+vsize > export_rva)
++# {
++# expptr = fptr + (export_rva - vaddr);
++# if (export_rva + export_size > vaddr + vsize)
++# export_size = vsize - (export_rva - vaddr);
++# break;
++# }
++# }
++#
++# expdata = (unsigned char*)malloc(export_size);
++# lseek (dll, expptr, SEEK_SET);
++# read (dll, expdata, export_size);
++# erva = expdata - export_rva;
++#
++# nexp = pe_as32 (expdata+24);
++# name_rvas = pe_as32 (expdata+32);
++#
++# printf ("EXPORTS\n");
++# for (i = 0; i<nexp; i++)
++# {
++# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
++# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
++# }
++#
++# return 0;
++# }
++# /* impgen.c ends here */
++
+ EOF
+-# The following way of writing the cache mishandles newlines in values,
+-# but we know of no workaround that is simple, portable, and efficient.
+-# So, don't put newlines in cache variables' values.
+-# 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.
+-(set) 2>&1 |
+- case `(ac_space=' '; set | grep ac_space) 2>&1` in
+- *ac_space=\ *)
+- # `set' does not quote correctly, so add quotes (double-quote substitution
+- # turns \\\\ into \\, and sed turns \\ into \).
+- sed -n \
+- -e "s/'/'\\\\''/g" \
+- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+- ;;
+- *)
+- # `set' quotes correctly as required by POSIX, so do not add quotes.
+- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+- esac >> confcache
+-if cmp -s $cache_file confcache; then
+- :
+-else
+- if test -w $cache_file; then
+- echo "updating cache $cache_file"
+- cat confcache > $cache_file
+- else
+- echo "not updating unwritable cache $cache_file"
+- fi
++ esac
++
++ # 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" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
++
++ mv -f "${ofile}T" "$ofile" || \
++ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
++ chmod +x "$ofile"
+ fi
+-rm -f confcache
+
+
+-# Actually configure libtool. ac_aux_dir is where install-sh is found.
+-CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+-LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+-LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+-DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+-${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+-$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+-|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+-# Reload cache, that may have been modified by ltconfig
+-if test -r "$cache_file"; then
+- echo "loading cache $cache_file"
+- . $cache_file
+-else
+- echo "creating cache $cache_file"
+- > $cache_file
+-fi
+
+
+ # This can be used to rebuild libtool when needed
+-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
++LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+ # Always use our own libtool.
+ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+-# Redirect the config.log output again, so that the ltconfig log is not
+-# clobbered by the next message.
+-exec 5>>./config.log
++# Prevent multiple expansion
++
+
+
+ echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+-echo "configure:1553: checking whether to enable maintainer-specific portions of Makefiles" >&5
++echo "configure:5479: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+ if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+@@ -1579,7 +5505,7 @@
+ fi
+
+ echo $ac_n "checking host system type""... $ac_c" 1>&6
+-echo "configure:1583: checking host system type" >&5
++echo "configure:5509: checking host system type" >&5
+
+ host_alias=$host
+ case "$host_alias" in
+@@ -1649,7 +5575,7 @@
+ mem_warn=false
+
+ echo $ac_n "checking whether to enable memory checking""... $ac_c" 1>&6
+-echo "configure:1653: checking whether to enable memory checking" >&5
++echo "configure:5579: checking whether to enable memory checking" >&5
+ if test "x$enable_mem_check" = "xyes"; then
+ cat >> confdefs.h <<\EOF
+ #define ENABLE_MEM_CHECK 1
+@@ -1663,7 +5589,7 @@
+ fi
+
+ echo $ac_n "checking whether to enable memory profiling""... $ac_c" 1>&6
+-echo "configure:1667: checking whether to enable memory profiling" >&5
++echo "configure:5593: checking whether to enable memory profiling" >&5
+ if test "x$enable_mem_profile" = "xyes"; then
+ cat >> confdefs.h <<\EOF
+ #define ENABLE_MEM_PROFILE 1
+@@ -1711,7 +5637,7 @@
+ # Extract the first word of "gcc", so it can be a program name with args.
+ set dummy gcc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1715: checking for $ac_word" >&5
++echo "configure:5641: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1741,7 +5667,7 @@
+ # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1745: checking for $ac_word" >&5
++echo "configure:5671: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1792,7 +5718,7 @@
+ # Extract the first word of "cl", so it can be a program name with args.
+ set dummy cl; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1796: checking for $ac_word" >&5
++echo "configure:5722: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1824,7 +5750,7 @@
+ fi
+
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:1828: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++echo "configure:5754: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ ac_ext=c
+ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+@@ -1835,12 +5761,12 @@
+
+ cat > conftest.$ac_ext << EOF
+
+-#line 1839 "configure"
++#line 5765 "configure"
+ #include "confdefs.h"
+
+ main(){return(0);}
+ EOF
+-if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:5770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+@@ -1866,12 +5792,12 @@
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:1870: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "configure:5796: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+ cross_compiling=$ac_cv_prog_cc_cross
+
+ echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:1875: checking whether we are using GNU C" >&5
++echo "configure:5801: checking whether we are using GNU C" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1880,7 +5806,7 @@
+ yes;
+ #endif
+ EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:5810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+ else
+ ac_cv_prog_gcc=no
+@@ -1899,7 +5825,7 @@
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:1903: checking whether ${CC-cc} accepts -g" >&5
++echo "configure:5829: checking whether ${CC-cc} accepts -g" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1934,7 +5860,7 @@
+
+
+ echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
+-echo "configure:1938: checking for ${CC-cc} option to accept ANSI C" >&5
++echo "configure:5864: checking for ${CC-cc} option to accept ANSI C" >&5
+ if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1950,7 +5876,7 @@
+ do
+ CC="$ac_save_CC $ac_arg"
+ cat > conftest.$ac_ext <<EOF
+-#line 1954 "configure"
++#line 5880 "configure"
+ #include "confdefs.h"
+ #include <stdarg.h>
+ #include <stdio.h>
+@@ -1987,7 +5913,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:1991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:5917: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_prog_cc_stdc="$ac_arg"; break
+ else
+@@ -2022,7 +5948,7 @@
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+ # ./install, which can be erroneously created by make from ./install.sh.
+ echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:2026: checking for a BSD compatible install" >&5
++echo "configure:5952: checking for a BSD compatible install" >&5
+ if test -z "$INSTALL"; then
+ if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -2095,19 +6021,19 @@
+ fi
+
+ echo $ac_n "checking for extra flags to get ANSI library prototypes""... $ac_c" 1>&6
+-echo "configure:2099: checking for extra flags to get ANSI library prototypes" >&5
++echo "configure:6025: checking for extra flags to get ANSI library prototypes" >&5
+ glib_save_LIBS=$LIBS
+ LIBS="$LIBS -lm"
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2106 "configure"
++#line 6032 "configure"
+ #include "confdefs.h"
+ #include <math.h>
+ int main (void) { return (log(1) != log(1.)); }
+ EOF
+-if { (eval echo configure:2111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ echo "$ac_t""none needed" 1>&6
+ else
+@@ -2120,12 +6046,12 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2124 "configure"
++#line 6050 "configure"
+ #include "confdefs.h"
+ #include <math.h>
+ int main (void) { return (log(1) != log(1.)); }
+ EOF
+-if { (eval echo configure:2129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ echo "$ac_t""-std1" 1>&6
+ else
+@@ -2148,16 +6074,16 @@
+ LIBS=$glib_save_LIBS
+
+ echo $ac_n "checking for extra flags for POSIX compliance""... $ac_c" 1>&6
+-echo "configure:2152: checking for extra flags for POSIX compliance" >&5
++echo "configure:6078: checking for extra flags for POSIX compliance" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 2154 "configure"
++#line 6080 "configure"
+ #include "confdefs.h"
+ #include <dirent.h>
+ int main() {
+ DIR *dir;
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:6087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""none needed" 1>&6
+ else
+@@ -2167,14 +6093,14 @@
+ glib_save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -posix"
+ cat > conftest.$ac_ext <<EOF
+-#line 2171 "configure"
++#line 6097 "configure"
+ #include "confdefs.h"
+ #include <dirent.h>
+ int main() {
+ DIR *dir;
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:6104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""-posix" 1>&6
+ else
+@@ -2190,93 +6116,13 @@
+ rm -f conftest*
+
+ # Checks for header files.
+-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+-echo "configure:2195: checking how to run the C preprocessor" >&5
+-# On Suns, sometimes $CPP names a directory.
+-if test -n "$CPP" && test -d "$CPP"; then
+- CPP=
+-fi
+-if test -z "$CPP"; then
+-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- # This must be in double quotes, not single quotes, because CPP may get
+- # substituted into the Makefile and "${CC-cc}" will confuse make.
+- CPP="${CC-cc} -E"
+- # On the NeXT, cc -E runs the code through the compiler's parser,
+- # not just through cpp.
+- cat > conftest.$ac_ext <<EOF
+-#line 2210 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:2216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
+-else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP="${CC-cc} -E -traditional-cpp"
+- cat > conftest.$ac_ext <<EOF
+-#line 2227 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:2233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
+-else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP="${CC-cc} -nologo -E"
+- cat > conftest.$ac_ext <<EOF
+-#line 2244 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:2250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
+-else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP=/lib/cpp
+-fi
+-rm -f conftest*
+-fi
+-rm -f conftest*
+-fi
+-rm -f conftest*
+- ac_cv_prog_CPP="$CPP"
+-fi
+- CPP="$ac_cv_prog_CPP"
+-else
+- ac_cv_prog_CPP="$CPP"
+-fi
+-echo "$ac_t""$CPP" 1>&6
+-
+ echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+-echo "configure:2275: checking for ANSI C header files" >&5
++echo "configure:6121: checking for ANSI C header files" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2280 "configure"
++#line 6126 "configure"
+ #include "confdefs.h"
+ #include <stdlib.h>
+ #include <stdarg.h>
+@@ -2284,7 +6130,7 @@
+ #include <float.h>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:2288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:6134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -2301,7 +6147,7 @@
+ if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat > conftest.$ac_ext <<EOF
+-#line 2305 "configure"
++#line 6151 "configure"
+ #include "confdefs.h"
+ #include <string.h>
+ EOF
+@@ -2319,7 +6165,7 @@
+ if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat > conftest.$ac_ext <<EOF
+-#line 2323 "configure"
++#line 6169 "configure"
+ #include "confdefs.h"
+ #include <stdlib.h>
+ EOF
+@@ -2340,7 +6186,7 @@
+ :
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2344 "configure"
++#line 6190 "configure"
+ #include "confdefs.h"
+ #include <ctype.h>
+ #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+@@ -2351,7 +6197,7 @@
+ exit (0); }
+
+ EOF
+-if { (eval echo configure:2355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ :
+ else
+@@ -2377,12 +6223,12 @@
+
+ # Checks for library functions.
+ echo $ac_n "checking for vprintf""... $ac_c" 1>&6
+-echo "configure:2381: checking for vprintf" >&5
++echo "configure:6227: checking for vprintf" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2386 "configure"
++#line 6232 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char vprintf(); below. */
+@@ -2405,7 +6251,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:6255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_vprintf=yes"
+ else
+@@ -2429,12 +6275,12 @@
+
+ if test "$ac_cv_func_vprintf" != yes; then
+ echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
+-echo "configure:2433: checking for _doprnt" >&5
++echo "configure:6279: checking for _doprnt" >&5
+ if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2438 "configure"
++#line 6284 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt(); below. */
+@@ -2457,7 +6303,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:6307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func__doprnt=yes"
+ else
+@@ -2485,12 +6331,12 @@
+ for ac_func in atexit on_exit
+ do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+-echo "configure:2489: checking for $ac_func" >&5
++echo "configure:6335: checking for $ac_func" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2494 "configure"
++#line 6340 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+@@ -2513,7 +6359,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:6363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+ else
+@@ -2539,7 +6385,7 @@
+
+
+ echo $ac_n "checking size of char""... $ac_c" 1>&6
+-echo "configure:2543: checking size of char" >&5
++echo "configure:6389: checking size of char" >&5
+ if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2547,9 +6393,10 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2551 "configure"
++#line 6397 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
++#include <sys/types.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+@@ -2558,7 +6405,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:2562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_sizeof_char=`cat conftestval`
+ else
+@@ -2578,7 +6425,7 @@
+
+
+ echo $ac_n "checking size of short""... $ac_c" 1>&6
+-echo "configure:2582: checking size of short" >&5
++echo "configure:6429: checking size of short" >&5
+ if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2586,9 +6433,10 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2590 "configure"
++#line 6437 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
++#include <sys/types.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+@@ -2597,7 +6445,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:2601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_sizeof_short=`cat conftestval`
+ else
+@@ -2617,7 +6465,7 @@
+
+
+ echo $ac_n "checking size of long""... $ac_c" 1>&6
+-echo "configure:2621: checking size of long" >&5
++echo "configure:6469: checking size of long" >&5
+ if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2625,9 +6473,10 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2629 "configure"
++#line 6477 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
++#include <sys/types.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+@@ -2636,7 +6485,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_sizeof_long=`cat conftestval`
+ else
+@@ -2656,7 +6505,7 @@
+
+
+ echo $ac_n "checking size of int""... $ac_c" 1>&6
+-echo "configure:2660: checking size of int" >&5
++echo "configure:6509: checking size of int" >&5
+ if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2664,9 +6513,10 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2668 "configure"
++#line 6517 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
++#include <sys/types.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+@@ -2675,7 +6525,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:2679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_sizeof_int=`cat conftestval`
+ else
+@@ -2695,7 +6545,7 @@
+
+
+ echo $ac_n "checking size of void *""... $ac_c" 1>&6
+-echo "configure:2699: checking size of void *" >&5
++echo "configure:6549: checking size of void *" >&5
+ if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2703,9 +6553,10 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2707 "configure"
++#line 6557 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
++#include <sys/types.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+@@ -2714,7 +6565,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:2718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_sizeof_void_p=`cat conftestval`
+ else
+@@ -2734,7 +6585,7 @@
+
+
+ echo $ac_n "checking size of long long""... $ac_c" 1>&6
+-echo "configure:2738: checking size of long long" >&5
++echo "configure:6589: checking size of long long" >&5
+ if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2742,9 +6593,10 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2746 "configure"
++#line 6597 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
++#include <sys/types.h>
+ main()
+ {
+ FILE *f=fopen("conftestval", "w");
+@@ -2753,7 +6605,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:2757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_sizeof_long_long=`cat conftestval`
+ else
+@@ -2774,12 +6626,12 @@
+
+
+ echo $ac_n "checking for working const""... $ac_c" 1>&6
+-echo "configure:2778: checking for working const" >&5
++echo "configure:6630: checking for working const" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2783 "configure"
++#line 6635 "configure"
+ #include "confdefs.h"
+
+ int main() {
+@@ -2828,7 +6680,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:6684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+ else
+@@ -2850,7 +6702,7 @@
+
+
+ echo $ac_n "checking for __inline""... $ac_c" 1>&6
+-echo "configure:2854: checking for __inline" >&5
++echo "configure:6706: checking for __inline" >&5
+ if eval "test \"`echo '$''{'glib_cv_has__inline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2859,14 +6711,14 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2863 "configure"
++#line 6715 "configure"
+ #include "confdefs.h"
+
+ __inline int foo () { return 0; }
+ int main () { return foo (); }
+
+ EOF
+-if { (eval echo configure:2870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_has__inline=yes
+
+@@ -2891,7 +6743,7 @@
+
+ esac
+ echo $ac_n "checking for __inline__""... $ac_c" 1>&6
+-echo "configure:2895: checking for __inline__" >&5
++echo "configure:6747: checking for __inline__" >&5
+ if eval "test \"`echo '$''{'glib_cv_has__inline__'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2900,14 +6752,14 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2904 "configure"
++#line 6756 "configure"
+ #include "confdefs.h"
+
+ __inline__ int foo () { return 0; }
+ int main () { return foo (); }
+
+ EOF
+-if { (eval echo configure:2911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_has__inline__=yes
+
+@@ -2932,7 +6784,7 @@
+
+ esac
+ echo $ac_n "checking for inline""... $ac_c" 1>&6
+-echo "configure:2936: checking for inline" >&5
++echo "configure:6788: checking for inline" >&5
+ if eval "test \"`echo '$''{'glib_cv_hasinline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -2941,14 +6793,14 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 2945 "configure"
++#line 6797 "configure"
+ #include "confdefs.h"
+
+ inline int foo () { return 0; }
+ int main () { return foo (); }
+
+ EOF
+-if { (eval echo configure:2952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_hasinline=yes
+
+@@ -2974,14 +6826,14 @@
+ esac
+
+ echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
+-echo "configure:2978: checking whether byte ordering is bigendian" >&5
++echo "configure:6830: checking whether byte ordering is bigendian" >&5
+ if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_cv_c_bigendian=unknown
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat > conftest.$ac_ext <<EOF
+-#line 2985 "configure"
++#line 6837 "configure"
+ #include "confdefs.h"
+ #include <sys/types.h>
+ #include <sys/param.h>
+@@ -2992,11 +6844,11 @@
+ #endif
+ ; return 0; }
+ EOF
+-if { (eval echo configure:2996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:6848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat > conftest.$ac_ext <<EOF
+-#line 3000 "configure"
++#line 6852 "configure"
+ #include "confdefs.h"
+ #include <sys/types.h>
+ #include <sys/param.h>
+@@ -3007,7 +6859,7 @@
+ #endif
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:6863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_bigendian=yes
+ else
+@@ -3027,7 +6879,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3031 "configure"
++#line 6883 "configure"
+ #include "confdefs.h"
+ main () {
+ /* Are we little or big endian? From Harbison&Steele. */
+@@ -3040,7 +6892,7 @@
+ exit (u.c[sizeof (long) - 1] == 1);
+ }
+ EOF
+-if { (eval echo configure:3044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:6896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_c_bigendian=no
+ else
+@@ -3068,17 +6920,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3072: checking for $ac_hdr" >&5
++echo "configure:6924: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3077 "configure"
++#line 6929 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:6934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3111,17 +6963,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3115: checking for $ac_hdr" >&5
++echo "configure:6967: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3120 "configure"
++#line 6972 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:6977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3154,17 +7006,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3158: checking for $ac_hdr" >&5
++echo "configure:7010: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3163 "configure"
++#line 7015 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3197,17 +7049,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3201: checking for $ac_hdr" >&5
++echo "configure:7053: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3206 "configure"
++#line 7058 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3240,17 +7092,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3244: checking for $ac_hdr" >&5
++echo "configure:7096: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3249 "configure"
++#line 7101 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3283,17 +7135,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3287: checking for $ac_hdr" >&5
++echo "configure:7139: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3292 "configure"
++#line 7144 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3326,17 +7178,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3330: checking for $ac_hdr" >&5
++echo "configure:7182: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3335 "configure"
++#line 7187 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3340: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3369,17 +7221,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3373: checking for $ac_hdr" >&5
++echo "configure:7225: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3378 "configure"
++#line 7230 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3412,17 +7264,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3416: checking for $ac_hdr" >&5
++echo "configure:7268: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3421 "configure"
++#line 7273 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3455,17 +7307,17 @@
+ do
+ ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:3459: checking for $ac_hdr" >&5
++echo "configure:7311: checking for $ac_hdr" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3464 "configure"
++#line 7316 "configure"
+ #include "confdefs.h"
+ #include <$ac_hdr>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3499,12 +7351,12 @@
+ for ac_func in lstat strerror strsignal memmove vsnprintf strcasecmp strncasecmp poll
+ do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+-echo "configure:3503: checking for $ac_func" >&5
++echo "configure:7355: checking for $ac_func" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3508 "configure"
++#line 7360 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+@@ -3527,7 +7379,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:7383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+ else
+@@ -3554,9 +7406,9 @@
+
+ # Check for sys_errlist
+ echo $ac_n "checking for sys_errlist""... $ac_c" 1>&6
+-echo "configure:3558: checking for sys_errlist" >&5
++echo "configure:7410: checking for sys_errlist" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 3560 "configure"
++#line 7412 "configure"
+ #include "confdefs.h"
+
+ int main() {
+@@ -3567,7 +7419,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:7423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ glib_ok=yes
+ else
+@@ -3587,9 +7439,9 @@
+
+ # Check for sys_siglist
+ echo $ac_n "checking for sys_siglist""... $ac_c" 1>&6
+-echo "configure:3591: checking for sys_siglist" >&5
++echo "configure:7443: checking for sys_siglist" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 3593 "configure"
++#line 7445 "configure"
+ #include "confdefs.h"
+
+ int main() {
+@@ -3599,7 +7451,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:7455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ glib_ok=yes
+ else
+@@ -3619,9 +7471,9 @@
+
+ # Check for sys_siglist decl (see Tue Jan 19 00:44:24 1999 in changelog)
+ echo $ac_n "checking for sys_siglist declaration""... $ac_c" 1>&6
+-echo "configure:3623: checking for sys_siglist declaration" >&5
++echo "configure:7475: checking for sys_siglist declaration" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 3625 "configure"
++#line 7477 "configure"
+ #include "confdefs.h"
+ #include <signal.h>
+ int main() {
+@@ -3630,7 +7482,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:7486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ glib_ok=yes
+ else
+@@ -3650,16 +7502,16 @@
+
+ # Check if <sys/select.h> needs to be included for fd_set
+ echo $ac_n "checking for fd_set""... $ac_c" 1>&6
+-echo "configure:3654: checking for fd_set" >&5
++echo "configure:7506: checking for fd_set" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 3656 "configure"
++#line 7508 "configure"
+ #include "confdefs.h"
+ #include <sys/types.h>
+ int main() {
+ fd_set readMask, writeMask;
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:7515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ gtk_ok=yes
+ else
+@@ -3673,7 +7525,7 @@
+ echo "$ac_t""yes, found in sys/types.h" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3677 "configure"
++#line 7529 "configure"
+ #include "confdefs.h"
+ #include <sys/select.h>
+ EOF
+@@ -3707,14 +7559,14 @@
+ # Check for wchar.h
+
+ echo $ac_n "checking for wchar.h""... $ac_c" 1>&6
+-echo "configure:3711: checking for wchar.h" >&5
++echo "configure:7563: checking for wchar.h" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 3713 "configure"
++#line 7565 "configure"
+ #include "confdefs.h"
+ #include <wchar.h>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3738,14 +7590,14 @@
+ # Check for wctype.h (for iswalnum)
+
+ echo $ac_n "checking for wctype.h""... $ac_c" 1>&6
+-echo "configure:3742: checking for wctype.h" >&5
++echo "configure:7594: checking for wctype.h" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 3744 "configure"
++#line 7596 "configure"
+ #include "confdefs.h"
+ #include <wctype.h>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:3749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:7601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -3769,12 +7621,12 @@
+ oLIBS="$LIBS"
+ # in Solaris 2.5, `iswalnum' is in -lw
+ echo $ac_n "checking for iswalnum""... $ac_c" 1>&6
+-echo "configure:3773: checking for iswalnum" >&5
++echo "configure:7625: checking for iswalnum" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_iswalnum'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3778 "configure"
++#line 7630 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char iswalnum(); below. */
+@@ -3797,7 +7649,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:7653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_iswalnum=yes"
+ else
+@@ -3815,7 +7667,7 @@
+ else
+ echo "$ac_t""no" 1>&6
+ echo $ac_n "checking for iswalnum in -lw""... $ac_c" 1>&6
+-echo "configure:3819: checking for iswalnum in -lw" >&5
++echo "configure:7671: checking for iswalnum in -lw" >&5
+ ac_lib_var=`echo w'_'iswalnum | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -3823,7 +7675,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lw $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 3827 "configure"
++#line 7679 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -3834,7 +7686,7 @@
+ iswalnum()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:7690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -3866,9 +7718,9 @@
+
+ # The following is necessary for Linux libc-5.4.38
+ echo $ac_n "checking if iswalnum() and friends are properly defined""... $ac_c" 1>&6
+-echo "configure:3870: checking if iswalnum() and friends are properly defined" >&5
++echo "configure:7722: checking if iswalnum() and friends are properly defined" >&5
+ cat > conftest.$ac_ext <<EOF
+-#line 3872 "configure"
++#line 7724 "configure"
+ #include "confdefs.h"
+ #include <stdlib.h>
+ int main() {
+@@ -3888,7 +7740,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:3892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:7744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ glib_working_wctype=yes
+ else
+@@ -3909,7 +7761,7 @@
+ echo "$ac_t""$glib_working_wctype" 1>&6
+
+ echo $ac_n "checking whether realloc (NULL,) will work""... $ac_c" 1>&6
+-echo "configure:3913: checking whether realloc (NULL,) will work" >&5
++echo "configure:7765: checking whether realloc (NULL,) will work" >&5
+ if eval "test \"`echo '$''{'glib_cv_sane_realloc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -3918,7 +7770,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3922 "configure"
++#line 7774 "configure"
+ #include "confdefs.h"
+
+ #include <stdlib.h>
+@@ -3926,7 +7778,7 @@
+ return realloc (0, sizeof (int)) == 0;
+ }
+ EOF
+-if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:7782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_sane_realloc=yes
+ cat >> confdefs.h <<\EOF
+@@ -3951,7 +7803,7 @@
+
+
+ echo $ac_n "checking for an implementation of va_copy()""... $ac_c" 1>&6
+-echo "configure:3955: checking for an implementation of va_copy()" >&5
++echo "configure:7807: checking for an implementation of va_copy()" >&5
+ if eval "test \"`echo '$''{'glib_cv_va_copy'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -3960,7 +7812,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 3964 "configure"
++#line 7816 "configure"
+ #include "confdefs.h"
+
+ #include <stdarg.h>
+@@ -3977,7 +7829,7 @@
+ return 0;
+ }
+ EOF
+-if { (eval echo configure:3981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:7833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_va_copy=yes
+
+@@ -3996,7 +7848,7 @@
+
+ echo "$ac_t""$glib_cv_va_copy" 1>&6
+ echo $ac_n "checking for an implementation of __va_copy()""... $ac_c" 1>&6
+-echo "configure:4000: checking for an implementation of __va_copy()" >&5
++echo "configure:7852: checking for an implementation of __va_copy()" >&5
+ if eval "test \"`echo '$''{'glib_cv___va_copy'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -4005,7 +7857,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4009 "configure"
++#line 7861 "configure"
+ #include "confdefs.h"
+
+ #include <stdarg.h>
+@@ -4022,7 +7874,7 @@
+ return 0;
+ }
+ EOF
+-if { (eval echo configure:4026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:7878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv___va_copy=yes
+
+@@ -4041,7 +7893,7 @@
+
+ echo "$ac_t""$glib_cv___va_copy" 1>&6
+ echo $ac_n "checking whether va_lists can be copied by value""... $ac_c" 1>&6
+-echo "configure:4045: checking whether va_lists can be copied by value" >&5
++echo "configure:7897: checking whether va_lists can be copied by value" >&5
+ if eval "test \"`echo '$''{'glib_cv_va_val_copy'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -4050,7 +7902,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4054 "configure"
++#line 7906 "configure"
+ #include "confdefs.h"
+
+ #include <stdarg.h>
+@@ -4067,7 +7919,7 @@
+ return 0;
+ }
+ EOF
+-if { (eval echo configure:4071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:7923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_va_val_copy=yes
+
+@@ -4112,12 +7964,12 @@
+ G_MODULE_HAVE_DLERROR=0
+ if test -z "$G_MODULE_IMPL"; then
+ echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+-echo "configure:4116: checking for dlopen" >&5
++echo "configure:7968: checking for dlopen" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4121 "configure"
++#line 7973 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen(); below. */
+@@ -4140,7 +7992,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:7996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=yes"
+ else
+@@ -4155,12 +8007,12 @@
+ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ echo $ac_n "checking for dlsym""... $ac_c" 1>&6
+-echo "configure:4159: checking for dlsym" >&5
++echo "configure:8011: checking for dlsym" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_dlsym'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4164 "configure"
++#line 8016 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlsym(); below. */
+@@ -4183,7 +8035,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dlsym=yes"
+ else
+@@ -4211,7 +8063,7 @@
+ fi
+ if test -z "$G_MODULE_IMPL"; then
+ echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+-echo "configure:4215: checking for dlopen in -ldl" >&5
++echo "configure:8067: checking for dlopen in -ldl" >&5
+ ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4219,7 +8071,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-ldl $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4223 "configure"
++#line 8075 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4230,7 +8082,7 @@
+ dlopen()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4246,7 +8098,7 @@
+ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6
+-echo "configure:4250: checking for dlsym in -ldl" >&5
++echo "configure:8102: checking for dlsym in -ldl" >&5
+ ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4254,7 +8106,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-ldl $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4258 "configure"
++#line 8110 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4265,7 +8117,7 @@
+ dlsym()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4295,18 +8147,18 @@
+ fi
+ if test -z "$G_MODULE_IMPL"; then
+ echo $ac_n "checking how to export all symbols""... $ac_c" 1>&6
+-echo "configure:4299: checking how to export all symbols" >&5
++echo "configure:8151: checking how to export all symbols" >&5
+ SAVED_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ cat > conftest.$ac_ext <<EOF
+-#line 4303 "configure"
++#line 8155 "configure"
+ #include "confdefs.h"
+
+ int main() {
+ return 0;
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ G_MODULE_LDFLAGS="-Wl,-E"
+ else
+@@ -4316,14 +8168,14 @@
+
+ LDFLAGS="$SAVED_LDFLAGS -bexpall"
+ cat > conftest.$ac_ext <<EOF
+-#line 4320 "configure"
++#line 8172 "configure"
+ #include "confdefs.h"
+
+ int main() {
+ return 0;
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ G_MODULE_LDFLAGS="-bexpall"
+ else
+@@ -4343,7 +8195,7 @@
+ G_MODULE_LDFLAGS=
+ fi
+ echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+-echo "configure:4347: checking for shl_load in -ldld" >&5
++echo "configure:8199: checking for shl_load in -ldld" >&5
+ ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4351,7 +8203,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-ldld $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4355 "configure"
++#line 8207 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4362,7 +8214,7 @@
+ shl_load()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4396,7 +8248,7 @@
+ LIBS="$LIBS $G_MODULE_LIBS"
+ LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ echo $ac_n "checking for RTLD_GLOBAL brokenness""... $ac_c" 1>&6
+-echo "configure:4400: checking for RTLD_GLOBAL brokenness" >&5
++echo "configure:8252: checking for RTLD_GLOBAL brokenness" >&5
+ if eval "test \"`echo '$''{'glib_cv_rtldglobal_broken'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -4405,7 +8257,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4409 "configure"
++#line 8261 "configure"
+ #include "confdefs.h"
+
+ #include <dlfcn.h>
+@@ -4425,7 +8277,7 @@
+ return global == local;
+ }
+ EOF
+-if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:8281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_rtldglobal_broken=no
+ else
+@@ -4448,7 +8300,7 @@
+ G_MODULE_BROKEN_RTLD_GLOBAL=0
+ fi
+ echo $ac_n "checking for preceeding underscore in symbols""... $ac_c" 1>&6
+-echo "configure:4452: checking for preceeding underscore in symbols" >&5
++echo "configure:8304: checking for preceeding underscore in symbols" >&5
+ if eval "test \"`echo '$''{'glib_cv_uscore'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -4457,7 +8309,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4461 "configure"
++#line 8313 "configure"
+ #include "confdefs.h"
+
+ #include <dlfcn.h>
+@@ -4471,7 +8323,7 @@
+ } return (!f2 || f1);
+ }
+ EOF
+-if { (eval echo configure:4475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:8327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_uscore=yes
+ else
+@@ -4496,12 +8348,12 @@
+
+ LDFLAGS="$LDFLAGS_orig"
+ echo $ac_n "checking for dlerror""... $ac_c" 1>&6
+-echo "configure:4500: checking for dlerror" >&5
++echo "configure:8352: checking for dlerror" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_dlerror'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4505 "configure"
++#line 8357 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlerror(); below. */
+@@ -4524,7 +8376,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dlerror=yes"
+ else
+@@ -4608,7 +8460,7 @@
+ case $host in
+ *-*-solaris*)
+ echo $ac_n "checking for cond_init in -lthread""... $ac_c" 1>&6
+-echo "configure:4612: checking for cond_init in -lthread" >&5
++echo "configure:8464: checking for cond_init in -lthread" >&5
+ ac_lib_var=`echo thread'_'cond_init | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4616,7 +8468,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4620 "configure"
++#line 8472 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4627,7 +8479,7 @@
+ cond_init()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4654,17 +8506,17 @@
+ if test "x$have_threads" = xnone; then
+ ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
+ echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
+-echo "configure:4658: checking for pthread.h" >&5
++echo "configure:8510: checking for pthread.h" >&5
+ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4663 "configure"
++#line 8515 "configure"
+ #include "confdefs.h"
+ #include <pthread.h>
+ EOF
+ ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:4668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
++{ (eval echo configure:8520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+ if test -z "$ac_err"; then
+ rm -rf conftest*
+@@ -4690,7 +8542,7 @@
+ if test "x$want_threads" = xyes || test "x$want_threads" = xnspr; then
+ if test "x$have_threads" = xnone; then
+ echo $ac_n "checking for PRP_NewNakedCondVar in -lnspr21""... $ac_c" 1>&6
+-echo "configure:4694: checking for PRP_NewNakedCondVar in -lnspr21" >&5
++echo "configure:8546: checking for PRP_NewNakedCondVar in -lnspr21" >&5
+ ac_lib_var=`echo nspr21'_'PRP_NewNakedCondVar | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4698,7 +8550,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lnspr21 $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4702 "configure"
++#line 8554 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4709,7 +8561,7 @@
+ PRP_NewNakedCondVar()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4733,7 +8585,7 @@
+ fi
+
+ echo $ac_n "checking for thread implementation""... $ac_c" 1>&6
+-echo "configure:4737: checking for thread implementation" >&5
++echo "configure:8589: checking for thread implementation" >&5
+
+ if test "x$have_threads" = xnone && test "x$want_threads" != xno; then
+ echo "$ac_t""none available" 1>&6
+@@ -4752,7 +8604,7 @@
+ posix)
+ G_THREAD_LIBS=error
+ echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
+-echo "configure:4756: checking for pthread_attr_init in -lpthread" >&5
++echo "configure:8608: checking for pthread_attr_init in -lpthread" >&5
+ ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4760,7 +8612,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lpthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4764 "configure"
++#line 8616 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4771,7 +8623,7 @@
+ pthread_attr_init()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4793,7 +8645,7 @@
+
+ if test "x$G_THREAD_LIBS" = xerror; then
+ echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
+-echo "configure:4797: checking for pthread_attr_init in -lpthreads" >&5
++echo "configure:8649: checking for pthread_attr_init in -lpthreads" >&5
+ ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4801,7 +8653,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lpthreads $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4805 "configure"
++#line 8657 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4812,7 +8664,7 @@
+ pthread_attr_init()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4835,7 +8687,7 @@
+ fi
+ if test "x$G_THREAD_LIBS" = xerror; then
+ echo $ac_n "checking for pthread_attr_init in -lthread""... $ac_c" 1>&6
+-echo "configure:4839: checking for pthread_attr_init in -lthread" >&5
++echo "configure:8691: checking for pthread_attr_init in -lthread" >&5
+ ac_lib_var=`echo thread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4843,7 +8695,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4847 "configure"
++#line 8699 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4854,7 +8706,7 @@
+ pthread_attr_init()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4877,7 +8729,7 @@
+ fi
+ if test "x$G_THREAD_LIBS" = xerror; then
+ echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
+-echo "configure:4881: checking for pthread_attr_init in -lc_r" >&5
++echo "configure:8733: checking for pthread_attr_init in -lc_r" >&5
+ ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4885,7 +8737,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lc_r $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4889 "configure"
++#line 8741 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4896,7 +8748,7 @@
+ pthread_attr_init()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -4919,12 +8771,12 @@
+ fi
+ if test "x$G_THREAD_LIBS" = xerror; then
+ echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
+-echo "configure:4923: checking for pthread_attr_init" >&5
++echo "configure:8775: checking for pthread_attr_init" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 4928 "configure"
++#line 8780 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char pthread_attr_init(); below. */
+@@ -4947,7 +8799,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_pthread_attr_init=yes"
+ else
+@@ -4969,7 +8821,7 @@
+ fi
+ if test "x$G_THREAD_LIBS" = xerror; then
+ echo $ac_n "checking for __d10_pthread_attr_init in -lthread""... $ac_c" 1>&6
+-echo "configure:4973: checking for __d10_pthread_attr_init in -lthread" >&5
++echo "configure:8825: checking for __d10_pthread_attr_init in -lthread" >&5
+ ac_lib_var=`echo thread'_'__d10_pthread_attr_init | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -4977,7 +8829,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 4981 "configure"
++#line 8833 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -4988,7 +8840,7 @@
+ __d10_pthread_attr_init()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:4992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -5012,7 +8864,7 @@
+ fi
+ if test "x$G_THREAD_LIBS" = xerror; then
+ echo $ac_n "checking for __pthread_attr_init_system in -lpthread""... $ac_c" 1>&6
+-echo "configure:5016: checking for __pthread_attr_init_system in -lpthread" >&5
++echo "configure:8868: checking for __pthread_attr_init_system in -lpthread" >&5
+ ac_lib_var=`echo pthread'_'__pthread_attr_init_system | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -5020,7 +8872,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lpthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 5024 "configure"
++#line 8876 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -5031,7 +8883,7 @@
+ __pthread_attr_init_system()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:5035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -5061,7 +8913,7 @@
+ solaris)
+ G_THREAD_LIBS=error
+ echo $ac_n "checking for cond_init in -lthread""... $ac_c" 1>&6
+-echo "configure:5065: checking for cond_init in -lthread" >&5
++echo "configure:8917: checking for cond_init in -lthread" >&5
+ ac_lib_var=`echo thread'_'cond_init | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -5069,7 +8921,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lthread $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 5073 "configure"
++#line 8925 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -5080,7 +8932,7 @@
+ cond_init()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:5084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -5108,7 +8960,7 @@
+ ;;
+ nspr)
+ echo $ac_n "checking for PRP_NewNakedCondVar in -lnspr21""... $ac_c" 1>&6
+-echo "configure:5112: checking for PRP_NewNakedCondVar in -lnspr21" >&5
++echo "configure:8964: checking for PRP_NewNakedCondVar in -lnspr21" >&5
+ ac_lib_var=`echo nspr21'_'PRP_NewNakedCondVar | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+@@ -5116,7 +8968,7 @@
+ ac_save_LIBS="$LIBS"
+ LIBS="-lnspr21 $LIBS"
+ cat > conftest.$ac_ext <<EOF
+-#line 5120 "configure"
++#line 8972 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+@@ -5127,7 +8979,7 @@
+ PRP_NewNakedCondVar()
+ ; return 0; }
+ EOF
+-if { (eval echo configure:5131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:8983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+@@ -5163,7 +9015,7 @@
+ fi
+
+ echo $ac_n "checking necessary linker options""... $ac_c" 1>&6
+-echo "configure:5167: checking necessary linker options" >&5
++echo "configure:9019: checking necessary linker options" >&5
+ echo "$ac_t""$G_THREAD_LIBS" 1>&6
+
+
+@@ -5191,7 +9043,7 @@
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS"
+ cat > conftest.$ac_ext <<EOF
+-#line 5195 "configure"
++#line 9047 "configure"
+ #include "confdefs.h"
+ #include <time.h>
+ EOF
+@@ -5208,7 +9060,7 @@
+ CPPFLAGS=$old_CPPFLAGS
+
+ echo $ac_n "checking necessary compiler options""... $ac_c" 1>&6
+-echo "configure:5212: checking necessary compiler options" >&5
++echo "configure:9064: checking necessary compiler options" >&5
+
+ echo "$ac_t""$G_THREAD_CFLAGS" 1>&6
+ else
+@@ -5226,12 +9078,12 @@
+ for ac_func in localtime_r rand_r
+ do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+-echo "configure:5230: checking for $ac_func" >&5
++echo "configure:9082: checking for $ac_func" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 5235 "configure"
++#line 9087 "configure"
+ #include "confdefs.h"
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+@@ -5254,7 +9106,7 @@
+
+ ; return 0; }
+ EOF
+-if { (eval echo configure:5258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:9110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+ else
+@@ -5280,7 +9132,7 @@
+
+ if test "$ac_cv_header_pwd_h" = "yes"; then
+ echo $ac_n "checking for getpwuid_r""... $ac_c" 1>&6
+-echo "configure:5284: checking for getpwuid_r" >&5
++echo "configure:9136: checking for getpwuid_r" >&5
+ if eval "test \"`echo '$''{'ac_cv_func_getpwuid_r'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -5288,7 +9140,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 5292 "configure"
++#line 9144 "configure"
+ #include "confdefs.h"
+ #include <errno.h>
+ int main () { char buffer[10000], *pointer;
+@@ -5300,7 +9152,7 @@
+ sizeof (buffer), &pointer);
+ return errno == ENOSYS || error == ENOSYS;}
+ EOF
+-if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:9156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ ac_cv_func_getpwuid_r=yes
+ else
+@@ -5325,11 +9177,11 @@
+ fi
+ if test "$ac_cv_func_getpwuid_r" = "yes"; then
+ echo $ac_n "checking whether getpwuid_r is posix like""... $ac_c" 1>&6
+-echo "configure:5329: checking whether getpwuid_r is posix like" >&5
++echo "configure:9181: checking whether getpwuid_r is posix like" >&5
+ # The signature for the POSIX version is:
+ # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **)
+ cat > conftest.$ac_ext <<EOF
+-#line 5333 "configure"
++#line 9185 "configure"
+ #include "confdefs.h"
+ #include <pwd.h>
+ #include <sys/types.h>
+@@ -5338,7 +9190,7 @@
+ getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);
+ ; return 0; }
+ EOF
+-if { (eval echo configure:5342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:9194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ cat >> confdefs.h <<\EOF
+ #define HAVE_GETPWUID_R_POSIX 1
+@@ -5357,17 +9209,17 @@
+ if test x"$have_threads" = xposix; then
+ LIBS="$LIBS $G_THREAD_LIBS"
+ echo $ac_n "checking whether pthread_getspecific is posix like""... $ac_c" 1>&6
+-echo "configure:5361: checking whether pthread_getspecific is posix like" >&5
++echo "configure:9213: checking whether pthread_getspecific is posix like" >&5
+ # PCThreads has pthread_getspecific(pthread_key_t, void **);
+ cat > conftest.$ac_ext <<EOF
+-#line 5364 "configure"
++#line 9216 "configure"
+ #include "confdefs.h"
+ #include <pthread.h>
+ int main() {
+ pthread_getspecific(0,NULL);
+ ; return 0; }
+ EOF
+-if { (eval echo configure:5371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++if { (eval echo configure:9223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+ else
+@@ -5382,20 +9234,20 @@
+ fi
+ rm -f conftest*
+ echo $ac_n "checking whether pthread_mutex_trylock is posix like""... $ac_c" 1>&6
+-echo "configure:5386: checking whether pthread_mutex_trylock is posix like" >&5
++echo "configure:9238: checking whether pthread_mutex_trylock is posix like" >&5
+ # DCE Threads return 1 as success, posix 0. what a mess.
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 5392 "configure"
++#line 9244 "configure"
+ #include "confdefs.h"
+ #include <pthread.h>
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ int main () {
+ return !pthread_mutex_trylock (&mutex); }
+ EOF
+-if { (eval echo configure:5399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:9251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ echo "$ac_t""no" 1>&6
+ else
+@@ -5412,13 +9264,13 @@
+ fi
+
+ echo $ac_n "checking whether pthread_cond_timedwait is posix like""... $ac_c" 1>&6
+-echo "configure:5416: checking whether pthread_cond_timedwait is posix like" >&5
++echo "configure:9268: checking whether pthread_cond_timedwait is posix like" >&5
+ # DCE Threads return -1 as failure, posix ETIMEDOUT.
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 5422 "configure"
++#line 9274 "configure"
+ #include "confdefs.h"
+ #include <pthread.h>
+ int main () {
+@@ -5432,7 +9284,7 @@
+ return pthread_cond_timedwait (&cond,&mutex,&tspec)
+ != -1;}
+ EOF
+-if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:9288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ echo "$ac_t""no" 1>&6
+ else
+@@ -5475,7 +9327,7 @@
+ case "$mutex_has_default" in
+ "yes")
+ echo $ac_n "checking size of $mutex_default_type""... $ac_c" 1>&6
+-echo "configure:5479: checking size of $mutex_default_type" >&5
++echo "configure:9331: checking size of $mutex_default_type" >&5
+ if eval "test \"`echo '$''{'glib_cv_sizeof_gmutex'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -5483,7 +9335,7 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 5487 "configure"
++#line 9339 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
+ #include <$mutex_header_file>
+@@ -5495,7 +9347,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:5499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:9351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_sizeof_gmutex=`cat conftestval`
+ else
+@@ -5515,7 +9367,7 @@
+
+
+ echo $ac_n "checking byte contents of $mutex_default_type""... $ac_c" 1>&6
+-echo "configure:5519: checking byte contents of $mutex_default_type" >&5
++echo "configure:9371: checking byte contents of $mutex_default_type" >&5
+ if eval "test \"`echo '$''{'glib_cv_byte_contents_gmutex'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -5523,7 +9375,7 @@
+ glib_cv_byte_contents_gmutex=0
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 5527 "configure"
++#line 9379 "configure"
+ #include "confdefs.h"
+ #include <stdio.h>
+ #include <$mutex_header_file>
+@@ -5540,7 +9392,7 @@
+ exit(0);
+ }
+ EOF
+-if { (eval echo configure:5544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:9396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ glib_cv_byte_contents_gmutex=`cat conftestval`
+ else
+@@ -5576,7 +9428,7 @@
+ glib_nl='\n'
+ fi
+ echo $ac_n "checking system definitions for $glib_sysdef_msg""... $ac_c" 1>&6
+-echo "configure:5580: checking system definitions for $glib_sysdef_msg" >&5
++echo "configure:9432: checking system definitions for $glib_sysdef_msg" >&5
+ cat >confrun.c <<_______EOF
+ #include <stdio.h>
+ #include <sys/types.h>
+@@ -5603,11 +9455,11 @@
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+ else
+ cat > conftest.$ac_ext <<EOF
+-#line 5607 "configure"
++#line 9459 "configure"
+ #include "confdefs.h"
+ `cat confrun.c`
+ EOF
+-if { (eval echo configure:5611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
++if { (eval echo configure:9463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+ then
+ echo "$ac_t""done" 1>&6
+ else
+@@ -5813,16 +9665,20 @@
+ s%@build_cpu@%$build_cpu%g
+ s%@build_vendor@%$build_vendor%g
+ s%@build_os@%$build_os%g
+-s%@RANLIB@%$RANLIB%g
+ s%@CC@%$CC%g
+ s%@LN_S@%$LN_S%g
++s%@OBJEXT@%$OBJEXT%g
++s%@EXEEXT@%$EXEEXT%g
++s%@ECHO@%$ECHO%g
++s%@RANLIB@%$RANLIB%g
++s%@STRIP@%$STRIP%g
++s%@CPP@%$CPP%g
+ s%@LIBTOOL@%$LIBTOOL%g
+ s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+ s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+ s%@MAINT@%$MAINT%g
+ s%@ENABLE_MEM_CHECK@%$ENABLE_MEM_CHECK%g
+ s%@ENABLE_MEM_PROFILE@%$ENABLE_MEM_PROFILE%g
+-s%@CPP@%$CPP%g
+ s%@G_MODULE_IMPL@%$G_MODULE_IMPL%g
+ s%@G_MODULE_LIBS@%$G_MODULE_LIBS%g
+ s%@G_MODULE_LDFLAGS@%$G_MODULE_LDFLAGS%g
+--- glib1.2-1.2.10.orig/ltmain.sh
++++ glib1.2-1.2.10/ltmain.sh
+@@ -1,7 +1,8 @@
+ # ltmain.sh - Provide generalized library-building support services.
+-# NOTE: Changing this file will not affect anything until you rerun ltconfig.
++# NOTE: Changing this file will not affect anything until you rerun configure.
+ #
+-# Copyright (C) 1996-1999 Free Software Foundation, Inc.
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
++# Free Software Foundation, Inc.
+ # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+ #
+ # This program is free software; you can redistribute it and/or modify
+@@ -48,14 +49,14 @@
+ fi
+
+ # The name of this program.
+-progname=`$echo "$0" | sed 's%^.*/%%'`
++progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+ modename="$progname"
+
+ # Constants.
+ PROGRAM=ltmain.sh
+ PACKAGE=libtool
+-VERSION=1.3.4
+-TIMESTAMP=" (1.385.2.196 1999/12/07 21:47:57)"
++VERSION=1.4.3
++TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
+
+ default_mode=
+ help="Try \`$progname --help' for more information."
+@@ -66,10 +67,19 @@
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+-Xsed='sed -e 1s/^X//'
++Xsed="${SED}"' -e 1s/^X//'
+ sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+-SP2NL='tr \040 \012'
+-NL2SP='tr \015\012 \040\040'
++# test EBCDIC or ASCII
++case `echo A|od -x` in
++ *[Cc]1*) # EBCDIC based system
++ SP2NL="tr '\100' '\n'"
++ NL2SP="tr '\r\n' '\100\100'"
++ ;;
++ *) # Assume ASCII based system
++ SP2NL="tr '\040' '\012'"
++ NL2SP="tr '\015\012' '\040\040'"
++ ;;
++esac
+
+ # NLS nuisances.
+ # Only set LANG and LC_ALL to C if already set.
+@@ -83,11 +93,8 @@
+ save_LANG="$LANG"; LANG=C; export LANG
+ fi
+
+-if test "$LTCONFIG_VERSION" != "$VERSION"; then
+- echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
+- echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+- exit 1
+-fi
++# Make sure IFS has a sensible default
++: ${IFS=" "}
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ echo "$modename: not configured to build any kind of library" 1>&2
+@@ -113,16 +120,16 @@
+ arg="$1"
+ shift
+
+- case "$arg" in
++ case $arg in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+- case "$prev" in
++ case $prev in
+ execute_dlfiles)
+- eval "$prev=\"\$$prev \$arg\""
++ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
+ *)
+ eval "$prev=\$arg"
+@@ -135,7 +142,7 @@
+ fi
+
+ # Have we seen a non-optional argument yet?
+- case "$arg" in
++ case $arg in
+ --help)
+ show_help=yes
+ ;;
+@@ -146,7 +153,7 @@
+ ;;
+
+ --config)
+- sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
++ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ exit 0
+ ;;
+
+@@ -179,6 +186,8 @@
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
++ --preserve-dup-deps) duplicate_deps="yes" ;;
++
+ --quiet | --silent)
+ show=:
+ ;;
+@@ -207,16 +216,21 @@
+ exit 1
+ fi
+
++# If this variable is set in any of the actions, the command in it
++# will be execed at the end. This prevents here-documents from being
++# left over by shells.
++exec_cmd=
++
+ if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+- case "$nonopt" in
+- *cc | *++ | gcc* | *-gcc*)
++ case $nonopt in
++ *cc | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+- case "$arg" in
++ case $arg in
+ -c)
+ mode=compile
+ break
+@@ -261,12 +275,13 @@
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+- case "$mode" in
++ case $mode in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
++ prev=
+ lastarg=
+ srcfile="$nonopt"
+ suppress_output=
+@@ -274,8 +289,34 @@
+ user_target=no
+ for arg
+ do
++ case $prev in
++ "") ;;
++ xcompiler)
++ # Aesthetically quote the previous argument.
++ prev=
++ lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
++
++ case $arg in
++ # Double-quote args containing other shell metacharacters.
++ # Many Bourne shells cannot handle close brackets correctly
++ # in scan sets, so we specify it separately.
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ arg="\"$arg\""
++ ;;
++ esac
++
++ # Add the previous argument to base_compile.
++ if test -z "$base_compile"; then
++ base_compile="$lastarg"
++ else
++ base_compile="$base_compile $lastarg"
++ fi
++ continue
++ ;;
++ esac
++
+ # Accept any command-line options.
+- case "$arg" in
++ case $arg in
+ -o)
+ if test "$user_target" != "no"; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+@@ -288,9 +329,53 @@
+ build_old_libs=yes
+ continue
+ ;;
++
++ -prefer-pic)
++ pic_mode=yes
++ continue
++ ;;
++
++ -prefer-non-pic)
++ pic_mode=no
++ continue
++ ;;
++
++ -Xcompiler)
++ prev=xcompiler
++ continue
++ ;;
++
++ -Wc,*)
++ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
++ lastarg=
++ save_ifs="$IFS"; IFS=','
++ for arg in $args; do
++ IFS="$save_ifs"
++
++ # Double-quote args containing other shell metacharacters.
++ # Many Bourne shells cannot handle close brackets correctly
++ # in scan sets, so we specify it separately.
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ arg="\"$arg\""
++ ;;
++ esac
++ lastarg="$lastarg $arg"
++ done
++ IFS="$save_ifs"
++ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
++
++ # Add the arguments to base_compile.
++ if test -z "$base_compile"; then
++ base_compile="$lastarg"
++ else
++ base_compile="$base_compile $lastarg"
++ fi
++ continue
++ ;;
+ esac
+
+- case "$user_target" in
++ case $user_target in
+ next)
+ # The next one is the -o target name
+ user_target=yes
+@@ -316,10 +401,10 @@
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ # Double-quote args containing other shell metacharacters.
+- # Many Bourne shells cannot handle close brackets correctly in scan
+- # sets, so we specify it separately.
+- case "$lastarg" in
+- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
++ # Many Bourne shells cannot handle close brackets correctly
++ # in scan sets, so we specify it separately.
++ case $lastarg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+@@ -332,7 +417,7 @@
+ fi
+ done
+
+- case "$user_target" in
++ case $user_target in
+ set)
+ ;;
+ no)
+@@ -348,7 +433,7 @@
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSfmso]'
+- case "$libobj" in
++ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+@@ -363,7 +448,7 @@
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+- case "$libobj" in
++ case $libobj in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+@@ -387,10 +472,21 @@
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit 1" 1 2 15
+
++ # On Cygwin there's no "real" PIC flag so we must build both object types
++ case $host_os in
++ cygwin* | mingw* | pw32* | os2*)
++ pic_mode=default
++ ;;
++ esac
++ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
++ # non-PIC code in shared libraries is not supported
++ pic_mode=default
++ fi
++
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+- output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
++ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit 1" 1 2 15
+@@ -402,7 +498,7 @@
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+- until ln "$0" "$lockfile" 2>/dev/null; do
++ until $run ln "$0" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+@@ -434,8 +530,13 @@
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+- # All platforms use -DPIC, to notify preprocessed assembler code.
+- command="$base_compile $srcfile $pic_flag -DPIC"
++ if test "$pic_mode" != no; then
++ # All platforms use -DPIC, to notify preprocessed assembler code.
++ command="$base_compile $srcfile $pic_flag -DPIC"
++ else
++ # Don't build PIC code
++ command="$base_compile $srcfile"
++ fi
+ if test "$build_old_libs" = yes; then
+ lo_libobj="$libobj"
+ dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+@@ -506,7 +607,8 @@
+ fi
+
+ # If we have no pic_flag, then copy the object into place and finish.
+- if test -z "$pic_flag" && test "$build_old_libs" = yes; then
++ if (test -z "$pic_flag" || test "$pic_mode" != default) &&
++ test "$build_old_libs" = yes; then
+ # Rename the .lo from within objdir to obj
+ if test -f $obj; then
+ $show $rm $obj
+@@ -532,6 +634,10 @@
+ # Now arrange that obj and lo_libobj become the same file
+ $show "(cd $xdir && $LN_S $baseobj $libobj)"
+ if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
++ # Unlock the critical section if it was locked
++ if test "$need_locks" != no; then
++ $run $rm "$lockfile"
++ fi
+ exit 0
+ else
+ error=$?
+@@ -546,7 +652,13 @@
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+- command="$base_compile $srcfile"
++ if test "$pic_mode" != yes; then
++ # Don't build PIC code
++ command="$base_compile $srcfile"
++ else
++ # All platforms use -DPIC, to notify preprocessed assembler code.
++ command="$base_compile $srcfile $pic_flag -DPIC"
++ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ output_obj="$obj"
+@@ -612,17 +724,17 @@
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+- $rm "$lockfile"
++ $run $rm "$lockfile"
+ fi
+
+ exit 0
+ ;;
+
+ # libtool link mode
+- link)
++ link | relink)
+ modename="$modename: link"
+- case "$host" in
+- *-*-cygwin* | *-*-mingw* | *-*-os2*)
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+@@ -635,179 +747,12 @@
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+-
+- # This is a source program that is used to create dlls on Windows
+- # Don't remove nor modify the starting and closing comments
+-# /* ltdll.c starts here */
+-# #define WIN32_LEAN_AND_MEAN
+-# #include <windows.h>
+-# #undef WIN32_LEAN_AND_MEAN
+-# #include <stdio.h>
+-#
+-# #ifndef __CYGWIN__
+-# # ifdef __CYGWIN32__
+-# # define __CYGWIN__ __CYGWIN32__
+-# # endif
+-# #endif
+-#
+-# #ifdef __cplusplus
+-# extern "C" {
+-# #endif
+-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+-# #ifdef __cplusplus
+-# }
+-# #endif
+-#
+-# #ifdef __CYGWIN__
+-# #include <cygwin/cygwin_dll.h>
+-# DECLARE_CYGWIN_DLL( DllMain );
+-# #endif
+-# HINSTANCE __hDllInstance_base;
+-#
+-# BOOL APIENTRY
+-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+-# {
+-# __hDllInstance_base = hInst;
+-# return TRUE;
+-# }
+-# /* ltdll.c ends here */
+- # This is a source program that is used to create import libraries
+- # on Windows for dlls which lack them. Don't remove nor modify the
+- # starting and closing comments
+-# /* impgen.c starts here */
+-# /* Copyright (C) 1999 Free Software Foundation, Inc.
+-#
+-# This file is part of GNU libtool.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
+-# (at your option) any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-# */
+-#
+-# #include <stdio.h> /* for printf() */
+-# #include <unistd.h> /* for open(), lseek(), read() */
+-# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
+-# #include <string.h> /* for strdup() */
+-#
+-# static unsigned int
+-# pe_get16 (fd, offset)
+-# int fd;
+-# int offset;
+-# {
+-# unsigned char b[2];
+-# lseek (fd, offset, SEEK_SET);
+-# read (fd, b, 2);
+-# return b[0] + (b[1]<<8);
+-# }
+-#
+-# static unsigned int
+-# pe_get32 (fd, offset)
+-# int fd;
+-# int offset;
+-# {
+-# unsigned char b[4];
+-# lseek (fd, offset, SEEK_SET);
+-# read (fd, b, 4);
+-# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+-# }
+-#
+-# static unsigned int
+-# pe_as32 (ptr)
+-# void *ptr;
+-# {
+-# unsigned char *b = ptr;
+-# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+-# }
+-#
+-# int
+-# main (argc, argv)
+-# int argc;
+-# char *argv[];
+-# {
+-# int dll;
+-# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
+-# unsigned long export_rva, export_size, nsections, secptr, expptr;
+-# unsigned long name_rvas, nexp;
+-# unsigned char *expdata, *erva;
+-# char *filename, *dll_name;
+-#
+-# filename = argv[1];
+-#
+-# dll = open(filename, O_RDONLY|O_BINARY);
+-# if (!dll)
+-# return 1;
+-#
+-# dll_name = filename;
+-#
+-# for (i=0; filename[i]; i++)
+-# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
+-# dll_name = filename + i +1;
+-#
+-# pe_header_offset = pe_get32 (dll, 0x3c);
+-# opthdr_ofs = pe_header_offset + 4 + 20;
+-# num_entries = pe_get32 (dll, opthdr_ofs + 92);
+-#
+-# if (num_entries < 1) /* no exports */
+-# return 1;
+-#
+-# export_rva = pe_get32 (dll, opthdr_ofs + 96);
+-# export_size = pe_get32 (dll, opthdr_ofs + 100);
+-# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
+-# secptr = (pe_header_offset + 4 + 20 +
+-# pe_get16 (dll, pe_header_offset + 4 + 16));
+-#
+-# expptr = 0;
+-# for (i = 0; i < nsections; i++)
+-# {
+-# char sname[8];
+-# unsigned long secptr1 = secptr + 40 * i;
+-# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+-# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
+-# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
+-# lseek(dll, secptr1, SEEK_SET);
+-# read(dll, sname, 8);
+-# if (vaddr <= export_rva && vaddr+vsize > export_rva)
+-# {
+-# expptr = fptr + (export_rva - vaddr);
+-# if (export_rva + export_size > vaddr + vsize)
+-# export_size = vsize - (export_rva - vaddr);
+-# break;
+-# }
+-# }
+-#
+-# expdata = (unsigned char*)malloc(export_size);
+-# lseek (dll, expptr, SEEK_SET);
+-# read (dll, expdata, export_size);
+-# erva = expdata - export_rva;
+-#
+-# nexp = pe_as32 (expdata+24);
+-# name_rvas = pe_as32 (expdata+32);
+-#
+-# printf ("EXPORTS\n");
+-# for (i = 0; i<nexp; i++)
+-# {
+-# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+-# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
+-# }
+-#
+-# return 0;
+-# }
+-# /* impgen.c ends here */
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
++ libtool_args="$nonopt"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
+
+@@ -818,18 +763,13 @@
+ convenience=
+ old_convenience=
+ deplibs=
+- linkopts=
++ old_deplibs=
++ compiler_flags=
++ linker_flags=
++ dllsearchpath=
++ lib_search_path=`pwd`
++ inst_prefix_dir=
+
+- if test -n "$shlibpath_var"; then
+- # get the directories listed in $shlibpath_var
+- eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+- else
+- lib_search_path=
+- fi
+- # now prepend the system-specific ones
+- eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
+- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+-
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+@@ -839,9 +779,9 @@
+ export_symbols_regex=
+ generated=
+ libobjs=
+- link_against_libtool_libs=
+ ltlibs=
+ module=no
++ no_install=no
+ objs=
+ prefer_static_libs=no
+ preload=no
+@@ -858,7 +798,7 @@
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+- case "$arg" in
++ case $arg in
+ -all-static | -static)
+ if test "X$arg" = "X-all-static"; then
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+@@ -887,17 +827,24 @@
+ while test $# -gt 0; do
+ arg="$1"
+ shift
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
++ ;;
++ *) qarg=$arg ;;
++ esac
++ libtool_args="$libtool_args $qarg"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+- case "$prev" in
++ case $prev in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+- case "$prev" in
++ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+@@ -905,7 +852,7 @@
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+- case "$arg" in
++ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+@@ -934,6 +881,7 @@
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
++ continue
+ ;;
+ esac
+ ;;
+@@ -951,6 +899,11 @@
+ prev=
+ continue
+ ;;
++ inst_prefix)
++ inst_prefix_dir="$arg"
++ prev=
++ continue
++ ;;
+ release)
+ release="-$arg"
+ prev=
+@@ -958,7 +911,7 @@
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+- case "$arg" in
++ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+@@ -979,17 +932,32 @@
+ prev=
+ continue
+ ;;
++ xcompiler)
++ compiler_flags="$compiler_flags $qarg"
++ prev=
++ compile_command="$compile_command $qarg"
++ finalize_command="$finalize_command $qarg"
++ continue
++ ;;
++ xlinker)
++ linker_flags="$linker_flags $qarg"
++ compiler_flags="$compiler_flags $wl$qarg"
++ prev=
++ compile_command="$compile_command $wl$qarg"
++ finalize_command="$finalize_command $wl$qarg"
++ continue
++ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+- fi
++ fi # test -n $prev
+
+ prevarg="$arg"
+
+- case "$arg" in
++ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+@@ -1026,7 +994,7 @@
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+- $echo "$modename: not more than one -exported-symbols argument allowed"
++ $echo "$modename: more than one -exported-symbols argument is not allowed"
+ exit 1
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+@@ -1037,58 +1005,81 @@
+ continue
+ ;;
+
++ -inst-prefix-dir)
++ prev=inst_prefix
++ continue
++ ;;
++
++ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
++ # so, if we see these flags be careful not to treat them like -L
++ -L[A-Z][A-Z]*:*)
++ case $with_gcc/$host in
++ no/*-*-irix* | no/*-*-nonstopux*)
++ compile_command="$compile_command $arg"
++ finalize_command="$finalize_command $arg"
++ ;;
++ esac
++ continue
++ ;;
++
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+- case "$dir" in
++ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+- $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+- $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+- absdir="$dir"
++ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
++ exit 1
+ fi
+ dir="$absdir"
+ ;;
+ esac
+- case " $deplibs " in
+- *" $arg "*) ;;
+- *) deplibs="$deplibs $arg";;
+- esac
+- case " $lib_search_path " in
+- *" $dir "*) ;;
+- *) lib_search_path="$lib_search_path $dir";;
++ case "$deplibs " in
++ *" -L$dir "*) ;;
++ *)
++ deplibs="$deplibs -L$dir"
++ lib_search_path="$lib_search_path $dir"
++ ;;
+ esac
+- case "$host" in
+- *-*-cygwin* | *-*-mingw* | *-*-os2*)
+- dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
+- case ":$dllsearchpath:" in
+- ::) dllsearchpath="$dllsearchdir";;
+- *":$dllsearchdir:"*) ;;
+- *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
++ case :$dllsearchpath: in
++ *":$dir:"*) ;;
++ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ ;;
+ esac
++ continue
+ ;;
+
+ -l*)
+- if test "$arg" = "-lc"; then
+- case "$host" in
+- *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+- # These systems don't actually have c library (as such)
++ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
++ case $host in
++ *-*-cygwin* | *-*-pw32* | *-*-beos*)
++ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
++ *-*-mingw* | *-*-os2*)
++ # These systems don't actually have a C library (as such)
++ test "X$arg" = "X-lc" && continue
++ ;;
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc due to us having libc/libc_r.
++ test "X$arg" = "X-lc" && continue
++ ;;
+ esac
+- elif test "$arg" = "-lm"; then
+- case "$host" in
+- *-*-cygwin* | *-*-beos*)
+- # These systems don't actually have math library (as such)
++ elif test "X$arg" = "X-lc_r"; then
++ case $host in
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
++ continue
+ ;;
+
+ -module)
+@@ -1096,6 +1087,25 @@
+ continue
+ ;;
+
++ -no-fast-install)
++ fast_install=no
++ continue
++ ;;
++
++ -no-install)
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
++ # The PATH hackery in wrapper scripts is required on Windows
++ # in order for the loader to find any dlls it needs.
++ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
++ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
++ fast_install=no
++ ;;
++ *) no_install=yes ;;
++ esac
++ continue
++ ;;
++
+ -no-undefined)
+ allow_undefined=no
+ continue
+@@ -1121,7 +1131,7 @@
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+- case "$dir" in
++ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+@@ -1136,11 +1146,11 @@
+ ;;
+
+ -static)
+- # If we have no pic_flag, then this is the same as -all-static.
+- if test -z "$pic_flag" && test -n "$link_static_flag"; then
+- compile_command="$compile_command $link_static_flag"
+- finalize_command="$finalize_command $link_static_flag"
+- fi
++ # The effects of -static are defined in a previous loop.
++ # We used to do the same as -all-static on platforms that
++ # didn't have a PIC flag, but the assumption that the effects
++ # would be equivalent was wrong. It would break on at least
++ # Digital Unix and AIX.
+ continue
+ ;;
+
+@@ -1154,28 +1164,71 @@
+ continue
+ ;;
+
++ -Wc,*)
++ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
++ arg=
++ save_ifs="$IFS"; IFS=','
++ for flag in $args; do
++ IFS="$save_ifs"
++ case $flag in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ flag="\"$flag\""
++ ;;
++ esac
++ arg="$arg $wl$flag"
++ compiler_flags="$compiler_flags $flag"
++ done
++ IFS="$save_ifs"
++ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
++ ;;
++
++ -Wl,*)
++ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
++ arg=
++ save_ifs="$IFS"; IFS=','
++ for flag in $args; do
++ IFS="$save_ifs"
++ case $flag in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ flag="\"$flag\""
++ ;;
++ esac
++ arg="$arg $wl$flag"
++ compiler_flags="$compiler_flags $wl$flag"
++ linker_flags="$linker_flags $flag"
++ done
++ IFS="$save_ifs"
++ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
++ ;;
++
++ -Xcompiler)
++ prev=xcompiler
++ continue
++ ;;
++
++ -Xlinker)
++ prev=xlinker
++ continue
++ ;;
++
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+- case "$arg" in
+- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+- *.o | *.obj | *.a | *.lib)
+- # A standard object.
+- objs="$objs $arg"
+- ;;
+-
+- *.lo)
+- # A library object.
++ *.lo | *.$objext)
++ # A library or standard object.
+ if test "$prev" = dlfiles; then
+- dlfiles="$dlfiles $arg"
+- if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
++ # This file was specified with -dlopen.
++ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
++ dlfiles="$dlfiles $arg"
+ prev=
+ continue
+ else
+@@ -1188,357 +1241,917 @@
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
+ prev=
++ else
++ case $arg in
++ *.lo) libobjs="$libobjs $arg" ;;
++ *) objs="$objs $arg" ;;
++ esac
+ fi
+- libobjs="$libobjs $arg"
++ ;;
++
++ *.$libext)
++ # An archive.
++ deplibs="$deplibs $arg"
++ old_deplibs="$old_deplibs $arg"
++ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+- dlname=
+- libdir=
+- library_names=
+- old_library=
+-
+- # Check to see that this really is a libtool archive.
+- if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ if test "$prev" = dlfiles; then
++ # This library was specified with -dlopen.
++ dlfiles="$dlfiles $arg"
++ prev=
++ elif test "$prev" = dlprefiles; then
++ # The library was specified with -dlpreopen.
++ dlprefiles="$dlprefiles $arg"
++ prev=
+ else
+- $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
+- exit 1
++ deplibs="$deplibs $arg"
+ fi
++ continue
++ ;;
+
+- # If the library was installed with an old release of libtool,
+- # it will not redefine variable installed.
+- installed=yes
+-
+- # Read the .la file
+- # If there is no directory component, then add one.
+- case "$arg" in
+- */* | *\\*) . $arg ;;
+- *) . ./$arg ;;
++ # Some other compiler argument.
++ *)
++ # Unknown arguments in both finalize_command and compile_command need
++ # to be aesthetically quoted because they are evaled later.
++ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ arg="\"$arg\""
++ ;;
+ esac
++ ;;
++ esac # arg
+
+- # Get the name of the library we link against.
+- linklib=
+- for l in $old_library $library_names; do
+- linklib="$l"
+- done
+-
+- if test -z "$linklib"; then
+- $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
+- exit 1
+- fi
+-
+- # Find the relevant object directory and library name.
+- name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
+-
+- if test "X$installed" = Xyes; then
+- dir="$libdir"
+- else
+- dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+- if test "X$dir" = "X$arg"; then
+- dir="$objdir"
+- else
+- dir="$dir/$objdir"
+- fi
+- fi
++ # Now actually substitute the argument into the commands.
++ if test -n "$arg"; then
++ compile_command="$compile_command $arg"
++ finalize_command="$finalize_command $arg"
++ fi
++ done # argument parsing loop
+
+- if test -n "$dependency_libs"; then
+- # Extract -R and -L from dependency_libs
+- temp_deplibs=
+- for deplib in $dependency_libs; do
+- case "$deplib" in
+- -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+- case " $rpath $xrpath " in
+- *" $temp_xrpath "*) ;;
+- *) xrpath="$xrpath $temp_xrpath";;
+- esac;;
+- -L*) case "$compile_command $temp_deplibs " in
+- *" $deplib "*) ;;
+- *) temp_deplibs="$temp_deplibs $deplib";;
+- esac
+- temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+- case " $lib_search_path " in
+- *" $temp_dir "*) ;;
+- *) lib_search_path="$lib_search_path $temp_dir";;
+- esac
+- ;;
+- *) temp_deplibs="$temp_deplibs $deplib";;
+- esac
+- done
+- dependency_libs="$temp_deplibs"
+- fi
++ if test -n "$prev"; then
++ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
+
+- if test -z "$libdir"; then
+- # It is a libtool convenience library, so add in its objects.
+- convenience="$convenience $dir/$old_library"
+- old_convenience="$old_convenience $dir/$old_library"
+- deplibs="$deplibs$dependency_libs"
+- compile_command="$compile_command $dir/$old_library$dependency_libs"
+- finalize_command="$finalize_command $dir/$old_library$dependency_libs"
+- continue
+- fi
++ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
++ eval arg=\"$export_dynamic_flag_spec\"
++ compile_command="$compile_command $arg"
++ finalize_command="$finalize_command $arg"
++ fi
+
+- # This library was specified with -dlopen.
+- if test "$prev" = dlfiles; then
+- dlfiles="$dlfiles $arg"
+- if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
+- # If there is no dlname, no dlopen support or we're linking statically,
+- # we need to preload.
+- prev=dlprefiles
+- else
+- # We should not create a dependency on this library, but we
+- # may need any libraries it requires.
+- compile_command="$compile_command$dependency_libs"
+- finalize_command="$finalize_command$dependency_libs"
+- prev=
+- continue
+- fi
+- fi
++ # calculate the name of the file, without its directory
++ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
++ libobjs_save="$libobjs"
+
+- # The library was specified with -dlpreopen.
+- if test "$prev" = dlprefiles; then
+- # Prefer using a static library (so that no silly _DYNAMIC symbols
+- # are required to link).
+- if test -n "$old_library"; then
+- dlprefiles="$dlprefiles $dir/$old_library"
+- else
+- dlprefiles="$dlprefiles $dir/$linklib"
+- fi
+- prev=
+- fi
++ if test -n "$shlibpath_var"; then
++ # get the directories listed in $shlibpath_var
++ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
++ else
++ shlib_search_path=
++ fi
++ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
++ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+- if test -n "$library_names" &&
+- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+- link_against_libtool_libs="$link_against_libtool_libs $arg"
+- if test -n "$shlibpath_var"; then
+- # Make sure the rpath contains only unique directories.
+- case "$temp_rpath " in
+- *" $dir "*) ;;
+- *) temp_rpath="$temp_rpath $dir" ;;
+- esac
+- fi
++ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$output_objdir" = "X$output"; then
++ output_objdir="$objdir"
++ else
++ output_objdir="$output_objdir/$objdir"
++ fi
++ # Create the object directory.
++ if test ! -d $output_objdir; then
++ $show "$mkdir $output_objdir"
++ $run $mkdir $output_objdir
++ status=$?
++ if test $status -ne 0 && test ! -d $output_objdir; then
++ exit $status
++ fi
++ fi
+
+- # We need an absolute path.
+- case "$dir" in
+- [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+- *)
+- absdir=`cd "$dir" && pwd`
+- if test -z "$absdir"; then
+- $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+- $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+- absdir="$dir"
+- fi
+- ;;
+- esac
+-
+- # This is the magic to use -rpath.
+- # Skip directories that are in the system default run-time
+- # search path, unless they have been requested with -R.
+- case " $sys_lib_dlsearch_path " in
+- *" $absdir "*) ;;
+- *)
+- case "$compile_rpath " in
+- *" $absdir "*) ;;
+- *) compile_rpath="$compile_rpath $absdir"
+- esac
+- ;;
+- esac
++ # Determine the type of output
++ case $output in
++ "")
++ $echo "$modename: you must specify an output file" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ ;;
++ *.$libext) linkmode=oldlib ;;
++ *.lo | *.$objext) linkmode=obj ;;
++ *.la) linkmode=lib ;;
++ *) linkmode=prog ;; # Anything else should be a program.
++ esac
+
+- case " $sys_lib_dlsearch_path " in
+- *" $libdir "*) ;;
++ specialdeplibs=
++ libs=
++ # Find all interdependent deplibs by searching for libraries
++ # that are linked more than once (e.g. -la -lb -la)
++ for deplib in $deplibs; do
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ libs="$libs $deplib"
++ done
++ deplibs=
++ newdependency_libs=
++ newlib_search_path=
++ need_relink=no # whether we're linking any uninstalled libtool libraries
++ notinst_deplibs= # not-installed libtool libraries
++ notinst_path= # paths that contain not-installed libtool libraries
++ case $linkmode in
++ lib)
++ passes="conv link"
++ for file in $dlfiles $dlprefiles; do
++ case $file in
++ *.la) ;;
+ *)
+- case "$finalize_rpath " in
+- *" $libdir "*) ;;
+- *) finalize_rpath="$finalize_rpath $libdir"
+- esac
++ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
++ exit 1
+ ;;
+ esac
+-
+- lib_linked=yes
+- case "$hardcode_action" in
+- immediate | unsupported)
+- if test "$hardcode_direct" = no; then
+- compile_command="$compile_command $dir/$linklib"
+- deplibs="$deplibs $dir/$linklib"
+- case "$host" in
+- *-*-cygwin* | *-*-mingw* | *-*-os2*)
+- dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
+- if test -n "$dllsearchpath"; then
+- dllsearchpath="$dllsearchpath:$dllsearchdir"
+- else
+- dllsearchpath="$dllsearchdir"
+- fi
+- ;;
+- esac
+- elif test "$hardcode_minus_L" = no; then
+- case "$host" in
+- *-*-sunos*)
+- compile_shlibpath="$compile_shlibpath$dir:"
+- ;;
+- esac
+- case "$compile_command " in
+- *" -L$dir "*) ;;
+- *) compile_command="$compile_command -L$dir";;
+- esac
+- compile_command="$compile_command -l$name"
+- deplibs="$deplibs -L$dir -l$name"
+- elif test "$hardcode_shlibpath_var" = no; then
+- case ":$compile_shlibpath:" in
+- *":$dir:"*) ;;
+- *) compile_shlibpath="$compile_shlibpath$dir:";;
+- esac
+- compile_command="$compile_command -l$name"
+- deplibs="$deplibs -l$name"
++ done
++ ;;
++ prog)
++ compile_deplibs=
++ finalize_deplibs=
++ alldeplibs=no
++ newdlfiles=
++ newdlprefiles=
++ passes="conv scan dlopen dlpreopen link"
++ ;;
++ *) passes="conv"
++ ;;
++ esac
++ for pass in $passes; do
++ if test $linkmode = prog; then
++ # Determine which files to process
++ case $pass in
++ dlopen)
++ libs="$dlfiles"
++ save_deplibs="$deplibs" # Collect dlpreopened libraries
++ deplibs=
++ ;;
++ dlpreopen) libs="$dlprefiles" ;;
++ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
++ esac
++ fi
++ for deplib in $libs; do
++ lib=
++ found=no
++ case $deplib in
++ -l*)
++ if test $linkmode = oldlib && test $linkmode = obj; then
++ $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
++ continue
++ fi
++ if test $pass = conv; then
++ deplibs="$deplib $deplibs"
++ continue
++ fi
++ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
++ for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
++ # Search the libtool library
++ lib="$searchdir/lib${name}.la"
++ if test -f "$lib"; then
++ found=yes
++ break
++ fi
++ done
++ if test "$found" != yes; then
++ # deplib doesn't seem to be a libtool library
++ if test "$linkmode,$pass" = "prog,link"; then
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+- lib_linked=no
++ deplibs="$deplib $deplibs"
++ test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
++ continue
++ fi
++ ;; # -l
++ -L*)
++ case $linkmode in
++ lib)
++ deplibs="$deplib $deplibs"
++ test $pass = conv && continue
++ newdependency_libs="$deplib $newdependency_libs"
++ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+-
+- relink)
+- if test "$hardcode_direct" = yes; then
+- compile_command="$compile_command $absdir/$linklib"
+- deplibs="$deplibs $absdir/$linklib"
+- elif test "$hardcode_minus_L" = yes; then
+- case "$compile_command " in
+- *" -L$absdir "*) ;;
+- *) compile_command="$compile_command -L$absdir";;
+- esac
+- compile_command="$compile_command -l$name"
+- deplibs="$deplibs -L$absdir -l$name"
+- elif test "$hardcode_shlibpath_var" = yes; then
+- case ":$compile_shlibpath:" in
+- *":$absdir:"*) ;;
+- *) compile_shlibpath="$compile_shlibpath$absdir:";;
+- esac
+- compile_command="$compile_command -l$name"
+- deplibs="$deplibs -l$name"
++ prog)
++ if test $pass = conv; then
++ deplibs="$deplib $deplibs"
++ continue
++ fi
++ if test $pass = scan; then
++ deplibs="$deplib $deplibs"
++ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ else
+- lib_linked=no
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ ;;
+-
+ *)
+- lib_linked=no
++ $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
+ ;;
+- esac
++ esac # linkmode
++ continue
++ ;; # -L
++ -R*)
++ if test $pass = link; then
++ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
++ # Make sure the xrpath contains only unique directories.
++ case "$xrpath " in
++ *" $dir "*) ;;
++ *) xrpath="$xrpath $dir" ;;
++ esac
++ fi
++ deplibs="$deplib $deplibs"
++ continue
++ ;;
++ *.la) lib="$deplib" ;;
++ *.$libext)
++ if test $pass = conv; then
++ deplibs="$deplib $deplibs"
++ continue
++ fi
++ case $linkmode in
++ lib)
++ if test "$deplibs_check_method" != pass_all; then
++ echo
++ echo "*** Warning: Trying to link with static lib archive $deplib."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because the file extensions .$libext of this argument makes me believe"
++ echo "*** that it is just a static archive that I should not used here."
++ else
++ echo
++ echo "*** Warning: Linking the shared library $output against the"
++ echo "*** static library $deplib is not portable!"
++ deplibs="$deplib $deplibs"
++ fi
++ continue
++ ;;
++ prog)
++ if test $pass != link; then
++ deplibs="$deplib $deplibs"
++ else
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ fi
++ continue
++ ;;
++ esac # linkmode
++ ;; # *.$libext
++ *.lo | *.$objext)
++ if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
++ # If there is no dlopen support or we're linking statically,
++ # we need to preload.
++ newdlprefiles="$newdlprefiles $deplib"
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ else
++ newdlfiles="$newdlfiles $deplib"
++ fi
++ continue
++ ;;
++ %DEPLIBS%)
++ alldeplibs=yes
++ continue
++ ;;
++ esac # case $deplib
++ if test $found = yes || test -f "$lib"; then :
++ else
++ $echo "$modename: cannot find the library \`$lib'" 1>&2
++ exit 1
++ fi
++
++ # Check to see that this really is a libtool archive.
++ if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ else
++ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++
++ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
++ test "X$ladir" = "X$lib" && ladir="."
++
++ dlname=
++ dlopen=
++ dlpreopen=
++ libdir=
++ library_names=
++ old_library=
++ # If the library was installed with an old release of libtool,
++ # it will not redefine variable installed.
++ installed=yes
++
++ # Read the .la file
++ case $lib in
++ */* | *\\*) . $lib ;;
++ *) . ./$lib ;;
++ esac
++
++ if test "$linkmode,$pass" = "lib,link" ||
++ test "$linkmode,$pass" = "prog,scan" ||
++ { test $linkmode = oldlib && test $linkmode = obj; }; then
++ # Add dl[pre]opened files of deplib
++ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
++ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
++ fi
+
+- if test "$lib_linked" != yes; then
+- $echo "$modename: configuration error: unsupported hardcode properties"
++ if test $pass = conv; then
++ # Only check for convenience libraries
++ deplibs="$lib $deplibs"
++ if test -z "$libdir"; then
++ if test -z "$old_library"; then
++ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
++ exit 1
++ fi
++ # It is a libtool convenience library, so add in its objects.
++ convenience="$convenience $ladir/$objdir/$old_library"
++ old_convenience="$old_convenience $ladir/$objdir/$old_library"
++ tmp_libs=
++ for deplib in $dependency_libs; do
++ deplibs="$deplib $deplibs"
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ tmp_libs="$tmp_libs $deplib"
++ done
++ elif test $linkmode != prog && test $linkmode != lib; then
++ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit 1
+ fi
++ continue
++ fi # $pass = conv
+
+- # Finalize command for both is simple: just hardcode it.
+- if test "$hardcode_direct" = yes; then
+- finalize_command="$finalize_command $libdir/$linklib"
+- elif test "$hardcode_minus_L" = yes; then
+- case "$finalize_command " in
+- *" -L$libdir "*) ;;
+- *) finalize_command="$finalize_command -L$libdir";;
+- esac
+- finalize_command="$finalize_command -l$name"
+- elif test "$hardcode_shlibpath_var" = yes; then
+- case ":$finalize_shlibpath:" in
+- *":$libdir:"*) ;;
+- *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
+- esac
+- finalize_command="$finalize_command -l$name"
++ # Get the name of the library we link against.
++ linklib=
++ for l in $old_library $library_names; do
++ linklib="$l"
++ done
++ if test -z "$linklib"; then
++ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
++ exit 1
++ fi
++
++ # This library was specified with -dlopen.
++ if test $pass = dlopen; then
++ if test -z "$libdir"; then
++ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
++ exit 1
++ fi
++ if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
++ # If there is no dlname, no dlopen support or we're linking
++ # statically, we need to preload.
++ dlprefiles="$dlprefiles $lib"
+ else
+- # We cannot seem to hardcode it, guess we'll fake it.
+- case "$finalize_command " in
+- *" -L$dir "*) ;;
+- *) finalize_command="$finalize_command -L$libdir";;
+- esac
+- finalize_command="$finalize_command -l$name"
++ newdlfiles="$newdlfiles $lib"
++ fi
++ continue
++ fi # $pass = dlopen
++
++ # We need an absolute path.
++ case $ladir in
++ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
++ *)
++ abs_ladir=`cd "$ladir" && pwd`
++ if test -z "$abs_ladir"; then
++ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
++ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
++ abs_ladir="$ladir"
++ fi
++ ;;
++ esac
++ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
++
++ # Find the relevant object directory and library name.
++ if test "X$installed" = Xyes; then
++ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
++ $echo "$modename: warning: library \`$lib' was moved." 1>&2
++ dir="$ladir"
++ absdir="$abs_ladir"
++ libdir="$abs_ladir"
++ else
++ dir="$libdir"
++ absdir="$libdir"
+ fi
+ else
+- # Transform directly to old archives if we don't build new libraries.
+- if test -n "$pic_flag" && test -z "$old_library"; then
+- $echo "$modename: cannot find static library for \`$arg'" 1>&2
++ dir="$ladir/$objdir"
++ absdir="$abs_ladir/$objdir"
++ # Remove this search path later
++ notinst_path="$notinst_path $abs_ladir"
++ fi # $installed = yes
++ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
++
++ # This library was specified with -dlpreopen.
++ if test $pass = dlpreopen; then
++ if test -z "$libdir"; then
++ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
++ # Prefer using a static library (so that no silly _DYNAMIC symbols
++ # are required to link).
++ if test -n "$old_library"; then
++ newdlprefiles="$newdlprefiles $dir/$old_library"
++ # Otherwise, use the dlname, so that lt_dlopen finds it.
++ elif test -n "$dlname"; then
++ newdlprefiles="$newdlprefiles $dir/$dlname"
++ else
++ newdlprefiles="$newdlprefiles $dir/$linklib"
++ fi
++ fi # $pass = dlpreopen
+
+- # Here we assume that one of hardcode_direct or hardcode_minus_L
+- # is not unsupported. This is valid on all known static and
+- # shared platforms.
+- if test "$hardcode_direct" != unsupported; then
+- test -n "$old_library" && linklib="$old_library"
+- compile_command="$compile_command $dir/$linklib"
+- finalize_command="$finalize_command $dir/$linklib"
++ if test -z "$libdir"; then
++ # Link the convenience library
++ if test $linkmode = lib; then
++ deplibs="$dir/$old_library $deplibs"
++ elif test "$linkmode,$pass" = "prog,link"; then
++ compile_deplibs="$dir/$old_library $compile_deplibs"
++ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+- case "$compile_command " in
+- *" -L$dir "*) ;;
+- *) compile_command="$compile_command -L$dir";;
++ deplibs="$lib $deplibs"
++ fi
++ continue
++ fi
++
++ if test $linkmode = prog && test $pass != link; then
++ newlib_search_path="$newlib_search_path $ladir"
++ deplibs="$lib $deplibs"
++
++ linkalldeplibs=no
++ if test "$link_all_deplibs" != no || test -z "$library_names" ||
++ test "$build_libtool_libs" = no; then
++ linkalldeplibs=yes
++ fi
++
++ tmp_libs=
++ for deplib in $dependency_libs; do
++ case $deplib in
++ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+- compile_command="$compile_command -l$name"
+- case "$finalize_command " in
+- *" -L$dir "*) ;;
+- *) finalize_command="$finalize_command -L$dir";;
++ # Need to link against all dependency_libs?
++ if test $linkalldeplibs = yes; then
++ deplibs="$deplib $deplibs"
++ else
++ # Need to hardcode shared library paths
++ # or/and link against static libraries
++ newdependency_libs="$deplib $newdependency_libs"
++ fi
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ tmp_libs="$tmp_libs $deplib"
++ done # for deplib
++ continue
++ fi # $linkmode = prog...
++
++ link_static=no # Whether the deplib will be linked statically
++ if test -n "$library_names" &&
++ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
++ # Link against this shared library
++
++ if test "$linkmode,$pass" = "prog,link" ||
++ { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
++ # Hardcode the library path.
++ # Skip directories that are in the system default run-time
++ # search path.
++ case " $sys_lib_dlsearch_path " in
++ *" $absdir "*) ;;
++ *)
++ case "$compile_rpath " in
++ *" $absdir "*) ;;
++ *) compile_rpath="$compile_rpath $absdir"
++ esac
++ ;;
+ esac
+- finalize_command="$finalize_command -l$name"
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir "*) ;;
++ *)
++ case "$finalize_rpath " in
++ *" $libdir "*) ;;
++ *) finalize_rpath="$finalize_rpath $libdir"
++ esac
++ ;;
++ esac
++ if test $linkmode = prog; then
++ # We need to hardcode the library path
++ if test -n "$shlibpath_var"; then
++ # Make sure the rpath contains only unique directories.
++ case "$temp_rpath " in
++ *" $dir "*) ;;
++ *" $absdir "*) ;;
++ *) temp_rpath="$temp_rpath $dir" ;;
++ esac
++ fi
++ fi
++ fi # $linkmode,$pass = prog,link...
++
++ if test "$alldeplibs" = yes &&
++ { test "$deplibs_check_method" = pass_all ||
++ { test "$build_libtool_libs" = yes &&
++ test -n "$library_names"; }; }; then
++ # We only need to search for static libraries
++ continue
+ fi
+- fi
+
+- # Add in any libraries that this one depends upon.
+- compile_command="$compile_command$dependency_libs"
+- finalize_command="$finalize_command$dependency_libs"
+- continue
+- ;;
++ if test "$installed" = no; then
++ notinst_deplibs="$notinst_deplibs $lib"
++ need_relink=yes
++ fi
++
++ if test -n "$old_archive_from_expsyms_cmds"; then
++ # figure out the soname
++ set dummy $library_names
++ realname="$2"
++ shift; shift
++ libname=`eval \\$echo \"$libname_spec\"`
++ # use dlname if we got it. it's perfectly good, no?
++ if test -n "$dlname"; then
++ soname="$dlname"
++ elif test -n "$soname_spec"; then
++ # bleh windows
++ case $host in
++ *cygwin*)
++ major=`expr $current - $age`
++ versuffix="-$major"
++ ;;
++ esac
++ eval soname=\"$soname_spec\"
++ else
++ soname="$realname"
++ fi
+
+- # Some other compiler argument.
+- *)
+- # Unknown arguments in both finalize_command and compile_command need
+- # to be aesthetically quoted because they are evaled later.
+- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+- case "$arg" in
+- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+- arg="\"$arg\""
+- ;;
+- esac
+- ;;
+- esac
++ # Make a new name for the extract_expsyms_cmds to use
++ soroot="$soname"
++ soname=`echo $soroot | ${SED} -e 's/^.*\///'`
++ newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+- # Now actually substitute the argument into the commands.
+- if test -n "$arg"; then
+- compile_command="$compile_command $arg"
+- finalize_command="$finalize_command $arg"
+- fi
+- done
++ # If the library has no export list, then create one now
++ if test -f "$output_objdir/$soname-def"; then :
++ else
++ $show "extracting exported symbol list from \`$soname'"
++ save_ifs="$IFS"; IFS='~'
++ eval cmds=\"$extract_expsyms_cmds\"
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ fi
+
+- if test -n "$prev"; then
+- $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+- $echo "$help" 1>&2
+- exit 1
+- fi
++ # Create $newlib
++ if test -f "$output_objdir/$newlib"; then :; else
++ $show "generating import library for \`$soname'"
++ save_ifs="$IFS"; IFS='~'
++ eval cmds=\"$old_archive_from_expsyms_cmds\"
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ fi
++ # make sure the library variables are pointing to the new library
++ dir=$output_objdir
++ linklib=$newlib
++ fi # test -n $old_archive_from_expsyms_cmds
++
++ if test $linkmode = prog || test "$mode" != relink; then
++ add_shlibpath=
++ add_dir=
++ add=
++ lib_linked=yes
++ case $hardcode_action in
++ immediate | unsupported)
++ if test "$hardcode_direct" = no; then
++ add="$dir/$linklib"
++ elif test "$hardcode_minus_L" = no; then
++ case $host in
++ *-*-sunos*) add_shlibpath="$dir" ;;
++ esac
++ add_dir="-L$dir"
++ add="-l$name"
++ elif test "$hardcode_shlibpath_var" = no; then
++ add_shlibpath="$dir"
++ add="-l$name"
++ else
++ lib_linked=no
++ fi
++ ;;
++ relink)
++ if test "$hardcode_direct" = yes; then
++ add="$dir/$linklib"
++ elif test "$hardcode_minus_L" = yes; then
++ add_dir="-L$dir"
++ # Try looking first in the location we're being installed to.
++ if test -n "$inst_prefix_dir"; then
++ case "$libdir" in
++ [\/]*)
++ add_dir="-L$inst_prefix_dir$libdir $add_dir"
++ ;;
++ esac
++ fi
++ add="-l$name"
++ elif test "$hardcode_shlibpath_var" = yes; then
++ add_shlibpath="$dir"
++ add="-l$name"
++ else
++ lib_linked=no
++ fi
++ ;;
++ *) lib_linked=no ;;
++ esac
+
+- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+- eval arg=\"$export_dynamic_flag_spec\"
+- compile_command="$compile_command $arg"
+- finalize_command="$finalize_command $arg"
+- fi
++ if test "$lib_linked" != yes; then
++ $echo "$modename: configuration error: unsupported hardcode properties"
++ exit 1
++ fi
+
+- oldlibs=
+- # calculate the name of the file, without its directory
+- outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+- libobjs_save="$libobjs"
++ if test -n "$add_shlibpath"; then
++ case :$compile_shlibpath: in
++ *":$add_shlibpath:"*) ;;
++ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
++ esac
++ fi
++ if test $linkmode = prog; then
++ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
++ test -n "$add" && compile_deplibs="$add $compile_deplibs"
++ else
++ test -n "$add_dir" && deplibs="$add_dir $deplibs"
++ test -n "$add" && deplibs="$add $deplibs"
++ if test "$hardcode_direct" != yes && \
++ test "$hardcode_minus_L" != yes && \
++ test "$hardcode_shlibpath_var" = yes; then
++ case :$finalize_shlibpath: in
++ *":$libdir:"*) ;;
++ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++ esac
++ fi
++ fi
++ fi
+
+- case "$output" in
+- "")
+- $echo "$modename: you must specify an output file" 1>&2
+- $echo "$help" 1>&2
+- exit 1
+- ;;
++ if test $linkmode = prog || test "$mode" = relink; then
++ add_shlibpath=
++ add_dir=
++ add=
++ # Finalize command for both is simple: just hardcode it.
++ if test "$hardcode_direct" = yes; then
++ add="$libdir/$linklib"
++ elif test "$hardcode_minus_L" = yes; then
++ add_dir="-L$libdir"
++ add="-l$name"
++ elif test "$hardcode_shlibpath_var" = yes; then
++ case :$finalize_shlibpath: in
++ *":$libdir:"*) ;;
++ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++ esac
++ add="-l$name"
++ else
++ # We cannot seem to hardcode it, guess we'll fake it.
++ add_dir="-L$libdir"
++ # Try looking first in the location we're being installed to.
++ if test -n "$inst_prefix_dir"; then
++ case "$libdir" in
++ [\/]*)
++ add_dir="-L$inst_prefix_dir$libdir $add_dir"
++ ;;
++ esac
++ fi
++ add="-l$name"
++ fi
+
+- *.a | *.lib)
+- if test -n "$link_against_libtool_libs"; then
+- $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
+- exit 1
++ if test $linkmode = prog; then
++ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
++ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
++ else
++ test -n "$add_dir" && deplibs="$add_dir $deplibs"
++ test -n "$add" && deplibs="$add $deplibs"
++ fi
++ fi
++ elif test $linkmode = prog; then
++ if test "$alldeplibs" = yes &&
++ { test "$deplibs_check_method" = pass_all ||
++ { test "$build_libtool_libs" = yes &&
++ test -n "$library_names"; }; }; then
++ # We only need to search for static libraries
++ continue
++ fi
++
++ # Try to link the static library
++ # Here we assume that one of hardcode_direct or hardcode_minus_L
++ # is not unsupported. This is valid on all known static and
++ # shared platforms.
++ if test "$hardcode_direct" != unsupported; then
++ test -n "$old_library" && linklib="$old_library"
++ compile_deplibs="$dir/$linklib $compile_deplibs"
++ finalize_deplibs="$dir/$linklib $finalize_deplibs"
++ else
++ compile_deplibs="-l$name -L$dir $compile_deplibs"
++ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
++ fi
++ elif test "$build_libtool_libs" = yes; then
++ # Not a shared library
++ if test "$deplibs_check_method" != pass_all; then
++ # We're trying link a shared library against a static one
++ # but the system doesn't support it.
++
++ # Just print a warning and add the library to dependency_libs so
++ # that the program can be linked against the static library.
++ echo
++ echo "*** Warning: This system can not link to static lib archive $lib."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have."
++ if test "$module" = yes; then
++ echo "*** But as you try to build a module library, libtool will still create "
++ echo "*** a static module, that should work as long as the dlopening application"
++ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
++ if test -z "$global_symbol_pipe"; then
++ echo
++ echo "*** However, this would only work if libtool was able to extract symbol"
++ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
++ echo "*** not find such a program. So, this module is probably useless."
++ echo "*** \`nm' from GNU binutils and a full rebuild may help."
++ fi
++ if test "$build_old_libs" = no; then
++ build_libtool_libs=module
++ build_old_libs=yes
++ else
++ build_libtool_libs=no
++ fi
++ fi
++ else
++ convenience="$convenience $dir/$old_library"
++ old_convenience="$old_convenience $dir/$old_library"
++ deplibs="$dir/$old_library $deplibs"
++ link_static=yes
++ fi
++ fi # link shared/static library?
++
++ if test $linkmode = lib; then
++ if test -n "$dependency_libs" &&
++ { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
++ test $link_static = yes; }; then
++ # Extract -R from dependency_libs
++ temp_deplibs=
++ for libdir in $dependency_libs; do
++ case $libdir in
++ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
++ case " $xrpath " in
++ *" $temp_xrpath "*) ;;
++ *) xrpath="$xrpath $temp_xrpath";;
++ esac;;
++ *) temp_deplibs="$temp_deplibs $libdir";;
++ esac
++ done
++ dependency_libs="$temp_deplibs"
++ fi
++
++ newlib_search_path="$newlib_search_path $absdir"
++ # Link against this library
++ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
++ # ... and its dependency_libs
++ tmp_libs=
++ for deplib in $dependency_libs; do
++ newdependency_libs="$deplib $newdependency_libs"
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ tmp_libs="$tmp_libs $deplib"
++ done
++
++ if test $link_all_deplibs != no; then
++ # Add the search paths of all dependency libraries
++ for deplib in $dependency_libs; do
++ case $deplib in
++ -L*) path="$deplib" ;;
++ *.la)
++ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
++ test "X$dir" = "X$deplib" && dir="."
++ # We need an absolute path.
++ case $dir in
++ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
++ *)
++ absdir=`cd "$dir" && pwd`
++ if test -z "$absdir"; then
++ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
++ absdir="$dir"
++ fi
++ ;;
++ esac
++ if grep "^installed=no" $deplib > /dev/null; then
++ path="-L$absdir/$objdir"
++ else
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ if test "$absdir" != "$libdir"; then
++ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
++ fi
++ path="-L$absdir"
++ fi
++ ;;
++ *) continue ;;
++ esac
++ case " $deplibs " in
++ *" $path "*) ;;
++ *) deplibs="$deplibs $path" ;;
++ esac
++ done
++ fi # link_all_deplibs != no
++ fi # linkmode = lib
++ done # for deplib in $libs
++ if test $pass = dlpreopen; then
++ # Link the dlpreopened libraries before other libraries
++ for deplib in $save_deplibs; do
++ deplibs="$deplib $deplibs"
++ done
+ fi
++ if test $pass != dlopen; then
++ test $pass != scan && dependency_libs="$newdependency_libs"
++ if test $pass != conv; then
++ # Make sure lib_search_path contains only unique directories.
++ lib_search_path=
++ for dir in $newlib_search_path; do
++ case "$lib_search_path " in
++ *" $dir "*) ;;
++ *) lib_search_path="$lib_search_path $dir" ;;
++ esac
++ done
++ newlib_search_path=
++ fi
+
+- if test -n "$deplibs"; then
+- $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
++ if test "$linkmode,$pass" != "prog,link"; then
++ vars="deplibs"
++ else
++ vars="compile_deplibs finalize_deplibs"
++ fi
++ for var in $vars dependency_libs; do
++ # Add libraries to $var in reverse order
++ eval tmp_libs=\"\$$var\"
++ new_libs=
++ for deplib in $tmp_libs; do
++ case $deplib in
++ -L*) new_libs="$deplib $new_libs" ;;
++ *)
++ case " $specialdeplibs " in
++ *" $deplib "*) new_libs="$deplib $new_libs" ;;
++ *)
++ case " $new_libs " in
++ *" $deplib "*) ;;
++ *) new_libs="$deplib $new_libs" ;;
++ esac
++ ;;
++ esac
++ ;;
++ esac
++ done
++ tmp_libs=
++ for deplib in $new_libs; do
++ case $deplib in
++ -L*)
++ case " $tmp_libs " in
++ *" $deplib "*) ;;
++ *) tmp_libs="$tmp_libs $deplib" ;;
++ esac
++ ;;
++ *) tmp_libs="$tmp_libs $deplib" ;;
++ esac
++ done
++ eval $var=\"$tmp_libs\"
++ done # for var
+ fi
++ if test "$pass" = "conv" &&
++ { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
++ libs="$deplibs" # reset libs
++ deplibs=
++ fi
++ done # for pass
++ if test $linkmode = prog; then
++ dlfiles="$newdlfiles"
++ dlprefiles="$newdlprefiles"
++ fi
+
++ case $linkmode in
++ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+@@ -1566,11 +2179,12 @@
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
++ objs="$objs$old_deplibs"
+ ;;
+
+- *.la)
++ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+- case "$outputname" in
++ case $outputname in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval libname=\"$libname_spec\"
+@@ -1591,26 +2205,20 @@
+ ;;
+ esac
+
+- output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+- if test "X$output_objdir" = "X$output"; then
+- output_objdir="$objdir"
+- else
+- output_objdir="$output_objdir/$objdir"
+- fi
+-
+ if test -n "$objs"; then
+- $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
+- exit 1
+- fi
+-
+- # How the heck are we supposed to write a wrapper for a shared library?
+- if test -n "$link_against_libtool_libs"; then
+- $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
+- exit 1
++ if test "$deplibs_check_method" != pass_all; then
++ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
++ exit 1
++ else
++ echo
++ echo "*** Warning: Linking the shared library $output against the non-libtool"
++ echo "*** objects $objs is not portable!"
++ libobjs="$libobjs $objs"
++ fi
+ fi
+
+- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+- $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
++ if test "$dlself" != no; then
++ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+@@ -1628,7 +2236,6 @@
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+- dependency_libs="$deplibs"
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
+@@ -1640,7 +2247,7 @@
+ else
+
+ # Parse the version information argument.
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
++ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+@@ -1655,8 +2262,8 @@
+ age="$4"
+
+ # Check that each of the things are valid numbers.
+- case "$current" in
+- 0 | [1-9] | [1-9][0-9]*) ;;
++ case $current in
++ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+@@ -1664,8 +2271,8 @@
+ ;;
+ esac
+
+- case "$revision" in
+- 0 | [1-9] | [1-9][0-9]*) ;;
++ case $revision in
++ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+@@ -1673,8 +2280,8 @@
+ ;;
+ esac
+
+- case "$age" in
+- 0 | [1-9] | [1-9][0-9]*) ;;
++ case $age in
++ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+@@ -1692,21 +2299,49 @@
+ major=
+ versuffix=
+ verstring=
+- case "$version_type" in
++ case $version_type in
+ none) ;;
+
+- irix)
++ darwin)
++ # Like Linux, but with the current version available in
++ # verstring for coding it into the library header
++ major=.`expr $current - $age`
++ versuffix="$major.$age.$revision"
++ # Darwin ld doesn't like 0 for these options...
++ minor_current=`expr $current + 1`
++ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
++ ;;
++
++ freebsd-aout)
++ major=".$current"
++ versuffix=".$current.$revision";
++ ;;
++
++ freebsd-elf)
++ major=".$current"
++ versuffix=".$current";
++ ;;
++
++ irix | nonstopux)
+ major=`expr $current - $age + 1`
+- versuffix="$major.$revision"
+- verstring="sgi$major.$revision"
++
++ case $version_type in
++ nonstopux) verstring_prefix=nonstopux ;;
++ *) verstring_prefix=sgi ;;
++ esac
++ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test $loop != 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+- verstring="sgi$major.$iface:$verstring"
++ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
++
++ # Before this point, $major must not contain `.'.
++ major=.$major
++ versuffix="$major.$revision"
+ ;;
+
+ linux)
+@@ -1715,7 +2350,7 @@
+ ;;
+
+ osf)
+- major=`expr $current - $age`
++ major=.`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+@@ -1736,21 +2371,11 @@
+ versuffix=".$current.$revision"
+ ;;
+
+- freebsd-aout)
+- major=".$current"
+- versuffix=".$current.$revision";
+- ;;
+-
+- freebsd-elf)
+- major=".$current"
+- versuffix=".$current";
+- ;;
+-
+ windows)
+- # Like Linux, but with '-' rather than '.', since we only
+- # want one extension on Windows 95.
++ # Use '-' rather than '.', since we only want one
++ # extension on DOS 8.3 filesystems.
+ major=`expr $current - $age`
+- versuffix="-$major-$age-$revision"
++ versuffix="-$major"
+ ;;
+
+ *)
+@@ -1764,6 +2389,16 @@
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ verstring="0.0"
++ case $version_type in
++ darwin)
++ # we can't check for "0.0" in archive_cmds due to quoting
++ # problems, so we reset it completely
++ verstring=""
++ ;;
++ *)
++ verstring="0.0"
++ ;;
++ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+@@ -1777,7 +2412,7 @@
+ versuffix=
+ verstring=""
+ fi
+-
++
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+@@ -1785,34 +2420,16 @@
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+- else
+- # Don't allow undefined symbols.
+- allow_undefined_flag="$no_undefined_flag"
+- fi
+-
+- dependency_libs="$deplibs"
+- case "$host" in
+- *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+- # these systems don't actually have a c library (as such)!
+- ;;
+- *)
+- # Add libc to deplibs on all other systems.
+- deplibs="$deplibs -lc"
+- ;;
+- esac
++ else
++ # Don't allow undefined symbols.
++ allow_undefined_flag="$no_undefined_flag"
++ fi
+ fi
+
+- # Create the output directory, or remove our outputs if we need to.
+- if test -d $output_objdir; then
++ if test "$mode" != relink; then
++ # Remove our outputs.
+ $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
+ $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
+- else
+- $show "$mkdir $output_objdir"
+- $run $mkdir $output_objdir
+- status=$?
+- if test $status -ne 0 && test ! -d $output_objdir; then
+- exit $status
+- fi
+ fi
+
+ # Now set the variables for building old libraries.
+@@ -1823,7 +2440,73 @@
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
++ # Eliminate all temporary directories.
++ for path in $notinst_path; do
++ lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
++ deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
++ dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
++ done
++
++ if test -n "$xrpath"; then
++ # If the user specified any rpath flags, then add them.
++ temp_xrpath=
++ for libdir in $xrpath; do
++ temp_xrpath="$temp_xrpath -R$libdir"
++ case "$finalize_rpath " in
++ *" $libdir "*) ;;
++ *) finalize_rpath="$finalize_rpath $libdir" ;;
++ esac
++ done
++ if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
++ dependency_libs="$temp_xrpath $dependency_libs"
++ fi
++ fi
++
++ # Make sure dlfiles contains only unique files that won't be dlpreopened
++ old_dlfiles="$dlfiles"
++ dlfiles=
++ for lib in $old_dlfiles; do
++ case " $dlprefiles $dlfiles " in
++ *" $lib "*) ;;
++ *) dlfiles="$dlfiles $lib" ;;
++ esac
++ done
++
++ # Make sure dlprefiles contains only unique files
++ old_dlprefiles="$dlprefiles"
++ dlprefiles=
++ for lib in $old_dlprefiles; do
++ case "$dlprefiles " in
++ *" $lib "*) ;;
++ *) dlprefiles="$dlprefiles $lib" ;;
++ esac
++ done
++
+ if test "$build_libtool_libs" = yes; then
++ if test -n "$rpath"; then
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
++ # these systems don't actually have a c library (as such)!
++ ;;
++ *-*-rhapsody* | *-*-darwin1.[012])
++ # Rhapsody C library is in the System framework
++ deplibs="$deplibs -framework System"
++ ;;
++ *-*-netbsd*)
++ # Don't link with libc until the a.out ld.so is fixed.
++ ;;
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc due to us having libc/libc_r.
++ ;;
++ *)
++ # Add libc to deplibs on all other systems if necessary.
++ if test $build_libtool_need_lc = "yes"; then
++ deplibs="$deplibs -lc"
++ fi
++ ;;
++ esac
++ fi
++
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+@@ -1838,7 +2521,7 @@
+ major=""
+ newdeplibs=
+ droppeddeps=no
+- case "$deplibs_check_method" in
++ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+@@ -1863,7 +2546,7 @@
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+- if test "$name" != "" ; then
++ if test -n "$name" && test "$name" != "0"; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+@@ -1873,22 +2556,24 @@
+ else
+ droppeddeps=yes
+ echo
+- echo "*** Warning: This library needs some functionality provided by $i."
++ echo "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which I believe you do not have"
++ echo "*** because a test_compile did reveal that the linker did not use it for"
++ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+- # Error occured in the first compile. Let's try to salvage the situation:
+- # Compile a seperate program for each library.
++ # Error occured in the first compile. Let's try to salvage
++ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+- if test "$name" != "" ; then
++ if test -n "$name" && test "$name" != "0"; then
+ $rm conftest
+ $CC -o conftest conftest.c $i
+ # Did it work?
+@@ -1903,10 +2588,12 @@
+ else
+ droppeddeps=yes
+ echo
+- echo "*** Warning: This library needs some functionality provided by $i."
++ echo "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because a test_compile did reveal that the linker did not use this one"
++ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ else
+ droppeddeps=yes
+@@ -1924,19 +2611,19 @@
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+- file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
++ file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+- if test "$name" != "" ; then
++ if test -n "$name" && test "$name" != "0"; then
+ libname=`eval \\$echo \"$libname_spec\"`
+- for i in $lib_search_path; do
++ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+- continue
++ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+@@ -1945,14 +2632,14 @@
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+- potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+- case "$potliblink" in
++ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
++ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+- | sed 10q \
++ | ${SED} 10q \
+ | egrep "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+@@ -1963,10 +2650,59 @@
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+- echo "*** Warning: This library needs some functionality provided by $a_deplib."
++ echo "*** Warning: linker path does not have real file for library $a_deplib."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because I did check the linker path looking for a file starting"
++ if test -z "$potlib" ; then
++ echo "*** with $libname but no candidates were found. (...for file magic test)"
++ else
++ echo "*** with $libname and none of the candidates passed a file format test"
++ echo "*** using a file magic. Last file checked: $potlib"
++ fi
++ fi
++ else
++ # Add a -L argument.
++ newdeplibs="$newdeplibs $a_deplib"
++ fi
++ done # Gone through all deplibs.
++ ;;
++ match_pattern*)
++ set dummy $deplibs_check_method
++ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
++ for a_deplib in $deplibs; do
++ name="`expr $a_deplib : '-l\(.*\)'`"
++ # If $name is empty we are operating on a -L argument.
++ if test -n "$name" && test "$name" != "0"; then
++ libname=`eval \\$echo \"$libname_spec\"`
++ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
++ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
++ for potent_lib in $potential_libs; do
++ potlib="$potent_lib" # see symlink-check below in file_magic test
++ if eval echo \"$potent_lib\" 2>/dev/null \
++ | ${SED} 10q \
++ | egrep "$match_pattern_regex" > /dev/null; then
++ newdeplibs="$newdeplibs $a_deplib"
++ a_deplib=""
++ break 2
++ fi
++ done
++ done
++ if test -n "$a_deplib" ; then
++ droppeddeps=yes
++ echo
++ echo "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because I did check the linker path looking for a file starting"
++ if test -z "$potlib" ; then
++ echo "*** with $libname but no candidates were found. (...for regex pattern test)"
++ else
++ echo "*** with $libname and none of the candidates passed a file format test"
++ echo "*** using a regex pattern. Last file checked: $potlib"
++ fi
+ fi
+ else
+ # Add a -L argument.
+@@ -1996,6 +2732,13 @@
+ libname=$libname_save
+ name=$name_save
+
++ case $host in
++ *-*-rhapsody* | *-*-darwin1.[012])
++ # On Rhapsody replace the C library is the System framework
++ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
++ ;;
++ esac
++
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+@@ -2021,6 +2764,21 @@
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
++
++ if test $allow_undefined = no; then
++ echo
++ echo "*** Since this library must not contain undefined symbols,"
++ echo "*** because either the platform does not support them or"
++ echo "*** it was explicitly requested with -no-undefined,"
++ echo "*** libtool will only create a static version of it."
++ if test "$build_old_libs" = no; then
++ oldlibs="$output_objdir/$libname.$libext"
++ build_libtool_libs=module
++ build_old_libs=yes
++ else
++ build_libtool_libs=no
++ fi
++ fi
+ fi
+ fi
+ # Done checking deplibs!
+@@ -2031,9 +2789,64 @@
+ library_names=
+ old_library=
+ dlname=
+-
++
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
++ if test $hardcode_into_libs = yes; then
++ # Hardcode the library paths
++ hardcode_libdirs=
++ dep_rpath=
++ rpath="$finalize_rpath"
++ test "$mode" != relink && rpath="$compile_rpath$rpath"
++ for libdir in $rpath; do
++ if test -n "$hardcode_libdir_flag_spec"; then
++ if test -n "$hardcode_libdir_separator"; then
++ if test -z "$hardcode_libdirs"; then
++ hardcode_libdirs="$libdir"
++ else
++ # Just accumulate the unique libdirs.
++ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
++ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
++ ;;
++ *)
++ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++ ;;
++ esac
++ fi
++ else
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ dep_rpath="$dep_rpath $flag"
++ fi
++ elif test -n "$runpath_var"; then
++ case "$perm_rpath " in
++ *" $libdir "*) ;;
++ *) perm_rpath="$perm_rpath $libdir" ;;
++ esac
++ fi
++ done
++ # Substitute the hardcoded libdirs into the rpath.
++ if test -n "$hardcode_libdir_separator" &&
++ test -n "$hardcode_libdirs"; then
++ libdir="$hardcode_libdirs"
++ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
++ fi
++ if test -n "$runpath_var" && test -n "$perm_rpath"; then
++ # We should set the runpath_var.
++ rpath=
++ for dir in $perm_rpath; do
++ rpath="$rpath$dir:"
++ done
++ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
++ fi
++ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
++ fi
++
++ shlibpath="$finalize_shlibpath"
++ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
++ if test -n "$shlibpath"; then
++ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
++ fi
++
+ # Get the real and link names of the library.
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+@@ -2045,6 +2858,7 @@
+ else
+ soname="$realname"
+ fi
++ test -z "$dlname" && dlname=$soname
+
+ lib="$output_objdir/$realname"
+ for link
+@@ -2079,7 +2893,7 @@
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ eval cmds=\"$export_symbols_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -2116,7 +2930,7 @@
+
+ for xlib in $convenience; do
+ # Extract the objects.
+- case "$xlib" in
++ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+@@ -2141,16 +2955,32 @@
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+- linkopts="$linkopts $flag"
++ linker_flags="$linker_flags $flag"
++ fi
++
++ # Make a backup of the uninstalled library when relinking
++ if test "$mode" = relink; then
++ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
++ save_deplibs="$deplibs"
++ for conv in $convenience; do
++ tmp_deplibs=
++ for test_deplib in $deplibs; do
++ if test "$test_deplib" != "$conv"; then
++ tmp_deplibs="$tmp_deplibs $test_deplib"
++ fi
++ done
++ deplibs="$tmp_deplibs"
++ done
+ eval cmds=\"$archive_cmds\"
++ deplibs="$save_deplibs"
+ fi
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -2158,6 +2988,12 @@
+ done
+ IFS="$save_ifs"
+
++ # Restore the uninstalled library and exit
++ if test "$mode" = relink; then
++ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
++ exit 0
++ fi
++
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+@@ -2174,12 +3010,7 @@
+ fi
+ ;;
+
+- *.lo | *.o | *.obj)
+- if test -n "$link_against_libtool_libs"; then
+- $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
+- exit 1
+- fi
+-
++ obj)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+ fi
+@@ -2204,9 +3035,9 @@
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+- case "$output" in
++ case $output in
+ *.lo)
+- if test -n "$objs"; then
++ if test -n "$objs$old_deplibs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit 1
+ fi
+@@ -2230,7 +3061,7 @@
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec
+- wl=
++ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+@@ -2249,7 +3080,7 @@
+
+ for xlib in $convenience; do
+ # Extract the objects.
+- case "$xlib" in
++ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+@@ -2273,11 +3104,11 @@
+ fi
+
+ # Create the old-style object.
+- reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
++ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ eval cmds=\"$reload_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -2308,12 +3139,12 @@
+ exit 0
+ fi
+
+- if test -n "$pic_flag"; then
++ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ eval cmds=\"$reload_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -2344,8 +3175,10 @@
+ exit 0
+ ;;
+
+- # Anything else should be a program.
+- *)
++ prog)
++ case $host in
++ *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
++ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
+@@ -2355,20 +3188,34 @@
+ fi
+
+ if test "$preload" = yes; then
+- if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
++ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+- fi
++ fi
+ fi
+-
++
++ case $host in
++ *-*-rhapsody* | *-*-darwin1.[012])
++ # On Rhapsody replace the C library is the System framework
++ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
++ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
++ case $host in
++ *darwin*)
++ # Don't allow lazy linking, it breaks C++ global constructors
++ compile_command="$compile_command ${wl}-bind_at_load"
++ finalize_command="$finalize_command ${wl}-bind_at_load"
++ ;;
++ esac
++ ;;
++ esac
++
++ compile_command="$compile_command $compile_deplibs"
++ finalize_command="$finalize_command $finalize_deplibs"
++
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+- case "$compile_rpath " in
+- *" $libdir "*) ;;
+- *) compile_rpath="$compile_rpath $libdir" ;;
+- esac
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+@@ -2386,7 +3233,7 @@
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+- case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
++ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+@@ -2404,6 +3251,14 @@
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
++ case :$dllsearchpath: in
++ *":$libdir:"*) ;;
++ *) dllsearchpath="$dllsearchpath:$libdir";;
++ esac
++ ;;
++ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+@@ -2422,7 +3277,7 @@
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+- case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
++ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+@@ -2449,23 +3304,6 @@
+ fi
+ finalize_rpath="$rpath"
+
+- output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+- if test "X$output_objdir" = "X$output"; then
+- output_objdir="$objdir"
+- else
+- output_objdir="$output_objdir/$objdir"
+- fi
+-
+- # Create the binary in the object directory, then wrap it.
+- if test ! -d $output_objdir; then
+- $show "$mkdir $output_objdir"
+- $run $mkdir $output_objdir
+- status=$?
+- if test $status -ne 0 && test ! -d $output_objdir; then
+- exit $status
+- fi
+- fi
+-
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+@@ -2482,7 +3320,7 @@
+ fi
+
+ if test -n "$dlsyms"; then
+- case "$dlsyms" in
++ case $dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+@@ -2514,7 +3352,7 @@
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+- progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+@@ -2524,7 +3362,7 @@
+ $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+-
++
+ if test -n "$export_symbols_regex"; then
+ $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+@@ -2534,9 +3372,9 @@
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+- $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
++ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+- $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
++ $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+@@ -2544,7 +3382,7 @@
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+- name=`echo "$arg" | sed -e 's%^.*/%%'`
++ name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval 'echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+@@ -2559,7 +3397,13 @@
+ fi
+
+ # Try sorting and uniquifying the output.
+- if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
++ if grep -v "^: " < "$nlist" |
++ if sort -k 3 </dev/null >/dev/null 2>&1; then
++ sort -k 3
++ else
++ sort +2
++ fi |
++ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+@@ -2576,27 +3420,25 @@
+ #undef lt_preloaded_symbols
+
+ #if defined (__STDC__) && __STDC__
+-# define lt_ptr_t void *
++# define lt_ptr void *
+ #else
+-# define lt_ptr_t char *
++# define lt_ptr char *
+ # define const
+ #endif
+
+ /* The mapping between symbol names and symbols. */
+ const struct {
+ const char *name;
+- lt_ptr_t address;
++ lt_ptr address;
+ }
+ lt_preloaded_symbols[] =
+ {\
+ "
+
+- sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
+- -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
+- < "$nlist" >> "$output_objdir/$dlsyms"
++ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+- {0, (lt_ptr_t) 0}
++ {0, (lt_ptr) 0}
+ };
+
+ /* This works around a problem in FreeBSD linker */
+@@ -2658,7 +3500,7 @@
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+- if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
++ if test $need_relink = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+@@ -2667,7 +3509,7 @@
+ $show "$link_command"
+ $run eval "$link_command"
+ status=$?
+-
++
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+@@ -2681,7 +3523,7 @@
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+- case "$dir" in
++ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+@@ -2723,11 +3565,24 @@
+ fi
+ fi
+
++ if test "$no_install" = yes; then
++ # We don't need to create a wrapper script.
++ link_command="$compile_var$compile_command$compile_rpath"
++ # Replace the output file specification.
++ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
++ # Delete the old output file.
++ $run $rm $output
++ # Link the executable and exit
++ $show "$link_command"
++ $run eval "$link_command" || exit $?
++ exit 0
++ fi
++
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+-
++
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+@@ -2747,7 +3602,7 @@
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+-
++
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+@@ -2759,12 +3614,24 @@
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
++ # Preserve any variables that may affect compiler behavior
++ for var in $variables_saved_for_relink; do
++ if eval test -z \"\${$var+set}\"; then
++ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
++ elif eval var_value=\$$var; test -z "$var_value"; then
++ relink_command="$var=; export $var; $relink_command"
++ else
++ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
++ relink_command="$var=\"$var_value\"; export $var; $relink_command"
++ fi
++ done
++ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+- case "$0" in
++ case $0 in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+ esac
+@@ -2778,7 +3645,12 @@
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+- *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
++ *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
++ esac
++ # test for cygwin because mv fails w/o .exe extensions
++ case $host in
++ *cygwin*) exeext=.exe ;;
++ *) exeext= ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit 1" 1 2 15
+@@ -2797,7 +3669,7 @@
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+-Xsed='sed -e 1s/^X//'
++Xsed="${SED}"' -e 1s/^X//'
+ sed_quote_subst='$sed_quote_subst'
+
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
+@@ -2809,7 +3681,7 @@
+ # This environment variable determines our operation mode.
+ if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+- link_against_libtool_libs='$link_against_libtool_libs'
++ notinst_deplibs='$notinst_deplibs'
+ else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+@@ -2835,20 +3707,20 @@
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+- file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
++ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+- [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
++ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+- file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
++ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+@@ -2858,11 +3730,11 @@
+
+ if test "$fast_install" = yes; then
+ echo >> $output "\
+- program=lt-'$outputname'
++ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+-
++
+ if test ! -f \"\$progdir/\$program\" || \\
+- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
++ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+@@ -2877,8 +3749,9 @@
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+- if (cd \"\$thisdir\" && eval \$relink_command); then :
++ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
++ $echo \"\$relink_command_output\" >&2
+ $rm \"\$progdir/\$file\"
+ exit 1
+ fi
+@@ -2907,7 +3780,7 @@
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+- # The second colon is a workaround for a bug in BeOS R4 sed
++ # The second colon is a workaround for a bug in BeOS R4 ${SED}
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+@@ -2927,13 +3800,21 @@
+ # Run the actual program with our arguments.
+ "
+ case $host in
+- *-*-cygwin* | *-*-mingw | *-*-os2*)
+- # win32 systems need to use the prog path for dll
+- # lookup to work
++ # win32 systems need to use the prog path for dll
++ # lookup to work
++ *-*-cygwin* | *-*-pw32*)
++ $echo >> $output "\
++ exec \$progdir/\$program \${1+\"\$@\"}
++"
++ ;;
++
++ # Backslashes separate directories on plain windows
++ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \$progdir\\\\\$program \${1+\"\$@\"}
+ "
+ ;;
++
+ *)
+ $echo >> $output "\
+ # Export the path to the program.
+@@ -2975,7 +3856,7 @@
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+- oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
++ oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+ fi
+ addlibs="$old_convenience"
+ fi
+@@ -2991,11 +3872,11 @@
+ exit $status
+ fi
+ generated="$generated $gentop"
+-
++
+ # Add in members from convenience archives.
+ for xlib in $addlibs; do
+ # Extract the objects.
+- case "$xlib" in
++ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+@@ -3041,7 +3922,7 @@
+
+ eval cmds=\"$old_archive_cmds\"
+ fi
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -3056,19 +3937,26 @@
+ fi
+
+ # Now create the libtool archive.
+- case "$output" in
++ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+- if test -n "$xrpath"; then
+- temp_xrpath=
+- for libdir in $xrpath; do
+- temp_xrpath="$temp_xrpath -R$libdir"
+- done
+- dependency_libs="$temp_xrpath $dependency_libs"
+- fi
++ # Preserve any variables that may affect compiler behavior
++ for var in $variables_saved_for_relink; do
++ if eval test -z \"\${$var+set}\"; then
++ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
++ elif eval var_value=\$$var; test -z "$var_value"; then
++ relink_command="$var=; export $var; $relink_command"
++ else
++ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
++ relink_command="$var=\"$var_value\"; export $var; $relink_command"
++ fi
++ done
++ # Quote the link command for shipping.
++ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
++ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+@@ -3078,8 +3966,52 @@
+ break
+ fi
+ output="$output_objdir/$outputname"i
++ # Replace all uninstalled libtool libraries with the installed ones
++ newdependency_libs=
++ for deplib in $dependency_libs; do
++ case $deplib in
++ *.la)
++ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ newdependency_libs="$newdependency_libs $libdir/$name"
++ ;;
++ *) newdependency_libs="$newdependency_libs $deplib" ;;
++ esac
++ done
++ dependency_libs="$newdependency_libs"
++ newdlfiles=
++ for lib in $dlfiles; do
++ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ newdlfiles="$newdlfiles $libdir/$name"
++ done
++ dlfiles="$newdlfiles"
++ newdlprefiles=
++ for lib in $dlprefiles; do
++ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ newdlprefiles="$newdlprefiles $libdir/$name"
++ done
++ dlprefiles="$newdlprefiles"
+ fi
+ $rm $output
++ # place dlname in correct position for cygwin
++ tdlname=$dlname
++ case $host,$output,$installed,$module,$dlname in
++ *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
++ esac
+ $echo > $output "\
+ # $outputname - a libtool library file
+ # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+@@ -3088,7 +4020,7 @@
+ # It is necessary for linking the library.
+
+ # The name that we can dlopen(3).
+-dlname='$dlname'
++dlname='$tdlname'
+
+ # Names of this library.
+ library_names='$library_names'
+@@ -3107,16 +4039,23 @@
+ # Is this an already installed library?
+ installed=$installed
+
++# Files to dlopen/dlpreopen
++dlopen='$dlfiles'
++dlpreopen='$dlprefiles'
++
+ # Directory that this library needs to be installed in:
+-libdir='$install_libdir'\
+-"
++libdir='$install_libdir'"
++ if test "$installed" = no && test $need_relink = yes; then
++ $echo >> $output "\
++relink_command=\"$relink_command\""
++ fi
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+- $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
++ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+ ;;
+ esac
+ exit 0
+@@ -3128,10 +4067,12 @@
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
++ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
++ # Allow the use of GNU shtool's install command.
++ $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+- case "$arg" in
++ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+@@ -3147,7 +4088,7 @@
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+- case "$arg" in
++ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+@@ -3170,7 +4111,7 @@
+ continue
+ fi
+
+- case "$arg" in
++ case $arg in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+@@ -3195,7 +4136,7 @@
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+- case "$arg" in
++ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+@@ -3246,11 +4187,11 @@
+ exit 1
+ fi
+ fi
+- case "$destdir" in
++ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+- case "$file" in
++ case $file in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+@@ -3272,15 +4213,15 @@
+ for file in $files; do
+
+ # Do each installation.
+- case "$file" in
+- *.a | *.lib)
++ case $file in
++ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+@@ -3289,8 +4230,9 @@
+
+ library_names=
+ old_library=
++ relink_command=
+ # If there is no directory component, then add one.
+- case "$file" in
++ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+@@ -3309,10 +4251,38 @@
+ esac
+ fi
+
+- dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
++ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
++ if test -n "$relink_command"; then
++ # Determine the prefix the user has applied to our future dir.
++ inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
++
++ # Don't allow the user to place us outside of our expected
++ # location b/c this prevents finding dependent libraries that
++ # are installed to the same prefix.
++ if test "$inst_prefix_dir" = "$destdir"; then
++ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
++ exit 1
++ fi
++
++ if test -n "$inst_prefix_dir"; then
++ # Stick the inst_prefix_dir data into the link command.
++ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
++ else
++ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
++ fi
++
++ $echo "$modename: warning: relinking \`$file'" 1>&2
++ $show "$relink_command"
++ if $run eval "$relink_command"; then :
++ else
++ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
++ exit 1
++ fi
++ fi
++
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+@@ -3320,9 +4290,16 @@
+ shift
+ shift
+
++ srcname="$realname"
++ test -n "$relink_command" && srcname="$realname"T
++
+ # Install the shared library and build the symlinks.
+- $show "$install_prog $dir/$realname $destdir/$realname"
+- $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
++ $show "$install_prog $dir/$srcname $destdir/$realname"
++ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
++ if test -n "$stripme" && test -n "$striplib"; then
++ $show "$striplib $destdir/$realname"
++ $run eval "$striplib $destdir/$realname" || exit $?
++ fi
+
+ if test $# -gt 0; then
+ # Delete the old symlinks, and create new ones.
+@@ -3338,7 +4315,7 @@
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ eval cmds=\"$postinstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -3369,11 +4346,11 @@
+ fi
+
+ # Deduce the name of the destination old-style object file.
+- case "$destfile" in
++ case $destfile in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+- *.o | *.obj)
++ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+@@ -3411,40 +4388,55 @@
+ fi
+
+ # Do a test to see if this is really a libtool program.
+- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+- link_against_libtool_libs=
++ case $host in
++ *cygwin*|*mingw*)
++ wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
++ ;;
++ *)
++ wrapper=$file
++ ;;
++ esac
++ if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
++ notinst_deplibs=
+ relink_command=
+
+ # If there is no directory component, then add one.
+- case "$file" in
+- */* | *\\*) . $file ;;
+- *) . ./$file ;;
++ case $file in
++ */* | *\\*) . $wrapper ;;
++ *) . ./$wrapper ;;
+ esac
+
+ # Check the variables that should have been set.
+- if test -z "$link_against_libtool_libs"; then
+- $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
++ if test -z "$notinst_deplibs"; then
++ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit 1
+ fi
+
+ finalize=yes
+- for lib in $link_against_libtool_libs; do
++ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+- case "$lib" in
++ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+- libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
++ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
++ relink_command=
++ # If there is no directory component, then add one.
++ case $file in
++ */* | *\\*) . $wrapper ;;
++ *) . ./$wrapper ;;
++ esac
++
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+@@ -3456,6 +4448,7 @@
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
++ file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+@@ -3477,6 +4470,23 @@
+ fi
+ fi
+
++ # remove .exe since cygwin /usr/bin/install will append another
++ # one anyways
++ case $install_prog,$host in
++ /usr/bin/install*,*cygwin*)
++ case $file:$destfile in
++ *.exe:*.exe)
++ # this is ok
++ ;;
++ *.exe:*)
++ destfile=$destfile.exe
++ ;;
++ *:*.exe)
++ destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
++ ;;
++ esac
++ ;;
++ esac
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+@@ -3493,9 +4503,14 @@
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
++ if test -n "$stripme" && test -n "$striplib"; then
++ $show "$old_striplib $oldlib"
++ $run eval "$old_striplib $oldlib" || exit $?
++ fi
++
+ # Do each command in the postinstall commands.
+ eval cmds=\"$old_postinstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -3511,11 +4526,10 @@
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+- exec $SHELL $0 --finish$current_libdirs
+- exit 1
++ exec_cmd='$SHELL $0 --finish$current_libdirs'
++ else
++ exit 0
+ fi
+-
+- exit 0
+ ;;
+
+ # libtool finish mode
+@@ -3534,7 +4548,7 @@
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ eval cmds=\"$finish_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -3553,7 +4567,7 @@
+ fi
+
+ # Exit here if they wanted silent mode.
+- test "$show" = : && exit 0
++ test "$show" = ":" && exit 0
+
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+@@ -3563,7 +4577,7 @@
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+- echo "specify the full pathname of the library, or use \`-LLIBDIR'"
++ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+@@ -3613,10 +4627,10 @@
+ fi
+
+ dir=
+- case "$file" in
++ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+@@ -3628,7 +4642,7 @@
+ library_names=
+
+ # If there is no directory component, then add one.
+- case "$file" in
++ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+@@ -3683,13 +4697,13 @@
+ args=
+ for file
+ do
+- case "$file" in
++ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+- case "$file" in
++ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+@@ -3706,8 +4720,8 @@
+
+ if test -z "$run"; then
+ if test -n "$shlibpath_var"; then
+- # Export the shlibpath_var.
+- eval "export $shlibpath_var"
++ # Export the shlibpath_var.
++ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved enviroment variables
+@@ -3718,31 +4732,35 @@
+ LANG="$save_LANG"; export LANG
+ fi
+
+- # Now actually exec the command.
+- eval "exec \$cmd$args"
+-
+- $echo "$modename: cannot exec \$cmd$args"
+- exit 1
++ # Now prepare to actually exec the command.
++ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+- eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+- $echo "export $shlibpath_var"
++ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
++ $echo "export $shlibpath_var"
+ fi
+ $echo "$cmd$args"
+ exit 0
+ fi
+ ;;
+
+- # libtool uninstall mode
+- uninstall)
+- modename="$modename: uninstall"
++ # libtool clean and uninstall mode
++ clean | uninstall)
++ modename="$modename: $mode"
+ rm="$nonopt"
+ files=
++ rmforce=
++ exit_status=0
++
++ # This variable tells wrapper scripts just to set variables rather
++ # than running their programs.
++ libtool_install_magic="$magic"
+
+ for arg
+ do
+- case "$arg" in
++ case $arg in
++ -f) rm="$rm $arg"; rmforce=yes ;;
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+@@ -3754,53 +4772,86 @@
+ exit 1
+ fi
+
++ rmdirs=
++
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+- test "X$dir" = "X$file" && dir=.
++ if test "X$dir" = "X$file"; then
++ dir=.
++ objdir="$objdir"
++ else
++ objdir="$dir/$objdir"
++ fi
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
++ test $mode = uninstall && objdir="$dir"
++
++ # Remember objdir for removal later, being careful to avoid duplicates
++ if test $mode = clean; then
++ case " $rmdirs " in
++ *" $objdir "*) ;;
++ *) rmdirs="$rmdirs $objdir" ;;
++ esac
++ fi
++
++ # Don't error if the file doesn't exist and rm -f was used.
++ if (test -L "$file") >/dev/null 2>&1 \
++ || (test -h "$file") >/dev/null 2>&1 \
++ || test -f "$file"; then
++ :
++ elif test -d "$file"; then
++ exit_status=1
++ continue
++ elif test "$rmforce" = yes; then
++ continue
++ fi
+
+ rmfiles="$file"
+
+- case "$name" in
++ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+- rmfiles="$rmfiles $dir/$n"
++ rmfiles="$rmfiles $objdir/$n"
+ done
+- test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
++ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
++ test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+- $show "$rm $rmfiles"
+- $run $rm $rmfiles
+-
+- if test -n "$library_names"; then
+- # Do each command in the postuninstall commands.
+- eval cmds=\"$postuninstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+- for cmd in $cmds; do
++ if test $mode = uninstall; then
++ if test -n "$library_names"; then
++ # Do each command in the postuninstall commands.
++ eval cmds=\"$postuninstall_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd"
++ if test $? != 0 && test "$rmforce" != yes; then
++ exit_status=1
++ fi
++ done
+ IFS="$save_ifs"
+- $show "$cmd"
+- $run eval "$cmd"
+- done
+- IFS="$save_ifs"
+- fi
++ fi
+
+- if test -n "$old_library"; then
+- # Do each command in the old_postuninstall commands.
+- eval cmds=\"$old_postuninstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+- for cmd in $cmds; do
++ if test -n "$old_library"; then
++ # Do each command in the old_postuninstall commands.
++ eval cmds=\"$old_postuninstall_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd"
++ if test $? != 0 && test "$rmforce" != yes; then
++ exit_status=1
++ fi
++ done
+ IFS="$save_ifs"
+- $show "$cmd"
+- $run eval "$cmd"
+- done
+- IFS="$save_ifs"
++ fi
++ # FIXME: should reinstall the best remaining shared library.
+ fi
+-
+- # FIXME: should reinstall the best remaining shared library.
+ fi
+ ;;
+
+@@ -3809,17 +4860,35 @@
+ oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
+ rmfiles="$rmfiles $dir/$oldobj"
+ fi
+- $show "$rm $rmfiles"
+- $run $rm $rmfiles
+ ;;
+
+ *)
+- $show "$rm $rmfiles"
+- $run $rm $rmfiles
++ # Do a test to see if this is a libtool program.
++ if test $mode = clean &&
++ (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ relink_command=
++ . $dir/$file
++
++ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
++ if test "$fast_install" = yes && test -n "$relink_command"; then
++ rmfiles="$rmfiles $objdir/lt-$name"
++ fi
++ fi
+ ;;
+ esac
++ $show "$rm $rmfiles"
++ $run $rm $rmfiles || exit_status=1
+ done
+- exit 0
++
++ # Try to remove the ${objdir}s in the directories where we deleted files
++ for dir in $rmdirs; do
++ if test -d "$dir"; then
++ $show "rmdir $dir"
++ $run rmdir $dir >/dev/null 2>&1
++ fi
++ done
++
++ exit $exit_status
+ ;;
+
+ "")
+@@ -3829,13 +4898,20 @@
+ ;;
+ esac
+
+- $echo "$modename: invalid operation mode \`$mode'" 1>&2
+- $echo "$generic_help" 1>&2
+- exit 1
++ if test -z "$exec_cmd"; then
++ $echo "$modename: invalid operation mode \`$mode'" 1>&2
++ $echo "$generic_help" 1>&2
++ exit 1
++ fi
+ fi # test -z "$show_help"
+
++if test -n "$exec_cmd"; then
++ eval exec $exec_cmd
++ exit 1
++fi
++
+ # We need to display help for each of the modes.
+-case "$mode" in
++case $mode in
+ "") $echo \
+ "Usage: $modename [OPTION]... [MODE-ARG]...
+
+@@ -3854,6 +4930,7 @@
+
+ MODE must be one of the following:
+
++ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+@@ -3866,6 +4943,20 @@
+ exit 0
+ ;;
+
++clean)
++ $echo \
++"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
++
++Remove files from the build directory.
++
++RM is the name of the program to use to delete files associated with each FILE
++(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
++to RM.
++
++If FILE is a libtool library, object or program, all the files associated
++with it are deleted. Otherwise, only FILE itself is deleted using RM."
++ ;;
++
+ compile)
+ $echo \
+ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+@@ -3875,6 +4966,8 @@
+ This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
++ -prefer-pic try to building PIC objects only
++ -prefer-non-pic try to building non-PIC objects only
+ -static always build a \`.o' file suitable for static linking
+
+ COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+@@ -3954,6 +5047,8 @@
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
++ -no-fast-install disable the fast-install mode
++ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -release RELEASE specify package release information
+--- glib1.2-1.2.10.orig/gmodule/Makefile.in
++++ glib1.2-1.2.10/gmodule/Makefile.in
+@@ -1,6 +1,6 @@
+-# Makefile.in generated automatically by automake 1.4 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
++# Copyright (C) 1994, 1995-8, 1999, 2001 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.
+@@ -62,8 +62,10 @@
+ AS = @AS@
+ CC = @CC@
+ DLLTOOL = @DLLTOOL@
++ECHO = @ECHO@
+ ENABLE_MEM_CHECK = @ENABLE_MEM_CHECK@
+ ENABLE_MEM_PROFILE = @ENABLE_MEM_PROFILE@
++EXEEXT = @EXEEXT@
+ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@
+ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@
+ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@
+@@ -88,8 +90,10 @@
+ MAINT = @MAINT@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
++OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ RANLIB = @RANLIB@
++STRIP = @STRIP@
+ VERSION = @VERSION@
+
+ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule -DG_LOG_DOMAIN=\"GModule\" @GLIB_DEBUG_FLAGS@
+@@ -112,17 +116,17 @@
+ libgmodule_la_LDFLAGS = @G_MODULE_LDFLAGS@ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) -export-dynamic
+
+
+-libgmodule_la_LIBADD = @G_MODULE_LIBS@ # $(libglib)
++libgmodule_la_LIBADD = @G_MODULE_LIBS@ $(libglib)
+ # we should really depend on $(libglib) for libgmodule.la, but libtool has a
+ # problem with this ;(
+
+ libgplugin_a_la_SOURCES = libgplugin_a.c
+ libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
+-libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ # $(libglib)
++libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ $(libglib)
+
+ libgplugin_b_la_SOURCES = libgplugin_b.c
+ libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
+-libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ # $(libglib)
++libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ $(libglib)
+
+ noinst_PROGRAMS = testgmodule
+ testgmodule_LDFLAGS = @G_MODULE_LDFLAGS@
+@@ -143,10 +147,11 @@
+ libgplugin_a_la_OBJECTS = libgplugin_a.lo
+ libgplugin_b_la_DEPENDENCIES =
+ libgplugin_b_la_OBJECTS = libgplugin_b.lo
++noinst_PROGRAMS = testgmodule$(EXEEXT)
+ PROGRAMS = $(noinst_PROGRAMS)
+
+ testgmodule_SOURCES = testgmodule.c
+-testgmodule_OBJECTS = testgmodule.o
++testgmodule_OBJECTS = testgmodule.$(OBJEXT)
+ testgmodule_DEPENDENCIES = libgmodule.la $(top_builddir)/libglib.la
+ CFLAGS = @CFLAGS@
+ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+@@ -161,14 +166,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ SOURCES = $(libgmodule_la_SOURCES) $(libgplugin_a_la_SOURCES) $(libgplugin_b_la_SOURCES) testgmodule.c
+-OBJECTS = $(libgmodule_la_OBJECTS) $(libgplugin_a_la_OBJECTS) $(libgplugin_b_la_OBJECTS) testgmodule.o
++OBJECTS = $(libgmodule_la_OBJECTS) $(libgplugin_a_la_OBJECTS) $(libgplugin_b_la_OBJECTS) testgmodule.$(OBJEXT)
+
+ all: all-redirect
+ .SUFFIXES:
+-.SUFFIXES: .S .c .lo .o .s
++.SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps gmodule/Makefile
+
+@@ -197,6 +202,11 @@
+ .c.o:
+ $(COMPILE) -c $<
+
++# FIXME: We should only use cygpath when building on Windows,
++# and only if it is available.
++.c.obj:
++ $(COMPILE) -c `cygpath -w $<`
++
+ .s.o:
+ $(COMPILE) -c $<
+
+@@ -205,6 +215,7 @@
+
+ mostlyclean-compile:
+ -rm -f *.o core *.core
++ -rm -f *.$(OBJEXT)
+
+ clean-compile:
+
+@@ -250,8 +261,8 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-testgmodule: $(testgmodule_OBJECTS) $(testgmodule_DEPENDENCIES)
+- @rm -f testgmodule
++testgmodule$(EXEEXT): $(testgmodule_OBJECTS) $(testgmodule_DEPENDENCIES)
++ @rm -f testgmodule$(EXEEXT)
+ $(LINK) $(testgmodule_LDFLAGS) $(testgmodule_OBJECTS) $(testgmodule_LDADD) $(LIBS)
+
+ install-glibincludeHEADERS: $(glibinclude_HEADERS)
+@@ -287,7 +298,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -313,15 +324,6 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-gmodule.lo gmodule.o : gmodule.c gmodule.h ../glib.h ../glibconfig.h \
+- gmoduleconf.h gmodule-dl.c
+-libgplugin_a.lo libgplugin_a.o : libgplugin_a.c gmodule.h ../glib.h \
+- ../glibconfig.h
+-libgplugin_b.lo libgplugin_b.o : libgplugin_b.c gmodule.h ../glib.h \
+- ../glibconfig.h
+-testgmodule.o: testgmodule.c gmodule.h ../glib.h ../glibconfig.h \
+- gmoduleconf.h
+-
+ info-am:
+ info: info-am
+ dvi-am:
+--- glib1.2-1.2.10.orig/gmodule/Makefile.am
++++ glib1.2-1.2.10/gmodule/Makefile.am
+@@ -29,17 +29,17 @@
+ -release $(LT_RELEASE) \
+ -export-dynamic
+
+-libgmodule_la_LIBADD = @G_MODULE_LIBS@ # $(libglib)
++libgmodule_la_LIBADD = @G_MODULE_LIBS@ $(libglib)
+ # we should really depend on $(libglib) for libgmodule.la, but libtool has a
+ # problem with this ;(
+
+ libgplugin_a_la_SOURCES = libgplugin_a.c
+ libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
+-libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ # $(libglib)
++libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ $(libglib)
+
+ libgplugin_b_la_SOURCES = libgplugin_b.c
+ libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
+-libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ # $(libglib)
++libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ $(libglib)
+
+ noinst_PROGRAMS = testgmodule
+ testgmodule_LDFLAGS += @G_MODULE_LDFLAGS@
+--- glib1.2-1.2.10.orig/gthread/Makefile.in
++++ glib1.2-1.2.10/gthread/Makefile.in
+@@ -1,6 +1,6 @@
+-# Makefile.in generated automatically by automake 1.4 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
++# Copyright (C) 1994, 1995-8, 1999, 2001 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.
+@@ -62,8 +62,10 @@
+ AS = @AS@
+ CC = @CC@
+ DLLTOOL = @DLLTOOL@
++ECHO = @ECHO@
+ ENABLE_MEM_CHECK = @ENABLE_MEM_CHECK@
+ ENABLE_MEM_PROFILE = @ENABLE_MEM_PROFILE@
++EXEEXT = @EXEEXT@
+ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@
+ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@
+ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@
+@@ -88,8 +90,10 @@
+ MAINT = @MAINT@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
++OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ RANLIB = @RANLIB@
++STRIP = @STRIP@
+ VERSION = @VERSION@
+
+ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gthread -DG_LOG_DOMAIN=\"GThread\"
+@@ -105,7 +109,7 @@
+ libgthread_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -release $(LT_RELEASE) -export-dynamic
+
+
+-libgthread_la_LIBADD = @G_THREAD_LIBS@
++libgthread_la_LIBADD = @G_THREAD_LIBS@ $(libglib)
+
+ noinst_PROGRAMS = testgthread
+ testgthread_LDADD = ../libglib.la libgthread.la
+@@ -121,10 +125,11 @@
+ LIBS = @LIBS@
+ libgthread_la_DEPENDENCIES =
+ libgthread_la_OBJECTS = gthread.lo
++noinst_PROGRAMS = testgthread$(EXEEXT)
+ PROGRAMS = $(noinst_PROGRAMS)
+
+ testgthread_SOURCES = testgthread.c
+-testgthread_OBJECTS = testgthread.o
++testgthread_OBJECTS = testgthread.$(OBJEXT)
+ testgthread_DEPENDENCIES = ../libglib.la libgthread.la
+ testgthread_LDFLAGS =
+ CFLAGS = @CFLAGS@
+@@ -137,14 +142,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ SOURCES = $(libgthread_la_SOURCES) testgthread.c
+-OBJECTS = $(libgthread_la_OBJECTS) testgthread.o
++OBJECTS = $(libgthread_la_OBJECTS) testgthread.$(OBJEXT)
+
+ all: all-redirect
+ .SUFFIXES:
+-.SUFFIXES: .S .c .lo .o .s
++.SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps gthread/Makefile
+
+@@ -181,6 +186,11 @@
+ .c.o:
+ $(COMPILE) -c $<
+
++# FIXME: We should only use cygpath when building on Windows,
++# and only if it is available.
++.c.obj:
++ $(COMPILE) -c `cygpath -w $<`
++
+ .s.o:
+ $(COMPILE) -c $<
+
+@@ -189,6 +199,7 @@
+
+ mostlyclean-compile:
+ -rm -f *.o core *.core
++ -rm -f *.$(OBJEXT)
+
+ clean-compile:
+
+@@ -228,8 +239,8 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-testgthread: $(testgthread_OBJECTS) $(testgthread_DEPENDENCIES)
+- @rm -f testgthread
++testgthread$(EXEEXT): $(testgthread_OBJECTS) $(testgthread_DEPENDENCIES)
++ @rm -f testgthread$(EXEEXT)
+ $(LINK) $(testgthread_LDFLAGS) $(testgthread_OBJECTS) $(testgthread_LDADD) $(LIBS)
+
+ tags: TAGS
+@@ -250,7 +261,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -276,11 +287,6 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-gthread.lo gthread.o : gthread.c ../config.h ../glib.h ../glibconfig.h \
+- gthread-posix.c
+-testgthread.o: testgthread.c ../config.h ../testglib.c ../glib.h \
+- ../glibconfig.h
+-
+ info-am:
+ info: info-am
+ dvi-am:
+--- glib1.2-1.2.10.orig/gthread/Makefile.am
++++ glib1.2-1.2.10/gthread/Makefile.am
+@@ -19,7 +19,7 @@
+ -release $(LT_RELEASE) \
+ -export-dynamic
+
+-libgthread_la_LIBADD = @G_THREAD_LIBS@
++libgthread_la_LIBADD = @G_THREAD_LIBS@ $(libglib)
+
+ noinst_PROGRAMS = testgthread
+ testgthread_LDADD = ../libglib.la libgthread.la
+--- glib1.2-1.2.10.orig/docs/Makefile.in
++++ glib1.2-1.2.10/docs/Makefile.in
+@@ -1,6 +1,6 @@
+-# Makefile.in generated automatically by automake 1.4 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
++# Copyright (C) 1994, 1995-8, 1999, 2001 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.
+@@ -62,8 +62,10 @@
+ AS = @AS@
+ CC = @CC@
+ DLLTOOL = @DLLTOOL@
++ECHO = @ECHO@
+ ENABLE_MEM_CHECK = @ENABLE_MEM_CHECK@
+ ENABLE_MEM_PROFILE = @ENABLE_MEM_PROFILE@
++EXEEXT = @EXEEXT@
+ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@
+ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@
+ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@
+@@ -88,8 +90,10 @@
+ MAINT = @MAINT@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
++OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ RANLIB = @RANLIB@
++STRIP = @STRIP@
+ VERSION = @VERSION@
+
+ info_TEXINFOS = glib.texi
+@@ -114,7 +118,7 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+@@ -208,7 +212,7 @@
+ else ii=; fi; \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+- test -z "$ii" \
++ test -z "$$ii" \
+ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
+ done
+ @$(NORMAL_UNINSTALL)
+--- glib1.2-1.2.10.orig/tests/Makefile.in
++++ glib1.2-1.2.10/tests/Makefile.in
+@@ -1,6 +1,6 @@
+-# Makefile.in generated automatically by automake 1.4 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
++# Copyright (C) 1994, 1995-8, 1999, 2001 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.
+@@ -62,8 +62,10 @@
+ AS = @AS@
+ CC = @CC@
+ DLLTOOL = @DLLTOOL@
++ECHO = @ECHO@
+ ENABLE_MEM_CHECK = @ENABLE_MEM_CHECK@
+ ENABLE_MEM_PROFILE = @ENABLE_MEM_PROFILE@
++EXEEXT = @EXEEXT@
+ GLIB_BINARY_AGE = @GLIB_BINARY_AGE@
+ GLIB_DEBUG_FLAGS = @GLIB_DEBUG_FLAGS@
+ GLIB_INTERFACE_AGE = @GLIB_INTERFACE_AGE@
+@@ -88,8 +90,10 @@
+ MAINT = @MAINT@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
++OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ RANLIB = @RANLIB@
++STRIP = @STRIP@
+ VERSION = @VERSION@
+
+ INCLUDES = -I$(top_srcdir)
+@@ -116,6 +120,10 @@
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../config.h
+ CONFIG_CLEAN_FILES =
++noinst_PROGRAMS = array-test$(EXEEXT) dirname-test$(EXEEXT) \
++hash-test$(EXEEXT) list-test$(EXEEXT) node-test$(EXEEXT) \
++relation-test$(EXEEXT) slist-test$(EXEEXT) string-test$(EXEEXT) \
++strfunc-test$(EXEEXT) tree-test$(EXEEXT) type-test$(EXEEXT)
+ PROGRAMS = $(noinst_PROGRAMS)
+
+
+@@ -124,47 +132,47 @@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+ array_test_SOURCES = array-test.c
+-array_test_OBJECTS = array-test.o
++array_test_OBJECTS = array-test.$(OBJEXT)
+ array_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ array_test_LDFLAGS =
+ dirname_test_SOURCES = dirname-test.c
+-dirname_test_OBJECTS = dirname-test.o
++dirname_test_OBJECTS = dirname-test.$(OBJEXT)
+ dirname_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ dirname_test_LDFLAGS =
+ hash_test_SOURCES = hash-test.c
+-hash_test_OBJECTS = hash-test.o
++hash_test_OBJECTS = hash-test.$(OBJEXT)
+ hash_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ hash_test_LDFLAGS =
+ list_test_SOURCES = list-test.c
+-list_test_OBJECTS = list-test.o
++list_test_OBJECTS = list-test.$(OBJEXT)
+ list_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ list_test_LDFLAGS =
+ node_test_SOURCES = node-test.c
+-node_test_OBJECTS = node-test.o
++node_test_OBJECTS = node-test.$(OBJEXT)
+ node_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ node_test_LDFLAGS =
+ relation_test_SOURCES = relation-test.c
+-relation_test_OBJECTS = relation-test.o
++relation_test_OBJECTS = relation-test.$(OBJEXT)
+ relation_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ relation_test_LDFLAGS =
+ slist_test_SOURCES = slist-test.c
+-slist_test_OBJECTS = slist-test.o
++slist_test_OBJECTS = slist-test.$(OBJEXT)
+ slist_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ slist_test_LDFLAGS =
+ string_test_SOURCES = string-test.c
+-string_test_OBJECTS = string-test.o
++string_test_OBJECTS = string-test.$(OBJEXT)
+ string_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ string_test_LDFLAGS =
+ strfunc_test_SOURCES = strfunc-test.c
+-strfunc_test_OBJECTS = strfunc-test.o
++strfunc_test_OBJECTS = strfunc-test.$(OBJEXT)
+ strfunc_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ strfunc_test_LDFLAGS =
+ tree_test_SOURCES = tree-test.c
+-tree_test_OBJECTS = tree-test.o
++tree_test_OBJECTS = tree-test.$(OBJEXT)
+ tree_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ tree_test_LDFLAGS =
+ type_test_SOURCES = type-test.c
+-type_test_OBJECTS = type-test.o
++type_test_OBJECTS = type-test.$(OBJEXT)
+ type_test_DEPENDENCIES = $(top_builddir)/libglib.la
+ type_test_LDFLAGS =
+ CFLAGS = @CFLAGS@
+@@ -177,14 +185,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ SOURCES = array-test.c dirname-test.c hash-test.c list-test.c node-test.c relation-test.c slist-test.c string-test.c strfunc-test.c tree-test.c type-test.c
+-OBJECTS = array-test.o dirname-test.o hash-test.o list-test.o node-test.o relation-test.o slist-test.o string-test.o strfunc-test.o tree-test.o type-test.o
++OBJECTS = array-test.$(OBJEXT) dirname-test.$(OBJEXT) hash-test.$(OBJEXT) list-test.$(OBJEXT) node-test.$(OBJEXT) relation-test.$(OBJEXT) slist-test.$(OBJEXT) string-test.$(OBJEXT) strfunc-test.$(OBJEXT) tree-test.$(OBJEXT) type-test.$(OBJEXT)
+
+ all: all-redirect
+ .SUFFIXES:
+-.SUFFIXES: .S .c .lo .o .s
++.SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps tests/Makefile
+
+@@ -205,6 +213,11 @@
+ .c.o:
+ $(COMPILE) -c $<
+
++# FIXME: We should only use cygpath when building on Windows,
++# and only if it is available.
++.c.obj:
++ $(COMPILE) -c `cygpath -w $<`
++
+ .s.o:
+ $(COMPILE) -c $<
+
+@@ -213,6 +226,7 @@
+
+ mostlyclean-compile:
+ -rm -f *.o core *.core
++ -rm -f *.$(OBJEXT)
+
+ clean-compile:
+
+@@ -240,48 +254,48 @@
+
+ maintainer-clean-libtool:
+
+-array-test: $(array_test_OBJECTS) $(array_test_DEPENDENCIES)
+- @rm -f array-test
++array-test$(EXEEXT): $(array_test_OBJECTS) $(array_test_DEPENDENCIES)
++ @rm -f array-test$(EXEEXT)
+ $(LINK) $(array_test_LDFLAGS) $(array_test_OBJECTS) $(array_test_LDADD) $(LIBS)
+
+-dirname-test: $(dirname_test_OBJECTS) $(dirname_test_DEPENDENCIES)
+- @rm -f dirname-test
++dirname-test$(EXEEXT): $(dirname_test_OBJECTS) $(dirname_test_DEPENDENCIES)
++ @rm -f dirname-test$(EXEEXT)
+ $(LINK) $(dirname_test_LDFLAGS) $(dirname_test_OBJECTS) $(dirname_test_LDADD) $(LIBS)
+
+-hash-test: $(hash_test_OBJECTS) $(hash_test_DEPENDENCIES)
+- @rm -f hash-test
++hash-test$(EXEEXT): $(hash_test_OBJECTS) $(hash_test_DEPENDENCIES)
++ @rm -f hash-test$(EXEEXT)
+ $(LINK) $(hash_test_LDFLAGS) $(hash_test_OBJECTS) $(hash_test_LDADD) $(LIBS)
+
+-list-test: $(list_test_OBJECTS) $(list_test_DEPENDENCIES)
+- @rm -f list-test
++list-test$(EXEEXT): $(list_test_OBJECTS) $(list_test_DEPENDENCIES)
++ @rm -f list-test$(EXEEXT)
+ $(LINK) $(list_test_LDFLAGS) $(list_test_OBJECTS) $(list_test_LDADD) $(LIBS)
+
+-node-test: $(node_test_OBJECTS) $(node_test_DEPENDENCIES)
+- @rm -f node-test
++node-test$(EXEEXT): $(node_test_OBJECTS) $(node_test_DEPENDENCIES)
++ @rm -f node-test$(EXEEXT)
+ $(LINK) $(node_test_LDFLAGS) $(node_test_OBJECTS) $(node_test_LDADD) $(LIBS)
+
+-relation-test: $(relation_test_OBJECTS) $(relation_test_DEPENDENCIES)
+- @rm -f relation-test
++relation-test$(EXEEXT): $(relation_test_OBJECTS) $(relation_test_DEPENDENCIES)
++ @rm -f relation-test$(EXEEXT)
+ $(LINK) $(relation_test_LDFLAGS) $(relation_test_OBJECTS) $(relation_test_LDADD) $(LIBS)
+
+-slist-test: $(slist_test_OBJECTS) $(slist_test_DEPENDENCIES)
+- @rm -f slist-test
++slist-test$(EXEEXT): $(slist_test_OBJECTS) $(slist_test_DEPENDENCIES)
++ @rm -f slist-test$(EXEEXT)
+ $(LINK) $(slist_test_LDFLAGS) $(slist_test_OBJECTS) $(slist_test_LDADD) $(LIBS)
+
+-string-test: $(string_test_OBJECTS) $(string_test_DEPENDENCIES)
+- @rm -f string-test
++string-test$(EXEEXT): $(string_test_OBJECTS) $(string_test_DEPENDENCIES)
++ @rm -f string-test$(EXEEXT)
+ $(LINK) $(string_test_LDFLAGS) $(string_test_OBJECTS) $(string_test_LDADD) $(LIBS)
+
+-strfunc-test: $(strfunc_test_OBJECTS) $(strfunc_test_DEPENDENCIES)
+- @rm -f strfunc-test
++strfunc-test$(EXEEXT): $(strfunc_test_OBJECTS) $(strfunc_test_DEPENDENCIES)
++ @rm -f strfunc-test$(EXEEXT)
+ $(LINK) $(strfunc_test_LDFLAGS) $(strfunc_test_OBJECTS) $(strfunc_test_LDADD) $(LIBS)
+
+-tree-test: $(tree_test_OBJECTS) $(tree_test_DEPENDENCIES)
+- @rm -f tree-test
++tree-test$(EXEEXT): $(tree_test_OBJECTS) $(tree_test_DEPENDENCIES)
++ @rm -f tree-test$(EXEEXT)
+ $(LINK) $(tree_test_LDFLAGS) $(tree_test_OBJECTS) $(tree_test_LDADD) $(LIBS)
+
+-type-test: $(type_test_OBJECTS) $(type_test_DEPENDENCIES)
+- @rm -f type-test
++type-test$(EXEEXT): $(type_test_OBJECTS) $(type_test_DEPENDENCIES)
++ @rm -f type-test$(EXEEXT)
+ $(LINK) $(type_test_LDFLAGS) $(type_test_OBJECTS) $(type_test_LDADD) $(LIBS)
+
+ tags: TAGS
+@@ -302,7 +316,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -328,18 +342,6 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-array-test.o: array-test.c ../glib.h ../glibconfig.h
+-dirname-test.o: dirname-test.c ../glib.h ../glibconfig.h
+-hash-test.o: hash-test.c ../config.h ../glib.h ../glibconfig.h
+-list-test.o: list-test.c ../glib.h ../glibconfig.h
+-node-test.o: node-test.c ../config.h ../glib.h ../glibconfig.h
+-relation-test.o: relation-test.c ../glib.h ../glibconfig.h
+-slist-test.o: slist-test.c ../glib.h ../glibconfig.h
+-strfunc-test.o: strfunc-test.c ../glib.h ../glibconfig.h
+-string-test.o: string-test.c ../glib.h ../glibconfig.h
+-tree-test.o: tree-test.c ../glib.h ../glibconfig.h
+-type-test.o: type-test.c ../glib.h ../glibconfig.h
+-
+ check-TESTS: $(TESTS)
+ @failed=0; all=0; \
+ srcdir=$(srcdir); export srcdir; \
+--- glib1.2-1.2.10.orig/debian/rules
++++ glib1.2-1.2.10/debian/rules
+@@ -0,0 +1,137 @@
++#!/usr/bin/make -f
++# Sample debian/rules that uses debhelper.
++# GNU copyright 1997 to 1999 by Joey Hess.
++
++# Uncomment this to turn on verbose mode.
++#export DH_VERBOSE=1
++
++# These are used for cross-compiling and for saving the configure script
++# from having to guess our platform (since we know it already)
++DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
++DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
++
++CFLAGS = -Wall -g
++
++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
++ CFLAGS += -O0
++else
++ CFLAGS += -O2
++endif
++ifeq (,$(findstring,nostrip,$(DEB_BUILD_OPTIONS)))
++ INSTALL_PROGRAM += -s
++endif
++
++# shared library versions, option 1
++version=2.0.5
++major=2
++# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
++#version=`ls src/.libs/lib*.so.* | \
++# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
++#major=`ls src/.libs/lib*.so.* | \
++# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
++
++config.status: configure
++ dh_testdir
++
++ # Add here commands to configure the package.
++ ./configure --host=$(DEB_HOST_GNU_TYPE) \
++ --build=$(DEB_BUILD_GNU_TYPE) \
++ --prefix=/usr \
++ --mandir=\$${prefix}/share/man \
++ --infodir=\$${prefix}/share/info \
++ --enable-debug=yes
++
++build: build-stamp
++build-stamp: config.status
++ dh_testdir
++
++ # Add here commands to compile the package.
++ $(MAKE)
++
++ touch $@
++
++clean:
++ dh_testdir
++ dh_testroot
++ rm -f build-stamp
++
++ # Add here commands to clean up after the build process.
++ -$(MAKE) distclean
++
++ -test -r /usr/share/misc/config.sub && \
++ cp -r /usr/share/misc/config.sub config.sub
++ -test -r /usr/share/misc/config.guess && \
++ cp -r /usr/share/misc/config.guess config.guess
++
++ dh_clean
++
++install: build
++ dh_testdir
++ dh_testroot
++ dh_clean -k
++ dh_installdirs
++
++ # Add here commands to install the package into debian/tmp
++ $(MAKE) install prefix=$(CURDIR)/debian/libglib1.2/usr
++
++ # for -dbg
++ mkdir -p $(CURDIR)/debian/libglib1.2/usr/lib/debug
++ for l in `find $(CURDIR)/debian/libglib1.2/usr/lib -name '*.so*'`; do \
++ cp -vdf $$l \
++ $(CURDIR)/debian/libglib1.2/usr/lib/debug/; \
++ done
++
++ dh_movefiles --sourcedir=debian/libglib1.2
++ -find $(CURDIR)/debian/ -type d -empty | xargs rmdir -p 2>&1 > /dev/null
++
++# Build architecture-independent files here.
++binary-indep: build install
++ dh_testdir -i
++ dh_testroot -i
++
++ dh_installdocs -i
++
++ dh_installexamples -i
++ dh_installinfo -i
++ dh_installchangelogs -i ChangeLog
++ dh_compress -i
++ dh_fixperms -i
++ dh_installdeb -i
++ dh_gencontrol -i
++ dh_md5sums -i
++ dh_builddeb -i
++
++# Build architecture-dependent files here.
++binary-arch: build install
++ dh_testdir -a
++ dh_testroot -a
++
++# dh_installdebconf
++ dh_installdocs -a
++ dh_installexamples -a
++ dh_installmenu -a
++# dh_installlogrotate
++# dh_installemacsen
++# dh_installpam
++# dh_installmime
++# dh_installinit
++# dh_installcron
++ dh_installman -a
++ dh_installinfo -a
++# dh_undocumented
++ dh_installchangelogs -a ChangeLog
++ dh_link -a
++ dh_strip -a -Nlibglib1.2-dbg
++ dh_compress -a
++ dh_fixperms -a
++ dh_makeshlibs -a -Nlibglib1.2-dbg
++ dh_makeshlibs -n -plibglib1.2 -V 'libglib1.2 (>= 1.2.0)'
++ dh_installdeb -a
++# dh_perl
++ dh_shlibdeps -a
++ dh_gencontrol -a
++ dh_md5sums -a
++ dh_builddeb -a
++
++binary: binary-indep binary-arch
++.PHONY: build clean binary-indep binary-arch binary install
+--- glib1.2-1.2.10.orig/debian/docs
++++ glib1.2-1.2.10/debian/docs
+@@ -0,0 +1,2 @@
++NEWS
++README
+--- glib1.2-1.2.10.orig/debian/README.Debian
++++ glib1.2-1.2.10/debian/README.Debian
+@@ -0,0 +1,25 @@
++glib for Debian
++----------------------
++
++This is GLib version 1.2. GLib, is a library which includes support
++routines for C such as lists, trees, hashes, memory allocation, and
++many other things.
++
++Versions of GLib prior to 1.1 are distributed with GTK+ versions 1.1.0
++and earlier.
++
++The GIMP Tool Kit (gtk) is a set of widgets to help you program
++programs for the X Windowing System easily and powerfully.
++
++gtk is the moving force behind The GNU Image Manipulation Program (The
++GIMP) -- the number one freely-available image editing and creation
++program available.
++
++gtk is rapidly under development, and the source tree has officially
++been separated from The GIMP now, as other teams of programmers
++are beginning to write software using its great widget set -- like
++GNOME, a desktop interface for X, and gzilla, a freely available
++web browser for X.
++
++Ben Gertzfield <che@debian.org>, Mon, 29 Sep 1997 13:11:45 -0700
++
+--- glib1.2-1.2.10.orig/debian/changelog
++++ glib1.2-1.2.10/debian/changelog
+@@ -0,0 +1,298 @@
++glib1.2 (1.2.10-9) unstable; urgency=low
++
++ * debian/control:
++ - bumped Standards-Version to 3.5.10.0.
++ - changed the sections for libglib1.2-dev and libglib1.2-dbg to libdevel.
++ * debian/compat:
++ - use it instead of DH_COMPAT.
++ * gmodule/Makefile.in, gthread/Makefile.in:
++ fix the undefined non-weak symbols. (closes: Bug#193347)
++
++ -- Akira TAGOH <tagoh@debian.org> Sun, 18 May 2003 00:00:17 +0900
++
++glib1.2 (1.2.10-8) unstable; urgency=low
++
++ * Fixed libtool issue on mispel. (closes: Bug#183793)
++ * acinclude.m4, ltconfig:
++ - removed. it contained the old libtool stuff.
++
++ -- Akira TAGOH <tagoh@debian.org> Tue, 11 Mar 2003 23:36:10 +0900
++
++glib1.2 (1.2.10-7) unstable; urgency=low
++
++ * debian/rules:
++ - fix twice modified the maintainer script for dh_installdocs.
++ - support DEB_HOST_GNU_TYPE and DEB_BUILD_GNU_TYPE.
++ - support noopt and nostrip for DEB_BUILD_OPTIONS.
++ - copy the latest config.sub and config.guess. (closes: Bug#181942)
++ - don't call ldconfig for -dbg package.
++ * debian/control:
++ - bumped Standards-Version to 3.5.8.
++ - updated Build-Depends.
++ - split the documentation files into libglib1.2-doc.
++ * debian/libglib1.2-doc.info: add glib.info. (closes: Bug#159677)
++
++ -- Akira TAGOH <tagoh@debian.org> Thu, 27 Feb 2003 00:12:39 +0900
++
++glib1.2 (1.2.10-6) unstable; urgency=low
++
++ * debian/control:
++ - removed libc6-dev from Build-Depends.
++ - changed libc6-dev to libc6-dev | libc-dev in -dev's Depends.
++
++ -- Akira TAGOH <tagoh@debian.org> Thu, 22 Aug 2002 02:02:32 +0900
++
++glib1.2 (1.2.10-5) unstable; urgency=low
++
++ * debian/control: add libc6-dev to Depends for -dev (closes: Bug#147653)
++
++ -- Akira TAGOH <tagoh@debian.org> Wed, 22 May 2002 23:58:14 +0900
++
++glib1.2 (1.2.10-4) unstable; urgency=low
++
++ * debian/control: Fixed build-depends for NetBSD/i386 (closes: Bug#133443)
++
++ -- Akira TAGOH <tagoh@debian.org> Wed, 13 Feb 2002 02:22:20 +0900
++
++glib1.2 (1.2.10-3) unstable; urgency=low
++
++ * Closed a NMU bug. (closes: Bug#93932)
++ * Fixed description typo (closes: Bug#102988)
++ * -dbg package contains shared libraries for debugging. so if you
++ need static link, add -static to compiler option and use
++ static libraries which is included in libglib1.2-dev.
++
++ -- Akira TAGOH <tagoh@debian.org> Sat, 24 Nov 2001 20:54:25 +0900
++
++glib1.2 (1.2.10-2) unstable; urgency=low
++
++ * I took over this package from Ben.
++ * Closed a bug because it is already fixed in the latest release.
++ (closes: Bug#62463)
++
++ -- Akira TAGOH <tagoh@debian.org> Sat, 10 Nov 2001 19:49:14 +0900
++
++glib1.2 (1.2.10-1.2) unstable; urgency=low
++
++ * Non-Maintainer Upload, approved by Ben.
++ * Updated config.sub and config.guess for ia64 (closes: #93932).
++ * If -dev's postinst fails at install-info, have a look at Bug#99816.
++
++ -- Jordi Mallach <jordi@debian.org> Sat, 23 Jun 2001 05:28:15 +0200
++
++glib1.2 (1.2.10-1.1) unstable; urgency=low
++
++ * Binary-only rebuild because of gcc 2.95 atexit() problem on i386.
++ (Closes: #93052)
++
++ -- Ben Gertzfield <che@debian.org> Wed, 11 Apr 2001 19:46:27 -0700
++
++glib1.2 (1.2.10-1) unstable; urgency=low
++
++ * New upstream version.
++ * Patch config.sub for s390 architecture. (Closes: #88553)
++
++ -- Ben Gertzfield <che@debian.org> Sun, 1 Apr 2001 21:44:47 -0700
++
++glib1.2 (1.2.9-1) unstable; urgency=low
++
++ * New upstream version.
++ * Include upstream changelog. (Closes: #59744)
++ * Note that the include files have been moved (according to
++ upstream) to /usr/include/glib-1.2/, but this should not be a
++ problem for anything using glib-config. Please, PLEASE, don't
++ submit bugs on my poor packages because your program isn't using
++ glib-config!
++ * Fix bashisms in debian/rules. (Hah, caught 'em on my own..)
++
++ -- Ben Gertzfield <che@debian.org> Fri, 2 Mar 2001 16:18:36 -0800
++
++glib1.2 (1.2.8-2) unstable; urgency=low
++
++ * Bump Standards-Version to 3.2.1.
++
++ -- Ben Gertzfield <che@debian.org> Sat, 23 Dec 2000 01:31:39 -0800
++
++glib1.2 (1.2.8-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Wed, 24 May 2000 19:41:54 -0700
++
++glib1.2 (1.2.7-2) frozen unstable; urgency=medium
++
++ * Fix "guard code" in configure.in that tests for gcc version
++ greater than 2.8 (will fail when 3.0 comes out.) This fixes
++ *half* of the release-critical bug report #55246.
++ * The other half of RC bug #55246 is not really a glib problem;
++ G_GNUC_EXTENSION arguably should be defined on all platforms, but
++ that's up to upstream to change this. It's been reported upstream as
++ gnome bug #6328, http://bugs.gnome.org/db/63/6328.html. In any case,
++ gentoo should be using G_GINT64_CONSTANT(12345) for portably declaring
++ 64-bit constants, instead of the undocumented, internal,
++ not-defined-on-all-platforms G_GNUC_EXTENSION. I will be reassigning
++ the remainder of RC bug #55246 to gentoo.
++
++ -- Ben Gertzfield <che@debian.org> Mon, 28 Feb 2000 12:33:57 -0800
++
++glib1.2 (1.2.7-1) frozen unstable; urgency=low
++
++ * To fix i18n problems with GTK+, glib 1.2.7 and gtk+ 1.2.7
++ must both make it into frozen.
++ * (New upstream version, too. :)
++
++ -- Ben Gertzfield <che@debian.org> Thu, 17 Feb 2000 09:12:20 -0800
++
++glib1.2 (1.2.6-1) unstable; urgency=low
++
++ * New upstream version.
++ * Make sure docs are in /usr/share/doc/libglib1.2 etc.
++
++ -- Ben Gertzfield <che@debian.org> Fri, 15 Oct 1999 09:44:19 -0700
++
++glib1.2 (1.2.5-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Fri, 24 Sep 1999 09:27:25 -0700
++
++glib1.2 (1.2.4-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Tue, 24 Aug 1999 11:10:11 -0700
++
++glib1.2 (1.2.3-2) unstable; urgency=low
++
++ * Erg. Make sure -dev depends on exact version of lib, and -dbg
++ depends on exact version of -dev and lib.
++
++ -- Ben Gertzfield <che@debian.org> Tue, 27 Jul 1999 15:24:33 -0700
++
++glib1.2 (1.2.3-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Tue, 11 May 1999 20:55:00 -0700
++
++glib1.2 (1.2.2-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Mon, 26 Apr 1999 18:15:06 -0700
++
++glib1.2 (1.2.1-2) unstable; urgency=low
++
++ * Recompile with GNU libc 2.1.
++
++ -- Ben Gertzfield <che@debian.org> Thu, 15 Apr 1999 13:26:50 -0700
++
++glib1.2 (1.2.1-1) unstable; urgency=low
++
++ * New upstream version.
++ * Make the shlibs looser; now packages depend on libglib1.2 (>= 1.2.0)
++
++ -- Ben Gertzfield <che@debian.org> Thu, 25 Mar 1999 10:33:26 -0800
++
++glib1.2 (1.2.0-1) unstable; urgency=low
++
++ * Hallelujah! :) We made it.
++
++ -- Ben Gertzfield <che@debian.org> Thu, 25 Feb 1999 22:17:36 -0800
++
++glib1.1.16 (1.1.16-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Tue, 16 Feb 1999 16:55:07 -0800
++
++glib1.1.13 (1.1.13-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Wed, 20 Jan 1999 18:25:48 -0800
++
++glib1.1.12 (1.1.12-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Mon, 4 Jan 1999 14:13:59 -0800
++
++glib1.1.11 (1.1.11-1) unstable; urgency=low
++
++ * New upstream version. (They skipped .10.)
++
++ -- Ben Gertzfield <che@debian.org> Wed, 30 Dec 1998 21:46:40 -0800
++
++glib1.1.9 (1.1.9-1) unstable; urgency=low
++
++ * New upstream version.
++ * Now debian/rules uses a $(version) variable to make my life easier.
++
++ -- Ben Gertzfield <che@debian.org> Thu, 17 Dec 1998 10:36:27 -0800
++
++glib1.1.6 (1.1.6-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Tue, 8 Dec 1998 20:54:59 -0800
++
++glib1.1.5 (1.1.5-2) unstable; urgency=low
++
++ * Now libglib1.1.5-dev Provides: libglib-dev and libglib1.1-dev.
++
++ -- Ben Gertzfield <che@debian.org> Sun, 29 Nov 1998 17:59:52 -0800
++
++glib1.1.5 (1.1.5-1) unstable; urgency=low
++
++ * Now the source and binary packages *all* specifically have the version
++ number in them. This is so a new release of glib or gtk+ does not break
++ all apps dependant upon glib or gtk+'s unstable branch.
++ * Removed --enable-debug=no from libglib1.1 build; it was causing problems
++
++ -- Ben Gertzfield <che@debian.org> Tue, 24 Nov 1998 14:25:15 -0800
++
++glib (1.1.4-1) unstable; urgency=low
++
++ * New upstream version.
++ * debian/control: libglib-dev and libglib-dbg now depend on ${Source-Version}
++ of libglib1.1 to make upgrades force you to have one version of the library
++ and -dev and -dbg, no more multiple versions allowed.
++
++ -- Ben Gertzfield <che@debian.org> Thu, 5 Nov 1998 10:50:03 -0800
++
++glib (1.1.3-2) unstable; urgency=low
++
++ * Rebuild with new clean-dbg target to fix my error helped along by
++ an old broken debhelper.
++
++ -- Ben Gertzfield <che@debian.org> Tue, 29 Sep 1998 13:01:24 -0700
++
++glib (1.1.3-1) unstable; urgency=low
++
++ * New upstream version.
++ * New libglib-dbg package.
++
++ -- Ben Gertzfield <che@debian.org> Mon, 21 Sep 1998 22:30:46 -0700
++
++glib (1.1.2-1) unstable; urgency=low
++
++ * New upstream version (that was fast!).
++
++ -- Ben Gertzfield <che@debian.org> Wed, 5 Aug 1998 12:13:59 -0700
++
++glib (1.1.1-1) unstable; urgency=low
++
++ * New upstream version.
++
++ -- Ben Gertzfield <che@debian.org> Tue, 4 Aug 1998 22:42:09 -0700
++
++glib (1.1.0-1) unstable; urgency=low
++
++ * Split off of GTK+ package upstream. New package.
++
++ -- Ben Gertzfield <che@debian.org> Mon, 27 Jul 1998 14:11:04 -0700
++
++Local variables:
++mode: debian-changelog
++End:
+--- glib1.2-1.2.10.orig/debian/control
++++ glib1.2-1.2.10/debian/control
+@@ -0,0 +1,73 @@
++Source: glib1.2
++Priority: optional
++Section: libs
++Maintainer: Akira TAGOH <tagoh@debian.org>
++Standards-Version: 3.5.10.0
++Build-Depends: debhelper (>> 4.0.0), libpth-dev [netbsd-i386], autotools-dev
++
++Package: libglib1.2
++Architecture: any
++Section: libs
++Depends: ${shlibs:Depends}
++Replaces: libgtk-doc
++Description: The GLib library of C routines
++ GLib is a library containing many useful C routines for things such
++ as trees, hashes, and lists. GLib was previously distributed with
++ the GTK+ toolkit, but has been split off as of the developers' version
++ 1.1.0.
++ .
++ You do not need to install this package if you have libgtk1 (note 1,
++ not 1.1 or 1.2) installed. libgtk1 included libglib in it. libgtk1.1
++ and libgtk1.2, however, do need libglib1.1 to be installed separately.
++
++Package: libglib1.2-dev
++Architecture: any
++Section: libdevel
++Depends: libglib1.2 (= ${Source-Version}), libc6-dev | libc-dev, pkg-config
++Conflicts: libglib-dev, libglib1.1.5-dev, libglib1.1.7-dev, libglib1.1.8-dev, libglib1.1.9-dev, libglib1.1.10-dev, libglib1.1.11-dev, libglib1.1.12-dev, libglib1.1.13-dev, libglib1.1.16-dev, libglib1.2 (<< 1.2.10-3)
++Provides: libglib-dev, libglib1.1-dev
++Replaces: libgtk-doc, libglib1.1.5-dev, libglib1.1.6-dev, libglib1.1.9-dev, libglib1.1.11-dev, libglib1.1.12-dev, libglib1.1.13-dev, libglib1.1.16-dev, libglib1.2 (<< 1.2.10-3)
++Suggests: libglib1.2-doc
++Description: Development files for GLib library
++ GLib is a library containing many useful C routines for things such
++ as trees, hashes, and lists. GLib was previously distributed with
++ the GTK+ toolkit, but has been split off as of the developers' version
++ 1.1.0.
++ .
++ This package contains the header files and static libraries for the
++ GLib C library
++
++Package: libglib1.2-dbg
++Architecture: any
++Section: libdevel
++Priority: extra
++Conflicts: libgtk-dev
++Depends: libglib1.2 (= ${Source-Version})
++Conflicts: libglib-dbg, libglib1.1.5-dbg, libglib1.1.7-dbg, libglib1.1.8-dbg, libglib1.1.9-dbg, libglib1.1.11-dbg, libglib1.1.12-dbg, libglib1.1.13-dbg, libglib1.1.16-dbg
++Replaces: libglib1.1.5-dbg, libglib1.1.6-dbg, libglib1.1.9-dbg, libglib1.1.11-dbg, libglib1.1.12-dbg, libglib1.1.13-dbg, libglib1.1.16-dbg
++Description: GLib libraries and debugging symbols
++ GLib is a library containing many useful C routines for things such
++ as trees, hashes, and lists. GLib was previously distributed with
++ the GTK+ toolkit, but has been split off as of the developers' version
++ 1.1.0.
++ .
++ This package contains unstripped shared libraries. it is provided
++ primarily to provide a backtrace with names in a debugger, this makes
++ it somewhat easier to interpret core dumps. The libraries are installed
++ in /usr/lib/debug and can be used by placing that directory in
++ LD_LIBRARY_PATH.
++ Most people will not need this package.
++
++Package: libglib1.2-doc
++Architecture: all
++Section: doc
++Depends: lynx | www-browser
++Description: Documentation files for the GLib library version 1.2
++ GLib is a library containing many useful C routines for things such
++ as trees, hashes, and lists. GLib was previously distributed with
++ the GTK+ toolkit, but has been split off as of the developers' version
++ 1.1.0.
++ .
++ This package contains the documentation files for the GLib library
++ in /usr/share/doc/libglib1.2-doc/ .
++
+--- glib1.2-1.2.10.orig/debian/copyright
++++ glib1.2-1.2.10/debian/copyright
+@@ -0,0 +1,8 @@
++This package was debianized by Ben Gertzfield <che@debian.org>
++on Mon, 27 Jul 1998 14:17:44 -0700
++
++GIMP's source may be fetched from http://www.gimp.org/ .
++
++It may be redistributed under the terms of the GNU LGPL, Version 2 or
++later, found on Debian systems in the file /usr/share/common-licenses/LGPL-2.
++
+--- glib1.2-1.2.10.orig/debian/compat
++++ glib1.2-1.2.10/debian/compat
+@@ -0,0 +1 @@
++4
+--- glib1.2-1.2.10.orig/debian/libglib1.2-dbg.dirs
++++ glib1.2-1.2.10/debian/libglib1.2-dbg.dirs
+@@ -0,0 +1 @@
++usr/lib/debug
+--- glib1.2-1.2.10.orig/debian/libglib1.2-dbg.files
++++ glib1.2-1.2.10/debian/libglib1.2-dbg.files
+@@ -0,0 +1 @@
++usr/lib/debug/*.so*
+--- glib1.2-1.2.10.orig/debian/libglib1.2-dev.dirs
++++ glib1.2-1.2.10/debian/libglib1.2-dev.dirs
+@@ -0,0 +1,4 @@
++usr/include
++usr/lib
++usr/lib/pkgconfig
++
+--- glib1.2-1.2.10.orig/debian/libglib1.2-doc.doc-base
++++ glib1.2-1.2.10/debian/libglib1.2-doc.doc-base
+@@ -0,0 +1,16 @@
++Document: glib-docs
++Title: GLib C library documentation
++Author: Gregory McLean
++Abstract: Library reference for GLib C library of useful functions
++ This document goes into detail on each function of the GLib C
++ library of useful functions to deal with common structures like
++ lists, trees, et cetera.
++Section: Apps/Programming
++
++Format: texinfo
++Files: /usr/share/doc/libglib1.2-doc/glib.texi.gz
++
++Format: HTML
++Index: /usr/share/doc/libglib1.2-doc/glib_toc.html
++Files: /usr/share/doc/libglib1.2-doc/glib.html
++
+--- glib1.2-1.2.10.orig/debian/libglib1.2-dev.files
++++ glib1.2-1.2.10/debian/libglib1.2-dev.files
+@@ -0,0 +1,7 @@
++usr/bin/glib-config
++usr/include/*
++usr/lib/lib*.{so,la,a}
++usr/lib/glib/include/*
++usr/lib/pkgconfig/*.pc
++usr/share/aclocal/*m4
++usr/share/man/man1/glib-config.1*
+--- glib1.2-1.2.10.orig/debian/libglib1.2-doc.dirs
++++ glib1.2-1.2.10/debian/libglib1.2-doc.dirs
+@@ -0,0 +1 @@
++usr/share/doc/libglib1.2-doc
+--- glib1.2-1.2.10.orig/debian/libglib1.2-doc.files
++++ glib1.2-1.2.10/debian/libglib1.2-doc.files
+@@ -0,0 +1,2 @@
++usr/share/doc/libglib1.2-doc/*
++usr/share/info/*
+--- glib1.2-1.2.10.orig/debian/libglib1.2-doc.docs
++++ glib1.2-1.2.10/debian/libglib1.2-doc.docs
+@@ -0,0 +1,2 @@
++docs/*.html
++docs/*.texi
+--- glib1.2-1.2.10.orig/debian/libglib1.2-doc.info
++++ glib1.2-1.2.10/debian/libglib1.2-doc.info
+@@ -0,0 +1 @@
++docs/glib.info
+--- glib1.2-1.2.10.orig/glibconfig.h
++++ glib1.2-1.2.10/glibconfig.h
+@@ -0,0 +1,131 @@
++/* glibconfig.h
++ *
++ * This is a generated file. Please modify `configure.in'
++ */
++
++#ifndef GLIBCONFIG_H
++#define GLIBCONFIG_H
++
++#include <limits.h>
++#include <float.h>
++#define GLIB_HAVE_SYS_POLL_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
++#define G_MINFLOAT FLT_MIN
++#define G_MAXFLOAT FLT_MAX
++#define G_MINDOUBLE DBL_MIN
++#define G_MAXDOUBLE DBL_MAX
++#define G_MINSHORT SHRT_MIN
++#define G_MAXSHORT SHRT_MAX
++#define G_MININT INT_MIN
++#define G_MAXINT INT_MAX
++#define G_MINLONG LONG_MIN
++#define G_MAXLONG LONG_MAX
++
++typedef signed char gint8;
++typedef unsigned char guint8;
++typedef signed short gint16;
++typedef unsigned short guint16;
++typedef signed int gint32;
++typedef unsigned int guint32;
++
++#if defined (__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
++# define G_GNUC_EXTENSION __extension__
++#else
++# define G_GNUC_EXTENSION
++#endif
++
++#define G_HAVE_GINT64 1
++
++G_GNUC_EXTENSION typedef signed long long gint64;
++G_GNUC_EXTENSION typedef unsigned long long guint64;
++
++#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL))
++
++#define GPOINTER_TO_INT(p) ((gint) (p))
++#define GPOINTER_TO_UINT(p) ((guint) (p))
++
++#define GINT_TO_POINTER(i) ((gpointer) (i))
++#define GUINT_TO_POINTER(u) ((gpointer) (u))
++
++#ifdef NeXT /* @#%@! NeXTStep */
++# define g_ATEXIT(proc) (!atexit (proc))
++#else
++# define g_ATEXIT(proc) (atexit (proc))
++#endif
++
++#define g_memmove(d,s,n) G_STMT_START { memmove ((d), (s), (n)); } G_STMT_END
++
++#define GLIB_MAJOR_VERSION 1
++#define GLIB_MINOR_VERSION 2
++#define GLIB_MICRO_VERSION 10
++
++
++#define G_VA_COPY __va_copy
++
++#ifdef __cplusplus
++#define G_HAVE_INLINE 1
++#else /* !__cplusplus */
++#define G_HAVE_INLINE 1
++#define G_HAVE___INLINE 1
++#define G_HAVE___INLINE__ 1
++#endif /* !__cplusplus */
++
++#define G_THREADS_ENABLED
++#define G_THREADS_IMPL_POSIX
++typedef struct _GStaticMutex GStaticMutex;
++struct _GStaticMutex
++{
++ struct _GMutex *runtime_mutex;
++ union {
++ char pad[24];
++ double dummy_double;
++ void *dummy_pointer;
++ long dummy_long;
++ } aligned_pad_u;
++};
++#define G_STATIC_MUTEX_INIT { NULL, { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } }
++#define g_static_mutex_get_mutex(mutex) (g_thread_use_default_impl ? ((GMutex*) &((mutex)->aligned_pad_u)) : g_static_mutex_get_mutex_impl (&((mutex)->runtime_mutex)))
++
++#define GINT16_TO_LE(val) ((gint16) (val))
++#define GUINT16_TO_LE(val) ((guint16) (val))
++#define GINT16_TO_BE(val) ((gint16) GUINT16_SWAP_LE_BE (val))
++#define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val))
++#define GINT32_TO_LE(val) ((gint32) (val))
++#define GUINT32_TO_LE(val) ((guint32) (val))
++#define GINT32_TO_BE(val) ((gint32) GUINT32_SWAP_LE_BE (val))
++#define GUINT32_TO_BE(val) (GUINT32_SWAP_LE_BE (val))
++#define GINT64_TO_LE(val) ((gint64) (val))
++#define GUINT64_TO_LE(val) ((guint64) (val))
++#define GINT64_TO_BE(val) ((gint64) GUINT64_SWAP_LE_BE (val))
++#define GUINT64_TO_BE(val) (GUINT64_SWAP_LE_BE (val))
++#define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val))
++#define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val))
++#define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val))
++#define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val))
++#define GINT_TO_LE(val) ((gint) GINT32_TO_LE (val))
++#define GUINT_TO_LE(val) ((guint) GUINT32_TO_LE (val))
++#define GINT_TO_BE(val) ((gint) GINT32_TO_BE (val))
++#define GUINT_TO_BE(val) ((guint) GUINT32_TO_BE (val))
++#define G_BYTE_ORDER G_LITTLE_ENDIAN
++
++#define GLIB_SYSDEF_POLLIN =1
++#define GLIB_SYSDEF_POLLOUT =4
++#define GLIB_SYSDEF_POLLPRI =2
++#define GLIB_SYSDEF_POLLERR =8
++#define GLIB_SYSDEF_POLLHUP =16
++#define GLIB_SYSDEF_POLLNVAL =32
++
++
++#define G_HAVE_WCHAR_H 1
++#define G_HAVE_WCTYPE_H 1
++
++
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
++
++#endif /* GLIBCONFIG_H */
+--- glib1.2-1.2.10.orig/stamp-gc-h
++++ glib1.2-1.2.10/stamp-gc-h
+@@ -0,0 +1 @@
++timestamp
+--- glib1.2-1.2.10.orig/glibconfig-sysdefs.h
++++ glib1.2-1.2.10/glibconfig-sysdefs.h
+@@ -0,0 +1,6 @@
++#define GLIB_SYSDEF_POLLIN =1
++#define GLIB_SYSDEF_POLLOUT =4
++#define GLIB_SYSDEF_POLLPRI =2
++#define GLIB_SYSDEF_POLLERR =8
++#define GLIB_SYSDEF_POLLHUP =16
++#define GLIB_SYSDEF_POLLNVAL =32
diff --git a/package/glib/patches/02-cross-compile-fix.patch b/package/glib/patches/02-cross-compile-fix.patch
new file mode 100644
index 000000000..e3d68a015
--- /dev/null
+++ b/package/glib/patches/02-cross-compile-fix.patch
@@ -0,0 +1,210 @@
+diff -urN glib-1.2.10.old/configure glib-1.2.10/configure
+--- glib-1.2.10.old/configure 2005-04-03 01:09:18.000000000 +0200
++++ glib-1.2.10/configure 2005-04-03 01:09:37.000000000 +0200
+@@ -6025,7 +6025,7 @@
+ glib_save_LIBS=$LIBS
+ LIBS="$LIBS -lm"
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6032 "configure"
+@@ -6043,7 +6043,7 @@
+ glib_save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -std1"
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6050 "configure"
+@@ -6390,7 +6390,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6397 "configure"
+@@ -6430,7 +6430,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6437 "configure"
+@@ -6470,7 +6470,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6477 "configure"
+@@ -6510,7 +6510,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6517 "configure"
+@@ -6550,7 +6550,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6557 "configure"
+@@ -6590,7 +6590,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6597 "configure"
+@@ -6708,7 +6708,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6715 "configure"
+@@ -6749,7 +6749,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6756 "configure"
+@@ -6790,7 +6790,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6797 "configure"
+@@ -6876,7 +6876,7 @@
+ rm -f conftest*
+ if test $ac_cv_c_bigendian = unknown; then
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 6883 "configure"
+@@ -7767,7 +7767,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 7774 "configure"
+@@ -7809,7 +7809,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 7816 "configure"
+@@ -7854,7 +7854,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 7861 "configure"
+@@ -7899,7 +7899,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 7906 "configure"
+@@ -8254,7 +8254,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 8261 "configure"
+@@ -8306,7 +8306,7 @@
+ else
+
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 8313 "configure"
+@@ -9137,7 +9137,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 9144 "configure"
+@@ -9237,7 +9237,7 @@
+ echo "configure:9238: checking whether pthread_mutex_trylock is posix like" >&5
+ # DCE Threads return 1 as success, posix 0. what a mess.
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 9244 "configure"
+@@ -9267,7 +9267,7 @@
+ echo "configure:9268: checking whether pthread_cond_timedwait is posix like" >&5
+ # DCE Threads return -1 as failure, posix ETIMEDOUT.
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 9274 "configure"
+@@ -9332,7 +9332,7 @@
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 9339 "configure"
+@@ -9452,7 +9452,7 @@
+ done
+ echo "return 0; }" >>confrun.c
+ if test "$cross_compiling" = yes; then
+- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
++ { echo "configure: error: can not run test program while cross compiling" 1>&2; }
+ else
+ cat > conftest.$ac_ext <<EOF
+ #line 9459 "configure"
diff --git a/package/glib/patches/03-use-glibconfig-sysdefs.patch b/package/glib/patches/03-use-glibconfig-sysdefs.patch
new file mode 100644
index 000000000..932d7c380
--- /dev/null
+++ b/package/glib/patches/03-use-glibconfig-sysdefs.patch
@@ -0,0 +1,31 @@
+diff -urN glib-1.2.10.old/glib.h glib-1.2.10/glib.h
+--- glib-1.2.10.old/glib.h 2001-02-27 04:44:38.000000000 +0100
++++ glib-1.2.10/glib.h 2005-04-03 01:43:17.000000000 +0200
+@@ -63,6 +63,7 @@
+ * exist. The prototype looks like the above, give or take a const,
+ * or size_t.
+ */
++#include <glibconfig-sysdefs.h>
+ #include <glibconfig.h>
+
+ /* include varargs functions for assertment macros
+diff -urN glib-1.2.10.old/configure glib-1.2.10/configure
+--- glib-1.2.10.old/configure 2005-04-03 01:43:49.000000000 +0200
++++ glib-1.2.10/configure 2005-04-03 01:45:47.000000000 +0200
+@@ -575,16 +575,6 @@
+ # Save this value here, since automake will set cflags later
+ cflags_set=${CFLAGS+set}
+
+-# we rewrite this file
+-rm -f glibconfig-sysdefs.h
+-
+-
+-
+-
+-
+-
+-
+-
+
+ # libtool versioning
+ LT_RELEASE=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION
diff --git a/package/glib/patches/04-gcc3.4-fix.patch b/package/glib/patches/04-gcc3.4-fix.patch
new file mode 100644
index 000000000..d2d3f5b6f
--- /dev/null
+++ b/package/glib/patches/04-gcc3.4-fix.patch
@@ -0,0 +1,22 @@
+Submitted By: Uwe Düffert (lfs at uwe-dueffert dot de)
+Date: 2004-05-15
+Initial Package Version: 1.2.10
+Origin: self-created, http://www.uwe-dueffert.de/lfs/ownpatches/glib-1.2.10-gcc34-1.patch
+Upstream Status: not reported
+Description: fix compilation of glib1 with gcc34
+
+$LastChangedBy: mbm $
+$Date: 2006-02-02 00:53:19 +0100 (Thu, 02 Feb 2006) $
+
+diff -Naur glib-1.2.10.orig/gstrfuncs.c glib-1.2.10/gstrfuncs.c
+--- glib-1.2.10.orig/gstrfuncs.c 2004-05-15 13:40:03.556092792 +0000
++++ glib-1.2.10/gstrfuncs.c 2004-05-15 13:40:36.712052320 +0000
+@@ -47,6 +47,8 @@
+ * inteferes with g_strsignal() on some OSes
+ */
+
++#define G_GNUC_PRETTY_FUNCTION
++
+ typedef union _GDoubleIEEE754 GDoubleIEEE754;
+ #define G_IEEE754_DOUBLE_BIAS (1023)
+ /* multiply with base2 exponent to get base10 exponent (nomal numbers) */
diff --git a/package/glib2/Config.in b/package/glib2/Config.in
new file mode 100644
index 000000000..7d4e91ff5
--- /dev/null
+++ b/package/glib2/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_GLIB2
+ prompt "glib2............................. some broken toolkit"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBICONV
+ select ADK_PACKAGE_GETTEXT
diff --git a/package/glib2/Makefile b/package/glib2/Makefile
new file mode 100644
index 000000000..ed13a26c2
--- /dev/null
+++ b/package/glib2/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= glib2
+PKG_VERSION= 2.18.1
+PKG_RELEASE= 1
+PKG_MD5SUM= d53836f7fdd9970d03e255e9d712bd83
+DISTFILES= glib-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/glib-${PKG_VERSION}
+MASTER_SITES= ftp://ftp.gtk.org/pub/glib/2.18/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GLIB2,glib2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TCPPFLAGS+= -I'${STAGING_DIR}/usr/include'
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-debug=no \
+ --disable-mem-pools \
+ --disable-rebuilds \
+ --with-libiconv=gnu \
+ --with-threads=posix
+CONFIGURE_ENV+= glib_cv_long_long_format=ll \
+ glib_cv_stack_grows=no \
+ glib_cv_have_strlcpy=no \
+ glib_cv_uscore=no \
+ ac_cv_func_posix_getpwuid_r=yes \
+ ac_cv_func_posix_getgrgid_r=yes
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GLIB2}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/lib*.so.* ${IDIR_GLIB2}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/glib2/ipkg/glib2.control b/package/glib2/ipkg/glib2.control
new file mode 100644
index 000000000..c3dbc208b
--- /dev/null
+++ b/package/glib2/ipkg/glib2.control
@@ -0,0 +1,5 @@
+Package: glib2
+Priority: optional
+Section: libs
+Description: some broken toolkit
+Depends: gettext, libiconv, libpthread
diff --git a/package/glibc/Config.in b/package/glibc/Config.in
new file mode 100644
index 000000000..d16cd8637
--- /dev/null
+++ b/package/glibc/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_GLIBC
+ prompt "glibc............................... GNU C library"
+ tristate
+ default y if ADK_TARGET_LIB_GLIBC
+ default n
+ depends on ADK_TARGET_LIB_GLIBC
+ help
+ GNU C library.
+
diff --git a/package/glibc/Makefile b/package/glibc/Makefile
new file mode 100644
index 000000000..b1ba2f93b
--- /dev/null
+++ b/package/glibc/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/toolchain/glibc/Makefile.inc
+
+NO_DISTFILES:= 1
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,GLIBC,glibc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+do-extract:
+
+# do nothing, glibc is already build in toolchain directory
+do-install:
+ ${INSTALL_DIR} $(IDIR_GLIBC)/lib $(IDIR_GLIBC)/etc
+ # install /etc/localtime from host system (FIXME)
+ ${CP} /etc/localtime $(IDIR_GLIBC)/etc
+ifeq ($(ADK_SSP),y)
+ $(CP) $(STAGING_DIR)/lib/libssp.so* $(IDIR_GLIBC)/lib/
+endif
+ $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(IDIR_GLIBC)/lib/
+ $(CP) $(STAGING_DIR)/lib/ld-*.so* $(IDIR_GLIBC)/lib/
+ -for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
+ $(CP) $(STAGING_DIR)/lib/$$file.so.* $(IDIR_GLIBC)/lib/; \
+ $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib/; \
+ done
+ # create ld.so link for ldd
+ cd $(IDIR_GLIBC)/lib && ln -sf ld-linux.so.2 ld.so
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/glibc/ipkg/glibc.control b/package/glibc/ipkg/glibc.control
new file mode 100644
index 000000000..b96c464e7
--- /dev/null
+++ b/package/glibc/ipkg/glibc.control
@@ -0,0 +1,4 @@
+Package: glibc
+Priority: optional
+Section: libs
+Description: GNU Standard C library
diff --git a/package/gmediaserver/Config.in b/package/gmediaserver/Config.in
new file mode 100644
index 000000000..fc256a0cd
--- /dev/null
+++ b/package/gmediaserver/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_GMEDIASERVER
+ prompt "gmediaserver...................... An UPnP music media server"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_ID3LIB
+ select ADK_PACKAGE_LIBUPNP
+ help
+ An UPnP music media server.
+
+ http://www.nongnu.org/gmediaserver/
+
+ Depends: id3lib, libupnp
diff --git a/package/gmediaserver/Makefile b/package/gmediaserver/Makefile
new file mode 100644
index 000000000..8fda74940
--- /dev/null
+++ b/package/gmediaserver/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gmediaserver
+PKG_VERSION:= 0.13.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c422de386331e2a1a859d45f6fa270a3
+MASTER_SITES:= http://savannah.nongnu.org/download/gmediaserver/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GMEDIASERVER,gmediaserver,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= LIBS=" -lixml -lthreadutil -lupnp -lz" \
+ am_cv_func_iconv=no
+CONFIGURE_ARGS+= --with-id3lib="${STAGING_DIR}/usr" \
+ --with-libupnp="${STAGING_DIR}/usr"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+ifeq ($(ADK_TARGET_LIB_UCLIBCXX),y)
+CONFIGURE_ENV+= LIBS=" -lixml -lthreadutil -lupnp -luClibc++ -lz"
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GMEDIASERVER}/etc/init.d
+ ${INSTALL_BIN} ./files/gmediaserver.init \
+ ${IDIR_GMEDIASERVER}/etc/init.d/gmediaserver
+ ${INSTALL_DIR} ${IDIR_GMEDIASERVER}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/gmediaserver ${IDIR_GMEDIASERVER}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gmediaserver/files/gmediaserver.init b/package/gmediaserver/files/gmediaserver.init
new file mode 100644
index 000000000..3ce0ac09d
--- /dev/null
+++ b/package/gmediaserver/files/gmediaserver.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+ autostart)
+ test x"${gmediaserver:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+ start)
+ gmediaserver $gmediaserver_flags
+ ;;
+ stop)
+ killall gmediaserver
+ ;;
+ restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 (start | stop | restart)"
+ exit 1
+esac
+exit $?
diff --git a/package/gmediaserver/ipkg/gmediaserver.control b/package/gmediaserver/ipkg/gmediaserver.control
new file mode 100644
index 000000000..6ba003f5a
--- /dev/null
+++ b/package/gmediaserver/ipkg/gmediaserver.control
@@ -0,0 +1,5 @@
+Package: gmediaserver
+Priority: optional
+Section: net
+Depends: id3lib, libupnp
+Description: An UPnP music media server.
diff --git a/package/gmediaserver/ipkg/gmediaserver.postinst b/package/gmediaserver/ipkg/gmediaserver.postinst
new file mode 100644
index 000000000..1d2338cb0
--- /dev/null
+++ b/package/gmediaserver/ipkg/gmediaserver.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf gmediaserver gmediaserver NO
+add_rcconf gmediaserver_flags gmediaserver_flags "--background --interface=eth0.0"
diff --git a/package/gmediaserver/patches/patch-src_main_c b/package/gmediaserver/patches/patch-src_main_c
new file mode 100644
index 000000000..1348a67c8
--- /dev/null
+++ b/package/gmediaserver/patches/patch-src_main_c
@@ -0,0 +1,158 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- gmediaserver-0.13.0.orig/src/main.c 2007-10-20 11:41:37.000000000 +0200
++++ gmediaserver-0.13.0/src/main.c 2008-10-28 12:14:59.000000000 +0100
+@@ -32,8 +32,10 @@
+ #include <stdbool.h> /* Gnulib, C99 */
+ #include <signal.h> /* ? */
+ #include <locale.h> /* ? */
++#ifdef HAVE_ICONV
+ #include <iconv.h> /* Gnulib, POSIX */
+ #include "striconv.h" /* Gnulib */
++#endif
+ #ifdef HAVE_NL_LANGINFO
+ #include <langinfo.h>
+ #endif
+@@ -72,9 +74,11 @@ enum {
+ static const char *short_options = "bv::i:o:p:";
+ static struct option long_options[] = {
+ { "disable-tags", no_argument, NULL, OPT_DISABLE_TAGS },
++#ifdef HAVE_ICONV
+ { "fs-charset", required_argument, NULL, OPT_FS_CHARSET },
+ { "device-charset", required_argument, NULL, OPT_DEVICE_CHARSET },
+ { "log-charset", required_argument, NULL, OPT_LOG_CHARSET },
++#endif
+ { "friendly-name", required_argument, NULL, OPT_FRIENDLY_NAME },
+ { "pid-file", required_argument, NULL, OPT_PIDFILE },
+ { "profile", required_argument, NULL, OPT_PROFILE, },
+@@ -92,14 +96,17 @@ static struct option long_options[] = {
+ { NULL, 0, NULL, 0 }
+ };
+
++#ifdef HAVE_ICONV
+ static iconv_t utf8_to_device = (iconv_t) -1;
+ static iconv_t utf8_to_log = (iconv_t) -1;
+ static iconv_t fs_to_utf8 = (iconv_t) -1;
++#endif
+ const char version_etc_copyright[] = "Copyright (C) 2005, 2006 Oskar Liljeblad.";
+
+ char *
+ convert_string_to_device(const char *str)
+ {
++#ifdef HAVE_ICONV
+ char *out;
+ if (utf8_to_device == (iconv_t) -1)
+ return xstrdup(str);
+@@ -107,12 +114,15 @@ convert_string_to_device(const char *str
+ if (out != NULL)
+ return out;
+ warn(_("%s: cannot convert to device character set: %s\n"), quotearg(str), errstr);
++#else
+ return xstrdup(str);
++#endif
+ }
+
+ char *
+ convert_string_to_log(const char *str)
+ {
++#ifdef HAVE_ICONV
+ char *out;
+
+ if (utf8_to_log == (iconv_t) -1)
+@@ -121,7 +131,9 @@ convert_string_to_log(const char *str)
+ if (out != NULL)
+ return out;
+ /* Cannot warn here - would deadlock! */
++#else
+ return xstrdup(str);
++#endif
+ }
+
+ static char *cache_fs_str = NULL;
+@@ -129,6 +141,7 @@ static char *cache_fs_str = NULL;
+ char *
+ conv_filename(const char *str)
+ {
++#ifdef HAVE_ICONV
+ free(cache_fs_str);
+ if (fs_to_utf8 == (iconv_t) -1) {
+ cache_fs_str = xstrdup(str);
+@@ -140,6 +153,9 @@ conv_filename(const char *str)
+ }
+ }
+ return cache_fs_str;
++#else
++ return xstrdup(str);
++#endif
+ }
+
+ static void
+@@ -188,8 +204,10 @@ main(int argc, char **argv)
+ set_program_name(argv[0]);
+ set_quoting_style(0, escape_quoting_style);
+
++#ifdef LOCALE
+ if (setlocale(LC_ALL, "") == NULL)
+ warn(_("cannot set locale: %s\n"), errstr);
++#endif
+ #ifdef ENABLE_NLS
+ if (bindtextdomain(PACKAGE, LOCALEDIR) == NULL)
+ warn(_("cannot bind message domain: %s\n"), errstr);
+@@ -215,6 +233,7 @@ main(int argc, char **argv)
+ case OPT_DISABLE_TAGS:
+ tags_enabled = false;
+ break;
++#ifdef HAVE_ICONV
+ case OPT_FS_CHARSET:
+ fs_charset = optarg;
+ break;
+@@ -224,6 +243,7 @@ main(int argc, char **argv)
+ case OPT_LOG_CHARSET:
+ log_charset = optarg;
+ break;
++#endif
+ case OPT_FRIENDLY_NAME:
+ if (optarg[0] == '\0')
+ die(_("friendly name cannot be empty\n"));
+@@ -294,9 +314,11 @@ main(int argc, char **argv)
+ printf(_("Run the UPnP media server.\n\n"));
+ printf(_(" --friendly-name=NAME set display name for media server\n"));
+ printf(_(" --disable-tags do not scan files for tags\n"));
++#ifdef HAVE_ICONV
+ printf(_(" --fs-charset=CHARSET character set used in file names\n"));
+ printf(_(" --device-charset=CHARSET character set used in the player device\n"));
+ printf(_(" --log-charset=CHARSET character set used in logs and display\n"));
++#endif
+ printf(_(" -v, --verbose[=LEVEL] set verbosity level (0-4)\n"));
+ printf(_(" --pid-file=FILE write pid to FILE when up and running\n"));
+ printf(_(" -i, --interface=NAME listen on a specific interface\n"));
+@@ -371,6 +393,7 @@ main(int argc, char **argv)
+ if (fs_charset == NULL && getenv("G_BROKEN_FILENAMES") != NULL)
+ fs_charset = nl_langinfo(CODESET);
+ #endif
++#ifdef HAVE_ICONV
+ if (fs_charset != NULL) {
+ fs_to_utf8 = iconv_open("UTF-8", fs_charset);
+ if (fs_to_utf8 == (iconv_t) -1)
+@@ -395,6 +418,7 @@ main(int argc, char **argv)
+ die(_("cannot create character set convertor from %s to %s\n"), "UTF-8", quotearg(log_charset));
+ }
+ say(4, _("Using log character set %s\n"), quote(log_charset == NULL ? "UTF-8" : log_charset));
++#endif
+
+ init_logging(logfilename, timestamp_format);
+
+@@ -478,12 +502,14 @@ main(int argc, char **argv)
+
+ finish_logging(true);
+
++#ifdef HAVE_ICONV
+ if (fs_to_utf8 != (iconv_t) -1)
+ iconv_close(fs_to_utf8); /* ignore errors (only EINVAL) */
+ if (utf8_to_device != (iconv_t) -1)
+ iconv_close(utf8_to_device); /* ignore errors (only EINVAL) */
+ if (utf8_to_log != (iconv_t) -1)
+ iconv_close(utf8_to_log); /* ignore errors (only EINVAL) */
++#endif
+
+ free(cache_fs_str);
+
diff --git a/package/gmp/Config.in b/package/gmp/Config.in
new file mode 100644
index 000000000..e681b6519
--- /dev/null
+++ b/package/gmp/Config.in
@@ -0,0 +1,14 @@
+config ADK_COMPILE_GMP
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBGMP
+
+config ADK_PACKAGE_LIBGMP
+ prompt "libgmp............................ GNU multiprecision arithmetic library"
+ tristate
+ default n
+ select ADK_COMPILE_GMP
+ help
+ GNU multiprecision arithmetic library
+
+ http://www.swox.com/gmp/
diff --git a/package/gmp/Makefile b/package/gmp/Makefile
new file mode 100644
index 000000000..a467fa713
--- /dev/null
+++ b/package/gmp/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gmp
+PKG_VERSION:= 4.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7ce52531644e6d12f16911b7e3151f3f
+MASTER_SITES:= ${MASTER_SITE_GNU:=gmp/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBGMP,libgmp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBGMP}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgmp.so.* ${IDIR_LIBGMP}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gmp/ipkg/libgmp.control b/package/gmp/ipkg/libgmp.control
new file mode 100644
index 000000000..169002856
--- /dev/null
+++ b/package/gmp/ipkg/libgmp.control
@@ -0,0 +1,4 @@
+Package: libgmp
+Priority: optional
+Section: net
+Description: GNU multiprecision arithmetic library
diff --git a/package/gnutls/Config.in b/package/gnutls/Config.in
new file mode 100644
index 000000000..cfc6ed4f0
--- /dev/null
+++ b/package/gnutls/Config.in
@@ -0,0 +1,97 @@
+config ADK_COMPILE_GNUTLS
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBGNUTLS
+
+config ADK_PACKAGE_LIBGNUTLS
+ prompt "libgnutls......................... The GNU TLS library"
+ tristate
+ default n
+ select ADK_COMPILE_GNUTLS
+ select ADK_PACKAGE_LIBGCRYPT
+ select ADK_PACKAGE_LIBTASN1
+ select ADK_PACKAGE_ZLIB
+ help
+ GnuTLS is a project that aims to develop a library which provides a
+ secure layer, over a reliable transport layer. Currently the GnuTLS
+ library implements the proposed standards by the IETF's TLS working
+ group.
+
+ Quoting from RFC2246 - the TLS 1.0 protocol specification:
+
+ "The TLS protocol provides communications privacy over the Internet.
+ The protocol allows client/server applications to communicate in a
+ way that is designed to prevent eavesdropping, tampering, or message
+ forgery."
+
+ Features
+ * Support for TLS 1.1 and SSL 3.0 protocols
+ * Support for TLS extensions
+ * Support for authentication using the SRP protocol
+ * Support for authentication using both X.509 certificates
+ * and OpenPGP keys Support for X.509 and OpenPGP certificate handling.
+ * Supports all the strong encryption algorithms
+
+ http://www.gnu.org/software/gnutls/
+
+ This packages contains the core GnuTLS shared library,
+ needed by other programs.
+
+config ADK_PACKAGE_LIBGNUTLS_EXTRA
+ prompt "libgnutls-extra................... The GNU TLS extra library"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBGNUTLS
+ select ADK_PACKAGE_LIBOPENCDK
+ select ADK_PACKAGE_LIBLZO
+ help
+ GnuTLS is a project that aims to develop a library which provides a
+ secure layer, over a reliable transport layer. Currently the GnuTLS
+ library implements the proposed standards by the IETF's TLS working
+ group.
+
+ This packages contains the optional "extra" GnuTLS shared
+ library, needed by other programs, which contains OpenPGP,
+ TLS/IA and LZO2 compression.
+
+config ADK_PACKAGE_LIBGNUTLS_OPENSSL
+ prompt "libgnutls-openssl................. The GNU TLS OpenSSL compatibility layer library"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBGNUTLS
+ help
+ GnuTLS is a project that aims to develop a library which provides a
+ secure layer, over a reliable transport layer. Currently the GnuTLS
+ library implements the proposed standards by the IETF's TLS working
+ group.
+
+ This packages contains the GnuTLS OpenSSL compatibility
+ layer shared library.
+
+config ADK_PACKAGE_LIBGNUTLSXX
+ prompt "libgnutlsxx....................... The GNU TLS C++ library"
+ tristate
+ default n
+ depends on ADK_CXX
+ depends ADK_PACKAGE_LIBGNUTLS
+ help
+ GnuTLS is a project that aims to develop a library which provides a
+ secure layer, over a reliable transport layer. Currently the GnuTLS
+ library implements the proposed standards by the IETF's TLS working
+ group.
+
+ This packages contains the GnuTLS C++ shared library.
+
+config ADK_PACKAGE_GNUTLS_UTILS
+ prompt "gnutls-utils...................... The GNU TLS utilities"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBGNUTLS
+ select ADK_PACKAGE_LIBGNUTLS_EXTRA
+ help
+ GnuTLS is a project that aims to develop a library which provides a
+ secure layer, over a reliable transport layer. Currently the GnuTLS
+ library implements the proposed standards by the IETF's TLS working
+ group.
+
+ This packages contains some GnuTLS command line utilities.
diff --git a/package/gnutls/Makefile b/package/gnutls/Makefile
new file mode 100644
index 000000000..1a46a3b3a
--- /dev/null
+++ b/package/gnutls/Makefile
@@ -0,0 +1,44 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gnutls
+PKG_VERSION:= 2.6.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f42e7342cf9c12755577d207fffa9713
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= ${MASTER_SITE_GNU:=gnutls/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBGNUTLS,libgnutls,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,GNUTLS_UTILS,gnutls-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBGNUTLS_EXTRA,libgnutls-extra,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBGNUTLS_OPENSSL,libgnutls-openssl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBGNUTLSXX,libgnutlsxx,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --without-libopencdk-prefix \
+ --without-libz-prefix
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBGNUTLS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgnutls.so.* ${IDIR_LIBGNUTLS}/usr/lib
+ ${INSTALL_DIR} ${IDIR_LIBGNUTLS_EXTRA}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgnutls-extra.so.* ${IDIR_LIBGNUTLS_EXTRA}/usr/lib
+ ${INSTALL_DIR} ${IDIR_LIBGNUTLS_OPENSSL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgnutls-openssl.so.* ${IDIR_LIBGNUTLS_OPENSSL}/usr/lib
+ ${INSTALL_DIR} ${IDIR_GNUTLS_UTILS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/{{cert,srp,psk}tool,gnutls-{cli,serv}} \
+ ${IDIR_GNUTLS_UTILS}/usr/bin
+ifeq ($(ADK_CXX),y)
+ ${INSTALL_DIR} ${IDIR_LIBGNUTLSXX}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgnutlsxx.so.* ${IDIR_LIBGNUTLSXX}/usr/lib
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gnutls/ipkg/gnutls-utils.control b/package/gnutls/ipkg/gnutls-utils.control
new file mode 100644
index 000000000..856d704a8
--- /dev/null
+++ b/package/gnutls/ipkg/gnutls-utils.control
@@ -0,0 +1,5 @@
+Package: gnutls-utils
+Priority: optional
+Section: admin
+Description: GNU TLS utilities
+Depends: libgnutls, libgnutls-extra
diff --git a/package/gnutls/ipkg/libgnutls-extra.control b/package/gnutls/ipkg/libgnutls-extra.control
new file mode 100644
index 000000000..332384a1b
--- /dev/null
+++ b/package/gnutls/ipkg/libgnutls-extra.control
@@ -0,0 +1,5 @@
+Package: libgnutls-extra
+Priority: optional
+Section: libs
+Description: GNU TLS extra library
+Depends: libgnutls, opencdk, liblzo
diff --git a/package/gnutls/ipkg/libgnutls-openssl.control b/package/gnutls/ipkg/libgnutls-openssl.control
new file mode 100644
index 000000000..ea06e1522
--- /dev/null
+++ b/package/gnutls/ipkg/libgnutls-openssl.control
@@ -0,0 +1,5 @@
+Package: libgnutls-openssl
+Priority: optional
+Section: libs
+Description: GNU TLS OpenSSL compatibility layer library
+Depends: libgnutls
diff --git a/package/gnutls/ipkg/libgnutls.control b/package/gnutls/ipkg/libgnutls.control
new file mode 100644
index 000000000..6c2faffee
--- /dev/null
+++ b/package/gnutls/ipkg/libgnutls.control
@@ -0,0 +1,5 @@
+Package: libgnutls
+Priority: optional
+Section: libs
+Description: GNU TLS library
+Depends: libgcrypt, libtasn1, zlib
diff --git a/package/gnutls/ipkg/libgnutlsxx.control b/package/gnutls/ipkg/libgnutlsxx.control
new file mode 100644
index 000000000..7034a5f33
--- /dev/null
+++ b/package/gnutls/ipkg/libgnutlsxx.control
@@ -0,0 +1,5 @@
+Package: libgnutlsxx
+Priority: optional
+Section: libs
+Description: GNU TLS C++ library
+Depends: libgnutls
diff --git a/package/gpg/Config.in b/package/gpg/Config.in
new file mode 100644
index 000000000..037529c5b
--- /dev/null
+++ b/package/gpg/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_GPG
+ prompt "gpg .............................. Gnu Privacy Guard"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBREADLINE
+ help
+ GPG is an encryption program
+
+ http://www.gnupg.org
diff --git a/package/gpg/Makefile b/package/gpg/Makefile
new file mode 100644
index 000000000..2fa4ea584
--- /dev/null
+++ b/package/gpg/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gnupg
+PKG_VERSION:= 1.4.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3537dedea45cc09e8d88d1ef4f774246
+MASTER_SITES:= ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/gnupg/ \
+ ftp://ftp.gnupg.org/gcrypt/gnupg/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GPG,gpg,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_c_bigendian=no \
+ ac_cv_sizeof_off_t=8
+CONFIGURE_ARGS+= --disable-asm \
+ --disable-gnupg-iconv \
+ --disable-card-support \
+ --disable-agent-support \
+ --disable-bzip2 \
+ --disable-exec \
+ --disable-ldap \
+ --disable-hkp \
+ --disable-finger \
+ --disable-ftp \
+ --disable-dns-srv \
+ --enable-fake-curl \
+ --disable-regex
+BUILD_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_GPG}/usr/bin/
+ ${INSTALL_BIN} ${WRKBUILD}/g10/gpg ${IDIR_GPG}/usr/bin/
+# we need root privileges for secure memory (locked pages)
+ chmod u+s ${IDIR_GPG}/usr/bin/gpg
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gpg/ipkg/gpg.control b/package/gpg/ipkg/gpg.control
new file mode 100644
index 000000000..8dd20f144
--- /dev/null
+++ b/package/gpg/ipkg/gpg.control
@@ -0,0 +1,5 @@
+Package: gpg
+Priority: optional
+Section: text
+Description: Gnu Privacy Guard
+Depends: libreadline
diff --git a/package/gpm/Config.in b/package/gpm/Config.in
new file mode 100644
index 000000000..9afe47f6c
--- /dev/null
+++ b/package/gpm/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_GPM
+ prompt "gpm .............................. GPM"
+ tristate
+ default n
+ help
+ http://unix.schottelius.org/gpm/
diff --git a/package/gpm/Makefile b/package/gpm/Makefile
new file mode 100644
index 000000000..0c0fd2a55
--- /dev/null
+++ b/package/gpm/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gpm
+PKG_VERSION:= 1.20.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3915bdd6bf947ef867752a30b4be2387
+MASTER_SITES:= http://unix.schottelius.org/gpm/archives/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GPM,gpm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+TCFLAGS+= -I${WRKSRC}/src/headers
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GPM}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_GPM}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/gpm ${IDIR_GPM}/usr/sbin/
+ ${CP} ${WRKINST}/usr/lib/libgpm.so.* ${IDIR_GPM}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gpm/ipkg/gpm.control b/package/gpm/ipkg/gpm.control
new file mode 100644
index 000000000..713af12a1
--- /dev/null
+++ b/package/gpm/ipkg/gpm.control
@@ -0,0 +1,4 @@
+Package: gpm
+Priority: optional
+Section: text
+Description: GPM
diff --git a/package/gpm/patches/patch-src_daemon_open_console_c b/package/gpm/patches/patch-src_daemon_open_console_c
new file mode 100644
index 000000000..28bd57e11
--- /dev/null
+++ b/package/gpm/patches/patch-src_daemon_open_console_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- gpm-1.20.5.orig/src/daemon/open_console.c 2008-06-13 10:08:19.000000000 +0200
++++ gpm-1.20.5/src/daemon/open_console.c 2008-09-16 17:11:51.000000000 +0200
+@@ -21,7 +21,7 @@
+
+ #include <fcntl.h> /* open and co. */
+ #include <sys/stat.h> /* stat() */
+-#include <stropts.h> /* ioctl */
++#include <sys/ioctl.h> /* ioctl */
+
+ /* Linux specific (to be outsourced in gpm2 */
+ #include <linux/serial.h> /* for serial console check */
diff --git a/package/gpm/patches/patch-src_synaptics_c b/package/gpm/patches/patch-src_synaptics_c
new file mode 100644
index 000000000..c442926a2
--- /dev/null
+++ b/package/gpm/patches/patch-src_synaptics_c
@@ -0,0 +1,15 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- gpm-1.20.5.orig/src/synaptics.c 2008-06-13 10:08:19.000000000 +0200
++++ gpm-1.20.5/src/synaptics.c 2008-10-09 14:07:01.000000000 +0200
+@@ -2134,9 +2134,9 @@ void tp_read_config_file (char* config_f
+ break;
+
+ case Flag_Param:
+- if (index ("YyTt1", token [0])) {
++ if (strchr ("YyTt1", token [0])) {
+ *(param_data [param].addr.flag_p) = 1;
+- } else if (index ("NnFf0", token [0])) {
++ } else if (strchr ("NnFf0", token [0])) {
+ *(param_data [param].addr.flag_p) = 0;
+ } else {
+ gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid",
diff --git a/package/gpsd/Config.in b/package/gpsd/Config.in
new file mode 100644
index 000000000..f8c3614df
--- /dev/null
+++ b/package/gpsd/Config.in
@@ -0,0 +1,26 @@
+config ADK_PACKAGE_GPSD
+ prompt "gpsd.............................. An interface daemon for GPS receivers"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ gpsd is a monitor daemon that watches a TCP/IP port (2947 by default),
+ waiting for applications to request information from GPSes or
+ differential-GPS radios attached to the host machine. Each GPS or
+ radio is expected to be direct-connected to the host via a USB or
+ RS232C serial port. The port may be specified to gpsd at startup, or
+ it may be set via a command shipped down a local control socket (e.g.
+ by a USB hotplug script). Given a GPS device by either means, gpsd
+ discovers the correct port speed and protocol for it.
+
+ http://gpsd.berlios.de/
+
+config ADK_PACKAGE_GPSD_CLIENTS
+ prompt "gpsd-clients.................... cgps and gpxlogger"
+ tristate
+ default y
+ depends on ADK_PACKAGE_GPSD
+ help
+ This enables the command-line GPS client "cgps" and
+ the "gpxlogger" tool for outputting standard GPX files.
diff --git a/package/gpsd/Makefile b/package/gpsd/Makefile
new file mode 100644
index 000000000..15e4d1305
--- /dev/null
+++ b/package/gpsd/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gpsd
+PKG_VERSION:= 2.37
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6c96cc0b2df0279cb7baac1ebc5881d3
+MASTER_SITES:= http://download.berlios.de/gpsd/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,GPSD,gpsd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,GPSD_CLIENTS,gpsd-clients,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --without-x \
+ --disable-python
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS= CXXLINK="\$$(LINK)"
+
+ifeq ($(ADK_TARGET_LIB_UCLIBCXX),y)
+TCXXFLAGS+= -fno-builtin -fno-rtti -nostdinc++
+TLDFLAGS+= -luClibc++ -lc -lm -nodefaultlibs
+else
+TLDFLAGS+= -shared
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_GPSD}/usr/lib ${IDIR_GPSD}/usr/sbin
+ ${CP} ${WRKINST}/usr/lib/libgps.so.* ${IDIR_GPSD}/usr/lib
+ ${CP} ${WRKINST}/usr/sbin/gpsd ${IDIR_GPSD}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_GPSD_CLIENTS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/{cgps,cgpxlogger} ${IDIR_GPSD_CLIENTS}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gpsd/ipkg/gpsd-clients.control b/package/gpsd/ipkg/gpsd-clients.control
new file mode 100644
index 000000000..f8a15ada8
--- /dev/null
+++ b/package/gpsd/ipkg/gpsd-clients.control
@@ -0,0 +1,5 @@
+Package: gpsd-clients
+Priority: optional
+Section: net
+Depends: gpsd
+Description: Command-line clients for the GPS daemon.
diff --git a/package/gpsd/ipkg/gpsd.control b/package/gpsd/ipkg/gpsd.control
new file mode 100644
index 000000000..94618b69c
--- /dev/null
+++ b/package/gpsd/ipkg/gpsd.control
@@ -0,0 +1,5 @@
+Package: gpsd
+Priority: optional
+Section: net
+Depends: libpthread, uclibc++
+Description: An interface daemon for GPS receivers.
diff --git a/package/gpsd/patches/patch-gpsd_h b/package/gpsd/patches/patch-gpsd_h
new file mode 100644
index 000000000..50c8db101
--- /dev/null
+++ b/package/gpsd/patches/patch-gpsd_h
@@ -0,0 +1,24 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- gpsd-2.37.orig/gpsd.h 2008-02-17 18:47:00.000000000 +0100
++++ gpsd-2.37/gpsd.h 2008-10-09 14:08:46.000000000 +0200
+@@ -22,16 +22,16 @@
+ /* #undef DBUS_ENABLE */
+ #define EARTHMATE_ENABLE 1
+ #define EVERMORE_ENABLE 1
+-/* #undef FV18_ENABLE */
++#define FV18_ENABLE 1
+ /* #undef GARMINTXT_ENABLE */
+ #define GARMIN_ENABLE 1
+ #define GPSCLOCK_ENABLE 1
+ #define ITRAX_ENABLE 1
+ #define NAVCOM_ENABLE 1
+ #define NMEA_ENABLE 1
+-/* #undef NTPSHM_ENABLE */
+-/* #undef NTRIP_ENABLE */
+-/* #undef PPS_ENABLE */
++#define NTPSHM_ENABLE 1
++#define NTRIP_ENABLE 1
++#define PPS_ENABLE 1
+ #define RTCM104_ENABLE 1
+ #define SIRF_ENABLE 1
+ /* #undef SQUELCH_ENABLE */
diff --git a/package/gpsd/patches/patch-sirfflash_c b/package/gpsd/patches/patch-sirfflash_c
new file mode 100644
index 000000000..3664b374f
--- /dev/null
+++ b/package/gpsd/patches/patch-sirfflash_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- gpsd-2.37.orig/sirfflash.c 2007-10-12 15:44:48.000000000 +0200
++++ gpsd-2.37/sirfflash.c 2008-10-09 14:17:23.000000000 +0200
+@@ -166,7 +166,7 @@ sirfSetProto(int pfd, struct termios *te
+
+ sirf[7] = sirf[6] = (unsigned char)proto;
+ /*@i@*/i = htonl(speed); /* borrow "i" to put speed into proper byte order */
+- /*@i@*/bcopy(&i, sirf+8, 4);
++ /*@i@*/memcpy(sirf+8, &i, 4);
+
+ /* send at whatever baud we're currently using */
+ (void)sirf_write(pfd, sirf);
diff --git a/package/gsm/Config.in b/package/gsm/Config.in
new file mode 100644
index 000000000..77bf91626
--- /dev/null
+++ b/package/gsm/Config.in
@@ -0,0 +1,30 @@
+config ADK_COMPILE_GSM
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBGSM
+
+config ADK_PACKAGE_LIBGSM
+ prompt "libgsm............................ A GSM 06.10 full-rate speech transcoding implementation (library)"
+ tristate
+ default n
+ select ADK_COMPILE_GSM
+ help
+ An implementation of the European GSM 06.10 provisional standard
+ for full-rate speech transcoding, prI-ETS 300 036, which uses
+ RPE/LTP (residual pulse excitation/long term prediction) coding
+ at 13 kbit/s.
+
+ ftp://ftp.cs.tu-berlin.de/pub/local/kbs/tubmik/gsm/
+
+config ADK_PACKAGE_GSM_UTILS
+ prompt "gsm-utils....................... A GSM 06.10 full-rate speech transcoding implementation (utilities)"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBGSM
+ help
+ An implementation of the European GSM 06.10 provisional standard
+ for full-rate speech transcoding, prI-ETS 300 036, which uses
+ RPE/LTP (residual pulse excitation/long term prediction) coding
+ at 13 kbit/s.
+
+ ftp://ftp.cs.tu-berlin.de/pub/local/kbs/tubmik/gsm/
diff --git a/package/gsm/Makefile b/package/gsm/Makefile
new file mode 100644
index 000000000..27dad9eb1
--- /dev/null
+++ b/package/gsm/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gsm
+PKG_VERSION:= 1.0.10
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4b148480f82e96d274248e13880ec873
+MASTER_SITES:= http://www-rn.informatik.uni-bremen.de/software/gsm/
+WRKDIST= ${WRKDIR}/${PKG_NAME}-1.0-pl10
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBGSM,libgsm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,GSM_UTILS,gsm-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+XAKE_FLAGS+= COPTS="${TARGET_CFLAGS}" \
+ INSTALL_ROOT="${WRKINST}"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBGSM}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgsm.so.1.0.10 ${IDIR_LIBGSM}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_GSM_UTILS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/toast ${IDIR_GSM_UTILS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/gsm/ipkg/gsm-utils.control b/package/gsm/ipkg/gsm-utils.control
new file mode 100644
index 000000000..b022f7154
--- /dev/null
+++ b/package/gsm/ipkg/gsm-utils.control
@@ -0,0 +1,4 @@
+Package: gsm-utils
+Priority: optional
+Section: admin
+Description: A GSM 06.10 full-rate speech transcoding implementation (utilities)
diff --git a/package/gsm/ipkg/libgsm.control b/package/gsm/ipkg/libgsm.control
new file mode 100644
index 000000000..922f69656
--- /dev/null
+++ b/package/gsm/ipkg/libgsm.control
@@ -0,0 +1,4 @@
+Package: libgsm
+Priority: optional
+Section: libs
+Description: A GSM 06.10 full-rate speech transcoding implementation (library)
diff --git a/package/gsm/patches/patch-Makefile b/package/gsm/patches/patch-Makefile
new file mode 100644
index 000000000..e4ece74fd
--- /dev/null
+++ b/package/gsm/patches/patch-Makefile
@@ -0,0 +1,244 @@
+$Id$
+--- gsm-1.0-pl10.orig/Makefile Tue Jul 2 16:36:06 1996
++++ gsm-1.0-pl10/Makefile Sat Jan 20 13:23:30 2007
+@@ -7,11 +7,13 @@
+ SASR = -DSASR
+ ######### Define SASR if >> is a signed arithmetic shift (-1 >> 1 == -1)
+
+-MULHACK = -DUSE_FLOAT_MUL
++#MULHACK = -DUSE_FLOAT_MUL
++MULHACK =
+ ######### Define this if your host multiplies floats faster than integers,
+ ######### e.g. on a SPARCstation.
+
+-FAST = -DFAST
++#FAST = -DFAST
++FAST =
+ ######### Define together with USE_FLOAT_MUL to enable the GSM library's
+ ######### approximation option for incorrect, but good-enough results.
+
+@@ -43,8 +45,9 @@ WAV49 =
+ # CC = /usr/lang/acc
+ # CCFLAGS = -c -O
+
+-CC = gcc -ansi -pedantic
+-CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1
++CC ?= gcc -ansi -pedantic
++COPTS ?= -O2
++CCFLAGS = -c $(COPTS) -DNeedFunctionPrototypes=1
+
+ LD = $(CC)
+
+@@ -78,10 +81,10 @@ INSTALL_ROOT =
+ # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
+ # this directory.
+
+-GSM_INSTALL_ROOT = $(INSTALL_ROOT)
++GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
+ GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
+-GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
+-GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
++GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
++GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
+
+
+ # Where do you want to install the toast binaries and their manpage?
+@@ -89,14 +92,14 @@ GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/ma
+ # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
+ # of this directory.
+
+-TOAST_INSTALL_ROOT = $(INSTALL_ROOT)
++TOAST_INSTALL_ROOT = $(INSTALL_ROOT)/usr
+ TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
+-TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
++TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
+
+ # Other tools
+
+ SHELL = /bin/sh
+-LN = ln
++LN = ln -s
+ BASENAME = basename
+ AR = ar
+ ARFLAGS = cr
+@@ -126,7 +129,7 @@ INC = $(ROOT)/inc
+
+ # Flags
+
+-# DEBUG = -DNDEBUG
++DEBUG = -DNDEBUG
+ ######### Remove -DNDEBUG to enable assertions.
+
+ CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
+@@ -140,6 +143,7 @@ LFLAGS = $(LDFLAGS) $(LDINC)
+ # Targets
+
+ LIBGSM = $(LIB)/libgsm.a
++LIBGSMSO= $(LIB)/libgsm.so
+
+ TOAST = $(BIN)/toast
+ UNTOAST = $(BIN)/untoast
+@@ -258,6 +262,9 @@ STUFF = ChangeLog \
+
+ GSM_INSTALL_TARGETS = \
+ $(GSM_INSTALL_LIB)/libgsm.a \
++ $(GSM_INSTALL_LIB)/libgsm.so \
++ $(GSM_INSTALL_LIB)/libgsm.so.1 \
++ $(GSM_INSTALL_LIB)/libgsm.so.1.0.10 \
+ $(GSM_INSTALL_INC)/gsm.h \
+ $(GSM_INSTALL_MAN)/gsm.3 \
+ $(GSM_INSTALL_MAN)/gsm_explode.3 \
+@@ -279,7 +286,7 @@ TOAST_INSTALL_TARGETS = \
+
+ # Target rules
+
+-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
++all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
+ @-echo $(ROOT): Done.
+
+ tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
+@@ -299,6 +306,11 @@ install: toastinstall gsminstall
+
+ # The basic API: libgsm
+
++$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
++ $(LD) -o $@.1.0.10 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
++ ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
++ ln -fs libgsm.so.1.0.10 lib/libgsm.so
++
+ $(LIBGSM): $(LIB) $(GSM_OBJECTS)
+ -rm $(RMFLAGS) $(LIBGSM)
+ $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
+@@ -308,15 +320,15 @@ $(LIBGSM): $(LIB) $(GSM_OBJECTS)
+ # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
+
+ $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM)
+- $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
++ $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
+
+ $(UNTOAST): $(BIN) $(TOAST)
+ -rm $(RMFLAGS) $(UNTOAST)
+- $(LN) $(TOAST) $(UNTOAST)
++ $(LN) toast $(UNTOAST)
+
+ $(TCAT): $(BIN) $(TOAST)
+ -rm $(RMFLAGS) $(TCAT)
+- $(LN) $(TOAST) $(TCAT)
++ $(LN) toast $(TCAT)
+
+
+ # The local bin and lib directories
+@@ -332,12 +344,12 @@ $(LIB):
+
+ gsminstall:
+ -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \
+- make $(GSM_INSTALL_TARGETS) ; \
++ $(MAKE) $(GSM_INSTALL_TARGETS) ; \
+ fi
+
+ toastinstall:
+ -if [ x"$(TOAST_INSTALL_ROOT)" != x ]; then \
+- make $(TOAST_INSTALL_TARGETS); \
++ $(MAKE) $(TOAST_INSTALL_TARGETS); \
+ fi
+
+ gsmuninstall:
+@@ -351,54 +363,67 @@ toastuninstall:
+ fi
+
+ $(TOAST_INSTALL_BIN)/toast: $(TOAST)
+- -rm $@
+- cp $(TOAST) $@
++ mkdir -p $(TOAST_INSTALL_BIN)
++ cp -f $(TOAST) $@
+ chmod 755 $@
+
+ $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast
+- -rm $@
+- ln $? $@
++ mkdir -p $(TOAST_INSTALL_BIN)
++ ln -sf $? $@
+
+ $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast
+- -rm $@
+- ln $? $@
++ mkdir -p $(TOAST_INSTALL_BIN)
++ ln -sf $? $@
+
+ $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1
+- -rm $@
+- cp $? $@
++ mkdir -p $(TOAST_INSTALL_MAN)
++ cp -f $? $@
+ chmod 444 $@
+
+ $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3
+- -rm $@
+- cp $? $@
++ mkdir -p $(GSM_INSTALL_MAN)
++ cp -f $? $@
+ chmod 444 $@
+
+ $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3
+- -rm $@
+- cp $? $@
++ mkdir -p $(GSM_INSTALL_MAN)
++ cp -f $? $@
+ chmod 444 $@
+
+ $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3
+- -rm $@
+- cp $? $@
++ mkdir -p $(GSM_INSTALL_MAN)
++ cp -f $? $@
+ chmod 444 $@
+
+ $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3
+- -rm $@
+- cp $? $@
++ mkdir -p $(GSM_INSTALL_MAN)
++ cp -f $? $@
+ chmod 444 $@
+
+ $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h
+- -rm $@
+- cp $? $@
++ mkdir -p $(GSM_INSTALL_INC)
++ cp -f $? $@
+ chmod 444 $@
+
+ $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM)
+- -rm $@
+- cp $? $@
++ mkdir -p $(GSM_INSTALL_LIB)
++ cp -f $? $@
+ chmod 444 $@
+
++$(GSM_INSTALL_LIB)/libgsm.so: $(LIBGSMSO)
++ mkdir -p $(GSM_INSTALL_LIB)
++ cp -f $? $@
+
++$(GSM_INSTALL_LIB)/libgsm.so.1: $(LIBGSMSO)
++ mkdir -p $(GSM_INSTALL_LIB)
++ cp -f $? $@
++
++$(GSM_INSTALL_LIB)/libgsm.so.1.0.10: $(LIBGSMSO)
++ mkdir -p $(GSM_INSTALL_LIB)
++ cp -f $? $@
++ chmod 755 $@
++
++
+ # Distribution
+
+ dist: gsm-1.0.tar.Z
+@@ -426,7 +451,9 @@ semi-clean:
+
+ clean: semi-clean
+ -rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \
+- $(TOAST) $(TCAT) $(UNTOAST) \
++ $(LIBGSMSO) $(LIB)/libgsm.so.1.0.10 \
++ $(LIB)libgsm.so.1 \
++ $(TOAST) $(TCAT) $(UNTOAST) \
+ $(ROOT)/gsm-1.0.tar.Z
+
+
diff --git a/package/gsm/patches/patch-inc_config_h b/package/gsm/patches/patch-inc_config_h
new file mode 100644
index 000000000..3d4bec8b1
--- /dev/null
+++ b/package/gsm/patches/patch-inc_config_h
@@ -0,0 +1,42 @@
+$Id$
+--- gsm-1.0-pl10.orig/inc/config.h Tue Jul 2 16:32:27 1996
++++ gsm-1.0-pl10/inc/config.h Sat Jan 20 13:06:50 2007
+@@ -9,29 +9,29 @@
+ #ifndef CONFIG_H
+ #define CONFIG_H
+
+-/*efine SIGHANDLER_T int /* signal handlers are void */
+-/*efine HAS_SYSV_SIGNAL 1 /* sigs not blocked/reset? */
++/*efine SIGHANDLER_T int -* signal handlers are void */
++/*efine HAS_SYSV_SIGNAL 1 -* sigs not blocked/reset? */
+
+ #define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */
+-/*efine HAS_LIMITS_H 1 /* /usr/include/limits.h */
++#define HAS_STDIO_H 1 /* /usr/include/stdio.h */
++/*efine HAS_LIMITS_H 1 -* /usr/include/limits.h */
+ #define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */
+-/*efine HAS_ERRNO_DECL 1 /* errno.h declares errno */
+
+ #define HAS_FSTAT 1 /* fstat syscall */
+ #define HAS_FCHMOD 1 /* fchmod syscall */
+ #define HAS_CHMOD 1 /* chmod syscall */
+ #define HAS_FCHOWN 1 /* fchown syscall */
+ #define HAS_CHOWN 1 /* chown syscall */
+-/*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */
++/*efine HAS__FSETMODE 1 -* _fsetmode -- set file mode */
+
+ #define HAS_STRING_H 1 /* /usr/include/string.h */
+-/*efine HAS_STRINGS_H 1 /* /usr/include/strings.h */
++/*efine HAS_STRINGS_H 1 -* /usr/include/strings.h */
+
+ #define HAS_UNISTD_H 1 /* /usr/include/unistd.h */
+ #define HAS_UTIME 1 /* POSIX utime(path, times) */
+-/*efine HAS_UTIMES 1 /* use utimes() syscall instead */
++/*efine HAS_UTIMES 1 -* use utimes() syscall instead */
+ #define HAS_UTIME_H 1 /* UTIME header file */
+-/*efine HAS_UTIMBUF 1 /* struct utimbuf */
+-/*efine HAS_UTIMEUSEC 1 /* microseconds in utimbuf? */
++/*efine HAS_UTIMBUF 1 -* struct utimbuf */
++/*efine HAS_UTIMEUSEC 1 -* microseconds in utimbuf? */
+
+ #endif /* CONFIG_H */
diff --git a/package/gsm/patches/patch-inc_gsm_h b/package/gsm/patches/patch-inc_gsm_h
new file mode 100644
index 000000000..8e7ec33b7
--- /dev/null
+++ b/package/gsm/patches/patch-inc_gsm_h
@@ -0,0 +1,25 @@
+$Id$
+--- gsm-1.0-pl10.orig/inc/gsm.h Fri Jul 5 20:31:51 1996
++++ gsm-1.0-pl10/inc/gsm.h Sat Jan 20 13:06:50 2007
+@@ -54,6 +54,10 @@ typedef gsm_byte gsm_frame[33]; /* 33
+ #define GSM_OPT_FRAME_INDEX 5
+ #define GSM_OPT_FRAME_CHAIN 6
+
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ extern gsm gsm_create GSM_P((void));
+ extern void gsm_destroy GSM_P((gsm));
+
+@@ -65,6 +69,10 @@ extern int gsm_decode GSM_P((gsm, gsm_
+
+ extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *));
+ extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *));
++
++#ifdef __cplusplus
++}
++#endif
+
+ #undef GSM_P
+
diff --git a/package/gsm/patches/patch-inc_toast_h b/package/gsm/patches/patch-inc_toast_h
new file mode 100644
index 000000000..9772f077c
--- /dev/null
+++ b/package/gsm/patches/patch-inc_toast_h
@@ -0,0 +1,29 @@
+$Id$
+--- gsm-1.0-pl10.orig/inc/toast.h Tue Jul 2 16:32:29 1996
++++ gsm-1.0-pl10/inc/toast.h Sat Jan 20 13:06:50 2007
+@@ -16,11 +16,12 @@
+
+ #include <stdio.h>
+ #include <ctype.h>
++#include <pthread.h>
+ #include <signal.h>
+
+ #include <errno.h>
+-#ifndef HAS_ERRNO_DECL
+- extern int errno;
++#ifndef errno
++ extern int errno;
+ #endif
+
+ #ifdef HAS_LIMITS_H
+@@ -35,6 +36,10 @@
+ # ifdef HAS_UTIME_H
+ # include <utime.h>
+ # endif
++#endif
++
++#ifdef HAS_STDIO_H
++# include <stdio.h>
+ #endif
+
+ #include "gsm.h"
diff --git a/package/gsm/patches/patch-src_code_c b/package/gsm/patches/patch-src_code_c
new file mode 100644
index 000000000..6d81a946b
--- /dev/null
+++ b/package/gsm/patches/patch-src_code_c
@@ -0,0 +1,14 @@
+$Id$
+--- gsm-1.0-pl10.orig/src/code.c Tue Jul 2 16:32:36 1996
++++ gsm-1.0-pl10/src/code.c Sat Jan 20 13:06:50 2007
+@@ -9,8 +9,8 @@
+ #include "config.h"
+
+
+-#ifdef HAS_STDLIB_H
+-#include <stdlib.h>
++#ifdef HAS_STRING_H
++#include <string.h>
+ #else
+ # include "proto.h"
+ extern char * memcpy P((char *, char *, int));
diff --git a/package/gsm/patches/patch-src_debug_c b/package/gsm/patches/patch-src_debug_c
new file mode 100644
index 000000000..74335b938
--- /dev/null
+++ b/package/gsm/patches/patch-src_debug_c
@@ -0,0 +1,29 @@
+$Id$
+--- gsm-1.0-pl10.orig/src/debug.c Tue Jul 2 16:32:37 1996
++++ gsm-1.0-pl10/src/debug.c Sat Jan 20 13:06:50 2007
+@@ -49,7 +49,7 @@ void gsm_debug_longwords P4( (name, from
+ fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
+ while (from <= to) {
+
+- fprintf(stderr, "%d ", ptr[ from ] );
++ fprintf(stderr, "%ld ", ptr[ from ] );
+ from++;
+ if (nprinted++ >= 7) {
+ nprinted = 0;
+@@ -63,14 +63,14 @@ void gsm_debug_longword P2( (name, valu
+ char * name,
+ longword value )
+ {
+- fprintf(stderr, "%s: %d\n", name, (long)value );
++ fprintf(stderr, "%s: %ld\n", name, (long)value );
+ }
+
+ void gsm_debug_word P2( (name, value),
+ char * name,
+ word value )
+ {
+- fprintf(stderr, "%s: %d\n", name, (long)value);
++ fprintf(stderr, "%s: %ld\n", name, (long)value);
+ }
+
+ #endif
diff --git a/package/gsm/patches/patch-src_toast_c b/package/gsm/patches/patch-src_toast_c
new file mode 100644
index 000000000..e06463992
--- /dev/null
+++ b/package/gsm/patches/patch-src_toast_c
@@ -0,0 +1,69 @@
+$Id$
+--- gsm-1.0-pl10.orig/src/toast.c Tue Jul 2 16:32:55 1996
++++ gsm-1.0-pl10/src/toast.c Sat Jan 20 13:06:50 2007
+@@ -251,8 +251,8 @@ static char * emalloc P1((len), size_t l
+ {
+ char * s;
+ if (!(s = malloc(len))) {
+- fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n",
+- progname, len);
++ fprintf(stderr, "%s: failed to malloc %ld bytes -- abort\n",
++ progname, (long) len);
+ onintr();
+ exit(1);
+ }
+@@ -270,7 +270,7 @@ static char* normalname P3((name, want,
+ maxlen = strlen(name) + 1 + strlen(want) + strlen(cut);
+ p = strcpy(emalloc(maxlen), name);
+
+- if (s = suffix(p, cut)) strcpy(s, want);
++ if ((s = suffix(p, cut))) strcpy(s, want);
+ else if (*want && !suffix(p, want)) strcat(p, want);
+
+ return p;
+@@ -386,7 +386,7 @@ static void update_times P0()
+ ut[0] = instat.st_atime;
+ ut[1] = instat.st_mtime;
+
+- (void) utime(outname, ut);
++ (void) utime(outname, (struct utimbuf *)ut);
+
+ #endif /* UTIMBUF */
+ }
+@@ -416,7 +416,7 @@ static int okay_as_input P3((name,f,st),
+ }
+ if (st->st_nlink > 1 && !f_cat && !f_precious) {
+ fprintf(stderr,
+- "%s: \"%s\" has %s other link%s -- unchanged.\n",
++ "%s: \"%s\" has %d other link%s -- unchanged.\n",
+ progname,name,st->st_nlink - 1,"s" + (st->st_nlink<=2));
+ return 0;
+ }
+@@ -585,8 +585,8 @@ static int process_decode P0()
+
+ if (cc != sizeof(s)) {
+ if (cc >= 0) fprintf(stderr,
+- "%s: incomplete frame (%d byte%s missing) from %s\n",
+- progname, sizeof(s) - cc,
++ "%s: incomplete frame (%ld byte%s missing) from %s\n",
++ progname, (long) sizeof(s) - cc,
+ "s" + (sizeof(s) - cc == 1),
+ inname ? inname : "stdin" );
+ gsm_destroy(r);
+@@ -624,8 +624,6 @@ static int process_decode P0()
+
+ static int process P1((name), char * name)
+ {
+- int step = 0;
+-
+ out = (FILE *)0;
+ in = (FILE *)0;
+
+@@ -779,7 +777,6 @@ int main P2((ac, av), int ac, char **av)
+ case 'h': help(); exit(0);
+
+ default:
+- usage:
+ fprintf(stderr,
+ "Usage: %s [-fcpdhvuaslFC] [files...] (-h for help)\n",
+ progname);
diff --git a/package/haserl/Config.in b/package/haserl/Config.in
new file mode 100644
index 000000000..bab5680c9
--- /dev/null
+++ b/package/haserl/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_HASERL
+ prompt "haserl............................ A CGI wrapper to embed shell scripts in HTML documents"
+ tristate
+ default n
+ help
+ A CGI wrapper to embed shell scripts in HTML documents.
+
+ http://haserl.sourceforge.net/
+
diff --git a/package/haserl/Makefile b/package/haserl/Makefile
new file mode 100644
index 000000000..f1ed01580
--- /dev/null
+++ b/package/haserl/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= haserl
+PKG_VERSION:= 0.8.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= bd9195d086566f56634c0bcbbbcbebea
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=haserl/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,HASERL,haserl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TCFLAGS+= -DMAX_UPLOAD_KB=8192
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_HASERL}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/haserl ${IDIR_HASERL}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/haserl/ipkg/haserl.control b/package/haserl/ipkg/haserl.control
new file mode 100644
index 000000000..0243b6d75
--- /dev/null
+++ b/package/haserl/ipkg/haserl.control
@@ -0,0 +1,4 @@
+Package: haserl
+Priority: optional
+Section: web
+Description: a CGI wrapper to embed shell scripts in HTML documents
diff --git a/package/haserl/patches/patch-src_haserl_c b/package/haserl/patches/patch-src_haserl_c
new file mode 100644
index 000000000..208f9073b
--- /dev/null
+++ b/package/haserl/patches/patch-src_haserl_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- haserl-0.8.0.orig/src/haserl.c 2004-11-10 18:59:35.000000000 +0100
++++ haserl-0.8.0/src/haserl.c 2008-10-09 14:21:28.000000000 +0200
+@@ -131,7 +131,7 @@ int myputenv (char *newbuf, char *prefix
+ if (strlen(prefix)) { memcpy (entry, prefix, strlen(prefix)); }
+ memcpy ((char *) (entry + strlen(prefix)), newbuf, strlen(newbuf));
+
+- keylen = (size_t) (index (entry, '=') - entry);
++ keylen = (size_t) (strchr (entry, '=') - entry);
+
+ if ( keylen <= 0 ) {
+ free (entry);
diff --git a/package/hdparm/Config.in b/package/hdparm/Config.in
new file mode 100644
index 000000000..494c2b9a6
--- /dev/null
+++ b/package/hdparm/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_HDPARM
+ prompt "hdparm............................ get/set ATA drive parameters"
+ tristate
+ default n
+ help
+
+ tune hard disk parameters for high performance
+ Get/set hard disk parameters for Linux IDE drives.
+ Primary use is for enabling irq-unmasking and IDE multiplemode.
+
+ The original website:
+ http://sourceforge.net/projects/hdparm/
diff --git a/package/hdparm/Makefile b/package/hdparm/Makefile
new file mode 100644
index 000000000..b77f02e33
--- /dev/null
+++ b/package/hdparm/Makefile
@@ -0,0 +1,24 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= hdparm
+PKG_VERSION:= 6.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ecea69f775396e4ab6112dcf9066239f
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=hdparm/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,HDPARM,hdparm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_HDPARM}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/hdparm ${IDIR_HDPARM}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/hdparm/ipkg/hdparm.control b/package/hdparm/ipkg/hdparm.control
new file mode 100644
index 000000000..4db1002d1
--- /dev/null
+++ b/package/hdparm/ipkg/hdparm.control
@@ -0,0 +1,4 @@
+Package: hdparm
+Priority: optional
+Section: misc
+Description: get/set ATA drive parameters
diff --git a/package/heimdal/Config.in b/package/heimdal/Config.in
new file mode 100644
index 000000000..449d4c5f3
--- /dev/null
+++ b/package/heimdal/Config.in
@@ -0,0 +1,63 @@
+config ADK_COMPILE_HEIMDAL
+ prompt "heimdal........................... Heimdal kerberos software"
+ bool
+ default n
+
+config ADK_COMPILE_HEIMDAL_WITH_PKINIT
+ prompt "Enable PK-INIT"
+ bool
+ depends on ADK_COMPILE_HEIMDAL
+ default n
+
+config ADK_PACKAGE_HEIMDAL_SERVER
+ prompt "heimdal-server.................... heimdal kerberos server"
+ tristate
+ depends on ADK_COMPILE_HEIMDAL
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_HEIMDAL_LIBS
+ select ADK_PACKAGE_HEIMDAL_CLIENT_LIBS
+ default n
+ help
+ http://www.h5l.org
+
+choice
+prompt "Database backend"
+depends on ADK_PACKAGE_HEIMDAL_SERVER
+default ADK_COMPILE_HEIMDAL_WITH_DB_BDB
+
+config ADK_COMPILE_HEIMDAL_WITH_DB_BDB
+ bool "Berkeley DB backend"
+ select ADK_PACKAGE_LIBDB
+ help
+ Use Oracle Berkeley DB as kerberos database backend.
+
+config ADK_COMPILE_HEIMDAL_WITH_DB_LDAP
+ bool "LDAP backend"
+ select ADK_PACKAGE_LIBOPENLDAP
+ help
+ Use OpenLDAP as kerberos database backend.
+ (Useful for SSO setup)
+
+endchoice
+
+config ADK_PACKAGE_HEIMDAL_LIBS
+ prompt "heimdal-libs...................... heimdal kerberos libraries"
+ tristate
+ depends on ADK_COMPILE_HEIMDAL
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBOPENSSL
+ default n
+ help
+ http://www.h5l.org
+
+config ADK_PACKAGE_HEIMDAL_CLIENT_LIBS
+ prompt "heimdal-client-libs............... heimdal kerberos client libraries"
+ tristate
+ depends on ADK_COMPILE_HEIMDAL
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBOPENSSL
+ default n
+ help
+ http://www.h5l.org
diff --git a/package/heimdal/Makefile b/package/heimdal/Makefile
new file mode 100644
index 000000000..40a750fc9
--- /dev/null
+++ b/package/heimdal/Makefile
@@ -0,0 +1,126 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= heimdal
+PKG_VERSION:= 1.2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6e5028077e2a6b101a4a72801ba71b9e
+MASTER_SITES:= http://www.h5l.org/dist/src/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,HEIMDAL_SERVER,heimdal-server,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,HEIMDAL_LIBS,heimdal-libs,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,HEIMDAL_CLIENT_LIBS,heimdal-client-libs,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+PKG_DEPENDS:= heimdal-libs, heimdal-client-libs, libncurses,
+
+CONFIGURE_OPTS:= --with-hdbdir=/etc/heimdal \
+ --disable-otp \
+ --disable-ndbm-db \
+ --libexecdir=/usr/sbin \
+ --sysconfdir=/etc/heimdal
+
+ifeq ($(ADK_IPV6),y)
+CONFIGURE_OPTS+= --with-ipv6
+else
+CONFIGURE_OPTS+= --without-ipv6
+endif
+
+ifeq ($(ADK_COMPILE_HEIMDAL_WITH_DB_BDB),y)
+CONFIGURE_ARGS+= --enable-berkeley-db
+PKG_DEPENDS+= libdb
+else
+CONFIGURE_ARGS+= --disable-berkeley-db
+endif
+
+ifeq ($(ADK_COMPILE_HEIMDAL_WITH_DB_LDAP),y)
+CONFIGURE_ARGS+= --with-openldap=yes
+CONFIGURE_ARGS+= --with-openldap-include=${STAGING_DIR}/usr
+CONFIGURE_ARGS+= --with-openldap-lib=${STAGING_DIR}/usr
+PKG_DEPENDS+= libopenldap
+else
+CONFIGURE_ARGS+= --without-openldap
+endif
+
+ifeq ($(ADK_COMPILE_HEIMDAL_WITH_PKINIT),y)
+CONFIGURE_OPTS+= --enable-pk-init
+else
+CONFIGURE_OPTS+= --disable-pk-init
+endif
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= ${CONFIGURE_OPTS}
+CONFIGURE_ENV+= ac_cv_func_getaddrinfo_numserv=yes
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+pre-configure:
+ (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
+ CFLAGS="-static" \
+ ./configure ${CONFIGURE_OPTS} \
+ );
+ ${MAKE} -C ${WRKBUILD}/lib/roken
+ ${MAKE} -C ${WRKBUILD}/lib/vers
+ ${MAKE} -C ${WRKBUILD}/lib/editline
+ ${MAKE} -C ${WRKBUILD}/lib/com_err compile_et
+ ${MAKE} -C ${WRKBUILD}/lib/asn1 asn1_compile
+ ${MAKE} -C ${WRKBUILD}/lib/sl slc
+ ${INSTALL_BIN} ${WRKBUILD}/lib/com_err/compile_et \
+ ${STAGING_TOOLS}/bin
+ ${INSTALL_BIN} ${WRKBUILD}/lib/asn1/asn1_compile \
+ ${STAGING_TOOLS}/bin
+ ${INSTALL_BIN} ${WRKBUILD}/lib/sl/slc \
+ ${STAGING_TOOLS}/bin
+ ${MAKE} -C ${WRKBUILD}/lib/com_err clean
+ ${MAKE} -C ${WRKBUILD} clean
+
+post-install:
+ifeq (${ADK_COMPILE_HEIMDAL_WITH_DB_LDAP},y)
+ ${INSTALL_DIR} ${IDIR_HEIMDAL_SERVER}/etc/openldap/schema
+ ${INSTALL_DATA} ${WRKBUILD}/lib/hdb/hdb.schema \
+ ${IDIR_HEIMDAL_SERVER}/etc/openldap/schema
+endif
+ ${INSTALL_DIR} ${IDIR_HEIMDAL_SERVER}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_HEIMDAL_SERVER}/etc/heimdal
+ ${INSTALL_DIR} ${IDIR_HEIMDAL_SERVER}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_HEIMDAL_SERVER}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libkdc.so* ${IDIR_HEIMDAL_SERVER}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libkadm5srv.so* ${IDIR_HEIMDAL_SERVER}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libhdb.so* ${IDIR_HEIMDAL_SERVER}/usr/lib
+ ${INSTALL_DATA} ./files/krb5.conf ${IDIR_HEIMDAL_SERVER}/etc/heimdal
+ ${INSTALL_DATA} ./files/heimdal.init \
+ ${IDIR_HEIMDAL_SERVER}/etc/init.d/heimdal
+ ${INSTALL_DATA} ./files/kdc.conf ${IDIR_HEIMDAL_SERVER}/etc/heimdal
+ ${INSTALL_DATA} ./files/kadmind.acl ${IDIR_HEIMDAL_SERVER}/etc/heimdal
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/kdc ${IDIR_HEIMDAL_SERVER}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/kadmind ${IDIR_HEIMDAL_SERVER}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/kpasswdd ${IDIR_HEIMDAL_SERVER}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/kstash ${IDIR_HEIMDAL_SERVER}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ktutil ${IDIR_HEIMDAL_SERVER}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/kadmin ${IDIR_HEIMDAL_SERVER}/usr/sbin/
+ # heimdal libs
+ ${INSTALL_DIR} ${IDIR_HEIMDAL_LIBS}/usr/lib
+ifeq ($(ADK_COMPILE_HEIMDAL_WITH_PKINIT),y)
+ ${CP} ${WRKINST}/usr/lib/libhx509.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+endif
+ ${CP} ${WRKINST}/usr/lib/libheimntlm.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libwind.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgssapi.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libkafs.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libkrb5.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libcom_err.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libasn1.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libroken.so* ${IDIR_HEIMDAL_LIBS}/usr/lib
+ # heimdal client libs
+ ${INSTALL_DIR} ${IDIR_HEIMDAL_CLIENT_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libeditline.so* ${IDIR_HEIMDAL_CLIENT_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libsl.so* ${IDIR_HEIMDAL_CLIENT_LIBS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libkadm5clnt.so* ${IDIR_HEIMDAL_CLIENT_LIBS}/usr/lib
+ echo 'Depends: ${PKG_DEPENDS}' >> ${IDIR_HEIMDAL_SERVER}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/heimdal/files/heimdal.init b/package/heimdal/files/heimdal.init
new file mode 100644
index 000000000..fad5a7818
--- /dev/null
+++ b/package/heimdal/files/heimdal.init
@@ -0,0 +1,30 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${kdc:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/kdc
+ /usr/sbin/kadmind &
+ /usr/sbin/kpasswdd &
+ ;;
+stop)
+ killall kdc
+ killall kadmind
+ killall kpasswdd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/heimdal/files/kadmind.acl b/package/heimdal/files/kadmind.acl
new file mode 100644
index 000000000..e5da87fb5
--- /dev/null
+++ b/package/heimdal/files/kadmind.acl
@@ -0,0 +1 @@
+#principal [priv1,priv2,...] [glob-pattern]
diff --git a/package/heimdal/files/kdc.conf b/package/heimdal/files/kdc.conf
new file mode 100644
index 000000000..1adcb022e
--- /dev/null
+++ b/package/heimdal/files/kdc.conf
@@ -0,0 +1,4 @@
+[kdc]
+ acl_file = FILE:/etc/heimdal/kadmind.acl
+ detach = yes
+ enable-kerberos4 = false
diff --git a/package/heimdal/files/krb5.conf b/package/heimdal/files/krb5.conf
new file mode 100644
index 000000000..927ba24dc
--- /dev/null
+++ b/package/heimdal/files/krb5.conf
@@ -0,0 +1,25 @@
+[libdefaults]
+ default_realm = MY.REALM
+ clockskew = 300
+
+[realms]
+ MY.REALM = {
+ kdc = my.hostname
+ }
+
+[domain_realm]
+ .my.domain = MY.REALM
+
+[kdc]
+ database = {
+ realm = MY.REALM
+ dbname = db:/etc/heimdal/krb5db
+ mkey_file = /etc/heimdal/m-key
+ acl_file = /etc/heimdal/kadmind.acl
+ log_file = /var/log/krb5db.log
+ }
+
+[logging]
+ kdc = SYSLOG:INFO
+ default = SYSLOG:INFO
+
diff --git a/package/heimdal/ipkg/heimdal-client-libs.control b/package/heimdal/ipkg/heimdal-client-libs.control
new file mode 100644
index 000000000..550a6bb16
--- /dev/null
+++ b/package/heimdal/ipkg/heimdal-client-libs.control
@@ -0,0 +1,5 @@
+Package: heimdal-client-libs
+Priority: optional
+Section: net
+Depends: libopenssl, libpthread
+Description: heimdal kerberos client tool libraries
diff --git a/package/heimdal/ipkg/heimdal-libs.control b/package/heimdal/ipkg/heimdal-libs.control
new file mode 100644
index 000000000..5a1612530
--- /dev/null
+++ b/package/heimdal/ipkg/heimdal-libs.control
@@ -0,0 +1,5 @@
+Package: heimdal-libs
+Priority: optional
+Section: net
+Depends: libopenssl, libpthread
+Description: heimdal kerberos libraries
diff --git a/package/heimdal/ipkg/heimdal-server.control b/package/heimdal/ipkg/heimdal-server.control
new file mode 100644
index 000000000..81c33a95a
--- /dev/null
+++ b/package/heimdal/ipkg/heimdal-server.control
@@ -0,0 +1,4 @@
+Package: heimdal-server
+Priority: optional
+Section: net
+Description: heimdal kerberos server
diff --git a/package/heimdal/ipkg/heimdal-server.postinst b/package/heimdal/ipkg/heimdal-server.postinst
new file mode 100644
index 000000000..401d7bfd8
--- /dev/null
+++ b/package/heimdal/ipkg/heimdal-server.postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf "heimdal kdc" kdc NO
+add_service kerberos 88/tcp
+add_service kerberos 88/udp
+add_service kerberos-adm 749/tcp
+add_service kpasswd 464/tcp
+add_service kpasswd 464/udp
diff --git a/package/heimdal/patches/patch-Makefile_am b/package/heimdal/patches/patch-Makefile_am
new file mode 100644
index 000000000..a943323e0
--- /dev/null
+++ b/package/heimdal/patches/patch-Makefile_am
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/Makefile.am 2008-07-28 14:04:51.000000000 +0200
++++ heimdal-1.2.1/Makefile.am 2009-01-02 22:22:24.000000000 +0100
+@@ -7,7 +7,7 @@ kcm_dir = kcm
+ endif
+
+ SUBDIRS= include lib kuser kdc admin kadmin kpasswd
+-SUBDIRS+= $(kcm_dir) appl doc tools tests packages etc
++SUBDIRS+= $(kcm_dir) doc tools etc
+
+ ## ACLOCAL = @ACLOCAL@ -I cf
+ ACLOCAL_AMFLAGS = -I cf
diff --git a/package/heimdal/patches/patch-Makefile_in b/package/heimdal/patches/patch-Makefile_in
new file mode 100644
index 000000000..55a532f8b
--- /dev/null
+++ b/package/heimdal/patches/patch-Makefile_in
@@ -0,0 +1,25 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/Makefile.in 2008-07-28 14:05:35.000000000 +0200
++++ heimdal-1.2.1/Makefile.in 2009-01-02 22:22:24.000000000 +0100
+@@ -107,8 +107,8 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re
+ distclean-recursive maintainer-clean-recursive
+ ETAGS = etags
+ CTAGS = ctags
+-DIST_SUBDIRS = include lib kuser kdc admin kadmin kpasswd kcm appl doc \
+- tools tests packages etc
++DIST_SUBDIRS = include lib kuser kdc admin kadmin kpasswd kcm doc \
++ tools etc
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ distdir = $(PACKAGE)-$(VERSION)
+ top_distdir = $(distdir)
+@@ -346,8 +346,8 @@ LIB_kafs = $(top_builddir)/lib/kafs/libk
+ @KRB5_TRUE@LIB_tsasl = $(top_builddir)/lib/tsasl/libtsasl.la
+ @DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
+ @KCM_TRUE@kcm_dir = kcm
+-SUBDIRS = include lib kuser kdc admin kadmin kpasswd $(kcm_dir) appl \
+- doc tools tests packages etc
++SUBDIRS = include lib kuser kdc admin kadmin kpasswd $(kcm_dir) doc \
++ tools etc
+ ACLOCAL_AMFLAGS = -I cf
+ EXTRA_DIST = \
+ TODO \
diff --git a/package/heimdal/patches/patch-admin_Makefile_am b/package/heimdal/patches/patch-admin_Makefile_am
new file mode 100644
index 000000000..ca557d203
--- /dev/null
+++ b/package/heimdal/patches/patch-admin_Makefile_am
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/admin/Makefile.am 2008-07-28 14:04:49.000000000 +0200
++++ heimdal-1.2.1/admin/Makefile.am 2009-01-02 22:22:24.000000000 +0100
+@@ -30,7 +30,7 @@ $(ktutil_OBJECTS): ktutil-commands.h
+ CLEANFILES = ktutil-commands.h ktutil-commands.c
+
+ ktutil-commands.c ktutil-commands.h: ktutil-commands.in
+- $(SLC) $(srcdir)/ktutil-commands.in
++ slc $(srcdir)/ktutil-commands.in
+
+ LDADD = \
+ $(top_builddir)/lib/kadm5/libkadm5clnt.la \
diff --git a/package/heimdal/patches/patch-admin_Makefile_in b/package/heimdal/patches/patch-admin_Makefile_in
new file mode 100644
index 000000000..5baf7e5e5
--- /dev/null
+++ b/package/heimdal/patches/patch-admin_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/admin/Makefile.in 2008-07-28 14:05:26.000000000 +0200
++++ heimdal-1.2.1/admin/Makefile.in 2009-01-02 22:22:24.000000000 +0100
+@@ -898,7 +898,7 @@ distdir-in-tree: $(DISTFILES) $(INFO_DEP
+ $(ktutil_OBJECTS): ktutil-commands.h
+
+ ktutil-commands.c ktutil-commands.h: ktutil-commands.in
+- $(SLC) $(srcdir)/ktutil-commands.in
++ slc $(srcdir)/ktutil-commands.in
+ # 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/package/heimdal/patches/patch-configure b/package/heimdal/patches/patch-configure
new file mode 100644
index 000000000..d92f7cdbc
--- /dev/null
+++ b/package/heimdal/patches/patch-configure
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/configure 2008-07-28 14:05:20.000000000 +0200
++++ heimdal-1.2.1/configure 2009-01-04 18:24:14.421500455 +0100
+@@ -47096,9 +47096,6 @@ end
+ EOF
+ if ${COMPILE_ET} conftest_et.et >/dev/null 2>&1; then
+ save_CPPFLAGS="${CPPFLAGS}"
+- if test -d "/usr/include/et"; then
+- CPPFLAGS="-I/usr/include/et ${CPPFLAGS}"
+- fi
+ if test "$cross_compiling" = yes; then
+ krb_cv_compile_et="yes" krb_cv_compile_et_cross=yes
+ else
diff --git a/package/heimdal/patches/patch-include_Makefile_am b/package/heimdal/patches/patch-include_Makefile_am
new file mode 100644
index 000000000..9ad949c73
--- /dev/null
+++ b/package/heimdal/patches/patch-include_Makefile_am
@@ -0,0 +1,22 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/include/Makefile.am 2008-07-28 14:04:49.000000000 +0200
++++ heimdal-1.2.1/include/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -7,11 +7,17 @@ SUBDIRS = kadm5 hcrypto gssapi
+ noinst_PROGRAMS = bits make_crypto
+ CHECK_LOCAL = no-check-local
+
+-AM_CPPFLAGS += -DHOST=\"$(CANONICAL_HOST)\"
++AM_CPPFLAGS += -DHOST=\"$(CANONICAL_HOST)\" -DHAVE_CONFIG_H -I. -I..
+
+ nodist_include_HEADERS = krb5-types.h
+ nodist_noinst_HEADERS = crypto-headers.h
+
++bits:
++ $(HOSTCC) $(HOSTCFLAGS) $(AM_CPPFLAGS) -o $@ $(bits_SOURCES)
++
++make_crypto:
++ $(HOSTCC) $(HOSTCFLAGS) $(AM_CPPFLAGS) -o $@ $(make_crypto_SOURCES)
++
+ krb5-types.h: bits$(EXEEXT)
+ ./bits$(EXEEXT) krb5-types.h
+
diff --git a/package/heimdal/patches/patch-include_Makefile_in b/package/heimdal/patches/patch-include_Makefile_in
new file mode 100644
index 000000000..d3f0667c3
--- /dev/null
+++ b/package/heimdal/patches/patch-include_Makefile_in
@@ -0,0 +1,39 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/include/Makefile.in 2008-07-28 14:05:29.000000000 +0200
++++ heimdal-1.2.1/include/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -341,7 +341,8 @@ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ SUFFIXES = .et .h .x .z .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8
+ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+-AM_CPPFLAGS = $(INCLUDES_roken) -DHOST=\"$(CANONICAL_HOST)\"
++AM_CPPFLAGS = $(INCLUDES_roken) -DHOST=\"$(CANONICAL_HOST)\" \
++ -DHAVE_CONFIG_H -I. -I..
+ @do_roken_rename_TRUE@ROKEN_RENAME = -DROKEN_RENAME
+ AM_CFLAGS = $(WFLAGS)
+ CP = cp
+@@ -492,12 +493,6 @@ clean-noinstPROGRAMS:
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+-bits$(EXEEXT): $(bits_OBJECTS) $(bits_DEPENDENCIES)
+- @rm -f bits$(EXEEXT)
+- $(LINK) $(bits_OBJECTS) $(bits_LDADD) $(LIBS)
+-make_crypto$(EXEEXT): $(make_crypto_OBJECTS) $(make_crypto_DEPENDENCIES)
+- @rm -f make_crypto$(EXEEXT)
+- $(LINK) $(make_crypto_OBJECTS) $(make_crypto_LDADD) $(LIBS)
+
+ mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+@@ -1017,6 +1012,12 @@ distdir-in-tree: $(DISTFILES) $(INFO_DEP
+ fi ; \
+ done
+
++bits:
++ $(HOSTCC) $(HOSTCFLAGS) $(AM_CPPFLAGS) -o $@ $(bits_SOURCES)
++
++make_crypto:
++ $(HOSTCC) $(HOSTCFLAGS) $(AM_CPPFLAGS) -o $@ $(make_crypto_SOURCES)
++
+ krb5-types.h: bits$(EXEEXT)
+ ./bits$(EXEEXT) krb5-types.h
+
diff --git a/package/heimdal/patches/patch-kadmin_Makefile_am b/package/heimdal/patches/patch-kadmin_Makefile_am
new file mode 100644
index 000000000..6bcfe8483
--- /dev/null
+++ b/package/heimdal/patches/patch-kadmin_Makefile_am
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/kadmin/Makefile.am 2008-07-28 14:04:51.000000000 +0200
++++ heimdal-1.2.1/kadmin/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -44,7 +44,7 @@ $(kadmin_OBJECTS): kadmin-commands.h
+ CLEANFILES = kadmin-commands.h kadmin-commands.c
+
+ kadmin-commands.c kadmin-commands.h: kadmin-commands.in
+- $(SLC) $(srcdir)/kadmin-commands.in
++ slc $(srcdir)/kadmin-commands.in
+
+ kadmind_SOURCES = \
+ kadmind.c \
diff --git a/package/heimdal/patches/patch-kadmin_Makefile_in b/package/heimdal/patches/patch-kadmin_Makefile_in
new file mode 100644
index 000000000..c989c1b11
--- /dev/null
+++ b/package/heimdal/patches/patch-kadmin_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/kadmin/Makefile.in 2008-07-28 14:05:29.000000000 +0200
++++ heimdal-1.2.1/kadmin/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -1115,7 +1115,7 @@ distdir-in-tree: $(DISTFILES) $(INFO_DEP
+ $(kadmin_OBJECTS): kadmin-commands.h
+
+ kadmin-commands.c kadmin-commands.h: kadmin-commands.in
+- $(SLC) $(srcdir)/kadmin-commands.in
++ slc $(srcdir)/kadmin-commands.in
+ # 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/package/heimdal/patches/patch-kadmin_kadm_conn_c b/package/heimdal/patches/patch-kadmin_kadm_conn_c
new file mode 100644
index 000000000..b0c288404
--- /dev/null
+++ b/package/heimdal/patches/patch-kadmin_kadm_conn_c
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/kadmin/kadm_conn.c 2008-07-28 14:04:51.000000000 +0200
++++ heimdal-1.2.1/kadmin/kadm_conn.c 2009-01-06 14:21:32.674256091 +0100
+@@ -264,8 +264,9 @@ start_server(krb5_context context)
+ }
+
+ socket_set_reuseaddr(s, 1);
++#ifdef HAVE_IPV6
+ socket_set_ipv6only(s, 1);
+-
++#endif
+ if (bind (s, ap->ai_addr, ap->ai_addrlen) < 0) {
+ krb5_warn(context, errno, "bind");
+ close(s);
diff --git a/package/heimdal/patches/patch-kdc_kx509_c b/package/heimdal/patches/patch-kdc_kx509_c
new file mode 100644
index 000000000..d3518d651
--- /dev/null
+++ b/package/heimdal/patches/patch-kdc_kx509_c
@@ -0,0 +1,18 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/kdc/kx509.c 2008-07-28 14:04:51.000000000 +0200
++++ heimdal-1.2.1/kdc/kx509.c 2009-01-04 18:43:21.853211573 +0100
+@@ -32,6 +32,9 @@
+ */
+
+ #include "kdc_locl.h"
++
++#ifdef PKINIT
++
+ #include <hex.h>
+ #include <rfc2459_asn1.h>
+ #include <hx509.h>
+@@ -454,3 +457,4 @@ out:
+
+ return 0;
+ }
++#endif
diff --git a/package/heimdal/patches/patch-kdc_process_c b/package/heimdal/patches/patch-kdc_process_c
new file mode 100644
index 000000000..b44d6e636
--- /dev/null
+++ b/package/heimdal/patches/patch-kdc_process_c
@@ -0,0 +1,26 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/kdc/process.c 2008-07-28 14:04:51.000000000 +0200
++++ heimdal-1.2.1/kdc/process.c 2009-01-04 19:04:06.899022107 +0100
+@@ -68,7 +68,9 @@ krb5_kdc_process_request(krb5_context co
+ KDC_REQ req;
+ Ticket ticket;
+ DigestREQ digestreq;
++#ifdef PKINIT
+ Kx509Request kx509req;
++#endif
+ krb5_error_code ret;
+ size_t i;
+
+@@ -94,10 +96,12 @@ krb5_kdc_process_request(krb5_context co
+ ret = _kdc_do_digest(context, config, &digestreq, reply, from, addr);
+ free_DigestREQ(&digestreq);
+ return ret;
++#ifdef PKINIT
+ } else if (_kdc_try_kx509_request(buf, len, &kx509req, &i) == 0) {
+ ret = _kdc_do_kx509(context, config, &kx509req, reply, from, addr);
+ free_Kx509Request(&kx509req);
+ return ret;
++#endif
+ } else if(_kdc_maybe_version4(buf, len)){
+ *prependlength = FALSE; /* elbitapmoc sdrawkcab XXX */
+ _kdc_do_version4(context, config, buf, len, reply, from,
diff --git a/package/heimdal/patches/patch-kuser_Makefile_am b/package/heimdal/patches/patch-kuser_Makefile_am
new file mode 100644
index 000000000..665c3554f
--- /dev/null
+++ b/package/heimdal/patches/patch-kuser_Makefile_am
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/kuser/Makefile.am 2008-07-28 14:04:50.000000000 +0200
++++ heimdal-1.2.1/kuser/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -48,7 +48,7 @@ $(kdigest_OBJECTS): kdigest-commands.h
+ CLEANFILES = kdigest-commands.h kdigest-commands.c
+
+ kdigest-commands.c kdigest-commands.h: kdigest-commands.in
+- $(SLC) $(srcdir)/kdigest-commands.in
++ slc $(srcdir)/kdigest-commands.in
+
+ LDADD = \
+ $(top_builddir)/lib/krb5/libkrb5.la \
diff --git a/package/heimdal/patches/patch-kuser_Makefile_in b/package/heimdal/patches/patch-kuser_Makefile_in
new file mode 100644
index 000000000..77c7206db
--- /dev/null
+++ b/package/heimdal/patches/patch-kuser_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/kuser/Makefile.in 2008-07-28 14:05:30.000000000 +0200
++++ heimdal-1.2.1/kuser/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -1041,7 +1041,7 @@ distdir-in-tree: $(DISTFILES) $(INFO_DEP
+ $(kdigest_OBJECTS): kdigest-commands.h
+
+ kdigest-commands.c kdigest-commands.h: kdigest-commands.in
+- $(SLC) $(srcdir)/kdigest-commands.in
++ slc $(srcdir)/kdigest-commands.in
+
+ # make sure install-exec-hook doesn't have any commands in Makefile.am.common
+ install-exec-hook:
diff --git a/package/heimdal/patches/patch-lib_asn1_Makefile_am b/package/heimdal/patches/patch-lib_asn1_Makefile_am
new file mode 100644
index 000000000..44ac46c5b
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_asn1_Makefile_am
@@ -0,0 +1,48 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/asn1/Makefile.am 2008-07-28 14:04:43.000000000 +0200
++++ heimdal-1.2.1/lib/asn1/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -568,34 +568,34 @@ $(gen_files_cms) cms_asn1.h: cms_asn1_fi
+ $(gen_files_test) test_asn1.h: test_asn1_files
+
+ rfc2459_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/rfc2459.asn1
+- ./asn1_compile$(EXEEXT) --preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints $(srcdir)/rfc2459.asn1 rfc2459_asn1 || (rm -f rfc2459_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) --preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints $(srcdir)/rfc2459.asn1 rfc2459_asn1 || (rm -f rfc2459_asn1_files ; exit 1)
+
+ cms_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/CMS.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/CMS.asn1 cms_asn1 || (rm -f cms_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/CMS.asn1 cms_asn1 || (rm -f cms_asn1_files ; exit 1)
+
+ krb5_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.asn1
+- ./asn1_compile$(EXEEXT) --encode-rfc1510-bit-string --sequence=KRB5SignedPathPrincipals --sequence=AuthorizationData --sequence=METHOD-DATA --sequence=ETYPE-INFO --sequence=ETYPE-INFO2 $(srcdir)/k5.asn1 krb5_asn1 || (rm -f krb5_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) --encode-rfc1510-bit-string --sequence=KRB5SignedPathPrincipals --sequence=AuthorizationData --sequence=METHOD-DATA --sequence=ETYPE-INFO --sequence=ETYPE-INFO2 $(srcdir)/k5.asn1 krb5_asn1 || (rm -f krb5_asn1_files ; exit 1)
+
+ pkinit_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkinit.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkinit.asn1 pkinit_asn1 || (rm -f pkinit_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkinit.asn1 pkinit_asn1 || (rm -f pkinit_asn1_files ; exit 1)
+
+ pkcs8_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs8.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkcs8.asn1 pkcs8_asn1 || (rm -f pkcs8_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkcs8.asn1 pkcs8_asn1 || (rm -f pkcs8_asn1_files ; exit 1)
+
+ pkcs9_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs9.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkcs9.asn1 pkcs9_asn1 || (rm -f pkcs9_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkcs9.asn1 pkcs9_asn1 || (rm -f pkcs9_asn1_files ; exit 1)
+
+ pkcs12_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs12.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkcs12.asn1 pkcs12_asn1 || (rm -f pkcs12_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkcs12.asn1 pkcs12_asn1 || (rm -f pkcs12_asn1_files ; exit 1)
+
+ digest_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/digest.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/digest.asn1 digest_asn1 || (rm -f digest_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/digest.asn1 digest_asn1 || (rm -f digest_asn1_files ; exit 1)
+
+ kx509_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/kx509.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/kx509.asn1 kx509_asn1 || (rm -f kx509_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/kx509.asn1 kx509_asn1 || (rm -f kx509_asn1_files ; exit 1)
+
+ test_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/test.asn1
+- ./asn1_compile$(EXEEXT) --sequence=TESTSeqOf $(srcdir)/test.asn1 test_asn1 || (rm -f test_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) --sequence=TESTSeqOf $(srcdir)/test.asn1 test_asn1 || (rm -f test_asn1_files ; exit 1)
+
+ EXTRA_DIST = \
+ asn1_err.et \
diff --git a/package/heimdal/patches/patch-lib_asn1_Makefile_in b/package/heimdal/patches/patch-lib_asn1_Makefile_in
new file mode 100644
index 000000000..07dc3af52
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_asn1_Makefile_in
@@ -0,0 +1,48 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/asn1/Makefile.in 2008-07-28 14:05:30.000000000 +0200
++++ heimdal-1.2.1/lib/asn1/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -2239,34 +2239,34 @@ $(gen_files_cms) cms_asn1.h: cms_asn1_fi
+ $(gen_files_test) test_asn1.h: test_asn1_files
+
+ rfc2459_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/rfc2459.asn1
+- ./asn1_compile$(EXEEXT) --preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints $(srcdir)/rfc2459.asn1 rfc2459_asn1 || (rm -f rfc2459_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) --preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints $(srcdir)/rfc2459.asn1 rfc2459_asn1 || (rm -f rfc2459_asn1_files ; exit 1)
+
+ cms_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/CMS.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/CMS.asn1 cms_asn1 || (rm -f cms_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/CMS.asn1 cms_asn1 || (rm -f cms_asn1_files ; exit 1)
+
+ krb5_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/k5.asn1
+- ./asn1_compile$(EXEEXT) --encode-rfc1510-bit-string --sequence=KRB5SignedPathPrincipals --sequence=AuthorizationData --sequence=METHOD-DATA --sequence=ETYPE-INFO --sequence=ETYPE-INFO2 $(srcdir)/k5.asn1 krb5_asn1 || (rm -f krb5_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) --encode-rfc1510-bit-string --sequence=KRB5SignedPathPrincipals --sequence=AuthorizationData --sequence=METHOD-DATA --sequence=ETYPE-INFO --sequence=ETYPE-INFO2 $(srcdir)/k5.asn1 krb5_asn1 || (rm -f krb5_asn1_files ; exit 1)
+
+ pkinit_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkinit.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkinit.asn1 pkinit_asn1 || (rm -f pkinit_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkinit.asn1 pkinit_asn1 || (rm -f pkinit_asn1_files ; exit 1)
+
+ pkcs8_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs8.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkcs8.asn1 pkcs8_asn1 || (rm -f pkcs8_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkcs8.asn1 pkcs8_asn1 || (rm -f pkcs8_asn1_files ; exit 1)
+
+ pkcs9_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs9.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkcs9.asn1 pkcs9_asn1 || (rm -f pkcs9_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkcs9.asn1 pkcs9_asn1 || (rm -f pkcs9_asn1_files ; exit 1)
+
+ pkcs12_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/pkcs12.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/pkcs12.asn1 pkcs12_asn1 || (rm -f pkcs12_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/pkcs12.asn1 pkcs12_asn1 || (rm -f pkcs12_asn1_files ; exit 1)
+
+ digest_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/digest.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/digest.asn1 digest_asn1 || (rm -f digest_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/digest.asn1 digest_asn1 || (rm -f digest_asn1_files ; exit 1)
+
+ kx509_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/kx509.asn1
+- ./asn1_compile$(EXEEXT) $(srcdir)/kx509.asn1 kx509_asn1 || (rm -f kx509_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) $(srcdir)/kx509.asn1 kx509_asn1 || (rm -f kx509_asn1_files ; exit 1)
+
+ test_asn1_files: asn1_compile$(EXEEXT) $(srcdir)/test.asn1
+- ./asn1_compile$(EXEEXT) --sequence=TESTSeqOf $(srcdir)/test.asn1 test_asn1 || (rm -f test_asn1_files ; exit 1)
++ asn1_compile$(EXEEXT) --sequence=TESTSeqOf $(srcdir)/test.asn1 test_asn1 || (rm -f test_asn1_files ; exit 1)
+
+ $(srcdir)/der-protos.h:
+ cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -o der-protos.h $(dist_libasn1_la_SOURCES) || rm -f der-protos.h
diff --git a/package/heimdal/patches/patch-lib_gssapi_Makefile_am b/package/heimdal/patches/patch-lib_gssapi_Makefile_am
new file mode 100644
index 000000000..95c19a31d
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_gssapi_Makefile_am
@@ -0,0 +1,25 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/gssapi/Makefile.am 2008-07-28 14:04:39.000000000 +0200
++++ heimdal-1.2.1/lib/gssapi/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -249,10 +249,10 @@ $(spnego_files) spnego_asn1.h: spnego_as
+ $(gssapi_files) gssapi_asn1.h: gssapi_asn1_files
+
+ spnego_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/spnego/spnego.asn1
+- ../asn1/asn1_compile$(EXEEXT) --sequence=MechTypeList $(srcdir)/spnego/spnego.asn1 spnego_asn1
++ asn1_compile$(EXEEXT) --sequence=MechTypeList $(srcdir)/spnego/spnego.asn1 spnego_asn1
+
+ gssapi_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/mech/gssapi.asn1
+- ../asn1/asn1_compile$(EXEEXT) $(srcdir)/mech/gssapi.asn1 gssapi_asn1
++ asn1_compile$(EXEEXT) $(srcdir)/mech/gssapi.asn1 gssapi_asn1
+
+ $(srcdir)/krb5/gsskrb5-private.h:
+ cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p krb5/gsskrb5-private.h $(krb5src) || rm -f krb5/gsskrb5-private.h
+@@ -297,7 +297,7 @@ gss_LDADD = libgssapi.la \
+ SLC = $(top_builddir)/lib/sl/slc
+
+ gss-commands.c gss-commands.h: gss-commands.in
+- $(SLC) $(srcdir)/gss-commands.in
++ slc $(srcdir)/gss-commands.in
+
+ $(gss_OBJECTS): gss-commands.h
+
diff --git a/package/heimdal/patches/patch-lib_gssapi_Makefile_in b/package/heimdal/patches/patch-lib_gssapi_Makefile_in
new file mode 100644
index 000000000..3ba5e1f92
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_gssapi_Makefile_in
@@ -0,0 +1,25 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/gssapi/Makefile.in 2008-07-28 14:05:31.000000000 +0200
++++ heimdal-1.2.1/lib/gssapi/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -2254,10 +2254,10 @@ $(spnego_files) spnego_asn1.h: spnego_as
+ $(gssapi_files) gssapi_asn1.h: gssapi_asn1_files
+
+ spnego_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/spnego/spnego.asn1
+- ../asn1/asn1_compile$(EXEEXT) --sequence=MechTypeList $(srcdir)/spnego/spnego.asn1 spnego_asn1
++ asn1_compile$(EXEEXT) --sequence=MechTypeList $(srcdir)/spnego/spnego.asn1 spnego_asn1
+
+ gssapi_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/mech/gssapi.asn1
+- ../asn1/asn1_compile$(EXEEXT) $(srcdir)/mech/gssapi.asn1 gssapi_asn1
++ asn1_compile$(EXEEXT) $(srcdir)/mech/gssapi.asn1 gssapi_asn1
+
+ $(srcdir)/krb5/gsskrb5-private.h:
+ cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p krb5/gsskrb5-private.h $(krb5src) || rm -f krb5/gsskrb5-private.h
+@@ -2266,7 +2266,7 @@ $(srcdir)/spnego/spnego-private.h:
+ cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p spnego/spnego-private.h $(spnegosrc) || rm -f spnego/spnego-private.h
+
+ gss-commands.c gss-commands.h: gss-commands.in
+- $(SLC) $(srcdir)/gss-commands.in
++ slc $(srcdir)/gss-commands.in
+
+ $(gss_OBJECTS): gss-commands.h
+
diff --git a/package/heimdal/patches/patch-lib_hdb_Makefile_am b/package/heimdal/patches/patch-lib_hdb_Makefile_am
new file mode 100644
index 000000000..b18fafdf9
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_hdb_Makefile_am
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/hdb/Makefile.am 2008-07-28 14:04:40.000000000 +0200
++++ heimdal-1.2.1/lib/hdb/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -98,7 +98,7 @@ $(srcdir)/hdb-private.h:
+ $(gen_files_hdb) hdb_asn1.h: hdb_asn1_files
+
+ hdb_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/hdb.asn1
+- ../asn1/asn1_compile$(EXEEXT) $(srcdir)/hdb.asn1 hdb_asn1
++ asn1_compile$(EXEEXT) $(srcdir)/hdb.asn1 hdb_asn1
+
+ $(libhdb_la_OBJECTS): hdb_asn1.h hdb_err.h
+
diff --git a/package/heimdal/patches/patch-lib_hdb_Makefile_in b/package/heimdal/patches/patch-lib_hdb_Makefile_in
new file mode 100644
index 000000000..ea5a4a4a2
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_hdb_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/hdb/Makefile.in 2008-07-28 14:05:31.000000000 +0200
++++ heimdal-1.2.1/lib/hdb/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -1015,7 +1015,7 @@ $(srcdir)/hdb-private.h:
+ $(gen_files_hdb) hdb_asn1.h: hdb_asn1_files
+
+ hdb_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/hdb.asn1
+- ../asn1/asn1_compile$(EXEEXT) $(srcdir)/hdb.asn1 hdb_asn1
++ asn1_compile$(EXEEXT) $(srcdir)/hdb.asn1 hdb_asn1
+
+ $(libhdb_la_OBJECTS): hdb_asn1.h hdb_err.h
+
diff --git a/package/heimdal/patches/patch-lib_hx509_Makefile_am b/package/heimdal/patches/patch-lib_hx509_Makefile_am
new file mode 100644
index 000000000..33643e14d
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_hx509_Makefile_am
@@ -0,0 +1,32 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/hx509/Makefile.am 2008-07-28 14:04:48.000000000 +0200
++++ heimdal-1.2.1/lib/hx509/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -114,15 +114,15 @@ $(gen_files_ocsp) ocsp_asn1.h: ocsp_asn1
+ $(gen_files_pkcs10) pkcs10_asn1.h: pkcs10_asn1_files
+ $(gen_files_crmf) crmf_asn1.h: crmf_asn1_files
+
+-asn1_compile = ../asn1/asn1_compile$(EXEEXT)
++asn1_compile = asn1_compile$(EXEEXT)
+
+-ocsp_asn1_files: $(asn1_compile) $(srcdir)/ocsp.asn1
++ocsp_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/ocsp.asn1
+ $(asn1_compile) --preserve-binary=OCSPTBSRequest --preserve-binary=OCSPResponseData $(srcdir)/ocsp.asn1 ocsp_asn1 || (rm -f ocsp_asn1_files ; exit 1)
+
+-pkcs10_asn1_files: $(asn1_compile) $(srcdir)/pkcs10.asn1
++pkcs10_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/pkcs10.asn1
+ $(asn1_compile) --preserve-binary=CertificationRequestInfo $(srcdir)/pkcs10.asn1 pkcs10_asn1 || (rm -f pkcs10_asn1_files ; exit 1)
+
+-crmf_asn1_files: $(asn1_compile) $(srcdir)/crmf.asn1
++crmf_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/crmf.asn1
+ $(asn1_compile) $(srcdir)/crmf.asn1 crmf_asn1 || (rm -f crmf_asn1_files ; exit 1)
+
+ $(libhx509_la_OBJECTS): $(srcdir)/hx509-protos.h $(srcdir)/hx509-private.h $(srcdir)/hx_locl.h
+@@ -141,7 +141,7 @@ SLC = $(top_builddir)/lib/sl/slc
+ bin_PROGRAMS = hxtool
+
+ hxtool-commands.c hxtool-commands.h: hxtool-commands.in $(SLC)
+- $(SLC) $(srcdir)/hxtool-commands.in
++ slc $(srcdir)/hxtool-commands.in
+
+ dist_hxtool_SOURCES = hxtool.c
+ nodist_hxtool_SOURCES = hxtool-commands.c hxtool-commands.h
diff --git a/package/heimdal/patches/patch-lib_hx509_Makefile_in b/package/heimdal/patches/patch-lib_hx509_Makefile_in
new file mode 100644
index 000000000..7cb6847e3
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_hx509_Makefile_in
@@ -0,0 +1,38 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/hx509/Makefile.in 2008-07-28 14:05:32.000000000 +0200
++++ heimdal-1.2.1/lib/hx509/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -527,7 +527,7 @@ libhx509_la_LIBADD = \
+
+ libhx509_la_CPPFLAGS = -I$(srcdir)/ref $(INCLUDE_hcrypto)
+ nodist_libhx509_la_SOURCES = $(BUILT_SOURCES)
+-asn1_compile = ../asn1/asn1_compile$(EXEEXT)
++asn1_compile = asn1_compile$(EXEEXT)
+ dist_include_HEADERS = hx509.h hx509-protos.h
+ nodist_include_HEADERS = hx509_err.h
+ SLC = $(top_builddir)/lib/sl/slc
+@@ -1781,13 +1781,13 @@ $(gen_files_ocsp) ocsp_asn1.h: ocsp_asn1
+ $(gen_files_pkcs10) pkcs10_asn1.h: pkcs10_asn1_files
+ $(gen_files_crmf) crmf_asn1.h: crmf_asn1_files
+
+-ocsp_asn1_files: $(asn1_compile) $(srcdir)/ocsp.asn1
++ocsp_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/ocsp.asn1
+ $(asn1_compile) --preserve-binary=OCSPTBSRequest --preserve-binary=OCSPResponseData $(srcdir)/ocsp.asn1 ocsp_asn1 || (rm -f ocsp_asn1_files ; exit 1)
+
+-pkcs10_asn1_files: $(asn1_compile) $(srcdir)/pkcs10.asn1
++pkcs10_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/pkcs10.asn1
+ $(asn1_compile) --preserve-binary=CertificationRequestInfo $(srcdir)/pkcs10.asn1 pkcs10_asn1 || (rm -f pkcs10_asn1_files ; exit 1)
+
+-crmf_asn1_files: $(asn1_compile) $(srcdir)/crmf.asn1
++crmf_asn1_files: ../asn1/asn1_compile$(EXEEXT) $(srcdir)/crmf.asn1
+ $(asn1_compile) $(srcdir)/crmf.asn1 crmf_asn1 || (rm -f crmf_asn1_files ; exit 1)
+
+ $(libhx509_la_OBJECTS): $(srcdir)/hx509-protos.h $(srcdir)/hx509-private.h $(srcdir)/hx_locl.h
+@@ -1799,7 +1799,7 @@ $(srcdir)/hx509-private.h:
+ cd $(srcdir) && perl ../../cf/make-proto.pl -q -P comment -p hx509-private.h $(dist_libhx509_la_SOURCES) || rm -f hx509-private.h
+
+ hxtool-commands.c hxtool-commands.h: hxtool-commands.in $(SLC)
+- $(SLC) $(srcdir)/hxtool-commands.in
++ slc $(srcdir)/hxtool-commands.in
+
+ $(hxtool_OBJECTS): hxtool-commands.h
+
diff --git a/package/heimdal/patches/patch-lib_kadm5_Makefile_am b/package/heimdal/patches/patch-lib_kadm5_Makefile_am
new file mode 100644
index 000000000..13a317733
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_kadm5_Makefile_am
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/kadm5/Makefile.am 2008-07-28 14:04:41.000000000 +0200
++++ heimdal-1.2.1/lib/kadm5/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -152,7 +152,7 @@ iprop_log_LDADD = \
+
+
+ iprop-commands.c iprop-commands.h: iprop-commands.in
+- $(SLC) $(srcdir)/iprop-commands.in
++ slc $(srcdir)/iprop-commands.in
+
+ $(libkadm5srv_la_OBJECTS): kadm5_err.h
+ $(iprop_log_OBJECTS): iprop-commands.h
diff --git a/package/heimdal/patches/patch-lib_kadm5_Makefile_in b/package/heimdal/patches/patch-lib_kadm5_Makefile_in
new file mode 100644
index 000000000..e705690f2
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_kadm5_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/kadm5/Makefile.in 2008-07-28 14:05:32.000000000 +0200
++++ heimdal-1.2.1/lib/kadm5/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -1341,7 +1341,7 @@ install-build-headers:: $(dist_kadm5incl
+ done
+
+ iprop-commands.c iprop-commands.h: iprop-commands.in
+- $(SLC) $(srcdir)/iprop-commands.in
++ slc $(srcdir)/iprop-commands.in
+
+ $(libkadm5srv_la_OBJECTS): kadm5_err.h
+ $(iprop_log_OBJECTS): iprop-commands.h
diff --git a/package/heimdal/patches/patch-lib_krb5_Makefile_am b/package/heimdal/patches/patch-lib_krb5_Makefile_am
new file mode 100644
index 000000000..56b414efb
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_krb5_Makefile_am
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/krb5/Makefile.am 2008-07-28 14:04:45.000000000 +0200
++++ heimdal-1.2.1/lib/krb5/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -57,6 +57,7 @@ libkrb5_la_LIBADD = \
+ $(LIB_com_err) \
+ $(LIB_hcrypto) \
+ $(top_builddir)/lib/asn1/libasn1.la \
++ $(top_builddir)/lib/wind/libwind.la \
+ $(LIBADD_roken) \
+ $(LIB_door_create) \
+ $(LIB_dlopen)
diff --git a/package/heimdal/patches/patch-lib_krb5_Makefile_in b/package/heimdal/patches/patch-lib_krb5_Makefile_in
new file mode 100644
index 000000000..065acdeff
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_krb5_Makefile_in
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/krb5/Makefile.in 2008-07-28 14:05:33.000000000 +0200
++++ heimdal-1.2.1/lib/krb5/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -126,7 +126,8 @@ LTLIBRARIES = $(lib_LTLIBRARIES)
+ am__DEPENDENCIES_1 =
+ libkrb5_la_DEPENDENCIES = $(LIB_pkinit) ../sqlite/libsqlite.la \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+- $(top_builddir)/lib/asn1/libasn1.la $(am__DEPENDENCIES_1) \
++ $(top_builddir)/lib/asn1/libasn1.la \
++ $(top_builddir)/lib/wind/libwind.la $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ dist_libkrb5_la_OBJECTS = libkrb5_la-acache.lo libkrb5_la-acl.lo \
+ libkrb5_la-add_et_list.lo libkrb5_la-addr_families.lo \
+@@ -664,6 +665,7 @@ libkrb5_la_LIBADD = \
+ $(LIB_com_err) \
+ $(LIB_hcrypto) \
+ $(top_builddir)/lib/asn1/libasn1.la \
++ $(top_builddir)/lib/wind/libwind.la \
+ $(LIBADD_roken) \
+ $(LIB_door_create) \
+ $(LIB_dlopen)
diff --git a/package/heimdal/patches/patch-lib_krb5_constants_c b/package/heimdal/patches/patch-lib_krb5_constants_c
new file mode 100644
index 000000000..b2f413c88
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_krb5_constants_c
@@ -0,0 +1,10 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/krb5/constants.c 2008-07-28 14:04:45.000000000 +0200
++++ heimdal-1.2.1/lib/krb5/constants.c 2009-01-06 14:04:51.435662847 +0100
+@@ -39,5 +39,5 @@ KRB5_LIB_VARIABLE const char *krb5_confi
+ #ifdef __APPLE__
+ "/Library/Preferences/edu.mit.Kerberos:"
+ #endif
+-SYSCONFDIR "/krb5.conf:/etc/krb5.conf";
++SYSCONFDIR "/krb5.conf";
+ KRB5_LIB_VARIABLE const char *krb5_defkeyname = KEYTAB_DEFAULT;
diff --git a/package/heimdal/patches/patch-lib_roken_Makefile_am b/package/heimdal/patches/patch-lib_roken_Makefile_am
new file mode 100644
index 000000000..4a34768ad
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_roken_Makefile_am
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/roken/Makefile.am 2008-07-28 14:04:48.000000000 +0200
++++ heimdal-1.2.1/lib/roken/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -187,6 +187,10 @@ roken.h: make-roken$(EXEEXT)
+ make-roken.c: roken.h.in roken.awk
+ $(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c
+
++make-roken: make-roken.c
++ $(HOSTCC) $(HOSTCFLAGS) -I$(top_builddir)/include -DHAVE_CONFIG_H \
++ -o $@ $<
++
+ EXTRA_DIST = \
+ roken.awk roken.h.in \
+ $(man_MANS) \
diff --git a/package/heimdal/patches/patch-lib_roken_Makefile_in b/package/heimdal/patches/patch-lib_roken_Makefile_in
new file mode 100644
index 000000000..1e83ad590
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_roken_Makefile_in
@@ -0,0 +1,24 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/roken/Makefile.in 2008-07-28 14:05:33.000000000 +0200
++++ heimdal-1.2.1/lib/roken/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -665,9 +665,6 @@ getaddrinfo-test$(EXEEXT): $(getaddrinfo
+ hex-test$(EXEEXT): $(hex_test_OBJECTS) $(hex_test_DEPENDENCIES)
+ @rm -f hex-test$(EXEEXT)
+ $(LINK) $(hex_test_OBJECTS) $(hex_test_LDADD) $(LIBS)
+-make-roken$(EXEEXT): $(make_roken_OBJECTS) $(make_roken_DEPENDENCIES)
+- @rm -f make-roken$(EXEEXT)
+- $(LINK) $(make_roken_OBJECTS) $(make_roken_LDADD) $(LIBS)
+ parse_bytes-test$(EXEEXT): $(parse_bytes_test_OBJECTS) $(parse_bytes_test_DEPENDENCIES)
+ @rm -f parse_bytes-test$(EXEEXT)
+ $(LINK) $(parse_bytes_test_OBJECTS) $(parse_bytes_test_LDADD) $(LIBS)
+@@ -1818,6 +1815,10 @@ roken.h: make-roken$(EXEEXT)
+
+ make-roken.c: roken.h.in roken.awk
+ $(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c
++
++make-roken: make-roken.c
++ $(HOSTCC) $(HOSTCFLAGS) -I$(top_builddir)/include -DHAVE_CONFIG_H \
++ -o $@ $<
+ # 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/package/heimdal/patches/patch-lib_vers_Makefile_am b/package/heimdal/patches/patch-lib_vers_Makefile_am
new file mode 100644
index 000000000..c1c6f1b25
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_vers_Makefile_am
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/vers/Makefile.am 2008-07-28 14:04:38.000000000 +0200
++++ heimdal-1.2.1/lib/vers/Makefile.am 2009-01-02 22:22:25.000000000 +0100
+@@ -27,6 +27,8 @@ print_version.lo: print_version.h
+ print_version.h: make-print-version$(EXEEXT)
+ ./make-print-version$(EXEEXT) print_version.h
+
+-make-print-version.o: $(top_builddir)/include/version.h
++make-print-version: $(top_builddir)/include/version.h
++ $(HOSTCC) $(HOSTCFLAGS) -I$(top_builddir)/include -o $@ \
++ $(make_print_version_SOURCES)
+
+ EXTRA_DIST = $(build_HEADERZ)
diff --git a/package/heimdal/patches/patch-lib_vers_Makefile_in b/package/heimdal/patches/patch-lib_vers_Makefile_in
new file mode 100644
index 000000000..4f4aec554
--- /dev/null
+++ b/package/heimdal/patches/patch-lib_vers_Makefile_in
@@ -0,0 +1,24 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/lib/vers/Makefile.in 2008-07-28 14:05:34.000000000 +0200
++++ heimdal-1.2.1/lib/vers/Makefile.in 2009-01-02 22:22:25.000000000 +0100
+@@ -403,9 +403,6 @@ clean-noinstPROGRAMS:
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+-make-print-version$(EXEEXT): $(make_print_version_OBJECTS) $(make_print_version_DEPENDENCIES)
+- @rm -f make-print-version$(EXEEXT)
+- $(LINK) $(make_print_version_OBJECTS) $(make_print_version_LDADD) $(LIBS)
+
+ mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+@@ -805,7 +802,9 @@ print_version.lo: print_version.h
+ print_version.h: make-print-version$(EXEEXT)
+ ./make-print-version$(EXEEXT) print_version.h
+
+-make-print-version.o: $(top_builddir)/include/version.h
++make-print-version: $(top_builddir)/include/version.h
++ $(HOSTCC) $(HOSTCFLAGS) -DKRB5 -I$(top_builddir)/include -o $@ \
++ $(make_print_version_SOURCES)
+ # 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/package/heimdal/patches/patch-tools_krb5-config_in b/package/heimdal/patches/patch-tools_krb5-config_in
new file mode 100644
index 000000000..53882e523
--- /dev/null
+++ b/package/heimdal/patches/patch-tools_krb5-config_in
@@ -0,0 +1,23 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heimdal-1.2.1.orig/tools/krb5-config.in 2008-07-28 14:04:32.000000000 +0200
++++ heimdal-1.2.1/tools/krb5-config.in 2009-01-02 23:04:28.000000000 +0100
+@@ -71,15 +71,10 @@ if test "$do_usage" = "yes"; then
+ exit $usage_exit
+ fi
+
+-if test "$prefix" = ""; then
+- prefix=@prefix@
+-fi
+-if test "$exec_prefix" = ""; then
+- exec_prefix=@exec_prefix@
+-fi
+-
+-libdir=@libdir@
+-includedir=@includedir@
++prefix=@prefix@
++exec_prefix=$prefix
++libdir=${prefix}/lib
++includedir=${prefix}/include
+
+ if test "$print_prefix" = "yes"; then
+ echo $prefix
diff --git a/package/heyu/Config.in b/package/heyu/Config.in
new file mode 100644
index 000000000..4b6a548dc
--- /dev/null
+++ b/package/heyu/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_HEYU
+ prompt "heyu.............................. X10 home automation control using a CM11A"
+ tristate
+ default n
+ help
+ X10 home automation control using the CM11A serial device.
+
+ See http://heyu.tanj.com/heyu2/ for details.
diff --git a/package/heyu/Makefile b/package/heyu/Makefile
new file mode 100644
index 000000000..8202d29f9
--- /dev/null
+++ b/package/heyu/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= heyu
+PKG_VERSION:= 2.3.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= af3eeeaa8c432e5b3510f4df6dd39f4f
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+MASTER_SITES:= http://heyu.tanj.com/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,HEYU,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ (cd ${WRKBUILD} && ${BASH} ./Configure);
+ ${MAKE} -C ${WRKBUILD} \
+ CC="${TARGET_CC}" LD=${TARGET_CROSS}ld \
+ CFLAGS="${TARGET_CFLAGS} -I${WRKBUILD} -DSYSV -DPOSIX -DHAS_ITIMER -DLINUX -DHASSELECT -DHASTZ"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_HEYU}/etc/${PKG_NAME}
+ ${INSTALL_DATA} ./files/x10.conf ${IDIR_HEYU}/etc/${PKG_NAME}/x10.conf
+ ${INSTALL_DIR} ${IDIR_HEYU}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/heyu ${IDIR_HEYU}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/heyu/files/x10.conf b/package/heyu/files/x10.conf
new file mode 100644
index 000000000..3cacaf5e8
--- /dev/null
+++ b/package/heyu/files/x10.conf
@@ -0,0 +1,24 @@
+# this file should contain x10 appliance aliases, one per line, as:
+# appliance-name housecode modulenumber
+# for example:
+# mydesklamp A 4
+# atticfan B 3
+# sumppump C 3
+# manythings J 1-4
+#
+# IMPORTANT! disable the serial console if you need to use heyu
+# on /dev/tts/0. Read http://forum.openwrt.org/viewtopic.php?id=1767
+#
+# NOTE: using /dev/tts/1 requires the setserial package to
+# set the port to use irq 3, otherwise performance will be
+# unbearable as it is polled.
+#
+TTY /dev/tts/1
+#
+# give your location - for computing sunrise and sunset times
+# Boston, MA USA:
+#LATITUDE N42:20
+#LONGITUDE W71:05
+# Menlo Park, CA USA:
+LATITUDE N37:43
+LONGITUDE W122:20
diff --git a/package/heyu/ipkg/files/heyu.conffiles b/package/heyu/ipkg/files/heyu.conffiles
new file mode 100644
index 000000000..f3c36bc00
--- /dev/null
+++ b/package/heyu/ipkg/files/heyu.conffiles
@@ -0,0 +1 @@
+/etc/heyu/x10.conf
diff --git a/package/heyu/ipkg/heyu.control b/package/heyu/ipkg/heyu.control
new file mode 100644
index 000000000..e888f236c
--- /dev/null
+++ b/package/heyu/ipkg/heyu.control
@@ -0,0 +1,6 @@
+Package: heyu
+Priority: optional
+Section: misc
+Source: buildroot internal
+Description: X10 home automation control using the CM11A
+Depends: setserial
diff --git a/package/heyu/patches/patch-tty_c b/package/heyu/patches/patch-tty_c
new file mode 100644
index 000000000..d5a83ff86
--- /dev/null
+++ b/package/heyu/patches/patch-tty_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- heyu-2.3.2.orig/tty.c 2008-04-14 00:40:24.000000000 +0200
++++ heyu-2.3.2/tty.c 2008-10-09 14:57:18.000000000 +0200
+@@ -396,7 +396,7 @@ char *make_lock_name ( char *ttydev )
+ char err_string[200];
+
+ /* strip the leading path name */
+- ptr = rindex(ttydev, '/');
++ ptr = strrchr(ttydev, '/');
+
+ devstr = dev_string;
+
diff --git a/package/hostapd/Config.in b/package/hostapd/Config.in
new file mode 100644
index 000000000..562f1f23c
--- /dev/null
+++ b/package/hostapd/Config.in
@@ -0,0 +1,41 @@
+config ADK_COMPILE_HOSTAPD
+ tristate
+ default n
+ depends ADK_PACKAGE_HOSTAPD || ADK_PACKAGE_HOSTAPD_UTILS
+
+config ADK_PACKAGE_HOSTAPD
+ prompt "hostapd........................... An IEEE 802.11 AP, IEEE 802.1x/WPA/WPA2/EAP/RADIUS Authenticator"
+ tristate
+ default n
+ select ADK_COMPILE_HOSTAPD
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBNL
+ help
+
+ hostapd is a user space daemon for access point and
+ authentication servers. It implements IEEE 802.11 access point
+ management, IEEE 802.1X/WPA/WPA2/EAP Authenticators, RADIUS
+ client, EAP server, and RADIUS authentication server.
+
+ http://hostap.epitest.fi/hostapd/
+
+ Includes:
+ - hostapd
+
+config ADK_PACKAGE_HOSTAPD_UTILS
+ prompt "hostapd-utils..................... An IEEE 802.11 AP, IEEE 802.1x/WPA/WPA2/EAP/RADIUS Authenticator (CLI utility)"
+ tristate
+ default n
+ select ADK_COMPILE_HOSTAPD
+ depends on ADK_PACKAGE_HOSTAPD
+ help
+
+ hostapd is a user space daemon for access point and
+ authentication servers. It implements IEEE 802.11 access point
+ management, IEEE 802.1X/WPA/WPA2/EAP Authenticators, RADIUS
+ client, EAP server, and RADIUS authentication server.
+
+ http://hostap.epitest.fi/hostapd/
+
+ Includes:
+ - hostapd_cli
diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
new file mode 100644
index 000000000..b5e957719
--- /dev/null
+++ b/package/hostapd/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= hostapd
+PKG_VERSION:= 0.6.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 83630d11fa66ade9091f1b304fccd74c
+MASTER_SITES:= http://hostap.epitest.fi/releases/
+
+WRKSRC= ${WRKDIST}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,HOSTAPD,hostapd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,HOSTAPD_UTILS,hostapd-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+#MAKE_FLAGS+= OPTFLAGS="${TARGET_CFLAGS}"
+
+do-configure:
+ ${CP} ./files/hostapd.config ${WRKBUILD}/.config
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_HOSTAPD_UTILS}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/hostapd_cli ${IDIR_HOSTAPD_UTILS}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_HOSTAPD}/etc
+ ${INSTALL_DIR} ${IDIR_HOSTAPD}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/hostapd ${IDIR_HOSTAPD}/usr/sbin/
+ ${INSTALL_DATA} ./files/hostapd.conf ${IDIR_HOSTAPD}/etc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/hostapd/files/hostapd.conf b/package/hostapd/files/hostapd.conf
new file mode 100644
index 000000000..8676e96a6
--- /dev/null
+++ b/package/hostapd/files/hostapd.conf
@@ -0,0 +1,23 @@
+##### hostapd configuration file #####
+interface=wlan0
+#bridge=br0
+driver=nl80211
+logger_syslog=-1
+logger_syslog_level=0
+logger_stdout=-1
+logger_stdout_level=0
+ctrl_interface=/var/run/hostapd
+ctrl_interface_group=0
+# set ssid, channel and mode
+ssid=openadk
+hw_mode=g
+channel=1
+# enable WPA2 (WEP/WPA disabled)
+macaddr_acl=0
+auth_algs=1
+ignore_broadcast_ssid=0
+wpa=2
+wpa_passphrase=secret123
+wpa_key_mgmt=WPA-PSK
+wpa_pairwise=TKIP
+rsn_pairwise=CCMP
diff --git a/package/hostapd/files/hostapd.config b/package/hostapd/files/hostapd.config
new file mode 100644
index 000000000..7f9815dff
--- /dev/null
+++ b/package/hostapd/files/hostapd.config
@@ -0,0 +1,77 @@
+# Example hostapd build time configuration
+#
+# This file lists the configuration options that are used when building the
+# hostapd binary. All lines starting with # are ignored. Configuration option
+# lines must be commented out complete, if they are not to be included, i.e.,
+# just setting VARIABLE=n is not disabling that variable.
+#
+# This file is included in Makefile, so variables like CFLAGS and LIBS can also
+# be modified from here. In most cass, these lines should use += in order not
+# to override previous values of the variables.
+
+# Driver interface for drivers using the nl80211 kernel interface
+CONFIG_DRIVER_NL80211=y
+
+# Driver interface for Host AP driver
+#CONFIG_DRIVER_HOSTAP=y
+
+# Driver interface for wired authenticator
+#CONFIG_DRIVER_WIRED=y
+
+# Driver interface for madwifi driver
+#CONFIG_DRIVER_MADWIFI=y
+#CFLAGS += -I../head # change to reflect local setup; directory for madwifi src
+
+# Driver interface for Prism54 driver
+#CONFIG_DRIVER_PRISM54=y
+
+# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+#CONFIG_DRIVER_BSD=y
+#CFLAGS += -I/usr/local/include
+#LIBS += -L/usr/local/lib
+
+# IEEE 802.11F/IAPP
+#CONFIG_IAPP=y
+
+# WPA2/IEEE 802.11i RSN pre-authentication
+# CONFIG_RSN_PREAUTH=y
+
+# Integrated EAP authenticator
+#CONFIG_EAP=y
+
+# EAP-MD5 for the integrated EAP authenticator
+#CONFIG_EAP_MD5=y
+
+# EAP-TLS for the integrated EAP authenticator
+#CONFIG_EAP_TLS=y
+
+# EAP-MSCHAPv2 for the integrated EAP authenticator
+#CONFIG_EAP_MSCHAPV2=y
+
+# EAP-PEAP for the integrated EAP authenticator
+#CONFIG_EAP_PEAP=y
+
+# EAP-PSK for the integrated EAP authenticator
+#CONFIG_EAP_PSK=y
+
+# EAP-GTC for the integrated EAP authenticator
+#CONFIG_EAP_GTC=y
+
+# EAP-TTLS for the integrated EAP authenticator
+#CONFIG_EAP_TTLS=y
+
+# EAP-SIM for the integrated EAP authenticator
+#CONFIG_EAP_SIM=y
+
+# PKCS#12 (PFX) support (used to read private key and certificate file from
+# a file that usually has extension .p12 or .pfx)
+#CONFIG_PKCS12=y
+
+# RADIUS authentication server. This provides access to the integrated EAP
+# authenticator from external hosts using RADIUS.
+#CONFIG_RADIUS_SERVER=y
+#
+# Remove debugging code that is printing out debug messages to stdout.
+# This can be used to reduce the size of the hostapd considerably if debugging
+# code is not needed.
+#CONFIG_NO_STDOUT_DEBUG=y
diff --git a/package/hostapd/ipkg/hostapd-utils.control b/package/hostapd/ipkg/hostapd-utils.control
new file mode 100644
index 000000000..5f8d82d9c
--- /dev/null
+++ b/package/hostapd/ipkg/hostapd-utils.control
@@ -0,0 +1,5 @@
+Package: hostapd-utils
+Priority: optional
+Section: net
+Depends: hostapd
+Description: an IEEE 802.11 AP, IEEE 802.1x/WPA/WPA2/EAP/RADIUS Authenticator (CLI utility)
diff --git a/package/hostapd/ipkg/hostapd.conffiles b/package/hostapd/ipkg/hostapd.conffiles
new file mode 100644
index 000000000..f61980010
--- /dev/null
+++ b/package/hostapd/ipkg/hostapd.conffiles
@@ -0,0 +1 @@
+/etc/hostapd.conf
diff --git a/package/hostapd/ipkg/hostapd.control b/package/hostapd/ipkg/hostapd.control
new file mode 100644
index 000000000..cb2dac672
--- /dev/null
+++ b/package/hostapd/ipkg/hostapd.control
@@ -0,0 +1,6 @@
+Package: hostapd
+Priority: optional
+Section: net
+Depends: kmod-madwifi, libopenssl
+Provides: hostpad
+Description: an IEEE 802.11 AP, IEEE 802.1x/WPA/WPA2/EAP/RADIUS Authenticator
diff --git a/package/hostapd/patches/patch-hostapd_Makefile b/package/hostapd/patches/patch-hostapd_Makefile
new file mode 100644
index 000000000..fdae44c6c
--- /dev/null
+++ b/package/hostapd/patches/patch-hostapd_Makefile
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- hostapd-0.6.9.orig/hostapd/Makefile 2009-03-23 15:06:28.000000000 +0100
++++ hostapd-0.6.9/hostapd/Makefile 2009-04-29 23:24:00.835839521 +0200
+@@ -8,7 +8,7 @@ endif
+
+ # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
+ # a file (undefine it, if you want to save in binary size)
+-CFLAGS += -DHOSTAPD_DUMP_STATE
++# CFLAGS += -DHOSTAPD_DUMP_STATE
+
+ CFLAGS += -I../src
+ CFLAGS += -I../src/crypto
diff --git a/package/htpdate/Config.in b/package/htpdate/Config.in
new file mode 100644
index 000000000..b3801ed03
--- /dev/null
+++ b/package/htpdate/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_HTPDATE
+ prompt "htpdate........................... HTP (Hypertext Time Protocol) implementation"
+ tristate
+ default n
+ help
+ An HTP (Hypertext Time Protocol) implementation
+
+ http://www.clevervest.com/htp/
diff --git a/package/htpdate/Makefile b/package/htpdate/Makefile
new file mode 100644
index 000000000..f0e9f77ce
--- /dev/null
+++ b/package/htpdate/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= htpdate
+PKG_VERSION:= 0.9.0
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 12cf883c5619cf4c13a62f77f1a55b54
+MASTER_SITES:= http://www.clevervest.com/htp/archive/c/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,HTPDATE,htpdate,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_HTPDATE}/etc/init.d/
+ ${INSTALL_BIN} ./files/htpdate.init \
+ ${IDIR_HTPDATE}/etc/init.d/htpdate
+ ${INSTALL_DIR} ${IDIR_HTPDATE}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/htpdate ${IDIR_HTPDATE}/usr/sbin/
+
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/htpdate/files/htpdate.init b/package/htpdate/files/htpdate.init
new file mode 100644
index 000000000..3c291ef54
--- /dev/null
+++ b/package/htpdate/files/htpdate.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${htpdate:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ htpdate -l -s -t $htpdate_flags && htpdate -D $htpdate_flags
+ ;;
+stop)
+ killall htpdate
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+
+esac
+exit $?
diff --git a/package/htpdate/ipkg/htpdate.control b/package/htpdate/ipkg/htpdate.control
new file mode 100644
index 000000000..cdb470c2d
--- /dev/null
+++ b/package/htpdate/ipkg/htpdate.control
@@ -0,0 +1,4 @@
+Package: htpdate
+Priority: optional
+Section: net
+Description: an HTP (Hypertext Time Protocol) implementation
diff --git a/package/htpdate/ipkg/htpdate.postinst b/package/htpdate/ipkg/htpdate.postinst
new file mode 100644
index 000000000..baf149665
--- /dev/null
+++ b/package/htpdate/ipkg/htpdate.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf htpdate htpdate NO
+add_rcconf htpdate_flags htpdate_flags "www.google.com www.yahoo.com www.linux.org www.freebsd.org"
diff --git a/package/htpdate/patches/patch-Makefile b/package/htpdate/patches/patch-Makefile
new file mode 100644
index 000000000..edd5b9c38
--- /dev/null
+++ b/package/htpdate/patches/patch-Makefile
@@ -0,0 +1,14 @@
+$Id$
+--- htpdate-0.9.0.orig/Makefile Sun Dec 11 22:34:35 2005
++++ htpdate-0.9.0/Makefile Tue Jan 16 23:47:33 2007
+@@ -2,8 +2,8 @@ prefix = /usr
+ bindir = ${prefix}/bin
+ mandir = ${prefix}/share/man
+
+-CC = gcc
+-CFLAGS += -Wall -ansi -Os -DDEBUG
++CC ?= gcc
++CFLAGS ?= -Wall -ansi -Os -DDEBUG
+
+ INSTALL = /usr/bin/install -c
+ STRIP = /usr/bin/strip -s
diff --git a/package/httping/Config.in b/package/httping/Config.in
new file mode 100644
index 000000000..10c77aea7
--- /dev/null
+++ b/package/httping/Config.in
@@ -0,0 +1,21 @@
+#menu "httping........................... Httping is like 'ping' but for http-requests."
+
+config ADK_PACKAGE_HTTPING
+ prompt "httping........................... Httping is like 'ping' but for http-requests."
+ tristate
+ default n
+ help
+ Httping is like 'ping' but for http-requests.
+ Give it an url, and it'll show you how long it takes to connect, send a
+ request and retrieve the reply (only the headers). Be aware that the
+ transmission across the network also takes time!
+
+ http://www.vanheusden.com/httping/
+
+config ADK_PACKAGE_HTTPING_WITH_SSL
+ prompt " Enable SSL support"
+ bool
+ default y
+ depends ADK_PACKAGE_HTTPING
+
+#endmenu
diff --git a/package/httping/Makefile b/package/httping/Makefile
new file mode 100644
index 000000000..4a1f76c1b
--- /dev/null
+++ b/package/httping/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= httping
+PKG_VERSION:= 1.2.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b257586da8acec18185c134ed86d2fdd
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+MASTER_SITES:= http://www.vanheusden.com/httping/
+
+PKG_DEPEND=libopenssl
+ifneq (${ADK_PACKAGE_HTTPING_WITH_SSL},y)
+SSL_ENABLE:=".nossl"
+PKG_DEPEND:=""
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,HTTPING,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${MAKE} -C ${WRKBUILD} -f ${WRKBUILD}/Makefile${SSL_ENABLE} \
+ CC="${TARGET_CC}" STAGING_DIR=${STAGING_DIR}
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_HTTPING}/usr/sbin
+ echo "Depends: ${PKG_DEPEND}" >> ${IDIR_HTTPING}/CONTROL/control
+ ${CP} ${WRKBUILD}/${PKG_NAME} ${IDIR_HTTPING}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/httping/ipkg/httping.control b/package/httping/ipkg/httping.control
new file mode 100644
index 000000000..5ab31d962
--- /dev/null
+++ b/package/httping/ipkg/httping.control
@@ -0,0 +1,4 @@
+Package: httping
+Section: net
+Priority: optional
+Description: Httping is like 'ping' but for http-requests.
diff --git a/package/httping/patches/patch-Makefile b/package/httping/patches/patch-Makefile
new file mode 100644
index 000000000..89099b868
--- /dev/null
+++ b/package/httping/patches/patch-Makefile
@@ -0,0 +1,14 @@
+$Id$
+--- httping-1.2.3.orig/Makefile 2007-05-01 14:05:43.000000000 +0000
++++ httping-1.2.3/Makefile 2007-06-20 14:19:59.000000000 +0000
+@@ -15,8 +15,8 @@
+ include version
+
+ DEBUG=-g # -D_DEBUG
+-LDFLAGS+=-lssl -lcrypto $(DEBUG)
+-CFLAGS+=-O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG)
++LDFLAGS+=-lssl -lcrypto $(DEBUG) -L$(STAGING_DIR)/usr/lib
++CFLAGS+=-O2 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) -I$(STAGING_DIR)/usr/include
+
+ OBJS=mem.o http.o io.o str.o error.o utils.o main.o tcp.o mssl.o res.o
+
diff --git a/package/httping/patches/patch-io_c b/package/httping/patches/patch-io_c
new file mode 100644
index 000000000..b1ac1166b
--- /dev/null
+++ b/package/httping/patches/patch-io_c
@@ -0,0 +1,12 @@
+$Id$
+--- httping-1.2.3.orig/io.c 2007-05-01 14:05:43.000000000 +0000
++++ httping-1.2.3/io.c 2007-06-20 14:19:11.000000000 +0000
+@@ -37,7 +37,7 @@ ssize_t myread(int fd, char *whereto, si
+ struct timeval to;
+ fd_set rfds;
+
+- FD_ZERO(&rfds);
++ //FD_ZERO(&rfds);
+ FD_SET(fd, &rfds);
+
+ to.tv_sec = timeout / 1000;
diff --git a/package/httptunnel/Config.in b/package/httptunnel/Config.in
new file mode 100644
index 000000000..cb5b0b83a
--- /dev/null
+++ b/package/httptunnel/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_HTTPTUNNEL
+ prompt "httptunnel........................ http tunneling software"
+ tristate
+ default n
+ help
+ httptunnel creates a bidirectional virtual data connection tunnelled
+ in HTTP requests.
+
+ http://www.nocrew.org/software/httptunnel.html
diff --git a/package/httptunnel/Makefile b/package/httptunnel/Makefile
new file mode 100644
index 000000000..a848f93a3
--- /dev/null
+++ b/package/httptunnel/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= httptunnel
+PKG_VERSION:= 3.0.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2a710f377c82ab4eb201458f7b9f99c5
+MASTER_SITES:= http://www.nocrew.org/software/httptunnel/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,HTTPTUNNEL,httptunnel,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_HTTPTUNNEL}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/hts ${IDIR_HTTPTUNNEL}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/htc ${IDIR_HTTPTUNNEL}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/httptunnel/ipkg/httptunnel.control b/package/httptunnel/ipkg/httptunnel.control
new file mode 100644
index 000000000..45835ff17
--- /dev/null
+++ b/package/httptunnel/ipkg/httptunnel.control
@@ -0,0 +1,4 @@
+Package: httptunnel
+Priority: optional
+Section: net
+Description: http tunneling software
diff --git a/package/icecast/Config.in b/package/icecast/Config.in
new file mode 100644
index 000000000..ea007003e
--- /dev/null
+++ b/package/icecast/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_ICECAST
+ prompt "icecast........................... A streaming media server for Ogg/Vorbis and MP3 audio streams"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBCURL
+ select ADK_PACKAGE_LIBVORBIS
+ select ADK_PACKAGE_LIBXML2
+ select ADK_PACKAGE_LIBXSLT
+ help
+ Icecast is a streaming media server which currently supports Ogg
+ Vorbis and MP3 audio streams. It can be used to create an Internet
+ radio station or a privately running jukebox and many things in
+ between. It is very versatile in that new formats can be added
+ relatively easily and supports open standards for commuincation and
+ interaction.
+
+ http://www.icecast.org/
diff --git a/package/icecast/Makefile b/package/icecast/Makefile
new file mode 100644
index 000000000..77ff8f48f
--- /dev/null
+++ b/package/icecast/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= icecast
+PKG_VERSION:= 2.3.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ff516b3ccd2bcc31e68f460cd316093f
+MASTER_SITES:= http://downloads.us.xiph.org/releases/icecast/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ICECAST,icecast,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TCPPFLAGS+= -I${STAGING_DIR}/usr/include/libxml2
+CONFIGURE_STYLE= autotool gnu
+CONFIGURE_ARGS+= --disable-yp \
+ --with-curl="yes" \
+ --with-curl-config="${STAGING_DIR}/usr/bin/curl-config" \
+ --with-ogg="${STAGING_DIR}/usr" \
+ --with-vorbis="${STAGING_DIR}/usr" \
+ --with-speex="no" \
+ --with-theora="no" \
+ --with-xslt-config="${STAGING_DIR}/usr/bin/xslt-config"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ICECAST}/etc
+ ${CP} ${WRKINST}/etc/icecast.xml ${IDIR_ICECAST}/etc/
+ ${INSTALL_DIR} ${IDIR_ICECAST}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/icecast ${IDIR_ICECAST}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_ICECAST}/usr/share/icecast
+ ${CP} ${WRKINST}/usr/share/icecast/admin ${IDIR_ICECAST}/usr/share/icecast/
+ ${CP} ${WRKINST}/usr/share/icecast/web ${IDIR_ICECAST}/usr/share/icecast/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/icecast/ipkg/icecast.conffiles b/package/icecast/ipkg/icecast.conffiles
new file mode 100644
index 000000000..1203e9dc4
--- /dev/null
+++ b/package/icecast/ipkg/icecast.conffiles
@@ -0,0 +1 @@
+/etc/icecast.xml
diff --git a/package/icecast/ipkg/icecast.control b/package/icecast/ipkg/icecast.control
new file mode 100644
index 000000000..4df9d507f
--- /dev/null
+++ b/package/icecast/ipkg/icecast.control
@@ -0,0 +1,5 @@
+Package: icecast
+Priority: optional
+Section: net
+Depends: libcurl, libvorbisidec, libpthread, libxml2, libxslt
+Description: A streaming media server
diff --git a/package/icecast/patches/patch-m4_xiph_curl_m4 b/package/icecast/patches/patch-m4_xiph_curl_m4
new file mode 100644
index 000000000..b88806380
--- /dev/null
+++ b/package/icecast/patches/patch-m4_xiph_curl_m4
@@ -0,0 +1,12 @@
+$Id$
+--- icecast-2.3.2.orig/m4/xiph_curl.m4 2008-04-19 03:54:26.000000000 +0200
++++ icecast-2.3.2/m4/xiph_curl.m4 2008-08-29 12:34:17.000000000 +0200
+@@ -52,7 +52,7 @@ AC_CHECK_HEADERS([curl/curl.h],, curl_ok
+ AC_MSG_CHECKING(for libcurl)
+ if test "$curl_ok" = "yes"
+ then
+- AC_RUN_IFELSE(AC_LANG_SOURCE([
++ AC_LINK_IFELSE(AC_LANG_SOURCE([
+ #include <curl/curl.h>
+ int main()
+ {
diff --git a/package/id3lib/Config.in b/package/id3lib/Config.in
new file mode 100644
index 000000000..302b8148d
--- /dev/null
+++ b/package/id3lib/Config.in
@@ -0,0 +1,28 @@
+config ADK_PACKAGE_ID3LIB
+ prompt "id3lib............................ An ID3v1/ID3v2 tagging library"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_ZLIB
+ help
+ An ID3v1/ID3v2 tagging library.
+
+ http://www.id3lib.org/
+
+choice
+prompt "C++ library to use"
+depends on ADK_PACKAGE_ID3LIB
+default ADK_COMPILE_ID3LIB_WITH_STDCXX if ADK_TARGET_LIB_GLIBC
+default ADK_COMPILE_ID3LIB_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC
+
+config ADK_COMPILE_ID3LIB_WITH_STDCXX
+ bool "Standard C++ library"
+ select ADK_PACKAGE_LIBSTDCXX
+ help
+
+config ADK_COMPILE_ID3LIB_WITH_UCLIBCXX
+ bool "Embedded uClibc++ library"
+ select ADK_PACKAGE_UCLIBCXX
+ help
+
+endchoice
diff --git a/package/id3lib/Makefile b/package/id3lib/Makefile
new file mode 100644
index 000000000..bb821c4ca
--- /dev/null
+++ b/package/id3lib/Makefile
@@ -0,0 +1,42 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= id3lib
+PKG_VERSION:= 3.8.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 19f27ddd2dda4b2d26a559a4f0f402a7
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=id3lib/}
+
+PKG_DEPEND:= zlib libiconv
+ifeq ($(ADK_COMPILE_ID3LIB_WITH_UCLIBCXX),y)
+PKG_DEPEND+= uclibc++
+else
+PKG_DEPEND+= libstdcxx
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ID3LIB,id3lib,${PKG_VERSION}-${PKG_RELEASE},${ARCH},${PKG_DEPEND}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-cxx-warnings=no
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+ifeq ($(ADK_COMPILE_ID3LIB_WITH_UCLIBCXX),y)
+TCXXFLAGS+= -fno-builtin -fno-rtti -nostdinc++ \
+ -I${STAGING_DIR}/usr/include/uClibc++
+CONFIGURE_ENV+= LIBS="-nodefaultlibs -luClibc++ -lz -lm -lc"
+else
+TLDFLAGS+= -shared
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ID3LIB}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libid3-*.so.* ${IDIR_ID3LIB}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/id3lib/ipkg/id3lib.control b/package/id3lib/ipkg/id3lib.control
new file mode 100644
index 000000000..2a7b02a35
--- /dev/null
+++ b/package/id3lib/ipkg/id3lib.control
@@ -0,0 +1,4 @@
+Package: id3lib
+Priority: optional
+Section: libs
+Description: An ID3v1/ID3v2 tagging library.
diff --git a/package/id3lib/patches/patch-Makefile_in b/package/id3lib/patches/patch-Makefile_in
new file mode 100644
index 000000000..89abb743c
--- /dev/null
+++ b/package/id3lib/patches/patch-Makefile_in
@@ -0,0 +1,15 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+
+* disable examples
+
+--- id3lib-3.8.3.orig/Makefile.in 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/Makefile.in 2008-12-15 13:21:08.000000000 +0100
+@@ -132,7 +132,7 @@ EXTRA_DIST = \
+ @ID3_NEEDZLIB_TRUE@zlib_subdir = zlib
+ @ID3_NEEDZLIB_FALSE@zlib_subdir =
+
+-SUBDIRS = . m4 $(zlib_subdir) doc include id3com src examples
++SUBDIRS = . m4 $(zlib_subdir) doc include id3com src
+ DIST_SUBDIRS = . m4 zlib doc include id3com src examples prj libprj
+
+ INCLUDES = @ID3LIB_DEBUG_FLAGS@
diff --git a/package/id3lib/patches/patch-configure b/package/id3lib/patches/patch-configure
new file mode 100644
index 000000000..6853215af
--- /dev/null
+++ b/package/id3lib/patches/patch-configure
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- id3lib-3.8.3.orig/configure 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/configure 2008-12-15 13:14:18.000000000 +0100
+@@ -10296,7 +10296,7 @@ done
+
+ for ac_header in \
+ string \
+- iomanip.h \
++ iomanip \
+
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff --git a/package/id3lib/patches/patch-include_id3_id3lib_strings_h b/package/id3lib/patches/patch-include_id3_id3lib_strings_h
new file mode 100644
index 000000000..9b21c2c4a
--- /dev/null
+++ b/package/id3lib/patches/patch-include_id3_id3lib_strings_h
@@ -0,0 +1,20 @@
+$Id$
+--- id3lib-3.8.3.orig/include/id3/id3lib_strings.h 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/include/id3/id3lib_strings.h 2008-12-15 13:15:00.000000000 +0100
+@@ -30,6 +30,7 @@
+ #define _ID3LIB_STRINGS_H_
+
+ #include <string>
++#include <cstring>
+
+ #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
+ namespace std
+@@ -41,7 +42,7 @@ namespace std
+ // Unsigned as wint_t in unsigned.
+ typedef unsigned long int_type;
+ typedef streampos pos_type;
+- typedef streamoff off_type;
++ //typedef streamoff off_type;
+ typedef mbstate_t state_type;
+
+ static void
diff --git a/package/id3lib/patches/patch-include_id3_writers_h b/package/id3lib/patches/patch-include_id3_writers_h
new file mode 100644
index 000000000..a33f707de
--- /dev/null
+++ b/package/id3lib/patches/patch-include_id3_writers_h
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- id3lib-3.8.3.orig/include/id3/writers.h 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/include/id3/writers.h 2008-12-15 13:15:25.000000000 +0100
+@@ -30,7 +30,7 @@
+
+ #include "id3/writer.h"
+ #include "id3/id3lib_streams.h"
+-//#include <string.h>
++#include <cstring>
+
+ class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer
+ {
diff --git a/package/iftop/Config.in b/package/iftop/Config.in
new file mode 100644
index 000000000..226032d4c
--- /dev/null
+++ b/package/iftop/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_IFTOP
+ prompt "iftop............................. display bandwith usage on an interface"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ iftop does for network usage what top(1) does for CPU usage. It
+ listens to network traffic on a named interface and displays a
+ table of current bandwidth usage by pairs of hosts. Handy for
+ answering the question "why is our ADSL link so slow?".
+
+ http://www.ex-parrot.com/~pdw/iftop/
diff --git a/package/iftop/Makefile b/package/iftop/Makefile
new file mode 100644
index 000000000..9981b1a87
--- /dev/null
+++ b/package/iftop/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= iftop
+PKG_VERSION:= 0.17
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 062bc8fb3856580319857326e0b8752d
+MASTER_SITES:= http://www.ex-parrot.com/~pdw/iftop/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IFTOP,iftop,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+pots-install:
+ ${INSTALL_DIR} ${IDIR_IFTOP}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/${PKG_NAME} ${IDIR_IFTOP}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/iftop/ipkg/iftop.control b/package/iftop/ipkg/iftop.control
new file mode 100644
index 000000000..ce2cbadd5
--- /dev/null
+++ b/package/iftop/ipkg/iftop.control
@@ -0,0 +1,5 @@
+Package: iftop
+Priority: optional
+Section: net
+Depends: libncurses, libpcap, libpthread
+Description: display bandwith usage on an interface
diff --git a/package/igmpproxy/Config.in b/package/igmpproxy/Config.in
new file mode 100644
index 000000000..59f8ae187
--- /dev/null
+++ b/package/igmpproxy/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_IGMPPROXY
+ prompt "igmpproxy......................... Multicast Routing Daemon"
+ tristate
+ default n
+ help
+ IGMPproxy is a simple dynamic Multicast Routing Daemon using
+ only IGMP signalling (Internet Group Management Protocol).
+
+ http://sourceforge.net/projects/igmpproxy
diff --git a/package/igmpproxy/Makefile b/package/igmpproxy/Makefile
new file mode 100644
index 000000000..a52cc8133
--- /dev/null
+++ b/package/igmpproxy/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= igmpproxy
+PKG_VERSION:= 0.1-beta2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2a5a59480f44d4b14077a6b5319e9940
+DISTFILES:= ${PKG_NAME}-src-${PKG_VERSION}.tar.gz
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=igmpproxy/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IGMPPROXY,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${MAKE} CC="${TARGET_CC}" CFLAGS="${TARGET_CFLAGS}" -C ${WRKBUILD}/src
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_IGMPPROXY}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_IGMPPROXY}/etc
+ ${INSTALL_BIN} ${WRKBUILD}/src/${PKG_NAME} ${IDIR_IGMPPROXY}/usr/sbin/
+ ${INSTALL_DATA} ${WRKBUILD}/src/${PKG_NAME}.conf ${IDIR_IGMPPROXY}/etc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/igmpproxy/ipkg/igmpproxy.control b/package/igmpproxy/ipkg/igmpproxy.control
new file mode 100644
index 000000000..26bfe1563
--- /dev/null
+++ b/package/igmpproxy/ipkg/igmpproxy.control
@@ -0,0 +1,4 @@
+Package: igmpproxy
+Section: net
+Priority: optional
+Description: IGMPproxy is a simple dynamic Multicast Routing Daemon.
diff --git a/package/inputproto/Config.in b/package/inputproto/Config.in
new file mode 100644
index 000000000..da7749134
--- /dev/null
+++ b/package/inputproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_INPUTPROTO
+ prompt "inputproto............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/inputproto/Makefile b/package/inputproto/Makefile
new file mode 100644
index 000000000..2ae002b80
--- /dev/null
+++ b/package/inputproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= inputproto
+PKG_VERSION:= 1.4.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 55c67c1f42d70458a3e4d153c8c07cf7
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ipcad/Config.in b/package/ipcad/Config.in
new file mode 100644
index 000000000..e9c3f3278
--- /dev/null
+++ b/package/ipcad/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_IPCAD
+ prompt "ipcad............................. listens for traffic on the specified interfaces"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCAP
+ help
+ This daemon listens for traffic on the specified interfaces.
+ It has the built-in RSH and NetFlow engines to allow exporting
+ the accounting data the same way as Cisco routers do.
+
+ http://lionet.info/ipcad/
+
diff --git a/package/ipcad/Makefile b/package/ipcad/Makefile
new file mode 100644
index 000000000..11cef0586
--- /dev/null
+++ b/package/ipcad/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ipcad
+PKG_VERSION:= 3.7.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 125605249958894148ec26d3c88189f5
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=ipcad/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IPCAD,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-ifst=linux \
+ --with-psrc=pcap \
+ --with-pcap-include="${STAGING_DIR}/usr/include" \
+ --with-pcap-libraries="${STAGING_DIR}/usr/lib"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+pre-build:
+ touch $(WRKBUILD)/cfglex.c $(WRKBUILD)/cslex.c
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_IPCAD}/usr/bin
+ ${INSTALL_DIR} ${IDIR_IPCAD}/etc
+ ${INSTALL_DATA} ${WRKINST}/etc/ipcad.conf ${IDIR_IPCAD}/etc/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ipcad ${IDIR_IPCAD}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ipcad/ipkg/ipcad.conffiles b/package/ipcad/ipkg/ipcad.conffiles
new file mode 100644
index 000000000..f6843d846
--- /dev/null
+++ b/package/ipcad/ipkg/ipcad.conffiles
@@ -0,0 +1 @@
+/etc/ipcad.conf
diff --git a/package/ipcad/ipkg/ipcad.control b/package/ipcad/ipkg/ipcad.control
new file mode 100644
index 000000000..93df70c1d
--- /dev/null
+++ b/package/ipcad/ipkg/ipcad.control
@@ -0,0 +1,6 @@
+Package: ipcad
+Depends: libpcap
+Section: net
+Architecture: mipsel
+Priority: optional
+Description: IPCAD stands for IP Cisco Accounting Daemon. It runs in background, listens traffic on the specified interfaces, and records the traffic for later retrieval and analysis. IPCAD can use raw BPF devices, PCAP library, divert, tee or Linux iptables' ULOG & IPQ packet sources to capture the packets.
diff --git a/package/ipcad/patches/patch-configure b/package/ipcad/patches/patch-configure
new file mode 100644
index 000000000..dfcf87cea
--- /dev/null
+++ b/package/ipcad/patches/patch-configure
@@ -0,0 +1,99 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ipcad-3.7.3.orig/configure 2007-04-22 10:08:45.000000000 +0200
++++ ipcad-3.7.3/configure 2008-12-22 15:49:17.000000000 +0100
+@@ -2691,10 +2691,6 @@ fi
+
+ fi
+
+-LDFLAGS="$LDFLAGS -L${ac_default_prefix}/lib"
+-CFLAGS="$CFLAGS -I${ac_default_prefix}/include"
+-CPPFLAGS="$CPPFLAGS -I${ac_default_prefix}/include"
+-
+
+ for ac_func in pthread_detach
+ do
+@@ -4872,84 +4868,6 @@ done
+
+
+
+-for ac_header in linux/netfilter_ipv4/ipt_ULOG.h
+-do
+-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-echo "$as_me:$LINENO: checking for $ac_header" >&5
+-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#ifdef HAVE_SYS_TYPES_H
+-#include <sys/types.h>
+-#endif
+-#ifdef HAVE_ASM_TYPES_H
+-#include <asm/types.h>
+-#endif
+-#ifdef HAVE_SYS_SOCKET_H
+-#include <sys/socket.h>
+-#endif
+-#ifdef HAVE_LINUX_SOCKET_H
+-#include <linux/socket.h>
+-#endif
+-#ifdef HAVE_LINUX_NETLINK_H
+-#include <linux/netlink.h>
+-#endif
+-#ifdef HAVE_NET_IF_H
+-#include <net/if.h>
+-#endif
+-
+-
+-#include <$ac_header>
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- eval "$as_ac_Header=yes"
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-eval "$as_ac_Header=no"
+-fi
+-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+- cat >>confdefs.h <<_ACEOF
+-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+-_ACEOF
+-
+-fi
+-
+-done
+
+
+
diff --git a/package/ipcad/patches/patch-loop-ipq_c b/package/ipcad/patches/patch-loop-ipq_c
new file mode 100644
index 000000000..ca1c8e98e
--- /dev/null
+++ b/package/ipcad/patches/patch-loop-ipq_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ipcad-3.7.3.orig/loop-ipq.c 2007-04-22 10:08:45.000000000 +0200
++++ ipcad-3.7.3/loop-ipq.c 2008-10-09 16:47:02.000000000 +0200
+@@ -29,6 +29,7 @@
+ #include "ipcad.h"
+ #include "opt.h"
+
++#define NF_ACCEPT 1
+
+ #ifndef PSRC_ipq
+
diff --git a/package/iperf/Config.in b/package/iperf/Config.in
new file mode 100644
index 000000000..c498a5b16
--- /dev/null
+++ b/package/iperf/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_IPERF
+ prompt "iperf............................. Internet Protocol bandwidth measuring tool"
+ tristate
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBPTHREAD
+ default n
+ help
+ Iperf is a modern alternative for measuring TCP and UDP bandwidth
+ performance, allowing the tuning of various parameters and
+ characteristics.
+
+ http://dast.nlanr.net/Projects/Iperf/
+
diff --git a/package/iperf/Makefile b/package/iperf/Makefile
new file mode 100644
index 000000000..358e54724
--- /dev/null
+++ b/package/iperf/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= iperf
+PKG_VERSION:= 2.0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8c5bc14cc2ea55f18f22afe3c23e3dcb
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=iperf/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IPERF,iperf,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull=yes \
+ LIBS="-lc -lm -lgcc_s -lpthread"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+ifeq ($(ADK_TARGET_LIB_UCLIBCXX),y)
+TCXXFLAGS+= -fno-builtin -fno-rtti -nostdinc++
+TLDFLAGS+= -nodefaultlibs
+CONFIGURE_ENV+= LIBS="-luClibc++ -lc -lm -lgcc_s -lpthread"
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_IPERF}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/iperf ${IDIR_IPERF}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/iperf/ipkg/iperf.control b/package/iperf/ipkg/iperf.control
new file mode 100644
index 000000000..b58436f6e
--- /dev/null
+++ b/package/iperf/ipkg/iperf.control
@@ -0,0 +1,5 @@
+Package: iperf
+Priority: optional
+Section: net
+Depends: uclibc++, libgcc, libpthread
+Description: Internet Protocol bandwidth measuring tool.
diff --git a/package/iproute2/Config.in b/package/iproute2/Config.in
new file mode 100644
index 000000000..a2f60f226
--- /dev/null
+++ b/package/iproute2/Config.in
@@ -0,0 +1,18 @@
+config ADK_COMPILE_IPROUTE2
+ tristate
+ default n
+
+config ADK_PACKAGE_IP
+ prompt "ip................................ iproute2 routing control utility"
+ tristate
+ default n
+ select ADK_COMPILE_IPROUTE2
+
+config ADK_PACKAGE_TC
+ prompt "tc................................ iproute2 traffic control utility"
+ tristate
+ default n
+ select ADK_COMPILE_IPROUTE2
+ help
+ Traffic shaping control utility. Please choose the kmod-sched-* modules
+ you need.
diff --git a/package/iproute2/Makefile b/package/iproute2/Makefile
new file mode 100644
index 000000000..f688ccbee
--- /dev/null
+++ b/package/iproute2/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= iproute2
+PKG_VERSION:= 2.6.29-1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c1bc258a6c345905e79935ac7a3cc582
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
+MASTER_SITES:= http://developer.osdl.org/dev/iproute2/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IP,ip,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,TC,tc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-configure:
+ ${SED} "s:-O2:${TARGET_CFLAGS}:g" ${WRKBUILD}/Makefile
+ ${SED} "s,-I/usr/include/db3,," ${WRKBUILD}/Makefile
+ ${SED} "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=${LINUX_DIR}/include," \
+ ${WRKBUILD}/Makefile
+ ${SED} "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=${STAGING_DIR}/include," \
+ ${WRKBUILD}/Makefile
+ # For now disable compiling of the misc directory because it seems to fail
+ rm -rf ${WRKBUILD}/misc
+ ${SED} "s, misc,," ${WRKBUILD}/Makefile
+ # netem is 2.6 only stuff
+ ${SED} "s, netem,," ${WRKBUILD}/Makefile
+
+do-build:
+ ${MAKE} -j1 -C ${WRKBUILD}/netem \
+ HOSTCC=${HOSTCC} \
+ CCOPTS="-I${LINUX_DIR}" \
+ ${MAKE} -j1 -C ${WRKBUILD} ${TARGET_CONFIGURE_OPTS} \
+ CFLAGS="-D_GNU_SOURCE ${TARGET_CFLAGS} -I ../include -DRESOLVE_HOSTNAMES" \
+ KERNEL_INCLUDE=${LINUX_DIR}/include all tc/tc ip/ip \
+ CCOPTS="-I${LINUX_DIR}"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_IP}/usr/sbin
+ ${CP} ${WRKBUILD}/ip/ip ${IDIR_IP}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_TC}/usr/sbin
+ ${CP} ${WRKBUILD}/tc/tc ${IDIR_TC}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/iproute2/ipkg/ip.control b/package/iproute2/ipkg/ip.control
new file mode 100644
index 000000000..8206dd37a
--- /dev/null
+++ b/package/iproute2/ipkg/ip.control
@@ -0,0 +1,4 @@
+Package: ip
+Section: net
+Priority: optional
+Description: iproute2 routing control utility
diff --git a/package/iproute2/ipkg/tc.control b/package/iproute2/ipkg/tc.control
new file mode 100644
index 000000000..8950da394
--- /dev/null
+++ b/package/iproute2/ipkg/tc.control
@@ -0,0 +1,5 @@
+Package: tc
+Section: net
+Priority: optional
+Description: iproute2 traffic control utility
+Depends: kmod-sched
diff --git a/package/iproute2/patches/patch-Makefile b/package/iproute2/patches/patch-Makefile
new file mode 100644
index 000000000..bb7ba6a10
--- /dev/null
+++ b/package/iproute2/patches/patch-Makefile
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iproute2-2.6.26.orig/Makefile 2008-07-25 22:46:07.000000000 +0200
++++ iproute2-2.6.26/Makefile 2008-10-09 17:08:16.000000000 +0200
+@@ -21,13 +21,13 @@ ADDLIB+=ipx_ntop.o ipx_pton.o
+
+ CC = gcc
+ HOSTCC = gcc
+-CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
++CCOPTS = -D_GNU_SOURCE -fwrapv -fno-ident -fwrapv -fno-ident -O2 -pipe -march=i586 -funit-at-a-time -pipe -march=i586 -funit-at-a-time -Wstrict-prototypes -Wall
+ CFLAGS = $(CCOPTS) -I../include $(DEFINES)
+ YACCFLAGS = -d -t -v
+
+ LDLIBS += -L../lib -lnetlink -lutil
+
+-SUBDIRS=lib ip tc misc netem genl
++SUBDIRS=lib ip tc genl
+
+ LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
+
diff --git a/package/iproute2/patches/patch-ip_Makefile b/package/iproute2/patches/patch-ip_Makefile
new file mode 100644
index 000000000..d1f2cceec
--- /dev/null
+++ b/package/iproute2/patches/patch-ip_Makefile
@@ -0,0 +1,10 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iproute2-2.6.26.orig/ip/Makefile 2008-07-25 22:46:07.000000000 +0200
++++ iproute2-2.6.26/ip/Makefile 2008-10-09 17:07:10.000000000 +0200
+@@ -1,5 +1,5 @@
+ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o \
+- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
++ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
+ ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o \
+ ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
+ iplink_vlan.o link_veth.o
diff --git a/package/iproute2/patches/patch-ip_iptunnel_c b/package/iproute2/patches/patch-ip_iptunnel_c
new file mode 100644
index 000000000..c9e6098fb
--- /dev/null
+++ b/package/iproute2/patches/patch-ip_iptunnel_c
@@ -0,0 +1,17 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iproute2-2.6.26.orig/ip/iptunnel.c 2008-07-25 22:46:07.000000000 +0200
++++ iproute2-2.6.26/ip/iptunnel.c 2008-10-09 17:08:43.000000000 +0200
+@@ -478,13 +478,6 @@ int do_iptunnel(int argc, char **argv)
+ break;
+ case AF_INET:
+ break;
+- /*
+- * This is silly enough but we have no easy way to make it
+- * protocol-independent because of unarranged structure between
+- * IPv4 and IPv6.
+- */
+- case AF_INET6:
+- return do_ip6tunnel(argc, argv);
+ default:
+ fprintf(stderr, "Unsupported family:%d\n", preferred_family);
+ exit(-1);
diff --git a/package/ipsec-tools/Config.in b/package/ipsec-tools/Config.in
new file mode 100644
index 000000000..b140738b1
--- /dev/null
+++ b/package/ipsec-tools/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_IPSEC_TOOLS
+ prompt "ipsec-tools....................... IPsec management tools"
+ tristate
+ depends ADK_LINUX_2_6
+ select ADK_PACKAGE_LIBOPENSSL
+ default n
+ help
+ IPsec management tools
+
+ http://ipsec-tools.sourceforge.net/
+
diff --git a/package/ipsec-tools/Makefile b/package/ipsec-tools/Makefile
new file mode 100644
index 000000000..657bb83ef
--- /dev/null
+++ b/package/ipsec-tools/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ipsec-tools
+PKG_VERSION:= 0.6.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d0242a943c82c0cbf28005966ff35e21
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=ipsec-tools/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IPSEC_TOOLS,ipsec-tools,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-kernel-headers="${LINUX_DIR}/include" \
+ --without-readline \
+ --with-openssl="${STAGING_DIR}/usr" \
+ --without-libradius \
+ --without-libpam
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_IPSEC_TOOLS}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_IPSEC_TOOLS}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_IPSEC_TOOLS}/etc
+ ${INSTALL_DATA} ${WRKBUILD}/src/racoon/samples/racoon.conf ${IDIR_IPSEC_TOOLS}/etc/
+ ${CP} ${WRKINST}/usr/lib/libipsec.so.* ${IDIR_IPSEC_TOOLS}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/libracoon.so.* ${IDIR_IPSEC_TOOLS}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/plainrsa-gen ${IDIR_IPSEC_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/racoon ${IDIR_IPSEC_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/racoonctl ${IDIR_IPSEC_TOOLS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/setkey ${IDIR_IPSEC_TOOLS}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ipsec-tools/ipkg/ipsec-tools.conffiles b/package/ipsec-tools/ipkg/ipsec-tools.conffiles
new file mode 100644
index 000000000..434045463
--- /dev/null
+++ b/package/ipsec-tools/ipkg/ipsec-tools.conffiles
@@ -0,0 +1 @@
+/etc/racoon.conf
diff --git a/package/ipsec-tools/ipkg/ipsec-tools.control b/package/ipsec-tools/ipkg/ipsec-tools.control
new file mode 100644
index 000000000..c1cade10b
--- /dev/null
+++ b/package/ipsec-tools/ipkg/ipsec-tools.control
@@ -0,0 +1,5 @@
+Package: ipsec-tools
+Priority: optional
+Section: net
+Depends: libopenssl
+Description: IPsec management tools
diff --git a/package/ipsec-tools/patches/patch-configure b/package/ipsec-tools/patches/patch-configure
new file mode 100644
index 000000000..5ff9866f7
--- /dev/null
+++ b/package/ipsec-tools/patches/patch-configure
@@ -0,0 +1,12 @@
+$Id$
+--- ipsec-tools-0.6.4.orig/configure 2005-12-09 10:03:34.000000000 +0100
++++ ipsec-tools-0.6.4/configure 2007-06-28 16:58:31.000000000 +0200
+@@ -23147,7 +23147,7 @@ echo "${ECHO_T}${crypto_dir-default}" >&
+
+ if test "x$crypto_dir" != "x"; then
+ LIBS="$LIBS -L${crypto_dir}/lib"
+- CPPFLAGS="-I${crypto_dir}/include $CPPLAGS"
++ CPPFLAGS="-I${crypto_dir}/include $CPPFLAGS"
+ fi
+ echo "$as_me:$LINENO: checking openssl version" >&5
+ echo $ECHO_N "checking openssl version... $ECHO_C" >&6
diff --git a/package/ipsec-tools/patches/patch-configure_ac b/package/ipsec-tools/patches/patch-configure_ac
new file mode 100644
index 000000000..d28f9afb7
--- /dev/null
+++ b/package/ipsec-tools/patches/patch-configure_ac
@@ -0,0 +1,12 @@
+$Id$
+--- ipsec-tools-0.6.4.orig/configure.ac 2005-12-09 10:00:28.000000000 +0100
++++ ipsec-tools-0.6.4/configure.ac 2007-06-28 16:58:31.000000000 +0200
+@@ -183,7 +183,7 @@ AC_MSG_RESULT(${crypto_dir-default})
+
+ if test "x$crypto_dir" != "x"; then
+ LIBS="$LIBS -L${crypto_dir}/lib"
+- CPPFLAGS="-I${crypto_dir}/include $CPPLAGS"
++ CPPFLAGS="-I${crypto_dir}/include $CPPFLAGS"
+ fi
+ AC_MSG_CHECKING(openssl version)
+
diff --git a/package/ipsec-tools/patches/patch-src_racoon_cftoken_l b/package/ipsec-tools/patches/patch-src_racoon_cftoken_l
new file mode 100644
index 000000000..977ba8a37
--- /dev/null
+++ b/package/ipsec-tools/patches/patch-src_racoon_cftoken_l
@@ -0,0 +1,12 @@
+$Id$
+--- ipsec-tools-0.6.4.orig/src/racoon/cftoken.l 2005-11-06 18:18:26.000000000 +0100
++++ ipsec-tools-0.6.4/src/racoon/cftoken.l 2007-06-28 16:58:31.000000000 +0200
+@@ -105,6 +105,8 @@ static struct include_stack {
+ static int incstackp = 0;
+
+ static int yy_first_time = 1;
++
++int yywrap(void) { return 1; }
+ %}
+
+ /* common seciton */
diff --git a/package/ipsec-tools/patches/patch-src_racoon_crypto_openssl_c b/package/ipsec-tools/patches/patch-src_racoon_crypto_openssl_c
new file mode 100644
index 000000000..66f9ba7d2
--- /dev/null
+++ b/package/ipsec-tools/patches/patch-src_racoon_crypto_openssl_c
@@ -0,0 +1,12 @@
+$Id$
+--- ipsec-tools-0.6.4.orig/src/racoon/crypto_openssl.c 2005-07-12 13:50:15.000000000 +0200
++++ ipsec-tools-0.6.4/src/racoon/crypto_openssl.c 2007-06-28 17:04:27.000000000 +0200
+@@ -81,7 +81,7 @@
+ #ifdef HAVE_OPENSSL_SHA2_H
+ #include <openssl/sha2.h>
+ #else
+-#include "crypto/sha2/sha2.h"
++#include "missing/crypto/sha2/sha2.h"
+ #endif
+ #endif
+
diff --git a/package/ipsec-tools/patches/patch-src_setkey_token_l b/package/ipsec-tools/patches/patch-src_setkey_token_l
new file mode 100644
index 000000000..b73f73fea
--- /dev/null
+++ b/package/ipsec-tools/patches/patch-src_setkey_token_l
@@ -0,0 +1,12 @@
+$Id$
+--- ipsec-tools-0.6.4.orig/src/setkey/token.l 2005-06-29 15:01:30.000000000 +0200
++++ ipsec-tools-0.6.4/src/setkey/token.l 2007-06-28 16:58:31.000000000 +0200
+@@ -84,6 +84,8 @@
+ #ifndef SADB_X_EALG_AESCTR
+ #define SADB_X_EALG_AESCTR (-1)
+ #endif
++
++int yywrap(void) { return 1; }
+ %}
+
+ /* common section */
diff --git a/package/ipset/Config.in b/package/ipset/Config.in
new file mode 100644
index 000000000..d6e41c5a0
--- /dev/null
+++ b/package/ipset/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_IPSET
+ prompt "ipset............................. Netfilter ip sets administration utility"
+ tristate
+ default n
+ help
+ Netfilter ip sets administration utility
+
+ http://ipset.netfilter.org/
+
diff --git a/package/ipset/Makefile b/package/ipset/Makefile
new file mode 100644
index 000000000..c299bd88a
--- /dev/null
+++ b/package/ipset/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ipset
+PKG_VERSION:= 2.3.3a
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c7d2f165242edaef5581db0f7d5af520
+MASTER_SITES:= http://ipset.netfilter.org/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IPSET,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+XAKE_FLAGS+= KERNEL_DIR=${LINUX_DIR} PREFIX=/usr LD=$(TARGET_CROSS)ld
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+INSTALL_TARGET= binaries_install
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_IPSET}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_IPSET}/usr/lib/ipset
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ipset ${IDIR_IPSET}/usr/sbin
+ ${CP} ${WRKINST}/usr/lib/ipset/*.so ${IDIR_IPSET}/usr/lib/ipset/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ipset/ipkg/ipset.control b/package/ipset/ipkg/ipset.control
new file mode 100644
index 000000000..f7f6ae0e6
--- /dev/null
+++ b/package/ipset/ipkg/ipset.control
@@ -0,0 +1,5 @@
+Package: ipset
+Priority: optional
+Section: net
+Description: Netfilter ip sets administration utility
+Depends: kmod-iptables-extra
diff --git a/package/ipset/patches/patch-kernel_ip_set_c b/package/ipset/patches/patch-kernel_ip_set_c
new file mode 100644
index 000000000..bf931398f
--- /dev/null
+++ b/package/ipset/patches/patch-kernel_ip_set_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ipset-2.3.3a.orig/kernel/ip_set.c 2008-07-16 19:17:55.000000000 +0200
++++ ipset-2.3.3a/kernel/ip_set.c 2008-10-20 16:38:11.000000000 +0200
+@@ -24,7 +24,7 @@
+ #include <linux/errno.h>
+ #include <asm/uaccess.h>
+ #include <asm/bitops.h>
+-#include <asm/semaphore.h>
++#include <linux/semaphore.h>
+ #include <linux/spinlock.h>
+ #include <linux/vmalloc.h>
+
diff --git a/package/iptables-snmp/Config.in b/package/iptables-snmp/Config.in
new file mode 100644
index 000000000..f4472ee61
--- /dev/null
+++ b/package/iptables-snmp/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_IPTABLES_SNMP
+ prompt "iptables-snmp..................... An snmpd plugin to access iptables rules"
+ tristate
+ default n
+ select ADK_PACKAGE_SNMPD
+ help
+ This is a plugin that makes iptables rules accessable from snmpd.
+
+ http://www.nobiscuit.com/iptables-snmp/
+
diff --git a/package/iptables-snmp/Makefile b/package/iptables-snmp/Makefile
new file mode 100644
index 000000000..3f8deecfc
--- /dev/null
+++ b/package/iptables-snmp/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= iptables-snmp
+PKG_VERSION:= 0.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8370d2f0c899461a053da491400119d1
+MASTER_SITES:= http://www.nobiscuit.com/iptables-snmp/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IPTABLES_SNMP,iptables-snmp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+FAKE_FLAGS+= INSTALL_PREFIX="${WRKINST}"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_IPTABLES_SNMP}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/iptables-snmp.so ${IDIR_IPTABLES_SNMP}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/iptables-snmp/ipkg/iptables-snmp.control b/package/iptables-snmp/ipkg/iptables-snmp.control
new file mode 100644
index 000000000..cd92ffeb5
--- /dev/null
+++ b/package/iptables-snmp/ipkg/iptables-snmp.control
@@ -0,0 +1,5 @@
+Package: iptables-snmp
+Priority: optional
+Section: net
+Depends: snmpd
+Description: An snmpd plugin to access iptables rules \ No newline at end of file
diff --git a/package/iptables/Config.in b/package/iptables/Config.in
new file mode 100644
index 000000000..bf7fd0ebb
--- /dev/null
+++ b/package/iptables/Config.in
@@ -0,0 +1,42 @@
+config ADK_COMPILE_IPTABLES
+ bool
+ default n
+ depends ADK_PACKAGE_IPTABLES || ADK_PACKAGE_IP6TABLES
+
+config ADK_PACKAGE_IPTABLES
+ prompt "iptables.......................... IPv4 firewall administration tool"
+ tristate
+ default n
+ select ADK_COMPILE_IPTABLES
+ select ADK_KPACKAGE_KMOD_IP_NF_IPTABLES
+ select ADK_KPACKAGE_KMOD_NF_CONNTRACK
+ select ADK_KPACKAGE_KMOD_IP_NF_FILTER
+ select ADK_KPACKAGE_KMOD_IP_NF_TARGET_REJECT
+ select ADK_KPACKAGE_KMOD_NF_NAT
+ select ADK_KPACKAGE_KMOD_IP_NF_TARGET_MASQUERADE
+ select ADK_KPACKAGE_KMOD_NF_CONNTRACK_IPV4
+ help
+ IPv4 firewall, NAT, and packet mangling tools.
+ Automatically selects needed kernel modules for NAT and filtering.
+
+ http://www.iptables.org/
+
+config ADK_PACKAGE_IPTABLES_UTILS
+ prompt "iptables-utils.................. Save and restore utilities"
+ tristate
+ default n
+ depends ADK_PACKAGE_IPTABLES
+ help
+ iptables-save and iptables-restore for Iptables (IPv4)
+
+ http://www.iptables.org/
+
+config ADK_PACKAGE_IP6TABLES
+ prompt "ip6tables......................... IPv6 firewall administration tool"
+ tristate
+ default n
+ select ADK_COMPILE_IPTABLES
+ help
+ IPv6 firewall, NAT, and packet mangling tools.
+
+ http://www.iptables.org/
diff --git a/package/iptables/Makefile b/package/iptables/Makefile
new file mode 100644
index 000000000..ba7de8fad
--- /dev/null
+++ b/package/iptables/Makefile
@@ -0,0 +1,65 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= iptables
+PKG_VERSION:= 1.4.3.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 545698693b636cfc844aafc6729fd48a
+MASTER_SITES:= http://www.netfilter.org/projects/iptables/files/ \
+ ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \
+ ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \
+ ftp://ftp.no.netfilter.org/pub/netfilter/iptables/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+include ${LINUX_DIR}/.config
+
+$(eval $(call PKG_template,IPTABLES,iptables,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,IPTABLES_UTILS,iptables-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+ifeq ($(ADK_IPV6),y)
+$(eval $(call PKG_template,IP6TABLES,ip6tables,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+endif
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-devel \
+ --libexecdir=/usr/lib \
+ --with-kernel='${LINUX_DIR}'
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+SUB_INSTALL-${ADK_PACKAGE_IPTABLES_UTILS}+= iptables-utils-install
+ifeq ($(ADK_IPV6),y)
+SUB_INSTALL-${ADK_PACKAGE_IP6TABLES}+= ip6tables-install
+endif
+
+post-install: ${SUB_INSTALL-m} ${SUB_INSTALL-y}
+ ${INSTALL_DIR} ${IDIR_IPTABLES}/usr/lib
+ ${INSTALL_DIR} ${IDIR_IPTABLES}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_IPTABLES}/usr/lib/xtables
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/iptables ${IDIR_IPTABLES}/usr/sbin/
+ (cd ${WRKINST}/usr/lib/xtables ; \
+ ${INSTALL_DATA} libipt_*.so ${IDIR_IPTABLES}/usr/lib/xtables/ \
+ )
+ (cd ${WRKINST}/usr/lib/xtables ; \
+ ${INSTALL_DATA} libxt_*.so ${IDIR_IPTABLES}/usr/lib/xtables/ \
+ )
+ ${CP} ${WRKINST}/usr/lib/libiptc.so* ${IDIR_IPTABLES}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libxtables.so* ${IDIR_IPTABLES}/usr/lib
+
+iptables-utils-install:
+ ${INSTALL_DIR} ${IDIR_IPTABLES_UTILS}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/iptables-{save,restore} ${IDIR_IPTABLES_UTILS}/usr/sbin/
+
+ip6tables-install:
+ ${INSTALL_DIR} ${IDIR_IP6TABLES}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_IP6TABLES}/usr/lib/xtables
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ip6tables ${IDIR_IP6TABLES}/usr/sbin/
+ (cd ${WRKINST}/usr/lib/xtables ; \
+ ${INSTALL_DATA} libip6t_*.so ${IDIR_IP6TABLES}/usr/lib/xtables/ \
+ )
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/iptables/files/l7/aim.pat b/package/iptables/files/l7/aim.pat
new file mode 100644
index 000000000..9768dbbdc
--- /dev/null
+++ b/package/iptables/files/l7/aim.pat
@@ -0,0 +1,27 @@
+# AIM - AOL instant messenger (OSCAR and TOC)
+# Pattern quality: good notsofast
+# Usually runs on port 5190
+#
+# This may also match ICQ traffic.
+#
+# This pattern has been tested and is believed to work well. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+aim
+# See http://gridley.acns.carleton.edu/~straitm/final (and various other places)
+# The first bit matches OSCAR signon and data commands, but not sure what
+# \x03\x0b matches, but it works apparently.
+# The next three bits match various parts of the TOC signon process.
+# The third one is the magic number "*", then 0x01 for "signon", then up to four
+# bytes ("up to" because l7-filter strips out nulls) which contain a sequence
+# number (2 bytes) the data length (2 more) and 3 nulls (which don't count),
+# then 0x01 for the version number (not sure if there ever has been another
+# version)
+# The fourth one is a command string, followed by some stuff, then the
+# beginning of the "roasted" password
+
+# This pattern is too slow!
+
+^(\*[\x01\x02].*\x03\x0b|\*\x01.?.?.?.?\x01)|flapon|toc_signon.*0x
diff --git a/package/iptables/files/l7/bittorrent.pat b/package/iptables/files/l7/bittorrent.pat
new file mode 100644
index 000000000..c1804ee4b
--- /dev/null
+++ b/package/iptables/files/l7/bittorrent.pat
@@ -0,0 +1,14 @@
+# Bittorrent - P2P filesharing / publishing tool - http://www.bittorrent.com
+# Pattern quality: great veryfast
+#
+# This pattern has been tested and is believed to work well. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+bittorrent
+
+# Does not attempt to match the HTTP download of the tracker
+# 0x13 is the length of "bittorrent protocol"
+# Second two bits match UDP wierdness, commented out until it's tested
+#^(\x13bittorrent protocol|d1:ad2:id20:|\x08'7P\)[RP])
+^\x13bittorrent protocol
diff --git a/package/iptables/files/l7/edonkey-dl.pat b/package/iptables/files/l7/edonkey-dl.pat
new file mode 100644
index 000000000..d344d169d
--- /dev/null
+++ b/package/iptables/files/l7/edonkey-dl.pat
@@ -0,0 +1,8 @@
+# eDonkey2000 - P2P filesharing (download part) - http://edonkey2000.com
+# Pattern quality: good veryfast overmatch usepacket
+
+edonkey-dl
+
+^[\xe3\xe4\xc5\xe5\xd4](....)?[\x01\x0a\x0e\x0f\x10\x18\x19\x1b\x1c\x47\x4a\x4f\x51\x53\x54\x58\x60\x81\x90\x96\x9a\x9c\xa2]
+
+
diff --git a/package/iptables/files/l7/edonkey.pat b/package/iptables/files/l7/edonkey.pat
new file mode 100644
index 000000000..efbc3f361
--- /dev/null
+++ b/package/iptables/files/l7/edonkey.pat
@@ -0,0 +1,29 @@
+# eDonkey2000 - P2P filesharing - http://edonkey2000.com
+# Pattern quality: good veryfast overmatch
+#
+# Please post to l7-filter-developers@lists.sf.net as to whether this pattern
+# works for you or not. If you believe it could be improved please post your
+# suggestions to that list as well. You may subscribe to this list at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+# Thanks to Matt Skidmore <fox AT woozle.org>
+
+edonkey
+
+# http://gd.tuwien.ac.at/opsys/linux/sf/p/pdonkey/eDonkey-protocol-0.6
+#
+# In addition to \xe3, \xc5 and \xd4, I see a lot of \xe5
+#
+# God this is a mess. What an irritating protocol.
+# This will match about 1% of streams with random data in them!
+
+^[\xe3\xc5\xe5\xd4](....)?([\x01\x02\x05\x14\x15\x16\x18\x19\x1a\x1b\x1c\x20\x21\x32\x33\x34\x35\x36\x38\x40\x41\x42\x43\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x5b\x5c\x60\x81\x82\x90\x91\x93\x96\x97\x98\x99\x9a\x9b\x9c\x9e\xa0\xa1\xa2\xa3\xa4]|\x59................?[ -~]|\x96....$)
+
+# matches everything and too much
+# ^(\xe3|\xc5|\xd4)
+
+# ipp2p essentially uses "\xe3....\x47", which doesn't seem at all right to me.
+
+# bandwidtharbitrator uses
+# e0.*@.*6[a-z].*p$|e0.*@.*[a-z]6[a-z].*p0$|e.*@.*[0-9]6.*p$|emule|edonkey
+# no comments to explain what all the mush is, of course...
diff --git a/package/iptables/files/l7/fasttrack.pat b/package/iptables/files/l7/fasttrack.pat
new file mode 100644
index 000000000..46295c6bb
--- /dev/null
+++ b/package/iptables/files/l7/fasttrack.pat
@@ -0,0 +1,25 @@
+# FastTrack - P2P filesharing (Kazaa, Morpheus, iMesh, Grokster, etc)
+# Pattern quality: good notsofast
+#
+# Tested with Kazaa Lite Resurrection 0.0.7.6F
+#
+# This appears to match the download connections well, but not the search
+# connections (I think they are encrypted :-( ).
+#
+# Please post to l7-filter-developers@lists.sf.net as to whether it works
+# for you or not. If you believe it could be improved please post your
+# suggestions to that list as well. You may subscribe to this list at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+fasttrack
+# while this is a valid http request, this will be caught because
+# the http pattern matches the response (and therefore the next packet)
+# Even so, it's best to put this match earlier in the chain.
+# http://cvs.berlios.de/cgi-bin/viewcvs.cgi/gift-fasttrack/giFT-FastTrack/PROTOCOL?rev=HEAD&content-type=text/vnd.viewcvs-markup
+
+# This pattern is kinda slow, but not too bad.
+^get (/.download/[ -~]*|/.supernode[ -~]|/.status[ -~]|/.network[ -~]*|/.files|/.hash=[0-9a-f]*/[ -~]*) http/1.1|user-agent: kazaa|x-kazaa(-username|-network|-ip|-supernodeip|-xferid|-xferuid|tag)|^give [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]?[0-9]?[0-9]?
+
+# This isn't much faster:
+#^get (/.download/.*|/.supernode.|/.status.|/.network.*|/.files|/.hash=[0-9a-f]*/.*) http/1.1|user-agent: kazaa|x-kazaa(-username|-network|-ip|-supernodeip|-xferid|-xferuid|tag)|^give [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]?[0-9]?[0-9]?
+
diff --git a/package/iptables/files/l7/ftp.pat b/package/iptables/files/l7/ftp.pat
new file mode 100644
index 000000000..9593ffd1b
--- /dev/null
+++ b/package/iptables/files/l7/ftp.pat
@@ -0,0 +1,34 @@
+# FTP - File Transfer Protocol - RFC 959
+# Pattern quality: great fast
+#
+# Usually runs on port 21. Note that the data stream is on a dynamically
+# assigned port, which means that you will need the FTP connection
+# tracking module in your kernel to usefully match FTP data transfers.
+#
+# This pattern is well tested. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+#
+# Matches the first two things a server should say. Most servers say
+# something after 220, even though they don't have to, and it usually
+# includes the string "ftp" (l7-filter is case insensitive).
+# This includes proftpd, vsftpd, wuftpd, warftpd, pureftpd, Bulletproof
+# FTP Server, and whatever ftp.microsoft.com uses. Just in case, the next
+# thing the server sends is a 331. All the above servers also send
+# something including "password" after this code.
+ftp
+# actually, let's just do the first for now, it's faster
+^220[\x09-\x0d -~]*ftp
+
+# This is ~10x faster if the stream starts with "220"
+#^220.*ftp
+
+# This will match more, but much slower
+#^220[\x09-\x0d -~]*ftp|331[\x09-\x0d -~]*password
+
+# This pattern is more precise, but takes longer to match. (3 packets vs. 1)
+#^220[\x09-\x0d -~]*\x0d\x0aUSER[\x09-\x0d -~]*\x0d\x0a331
+
+# same as above, but slightly less precise and only takes 2 packets.
+#^220[\x09-\x0d -~]*\x0d\x0aUSER[\x09-\x0d -~]*\x0d\x0a
diff --git a/package/iptables/files/l7/gnutella.pat b/package/iptables/files/l7/gnutella.pat
new file mode 100644
index 000000000..ebbd5c621
--- /dev/null
+++ b/package/iptables/files/l7/gnutella.pat
@@ -0,0 +1,36 @@
+# Gnutella - P2P filesharing
+# Pattern quality: good fast
+#
+# This should match both Gnutella and "Gnutella2" ("Mike's protocol")
+#
+# Various clients use this protocol including Mactella, Shareaza,
+# GTK-gnutella, Gnucleus, Gnotella, LimeWire, BearShare, and iMesh.
+#
+# This is tested with gtk-gnutella and Shareaza.
+#
+# Please report on how this pattern works for you at
+# l7-filter-developers@lists.sf.net . If you can improve on this
+# pattern, please also post to that list. You may subscribe at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+# http://www.gnutella2.com/tiki-index.php?page=UDP%20Transceiver
+# http://rfc-gnutella.sf.net/
+# http://www.gnutella2.com/tiki-index.php?page=Gnutella2%20Specification
+# http://en.wikipedia.org/wiki/Shareaza
+
+gnutella
+
+# The first part matches UDP messages - All start with "GND", then have
+# a flag byte which is either \x00, \x01 or \x02, then two sequence bytes
+# that can be anything, then a fragment number, which must start at 1.
+# The rest matches TCP first client message or first server message (in case
+# we can't see client messages). Some parts of this are empirical rather than
+# document based. Assumes version is between 0.0 and 2.9. (usually is
+# 0.4 or 0.6). I'm guessing at many of the user-agents.
+# The last bit is emprical and probably only matches Limewire.
+^(gnd[\x01\x02]?.?.?\x01|gnutella connect/[012]\.[0-9]\x0d\x0a|get /uri-res/n2r\?urn:sha1:|get /.*user-agent: (gtk-gnutella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|get /.*content-type: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|queue [0-9a-f]* [1-9][0-9]?[0-9]?\.[1-9][0-9]?[0-9]?\.[1-9][0-9]?[0-9]?\.[1-9][0-9]?[0-9]?:[1-9][0-9]?[0-9]?[0-9]?|gnutella.*content-type: application/x-gnutella|..................lime)
+
+# Needlessly precise, at the expense of time
+#^(gnd[\x01\x02]?.?.?\x01|gnutella connect/[012]\.[0-9]\x0d\x0a|get /uri-res/n2r\?urn:sha1:|get /[\x09-\x0d -~]*user-agent: (gtk-gnutella|bearshare|mactella|gnucleus|gnotella|limewire|imesh)|get /[\x09-\x0d -~]*content-type: application/x-gnutella-packets|giv [0-9]*:[0-9a-f]*/|queue [0-9a-f]* [1-9][0-9]?[0-9]?\.[1-9][0-9]?[0-9]?\.[1-9][0-9]?[0-9]?\.[1-9][0-9]?[0-9]?:[1-9][0-9]?[0-9]?[0-9]?|gnutella[\x09-\x0d -~]*content-type: application/x-gnutella|..................lime)
+
+
diff --git a/package/iptables/files/l7/http.pat b/package/iptables/files/l7/http.pat
new file mode 100644
index 000000000..520e7fe21
--- /dev/null
+++ b/package/iptables/files/l7/http.pat
@@ -0,0 +1,28 @@
+# HTTP - HyperText Transfer Protocol - RFC 2616
+# Pattern quality: great notsofast
+# Usually runs on port 80
+#
+# This pattern has been tested and is believed to work well. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+#
+# this intentionally catches the response from the server
+# rather than the request so that other protocols which use
+# http (like kazaa) can be caught based on specific http requests
+# regardless of the ordering of filters...
+# also matches posts
+
+# Sites that serve really long cookies may break this by pushing the
+# server response too far away from the beginning of the connection. To
+# fix this, increase the kernel's data buffer length.
+
+http
+# Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF (rfc 2616)
+# As specified in rfc 2616 a status code is preceeded and followed by a
+# space.
+http/(0\.9|1\.0|1\.1) [1-5][0-9][0-9] [\x09-\x0d -~]*(connection:|content-type:|content-length:|date:)|post [\x09-\x0d -~]* http/[01]\.[019]
+# A slightly faster version that might be good enough:
+#http/(0\.9|1\.0|1\.1) [1-5][0-9][0-9]|post [\x09-\x0d -~]* http/[01]\.[019]
+# old pattern(s):
+#(http[\x09-\x0d -~]*(200 ok|302 |304 )[\x09-\x0d -~]*(connection:|content-type:|content-length:))|^(post [\x09-\x0d -~]* http/)
diff --git a/package/iptables/files/l7/ident.pat b/package/iptables/files/l7/ident.pat
new file mode 100644
index 000000000..672b0753c
--- /dev/null
+++ b/package/iptables/files/l7/ident.pat
@@ -0,0 +1,14 @@
+# Ident - Identification Protocol - RFC 1413
+# Pattern quality: good veryfast
+# Usually runs on port 113
+#
+# This pattern is believed to work. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+ident
+# "number , numberCRLF" possibly without the CR and/or LF.
+# ^$ is appropriate because the first packet should never have anything
+# else in it.
+^[1-9][0-9]?[0-9]?[0-9]?[0-9]?[\x09-\x0d]*,[\x09-\x0d]*[1-9][0-9]?[0-9]?[0-9]?[0-9]?(\x0d\x0a|[\x0d\x0a])?$
diff --git a/package/iptables/files/l7/irc.pat b/package/iptables/files/l7/irc.pat
new file mode 100644
index 000000000..6643f6c2f
--- /dev/null
+++ b/package/iptables/files/l7/irc.pat
@@ -0,0 +1,20 @@
+# IRC - Internet Relay Chat - RFC 1459
+# Pattern quality: good veryfast
+#
+# Usually runs on port 6666 or 6667
+# Note that chat traffic runs on these ports, but IRC-DCC traffic (which
+# can use much more bandwidth) uses a dynamically assigned port, so you
+# must have the IRC connection tracking module in your kernel to classify
+# this.
+#
+# This pattern has been tested and is believed to work well. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+irc
+# First thing that happens is that the client sends NICK and USER, in
+# either order. This allows MIRC color codes (\x02-\x0d instead of
+# \x09-\x0d).
+^(nick[\x09-\x0d -~]*user[\x09-\x0d -~]*:|user[\x09-\x0d -~]*:[\x02-\x0d -~]*nick[\x09-\x0d -~]*\x0d\x0a)
+
diff --git a/package/iptables/files/l7/jabber.pat b/package/iptables/files/l7/jabber.pat
new file mode 100644
index 000000000..7a0c6840e
--- /dev/null
+++ b/package/iptables/files/l7/jabber.pat
@@ -0,0 +1,24 @@
+# Jabber (XMPP) - an open instant messenger protocol - http://jabber.org
+# Pattern quality: good fast
+#
+# This pattern has been tested with Gaim and Gabber. It is only tested
+# with non-SSL mode Jabber with no proxies. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+# Thanks to Jan Hudec for some improvements.
+
+# Jabber seems to take a long time to set up a connection. I'm
+# connecting with Gabber 0.8.8 to 12jabber.org and the first 8 packets
+# is this:
+# <stream:stream to='12jabber.com' xmlns='jabber:client'
+# xmlns:stream='http://etherx.jabber.org/streams'><?xml
+# version='1.0'?><stream:stream
+# xmlns:stream='http://etherx.jabber.org/streams' id='3f73e951'
+# xmlns='jabber:client' from='12jabber.com'>
+#
+# No mention of my username or password yet, you'll note.
+
+jabber
+<stream:stream[\x09-\x0d ][ -~]*[\x09-\x0d ]xmlns=['"]jabber
diff --git a/package/iptables/files/l7/msnmessenger.pat b/package/iptables/files/l7/msnmessenger.pat
new file mode 100644
index 000000000..e07f71f31
--- /dev/null
+++ b/package/iptables/files/l7/msnmessenger.pat
@@ -0,0 +1,15 @@
+# MSN Messenger - Microsoft Network chat client
+# Pattern quality: good veryfast
+#
+# Usually uses port 1863
+# http://www.hypothetic.org/docs/msn/index.php
+#
+# This pattern has been tested and is believed to work well. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+msnmessenger
+# ver: allow versions up to 99.
+# usr (in case ver didn't work):
+^(ver [0-9]+ msnp[1-9][0-9]? [\x09-\x0d -~]* cvr|usr md5 i [ -~]*)
diff --git a/package/iptables/files/l7/ntp.pat b/package/iptables/files/l7/ntp.pat
new file mode 100644
index 000000000..b7e443e21
--- /dev/null
+++ b/package/iptables/files/l7/ntp.pat
@@ -0,0 +1,17 @@
+# (S)NTP - (Simple) Network Time Protocol - RFCs 1305 and 2030
+# Pattern quality: good veryfast overmatch
+#
+# This pattern is tested and is believed to work. If this does not work
+# for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . Subscribe at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+# client|server
+# Requires the server's timestamp to be in the present or future (of 2005).
+# Tested with ntpdate on Linux.
+# Assumes version 2, 3 or 4.
+
+# Note that ntp packets are always 48 bytes, so you should match on that too.
+
+ntp
+^([\x13\x1b\x23\xd3\xdb\xe3]|[\x14\x1c$].......?.?.?.?.?.?.?.?.?[\xc6-\xff])
diff --git a/package/iptables/files/l7/pop3.pat b/package/iptables/files/l7/pop3.pat
new file mode 100644
index 000000000..f6bb63061
--- /dev/null
+++ b/package/iptables/files/l7/pop3.pat
@@ -0,0 +1,50 @@
+# POP3 - Post Office Protocol version 3 (popular e-mail protocol) - RFC 1939
+# Pattern quality: good veryfast
+#
+# This pattern has been tested somewhat. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+# this is a difficult protocol to match because of the relative lack of
+# distinguishing information. Read on.
+pop3
+
+# this the most conservative pattern. It should definitely work.
+#^(\+ok|-err)
+
+# this pattern assumes that the server says _something_ after +ok or -err
+# I think this is probably the way to go.
+^(\+ok |-err )
+
+# more that 90% of servers seem to say "pop" after "+ok", but not all.
+#^(\+ok .*pop)
+
+# Here's another tack. I think this is my second favorite.
+#^(\+ok [\x09-\x0d -~]*(ready|hello|pop|starting)|-err [\x09-\x0d -~]*(invalid|unknown|unimplemented|unrecognized|command))
+
+# this matches the server saying "you have N messages that are M bytes",
+# which the client probably asks for early in the session (not tested)
+#\+ok [0-9]+ [0-9]+
+
+# some sample servers:
+# RFC example: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>
+# mail.dreamhost.com: +OK Hello there.
+# pop.carleton.edu: +OK POP3D(*) Server PMDFV6.2.2 at Fri, 12 Sep 2003 19:28:10 -0500 (CDT) (APOP disabled)
+# mail.earthlink.net: +OK NGPopper vEL_4_38 at earthlink.net ready <25509.1063412951@falcon>
+# *.email.umn.edu: +OK Cubic Circle's v1.22 1998/04/11 POP3 ready <7d1e0000da67623f@aquamarine.tc.umn.edu>
+# mail.yale.edu: +OK POP3 pantheon-po01 v2002.81 server ready
+# mail.gustavus.edu: +OK POP3 solen v2001.78 server ready
+# mail.reed.edu: +OK POP3 letra.reed.edu v2002.81 server ready
+# mail.bowdoin.edu: +OK mail.bowdoin.edu POP3 service (iPlanet Messaging Server 5.2 HotFix 1.15 (built Apr 28 2003))
+# pop.colby.edu: +OK Qpopper (version 4.0.5) at basalt starting.
+# mail.mac.com: +OK Netscape Messaging Multiplexor ready
+
+# various error strings:
+#-ERR Invalid command.
+#-ERR invalid command
+#-ERR unimplemented
+#-ERR Invalid command, try one of: USER name, PASS string, QUIT
+#-ERR Unknown AUTHORIZATION state command
+#-ERR Unrecognized command
+#-ERR Unknown command: "sadf'".
diff --git a/package/iptables/files/l7/smtp.pat b/package/iptables/files/l7/smtp.pat
new file mode 100644
index 000000000..1bab7a1df
--- /dev/null
+++ b/package/iptables/files/l7/smtp.pat
@@ -0,0 +1,39 @@
+# SMTP - Simple Mail Transfer Protocol - RFC 2821 (See also RFC 1869)
+# Pattern quality: great fast
+# usually runs on port 25
+#
+# This pattern has been tested and is believed to work well. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+smtp
+# As usual, no text is required after "220", but all known servers have some
+# there. It (almost?) always has string "smtp" in it. The RFC examples
+# does not, so we match those too, just in case anyone has copied them
+# literally.
+^220[\x09-\x0d -~]* (e?smtp|simple mail)
+
+# This is ~3x faster if the stream starts with "220"
+#^220.* (e?smtp|simple mail)
+
+# Some examples:
+# 220 mail.stalker.com ESMTP CommuniGate Pro 4.1.3
+# 220 mail.vieodata.com ESMTP Merak 6.1.0; Mon, 15 Sep 2003 13:48:11 -0400
+# 220 mail.ut.caldera.com ESMTP
+# 220 persephone.pmail.gen.nz ESMTP server ready.
+# 220 smtp1.superb.net ESMTP
+# 220 mail.kerio.com Kerio MailServer 5.6.7 ESMTP ready
+# 220-mail.deerfield.com ESMTP VisNetic.MailServer.v6.0.9.0; Mon, 15 Sep 2003 13:4
+# 220 altn.com ESMTP MDaemon 6.8.5; Mon, 15 Sep 2003 12:46:42 -0500
+# 220 X1 NT-ESMTP Server ipsmin0165atl2.interland.net (IMail 6.06 73062-3)
+# 220 mail.icewarp.com ESMTP Merak 6.1.1; Mon, 15 Sep 2003 19:43:23 +0200
+# 220-mail.email-scan.com ESMTP
+# 220 smaug.dreamhost.com ESMTP
+# 220 kona.carleton.edu -- Server ESMTP (PMDF V6.2#30648)
+# 220 letra.reed.edu ESMTP Sendmail 8.12.9/8.12.9; Mon, 15 Sep 2003 10:35:57 -0700 (PDT)
+# 220-swan.mail.pas.earthlink.net ESMTP Exim 3.33 #1 Mon, 15 Sep 2003 10:32:15 -0700
+#
+# RFC examples:
+# 220 xyz.com Simple Mail Transfer Service Ready (RFC example)
+# 220 dbc.mtview.ca.us SMTP service ready
diff --git a/package/iptables/files/l7/ssl.pat b/package/iptables/files/l7/ssl.pat
new file mode 100644
index 000000000..ab5f62caa
--- /dev/null
+++ b/package/iptables/files/l7/ssl.pat
@@ -0,0 +1,15 @@
+# SSL and TLS - Secure Socket Layer / Transport Layer Security - RFC 2246
+# Pattern quality: good fast
+# Usually runs on port 443
+#
+# This is a superset validcertssl. For it to match, it must be first.
+#
+# This pattern has been tested and is believed to work well. If it does not
+# work for you, or you believe it could be improved, please post to
+# l7-filter-developers@lists.sf.net . This list may be subscribed to at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+
+ssl
+# Client Hello | Server Hello with certificate
+# This allows SSL 3.X, which includes TLS 1.0, known internally as SSL 3.1
+^(.?.?\x16\x03.*\x16\x03|.?.?\x01\x03\x01?.*\x0b)
diff --git a/package/iptables/files/l7/vnc.pat b/package/iptables/files/l7/vnc.pat
new file mode 100644
index 000000000..35bfbd4ba
--- /dev/null
+++ b/package/iptables/files/l7/vnc.pat
@@ -0,0 +1,23 @@
+# VNC - Virtual Network Computing. Also known as RFB - Remote Frame Buffer
+# Pattern quality: good fast
+# http://www.realvnc.com/documentation.html
+#
+# This pattern has been verified with vnc v3.3.7 on WinXP and Linux
+# Please report on how this pattern works for you at
+# l7-filter-developers@lists.sf.net . If you can improve on this pattern,
+# please also post to that list. You may subscribe at
+# http://lists.sourceforge.net/lists/listinfo/l7-filter-developers
+#
+# Thanks to Trevor Paskett <tpaskett AT cymphonix.com> for this pattern.
+
+vnc
+# Assumes single digit major and minor version numbers
+# This message should be all alone in the first packet, so ^$ is appropriate
+^rfb 00[1-9]\.00[0-9]\x0a$
+
+# This is a more restrictive version which assumes the version numbers
+# are ones actually in existance at the time of this writing, i.e. 3.3,
+# 3.7 and 3.8 (with some clients wrongly reporting 3.5). It should be
+# slightly faster, but probably not worth the extra maintenance.
+# ^rfb 003\.00[3578]\x0a$
+
diff --git a/package/iptables/ipkg/ip6tables.control b/package/iptables/ipkg/ip6tables.control
new file mode 100644
index 000000000..c6d63936e
--- /dev/null
+++ b/package/iptables/ipkg/ip6tables.control
@@ -0,0 +1,5 @@
+Package: ip6tables
+Priority: optional
+Depends: kmod-ip6tables
+Section: net
+Description: The netfilter firewalling software for IPv6
diff --git a/package/iptables/ipkg/iptables-extra.control b/package/iptables/ipkg/iptables-extra.control
new file mode 100644
index 000000000..afd4235c4
--- /dev/null
+++ b/package/iptables/ipkg/iptables-extra.control
@@ -0,0 +1,5 @@
+Package: iptables-extra
+Priority: optional
+Section: net
+Depends: iptables, iptables-mod-conntrack, iptables-mod-extra, iptables-mod-filter, iptables-mod-ipopt, iptables-mod-ipsec, iptables-mod-nat, iptables-mod-ulog
+Description: Other extra Iptables extensions (meta-package)
diff --git a/package/iptables/ipkg/iptables-mod-conntrack.control b/package/iptables/ipkg/iptables-mod-conntrack.control
new file mode 100644
index 000000000..840992e67
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-conntrack.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-conntrack
+Priority: optional
+Section: net
+Depends: iptables, kmod-ipt-conntrack
+Description: Iptables (IPv4) extensions for connection tracking
diff --git a/package/iptables/ipkg/iptables-mod-extra.control b/package/iptables/ipkg/iptables-mod-extra.control
new file mode 100644
index 000000000..f26b4a458
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-extra.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-extra
+Priority: optional
+Section: net
+Depends: iptables, kmod-ipt-extra
+Description: Other extra Iptables (IPv4) extensions
diff --git a/package/iptables/ipkg/iptables-mod-filter.control b/package/iptables/ipkg/iptables-mod-filter.control
new file mode 100644
index 000000000..43ec79955
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-filter.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-filter
+Priority: optional
+Section: net
+Depends: iptables, kmod-ipt-filter
+Description: Iptables (IPv4) extension for packet content inspection
diff --git a/package/iptables/ipkg/iptables-mod-imq.control b/package/iptables/ipkg/iptables-mod-imq.control
new file mode 100644
index 000000000..d1e46d28a
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-imq.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-imq
+Priority: optional
+Section: net
+Depends: kmod-imq
+Description: Iptables (IPv4) extensions for Intermediate Queuing Device QoS-support
diff --git a/package/iptables/ipkg/iptables-mod-ipopt.control b/package/iptables/ipkg/iptables-mod-ipopt.control
new file mode 100644
index 000000000..51ec6b20a
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-ipopt.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-ipopt
+Priority: optional
+Section: net
+Depends: iptables, kmod-ipt-ipopt
+Description: Iptables (IPv4) extensions for matching/changing IP packet options
diff --git a/package/iptables/ipkg/iptables-mod-ipsec.control b/package/iptables/ipkg/iptables-mod-ipsec.control
new file mode 100644
index 000000000..4b4d2e638
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-ipsec.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-ipsec
+Priority: optional
+Section: net
+Depends: iptables, kmod-ipt-ipsec
+Description: Iptables (IPv4) extensions for matching special IPsec packets
diff --git a/package/iptables/ipkg/iptables-mod-nat.control b/package/iptables/ipkg/iptables-mod-nat.control
new file mode 100644
index 000000000..2ebbb1cf7
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-nat.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-nat
+Priority: optional
+Section: net
+Depends: iptables, kmod-ipt-nat
+Description: Iptables (IPv4) extensions for different NAT targets
diff --git a/package/iptables/ipkg/iptables-mod-ulog.control b/package/iptables/ipkg/iptables-mod-ulog.control
new file mode 100644
index 000000000..3fcd26fed
--- /dev/null
+++ b/package/iptables/ipkg/iptables-mod-ulog.control
@@ -0,0 +1,5 @@
+Package: iptables-mod-ulog
+Priority: optional
+Section: net
+Depends: iptables, kmod-ipt-ulog
+Description: Iptables (IPv4) extension for user-space packet logging
diff --git a/package/iptables/ipkg/iptables-utils.control b/package/iptables/ipkg/iptables-utils.control
new file mode 100644
index 000000000..aff5f4d77
--- /dev/null
+++ b/package/iptables/ipkg/iptables-utils.control
@@ -0,0 +1,5 @@
+Package: iptables-utils
+Priority: optional
+Section: net
+Depends: iptables
+Description: iptables-save and iptables-restore for Iptables (IPv4)
diff --git a/package/iptables/ipkg/iptables.control b/package/iptables/ipkg/iptables.control
new file mode 100644
index 000000000..40a6523b7
--- /dev/null
+++ b/package/iptables/ipkg/iptables.control
@@ -0,0 +1,4 @@
+Package: iptables
+Priority: optional
+Section: net
+Description: The netfilter firewalling software for IPv4
diff --git a/package/iptables/ipkg/iptables.postinst b/package/iptables/ipkg/iptables.postinst
new file mode 100644
index 000000000..fd2865a31
--- /dev/null
+++ b/package/iptables/ipkg/iptables.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+
+if [ -f $IPKG_INSTROOT/etc/init.d/S45firewall ]; then
+ add_rcconf iptables firewall NO
+fi
+
diff --git a/package/iptraf/Config.in b/package/iptraf/Config.in
new file mode 100644
index 000000000..8964fa68b
--- /dev/null
+++ b/package/iptraf/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_IPTRAF
+ prompt "iptraf............................ A console-based network monitoring program"
+ tristate
+ select ADK_PACKAGE_LIBNCURSES
+ default n
+ help
+ IPTraf is a console-based network statistics utility for Linux. It gathers
+ a variety of figures such as TCP connection packet and byte counts,
+ interface statistics and activity indicators, TCP/UDP traffic breakdowns,
+ and LAN station packet and byte counts.
+
+ http://iptraf.seul.org/
+
diff --git a/package/iptraf/Makefile b/package/iptraf/Makefile
new file mode 100644
index 000000000..3ee0796a8
--- /dev/null
+++ b/package/iptraf/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= iptraf
+PKG_VERSION:= 3.0.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 377371c28ee3c21a76f7024920649ea8
+MASTER_SITES:= ftp://iptraf.seul.org/pub/iptraf/ \
+ ftp://the.wiretapped.net/pub/security/network-monitoring/iptraf/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IPTRAF,iptraf,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${MAKE} -C ${WRKBUILD}/src \
+ ${TARGET_CONFIGURE_OPTS} \
+ CFLAGS="${TARGET_CFLAGS}" \
+ DEBUG="" \
+ INCLUDEDIR="-I../support -I${STAGING_DIR}/usr/include -I${STAGING_DIR}/include" \
+ LDOPTS="-L${STAGING_DIR}/usr/lib -L${STAGING_DIR}/lib" \
+ PLATFORM="-DPLATFORM=\\\"Linux/${ARCH}\\\"" \
+ TARGET="/usr/bin" \
+ WORKDIR="/var/lib/iptraf" \
+ all
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_IPTRAF}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/src/iptraf ${IDIR_IPTRAF}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/iptraf/ipkg/iptraf.control b/package/iptraf/ipkg/iptraf.control
new file mode 100644
index 000000000..840c9d1e0
--- /dev/null
+++ b/package/iptraf/ipkg/iptraf.control
@@ -0,0 +1,5 @@
+Package: iptraf
+Priority: optional
+Section: net
+Depends: libncurses
+Description: A console-based network monitoring program.
diff --git a/package/iptraf/patches/patch-src_Makefile b/package/iptraf/patches/patch-src_Makefile
new file mode 100644
index 000000000..40b4f9d7d
--- /dev/null
+++ b/package/iptraf/patches/patch-src_Makefile
@@ -0,0 +1,21 @@
+$Id$
+--- iptraf-3.0.0.orig/src/Makefile Tue Sep 13 11:11:17 2005
++++ iptraf-3.0.0/src/Makefile Tue Jan 16 22:27:34 2007
+@@ -113,7 +113,7 @@ iptraf: $(OBJS) textlib
+ $(CC) $(LDOPTS) $(PROF) -o iptraf $(OBJS) $(LIBS)
+
+ textlib:
+- make -C ../support
++ $(MAKE) -C ../support
+
+ %.o: %.c *.h version
+ $(CC) $(CFLAGS) $(DIRS) $(INCLUDEDIR) $(VERSION) $(PLATFORM) $(PROF) $(DEBUG) $(EXECPERM) $(BSSETTING) -c -o $*.o $<
+@@ -132,7 +132,7 @@ rawtime: rawtime.c
+
+ clean:
+ rm -f *.o *~ core $(BINS)
+- make -C ../support clean
++ $(MAKE) -C ../support clean
+
+ # I just included this rule to clear out the .o files, leaving the
+ # executables, stripped and ready for packing.
diff --git a/package/iptraf/patches/patch-src_dirs_h b/package/iptraf/patches/patch-src_dirs_h
new file mode 100644
index 000000000..430b4d27e
--- /dev/null
+++ b/package/iptraf/patches/patch-src_dirs_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/dirs.h 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/dirs.h 2008-10-09 17:34:11.000000000 +0200
+@@ -155,7 +155,6 @@
+ */
+
+ #define ETHFILE get_path(T_WORKDIR, "ethernet.desc")
+-#define FDDIFILE get_path(T_WORKDIR, "fddi.desc")
+
+ /*
+ * The rvnamed program file
diff --git a/package/iptraf/patches/patch-src_fltmgr_c b/package/iptraf/patches/patch-src_fltmgr_c
new file mode 100644
index 000000000..6d0648422
--- /dev/null
+++ b/package/iptraf/patches/patch-src_fltmgr_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/fltmgr.c 2005-09-13 09:27:51.000000000 +0200
++++ iptraf-3.0.0/src/fltmgr.c 2008-10-09 17:35:25.000000000 +0200
+@@ -112,7 +112,7 @@ unsigned long int nametoaddr(char *ascna
+
+ he = gethostbyname(ascname);
+ if (he != NULL)
+- bcopy((he->h_addr_list)[0], &result, he->h_length);
++ memcpy(&result, (he->h_addr_list)[0], he->h_length);
+ else {
+ snprintf(imsg, 45, "Unable to resolve %s", ascname);
+ write_error(imsg, daemonized);
diff --git a/package/iptraf/patches/patch-src_hostmon_c b/package/iptraf/patches/patch-src_hostmon_c
new file mode 100644
index 000000000..0c77aad22
--- /dev/null
+++ b/package/iptraf/patches/patch-src_hostmon_c
@@ -0,0 +1,61 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/hostmon.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/hostmon.c 2008-10-09 17:34:11.000000000 +0200
+@@ -30,7 +30,6 @@ details.
+ #include <netinet/in.h>
+ #include <linux/if_packet.h>
+ #include <linux/if_ether.h>
+-#include <linux/if_fddi.h>
+ #include <linux/if_tr.h>
+ #include <net/if_arp.h>
+ #include <stdlib.h>
+@@ -293,8 +292,6 @@ void printethent(struct ethtab *table, s
+ wprintw(table->tabwin, "Ethernet");
+ else if (entry->un.desc.linktype == LINK_PLIP)
+ wprintw(table->tabwin, "PLIP");
+- else if (entry->un.desc.linktype == LINK_FDDI)
+- wprintw(table->tabwin, "FDDI");
+
+ wprintw(table->tabwin, " HW addr: %s", entry->un.desc.ascaddr);
+
+@@ -722,7 +719,7 @@ void hostmon(const struct OPTIONS *optio
+ unsigned long long updtime_usec = 0;
+
+ struct desclist elist; /* Ethernet description list */
+- struct desclist flist; /* FDDI description list */
++ struct desclist flist; /* Other links description list */
+ struct desclist *list = NULL;
+
+ FILE *logfile = NULL;
+@@ -786,7 +783,6 @@ void hostmon(const struct OPTIONS *optio
+
+ initethtab(&table, options->actmode);
+ loaddesclist(&elist, LINK_ETHERNET, WITHETCETHERS);
+- loaddesclist(&flist, LINK_FDDI, WITHETCETHERS);
+
+ if (logging) {
+ if (strcmp(current_logfile, "") == 0) {
+@@ -900,9 +896,7 @@ void hostmon(const struct OPTIONS *optio
+ if (pkt_result != PACKET_OK)
+ continue;
+
+- if ((linktype == LINK_ETHERNET) || (linktype == LINK_FDDI)
+- || (linktype == LINK_PLIP) || (linktype == LINK_TR) ||
+- (linktype == LINK_VLAN)) {
++ if ((linktype == LINK_ETHERNET) || (linktype == LINK_PLIP) || (linktype == LINK_TR) || (linktype == LINK_VLAN)) {
+
+ if (fromaddr.sll_protocol == htons(ETH_P_IP))
+ is_ip = 1;
+@@ -920,12 +914,6 @@ void hostmon(const struct OPTIONS *optio
+ memcpy(scratch_daddr, ((struct ethhdr *) buf)->h_dest,
+ ETH_ALEN);
+ list = &elist;
+- } else if (linktype == LINK_FDDI) {
+- memcpy(scratch_saddr, ((struct fddihdr *) buf)->saddr,
+- FDDI_K_ALEN);
+- memcpy(scratch_daddr, ((struct fddihdr *) buf)->daddr,
+- FDDI_K_ALEN);
+- list = &flist;
+ } else if (linktype == LINK_TR) {
+ memcpy(scratch_saddr, ((struct trh_hdr *) buf)->saddr,
+ TR_ALEN);
diff --git a/package/iptraf/patches/patch-src_ifaces_c b/package/iptraf/patches/patch-src_ifaces_c
new file mode 100644
index 000000000..2da98aa53
--- /dev/null
+++ b/package/iptraf/patches/patch-src_ifaces_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/ifaces.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/ifaces.c 2008-10-09 17:34:11.000000000 +0200
+@@ -37,7 +37,7 @@ extern int accept_unsupported_interfaces
+ extern int daemonized;
+
+ char ifaces[][6] =
+- { "lo", "eth", "sl", "ppp", "ippp", "plip", "fddi", "isdn", "dvb",
++ { "lo", "eth", "sl", "ppp", "ippp", "plip", "isdn", "dvb",
+ "pvc", "hdlc", "ipsec", "sbni", "tr", "wvlan", "wlan", "sm2", "sm3",
+ "pent", "lec", "brg", "tun", "tap", "cipcb", "tunl", "vlan"
+ };
diff --git a/package/iptraf/patches/patch-src_landesc_c b/package/iptraf/patches/patch-src_landesc_c
new file mode 100644
index 000000000..8cbdd6be0
--- /dev/null
+++ b/package/iptraf/patches/patch-src_landesc_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/landesc.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/landesc.c 2008-10-09 17:34:11.000000000 +0200
+@@ -83,8 +83,6 @@ void loaddesclist(struct desclist *list,
+
+ if (linktype == LINK_ETHERNET)
+ fd = fopen(ETHFILE, "r");
+- else if (linktype == LINK_FDDI)
+- fd = fopen(FDDIFILE, "r");
+
+ if (fd == NULL) {
+ return;
+@@ -205,8 +203,6 @@ void savedesclist(struct desclist *list,
+
+ if (linktype == LINK_ETHERNET)
+ fd = fopen(ETHFILE, "w");
+- else if (linktype == LINK_FDDI)
+- fd = fopen(FDDIFILE, "w");
+
+ if (fd < 0) {
+ etherr();
diff --git a/package/iptraf/patches/patch-src_links_h b/package/iptraf/patches/patch-src_links_h
new file mode 100644
index 000000000..35a7e3d24
--- /dev/null
+++ b/package/iptraf/patches/patch-src_links_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/links.h 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/links.h 2008-10-09 17:34:11.000000000 +0200
+@@ -6,7 +6,6 @@
+ #define LINK_ISDN_RAWIP 6
+ #define LINK_ISDN_CISCOHDLC 7
+ #define LINK_CISCOHDLC 7
+-#define LINK_FDDI 8
+ #define LINK_FRAD 9
+ #define LINK_DLCI 10
+ #define LINK_TR 11
diff --git a/package/iptraf/patches/patch-src_log_c b/package/iptraf/patches/patch-src_log_c
new file mode 100644
index 000000000..59786fcee
--- /dev/null
+++ b/package/iptraf/patches/patch-src_log_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/log.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/log.c 2008-10-09 17:34:11.000000000 +0200
+@@ -491,8 +491,6 @@ void writeethlog(struct ethtabent *list,
+ ptmp->un.desc.ascaddr);
+ else if (ptmp->un.desc.linktype == LINK_PLIP)
+ fprintf(fd, "\nPLIP address: %s", ptmp->un.desc.ascaddr);
+- else if (ptmp->un.desc.linktype == LINK_FDDI)
+- fprintf(fd, "\nFDDI address: %s", ptmp->un.desc.ascaddr);
+
+ if (ptmp->un.desc.withdesc)
+ fprintf(fd, " (%s)", ptmp->un.desc.desc);
diff --git a/package/iptraf/patches/patch-src_options_c b/package/iptraf/patches/patch-src_options_c
new file mode 100644
index 000000000..b30bab481
--- /dev/null
+++ b/package/iptraf/patches/patch-src_options_c
@@ -0,0 +1,22 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/options.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/options.c 2008-10-09 17:34:11.000000000 +0200
+@@ -68,8 +68,6 @@ void makeoptionmenu(struct MENU *menu)
+ tx_additem(menu, NULL, NULL);
+ tx_additem(menu, " ^E^thernet/PLIP host descriptions...",
+ "Manages descriptions for Ethernet and PLIP addresses");
+- tx_additem(menu, " ^F^DDI/Token Ring host descriptions...",
+- "Manages descriptions for FDDI and FDDI addresses");
+ tx_additem(menu, NULL, NULL);
+ tx_additem(menu, " E^x^it configuration", "Returns to main menu");
+ }
+@@ -371,9 +369,6 @@ void setoptions(struct OPTIONS *options,
+ case 14:
+ ethdescmgr(LINK_ETHERNET);
+ break;
+- case 15:
+- ethdescmgr(LINK_FDDI);
+- break;
+ }
+
+ indicatesetting(row, options, statwin);
diff --git a/package/iptraf/patches/patch-src_othptab_c b/package/iptraf/patches/patch-src_othptab_c
new file mode 100644
index 000000000..5474c21c1
--- /dev/null
+++ b/package/iptraf/patches/patch-src_othptab_c
@@ -0,0 +1,33 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/othptab.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/othptab.c 2008-10-09 17:34:11.000000000 +0200
+@@ -19,7 +19,6 @@ details.
+ #include <asm/types.h>
+ #include <linux/if_ether.h>
+ #include <linux/if_tr.h>
+-#include <linux/if_fddi.h>
+ #include <winops.h>
+ #include "arphdr.h"
+ #include "options.h"
+@@ -139,11 +138,6 @@ struct othptabent *add_othp_entry(struct
+ new_entry->smacaddr);
+ convmacaddr(((struct ethhdr *) packet)->h_dest,
+ new_entry->dmacaddr);
+- } else if (linkproto == LINK_FDDI) {
+- convmacaddr(((struct fddihdr *) packet)->saddr,
+- new_entry->smacaddr);
+- convmacaddr(((struct fddihdr *) packet)->daddr,
+- new_entry->dmacaddr);
+ } else if (linkproto == LINK_TR) {
+ convmacaddr(((struct trh_hdr *) packet)->saddr,
+ new_entry->smacaddr);
+@@ -373,8 +367,7 @@ void printothpentry(struct othptable *ta
+ strcat(msgstring, scratchpad);
+
+ if ((entry->linkproto == LINK_ETHERNET) ||
+- (entry->linkproto == LINK_PLIP) ||
+- (entry->linkproto == LINK_FDDI)) {
++ (entry->linkproto == LINK_PLIP)) {
+ sprintf(scratchpad, " from %s to %s on %s",
+ entry->smacaddr, entry->dmacaddr, entry->iface);
+
diff --git a/package/iptraf/patches/patch-src_packet_c b/package/iptraf/patches/patch-src_packet_c
new file mode 100644
index 000000000..c5669deca
--- /dev/null
+++ b/package/iptraf/patches/patch-src_packet_c
@@ -0,0 +1,50 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/packet.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/packet.c 2008-10-09 17:34:11.000000000 +0200
+@@ -35,7 +35,6 @@ details.
+ #include <sys/ioctl.h>
+ #include <linux/if_packet.h>
+ #include <linux/if_ether.h>
+-#include <linux/if_fddi.h>
+ #include <linux/if_tr.h>
+ #include <linux/isdn.h>
+ #include <linux/sockios.h>
+@@ -81,8 +80,6 @@ unsigned short getlinktype(unsigned shor
+ result = LINK_ETHERNET;
+ else if (strncmp(ifname, "plip", 4) == 0)
+ result = LINK_PLIP;
+- else if (strncmp(ifname, "fddi", 4) == 0) /* For some Ethernet- */
+- result = LINK_ETHERNET; /* emulated FDDI ifaces */
+ else if (strncmp(ifname, "dvb", 3) == 0)
+ result = LINK_ETHERNET;
+ else if (strncmp(ifname, "sbni", 4) == 0)
+@@ -136,9 +133,6 @@ unsigned short getlinktype(unsigned shor
+ case ARPHRD_PPP:
+ result = LINK_PPP;
+ break;
+- case ARPHRD_FDDI:
+- result = LINK_FDDI;
+- break;
+ case ARPHRD_IEEE802:
+ case ARPHRD_IEEE802_TR:
+ result = LINK_TR;
+@@ -194,19 +188,6 @@ void adjustpacket(char *tpacket, unsigne
+ *packet = tpacket + 4;
+ *readlen -= 4;
+ break;
+- case LINK_FDDI:
+- *packet = tpacket + sizeof(struct fddihdr);
+- *readlen -= sizeof(struct fddihdr);
+-
+- /*
+- * Move IP data into an aligned buffer. 96 bytes should be sufficient
+- * for IP and TCP headers with reasonable numbers of options and some
+- * data.
+- */
+-
+- memmove(aligned_buf, *packet, min(SNAPSHOT_LEN, *readlen));
+- *packet = aligned_buf;
+- break;
+ case LINK_TR:
+ /*
+ * Token Ring patch supplied by Tomas Dvorak
diff --git a/package/iptraf/patches/patch-src_promisc_c b/package/iptraf/patches/patch-src_promisc_c
new file mode 100644
index 000000000..a8b4c4f90
--- /dev/null
+++ b/package/iptraf/patches/patch-src_promisc_c
@@ -0,0 +1,22 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/promisc.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/promisc.c 2008-10-09 17:34:11.000000000 +0200
+@@ -81,8 +81,8 @@ void init_promisc_list(struct promisc_st
+ */
+
+ if ((strncmp(buf, "eth", 3) == 0) ||
+- (strncmp(buf, "fddi", 4) == 0) ||
+ (strncmp(buf, "tr", 2) == 0) ||
++ (strncmp(buf, "vlan", 4) == 0) ||
+ (strncmp(ptmp->params.ifname, "wvlan", 4) == 0) ||
+ (strncmp(ptmp->params.ifname, "lec", 3) == 0) ||
+ (accept_unsupported_interfaces)) {
+@@ -195,7 +195,7 @@ void srpromisc(int mode, struct promisc_
+
+ while (ptmp != NULL) {
+ if (((strncmp(ptmp->params.ifname, "eth", 3) == 0) ||
+- (strncmp(ptmp->params.ifname, "fddi", 4) == 0) ||
++ (strncmp(ptmp->params.ifname, "vlan", 4) == 0) ||
+ (strncmp(ptmp->params.ifname, "tr", 2) == 0) ||
+ (strncmp(ptmp->params.ifname, "wvlan", 4) == 0) ||
+ (strncmp(ptmp->params.ifname, "lec", 3) == 0)) &&
diff --git a/package/iptraf/patches/patch-src_rvnamed_h b/package/iptraf/patches/patch-src_rvnamed_h
new file mode 100644
index 000000000..f2637c597
--- /dev/null
+++ b/package/iptraf/patches/patch-src_rvnamed_h
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/rvnamed.h 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/rvnamed.h 2008-10-09 17:34:11.000000000 +0200
+@@ -1,9 +1,9 @@
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+
+-#define CHILDSOCKNAME "/dev/rvndcldcomsk"
+-#define PARENTSOCKNAME "/dev/rvndpntcomsk"
+-#define IPTSOCKNAME "/dev/rvndiptcomsk"
++#define CHILDSOCKNAME "/tmp/rvndcldcomsk"
++#define PARENTSOCKNAME "/tmp/rvndpntcomsk"
++#define IPTSOCKNAME "/tmp/rvndiptcomsk"
+
+ #define SOCKET_PREFIX "isock"
+
diff --git a/package/iptraf/patches/patch-src_tcptable_c b/package/iptraf/patches/patch-src_tcptable_c
new file mode 100644
index 000000000..83ba44ff3
--- /dev/null
+++ b/package/iptraf/patches/patch-src_tcptable_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/tcptable.c 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/tcptable.c 2008-10-09 17:34:11.000000000 +0200
+@@ -600,8 +600,6 @@ void updateentry(struct tcptable *table,
+
+ if ((linkproto == LINK_ETHERNET) || (linkproto == LINK_PLIP)) {
+ convmacaddr(((struct ethhdr *) packet)->h_source, newmacaddr);
+- } else if (linkproto == LINK_FDDI) {
+- convmacaddr(((struct fddihdr *) packet)->saddr, newmacaddr);
+ } else if (linkproto == LINK_TR) {
+ convmacaddr(((struct trh_hdr *) packet)->saddr, newmacaddr);
+ }
diff --git a/package/iptraf/patches/patch-src_tcptable_h b/package/iptraf/patches/patch-src_tcptable_h
new file mode 100644
index 000000000..fa3d66618
--- /dev/null
+++ b/package/iptraf/patches/patch-src_tcptable_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/src/tcptable.h 2005-09-13 08:42:54.000000000 +0200
++++ iptraf-3.0.0/src/tcptable.h 2008-10-09 17:34:11.000000000 +0200
+@@ -22,7 +22,6 @@
+ #include <asm/types.h>
+ #include <linux/if_packet.h>
+ #include <linux/if_ether.h>
+-#include <linux/if_fddi.h>
+ #include <linux/if_tr.h>
+ #include <net/if.h>
+ #include <netinet/ip.h>
diff --git a/package/iptraf/patches/patch-support_Makefile b/package/iptraf/patches/patch-support_Makefile
new file mode 100644
index 000000000..c72b89ef6
--- /dev/null
+++ b/package/iptraf/patches/patch-support_Makefile
@@ -0,0 +1,24 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- iptraf-3.0.0.orig/support/Makefile 2002-07-19 18:31:48.000000000 +0200
++++ iptraf-3.0.0/support/Makefile 2008-10-09 17:34:11.000000000 +0200
+@@ -3,16 +3,14 @@ INCLUDEDIR = -I/usr/include/ncurses
+ OBJS = input.o menurt.o listbox.o winops.o labels.o \
+ msgboxes.o txbox.o
+
+-all: libtextbox.a
+-
+ libtextbox.a: $(OBJS)
+ rm -rf libtextbox.a
+- ar cq libtextbox.a $(OBJS)
+- ranlib libtextbox.a
+-# gcc -shared -o libtextbox.so $(OBJS)
++ $(AR) cq libtextbox.a $(OBJS)
++ $(RANLIB) libtextbox.a
++# $(CC) -shared -o libtextbox.so $(OBJS)
+
+ %.o: %.c *.h
+- gcc -O2 -g -Wall -fPIC $(INCLUDEDIR) -c -o $*.o $<
++ $(CC) -O2 -g -Wall -fPIC $(INCLUDEDIR) -c -o $*.o $<
+
+ clean:
+ rm -rf *.o *~ libtextbox.a libtextbox.so
diff --git a/package/irssi/Config.in b/package/irssi/Config.in
new file mode 100644
index 000000000..8aac10af4
--- /dev/null
+++ b/package/irssi/Config.in
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_IRSSI
+ prompt "irssi............................. console irc client"
+ tristate
+ default n
+ select ADK_PACKAGE_GLIB2
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ IRC client for the text console
+
+ http://irssi.org
+
+config ADK_PACKAGE_IRSSI_SSL
+ bool " Enable SSL/TLS support"
+ depends ADK_PACKAGE_IRSSI
+ select ADK_PACKAGE_LIBOPENSSL
+ default n
+ help
+ Enable this to be able to chat more securely.
diff --git a/package/irssi/Makefile b/package/irssi/Makefile
new file mode 100644
index 000000000..e7d8eb5e7
--- /dev/null
+++ b/package/irssi/Makefile
@@ -0,0 +1,42 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= irssi
+PKG_VERSION:= 0.8.12
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e407b557b3cfc7c91ce4de2571dd79cb
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://www.irssi.org/files/
+PKG_DEPENDS:= glib2, libncurses
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IRSSI,irssi,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-perl=no \
+ --with-gnu-ld \
+ --with-textui \
+ --with-terminfo \
+ --without-bot \
+ --without-proxy \
+ --enable-static
+BUILD_STYLE= auto
+
+ifeq (${ADK_PACKAGE_IRSSI_SSL},y)
+CONFIGURE_ARGS+= --enable-ssl
+PKG_DEPENDS:= ${PKG_DEPENDS}, openssl
+else
+CONFIGURE_ARGS+= --disable-ssl
+endif
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_IRSSI}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/src/fe-text/${PKG_NAME} ${IDIR_IRSSI}/usr/bin/
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_IRSSI}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/irssi/ipkg/irssi.control b/package/irssi/ipkg/irssi.control
new file mode 100644
index 000000000..5112153c4
--- /dev/null
+++ b/package/irssi/ipkg/irssi.control
@@ -0,0 +1,4 @@
+Package: irssi
+Priority: optional
+Section: text
+Description: IRC text client
diff --git a/package/iw/Config.in b/package/iw/Config.in
new file mode 100644
index 000000000..16b88454d
--- /dev/null
+++ b/package/iw/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_IW
+ prompt "iw................................ Tools for manipulating Linux Wireless cards"
+ tristate
+ select ADK_PACKAGE_LIBNL
+ default n
+ help
+ Tools for configuring Wireless Adapters.
diff --git a/package/iw/Makefile b/package/iw/Makefile
new file mode 100644
index 000000000..997abebfc
--- /dev/null
+++ b/package/iw/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= iw
+PKG_VERSION:= 0.9.13
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cf9121abb4ffe6dce1691e2ec97d5b2b
+MASTER_SITES:= http://wireless.kernel.org/download/iw/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,IW,iw,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_IW}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/iw ${IDIR_IW}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/iw/ipkg/iw.control b/package/iw/ipkg/iw.control
new file mode 100644
index 000000000..b6246b4df
--- /dev/null
+++ b/package/iw/ipkg/iw.control
@@ -0,0 +1,4 @@
+Package: iw
+Priority: optional
+Section: net
+Description: Tools for setting up WiFi cards via netlink (nl80211)
diff --git a/package/jamvm/Config.in b/package/jamvm/Config.in
new file mode 100644
index 000000000..0a4c39451
--- /dev/null
+++ b/package/jamvm/Config.in
@@ -0,0 +1,16 @@
+config ADK_PACKAGE_JAMVM
+ prompt "jamvm............................. A compact Java Virtual Machine"
+ tristate
+ default n
+ select ADK_PACKAGE_ZLIB
+ select ADK_PACKAGE_LIBFFI
+ help
+ JamVM is a new Java Virtual Machine which conforms to the JVM
+ specification version (blue book). In comparison to most other VM's
+ (free and commercial) it is extremely small.However, unlike other
+ small VMs (e.g. KVM) it is designed to support the full
+ specification, and includes support for object finalisation,
+ Soft/Weak/Phantom References, the Java Native Interface (JNI) and the
+ Reflection API.
+
+ http://sourceforge.net/projects/jamvm
diff --git a/package/jamvm/Makefile b/package/jamvm/Makefile
new file mode 100644
index 000000000..eb066fe46
--- /dev/null
+++ b/package/jamvm/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= jamvm
+PKG_VERSION:= 1.5.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 5a82751b50391eb092c906ce64f3b6bf
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=jamvm/}
+
+include ${TOPDIR}/mk/package.mk
+
+${eval ${call PKG_template,JAMVM,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}}}
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-ffi
+
+do-build:
+ ${INSTALL_DIR} ${WRKINST}/usr/bin
+ ${INSTALL_DIR} ${WRKINST}/usr/share/jamvm
+ ${MAKE} -C ${WRKBUILD}/src \
+ ${TARGET_CONFIGURE_OPTS}
+ ${CP} ${WRKBUILD}/src/jamvm ${WRKINST}/usr/bin
+ ${MAKE} -C ${WRKBUILD}/lib
+ ${CP} ${WRKBUILD}/lib/classes.zip ${WRKINST}/usr/share/jamvm
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_JAMVM}/usr/bin
+ ${INSTALL_DIR} ${IDIR_JAMVM}/usr/share/jamvm
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/jamvm ${IDIR_JAMVM}/usr/bin
+ ${CP} ${WRKINST}/usr/share/jamvm/classes.zip ${IDIR_JAMVM}/usr/share/jamvm
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/jamvm/ipkg/jamvm.control b/package/jamvm/ipkg/jamvm.control
new file mode 100644
index 000000000..f33e66c94
--- /dev/null
+++ b/package/jamvm/ipkg/jamvm.control
@@ -0,0 +1,5 @@
+Package: jamvm
+Priority: optional
+Section: misc
+Description: A Java Virtual Machine (JVM) implementation
+Depends: libffi, zlib
diff --git a/package/jpeg/Config.in b/package/jpeg/Config.in
new file mode 100644
index 000000000..4d05a0761
--- /dev/null
+++ b/package/jpeg/Config.in
@@ -0,0 +1,15 @@
+config ADK_COMPILE_JPEG
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBJPEG
+
+config ADK_PACKAGE_LIBJPEG
+ prompt "libjpeg........................... The Independent JPEG Group's JPEG runtime library"
+ tristate
+ default n
+ select ADK_COMPILE_JPEG
+ help
+ The Independent JPEG Group's JPEG runtime library.
+
+ http://www.ijg.org/
+
diff --git a/package/jpeg/Makefile b/package/jpeg/Makefile
new file mode 100644
index 000000000..731222e86
--- /dev/null
+++ b/package/jpeg/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= jpeg
+PKG_VERSION:= 6b
+PKG_RELEASE:= 1
+PKG_MD5SUM:= dbd5f3b47ed13132f04c685d608a7547
+MASTER_SITES:= http://www.ijg.org/files/ \
+ ftp://ftp.uu.net/graphics/jpeg/
+DISTFILES:= ${PKG_NAME}src.v${PKG_VERSION}.tar.gz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBJPEG,libjpeg,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+FAKE_FLAGS+= prefix="${WRKINST}/usr" \
+ exec_prefix="${WRKINST}/usr"
+INSTALL_TARGET:= install-headers install-lib
+
+pre-build:
+ mkdir -p ${WRKINST}/usr/{include,lib}
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBJPEG}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libjpeg.* ${IDIR_LIBJPEG}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/jpeg/ipkg/libjpeg.control b/package/jpeg/ipkg/libjpeg.control
new file mode 100644
index 000000000..83111d7c7
--- /dev/null
+++ b/package/jpeg/ipkg/libjpeg.control
@@ -0,0 +1,6 @@
+Package: libjpeg
+Priority: optional
+Section: libs
+Depends:
+Description: The Independent JPEG Group's JPEG runtime library
+
diff --git a/package/jpeg/patches/jpeg-6b-config_guess.patch b/package/jpeg/patches/jpeg-6b-config_guess.patch
new file mode 100644
index 000000000..de8141f1b
--- /dev/null
+++ b/package/jpeg/patches/jpeg-6b-config_guess.patch
@@ -0,0 +1,2854 @@
+diff -urN jpeg.old/config.guess jpeg.dev/config.guess
+--- jpeg.old/config.guess 1998-03-25 16:25:38.000000000 +0100
++++ jpeg.dev/config.guess 2006-04-21 16:22:05.000000000 +0200
+@@ -1,7 +1,10 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+-# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+-#
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++timestamp='2004-11-12'
++
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+@@ -21,125 +24,314 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
+-# Written by Per Bothner <bothner@cygnus.com>.
+-# The master version of this file is at the FSF in /home/gd/gnu/lib.
++# Originally written by Per Bothner <per@bothner.com>.
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
+ #
+ # This script attempts to guess a canonical system name similar to
+ # config.sub. If it succeeds, it prints the system name on stdout, and
+ # exits with 0. Otherwise, it exits with 1.
+ #
+ # The plan is that this can be called by configure scripts if you
+-# don't specify an explicit system type (host/target name).
+-#
+-# Only a few systems have been added to this list; please add others
+-# (but try to keep the structure clean).
+-#
++# don't specify an explicit build system type.
++
++me=`echo "$0" | sed -e 's,.*/,,'`
++
++usage="\
++Usage: $0 [OPTION]
++
++Output the configuration name of the system \`$me' is run on.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.guess ($timestamp)
++
++Originally written by Per Bothner.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
++Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit 0 ;;
++ --version | -v )
++ echo "$version" ; exit 0 ;;
++ --help | --h* | -h )
++ echo "$usage"; exit 0 ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help" >&2
++ exit 1 ;;
++ * )
++ break ;;
++ esac
++done
++
++if test $# != 0; then
++ echo "$me: too many arguments$help" >&2
++ exit 1
++fi
++
++trap 'exit 1' 1 2 15
++
++# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
++# compiler to aid in system detection is discouraged as it requires
++# temporary files to be created and, as you can see below, it is a
++# headache to deal with in a portable fashion.
++
++# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
++# use `HOST_CC' if defined, but it is deprecated.
++
++# Portable tmp directory creation inspired by the Autoconf team.
++
++set_cc_for_build='
++trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
++trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
++: ${TMPDIR=/tmp} ;
++ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
++ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
++dummy=$tmp/dummy ;
++tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
++case $CC_FOR_BUILD,$HOST_CC,$CC in
++ ,,) echo "int x;" > $dummy.c ;
++ for c in cc gcc c89 c99 ; do
++ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
++ CC_FOR_BUILD="$c"; break ;
++ fi ;
++ done ;
++ if test x"$CC_FOR_BUILD" = x ; then
++ CC_FOR_BUILD=no_compiler_found ;
++ fi
++ ;;
++ ,,*) CC_FOR_BUILD=$CC ;;
++ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
++esac ;'
+
+ # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+-# (ghazi@noc.rutgers.edu 8/24/94.)
++# (ghazi@noc.rutgers.edu 1994-08-24)
+ if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+ fi
+
+ UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
++UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+-
+ # Note: order is significant - the case branches are not exclusive.
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
++ *:NetBSD:*:*)
++ # NetBSD (nbsd) targets should (where applicable) match one or
++ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
++ # switched to ELF, *-*-netbsd* would select the old
++ # object file format. This provides both forward
++ # compatibility and a consistent mechanism for selecting the
++ # object file format.
++ #
++ # Note: NetBSD doesn't particularly care about the vendor
++ # portion of the name. We always set it to "unknown".
++ sysctl="sysctl -n hw.machine_arch"
++ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
++ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
++ case "${UNAME_MACHINE_ARCH}" in
++ armeb) machine=armeb-unknown ;;
++ arm*) machine=arm-unknown ;;
++ sh3el) machine=shl-unknown ;;
++ sh3eb) machine=sh-unknown ;;
++ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
++ esac
++ # The Operating System including object format, if it has switched
++ # to ELF recently, or will in the future.
++ case "${UNAME_MACHINE_ARCH}" in
++ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
++ eval $set_cc_for_build
++ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
++ | grep __ELF__ >/dev/null
++ then
++ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
++ # Return netbsd for either. FIX?
++ os=netbsd
++ else
++ os=netbsdelf
++ fi
++ ;;
++ *)
++ os=netbsd
++ ;;
++ esac
++ # The OS release
++ # Debian GNU/NetBSD machines have a different userland, and
++ # thus, need a distinct triplet. However, they do not need
++ # kernel version information, so it can be replaced with a
++ # suitable tag, in the style of linux-gnu.
++ case "${UNAME_VERSION}" in
++ Debian*)
++ release='-gnu'
++ ;;
++ *)
++ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ ;;
++ esac
++ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
++ # contains redundant information, the shorter form:
++ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
++ echo "${machine}-${os}${release}"
++ exit 0 ;;
++ amd64:OpenBSD:*:*)
++ echo x86_64-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ amiga:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ cats:OpenBSD:*:*)
++ echo arm-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ hp300:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ luna88k:OpenBSD:*:*)
++ echo m88k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mac68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ macppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme88k:OpenBSD:*:*)
++ echo m88k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvmeppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sgi:OpenBSD:*:*)
++ echo mips64-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sun3:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:OpenBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:ekkoBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
++ exit 0 ;;
++ macppc:MirBSD:*:*)
++ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:MirBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
++ exit 0 ;;
+ alpha:OSF1:*:*)
+- if test $UNAME_RELEASE = "V4.0"; then
++ case $UNAME_RELEASE in
++ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+- fi
++ ;;
++ *5.*)
++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
++ ;;
++ esac
++ # According to Compaq, /usr/sbin/psrinfo has been available on
++ # OSF/1 and Tru64 systems produced since 1995. I hope that
++ # covers most systems running today. This code pipes the CPU
++ # types through head -n 1, so we only detect the type of CPU 0.
++ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
++ case "$ALPHA_CPU_TYPE" in
++ "EV4 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "EV4.5 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "LCA4 (21066/21068)")
++ UNAME_MACHINE="alpha" ;;
++ "EV5 (21164)")
++ UNAME_MACHINE="alphaev5" ;;
++ "EV5.6 (21164A)")
++ UNAME_MACHINE="alphaev56" ;;
++ "EV5.6 (21164PC)")
++ UNAME_MACHINE="alphapca56" ;;
++ "EV5.7 (21164PC)")
++ UNAME_MACHINE="alphapca57" ;;
++ "EV6 (21264)")
++ UNAME_MACHINE="alphaev6" ;;
++ "EV6.7 (21264A)")
++ UNAME_MACHINE="alphaev67" ;;
++ "EV6.8CB (21264C)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8AL (21264B)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8CX (21264D)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.9A (21264/EV69A)")
++ UNAME_MACHINE="alphaev69" ;;
++ "EV7 (21364)")
++ UNAME_MACHINE="alphaev7" ;;
++ "EV7.9 (21364A)")
++ UNAME_MACHINE="alphaev79" ;;
++ esac
++ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+- cat <<EOF >dummy.s
+- .globl main
+- .ent main
+-main:
+- .frame \$30,0,\$26,0
+- .prologue 0
+- .long 0x47e03d80 # implver $0
+- lda \$2,259
+- .long 0x47e20c21 # amask $2,$1
+- srl \$1,8,\$2
+- sll \$2,2,\$2
+- sll \$0,3,\$0
+- addl \$1,\$0,\$0
+- addl \$2,\$0,\$0
+- ret \$31,(\$26),1
+- .end main
+-EOF
+- ${CC-cc} dummy.s -o dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- ./dummy
+- case "$?" in
+- 7)
+- UNAME_MACHINE="alpha"
+- ;;
+- 15)
+- UNAME_MACHINE="alphaev5"
+- ;;
+- 14)
+- UNAME_MACHINE="alphaev56"
+- ;;
+- 10)
+- UNAME_MACHINE="alphapca56"
+- ;;
+- 16)
+- UNAME_MACHINE="alphaev6"
+- ;;
+- esac
+- fi
+- rm -f dummy.s dummy
+- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
++ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
++ exit 0 ;;
++ Alpha\ *:Windows_NT*:*)
++ # How do we know it's Interix rather than the generic POSIX subsystem?
++ # Should we change UNAME_MACHINE based on the output of uname instead
++ # of the specific Alpha model?
++ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+- echo m68k-cbm-sysv4
++ echo m68k-unknown-sysv4
+ exit 0;;
+- amiga:NetBSD:*:*)
+- echo m68k-cbm-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- amiga:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- arc64:OpenBSD:*:*)
+- echo mips64el-unknown-openbsd${UNAME_RELEASE}
++ *:[Aa]miga[Oo][Ss]:*:*)
++ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+- arc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ *:[Mm]orph[Oo][Ss]:*:*)
++ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+- hkmips:OpenBSD:*:*)
+- echo mips-unknown-openbsd${UNAME_RELEASE}
++ *:OS/390:*:*)
++ echo i370-ibm-openedition
+ exit 0 ;;
+- pmax:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sgi:OpenBSD:*:*)
+- echo mips-unknown-openbsd${UNAME_RELEASE}
++ *:z/VM:*:*)
++ echo s390-ibm-zvmoe
+ exit 0 ;;
+- wgrisc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ *:OS400:*:*)
++ echo powerpc-ibm-os400
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+- arm32:NetBSD:*:*)
+- echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+- exit 0 ;;
+- SR2?01:HI-UX/MPP:*:*)
++ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
++ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+@@ -147,9 +339,19 @@
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+- NILE:*:*:dcosx)
++ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
++ DRS?6000:unix:4.0:6*)
++ echo sparc-icl-nx6
++ exit 0 ;;
++ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
++ case `/usr/bin/uname -p` in
++ sparc) echo sparc-icl-nx7 && exit 0 ;;
++ esac ;;
++ sun4H:SunOS:5.*:*)
++ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+@@ -175,7 +377,7 @@
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
++ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+@@ -189,29 +391,34 @@
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+- atari*:NetBSD:*:*)
+- echo m68k-atari-netbsd${UNAME_RELEASE}
++ # The situation for MiNT is a little confusing. The machine name
++ # can be virtually everything (everything which is not
++ # "atarist" or "atariste" at least should have a processor
++ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
++ # to the lowercase version "mint" (or "freemint"). Finally
++ # the system name "TOS" denotes a system which is actually not
++ # MiNT. But MiNT is downward compatible to TOS, so this should
++ # be no problem.
++ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+- atari*:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sun3*:NetBSD:*:*)
+- echo m68k-sun-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sun3*:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mac68k:NetBSD:*:*)
+- echo m68k-apple-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mac68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvme68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
++ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
++ echo m68k-atari-mint${UNAME_RELEASE}
++ exit 0 ;;
++ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+- mvme88k:OpenBSD:*:*)
+- echo m88k-unknown-openbsd${UNAME_RELEASE}
++ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
++ echo m68k-milan-mint${UNAME_RELEASE}
++ exit 0 ;;
++ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
++ echo m68k-hades-mint${UNAME_RELEASE}
++ exit 0 ;;
++ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
++ echo m68k-unknown-mint${UNAME_RELEASE}
++ exit 0 ;;
++ m68k:machten:*:*)
++ echo m68k-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+@@ -225,12 +432,18 @@
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+- 2020:CLIX:*:*)
++ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+- sed 's/^ //' << EOF >dummy.c
+- int main (argc, argv) int argc; char **argv; {
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++#ifdef __cplusplus
++#include <stdio.h> /* for printf() prototype */
++ int main (int argc, char *argv[]) {
++#else
++ int main (argc, argv) int argc; char *argv[]; {
++#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+@@ -245,12 +458,20 @@
+ exit (-1);
+ }
+ EOF
+- ${CC-cc} dummy.c -o dummy \
+- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+- && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c \
++ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
++ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
++ Motorola:PowerMAX_OS:*:*)
++ echo powerpc-motorola-powermax
++ exit 0 ;;
++ Motorola:*:4.3:PL8-*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
++ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+@@ -266,15 +487,18 @@
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
++ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
++ then
++ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
++ [ ${TARGET_BINARY_INTERFACE}x = x ]
++ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+- else
++ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
++ fi
++ else
++ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+- else echo i586-dg-dgux${UNAME_RELEASE}
+- fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+@@ -295,12 +519,21 @@
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+- i?86:AIX:*:*)
++ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
++ ia64:AIX:*:*)
++ if [ -x /usr/bin/oslevel ] ; then
++ IBM_REV=`/usr/bin/oslevel`
++ else
++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
++ fi
++ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
++ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+- sed 's/^ //' << EOF >dummy.c
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+@@ -311,8 +544,7 @@
+ exit(0);
+ }
+ EOF
+- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+@@ -320,8 +552,9 @@
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+- *:AIX:*:4)
+- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
++ *:AIX:*:[45])
++ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
++ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+@@ -329,7 +562,7 @@
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+- IBM_REV=4.${UNAME_RELEASE}
++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+@@ -339,7 +572,7 @@
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
++ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+@@ -354,18 +587,85 @@
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+- 9000/[3478]??:HP-UX:*:*)
++ 9000/[34678]??:HP-UX:*:*)
++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+- 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
+- 9000/8?? ) HP_ARCH=hppa1.0 ;;
++ 9000/[678][0-9][0-9])
++ if [ -x /usr/bin/getconf ]; then
++ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
++ case "${sc_cpu_version}" in
++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
++ 532) # CPU_PA_RISC2_0
++ case "${sc_kernel_bits}" in
++ 32) HP_ARCH="hppa2.0n" ;;
++ 64) HP_ARCH="hppa2.0w" ;;
++ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
++ esac ;;
++ esac
++ fi
++ if [ "${HP_ARCH}" = "" ]; then
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++
++ #define _HPUX_SOURCE
++ #include <stdlib.h>
++ #include <unistd.h>
++
++ int main ()
++ {
++ #if defined(_SC_KERNEL_BITS)
++ long bits = sysconf(_SC_KERNEL_BITS);
++ #endif
++ long cpu = sysconf (_SC_CPU_VERSION);
++
++ switch (cpu)
++ {
++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
++ case CPU_PA_RISC2_0:
++ #if defined(_SC_KERNEL_BITS)
++ switch (bits)
++ {
++ case 64: puts ("hppa2.0w"); break;
++ case 32: puts ("hppa2.0n"); break;
++ default: puts ("hppa2.0"); break;
++ } break;
++ #else /* !defined(_SC_KERNEL_BITS) */
++ puts ("hppa2.0"); break;
++ #endif
++ default: puts ("hppa1.0"); break;
++ }
++ exit (0);
++ }
++EOF
++ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
++ test -z "$HP_ARCH" && HP_ARCH=hppa
++ fi ;;
+ esac
+- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++ if [ ${HP_ARCH} = "hppa2.0w" ]
++ then
++ # avoid double evaluation of $set_cc_for_build
++ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
++ then
++ HP_ARCH="hppa2.0w"
++ else
++ HP_ARCH="hppa64"
++ fi
++ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
++ ia64:HP-UX:*:*)
++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++ echo ia64-hp-hpux${HPUX_REV}
++ exit 0 ;;
+ 3050*:HI-UX:*:*)
+- sed 's/^ //' << EOF >dummy.c
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+@@ -390,8 +690,7 @@
+ exit (0);
+ }
+ EOF
+- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+@@ -400,13 +699,16 @@
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
++ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
++ echo hppa1.0-hp-mpeix
++ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+- i?86:OSF1:*:*)
++ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+@@ -434,196 +736,259 @@
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+- CRAY*X-MP:*:*:*)
+- echo xmp-cray-unicos
+- exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+- echo ymp-cray-unicos${UNAME_RELEASE}
++ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
++ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
++ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+- echo t90-cray-unicos${UNAME_RELEASE}
++ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+- CRAY-2:*:*:*)
+- echo cray2-cray-unicos
+- exit 0 ;;
+- F300:UNIX_System_V:*:*)
+- FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
++ CRAY*T3E:*:*:*)
++ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ CRAY*SV1:*:*:*)
++ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ *:UNICOS/mp:*:*)
++ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
++ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+- F301:UNIX_System_V:*:*)
+- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+- exit 0 ;;
+- hp3[0-9][05]:NetBSD:*:*)
+- echo m68k-hp-netbsd${UNAME_RELEASE}
++ 5000:UNIX_System_V:4.*:*)
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+- hp300:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- i?86:BSD/386:*:* | *:BSD/OS:*:*)
++ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+- *:FreeBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
++ sparc*:BSD/OS:*:*)
++ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+- *:NetBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ *:BSD/OS:*:*)
++ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+- *:OpenBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ *:FreeBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ i*:CYGWIN*:*)
+- echo i386-pc-cygwin32
++ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+- echo i386-pc-mingw32
++ echo ${UNAME_MACHINE}-pc-mingw32
++ exit 0 ;;
++ i*:PW*:*)
++ echo ${UNAME_MACHINE}-pc-pw32
++ exit 0 ;;
++ x86:Interix*:[34]*)
++ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
++ exit 0 ;;
++ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
++ echo i${UNAME_MACHINE}-pc-mks
++ exit 0 ;;
++ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
++ # How do we know it's Interix rather than the generic POSIX subsystem?
++ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
++ # UNAME_MACHINE based on the output of uname instead of i386?
++ echo i586-pc-interix
++ exit 0 ;;
++ i*:UWIN*:*)
++ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+- echo powerpcle-unknown-cygwin32
++ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
++ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+- *:Linux:*:*)
++ *:GNU/*:*:*)
++ # other systems with GNU libc and userland
++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
++ exit 0 ;;
++ i*86:Minix:*:*)
++ echo ${UNAME_MACHINE}-pc-minix
++ exit 0 ;;
++ arm*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ cris:Linux:*:*)
++ echo cris-axis-linux-gnu
++ exit 0 ;;
++ crisv32:Linux:*:*)
++ echo crisv32-axis-linux-gnu
++ exit 0 ;;
++ frv:Linux:*:*)
++ echo frv-unknown-linux-gnu
++ exit 0 ;;
++ ia64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ m32r*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ m68*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ mips:Linux:*:*)
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips
++ #undef mipsel
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mipsel
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips
++ #else
++ CPU=
++ #endif
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ ;;
++ mips64:Linux:*:*)
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips64
++ #undef mips64el
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mips64el
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips64
++ #else
++ CPU=
++ #endif
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ ;;
++ ppc:Linux:*:*)
++ echo powerpc-unknown-linux-gnu
++ exit 0 ;;
++ ppc64:Linux:*:*)
++ echo powerpc64-unknown-linux-gnu
++ exit 0 ;;
++ alpha:Linux:*:*)
++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++ EV5) UNAME_MACHINE=alphaev5 ;;
++ EV56) UNAME_MACHINE=alphaev56 ;;
++ PCA56) UNAME_MACHINE=alphapca56 ;;
++ PCA57) UNAME_MACHINE=alphapca56 ;;
++ EV6) UNAME_MACHINE=alphaev6 ;;
++ EV67) UNAME_MACHINE=alphaev67 ;;
++ EV68*) UNAME_MACHINE=alphaev68 ;;
++ esac
++ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ exit 0 ;;
++ parisc:Linux:*:* | hppa:Linux:*:*)
++ # Look for CPU level
++ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
++ PA7*) echo hppa1.1-unknown-linux-gnu ;;
++ PA8*) echo hppa2.0-unknown-linux-gnu ;;
++ *) echo hppa-unknown-linux-gnu ;;
++ esac
++ exit 0 ;;
++ parisc64:Linux:*:* | hppa64:Linux:*:*)
++ echo hppa64-unknown-linux-gnu
++ exit 0 ;;
++ s390:Linux:*:* | s390x:Linux:*:*)
++ echo ${UNAME_MACHINE}-ibm-linux
++ exit 0 ;;
++ sh64*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ sh*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ sparc:Linux:*:* | sparc64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ x86_64:Linux:*:*)
++ echo x86_64-unknown-linux-gnu
++ exit 0 ;;
++ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+- # first see if it will tell us.
+- ld_help_string=`ld --help 2>&1`
+- ld_supported_emulations=`echo $ld_help_string \
+- | sed -ne '/supported emulations:/!d
++ # first see if it will tell us. cd to the root directory to prevent
++ # problems with other programs or directories called `ld' in the path.
++ # Set LC_ALL=C to ensure ld outputs messages in English.
++ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
++ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+- s/.*supported emulations: *//
++ s/.*supported targets: *//
+ s/ .*//
+ p'`
+- case "$ld_supported_emulations" in
+- i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
+- i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
+- sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+- m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+- elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
+- esac
+-
+- if test "${UNAME_MACHINE}" = "alpha" ; then
+- sed 's/^ //' <<EOF >dummy.s
+- .globl main
+- .ent main
+- main:
+- .frame \$30,0,\$26,0
+- .prologue 0
+- .long 0x47e03d80 # implver $0
+- lda \$2,259
+- .long 0x47e20c21 # amask $2,$1
+- srl \$1,8,\$2
+- sll \$2,2,\$2
+- sll \$0,3,\$0
+- addl \$1,\$0,\$0
+- addl \$2,\$0,\$0
+- ret \$31,(\$26),1
+- .end main
+-EOF
+- LIBC=""
+- ${CC-cc} dummy.s -o dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- ./dummy
+- case "$?" in
+- 7)
+- UNAME_MACHINE="alpha"
+- ;;
+- 15)
+- UNAME_MACHINE="alphaev5"
+- ;;
+- 14)
+- UNAME_MACHINE="alphaev56"
+- ;;
+- 10)
+- UNAME_MACHINE="alphapca56"
+- ;;
+- 16)
+- UNAME_MACHINE="alphaev6"
+- ;;
+- esac
+-
+- objdump --private-headers dummy | \
+- grep ld.so.1 > /dev/null
+- if test "$?" = 0 ; then
+- LIBC="libc1"
+- fi
+- fi
+- rm -f dummy.s dummy
+- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
+- elif test "${UNAME_MACHINE}" = "mips" ; then
+- cat >dummy.c <<EOF
+-main(argc, argv)
+- int argc;
+- char *argv[];
+-{
+-#ifdef __MIPSEB__
+- printf ("%s-unknown-linux-gnu\n", argv[1]);
+-#endif
+-#ifdef __MIPSEL__
+- printf ("%sel-unknown-linux-gnu\n", argv[1]);
+-#endif
+- return 0;
+-}
+-EOF
+- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
+- else
+- # Either a pre-BFD a.out linker (linux-gnuoldld)
+- # or one that does not give us useful --help.
+- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+- # If ld does not provide *any* "supported emulations:"
+- # that means it is gnuoldld.
+- echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+- test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+-
+- case "${UNAME_MACHINE}" in
+- i?86)
+- VENDOR=pc;
+- ;;
+- *)
+- VENDOR=unknown;
+- ;;
+- esac
+- # Determine whether the default compiler is a.out or elf
+- cat >dummy.c <<EOF
+-#include <features.h>
+-main(argc, argv)
+- int argc;
+- char *argv[];
+-{
+-#ifdef __ELF__
+-# ifdef __GLIBC__
+-# if __GLIBC__ >= 2
+- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+-# else
+- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+-# endif
+-# else
+- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+-# endif
+-#else
+- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+-#endif
+- return 0;
+-}
++ case "$ld_supported_targets" in
++ elf32-i386)
++ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
++ ;;
++ a.out-i386-linux)
++ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
++ exit 0 ;;
++ coff-i386)
++ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
++ exit 0 ;;
++ "")
++ # Either a pre-BFD a.out linker (linux-gnuoldld) or
++ # one that does not give us useful --help.
++ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
++ exit 0 ;;
++ esac
++ # Determine whether the default compiler is a.out or elf
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #include <features.h>
++ #ifdef __ELF__
++ # ifdef __GLIBC__
++ # if __GLIBC__ >= 2
++ LIBC=gnu
++ # else
++ LIBC=gnulibc1
++ # endif
++ # else
++ LIBC=gnulibc1
++ # endif
++ #else
++ #ifdef __INTEL_COMPILER
++ LIBC=gnu
++ #else
++ LIBC=gnuaout
++ #endif
++ #endif
++ #ifdef __dietlibc__
++ LIBC=dietlibc
++ #endif
+ EOF
+- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
+- fi ;;
+-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+-# are messed up and put the nodename in both sysname and nodename.
+- i?86:DYNIX/ptx:4*:*)
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
++ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
++ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
++ ;;
++ i*86:DYNIX/ptx:4*:*)
++ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
++ # earlier versions are messed up and put the nodename in both
++ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+- i?86:UNIX_SV:4.2MP:2.*)
++ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+@@ -631,28 +996,62 @@
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
++ i*86:OS/2:*:*)
++ # If we were able to find `uname', then EMX Unix compatibility
++ # is probably installed.
++ echo ${UNAME_MACHINE}-pc-os2-emx
++ exit 0 ;;
++ i*86:XTS-300:*:STOP)
++ echo ${UNAME_MACHINE}-unknown-stop
++ exit 0 ;;
++ i*86:atheos:*:*)
++ echo ${UNAME_MACHINE}-unknown-atheos
++ exit 0 ;;
++ i*86:syllable:*:*)
++ echo ${UNAME_MACHINE}-pc-syllable
++ exit 0 ;;
++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++ echo i386-unknown-lynxos${UNAME_RELEASE}
++ exit 0 ;;
++ i*86:*DOS:*:*)
++ echo ${UNAME_MACHINE}-pc-msdosdjgpp
++ exit 0 ;;
++ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
++ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
++ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
++ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+- i?86:*:3.2:*)
++ i*86:*:5:[78]*)
++ case `/bin/uname -X | grep "^Machine"` in
++ *486*) UNAME_MACHINE=i486 ;;
++ *Pentium) UNAME_MACHINE=i586 ;;
++ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
++ esac
++ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
++ exit 0 ;;
++ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
++ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
++ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
++ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
++ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
++ && UNAME_MACHINE=i686
++ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
++ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
++ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+@@ -674,9 +1073,15 @@
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+- M68*:*:R3V[567]*:*)
++ mc68k:UNIX:SYSTEM5:3.51m)
++ echo m68k-convergent-sysv
++ exit 0 ;;
++ M680?0:D-NIX:5.3:*)
++ echo m68k-diab-dnix
++ exit 0 ;;
++ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
++ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+@@ -687,24 +1092,27 @@
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+- m68*:LynxOS:2.*:*)
++ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+- i?86:LynxOS:2.*:*)
+- echo i386-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
++ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
++ echo powerpc-unknown-lynxos${UNAME_RELEASE}
++ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
++ RM*:ReliantUNIX-*:*:*)
++ echo mips-sni-sysv4
++ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+@@ -716,8 +1124,8 @@
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+- # says <Richard.M.Bartel@ccMail.Census.GOV>
++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+@@ -729,25 +1137,130 @@
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
++ *:VOS:*:*)
++ # From Paul.Green@stratus.com.
++ echo hppa1.1-stratus-vos
++ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+- news*:NEWS-OS:*:6*)
++ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
++ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
++ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
++ echo powerpc-be-beos
++ exit 0 ;;
++ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
++ echo powerpc-apple-beos
++ exit 0 ;;
++ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
++ echo i586-pc-beos
++ exit 0 ;;
++ SX-4:SUPER-UX:*:*)
++ echo sx4-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
++ SX-5:SUPER-UX:*:*)
++ echo sx5-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
++ SX-6:SUPER-UX:*:*)
++ echo sx6-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
++ Power*:Rhapsody:*:*)
++ echo powerpc-apple-rhapsody${UNAME_RELEASE}
++ exit 0 ;;
++ *:Rhapsody:*:*)
++ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
++ exit 0 ;;
++ *:Darwin:*:*)
++ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
++ case $UNAME_PROCESSOR in
++ *86) UNAME_PROCESSOR=i686 ;;
++ unknown) UNAME_PROCESSOR=powerpc ;;
++ esac
++ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
++ exit 0 ;;
++ *:procnto*:*:* | *:QNX:[0123456789]*:*)
++ UNAME_PROCESSOR=`uname -p`
++ if test "$UNAME_PROCESSOR" = "x86"; then
++ UNAME_PROCESSOR=i386
++ UNAME_MACHINE=pc
++ fi
++ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
++ exit 0 ;;
++ *:QNX:*:4*)
++ echo i386-pc-qnx
++ exit 0 ;;
++ NSR-?:NONSTOP_KERNEL:*:*)
++ echo nsr-tandem-nsk${UNAME_RELEASE}
++ exit 0 ;;
++ *:NonStop-UX:*:*)
++ echo mips-compaq-nonstopux
++ exit 0 ;;
++ BS2000:POSIX*:*:*)
++ echo bs2000-siemens-sysv
++ exit 0 ;;
++ DS/*:UNIX_System_V:*:*)
++ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
++ exit 0 ;;
++ *:Plan9:*:*)
++ # "uname -m" is not consistent, so use $cputype instead. 386
++ # is converted to i386 for consistency with other x86
++ # operating systems.
++ if test "$cputype" = "386"; then
++ UNAME_MACHINE=i386
++ else
++ UNAME_MACHINE="$cputype"
++ fi
++ echo ${UNAME_MACHINE}-unknown-plan9
++ exit 0 ;;
++ *:TOPS-10:*:*)
++ echo pdp10-unknown-tops10
++ exit 0 ;;
++ *:TENEX:*:*)
++ echo pdp10-unknown-tenex
++ exit 0 ;;
++ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
++ echo pdp10-dec-tops20
++ exit 0 ;;
++ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
++ echo pdp10-xkl-tops20
++ exit 0 ;;
++ *:TOPS-20:*:*)
++ echo pdp10-unknown-tops20
++ exit 0 ;;
++ *:ITS:*:*)
++ echo pdp10-unknown-its
++ exit 0 ;;
++ SEI:*:*:SEIUX)
++ echo mips-sei-seiux${UNAME_RELEASE}
++ exit 0 ;;
++ *:DragonFly:*:*)
++ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
++ exit 0 ;;
++ *:*VMS:*:*)
++ UNAME_MACHINE=`(uname -p) 2>/dev/null`
++ case "${UNAME_MACHINE}" in
++ A*) echo alpha-dec-vms && exit 0 ;;
++ I*) echo ia64-dec-vms && exit 0 ;;
++ V*) echo vax-dec-vms && exit 0 ;;
++ esac ;;
++ *:XENIX:*:SysV)
++ echo i386-pc-xenix
++ exit 0 ;;
+ esac
+
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+ #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+-cat >dummy.c <<EOF
++eval $set_cc_for_build
++cat >$dummy.c <<EOF
+ #ifdef _SEQUENT_
+ # include <sys/types.h>
+ # include <sys/utsname.h>
+@@ -785,7 +1298,10 @@
+ #endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
++ if (version < 4)
++ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
++ else
++ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+ #endif
+
+@@ -830,11 +1346,24 @@
+ #endif
+
+ #if defined (vax)
+-#if !defined (ultrix)
+- printf ("vax-dec-bsd\n"); exit (0);
+-#else
+- printf ("vax-dec-ultrix\n"); exit (0);
+-#endif
++# if !defined (ultrix)
++# include <sys/param.h>
++# if defined (BSD)
++# if BSD == 43
++ printf ("vax-dec-bsd4.3\n"); exit (0);
++# else
++# if BSD == 199006
++ printf ("vax-dec-bsd4.3reno\n"); exit (0);
++# else
++ printf ("vax-dec-bsd\n"); exit (0);
++# endif
++# endif
++# else
++ printf ("vax-dec-bsd\n"); exit (0);
++# endif
++# else
++ printf ("vax-dec-ultrix\n"); exit (0);
++# endif
+ #endif
+
+ #if defined (alliant) && defined (i860)
+@@ -845,8 +1374,7 @@
+ }
+ EOF
+
+-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+-rm -f dummy.c dummy
++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+ # Apollos put the system type in the environment.
+
+@@ -878,6 +1406,48 @@
+ esac
+ fi
+
+-#echo '(Unable to guess system type)' 1>&2
++cat >&2 <<EOF
++$0: unable to guess system type
++
++This script, last modified $timestamp, has failed to recognize
++the operating system you are using. It is advised that you
++download the most up to date version of the config scripts from
++
++ ftp://ftp.gnu.org/pub/gnu/config/
++
++If the version you run ($0) is already up to date, please
++send the following data and any information you think might be
++pertinent to <config-patches@gnu.org> in order to provide the needed
++information to handle your system.
++
++config.guess timestamp = $timestamp
++
++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`
++/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
++
++hostinfo = `(hostinfo) 2>/dev/null`
++/bin/universe = `(/bin/universe) 2>/dev/null`
++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
++/bin/arch = `(/bin/arch) 2>/dev/null`
++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
++
++UNAME_MACHINE = ${UNAME_MACHINE}
++UNAME_RELEASE = ${UNAME_RELEASE}
++UNAME_SYSTEM = ${UNAME_SYSTEM}
++UNAME_VERSION = ${UNAME_VERSION}
++EOF
+
+ exit 1
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+diff -urN jpeg.old/config.sub jpeg.dev/config.sub
+--- jpeg.old/config.sub 1998-03-25 16:25:39.000000000 +0100
++++ jpeg.dev/config.sub 2006-04-21 16:16:34.000000000 +0200
+@@ -1,6 +1,10 @@
+ #! /bin/sh
+-# Configuration validation subroutine script, version 1.1.
+-# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
++# Configuration validation subroutine script.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++timestamp='2004-11-30'
++
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+ # can handle that machine. It does not imply ALL GNU software can.
+@@ -25,6 +29,9 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
++#
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+ # If it is invalid, we print an error message on stderr and exit with code 1.
+@@ -45,30 +52,74 @@
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
+-if [ x$1 = x ]
+-then
+- echo Configuration name missing. 1>&2
+- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+- echo "or $0 ALIAS" 1>&2
+- echo where ALIAS is a recognized configuration type. 1>&2
+- exit 1
+-fi
++me=`echo "$0" | sed -e 's,.*/,,'`
+
+-# First pass through any local machine types.
+-case $1 in
+- *local*)
+- echo $1
+- exit 0
+- ;;
+- *)
+- ;;
++usage="\
++Usage: $0 [OPTION] CPU-MFR-OPSYS
++ $0 [OPTION] ALIAS
++
++Canonicalize a configuration name.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.sub ($timestamp)
++
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
++Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit 0 ;;
++ --version | -v )
++ echo "$version" ; exit 0 ;;
++ --help | --h* | -h )
++ echo "$usage"; exit 0 ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help"
++ exit 1 ;;
++
++ *local*)
++ # First pass through any local machine types.
++ echo $1
++ exit 0;;
++
++ * )
++ break ;;
++ esac
++done
++
++case $# in
++ 0) echo "$me: missing argument$help" >&2
++ exit 1;;
++ 1) ;;
++ *) echo "$me: too many arguments$help" >&2
++ exit 1;;
+ esac
+
+ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- linux-gnu*)
++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
++ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -94,15 +145,33 @@
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple)
++ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
++ -sim | -cisco | -oki | -wec | -winbond)
++ os=
++ basic_machine=$1
++ ;;
++ -scout)
++ ;;
++ -wrs)
++ os=-vxworks
++ basic_machine=$1
++ ;;
++ -chorusos*)
++ os=-chorusos
++ basic_machine=$1
++ ;;
++ -chorusrdb)
++ os=-chorusrdb
++ basic_machine=$1
++ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+- os=sco3.2v5
++ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+@@ -121,6 +190,9 @@
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
++ -udk*)
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+@@ -143,26 +215,74 @@
+ -psos*)
+ os=-psos
+ ;;
++ -mint | -mint[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
++ ;;
+ esac
+
+ # Decode aliases for certain CPU-COMPANY combinations.
+ case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+- | arme[lb] | pyramid | mn10200 | mn10300 \
+- | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
+- | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
+- | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
+- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
+- | mipstx39 | mipstx39el \
+- | sparc | sparclet | sparclite | sparc64 | v850)
++ 1750a | 580 \
++ | a29k \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
++ | am33_2.0 \
++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++ | c4x | clipper \
++ | d10v | d30v | dlx | dsp16xx \
++ | fr30 | frv \
++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | i370 | i860 | i960 | ia64 \
++ | ip2k | iq2000 \
++ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64el \
++ | mips64vr | mips64vrel \
++ | mips64orion | mips64orionel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64r2 | mipsisa64r2el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipstx39 | mipstx39el \
++ | mn10200 | mn10300 \
++ | msp430 \
++ | ns16k | ns32k \
++ | openrisc | or32 \
++ | pdp10 | pdp11 | pj | pjl \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | pyramid \
++ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
++ | sh64 | sh64le \
++ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
++ | strongarm \
++ | tahoe | thumb | tic4x | tic80 | tron \
++ | v850 | v850e \
++ | we32k \
++ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
++ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
++ m6811 | m68hc11 | m6812 | m68hc12)
++ # Motorola 68HC11/12.
++ basic_machine=$basic_machine-unknown
++ os=-none
++ ;;
++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
++ ;;
++
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+- i[3456]86)
++ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+@@ -171,27 +291,86 @@
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+- vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+- | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
+- | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
+- | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
+- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+- | sparc64-* | mips64-* | mipsel-* \
+- | mips64el-* | mips64orion-* | mips64orionel-* \
+- | mipstx39-* | mipstx39el-* \
+- | f301-*)
++ 580-* \
++ | a29k-* \
++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
++ | avr-* \
++ | bs2000-* \
++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
++ | clipper-* | craynv-* | cydra-* \
++ | d10v-* | d30v-* | dlx-* \
++ | elxsi-* \
++ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
++ | h8300-* | h8500-* \
++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++ | i*86-* | i860-* | i960-* | ia64-* \
++ | ip2k-* | iq2000-* \
++ | m32r-* | m32rle-* \
++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
++ | m88110-* | m88k-* | maxq-* | mcore-* \
++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
++ | mips16-* \
++ | mips64-* | mips64el-* \
++ | mips64vr-* | mips64vrel-* \
++ | mips64orion-* | mips64orionel-* \
++ | mips64vr4100-* | mips64vr4100el-* \
++ | mips64vr4300-* | mips64vr4300el-* \
++ | mips64vr5000-* | mips64vr5000el-* \
++ | mipsisa32-* | mipsisa32el-* \
++ | mipsisa32r2-* | mipsisa32r2el-* \
++ | mipsisa64-* | mipsisa64el-* \
++ | mipsisa64r2-* | mipsisa64r2el-* \
++ | mipsisa64sb1-* | mipsisa64sb1el-* \
++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
++ | mipstx39-* | mipstx39el-* \
++ | mmix-* \
++ | msp430-* \
++ | none-* | np1-* | ns16k-* | ns32k-* \
++ | orion-* \
++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++ | pyramid-* \
++ | romp-* | rs6000-* \
++ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
++ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
++ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
++ | tahoe-* | thumb-* \
++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++ | tron-* \
++ | v850-* | v850e-* | vax-* \
++ | we32k-* \
++ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
++ | xstormy16-* | xtensa-* \
++ | ymp-* \
++ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
++ 386bsd)
++ basic_machine=i386-unknown
++ os=-bsd
++ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
++ a29khif)
++ basic_machine=a29k-amd
++ os=-udi
++ ;;
++ abacus)
++ basic_machine=abacus-unknown
++ ;;
++ adobe68k)
++ basic_machine=m68010-adobe
++ os=-scout
++ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+@@ -202,25 +381,35 @@
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
++ amd64)
++ basic_machine=x86_64-pc
++ ;;
++ amd64-*)
++ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
++ apollo68bsd)
++ basic_machine=m68k-apollo
++ os=-bsd
++ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+@@ -229,6 +418,10 @@
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
++ c90)
++ basic_machine=c90-cray
++ os=-unicos
++ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+@@ -249,27 +442,45 @@
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+- cray | ymp)
+- basic_machine=ymp-cray
+- os=-unicos
+- ;;
+- cray2)
+- basic_machine=cray2-cray
++ cray | j90)
++ basic_machine=j90-cray
+ os=-unicos
+ ;;
+- [ctj]90-cray)
+- basic_machine=c90-cray
+- os=-unicos
++ craynv)
++ basic_machine=craynv-cray
++ os=-unicosmp
++ ;;
++ cr16c)
++ basic_machine=cr16c-unknown
++ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
++ crisv32 | crisv32-* | etraxfs*)
++ basic_machine=crisv32-axis
++ ;;
++ cris | cris-* | etrax*)
++ basic_machine=cris-axis
++ ;;
++ crx)
++ basic_machine=crx-unknown
++ os=-elf
++ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
++ decsystem10* | dec10*)
++ basic_machine=pdp10-dec
++ os=-tops10
++ ;;
++ decsystem20* | dec20*)
++ basic_machine=pdp10-dec
++ os=-tops20
++ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+@@ -278,6 +489,10 @@
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
++ djgpp)
++ basic_machine=i586-pc
++ os=-msdosdjgpp
++ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+@@ -297,6 +512,10 @@
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
++ es1800 | OSE68k | ose68k | ose | OSE)
++ basic_machine=m68k-ericsson
++ os=-ose
++ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+@@ -307,6 +526,10 @@
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
++ go32)
++ basic_machine=i386-pc
++ os=-go32
++ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+@@ -315,6 +538,14 @@
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
++ h8300xray)
++ basic_machine=h8300-hitachi
++ os=-xray
++ ;;
++ h8500hms)
++ basic_machine=h8500-hitachi
++ os=-hms
++ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+@@ -330,13 +561,30 @@
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
++ hp3k9[0-9][0-9] | hp9[0-9][0-9])
++ basic_machine=hppa1.0-hp
++ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
++ hp9k6[0-9][0-9] | hp6[0-9][0-9])
++ basic_machine=hppa1.0-hp
++ ;;
++ hp9k7[0-79][0-9] | hp7[0-79][0-9])
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k78[0-9] | hp78[0-9])
++ # FIXME: really hppa2.0-hp
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
++ # FIXME: really hppa2.0-hp
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+@@ -345,27 +593,42 @@
+ hppa-next)
+ os=-nextstep3
+ ;;
++ hppaosf)
++ basic_machine=hppa1.1-hp
++ os=-osf
++ ;;
++ hppro)
++ basic_machine=hppa1.1-hp
++ os=-proelf
++ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+- os=-mvs
+ ;;
+ # I'm not sure what "Sysv32" means. Should this be sysv3.2?
+- i[3456]86v32)
++ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+- i[3456]86v4*)
++ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+- i[3456]86v)
++ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+- i[3456]86sol2)
++ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
++ i386mach)
++ basic_machine=i386-mach
++ os=-mach
++ ;;
++ i386-vsta | vsta)
++ basic_machine=i386-unknown
++ os=-vsta
++ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+@@ -391,16 +654,16 @@
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
++ mingw32)
++ basic_machine=i386-pc
++ os=-mingw32
++ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+- mipsel*-linux*)
+- basic_machine=mipsel-unknown
+- os=-linux-gnu
+- ;;
+- mips*-linux*)
+- basic_machine=mips-unknown
+- os=-linux-gnu
++ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+@@ -408,10 +671,34 @@
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
++ monitor)
++ basic_machine=m68k-rom68k
++ os=-coff
++ ;;
++ morphos)
++ basic_machine=powerpc-unknown
++ os=-morphos
++ ;;
++ msdos)
++ basic_machine=i386-pc
++ os=-msdos
++ ;;
++ mvs)
++ basic_machine=i370-ibm
++ os=-mvs
++ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
++ netbsd386)
++ basic_machine=i386-unknown
++ os=-netbsd
++ ;;
++ netwinder)
++ basic_machine=armv4l-rebel
++ os=-linux
++ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+@@ -424,6 +711,10 @@
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
++ necv70)
++ basic_machine=v70-nec
++ os=-sysv
++ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+@@ -449,9 +740,40 @@
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
++ mon960)
++ basic_machine=i960-intel
++ os=-mon960
++ ;;
++ nonstopux)
++ basic_machine=mips-compaq
++ os=-nonstopux
++ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
++ nsr-tandem)
++ basic_machine=nsr-tandem
++ ;;
++ op50n-* | op60c-*)
++ basic_machine=hppa1.1-oki
++ os=-proelf
++ ;;
++ or32 | or32-*)
++ basic_machine=or32-unknown
++ os=-coff
++ ;;
++ os400)
++ basic_machine=powerpc-ibm
++ os=-os400
++ ;;
++ OSE68000 | ose68000)
++ basic_machine=m68000-ericsson
++ os=-ose
++ ;;
++ os68k)
++ basic_machine=m68k-none
++ os=-os68k
++ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+@@ -466,53 +788,95 @@
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+- pc532 | pc532-*)
++ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+- pentium | p5)
+- basic_machine=i586-intel
++ pentium | p5 | k5 | k6 | nexgen | viac3)
++ basic_machine=i586-pc
++ ;;
++ pentiumpro | p6 | 6x86 | athlon | athlon_*)
++ basic_machine=i686-pc
+ ;;
+- pentiumpro | p6)
+- basic_machine=i686-intel
++ pentiumii | pentium2 | pentiumiii | pentium3)
++ basic_machine=i686-pc
+ ;;
+- pentium-* | p5-*)
++ pentium4)
++ basic_machine=i786-pc
++ ;;
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+- pentiumpro-* | p6-*)
++ pentiumpro-* | p6-* | 6x86-* | athlon-*)
++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+- k5)
+- # We don't have specific support for AMD's K5 yet, so just call it a Pentium
+- basic_machine=i586-amd
+- ;;
+- nexen)
+- # We don't have specific support for Nexgen yet, so just call it a Pentium
+- basic_machine=i586-nexgen
++ pentium4-*)
++ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+- power) basic_machine=rs6000-ibm
++ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+- ;;
++ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+- ;;
++ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
++ ppc64) basic_machine=powerpc64-unknown
++ ;;
++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
++ basic_machine=powerpc64le-unknown
++ ;;
++ ppc64le-* | powerpc64little-*)
++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
++ pw32)
++ basic_machine=i586-unknown
++ os=-pw32
++ ;;
++ rom68k)
++ basic_machine=m68k-rom68k
++ os=-coff
++ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
++ s390 | s390-*)
++ basic_machine=s390-ibm
++ ;;
++ s390x | s390x-*)
++ basic_machine=s390x-ibm
++ ;;
++ sa29200)
++ basic_machine=a29k-amd
++ os=-udi
++ ;;
++ sb1)
++ basic_machine=mipsisa64sb1-unknown
++ ;;
++ sb1el)
++ basic_machine=mipsisa64sb1el-unknown
++ ;;
++ sei)
++ basic_machine=mips-sei
++ os=-seiux
++ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+@@ -520,6 +884,13 @@
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
++ sparclite-wrs | simso-wrs)
++ basic_machine=sparclite-wrs
++ os=-vxworks
++ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+@@ -527,6 +898,13 @@
+ spur)
+ basic_machine=spur-unknown
+ ;;
++ st2000)
++ basic_machine=m68k-tandem
++ ;;
++ stratus)
++ basic_machine=i860-stratus
++ os=-sysv4
++ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+@@ -567,19 +945,51 @@
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
++ sv1)
++ basic_machine=sv1-cray
++ os=-unicos
++ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
++ t3e)
++ basic_machine=alphaev5-cray
++ os=-unicos
++ ;;
++ t90)
++ basic_machine=t90-cray
++ os=-unicos
++ ;;
++ tic54x | c54x*)
++ basic_machine=tic54x-unknown
++ os=-coff
++ ;;
++ tic55x | c55x*)
++ basic_machine=tic55x-unknown
++ os=-coff
++ ;;
++ tic6x | c6x*)
++ basic_machine=tic6x-unknown
++ os=-coff
++ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ os=-tops20
++ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
++ tpf)
++ basic_machine=s390x-ibm
++ os=-tpf
++ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+@@ -588,6 +998,10 @@
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
++ v810 | necv810)
++ basic_machine=v810-nec
++ os=-none
++ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+@@ -597,8 +1011,8 @@
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
+- ;;
++ basic_machine=f301-fujitsu
++ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+@@ -611,13 +1025,29 @@
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+- xmp)
+- basic_machine=xmp-cray
+- os=-unicos
++ w65*)
++ basic_machine=w65-wdc
++ os=-none
++ ;;
++ w89k-*)
++ basic_machine=hppa1.1-winbond
++ os=-proelf
++ ;;
++ xbox)
++ basic_machine=i686-pc
++ os=-mingw32
+ ;;
+- xps | xps100)
++ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
++ ymp)
++ basic_machine=ymp-cray
++ os=-unicos
++ ;;
++ z8k-*-coff)
++ basic_machine=z8k-unknown
++ os=-sim
++ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+@@ -625,32 +1055,47 @@
+
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+- mips)
+- if [ x$os = x-linux-gnu ]; then
+- basic_machine=mips-unknown
+- else
+- basic_machine=mips-mips
+- fi
++ w89k)
++ basic_machine=hppa1.1-winbond
++ ;;
++ op50n)
++ basic_machine=hppa1.1-oki
++ ;;
++ op60c)
++ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
++ mmix)
++ basic_machine=mmix-knuth
++ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
++ pdp10)
++ # there are many clones, so DEC is not a safe bet
++ basic_machine=pdp10-unknown
++ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+- sparc)
++ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
++ basic_machine=sh-unknown
++ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
++ sparc | sparcv8 | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+- cydra)
++ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+@@ -659,6 +1104,15 @@
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
++ mac | mpw | mac-mpw)
++ basic_machine=m68k-apple
++ ;;
++ pmac | pmac-mpw)
++ basic_machine=powerpc-apple
++ ;;
++ *-unknown)
++ # Make sure to match an already-canonicalized machine name.
++ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+@@ -711,14 +1165,46 @@
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
++ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
++ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
++ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+- | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv*)
++ | -chorusos* | -chorusrdb* \
++ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
++ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
++ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
++ -qnx*)
++ case $basic_machine in
++ x86-* | i*86-*)
++ ;;
++ *)
++ os=-nto$os
++ ;;
++ esac
++ ;;
++ -nto-qnx*)
++ ;;
++ -nto*)
++ os=`echo $os | sed -e 's|nto|nto-qnx|'`
++ ;;
++ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
++ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
++ ;;
++ -mac*)
++ os=`echo $os | sed -e 's|mac|macos|'`
++ ;;
++ -linux-dietlibc)
++ os=-linux-dietlibc
++ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+@@ -728,6 +1214,15 @@
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
++ -opened*)
++ os=-openedition
++ ;;
++ -os400*)
++ os=-os400
++ ;;
++ -wince*)
++ os=-wince
++ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+@@ -743,11 +1238,26 @@
+ -acis*)
+ os=-aos
+ ;;
++ -atheos*)
++ os=-atheos
++ ;;
++ -syllable*)
++ os=-syllable
++ ;;
++ -386bsd)
++ os=-bsd
++ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
++ -nova*)
++ os=-rtmk-nova
++ ;;
+ -ns2 )
+- os=-nextstep2
++ os=-nextstep2
++ ;;
++ -nsk*)
++ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+@@ -756,6 +1266,9 @@
+ -sinix*)
+ os=-sysv4
+ ;;
++ -tpf*)
++ os=-tpf
++ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+@@ -774,9 +1287,27 @@
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
++ -ose*)
++ os=-ose
++ ;;
++ -es1800*)
++ os=-ose
++ ;;
+ -xenix)
+ os=-xenix
+ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ os=-mint
++ ;;
++ -aros*)
++ os=-aros
++ ;;
++ -kaos*)
++ os=-kaos
++ ;;
++ -zvmoe)
++ os=-zvmoe
++ ;;
+ -none)
+ ;;
+ *)
+@@ -802,10 +1333,20 @@
+ *-acorn)
+ os=-riscix1.2
+ ;;
++ arm*-rebel)
++ os=-linux
++ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+- pdp11-*)
++ c4x-* | tic4x-*)
++ os=-coff
++ ;;
++ # This must come before the *-dec entry.
++ pdp10-*)
++ os=-tops20
++ ;;
++ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+@@ -823,15 +1364,42 @@
+ # default.
+ # os=-sunos4
+ ;;
++ m68*-cisco)
++ os=-aout
++ ;;
++ mips*-cisco)
++ os=-elf
++ ;;
++ mips*-*)
++ os=-elf
++ ;;
++ or32-*)
++ os=-coff
++ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
++ *-be)
++ os=-beos
++ ;;
+ *-ibm)
+ os=-aix
+ ;;
++ *-knuth)
++ os=-mmixware
++ ;;
++ *-wec)
++ os=-proelf
++ ;;
++ *-winbond)
++ os=-proelf
++ ;;
++ *-oki)
++ os=-proelf
++ ;;
+ *-hp)
+ os=-hpux
+ ;;
+@@ -874,27 +1442,39 @@
+ *-next)
+ os=-nextstep3
+ ;;
+- *-gould)
++ *-gould)
+ os=-sysv
+ ;;
+- *-highlevel)
++ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+- *-sgi)
++ *-sgi)
+ os=-irix
+ ;;
+- *-siemens)
++ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+- f301-fujitsu)
++ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
++ *-rom68k)
++ os=-coff
++ ;;
++ *-*bug)
++ os=-coff
++ ;;
++ *-apple)
++ os=-macos
++ ;;
++ *-atari*)
++ os=-mint
++ ;;
+ *)
+ os=-none
+ ;;
+@@ -916,9 +1496,15 @@
+ -aix*)
+ vendor=ibm
+ ;;
++ -beos*)
++ vendor=be
++ ;;
+ -hpux*)
+ vendor=hp
+ ;;
++ -mpeix*)
++ vendor=hp
++ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+@@ -934,21 +1520,47 @@
+ -genix*)
+ vendor=ns
+ ;;
+- -mvs*)
++ -mvs* | -opened*)
++ vendor=ibm
++ ;;
++ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+- -vxsim* | -vxworks*)
++ -tpf*)
++ vendor=ibm
++ ;;
++ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
++ -hms*)
++ vendor=hitachi
++ ;;
++ -mpw* | -macos*)
++ vendor=apple
++ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ vendor=atari
++ ;;
++ -vos*)
++ vendor=stratus
++ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+ esac
+
+ echo $basic_machine$os
++exit 0
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
diff --git a/package/jpeg/patches/jpeg-6b-fix-makefile.patch b/package/jpeg/patches/jpeg-6b-fix-makefile.patch
new file mode 100644
index 000000000..7e4c8d3ed
--- /dev/null
+++ b/package/jpeg/patches/jpeg-6b-fix-makefile.patch
@@ -0,0 +1,12 @@
+diff -ruN jpeg-6b-old/makefile.cfg jpeg-6b/makefile.cfg
+--- jpeg-6b-old/makefile.cfg 2006-11-02 12:36:36.000000000 +0100
++++ jpeg-6b/makefile.cfg 2006-11-02 12:37:09.000000000 +0100
+@@ -168,7 +168,7 @@
+
+ # with libtool:
+ libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
+- $(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
++ $(LIBTOOL) --mode=link "$(CC)" -o libjpeg.la $(LIBOBJECTS) \
+ -rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
+
+ # sample programs:
diff --git a/package/kbproto/Config.in b/package/kbproto/Config.in
new file mode 100644
index 000000000..ead095b54
--- /dev/null
+++ b/package/kbproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_KBPROTO
+ prompt "kbproto................................ X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/kbproto/Makefile b/package/kbproto/Makefile
new file mode 100644
index 000000000..7341f1ff7
--- /dev/null
+++ b/package/kbproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= kbproto
+PKG_VERSION:= 1.0.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1efc6a4d97acb3ec3f34c4b2508478dc
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/kismet/Config.in b/package/kismet/Config.in
new file mode 100644
index 000000000..84b256509
--- /dev/null
+++ b/package/kismet/Config.in
@@ -0,0 +1,67 @@
+config ADK_COMPILE_KISMET
+ tristate
+ default n
+ depends ADK_PACKAGE_KISMET_CLIENT || ADK_PACKAGE_KISMET_DRONE || ADK_PACKAGE_KISMET_SERVER
+
+config ADK_PACKAGE_KISMET_CLIENT
+ prompt "kismet-client..................... The Kismet client"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_COMPILE_KISMET
+ select ADK_PACKAGE_LIBNCURSES
+ help
+
+ An 802.11 layer2 wireless network detector, sniffer, and intrusion detection system.
+
+ http://www.kismetwireless.net/
+
+ This package contains the kismet text interface client.
+
+config ADK_PACKAGE_KISMET_DRONE
+ prompt "kismet-drone...................... The Kismet drone"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_COMPILE_KISMET
+ select ADK_PACKAGE_LIBPCAP
+ help
+
+ An 802.11 layer2 wireless network detector, sniffer, and intrusion detection system.
+
+ http://www.kismetwireless.net/
+
+ This package contains the kismet remote sniffing.and monitoring drone.
+
+config ADK_PACKAGE_KISMET_SERVER
+ prompt "kismet-server..................... The Kismet server"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_COMPILE_KISMET
+ select ADK_PACKAGE_LIBPCAP
+ help
+
+ An 802.11 layer2 wireless network detector, sniffer, and intrusion detection system.
+
+ http://www.kismetwireless.net/
+
+ This package contains the kismet server.
+
+choice
+prompt "C++ library to use"
+depends on ADK_PACKAGE_KISMET_CLIENT || ADK_PACKAGE_KISMET_DRONE || ADK_PACKAGE_KISMET_SERVER
+default ADK_COMPILE_KISMET_WITH_STDCXX if ADK_TARGET_LIB_GLIBC
+default ADK_COMPILE_KISMET_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC
+
+config ADK_COMPILE_KISMET_WITH_STDCXX
+ bool "Standard C++ library"
+ select ADK_PACKAGE_LIBSTDCXX
+ help
+
+config ADK_COMPILE_KISMET_WITH_UCLIBCXX
+ bool "Embedded uClibc++ library"
+ select ADK_PACKAGE_UCLIBCXX
+ help
+
+endchoice
diff --git a/package/kismet/Makefile b/package/kismet/Makefile
new file mode 100644
index 000000000..76d0b824f
--- /dev/null
+++ b/package/kismet/Makefile
@@ -0,0 +1,57 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= kismet
+PKG_VERSION:= 2008-05-R1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6ee365d36354b4dee4945e67f8149294
+MASTER_SITES:= http://www.kismetwireless.net/code/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,KISMET,kismet,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,KISMET_CLIENT,kismet-client,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,KISMET_DRONE,kismet-drone,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,KISMET_SERVER,kismet-server,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifeq ($(ADK_COMPILE_KISMET_WITH_UCLIBCXX),y)
+TCFLAGS+= -fno-builtin -fno-rtti -nostdinc++ -I${STAGING_DIR}/usr/include/uClibc++
+TLDFLAGS+= -luClibc++ -lc -lm -lgcc_s -nodefaultlibs
+CONFIGURE_ENV+= CXXFLAGS="-fno-builtin -fno-rtti -nostdinc++ \
+ -I${STAGING_DIR}/usr/include/uClibc++"
+else
+TLDFLAGS+= -shared
+endif
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --sysconfdir=/etc/kismet \
+ --enable-syspcap=yes \
+ --disable-setuid \
+ --disable-gpsmap
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_KISMET}/usr/bin/
+ ${INSTALL_BIN} ${WRKBUILD}/kismet ${IDIR_KISMET}/usr/bin/kismet
+ ${INSTALL_DIR} ${IDIR_KISMET_CLIENT}/usr/bin
+ ${INSTALL_DIR} ${IDIR_KISMET_CLIENT}/etc/kismet/
+ ${INSTALL_DATA} ./files/ap_manuf ${IDIR_KISMET_CLIENT}/etc/kismet/
+ ${INSTALL_DATA} ./files/client_manuf ${IDIR_KISMET_CLIENT}/etc/kismet/
+ ${INSTALL_DATA} ./files/kismet.conf ${IDIR_KISMET_CLIENT}/etc/kismet/
+ ${INSTALL_DATA} ./files/kismet_ui.conf ${IDIR_KISMET_CLIENT}/etc/kismet/
+ ${CP} ${WRKBUILD}/kismet_client ${IDIR_KISMET_CLIENT}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_KISMET_DRONE}/usr/bin
+ ${INSTALL_DIR} ${IDIR_KISMET_DRONE}/etc/kismet/
+ ${INSTALL_DATA} ./files/kismet_drone.conf ${IDIR_KISMET_DRONE}/etc/kismet/
+ ${CP} ${WRKBUILD}/kismet_drone ${IDIR_KISMET_DRONE}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_KISMET_SERVER}/usr/bin
+ ${INSTALL_DIR} ${IDIR_KISMET_SERVER}/etc/kismet/
+ ${INSTALL_DATA} ./files/ap_manuf ${IDIR_KISMET_SERVER}/etc/kismet/
+ ${INSTALL_DATA} ./files/client_manuf ${IDIR_KISMET_SERVER}/etc/kismet/
+ ${INSTALL_DATA} ./files/kismet.conf ${IDIR_KISMET_SERVER}/etc/kismet/
+ ${CP} ${WRKBUILD}/kismet_server ${IDIR_KISMET_SERVER}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/kismet/files/ap_manuf b/package/kismet/files/ap_manuf
new file mode 100644
index 000000000..7561b6d5b
--- /dev/null
+++ b/package/kismet/files/ap_manuf
@@ -0,0 +1,79 @@
+00:01:03:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:01:24:00:00:00/FF:FF:FF:00:00:00 SMC Unknown default 6 192.168.2.1
+00:01:24:24:00:00/FF:FF:FF:FF:00:00 SMC SMC7004AWBR default 6 192.168.2.1
+00:02:2D:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0
+00:02:6F:00:00:00/FF:FF:FF:00:00:00 Senao Unknown 0
+00:02:A5:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0
+00:03:2F:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0
+00:04:3A:3A:00:00/FF:FF:FF:FF:00:00 Avaya ad-01444 0
+00:04:5A:0E:00:00/FF:FF:FF:FF:00:00 Linksys WAP11 linksys 6 192.168.1.1
+00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 6 192.168.1.1
+00:04:5A:2E:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 6 192.168.1.1
+00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1
+00:04:75:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE20096A AP2000 Version 1 3Com 0 169.254.0.1
+00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown 0
+00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC 7004AWBR default 6 192.168.2.1
+00:05:5D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-1000AP default 6
+00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 v2 linksys 6 192.168.1.1
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WET11 linksys 6 192.168.1.225
+00:07:0E:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:07:50:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:08:21:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:09:43:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0
+00:09:7C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:09:92:92:00:00/FF:FF:FF:FF:00:00 Sweex LC000010 wireless 11 192.168.0.1
+00:09:E8:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:0A:41:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:0A:8A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:0A:8A:8A:00:00/FF:FF:FF:FF:00:00 Cisco AIR-AP1200 0
+00:30:65:00:00:00/FF:FF:FF:00:00:00 Apple Unknown 0
+00:30:65:65:00:00/FF:FF:FF:FF:00:00 Apple Snow Base Station 1
+00:30:AB:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MR314NA Wireless 1 192.168.0.1
+00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0
+00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6230-3 0
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DI-614+ default 6 192.168.0.1
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-900AP+ default 6 192.168.0.50
+00:40:26:00:00:00/FF:FF:FF:00:00:00 Buffalo Unknown 0
+00:40:26:26:00:00/FF:FF:FF:FF:00:00 Buffalo WLAR-L11G-L 0
+00:40:96:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown tsunami 6
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-AP342E2R tsunami 6 192.168.1.1
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AP-350 tsunami 7
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco Aironet 350 tsunami 6
+00:50:08:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0
+00:50:8B:8B:00:00/FF:FF:FF:FF:00:00 Compaq WL400 - ETSI region compaq 11
+00:50:DA:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:50:DA:DA:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE747A 0
+00:50:F2:F2:00:00/FF:FF:FF:FF:00:00 Microsoft MN-500 MSHOME 6 192.168.0.1
+00:60:01:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0
+00:60:1D:00:00:00/FF:FF:FF:00:00:00 Orinoco Unknown 0
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Orinoco RG1000 0
+00:60:6D:00:00:00/FF:FF:FF:00:00:00 Cabletron Unknown 0
+00:60:B3:00:00:00/FF:FF:FF:00:00:00 Proxim Unknown 0
+00:80:37:37:00:00/FF:FF:FF:FF:00:00 Ericsson A11 (AP-4121-105M-ER-EU) 0
+00:80:C6:00:00:00/FF:FF:FF:00:00:00 SOHOware Unknown
+00:80:C6:C6:00:00/FF:FF:FF:FF:00:00 SOHOware NetBlaster II
+00:90:4B:4B:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 6 192.168.1.1
+00:90:D1:00:00:00/FF:FF:FF:00:00:00 SMC Unknown WLAN 11
+00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC SMC2652W WLAN 11
+00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC SMC2682W BRIDGE 11
+00:A0:04:00:00:00/FF:FF:FF:00:00:00 3Com Unknown
+00:A0:04:04:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE51196
+00:A0:F8:00:00:00/FF:FF:FF:00:00:00 Symbol Unknown
+00:E0:29:00:00:00/FF:FF:FF:00:00:00 OEM Unknown
+08:00:46:00:00:00/FF:FF:FF:00:00:00 Sony Unknown
+00:50:F2:00:00:00/FF:FF:FF:00:00:00 Microsoft Unknown MSHOME 6 192.168.2.1
+00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknwon NETGEAR 11 192.168.0.1
+00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown WLAN 11 0.0.0.0
+00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown Wireless 11 192.168.0.2
+00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown belkin54g 11 0.0.0.0
+00:0D:88:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1
+00:80:C8:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6 192.168.0.1
+00:40:05:00:00:00/FF:FF:FF:00:00:00 ANI Unknown default 6 192.168.0.1
+00:0C:41:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1
+00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown SMC 6 192.168.2.1
+00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys-g 6 192.168.1.1
diff --git a/package/kismet/files/client_manuf b/package/kismet/files/client_manuf
new file mode 100644
index 000000000..b1c5ef425
--- /dev/null
+++ b/package/kismet/files/client_manuf
@@ -0,0 +1,249 @@
+00:00:22:22:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver 0
+00:00:8F:8F:00:00/FF:FF:FF:FF:00:00 BreezeCOM Breezenet Pro SA-PC 0
+00:01:03:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:01:03:03:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE62092A
+00:01:03:03:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE777A 0
+00:01:24:00:00:00/FF:FF:FF:00:00:00 SMC Unknown default 6 192.168.2.1
+00:01:F4:F4:00:00/FF:FF:FF:FF:00:00 Entrasys CSIBD-AB-S Roamabout 0
+00:02:2D:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Agere Orinoco Gold
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Agere PC24E-H-FC 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Avaya PC24E-H-ET
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Avaya PC24E-H-FC 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Avaya World Card Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Buffalo WLI-PCM-L11
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Buffalo WLI-PCM-L11
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Buffalo WLI-PCM-L11GP 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell TrueMobile 1150
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell TrueMobile 1150 Mini-PCI 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell Truemobile 1150 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Dell true mobile 1150 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Gold
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-H-FC 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-H-FC 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-H-FC 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Silver 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Silver (PC24E-H-FC) 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN-Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN/IEEE Version 01.01 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco MiniPCI Card (embedded in Sony Laptop) 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Orinoco Gold wireless 3
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Orinoco Gold
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Orinoco Mini PCI Card 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco PC Card T2 Extended ORiNOCO Europe 128RC4 Kit Gold 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco PC24E-H-ET
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco PC24E-H-FC 0
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver
+00:02:2D:2D:00:00/FF:FF:FF:FF:00:00 Orinoco Silver
+00:02:6F:00:00:00/FF:FF:FF:00:00:00 Senao Unknown 0
+00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2011 CD
+00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2011CD 0
+00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2011CD
+00:02:6F:6F:00:00/FF:FF:FF:FF:00:00 Senao SL-2511CD PLUS EXT2(F200) 0
+00:02:A5:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0
+00:02:A5:A5:00:00/FF:FF:FF:FF:00:00 Compaq WL110
+00:02:A5:A5:00:00/FF:FF:FF:FF:00:00 Compaq WL110 REV.0A 0
+00:02:B3:B3:00:00/FF:FF:FF:FF:00:00 Intel WPC-2011BWW 0
+00:03:2F:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0
+00:03:2F:2F:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 0
+00:03:2F:2F:00:00/FF:FF:FF:FF:00:00 Linksys WPC11
+00:03:2F:2F:00:00/FF:FF:FF:FF:00:00 Repotec GL241101
+00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0
+00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown Linksys 6 192.168.1.1
+00:04:5A:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1
+00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 linksys 0
+00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WPC11
+00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WPC11
+00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WPC11
+00:04:5A:5A:00:00/FF:FF:FF:FF:00:00 Linksys WUSB11
+00:04:75:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRSHPW696 0
+00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE62092B 0
+00:04:75:75:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE62092B
+00:04:DB:DB:00:00/FF:FF:FF:FF:00:00 Tellus TWL-C11 0
+00:04:E2:00:00:00/FF:FF:FF:00:00:00 SMC Unknown 0
+00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W 0
+00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W
+00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W
+00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W
+00:04:E2:E2:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W
+00:05:3C:3C:00:00/FF:FF:FF:FF:00:00 Intel Intel MiniPCI High Rate Wireless (ISL3874A) 0
+00:05:5D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown 0
+00:05:5D:00:00:00/FF:FF:FF:00:00:00 D-Link Unknown default 6
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 Compaq HNW-100 0
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DCF-650W
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650H
+00:05:5D:5D:00:00/FF:FF:FF:FF:00:00 D-Link DWL-660 H/W:A1 F/W:4.04 0
+00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown 0
+00:06:25:00:00:00/FF:FF:FF:00:00:00 Linksys Unknown linksys 6 192.168.1.1
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 D-Link DCF-650W
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Dell True Mobile 1150 6
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys BEFW11S4 v2 linksys 6 192.168.1.1
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF11 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF11
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF12 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF12
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WCF12
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WMP11 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WMP11 v2.5 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 V.3 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v2.5
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v2.5
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 v3.0 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WPC11 ver.3 (FCC-ID: PKW-WPC11-V31[suggests V3.1]) 0
+00:06:25:25:00:00/FF:FF:FF:FF:00:00 Linksys WUSB11 v2.6 0
+00:07:0E:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:07:0E:0E:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352
+00:07:0E:0E:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:07:50:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:07:50:50:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352
+00:07:50:50:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM350 0
+00:08:21:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352
+00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352
+00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:08:21:21:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:09:43:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:09:43:43:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352
+00:09:5B:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0
+00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA401 0
+00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA401RA 0
+00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA401RA
+00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA701 0
+00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear MA701
+00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear ma101 0
+00:09:5B:5B:00:00/FF:FF:FF:FF:00:00 Netgear wab501 0
+00:09:7C:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:09:7C:7C:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352
+00:09:7C:7C:00:00/FF:FF:FF:FF:00:00 Cisco Cisco Aironet 352 802.11b pcmcia card 0
+00:09:92:92:00:00/FF:FF:FF:FF:00:00 Sweex LC500010 ATMEL PCMCIA FastVNET (502A-D) 0
+00:09:B7:B7:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 0
+00:09:B7:B7:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 0
+00:09:E8:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:09:E8:E8:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352
+00:0A:41:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-LMC352 0
+00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 0
+00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352 0
+00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:0A:41:41:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:0A:8A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:0A:8A:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:0A:8A:8A:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:0B:5F:5F:00:00/FF:FF:FF:FF:00:00 Cisco AIR-CB20A-A-K9 0
+00:20:A6:A6:00:00/FF:FF:FF:FF:00:00 Proxim Symphony (PC Card 4430) 0
+00:20:D6:D6:00:00/FF:FF:FF:FF:00:00 BreezeCOM Breezenet Pro.11 SA-PCR 0
+00:30:65:00:00:00/FF:FF:FF:00:00:00 Apple Unknown 0
+00:30:65:00:00:00/FF:FF:FF:00:00:00 Apple Unknown 0
+00:30:65:65:00:00/FF:FF:FF:FF:00:00 Apple Airport Card 2002
+00:30:AB:00:00:00/FF:FF:FF:00:00:00 Netgear Unknown 0
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401 0
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MA401
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear MR314 Wireless 1 192.168.0.1
+00:30:AB:AB:00:00/FF:FF:FF:FF:00:00 Netgear Netgear ma401 0
+00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0
+00:30:BD:00:00:00/FF:FF:FF:00:00:00 Belkin Unknown 0
+00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 0
+00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 0
+00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020
+00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020
+00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020 (Version 01.02) 0
+00:30:BD:BD:00:00/FF:FF:FF:FF:00:00 Belkin F5D6020u 0
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DI-614+ default 6 192.168.0.1
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DI-614+ 22Mbps router/AP/switch default 6 192.168.0.1
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-520+ 0
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 0
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650 internet 8
+00:40:05:05:00:00/FF:FF:FF:FF:00:00 D-Link DWL-650+ wireless 6 192.168.0.1
+00:40:26:00:00:00/FF:FF:FF:00:00:00 Buffalo Unknown 0
+00:40:96:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown 0
+00:40:96:00:00:00/FF:FF:FF:00:00:00 Cisco Unknown tsunami 6
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco 350
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PC4800
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 0
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 0
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM340 (Dell Rebrand) 0
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco AIR-PCM352
+00:40:96:96:00:00/FF:FF:FF:FF:00:00 Cisco PC 4800 DS PCI Adapter 0
+00:50:08:00:00:00/FF:FF:FF:00:00:00 Compaq Unknown 0
+00:50:08:08:00:00/FF:FF:FF:FF:00:00 Compaq WL100 0
+00:50:08:08:00:00/FF:FF:FF:FF:00:00 Compaq WL100
+00:50:8B:8B:00:00/FF:FF:FF:FF:00:00 Compaq Compaq WL100 compaq 0
+00:50:8B:8B:00:00/FF:FF:FF:FF:00:00 Compaq WL200 - ETSI region 0
+00:50:DA:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:50:DA:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:50:DA:DA:00:00/FF:FF:FF:FF:00:00 3Com 3CRWE73796B
+00:50:F2:F2:00:00/FF:FF:FF:FF:00:00 Microsoft MN-510 0
+00:50:F2:F2:00:00/FF:FF:FF:FF:00:00 Microsoft Wireless Notebook Adapter MN-520 0
+00:60:01:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0
+00:60:01:01:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Silver
+00:60:1D:00:00:00/FF:FF:FF:00:00:00 Lucent Unknown 0
+00:60:1D:00:00:00/FF:FF:FF:00:00:00 Orinoco Unknown 0
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Lucent WaveLAN Turbo - Bronze, P/N: 011498/A 0
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Orinoco Gold
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent PC24E-00-FC 0
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Silver
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Bronze
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent WaveLAN Gold
+00:60:1D:1D:00:00/FF:FF:FF:FF:00:00 Lucent Wavelan Turbo Bronze 0
+00:60:6D:00:00:00/FF:FF:FF:00:00:00 Cabletron Unknown 0
+00:60:6D:6D:00:00/FF:FF:FF:FF:00:00 Cabletron CSIBB-AA
+00:60:6D:6D:00:00/FF:FF:FF:FF:00:00 Cabletron CSIBB-AA
+00:60:6D:6D:00:00/FF:FF:FF:FF:00:00 Cabletron RoamAbout 802.11DS 0
+00:60:B3:00:00:00/FF:FF:FF:00:00:00 Proxim Unknown 0
+00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 3Com XI-815 0
+00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 3Com Zcom WL2000D 0
+00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 Proxim RangeLAN DS 0
+00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 Proxim RangeLan DS 8430
+00:60:B3:B3:00:00/FF:FF:FF:FF:00:00 SMC SMC2642W
+00:80:37:37:00:00/FF:FF:FF:FF:00:00 Ericsson C11 (LA-4121-102M-ER-EU) 0
+00:80:C6:00:00:00/FF:FF:FF:00:00:00 SOHOware Unknown 0
+00:90:4B:4B:00:00/FF:FF:FF:FF:00:00 Dell 1180 True Mobile PCI 0
+00:90:96:96:00:00/FF:FF:FF:FF:00:00 Yakumo WLAN PCMCIA Card 11 Mbps 0
+00:90:D1:00:00:00/FF:FF:FF:00:00:00 LeArtery Unknown 0
+00:90:D1:00:00:00/FF:FF:FF:00:00:00 SMC Unknown WLAN 11
+00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 LeArtery SyncByAir LN101
+00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC 2662W 0
+00:90:D1:D1:00:00/FF:FF:FF:FF:00:00 SMC SMC2632W 0
+00:A0:04:00:00:00/FF:FF:FF:00:00:00 3Com Unknown 0
+00:A0:65:65:00:00/FF:FF:FF:FF:00:00 Nexland Zcom XI-300 0
+00:A0:F8:00:00:00/FF:FF:FF:00:00:00 Symbol Unknown 0
+00:A0:F8:F8:00:00/FF:FF:FF:FF:00:00 Symbol Spectrum 24 High Rate 11MBps wireless LAN adapter 0
+00:A0:F8:F8:00:00/FF:FF:FF:FF:00:00 Symbol Spectrum24
+00:C0:49:49:00:00/FF:FF:FF:FF:00:00 US Robotics USR1120 0
+00:E0:29:00:00:00/FF:FF:FF:00:00:00 OEM Unknown 0
+00:E0:29:29:00:00/FF:FF:FF:FF:00:00 OEM OEM
+00:E0:29:29:00:00/FF:FF:FF:FF:00:00 SMC 2632W 0
+00:E0:29:29:00:00/FF:FF:FF:FF:00:00 SMC EZ-Connect Wireless 0
+08:00:46:00:00:00/FF:FF:FF:00:00:00 Sony Unknown 0
+08:00:46:46:00:00/FF:FF:FF:FF:00:00 Sony PCWA-C100
diff --git a/package/kismet/files/kismet.conf b/package/kismet/files/kismet.conf
new file mode 100644
index 000000000..a417d2885
--- /dev/null
+++ b/package/kismet/files/kismet.conf
@@ -0,0 +1,281 @@
+# Kismet config file
+# Most of the "static" configs have been moved to here -- the command line
+# config was getting way too crowded and cryptic. We want functionality,
+# not continually reading --help!
+
+# Version of Kismet config
+version=2005.01.R1
+
+# Name of server (Purely for organiational purposes)
+servername=Kismet
+
+# User to setid to (should be your normal user)
+suiduser=nobody
+
+# Sources are defined as:
+# source=cardtype,interface,name[,initialchannel]
+# Card types and required drivers are listed in the README.
+# The initial channel is optional, if hopping is not enabled it can be used
+# to set the channel the interface listens on.
+# YOU MUST CHANGE THIS TO BE THE SOURCE YOU WANT TO USE
+source=wrt54g,eth1,wireless
+# For v1 hardware uncomment this:
+# source=wrt54g,eth2,wireless
+
+# Comma-separated list of sources to enable. This is only needed if you defined
+# multiple sources and only want to enable some of them. By default, all defined
+# sources are enabled.
+# For example:
+# enablesources=prismsource,ciscosource
+
+# Do we channelhop?
+channelhop=true
+
+# How many channels per second do we hop? (1-10)
+channelvelocity=5
+
+# By setting the dwell time for channel hopping we override the channelvelocity
+# setting above and dwell on each channel for the given number of seconds.
+#channeldwell=10
+
+# Do we split channels between cards on the same spectrum? This means if
+# multiple 802.11b capture sources are defined, they will be offset to cover
+# the most possible spectrum at a given time. This also controls splitting
+# fine-tuned sourcechannels lines which cover multiple interfaces (see below)
+channelsplit=true
+
+# Basic channel hopping control:
+# These define the channels the cards hop through for various frequency ranges
+# supported by Kismet. More finegrain control is available via the
+# "sourcechannels" configuration option.
+#
+# Don't change the IEEE80211<x> identifiers or channel hopping won't work.
+
+# Users outside the US might want to use this list:
+# defaultchannels=IEEE80211b:1,7,13,2,8,3,14,9,4,10,5,11,6,12
+defaultchannels=IEEE80211b:1,6,11,2,7,3,8,4,9,5,10
+
+# 802.11g uses the same channels as 802.11b...
+defaultchannels=IEEE80211g:1,6,11,2,7,3,8,4,9,5,10
+
+# 802.11a channels are non-overlapping so sequential is fine. You may want to
+# adjust the list depending on the channels your card actually supports.
+# defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,184,188,192,196,200,204,208,212,216
+defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64
+
+# Combo cards like Atheros use both 'a' and 'b/g' channels. Of course, you
+# can also explicitly override a given source. You can use the script
+# extras/listchan.pl to extract all the channels your card supports.
+defaultchannels=IEEE80211ab:1,6,11,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64
+
+# Fine-tuning channel hopping control:
+# The sourcechannels option can be used to set the channel hopping for
+# specific interfaces, and to control what interfaces share a list of
+# channels for split hopping. This can also be used to easily lock
+# one card on a single channel while hopping with other cards.
+# Any card without a sourcechannel definition will use the standard hopping
+# list.
+# sourcechannels=sourcename[,sourcename]:ch1,ch2,ch3,...chN
+
+# ie, for us channels on the source 'prism2source' (same as normal channel
+# hopping behavior):
+# sourcechannels=prism2source:1,6,11,2,7,3,8,4,9,5,10
+
+# Given two capture sources, "prism2a" and "prism2b", we want prism2a to stay
+# on channel 6 and prism2b to hop normally. By not setting a sourcechannels
+# line for prism2b, it will use the standard hopping.
+# sourcechannels=prism2a:6
+
+# To assign the same custom hop channel to multiple sources, or to split the
+# same custom hop channel over two sources (if splitchannels is true), list
+# them all on the same sourcechannels line:
+# sourcechannels=prism2a,prism2b,prism2c:1,6,11
+
+# Port to serve GUI data
+tcpport=2501
+# People allowed to connect, comma seperated IP addresses or network/mask
+# blocks. Netmasks can be expressed as dotted quad (/255.255.255.0) or as
+# numbers (/24)
+allowedhosts=127.0.0.1
+# Maximum number of concurrent GUI's
+maxclients=5
+
+# Do we have a GPS?
+gps=false
+# Host:port that GPSD is running on. This can be localhost OR remote!
+gpshost=localhost:2947
+# Do we lock the mode? This overrides coordinates of lock "0", which will
+# generate some bad information until you get a GPS lock, but it will
+# fix problems with GPS units with broken NMEA that report lock 0
+gpsmodelock=false
+
+# Packet filtering options:
+# filter_tracker - Packets filtered from the tracker are not processed or
+# recorded in any way.
+# filter_dump - Packets filtered at the dump level are tracked, displayed,
+# and written to the csv/xml/network/etc files, but not
+# recorded in the packet dump
+# filter_export - Controls what packets influence the exported CSV, network,
+# xml, gps, etc files.
+# All filtering options take arguments containing the type of address and
+# addresses to be filtered. Valid address types are 'ANY', 'BSSID',
+# 'SOURCE', and 'DEST'. Filtering can be inverted by the use of '!' before
+# the address. For example,
+# filter_tracker=ANY(!00:00:DE:AD:BE:EF)
+# has the same effect as the previous mac_filter config file option.
+# filter_tracker=...
+# filter_dump=...
+# filter_export=...
+
+# Alerts to be reported and the throttling rates.
+# alert=name,throttle/unit,burst
+# The throttle/unit describes the number of alerts of this type that are
+# sent per time unit. Valid time units are second, minute, hour, and day.
+# Burst describes the number of alerts sent before throttling takes place.
+# For example:
+# alert=FOO,10/min,5
+# Would allow 5 alerts through before throttling is enabled, and will then
+# limit the number of alerts to 10 per minute.
+# A throttle rate of 0 disables throttling of the alert.
+# See the README for a list of alert types.
+alert=NETSTUMBLER,5/min,2
+alert=WELLENREITER,5/min,2
+alert=LUCENTTEST,5/min,2
+alert=DEAUTHFLOOD,5/min,4
+alert=BCASTDISCON,5/min,4
+alert=CHANCHANGE,5/min,4
+alert=AIRJACKSSID,5/min,2
+alert=PROBENOJOIN,5/min,2
+alert=DISASSOCTRAFFIC,5/min,2
+alert=NULLPROBERESP,5/min,5
+alert=BSSTIMESTAMP,5/min,5
+
+# Known WEP keys to decrypt, bssid,hexkey. This is only for networks where
+# the keys are already known, and it may impact throughput on slower hardware.
+# Multiple wepkey lines may be used for multiple BSSIDs.
+# wepkey=00:DE:AD:C0:DE:00,FEEDFACEDEADBEEF01020304050607080900
+
+# Is transmission of the keys to the client allowed? This may be a security
+# risk for some. If you disable this, you will not be able to query keys from
+# a client.
+allowkeytransmit=true
+
+# How often (in seconds) do we write all our data files (0 to disable)
+writeinterval=300
+
+# Where do we get our manufacturer fingerprints from? Assumed to be in the
+# default config directory if an absolute path is not given.
+ap_manuf=ap_manuf
+client_manuf=client_manuf
+
+# Use metric measurements in the output?
+metric=false
+
+# Do we write waypoints for gpsdrive to load? Note: This is NOT related to
+# recent versions of GPSDrive's native support of Kismet.
+waypoints=false
+# GPSMap waypoint file. This WILL be truncated.
+waypointdata=%h/.gpsdrive/way_kismet.txt
+
+# How many alerts do we backlog for new clients? Only change this if you have
+# a -very- low memory system and need those extra bytes, or if you have a high
+# memory system and a huge number of alert conditions.
+alertbacklog=50
+
+# File types to log, comma seperated
+# dump - raw packet dump
+# network - plaintext detected networks
+# csv - plaintext detected networks in CSV format
+# xml - XML formatted network and cisco log
+# weak - weak packets (in airsnort format)
+# cisco - cisco equipment CDP broadcasts
+# gps - gps coordinates
+logtypes=dump,network,csv,xml,weak,cisco,gps
+
+# Do we track probe responses and merge probe networks into their owners?
+# This isn't always desireable, depending on the type of monitoring you're
+# trying to do.
+trackprobenets=true
+
+# Do we log "noise" packets that we can't decipher? I tend to not, since
+# they don't have anything interesting at all in them.
+noiselog=false
+
+# Do we log corrupt packets? Corrupt packets have enough header information
+# to see what they are, but someting is wrong with them that prevents us from
+# completely dissecting them. Logging these is usually not a bad idea.
+corruptlog=true
+
+# Do we log beacon packets or do we filter them out of the dumpfile
+beaconlog=true
+
+# Do we log PHY layer packets or do we filter them out of the dumpfile
+phylog=true
+
+# Do we mangle packets if we can decrypt them or if they're fuzzy-detected
+mangledatalog=true
+
+# Do we do "fuzzy" crypt detection? (byte-based detection instead of 802.11
+# frame headers)
+# valid option: Comma seperated list of card types to perform fuzzy detection
+# on, or 'all'
+fuzzycrypt=wtapfile,wlanng,wlanng_legacy,wlanng_avs,hostap,wlanng_wext
+
+# What type of dump do we generate?
+# valid option: "wiretap"
+dumptype=wiretap
+# Do we limit the size of dump logs? Sometimes ethereal can't handle big ones.
+# 0 = No limit
+# Anything else = Max number of packets to log to a single file before closing
+# and opening a new one.
+dumplimit=0
+
+# Do we write data packets to a FIFO for an external data-IDS (such as Snort)?
+# See the docs before enabling this.
+#fifo=/tmp/kismet_dump
+
+# Default log title
+logdefault=Kismet
+
+# logtemplate - Filename logging template.
+# This is, at first glance, really nasty and ugly, but you'll hardly ever
+# have to touch it so don't complain too much.
+#
+# %n is replaced by the logging instance name
+# %d is replaced by the current date as Mon-DD-YYYY
+# %D is replaced by the current date as YYYYMMDD
+# %t is replaced by the starting log time
+# %i is replaced by the increment log in the case of multiple logs
+# %l is replaced by the log type (dump, status, crypt, etc)
+# %h is replaced by the home directory
+# ie, "netlogs/%n-%d-%i.dump" called with a logging name of "Pok" could expand
+# to something like "netlogs/Pok-Dec-20-01-1.dump" for the first instance and
+# "netlogs/Pok-Dec-20-01-2.%l" for the second logfile generated.
+# %h/netlots/%n-%d-%i.dump could expand to
+# /home/foo/netlogs/Pok-Dec-20-01-2.dump
+#
+# Other possibilities: Sorting by directory
+# logtemplate=%l/%n-%d-%i
+# Would expand to, for example,
+# dump/Pok-Dec-20-01-1
+# crypt/Pok-Dec-20-01-1
+# and so on. The "dump", "crypt", etc, dirs must exist before kismet is run
+# in this case.
+logtemplate=%n-%d-%i.%l
+
+# Where do we store the pid file of the server?
+piddir=/var/run/
+
+# Where state info, etc, is stored. You shouldnt ever need to change this.
+# This is a directory.
+configdir=%h/.kismet/
+
+# cloaked SSID file. You shouldn't ever need to change this.
+ssidmap=ssid_map
+
+# Group map file. You shouldn't ever need to change this.
+groupmap=group_map
+
+# IP range map file. You shouldn't ever need to change this.
+ipmap=ip_map
+
diff --git a/package/kismet/files/kismet_drone.conf b/package/kismet/files/kismet_drone.conf
new file mode 100644
index 000000000..901b5b83e
--- /dev/null
+++ b/package/kismet/files/kismet_drone.conf
@@ -0,0 +1,121 @@
+# Kismet drone config file
+
+version=2005.04.R1
+
+# Name of server (Purely for organiational purposes)
+servername=Kismet
+
+# User to setid to (should be your normal user)
+suiduser=nobody
+
+# Port to serve packet data... This probably shouldn't be the same as the port
+# you configured kismet_server for, or else you'll have problems running them
+# on the same system.
+tcpport=3501
+# People allowed to connect, comma seperated IP addresses or network/mask
+# blocks. Netmasks can be expressed as dotted quad (/255.255.255.0) or as
+# numbers (/24)
+allowedhosts=127.0.0.1
+# Maximum number of concurrent stream attachments
+maxclients=5
+
+# Packet sources:
+# source=capture_cardtype,capture_interface,capture_name
+# Card type - Specifies the type of device. It can be one of:
+# cisco - Cisco card with Linux Kernel drivers
+# cisco_cvs - Cisco card with CVS Linux drivers
+# cisco_bsd - Cisco on *BSD
+# prism2 - Prism2 using wlan-ng drivers with pcap support (all
+# current versions support pcap)
+# prism2_hostap - Prism2 using hostap drivers
+# prism2_legacy - Prism2 using wlan-ng drivers without pcap support (0.1.9)
+# prism2_bsd - Prism2 on *BSD
+# orinoco - Orinoco cards using Snax's patched driers
+# generic - Generic card with no specific support. You will have
+# to put this into monitor mode yourself!
+# wsp100 - WSP100 embedded remote sensor.
+# wtapfile - Saved file of packets readable by libwiretap
+# ar5k - ar5k 802.11a using the vt_ar5k drivers
+# Capture interface - Specifies the network interface Kismet will watch for
+# packets to come in on. Typically "ethX" or "wlanX". For the WSP100 capture
+# engine, the WSP100 device sends packets via a UDP stream, so the capture
+# interface should be in the form of host:port where 'host' is the WSP100 and
+# 'port' is the local UDP port that it will send data to.
+# Capture Name - The name Kismet uses for this capture source. This is the
+# name used to specify what sources to enable.
+#
+# To enable multiple sources, specify a source line for each and then use the
+# enablesources line to enable them. For example:
+# source=prism2,wlan0,prism
+# source=cisco,eth0,cisco
+source=wrt54g,eth1,wireless
+# For v1 hardware uncomment this:
+# source=wrt54g,eth2,wireless
+
+# Comma-separated list of sources to enable. This is only needed if you wish
+# to selectively enable multiple sources.
+# enablesources=prism,cisco
+
+# Do we channelhop?
+channelhop=true
+
+# How many channels per second do we hop? (1-10)
+channelvelocity=5
+
+# By setting the dwell time for channel hopping we override the channelvelocity
+# setting above and dwell on each channel for the given number of seconds.
+#channeldwell=10
+
+# Do we split channels between cards on the same spectrum? This means if
+# multiple 802.11b capture sources are defined, they will be offset to cover
+# the most possible spectrum at a given time. This also controls splitting
+# fine-tuned sourcechannels lines which cover multiple interfaces (see below)
+splitchannels=true
+
+# Basic channel hopping control:
+# These define the channels the cards hop through for various frequency ranges
+# supported by Kismet. More finegrain control is available via the
+# "sourcechannels" configuration option.
+#
+# Don't change the IEEE80211<x> identifiers or channel hopping won't work.
+
+# Users outside the US might want to use this list:
+# defaultchannels=IEEE80211b:1,7,13,2,8,3,14,9,4,10,5,11,6,12
+defaultchannels=IEEE80211b:1,6,11,2,7,3,8,4,9,5,10
+
+# 802.11g uses the same channels as 802.11b...
+defaultchannels=IEEE80211g:1,6,11,2,7,3,8,4,9,5,10
+
+# 802.11a channels are non-overlapping so sequential is fine. You may want to
+# adjust the list depending on the channels your card actually supports.
+# defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,184,188,192,196,200,204,208,212,216
+defaultchannels=IEEE80211a:36,40,44,48,52,56,60,64
+
+# Combo cards like Atheros use both 'a' and 'b/g' channels. Of course, you
+# can also explicitly override a given source. You can use the script
+# extras/listchan.pl to extract all the channels your card supports.
+defaultchannels=IEEE80211ab:1,6,11,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64
+
+# Fine-tuning channel hopping control:
+# The sourcechannels option can be used to set the channel hopping for
+# specific interfaces, and to control what interfaces share a list of
+# channels for split hopping. This can also be used to easily lock
+# one card on a single channel while hopping with other cards.
+# Any card without a sourcechannel definition will use the standard hopping
+# list.
+# sourcechannels=sourcename[,sourcename]:ch1,ch2,ch3,...chN
+
+# ie, for us channels on the source 'prism2source' (same as normal channel
+# hopping behavior):
+# sourcechannels=prism2source:1,6,11,2,7,3,8,4,9,5,10
+
+# Given two capture sources, "prism2a" and "prism2b", we want prism2a to stay
+# on channel 6 and prism2b to hop normally. By not setting a sourcechannels
+# line for prism2b, it will use the standard hopping.
+# sourcechannels=prism2a:6
+
+# To assign the same custom hop channel to multiple sources, or to split the
+# same custom hop channel over two sources (if splitchannels is true), list
+# them all on the same sourcechannels line:
+# sourcechannels=prism2a,prism2b,prism2c:1,6,11
+
diff --git a/package/kismet/files/kismet_ui.conf b/package/kismet/files/kismet_ui.conf
new file mode 100644
index 000000000..e704b37e5
--- /dev/null
+++ b/package/kismet/files/kismet_ui.conf
@@ -0,0 +1,61 @@
+# Kismet GUI config file
+
+# Version of Kismet config
+version=2005.04.R1
+
+# Do we show the intro window?
+showintro=false
+
+# Gui type to use
+# Valid types: curses, panel
+gui=panel
+# Server to connect to (host:port)
+host=localhost:2501
+# Network traffic decay (active/recent/inactive) and packet click rate - increase
+# this if you are doing prism2 channel hopping.
+decay=3
+# What columns do we display? Comma seperated. Read the documentation for what
+# columns are valid.
+columns=decay,name,type,wep,channel,packets,flags,ip,size
+# What columns do we display for clients? Comma seperated.
+clientcolumns=decay,type,mac,manuf,data,crypt,size,ip,signal,quality,noise
+
+# Do we auotmatically make a group for probed networks or do we show them
+# amidst other networks?
+autogroup_probe=true
+# Do we autogroup data-only networks?
+autogroup_data=true
+
+# Display battery status?
+apm=false
+
+# Simple borders (use - and | instead of smooth vertical and horizontal
+# lines. This is required on Zaurus, and might be needed elsewhere if your
+# terminal doesn't display the border characters correctly.
+simpleborders=false
+
+# Colors (front, back) of text in the panel front. Valid colors are:
+# black, red, yellow, green, blue, magenta, cyan, white
+# optionally prefixed with "hi-" for bold/bright colors, ie
+# hi-red, hi-yellow, hi-green, etc.
+
+# Enable colors?
+color=true
+# Background
+backgroundcolor=black
+# Default text
+textcolor=white
+# Window borders
+bordercolor=green
+# Titles
+titlecolor=hi-white
+# GPS and APM info
+monitorcolor=hi-white
+# WEP network color
+wepcolor=hi-green
+# Factory network color
+factorycolor=hi-red
+# Open color
+opencolor=hi-yellow
+# Decloaked network color
+cloakcolor=hi-blue
diff --git a/package/kismet/ipkg/kismet-client.conffiles b/package/kismet/ipkg/kismet-client.conffiles
new file mode 100644
index 000000000..b849ce1ce
--- /dev/null
+++ b/package/kismet/ipkg/kismet-client.conffiles
@@ -0,0 +1,4 @@
+/etc/kismet/ap_manuf
+/etc/kismet/client_manuf
+/etc/kismet/kismet.conf
+/etc/kismet/kismet_ui.conf \ No newline at end of file
diff --git a/package/kismet/ipkg/kismet-client.control b/package/kismet/ipkg/kismet-client.control
new file mode 100644
index 000000000..e5c8f512c
--- /dev/null
+++ b/package/kismet/ipkg/kismet-client.control
@@ -0,0 +1,9 @@
+Package: kismet-client
+Priority: optional
+Section: net
+Depends: uclibc++, libncurses
+Description: The kismet client
+ Kismet is an 802.11 layer2 wireless network detector,
+ sniffer, and intrusion detection system. Kismet will work with any
+ wireless card which supports raw monitoring (rfmon) mode, and can
+ sniff 802.11b, 802.11a, and 802.11g traffic.
diff --git a/package/kismet/ipkg/kismet-drone.conffiles b/package/kismet/ipkg/kismet-drone.conffiles
new file mode 100644
index 000000000..744e24473
--- /dev/null
+++ b/package/kismet/ipkg/kismet-drone.conffiles
@@ -0,0 +1 @@
+/etc/kismet/kismet_drone.conf
diff --git a/package/kismet/ipkg/kismet-drone.control b/package/kismet/ipkg/kismet-drone.control
new file mode 100644
index 000000000..9d8ac0df3
--- /dev/null
+++ b/package/kismet/ipkg/kismet-drone.control
@@ -0,0 +1,9 @@
+Package: kismet-drone
+Priority: optional
+Section: net
+Depends: uclibc++, libpcap
+Description: The kismet drone
+ Kismet is an 802.11 layer2 wireless network detector,
+ sniffer, and intrusion detection system. Kismet will work with any
+ wireless card which supports raw monitoring (rfmon) mode, and can
+ sniff 802.11b, 802.11a, and 802.11g traffic.
diff --git a/package/kismet/ipkg/kismet-server.conffiles b/package/kismet/ipkg/kismet-server.conffiles
new file mode 100644
index 000000000..0fdf43763
--- /dev/null
+++ b/package/kismet/ipkg/kismet-server.conffiles
@@ -0,0 +1,3 @@
+/etc/kismet/ap_manuf
+/etc/kismet/client_manuf
+/etc/kismet/kismet.conf
diff --git a/package/kismet/ipkg/kismet-server.control b/package/kismet/ipkg/kismet-server.control
new file mode 100644
index 000000000..3c416be83
--- /dev/null
+++ b/package/kismet/ipkg/kismet-server.control
@@ -0,0 +1,9 @@
+Package: kismet-server
+Priority: optional
+Section: net
+Depends: uclibc++, libpcap
+Description: The kismet server
+ Kismet is an 802.11 layer2 wireless network detector,
+ sniffer, and intrusion detection system. Kismet will work with any
+ wireless card which supports raw monitoring (rfmon) mode, and can
+ sniff 802.11b, 802.11a, and 802.11g traffic.
diff --git a/package/kismet/ipkg/kismet.control b/package/kismet/ipkg/kismet.control
new file mode 100644
index 000000000..193328563
--- /dev/null
+++ b/package/kismet/ipkg/kismet.control
@@ -0,0 +1,9 @@
+Package: kismet
+Priority: optional
+Section: net
+Depends: libgcc, kismet-client, kismet-server
+Description: kismet
+ Kismet is an 802.11 layer2 wireless network detector,
+ sniffer, and intrusion detection system. Kismet will work with any
+ wireless card which supports raw monitoring (rfmon) mode, and can
+ sniff 802.11b, 802.11a, and 802.11g traffic.
diff --git a/package/kismet/patches/patch-Makefile_in b/package/kismet/patches/patch-Makefile_in
new file mode 100644
index 000000000..e58e3399a
--- /dev/null
+++ b/package/kismet/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- kismet-2008-05-R1.orig/Makefile.in 2008-05-29 21:18:26.000000000 +0200
++++ kismet-2008-05-R1/Makefile.in 2009-05-10 01:19:47.000000000 +0200
+@@ -22,7 +22,7 @@ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+ CLIBS = @CLIBS@
+ CFLAGS = @CFLAGS@
+-CXXFLAGS = -O2 -Wall -DVERSION_MAJOR=\"$(VERSION_MAJOR)\" -DVERSION_MINOR=\"$(VERSION_MINOR)\" -DVERSION_TINY=\"$(VERSION_TINY)\" -DTIMESTAMP=\"`cat TIMESTAMP`\" @CXXFLAGS@
++CXXFLAGS = -Wall -DVERSION_MAJOR=\"$(VERSION_MAJOR)\" -DVERSION_MINOR=\"$(VERSION_MINOR)\" -DVERSION_TINY=\"$(VERSION_TINY)\" -DTIMESTAMP=\"`cat TIMESTAMP`\" @CXXFLAGS@
+ CPPFLAGS = @CPPFLAGS@
+ SUID = @suid@
+
diff --git a/package/knock/Config.in b/package/knock/Config.in
new file mode 100644
index 000000000..ada7f06c8
--- /dev/null
+++ b/package/knock/Config.in
@@ -0,0 +1,41 @@
+config ADK_COMPILE_KNOCK
+ tristate
+ default n
+ depends ADK_PACKAGE_KNOCK || ADK_PACKAGE_KNOCKD
+
+config ADK_PACKAGE_KNOCK
+ prompt "knock............................. A port-knocking client"
+ tristate
+ default n
+ select ADK_COMPILE_KNOCK
+ help
+ It listens to all traffic on an ethernet (or PPP) interface,
+ looking for special "knock" sequences of port-hits. A client
+ makes these port-hits by sending a TCP (or UDP) packet to a
+ port on the server. This port need not be open -- since
+ knockd listens at the link-layer level, it sees all traffic
+ even if it's destined for a closed port. When the server
+ detects a specific sequence of port-hits, it runs a command
+ defined in its configuration file. This can be used to open
+ up holes in a firewall for quick access.
+
+ http://www.zeroflux.org/cgi-bin/cvstrac/knock/wiki
+
+config ADK_PACKAGE_KNOCKD
+ prompt "knockd............................ A port-knocking server"
+ tristate
+ default n
+ select ADK_COMPILE_KNOCK
+ help
+ It listens to all traffic on an ethernet (or PPP) interface,
+ looking for special "knock" sequences of port-hits. A client
+ makes these port-hits by sending a TCP (or UDP) packet to a
+ port on the server. This port need not be open -- since
+ knockd listens at the link-layer level, it sees all traffic
+ even if it's destined for a closed port. When the server
+ detects a specific sequence of port-hits, it runs a command
+ defined in its configuration file. This can be used to open
+ up holes in a firewall for quick access.
+
+ http://www.zeroflux.org/cgi-bin/cvstrac/knock/wiki
+
diff --git a/package/knock/Makefile b/package/knock/Makefile
new file mode 100644
index 000000000..13e57d43b
--- /dev/null
+++ b/package/knock/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= knock
+PKG_VERSION:= 0.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ca09d61458974cff90a700aba6120891
+MASTER_SITES:= http://www.zeroflux.org/proj/knock/files/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,KNOCK,knock,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,KNOCKD,knockd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TCXXFLAGS+= ${TCPPFLAGS} ${TCFLAGS}
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_lib_pcap_pcap_open_live=yes
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_KNOCK}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/knock ${IDIR_KNOCK}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_KNOCKD}/etc
+ install -m0600 ${WRKINST}/etc/knockd.conf ${IDIR_KNOCKD}/etc/
+ ${INSTALL_DIR} ${IDIR_KNOCKD}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/knockd ${IDIR_KNOCKD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/knock/ipkg/knock.control b/package/knock/ipkg/knock.control
new file mode 100644
index 000000000..72e635ff4
--- /dev/null
+++ b/package/knock/ipkg/knock.control
@@ -0,0 +1,5 @@
+Package: knock
+Priority: optional
+Section: net
+Depends:
+Description: A port-knocking client
diff --git a/package/knock/ipkg/knockd.conffiles b/package/knock/ipkg/knockd.conffiles
new file mode 100644
index 000000000..e191bfd70
--- /dev/null
+++ b/package/knock/ipkg/knockd.conffiles
@@ -0,0 +1 @@
+/etc/knockd.conf \ No newline at end of file
diff --git a/package/knock/ipkg/knockd.control b/package/knock/ipkg/knockd.control
new file mode 100644
index 000000000..e0c943915
--- /dev/null
+++ b/package/knock/ipkg/knockd.control
@@ -0,0 +1,5 @@
+Package: knockd
+Priority: optional
+Section: net
+Depends: libpcap
+Description: A port-knocking server
diff --git a/package/krb5/Config.in b/package/krb5/Config.in
new file mode 100644
index 000000000..5fa68aa6f
--- /dev/null
+++ b/package/krb5/Config.in
@@ -0,0 +1,45 @@
+config ADK_COMPILE_KRB5
+ prompt "kerberos5......................... MIT kerberos software"
+ bool
+ select ADK_PACKAGE_LIBNCURSES
+ default n
+
+config ADK_PACKAGE_KRB5_SERVER
+ prompt "krb5-server....................... MIT kerberos server"
+ tristate
+ depends on ADK_COMPILE_KRB5
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_KRB5_LIBS
+ default n
+ help
+ http://web.mit.edu/kerberos
+
+#choice
+##prompt "Database backend"
+#depends on ADK_PACKAGE_HEIMDAL_SERVER
+#default ADK_COMPILE_HEIMDAL_WITH_DB_BDB
+#
+#config ADK_COMPILE_HEIMDAL_WITH_DB_BDB
+# bool "Berkeley DB backend"
+# select ADK_PACKAGE_LIBDB
+# help
+# Use Oracle Berkeley DB as kerberos database backend.
+#
+#config ADK_COMPILE_HEIMDAL_WITH_DB_LDAP
+# bool "LDAP backend"
+# select ADK_PACKAGE_LIBOPENLDAP
+# help
+# Use OpenLDAP as kerberos database backend.
+# (Useful for SSO setup)
+#
+#endchoice
+
+config ADK_PACKAGE_KRB5_LIBS
+ prompt "krb5-libs......................... MIT kerberos libraries"
+ tristate
+ depends on ADK_COMPILE_KRB5
+ select ADK_PACKAGE_LIBPTHREAD
+ default n
+ help
+ http://web.mit.edu/kerberos
+
diff --git a/package/krb5/Makefile b/package/krb5/Makefile
new file mode 100644
index 000000000..062568d97
--- /dev/null
+++ b/package/krb5/Makefile
@@ -0,0 +1,57 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= krb5
+PKG_VERSION:= 1.6.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2dc1307686eb1c2bf1ab08ea805dad46
+MASTER_SITES:= http://web.mit.edu/kerberos/dist/krb5/1.6/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}-signed.tar
+
+WRKSRC= ${WRKDIST}/src
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,KRB5_SERVER,krb5-server,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,KRB5_LIBS,krb5-libs,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --without-krb4 --disable-static --without-tcl
+CONFIGURE_ENV+= krb5_cv_attr_constructor_destructor=yes,yes \
+ ac_cv_func_regcomp=yes \
+ ac_cv_printf_positional=yes \
+ ac_cv_file__etc_environment=no \
+ ac_cv_file__etc_TIMEZONE=no
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-extract:
+ (cd ${WRKDIR}; tar xzf ${PKG_NAME}-${PKG_VERSION}.tar.gz)
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_KRB5_SERVER}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_KRB5_SERVER}/etc/krb5kdc
+ ${INSTALL_DIR} ${IDIR_KRB5_SERVER}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_KRB5_SERVER}/usr/lib
+ ${INSTALL_DIR} ${IDIR_KRB5_SERVER}/usr/lib/krb5/plugins/kdb
+ ${INSTALL_DATA} ./files/kdc.conf ${IDIR_KRB5_SERVER}/etc/krb5kdc
+ ${INSTALL_BIN} ./files/krb5.init ${IDIR_KRB5_SERVER}/etc/init.d/krb5
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/{ktutil,kdb5_util,krb5kdc,kadmind,kadmin.local,kadmin} \
+ ${IDIR_KRB5_SERVER}/usr/sbin
+ ${INSTALL_DATA} ${WRKINST}/usr/lib/krb5/plugins/kdb/db2.so \
+ ${IDIR_KRB5_SERVER}/usr/lib/krb5/plugins/kdb
+ ${CP} ${WRKINST}/usr/lib/lib{des425,gssrpc,kadm5clnt,kadm5srv,kdb5}.so* \
+ ${IDIR_KRB5_SERVER}/usr/lib
+ # krb5-libs
+ ${INSTALL_DIR} ${IDIR_KRB5_LIBS}/etc
+ ${INSTALL_DIR} ${IDIR_KRB5_LIBS}/usr/lib
+ ${INSTALL_DATA} ./files/krb5.conf ${IDIR_KRB5_LIBS}/etc
+ ${CP} ${WRKINST}/usr/lib/lib{com_err,gssapi_krb5,k5crypto,krb5,krb5support}.so* \
+ ${IDIR_KRB5_LIBS}/usr/lib
+ echo '/usr/lib/libgssapi_krb5.so mechglue_internal_krb5_init' > ${IDIR_KRB5_LIBS}/etc/gssapi_mech.conf
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/krb5/files/kadmind.acl b/package/krb5/files/kadmind.acl
new file mode 100644
index 000000000..e5da87fb5
--- /dev/null
+++ b/package/krb5/files/kadmind.acl
@@ -0,0 +1 @@
+#principal [priv1,priv2,...] [glob-pattern]
diff --git a/package/krb5/files/kdc.conf b/package/krb5/files/kdc.conf
new file mode 100644
index 000000000..e11202e23
--- /dev/null
+++ b/package/krb5/files/kdc.conf
@@ -0,0 +1,13 @@
+[kdcdefaults]
+ kdc_ports = 750,88
+
+[realms]
+ MY.REALM = {
+ database_name = /etc/krb5kdc/principal
+ admin_keytab = FILE:/etc/krb5kdc/kadm5.keytab
+ acl_file = /etc/krb5kdc/kadm5.acl
+ key_stash_file = /etc/krb5kdc/.k5.MY.REALM
+ kdc_ports = 750,88
+ max_life = 10h 0m 0s
+ max_renewable_life = 7d 0h 0m 0s
+ }
diff --git a/package/krb5/files/krb5.conf b/package/krb5/files/krb5.conf
new file mode 100644
index 000000000..02b274c4c
--- /dev/null
+++ b/package/krb5/files/krb5.conf
@@ -0,0 +1,16 @@
+[libdefaults]
+ default_realm = MY.REALM
+ clockskew = 300
+
+[realms]
+ MY.REALM = {
+ kdc = my.hostname
+ }
+
+[domain_realm]
+ .my.domain = MY.REALM
+
+[logging]
+ kdc = SYSLOG:INFO
+ default = SYSLOG:INFO
+
diff --git a/package/krb5/files/krb5.init b/package/krb5/files/krb5.init
new file mode 100644
index 000000000..732088fcb
--- /dev/null
+++ b/package/krb5/files/krb5.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${kdc:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/krb5kdc
+ /usr/sbin/kadmind &
+ ;;
+stop)
+ killall krb5kdc
+ killall kadmind
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/krb5/ipkg/krb5-libs.control b/package/krb5/ipkg/krb5-libs.control
new file mode 100644
index 000000000..64ff0962b
--- /dev/null
+++ b/package/krb5/ipkg/krb5-libs.control
@@ -0,0 +1,5 @@
+Package: krb5-libs
+Priority: optional
+Section: net
+Depends: libpthread
+Description: MIT kerberos libraries
diff --git a/package/krb5/ipkg/krb5-server.control b/package/krb5/ipkg/krb5-server.control
new file mode 100644
index 000000000..6eea59a65
--- /dev/null
+++ b/package/krb5/ipkg/krb5-server.control
@@ -0,0 +1,4 @@
+Package: krb5-server
+Priority: optional
+Section: net
+Description: MIT kerberos server
diff --git a/package/krb5/ipkg/krb5-server.postinst b/package/krb5/ipkg/krb5-server.postinst
new file mode 100644
index 000000000..24f1f7d78
--- /dev/null
+++ b/package/krb5/ipkg/krb5-server.postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf "MIT kdc" kdc NO
+add_service kerberos 88/tcp
+add_service kerberos 88/udp
+add_service kerberos-adm 749/tcp
+add_service kpasswd 464/tcp
+add_service kpasswd 464/udp
diff --git a/package/krb5/patches/patch-src_Makefile_in b/package/krb5/patches/patch-src_Makefile_in
new file mode 100644
index 000000000..01533ad39
--- /dev/null
+++ b/package/krb5/patches/patch-src_Makefile_in
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/Makefile.in 2007-09-18 05:38:17.000000000 +0200
++++ krb5-1.6.3/src/Makefile.in 2009-01-29 11:50:21.000000000 +0100
+@@ -7,7 +7,6 @@ mydir=.
+ SUBDIRS=util include lib @krb524@ kdc kadmin @ldap_plugin_dir@ slave clients \
+ plugins/kdb/db2 \
+ plugins/preauth/pkinit \
+- appl tests \
+ config-files gen-manpages
+ BUILDTOP=$(REL)$(C)
+ LOCALINCLUDES = -I$(srcdir)
diff --git a/package/krb5/patches/patch-src_include_stock_osconf_h b/package/krb5/patches/patch-src_include_stock_osconf_h
new file mode 100644
index 000000000..b774623fa
--- /dev/null
+++ b/package/krb5/patches/patch-src_include_stock_osconf_h
@@ -0,0 +1,34 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/include/stock/osconf.h 2006-05-26 01:37:33.000000000 +0200
++++ krb5-1.6.3/src/include/stock/osconf.h 2009-02-03 19:13:37.508177540 +0100
+@@ -60,14 +60,14 @@
+ #define DEFAULT_LNAME_FILENAME "@PREFIX/lib/krb5.aname"
+ #endif /* _WINDOWS */
+
+-#define DEFAULT_KDB_FILE "@LOCALSTATEDIR/krb5kdc/principal"
+-#define DEFAULT_KEYFILE_STUB "@LOCALSTATEDIR/krb5kdc/.k5."
+-#define KRB5_DEFAULT_ADMIN_ACL "@LOCALSTATEDIR/krb5kdc/krb5_adm.acl"
++#define DEFAULT_KDB_FILE "@SYSCONFDIR/krb5kdc/principal"
++#define DEFAULT_KEYFILE_STUB "@SYSCONFDIR/krb5kdc/.k5."
++#define KRB5_DEFAULT_ADMIN_ACL "@SYSCONFDIR/krb5kdc/krb5_adm.acl"
+ /* Used by old admin server */
+-#define DEFAULT_ADMIN_ACL "@LOCALSTATEDIR/krb5kdc/kadm_old.acl"
++#define DEFAULT_ADMIN_ACL "@SYSCONFDIR/krb5kdc/kadm_old.acl"
+
+ /* Location of KDC profile */
+-#define DEFAULT_KDC_PROFILE "@LOCALSTATEDIR/krb5kdc/kdc.conf"
++#define DEFAULT_KDC_PROFILE "@SYSCONFDIR/krb5kdc/kdc.conf"
+ #define KDC_PROFILE_ENV "KRB5_KDC_PROFILE"
+
+ #if TARGET_OS_MAC
+@@ -96,8 +96,8 @@
+ /*
+ * Defaults for the KADM5 admin system.
+ */
+-#define DEFAULT_KADM5_KEYTAB "@LOCALSTATEDIR/krb5kdc/kadm5.keytab"
+-#define DEFAULT_KADM5_ACL_FILE "@LOCALSTATEDIR/krb5kdc/kadm5.acl"
++#define DEFAULT_KADM5_KEYTAB "@SYSCONFDIR/krb5kdc/kadm5.keytab"
++#define DEFAULT_KADM5_ACL_FILE "@SYSCONFDIR/krb5kdc/kadm5.acl"
+ #define DEFAULT_KADM5_PORT 749 /* assigned by IANA */
+
+ #define MAX_DGRAM_SIZE 4096
diff --git a/package/krb5/patches/patch-src_lib_kadm5_Makefile_in b/package/krb5/patches/patch-src_lib_kadm5_Makefile_in
new file mode 100644
index 000000000..dfcae989b
--- /dev/null
+++ b/package/krb5/patches/patch-src_lib_kadm5_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/lib/kadm5/Makefile.in 2007-09-18 06:22:24.000000000 +0200
++++ krb5-1.6.3/src/lib/kadm5/Makefile.in 2009-01-29 12:42:33.000000000 +0100
+@@ -2,7 +2,7 @@ thisconfigdir=../..
+ myfulldir=lib/kadm5
+ mydir=lib/kadm5
+ BUILDTOP=$(REL)..$(S)..
+-LOCAL_SUBDIRS = clnt srv unit-test
++LOCAL_SUBDIRS = clnt srv
+ DEFS=
+
+ ##DOSBUILDTOP = ..\..
diff --git a/package/krb5/patches/patch-src_lib_kadm5_clnt_Makefile_in b/package/krb5/patches/patch-src_lib_kadm5_clnt_Makefile_in
new file mode 100644
index 000000000..601506c83
--- /dev/null
+++ b/package/krb5/patches/patch-src_lib_kadm5_clnt_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/lib/kadm5/clnt/Makefile.in 2007-09-18 06:22:24.000000000 +0200
++++ krb5-1.6.3/src/lib/kadm5/clnt/Makefile.in 2009-01-30 18:38:15.000000000 +0100
+@@ -15,7 +15,7 @@ SHLIB_EXPDEPS=\
+ $(TOPLIBD)/libkrb5$(SHLIBEXT) \
+ $(TOPLIBD)/libk5crypto$(SHLIBEXT) \
+ $(COM_ERR_DEPLIB)
+-SHLIB_EXPLIBS=-lgssrpc -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
++SHLIB_EXPLIBS=-pthread -lgssrpc -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
+ SHLIB_DIRS=-L$(TOPLIBD)
+ SHLIB_RDIRS=$(KRB5_LIBDIR)
+ RELDIR=kadm5/clnt
diff --git a/package/krb5/patches/patch-src_lib_kadm5_srv_Makefile_in b/package/krb5/patches/patch-src_lib_kadm5_srv_Makefile_in
new file mode 100644
index 000000000..d33470c8f
--- /dev/null
+++ b/package/krb5/patches/patch-src_lib_kadm5_srv_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/lib/kadm5/srv/Makefile.in 2007-09-18 06:22:24.000000000 +0200
++++ krb5-1.6.3/src/lib/kadm5/srv/Makefile.in 2009-01-30 18:31:56.000000000 +0100
+@@ -23,7 +23,7 @@ SHLIB_EXPDEPS=\
+ $(TOPLIBD)/libkrb5$(SHLIBEXT) \
+ $(TOPLIBD)/libk5crypto$(SHLIBEXT) \
+ $(COM_ERR_DEPLIB)
+-SHLIB_EXPLIBS = -lgssrpc -lgssapi_krb5 -lkdb5 $(KDB5_DB_LIB) \
++SHLIB_EXPLIBS = -pthread -lgssrpc -lgssapi_krb5 -lkdb5 $(KDB5_DB_LIB) \
+ -lkrb5 -lk5crypto -lcom_err @GEN_LIB@
+ SHLIB_DIRS=-L$(TOPLIBD)
+ SHLIB_RDIRS=$(KRB5_LIBDIR)
diff --git a/package/krb5/patches/patch-src_lib_kdb_Makefile_in b/package/krb5/patches/patch-src_lib_kdb_Makefile_in
new file mode 100644
index 000000000..50e184e73
--- /dev/null
+++ b/package/krb5/patches/patch-src_lib_kdb_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/lib/kdb/Makefile.in 2007-09-18 06:22:24.000000000 +0200
++++ krb5-1.6.3/src/lib/kdb/Makefile.in 2009-01-30 18:35:24.000000000 +0100
+@@ -21,7 +21,7 @@ RELDIR=kdb
+ SHLIB_EXPDEPS = \
+ $(TOPLIBD)/libk5crypto$(SHLIBEXT) \
+ $(TOPLIBD)/libkrb5$(SHLIBEXT)
+-SHLIB_EXPLIBS=-lkrb5 -lcom_err -lk5crypto $(SUPPORT_LIB) $(DL_LIB) $(LIBS)
++SHLIB_EXPLIBS=-pthread -lkrb5 -lcom_err -lk5crypto $(SUPPORT_LIB) $(DL_LIB) $(LIBS)
+ SHLIB_DIRS=-L$(TOPLIBD)
+ SHLIB_RDIRS=$(KRB5_LIBDIR)
+
diff --git a/package/krb5/patches/patch-src_lib_krb5_Makefile_in b/package/krb5/patches/patch-src_lib_krb5_Makefile_in
new file mode 100644
index 000000000..e844e8750
--- /dev/null
+++ b/package/krb5/patches/patch-src_lib_krb5_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/lib/krb5/Makefile.in 2007-09-18 06:22:24.000000000 +0200
++++ krb5-1.6.3/src/lib/krb5/Makefile.in 2009-01-30 18:41:20.000000000 +0100
+@@ -55,7 +55,7 @@ RELDIR=krb5
+ SHLIB_EXPDEPS = \
+ $(TOPLIBD)/libk5crypto$(SHLIBEXT) \
+ $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB)
+-SHLIB_EXPLIBS=-lk5crypto -lcom_err $(SUPPORT_LIB) @GEN_LIB@ $(LIBS)
++SHLIB_EXPLIBS=-pthread -lk5crypto -lcom_err $(SUPPORT_LIB) @GEN_LIB@ $(LIBS)
+ SHLIB_DIRS=-L$(TOPLIBD)
+ SHLIB_RDIRS=$(KRB5_LIBDIR)
+
diff --git a/package/krb5/patches/patch-src_lib_rpc_Makefile_in b/package/krb5/patches/patch-src_lib_rpc_Makefile_in
new file mode 100644
index 000000000..6276dc4e3
--- /dev/null
+++ b/package/krb5/patches/patch-src_lib_rpc_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- krb5-1.6.3.orig/src/lib/rpc/Makefile.in 2006-10-05 16:05:40.000000000 +0200
++++ krb5-1.6.3/src/lib/rpc/Makefile.in 2009-01-29 12:39:25.000000000 +0100
+@@ -5,7 +5,7 @@ BUILDTOP=$(REL)..$(S)..
+ DEFINES = -DGSSAPI_KRB5 -DDEBUG_GSSAPI=0 -DGSSRPC__IMPL
+ DEFS=
+
+-SUBDIRS=unit-test
++#SUBDIRS=unit-test
+
+ ##DOSBUILDTOP = ..\..
+ ##DOSLIBNAME=libgssrpc.lib
diff --git a/package/l2tpns/Config.in b/package/l2tpns/Config.in
new file mode 100644
index 000000000..b1e1bad72
--- /dev/null
+++ b/package/l2tpns/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_L2TPNS
+ prompt "l2tpns............................ An L2TP enhanced server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBCLI
+ help
+ l2tpns is a layer 2 tunneling protocol network server (LNS).
+ It supports up to 65535 concurrent sessions per server/cluster
+ plus ISP features such as rate limiting, walled garden, usage
+ accounting, and more.
+
+ http://sourceforge.net/projects/l2tpns
diff --git a/package/l2tpns/Makefile b/package/l2tpns/Makefile
new file mode 100644
index 000000000..f78b3c421
--- /dev/null
+++ b/package/l2tpns/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= l2tpns
+PKG_VERSION:= 2.1.14
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2a0ee2a3678160c335f1d68c17c4f871
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=l2tpns/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,L2TPNS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_FLAGS= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= OPTIM="${TARGET_CFLAGS}" \
+ STAGING_DIR=${STAGING_DIR} \
+ LD="${TARGET_CC}"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_L2TPNS}/etc/l2tpns
+ ${CP} ${WRKINST}/etc/l2tpns/* ${IDIR_L2TPNS}/etc/l2tpns/
+ ${INSTALL_DIR} ${IDIR_L2TPNS}/usr/lib/l2tpns
+ ${CP} ${WRKINST}/usr/lib/l2tpns/* ${IDIR_L2TPNS}/usr/lib/l2tpns/
+ ${INSTALL_DIR} ${IDIR_L2TPNS}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/* ${IDIR_L2TPNS}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/l2tpns/ipkg/l2tpns.conffiles b/package/l2tpns/ipkg/l2tpns.conffiles
new file mode 100644
index 000000000..eaf3a5095
--- /dev/null
+++ b/package/l2tpns/ipkg/l2tpns.conffiles
@@ -0,0 +1,3 @@
+/etc/l2tpns/ip_pool
+/etc/l2tpns/startup-config
+/etc/l2tpns/users
diff --git a/package/l2tpns/ipkg/l2tpns.control b/package/l2tpns/ipkg/l2tpns.control
new file mode 100644
index 000000000..1946f8888
--- /dev/null
+++ b/package/l2tpns/ipkg/l2tpns.control
@@ -0,0 +1,4 @@
+Package: l2tpns
+Section: net
+Priority: optional
+Description: A layer 2 tunneling protocol network server (LNS).
diff --git a/package/l2tpns/patches/01-honor_includes_remove_backtrace.patch b/package/l2tpns/patches/01-honor_includes_remove_backtrace.patch
new file mode 100644
index 000000000..a8e4d754a
--- /dev/null
+++ b/package/l2tpns/patches/01-honor_includes_remove_backtrace.patch
@@ -0,0 +1,128 @@
+diff -urN orig/l2tpns-2.1.14/Makefile l2tpns-2.1.14/Makefile
+--- orig/l2tpns-2.1.14/Makefile 2005-12-07 06:21:37.000000000 +0100
++++ l2tpns-2.1.14/Makefile 2005-12-14 12:50:49.000000000 +0100
+@@ -11,17 +11,14 @@
+ DEFINES += -DETCDIR='"$(etcdir)"'
+
+ OPTIM =
+-OPTIM += -g
+ OPTIM += -O3
+
+-CC = gcc
+-LD = gcc
+-INCLUDES = -I.
++INCLUDES = -I. -I$(STAGING_DIR)/usr/include
+ CPPFLAGS = $(INCLUDES) $(DEFINES)
+ CFLAGS = -Wall -Wformat-security -Wno-format-zero-length $(OPTIM)
+-LDFLAGS =
++LDFLAGS = -L$(STAGING_DIR)/usr/lib
+ LDLIBS =
+-INSTALL = install -c -D -o root -g root
++INSTALL = install -c -D
+
+ l2tpns.LIBS = -lm -lcli -ldl
+
+diff -urN orig/l2tpns-2.1.14/l2tpns.c l2tpns-2.1.14/l2tpns.c
+--- orig/l2tpns-2.1.14/l2tpns.c 2005-12-07 06:21:37.000000000 +0100
++++ l2tpns-2.1.14/l2tpns.c 2005-12-14 12:50:36.000000000 +0100
+@@ -940,18 +940,14 @@
+
+ if (!t)
+ {
+- static int backtrace_count = 0;
+ LOG(0, 0, t, "tunnelsend called with 0 as tunnel id\n");
+ STAT(tunnel_tx_errors);
+- log_backtrace(backtrace_count, 5)
+ return;
+ }
+
+ if (!tunnel[t].ip)
+ {
+- static int backtrace_count = 0;
+ LOG(1, 0, t, "Error sending data out tunnel: no remote endpoint (tunnel not set up)\n");
+- log_backtrace(backtrace_count, 5)
+ STAT(tunnel_tx_errors);
+ return;
+ }
+@@ -4125,23 +4121,8 @@
+ struct sched_param params = {0};
+ params.sched_priority = 1;
+
+- if (get_nprocs() < 2)
+- {
+- LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n");
+- config->scheduler_fifo = 0;
+- }
+- else
+- {
+- if ((ret = sched_setscheduler(0, SCHED_FIFO, &params)) == 0)
+- {
+- LOG(1, 0, 0, "Using FIFO scheduler. Say goodbye to any other processes running\n");
+- }
+- else
+- {
+- LOG(0, 0, 0, "Error setting scheduler to FIFO: %s\n", strerror(errno));
+- config->scheduler_fifo = 0;
+- }
+- }
++ LOG(0, 0, 0, "Not using FIFO scheduler, there is only 1 processor in the system.\n");
++ config->scheduler_fifo = 0;
+ }
+
+ /* Set up the cluster communications port. */
+diff -urN orig/l2tpns-2.1.14/l2tpns.h l2tpns-2.1.14/l2tpns.h
+--- orig/l2tpns-2.1.14/l2tpns.h 2005-12-09 01:43:17.000000000 +0100
++++ l2tpns-2.1.14/l2tpns.h 2005-12-14 07:43:51.000000000 +0100
+@@ -5,7 +5,6 @@
+ #define __L2TPNS_H__
+
+ #include <netinet/in.h>
+-#include <execinfo.h>
+ #include <stdio.h>
+ #include <signal.h>
+ #include <stdlib.h>
+@@ -766,21 +765,6 @@
+ extern ippoolt *ip_address_pool;
+ #define sessionfree (session[0].next)
+
+-#define log_backtrace(count, max) \
+-if (count++ < max) { \
+- void *array[20]; \
+- char **strings; \
+- int size, i; \
+- LOG(0, 0, t, "Backtrace follows:\n"); \
+- size = backtrace(array, 10); \
+- strings = backtrace_symbols(array, size); \
+- if (strings) for (i = 0; i < size; i++) \
+- { \
+- LOG(0, 0, t, " %s\n", strings[i]); \
+- } \
+- free(strings); \
+-}
+-
+
+ extern configt *config;
+ extern time_t basetime; // Time when this process started.
+diff -urN orig/l2tpns-2.1.14/ppp.c l2tpns-2.1.14/ppp.c
+--- orig/l2tpns-2.1.14/ppp.c 2005-12-07 06:21:37.000000000 +0100
++++ l2tpns-2.1.14/ppp.c 2005-12-14 07:43:08.000000000 +0100
+@@ -1755,9 +1755,7 @@
+ {
+ if (size < 12) // Need more space than this!!
+ {
+- static int backtrace_count = 0;
+ LOG(0, s, t, "makeppp buffer too small for L2TP header (size=%d)\n", size);
+- log_backtrace(backtrace_count, 5)
+ return NULL;
+ }
+
+@@ -1780,9 +1778,7 @@
+
+ if (l + 12 > size)
+ {
+- static int backtrace_count = 0;
+ LOG(2, s, t, "makeppp would overflow buffer (size=%d, header+payload=%d)\n", size, l + 12);
+- log_backtrace(backtrace_count, 5)
+ return NULL;
+ }
+
diff --git a/package/lame/Config.in b/package/lame/Config.in
new file mode 100644
index 000000000..40d9e5b9e
--- /dev/null
+++ b/package/lame/Config.in
@@ -0,0 +1,12 @@
+config ADK_COMPILE_LAME
+ boolean
+ default n
+ help
+
+config ADK_PACKAGE_LAME
+ prompt "lame.............................. MP3 encoder"
+ tristate
+ default n
+ select ADK_COMPILE_LAME
+ help
+ http://lame.sourceforge.net
diff --git a/package/lame/Config.in.lib b/package/lame/Config.in.lib
new file mode 100644
index 000000000..5e0cee53d
--- /dev/null
+++ b/package/lame/Config.in.lib
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_LIBLAME
+ prompt "liblame........................... MP3 encoding library"
+ tristate
+ default n
+ select ADK_COMPILE_LAME
+ help
+ http://lame.sourceforge.net
diff --git a/package/lame/Makefile b/package/lame/Makefile
new file mode 100644
index 000000000..f60c0eaa8
--- /dev/null
+++ b/package/lame/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= lame
+PKG_VERSION:= 398-2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 719dae0ee675d0c16e0e89952930ed35
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=lame/}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LAME,lame,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIBLAME,liblame,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_LAME)/usr/bin
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/lame $(IDIR_LAME)/usr/bin/
+ $(INSTALL_DIR) $(IDIR_LIBLAME)/usr/lib
+ $(CP) $(WRKINST)/usr/lib/lib*.so* $(IDIR_LIBLAME)/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/lame/ipkg/lame.control b/package/lame/ipkg/lame.control
new file mode 100644
index 000000000..605416094
--- /dev/null
+++ b/package/lame/ipkg/lame.control
@@ -0,0 +1,5 @@
+Package: lame
+Priority: optional
+Section: sound
+Depends: ncurses
+Description: LAME MP3 encoder
diff --git a/package/lame/ipkg/liblame.control b/package/lame/ipkg/liblame.control
new file mode 100644
index 000000000..1ce78f175
--- /dev/null
+++ b/package/lame/ipkg/liblame.control
@@ -0,0 +1,4 @@
+Package: liblame
+Priority: optional
+Section: sound
+Description: LAME MP3 encoding library
diff --git a/package/less/Config.in b/package/less/Config.in
new file mode 100644
index 000000000..4d3d44edb
--- /dev/null
+++ b/package/less/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LESS
+ prompt "less.............................. A text file viewer."
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ less - less is a pager. A pager usually displays text files.
+
+ http://www.greenwoodsoftware.com/less/
+
diff --git a/package/less/Makefile b/package/less/Makefile
new file mode 100644
index 000000000..59f643965
--- /dev/null
+++ b/package/less/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= less
+PKG_VERSION:= 381
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 40c2dd4ac137b61b6a55a6478817daf4
+MASTER_SITES:= http://www.greenwoodsoftware.com/less/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LESS,less,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --without-regex
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LESS}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/less ${IDIR_LESS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/less/ipkg/less.control b/package/less/ipkg/less.control
new file mode 100644
index 000000000..dbf4e4fa7
--- /dev/null
+++ b/package/less/ipkg/less.control
@@ -0,0 +1,5 @@
+Package: less
+Priority: optional
+Section: misc
+Depends: libncurses
+Description: A text mode pager
diff --git a/package/libICE/Config.in b/package/libICE/Config.in
new file mode 100644
index 000000000..446b50b31
--- /dev/null
+++ b/package/libICE/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBICE
+ prompt "libICE.................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libICE/Makefile b/package/libICE/Makefile
new file mode 100644
index 000000000..8a0b79c37
--- /dev/null
+++ b/package/libICE/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libICE
+PKG_VERSION:= 1.0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d80aab5b32434251cf4732f0e760e9d8
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBICE,libice,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBICE}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libICE.so* ${IDIR_LIBICE}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libICE/ipkg/libice.control b/package/libICE/ipkg/libice.control
new file mode 100644
index 000000000..471ce8d5c
--- /dev/null
+++ b/package/libICE/ipkg/libice.control
@@ -0,0 +1,4 @@
+Package: libice
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libSM/Config.in b/package/libSM/Config.in
new file mode 100644
index 000000000..650563a61
--- /dev/null
+++ b/package/libSM/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBSM
+ prompt "libSM................................... X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libSM/Makefile b/package/libSM/Makefile
new file mode 100644
index 000000000..25b4364dd
--- /dev/null
+++ b/package/libSM/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libSM
+PKG_VERSION:= 1.1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 39ee8e9dfbb2c1788629066ce796df22
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBSM,libsm,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBSM}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libSM.so* ${IDIR_LIBSM}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libSM/ipkg/libsm.control b/package/libSM/ipkg/libsm.control
new file mode 100644
index 000000000..f74b397cb
--- /dev/null
+++ b/package/libSM/ipkg/libsm.control
@@ -0,0 +1,4 @@
+Package: libsm
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libX11/Config.in b/package/libX11/Config.in
new file mode 100644
index 000000000..d83aa266d
--- /dev/null
+++ b/package/libX11/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_LIBX11
+ prompt "libX11................................. X library"
+ tristate
+ select ADK_PACKAGE_LIBXDMCP
+ default n
+ help
+ http://www.x.org
diff --git a/package/libX11/Makefile b/package/libX11/Makefile
new file mode 100644
index 000000000..2709dd1f7
--- /dev/null
+++ b/package/libX11/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libX11
+PKG_VERSION:= 1.1.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2feb39a0de6f05b25c308268691d960c
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBX11,libx11,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-xlocale \
+ --disable-xf86bigfont \
+ --disable-malloc0returnsnull \
+ --without-xcb
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBX11}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libX11.so* ${IDIR_LIBX11}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libX11/ipkg/libx11.control b/package/libX11/ipkg/libx11.control
new file mode 100644
index 000000000..5a71847b3
--- /dev/null
+++ b/package/libX11/ipkg/libx11.control
@@ -0,0 +1,4 @@
+Package: libx11
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libX11/patches/patch-src_util_Makefile_in b/package/libX11/patches/patch-src_util_Makefile_in
new file mode 100644
index 000000000..3a5366af1
--- /dev/null
+++ b/package/libX11/patches/patch-src_util_Makefile_in
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libX11-1.1.5.orig/src/util/Makefile.in 2008-09-04 23:48:56.000000000 +0200
++++ libX11-1.1.5/src/util/Makefile.in 2008-12-22 13:41:42.000000000 +0100
+@@ -82,7 +82,7 @@ BIGFONT_CFLAGS = @BIGFONT_CFLAGS@
+ BIGFONT_LIBS = @BIGFONT_LIBS@
+ CC = @CC@
+ CCDEPMODE = @CCDEPMODE@
+-CFLAGS = @CFLAGS@
++CFLAGS = -O2
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CXX = @CXX@
+@@ -229,7 +229,7 @@ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ makekeys_CFLAGS = $(X11_CFLAGS)
+
+-#override CC = gcc
++override CC = gcc
+ LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ EXTRA_DIST = mkks.sh
+
diff --git a/package/libX11/patches/patch-src_util_Makefile_in.orig b/package/libX11/patches/patch-src_util_Makefile_in.orig
new file mode 100644
index 000000000..fb4885f40
--- /dev/null
+++ b/package/libX11/patches/patch-src_util_Makefile_in.orig
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libX11-1.1.5.orig/src/util/Makefile.in 2008-09-04 23:48:56.000000000 +0200
++++ libX11-1.1.5/src/util/Makefile.in 2008-12-22 13:39:31.000000000 +0100
+@@ -229,7 +229,7 @@ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ makekeys_CFLAGS = $(X11_CFLAGS)
+
+-#override CC = gcc
++override CC = gcc
+ LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ EXTRA_DIST = mkks.sh
+
diff --git a/package/libXau/Config.in b/package/libXau/Config.in
new file mode 100644
index 000000000..682e225e7
--- /dev/null
+++ b/package/libXau/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXAU
+ prompt "libXau................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXau/Makefile b/package/libXau/Makefile
new file mode 100644
index 000000000..af0d66956
--- /dev/null
+++ b/package/libXau/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXau
+PKG_VERSION:= 1.0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 77c3de874155456c857b331063ad2fd9
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXAU,libxau,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXAU}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXau.so* ${IDIR_LIBXAU}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXau/ipkg/libxau.control b/package/libXau/ipkg/libxau.control
new file mode 100644
index 000000000..cac514db8
--- /dev/null
+++ b/package/libXau/ipkg/libxau.control
@@ -0,0 +1,4 @@
+Package: libxau
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXaw/Config.in b/package/libXaw/Config.in
new file mode 100644
index 000000000..713a26ab9
--- /dev/null
+++ b/package/libXaw/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXAW
+ prompt "libXaw................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXaw/Makefile b/package/libXaw/Makefile
new file mode 100644
index 000000000..cb757b3c2
--- /dev/null
+++ b/package/libXaw/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXaw
+PKG_VERSION:= 1.0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d27375737f323849cf7ca2fa8566afa5
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXAW,libxaw,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXAW}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXaw.so* ${IDIR_LIBXAW}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXaw/ipkg/libxaw.control b/package/libXaw/ipkg/libxaw.control
new file mode 100644
index 000000000..75e476c94
--- /dev/null
+++ b/package/libXaw/ipkg/libxaw.control
@@ -0,0 +1,4 @@
+Package: libxaw
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXdmcp/Config.in b/package/libXdmcp/Config.in
new file mode 100644
index 000000000..a62285364
--- /dev/null
+++ b/package/libXdmcp/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXDMCP
+ prompt "libXdmcp............................... X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXdmcp/Makefile b/package/libXdmcp/Makefile
new file mode 100644
index 000000000..1cb6245b2
--- /dev/null
+++ b/package/libXdmcp/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXdmcp
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a7e23f356a2b4fe8668f9ff4a2b0413a
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXDMCP,libxdmcp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXDMCP}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXdmcp.so* ${IDIR_LIBXDMCP}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXdmcp/ipkg/libxdmcp.control b/package/libXdmcp/ipkg/libxdmcp.control
new file mode 100644
index 000000000..740edcfba
--- /dev/null
+++ b/package/libXdmcp/ipkg/libxdmcp.control
@@ -0,0 +1,4 @@
+Package: libxdmcp
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXext/Config.in b/package/libXext/Config.in
new file mode 100644
index 000000000..1110918f5
--- /dev/null
+++ b/package/libXext/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXEXT
+ prompt "libXext................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXext/Makefile b/package/libXext/Makefile
new file mode 100644
index 000000000..27ba0cae0
--- /dev/null
+++ b/package/libXext/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXext
+PKG_VERSION:= 1.0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b7749174f9b3c3227bcbabc9ffb7d1a9
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXEXT,libxext,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-malloc0returnsnull
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXEXT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXext.so* ${IDIR_LIBXEXT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXext/ipkg/libxext.control b/package/libXext/ipkg/libxext.control
new file mode 100644
index 000000000..44a712bb7
--- /dev/null
+++ b/package/libXext/ipkg/libxext.control
@@ -0,0 +1,4 @@
+Package: libxext
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXfont/Config.in b/package/libXfont/Config.in
new file mode 100644
index 000000000..68aacfc92
--- /dev/null
+++ b/package/libXfont/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXFONT
+ prompt "libxfont................................ X keyboard library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXfont/Makefile b/package/libXfont/Makefile
new file mode 100644
index 000000000..8f0d925a7
--- /dev/null
+++ b/package/libXfont/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXfont
+PKG_VERSION:= 1.3.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cb202f7b1af5fc95a7f35f0a62e52e6e
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXFONT,libxfont,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXFONT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXfont.so* ${IDIR_LIBXFONT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXfont/ipkg/libxfont.control b/package/libXfont/ipkg/libxfont.control
new file mode 100644
index 000000000..f622a838e
--- /dev/null
+++ b/package/libXfont/ipkg/libxfont.control
@@ -0,0 +1,4 @@
+Package: libxfont
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXmu/Config.in b/package/libXmu/Config.in
new file mode 100644
index 000000000..99cf0d08e
--- /dev/null
+++ b/package/libXmu/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXMU
+ prompt "libXmu................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXmu/Makefile b/package/libXmu/Makefile
new file mode 100644
index 000000000..c75f945fb
--- /dev/null
+++ b/package/libXmu/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXmu
+PKG_VERSION:= 1.0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 48b432e84035c664ece80a33695d5254
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXMU,libxmu,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+#CONFIGURE_ARGS+= --disable-malloc0returnsnull
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXMU}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXmu.so* ${IDIR_LIBXMU}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXmu/ipkg/libxmu.control b/package/libXmu/ipkg/libxmu.control
new file mode 100644
index 000000000..73545b280
--- /dev/null
+++ b/package/libXmu/ipkg/libxmu.control
@@ -0,0 +1,4 @@
+Package: libxmu
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXpm/Config.in b/package/libXpm/Config.in
new file mode 100644
index 000000000..8fc79245a
--- /dev/null
+++ b/package/libXpm/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXPM
+ prompt "libXpm................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXpm/Makefile b/package/libXpm/Makefile
new file mode 100644
index 000000000..27dd66e32
--- /dev/null
+++ b/package/libXpm/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXpm
+PKG_VERSION:= 3.5.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7bbc8f112f7143ed6961a58ce4e14558
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXPM,libxpm,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+TCFLAGS+= -lintl
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXPM}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXpm.so* ${IDIR_LIBXPM}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXpm/ipkg/libxpm.control b/package/libXpm/ipkg/libxpm.control
new file mode 100644
index 000000000..276bd3db6
--- /dev/null
+++ b/package/libXpm/ipkg/libxpm.control
@@ -0,0 +1,4 @@
+Package: libxpm
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXt/Config.in b/package/libXt/Config.in
new file mode 100644
index 000000000..b1c4a76f3
--- /dev/null
+++ b/package/libXt/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXT
+ prompt "libXt................................... X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXt/Makefile b/package/libXt/Makefile
new file mode 100644
index 000000000..0253f29f8
--- /dev/null
+++ b/package/libXt/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXt
+PKG_VERSION:= 1.0.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 666305c8a2b825b276b3412d8c0d2273
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXT,libxt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-malloc0returnsnull \
+ --disable-install-makestrs
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXt.so* ${IDIR_LIBXT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXt/ipkg/libxt.control b/package/libXt/ipkg/libxt.control
new file mode 100644
index 000000000..a2c6ff188
--- /dev/null
+++ b/package/libXt/ipkg/libxt.control
@@ -0,0 +1,4 @@
+Package: libxt
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libXt/patches/patch-util_Makefile_in b/package/libXt/patches/patch-util_Makefile_in
new file mode 100644
index 000000000..b408db791
--- /dev/null
+++ b/package/libXt/patches/patch-util_Makefile_in
@@ -0,0 +1,24 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libXt-1.0.5.orig/util/Makefile.in 2007-01-28 07:31:13.000000000 +0100
++++ libXt-1.0.5/util/Makefile.in 2009-05-15 16:39:05.000000000 +0200
+@@ -92,9 +92,9 @@ AUTOCONF = @AUTOCONF@
+ AUTOHEADER = @AUTOHEADER@
+ AUTOMAKE = @AUTOMAKE@
+ AWK = @AWK@
+-CC = @CC@
++CC = $(HOSTCC)
+ CCDEPMODE = @CCDEPMODE@
+-CFLAGS = @CFLAGS@
++CFLAGS = $(HOSTCFLAGS)
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CXX = @CXX@
+@@ -123,7 +123,7 @@ INSTALL_MAKESTRS_TRUE = @INSTALL_MAKESTR
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+-LDFLAGS = @LDFLAGS@
++LDFLAGS = $(HOSTLDFLAGS)
+ LIBOBJS = @LIBOBJS@
+ LIBS = @LIBS@
+ LIBTOOL = @LIBTOOL@
diff --git a/package/libXxf86dga/Config.in b/package/libXxf86dga/Config.in
new file mode 100644
index 000000000..3c4a0c313
--- /dev/null
+++ b/package/libXxf86dga/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXXF86DGA
+ prompt "libXxf86dga................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libXxf86dga/Makefile b/package/libXxf86dga/Makefile
new file mode 100644
index 000000000..a8e4e526d
--- /dev/null
+++ b/package/libXxf86dga/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libXxf86dga
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 704501402a277258ffc878e821357ad4
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXXF86DGA,libxxf86dga,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-malloc0returnsnull
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXXF86DGA}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libXxf86dga.so* ${IDIR_LIBXXF86DGA}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libXxf86dga/ipkg/libxxf86dga.control b/package/libXxf86dga/ipkg/libxxf86dga.control
new file mode 100644
index 000000000..51e7a1e9b
--- /dev/null
+++ b/package/libXxf86dga/ipkg/libxxf86dga.control
@@ -0,0 +1,4 @@
+Package: libxxf86dga
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libao/Config.in b/package/libao/Config.in
new file mode 100644
index 000000000..2509b6b1a
--- /dev/null
+++ b/package/libao/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LIBAO
+ prompt "libao............................. A cross platform audio library"
+ tristate
+ default n
+ help
+ Libao is a cross-platform audio library that allows programs to
+ output audio using a simple API on a wide variety of platforms.
+
+ http://www.xiph.org/ao/
+
diff --git a/package/libao/Makefile b/package/libao/Makefile
new file mode 100644
index 000000000..1cb4494e5
--- /dev/null
+++ b/package/libao/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libao
+PKG_VERSION:= 0.8.6
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 12e136a4c0995068ff134997c84421ed
+MASTER_SITES:= http://downloads.xiph.org/releases/ao/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBAO,libao,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-esd \
+ --disable-arts \
+ --disable-nas \
+ --disable-polyp
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBAO}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libao.so.* ${IDIR_LIBAO}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libao/ipkg/libao.control b/package/libao/ipkg/libao.control
new file mode 100644
index 000000000..510392922
--- /dev/null
+++ b/package/libao/ipkg/libao.control
@@ -0,0 +1,4 @@
+Package: libao
+Priority: optional
+Section: libs
+Description: A cross platform audio library
diff --git a/package/libart/Config.in b/package/libart/Config.in
new file mode 100644
index 000000000..477bcc63e
--- /dev/null
+++ b/package/libart/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_LIBART
+ prompt "libart............................ An high-performance 2D graphics library"
+ tristate
+ default n
+ help
+ A library of functions for 2D graphics supporting a superset of the
+ PostScript imaging model, designed to be integrated with graphics, artwork,
+ and illustration programs. It is written in optimized C, and is fully
+ compatible with C++. With a small footprint of 10,000 lines of code, it is
+ especially suitable for embedded applications.
+
+ http://www.levien.com/libart/
diff --git a/package/libart/Makefile b/package/libart/Makefile
new file mode 100644
index 000000000..a579a7338
--- /dev/null
+++ b/package/libart/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libart
+PKG_VERSION:= 2.3.17
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f1f6b3e5490f382535dccb288f5d8b14
+MASTER_SITES:= ${MASTER_SITE_GNOME:=libart_lgpl/2.3/}
+DISTFILES:= ${PKG_NAME}_lgpl-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/${PKG_NAME}_lgpl-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBART,libart,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBART}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libart_lgpl_2.so.* ${IDIR_LIBART}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libart/ipkg/libart.control b/package/libart/ipkg/libart.control
new file mode 100644
index 000000000..42d9523ad
--- /dev/null
+++ b/package/libart/ipkg/libart.control
@@ -0,0 +1,9 @@
+Package: libart
+Priority: optional
+Section: libs
+Description: An high-performance 2D graphics library.
+ A library of functions for 2D graphics supporting a superset of the
+ PostScript imaging model, designed to be integrated with graphics, artwork,
+ and illustration programs. It is written in optimized C, and is fully
+ compatible with C++. With a small footprint of 10,000 lines of code, it is
+ especially suitable for embedded applications.
diff --git a/package/libart/patches/100-cross_compile_fix.patch b/package/libart/patches/100-cross_compile_fix.patch
new file mode 100644
index 000000000..aae1acccf
--- /dev/null
+++ b/package/libart/patches/100-cross_compile_fix.patch
@@ -0,0 +1,15 @@
+diff -urN libart.old/Makefile.in libart.dev/Makefile.in
+--- libart.old/Makefile.in 2005-01-21 10:52:11.000000000 +0100
++++ libart.dev/Makefile.in 2005-07-17 19:31:05.000000000 +0200
+@@ -440,9 +440,9 @@
+ @rm -f testuta$(EXEEXT)
+ $(LINK) $(testuta_LDFLAGS) $(testuta_OBJECTS) $(testuta_LDADD) $(LIBS)
+
+-gen_art_config$(EXEEXT): $(gen_art_config_OBJECTS) $(gen_art_config_DEPENDENCIES)
++gen_art_config$(EXEEXT):
+ @rm -f gen_art_config$(EXEEXT)
+- $(LINK) $(gen_art_config_LDFLAGS) $(gen_art_config_OBJECTS) $(gen_art_config_LDADD) $(LIBS)
++ $(HOSTCC) -I. -DLIBART_COMPILATION -DHAVE_CONFIG_H -o $@ gen_art_config.c
+
+ install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
diff --git a/package/libaudiofile/Config.in b/package/libaudiofile/Config.in
new file mode 100644
index 000000000..ebe0d4b8b
--- /dev/null
+++ b/package/libaudiofile/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_LIBAUDIOFILE
+ prompt "libaudiofile...................... An open-source version of SGI's audiofile library"
+ tristate
+ default n
+ help
+ The audiofile library allows the processing of audio data to and from audio
+ files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun, BICS,
+ and raw data).
diff --git a/package/libaudiofile/Makefile b/package/libaudiofile/Makefile
new file mode 100644
index 000000000..2290776e4
--- /dev/null
+++ b/package/libaudiofile/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libaudiofile
+PKG_VERSION:= 0.2.6
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 460f848ce5f4a33ae66b15a4fb7720ec
+MASTER_SITES:= http://www.freewrt.org/distfiles/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBAUDIOFILE,libaudiofile,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_linux_vers=2
+CONFIGURE_ARGS+= --with-build-cc=${HOSTCC}
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBAUDIOFILE}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libaudiofile.so.* ${IDIR_LIBAUDIOFILE}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libaudiofile/ipkg/libaudiofile.control b/package/libaudiofile/ipkg/libaudiofile.control
new file mode 100644
index 000000000..b9ba5e184
--- /dev/null
+++ b/package/libaudiofile/ipkg/libaudiofile.control
@@ -0,0 +1,4 @@
+Package: libaudiofile
+Priority: optional
+Section: libs
+Description: Open-source version of SGI's audiofile library
diff --git a/package/libaudiofile/patches/001-audiofile-config-libdirs.patch b/package/libaudiofile/patches/001-audiofile-config-libdirs.patch
new file mode 100644
index 000000000..ba92d7d4e
--- /dev/null
+++ b/package/libaudiofile/patches/001-audiofile-config-libdirs.patch
@@ -0,0 +1,13 @@
+--- libaudiofile-0.2.6/audiofile-config.in.orig 2004-03-06 07:39:23.000000000 +0100
++++ libaudiofile-0.2.6/audiofile-config.in 2005-12-13 14:15:52.000000000 +0100
+@@ -45,7 +45,9 @@
+ echo $includes
+ ;;
+ --libs)
+- libdirs=-L@libdir@
++ if test @libdir@ != /usr/libdir ; then
++ libdirs=-L@libdir@
++ fi
+ echo $libdirs -laudiofile -lm
+ ;;
+ *)
diff --git a/package/libcli/Config.in b/package/libcli/Config.in
new file mode 100644
index 000000000..cfec7e4a2
--- /dev/null
+++ b/package/libcli/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_LIBCLI
+ prompt "libcli............................ A Cisco-like command line interface"
+ tristate
+ default n
+ help
+ Provides a shared library for including a Cisco-like
+ command-line interface into other software. It's a telnet
+ interface which supports command-line editing, history,
+ authentication and callbacks for a user-definable function tree
+
+ http://libcli.sourceforge.net/
diff --git a/package/libcli/Makefile b/package/libcli/Makefile
new file mode 100755
index 000000000..e4d42346c
--- /dev/null
+++ b/package/libcli/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libcli
+PKG_VERSION:= 1.8.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= fde7103a3771f550bfd366ee3ca1ef53
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=libcli/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBCLI,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBCLI}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libcli.so.* ${IDIR_LIBCLI}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libcli/ipkg/libcli.control b/package/libcli/ipkg/libcli.control
new file mode 100755
index 000000000..6ef456b59
--- /dev/null
+++ b/package/libcli/ipkg/libcli.control
@@ -0,0 +1,5 @@
+Package: libcli
+Section: libs
+Architecture: mipsel
+Priority: optional
+Description: Provides a shared library for including a Cisco-like command-line interface into other software. \ No newline at end of file
diff --git a/package/libcli/patches/patch-Makefile b/package/libcli/patches/patch-Makefile
new file mode 100644
index 000000000..26f11e041
--- /dev/null
+++ b/package/libcli/patches/patch-Makefile
@@ -0,0 +1,23 @@
+$Id$
+allow CFLAGS overwrite, change some defaults
+--- libcli-1.8.6.orig/Makefile 2006-03-07 00:13:11.000000000 +0100
++++ libcli-1.8.6/Makefile 2007-01-07 21:27:49.000000000 +0100
+@@ -1,14 +1,14 @@
+ DESTDIR =
+-PREFIX = /usr/local
++PREFIX = /usr
+
+ MAJOR = 1
+ MINOR = 8
+ REVISION = 6
+ LIB = libcli.so
+
+-CC = gcc
+-DEBUG = -g
+-OPTIM = -O3
++#CC := gcc
++#DEBUG = -g
++#OPTIM = -O3
+ CFLAGS += $(DEBUG) $(OPTIM) -Wall -Wformat-security -Wno-format-zero-length
+ LDFLAGS += -shared -Wl,-soname,$(LIB).$(MAJOR).$(MINOR)
+ LIBPATH += -L.
diff --git a/package/libdaemon/Config.in b/package/libdaemon/Config.in
new file mode 100644
index 000000000..e19d50ef9
--- /dev/null
+++ b/package/libdaemon/Config.in
@@ -0,0 +1,19 @@
+config ADK_PACKAGE_LIBDAEMON
+ prompt "libdaemon......................... A lightweight C library that eases the writing of UNIX daemons"
+ tristate
+ default n
+ help
+ libdaemon is a lightweight C library that eases the writing of UNIX daemons.
+ It consists of the following parts:
+
+ * A wrapper around fork() which does the correct daemonization procedure of a process
+ * A wrapper around syslog() for simpler and compatible log output to Syslog or STDERR
+ * An API for writing PID files
+ * An API for serializing UNIX signals into a pipe for usage with select() or poll()
+ * An API for running subprocesses with STDOUT and STDERR redirected to syslog.
+
+ APIs like these are used in most daemon software available. It is not that
+ simple to get it done right and code duplication is not a goal.
+
+ http://0pointer.de/lennart/projects/libdaemon/
+
diff --git a/package/libdaemon/Makefile b/package/libdaemon/Makefile
new file mode 100644
index 000000000..cf61b8328
--- /dev/null
+++ b/package/libdaemon/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libdaemon
+PKG_VERSION:= 0.10
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 6812a5e4063b5016f25e9a0cebbd3dd9
+MASTER_SITES:= http://0pointer.de/lennart/projects/libdaemon/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBDAEMON,libdaemon,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_setpgrp_void=yes
+CONFIGURE_ARGS+= --disable-lynx
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBDAEMON}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libdaemon.so.* ${IDIR_LIBDAEMON}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libdaemon/ipkg/libdaemon.control b/package/libdaemon/ipkg/libdaemon.control
new file mode 100644
index 000000000..3f5342224
--- /dev/null
+++ b/package/libdaemon/ipkg/libdaemon.control
@@ -0,0 +1,4 @@
+Package: libdaemon
+Priority: optional
+Section: libs
+Description: A lightweight C library that eases the writing of UNIX daemons.
diff --git a/package/libdb/Config.in b/package/libdb/Config.in
new file mode 100644
index 000000000..f8360bee8
--- /dev/null
+++ b/package/libdb/Config.in
@@ -0,0 +1,15 @@
+config ADK_COMPILE_DB
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBDB
+
+config ADK_PACKAGE_LIBDB
+ prompt "libdb............................. Berkeley DB"
+ tristate
+ default n
+ select ADK_COMPILE_DB
+ help
+ disk file format database which stores key/data-pairs in single files.
+
+ http://www.sleepycat.com/products/db.shtml
+
diff --git a/package/libdb/Makefile b/package/libdb/Makefile
new file mode 100644
index 000000000..01bb31039
--- /dev/null
+++ b/package/libdb/Makefile
@@ -0,0 +1,80 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libdb
+PKG_VERSION:= 4.7.25
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ec2b87e833779681a0c3a814aa71359e
+MASTER_SITES:= http://www.oracle.com/technology/software/products/berkeley-db/
+DISTFILES:= db-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/db-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBDB,libdb,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifeq ($(DEBUG),1)
+PKG_CONFIGURE:= --enable-debug
+else
+PKG_CONFIGURE:= --disable-debug
+endif
+
+do-configure:
+ (cd ${WRKBUILD}/build_unix ; \
+ ${TARGET_CONFIGURE_OPTS} \
+ CFLAGS="${TARGET_CFLAGS_ARCH} -pipe" \
+ CPPFLAGS="-I${STAGING_DIR}/usr/include" \
+ LDFLAGS="-L${STAGING_DIR}/usr/lib" \
+ ../dist/configure \
+ --target=${GNU_TARGET_NAME} \
+ --host=${GNU_TARGET_NAME} \
+ --build=${GNU_HOST_NAME} \
+ --program-prefix="" \
+ --program-suffix="" \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=/usr/share \
+ --includedir=/usr/include \
+ --infodir=/usr/share/info \
+ --libdir=/usr/lib \
+ --libexecdir=/usr/lib \
+ --localstatedir=/var \
+ --mandir=/usr/share/man \
+ --sbindir=/usr/sbin \
+ --sysconfdir=/etc \
+ --disable-nls \
+ --enable-shared \
+ --enable-static \
+ --enable-smallbuild \
+ --disable-debug_rop \
+ --disable-debug_wop \
+ --disable-diagnostic \
+ --disable-java \
+ --disable-cxx \
+ --disable-posixmutexes \
+ --disable-uimutexes \
+ --disable-tcl \
+ --disable-rpc \
+ --disable-compat185 \
+ --disable-statistics \
+ --disable-replication \
+ --disable-cryptography \
+ --disable-queue \
+ --with-mutex=UNIX/fcntl \
+ ${PKG_CONFIGURE} \
+ );
+
+do-install:
+ ${MAKE} -C ${WRKBUILD}/build_unix \
+ DESTDIR="${WRKINST}" install
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBDB}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libdb*.so ${IDIR_LIBDB}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libdb/ipkg/libdb.control b/package/libdb/ipkg/libdb.control
new file mode 100644
index 000000000..28605c38f
--- /dev/null
+++ b/package/libdb/ipkg/libdb.control
@@ -0,0 +1,4 @@
+Package: libdb
+Priority: optional
+Section: libs
+Description: disk file format database which stores key/data-pairs in single files
diff --git a/package/libdnet/Config.in b/package/libdnet/Config.in
new file mode 100644
index 000000000..bef486d2d
--- /dev/null
+++ b/package/libdnet/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBDNET
+ prompt "libdnet........................... Low-level network library"
+ tristate
+ default n
+ help
+ simplified, portable interface to several low-level networking routines
+
+ http://sourceforge.net/projects/libdnet/
+
diff --git a/package/libdnet/Makefile b/package/libdnet/Makefile
new file mode 100644
index 000000000..8b25414bb
--- /dev/null
+++ b/package/libdnet/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libdnet
+PKG_VERSION:= 1.10
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 416b765e9d9961501ac85e9a366fd219
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=$(PKG_NAME)/}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBDNET,libdnet,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_dnet_bsd_bpf=no
+CONFIGURE_ARGS+= --without-check
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_LIBDNET)/usr/lib
+ $(INSTALL_DIR) $(IDIR_LIBDNET)/usr/sbin
+ $(CP) $(WRKINST)/usr/lib/libdnet.so.* $(IDIR_LIBDNET)/usr/lib/
+ $(INSTALL_BIN) $(WRKINST)/usr/sbin/dnet $(IDIR_LIBDNET)/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libdnet/ipkg/libdnet.control b/package/libdnet/ipkg/libdnet.control
new file mode 100644
index 000000000..cb7c6ac67
--- /dev/null
+++ b/package/libdnet/ipkg/libdnet.control
@@ -0,0 +1,4 @@
+Package: libdnet
+Priority: optional
+Section: libs
+Description: a low-level networking library
diff --git a/package/libdnet/patches/libdnet-1.10-dnet_config.patch b/package/libdnet/patches/libdnet-1.10-dnet_config.patch
new file mode 100644
index 000000000..005ac3305
--- /dev/null
+++ b/package/libdnet/patches/libdnet-1.10-dnet_config.patch
@@ -0,0 +1,23 @@
+--- libdnet-1.10/dnet-config.in.orig 2001-10-19 03:29:00.000000000 +0200
++++ libdnet-1.10/dnet-config.in 2005-09-20 09:32:53.000000000 +0200
+@@ -45,10 +45,18 @@
+ done
+
+ if test "$echo_cflags" = "yes"; then
+- echo -I@includedir@
++ includes=
++ if test "@includedir@" != "/usr/include" ; then
++ includes=-I@includedir@
++ fi
++ echo $includes
+ fi
+
+ if test "$echo_libs" = "yes"; then
+- echo -L@libdir@ -ldnet @LIBS@
++ libs=
++ if test "@libdir@" != "/usr/lib" ; then
++ libs=-I@libdir@
++ fi
++ echo $libs -ldnet @LIBS@
+ fi
+
diff --git a/package/libelf/Config.in b/package/libelf/Config.in
new file mode 100644
index 000000000..3f2fa6024
--- /dev/null
+++ b/package/libelf/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LIBELF
+ prompt "libelf............................ ELF object file access library"
+ tristate
+ default n
+ help
+ This is the public release of libelf-0.8.5, a free ELF object
+ file access library.
+
+ http://www.stud.uni-hannover.de/~michael/software/
+
diff --git a/package/libelf/Makefile b/package/libelf/Makefile
new file mode 100644
index 000000000..920747eea
--- /dev/null
+++ b/package/libelf/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libelf
+PKG_VERSION:= 0.8.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 11904a77b948bcfab671e80100b6098d
+MASTER_SITES:= http://www.mr511.de/software/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBELF,libelf,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= mr_cv_target_elf=yes \
+ libelf_64bit=yes \
+ libelf_cv_struct_elf64_ehdr=yes \
+ libelf_cv_type_elf64_addr=no \
+ libelf_cv_struct_elf64_rel=yes \
+ ac_cv_sizeof_long_long=8
+CONFIGURE_ARGS+= --enable-elf64=yes
+BUILD_STYLE= auto
+INSTALL_STYLE= confprog auto
+FAKE_FLAGS+= instroot="${WRKINST}"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBELF}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libelf.so.* ${IDIR_LIBELF}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libelf/ipkg/libelf.control b/package/libelf/ipkg/libelf.control
new file mode 100644
index 000000000..804b02fd7
--- /dev/null
+++ b/package/libelf/ipkg/libelf.control
@@ -0,0 +1,4 @@
+Package: libelf
+Priority: optional
+Section: libs
+Description: a library for accessing ELF objects
diff --git a/package/libevent/Config.in b/package/libevent/Config.in
new file mode 100644
index 000000000..d0f91a2a9
--- /dev/null
+++ b/package/libevent/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_LIBEVENT
+ prompt "libevent.......................... Event notification library for event-driven network servers"
+ tristate
+ default n
+ help
+ The libevent API provides a mechanism to execute a callback function
+ when a specific event occurs on a file descriptor or after a timeout
+ has been reached. Furthermore, libevent also support callbacks due
+ to signals or regular timeouts.
+
+ libevent is meant to replace the event loop found in event driven
+ network servers. An application just needs to call event_dispatch()
+ and then add or remove events dynamically without having to change
+ the event loop.
+
+ http://www.monkey.org/~provos/libevent/
+
diff --git a/package/libevent/Makefile b/package/libevent/Makefile
new file mode 100644
index 000000000..37cc0cc04
--- /dev/null
+++ b/package/libevent/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libevent
+PKG_VERSION:= 1.3
+PKG_RELEASE:= 2
+PKG_MD5SUM:= d87b05143c6c2bc9464758e68e9c6e25
+MASTER_SITES:= http://www.monkey.org/~provos/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBEVENT,libevent,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_LIBEVENT)/usr/lib
+ $(CP) $(WRKINST)/usr/lib/libevent-$(PKG_VERSION).so.* \
+ $(IDIR_LIBEVENT)/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libevent/ipkg/libevent.control b/package/libevent/ipkg/libevent.control
new file mode 100644
index 000000000..31da5b27e
--- /dev/null
+++ b/package/libevent/ipkg/libevent.control
@@ -0,0 +1,4 @@
+Package: libevent
+Priority: optional
+Section: libs
+Description: Event notification library for event-driven network servers
diff --git a/package/libevent/patches/patch-Makefile_in b/package/libevent/patches/patch-Makefile_in
new file mode 100644
index 000000000..4b3517454
--- /dev/null
+++ b/package/libevent/patches/patch-Makefile_in
@@ -0,0 +1,45 @@
+$Id$
+ * sample does not compile
+--- libevent-1.3.orig/Makefile.in 2007-02-16 01:52:33.000000000 +0100
++++ libevent-1.3/Makefile.in 2007-02-18 02:12:04.000000000 +0100
+@@ -102,7 +102,7 @@ includeHEADERS_INSTALL = $(INSTALL_HEADE
+ HEADERS = $(include_HEADERS)
+ ETAGS = etags
+ CTAGS = ctags
+-DIST_SUBDIRS = . sample test
++DIST_SUBDIRS = .
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ distdir = $(PACKAGE)-$(VERSION)
+ top_distdir = $(distdir)
+@@ -227,11 +227,6 @@ EXTRA_DIST = acconfig.h event.h event-in
+ event.3 \
+ kqueue.c epoll_sub.c epoll.c select.c rtsig.c poll.c signal.c \
+ evport.c devpoll.c event_rpcgen.py \
+- sample/Makefile.am sample/Makefile.in sample/event-test.c \
+- sample/signal-test.c sample/time-test.c \
+- test/Makefile.am test/Makefile.in test/bench.c test/regress.c \
+- test/test-eof.c test/test-weof.c test/test-time.c \
+- test/test-init.c test/test.sh \
+ compat/sys/queue.h compat/sys/tree.h compat/sys/_time.h \
+ WIN32-Code/config.h WIN32-Code/misc.c \
+ WIN32-Code/win32.c WIN32-Code/misc.h \
+@@ -241,8 +236,8 @@ EXTRA_DIST = acconfig.h event.h event-in
+ WIN32-Prj/time_test/time_test.dsp
+
+ lib_LTLIBRARIES = libevent.la
+-@BUILD_WIN32_FALSE@SUBDIRS = . sample test
+-@BUILD_WIN32_TRUE@SUBDIRS = . sample
++@BUILD_WIN32_FALSE@SUBDIRS = .
++@BUILD_WIN32_TRUE@SUBDIRS = .
+ @BUILD_WIN32_FALSE@SYS_LIBS =
+ @BUILD_WIN32_TRUE@SYS_LIBS = -lws2_32
+ @BUILD_WIN32_FALSE@SYS_SRC =
+@@ -592,7 +587,7 @@ distclean-tags:
+ distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+- $(mkdir_p) $(distdir)/WIN32-Code $(distdir)/WIN32-Prj $(distdir)/WIN32-Prj/event_test $(distdir)/WIN32-Prj/signal_test $(distdir)/WIN32-Prj/time_test $(distdir)/compat/sys $(distdir)/sample $(distdir)/test
++ $(mkdir_p) $(distdir)/WIN32-Code $(distdir)/WIN32-Prj $(distdir)/WIN32-Prj/event_test $(distdir)/WIN32-Prj/signal_test $(distdir)/WIN32-Prj/time_test $(distdir)/compat/sys $(distdir)/test
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
diff --git a/package/libevent/patches/patch-evdns_c b/package/libevent/patches/patch-evdns_c
new file mode 100644
index 000000000..b08493c12
--- /dev/null
+++ b/package/libevent/patches/patch-evdns_c
@@ -0,0 +1,11 @@
+$Id$
+--- libevent-1.3.orig/evdns.c 2007-02-16 00:49:26.000000000 +0000
++++ libevent-1.3/evdns.c 2007-02-18 13:55:52.000000000 +0000
+@@ -44,6 +44,7 @@
+ #endif
+
+ //#define NDEBUG
++#undef NDEBUG
+
+ #ifndef DNS_USE_CPU_CLOCK_FOR_ID
+ #ifndef DNS_USE_GETTIMEOFDAY_FOR_ID
diff --git a/package/libevent/patches/patch-event_c b/package/libevent/patches/patch-event_c
new file mode 100644
index 000000000..3a7571cfd
--- /dev/null
+++ b/package/libevent/patches/patch-event_c
@@ -0,0 +1,18 @@
+$Id$
+
+ In uClibc, clock_gettime(2) is defined as user-space
+ function in <time.h> instead of <sys/time.h>, so we
+ need that as well. Candidate for sending to upstream.
+
+--- libevent-1.3.orig/event.c 2007-02-16 00:49:06.000000000 +0000
++++ libevent-1.3/event.c 2007-02-18 14:21:29.000000000 +0000
+@@ -51,6 +51,9 @@
+ #include <signal.h>
+ #include <string.h>
+ #include <assert.h>
++#ifdef __UCLIBC__
++#include <time.h>
++#endif
+
+ #include "event.h"
+ #include "event-internal.h"
diff --git a/package/libffi/Config.in b/package/libffi/Config.in
new file mode 100644
index 000000000..2186062ad
--- /dev/null
+++ b/package/libffi/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_LIBFFI
+ prompt "libffi.......................... Foreign Function Interface library"
+ tristate
+ default n
+ help
+ The libffi library provides a portable, high level programming
+ interface to various calling conventions. This allows a programmer to
+ call any function specified by a call interface description at run
+ time.
+
+ http://sources.redhat.com/libffi/
+
diff --git a/package/libffi/Makefile b/package/libffi/Makefile
new file mode 100644
index 000000000..83c03b2d9
--- /dev/null
+++ b/package/libffi/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libffi
+PKG_VERSION:= 3.0.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8994a7e0e8baeedf63e3d0d94d75ac68
+MASTER_SITES:= ftp://sourceware.org/pub/libffi/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBFFI,libffi,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= autotool gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBFFI}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libffi.so.* ${IDIR_LIBFFI}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libffi/ipkg/libffi.control b/package/libffi/ipkg/libffi.control
new file mode 100644
index 000000000..7e52b9cad
--- /dev/null
+++ b/package/libffi/ipkg/libffi.control
@@ -0,0 +1,4 @@
+Package: libffi
+Priority: optional
+Section: libs
+Description: Foreign Function Interface library
diff --git a/package/libffi/patches/patch-Makefile_am b/package/libffi/patches/patch-Makefile_am
new file mode 100644
index 000000000..d53ba2a76
--- /dev/null
+++ b/package/libffi/patches/patch-Makefile_am
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libffi-3.0.6.orig/Makefile.am 2008-02-21 14:36:18.000000000 +0100
++++ libffi-3.0.6/Makefile.am 2008-12-08 02:27:27.000000000 +0100
+@@ -68,6 +68,7 @@ AM_MAKEFLAGS = \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "prefix=$(prefix)" \
++ "includesdir=$(prefix)/include" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "CC=$(CC)" \
diff --git a/package/libffi/patches/patch-include_Makefile_am b/package/libffi/patches/patch-include_Makefile_am
new file mode 100644
index 000000000..0b6ad70ab
--- /dev/null
+++ b/package/libffi/patches/patch-include_Makefile_am
@@ -0,0 +1,10 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libffi-3.0.6.orig/include/Makefile.am 2008-02-14 16:37:00.000000000 +0100
++++ libffi-3.0.6/include/Makefile.am 2008-12-08 02:20:25.000000000 +0100
+@@ -5,5 +5,5 @@ AUTOMAKE_OPTIONS=foreign
+ DISTCLEANFILES=ffitarget.h
+ EXTRA_DIST=ffi.h.in ffi_common.h
+
+-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
++includesdir = $(includesdir)
+ nodist_includes_HEADERS = ffi.h ffitarget.h
diff --git a/package/libfontenc/Config.in b/package/libfontenc/Config.in
new file mode 100644
index 000000000..1cf91edba
--- /dev/null
+++ b/package/libfontenc/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_LIBFONTENC
+ prompt "libfontenc.............................. X font encoding library"
+ tristate
+ select ADK_PACKAGE_XPROTO
+ select ADK_PACKAGE_ZLIB
+ default n
+ help
+ http://www.x.org
diff --git a/package/libfontenc/Makefile b/package/libfontenc/Makefile
new file mode 100644
index 000000000..0a750a3ad
--- /dev/null
+++ b/package/libfontenc/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libfontenc
+PKG_VERSION:= 1.0.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b7bb0887b702ab03251fd9fc361d0c58
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBFONTENC,libfontenc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBFONTENC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libfontenc.so* ${IDIR_LIBFONTENC}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libfontenc/ipkg/libfontenc.control b/package/libfontenc/ipkg/libfontenc.control
new file mode 100644
index 000000000..0a0db7a57
--- /dev/null
+++ b/package/libfontenc/ipkg/libfontenc.control
@@ -0,0 +1,4 @@
+Package: libfontenc
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libgcrypt/Config.in b/package/libgcrypt/Config.in
new file mode 100644
index 000000000..fb8a065a6
--- /dev/null
+++ b/package/libgcrypt/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_LIBGCRYPT
+ prompt "libgcrypt......................... The GNU crypto library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBGPG_ERROR
+ help
+ This is a general purpose cryptographic library based on the code from
+ GnuPG. It provides functions for all cryptograhic building blocks:
+ symmetric ciphers (AES, DES, Blowfish, CAST5, Twofish, Arcfour), hash
+ algorithms (MD4, MD5, RIPE-MD160, SHA-1, TIGER-192), MACs (HMAC for all
+ hash algorithms), public key algorithms (RSA, ElGamal, DSA), large
+ integer functions, random numbers and a lot of supporting functions.
+
+ http://directory.fsf.org/security/libgcrypt.html
+
diff --git a/package/libgcrypt/Makefile b/package/libgcrypt/Makefile
new file mode 100644
index 000000000..789466831
--- /dev/null
+++ b/package/libgcrypt/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libgcrypt
+PKG_VERSION:= 1.4.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 555488ddfc81a6e0df1fb5112e7eee13
+MASTER_SITES:= ftp://ftp.gnupg.org/gcrypt/libgcrypt/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBGCRYPT,libgcrypt,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-asm \
+ --with-gpg-error-prefix="${STAGING_DIR}/usr"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBGCRYPT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgcrypt.so.* ${IDIR_LIBGCRYPT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libgcrypt/ipkg/libgcrypt.control b/package/libgcrypt/ipkg/libgcrypt.control
new file mode 100644
index 000000000..8cf2b303f
--- /dev/null
+++ b/package/libgcrypt/ipkg/libgcrypt.control
@@ -0,0 +1,6 @@
+Package: libgcrypt
+Priority: optional
+Section: libs
+Description: GNU crypto library
+Depends: libgpg-error
+
diff --git a/package/libgd/Config.in b/package/libgd/Config.in
new file mode 100644
index 000000000..af20a95a2
--- /dev/null
+++ b/package/libgd/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_LIBGD
+ prompt "libgd............................. The GD Graphics Library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBJPEG
+ select ADK_PACKAGE_LIBPNG
+ help
+ The GD Graphics Library
+
+ http://www.libgd.org/
+
diff --git a/package/libgd/Makefile b/package/libgd/Makefile
new file mode 100644
index 000000000..adc3b780f
--- /dev/null
+++ b/package/libgd/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= gd
+PKG_VERSION:= 2.0.35
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 982963448dc36f20cb79b6e9ba6fdede
+MASTER_SITES:= http://www.libgd.org/releases/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBGD,libgd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= LIBPNG12_CONFIG="${STAGING_DIR}/usr/bin/libpng12-config"
+CONFIGURE_ARGS+= --without-x \
+ --without-freetype \
+ --with-jpeg=${STAGING_DIR}/usr \
+ --with-png=${STAGING_DIR}/usr \
+ --without-xpm
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBGD}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgd.so.* ${IDIR_LIBGD}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libgd/ipkg/libgd.control b/package/libgd/ipkg/libgd.control
new file mode 100644
index 000000000..f6a78e5c3
--- /dev/null
+++ b/package/libgd/ipkg/libgd.control
@@ -0,0 +1,5 @@
+Package: libgd
+Priority: optional
+Section: libs
+Depends: libjpeg, libpng
+Description: A library for the dynamic creation of images
diff --git a/package/libgd/patches/patch-Makefile_in b/package/libgd/patches/patch-Makefile_in
new file mode 100644
index 000000000..c36a6b4a6
--- /dev/null
+++ b/package/libgd/patches/patch-Makefile_in
@@ -0,0 +1,29 @@
+$Id$
+--- gd-2.0.34.orig/Makefile.in 2007-02-03 02:41:46.000000000 +0100
++++ gd-2.0.34/Makefile.in 2007-02-20 20:56:27.000000000 +0100
+@@ -78,7 +78,7 @@ am_libgd_la_OBJECTS = gd.lo gdfx.lo gd_s
+ gd_io.lo gd_io_dp.lo gd_gif_in.lo gd_gif_out.lo gd_io_file.lo \
+ gd_io_ss.lo gd_jpeg.lo gd_png.lo gd_ss.lo gd_topal.lo \
+ gd_wbmp.lo gdcache.lo gdfontg.lo gdfontl.lo gdfontmb.lo \
+- gdfonts.lo gdfontt.lo gdft.lo gdhelpers.lo gdkanji.lo \
++ gdfonts.lo gdfontt.lo gdft.lo gdhelpers.lo \
+ gdtables.lo gdxpm.lo wbmp.lo
+ libgd_la_OBJECTS = $(am_libgd_la_OBJECTS)
+ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+@@ -344,7 +344,7 @@ bin_SCRIPTS = bdftogd config/gdlib-confi
+ EXTRA_DIST = README-JPEG.TXT README.TXT configure.pl bdftogd demoin.png err.out index.html install-item makefile.sample readme.jpn entities.html entities.tcl
+ include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h entities.h
+ lib_LTLIBRARIES = libgd.la
+-libgd_la_SOURCES = gd.c gdfx.c gd_security.c gd_gd.c gd_gd2.c gd_io.c gd_io_dp.c gd_gif_in.c gd_gif_out.c gd_io_file.c gd_io_ss.c gd_jpeg.c gd_png.c gd_ss.c gd_topal.c gd_wbmp.c gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c gdft.c gdhelpers.c gdhelpers.h gdkanji.c gdtables.c gdxpm.c jisx0208.h wbmp.c wbmp.h
++libgd_la_SOURCES = gd.c gdfx.c gd_security.c gd_gd.c gd_gd2.c gd_io.c gd_io_dp.c gd_gif_in.c gd_gif_out.c gd_io_file.c gd_io_ss.c gd_jpeg.c gd_png.c gd_ss.c gd_topal.c gd_wbmp.c gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c gdft.c gdhelpers.c gdhelpers.h gdtables.c gdxpm.c jisx0208.h wbmp.c wbmp.h
+ libgd_la_LDFLAGS = -version-info 2:0:0 $(XTRA_LDFLAGS)
+ libgd_la_LIBADD = $(LTLIBICONV)
+ LDADD = ./libgd.la $(LIBICONV)
+@@ -594,7 +594,6 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdft.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdfx.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdhelpers.Plo@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdkanji.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdparttopng.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdtables.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gdtest.Po@am__quote@
diff --git a/package/libgdbm/Config.in b/package/libgdbm/Config.in
new file mode 100644
index 000000000..f644ae473
--- /dev/null
+++ b/package/libgdbm/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBGDBM
+ prompt "libgdbm........................... The GNU database manager"
+ tristate
+ default n
+ help
+ disk file format database which stores key/data-pairs in single files.
+
+ http://www.gnu.org
+
diff --git a/package/libgdbm/Makefile b/package/libgdbm/Makefile
new file mode 100644
index 000000000..2677c9a3b
--- /dev/null
+++ b/package/libgdbm/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libgdbm
+PKG_VERSION:= 1.8.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1d1b1d5c0245b1c00aff92da751e9aa1
+
+MASTER_SITES:= ${MASTER_SITE_GNU:=gdbm/}
+DISTFILES:= gdbm-${PKG_VERSION}.tar.gz
+
+WRKDIST= ${WRKDIR}/gdbm-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBGDBM,libgdbm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= BINOWN=`id -u` \
+ BINGRP=`id -g` \
+ INSTALL_ROOT="${WRKINST}"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBGDBM}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgdbm.so.* ${IDIR_LIBGDBM}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libgdbm/ipkg/libgdbm.control b/package/libgdbm/ipkg/libgdbm.control
new file mode 100644
index 000000000..a05a7ac37
--- /dev/null
+++ b/package/libgdbm/ipkg/libgdbm.control
@@ -0,0 +1,4 @@
+Package: libgdbm
+Priority: optional
+Section: libs
+Description: disk file format database which stores key/data-pairs in single files
diff --git a/package/libgpg-error/Config.in b/package/libgpg-error/Config.in
new file mode 100644
index 000000000..88cdd9cd6
--- /dev/null
+++ b/package/libgpg-error/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_LIBGPG_ERROR
+ prompt "libgpg-error...................... An helper library for common error codes and descriptions"
+ tristate
+ default n
+ help
+ This is a library that defines common error values for all GnuPG
+ components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
+ Libksba, DirMngr, Pinentry, SmartCard Daemon and possibly more in the
+ future.
+
+ http://www.gnupg.org/related_software/libgpg-error/
+
diff --git a/package/libgpg-error/Makefile b/package/libgpg-error/Makefile
new file mode 100644
index 000000000..d6cd2ee09
--- /dev/null
+++ b/package/libgpg-error/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libgpg-error
+PKG_VERSION:= 1.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8599b96c911b1df1be24a6ff4ec3c364
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= ftp://ftp.gnupg.org/gcrypt/libgpg-error/ \
+ http://mirrors.rootmode.com/ftp.gnupg.org/libgpg-error/ \
+ http://gulus.usherbrooke.ca/pub/appl/GnuPG/libgpg-error/ \
+ http://gnupg.unixmexico.org/ftp/libgpg-error/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBGPG_ERROR,libgpg-error,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBGPG_ERROR}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libgpg-error.so.* ${IDIR_LIBGPG_ERROR}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libgpg-error/ipkg/libgpg-error.control b/package/libgpg-error/ipkg/libgpg-error.control
new file mode 100644
index 000000000..6a08c01ab
--- /dev/null
+++ b/package/libgpg-error/ipkg/libgpg-error.control
@@ -0,0 +1,4 @@
+Package: libgpg-error
+Priority: optional
+Section: libs
+Description: an helper library for common error codes and descriptions
diff --git a/package/libgssglue/Config.in b/package/libgssglue/Config.in
new file mode 100644
index 000000000..0039e7cce
--- /dev/null
+++ b/package/libgssglue/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBGSSGLUE
+ prompt "libgssglue........................ NFSv4 GSSAPI helper library"
+ tristate
+ default n
+ help
+
diff --git a/package/libgssglue/Makefile b/package/libgssglue/Makefile
new file mode 100644
index 000000000..de69e7d2f
--- /dev/null
+++ b/package/libgssglue/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libgssglue
+PKG_VERSION:= 0.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ce1b4c758e6de01b712d154c5c97e540
+MASTER_SITES:= http://www.citi.umich.edu/projects/nfsv4/linux/libgssglue/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBGSSGLUE,libgssglue,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_LIBGSSGLUE)/usr/lib
+ $(CP) $(WRKINST)/usr/lib/libgssglue.so* $(IDIR_LIBGSSGLUE)/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libgssglue/ipkg/libgssglue.control b/package/libgssglue/ipkg/libgssglue.control
new file mode 100644
index 000000000..44e801a6c
--- /dev/null
+++ b/package/libgssglue/ipkg/libgssglue.control
@@ -0,0 +1,4 @@
+Package: libgssglue
+Priority: optional
+Section: libs
+Description: library for NFSv4
diff --git a/package/libiconv/Config.in b/package/libiconv/Config.in
new file mode 100644
index 000000000..e834bb3d1
--- /dev/null
+++ b/package/libiconv/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_LIBICONV
+ prompt "libiconv.......................... character set conversion library"
+ tristate
+ default n
+ help
+
+ This package contains a _very_ stripped down version of GNU Libiconv,
+ all charsets have been removed, except ASCII, various unicode charsets
+ and iso8896-1.
+
+ The original website:
+ http://www.gnu.org/software/libiconv/
+
diff --git a/package/libiconv/Makefile b/package/libiconv/Makefile
new file mode 100644
index 000000000..501782875
--- /dev/null
+++ b/package/libiconv/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libiconv
+PKG_VERSION:= 1.13
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 048032a3032ebd182150bdee30a5d533
+
+MASTER_SITES:= ${MASTER_SITE_GNU:=libiconv/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBICONV,libiconv,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+FAKE_FLAGS+= libdir="${WRKINST}/usr/lib" \
+ includedir="${WRKINST}/usr/include" \
+INSTALL_TARGET= install-lib
+
+post-extract:
+ @find ${WRKBUILD} -name *.rej -delete
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBICONV}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libiconv.so.* ${IDIR_LIBICONV}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libiconv/ipkg/libiconv.control b/package/libiconv/ipkg/libiconv.control
new file mode 100644
index 000000000..21306f1d7
--- /dev/null
+++ b/package/libiconv/ipkg/libiconv.control
@@ -0,0 +1,4 @@
+Package: libiconv
+Priority: optional
+Section: libs
+Description: character set conversion library
diff --git a/package/libid3tag/Config.in b/package/libid3tag/Config.in
new file mode 100644
index 000000000..e61f46e76
--- /dev/null
+++ b/package/libid3tag/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_LIBID3TAG
+ prompt "libid3tag......................... An ID3 tag manipulation library"
+ tristate
+ default n
+ select ADK_PACKAGE_ZLIB
+ help
+ libid3tag is a library for reading and (eventually) writing ID3 tags, both
+ ID3v1 and the various versions of ID3v2.
+
+ http://mad.sourceforge.net/
+
+ Depends: zlib
+
diff --git a/package/libid3tag/Makefile b/package/libid3tag/Makefile
new file mode 100644
index 000000000..0d1032c2b
--- /dev/null
+++ b/package/libid3tag/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libid3tag
+PKG_VERSION:= 0.15.1b
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e5808ad997ba32c498803822078748c3
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=mad/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBID3TAG,libid3tag,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-debugging \
+ --disable-profiling
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+pre-install:
+ ${INSTALL_DIR} ${WRKINST}/usr/lib/pkgconfig
+ ${CP} ./files/id3tag.pc ${WRKINST}/usr/lib/pkgconfig
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBID3TAG}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libid3tag.so.* ${IDIR_LIBID3TAG}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libid3tag/files/id3tag.pc b/package/libid3tag/files/id3tag.pc
new file mode 100644
index 000000000..e68600068
--- /dev/null
+++ b/package/libid3tag/files/id3tag.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: id3tag
+Description: ID3 tag reading library
+Requires:
+Version: 0.15.0b
+Libs: -L${libdir} -lid3tag -lz
+Cflags: -I${includedir}
diff --git a/package/libid3tag/ipkg/libid3tag.control b/package/libid3tag/ipkg/libid3tag.control
new file mode 100644
index 000000000..ec9a75470
--- /dev/null
+++ b/package/libid3tag/ipkg/libid3tag.control
@@ -0,0 +1,5 @@
+Package: libid3tag
+Priority: optional
+Section: libs
+Depends: zlib
+Description: an ID3 tag manipulation library
diff --git a/package/liblzo/Config.in b/package/liblzo/Config.in
new file mode 100644
index 000000000..d4ba51139
--- /dev/null
+++ b/package/liblzo/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBLZO
+ prompt "liblzo............................ Real-time data compression library"
+ tristate
+ default n
+ help
+ A real-time data compression library
+
+ http://www.oberhumer.com/opensource/lzo/
+
diff --git a/package/liblzo/Makefile b/package/liblzo/Makefile
new file mode 100644
index 000000000..6b8325d84
--- /dev/null
+++ b/package/liblzo/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= lzo
+PKG_VERSION:= 2.02
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6760e5819f4238328709bf93bf10071c
+
+MASTER_SITES:= http://www.oberhumer.com/opensource/lzo/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBLZO,liblzo,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-static
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CFLAGS_O="${TARGET_CFLAGS}"
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBLZO}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/liblzo2.so.* ${IDIR_LIBLZO}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/liblzo/ipkg/liblzo.control b/package/liblzo/ipkg/liblzo.control
new file mode 100644
index 000000000..3f84ee6f2
--- /dev/null
+++ b/package/liblzo/ipkg/liblzo.control
@@ -0,0 +1,4 @@
+Package: liblzo
+Priority: optional
+Section: libs
+Description: a real-time data compression library
diff --git a/package/libmad/Config.in b/package/libmad/Config.in
new file mode 100644
index 000000000..8dd618c55
--- /dev/null
+++ b/package/libmad/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_LIBMAD
+ prompt "libmad............................ An high-quality MPEG audio decoding library"
+ tristate
+ default n
+ help
+ MAD is a high-quality MPEG audio decoder. It currently supports
+ MPEG-1 and the MPEG-2 extension to lower sampling frequencies,
+ as well as the de facto MPEG 2.5 format. All three audio layers -
+ Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
+
+ http://www.underbit.com/products/mad/
+
diff --git a/package/libmad/Makefile b/package/libmad/Makefile
new file mode 100644
index 000000000..55242169d
--- /dev/null
+++ b/package/libmad/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libmad
+PKG_VERSION:= 0.15.1b
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1be543bc30c56fb6bea1d7bf6a64e66c
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=mad/} \
+ ftp://ftp.mars.org/pub/mpeg/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBMAD,libmad,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+FPM:=default
+ifeq (${ARCH},i386)
+FPM:=intel
+endif
+ifeq (${ARCH},mips)
+FPM:=mips
+endif
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-fpm=${FPM} \
+ --disable-debugging \
+ --enable-speed
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+pre-install:
+ ${INSTALL_DIR} ${WRKINST}/usr/lib/pkgconfig
+ ${CP} ./files/mad.pc ${WRKINST}/usr/lib/pkgconfig
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBMAD}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libmad.so.* ${IDIR_LIBMAD}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libmad/files/mad.pc b/package/libmad/files/mad.pc
new file mode 100644
index 000000000..9a164cfb0
--- /dev/null
+++ b/package/libmad/files/mad.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: mad
+Description: MPEG Audio Decoder
+Requires:
+Version: 0.15.0b
+Libs: -L${libdir} -lmad
+Cflags: -I${includedir}
diff --git a/package/libmad/ipkg/libmad.control b/package/libmad/ipkg/libmad.control
new file mode 100644
index 000000000..e81fea2dc
--- /dev/null
+++ b/package/libmad/ipkg/libmad.control
@@ -0,0 +1,4 @@
+Package: libmad
+Priority: optional
+Section: libs
+Description: An high-quality MPEG audio decoding library
diff --git a/package/libnet/Config.in b/package/libnet/Config.in
new file mode 100644
index 000000000..6a82db9c3
--- /dev/null
+++ b/package/libnet/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_LIBNET
+ prompt "libnet............................ Low-level packet creation library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCAP
+ help
+ A low-level packet creation library.
+
+ http://www.packetfactory.net/libnet/
+
+ Depends: libpcap
+
diff --git a/package/libnet/Makefile b/package/libnet/Makefile
new file mode 100644
index 000000000..bc3a13b97
--- /dev/null
+++ b/package/libnet/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libnet
+PKG_VERSION:= 1.0.2a
+PKG_RELEASE:= 7
+PKG_MD5SUM:= ddf53f0f484184390e8c2a1bd0853667
+MASTER_SITES:= http://www.packetfactory.net/libnet/dist/deprecated/
+WRKDIST= ${WRKDIR}/Libnet-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+ENDIAN:=lil
+ifeq (${ARCH},mips)
+ENDIAN:=big
+endif
+
+$(eval $(call PKG_template,LIBNET,libnet,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_libnet_have_pf_packet=yes \
+ ac_cv_lbl_unaligned_fail=no \
+ ac_cv_libnet_endianess=${ENDIAN}
+CONFIGURE_ARGS+= --with-pf_packet=yes
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBNET}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libnet.so.* ${IDIR_LIBNET}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libnet/ipkg/libnet.control b/package/libnet/ipkg/libnet.control
new file mode 100644
index 000000000..65a2b5e84
--- /dev/null
+++ b/package/libnet/ipkg/libnet.control
@@ -0,0 +1,5 @@
+Package: libnet
+Priority: optional
+Section: libs
+Description: a low-level packet creation library
+Depends: libpcap
diff --git a/package/libnet/patches/500-debian-subset.patch b/package/libnet/patches/500-debian-subset.patch
new file mode 100644
index 000000000..87674b83f
--- /dev/null
+++ b/package/libnet/patches/500-debian-subset.patch
@@ -0,0 +1,28584 @@
+diff -ruN libnet-1.0.2a-orig/Makefile.am libnet-1.0.2a-7/Makefile.am
+--- libnet-1.0.2a-orig/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,10 @@
++include $(top_srcdir)/Makefile.am.common
++
++SUBDIRS = src include
++
++EXTRA_DIST = Makefile.am.common
++
++bin_SCRIPTS = libnet-config
++
++version.h: VERSION
++ sed -e 's/.*/#define VERSION "&"/' < $< > $@
+diff -ruN libnet-1.0.2a-orig/Makefile.am.common libnet-1.0.2a-7/Makefile.am.common
+--- libnet-1.0.2a-orig/Makefile.am.common 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/Makefile.am.common 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,3 @@
++AUTOMAKE_OPTIONS = foreign no-dependencies
++
++DISTCLEANFILES = *~
+diff -ruN libnet-1.0.2a-orig/Makefile.in libnet-1.0.2a-7/Makefile.in
+--- libnet-1.0.2a-orig/Makefile.in 2001-02-05 18:51:41.000000000 +0100
++++ libnet-1.0.2a-7/Makefile.in 2005-03-08 03:53:26.000000000 +0100
+@@ -1,147 +1,620 @@
+-#
+-# $Id: Makefile.in,v 1.1.1.1 2000/05/25 00:28:49 route Exp $
+-#
+-# Libnet 1.0 makefile
+-# (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+-#
+-# @configure_input@
+-
+-# Enabled: Dumps debugging info and verbose error information.
+-# Disabled: Doesn't.
+-# default: disabled.
+-DEFINES += #-D__DEBUG
+-prefix = @prefix@
+-exec_prefix = @exec_prefix@
+-srcdir = @srcdir@
+-BIN_PREFIX = @bindir@/
+-INC_PREFIX = @includedir@/
+-LIB_PREFIX = @libdir@/
+-MAN_PREFIX = @MAN_PREFIX@
+-
+-LIBNET = libnet
+-LIBPWRITE = libpwrite
+-LIB = lib/$(LIBNET).a
+-MAN = doc/$(LIBNET).3
+-INCLUDE = include/$(LIBNET).h
+-INCLUDE-H = include/$(LIBNET)/$(LIBNET)-headers.h
+-INCLUDE-F = include/$(LIBNET)/$(LIBNET)-functions.h
+-INCLUDE-S = include/$(LIBNET)/$(LIBNET)-structures.h
+-INCLUDE-M = include/$(LIBNET)/$(LIBNET)-macros.h
+-INCLUDE-A = include/$(LIBNET)/$(LIBNET)-asn1.h
+-INCLUDE-O = include/$(LIBNET)/$(LIBNET)-ospf.h
+-CONFIG = $(LIBNET)-config
+-DEFINES += @DEFS@
+-RANLIB = @RANLIB@
+-AR = @AR@
+-LN = @LN@
+-CC = @CC@
+-ENSUREDIR = $(srcdir)/ensure-dir.sh
+-INSTALL_DATA= $(srcdir)/install-sh
+-CFLAGS = @CFLAGS@
+-CPPFLAGS = @CPPFLAGS@
+-OBJECTS = src/libnet_resolve.o\
+- src/libnet_socket.o\
+- src/libnet_checksum.o\
+- src/libnet_prand.o\
+- src/libnet_version.o\
+- src/libnet_write_ip.o\
+- src/libnet_insert_ipo.o\
+- src/libnet_insert_tcpo.o\
+- src/libnet_error.o\
+- src/libnet_link_@LL_INT_TYPE@.o\
+- src/libnet_packet_mem.o\
+- src/libnet_build_ip.o\
+- src/libnet_build_tcp.o\
+- src/libnet_build_udp.o\
+- src/libnet_build_arp.o\
+- src/libnet_build_ethernet.o\
+- src/libnet_build_icmp.o\
+- src/libnet_build_igmp.o\
+- src/libnet_build_dns.o\
+- src/libnet_build_snmp.o\
+- src/libnet_build_rip.o\
+- src/libnet_build_ospf.o\
+- src/libnet_build_vrrp.o\
+- src/libnet_asn1.o\
+- src/libnet_hex_dump.o\
+- src/libnet_if_addr.o\
+- src/libnet_port_list.o
+-
+-.c.o:
+- $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFINES) -c $< -o $@
+-
+-all: libnet
+-supp: test example
+-
+-libnet: version.h $(OBJECTS)
+- $(AR) -cr $(LIB) $(OBJECTS)
+- $(RANLIB) $(LIB)
+-
+-version.o: version.h
+-version.h: ./VERSION
+- @rm -f $@
+- sed -e 's/.*/#define VERSION "&"/' ./VERSION > $@
+-
+-test: libnet
+- cd test; make
+-
+-util: libnet install
+- cd util; make
+-
+-example: libnet install
+- cd example; make
+-
+-install: libnet
+- $(ENSUREDIR) $(DESTDIR)$(prefix) 755
+- $(ENSUREDIR) $(DESTDIR)$(LIB_PREFIX) 755
+- $(ENSUREDIR) $(DESTDIR)$(INC_PREFIX)$(LIBNET) 755
+- $(ENSUREDIR) $(DESTDIR)$(INC_PREFIX) 755
+- $(ENSUREDIR) $(DESTDIR)$(MAN_PREFIX) 755
+- $(ENSUREDIR) $(DESTDIR)$(BIN_PREFIX) 755
+- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIB_PREFIX)
+- rm -f $(DESTDIR)$(LIB_PREFIX)$(LIBPWRITE).a
+- cd $(DESTDIR)$(LIB_PREFIX); $(LN) -f -s $(LIBNET).a $(LIBPWRITE).a
+- $(INSTALL_DATA) $(INCLUDE) $(DESTDIR)$(INC_PREFIX)
+- $(INSTALL_DATA) $(INCLUDE-H) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+- $(INSTALL_DATA) $(INCLUDE-F) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+- $(INSTALL_DATA) $(INCLUDE-S) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+- $(INSTALL_DATA) $(INCLUDE-M) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+- $(INSTALL_DATA) $(INCLUDE-A) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+- $(INSTALL_DATA) $(INCLUDE-O) $(DESTDIR)$(INC_PREFIX)$(LIBNET)
+- $(INSTALL_DATA) $(MAN) $(DESTDIR)$(MAN_PREFIX)
+- $(INSTALL_DATA) $(CONFIG) $(DESTDIR)$(BIN_PREFIX)
+-
+-
+-
+-clean:
+- if test -f test/Makefile; then \
+- cd test && make clean; \
+- fi
+- if test -f example/Makefile; then \
+- cd example && make clean; \
+- fi
+- if test -f util/Makefile; then \
+- cd util && make clean; \
+- fi
+- if test -f support/bpf-lkm/etherspoof; then \
+- cd support/bpf-lkm/etherspoof && make clean; \
+- fi
+- rm -f *.core src/*.o $(LIB)
++# Makefile.in generated by automake 1.8.5 from Makefile.am.
++# @configure_input@
+
+-distclean: clean
+- if test -f test/Makefile; then \
+- cd test && make distclean; \
+- fi
+- if test -f example/Makefile; then \
+- cd example && make distclean; \
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004 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@
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++pkgdatadir = $(datadir)/@PACKAGE@
++pkglibdir = $(libdir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@
++top_builddir = .
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++INSTALL = @INSTALL@
++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@
++DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
++ $(srcdir)/Makefile.in $(srcdir)/libnet-config.in \
++ $(top_srcdir)/Makefile.am.common $(top_srcdir)/configure \
++ acconfig.h config.guess config.sub install-sh ltmain.sh \
++ missing mkinstalldirs
++subdir = .
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
++ $(top_srcdir)/configure.in
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++ $(ACLOCAL_M4)
++am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
++ configure.lineno configure.status.lineno
++mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
++CONFIG_HEADER = $(top_builddir)/include/config.h
++CONFIG_CLEAN_FILES = libnet-config
++am__installdirs = "$(DESTDIR)$(bindir)"
++binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
++SCRIPTS = $(bin_SCRIPTS)
++depcomp =
++am__depfiles_maybe =
++SOURCES =
++DIST_SOURCES =
++RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
++ html-recursive info-recursive install-data-recursive \
++ install-exec-recursive install-info-recursive \
++ install-recursive installcheck-recursive installdirs-recursive \
++ pdf-recursive ps-recursive uninstall-info-recursive \
++ uninstall-recursive
++ETAGS = etags
++CTAGS = ctags
++DIST_SUBDIRS = $(SUBDIRS)
++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
++distdir = $(PACKAGE)-$(VERSION)
++top_distdir = $(distdir)
++am__remove_distdir = \
++ { test ! -d $(distdir) \
++ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
++ && rm -fr $(distdir); }; }
++DIST_ARCHIVES = $(distdir).tar.gz
++GZIP_ENV = --best
++distuninstallcheck_listfiles = find . -type f -print
++distcleancheck_listfiles = find . -type f -print
++ACLOCAL = @ACLOCAL@
++ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
++AMDEP_FALSE = @AMDEP_FALSE@
++AMDEP_TRUE = @AMDEP_TRUE@
++AMTAR = @AMTAR@
++AR = @AR@
++AUTOCONF = @AUTOCONF@
++AUTOHEADER = @AUTOHEADER@
++AUTOMAKE = @AUTOMAKE@
++AWK = @AWK@
++BIN_PREFIX = @BIN_PREFIX@
++CC = @CC@
++CCDEPMODE = @CCDEPMODE@
++CFLAGS = @CFLAGS@
++CPP = @CPP@
++CPPFLAGS = @CPPFLAGS@
++CYGPATH_W = @CYGPATH_W@
++DEFS = @DEFS@
++DEPDIR = @DEPDIR@
++ECHO = @ECHO@
++ECHO_C = @ECHO_C@
++ECHO_N = @ECHO_N@
++ECHO_T = @ECHO_T@
++EGREP = @EGREP@
++EXEEXT = @EXEEXT@
++INC_PREFIX = @INC_PREFIX@
++INSTALL_DATA = @INSTALL_DATA@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
++LDFLAGS = @LDFLAGS@
++LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
++LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
++LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
++LIBOBJS = @LIBOBJS@
++LIBS = @LIBS@
++LIBTOOL = @LIBTOOL@
++LIB_PREFIX = @LIB_PREFIX@
++LL_INT_TYPE = @LL_INT_TYPE@
++LL_INT_TYPE_UC = @LL_INT_TYPE_UC@
++LN = @LN@
++LN_S = @LN_S@
++LTLIBOBJS = @LTLIBOBJS@
++MAKEINFO = @MAKEINFO@
++MAN_PREFIX = @MAN_PREFIX@
++OBJEXT = @OBJEXT@
++PACKAGE = @PACKAGE@
++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
++PACKAGE_NAME = @PACKAGE_NAME@
++PACKAGE_STRING = @PACKAGE_STRING@
++PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_VERSION = @PACKAGE_VERSION@
++PATH_SEPARATOR = @PATH_SEPARATOR@
++RANLIB = @RANLIB@
++SET_MAKE = @SET_MAKE@
++SHELL = @SHELL@
++STRIP = @STRIP@
++VERSION = @VERSION@
++ac_ct_CC = @ac_ct_CC@
++ac_ct_RANLIB = @ac_ct_RANLIB@
++ac_ct_STRIP = @ac_ct_STRIP@
++am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
++am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
++am__include = @am__include@
++am__leading_dot = @am__leading_dot@
++am__quote = @am__quote@
++bindir = @bindir@
++build = @build@
++build_alias = @build_alias@
++build_cpu = @build_cpu@
++build_os = @build_os@
++build_vendor = @build_vendor@
++datadir = @datadir@
++exec_prefix = @exec_prefix@
++host = @host@
++host_alias = @host_alias@
++host_cpu = @host_cpu@
++host_os = @host_os@
++host_vendor = @host_vendor@
++includedir = @includedir@
++infodir = @infodir@
++install_sh = @install_sh@
++libdir = @libdir@
++libexecdir = @libexecdir@
++localstatedir = @localstatedir@
++mandir = @mandir@
++mkdir_p = @mkdir_p@
++oldincludedir = @oldincludedir@
++prefix = @prefix@
++program_transform_name = @program_transform_name@
++sbindir = @sbindir@
++sharedstatedir = @sharedstatedir@
++sysconfdir = @sysconfdir@
++target = @target@
++target_alias = @target_alias@
++target_cpu = @target_cpu@
++target_os = @target_os@
++target_vendor = @target_vendor@
++AUTOMAKE_OPTIONS = foreign no-dependencies
++DISTCLEANFILES = *~
++SUBDIRS = src include
++EXTRA_DIST = Makefile.am.common
++bin_SCRIPTS = libnet-config
++all: all-recursive
++
++.SUFFIXES:
++am--refresh:
++ @:
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(am__configure_deps)
++ @for dep in $?; do \
++ case '$(am__configure_deps)' in \
++ *$$dep*) \
++ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
++ cd $(srcdir) && $(AUTOMAKE) --foreign \
++ && exit 0; \
++ exit 1;; \
++ esac; \
++ done; \
++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
++ 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: $(am__configure_deps)
++ cd $(srcdir) && $(AUTOCONF)
++$(ACLOCAL_M4): $(am__aclocal_m4_deps)
++ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
++libnet-config: $(top_builddir)/config.status $(srcdir)/libnet-config.in
++ cd $(top_builddir) && $(SHELL) ./config.status $@
++install-binSCRIPTS: $(bin_SCRIPTS)
++ @$(NORMAL_INSTALL)
++ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
++ @list='$(bin_SCRIPTS)'; for p in $$list; do \
++ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
++ if test -f $$d$$p; then \
++ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
++ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
++ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
++ else :; fi; \
++ done
++
++uninstall-binSCRIPTS:
++ @$(NORMAL_UNINSTALL)
++ @list='$(bin_SCRIPTS)'; for p in $$list; do \
++ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
++ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
++ rm -f "$(DESTDIR)$(bindir)/$$f"; \
++ done
++
++mostlyclean-libtool:
++ -rm -f *.lo
++
++clean-libtool:
++ -rm -rf .libs _libs
++
++distclean-libtool:
++ -rm -f libtool
++uninstall-info-am:
++
++# 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):
++ @set fnord $$MAKEFLAGS; amf=$$2; \
++ 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; \
++ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
++ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
++ done; \
++ if test "$$dot_seen" = "no"; then \
++ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
++ fi; test -z "$$fail"
++
++mostlyclean-recursive clean-recursive distclean-recursive \
++maintainer-clean-recursive:
++ @set fnord $$MAKEFLAGS; amf=$$2; \
++ 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; \
++ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
++ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
++ done && test -z "$$fail"
++tags-recursive:
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
++ done
++ctags-recursive:
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ test "$$subdir" = . || (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; } \
++ END { for (i in files) print i; }'`; \
++ mkid -fID $$unique
++tags: TAGS
++
++TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ 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 || \
++ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
++ fi; \
++ done; \
++ 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; } \
++ END { for (i in files) print i; }'`; \
++ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
++ test -n "$$unique" || unique=$$empty_fix; \
++ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
++ $$tags $$unique; \
+ fi
+- if test -f util/Makefile; then \
+- cd util && make distclean; \
++ctags: CTAGS
++CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ test -z "$(CTAGS_ARGS)$$tags$$unique" \
++ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
++ $$tags $$unique
++
++GTAGS:
++ here=`$(am__cd) $(top_builddir) && pwd` \
++ && cd $(top_srcdir) \
++ && gtags -i $(GTAGS_ARGS) $$here
++
++distclean-tags:
++ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
++
++distdir: $(DISTFILES)
++ $(am__remove_distdir)
++ mkdir $(distdir)
++ $(mkdir_p) $(distdir)/.
++ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
++ list='$(DISTFILES)'; for file in $$list; do \
++ case $$file in \
++ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
++ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
++ esac; \
++ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
++ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
++ dir="/$$dir"; \
++ $(mkdir_p) "$(distdir)$$dir"; \
++ else \
++ dir=''; \
++ fi; \
++ if test -d $$d/$$file; then \
++ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
++ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
++ fi; \
++ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
++ else \
++ test -f $(distdir)/$$file \
++ || cp -p $$d/$$file $(distdir)/$$file \
++ || exit 1; \
++ fi; \
++ done
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ if test "$$subdir" = .; then :; else \
++ test -d "$(distdir)/$$subdir" \
++ || mkdir "$(distdir)/$$subdir" \
++ || exit 1; \
++ (cd $$subdir && \
++ $(MAKE) $(AM_MAKEFLAGS) \
++ top_distdir="../$(top_distdir)" \
++ distdir="../$(distdir)/$$subdir" \
++ distdir) \
++ || exit 1; \
++ fi; \
++ done
++ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
++ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
++ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
++ || chmod -R a+r $(distdir)
++dist-gzip: distdir
++ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
++ $(am__remove_distdir)
++
++dist-bzip2: distdir
++ $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
++ $(am__remove_distdir)
++
++dist-tarZ: distdir
++ $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
++ $(am__remove_distdir)
++
++dist-shar: distdir
++ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
++ $(am__remove_distdir)
++
++dist-zip: distdir
++ -rm -f $(distdir).zip
++ zip -rq $(distdir).zip $(distdir)
++ $(am__remove_distdir)
++
++dist dist-all: distdir
++ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
++ $(am__remove_distdir)
++
++# This target untars the dist file and tries a VPATH configuration. Then
++# it guarantees that the distribution is self-contained by making another
++# tarfile.
++distcheck: dist
++ case '$(DIST_ARCHIVES)' in \
++ *.tar.gz*) \
++ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\
++ *.tar.bz2*) \
++ bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\
++ *.tar.Z*) \
++ uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
++ *.shar.gz*) \
++ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
++ *.zip*) \
++ unzip $(distdir).zip ;;\
++ esac
++ chmod -R a-w $(distdir); chmod a+w $(distdir)
++ mkdir $(distdir)/_build
++ mkdir $(distdir)/_inst
++ chmod a-w $(distdir)
++ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
++ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
++ && cd $(distdir)/_build \
++ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
++ $(DISTCHECK_CONFIGURE_FLAGS) \
++ && $(MAKE) $(AM_MAKEFLAGS) \
++ && $(MAKE) $(AM_MAKEFLAGS) dvi \
++ && $(MAKE) $(AM_MAKEFLAGS) check \
++ && $(MAKE) $(AM_MAKEFLAGS) install \
++ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
++ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
++ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
++ distuninstallcheck \
++ && chmod -R a-w "$$dc_install_base" \
++ && ({ \
++ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
++ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
++ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
++ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
++ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
++ } || { rm -rf "$$dc_destdir"; exit 1; }) \
++ && rm -rf "$$dc_destdir" \
++ && $(MAKE) $(AM_MAKEFLAGS) dist \
++ && rm -rf $(DIST_ARCHIVES) \
++ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
++ $(am__remove_distdir)
++ @(echo "$(distdir) archives ready for distribution: "; \
++ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
++ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
++distuninstallcheck:
++ @cd $(distuninstallcheck_dir) \
++ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
++ || { echo "ERROR: files left after uninstall:" ; \
++ if test -n "$(DESTDIR)"; then \
++ echo " (check DESTDIR support)"; \
++ fi ; \
++ $(distuninstallcheck_listfiles) ; \
++ exit 1; } >&2
++distcleancheck: distclean
++ @if test '$(srcdir)' = . ; then \
++ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
++ exit 1 ; \
+ fi
+- if test -f support/bpf-lkm/etherspoof; then \
+- cd support/bpf-lkm/etherspoof && rm -rf Makefile; \
+- fi
+- rm -f config.log config.cache config.status Makefile include/config.h \
+- version.h support/bpf-lkm/etherspoof conftest* libnet-config
++ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
++ || { echo "ERROR: files left in build directory after distclean:" ; \
++ $(distcleancheck_listfiles) ; \
++ exit 1; } >&2
++check-am: all-am
++check: check-recursive
++all-am: Makefile $(SCRIPTS)
++installdirs: installdirs-recursive
++installdirs-am:
++ for dir in "$(DESTDIR)$(bindir)"; 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:
++
++distclean-generic:
++ -rm -f $(CONFIG_CLEAN_FILES)
++ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
++
++maintainer-clean-generic:
++ @echo "This command is intended for maintainers to use"
++ @echo "it deletes files that may require special tools to rebuild."
++clean: clean-recursive
++
++clean-am: clean-generic clean-libtool mostlyclean-am
++
++distclean: distclean-recursive
++ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
++ -rm -f Makefile
++distclean-am: clean-am distclean-generic distclean-libtool \
++ distclean-tags
++
++dvi: dvi-recursive
++
++dvi-am:
++
++html: html-recursive
++
++info: info-recursive
++
++info-am:
++
++install-data-am:
++
++install-exec-am: install-binSCRIPTS
++
++install-info: install-info-recursive
++
++install-man:
++
++installcheck-am:
++
++maintainer-clean: maintainer-clean-recursive
++ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
++ -rm -rf $(top_srcdir)/autom4te.cache
++ -rm -f Makefile
++maintainer-clean-am: distclean-am maintainer-clean-generic
++
++mostlyclean: mostlyclean-recursive
++
++mostlyclean-am: mostlyclean-generic mostlyclean-libtool
++
++pdf: pdf-recursive
++
++pdf-am:
++
++ps: ps-recursive
++
++ps-am:
++
++uninstall-am: uninstall-binSCRIPTS uninstall-info-am
++
++uninstall-info: uninstall-info-recursive
++
++.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
++ check-am clean clean-generic clean-libtool clean-recursive \
++ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
++ dist-shar dist-tarZ dist-zip distcheck distclean \
++ distclean-generic distclean-libtool distclean-recursive \
++ distclean-tags distcleancheck distdir distuninstallcheck dvi \
++ dvi-am html html-am info info-am install install-am \
++ install-binSCRIPTS install-data install-data-am install-exec \
++ install-exec-am install-info install-info-am install-man \
++ install-strip installcheck installcheck-am installdirs \
++ installdirs-am maintainer-clean maintainer-clean-generic \
++ maintainer-clean-recursive mostlyclean mostlyclean-generic \
++ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
++ tags tags-recursive uninstall uninstall-am \
++ uninstall-binSCRIPTS uninstall-info-am
++
+
+-# EOF
++version.h: VERSION
++ sed -e 's/.*/#define VERSION "&"/' < $< > $@
++# 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 -ruN libnet-1.0.2a-orig/acconfig.h libnet-1.0.2a-7/acconfig.h
+--- libnet-1.0.2a-orig/acconfig.h 2000-12-12 19:31:39.000000000 +0100
++++ libnet-1.0.2a-7/acconfig.h 2005-03-08 03:53:26.000000000 +0100
+@@ -1,15 +1,17 @@
+-dnl $Id: acconfig.h,v 1.1.1.1 2000/05/25 00:28:49 route Exp $
+-dnl
+-dnl Libnet autoconfiguration acconfig.h file
+-dnl Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
+-dnl All rights reserved.
+-dnl
+-dnl Process this file with autoheader to produce a config.h file.
+-dnl
++/* $Id: acconfig.h,v 1.1.1.1 2000/05/25 00:28:49 route Exp $
++ *
++ * Libnet autoconfiguration acconfig.h file
++ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
++ * All rights reserved.
++ *
++ * Process this file with autoheader to produce a config.h file.
++ */
+
+ #undef LIBNET_BSDISH_OS
+ #undef LIBNET_BSD_BYTE_SWAP
+ #undef DLPI_DEV_PREFIX
++#undef LIBNET_FAST_X86_CHECK
++#undef HAVE_SOLARIS
+ #undef HAVE_DEV_DLPI
+ #undef HAVE_SOCKADDR_SA_LEN
+ #undef HAVE_DLPI
+@@ -23,5 +25,3 @@
+ #undef __FAVOR_BSD
+ #undef LIBNET_BIG_ENDIAN
+ #undef LIBNET_LIL_ENDIAN
+-
+-dnl EOF
+diff -ruN libnet-1.0.2a-orig/acinclude.m4 libnet-1.0.2a-7/acinclude.m4
+--- libnet-1.0.2a-orig/acinclude.m4 2000-12-12 19:31:54.000000000 +0100
++++ libnet-1.0.2a-7/acinclude.m4 2005-03-08 03:53:26.000000000 +0100
+@@ -30,65 +30,43 @@
+ *)
+
+ cat > pf_packet-test.c << EOF
+-#include <net/if.h>
+-#if (__GLIBC__)
+-#include <netinet/if_ether.h>
+-#include <net/if_arp.h>
++#include <stdio.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <netinet/in.h>
++#include <sys/socket.h>
++#include <features.h> /* for the glibc version number */
++#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
++#include <netpacket/packet.h>
++#include <net/ethernet.h> /* the L2 protocols */
+ #else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
++#include <asm/types.h>
++#include <linux/if_packet.h>
++#include <linux/if_ether.h> /* The L2 protocols */
+ #endif
+-#if (PF_PACKET)
++
+ #ifndef SOL_PACKET
+ #define SOL_PACKET 263
+ #endif /* SOL_PACKET */
+-#include <linux/if_packet.h>
+-#endif
+-#include "./include/libnet.h"
+
+ int
+ main()
+ {
+-#if (PF_PACKET)
+ int fd;
+- struct sockaddr_ll sa;
+- struct ifreq ifr;
+- struct packet_mreq mr;
+- char *device ="lo";
+
+ fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ if (fd == -1)
+ {
+- printf("choked");
+- exit (EXIT_FAILURE);
+- }
+-
+- memset(&sa, 0, sizeof(sa));
+- strcpy(ifr.ifr_name, device);
+- if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0)
+- {
+- printf("choked");
+- exit (EXIT_FAILURE);
+- }
+- sa.sll_family = AF_PACKET;
+- sa.sll_ifindex = ifr.ifr_ifindex;
+- sa.sll_protocol = htons(ETH_P_ALL);
+-
+- memset(&mr, 0, sizeof (mr));
+- mr.mr_ifindex = sa.sll_ifindex;
+- mr.mr_type = PACKET_MR_ALLMULTI;
+-
+- if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, (char *)&mr,
+- sizeof (mr)) < 0)
+- {
+- printf("choked\n");
++ if (errno == EPERM)
++ {
++ /* user's UID != 0 */
++ printf("probably");
++ exit (EXIT_FAILURE);
++ }
++ printf("no");
+ exit (EXIT_FAILURE);
+ }
+- /* yay. we made it and it workz! */
+ printf("yes");
+-#else /* PF_PACKET */
+- printf("no");
+-#endif
+ exit (EXIT_SUCCESS);
+ }
+ EOF
+@@ -104,16 +82,21 @@
+ if test $ac_libnet_have_pf_packet = choked; then
+ AC_MSG_RESULT(test program choked... assuming no)
+ elif test $ac_libnet_have_pf_packet = yes; then
+- AC_DEFINE(HAVE_PF_PACKET)
++ AC_MSG_RESULT(yes)
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_PF_PACKET"
++ elif test $ac_libnet_have_pf_packet = probably; then
++ AC_MSG_RESULT(test program got EPERM... assuming yes)
++ elif test $ac_libnet_have_pf_packet = no; then
++ AC_MSG_RESULT(no)
+ fi
+
+- if test $ac_libnet_have_pf_packet != choked; then
+- AC_MSG_RESULT($ac_libnet_have_pf_packet)
+- fi
+ rm -f pf_packet-test* core core.pf_packet-test
+ ;;
+ esac])
++
++ if test $ac_libnet_have_pf_packet = yes -o $ac_libnet_have_pf_packet = probably; then
++ AC_DEFINE(HAVE_PF_PACKET)
++ fi
+ ])
+
+ dnl
+@@ -279,6 +262,8 @@
+
+ AC_DEFUN(AC_LIBNET_ENDIAN_CHECK,
+ [AC_MSG_CHECKING(machine endianess)
++ AC_CACHE_VAL(ac_cv_libnet_endianess,
++ [
+
+ cat > conftest.c << EOF
+ # include <stdio.h>
+@@ -332,6 +317,7 @@
+ fi
+ rm -f conftest* core core.conftest
+
++ ])
+ AC_MSG_RESULT($ac_cv_libnet_endianess)
+
+ if test $ac_cv_libnet_endianess = big ; then
+diff -ruN libnet-1.0.2a-orig/aclocal.m4 libnet-1.0.2a-7/aclocal.m4
+--- libnet-1.0.2a-orig/aclocal.m4 2001-01-07 21:49:29.000000000 +0100
++++ libnet-1.0.2a-7/aclocal.m4 2005-03-08 03:53:26.000000000 +0100
+@@ -1,358 +1,4525 @@
+-dnl aclocal.m4 generated automatically by aclocal 1.4
++# generated automatically by aclocal 1.8.5 -*- Autoconf -*-
+
+-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+-dnl This file is free software; the Free Software Foundation
+-dnl gives unlimited permission to copy and/or distribute it,
+-dnl with or without modifications, as long as this notice is preserved.
+-
+-dnl This program is distributed in the hope that it will be useful,
+-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+-dnl PARTICULAR PURPOSE.
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
++# 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.
+
+-dnl $Id: aclocal.m4,v 1.1.1.1 2000/05/25 00:28:49 route Exp $
+-dnl
+-dnl Libnet specific autoconf macros
+-dnl Copyright (c) 1998, 1999, 2000 Mike D. Schiffman <mike@infonexus.com>
+-dnl All rights reserved.
+-dnl
++# 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.
+
+-dnl
+-dnl Checks to see if this linux kernel has a working PF_PACKET
+-dnl
+-dnl usage:
+-dnl
+-dnl AC_LIBNET_CHECK_PF_PACKET
+-dnl
+-dnl results:
+-dnl
+-dnl HAVE_PF_PACKET (DEFINED)
++# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
++
++# serial 46 AC_PROG_LIBTOOL
++# Debian $Rev: 102 $
++
++AC_DEFUN([AC_PROG_LIBTOOL],
++[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
++
++# This can be used to rebuild libtool when needed
++LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
++
++# Always use our own libtool.
++LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++AC_SUBST(LIBTOOL)dnl
++
++# Prevent multiple expansion
++define([AC_PROG_LIBTOOL], [])
++])
++
++AC_DEFUN([AC_LIBTOOL_SETUP],
++[AC_PREREQ(2.13)dnl
++AC_REQUIRE([AC_ENABLE_SHARED])dnl
++AC_REQUIRE([AC_ENABLE_STATIC])dnl
++AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_PROG_LD])dnl
++AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
++AC_REQUIRE([AC_PROG_NM])dnl
++AC_REQUIRE([LT_AC_PROG_SED])dnl
++
++AC_REQUIRE([AC_PROG_LN_S])dnl
++AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
++AC_REQUIRE([AC_OBJEXT])dnl
++AC_REQUIRE([AC_EXEEXT])dnl
+ dnl
+
+-AC_DEFUN(AC_LIBNET_CHECK_PF_PACKET,
+-[
+- AC_MSG_CHECKING(for PF_PACKET)
+- AC_CACHE_VAL(ac_libnet_have_pf_packet,
+-
+- [case "$target_os" in
+-
+- linux)
+- ac_libnet_have_pf_packet = no
+- ;;
+- *)
+-
+- cat > pf_packet-test.c << EOF
+-#include <net/if.h>
+-#if (__GLIBC__)
+-#include <netinet/if_ether.h>
+-#include <net/if_arp.h>
+-#else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
++_LT_AC_PROG_ECHO_BACKSLASH
++# Only perform the check for file, if the check method requires it
++case $deplibs_check_method in
++file_magic*)
++ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
++ AC_PATH_MAGIC
++ fi
++ ;;
++esac
++
++AC_CHECK_TOOL(RANLIB, ranlib, :)
++AC_CHECK_TOOL(STRIP, strip, :)
++
++ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
++ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
++enable_win32_dll=yes, enable_win32_dll=no)
++
++AC_ARG_ENABLE(libtool-lock,
++ [ --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
++*-*-irix6*)
++ # Find out which ABI we are using.
++ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
++ if AC_TRY_EVAL(ac_compile); then
++ 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
++ 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_SAVE
++ AC_LANG_C
++ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
++ AC_LANG_RESTORE])
++ 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
++ ;;
++
++ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
++[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
++ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++ AC_CHECK_TOOL(AS, as, false)
++ AC_CHECK_TOOL(OBJDUMP, objdump, false)
++
++ # recent cygwin and mingw systems supply a stub DllMain which the user
++ # can override, but on older systems we have to supply one
++ AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
++ [AC_TRY_LINK([],
++ [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
++ DllMain (0, 0, 0);],
++ [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
++
++ case $host/$CC in
++ *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
++ # old mingw systems require "-dll" to link a DLL, while more recent ones
++ # require "-mdll"
++ SAVE_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -mdll"
++ AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
++ [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
++ CFLAGS="$SAVE_CFLAGS" ;;
++ *-*-cygwin* | *-*-pw32*)
++ # cygwin systems need to pass --dll to the linker, and not link
++ # crt.o which will require a WinMain@16 definition.
++ lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
++ esac
++ ;;
++ ])
++esac
++
++_LT_AC_LTCONFIG_HACK
++
++])
++
++# AC_LIBTOOL_HEADER_ASSERT
++# ------------------------
++AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
++[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
++ [lt_cv_func_assert_works],
++ [case $host in
++ *-*-solaris*)
++ if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
++ case `$CC --version 2>/dev/null` in
++ [[12]].*) lt_cv_func_assert_works=no ;;
++ *) lt_cv_func_assert_works=yes ;;
++ esac
++ fi
++ ;;
++ esac])
++
++if test "x$lt_cv_func_assert_works" = xyes; then
++ AC_CHECK_HEADERS(assert.h)
++fi
++])# AC_LIBTOOL_HEADER_ASSERT
++
++# _LT_AC_CHECK_DLFCN
++# --------------------
++AC_DEFUN([_LT_AC_CHECK_DLFCN],
++[AC_CHECK_HEADERS(dlfcn.h)
++])# _LT_AC_CHECK_DLFCN
++
++# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++# ---------------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
++[AC_REQUIRE([AC_CANONICAL_HOST])
++AC_REQUIRE([AC_PROG_NM])
++AC_REQUIRE([AC_OBJEXT])
++# Check for command to grab the raw symbol name followed by C symbol from nm.
++AC_MSG_CHECKING([command to parse $NM output])
++AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
++
++# 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]]*\)'
++
++# Transform the above into a raw symbol and a C symbol.
++symxfrm='\1 \2\3 \3'
++
++# Transform an extracted symbol line into a proper C declaration
++lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
++
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
++# Define system-specific variables.
++case $host_os in
++aix*)
++ symcode='[[BCDT]]'
++ ;;
++cygwin* | mingw* | pw32*)
++ symcode='[[ABCDGISTW]]'
++ ;;
++hpux*) # Its linker distinguishes data from code symbols
++ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++ ;;
++irix* | nonstopux*)
++ symcode='[[BCDEGRST]]'
++ ;;
++osf*)
++ symcode='[[BCDEGQRST]]'
++ ;;
++solaris* | sysv5*)
++ symcode='[[BDT]]'
++ ;;
++sysv4)
++ symcode='[[DFNSTU]]'
++ ;;
++esac
++
++# Handle CRLF in mingw tool chain
++opt_cr=
++case $host_os in
++mingw*)
++ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
++ ;;
++esac
++
++# If we're using GNU nm, then use its standard symbol codes.
++if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
++ symcode='[[ABCDGISTW]]'
++fi
++
++# Try without a prefix undercore, then with it.
++for ac_symprfx in "" "_"; do
++
++ # Write the raw and C identifiers.
++lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
++
++ # Check to see that the pipe works correctly.
++ pipe_works=no
++ rm -f conftest*
++ cat > conftest.$ac_ext <<EOF
++#ifdef __cplusplus
++extern "C" {
+ #endif
+-#if (PF_PACKET)
+-#ifndef SOL_PACKET
+-#define SOL_PACKET 263
+-#endif /* SOL_PACKET */
+-#include <linux/if_packet.h>
++char nm_test_var;
++void nm_test_func(){}
++#ifdef __cplusplus
++}
+ #endif
+-#include <stdlib.h>
+-#include <linux/sockios.h>
++int main(){nm_test_var='a';nm_test_func();return(0);}
++EOF
+
+-int
+-main()
+-{
+-#if (PF_PACKET)
+- int fd;
+- struct sockaddr_ll sa;
+- struct ifreq ifr;
+- struct packet_mreq mr;
+- char *device ="lo";
++ 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
+
+- fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+- if (fd == -1)
+- {
+- printf("choked");
+- exit (EXIT_FAILURE);
+- }
++ # Make sure that we snagged all the symbols we need.
++ if egrep ' nm_test_var$' "$nlist" >/dev/null; then
++ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
++ cat <<EOF > conftest.$ac_ext
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+- memset(&sa, 0, sizeof(sa));
+- strcpy(ifr.ifr_name, device);
+- if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0)
+- {
+- printf("choked");
+- exit (EXIT_FAILURE);
+- }
+- sa.sll_family = AF_PACKET;
+- sa.sll_ifindex = ifr.ifr_ifindex;
+- sa.sll_protocol = htons(ETH_P_ALL);
+-
+- memset(&mr, 0, sizeof (mr));
+- mr.mr_ifindex = sa.sll_ifindex;
+- mr.mr_type = PACKET_MR_ALLMULTI;
++EOF
++ # Now generate the symbol file.
++ eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
+
+- if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, (char *)&mr,
+- sizeof (mr)) < 0)
+- {
+- printf("choked\n");
+- exit (EXIT_FAILURE);
+- }
+- /* yay. we made it and it workz! */
+- printf("yes");
+-#else /* PF_PACKET */
+- printf("no");
++ cat <<EOF >> conftest.$ac_ext
++#if defined (__STDC__) && __STDC__
++# define lt_ptr void *
++#else
++# define lt_ptr char *
++# define const
+ #endif
+- exit (EXIT_SUCCESS);
++
++/* The mapping between symbol names and symbols. */
++const struct {
++ const char *name;
++ lt_ptr address;
+ }
++lt_preloaded_symbols[[]] =
++{
+ EOF
+- ${CC-cc} -o pf_packet-test $CFLAGS pf_packet-test.c >/dev/null 2>&1
++ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
++ cat <<\EOF >> conftest.$ac_ext
++ {0, (lt_ptr) 0}
++};
+
+- # Oopz 4.3 BSD doesn't have this. Sorry.
+- if test ! -x ./pf_packet-test ; then
+- ac_libnet_have_pf_packet=choked
++#ifdef __cplusplus
++}
++#endif
++EOF
++ # Now try linking the two files.
++ mv conftest.$ac_objext conftstm.$ac_objext
++ save_LIBS="$LIBS"
++ save_CFLAGS="$CFLAGS"
++ LIBS="conftstm.$ac_objext"
++ CFLAGS="$CFLAGS$no_builtin_flag"
++ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
++ pipe_works=yes
++ fi
++ LIBS="$save_LIBS"
++ CFLAGS="$save_CFLAGS"
++ else
++ echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
++ fi
++ else
++ echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
++ fi
+ else
+- ac_libnet_have_pf_packet=`./pf_packet-test`;
++ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
++ fi
++ else
++ echo "$progname: failed program was:" >&AC_FD_CC
++ cat conftest.$ac_ext >&5
++ fi
++ rm -f 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
++])
++global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
++if test -z "$lt_cv_sys_global_symbol_pipe"; then
++ global_symbol_to_cdecl=
++ global_symbol_to_c_name_address=
++else
++ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
++ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
++fi
++if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
++then
++ AC_MSG_RESULT(failed)
++else
++ AC_MSG_RESULT(ok)
++fi
++]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++
++# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
++# ---------------------------------
++AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
++[# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
++
++# _LT_AC_PROG_ECHO_BACKSLASH
++# --------------------------
++# Add some code to the start of the generated configure script which
++# will find an echo command which doesn't interpret backslashes.
++AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
++[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
++ [AC_DIVERT_PUSH(NOTICE)])
++_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
++
++# Check that we are running under the correct shell.
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++case X$ECHO in
++X*--fallback-echo)
++ # Remove one level of quotation (which was required for Make).
++ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
++ ;;
++esac
++
++echo=${ECHO-echo}
++if test "X[$]1" = X--no-reexec; then
++ # Discard the --no-reexec flag, and continue.
++ shift
++elif test "X[$]1" = X--fallback-echo; then
++ # Avoid inline document here, it may be left over
++ :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
++ # Yippee, $echo works!
++ :
++else
++ # Restart under the correct shell.
++ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
++fi
++
++if test "X[$]1" = X--fallback-echo; then
++ # used as fallback echo
++ shift
++ cat <<EOF
++$*
++EOF
++ exit 0
++fi
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++if test -z "$ECHO"; then
++if test "X${echo_test_string+set}" != Xset; then
++# find a string as large as possible, as long as the shell can cope with it
++ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
++ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
++ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
++ echo_test_string="`eval $cmd`" &&
++ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
++ then
++ break
++ fi
++ done
++fi
++
++if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ :
++else
++ # The Solaris, AIX, and Digital Unix default echo programs unquote
++ # backslashes. This makes it impossible to quote backslashes using
++ # echo "$something" | sed 's/\\/\\\\/g'
++ #
++ # So, first we look for a working echo in the user's PATH.
++
++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for dir in $PATH /usr/ucb; do
++ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
++ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$dir/echo"
++ break
+ fi
++ done
++ IFS="$save_ifs"
+
+- if test $ac_libnet_have_pf_packet = choked; then
+- AC_MSG_RESULT(test program choked... assuming no)
+- elif test $ac_libnet_have_pf_packet = yes; then
+- AC_DEFINE(HAVE_PF_PACKET)
+- LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_PF_PACKET"
++ if test "X$echo" = Xecho; then
++ # We didn't find a better echo, so look for alternatives.
++ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # This shell has a builtin print -r that does the trick.
++ echo='print -r'
++ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
++ test "X$CONFIG_SHELL" != X/bin/ksh; then
++ # If we have ksh, try running configure again with it.
++ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
++ export ORIGINAL_CONFIG_SHELL
++ CONFIG_SHELL=/bin/ksh
++ export CONFIG_SHELL
++ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
++ else
++ # Try using printf.
++ echo='printf %s\n'
++ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # Cool, printf works
++ :
++ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
++ export CONFIG_SHELL
++ SHELL="$CONFIG_SHELL"
++ export SHELL
++ echo="$CONFIG_SHELL [$]0 --fallback-echo"
++ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$CONFIG_SHELL [$]0 --fallback-echo"
++ else
++ # maybe with a smaller string...
++ prev=:
++
++ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
++ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
++ then
++ break
++ fi
++ prev="$cmd"
++ done
++
++ if test "$prev" != 'sed 50q "[$]0"'; then
++ echo_test_string=`eval $prev`
++ export echo_test_string
++ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
++ else
++ # Oops. We lost completely, so just stick with echo.
++ echo=echo
++ fi
++ fi
+ fi
++ fi
++fi
++fi
++
++# Copy echo and quote the copy suitably for passing to libtool from
++# the Makefile, instead of quoting the original, which is used later.
++ECHO=$echo
++if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
++ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
++fi
++
++AC_SUBST(ECHO)
++AC_DIVERT_POP
++])# _LT_AC_PROG_ECHO_BACKSLASH
++
++# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
++# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
++# ------------------------------------------------------------------
++AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
++[if test "$cross_compiling" = yes; then :
++ [$4]
++else
++ AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
++ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
++ lt_status=$lt_dlunknown
++ cat > conftest.$ac_ext <<EOF
++[#line __oline__ "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}]
++EOF
++ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 2>/dev/null
++ lt_status=$?
++ case x$lt_status in
++ x$lt_dlno_uscore) $1 ;;
++ x$lt_dlneed_uscore) $2 ;;
++ x$lt_unknown|x*) $3 ;;
++ esac
++ else :
++ # compilation failed
++ $3
++ fi
++fi
++rm -fr conftest*
++])# _LT_AC_TRY_DLOPEN_SELF
++
++# AC_LIBTOOL_DLOPEN_SELF
++# -------------------
++AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
++[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
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ lt_cv_dlopen="LoadLibrary"
++ lt_cv_dlopen_libs=
++ ;;
++
++ *)
++ 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="-dld"],
++ [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="-dld"])
++ ])
++ ])
++ ])
++ ])
++ ])
++ ;;
++ 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"
++ AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
++ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
++
++ save_LDFLAGS="$LDFLAGS"
++ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+- if test $ac_libnet_have_pf_packet != choked; then
+- AC_MSG_RESULT($ac_libnet_have_pf_packet)
++ save_LIBS="$LIBS"
++ LIBS="$lt_cv_dlopen_libs $LIBS"
++
++ AC_CACHE_CHECK([whether a program can dlopen itself],
++ lt_cv_dlopen_self, [dnl
++ _LT_AC_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
++ LDFLAGS="$LDFLAGS $link_static_flag"
++ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
++ lt_cv_dlopen_self_static, [dnl
++ _LT_AC_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
+- rm -f pf_packet-test* core core.pf_packet-test
++
++ CPPFLAGS="$save_CPPFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++ LIBS="$save_LIBS"
+ ;;
+- esac])
++ 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
++])# AC_LIBTOOL_DLOPEN_SELF
++
++AC_DEFUN([_LT_AC_LTCONFIG_HACK],
++[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed='sed -e s/^X//'
++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'
++
++# Constants:
++rm="rm -f"
++
++# Global variables:
++default_ofile=libtool
++can_build_shared=yes
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++ltmain="$ac_aux_dir/ltmain.sh"
++ofile="$default_ofile"
++with_gnu_ld="$lt_cv_prog_gnu_ld"
++need_locks="$enable_libtool_lock"
++
++old_CC="$CC"
++old_CFLAGS="$CFLAGS"
++
++# Set sane defaults for various variables
++test -z "$AR" && AR=ar
++test -z "$AR_FLAGS" && AR_FLAGS=cru
++test -z "$AS" && AS=as
++test -z "$CC" && CC=cc
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++test -z "$LD" && LD=ld
++test -z "$LN_S" && LN_S="ln -s"
++test -z "$MAGIC_CMD" && MAGIC_CMD=file
++test -z "$NM" && NM=nm
++test -z "$OBJDUMP" && OBJDUMP=objdump
++test -z "$RANLIB" && RANLIB=:
++test -z "$STRIP" && STRIP=:
++test -z "$ac_objext" && ac_objext=o
++
++if test x"$host" != x"$build"; then
++ ac_tool_prefix=${host_alias}-
++else
++ ac_tool_prefix=
++fi
++
++# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
++case $host_os in
++linux-gnu*) ;;
++linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
++esac
++
++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
++
++# Determine commands to create old-style static archives.
++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
++old_postinstall_cmds='chmod 644 $oldlib'
++old_postuninstall_cmds=
++
++if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++fi
++
++# Allow CC to be a program name with arguments.
++set dummy $CC
++compiler="[$]2"
++
++AC_MSG_CHECKING([for objdir])
++rm -f .libs 2>/dev/null
++mkdir .libs 2>/dev/null
++if test -d .libs; then
++ objdir=.libs
++else
++ # MS-DOS does not allow filenames that begin with a dot.
++ objdir=_libs
++fi
++rmdir .libs 2>/dev/null
++AC_MSG_RESULT($objdir)
++
++
++AC_ARG_WITH(pic,
++[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
++pic_mode="$withval", pic_mode=default)
++test -z "$pic_mode" && pic_mode=default
++
++# We assume here that the value for lt_cv_prog_cc_pic will not be cached
++# in isolation, and that seeing it set (from the cache) indicates that
++# the associated values are set (in the cache) correctly too.
++AC_MSG_CHECKING([for $compiler option to produce PIC])
++AC_CACHE_VAL(lt_cv_prog_cc_pic,
++[ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_shlib=
++ lt_cv_prog_cc_wl=
++ lt_cv_prog_cc_static=
++ lt_cv_prog_cc_no_builtin=
++ lt_cv_prog_cc_can_build_shared=$can_build_shared
++
++ if test "$GCC" = yes; then
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-static'
++
++ case $host_os in
++ aix*)
++ # Below there is a dirty hack to force normal static linking with -ldl
++ # The problem is because libdl dynamically linked with both libc and
++ # libC (AIX C++ library), which obviously doesn't included in libraries
++ # list by gcc. This cause undefined symbols with -static flags.
++ # This hack allows C programs to be linked with "-static -ldl", but
++ # not sure about C++ programs.
++ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
++ ;;
++ amigaos*)
++ # 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
++ ;;
++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++ # PIC is the default for these OSes.
++ ;;
++ darwin* | rhapsody*)
++ # PIC is the default on this platform
++ # Common symbols not allowed in MH_DYLIB files
++ lt_cv_prog_cc_pic='-fno-common'
++ ;;
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ lt_cv_prog_cc_pic=-Kconform_pic
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic='-fPIC'
++ ;;
++ esac
++ else
++ # PORTME Check for PIC flags for the system compiler.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ lt_cv_prog_cc_wl='-Wl,'
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ lt_cv_prog_cc_static='-Bstatic'
++ else
++ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ fi
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
++ lt_cv_prog_cc_pic='+Z'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ # PIC (with -KPIC) is the default.
++ ;;
++
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++
++ newsos6)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ osf3* | osf4* | osf5*)
++ # All OSF/1 code is PIC.
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ ;;
++
++ sco3.2v5*)
++ lt_cv_prog_cc_pic='-Kpic'
++ lt_cv_prog_cc_static='-dn'
++ lt_cv_prog_cc_shlib='-belf'
++ ;;
++
++ solaris*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ sunos4*)
++ lt_cv_prog_cc_pic='-PIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Qoption ld '
++ ;;
++
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ uts4*)
++ lt_cv_prog_cc_pic='-pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ sysv4*MP*)
++ if test -d /usr/nec ;then
++ lt_cv_prog_cc_pic='-Kconform_pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ fi
++ ;;
++
++ *)
++ lt_cv_prog_cc_can_build_shared=no
++ ;;
++ esac
++ fi
+ ])
++if test -z "$lt_cv_prog_cc_pic"; then
++ AC_MSG_RESULT([none])
++else
++ AC_MSG_RESULT([$lt_cv_prog_cc_pic])
+
+-dnl
+-dnl Looks for a previous libnet version and attempts to determine which verion
+-dnl it is. Version 0.8 was the first version that actually knew internally
+-dnl what version it was.
+-dnl
+-dnl usage:
+-dnl
+-dnl AC_LIBNET_CHECK_LIBNET_VERSION
+-dnl
+-dnl results:
+-dnl
+-dnl
+-dnl
++ # Check to make sure the pic_flag actually works.
++ AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
++ AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
++ AC_TRY_COMPILE([], [], [dnl
++ case $host_os in
++ hpux9* | hpux10* | hpux11*)
++ # On HP-UX, both CC and GCC only warn that PIC is supported... then
++ # they create non-PIC objects. So, if there were any warnings, we
++ # assume that PIC is not supported.
++ if test -s conftest.err; then
++ lt_cv_prog_cc_pic_works=no
++ else
++ lt_cv_prog_cc_pic_works=yes
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic_works=yes
++ ;;
++ esac
++ ], [dnl
++ lt_cv_prog_cc_pic_works=no
++ ])
++ CFLAGS="$save_CFLAGS"
++ ])
+
+-AC_DEFUN(AC_LIBNET_CHECK_LIBNET_VER,
+-[
+- AC_CHECK_LIB(net, libnet_build_ip, AC_MSG_CHECKING(version) \
++ if test "X$lt_cv_prog_cc_pic_works" = Xno; then
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_can_build_shared=no
++ else
++ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
++ fi
+
+-changequote(<<, >>)dnl
+- if [[ ! -f $LIB_PREFIX/libnet.a ]] ; then
+-changequote([, ])dnl
+- AC_MSG_RESULT($LIB_PREFIX/libnet.a doesn't exist)
+- AC_MSG_RESULT(previous libnet install lives elsewhere, you should probably find it)
+- else
+- __LIBNET_VERSION=`strings $LIB_PREFIX/libnet.a | grep "libnet version"\
+- | cut -f3 -d" "`;\
+- if test -z "$__LIBNET_VERSION"; then
+- AC_MSG_RESULT(<0.8)
+- else
+- AC_MSG_RESULT($__LIBNET_VERSION)
+- fi
+- fi\
+- )
++ AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
++fi
++
++# Check for any special shared library compilation flags.
++if test -n "$lt_cv_prog_cc_shlib"; then
++ AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
++ if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
++ else
++ AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
++ lt_cv_prog_cc_can_build_shared=no
++ fi
++fi
++
++AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
++AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
++ lt_cv_prog_cc_static_works=no
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
++ AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
++ LDFLAGS="$save_LDFLAGS"
+ ])
+
++# Belt *and* braces to stop my trousers falling down:
++test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
++AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
+
+-dnl
+-dnl Checks to see if this linux kernel uses ip_sum or ip_csum
+-dnl (Pulled from queso)
+-dnl
+-dnl usage:
+-dnl
+-dnl AC_LIBNET_CHECK_IP_CSUM
+-dnl
+-dnl results:
+-dnl
+-dnl HAVE_STRUCT_IP_CSUM (DEFINED)
+-dnl
++pic_flag="$lt_cv_prog_cc_pic"
++special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
++wl="$lt_cv_prog_cc_wl"
++link_static_flag="$lt_cv_prog_cc_static"
++no_builtin_flag="$lt_cv_prog_cc_no_builtin"
++can_build_shared="$lt_cv_prog_cc_can_build_shared"
+
+-AC_DEFUN(AC_LIBNET_CHECK_IP_CSUM,
+-[
+- AC_MSG_CHECKING([struct ip contains ip_csum])
+- AC_TRY_COMPILE([
+- #define __BSD_SOURCE
+- #define _BSD_SOURCE
+- #include <sys/types.h>
+- #include <netinet/in.h>
+- #include <netinet/in_systm.h>
+- #include <netinet/ip.h>],
+- [
+- struct ip ip;
+- ip.ip_csum = 0;
+- ],
+- [AC_MSG_RESULT(yes);
+- AC_DEFINE(HAVE_STRUCT_IP_CSUM)],
+- [AC_MSG_RESULT(no);
+- ])
++
++# Check to see if options -o and -c are simultaneously supported by compiler
++AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
++AC_CACHE_VAL([lt_cv_compiler_c_o], [
++$rm -r conftest 2>/dev/null
++mkdir conftest
++cd conftest
++echo "int some_variable = 0;" > conftest.$ac_ext
++mkdir out
++# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
++# that will create temporary files in the current directory regardless of
++# the output directory. Thus, making CWD read-only will cause this test
++# to fail, enabling locking or at least warning the user not to do parallel
++# builds.
++chmod -w .
++save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
++compiler_c_o=no
++if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
++ if test -s out/conftest.err; then
++ lt_cv_compiler_c_o=no
++ else
++ lt_cv_compiler_c_o=yes
++ fi
++else
++ # Append any errors to the config.log.
++ cat out/conftest.err 1>&AC_FD_CC
++ lt_cv_compiler_c_o=no
++fi
++CFLAGS="$save_CFLAGS"
++chmod u+w .
++$rm conftest* out/*
++rmdir out
++cd ..
++rmdir conftest
++$rm -r conftest 2>/dev/null
+ ])
++compiler_c_o=$lt_cv_compiler_c_o
++AC_MSG_RESULT([$compiler_c_o])
+
+-dnl
+-dnl Checks to see if unaligned memory accesses fail
+-dnl (Pulled from libpcap)
+-dnl
+-dnl usage:
+-dnl
+-dnl AC_LBL_UNALIGNED_ACCESS
+-dnl
+-dnl results:
+-dnl
+-dnl LBL_ALIGN (DEFINED)
+-dnl
++if test x"$compiler_c_o" = x"yes"; then
++ # Check to see if we can write to a .lo
++ AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
++ AC_CACHE_VAL([lt_cv_compiler_o_lo], [
++ lt_cv_compiler_o_lo=no
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -c -o conftest.lo"
++ save_objext="$ac_objext"
++ ac_objext=lo
++ AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ lt_cv_compiler_o_lo=no
++ else
++ lt_cv_compiler_o_lo=yes
++ fi
++ ])
++ ac_objext="$save_objext"
++ CFLAGS="$save_CFLAGS"
++ ])
++ compiler_o_lo=$lt_cv_compiler_o_lo
++ AC_MSG_RESULT([$compiler_o_lo])
++else
++ compiler_o_lo=no
++fi
+
+-AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
+- [AC_MSG_CHECKING(if unaligned accesses fail)
+- AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
+- [case "$target_cpu" in
+-
+- alpha|hp*|mips|sparc)
+- ac_cv_lbl_unaligned_fail=yes
+- ;;
+-
+- *)
+- cat >conftest.c <<EOF
+-# include <sys/types.h>
+-# include <sys/wait.h>
+-# include <stdio.h>
+- unsigned char a[[5]] = { 1, 2, 3, 4, 5 };
+- main()
+- {
+- unsigned int i;
+- pid_t pid;
+- int status;
+- /* avoid "core dumped" message */
+- pid = fork();
+- if (pid < 0)
+- {
+- exit(2);
+- }
+- if (pid > 0)
+- {
+- /* parent */
+- pid = waitpid(pid, &status, 0);
+- if (pid < 0)
+- {
+- exit(3);
+- }
+- exit(!WIFEXITED(status));
+- }
+- /* child */
+- i = *(unsigned int *)&a[[1]];
+- printf("%d\n", i);
+- exit(0);
+- }
+-EOF
+- ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
+- conftest.c $LIBS > /dev/null 2>&1
+- # Oopz 4.3 BSD doesn't have this. Sorry.
+- if test ! -x conftest ; then
+- dnl failed to compile for some reason
+- ac_cv_lbl_unaligned_fail=yes
+- else
+- ./conftest > conftest.out
+- if test ! -s conftest.out ; then
+- ac_cv_lbl_unaligned_fail=yes
+- else
+- ac_cv_lbl_unaligned_fail=no
+- fi
+- fi
+- rm -f conftest* core core.conftest
+- ;;
+- esac])
+- AC_MSG_RESULT($ac_cv_lbl_unaligned_fail)
+- if test $ac_cv_lbl_unaligned_fail = yes ; then
+- AC_DEFINE(LBL_ALIGN)
++# Check to see if we can do hard links to lock some files if needed
++hard_links="nottested"
++if test "$compiler_c_o" = 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
++
++if test "$GCC" = yes; then
++ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
++ AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
++ echo "int some_variable = 0;" > conftest.$ac_ext
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
++ compiler_rtti_exceptions=no
++ AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ compiler_rtti_exceptions=no
++ else
++ compiler_rtti_exceptions=yes
+ fi
+-])
++ ])
++ CFLAGS="$save_CFLAGS"
++ AC_MSG_RESULT([$compiler_rtti_exceptions])
+
++ if test "$compiler_rtti_exceptions" = "yes"; then
++ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
++ else
++ no_builtin_flag=' -fno-builtin'
++ fi
++fi
+
+-dnl
+-dnl Checks endianess
+-dnl
+-dnl usage:
+-dnl
+-dnl AC_LIBNET_ENDIAN_CHECK
+-dnl
+-dnl results:
+-dnl
+-dnl LIBNET_BIG_ENDIAN = 1 or
+-dnl LIBNET_LIL_ENDIAN = 1
+-dnl
++# See if the linker supports building shared libraries.
++AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
+
+-AC_DEFUN(AC_LIBNET_ENDIAN_CHECK,
+- [AC_MSG_CHECKING(machine endianess)
++allow_undefined_flag=
++no_undefined_flag=
++need_lib_prefix=unknown
++need_version=unknown
++# when you set need_version to no, make sure it does not cause -set_version
++# flags to be left without arguments
++archive_cmds=
++archive_expsym_cmds=
++old_archive_from_new_cmds=
++old_archive_from_expsyms_cmds=
++export_dynamic_flag_spec=
++whole_archive_flag_spec=
++thread_safe_flag_spec=
++hardcode_into_libs=no
++hardcode_libdir_flag_spec=
++hardcode_libdir_separator=
++hardcode_direct=no
++hardcode_minus_L=no
++hardcode_shlibpath_var=unsupported
++runpath_var=
++link_all_deplibs=unknown
++always_export_symbols=no
++export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
++# include_expsyms should be a list of space-separated symbols to be *always*
++# included in the symbol list
++include_expsyms=
++# exclude_expsyms can be an egrep regular expression 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_"
++# 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.
++extract_expsyms_cmds=
+
+- cat > conftest.c << EOF
+-# include <stdio.h>
+-# include <stdlib.h>
+-
+- int main()
+- {
+- union
+- {
+- short s;
+- char c[[sizeof(short)]];
+- } un;
+-
+- un.s = 0x0102;
+- if (sizeof (short) == 2)
+- {
+- if (un.c [[0]] == 1 && un.c [[1]] == 2)
+- {
+- printf("B\n");
+- }
+- else
+- {
+- if (un.c [[0]] == 2 && un.c [[1]] == 1)
+- {
+- printf("L\n");
+- }
+- }
+- }
+- else
+- {
+- printf("?\n");
+- }
+- return (EXIT_SUCCESS);
+- }
+-EOF
+- ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS > /dev/null 2>&1
+- # Oopz 4.3 BSD doesn't have this. Sorry.
+- if test ! -x conftest ; then
+-dnl failed to compile for some reason
+- ac_cv_libnet_endianess=unknown
+- else
+- ./conftest > conftest.out
+- result=`cat conftest.out`
+- if test $result = "B"; then
+- ac_cv_libnet_endianess=big
+- elif test $result = "L"; then
+- ac_cv_libnet_endianess=lil
+- else
+- ac_cv_libnet_endianess=unknown
+- fi
+- fi
+- rm -f conftest* core core.conftest
+-
+- AC_MSG_RESULT($ac_cv_libnet_endianess)
+-
+- if test $ac_cv_libnet_endianess = big ; then
+- AC_DEFINE(LIBNET_BIG_ENDIAN)
+- LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
+- elif test $ac_cv_libnet_endianess = lil ; then
+- AC_DEFINE(LIBNET_LIL_ENDIAN)
+- LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
+- fi
+- ])
++case $host_os in
++cygwin* | mingw* | pw32*)
++ # 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
++ ;;
++openbsd*)
++ with_gnu_ld=no
++ ;;
++esac
++
++ld_shlibs=yes
++if test "$with_gnu_ld" = yes; then
++ # If archive_cmds runs LD, not CC, wlarc should be empty
++ wlarc='${wl}'
++
++ # See if GNU ld supports shared libraries.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ # On AIX, the GNU linker is very broken
++ # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
++ ld_shlibs=no
++ cat <<EOF 1>&2
++
++*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
++*** so that a non-GNU linker is found, and then restart.
++
++EOF
++ ;;
++
++ amigaos*)
++ 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
++
++ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++ # that the semantics of dynamic libraries on AmigaOS, at least up
++ # to version 4, is to share data among multiple programs linked
++ # with the same dynamic library. Since this doesn't match the
++ # behavior of shared libraries on other platforms, we can use
++ # them.
++ ld_shlibs=no
++ ;;
++
++ beos*)
++ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
++ allow_undefined_flag=unsupported
++ # Joseph Beckenbach <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*)
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec='-L$libdir'
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++
++ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
++ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
++ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
++ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
++ else $CC -o impgen impgen.c ; fi)~
++ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
++
++ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
++
++ # cygwin and mingw dlls have different entry points and sets of symbols
++ # to exclude.
++ # FIXME: what about values for MSVC?
++ dll_entry=__cygwin_dll_entry@12
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
++ case $host_os in
++ mingw*)
++ # mingw values
++ dll_entry=_DllMainCRTStartup@12
++ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
++ ;;
++ esac
++
++ # mingw and cygwin differ, and it's simplest to just exclude the union
++ # of the two symbol sets.
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
++
++ # recent cygwin and mingw systems supply a stub DllMain which the user
++ # can override, but on older systems we have to supply one (in ltdll.c)
++ if test "x$lt_cv_need_dllmain" = "xyes"; then
++ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
++ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
++ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
++ else
++ ltdll_obj=
++ ltdll_cmds=
++ fi
++
++ # Extract the symbol export list from an `--export-all' def file,
++ # then regenerate the def file from the symbol export list, so that
++ # the compiled dll only exports the symbol export list.
++ # Be careful not to strip the DATA tag left be newer dlltools.
++ export_symbols_cmds="$ltdll_cmds"'
++ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
++ sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
++
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is.
++ # If DATA tags from a recent dlltool are present, honour them!
++ 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;
++ _lt_hint=1;
++ cat $export_symbols | while read symbol; do
++ set dummy \$symbol;
++ case \[$]# in
++ 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
++ 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
++ *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
++ esac;
++ _lt_hint=`expr 1 + \$_lt_hint`;
++ done;
++ fi~
++ '"$ltdll_cmds"'
++ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
++ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
++ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
++ ;;
++
++ 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ fi
++ ;;
++
++ solaris* | sysv5*)
++ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
++ ld_shlibs=no
++ cat <<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.
++
++EOF
++ elif $LD --help 2>&1 | egrep ': 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
++ ;;
++
++ 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 | egrep ': 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" = yes; then
++ runpath_var=LD_RUN_PATH
++ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
++ export_dynamic_flag_spec='${wl}--export-dynamic'
++ case $host_os in
++ cygwin* | mingw* | pw32*)
++ # dlltool doesn't understand --whole-archive et. al.
++ whole_archive_flag_spec=
++ ;;
++ *)
++ # ancient GNU ld didn't support --whole-archive et. al.
++ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
++ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ else
++ whole_archive_flag_spec=
++ fi
++ ;;
++ esac
++ fi
++else
++ # PORTME fill in a description of your system's linker (not GNU ld)
++ 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 "$link_static_flag"; then
++ # Neither direct hardcoding nor static linking is supported with a
++ # broken collect2.
++ hardcode_direct=unsupported
++ fi
++ ;;
++
++ aix4* | aix5*)
++ 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]].*|aix5*)
++ 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.
++
++ hardcode_direct=yes
++ archive_cmds=''
++ hardcode_libdir_separator=':'
++ if test "$GCC" = yes; then
++ case $host_os in aix4.[[012]]|aix4.[[012]].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ # It fails to find uninstalled libraries when the uninstalled
++ # path is not listed in the libpath. Setting hardcode_minus_L
++ # to unsupported forces relinking
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++
++ shared_flag='-shared'
++ else
++ # not using gcc
++ if test "$host_cpu" = ia64; then
++ shared_flag='${wl}-G'
++ else
++ if test "$aix_use_runtimelinking" = yes; then
++ shared_flag='${wl}-G'
++ else
++ shared_flag='${wl}-bM:SRE'
++ fi
++ fi
++ fi
++
++ # It seems that -bexpall can do strange things, 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'
++ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
++ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ else
++ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Warning - without using the other run time loading flags,
++ # -berok will link without error, but may produce a broken library.
++ allow_undefined_flag='${wl}-berok'
++ # This is a bit strange, but is similar to how AIX traditionally builds
++ # it's shared libraries.
++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
++ fi
++ fi
++ ;;
++
++ amigaos*)
++ 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
++ # see comment about different semantics on the GNU ld section
++ ld_shlibs=no
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ # 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
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''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"`'
++ ;;
++
++ darwin* | rhapsody*)
++ case "$host_os" in
++ rhapsody* | darwin1.[[012]])
++ allow_undefined_flag='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ allow_undefined_flag='-flat_namespace -undefined suppress'
++ ;;
++ esac
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
++ # `"' quotes if we put them in here... so don't!
++ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
++ # We need to add '_' to the symbols in $export_symbols first
++ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ whole_archive_flag_spec='-all_load $convenience'
++ ;;
++
++ freebsd1*)
++ ld_shlibs=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*)
++ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ case $host_os in
++ hpux9*) 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' ;;
++ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
++ esac
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=yes
++ hardcode_minus_L=yes # Not in the search PATH, but as the default
++ # location of the library.
++ export_dynamic_flag_spec='${wl}-E'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ else
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ 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
++ ;;
++
++ openbsd*)
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ 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'
++ 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
++ ;;
++
++ 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ else
++ allow_undefined_flag=' -expect_unresolved \*'
++ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ fi
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++
++ osf4* | osf5*) # as osf3* with the addition of -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" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
++ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
++
++ #Both c and cxx compiler support -rpath directly
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ ;;
++
++ sco3.2v5*)
++ 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
++ export_dynamic_flag_spec='${wl}-Bexport'
++ ;;
++
++ solaris*)
++ # gcc --version < 3.0 without binutils cannot create self contained
++ # shared libraries reliably, requiring libgcc.a to resolve some of
++ # the object symbols generated in some cases. Libraries that use
++ # assert need libgcc.a to resolve __eprintf, for example. Linking
++ # a copy of libgcc.a into every shared library to guarantee resolving
++ # such symbols causes other problems: According to Tim Van Holder
++ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
++ # (to the application) exception stack for one thing.
++ no_undefined_flag=' -z defs'
++ if test "$GCC" = yes; then
++ case `$CC --version 2>/dev/null` in
++ [[12]].*)
++ cat <<EOF 1>&2
++
++*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
++*** create self contained shared libraries on Solaris systems, without
++*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
++*** -no-undefined support, which will at least allow you to build shared
++*** libraries. However, you may find that when you link such libraries
++*** into an application without using GCC, you have to manually add
++*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
++*** upgrade to a newer version of GCC. Another option is to rebuild your
++*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
++
++EOF
++ no_undefined_flag=
++ ;;
++ esac
++ fi
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_shlibpath_var=no
++ case $host_os in
++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
++ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
++ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
++ esac
++ 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'
++ ;;
++
++ sysv5*)
++ no_undefined_flag=' -z text'
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec=
++ hardcode_shlibpath_var=no
++ runpath_var='LD_RUN_PATH'
++ ;;
++
++ uts4*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ dgux*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ 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.2uw2*)
++ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_direct=yes
++ hardcode_minus_L=no
++ hardcode_shlibpath_var=no
++ hardcode_runpath_var=yes
++ runpath_var=LD_RUN_PATH
++ ;;
++
++ sysv5uw7* | unixware7*)
++ no_undefined_flag='${wl}-z ${wl}text'
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ else
++ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ fi
++ runpath_var='LD_RUN_PATH'
++ hardcode_shlibpath_var=no
++ ;;
++
++ *)
++ ld_shlibs=no
++ ;;
++ esac
++fi
++AC_MSG_RESULT([$ld_shlibs])
++test "$ld_shlibs" = no && can_build_shared=no
++
++# Check hardcoding attributes.
++AC_MSG_CHECKING([how to hardcode library paths into programs])
++hardcode_action=
++if test -n "$hardcode_libdir_flag_spec" || \
++ test -n "$runpath_var"; then
++
++ # We can hardcode non-existant 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 "$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
++AC_MSG_RESULT([$hardcode_action])
++
++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
++ AC_MSG_RESULT([no])
++fi
++
++reload_cmds='$LD$reload_flag -o $output$reload_objs'
++test -z "$deplibs_check_method" && deplibs_check_method=unknown
++
++# PORTME Fill in your ld.so characteristics
++AC_MSG_CHECKING([dynamic linker characteristics])
++library_names_spec=
++libname_spec='lib$name'
++soname_spec=
++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"
++sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
++
++case $host_os in
++aix3*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix $libname.a'
++ shlibpath_var=LIBPATH
++
++ # AIX has no versioning support, so we append a major version to the name.
++ soname_spec='${libname}${release}.so$major'
++ ;;
++
++aix4* | aix5*)
++ 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}.so$major ${libname}${release}.so$versuffix $libname.so'
++ 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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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}.so$major'
++ fi
++ shlibpath_var=LIBPATH
++ fi
++ hardcode_into_libs=yes
++ ;;
++
++amigaos*)
++ 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=`$echo "X$lib" | $Xsed -e '\''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'
++ ;;
++
++beos*)
++ library_names_spec='${libname}.so'
++ dynamic_linker="$host_os ld.so"
++ shlibpath_var=LIBRARY_PATH
++ ;;
++
++bsdi4*)
++ version_type=linux
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
++ export_dynamic_flag_spec=-rdynamic
++ # the default ld.so.conf also contains /usr/contrib/lib and
++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
++ # libtool to hard-code these into programs
++ ;;
++
++cygwin* | mingw* | pw32*)
++ version_type=windows
++ need_version=no
++ need_lib_prefix=no
++ case $GCC,$host_os in
++ yes,cygwin*)
++ library_names_spec='$libname.dll.a'
++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
++ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog .libs/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $rm \$dlpath'
++ ;;
++ yes,mingw*)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
++ ;;
++ yes,pw32*)
++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ ;;
++ *)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $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
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes.
++ library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
++ soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
++ shlibpath_overrides_runpath=yes
++ shlibpath_var=DYLD_LIBRARY_PATH
++ ;;
++
++freebsd1*)
++ dynamic_linker=no
++ ;;
++
++kfreebsd*-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU/FreeBSD ld.so'
++ ;;
++
++freebsd*)
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ version_type=freebsd-$objformat
++ case $version_type in
++ freebsd-elf*)
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
++ need_version=no
++ need_lib_prefix=no
++ ;;
++ freebsd-*)
++ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
++ need_version=yes
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_os in
++ freebsd2*)
++ shlibpath_overrides_runpath=yes
++ ;;
++ *)
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ ;;
++ esac
++ ;;
++
++gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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.
++ dynamic_linker="$host_os dld.sl"
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ shlibpath_var=SHLIB_PATH
++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
++ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
++ soname_spec='${libname}${release}.sl$major'
++ # HP-UX runs *really* slowly unless shared libraries are mode 555.
++ postinstall_cmds='chmod 555 $lib'
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ nonstopux*) version_type=nonstopux ;;
++ *) version_type=irix ;;
++ esac
++ need_lib_prefix=no
++ need_version=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
++ case $host_os in
++ irix5* | nonstopux*)
++ libsuff= shlibsuff=
++ ;;
++ *)
++ case $LD in # libtool.m4 will add one of these switches to LD
++ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
++ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
++ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
++ *) libsuff= shlibsuff= libmagic=never-match;;
++ esac
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
++ shlibpath_overrides_runpath=no
++ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
++ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
++ ;;
++
++# No shared lib support for Linux oldld, aout, or coff.
++linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
++ dynamic_linker=no
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # 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
++
++ # 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}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ dynamic_linker='NetBSD (a.out) ld.so'
++ else
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
++ soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=yes
++ ;;
++
++openbsd*)
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ 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
++ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++os2*)
++ libname_spec='$name'
++ need_lib_prefix=no
++ library_names_spec='$libname.dll $libname.a'
++ dynamic_linker='OS/2 ld.exe'
++ shlibpath_var=LIBPATH
++ ;;
++
++osf3* | osf4* | osf5*)
++ version_type=osf
++ need_version=no
++ need_lib_prefix=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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"
++ hardcode_into_libs=yes
++ ;;
++
++sco3.2v5*)
++ version_type=osf
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++solaris*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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}.so$versuffix ${libname}.so$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.2uw2* | sysv4.3* | sysv5*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_vendor in
++ sni)
++ shlibpath_overrides_runpath=no
++ need_lib_prefix=no
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ 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
++ ;;
++
++uts4*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++dgux*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++sysv4*MP*)
++ if test -d /usr/nec ;then
++ version_type=linux
++ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
++ soname_spec='$libname.so.$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ fi
++ ;;
++
++*)
++ dynamic_linker=no
++ ;;
++esac
++AC_MSG_RESULT([$dynamic_linker])
++test "$dynamic_linker" = no && can_build_shared=no
++
++# Report the final consequences.
++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
++ ;;
++
++aix4*)
++ 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])
++
++if test "$hardcode_action" = relink; 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
++
++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
++
++AC_LIBTOOL_DLOPEN_SELF
++
++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.
++ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
++ AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
++ [$rm conftest*
++ echo 'static int dummy;' > conftest.$ac_ext
++
++ if AC_TRY_EVAL(ac_compile); then
++ soname=conftest
++ lib=conftest
++ libobjs=conftest.$ac_objext
++ deplibs=
++ wl=$lt_cv_prog_cc_wl
++ compiler_flags=-v
++ linker_flags=-v
++ verstring=
++ output_objdir=.
++ libname=conftest
++ save_allow_undefined_flag=$allow_undefined_flag
++ allow_undefined_flag=
++ if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
++ then
++ lt_cv_archive_cmds_need_lc=no
++ else
++ lt_cv_archive_cmds_need_lc=yes
++ fi
++ allow_undefined_flag=$save_allow_undefined_flag
++ else
++ cat conftest.err 1>&5
++ fi])
++ AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
++ ;;
++ esac
++fi
++need_lc=${lt_cv_archive_cmds_need_lc-yes}
++
++# The second clause should only fire when bootstrapping the
++# libtool distribution, otherwise you forgot to ship ltmain.sh
++# with your package, and you will get complaints that there are
++# no rules to generate ltmain.sh.
++if test -f "$ltmain"; then
++ :
++else
++ # If there is no Makefile yet, we rely on a make rule to execute
++ # `config.status --recheck' to rerun these tests and create the
++ # libtool script then.
++ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
++ if test -f "$ltmain_in"; then
++ test -f Makefile && make "$ltmain"
++ fi
++fi
++
++if test -f "$ltmain"; then
++ trap "$rm \"${ofile}T\"; exit 1" 1 2 15
++ $rm -f "${ofile}T"
++
++ echo creating $ofile
++
++ # Now quote all the things that may contain metacharacters while being
++ # careful not to overquote the AC_SUBSTed values. We take copies of the
++ # variables and quote the copies for generation of the libtool script.
++ for var in echo old_CC old_CFLAGS SED \
++ AR AR_FLAGS CC LD LN_S NM SHELL STRIP \
++ reload_flag reload_cmds wl \
++ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
++ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
++ library_names_spec soname_spec \
++ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
++ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
++ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
++ old_striplib striplib file_magic_cmd export_symbols_cmds \
++ deplibs_check_method allow_undefined_flag no_undefined_flag \
++ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
++ global_symbol_to_c_name_address \
++ hardcode_libdir_flag_spec hardcode_libdir_separator \
++ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
++ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
++
++ case $var in
++ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
++ old_postinstall_cmds | old_postuninstall_cmds | \
++ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
++ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
++ postinstall_cmds | postuninstall_cmds | \
++ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
++ # Double-quote double-evaled strings.
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
++ ;;
++ *)
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
++ ;;
++ esac
++ done
++
++ cat <<__EOF__ > "${ofile}T"
++#! $SHELL
++
++# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
++# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
++# NOTE: Changes made to this file will be lost: look at ltmain.sh.
++#
++# Copyright (C) 1996-2000 Free Software Foundation, Inc.
++# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# A sed that does not truncate output.
++SED=$lt_SED
++
++# Sed that helps us avoid accidentally triggering echo(1) options like -n.
++Xsed="${SED} -e s/^X//"
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++# ### BEGIN LIBTOOL CONFIG
++
++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++
++# Shell to use when invoking shell scripts.
++SHELL=$lt_SHELL
++
++# Whether or not to build shared libraries.
++build_libtool_libs=$enable_shared
++
++# Whether or not to build static libraries.
++build_old_libs=$enable_static
++
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$need_lc
++
++# Whether or not to optimize for fast installation.
++fast_install=$enable_fast_install
++
++# The host system.
++host_alias=$host_alias
++host=$host
++
++# An echo program that does not interpret backslashes.
++echo=$lt_echo
++
++# The archiver.
++AR=$lt_AR
++AR_FLAGS=$lt_AR_FLAGS
++
++# The default C compiler.
++CC=$lt_CC
++
++# Is the compiler the GNU C compiler?
++with_gcc=$GCC
++
++# The linker used to build libraries.
++LD=$lt_LD
++
++# Whether we need hard or soft links.
++LN_S=$lt_LN_S
++
++# A BSD-compatible nm program.
++NM=$lt_NM
++
++# A symbol stripping program
++STRIP=$lt_STRIP
++
++# Used to examine libraries when file_magic_cmd begins "file"
++MAGIC_CMD=$MAGIC_CMD
++
++# Used on cygwin: DLL creation program.
++DLLTOOL="$DLLTOOL"
++
++# Used on cygwin: object dumper.
++OBJDUMP="$OBJDUMP"
++
++# Used on cygwin: assembler.
++AS="$AS"
++
++# The name of the directory that contains temporary libtool files.
++objdir=$objdir
++
++# How to create reloadable object files.
++reload_flag=$lt_reload_flag
++reload_cmds=$lt_reload_cmds
++
++# How to pass a linker flag through the compiler.
++wl=$lt_wl
++
++# Object file suffix (normally "o").
++objext="$ac_objext"
++
++# Old archive suffix (normally "a").
++libext="$libext"
++
++# Executable file suffix (normally "").
++exeext="$exeext"
++
++# Additional compiler flags for building library objects.
++pic_flag=$lt_pic_flag
++pic_mode=$pic_mode
++
++# Does compiler simultaneously support -c and -o options?
++compiler_c_o=$lt_compiler_c_o
++
++# Can we write directly to a .lo ?
++compiler_o_lo=$lt_compiler_o_lo
++
++# Must we lock files when doing compilation ?
++need_locks=$lt_need_locks
++
++# 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
++
++# 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
++
++# Compiler flag to prevent dynamic linking.
++link_static_flag=$lt_link_static_flag
++
++# Compiler flag to turn off builtin functions.
++no_builtin_flag=$lt_no_builtin_flag
++
++# 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
++
++# Compiler flag to generate thread-safe objects.
++thread_safe_flag_spec=$lt_thread_safe_flag_spec
++
++# Library versioning type.
++version_type=$version_type
++
++# 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
++
++# Commands used to build and install an old-style archive.
++RANLIB=$lt_RANLIB
++old_archive_cmds=$lt_old_archive_cmds
++old_postinstall_cmds=$lt_old_postinstall_cmds
++old_postuninstall_cmds=$lt_old_postuninstall_cmds
++
++# 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 and install a shared archive.
++archive_cmds=$lt_archive_cmds
++archive_expsym_cmds=$lt_archive_expsym_cmds
++postinstall_cmds=$lt_postinstall_cmds
++postuninstall_cmds=$lt_postuninstall_cmds
++
++# Commands to strip libraries.
++old_striplib=$lt_old_striplib
++striplib=$lt_striplib
++
++# 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
++
++# Flag that allows shared libraries with undefined symbols to be built.
++allow_undefined_flag=$lt_allow_undefined_flag
++
++# Flag that forces no undefined symbols.
++no_undefined_flag=$lt_no_undefined_flag
++
++# Commands used to finish a libtool library installation in a directory.
++finish_cmds=$lt_finish_cmds
++
++# Same as above, but a single script fragment to be evaled but not shown.
++finish_eval=$lt_finish_eval
++
++# Take the output of nm and produce a listing of raw symbols and C names.
++global_symbol_pipe=$lt_global_symbol_pipe
++
++# Transform the output of nm in a proper C declaration
++global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
++
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
++
++# This is the shared library runtime path variable.
++runpath_var=$runpath_var
++
++# This is the shared library path variable.
++shlibpath_var=$shlibpath_var
++
++# Is shlibpath searched before the hard-coded library search path?
++shlibpath_overrides_runpath=$shlibpath_overrides_runpath
++
++# How to hardcode a shared library path into an executable.
++hardcode_action=$hardcode_action
++
++# Whether we should hardcode library paths into libraries.
++hardcode_into_libs=$hardcode_into_libs
++
++# 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
++
++# 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.so during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct=$hardcode_direct
++
++# 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
++
++# Variables whose values should be saved in libtool wrapper scripts and
++# restored at relink time.
++variables_saved_for_relink="$variables_saved_for_relink"
++
++# Whether libtool must link a program against all its dependency libraries.
++link_all_deplibs=$link_all_deplibs
++
++# 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
++
++# Fix the shell variable \$srcfile for the compiler.
++fix_srcfile_path="$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
++
++# The commands to extract the exported symbol list from a shared archive.
++extract_expsyms_cmds=$lt_extract_expsyms_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
++
++# ### END LIBTOOL CONFIG
++
++__EOF__
++
++ case $host_os in
++ aix3*)
++ cat <<\EOF >> "${ofile}T"
++
++# 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
++EOF
++ ;;
++ esac
++
++ case $host_os in
++ cygwin* | mingw* | pw32* | os2*)
++ cat <<'EOF' >> "${ofile}T"
++ # This is a source program that is used to create dlls on Windows
++ # Don't remove nor modify the starting and closing comments
++# /* ltdll.c starts here */
++# #define WIN32_LEAN_AND_MEAN
++# #include <windows.h>
++# #undef WIN32_LEAN_AND_MEAN
++# #include <stdio.h>
++#
++# #ifndef __CYGWIN__
++# # ifdef __CYGWIN32__
++# # define __CYGWIN__ __CYGWIN32__
++# # endif
++# #endif
++#
++# #ifdef __cplusplus
++# extern "C" {
++# #endif
++# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
++# #ifdef __cplusplus
++# }
++# #endif
++#
++# #ifdef __CYGWIN__
++# #include <cygwin/cygwin_dll.h>
++# DECLARE_CYGWIN_DLL( DllMain );
++# #endif
++# HINSTANCE __hDllInstance_base;
++#
++# BOOL APIENTRY
++# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
++# {
++# __hDllInstance_base = hInst;
++# return TRUE;
++# }
++# /* ltdll.c ends here */
++ # This is a source program that is used to create import libraries
++ # on Windows for dlls which lack them. Don't remove nor modify the
++ # starting and closing comments
++# /* impgen.c starts here */
++# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
++#
++# This file is part of GNU libtool.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# */
++#
++# #include <stdio.h> /* for printf() */
++# #include <unistd.h> /* for open(), lseek(), read() */
++# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
++# #include <string.h> /* for strdup() */
++#
++# /* O_BINARY isn't required (or even defined sometimes) under Unix */
++# #ifndef O_BINARY
++# #define O_BINARY 0
++# #endif
++#
++# static unsigned int
++# pe_get16 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[2];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 2);
++# return b[0] + (b[1]<<8);
++# }
++#
++# static unsigned int
++# pe_get32 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[4];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 4);
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# static unsigned int
++# pe_as32 (ptr)
++# void *ptr;
++# {
++# unsigned char *b = ptr;
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# int
++# main (argc, argv)
++# int argc;
++# char *argv[];
++# {
++# int dll;
++# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
++# unsigned long export_rva, export_size, nsections, secptr, expptr;
++# unsigned long name_rvas, nexp;
++# unsigned char *expdata, *erva;
++# char *filename, *dll_name;
++#
++# filename = argv[1];
++#
++# dll = open(filename, O_RDONLY|O_BINARY);
++# if (dll < 1)
++# return 1;
++#
++# dll_name = filename;
++#
++# for (i=0; filename[i]; i++)
++# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
++# dll_name = filename + i +1;
++#
++# pe_header_offset = pe_get32 (dll, 0x3c);
++# opthdr_ofs = pe_header_offset + 4 + 20;
++# num_entries = pe_get32 (dll, opthdr_ofs + 92);
++#
++# if (num_entries < 1) /* no exports */
++# return 1;
++#
++# export_rva = pe_get32 (dll, opthdr_ofs + 96);
++# export_size = pe_get32 (dll, opthdr_ofs + 100);
++# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
++# secptr = (pe_header_offset + 4 + 20 +
++# pe_get16 (dll, pe_header_offset + 4 + 16));
++#
++# expptr = 0;
++# for (i = 0; i < nsections; i++)
++# {
++# char sname[8];
++# unsigned long secptr1 = secptr + 40 * i;
++# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
++# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
++# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
++# lseek(dll, secptr1, SEEK_SET);
++# read(dll, sname, 8);
++# if (vaddr <= export_rva && vaddr+vsize > export_rva)
++# {
++# expptr = fptr + (export_rva - vaddr);
++# if (export_rva + export_size > vaddr + vsize)
++# export_size = vsize - (export_rva - vaddr);
++# break;
++# }
++# }
++#
++# expdata = (unsigned char*)malloc(export_size);
++# lseek (dll, expptr, SEEK_SET);
++# read (dll, expdata, export_size);
++# erva = expdata - export_rva;
++#
++# nexp = pe_as32 (expdata+24);
++# name_rvas = pe_as32 (expdata+32);
++#
++# printf ("EXPORTS\n");
++# for (i = 0; i<nexp; i++)
++# {
++# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
++# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
++# }
++#
++# return 0;
++# }
++# /* impgen.c ends here */
++
++EOF
++ ;;
++ esac
++
++ # 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" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
++
++ mv -f "${ofile}T" "$ofile" || \
++ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
++ chmod +x "$ofile"
++fi
++
++])# _LT_AC_LTCONFIG_HACK
++
++# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
++AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
++
++# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
++AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
++
++# AC_ENABLE_SHARED - implement the --enable-shared flag
++# Usage: AC_ENABLE_SHARED[(DEFAULT)]
++# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
++# `yes'.
++AC_DEFUN([AC_ENABLE_SHARED],
++[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE(shared,
++changequote(<<, >>)dnl
++<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
++changequote([, ])dnl
++[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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_shared=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac],
++enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
++])
++
++# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
++AC_DEFUN([AC_DISABLE_SHARED],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_SHARED(no)])
++
++# AC_ENABLE_STATIC - implement the --enable-static flag
++# Usage: AC_ENABLE_STATIC[(DEFAULT)]
++# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
++# `yes'.
++AC_DEFUN([AC_ENABLE_STATIC],
++[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE(static,
++changequote(<<, >>)dnl
++<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
++changequote([, ])dnl
++[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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_static=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac],
++enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
++])
++
++# AC_DISABLE_STATIC - set the default static flag to --disable-static
++AC_DEFUN([AC_DISABLE_STATIC],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_STATIC(no)])
++
++
++# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
++# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
++# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
++# `yes'.
++AC_DEFUN([AC_ENABLE_FAST_INSTALL],
++[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE(fast-install,
++changequote(<<, >>)dnl
++<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
++changequote([, ])dnl
++[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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_fast_install=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac],
++enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
++])
++
++# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
++AC_DEFUN([AC_DISABLE_FAST_INSTALL],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_FAST_INSTALL(no)])
++
++# AC_LIBTOOL_PICMODE - implement the --with-pic flag
++# Usage: AC_LIBTOOL_PICMODE[(MODE)]
++# Where MODE is either `yes' or `no'. If omitted, it defaults to
++# `both'.
++AC_DEFUN([AC_LIBTOOL_PICMODE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++pic_mode=ifelse($#,1,$1,default)])
++
++
++# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
++AC_DEFUN([AC_PATH_TOOL_PREFIX],
++[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_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++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="ifelse([$2], , $PATH, [$2])"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_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
++])
++
++
++# AC_PATH_MAGIC - find a file program which can recognise a shared library
++AC_DEFUN([AC_PATH_MAGIC],
++[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
++AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
++if test -z "$lt_cv_path_MAGIC_CMD"; then
++ if test -n "$ac_tool_prefix"; then
++ AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
++ else
++ MAGIC_CMD=:
++ fi
++fi
++])
++
++
++# AC_PROG_LD - find the path to the GNU or non-GNU linker
++AC_DEFUN([AC_PROG_LD],
++[AC_ARG_WITH(gnu-ld,
++[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
++test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])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 GCC])
++ 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.
++ [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
++ re_direlt='/[[^/]][[^/]]*/\.\./'
++ # Canonicalize the path 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
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in $PATH; do
++ 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 GNU ld's only accept -v.
++ # Break only if it was the GNU/non-GNU ld that we prefer.
++ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
++ test "$with_gnu_ld" != no && break
++ else
++ test "$with_gnu_ld" != yes && break
++ fi
++ fi
++ done
++ IFS="$ac_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])
++AC_PROG_LD_GNU
++])
++
++# AC_PROG_LD_GNU -
++AC_DEFUN([AC_PROG_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 ld's only accept -v.
++if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
++ lt_cv_prog_gnu_ld=yes
++else
++ lt_cv_prog_gnu_ld=no
++fi])
++with_gnu_ld=$lt_cv_prog_gnu_ld
++])
++
++# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
++# -- PORTME Some linkers may need a different reload flag.
++AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
++[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
++test -n "$reload_flag" && reload_flag=" $reload_flag"
++])
++
++# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
++# -- PORTME fill in with the dynamic library characteristics
++AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
++[AC_CACHE_CHECK([how to recognise 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 egrep 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
++aix4* | aix5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++beos*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++bsdi4*)
++ 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* | mingw* | pw32*)
++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ lt_cv_file_magic_cmd='$OBJDUMP -f'
++ ;;
++
++darwin* | rhapsody*)
++ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
++ lt_cv_file_magic_cmd='/usr/bin/file -L'
++ case "$host_os" in
++ rhapsody* | darwin1.[[012]])
++ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
++ ;;
++ *) # Darwin 1.3 on
++ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
++ ;;
++ esac
++ ;;
++
++freebsd*)
++ 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)/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
++ ;;
++
++hpux10.20*|hpux11*)
++ 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_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=/usr/lib/libc.sl
++ ;;
++
++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-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]]+$'
++ else
++ lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
++ 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
++ ;;
++
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
++osf3* | osf4* | osf5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sco3.2v5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++solaris*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv5uw[[78]]* | sysv4*uw2*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ 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
++ ;;
++ esac
++ ;;
++esac
++])
++file_magic_cmd=$lt_cv_file_magic_cmd
++deplibs_check_method=$lt_cv_deplibs_check_method
++])
++
++
++# AC_PROG_NM - find the path to a BSD-compatible name lister
++AC_DEFUN([AC_PROG_NM],
++[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
++AC_MSG_CHECKING([for BSD-compatible nm])
++AC_CACHE_VAL(lt_cv_path_NM,
++[if test -n "$NM"; then
++ # Let the user override the test.
++ lt_cv_path_NM="$NM"
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
++ test -z "$ac_dir" && ac_dir=.
++ tmp_nm=$ac_dir/${ac_tool_prefix}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
++ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -B"
++ break
++ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -p"
++ break
++ else
++ 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
++ fi
++ fi
++ done
++ IFS="$ac_save_ifs"
++ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
++fi])
++NM="$lt_cv_path_NM"
++AC_MSG_RESULT([$NM])
++])
++
++# AC_CHECK_LIBM - check for math library
++AC_DEFUN([AC_CHECK_LIBM],
++[AC_REQUIRE([AC_CANONICAL_HOST])dnl
++LIBM=
++case $host in
++*-*-beos* | *-*-cygwin* | *-*-pw32*)
++ # These system don't have libm
++ ;;
++*-ncr-sysv4.3*)
++ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
++ AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
++ ;;
++*)
++ AC_CHECK_LIB(m, main, LIBM="-lm")
++ ;;
++esac
++])
++
++# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
++# the libltdl convenience library and LTDLINCL to the include flags for
++# the libltdl header and adds --enable-ltdl-convenience to the
++# configure arguments. Note that LIBLTDL and LTDLINCL are not
++# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
++# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
++# with '${top_builddir}/' and LTDLINCL will be prefixed with
++# '${top_srcdir}/' (note the single quotes!). If your package is not
++# flat and you're not using automake, define top_builddir and
++# top_srcdir appropriately in the Makefiles.
++AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++ case $enable_ltdl_convenience in
++ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
++ "") enable_ltdl_convenience=yes
++ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
++ esac
++ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
++])
++
++# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
++# the libltdl installable library and LTDLINCL to the include flags for
++# the libltdl header and adds --enable-ltdl-install to the configure
++# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
++# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
++# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
++# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
++# with '${top_srcdir}/' (note the single quotes!). If your package is
++# not flat and you're not using automake, define top_builddir and
++# top_srcdir appropriately in the Makefiles.
++# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
++AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++ AC_CHECK_LIB(ltdl, main,
++ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
++ [if test x"$enable_ltdl_install" = xno; then
++ AC_MSG_WARN([libltdl not installed, but installation disabled])
++ else
++ enable_ltdl_install=yes
++ fi
++ ])
++ if test x"$enable_ltdl_install" = x"yes"; then
++ ac_configure_args="$ac_configure_args --enable-ltdl-install"
++ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ else
++ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
++ LIBLTDL="-lltdl"
++ LTDLINCL=
++ fi
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
++])
++
++# old names
++AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
++AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
++AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
++AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
++AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
++AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
++AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
++
++# This is just to silence aclocal about the macro not being used
++ifelse([AC_DISABLE_FAST_INSTALL])
++
++# 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. #
++# LT_AC_PROG_SED
++# --------------
++# Check for a fully-functional sed program, that truncates
++# as few characters as possible. Prefer GNU sed if found.
++AC_DEFUN([LT_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_executable_p="test -f"
++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
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ fi
++ done
++ done
++done
++
++ # Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++: ${TMPDIR=/tmp}
++{
++ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=$TMPDIR/sed$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
++ { (exit 1); exit 1; }
++}
++ _max=0
++ _count=0
++ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
++ # along with /bin/sed that truncates output.
++ for _sed in $_sed_list /usr/xpg4/bin/sed; do
++ test ! -f ${_sed} && break
++ cat /dev/null > "$tmp/sed.in"
++ _count=0
++ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
++ # Check for GNU sed and select it if it is found.
++ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
++ lt_cv_path_SED=${_sed}
++ break
++ fi
++ while true; do
++ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
++ mv "$tmp/sed.tmp" "$tmp/sed.in"
++ cp "$tmp/sed.in" "$tmp/sed.nl"
++ echo >>"$tmp/sed.nl"
++ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
++ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
++ # 40000 chars as input seems more than enough
++ test $_count -gt 10 && break
++ _count=`expr $_count + 1`
++ if test $_count -gt $_max; then
++ _max=$_count
++ lt_cv_path_SED=$_sed
++ fi
++ done
++ done
++ rm -rf "$tmp"
++])
++if test "X$SED" != "X"; then
++ lt_cv_path_SED=$SED
++else
++ SED=$lt_cv_path_SED
++fi
++AC_MSG_RESULT([$SED])
++])
++
++# -*- Autoconf -*-
++# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++# Generated from amversion.in; do not edit by hand.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++
++# 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.
++AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"])
++
++# AM_SET_CURRENT_AUTOMAKE_VERSION
++# -------------------------------
++# Call AM_AUTOMAKE_VERSION so it can be traced.
++# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
++AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
++ [AM_AUTOMAKE_VERSION([1.8.5])])
++
++# AM_AUX_DIR_EXPAND
++
++# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# 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 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# serial 6
++
++# 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])
++AC_SUBST([$1_FALSE])
++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])])
++
++# serial 7 -*- Autoconf -*-
++
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
++# Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++
++# 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], 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
++ 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
++
++ case $depmode in
++ 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
++ ;;
++ none) break ;;
++ esac
++ # 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.
++ if depmode=$depmode \
++ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
++ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
++ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
++ >/dev/null 2>conftest.err &&
++ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
++ grep sub/conftest.${OBJEXT-o} 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])
++])
++
++# Generate code to set up dependency tracking. -*- Autoconf -*-
++
++# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++#serial 2
++
++# _AM_OUTPUT_DEPENDENCY_COMMANDS
++# ------------------------------
++AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
++[for mf in $CONFIG_FILES; 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.
++ # So let's grep whole file.
++ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
++ dirpart=`AS_DIRNAME("$mf")`
++ else
++ continue
++ fi
++ grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
++ # Extract the definition of DEP_FILES from the Makefile without
++ # running `make'.
++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
++ test -z "$DEPDIR" && continue
++ # When using ansi2knr, U may be empty or an underscore; expand it
++ U=`sed -n 's/^U = //p' < "$mf"`
++ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
++ # 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 '
++ /^DEP_FILES = .*\\\\$/ {
++ s/^DEP_FILES = //
++ :loop
++ s/\\\\$//
++ p
++ n
++ /\\\\$/ b loop
++ p
++ }
++ /^DEP_FILES = / s/^DEP_FILES = //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 -*-
++
++# 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.
++
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
++# Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# serial 11
++
++# 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.58])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
++# test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" &&
++ test -f $srcdir/config.status; then
++ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
++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
++ 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)
++AM_MISSING_PROG(AMTAR, tar)
++AM_PROG_INSTALL_SH
++AM_PROG_INSTALL_STRIP
++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([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
++])
++])
++
++
++# 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_stamp_count=1
++for _am_header in $config_headers :; do
++ case $_am_header in
++ $1 | $1:* )
++ break ;;
++ * )
++ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
++ esac
++done
++echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
++
++# AM_PROG_INSTALL_SH
++# ------------------
++# Define $install_sh.
++
++# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++AC_DEFUN([AM_PROG_INSTALL_SH],
++[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
++install_sh=${install_sh-"$am_aux_dir/install-sh"}
++AC_SUBST(install_sh)])
++
++# -*- Autoconf -*-
++# Copyright (C) 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# serial 1
++
++# Check whether the underlying file-system supports filenames
++# with a leading dot. For instance MS-DOS doesn't.
++AC_DEFUN([AM_SET_LEADING_DOT],
++[rm -rf .tst 2>/dev/null
++mkdir .tst 2>/dev/null
++if test -d .tst; then
++ am__leading_dot=.
++else
++ am__leading_dot=_
++fi
++rmdir .tst 2>/dev/null
++AC_SUBST([am__leading_dot])])
++
++# Check to see how 'make' treats includes. -*- Autoconf -*-
++
++# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# serial 2
++
++# 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 done
++.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
++# We grep out `Entering directory' and `Leaving directory'
++# messages which can occur if `w' ends up in MAKEFLAGS.
++# In particular we don't look at `^make:' because GNU make might
++# be invoked under some other name (usually "gmake"), in which
++# case it prints its new name instead of `make'.
++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
++ am__include=include
++ am__quote=
++ _am_result=GNU
++fi
++# Now try BSD make style include.
++if test "$am__include" = "#"; then
++ echo '.include "confinc"' > confmf
++ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
++ am__include=.include
++ am__quote="\""
++ _am_result=BSD
++ fi
++fi
++AC_SUBST([am__include])
++AC_SUBST([am__quote])
++AC_MSG_RESULT([$_am_result])
++rm -f confinc confmf
++])
++
++# -*- Autoconf -*-
++
++
++# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# serial 3
++
++# 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
++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
++# 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
++])
++
++# AM_PROG_MKDIR_P
++# ---------------
++# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
++
++# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
++# created by `make install' are always world readable, even if the
++# installer happens to have an overly restrictive umask (e.g. 077).
++# This was a mistake. There are at least two reasons why we must not
++# use `-m 0755':
++# - it causes special bits like SGID to be ignored,
++# - it may be too restrictive (some setups expect 775 directories).
++#
++# Do not use -m 0755 and let people choose whatever they expect by
++# setting umask.
++#
++# We cannot accept any implementation of `mkdir' that recognizes `-p'.
++# Some implementations (such as Solaris 8's) are not thread-safe: if a
++# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
++# concurrently, both version can detect that a/ is missing, but only
++# one can create it and the other will error out. Consequently we
++# restrict ourselves to GNU make (using the --version option ensures
++# this.)
++AC_DEFUN([AM_PROG_MKDIR_P],
++[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++ # Keeping the `.' argument allows $(mkdir_p) to be used without
++ # argument. Indeed, we sometimes output rules like
++ # $(mkdir_p) $(somedir)
++ # where $(somedir) is conditionally defined.
++ # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
++ # expensive solution, as it forces Make to start a sub-shell.)
++ mkdir_p='mkdir -p -- .'
++else
++ # On NextStep and OpenStep, the `mkdir' command does not
++ # recognize any option. It will interpret all options as
++ # directories to create, and then abort because `.' already
++ # exists.
++ for d in ./-p ./--version;
++ do
++ test -d $d && rmdir $d
++ done
++ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
++ if test -f "$ac_aux_dir/mkinstalldirs"; then
++ mkdir_p='$(mkinstalldirs)'
++ else
++ mkdir_p='$(install_sh) -d'
++ fi
++fi
++AC_SUBST([mkdir_p])])
++
++# Helper functions for option handling. -*- Autoconf -*-
++
++# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# serial 2
++
++# _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],
++[AC_FOREACH([_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.
++#
++
++# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# serial 3
++
++# 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
++# 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)])
++
++# AM_PROG_INSTALL_STRIP
++
++# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# 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="\${SHELL} \$(install_sh) -c -s"
++AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
++m4_include([acinclude.m4])
+diff -ruN libnet-1.0.2a-orig/config.guess libnet-1.0.2a-7/config.guess
+--- libnet-1.0.2a-orig/config.guess 2000-05-25 02:28:49.000000000 +0200
++++ libnet-1.0.2a-7/config.guess 2005-03-08 03:53:26.000000000 +0100
+@@ -1,7 +1,10 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+-# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
+-#
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++timestamp='2004-07-19'
++
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+@@ -21,59 +24,320 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
+-# Written by Per Bothner <bothner@cygnus.com>.
+-# The master version of this file is at the FSF in /home/gd/gnu/lib.
++# Originally written by Per Bothner <per@bothner.com>.
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
+ #
+ # This script attempts to guess a canonical system name similar to
+ # config.sub. If it succeeds, it prints the system name on stdout, and
+ # exits with 0. Otherwise, it exits with 1.
+ #
+ # The plan is that this can be called by configure scripts if you
+-# don't specify an explicit system type (host/target name).
+-#
+-# Only a few systems have been added to this list; please add others
+-# (but try to keep the structure clean).
+-#
++# don't specify an explicit build system type.
++
++me=`echo "$0" | sed -e 's,.*/,,'`
++
++usage="\
++Usage: $0 [OPTION]
++
++Output the configuration name of the system \`$me' is run on.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.guess ($timestamp)
++
++Originally written by Per Bothner.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
++Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit 0 ;;
++ --version | -v )
++ echo "$version" ; exit 0 ;;
++ --help | --h* | -h )
++ echo "$usage"; exit 0 ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help" >&2
++ exit 1 ;;
++ * )
++ break ;;
++ esac
++done
++
++if test $# != 0; then
++ echo "$me: too many arguments$help" >&2
++ exit 1
++fi
++
++trap 'exit 1' 1 2 15
++
++# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
++# compiler to aid in system detection is discouraged as it requires
++# temporary files to be created and, as you can see below, it is a
++# headache to deal with in a portable fashion.
++
++# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
++# use `HOST_CC' if defined, but it is deprecated.
++
++# Portable tmp directory creation inspired by the Autoconf team.
++
++set_cc_for_build='
++trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
++trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
++: ${TMPDIR=/tmp} ;
++ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
++ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
++dummy=$tmp/dummy ;
++tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
++case $CC_FOR_BUILD,$HOST_CC,$CC in
++ ,,) echo "int x;" > $dummy.c ;
++ for c in cc gcc c89 c99 ; do
++ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
++ CC_FOR_BUILD="$c"; break ;
++ fi ;
++ done ;
++ if test x"$CC_FOR_BUILD" = x ; then
++ CC_FOR_BUILD=no_compiler_found ;
++ fi
++ ;;
++ ,,*) CC_FOR_BUILD=$CC ;;
++ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
++esac ;'
+
+ # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+-# (ghazi@noc.rutgers.edu 8/24/94.)
++# (ghazi@noc.rutgers.edu 1994-08-24)
+ if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+ fi
+
+ UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
++UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+-
+ # Note: order is significant - the case branches are not exclusive.
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
++ *:NetBSD:*:*)
++ # NetBSD (nbsd) targets should (where applicable) match one or
++ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
++ # switched to ELF, *-*-netbsd* would select the old
++ # object file format. This provides both forward
++ # compatibility and a consistent mechanism for selecting the
++ # object file format.
++ #
++ # Note: NetBSD doesn't particularly care about the vendor
++ # portion of the name. We always set it to "unknown".
++ sysctl="sysctl -n hw.machine_arch"
++ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
++ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
++ case "${UNAME_MACHINE_ARCH}" in
++ armeb) machine=armeb-unknown ;;
++ arm*) machine=arm-unknown ;;
++ sh3el) machine=shl-unknown ;;
++ sh3eb) machine=sh-unknown ;;
++ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
++ esac
++ # The Operating System including object format, if it has switched
++ # to ELF recently, or will in the future.
++ case "${UNAME_MACHINE_ARCH}" in
++ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
++ eval $set_cc_for_build
++ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
++ | grep __ELF__ >/dev/null
++ then
++ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
++ # Return netbsd for either. FIX?
++ os=netbsd
++ else
++ os=netbsdelf
++ fi
++ ;;
++ *)
++ os=netbsd
++ ;;
++ esac
++ # The OS release
++ # Debian GNU/NetBSD machines have a different userland, and
++ # thus, need a distinct triplet. However, they do not need
++ # kernel version information, so it can be replaced with a
++ # suitable tag, in the style of linux-gnu.
++ case "${UNAME_VERSION}" in
++ Debian*)
++ release='-gnu'
++ ;;
++ *)
++ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ ;;
++ esac
++ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
++ # contains redundant information, the shorter form:
++ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
++ echo "${machine}-${os}${release}"
++ exit 0 ;;
++ amd64:OpenBSD:*:*)
++ echo x86_64-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ amiga:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ arc:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ cats:OpenBSD:*:*)
++ echo arm-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ hp300:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ luna88k:OpenBSD:*:*)
++ echo m88k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mac68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ macppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme88k:OpenBSD:*:*)
++ echo m88k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvmeppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ pmax:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sgi:OpenBSD:*:*)
++ echo mipseb-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sun3:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ wgrisc:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:OpenBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:ekkoBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
++ exit 0 ;;
++ macppc:MirBSD:*:*)
++ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:MirBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
++ exit 0 ;;
+ alpha:OSF1:*:*)
++ case $UNAME_RELEASE in
++ *4.0)
++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
++ ;;
++ *5.*)
++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
++ ;;
++ esac
++ # According to Compaq, /usr/sbin/psrinfo has been available on
++ # OSF/1 and Tru64 systems produced since 1995. I hope that
++ # covers most systems running today. This code pipes the CPU
++ # types through head -n 1, so we only detect the type of CPU 0.
++ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
++ case "$ALPHA_CPU_TYPE" in
++ "EV4 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "EV4.5 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "LCA4 (21066/21068)")
++ UNAME_MACHINE="alpha" ;;
++ "EV5 (21164)")
++ UNAME_MACHINE="alphaev5" ;;
++ "EV5.6 (21164A)")
++ UNAME_MACHINE="alphaev56" ;;
++ "EV5.6 (21164PC)")
++ UNAME_MACHINE="alphapca56" ;;
++ "EV5.7 (21164PC)")
++ UNAME_MACHINE="alphapca57" ;;
++ "EV6 (21264)")
++ UNAME_MACHINE="alphaev6" ;;
++ "EV6.7 (21264A)")
++ UNAME_MACHINE="alphaev67" ;;
++ "EV6.8CB (21264C)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8AL (21264B)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8CX (21264D)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.9A (21264/EV69A)")
++ UNAME_MACHINE="alphaev69" ;;
++ "EV7 (21364)")
++ UNAME_MACHINE="alphaev7" ;;
++ "EV7.9 (21364A)")
++ UNAME_MACHINE="alphaev79" ;;
++ esac
++ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+- echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`
++ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
++ exit 0 ;;
++ Alpha\ *:Windows_NT*:*)
++ # How do we know it's Interix rather than the generic POSIX subsystem?
++ # Should we change UNAME_MACHINE based on the output of uname instead
++ # of the specific Alpha model?
++ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+- echo m68k-cbm-sysv4
++ echo m68k-unknown-sysv4
+ exit 0;;
+- amiga:NetBSD:*:*)
+- echo m68k-cbm-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- amiga:OpenBSD:*:*)
+- echo m68k-cbm-openbsd${UNAME_RELEASE}
+- exit 0 ;;
++ *:[Aa]miga[Oo][Ss]:*:*)
++ echo ${UNAME_MACHINE}-unknown-amigaos
++ exit 0 ;;
++ *:[Mm]orph[Oo][Ss]:*:*)
++ echo ${UNAME_MACHINE}-unknown-morphos
++ exit 0 ;;
++ *:OS/390:*:*)
++ echo i370-ibm-openedition
++ exit 0 ;;
++ *:OS400:*:*)
++ echo powerpc-ibm-os400
++ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
++ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
++ echo hppa1.1-hitachi-hiuxmpp
++ exit 0;;
++ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+@@ -81,9 +345,19 @@
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+- NILE:*:*:dcosx)
++ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
++ DRS?6000:unix:4.0:6*)
++ echo sparc-icl-nx6
++ exit 0 ;;
++ DRS?6000:UNIX_SV:4.2*:7*)
++ case `/usr/bin/uname -p` in
++ sparc) echo sparc-icl-nx7 && exit 0 ;;
++ esac ;;
++ sun4H:SunOS:5.*:*)
++ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+@@ -108,26 +382,49 @@
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
++ sun*:*:4.2BSD:*)
++ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
++ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
++ case "`/bin/arch`" in
++ sun3)
++ echo m68k-sun-sunos${UNAME_RELEASE}
++ ;;
++ sun4)
++ echo sparc-sun-sunos${UNAME_RELEASE}
++ ;;
++ esac
++ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+- atari*:NetBSD:*:*)
+- echo m68k-atari-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- atari*:OpenBSD:*:*)
+- echo m68k-atari-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sun3*:NetBSD:*:*)
+- echo m68k-sun-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sun3*:OpenBSD:*:*)
+- echo m68k-sun-openbsd${UNAME_RELEASE}
++ # The situation for MiNT is a little confusing. The machine name
++ # can be virtually everything (everything which is not
++ # "atarist" or "atariste" at least should have a processor
++ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
++ # to the lowercase version "mint" (or "freemint"). Finally
++ # the system name "TOS" denotes a system which is actually not
++ # MiNT. But MiNT is downward compatible to TOS, so this should
++ # be no problem.
++ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+- mac68k:NetBSD:*:*)
+- echo m68k-apple-netbsd${UNAME_RELEASE}
++ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
++ echo m68k-atari-mint${UNAME_RELEASE}
++ exit 0 ;;
++ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
++ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+- mac68k:OpenBSD:*:*)
+- echo m68k-apple-openbsd${UNAME_RELEASE}
++ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
++ echo m68k-milan-mint${UNAME_RELEASE}
++ exit 0 ;;
++ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
++ echo m68k-hades-mint${UNAME_RELEASE}
++ exit 0 ;;
++ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
++ echo m68k-unknown-mint${UNAME_RELEASE}
++ exit 0 ;;
++ m68k:machten:*:*)
++ echo m68k-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+@@ -141,9 +438,18 @@
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
++ 2020:CLIX:*:* | 2430:CLIX:*:*)
++ echo clipper-intergraph-clix${UNAME_RELEASE}
++ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+- sed 's/^ //' << EOF >dummy.c
+- int main (argc, argv) int argc; char **argv; {
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++#ifdef __cplusplus
++#include <stdio.h> /* for printf() prototype */
++ int main (int argc, char *argv[]) {
++#else
++ int main (argc, argv) int argc; char *argv[]; {
++#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+@@ -158,12 +464,20 @@
+ exit (-1);
+ }
+ EOF
+- ${CC-cc} dummy.c -o dummy \
+- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+- && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c \
++ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
++ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
++ Motorola:PowerMAX_OS:*:*)
++ echo powerpc-motorola-powermax
++ exit 0 ;;
++ Motorola:*:4.3:PL8-*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
++ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+@@ -179,15 +493,18 @@
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
++ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
++ then
++ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
++ [ ${TARGET_BINARY_INTERFACE}x = x ]
++ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+- else
++ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
++ fi
++ else
++ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+- else echo i586-dg-dgux${UNAME_RELEASE}
+- fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+@@ -208,12 +525,21 @@
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+- i?86:AIX:*:*)
++ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
++ ia64:AIX:*:*)
++ if [ -x /usr/bin/oslevel ] ; then
++ IBM_REV=`/usr/bin/oslevel`
++ else
++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
++ fi
++ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
++ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+- sed 's/^ //' << EOF >dummy.c
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+@@ -224,8 +550,7 @@
+ exit(0);
+ }
+ EOF
+- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+@@ -233,8 +558,9 @@
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+- *:AIX:*:4)
+- if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
++ *:AIX:*:[45])
++ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
++ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+@@ -242,7 +568,7 @@
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+- IBM_REV=4.${UNAME_RELEASE}
++ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+@@ -252,7 +578,7 @@
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
++ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+@@ -267,18 +593,85 @@
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+- 9000/[3478]??:HP-UX:*:*)
++ 9000/[34678]??:HP-UX:*:*)
++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+- 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
+- 9000/8?? ) HP_ARCH=hppa1.0 ;;
++ 9000/[678][0-9][0-9])
++ if [ -x /usr/bin/getconf ]; then
++ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
++ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
++ case "${sc_cpu_version}" in
++ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
++ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
++ 532) # CPU_PA_RISC2_0
++ case "${sc_kernel_bits}" in
++ 32) HP_ARCH="hppa2.0n" ;;
++ 64) HP_ARCH="hppa2.0w" ;;
++ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
++ esac ;;
++ esac
++ fi
++ if [ "${HP_ARCH}" = "" ]; then
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++
++ #define _HPUX_SOURCE
++ #include <stdlib.h>
++ #include <unistd.h>
++
++ int main ()
++ {
++ #if defined(_SC_KERNEL_BITS)
++ long bits = sysconf(_SC_KERNEL_BITS);
++ #endif
++ long cpu = sysconf (_SC_CPU_VERSION);
++
++ switch (cpu)
++ {
++ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
++ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
++ case CPU_PA_RISC2_0:
++ #if defined(_SC_KERNEL_BITS)
++ switch (bits)
++ {
++ case 64: puts ("hppa2.0w"); break;
++ case 32: puts ("hppa2.0n"); break;
++ default: puts ("hppa2.0"); break;
++ } break;
++ #else /* !defined(_SC_KERNEL_BITS) */
++ puts ("hppa2.0"); break;
++ #endif
++ default: puts ("hppa1.0"); break;
++ }
++ exit (0);
++ }
++EOF
++ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
++ test -z "$HP_ARCH" && HP_ARCH=hppa
++ fi ;;
+ esac
+- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++ if [ ${HP_ARCH} = "hppa2.0w" ]
++ then
++ # avoid double evaluation of $set_cc_for_build
++ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
++ then
++ HP_ARCH="hppa2.0w"
++ else
++ HP_ARCH="hppa64"
++ fi
++ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
++ ia64:HP-UX:*:*)
++ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
++ echo ia64-hp-hpux${HPUX_REV}
++ exit 0 ;;
+ 3050*:HI-UX:*:*)
+- sed 's/^ //' << EOF >dummy.c
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+@@ -303,8 +696,7 @@
+ exit (0);
+ }
+ EOF
+- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+@@ -313,13 +705,16 @@
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
++ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
++ echo hppa1.0-hp-mpeix
++ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+- i?86:OSF1:*:*)
++ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+@@ -347,129 +742,320 @@
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+- CRAY*X-MP:*:*:*)
+- echo xmp-cray-unicos
+- exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+- echo ymp-cray-unicos${UNAME_RELEASE}
++ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
++ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
++ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+- echo t90-cray-unicos${UNAME_RELEASE}
++ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+- CRAY-2:*:*:*)
+- echo cray2-cray-unicos
+- exit 0 ;;
+- F300:UNIX_System_V:*:*)
+- FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
++ CRAY*T3E:*:*:*)
++ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ CRAY*SV1:*:*:*)
++ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ *:UNICOS/mp:*:*)
++ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
++ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
++ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+- F301:UNIX_System_V:*:*)
+- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+- exit 0 ;;
+- hp3[0-9][05]:NetBSD:*:*)
+- echo m68k-hp-netbsd${UNAME_RELEASE}
+- exit 0 ;;
+- hp3[0-9][05]:OpenBSD:*:*)
+- echo m68k-hp-openbsd${UNAME_RELEASE}
++ 5000:UNIX_System_V:4.*:*)
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+- i?86:BSD/386:*:* | *:BSD/OS:*:*)
++ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
++ sparc*:BSD/OS:*:*)
++ echo sparc-unknown-bsdi${UNAME_RELEASE}
++ exit 0 ;;
++ *:BSD/OS:*:*)
++ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
++ exit 0 ;;
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+- *:NetBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ i*:CYGWIN*:*)
++ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+- *:OpenBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ i*:MINGW*:*)
++ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+- i*:CYGWIN*:*)
+- echo i386-pc-cygwin32
++ i*:PW*:*)
++ echo ${UNAME_MACHINE}-pc-pw32
++ exit 0 ;;
++ x86:Interix*:[34]*)
++ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
++ exit 0 ;;
++ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
++ echo i${UNAME_MACHINE}-pc-mks
++ exit 0 ;;
++ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
++ # How do we know it's Interix rather than the generic POSIX subsystem?
++ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
++ # UNAME_MACHINE based on the output of uname instead of i386?
++ echo i586-pc-interix
++ exit 0 ;;
++ i*:UWIN*:*)
++ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+- echo powerpcle-unknown-cygwin32
++ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+- echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
++ # the GNU system
++ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
++ exit 0 ;;
++ *:GNU/*:*:*)
++ # other systems with GNU libc and userland
++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
++ exit 0 ;;
++ i*86:Minix:*:*)
++ echo ${UNAME_MACHINE}-pc-minix
++ exit 0 ;;
++ arm*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ cris:Linux:*:*)
++ echo cris-axis-linux-gnu
++ exit 0 ;;
++ ia64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ m32r*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ m68*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ mips:Linux:*:*)
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips
++ #undef mipsel
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mipsel
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips
++ #else
++ CPU=
++ #endif
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ ;;
++ mips64:Linux:*:*)
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips64
++ #undef mips64el
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mips64el
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips64
++ #else
++ CPU=
++ #endif
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ ;;
++ ppc:Linux:*:*)
++ echo powerpc-unknown-linux-gnu
++ exit 0 ;;
++ ppc64:Linux:*:*)
++ echo powerpc64-unknown-linux-gnu
++ exit 0 ;;
++ alpha:Linux:*:*)
++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++ EV5) UNAME_MACHINE=alphaev5 ;;
++ EV56) UNAME_MACHINE=alphaev56 ;;
++ PCA56) UNAME_MACHINE=alphapca56 ;;
++ PCA57) UNAME_MACHINE=alphapca56 ;;
++ EV6) UNAME_MACHINE=alphaev6 ;;
++ EV67) UNAME_MACHINE=alphaev67 ;;
++ EV68*) UNAME_MACHINE=alphaev68 ;;
++ esac
++ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++ exit 0 ;;
++ parisc:Linux:*:* | hppa:Linux:*:*)
++ # Look for CPU level
++ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
++ PA7*) echo hppa1.1-unknown-linux-gnu ;;
++ PA8*) echo hppa2.0-unknown-linux-gnu ;;
++ *) echo hppa-unknown-linux-gnu ;;
++ esac
++ exit 0 ;;
++ parisc64:Linux:*:* | hppa64:Linux:*:*)
++ echo hppa64-unknown-linux-gnu
++ exit 0 ;;
++ s390:Linux:*:* | s390x:Linux:*:*)
++ echo ${UNAME_MACHINE}-ibm-linux
++ exit 0 ;;
++ sh64*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+- *:Linux:*:*)
++ sh*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ sparc:Linux:*:* | sparc64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit 0 ;;
++ x86_64:Linux:*:*)
++ echo x86_64-unknown-linux-gnu
++ exit 0 ;;
++ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+- # first see if it will tell us.
+- ld_help_string=`ld --help 2>&1`
+- if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then
+- echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0
+- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then
+- echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0
+- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then
+- echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0
+- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then
+- echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0
+- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then
+- echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0
+- elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then
+- echo "powerpc-unknown-linux-gnu" ; exit 0
+- elif test "${UNAME_MACHINE}" = "alpha" ; then
+- echo alpha-unknown-linux-gnu ; exit 0
+- elif test "${UNAME_MACHINE}" = "sparc" ; then
+- echo sparc-unknown-linux-gnu ; exit 0
+- else
+- # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us
+- # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.
+- test ! -d /usr/lib/ldscripts/. \
+- && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+- # Determine whether the default compiler is a.out or elf
+- cat >dummy.c <<EOF
+-main(argc, argv)
+-int argc;
+-char *argv[];
+-{
+-#ifdef __ELF__
+- printf ("%s-pc-linux-gnu\n", argv[1]);
+-#else
+- printf ("%s-pc-linux-gnuaout\n", argv[1]);
+-#endif
+- return 0;
+-}
++ # first see if it will tell us. cd to the root directory to prevent
++ # problems with other programs or directories called `ld' in the path.
++ # Set LC_ALL=C to ensure ld outputs messages in English.
++ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
++ | sed -ne '/supported targets:/!d
++ s/[ ][ ]*/ /g
++ s/.*supported targets: *//
++ s/ .*//
++ p'`
++ case "$ld_supported_targets" in
++ elf32-i386)
++ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
++ ;;
++ a.out-i386-linux)
++ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
++ exit 0 ;;
++ coff-i386)
++ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
++ exit 0 ;;
++ "")
++ # Either a pre-BFD a.out linker (linux-gnuoldld) or
++ # one that does not give us useful --help.
++ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
++ exit 0 ;;
++ esac
++ # Determine whether the default compiler is a.out or elf
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #include <features.h>
++ #ifdef __ELF__
++ # ifdef __GLIBC__
++ # if __GLIBC__ >= 2
++ LIBC=gnu
++ # else
++ LIBC=gnulibc1
++ # endif
++ # else
++ LIBC=gnulibc1
++ # endif
++ #else
++ #ifdef __INTEL_COMPILER
++ LIBC=gnu
++ #else
++ LIBC=gnuaout
++ #endif
++ #endif
++ #ifdef __dietlibc__
++ LIBC=dietlibc
++ #endif
+ EOF
+- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+- rm -f dummy.c dummy
+- fi ;;
+-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+-# are messed up and put the nodename in both sysname and nodename.
+- i?86:DYNIX/ptx:4*:*)
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
++ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
++ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
++ ;;
++ i*86:DYNIX/ptx:4*:*)
++ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
++ # earlier versions are messed up and put the nodename in both
++ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
++ i*86:UNIX_SV:4.2MP:2.*)
++ # Unixware is an offshoot of SVR4, but it has its own version
++ # number series starting with 2...
++ # I am not positive that other SVR4 systems won't match this,
++ # I just have to hope. -- rms.
++ # Use sysv4.2uw... so that sysv4* matches it.
++ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
++ exit 0 ;;
++ i*86:OS/2:*:*)
++ # If we were able to find `uname', then EMX Unix compatibility
++ # is probably installed.
++ echo ${UNAME_MACHINE}-pc-os2-emx
++ exit 0 ;;
++ i*86:XTS-300:*:STOP)
++ echo ${UNAME_MACHINE}-unknown-stop
++ exit 0 ;;
++ i*86:atheos:*:*)
++ echo ${UNAME_MACHINE}-unknown-atheos
++ exit 0 ;;
++ i*86:syllable:*:*)
++ echo ${UNAME_MACHINE}-pc-syllable
++ exit 0 ;;
++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++ echo i386-unknown-lynxos${UNAME_RELEASE}
++ exit 0 ;;
++ i*86:*DOS:*:*)
++ echo ${UNAME_MACHINE}-pc-msdosdjgpp
++ exit 0 ;;
++ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
++ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
++ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
++ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+- i?86:*:3.2:*)
++ i*86:*:5:[78]*)
++ case `/bin/uname -X | grep "^Machine"` in
++ *486*) UNAME_MACHINE=i486 ;;
++ *Pentium) UNAME_MACHINE=i586 ;;
++ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
++ esac
++ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
++ exit 0 ;;
++ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
++ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
++ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
++ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
++ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
++ && UNAME_MACHINE=i686
++ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
++ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
++ pc:*:*:*)
++ # Left here for compatibility:
++ # uname -m prints for DJGPP always 'pc', but it prints nothing about
++ # the processor, so we play safe by assuming i386.
++ echo i386-pc-msdosdjgpp
++ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+@@ -487,9 +1073,15 @@
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+- M68*:*:R3V[567]*:*)
++ mc68k:UNIX:SYSTEM5:3.51m)
++ echo m68k-convergent-sysv
++ exit 0 ;;
++ M680?0:D-NIX:5.3:*)
++ echo m68k-diab-dnix
++ exit 0 ;;
++ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
++ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+@@ -500,24 +1092,27 @@
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+- m68*:LynxOS:2.*:*)
++ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+- i?86:LynxOS:2.*:*)
+- echo i386-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
++ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
++ echo powerpc-unknown-lynxos${UNAME_RELEASE}
++ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
++ RM*:ReliantUNIX-*:*:*)
++ echo mips-sni-sysv4
++ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+@@ -529,6 +1124,10 @@
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++ # says <Richard.M.Bartel@ccMail.Census.GOV>
++ echo i586-unisys-sysv4
++ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+@@ -538,26 +1137,126 @@
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
++ *:VOS:*:*)
++ # From Paul.Green@stratus.com.
++ echo hppa1.1-stratus-vos
++ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
++ news*:NEWS-OS:6*:*)
++ echo mips-sony-newsos6
++ exit 0 ;;
++ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+- # says <Richard.M.Bartel@ccMail.Census.GOV>
+- echo i586-unisys-sysv4
+- exit 0 ;;
++ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
++ echo powerpc-be-beos
++ exit 0 ;;
++ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
++ echo powerpc-apple-beos
++ exit 0 ;;
++ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
++ echo i586-pc-beos
++ exit 0 ;;
++ SX-4:SUPER-UX:*:*)
++ echo sx4-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
++ SX-5:SUPER-UX:*:*)
++ echo sx5-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
++ SX-6:SUPER-UX:*:*)
++ echo sx6-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
++ Power*:Rhapsody:*:*)
++ echo powerpc-apple-rhapsody${UNAME_RELEASE}
++ exit 0 ;;
++ *:Rhapsody:*:*)
++ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
++ exit 0 ;;
++ *:Darwin:*:*)
++ case `uname -p` in
++ *86) UNAME_PROCESSOR=i686 ;;
++ powerpc) UNAME_PROCESSOR=powerpc ;;
++ esac
++ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
++ exit 0 ;;
++ *:procnto*:*:* | *:QNX:[0123456789]*:*)
++ UNAME_PROCESSOR=`uname -p`
++ if test "$UNAME_PROCESSOR" = "x86"; then
++ UNAME_PROCESSOR=i386
++ UNAME_MACHINE=pc
++ fi
++ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
++ exit 0 ;;
++ *:QNX:*:4*)
++ echo i386-pc-qnx
++ exit 0 ;;
++ NSR-?:NONSTOP_KERNEL:*:*)
++ echo nsr-tandem-nsk${UNAME_RELEASE}
++ exit 0 ;;
++ *:NonStop-UX:*:*)
++ echo mips-compaq-nonstopux
++ exit 0 ;;
++ BS2000:POSIX*:*:*)
++ echo bs2000-siemens-sysv
++ exit 0 ;;
++ DS/*:UNIX_System_V:*:*)
++ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
++ exit 0 ;;
++ *:Plan9:*:*)
++ # "uname -m" is not consistent, so use $cputype instead. 386
++ # is converted to i386 for consistency with other x86
++ # operating systems.
++ if test "$cputype" = "386"; then
++ UNAME_MACHINE=i386
++ else
++ UNAME_MACHINE="$cputype"
++ fi
++ echo ${UNAME_MACHINE}-unknown-plan9
++ exit 0 ;;
++ *:TOPS-10:*:*)
++ echo pdp10-unknown-tops10
++ exit 0 ;;
++ *:TENEX:*:*)
++ echo pdp10-unknown-tenex
++ exit 0 ;;
++ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
++ echo pdp10-dec-tops20
++ exit 0 ;;
++ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
++ echo pdp10-xkl-tops20
++ exit 0 ;;
++ *:TOPS-20:*:*)
++ echo pdp10-unknown-tops20
++ exit 0 ;;
++ *:ITS:*:*)
++ echo pdp10-unknown-its
++ exit 0 ;;
++ SEI:*:*:SEIUX)
++ echo mips-sei-seiux${UNAME_RELEASE}
++ exit 0 ;;
++ *:DragonFly:*:*)
++ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
++ exit 0 ;;
++ *:*VMS:*:*)
++ UNAME_MACHINE=`(uname -p) 2>/dev/null`
++ case "${UNAME_MACHINE}" in
++ A*) echo alpha-dec-vms && exit 0 ;;
++ I*) echo ia64-dec-vms && exit 0 ;;
++ V*) echo vax-dec-vms && exit 0 ;;
++ esac
+ esac
+
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+ #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+-cat >dummy.c <<EOF
++eval $set_cc_for_build
++cat >$dummy.c <<EOF
+ #ifdef _SEQUENT_
+ # include <sys/types.h>
+ # include <sys/utsname.h>
+@@ -595,7 +1294,10 @@
+ #endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
++ if (version < 4)
++ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
++ else
++ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+ #endif
+
+@@ -640,11 +1342,24 @@
+ #endif
+
+ #if defined (vax)
+-#if !defined (ultrix)
+- printf ("vax-dec-bsd\n"); exit (0);
+-#else
+- printf ("vax-dec-ultrix\n"); exit (0);
+-#endif
++# if !defined (ultrix)
++# include <sys/param.h>
++# if defined (BSD)
++# if BSD == 43
++ printf ("vax-dec-bsd4.3\n"); exit (0);
++# else
++# if BSD == 199006
++ printf ("vax-dec-bsd4.3reno\n"); exit (0);
++# else
++ printf ("vax-dec-bsd\n"); exit (0);
++# endif
++# endif
++# else
++ printf ("vax-dec-bsd\n"); exit (0);
++# endif
++# else
++ printf ("vax-dec-ultrix\n"); exit (0);
++# endif
+ #endif
+
+ #if defined (alliant) && defined (i860)
+@@ -655,8 +1370,7 @@
+ }
+ EOF
+
+-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+-rm -f dummy.c dummy
++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+ # Apollos put the system type in the environment.
+
+@@ -688,6 +1402,48 @@
+ esac
+ fi
+
+-#echo '(Unable to guess system type)' 1>&2
++cat >&2 <<EOF
++$0: unable to guess system type
++
++This script, last modified $timestamp, has failed to recognize
++the operating system you are using. It is advised that you
++download the most up to date version of the config scripts from
++
++ ftp://ftp.gnu.org/pub/gnu/config/
++
++If the version you run ($0) is already up to date, please
++send the following data and any information you think might be
++pertinent to <config-patches@gnu.org> in order to provide the needed
++information to handle your system.
++
++config.guess timestamp = $timestamp
++
++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`
++/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
++
++hostinfo = `(hostinfo) 2>/dev/null`
++/bin/universe = `(/bin/universe) 2>/dev/null`
++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
++/bin/arch = `(/bin/arch) 2>/dev/null`
++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
++
++UNAME_MACHINE = ${UNAME_MACHINE}
++UNAME_RELEASE = ${UNAME_RELEASE}
++UNAME_SYSTEM = ${UNAME_SYSTEM}
++UNAME_VERSION = ${UNAME_VERSION}
++EOF
+
+ exit 1
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+diff -ruN libnet-1.0.2a-orig/config.sub libnet-1.0.2a-7/config.sub
+--- libnet-1.0.2a-orig/config.sub 2001-02-07 00:14:20.000000000 +0100
++++ libnet-1.0.2a-7/config.sub 2005-03-08 03:53:26.000000000 +0100
+@@ -1,6 +1,10 @@
+ #! /bin/sh
+-# Configuration validation subroutine script, version 1.1.
+-# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
++# Configuration validation subroutine script.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++timestamp='2004-06-24'
++
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+ # can handle that machine. It does not imply ALL GNU software can.
+@@ -25,6 +29,9 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
++#
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+ # If it is invalid, we print an error message on stderr and exit with code 1.
+@@ -45,30 +52,74 @@
+ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+ # It is wrong to echo any other type of specification.
+
+-if [ x$1 = x ]
+-then
+- echo Configuration name missing. 1>&2
+- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+- echo "or $0 ALIAS" 1>&2
+- echo where ALIAS is a recognized configuration type. 1>&2
+- exit 1
+-fi
++me=`echo "$0" | sed -e 's,.*/,,'`
+
+-# First pass through any local machine types.
+-case $1 in
+- *local*)
+- echo $1
+- exit 0
+- ;;
+- *)
+- ;;
++usage="\
++Usage: $0 [OPTION] CPU-MFR-OPSYS
++ $0 [OPTION] ALIAS
++
++Canonicalize a configuration name.
++
++Operation modes:
++ -h, --help print this help, then exit
++ -t, --time-stamp print date of last modification, then exit
++ -v, --version print version number, then exit
++
++Report bugs and patches to <config-patches@gnu.org>."
++
++version="\
++GNU config.sub ($timestamp)
++
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
++Free Software Foundation, Inc.
++
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
++
++help="
++Try \`$me --help' for more information."
++
++# Parse command line
++while test $# -gt 0 ; do
++ case $1 in
++ --time-stamp | --time* | -t )
++ echo "$timestamp" ; exit 0 ;;
++ --version | -v )
++ echo "$version" ; exit 0 ;;
++ --help | --h* | -h )
++ echo "$usage"; exit 0 ;;
++ -- ) # Stop option processing
++ shift; break ;;
++ - ) # Use stdin as input.
++ break ;;
++ -* )
++ echo "$me: invalid option $1$help"
++ exit 1 ;;
++
++ *local*)
++ # First pass through any local machine types.
++ echo $1
++ exit 0;;
++
++ * )
++ break ;;
++ esac
++done
++
++case $# in
++ 0) echo "$me: missing argument$help" >&2
++ exit 1;;
++ 1) ;;
++ *) echo "$me: too many arguments$help" >&2
++ exit 1;;
+ esac
+
+ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- linux-gnu*)
++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
++ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -94,15 +145,33 @@
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple)
++ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
++ -sim | -cisco | -oki | -wec | -winbond)
++ os=
++ basic_machine=$1
++ ;;
++ -scout)
++ ;;
++ -wrs)
++ os=-vxworks
++ basic_machine=$1
++ ;;
++ -chorusos*)
++ os=-chorusos
++ basic_machine=$1
++ ;;
++ -chorusrdb)
++ os=-chorusrdb
++ basic_machine=$1
++ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+- os=sco3.2v5
++ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+@@ -121,6 +190,9 @@
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
++ -udk*)
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+@@ -143,25 +215,74 @@
+ -psos*)
+ os=-psos
+ ;;
++ -mint | -mint[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
++ ;;
+ esac
+
+ # Decode aliases for certain CPU-COMPANY combinations.
+ case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+- tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
+- | arme[lb] | pyramid \
+- | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
+- | alpha | we32k | ns16k | clipper | i370 | sh \
+- | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
+- | pdp11 | mips64el | mips64orion | mips64orionel \
+- | sparc | sparclet | sparclite | sparc64)
++ 1750a | 580 \
++ | a29k \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
++ | am33_2.0 \
++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++ | c4x | clipper \
++ | d10v | d30v | dlx | dsp16xx \
++ | fr30 | frv \
++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | i370 | i860 | i960 | ia64 \
++ | ip2k | iq2000 \
++ | m32r | m32rle | m68000 | m68k | m88k | mcore \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64el \
++ | mips64vr | mips64vrel \
++ | mips64orion | mips64orionel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64r2 | mipsisa64r2el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipstx39 | mipstx39el \
++ | mn10200 | mn10300 \
++ | msp430 \
++ | ns16k | ns32k \
++ | openrisc | or32 \
++ | pdp10 | pdp11 | pj | pjl \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | pyramid \
++ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
++ | sh64 | sh64le \
++ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
++ | strongarm \
++ | tahoe | thumb | tic4x | tic80 | tron \
++ | v850 | v850e \
++ | we32k \
++ | x86 | xscale | xstormy16 | xtensa \
++ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
++ m6811 | m68hc11 | m6812 | m68hc12)
++ # Motorola 68HC11/12.
++ basic_machine=$basic_machine-unknown
++ os=-none
++ ;;
++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
++ ;;
++
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+- i[3456]86)
++ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+@@ -170,23 +291,86 @@
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+- vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
+- | sparc-* | ns32k-* | fx80-* | arm* | c[123]* \
+- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
+- | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
+- | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
+- | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
+- | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
+- | mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
++ 580-* \
++ | a29k-* \
++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
++ | avr-* \
++ | bs2000-* \
++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
++ | clipper-* | craynv-* | cydra-* \
++ | d10v-* | d30v-* | dlx-* \
++ | elxsi-* \
++ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
++ | h8300-* | h8500-* \
++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++ | i*86-* | i860-* | i960-* | ia64-* \
++ | ip2k-* | iq2000-* \
++ | m32r-* | m32rle-* \
++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
++ | m88110-* | m88k-* | mcore-* \
++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
++ | mips16-* \
++ | mips64-* | mips64el-* \
++ | mips64vr-* | mips64vrel-* \
++ | mips64orion-* | mips64orionel-* \
++ | mips64vr4100-* | mips64vr4100el-* \
++ | mips64vr4300-* | mips64vr4300el-* \
++ | mips64vr5000-* | mips64vr5000el-* \
++ | mipsisa32-* | mipsisa32el-* \
++ | mipsisa32r2-* | mipsisa32r2el-* \
++ | mipsisa64-* | mipsisa64el-* \
++ | mipsisa64r2-* | mipsisa64r2el-* \
++ | mipsisa64sb1-* | mipsisa64sb1el-* \
++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
++ | mipstx39-* | mipstx39el-* \
++ | mmix-* \
++ | msp430-* \
++ | none-* | np1-* | ns16k-* | ns32k-* \
++ | orion-* \
++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++ | pyramid-* \
++ | romp-* | rs6000-* \
++ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
++ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
++ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
++ | tahoe-* | thumb-* \
++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++ | tron-* \
++ | v850-* | v850e-* | vax-* \
++ | we32k-* \
++ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
++ | xtensa-* \
++ | ymp-* \
++ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
++ 386bsd)
++ basic_machine=i386-unknown
++ os=-bsd
++ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
++ a29khif)
++ basic_machine=a29k-amd
++ os=-udi
++ ;;
++ abacus)
++ basic_machine=abacus-unknown
++ ;;
++ adobe68k)
++ basic_machine=m68010-adobe
++ os=-scout
++ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+@@ -197,25 +381,35 @@
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
++ amd64)
++ basic_machine=x86_64-pc
++ ;;
++ amd64-*)
++ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ ;;
+- amigados)
+- basic_machine=m68k-cbm
+- os=-amigados
++ amigaos | amigados)
++ basic_machine=m68k-unknown
++ os=-amigaos
+ ;;
+ amigaunix | amix)
+- basic_machine=m68k-cbm
++ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
++ apollo68bsd)
++ basic_machine=m68k-apollo
++ os=-bsd
++ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+@@ -224,6 +418,10 @@
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
++ c90)
++ basic_machine=c90-cray
++ os=-unicos
++ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+@@ -244,27 +442,42 @@
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+- cray | ymp)
+- basic_machine=ymp-cray
+- os=-unicos
+- ;;
+- cray2)
+- basic_machine=cray2-cray
++ cray | j90)
++ basic_machine=j90-cray
+ os=-unicos
+ ;;
+- [ctj]90-cray)
+- basic_machine=c90-cray
+- os=-unicos
++ craynv)
++ basic_machine=craynv-cray
++ os=-unicosmp
++ ;;
++ cr16c)
++ basic_machine=cr16c-unknown
++ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
++ cris | cris-* | etrax*)
++ basic_machine=cris-axis
++ ;;
++ crx)
++ basic_machine=crx-unknown
++ os=-elf
++ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
++ decsystem10* | dec10*)
++ basic_machine=pdp10-dec
++ os=-tops10
++ ;;
++ decsystem20* | dec20*)
++ basic_machine=pdp10-dec
++ os=-tops20
++ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+@@ -292,6 +505,10 @@
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
++ es1800 | OSE68k | ose68k | ose | OSE)
++ basic_machine=m68k-ericsson
++ os=-ose
++ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+@@ -302,6 +519,10 @@
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
++ go32)
++ basic_machine=i386-pc
++ os=-go32
++ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+@@ -310,6 +531,14 @@
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
++ h8300xray)
++ basic_machine=h8300-hitachi
++ os=-xray
++ ;;
++ h8500hms)
++ basic_machine=h8500-hitachi
++ os=-hms
++ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+@@ -325,13 +554,30 @@
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
++ hp3k9[0-9][0-9] | hp9[0-9][0-9])
++ basic_machine=hppa1.0-hp
++ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
++ hp9k6[0-9][0-9] | hp6[0-9][0-9])
++ basic_machine=hppa1.0-hp
++ ;;
++ hp9k7[0-79][0-9] | hp7[0-79][0-9])
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k78[0-9] | hp78[0-9])
++ # FIXME: really hppa2.0-hp
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
++ # FIXME: really hppa2.0-hp
++ basic_machine=hppa1.1-hp
++ ;;
++ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+@@ -340,27 +586,42 @@
+ hppa-next)
+ os=-nextstep3
+ ;;
++ hppaosf)
++ basic_machine=hppa1.1-hp
++ os=-osf
++ ;;
++ hppro)
++ basic_machine=hppa1.1-hp
++ os=-proelf
++ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+- os=-mvs
+ ;;
+ # I'm not sure what "Sysv32" means. Should this be sysv3.2?
+- i[3456]86v32)
++ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+- i[3456]86v4*)
++ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+- i[3456]86v)
++ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+- i[3456]86sol2)
++ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
++ i386mach)
++ basic_machine=i386-mach
++ os=-mach
++ ;;
++ i386-vsta | vsta)
++ basic_machine=i386-unknown
++ os=-vsta
++ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+@@ -386,19 +647,51 @@
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
++ mingw32)
++ basic_machine=i386-pc
++ os=-mingw32
++ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
++ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
++ basic_machine=m68k-atari
++ os=-mint
++ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
++ monitor)
++ basic_machine=m68k-rom68k
++ os=-coff
++ ;;
++ morphos)
++ basic_machine=powerpc-unknown
++ os=-morphos
++ ;;
++ msdos)
++ basic_machine=i386-pc
++ os=-msdos
++ ;;
++ mvs)
++ basic_machine=i370-ibm
++ os=-mvs
++ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
++ netbsd386)
++ basic_machine=i386-unknown
++ os=-netbsd
++ ;;
++ netwinder)
++ basic_machine=armv4l-rebel
++ os=-linux
++ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+@@ -411,6 +704,10 @@
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
++ necv70)
++ basic_machine=v70-nec
++ os=-sysv
++ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+@@ -436,9 +733,40 @@
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
++ mon960)
++ basic_machine=i960-intel
++ os=-mon960
++ ;;
++ nonstopux)
++ basic_machine=mips-compaq
++ os=-nonstopux
++ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
++ nsr-tandem)
++ basic_machine=nsr-tandem
++ ;;
++ op50n-* | op60c-*)
++ basic_machine=hppa1.1-oki
++ os=-proelf
++ ;;
++ or32 | or32-*)
++ basic_machine=or32-unknown
++ os=-coff
++ ;;
++ os400)
++ basic_machine=powerpc-ibm
++ os=-os400
++ ;;
++ OSE68000 | ose68000)
++ basic_machine=m68000-ericsson
++ os=-ose
++ ;;
++ os68k)
++ basic_machine=m68k-none
++ os=-os68k
++ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+@@ -453,53 +781,95 @@
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+- pc532 | pc532-*)
++ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+- pentium | p5)
+- basic_machine=i586-intel
++ pentium | p5 | k5 | k6 | nexgen | viac3)
++ basic_machine=i586-pc
++ ;;
++ pentiumpro | p6 | 6x86 | athlon | athlon_*)
++ basic_machine=i686-pc
++ ;;
++ pentiumii | pentium2 | pentiumiii | pentium3)
++ basic_machine=i686-pc
+ ;;
+- pentiumpro | p6)
+- basic_machine=i686-intel
++ pentium4)
++ basic_machine=i786-pc
+ ;;
+- pentium-* | p5-*)
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+- pentiumpro-* | p6-*)
++ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+- k5)
+- # We don't have specific support for AMD's K5 yet, so just call it a Pentium
+- basic_machine=i586-amd
+- ;;
+- nexen)
+- # We don't have specific support for Nexgen yet, so just call it a Pentium
+- basic_machine=i586-nexgen
++ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ pentium4-*)
++ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+- power) basic_machine=rs6000-ibm
++ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+- ;;
++ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+- ;;
++ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
++ ppc64) basic_machine=powerpc64-unknown
++ ;;
++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
++ basic_machine=powerpc64le-unknown
++ ;;
++ ppc64le-* | powerpc64little-*)
++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
++ pw32)
++ basic_machine=i586-unknown
++ os=-pw32
++ ;;
++ rom68k)
++ basic_machine=m68k-rom68k
++ os=-coff
++ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
++ s390 | s390-*)
++ basic_machine=s390-ibm
++ ;;
++ s390x | s390x-*)
++ basic_machine=s390x-ibm
++ ;;
++ sa29200)
++ basic_machine=a29k-amd
++ os=-udi
++ ;;
++ sb1)
++ basic_machine=mipsisa64sb1-unknown
++ ;;
++ sb1el)
++ basic_machine=mipsisa64sb1el-unknown
++ ;;
++ sei)
++ basic_machine=mips-sei
++ os=-seiux
++ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+@@ -507,6 +877,13 @@
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
++ sparclite-wrs | simso-wrs)
++ basic_machine=sparclite-wrs
++ os=-vxworks
++ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+@@ -514,6 +891,13 @@
+ spur)
+ basic_machine=spur-unknown
+ ;;
++ st2000)
++ basic_machine=m68k-tandem
++ ;;
++ stratus)
++ basic_machine=i860-stratus
++ os=-sysv4
++ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+@@ -554,13 +938,51 @@
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
++ sv1)
++ basic_machine=sv1-cray
++ os=-unicos
++ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
++ t3e)
++ basic_machine=alphaev5-cray
++ os=-unicos
++ ;;
++ t90)
++ basic_machine=t90-cray
++ os=-unicos
++ ;;
++ tic54x | c54x*)
++ basic_machine=tic54x-unknown
++ os=-coff
++ ;;
++ tic55x | c55x*)
++ basic_machine=tic55x-unknown
++ os=-coff
++ ;;
++ tic6x | c6x*)
++ basic_machine=tic6x-unknown
++ os=-coff
++ ;;
++ tx39)
++ basic_machine=mipstx39-unknown
++ ;;
++ tx39el)
++ basic_machine=mipstx39el-unknown
++ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ os=-tops20
++ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
++ tpf)
++ basic_machine=s390x-ibm
++ os=-tpf
++ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+@@ -569,6 +991,10 @@
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
++ v810 | necv810)
++ basic_machine=v810-nec
++ os=-none
++ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+@@ -577,9 +1003,9 @@
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+- vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
+- ;;
++ vpp*|vx|vx-*)
++ basic_machine=f301-fujitsu
++ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+@@ -592,13 +1018,25 @@
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+- xmp)
+- basic_machine=xmp-cray
+- os=-unicos
++ w65*)
++ basic_machine=w65-wdc
++ os=-none
+ ;;
+- xps | xps100)
++ w89k-*)
++ basic_machine=hppa1.1-winbond
++ os=-proelf
++ ;;
++ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
++ ymp)
++ basic_machine=ymp-cray
++ os=-unicos
++ ;;
++ z8k-*-coff)
++ basic_machine=z8k-unknown
++ os=-sim
++ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+@@ -606,28 +1044,47 @@
+
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+- mips)
+- basic_machine=mips-mips
++ w89k)
++ basic_machine=hppa1.1-winbond
++ ;;
++ op50n)
++ basic_machine=hppa1.1-oki
++ ;;
++ op60c)
++ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
++ mmix)
++ basic_machine=mmix-knuth
++ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
++ pdp10)
++ # there are many clones, so DEC is not a safe bet
++ basic_machine=pdp10-unknown
++ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+- sparc)
++ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
++ basic_machine=sh-unknown
++ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
++ sparc | sparcv8 | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+- cydra)
++ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+@@ -636,6 +1093,15 @@
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
++ mac | mpw | mac-mpw)
++ basic_machine=m68k-apple
++ ;;
++ pmac | pmac-mpw)
++ basic_machine=powerpc-apple
++ ;;
++ *-unknown)
++ # Make sure to match an already-canonicalized machine name.
++ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+@@ -668,9 +1134,12 @@
+ -solaris)
+ os=-solaris2
+ ;;
+- -unixware* | svr4*)
++ -svr4*)
+ os=-sysv4
+ ;;
++ -unixware*)
++ os=-sysv4.2uw
++ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+@@ -681,17 +1150,50 @@
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+- | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
++ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
++ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
++ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
++ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
++ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+- | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -linux-gnu* | -uxpv*)
++ | -chorusos* | -chorusrdb* \
++ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
++ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
++ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
++ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
++ -qnx*)
++ case $basic_machine in
++ x86-* | i*86-*)
++ ;;
++ *)
++ os=-nto$os
++ ;;
++ esac
++ ;;
++ -nto-qnx*)
++ ;;
++ -nto*)
++ os=`echo $os | sed -e 's|nto|nto-qnx|'`
++ ;;
++ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
++ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
++ ;;
++ -mac*)
++ os=`echo $os | sed -e 's|mac|macos|'`
++ ;;
++ -linux-dietlibc)
++ os=-linux-dietlibc
++ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+@@ -701,6 +1203,15 @@
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
++ -opened*)
++ os=-openedition
++ ;;
++ -os400*)
++ os=-os400
++ ;;
++ -wince*)
++ os=-wince
++ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+@@ -716,11 +1227,26 @@
+ -acis*)
+ os=-aos
+ ;;
++ -atheos*)
++ os=-atheos
++ ;;
++ -syllable*)
++ os=-syllable
++ ;;
++ -386bsd)
++ os=-bsd
++ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
++ -nova*)
++ os=-rtmk-nova
++ ;;
+ -ns2 )
+- os=-nextstep2
++ os=-nextstep2
++ ;;
++ -nsk*)
++ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+@@ -729,6 +1255,9 @@
+ -sinix*)
+ os=-sysv4
+ ;;
++ -tpf*)
++ os=-tpf
++ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+@@ -747,9 +1276,24 @@
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
++ -ose*)
++ os=-ose
++ ;;
++ -es1800*)
++ os=-ose
++ ;;
+ -xenix)
+ os=-xenix
+ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ os=-mint
++ ;;
++ -aros*)
++ os=-aros
++ ;;
++ -kaos*)
++ os=-kaos
++ ;;
+ -none)
+ ;;
+ *)
+@@ -775,10 +1319,20 @@
+ *-acorn)
+ os=-riscix1.2
+ ;;
++ arm*-rebel)
++ os=-linux
++ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+- pdp11-*)
++ c4x-* | tic4x-*)
++ os=-coff
++ ;;
++ # This must come before the *-dec entry.
++ pdp10-*)
++ os=-tops20
++ ;;
++ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+@@ -796,15 +1350,42 @@
+ # default.
+ # os=-sunos4
+ ;;
++ m68*-cisco)
++ os=-aout
++ ;;
++ mips*-cisco)
++ os=-elf
++ ;;
++ mips*-*)
++ os=-elf
++ ;;
++ or32-*)
++ os=-coff
++ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
++ *-be)
++ os=-beos
++ ;;
+ *-ibm)
+ os=-aix
+ ;;
++ *-knuth)
++ os=-mmixware
++ ;;
++ *-wec)
++ os=-proelf
++ ;;
++ *-winbond)
++ os=-proelf
++ ;;
++ *-oki)
++ os=-proelf
++ ;;
+ *-hp)
+ os=-hpux
+ ;;
+@@ -815,7 +1396,7 @@
+ os=-sysv
+ ;;
+ *-cbm)
+- os=-amigados
++ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+@@ -847,27 +1428,39 @@
+ *-next)
+ os=-nextstep3
+ ;;
+- *-gould)
++ *-gould)
+ os=-sysv
+ ;;
+- *-highlevel)
++ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+- *-sgi)
++ *-sgi)
+ os=-irix
+ ;;
+- *-siemens)
++ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+- f301-fujitsu)
++ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
++ *-rom68k)
++ os=-coff
++ ;;
++ *-*bug)
++ os=-coff
++ ;;
++ *-apple)
++ os=-macos
++ ;;
++ *-atari*)
++ os=-mint
++ ;;
+ *)
+ os=-none
+ ;;
+@@ -889,9 +1482,15 @@
+ -aix*)
+ vendor=ibm
+ ;;
++ -beos*)
++ vendor=be
++ ;;
+ -hpux*)
+ vendor=hp
+ ;;
++ -mpeix*)
++ vendor=hp
++ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+@@ -907,21 +1506,47 @@
+ -genix*)
+ vendor=ns
+ ;;
+- -mvs*)
++ -mvs* | -opened*)
++ vendor=ibm
++ ;;
++ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+- -vxsim* | -vxworks*)
++ -tpf*)
++ vendor=ibm
++ ;;
++ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
++ -hms*)
++ vendor=hitachi
++ ;;
++ -mpw* | -macos*)
++ vendor=apple
++ ;;
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ vendor=atari
++ ;;
++ -vos*)
++ vendor=stratus
++ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+ esac
+
+ echo $basic_machine$os
++exit 0
++
++# Local variables:
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "timestamp='"
++# time-stamp-format: "%:y-%02m-%02d"
++# time-stamp-end: "'"
++# End:
+diff -ruN libnet-1.0.2a-orig/configure libnet-1.0.2a-7/configure
+--- libnet-1.0.2a-orig/configure 2001-01-17 21:59:33.000000000 +0100
++++ libnet-1.0.2a-7/configure 2005-03-08 03:53:26.000000000 +0100
+@@ -1,31 +1,485 @@
+ #! /bin/sh
+-
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated automatically using autoconf version 2.13
+-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
++# Generated by GNU Autoconf 2.59.
+ #
++# Copyright (C) 2003 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 Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++DUALCASE=1; export DUALCASE # for MKS sh
++
++# Support unset when possible.
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; 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
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# 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
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ 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
++
++ ;;
++ 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
++ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
++done
++;;
++ esac
++
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++ { (exit 1); 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 sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
++
++
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
++
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
++ else
++ as_ln_s='ln -s'
++ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ test -d ./-p && rmdir ./-p
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# 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'"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++
++# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++
++
++# Check that we are running under the correct shell.
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++case X$ECHO in
++X*--fallback-echo)
++ # Remove one level of quotation (which was required for Make).
++ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
++ ;;
++esac
++
++echo=${ECHO-echo}
++if test "X$1" = X--no-reexec; then
++ # Discard the --no-reexec flag, and continue.
++ shift
++elif test "X$1" = X--fallback-echo; then
++ # Avoid inline document here, it may be left over
++ :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
++ # Yippee, $echo works!
++ :
++else
++ # Restart under the correct shell.
++ exec $SHELL "$0" --no-reexec ${1+"$@"}
++fi
++
++if test "X$1" = X--fallback-echo; then
++ # used as fallback echo
++ shift
++ cat <<EOF
++
++EOF
++ exit 0
++fi
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++if test -z "$ECHO"; then
++if test "X${echo_test_string+set}" != Xset; then
++# find a string as large as possible, as long as the shell can cope with it
++ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
++ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
++ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
++ echo_test_string="`eval $cmd`" &&
++ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
++ then
++ break
++ fi
++ done
++fi
++
++if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ :
++else
++ # The Solaris, AIX, and Digital Unix default echo programs unquote
++ # backslashes. This makes it impossible to quote backslashes using
++ # echo "$something" | sed 's/\\/\\\\/g'
++ #
++ # So, first we look for a working echo in the user's PATH.
++
++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for dir in $PATH /usr/ucb; do
++ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
++ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$dir/echo"
++ break
++ fi
++ done
++ IFS="$save_ifs"
++
++ if test "X$echo" = Xecho; then
++ # We didn't find a better echo, so look for alternatives.
++ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # This shell has a builtin print -r that does the trick.
++ echo='print -r'
++ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
++ test "X$CONFIG_SHELL" != X/bin/ksh; then
++ # If we have ksh, try running configure again with it.
++ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
++ export ORIGINAL_CONFIG_SHELL
++ CONFIG_SHELL=/bin/ksh
++ export CONFIG_SHELL
++ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
++ else
++ # Try using printf.
++ echo='printf %s\n'
++ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # Cool, printf works
++ :
++ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
++ export CONFIG_SHELL
++ SHELL="$CONFIG_SHELL"
++ export SHELL
++ echo="$CONFIG_SHELL $0 --fallback-echo"
++ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$CONFIG_SHELL $0 --fallback-echo"
++ else
++ # maybe with a smaller string...
++ prev=:
++
++ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
++ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
++ then
++ break
++ fi
++ prev="$cmd"
++ done
++
++ if test "$prev" != 'sed 50q "$0"'; then
++ echo_test_string=`eval $prev`
++ export echo_test_string
++ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
++ else
++ # Oops. We lost completely, so just stick with echo.
++ echo=echo
++ fi
++ fi
++ fi
++ fi
++fi
++fi
++
++# Copy echo and quote the copy suitably for passing to libtool from
++# the Makefile, instead of quoting the original, which is used later.
++ECHO=$echo
++if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
++ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
++fi
++
++
+
+-# Defaults:
+-ac_help=
++# 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`
++
++exec 6>&1
++
++#
++# Initializations.
++#
+ ac_default_prefix=/usr/local
+-# Any additions from configure.in:
++ac_config_libobj_dir=.
++cross_compiling=no
++subdirs=
++MFLAGS=
++MAKEFLAGS=
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++# Maximum number of lines to put in a shell here document.
++# This variable seems obsolete. It should probably be removed, and
++# only ac_max_sed_lines should be used.
++: ${ac_max_here_lines=38}
++
++# Identity of this package.
++PACKAGE_NAME=
++PACKAGE_TARNAME=
++PACKAGE_VERSION=
++PACKAGE_STRING=
++PACKAGE_BUGREPORT=
++
++ac_unique_file="src/libnet_build_ip.c"
+ ac_default_prefix=/usr
+-ac_help="$ac_help
+- --with-pf_packet=[yes,no] override defaults"
+-ac_help="$ac_help
+- --with-fast_x86_check=[yes,no] override defaults"
++# Factoring default headers for most tests.
++ac_includes_default="\
++#include <stdio.h>
++#if HAVE_SYS_TYPES_H
++# include <sys/types.h>
++#endif
++#if HAVE_SYS_STAT_H
++# include <sys/stat.h>
++#endif
++#if STDC_HEADERS
++# include <stdlib.h>
++# include <stddef.h>
++#else
++# if HAVE_STDLIB_H
++# include <stdlib.h>
++# endif
++#endif
++#if HAVE_STRING_H
++# if !STDC_HEADERS && HAVE_MEMORY_H
++# include <memory.h>
++# endif
++# include <string.h>
++#endif
++#if HAVE_STRINGS_H
++# include <strings.h>
++#endif
++#if HAVE_INTTYPES_H
++# include <inttypes.h>
++#else
++# if HAVE_STDINT_H
++# include <stdint.h>
++# endif
++#endif
++#if HAVE_UNISTD_H
++# include <unistd.h>
++#endif"
++
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot LL_INT_TYPE_UC LL_INT_TYPE LIB_PREFIX INC_PREFIX MAN_PREFIX BIN_PREFIX RANLIB AR LN ADDITIONAL_LIBS LIBNET_CONFIG_DEFINES LIBNET_CONFIG_LIBS LIBNET_CONFIG_CFLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S ECHO ac_ct_RANLIB CPP EGREP LIBTOOL LIBOBJS LTLIBOBJS'
++ac_subst_files=''
+
+ # Initialize some variables set by options.
++ac_init_help=
++ac_init_version=false
+ # The variables have the same names as the options, with
+ # dashes changed to underlines.
+-build=NONE
+-cache_file=./config.cache
++cache_file=/dev/null
+ exec_prefix=NONE
+-host=NONE
+ no_create=
+-nonopt=NONE
+ no_recursion=
+ prefix=NONE
+ program_prefix=NONE
+@@ -34,10 +488,15 @@
+ silent=
+ site=
+ srcdir=
+-target=NONE
+ 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.
+ bindir='${exec_prefix}/bin'
+ sbindir='${exec_prefix}/sbin'
+ libexecdir='${exec_prefix}/libexec'
+@@ -51,17 +510,9 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
+-# Initialize some other variables.
+-subdirs=
+-MFLAGS= MAKEFLAGS=
+-SHELL=${CONFIG_SHELL-/bin/sh}
+-# Maximum number of lines to put in a shell here document.
+-ac_max_here_lines=12
+-
+ ac_prev=
+ for ac_option
+ do
+-
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+@@ -69,59 +520,59 @@
+ continue
+ fi
+
+- case "$ac_option" in
+- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+- *) ac_optarg= ;;
+- esac
++ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+- case "$ac_option" in
++ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+- bindir="$ac_optarg" ;;
++ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+- ac_prev=build ;;
++ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+- build="$ac_optarg" ;;
++ 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" ;;
++ cache_file=$ac_optarg ;;
++
++ --config-cache | -C)
++ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+- datadir="$ac_optarg" ;;
++ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
++ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+- fi
+- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+- eval "enable_${ac_feature}=no" ;;
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
++ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+- fi
+- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+- case "$ac_option" in
+- *=*) ;;
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+- eval "enable_${ac_feature}='$ac_optarg'" ;;
++ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+@@ -130,95 +581,47 @@
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+- exec_prefix="$ac_optarg" ;;
++ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+- -help | --help | --hel | --he)
+- # 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 << EOF
+-Usage: configure [options] [host]
+-Options: [defaults in brackets after descriptions]
+-Configuration:
+- --cache-file=FILE cache test results in FILE
+- --help print this message
+- --no-create do not create output files
+- --quiet, --silent do not print \`checking...' messages
+- --version print the version of autoconf that created configure
+-Directory and file names:
+- --prefix=PREFIX install architecture-independent files in PREFIX
+- [$ac_default_prefix]
+- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+- [same as prefix]
+- --bindir=DIR user executables in DIR [EPREFIX/bin]
+- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+- --datadir=DIR read-only architecture-independent data in DIR
+- [PREFIX/share]
+- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+- --sharedstatedir=DIR modifiable architecture-independent data in DIR
+- [PREFIX/com]
+- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+- --includedir=DIR C header files in DIR [PREFIX/include]
+- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+- --infodir=DIR info documentation in DIR [PREFIX/info]
+- --mandir=DIR man documentation in DIR [PREFIX/man]
+- --srcdir=DIR find the sources in DIR [configure dir or ..]
+- --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
+-EOF
+- cat << EOF
+-Host type:
+- --build=BUILD configure for building on BUILD [BUILD=HOST]
+- --host=HOST configure for HOST [guessed]
+- --target=TARGET configure for TARGET [TARGET=HOST]
+-Features and packages:
+- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+- --x-includes=DIR X include files are in DIR
+- --x-libraries=DIR X library files are in DIR
+-EOF
+- if test -n "$ac_help"; then
+- echo "--enable and --with options recognized:$ac_help"
+- fi
+- exit 0 ;;
++ -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 ;;
++ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+- host="$ac_optarg" ;;
++ host_alias=$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" ;;
++ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+- infodir="$ac_optarg" ;;
++ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+- libdir="$ac_optarg" ;;
++ 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" ;;
++ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+@@ -227,19 +630,19 @@
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+- localstatedir="$ac_optarg" ;;
++ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+- mandir="$ac_optarg" ;;
++ 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)
++ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+@@ -253,26 +656,26 @@
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+- oldincludedir="$ac_optarg" ;;
++ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+- prefix="$ac_optarg" ;;
++ 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_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_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+@@ -289,7 +692,7 @@
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+- program_transform_name="$ac_optarg" ;;
++ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+@@ -299,7 +702,7 @@
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+- sbindir="$ac_optarg" ;;
++ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+@@ -310,58 +713,57 @@
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+- sharedstatedir="$ac_optarg" ;;
++ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+- site="$ac_optarg" ;;
++ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+- srcdir="$ac_optarg" ;;
++ 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" ;;
++ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+- ac_prev=target ;;
++ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+- target="$ac_optarg" ;;
++ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+- -version | --version | --versio | --versi | --vers)
+- echo "configure generated by autoconf version 2.13"
+- exit 0 ;;
++ -version | --version | --versio | --versi | --vers | -V)
++ ac_init_version=: ;;
+
+ -with-* | --with-*)
+- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
++ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+- fi
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+- case "$ac_option" in
+- *=*) ;;
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+- eval "with_${ac_package}='$ac_optarg'" ;;
++ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
++ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+- fi
+- ac_package=`echo $ac_package| sed 's/-/_/g'`
+- eval "with_${ac_package}=no" ;;
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
++ ac_package=`echo $ac_package | sed 's/-/_/g'`
++ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+@@ -372,99 +774,110 @@
+ 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_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" ;;
++ x_libraries=$ac_optarg ;;
+
+- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
++ -*) { echo "$as_me: error: unrecognized option: $ac_option
++Try \`$0 --help' for more information." >&2
++ { (exit 1); exit 1; }; }
+ ;;
+
++ *=*)
++ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
++ { (exit 1); exit 1; }; }
++ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
++ eval "$ac_envvar='$ac_optarg'"
++ export $ac_envvar ;;
++
+ *)
+- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+- echo "configure: warning: $ac_option: invalid host type" 1>&2
+- fi
+- if test "x$nonopt" != xNONE; then
+- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+- fi
+- nonopt="$ac_option"
++ # FIXME: should be removed in autoconf 3.0.
++ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
++ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
++ 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
+- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+-fi
+-
+-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+-
+-# File descriptor usage:
+-# 0 standard input
+-# 1 file creation
+-# 2 errors and warnings
+-# 3 some systems may open it to /dev/tty
+-# 4 used on the Kubota Titan
+-# 6 checking for... messages and results
+-# 5 compiler messages saved in config.log
+-if test "$silent" = yes; then
+- exec 6>/dev/null
+-else
+- exec 6>&1
++ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
++ { echo "$as_me: error: missing argument to $ac_option" >&2
++ { (exit 1); exit 1; }; }
+ fi
+-exec 5>./config.log
+
+-echo "\
+-This file contains any messages produced by compilers while
+-running configure, to aid debugging if configure makes a mistake.
+-" 1>&5
++# Be sure to have absolute paths.
++for ac_var in exec_prefix prefix
++do
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
++ esac
++done
+
+-# Strip out --no-create and --no-recursion so they do not pile up.
+-# Also quote any args containing shell metacharacters.
+-ac_configure_args=
+-for ac_arg
++# Be sure to have absolute paths.
++for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
++ localstatedir libdir includedir oldincludedir infodir mandir
+ do
+- case "$ac_arg" in
+- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+- | --no-cr | --no-c) ;;
+- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
+ esac
+ done
+
+-# NLS nuisances.
+-# Only set these to C if already set. These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
++# 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
++ 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
+
+-# confdefs.h avoids OS command line length limits that DEFS can exceed.
+-rm -rf conftest* confdefs.h
+-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+-echo > confdefs.h
++ac_tool_prefix=
++test -n "$host_alias" && ac_tool_prefix=$host_alias-
++
++test "$silent" = yes && exec 6>/dev/null
+
+-# A filename unique to this package, relative to the directory that
+-# configure is in, which we can look for to find out if srcdir is correct.
+-ac_unique_file=src/libnet_build_ip.c
+
+ # 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 its parent.
+- ac_prog=$0
+- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
++ ac_confdir=`(dirname "$0") 2>/dev/null ||
++$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$0" : 'X\(//\)[^/]' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$0" |
++ 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=..
+@@ -474,516 +887,702 @@
+ fi
+ if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+- else
+- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+- fi
+-fi
+-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+-
+-# Prefer explicitly selected file to automatically selected ones.
+-if test -z "$CONFIG_SITE"; then
+- if test "x$prefix" != xNONE; then
+- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
++ { (exit 1); exit 1; }; }
+ else
+- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
++ { (exit 1); exit 1; }; }
+ fi
+ fi
+-for ac_site_file in $CONFIG_SITE; do
+- if test -r "$ac_site_file"; then
+- echo "loading site script $ac_site_file"
+- . "$ac_site_file"
+- fi
+-done
++(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
++ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
++ { (exit 1); exit 1; }; }
++srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
++ac_env_build_alias_set=${build_alias+set}
++ac_env_build_alias_value=$build_alias
++ac_cv_env_build_alias_set=${build_alias+set}
++ac_cv_env_build_alias_value=$build_alias
++ac_env_host_alias_set=${host_alias+set}
++ac_env_host_alias_value=$host_alias
++ac_cv_env_host_alias_set=${host_alias+set}
++ac_cv_env_host_alias_value=$host_alias
++ac_env_target_alias_set=${target_alias+set}
++ac_env_target_alias_value=$target_alias
++ac_cv_env_target_alias_set=${target_alias+set}
++ac_cv_env_target_alias_value=$target_alias
++ac_env_CC_set=${CC+set}
++ac_env_CC_value=$CC
++ac_cv_env_CC_set=${CC+set}
++ac_cv_env_CC_value=$CC
++ac_env_CFLAGS_set=${CFLAGS+set}
++ac_env_CFLAGS_value=$CFLAGS
++ac_cv_env_CFLAGS_set=${CFLAGS+set}
++ac_cv_env_CFLAGS_value=$CFLAGS
++ac_env_LDFLAGS_set=${LDFLAGS+set}
++ac_env_LDFLAGS_value=$LDFLAGS
++ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
++ac_cv_env_LDFLAGS_value=$LDFLAGS
++ac_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_env_CPPFLAGS_value=$CPPFLAGS
++ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_cv_env_CPPFLAGS_value=$CPPFLAGS
++ac_env_CPP_set=${CPP+set}
++ac_env_CPP_value=$CPP
++ac_cv_env_CPP_set=${CPP+set}
++ac_cv_env_CPP_value=$CPP
+
+-if test -r "$cache_file"; then
+- echo "loading cache $cache_file"
+- . $cache_file
+-else
+- echo "creating cache $cache_file"
+- > $cache_file
+-fi
++#
++# 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 this package to adapt to many kinds of systems.
+
+-ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
+-
+-ac_exeext=
+-ac_objext=o
+-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+- ac_n= ac_c='
+-' ac_t=' '
+- else
+- ac_n=-n ac_c= ac_t=
+- fi
+-else
+- ac_n= ac_c='\c' ac_t=
+-fi
++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.
+
+-VER=`cat VERSION`
+-echo "$ac_t""Beginning autoconfiguration process for libnet-$VER..." 1>&6
++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 \`..']
+
++_ACEOF
+
++ cat <<_ACEOF
++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]
++ --datadir=DIR read-only architecture-independent data [PREFIX/share]
++ --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]
++ --infodir=DIR info documentation [PREFIX/info]
++ --mandir=DIR man documentation [PREFIX/man]
++_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
+
++ cat <<\_ACEOF
+
++Optional Features:
++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
++ --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)
+
++Optional Packages:
++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-pf_packet=yes,no override defaults
++ --with-fast_x86_check=yes,no override defaults
++ --with-gnu-ld assume the C compiler uses GNU ld default=no
++ --with-pic try to use only PIC/non-PIC objects default=use both
++
++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>
++ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
++ headers in a nonstandard directory <include dir>
++ CPP C preprocessor
++
++Use these variables to override the choices made by `configure' or to help
++it to find libraries and programs with nonstandard names/locations.
++
++_ACEOF
++fi
++
++if test "$ac_init_help" = "recursive"; then
++ # If there are subdirs, report their specific --help.
++ ac_popdir=`pwd`
++ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
++ test -d $ac_dir || continue
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
+
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
+
++ cd $ac_dir
++ # Check for guested configure; otherwise get Cygnus style 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
++ elif test -f $ac_srcdir/configure.ac ||
++ test -f $ac_srcdir/configure.in; then
++ echo
++ $ac_configure --help
++ else
++ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
++ fi
++ cd "$ac_popdir"
++ done
++fi
+
++test -n "$ac_init_help" && exit 0
++if $ac_init_version; then
++ cat <<\_ACEOF
++
++Copyright (C) 2003 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 0
++fi
++exec 5>config.log
++cat >&5 <<_ACEOF
++This file contains any messages produced by compilers while
++running configure, to aid debugging if configure makes a mistake.
+
++It was created by $as_me, which was
++generated by GNU Autoconf 2.59. Invocation command line was
+
++ $ $0 $@
+
++_ACEOF
++{
++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`
++hostinfo = `(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
+
+-ac_aux_dir=
+-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+- if test -f $ac_dir/install-sh; then
+- ac_aux_dir=$ac_dir
+- ac_install_sh="$ac_aux_dir/install-sh -c"
+- break
+- elif test -f $ac_dir/install.sh; then
+- ac_aux_dir=$ac_dir
+- ac_install_sh="$ac_aux_dir/install.sh -c"
+- break
+- fi
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ echo "PATH: $as_dir"
+ done
+-if test -z "$ac_aux_dir"; then
+- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+-fi
+-ac_config_guess=$ac_aux_dir/config.guess
+-ac_config_sub=$ac_aux_dir/config.sub
+-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+-
+-
+-# Do some error checking and defaulting for the host and target type.
+-# The inputs are:
+-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+-#
+-# The rules are:
+-# 1. You are not allowed to specify --host, --target, and nonopt at the
+-# same time.
+-# 2. Host defaults to nonopt.
+-# 3. If nonopt is not specified, then host defaults to the current host,
+-# as determined by config.guess.
+-# 4. Target and build default to nonopt.
+-# 5. If nonopt is not specified, then target and build default to host.
+
+-# The aliases save the names the user supplied, while $host etc.
+-# will get canonicalized.
+-case $host---$target---$nonopt in
+-NONE---*---* | *---NONE---* | *---*---NONE) ;;
+-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+-esac
++} >&5
+
++cat >&5 <<_ACEOF
+
+-# Make sure we can run config.sub.
+-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+-fi
+
+-echo $ac_n "checking host system type""... $ac_c" 1>&6
+-echo "configure:595: checking host system type" >&5
++## ----------- ##
++## Core tests. ##
++## ----------- ##
+
+-host_alias=$host
+-case "$host_alias" in
+-NONE)
+- case $nonopt in
+- NONE)
+- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+- fi ;;
+- *) host_alias=$nonopt ;;
+- esac ;;
+-esac
++_ACEOF
+
+-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+-echo "$ac_t""$host" 1>&6
+-
+-echo $ac_n "checking target system type""... $ac_c" 1>&6
+-echo "configure:616: checking target system type" >&5
+-
+-target_alias=$target
+-case "$target_alias" in
+-NONE)
+- case $nonopt in
+- NONE) target_alias=$host_alias ;;
+- *) target_alias=$nonopt ;;
+- esac ;;
+-esac
+-
+-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+-echo "$ac_t""$target" 1>&6
+-
+-echo $ac_n "checking build system type""... $ac_c" 1>&6
+-echo "configure:634: checking build system type" >&5
+-
+-build_alias=$build
+-case "$build_alias" in
+-NONE)
+- case $nonopt in
+- NONE) build_alias=$host_alias ;;
+- *) build_alias=$nonopt ;;
+- esac ;;
+-esac
+-
+-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+-echo "$ac_t""$build" 1>&6
+
+-test "$host_alias" != "$target_alias" &&
+- test "$program_prefix$program_suffix$program_transform_name" = \
+- NONENONEs,x,x, &&
+- program_prefix=${target_alias}-
++# 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_sep=
++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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ esac
++ case $ac_pass in
++ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
++ 2)
++ ac_configure_args1="$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
++ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
++ # Get rid of the leading space.
++ ac_sep=" "
++ ;;
++ esac
++ done
++done
++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells,
++# such as our DU 5.0 friend, will then `close' the trap.
++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,
++{
++ (set) 2>&1 |
++ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
++ *ac_space=\ *)
++ sed -n \
++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++ ;;
++ *)
++ sed -n \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++}
++ echo
+
++ cat <<\_ASBOX
++## ----------------- ##
++## Output variables. ##
++## ----------------- ##
++_ASBOX
++ echo
++ for ac_var in $ac_subst_vars
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++
++ if test -n "$ac_subst_files"; then
++ cat <<\_ASBOX
++## ------------- ##
++## Output files. ##
++## ------------- ##
++_ASBOX
++ echo
++ for ac_var in $ac_subst_files
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++ fi
+
+-if test "$prefix" = "NONE"; then
+- prefix="/usr"
+-fi
+-
+-# Extract the first word of "gcc", so it can be a program name with args.
+-set dummy gcc; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:665: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- if test -n "$CC"; then
+- ac_cv_prog_CC="$CC" # Let the user override the test.
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_CC="gcc"
+- break
++ if test -s confdefs.h; then
++ cat <<\_ASBOX
++## ----------- ##
++## confdefs.h. ##
++## ----------- ##
++_ASBOX
++ echo
++ sed "/^$/d" confdefs.h | sort
++ echo
+ fi
+- done
+- IFS="$ac_save_ifs"
+-fi
+-fi
+-CC="$ac_cv_prog_CC"
+-if test -n "$CC"; then
+- echo "$ac_t""$CC" 1>&6
+-else
+- echo "$ac_t""no" 1>&6
+-fi
++ test "$ac_signal" != 0 &&
++ echo "$as_me: caught signal $ac_signal"
++ echo "$as_me: exit $exit_status"
++ } >&5
++ rm -f core *.core &&
++ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
++ exit $exit_status
++ ' 0
++for ac_signal in 1 2 13 15; do
++ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
++done
++ac_signal=0
+
+-if test -z "$CC"; then
+- # Extract the first word of "cc", so it can be a program name with args.
+-set dummy cc; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:695: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- if test -n "$CC"; then
+- ac_cv_prog_CC="$CC" # Let the user override the test.
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_prog_rejected=no
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+- ac_prog_rejected=yes
+- continue
+- fi
+- ac_cv_prog_CC="cc"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+-if test $ac_prog_rejected = yes; then
+- # We found a bogon in the path, so make sure we never use it.
+- set dummy $ac_cv_prog_CC
+- shift
+- if test $# -gt 0; then
+- # We chose a different compiler from the bogus one.
+- # However, it has the same basename, so the bogon will be chosen
+- # first if we set CC to just the basename; use the full file name.
+- shift
+- set dummy "$ac_dir/$ac_word" "$@"
+- shift
+- ac_cv_prog_CC="$@"
++# confdefs.h avoids OS command line length limits that DEFS can exceed.
++rm -rf conftest* confdefs.h
++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
++echo >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
++
++
++# Let the site file select an alternate cache file if it wants to.
++# Prefer explicitly selected file to automatically selected ones.
++if test -z "$CONFIG_SITE"; then
++ if test "x$prefix" != xNONE; then
++ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++ else
++ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+ fi
+-fi
+-fi
+-CC="$ac_cv_prog_CC"
+-if test -n "$CC"; then
+- echo "$ac_t""$CC" 1>&6
+-else
+- echo "$ac_t""no" 1>&6
+-fi
++for ac_site_file in $CONFIG_SITE; do
++ if test -r "$ac_site_file"; then
++ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
++echo "$as_me: loading site script $ac_site_file" >&6;}
++ sed 's/^/| /' "$ac_site_file" >&5
++ . "$ac_site_file"
++ fi
++done
+
+- if test -z "$CC"; then
+- case "`uname -s`" in
+- *win32* | *WIN32*)
+- # Extract the first word of "cl", so it can be a program name with args.
+-set dummy cl; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:746: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- if test -n "$CC"; then
+- ac_cv_prog_CC="$CC" # Let the user override the test.
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_CC="cl"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+-fi
+-fi
+-CC="$ac_cv_prog_CC"
+-if test -n "$CC"; then
+- echo "$ac_t""$CC" 1>&6
++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
++ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
++echo "$as_me: loading cache $cache_file" >&6;}
++ case $cache_file in
++ [\\/]* | ?:[\\/]* ) . $cache_file;;
++ *) . ./$cache_file;;
++ esac
++ fi
+ else
+- echo "$ac_t""no" 1>&6
+-fi
+- ;;
++ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
++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 `(set) 2>&1 |
++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
++echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
++ ac_cache_corrupted=: ;;
++ ,set)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
++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
++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
++echo "$as_me: former value: $ac_old_val" >&2;}
++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
++echo "$as_me: current value: $ac_new_val" >&2;}
++ ac_cache_corrupted=:
++ fi;;
++ esac
++ # Pass precious variables to config.status.
++ if test "$ac_new_set" = set; then
++ case $ac_new_val in
++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
++ ac_arg=$ac_var=`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.
++ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
++done
++if $ac_cache_corrupted; then
++ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
++echo "$as_me: error: changes in the environment can compromise the build" >&2;}
++ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
++echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+
+-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:778: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+-
+ ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
++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 > conftest.$ac_ext << EOF
+
+-#line 789 "configure"
+-#include "confdefs.h"
+
+-main(){return(0);}
+-EOF
+-if { (eval echo configure:794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- ac_cv_prog_cc_works=yes
+- # If we can't run a trivial program, we are probably using a cross compiler.
+- if (./conftest; exit) 2>/dev/null; then
+- ac_cv_prog_cc_cross=no
+- else
+- ac_cv_prog_cc_cross=yes
+- fi
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- ac_cv_prog_cc_works=no
+-fi
+-rm -fr conftest*
+-ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
+-
+-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+-if test $ac_cv_prog_cc_works = no; then
+- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+-fi
+-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:820: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+-cross_compiling=$ac_cv_prog_cc_cross
+-
+-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:825: checking whether we are using GNU C" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.c <<EOF
+-#ifdef __GNUC__
+- yes;
+-#endif
+-EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+- ac_cv_prog_gcc=yes
+-else
+- ac_cv_prog_gcc=no
+-fi
+-fi
+
+-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+-if test $ac_cv_prog_gcc = yes; then
+- GCC=yes
+-else
+- GCC=
+-fi
+
+-ac_test_CFLAGS="${CFLAGS+set}"
+-ac_save_CFLAGS="$CFLAGS"
+-CFLAGS=
+-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:853: checking whether ${CC-cc} accepts -g" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- echo 'void f(){}' > conftest.c
+-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+- ac_cv_prog_cc_g=yes
+-else
+- ac_cv_prog_cc_g=no
+-fi
+-rm -f conftest*
+
+-fi
+
+-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+-if test "$ac_test_CFLAGS" = set; then
+- CFLAGS="$ac_save_CFLAGS"
+-elif test $ac_cv_prog_cc_g = yes; then
+- if test "$GCC" = yes; then
+- CFLAGS="-g -O2"
+- else
+- CFLAGS="-g"
+- fi
+-else
+- if test "$GCC" = yes; then
+- CFLAGS="-O2"
+- else
+- CFLAGS=
+- fi
+-fi
+
+
+-echo $ac_n "checking for working const""... $ac_c" 1>&6
+-echo "configure:886: checking for working const" >&5
+-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 891 "configure"
+-#include "confdefs.h"
+
+-int main() {
+
+-/* Ultrix mips cc rejects this. */
+-typedef int charset[2]; const charset x;
+-/* SunOS 4.1.1 cc rejects this. */
+-char const *const *ccp;
+-char **p;
+-/* NEC SVR4.0.2 mips cc rejects this. */
+-struct point {int x, y;};
+-static struct point const zero = {0,0};
+-/* AIX XL C 1.02.0.0 rejects this.
+- It does not let you subtract one const X* pointer from another in an arm
+- of an if-expression whose if-part is not a constant expression */
+-const char *g = "string";
+-ccp = &g + (g ? g-g : 0);
+-/* HPUX 7.0 cc rejects these. */
+-++ccp;
+-p = (char**) ccp;
+-ccp = (char const *const *) p;
+-{ /* SCO 3.2v4 cc rejects this. */
+- char *t;
+- char const *s = 0 ? (char *) 0 : (char const *) 0;
+-
+- *t++ = 0;
+-}
+-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+- int x[] = {25, 17};
+- const int *foo = &x[0];
+- ++foo;
+-}
+-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+- typedef const int *iptr;
+- iptr p = 0;
+- ++p;
+-}
+-{ /* AIX XL C 1.02.0.0 rejects this saying
+- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+- struct s { int j; const int *ap[3]; };
+- struct s *b; b->j = 5;
+-}
+-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+- const int foo = 10;
+-}
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- rm -rf conftest*
+- ac_cv_c_const=yes
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- ac_cv_c_const=no
+-fi
+-rm -f conftest*
+-fi
+
+-echo "$ac_t""$ac_cv_c_const" 1>&6
+-if test $ac_cv_c_const = no; then
+- cat >> confdefs.h <<\EOF
+-#define const
+-EOF
+
+-fi
+
+
+
+-if test $ac_cv_prog_gcc = yes; then
+- CCOPTS='-O2 -funroll-loops -fomit-frame-pointer -Wall'
+- CFLAGS="$CCOPTS"
+-fi
+
+-# Check whether --with-pf_packet or --without-pf_packet was given.
+-if test "${with_pf_packet+set}" = set; then
+- withval="$with_pf_packet"
+- \
+- with_pf_packet=yes
+-else
+- with_pf_packet=no
+-fi
+
++ac_aux_dir=
++for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
++ if test -f $ac_dir/install-sh; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/install-sh -c"
++ break
++ elif test -f $ac_dir/install.sh; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/install.sh -c"
++ break
++ elif test -f $ac_dir/shtool; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/shtool install -c"
++ break
++ fi
++done
++if test -z "$ac_aux_dir"; then
++ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
++echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++ac_config_guess="$SHELL $ac_aux_dir/config.guess"
++ac_config_sub="$SHELL $ac_aux_dir/config.sub"
++ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+-# Check whether --with-fast_x86_check or --without-fast_x86_check was given.
+-if test "${with_fast_x86_check+set}" = set; then
+- withval="$with_fast_x86_check"
+- \
+- cat >> confdefs.h <<\EOF
+-#define LIBNET_FAST_X86_CHECK 1
+-EOF
++# Make sure we can run config.sub.
++$ac_config_sub sun4 >/dev/null 2>&1 ||
++ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
++echo "$as_me: error: cannot run $ac_config_sub" >&2;}
++ { (exit 1); exit 1; }; }
++
++echo "$as_me:$LINENO: checking build system type" >&5
++echo $ECHO_N "checking build system type... $ECHO_C" >&6
++if test "${ac_cv_build+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_build_alias=$build_alias
++test -z "$ac_cv_build_alias" &&
++ ac_cv_build_alias=`$ac_config_guess`
++test -z "$ac_cv_build_alias" &&
++ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
++echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
++ { (exit 1); exit 1; }; }
++ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_build" >&5
++echo "${ECHO_T}$ac_cv_build" >&6
++build=$ac_cv_build
++build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++echo "$as_me:$LINENO: checking host system type" >&5
++echo $ECHO_N "checking host system type... $ECHO_C" >&6
++if test "${ac_cv_host+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_host_alias=$host_alias
++test -z "$ac_cv_host_alias" &&
++ ac_cv_host_alias=$ac_cv_build_alias
++ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_host" >&5
++echo "${ECHO_T}$ac_cv_host" >&6
++host=$ac_cv_host
++host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++echo "$as_me:$LINENO: checking target system type" >&5
++echo $ECHO_N "checking target system type... $ECHO_C" >&6
++if test "${ac_cv_target+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_target_alias=$target_alias
++test "x$ac_cv_target_alias" = "x" &&
++ ac_cv_target_alias=$ac_cv_host_alias
++ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_target" >&5
++echo "${ECHO_T}$ac_cv_target" >&6
++target=$ac_cv_target
++target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+-fi
++
++# 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}-
+
+
++am__api_version="1.8"
+ # 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:
+@@ -991,330 +1590,7067 @@
+ # 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.
+-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:1000: checking for a BSD compatible install" >&5
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+ if test -z "$INSTALL"; then
+-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+- for ac_dir in $PATH; do
+- # Account for people who put trailing slashes in PATH elements.
+- case "$ac_dir/" in
+- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+- *)
+- # OSF1 and SCO ODT 3.0 have their own names for install.
+- # Don't use installbsd from OSF since it installs stuff as root
+- # by default.
+- for ac_prog in ginstall scoinst install; do
+- if test -f $ac_dir/$ac_prog; then
++ 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 $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
++ 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
+- ac_cv_path_install="$ac_dir/$ac_prog -c"
+- break 2
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
+ fi
+ fi
+ done
+- ;;
+- esac
+- done
+- IFS="$ac_save_IFS"
++ done
++ ;;
++esac
++done
++
+
+ fi
+ if test "${ac_cv_path_install+set}" = set; then
+- INSTALL="$ac_cv_path_install"
++ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+- INSTALL="$ac_install_sh"
++ INSTALL=$ac_install_sh
+ fi
+ fi
+-echo "$ac_t""$INSTALL" 1>&6
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$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_PROGRAM}'
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+-echo "configure:1053: checking whether ${MAKE-make} sets \${MAKE}" >&5
+-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftestmake <<\EOF
+-all:
+- @echo 'ac_maketemp="${MAKE}"'
+-EOF
+-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+-if test -n "$ac_maketemp"; then
+- eval ac_cv_prog_make_${ac_make}_set=yes
+-else
+- eval ac_cv_prog_make_${ac_make}_set=no
+-fi
+-rm -f conftestmake
+-fi
+-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- SET_MAKE=
+-else
+- echo "$ac_t""no" 1>&6
+- SET_MAKE="MAKE=${MAKE-make}"
++echo "$as_me:$LINENO: checking whether build environment is sane" >&5
++echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
++# Just in case
++sleep 1
++echo timestamp > conftest.file
++# 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".
++ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&5
++echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++
++ test "$2" = conftest.file
++ )
++then
++ # Ok.
++ :
++else
++ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
++Check your system clock" >&5
++echo "$as_me: error: newly created file is older than distributed files!
++Check your system clock" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}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 $. echo might interpret backslashes.
++# By default was `s,x,x', remove it if useless.
++cat <<\_ACEOF >conftest.sed
++s/[\\$]/&&/g;s/;s,x,x,$//
++_ACEOF
++program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
++rm conftest.sed
++
++# expand $ac_aux_dir to an absolute path
++am_aux_dir=`cd $ac_aux_dir && pwd`
++
++test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
++# Use eval to expand $SHELL
++if eval "$MISSING --run true"; then
++ am_missing_run="$MISSING --run "
++else
++ am_missing_run=
++ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
++echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
++fi
++
++if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++ # Keeping the `.' argument allows $(mkdir_p) to be used without
++ # argument. Indeed, we sometimes output rules like
++ # $(mkdir_p) $(somedir)
++ # where $(somedir) is conditionally defined.
++ # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more
++ # expensive solution, as it forces Make to start a sub-shell.)
++ mkdir_p='mkdir -p -- .'
++else
++ # On NextStep and OpenStep, the `mkdir' command does not
++ # recognize any option. It will interpret all options as
++ # directories to create, and then abort because `.' already
++ # exists.
++ for d in ./-p ./--version;
++ do
++ test -d $d && rmdir $d
++ done
++ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
++ if test -f "$ac_aux_dir/mkinstalldirs"; then
++ mkdir_p='$(mkinstalldirs)'
++ else
++ mkdir_p='$(install_sh) -d'
++ fi
+ fi
+
+-for ac_prog in ranlib
++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.
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1084: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_AWK+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- if test -n "$RANLIB"; then
+- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
++ if test -n "$AWK"; then
++ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_RANLIB="$ac_prog"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_AWK="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-RANLIB="$ac_cv_prog_RANLIB"
+-if test -n "$RANLIB"; then
+- echo "$ac_t""$RANLIB" 1>&6
++AWK=$ac_cv_prog_AWK
++if test -n "$AWK"; then
++ echo "$as_me:$LINENO: result: $AWK" >&5
++echo "${ECHO_T}$AWK" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+-test -n "$RANLIB" && break
++ test -n "$AWK" && break
+ done
+-test -n "$RANLIB" || RANLIB="@true"
+
+-for ac_prog in ar
+-do
+-# Extract the first word of "$ac_prog", so it can be a program name with args.
+-set dummy $ac_prog; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1119: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
++if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- if test -n "$AR"; then
+- ac_cv_prog_AR="$AR" # Let the user override the test.
++ cat >conftest.make <<\_ACEOF
++all:
++ @echo 'ac_maketemp="$(MAKE)"'
++_ACEOF
++# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
++eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
++if test -n "$ac_maketemp"; then
++ eval ac_cv_prog_make_${ac_make}_set=yes
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_AR="$ac_prog"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++ eval ac_cv_prog_make_${ac_make}_set=no
+ fi
++rm -f conftest.make
+ fi
+-AR="$ac_cv_prog_AR"
+-if test -n "$AR"; then
+- echo "$ac_t""$AR" 1>&6
++if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++ SET_MAKE=
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++ SET_MAKE="MAKE=${MAKE-make}"
+ fi
+
+-test -n "$AR" && break
+-done
+-test -n "$AR" || AR="@true"
++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
++
++# test to see if srcdir already configured
++if test "`cd $srcdir && pwd`" != "`pwd`" &&
++ test -f $srcdir/config.status; then
++ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
++echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
++ { (exit 1); exit 1; }; }
++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=libnet
++ VERSION=1.0.2a
++
++
++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"}
++
++
++AMTAR=${AMTAR-"${am_missing_run}tar"}
++
++install_sh=${install_sh-"$am_aux_dir/install-sh"}
++
++# 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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++STRIP=$ac_cv_prog_STRIP
++if test -n "$STRIP"; then
++ echo "$as_me:$LINENO: result: $STRIP" >&5
++echo "${ECHO_T}$STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_STRIP="strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
++fi
++fi
++ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
++if test -n "$ac_ct_STRIP"; then
++ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++echo "${ECHO_T}$ac_ct_STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ STRIP=$ac_ct_STRIP
++else
++ STRIP="$ac_cv_prog_STRIP"
++fi
++
++fi
++INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
++
++# We need awk for the "check" target. The system "awk" is bad on
++# some platforms.
++
++
++
++
++VER=`cat VERSION`
++echo "$as_me:$LINENO: result: Beginning autoconfiguration process for libnet-$VER..." >&5
++echo "${ECHO_T}Beginning autoconfiguration process for libnet-$VER..." >&6
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++if test "$prefix" = "NONE"; then
++ prefix="/usr"
++fi
++
++if test "$mandir" = "NONE"; then
++ mandir="$prefix/man"
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="${ac_tool_prefix}gcc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="gcc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ CC=$ac_ct_CC
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="${ac_tool_prefix}cc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_CC"; then
++ ac_ct_CC=$CC
++ # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="cc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ CC=$ac_ct_CC
++else
++ CC="$ac_cv_prog_CC"
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++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
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$CC"; then
++ if test -n "$ac_tool_prefix"; then
++ for ac_prog in cl
++ 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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$CC" && break
++ done
++fi
++if test -z "$CC"; then
++ ac_ct_CC=$CC
++ for ac_prog in cl
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$ac_ct_CC" && break
++done
++
++ CC=$ac_ct_CC
++fi
++
++fi
++
++
++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&5
++echo "$as_me: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++
++# Provide some information about the compiler.
++echo "$as_me:$LINENO:" \
++ "checking for C compiler version" >&5
++ac_compiler=`set X $ac_compile; echo $2`
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
++ (eval $ac_compiler --version </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
++ (eval $ac_compiler -v </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
++ (eval $ac_compiler -V </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files a.out a.exe b.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.
++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
++ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
++if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
++ (eval $ac_link_default) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ # Find the output, starting from the most likely. This scheme is
++# not robust to junk in `.', hence go to wildcards (a.*) only as a last
++# resort.
++
++# Be careful to initialize this variable, since it used to be cached.
++# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
++ac_cv_exeext=
++# b.out is created by i960 compilers.
++for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
++do
++ test -f "$ac_file" || continue
++ case $ac_file in
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
++ ;;
++ conftest.$ac_ext )
++ # This is the source file.
++ ;;
++ [ab].out )
++ # We found the default executable, but exeext='' is most
++ # certainly right.
++ break;;
++ *.* )
++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ # FIXME: I believe we export ac_cv_exeext for Libtool,
++ # but it would be cool to find out if it's true. Does anybody
++ # maintain Libtool? --akim.
++ export ac_cv_exeext
++ break;;
++ * )
++ break;;
++ esac
++done
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
++See \`config.log' for more details." >&5
++echo "$as_me: error: C compiler cannot create executables
++See \`config.log' for more details." >&2;}
++ { (exit 77); exit 77; }; }
++fi
++
++ac_exeext=$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_file" >&5
++echo "${ECHO_T}$ac_file" >&6
++
++# Check the compiler produces executables we can run. If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether the C compiler works" >&5
++echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
++# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
++# If not cross compiling, check that we can run a simple program.
++if test "$cross_compiling" != yes; then
++ if { ac_try='./$ac_file'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ cross_compiling=no
++ else
++ if test "$cross_compiling" = maybe; then
++ cross_compiling=yes
++ else
++ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++ fi
++fi
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++
++rm -f a.out a.exe conftest$ac_cv_exeext b.out
++ac_clean_files=$ac_clean_files_save
++# Check the compiler produces executables we can run. If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
++echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
++echo "$as_me:$LINENO: result: $cross_compiling" >&5
++echo "${ECHO_T}$cross_compiling" >&6
++
++echo "$as_me:$LINENO: checking for suffix of executables" >&5
++echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; 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 | *.o | *.obj ) ;;
++ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ export ac_cv_exeext
++ break;;
++ * ) break;;
++ esac
++done
++else
++ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++rm -f conftest$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
++echo "${ECHO_T}$ac_cv_exeext" >&6
++
++rm -f conftest.$ac_ext
++EXEEXT=$ac_cv_exeext
++ac_exeext=$EXEEXT
++echo "$as_me:$LINENO: checking for suffix of object files" >&5
++echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
++if test "${ac_cv_objext+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.o conftest.obj
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
++ case $ac_file in
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
++ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
++ break;;
++ esac
++done
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++rm -f conftest.$ac_cv_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
++echo "${ECHO_T}$ac_cv_objext" >&6
++OBJEXT=$ac_cv_objext
++ac_objext=$OBJEXT
++echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
++echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
++if test "${ac_cv_c_compiler_gnu+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++#ifndef __GNUC__
++ choke me
++#endif
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_compiler_gnu=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_compiler_gnu=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ac_cv_c_compiler_gnu=$ac_compiler_gnu
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
++GCC=`test $ac_compiler_gnu = yes && echo yes`
++ac_test_CFLAGS=${CFLAGS+set}
++ac_save_CFLAGS=$CFLAGS
++CFLAGS="-g"
++echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_g+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_prog_cc_g=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_prog_cc_g=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
++echo "${ECHO_T}$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
++echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
++echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_stdc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_prog_cc_stdc=no
++ac_save_CC=$CC
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 -std1 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 -std1. */
++int osf4_cc_array ['\x00' == 0 ? 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
++# Don't try gcc -ansi; that turns off useful extensions and
++# breaks some systems' header files.
++# AIX -qlanglvl=ansi
++# Ultrix and OSF/1 -std1
++# HP-UX 10.20 and later -Ae
++# HP-UX older versions -Aa -D_HPUX_SOURCE
++# SVR4 -Xc -D__EXTENSIONS__
++for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
++do
++ CC="$ac_save_CC $ac_arg"
++ rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_prog_cc_stdc=$ac_arg
++break
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext
++done
++rm -f conftest.$ac_ext conftest.$ac_objext
++CC=$ac_save_CC
++
++fi
++
++case "x$ac_cv_prog_cc_stdc" in
++ x|xno)
++ echo "$as_me:$LINENO: result: none needed" >&5
++echo "${ECHO_T}none needed" >&6 ;;
++ *)
++ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
++echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
++ CC="$CC $ac_cv_prog_cc_stdc" ;;
++esac
++
++# Some people use a C++ compiler to compile C. Since we use `exit',
++# in C++ we need to declare it. In case someone uses the same compiler
++# for both compiling C and C++ we need to have the C++ compiler decide
++# the declaration of exit, since it's the most demanding environment.
++cat >conftest.$ac_ext <<_ACEOF
++#ifndef __cplusplus
++ choke me
++#endif
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ for ac_declaration in \
++ '' \
++ 'extern "C" void std::exit (int) throw (); using std::exit;' \
++ 'extern "C" void std::exit (int); using std::exit;' \
++ 'extern "C" void exit (int) throw ();' \
++ 'extern "C" void exit (int);' \
++ 'void exit (int);'
++do
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_declaration
++#include <stdlib.h>
++int
++main ()
++{
++exit (42);
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ :
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++continue
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_declaration
++int
++main ()
++{
++exit (42);
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ break
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++done
++rm -f conftest*
++if test -n "$ac_declaration"; then
++ echo '#ifdef __cplusplus' >>confdefs.h
++ echo $ac_declaration >>confdefs.h
++ echo '#endif' >>confdefs.h
++fi
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f 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
++DEPDIR="${am__leading_dot}deps"
++
++ ac_config_commands="$ac_config_commands depfiles"
++
++
++am_make=${MAKE-make}
++cat > confinc << 'END'
++am__doit:
++ @echo done
++.PHONY: am__doit
++END
++# If we don't find an include directive, just comment out the code.
++echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
++echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
++am__include="#"
++am__quote=
++_am_result=none
++# First try GNU make style include.
++echo "include confinc" > confmf
++# We grep out `Entering directory' and `Leaving directory'
++# messages which can occur if `w' ends up in MAKEFLAGS.
++# In particular we don't look at `^make:' because GNU make might
++# be invoked under some other name (usually "gmake"), in which
++# case it prints its new name instead of `make'.
++if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
++ am__include=include
++ am__quote=
++ _am_result=GNU
++fi
++# Now try BSD make style include.
++if test "$am__include" = "#"; then
++ echo '.include "confinc"' > confmf
++ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
++ am__include=.include
++ am__quote="\""
++ _am_result=BSD
++ fi
++fi
++
++
++echo "$as_me:$LINENO: result: $_am_result" >&5
++echo "${ECHO_T}$_am_result" >&6
++rm -f confinc confmf
++
++# Check whether --enable-dependency-tracking or --disable-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=
++
++echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
++echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
++if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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
++ 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
++
++ case $depmode in
++ 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
++ ;;
++ none) break ;;
++ esac
++ # 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.
++ if depmode=$depmode \
++ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
++ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
++ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
++ >/dev/null 2>conftest.err &&
++ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
++ grep sub/conftest.${OBJEXT-o} 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
++echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
++echo "${ECHO_T}$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
++
++
++
++
++echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
++echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
++if test "${ac_cv_c_const+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++/* FIXME: Include the comments suggested by Paul. */
++#ifndef __cplusplus
++ /* Ultrix mips cc rejects this. */
++ typedef int charset[2];
++ const charset x;
++ /* SunOS 4.1.1 cc rejects this. */
++ char const *const *ccp;
++ char **p;
++ /* NEC SVR4.0.2 mips cc rejects this. */
++ struct point {int x, y;};
++ static struct point const zero = {0,0};
++ /* AIX XL C 1.02.0.0 rejects this.
++ It does not let you subtract one const X* pointer from another in
++ an arm of an if-expression whose if-part is not a constant
++ expression */
++ const char *g = "string";
++ ccp = &g + (g ? g-g : 0);
++ /* HPUX 7.0 cc rejects these. */
++ ++ccp;
++ p = (char**) ccp;
++ ccp = (char const *const *) p;
++ { /* SCO 3.2v4 cc rejects this. */
++ char *t;
++ char const *s = 0 ? (char *) 0 : (char const *) 0;
++
++ *t++ = 0;
++ }
++ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
++ int x[] = {25, 17};
++ const int *foo = &x[0];
++ ++foo;
++ }
++ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
++ typedef const int *iptr;
++ iptr p = 0;
++ ++p;
++ }
++ { /* AIX XL C 1.02.0.0 rejects this saying
++ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
++ struct s { int j; const int *ap[3]; };
++ struct s *b; b->j = 5;
++ }
++ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
++ const int foo = 10;
++ }
++#endif
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_c_const=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_c_const=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
++echo "${ECHO_T}$ac_cv_c_const" >&6
++if test $ac_cv_c_const = no; then
++
++cat >>confdefs.h <<\_ACEOF
++#define const
++_ACEOF
++
++fi
++
++
++
++if test $ac_cv_c_compiler_gnu = yes; then
++ CCOPTS='-O2 -funroll-loops -fomit-frame-pointer -Wall'
++ CFLAGS="$CCOPTS"
++fi
++
++
++# Check whether --with-pf_packet or --without-pf_packet was given.
++if test "${with_pf_packet+set}" = set; then
++ withval="$with_pf_packet"
++ \
++ with_pf_packet=yes
++else
++ with_pf_packet=no
++fi;
++
++
++# Check whether --with-fast_x86_check or --without-fast_x86_check was given.
++if test "${with_fast_x86_check+set}" = set; then
++ withval="$with_fast_x86_check"
++ \
++ cat >>confdefs.h <<\_ACEOF
++#define LIBNET_FAST_X86_CHECK 1
++_ACEOF
++
++fi;
++
++# Find a good install program. We prefer a C program (faster),
++# so one script is as good as another. But avoid the broken or
++# 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.
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++if test -z "$INSTALL"; then
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
++ done
++ done
++ ;;
++esac
++done
++
++
++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. We don't cache a
++ # path for INSTALL within a source directory, because that will
++ # break other packages using the cache if that directory is
++ # removed, or if the path is relative.
++ INSTALL=$ac_install_sh
++ fi
++fi
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$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'
++
++echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
++if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.make <<\_ACEOF
++all:
++ @echo 'ac_maketemp="$(MAKE)"'
++_ACEOF
++# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
++eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
++if test -n "$ac_maketemp"; then
++ eval ac_cv_prog_make_${ac_make}_set=yes
++else
++ eval ac_cv_prog_make_${ac_make}_set=no
++fi
++rm -f conftest.make
++fi
++if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++ SET_MAKE=
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++ SET_MAKE="MAKE=${MAKE-make}"
++fi
++
++for ac_prog in ranlib
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_RANLIB="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++RANLIB=$ac_cv_prog_RANLIB
++if test -n "$RANLIB"; then
++ echo "$as_me:$LINENO: result: $RANLIB" >&5
++echo "${ECHO_T}$RANLIB" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$RANLIB" && break
++done
++test -n "$RANLIB" || RANLIB="@true"
++
++for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_AR+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_AR="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++AR=$ac_cv_prog_AR
++if test -n "$AR"; then
++ echo "$as_me:$LINENO: result: $AR" >&5
++echo "${ECHO_T}$AR" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$AR" && break
++done
++test -n "$AR" || AR="@true"
++
++for ac_prog in ln
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_LN+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$LN"; then
++ ac_cv_prog_LN="$LN" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_LN="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++LN=$ac_cv_prog_LN
++if test -n "$LN"; then
++ echo "$as_me:$LINENO: result: $LN" >&5
++echo "${ECHO_T}$LN" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$LN" && break
++done
++test -n "$LN" || LN="@true"
++
++
++# Check whether --enable-shared or --disable-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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_shared=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac
++else
++ enable_shared=yes
++fi;
++# Check whether --enable-static or --disable-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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_static=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac
++else
++ enable_static=yes
++fi;
++# Check whether --enable-fast-install or --disable-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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_fast_install=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac
++else
++ enable_fast_install=yes
++fi;
++# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++
++
++# Check whether --with-gnu-ld or --without-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.
++ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
++echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&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.
++ [\\/]* | [A-Za-z]:[\\/]*)
++ re_direlt='/[^/][^/]*/\.\./'
++ # Canonicalize the path 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
++ echo "$as_me:$LINENO: checking for GNU ld" >&5
++echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
++else
++ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
++echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
++fi
++if test "${lt_cv_path_LD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -z "$LD"; then
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in $PATH; do
++ 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 GNU ld's only accept -v.
++ # Break only if it was the GNU/non-GNU ld that we prefer.
++ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
++ test "$with_gnu_ld" != no && break
++ else
++ test "$with_gnu_ld" != yes && break
++ fi
++ fi
++ done
++ IFS="$ac_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
++ echo "$as_me:$LINENO: result: $LD" >&5
++echo "${ECHO_T}$LD" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
++echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
++ { (exit 1); exit 1; }; }
++echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
++echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
++if test "${lt_cv_prog_gnu_ld+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
++if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
++ lt_cv_prog_gnu_ld=yes
++else
++ lt_cv_prog_gnu_ld=no
++fi
++fi
++echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
++echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
++with_gnu_ld=$lt_cv_prog_gnu_ld
++
++
++echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
++echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
++if test "${lt_cv_ld_reload_flag+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ lt_cv_ld_reload_flag='-r'
++fi
++echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
++echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
++reload_flag=$lt_cv_ld_reload_flag
++test -n "$reload_flag" && reload_flag=" $reload_flag"
++
++echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
++echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
++if test "${lt_cv_path_NM+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$NM"; then
++ # Let the user override the test.
++ lt_cv_path_NM="$NM"
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
++ test -z "$ac_dir" && ac_dir=.
++ tmp_nm=$ac_dir/${ac_tool_prefix}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
++ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -B"
++ break
++ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -p"
++ break
++ else
++ 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
++ fi
++ fi
++ done
++ IFS="$ac_save_ifs"
++ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
++fi
++fi
++
++NM="$lt_cv_path_NM"
++echo "$as_me:$LINENO: result: $NM" >&5
++echo "${ECHO_T}$NM" >&6
++
++echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
++echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
++if test "${lt_cv_path_SED+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ # 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_executable_p="test -f"
++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
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ fi
++ done
++ done
++done
++
++ # Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++: ${TMPDIR=/tmp}
++{
++ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=$TMPDIR/sed$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
++ { (exit 1); exit 1; }
++}
++ _max=0
++ _count=0
++ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
++ # along with /bin/sed that truncates output.
++ for _sed in $_sed_list /usr/xpg4/bin/sed; do
++ test ! -f ${_sed} && break
++ cat /dev/null > "$tmp/sed.in"
++ _count=0
++ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
++ # Check for GNU sed and select it if it is found.
++ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
++ lt_cv_path_SED=${_sed}
++ break
++ fi
++ while true; do
++ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
++ mv "$tmp/sed.tmp" "$tmp/sed.in"
++ cp "$tmp/sed.in" "$tmp/sed.nl"
++ echo >>"$tmp/sed.nl"
++ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
++ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
++ # 40000 chars as input seems more than enough
++ test $_count -gt 10 && break
++ _count=`expr $_count + 1`
++ if test $_count -gt $_max; then
++ _max=$_count
++ lt_cv_path_SED=$_sed
++ fi
++ done
++ done
++ rm -rf "$tmp"
++
++fi
++
++if test "X$SED" != "X"; then
++ lt_cv_path_SED=$SED
++else
++ SED=$lt_cv_path_SED
++fi
++echo "$as_me:$LINENO: result: $SED" >&5
++echo "${ECHO_T}$SED" >&6
++
++echo "$as_me:$LINENO: checking whether ln -s works" >&5
++echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
++LN_S=$as_ln_s
++if test "$LN_S" = "ln -s"; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++else
++ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
++echo "${ECHO_T}no, using $LN_S" >&6
++fi
++
++echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
++echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
++if test "${lt_cv_deplibs_check_method+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 egrep 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
++aix4* | aix5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++beos*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++bsdi4*)
++ 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* | mingw* | pw32*)
++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ lt_cv_file_magic_cmd='$OBJDUMP -f'
++ ;;
++
++darwin* | rhapsody*)
++ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
++ lt_cv_file_magic_cmd='/usr/bin/file -L'
++ case "$host_os" in
++ rhapsody* | darwin1.[012])
++ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
++ ;;
++ *) # Darwin 1.3 on
++ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
++ ;;
++ esac
++ ;;
++
++freebsd*)
++ 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)/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
++ ;;
++
++hpux10.20*|hpux11*)
++ 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_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=/usr/lib/libc.sl
++ ;;
++
++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-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]+$'
++ else
++ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
++ 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
++ ;;
++
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
++osf3* | osf4* | osf5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sco3.2v5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++solaris*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv5uw[78]* | sysv4*uw2*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ 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
++ ;;
++ esac
++ ;;
++esac
++
++fi
++echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
++echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
++file_magic_cmd=$lt_cv_file_magic_cmd
++deplibs_check_method=$lt_cv_deplibs_check_method
++
++
++
++
++
++
++
++# Check for command to grab the raw symbol name followed by C symbol from nm.
++echo "$as_me:$LINENO: checking command to parse $NM output" >&5
++echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6
++if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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]*\)'
++
++# Transform the above into a raw symbol and a C symbol.
++symxfrm='\1 \2\3 \3'
++
++# Transform an extracted symbol line into a proper C declaration
++lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
++
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
++# Define system-specific variables.
++case $host_os in
++aix*)
++ symcode='[BCDT]'
++ ;;
++cygwin* | mingw* | pw32*)
++ symcode='[ABCDGISTW]'
++ ;;
++hpux*) # Its linker distinguishes data from code symbols
++ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++ ;;
++irix* | nonstopux*)
++ symcode='[BCDEGRST]'
++ ;;
++osf*)
++ symcode='[BCDEGQRST]'
++ ;;
++solaris* | sysv5*)
++ symcode='[BDT]'
++ ;;
++sysv4)
++ symcode='[DFNSTU]'
++ ;;
++esac
++
++# Handle CRLF in mingw tool chain
++opt_cr=
++case $host_os in
++mingw*)
++ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
++ ;;
++esac
++
++# If we're using GNU nm, then use its standard symbol codes.
++if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
++ symcode='[ABCDGISTW]'
++fi
++
++# Try without a prefix undercore, then with it.
++for ac_symprfx in "" "_"; do
++
++ # Write the raw and C identifiers.
++lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
++
++ # Check to see that the pipe works correctly.
++ pipe_works=no
++ rm -f conftest*
++ cat > conftest.$ac_ext <<EOF
++#ifdef __cplusplus
++extern "C" {
++#endif
++char nm_test_var;
++void nm_test_func(){}
++#ifdef __cplusplus
++}
++#endif
++int main(){nm_test_var='a';nm_test_func();return(0);}
++EOF
++
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ # Now try to grab the symbols.
++ nlist=conftest.nm
++ if { (eval echo "$as_me:$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=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && 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 egrep ' nm_test_var$' "$nlist" >/dev/null; then
++ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
++ cat <<EOF > conftest.$ac_ext
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++EOF
++ # Now generate the symbol file.
++ eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
++
++ cat <<EOF >> conftest.$ac_ext
++#if defined (__STDC__) && __STDC__
++# define lt_ptr void *
++#else
++# define lt_ptr char *
++# define const
++#endif
++
++/* The mapping between symbol names and symbols. */
++const struct {
++ const char *name;
++ lt_ptr address;
++}
++lt_preloaded_symbols[] =
++{
++EOF
++ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
++ cat <<\EOF >> conftest.$ac_ext
++ {0, (lt_ptr) 0}
++};
++
++#ifdef __cplusplus
++}
++#endif
++EOF
++ # Now try linking the two files.
++ mv conftest.$ac_objext conftstm.$ac_objext
++ save_LIBS="$LIBS"
++ save_CFLAGS="$CFLAGS"
++ LIBS="conftstm.$ac_objext"
++ CFLAGS="$CFLAGS$no_builtin_flag"
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest$ac_exeext; then
++ pipe_works=yes
++ fi
++ LIBS="$save_LIBS"
++ CFLAGS="$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 -f 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
++
++global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
++if test -z "$lt_cv_sys_global_symbol_pipe"; then
++ global_symbol_to_cdecl=
++ global_symbol_to_c_name_address=
++else
++ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
++ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
++fi
++if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
++then
++ echo "$as_me:$LINENO: result: failed" >&5
++echo "${ECHO_T}failed" >&6
++else
++ echo "$as_me:$LINENO: result: ok" >&5
++echo "${ECHO_T}ok" >&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
++echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
++echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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
++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++ Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ :
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # Broken: fails on valid input.
++continue
++fi
++rm -f conftest.err conftest.$ac_ext
++
++ # OK, works on sane cases. Now check whether non-existent headers
++ # can be detected and how.
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ # Broken: success on invalid input.
++continue
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # 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
++echo "$as_me:$LINENO: result: $CPP" >&5
++echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++ Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ :
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # Broken: fails on valid input.
++continue
++fi
++rm -f conftest.err conftest.$ac_ext
++
++ # OK, works on sane cases. Now check whether non-existent headers
++ # can be detected and how.
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ # Broken: success on invalid input.
++continue
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # 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
++ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&5
++echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++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
++
++
++echo "$as_me:$LINENO: checking for egrep" >&5
++echo $ECHO_N "checking for egrep... $ECHO_C" >&6
++if test "${ac_cv_prog_egrep+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
++ then ac_cv_prog_egrep='grep -E'
++ else ac_cv_prog_egrep='egrep'
++ fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
++echo "${ECHO_T}$ac_cv_prog_egrep" >&6
++ EGREP=$ac_cv_prog_egrep
++
++
++echo "$as_me:$LINENO: checking for ANSI C header files" >&5
++echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
++if test "${ac_cv_header_stdc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <stdlib.h>
++#include <stdarg.h>
++#include <string.h>
++#include <float.h>
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_header_stdc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_header_stdc=no
++fi
++rm -f 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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <ctype.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))
++ exit(2);
++ exit (0);
++}
++_ACEOF
++rm -f conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ :
++else
++ echo "$as_me: program exited with status $ac_status" >&5
++echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++( exit $ac_status )
++ac_cv_header_stdc=no
++fi
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++fi
++fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
++echo "${ECHO_T}$ac_cv_header_stdc" >&6
++if test $ac_cv_header_stdc = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define STDC_HEADERS 1
++_ACEOF
++
++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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ eval "$as_ac_Header=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "$as_ac_Header=no"
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++
++done
++
++
++
++for ac_header in dlfcn.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <$ac_header>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ eval "$as_ac_Header=\$ac_header_preproc"
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++
++fi
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++
++done
++
++
++
++
++
++
++# Only perform the check for file, if the check method requires it
++case $deplibs_check_method in
++file_magic*)
++ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
++ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
++echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ case $MAGIC_CMD in
++ /*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++ ;;
++ ?:/*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="/usr/bin:$PATH"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_save_MAGIC_CMD"
++ ;;
++esac
++fi
++
++MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++if test -n "$MAGIC_CMD"; then
++ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++echo "${ECHO_T}$MAGIC_CMD" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++if test -z "$lt_cv_path_MAGIC_CMD"; then
++ if test -n "$ac_tool_prefix"; then
++ echo "$as_me:$LINENO: checking for file" >&5
++echo $ECHO_N "checking for file... $ECHO_C" >&6
++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ case $MAGIC_CMD in
++ /*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++ ;;
++ ?:/*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="/usr/bin:$PATH"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_save_MAGIC_CMD"
++ ;;
++esac
++fi
++
++MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++if test -n "$MAGIC_CMD"; then
++ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++echo "${ECHO_T}$MAGIC_CMD" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ else
++ MAGIC_CMD=:
++ fi
++fi
++
++ fi
++ ;;
++esac
++
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++RANLIB=$ac_cv_prog_RANLIB
++if test -n "$RANLIB"; then
++ echo "$as_me:$LINENO: result: $RANLIB" >&5
++echo "${ECHO_T}$RANLIB" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_RANLIB="ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
++fi
++fi
++ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
++if test -n "$ac_ct_RANLIB"; then
++ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
++echo "${ECHO_T}$ac_ct_RANLIB" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ RANLIB=$ac_ct_RANLIB
++else
++ RANLIB="$ac_cv_prog_RANLIB"
++fi
++
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++STRIP=$ac_cv_prog_STRIP
++if test -n "$STRIP"; then
++ echo "$as_me:$LINENO: result: $STRIP" >&5
++echo "${ECHO_T}$STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_STRIP="strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
++fi
++fi
++ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
++if test -n "$ac_ct_STRIP"; then
++ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++echo "${ECHO_T}$ac_ct_STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ STRIP=$ac_ct_STRIP
++else
++ STRIP="$ac_cv_prog_STRIP"
++fi
++
++
++enable_dlopen=no
++enable_win32_dll=no
++
++# Check whether --enable-libtool-lock or --disable-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
++*-*-irix6*)
++ # Find out which ABI we are using.
++ echo '#line 5125 "configure"' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ 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
++ rm -rf conftest*
++ ;;
++
++*-*-sco3.2v5*)
++ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
++ SAVE_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -belf"
++ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
++echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
++if test "${lt_cv_cc_needs_belf+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ lt_cv_cc_needs_belf=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++lt_cv_cc_needs_belf=no
++fi
++rm -f 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
++echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
++echo "${ECHO_T}$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
++ ;;
++
++
++esac
++
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed='sed -e s/^X//'
++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'
++
++# Constants:
++rm="rm -f"
++
++# Global variables:
++default_ofile=libtool
++can_build_shared=yes
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++ltmain="$ac_aux_dir/ltmain.sh"
++ofile="$default_ofile"
++with_gnu_ld="$lt_cv_prog_gnu_ld"
++need_locks="$enable_libtool_lock"
++
++old_CC="$CC"
++old_CFLAGS="$CFLAGS"
++
++# Set sane defaults for various variables
++test -z "$AR" && AR=ar
++test -z "$AR_FLAGS" && AR_FLAGS=cru
++test -z "$AS" && AS=as
++test -z "$CC" && CC=cc
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++test -z "$LD" && LD=ld
++test -z "$LN_S" && LN_S="ln -s"
++test -z "$MAGIC_CMD" && MAGIC_CMD=file
++test -z "$NM" && NM=nm
++test -z "$OBJDUMP" && OBJDUMP=objdump
++test -z "$RANLIB" && RANLIB=:
++test -z "$STRIP" && STRIP=:
++test -z "$ac_objext" && ac_objext=o
++
++if test x"$host" != x"$build"; then
++ ac_tool_prefix=${host_alias}-
++else
++ ac_tool_prefix=
++fi
++
++# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
++case $host_os in
++linux-gnu*) ;;
++linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
++esac
++
++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
++
++# Determine commands to create old-style static archives.
++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
++old_postinstall_cmds='chmod 644 $oldlib'
++old_postuninstall_cmds=
++
++if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++fi
++
++# Allow CC to be a program name with arguments.
++set dummy $CC
++compiler="$2"
++
++echo "$as_me:$LINENO: checking for objdir" >&5
++echo $ECHO_N "checking for objdir... $ECHO_C" >&6
++rm -f .libs 2>/dev/null
++mkdir .libs 2>/dev/null
++if test -d .libs; then
++ objdir=.libs
++else
++ # MS-DOS does not allow filenames that begin with a dot.
++ objdir=_libs
++fi
++rmdir .libs 2>/dev/null
++echo "$as_me:$LINENO: result: $objdir" >&5
++echo "${ECHO_T}$objdir" >&6
++
++
++
++# Check whether --with-pic or --without-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
++
++# We assume here that the value for lt_cv_prog_cc_pic will not be cached
++# in isolation, and that seeing it set (from the cache) indicates that
++# the associated values are set (in the cache) correctly too.
++echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
++echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
++if test "${lt_cv_prog_cc_pic+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_shlib=
++ lt_cv_prog_cc_wl=
++ lt_cv_prog_cc_static=
++ lt_cv_prog_cc_no_builtin=
++ lt_cv_prog_cc_can_build_shared=$can_build_shared
++
++ if test "$GCC" = yes; then
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-static'
++
++ case $host_os in
++ aix*)
++ # Below there is a dirty hack to force normal static linking with -ldl
++ # The problem is because libdl dynamically linked with both libc and
++ # libC (AIX C++ library), which obviously doesn't included in libraries
++ # list by gcc. This cause undefined symbols with -static flags.
++ # This hack allows C programs to be linked with "-static -ldl", but
++ # not sure about C++ programs.
++ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
++ ;;
++ amigaos*)
++ # 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
++ ;;
++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++ # PIC is the default for these OSes.
++ ;;
++ darwin* | rhapsody*)
++ # PIC is the default on this platform
++ # Common symbols not allowed in MH_DYLIB files
++ lt_cv_prog_cc_pic='-fno-common'
++ ;;
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ lt_cv_prog_cc_pic=-Kconform_pic
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic='-fPIC'
++ ;;
++ esac
++ else
++ # PORTME Check for PIC flags for the system compiler.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ lt_cv_prog_cc_wl='-Wl,'
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ lt_cv_prog_cc_static='-Bstatic'
++ else
++ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ fi
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
++ lt_cv_prog_cc_pic='+Z'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ # PIC (with -KPIC) is the default.
++ ;;
++
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++
++ newsos6)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ osf3* | osf4* | osf5*)
++ # All OSF/1 code is PIC.
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ ;;
++
++ sco3.2v5*)
++ lt_cv_prog_cc_pic='-Kpic'
++ lt_cv_prog_cc_static='-dn'
++ lt_cv_prog_cc_shlib='-belf'
++ ;;
++
++ solaris*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ sunos4*)
++ lt_cv_prog_cc_pic='-PIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Qoption ld '
++ ;;
++
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ uts4*)
++ lt_cv_prog_cc_pic='-pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ sysv4*MP*)
++ if test -d /usr/nec ;then
++ lt_cv_prog_cc_pic='-Kconform_pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ fi
++ ;;
++
++ *)
++ lt_cv_prog_cc_can_build_shared=no
++ ;;
++ esac
++ fi
++
++fi
++
++if test -z "$lt_cv_prog_cc_pic"; then
++ echo "$as_me:$LINENO: result: none" >&5
++echo "${ECHO_T}none" >&6
++else
++ echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6
++
++ # Check to make sure the pic_flag actually works.
++ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
++echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6
++ if test "${lt_cv_prog_cc_pic_works+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ case $host_os in
++ hpux9* | hpux10* | hpux11*)
++ # On HP-UX, both CC and GCC only warn that PIC is supported... then
++ # they create non-PIC objects. So, if there were any warnings, we
++ # assume that PIC is not supported.
++ if test -s conftest.err; then
++ lt_cv_prog_cc_pic_works=no
++ else
++ lt_cv_prog_cc_pic_works=yes
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic_works=yes
++ ;;
++ esac
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ lt_cv_prog_cc_pic_works=no
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++
++fi
++
++
++ if test "X$lt_cv_prog_cc_pic_works" = Xno; then
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_can_build_shared=no
++ else
++ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
++ fi
++
++ echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6
++fi
++
++# Check for any special shared library compilation flags.
++if test -n "$lt_cv_prog_cc_shlib"; then
++ { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5
++echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;}
++ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then :
++ else
++ { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
++echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
++ lt_cv_prog_cc_can_build_shared=no
++ fi
++fi
++
++echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
++echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6
++if test "${lt_cv_prog_cc_static_works+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ lt_cv_prog_cc_static_works=no
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ lt_cv_prog_cc_static_works=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$save_LDFLAGS"
++
++fi
++
++
++# Belt *and* braces to stop my trousers falling down:
++test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
++echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6
++
++pic_flag="$lt_cv_prog_cc_pic"
++special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
++wl="$lt_cv_prog_cc_wl"
++link_static_flag="$lt_cv_prog_cc_static"
++no_builtin_flag="$lt_cv_prog_cc_no_builtin"
++can_build_shared="$lt_cv_prog_cc_can_build_shared"
++
++
++# Check to see if options -o and -c are simultaneously supported by compiler
++echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
++echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
++if test "${lt_cv_compiler_c_o+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++$rm -r conftest 2>/dev/null
++mkdir conftest
++cd conftest
++echo "int some_variable = 0;" > conftest.$ac_ext
++mkdir out
++# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
++# that will create temporary files in the current directory regardless of
++# the output directory. Thus, making CWD read-only will cause this test
++# to fail, enabling locking or at least warning the user not to do parallel
++# builds.
++chmod -w .
++save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
++compiler_c_o=no
++if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
++ if test -s out/conftest.err; then
++ lt_cv_compiler_c_o=no
++ else
++ lt_cv_compiler_c_o=yes
++ fi
++else
++ # Append any errors to the config.log.
++ cat out/conftest.err 1>&5
++ lt_cv_compiler_c_o=no
++fi
++CFLAGS="$save_CFLAGS"
++chmod u+w .
++$rm conftest* out/*
++rmdir out
++cd ..
++rmdir conftest
++$rm -r conftest 2>/dev/null
++
++fi
++
++compiler_c_o=$lt_cv_compiler_c_o
++echo "$as_me:$LINENO: result: $compiler_c_o" >&5
++echo "${ECHO_T}$compiler_c_o" >&6
++
++if test x"$compiler_c_o" = x"yes"; then
++ # Check to see if we can write to a .lo
++ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5
++echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6
++ if test "${lt_cv_compiler_o_lo+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ lt_cv_compiler_o_lo=no
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -c -o conftest.lo"
++ save_objext="$ac_objext"
++ ac_objext=lo
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++int some_variable = 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ lt_cv_compiler_o_lo=no
++ else
++ lt_cv_compiler_o_lo=yes
++ fi
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ ac_objext="$save_objext"
++ CFLAGS="$save_CFLAGS"
++
++fi
++
++ compiler_o_lo=$lt_cv_compiler_o_lo
++ echo "$as_me:$LINENO: result: $compiler_o_lo" >&5
++echo "${ECHO_T}$compiler_o_lo" >&6
++else
++ compiler_o_lo=no
++fi
++
++# Check to see if we can do hard links to lock some files if needed
++hard_links="nottested"
++if test "$compiler_c_o" = no && test "$need_locks" != no; then
++ # do not overwrite the value of need_locks provided by the user
++ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
++echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
++ echo "$as_me:$LINENO: result: $hard_links" >&5
++echo "${ECHO_T}$hard_links" >&6
++ if test "$hard_links" = no; then
++ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
++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
++
++if test "$GCC" = yes; then
++ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
++ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
++echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
++ echo "int some_variable = 0;" > conftest.$ac_ext
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
++ compiler_rtti_exceptions=no
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++int some_variable = 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ compiler_rtti_exceptions=no
++ else
++ compiler_rtti_exceptions=yes
++ fi
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++ echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
++echo "${ECHO_T}$compiler_rtti_exceptions" >&6
++
++ if test "$compiler_rtti_exceptions" = "yes"; then
++ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
++ else
++ no_builtin_flag=' -fno-builtin'
++ fi
++fi
++
++# See if the linker supports building shared libraries.
++echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5
++echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6
++
++allow_undefined_flag=
++no_undefined_flag=
++need_lib_prefix=unknown
++need_version=unknown
++# when you set need_version to no, make sure it does not cause -set_version
++# flags to be left without arguments
++archive_cmds=
++archive_expsym_cmds=
++old_archive_from_new_cmds=
++old_archive_from_expsyms_cmds=
++export_dynamic_flag_spec=
++whole_archive_flag_spec=
++thread_safe_flag_spec=
++hardcode_into_libs=no
++hardcode_libdir_flag_spec=
++hardcode_libdir_separator=
++hardcode_direct=no
++hardcode_minus_L=no
++hardcode_shlibpath_var=unsupported
++runpath_var=
++link_all_deplibs=unknown
++always_export_symbols=no
++export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
++# include_expsyms should be a list of space-separated symbols to be *always*
++# included in the symbol list
++include_expsyms=
++# exclude_expsyms can be an egrep regular expression 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_"
++# 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.
++extract_expsyms_cmds=
++
++case $host_os in
++cygwin* | mingw* | pw32*)
++ # 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
++ ;;
++openbsd*)
++ with_gnu_ld=no
++ ;;
++esac
++
++ld_shlibs=yes
++if test "$with_gnu_ld" = yes; then
++ # If archive_cmds runs LD, not CC, wlarc should be empty
++ wlarc='${wl}'
++
++ # See if GNU ld supports shared libraries.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ # On AIX, the GNU linker is very broken
++ # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
++ ld_shlibs=no
++ cat <<EOF 1>&2
++
++*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
++*** so that a non-GNU linker is found, and then restart.
++
++EOF
++ ;;
++
++ amigaos*)
++ 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
++
++ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++ # that the semantics of dynamic libraries on AmigaOS, at least up
++ # to version 4, is to share data among multiple programs linked
++ # with the same dynamic library. Since this doesn't match the
++ # behavior of shared libraries on other platforms, we can use
++ # them.
++ ld_shlibs=no
++ ;;
++
++ beos*)
++ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
++ allow_undefined_flag=unsupported
++ # Joseph Beckenbach <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*)
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec='-L$libdir'
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++
++ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
++ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
++ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
++ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
++ else $CC -o impgen impgen.c ; fi)~
++ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
++
++ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
++
++ # cygwin and mingw dlls have different entry points and sets of symbols
++ # to exclude.
++ # FIXME: what about values for MSVC?
++ dll_entry=__cygwin_dll_entry@12
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
++ case $host_os in
++ mingw*)
++ # mingw values
++ dll_entry=_DllMainCRTStartup@12
++ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
++ ;;
++ esac
++
++ # mingw and cygwin differ, and it's simplest to just exclude the union
++ # of the two symbol sets.
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
++
++ # recent cygwin and mingw systems supply a stub DllMain which the user
++ # can override, but on older systems we have to supply one (in ltdll.c)
++ if test "x$lt_cv_need_dllmain" = "xyes"; then
++ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
++ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
++ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
++ else
++ ltdll_obj=
++ ltdll_cmds=
++ fi
++
++ # Extract the symbol export list from an `--export-all' def file,
++ # then regenerate the def file from the symbol export list, so that
++ # the compiled dll only exports the symbol export list.
++ # Be careful not to strip the DATA tag left be newer dlltools.
++ export_symbols_cmds="$ltdll_cmds"'
++ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
++ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
++
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is.
++ # If DATA tags from a recent dlltool are present, honour them!
++ 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;
++ _lt_hint=1;
++ cat $export_symbols | while read symbol; do
++ set dummy \$symbol;
++ case \$# in
++ 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
++ 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
++ *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
++ esac;
++ _lt_hint=`expr 1 + \$_lt_hint`;
++ done;
++ fi~
++ '"$ltdll_cmds"'
++ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
++ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
++ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
++ ;;
++
++ 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ fi
++ ;;
++
++ solaris* | sysv5*)
++ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
++ ld_shlibs=no
++ cat <<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.
++
++EOF
++ elif $LD --help 2>&1 | egrep ': 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
++ ;;
++
++ 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 | egrep ': 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" = yes; then
++ runpath_var=LD_RUN_PATH
++ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
++ export_dynamic_flag_spec='${wl}--export-dynamic'
++ case $host_os in
++ cygwin* | mingw* | pw32*)
++ # dlltool doesn't understand --whole-archive et. al.
++ whole_archive_flag_spec=
++ ;;
++ *)
++ # ancient GNU ld didn't support --whole-archive et. al.
++ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
++ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ else
++ whole_archive_flag_spec=
++ fi
++ ;;
++ esac
++ fi
++else
++ # PORTME fill in a description of your system's linker (not GNU ld)
++ 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 "$link_static_flag"; then
++ # Neither direct hardcoding nor static linking is supported with a
++ # broken collect2.
++ hardcode_direct=unsupported
++ fi
++ ;;
++
++ aix4* | aix5*)
++ 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].*|aix5*)
++ 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.
++
++ hardcode_direct=yes
++ archive_cmds=''
++ hardcode_libdir_separator=':'
++ if test "$GCC" = yes; then
++ case $host_os in aix4.[012]|aix4.[012].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ # It fails to find uninstalled libraries when the uninstalled
++ # path is not listed in the libpath. Setting hardcode_minus_L
++ # to unsupported forces relinking
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++
++ shared_flag='-shared'
++ else
++ # not using gcc
++ if test "$host_cpu" = ia64; then
++ shared_flag='${wl}-G'
++ else
++ if test "$aix_use_runtimelinking" = yes; then
++ shared_flag='${wl}-G'
++ else
++ shared_flag='${wl}-bM:SRE'
++ fi
++ fi
++ fi
++
++ # It seems that -bexpall can do strange things, 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'
++ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
++ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ else
++ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Warning - without using the other run time loading flags,
++ # -berok will link without error, but may produce a broken library.
++ allow_undefined_flag='${wl}-berok'
++ # This is a bit strange, but is similar to how AIX traditionally builds
++ # it's shared libraries.
++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
++ fi
++ fi
++ ;;
++
++ amigaos*)
++ 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
++ # see comment about different semantics on the GNU ld section
++ ld_shlibs=no
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ # 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
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''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"`'
++ ;;
++
++ darwin* | rhapsody*)
++ case "$host_os" in
++ rhapsody* | darwin1.[012])
++ allow_undefined_flag='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ allow_undefined_flag='-flat_namespace -undefined suppress'
++ ;;
++ esac
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
++ # `"' quotes if we put them in here... so don't!
++ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
++ # We need to add '_' to the symbols in $export_symbols first
++ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ whole_archive_flag_spec='-all_load $convenience'
++ ;;
++
++ freebsd1*)
++ ld_shlibs=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*)
++ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ case $host_os in
++ hpux9*) 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' ;;
++ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
++ esac
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=yes
++ hardcode_minus_L=yes # Not in the search PATH, but as the default
++ # location of the library.
++ export_dynamic_flag_spec='${wl}-E'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ else
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ 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
++ ;;
++
++ openbsd*)
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ 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'
++ 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
++ ;;
++
++ 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ else
++ allow_undefined_flag=' -expect_unresolved \*'
++ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ fi
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++
++ osf4* | osf5*) # as osf3* with the addition of -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" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
++ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
++
++ #Both c and cxx compiler support -rpath directly
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ ;;
++
++ sco3.2v5*)
++ 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
++ export_dynamic_flag_spec='${wl}-Bexport'
++ ;;
++
++ solaris*)
++ # gcc --version < 3.0 without binutils cannot create self contained
++ # shared libraries reliably, requiring libgcc.a to resolve some of
++ # the object symbols generated in some cases. Libraries that use
++ # assert need libgcc.a to resolve __eprintf, for example. Linking
++ # a copy of libgcc.a into every shared library to guarantee resolving
++ # such symbols causes other problems: According to Tim Van Holder
++ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
++ # (to the application) exception stack for one thing.
++ no_undefined_flag=' -z defs'
++ if test "$GCC" = yes; then
++ case `$CC --version 2>/dev/null` in
++ [12].*)
++ cat <<EOF 1>&2
++
++*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
++*** create self contained shared libraries on Solaris systems, without
++*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
++*** -no-undefined support, which will at least allow you to build shared
++*** libraries. However, you may find that when you link such libraries
++*** into an application without using GCC, you have to manually add
++*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
++*** upgrade to a newer version of GCC. Another option is to rebuild your
++*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
++
++EOF
++ no_undefined_flag=
++ ;;
++ esac
++ fi
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_shlibpath_var=no
++ case $host_os in
++ solaris2.[0-5] | solaris2.[0-5].*) ;;
++ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
++ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
++ esac
++ 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'
++ ;;
++
++ sysv5*)
++ no_undefined_flag=' -z text'
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec=
++ hardcode_shlibpath_var=no
++ runpath_var='LD_RUN_PATH'
++ ;;
++
++ uts4*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ dgux*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ 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.2uw2*)
++ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_direct=yes
++ hardcode_minus_L=no
++ hardcode_shlibpath_var=no
++ hardcode_runpath_var=yes
++ runpath_var=LD_RUN_PATH
++ ;;
++
++ sysv5uw7* | unixware7*)
++ no_undefined_flag='${wl}-z ${wl}text'
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ else
++ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ fi
++ runpath_var='LD_RUN_PATH'
++ hardcode_shlibpath_var=no
++ ;;
++
++ *)
++ ld_shlibs=no
++ ;;
++ esac
++fi
++echo "$as_me:$LINENO: result: $ld_shlibs" >&5
++echo "${ECHO_T}$ld_shlibs" >&6
++test "$ld_shlibs" = no && can_build_shared=no
++
++# Check hardcoding attributes.
++echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
++echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
++hardcode_action=
++if test -n "$hardcode_libdir_flag_spec" || \
++ test -n "$runpath_var"; then
++
++ # We can hardcode non-existant 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 "$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
++echo "$as_me:$LINENO: result: $hardcode_action" >&5
++echo "${ECHO_T}$hardcode_action" >&6
++
++striplib=
++old_striplib=
++echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
++echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++reload_cmds='$LD$reload_flag -o $output$reload_objs'
++test -z "$deplibs_check_method" && deplibs_check_method=unknown
++
++# PORTME Fill in your ld.so characteristics
++echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
++echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
++library_names_spec=
++libname_spec='lib$name'
++soname_spec=
++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"
++sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
++
++case $host_os in
++aix3*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix $libname.a'
++ shlibpath_var=LIBPATH
++
++ # AIX has no versioning support, so we append a major version to the name.
++ soname_spec='${libname}${release}.so$major'
++ ;;
++
++aix4* | aix5*)
++ 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}.so$major ${libname}${release}.so$versuffix $libname.so'
++ 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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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}.so$major'
++ fi
++ shlibpath_var=LIBPATH
++ fi
++ hardcode_into_libs=yes
++ ;;
++
++amigaos*)
++ 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=`$echo "X$lib" | $Xsed -e '\''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'
++ ;;
++
++beos*)
++ library_names_spec='${libname}.so'
++ dynamic_linker="$host_os ld.so"
++ shlibpath_var=LIBRARY_PATH
++ ;;
++
++bsdi4*)
++ version_type=linux
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
++ export_dynamic_flag_spec=-rdynamic
++ # the default ld.so.conf also contains /usr/contrib/lib and
++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
++ # libtool to hard-code these into programs
++ ;;
++
++cygwin* | mingw* | pw32*)
++ version_type=windows
++ need_version=no
++ need_lib_prefix=no
++ case $GCC,$host_os in
++ yes,cygwin*)
++ library_names_spec='$libname.dll.a'
++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog .libs/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $rm \$dlpath'
++ ;;
++ yes,mingw*)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
++ ;;
++ yes,pw32*)
++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
++ ;;
++ *)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $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
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes.
++ library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
++ soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
++ shlibpath_overrides_runpath=yes
++ shlibpath_var=DYLD_LIBRARY_PATH
++ ;;
++
++freebsd1*)
++ dynamic_linker=no
++ ;;
++
++kfreebsd*-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU/FreeBSD ld.so'
++ ;;
++
++freebsd*)
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ version_type=freebsd-$objformat
++ case $version_type in
++ freebsd-elf*)
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
++ need_version=no
++ need_lib_prefix=no
++ ;;
++ freebsd-*)
++ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
++ need_version=yes
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_os in
++ freebsd2*)
++ shlibpath_overrides_runpath=yes
++ ;;
++ *)
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ ;;
++ esac
++ ;;
++
++gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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.
++ dynamic_linker="$host_os dld.sl"
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ shlibpath_var=SHLIB_PATH
++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
++ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
++ soname_spec='${libname}${release}.sl$major'
++ # HP-UX runs *really* slowly unless shared libraries are mode 555.
++ postinstall_cmds='chmod 555 $lib'
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ nonstopux*) version_type=nonstopux ;;
++ *) version_type=irix ;;
++ esac
++ need_lib_prefix=no
++ need_version=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
++ case $host_os in
++ irix5* | nonstopux*)
++ libsuff= shlibsuff=
++ ;;
++ *)
++ case $LD in # libtool.m4 will add one of these switches to LD
++ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
++ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
++ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
++ *) libsuff= shlibsuff= libmagic=never-match;;
++ esac
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
++ shlibpath_overrides_runpath=no
++ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
++ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
++ ;;
++
++# No shared lib support for Linux oldld, aout, or coff.
++linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
++ dynamic_linker=no
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # 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
++
++ # 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}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ dynamic_linker='NetBSD (a.out) ld.so'
++ else
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
++ soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=yes
++ ;;
++
++openbsd*)
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ 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
++ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++os2*)
++ libname_spec='$name'
++ need_lib_prefix=no
++ library_names_spec='$libname.dll $libname.a'
++ dynamic_linker='OS/2 ld.exe'
++ shlibpath_var=LIBPATH
++ ;;
++
++osf3* | osf4* | osf5*)
++ version_type=osf
++ need_version=no
++ need_lib_prefix=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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"
++ hardcode_into_libs=yes
++ ;;
++
++sco3.2v5*)
++ version_type=osf
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++solaris*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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}.so$versuffix ${libname}.so$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.2uw2* | sysv4.3* | sysv5*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_vendor in
++ sni)
++ shlibpath_overrides_runpath=no
++ need_lib_prefix=no
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ 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
++ ;;
++
++uts4*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++dgux*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++sysv4*MP*)
++ if test -d /usr/nec ;then
++ version_type=linux
++ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
++ soname_spec='$libname.so.$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ fi
++ ;;
++
++*)
++ dynamic_linker=no
++ ;;
++esac
++echo "$as_me:$LINENO: result: $dynamic_linker" >&5
++echo "${ECHO_T}$dynamic_linker" >&6
++test "$dynamic_linker" = no && can_build_shared=no
++
++# Report the final consequences.
++echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
++echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
++echo "$as_me:$LINENO: result: $can_build_shared" >&5
++echo "${ECHO_T}$can_build_shared" >&6
++
++echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
++echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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
++ ;;
++
++aix4*)
++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
++ test "$enable_shared" = yes && enable_static=no
++ fi
++ ;;
++esac
++echo "$as_me:$LINENO: result: $enable_shared" >&5
++echo "${ECHO_T}$enable_shared" >&6
++
++echo "$as_me:$LINENO: checking whether to build static libraries" >&5
++echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
++# Make sure either enable_shared or enable_static is yes.
++test "$enable_shared" = yes || enable_static=yes
++echo "$as_me:$LINENO: result: $enable_static" >&5
++echo "${ECHO_T}$enable_static" >&6
++
++if test "$hardcode_action" = relink; 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
++
++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 "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
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ lt_cv_dlopen="LoadLibrary"
++ lt_cv_dlopen_libs=
++ ;;
++
++ *)
++ echo "$as_me:$LINENO: checking for shl_load" >&5
++echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
++if test "${ac_cv_func_shl_load+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define shl_load innocuous_shl_load
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char shl_load (); 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 shl_load
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char shl_load ();
++/* 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_shl_load) || defined (__stub___shl_load)
++choke me
++#else
++char (*f) () = shl_load;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != shl_load;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_func_shl_load=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_func_shl_load=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
++echo "${ECHO_T}$ac_cv_func_shl_load" >&6
++if test $ac_cv_func_shl_load = yes; then
++ lt_cv_dlopen="shl_load"
++else
++ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
++echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
++if test "${ac_cv_lib_dld_shl_load+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldld $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char shl_load ();
++int
++main ()
++{
++shl_load ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dld_shl_load=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dld_shl_load=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
++echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
++if test $ac_cv_lib_dld_shl_load = yes; then
++ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
++else
++ echo "$as_me:$LINENO: checking for dlopen" >&5
++echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
++if test "${ac_cv_func_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define dlopen innocuous_dlopen
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char dlopen (); 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 dlopen
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_dlopen) || defined (__stub___dlopen)
++choke me
++#else
++char (*f) () = dlopen;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != dlopen;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_func_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_func_dlopen=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
++echo "${ECHO_T}$ac_cv_func_dlopen" >&6
++if test $ac_cv_func_dlopen = yes; then
++ lt_cv_dlopen="dlopen"
++else
++ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
++echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
++if test "${ac_cv_lib_dl_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldl $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dl_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dl_dlopen=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
++echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
++if test $ac_cv_lib_dl_dlopen = yes; then
++ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
++else
++ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
++echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
++if test "${ac_cv_lib_svld_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lsvld $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_svld_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_svld_dlopen=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
++echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
++if test $ac_cv_lib_svld_dlopen = yes; then
++ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
++else
++ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
++echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
++if test "${ac_cv_lib_dld_dld_link+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldld $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dld_link ();
++int
++main ()
++{
++dld_link ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dld_dld_link=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dld_dld_link=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
++echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
++if test $ac_cv_lib_dld_dld_link = yes; then
++ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
++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"
++ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
++
++ save_LIBS="$LIBS"
++ LIBS="$lt_cv_dlopen_libs $LIBS"
++
++ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
++echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
++if test "${lt_cv_dlopen_self+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
++#line 7611 "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}
++EOF
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;;
++ esac
++ else :
++ # compilation failed
++ lt_cv_dlopen_self=no
++ fi
++fi
++rm -fr conftest*
++
++
++fi
++echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
++echo "${ECHO_T}$lt_cv_dlopen_self" >&6
++
++ if test "x$lt_cv_dlopen_self" = xyes; then
++ LDFLAGS="$LDFLAGS $link_static_flag"
++ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
++echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
++if test "${lt_cv_dlopen_self_static+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
++#line 7709 "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}
++EOF
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
++ esac
++ else :
++ # compilation failed
++ lt_cv_dlopen_self_static=no
++ fi
++fi
++rm -fr conftest*
++
++
++fi
++echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
++echo "${ECHO_T}$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
++
++
++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.
++ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
++echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
++ if test "${lt_cv_archive_cmds_need_lc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ $rm conftest*
++ echo 'static int dummy;' > conftest.$ac_ext
++
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ soname=conftest
++ lib=conftest
++ libobjs=conftest.$ac_objext
++ deplibs=
++ wl=$lt_cv_prog_cc_wl
++ compiler_flags=-v
++ linker_flags=-v
++ verstring=
++ output_objdir=.
++ libname=conftest
++ save_allow_undefined_flag=$allow_undefined_flag
++ allow_undefined_flag=
++ if { (eval echo "$as_me:$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=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++ then
++ lt_cv_archive_cmds_need_lc=no
++ else
++ lt_cv_archive_cmds_need_lc=yes
++ fi
++ allow_undefined_flag=$save_allow_undefined_flag
++ else
++ cat conftest.err 1>&5
++ fi
++fi
++
++ echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5
++echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6
++ ;;
++ esac
++fi
++need_lc=${lt_cv_archive_cmds_need_lc-yes}
++
++# The second clause should only fire when bootstrapping the
++# libtool distribution, otherwise you forgot to ship ltmain.sh
++# with your package, and you will get complaints that there are
++# no rules to generate ltmain.sh.
++if test -f "$ltmain"; then
++ :
++else
++ # If there is no Makefile yet, we rely on a make rule to execute
++ # `config.status --recheck' to rerun these tests and create the
++ # libtool script then.
++ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
++ if test -f "$ltmain_in"; then
++ test -f Makefile && make "$ltmain"
++ fi
++fi
++
++if test -f "$ltmain"; then
++ trap "$rm \"${ofile}T\"; exit 1" 1 2 15
++ $rm -f "${ofile}T"
++
++ echo creating $ofile
++
++ # Now quote all the things that may contain metacharacters while being
++ # careful not to overquote the AC_SUBSTed values. We take copies of the
++ # variables and quote the copies for generation of the libtool script.
++ for var in echo old_CC old_CFLAGS SED \
++ AR AR_FLAGS CC LD LN_S NM SHELL STRIP \
++ reload_flag reload_cmds wl \
++ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
++ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
++ library_names_spec soname_spec \
++ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
++ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
++ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
++ old_striplib striplib file_magic_cmd export_symbols_cmds \
++ deplibs_check_method allow_undefined_flag no_undefined_flag \
++ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
++ global_symbol_to_c_name_address \
++ hardcode_libdir_flag_spec hardcode_libdir_separator \
++ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
++ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
++
++ case $var in
++ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
++ old_postinstall_cmds | old_postuninstall_cmds | \
++ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
++ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
++ postinstall_cmds | postuninstall_cmds | \
++ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
++ # Double-quote double-evaled strings.
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
++ ;;
++ *)
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
++ ;;
++ esac
++ done
++
++ cat <<__EOF__ > "${ofile}T"
++#! $SHELL
++
++# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
++# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
++# NOTE: Changes made to this file will be lost: look at ltmain.sh.
++#
++# Copyright (C) 1996-2000 Free Software Foundation, Inc.
++# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# A sed that does not truncate output.
++SED=$lt_SED
++
++# Sed that helps us avoid accidentally triggering echo(1) options like -n.
++Xsed="${SED} -e s/^X//"
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++# ### BEGIN LIBTOOL CONFIG
++
++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++
++# Shell to use when invoking shell scripts.
++SHELL=$lt_SHELL
++
++# Whether or not to build shared libraries.
++build_libtool_libs=$enable_shared
++
++# Whether or not to build static libraries.
++build_old_libs=$enable_static
++
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$need_lc
++
++# Whether or not to optimize for fast installation.
++fast_install=$enable_fast_install
++
++# The host system.
++host_alias=$host_alias
++host=$host
++
++# An echo program that does not interpret backslashes.
++echo=$lt_echo
++
++# The archiver.
++AR=$lt_AR
++AR_FLAGS=$lt_AR_FLAGS
++
++# The default C compiler.
++CC=$lt_CC
++
++# Is the compiler the GNU C compiler?
++with_gcc=$GCC
++
++# The linker used to build libraries.
++LD=$lt_LD
++
++# Whether we need hard or soft links.
++LN_S=$lt_LN_S
++
++# A BSD-compatible nm program.
++NM=$lt_NM
++
++# A symbol stripping program
++STRIP=$lt_STRIP
++
++# Used to examine libraries when file_magic_cmd begins "file"
++MAGIC_CMD=$MAGIC_CMD
++
++# Used on cygwin: DLL creation program.
++DLLTOOL="$DLLTOOL"
++
++# Used on cygwin: object dumper.
++OBJDUMP="$OBJDUMP"
++
++# Used on cygwin: assembler.
++AS="$AS"
++
++# The name of the directory that contains temporary libtool files.
++objdir=$objdir
++
++# How to create reloadable object files.
++reload_flag=$lt_reload_flag
++reload_cmds=$lt_reload_cmds
++
++# How to pass a linker flag through the compiler.
++wl=$lt_wl
++
++# Object file suffix (normally "o").
++objext="$ac_objext"
++
++# Old archive suffix (normally "a").
++libext="$libext"
++
++# Executable file suffix (normally "").
++exeext="$exeext"
++
++# Additional compiler flags for building library objects.
++pic_flag=$lt_pic_flag
++pic_mode=$pic_mode
++
++# Does compiler simultaneously support -c and -o options?
++compiler_c_o=$lt_compiler_c_o
++
++# Can we write directly to a .lo ?
++compiler_o_lo=$lt_compiler_o_lo
++
++# Must we lock files when doing compilation ?
++need_locks=$lt_need_locks
++
++# 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
++
++# 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
++
++# Compiler flag to prevent dynamic linking.
++link_static_flag=$lt_link_static_flag
++
++# Compiler flag to turn off builtin functions.
++no_builtin_flag=$lt_no_builtin_flag
++
++# 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
++
++# Compiler flag to generate thread-safe objects.
++thread_safe_flag_spec=$lt_thread_safe_flag_spec
++
++# Library versioning type.
++version_type=$version_type
++
++# 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
++
++# Commands used to build and install an old-style archive.
++RANLIB=$lt_RANLIB
++old_archive_cmds=$lt_old_archive_cmds
++old_postinstall_cmds=$lt_old_postinstall_cmds
++old_postuninstall_cmds=$lt_old_postuninstall_cmds
++
++# 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 and install a shared archive.
++archive_cmds=$lt_archive_cmds
++archive_expsym_cmds=$lt_archive_expsym_cmds
++postinstall_cmds=$lt_postinstall_cmds
++postuninstall_cmds=$lt_postuninstall_cmds
++
++# Commands to strip libraries.
++old_striplib=$lt_old_striplib
++striplib=$lt_striplib
++
++# 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
++
++# Flag that allows shared libraries with undefined symbols to be built.
++allow_undefined_flag=$lt_allow_undefined_flag
++
++# Flag that forces no undefined symbols.
++no_undefined_flag=$lt_no_undefined_flag
++
++# Commands used to finish a libtool library installation in a directory.
++finish_cmds=$lt_finish_cmds
++
++# Same as above, but a single script fragment to be evaled but not shown.
++finish_eval=$lt_finish_eval
++
++# Take the output of nm and produce a listing of raw symbols and C names.
++global_symbol_pipe=$lt_global_symbol_pipe
++
++# Transform the output of nm in a proper C declaration
++global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
++
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
++
++# This is the shared library runtime path variable.
++runpath_var=$runpath_var
++
++# This is the shared library path variable.
++shlibpath_var=$shlibpath_var
++
++# Is shlibpath searched before the hard-coded library search path?
++shlibpath_overrides_runpath=$shlibpath_overrides_runpath
++
++# How to hardcode a shared library path into an executable.
++hardcode_action=$hardcode_action
++
++# Whether we should hardcode library paths into libraries.
++hardcode_into_libs=$hardcode_into_libs
++
++# 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
++
++# 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.so during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct=$hardcode_direct
++
++# 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
++
++# Variables whose values should be saved in libtool wrapper scripts and
++# restored at relink time.
++variables_saved_for_relink="$variables_saved_for_relink"
++
++# Whether libtool must link a program against all its dependency libraries.
++link_all_deplibs=$link_all_deplibs
++
++# 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
++
++# Fix the shell variable \$srcfile for the compiler.
++fix_srcfile_path="$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
++
++# The commands to extract the exported symbol list from a shared archive.
++extract_expsyms_cmds=$lt_extract_expsyms_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
++
++# ### END LIBTOOL CONFIG
++
++__EOF__
++
++ case $host_os in
++ aix3*)
++ cat <<\EOF >> "${ofile}T"
++
++# 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
++EOF
++ ;;
++ esac
++
++ case $host_os in
++ cygwin* | mingw* | pw32* | os2*)
++ cat <<'EOF' >> "${ofile}T"
++ # This is a source program that is used to create dlls on Windows
++ # Don't remove nor modify the starting and closing comments
++# /* ltdll.c starts here */
++# #define WIN32_LEAN_AND_MEAN
++# #include <windows.h>
++# #undef WIN32_LEAN_AND_MEAN
++# #include <stdio.h>
++#
++# #ifndef __CYGWIN__
++# # ifdef __CYGWIN32__
++# # define __CYGWIN__ __CYGWIN32__
++# # endif
++# #endif
++#
++# #ifdef __cplusplus
++# extern "C" {
++# #endif
++# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
++# #ifdef __cplusplus
++# }
++# #endif
++#
++# #ifdef __CYGWIN__
++# #include <cygwin/cygwin_dll.h>
++# DECLARE_CYGWIN_DLL( DllMain );
++# #endif
++# HINSTANCE __hDllInstance_base;
++#
++# BOOL APIENTRY
++# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
++# {
++# __hDllInstance_base = hInst;
++# return TRUE;
++# }
++# /* ltdll.c ends here */
++ # This is a source program that is used to create import libraries
++ # on Windows for dlls which lack them. Don't remove nor modify the
++ # starting and closing comments
++# /* impgen.c starts here */
++# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
++#
++# This file is part of GNU libtool.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# */
++#
++# #include <stdio.h> /* for printf() */
++# #include <unistd.h> /* for open(), lseek(), read() */
++# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
++# #include <string.h> /* for strdup() */
++#
++# /* O_BINARY isn't required (or even defined sometimes) under Unix */
++# #ifndef O_BINARY
++# #define O_BINARY 0
++# #endif
++#
++# static unsigned int
++# pe_get16 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[2];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 2);
++# return b[0] + (b[1]<<8);
++# }
++#
++# static unsigned int
++# pe_get32 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[4];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 4);
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# static unsigned int
++# pe_as32 (ptr)
++# void *ptr;
++# {
++# unsigned char *b = ptr;
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# int
++# main (argc, argv)
++# int argc;
++# char *argv[];
++# {
++# int dll;
++# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
++# unsigned long export_rva, export_size, nsections, secptr, expptr;
++# unsigned long name_rvas, nexp;
++# unsigned char *expdata, *erva;
++# char *filename, *dll_name;
++#
++# filename = argv[1];
++#
++# dll = open(filename, O_RDONLY|O_BINARY);
++# if (dll < 1)
++# return 1;
++#
++# dll_name = filename;
++#
++# for (i=0; filename[i]; i++)
++# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
++# dll_name = filename + i +1;
++#
++# pe_header_offset = pe_get32 (dll, 0x3c);
++# opthdr_ofs = pe_header_offset + 4 + 20;
++# num_entries = pe_get32 (dll, opthdr_ofs + 92);
++#
++# if (num_entries < 1) /* no exports */
++# return 1;
++#
++# export_rva = pe_get32 (dll, opthdr_ofs + 96);
++# export_size = pe_get32 (dll, opthdr_ofs + 100);
++# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
++# secptr = (pe_header_offset + 4 + 20 +
++# pe_get16 (dll, pe_header_offset + 4 + 16));
++#
++# expptr = 0;
++# for (i = 0; i < nsections; i++)
++# {
++# char sname[8];
++# unsigned long secptr1 = secptr + 40 * i;
++# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
++# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
++# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
++# lseek(dll, secptr1, SEEK_SET);
++# read(dll, sname, 8);
++# if (vaddr <= export_rva && vaddr+vsize > export_rva)
++# {
++# expptr = fptr + (export_rva - vaddr);
++# if (export_rva + export_size > vaddr + vsize)
++# export_size = vsize - (export_rva - vaddr);
++# break;
++# }
++# }
++#
++# expdata = (unsigned char*)malloc(export_size);
++# lseek (dll, expptr, SEEK_SET);
++# read (dll, expdata, export_size);
++# erva = expdata - export_rva;
++#
++# nexp = pe_as32 (expdata+24);
++# name_rvas = pe_as32 (expdata+32);
++#
++# printf ("EXPORTS\n");
++# for (i = 0; i<nexp; i++)
++# {
++# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
++# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
++# }
++#
++# return 0;
++# }
++# /* impgen.c ends here */
++
++EOF
++ ;;
++ esac
+
+-for ac_prog in ln
+-do
+-# Extract the first word of "$ac_prog", so it can be a program name with args.
+-set dummy $ac_prog; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1154: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_LN'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- if test -n "$LN"; then
+- ac_cv_prog_LN="$LN" # Let the user override the test.
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_LN="$ac_prog"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+-fi
+-fi
+-LN="$ac_cv_prog_LN"
+-if test -n "$LN"; then
+- echo "$ac_t""$LN" 1>&6
+-else
+- echo "$ac_t""no" 1>&6
++ # 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" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
++
++ mv -f "${ofile}T" "$ofile" || \
++ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
++ chmod +x "$ofile"
+ fi
+
+-test -n "$LN" && break
+-done
+-test -n "$LN" || LN="@true"
++
++
++
++
++# This can be used to rebuild libtool when needed
++LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
++
++# Always use our own libtool.
++LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++
++# Prevent multiple expansion
++
++
+
+
+ for ac_func in strerror
+ do
+-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+-echo "configure:1188: checking for $ac_func" >&5
+-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 1193 "configure"
+-#include "confdefs.h"
++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_func" >&5
++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
++if eval "test \"\${$as_ac_var+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+- which can conflict with char $ac_func(); below. */
+-#include <assert.h>
+-/* Override any gcc2 internal prototype to avoid an error. */
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char $ac_func();
++ which can conflict with char $ac_func (); 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
+
+-int main() {
++#undef $ac_func
+
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char $ac_func ();
+ /* 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_$ac_func) || defined (__stub___$ac_func)
+ choke me
+ #else
+-$ac_func();
++char (*f) () = $ac_func;
++#endif
++#ifdef __cplusplus
++}
+ #endif
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:1216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_func_$ac_func=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_func_$ac_func=no"
+-fi
+-rm -f conftest*
+-fi
++int
++main ()
++{
++return f != $ac_func;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ eval "$as_ac_var=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "$as_ac_var=no"
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
++if test `eval echo '${'$as_ac_var'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
++_ACEOF
+
+-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_func 1
+-EOF
+-
+-else
+- echo "$ac_t""no" 1>&6
+ fi
+ done
+
+
+-echo $ac_n "checking for pcap_open_live in -lpcap""... $ac_c" 1>&6
+-echo "configure:1242: checking for pcap_open_live in -lpcap" >&5
+-ac_lib_var=`echo pcap'_'pcap_open_live | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for pcap_open_live in -lpcap" >&5
++echo $ECHO_N "checking for pcap_open_live in -lpcap... $ECHO_C" >&6
++if test "${ac_cv_lib_pcap_pcap_open_live+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lpcap $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 1250 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char pcap_open_live();
+-
+-int main() {
+-pcap_open_live()
+-; return 0; }
+-EOF
+-if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+-
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- cat >> confdefs.h <<\EOF
++ builtin and then its argument prototype would still apply. */
++char pcap_open_live ();
++int
++main ()
++{
++pcap_open_live ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_pcap_pcap_open_live=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_pcap_pcap_open_live=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_open_live" >&5
++echo "${ECHO_T}$ac_cv_lib_pcap_pcap_open_live" >&6
++if test $ac_cv_lib_pcap_pcap_open_live = yes; then
++ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_LIB_PCAP 1
+-EOF
++_ACEOF
+
+-else
+- echo "$ac_t""no" 1>&6
+ fi
+
+
+-echo $ac_n "checking low-level packet interface type""... $ac_c" 1>&6
+-echo "configure:1286: checking low-level packet interface type" >&5
++echo "$as_me:$LINENO: checking low-level packet interface type" >&5
++echo $ECHO_N "checking low-level packet interface type... $ECHO_C" >&6
+
+ if test -r /dev/bpf0 ; then
+ LL_INT_TYPE=bpf
+- echo "$ac_t""found bpf" 1>&6
++ echo "$as_me:$LINENO: result: found bpf" >&5
++echo "${ECHO_T}found bpf" >&6
+ elif test -r /usr/include/net/pfilt.h ; then
+ LL_INT_TYPE=pf
+- echo "$ac_t""found pf" 1>&6
++ echo "$as_me:$LINENO: result: found pf" >&5
++echo "${ECHO_T}found pf" >&6
+ elif test -r /dev/nit ; then
+ LL_INT_TYPE=snit
+- echo "$ac_t""found snit" 1>&6
++ echo "$as_me:$LINENO: result: found snit" >&5
++echo "${ECHO_T}found snit" >&6
+ elif test -r /usr/include/sys/net/nit.h ; then
+ LL_INT_TYPE=nit
+- echo "$ac_t""found nit" 1>&6
++ echo "$as_me:$LINENO: result: found nit" >&5
++echo "${ECHO_T}found nit" >&6
+ elif test -r /usr/include/net/raw.h ; then
+ LL_INT_TYPE=snoop
+- echo "$ac_t""found snoop" 1>&6
++ echo "$as_me:$LINENO: result: found snoop" >&5
++echo "${ECHO_T}found snoop" >&6
+ elif test -r /usr/include/sys/dlpi.h ; then
+ LL_INT_TYPE=dlpi
+- echo "$ac_t""found dlpi" 1>&6
+- cat >> confdefs.h <<\EOF
++ echo "$as_me:$LINENO: result: found dlpi" >&5
++echo "${ECHO_T}found dlpi" >&6
++ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_DLPI 1
+-EOF
++_ACEOF
+
+ elif test -r /usr/include/linux/socket.h ; then
+ LL_INT_TYPE=sockpacket
+- echo "$ac_t""found SOCK_PACKET" 1>&6
++ echo "$as_me:$LINENO: result: found linux primitives" >&5
++echo "${ECHO_T}found linux primitives" >&6
+ if test $with_pf_packet = yes; then
+-
+- echo $ac_n "checking for PF_PACKET""... $ac_c" 1>&6
+-echo "configure:1316: checking for PF_PACKET" >&5
+- if eval "test \"`echo '$''{'ac_libnet_have_pf_packet'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++
++ echo "$as_me:$LINENO: checking for PF_PACKET" >&5
++echo $ECHO_N "checking for PF_PACKET... $ECHO_C" >&6
++ if test "${ac_libnet_have_pf_packet+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ case "$target_os" in
+
+@@ -1324,66 +8660,43 @@
+ *)
+
+ cat > pf_packet-test.c << EOF
+-#include <net/if.h>
+-#if (__GLIBC__)
+-#include <netinet/if_ether.h>
+-#include <net/if_arp.h>
++#include <stdio.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <netinet/in.h>
++#include <sys/socket.h>
++#include <features.h> /* for the glibc version number */
++#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
++#include <netpacket/packet.h>
++#include <net/ethernet.h> /* the L2 protocols */
+ #else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
++#include <asm/types.h>
++#include <linux/if_packet.h>
++#include <linux/if_ether.h> /* The L2 protocols */
+ #endif
+-#if (PF_PACKET)
++
+ #ifndef SOL_PACKET
+ #define SOL_PACKET 263
+ #endif /* SOL_PACKET */
+-#include <linux/if_packet.h>
+-#endif
+-#include <stdlib.h>
+-#include <linux/sockios.h>
+
+ int
+ main()
+ {
+-#if (PF_PACKET)
+ int fd;
+- struct sockaddr_ll sa;
+- struct ifreq ifr;
+- struct packet_mreq mr;
+- char *device ="lo";
+
+ fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
+ if (fd == -1)
+ {
+- printf("choked");
+- exit (EXIT_FAILURE);
+- }
+-
+- memset(&sa, 0, sizeof(sa));
+- strcpy(ifr.ifr_name, device);
+- if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0)
+- {
+- printf("choked");
+- exit (EXIT_FAILURE);
+- }
+- sa.sll_family = AF_PACKET;
+- sa.sll_ifindex = ifr.ifr_ifindex;
+- sa.sll_protocol = htons(ETH_P_ALL);
+-
+- memset(&mr, 0, sizeof (mr));
+- mr.mr_ifindex = sa.sll_ifindex;
+- mr.mr_type = PACKET_MR_ALLMULTI;
+-
+- if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, (char *)&mr,
+- sizeof (mr)) < 0)
+- {
+- printf("choked\n");
++ if (errno == EPERM)
++ {
++ /* user's UID != 0 */
++ printf("probably");
++ exit (EXIT_FAILURE);
++ }
++ printf("no");
+ exit (EXIT_FAILURE);
+ }
+- /* yay. we made it and it workz! */
+ printf("yes");
+-#else /* PF_PACKET */
+- printf("no");
+-#endif
+ exit (EXIT_SUCCESS);
+ }
+ EOF
+@@ -1397,38 +8710,52 @@
+ fi
+
+ if test $ac_libnet_have_pf_packet = choked; then
+- echo "$ac_t""test program choked... assuming no" 1>&6
++ echo "$as_me:$LINENO: result: test program choked... assuming no" >&5
++echo "${ECHO_T}test program choked... assuming no" >&6
+ elif test $ac_libnet_have_pf_packet = yes; then
+- cat >> confdefs.h <<\EOF
+-#define HAVE_PF_PACKET 1
+-EOF
+-
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_PF_PACKET"
++ elif test $ac_libnet_have_pf_packet = probably; then
++ echo "$as_me:$LINENO: result: test program got EPERM... assuming yes" >&5
++echo "${ECHO_T}test program got EPERM... assuming yes" >&6
++ elif test $ac_libnet_have_pf_packet = no; then
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+- if test $ac_libnet_have_pf_packet != choked; then
+- echo "$ac_t""$ac_libnet_have_pf_packet" 1>&6
+- fi
+ rm -f pf_packet-test* core core.pf_packet-test
+ ;;
+ esac
+ fi
+
+
++ if test $ac_libnet_have_pf_packet = yes -o $ac_libnet_have_pf_packet = probably; then
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_PF_PACKET 1
++_ACEOF
++
++ fi
++
+ fi
+ elif test -c /dev/bpf0 ; then # check again in case not readable
+ LL_INT_TYPE=bpf
+- echo "$ac_t""found bpf" 1>&6
++ echo "$as_me:$LINENO: result: found bpf" >&5
++echo "${ECHO_T}found bpf" >&6
+ elif test -c /dev/enet ; then # check again in case not readable
+ LL_INT_TYPE=enet
+- echo "$ac_t""found enet" 1>&6
++ echo "$as_me:$LINENO: result: found enet" >&5
++echo "${ECHO_T}found enet" >&6
+ elif test -c /dev/nit ; then # check again in case not readable
+ LL_INT_TYPE=snit
+- echo "$ac_t""found snit" 1>&6
++ echo "$as_me:$LINENO: result: found snit" >&5
++echo "${ECHO_T}found snit" >&6
+ else
+ LL_INT_TYPE=null
+- echo "configure: warning: could not find a low level packet interface" 1>&2
+- echo "configure: warning: low level packet creation API will not be added to the library" 1>&2
++ { echo "$as_me:$LINENO: WARNING: could not find a low level packet interface" >&5
++echo "$as_me: WARNING: could not find a low level packet interface" >&2;}
++ { echo "$as_me:$LINENO: WARNING: low level packet creation API will not be added to the library" >&5
++echo "$as_me: WARNING: low level packet creation API will not be added to the library" >&2;}
+ fi
+
+ LL_INT_TYPE_UC=`echo $LL_INT_TYPE | tr a-z A-Z`
+@@ -1437,158 +8764,187 @@
+ case "$target_os" in
+
+ *linux*)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define _BSD_SOURCE 1
+-EOF
++_ACEOF
+
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define __BSD_SOURCE 1
+-EOF
++_ACEOF
+
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define __FAVOR_BSD 1
+-EOF
++_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
+- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+-echo "configure:1455: checking how to run the C preprocessor" >&5
+-# On Suns, sometimes $CPP names a directory.
+-if test -n "$CPP" && test -d "$CPP"; then
+- CPP=
+-fi
+-if test -z "$CPP"; then
+-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- # This must be in double quotes, not single quotes, because CPP may get
+- # substituted into the Makefile and "${CC-cc}" will confuse make.
+- CPP="${CC-cc} -E"
+- # On the NeXT, cc -E runs the code through the compiler's parser,
+- # not just through cpp.
+- cat > conftest.$ac_ext <<EOF
+-#line 1470 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
+-else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP="${CC-cc} -E -traditional-cpp"
+- cat > conftest.$ac_ext <<EOF
+-#line 1487 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
+-else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP="${CC-cc} -nologo -E"
+- cat > conftest.$ac_ext <<EOF
+-#line 1504 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
++
++for ac_header in net/ethernet.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <$ac_header>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP=/lib/cpp
+-fi
+-rm -f conftest*
+-fi
+-rm -f conftest*
+-fi
+-rm -f conftest*
+- ac_cv_prog_CPP="$CPP"
++ ac_cpp_err=yes
+ fi
+- CPP="$ac_cv_prog_CPP"
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
+ else
+- ac_cv_prog_CPP="$CPP"
+-fi
+-echo "$ac_t""$CPP" 1>&6
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
+-for ac_hdr in net/ethernet.h
+-do
+-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:1538: checking for $ac_hdr" >&5
+-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 1543 "configure"
+-#include "confdefs.h"
+-#include <$ac_hdr>
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=yes"
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=no"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+-rm -f conftest*
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++
+ fi
+-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_hdr 1
+-EOF
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
+ \
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H"
+-else
+- echo "$ac_t""no" 1>&6
+ fi
++
+ done
+
+- MAN_PREFIX="$prefix/man/man3/"
++ MAN_PREFIX="$mandir/man3/"
+ LIB_PREFIX="$prefix/lib/"
+ INC_PREFIX="$prefix/include/"
+ BIN_PREFIX="$prefix/bin/"
+ ;;
+
+ *freebsd*)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BSDISH_OS 1
+-EOF
++_ACEOF
+
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BSD_BYTE_SWAP 1
+-EOF
++_ACEOF
+
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SOCKADDR_SA_LEN 1
+-EOF
++_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP \
+ -DHAVE_SOCKADDR_SA_LEN"
+@@ -1596,19 +8952,21 @@
+ LIB_PREFIX="$prefix/lib/aout"
+ INC_PREFIX="$prefix/include/"
+ BIN_PREFIX="$prefix/bin/"
+- echo "$ac_t""Note: support/bpf-lkm/etherspoof contains the lkm source \
+-required to spoof ethernet frames" 1>&6
++ echo "$as_me:$LINENO: result: Note: support/bpf-lkm/etherspoof contains the lkm source \
++required to spoof ethernet frames" >&5
++echo "${ECHO_T}Note: support/bpf-lkm/etherspoof contains the lkm source \
++required to spoof ethernet frames" >&6
+ ln -sf FreeBSD support/bpf-lkm/etherspoof
+ ;;
+
+ *netbsd*)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BSDISH_OS 1
+-EOF
++_ACEOF
+
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BSD_BYTE_SWAP 1
+-EOF
++_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ MAN_PREFIX="$prefix/man/man3/"
+@@ -1618,32 +8976,34 @@
+ ;;
+
+ *openbsd*)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BSDISH_OS 1
+-EOF
++_ACEOF
+
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SOCKADDR_SA_LEN 1
+-EOF
++_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS"
+ MAN_PREFIX="$prefix/man/man3/"
+ LIB_PREFIX="$prefix/lib/"
+ INC_PREFIX="$prefix/include/"
+ BIN_PREFIX="$prefix/bin/"
+- echo "$ac_t""Note: support/bpf-lkm/etherspoof contains the lkm required \
+-to spoof ethernet frames" 1>&6
++ echo "$as_me:$LINENO: result: Note: support/bpf-lkm/etherspoof contains the lkm required \
++to spoof ethernet frames" >&5
++echo "${ECHO_T}Note: support/bpf-lkm/etherspoof contains the lkm required \
++to spoof ethernet frames" >&6
+ ln -sf OpenBSD support/bpf-lkm/etherspoof
+ ;;
+
+ *bsdi*)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BSDISH_OS 1
+-EOF
++_ACEOF
+
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BSD_BYTE_SWAP 1
+-EOF
++_ACEOF
+
+ LIBNET_CONFIG_DEFINES="-DLIBNET_BSDISH_OS -DLIBNET_BSD_BYTE_SWAP"
+ MAN_PREFIX="$prefix/man/man3/"
+@@ -1653,181 +9013,353 @@
+ ;;
+
+ *solaris*)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_SOLARIS 1
+-EOF
++_ACEOF
+
+- for ac_hdr in sys/bufmod.h sys/dlpi_ext.h
++
++
++for ac_header in sys/bufmod.h sys/dlpi_ext.h
+ do
+-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:1665: checking for $ac_hdr" >&5
+-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <$ac_header>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
+ else
+- cat > conftest.$ac_ext <<EOF
+-#line 1670 "configure"
+-#include "confdefs.h"
+-#include <$ac_hdr>
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=yes"
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=no"
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+-rm -f conftest*
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++
+ fi
+-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_hdr 1
+-EOF
+-
+-else
+- echo "$ac_t""no" 1>&6
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
+ fi
++
+ done
+
+- echo $ac_n "checking for /dev/dlpi device""... $ac_c" 1>&6
+-echo "configure:1702: checking for /dev/dlpi device" >&5
++ echo "$as_me:$LINENO: checking for /dev/dlpi device" >&5
++echo $ECHO_N "checking for /dev/dlpi device... $ECHO_C" >&6
+ if test -c /dev/dlpi; then
+- echo "$ac_t""yes" 1>&6
+- cat >> confdefs.h <<\EOF
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_DEV_DLPI 1
+-EOF
++_ACEOF
+
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ dir="/dev/dlpi"
+- echo $ac_n "checking for $dir directory""... $ac_c" 1>&6
+-echo "configure:1713: checking for $dir directory" >&5
++ echo "$as_me:$LINENO: checking for $dir directory" >&5
++echo $ECHO_N "checking for $dir directory... $ECHO_C" >&6
+ if test -d $dir ; then
+- echo "$ac_t""yes" 1>&6
+- cat >> confdefs.h <<EOF
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++ cat >>confdefs.h <<_ACEOF
+ #define DLPI_DEV_PREFIX "$dir"
+-EOF
++_ACEOF
+
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+ fi
+- echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+-echo "configure:1725: checking for socket in -lsocket" >&5
+-ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++
++echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
++echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
++if test "${ac_cv_lib_socket_socket+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lsocket $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 1733 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char socket();
+-
+-int main() {
+-socket()
+-; return 0; }
+-EOF
+-if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+-
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_lib 1
+-EOF
++ builtin and then its argument prototype would still apply. */
++char socket ();
++int
++main ()
++{
++socket ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_socket_socket=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_socket_socket=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
++echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
++if test $ac_cv_lib_socket_socket = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBSOCKET 1
++_ACEOF
+
+ LIBS="-lsocket $LIBS"
+
+ else
+- echo "$ac_t""no" 1>&6
+-{ echo "configure: error: libsocket not found." 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: libsocket not found." >&5
++echo "$as_me: error: libsocket not found." >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+
+- echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+-echo "configure:1773: checking for gethostbyname in -lnsl" >&5
+-ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++
++echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
++echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
++if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lnsl $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 1781 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char gethostbyname();
+-
+-int main() {
+-gethostbyname()
+-; return 0; }
+-EOF
+-if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+-
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_lib 1
+-EOF
++ builtin and then its argument prototype would still apply. */
++char gethostbyname ();
++int
++main ()
++{
++gethostbyname ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_nsl_gethostbyname=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_nsl_gethostbyname=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
++echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
++if test $ac_cv_lib_nsl_gethostbyname = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBNSL 1
++_ACEOF
+
+ LIBS="-lnsl $LIBS"
+
+ else
+- echo "$ac_t""no" 1>&6
+-{ echo "configure: error: libnsl not found." 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: libnsl not found." >&5
++echo "$as_me: error: libnsl not found." >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+
+
+ case "`uname -r`" in
+ 5.4)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define STUPID_SOLARIS_CHECKSUM_BUG 1
+-EOF
++_ACEOF
+
+ ;;
+ 5.5*)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define STUPID_SOLARIS_CHECKSUM_BUG 1
+-EOF
++_ACEOF
+
+ ;;
+
+@@ -1842,73 +9374,112 @@
+ ;;
+
+ *)
+- echo "configure: warning: apparently your OS is not officially supported yet" 1>&2
+- echo "configure: warning: this may not work" 1>&2
+- echo "$ac_t""you'll have to edit the makefile by hand" 1>&6
+- echo "$ac_t""please send diffs to mike@infonexus.com" 1>&6
++ { echo "$as_me:$LINENO: WARNING: apparently your OS is not officially supported yet" >&5
++echo "$as_me: WARNING: apparently your OS is not officially supported yet" >&2;}
++ { echo "$as_me:$LINENO: WARNING: this may not work" >&5
++echo "$as_me: WARNING: this may not work" >&2;}
++ echo "$as_me:$LINENO: result: you'll have to edit the makefile by hand" >&5
++echo "${ECHO_T}you'll have to edit the makefile by hand" >&6
++ echo "$as_me:$LINENO: result: please send diffs to mike@infonexus.com" >&5
++echo "${ECHO_T}please send diffs to mike@infonexus.com" >&6
+ ;;
+
+ esac
+
+
+- echo $ac_n "checking for libnet_build_ip in -lnet""... $ac_c" 1>&6
+-echo "configure:1856: checking for libnet_build_ip in -lnet" >&5
+-ac_lib_var=`echo net'_'libnet_build_ip | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking for libnet_build_ip in -lnet" >&5
++echo $ECHO_N "checking for libnet_build_ip in -lnet... $ECHO_C" >&6
++if test "${ac_cv_lib_net_libnet_build_ip+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lnet $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 1864 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char libnet_build_ip();
+-
+-int main() {
+-libnet_build_ip()
+-; return 0; }
+-EOF
+-if { (eval echo configure:1875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+-
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- echo $ac_n "checking version""... $ac_c" 1>&6
+-echo "configure:1891: checking version" >&5 \
++ builtin and then its argument prototype would still apply. */
++char libnet_build_ip ();
++int
++main ()
++{
++libnet_build_ip ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_net_libnet_build_ip=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_net_libnet_build_ip=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_net_libnet_build_ip" >&5
++echo "${ECHO_T}$ac_cv_lib_net_libnet_build_ip" >&6
++if test $ac_cv_lib_net_libnet_build_ip = yes; then
++ echo "$as_me:$LINENO: checking version" >&5
++echo $ECHO_N "checking version... $ECHO_C" >&6 \
+
+ if [ ! -f $LIB_PREFIX/libnet.a ] ; then
+- echo "$ac_t""$LIB_PREFIX/libnet.a doesn't exist" 1>&6
+- echo "$ac_t""previous libnet install lives elsewhere" 1>&6
++ echo "$as_me:$LINENO: result: $LIB_PREFIX/libnet.a doesn't exist" >&5
++echo "${ECHO_T}$LIB_PREFIX/libnet.a doesn't exist" >&6
++ echo "$as_me:$LINENO: result: previous libnet install lives elsewhere" >&5
++echo "${ECHO_T}previous libnet install lives elsewhere" >&6
+ else
+ __LIBNET_VERSION=`strings $LIB_PREFIX/libnet.a | grep "libnet version"\
+ | cut -f3 -d" "`;\
+ if test -z "$__LIBNET_VERSION"; then
+- echo "$ac_t""<0.8" 1>&6
++ echo "$as_me:$LINENO: result: <0.8" >&5
++echo "${ECHO_T}<0.8" >&6
+ else
+- echo "$ac_t""$__LIBNET_VERSION" 1>&6
++ echo "$as_me:$LINENO: result: $__LIBNET_VERSION" >&5
++echo "${ECHO_T}$__LIBNET_VERSION" >&6
+ fi
+ fi\
+-
+-else
+- echo "$ac_t""no" 1>&6
++
+ fi
+
+
+-echo $ac_n "checking machine endianess""... $ac_c" 1>&6
+-echo "configure:1912: checking machine endianess" >&5
++echo "$as_me:$LINENO: checking machine endianess" >&5
++echo $ECHO_N "checking machine endianess... $ECHO_C" >&6
++ if test "${ac_cv_libnet_endianess+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
+
+ cat > conftest.c << EOF
+ # include <stdio.h>
+@@ -1957,30 +9528,34 @@
+ ac_cv_libnet_endianess=lil
+ else
+ ac_cv_libnet_endianess=unknown
+- fi
++ fi
+ fi
+ rm -f conftest* core core.conftest
+
+- echo "$ac_t""$ac_cv_libnet_endianess" 1>&6
++
++fi
++
++ echo "$as_me:$LINENO: result: $ac_cv_libnet_endianess" >&5
++echo "${ECHO_T}$ac_cv_libnet_endianess" >&6
+
+ if test $ac_cv_libnet_endianess = big ; then
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_BIG_ENDIAN 1
+-EOF
++_ACEOF
+
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_BIG_ENDIAN"
+ elif test $ac_cv_libnet_endianess = lil ; then
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LIBNET_LIL_ENDIAN 1
+-EOF
++_ACEOF
+
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DLIBNET_LIL_ENDIAN"
+ fi
+-
+-echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6
+-echo "configure:1982: checking if unaligned accesses fail" >&5
+- if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++
++echo "$as_me:$LINENO: checking if unaligned accesses fail" >&5
++echo $ECHO_N "checking if unaligned accesses fail... $ECHO_C" >&6
++ if test "${ac_cv_lbl_unaligned_fail+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ case "$target_cpu" in
+
+@@ -2039,446 +9614,1598 @@
+ esac
+ fi
+
+- echo "$ac_t""$ac_cv_lbl_unaligned_fail" 1>&6
++ echo "$as_me:$LINENO: result: $ac_cv_lbl_unaligned_fail" >&5
++echo "${ECHO_T}$ac_cv_lbl_unaligned_fail" >&6
+ if test $ac_cv_lbl_unaligned_fail = yes ; then
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define LBL_ALIGN 1
+-EOF
++_ACEOF
+
+ fi
+
+
+-for ac_hdr in sys/sockio.h
++
++for ac_header in sys/sockio.h
+ do
+-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:2056: checking for $ac_hdr" >&5
+-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <$ac_header>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
+ else
+- cat > conftest.$ac_ext <<EOF
+-#line 2061 "configure"
+-#include "confdefs.h"
+-#include <$ac_hdr>
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:2066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=yes"
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=no"
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+-rm -f conftest*
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++
+ fi
+-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_hdr 1
+-EOF
+-
+-else
+- echo "$ac_t""no" 1>&6
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
+ fi
++
+ done
+
++ ac_config_headers="$ac_config_headers include/config.h"
+
+-trap '' 1 2 15
+-cat > confcache <<\EOF
++ ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile include/libnet/Makefile libnet-config"
++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. It is not useful on other systems.
+-# If it contains results you don't want to keep, you may remove or edit it.
++# 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.
+ #
+-# By default, configure uses ./config.cache as the cache file,
+-# creating it if it does not exist already. You can give configure
+-# the --cache-file=FILE option to use a different cache file; that is
+-# what configure does when it calls configure scripts in
+-# subdirectories, so they share the cache.
+-# Giving --cache-file=/dev/null disables caching, for debugging configure.
+-# config.status only pays attention to the cache file if you give it the
+-# --recheck option to rerun configure.
++# config.status only pays attention to the cache file if you give it
++# the --recheck option to rerun configure.
+ #
+-EOF
++# `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, don't put newlines in cache variables' values.
+ # 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.
+-(set) 2>&1 |
+- case `(ac_space=' '; set | grep ac_space) 2>&1` in
+- *ac_space=\ *)
+- # `set' does not quote correctly, so add quotes (double-quote substitution
+- # turns \\\\ into \\, and sed turns \\ into \).
+- sed -n \
+- -e "s/'/'\\\\''/g" \
+- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+- ;;
+- *)
+- # `set' quotes correctly as required by POSIX, so do not add quotes.
+- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+- ;;
+- esac >> confcache
+-if cmp -s $cache_file confcache; then
+- :
+-else
++{
++ (set) 2>&1 |
++ case `(ac_space=' '; set | grep ac_space) 2>&1` in
++ *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 \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++} |
++ sed '
++ t clear
++ : clear
++ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
++ t end
++ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
++ : end' >>confcache
++if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+- echo "updating cache $cache_file"
+- cat confcache > $cache_file
++ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
++ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+ fi
+ rm -f confcache
+
+-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+-
+ test "x$prefix" = xNONE && prefix=$ac_default_prefix
+ # Let make expand exec_prefix.
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+-# Any assignment to VPATH causes Sun make to only execute
+-# the first set of double-colon rules, so remove it if not needed.
+-# If there is a colon in the path, we need to keep it.
++# 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[ ]*=[^:]*$/d'
++ ac_vpsub='/^[ ]*VPATH[ ]*=/{
++s/:*\$(srcdir):*/:/;
++s/:*\${srcdir}:*/:/;
++s/:*@srcdir@:*/:/;
++s/^\([^=]*=[ ]*\):*/\1/;
++s/:*$//;
++s/^[^=]*=[ ]*$//;
++}'
+ fi
+
+-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+-
+ DEFS=-DHAVE_CONFIG_H
+
+-# Without the "./", some shells look in PATH for config.status.
+-: ${CONFIG_STATUS=./config.status}
++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_i=`echo "$ac_i" |
++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
++ # 2. Add them.
++ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
++ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
++done
++LIBOBJS=$ac_libobjs
+
+-echo creating $CONFIG_STATUS
+-rm -f $CONFIG_STATUS
+-cat > $CONFIG_STATUS <<EOF
+-#! /bin/sh
+-# Generated automatically by configure.
++LTLIBOBJS=$ac_ltlibobjs
++
++
++if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"AMDEP\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
++ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++: ${CONFIG_STATUS=./config.status}
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files $CONFIG_STATUS"
++{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
++echo "$as_me: creating $CONFIG_STATUS" >&6;}
++cat >$CONFIG_STATUS <<_ACEOF
++#! $SHELL
++# Generated by $as_me.
+ # Run this file to recreate the current configuration.
+-# This directory was configured as follows,
+-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+-#
+-# $0 $ac_configure_args
+-#
+ # Compiler output produced by configure, useful for debugging
+-# configure, is in ./config.log if it exists.
++# configure, is in config.log if it exists.
+
+-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+-for ac_option
++debug=false
++ac_cs_recheck=false
++ac_cs_silent=false
++SHELL=\${CONFIG_SHELL-$SHELL}
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++## --------------------- ##
++## M4sh Initialization. ##
++## --------------------- ##
++
++# Be Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++DUALCASE=1; export DUALCASE # for MKS sh
++
++# Support unset when possible.
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
+ do
+- case "\$ac_option" in
+- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+- echo "$CONFIG_STATUS generated by autoconf version 2.13"
+- exit 0 ;;
+- -help | --help | --hel | --he | --h)
+- echo "\$ac_cs_usage"; exit 0 ;;
+- *) echo "\$ac_cs_usage"; exit 1 ;;
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; 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
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# 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
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ 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
++
++ ;;
+ 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
++ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
++echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
+ done
++;;
++ esac
+
+-ac_given_srcdir=$srcdir
+-ac_given_INSTALL="$INSTALL"
+-
+-trap 'rm -fr `echo "Makefile test/Makefile test/TCP/Makefile test/Ethernet/Makefile \
+- test/UDP/Makefile test/ICMP/Makefile test/Random/Makefile \
+- test/OSPF/Makefile util/Makefile util/Get-mac/Makefile example/Makefile \
+- libnet-config include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+-EOF
+-cat >> $CONFIG_STATUS <<EOF
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
++echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
++ { (exit 1); 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 sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
+
+-# Protect against being on the right side of a sed subst in config.status.
+-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+-$ac_vpsub
+-$extrasub
+-s%@SHELL@%$SHELL%g
+-s%@CFLAGS@%$CFLAGS%g
+-s%@CPPFLAGS@%$CPPFLAGS%g
+-s%@CXXFLAGS@%$CXXFLAGS%g
+-s%@FFLAGS@%$FFLAGS%g
+-s%@DEFS@%$DEFS%g
+-s%@LDFLAGS@%$LDFLAGS%g
+-s%@LIBS@%$LIBS%g
+-s%@exec_prefix@%$exec_prefix%g
+-s%@prefix@%$prefix%g
+-s%@program_transform_name@%$program_transform_name%g
+-s%@bindir@%$bindir%g
+-s%@sbindir@%$sbindir%g
+-s%@libexecdir@%$libexecdir%g
+-s%@datadir@%$datadir%g
+-s%@sysconfdir@%$sysconfdir%g
+-s%@sharedstatedir@%$sharedstatedir%g
+-s%@localstatedir@%$localstatedir%g
+-s%@libdir@%$libdir%g
+-s%@includedir@%$includedir%g
+-s%@oldincludedir@%$oldincludedir%g
+-s%@infodir@%$infodir%g
+-s%@mandir@%$mandir%g
+-s%@LL_INT_TYPE_UC@%$LL_INT_TYPE_UC%g
+-s%@LL_INT_TYPE@%$LL_INT_TYPE%g
+-s%@LIB_PREFIX@%$LIB_PREFIX%g
+-s%@INC_PREFIX@%$INC_PREFIX%g
+-s%@MAN_PREFIX@%$MAN_PREFIX%g
+-s%@BIN_PREFIX@%$BIN_PREFIX%g
+-s%@RANLIB@%$RANLIB%g
+-s%@AR@%$AR%g
+-s%@LN@%$LN%g
+-s%@ADDITIONAL_LIBS@%$ADDITIONAL_LIBS%g
+-s%@LIBNET_CONFIG_DEFINES@%$LIBNET_CONFIG_DEFINES%g
+-s%@LIBNET_CONFIG_LIBS@%$LIBNET_CONFIG_LIBS%g
+-s%@LIBNET_CONFIG_CFLAGS@%$LIBNET_CONFIG_CFLAGS%g
+-s%@host@%$host%g
+-s%@host_alias@%$host_alias%g
+-s%@host_cpu@%$host_cpu%g
+-s%@host_vendor@%$host_vendor%g
+-s%@host_os@%$host_os%g
+-s%@target@%$target%g
+-s%@target_alias@%$target_alias%g
+-s%@target_cpu@%$target_cpu%g
+-s%@target_vendor@%$target_vendor%g
+-s%@target_os@%$target_os%g
+-s%@build@%$build%g
+-s%@build_alias@%$build_alias%g
+-s%@build_cpu@%$build_cpu%g
+-s%@build_vendor@%$build_vendor%g
+-s%@build_os@%$build_os%g
+-s%@CC@%$CC%g
+-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+-s%@INSTALL_DATA@%$INSTALL_DATA%g
+-s%@SET_MAKE@%$SET_MAKE%g
+-s%@CPP@%$CPP%g
+
+-CEOF
+-EOF
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
+
+-cat >> $CONFIG_STATUS <<\EOF
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
+
+-# Split the substitutions into bite-sized pieces for seds with
+-# small command number limits, like on Digital OSF/1 and HP-UX.
+-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+-ac_file=1 # Number of current file.
+-ac_beg=1 # First line for current file.
+-ac_end=$ac_max_sed_cmds # Line after last line for current file.
+-ac_more_lines=:
+-ac_sed_cmds=""
+-while $ac_more_lines; do
+- if test $ac_beg -gt 1; then
+- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+- else
+- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+- fi
+- if test ! -s conftest.s$ac_file; then
+- ac_more_lines=false
+- rm -f conftest.s$ac_file
+- else
+- if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds="sed -f conftest.s$ac_file"
+- else
+- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+- fi
+- ac_file=`expr $ac_file + 1`
+- ac_beg=$ac_end
+- ac_end=`expr $ac_end + $ac_max_sed_cmds`
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
++ else
++ as_ln_s='ln -s'
+ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ test -d ./-p && rmdir ./-p
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# 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'"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++exec 6>&1
++
++# Open the log real soon, to keep \$[0] and so on meaningful, and to
++# report actual input values of CONFIG_FILES etc. instead of their
++# values after options handling. Logging --version etc. is OK.
++exec 5>>config.log
++{
++ echo
++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
++## Running $as_me. ##
++_ASBOX
++} >&5
++cat >&5 <<_CSEOF
++
++This file was extended by $as_me, which was
++generated by GNU Autoconf 2.59. Invocation command line was
++
++ CONFIG_FILES = $CONFIG_FILES
++ CONFIG_HEADERS = $CONFIG_HEADERS
++ CONFIG_LINKS = $CONFIG_LINKS
++ CONFIG_COMMANDS = $CONFIG_COMMANDS
++ $ $0 $@
++
++_CSEOF
++echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
++echo >&5
++_ACEOF
++
++# Files that config.status was made for.
++if test -n "$ac_config_files"; then
++ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_headers"; then
++ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_links"; then
++ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_commands"; then
++ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
++fi
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++ac_cs_usage="\
++\`$as_me' instantiates files from templates according to the
++current configuration.
++
++Usage: $0 [OPTIONS] [FILE]...
++
++ -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
++ --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 <bug-autoconf@gnu.org>."
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++ac_cs_version="\\
++config.status
++configured by $0, generated by GNU Autoconf 2.59,
++ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
++
++Copyright (C) 2003 Free Software Foundation, Inc.
++This config.status script is free software; the Free Software Foundation
++gives unlimited permission to copy, distribute and modify it."
++srcdir=$srcdir
++INSTALL="$INSTALL"
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++# If no file are specified by the user, then we need to provide default
++# value. By we need to know if files were specified by the user.
++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
++ ;;
++ *) # This is not an option, so the user has probably given explicit
++ # arguments.
++ ac_option=$1
++ ac_need_defaults=false;;
++ esac
++
++ case $ac_option in
++ # Handling of the options.
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ ac_cs_recheck=: ;;
++ --version | --vers* | -V )
++ echo "$ac_cs_version"; exit 0 ;;
++ --he | --h)
++ # Conflict between --help and --header
++ { { echo "$as_me:$LINENO: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; };;
++ --help | --hel | -h )
++ echo "$ac_cs_usage"; exit 0 ;;
++ --debug | --d* | -d )
++ debug=: ;;
++ --file | --fil | --fi | --f )
++ $ac_shift
++ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
++ ac_need_defaults=false;;
++ --header | --heade | --head | --hea )
++ $ac_shift
++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
++ ac_need_defaults=false;;
++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++ | -silent | --silent | --silen | --sile | --sil | --si | --s)
++ ac_cs_silent=: ;;
++
++ # This is an error.
++ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; } ;;
++
++ *) ac_config_targets="$ac_config_targets $1" ;;
++
++ esac
++ shift
+ done
+-if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds=cat
++
++ac_configure_extra_args=
++
++if $ac_cs_silent; then
++ exec 6>/dev/null
++ ac_configure_extra_args="$ac_configure_extra_args --silent"
+ fi
+-EOF
+
+-cat >> $CONFIG_STATUS <<EOF
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF
++if \$ac_cs_recheck; then
++ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
++ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
++fi
+
+-CONFIG_FILES=\${CONFIG_FILES-"Makefile test/Makefile test/TCP/Makefile test/Ethernet/Makefile \
+- test/UDP/Makefile test/ICMP/Makefile test/Random/Makefile \
+- test/OSPF/Makefile util/Makefile util/Get-mac/Makefile example/Makefile \
+- libnet-config"}
+-EOF
+-cat >> $CONFIG_STATUS <<\EOF
+-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++#
++# INIT-COMMANDS section.
++#
++
++AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
++
++_ACEOF
++
++
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_config_target in $ac_config_targets
++do
++ case "$ac_config_target" in
++ # Handling of arguments.
++ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
++ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
++ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
++ "include/libnet/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/libnet/Makefile" ;;
++ "libnet-config" ) CONFIG_FILES="$CONFIG_FILES libnet-config" ;;
++ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
++ "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
++echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
++ { (exit 1); exit 1; }; };;
++ 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 to put it here, and in addition,
++# creating and moving files from /tmp can sometimes cause problems.
++# Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++
++{
++ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=./confstat$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in ." >&2
++ { (exit 1); exit 1; }
++}
++
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++
++#
++# CONFIG_FILES section.
++#
++
++# No need to generate the scripts if there are no CONFIG_FILES.
++# This happens for instance when ./config.status config.h
++if test -n "\$CONFIG_FILES"; then
++ # Protect against being on the right side of a sed subst in config.status.
++ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
++ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
++s,@SHELL@,$SHELL,;t t
++s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
++s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
++s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
++s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
++s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
++s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
++s,@exec_prefix@,$exec_prefix,;t t
++s,@prefix@,$prefix,;t t
++s,@program_transform_name@,$program_transform_name,;t t
++s,@bindir@,$bindir,;t t
++s,@sbindir@,$sbindir,;t t
++s,@libexecdir@,$libexecdir,;t t
++s,@datadir@,$datadir,;t t
++s,@sysconfdir@,$sysconfdir,;t t
++s,@sharedstatedir@,$sharedstatedir,;t t
++s,@localstatedir@,$localstatedir,;t t
++s,@libdir@,$libdir,;t t
++s,@includedir@,$includedir,;t t
++s,@oldincludedir@,$oldincludedir,;t t
++s,@infodir@,$infodir,;t t
++s,@mandir@,$mandir,;t t
++s,@build_alias@,$build_alias,;t t
++s,@host_alias@,$host_alias,;t t
++s,@target_alias@,$target_alias,;t t
++s,@DEFS@,$DEFS,;t t
++s,@ECHO_C@,$ECHO_C,;t t
++s,@ECHO_N@,$ECHO_N,;t t
++s,@ECHO_T@,$ECHO_T,;t t
++s,@LIBS@,$LIBS,;t t
++s,@build@,$build,;t t
++s,@build_cpu@,$build_cpu,;t t
++s,@build_vendor@,$build_vendor,;t t
++s,@build_os@,$build_os,;t t
++s,@host@,$host,;t t
++s,@host_cpu@,$host_cpu,;t t
++s,@host_vendor@,$host_vendor,;t t
++s,@host_os@,$host_os,;t t
++s,@target@,$target,;t t
++s,@target_cpu@,$target_cpu,;t t
++s,@target_vendor@,$target_vendor,;t t
++s,@target_os@,$target_os,;t t
++s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
++s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
++s,@INSTALL_DATA@,$INSTALL_DATA,;t t
++s,@CYGPATH_W@,$CYGPATH_W,;t t
++s,@PACKAGE@,$PACKAGE,;t t
++s,@VERSION@,$VERSION,;t t
++s,@ACLOCAL@,$ACLOCAL,;t t
++s,@AUTOCONF@,$AUTOCONF,;t t
++s,@AUTOMAKE@,$AUTOMAKE,;t t
++s,@AUTOHEADER@,$AUTOHEADER,;t t
++s,@MAKEINFO@,$MAKEINFO,;t t
++s,@AMTAR@,$AMTAR,;t t
++s,@install_sh@,$install_sh,;t t
++s,@STRIP@,$STRIP,;t t
++s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
++s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
++s,@mkdir_p@,$mkdir_p,;t t
++s,@AWK@,$AWK,;t t
++s,@SET_MAKE@,$SET_MAKE,;t t
++s,@am__leading_dot@,$am__leading_dot,;t t
++s,@LL_INT_TYPE_UC@,$LL_INT_TYPE_UC,;t t
++s,@LL_INT_TYPE@,$LL_INT_TYPE,;t t
++s,@LIB_PREFIX@,$LIB_PREFIX,;t t
++s,@INC_PREFIX@,$INC_PREFIX,;t t
++s,@MAN_PREFIX@,$MAN_PREFIX,;t t
++s,@BIN_PREFIX@,$BIN_PREFIX,;t t
++s,@RANLIB@,$RANLIB,;t t
++s,@AR@,$AR,;t t
++s,@LN@,$LN,;t t
++s,@ADDITIONAL_LIBS@,$ADDITIONAL_LIBS,;t t
++s,@LIBNET_CONFIG_DEFINES@,$LIBNET_CONFIG_DEFINES,;t t
++s,@LIBNET_CONFIG_LIBS@,$LIBNET_CONFIG_LIBS,;t t
++s,@LIBNET_CONFIG_CFLAGS@,$LIBNET_CONFIG_CFLAGS,;t t
++s,@CC@,$CC,;t t
++s,@CFLAGS@,$CFLAGS,;t t
++s,@LDFLAGS@,$LDFLAGS,;t t
++s,@CPPFLAGS@,$CPPFLAGS,;t t
++s,@ac_ct_CC@,$ac_ct_CC,;t t
++s,@EXEEXT@,$EXEEXT,;t t
++s,@OBJEXT@,$OBJEXT,;t t
++s,@DEPDIR@,$DEPDIR,;t t
++s,@am__include@,$am__include,;t t
++s,@am__quote@,$am__quote,;t t
++s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
++s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
++s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
++s,@CCDEPMODE@,$CCDEPMODE,;t t
++s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
++s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
++s,@LN_S@,$LN_S,;t t
++s,@ECHO@,$ECHO,;t t
++s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
++s,@CPP@,$CPP,;t t
++s,@EGREP@,$EGREP,;t t
++s,@LIBTOOL@,$LIBTOOL,;t t
++s,@LIBOBJS@,$LIBOBJS,;t t
++s,@LTLIBOBJS@,$LTLIBOBJS,;t t
++CEOF
++
++_ACEOF
++
++ cat >>$CONFIG_STATUS <<\_ACEOF
++ # Split the substitutions into bite-sized pieces for seds with
++ # small command number limits, like on Digital OSF/1 and HP-UX.
++ ac_max_sed_lines=48
++ ac_sed_frag=1 # Number of current file.
++ ac_beg=1 # First line for current file.
++ ac_end=$ac_max_sed_lines # Line after last line for current file.
++ ac_more_lines=:
++ ac_sed_cmds=
++ while $ac_more_lines; do
++ if test $ac_beg -gt 1; then
++ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ else
++ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ fi
++ if test ! -s $tmp/subs.frag; then
++ ac_more_lines=false
++ else
++ # The purpose of the label and of the branching condition is to
++ # speed up the sed processing (if there are no `@' at all, there
++ # is no need to browse any of the substitutions).
++ # These are the two extra sed commands mentioned above.
++ (echo ':t
++ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
++ else
++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
++ fi
++ ac_sed_frag=`expr $ac_sed_frag + 1`
++ ac_beg=$ac_end
++ ac_end=`expr $ac_end + $ac_max_sed_lines`
++ fi
++ done
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds=cat
++ fi
++fi # test -n "$CONFIG_FILES"
++
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+- case "$ac_file" in
+- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+- *) ac_file_in="${ac_file}.in" ;;
+- esac
+-
+- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+-
+- # Remove last slash and all that follows it. Not all systems have dirname.
+- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+- # The file is in a subdirectory.
+- test ! -d "$ac_dir" && mkdir "$ac_dir"
+- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+- # A "../" for each directory in $ac_dir_suffix.
+- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+- else
+- ac_dir_suffix= ac_dots=
+- fi
+-
+- case "$ac_given_srcdir" in
+- .) srcdir=.
+- if test -z "$ac_dots"; then top_srcdir=.
+- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
++ case $ac_file in
++ - | *:- | *:-:* ) # input from stdin
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ * ) ac_file_in=$ac_file.in ;;
++ esac
++
++ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
++ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+- top_srcdir="$ac_dots$ac_given_srcdir" ;;
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++
++ case $INSTALL in
++ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
++ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+- case "$ac_given_INSTALL" in
+- [/$]*) INSTALL="$ac_given_INSTALL" ;;
+- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+- esac
+-
+- echo creating "$ac_file"
+- rm -f "$ac_file"
+- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+- case "$ac_file" in
+- *Makefile*) ac_comsub="1i\\
+-# $configure_input" ;;
+- *) ac_comsub= ;;
+- esac
+-
+- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+- sed -e "$ac_comsub
+-s%@configure_input@%$configure_input%g
+-s%@srcdir@%$srcdir%g
+-s%@top_srcdir@%$top_srcdir%g
+-s%@INSTALL@%$INSTALL%g
+-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+-fi; done
+-rm -f conftest.s*
++ # 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. */
++ if test x"$ac_file" = x-; then
++ configure_input=
++ else
++ configure_input="$ac_file. "
++ fi
++ configure_input=$configure_input"Generated from `echo $ac_file_in |
++ sed 's,.*/,,'` by configure."
++
++ # First look for the input files in the build tree, otherwise in the
++ # src tree.
++ ac_file_inputs=`IFS=:
++ for f in $ac_file_in; do
++ case $f in
++ -) echo $tmp/stdin ;;
++ [\\/$]*)
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ echo "$f";;
++ *) # Relative
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ fi;;
++ esac
++ done` || { (exit 1); exit 1; }
++
++ if test x"$ac_file" != x-; then
++ { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++ rm -f "$ac_file"
++ fi
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF
++ sed "$ac_vpsub
++$extrasub
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++:t
++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
++s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t
++s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
++s,@INSTALL@,$ac_INSTALL,;t t
++" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
++ rm -f $tmp/stdin
++ if test x"$ac_file" != x-; then
++ mv $tmp/out $ac_file
++ else
++ cat $tmp/out
++ rm -f $tmp/out
++ fi
++
++done
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++#
++# CONFIG_HEADER section.
++#
+
+ # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+ # NAME is the cpp macro being defined and VALUE is the value it is being given.
+ #
+ # ac_d sets the value in "#define NAME VALUE" lines.
+-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+-ac_dC='\3'
+-ac_dD='%g'
+-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+-ac_uB='\([ ]\)%\1#\2define\3'
++ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
++ac_dB='[ ].*$,\1#\2'
++ac_dC=' '
++ac_dD=',;t'
++# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
++ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
++ac_uB='$,\1#\2define\3'
+ ac_uC=' '
+-ac_uD='\4%g'
+-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+-ac_eB='$%\1#\2define\3'
+-ac_eC=' '
+-ac_eD='%g'
++ac_uD=',;t'
+
+-if test "${CONFIG_HEADERS+set}" != set; then
+-EOF
+-cat >> $CONFIG_STATUS <<EOF
+- CONFIG_HEADERS="include/config.h"
+-EOF
+-cat >> $CONFIG_STATUS <<\EOF
+-fi
+-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
++for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+- case "$ac_file" in
+- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+- *) ac_file_in="${ac_file}.in" ;;
++ case $ac_file in
++ - | *:- | *:-:* ) # input from stdin
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+- echo creating $ac_file
+-
+- rm -f conftest.frag conftest.in conftest.out
+- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+- cat $ac_file_inputs > conftest.in
+-
+-EOF
++ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
+
+-# Transform confdefs.h into a sed script conftest.vals that substitutes
+-# the proper values into config.h.in to produce config.h. And first:
+-# Protect against being on the right side of a sed subst in config.status.
+-# Protect against being in an unquoted here document in config.status.
+-rm -f conftest.vals
+-cat > conftest.hdr <<\EOF
+-s/[\\&%]/\\&/g
+-s%[\\$`]%\\&%g
+-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+-s%ac_d%ac_u%gp
+-s%ac_u%ac_e%gp
+-EOF
+-sed -n -f conftest.hdr confdefs.h > conftest.vals
+-rm -f conftest.hdr
++ # First look for the input files in the build tree, otherwise in the
++ # src tree.
++ ac_file_inputs=`IFS=:
++ for f in $ac_file_in; do
++ case $f in
++ -) echo $tmp/stdin ;;
++ [\\/$]*)
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ # Do quote $f, to prevent DOS paths from being IFS'd.
++ echo "$f";;
++ *) # Relative
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ fi;;
++ esac
++ done` || { (exit 1); exit 1; }
++ # Remove the trailing spaces.
++ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
++
++_ACEOF
++
++# Transform confdefs.h into two sed scripts, `conftest.defines' and
++# `conftest.undefs', that substitutes the proper values into
++# config.h.in to produce config.h. The first handles `#define'
++# templates, and the second `#undef' templates.
++# And first: Protect against being on the right side of a sed subst in
++# config.status. Protect against being in an unquoted here document
++# in config.status.
++rm -f conftest.defines conftest.undefs
++# Using a here document instead of a string reduces the quoting nightmare.
++# Putting comments in sed scripts is not portable.
++#
++# `end' is used to avoid that the second main sed command (meant for
++# 0-ary CPP macros) applies to n-ary macro definitions.
++# See the Autoconf documentation for `clear'.
++cat >confdef2sed.sed <<\_ACEOF
++s/[\\&,]/\\&/g
++s,[\\$`],\\&,g
++t clear
++: clear
++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
++t end
++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
++: end
++_ACEOF
++# If some macros were called several times there might be several times
++# the same #defines, which is useless. Nevertheless, we may not want to
++# sort them, since we want the *last* AC-DEFINE to be honored.
++uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
++sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
++rm -f confdef2sed.sed
+
+ # This sed command replaces #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.
+-cat >> conftest.vals <<\EOF
+-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+-EOF
+-
+-# Break up conftest.vals because some shells have a limit on
+-# the size of here documents, and old seds have small limits too.
+-
++cat >>conftest.undefs <<\_ACEOF
++s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
++_ACEOF
++
++# Break up conftest.defines because some shells have a limit on the size
++# of here documents, and old seds have small limits too (100 cmds).
++echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
++echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
++echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
++echo ' :' >>$CONFIG_STATUS
++rm -f conftest.tail
++while grep . conftest.defines >/dev/null
++do
++ # Write a limited-size here document to $tmp/defines.sed.
++ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
++ # Speed up: don't consider the non `#define' lines.
++ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
++ # Work around the forget-to-reset-the-flag bug.
++ echo 't clr' >>$CONFIG_STATUS
++ echo ': clr' >>$CONFIG_STATUS
++ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
++ echo 'CEOF
++ sed -f $tmp/defines.sed $tmp/in >$tmp/out
++ rm -f $tmp/in
++ mv $tmp/out $tmp/in
++' >>$CONFIG_STATUS
++ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
++ rm -f conftest.defines
++ mv conftest.tail conftest.defines
++done
++rm -f conftest.defines
++echo ' fi # grep' >>$CONFIG_STATUS
++echo >>$CONFIG_STATUS
++
++# Break up conftest.undefs because some shells have a limit on the size
++# of here documents, and old seds have small limits too (100 cmds).
++echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+ rm -f conftest.tail
+-while :
++while grep . conftest.undefs >/dev/null
+ do
+- ac_lines=`grep -c . conftest.vals`
+- # grep -c gives empty output for an empty file on some AIX systems.
+- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+- # Write a limited-size here document to conftest.frag.
+- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
++ # Write a limited-size here document to $tmp/undefs.sed.
++ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
++ # Speed up: don't consider the non `#undef'
++ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
++ # Work around the forget-to-reset-the-flag bug.
++ echo 't clr' >>$CONFIG_STATUS
++ echo ': clr' >>$CONFIG_STATUS
++ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+- sed -f conftest.frag conftest.in > conftest.out
+- rm -f conftest.in
+- mv conftest.out conftest.in
+-' >> $CONFIG_STATUS
+- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+- rm -f conftest.vals
+- mv conftest.tail conftest.vals
+-done
+-rm -f conftest.vals
+-
+-cat >> $CONFIG_STATUS <<\EOF
+- rm -f conftest.frag conftest.h
+- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+- cat conftest.in >> conftest.h
+- rm -f conftest.in
+- if cmp -s $ac_file conftest.h 2>/dev/null; then
+- echo "$ac_file is unchanged"
+- rm -f conftest.h
+- else
+- # Remove last slash and all that follows it. Not all systems have dirname.
+- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+- # The file is in a subdirectory.
+- test ! -d "$ac_dir" && mkdir "$ac_dir"
++ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
++ rm -f $tmp/in
++ mv $tmp/out $tmp/in
++' >>$CONFIG_STATUS
++ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
++ rm -f conftest.undefs
++ mv conftest.tail conftest.undefs
++done
++rm -f conftest.undefs
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++ # 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. */
++ if test x"$ac_file" = x-; then
++ echo "/* Generated by configure. */" >$tmp/config.h
++ else
++ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
++ fi
++ cat $tmp/in >>$tmp/config.h
++ rm -f $tmp/in
++ if test x"$ac_file" != x-; then
++ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
++ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
++echo "$as_me: $ac_file is unchanged" >&6;}
++ else
++ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ rm -f $ac_file
++ mv $tmp/config.h $ac_file
+ fi
+- rm -f $ac_file
+- mv conftest.h $ac_file
++ else
++ cat $tmp/config.h
++ rm -f $tmp/config.h
+ fi
+-fi; done
++# Compute $ac_file's index in $config_headers.
++_am_stamp_count=1
++for _am_header in $config_headers :; do
++ case $_am_header in
++ $ac_file | $ac_file:* )
++ break ;;
++ * )
++ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
++ esac
++done
++echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
++$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X$ac_file : 'X\(//\)[^/]' \| \
++ X$ac_file : 'X\(//\)$' \| \
++ X$ac_file : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X$ac_file |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`/stamp-h$_am_stamp_count
++done
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
+
+-EOF
+-cat >> $CONFIG_STATUS <<EOF
++#
++# CONFIG_COMMANDS section.
++#
++for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
++ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
++ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
++$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_dest" : 'X\(//\)[^/]' \| \
++ X"$ac_dest" : 'X\(//\)$' \| \
++ X"$ac_dest" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_dest" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
+
+-EOF
+-cat >> $CONFIG_STATUS <<\EOF
+-chmod +x libnet-config
+-exit 0
+-EOF
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++
++ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
++echo "$as_me: executing $ac_dest commands" >&6;}
++ case $ac_dest in
++ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; 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.
++ # So let's grep whole file.
++ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
++ dirpart=`(dirname "$mf") 2>/dev/null ||
++$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$mf" : 'X\(//\)[^/]' \| \
++ X"$mf" : 'X\(//\)$' \| \
++ X"$mf" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++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
++ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
++ # Extract the definition of DEP_FILES from the Makefile without
++ # running `make'.
++ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
++ test -z "$DEPDIR" && continue
++ # When using ansi2knr, U may be empty or an underscore; expand it
++ U=`sed -n 's/^U = //p' < "$mf"`
++ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
++ # 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 '
++ /^DEP_FILES = .*\\\\$/ {
++ s/^DEP_FILES = //
++ :loop
++ s/\\\\$//
++ p
++ n
++ /\\\\$/ b loop
++ p
++ }
++ /^DEP_FILES = / s/^DEP_FILES = //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=`(dirname "$file") 2>/dev/null ||
++$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$file" : 'X\(//\)[^/]' \| \
++ X"$file" : 'X\(//\)$' \| \
++ X"$file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p $dirpart/$fdir
++ else
++ as_dir=$dirpart/$fdir
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
++echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ # echo "creating $dirpart/$file"
++ echo '# dummy' > "$dirpart/$file"
++ done
++done
++ ;;
++ esac
++done
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++{ (exit 0); exit 0; }
++_ACEOF
+ chmod +x $CONFIG_STATUS
+-rm -fr confdefs* $ac_clean_files
+-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
++ac_clean_files=$ac_clean_files_save
++
++
++# 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 || { (exit 1); exit 1; }
++fi
+
+
+diff -ruN libnet-1.0.2a-orig/configure.in libnet-1.0.2a-7/configure.in
+--- libnet-1.0.2a-orig/configure.in 2001-01-17 21:59:30.000000000 +0100
++++ libnet-1.0.2a-7/configure.in 2005-03-08 03:53:26.000000000 +0100
+@@ -8,6 +8,14 @@
+
+ AC_INIT(src/libnet_build_ip.c)
+
++dnl
++dnl Determine hosttype and set the root install directory.
++dnl
++AC_CANONICAL_SYSTEM
++AC_PREFIX_DEFAULT(/usr)
++
++AM_INIT_AUTOMAKE(libnet, 1.0.2a)
++
+ VER=`cat VERSION`
+ AC_MSG_RESULT(Beginning autoconfiguration process for libnet-$VER...)
+
+@@ -25,16 +33,14 @@
+ AC_SUBST(LIBNET_CONFIG_LIBS)
+ AC_SUBST(LIBNET_CONFIG_CFLAGS)
+
+-dnl
+-dnl Determine hosttype and set the root install directory.
+-dnl
+-AC_CANONICAL_SYSTEM
+-AC_PREFIX_DEFAULT(/usr)
+-
+ if test "$prefix" = "NONE"; then
+ prefix="/usr"
+ fi
+
++if test "$mandir" = "NONE"; then
++ mandir="$prefix/man"
++fi
++
+ dnl
+ dnl Check compiler type.
+ dnl
+@@ -74,6 +80,8 @@
+ AC_CHECK_PROGS(AR, ar, @true)
+ AC_CHECK_PROGS(LN, ln, @true)
+
++AC_PROG_LIBTOOL
++
+ dnl
+ dnl Check for library functions.
+ dnl
+@@ -110,7 +118,7 @@
+ AC_DEFINE(HAVE_DLPI)
+ elif test -r /usr/include/linux/socket.h ; then
+ LL_INT_TYPE=sockpacket
+- AC_MSG_RESULT(found SOCK_PACKET)
++ AC_MSG_RESULT(found linux primitives)
+ if test $with_pf_packet = yes; then
+ AC_LIBNET_CHECK_PF_PACKET
+ fi
+@@ -147,7 +155,7 @@
+ LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD"
+ AC_CHECK_HEADERS(net/ethernet.h, \
+ LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H")
+- MAN_PREFIX="$prefix/man/man3/"
++ MAN_PREFIX="$mandir/man3/"
+ LIB_PREFIX="$prefix/lib/"
+ INC_PREFIX="$prefix/include/"
+ BIN_PREFIX="$prefix/bin/"
+@@ -258,9 +266,11 @@
+
+ AC_CHECK_HEADERS(sys/sockio.h)
+ AC_CONFIG_HEADER(include/config.h)
+-AC_OUTPUT(Makefile test/Makefile test/TCP/Makefile test/Ethernet/Makefile \
+- test/UDP/Makefile test/ICMP/Makefile test/Random/Makefile \
+- test/OSPF/Makefile util/Makefile util/Get-mac/Makefile example/Makefile \
+- libnet-config, chmod +x libnet-config)
++AC_OUTPUT( \
++ Makefile \
++ src/Makefile \
++ include/Makefile \
++ include/libnet/Makefile \
++ libnet-config)
+
+ dnl EOF
+diff -ruN libnet-1.0.2a-orig/include/Makefile.am libnet-1.0.2a-7/include/Makefile.am
+--- libnet-1.0.2a-orig/include/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/include/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5 @@
++include $(top_srcdir)/Makefile.am.common
++
++SUBDIRS = libnet
++
++include_HEADERS = libnet.h
+diff -ruN libnet-1.0.2a-orig/include/Makefile.in libnet-1.0.2a-7/include/Makefile.in
+--- libnet-1.0.2a-orig/include/Makefile.in 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/include/Makefile.in 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,509 @@
++# Makefile.in generated by automake 1.8.5 from Makefile.am.
++# @configure_input@
++
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004 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@
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++pkgdatadir = $(datadir)/@PACKAGE@
++pkglibdir = $(libdir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@
++top_builddir = ..
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++INSTALL = @INSTALL@
++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@
++DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
++ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
++ $(top_srcdir)/Makefile.am.common
++subdir = include
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
++ $(top_srcdir)/configure.in
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++ $(ACLOCAL_M4)
++mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
++CONFIG_HEADER = config.h
++CONFIG_CLEAN_FILES =
++depcomp =
++am__depfiles_maybe =
++SOURCES =
++DIST_SOURCES =
++RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
++ html-recursive info-recursive install-data-recursive \
++ install-exec-recursive install-info-recursive \
++ install-recursive installcheck-recursive installdirs-recursive \
++ pdf-recursive ps-recursive uninstall-info-recursive \
++ uninstall-recursive
++am__installdirs = "$(DESTDIR)$(includedir)"
++includeHEADERS_INSTALL = $(INSTALL_HEADER)
++HEADERS = $(include_HEADERS)
++ETAGS = etags
++CTAGS = ctags
++DIST_SUBDIRS = $(SUBDIRS)
++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
++ACLOCAL = @ACLOCAL@
++ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
++AMDEP_FALSE = @AMDEP_FALSE@
++AMDEP_TRUE = @AMDEP_TRUE@
++AMTAR = @AMTAR@
++AR = @AR@
++AUTOCONF = @AUTOCONF@
++AUTOHEADER = @AUTOHEADER@
++AUTOMAKE = @AUTOMAKE@
++AWK = @AWK@
++BIN_PREFIX = @BIN_PREFIX@
++CC = @CC@
++CCDEPMODE = @CCDEPMODE@
++CFLAGS = @CFLAGS@
++CPP = @CPP@
++CPPFLAGS = @CPPFLAGS@
++CYGPATH_W = @CYGPATH_W@
++DEFS = @DEFS@
++DEPDIR = @DEPDIR@
++ECHO = @ECHO@
++ECHO_C = @ECHO_C@
++ECHO_N = @ECHO_N@
++ECHO_T = @ECHO_T@
++EGREP = @EGREP@
++EXEEXT = @EXEEXT@
++INC_PREFIX = @INC_PREFIX@
++INSTALL_DATA = @INSTALL_DATA@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
++LDFLAGS = @LDFLAGS@
++LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
++LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
++LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
++LIBOBJS = @LIBOBJS@
++LIBS = @LIBS@
++LIBTOOL = @LIBTOOL@
++LIB_PREFIX = @LIB_PREFIX@
++LL_INT_TYPE = @LL_INT_TYPE@
++LL_INT_TYPE_UC = @LL_INT_TYPE_UC@
++LN = @LN@
++LN_S = @LN_S@
++LTLIBOBJS = @LTLIBOBJS@
++MAKEINFO = @MAKEINFO@
++MAN_PREFIX = @MAN_PREFIX@
++OBJEXT = @OBJEXT@
++PACKAGE = @PACKAGE@
++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
++PACKAGE_NAME = @PACKAGE_NAME@
++PACKAGE_STRING = @PACKAGE_STRING@
++PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_VERSION = @PACKAGE_VERSION@
++PATH_SEPARATOR = @PATH_SEPARATOR@
++RANLIB = @RANLIB@
++SET_MAKE = @SET_MAKE@
++SHELL = @SHELL@
++STRIP = @STRIP@
++VERSION = @VERSION@
++ac_ct_CC = @ac_ct_CC@
++ac_ct_RANLIB = @ac_ct_RANLIB@
++ac_ct_STRIP = @ac_ct_STRIP@
++am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
++am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
++am__include = @am__include@
++am__leading_dot = @am__leading_dot@
++am__quote = @am__quote@
++bindir = @bindir@
++build = @build@
++build_alias = @build_alias@
++build_cpu = @build_cpu@
++build_os = @build_os@
++build_vendor = @build_vendor@
++datadir = @datadir@
++exec_prefix = @exec_prefix@
++host = @host@
++host_alias = @host_alias@
++host_cpu = @host_cpu@
++host_os = @host_os@
++host_vendor = @host_vendor@
++includedir = @includedir@
++infodir = @infodir@
++install_sh = @install_sh@
++libdir = @libdir@
++libexecdir = @libexecdir@
++localstatedir = @localstatedir@
++mandir = @mandir@
++mkdir_p = @mkdir_p@
++oldincludedir = @oldincludedir@
++prefix = @prefix@
++program_transform_name = @program_transform_name@
++sbindir = @sbindir@
++sharedstatedir = @sharedstatedir@
++sysconfdir = @sysconfdir@
++target = @target@
++target_alias = @target_alias@
++target_cpu = @target_cpu@
++target_os = @target_os@
++target_vendor = @target_vendor@
++AUTOMAKE_OPTIONS = foreign no-dependencies
++DISTCLEANFILES = *~
++SUBDIRS = libnet
++include_HEADERS = libnet.h
++all: config.h
++ $(MAKE) $(AM_MAKEFLAGS) all-recursive
++
++.SUFFIXES:
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(am__configure_deps)
++ @for dep in $?; do \
++ case '$(am__configure_deps)' in \
++ *$$dep*) \
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
++ && exit 0; \
++ exit 1;; \
++ esac; \
++ done; \
++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
++ cd $(top_srcdir) && \
++ $(AUTOMAKE) --foreign include/Makefile
++.PRECIOUS: Makefile
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++ @case '$?' in \
++ *config.status*) \
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
++ *) \
++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
++ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
++ esac;
++
++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++
++$(top_srcdir)/configure: $(am__configure_deps)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++$(ACLOCAL_M4): $(am__aclocal_m4_deps)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++
++config.h: stamp-h1
++ @if test ! -f $@; then \
++ rm -f stamp-h1; \
++ $(MAKE) stamp-h1; \
++ else :; fi
++
++stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
++ @rm -f stamp-h1
++ cd $(top_builddir) && $(SHELL) ./config.status include/config.h
++$(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h
++ cd $(top_srcdir) && $(AUTOHEADER)
++ rm -f stamp-h1
++ touch $@
++
++distclean-hdr:
++ -rm -f config.h stamp-h1
++
++mostlyclean-libtool:
++ -rm -f *.lo
++
++clean-libtool:
++ -rm -rf .libs _libs
++
++distclean-libtool:
++ -rm -f libtool
++uninstall-info-am:
++install-includeHEADERS: $(include_HEADERS)
++ @$(NORMAL_INSTALL)
++ test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
++ @list='$(include_HEADERS)'; for p in $$list; do \
++ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
++ f="`echo $$p | sed -e 's|^.*/||'`"; \
++ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
++ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
++ done
++
++uninstall-includeHEADERS:
++ @$(NORMAL_UNINSTALL)
++ @list='$(include_HEADERS)'; for p in $$list; do \
++ f="`echo $$p | sed -e 's|^.*/||'`"; \
++ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
++ rm -f "$(DESTDIR)$(includedir)/$$f"; \
++ done
++
++# 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):
++ @set fnord $$MAKEFLAGS; amf=$$2; \
++ 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; \
++ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
++ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
++ done; \
++ if test "$$dot_seen" = "no"; then \
++ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
++ fi; test -z "$$fail"
++
++mostlyclean-recursive clean-recursive distclean-recursive \
++maintainer-clean-recursive:
++ @set fnord $$MAKEFLAGS; amf=$$2; \
++ 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; \
++ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
++ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
++ done && test -z "$$fail"
++tags-recursive:
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
++ done
++ctags-recursive:
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ test "$$subdir" = . || (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; } \
++ END { for (i in files) print i; }'`; \
++ mkid -fID $$unique
++tags: TAGS
++
++TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ 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 || \
++ tags="$$tags $$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; } \
++ END { for (i in files) print i; }'`; \
++ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
++ test -n "$$unique" || unique=$$empty_fix; \
++ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
++ $$tags $$unique; \
++ fi
++ctags: CTAGS
++CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ 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; } \
++ END { for (i in files) print i; }'`; \
++ test -z "$(CTAGS_ARGS)$$tags$$unique" \
++ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
++ $$tags $$unique
++
++GTAGS:
++ here=`$(am__cd) $(top_builddir) && pwd` \
++ && cd $(top_srcdir) \
++ && gtags -i $(GTAGS_ARGS) $$here
++
++distclean-tags:
++ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
++
++distdir: $(DISTFILES)
++ $(mkdir_p) $(distdir)/..
++ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
++ list='$(DISTFILES)'; for file in $$list; do \
++ case $$file in \
++ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
++ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
++ esac; \
++ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
++ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
++ dir="/$$dir"; \
++ $(mkdir_p) "$(distdir)$$dir"; \
++ else \
++ dir=''; \
++ fi; \
++ if test -d $$d/$$file; then \
++ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
++ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
++ fi; \
++ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
++ else \
++ test -f $(distdir)/$$file \
++ || cp -p $$d/$$file $(distdir)/$$file \
++ || exit 1; \
++ fi; \
++ done
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ if test "$$subdir" = .; then :; else \
++ test -d "$(distdir)/$$subdir" \
++ || mkdir "$(distdir)/$$subdir" \
++ || exit 1; \
++ (cd $$subdir && \
++ $(MAKE) $(AM_MAKEFLAGS) \
++ top_distdir="../$(top_distdir)" \
++ distdir="../$(distdir)/$$subdir" \
++ distdir) \
++ || exit 1; \
++ fi; \
++ done
++check-am: all-am
++check: check-recursive
++all-am: Makefile $(HEADERS) config.h
++installdirs: installdirs-recursive
++installdirs-am:
++ for dir in "$(DESTDIR)$(includedir)"; 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:
++
++distclean-generic:
++ -rm -f $(CONFIG_CLEAN_FILES)
++ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
++
++maintainer-clean-generic:
++ @echo "This command is intended for maintainers to use"
++ @echo "it deletes files that may require special tools to rebuild."
++clean: clean-recursive
++
++clean-am: clean-generic clean-libtool mostlyclean-am
++
++distclean: distclean-recursive
++ -rm -f Makefile
++distclean-am: clean-am distclean-generic distclean-hdr \
++ distclean-libtool distclean-tags
++
++dvi: dvi-recursive
++
++dvi-am:
++
++html: html-recursive
++
++info: info-recursive
++
++info-am:
++
++install-data-am: install-includeHEADERS
++
++install-exec-am:
++
++install-info: install-info-recursive
++
++install-man:
++
++installcheck-am:
++
++maintainer-clean: maintainer-clean-recursive
++ -rm -f Makefile
++maintainer-clean-am: distclean-am maintainer-clean-generic
++
++mostlyclean: mostlyclean-recursive
++
++mostlyclean-am: mostlyclean-generic mostlyclean-libtool
++
++pdf: pdf-recursive
++
++pdf-am:
++
++ps: ps-recursive
++
++ps-am:
++
++uninstall-am: uninstall-includeHEADERS uninstall-info-am
++
++uninstall-info: uninstall-info-recursive
++
++.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
++ clean clean-generic clean-libtool clean-recursive ctags \
++ ctags-recursive distclean distclean-generic distclean-hdr \
++ distclean-libtool distclean-recursive distclean-tags distdir \
++ dvi dvi-am html html-am info info-am install install-am \
++ install-data install-data-am install-exec install-exec-am \
++ install-includeHEADERS install-info install-info-am \
++ install-man install-strip installcheck installcheck-am \
++ installdirs installdirs-am maintainer-clean \
++ maintainer-clean-generic maintainer-clean-recursive \
++ mostlyclean mostlyclean-generic mostlyclean-libtool \
++ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
++ uninstall uninstall-am uninstall-includeHEADERS \
++ uninstall-info-am
++
++# Tell versions [3.59,3.63) of GNU make to not export all variables.
++# Otherwise a system limit (for SysV at least) may be exceeded.
++.NOEXPORT:
+diff -ruN libnet-1.0.2a-orig/include/config.h.in libnet-1.0.2a-7/include/config.h.in
+--- libnet-1.0.2a-orig/include/config.h.in 2000-05-25 02:28:49.000000000 +0200
++++ libnet-1.0.2a-7/include/config.h.in 2005-03-08 03:53:26.000000000 +0100
+@@ -1,14 +1,20 @@
+-/* include/config.h.in. Generated automatically from configure.in by autoheader. */
+-
+-/* Define to empty if the keyword does not work. */
+-#undef const
++/* include/config.h.in. Generated from configure.in by autoheader. */
++/*
++ *
++ * Libnet autoconfiguration acconfig.h file
++ * Copyright (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
++ * All rights reserved.
++ *
++ * Process this file with autoheader to produce a config.h file.
++ */
+
+ #undef LIBNET_BSDISH_OS
+ #undef LIBNET_BSD_BYTE_SWAP
+ #undef DLPI_DEV_PREFIX
++#undef LIBNET_FAST_X86_CHECK
++#undef HAVE_SOLARIS
+ #undef HAVE_DEV_DLPI
+ #undef HAVE_SOCKADDR_SA_LEN
+-#undef HAVE_SOLARIS
+ #undef HAVE_DLPI
+ #undef HAVE_PF_PACKET
+ #undef HAVE_STRUCT_IP_CSUM
+@@ -21,23 +27,80 @@
+ #undef LIBNET_BIG_ENDIAN
+ #undef LIBNET_LIL_ENDIAN
+
+-/* Define if you have the strerror function. */
+-#undef HAVE_STRERROR
++/* Define to 1 if you have the <dlfcn.h> header file. */
++#undef HAVE_DLFCN_H
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#undef HAVE_INTTYPES_H
++
++/* Define to 1 if you have the `nsl' library (-lnsl). */
++#undef HAVE_LIBNSL
+
+-/* Define if you have the <net/ethernet.h> header file. */
++/* Define to 1 if you have the `socket' library (-lsocket). */
++#undef HAVE_LIBSOCKET
++
++/* Define to 1 if you have the <memory.h> header file. */
++#undef HAVE_MEMORY_H
++
++/* Define to 1 if you have the <net/ethernet.h> header file. */
+ #undef HAVE_NET_ETHERNET_H
+
+-/* Define if you have the <sys/bufmod.h> header file. */
++/* 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 `strerror' function. */
++#undef HAVE_STRERROR
++
++/* 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 <sys/bufmod.h> header file. */
+ #undef HAVE_SYS_BUFMOD_H
+
+-/* Define if you have the <sys/dlpi_ext.h> header file. */
++/* Define to 1 if you have the <sys/dlpi_ext.h> header file. */
+ #undef HAVE_SYS_DLPI_EXT_H
+
+-/* Define if you have the <sys/sockio.h> header file. */
++/* Define to 1 if you have the <sys/sockio.h> header file. */
+ #undef HAVE_SYS_SOCKIO_H
+
+-/* Define if you have the nsl library (-lnsl). */
+-#undef HAVE_LIBNSL
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#undef HAVE_SYS_STAT_H
+
+-/* Define if you have the socket library (-lsocket). */
+-#undef HAVE_LIBSOCKET
++/* Define to 1 if you have the <sys/types.h> header file. */
++#undef HAVE_SYS_TYPES_H
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#undef HAVE_UNISTD_H
++
++/* 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 version of this package. */
++#undef PACKAGE_VERSION
++
++/* Define to 1 if you have the ANSI C header files. */
++#undef STDC_HEADERS
++
++/* Version number of package */
++#undef VERSION
++
++/* Define to empty if `const' does not conform to ANSI C. */
++#undef const
+diff -ruN libnet-1.0.2a-orig/include/libnet/Makefile.am libnet-1.0.2a-7/include/libnet/Makefile.am
+--- libnet-1.0.2a-orig/include/libnet/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/include/libnet/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,9 @@
++include $(top_srcdir)/Makefile.am.common
++
++pkginclude_HEADERS = \
++ libnet-asn1.h \
++ libnet-functions.h \
++ libnet-headers.h \
++ libnet-macros.h \
++ libnet-ospf.h \
++ libnet-structures.h
+diff -ruN libnet-1.0.2a-orig/include/libnet/Makefile.in libnet-1.0.2a-7/include/libnet/Makefile.in
+--- libnet-1.0.2a-orig/include/libnet/Makefile.in 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/include/libnet/Makefile.in 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,398 @@
++# Makefile.in generated by automake 1.8.5 from Makefile.am.
++# @configure_input@
++
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004 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@
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++pkgdatadir = $(datadir)/@PACKAGE@
++pkglibdir = $(libdir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@
++top_builddir = ../..
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++INSTALL = @INSTALL@
++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@
++DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
++ $(srcdir)/Makefile.in $(top_srcdir)/Makefile.am.common
++subdir = include/libnet
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
++ $(top_srcdir)/configure.in
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++ $(ACLOCAL_M4)
++mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
++CONFIG_HEADER = $(top_builddir)/include/config.h
++CONFIG_CLEAN_FILES =
++depcomp =
++am__depfiles_maybe =
++SOURCES =
++DIST_SOURCES =
++am__installdirs = "$(DESTDIR)$(pkgincludedir)"
++pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
++HEADERS = $(pkginclude_HEADERS)
++ETAGS = etags
++CTAGS = ctags
++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
++ACLOCAL = @ACLOCAL@
++ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
++AMDEP_FALSE = @AMDEP_FALSE@
++AMDEP_TRUE = @AMDEP_TRUE@
++AMTAR = @AMTAR@
++AR = @AR@
++AUTOCONF = @AUTOCONF@
++AUTOHEADER = @AUTOHEADER@
++AUTOMAKE = @AUTOMAKE@
++AWK = @AWK@
++BIN_PREFIX = @BIN_PREFIX@
++CC = @CC@
++CCDEPMODE = @CCDEPMODE@
++CFLAGS = @CFLAGS@
++CPP = @CPP@
++CPPFLAGS = @CPPFLAGS@
++CYGPATH_W = @CYGPATH_W@
++DEFS = @DEFS@
++DEPDIR = @DEPDIR@
++ECHO = @ECHO@
++ECHO_C = @ECHO_C@
++ECHO_N = @ECHO_N@
++ECHO_T = @ECHO_T@
++EGREP = @EGREP@
++EXEEXT = @EXEEXT@
++INC_PREFIX = @INC_PREFIX@
++INSTALL_DATA = @INSTALL_DATA@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
++LDFLAGS = @LDFLAGS@
++LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
++LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
++LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
++LIBOBJS = @LIBOBJS@
++LIBS = @LIBS@
++LIBTOOL = @LIBTOOL@
++LIB_PREFIX = @LIB_PREFIX@
++LL_INT_TYPE = @LL_INT_TYPE@
++LL_INT_TYPE_UC = @LL_INT_TYPE_UC@
++LN = @LN@
++LN_S = @LN_S@
++LTLIBOBJS = @LTLIBOBJS@
++MAKEINFO = @MAKEINFO@
++MAN_PREFIX = @MAN_PREFIX@
++OBJEXT = @OBJEXT@
++PACKAGE = @PACKAGE@
++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
++PACKAGE_NAME = @PACKAGE_NAME@
++PACKAGE_STRING = @PACKAGE_STRING@
++PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_VERSION = @PACKAGE_VERSION@
++PATH_SEPARATOR = @PATH_SEPARATOR@
++RANLIB = @RANLIB@
++SET_MAKE = @SET_MAKE@
++SHELL = @SHELL@
++STRIP = @STRIP@
++VERSION = @VERSION@
++ac_ct_CC = @ac_ct_CC@
++ac_ct_RANLIB = @ac_ct_RANLIB@
++ac_ct_STRIP = @ac_ct_STRIP@
++am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
++am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
++am__include = @am__include@
++am__leading_dot = @am__leading_dot@
++am__quote = @am__quote@
++bindir = @bindir@
++build = @build@
++build_alias = @build_alias@
++build_cpu = @build_cpu@
++build_os = @build_os@
++build_vendor = @build_vendor@
++datadir = @datadir@
++exec_prefix = @exec_prefix@
++host = @host@
++host_alias = @host_alias@
++host_cpu = @host_cpu@
++host_os = @host_os@
++host_vendor = @host_vendor@
++includedir = @includedir@
++infodir = @infodir@
++install_sh = @install_sh@
++libdir = @libdir@
++libexecdir = @libexecdir@
++localstatedir = @localstatedir@
++mandir = @mandir@
++mkdir_p = @mkdir_p@
++oldincludedir = @oldincludedir@
++prefix = @prefix@
++program_transform_name = @program_transform_name@
++sbindir = @sbindir@
++sharedstatedir = @sharedstatedir@
++sysconfdir = @sysconfdir@
++target = @target@
++target_alias = @target_alias@
++target_cpu = @target_cpu@
++target_os = @target_os@
++target_vendor = @target_vendor@
++AUTOMAKE_OPTIONS = foreign no-dependencies
++DISTCLEANFILES = *~
++pkginclude_HEADERS = \
++ libnet-asn1.h \
++ libnet-functions.h \
++ libnet-headers.h \
++ libnet-macros.h \
++ libnet-ospf.h \
++ libnet-structures.h
++
++all: all-am
++
++.SUFFIXES:
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(am__configure_deps)
++ @for dep in $?; do \
++ case '$(am__configure_deps)' in \
++ *$$dep*) \
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
++ && exit 0; \
++ exit 1;; \
++ esac; \
++ done; \
++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/libnet/Makefile'; \
++ cd $(top_srcdir) && \
++ $(AUTOMAKE) --foreign include/libnet/Makefile
++.PRECIOUS: Makefile
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++ @case '$?' in \
++ *config.status*) \
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
++ *) \
++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
++ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
++ esac;
++
++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++
++$(top_srcdir)/configure: $(am__configure_deps)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++$(ACLOCAL_M4): $(am__aclocal_m4_deps)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++
++mostlyclean-libtool:
++ -rm -f *.lo
++
++clean-libtool:
++ -rm -rf .libs _libs
++
++distclean-libtool:
++ -rm -f libtool
++uninstall-info-am:
++install-pkgincludeHEADERS: $(pkginclude_HEADERS)
++ @$(NORMAL_INSTALL)
++ test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
++ @list='$(pkginclude_HEADERS)'; for p in $$list; do \
++ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
++ f="`echo $$p | sed -e 's|^.*/||'`"; \
++ echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
++ $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
++ done
++
++uninstall-pkgincludeHEADERS:
++ @$(NORMAL_UNINSTALL)
++ @list='$(pkginclude_HEADERS)'; for p in $$list; do \
++ f="`echo $$p | sed -e 's|^.*/||'`"; \
++ echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
++ rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
++ 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; } \
++ END { for (i in files) print i; }'`; \
++ mkid -fID $$unique
++tags: TAGS
++
++TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
++ test -n "$$unique" || unique=$$empty_fix; \
++ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
++ $$tags $$unique; \
++ fi
++ctags: CTAGS
++CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ test -z "$(CTAGS_ARGS)$$tags$$unique" \
++ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
++ $$tags $$unique
++
++GTAGS:
++ here=`$(am__cd) $(top_builddir) && pwd` \
++ && cd $(top_srcdir) \
++ && gtags -i $(GTAGS_ARGS) $$here
++
++distclean-tags:
++ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
++
++distdir: $(DISTFILES)
++ $(mkdir_p) $(distdir)/../..
++ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
++ list='$(DISTFILES)'; for file in $$list; do \
++ case $$file in \
++ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
++ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
++ esac; \
++ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
++ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
++ dir="/$$dir"; \
++ $(mkdir_p) "$(distdir)$$dir"; \
++ else \
++ dir=''; \
++ fi; \
++ if test -d $$d/$$file; then \
++ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
++ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
++ fi; \
++ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
++ else \
++ test -f $(distdir)/$$file \
++ || cp -p $$d/$$file $(distdir)/$$file \
++ || exit 1; \
++ fi; \
++ done
++check-am: all-am
++check: check-am
++all-am: Makefile $(HEADERS)
++installdirs:
++ for dir in "$(DESTDIR)$(pkgincludedir)"; do \
++ test -z "$$dir" || $(mkdir_p) "$$dir"; \
++ done
++install: install-am
++install-exec: install-exec-am
++install-data: install-data-am
++uninstall: uninstall-am
++
++install-am: all-am
++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
++
++installcheck: installcheck-am
++install-strip:
++ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
++ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
++ `test -z '$(STRIP)' || \
++ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
++mostlyclean-generic:
++
++clean-generic:
++
++distclean-generic:
++ -rm -f $(CONFIG_CLEAN_FILES)
++ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
++
++maintainer-clean-generic:
++ @echo "This command is intended for maintainers to use"
++ @echo "it deletes files that may require special tools to rebuild."
++clean: clean-am
++
++clean-am: clean-generic clean-libtool mostlyclean-am
++
++distclean: distclean-am
++ -rm -f Makefile
++distclean-am: clean-am distclean-generic distclean-libtool \
++ distclean-tags
++
++dvi: dvi-am
++
++dvi-am:
++
++html: html-am
++
++info: info-am
++
++info-am:
++
++install-data-am: install-pkgincludeHEADERS
++
++install-exec-am:
++
++install-info: install-info-am
++
++install-man:
++
++installcheck-am:
++
++maintainer-clean: maintainer-clean-am
++ -rm -f Makefile
++maintainer-clean-am: distclean-am maintainer-clean-generic
++
++mostlyclean: mostlyclean-am
++
++mostlyclean-am: mostlyclean-generic mostlyclean-libtool
++
++pdf: pdf-am
++
++pdf-am:
++
++ps: ps-am
++
++ps-am:
++
++uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
++
++.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
++ clean-libtool ctags distclean distclean-generic \
++ distclean-libtool distclean-tags distdir dvi dvi-am html \
++ html-am info info-am install install-am install-data \
++ install-data-am install-exec install-exec-am install-info \
++ install-info-am install-man install-pkgincludeHEADERS \
++ install-strip installcheck installcheck-am installdirs \
++ maintainer-clean maintainer-clean-generic mostlyclean \
++ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
++ tags uninstall uninstall-am uninstall-info-am \
++ uninstall-pkgincludeHEADERS
++
++# 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 -ruN libnet-1.0.2a-orig/include/libnet.h libnet-1.0.2a-7/include/libnet.h
+--- libnet-1.0.2a-orig/include/libnet.h 2001-02-07 00:19:25.000000000 +0100
++++ libnet-1.0.2a-7/include/libnet.h 2005-03-08 03:53:26.000000000 +0100
+@@ -84,9 +84,9 @@
+ #define LIBNET_VERSION "1.0.2a"
+
+ #if (!LIBNET_LIL_ENDIAN && !LIBNET_BIG_ENDIAN)
+-#error "byte order has not been specified, you'll
+-need to #define either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN. See the
+-documentation regarding the libnet-config script."
++#error "byte order has not been specified, you'll"
++"need to #define either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN. See the"
++"documentation regarding the libnet-config script."
+ #endif
+
+ #endif /* __LIBNET_H */
+diff -ruN libnet-1.0.2a-orig/install-sh libnet-1.0.2a-7/install-sh
+--- libnet-1.0.2a-orig/install-sh 2001-02-05 18:51:48.000000000 +0100
++++ libnet-1.0.2a-7/install-sh 2005-03-08 03:53:26.000000000 +0100
+@@ -44,7 +44,7 @@
+ transformbasename=""
+ transform_arg=""
+ instcmd="$cpprog"
+-chmodcmd="$chmodprog 0755"
++chmodcmd=""
+ chowncmd=""
+ chgrpcmd=""
+ stripcmd=""
+diff -ruN libnet-1.0.2a-orig/ipkg/libnet/CONTROL/control libnet-1.0.2a-7/ipkg/libnet/CONTROL/control
+diff -ruN libnet-1.0.2a-orig/ipkg/libnet-dev/CONTROL/control libnet-1.0.2a-7/ipkg/libnet-dev/CONTROL/control
+diff -ruN libnet-1.0.2a-orig/ipkg/rules libnet-1.0.2a-7/ipkg/rules
+diff -ruN libnet-1.0.2a-orig/ipkg/version libnet-1.0.2a-7/ipkg/version
+diff -ruN libnet-1.0.2a-orig/ltmain.sh libnet-1.0.2a-7/ltmain.sh
+--- libnet-1.0.2a-orig/ltmain.sh 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/ltmain.sh 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5124 @@
++# ltmain.sh - Provide generalized library-building support services.
++# NOTE: Changing this file will not affect anything until you rerun configure.
++#
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
++# Free Software Foundation, Inc.
++# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# Check that we have a working $echo.
++if test "X$1" = X--no-reexec; then
++ # Discard the --no-reexec flag, and continue.
++ shift
++elif test "X$1" = X--fallback-echo; then
++ # Avoid inline document here, it may be left over
++ :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
++ # Yippee, $echo works!
++ :
++else
++ # Restart under the correct shell, and then maybe $echo will work.
++ exec $SHELL "$0" --no-reexec ${1+"$@"}
++fi
++
++if test "X$1" = X--fallback-echo; then
++ # used as fallback echo
++ shift
++ cat <<EOF
++$*
++EOF
++ exit 0
++fi
++
++# The name of this program.
++progname=`$echo "$0" | ${SED} 's%^.*/%%'`
++modename="$progname"
++
++# Constants.
++PROGRAM=ltmain.sh
++PACKAGE=libtool
++VERSION=1.4.3
++TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36) Debian$Rev: 145 $"
++
++default_mode=
++help="Try \`$progname --help' for more information."
++magic="%%%MAGIC variable%%%"
++mkdir="mkdir"
++mv="mv -f"
++rm="rm -f"
++
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed="${SED}"' -e 1s/^X//'
++sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
++# test EBCDIC or ASCII
++case `echo A|od -x` in
++ *[Cc]1*) # EBCDIC based system
++ SP2NL="tr '\100' '\n'"
++ NL2SP="tr '\r\n' '\100\100'"
++ ;;
++ *) # Assume ASCII based system
++ SP2NL="tr '\040' '\012'"
++ NL2SP="tr '\015\012' '\040\040'"
++ ;;
++esac
++
++# NLS nuisances.
++# Only set LANG and LC_ALL to C if already set.
++# These must not be set unconditionally because not all systems understand
++# e.g. LANG=C (notably SCO).
++# We save the old values to restore during execute mode.
++if test "${LC_ALL+set}" = set; then
++ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
++fi
++if test "${LANG+set}" = set; then
++ save_LANG="$LANG"; LANG=C; export LANG
++fi
++
++# Make sure IFS has a sensible default
++: ${IFS="
++"}
++
++if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
++ echo "$modename: not configured to build any kind of library" 1>&2
++ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
++ exit 1
++fi
++
++# Global variables.
++mode=$default_mode
++nonopt=
++prev=
++prevopt=
++run=
++show="$echo"
++show_help=
++execute_dlfiles=
++lo2o="s/\\.lo\$/.${objext}/"
++o2lo="s/\\.${objext}\$/.lo/"
++
++# Parse our command line options once, thoroughly.
++while test $# -gt 0
++do
++ arg="$1"
++ shift
++
++ case $arg in
++ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
++ *) optarg= ;;
++ esac
++
++ # If the previous option needs an argument, assign it.
++ if test -n "$prev"; then
++ case $prev in
++ execute_dlfiles)
++ execute_dlfiles="$execute_dlfiles $arg"
++ ;;
++ *)
++ eval "$prev=\$arg"
++ ;;
++ esac
++
++ prev=
++ prevopt=
++ continue
++ fi
++
++ # Have we seen a non-optional argument yet?
++ case $arg in
++ --help)
++ show_help=yes
++ ;;
++
++ --version)
++ echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
++ exit 0
++ ;;
++
++ --config)
++ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
++ exit 0
++ ;;
++
++ --debug)
++ echo "$progname: enabling shell trace mode"
++ set -x
++ ;;
++
++ --dry-run | -n)
++ run=:
++ ;;
++
++ --features)
++ echo "host: $host"
++ if test "$build_libtool_libs" = yes; then
++ echo "enable shared libraries"
++ else
++ echo "disable shared libraries"
++ fi
++ if test "$build_old_libs" = yes; then
++ echo "enable static libraries"
++ else
++ echo "disable static libraries"
++ fi
++ exit 0
++ ;;
++
++ --finish) mode="finish" ;;
++
++ --mode) prevopt="--mode" prev=mode ;;
++ --mode=*) mode="$optarg" ;;
++
++ --preserve-dup-deps) duplicate_deps="yes" ;;
++
++ --quiet | --silent)
++ show=:
++ ;;
++
++ -dlopen)
++ prevopt="-dlopen"
++ prev=execute_dlfiles
++ ;;
++
++ -*)
++ $echo "$modename: unrecognized option \`$arg'" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ ;;
++
++ *)
++ nonopt="$arg"
++ break
++ ;;
++ esac
++done
++
++if test -n "$prevopt"; then
++ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++fi
++
++# If this variable is set in any of the actions, the command in it
++# will be execed at the end. This prevents here-documents from being
++# left over by shells.
++exec_cmd=
++
++if test -z "$show_help"; then
++
++ # Infer the operation mode.
++ if test -z "$mode"; then
++ case $nonopt in
++ *cc | *++ | gcc* | *-gcc* | g++* | xlc*)
++ mode=link
++ for arg
++ do
++ case $arg in
++ -c)
++ mode=compile
++ break
++ ;;
++ esac
++ done
++ ;;
++ *db | *dbx | *strace | *truss)
++ mode=execute
++ ;;
++ *install*|cp|mv)
++ mode=install
++ ;;
++ *rm)
++ mode=uninstall
++ ;;
++ *)
++ # If we have no mode, but dlfiles were specified, then do execute mode.
++ test -n "$execute_dlfiles" && mode=execute
++
++ # Just use the default operation mode.
++ if test -z "$mode"; then
++ if test -n "$nonopt"; then
++ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
++ else
++ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
++ fi
++ fi
++ ;;
++ esac
++ fi
++
++ # Only execute mode is allowed to have -dlopen flags.
++ if test -n "$execute_dlfiles" && test "$mode" != execute; then
++ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ # Change the help message to a mode-specific one.
++ generic_help="$help"
++ help="Try \`$modename --help --mode=$mode' for more information."
++
++ # These modes are in order of execution frequency so that they run quickly.
++ case $mode in
++ # libtool compile mode
++ compile)
++ modename="$modename: compile"
++ # Get the compilation command and the source file.
++ base_compile=
++ prev=
++ lastarg=
++ srcfile="$nonopt"
++ suppress_output=
++
++ user_target=no
++ for arg
++ do
++ case $prev in
++ "") ;;
++ xcompiler)
++ # Aesthetically quote the previous argument.
++ prev=
++ lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
++
++ case $arg in
++ # Double-quote args containing other shell metacharacters.
++ # Many Bourne shells cannot handle close brackets correctly
++ # in scan sets, so we specify it separately.
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ arg="\"$arg\""
++ ;;
++ esac
++
++ # Add the previous argument to base_compile.
++ if test -z "$base_compile"; then
++ base_compile="$lastarg"
++ else
++ base_compile="$base_compile $lastarg"
++ fi
++ continue
++ ;;
++ esac
++
++ # Accept any command-line options.
++ case $arg in
++ -o)
++ if test "$user_target" != "no"; then
++ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
++ exit 1
++ fi
++ user_target=next
++ ;;
++
++ -static)
++ build_old_libs=yes
++ continue
++ ;;
++
++ -prefer-pic)
++ pic_mode=yes
++ continue
++ ;;
++
++ -prefer-non-pic)
++ pic_mode=no
++ continue
++ ;;
++
++ -Xcompiler)
++ prev=xcompiler
++ continue
++ ;;
++
++ -Wc,*)
++ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
++ lastarg=
++ save_ifs="$IFS"; IFS=','
++ for arg in $args; do
++ IFS="$save_ifs"
++
++ # Double-quote args containing other shell metacharacters.
++ # Many Bourne shells cannot handle close brackets correctly
++ # in scan sets, so we specify it separately.
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ arg="\"$arg\""
++ ;;
++ esac
++ lastarg="$lastarg $arg"
++ done
++ IFS="$save_ifs"
++ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
++
++ # Add the arguments to base_compile.
++ if test -z "$base_compile"; then
++ base_compile="$lastarg"
++ else
++ base_compile="$base_compile $lastarg"
++ fi
++ continue
++ ;;
++ esac
++
++ case $user_target in
++ next)
++ # The next one is the -o target name
++ user_target=yes
++ continue
++ ;;
++ yes)
++ # We got the output file
++ user_target=set
++ libobj="$arg"
++ continue
++ ;;
++ esac
++
++ # Accept the current argument as the source file.
++ lastarg="$srcfile"
++ srcfile="$arg"
++
++ # Aesthetically quote the previous argument.
++
++ # Backslashify any backslashes, double quotes, and dollar signs.
++ # These are the only characters that are still specially
++ # interpreted inside of double-quoted scrings.
++ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
++
++ # Double-quote args containing other shell metacharacters.
++ # Many Bourne shells cannot handle close brackets correctly
++ # in scan sets, so we specify it separately.
++ case $lastarg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ lastarg="\"$lastarg\""
++ ;;
++ esac
++
++ # Add the previous argument to base_compile.
++ if test -z "$base_compile"; then
++ base_compile="$lastarg"
++ else
++ base_compile="$base_compile $lastarg"
++ fi
++ done
++
++ case $user_target in
++ set)
++ ;;
++ no)
++ # Get the name of the library object.
++ libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
++ ;;
++ *)
++ $echo "$modename: you must specify a target with \`-o'" 1>&2
++ exit 1
++ ;;
++ esac
++
++ # Recognize several different file suffixes.
++ # If the user specifies -o file.o, it is replaced with file.lo
++ xform='[cCFSfmso]'
++ case $libobj in
++ *.ada) xform=ada ;;
++ *.adb) xform=adb ;;
++ *.ads) xform=ads ;;
++ *.asm) xform=asm ;;
++ *.c++) xform=c++ ;;
++ *.cc) xform=cc ;;
++ *.cpp) xform=cpp ;;
++ *.cxx) xform=cxx ;;
++ *.f90) xform=f90 ;;
++ *.for) xform=for ;;
++ esac
++
++ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
++
++ case $libobj in
++ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
++ *)
++ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
++ exit 1
++ ;;
++ esac
++
++ if test -z "$base_compile"; then
++ $echo "$modename: you must specify a compilation command" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ # Delete any leftover library objects.
++ if test "$build_old_libs" = yes; then
++ removelist="$obj $libobj"
++ else
++ removelist="$libobj"
++ fi
++
++ $run $rm $removelist
++ trap "$run $rm $removelist; exit 1" 1 2 15
++
++ # On Cygwin there's no "real" PIC flag so we must build both object types
++ case $host_os in
++ cygwin* | mingw* | pw32* | os2*)
++ pic_mode=default
++ ;;
++ esac
++ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
++ # non-PIC code in shared libraries is not supported
++ pic_mode=default
++ fi
++
++ # Calculate the filename of the output object if compiler does
++ # not support -o with -c
++ if test "$compiler_c_o" = no; then
++ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
++ lockfile="$output_obj.lock"
++ removelist="$removelist $output_obj $lockfile"
++ trap "$run $rm $removelist; exit 1" 1 2 15
++ else
++ need_locks=no
++ lockfile=
++ fi
++
++ # Lock this critical section if it is needed
++ # We use this script file to make the link, it avoids creating a new file
++ if test "$need_locks" = yes; then
++ until $run ln "$0" "$lockfile" 2>/dev/null; do
++ $show "Waiting for $lockfile to be removed"
++ sleep 2
++ done
++ elif test "$need_locks" = warn; then
++ if test -f "$lockfile"; then
++ echo "\
++*** ERROR, $lockfile exists and contains:
++`cat $lockfile 2>/dev/null`
++
++This indicates that another process is trying to use the same
++temporary object file, and libtool could not work around it because
++your compiler does not support \`-c' and \`-o' together. If you
++repeat this compilation, it may succeed, by chance, but you had better
++avoid parallel builds (make -j) in this platform, or get a better
++compiler."
++
++ $run $rm $removelist
++ exit 1
++ fi
++ echo $srcfile > "$lockfile"
++ fi
++
++ if test -n "$fix_srcfile_path"; then
++ eval srcfile=\"$fix_srcfile_path\"
++ fi
++
++ # Only build a PIC object if we are building libtool libraries.
++ if test "$build_libtool_libs" = yes; then
++ # Without this assignment, base_compile gets emptied.
++ fbsd_hideous_sh_bug=$base_compile
++
++ if test "$pic_mode" != no; then
++ # All platforms use -DPIC, to notify preprocessed assembler code.
++ command="$base_compile $srcfile $pic_flag -DPIC"
++ else
++ # Don't build PIC code
++ command="$base_compile $srcfile"
++ fi
++ if test "$build_old_libs" = yes; then
++ lo_libobj="$libobj"
++ dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$dir" = "X$libobj"; then
++ dir="$objdir"
++ else
++ dir="$dir/$objdir"
++ fi
++ libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
++
++ if test -d "$dir"; then
++ $show "$rm $libobj"
++ $run $rm $libobj
++ else
++ $show "$mkdir $dir"
++ $run $mkdir $dir
++ status=$?
++ if test $status -ne 0 && test ! -d $dir; then
++ exit $status
++ fi
++ fi
++ fi
++ if test "$compiler_o_lo" = yes; then
++ output_obj="$libobj"
++ command="$command -o $output_obj"
++ elif test "$compiler_c_o" = yes; then
++ output_obj="$obj"
++ command="$command -o $output_obj"
++ fi
++
++ $run $rm "$output_obj"
++ $show "$command"
++ if $run eval "$command"; then :
++ else
++ test -n "$output_obj" && $run $rm $removelist
++ exit 1
++ fi
++
++ if test "$need_locks" = warn &&
++ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
++ echo "\
++*** ERROR, $lockfile contains:
++`cat $lockfile 2>/dev/null`
++
++but it should contain:
++$srcfile
++
++This indicates that another process is trying to use the same
++temporary object file, and libtool could not work around it because
++your compiler does not support \`-c' and \`-o' together. If you
++repeat this compilation, it may succeed, by chance, but you had better
++avoid parallel builds (make -j) in this platform, or get a better
++compiler."
++
++ $run $rm $removelist
++ exit 1
++ fi
++
++ # Just move the object if needed, then go on to compile the next one
++ if test x"$output_obj" != x"$libobj"; then
++ $show "$mv $output_obj $libobj"
++ if $run $mv $output_obj $libobj; then :
++ else
++ error=$?
++ $run $rm $removelist
++ exit $error
++ fi
++ fi
++
++ # If we have no pic_flag, then copy the object into place and finish.
++ if (test -z "$pic_flag" || test "$pic_mode" != default) &&
++ test "$build_old_libs" = yes; then
++ # Rename the .lo from within objdir to obj
++ if test -f $obj; then
++ $show $rm $obj
++ $run $rm $obj
++ fi
++
++ $show "$mv $libobj $obj"
++ if $run $mv $libobj $obj; then :
++ else
++ error=$?
++ $run $rm $removelist
++ exit $error
++ fi
++
++ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$xdir" = "X$obj"; then
++ xdir="."
++ else
++ xdir="$xdir"
++ fi
++ baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
++ libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
++ # Now arrange that obj and lo_libobj become the same file
++ $show "(cd $xdir && $LN_S $baseobj $libobj)"
++ if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
++ # Unlock the critical section if it was locked
++ if test "$need_locks" != no; then
++ $run $rm "$lockfile"
++ fi
++ exit 0
++ else
++ error=$?
++ $run $rm $removelist
++ exit $error
++ fi
++ fi
++
++ # Allow error messages only from the first compilation.
++ suppress_output=' >/dev/null 2>&1'
++ fi
++
++ # Only build a position-dependent object if we build old libraries.
++ if test "$build_old_libs" = yes; then
++ if test "$pic_mode" != yes; then
++ # Don't build PIC code
++ command="$base_compile $srcfile"
++ else
++ # All platforms use -DPIC, to notify preprocessed assembler code.
++ command="$base_compile $srcfile $pic_flag -DPIC"
++ fi
++ if test "$compiler_c_o" = yes; then
++ command="$command -o $obj"
++ output_obj="$obj"
++ fi
++
++ # Suppress compiler output if we already did a PIC compilation.
++ command="$command$suppress_output"
++ $run $rm "$output_obj"
++ $show "$command"
++ if $run eval "$command"; then :
++ else
++ $run $rm $removelist
++ exit 1
++ fi
++
++ if test "$need_locks" = warn &&
++ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
++ echo "\
++*** ERROR, $lockfile contains:
++`cat $lockfile 2>/dev/null`
++
++but it should contain:
++$srcfile
++
++This indicates that another process is trying to use the same
++temporary object file, and libtool could not work around it because
++your compiler does not support \`-c' and \`-o' together. If you
++repeat this compilation, it may succeed, by chance, but you had better
++avoid parallel builds (make -j) in this platform, or get a better
++compiler."
++
++ $run $rm $removelist
++ exit 1
++ fi
++
++ # Just move the object if needed
++ if test x"$output_obj" != x"$obj"; then
++ $show "$mv $output_obj $obj"
++ if $run $mv $output_obj $obj; then :
++ else
++ error=$?
++ $run $rm $removelist
++ exit $error
++ fi
++ fi
++
++ # Create an invalid libtool object if no PIC, so that we do not
++ # accidentally link it into a program.
++ if test "$build_libtool_libs" != yes; then
++ $show "echo timestamp > $libobj"
++ $run eval "echo timestamp > \$libobj" || exit $?
++ else
++ # Move the .lo from within objdir
++ $show "$mv $libobj $lo_libobj"
++ if $run $mv $libobj $lo_libobj; then :
++ else
++ error=$?
++ $run $rm $removelist
++ exit $error
++ fi
++ fi
++ fi
++
++ # Unlock the critical section if it was locked
++ if test "$need_locks" != no; then
++ $run $rm "$lockfile"
++ fi
++
++ exit 0
++ ;;
++
++ # libtool link mode
++ link | relink)
++ modename="$modename: link"
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
++ # It is impossible to link a dll without this setting, and
++ # we shouldn't force the makefile maintainer to figure out
++ # which system we are compiling for in order to pass an extra
++ # flag for every libtool invokation.
++ # allow_undefined=no
++
++ # FIXME: Unfortunately, there are problems with the above when trying
++ # to make a dll which has undefined symbols, in which case not
++ # even a static library is built. For now, we need to specify
++ # -no-undefined on the libtool link line when we can be certain
++ # that all symbols are satisfied, otherwise we get a static library.
++ allow_undefined=yes
++ ;;
++ *)
++ allow_undefined=yes
++ ;;
++ esac
++ libtool_args="$nonopt"
++ compile_command="$nonopt"
++ finalize_command="$nonopt"
++
++ compile_rpath=
++ finalize_rpath=
++ compile_shlibpath=
++ finalize_shlibpath=
++ convenience=
++ old_convenience=
++ deplibs=
++ old_deplibs=
++ compiler_flags=
++ linker_flags=
++ dllsearchpath=
++ lib_search_path=`pwd`
++ inst_prefix_dir=
++
++ avoid_version=no
++ dlfiles=
++ dlprefiles=
++ dlself=no
++ export_dynamic=no
++ export_symbols=
++ export_symbols_regex=
++ generated=
++ libobjs=
++ ltlibs=
++ module=no
++ no_install=no
++ objs=
++ prefer_static_libs=no
++ preload=no
++ prev=
++ prevarg=
++ release=
++ rpath=
++ xrpath=
++ perm_rpath=
++ temp_rpath=
++ thread_safe=no
++ vinfo=
++
++ # We need to know -static, to get the right output filenames.
++ for arg
++ do
++ case $arg in
++ -all-static | -static)
++ if test "X$arg" = "X-all-static"; then
++ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
++ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
++ fi
++ if test -n "$link_static_flag"; then
++ dlopen_self=$dlopen_self_static
++ fi
++ else
++ if test -z "$pic_flag" && test -n "$link_static_flag"; then
++ dlopen_self=$dlopen_self_static
++ fi
++ fi
++ build_libtool_libs=no
++ build_old_libs=yes
++ prefer_static_libs=yes
++ break
++ ;;
++ esac
++ done
++
++ # See if our shared archives depend on static archives.
++ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
++
++ # Go through the arguments, transforming them on the way.
++ while test $# -gt 0; do
++ arg="$1"
++ shift
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
++ ;;
++ *) qarg=$arg ;;
++ esac
++ libtool_args="$libtool_args $qarg"
++
++ # If the previous option needs an argument, assign it.
++ if test -n "$prev"; then
++ case $prev in
++ output)
++ compile_command="$compile_command @OUTPUT@"
++ finalize_command="$finalize_command @OUTPUT@"
++ ;;
++ esac
++
++ case $prev in
++ dlfiles|dlprefiles)
++ if test "$preload" = no; then
++ # Add the symbol object into the linking commands.
++ compile_command="$compile_command @SYMFILE@"
++ finalize_command="$finalize_command @SYMFILE@"
++ preload=yes
++ fi
++ case $arg in
++ *.la | *.lo) ;; # We handle these cases below.
++ force)
++ if test "$dlself" = no; then
++ dlself=needless
++ export_dynamic=yes
++ fi
++ prev=
++ continue
++ ;;
++ self)
++ if test "$prev" = dlprefiles; then
++ dlself=yes
++ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
++ dlself=yes
++ else
++ dlself=needless
++ export_dynamic=yes
++ fi
++ prev=
++ continue
++ ;;
++ *)
++ if test "$prev" = dlfiles; then
++ dlfiles="$dlfiles $arg"
++ else
++ dlprefiles="$dlprefiles $arg"
++ fi
++ prev=
++ continue
++ ;;
++ esac
++ ;;
++ expsyms)
++ export_symbols="$arg"
++ if test ! -f "$arg"; then
++ $echo "$modename: symbol file \`$arg' does not exist"
++ exit 1
++ fi
++ prev=
++ continue
++ ;;
++ expsyms_regex)
++ export_symbols_regex="$arg"
++ prev=
++ continue
++ ;;
++ inst_prefix)
++ inst_prefix_dir="$arg"
++ prev=
++ continue
++ ;;
++ release)
++ release="-$arg"
++ prev=
++ continue
++ ;;
++ rpath | xrpath)
++ # We need an absolute path.
++ case $arg in
++ [\\/]* | [A-Za-z]:[\\/]*) ;;
++ *)
++ $echo "$modename: only absolute run-paths are allowed" 1>&2
++ exit 1
++ ;;
++ esac
++ if test "$prev" = rpath; then
++ case "$rpath " in
++ *" $arg "*) ;;
++ *) rpath="$rpath $arg" ;;
++ esac
++ else
++ case "$xrpath " in
++ *" $arg "*) ;;
++ *) xrpath="$xrpath $arg" ;;
++ esac
++ fi
++ prev=
++ continue
++ ;;
++ xcompiler)
++ compiler_flags="$compiler_flags $qarg"
++ prev=
++ compile_command="$compile_command $qarg"
++ finalize_command="$finalize_command $qarg"
++ continue
++ ;;
++ xlinker)
++ linker_flags="$linker_flags $qarg"
++ compiler_flags="$compiler_flags $wl$qarg"
++ prev=
++ compile_command="$compile_command $wl$qarg"
++ finalize_command="$finalize_command $wl$qarg"
++ continue
++ ;;
++ *)
++ eval "$prev=\"\$arg\""
++ prev=
++ continue
++ ;;
++ esac
++ fi # test -n $prev
++
++ prevarg="$arg"
++
++ case $arg in
++ -all-static)
++ if test -n "$link_static_flag"; then
++ compile_command="$compile_command $link_static_flag"
++ finalize_command="$finalize_command $link_static_flag"
++ fi
++ continue
++ ;;
++
++ -allow-undefined)
++ # FIXME: remove this flag sometime in the future.
++ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
++ continue
++ ;;
++
++ -avoid-version)
++ avoid_version=yes
++ continue
++ ;;
++
++ -dlopen)
++ prev=dlfiles
++ continue
++ ;;
++
++ -dlpreopen)
++ prev=dlprefiles
++ continue
++ ;;
++
++ -export-dynamic)
++ export_dynamic=yes
++ continue
++ ;;
++
++ -export-symbols | -export-symbols-regex)
++ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
++ $echo "$modename: more than one -exported-symbols argument is not allowed"
++ exit 1
++ fi
++ if test "X$arg" = "X-export-symbols"; then
++ prev=expsyms
++ else
++ prev=expsyms_regex
++ fi
++ continue
++ ;;
++
++ -inst-prefix-dir)
++ prev=inst_prefix
++ continue
++ ;;
++
++ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
++ # so, if we see these flags be careful not to treat them like -L
++ -L[A-Z][A-Z]*:*)
++ if test -z "$with_gcc"; then
++ case $host in
++ *-*-irix* | *-*-nonstopux*)
++ compile_command="$compile_command $arg"
++ finalize_command="$finalize_command $arg"
++ ;;
++ esac
++ fi
++ continue
++ ;;
++
++ -L*)
++ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
++ # We need an absolute path.
++ case $dir in
++ [\\/]* | [A-Za-z]:[\\/]*) ;;
++ *)
++ absdir=`cd "$dir" && pwd`
++ if test -z "$absdir"; then
++ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
++ exit 1
++ fi
++ dir="$absdir"
++ ;;
++ esac
++ case "$deplibs " in
++ *" -L$dir "*) ;;
++ *)
++ deplibs="$deplibs -L$dir"
++ lib_search_path="$lib_search_path $dir"
++ ;;
++ esac
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
++ case :$dllsearchpath: in
++ *":$dir:"*) ;;
++ *) dllsearchpath="$dllsearchpath:$dir";;
++ esac
++ ;;
++ esac
++ continue
++ ;;
++
++ -l*)
++ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
++ case $host in
++ *-*-cygwin* | *-*-pw32* | *-*-beos*)
++ # These systems don't actually have a C or math library (as such)
++ continue
++ ;;
++ *-*-mingw* | *-*-os2*)
++ # These systems don't actually have a C library (as such)
++ test "X$arg" = "X-lc" && continue
++ ;;
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc due to us having libc/libc_r.
++ test "X$arg" = "X-lc" && continue
++ ;;
++ esac
++ elif test "X$arg" = "X-lc_r"; then
++ case $host in
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc_r directly, use -pthread flag.
++ continue
++ ;;
++ esac
++ fi
++ deplibs="$deplibs $arg"
++ continue
++ ;;
++
++ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads)
++ deplibs="$deplibs $arg"
++ continue
++ ;;
++
++ -module)
++ module=yes
++ continue
++ ;;
++
++ -no-fast-install)
++ fast_install=no
++ continue
++ ;;
++
++ -no-install)
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
++ # The PATH hackery in wrapper scripts is required on Windows
++ # in order for the loader to find any dlls it needs.
++ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
++ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
++ fast_install=no
++ ;;
++ *) no_install=yes ;;
++ esac
++ continue
++ ;;
++
++ -no-undefined)
++ allow_undefined=no
++ continue
++ ;;
++
++ -o) prev=output ;;
++
++ -release)
++ prev=release
++ continue
++ ;;
++
++ -rpath)
++ prev=rpath
++ continue
++ ;;
++
++ -R)
++ prev=xrpath
++ continue
++ ;;
++
++ -R*)
++ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
++ # We need an absolute path.
++ case $dir in
++ [\\/]* | [A-Za-z]:[\\/]*) ;;
++ *)
++ $echo "$modename: only absolute run-paths are allowed" 1>&2
++ exit 1
++ ;;
++ esac
++ case "$xrpath " in
++ *" $dir "*) ;;
++ *) xrpath="$xrpath $dir" ;;
++ esac
++ continue
++ ;;
++
++ -static)
++ # The effects of -static are defined in a previous loop.
++ # We used to do the same as -all-static on platforms that
++ # didn't have a PIC flag, but the assumption that the effects
++ # would be equivalent was wrong. It would break on at least
++ # Digital Unix and AIX.
++ continue
++ ;;
++
++ -thread-safe)
++ thread_safe=yes
++ continue
++ ;;
++
++ -version-info)
++ prev=vinfo
++ continue
++ ;;
++
++ -Wc,*)
++ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
++ arg=
++ save_ifs="$IFS"; IFS=','
++ for flag in $args; do
++ IFS="$save_ifs"
++ case $flag in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ flag="\"$flag\""
++ ;;
++ esac
++ arg="$arg $wl$flag"
++ compiler_flags="$compiler_flags $flag"
++ done
++ IFS="$save_ifs"
++ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
++ ;;
++
++ -Wl,*)
++ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
++ arg=
++ save_ifs="$IFS"; IFS=','
++ for flag in $args; do
++ IFS="$save_ifs"
++ case $flag in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ flag="\"$flag\""
++ ;;
++ esac
++ arg="$arg $wl$flag"
++ compiler_flags="$compiler_flags $wl$flag"
++ linker_flags="$linker_flags $flag"
++ done
++ IFS="$save_ifs"
++ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
++ ;;
++
++ -Xcompiler)
++ prev=xcompiler
++ continue
++ ;;
++
++ -Xlinker)
++ prev=xlinker
++ continue
++ ;;
++
++ # Some other compiler flag.
++ -* | +*)
++ # Unknown arguments in both finalize_command and compile_command need
++ # to be aesthetically quoted because they are evaled later.
++ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ arg="\"$arg\""
++ ;;
++ esac
++ ;;
++
++ *.lo | *.$objext)
++ # A library or standard object.
++ if test "$prev" = dlfiles; then
++ # This file was specified with -dlopen.
++ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
++ dlfiles="$dlfiles $arg"
++ prev=
++ continue
++ else
++ # If libtool objects are unsupported, then we need to preload.
++ prev=dlprefiles
++ fi
++ fi
++
++ if test "$prev" = dlprefiles; then
++ # Preload the old-style object.
++ dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
++ prev=
++ else
++ case $arg in
++ *.lo) libobjs="$libobjs $arg" ;;
++ *) objs="$objs $arg" ;;
++ esac
++ fi
++ ;;
++
++ *.$libext)
++ # An archive.
++ deplibs="$deplibs $arg"
++ old_deplibs="$old_deplibs $arg"
++ continue
++ ;;
++
++ *.la)
++ # A libtool-controlled library.
++
++ if test "$prev" = dlfiles; then
++ # This library was specified with -dlopen.
++ dlfiles="$dlfiles $arg"
++ prev=
++ elif test "$prev" = dlprefiles; then
++ # The library was specified with -dlpreopen.
++ dlprefiles="$dlprefiles $arg"
++ prev=
++ else
++ deplibs="$deplibs $arg"
++ fi
++ continue
++ ;;
++
++ # Some other compiler argument.
++ *)
++ # Unknown arguments in both finalize_command and compile_command need
++ # to be aesthetically quoted because they are evaled later.
++ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
++ arg="\"$arg\""
++ ;;
++ esac
++ ;;
++ esac # arg
++
++ # Now actually substitute the argument into the commands.
++ if test -n "$arg"; then
++ compile_command="$compile_command $arg"
++ finalize_command="$finalize_command $arg"
++ fi
++ done # argument parsing loop
++
++ if test -n "$prev"; then
++ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
++ eval arg=\"$export_dynamic_flag_spec\"
++ compile_command="$compile_command $arg"
++ finalize_command="$finalize_command $arg"
++ fi
++
++ # calculate the name of the file, without its directory
++ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
++ libobjs_save="$libobjs"
++
++ if test -n "$shlibpath_var"; then
++ # get the directories listed in $shlibpath_var
++ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
++ else
++ shlib_search_path=
++ fi
++ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
++ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
++
++ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$output_objdir" = "X$output"; then
++ output_objdir="$objdir"
++ else
++ output_objdir="$output_objdir/$objdir"
++ fi
++ # Create the object directory.
++ if test ! -d $output_objdir; then
++ $show "$mkdir $output_objdir"
++ $run $mkdir $output_objdir
++ status=$?
++ if test $status -ne 0 && test ! -d $output_objdir; then
++ exit $status
++ fi
++ fi
++
++ # Determine the type of output
++ case $output in
++ "")
++ $echo "$modename: you must specify an output file" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ ;;
++ *.$libext) linkmode=oldlib ;;
++ *.lo | *.$objext) linkmode=obj ;;
++ *.la) linkmode=lib ;;
++ *) linkmode=prog ;; # Anything else should be a program.
++ esac
++
++ specialdeplibs=
++ libs=
++ # Find all interdependent deplibs by searching for libraries
++ # that are linked more than once (e.g. -la -lb -la)
++ for deplib in $deplibs; do
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ libs="$libs $deplib"
++ done
++ deplibs=
++ newdependency_libs=
++ newlib_search_path=
++ need_relink=no # whether we're linking any uninstalled libtool libraries
++ notinst_deplibs= # not-installed libtool libraries
++ notinst_path= # paths that contain not-installed libtool libraries
++ case $linkmode in
++ lib)
++ passes="conv link"
++ for file in $dlfiles $dlprefiles; do
++ case $file in
++ *.la) ;;
++ *)
++ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
++ exit 1
++ ;;
++ esac
++ done
++ ;;
++ prog)
++ compile_deplibs=
++ finalize_deplibs=
++ alldeplibs=no
++ newdlfiles=
++ newdlprefiles=
++ passes="conv scan dlopen dlpreopen link"
++ ;;
++ *) passes="conv"
++ ;;
++ esac
++ for pass in $passes; do
++ if test $linkmode = prog; then
++ # Determine which files to process
++ case $pass in
++ dlopen)
++ libs="$dlfiles"
++ save_deplibs="$deplibs" # Collect dlpreopened libraries
++ deplibs=
++ ;;
++ dlpreopen) libs="$dlprefiles" ;;
++ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
++ esac
++ fi
++ for deplib in $libs; do
++ lib=
++ found=no
++ case $deplib in
++ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads)
++ if test "$linkmode,$pass" = "prog,link"; then
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ else
++ deplibs="$deplib $deplibs"
++ fi
++ continue
++ ;;
++ -l*)
++ if test $linkmode = oldlib && test $linkmode = obj; then
++ $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
++ continue
++ fi
++ if test $pass = conv; then
++ deplibs="$deplib $deplibs"
++ continue
++ fi
++ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
++ for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
++ # Search the libtool library
++ lib="$searchdir/lib${name}.la"
++ if test -f "$lib"; then
++ found=yes
++ break
++ fi
++ done
++ if test "$found" != yes; then
++ # deplib doesn't seem to be a libtool library
++ if test "$linkmode,$pass" = "prog,link"; then
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ else
++ deplibs="$deplib $deplibs"
++ test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
++ fi
++ continue
++ fi
++ ;; # -l
++ -L*)
++ case $linkmode in
++ lib)
++ deplibs="$deplib $deplibs"
++ test $pass = conv && continue
++ newdependency_libs="$deplib $newdependency_libs"
++ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
++ ;;
++ prog)
++ if test $pass = conv; then
++ deplibs="$deplib $deplibs"
++ continue
++ fi
++ if test $pass = scan; then
++ deplibs="$deplib $deplibs"
++ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
++ else
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ fi
++ ;;
++ *)
++ $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
++ ;;
++ esac # linkmode
++ continue
++ ;; # -L
++ -R*)
++ if test $pass = link; then
++ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
++ # Make sure the xrpath contains only unique directories.
++ case "$xrpath " in
++ *" $dir "*) ;;
++ *) xrpath="$xrpath $dir" ;;
++ esac
++ fi
++ deplibs="$deplib $deplibs"
++ continue
++ ;;
++ *.la) lib="$deplib" ;;
++ *.$libext)
++ if test $pass = conv; then
++ deplibs="$deplib $deplibs"
++ continue
++ fi
++ case $linkmode in
++ lib)
++ if test "$deplibs_check_method" != pass_all; then
++ echo
++ echo "*** Warning: Trying to link with static lib archive $deplib."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because the file extensions .$libext of this argument makes me believe"
++ echo "*** that it is just a static archive that I should not used here."
++ else
++ echo
++ echo "*** Warning: Linking the shared library $output against the"
++ echo "*** static library $deplib is not portable!"
++ deplibs="$deplib $deplibs"
++ fi
++ continue
++ ;;
++ prog)
++ if test $pass != link; then
++ deplibs="$deplib $deplibs"
++ else
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ fi
++ continue
++ ;;
++ esac # linkmode
++ ;; # *.$libext
++ *.lo | *.$objext)
++ if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
++ # If there is no dlopen support or we're linking statically,
++ # we need to preload.
++ newdlprefiles="$newdlprefiles $deplib"
++ compile_deplibs="$deplib $compile_deplibs"
++ finalize_deplibs="$deplib $finalize_deplibs"
++ else
++ newdlfiles="$newdlfiles $deplib"
++ fi
++ continue
++ ;;
++ %DEPLIBS%)
++ alldeplibs=yes
++ continue
++ ;;
++ esac # case $deplib
++ if test $found = yes || test -f "$lib"; then :
++ else
++ $echo "$modename: cannot find the library \`$lib'" 1>&2
++ exit 1
++ fi
++
++ # Check to see that this really is a libtool archive.
++ if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ else
++ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++
++ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
++ test "X$ladir" = "X$lib" && ladir="."
++
++ dlname=
++ dlopen=
++ dlpreopen=
++ libdir=
++ library_names=
++ old_library=
++ # If the library was installed with an old release of libtool,
++ # it will not redefine variable installed.
++ installed=yes
++
++ # Read the .la file
++ case $lib in
++ */* | *\\*) . $lib ;;
++ *) . ./$lib ;;
++ esac
++
++ if test "$linkmode,$pass" = "lib,link" ||
++ test "$linkmode,$pass" = "prog,scan" ||
++ { test $linkmode = oldlib && test $linkmode = obj; }; then
++ # Add dl[pre]opened files of deplib
++ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
++ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
++ fi
++
++ if test $pass = conv; then
++ # Only check for convenience libraries
++ deplibs="$lib $deplibs"
++ if test -z "$libdir"; then
++ if test -z "$old_library"; then
++ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
++ exit 1
++ fi
++ # It is a libtool convenience library, so add in its objects.
++ convenience="$convenience $ladir/$objdir/$old_library"
++ old_convenience="$old_convenience $ladir/$objdir/$old_library"
++ tmp_libs=
++ for deplib in $dependency_libs; do
++ deplibs="$deplib $deplibs"
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ tmp_libs="$tmp_libs $deplib"
++ done
++ elif test $linkmode != prog && test $linkmode != lib; then
++ $echo "$modename: \`$lib' is not a convenience library" 1>&2
++ exit 1
++ fi
++ continue
++ fi # $pass = conv
++
++ # Get the name of the library we link against.
++ linklib=
++ for l in $old_library $library_names; do
++ linklib="$l"
++ done
++ if test -z "$linklib"; then
++ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
++ exit 1
++ fi
++
++ # This library was specified with -dlopen.
++ if test $pass = dlopen; then
++ if test -z "$libdir"; then
++ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
++ exit 1
++ fi
++ if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
++ # If there is no dlname, no dlopen support or we're linking
++ # statically, we need to preload.
++ dlprefiles="$dlprefiles $lib"
++ else
++ newdlfiles="$newdlfiles $lib"
++ fi
++ continue
++ fi # $pass = dlopen
++
++ # We need an absolute path.
++ case $ladir in
++ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
++ *)
++ abs_ladir=`cd "$ladir" && pwd`
++ if test -z "$abs_ladir"; then
++ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
++ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
++ abs_ladir="$ladir"
++ fi
++ ;;
++ esac
++ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
++
++ # Find the relevant object directory and library name.
++ if test "X$installed" = Xyes; then
++ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
++ $echo "$modename: warning: library \`$lib' was moved." 1>&2
++ dir="$ladir"
++ absdir="$abs_ladir"
++ libdir="$abs_ladir"
++ else
++ dir="$libdir"
++ absdir="$libdir"
++ fi
++ else
++ dir="$ladir/$objdir"
++ absdir="$abs_ladir/$objdir"
++ # Remove this search path later
++ notinst_path="$notinst_path $abs_ladir"
++ fi # $installed = yes
++ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
++
++ # This library was specified with -dlpreopen.
++ if test $pass = dlpreopen; then
++ if test -z "$libdir"; then
++ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
++ exit 1
++ fi
++ # Prefer using a static library (so that no silly _DYNAMIC symbols
++ # are required to link).
++ if test -n "$old_library"; then
++ newdlprefiles="$newdlprefiles $dir/$old_library"
++ # Otherwise, use the dlname, so that lt_dlopen finds it.
++ elif test -n "$dlname"; then
++ newdlprefiles="$newdlprefiles $dir/$dlname"
++ else
++ newdlprefiles="$newdlprefiles $dir/$linklib"
++ fi
++ fi # $pass = dlpreopen
++
++ if test -z "$libdir"; then
++ # Link the convenience library
++ if test $linkmode = lib; then
++ deplibs="$dir/$old_library $deplibs"
++ elif test "$linkmode,$pass" = "prog,link"; then
++ compile_deplibs="$dir/$old_library $compile_deplibs"
++ finalize_deplibs="$dir/$old_library $finalize_deplibs"
++ else
++ deplibs="$lib $deplibs"
++ fi
++ continue
++ fi
++
++ if test $linkmode = prog && test $pass != link; then
++ newlib_search_path="$newlib_search_path $ladir"
++ deplibs="$lib $deplibs"
++
++ linkalldeplibs=no
++ if test "$link_all_deplibs" != no || test -z "$library_names" ||
++ test "$build_libtool_libs" = no; then
++ linkalldeplibs=yes
++ fi
++
++ tmp_libs=
++ for deplib in $dependency_libs; do
++ case $deplib in
++ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
++ esac
++ # Need to link against all dependency_libs?
++ if test $linkalldeplibs = yes; then
++ deplibs="$deplib $deplibs"
++ else
++ # Need to hardcode shared library paths
++ # or/and link against static libraries
++ newdependency_libs="$deplib $newdependency_libs"
++ fi
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ tmp_libs="$tmp_libs $deplib"
++ done # for deplib
++ continue
++ fi # $linkmode = prog...
++
++ link_static=no # Whether the deplib will be linked statically
++ if test -n "$library_names" &&
++ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
++ # Link against this shared library
++
++ if test "$linkmode,$pass" = "prog,link" ||
++ { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
++ # Hardcode the library path.
++ # Skip directories that are in the system default run-time
++ # search path.
++ case " $sys_lib_dlsearch_path " in
++ *" $absdir "*) ;;
++ *)
++ case "$compile_rpath " in
++ *" $absdir "*) ;;
++ *) compile_rpath="$compile_rpath $absdir"
++ esac
++ ;;
++ esac
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir "*) ;;
++ *)
++ case "$finalize_rpath " in
++ *" $libdir "*) ;;
++ *) finalize_rpath="$finalize_rpath $libdir"
++ esac
++ ;;
++ esac
++ if test $linkmode = prog; then
++ # We need to hardcode the library path
++ if test -n "$shlibpath_var"; then
++ # Make sure the rpath contains only unique directories.
++ case "$temp_rpath " in
++ *" $dir "*) ;;
++ *" $absdir "*) ;;
++ *) temp_rpath="$temp_rpath $dir" ;;
++ esac
++ fi
++ fi
++ fi # $linkmode,$pass = prog,link...
++
++ if test "$alldeplibs" = yes &&
++ { test "$deplibs_check_method" = pass_all ||
++ { test "$build_libtool_libs" = yes &&
++ test -n "$library_names"; }; }; then
++ # We only need to search for static libraries
++ continue
++ fi
++
++ if test "$installed" = no; then
++ notinst_deplibs="$notinst_deplibs $lib"
++ need_relink=yes
++ fi
++
++ if test -n "$old_archive_from_expsyms_cmds"; then
++ # figure out the soname
++ set dummy $library_names
++ realname="$2"
++ shift; shift
++ libname=`eval \\$echo \"$libname_spec\"`
++ # use dlname if we got it. it's perfectly good, no?
++ if test -n "$dlname"; then
++ soname="$dlname"
++ elif test -n "$soname_spec"; then
++ # bleh windows
++ case $host in
++ *cygwin*)
++ major=`expr $current - $age`
++ versuffix="-$major"
++ ;;
++ esac
++ eval soname=\"$soname_spec\"
++ else
++ soname="$realname"
++ fi
++
++ # Make a new name for the extract_expsyms_cmds to use
++ soroot="$soname"
++ soname=`echo $soroot | ${SED} -e 's/^.*\///'`
++ newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
++
++ # If the library has no export list, then create one now
++ if test -f "$output_objdir/$soname-def"; then :
++ else
++ $show "extracting exported symbol list from \`$soname'"
++ save_ifs="$IFS"; IFS='~'
++ eval cmds=\"$extract_expsyms_cmds\"
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ fi
++
++ # Create $newlib
++ if test -f "$output_objdir/$newlib"; then :; else
++ $show "generating import library for \`$soname'"
++ save_ifs="$IFS"; IFS='~'
++ eval cmds=\"$old_archive_from_expsyms_cmds\"
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ fi
++ # make sure the library variables are pointing to the new library
++ dir=$output_objdir
++ linklib=$newlib
++ fi # test -n $old_archive_from_expsyms_cmds
++
++ if test $linkmode = prog || test "$mode" != relink; then
++ add_shlibpath=
++ add_dir=
++ add=
++ lib_linked=yes
++ case $hardcode_action in
++ immediate | unsupported)
++ if test "$hardcode_direct" = no; then
++ add="$dir/$linklib"
++ elif test "$hardcode_minus_L" = no; then
++ case $host in
++ *-*-sunos*) add_shlibpath="$dir" ;;
++ esac
++ add_dir="-L$dir"
++ add="-l$name"
++ elif test "$hardcode_shlibpath_var" = no; then
++ add_shlibpath="$dir"
++ add="-l$name"
++ else
++ lib_linked=no
++ fi
++ ;;
++ relink)
++ if test "$hardcode_direct" = yes; then
++ add="$dir/$linklib"
++ elif test "$hardcode_minus_L" = yes; then
++ add_dir="-L$dir"
++ # Try looking first in the location we're being installed to.
++ if test -n "$inst_prefix_dir"; then
++ case "$libdir" in
++ [\/]*)
++ add_dir="$add_dir -L$inst_prefix_dir$libdir"
++ ;;
++ esac
++ fi
++ add="-l$name"
++ elif test "$hardcode_shlibpath_var" = yes; then
++ add_shlibpath="$dir"
++ add="-l$name"
++ else
++ lib_linked=no
++ fi
++ ;;
++ *) lib_linked=no ;;
++ esac
++
++ if test "$lib_linked" != yes; then
++ $echo "$modename: configuration error: unsupported hardcode properties"
++ exit 1
++ fi
++
++ if test -n "$add_shlibpath"; then
++ case :$compile_shlibpath: in
++ *":$add_shlibpath:"*) ;;
++ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
++ esac
++ fi
++ if test $linkmode = prog; then
++ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
++ test -n "$add" && compile_deplibs="$add $compile_deplibs"
++ else
++ test -n "$add_dir" && deplibs="$add_dir $deplibs"
++ test -n "$add" && deplibs="$add $deplibs"
++ if test "$hardcode_direct" != yes && \
++ test "$hardcode_minus_L" != yes && \
++ test "$hardcode_shlibpath_var" = yes; then
++ case :$finalize_shlibpath: in
++ *":$libdir:"*) ;;
++ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++ esac
++ fi
++ fi
++ fi
++
++ if test $linkmode = prog || test "$mode" = relink; then
++ add_shlibpath=
++ add_dir=
++ add=
++ # Finalize command for both is simple: just hardcode it.
++ if test "$hardcode_direct" = yes; then
++ add="$libdir/$linklib"
++ elif test "$hardcode_minus_L" = yes; then
++ add_dir="-L$libdir"
++ add="-l$name"
++ elif test "$hardcode_shlibpath_var" = yes; then
++ case :$finalize_shlibpath: in
++ *":$libdir:"*) ;;
++ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++ esac
++ add="-l$name"
++ else
++ # We cannot seem to hardcode it, guess we'll fake it.
++ add_dir="-L$libdir"
++ # Try looking first in the location we're being installed to.
++ if test -n "$inst_prefix_dir"; then
++ case "$libdir" in
++ [\/]*)
++ add_dir="$add_dir -L$inst_prefix_dir$libdir"
++ ;;
++ esac
++ fi
++ add="-l$name"
++ fi
++
++ if test $linkmode = prog; then
++ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
++ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
++ else
++ test -n "$add_dir" && deplibs="$add_dir $deplibs"
++ test -n "$add" && deplibs="$add $deplibs"
++ fi
++ fi
++ elif test $linkmode = prog; then
++ if test "$alldeplibs" = yes &&
++ { test "$deplibs_check_method" = pass_all ||
++ { test "$build_libtool_libs" = yes &&
++ test -n "$library_names"; }; }; then
++ # We only need to search for static libraries
++ continue
++ fi
++
++ # Try to link the static library
++ # Here we assume that one of hardcode_direct or hardcode_minus_L
++ # is not unsupported. This is valid on all known static and
++ # shared platforms.
++ if test "$hardcode_direct" != unsupported; then
++ test -n "$old_library" && linklib="$old_library"
++ compile_deplibs="$dir/$linklib $compile_deplibs"
++ finalize_deplibs="$dir/$linklib $finalize_deplibs"
++ else
++ compile_deplibs="-l$name -L$dir $compile_deplibs"
++ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
++ fi
++ elif test "$build_libtool_libs" = yes; then
++ # Not a shared library
++ if test "$deplibs_check_method" != pass_all; then
++ # We're trying link a shared library against a static one
++ # but the system doesn't support it.
++
++ # Just print a warning and add the library to dependency_libs so
++ # that the program can be linked against the static library.
++ echo
++ echo "*** Warning: This system can not link to static lib archive $lib."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have."
++ if test "$module" = yes; then
++ echo "*** But as you try to build a module library, libtool will still create "
++ echo "*** a static module, that should work as long as the dlopening application"
++ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
++ if test -z "$global_symbol_pipe"; then
++ echo
++ echo "*** However, this would only work if libtool was able to extract symbol"
++ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
++ echo "*** not find such a program. So, this module is probably useless."
++ echo "*** \`nm' from GNU binutils and a full rebuild may help."
++ fi
++ if test "$build_old_libs" = no; then
++ build_libtool_libs=module
++ build_old_libs=yes
++ else
++ build_libtool_libs=no
++ fi
++ fi
++ else
++ convenience="$convenience $dir/$old_library"
++ old_convenience="$old_convenience $dir/$old_library"
++ deplibs="$dir/$old_library $deplibs"
++ link_static=yes
++ fi
++ fi # link shared/static library?
++
++ if test $linkmode = lib; then
++ if test -n "$dependency_libs" &&
++ { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
++ test $link_static = yes; }; then
++ # Extract -R from dependency_libs
++ temp_deplibs=
++ for libdir in $dependency_libs; do
++ case $libdir in
++ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
++ case " $xrpath " in
++ *" $temp_xrpath "*) ;;
++ *) xrpath="$xrpath $temp_xrpath";;
++ esac;;
++ *) temp_deplibs="$temp_deplibs $libdir";;
++ esac
++ done
++ dependency_libs="$temp_deplibs"
++ fi
++
++ newlib_search_path="$newlib_search_path $absdir"
++ # Link against this library
++ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
++ # ... and its dependency_libs
++ tmp_libs=
++ for deplib in $dependency_libs; do
++ newdependency_libs="$deplib $newdependency_libs"
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
++ tmp_libs="$tmp_libs $deplib"
++ done
++
++ if test $link_all_deplibs != no; then
++ # Add the search paths of all dependency libraries
++ for deplib in $dependency_libs; do
++ case $deplib in
++ -L*) path="$deplib" ;;
++ *.la)
++ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
++ test "X$dir" = "X$deplib" && dir="."
++ # We need an absolute path.
++ case $dir in
++ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
++ *)
++ absdir=`cd "$dir" && pwd`
++ if test -z "$absdir"; then
++ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
++ absdir="$dir"
++ fi
++ ;;
++ esac
++ if grep "^installed=no" $deplib > /dev/null; then
++ path="-L$absdir/$objdir"
++ else
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ if test "$absdir" != "$libdir"; then
++ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
++ fi
++ path="-L$absdir"
++ fi
++ ;;
++ *) continue ;;
++ esac
++ case " $deplibs " in
++ *" $path "*) ;;
++ *) deplibs="$deplibs $path" ;;
++ esac
++ done
++ fi # link_all_deplibs != no
++ fi # linkmode = lib
++ done # for deplib in $libs
++ if test $pass = dlpreopen; then
++ # Link the dlpreopened libraries before other libraries
++ for deplib in $save_deplibs; do
++ deplibs="$deplib $deplibs"
++ done
++ fi
++ if test $pass != dlopen; then
++ test $pass != scan && dependency_libs="$newdependency_libs"
++ if test $pass != conv; then
++ # Make sure lib_search_path contains only unique directories.
++ lib_search_path=
++ for dir in $newlib_search_path; do
++ case "$lib_search_path " in
++ *" $dir "*) ;;
++ *) lib_search_path="$lib_search_path $dir" ;;
++ esac
++ done
++ newlib_search_path=
++ fi
++
++ if test "$linkmode,$pass" != "prog,link"; then
++ vars="deplibs"
++ else
++ vars="compile_deplibs finalize_deplibs"
++ fi
++ for var in $vars dependency_libs; do
++ # Add libraries to $var in reverse order
++ eval tmp_libs=\"\$$var\"
++ new_libs=
++ for deplib in $tmp_libs; do
++ case $deplib in
++ -L*) new_libs="$deplib $new_libs" ;;
++ *)
++ case " $specialdeplibs " in
++ *" $deplib "*) new_libs="$deplib $new_libs" ;;
++ *)
++ case " $new_libs " in
++ *" $deplib "*) ;;
++ *) new_libs="$deplib $new_libs" ;;
++ esac
++ ;;
++ esac
++ ;;
++ esac
++ done
++ tmp_libs=
++ for deplib in $new_libs; do
++ case $deplib in
++ -L*)
++ case " $tmp_libs " in
++ *" $deplib "*) ;;
++ *) tmp_libs="$tmp_libs $deplib" ;;
++ esac
++ ;;
++ *) tmp_libs="$tmp_libs $deplib" ;;
++ esac
++ done
++ eval $var=\"$tmp_libs\"
++ done # for var
++ fi
++ if test "$pass" = "conv" &&
++ { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
++ libs="$deplibs" # reset libs
++ deplibs=
++ fi
++ done # for pass
++ if test $linkmode = prog; then
++ dlfiles="$newdlfiles"
++ dlprefiles="$newdlprefiles"
++ fi
++
++ case $linkmode in
++ oldlib)
++ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
++ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
++ fi
++
++ if test -n "$rpath"; then
++ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
++ fi
++
++ if test -n "$xrpath"; then
++ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
++ fi
++
++ if test -n "$vinfo"; then
++ $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
++ fi
++
++ if test -n "$release"; then
++ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
++ fi
++
++ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
++ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
++ fi
++
++ # Now set the variables for building old libraries.
++ build_libtool_libs=no
++ oldlibs="$output"
++ objs="$objs$old_deplibs"
++ ;;
++
++ lib)
++ # Make sure we only generate libraries of the form `libNAME.la'.
++ case $outputname in
++ lib*)
++ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
++ eval libname=\"$libname_spec\"
++ ;;
++ *)
++ if test "$module" = no; then
++ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++ if test "$need_lib_prefix" != no; then
++ # Add the "lib" prefix for modules if required
++ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
++ eval libname=\"$libname_spec\"
++ else
++ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
++ fi
++ ;;
++ esac
++
++ if test -n "$objs"; then
++ if test "$deplibs_check_method" != pass_all; then
++ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
++ exit 1
++ else
++ echo
++ echo "*** Warning: Linking the shared library $output against the non-libtool"
++ echo "*** objects $objs is not portable!"
++ libobjs="$libobjs $objs"
++ fi
++ fi
++
++ if test "$dlself" != no; then
++ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
++ fi
++
++ set dummy $rpath
++ if test $# -gt 2; then
++ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
++ fi
++ install_libdir="$2"
++
++ oldlibs=
++ if test -z "$rpath"; then
++ if test "$build_libtool_libs" = yes; then
++ # Building a libtool convenience library.
++ libext=al
++ oldlibs="$output_objdir/$libname.$libext $oldlibs"
++ build_libtool_libs=convenience
++ build_old_libs=yes
++ fi
++
++ if test -n "$vinfo"; then
++ $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
++ fi
++
++ if test -n "$release"; then
++ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
++ fi
++ else
++
++ # Parse the version information argument.
++ save_ifs="$IFS"; IFS=':'
++ set dummy $vinfo 0 0 0
++ IFS="$save_ifs"
++
++ if test -n "$8"; then
++ $echo "$modename: too many parameters to \`-version-info'" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ current="$2"
++ revision="$3"
++ age="$4"
++
++ # Check that each of the things are valid numbers.
++ case $current in
++ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
++ *)
++ $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
++ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
++ exit 1
++ ;;
++ esac
++
++ case $revision in
++ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
++ *)
++ $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
++ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
++ exit 1
++ ;;
++ esac
++
++ case $age in
++ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
++ *)
++ $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
++ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
++ exit 1
++ ;;
++ esac
++
++ if test $age -gt $current; then
++ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
++ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
++ exit 1
++ fi
++
++ # Calculate the version variables.
++ major=
++ versuffix=
++ verstring=
++ case $version_type in
++ none) ;;
++
++ darwin)
++ # Like Linux, but with the current version available in
++ # verstring for coding it into the library header
++ major=.`expr $current - $age`
++ versuffix="$major.$age.$revision"
++ # Darwin ld doesn't like 0 for these options...
++ minor_current=`expr $current + 1`
++ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
++ ;;
++
++ freebsd-aout)
++ major=".$current"
++ versuffix=".$current.$revision";
++ ;;
++
++ freebsd-elf)
++ major=".$current"
++ versuffix=".$current";
++ ;;
++
++ irix | nonstopux)
++ major=`expr $current - $age + 1`
++
++ case $version_type in
++ nonstopux) verstring_prefix=nonstopux ;;
++ *) verstring_prefix=sgi ;;
++ esac
++ verstring="$verstring_prefix$major.$revision"
++
++ # Add in all the interfaces that we are compatible with.
++ loop=$revision
++ while test $loop != 0; do
++ iface=`expr $revision - $loop`
++ loop=`expr $loop - 1`
++ verstring="$verstring_prefix$major.$iface:$verstring"
++ done
++
++ # Before this point, $major must not contain `.'.
++ major=.$major
++ versuffix="$major.$revision"
++ ;;
++
++ linux)
++ major=.`expr $current - $age`
++ versuffix="$major.$age.$revision"
++ ;;
++
++ osf)
++ major=.`expr $current - $age`
++ versuffix=".$current.$age.$revision"
++ verstring="$current.$age.$revision"
++
++ # Add in all the interfaces that we are compatible with.
++ loop=$age
++ while test $loop != 0; do
++ iface=`expr $current - $loop`
++ loop=`expr $loop - 1`
++ verstring="$verstring:${iface}.0"
++ done
++
++ # Make executables depend on our current version.
++ verstring="$verstring:${current}.0"
++ ;;
++
++ sunos)
++ major=".$current"
++ versuffix=".$current.$revision"
++ ;;
++
++ windows)
++ # Use '-' rather than '.', since we only want one
++ # extension on DOS 8.3 filesystems.
++ major=`expr $current - $age`
++ versuffix="-$major"
++ ;;
++
++ *)
++ $echo "$modename: unknown library version type \`$version_type'" 1>&2
++ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
++ exit 1
++ ;;
++ esac
++
++ # Clear the version info if we defaulted, and they specified a release.
++ if test -z "$vinfo" && test -n "$release"; then
++ major=
++ verstring="0.0"
++ case $version_type in
++ darwin)
++ # we can't check for "0.0" in archive_cmds due to quoting
++ # problems, so we reset it completely
++ verstring=""
++ ;;
++ *)
++ verstring="0.0"
++ ;;
++ esac
++ if test "$need_version" = no; then
++ versuffix=
++ else
++ versuffix=".0.0"
++ fi
++ fi
++
++ # Remove version info from name if versioning should be avoided
++ if test "$avoid_version" = yes && test "$need_version" = no; then
++ major=
++ versuffix=
++ verstring=""
++ fi
++
++ # Check to see if the archive will have undefined symbols.
++ if test "$allow_undefined" = yes; then
++ if test "$allow_undefined_flag" = unsupported; then
++ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
++ build_libtool_libs=no
++ build_old_libs=yes
++ fi
++ else
++ # Don't allow undefined symbols.
++ allow_undefined_flag="$no_undefined_flag"
++ fi
++ fi
++
++ if test "$mode" != relink; then
++ # Remove our outputs.
++ $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
++ $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
++ fi
++
++ # Now set the variables for building old libraries.
++ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
++ oldlibs="$oldlibs $output_objdir/$libname.$libext"
++
++ # Transform .lo files to .o files.
++ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
++ fi
++
++ # Eliminate all temporary directories.
++ for path in $notinst_path; do
++ lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
++ deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
++ dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
++ done
++
++ if test -n "$xrpath"; then
++ # If the user specified any rpath flags, then add them.
++ temp_xrpath=
++ for libdir in $xrpath; do
++ temp_xrpath="$temp_xrpath -R$libdir"
++ case "$finalize_rpath " in
++ *" $libdir "*) ;;
++ *) finalize_rpath="$finalize_rpath $libdir" ;;
++ esac
++ done
++ if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
++ dependency_libs="$temp_xrpath $dependency_libs"
++ fi
++ fi
++
++ # Make sure dlfiles contains only unique files that won't be dlpreopened
++ old_dlfiles="$dlfiles"
++ dlfiles=
++ for lib in $old_dlfiles; do
++ case " $dlprefiles $dlfiles " in
++ *" $lib "*) ;;
++ *) dlfiles="$dlfiles $lib" ;;
++ esac
++ done
++
++ # Make sure dlprefiles contains only unique files
++ old_dlprefiles="$dlprefiles"
++ dlprefiles=
++ for lib in $old_dlprefiles; do
++ case "$dlprefiles " in
++ *" $lib "*) ;;
++ *) dlprefiles="$dlprefiles $lib" ;;
++ esac
++ done
++
++ if test "$build_libtool_libs" = yes; then
++ if test -n "$rpath"; then
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
++ # these systems don't actually have a c library (as such)!
++ ;;
++ *-*-rhapsody* | *-*-darwin1.[012])
++ # Rhapsody C library is in the System framework
++ deplibs="$deplibs -framework System"
++ ;;
++ *-*-netbsd*)
++ # Don't link with libc until the a.out ld.so is fixed.
++ ;;
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc due to us having libc/libc_r.
++ ;;
++ *)
++ # Add libc to deplibs on all other systems if necessary.
++ if test $build_libtool_need_lc = "yes"; then
++ deplibs="$deplibs -lc"
++ fi
++ ;;
++ esac
++ fi
++
++ # Transform deplibs into only deplibs that can be linked in shared.
++ name_save=$name
++ libname_save=$libname
++ release_save=$release
++ versuffix_save=$versuffix
++ major_save=$major
++ # I'm not sure if I'm treating the release correctly. I think
++ # release should show up in the -l (ie -lgmp5) so we don't want to
++ # add it in twice. Is that correct?
++ release=""
++ versuffix=""
++ major=""
++ newdeplibs=
++ droppeddeps=no
++ case $deplibs_check_method in
++ pass_all)
++ # Don't check for shared/static. Everything works.
++ # This might be a little naive. We might want to check
++ # whether the library exists or not. But this is on
++ # osf3 & osf4 and I'm not really sure... Just
++ # implementing what was already the behaviour.
++ newdeplibs=$deplibs
++ ;;
++ test_compile)
++ # This code stresses the "libraries are programs" paradigm to its
++ # limits. Maybe even breaks it. We compile a program, linking it
++ # against the deplibs as a proxy for the library. Then we can check
++ # whether they linked in statically or dynamically with ldd.
++ $rm conftest.c
++ cat > conftest.c <<EOF
++ int main() { return 0; }
++EOF
++ $rm conftest
++ $CC -o conftest conftest.c $deplibs
++ if test $? -eq 0 ; then
++ ldd_output=`ldd conftest`
++ for i in $deplibs; do
++ name="`expr $i : '-l\(.*\)'`"
++ # If $name is empty we are operating on a -L argument.
++ if test -n "$name" && test "$name" != "0"; then
++ libname=`eval \\$echo \"$libname_spec\"`
++ deplib_matches=`eval \\$echo \"$library_names_spec\"`
++ set dummy $deplib_matches
++ deplib_match=$2
++ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
++ newdeplibs="$newdeplibs $i"
++ else
++ droppeddeps=yes
++ echo
++ echo "*** Warning: dynamic linker does not accept needed library $i."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which I believe you do not have"
++ echo "*** because a test_compile did reveal that the linker did not use it for"
++ echo "*** its dynamic dependency list that programs get resolved with at runtime."
++ fi
++ else
++ newdeplibs="$newdeplibs $i"
++ fi
++ done
++ else
++ # Error occured in the first compile. Let's try to salvage
++ # the situation: Compile a separate program for each library.
++ for i in $deplibs; do
++ name="`expr $i : '-l\(.*\)'`"
++ # If $name is empty we are operating on a -L argument.
++ if test -n "$name" && test "$name" != "0"; then
++ $rm conftest
++ $CC -o conftest conftest.c $i
++ # Did it work?
++ if test $? -eq 0 ; then
++ ldd_output=`ldd conftest`
++ libname=`eval \\$echo \"$libname_spec\"`
++ deplib_matches=`eval \\$echo \"$library_names_spec\"`
++ set dummy $deplib_matches
++ deplib_match=$2
++ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
++ newdeplibs="$newdeplibs $i"
++ else
++ droppeddeps=yes
++ echo
++ echo "*** Warning: dynamic linker does not accept needed library $i."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because a test_compile did reveal that the linker did not use this one"
++ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
++ fi
++ else
++ droppeddeps=yes
++ echo
++ echo "*** Warning! Library $i is needed by this library but I was not able to"
++ echo "*** make it link in! You will probably need to install it or some"
++ echo "*** library that it depends on before this library will be fully"
++ echo "*** functional. Installing it before continuing would be even better."
++ fi
++ else
++ newdeplibs="$newdeplibs $i"
++ fi
++ done
++ fi
++ ;;
++ file_magic*)
++ set dummy $deplibs_check_method
++ file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
++ for a_deplib in $deplibs; do
++ name="`expr $a_deplib : '-l\(.*\)'`"
++ # If $name is empty we are operating on a -L argument.
++ if test -n "$name" && test "$name" != "0"; then
++ libname=`eval \\$echo \"$libname_spec\"`
++ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
++ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
++ for potent_lib in $potential_libs; do
++ # Follow soft links.
++ if ls -lLd "$potent_lib" 2>/dev/null \
++ | grep " -> " >/dev/null; then
++ continue
++ fi
++ # The statement above tries to avoid entering an
++ # endless loop below, in case of cyclic links.
++ # We might still enter an endless loop, since a link
++ # loop can be closed while we follow links,
++ # but so what?
++ potlib="$potent_lib"
++ while test -h "$potlib" 2>/dev/null; do
++ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
++ case $potliblink in
++ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
++ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
++ esac
++ done
++ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
++ | ${SED} 10q \
++ | egrep "$file_magic_regex" > /dev/null; then
++ newdeplibs="$newdeplibs $a_deplib"
++ a_deplib=""
++ break 2
++ fi
++ done
++ done
++ if test -n "$a_deplib" ; then
++ droppeddeps=yes
++ echo
++ echo "*** Warning: linker path does not have real file for library $a_deplib."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because I did check the linker path looking for a file starting"
++ if test -z "$potlib" ; then
++ echo "*** with $libname but no candidates were found. (...for file magic test)"
++ else
++ echo "*** with $libname and none of the candidates passed a file format test"
++ echo "*** using a file magic. Last file checked: $potlib"
++ fi
++ fi
++ else
++ # Add a -L argument.
++ newdeplibs="$newdeplibs $a_deplib"
++ fi
++ done # Gone through all deplibs.
++ ;;
++ match_pattern*)
++ set dummy $deplibs_check_method
++ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
++ for a_deplib in $deplibs; do
++ name="`expr $a_deplib : '-l\(.*\)'`"
++ # If $name is empty we are operating on a -L argument.
++ if test -n "$name" && test "$name" != "0"; then
++ libname=`eval \\$echo \"$libname_spec\"`
++ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
++ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
++ for potent_lib in $potential_libs; do
++ potlib="$potent_lib" # see symlink-check below in file_magic test
++ if eval echo \"$potent_lib\" 2>/dev/null \
++ | ${SED} 10q \
++ | egrep "$match_pattern_regex" > /dev/null; then
++ newdeplibs="$newdeplibs $a_deplib"
++ a_deplib=""
++ break 2
++ fi
++ done
++ done
++ if test -n "$a_deplib" ; then
++ droppeddeps=yes
++ echo
++ echo "*** Warning: linker path does not have real file for library $a_deplib."
++ echo "*** I have the capability to make that library automatically link in when"
++ echo "*** you link to this library. But I can only do this if you have a"
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because I did check the linker path looking for a file starting"
++ if test -z "$potlib" ; then
++ echo "*** with $libname but no candidates were found. (...for regex pattern test)"
++ else
++ echo "*** with $libname and none of the candidates passed a file format test"
++ echo "*** using a regex pattern. Last file checked: $potlib"
++ fi
++ fi
++ else
++ # Add a -L argument.
++ newdeplibs="$newdeplibs $a_deplib"
++ fi
++ done # Gone through all deplibs.
++ ;;
++ none | unknown | *)
++ newdeplibs=""
++ if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
++ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
++ grep . >/dev/null; then
++ echo
++ if test "X$deplibs_check_method" = "Xnone"; then
++ echo "*** Warning: inter-library dependencies are not supported in this platform."
++ else
++ echo "*** Warning: inter-library dependencies are not known to be supported."
++ fi
++ echo "*** All declared inter-library dependencies are being dropped."
++ droppeddeps=yes
++ fi
++ ;;
++ esac
++ versuffix=$versuffix_save
++ major=$major_save
++ release=$release_save
++ libname=$libname_save
++ name=$name_save
++
++ case $host in
++ *-*-rhapsody* | *-*-darwin1.[012])
++ # On Rhapsody replace the C library is the System framework
++ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
++ ;;
++ esac
++
++ if test "$droppeddeps" = yes; then
++ if test "$module" = yes; then
++ echo
++ echo "*** Warning: libtool could not satisfy all declared inter-library"
++ echo "*** dependencies of module $libname. Therefore, libtool will create"
++ echo "*** a static module, that should work as long as the dlopening"
++ echo "*** application is linked with the -dlopen flag."
++ if test -z "$global_symbol_pipe"; then
++ echo
++ echo "*** However, this would only work if libtool was able to extract symbol"
++ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
++ echo "*** not find such a program. So, this module is probably useless."
++ echo "*** \`nm' from GNU binutils and a full rebuild may help."
++ fi
++ if test "$build_old_libs" = no; then
++ oldlibs="$output_objdir/$libname.$libext"
++ build_libtool_libs=module
++ build_old_libs=yes
++ else
++ build_libtool_libs=no
++ fi
++ else
++ echo "*** The inter-library dependencies that have been dropped here will be"
++ echo "*** automatically added whenever a program is linked with this library"
++ echo "*** or is declared to -dlopen it."
++
++ if test $allow_undefined = no; then
++ echo
++ echo "*** Since this library must not contain undefined symbols,"
++ echo "*** because either the platform does not support them or"
++ echo "*** it was explicitly requested with -no-undefined,"
++ echo "*** libtool will only create a static version of it."
++ if test "$build_old_libs" = no; then
++ oldlibs="$output_objdir/$libname.$libext"
++ build_libtool_libs=module
++ build_old_libs=yes
++ else
++ build_libtool_libs=no
++ fi
++ fi
++ fi
++ fi
++ # Done checking deplibs!
++ deplibs=$newdeplibs
++ fi
++
++ # All the library-specific variables (install_libdir is set above).
++ library_names=
++ old_library=
++ dlname=
++
++ # Test again, we may have decided not to build it any more
++ if test "$build_libtool_libs" = yes; then
++ if test $hardcode_into_libs = yes; then
++ # Hardcode the library paths
++ hardcode_libdirs=
++ dep_rpath=
++ rpath="$finalize_rpath"
++ test "$mode" != relink && rpath="$compile_rpath$rpath"
++ for libdir in $rpath; do
++ if test -n "$hardcode_libdir_flag_spec"; then
++ if test -n "$hardcode_libdir_separator"; then
++ if test -z "$hardcode_libdirs"; then
++ hardcode_libdirs="$libdir"
++ else
++ # Just accumulate the unique libdirs.
++ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
++ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
++ ;;
++ *)
++ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++ ;;
++ esac
++ fi
++ else
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ dep_rpath="$dep_rpath $flag"
++ fi
++ elif test -n "$runpath_var"; then
++ case "$perm_rpath " in
++ *" $libdir "*) ;;
++ *) perm_rpath="$perm_rpath $libdir" ;;
++ esac
++ fi
++ done
++ # Substitute the hardcoded libdirs into the rpath.
++ if test -n "$hardcode_libdir_separator" &&
++ test -n "$hardcode_libdirs"; then
++ libdir="$hardcode_libdirs"
++ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
++ fi
++ if test -n "$runpath_var" && test -n "$perm_rpath"; then
++ # We should set the runpath_var.
++ rpath=
++ for dir in $perm_rpath; do
++ rpath="$rpath$dir:"
++ done
++ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
++ fi
++ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
++ fi
++
++ shlibpath="$finalize_shlibpath"
++ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
++ if test -n "$shlibpath"; then
++ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
++ fi
++
++ # Get the real and link names of the library.
++ eval library_names=\"$library_names_spec\"
++ set dummy $library_names
++ realname="$2"
++ shift; shift
++
++ if test -n "$soname_spec"; then
++ eval soname=\"$soname_spec\"
++ else
++ soname="$realname"
++ fi
++ test -z "$dlname" && dlname=$soname
++
++ lib="$output_objdir/$realname"
++ for link
++ do
++ linknames="$linknames $link"
++ done
++
++ # Ensure that we have .o objects for linkers which dislike .lo
++ # (e.g. aix) in case we are running --disable-static
++ for obj in $libobjs; do
++ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$xdir" = "X$obj"; then
++ xdir="."
++ else
++ xdir="$xdir"
++ fi
++ baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
++ oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
++ if test ! -f $xdir/$oldobj; then
++ $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
++ $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
++ fi
++ done
++
++ # Use standard objects if they are pic
++ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++
++ # Prepare the list of exported symbols
++ if test -z "$export_symbols"; then
++ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
++ $show "generating symbol list for \`$libname.la'"
++ export_symbols="$output_objdir/$libname.exp"
++ $run $rm $export_symbols
++ eval cmds=\"$export_symbols_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ if test -n "$export_symbols_regex"; then
++ $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
++ $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
++ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
++ $run eval '$mv "${export_symbols}T" "$export_symbols"'
++ fi
++ fi
++ fi
++
++ if test -n "$export_symbols" && test -n "$include_expsyms"; then
++ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
++ fi
++
++ if test -n "$convenience"; then
++ if test -n "$whole_archive_flag_spec"; then
++ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
++ else
++ gentop="$output_objdir/${outputname}x"
++ $show "${rm}r $gentop"
++ $run ${rm}r "$gentop"
++ $show "mkdir $gentop"
++ $run mkdir "$gentop"
++ status=$?
++ if test $status -ne 0 && test ! -d "$gentop"; then
++ exit $status
++ fi
++ generated="$generated $gentop"
++
++ for xlib in $convenience; do
++ # Extract the objects.
++ case $xlib in
++ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
++ *) xabs=`pwd`"/$xlib" ;;
++ esac
++ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
++ xdir="$gentop/$xlib"
++
++ $show "${rm}r $xdir"
++ $run ${rm}r "$xdir"
++ $show "mkdir $xdir"
++ $run mkdir "$xdir"
++ status=$?
++ if test $status -ne 0 && test ! -d "$xdir"; then
++ exit $status
++ fi
++ $show "(cd $xdir && $AR x $xabs)"
++ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
++
++ libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
++ done
++ fi
++ fi
++
++ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
++ eval flag=\"$thread_safe_flag_spec\"
++ linker_flags="$linker_flags $flag"
++ fi
++
++ # Make a backup of the uninstalled library when relinking
++ if test "$mode" = relink; then
++ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
++ fi
++
++ # Do each of the archive commands.
++ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
++ eval cmds=\"$archive_expsym_cmds\"
++ else
++ save_deplibs="$deplibs"
++ for conv in $convenience; do
++ tmp_deplibs=
++ for test_deplib in $deplibs; do
++ if test "$test_deplib" != "$conv"; then
++ tmp_deplibs="$tmp_deplibs $test_deplib"
++ fi
++ done
++ deplibs="$tmp_deplibs"
++ done
++ eval cmds=\"$archive_cmds\"
++ deplibs="$save_deplibs"
++ fi
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++
++ # Restore the uninstalled library and exit
++ if test "$mode" = relink; then
++ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
++ exit 0
++ fi
++
++ # Create links to the real library.
++ for linkname in $linknames; do
++ if test "$realname" != "$linkname"; then
++ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
++ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
++ fi
++ done
++
++ # If -module or -export-dynamic was specified, set the dlname.
++ if test "$module" = yes || test "$export_dynamic" = yes; then
++ # On all known operating systems, these are identical.
++ dlname="$soname"
++ fi
++ fi
++ ;;
++
++ obj)
++ if test -n "$deplibs"; then
++ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
++ fi
++
++ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
++ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
++ fi
++
++ if test -n "$rpath"; then
++ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
++ fi
++
++ if test -n "$xrpath"; then
++ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
++ fi
++
++ if test -n "$vinfo"; then
++ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
++ fi
++
++ if test -n "$release"; then
++ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
++ fi
++
++ case $output in
++ *.lo)
++ if test -n "$objs$old_deplibs"; then
++ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
++ exit 1
++ fi
++ libobj="$output"
++ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
++ ;;
++ *)
++ libobj=
++ obj="$output"
++ ;;
++ esac
++
++ # Delete the old objects.
++ $run $rm $obj $libobj
++
++ # Objects from convenience libraries. This assumes
++ # single-version convenience libraries. Whenever we create
++ # different ones for PIC/non-PIC, this we'll have to duplicate
++ # the extraction.
++ reload_conv_objs=
++ gentop=
++ # reload_cmds runs $LD directly, so let us get rid of
++ # -Wl from whole_archive_flag_spec
++ wl=
++
++ if test -n "$convenience"; then
++ if test -n "$whole_archive_flag_spec"; then
++ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
++ else
++ gentop="$output_objdir/${obj}x"
++ $show "${rm}r $gentop"
++ $run ${rm}r "$gentop"
++ $show "mkdir $gentop"
++ $run mkdir "$gentop"
++ status=$?
++ if test $status -ne 0 && test ! -d "$gentop"; then
++ exit $status
++ fi
++ generated="$generated $gentop"
++
++ for xlib in $convenience; do
++ # Extract the objects.
++ case $xlib in
++ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
++ *) xabs=`pwd`"/$xlib" ;;
++ esac
++ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
++ xdir="$gentop/$xlib"
++
++ $show "${rm}r $xdir"
++ $run ${rm}r "$xdir"
++ $show "mkdir $xdir"
++ $run mkdir "$xdir"
++ status=$?
++ if test $status -ne 0 && test ! -d "$xdir"; then
++ exit $status
++ fi
++ $show "(cd $xdir && $AR x $xabs)"
++ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
++
++ reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
++ done
++ fi
++ fi
++
++ # Create the old-style object.
++ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
++
++ output="$obj"
++ eval cmds=\"$reload_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++
++ # Exit if we aren't doing a library object file.
++ if test -z "$libobj"; then
++ if test -n "$gentop"; then
++ $show "${rm}r $gentop"
++ $run ${rm}r $gentop
++ fi
++
++ exit 0
++ fi
++
++ if test "$build_libtool_libs" != yes; then
++ if test -n "$gentop"; then
++ $show "${rm}r $gentop"
++ $run ${rm}r $gentop
++ fi
++
++ # Create an invalid libtool object if no PIC, so that we don't
++ # accidentally link it into a program.
++ $show "echo timestamp > $libobj"
++ $run eval "echo timestamp > $libobj" || exit $?
++ exit 0
++ fi
++
++ if test -n "$pic_flag" || test "$pic_mode" != default; then
++ # Only do commands if we really have different PIC objects.
++ reload_objs="$libobjs $reload_conv_objs"
++ output="$libobj"
++ eval cmds=\"$reload_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ else
++ # Just create a symlink.
++ $show $rm $libobj
++ $run $rm $libobj
++ xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$xdir" = "X$libobj"; then
++ xdir="."
++ else
++ xdir="$xdir"
++ fi
++ baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
++ oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
++ $show "(cd $xdir && $LN_S $oldobj $baseobj)"
++ $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
++ fi
++
++ if test -n "$gentop"; then
++ $show "${rm}r $gentop"
++ $run ${rm}r $gentop
++ fi
++
++ exit 0
++ ;;
++
++ prog)
++ case $host in
++ *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
++ esac
++ if test -n "$vinfo"; then
++ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
++ fi
++
++ if test -n "$release"; then
++ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
++ fi
++
++ if test "$preload" = yes; then
++ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
++ test "$dlopen_self_static" = unknown; then
++ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
++ fi
++ fi
++
++ case $host in
++ *-*-rhapsody* | *-*-darwin1.[012])
++ # On Rhapsody replace the C library is the System framework
++ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
++ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
++ case $host in
++ *darwin*)
++ # Don't allow lazy linking, it breaks C++ global constructors
++ compile_command="$compile_command ${wl}-bind_at_load"
++ finalize_command="$finalize_command ${wl}-bind_at_load"
++ ;;
++ esac
++ ;;
++ esac
++
++ compile_command="$compile_command $compile_deplibs"
++ finalize_command="$finalize_command $finalize_deplibs"
++
++ if test -n "$rpath$xrpath"; then
++ # If the user specified any rpath flags, then add them.
++ for libdir in $rpath $xrpath; do
++ # This is the magic to use -rpath.
++ case "$finalize_rpath " in
++ *" $libdir "*) ;;
++ *) finalize_rpath="$finalize_rpath $libdir" ;;
++ esac
++ done
++ fi
++
++ # Now hardcode the library paths
++ rpath=
++ hardcode_libdirs=
++ for libdir in $compile_rpath $finalize_rpath; do
++ if test -n "$hardcode_libdir_flag_spec"; then
++ if test -n "$hardcode_libdir_separator"; then
++ if test -z "$hardcode_libdirs"; then
++ hardcode_libdirs="$libdir"
++ else
++ # Just accumulate the unique libdirs.
++ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
++ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
++ ;;
++ *)
++ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++ ;;
++ esac
++ fi
++ else
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ rpath="$rpath $flag"
++ fi
++ elif test -n "$runpath_var"; then
++ case "$perm_rpath " in
++ *" $libdir "*) ;;
++ *) perm_rpath="$perm_rpath $libdir" ;;
++ esac
++ fi
++ case $host in
++ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
++ case :$dllsearchpath: in
++ *":$libdir:"*) ;;
++ *) dllsearchpath="$dllsearchpath:$libdir";;
++ esac
++ ;;
++ esac
++ done
++ # Substitute the hardcoded libdirs into the rpath.
++ if test -n "$hardcode_libdir_separator" &&
++ test -n "$hardcode_libdirs"; then
++ libdir="$hardcode_libdirs"
++ eval rpath=\" $hardcode_libdir_flag_spec\"
++ fi
++ compile_rpath="$rpath"
++
++ rpath=
++ hardcode_libdirs=
++ for libdir in $finalize_rpath; do
++ if test -n "$hardcode_libdir_flag_spec"; then
++ if test -n "$hardcode_libdir_separator"; then
++ if test -z "$hardcode_libdirs"; then
++ hardcode_libdirs="$libdir"
++ else
++ # Just accumulate the unique libdirs.
++ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
++ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
++ ;;
++ *)
++ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++ ;;
++ esac
++ fi
++ else
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ rpath="$rpath $flag"
++ fi
++ elif test -n "$runpath_var"; then
++ case "$finalize_perm_rpath " in
++ *" $libdir "*) ;;
++ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
++ esac
++ fi
++ done
++ # Substitute the hardcoded libdirs into the rpath.
++ if test -n "$hardcode_libdir_separator" &&
++ test -n "$hardcode_libdirs"; then
++ libdir="$hardcode_libdirs"
++ eval rpath=\" $hardcode_libdir_flag_spec\"
++ fi
++ finalize_rpath="$rpath"
++
++ if test -n "$libobjs" && test "$build_old_libs" = yes; then
++ # Transform all the library objects into standard objects.
++ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++ fi
++
++ dlsyms=
++ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
++ if test -n "$NM" && test -n "$global_symbol_pipe"; then
++ dlsyms="${outputname}S.c"
++ else
++ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
++ fi
++ fi
++
++ if test -n "$dlsyms"; then
++ case $dlsyms in
++ "") ;;
++ *.c)
++ # Discover the nlist of each of the dlfiles.
++ nlist="$output_objdir/${outputname}.nm"
++
++ $show "$rm $nlist ${nlist}S ${nlist}T"
++ $run $rm "$nlist" "${nlist}S" "${nlist}T"
++
++ # Parse the name list into a source file.
++ $show "creating $output_objdir/$dlsyms"
++
++ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
++/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
++/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
++
++#ifdef __cplusplus
++extern \"C\" {
++#endif
++
++/* Prevent the only kind of declaration conflicts we can make. */
++#define lt_preloaded_symbols some_other_symbol
++
++/* External symbol declarations for the compiler. */\
++"
++
++ if test "$dlself" = yes; then
++ $show "generating symbol list for \`$output'"
++
++ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
++
++ # Add our own program objects to the symbol list.
++ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
++ for arg in $progfiles; do
++ $show "extracting global C symbols from \`$arg'"
++ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
++ done
++
++ if test -n "$exclude_expsyms"; then
++ $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
++ $run eval '$mv "$nlist"T "$nlist"'
++ fi
++
++ if test -n "$export_symbols_regex"; then
++ $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
++ $run eval '$mv "$nlist"T "$nlist"'
++ fi
++
++ # Prepare the list of exported symbols
++ if test -z "$export_symbols"; then
++ export_symbols="$output_objdir/$output.exp"
++ $run $rm $export_symbols
++ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
++ else
++ $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
++ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
++ $run eval 'mv "$nlist"T "$nlist"'
++ fi
++ fi
++
++ for arg in $dlprefiles; do
++ $show "extracting global C symbols from \`$arg'"
++ name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
++ $run eval 'echo ": $name " >> "$nlist"'
++ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
++ done
++
++ if test -z "$run"; then
++ # Make sure we have at least an empty file.
++ test -f "$nlist" || : > "$nlist"
++
++ if test -n "$exclude_expsyms"; then
++ egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
++ $mv "$nlist"T "$nlist"
++ fi
++
++ # Try sorting and uniquifying the output.
++ if grep -v "^: " < "$nlist" |
++ if sort -k 3 </dev/null >/dev/null 2>&1; then
++ sort -k 3
++ else
++ sort +2
++ fi |
++ uniq > "$nlist"S; then
++ :
++ else
++ grep -v "^: " < "$nlist" > "$nlist"S
++ fi
++
++ if test -f "$nlist"S; then
++ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
++ else
++ echo '/* NONE */' >> "$output_objdir/$dlsyms"
++ fi
++
++ $echo >> "$output_objdir/$dlsyms" "\
++
++#undef lt_preloaded_symbols
++
++#if defined (__STDC__) && __STDC__
++# define lt_ptr void *
++#else
++# define lt_ptr char *
++# define const
++#endif
++
++/* The mapping between symbol names and symbols. */
++const struct {
++ const char *name;
++ lt_ptr address;
++}
++lt_preloaded_symbols[] =
++{\
++"
++
++ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
++
++ $echo >> "$output_objdir/$dlsyms" "\
++ {0, (lt_ptr) 0}
++};
++
++/* This works around a problem in FreeBSD linker */
++#ifdef FREEBSD_WORKAROUND
++static const void *lt_preloaded_setup() {
++ return lt_preloaded_symbols;
++}
++#endif
++
++#ifdef __cplusplus
++}
++#endif\
++"
++ fi
++
++ pic_flag_for_symtable=
++ case $host in
++ # compiling the symbol table file with pic_flag works around
++ # a FreeBSD bug that causes programs to crash when -lm is
++ # linked before any other PIC object. But we must not use
++ # pic_flag when linking with -static. The problem exists in
++ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
++ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
++ case "$compile_command " in
++ *" -static "*) ;;
++ *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
++ esac;;
++ *-*-hpux*)
++ case "$compile_command " in
++ *" -static "*) ;;
++ *) pic_flag_for_symtable=" $pic_flag -DPIC";;
++ esac
++ esac
++
++ # Now compile the dynamic symbol file.
++ $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
++ $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
++
++ # Clean up the generated files.
++ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
++ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
++
++ # Transform the symbol file into the correct name.
++ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
++ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
++ ;;
++ *)
++ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
++ exit 1
++ ;;
++ esac
++ else
++ # We keep going just in case the user didn't refer to
++ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
++ # really was required.
++
++ # Nullify the symbol file.
++ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
++ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
++ fi
++
++ if test $need_relink = no || test "$build_libtool_libs" != yes; then
++ # Replace the output file specification.
++ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
++ link_command="$compile_command$compile_rpath"
++
++ # We have no uninstalled library dependencies, so finalize right now.
++ $show "$link_command"
++ $run eval "$link_command"
++ status=$?
++
++ # Delete the generated files.
++ if test -n "$dlsyms"; then
++ $show "$rm $output_objdir/${outputname}S.${objext}"
++ $run $rm "$output_objdir/${outputname}S.${objext}"
++ fi
++
++ exit $status
++ fi
++
++ if test -n "$shlibpath_var"; then
++ # We should set the shlibpath_var
++ rpath=
++ for dir in $temp_rpath; do
++ case $dir in
++ [\\/]* | [A-Za-z]:[\\/]*)
++ # Absolute path.
++ rpath="$rpath$dir:"
++ ;;
++ *)
++ # Relative path: add a thisdir entry.
++ rpath="$rpath\$thisdir/$dir:"
++ ;;
++ esac
++ done
++ temp_rpath="$rpath"
++ fi
++
++ if test -n "$compile_shlibpath$finalize_shlibpath"; then
++ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
++ fi
++ if test -n "$finalize_shlibpath"; then
++ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
++ fi
++
++ compile_var=
++ finalize_var=
++ if test -n "$runpath_var"; then
++ if test -n "$perm_rpath"; then
++ # We should set the runpath_var.
++ rpath=
++ for dir in $perm_rpath; do
++ rpath="$rpath$dir:"
++ done
++ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
++ fi
++ if test -n "$finalize_perm_rpath"; then
++ # We should set the runpath_var.
++ rpath=
++ for dir in $finalize_perm_rpath; do
++ rpath="$rpath$dir:"
++ done
++ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
++ fi
++ fi
++
++ if test "$no_install" = yes; then
++ # We don't need to create a wrapper script.
++ link_command="$compile_var$compile_command$compile_rpath"
++ # Replace the output file specification.
++ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
++ # Delete the old output file.
++ $run $rm $output
++ # Link the executable and exit
++ $show "$link_command"
++ $run eval "$link_command" || exit $?
++ exit 0
++ fi
++
++ if test "$hardcode_action" = relink; then
++ # Fast installation is not supported
++ link_command="$compile_var$compile_command$compile_rpath"
++ relink_command="$finalize_var$finalize_command$finalize_rpath"
++
++ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
++ $echo "$modename: \`$output' will be relinked during installation" 1>&2
++ else
++ if test "$fast_install" != no; then
++ link_command="$finalize_var$compile_command$finalize_rpath"
++ if test "$fast_install" = yes; then
++ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
++ else
++ # fast_install is set to needless
++ relink_command=
++ fi
++ else
++ link_command="$compile_var$compile_command$compile_rpath"
++ relink_command="$finalize_var$finalize_command$finalize_rpath"
++ fi
++ fi
++
++ # Replace the output file specification.
++ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
++
++ # Delete the old output files.
++ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
++
++ $show "$link_command"
++ $run eval "$link_command" || exit $?
++
++ # Now create the wrapper script.
++ $show "creating $output"
++
++ # Quote the relink command for shipping.
++ if test -n "$relink_command"; then
++ # Preserve any variables that may affect compiler behavior
++ for var in $variables_saved_for_relink; do
++ if eval test -z \"\${$var+set}\"; then
++ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
++ elif eval var_value=\$$var; test -z "$var_value"; then
++ relink_command="$var=; export $var; $relink_command"
++ else
++ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
++ relink_command="$var=\"$var_value\"; export $var; $relink_command"
++ fi
++ done
++ relink_command="(cd `pwd`; $relink_command)"
++ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
++ fi
++
++ # Quote $echo for shipping.
++ if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
++ case $0 in
++ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
++ *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
++ esac
++ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
++ else
++ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
++ fi
++
++ # Only actually do things if our run command is non-null.
++ if test -z "$run"; then
++ # win32 will think the script is a binary if it has
++ # a .exe suffix, so we strip it off here.
++ case $output in
++ *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
++ esac
++ # test for cygwin because mv fails w/o .exe extensions
++ case $host in
++ *cygwin*) exeext=.exe ;;
++ *) exeext= ;;
++ esac
++ $rm $output
++ trap "$rm $output; exit 1" 1 2 15
++
++ $echo > $output "\
++#! $SHELL
++
++# $output - temporary wrapper script for $objdir/$outputname
++# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
++#
++# The $output program cannot be directly executed until all the libtool
++# libraries that it depends on are installed.
++#
++# This wrapper script should never be moved out of the build directory.
++# If it is, it will not operate correctly.
++
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed="${SED}"' -e 1s/^X//'
++sed_quote_subst='$sed_quote_subst'
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
++
++relink_command=\"$relink_command\"
++
++# This environment variable determines our operation mode.
++if test \"\$libtool_install_magic\" = \"$magic\"; then
++ # install mode needs the following variable:
++ notinst_deplibs='$notinst_deplibs'
++else
++ # When we are sourced in execute mode, \$file and \$echo are already set.
++ if test \"\$libtool_execute_magic\" != \"$magic\"; then
++ echo=\"$qecho\"
++ file=\"\$0\"
++ # Make sure echo works.
++ if test \"X\$1\" = X--no-reexec; then
++ # Discard the --no-reexec flag, and continue.
++ shift
++ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
++ # Yippee, \$echo works!
++ :
++ else
++ # Restart under the correct shell, and then maybe \$echo will work.
++ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
++ fi
++ fi\
++"
++ $echo >> $output "\
++
++ # Find the directory that this script lives in.
++ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
++ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
++
++ # Follow symbolic links until we get to the real thisdir.
++ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
++ while test -n \"\$file\"; do
++ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
++
++ # If there was a directory component, then change thisdir.
++ if test \"x\$destdir\" != \"x\$file\"; then
++ case \"\$destdir\" in
++ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
++ *) thisdir=\"\$thisdir/\$destdir\" ;;
++ esac
++ fi
++
++ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
++ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
++ done
++
++ # Try to get the absolute directory name.
++ absdir=\`cd \"\$thisdir\" && pwd\`
++ test -n \"\$absdir\" && thisdir=\"\$absdir\"
++"
++
++ if test "$fast_install" = yes; then
++ echo >> $output "\
++ program=lt-'$outputname'$exeext
++ progdir=\"\$thisdir/$objdir\"
++
++ if test ! -f \"\$progdir/\$program\" || \\
++ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
++ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
++
++ file=\"\$\$-\$program\"
++
++ if test ! -d \"\$progdir\"; then
++ $mkdir \"\$progdir\"
++ else
++ $rm \"\$progdir/\$file\"
++ fi"
++
++ echo >> $output "\
++
++ # relink executable if necessary
++ if test -n \"\$relink_command\"; then
++ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
++ else
++ $echo \"\$relink_command_output\" >&2
++ $rm \"\$progdir/\$file\"
++ exit 1
++ fi
++ fi
++
++ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
++ { $rm \"\$progdir/\$program\";
++ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
++ $rm \"\$progdir/\$file\"
++ fi"
++ else
++ echo >> $output "\
++ program='$outputname'
++ progdir=\"\$thisdir/$objdir\"
++"
++ fi
++
++ echo >> $output "\
++
++ if test -f \"\$progdir/\$program\"; then"
++
++ # Export our shlibpath_var if we have one.
++ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
++ $echo >> $output "\
++ # Add our own library path to $shlibpath_var
++ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
++
++ # Some systems cannot cope with colon-terminated $shlibpath_var
++ # The second colon is a workaround for a bug in BeOS R4 ${SED}
++ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
++
++ export $shlibpath_var
++"
++ fi
++
++ # fixup the dll searchpath if we need to.
++ if test -n "$dllsearchpath"; then
++ $echo >> $output "\
++ # Add the dll search path components to the executable PATH
++ PATH=$dllsearchpath:\$PATH
++"
++ fi
++
++ $echo >> $output "\
++ if test \"\$libtool_execute_magic\" != \"$magic\"; then
++ # Run the actual program with our arguments.
++"
++ case $host in
++ # win32 systems need to use the prog path for dll
++ # lookup to work
++ *-*-cygwin* | *-*-pw32*)
++ $echo >> $output "\
++ exec \$progdir/\$program \${1+\"\$@\"}
++"
++ ;;
++
++ # Backslashes separate directories on plain windows
++ *-*-mingw | *-*-os2*)
++ $echo >> $output "\
++ exec \$progdir\\\\\$program \${1+\"\$@\"}
++"
++ ;;
++
++ *)
++ $echo >> $output "\
++ # Export the path to the program.
++ PATH=\"\$progdir:\$PATH\"
++ export PATH
++
++ exec \$program \${1+\"\$@\"}
++"
++ ;;
++ esac
++ $echo >> $output "\
++ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
++ exit 1
++ fi
++ else
++ # The program doesn't exist.
++ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
++ \$echo \"This script is just a wrapper for \$program.\" 1>&2
++ echo \"See the $PACKAGE documentation for more information.\" 1>&2
++ exit 1
++ fi
++fi\
++"
++ chmod +x $output
++ fi
++ exit 0
++ ;;
++ esac
++
++ # See if we need to build an old-fashioned archive.
++ for oldlib in $oldlibs; do
++
++ if test "$build_libtool_libs" = convenience; then
++ oldobjs="$libobjs_save"
++ addlibs="$convenience"
++ build_libtool_libs=no
++ else
++ if test "$build_libtool_libs" = module; then
++ oldobjs="$libobjs_save"
++ build_libtool_libs=no
++ else
++ oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
++ fi
++ addlibs="$old_convenience"
++ fi
++
++ if test -n "$addlibs"; then
++ gentop="$output_objdir/${outputname}x"
++ $show "${rm}r $gentop"
++ $run ${rm}r "$gentop"
++ $show "mkdir $gentop"
++ $run mkdir "$gentop"
++ status=$?
++ if test $status -ne 0 && test ! -d "$gentop"; then
++ exit $status
++ fi
++ generated="$generated $gentop"
++
++ # Add in members from convenience archives.
++ for xlib in $addlibs; do
++ # Extract the objects.
++ case $xlib in
++ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
++ *) xabs=`pwd`"/$xlib" ;;
++ esac
++ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
++ xdir="$gentop/$xlib"
++
++ $show "${rm}r $xdir"
++ $run ${rm}r "$xdir"
++ $show "mkdir $xdir"
++ $run mkdir "$xdir"
++ status=$?
++ if test $status -ne 0 && test ! -d "$xdir"; then
++ exit $status
++ fi
++ $show "(cd $xdir && $AR x $xabs)"
++ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
++
++ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
++ done
++ fi
++
++ # Do each command in the archive commands.
++ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
++ eval cmds=\"$old_archive_from_new_cmds\"
++ else
++ # Ensure that we have .o objects in place in case we decided
++ # not to build a shared library, and have fallen back to building
++ # static libs even though --disable-static was passed!
++ for oldobj in $oldobjs; do
++ if test ! -f $oldobj; then
++ xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$xdir" = "X$oldobj"; then
++ xdir="."
++ else
++ xdir="$xdir"
++ fi
++ baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
++ obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
++ $show "(cd $xdir && ${LN_S} $obj $baseobj)"
++ $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
++ fi
++ done
++
++ eval cmds=\"$old_archive_cmds\"
++ fi
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ done
++
++ if test -n "$generated"; then
++ $show "${rm}r$generated"
++ $run ${rm}r$generated
++ fi
++
++ # Now create the libtool archive.
++ case $output in
++ *.la)
++ old_library=
++ test "$build_old_libs" = yes && old_library="$libname.$libext"
++ $show "creating $output"
++
++ # Preserve any variables that may affect compiler behavior
++ for var in $variables_saved_for_relink; do
++ if eval test -z \"\${$var+set}\"; then
++ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
++ elif eval var_value=\$$var; test -z "$var_value"; then
++ relink_command="$var=; export $var; $relink_command"
++ else
++ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
++ relink_command="$var=\"$var_value\"; export $var; $relink_command"
++ fi
++ done
++ # Quote the link command for shipping.
++ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
++ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
++
++ # Only create the output if not a dry run.
++ if test -z "$run"; then
++ for installed in no yes; do
++ if test "$installed" = yes; then
++ if test -z "$install_libdir"; then
++ break
++ fi
++ output="$output_objdir/$outputname"i
++ # Replace all uninstalled libtool libraries with the installed ones
++ newdependency_libs=
++ for deplib in $dependency_libs; do
++ case $deplib in
++ *.la)
++ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ newdependency_libs="$newdependency_libs $libdir/$name"
++ ;;
++ *) newdependency_libs="$newdependency_libs $deplib" ;;
++ esac
++ done
++ dependency_libs="$newdependency_libs"
++ newdlfiles=
++ for lib in $dlfiles; do
++ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ newdlfiles="$newdlfiles $libdir/$name"
++ done
++ dlfiles="$newdlfiles"
++ newdlprefiles=
++ for lib in $dlprefiles; do
++ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ if test -z "$libdir"; then
++ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
++ exit 1
++ fi
++ newdlprefiles="$newdlprefiles $libdir/$name"
++ done
++ dlprefiles="$newdlprefiles"
++ fi
++ $rm $output
++ # place dlname in correct position for cygwin
++ tdlname=$dlname
++ case $host,$output,$installed,$module,$dlname in
++ *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
++ esac
++ $echo > $output "\
++# $outputname - a libtool library file
++# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
++#
++# Please DO NOT delete this file!
++# It is necessary for linking the library.
++
++# The name that we can dlopen(3).
++dlname='$tdlname'
++
++# Names of this library.
++library_names='$library_names'
++
++# The name of the static archive.
++old_library='$old_library'
++
++# Libraries that this one depends upon.
++dependency_libs='$dependency_libs'
++
++# Version information for $libname.
++current=$current
++age=$age
++revision=$revision
++
++# Is this an already installed library?
++installed=$installed
++
++# Files to dlopen/dlpreopen
++dlopen='$dlfiles'
++dlpreopen='$dlprefiles'
++
++# Directory that this library needs to be installed in:
++libdir='$install_libdir'"
++ if test "$installed" = no && test $need_relink = yes; then
++ $echo >> $output "\
++relink_command=\"$relink_command\""
++ fi
++ done
++ fi
++
++ # Do a symbolic link so that the libtool archive can be found in
++ # LD_LIBRARY_PATH before the program is installed.
++ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
++ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
++ ;;
++ esac
++ exit 0
++ ;;
++
++ # libtool install mode
++ install)
++ modename="$modename: install"
++
++ # There may be an optional sh(1) argument at the beginning of
++ # install_prog (especially on Windows NT).
++ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
++ # Allow the use of GNU shtool's install command.
++ $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
++ # Aesthetically quote it.
++ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
++ arg="\"$arg\""
++ ;;
++ esac
++ install_prog="$arg "
++ arg="$1"
++ shift
++ else
++ install_prog=
++ arg="$nonopt"
++ fi
++
++ # The real first argument should be the name of the installation program.
++ # Aesthetically quote it.
++ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
++ arg="\"$arg\""
++ ;;
++ esac
++ install_prog="$install_prog$arg"
++
++ # We need to accept at least all the BSD install flags.
++ dest=
++ files=
++ opts=
++ prev=
++ install_type=
++ isdir=no
++ stripme=
++ for arg
++ do
++ if test -n "$dest"; then
++ files="$files $dest"
++ dest="$arg"
++ continue
++ fi
++
++ case $arg in
++ -d) isdir=yes ;;
++ -f) prev="-f" ;;
++ -g) prev="-g" ;;
++ -m) prev="-m" ;;
++ -o) prev="-o" ;;
++ -s)
++ stripme=" -s"
++ continue
++ ;;
++ -*) ;;
++
++ *)
++ # If the previous option needed an argument, then skip it.
++ if test -n "$prev"; then
++ prev=
++ else
++ dest="$arg"
++ continue
++ fi
++ ;;
++ esac
++
++ # Aesthetically quote the argument.
++ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
++ case $arg in
++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
++ arg="\"$arg\""
++ ;;
++ esac
++ install_prog="$install_prog $arg"
++ done
++
++ if test -z "$install_prog"; then
++ $echo "$modename: you must specify an install program" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ if test -n "$prev"; then
++ $echo "$modename: the \`$prev' option requires an argument" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ if test -z "$files"; then
++ if test -z "$dest"; then
++ $echo "$modename: no file or destination specified" 1>&2
++ else
++ $echo "$modename: you must specify a destination" 1>&2
++ fi
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ # Strip any trailing slash from the destination.
++ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
++
++ # Check to see that the destination is a directory.
++ test -d "$dest" && isdir=yes
++ if test "$isdir" = yes; then
++ destdir="$dest"
++ destname=
++ else
++ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
++ test "X$destdir" = "X$dest" && destdir=.
++ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
++
++ # Not a directory, so check to see that there is only one file specified.
++ set dummy $files
++ if test $# -gt 2; then
++ $echo "$modename: \`$dest' is not a directory" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++ fi
++ case $destdir in
++ [\\/]* | [A-Za-z]:[\\/]*) ;;
++ *)
++ for file in $files; do
++ case $file in
++ *.lo) ;;
++ *)
++ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ ;;
++ esac
++ done
++ ;;
++ esac
++
++ # This variable tells wrapper scripts just to set variables rather
++ # than running their programs.
++ libtool_install_magic="$magic"
++
++ staticlibs=
++ future_libdirs=
++ current_libdirs=
++ for file in $files; do
++
++ # Do each installation.
++ case $file in
++ *.$libext)
++ # Do the static libraries later.
++ staticlibs="$staticlibs $file"
++ ;;
++
++ *.la)
++ # Check to see that this really is a libtool archive.
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ else
++ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ library_names=
++ old_library=
++ relink_command=
++ # If there is no directory component, then add one.
++ case $file in
++ */* | *\\*) . $file ;;
++ *) . ./$file ;;
++ esac
++
++ # Add the libdir to current_libdirs if it is the destination.
++ if test "X$destdir" = "X$libdir"; then
++ case "$current_libdirs " in
++ *" $libdir "*) ;;
++ *) current_libdirs="$current_libdirs $libdir" ;;
++ esac
++ else
++ # Note the libdir as a future libdir.
++ case "$future_libdirs " in
++ *" $libdir "*) ;;
++ *) future_libdirs="$future_libdirs $libdir" ;;
++ esac
++ fi
++
++ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
++ test "X$dir" = "X$file/" && dir=
++ dir="$dir$objdir"
++
++ if test -n "$relink_command"; then
++ # Determine the prefix the user has applied to our future dir.
++ inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
++
++ # Don't allow the user to place us outside of our expected
++ # location b/c this prevents finding dependent libraries that
++ # are installed to the same prefix.
++ if test "$inst_prefix_dir" = "$destdir"; then
++ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
++ exit 1
++ fi
++
++ if test -n "$inst_prefix_dir"; then
++ # Stick the inst_prefix_dir data into the link command.
++ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
++ else
++ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
++ fi
++
++ $echo "$modename: warning: relinking \`$file'" 1>&2
++ $show "$relink_command"
++ if $run eval "$relink_command"; then :
++ else
++ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
++ exit 1
++ fi
++ fi
++
++ # See the names of the shared library.
++ set dummy $library_names
++ if test -n "$2"; then
++ realname="$2"
++ shift
++ shift
++
++ srcname="$realname"
++ test -n "$relink_command" && srcname="$realname"T
++
++ # Install the shared library and build the symlinks.
++ $show "$install_prog $dir/$srcname $destdir/$realname"
++ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
++ if test -n "$stripme" && test -n "$striplib"; then
++ $show "$striplib $destdir/$realname"
++ $run eval "$striplib $destdir/$realname" || exit $?
++ fi
++
++ if test $# -gt 0; then
++ # Delete the old symlinks, and create new ones.
++ for linkname
++ do
++ if test "$linkname" != "$realname"; then
++ $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
++ $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
++ fi
++ done
++ fi
++
++ # Do each command in the postinstall commands.
++ lib="$destdir/$realname"
++ eval cmds=\"$postinstall_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ fi
++
++ # Install the pseudo-library for information purposes.
++ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
++ instname="$dir/$name"i
++ $show "$install_prog $instname $destdir/$name"
++ $run eval "$install_prog $instname $destdir/$name" || exit $?
++
++ # Maybe install the static library, too.
++ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
++ ;;
++
++ *.lo)
++ # Install (i.e. copy) a libtool object.
++
++ # Figure out destination file name, if it wasn't already specified.
++ if test -n "$destname"; then
++ destfile="$destdir/$destname"
++ else
++ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
++ destfile="$destdir/$destfile"
++ fi
++
++ # Deduce the name of the destination old-style object file.
++ case $destfile in
++ *.lo)
++ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
++ ;;
++ *.$objext)
++ staticdest="$destfile"
++ destfile=
++ ;;
++ *)
++ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ ;;
++ esac
++
++ # Install the libtool object if requested.
++ if test -n "$destfile"; then
++ $show "$install_prog $file $destfile"
++ $run eval "$install_prog $file $destfile" || exit $?
++ fi
++
++ # Install the old object if enabled.
++ if test "$build_old_libs" = yes; then
++ # Deduce the name of the old-style object file.
++ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
++
++ $show "$install_prog $staticobj $staticdest"
++ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
++ fi
++ exit 0
++ ;;
++
++ *)
++ # Figure out destination file name, if it wasn't already specified.
++ if test -n "$destname"; then
++ destfile="$destdir/$destname"
++ else
++ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
++ destfile="$destdir/$destfile"
++ fi
++
++ # Do a test to see if this is really a libtool program.
++ case $host in
++ *cygwin*|*mingw*)
++ wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
++ ;;
++ *)
++ wrapper=$file
++ ;;
++ esac
++ if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
++ notinst_deplibs=
++ relink_command=
++
++ # If there is no directory component, then add one.
++ case $file in
++ */* | *\\*) . $wrapper ;;
++ *) . ./$wrapper ;;
++ esac
++
++ # Check the variables that should have been set.
++ if test -z "$notinst_deplibs"; then
++ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
++ exit 1
++ fi
++
++ finalize=yes
++ for lib in $notinst_deplibs; do
++ # Check to see that each library is installed.
++ libdir=
++ if test -f "$lib"; then
++ # If there is no directory component, then add one.
++ case $lib in
++ */* | *\\*) . $lib ;;
++ *) . ./$lib ;;
++ esac
++ fi
++ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
++ if test -n "$libdir" && test ! -f "$libfile"; then
++ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
++ finalize=no
++ fi
++ done
++
++ relink_command=
++ # If there is no directory component, then add one.
++ case $file in
++ */* | *\\*) . $wrapper ;;
++ *) . ./$wrapper ;;
++ esac
++
++ outputname=
++ if test "$fast_install" = no && test -n "$relink_command"; then
++ if test "$finalize" = yes && test -z "$run"; then
++ tmpdir="/tmp"
++ test -n "$TMPDIR" && tmpdir="$TMPDIR"
++ tmpdir="$tmpdir/libtool-$$"
++ if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
++ else
++ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
++ continue
++ fi
++ file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
++ outputname="$tmpdir/$file"
++ # Replace the output file specification.
++ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
++
++ $show "$relink_command"
++ if $run eval "$relink_command"; then :
++ else
++ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
++ ${rm}r "$tmpdir"
++ continue
++ fi
++ file="$outputname"
++ else
++ $echo "$modename: warning: cannot relink \`$file'" 1>&2
++ fi
++ else
++ # Install the binary that we compiled earlier.
++ file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
++ fi
++ fi
++
++ # remove .exe since cygwin /usr/bin/install will append another
++ # one anyways
++ case $install_prog,$host in
++ /usr/bin/install*,*cygwin*)
++ case $file:$destfile in
++ *.exe:*.exe)
++ # this is ok
++ ;;
++ *.exe:*)
++ destfile=$destfile.exe
++ ;;
++ *:*.exe)
++ destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
++ ;;
++ esac
++ ;;
++ esac
++ $show "$install_prog$stripme $file $destfile"
++ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
++ test -n "$outputname" && ${rm}r "$tmpdir"
++ ;;
++ esac
++ done
++
++ for file in $staticlibs; do
++ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
++
++ # Set up the ranlib parameters.
++ oldlib="$destdir/$name"
++
++ $show "$install_prog $file $oldlib"
++ $run eval "$install_prog \$file \$oldlib" || exit $?
++
++ if test -n "$stripme" && test -n "$striplib"; then
++ $show "$old_striplib $oldlib"
++ $run eval "$old_striplib $oldlib" || exit $?
++ fi
++
++ # Do each command in the postinstall commands.
++ eval cmds=\"$old_postinstall_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++ done
++
++ if test -n "$future_libdirs"; then
++ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
++ fi
++
++ if test -n "$current_libdirs"; then
++ # Maybe just do a dry run.
++ test -n "$run" && current_libdirs=" -n$current_libdirs"
++ exec_cmd='$SHELL $0 --finish$current_libdirs'
++ else
++ exit 0
++ fi
++ ;;
++
++ # libtool finish mode
++ finish)
++ modename="$modename: finish"
++ libdirs="$nonopt"
++ admincmds=
++
++ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
++ for dir
++ do
++ libdirs="$libdirs $dir"
++ done
++
++ for libdir in $libdirs; do
++ if test -n "$finish_cmds"; then
++ # Do each command in the finish commands.
++ eval cmds=\"$finish_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || admincmds="$admincmds
++ $cmd"
++ done
++ IFS="$save_ifs"
++ fi
++ if test -n "$finish_eval"; then
++ # Do the single finish_eval.
++ eval cmds=\"$finish_eval\"
++ $run eval "$cmds" || admincmds="$admincmds
++ $cmds"
++ fi
++ done
++ fi
++
++ # Exit here if they wanted silent mode.
++ test "$show" = ":" && exit 0
++
++ echo "----------------------------------------------------------------------"
++ echo "Libraries have been installed in:"
++ for libdir in $libdirs; do
++ echo " $libdir"
++ done
++ echo
++ echo "If you ever happen to want to link against installed libraries"
++ echo "in a given directory, LIBDIR, you must either use libtool, and"
++ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
++ echo "flag during linking and do at least one of the following:"
++ if test -n "$shlibpath_var"; then
++ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
++ echo " during execution"
++ fi
++ if test -n "$runpath_var"; then
++ echo " - add LIBDIR to the \`$runpath_var' environment variable"
++ echo " during linking"
++ fi
++ if test -n "$hardcode_libdir_flag_spec"; then
++ libdir=LIBDIR
++ eval flag=\"$hardcode_libdir_flag_spec\"
++
++ echo " - use the \`$flag' linker flag"
++ fi
++ if test -n "$admincmds"; then
++ echo " - have your system administrator run these commands:$admincmds"
++ fi
++ if test -f /etc/ld.so.conf; then
++ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
++ fi
++ echo
++ echo "See any operating system documentation about shared libraries for"
++ echo "more information, such as the ld(1) and ld.so(8) manual pages."
++ echo "----------------------------------------------------------------------"
++ exit 0
++ ;;
++
++ # libtool execute mode
++ execute)
++ modename="$modename: execute"
++
++ # The first argument is the command name.
++ cmd="$nonopt"
++ if test -z "$cmd"; then
++ $echo "$modename: you must specify a COMMAND" 1>&2
++ $echo "$help"
++ exit 1
++ fi
++
++ # Handle -dlopen flags immediately.
++ for file in $execute_dlfiles; do
++ if test ! -f "$file"; then
++ $echo "$modename: \`$file' is not a file" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ dir=
++ case $file in
++ *.la)
++ # Check to see that this really is a libtool archive.
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ else
++ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ # Read the libtool library.
++ dlname=
++ library_names=
++
++ # If there is no directory component, then add one.
++ case $file in
++ */* | *\\*) . $file ;;
++ *) . ./$file ;;
++ esac
++
++ # Skip this library if it cannot be dlopened.
++ if test -z "$dlname"; then
++ # Warn if it was a shared library.
++ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
++ continue
++ fi
++
++ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
++ test "X$dir" = "X$file" && dir=.
++
++ if test -f "$dir/$objdir/$dlname"; then
++ dir="$dir/$objdir"
++ else
++ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
++ exit 1
++ fi
++ ;;
++
++ *.lo)
++ # Just add the directory containing the .lo file.
++ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
++ test "X$dir" = "X$file" && dir=.
++ ;;
++
++ *)
++ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
++ continue
++ ;;
++ esac
++
++ # Get the absolute pathname.
++ absdir=`cd "$dir" && pwd`
++ test -n "$absdir" && dir="$absdir"
++
++ # Now add the directory to shlibpath_var.
++ if eval "test -z \"\$$shlibpath_var\""; then
++ eval "$shlibpath_var=\"\$dir\""
++ else
++ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
++ fi
++ done
++
++ # This variable tells wrapper scripts just to set shlibpath_var
++ # rather than running their programs.
++ libtool_execute_magic="$magic"
++
++ # Check if any of the arguments is a wrapper script.
++ args=
++ for file
++ do
++ case $file in
++ -*) ;;
++ *)
++ # Do a test to see if this is really a libtool program.
++ if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ # If there is no directory component, then add one.
++ case $file in
++ */* | *\\*) . $file ;;
++ *) . ./$file ;;
++ esac
++
++ # Transform arg to wrapped name.
++ file="$progdir/$program"
++ fi
++ ;;
++ esac
++ # Quote arguments (to preserve shell metacharacters).
++ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
++ args="$args \"$file\""
++ done
++
++ if test -z "$run"; then
++ if test -n "$shlibpath_var"; then
++ # Export the shlibpath_var.
++ eval "export $shlibpath_var"
++ fi
++
++ # Restore saved enviroment variables
++ if test "${save_LC_ALL+set}" = set; then
++ LC_ALL="$save_LC_ALL"; export LC_ALL
++ fi
++ if test "${save_LANG+set}" = set; then
++ LANG="$save_LANG"; export LANG
++ fi
++
++ # Now prepare to actually exec the command.
++ exec_cmd="\$cmd$args"
++ else
++ # Display what would be done.
++ if test -n "$shlibpath_var"; then
++ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
++ $echo "export $shlibpath_var"
++ fi
++ $echo "$cmd$args"
++ exit 0
++ fi
++ ;;
++
++ # libtool clean and uninstall mode
++ clean | uninstall)
++ modename="$modename: $mode"
++ rm="$nonopt"
++ files=
++ rmforce=
++ exit_status=0
++
++ # This variable tells wrapper scripts just to set variables rather
++ # than running their programs.
++ libtool_install_magic="$magic"
++
++ for arg
++ do
++ case $arg in
++ -f) rm="$rm $arg"; rmforce=yes ;;
++ -*) rm="$rm $arg" ;;
++ *) files="$files $arg" ;;
++ esac
++ done
++
++ if test -z "$rm"; then
++ $echo "$modename: you must specify an RM program" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ fi
++
++ rmdirs=
++
++ for file in $files; do
++ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$dir" = "X$file"; then
++ dir=.
++ objdir="$objdir"
++ else
++ objdir="$dir/$objdir"
++ fi
++ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
++ test $mode = uninstall && objdir="$dir"
++
++ # Remember objdir for removal later, being careful to avoid duplicates
++ if test $mode = clean; then
++ case " $rmdirs " in
++ *" $objdir "*) ;;
++ *) rmdirs="$rmdirs $objdir" ;;
++ esac
++ fi
++
++ # Don't error if the file doesn't exist and rm -f was used.
++ if (test -L "$file") >/dev/null 2>&1 \
++ || (test -h "$file") >/dev/null 2>&1 \
++ || test -f "$file"; then
++ :
++ elif test -d "$file"; then
++ exit_status=1
++ continue
++ elif test "$rmforce" = yes; then
++ continue
++ fi
++
++ rmfiles="$file"
++
++ case $name in
++ *.la)
++ # Possibly a libtool archive, so verify it.
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ . $dir/$name
++
++ # Delete the libtool libraries and symlinks.
++ for n in $library_names; do
++ rmfiles="$rmfiles $objdir/$n"
++ done
++ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
++ test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
++
++ if test $mode = uninstall; then
++ if test -n "$library_names"; then
++ # Do each command in the postuninstall commands.
++ eval cmds=\"$postuninstall_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd"
++ if test $? != 0 && test "$rmforce" != yes; then
++ exit_status=1
++ fi
++ done
++ IFS="$save_ifs"
++ fi
++
++ if test -n "$old_library"; then
++ # Do each command in the old_postuninstall commands.
++ eval cmds=\"$old_postuninstall_cmds\"
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd"
++ if test $? != 0 && test "$rmforce" != yes; then
++ exit_status=1
++ fi
++ done
++ IFS="$save_ifs"
++ fi
++ # FIXME: should reinstall the best remaining shared library.
++ fi
++ fi
++ ;;
++
++ *.lo)
++ if test "$build_old_libs" = yes; then
++ oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
++ rmfiles="$rmfiles $dir/$oldobj"
++ fi
++ ;;
++
++ *)
++ # Do a test to see if this is a libtool program.
++ if test $mode = clean &&
++ (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ relink_command=
++ . $file
++
++ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
++ if test "$fast_install" = yes && test -n "$relink_command"; then
++ rmfiles="$rmfiles $objdir/lt-$name"
++ fi
++ fi
++ ;;
++ esac
++ $show "$rm $rmfiles"
++ $run $rm $rmfiles || exit_status=1
++ done
++
++ # Try to remove the ${objdir}s in the directories where we deleted files
++ for dir in $rmdirs; do
++ if test -d "$dir"; then
++ $show "rmdir $dir"
++ $run rmdir $dir >/dev/null 2>&1
++ fi
++ done
++
++ exit $exit_status
++ ;;
++
++ "")
++ $echo "$modename: you must specify a MODE" 1>&2
++ $echo "$generic_help" 1>&2
++ exit 1
++ ;;
++ esac
++
++ if test -z "$exec_cmd"; then
++ $echo "$modename: invalid operation mode \`$mode'" 1>&2
++ $echo "$generic_help" 1>&2
++ exit 1
++ fi
++fi # test -z "$show_help"
++
++if test -n "$exec_cmd"; then
++ eval exec $exec_cmd
++ exit 1
++fi
++
++# We need to display help for each of the modes.
++case $mode in
++"") $echo \
++"Usage: $modename [OPTION]... [MODE-ARG]...
++
++Provide generalized library-building support services.
++
++ --config show all configuration variables
++ --debug enable verbose shell tracing
++-n, --dry-run display commands without modifying any files
++ --features display basic configuration information and exit
++ --finish same as \`--mode=finish'
++ --help display this help message and exit
++ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
++ --quiet same as \`--silent'
++ --silent don't print informational messages
++ --version print version information
++
++MODE must be one of the following:
++
++ clean remove files from the build directory
++ compile compile a source file into a libtool object
++ execute automatically set library path, then run a program
++ finish complete the installation of libtool libraries
++ install install libraries or executables
++ link create a library or an executable
++ uninstall remove libraries from an installed directory
++
++MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
++a more detailed description of MODE."
++ exit 0
++ ;;
++
++clean)
++ $echo \
++"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
++
++Remove files from the build directory.
++
++RM is the name of the program to use to delete files associated with each FILE
++(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
++to RM.
++
++If FILE is a libtool library, object or program, all the files associated
++with it are deleted. Otherwise, only FILE itself is deleted using RM."
++ ;;
++
++compile)
++ $echo \
++"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
++
++Compile a source file into a libtool library object.
++
++This mode accepts the following additional options:
++
++ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
++ -prefer-pic try to building PIC objects only
++ -prefer-non-pic try to building non-PIC objects only
++ -static always build a \`.o' file suitable for static linking
++
++COMPILE-COMMAND is a command to be used in creating a \`standard' object file
++from the given SOURCEFILE.
++
++The output file name is determined by removing the directory component from
++SOURCEFILE, then substituting the C source code suffix \`.c' with the
++library object suffix, \`.lo'."
++ ;;
++
++execute)
++ $echo \
++"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
++
++Automatically set library path, then run a program.
++
++This mode accepts the following additional options:
++
++ -dlopen FILE add the directory containing FILE to the library path
++
++This mode sets the library path environment variable according to \`-dlopen'
++flags.
++
++If any of the ARGS are libtool executable wrappers, then they are translated
++into their corresponding uninstalled binary, and any of their required library
++directories are added to the library path.
++
++Then, COMMAND is executed, with ARGS as arguments."
++ ;;
++
++finish)
++ $echo \
++"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
++
++Complete the installation of libtool libraries.
++
++Each LIBDIR is a directory that contains libtool libraries.
++
++The commands that this mode executes may require superuser privileges. Use
++the \`--dry-run' option if you just want to see what would be executed."
++ ;;
++
++install)
++ $echo \
++"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
++
++Install executables or libraries.
++
++INSTALL-COMMAND is the installation command. The first component should be
++either the \`install' or \`cp' program.
++
++The rest of the components are interpreted as arguments to that command (only
++BSD-compatible install options are recognized)."
++ ;;
++
++link)
++ $echo \
++"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
++
++Link object files or libraries together to form another library, or to
++create an executable program.
++
++LINK-COMMAND is a command using the C compiler that you would use to create
++a program from several object files.
++
++The following components of LINK-COMMAND are treated specially:
++
++ -all-static do not do any dynamic linking at all
++ -avoid-version do not add a version suffix if possible
++ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
++ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
++ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
++ -export-symbols SYMFILE
++ try to export only the symbols listed in SYMFILE
++ -export-symbols-regex REGEX
++ try to export only the symbols matching REGEX
++ -LLIBDIR search LIBDIR for required installed libraries
++ -lNAME OUTPUT-FILE requires the installed library libNAME
++ -module build a library that can dlopened
++ -no-fast-install disable the fast-install mode
++ -no-install link a not-installable executable
++ -no-undefined declare that a library does not refer to external symbols
++ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
++ -release RELEASE specify package release information
++ -rpath LIBDIR the created library will eventually be installed in LIBDIR
++ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
++ -static do not do any dynamic linking of libtool libraries
++ -version-info CURRENT[:REVISION[:AGE]]
++ specify library version info [each variable defaults to 0]
++
++All other options (arguments beginning with \`-') are ignored.
++
++Every other argument is treated as a filename. Files ending in \`.la' are
++treated as uninstalled libtool libraries, other files are standard or library
++object files.
++
++If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
++only library objects (\`.lo' files) may be specified, and \`-rpath' is
++required, except when creating a convenience library.
++
++If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
++using \`ar' and \`ranlib', or on Windows using \`lib'.
++
++If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
++is created, otherwise an executable program is created."
++ ;;
++
++uninstall)
++ $echo \
++"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
++
++Remove libraries from an installation directory.
++
++RM is the name of the program to use to delete files associated with each FILE
++(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
++to RM.
++
++If FILE is a libtool library, all the files associated with it are deleted.
++Otherwise, only FILE itself is deleted using RM."
++ ;;
++
++*)
++ $echo "$modename: invalid operation mode \`$mode'" 1>&2
++ $echo "$help" 1>&2
++ exit 1
++ ;;
++esac
++
++echo
++$echo "Try \`$modename --help' for more information about other modes."
++
++exit 0
++
++# Local Variables:
++# mode:shell-script
++# sh-indentation:2
++# End:
+diff -ruN libnet-1.0.2a-orig/missing libnet-1.0.2a-7/missing
+--- libnet-1.0.2a-orig/missing 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/missing 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,336 @@
++#! /bin/sh
++# Common stub for a few missing GNU programs while installing.
++# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
++# Originally 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
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++if test $# -eq 0; then
++ echo 1>&2 "Try \`$0 --help' for more information"
++ exit 1
++fi
++
++run=:
++
++# 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
++--run)
++ # Try to run requested program, and just exit if it succeeds.
++ run=
++ shift
++ "$@" && exit 0
++ ;;
++esac
++
++# If it does not exist, or fails to run (possibly an outdated version),
++# try to emulate it.
++case "$1" in
++
++ -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.
++
++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'
++ 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
++ tar try tar, gnutar, gtar, then tar without non-portable flags
++ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
++ ;;
++
++ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
++ echo "missing 0.4 - GNU automake"
++ ;;
++
++ -*)
++ echo 1>&2 "$0: Unknown \`$1' option"
++ echo 1>&2 "Try \`$0 --help' for more information"
++ exit 1
++ ;;
++
++ aclocal*)
++ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
++ # We have it, but it failed.
++ exit 1
++ fi
++
++ echo 1>&2 "\
++WARNING: \`$1' is missing on your system. 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)
++ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
++ # We have it, but it failed.
++ exit 1
++ fi
++
++ echo 1>&2 "\
++WARNING: \`$1' is missing on your system. 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)
++ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
++ # We have it, but it failed.
++ exit 1
++ fi
++
++ echo 1>&2 "\
++WARNING: \`$1' is missing on your system. 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*)
++ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
++ # We have it, but it failed.
++ exit 1
++ fi
++
++ echo 1>&2 "\
++WARNING: \`$1' is missing on your system. 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)
++ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
++ # We have it, but it failed.
++ exit 1
++ fi
++
++ echo 1>&2 "\
++WARNING: \`$1' is needed, and you do not seem to have it handy on your
++ system. 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 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
++ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
++ 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' is missing on your system. 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 [ $# -ne 1 ]; then
++ eval LASTARG="\${$#}"
++ case "$LASTARG" in
++ *.y)
++ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
++ if [ -f "$SRCFILE" ]; then
++ cp "$SRCFILE" y.tab.c
++ fi
++ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
++ if [ -f "$SRCFILE" ]; then
++ cp "$SRCFILE" y.tab.h
++ fi
++ ;;
++ esac
++ fi
++ if [ ! -f y.tab.h ]; then
++ echo >y.tab.h
++ fi
++ if [ ! -f y.tab.c ]; then
++ echo 'main() { return 0; }' >y.tab.c
++ fi
++ ;;
++
++ lex|flex)
++ echo 1>&2 "\
++WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then
++ eval LASTARG="\${$#}"
++ case "$LASTARG" in
++ *.l)
++ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
++ if [ -f "$SRCFILE" ]; then
++ cp "$SRCFILE" lex.yy.c
++ fi
++ ;;
++ esac
++ fi
++ if [ ! -f lex.yy.c ]; then
++ echo 'main() { return 0; }' >lex.yy.c
++ fi
++ ;;
++
++ help2man)
++ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
++ # We have it, but it failed.
++ exit 1
++ fi
++
++ echo 1>&2 "\
++WARNING: \`$1' is missing on your system. 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 's/.*-o \([^ ]*\).*/\1/p'`
++ if test -z "$file"; then
++ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
++ fi
++ if [ -f "$file" ]; then
++ touch $file
++ else
++ test -z "$file" || exec >$file
++ echo ".ab help2man is required to generate this page"
++ exit 1
++ fi
++ ;;
++
++ makeinfo)
++ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
++ # We have makeinfo, but it failed.
++ exit 1
++ fi
++
++ echo 1>&2 "\
++WARNING: \`$1' is missing on your system. 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."
++ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
++ if test -z "$file"; then
++ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
++ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
++ fi
++ touch $file
++ ;;
++
++ tar)
++ shift
++ if test -n "$run"; then
++ echo 1>&2 "ERROR: \`tar' requires --run"
++ exit 1
++ fi
++
++ # We have already tried tar in the generic part.
++ # Look for gnutar/gtar before invocation to avoid ugly error
++ # messages.
++ if (gnutar --version > /dev/null 2>&1); then
++ gnutar "$@" && exit 0
++ fi
++ if (gtar --version > /dev/null 2>&1); then
++ gtar "$@" && exit 0
++ fi
++ firstarg="$1"
++ if shift; then
++ case "$firstarg" in
++ *o*)
++ firstarg=`echo "$firstarg" | sed s/o//`
++ tar "$firstarg" "$@" && exit 0
++ ;;
++ esac
++ case "$firstarg" in
++ *h*)
++ firstarg=`echo "$firstarg" | sed s/h//`
++ tar "$firstarg" "$@" && exit 0
++ ;;
++ esac
++ fi
++
++ echo 1>&2 "\
++WARNING: I can't seem to be able to run \`tar' with the given arguments.
++ You may want to install GNU tar or Free paxutils, or check the
++ command line arguments."
++ exit 1
++ ;;
++
++ *)
++ echo 1>&2 "\
++WARNING: \`$1' is needed, and you do not seem to have it handy on your
++ system. 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
++ ;;
++esac
++
++exit 0
+diff -ruN libnet-1.0.2a-orig/mkinstalldirs libnet-1.0.2a-7/mkinstalldirs
+--- libnet-1.0.2a-orig/mkinstalldirs 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/mkinstalldirs 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,111 @@
++#! /bin/sh
++# mkinstalldirs --- make directory hierarchy
++# Author: Noah Friedman <friedman@prep.ai.mit.edu>
++# Created: 1993-05-16
++# Public domain
++
++errstatus=0
++dirmode=""
++
++usage="\
++Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
++
++# process command line arguments
++while test $# -gt 0 ; do
++ case $1 in
++ -h | --help | --h*) # -h for help
++ echo "$usage" 1>&2
++ exit 0
++ ;;
++ -m) # -m PERM arg
++ shift
++ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
++ dirmode=$1
++ shift
++ ;;
++ --) # stop option processing
++ shift
++ break
++ ;;
++ -*) # unknown option
++ echo "$usage" 1>&2
++ exit 1
++ ;;
++ *) # first non-opt arg
++ break
++ ;;
++ esac
++done
++
++for file
++do
++ if test -d "$file"; then
++ shift
++ else
++ break
++ fi
++done
++
++case $# in
++ 0) exit 0 ;;
++esac
++
++case $dirmode in
++ '')
++ if mkdir -p -- . 2>/dev/null; then
++ echo "mkdir -p -- $*"
++ exec mkdir -p -- "$@"
++ fi
++ ;;
++ *)
++ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
++ echo "mkdir -m $dirmode -p -- $*"
++ exec mkdir -m "$dirmode" -p -- "$@"
++ fi
++ ;;
++esac
++
++for file
++do
++ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
++ shift
++
++ pathcomp=
++ for d
++ do
++ pathcomp="$pathcomp$d"
++ case $pathcomp in
++ -*) pathcomp=./$pathcomp ;;
++ esac
++
++ if test ! -d "$pathcomp"; then
++ echo "mkdir $pathcomp"
++
++ mkdir "$pathcomp" || lasterr=$?
++
++ if test ! -d "$pathcomp"; then
++ errstatus=$lasterr
++ else
++ if test ! -z "$dirmode"; then
++ echo "chmod $dirmode $pathcomp"
++ lasterr=""
++ chmod "$dirmode" "$pathcomp" || lasterr=$?
++
++ if test ! -z "$lasterr"; then
++ errstatus=$lasterr
++ fi
++ fi
++ fi
++ fi
++
++ pathcomp="$pathcomp/"
++ done
++done
++
++exit $errstatus
++
++# Local Variables:
++# mode: shell-script
++# sh-indentation: 2
++# End:
++# mkinstalldirs ends here
+diff -ruN libnet-1.0.2a-orig/src/Makefile.am libnet-1.0.2a-7/src/Makefile.am
+--- libnet-1.0.2a-orig/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/src/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,56 @@
++include $(top_srcdir)/Makefile.am.common
++
++lib_LTLIBRARIES = libnet.la
++
++libnet_la_SOURCES = \
++ libnet_resolve.c \
++ libnet_socket.c \
++ libnet_checksum.c \
++ libnet_prand.c \
++ libnet_version.c \
++ libnet_write_ip.c \
++ libnet_insert_ipo.c \
++ libnet_insert_tcpo.c \
++ libnet_error.c \
++ libnet_link_@LL_INT_TYPE@.c \
++ libnet_packet_mem.c \
++ libnet_build_ip.c \
++ libnet_build_tcp.c \
++ libnet_build_udp.c \
++ libnet_build_arp.c \
++ libnet_build_ethernet.c \
++ libnet_build_icmp.c \
++ libnet_build_igmp.c \
++ libnet_build_dns.c \
++ libnet_build_snmp.c \
++ libnet_build_rip.c \
++ libnet_build_ospf.c \
++ libnet_build_vrrp.c \
++ libnet_asn1.c \
++ libnet_hex_dump.c \
++ libnet_if_addr.c \
++ libnet_port_list.c
++
++libnet_la_LIBADD = @LTLIBOBJS@
++
++# Here are a set of rules to help you update your library version
++# information:
++#
++# 1. If the library source code has changed at all since the last
++# update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
++#
++# 2. If any interfaces have been added, removed, or changed since the
++# last update, increment CURRENT, and set REVISION to 0.
++#
++# 3. If any interfaces have been added since the last public release,
++# then increment AGE.
++#
++# 4. If any interfaces have been removed since the last public release,
++# then set AGE to 0.
++libnet_la_LDFLAGS = -version-info 0:0:0 # CURRENT[:REVISION[:AGE]]
++
++install-data-hook:
++ ln -f -s libnet.a $(DESTDIR)$(libdir)/libwrite.a
++
++uninstall-hook:
++ rm -f $(DESTDIR)$(libdir)/libwrite.a
+diff -ruN libnet-1.0.2a-orig/src/Makefile.in libnet-1.0.2a-7/src/Makefile.in
+--- libnet-1.0.2a-orig/src/Makefile.in 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/src/Makefile.in 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,502 @@
++# Makefile.in generated by automake 1.8.5 from Makefile.am.
++# @configure_input@
++
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004 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@
++
++SOURCES = $(libnet_la_SOURCES)
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++pkgdatadir = $(datadir)/@PACKAGE@
++pkglibdir = $(libdir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@
++top_builddir = ..
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++INSTALL = @INSTALL@
++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@
++DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
++ $(top_srcdir)/Makefile.am.common
++subdir = src
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
++ $(top_srcdir)/configure.in
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++ $(ACLOCAL_M4)
++mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
++CONFIG_HEADER = $(top_builddir)/include/config.h
++CONFIG_CLEAN_FILES =
++am__installdirs = "$(DESTDIR)$(libdir)"
++libLTLIBRARIES_INSTALL = $(INSTALL)
++LTLIBRARIES = $(lib_LTLIBRARIES)
++libnet_la_DEPENDENCIES = @LTLIBOBJS@
++am_libnet_la_OBJECTS = libnet_resolve.lo libnet_socket.lo \
++ libnet_checksum.lo libnet_prand.lo libnet_version.lo \
++ libnet_write_ip.lo libnet_insert_ipo.lo libnet_insert_tcpo.lo \
++ libnet_error.lo libnet_link_@LL_INT_TYPE@.lo \
++ libnet_packet_mem.lo libnet_build_ip.lo libnet_build_tcp.lo \
++ libnet_build_udp.lo libnet_build_arp.lo \
++ libnet_build_ethernet.lo libnet_build_icmp.lo \
++ libnet_build_igmp.lo libnet_build_dns.lo libnet_build_snmp.lo \
++ libnet_build_rip.lo libnet_build_ospf.lo libnet_build_vrrp.lo \
++ libnet_asn1.lo libnet_hex_dump.lo libnet_if_addr.lo \
++ libnet_port_list.lo
++libnet_la_OBJECTS = $(am_libnet_la_OBJECTS)
++DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
++depcomp =
++am__depfiles_maybe =
++COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
++ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
++ $(AM_CFLAGS) $(CFLAGS)
++CCLD = $(CC)
++LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
++ $(AM_LDFLAGS) $(LDFLAGS) -o $@
++SOURCES = $(libnet_la_SOURCES)
++DIST_SOURCES = $(libnet_la_SOURCES)
++ETAGS = etags
++CTAGS = ctags
++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
++ACLOCAL = @ACLOCAL@
++ADDITIONAL_LIBS = @ADDITIONAL_LIBS@
++AMDEP_FALSE = @AMDEP_FALSE@
++AMDEP_TRUE = @AMDEP_TRUE@
++AMTAR = @AMTAR@
++AR = @AR@
++AUTOCONF = @AUTOCONF@
++AUTOHEADER = @AUTOHEADER@
++AUTOMAKE = @AUTOMAKE@
++AWK = @AWK@
++BIN_PREFIX = @BIN_PREFIX@
++CC = @CC@
++CCDEPMODE = @CCDEPMODE@
++CFLAGS = @CFLAGS@
++CPP = @CPP@
++CPPFLAGS = @CPPFLAGS@
++CYGPATH_W = @CYGPATH_W@
++DEFS = @DEFS@
++DEPDIR = @DEPDIR@
++ECHO = @ECHO@
++ECHO_C = @ECHO_C@
++ECHO_N = @ECHO_N@
++ECHO_T = @ECHO_T@
++EGREP = @EGREP@
++EXEEXT = @EXEEXT@
++INC_PREFIX = @INC_PREFIX@
++INSTALL_DATA = @INSTALL_DATA@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
++LDFLAGS = @LDFLAGS@
++LIBNET_CONFIG_CFLAGS = @LIBNET_CONFIG_CFLAGS@
++LIBNET_CONFIG_DEFINES = @LIBNET_CONFIG_DEFINES@
++LIBNET_CONFIG_LIBS = @LIBNET_CONFIG_LIBS@
++LIBOBJS = @LIBOBJS@
++LIBS = @LIBS@
++LIBTOOL = @LIBTOOL@
++LIB_PREFIX = @LIB_PREFIX@
++LL_INT_TYPE = @LL_INT_TYPE@
++LL_INT_TYPE_UC = @LL_INT_TYPE_UC@
++LN = @LN@
++LN_S = @LN_S@
++LTLIBOBJS = @LTLIBOBJS@
++MAKEINFO = @MAKEINFO@
++MAN_PREFIX = @MAN_PREFIX@
++OBJEXT = @OBJEXT@
++PACKAGE = @PACKAGE@
++PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
++PACKAGE_NAME = @PACKAGE_NAME@
++PACKAGE_STRING = @PACKAGE_STRING@
++PACKAGE_TARNAME = @PACKAGE_TARNAME@
++PACKAGE_VERSION = @PACKAGE_VERSION@
++PATH_SEPARATOR = @PATH_SEPARATOR@
++RANLIB = @RANLIB@
++SET_MAKE = @SET_MAKE@
++SHELL = @SHELL@
++STRIP = @STRIP@
++VERSION = @VERSION@
++ac_ct_CC = @ac_ct_CC@
++ac_ct_RANLIB = @ac_ct_RANLIB@
++ac_ct_STRIP = @ac_ct_STRIP@
++am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
++am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
++am__include = @am__include@
++am__leading_dot = @am__leading_dot@
++am__quote = @am__quote@
++bindir = @bindir@
++build = @build@
++build_alias = @build_alias@
++build_cpu = @build_cpu@
++build_os = @build_os@
++build_vendor = @build_vendor@
++datadir = @datadir@
++exec_prefix = @exec_prefix@
++host = @host@
++host_alias = @host_alias@
++host_cpu = @host_cpu@
++host_os = @host_os@
++host_vendor = @host_vendor@
++includedir = @includedir@
++infodir = @infodir@
++install_sh = @install_sh@
++libdir = @libdir@
++libexecdir = @libexecdir@
++localstatedir = @localstatedir@
++mandir = @mandir@
++mkdir_p = @mkdir_p@
++oldincludedir = @oldincludedir@
++prefix = @prefix@
++program_transform_name = @program_transform_name@
++sbindir = @sbindir@
++sharedstatedir = @sharedstatedir@
++sysconfdir = @sysconfdir@
++target = @target@
++target_alias = @target_alias@
++target_cpu = @target_cpu@
++target_os = @target_os@
++target_vendor = @target_vendor@
++AUTOMAKE_OPTIONS = foreign no-dependencies
++DISTCLEANFILES = *~
++lib_LTLIBRARIES = libnet.la
++libnet_la_SOURCES = \
++ libnet_resolve.c \
++ libnet_socket.c \
++ libnet_checksum.c \
++ libnet_prand.c \
++ libnet_version.c \
++ libnet_write_ip.c \
++ libnet_insert_ipo.c \
++ libnet_insert_tcpo.c \
++ libnet_error.c \
++ libnet_link_@LL_INT_TYPE@.c \
++ libnet_packet_mem.c \
++ libnet_build_ip.c \
++ libnet_build_tcp.c \
++ libnet_build_udp.c \
++ libnet_build_arp.c \
++ libnet_build_ethernet.c \
++ libnet_build_icmp.c \
++ libnet_build_igmp.c \
++ libnet_build_dns.c \
++ libnet_build_snmp.c \
++ libnet_build_rip.c \
++ libnet_build_ospf.c \
++ libnet_build_vrrp.c \
++ libnet_asn1.c \
++ libnet_hex_dump.c \
++ libnet_if_addr.c \
++ libnet_port_list.c
++
++libnet_la_LIBADD = @LTLIBOBJS@
++
++# Here are a set of rules to help you update your library version
++# information:
++#
++# 1. If the library source code has changed at all since the last
++# update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
++#
++# 2. If any interfaces have been added, removed, or changed since the
++# last update, increment CURRENT, and set REVISION to 0.
++#
++# 3. If any interfaces have been added since the last public release,
++# then increment AGE.
++#
++# 4. If any interfaces have been removed since the last public release,
++# then set AGE to 0.
++libnet_la_LDFLAGS = -version-info 0:0:0 # CURRENT[:REVISION[:AGE]]
++all: all-am
++
++.SUFFIXES:
++.SUFFIXES: .c .lo .o .obj
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(am__configure_deps)
++ @for dep in $?; do \
++ case '$(am__configure_deps)' in \
++ *$$dep*) \
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
++ && exit 0; \
++ exit 1;; \
++ esac; \
++ done; \
++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
++ cd $(top_srcdir) && \
++ $(AUTOMAKE) --foreign src/Makefile
++.PRECIOUS: Makefile
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++ @case '$?' in \
++ *config.status*) \
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
++ *) \
++ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
++ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
++ esac;
++
++$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++
++$(top_srcdir)/configure: $(am__configure_deps)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++$(ACLOCAL_M4): $(am__aclocal_m4_deps)
++ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
++install-libLTLIBRARIES: $(lib_LTLIBRARIES)
++ @$(NORMAL_INSTALL)
++ test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
++ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
++ if test -f $$p; then \
++ f="`echo $$p | sed -e 's|^.*/||'`"; \
++ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
++ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
++ else :; fi; \
++ done
++
++uninstall-libLTLIBRARIES:
++ @$(NORMAL_UNINSTALL)
++ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
++ p="`echo $$p | sed -e 's|^.*/||'`"; \
++ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
++ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
++ done
++
++clean-libLTLIBRARIES:
++ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
++ @list='$(lib_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
++libnet.la: $(libnet_la_OBJECTS) $(libnet_la_DEPENDENCIES)
++ $(LINK) -rpath $(libdir) $(libnet_la_LDFLAGS) $(libnet_la_OBJECTS) $(libnet_la_LIBADD) $(LIBS)
++
++mostlyclean-compile:
++ -rm -f *.$(OBJEXT)
++
++distclean-compile:
++ -rm -f *.tab.c
++
++.c.o:
++ $(COMPILE) -c $<
++
++.c.obj:
++ $(COMPILE) -c `$(CYGPATH_W) '$<'`
++
++.c.lo:
++ $(LTCOMPILE) -c -o $@ $<
++
++mostlyclean-libtool:
++ -rm -f *.lo
++
++clean-libtool:
++ -rm -rf .libs _libs
++
++distclean-libtool:
++ -rm -f libtool
++uninstall-info-am:
++
++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; } \
++ END { for (i in files) print i; }'`; \
++ mkid -fID $$unique
++tags: TAGS
++
++TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
++ test -n "$$unique" || unique=$$empty_fix; \
++ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
++ $$tags $$unique; \
++ fi
++ctags: CTAGS
++CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
++ unique=`for i in $$list; do \
++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
++ done | \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ test -z "$(CTAGS_ARGS)$$tags$$unique" \
++ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
++ $$tags $$unique
++
++GTAGS:
++ here=`$(am__cd) $(top_builddir) && pwd` \
++ && cd $(top_srcdir) \
++ && gtags -i $(GTAGS_ARGS) $$here
++
++distclean-tags:
++ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
++
++distdir: $(DISTFILES)
++ $(mkdir_p) $(distdir)/..
++ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
++ list='$(DISTFILES)'; for file in $$list; do \
++ case $$file in \
++ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
++ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
++ esac; \
++ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
++ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
++ dir="/$$dir"; \
++ $(mkdir_p) "$(distdir)$$dir"; \
++ else \
++ dir=''; \
++ fi; \
++ if test -d $$d/$$file; then \
++ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
++ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
++ fi; \
++ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
++ else \
++ test -f $(distdir)/$$file \
++ || cp -p $$d/$$file $(distdir)/$$file \
++ || exit 1; \
++ fi; \
++ done
++check-am: all-am
++check: check-am
++all-am: Makefile $(LTLIBRARIES)
++installdirs:
++ for dir in "$(DESTDIR)$(libdir)"; do \
++ test -z "$$dir" || $(mkdir_p) "$$dir"; \
++ done
++install: install-am
++install-exec: install-exec-am
++install-data: install-data-am
++uninstall: uninstall-am
++
++install-am: all-am
++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
++
++installcheck: installcheck-am
++install-strip:
++ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
++ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
++ `test -z '$(STRIP)' || \
++ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
++mostlyclean-generic:
++
++clean-generic:
++
++distclean-generic:
++ -rm -f $(CONFIG_CLEAN_FILES)
++ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
++
++maintainer-clean-generic:
++ @echo "This command is intended for maintainers to use"
++ @echo "it deletes files that may require special tools to rebuild."
++clean: clean-am
++
++clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
++ mostlyclean-am
++
++distclean: distclean-am
++ -rm -f Makefile
++distclean-am: clean-am distclean-compile distclean-generic \
++ distclean-libtool distclean-tags
++
++dvi: dvi-am
++
++dvi-am:
++
++html: html-am
++
++info: info-am
++
++info-am:
++
++install-data-am:
++ @$(NORMAL_INSTALL)
++ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
++
++install-exec-am: install-libLTLIBRARIES
++
++install-info: install-info-am
++
++install-man:
++
++installcheck-am:
++
++maintainer-clean: maintainer-clean-am
++ -rm -f Makefile
++maintainer-clean-am: distclean-am maintainer-clean-generic
++
++mostlyclean: mostlyclean-am
++
++mostlyclean-am: mostlyclean-compile mostlyclean-generic \
++ mostlyclean-libtool
++
++pdf: pdf-am
++
++pdf-am:
++
++ps: ps-am
++
++ps-am:
++
++uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
++ @$(NORMAL_INSTALL)
++ $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
++
++.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
++ clean-libLTLIBRARIES clean-libtool ctags distclean \
++ distclean-compile distclean-generic distclean-libtool \
++ distclean-tags distdir dvi dvi-am html html-am info info-am \
++ install install-am install-data install-data-am install-exec \
++ install-exec-am install-info install-info-am \
++ install-libLTLIBRARIES install-man 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 uninstall-am uninstall-info-am \
++ uninstall-libLTLIBRARIES
++
++
++install-data-hook:
++ ln -f -s libnet.a $(DESTDIR)$(libdir)/libwrite.a
++
++uninstall-hook:
++ rm -f $(DESTDIR)$(libdir)/libwrite.a
++# 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 -ruN libnet-1.0.2a-orig/src/libnet_prand.c libnet-1.0.2a-7/src/libnet_prand.c
+--- libnet-1.0.2a-orig/src/libnet_prand.c 2001-02-05 20:22:26.000000000 +0100
++++ libnet-1.0.2a-7/src/libnet_prand.c 2005-03-08 03:53:26.000000000 +0100
+@@ -30,6 +30,8 @@
+ *
+ */
+
++#include <stdlib.h>
++
+ #if (HAVE_CONFIG_H)
+ #include "../include/config.h"
+ #endif
+diff -ruN libnet-1.0.2a-orig/test/Ethernet/Makefile.am libnet-1.0.2a-7/test/Ethernet/Makefile.am
+--- libnet-1.0.2a-orig/test/Ethernet/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/Ethernet/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5 @@
++include $(top_srcdir)/Makefile.am.common
++
++noinst_PROGRAMS = arp tcp icmp_mask get_address poink
++
++LDFLAGS = ../../src/libnet.la
+diff -ruN libnet-1.0.2a-orig/test/ICMP/Makefile.am libnet-1.0.2a-7/test/ICMP/Makefile.am
+--- libnet-1.0.2a-orig/test/ICMP/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/ICMP/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5 @@
++include $(top_srcdir)/Makefile.am.common
++
++noinst_PROGRAMS = icmp_echo icmp_unreach icmp_timexceed icmp_timestamp silvertongue ping_of_death
++
++LDFLAGS = ../../src/libnet.la
+diff -ruN libnet-1.0.2a-orig/test/IP/Makefile.am libnet-1.0.2a-7/test/IP/Makefile.am
+--- libnet-1.0.2a-orig/test/IP/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/IP/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1 @@
++include $(top_srcdir)/Makefile.am.common
+diff -ruN libnet-1.0.2a-orig/test/Makefile.am libnet-1.0.2a-7/test/Makefile.am
+--- libnet-1.0.2a-orig/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,3 @@
++include $(top_srcdir)/Makefile.am.common
++
++SUBDIRS = IP TCP UDP ICMP OSPF Ethernet Random
+diff -ruN libnet-1.0.2a-orig/test/OSPF/Makefile.am libnet-1.0.2a-7/test/OSPF/Makefile.am
+--- libnet-1.0.2a-orig/test/OSPF/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/OSPF/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5 @@
++include $(top_srcdir)/Makefile.am.common
++
++noinst_PROGRAMS = ospf_hello ospf_lsa ospf_request
++
++LDFLAGS = ../../src/libnet.la
+diff -ruN libnet-1.0.2a-orig/test/Random/Makefile.am libnet-1.0.2a-7/test/Random/Makefile.am
+--- libnet-1.0.2a-orig/test/Random/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/Random/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5 @@
++include $(top_srcdir)/Makefile.am.common
++
++noinst_PROGRAMS = prand_trials
++
++LDFLAGS = ../../src/libnet.la
+diff -ruN libnet-1.0.2a-orig/test/TCP/Makefile.am libnet-1.0.2a-7/test/TCP/Makefile.am
+--- libnet-1.0.2a-orig/test/TCP/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/TCP/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5 @@
++include $(top_srcdir)/Makefile.am.common
++
++noinst_PROGRAMS = syn-flood tcp tcp+data tcp+data+ipopt
++
++LDFLAGS += ../../src/libnet.la
+diff -ruN libnet-1.0.2a-orig/test/UDP/Makefile.am libnet-1.0.2a-7/test/UDP/Makefile.am
+--- libnet-1.0.2a-orig/test/UDP/Makefile.am 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/test/UDP/Makefile.am 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1,5 @@
++include $(top_srcdir)/Makefile.am.common
++
++noinst_PROGRAMS = udp udp+data
++
++LDFLAGS = ../../src/libnet.la
+diff -ruN libnet-1.0.2a-orig/version.h libnet-1.0.2a-7/version.h
+--- libnet-1.0.2a-orig/version.h 1970-01-01 01:00:00.000000000 +0100
++++ libnet-1.0.2a-7/version.h 2005-03-08 03:53:26.000000000 +0100
+@@ -0,0 +1 @@
++#define VERSION "1.0.2a"
diff --git a/package/libnfsidmap/Config.in b/package/libnfsidmap/Config.in
new file mode 100644
index 000000000..cb1bf4d66
--- /dev/null
+++ b/package/libnfsidmap/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBNFSIDMAP
+ prompt "libnfsidmap....................... NFSv4 library"
+ tristate
+ default n
+ help
+
diff --git a/package/libnfsidmap/Makefile b/package/libnfsidmap/Makefile
new file mode 100644
index 000000000..2a104e9ab
--- /dev/null
+++ b/package/libnfsidmap/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libnfsidmap
+PKG_VERSION:= 0.21b1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a8a44bd4aa22441fb54735dd65496b72
+MASTER_SITES:= http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBNFSIDMAP,libnfsidmap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_LIBNFSIDMAP)/usr/lib
+ $(CP) $(WRKINST)/usr/lib/libnfsidmap.so* \
+ $(IDIR_LIBNFSIDMAP)/usr/lib/
+ $(CP) $(WRKINST)/usr/lib/libnfsidmap_static.so* \
+ $(IDIR_LIBNFSIDMAP)/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libnfsidmap/ipkg/libnfsidmap.control b/package/libnfsidmap/ipkg/libnfsidmap.control
new file mode 100644
index 000000000..ad122b2da
--- /dev/null
+++ b/package/libnfsidmap/ipkg/libnfsidmap.control
@@ -0,0 +1,4 @@
+Package: libnfsidmap
+Priority: optional
+Section: libs
+Description: library for NFSv4
diff --git a/package/libnids/Config.in b/package/libnids/Config.in
new file mode 100644
index 000000000..aea5d4e2f
--- /dev/null
+++ b/package/libnids/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_LIBNIDS
+ prompt "libnids........................... A network intrusion detection library"
+ tristate
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBNET
+ default n
+ help
+ An implementation of an E-component of Network Intrusion Detection System.
+
+ http://www.packetfactory.net/projects/libnids/
+
diff --git a/package/libnids/Makefile b/package/libnids/Makefile
new file mode 100644
index 000000000..eb0f92e79
--- /dev/null
+++ b/package/libnids/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libnids
+PKG_VERSION:= 1.18
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 9ee6dcdfac97bae6fe611aa27d2594a5
+MASTER_SITES:= http://www.packetfactory.net/projects/libnids/dist/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBNIDS,libnids,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-libnet="${STAGING_DIR}/usr" \
+ --with-libpcap="${STAGING_DIR}/usr"
+XAKE_FLAGS+= install_prefix="${WRKINST}"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBNIDS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libnids.so.* ${IDIR_LIBNIDS}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libnids/ipkg/libnids.control b/package/libnids/ipkg/libnids.control
new file mode 100644
index 000000000..f34274269
--- /dev/null
+++ b/package/libnids/ipkg/libnids.control
@@ -0,0 +1,5 @@
+Package: libnids
+Priority: optional
+Section: libs
+Description: implementation of an E-component of Network Intrusion Detection System.
+Depends: libpcap, libnet
diff --git a/package/libnids/patches/configure.patch b/package/libnids/patches/configure.patch
new file mode 100644
index 000000000..b6ec19388
--- /dev/null
+++ b/package/libnids/patches/configure.patch
@@ -0,0 +1,73 @@
+diff -Nur libnids-1.18/configure libnids-1.18.patched/configure
+--- libnids-1.18.orig/configure 2003-10-15 01:40:09.000000000 +0200
++++ libnids-1.18/configure 2007-01-23 00:18:43.000000000 +0100
+@@ -3253,7 +3253,7 @@ presetting ac_cv_c_bigendian=no (or yes)
+ esac
+
+
+-CFLAGS="$CFLAGS -D_BSD_SOURCE"
++CFLAGS="$CFLAGS"
+
+ for ac_func in gettimeofday
+ do
+@@ -3489,17 +3489,21 @@ if test "${with_libpcap+set}" = set; the
+ echo "${ECHO_T}no" >&6
+ ;;
+ *)
+- echo "$as_me:$LINENO: result: $withval" >&5
+-echo "${ECHO_T}$withval" >&6
++ echo "$ac_t""$withval" 1>&6
+ if test -f $withval/pcap.h -a -f $withval/libpcap.a; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+- PCAP_CFLAGS="-I$withval -I$withval/bpf"
++ PCAPINC="-I$withval -I$withval/bpf"
+ PCAPLIB="-L$withval -lpcap"
++ elif test -f $withval/include/pcap.h -a \
++ -f $withval/include/pcap-bpf.h -a \
++ -f $withval/lib/libpcap.a; then
++ owd=`pwd`
++ if cd $withval; then withval=`pwd`; cd $owd; fi
++ PCAPINC="-I$withval/include"
++ PCAPLIB="-L$withval/lib -lpcap"
+ else
+- { { echo "$as_me:$LINENO: error: pcap.h or libpcap.a not found in $withval" >&5
+-echo "$as_me: error: pcap.h or libpcap.a not found in $withval" >&2;}
+- { (exit 1); exit 1; }; }
++ { echo "configure: error: pcap.h" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
+@@ -3605,18 +3609,18 @@ echo "${ECHO_T}no" >&6
+ *)
+ echo "$as_me:$LINENO: result: $withval" >&5
+ echo "${ECHO_T}$withval" >&6
+- if test -f $withval/include/libnet.h -a -f $withval/lib/libnet.a -a -f $withval/libnet-config ; then
++ if test -f $withval/include/libnet.h -a -f $withval/bin/libnet-config ; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+- LNET_CFLAGS="-I$withval/include `$withval/libnet-config --defines`"
++ LNET_CFLAGS="-I$withval/include `$withval/bin/libnet-config --defines`"
+ LNETLIB="-L$withval/lib -lnet"
+- elif test -f $withval/include/libnet.h -a -f $withval/src/libnet.a; then
++ elif test -f $withval/include/libnet.h; then
+ owd=`pwd`
+ if cd $withval; then withval=`pwd`; cd $owd; fi
+ LNET_CFLAGS="-I$withval/include"
+- LNETLIB="-L$withval/src -lnet"
++ LNETLIB="-L$withval/lib -lnet"
+ else
+- echo "A working combination of libnet.h, libnet.a and libnet-config not found in $withval; get libnet from www.packetfactory.net/projects/libnet and reinstall"
++ echo "A working combination of libnet.h and libnet-config not found in $withval; get libnet from www.packetfactory.net/projects/libnet and reinstall"
+ { { echo "$as_me:$LINENO: error: libnet" >&5
+ echo "$as_me: error: libnet" >&2;}
+ { (exit 1); exit 1; }; }
+@@ -3861,7 +3865,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
+ else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+-HAVE_BSD_UDPHDR=0
++HAVE_BSD_UDPHDR=1
+ fi
+ rm -f conftest.$ac_objext conftest.$ac_ext
+
diff --git a/package/libnids/patches/no_asm_for_i386.patch b/package/libnids/patches/no_asm_for_i386.patch
new file mode 100644
index 000000000..ff6fde7b1
--- /dev/null
+++ b/package/libnids/patches/no_asm_for_i386.patch
@@ -0,0 +1,12 @@
+diff -ruN libnids-1.18-orig/src/checksum.c libnids-1.18/src/checksum.c
+--- libnids-1.18-orig/src/checksum.c 2003-09-20 22:40:44.000000000 +0200
++++ libnids-1.18/src/checksum.c 2005-08-09 23:55:00.000000000 +0200
+@@ -4,7 +4,7 @@
+ #include <netinet/tcp.h>
+ #include <netinet/udp.h>
+
+-#if ( __i386__ || __i386 )
++#if 0
+ // all asm procedures are copied from Linux 2.0.36 and 2.2.10 kernels
+
+ /*
diff --git a/package/libnl/Config.in b/package/libnl/Config.in
new file mode 100644
index 000000000..4d5e953a2
--- /dev/null
+++ b/package/libnl/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBNL
+ prompt "libnl........................... Tools for manipulating Linux Wireless cards"
+ tristate
+ default n
+ help
+ Tools for configuring Wireless Adapters.
diff --git a/package/libnl/Makefile b/package/libnl/Makefile
new file mode 100644
index 000000000..8e66802ea
--- /dev/null
+++ b/package/libnl/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libnl
+PKG_VERSION:= 1.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ae970ccd9144e132b68664f98e7ceeb1
+MASTER_SITES:= http://downloads.openwrt.org/sources/
+
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBNL,libnl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBNL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libnl.so* ${IDIR_LIBNL}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libnl/ipkg/libnl.control b/package/libnl/ipkg/libnl.control
new file mode 100644
index 000000000..8ad5fcce4
--- /dev/null
+++ b/package/libnl/ipkg/libnl.control
@@ -0,0 +1,4 @@
+Package: libnl
+Priority: optional
+Section: net
+Description: Tools for setting up WiFi cards via netlink (nl80211)
diff --git a/package/libnl/patches/patch-include_netlink-types_h b/package/libnl/patches/patch-include_netlink-types_h
new file mode 100644
index 000000000..01d181e28
--- /dev/null
+++ b/package/libnl/patches/patch-include_netlink-types_h
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libnl-1.1.orig/include/netlink-types.h 2008-01-14 16:48:45.000000000 +0100
++++ libnl-1.1/include/netlink-types.h 2009-04-16 20:16:45.349364825 +0200
+@@ -95,15 +95,6 @@ struct nl_cache_mngr
+
+ struct nl_parser_param;
+
+-struct genl_info
+-{
+- struct sockaddr_nl * who;
+- struct nlmsghdr * nlh;
+- struct genlmsghdr * genlhdr;
+- void * userhdr;
+- struct nlattr ** attrs;
+-};
+-
+ #define LOOSE_FLAG_COMPARISON 1
+
+ #define NL_OBJ_MARK 1
diff --git a/package/libnl/patches/patch-include_netlink_genl_mngt_h b/package/libnl/patches/patch-include_netlink_genl_mngt_h
new file mode 100644
index 000000000..28ba36d23
--- /dev/null
+++ b/package/libnl/patches/patch-include_netlink_genl_mngt_h
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libnl-1.1.orig/include/netlink/genl/mngt.h 2008-01-14 16:48:45.000000000 +0100
++++ libnl-1.1/include/netlink/genl/mngt.h 2009-04-16 20:16:45.343843731 +0200
+@@ -22,6 +22,15 @@ extern "C" {
+
+ struct nl_cache_ops;
+
++struct genl_info
++{
++ struct sockaddr_nl * who;
++ struct nlmsghdr * nlh;
++ struct genlmsghdr * genlhdr;
++ void * userhdr;
++ struct nlattr ** attrs;
++};
++
+ /**
+ * @ingroup genl_mngt
+ * Generic Netlink Command
diff --git a/package/libnl/patches/patch-src_nl-list-caches_c b/package/libnl/patches/patch-src_nl-list-caches_c
new file mode 100644
index 000000000..cb7c8986c
--- /dev/null
+++ b/package/libnl/patches/patch-src_nl-list-caches_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libnl-1.1.orig/src/nl-list-caches.c 2008-01-14 16:48:45.000000000 +0100
++++ libnl-1.1/src/nl-list-caches.c 2009-04-16 20:16:45.349364825 +0200
+@@ -10,6 +10,7 @@
+ */
+
+ #include "utils.h"
++#include <netlink-local.h>
+
+ static void print_usage(void)
+ {
diff --git a/package/libnl/patches/patch-src_utils_c b/package/libnl/patches/patch-src_utils_c
new file mode 100644
index 000000000..05da529a3
--- /dev/null
+++ b/package/libnl/patches/patch-src_utils_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libnl-1.1.orig/src/utils.c 2008-01-14 16:48:45.000000000 +0100
++++ libnl-1.1/src/utils.c 2009-04-16 20:16:45.349364825 +0200
+@@ -12,6 +12,7 @@
+ #include "utils.h"
+
+ #include <stdlib.h>
++#include <stdarg.h>
+
+ int nltool_init(int argc, char *argv[])
+ {
diff --git a/package/libnl/patches/patch-src_utils_h b/package/libnl/patches/patch-src_utils_h
new file mode 100644
index 000000000..e19e1e182
--- /dev/null
+++ b/package/libnl/patches/patch-src_utils_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libnl-1.1.orig/src/utils.h 2008-01-14 16:48:45.000000000 +0100
++++ libnl-1.1/src/utils.h 2009-04-16 20:16:45.353364776 +0200
+@@ -22,7 +22,6 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+-#include <netlink-local.h>
+ #include <netlink/netlink.h>
+ #include <netlink/utils.h>
+ #include <netlink/addr.h>
diff --git a/package/libogg/Config.in b/package/libogg/Config.in
new file mode 100644
index 000000000..2d75d650d
--- /dev/null
+++ b/package/libogg/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBOGG
+ prompt "libogg............................ The Ogg bitstream handling library"
+ tristate
+ default n
+ help
+ The Ogg bitstream handling library.
+
+ http://www.vorbis.com/
+
diff --git a/package/libogg/Makefile b/package/libogg/Makefile
new file mode 100644
index 000000000..575cdeb2f
--- /dev/null
+++ b/package/libogg/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libogg
+PKG_VERSION:= 1.1.3
+PKG_RELEASE:= 2
+PKG_MD5SUM:= eaf7dc6ebbff30975de7527a80831585
+MASTER_SITES:= http://downloads.xiph.org/releases/ogg/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBOGG,libogg,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBOGG}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libogg.so.* ${IDIR_LIBOGG}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libogg/ipkg/libogg.control b/package/libogg/ipkg/libogg.control
new file mode 100644
index 000000000..dd816f3c2
--- /dev/null
+++ b/package/libogg/ipkg/libogg.control
@@ -0,0 +1,4 @@
+Package: libogg
+Priority: optional
+Section: libs
+Description: The Ogg bitstream handling library
diff --git a/package/libol/Config.in b/package/libol/Config.in
new file mode 100644
index 000000000..4bdc57aff
--- /dev/null
+++ b/package/libol/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_LIBOL
+ prompt "libol............................. Support library for syslog-ng"
+ tristate
+ default n
+ help
+ Support library for syslog-ng
+
+ http://www.balabit.com
diff --git a/package/libol/Makefile b/package/libol/Makefile
new file mode 100644
index 000000000..0c17eb8f5
--- /dev/null
+++ b/package/libol/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libol
+PKG_VERSION:= 0.3.18
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cbadf4b7ea276dfa85acc38a1cc5ff17
+MASTER_SITES:= http://www.balabit.com/downloads/files/libol/0.3/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBOL,libol,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= confprog auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBOL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libol.so.* ${IDIR_LIBOL}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libol/ipkg/libol.control b/package/libol/ipkg/libol.control
new file mode 100644
index 000000000..c65ae3859
--- /dev/null
+++ b/package/libol/ipkg/libol.control
@@ -0,0 +1,4 @@
+Package: libol
+Section: libs
+Description: Support library for syslog-ng
+Priority: optional
diff --git a/package/libosip2/Config.in b/package/libosip2/Config.in
new file mode 100644
index 000000000..7e7bb3477
--- /dev/null
+++ b/package/libosip2/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBOSIP2
+ prompt "libosip2.......................... The GNU oSIP library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ GNU oSIP library, a Session Initiation Protocol (SIP) implementation
+
+ http://www.gnu.org/software/osip/
diff --git a/package/libosip2/Makefile b/package/libosip2/Makefile
new file mode 100644
index 000000000..201102c6a
--- /dev/null
+++ b/package/libosip2/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libosip2
+PKG_VERSION:= 2.2.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f1237af0250c59b318bd64a59f5750ea
+MASTER_SITES:= ${MASTER_SITE_GNU:=osip/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBOSIP2,libosip2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-trace \
+ --enable-pthread \
+ --enable-semaphore \
+ --enable-ntimer
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBOSIP2}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libosip{,parser}2.so.* ${IDIR_LIBOSIP2}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libosip2/ipkg/libosip2.control b/package/libosip2/ipkg/libosip2.control
new file mode 100644
index 000000000..706c3e465
--- /dev/null
+++ b/package/libosip2/ipkg/libosip2.control
@@ -0,0 +1,5 @@
+Package: libosip2
+Priority: optional
+Section: libs
+Description: GNU oSIP library, a SIP (Session Initiation Protocol) implementation
+Depends: libpthread
diff --git a/package/libowfat/Config.in b/package/libowfat/Config.in
new file mode 100644
index 000000000..a95b28736
--- /dev/null
+++ b/package/libowfat/Config.in
@@ -0,0 +1,4 @@
+config ADK_COMPILE_LIBOWFAT
+ prompt "libowfat.......................... fefe's version of libdjb"
+ tristate
+ default n
diff --git a/package/libowfat/Makefile b/package/libowfat/Makefile
new file mode 100644
index 000000000..cb288b823
--- /dev/null
+++ b/package/libowfat/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= libowfat
+PKG_VERSION= 0.25
+PKG_RELEASE= 1
+PKG_MD5SUM= 7a5ab9f5b7099b82e428cd308d170005
+
+MASTER_SITES= http://dl.fefe.de/
+DISTFILES= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBOWFAT,libowfat,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+MAKE_FILE= GNUmakefile
+MAKE_FLAGS+= DIET= CC='${TARGET_CC}' CROSS=${TARGET_CROSS}
+TCFLAGS+= ${TCPPFLAGS}
+FAKE_FLAGS+= prefix='${WRKINST}/usr' \
+ INCLUDEDIR='${WRKINST}/usr/include/owfat'
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libowfat/patches/patch-GNUmakefile b/package/libowfat/patches/patch-GNUmakefile
new file mode 100644
index 000000000..24c836bac
--- /dev/null
+++ b/package/libowfat/patches/patch-GNUmakefile
@@ -0,0 +1,12 @@
+$Id$
+--- libowfat-0.25.orig/GNUmakefile 2006-07-16 01:17:01.000000000 +0200
++++ libowfat-0.25/GNUmakefile 2007-07-06 17:35:01.000000000 +0200
+@@ -18,7 +18,7 @@ all: t $(LIBS) libowfat.a libsocket
+ CROSS=
+ #CROSS=i686-mingw-
+ CC=$(CROSS)gcc
+-CFLAGS=-pipe -W -Wall -O2 -fomit-frame-pointer
++CFLAGS?=-pipe -W -Wall -O2 -fomit-frame-pointer
+ #CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall
+
+ # CFLAGS += -fstrict-aliasing -Wstrict-aliasing=2
diff --git a/package/libp11/Config.in b/package/libp11/Config.in
new file mode 100644
index 000000000..72945d813
--- /dev/null
+++ b/package/libp11/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_LIBP11
+ prompt "libp11............................ libp11"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBLTDL
+ help
+ libp11
diff --git a/package/libp11/Makefile b/package/libp11/Makefile
new file mode 100644
index 000000000..5d6b8530b
--- /dev/null
+++ b/package/libp11/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libp11
+PKG_VERSION:= 0.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b8655b2065575eb1b96a9c924c234c63
+MASTER_SITES:= http://www.opensc-project.org/files/libp11/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBP11,libp11,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBP11}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libp11.so.* ${IDIR_LIBP11}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libp11/ipkg/libp11.control b/package/libp11/ipkg/libp11.control
new file mode 100644
index 000000000..93e01557a
--- /dev/null
+++ b/package/libp11/ipkg/libp11.control
@@ -0,0 +1,5 @@
+Package: libp11
+Priority: optional
+Section: crypto
+Description: libp11
+Depends: libopenssl, libltdl
diff --git a/package/libpcap/Config.in b/package/libpcap/Config.in
new file mode 100644
index 000000000..752bf5797
--- /dev/null
+++ b/package/libpcap/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBPCAP
+ prompt "libpcap........................... Low-level packet capture library"
+ tristate
+ default n
+ help
+ A system-independent library for user-level network packet capture.
+
+ http://www.tcpdump.org/
+
diff --git a/package/libpcap/Makefile b/package/libpcap/Makefile
new file mode 100644
index 000000000..528d1c65c
--- /dev/null
+++ b/package/libpcap/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libpcap
+PKG_VERSION:= 1.0.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 9ad1358c5dec48456405eac197a46d3d
+MASTER_SITES:= http://www.tcpdump.org/release/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBPCAP,libpcap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_linux_vers=26
+CONFIGURE_ARGS+= --disable-yydebug \
+ --with-build-cc=$(HOSTCC) \
+ --with-pcap=linux
+BUILD_STYLE= auto
+TCFLAGS+= ${TCPPFLAGS}
+INSTALL_STYLE= auto
+INSTALL_TARGET= install install-shared
+
+pre-install:
+ ${INSTALL_DIR} ${WRKINST}/usr/bin
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBPCAP}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/libpcap.so.* ${IDIR_LIBPCAP}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libpcap/ipkg/libpcap.control b/package/libpcap/ipkg/libpcap.control
new file mode 100644
index 000000000..a743ea4fc
--- /dev/null
+++ b/package/libpcap/ipkg/libpcap.control
@@ -0,0 +1,4 @@
+Package: libpcap
+Priority: optional
+Section: libs
+Description: a low-level packet capture library
diff --git a/package/libpciaccess/Config.in b/package/libpciaccess/Config.in
new file mode 100644
index 000000000..7f8c03c54
--- /dev/null
+++ b/package/libpciaccess/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBPCIACCESS
+ prompt "libpciaccess.......................... PCI access library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libpciaccess/Makefile b/package/libpciaccess/Makefile
new file mode 100644
index 000000000..e0abce898
--- /dev/null
+++ b/package/libpciaccess/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libpciaccess
+PKG_VERSION:= 0.10.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3c4a7578cb63c63ccb1ebca87e10407f
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBPCIACCESS,libpciaccess,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= autotool gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBPCIACCESS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpciaccess.so* ${IDIR_LIBPCIACCESS}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libpciaccess/ipkg/libpciaccess.control b/package/libpciaccess/ipkg/libpciaccess.control
new file mode 100644
index 000000000..c0c7469eb
--- /dev/null
+++ b/package/libpciaccess/ipkg/libpciaccess.control
@@ -0,0 +1,4 @@
+Package: libpciaccess
+Priority: optional
+Section: x11
+Description: libpciaccess library
diff --git a/package/libpciaccess/patches/patch-configure_ac b/package/libpciaccess/patches/patch-configure_ac
new file mode 100644
index 000000000..11571fda3
--- /dev/null
+++ b/package/libpciaccess/patches/patch-configure_ac
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libpciaccess-0.10.3.orig/configure.ac 2008-06-10 21:24:44.000000000 +0200
++++ libpciaccess-0.10.3/configure.ac 2009-05-10 17:22:54.000000000 +0200
+@@ -91,12 +91,6 @@ AM_CONDITIONAL(FREEBSD, [test "x$freebsd
+ AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes])
+ AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes])
+
+-AC_CHECK_FILE([/usr/include/asm/mtrr.h],
+- [have_mtrr_h="yes"], [have_mtrr_h="no"])
+-if test "x$have_mtrr_h" = xyes; then
+- AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])
+-fi
+-
+ AC_SUBST(PCIACCESS_CFLAGS)
+ AC_SUBST(PCIACCESS_LIBS)
+
diff --git a/package/libpng/Config.in b/package/libpng/Config.in
new file mode 100644
index 000000000..9b3de9cae
--- /dev/null
+++ b/package/libpng/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LIBPNG
+ prompt "libpng............................ PNG (Portable Network Graphics) format files handling library"
+ tristate
+ default n
+ select ADK_PACKAGE_ZLIB
+ help
+ A library for reading/writing PNG files
+
+ http://www.libpng.org/pub/png/libpng.html
+
diff --git a/package/libpng/Makefile b/package/libpng/Makefile
new file mode 100644
index 000000000..0e3b3a733
--- /dev/null
+++ b/package/libpng/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libpng
+PKG_VERSION:= 1.2.35
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8ca6246930a57d5be7adc7c4e7fb5e00
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=libpng/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBPNG,libpng,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBPNG}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpng{,12}.so.* ${IDIR_LIBPNG}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libpng/ipkg/libpng.control b/package/libpng/ipkg/libpng.control
new file mode 100644
index 000000000..96c91b4de
--- /dev/null
+++ b/package/libpng/ipkg/libpng.control
@@ -0,0 +1,5 @@
+Package: libpng
+Priority: optional
+Section: libs
+Depends: zlib
+Description: A library for reading/writing PNG images
diff --git a/package/libpri/Config.in b/package/libpri/Config.in
new file mode 100644
index 000000000..b39ab031b
--- /dev/null
+++ b/package/libpri/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LIBPRI
+ prompt "libpri............................ Primary Rate ISDN Library"
+ tristate
+ default n
+ help
+ libpri is a C implementation of the Primary Rate ISDN specification. It was
+ based on the Bellcore specification SR-NWT-002343 for National ISDN. As of
+ May 12, 2001, it has been tested work with NI-2, Nortel DMS-100, and
+ Lucent 5E Custom protocols on switches from Nortel and Lucent.
+
diff --git a/package/libpri/Makefile b/package/libpri/Makefile
new file mode 100644
index 000000000..ab2619805
--- /dev/null
+++ b/package/libpri/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libpri
+PKG_VERSION:= 1.2.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b9354f420304afa7b8923615a117b9c6
+MASTER_SITES:= http://www.asterisk-support.de/mirror/libpri/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBPRI,libpri,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC='${TARGET_CC}'
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBPRI}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpri.so.* ${IDIR_LIBPRI}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libpri/ipkg/libpri.control b/package/libpri/ipkg/libpri.control
new file mode 100644
index 000000000..029fa4450
--- /dev/null
+++ b/package/libpri/ipkg/libpri.control
@@ -0,0 +1,5 @@
+Package: libpri
+Priority: optional
+Section: libs
+Depends:
+Description: C implementation of the Primary Rate ISDN specification
diff --git a/package/libpri/patches/patch-Makefile b/package/libpri/patches/patch-Makefile
new file mode 100644
index 000000000..d1fb6c1c7
--- /dev/null
+++ b/package/libpri/patches/patch-Makefile
@@ -0,0 +1,12 @@
+$Id$
+
+ submitted upstream as http://bugs.digium.com/view.php?id=10253
+
+--- libpri-1.2.4.orig/Makefile 2006-04-30 17:17:47.000000000 +0200
++++ libpri-1.2.4/Makefile 2007-06-29 19:34:16.000000000 +0200
+@@ -144,4 +144,4 @@ clean:
+ depend: .depend
+
+ .depend:
+- CC=$(CC) ./mkdep ${CFLAGS} `ls *.c`
++ CC="$(CC)" ./mkdep ${CFLAGS} `ls *.c`
diff --git a/package/libpthread/Config.in b/package/libpthread/Config.in
new file mode 100644
index 000000000..dab1b0e97
--- /dev/null
+++ b/package/libpthread/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_LIBPTHREAD
+ prompt "libpthread........................ POSIX threads library"
+ tristate
+ default n
+ help
+ POSIX threads library
+
diff --git a/package/libpthread/Makefile b/package/libpthread/Makefile
new file mode 100644
index 000000000..483fcc136
--- /dev/null
+++ b/package/libpthread/Makefile
@@ -0,0 +1,25 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+ifeq ($(ADK_TARGET_LIB_GLIBC),y)
+include ${TOPDIR}/toolchain/glibc/Makefile.inc
+else
+include ${TOPDIR}/toolchain/uClibc/Makefile.inc
+endif
+
+PKG_NAME:= libpthread
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBPTHREAD,libpthread,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LIBPTHREAD}/lib
+ ${CP} ${STAGING_DIR}/lib/libpthread*.so* ${IDIR_LIBPTHREAD}/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libpthread/ipkg/libpthread.control b/package/libpthread/ipkg/libpthread.control
new file mode 100644
index 000000000..73978c2cc
--- /dev/null
+++ b/package/libpthread/ipkg/libpthread.control
@@ -0,0 +1,4 @@
+Package: libpthread
+Priority: optional
+Section: libs
+Description: POSIX threads library
diff --git a/package/librpcsecgss/Config.in b/package/librpcsecgss/Config.in
new file mode 100644
index 000000000..92e049cda
--- /dev/null
+++ b/package/librpcsecgss/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBRPCSECGSS
+ prompt "librpcsecgss...................... NFSv4 library"
+ tristate
+ default n
+ help
+
diff --git a/package/librpcsecgss/Makefile b/package/librpcsecgss/Makefile
new file mode 100644
index 000000000..17a6404b2
--- /dev/null
+++ b/package/librpcsecgss/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= librpcsecgss
+PKG_VERSION:= 0.18
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f2c4a69c5a32f62b762a569b8d962156
+MASTER_SITES:= http://www.citi.umich.edu/projects/nfsv4/linux/librpcsecgss/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBRPCSECGSS,librpcsecgss,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= autotool gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-extract:
+ $(CP) ./files/librpcsecgss.pc* $(WRKSRC)/
+post-install:
+ $(INSTALL_DIR) $(IDIR_LIBRPCSECGSS)/usr/lib
+ $(CP) $(WRKINST)/usr/lib/librpcsecgss.so* $(IDIR_LIBRPCSECGSS)/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/librpcsecgss/files/librpcsecgss.pc.in.gssglue b/package/librpcsecgss/files/librpcsecgss.pc.in.gssglue
new file mode 100644
index 000000000..d67b7e4b6
--- /dev/null
+++ b/package/librpcsecgss/files/librpcsecgss.pc.in.gssglue
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: librpcsecgss
+Description: Library that implements rpcsec_gss interface.
+Requires: libgssglue
+Version: @PACKAGE_VERSION@
+Libs: -L@libdir@ -lrpcsecgss
+Cflags: -I@includedir@/rpcsecgss
+
diff --git a/package/librpcsecgss/files/librpcsecgss.pc.in.heimdal b/package/librpcsecgss/files/librpcsecgss.pc.in.heimdal
new file mode 100644
index 000000000..caecaa582
--- /dev/null
+++ b/package/librpcsecgss/files/librpcsecgss.pc.in.heimdal
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: librpcsecgss
+Description: Library that implements rpcsec_gss interface.
+Requires: heimdal-gssapi
+Version: @PACKAGE_VERSION@
+Libs: -L@libdir@ -lrpcsecgss
+Cflags: -I@includedir@/rpcsecgss
+
diff --git a/package/librpcsecgss/ipkg/librpcsecgss.control b/package/librpcsecgss/ipkg/librpcsecgss.control
new file mode 100644
index 000000000..b4772a082
--- /dev/null
+++ b/package/librpcsecgss/ipkg/librpcsecgss.control
@@ -0,0 +1,4 @@
+Package: librpcsecgss
+Priority: optional
+Section: libs
+Description: library for NFSv4
diff --git a/package/librpcsecgss/patches/patch-configure_in b/package/librpcsecgss/patches/patch-configure_in
new file mode 100644
index 000000000..a57facbc6
--- /dev/null
+++ b/package/librpcsecgss/patches/patch-configure_in
@@ -0,0 +1,25 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- librpcsecgss-0.18.orig/configure.in 2008-04-09 00:05:40.000000000 +0200
++++ librpcsecgss-0.18/configure.in 2009-01-30 16:11:01.000000000 +0100
+@@ -10,12 +10,17 @@ AM_PROG_LIBTOOL
+ # Checks for programs.
+ AC_PROG_CC
+ AC_PROG_RANLIB
++AC_PROG_LIBTOOL
+
+ # Checks for libraries.
+-PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1], [],
+- [AC_MSG_ERROR([Unable to locate information required to use libgssglue.
+- If you have pkgconfig installed, you might try setting environment
+- variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])])
++PKG_CHECK_MODULES([GSSGLUE], [libgssglue >= 0.1],
++ [echo GSSGLUE found; cp librpcsecgss.pc.in.gssglue librpcsecgss.pc.in],
++ [PKG_CHECK_MODULES([GSSGLUE], [heimdal-gssapi],
++ [echo HEIMDAL found; cp librpcsecgss.pc.in.heimdal librpcsecgss.pc.in],
++ [AC_MSG_ERROR([Unable to locate information required to use libgssglue.
++ If you have pkgconfig installed, you might try setting environment
++ variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])])])
++
+
+ # Checks for header files.
+ AC_HEADER_STDC
diff --git a/package/libshout/Config.in b/package/libshout/Config.in
new file mode 100644
index 000000000..9c9aaf3d5
--- /dev/null
+++ b/package/libshout/Config.in
@@ -0,0 +1,16 @@
+config ADK_COMPILE_LIBSHOUT
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBSHOUT
+
+config ADK_PACKAGE_LIBSHOUT
+ prompt "libshout.......................... Streaming library"
+ tristate
+ default n
+ select ADK_COMPILE_LIBSHOUT
+ select ADK_PACKAGE_LIBVORBIS
+ select ADK_PACKAGE_LIBOGG
+ help
+ Shoutcast streaming library.
+
+ http://www.icecast.org/
diff --git a/package/libshout/Makefile b/package/libshout/Makefile
new file mode 100644
index 000000000..97ff7ad6c
--- /dev/null
+++ b/package/libshout/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libshout
+PKG_VERSION:= 2.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4f75fc9901c724b712c371c9a1e782d3
+MASTER_SITES:= http://downloads.us.xiph.org/releases/libshout/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBSHOUT,libshout,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-speex=no \
+ --with-theora=no
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBSHOUT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libshout.so.* ${IDIR_LIBSHOUT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libshout/ipkg/libshout.control b/package/libshout/ipkg/libshout.control
new file mode 100644
index 000000000..d1d9ce692
--- /dev/null
+++ b/package/libshout/ipkg/libshout.control
@@ -0,0 +1,5 @@
+Package: libshout
+Priority: optional
+Section: libs
+Depends: libvorbis, libogg
+Description: Library which can be used to write a source client for streaming
diff --git a/package/libsigc++/Config.in b/package/libsigc++/Config.in
new file mode 100644
index 000000000..16c4da796
--- /dev/null
+++ b/package/libsigc++/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_LIBSIGCXX
+ prompt "libsigc++......................... Callback framework for C++"
+ tristate
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBSTDCXX
+ default n
+ help
+ Callback framework for C++
diff --git a/package/libsigc++/Makefile b/package/libsigc++/Makefile
new file mode 100644
index 000000000..95cec59db
--- /dev/null
+++ b/package/libsigc++/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libsigc++
+PKG_VERSION:= 2.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e27a20ac9bc9100f48effdfca8e8c595
+
+MASTER_SITES:= ${MASTER_SITE_GNOME:=libsigc++/2.2/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBSIGCXX,libsigc++,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBSIGCXX}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libsigc-2.0.so.* ${IDIR_LIBSIGCXX}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libsigc++/ipkg/libsigc++.control b/package/libsigc++/ipkg/libsigc++.control
new file mode 100644
index 000000000..ffce29762
--- /dev/null
+++ b/package/libsigc++/ipkg/libsigc++.control
@@ -0,0 +1,5 @@
+Package: libsigc++
+Priority: optional
+Section: libs
+Depends: libstdc++
+Description: Callback framework for C++
diff --git a/package/libsigc++/patches/patch-Makefile_in b/package/libsigc++/patches/patch-Makefile_in
new file mode 100644
index 000000000..8a539b06b
--- /dev/null
+++ b/package/libsigc++/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libsigc++-2.2.2.orig/Makefile.in 2008-03-10 13:11:44.000000000 +0100
++++ libsigc++-2.2.2/Makefile.in 2008-10-10 11:05:33.000000000 +0200
+@@ -206,7 +206,7 @@ top_srcdir = @top_srcdir@
+ # other stuff here
+ EXTRA_DIST = autogen.sh sigc++config.h.in libsigc++-2.0.spec.in
+ # ACLOCAL_FLAGS = -I scripts
+-SUBDIRS = sigc++ tests docs examples scripts MSVC_Net2003
++SUBDIRS = sigc++ scripts
+ DIST_SUBDIRS = $(SUBDIRS)
+ sigc_configdir = $(libdir)/sigc++-2.0/include
+ sigc_config_DATA = sigc++config.h
diff --git a/package/libstdcxx/Config.in b/package/libstdcxx/Config.in
new file mode 100644
index 000000000..732d07535
--- /dev/null
+++ b/package/libstdcxx/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_LIBSTDCXX
+ prompt "libstdc++......................... C++ support library"
+ tristate
+ depends on ADK_CXX
+ default n
+ help
+ C++ support library
diff --git a/package/libstdcxx/Makefile b/package/libstdcxx/Makefile
new file mode 100644
index 000000000..e49735472
--- /dev/null
+++ b/package/libstdcxx/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+include ${TOPDIR}/toolchain/glibc/Makefile.inc
+
+PKG_NAME:= libstdcxx
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBSTDCXX,libstdcxx,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LIBSTDCXX}/lib
+ $(CP) ${STAGING_DIR}/lib/libstdc++.so.* ${IDIR_LIBSTDCXX}/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libstdcxx/ipkg/libstdcxx.control b/package/libstdcxx/ipkg/libstdcxx.control
new file mode 100644
index 000000000..384ebc12b
--- /dev/null
+++ b/package/libstdcxx/ipkg/libstdcxx.control
@@ -0,0 +1,5 @@
+Package: libstdcxx
+Priority: optional
+Section: net
+Depends: libgcc
+Description: G++ support library
diff --git a/package/libtasn1/Config.in b/package/libtasn1/Config.in
new file mode 100644
index 000000000..b84efff17
--- /dev/null
+++ b/package/libtasn1/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBTASN1
+ prompt "libtasn1.......................... An ASN.1 and DER structures manipulation library"
+ tristate
+ default n
+ help
+ This is a library for Abstract Syntax Notation One (ASN.1) and
+ Distinguish Encoding Rules (DER) manipulation.
+
+ ftp://ftp.gnutls.org/pub/gnutls/libtasn1/
diff --git a/package/libtasn1/Makefile b/package/libtasn1/Makefile
new file mode 100644
index 000000000..dbb3b7e61
--- /dev/null
+++ b/package/libtasn1/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libtasn1
+PKG_VERSION:= 1.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 93b43cc5013bda4d8bf64508f1566c54
+MASTER_SITES:= ftp://ftp.gnutls.org/pub/gnutls/libtasn1/ \
+ ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/libtasn1/ \
+ http://www.mirrors.wiretapped.net/security/network-securitygnutls/libtasn1/ \
+ ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/libtasn1/ \
+ http://josefsson.org/gnutls/releases/libtasn1/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBTASN1,libtasn1,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBTASN1}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libtasn1.so.* ${IDIR_LIBTASN1}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libtasn1/ipkg/libtasn1.control b/package/libtasn1/ipkg/libtasn1.control
new file mode 100644
index 000000000..4a5c1f6f3
--- /dev/null
+++ b/package/libtasn1/ipkg/libtasn1.control
@@ -0,0 +1,4 @@
+Package: libtasn1
+Priority: optional
+Section: libs
+Description: an ASN.1 and DER structures manipulation library
diff --git a/package/libtasn1/patches/patch-configure b/package/libtasn1/patches/patch-configure
new file mode 100644
index 000000000..7b8e25cd5
--- /dev/null
+++ b/package/libtasn1/patches/patch-configure
@@ -0,0 +1,14 @@
+$Id$
+--- libtasn1-1.1.orig/configure Fri Aug 31 15:17:55 2007
++++ libtasn1-1.1/configure Thu Sep 6 15:24:25 2007
+@@ -23445,8 +23445,8 @@ echo "${ECHO_T}$gl_cv_next_unistd_h" >&6
+
+
+ # For libtasn1-config.
+-LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS"
+-LIBTASN1_CFLAGS="-I${includedir}"
++LIBTASN1_LIBS="-ltasn1 $LIBS"
++LIBTASN1_CFLAGS=
+
+
+ ac_config_commands="$ac_config_commands chmod"
diff --git a/package/libthread_db/Config.in b/package/libthread_db/Config.in
new file mode 100644
index 000000000..3aef82785
--- /dev/null
+++ b/package/libthread_db/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_LIBTHREAD_DB
+ prompt "libthread_db...................... POSIX threads library for Debugging"
+ tristate
+ default n
+ help
+ POSIX threads library
+
diff --git a/package/libthread_db/Makefile b/package/libthread_db/Makefile
new file mode 100644
index 000000000..4741ce3a5
--- /dev/null
+++ b/package/libthread_db/Makefile
@@ -0,0 +1,25 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+ifeq ($(ADK_TARGET_LIB_GLIBC),y)
+include ${TOPDIR}/toolchain/glibc/Makefile.inc
+else
+include ${TOPDIR}/toolchain/uClibc/Makefile.inc
+endif
+
+PKG_NAME:= libthread-db
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBTHREAD_DB,libthread-db,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LIBTHREAD_DB}/lib
+ ${CP} ${STAGING_DIR}/lib/libthread_db*.so* ${IDIR_LIBTHREAD_DB}/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libthread_db/ipkg/libthread-db.control b/package/libthread_db/ipkg/libthread-db.control
new file mode 100644
index 000000000..533ba4149
--- /dev/null
+++ b/package/libthread_db/ipkg/libthread-db.control
@@ -0,0 +1,4 @@
+Package: libthread-db
+Priority: optional
+Section: libs
+Description: POSIX threads library for gdb/gdbserver
diff --git a/package/libtiff/Config.in b/package/libtiff/Config.in
new file mode 100644
index 000000000..49c34ee14
--- /dev/null
+++ b/package/libtiff/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_LIBTIFF
+ prompt "libtiff........................... TIFF format files handling library"
+ tristate
+ default n
+ help
+ A library for reading/writing TIFF files
+
+ http://www.libtiff.org/
diff --git a/package/libtiff/Makefile b/package/libtiff/Makefile
new file mode 100644
index 000000000..7f50c2e68
--- /dev/null
+++ b/package/libtiff/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libtiff
+PKG_VERSION:= 3.8.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= fbb6f446ea4ed18955e2714934e5b698
+MASTER_SITES:= ftp://ftp.remotesensing.org/pub/libtiff/
+DISTFILES:= tiff-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/tiff-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBTIFF,libtiff,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-cxx
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBTIFF}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libtiff.so.* ${IDIR_LIBTIFF}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libtiff/ipkg/libtiff.control b/package/libtiff/ipkg/libtiff.control
new file mode 100644
index 000000000..9647d0730
--- /dev/null
+++ b/package/libtiff/ipkg/libtiff.control
@@ -0,0 +1,4 @@
+Package: libtiff
+Priority: optional
+Section: libs
+Description: A library for reading/writing TIFF images
diff --git a/package/libtirpc/Config.in b/package/libtirpc/Config.in
new file mode 100644
index 000000000..33d144dd7
--- /dev/null
+++ b/package/libtirpc/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBTIRPC
+ prompt "libtirpc.......................... A transport independent RPC library"
+ tristate
+ default n
+ help
+ A transport independent RPC library
+
+ http://libtirpc.sourceforge.net/
+
diff --git a/package/libtirpc/Makefile b/package/libtirpc/Makefile
new file mode 100644
index 000000000..c9ec41721
--- /dev/null
+++ b/package/libtirpc/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libtirpc
+PKG_VERSION:= 0.1.11
+PKG_RELEASE:= 2
+PKG_MD5SUM:= c656b7bf47e8bddbdefcd0b6a6f77b71
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=libtirpc/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBTIRPC,libtirpc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= autotool gnu
+ifneq (${ADK_COMPILE_NFS_UTILS_WITH_KERBEROS},y)
+CONFIGURE_ARGS+= --disable-gss
+endif
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBTIRPC}/usr/lib ${IDIR_LIBTIRPC}/etc
+ ${CP} ${WRKINST}/usr/lib/libtirpc*.so* ${IDIR_LIBTIRPC}/usr/lib/
+ ${CP} ./files/netconfig ${IDIR_LIBTIRPC}/etc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libtirpc/files/netconfig b/package/libtirpc/files/netconfig
new file mode 100644
index 000000000..5cbe4c120
--- /dev/null
+++ b/package/libtirpc/files/netconfig
@@ -0,0 +1,7 @@
+udp tpi_clts v inet udp - -
+tcp tpi_cots_ord v inet tcp - -
+udp6 tpi_clts v inet6 udp - -
+tcp6 tpi_cots_ord v inet6 tcp - -
+rawip tpi_raw - inet - - -
+local tpi_cots_ord - loopback - - -
+unix tpi_cots_ord - loopback - - -
diff --git a/package/libtirpc/ipkg/libtirpc.control b/package/libtirpc/ipkg/libtirpc.control
new file mode 100644
index 000000000..2253115a3
--- /dev/null
+++ b/package/libtirpc/ipkg/libtirpc.control
@@ -0,0 +1,4 @@
+Package: libtirpc
+Priority: optional
+Section: libs
+Description: a transport independent RPC library
diff --git a/package/libtirpc/patches/patch-Makefile_am b/package/libtirpc/patches/patch-Makefile_am
new file mode 100644
index 000000000..e95e38150
--- /dev/null
+++ b/package/libtirpc/patches/patch-Makefile_am
@@ -0,0 +1,10 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtirpc-0.1.9.orig/Makefile.am 2008-07-09 20:13:20.000000000 +0200
++++ libtirpc-0.1.9/Makefile.am 2008-12-10 01:02:50.823745058 +0100
+@@ -46,6 +46,3 @@ nobase_include_HEADERS = tirpc/un-namesp
+ pkgconfigdir=$(libdir)/pkgconfig
+ pkgconfig_DATA = libtirpc.pc
+
+-install-exec-local:
+- cp -p ./doc/etc_netconfig $(DESTDIR)/etc/netconfig
+- chmod 0644 $(DESTDIR)/etc/netconfig
diff --git a/package/libtirpc/patches/patch-src_Makefile_am b/package/libtirpc/patches/patch-src_Makefile_am
new file mode 100644
index 000000000..9248c173d
--- /dev/null
+++ b/package/libtirpc/patches/patch-src_Makefile_am
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtirpc-0.1.9.orig/src/Makefile.am 2008-07-09 20:13:20.000000000 +0200
++++ libtirpc-0.1.9/src/Makefile.am 2008-10-27 14:54:13.000000000 +0100
+@@ -20,8 +20,7 @@ libtirpc_la_SOURCES = auth_none.c auth_u
+ pmap_prot.c pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c \
+ rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+ rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_generic.c \
+- svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+- auth_time.c auth_des.c authdes_prot.c
++ svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c
+
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c
+@@ -62,5 +61,5 @@ $(libtirpc_la_OBJECTS) :auth_none.c auth
+ rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_generic.c \
+ svc_raw.c svc_run.c svc_simple.c svc_vc.c \
+ xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c \
+- getpeereid.c auth_time.c auth_des.c authdes_prot.c
++ getpeereid.c
+ endif
diff --git a/package/libtirpc/patches/patch-src_rpc_soc_c b/package/libtirpc/patches/patch-src_rpc_soc_c
new file mode 100644
index 000000000..6422d507c
--- /dev/null
+++ b/package/libtirpc/patches/patch-src_rpc_soc_c
@@ -0,0 +1,41 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtirpc-0.1.9.orig/src/rpc_soc.c 2008-07-09 20:13:20.000000000 +0200
++++ libtirpc-0.1.9/src/rpc_soc.c 2008-10-28 16:20:59.000000000 +0100
+@@ -480,37 +480,6 @@ clnt_broadcast(prog, vers, proc, xargs,
+ (resultproc_t) rpc_wrap_bcast, "udp");
+ }
+
+-/*
+- * Create the client des authentication object. Obsoleted by
+- * authdes_seccreate().
+- */
+-AUTH *
+-authdes_create(servername, window, syncaddr, ckey)
+- char *servername; /* network name of server */
+- u_int window; /* time to live */
+- struct sockaddr *syncaddr; /* optional hostaddr to sync with */
+- des_block *ckey; /* optional conversation key to use */
+-{
+- AUTH *dummy;
+- AUTH *nauth;
+- char hostname[NI_MAXHOST];
+-
+- if (syncaddr) {
+- /*
+- * Change addr to hostname, because that is the way
+- * new interface takes it.
+- */
+- if (getnameinfo(syncaddr, sizeof(syncaddr), hostname,
+- sizeof hostname, NULL, 0, 0) != 0)
+- goto fallback;
+-
+- nauth = authdes_seccreate(servername, window, hostname, ckey);
+- return (nauth);
+- }
+-fallback:
+- dummy = authdes_seccreate(servername, window, NULL, ckey);
+- return (dummy);
+-}
+
+ /*
+ * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
diff --git a/package/libtool/Config.in b/package/libtool/Config.in
new file mode 100644
index 000000000..aed0c9640
--- /dev/null
+++ b/package/libtool/Config.in
@@ -0,0 +1,14 @@
+config ADK_COMPILE_LIBTOOL
+ tristate
+ depends ADK_PACKAGE_LIBLTDL
+
+config ADK_PACKAGE_LIBLTDL
+ prompt "libltdl........................... A generic dynamic object loading library"
+ tristate
+ default n
+ select ADK_COMPILE_LIBTOOL
+ help
+ A generic dynamic object loading library.
+
+ http://www.gnu.org/software/libtool/
+
diff --git a/package/libtool/Makefile b/package/libtool/Makefile
new file mode 100644
index 000000000..4a23de141
--- /dev/null
+++ b/package/libtool/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libtool
+PKG_VERSION:= 1.5.22
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8e0ac9797b62ba4dcc8a2fb7936412b0
+MASTER_SITES:= ${MASTER_SITE_GNU:=libtool/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBLTDL,libltdl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBLTDL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libltdl.so.* ${IDIR_LIBLTDL}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libtool/ipkg/libltdl.control b/package/libtool/ipkg/libltdl.control
new file mode 100644
index 000000000..d6a1777d3
--- /dev/null
+++ b/package/libtool/ipkg/libltdl.control
@@ -0,0 +1,4 @@
+Package: libltdl
+Priority: optional
+Section: libs
+Description: a generic dynamic object loading library
diff --git a/package/libtool/patches/01-force_dlopen_deplibs.patch b/package/libtool/patches/01-force_dlopen_deplibs.patch
new file mode 100644
index 000000000..dfcf56b32
--- /dev/null
+++ b/package/libtool/patches/01-force_dlopen_deplibs.patch
@@ -0,0 +1,14 @@
+diff -urN libtool-1.5.14/libltdl/acinclude.m4 libtool-1.5.14.new/libltdl/acinclude.m4
+--- libtool-1.5.14/libltdl/acinclude.m4 2005-02-12 13:20:02.000000000 +0100
++++ libtool-1.5.14.new/libltdl/acinclude.m4 2006-04-17 23:00:24.000000000 +0200
+@@ -6228,10 +6228,8 @@
+ ;;
+ esac
+ ])
+-if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
+ AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
+ [Define if the OS needs help to load dependent libraries for dlopen().])
+-fi
+ ])# AC_LTDL_SYS_DLOPEN_DEPLIBS
+
+
diff --git a/package/libtorrent/Config.in b/package/libtorrent/Config.in
new file mode 100644
index 000000000..6b65665a1
--- /dev/null
+++ b/package/libtorrent/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LIBTORRENT
+ prompt "libtorrent........................ bittorrent library"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBSTDCXX
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBSIGCXX
+ help
+ http://libtorrent.rakshasa.no/
diff --git a/package/libtorrent/Makefile b/package/libtorrent/Makefile
new file mode 100644
index 000000000..8dc335cd8
--- /dev/null
+++ b/package/libtorrent/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libtorrent
+PKG_VERSION:= 0.12.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0831ca06f8906c7898fd67931ab239c7
+MASTER_SITES:= http://libtorrent.rakshasa.no/downloads/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBTORRENT,libtorrent,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-aligned
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBTORRENT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libtorrent.so.* ${IDIR_LIBTORRENT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libtorrent/ipkg/libtorrent.control b/package/libtorrent/ipkg/libtorrent.control
new file mode 100644
index 000000000..7634b1860
--- /dev/null
+++ b/package/libtorrent/ipkg/libtorrent.control
@@ -0,0 +1,5 @@
+Package: libtorrent
+Priority: optional
+Section: libs
+Depends: uclibc++
+Description: A bittorrent library
diff --git a/package/libtorrent/patches/patch-rak_functional_h b/package/libtorrent/patches/patch-rak_functional_h
new file mode 100644
index 000000000..1b8347d6f
--- /dev/null
+++ b/package/libtorrent/patches/patch-rak_functional_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/rak/functional.h 2008-05-07 14:19:14.000000000 +0200
++++ libtorrent-0.12.2/rak/functional.h 2008-12-14 21:36:38.000000000 +0100
+@@ -37,6 +37,7 @@
+ #ifndef RAK_FUNCTIONAL_H
+ #define RAK_FUNCTIONAL_H
+
++#include <cstdlib>
+ #include <functional>
+
+ namespace rak {
diff --git a/package/libtorrent/patches/patch-src_data_chunk_cc b/package/libtorrent/patches/patch-src_data_chunk_cc
new file mode 100644
index 000000000..af7c2c62d
--- /dev/null
+++ b/package/libtorrent/patches/patch-src_data_chunk_cc
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/src/data/chunk.cc 2008-05-07 14:19:13.000000000 +0200
++++ libtorrent-0.12.2/src/data/chunk.cc 2008-12-14 21:42:29.000000000 +0100
+@@ -38,6 +38,7 @@
+
+ #include <algorithm>
+ #include <functional>
++#include <cstring>
+
+ #include "torrent/exceptions.h"
+
diff --git a/package/libtorrent/patches/patch-src_data_chunk_list_h b/package/libtorrent/patches/patch-src_data_chunk_list_h
new file mode 100644
index 000000000..c1a324bee
--- /dev/null
+++ b/package/libtorrent/patches/patch-src_data_chunk_list_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/src/data/chunk_list.h 2008-05-07 14:19:13.000000000 +0200
++++ libtorrent-0.12.2/src/data/chunk_list.h 2008-12-14 21:34:31.000000000 +0100
+@@ -38,6 +38,7 @@
+ #define LIBTORRENT_DATA_CHUNK_LIST_H
+
+ #include <vector>
++#include <string>
+ #include <rak/error_number.h>
+ #include <rak/functional.h>
+
diff --git a/package/libtorrent/patches/patch-src_net_address_list_cc b/package/libtorrent/patches/patch-src_net_address_list_cc
new file mode 100644
index 000000000..4f888d13d
--- /dev/null
+++ b/package/libtorrent/patches/patch-src_net_address_list_cc
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/src/net/address_list.cc 2008-05-07 14:19:12.000000000 +0200
++++ libtorrent-0.12.2/src/net/address_list.cc 2008-12-14 21:47:24.000000000 +0100
+@@ -38,6 +38,8 @@
+
+ #include <rak/functional.h>
+
++#include <algorithm>
++
+ #include "download/download_info.h" // for SocketAddressCompact
+
+ #include "address_list.h"
diff --git a/package/libtorrent/patches/patch-src_torrent_data_file_list_iterator_h b/package/libtorrent/patches/patch-src_torrent_data_file_list_iterator_h
new file mode 100644
index 000000000..d20b9f974
--- /dev/null
+++ b/package/libtorrent/patches/patch-src_torrent_data_file_list_iterator_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/src/torrent/data/file_list_iterator.h 2008-05-07 14:19:13.000000000 +0200
++++ libtorrent-0.12.2/src/torrent/data/file_list_iterator.h 2008-12-14 21:31:54.000000000 +0100
+@@ -39,6 +39,7 @@
+
+ #include <torrent/common.h>
+ #include <torrent/data/file_list.h>
++#include <cstdlib>
+
+ namespace torrent {
+
diff --git a/package/libtorrent/patches/patch-src_torrent_exceptions_cc b/package/libtorrent/patches/patch-src_torrent_exceptions_cc
new file mode 100644
index 000000000..2ed644ae1
--- /dev/null
+++ b/package/libtorrent/patches/patch-src_torrent_exceptions_cc
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/src/torrent/exceptions.cc 2008-05-07 14:19:13.000000000 +0200
++++ libtorrent-0.12.2/src/torrent/exceptions.cc 2008-12-14 21:40:48.000000000 +0100
+@@ -37,6 +37,7 @@
+ #include "config.h"
+
+ #include <cerrno>
++#include <cstring>
+
+ #include "exceptions.h"
+
diff --git a/package/libtorrent/patches/patch-src_torrent_tracker_list_h b/package/libtorrent/patches/patch-src_torrent_tracker_list_h
new file mode 100644
index 000000000..b307908e4
--- /dev/null
+++ b/package/libtorrent/patches/patch-src_torrent_tracker_list_h
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/src/torrent/tracker_list.h 2008-05-07 14:19:13.000000000 +0200
++++ libtorrent-0.12.2/src/torrent/tracker_list.h 2008-12-14 22:31:57.000000000 +0100
+@@ -39,6 +39,7 @@
+
+ #include <algorithm>
+ #include <vector>
++#include <string>
+ #include <torrent/common.h>
+
+ namespace torrent {
diff --git a/package/libtorrent/patches/patch-src_utils_diffie_hellman_cc b/package/libtorrent/patches/patch-src_utils_diffie_hellman_cc
new file mode 100644
index 000000000..3608b70ba
--- /dev/null
+++ b/package/libtorrent/patches/patch-src_utils_diffie_hellman_cc
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libtorrent-0.12.2.orig/src/utils/diffie_hellman.cc 2008-05-07 14:19:12.000000000 +0200
++++ libtorrent-0.12.2/src/utils/diffie_hellman.cc 2008-12-14 21:51:18.000000000 +0100
+@@ -37,6 +37,7 @@
+ #include "config.h"
+
+ #include <string>
++#include <cstring>
+
+ #ifdef USE_OPENSSL
+ #include <openssl/bn.h>
diff --git a/package/libupnp/Config.in b/package/libupnp/Config.in
new file mode 100644
index 000000000..ad069b154
--- /dev/null
+++ b/package/libupnp/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_LIBUPNP
+ prompt "libupnp........................... Universal Plug and Play (UPnP) SDK library"
+ tristate
+ default n
+ help
+ The Universal Plug and Play (UPnP) SDK for Linux provides support
+ for building UPnP-compliant control points, devices, and bridges
+ on Linux.
+
+ http://upnp.sourceforge.net/
+
+ Depends: libpthread
+
diff --git a/package/libupnp/Makefile b/package/libupnp/Makefile
new file mode 100644
index 000000000..09e458f05
--- /dev/null
+++ b/package/libupnp/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libupnp
+PKG_VERSION:= 1.6.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8918dcf7428cd119d0c8275765ff2833
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=pupnp/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBUPNP,libupnp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= autotool gnu
+CONFIGURE_ARGS+= --disable-samples
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto confprog
+
+post-build:
+ sed -i -e 's#^libdir=.*#libdir=#' ${WRKBUILD}/threadutil/libthreadutil.la
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBUPNP}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/lib*.so* ${IDIR_LIBUPNP}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libupnp/ipkg/libupnp.control b/package/libupnp/ipkg/libupnp.control
new file mode 100644
index 000000000..2ebe4f7a8
--- /dev/null
+++ b/package/libupnp/ipkg/libupnp.control
@@ -0,0 +1,5 @@
+Package: libupnp
+Priority: optional
+Section: libs
+Depends: libpthread
+Description: The Universal Plug and Play (UPnP) SDK library.
diff --git a/package/libupnp/patches/patch-configure_ac b/package/libupnp/patches/patch-configure_ac
new file mode 100644
index 000000000..4bd55fdcc
--- /dev/null
+++ b/package/libupnp/patches/patch-configure_ac
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- libupnp-1.6.6.orig/configure.ac 2008-04-25 13:41:16.000000000 +0200
++++ libupnp-1.6.6/configure.ac 2008-10-28 11:42:40.000000000 +0100
+@@ -343,7 +343,6 @@ AC_CHECK_HEADERS(
+ sys/ioctl.h \
+ sys/socket.h \
+ sys/time.h \
+- sys/timeb.h \
+ syslog.h \
+ unistd.h \
+ ],
diff --git a/package/libusb/Config.in b/package/libusb/Config.in
new file mode 100644
index 000000000..ca6face1d
--- /dev/null
+++ b/package/libusb/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_LIBUSB
+ prompt "libusb............................ A library for accessing Linux USB devices"
+ tristate
+ default n
+ help
+ A library for accessing Linux USB devices
+
+ http://libusb.sourceforge.net/
+
diff --git a/package/libusb/Makefile b/package/libusb/Makefile
new file mode 100644
index 000000000..ba6fe0a65
--- /dev/null
+++ b/package/libusb/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libusb
+PKG_VERSION:= 0.1.10a
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c6062b29acd2cef414bcc34e0decbdd1
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=libusb/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBUSB,libusb,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_c_bigendian=no
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBUSB}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libusb*.so* ${IDIR_LIBUSB}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libusb/ipkg/libusb.control b/package/libusb/ipkg/libusb.control
new file mode 100644
index 000000000..599a217fc
--- /dev/null
+++ b/package/libusb/ipkg/libusb.control
@@ -0,0 +1,4 @@
+Package: libusb
+Priority: optional
+Section: libs
+Description: a Library for accessing Linux USB devices
diff --git a/package/libusb/patches/no-libusbpp.patch b/package/libusb/patches/no-libusbpp.patch
new file mode 100644
index 000000000..7fb5bd202
--- /dev/null
+++ b/package/libusb/patches/no-libusbpp.patch
@@ -0,0 +1,114 @@
+--- libusb-0.1.10a.orig/Makefile.in 2005-02-14 21:23:19.000000000 +0100
++++ libusb-0.1.10a/Makefile.in 2008-12-07 23:13:01.000000000 +0100
+@@ -16,7 +16,7 @@
+
+
+
+-SOURCES = $(libusb_la_SOURCES) $(libusbpp_la_SOURCES)
++SOURCES = $(libusb_la_SOURCES)
+
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
+@@ -71,8 +71,8 @@ am__libusb_la_SOURCES_DIST = usb.c usbi.
+ am_libusb_la_OBJECTS = usb.lo error.lo descriptors.lo $(am__objects_1)
+ libusb_la_OBJECTS = $(am_libusb_la_OBJECTS)
+ libusbpp_la_LIBADD =
+-am_libusbpp_la_OBJECTS = usbpp.lo
+-libusbpp_la_OBJECTS = $(am_libusbpp_la_OBJECTS)
++am_libusbpp_la_OBJECTS =
++libusbpp_la_OBJECTS =
+ binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+ SCRIPTS = $(bin_SCRIPTS)
+ DEFAULT_INCLUDES =
+@@ -80,15 +80,14 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
+ am__depfiles_maybe = depfiles
+ @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bsd.Plo ./$(DEPDIR)/darwin.Plo \
+ @AMDEP_TRUE@ ./$(DEPDIR)/descriptors.Plo ./$(DEPDIR)/error.Plo \
+-@AMDEP_TRUE@ ./$(DEPDIR)/linux.Plo ./$(DEPDIR)/usb.Plo \
+-@AMDEP_TRUE@ ./$(DEPDIR)/usbpp.Plo
++@AMDEP_TRUE@ ./$(DEPDIR)/linux.Plo ./$(DEPDIR)/usb.Plo
+ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
++LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+ CCLD = $(CC)
+-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
++LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+@@ -98,8 +97,8 @@ LTCXXCOMPILE = $(LIBTOOL) --mode=compile
+ CXXLD = $(CXX)
+ CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+-SOURCES = $(libusb_la_SOURCES) $(libusbpp_la_SOURCES)
+-DIST_SOURCES = $(am__libusb_la_SOURCES_DIST) $(libusbpp_la_SOURCES)
++SOURCES = $(libusb_la_SOURCES)
++DIST_SOURCES = $(am__libusb_la_SOURCES_DIST)
+ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+@@ -250,7 +249,7 @@ target_alias = @target_alias@
+ # require automake 1.4
+ # gnu strictness chokes on README being autogenerated
+ AUTOMAKE_OPTIONS = 1.4 foreign
+-SUBDIRS = . tests doc
++SUBDIRS = .
+ AM_CFLAGS = $(CFLAGS_EXT)
+ configincludedir = $(pkglibdir)/include
+ bin_SCRIPTS = libusb-config
+@@ -259,7 +258,7 @@ EXTRA_DIST = LICENSE libusb.spec.in libu
+ apidocs/footer.html apidocs/doxygen.css apidocs/doxygen.png
+
+ EXTRA_libusb_la_SOURCE = linux.c linux.h bsd.c darwin.c
+-lib_LTLIBRARIES = libusb.la libusbpp.la
++lib_LTLIBRARIES = libusb.la
+ @BSD_API_FALSE@@DARWIN_API_FALSE@@LINUX_API_FALSE@OS_SUPPORT =
+ @BSD_API_FALSE@@DARWIN_API_TRUE@@LINUX_API_FALSE@OS_SUPPORT = darwin.c
+ @BSD_API_TRUE@@LINUX_API_FALSE@OS_SUPPORT = bsd.c
+@@ -269,24 +268,18 @@ lib_LTLIBRARIES = libusb.la libusbpp.la
+ AM_CPPFLAGS = -I.
+ AM_CXXFLAGS =
+ libusb_la_SOURCES = usb.c usbi.h error.c error.h descriptors.c $(OS_SUPPORT)
+-libusbpp_la_SOURCES = usbpp.cpp usbpp.h
++libusbpp_la_SOURCES =
+
+ # Do not add usb.h to *_SOURCES, regardless of dependencies.
+ # It would be added to the dist tarball, which it shouldn't be.
+ nodist_include_HEADERS = usb.h
+-include_HEADERS = usbpp.h
++include_HEADERS =
+ libusb_la_LDFLAGS = \
+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+ -release $(LT_RELEASE) \
+ -export-dynamic \
+ $(LDADDS)
+
+-libusbpp_la_LDFLAGS = \
+- -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
+- -release $(LT_RELEASE) \
+- -export-dynamic \
+- $(LDADDS) -lusb $(QT_LDFLAGS)
+-
+ all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+@@ -381,8 +374,6 @@ clean-libLTLIBRARIES:
+ done
+ libusb.la: $(libusb_la_OBJECTS) $(libusb_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libusb_la_LDFLAGS) $(libusb_la_OBJECTS) $(libusb_la_LIBADD) $(LIBS)
+-libusbpp.la: $(libusbpp_la_OBJECTS) $(libusbpp_la_DEPENDENCIES)
+- $(CXXLINK) -rpath $(libdir) $(libusbpp_la_LDFLAGS) $(libusbpp_la_OBJECTS) $(libusbpp_la_LIBADD) $(LIBS)
+ install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+@@ -415,7 +406,6 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb.Plo@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usbpp.Plo@am__quote@
+
+ .c.o:
+ @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
diff --git a/package/libvorbis/Config.in b/package/libvorbis/Config.in
new file mode 100644
index 000000000..9990cb8c1
--- /dev/null
+++ b/package/libvorbis/Config.in
@@ -0,0 +1,20 @@
+config ADK_PACKAGE_LIBVORBIS
+ prompt "libvorbis......................... The Vorbis General Audio Compression Codec library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOGG
+ help
+ The Vorbis General Audio Compression Codec library.
+
+ http://www.vorbis.com/
+
+config ADK_PACKAGE_LIBVORBISENC
+ prompt "libvorbisenc...................... The Vorbis General Audio Compression Codec library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBVORBIS
+ help
+ The Vorbis General Audio Compression Codec library.
+ This is the encoding part, needed f.e. for mpd shout support.
+ http://www.vorbis.com/
+
diff --git a/package/libvorbis/Makefile b/package/libvorbis/Makefile
new file mode 100644
index 000000000..ea4f4f56a
--- /dev/null
+++ b/package/libvorbis/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libvorbis
+PKG_VERSION:= 1.2.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 478646358c49f34aedcce58948793619
+MASTER_SITES:= http://downloads.xiph.org/releases/vorbis/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBVORBIS,libvorbis,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBVORBISENC,libvorbisenc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= LIBS="-lm -logg"
+CONFIGURE_ARGS+= --with-ogg="${STAGING_DIR}/usr" \
+ --with-ogg-includes="${STAGING_DIR}/usr/include" \
+ --with-ogg-libraries="${STAGING_DIR}/usr/lib"
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBVORBIS}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libvorbis.so.* ${IDIR_LIBVORBIS}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/libvorbisfile.so.* ${IDIR_LIBVORBIS}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_LIBVORBISENC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libvorbisenc.so.* ${IDIR_LIBVORBISENC}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libvorbis/ipkg/libvorbis.control b/package/libvorbis/ipkg/libvorbis.control
new file mode 100644
index 000000000..d122faa2e
--- /dev/null
+++ b/package/libvorbis/ipkg/libvorbis.control
@@ -0,0 +1,4 @@
+Package: libvorbis
+Priority: optional
+Section: libs
+Description: The Vorbis General Audio Compression Codec library
diff --git a/package/libvorbis/ipkg/libvorbisenc.control b/package/libvorbis/ipkg/libvorbisenc.control
new file mode 100644
index 000000000..16167ef32
--- /dev/null
+++ b/package/libvorbis/ipkg/libvorbisenc.control
@@ -0,0 +1,4 @@
+Package: libvorbisenc
+Priority: optional
+Section: libs
+Description: The Vorbis General Audio Compression Codec library
diff --git a/package/libvorbis/patches/patch-Makefile_in b/package/libvorbis/patches/patch-Makefile_in
new file mode 100644
index 000000000..51c885573
--- /dev/null
+++ b/package/libvorbis/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- libvorbis-1.2.0.orig/Makefile.in 2007-07-25 16:46:36.000000000 +0000
++++ libvorbis-1.2.0/Makefile.in 2007-10-11 09:22:14.000000000 +0000
+@@ -221,7 +221,7 @@ target_vendor = @target_vendor@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ AUTOMAKE_OPTIONS = 1.6 foreign dist-zip dist-bzip2
+-SUBDIRS = lib include doc examples vq
++SUBDIRS = lib include doc vq
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = vorbis.m4
+ pkgconfigdir = $(libdir)/pkgconfig
diff --git a/package/libvorbisidec/Config.in b/package/libvorbisidec/Config.in
new file mode 100644
index 000000000..b4794f02a
--- /dev/null
+++ b/package/libvorbisidec/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_LIBVORBISIDEC
+ prompt "libvorbisidec..................... A fixed-point implementation (Tremor) of libogg/libvorbis"
+ tristate
+ default n
+ help
+ libvorbisidec is "tremor", a fixed-point implementation of libvorbis.
+ It also has libogg built-in. It is suitable as a replacement for
+ libvorbis and libogg in tremor-aware applications.
+ Tremor is a decoder only.
+
+ http://http://wiki.xiph.org/index.php/Tremor
+
diff --git a/package/libvorbisidec/Makefile b/package/libvorbisidec/Makefile
new file mode 100644
index 000000000..89158db04
--- /dev/null
+++ b/package/libvorbisidec/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libvorbisidec
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 1
+PKG_VARIANT:= svn15687
+PKG_MD5SUM:= cd3f62e87e38548c3e1120b1b2d3cac7
+MASTER_SITES:= http://ftp.de.debian.org/debian/pool/main/libv/libvorbisidec/
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}+$(PKG_VARIANT).orig.tar.gz
+WRKDIST= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)+$(PKG_VARIANT)
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBVORBISIDEC,libvorbisidec,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-extract:
+ cd ${WRKBUILD}; ./autogen.sh
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBVORBISIDEC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libvorbisidec.so.* ${IDIR_LIBVORBISIDEC}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libvorbisidec/ipkg/libvorbisidec.control b/package/libvorbisidec/ipkg/libvorbisidec.control
new file mode 100644
index 000000000..41cd1e037
--- /dev/null
+++ b/package/libvorbisidec/ipkg/libvorbisidec.control
@@ -0,0 +1,4 @@
+Package: libvorbisidec
+Priority: optional
+Section: libs
+Description: A fixed-point implementation (Tremor) of libogg/libvorbis"
diff --git a/package/libxkbfile/Config.in b/package/libxkbfile/Config.in
new file mode 100644
index 000000000..9b6adea78
--- /dev/null
+++ b/package/libxkbfile/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LIBXKBFILE
+ prompt "libxkbfile.............................. X keyboard library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/libxkbfile/Makefile b/package/libxkbfile/Makefile
new file mode 100644
index 000000000..ddc8cd296
--- /dev/null
+++ b/package/libxkbfile/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= libxkbfile
+PKG_VERSION:= 1.0.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8be68d830d227cbd52cbafe24cb4fa78
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBXKBFILE,libxkbfile,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXKBFILE}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libxkbfile.so* ${IDIR_LIBXKBFILE}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libxkbfile/ipkg/libxkbfile.control b/package/libxkbfile/ipkg/libxkbfile.control
new file mode 100644
index 000000000..c48619921
--- /dev/null
+++ b/package/libxkbfile/ipkg/libxkbfile.control
@@ -0,0 +1,4 @@
+Package: libxkbfile
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/libxml2/Config.in b/package/libxml2/Config.in
new file mode 100644
index 000000000..c9a6833de
--- /dev/null
+++ b/package/libxml2/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_LIBXML2
+ prompt "libxml2........................... Gnome XML library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_ZLIB
+ help
+ A library for manipulating XML and HTML resources.
+
+ http://xmlsoft.org/
+
diff --git a/package/libxml2/Makefile b/package/libxml2/Makefile
new file mode 100644
index 000000000..3a8afc371
--- /dev/null
+++ b/package/libxml2/Makefile
@@ -0,0 +1,55 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libxml2
+PKG_VERSION:= 2.7.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= dc43ff7ae6aded45f578c87b7b0c8766
+MASTER_SITES:= http://xmlsoft.org/sources/ \
+ ftp://fr.rpmfind.net/pub/libxml/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBXML2,libxml2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --without-c14n \
+ --without-catalog \
+ --without-debug \
+ --without-docbook \
+ --with-html \
+ --without-ftp \
+ --without-http \
+ --without-iconv \
+ --without-iso8859x \
+ --without-legacy \
+ --with-output \
+ --without-pattern \
+ --without-push \
+ --without-python \
+ --with-reader \
+ --without-readline \
+ --without-regexps \
+ --with-sax1 \
+ --with-schemas \
+ --with-threads \
+ --with-tree \
+ --with-valid \
+ --with-writer \
+ --with-xinclude \
+ --with-xpath \
+ --with-xptr \
+ --with-zlib
+
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXML2}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libxml2.so.* ${IDIR_LIBXML2}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libxml2/ipkg/libxml2.control b/package/libxml2/ipkg/libxml2.control
new file mode 100644
index 000000000..927409187
--- /dev/null
+++ b/package/libxml2/ipkg/libxml2.control
@@ -0,0 +1,5 @@
+Package: libxml2
+Priority: optional
+Section: libs
+Description: Gnome XML library
+Depends: zlib
diff --git a/package/libxslt/Config.in b/package/libxslt/Config.in
new file mode 100644
index 000000000..ed8bfe177
--- /dev/null
+++ b/package/libxslt/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LIBXSLT
+ prompt "libxslt........................... Gnome XSLT library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBXML2
+ help
+ A library for XML transformation using XSLT.
+
+ http://xmlsoft.org/XSLT/
+
diff --git a/package/libxslt/Makefile b/package/libxslt/Makefile
new file mode 100644
index 000000000..39fa934cc
--- /dev/null
+++ b/package/libxslt/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= libxslt
+PKG_VERSION:= 1.1.24
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e83ec5d27fc4c10c6f612879bea9a153
+MASTER_SITES:= http://xmlsoft.org/sources/ \
+ ftp://fr.rpmfind.net/pub/libxml/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBXSLT,libxslt,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-libxml-prefix="${STAGING_DIR}/usr" \
+ --with-libxml-include-prefix="${STAGING_DIR}/usr/include/libxml2" \
+ --with-libxml-libs-prefix="${STAGING_DIR}/usr/lib" \
+ --without-python \
+ --without-crypto \
+ --without-debug \
+ --without-mem-debug \
+ --without-debugger
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBXSLT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libxslt.so.* ${IDIR_LIBXSLT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/libxslt/ipkg/libxslt.control b/package/libxslt/ipkg/libxslt.control
new file mode 100644
index 000000000..7236bb147
--- /dev/null
+++ b/package/libxslt/ipkg/libxslt.control
@@ -0,0 +1,5 @@
+Package: libxslt
+Priority: optional
+Section: libs
+Description: Gnome XML library
+Depends: libxml2
diff --git a/package/lighttpd/Config.in b/package/lighttpd/Config.in
new file mode 100644
index 000000000..6eea65df2
--- /dev/null
+++ b/package/lighttpd/Config.in
@@ -0,0 +1,113 @@
+config ADK_PACKAGE_LIGHTTPD
+ prompt "lighttpd.......................... Flexible and lightweight web server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCRE
+ select ADK_COMPILE_SQLITE
+ select ADK_PACKAGE_LIBXML2
+ help
+ A flexible and lightweight web server.
+
+ http://www.lighttpd.net/
+
+config ADK_COMPILE_LIGHTTPD_WITH_OPENSSL
+ bool " Use OpenSSL for https support"
+ default y
+ depends on ADK_PACKAGE_LIGHTTPD
+ select ADK_PACKAGE_LIBOPENSSL
+
+config ADK_PACKAGE_LIGHTTPD_MOD_ACCESSLOG
+ prompt " lighttpd-mod-accesslog........ Access logging module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_ALIAS
+ prompt " lighttpd-mod-alias............ Directory alias module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_AUTH
+ prompt " lighttpd-mod-auth............. Authentication module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_CGI
+ prompt " lighttpd-mod-cgi.............. CGI module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_EVASIVE
+ prompt " lighttpd-mod-evasive.......... Evasive module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_EXPIRE
+ prompt " lighttpd-mod-expire........... Expire module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_FASTCGI
+ prompt " lighttpd-mod-fastcgi.......... FastCGI module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_PROXY
+ prompt " lighttpd-mod-proxy............ Proxy module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_REDIRECT
+ prompt " lighttpd-mod-redirect......... URL redirection module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_REWRITE
+ prompt " lighttpd-mod-rewrite.......... URL rewriting module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_SETENV
+ prompt " lighttpd-mod-setenv........... Environment variable setting module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_SIMPLE_VHOST
+ prompt " lighttpd-mod-simple-vhost..... Simple virtual hosting module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_SSI
+ prompt " lighttpd-mod-ssi.............. SSI module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_STATUS
+ prompt " lighttpd-mod-status........... Server status display module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_USERTRACK
+ prompt " lighttpd-mod-usertrack........ User tracking module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
+
+config ADK_PACKAGE_LIGHTTPD_MOD_WEBDAV
+ prompt " lighttpd-mod-webdav........... webdav module"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIGHTTPD
diff --git a/package/lighttpd/Makefile b/package/lighttpd/Makefile
new file mode 100644
index 000000000..7cd2f6c29
--- /dev/null
+++ b/package/lighttpd/Makefile
@@ -0,0 +1,104 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= lighttpd
+PKG_VERSION:= 1.4.22
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 949c33a81e83f7718a47280bef21b90c
+MASTER_SITES:= http://www.lighttpd.net/download/
+
+include $(TOPDIR)/mk/package.mk
+
+define PKG_mod_template
+
+INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
+
+${2}-install:
+ ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/lighttpd
+ ${INSTALL_BIN} $(WRKINST)/usr/lib/lighttpd/mod_$(2).so $$(IDIR_$(1))/usr/lib/lighttpd/
+
+endef
+
+$(eval $(call PKG_template,LIGHTTPD,lighttpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_ACCESSLOG,lighttpd-mod-accesslog,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_ALIAS,lighttpd-mod-alias,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_AUTH,lighttpd-mod-auth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_CGI,lighttpd-mod-cgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_EVASIVE,lighttpd-mod-evasive,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_EXPIRE,lighttpd-mod-expire,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_FASTCGI,lighttpd-mod-fastcgi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_PROXY,lighttpd-mod-proxy,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_REDIRECT,lighttpd-mod-redirect,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_REWRITE,lighttpd-mod-rewrite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_SETENV,lighttpd-mod-setenv,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_SIMPLE_VHOST,lighttpd-mod-simple-vhost,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_SSI,lighttpd-mod-ssi,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_STATUS,lighttpd-mod-status,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_USERTRACK,lighttpd-mod-usertrack,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,LIGHTTPD_MOD_WEBDAV,lighttpd-mod-webdav,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_ACCESSLOG,accesslog))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_ALIAS,alias))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_AUTH,auth))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_CGI,cgi))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_EVASIVE,evasive))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_EXPIRE,expire))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_FASTCGI,fastcgi))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_PROXY,proxy))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_REDIRECT,redirect))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_REWRITE,rewrite))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_SETENV,setenv))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_SIMPLE_VHOST,simple_vhost))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_SSI,ssi))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_STATUS,status))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_USERTRACK,usertrack))
+$(eval $(call PKG_mod_template,LIGHTTPD_MOD_WEBDAV,webdav))
+
+TCPPFLAGS+= -I$(STAGING_DIR)/usr/include/libxml2
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= PCRE_LIB="-lpcre"
+CONFIGURE_ARGS+= --without-openssl \
+ --libdir=/usr/lib/lighttpd \
+ --sysconfdir=/etc/lighttpd \
+ --without-attr \
+ --without-bzip2 \
+ --without-fam \
+ --without-gdbm \
+ --without-ldap \
+ --without-lua \
+ --without-memcache \
+ --without-mysql \
+ --with-pcre \
+ --without-valgrind \
+ --with-webdav-props
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+ifeq (${ADK_COMPILE_LIGHTTPD_WITH_OPENSSL},y)
+CONFIGURE_ARGS+= --with-openssl='${STAGING_DIR}/usr'
+endif
+
+post-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
+ install -m0755 -d $(IDIR_LIGHTTPD)/etc
+ install -m0644 ./files/lighttpd.conf $(IDIR_LIGHTTPD)/etc/
+ install -m0755 -d $(IDIR_LIGHTTPD)/etc/init.d
+ install -m0644 ./files/lighttpd.init \
+ $(IDIR_LIGHTTPD)/etc/init.d/lighttpd
+ install -m0755 -d $(IDIR_LIGHTTPD)/usr/lib/lighttpd
+ for m in dirlisting indexfile staticfile; do \
+ $(CP) $(WRKINST)/usr/lib/lighttpd/mod_$$m.so $(IDIR_LIGHTTPD)/usr/lib/lighttpd/ ; \
+ done
+ install -m0755 -d $(IDIR_LIGHTTPD)/usr/sbin
+ $(CP) $(WRKINST)/usr/sbin/lighttpd $(IDIR_LIGHTTPD)/usr/sbin/
+ifeq (${ADK_COMPILE_LIGHTTPD_WITH_OPENSSL},y)
+ echo 'Depends: libxml2, libsqlite, libpcre, openssl' \
+ >>${IDIR_LIGHTTPD}/CONTROL/control
+else
+ echo 'Depends: libxml2, libsqlite, libpcre' \
+ >>${IDIR_LIGHTTPD}/CONTROL/control
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/lighttpd/files/lighttpd.conf b/package/lighttpd/files/lighttpd.conf
new file mode 100644
index 000000000..b97b39120
--- /dev/null
+++ b/package/lighttpd/files/lighttpd.conf
@@ -0,0 +1,217 @@
+# lighttpd configuration file
+#
+## modules to load
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+#server.modules = (
+# "mod_rewrite",
+# "mod_redirect",
+# "mod_alias",
+# "mod_auth",
+# "mod_status",
+# "mod_setenv",
+# "mod_fastcgi",
+# "mod_proxy",
+# "mod_simple_vhost",
+# "mod_cgi",
+# "mod_ssi",
+# "mod_usertrack",
+# "mod_expire"
+#)
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root = "/tmp/"
+
+## where to send error-messages to
+#server.errorlog = "/var/log/lighttpd/error.log"
+
+## files to check for if .../ is requested
+index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" )
+
+## mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".class" => "application/octet-stream",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml"
+ )
+
+## Use the "Content-Type" extended attribute to obtain mime type if possible
+#mimetypes.use-xattr = "enable"
+
+## send a different Server: header
+## be nice and keep it at lighttpd
+#server.tag = "lighttpd"
+
+$HTTP["url"] =~ "\.pdf$" {
+ server.range-requests = "disable"
+}
+
+##
+# which extensions should not be handle via static-file transfer
+#
+# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+#server.port = 81
+
+## bind to localhost (default: all interfaces)
+#server.bind = "localhost"
+
+## error-handler for status 404
+#server.error-handler-404 = "/error-handler.html"
+#server.error-handler-404 = "/error-handler.php"
+
+## to help the rc.scripts
+server.pid-file = "/var/run/lighttpd.pid"
+
+
+###### virtual hosts
+##
+## If you want name-based virtual hosting add the next three settings and load
+## mod_simple_vhost
+##
+## document-root =
+## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
+## virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
+#simple-vhost.default-host = "grisu.home.kneschke.de"
+#simple-vhost.document-root = "/pages/"
+
+
+##
+## Format: <errorfile-prefix><status>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix = "/www/error-"
+
+## virtual directory listings
+#server.dir-listing = "enable"
+
+## send unhandled HTTP-header headers to error-log
+#debug.dump-unknown-headers = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username = "nobody"
+
+## change uid to <uid> (default: don't care)
+#server.groupname = "nobody"
+
+#### compress module
+#compress.cache-dir = "/dev/null/"
+#compress.filetype = ("text/plain", "text/html")
+
+#### proxy module
+## read proxy.txt for more info
+#proxy.server = (
+# ".php" => (
+# "localhost" => (
+# "host" => "192.168.0.101",
+# "port" => 80
+# )
+# )
+#)
+
+#### fastcgi module
+## read fastcgi.txt for more info
+#fastcgi.server = (
+# ".php" => (
+# "localhost" => (
+# "socket" => "/tmp/php-fastcgi.socket",
+# "bin-path" => "/usr/local/bin/php"
+# )
+# )
+#)
+
+#### CGI module
+#cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
+
+#### SSL engine
+#ssl.engine = "enable"
+#ssl.pemfile = "server.pem"
+
+#### status module
+#status.status-url = "/server-status"
+#status.config-url = "/server-config"
+
+#### auth module
+## read authentification.txt for more info
+#auth.backend = "plain"
+#auth.backend.plain.userfile = "lighttpd.user"
+#auth.backend.plain.groupfile = "lighttpd.group"
+#auth.require = (
+# "/server-status" => (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "group=www|user=jan|host=192.168.2.10"
+# ),
+# "/server-info" => (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "group=www|user=jan|host=192.168.2.10"
+# )
+#)
+
+#### url handling modules (rewrite, redirect, access)
+#url.rewrite = ( "^/$" => "/server-status" )
+#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+
+#### both rewrite/redirect support back reference to regex conditional using %n
+#$HTTP["host"] =~ "^www\.(.*)" {
+# url.redirect = ( "^/(.*)" => "http://%1/$1" )
+#}
+
+#### expire module
+#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+#ssi.extension = ( ".shtml" )
+
+#### setenv
+#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
+#setenv.add-response-header = ( "X-Secret-Message" => "42" )
+
+#### variable usage:
+## variable name without "." is auto prefixed by "var." and becomes "var.bar"
+#bar = 1
+#var.mystring = "foo"
+
+## integer add
+#bar += 1
+## string concat, with integer cast as string, result: "www.foo1.com"
+#server.name = "www." + mystring + var.bar + ".com"
+## array merge
+#index-file.names = (foo + ".php") + index-file.names
+#index-file.names += (foo + ".php")
+
+#### include
+#include /etc/lighttpd/lighttpd-inc.conf
+## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
+#include "lighttpd-inc.conf"
+
+#### include_shell
+#include_shell "echo var.a=1"
+## the above is same as:
+#var.a=1
diff --git a/package/lighttpd/files/lighttpd.init b/package/lighttpd/files/lighttpd.init
new file mode 100644
index 000000000..f8edbe10a
--- /dev/null
+++ b/package/lighttpd/files/lighttpd.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${lighttpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ lighttpd $lighttpd_flags
+ ;;
+stop)
+ killall lighttpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/lighttpd/ipkg/lighttpd-mod-accesslog.control b/package/lighttpd/ipkg/lighttpd-mod-accesslog.control
new file mode 100644
index 000000000..640122652
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-accesslog.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-accesslog
+Priority: optional
+Section: net
+Description: an access logging module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-alias.control b/package/lighttpd/ipkg/lighttpd-mod-alias.control
new file mode 100644
index 000000000..c1e12e373
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-alias.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-alias
+Priority: optional
+Section: net
+Description: a directory alias module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-auth.control b/package/lighttpd/ipkg/lighttpd-mod-auth.control
new file mode 100644
index 000000000..179501fbf
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-auth.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-auth
+Priority: optional
+Section: net
+Description: an authentication module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-cgi.control b/package/lighttpd/ipkg/lighttpd-mod-cgi.control
new file mode 100644
index 000000000..18c574a9b
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-cgi.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-cgi
+Priority: optional
+Section: net
+Description: a CGI module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-evasive.control b/package/lighttpd/ipkg/lighttpd-mod-evasive.control
new file mode 100644
index 000000000..dd00165ea
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-evasive.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-evasive
+Priority: optional
+Section: net
+Description: Evasive module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-expire.control b/package/lighttpd/ipkg/lighttpd-mod-expire.control
new file mode 100644
index 000000000..8d5c5546c
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-expire.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-expire
+Priority: optional
+Section: net
+Description: Expire module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-fastcgi.control b/package/lighttpd/ipkg/lighttpd-mod-fastcgi.control
new file mode 100644
index 000000000..123e9b636
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-fastcgi.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-fastcgi
+Priority: optional
+Section: net
+Description: FASTCGI module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-proxy.control b/package/lighttpd/ipkg/lighttpd-mod-proxy.control
new file mode 100644
index 000000000..5578d1a53
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-proxy.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-proxy
+Priority: optional
+Section: net
+Description: a proxy module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-redirect.control b/package/lighttpd/ipkg/lighttpd-mod-redirect.control
new file mode 100644
index 000000000..80f3a574c
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-redirect.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-redirect
+Priority: optional
+Section: net
+Description: an url redirection module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-rewrite.control b/package/lighttpd/ipkg/lighttpd-mod-rewrite.control
new file mode 100644
index 000000000..19c5b1a76
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-rewrite.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-rewrite
+Priority: optional
+Section: net
+Description: an url rewriting module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-setenv.control b/package/lighttpd/ipkg/lighttpd-mod-setenv.control
new file mode 100644
index 000000000..0506b7a4c
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-setenv.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-setenv
+Priority: optional
+Section: net
+Description: an environment variable setting module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-simple-vhost.control b/package/lighttpd/ipkg/lighttpd-mod-simple-vhost.control
new file mode 100644
index 000000000..58550e124
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-simple-vhost.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-simple-vhost
+Priority: optional
+Section: net
+Description: a simple virtual hosting module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-ssi.control b/package/lighttpd/ipkg/lighttpd-mod-ssi.control
new file mode 100644
index 000000000..266d4ea68
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-ssi.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-ssi
+Priority: optional
+Section: net
+Description: SSI module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-status.control b/package/lighttpd/ipkg/lighttpd-mod-status.control
new file mode 100644
index 000000000..081d21c4e
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-status.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-status
+Priority: optional
+Section: net
+Description: a server status display module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-usertrack.control b/package/lighttpd/ipkg/lighttpd-mod-usertrack.control
new file mode 100644
index 000000000..32a0e79a0
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-usertrack.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-usertrack
+Priority: optional
+Section: net
+Description: an user tracking module for lighttpd
+Depends: lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd-mod-webdav.control b/package/lighttpd/ipkg/lighttpd-mod-webdav.control
new file mode 100644
index 000000000..ebc52b58f
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd-mod-webdav.control
@@ -0,0 +1,5 @@
+Package: lighttpd-mod-webdav
+Priority: optional
+Section: net
+Depends: lighttpd, libxml2, libsqlite
+Description: a webdav module for lighttpd
diff --git a/package/lighttpd/ipkg/lighttpd.conffiles b/package/lighttpd/ipkg/lighttpd.conffiles
new file mode 100644
index 000000000..e90f8e19d
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd.conffiles
@@ -0,0 +1 @@
+/etc/lighttpd.conf
diff --git a/package/lighttpd/ipkg/lighttpd.control b/package/lighttpd/ipkg/lighttpd.control
new file mode 100644
index 000000000..788aa07e1
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd.control
@@ -0,0 +1,5 @@
+Package: lighttpd
+Priority: optional
+Section: net
+Description: a flexible and lightweight web server,
+ built with SSL support.
diff --git a/package/lighttpd/ipkg/lighttpd.postinst b/package/lighttpd/ipkg/lighttpd.postinst
new file mode 100644
index 000000000..dbf355c4b
--- /dev/null
+++ b/package/lighttpd/ipkg/lighttpd.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf lighttpd lighttpd NO
+add_rcconf lighttpd_flags lighttpd_flags "-f /etc/lighttpd.conf"
diff --git a/package/lighttpd/patches/500-configure_cross.patch b/package/lighttpd/patches/500-configure_cross.patch
new file mode 100644
index 000000000..8f8099823
--- /dev/null
+++ b/package/lighttpd/patches/500-configure_cross.patch
@@ -0,0 +1,24 @@
+diff -ruN lighttpd-1.4.2-old/configure lighttpd-1.4.2-new/configure
+--- lighttpd-1.4.2-old/configure 2005-08-29 14:18:11.000000000 +0200
++++ lighttpd-1.4.2-new/configure 2005-09-01 09:06:29.000000000 +0200
+@@ -23849,7 +23849,7 @@
+ echo "$as_me:$LINENO: result: $WITH_PCRE" >&5
+ echo "${ECHO_T}$WITH_PCRE" >&6
+
+-if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
++if test "$WITH_PCRE" != "no"; then
+ # Extract the first word of "pcre-config", so it can be a program name with args.
+ set dummy pcre-config; ac_word=$2
+ echo "$as_me:$LINENO: checking for $ac_word" >&5
+diff -ruN lighttpd-1.4.2-old/configure.in lighttpd-1.4.2-new/configure.in
+--- lighttpd-1.4.2-old/configure.in 2005-08-29 14:06:03.000000000 +0200
++++ lighttpd-1.4.2-new/configure.in 2005-09-01 09:05:39.000000000 +0200
+@@ -222,7 +222,7 @@
+ [WITH_PCRE=$withval],[WITH_PCRE=yes])
+ AC_MSG_RESULT([$WITH_PCRE])
+
+-if test "x$cross_compiling" = xno -a "$WITH_PCRE" != "no"; then
++if test "$WITH_PCRE" != "no"; then
+ AC_PATH_PROG(PCRECONFIG, pcre-config)
+
+ if test x"$PCRECONFIG" != x; then
diff --git a/package/links/Config.in b/package/links/Config.in
new file mode 100644
index 000000000..559e446f3
--- /dev/null
+++ b/package/links/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LINKS
+ prompt "links............................. web browser for console"
+ tristate
+ select ADK_PACKAGE_LIBJPEG
+ select ADK_PACKAGE_LIBPNG
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_GPM
+ default n
+ help
+ http://links.twibright.com/
diff --git a/package/links/Makefile b/package/links/Makefile
new file mode 100644
index 000000000..fb6070b52
--- /dev/null
+++ b/package/links/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= links
+PKG_VERSION:= 2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c9937f9ed0061f264973182f871fb667
+MASTER_SITES:= http://links.twibright.com/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LINKS,links,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-graphics \
+ --with-ssl \
+ --without-svgalib \
+ --without-x \
+ --without-directfb \
+ --without-pmshell \
+ --without-atheos
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LINKS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_LINKS}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/links/ipkg/links.control b/package/links/ipkg/links.control
new file mode 100644
index 000000000..28742a5ab
--- /dev/null
+++ b/package/links/ipkg/links.control
@@ -0,0 +1,4 @@
+Package: links
+Priority: optional
+Section: net
+Description: web browser with console graphic support
diff --git a/package/linux-atm/Config.in b/package/linux-atm/Config.in
new file mode 100644
index 000000000..b06a3093c
--- /dev/null
+++ b/package/linux-atm/Config.in
@@ -0,0 +1,20 @@
+config ADK_PACKAGE_LINUX_ATM
+ prompt "linux-atm......................... ATM Library/Utilities for Linux"
+ tristate
+ default n
+ help
+ ATM Library for linux
+
+ http://ftp.debian.org/debian/pool/main/l/linux-atm/
+
+config ADK_PACKAGE_BR2684CTL
+ prompt "br2684ctl....................... RFC2684 bridging utility"
+ tristate
+ default n
+ depends ADK_PACKAGE_LINUX_ATM
+ help
+ Utility for setting up ATM RFC2684 bridging mode
+ Useful for PPPoE
+
+ http://ftp.debian.org/debian/pool/main/l/linux-atm/
+
diff --git a/package/linux-atm/Makefile b/package/linux-atm/Makefile
new file mode 100644
index 000000000..32b6665e0
--- /dev/null
+++ b/package/linux-atm/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= linux-atm
+PKG_VERSION:= 2.4.1
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 84fef49cc39ff2605204246666f65864
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz
+MASTER_SITES:= http://ftp.debian.org/debian/pool/main/l/linux-atm/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LINUX_ATM,linux-atm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,BR2684CTL,br2684ctl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LINUX_ATM}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libatm.so.1 ${IDIR_LINUX_ATM}/usr/lib
+ ${INSTALL_DIR} ${IDIR_BR2684CTL}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/br2684ctl ${IDIR_BR2684CTL}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_BR2684CTL}/etc/hotplug.d/net
+ ${INSTALL_DATA} ./files/br2684.hotplug \
+ ${IDIR_BR2684CTL}/etc/hotplug.d/net/30-br2684
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/linux-atm/files/br2684.hotplug b/package/linux-atm/files/br2684.hotplug
new file mode 100644
index 000000000..242e7e515
--- /dev/null
+++ b/package/linux-atm/files/br2684.hotplug
@@ -0,0 +1,19 @@
+[ "${INTERFACE%%[0-9]*}" = "atm" ] && {
+ case "$ACTION" in
+ register)
+ [ "$pppoe_atm" = 1 ] && {
+ case "$atm_encaps" in
+ 0|vc) ENCAPS=0 ;;
+ 1|llc) ENCAPS=1 ;;
+ *) ENCAPS=0 ;;
+ esac
+ insmod br2684 2>&- >&-
+ br2684ctl -c0 -e${ENCAPS} -a${atm_vpi:-8}.${atm_vci:-35} &
+ }
+ ;;
+ unregister)
+ killall br2684ctl 2>&- >&-
+ rmmod br2684
+ ;;
+ esac
+}
diff --git a/package/linux-atm/ipkg/br2684ctl.control b/package/linux-atm/ipkg/br2684ctl.control
new file mode 100644
index 000000000..444dc07ab
--- /dev/null
+++ b/package/linux-atm/ipkg/br2684ctl.control
@@ -0,0 +1,4 @@
+Package: br2684ctl
+Priority: optional
+Section: net
+Description: Utility for configuring the ATM RFC2684 bridging
diff --git a/package/linux-atm/ipkg/linux-atm.control b/package/linux-atm/ipkg/linux-atm.control
new file mode 100644
index 000000000..616471a2b
--- /dev/null
+++ b/package/linux-atm/ipkg/linux-atm.control
@@ -0,0 +1,4 @@
+Package: linux-atm
+Priority: optional
+Section: net
+Description: ATM library for linux
diff --git a/package/linux-atm/patches/000-debian_16.patch b/package/linux-atm/patches/000-debian_16.patch
new file mode 100644
index 000000000..41dc437ca
--- /dev/null
+++ b/package/linux-atm/patches/000-debian_16.patch
@@ -0,0 +1,35073 @@
+--- linux-atm-2.4.1.orig/Makefile.in
++++ linux-atm-2.4.1/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -100,14 +100,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -225,7 +225,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -274,6 +274,11 @@
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/aclocal.m4
++++ linux-atm-2.4.1/aclocal.m4
+@@ -1,4 +1,4 @@
+-dnl aclocal.m4 generated automatically by aclocal 1.4-p5
++dnl aclocal.m4 generated automatically by aclocal 1.4-p6
+
+ dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+@@ -43,7 +43,8 @@
+ dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+ AC_DEFUN([AM_INIT_AUTOMAKE],
+-[AC_REQUIRE([AC_PROG_INSTALL])
++[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
++AC_REQUIRE([AC_PROG_INSTALL])
+ PACKAGE=[$1]
+ AC_SUBST(PACKAGE)
+ VERSION=[$2]
+@@ -59,13 +60,42 @@
+ AC_REQUIRE([AC_ARG_PROGRAM])
+ dnl FIXME This is truly gross.
+ missing_dir=`cd $ac_aux_dir && pwd`
+-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
++AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)
+ AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
++AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)
+ AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+ AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+ AC_REQUIRE([AC_PROG_MAKE_SET])])
+
++# Copyright 2002 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++
++# 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.
++AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])
++
++# AM_SET_CURRENT_AUTOMAKE_VERSION
++# -------------------------------
++# Call AM_AUTOMAKE_VERSION so it can be traced.
++# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
++AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
++ [AM_AUTOMAKE_VERSION([1.4-p6])])
++
+ #
+ # Check to make sure that the build environment is sane.
+ #
+@@ -130,13 +160,14 @@
+ dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
+ AC_DEFUN([AM_PROG_LEX],
+ [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
+-AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
++AC_CHECK_PROGS(LEX, flex lex, $missing_dir/missing flex)
+ AC_PROG_LEX
+ AC_DECL_YYTEXT])
+
+ # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+
+ # serial 46 AC_PROG_LIBTOOL
++
+ AC_DEFUN([AC_PROG_LIBTOOL],
+ [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+@@ -162,6 +193,8 @@
+ AC_REQUIRE([AC_PROG_LD])dnl
+ AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+ AC_REQUIRE([AC_PROG_NM])dnl
++AC_REQUIRE([LT_AC_PROG_SED])dnl
++
+ AC_REQUIRE([AC_PROG_LN_S])dnl
+ AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+ AC_REQUIRE([AC_OBJEXT])dnl
+@@ -262,9 +295,30 @@
+
+ ])
+
++# AC_LIBTOOL_HEADER_ASSERT
++# ------------------------
++AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
++[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
++ [lt_cv_func_assert_works],
++ [case $host in
++ *-*-solaris*)
++ if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
++ case `$CC --version 2>/dev/null` in
++ [[12]].*) lt_cv_func_assert_works=no ;;
++ *) lt_cv_func_assert_works=yes ;;
++ esac
++ fi
++ ;;
++ esac])
++
++if test "x$lt_cv_func_assert_works" = xyes; then
++ AC_CHECK_HEADERS(assert.h)
++fi
++])# AC_LIBTOOL_HEADER_ASSERT
++
+ # _LT_AC_CHECK_DLFCN
+ # --------------------
+-AC_DEFUN(_LT_AC_CHECK_DLFCN,
++AC_DEFUN([_LT_AC_CHECK_DLFCN],
+ [AC_CHECK_HEADERS(dlfcn.h)
+ ])# _LT_AC_CHECK_DLFCN
+
+@@ -282,10 +336,10 @@
+ # [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+ # Character class describing NM global symbol codes.
+-[symcode='[BCDEGRST]']
++symcode='[[BCDEGRST]]'
+
+ # Regexp to match symbols that can be accessed directly from C.
+-[sympat='\([_A-Za-z][_A-Za-z0-9]*\)']
++sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+ # Transform the above into a raw symbol and a C symbol.
+ symxfrm='\1 \2\3 \3'
+@@ -293,25 +347,32 @@
+ # Transform an extracted symbol line into a proper C declaration
+ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
+ # Define system-specific variables.
+ case $host_os in
+ aix*)
+- [symcode='[BCDT]']
++ symcode='[[BCDT]]'
+ ;;
+ cygwin* | mingw* | pw32*)
+- [symcode='[ABCDGISTW]']
++ symcode='[[ABCDGISTW]]'
+ ;;
+ hpux*) # Its linker distinguishes data from code symbols
+ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++ ;;
++irix* | nonstopux*)
++ symcode='[[BCDEGRST]]'
+ ;;
+-irix*)
+- [symcode='[BCDEGRST]']
++osf*)
++ symcode='[[BCDEGQRST]]'
+ ;;
+ solaris* | sysv5*)
+- [symcode='[BDT]']
++ symcode='[[BDT]]'
+ ;;
+ sysv4)
+- [symcode='[DFNSTU]']
++ symcode='[[DFNSTU]]'
+ ;;
+ esac
+
+@@ -325,14 +386,14 @@
+
+ # If we're using GNU nm, then use its standard symbol codes.
+ if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+- [symcode='[ABCDGISTW]']
++ symcode='[[ABCDGISTW]]'
+ fi
+
+ # Try without a prefix undercore, then with it.
+ for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+-[lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"]
++lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -374,23 +435,23 @@
+
+ cat <<EOF >> conftest.$ac_ext
+ #if defined (__STDC__) && __STDC__
+-# define lt_ptr_t void *
++# define lt_ptr void *
+ #else
+-# define lt_ptr_t char *
++# define lt_ptr char *
+ # define const
+ #endif
+
+ /* The mapping between symbol names and symbols. */
+ const struct {
+ const char *name;
+- lt_ptr_t address;
++ lt_ptr address;
+ }
+-[lt_preloaded_symbols[] =]
++lt_preloaded_symbols[[]] =
+ {
+ EOF
+- sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
++ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+- {0, (lt_ptr_t) 0}
++ {0, (lt_ptr) 0}
+ };
+
+ #ifdef __cplusplus
+@@ -403,7 +464,7 @@
+ save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+- if AC_TRY_EVAL(ac_link) && test -s conftest; then
++ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS="$save_LIBS"
+@@ -434,10 +495,13 @@
+ global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
+ if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ global_symbol_to_cdecl=
++ global_symbol_to_c_name_address=
+ else
+ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
++ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
+ fi
+-if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then
++if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
++then
+ AC_MSG_RESULT(failed)
+ else
+ AC_MSG_RESULT(ok)
+@@ -455,16 +519,17 @@
+ *-DOS) lt_cv_sys_path_separator=';' ;;
+ *) lt_cv_sys_path_separator=':' ;;
+ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
+ fi
+ ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+
+ # _LT_AC_PROG_ECHO_BACKSLASH
+ # --------------------------
+ # Add some code to the start of the generated configure script which
+-# will find an echo command which doesn;t interpret backslashes.
++# will find an echo command which doesn't interpret backslashes.
+ AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+ [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+- [AC_DIVERT_PUSH(NOTICE)])
++ [AC_DIVERT_PUSH(NOTICE)])
+ _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+
+ # Check that we are running under the correct shell.
+@@ -530,7 +595,7 @@
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+@@ -619,7 +684,7 @@
+ # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+ # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+ # ------------------------------------------------------------------
+-AC_DEFUN(_LT_AC_TRY_DLOPEN_SELF,
++AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+ [if test "$cross_compiling" = yes; then :
+ [$4]
+ else
+@@ -706,7 +771,7 @@
+
+ # AC_LIBTOOL_DLOPEN_SELF
+ # -------------------
+-AC_DEFUN(AC_LIBTOOL_DLOPEN_SELF,
++AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+ [if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+@@ -728,16 +793,22 @@
+ ;;
+
+ *)
+- AC_CHECK_LIB(dl, dlopen, [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+- [AC_CHECK_FUNC(dlopen, lt_cv_dlopen="dlopen",
+- [AC_CHECK_FUNC(shl_load, lt_cv_dlopen="shl_load",
+- [AC_CHECK_LIB(svld, dlopen,
+- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+- [AC_CHECK_LIB(dld, shl_load,
+- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
++ 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="-dld"],
++ [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="-dld"])
++ ])
+ ])
+- ])
+- ])
++ ])
++ ])
+ ])
+ ;;
+ esac
+@@ -800,10 +871,10 @@
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+ Xsed='sed -e s/^X//'
+-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
++sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
+
+ # Same as above, but do not quote variable references.
+-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
++double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
+
+ # Sed substitution to delay expansion of an escaped shell variable in a
+ # double_quote_subst'ed string.
+@@ -872,8 +943,15 @@
+ old_postuninstall_cmds=
+
+ if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ fi
+
+ # Allow CC to be a program name with arguments.
+@@ -893,7 +971,7 @@
+ AC_MSG_RESULT($objdir)
+
+
+-AC_ARG_WITH(pic,
++AC_ARG_WITH(pic,
+ [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
+ pic_mode="$withval", pic_mode=default)
+ test -z "$pic_mode" && pic_mode=default
+@@ -921,7 +999,7 @@
+ # libC (AIX C++ library), which obviously doesn't included in libraries
+ # list by gcc. This cause undefined symbols with -static flags.
+ # This hack allows C programs to be linked with "-static -ldl", but
+- # we not sure about C++ programs.
++ # not sure about C++ programs.
+ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+ ;;
+ amigaos*)
+@@ -930,7 +1008,7 @@
+ # like `-m68040'.
+ lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+- beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ darwin* | rhapsody*)
+@@ -956,13 +1034,13 @@
+ # PORTME Check for PIC flags for the system compiler.
+ case $host_os in
+ aix3* | aix4* | aix5*)
++ lt_cv_prog_cc_wl='-Wl,'
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+- # AIX 5 now supports IA64 processor
+- lt_cv_prog_cc_static='-Bstatic'
+- lt_cv_prog_cc_wl='-Wl,'
++ # AIX 5 now supports IA64 processor
++ lt_cv_prog_cc_static='-Bstatic'
+ else
+- lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+@@ -973,7 +1051,7 @@
+ lt_cv_prog_cc_pic='+Z'
+ ;;
+
+- irix5* | irix6*)
++ irix5* | irix6* | nonstopux*)
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-non_shared'
+ # PIC (with -KPIC) is the default.
+@@ -1017,11 +1095,7 @@
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+- if test "x$host_vendor" = xsni; then
+- lt_cv_prog_cc_wl='-LD'
+- else
+- lt_cv_prog_cc_wl='-Wl,'
+- fi
++ lt_cv_prog_cc_wl='-Wl,'
+ ;;
+
+ uts4*)
+@@ -1087,7 +1161,7 @@
+ # Check for any special shared library compilation flags.
+ if test -n "$lt_cv_prog_cc_shlib"; then
+ AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
+- if echo "$old_CC $old_CFLAGS " | [egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]"] >/dev/null; then :
++ if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
+ else
+ AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
+ lt_cv_prog_cc_can_build_shared=no
+@@ -1163,6 +1237,8 @@
+ lt_cv_compiler_o_lo=no
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -c -o conftest.lo"
++ save_objext="$ac_objext"
++ ac_objext=lo
+ AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+@@ -1172,6 +1248,7 @@
+ lt_cv_compiler_o_lo=yes
+ fi
+ ])
++ ac_objext="$save_objext"
+ CFLAGS="$save_CFLAGS"
+ ])
+ compiler_o_lo=$lt_cv_compiler_o_lo
+@@ -1268,7 +1345,7 @@
+ extract_expsyms_cmds=
+
+ case $host_os in
+-cygwin* | mingw* | pw32* )
++cygwin* | mingw* | pw32*)
+ # 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++.
+@@ -1276,7 +1353,9 @@
+ with_gnu_ld=no
+ fi
+ ;;
+-
++openbsd*)
++ with_gnu_ld=no
++ ;;
+ esac
+
+ ld_shlibs=yes
+@@ -1363,7 +1442,7 @@
+ # can override, but on older systems we have to supply one (in ltdll.c)
+ if test "x$lt_cv_need_dllmain" = "xyes"; then
+ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
+- ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~
++ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
+ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
+ else
+ ltdll_obj=
+@@ -1376,24 +1455,25 @@
+ # Be careful not to strip the DATA tag left be newer dlltools.
+ export_symbols_cmds="$ltdll_cmds"'
+ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
+- [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols'
++ sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is.
+ # If DATA tags from a recent dlltool are present, honour them!
+- archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+- cp $export_symbols $output_objdir/$soname-def;
++ 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;
+- _lt_hint=1;
+- cat $export_symbols | while read symbol; do
+- set dummy \$symbol;
+- case \[$]# in
+- 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+- *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
+- esac;
+- _lt_hint=`expr 1 + \$_lt_hint`;
+- done;
++ echo EXPORTS > $output_objdir/$soname-def;
++ _lt_hint=1;
++ cat $export_symbols | while read symbol; do
++ set dummy \$symbol;
++ case \[$]# in
++ 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
++ 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
++ *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
++ esac;
++ _lt_hint=`expr 1 + \$_lt_hint`;
++ done;
+ fi~
+ '"$ltdll_cmds"'
+ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+@@ -1488,80 +1568,98 @@
+ ;;
+
+ aix4* | aix5*)
++ 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]].*|aix5*)
++ 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.
+
++ hardcode_direct=yes
+ archive_cmds=''
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+- collect2name=`${CC} -print-prog-name=collect2`
+- if test -f "$collect2name" && \
+- strings "$collect2name" | grep resolve_lib_name >/dev/null
+- then
+- # We have reworked collect2
+- hardcode_direct=yes
+- else
+- # We have old collect2
+- hardcode_direct=unsupported
+- # It fails to find uninstalled libraries when the uninstalled
+- # path is not listed in the libpath. Setting hardcode_minus_L
+- # to unsupported forces relinking
+- hardcode_minus_L=yes
+- hardcode_libdir_flag_spec='-L$libdir'
+- hardcode_libdir_separator=
+- fi
++ case $host_os in aix4.[[012]]|aix4.[[012]].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ # It fails to find uninstalled libraries when the uninstalled
++ # path is not listed in the libpath. Setting hardcode_minus_L
++ # to unsupported forces relinking
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++
+ shared_flag='-shared'
+ else
++ # not using gcc
+ if test "$host_cpu" = ia64; then
+- shared_flag='-G'
++ shared_flag='${wl}-G'
+ else
+- shared_flag='${wl}-bM:SRE'
++ if test "$aix_use_runtimelinking" = yes; then
++ shared_flag='${wl}-G'
++ else
++ shared_flag='${wl}-bM:SRE'
++ fi
+ fi
+- hardcode_direct=yes
+ fi
+
+- 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
+- # 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 run time linking.
+- aix_use_runtimelinking=no
+- for ld_flag in $LDFLAGS; do
+- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
+- aix_use_runtimelinking=yes
+- break
+- fi
+- done
+- exp_sym_flag='-bexport'
+- no_entry_flag='-bnoentry'
+- fi
+ # It seems that -bexpall can do strange things, 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'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+- allow_undefined_flag=' -Wl,-G'
+- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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="-znodefs"
+- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ 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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+- hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+- # Warning - without using the other run time loading flags, -berok will
+- # link without error, but may produce a broken library.
+- allow_undefined_flag='${wl}-berok'
+- # This is a bit strange, but is similar to how AIX traditionally builds
+- # it's shared libraries.
+- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
++ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Warning - without using the other run time loading flags,
++ # -berok will link without error, but may produce a broken library.
++ allow_undefined_flag='${wl}-berok'
++ # This is a bit strange, but is similar to how AIX traditionally builds
++ # it's shared libraries.
++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+@@ -1593,11 +1691,19 @@
+ ;;
+
+ darwin* | rhapsody*)
+- allow_undefined_flag='-undefined suppress'
++ case "$host_os" in
++ rhapsody* | darwin1.[[012]])
++ allow_undefined_flag='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ allow_undefined_flag='-flat_namespace -undefined suppress'
++ ;;
++ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+- # yet detect zsh echo's removal of \ escapes.
+- archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
++ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
++ # `"' quotes if we put them in here... so don't!
++ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+ # We need to add '_' to the symbols in $export_symbols first
+ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+ hardcode_direct=yes
+@@ -1649,13 +1755,14 @@
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+- irix5* | irix6*)
++ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+@@ -1672,7 +1779,7 @@
+ ;;
+
+ newsos6)
+- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
++ 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=:
+@@ -1680,10 +1787,24 @@
+ ;;
+
+ openbsd*)
+- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+- hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
++ 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'
++ 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
+ ;;
+
+ os2*)
+@@ -1728,10 +1849,39 @@
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
++ export_dynamic_flag_spec='${wl}-Bexport'
+ ;;
+
+ solaris*)
++ # gcc --version < 3.0 without binutils cannot create self contained
++ # shared libraries reliably, requiring libgcc.a to resolve some of
++ # the object symbols generated in some cases. Libraries that use
++ # assert need libgcc.a to resolve __eprintf, for example. Linking
++ # a copy of libgcc.a into every shared library to guarantee resolving
++ # such symbols causes other problems: According to Tim Van Holder
++ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
++ # (to the application) exception stack for one thing.
+ no_undefined_flag=' -z defs'
++ if test "$GCC" = yes; then
++ case `$CC --version 2>/dev/null` in
++ [[12]].*)
++ cat <<EOF 1>&2
++
++*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
++*** create self contained shared libraries on Solaris systems, without
++*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
++*** -no-undefined support, which will at least allow you to build shared
++*** libraries. However, you may find that when you link such libraries
++*** into an application without using GCC, you have to manually add
++*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
++*** upgrade to a newer version of GCC. Another option is to rebuild your
++*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
++
++EOF
++ no_undefined_flag=
++ ;;
++ esac
++ fi
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+@@ -1740,7 +1890,7 @@
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+- [solaris2.[0-5] | solaris2.[0-5].*]) ;;
++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ esac
+@@ -1762,13 +1912,23 @@
+ ;;
+
+ sysv4)
+- if test "x$host_vendor" = xsno; then
+- archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts'
+- hardcode_direct=yes # is this really true???
+- else
+- 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
+- fi
++ 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
+ ;;
+@@ -1909,6 +2069,9 @@
+
+ aix4* | aix5*)
+ 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}.so$major ${libname}${release}.so$versuffix $libname.so'
+@@ -1920,22 +2083,24 @@
+ # 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
+- ;;
++ 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.
++ # 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.
++ # 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}.so$versuffix ${libname}${release}.so$major $libname.so'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+@@ -1944,14 +2109,14 @@
+ soname_spec='${libname}${release}.so$major'
+ fi
+ shlibpath_var=LIBPATH
+- deplibs_check_method=pass_all
+ fi
++ hardcode_into_libs=yes
+ ;;
+
+ amigaos*)
+ 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=`$echo "X$lib" | [$Xsed -e '\''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'
++ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''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'
+ ;;
+
+ beos*)
+@@ -1982,7 +2147,7 @@
+ case $GCC,$host_os in
+ yes,cygwin*)
+ library_names_spec='$libname.dll.a'
+- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
+ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+@@ -1992,14 +2157,14 @@
+ $rm \$dlpath'
+ ;;
+ yes,mingw*)
+- library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
+- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
+ ;;
+ yes,pw32*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+ ;;
+ *)
+- library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll $libname.lib'
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+@@ -2025,6 +2190,18 @@
+ dynamic_linker=no
+ ;;
+
++freebsd*-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU/FreeBSD ld.so'
++ ;;
++
+ freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+@@ -2076,14 +2253,17 @@
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+-irix5* | irix6*)
+- version_type=irix
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ nonstopux*) version_type=nonstopux ;;
++ *) version_type=irix ;;
++ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
+ case $host_os in
+- irix5*)
++ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+@@ -2157,9 +2337,19 @@
+
+ openbsd*)
+ version_type=sunos
+- if test "$with_gnu_ld" = yes; then
+- need_lib_prefix=no
+- need_version=no
++ need_lib_prefix=no
++ need_version=no
++ 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
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+@@ -2177,11 +2367,13 @@
+ osf3* | osf4* | osf5*)
+ version_type=osf
+ need_version=no
+- soname_spec='${libname}${release}.so'
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
++ need_lib_prefix=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ 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"
++ hardcode_into_libs=yes
+ ;;
+
+ sco3.2v5*)
+@@ -2224,6 +2416,12 @@
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
++ need_lib_prefix=no
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ runpath_var=LD_RUN_PATH
++ ;;
++ siemens)
++ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+@@ -2270,6 +2468,33 @@
+ 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
++ ;;
++
++aix4*)
++ 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])
++
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+@@ -2351,7 +2576,7 @@
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+- for var in echo old_CC old_CFLAGS \
++ for var in echo old_CC old_CFLAGS SED \
+ AR AR_FLAGS CC LD LN_S NM SHELL \
+ reload_flag reload_cmds wl \
+ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
+@@ -2363,6 +2588,7 @@
+ old_striplib striplib file_magic_cmd export_symbols_cmds \
+ deplibs_check_method allow_undefined_flag no_undefined_flag \
+ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
++ global_symbol_to_c_name_address \
+ hardcode_libdir_flag_spec hardcode_libdir_separator \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
+@@ -2412,8 +2638,11 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++# A sed that does not truncate output.
++SED=$lt_SED
++
+ # Sed that helps us avoid accidentally triggering echo(1) options like -n.
+-Xsed="sed -e s/^X//"
++Xsed="${SED} -e s/^X//"
+
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
+ # if CDPATH is set.
+@@ -2429,12 +2658,12 @@
+ # Whether or not to build shared libraries.
+ build_libtool_libs=$enable_shared
+
+-# Whether or not to add -lc for building shared libraries.
+-build_libtool_need_lc=$need_lc
+-
+ # Whether or not to build static libraries.
+ build_old_libs=$enable_static
+
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$need_lc
++
+ # Whether or not to optimize for fast installation.
+ fast_install=$enable_fast_install
+
+@@ -2600,6 +2829,9 @@
+ # Transform the output of nm in a proper C declaration
+ global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
++
+ # This is the shared library runtime path variable.
+ runpath_var=$runpath_var
+
+@@ -2722,9 +2954,9 @@
+ # return TRUE;
+ # }
+ # /* ltdll.c ends here */
+- # This is a source program that is used to create import libraries
+- # on Windows for dlls which lack them. Don't remove nor modify the
+- # starting and closing comments
++ # This is a source program that is used to create import libraries
++ # on Windows for dlls which lack them. Don't remove nor modify the
++ # starting and closing comments
+ # /* impgen.c starts here */
+ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
+ #
+@@ -3079,6 +3311,7 @@
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
+ ac_prog=ld
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+@@ -3092,8 +3325,8 @@
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+- [[\\/]* | [A-Za-z]:[\\/]*)]
+- [re_direlt='/[^/][^/]*/\.\./']
++ [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
++ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+@@ -3117,7 +3350,7 @@
+ fi
+ AC_CACHE_VAL(lt_cv_path_LD,
+ [if test -z "$LD"; then
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+@@ -3170,7 +3403,7 @@
+ # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+ # -- PORTME fill in with the dynamic library characteristics
+ AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+-[AC_CACHE_CHECK([how to recognise dependant libraries],
++[AC_CACHE_CHECK([how to recognise dependent libraries],
+ lt_cv_deplibs_check_method,
+ [lt_cv_file_magic_cmd='$MAGIC_CMD'
+ lt_cv_file_magic_test_file=
+@@ -3181,7 +3414,7 @@
+ # `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
++# 'file_magic [[regex]]' -- check by looking for files in library path
+ # which responds to the $file_magic_cmd with a given egrep 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.
+@@ -3196,7 +3429,7 @@
+ ;;
+
+ bsdi4*)
+- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
++ 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
+ ;;
+@@ -3210,7 +3443,7 @@
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+- rhapsody* | darwin1.[012])
++ rhapsody* | darwin1.[[012]])
+ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+ ;;
+ *) # Darwin 1.3 on
+@@ -3225,7 +3458,7 @@
+ 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)/i[3-9]86 (compact )?demand paged shared library']
++ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/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.*`
+ ;;
+@@ -3240,14 +3473,14 @@
+ ;;
+
+ hpux10.20*|hpux11*)
+- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
++ 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_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+
+-irix5* | irix6*)
++irix5* | irix6* | nonstopux*)
+ case $host_os in
+- irix5*)
++ irix5* | nonstopux*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+@@ -3259,7 +3492,7 @@
+ *) libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+- [lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
++ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+@@ -3269,29 +3502,39 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* )
++ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | arm* | m68k)
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;]
++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+ esac
+ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+- [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
++ lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
+ else
+- [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
++ lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
+ fi
+ ;;
+
+ newos6*)
+- [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
++ 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
+ ;;
+
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
+ osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+@@ -3308,14 +3551,14 @@
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+
+-[sysv5uw[78]* | sysv4*uw2*)]
++sysv5uw[[78]]* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ 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_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)
+@@ -3323,13 +3566,16 @@
+ ;;
+ 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 )']
++ 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_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
++ ;;
+ esac
+ ;;
+ esac
+@@ -3341,13 +3587,14 @@
+
+ # AC_PROG_NM - find the path to a BSD-compatible name lister
+ AC_DEFUN([AC_PROG_NM],
+-[AC_MSG_CHECKING([for BSD-compatible nm])
++[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
++AC_MSG_CHECKING([for BSD-compatible nm])
+ AC_CACHE_VAL(lt_cv_path_NM,
+ [if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+@@ -3394,12 +3641,12 @@
+ ])
+
+ # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl convenience library and INCLTDL to the include flags for
++# the libltdl convenience library and LTDLINCL to the include flags for
+ # the libltdl header and adds --enable-ltdl-convenience to the
+-# configure arguments. Note that LIBLTDL and INCLTDL are not
++# configure arguments. Note that LIBLTDL and LTDLINCL are not
+ # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+ # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+-# with '${top_builddir}/' and INCLTDL will be prefixed with
++# with '${top_builddir}/' and LTDLINCL will be prefixed with
+ # '${top_srcdir}/' (note the single quotes!). If your package is not
+ # flat and you're not using automake, define top_builddir and
+ # top_srcdir appropriately in the Makefiles.
+@@ -3411,16 +3658,18 @@
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
+ ])
+
+ # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl installable library and INCLTDL to the include flags for
++# the libltdl installable library and LTDLINCL to the include flags for
+ # the libltdl header and adds --enable-ltdl-install to the configure
+-# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
++# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
+ # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+ # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+-# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
++# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
+ # with '${top_srcdir}/' (note the single quotes!). If your package is
+ # not flat and you're not using automake, define top_builddir and
+ # top_srcdir appropriately in the Makefiles.
+@@ -3438,12 +3687,14 @@
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+- INCLTDL=
++ LTDLINCL=
+ fi
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
+ ])
+
+ # old names
+@@ -3458,3 +3709,92 @@
+ # This is just to silence aclocal about the macro not being used
+ ifelse([AC_DISABLE_FAST_INSTALL])
+
++# 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. #
++# LT_AC_PROG_SED
++# --------------
++# Check for a fully-functional sed program, that truncates
++# as few characters as possible. Prefer GNU sed if found.
++AC_DEFUN([LT_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_executable_p="test -f"
++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
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ fi
++ done
++ done
++done
++
++ # Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++: ${TMPDIR=/tmp}
++{
++ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=$TMPDIR/sed$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
++ { (exit 1); exit 1; }
++}
++ _max=0
++ _count=0
++ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
++ # along with /bin/sed that truncates output.
++ for _sed in $_sed_list /usr/xpg4/bin/sed; do
++ test ! -f ${_sed} && break
++ cat /dev/null > "$tmp/sed.in"
++ _count=0
++ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
++ # Check for GNU sed and select it if it is found.
++ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
++ lt_cv_path_SED=${_sed}
++ break
++ fi
++ while true; do
++ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
++ mv "$tmp/sed.tmp" "$tmp/sed.in"
++ cp "$tmp/sed.in" "$tmp/sed.nl"
++ echo >>"$tmp/sed.nl"
++ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
++ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
++ # 40000 chars as input seems more than enough
++ test $_count -gt 10 && break
++ _count=`expr $_count + 1`
++ if test $_count -gt $_max; then
++ _max=$_count
++ lt_cv_path_SED=$_sed
++ fi
++ done
++ done
++ rm -rf "$tmp"
++])
++if test "X$SED" != "X"; then
++ lt_cv_path_SED=$SED
++else
++ SED=$lt_cv_path_SED
++fi
++AC_MSG_RESULT([$SED])
++])
++
+--- linux-atm-2.4.1.orig/config.guess
++++ linux-atm-2.4.1/config.guess
+@@ -1,9 +1,9 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+-# Free Software Foundation, Inc.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+-timestamp='2001-04-20'
++timestamp='2003-05-19'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -24,8 +24,9 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
+-# Written by Per Bothner <bothner@cygnus.com>.
+-# Please send patches to <config-patches@gnu.org>.
++# Originally written by Per Bothner <per@bothner.com>.
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
+ #
+ # This script attempts to guess a canonical system name similar to
+ # config.sub. If it succeeds, it prints the system name on stdout, and
+@@ -52,7 +53,7 @@
+ GNU config.guess ($timestamp)
+
+ Originally written by Per Bothner.
+-Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+@@ -87,33 +88,44 @@
+ exit 1
+ fi
+
++trap 'exit 1' 1 2 15
+
+-dummy=dummy-$$
+-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
++# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
++# compiler to aid in system detection is discouraged as it requires
++# temporary files to be created and, as you can see below, it is a
++# headache to deal with in a portable fashion.
+
+-# CC_FOR_BUILD -- compiler used by this script.
+ # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+ # use `HOST_CC' if defined, but it is deprecated.
+
++# Portable tmp directory creation inspired by the Autoconf team.
++
++set_cc_for_build='
++trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
++trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
++: ${TMPDIR=/tmp} ;
++ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
++dummy=$tmp/dummy ;
++tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+ case $CC_FOR_BUILD,$HOST_CC,$CC in
+- ,,) echo "int dummy(){}" > $dummy.c
+- for c in cc gcc c89 ; do
+- ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
+- if test $? = 0 ; then
+- CC_FOR_BUILD="$c"; break
+- fi
+- done
+- rm -f $dummy.c $dummy.o $dummy.rel
++ ,,) echo "int x;" > $dummy.c ;
++ for c in cc gcc c89 c99 ; do
++ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
++ CC_FOR_BUILD="$c"; break ;
++ fi ;
++ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+- CC_FOR_BUILD=no_compiler_found
++ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+-esac
++esac ;'
+
+ # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+-# (ghazi@noc.rutgers.edu 8/24/94.)
++# (ghazi@noc.rutgers.edu 1994-08-24)
+ if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+ fi
+@@ -127,29 +139,31 @@
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+- # Netbsd (nbsd) targets should (where applicable) match one or
++ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+- # Determine the machine/vendor (is the vendor relevant).
+- case "${UNAME_MACHINE}" in
+- amiga) machine=m68k-unknown ;;
+- arm32) machine=arm-unknown ;;
+- atari*) machine=m68k-atari ;;
+- sun3*) machine=m68k-sun ;;
+- mac68k) machine=m68k-apple ;;
+- macppc) machine=powerpc-apple ;;
+- hp3[0-9][05]) machine=m68k-hp ;;
+- ibmrt|romp-ibm) machine=romp-ibm ;;
+- *) machine=${UNAME_MACHINE}-unknown ;;
++ #
++ # Note: NetBSD doesn't particularly care about the vendor
++ # portion of the name. We always set it to "unknown".
++ sysctl="sysctl -n hw.machine_arch"
++ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
++ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
++ case "${UNAME_MACHINE_ARCH}" in
++ armeb) machine=armeb-unknown ;;
++ arm*) machine=arm-unknown ;;
++ sh3el) machine=shl-unknown ;;
++ sh3eb) machine=sh-unknown ;;
++ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+- case "${UNAME_MACHINE}" in
+- i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
++ case "${UNAME_MACHINE_ARCH}" in
++ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
++ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+@@ -165,69 +179,107 @@
+ ;;
+ esac
+ # The OS release
+- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ # Debian GNU/NetBSD machines have a different userland, and
++ # thus, need a distinct triplet. However, they do not need
++ # kernel version information, so it can be replaced with a
++ # suitable tag, in the style of linux-gnu.
++ case "${UNAME_VERSION}" in
++ Debian*)
++ release='-gnu'
++ ;;
++ *)
++ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ ;;
++ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
++ amiga:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ arc:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ hp300:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mac68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ macppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme68k:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvme88k:OpenBSD:*:*)
++ echo m88k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ mvmeppc:OpenBSD:*:*)
++ echo powerpc-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ pmax:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sgi:OpenBSD:*:*)
++ echo mipseb-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ sun3:OpenBSD:*:*)
++ echo m68k-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ wgrisc:OpenBSD:*:*)
++ echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
++ *:OpenBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
++ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
++ # According to Compaq, /usr/sbin/psrinfo has been available on
++ # OSF/1 and Tru64 systems produced since 1995. I hope that
++ # covers most systems running today. This code pipes the CPU
++ # types through head -n 1, so we only detect the type of CPU 0.
++ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
++ case "$ALPHA_CPU_TYPE" in
++ "EV4 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "EV4.5 (21064)")
++ UNAME_MACHINE="alpha" ;;
++ "LCA4 (21066/21068)")
++ UNAME_MACHINE="alpha" ;;
++ "EV5 (21164)")
++ UNAME_MACHINE="alphaev5" ;;
++ "EV5.6 (21164A)")
++ UNAME_MACHINE="alphaev56" ;;
++ "EV5.6 (21164PC)")
++ UNAME_MACHINE="alphapca56" ;;
++ "EV5.7 (21164PC)")
++ UNAME_MACHINE="alphapca57" ;;
++ "EV6 (21264)")
++ UNAME_MACHINE="alphaev6" ;;
++ "EV6.7 (21264A)")
++ UNAME_MACHINE="alphaev67" ;;
++ "EV6.8CB (21264C)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8AL (21264B)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.8CX (21264D)")
++ UNAME_MACHINE="alphaev68" ;;
++ "EV6.9A (21264/EV69A)")
++ UNAME_MACHINE="alphaev69" ;;
++ "EV7 (21364)")
++ UNAME_MACHINE="alphaev7" ;;
++ "EV7.9 (21364A)")
++ UNAME_MACHINE="alphaev79" ;;
++ esac
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+- cat <<EOF >$dummy.s
+- .data
+-\$Lformat:
+- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+-
+- .text
+- .globl main
+- .align 4
+- .ent main
+-main:
+- .frame \$30,16,\$26,0
+- ldgp \$29,0(\$27)
+- .prologue 1
+- .long 0x47e03d80 # implver \$0
+- lda \$2,-1
+- .long 0x47e20c21 # amask \$2,\$1
+- lda \$16,\$Lformat
+- mov \$0,\$17
+- not \$1,\$18
+- jsr \$26,printf
+- ldgp \$29,0(\$26)
+- mov 0,\$16
+- jsr \$26,exit
+- .end main
+-EOF
+- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- case `./$dummy` in
+- 0-0)
+- UNAME_MACHINE="alpha"
+- ;;
+- 1-0)
+- UNAME_MACHINE="alphaev5"
+- ;;
+- 1-1)
+- UNAME_MACHINE="alphaev56"
+- ;;
+- 1-101)
+- UNAME_MACHINE="alphapca56"
+- ;;
+- 2-303)
+- UNAME_MACHINE="alphaev6"
+- ;;
+- 2-307)
+- UNAME_MACHINE="alphaev67"
+- ;;
+- esac
+- fi
+- rm -f $dummy.s $dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+@@ -242,29 +294,11 @@
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+- amiga:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+- arc64:OpenBSD:*:*)
+- echo mips64el-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- arc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- hkmips:OpenBSD:*:*)
+- echo mips-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- pmax:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sgi:OpenBSD:*:*)
+- echo mips-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- wgrisc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
++ *:[Mm]orph[Oo][Ss]:*:*)
++ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+@@ -286,6 +320,10 @@
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
++ DRS?6000:UNIX_SV:4.2*:7*)
++ case `/usr/bin/uname -p` in
++ sparc) echo sparc-icl-nx7 && exit 0 ;;
++ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+@@ -314,7 +352,7 @@
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
++ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+@@ -328,9 +366,6 @@
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+- atari*:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+@@ -357,18 +392,6 @@
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+- sun3*:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mac68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvme68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvme88k:OpenBSD:*:*)
+- echo m88k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+@@ -385,6 +408,7 @@
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
++ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __cplusplus
+ #include <stdio.h> /* for printf() prototype */
+@@ -406,15 +430,20 @@
+ exit (-1);
+ }
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy \
+- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+- && rm -f $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c \
++ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
++ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
++ Motorola:*:4.3:PL8-*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
++ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
++ echo powerpc-harris-powermax
++ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+@@ -475,6 +504,7 @@
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
++ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+@@ -486,8 +516,7 @@
+ exit(0);
+ }
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+@@ -496,7 +525,7 @@
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
++ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+@@ -536,10 +565,8 @@
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+- case "${HPUX_REV}" in
+- 11.[0-9][0-9])
+- if [ -x /usr/bin/getconf ]; then
+- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
++ if [ -x /usr/bin/getconf ]; then
++ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+@@ -548,12 +575,13 @@
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
++ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+- fi ;;
+- esac
+- if [ "${HP_ARCH}" = "" ]; then
+- sed 's/^ //' << EOF >$dummy.c
++ fi
++ if [ "${HP_ARCH}" = "" ]; then
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+@@ -586,11 +614,21 @@
+ exit (0);
+ }
+ EOF
+- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+- rm -f $dummy.c $dummy
+- fi ;;
++ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
++ test -z "$HP_ARCH" && HP_ARCH=hppa
++ fi ;;
+ esac
++ if [ ${HP_ARCH} = "hppa2.0w" ]
++ then
++ # avoid double evaluation of $set_cc_for_build
++ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
++ then
++ HP_ARCH="hppa2.0w"
++ else
++ HP_ARCH="hppa64"
++ fi
++ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+@@ -598,6 +636,7 @@
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
++ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+@@ -623,8 +662,7 @@
+ exit (0);
+ }
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+@@ -633,7 +671,7 @@
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+- *9??*:MPE/iX:*:*)
++ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+@@ -652,9 +690,6 @@
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+- hppa*:OpenBSD:*:*)
+- echo hppa-unknown-openbsd
+- exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+@@ -673,41 +708,33 @@
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+- CRAY*X-MP:*:*:*)
+- echo xmp-cray-unicos
+- exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+- echo ymp-cray-unicos${UNAME_RELEASE}
++ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
++ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
++ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+- CRAY*T3D:*:*:*)
+- echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+- CRAY-2:*:*:*)
+- echo cray2-cray-unicos
+- exit 0 ;;
++ *:UNICOS/mp:*:*)
++ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+- hp300:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+@@ -717,11 +744,19 @@
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+- *:FreeBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+- exit 0 ;;
+- *:OpenBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
++ *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
++ # Determine whether the default compiler uses glibc.
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #include <features.h>
++ #if __GLIBC__ >= 2
++ LIBC=gnu
++ #else
++ LIBC=
++ #endif
++EOF
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
++ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+@@ -732,11 +767,17 @@
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
++ x86:Interix*:3*)
++ echo i586-pc-interix3
++ exit 0 ;;
++ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
++ echo i${UNAME_MACHINE}-pc-mks
++ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+- echo i386-pc-interix
++ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+@@ -756,104 +797,71 @@
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
++ cris:Linux:*:*)
++ echo cris-axis-linux-gnu
++ exit 0 ;;
+ ia64:Linux:*:*)
+- echo ${UNAME_MACHINE}-unknown-linux
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+- cat >$dummy.c <<EOF
+-#ifdef __cplusplus
+-#include <stdio.h> /* for printf() prototype */
+-int main (int argc, char *argv[]) {
+-#else
+-int main (argc, argv) int argc; char *argv[]; {
+-#endif
+-#ifdef __MIPSEB__
+- printf ("%s-unknown-linux-gnu\n", argv[1]);
+-#endif
+-#ifdef __MIPSEL__
+- printf ("%sel-unknown-linux-gnu\n", argv[1]);
+-#endif
+- return 0;
+-}
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips
++ #undef mipsel
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mipsel
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips
++ #else
++ CPU=
++ #endif
++ #endif
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+- ppc:Linux:*:*)
+- # Determine Lib Version
+- cat >$dummy.c <<EOF
+-#include <features.h>
+-#if defined(__GLIBC__)
+-extern char __libc_version[];
+-extern char __libc_release[];
+-#endif
+-main(argc, argv)
+- int argc;
+- char *argv[];
+-{
+-#if defined(__GLIBC__)
+- printf("%s %s\n", __libc_version, __libc_release);
+-#else
+- printf("unknown\n");
+-#endif
+- return 0;
+-}
++ mips64:Linux:*:*)
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #undef CPU
++ #undef mips64
++ #undef mips64el
++ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
++ CPU=mips64el
++ #else
++ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
++ CPU=mips64
++ #else
++ CPU=
++ #endif
++ #endif
+ EOF
+- LIBC=""
+- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- ./$dummy | grep 1\.99 > /dev/null
+- if test "$?" = 0 ; then LIBC="libc1" ; fi
+- fi
+- rm -f $dummy.c $dummy
+- echo powerpc-unknown-linux-gnu${LIBC}
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
++ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ ;;
++ ppc:Linux:*:*)
++ echo powerpc-unknown-linux-gnu
++ exit 0 ;;
++ ppc64:Linux:*:*)
++ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+- cat <<EOF >$dummy.s
+- .data
+- \$Lformat:
+- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+- .text
+- .globl main
+- .align 4
+- .ent main
+- main:
+- .frame \$30,16,\$26,0
+- ldgp \$29,0(\$27)
+- .prologue 1
+- .long 0x47e03d80 # implver \$0
+- lda \$2,-1
+- .long 0x47e20c21 # amask \$2,\$1
+- lda \$16,\$Lformat
+- mov \$0,\$17
+- not \$1,\$18
+- jsr \$26,printf
+- ldgp \$29,0(\$26)
+- mov 0,\$16
+- jsr \$26,exit
+- .end main
+-EOF
+- LIBC=""
+- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
+- if test "$?" = 0 ; then
+- case `./$dummy` in
+- 0-0) UNAME_MACHINE="alpha" ;;
+- 1-0) UNAME_MACHINE="alphaev5" ;;
+- 1-1) UNAME_MACHINE="alphaev56" ;;
+- 1-101) UNAME_MACHINE="alphapca56" ;;
+- 2-303) UNAME_MACHINE="alphaev6" ;;
+- 2-307) UNAME_MACHINE="alphaev67" ;;
+- esac
+- objdump --private-headers $dummy | \
+- grep ld.so.1 > /dev/null
+- if test "$?" = 0 ; then
+- LIBC="libc1"
+- fi
+- fi
+- rm -f $dummy.s $dummy
++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
++ EV5) UNAME_MACHINE=alphaev5 ;;
++ EV56) UNAME_MACHINE=alphaev56 ;;
++ PCA56) UNAME_MACHINE=alphapca56 ;;
++ PCA57) UNAME_MACHINE=alphapca56 ;;
++ EV6) UNAME_MACHINE=alphaev6 ;;
++ EV67) UNAME_MACHINE=alphaev67 ;;
++ EV68*) UNAME_MACHINE=alphaev68 ;;
++ esac
++ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+@@ -883,71 +891,59 @@
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+- ld_supported_emulations=`cd /; ld --help 2>&1 \
+- | sed -ne '/supported emulations:/!d
++ # Set LC_ALL=C to ensure ld outputs messages in English.
++ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
++ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+- s/.*supported emulations: *//
++ s/.*supported targets: *//
+ s/ .*//
+ p'`
+- case "$ld_supported_emulations" in
+- i*86linux)
+- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+- exit 0
+- ;;
+- elf_i*86)
++ case "$ld_supported_targets" in
++ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+- i*86coff)
++ a.out-i386-linux)
++ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
++ exit 0 ;;
++ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+- exit 0
+- ;;
+- esac
+- # Either a pre-BFD a.out linker (linux-gnuoldld)
+- # or one that does not give us useful --help.
+- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+- # If ld does not provide *any* "supported emulations:"
+- # that means it is gnuoldld.
+- test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+- case "${UNAME_MACHINE}" in
+- i*86)
+- VENDOR=pc;
+- ;;
+- *)
+- VENDOR=unknown;
+- ;;
++ exit 0 ;;
++ "")
++ # Either a pre-BFD a.out linker (linux-gnuoldld) or
++ # one that does not give us useful --help.
++ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
++ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+- cat >$dummy.c <<EOF
+-#include <features.h>
+-#ifdef __cplusplus
+-#include <stdio.h> /* for printf() prototype */
+- int main (int argc, char *argv[]) {
+-#else
+- int main (argc, argv) int argc; char *argv[]; {
+-#endif
+-#ifdef __ELF__
+-# ifdef __GLIBC__
+-# if __GLIBC__ >= 2
+- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+-# else
+- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+-# endif
+-# else
+- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+-# endif
+-#else
+- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+-#endif
+- return 0;
+-}
++ eval $set_cc_for_build
++ sed 's/^ //' << EOF >$dummy.c
++ #include <features.h>
++ #ifdef __ELF__
++ # ifdef __GLIBC__
++ # if __GLIBC__ >= 2
++ LIBC=gnu
++ # else
++ LIBC=gnulibc1
++ # endif
++ # else
++ LIBC=gnulibc1
++ # endif
++ #else
++ #ifdef __INTEL_COMPILER
++ LIBC=gnu
++ #else
++ LIBC=gnuaout
++ #endif
++ #endif
+ EOF
+- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+- rm -f $dummy.c $dummy
++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
++ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+-# are messed up and put the nodename in both sysname and nodename.
+ i*86:DYNIX/ptx:4*:*)
++ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
++ # earlier versions are messed up and put the nodename in both
++ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+@@ -958,6 +954,23 @@
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
++ i*86:OS/2:*:*)
++ # If we were able to find `uname', then EMX Unix compatibility
++ # is probably installed.
++ echo ${UNAME_MACHINE}-pc-os2-emx
++ exit 0 ;;
++ i*86:XTS-300:*:STOP)
++ echo ${UNAME_MACHINE}-unknown-stop
++ exit 0 ;;
++ i*86:atheos:*:*)
++ echo ${UNAME_MACHINE}-unknown-atheos
++ exit 0 ;;
++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
++ echo i386-unknown-lynxos${UNAME_RELEASE}
++ exit 0 ;;
++ i*86:*DOS:*:*)
++ echo ${UNAME_MACHINE}-pc-msdosdjgpp
++ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+@@ -966,36 +979,32 @@
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+- i*86:*:5:7*)
+- # Fixed at (any) Pentium or better
+- UNAME_MACHINE=i586
+- if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
+- echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
+- else
+- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+- fi
++ i*86:*:5:[78]*)
++ case `/bin/uname -X | grep "^Machine"` in
++ *486*) UNAME_MACHINE=i486 ;;
++ *Pentium) UNAME_MACHINE=i586 ;;
++ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
++ esac
++ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
++ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
++ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
++ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
++ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
++ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+- i*86:*DOS:*:*)
+- echo ${UNAME_MACHINE}-pc-msdosdjgpp
+- exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+@@ -1019,9 +1028,15 @@
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
++ mc68k:UNIX:SYSTEM5:3.51m)
++ echo m68k-convergent-sysv
++ exit 0 ;;
++ M680?0:D-NIX:5.3:*)
++ echo m68k-diab-dnix
++ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
++ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+@@ -1038,9 +1053,6 @@
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+- echo i386-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+@@ -1067,8 +1079,8 @@
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+- # says <Richard.M.Bartel@ccMail.Census.GOV>
++ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
++ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+@@ -1080,6 +1092,10 @@
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
++ *:VOS:*:*)
++ # From Paul.Green@stratus.com.
++ echo hppa1.1-stratus-vos
++ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+@@ -1108,6 +1124,9 @@
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
++ SX-6:SUPER-UX:*:*)
++ echo sx6-nec-superux${UNAME_RELEASE}
++ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+@@ -1115,18 +1134,24 @@
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+- echo `uname -p`-apple-darwin${UNAME_RELEASE}
++ case `uname -p` in
++ *86) UNAME_PROCESSOR=i686 ;;
++ powerpc) UNAME_PROCESSOR=powerpc ;;
++ esac
++ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+- if test "${UNAME_MACHINE}" = "x86pc"; then
++ UNAME_PROCESSOR=`uname -p`
++ if test "$UNAME_PROCESSOR" = "x86"; then
++ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+- echo `uname -p`-${UNAME_MACHINE}-nto-qnx
++ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+- NSR-[KW]:NONSTOP_KERNEL:*:*)
++ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+@@ -1149,11 +1174,6 @@
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+- i*86:OS/2:*:*)
+- # If we were able to find `uname', then EMX Unix compatibility
+- # is probably installed.
+- echo ${UNAME_MACHINE}-pc-os2-emx
+- exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+@@ -1177,6 +1197,7 @@
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+ #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
++eval $set_cc_for_build
+ cat >$dummy.c <<EOF
+ #ifdef _SEQUENT_
+ # include <sys/types.h>
+@@ -1291,8 +1312,7 @@
+ }
+ EOF
+
+-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
+-rm -f $dummy.c $dummy
++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+ # Apollos put the system type in the environment.
+
+--- linux-atm-2.4.1.orig/config.h.in
++++ linux-atm-2.4.1/config.h.in
+@@ -1,4 +1,4 @@
+-/* config.h.in. Generated automatically from configure.in by autoheader. */
++/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
+ #ifndef _ATM_CONFIG_H
+ #define _ATM_CONFIG_H
+
+--- linux-atm-2.4.1.orig/config.sub
++++ linux-atm-2.4.1/config.sub
+@@ -1,9 +1,9 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+-# Free Software Foundation, Inc.
++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
++# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+-timestamp='2001-04-20'
++timestamp='2003-05-09'
+
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+@@ -29,7 +29,8 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
+-# Please send patches to <config-patches@gnu.org>.
++# Please send patches to <config-patches@gnu.org>. Submit a context
++# diff and a properly formatted ChangeLog entry.
+ #
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+@@ -117,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
++ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -157,6 +158,14 @@
+ os=-vxworks
+ basic_machine=$1
+ ;;
++ -chorusos*)
++ os=-chorusos
++ basic_machine=$1
++ ;;
++ -chorusrdb)
++ os=-chorusrdb
++ basic_machine=$1
++ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+@@ -215,26 +224,48 @@
+ case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+- tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
+- | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
+- | pyramid | mn10200 | mn10300 | tron | a29k \
+- | 580 | i960 | h8300 \
+- | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
+- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
+- | hppa64 \
+- | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
+- | alphaev6[78] \
+- | we32k | ns16k | clipper | i370 | sh | sh[34] \
+- | powerpc | powerpcle \
+- | 1750a | dsp16xx | pdp10 | pdp11 \
+- | mips16 | mips64 | mipsel | mips64el \
+- | mips64orion | mips64orionel | mipstx39 | mipstx39el \
+- | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
+- | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
+- | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
+- | v850 | c4x \
+- | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
+- | pj | pjl | h8500)
++ 1750a | 580 \
++ | a29k \
++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++ | clipper \
++ | d10v | d30v | dlx | dsp16xx \
++ | fr30 | frv \
++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
++ | i370 | i860 | i960 | ia64 \
++ | ip2k \
++ | m32r | m68000 | m68k | m88k | mcore \
++ | mips | mipsbe | mipseb | mipsel | mipsle \
++ | mips16 \
++ | mips64 | mips64el \
++ | mips64vr | mips64vrel \
++ | mips64orion | mips64orionel \
++ | mips64vr4100 | mips64vr4100el \
++ | mips64vr4300 | mips64vr4300el \
++ | mips64vr5000 | mips64vr5000el \
++ | mipsisa32 | mipsisa32el \
++ | mipsisa32r2 | mipsisa32r2el \
++ | mipsisa64 | mipsisa64el \
++ | mipsisa64sb1 | mipsisa64sb1el \
++ | mipsisa64sr71k | mipsisa64sr71kel \
++ | mipstx39 | mipstx39el \
++ | mn10200 | mn10300 \
++ | msp430 \
++ | ns16k | ns32k \
++ | openrisc | or32 \
++ | pdp10 | pdp11 | pj | pjl \
++ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
++ | pyramid \
++ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
++ | sh64 | sh64le \
++ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
++ | strongarm \
++ | tahoe | thumb | tic80 | tron \
++ | v850 | v850e \
++ | we32k \
++ | x86 | xscale | xstormy16 | xtensa \
++ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+@@ -242,7 +273,7 @@
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+@@ -257,31 +288,60 @@
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+- # FIXME: clean up the formatting here.
+- vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
+- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
+- | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
+- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+- | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
+- | xmp-* | ymp-* \
+- | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
+- | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
+- | hppa2.0n-* | hppa64-* \
+- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
+- | alphaev6[78]-* \
+- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
+- | clipper-* | orion-* \
+- | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+- | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
+- | mips16-* | mips64-* | mipsel-* \
+- | mips64el-* | mips64orion-* | mips64orionel-* \
+- | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
+- | mipstx39-* | mipstx39el-* | mcore-* \
+- | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
+- | [cjt]90-* \
+- | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
+- | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
+- | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
++ 580-* \
++ | a29k-* \
++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
++ | avr-* \
++ | bs2000-* \
++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
++ | clipper-* | cydra-* \
++ | d10v-* | d30v-* | dlx-* \
++ | elxsi-* \
++ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
++ | h8300-* | h8500-* \
++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
++ | i*86-* | i860-* | i960-* | ia64-* \
++ | ip2k-* \
++ | m32r-* \
++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
++ | m88110-* | m88k-* | mcore-* \
++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
++ | mips16-* \
++ | mips64-* | mips64el-* \
++ | mips64vr-* | mips64vrel-* \
++ | mips64orion-* | mips64orionel-* \
++ | mips64vr4100-* | mips64vr4100el-* \
++ | mips64vr4300-* | mips64vr4300el-* \
++ | mips64vr5000-* | mips64vr5000el-* \
++ | mipsisa32-* | mipsisa32el-* \
++ | mipsisa32r2-* | mipsisa32r2el-* \
++ | mipsisa64-* | mipsisa64el-* \
++ | mipsisa64sb1-* | mipsisa64sb1el-* \
++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
++ | mipstx39-* | mipstx39el-* \
++ | msp430-* \
++ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
++ | orion-* \
++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
++ | pyramid-* \
++ | romp-* | rs6000-* \
++ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
++ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
++ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
++ | tahoe-* | thumb-* \
++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++ | tron-* \
++ | v850-* | v850e-* | vax-* \
++ | we32k-* \
++ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
++ | xtensa-* \
++ | ymp-* \
++ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+@@ -313,6 +373,9 @@
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
++ amd64)
++ basic_machine=x86_64-pc
++ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+@@ -344,6 +407,10 @@
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
++ c90)
++ basic_machine=c90-cray
++ os=-unicos
++ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+@@ -364,16 +431,8 @@
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+- cray | ymp)
+- basic_machine=ymp-cray
+- os=-unicos
+- ;;
+- cray2)
+- basic_machine=cray2-cray
+- os=-unicos
+- ;;
+- [cjt]90)
+- basic_machine=${basic_machine}-cray
++ cray | j90)
++ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+@@ -388,6 +447,14 @@
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
++ decsystem10* | dec10*)
++ basic_machine=pdp10-dec
++ os=-tops10
++ ;;
++ decsystem20* | dec20*)
++ basic_machine=pdp10-dec
++ os=-tops20
++ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+@@ -568,14 +635,6 @@
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+- mipsel*-linux*)
+- basic_machine=mipsel-unknown
+- os=-linux-gnu
+- ;;
+- mips*-linux*)
+- basic_machine=mips-unknown
+- os=-linux-gnu
+- ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+@@ -590,6 +649,10 @@
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
++ morphos)
++ basic_machine=powerpc-unknown
++ os=-morphos
++ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+@@ -662,6 +725,10 @@
+ np1)
+ basic_machine=np1-gould
+ ;;
++ nv1)
++ basic_machine=nv1-cray
++ os=-unicosmp
++ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+@@ -669,6 +736,10 @@
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
++ or32 | or32-*)
++ basic_machine=or32-unknown
++ os=-coff
++ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+@@ -691,19 +762,19 @@
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+- pc532 | pc532-*)
++ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+- pentium | p5 | k5 | k6 | nexgen)
++ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+- pentiumpro | p6 | 6x86 | athlon)
++ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2)
+ basic_machine=i686-pc
+ ;;
+- pentium-* | p5-* | k5-* | k6-* | nexgen-*)
++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+@@ -718,15 +789,25 @@
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+- ;;
++ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+- ;;
++ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
++ ppc64) basic_machine=powerpc64-unknown
++ ;;
++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
++ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
++ basic_machine=powerpc64le-unknown
++ ;;
++ ppc64le-* | powerpc64little-*)
++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+@@ -744,10 +825,22 @@
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
++ s390 | s390-*)
++ basic_machine=s390-ibm
++ ;;
++ s390x | s390x-*)
++ basic_machine=s390x-ibm
++ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
++ sb1)
++ basic_machine=mipsisa64sb1-unknown
++ ;;
++ sb1el)
++ basic_machine=mipsisa64sb1el-unknown
++ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+@@ -755,7 +848,7 @@
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+- sparclite-wrs)
++ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+@@ -822,19 +915,39 @@
+ os=-dynix
+ ;;
+ t3e)
+- basic_machine=t3e-cray
++ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
++ t90)
++ basic_machine=t90-cray
++ os=-unicos
++ ;;
++ tic4x | c4x*)
++ basic_machine=tic4x-unknown
++ os=-coff
++ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
++ tic55x | c55x*)
++ basic_machine=tic55x-unknown
++ os=-coff
++ ;;
++ tic6x | c6x*)
++ basic_machine=tic6x-unknown
++ os=-coff
++ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
++ toad1)
++ basic_machine=pdp10-xkl
++ os=-tops20
++ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+@@ -859,8 +972,8 @@
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+- basic_machine=f301-fujitsu
+- ;;
++ basic_machine=f301-fujitsu
++ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+@@ -881,13 +994,13 @@
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+- xmp)
+- basic_machine=xmp-cray
+- os=-unicos
+- ;;
+- xps | xps100)
++ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
++ ymp)
++ basic_machine=ymp-cray
++ os=-unicos
++ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+@@ -908,13 +1021,6 @@
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+- mips)
+- if [ x$os = x-linux-gnu ]; then
+- basic_machine=mips-unknown
+- else
+- basic_machine=mips-mips
+- fi
+- ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+@@ -934,13 +1040,16 @@
+ we32k)
+ basic_machine=we32k-att
+ ;;
+- sh3 | sh4)
++ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
++ sh64)
++ basic_machine=sh64-unknown
++ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+- cydra)
++ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+@@ -955,10 +1064,6 @@
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+- c4x*)
+- basic_machine=c4x-none
+- os=-coff
+- ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+@@ -1018,11 +1123,15 @@
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
++ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
++ | -powermax* | -dnix*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+@@ -1034,8 +1143,10 @@
+ ;;
+ esac
+ ;;
++ -nto-qnx*)
++ ;;
+ -nto*)
+- os=-nto-qnx
++ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+@@ -1074,14 +1185,20 @@
+ -acis*)
+ os=-aos
+ ;;
++ -atheos*)
++ os=-atheos
++ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
++ -nova*)
++ os=-rtmk-nova
++ ;;
+ -ns2 )
+- os=-nextstep2
++ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+@@ -1120,8 +1237,14 @@
+ -xenix)
+ os=-xenix
+ ;;
+- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+- os=-mint
++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
++ os=-mint
++ ;;
++ -aros*)
++ os=-aros
++ ;;
++ -kaos*)
++ os=-kaos
+ ;;
+ -none)
+ ;;
+@@ -1154,10 +1277,11 @@
+ arm*-semi)
+ os=-aout
+ ;;
++ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+- pdp11-*)
++ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+@@ -1184,6 +1308,9 @@
+ mips*-*)
+ os=-elf
+ ;;
++ or32-*)
++ os=-coff
++ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+@@ -1247,19 +1374,19 @@
+ *-next)
+ os=-nextstep3
+ ;;
+- *-gould)
++ *-gould)
+ os=-sysv
+ ;;
+- *-highlevel)
++ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+- *-sgi)
++ *-sgi)
+ os=-irix
+ ;;
+- *-siemens)
++ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+@@ -1331,7 +1458,7 @@
+ -ptx*)
+ vendor=sequent
+ ;;
+- -vxsim* | -vxworks*)
++ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+@@ -1346,6 +1473,9 @@
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
++ -vos*)
++ vendor=stratus
++ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+--- linux-atm-2.4.1.orig/configure
++++ linux-atm-2.4.1/configure
+@@ -1,24 +1,244 @@
+ #! /bin/sh
+-
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated automatically using autoconf version 2.13
+-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
++# Generated by GNU Autoconf 2.57.
+ #
++# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
++# 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 Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++
++# Support unset when possible.
++if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; 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
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# 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
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ 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
++
++ ;;
++ 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
++ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
++done
++;;
++ esac
++
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++ { (exit 1); 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 sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
++
++
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
++
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
++ else
++ as_ln_s='ln -s'
++ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# Sed expression to map a string onto a valid CPP name.
++as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
+
+-# Defaults:
+-ac_help=
+-ac_default_prefix=/usr/local
+-# Any additions from configure.in:
+-ac_help="$ac_help
+- --enable-shared[=PKGS] build shared libraries [default=yes]"
+-ac_help="$ac_help
+- --enable-static[=PKGS] build static libraries [default=yes]"
+-ac_help="$ac_help
+- --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
+-ac_help="$ac_help
+- --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+
+ # Find the correct PATH separator. Usually this is `:', but
+ # DJGPP uses `;' like DOS.
+@@ -28,6 +248,7 @@
+ *-DOS) lt_cv_sys_path_separator=';' ;;
+ *) lt_cv_sys_path_separator=':' ;;
+ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
+ fi
+
+
+@@ -94,7 +315,7 @@
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+@@ -177,34 +398,86 @@
+ fi
+
+
+-ac_help="$ac_help
+- --disable-libtool-lock avoid locking (might break parallel builds)"
+-ac_help="$ac_help
+- --with-pic try to use only PIC/non-PIC objects [default=use both]"
+-ac_help="$ac_help
+- --with-uni=VERSION UNI version to use (3.0,3.1,4.0) [default=dynamic]"
+-ac_help="$ac_help
+- --enable-allow_uni30 Allow UNI 3.0 backwards-compatible extensions (if using UNI 3.1)"
+-ac_help="$ac_help
+- --enable-q2963_1 Enable peak cell rate modification as specified in Q.2963.1 (if using UNI 4.0)"
+-ac_help="$ac_help
+- --enable-cisco Enable work around for point-to-multipoint signaling bug in Cisco LS100 or LS7010 switches"
+-ac_help="$ac_help
+- --enable-thomflex Some versions of the Thomson Thomflex 5000 won't do any signaling before they get a RESTART. Enable sending of a RESTART whenever SAAL comes up."
+-ac_help="$ac_help
+- --enable-mpoa_1_1 Enable proposed MPOA 1.1 features"
+-ac_help="$ac_help
+- --enable-mpr Enable memory debugging (if MPR is installed)"
++
++# 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`
++
++exec 6>&1
++
++#
++# Initializations.
++#
++ac_default_prefix=/usr/local
++ac_config_libobj_dir=.
++cross_compiling=no
++subdirs=
++MFLAGS=
++MAKEFLAGS=
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++# Maximum number of lines to put in a shell here document.
++# This variable seems obsolete. It should probably be removed, and
++# only ac_max_sed_lines should be used.
++: ${ac_max_here_lines=38}
++
++# Identity of this package.
++PACKAGE_NAME=
++PACKAGE_TARNAME=
++PACKAGE_VERSION=
++PACKAGE_STRING=
++PACKAGE_BUGREPORT=
++
++ac_unique_file="src/include/atm.h"
++# Factoring default headers for most tests.
++ac_includes_default="\
++#include <stdio.h>
++#if HAVE_SYS_TYPES_H
++# include <sys/types.h>
++#endif
++#if HAVE_SYS_STAT_H
++# include <sys/stat.h>
++#endif
++#if STDC_HEADERS
++# include <stdlib.h>
++# include <stddef.h>
++#else
++# if HAVE_STDLIB_H
++# include <stdlib.h>
++# endif
++#endif
++#if HAVE_STRING_H
++# if !STDC_HEADERS && HAVE_MEMORY_H
++# include <memory.h>
++# endif
++# include <string.h>
++#endif
++#if HAVE_STRINGS_H
++# include <strings.h>
++#endif
++#if HAVE_INTTYPES_H
++# include <inttypes.h>
++#else
++# if HAVE_STDINT_H
++# include <stdint.h>
++# endif
++#endif
++#if HAVE_UNISTD_H
++# include <unistd.h>
++#endif"
++
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE LIBVER_CURRENT LIBVER_REVISION LIBVER_AGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LEX LEXLIB LEX_OUTPUT_ROOT YACC LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP EGREP LIBTOOL LIBTOOL_DEPS PERL LIBOBJS LTLIBOBJS'
++ac_subst_files=''
+
+ # Initialize some variables set by options.
++ac_init_help=
++ac_init_version=false
+ # The variables have the same names as the options, with
+ # dashes changed to underlines.
+-build=NONE
+-cache_file=./config.cache
++cache_file=/dev/null
+ exec_prefix=NONE
+-host=NONE
+ no_create=
+-nonopt=NONE
+ no_recursion=
+ prefix=NONE
+ program_prefix=NONE
+@@ -213,10 +486,15 @@
+ silent=
+ site=
+ srcdir=
+-target=NONE
+ 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.
+ bindir='${exec_prefix}/bin'
+ sbindir='${exec_prefix}/sbin'
+ libexecdir='${exec_prefix}/libexec'
+@@ -230,17 +508,9 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
+-# Initialize some other variables.
+-subdirs=
+-MFLAGS= MAKEFLAGS=
+-SHELL=${CONFIG_SHELL-/bin/sh}
+-# Maximum number of lines to put in a shell here document.
+-ac_max_here_lines=12
+-
+ ac_prev=
+ for ac_option
+ do
+-
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+@@ -248,59 +518,59 @@
+ continue
+ fi
+
+- case "$ac_option" in
+- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+- *) ac_optarg= ;;
+- esac
++ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+- case "$ac_option" in
++ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+- bindir="$ac_optarg" ;;
++ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+- ac_prev=build ;;
++ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+- build="$ac_optarg" ;;
++ 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" ;;
++ cache_file=$ac_optarg ;;
++
++ --config-cache | -C)
++ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+- datadir="$ac_optarg" ;;
++ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
++ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+- fi
+- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+- eval "enable_${ac_feature}=no" ;;
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
++ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+- fi
+- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+- case "$ac_option" in
+- *=*) ;;
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+- eval "enable_${ac_feature}='$ac_optarg'" ;;
++ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+@@ -309,95 +579,47 @@
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+- exec_prefix="$ac_optarg" ;;
++ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+- -help | --help | --hel | --he)
+- # 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 << EOF
+-Usage: configure [options] [host]
+-Options: [defaults in brackets after descriptions]
+-Configuration:
+- --cache-file=FILE cache test results in FILE
+- --help print this message
+- --no-create do not create output files
+- --quiet, --silent do not print \`checking...' messages
+- --version print the version of autoconf that created configure
+-Directory and file names:
+- --prefix=PREFIX install architecture-independent files in PREFIX
+- [$ac_default_prefix]
+- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+- [same as prefix]
+- --bindir=DIR user executables in DIR [EPREFIX/bin]
+- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+- --datadir=DIR read-only architecture-independent data in DIR
+- [PREFIX/share]
+- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+- --sharedstatedir=DIR modifiable architecture-independent data in DIR
+- [PREFIX/com]
+- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+- --includedir=DIR C header files in DIR [PREFIX/include]
+- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+- --infodir=DIR info documentation in DIR [PREFIX/info]
+- --mandir=DIR man documentation in DIR [PREFIX/man]
+- --srcdir=DIR find the sources in DIR [configure dir or ..]
+- --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
+-EOF
+- cat << EOF
+-Host type:
+- --build=BUILD configure for building on BUILD [BUILD=HOST]
+- --host=HOST configure for HOST [guessed]
+- --target=TARGET configure for TARGET [TARGET=HOST]
+-Features and packages:
+- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+- --x-includes=DIR X include files are in DIR
+- --x-libraries=DIR X library files are in DIR
+-EOF
+- if test -n "$ac_help"; then
+- echo "--enable and --with options recognized:$ac_help"
+- fi
+- exit 0 ;;
++ -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 ;;
++ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+- host="$ac_optarg" ;;
++ host_alias=$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" ;;
++ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+- infodir="$ac_optarg" ;;
++ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+- libdir="$ac_optarg" ;;
++ 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" ;;
++ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+@@ -406,19 +628,19 @@
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+- localstatedir="$ac_optarg" ;;
++ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+- mandir="$ac_optarg" ;;
++ 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)
++ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+@@ -432,26 +654,26 @@
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+- oldincludedir="$ac_optarg" ;;
++ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+- prefix="$ac_optarg" ;;
++ 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_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_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+@@ -468,7 +690,7 @@
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+- program_transform_name="$ac_optarg" ;;
++ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+@@ -478,7 +700,7 @@
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+- sbindir="$ac_optarg" ;;
++ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+@@ -489,58 +711,57 @@
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+- sharedstatedir="$ac_optarg" ;;
++ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+- site="$ac_optarg" ;;
++ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+- srcdir="$ac_optarg" ;;
++ 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" ;;
++ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+- ac_prev=target ;;
++ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+- target="$ac_optarg" ;;
++ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+- -version | --version | --versio | --versi | --vers)
+- echo "configure generated by autoconf version 2.13"
+- exit 0 ;;
++ -version | --version | --versio | --versi | --vers | -V)
++ ac_init_version=: ;;
+
+ -with-* | --with-*)
+- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
++ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+- fi
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+- case "$ac_option" in
+- *=*) ;;
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+- eval "with_${ac_package}='$ac_optarg'" ;;
++ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
++ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+- fi
+- ac_package=`echo $ac_package| sed 's/-/_/g'`
+- eval "with_${ac_package}=no" ;;
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
++ ac_package=`echo $ac_package | sed 's/-/_/g'`
++ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+@@ -551,99 +772,110 @@
+ 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_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" ;;
++ x_libraries=$ac_optarg ;;
+
+- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
++ -*) { echo "$as_me: error: unrecognized option: $ac_option
++Try \`$0 --help' for more information." >&2
++ { (exit 1); exit 1; }; }
+ ;;
+
++ *=*)
++ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
++ { (exit 1); exit 1; }; }
++ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
++ eval "$ac_envvar='$ac_optarg'"
++ export $ac_envvar ;;
++
+ *)
+- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+- echo "configure: warning: $ac_option: invalid host type" 1>&2
+- fi
+- if test "x$nonopt" != xNONE; then
+- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+- fi
+- nonopt="$ac_option"
++ # FIXME: should be removed in autoconf 3.0.
++ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
++ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
++ 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
+- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+-fi
+-
+-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+-
+-# File descriptor usage:
+-# 0 standard input
+-# 1 file creation
+-# 2 errors and warnings
+-# 3 some systems may open it to /dev/tty
+-# 4 used on the Kubota Titan
+-# 6 checking for... messages and results
+-# 5 compiler messages saved in config.log
+-if test "$silent" = yes; then
+- exec 6>/dev/null
+-else
+- exec 6>&1
++ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
++ { echo "$as_me: error: missing argument to $ac_option" >&2
++ { (exit 1); exit 1; }; }
+ fi
+-exec 5>./config.log
+
+-echo "\
+-This file contains any messages produced by compilers while
+-running configure, to aid debugging if configure makes a mistake.
+-" 1>&5
++# Be sure to have absolute paths.
++for ac_var in exec_prefix prefix
++do
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
++ esac
++done
+
+-# Strip out --no-create and --no-recursion so they do not pile up.
+-# Also quote any args containing shell metacharacters.
+-ac_configure_args=
+-for ac_arg
++# Be sure to have absolute paths.
++for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
++ localstatedir libdir includedir oldincludedir infodir mandir
+ do
+- case "$ac_arg" in
+- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+- | --no-cr | --no-c) ;;
+- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
+ esac
+ done
+
+-# NLS nuisances.
+-# Only set these to C if already set. These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
++# 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
++ 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
+
+-# confdefs.h avoids OS command line length limits that DEFS can exceed.
+-rm -rf conftest* confdefs.h
+-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+-echo > confdefs.h
++ac_tool_prefix=
++test -n "$host_alias" && ac_tool_prefix=$host_alias-
++
++test "$silent" = yes && exec 6>/dev/null
+
+-# A filename unique to this package, relative to the directory that
+-# configure is in, which we can look for to find out if srcdir is correct.
+-ac_unique_file=src/include/atm.h
+
+ # 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 its parent.
+- ac_prog=$0
+- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
++ ac_confdir=`(dirname "$0") 2>/dev/null ||
++$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$0" : 'X\(//\)[^/]' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$0" |
++ 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=..
+@@ -653,13 +885,453 @@
+ fi
+ if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
++ { (exit 1); exit 1; }; }
+ else
+- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
++ { (exit 1); exit 1; }; }
+ fi
+ fi
+-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
++(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
++ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
++ { (exit 1); exit 1; }; }
++srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
++ac_env_build_alias_set=${build_alias+set}
++ac_env_build_alias_value=$build_alias
++ac_cv_env_build_alias_set=${build_alias+set}
++ac_cv_env_build_alias_value=$build_alias
++ac_env_host_alias_set=${host_alias+set}
++ac_env_host_alias_value=$host_alias
++ac_cv_env_host_alias_set=${host_alias+set}
++ac_cv_env_host_alias_value=$host_alias
++ac_env_target_alias_set=${target_alias+set}
++ac_env_target_alias_value=$target_alias
++ac_cv_env_target_alias_set=${target_alias+set}
++ac_cv_env_target_alias_value=$target_alias
++ac_env_CC_set=${CC+set}
++ac_env_CC_value=$CC
++ac_cv_env_CC_set=${CC+set}
++ac_cv_env_CC_value=$CC
++ac_env_CFLAGS_set=${CFLAGS+set}
++ac_env_CFLAGS_value=$CFLAGS
++ac_cv_env_CFLAGS_set=${CFLAGS+set}
++ac_cv_env_CFLAGS_value=$CFLAGS
++ac_env_LDFLAGS_set=${LDFLAGS+set}
++ac_env_LDFLAGS_value=$LDFLAGS
++ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
++ac_cv_env_LDFLAGS_value=$LDFLAGS
++ac_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_env_CPPFLAGS_value=$CPPFLAGS
++ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_cv_env_CPPFLAGS_value=$CPPFLAGS
++ac_env_CPP_set=${CPP+set}
++ac_env_CPP_value=$CPP
++ac_cv_env_CPP_set=${CPP+set}
++ac_cv_env_CPP_value=$CPP
++
++#
++# 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 this package 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 \`..']
++
++_ACEOF
++
++ cat <<_ACEOF
++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]
++ --datadir=DIR read-only architecture-independent data [PREFIX/share]
++ --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]
++ --infodir=DIR info documentation [PREFIX/info]
++ --mandir=DIR man documentation [PREFIX/man]
++_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
++
++ cat <<\_ACEOF
++
++Optional Features:
++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
++ --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-allow_uni30 Allow UNI 3.0 backwards-compatible extensions (if using UNI 3.1)
++ --enable-q2963_1 Enable peak cell rate modification as specified in Q.2963.1 (if using UNI 4.0)
++ --enable-cisco Enable work around for point-to-multipoint signaling bug in Cisco LS100 or LS7010 switches
++ --enable-thomflex Some versions of the Thomson Thomflex 5000 won't do any signaling before they get a RESTART. Enable sending of a RESTART whenever SAAL comes up.
++ --enable-mpoa_1_1 Enable proposed MPOA 1.1 features
++ --enable-mpr Enable memory debugging (if MPR is installed)
++
++Optional Packages:
++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-gnu-ld assume the C compiler uses GNU ld default=no
++ --with-pic try to use only PIC/non-PIC objects default=use both
++ --with-uni=VERSION UNI version to use (3.0,3.1,4.0) default=dynamic
++
++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>
++ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
++ headers in a nonstandard directory <include dir>
++ CPP C preprocessor
++
++Use these variables to override the choices made by `configure' or to help
++it to find libraries and programs with nonstandard names/locations.
++
++_ACEOF
++fi
++
++if test "$ac_init_help" = "recursive"; then
++ # If there are subdirs, report their specific --help.
++ ac_popdir=`pwd`
++ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
++ test -d $ac_dir || continue
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
++# absolute.
++ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
++ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
++ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
++ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++ cd $ac_dir
++ # Check for guested configure; otherwise get Cygnus style 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
++ elif test -f $ac_srcdir/configure.ac ||
++ test -f $ac_srcdir/configure.in; then
++ echo
++ $ac_configure --help
++ else
++ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
++ fi
++ cd $ac_popdir
++ done
++fi
++
++test -n "$ac_init_help" && exit 0
++if $ac_init_version; then
++ cat <<\_ACEOF
++
++Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
++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 0
++fi
++exec 5>config.log
++cat >&5 <<_ACEOF
++This file contains any messages produced by compilers while
++running configure, to aid debugging if configure makes a mistake.
++
++It was created by $as_me, which was
++generated by GNU Autoconf 2.57. Invocation command line was
++
++ $ $0 $@
++
++_ACEOF
++{
++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`
++hostinfo = `(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=.
++ echo "PATH: $as_dir"
++done
++
++} >&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_sep=
++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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ esac
++ case $ac_pass in
++ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
++ 2)
++ ac_configure_args1="$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
++ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
++ # Get rid of the leading space.
++ ac_sep=" "
++ ;;
++ esac
++ done
++done
++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells,
++# such as our DU 5.0 friend, will then `close' the trap.
++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,
++{
++ (set) 2>&1 |
++ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
++ *ac_space=\ *)
++ sed -n \
++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++ ;;
++ *)
++ sed -n \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++}
++ echo
++
++ cat <<\_ASBOX
++## ----------------- ##
++## Output variables. ##
++## ----------------- ##
++_ASBOX
++ echo
++ for ac_var in $ac_subst_vars
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++
++ if test -n "$ac_subst_files"; then
++ cat <<\_ASBOX
++## ------------- ##
++## Output files. ##
++## ------------- ##
++_ASBOX
++ echo
++ for ac_var in $ac_subst_files
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++ fi
++
++ if test -s confdefs.h; then
++ cat <<\_ASBOX
++## ----------- ##
++## confdefs.h. ##
++## ----------- ##
++_ASBOX
++ echo
++ sed "/^$/d" confdefs.h | sort
++ echo
++ fi
++ test "$ac_signal" != 0 &&
++ echo "$as_me: caught signal $ac_signal"
++ echo "$as_me: exit $exit_status"
++ } >&5
++ rm -f core *.core &&
++ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
++ exit $exit_status
++ ' 0
++for ac_signal in 1 2 13 15; do
++ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
++done
++ac_signal=0
++
++# confdefs.h avoids OS command line length limits that DEFS can exceed.
++rm -rf conftest* confdefs.h
++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
++echo >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
++
++
++# Let the site file select an alternate cache file if it wants to.
+ # Prefer explicitly selected file to automatically selected ones.
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+@@ -670,45 +1342,111 @@
+ fi
+ for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+- echo "loading site script $ac_site_file"
++ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
++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
+- echo "loading cache $cache_file"
+- . $cache_file
++ # Some versions of bash will fail to source /dev/null (special
++ # files actually), so we avoid doing that.
++ if test -f "$cache_file"; then
++ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
++echo "$as_me: loading cache $cache_file" >&6;}
++ case $cache_file in
++ [\\/]* | ?:[\\/]* ) . $cache_file;;
++ *) . ./$cache_file;;
++ esac
++ fi
+ else
+- echo "creating cache $cache_file"
+- > $cache_file
++ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
++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 `(set) 2>&1 |
++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
++echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
++ ac_cache_corrupted=: ;;
++ ,set)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
++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
++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
++echo "$as_me: former value: $ac_old_val" >&2;}
++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
++echo "$as_me: current value: $ac_new_val" >&2;}
++ ac_cache_corrupted=:
++ fi;;
++ esac
++ # Pass precious variables to config.status.
++ if test "$ac_new_set" = set; then
++ case $ac_new_val in
++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
++ ac_arg=$ac_var=`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.
++ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
++ esac
++ fi
++done
++if $ac_cache_corrupted; then
++ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
++echo "$as_me: error: changes in the environment can compromise the build" >&2;}
++ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
++echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+
+ ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
+-
+-ac_exeext=
+-ac_objext=o
+-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+- ac_n= ac_c='
+-' ac_t=' '
+- else
+- ac_n=-n ac_c= ac_t=
+- fi
+-else
+- ac_n= ac_c='\c' ac_t=
+-fi
++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_config_commands="$ac_config_commands default-1"
++
++
+ ac_aux_dir=
+ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+@@ -719,105 +1457,105 @@
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
++ elif test -f $ac_dir/shtool; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/shtool install -c"
++ break
+ fi
+ done
+ if test -z "$ac_aux_dir"; then
+- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+-fi
+-ac_config_guess=$ac_aux_dir/config.guess
+-ac_config_sub=$ac_aux_dir/config.sub
+-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+-
+-
+-# Do some error checking and defaulting for the host and target type.
+-# The inputs are:
+-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+-#
+-# The rules are:
+-# 1. You are not allowed to specify --host, --target, and nonopt at the
+-# same time.
+-# 2. Host defaults to nonopt.
+-# 3. If nonopt is not specified, then host defaults to the current host,
+-# as determined by config.guess.
+-# 4. Target and build default to nonopt.
+-# 5. If nonopt is not specified, then target and build default to host.
+-
+-# The aliases save the names the user supplied, while $host etc.
+-# will get canonicalized.
+-case $host---$target---$nonopt in
+-NONE---*---* | *---NONE---* | *---*---NONE) ;;
+-*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+-esac
+-
++ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
++echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++ac_config_guess="$SHELL $ac_aux_dir/config.guess"
++ac_config_sub="$SHELL $ac_aux_dir/config.sub"
++ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+ # Make sure we can run config.sub.
+-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+-fi
++$ac_config_sub sun4 >/dev/null 2>&1 ||
++ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
++echo "$as_me: error: cannot run $ac_config_sub" >&2;}
++ { (exit 1); exit 1; }; }
++
++echo "$as_me:$LINENO: checking build system type" >&5
++echo $ECHO_N "checking build system type... $ECHO_C" >&6
++if test "${ac_cv_build+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_build_alias=$build_alias
++test -z "$ac_cv_build_alias" &&
++ ac_cv_build_alias=`$ac_config_guess`
++test -z "$ac_cv_build_alias" &&
++ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
++echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
++ { (exit 1); exit 1; }; }
++ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_build" >&5
++echo "${ECHO_T}$ac_cv_build" >&6
++build=$ac_cv_build
++build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++echo "$as_me:$LINENO: checking host system type" >&5
++echo $ECHO_N "checking host system type... $ECHO_C" >&6
++if test "${ac_cv_host+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_host_alias=$host_alias
++test -z "$ac_cv_host_alias" &&
++ ac_cv_host_alias=$ac_cv_build_alias
++ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_host" >&5
++echo "${ECHO_T}$ac_cv_host" >&6
++host=$ac_cv_host
++host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++echo "$as_me:$LINENO: checking target system type" >&5
++echo $ECHO_N "checking target system type... $ECHO_C" >&6
++if test "${ac_cv_target+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_target_alias=$target_alias
++test "x$ac_cv_target_alias" = "x" &&
++ ac_cv_target_alias=$ac_cv_host_alias
++ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_target" >&5
++echo "${ECHO_T}$ac_cv_target" >&6
++target=$ac_cv_target
++target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+-echo $ac_n "checking host system type""... $ac_c" 1>&6
+-echo "configure:760: checking host system type" >&5
+
+-host_alias=$host
+-case "$host_alias" in
+-NONE)
+- case $nonopt in
+- NONE)
+- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+- fi ;;
+- *) host_alias=$nonopt ;;
+- esac ;;
+-esac
+-
+-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+-echo "$ac_t""$host" 1>&6
+-
+-echo $ac_n "checking target system type""... $ac_c" 1>&6
+-echo "configure:781: checking target system type" >&5
+-
+-target_alias=$target
+-case "$target_alias" in
+-NONE)
+- case $nonopt in
+- NONE) target_alias=$host_alias ;;
+- *) target_alias=$nonopt ;;
+- esac ;;
+-esac
+-
+-target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+-target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+-target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+-target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+-echo "$ac_t""$target" 1>&6
+-
+-echo $ac_n "checking build system type""... $ac_c" 1>&6
+-echo "configure:799: checking build system type" >&5
+-
+-build_alias=$build
+-case "$build_alias" in
+-NONE)
+- case $nonopt in
+- NONE) build_alias=$host_alias ;;
+- *) build_alias=$nonopt ;;
+- esac ;;
+-esac
+-
+-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+-echo "$ac_t""$build" 1>&6
+-
+-test "$host_alias" != "$target_alias" &&
++# 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}-
+
+-
++am__api_version="1.4"
+ # 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:
+@@ -825,65 +1563,78 @@
+ # 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"
+ # ./install, which can be erroneously created by make from ./install.sh.
+-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:834: checking for a BSD compatible install" >&5
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+ if test -z "$INSTALL"; then
+-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+- for ac_dir in $PATH; do
+- # Account for people who put trailing slashes in PATH elements.
+- case "$ac_dir/" in
+- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+- *)
+- # OSF1 and SCO ODT 3.0 have their own names for install.
+- # Don't use installbsd from OSF since it installs stuff as root
+- # by default.
+- for ac_prog in ginstall scoinst install; do
+- if test -f $ac_dir/$ac_prog; then
+- if test $ac_prog = install &&
+- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+- # AIX install. It has an incompatible calling convention.
+- :
+- else
+- ac_cv_path_install="$ac_dir/$ac_prog -c"
+- break 2
+- fi
+- fi
++ 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/* | \
++ /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 $as_executable_p "$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
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
+ done
+- ;;
+- esac
+- done
+- IFS="$ac_save_IFS"
++ done
++ ;;
++esac
++done
++
+
+ fi
+ if test "${ac_cv_path_install+set}" = set; then
+- INSTALL="$ac_cv_path_install"
++ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+- INSTALL="$ac_install_sh"
++ INSTALL=$ac_install_sh
+ fi
+ fi
+-echo "$ac_t""$INSTALL" 1>&6
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$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_PROGRAM}'
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+-echo "configure:887: checking whether build environment is sane" >&5
++echo "$as_me:$LINENO: checking whether build environment is sane" >&5
++echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+ # Just in case
+ sleep 1
+ echo timestamp > conftestfile
+@@ -905,8 +1656,11 @@
+ # 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".
+- { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+-alias in your environment" 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&5
++echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftestfile
+@@ -915,54 +1669,54 @@
+ # Ok.
+ :
+ else
+- { echo "configure: error: newly created file is older than distributed files!
+-Check your system clock" 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
++Check your system clock" >&5
++echo "$as_me: error: newly created file is older than distributed files!
++Check your system clock" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+ rm -f conftest*
+-echo "$ac_t""yes" 1>&6
+-if test "$program_transform_name" = s,x,x,; then
+- program_transform_name=
+-else
+- # Double any \ or $. echo might interpret backslashes.
+- cat <<\EOF_SED > conftestsed
+-s,\\,\\\\,g; s,\$,$$,g
+-EOF_SED
+- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+- rm -f conftestsed
+-fi
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
+ test "$program_prefix" != NONE &&
+- program_transform_name="s,^,${program_prefix},; $program_transform_name"
++ 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"
+-
+-# sed with no file args requires a program.
+-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+-
+-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+-echo "configure:944: checking whether ${MAKE-make} sets \${MAKE}" >&5
+-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
++# Double any \ or $. echo might interpret backslashes.
++# By default was `s,x,x', remove it if useless.
++cat <<\_ACEOF >conftest.sed
++s/[\\$]/&&/g;s/;s,x,x,$//
++_ACEOF
++program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
++rm conftest.sed
++
++echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
++if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- cat > conftestmake <<\EOF
++ cat >conftest.make <<\_ACEOF
+ all:
+- @echo 'ac_maketemp="${MAKE}"'
+-EOF
++ @echo 'ac_maketemp="$(MAKE)"'
++_ACEOF
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
++eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+ if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+ else
+ eval ac_cv_prog_make_${ac_make}_set=no
+ fi
+-rm -f conftestmake
++rm -f conftest.make
+ fi
+ if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+ fi
+
+@@ -972,82 +1726,96 @@
+ VERSION=2.4.1
+
+ if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+- { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
++echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+-cat >> confdefs.h <<EOF
++
++cat >>confdefs.h <<_ACEOF
+ #define PACKAGE "$PACKAGE"
+-EOF
++_ACEOF
+
+-cat >> confdefs.h <<EOF
++
++cat >>confdefs.h <<_ACEOF
+ #define VERSION "$VERSION"
+-EOF
++_ACEOF
+
+
+
+ missing_dir=`cd $ac_aux_dir && pwd`
+-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+-echo "configure:990: checking for working aclocal" >&5
++echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5
++echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+- ACLOCAL=aclocal
+- echo "$ac_t""found" 1>&6
+-else
+- ACLOCAL="$missing_dir/missing aclocal"
+- echo "$ac_t""missing" 1>&6
++if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
++ ACLOCAL=aclocal-${am__api_version}
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
++else
++ ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
+ fi
+
+-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+-echo "configure:1003: checking for working autoconf" >&5
++echo "$as_me:$LINENO: checking for working autoconf" >&5
++echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+ if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+- echo "$ac_t""found" 1>&6
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
+ else
+ AUTOCONF="$missing_dir/missing autoconf"
+- echo "$ac_t""missing" 1>&6
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
+ fi
+
+-echo $ac_n "checking for working automake""... $ac_c" 1>&6
+-echo "configure:1016: checking for working automake" >&5
++echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5
++echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+-if (automake --version) < /dev/null > /dev/null 2>&1; then
+- AUTOMAKE=automake
+- echo "$ac_t""found" 1>&6
+-else
+- AUTOMAKE="$missing_dir/missing automake"
+- echo "$ac_t""missing" 1>&6
++if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
++ AUTOMAKE=automake-${am__api_version}
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
++else
++ AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
+ fi
+
+-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+-echo "configure:1029: checking for working autoheader" >&5
++echo "$as_me:$LINENO: checking for working autoheader" >&5
++echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+ if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+- echo "$ac_t""found" 1>&6
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
+ else
+ AUTOHEADER="$missing_dir/missing autoheader"
+- echo "$ac_t""missing" 1>&6
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
+ fi
+
+-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+-echo "configure:1042: checking for working makeinfo" >&5
++echo "$as_me:$LINENO: checking for working makeinfo" >&5
++echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ # Redirect stdin to placate older versions of autoconf. Sigh.
+ if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+- echo "$ac_t""found" 1>&6
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
+ else
+ MAKEINFO="$missing_dir/missing makeinfo"
+- echo "$ac_t""missing" 1>&6
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
+ fi
+
+
+@@ -1059,214 +1827,643 @@
+
+
+
+-# Extract the first word of "gcc", so it can be a program name with args.
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="${ac_tool_prefix}gcc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1066: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="gcc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ CC=$ac_ct_CC
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_CC="gcc"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="${ac_tool_prefix}cc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-CC="$ac_cv_prog_CC"
++CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- echo "$ac_t""$CC" 1>&6
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_CC"; then
++ ac_ct_CC=$CC
++ # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="cc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
++ CC=$ac_ct_CC
++else
++ CC="$ac_cv_prog_CC"
++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
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1096: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+- ac_prog_rejected=yes
+- continue
+- fi
+- ac_cv_prog_CC="cc"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$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"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+- if test $# -gt 0; then
++ 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
+- set dummy "$ac_dir/$ac_word" "$@"
+- shift
+- ac_cv_prog_CC="$@"
++ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+ fi
+ fi
+ fi
+-CC="$ac_cv_prog_CC"
++CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- echo "$ac_t""$CC" 1>&6
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+- if test -z "$CC"; then
+- case "`uname -s`" in
+- *win32* | *WIN32*)
+- # Extract the first word of "cl", so it can be a program name with args.
+-set dummy cl; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1147: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++fi
++if test -z "$CC"; then
++ if test -n "$ac_tool_prefix"; then
++ for ac_prog in cl
++ 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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_CC="cl"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-CC="$ac_cv_prog_CC"
++CC=$ac_cv_prog_CC
+ if test -n "$CC"; then
+- echo "$ac_t""$CC" 1>&6
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+- ;;
+- esac
++
++ test -n "$CC" && break
++ done
++fi
++if test -z "$CC"; then
++ ac_ct_CC=$CC
++ for ac_prog in cl
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
+ fi
+- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
++done
++done
++
+ fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$ac_ct_CC" && break
++done
+
+-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:1179: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++ CC=$ac_ct_CC
++fi
+
+-ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
++fi
+
+-cat > conftest.$ac_ext << EOF
+
+-#line 1190 "configure"
+-#include "confdefs.h"
++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&5
++echo "$as_me: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++
++# Provide some information about the compiler.
++echo "$as_me:$LINENO:" \
++ "checking for C compiler version" >&5
++ac_compiler=`set X $ac_compile; echo $2`
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
++ (eval $ac_compiler --version </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
++ (eval $ac_compiler -v </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
++ (eval $ac_compiler -V </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-main(){return(0);}
+-EOF
+-if { (eval echo configure:1195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- ac_cv_prog_cc_works=yes
+- # If we can't run a trivial program, we are probably using a cross compiler.
+- if (./conftest; exit) 2>/dev/null; then
+- ac_cv_prog_cc_cross=no
+- else
+- ac_cv_prog_cc_cross=yes
+- fi
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files a.out a.exe b.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.
++echo "$as_me:$LINENO: checking for C compiler default output" >&5
++echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
++ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
++if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
++ (eval $ac_link_default) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ # Find the output, starting from the most likely. This scheme is
++# not robust to junk in `.', hence go to wildcards (a.*) only as a last
++# resort.
++
++# Be careful to initialize this variable, since it used to be cached.
++# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
++ac_cv_exeext=
++# b.out is created by i960 compilers.
++for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
++do
++ test -f "$ac_file" || continue
++ case $ac_file in
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
++ ;;
++ conftest.$ac_ext )
++ # This is the source file.
++ ;;
++ [ab].out )
++ # We found the default executable, but exeext='' is most
++ # certainly right.
++ break;;
++ *.* )
++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ # FIXME: I believe we export ac_cv_exeext for Libtool,
++ # but it would be cool to find out if it's true. Does anybody
++ # maintain Libtool? --akim.
++ export ac_cv_exeext
++ break;;
++ * )
++ break;;
++ esac
++done
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- ac_cv_prog_cc_works=no
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
++See \`config.log' for more details." >&5
++echo "$as_me: error: C compiler cannot create executables
++See \`config.log' for more details." >&2;}
++ { (exit 77); exit 77; }; }
++fi
++
++ac_exeext=$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_file" >&5
++echo "${ECHO_T}$ac_file" >&6
++
++# Check the compiler produces executables we can run. If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether the C compiler works" >&5
++echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
++# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
++# If not cross compiling, check that we can run a simple program.
++if test "$cross_compiling" != yes; then
++ if { ac_try='./$ac_file'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ cross_compiling=no
++ else
++ if test "$cross_compiling" = maybe; then
++ cross_compiling=yes
++ else
++ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++ fi
+ fi
+-rm -fr conftest*
+-ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+-ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
+-
+-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+-if test $ac_cv_prog_cc_works = no; then
+- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+-fi
+-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:1221: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+-cross_compiling=$ac_cv_prog_cc_cross
+-
+-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:1226: checking whether we are using GNU C" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.c <<EOF
+-#ifdef __GNUC__
+- yes;
+-#endif
+-EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+- ac_cv_prog_gcc=yes
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++
++rm -f a.out a.exe conftest$ac_cv_exeext b.out
++ac_clean_files=$ac_clean_files_save
++# Check the compiler produces executables we can run. If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
++echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
++echo "$as_me:$LINENO: result: $cross_compiling" >&5
++echo "${ECHO_T}$cross_compiling" >&6
++
++echo "$as_me:$LINENO: checking for suffix of executables" >&5
++echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; 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 | *.o | *.obj ) ;;
++ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ export ac_cv_exeext
++ break;;
++ * ) break;;
++ esac
++done
+ else
+- ac_cv_prog_gcc=no
+-fi
++ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+
+-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
++rm -f conftest$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
++echo "${ECHO_T}$ac_cv_exeext" >&6
++
++rm -f conftest.$ac_ext
++EXEEXT=$ac_cv_exeext
++ac_exeext=$EXEEXT
++echo "$as_me:$LINENO: checking for suffix of object files" >&5
++echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
++if test "${ac_cv_objext+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
+
+-if test $ac_cv_prog_gcc = yes; then
+- GCC=yes
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.o conftest.obj
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
++ case $ac_file in
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
++ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
++ break;;
++ esac
++done
+ else
+- GCC=
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+
+-ac_test_CFLAGS="${CFLAGS+set}"
+-ac_save_CFLAGS="$CFLAGS"
+-CFLAGS=
+-echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:1254: checking whether ${CC-cc} accepts -g" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- echo 'void f(){}' > conftest.c
+-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
++rm -f conftest.$ac_cv_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
++echo "${ECHO_T}$ac_cv_objext" >&6
++OBJEXT=$ac_cv_objext
++ac_objext=$OBJEXT
++echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
++echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
++if test "${ac_cv_c_compiler_gnu+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++#ifndef __GNUC__
++ choke me
++#endif
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_compiler_gnu=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_compiler_gnu=no
++fi
++rm -f conftest.$ac_objext conftest.$ac_ext
++ac_cv_c_compiler_gnu=$ac_compiler_gnu
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
++GCC=`test $ac_compiler_gnu = yes && echo yes`
++ac_test_CFLAGS=${CFLAGS+set}
++ac_save_CFLAGS=$CFLAGS
++CFLAGS="-g"
++echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_g+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+ else
+- ac_cv_prog_cc_g=no
+-fi
+-rm -f conftest*
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
++ac_cv_prog_cc_g=no
+ fi
+-
+-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
++rm -f conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
++echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+ if test "$ac_test_CFLAGS" = set; then
+- CFLAGS="$ac_save_CFLAGS"
++ CFLAGS=$ac_save_CFLAGS
+ elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+@@ -1280,295 +2477,548 @@
+ CFLAGS=
+ fi
+ fi
++echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
++echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_stdc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_prog_cc_stdc=no
++ac_save_CC=$CC
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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;
++}
++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
++# Don't try gcc -ansi; that turns off useful extensions and
++# breaks some systems' header files.
++# AIX -qlanglvl=ansi
++# Ultrix and OSF/1 -std1
++# HP-UX 10.20 and later -Ae
++# HP-UX older versions -Aa -D_HPUX_SOURCE
++# SVR4 -Xc -D__EXTENSIONS__
++for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
++do
++ CC="$ac_save_CC $ac_arg"
++ rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_prog_cc_stdc=$ac_arg
++break
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.$ac_objext
++done
++rm -f conftest.$ac_ext conftest.$ac_objext
++CC=$ac_save_CC
+
+-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+-echo "configure:1286: checking how to run the C preprocessor" >&5
+-# On Suns, sometimes $CPP names a directory.
+-if test -n "$CPP" && test -d "$CPP"; then
+- CPP=
+ fi
+-if test -z "$CPP"; then
+-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- # This must be in double quotes, not single quotes, because CPP may get
+- # substituted into the Makefile and "${CC-cc}" will confuse make.
+- CPP="${CC-cc} -E"
+- # On the NeXT, cc -E runs the code through the compiler's parser,
+- # not just through cpp.
+- cat > conftest.$ac_ext <<EOF
+-#line 1301 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
+-else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP="${CC-cc} -E -traditional-cpp"
+- cat > conftest.$ac_ext <<EOF
+-#line 1318 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- :
+-else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP="${CC-cc} -nologo -E"
+- cat > conftest.$ac_ext <<EOF
+-#line 1335 "configure"
+-#include "confdefs.h"
+-#include <assert.h>
+-Syntax Error
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:1341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
++
++case "x$ac_cv_prog_cc_stdc" in
++ x|xno)
++ echo "$as_me:$LINENO: result: none needed" >&5
++echo "${ECHO_T}none needed" >&6 ;;
++ *)
++ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
++echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
++ CC="$CC $ac_cv_prog_cc_stdc" ;;
++esac
++
++# Some people use a C++ compiler to compile C. Since we use `exit',
++# in C++ we need to declare it. In case someone uses the same compiler
++# for both compiling C and C++ we need to have the C++ compiler decide
++# the declaration of exit, since it's the most demanding environment.
++cat >conftest.$ac_ext <<_ACEOF
++#ifndef __cplusplus
++ choke me
++#endif
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ for ac_declaration in \
++ '' \
++ 'extern "C" void std::exit (int) throw (); using std::exit;' \
++ 'extern "C" void std::exit (int); using std::exit;' \
++ 'extern "C" void exit (int) throw ();' \
++ 'extern "C" void exit (int);' \
++ 'void exit (int);'
++do
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_declaration
++#include <stdlib.h>
++int
++main ()
++{
++exit (42);
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ :
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- CPP=/lib/cpp
+-fi
+-rm -f conftest*
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++continue
+ fi
+-rm -f conftest*
++rm -f conftest.$ac_objext conftest.$ac_ext
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_declaration
++int
++main ()
++{
++exit (42);
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ break
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
+ fi
++rm -f conftest.$ac_objext conftest.$ac_ext
++done
+ rm -f conftest*
+- ac_cv_prog_CPP="$CPP"
++if test -n "$ac_declaration"; then
++ echo '#ifdef __cplusplus' >>confdefs.h
++ echo $ac_declaration >>confdefs.h
++ echo '#endif' >>confdefs.h
+ fi
+- CPP="$ac_cv_prog_CPP"
++
+ else
+- ac_cv_prog_CPP="$CPP"
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
+ fi
+-echo "$ac_t""$CPP" 1>&6
++rm -f 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
++
+
+ missing_dir=`cd $ac_aux_dir && pwd`
+ for ac_prog in flex lex
+ do
+-# Extract the first word of "$ac_prog", so it can be a program name with args.
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1371: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_LEX+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$LEX"; then
+ ac_cv_prog_LEX="$LEX" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_LEX="$ac_prog"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_LEX="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-LEX="$ac_cv_prog_LEX"
++LEX=$ac_cv_prog_LEX
+ if test -n "$LEX"; then
+- echo "$ac_t""$LEX" 1>&6
++ echo "$as_me:$LINENO: result: $LEX" >&5
++echo "${ECHO_T}$LEX" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+-test -n "$LEX" && break
++ test -n "$LEX" && break
+ done
+-test -n "$LEX" || LEX=""$missing_dir/missing flex""
++test -n "$LEX" || LEX="$missing_dir/missing flex"
+
+-# Extract the first word of "flex", so it can be a program name with args.
+-set dummy flex; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1404: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++for ac_prog in flex lex
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_LEX+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$LEX"; then
+ ac_cv_prog_LEX="$LEX" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_LEX="flex"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+- test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_LEX="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-LEX="$ac_cv_prog_LEX"
++LEX=$ac_cv_prog_LEX
+ if test -n "$LEX"; then
+- echo "$ac_t""$LEX" 1>&6
++ echo "$as_me:$LINENO: result: $LEX" >&5
++echo "${ECHO_T}$LEX" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
++ test -n "$LEX" && break
++done
++test -n "$LEX" || LEX=":"
++
+ if test -z "$LEXLIB"
+ then
+- case "$LEX" in
+- flex*) ac_lib=fl ;;
+- *) ac_lib=l ;;
+- esac
+- echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
+-echo "configure:1438: checking for yywrap in -l$ac_lib" >&5
+-ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- ac_save_LIBS="$LIBS"
+-LIBS="-l$ac_lib $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 1446 "configure"
+-#include "confdefs.h"
++ echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
++echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
++if test "${ac_cv_lib_fl_yywrap+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lfl $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char yywrap();
++ builtin and then its argument prototype would still apply. */
++char yywrap ();
++int
++main ()
++{
++yywrap ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_fl_yywrap=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_fl_yywrap=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
++echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
++if test $ac_cv_lib_fl_yywrap = yes; then
++ LEXLIB="-lfl"
++else
++ echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
++echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
++if test "${ac_cv_lib_l_yywrap+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ll $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-int main() {
+-yywrap()
+-; return 0; }
+-EOF
+-if { (eval echo configure:1457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char yywrap ();
++int
++main ()
++{
++yywrap ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_l_yywrap=yes
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
++ac_cv_lib_l_yywrap=no
+ fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- LEXLIB="-l$ac_lib"
+-else
+- echo "$ac_t""no" 1>&6
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
++echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
++if test $ac_cv_lib_l_yywrap = yes; then
++ LEXLIB="-ll"
++fi
++
+ fi
+
+ fi
+
+-echo $ac_n "checking lex output file root""... $ac_c" 1>&6
+-echo "configure:1480: checking lex output file root" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++if test "x$LEX" != "x:"; then
++ echo "$as_me:$LINENO: checking lex output file root" >&5
++echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
++if test "${ac_cv_prog_lex_root+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # The minimal lex program is just a single line: %%. But some broken lexes
+ # (Solaris, I think it was) want two %% lines, so accommodate them.
+-echo '%%
+-%%' | $LEX
++cat >conftest.l <<_ACEOF
++%%
++%%
++_ACEOF
++{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
++ (eval $LEX conftest.l) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
+ if test -f lex.yy.c; then
+ ac_cv_prog_lex_root=lex.yy
+ elif test -f lexyy.c; then
+ ac_cv_prog_lex_root=lexyy
+ else
+- { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
++echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
++ { (exit 1); exit 1; }; }
+ fi
+ fi
+-
+-echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
++echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
++echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
++rm -f conftest.l
+ LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+-echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
+-echo "configure:1501: checking whether yytext is a pointer" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
++echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
++if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # POSIX says lex can declare yytext either as a pointer or an array; the
+ # default is implementation-dependent. Figure out which it is, since
+ # not all implementations provide the %pointer and %array declarations.
+ ac_cv_prog_lex_yytext_pointer=no
+ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
+-ac_save_LIBS="$LIBS"
++ac_save_LIBS=$LIBS
+ LIBS="$LIBS $LEXLIB"
+-cat > conftest.$ac_ext <<EOF
+-#line 1513 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
+ `cat $LEX_OUTPUT_ROOT.c`
+-int main() {
+-
+-; return 0; }
+-EOF
+-if { (eval echo configure:1520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ ac_cv_prog_lex_yytext_pointer=yes
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
+ fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_save_LIBS
+ rm -f "${LEX_OUTPUT_ROOT}.c"
+
+ fi
+-
+-echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6
++echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
++echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
+ if test $ac_cv_prog_lex_yytext_pointer = yes; then
+- cat >> confdefs.h <<\EOF
++
++cat >>confdefs.h <<\_ACEOF
+ #define YYTEXT_POINTER 1
+-EOF
++_ACEOF
++
++fi
+
+ fi
+
+ for ac_prog in 'bison -y' byacc
+ do
+-# Extract the first word of "$ac_prog", so it can be a program name with args.
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1546: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_YACC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$YACC"; then
+ ac_cv_prog_YACC="$YACC" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_YACC="$ac_prog"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_YACC="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-YACC="$ac_cv_prog_YACC"
++YACC=$ac_cv_prog_YACC
+ if test -n "$YACC"; then
+- echo "$ac_t""$YACC" 1>&6
++ echo "$as_me:$LINENO: result: $YACC" >&5
++echo "${ECHO_T}$YACC" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+-test -n "$YACC" && break
++ test -n "$YACC" && break
+ done
+ test -n "$YACC" || YACC="yacc"
+
+@@ -1579,126 +3029,77 @@
+ # 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"
+ # ./install, which can be erroneously created by make from ./install.sh.
+-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:1588: checking for a BSD compatible install" >&5
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+ if test -z "$INSTALL"; then
+-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+- for ac_dir in $PATH; do
+- # Account for people who put trailing slashes in PATH elements.
+- case "$ac_dir/" in
+- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+- *)
+- # OSF1 and SCO ODT 3.0 have their own names for install.
+- # Don't use installbsd from OSF since it installs stuff as root
+- # by default.
+- for ac_prog in ginstall scoinst install; do
+- if test -f $ac_dir/$ac_prog; then
+- if test $ac_prog = install &&
+- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+- # AIX install. It has an incompatible calling convention.
+- :
+- else
+- ac_cv_path_install="$ac_dir/$ac_prog -c"
+- break 2
+- fi
+- fi
++ 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/* | \
++ /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 $as_executable_p "$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
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
+ done
+- ;;
+- esac
+- done
+- IFS="$ac_save_IFS"
++ done
++ ;;
++esac
++done
++
+
+ fi
+ if test "${ac_cv_path_install+set}" = set; then
+- INSTALL="$ac_cv_path_install"
++ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+- INSTALL="$ac_install_sh"
++ INSTALL=$ac_install_sh
+ fi
+ fi
+-echo "$ac_t""$INSTALL" 1>&6
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$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_PROGRAM}'
++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+-echo "configure:1642: checking for Cygwin environment" >&5
+-if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 1647 "configure"
+-#include "confdefs.h"
+-
+-int main() {
+-
+-#ifndef __CYGWIN__
+-#define __CYGWIN__ __CYGWIN32__
+-#endif
+-return __CYGWIN__;
+-; return 0; }
+-EOF
+-if { (eval echo configure:1658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- rm -rf conftest*
+- ac_cv_cygwin=yes
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- ac_cv_cygwin=no
+-fi
+-rm -f conftest*
+-rm -f conftest*
+-fi
+-
+-echo "$ac_t""$ac_cv_cygwin" 1>&6
+-CYGWIN=
+-test "$ac_cv_cygwin" = yes && CYGWIN=yes
+-echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+-echo "configure:1675: checking for mingw32 environment" >&5
+-if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 1680 "configure"
+-#include "confdefs.h"
+-
+-int main() {
+-return __MINGW32__;
+-; return 0; }
+-EOF
+-if { (eval echo configure:1687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- rm -rf conftest*
+- ac_cv_mingw32=yes
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- ac_cv_mingw32=no
+-fi
+-rm -f conftest*
+-rm -f conftest*
+-fi
+-
+-echo "$ac_t""$ac_cv_mingw32" 1>&6
+-MINGW32=
+-test "$ac_cv_mingw32" = yes && MINGW32=yes
+ # Check whether --enable-shared or --disable-shared was given.
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+@@ -1720,8 +3121,7 @@
+ esac
+ else
+ enable_shared=yes
+-fi
+-
++fi;
+ # Check whether --enable-static or --disable-static was given.
+ if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+@@ -1743,8 +3143,7 @@
+ esac
+ else
+ enable_static=yes
+-fi
+-
++fi;
+ # Check whether --enable-fast-install or --disable-fast-install was given.
+ if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+@@ -1766,21 +3165,31 @@
+ esac
+ else
+ enable_fast_install=yes
++fi;
++# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
+ fi
+
++
+ # Check whether --with-gnu-ld or --without-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
+-
++fi;
+ ac_prog=ld
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+- echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+-echo "configure:1784: checking for ld used by GCC" >&5
++ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
++echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+@@ -1809,17 +3218,17 @@
+ ;;
+ esac
+ elif test "$with_gnu_ld" = yes; then
+- echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+-echo "configure:1814: checking for GNU ld" >&5
++ echo "$as_me:$LINENO: checking for GNU ld" >&5
++echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+ else
+- echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+-echo "configure:1817: checking for non-GNU ld" >&5
++ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
++echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+ fi
+-if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++if test "${lt_cv_path_LD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -z "$LD"; then
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+@@ -1842,15 +3251,19 @@
+
+ LD="$lt_cv_path_LD"
+ if test -n "$LD"; then
+- echo "$ac_t""$LD" 1>&6
++ echo "$as_me:$LINENO: result: $LD" >&5
++echo "${ECHO_T}$LD" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+-test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+-echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+-echo "configure:1852: checking if the linker ($LD) is GNU ld" >&5
+-if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
++echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
++ { (exit 1); exit 1; }; }
++echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
++echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
++if test "${lt_cv_prog_gnu_ld+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+ if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+@@ -1859,33 +3272,33 @@
+ lt_cv_prog_gnu_ld=no
+ fi
+ fi
+-
+-echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
++echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
++echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+ with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+-echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
+-echo "configure:1869: checking for $LD option to reload object files" >&5
+-if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
++echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
++if test "${lt_cv_ld_reload_flag+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ lt_cv_ld_reload_flag='-r'
+ fi
+-
+-echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
++echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
++echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+ reload_flag=$lt_cv_ld_reload_flag
+ test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+-echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+-echo "configure:1881: checking for BSD-compatible nm" >&5
+-if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
++echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
++if test "${lt_cv_path_NM+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/${ac_tool_prefix}nm
+@@ -1912,33 +3325,109 @@
+ fi
+
+ NM="$lt_cv_path_NM"
+-echo "$ac_t""$NM" 1>&6
++echo "$as_me:$LINENO: result: $NM" >&5
++echo "${ECHO_T}$NM" >&6
++
++echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
++echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
++if test "${lt_cv_path_SED+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ # 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_executable_p="test -f"
++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
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ fi
++ done
++ done
++done
++
++ # Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++: ${TMPDIR=/tmp}
++{
++ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=$TMPDIR/sed$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
++ { (exit 1); exit 1; }
++}
++ _max=0
++ _count=0
++ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
++ # along with /bin/sed that truncates output.
++ for _sed in $_sed_list /usr/xpg4/bin/sed; do
++ test ! -f ${_sed} && break
++ cat /dev/null > "$tmp/sed.in"
++ _count=0
++ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
++ # Check for GNU sed and select it if it is found.
++ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
++ lt_cv_path_SED=${_sed}
++ break
++ fi
++ while true; do
++ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
++ mv "$tmp/sed.tmp" "$tmp/sed.in"
++ cp "$tmp/sed.in" "$tmp/sed.nl"
++ echo >>"$tmp/sed.nl"
++ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
++ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
++ # 40000 chars as input seems more than enough
++ test $_count -gt 10 && break
++ _count=`expr $_count + 1`
++ if test $_count -gt $_max; then
++ _max=$_count
++ lt_cv_path_SED=$_sed
++ fi
++ done
++ done
++ rm -rf "$tmp"
+
+-echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+-echo "configure:1919: checking whether ln -s works" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- rm -f conftestdata
+-if ln -s X conftestdata 2>/dev/null
+-then
+- rm -f conftestdata
+- ac_cv_prog_LN_S="ln -s"
+-else
+- ac_cv_prog_LN_S=ln
+ fi
++
++if test "X$SED" != "X"; then
++ lt_cv_path_SED=$SED
++else
++ SED=$lt_cv_path_SED
+ fi
+-LN_S="$ac_cv_prog_LN_S"
+-if test "$ac_cv_prog_LN_S" = "ln -s"; then
+- echo "$ac_t""yes" 1>&6
++echo "$as_me:$LINENO: result: $SED" >&5
++echo "${ECHO_T}$SED" >&6
++
++echo "$as_me:$LINENO: checking whether ln -s works" >&5
++echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
++LN_S=$as_ln_s
++if test "$LN_S" = "ln -s"; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
++echo "${ECHO_T}no, using $LN_S" >&6
+ fi
+
+-echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
+-echo "configure:1940: checking how to recognise dependant libraries" >&5
+-if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
++echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
++if test "${lt_cv_deplibs_check_method+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+ lt_cv_file_magic_test_file=
+@@ -1949,7 +3438,7 @@
+ # `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
++# 'file_magic [[regex]]' -- check by looking for files in library path
+ # which responds to the $file_magic_cmd with a given egrep 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.
+@@ -1978,7 +3467,7 @@
+ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ case "$host_os" in
+- rhapsody* | darwin1.012)
++ rhapsody* | darwin1.[012])
+ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+ ;;
+ *) # Darwin 1.3 on
+@@ -2013,9 +3502,9 @@
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+
+-irix5* | irix6*)
++irix5* | irix6* | nonstopux*)
+ case $host_os in
+- irix5*)
++ irix5* | nonstopux*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+@@ -2037,7 +3526,7 @@
+ # This must be Linux ELF.
+ linux-gnu*)
+ case $host_cpu in
+- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* )
++ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | arm* | m68k)
+ lt_cv_deplibs_check_method=pass_all ;;
+ *)
+ # glibc up to 2.1.1 does not perform some relocations on ARM
+@@ -2060,6 +3549,16 @@
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
+ osf3* | osf4* | osf5*)
+ # this will be overridden with pass_all, but let us keep it just in case
+ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+@@ -2098,89 +3597,32 @@
+ 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
++ ;;
+ esac
+ ;;
+ esac
+
+ fi
+-
+-echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
++echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
++echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+
+-echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+-echo "configure:2113: checking for object suffix" >&5
+-if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- rm -f conftest*
+-echo 'int i = 1;' > conftest.$ac_ext
+-if { (eval echo configure:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- for ac_file in conftest.*; do
+- case $ac_file in
+- *.c) ;;
+- *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+- esac
+- done
+-else
+- { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+-fi
+-rm -f conftest*
+-fi
+-
+-echo "$ac_t""$ac_cv_objext" 1>&6
+-OBJEXT=$ac_cv_objext
+-ac_objext=$ac_cv_objext
+-
+-
+-
+-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+-echo "configure:2139: checking for executable suffix" >&5
+-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+- ac_cv_exeext=.exe
+-else
+- rm -f conftest*
+- echo 'int main () { return 0; }' > conftest.$ac_ext
+- ac_cv_exeext=
+- if { (eval echo configure:2149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+- for file in conftest.*; do
+- case $file in
+- *.c | *.o | *.obj) ;;
+- *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+- esac
+- done
+- else
+- { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+- fi
+- rm -f conftest*
+- test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+-fi
+-fi
+
+-EXEEXT=""
+-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+-echo "$ac_t""${ac_cv_exeext}" 1>&6
+-ac_exeext=$EXEEXT
+
+-if test $host != $build; then
+- ac_tool_prefix=${host_alias}-
+-else
+- ac_tool_prefix=
+-fi
+
+
+
+
+ # Check for command to grab the raw symbol name followed by C symbol from nm.
+-echo $ac_n "checking command to parse $NM output""... $ac_c" 1>&6
+-echo "configure:2180: checking command to parse $NM output" >&5
+-if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking command to parse $NM output" >&5
++echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6
++if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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?!! ;)]
+
+@@ -2196,6 +3638,9 @@
+ # Transform an extracted symbol line into a proper C declaration
+ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
+ # Define system-specific variables.
+ case $host_os in
+ aix*)
+@@ -2206,10 +3651,14 @@
+ ;;
+ hpux*) # Its linker distinguishes data from code symbols
+ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+-irix*)
++irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
++osf*)
++ symcode='[BCDEGQRST]'
++ ;;
+ solaris* | sysv5*)
+ symcode='[BDT]'
+ ;;
+@@ -2252,10 +3701,18 @@
+ int main(){nm_test_var='a';nm_test_func();return(0);}
+ EOF
+
+- if { (eval echo configure:2256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+- if { (eval echo configure:2259: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5; } && test -s "$nlist"; then
++ if { (eval echo "$as_me:$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=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+@@ -2277,23 +3734,23 @@
+
+ cat <<EOF >> conftest.$ac_ext
+ #if defined (__STDC__) && __STDC__
+-# define lt_ptr_t void *
++# define lt_ptr void *
+ #else
+-# define lt_ptr_t char *
++# define lt_ptr char *
+ # define const
+ #endif
+
+ /* The mapping between symbol names and symbols. */
+ const struct {
+ const char *name;
+- lt_ptr_t address;
++ lt_ptr address;
+ }
+ lt_preloaded_symbols[] =
+ {
+ EOF
+- sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" >> conftest.$ac_ext
++ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+- {0, (lt_ptr_t) 0}
++ {0, (lt_ptr) 0}
+ };
+
+ #ifdef __cplusplus
+@@ -2306,7 +3763,11 @@
+ save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+- if { (eval echo configure:2310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS="$save_LIBS"
+@@ -2339,84 +3800,665 @@
+ global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
+ if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ global_symbol_to_cdecl=
++ global_symbol_to_c_name_address=
+ else
+ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
++ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
+ fi
+-if test -z "$global_symbol_pipe$global_symbol_to_cdecl"; then
+- echo "$ac_t""failed" 1>&6
++if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
++then
++ echo "$as_me:$LINENO: result: failed" >&5
++echo "${ECHO_T}failed" >&6
+ else
+- echo "$ac_t""ok" 1>&6
++ echo "$as_me:$LINENO: result: ok" >&5
++echo "${ECHO_T}ok" >&6
+ fi
+
+-for ac_hdr in dlfcn.h
++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
++echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
++echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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
++ echo $ECHO_N "(cached) $ECHO_C" >&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
+-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+-echo "configure:2356: checking for $ac_hdr" >&5
+-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ # 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 >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++ Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
+ else
+- cat > conftest.$ac_ext <<EOF
+-#line 2361 "configure"
+-#include "confdefs.h"
+-#include <$ac_hdr>
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:2366: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=yes"
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ :
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=no"
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # Broken: fails on valid input.
++continue
+ fi
+-rm -f conftest*
++rm -f conftest.err conftest.$ac_ext
++
++ # OK, works on sane cases. Now check whether non-existent headers
++ # can be detected and how.
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
+ fi
+-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_hdr 1
+-EOF
+-
++if test -z "$ac_cpp_err"; then
++ # Broken: success on invalid input.
++continue
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # 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
++echo "$as_me:$LINENO: result: $CPP" >&5
++echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++ Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ :
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
++ # Broken: fails on valid input.
++continue
++fi
++rm -f conftest.err conftest.$ac_ext
+
++ # OK, works on sane cases. Now check whether non-existent headers
++ # can be detected and how.
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ # Broken: success on invalid input.
++continue
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
+
++ # Passes both tests.
++ac_preproc_ok=:
++break
++fi
++rm -f conftest.err conftest.$ac_ext
+
+-# Only perform the check for file, if the check method requires it
+-case $deplibs_check_method in
+-file_magic*)
+- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+- echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+-echo "configure:2401: checking for ${ac_tool_prefix}file" >&5
+-if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++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
+- case $MAGIC_CMD in
+- /*)
+- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+- ;;
+- ?:/*)
+- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+- ;;
+- *)
+- ac_save_MAGIC_CMD="$MAGIC_CMD"
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="/usr/bin:$PATH"
+- for ac_dir in $ac_dummy; do
+- 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
++ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&5
++echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++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
++
++
++echo "$as_me:$LINENO: checking for egrep" >&5
++echo $ECHO_N "checking for egrep... $ECHO_C" >&6
++if test "${ac_cv_prog_egrep+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
++ then ac_cv_prog_egrep='grep -E'
++ else ac_cv_prog_egrep='egrep'
++ fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
++echo "${ECHO_T}$ac_cv_prog_egrep" >&6
++ EGREP=$ac_cv_prog_egrep
++
++
++echo "$as_me:$LINENO: checking for ANSI C header files" >&5
++echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
++if test "${ac_cv_header_stdc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <stdlib.h>
++#include <stdarg.h>
++#include <string.h>
++#include <float.h>
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_header_stdc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_header_stdc=no
++fi
++rm -f 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 >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <ctype.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))
++ exit(2);
++ exit (0);
++}
++_ACEOF
++rm -f conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ :
++else
++ echo "$as_me: program exited with status $ac_status" >&5
++echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++( exit $ac_status )
++ac_cv_header_stdc=no
++fi
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++fi
++fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
++echo "${ECHO_T}$ac_cv_header_stdc" >&6
++if test $ac_cv_header_stdc = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define STDC_HEADERS 1
++_ACEOF
++
++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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ eval "$as_ac_Header=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "$as_ac_Header=no"
++fi
++rm -f conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++
++done
++
++
++
++for ac_header in dlfcn.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++#include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <$ac_header>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc in
++ yes:no )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------ ##
++## Report this to bug-autoconf@gnu.org. ##
++## ------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++ no:yes )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------ ##
++## Report this to bug-autoconf@gnu.org. ##
++## ------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ eval "$as_ac_Header=$ac_header_preproc"
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++
++fi
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++
++done
++
++
++
++
++
++
++# Only perform the check for file, if the check method requires it
++case $deplibs_check_method in
++file_magic*)
++ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
++ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
++echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ case $MAGIC_CMD in
++ /*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++ ;;
++ ?:/*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="/usr/bin:$PATH"
++ for ac_dir in $ac_dummy; do
++ 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 \(.*\)\"`"
+@@ -2451,17 +4493,19 @@
+
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if test -n "$MAGIC_CMD"; then
+- echo "$ac_t""$MAGIC_CMD" 1>&6
++ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++echo "${ECHO_T}$MAGIC_CMD" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+ if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+- echo $ac_n "checking for file""... $ac_c" 1>&6
+-echo "configure:2463: checking for file" >&5
+-if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking for file" >&5
++echo $ECHO_N "checking for file... $ECHO_C" >&6
++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ case $MAGIC_CMD in
+ /*)
+@@ -2513,9 +4557,11 @@
+
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if test -n "$MAGIC_CMD"; then
+- echo "$ac_t""$MAGIC_CMD" 1>&6
++ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++echo "${ECHO_T}$MAGIC_CMD" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+ else
+@@ -2527,138 +4573,164 @@
+ ;;
+ esac
+
+-# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
++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
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:2534: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-RANLIB="$ac_cv_prog_RANLIB"
++RANLIB=$ac_cv_prog_RANLIB
+ if test -n "$RANLIB"; then
+- echo "$ac_t""$RANLIB" 1>&6
++ echo "$as_me:$LINENO: result: $RANLIB" >&5
++echo "${ECHO_T}$RANLIB" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+-
++fi
+ if test -z "$ac_cv_prog_RANLIB"; then
+-if test -n "$ac_tool_prefix"; 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
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:2566: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- if test -n "$RANLIB"; then
+- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
++ if test -n "$ac_ct_RANLIB"; then
++ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_RANLIB="ranlib"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_RANLIB="ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+ fi
+ fi
+-RANLIB="$ac_cv_prog_RANLIB"
+-if test -n "$RANLIB"; then
+- echo "$ac_t""$RANLIB" 1>&6
++ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
++if test -n "$ac_ct_RANLIB"; then
++ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
++echo "${ECHO_T}$ac_ct_RANLIB" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
++ RANLIB=$ac_ct_RANLIB
+ else
+- RANLIB=":"
+-fi
++ RANLIB="$ac_cv_prog_RANLIB"
+ fi
+
+-# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
++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
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:2601: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ fi
+ fi
+-STRIP="$ac_cv_prog_STRIP"
++STRIP=$ac_cv_prog_STRIP
+ if test -n "$STRIP"; then
+- echo "$ac_t""$STRIP" 1>&6
++ echo "$as_me:$LINENO: result: $STRIP" >&5
++echo "${ECHO_T}$STRIP" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+-
++fi
+ if test -z "$ac_cv_prog_STRIP"; then
+-if test -n "$ac_tool_prefix"; 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
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:2633: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- if test -n "$STRIP"; then
+- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
++ if test -n "$ac_ct_STRIP"; then
++ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+ else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_prog_STRIP="strip"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+- test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
++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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_STRIP="strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+ fi
+ fi
+-STRIP="$ac_cv_prog_STRIP"
+-if test -n "$STRIP"; then
+- echo "$ac_t""$STRIP" 1>&6
++ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
++if test -n "$ac_ct_STRIP"; then
++ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++echo "${ECHO_T}$ac_ct_STRIP" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
++ STRIP=$ac_ct_STRIP
+ else
+- STRIP=":"
+-fi
++ STRIP="$ac_cv_prog_STRIP"
+ fi
+
+
+@@ -2668,9 +4740,8 @@
+ # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+- :
+-fi
+
++fi;
+ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+ # Some flags need to be propagated to the compiler or linker for good
+@@ -2678,8 +4749,12 @@
+ case $host in
+ *-*-irix6*)
+ # Find out which ABI we are using.
+- echo '#line 2682 "configure"' > conftest.$ac_ext
+- if { (eval echo configure:2683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ echo '#line 4752 "configure"' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+@@ -2699,47 +4774,64 @@
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+- echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+-echo "configure:2704: checking whether the C compiler needs -belf" >&5
+-if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
++echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
++if test "${lt_cv_cc_needs_belf+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-
++
++
+ ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
++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 >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+- cat > conftest.$ac_ext <<EOF
+-#line 2717 "configure"
+-#include "confdefs.h"
+-
+-int main() {
++int
++main ()
++{
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:2724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- lt_cv_cc_needs_belf=no
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++lt_cv_cc_needs_belf=no
+ fi
+-rm -f conftest*
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ ac_cpp='$CPP $CPPFLAGS'
+-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+-cross_compiling=$ac_cv_prog_cc_cross
++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
+-
+-echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
++echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
++echo "${ECHO_T}$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"
+@@ -2824,16 +4916,23 @@
+ old_postuninstall_cmds=
+
+ if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ fi
+
+ # Allow CC to be a program name with arguments.
+ set dummy $CC
+ compiler="$2"
+
+-echo $ac_n "checking for objdir""... $ac_c" 1>&6
+-echo "configure:2837: checking for objdir" >&5
++echo "$as_me:$LINENO: checking for objdir" >&5
++echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+ if test -d .libs; then
+@@ -2843,7 +4942,9 @@
+ objdir=_libs
+ fi
+ rmdir .libs 2>/dev/null
+-echo "$ac_t""$objdir" 1>&6
++echo "$as_me:$LINENO: result: $objdir" >&5
++echo "${ECHO_T}$objdir" >&6
++
+
+
+ # Check whether --with-pic or --without-pic was given.
+@@ -2852,17 +4953,16 @@
+ pic_mode="$withval"
+ else
+ pic_mode=default
+-fi
+-
++fi;
+ test -z "$pic_mode" && pic_mode=default
+
+ # We assume here that the value for lt_cv_prog_cc_pic will not be cached
+ # in isolation, and that seeing it set (from the cache) indicates that
+ # the associated values are set (in the cache) correctly too.
+-echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6
+-echo "configure:2864: checking for $compiler option to produce PIC" >&5
+-if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
++echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
++if test "${lt_cv_prog_cc_pic+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ lt_cv_prog_cc_pic=
+ lt_cv_prog_cc_shlib=
+@@ -2882,7 +4982,7 @@
+ # libC (AIX C++ library), which obviously doesn't included in libraries
+ # list by gcc. This cause undefined symbols with -static flags.
+ # This hack allows C programs to be linked with "-static -ldl", but
+- # we not sure about C++ programs.
++ # not sure about C++ programs.
+ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+ ;;
+ amigaos*)
+@@ -2891,7 +4991,7 @@
+ # like `-m68040'.
+ lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+- beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ darwin* | rhapsody*)
+@@ -2917,13 +5017,13 @@
+ # PORTME Check for PIC flags for the system compiler.
+ case $host_os in
+ aix3* | aix4* | aix5*)
++ lt_cv_prog_cc_wl='-Wl,'
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+- # AIX 5 now supports IA64 processor
+- lt_cv_prog_cc_static='-Bstatic'
+- lt_cv_prog_cc_wl='-Wl,'
++ # AIX 5 now supports IA64 processor
++ lt_cv_prog_cc_static='-Bstatic'
+ else
+- lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+@@ -2934,7 +5034,7 @@
+ lt_cv_prog_cc_pic='+Z'
+ ;;
+
+- irix5* | irix6*)
++ irix5* | irix6* | nonstopux*)
+ lt_cv_prog_cc_wl='-Wl,'
+ lt_cv_prog_cc_static='-non_shared'
+ # PIC (with -KPIC) is the default.
+@@ -2978,11 +5078,7 @@
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_cv_prog_cc_pic='-KPIC'
+ lt_cv_prog_cc_static='-Bstatic'
+- if test "x$host_vendor" = xsni; then
+- lt_cv_prog_cc_wl='-LD'
+- else
+- lt_cv_prog_cc_wl='-Wl,'
+- fi
++ lt_cv_prog_cc_wl='-Wl,'
+ ;;
+
+ uts4*)
+@@ -3006,28 +5102,48 @@
+ fi
+
+ if test -z "$lt_cv_prog_cc_pic"; then
+- echo "$ac_t""none" 1>&6
++ echo "$as_me:$LINENO: result: none" >&5
++echo "${ECHO_T}none" >&6
+ else
+- echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6
++ echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6
+
+ # Check to make sure the pic_flag actually works.
+- echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6
+-echo "configure:3016: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
+- if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
++echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6
++ if test "${lt_cv_prog_cc_pic_works+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
+- cat > conftest.$ac_ext <<EOF
+-#line 3023 "configure"
+-#include "confdefs.h"
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-int main() {
++int
++main ()
++{
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:3030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- rm -rf conftest*
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ case $host_os in
+ hpux9* | hpux10* | hpux11*)
+ # On HP-UX, both CC and GCC only warn that PIC is supported... then
+@@ -3043,17 +5159,17 @@
+ lt_cv_prog_cc_pic_works=yes
+ ;;
+ esac
+-
++
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- lt_cv_prog_cc_pic_works=no
+-
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ lt_cv_prog_cc_pic_works=no
++
+ fi
+-rm -f conftest*
++rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
+-
++
+ fi
+
+
+@@ -3064,43 +5180,65 @@
+ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
+ fi
+
+- echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6
++ echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6
+ fi
+
+ # Check for any special shared library compilation flags.
+ if test -n "$lt_cv_prog_cc_shlib"; then
+- echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2
++ { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5
++echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;}
+ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then :
+ else
+- echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
++ { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
++echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+ lt_cv_prog_cc_can_build_shared=no
+ fi
+ fi
+
+-echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6
+-echo "configure:3082: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
+-if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
++echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6
++if test "${lt_cv_prog_cc_static_works+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ lt_cv_prog_cc_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
+- cat > conftest.$ac_ext <<EOF
+-#line 3090 "configure"
+-#include "confdefs.h"
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-int main() {
++int
++main ()
++{
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:3097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ lt_cv_prog_cc_static_works=yes
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
+ fi
+-rm -f conftest*
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+ fi
+@@ -3108,7 +5246,8 @@
+
+ # Belt *and* braces to stop my trousers falling down:
+ test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
+-echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6
++echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6
+
+ pic_flag="$lt_cv_prog_cc_pic"
+ special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
+@@ -3119,12 +5258,12 @@
+
+
+ # Check to see if options -o and -c are simultaneously supported by compiler
+-echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6
+-echo "configure:3124: checking if $compiler supports -c -o file.$ac_objext" >&5
+-if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
++echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
++if test "${lt_cv_compiler_c_o+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-
++
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+@@ -3139,7 +5278,7 @@
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
+ compiler_c_o=no
+-if { (eval echo configure:3143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
++if { (eval echo configure:5281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
+ if test -s out/conftest.err; then
+@@ -3163,29 +5302,50 @@
+ fi
+
+ compiler_c_o=$lt_cv_compiler_c_o
+-echo "$ac_t""$compiler_c_o" 1>&6
++echo "$as_me:$LINENO: result: $compiler_c_o" >&5
++echo "${ECHO_T}$compiler_c_o" >&6
+
+ if test x"$compiler_c_o" = x"yes"; then
+ # Check to see if we can write to a .lo
+- echo $ac_n "checking if $compiler supports -c -o file.lo""... $ac_c" 1>&6
+-echo "configure:3172: checking if $compiler supports -c -o file.lo" >&5
+- if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5
++echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6
++ if test "${lt_cv_compiler_o_lo+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-
++
+ lt_cv_compiler_o_lo=no
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -c -o conftest.lo"
+- cat > conftest.$ac_ext <<EOF
+-#line 3181 "configure"
+-#include "confdefs.h"
++ save_objext="$ac_objext"
++ ac_objext=lo
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-int main() {
++int
++main ()
++{
+ int some_variable = 0;
+-; return 0; }
+-EOF
+-if { (eval echo configure:3188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- rm -rf conftest*
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+@@ -3193,18 +5353,21 @@
+ else
+ lt_cv_compiler_o_lo=yes
+ fi
+-
++
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
+ fi
+-rm -f conftest*
++rm -f conftest.$ac_objext conftest.$ac_ext
++ ac_objext="$save_objext"
+ CFLAGS="$save_CFLAGS"
+-
++
+ fi
+
+ compiler_o_lo=$lt_cv_compiler_o_lo
+- echo "$ac_t""$compiler_o_lo" 1>&6
++ echo "$as_me:$LINENO: result: $compiler_o_lo" >&5
++echo "${ECHO_T}$compiler_o_lo" >&6
+ else
+ compiler_o_lo=no
+ fi
+@@ -3213,17 +5376,19 @@
+ hard_links="nottested"
+ if test "$compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+- echo $ac_n "checking if we can lock with hard links""... $ac_c" 1>&6
+-echo "configure:3218: checking if we can lock with hard links" >&5
++ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
++echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
+- echo "$ac_t""$hard_links" 1>&6
++ echo "$as_me:$LINENO: result: $hard_links" >&5
++echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+- echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2
++ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
++echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+ else
+@@ -3232,22 +5397,40 @@
+
+ if test "$GCC" = yes; then
+ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+- echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions""... $ac_c" 1>&6
+-echo "configure:3237: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
++ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
++echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
+ compiler_rtti_exceptions=no
+- cat > conftest.$ac_ext <<EOF
+-#line 3243 "configure"
+-#include "confdefs.h"
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-int main() {
++int
++main ()
++{
+ int some_variable = 0;
+-; return 0; }
+-EOF
+-if { (eval echo configure:3250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+- rm -rf conftest*
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+@@ -3255,14 +5438,16 @@
+ else
+ compiler_rtti_exceptions=yes
+ fi
+-
++
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
+ fi
+-rm -f conftest*
++rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
+- echo "$ac_t""$compiler_rtti_exceptions" 1>&6
++ echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
++echo "${ECHO_T}$compiler_rtti_exceptions" >&6
+
+ if test "$compiler_rtti_exceptions" = "yes"; then
+ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
+@@ -3272,8 +5457,8 @@
+ fi
+
+ # See if the linker supports building shared libraries.
+-echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6
+-echo "configure:3277: checking whether the linker ($LD) supports shared libraries" >&5
++echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5
++echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ allow_undefined_flag=
+ no_undefined_flag=
+@@ -3314,7 +5499,7 @@
+ extract_expsyms_cmds=
+
+ case $host_os in
+-cygwin* | mingw* | pw32* )
++cygwin* | mingw* | pw32*)
+ # 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++.
+@@ -3322,7 +5507,9 @@
+ with_gnu_ld=no
+ fi
+ ;;
+-
++openbsd*)
++ with_gnu_ld=no
++ ;;
+ esac
+
+ ld_shlibs=yes
+@@ -3409,7 +5596,7 @@
+ # can override, but on older systems we have to supply one (in ltdll.c)
+ if test "x$lt_cv_need_dllmain" = "xyes"; then
+ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
+- ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < [$]0 > $output_objdir/$soname-ltdll.c~
++ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
+ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
+ else
+ ltdll_obj=
+@@ -3427,19 +5614,20 @@
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is.
+ # If DATA tags from a recent dlltool are present, honour them!
+- archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+- cp $export_symbols $output_objdir/$soname-def;
++ 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;
+- _lt_hint=1;
+- cat $export_symbols | while read symbol; do
+- set dummy \$symbol;
+- case \$# in
+- 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+- *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
+- esac;
+- _lt_hint=`expr 1 + \$_lt_hint`;
+- done;
++ echo EXPORTS > $output_objdir/$soname-def;
++ _lt_hint=1;
++ cat $export_symbols | while read symbol; do
++ set dummy \$symbol;
++ case \$# in
++ 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
++ 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
++ *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
++ esac;
++ _lt_hint=`expr 1 + \$_lt_hint`;
++ done;
+ fi~
+ '"$ltdll_cmds"'
+ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+@@ -3534,80 +5722,98 @@
+ ;;
+
+ aix4* | aix5*)
++ 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].*|aix5*)
++ 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.
+
++ hardcode_direct=yes
+ archive_cmds=''
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+- collect2name=`${CC} -print-prog-name=collect2`
+- if test -f "$collect2name" && \
+- strings "$collect2name" | grep resolve_lib_name >/dev/null
+- then
+- # We have reworked collect2
+- hardcode_direct=yes
+- else
+- # We have old collect2
+- hardcode_direct=unsupported
+- # It fails to find uninstalled libraries when the uninstalled
+- # path is not listed in the libpath. Setting hardcode_minus_L
+- # to unsupported forces relinking
+- hardcode_minus_L=yes
+- hardcode_libdir_flag_spec='-L$libdir'
+- hardcode_libdir_separator=
+- fi
+- shared_flag='-shared'
+- else
++ case $host_os in aix4.[012]|aix4.[012].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ # It fails to find uninstalled libraries when the uninstalled
++ # path is not listed in the libpath. Setting hardcode_minus_L
++ # to unsupported forces relinking
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++
++ shared_flag='-shared'
++ else
++ # not using gcc
+ if test "$host_cpu" = ia64; then
+- shared_flag='-G'
++ shared_flag='${wl}-G'
+ else
+- shared_flag='${wl}-bM:SRE'
++ if test "$aix_use_runtimelinking" = yes; then
++ shared_flag='${wl}-G'
++ else
++ shared_flag='${wl}-bM:SRE'
++ fi
+ fi
+- hardcode_direct=yes
+ fi
+
+- 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
+- # 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 run time linking.
+- aix_use_runtimelinking=no
+- for ld_flag in $LDFLAGS; do
+- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
+- aix_use_runtimelinking=yes
+- break
+- fi
+- done
+- exp_sym_flag='-bexport'
+- no_entry_flag='-bnoentry'
+- fi
+ # It seems that -bexpall can do strange things, 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'
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+- allow_undefined_flag=' -Wl,-G'
+- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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="-znodefs"
+- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ 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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+- hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+- # Warning - without using the other run time loading flags, -berok will
+- # link without error, but may produce a broken library.
+- allow_undefined_flag='${wl}-berok'
+- # This is a bit strange, but is similar to how AIX traditionally builds
+- # it's shared libraries.
+- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname'
++ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Warning - without using the other run time loading flags,
++ # -berok will link without error, but may produce a broken library.
++ allow_undefined_flag='${wl}-berok'
++ # This is a bit strange, but is similar to how AIX traditionally builds
++ # it's shared libraries.
++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+@@ -3639,11 +5845,19 @@
+ ;;
+
+ darwin* | rhapsody*)
+- allow_undefined_flag='-undefined suppress'
++ case "$host_os" in
++ rhapsody* | darwin1.[012])
++ allow_undefined_flag='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ allow_undefined_flag='-flat_namespace -undefined suppress'
++ ;;
++ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+- # yet detect zsh echo's removal of \ escapes.
+- archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
++ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
++ # `"' quotes if we put them in here... so don't!
++ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+ # We need to add '_' to the symbols in $export_symbols first
+ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+ hardcode_direct=yes
+@@ -3695,13 +5909,14 @@
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+- irix5* | irix6*)
++ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+@@ -3718,7 +5933,7 @@
+ ;;
+
+ newsos6)
+- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
++ 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=:
+@@ -3726,10 +5941,24 @@
+ ;;
+
+ openbsd*)
+- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+- hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
++ 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'
++ 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
+ ;;
+
+ os2*)
+@@ -3774,10 +6003,39 @@
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
++ export_dynamic_flag_spec='${wl}-Bexport'
+ ;;
+
+ solaris*)
++ # gcc --version < 3.0 without binutils cannot create self contained
++ # shared libraries reliably, requiring libgcc.a to resolve some of
++ # the object symbols generated in some cases. Libraries that use
++ # assert need libgcc.a to resolve __eprintf, for example. Linking
++ # a copy of libgcc.a into every shared library to guarantee resolving
++ # such symbols causes other problems: According to Tim Van Holder
++ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
++ # (to the application) exception stack for one thing.
+ no_undefined_flag=' -z defs'
++ if test "$GCC" = yes; then
++ case `$CC --version 2>/dev/null` in
++ [12].*)
++ cat <<EOF 1>&2
++
++*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
++*** create self contained shared libraries on Solaris systems, without
++*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
++*** -no-undefined support, which will at least allow you to build shared
++*** libraries. However, you may find that when you link such libraries
++*** into an application without using GCC, you have to manually add
++*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
++*** upgrade to a newer version of GCC. Another option is to rebuild your
++*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
++
++EOF
++ no_undefined_flag=
++ ;;
++ esac
++ fi
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+@@ -3808,13 +6066,23 @@
+ ;;
+
+ sysv4)
+- if test "x$host_vendor" = xsno; then
+- archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linkopts'
+- hardcode_direct=yes # is this really true???
+- else
+- 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
+- fi
++ 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
+ ;;
+@@ -3884,12 +6152,13 @@
+ ;;
+ esac
+ fi
+-echo "$ac_t""$ld_shlibs" 1>&6
++echo "$as_me:$LINENO: result: $ld_shlibs" >&5
++echo "${ECHO_T}$ld_shlibs" >&6
+ test "$ld_shlibs" = no && can_build_shared=no
+
+ # Check hardcoding attributes.
+-echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6
+-echo "configure:3893: checking how to hardcode library paths into programs" >&5
++echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
++echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+ hardcode_action=
+ if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var"; then
+@@ -3912,26 +6181,29 @@
+ # directories.
+ hardcode_action=unsupported
+ fi
+-echo "$ac_t""$hardcode_action" 1>&6
++echo "$as_me:$LINENO: result: $hardcode_action" >&5
++echo "${ECHO_T}$hardcode_action" >&6
+
+ striplib=
+ old_striplib=
+-echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6
+-echo "configure:3921: checking whether stripping libraries is possible" >&5
++echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
++echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
+- echo "$ac_t""yes" 1>&6
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+ # PORTME Fill in your ld.so characteristics
+-echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6
+-echo "configure:3935: checking dynamic linker characteristics" >&5
++echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
++echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+ library_names_spec=
+ libname_spec='lib$name'
+ soname_spec=
+@@ -3958,6 +6230,9 @@
+
+ aix4* | aix5*)
+ 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}.so$major ${libname}${release}.so$versuffix $libname.so'
+@@ -3969,22 +6244,24 @@
+ # 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
+- ;;
++ 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.
++ # 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.
++ # 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}.so$versuffix ${libname}${release}.so$major $libname.so'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+@@ -3993,8 +6270,8 @@
+ soname_spec='${libname}${release}.so$major'
+ fi
+ shlibpath_var=LIBPATH
+- deplibs_check_method=pass_all
+ fi
++ hardcode_into_libs=yes
+ ;;
+
+ amigaos*)
+@@ -4042,7 +6319,7 @@
+ ;;
+ yes,mingw*)
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
+ ;;
+ yes,pw32*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
+@@ -4074,6 +6351,18 @@
+ dynamic_linker=no
+ ;;
+
++freebsd*-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU/FreeBSD ld.so'
++ ;;
++
+ freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+@@ -4125,14 +6414,17 @@
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+-irix5* | irix6*)
+- version_type=irix
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ nonstopux*) version_type=nonstopux ;;
++ *) version_type=irix ;;
++ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
+ case $host_os in
+- irix5*)
++ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+@@ -4206,9 +6498,19 @@
+
+ openbsd*)
+ version_type=sunos
+- if test "$with_gnu_ld" = yes; then
+- need_lib_prefix=no
+- need_version=no
++ need_lib_prefix=no
++ need_version=no
++ 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
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+@@ -4226,11 +6528,13 @@
+ osf3* | osf4* | osf5*)
+ version_type=osf
+ need_version=no
+- soname_spec='${libname}${release}.so'
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
++ need_lib_prefix=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ 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"
++ hardcode_into_libs=yes
+ ;;
+
+ sco3.2v5*)
+@@ -4273,6 +6577,12 @@
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
++ need_lib_prefix=no
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ runpath_var=LD_RUN_PATH
++ ;;
++ siemens)
++ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+@@ -4312,13 +6622,46 @@
+ dynamic_linker=no
+ ;;
+ esac
+-echo "$ac_t""$dynamic_linker" 1>&6
++echo "$as_me:$LINENO: result: $dynamic_linker" >&5
++echo "${ECHO_T}$dynamic_linker" >&6
+ test "$dynamic_linker" = no && can_build_shared=no
+
+ # Report the final consequences.
+-echo $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6
+-echo "configure:4321: checking if libtool supports shared libraries" >&5
+-echo "$ac_t""$can_build_shared" 1>&6
++echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
++echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
++echo "$as_me:$LINENO: result: $can_build_shared" >&5
++echo "${ECHO_T}$can_build_shared" >&6
++
++echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
++echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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
++ ;;
++
++aix4*)
++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
++ test "$enable_shared" = yes && enable_static=no
++ fi
++ ;;
++esac
++echo "$as_me:$LINENO: result: $enable_shared" >&5
++echo "${ECHO_T}$enable_shared" >&6
++
++echo "$as_me:$LINENO: checking whether to build static libraries" >&5
++echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
++# Make sure either enable_shared or enable_static is yes.
++test "$enable_shared" = yes || enable_static=yes
++echo "$as_me:$LINENO: result: $enable_static" >&5
++echo "${ECHO_T}$enable_static" >&6
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+@@ -4355,224 +6698,398 @@
+ ;;
+
+ *)
+- echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+-echo "configure:4360: checking for dlopen in -ldl" >&5
+-ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- ac_save_LIBS="$LIBS"
+-LIBS="-ldl $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 4368 "configure"
+-#include "confdefs.h"
+-/* Override any gcc2 internal prototype to avoid an error. */
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char dlopen();
+-
+-int main() {
+-dlopen()
+-; return 0; }
+-EOF
+-if { (eval echo configure:4379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+-
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+-else
+- echo "$ac_t""no" 1>&6
+-echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+-echo "configure:4398: checking for dlopen" >&5
+-if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 4403 "configure"
+-#include "confdefs.h"
++ echo "$as_me:$LINENO: checking for shl_load" >&5
++echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
++if test "${ac_cv_func_shl_load+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+ /* System header to define __stub macros and hopefully few prototypes,
+- which can conflict with char dlopen(); below. */
+-#include <assert.h>
++ which can conflict with char shl_load (); 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
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char dlopen();
+-
+-int main() {
+-
++ builtin and then its argument prototype would still apply. */
++char shl_load ();
+ /* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+-#if defined (__stub_dlopen) || defined (__stub___dlopen)
++#if defined (__stub_shl_load) || defined (__stub___shl_load)
+ choke me
+ #else
+-dlopen();
++char (*f) () = shl_load;
++#endif
++#ifdef __cplusplus
++}
+ #endif
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:4426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_func_dlopen=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_func_dlopen=no"
+-fi
+-rm -f conftest*
+-fi
+-
+-if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- lt_cv_dlopen="dlopen"
++int
++main ()
++{
++return f != shl_load;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_func_shl_load=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_func_shl_load=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
++echo "${ECHO_T}$ac_cv_func_shl_load" >&6
++if test $ac_cv_func_shl_load = yes; then
++ lt_cv_dlopen="shl_load"
+ else
+- echo "$ac_t""no" 1>&6
+-echo $ac_n "checking for shl_load""... $ac_c" 1>&6
+-echo "configure:4444: checking for shl_load" >&5
+-if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
++echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
++if test "${ac_cv_lib_dld_shl_load+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- cat > conftest.$ac_ext <<EOF
+-#line 4449 "configure"
+-#include "confdefs.h"
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldld $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char shl_load ();
++int
++main ()
++{
++shl_load ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dld_shl_load=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dld_shl_load=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
++echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
++if test $ac_cv_lib_dld_shl_load = yes; then
++ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
++else
++ echo "$as_me:$LINENO: checking for dlopen" >&5
++echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
++if test "${ac_cv_func_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+ /* System header to define __stub macros and hopefully few prototypes,
+- which can conflict with char shl_load(); below. */
+-#include <assert.h>
++ which can conflict with char dlopen (); 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
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char shl_load();
+-
+-int main() {
+-
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
+ /* 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_shl_load) || defined (__stub___shl_load)
++#if defined (__stub_dlopen) || defined (__stub___dlopen)
+ choke me
+ #else
+-shl_load();
++char (*f) () = dlopen;
++#endif
++#ifdef __cplusplus
++}
+ #endif
+
+-; return 0; }
+-EOF
+-if { (eval echo configure:4472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_func_shl_load=yes"
++int
++main ()
++{
++return f != dlopen;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_func_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_func_dlopen=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
++echo "${ECHO_T}$ac_cv_func_dlopen" >&6
++if test $ac_cv_func_dlopen = yes; then
++ lt_cv_dlopen="dlopen"
+ else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_func_shl_load=no"
+-fi
+-rm -f conftest*
+-fi
++ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
++echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
++if test "${ac_cv_lib_dl_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldl $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- lt_cv_dlopen="shl_load"
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dl_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dl_dlopen=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
++echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
++if test $ac_cv_lib_dl_dlopen = yes; then
++ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+ else
+- echo "$ac_t""no" 1>&6
+-echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
+-echo "configure:4490: checking for dlopen in -lsvld" >&5
+-ac_lib_var=`echo svld'_'dlopen | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
++echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
++if test "${ac_cv_lib_svld_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lsvld $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 4498 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char dlopen();
+-
+-int main() {
+-dlopen()
+-; return 0; }
+-EOF
+-if { (eval echo configure:4509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+-
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_svld_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_svld_dlopen=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
++echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
++if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+ else
+- echo "$ac_t""no" 1>&6
+-echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+-echo "configure:4528: checking for shl_load in -ldld" >&5
+-ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
++echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
++if test "${ac_cv_lib_dld_dld_link+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldld $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 4536 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
+ /* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
+ /* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char shl_load();
+-
+-int main() {
+-shl_load()
+-; return 0; }
+-EOF
+-if { (eval echo configure:4547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
++ builtin and then its argument prototype would still apply. */
++char dld_link ();
++int
++main ()
++{
++dld_link ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dld_dld_link=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dld_dld_link=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
++echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
++if test $ac_cv_lib_dld_dld_link = yes; then
++ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+ fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+-else
+- echo "$ac_t""no" 1>&6
++
+ fi
+
+-
++
+ fi
+
+-
++
+ fi
+
+-
++
+ fi
+
+-
++
+ fi
+
+ ;;
+@@ -4595,10 +7112,10 @@
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+- echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
+-echo "configure:4600: checking whether a program can dlopen itself" >&5
+-if eval "test \"`echo '$''{'lt_cv_dlopen_self'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
++echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
++if test "${lt_cv_dlopen_self+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+@@ -4606,7 +7123,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 4610 "configure"
++#line 7126 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -4667,7 +7184,11 @@
+ exit (status);
+ }
+ EOF
+- if { (eval echo configure:4671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+@@ -4682,17 +7203,17 @@
+ fi
+ rm -fr conftest*
+
+-
+-fi
+
+-echo "$ac_t""$lt_cv_dlopen_self" 1>&6
++fi
++echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
++echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+- echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
+-echo "configure:4694: checking whether a statically linked program can dlopen itself" >&5
+-if eval "test \"`echo '$''{'lt_cv_dlopen_self_static'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
++echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
++if test "${lt_cv_dlopen_self_static+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+@@ -4700,7 +7221,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 4704 "configure"
++#line 7224 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -4761,7 +7282,11 @@
+ exit (status);
+ }
+ EOF
+- if { (eval echo configure:4765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+@@ -4776,10 +7301,10 @@
+ fi
+ rm -fr conftest*
+
+-
+-fi
+
+-echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
++fi
++echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
++echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+@@ -4809,15 +7334,19 @@
+ # 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.
+- echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6
+-echo "configure:4814: checking whether -lc should be explicitly linked in" >&5
+- if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
++echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
++ if test "${lt_cv_archive_cmds_need_lc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ $rm conftest*
+ echo 'static int dummy;' > conftest.$ac_ext
+
+- if { (eval echo configure:4821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+@@ -4830,7 +7359,11 @@
+ libname=conftest
+ save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+- if { (eval echo configure:4834: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; }
++ if { (eval echo "$as_me:$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=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+@@ -4842,7 +7375,8 @@
+ fi
+ fi
+
+- echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6
++ echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5
++echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6
+ ;;
+ esac
+ fi
+@@ -4870,7 +7404,7 @@
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+- for var in echo old_CC old_CFLAGS \
++ for var in echo old_CC old_CFLAGS SED \
+ AR AR_FLAGS CC LD LN_S NM SHELL \
+ reload_flag reload_cmds wl \
+ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
+@@ -4882,6 +7416,7 @@
+ old_striplib striplib file_magic_cmd export_symbols_cmds \
+ deplibs_check_method allow_undefined_flag no_undefined_flag \
+ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
++ global_symbol_to_c_name_address \
+ hardcode_libdir_flag_spec hardcode_libdir_separator \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
+@@ -4931,8 +7466,11 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++# A sed that does not truncate output.
++SED=$lt_SED
++
+ # Sed that helps us avoid accidentally triggering echo(1) options like -n.
+-Xsed="sed -e s/^X//"
++Xsed="${SED} -e s/^X//"
+
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
+ # if CDPATH is set.
+@@ -4948,12 +7486,12 @@
+ # Whether or not to build shared libraries.
+ build_libtool_libs=$enable_shared
+
+-# Whether or not to add -lc for building shared libraries.
+-build_libtool_need_lc=$need_lc
+-
+ # Whether or not to build static libraries.
+ build_old_libs=$enable_static
+
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$need_lc
++
+ # Whether or not to optimize for fast installation.
+ fast_install=$enable_fast_install
+
+@@ -5119,6 +7657,9 @@
+ # Transform the output of nm in a proper C declaration
+ global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
+
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
++
+ # This is the shared library runtime path variable.
+ runpath_var=$runpath_var
+
+@@ -5241,9 +7782,9 @@
+ # return TRUE;
+ # }
+ # /* ltdll.c ends here */
+- # This is a source program that is used to create import libraries
+- # on Windows for dlls which lack them. Don't remove nor modify the
+- # starting and closing comments
++ # This is a source program that is used to create import libraries
++ # on Windows for dlls which lack them. Don't remove nor modify the
++ # starting and closing comments
+ # /* impgen.c starts here */
+ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
+ #
+@@ -5411,156 +7952,386 @@
+
+ # Extract the first word of "perl", so it can be a program name with args.
+ set dummy perl; ac_word=$2
+-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:5416: checking for $ac_word" >&5
+-if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_path_PERL+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- case "$PERL" in
+- /*)
++ case $PERL in
++ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+ ;;
+- ?:/*)
+- ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
+- ;;
+ *)
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+- ac_dummy="$PATH"
+- for ac_dir in $ac_dummy; do
+- test -z "$ac_dir" && ac_dir=.
+- if test -f $ac_dir/$ac_word; then
+- ac_cv_path_PERL="$ac_dir/$ac_word"
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
++ 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
+ ;;
+ esac
+ fi
+-PERL="$ac_cv_path_PERL"
++PERL=$ac_cv_path_PERL
++
+ if test -n "$PERL"; then
+- echo "$ac_t""$PERL" 1>&6
++ echo "$as_me:$LINENO: result: $PERL" >&5
++echo "${ECHO_T}$PERL" >&6
+ else
+- echo "$ac_t""no" 1>&6
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
+ fi
+
+
+
+
+-ac_safe=`echo "asm/errno.h" | sed 'y%./+-%__p_%'`
+-echo $ac_n "checking for asm/errno.h""... $ac_c" 1>&6
+-echo "configure:5453: checking for asm/errno.h" >&5
+-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++if test "${ac_cv_header_asm_errno_h+set}" = set; then
++ echo "$as_me:$LINENO: checking for asm/errno.h" >&5
++echo $ECHO_N "checking for asm/errno.h... $ECHO_C" >&6
++if test "${ac_cv_header_asm_errno_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_asm_errno_h" >&5
++echo "${ECHO_T}$ac_cv_header_asm_errno_h" >&6
+ else
+- cat > conftest.$ac_ext <<EOF
+-#line 5458 "configure"
+-#include "confdefs.h"
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking asm/errno.h usability" >&5
++echo $ECHO_N "checking asm/errno.h usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
+ #include <asm/errno.h>
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:5463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=yes"
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking asm/errno.h presence" >&5
++echo $ECHO_N "checking asm/errno.h presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <asm/errno.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=no"
++ ac_cpp_err=yes
+ fi
+-rm -f conftest*
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc in
++ yes:no )
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: asm/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------ ##
++## Report this to bug-autoconf@gnu.org. ##
++## ------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++ no:yes )
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: present but cannot be compiled" >&5
++echo "$as_me: WARNING: asm/errno.h: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: asm/errno.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------ ##
++## Report this to bug-autoconf@gnu.org. ##
++## ------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for asm/errno.h" >&5
++echo $ECHO_N "checking for asm/errno.h... $ECHO_C" >&6
++if test "${ac_cv_header_asm_errno_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_header_asm_errno_h=$ac_header_preproc
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_asm_errno_h" >&5
++echo "${ECHO_T}$ac_cv_header_asm_errno_h" >&6
++
+ fi
+-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
++if test $ac_cv_header_asm_errno_h = yes; then
+ :
+ else
+- echo "$ac_t""no" 1>&6
+-{ echo "configure: error: *** Unable to find asm/errno.h!!!" 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: *** Unable to find asm/errno.h!!!" >&5
++echo "$as_me: error: *** Unable to find asm/errno.h!!!" >&2;}
++ { (exit 1); exit 1; }; }
+
+ fi
+
+
+-ac_safe=`echo "linux/atmsap.h" | sed 'y%./+-%__p_%'`
+-echo $ac_n "checking for linux/atmsap.h""... $ac_c" 1>&6
+-echo "configure:5489: checking for linux/atmsap.h" >&5
+-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
+-else
+- cat > conftest.$ac_ext <<EOF
+-#line 5494 "configure"
+-#include "confdefs.h"
++
++if test "${ac_cv_header_linux_atmsap_h+set}" = set; then
++ echo "$as_me:$LINENO: checking for linux/atmsap.h" >&5
++echo $ECHO_N "checking for linux/atmsap.h... $ECHO_C" >&6
++if test "${ac_cv_header_linux_atmsap_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_linux_atmsap_h" >&5
++echo "${ECHO_T}$ac_cv_header_linux_atmsap_h" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking linux/atmsap.h usability" >&5
++echo $ECHO_N "checking linux/atmsap.h usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
+ #include <linux/atmsap.h>
+-EOF
+-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+-{ (eval echo configure:5499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+-if test -z "$ac_err"; then
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=yes"
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking linux/atmsap.h presence" >&5
++echo $ECHO_N "checking linux/atmsap.h presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <linux/atmsap.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ else
++ ac_cpp_err=
++ fi
+ else
+- echo "$ac_err" >&5
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_header_$ac_safe=no"
++ ac_cpp_err=yes
+ fi
+-rm -f conftest*
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc in
++ yes:no )
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: linux/atmsap.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------ ##
++## Report this to bug-autoconf@gnu.org. ##
++## ------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++ no:yes )
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: present but cannot be compiled" >&5
++echo "$as_me: WARNING: linux/atmsap.h: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&2;}
++ (
++ cat <<\_ASBOX
++## ------------------------------------ ##
++## Report this to bug-autoconf@gnu.org. ##
++## ------------------------------------ ##
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for linux/atmsap.h" >&5
++echo $ECHO_N "checking for linux/atmsap.h... $ECHO_C" >&6
++if test "${ac_cv_header_linux_atmsap_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_header_linux_atmsap_h=$ac_header_preproc
+ fi
+-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
++echo "$as_me:$LINENO: result: $ac_cv_header_linux_atmsap_h" >&5
++echo "${ECHO_T}$ac_cv_header_linux_atmsap_h" >&6
++
++fi
++if test $ac_cv_header_linux_atmsap_h = yes; then
+ :
+ else
+- echo "$ac_t""no" 1>&6
+-{ echo "configure: error: *** Unable to find linux/atmsap.h!!!" 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: *** Unable to find linux/atmsap.h!!!" >&5
++echo "$as_me: error: *** Unable to find linux/atmsap.h!!!" >&2;}
++ { (exit 1); exit 1; }; }
+
+ fi
+
+
+-echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6
+-echo "configure:5524: checking for main in -lresolv" >&5
+-ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++
++
++echo "$as_me:$LINENO: checking for main in -lresolv" >&5
++echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6
++if test "${ac_cv_lib_resolv_main+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lresolv $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 5532 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-int main() {
+-main()
+-; return 0; }
+-EOF
+-if { (eval echo configure:5539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_lib 1
+-EOF
++int
++main ()
++{
++main ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_resolv_main=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_resolv_main=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
++echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6
++if test $ac_cv_lib_resolv_main = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBRESOLV 1
++_ACEOF
+
+ LIBS="-lresolv $LIBS"
+
+ else
+- echo "$ac_t""no" 1>&6
+-{ echo "configure: error: *** Unable to find libresolv!!!" 1>&2; exit 1; }
++ { { echo "$as_me:$LINENO: error: *** Unable to find libresolv!!!" >&5
++echo "$as_me: error: *** Unable to find libresolv!!!" >&2;}
++ { (exit 1); exit 1; }; }
+
+ fi
+
+@@ -5571,639 +8342,1417 @@
+ CFLAGS="$INCLUDES $CFLAGS -Wall -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes"
+ YACC="$YACC -d"
+
+-cat >> confdefs.h <<\EOF
++cat >>confdefs.h <<\_ACEOF
+ #define YY_USE_CONST 1
+-EOF
++_ACEOF
+
+
+ atmsigd_conf_dir=` test "x$exec_prefix" = xNONE && exec_prefix=$ac_default_prefix
+ test "x$prefix" = xNONE && prefix=${exec_prefix}
+ eval echo "$sysconfdir"`
+-cat >> confdefs.h <<EOF
++cat >>confdefs.h <<_ACEOF
+ #define ATMSIGD_CONF "$atmsigd_conf_dir/atmsigd.conf"
+-EOF
++_ACEOF
++
+
+
+ # Check whether --with-uni or --without-uni was given.
+ if test "${with_uni+set}" = set; then
+ withval="$with_uni"
+-
++
+ case "$with_uni" in
+- "3.0" ) cat >> confdefs.h <<\EOF
++ "3.0" ) cat >>confdefs.h <<\_ACEOF
+ #define UNI30 1
+-EOF
++_ACEOF
+
+ ;;
+- "3.1" ) cat >> confdefs.h <<\EOF
++ "3.1" ) cat >>confdefs.h <<\_ACEOF
+ #define UNI31 1
+-EOF
++_ACEOF
+
+ ;;
+- "4.0" ) cat >> confdefs.h <<\EOF
++ "4.0" ) cat >>confdefs.h <<\_ACEOF
+ #define UNI40 1
+-EOF
++_ACEOF
+
+ ;;
+ *)
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define DYNAMIC_UNI 1
+-EOF
++_ACEOF
+
+- echo "configure: warning: *** UNI version not specified correctly. Defaulting to dynamic UNI." 1>&2
++ { echo "$as_me:$LINENO: WARNING: *** UNI version not specified correctly. Defaulting to dynamic UNI." >&5
++echo "$as_me: WARNING: *** UNI version not specified correctly. Defaulting to dynamic UNI." >&2;}
+ esac
+-
++
+ else
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define DYNAMIC_UNI 1
+-EOF
++_ACEOF
+
+
+-fi
+-
++fi;
+
+ # Check whether --enable-allow_uni30 or --disable-allow_uni30 was given.
+ if test "${enable_allow_uni30+set}" = set; then
+ enableval="$enable_allow_uni30"
+-
++
+ if test "$with_uni" = "3.1" ; then
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define ALLOW_UNI30 1
+-EOF
++_ACEOF
+
+ else
+- echo "configure: warning: *** Allow UNI 3.0 was not enabled. It is only valid when UNI 3.1 is specified as the default via --with-uni." 1>&2
++ { echo "$as_me:$LINENO: WARNING: *** Allow UNI 3.0 was not enabled. It is only valid when UNI 3.1 is specified as the default via --with-uni." >&5
++echo "$as_me: WARNING: *** Allow UNI 3.0 was not enabled. It is only valid when UNI 3.1 is specified as the default via --with-uni." >&2;}
+ fi
+-
+
+-fi
+
++fi;
+
+ # Check whether --enable-q2963_1 or --disable-q2963_1 was given.
+ if test "${enable_q2963_1+set}" = set; then
+ enableval="$enable_q2963_1"
+-
++
+ if test "$with_uni" = "4.0" ; then
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define Q2963_1 1
+-EOF
++_ACEOF
+
+ else
+- echo "configure: warning: *** Q.2963.1 was not enabled. It is only valid when UNI 4.0 is specified as the default via --with-uni." 1>&2
++ { echo "$as_me:$LINENO: WARNING: *** Q.2963.1 was not enabled. It is only valid when UNI 4.0 is specified as the default via --with-uni." >&5
++echo "$as_me: WARNING: *** Q.2963.1 was not enabled. It is only valid when UNI 4.0 is specified as the default via --with-uni." >&2;}
+ fi
+-
+
+-fi
+
++fi;
+
+ # Check whether --enable-cisco or --disable-cisco was given.
+ if test "${enable_cisco+set}" = set; then
+ enableval="$enable_cisco"
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define CISCO 1
+-EOF
++_ACEOF
+
+
+-fi
+-
++fi;
+
+ # Check whether --enable-thomflex or --disable-thomflex was given.
+ if test "${enable_thomflex+set}" = set; then
+ enableval="$enable_thomflex"
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define THOMFLEX 1
+-EOF
+-
++_ACEOF
+
+-fi
+
++fi;
+
+-cat >> confdefs.h <<\EOF
++cat >>confdefs.h <<\_ACEOF
+ #define BROKEN_POLL 1
+-EOF
++_ACEOF
+
+
+ # Check whether --enable-mpoa_1_1 or --disable-mpoa_1_1 was given.
+ if test "${enable_mpoa_1_1+set}" = set; then
+ enableval="$enable_mpoa_1_1"
+- cat >> confdefs.h <<\EOF
++ cat >>confdefs.h <<\_ACEOF
+ #define MPOA_1_1 1
+-EOF
+-
++_ACEOF
+
+-fi
+
++fi;
+
+ # Check whether --enable-mpr or --disable-mpr was given.
+ if test "${enable_mpr+set}" = set; then
+ enableval="$enable_mpr"
+-
++
+ case "$enable_mpr" in
+ "" | y | ye | yes | Y | YE | YES )
+- echo $ac_n "checking for main in -lmpr""... $ac_c" 1>&6
+-echo "configure:5704: checking for main in -lmpr" >&5
+-ac_lib_var=`echo mpr'_'main | sed 'y%./+-%__p_%'`
+-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+- echo $ac_n "(cached) $ac_c" 1>&6
++
++echo "$as_me:$LINENO: checking for main in -lmpr" >&5
++echo $ECHO_N "checking for main in -lmpr... $ECHO_C" >&6
++if test "${ac_cv_lib_mpr_main+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_save_LIBS="$LIBS"
++ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lmpr $LIBS"
+-cat > conftest.$ac_ext <<EOF
+-#line 5712 "configure"
+-#include "confdefs.h"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
+
+-int main() {
+-main()
+-; return 0; }
+-EOF
+-if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=yes"
+-else
+- echo "configure: failed program was:" >&5
+- cat conftest.$ac_ext >&5
+- rm -rf conftest*
+- eval "ac_cv_lib_$ac_lib_var=no"
+-fi
+-rm -f conftest*
+-LIBS="$ac_save_LIBS"
+
+-fi
+-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+- echo "$ac_t""yes" 1>&6
+- ac_tr_lib=HAVE_LIB`echo mpr | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+- cat >> confdefs.h <<EOF
+-#define $ac_tr_lib 1
+-EOF
++int
++main ()
++{
++main ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_mpr_main=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_mpr_main=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_mpr_main" >&5
++echo "${ECHO_T}$ac_cv_lib_mpr_main" >&6
++if test $ac_cv_lib_mpr_main = yes; then
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_LIBMPR 1
++_ACEOF
+
+ LIBS="-lmpr $LIBS"
+
+ else
+- echo "$ac_t""no" 1>&6
+
+- echo "configure: warning: *** Could not find libmpr! Is MPR installed?" 1>&2
+-
+-
++ { echo "$as_me:$LINENO: WARNING: *** Could not find libmpr! Is MPR installed?" >&5
++echo "$as_me: WARNING: *** Could not find libmpr! Is MPR installed?" >&2;}
++
++
+ fi
+
+ ;;
+ esac
+-
+
+-fi
+
++fi;
+
+
+-trap '' 1 2 15
+-cat > confcache <<\EOF
++ ac_config_files="$ac_config_files Makefile doc/Makefile m4/Makefile src/Makefile src/include/Makefile src/lib/Makefile src/test/Makefile src/debug/Makefile src/qgen/Makefile src/saal/Makefile src/sigd/Makefile src/maint/Makefile src/arpd/Makefile src/ilmid/Makefile src/ilmid/asn1/Makefile src/man/Makefile src/led/Makefile src/lane/Makefile src/mpoad/Makefile src/switch/Makefile src/switch/debug/Makefile src/switch/tcp/Makefile src/config/Makefile src/config/init-redhat/Makefile src/extra/Makefile src/extra/linux-atm.spec src/extra/ANS/Makefile"
++cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+ # tests run on this system so they can be shared between configure
+-# scripts and configure runs. It is not useful on other systems.
+-# If it contains results you don't want to keep, you may remove or edit it.
++# 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.
+ #
+-# By default, configure uses ./config.cache as the cache file,
+-# creating it if it does not exist already. You can give configure
+-# the --cache-file=FILE option to use a different cache file; that is
+-# what configure does when it calls configure scripts in
+-# subdirectories, so they share the cache.
+-# Giving --cache-file=/dev/null disables caching, for debugging configure.
+-# config.status only pays attention to the cache file if you give it the
+-# --recheck option to rerun configure.
++# config.status only pays attention to the cache file if you give it
++# the --recheck option to rerun configure.
+ #
+-EOF
++# `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, don't put newlines in cache variables' values.
+ # 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.
+-(set) 2>&1 |
+- case `(ac_space=' '; set | grep ac_space) 2>&1` in
+- *ac_space=\ *)
+- # `set' does not quote correctly, so add quotes (double-quote substitution
+- # turns \\\\ into \\, and sed turns \\ into \).
+- sed -n \
+- -e "s/'/'\\\\''/g" \
+- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+- ;;
+- *)
+- # `set' quotes correctly as required by POSIX, so do not add quotes.
+- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+- ;;
+- esac >> confcache
+-if cmp -s $cache_file confcache; then
+- :
+-else
++{
++ (set) 2>&1 |
++ case `(ac_space=' '; set | grep ac_space) 2>&1` in
++ *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 \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++} |
++ sed '
++ t clear
++ : clear
++ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
++ t end
++ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
++ : end' >>confcache
++if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+- echo "updating cache $cache_file"
+- cat confcache > $cache_file
++ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
++ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+ fi
+ rm -f confcache
+
+-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+-
+ test "x$prefix" = xNONE && prefix=$ac_default_prefix
+ # Let make expand exec_prefix.
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+-# Any assignment to VPATH causes Sun make to only execute
+-# the first set of double-colon rules, so remove it if not needed.
+-# If there is a colon in the path, we need to keep it.
++# 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[ ]*=[^:]*$/d'
++ ac_vpsub='/^[ ]*VPATH[ ]*=/{
++s/:*\$(srcdir):*/:/;
++s/:*\${srcdir}:*/:/;
++s/:*@srcdir@:*/:/;
++s/^\([^=]*=[ ]*\):*/\1/;
++s/:*$//;
++s/^[^=]*=[ ]*$//;
++}'
+ fi
+
+-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+-
+ DEFS=-DHAVE_CONFIG_H
+
+-# Without the "./", some shells look in PATH for config.status.
+-: ${CONFIG_STATUS=./config.status}
++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_i=`echo "$ac_i" |
++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
++ # 2. Add them.
++ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
++ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
++done
++LIBOBJS=$ac_libobjs
+
+-echo creating $CONFIG_STATUS
+-rm -f $CONFIG_STATUS
+-cat > $CONFIG_STATUS <<EOF
+-#! /bin/sh
+-# Generated automatically by configure.
++LTLIBOBJS=$ac_ltlibobjs
++
++
++
++: ${CONFIG_STATUS=./config.status}
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files $CONFIG_STATUS"
++{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
++echo "$as_me: creating $CONFIG_STATUS" >&6;}
++cat >$CONFIG_STATUS <<_ACEOF
++#! $SHELL
++# Generated by $as_me.
+ # Run this file to recreate the current configuration.
+-# This directory was configured as follows,
+-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+-#
+-# $0 $ac_configure_args
+-#
+ # Compiler output produced by configure, useful for debugging
+-# configure, is in ./config.log if it exists.
++# configure, is in config.log if it exists.
+
+-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+-for ac_option
++debug=false
++ac_cs_recheck=false
++ac_cs_silent=false
++SHELL=\${CONFIG_SHELL-$SHELL}
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++## --------------------- ##
++## M4sh Initialization. ##
++## --------------------- ##
++
++# Be Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++
++# Support unset when possible.
++if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
+ do
+- case "\$ac_option" in
+- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+- echo "$CONFIG_STATUS generated by autoconf version 2.13"
+- exit 0 ;;
+- -help | --help | --hel | --he | --h)
+- echo "\$ac_cs_usage"; exit 0 ;;
+- *) echo "\$ac_cs_usage"; exit 1 ;;
++ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; 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
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# 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
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ 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
++
++ ;;
+ 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
++ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
++echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
+ done
++;;
++ esac
+
+-ac_given_srcdir=$srcdir
+-ac_given_INSTALL="$INSTALL"
+-
+-trap 'rm -fr `echo "Makefile \
+- doc/Makefile \
+- m4/Makefile \
+- src/Makefile \
+- src/include/Makefile \
+- src/lib/Makefile \
+- src/test/Makefile \
+- src/debug/Makefile \
+- src/qgen/Makefile \
+- src/saal/Makefile \
+- src/sigd/Makefile \
+- src/maint/Makefile \
+- src/arpd/Makefile \
+- src/ilmid/Makefile \
+- src/ilmid/asn1/Makefile \
+- src/man/Makefile \
+- src/led/Makefile \
+- src/lane/Makefile \
+- src/mpoad/Makefile \
+- src/switch/Makefile \
+- src/switch/debug/Makefile \
+- src/switch/tcp/Makefile \
+- src/config/Makefile \
+- src/config/init-redhat/Makefile \
+- src/extra/Makefile \
+- src/extra/linux-atm.spec \
+- src/extra/ANS/Makefile
+- config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+-EOF
+-cat >> $CONFIG_STATUS <<EOF
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
++echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
++ { (exit 1); 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 sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
+
+-# Protect against being on the right side of a sed subst in config.status.
+-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+-$ac_vpsub
+-$extrasub
+-s%@SHELL@%$SHELL%g
+-s%@CFLAGS@%$CFLAGS%g
+-s%@CPPFLAGS@%$CPPFLAGS%g
+-s%@CXXFLAGS@%$CXXFLAGS%g
+-s%@FFLAGS@%$FFLAGS%g
+-s%@DEFS@%$DEFS%g
+-s%@LDFLAGS@%$LDFLAGS%g
+-s%@LIBS@%$LIBS%g
+-s%@exec_prefix@%$exec_prefix%g
+-s%@prefix@%$prefix%g
+-s%@program_transform_name@%$program_transform_name%g
+-s%@bindir@%$bindir%g
+-s%@sbindir@%$sbindir%g
+-s%@libexecdir@%$libexecdir%g
+-s%@datadir@%$datadir%g
+-s%@sysconfdir@%$sysconfdir%g
+-s%@sharedstatedir@%$sharedstatedir%g
+-s%@localstatedir@%$localstatedir%g
+-s%@libdir@%$libdir%g
+-s%@includedir@%$includedir%g
+-s%@oldincludedir@%$oldincludedir%g
+-s%@infodir@%$infodir%g
+-s%@mandir@%$mandir%g
+-s%@host@%$host%g
+-s%@host_alias@%$host_alias%g
+-s%@host_cpu@%$host_cpu%g
+-s%@host_vendor@%$host_vendor%g
+-s%@host_os@%$host_os%g
+-s%@target@%$target%g
+-s%@target_alias@%$target_alias%g
+-s%@target_cpu@%$target_cpu%g
+-s%@target_vendor@%$target_vendor%g
+-s%@target_os@%$target_os%g
+-s%@build@%$build%g
+-s%@build_alias@%$build_alias%g
+-s%@build_cpu@%$build_cpu%g
+-s%@build_vendor@%$build_vendor%g
+-s%@build_os@%$build_os%g
+-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+-s%@INSTALL_DATA@%$INSTALL_DATA%g
+-s%@PACKAGE@%$PACKAGE%g
+-s%@VERSION@%$VERSION%g
+-s%@ACLOCAL@%$ACLOCAL%g
+-s%@AUTOCONF@%$AUTOCONF%g
+-s%@AUTOMAKE@%$AUTOMAKE%g
+-s%@AUTOHEADER@%$AUTOHEADER%g
+-s%@MAKEINFO@%$MAKEINFO%g
+-s%@SET_MAKE@%$SET_MAKE%g
+-s%@LIBVER_CURRENT@%$LIBVER_CURRENT%g
+-s%@LIBVER_REVISION@%$LIBVER_REVISION%g
+-s%@LIBVER_AGE@%$LIBVER_AGE%g
+-s%@CC@%$CC%g
+-s%@LEX@%$LEX%g
+-s%@LEXLIB@%$LEXLIB%g
+-s%@CPP@%$CPP%g
+-s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g
+-s%@YACC@%$YACC%g
+-s%@LN_S@%$LN_S%g
+-s%@OBJEXT@%$OBJEXT%g
+-s%@EXEEXT@%$EXEEXT%g
+-s%@ECHO@%$ECHO%g
+-s%@RANLIB@%$RANLIB%g
+-s%@STRIP@%$STRIP%g
+-s%@LIBTOOL@%$LIBTOOL%g
+-s%@LIBTOOL_DEPS@%$LIBTOOL_DEPS%g
+-s%@PERL@%$PERL%g
+
+-CEOF
+-EOF
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
+
+-cat >> $CONFIG_STATUS <<\EOF
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
+
+-# Split the substitutions into bite-sized pieces for seds with
+-# small command number limits, like on Digital OSF/1 and HP-UX.
+-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+-ac_file=1 # Number of current file.
+-ac_beg=1 # First line for current file.
+-ac_end=$ac_max_sed_cmds # Line after last line for current file.
+-ac_more_lines=:
+-ac_sed_cmds=""
+-while $ac_more_lines; do
+- if test $ac_beg -gt 1; then
+- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+- else
+- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+- fi
+- if test ! -s conftest.s$ac_file; then
+- ac_more_lines=false
+- rm -f conftest.s$ac_file
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
+ else
+- if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds="sed -f conftest.s$ac_file"
+- else
+- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+- fi
+- ac_file=`expr $ac_file + 1`
+- ac_beg=$ac_end
+- ac_end=`expr $ac_end + $ac_max_sed_cmds`
++ as_ln_s='ln -s'
+ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# Sed expression to map a string onto a valid CPP name.
++as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++exec 6>&1
++
++# Open the log real soon, to keep \$[0] and so on meaningful, and to
++# report actual input values of CONFIG_FILES etc. instead of their
++# values after options handling. Logging --version etc. is OK.
++exec 5>>config.log
++{
++ echo
++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
++## Running $as_me. ##
++_ASBOX
++} >&5
++cat >&5 <<_CSEOF
++
++This file was extended by $as_me, which was
++generated by GNU Autoconf 2.57. Invocation command line was
++
++ CONFIG_FILES = $CONFIG_FILES
++ CONFIG_HEADERS = $CONFIG_HEADERS
++ CONFIG_LINKS = $CONFIG_LINKS
++ CONFIG_COMMANDS = $CONFIG_COMMANDS
++ $ $0 $@
++
++_CSEOF
++echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
++echo >&5
++_ACEOF
++
++# Files that config.status was made for.
++if test -n "$ac_config_files"; then
++ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_headers"; then
++ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_links"; then
++ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_commands"; then
++ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
++fi
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++ac_cs_usage="\
++\`$as_me' instantiates files from templates according to the
++current configuration.
++
++Usage: $0 [OPTIONS] [FILE]...
++
++ -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
++ --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 <bug-autoconf@gnu.org>."
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++ac_cs_version="\\
++config.status
++configured by $0, generated by GNU Autoconf 2.57,
++ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
++
++Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
++Free Software Foundation, Inc.
++This config.status script is free software; the Free Software Foundation
++gives unlimited permission to copy, distribute and modify it."
++srcdir=$srcdir
++INSTALL="$INSTALL"
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++# If no file are specified by the user, then we need to provide default
++# value. By we need to know if files were specified by the user.
++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
++ ;;
++ *) # This is not an option, so the user has probably given explicit
++ # arguments.
++ ac_option=$1
++ ac_need_defaults=false;;
++ esac
++
++ case $ac_option in
++ # Handling of the options.
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ ac_cs_recheck=: ;;
++ --version | --vers* | -V )
++ echo "$ac_cs_version"; exit 0 ;;
++ --he | --h)
++ # Conflict between --help and --header
++ { { echo "$as_me:$LINENO: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; };;
++ --help | --hel | -h )
++ echo "$ac_cs_usage"; exit 0 ;;
++ --debug | --d* | -d )
++ debug=: ;;
++ --file | --fil | --fi | --f )
++ $ac_shift
++ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
++ ac_need_defaults=false;;
++ --header | --heade | --head | --hea )
++ $ac_shift
++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
++ ac_need_defaults=false;;
++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++ | -silent | --silent | --silen | --sile | --sil | --si | --s)
++ ac_cs_silent=: ;;
++
++ # This is an error.
++ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; } ;;
++
++ *) ac_config_targets="$ac_config_targets $1" ;;
++
++ 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
++if \$ac_cs_recheck; then
++ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
++ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
++fi
++
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++#
++# INIT-COMMANDS section.
++#
++
++
++
++_ACEOF
++
++
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_config_target in $ac_config_targets
++do
++ case "$ac_config_target" in
++ # Handling of arguments.
++ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
++ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
++ "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
++ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
++ "src/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;;
++ "src/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
++ "src/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;;
++ "src/debug/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/debug/Makefile" ;;
++ "src/qgen/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/qgen/Makefile" ;;
++ "src/saal/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/saal/Makefile" ;;
++ "src/sigd/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/sigd/Makefile" ;;
++ "src/maint/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/maint/Makefile" ;;
++ "src/arpd/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/arpd/Makefile" ;;
++ "src/ilmid/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/ilmid/Makefile" ;;
++ "src/ilmid/asn1/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/ilmid/asn1/Makefile" ;;
++ "src/man/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/man/Makefile" ;;
++ "src/led/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/led/Makefile" ;;
++ "src/lane/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lane/Makefile" ;;
++ "src/mpoad/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mpoad/Makefile" ;;
++ "src/switch/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/switch/Makefile" ;;
++ "src/switch/debug/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/switch/debug/Makefile" ;;
++ "src/switch/tcp/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/switch/tcp/Makefile" ;;
++ "src/config/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/config/Makefile" ;;
++ "src/config/init-redhat/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/config/init-redhat/Makefile" ;;
++ "src/extra/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/extra/Makefile" ;;
++ "src/extra/linux-atm.spec" ) CONFIG_FILES="$CONFIG_FILES src/extra/linux-atm.spec" ;;
++ "src/extra/ANS/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/extra/ANS/Makefile" ;;
++ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
++ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
++echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
++ { (exit 1); exit 1; }; };;
++ esac
+ done
+-if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds=cat
++
++# 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
+-EOF
+
+-cat >> $CONFIG_STATUS <<EOF
++# Have a temporary directory for convenience. Make it in the build tree
++# simply because there is no reason to put it here, and in addition,
++# creating and moving files from /tmp can sometimes cause problems.
++# Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
+
+-CONFIG_FILES=\${CONFIG_FILES-"Makefile \
+- doc/Makefile \
+- m4/Makefile \
+- src/Makefile \
+- src/include/Makefile \
+- src/lib/Makefile \
+- src/test/Makefile \
+- src/debug/Makefile \
+- src/qgen/Makefile \
+- src/saal/Makefile \
+- src/sigd/Makefile \
+- src/maint/Makefile \
+- src/arpd/Makefile \
+- src/ilmid/Makefile \
+- src/ilmid/asn1/Makefile \
+- src/man/Makefile \
+- src/led/Makefile \
+- src/lane/Makefile \
+- src/mpoad/Makefile \
+- src/switch/Makefile \
+- src/switch/debug/Makefile \
+- src/switch/tcp/Makefile \
+- src/config/Makefile \
+- src/config/init-redhat/Makefile \
+- src/extra/Makefile \
+- src/extra/linux-atm.spec \
+- src/extra/ANS/Makefile
+- "}
+-EOF
+-cat >> $CONFIG_STATUS <<\EOF
+-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
++# Create a (secure) tmp directory for tmp files.
++
++{
++ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=./confstat$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in ." >&2
++ { (exit 1); exit 1; }
++}
++
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++
++#
++# CONFIG_FILES section.
++#
++
++# No need to generate the scripts if there are no CONFIG_FILES.
++# This happens for instance when ./config.status config.h
++if test -n "\$CONFIG_FILES"; then
++ # Protect against being on the right side of a sed subst in config.status.
++ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
++ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
++s,@SHELL@,$SHELL,;t t
++s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
++s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
++s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
++s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
++s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
++s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
++s,@exec_prefix@,$exec_prefix,;t t
++s,@prefix@,$prefix,;t t
++s,@program_transform_name@,$program_transform_name,;t t
++s,@bindir@,$bindir,;t t
++s,@sbindir@,$sbindir,;t t
++s,@libexecdir@,$libexecdir,;t t
++s,@datadir@,$datadir,;t t
++s,@sysconfdir@,$sysconfdir,;t t
++s,@sharedstatedir@,$sharedstatedir,;t t
++s,@localstatedir@,$localstatedir,;t t
++s,@libdir@,$libdir,;t t
++s,@includedir@,$includedir,;t t
++s,@oldincludedir@,$oldincludedir,;t t
++s,@infodir@,$infodir,;t t
++s,@mandir@,$mandir,;t t
++s,@build_alias@,$build_alias,;t t
++s,@host_alias@,$host_alias,;t t
++s,@target_alias@,$target_alias,;t t
++s,@DEFS@,$DEFS,;t t
++s,@ECHO_C@,$ECHO_C,;t t
++s,@ECHO_N@,$ECHO_N,;t t
++s,@ECHO_T@,$ECHO_T,;t t
++s,@LIBS@,$LIBS,;t t
++s,@build@,$build,;t t
++s,@build_cpu@,$build_cpu,;t t
++s,@build_vendor@,$build_vendor,;t t
++s,@build_os@,$build_os,;t t
++s,@host@,$host,;t t
++s,@host_cpu@,$host_cpu,;t t
++s,@host_vendor@,$host_vendor,;t t
++s,@host_os@,$host_os,;t t
++s,@target@,$target,;t t
++s,@target_cpu@,$target_cpu,;t t
++s,@target_vendor@,$target_vendor,;t t
++s,@target_os@,$target_os,;t t
++s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
++s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
++s,@INSTALL_DATA@,$INSTALL_DATA,;t t
++s,@PACKAGE@,$PACKAGE,;t t
++s,@VERSION@,$VERSION,;t t
++s,@ACLOCAL@,$ACLOCAL,;t t
++s,@AUTOCONF@,$AUTOCONF,;t t
++s,@AUTOMAKE@,$AUTOMAKE,;t t
++s,@AUTOHEADER@,$AUTOHEADER,;t t
++s,@MAKEINFO@,$MAKEINFO,;t t
++s,@SET_MAKE@,$SET_MAKE,;t t
++s,@LIBVER_CURRENT@,$LIBVER_CURRENT,;t t
++s,@LIBVER_REVISION@,$LIBVER_REVISION,;t t
++s,@LIBVER_AGE@,$LIBVER_AGE,;t t
++s,@CC@,$CC,;t t
++s,@CFLAGS@,$CFLAGS,;t t
++s,@LDFLAGS@,$LDFLAGS,;t t
++s,@CPPFLAGS@,$CPPFLAGS,;t t
++s,@ac_ct_CC@,$ac_ct_CC,;t t
++s,@EXEEXT@,$EXEEXT,;t t
++s,@OBJEXT@,$OBJEXT,;t t
++s,@LEX@,$LEX,;t t
++s,@LEXLIB@,$LEXLIB,;t t
++s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
++s,@YACC@,$YACC,;t t
++s,@LN_S@,$LN_S,;t t
++s,@ECHO@,$ECHO,;t t
++s,@RANLIB@,$RANLIB,;t t
++s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
++s,@STRIP@,$STRIP,;t t
++s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
++s,@CPP@,$CPP,;t t
++s,@EGREP@,$EGREP,;t t
++s,@LIBTOOL@,$LIBTOOL,;t t
++s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t
++s,@PERL@,$PERL,;t t
++s,@LIBOBJS@,$LIBOBJS,;t t
++s,@LTLIBOBJS@,$LTLIBOBJS,;t t
++CEOF
++
++_ACEOF
++
++ cat >>$CONFIG_STATUS <<\_ACEOF
++ # Split the substitutions into bite-sized pieces for seds with
++ # small command number limits, like on Digital OSF/1 and HP-UX.
++ ac_max_sed_lines=48
++ ac_sed_frag=1 # Number of current file.
++ ac_beg=1 # First line for current file.
++ ac_end=$ac_max_sed_lines # Line after last line for current file.
++ ac_more_lines=:
++ ac_sed_cmds=
++ while $ac_more_lines; do
++ if test $ac_beg -gt 1; then
++ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ else
++ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ fi
++ if test ! -s $tmp/subs.frag; then
++ ac_more_lines=false
++ else
++ # The purpose of the label and of the branching condition is to
++ # speed up the sed processing (if there are no `@' at all, there
++ # is no need to browse any of the substitutions).
++ # These are the two extra sed commands mentioned above.
++ (echo ':t
++ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
++ else
++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
++ fi
++ ac_sed_frag=`expr $ac_sed_frag + 1`
++ ac_beg=$ac_end
++ ac_end=`expr $ac_end + $ac_max_sed_lines`
++ fi
++ done
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds=cat
++ fi
++fi # test -n "$CONFIG_FILES"
++
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+- case "$ac_file" in
+- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+- *) ac_file_in="${ac_file}.in" ;;
+- esac
+-
+- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+-
+- # Remove last slash and all that follows it. Not all systems have dirname.
+- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+- # The file is in a subdirectory.
+- test ! -d "$ac_dir" && mkdir "$ac_dir"
+- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+- # A "../" for each directory in $ac_dir_suffix.
+- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+- else
+- ac_dir_suffix= ac_dots=
+- fi
+-
+- case "$ac_given_srcdir" in
+- .) srcdir=.
+- if test -z "$ac_dots"; then top_srcdir=.
+- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
++ case $ac_file in
++ - | *:- | *:-:* ) # input from stdin
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ * ) ac_file_in=$ac_file.in ;;
++ esac
++
++ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
++ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+- top_srcdir="$ac_dots$ac_given_srcdir" ;;
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
++# absolute.
++ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
++ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
++ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
++ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++
++ case $INSTALL in
++ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
++ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+- case "$ac_given_INSTALL" in
+- [/$]*) INSTALL="$ac_given_INSTALL" ;;
+- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+- esac
+-
+- echo creating "$ac_file"
+- rm -f "$ac_file"
+- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+- case "$ac_file" in
+- *Makefile*) ac_comsub="1i\\
+-# $configure_input" ;;
+- *) ac_comsub= ;;
+- esac
+-
+- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+- sed -e "$ac_comsub
+-s%@configure_input@%$configure_input%g
+-s%@srcdir@%$srcdir%g
+-s%@top_srcdir@%$top_srcdir%g
+-s%@INSTALL@%$INSTALL%g
+-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+-fi; done
+-rm -f conftest.s*
++ if test x"$ac_file" != x-; then
++ { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++ rm -f "$ac_file"
++ fi
++ # 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. */
++ if test x"$ac_file" = x-; then
++ configure_input=
++ else
++ configure_input="$ac_file. "
++ fi
++ configure_input=$configure_input"Generated from `echo $ac_file_in |
++ sed 's,.*/,,'` by configure."
++
++ # First look for the input files in the build tree, otherwise in the
++ # src tree.
++ ac_file_inputs=`IFS=:
++ for f in $ac_file_in; do
++ case $f in
++ -) echo $tmp/stdin ;;
++ [\\/$]*)
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ echo $f;;
++ *) # Relative
++ if test -f "$f"; then
++ # Build tree
++ echo $f
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo $srcdir/$f
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ fi;;
++ esac
++ done` || { (exit 1); exit 1; }
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF
++ sed "$ac_vpsub
++$extrasub
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++:t
++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
++s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t
++s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
++s,@INSTALL@,$ac_INSTALL,;t t
++" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
++ rm -f $tmp/stdin
++ if test x"$ac_file" != x-; then
++ mv $tmp/out $ac_file
++ else
++ cat $tmp/out
++ rm -f $tmp/out
++ fi
++
++done
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++#
++# CONFIG_HEADER section.
++#
+
+ # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+ # NAME is the cpp macro being defined and VALUE is the value it is being given.
+ #
+ # ac_d sets the value in "#define NAME VALUE" lines.
+-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+-ac_dC='\3'
+-ac_dD='%g'
+-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+-ac_uB='\([ ]\)%\1#\2define\3'
++ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
++ac_dB='[ ].*$,\1#\2'
++ac_dC=' '
++ac_dD=',;t'
++# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
++ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
++ac_uB='$,\1#\2define\3'
+ ac_uC=' '
+-ac_uD='\4%g'
+-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+-ac_eB='$%\1#\2define\3'
+-ac_eC=' '
+-ac_eD='%g'
++ac_uD=',;t'
+
+-if test "${CONFIG_HEADERS+set}" != set; then
+-EOF
+-cat >> $CONFIG_STATUS <<EOF
+- CONFIG_HEADERS="config.h"
+-EOF
+-cat >> $CONFIG_STATUS <<\EOF
+-fi
+-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
++for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+- case "$ac_file" in
+- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+- *) ac_file_in="${ac_file}.in" ;;
++ case $ac_file in
++ - | *:- | *:-:* ) # input from stdin
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+- echo creating $ac_file
+-
+- rm -f conftest.frag conftest.in conftest.out
+- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+- cat $ac_file_inputs > conftest.in
+-
+-EOF
++ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
+
+-# Transform confdefs.h into a sed script conftest.vals that substitutes
+-# the proper values into config.h.in to produce config.h. And first:
+-# Protect against being on the right side of a sed subst in config.status.
+-# Protect against being in an unquoted here document in config.status.
+-rm -f conftest.vals
+-cat > conftest.hdr <<\EOF
+-s/[\\&%]/\\&/g
+-s%[\\$`]%\\&%g
+-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+-s%ac_d%ac_u%gp
+-s%ac_u%ac_e%gp
+-EOF
+-sed -n -f conftest.hdr confdefs.h > conftest.vals
+-rm -f conftest.hdr
++ # First look for the input files in the build tree, otherwise in the
++ # src tree.
++ ac_file_inputs=`IFS=:
++ for f in $ac_file_in; do
++ case $f in
++ -) echo $tmp/stdin ;;
++ [\\/$]*)
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ echo $f;;
++ *) # Relative
++ if test -f "$f"; then
++ # Build tree
++ echo $f
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo $srcdir/$f
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ fi;;
++ esac
++ done` || { (exit 1); exit 1; }
++ # Remove the trailing spaces.
++ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
++
++_ACEOF
++
++# Transform confdefs.h into two sed scripts, `conftest.defines' and
++# `conftest.undefs', that substitutes the proper values into
++# config.h.in to produce config.h. The first handles `#define'
++# templates, and the second `#undef' templates.
++# And first: Protect against being on the right side of a sed subst in
++# config.status. Protect against being in an unquoted here document
++# in config.status.
++rm -f conftest.defines conftest.undefs
++# Using a here document instead of a string reduces the quoting nightmare.
++# Putting comments in sed scripts is not portable.
++#
++# `end' is used to avoid that the second main sed command (meant for
++# 0-ary CPP macros) applies to n-ary macro definitions.
++# See the Autoconf documentation for `clear'.
++cat >confdef2sed.sed <<\_ACEOF
++s/[\\&,]/\\&/g
++s,[\\$`],\\&,g
++t clear
++: clear
++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
++t end
++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
++: end
++_ACEOF
++# If some macros were called several times there might be several times
++# the same #defines, which is useless. Nevertheless, we may not want to
++# sort them, since we want the *last* AC-DEFINE to be honored.
++uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
++sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
++rm -f confdef2sed.sed
+
+ # This sed command replaces #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.
+-cat >> conftest.vals <<\EOF
+-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+-EOF
+-
+-# Break up conftest.vals because some shells have a limit on
+-# the size of here documents, and old seds have small limits too.
+-
++cat >>conftest.undefs <<\_ACEOF
++s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
++_ACEOF
++
++# Break up conftest.defines because some shells have a limit on the size
++# of here documents, and old seds have small limits too (100 cmds).
++echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
++echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
++echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
++echo ' :' >>$CONFIG_STATUS
++rm -f conftest.tail
++while grep . conftest.defines >/dev/null
++do
++ # Write a limited-size here document to $tmp/defines.sed.
++ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
++ # Speed up: don't consider the non `#define' lines.
++ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
++ # Work around the forget-to-reset-the-flag bug.
++ echo 't clr' >>$CONFIG_STATUS
++ echo ': clr' >>$CONFIG_STATUS
++ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
++ echo 'CEOF
++ sed -f $tmp/defines.sed $tmp/in >$tmp/out
++ rm -f $tmp/in
++ mv $tmp/out $tmp/in
++' >>$CONFIG_STATUS
++ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
++ rm -f conftest.defines
++ mv conftest.tail conftest.defines
++done
++rm -f conftest.defines
++echo ' fi # grep' >>$CONFIG_STATUS
++echo >>$CONFIG_STATUS
++
++# Break up conftest.undefs because some shells have a limit on the size
++# of here documents, and old seds have small limits too (100 cmds).
++echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+ rm -f conftest.tail
+-while :
++while grep . conftest.undefs >/dev/null
+ do
+- ac_lines=`grep -c . conftest.vals`
+- # grep -c gives empty output for an empty file on some AIX systems.
+- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+- # Write a limited-size here document to conftest.frag.
+- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
++ # Write a limited-size here document to $tmp/undefs.sed.
++ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
++ # Speed up: don't consider the non `#undef'
++ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
++ # Work around the forget-to-reset-the-flag bug.
++ echo 't clr' >>$CONFIG_STATUS
++ echo ': clr' >>$CONFIG_STATUS
++ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+- sed -f conftest.frag conftest.in > conftest.out
+- rm -f conftest.in
+- mv conftest.out conftest.in
+-' >> $CONFIG_STATUS
+- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+- rm -f conftest.vals
+- mv conftest.tail conftest.vals
+-done
+-rm -f conftest.vals
+-
+-cat >> $CONFIG_STATUS <<\EOF
+- rm -f conftest.frag conftest.h
+- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+- cat conftest.in >> conftest.h
+- rm -f conftest.in
+- if cmp -s $ac_file conftest.h 2>/dev/null; then
+- echo "$ac_file is unchanged"
+- rm -f conftest.h
+- else
+- # Remove last slash and all that follows it. Not all systems have dirname.
+- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+- # The file is in a subdirectory.
+- test ! -d "$ac_dir" && mkdir "$ac_dir"
++ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
++ rm -f $tmp/in
++ mv $tmp/out $tmp/in
++' >>$CONFIG_STATUS
++ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
++ rm -f conftest.undefs
++ mv conftest.tail conftest.undefs
++done
++rm -f conftest.undefs
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++ # 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. */
++ if test x"$ac_file" = x-; then
++ echo "/* Generated by configure. */" >$tmp/config.h
++ else
++ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
++ fi
++ cat $tmp/in >>$tmp/config.h
++ rm -f $tmp/in
++ if test x"$ac_file" != x-; then
++ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
++ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
++echo "$as_me: $ac_file is unchanged" >&6;}
++ else
++ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ rm -f $ac_file
++ mv $tmp/config.h $ac_file
+ fi
+- rm -f $ac_file
+- mv conftest.h $ac_file
++ else
++ cat $tmp/config.h
++ rm -f $tmp/config.h
+ fi
+-fi; done
++done
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
+
+-EOF
+-cat >> $CONFIG_STATUS <<EOF
++#
++# CONFIG_COMMANDS section.
++#
++for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
++ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
++ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
++$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_dest" : 'X\(//\)[^/]' \| \
++ X"$ac_dest" : 'X\(//\)$' \| \
++ X"$ac_dest" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_dest" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
++# absolute.
++ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
++ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
++ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
++ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+-EOF
+-cat >> $CONFIG_STATUS <<\EOF
+-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
++ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
++echo "$as_me: executing $ac_dest commands" >&6;}
++ case $ac_dest in
++ default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
++ esac
++done
++_ACEOF
+
+-exit 0
+-EOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++{ (exit 0); exit 0; }
++_ACEOF
+ chmod +x $CONFIG_STATUS
+-rm -fr confdefs* $ac_clean_files
+-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
++ac_clean_files=$ac_clean_files_save
++
++
++# 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 || { (exit 1); exit 1; }
++fi
+
+
+--- linux-atm-2.4.1.orig/ltmain.sh
++++ linux-atm-2.4.1/ltmain.sh
+@@ -49,14 +49,14 @@
+ fi
+
+ # The name of this program.
+-progname=`$echo "$0" | sed 's%^.*/%%'`
++progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+ modename="$progname"
+
+ # Constants.
+ PROGRAM=ltmain.sh
+ PACKAGE=libtool
+-VERSION=1.4
+-TIMESTAMP=" (1.920 2001/04/24 23:26:18)"
++VERSION=1.4.3
++TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
+
+ default_mode=
+ help="Try \`$progname --help' for more information."
+@@ -67,10 +67,19 @@
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+-Xsed='sed -e 1s/^X//'
++Xsed="${SED}"' -e 1s/^X//'
+ sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+-SP2NL='tr \040 \012'
+-NL2SP='tr \015\012 \040\040'
++# test EBCDIC or ASCII
++case `echo A|od -x` in
++ *[Cc]1*) # EBCDIC based system
++ SP2NL="tr '\100' '\n'"
++ NL2SP="tr '\r\n' '\100\100'"
++ ;;
++ *) # Assume ASCII based system
++ SP2NL="tr '\040' '\012'"
++ NL2SP="tr '\015\012' '\040\040'"
++ ;;
++esac
+
+ # NLS nuisances.
+ # Only set LANG and LC_ALL to C if already set.
+@@ -84,6 +93,9 @@
+ save_LANG="$LANG"; LANG=C; export LANG
+ fi
+
++# Make sure IFS has a sensible default
++: ${IFS=" "}
++
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ echo "$modename: not configured to build any kind of library" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+@@ -141,7 +153,7 @@
+ ;;
+
+ --config)
+- sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
++ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ exit 0
+ ;;
+
+@@ -174,6 +186,8 @@
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
++ --preserve-dup-deps) duplicate_deps="yes" ;;
++
+ --quiet | --silent)
+ show=:
+ ;;
+@@ -202,12 +216,17 @@
+ exit 1
+ fi
+
++# If this variable is set in any of the actions, the command in it
++# will be execed at the end. This prevents here-documents from being
++# left over by shells.
++exec_cmd=
++
+ if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ case $nonopt in
+- *cc | *++ | gcc* | *-gcc*)
++ *cc | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+@@ -329,7 +348,7 @@
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+ lastarg=
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
++ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+
+@@ -615,6 +634,10 @@
+ # Now arrange that obj and lo_libobj become the same file
+ $show "(cd $xdir && $LN_S $baseobj $libobj)"
+ if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
++ # Unlock the critical section if it was locked
++ if test "$need_locks" != no; then
++ $run $rm "$lockfile"
++ fi
+ exit 0
+ else
+ error=$?
+@@ -745,6 +768,7 @@
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
++ inst_prefix_dir=
+
+ avoid_version=no
+ dlfiles=
+@@ -875,6 +899,11 @@
+ prev=
+ continue
+ ;;
++ inst_prefix)
++ inst_prefix_dir="$arg"
++ prev=
++ continue
++ ;;
+ release)
+ release="-$arg"
+ prev=
+@@ -976,11 +1005,16 @@
+ continue
+ ;;
+
++ -inst-prefix-dir)
++ prev=inst_prefix
++ continue
++ ;;
++
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+- no/*-*-irix*)
++ no/*-*-irix* | no/*-*-nonstopux*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+@@ -1031,6 +1065,17 @@
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc due to us having libc/libc_r.
++ test "X$arg" = "X-lc" && continue
++ ;;
++ esac
++ elif test "X$arg" = "X-lc_r"; then
++ case $host in
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc_r directly, use -pthread flag.
++ continue
++ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+@@ -1122,7 +1167,7 @@
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+ arg=
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
++ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+@@ -1140,7 +1185,7 @@
+ -Wl,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+ arg=
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
++ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+@@ -1307,9 +1352,11 @@
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+- case "$libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+- esac
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
+ libs="$libs $deplib"
+ done
+ deplibs=
+@@ -1343,7 +1390,7 @@
+ ;;
+ esac
+ for pass in $passes; do
+- if test "$linkmode" = prog; then
++ if test $linkmode = prog; then
+ # Determine which files to process
+ case $pass in
+ dlopen)
+@@ -1360,11 +1407,11 @@
+ found=no
+ case $deplib in
+ -l*)
+- if test "$linkmode" = oldlib && test "$linkmode" = obj; then
++ if test $linkmode = oldlib && test $linkmode = obj; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
+ continue
+ fi
+- if test "$pass" = conv; then
++ if test $pass = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+@@ -1384,7 +1431,7 @@
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
++ test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+@@ -1393,16 +1440,16 @@
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+- test "$pass" = conv && continue
++ test $pass = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+- if test "$pass" = conv; then
++ if test $pass = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+- if test "$pass" = scan; then
++ if test $pass = scan; then
+ deplibs="$deplib $deplibs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ else
+@@ -1417,7 +1464,7 @@
+ continue
+ ;; # -L
+ -R*)
+- if test "$pass" = link; then
++ if test $pass = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+@@ -1430,7 +1477,7 @@
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+- if test "$pass" = conv; then
++ if test $pass = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+@@ -1438,10 +1485,12 @@
+ lib)
+ if test "$deplibs_check_method" != pass_all; then
+ echo
+- echo "*** Warning: This library needs some functionality provided by $deplib."
++ echo "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because the file extensions .$libext of this argument makes me believe"
++ echo "*** that it is just a static archive that I should not used here."
+ else
+ echo
+ echo "*** Warning: Linking the shared library $output against the"
+@@ -1451,7 +1500,7 @@
+ continue
+ ;;
+ prog)
+- if test "$pass" != link; then
++ if test $pass != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+@@ -1462,7 +1511,7 @@
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
++ if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+@@ -1485,7 +1534,7 @@
+ fi
+
+ # Check to see that this really is a libtool archive.
+- if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+@@ -1512,13 +1561,13 @@
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+- { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then
++ { test $linkmode = oldlib && test $linkmode = obj; }; then
+ # Add dl[pre]opened files of deplib
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+- if test "$pass" = conv; then
++ if test $pass = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+@@ -1532,12 +1581,14 @@
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+- case "$tmp_libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+- esac
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+- elif test "$linkmode" != prog && test "$linkmode" != lib; then
++ elif test $linkmode != prog && test $linkmode != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit 1
+ fi
+@@ -1555,7 +1606,7 @@
+ fi
+
+ # This library was specified with -dlopen.
+- if test "$pass" = dlopen; then
++ if test $pass = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit 1
+@@ -1604,7 +1655,7 @@
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+ # This library was specified with -dlpreopen.
+- if test "$pass" = dlpreopen; then
++ if test $pass = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit 1
+@@ -1623,7 +1674,7 @@
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+- if test "$linkmode" = lib; then
++ if test $linkmode = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+@@ -1634,7 +1685,7 @@
+ continue
+ fi
+
+- if test "$linkmode" = prog && test "$pass" != link; then
++ if test $linkmode = prog && test $pass != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+@@ -1657,9 +1708,11 @@
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+- case "$tmp_libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+- esac
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+@@ -1671,7 +1724,7 @@
+ # Link against this shared library
+
+ if test "$linkmode,$pass" = "prog,link" ||
+- { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
++ { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+@@ -1693,7 +1746,7 @@
+ esac
+ ;;
+ esac
+- if test "$linkmode" = prog; then
++ if test $linkmode = prog; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+@@ -1743,14 +1796,14 @@
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+- soname=`echo $soroot | sed -e 's/^.*\///'`
+- newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
++ soname=`echo $soroot | ${SED} -e 's/^.*\///'`
++ newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ $show "extracting exported symbol list from \`$soname'"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$extract_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+@@ -1763,7 +1816,7 @@
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ $show "generating import library for \`$soname'"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$old_archive_from_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+@@ -1777,7 +1830,7 @@
+ linklib=$newlib
+ fi # test -n $old_archive_from_expsyms_cmds
+
+- if test "$linkmode" = prog || test "$mode" != relink; then
++ if test $linkmode = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+@@ -1804,6 +1857,14 @@
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
++ # Try looking first in the location we're being installed to.
++ if test -n "$inst_prefix_dir"; then
++ case "$libdir" in
++ [\/]*)
++ add_dir="-L$inst_prefix_dir$libdir $add_dir"
++ ;;
++ esac
++ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+@@ -1826,7 +1887,7 @@
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+- if test "$linkmode" = prog; then
++ if test $linkmode = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+@@ -1843,7 +1904,7 @@
+ fi
+ fi
+
+- if test "$linkmode" = prog || test "$mode" = relink; then
++ if test $linkmode = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+@@ -1862,10 +1923,18 @@
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
++ # Try looking first in the location we're being installed to.
++ if test -n "$inst_prefix_dir"; then
++ case "$libdir" in
++ [\/]*)
++ add_dir="-L$inst_prefix_dir$libdir $add_dir"
++ ;;
++ esac
++ fi
+ add="-l$name"
+ fi
+
+- if test "$linkmode" = prog; then
++ if test $linkmode = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+@@ -1873,7 +1942,7 @@
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+- elif test "$linkmode" = prog; then
++ elif test $linkmode = prog; then
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+@@ -1903,25 +1972,26 @@
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+- echo "*** Warning: This library needs some functionality provided by $lib."
++ echo "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+- echo "*** Therefore, libtool will create a static module, that should work "
+- echo "*** as long as the dlopening application is linked with the -dlopen flag."
++ echo "*** But as you try to build a module library, libtool will still create "
++ echo "*** a static module, that should work as long as the dlopening application"
++ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+- echo
+- echo "*** However, this would only work if libtool was able to extract symbol"
+- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+- echo "*** not find such a program. So, this module is probably useless."
+- echo "*** \`nm' from GNU binutils and a full rebuild may help."
++ echo
++ echo "*** However, this would only work if libtool was able to extract symbol"
++ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
++ echo "*** not find such a program. So, this module is probably useless."
++ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+- build_libtool_libs=module
+- build_old_libs=yes
++ build_libtool_libs=module
++ build_old_libs=yes
+ else
+- build_libtool_libs=no
++ build_libtool_libs=no
+ fi
+ fi
+ else
+@@ -1932,9 +2002,9 @@
+ fi
+ fi # link shared/static library?
+
+- if test "$linkmode" = lib; then
++ if test $linkmode = lib; then
+ if test -n "$dependency_libs" &&
+- { test "$hardcode_into_libs" != yes || test $build_old_libs = yes ||
++ { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
+ test $link_static = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+@@ -1958,13 +2028,15 @@
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+- case "$tmp_libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+- esac
++ if test "X$duplicate_deps" = "Xyes" ; then
++ case "$tmp_libs " in
++ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ esac
++ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+- if test "$link_all_deplibs" != no; then
++ if test $link_all_deplibs != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+@@ -1986,7 +2058,7 @@
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="-L$absdir/$objdir"
+ else
+- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+@@ -2007,15 +2079,15 @@
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+- if test "$pass" = dlpreopen; then
++ if test $pass = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+- if test "$pass" != dlopen; then
+- test "$pass" != scan && dependency_libs="$newdependency_libs"
+- if test "$pass" != conv; then
++ if test $pass != dlopen; then
++ test $pass != scan && dependency_libs="$newdependency_libs"
++ if test $pass != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+@@ -2073,7 +2145,7 @@
+ deplibs=
+ fi
+ done # for pass
+- if test "$linkmode" = prog; then
++ if test $linkmode = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+@@ -2175,7 +2247,7 @@
+ else
+
+ # Parse the version information argument.
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
++ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+@@ -2250,16 +2322,21 @@
+ versuffix=".$current";
+ ;;
+
+- irix)
++ irix | nonstopux)
+ major=`expr $current - $age + 1`
+- verstring="sgi$major.$revision"
++
++ case $version_type in
++ nonstopux) verstring_prefix=nonstopux ;;
++ *) verstring_prefix=sgi ;;
++ esac
++ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test $loop != 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+- verstring="sgi$major.$iface:$verstring"
++ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+@@ -2273,7 +2350,7 @@
+ ;;
+
+ osf)
+- major=`expr $current - $age`
++ major=.`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+@@ -2312,6 +2389,16 @@
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ verstring="0.0"
++ case $version_type in
++ darwin)
++ # we can't check for "0.0" in archive_cmds due to quoting
++ # problems, so we reset it completely
++ verstring=""
++ ;;
++ *)
++ verstring="0.0"
++ ;;
++ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+@@ -2355,9 +2442,9 @@
+
+ # Eliminate all temporary directories.
+ for path in $notinst_path; do
+- lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
+- deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
+- dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
++ lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
++ deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
++ dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+ done
+
+ if test -n "$xrpath"; then
+@@ -2408,9 +2495,12 @@
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
++ *-*-openbsd* | *-*-freebsd*)
++ # Do not include libc due to us having libc/libc_r.
++ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+- if test "$build_libtool_need_lc" = "yes"; then
++ if test $build_libtool_need_lc = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+@@ -2466,18 +2556,20 @@
+ else
+ droppeddeps=yes
+ echo
+- echo "*** Warning: This library needs some functionality provided by $i."
++ echo "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which I believe you do not have"
++ echo "*** because a test_compile did reveal that the linker did not use it for"
++ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+- # Error occured in the first compile. Let's try to salvage the situation:
+- # Compile a seperate program for each library.
++ # Error occured in the first compile. Let's try to salvage
++ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+@@ -2496,10 +2588,12 @@
+ else
+ droppeddeps=yes
+ echo
+- echo "*** Warning: This library needs some functionality provided by $i."
++ echo "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because a test_compile did reveal that the linker did not use this one"
++ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ else
+ droppeddeps=yes
+@@ -2538,14 +2632,14 @@
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+- potliblink=`ls -ld $potlib | sed 's/.* -> //'`
++ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+- | sed 10q \
++ | ${SED} 10q \
+ | egrep "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+@@ -2556,10 +2650,17 @@
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+- echo "*** Warning: This library needs some functionality provided by $a_deplib."
++ echo "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because I did check the linker path looking for a file starting"
++ if test -z "$potlib" ; then
++ echo "*** with $libname but no candidates were found. (...for file magic test)"
++ else
++ echo "*** with $libname and none of the candidates passed a file format test"
++ echo "*** using a file magic. Last file checked: $potlib"
++ fi
+ fi
+ else
+ # Add a -L argument.
+@@ -2578,8 +2679,9 @@
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
++ potlib="$potent_lib" # see symlink-check below in file_magic test
+ if eval echo \"$potent_lib\" 2>/dev/null \
+- | sed 10q \
++ | ${SED} 10q \
+ | egrep "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+@@ -2590,10 +2692,17 @@
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+- echo "*** Warning: This library needs some functionality provided by $a_deplib."
++ echo "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+- echo "*** shared version of the library, which you do not appear to have."
++ echo "*** shared version of the library, which you do not appear to have"
++ echo "*** because I did check the linker path looking for a file starting"
++ if test -z "$potlib" ; then
++ echo "*** with $libname but no candidates were found. (...for regex pattern test)"
++ else
++ echo "*** with $libname and none of the candidates passed a file format test"
++ echo "*** using a regex pattern. Last file checked: $potlib"
++ fi
+ fi
+ else
+ # Add a -L argument.
+@@ -2683,7 +2792,7 @@
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+- if test "$hardcode_into_libs" = yes; then
++ if test $hardcode_into_libs = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+@@ -2784,7 +2893,7 @@
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ eval cmds=\"$export_symbols_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -2858,9 +2967,20 @@
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
++ save_deplibs="$deplibs"
++ for conv in $convenience; do
++ tmp_deplibs=
++ for test_deplib in $deplibs; do
++ if test "$test_deplib" != "$conv"; then
++ tmp_deplibs="$tmp_deplibs $test_deplib"
++ fi
++ done
++ deplibs="$tmp_deplibs"
++ done
+ eval cmds=\"$archive_cmds\"
++ deplibs="$save_deplibs"
+ fi
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -2988,7 +3108,7 @@
+
+ output="$obj"
+ eval cmds=\"$reload_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -3024,7 +3144,7 @@
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ eval cmds=\"$reload_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -3057,7 +3177,7 @@
+
+ prog)
+ case $host in
+- *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
++ *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+@@ -3079,6 +3199,13 @@
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
++ case $host in
++ *darwin*)
++ # Don't allow lazy linking, it breaks C++ global constructors
++ compile_command="$compile_command ${wl}-bind_at_load"
++ finalize_command="$finalize_command ${wl}-bind_at_load"
++ ;;
++ esac
+ ;;
+ esac
+
+@@ -3245,9 +3372,9 @@
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+- $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
++ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+- $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
++ $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+@@ -3255,7 +3382,7 @@
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+- name=`echo "$arg" | sed -e 's%^.*/%%'`
++ name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval 'echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+@@ -3270,7 +3397,13 @@
+ fi
+
+ # Try sorting and uniquifying the output.
+- if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
++ if grep -v "^: " < "$nlist" |
++ if sort -k 3 </dev/null >/dev/null 2>&1; then
++ sort -k 3
++ else
++ sort +2
++ fi |
++ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+@@ -3287,27 +3420,25 @@
+ #undef lt_preloaded_symbols
+
+ #if defined (__STDC__) && __STDC__
+-# define lt_ptr_t void *
++# define lt_ptr void *
+ #else
+-# define lt_ptr_t char *
++# define lt_ptr char *
+ # define const
+ #endif
+
+ /* The mapping between symbol names and symbols. */
+ const struct {
+ const char *name;
+- lt_ptr_t address;
++ lt_ptr address;
+ }
+ lt_preloaded_symbols[] =
+ {\
+ "
+
+- sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
+- -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
+- < "$nlist" >> "$output_objdir/$dlsyms"
++ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+- {0, (lt_ptr_t) 0}
++ {0, (lt_ptr) 0}
+ };
+
+ /* This works around a problem in FreeBSD linker */
+@@ -3494,7 +3625,7 @@
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+- relink_command="cd `pwd`; $relink_command"
++ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+@@ -3514,7 +3645,7 @@
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+- *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
++ *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+@@ -3538,7 +3669,7 @@
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+-Xsed='sed -e 1s/^X//'
++Xsed="${SED}"' -e 1s/^X//'
+ sed_quote_subst='$sed_quote_subst'
+
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
+@@ -3576,7 +3707,7 @@
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+- file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
++ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+@@ -3589,7 +3720,7 @@
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+- file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
++ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+@@ -3603,7 +3734,7 @@
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
++ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+@@ -3618,8 +3749,9 @@
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+- if (eval \$relink_command); then :
++ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
++ $echo \"\$relink_command_output\" >&2
+ $rm \"\$progdir/\$file\"
+ exit 1
+ fi
+@@ -3648,7 +3780,7 @@
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+- # The second colon is a workaround for a bug in BeOS R4 sed
++ # The second colon is a workaround for a bug in BeOS R4 ${SED}
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+@@ -3790,7 +3922,7 @@
+
+ eval cmds=\"$old_archive_cmds\"
+ fi
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -3823,7 +3955,7 @@
+ fi
+ done
+ # Quote the link command for shipping.
+- relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
++ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+
+ # Only create the output if not a dry run.
+@@ -3840,7 +3972,7 @@
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+@@ -3854,7 +3986,7 @@
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+@@ -3865,7 +3997,7 @@
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+@@ -4089,7 +4221,7 @@
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+@@ -4124,12 +4256,30 @@
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
++ # Determine the prefix the user has applied to our future dir.
++ inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
++
++ # Don't allow the user to place us outside of our expected
++ # location b/c this prevents finding dependent libraries that
++ # are installed to the same prefix.
++ if test "$inst_prefix_dir" = "$destdir"; then
++ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
++ exit 1
++ fi
++
++ if test -n "$inst_prefix_dir"; then
++ # Stick the inst_prefix_dir data into the link command.
++ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
++ else
++ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
++ fi
++
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+- continue
++ exit 1
+ fi
+ fi
+
+@@ -4165,7 +4315,7 @@
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ eval cmds=\"$postinstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -4238,19 +4388,27 @@
+ fi
+
+ # Do a test to see if this is really a libtool program.
+- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ case $host in
++ *cygwin*|*mingw*)
++ wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
++ ;;
++ *)
++ wrapper=$file
++ ;;
++ esac
++ if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # If there is no directory component, then add one.
+ case $file in
+- */* | *\\*) . $file ;;
+- *) . ./$file ;;
++ */* | *\\*) . $wrapper ;;
++ *) . ./$wrapper ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+- $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
++ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit 1
+ fi
+
+@@ -4275,8 +4433,8 @@
+ relink_command=
+ # If there is no directory component, then add one.
+ case $file in
+- */* | *\\*) . $file ;;
+- *) . ./$file ;;
++ */* | *\\*) . $wrapper ;;
++ *) . ./$wrapper ;;
+ esac
+
+ outputname=
+@@ -4324,7 +4482,7 @@
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+- destfile=`echo $destfile | sed -e 's,.exe$,,'`
++ destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+@@ -4352,7 +4510,7 @@
+
+ # Do each command in the postinstall commands.
+ eval cmds=\"$old_postinstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -4368,11 +4526,10 @@
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+- exec $SHELL $0 --finish$current_libdirs
+- exit 1
++ exec_cmd='$SHELL $0 --finish$current_libdirs'
++ else
++ exit 0
+ fi
+-
+- exit 0
+ ;;
+
+ # libtool finish mode
+@@ -4391,7 +4548,7 @@
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ eval cmds=\"$finish_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -4473,7 +4630,7 @@
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+@@ -4544,7 +4701,7 @@
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+@@ -4575,11 +4732,8 @@
+ LANG="$save_LANG"; export LANG
+ fi
+
+- # Now actually exec the command.
+- eval "exec \$cmd$args"
+-
+- $echo "$modename: cannot exec \$cmd$args"
+- exit 1
++ # Now prepare to actually exec the command.
++ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+@@ -4641,14 +4795,14 @@
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if (test -L "$file") >/dev/null 2>&1 \
+- || (test -h "$file") >/dev/null 2>&1 \
++ || (test -h "$file") >/dev/null 2>&1 \
+ || test -f "$file"; then
+- :
++ :
+ elif test -d "$file"; then
+- exit_status=1
++ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+- continue
++ continue
+ fi
+
+ rmfiles="$file"
+@@ -4656,7 +4810,7 @@
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+@@ -4670,7 +4824,7 @@
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -4685,7 +4839,7 @@
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ eval cmds=\"$old_postuninstall_cmds\"
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
++ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+@@ -4711,7 +4865,7 @@
+ *)
+ # Do a test to see if this is a libtool program.
+ if test $mode = clean &&
+- (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$file
+
+@@ -4744,11 +4898,18 @@
+ ;;
+ esac
+
+- $echo "$modename: invalid operation mode \`$mode'" 1>&2
+- $echo "$generic_help" 1>&2
+- exit 1
++ if test -z "$exec_cmd"; then
++ $echo "$modename: invalid operation mode \`$mode'" 1>&2
++ $echo "$generic_help" 1>&2
++ exit 1
++ fi
+ fi # test -z "$show_help"
+
++if test -n "$exec_cmd"; then
++ eval exec $exec_cmd
++ exit 1
++fi
++
+ # We need to display help for each of the modes.
+ case $mode in
+ "") $echo \
+--- linux-atm-2.4.1.orig/m4/Makefile.in
++++ linux-atm-2.4.1/m4/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -92,14 +92,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps m4/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -112,6 +112,11 @@
+ subdir = m4
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu m4/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/Makefile.in
++++ linux-atm-2.4.1/src/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -85,8 +85,7 @@
+ VERSION = @VERSION@
+ YACC = @YACC@
+
+-SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \
+- mpoad switch config extra
++SUBDIRS = include lib
+
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../config.h
+@@ -96,14 +95,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -186,7 +185,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -202,6 +201,11 @@
+ subdir = src
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/include/Makefile.in
++++ linux-atm-2.4.1/src/include/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -97,14 +97,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/include/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -142,7 +142,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -158,6 +158,11 @@
+ subdir = src/include
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/include/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/include/atmd.h
++++ linux-atm-2.4.1/src/include/atmd.h
+@@ -24,6 +24,10 @@
+ (i)->prev = (b)->prev; if ((b)->prev) (b)->prev->next = i; else r = i; \
+ (b)->prev = i; } else { (i)->next = r; (i)->prev = NULL; \
+ if (r) (r)->prev = i; r = i; } })
++#define Q_INSERT_BEFORE_TYPED(r,t,i,b) ({ if (b) { (i)->next = b; \
++ (i)->prev = (b)->prev; if ((b)->prev) (b)->prev->next = i; else r = i; \
++ (b)->prev = i; } else { (i)->next = t r; (i)->prev = NULL; \
++ if (t r) (t r)->prev = i; r = i; } })
+ #define Q_REMOVE(r,i) ({ if ((i)->next) (i)->next->prev = (i)->prev; \
+ if ((i)->prev) (i)->prev->next = (i)->next; else r = (i)->next; })
+
+--- linux-atm-2.4.1.orig/src/lib/Makefile.in
++++ linux-atm-2.4.1/src/lib/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -92,16 +92,10 @@
+ # ATMLIBS_VERSION comes from configure.in in the toplevel directory
+ LDFLAGS = -version-info @LIBVER_CURRENT@:@LIBVER_REVISION@:@LIBVER_AGE@
+
+-libatm_la_SOURCES = text2atm.c atm2text.c atmequal.c sdu2cell.c text2qos.c \
+- qos2text.c qosequal.c sap2text.c text2sap.c sapequal.c \
+- misc.c atmres.h ans.c \
+- common.c diag.c kptr.c text2ip.c timer.c unix.c
++libatm_la_SOURCES = text2atm.c atm2text.c atmequal.c sdu2cell.c text2qos.c qos2text.c qosequal.c sap2text.c text2sap.c sapequal.c misc.c atmres.h ans.c common.c diag.c kptr.c text2ip.c timer.c unix.c
+
+ libatm_la_LIBADD = -lresolv
+-libatm_la_DEPENDENCIES = $(top_builddir)/src/include/atm.h \
+- $(top_builddir)/src/include/atmsap.h \
+- $(top_builddir)/src/include/stdint.h \
+- $(top_builddir)/src/include/atmd.h
++libatm_la_DEPENDENCIES = $(top_builddir)/src/include/atm.h $(top_builddir)/src/include/atmsap.h $(top_builddir)/src/include/stdint.h $(top_builddir)/src/include/atmd.h
+
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../../config.h
+@@ -126,8 +120,13 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/ans.P .deps/atm2text.P .deps/atmequal.P \
++.deps/common.P .deps/diag.P .deps/kptr.P .deps/misc.P .deps/qos2text.P \
++.deps/qosequal.P .deps/sap2text.P .deps/sapequal.P .deps/sdu2cell.P \
++.deps/text2atm.P .deps/text2ip.P .deps/text2qos.P .deps/text2sap.P \
++.deps/timer.P .deps/unix.P
+ SOURCES = $(libatm_la_SOURCES)
+ OBJECTS = $(libatm_la_OBJECTS)
+
+@@ -135,9 +134,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/lib/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -167,9 +166,6 @@
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -192,9 +188,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -232,7 +225,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -248,6 +241,11 @@
+ subdir = src/lib
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/lib/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -258,48 +256,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-ans.lo ans.o : ans.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h atmres.h
+-atm2text.lo atm2text.o : atm2text.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h atmres.h
+-atmequal.lo atmequal.o : atmequal.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h
+-common.lo common.o : common.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atmd.h ../../src/include/atm.h
+-diag.lo diag.o : diag.c ../../config.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h
+-kptr.lo kptr.o : kptr.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h
+-misc.lo misc.o : misc.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmsap.h
+-qos2text.lo qos2text.o : qos2text.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h
+-qosequal.lo qosequal.o : qosequal.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h
+-sap2text.lo sap2text.o : sap2text.c ../../config.h \
+- ../../src/include/atmsap.h ../../src/include/stdint.h \
+- ../../src/include/atm.h
+-sapequal.lo sapequal.o : sapequal.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h \
+- ../../src/include/atmsap.h
+-sdu2cell.lo sdu2cell.o : sdu2cell.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h
+-text2atm.lo text2atm.o : text2atm.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h \
+- ../../src/include/atmsap.h atmres.h
+-text2ip.lo text2ip.o : text2ip.c ../../config.h \
+- ../../src/include/stdint.h ../../src/include/atm.h \
+- ../../src/include/atmd.h
+-text2qos.lo text2qos.o : text2qos.c ../../config.h \
+- ../../src/include/atm.h ../../src/include/stdint.h
+-text2sap.lo text2sap.o : text2sap.c ../../config.h \
+- ../../src/include/atmsap.h ../../src/include/stdint.h \
+- ../../src/include/atm.h
+-timer.lo timer.o : timer.c ../../config.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h
+-unix.lo unix.o : unix.c ../../config.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -337,27 +325,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-libLTLIBRARIES distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -369,12 +357,13 @@
+ distclean-compile clean-compile maintainer-clean-compile \
+ mostlyclean-libtool distclean-libtool clean-libtool \
+ maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
+-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
+-check-am installcheck-am installcheck install-exec-am install-exec \
+-install-data-am install-data install-am install uninstall-am uninstall \
+-all-redirect all-am all installdirs mostlyclean-generic \
+-distclean-generic clean-generic maintainer-clean-generic clean \
+-mostlyclean distclean maintainer-clean
++clean-tags maintainer-clean-tags distdir mostlyclean-depend \
++distclean-depend clean-depend maintainer-clean-depend info-am info \
++dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
++install-exec install-data-am install-data install-am install \
++uninstall-am uninstall all-redirect all-am all installdirs \
++mostlyclean-generic distclean-generic clean-generic \
++maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+ #libatm_la_SOURCES = text2atm.c atm2text.c atmequal.c sdu2cell.c text2qos.c \
+--- linux-atm-2.4.1.orig/src/lib/sapequal.c
++++ linux-atm-2.4.1/src/lib/sapequal.c
+@@ -65,6 +65,7 @@
+ CHECK(l2.itu.window,a.l2.itu.window > b.l2.itu.window);
+ break;
+ default:
++ break;
+ }
+ switch (a.l3_proto) {
+ case ATM_L3_X25:
+@@ -83,6 +84,7 @@
+ if (a.l3.user != b.l3.user) return 0;
+ break;
+ default:
++ break;
+ }
+ return 1;
+ }
+--- linux-atm-2.4.1.orig/src/test/Makefile.in
++++ linux-atm-2.4.1/src/test/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -168,8 +168,11 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/align.P .deps/aping.P .deps/aread.P .deps/awrite.P \
++.deps/br.P .deps/bw.P .deps/isp.P .deps/ispl_l.P .deps/ispl_y.P \
++.deps/ttcp.P .deps/window.P
+ SOURCES = $(aread_SOURCES) $(awrite_SOURCES) $(ttcp_atm_SOURCES) $(align_SOURCES) $(aping_SOURCES) $(br_SOURCES) $(bw_SOURCES) $(isp_SOURCES) $(window_SOURCES)
+ OBJECTS = $(aread_OBJECTS) $(awrite_OBJECTS) $(ttcp_atm_OBJECTS) $(align_OBJECTS) $(aping_OBJECTS) $(br_OBJECTS) $(bw_OBJECTS) $(isp_OBJECTS) $(window_OBJECTS)
+
+@@ -177,9 +180,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .l .lo .o .obj .s .y
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/test/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/test/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -218,9 +221,6 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -243,9 +243,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -325,7 +322,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -341,6 +338,11 @@
+ subdir = src/test
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/test/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -351,30 +353,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-align.o: align.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-aping.o: aping.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-aread.o: aread.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-awrite.o: awrite.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-br.o: br.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-bw.o: bw.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-isp.o: isp.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h isp.h \
+- errnos.inc
+-ispl_l.o: ispl_l.c ../../config.h ../../src/include/stdint.h isp.h \
+- ../../src/include/atm.h ispl_y.h
+-ispl_y.o: ispl_y.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h isp.h
+-ttcp.o: ttcp.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmsap.h
+-window.o: window.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -412,21 +422,22 @@
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+ maintainer-clean-generic:
+- -test -z "ispl_llispl_yhispl_yc" || rm -f ispl_ll ispl_yh ispl_yc
++ -test -z "ispl_lcispl_yhispl_yc" || rm -f ispl_lc ispl_yh ispl_yc
+ mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
+ mostlyclean-compile mostlyclean-libtool \
+- mostlyclean-tags mostlyclean-generic
++ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \
+- clean-libtool clean-tags clean-generic mostlyclean-am
++ clean-libtool clean-tags clean-depend clean-generic \
++ mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-binPROGRAMS distclean-noinstPROGRAMS \
+ distclean-compile distclean-libtool distclean-tags \
+- distclean-generic clean-am
++ distclean-depend distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+@@ -434,8 +445,8 @@
+ maintainer-clean-am: maintainer-clean-binPROGRAMS \
+ maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -448,19 +459,22 @@
+ mostlyclean-compile distclean-compile clean-compile \
+ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ isp.o: errnos.inc
+
+ errnos.inc: mkerrnos.pl
+- @PERL@ ./mkerrnos.pl </usr/include/asm/errno.h \
+- >errnos.inc || { rm -f errnos.inc; exit 1; }
++ cpp -I/usr/include/ -dM /usr/include/asm/errno.h | grep "^#define E" \
++ | @PERL@ ./mkerrnos.pl | grep -v EMAXERRNO >errnos.inc \
++ || { rm -f errnos.inc; exit 1; }
+
+ # 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.
+--- linux-atm-2.4.1.orig/src/test/Makefile.am
++++ linux-atm-2.4.1/src/test/Makefile.am
+@@ -26,6 +26,7 @@
+ isp.o: errnos.inc
+
+ errnos.inc: mkerrnos.pl
+- @PERL@ ./mkerrnos.pl </usr/include/asm/errno.h \
+- >errnos.inc || { rm -f errnos.inc; exit 1; }
+-
++ cpp -I/usr/include/ -dM /usr/include/asm/errno.h | grep "^#define E" \
++ | @PERL@ ./mkerrnos.pl | grep -v EMAXERRNO >errnos.inc \
++ || { rm -f errnos.inc; exit 1; }
++
+--- linux-atm-2.4.1.orig/src/test/ttcp.c
++++ linux-atm-2.4.1/src/test/ttcp.c
+@@ -55,6 +55,8 @@
+ /* #define SYSV */ /* required on SGI IRIX releases before 3.3 */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include <signal.h>
+ #include <ctype.h>
+ #include <errno.h>
+@@ -67,6 +69,7 @@
+ #include <sys/time.h> /* struct timeval */
+ #include <atm.h>
+ #include <atmsap.h>
++#include <unistd.h>
+
+ #if defined(SYSV)
+ #include <sys/times.h>
+@@ -85,7 +88,8 @@
+ struct sockaddr_atmsvc satm;
+ struct atm_qos qos;
+
+-int domain, fromlen;
++int domain;
++socklen_t fromlen;
+ int fd; /* fd of network socket */
+
+ int buflen = 8 * 1024; /* length of buffer */
+@@ -120,7 +124,6 @@
+ static struct rusage ru0; /* Resource utilization at the start */
+
+ struct hostent *addr;
+-extern int errno;
+ extern int optind;
+ extern char *optarg;
+
+@@ -158,23 +161,21 @@
+ unsigned long numCalls; /* # of I/O system calls */
+ double cput, realt; /* user, real time (seconds) */
+
+-void err();
+-void mes();
+-int pattern();
+-void prep_timer();
+-double read_timer();
+-int Nread();
+-int Nwrite();
+-void delay();
+-int mread();
+-char *outfmt();
+-static void prusage();
+-static void tvadd();
+-static void tvsub();
+-static void psecs();
++void err(const char *s);
++void mes(const char *s);
++void prep_timer(void);
++void pattern(char *cp, int cnt);
++int Nread(int nfd, char *Nbuf, int count);
++int Nwrite(int nfd, char *Nbuf, int count);
++void delay(int us);
++int mread(int mfd, char *bufp, unsigned n);
++char *outfmt(double b);
++static void prusage(struct rusage *r0, struct rusage *r1, struct timeval *e, struct timeval *b, char *outp);
++static void tvadd(struct timeval *tsum, struct timeval *t0, struct timeval *t1);
++static void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0);
++static void psecs(long l, char *cp);
+
+-void
+-sigpipe()
++void sigpipe(int unused)
+ {
+ }
+
+@@ -183,16 +184,14 @@
+ * main -
+ *-------------------------------------------------------------------------
+ */
+-main(argc,argv)
+-int argc;
+-char **argv;
++int main(int argc,char **argv)
+ {
+ struct timeval td;
+ unsigned long addr_tmp;
+ const char *port_name = NULL,*tos = NULL;
+ int c;
+ double mbps;
+-int no_check = 0;
++ int no_check = 0;
+
+ if (argc < 2) goto usage;
+
+@@ -275,7 +274,7 @@
+ }
+ }
+
+- if (port_name)
++ if (port_name) {
+ if (atm) goto usage;
+ else {
+ struct servent *se;
+@@ -283,13 +282,13 @@
+ se = getservbyname(port_name,udp ? "udp" : "tcp");
+ if (se) port = ntohs(se->s_port);
+ else {
+- const char *end;
++ char *end;
+
+ port = strtoul(port_name,&end,0);
+ if (*end) goto usage;
+ }
+ }
+-
++ }
+ host = argv[optind];
+
+ if (atm) {
+@@ -435,9 +434,9 @@
+ #endif
+
+ if (!atm || satm.sas_family == AF_ATMPVC || !trans)
+- if (bind(fd, atm ? &satm : &sinme, atm ? satm.sas_family == AF_ATMPVC ?
+- sizeof(struct sockaddr_atmpvc) : sizeof(struct sockaddr_atmsvc) :
+- sizeof(sinme)) < 0)
++ if (bind(fd, atm ?
++ (struct sockaddr *)&satm : (struct sockaddr *)&sinme,
++ atm ? satm.sas_family == AF_ATMPVC ? sizeof(struct sockaddr_atmpvc) : sizeof(struct sockaddr_atmsvc) : sizeof(sinme)) < 0)
+ err("bind");
+
+ if (!udp || (atm && satm.sas_family == AF_ATMSVC)) {
+@@ -453,8 +452,8 @@
+ err("setsockopt");
+ }
+
+- if (connect(fd, atm ? &satm : &sinhim, atm ? sizeof(satm) :
+- sizeof(sinhim)) < 0)
++ if (connect(fd,
++ atm ? (struct sockaddr *)&satm : (struct sockaddr *)&sinhim, atm ? sizeof(satm) : sizeof(sinhim)) < 0)
+ err("connect");
+
+ mes("connect");
+@@ -482,13 +481,13 @@
+ fromlen = sizeof(frominet);
+ domain = AF_INET;
+
+- if ((fd=accept(fd, &frominet, &fromlen) ) < 0)
++ if ((fd=accept(fd, (struct sockaddr *)&frominet, &fromlen) ) < 0)
+ err("accept");
+
+ {
+ struct sockaddr_atmsvc peer;
+ int peerlen = sizeof(peer);
+- if (getpeername(fd, (struct sockaddr_in *) &peer,
++ if (getpeername(fd, (struct sockaddr *) &peer,
+ &peerlen) < 0) {
+ err("getpeername");
+ }
+@@ -638,13 +637,13 @@
+ nbytes, cput, outfmt((double)nbytes/cput));
+
+ fprintf(stdout,
+- "ttcp%s: %d I/O calls, msec/call = %.2f, calls/sec = %.2f\n",
++ "ttcp%s: %lu I/O calls, msec/call = %.2f, calls/sec = %.2f\n",
+ trans?"-t":"-r",
+ numCalls,
+ 1000.0 * realt/((double)numCalls),
+ ((double)numCalls)/realt);
+ fprintf(stdout,
+- "ttcp%s: buffer address %#x\n",
++ "ttcp%s: buffer address %p\n",
+ trans?"-t":"-r",
+ buf);
+ }
+@@ -656,8 +655,7 @@
+ }
+
+ void
+-err(s)
+-char *s;
++err(const char *s)
+ {
+ int en = errno;
+
+@@ -670,8 +668,7 @@
+ }
+
+ void
+-mes(s)
+-char *s;
++mes(const char *s)
+ {
+ fprintf(stderr,"ttcp%s: %s\n", trans?"-t":"-r", s);
+ }
+@@ -681,9 +678,7 @@
+ * pattern -
+ *-------------------------------------------------------------------------
+ */
+-pattern(cp, cnt)
+-register char *cp;
+-register int cnt;
++void pattern(char *cp, int cnt)
+ {
+ register char c;
+ c = 0;
+@@ -694,9 +689,7 @@
+ }
+
+
+-char *
+-outfmt(b)
+-double b;
++char *outfmt(double b)
+ {
+ static char obuf[50];
+ switch (fmt) {
+@@ -758,7 +751,7 @@
+ * P R E P _ T I M E R
+ */
+ void
+-prep_timer()
++prep_timer(void)
+ {
+ gettimeofday(&start_time, (struct timezone *)0);
+ getrusage(RUSAGE_SELF, &ru0);
+@@ -768,8 +761,7 @@
+ * read_timer -
+ *-------------------------------------------------------------------------
+ */
+-double read_timer(str,len)
+-char *str;
++double read_timer(char *str,int len)
+ {
+ struct rusage ru1;
+ struct timeval tend, tstart, td;
+@@ -788,15 +780,11 @@
+ return( cput );
+ }
+
+-static void
+-prusage(r0, r1, e, b, outp)
+- register struct rusage *r0, *r1;
+- struct timeval *e, *b;
+- char *outp;
++static void prusage(struct rusage *r0, struct rusage *r1, struct timeval *e, struct timeval *b, char *outp)
+ {
+ struct timeval tdiff;
+ register time_t t;
+- register char *cp;
++ register const char *cp;
+ register int i;
+ int ms;
+
+@@ -823,13 +811,13 @@
+
+ case 'U':
+ tvsub(&tdiff, &r1->ru_utime, &r0->ru_utime);
+- sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000);
++ sprintf(outp,"%ld.%01ld", tdiff.tv_sec, tdiff.tv_usec/100000);
+ END(outp);
+ break;
+
+ case 'S':
+ tvsub(&tdiff, &r1->ru_stime, &r0->ru_stime);
+- sprintf(outp,"%d.%01d", tdiff.tv_sec, tdiff.tv_usec/100000);
++ sprintf(outp,"%ld.%01ld", tdiff.tv_sec, tdiff.tv_usec/100000);
+ END(outp);
+ break;
+
+@@ -851,49 +839,49 @@
+ break;
+
+ case 'X':
+- sprintf(outp,"%d", t == 0 ? 0 : (r1->ru_ixrss-r0->ru_ixrss)/t);
++ sprintf(outp,"%ld", t == 0 ? 0 : (r1->ru_ixrss-r0->ru_ixrss)/t);
+ END(outp);
+ break;
+
+ case 'D':
+- sprintf(outp,"%d", t == 0 ? 0 :
++ sprintf(outp,"%ld", t == 0 ? 0 :
+ (r1->ru_idrss+r1->ru_isrss-(r0->ru_idrss+r0->ru_isrss))/t);
+ END(outp);
+ break;
+
+ case 'K':
+- sprintf(outp,"%d", t == 0 ? 0 :
++ sprintf(outp,"%ld", t == 0 ? 0 :
+ ((r1->ru_ixrss+r1->ru_isrss+r1->ru_idrss) -
+ (r0->ru_ixrss+r0->ru_idrss+r0->ru_isrss))/t);
+ END(outp);
+ break;
+
+ case 'M':
+- sprintf(outp,"%d", r1->ru_maxrss/2);
++ sprintf(outp,"%ld", r1->ru_maxrss/2);
+ END(outp);
+ break;
+
+ case 'F':
+- sprintf(outp,"%d", r1->ru_majflt-r0->ru_majflt);
++ sprintf(outp,"%ld", r1->ru_majflt-r0->ru_majflt);
+ END(outp);
+ break;
+
+ case 'R':
+- sprintf(outp,"%d", r1->ru_minflt-r0->ru_minflt);
++ sprintf(outp,"%ld", r1->ru_minflt-r0->ru_minflt);
+ END(outp);
+ break;
+
+ case 'I':
+- sprintf(outp,"%d", r1->ru_inblock-r0->ru_inblock);
++ sprintf(outp,"%ld", r1->ru_inblock-r0->ru_inblock);
+ END(outp);
+ break;
+
+ case 'O':
+- sprintf(outp,"%d", r1->ru_oublock-r0->ru_oublock);
++ sprintf(outp,"%ld", r1->ru_oublock-r0->ru_oublock);
+ END(outp);
+ break;
+ case 'C':
+- sprintf(outp,"%d+%d", r1->ru_nvcsw-r0->ru_nvcsw,
++ sprintf(outp,"%ld+%ld", r1->ru_nvcsw-r0->ru_nvcsw,
+ r1->ru_nivcsw-r0->ru_nivcsw );
+ END(outp);
+ break;
+@@ -903,9 +891,7 @@
+ *outp = '\0';
+ }
+
+-static void
+-tvadd(tsum, t0, t1)
+- struct timeval *tsum, *t0, *t1;
++static void tvadd(struct timeval *tsum, struct timeval *t0, struct timeval *t1)
+ {
+
+ tsum->tv_sec = t0->tv_sec + t1->tv_sec;
+@@ -919,8 +905,7 @@
+ * tvsub - tdiff = t1 - t0
+ *-------------------------------------------------------------------------
+ */
+-static void tvsub(tdiff, t1, t0)
+- struct timeval *tdiff, *t1, *t0;
++static void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0)
+ {
+
+ tdiff->tv_sec = t1->tv_sec - t0->tv_sec;
+@@ -931,10 +916,7 @@
+ }
+ }
+
+-static void
+-psecs(l,cp)
+-long l;
+-register char *cp;
++static void psecs(long l, char *cp)
+ {
+ register int i;
+
+@@ -958,26 +940,23 @@
+ /*
+ * N R E A D
+ */
+-Nread( fd, buf, count )
+-int fd;
+-char *buf;
+-int count;
++int Nread( int nfd, char *Nbuf, int count )
+ {
+ struct sockaddr_in from;
+ int len = sizeof(from);
+ register int cnt;
+ if( udp ) {
+ #if 0
+- cnt = recvfrom( fd, buf, count, 0, &from, &len );
++ cnt = recvfrom( nfd, Nbuf, count, 0, &from, &len );
+ #else
+- cnt = recv( fd, buf, count, 0);
++ cnt = recv( nfd, Nbuf, count, 0);
+ #endif
+ numCalls++;
+ } else {
+ if( b_flag )
+- cnt = mread( fd, buf, count ); /* fill buf */
++ cnt = mread( nfd, Nbuf, count ); /* fill buf */
+ else {
+- cnt = read( fd, buf, count );
++ cnt = read( nfd, Nbuf, count );
+ numCalls++;
+ }
+ if (touchdata && cnt > 0) {
+@@ -994,17 +973,15 @@
+ * Nwrite -
+ *-------------------------------------------------------------------------
+ */
+-Nwrite(fd, buf, count)
+-int fd;
+-char *buf;
+-int count;
++int Nwrite(int nfd, char *Nbuf, int count)
+ {
+ register int cnt;
+
+ if (udp) {
+ again:
+- if (atm) cnt = write(fd, buf, count);
+- else cnt = sendto(fd, buf, count, 0, &sinhim, sizeof(sinhim));
++ if (atm) cnt = write(nfd, Nbuf, count);
++ else cnt = sendto(nfd, Nbuf, count, 0, (struct sockaddr *)&sinhim,
++ sizeof(sinhim));
+ numCalls++;
+ if ( cnt<0 && errno == ENOBUFS ) {
+ delay(18000);
+@@ -1012,7 +989,7 @@
+ goto again;
+ }
+ } else {
+- cnt = write(fd, buf, count);
++ cnt = write(nfd, Nbuf, count);
+ numCalls++;
+ }
+ if (cnt < 0) perror("WA:write");
+@@ -1020,13 +997,13 @@
+ }
+
+ void
+-delay(us)
++delay(int us)
+ {
+ struct timeval tv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = us;
+- (void)select( 1, (char *)0, (char *)0, (char *)0, &tv );
++ (void)select( 1, NULL, NULL, NULL, &tv );
+ }
+
+ /*
+@@ -1038,17 +1015,13 @@
+ * network connections don't deliver data with the same
+ * grouping as it is written with. Written by Robert S. Miles, BRL.
+ */
+-int
+-mread(fd, bufp, n)
+-int fd;
+-register char *bufp;
+-unsigned n;
++int mread(int mfd, char *bufp, unsigned n)
+ {
+ register unsigned count = 0;
+ register int nread;
+
+ do {
+- nread = read(fd, bufp, n-count);
++ nread = read(mfd, bufp, n-count);
+ numCalls++;
+ if(nread < 0) {
+ perror("ttcp_mread");
+--- linux-atm-2.4.1.orig/src/debug/Makefile.in
++++ linux-atm-2.4.1/src/debug/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -129,8 +129,9 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/delay.P .deps/svctor.P
+ SOURCES = $(delay_SOURCES) $(svctor_SOURCES)
+ OBJECTS = $(delay_OBJECTS) $(svctor_OBJECTS)
+
+@@ -138,9 +139,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/debug/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/debug/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -154,9 +155,6 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -179,9 +177,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -224,7 +219,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -240,6 +235,11 @@
+ subdir = src/debug
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/debug/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -250,11 +250,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-delay.o: delay.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-svctor.o: svctor.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -291,27 +318,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-noinstPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -322,12 +349,14 @@
+ mostlyclean-compile distclean-compile clean-compile \
+ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/qgen/Makefile.in
++++ linux-atm-2.4.1/src/qgen/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -88,8 +88,7 @@
+ noinst_PROGRAMS = qgen q.dump # q40.out.o
+ check_PROGRAMS = q.test
+
+-qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c \
+- qgen.h second.c third.c
++qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c qgen.h second.c third.c
+
+ qgen_LDADD = -lfl
+
+@@ -108,17 +107,10 @@
+
+ EXTRA_DIST = ql_y.h incl.pl mknl.pl msg.fmt TODO
+
+-CLEANFILES = q.out.h q.out.c q.test.c qd.out.h qd.out.c qd.dump.c qd.test.c \
+- default.nl # q40.out.h q40.out.c q40.test.c
++CLEANFILES = q.out.h q.out.c q.test.c qd.out.h qd.out.c qd.dump.c qd.test.c default.nl # q40.out.h q40.out.c q40.test.c
+
+
+-NLS = atm_ai_msg atm_ai_ie atm_loc atm_cv atm_pu atm_na atm_cond atm_ie \
+- atm_msg atm_np atm_ton atm_sat atm_prs atm_scrn atm_vpa atm_poe \
+- q2931_cs atm_td atm_bc atm_tc atm_stc atm_upcc q2931_proto atm_flag \
+- atm_aalp atm_fd atm_tag atm_l2 atm_l3 atm_tt atm_mc atm_hl atm_imd \
+- atm_tdl atm_tni atm_nip atm_shi atm_oci atm_unfm atm_ofi atm_irs \
+- atm_it atm_lit atm_lsi atm_tcs atm_css atm_eqo atm_eqp atm_aap \
+- atm_asp atm_tor
++NLS = atm_ai_msg atm_ai_ie atm_loc atm_cv atm_pu atm_na atm_cond atm_ie atm_msg atm_np atm_ton atm_sat atm_prs atm_scrn atm_vpa atm_poe q2931_cs atm_td atm_bc atm_tc atm_stc atm_upcc q2931_proto atm_flag atm_aalp atm_fd atm_tag atm_l2 atm_l3 atm_tt atm_mc atm_hl atm_imd atm_tdl atm_tni atm_nip atm_shi atm_oci atm_unfm atm_ofi atm_irs atm_it atm_lit atm_lsi atm_tcs atm_css atm_eqo atm_eqp atm_aap atm_asp atm_tor
+
+ SYMFILES = uni.h $(shell @PERL@ incl.pl $(CFLAGS) linux/atmsap.h)
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+@@ -155,8 +147,11 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/common.P .deps/file.P .deps/first.P .deps/qgen.P \
++.deps/ql_l.P .deps/ql_y.P .deps/qlib.P .deps/qtest.P .deps/second.P \
++.deps/third.P
+ SOURCES = $(q_test_SOURCES) $(qgen_SOURCES) $(q_dump_SOURCES) $(EXTRA_q_dump_SOURCES)
+ OBJECTS = $(q_test_OBJECTS) $(qgen_OBJECTS) $(q_dump_OBJECTS)
+
+@@ -164,9 +159,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .l .lo .o .obj .s .y
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/qgen/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/qgen/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -189,9 +184,6 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -214,9 +206,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -272,7 +261,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -288,6 +277,11 @@
+ subdir = src/qgen
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/qgen/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -298,15 +292,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-common.o: common.c ../../config.h common.h
+-file.o: file.c ../../config.h common.h file.h
+-first.o: first.c ../../config.h common.h qgen.h file.h
+-qgen.o: qgen.c ../../config.h common.h file.h qgen.h
+-ql_l.o: ql_l.c ../../config.h common.h qgen.h ql_y.h
+-ql_y.o: ql_y.c ../../config.h common.h qgen.h file.h
+-second.o: second.c ../../config.h common.h qgen.h file.h
+-third.o: third.c ../../config.h common.h qgen.h file.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -344,21 +361,22 @@
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+ maintainer-clean-generic:
+- -test -z "ql_llql_yhql_yc" || rm -f ql_ll ql_yh ql_yc
++ -test -z "ql_lcql_yhql_yc" || rm -f ql_lc ql_yh ql_yc
+ mostlyclean-am: mostlyclean-checkPROGRAMS mostlyclean-noinstPROGRAMS \
+ mostlyclean-compile mostlyclean-libtool \
+- mostlyclean-tags mostlyclean-generic
++ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-checkPROGRAMS clean-noinstPROGRAMS clean-compile \
+- clean-libtool clean-tags clean-generic mostlyclean-am
++ clean-libtool clean-tags clean-depend clean-generic \
++ mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-checkPROGRAMS distclean-noinstPROGRAMS \
+ distclean-compile distclean-libtool distclean-tags \
+- distclean-generic clean-am
++ distclean-depend distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+@@ -366,8 +384,8 @@
+ maintainer-clean-am: maintainer-clean-checkPROGRAMS \
+ maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -380,12 +398,14 @@
+ mostlyclean-compile distclean-compile clean-compile \
+ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ default.nl: mknl.pl $(SYMFILES)
+--- linux-atm-2.4.1.orig/src/qgen/ql_l.c
++++ linux-atm-2.4.1/src/qgen/ql_l.c
+@@ -1,32 +1,85 @@
+-/* A lexical scanner generated by flex */
+
+-/* Scanner skeleton version:
+- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
+- */
++#line 3 "lex.yy.c"
++
++#define YY_INT_ALIGNED short int
++
++/* A lexical scanner generated by flex */
+
+ #define FLEX_SCANNER
+ #define YY_FLEX_MAJOR_VERSION 2
+ #define YY_FLEX_MINOR_VERSION 5
++#define YY_FLEX_SUBMINOR_VERSION 31
++#if YY_FLEX_SUBMINOR_VERSION > 0
++#define FLEX_BETA
++#endif
+
++/* First, we deal with platform-specific or compiler-specific issues. */
++
++/* begin standard C headers. */
+ #include <stdio.h>
+-#include <unistd.h>
++#include <string.h>
++#include <errno.h>
++#include <stdlib.h>
+
++/* end standard C headers. */
+
+-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+-#ifdef c_plusplus
+-#ifndef __cplusplus
+-#define __cplusplus
++/* flex integer type definitions */
++
++#ifndef FLEXINT_H
++#define FLEXINT_H
++
++/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
++
++#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
++#include <inttypes.h>
++typedef int8_t flex_int8_t;
++typedef uint8_t flex_uint8_t;
++typedef int16_t flex_int16_t;
++typedef uint16_t flex_uint16_t;
++typedef int32_t flex_int32_t;
++typedef uint32_t flex_uint32_t;
++#else
++typedef signed char flex_int8_t;
++typedef short int flex_int16_t;
++typedef int flex_int32_t;
++typedef unsigned char flex_uint8_t;
++typedef unsigned short int flex_uint16_t;
++typedef unsigned int flex_uint32_t;
++#endif /* ! C99 */
++
++/* Limits of integral types. */
++#ifndef INT8_MIN
++#define INT8_MIN (-128)
++#endif
++#ifndef INT16_MIN
++#define INT16_MIN (-32767-1)
++#endif
++#ifndef INT32_MIN
++#define INT32_MIN (-2147483647-1)
+ #endif
++#ifndef INT8_MAX
++#define INT8_MAX (127)
++#endif
++#ifndef INT16_MAX
++#define INT16_MAX (32767)
++#endif
++#ifndef INT32_MAX
++#define INT32_MAX (2147483647)
++#endif
++#ifndef UINT8_MAX
++#define UINT8_MAX (255U)
++#endif
++#ifndef UINT16_MAX
++#define UINT16_MAX (65535U)
++#endif
++#ifndef UINT32_MAX
++#define UINT32_MAX (4294967295U)
+ #endif
+
++#endif /* ! FLEXINT_H */
+
+ #ifdef __cplusplus
+
+-#include <stdlib.h>
+-
+-/* Use prototypes in function declarations. */
+-#define YY_USE_PROTOS
+-
+ /* The "const" storage-class-modifier is valid. */
+ #define YY_USE_CONST
+
+@@ -34,34 +87,17 @@
+
+ #if __STDC__
+
+-#define YY_USE_PROTOS
+ #define YY_USE_CONST
+
+ #endif /* __STDC__ */
+ #endif /* ! __cplusplus */
+
+-#ifdef __TURBOC__
+- #pragma warn -rch
+- #pragma warn -use
+-#include <io.h>
+-#include <stdlib.h>
+-#define YY_USE_CONST
+-#define YY_USE_PROTOS
+-#endif
+-
+ #ifdef YY_USE_CONST
+ #define yyconst const
+ #else
+ #define yyconst
+ #endif
+
+-
+-#ifdef YY_USE_PROTOS
+-#define YY_PROTO(proto) proto
+-#else
+-#define YY_PROTO(proto) ()
+-#endif
+-
+ /* Returned upon end-of-file. */
+ #define YY_NULL 0
+
+@@ -76,71 +112,71 @@
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+-#define BEGIN yy_start = 1 + 2 *
++#define BEGIN (yy_start) = 1 + 2 *
+
+ /* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+-#define YY_START ((yy_start - 1) / 2)
++#define YY_START (((yy_start) - 1) / 2)
+ #define YYSTATE YY_START
+
+ /* Action number for EOF rule of a given start state. */
+ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+ /* Special action meaning "start processing a new file". */
+-#define YY_NEW_FILE yyrestart( yyin )
++#define YY_NEW_FILE yyrestart(yyin )
+
+ #define YY_END_OF_BUFFER_CHAR 0
+
+ /* Size of default input buffer. */
++#ifndef YY_BUF_SIZE
+ #define YY_BUF_SIZE 16384
++#endif
+
++#ifndef YY_TYPEDEF_YY_BUFFER_STATE
++#define YY_TYPEDEF_YY_BUFFER_STATE
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
++#endif
+
+ extern int yyleng;
++
+ extern FILE *yyin, *yyout;
+
+ #define EOB_ACT_CONTINUE_SCAN 0
+ #define EOB_ACT_END_OF_FILE 1
+ #define EOB_ACT_LAST_MATCH 2
+
+-/* The funky do-while in the following #define is used to turn the definition
+- * int a single C statement (which needs a semi-colon terminator). This
+- * avoids problems with code like:
+- *
+- * if ( condition_holds )
+- * yyless( 5 );
+- * else
+- * do_something_else();
+- *
+- * Prior to using the do-while the compiler would get upset at the
+- * "else" because it interpreted the "if" statement as being all
+- * done when it reached the ';' after the yyless() call.
+- */
+-
+-/* Return all but the first 'n' matched characters back to the input stream. */
+-
++ #define YY_LESS_LINENO(n)
++
++/* Return all but the first "n" matched characters back to the input stream. */
+ #define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+- *yy_cp = yy_hold_char; \
++ int yyless_macro_arg = (n); \
++ YY_LESS_LINENO(yyless_macro_arg);\
++ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+- yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
++ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+-#define unput(c) yyunput( c, yytext_ptr )
++#define unput(c) yyunput( c, (yytext_ptr) )
+
+ /* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+-typedef unsigned int yy_size_t;
+
++#ifndef YY_TYPEDEF_YY_SIZE_T
++#define YY_TYPEDEF_YY_SIZE_T
++typedef unsigned int yy_size_t;
++#endif
+
++#ifndef YY_STRUCT_YY_BUFFER_STATE
++#define YY_STRUCT_YY_BUFFER_STATE
+ struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+@@ -177,12 +213,16 @@
+ */
+ int yy_at_bol;
+
++ int yy_bs_lineno; /**< The line count. */
++ int yy_bs_column; /**< The column count. */
++
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
++
+ #define YY_BUFFER_NEW 0
+ #define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+@@ -196,23 +236,33 @@
+ * just pointing yyin at a new input file.
+ */
+ #define YY_BUFFER_EOF_PENDING 2
++
+ };
++#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+-static YY_BUFFER_STATE yy_current_buffer = 0;
++/* Stack of input buffers. */
++static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
++static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
++static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+ /* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
++ *
++ * Returns the top of the stack, or NULL.
+ */
+-#define YY_CURRENT_BUFFER yy_current_buffer
++#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
++ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
++ : NULL)
+
++/* Same as previous macro, but useful when we know that the buffer stack is not
++ * NULL or when we need an lvalue. For internal use only.
++ */
++#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+ /* yy_hold_char holds the character lost when yytext is formed. */
+ static char yy_hold_char;
+-
+ static int yy_n_chars; /* number of characters read into yy_ch_buf */
+-
+-
+ int yyleng;
+
+ /* Points to current character in buffer. */
+@@ -225,66 +275,92 @@
+ */
+ static int yy_did_buffer_switch_on_eof;
+
+-void yyrestart YY_PROTO(( FILE *input_file ));
+-
+-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+-void yy_load_buffer_state YY_PROTO(( void ));
+-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+-
+-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+-
+-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+-static void yy_flex_free YY_PROTO(( void * ));
++void yyrestart (FILE *input_file );
++void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
++YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
++void yy_delete_buffer (YY_BUFFER_STATE b );
++void yy_flush_buffer (YY_BUFFER_STATE b );
++void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
++void yypop_buffer_state (void );
++
++static void yyensure_buffer_stack (void );
++static void yy_load_buffer_state (void );
++static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
++
++#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
++
++YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
++YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
++YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
++
++void *yyalloc (yy_size_t );
++void *yyrealloc (void *,yy_size_t );
++void yyfree (void * );
+
+ #define yy_new_buffer yy_create_buffer
+
+ #define yy_set_interactive(is_interactive) \
+ { \
+- if ( ! yy_current_buffer ) \
+- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+- yy_current_buffer->yy_is_interactive = is_interactive; \
++ if ( ! YY_CURRENT_BUFFER ){ \
++ yyensure_buffer_stack (); \
++ YY_CURRENT_BUFFER_LVALUE = \
++ yy_create_buffer(yyin,YY_BUF_SIZE ); \
++ } \
++ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+ #define yy_set_bol(at_bol) \
+ { \
+- if ( ! yy_current_buffer ) \
+- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+- yy_current_buffer->yy_at_bol = at_bol; \
++ if ( ! YY_CURRENT_BUFFER ){\
++ yyensure_buffer_stack (); \
++ YY_CURRENT_BUFFER_LVALUE = \
++ yy_create_buffer(yyin,YY_BUF_SIZE ); \
++ } \
++ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
++#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
++
++/* Begin user sect3 */
+
+ typedef unsigned char YY_CHAR;
++
+ FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
++
+ typedef int yy_state_type;
++
++extern int yylineno;
++
++int yylineno = 1;
++
+ extern char *yytext;
+ #define yytext_ptr yytext
+
+-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+-static int yy_get_next_buffer YY_PROTO(( void ));
+-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
++static yy_state_type yy_get_previous_state (void );
++static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
++static int yy_get_next_buffer (void );
++static void yy_fatal_error (yyconst char msg[] );
+
+ /* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+ #define YY_DO_BEFORE_ACTION \
+- yytext_ptr = yy_bp; \
+- yyleng = (int) (yy_cp - yy_bp); \
+- yy_hold_char = *yy_cp; \
++ (yytext_ptr) = yy_bp; \
++ yyleng = (size_t) (yy_cp - yy_bp); \
++ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+- yy_c_buf_p = yy_cp;
++ (yy_c_buf_p) = yy_cp;
+
+ #define YY_NUM_RULES 16
+ #define YY_END_OF_BUFFER 17
+-static yyconst short int yy_accept[70] =
++/* This struct is not used in this scanner,
++ but its presence is necessary. */
++struct yy_trans_info
++ {
++ flex_int32_t yy_verify;
++ flex_int32_t yy_nxt;
++ };
++static yyconst flex_int16_t yy_accept[70] =
+ { 0,
+ 10, 10, 17, 15, 10, 10, 15, 15, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 10, 0, 0,
+@@ -295,7 +371,7 @@
+ 7, 0, 0, 0, 0, 0, 11, 12, 0
+ } ;
+
+-static yyconst int yy_ec[256] =
++static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+@@ -327,14 +403,14 @@
+ 1, 1, 1, 1, 1
+ } ;
+
+-static yyconst int yy_meta[29] =
++static yyconst flex_int32_t yy_meta[29] =
+ { 0,
+ 1, 2, 2, 1, 3, 1, 4, 5, 5, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4
+ } ;
+
+-static yyconst short int yy_base[75] =
++static yyconst flex_int16_t yy_base[75] =
+ { 0,
+ 0, 0, 99, 100, 27, 28, 0, 95, 0, 86,
+ 72, 85, 80, 71, 78, 64, 76, 31, 84, 85,
+@@ -346,7 +422,7 @@
+ 48, 34, 53, 58
+ } ;
+
+-static yyconst short int yy_def[75] =
++static yyconst flex_int16_t yy_def[75] =
+ { 0,
+ 69, 1, 69, 69, 69, 69, 70, 71, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 69, 70, 71,
+@@ -358,7 +434,7 @@
+ 69, 69, 69, 69
+ } ;
+
+-static yyconst short int yy_nxt[129] =
++static yyconst flex_int16_t yy_nxt[129] =
+ { 0,
+ 4, 5, 6, 5, 7, 8, 9, 4, 4, 10,
+ 11, 12, 13, 9, 9, 9, 9, 14, 9, 15,
+@@ -376,7 +452,7 @@
+ 69, 69, 69, 69, 69, 69, 69, 69
+ } ;
+
+-static yyconst short int yy_chk[129] =
++static yyconst flex_int16_t yy_chk[129] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+@@ -397,6 +473,9 @@
+ static yy_state_type yy_last_accepting_state;
+ static char *yy_last_accepting_cpos;
+
++extern int yy_flex_debug;
++int yy_flex_debug = 0;
++
+ /* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+@@ -406,7 +485,6 @@
+ #define YY_RESTORE_YY_MORE_OFFSET
+ char *yytext;
+ #line 1 "ql_l.l"
+-#define INITIAL 0
+ #line 2 "ql_l.l"
+ /* ql.l - Q.2931 data structures description language */
+
+@@ -451,7 +529,21 @@
+ return (*walk)->str;
+ }
+
+-#line 455 "lex.yy.c"
++#line 533 "lex.yy.c"
++
++#define INITIAL 0
++
++#ifndef YY_NO_UNISTD_H
++/* Special case for "unistd.h", since it is non-ANSI. We include it way
++ * down here because we want the user's section 1 to have been scanned first.
++ * The user has a chance to override it with an option.
++ */
++#include <unistd.h>
++#endif
++
++#ifndef YY_EXTRA_TYPE
++#define YY_EXTRA_TYPE void *
++#endif
+
+ /* Macros after this point can all be overridden by user definitions in
+ * section 1.
+@@ -459,65 +551,30 @@
+
+ #ifndef YY_SKIP_YYWRAP
+ #ifdef __cplusplus
+-extern "C" int yywrap YY_PROTO(( void ));
++extern "C" int yywrap (void );
+ #else
+-extern int yywrap YY_PROTO(( void ));
++extern int yywrap (void );
+ #endif
+ #endif
+
+-#ifndef YY_NO_UNPUT
+-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+-#endif
+-
++ static void yyunput (int c,char *buf_ptr );
++
+ #ifndef yytext_ptr
+-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
++static void yy_flex_strncpy (char *,yyconst char *,int );
+ #endif
+
+ #ifdef YY_NEED_STRLEN
+-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
++static int yy_flex_strlen (yyconst char * );
+ #endif
+
+ #ifndef YY_NO_INPUT
++
+ #ifdef __cplusplus
+-static int yyinput YY_PROTO(( void ));
++static int yyinput (void );
+ #else
+-static int input YY_PROTO(( void ));
+-#endif
+-#endif
+-
+-#if YY_STACK_USED
+-static int yy_start_stack_ptr = 0;
+-static int yy_start_stack_depth = 0;
+-static int *yy_start_stack = 0;
+-#ifndef YY_NO_PUSH_STATE
+-static void yy_push_state YY_PROTO(( int new_state ));
+-#endif
+-#ifndef YY_NO_POP_STATE
+-static void yy_pop_state YY_PROTO(( void ));
+-#endif
+-#ifndef YY_NO_TOP_STATE
+-static int yy_top_state YY_PROTO(( void ));
++static int input (void );
+ #endif
+
+-#else
+-#define YY_NO_PUSH_STATE 1
+-#define YY_NO_POP_STATE 1
+-#define YY_NO_TOP_STATE 1
+-#endif
+-
+-#ifdef YY_MALLOC_DECL
+-YY_MALLOC_DECL
+-#else
+-#if __STDC__
+-#ifndef __cplusplus
+-#include <stdlib.h>
+-#endif
+-#else
+-/* Just try to get by without declaring the routines. This will fail
+- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+- * or sizeof(void*) != sizeof(int).
+- */
+-#endif
+ #endif
+
+ /* Amount of stuff to slurp up with each read. */
+@@ -526,7 +583,6 @@
+ #endif
+
+ /* Copy whatever the last rule matched to the standard output. */
+-
+ #ifndef ECHO
+ /* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+@@ -539,9 +595,10 @@
+ */
+ #ifndef YY_INPUT
+ #define YY_INPUT(buf,result,max_size) \
+- if ( yy_current_buffer->yy_is_interactive ) \
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+- int c = '*', n; \
++ int c = '*'; \
++ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+@@ -551,9 +608,22 @@
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+- else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+- && ferror( yyin ) ) \
+- YY_FATAL_ERROR( "input in flex scanner failed" );
++ else \
++ { \
++ errno=0; \
++ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
++ { \
++ if( errno != EINTR) \
++ { \
++ YY_FATAL_ERROR( "input in flex scanner failed" ); \
++ break; \
++ } \
++ errno=0; \
++ clearerr(yyin); \
++ } \
++ }\
++\
++
+ #endif
+
+ /* No semi-colon after return; correct usage is to write "yyterminate();" -
+@@ -574,12 +644,18 @@
+ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+ #endif
+
++/* end tables serialization structures and prototypes */
++
+ /* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+ #ifndef YY_DECL
+-#define YY_DECL int yylex YY_PROTO(( void ))
+-#endif
++#define YY_DECL_IS_OURS 1
++
++extern int yylex (void);
++
++#define YY_DECL int yylex (void)
++#endif /* !YY_DECL */
+
+ /* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+@@ -596,27 +672,29 @@
+ #define YY_RULE_SETUP \
+ YY_USER_ACTION
+
++/** The main scanner function which does all the work.
++ */
+ YY_DECL
+- {
++{
+ register yy_state_type yy_current_state;
+- register char *yy_cp = NULL, *yy_bp = NULL;
++ register char *yy_cp, *yy_bp;
+ register int yy_act;
+-
++
+ #line 47 "ql_l.l"
+
+
+-#line 609 "lex.yy.c"
++#line 687 "lex.yy.c"
+
+- if ( yy_init )
++ if ( (yy_init) )
+ {
+- yy_init = 0;
++ (yy_init) = 0;
+
+ #ifdef YY_USER_INIT
+ YY_USER_INIT;
+ #endif
+
+- if ( ! yy_start )
+- yy_start = 1; /* first start state */
++ if ( ! (yy_start) )
++ (yy_start) = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+@@ -624,34 +702,36 @@
+ if ( ! yyout )
+ yyout = stdout;
+
+- if ( ! yy_current_buffer )
+- yy_current_buffer =
+- yy_create_buffer( yyin, YY_BUF_SIZE );
++ if ( ! YY_CURRENT_BUFFER ) {
++ yyensure_buffer_stack ();
++ YY_CURRENT_BUFFER_LVALUE =
++ yy_create_buffer(yyin,YY_BUF_SIZE );
++ }
+
+- yy_load_buffer_state();
++ yy_load_buffer_state( );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+- yy_cp = yy_c_buf_p;
++ yy_cp = (yy_c_buf_p);
+
+ /* Support of yytext. */
+- *yy_cp = yy_hold_char;
++ *yy_cp = (yy_hold_char);
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+- yy_current_state = yy_start;
++ yy_current_state = (yy_start);
+ yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+- yy_last_accepting_state = yy_current_state;
+- yy_last_accepting_cpos = yy_cp;
++ (yy_last_accepting_state) = yy_current_state;
++ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+@@ -668,24 +748,22 @@
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+- yy_cp = yy_last_accepting_cpos;
+- yy_current_state = yy_last_accepting_state;
++ yy_cp = (yy_last_accepting_cpos);
++ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+-
+ do_action: /* This label is used only to access EOF actions. */
+
+-
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+- *yy_cp = yy_hold_char;
+- yy_cp = yy_last_accepting_cpos;
+- yy_current_state = yy_last_accepting_state;
++ *yy_cp = (yy_hold_char);
++ yy_cp = (yy_last_accepting_cpos);
++ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
+ case 1:
+@@ -735,6 +813,7 @@
+ return TOK_ID; }
+ YY_BREAK
+ case 10:
++/* rule 10 can match eol */
+ YY_RULE_SETUP
+ #line 59 "ql_l.l"
+ lineno += *yytext == '\n';
+@@ -755,6 +834,7 @@
+ return TOK_STRING; }
+ YY_BREAK
+ case 14:
++/* rule 14 can match eol */
+ YY_RULE_SETUP
+ #line 66 "ql_l.l"
+ lineno++;
+@@ -769,33 +849,33 @@
+ #line 69 "ql_l.l"
+ ECHO;
+ YY_BREAK
+-#line 773 "lex.yy.c"
++#line 853 "lex.yy.c"
+ case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+- int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
++ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+- *yy_cp = yy_hold_char;
++ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+- * consistency between yy_current_buffer and our
++ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+- yy_n_chars = yy_current_buffer->yy_n_chars;
+- yy_current_buffer->yy_input_file = yyin;
+- yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
++ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
++ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
++ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+@@ -805,13 +885,13 @@
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+- if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
++ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+- yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
++ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+- yy_current_state = yy_get_previous_state();
++ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+@@ -824,30 +904,30 @@
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+- yy_bp = yytext_ptr + YY_MORE_ADJ;
++ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+- yy_cp = ++yy_c_buf_p;
++ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+- yy_cp = yy_c_buf_p;
++ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+- else switch ( yy_get_next_buffer() )
++ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+- yy_did_buffer_switch_on_eof = 0;
++ (yy_did_buffer_switch_on_eof) = 0;
+
+- if ( yywrap() )
++ if ( yywrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+@@ -858,7 +938,7 @@
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+- yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
++ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+@@ -866,30 +946,30 @@
+
+ else
+ {
+- if ( ! yy_did_buffer_switch_on_eof )
++ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+- yy_c_buf_p =
+- yytext_ptr + yy_amount_of_matched_text;
++ (yy_c_buf_p) =
++ (yytext_ptr) + yy_amount_of_matched_text;
+
+- yy_current_state = yy_get_previous_state();
++ yy_current_state = yy_get_previous_state( );
+
+- yy_cp = yy_c_buf_p;
+- yy_bp = yytext_ptr + YY_MORE_ADJ;
++ yy_cp = (yy_c_buf_p);
++ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+- yy_c_buf_p =
+- &yy_current_buffer->yy_ch_buf[yy_n_chars];
++ (yy_c_buf_p) =
++ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+- yy_current_state = yy_get_previous_state();
++ yy_current_state = yy_get_previous_state( );
+
+- yy_cp = yy_c_buf_p;
+- yy_bp = yytext_ptr + YY_MORE_ADJ;
++ yy_cp = (yy_c_buf_p);
++ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+@@ -900,8 +980,7 @@
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+- } /* end of yylex */
+-
++} /* end of yylex */
+
+ /* yy_get_next_buffer - try to read in a new buffer
+ *
+@@ -910,21 +989,20 @@
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+-
+-static int yy_get_next_buffer()
+- {
+- register char *dest = yy_current_buffer->yy_ch_buf;
+- register char *source = yytext_ptr;
++static int yy_get_next_buffer (void)
++{
++ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
++ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+- if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
++ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+- if ( yy_current_buffer->yy_fill_buffer == 0 )
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+- if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
++ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+@@ -944,34 +1022,30 @@
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+- number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
++ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+- if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
++ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+- yy_current_buffer->yy_n_chars = yy_n_chars = 0;
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+- int num_to_read =
+- yy_current_buffer->yy_buf_size - number_to_move - 1;
++ size_t num_to_read =
++ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+-#ifdef YY_USES_REJECT
+- YY_FATAL_ERROR(
+-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+-#else
+
+ /* just a shorter name for the current buffer */
+- YY_BUFFER_STATE b = yy_current_buffer;
++ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+- (int) (yy_c_buf_p - b->yy_ch_buf);
++ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+@@ -984,8 +1058,7 @@
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+- yy_flex_realloc( (void *) b->yy_ch_buf,
+- b->yy_buf_size + 2 );
++ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+@@ -995,35 +1068,35 @@
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+- yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
++ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+- num_to_read = yy_current_buffer->yy_buf_size -
++ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+-#endif
++
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+- YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+- yy_n_chars, num_to_read );
++ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
++ (yy_n_chars), num_to_read );
+
+- yy_current_buffer->yy_n_chars = yy_n_chars;
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+- if ( yy_n_chars == 0 )
++ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+- yyrestart( yyin );
++ yyrestart(yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+- yy_current_buffer->yy_buffer_status =
++ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+@@ -1031,32 +1104,31 @@
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+- yy_n_chars += number_to_move;
+- yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+- yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
++ (yy_n_chars) += number_to_move;
++ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
++ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+- yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
++ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+- }
+-
++}
+
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
+
+-static yy_state_type yy_get_previous_state()
+- {
++ static yy_state_type yy_get_previous_state (void)
++{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
++
++ yy_current_state = (yy_start);
+
+- yy_current_state = yy_start;
+-
+- for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
++ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+- yy_last_accepting_state = yy_current_state;
+- yy_last_accepting_cpos = yy_cp;
++ (yy_last_accepting_state) = yy_current_state;
++ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+@@ -1068,30 +1140,23 @@
+ }
+
+ return yy_current_state;
+- }
+-
++}
+
+ /* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+-
+-#ifdef YY_USE_PROTOS
+-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+-#else
+-static yy_state_type yy_try_NUL_trans( yy_current_state )
+-yy_state_type yy_current_state;
+-#endif
+- {
++ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
++{
+ register int yy_is_jam;
+- register char *yy_cp = yy_c_buf_p;
++ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+- yy_last_accepting_state = yy_current_state;
+- yy_last_accepting_cpos = yy_cp;
++ (yy_last_accepting_state) = yy_current_state;
++ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+@@ -1103,80 +1168,73 @@
+ yy_is_jam = (yy_current_state == 69);
+
+ return yy_is_jam ? 0 : yy_current_state;
+- }
+-
++}
+
+-#ifndef YY_NO_UNPUT
+-#ifdef YY_USE_PROTOS
+-static void yyunput( int c, register char *yy_bp )
+-#else
+-static void yyunput( c, yy_bp )
+-int c;
+-register char *yy_bp;
+-#endif
+- {
+- register char *yy_cp = yy_c_buf_p;
++ static void yyunput (int c, register char * yy_bp )
++{
++ register char *yy_cp;
++
++ yy_cp = (yy_c_buf_p);
+
+ /* undo effects of setting up yytext */
+- *yy_cp = yy_hold_char;
++ *yy_cp = (yy_hold_char);
+
+- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
++ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+- register int number_to_move = yy_n_chars + 2;
+- register char *dest = &yy_current_buffer->yy_ch_buf[
+- yy_current_buffer->yy_buf_size + 2];
++ register int number_to_move = (yy_n_chars) + 2;
++ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
++ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+- &yy_current_buffer->yy_ch_buf[number_to_move];
++ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+- while ( source > yy_current_buffer->yy_ch_buf )
++ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+- yy_current_buffer->yy_n_chars =
+- yy_n_chars = yy_current_buffer->yy_buf_size;
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
++ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+- if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
++ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
++ (yytext_ptr) = yy_bp;
++ (yy_hold_char) = *yy_cp;
++ (yy_c_buf_p) = yy_cp;
++}
+
+- yytext_ptr = yy_bp;
+- yy_hold_char = *yy_cp;
+- yy_c_buf_p = yy_cp;
+- }
+-#endif /* ifndef YY_NO_UNPUT */
+-
+-
++#ifndef YY_NO_INPUT
+ #ifdef __cplusplus
+-static int yyinput()
++ static int yyinput (void)
+ #else
+-static int input()
++ static int input (void)
+ #endif
+- {
+- int c;
+
+- *yy_c_buf_p = yy_hold_char;
++{
++ int c;
++
++ *(yy_c_buf_p) = (yy_hold_char);
+
+- if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
++ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+- if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
++ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+- *yy_c_buf_p = '\0';
++ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+- int offset = yy_c_buf_p - yytext_ptr;
+- ++yy_c_buf_p;
++ int offset = (yy_c_buf_p) - (yytext_ptr);
++ ++(yy_c_buf_p);
+
+- switch ( yy_get_next_buffer() )
++ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+@@ -1190,16 +1248,16 @@
+ */
+
+ /* Reset buffer status. */
+- yyrestart( yyin );
++ yyrestart(yyin );
+
+- /* fall through */
++ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+- if ( yywrap() )
++ if ( yywrap( ) )
+ return EOF;
+
+- if ( ! yy_did_buffer_switch_on_eof )
++ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ #ifdef __cplusplus
+ return yyinput();
+@@ -1209,90 +1267,92 @@
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+- yy_c_buf_p = yytext_ptr + offset;
++ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
+
+- c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+- *yy_c_buf_p = '\0'; /* preserve yytext */
+- yy_hold_char = *++yy_c_buf_p;
+-
++ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
++ *(yy_c_buf_p) = '\0'; /* preserve yytext */
++ (yy_hold_char) = *++(yy_c_buf_p);
+
+ return c;
+- }
+-
+-
+-#ifdef YY_USE_PROTOS
+-void yyrestart( FILE *input_file )
+-#else
+-void yyrestart( input_file )
+-FILE *input_file;
+-#endif
+- {
+- if ( ! yy_current_buffer )
+- yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
++}
++#endif /* ifndef YY_NO_INPUT */
+
+- yy_init_buffer( yy_current_buffer, input_file );
+- yy_load_buffer_state();
++/** Immediately switch to a different input stream.
++ * @param input_file A readable stream.
++ *
++ * @note This function does not reset the start condition to @c INITIAL .
++ */
++ void yyrestart (FILE * input_file )
++{
++
++ if ( ! YY_CURRENT_BUFFER ){
++ yyensure_buffer_stack ();
++ YY_CURRENT_BUFFER_LVALUE =
++ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
+
++ yy_init_buffer(YY_CURRENT_BUFFER,input_file );
++ yy_load_buffer_state( );
++}
+
+-#ifdef YY_USE_PROTOS
+-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+-#else
+-void yy_switch_to_buffer( new_buffer )
+-YY_BUFFER_STATE new_buffer;
+-#endif
+- {
+- if ( yy_current_buffer == new_buffer )
++/** Switch to a different input buffer.
++ * @param new_buffer The new input buffer.
++ *
++ */
++ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
++{
++
++ /* TODO. We should be able to replace this entire function body
++ * with
++ * yypop_buffer_state();
++ * yypush_buffer_state(new_buffer);
++ */
++ yyensure_buffer_stack ();
++ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+- if ( yy_current_buffer )
++ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+- *yy_c_buf_p = yy_hold_char;
+- yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+- yy_current_buffer->yy_n_chars = yy_n_chars;
++ *(yy_c_buf_p) = (yy_hold_char);
++ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+- yy_current_buffer = new_buffer;
+- yy_load_buffer_state();
++ YY_CURRENT_BUFFER_LVALUE = new_buffer;
++ yy_load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+- yy_did_buffer_switch_on_eof = 1;
+- }
+-
+-
+-#ifdef YY_USE_PROTOS
+-void yy_load_buffer_state( void )
+-#else
+-void yy_load_buffer_state()
+-#endif
+- {
+- yy_n_chars = yy_current_buffer->yy_n_chars;
+- yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+- yyin = yy_current_buffer->yy_input_file;
+- yy_hold_char = *yy_c_buf_p;
+- }
++ (yy_did_buffer_switch_on_eof) = 1;
++}
+
++static void yy_load_buffer_state (void)
++{
++ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
++ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
++ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
++ (yy_hold_char) = *(yy_c_buf_p);
++}
+
+-#ifdef YY_USE_PROTOS
+-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+-#else
+-YY_BUFFER_STATE yy_create_buffer( file, size )
+-FILE *file;
+-int size;
+-#endif
+- {
++/** Allocate and initialize an input buffer state.
++ * @param file A readable stream.
++ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
++ *
++ * @return the allocated buffer state.
++ */
++ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
++{
+ YY_BUFFER_STATE b;
+-
+- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
++
++ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+@@ -1301,75 +1361,75 @@
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+- b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
++ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+- yy_init_buffer( b, file );
++ yy_init_buffer(b,file );
+
+ return b;
+- }
+-
++}
+
+-#ifdef YY_USE_PROTOS
+-void yy_delete_buffer( YY_BUFFER_STATE b )
+-#else
+-void yy_delete_buffer( b )
+-YY_BUFFER_STATE b;
+-#endif
+- {
++/** Destroy the buffer.
++ * @param b a buffer created with yy_create_buffer()
++ *
++ */
++ void yy_delete_buffer (YY_BUFFER_STATE b )
++{
++
+ if ( ! b )
+ return;
+
+- if ( b == yy_current_buffer )
+- yy_current_buffer = (YY_BUFFER_STATE) 0;
++ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
++ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+- yy_flex_free( (void *) b->yy_ch_buf );
++ yyfree((void *) b->yy_ch_buf );
+
+- yy_flex_free( (void *) b );
+- }
+-
+-
+-
+-#ifdef YY_USE_PROTOS
+-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+-#else
+-void yy_init_buffer( b, file )
+-YY_BUFFER_STATE b;
+-FILE *file;
+-#endif
++ yyfree((void *) b );
++}
+
++#ifndef __cplusplus
++extern int isatty (int );
++#endif /* __cplusplus */
++
++/* Initializes or reinitializes a buffer.
++ * This function is sometimes called more than once on the same buffer,
++ * such as during a yyrestart() or at EOF.
++ */
++ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
+
+- {
+- yy_flush_buffer( b );
++{
++ int oerrno = errno;
++
++ yy_flush_buffer(b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+-#if YY_ALWAYS_INTERACTIVE
+- b->yy_is_interactive = 1;
+-#else
+-#if YY_NEVER_INTERACTIVE
+- b->yy_is_interactive = 0;
+-#else
+- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+-#endif
+-#endif
+- }
+-
++ /* If b is the current buffer, then yy_init_buffer was _probably_
++ * called from yyrestart() or through yy_get_next_buffer.
++ * In that case, we don't want to reset the lineno or column.
++ */
++ if (b != YY_CURRENT_BUFFER){
++ b->yy_bs_lineno = 1;
++ b->yy_bs_column = 0;
++ }
+
+-#ifdef YY_USE_PROTOS
+-void yy_flush_buffer( YY_BUFFER_STATE b )
+-#else
+-void yy_flush_buffer( b )
+-YY_BUFFER_STATE b;
+-#endif
++ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
++
++ errno = oerrno;
++}
+
+- {
+- if ( ! b )
++/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
++ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
++ *
++ */
++ void yy_flush_buffer (YY_BUFFER_STATE b )
++{
++ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+@@ -1386,29 +1446,121 @@
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+- if ( b == yy_current_buffer )
+- yy_load_buffer_state();
++ if ( b == YY_CURRENT_BUFFER )
++ yy_load_buffer_state( );
++}
++
++/** Pushes the new state onto the stack. The new state becomes
++ * the current state. This function will allocate the stack
++ * if necessary.
++ * @param new_buffer The new state.
++ *
++ */
++void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
++{
++ if (new_buffer == NULL)
++ return;
++
++ yyensure_buffer_stack();
++
++ /* This block is copied from yy_switch_to_buffer. */
++ if ( YY_CURRENT_BUFFER )
++ {
++ /* Flush out information for old buffer. */
++ *(yy_c_buf_p) = (yy_hold_char);
++ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
++ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
++ }
++
++ /* Only push if top exists. Otherwise, replace top. */
++ if (YY_CURRENT_BUFFER)
++ (yy_buffer_stack_top)++;
++ YY_CURRENT_BUFFER_LVALUE = new_buffer;
++
++ /* copied from yy_switch_to_buffer. */
++ yy_load_buffer_state( );
++ (yy_did_buffer_switch_on_eof) = 1;
++}
++
++/** Removes and deletes the top of the stack, if present.
++ * The next element becomes the new top.
++ *
++ */
++void yypop_buffer_state (void)
++{
++ if (!YY_CURRENT_BUFFER)
++ return;
++
++ yy_delete_buffer(YY_CURRENT_BUFFER );
++ YY_CURRENT_BUFFER_LVALUE = NULL;
++ if ((yy_buffer_stack_top) > 0)
++ --(yy_buffer_stack_top);
++
++ if (YY_CURRENT_BUFFER) {
++ yy_load_buffer_state( );
++ (yy_did_buffer_switch_on_eof) = 1;
+ }
++}
+
++/* Allocates the stack if it does not exist.
++ * Guarantees space for at least one push.
++ */
++static void yyensure_buffer_stack (void)
++{
++ int num_to_alloc;
++
++ if (!(yy_buffer_stack)) {
++
++ /* First allocation is just for 2 elements, since we don't know if this
++ * scanner will even need a stack. We use 2 instead of 1 to avoid an
++ * immediate realloc on the next call.
++ */
++ num_to_alloc = 1;
++ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
++ (num_to_alloc * sizeof(struct yy_buffer_state*)
++ );
++
++ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
++
++ (yy_buffer_stack_max) = num_to_alloc;
++ (yy_buffer_stack_top) = 0;
++ return;
++ }
+
+-#ifndef YY_NO_SCAN_BUFFER
+-#ifdef YY_USE_PROTOS
+-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+-#else
+-YY_BUFFER_STATE yy_scan_buffer( base, size )
+-char *base;
+-yy_size_t size;
+-#endif
+- {
+- YY_BUFFER_STATE b;
++ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
++
++ /* Increase the buffer to prepare for a possible push. */
++ int grow_size = 8 /* arbitrary grow size */;
+
++ num_to_alloc = (yy_buffer_stack_max) + grow_size;
++ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
++ ((yy_buffer_stack),
++ num_to_alloc * sizeof(struct yy_buffer_state*)
++ );
++
++ /* zero only the new slots.*/
++ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
++ (yy_buffer_stack_max) = num_to_alloc;
++ }
++}
++
++/** Setup the input buffer state to scan directly from a user-specified character buffer.
++ * @param base the character buffer
++ * @param size the size in bytes of the character buffer
++ *
++ * @return the newly allocated buffer state object.
++ */
++YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
++{
++ YY_BUFFER_STATE b;
++
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+- b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
++ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+@@ -1422,47 +1574,42 @@
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+- yy_switch_to_buffer( b );
++ yy_switch_to_buffer(b );
+
+ return b;
+- }
+-#endif
+-
+-
+-#ifndef YY_NO_SCAN_STRING
+-#ifdef YY_USE_PROTOS
+-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+-#else
+-YY_BUFFER_STATE yy_scan_string( yy_str )
+-yyconst char *yy_str;
+-#endif
+- {
+- int len;
+- for ( len = 0; yy_str[len]; ++len )
+- ;
+-
+- return yy_scan_bytes( yy_str, len );
+- }
+-#endif
++}
+
++/** Setup the input buffer state to scan a string. The next call to yylex() will
++ * scan from a @e copy of @a str.
++ * @param str a NUL-terminated string to scan
++ *
++ * @return the newly allocated buffer state object.
++ * @note If you want to scan bytes that may contain NUL values, then use
++ * yy_scan_bytes() instead.
++ */
++YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
++{
++
++ return yy_scan_bytes(yy_str,strlen(yy_str) );
++}
+
+-#ifndef YY_NO_SCAN_BYTES
+-#ifdef YY_USE_PROTOS
+-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+-#else
+-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+-yyconst char *bytes;
+-int len;
+-#endif
+- {
++/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
++ * scan from a @e copy of @a bytes.
++ * @param bytes the byte buffer to scan
++ * @param len the number of bytes in the buffer pointed to by @a bytes.
++ *
++ * @return the newly allocated buffer state object.
++ */
++YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
++{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+-
++
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+- buf = (char *) yy_flex_alloc( n );
++ buf = (char *) yyalloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+@@ -1471,7 +1618,7 @@
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+- b = yy_scan_buffer( buf, n );
++ b = yy_scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+@@ -1481,148 +1628,164 @@
+ b->yy_is_our_buffer = 1;
+
+ return b;
+- }
+-#endif
+-
++}
+
+-#ifndef YY_NO_PUSH_STATE
+-#ifdef YY_USE_PROTOS
+-static void yy_push_state( int new_state )
+-#else
+-static void yy_push_state( new_state )
+-int new_state;
++#ifndef YY_EXIT_FAILURE
++#define YY_EXIT_FAILURE 2
+ #endif
+- {
+- if ( yy_start_stack_ptr >= yy_start_stack_depth )
+- {
+- yy_size_t new_size;
+
+- yy_start_stack_depth += YY_START_STACK_INCR;
+- new_size = yy_start_stack_depth * sizeof( int );
++static void yy_fatal_error (yyconst char* msg )
++{
++ (void) fprintf( stderr, "%s\n", msg );
++ exit( YY_EXIT_FAILURE );
++}
+
+- if ( ! yy_start_stack )
+- yy_start_stack = (int *) yy_flex_alloc( new_size );
++/* Redefine yyless() so it works in section 3 code. */
+
+- else
+- yy_start_stack = (int *) yy_flex_realloc(
+- (void *) yy_start_stack, new_size );
++#undef yyless
++#define yyless(n) \
++ do \
++ { \
++ /* Undo effects of setting up yytext. */ \
++ int yyless_macro_arg = (n); \
++ YY_LESS_LINENO(yyless_macro_arg);\
++ yytext[yyleng] = (yy_hold_char); \
++ (yy_c_buf_p) = yytext + yyless_macro_arg; \
++ (yy_hold_char) = *(yy_c_buf_p); \
++ *(yy_c_buf_p) = '\0'; \
++ yyleng = yyless_macro_arg; \
++ } \
++ while ( 0 )
+
+- if ( ! yy_start_stack )
+- YY_FATAL_ERROR(
+- "out of memory expanding start-condition stack" );
+- }
++/* Accessor methods (get/set functions) to struct members. */
+
+- yy_start_stack[yy_start_stack_ptr++] = YY_START;
++/** Get the current line number.
++ *
++ */
++int yyget_lineno (void)
++{
++
++ return yylineno;
++}
+
+- BEGIN(new_state);
+- }
+-#endif
++/** Get the input stream.
++ *
++ */
++FILE *yyget_in (void)
++{
++ return yyin;
++}
+
++/** Get the output stream.
++ *
++ */
++FILE *yyget_out (void)
++{
++ return yyout;
++}
+
+-#ifndef YY_NO_POP_STATE
+-static void yy_pop_state()
+- {
+- if ( --yy_start_stack_ptr < 0 )
+- YY_FATAL_ERROR( "start-condition stack underflow" );
++/** Get the length of the current token.
++ *
++ */
++int yyget_leng (void)
++{
++ return yyleng;
++}
+
+- BEGIN(yy_start_stack[yy_start_stack_ptr]);
+- }
+-#endif
++/** Get the current token.
++ *
++ */
+
++char *yyget_text (void)
++{
++ return yytext;
++}
+
+-#ifndef YY_NO_TOP_STATE
+-static int yy_top_state()
+- {
+- return yy_start_stack[yy_start_stack_ptr - 1];
+- }
+-#endif
++/** Set the current line number.
++ * @param line_number
++ *
++ */
++void yyset_lineno (int line_number )
++{
++
++ yylineno = line_number;
++}
+
+-#ifndef YY_EXIT_FAILURE
+-#define YY_EXIT_FAILURE 2
+-#endif
++/** Set the input stream. This does not discard the current
++ * input buffer.
++ * @param in_str A readable stream.
++ *
++ * @see yy_switch_to_buffer
++ */
++void yyset_in (FILE * in_str )
++{
++ yyin = in_str ;
++}
+
+-#ifdef YY_USE_PROTOS
+-static void yy_fatal_error( yyconst char msg[] )
+-#else
+-static void yy_fatal_error( msg )
+-char msg[];
+-#endif
+- {
+- (void) fprintf( stderr, "%s\n", msg );
+- exit( YY_EXIT_FAILURE );
+- }
++void yyset_out (FILE * out_str )
++{
++ yyout = out_str ;
++}
+
++int yyget_debug (void)
++{
++ return yy_flex_debug;
++}
+
++void yyset_debug (int bdebug )
++{
++ yy_flex_debug = bdebug ;
++}
+
+-/* Redefine yyless() so it works in section 3 code. */
++/* yylex_destroy is for both reentrant and non-reentrant scanners. */
++int yylex_destroy (void)
++{
++
++ /* Pop the buffer stack, destroying each element. */
++ while(YY_CURRENT_BUFFER){
++ yy_delete_buffer(YY_CURRENT_BUFFER );
++ YY_CURRENT_BUFFER_LVALUE = NULL;
++ yypop_buffer_state();
++ }
+
+-#undef yyless
+-#define yyless(n) \
+- do \
+- { \
+- /* Undo effects of setting up yytext. */ \
+- yytext[yyleng] = yy_hold_char; \
+- yy_c_buf_p = yytext + n; \
+- yy_hold_char = *yy_c_buf_p; \
+- *yy_c_buf_p = '\0'; \
+- yyleng = n; \
+- } \
+- while ( 0 )
++ /* Destroy the stack itself. */
++ yyfree((yy_buffer_stack) );
++ (yy_buffer_stack) = NULL;
+
++ return 0;
++}
+
+-/* Internal utility routines. */
++/*
++ * Internal utility routines.
++ */
+
+ #ifndef yytext_ptr
+-#ifdef YY_USE_PROTOS
+-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+-#else
+-static void yy_flex_strncpy( s1, s2, n )
+-char *s1;
+-yyconst char *s2;
+-int n;
+-#endif
+- {
++static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
++{
+ register int i;
+- for ( i = 0; i < n; ++i )
++ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+- }
++}
+ #endif
+
+ #ifdef YY_NEED_STRLEN
+-#ifdef YY_USE_PROTOS
+-static int yy_flex_strlen( yyconst char *s )
+-#else
+-static int yy_flex_strlen( s )
+-yyconst char *s;
+-#endif
+- {
++static int yy_flex_strlen (yyconst char * s )
++{
+ register int n;
+- for ( n = 0; s[n]; ++n )
++ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+- }
++}
+ #endif
+
+-
+-#ifdef YY_USE_PROTOS
+-static void *yy_flex_alloc( yy_size_t size )
+-#else
+-static void *yy_flex_alloc( size )
+-yy_size_t size;
+-#endif
+- {
++void *yyalloc (yy_size_t size )
++{
+ return (void *) malloc( size );
+- }
++}
+
+-#ifdef YY_USE_PROTOS
+-static void *yy_flex_realloc( void *ptr, yy_size_t size )
+-#else
+-static void *yy_flex_realloc( ptr, size )
+-void *ptr;
+-yy_size_t size;
+-#endif
+- {
++void *yyrealloc (void * ptr, yy_size_t size )
++{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+@@ -1631,30 +1794,34 @@
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+- }
++}
+
+-#ifdef YY_USE_PROTOS
+-static void yy_flex_free( void *ptr )
+-#else
+-static void yy_flex_free( ptr )
+-void *ptr;
+-#endif
+- {
+- free( ptr );
+- }
++void yyfree (void * ptr )
++{
++ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
++}
+
+-#if YY_MAIN
+-int main()
+- {
+- yylex();
+- return 0;
+- }
++#define YYTABLES_NAME "yytables"
++
++#undef YY_NEW_FILE
++#undef YY_FLUSH_BUFFER
++#undef yy_set_bol
++#undef yy_new_buffer
++#undef yy_set_interactive
++#undef yytext_ptr
++#undef YY_DO_BEFORE_ACTION
++
++#ifdef YY_DECL_IS_OURS
++#undef YY_DECL_IS_OURS
++#undef YY_DECL
+ #endif
+ #line 69 "ql_l.l"
+
+
+-void yyerror(char *s)
++
++void yyerror(const char *s)
+ {
+ fprintf(stderr,"line %d: %s near \"%s\"\n",lineno,s,yytext);
+ exit(1);
+ }
++
+--- linux-atm-2.4.1.orig/src/qgen/ql_y.c
++++ linux-atm-2.4.1/src/qgen/ql_y.c
+@@ -1,21 +1,87 @@
++/* A Bison parser, made by GNU Bison 1.875d. */
+
+-/* A Bison parser, made from ql_y.y
+- by GNU Bison version 1.28 */
++/* Skeleton parser for Yacc-like parsing with Bison,
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+-#define YYBISON 1 /* Identify Bison output. */
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
+
+-#define TOK_BREAK 257
+-#define TOK_CASE 258
+-#define TOK_DEF 259
+-#define TOK_DEFAULT 260
+-#define TOK_LENGTH 261
+-#define TOK_MULTI 262
+-#define TOK_RECOVER 263
+-#define TOK_ABORT 264
+-#define TOK_ID 265
+-#define TOK_INCLUDE 266
+-#define TOK_STRING 267
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
+
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA. */
++
++/* As a special exception, when this file is copied by Bison into a
++ Bison output file, you may use that output file without restriction.
++ This special exception was added by the Free Software Foundation
++ in version 1.24 of Bison. */
++
++/* Written by Richard Stallman by simplifying the original so called
++ ``semantic'' parser. */
++
++/* All symbols defined below should begin with yy or YY, to avoid
++ infringing on user name space. This should be done even for local
++ variables, as they might otherwise be expanded by user macros.
++ There are some unavoidable exceptions within include files to
++ define necessary library symbols; they are noted "INFRINGES ON
++ USER NAME SPACE" below. */
++
++/* Identify Bison output. */
++#define YYBISON 1
++
++/* Skeleton name. */
++#define YYSKELETON_NAME "yacc.c"
++
++/* Pure parsers. */
++#define YYPURE 0
++
++/* Using locations. */
++#define YYLSP_NEEDED 0
++
++
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ TOK_BREAK = 258,
++ TOK_CASE = 259,
++ TOK_DEF = 260,
++ TOK_DEFAULT = 261,
++ TOK_LENGTH = 262,
++ TOK_MULTI = 263,
++ TOK_RECOVER = 264,
++ TOK_ABORT = 265,
++ TOK_ID = 266,
++ TOK_INCLUDE = 267,
++ TOK_STRING = 268
++ };
++#endif
++#define TOK_BREAK 258
++#define TOK_CASE 259
++#define TOK_DEF 260
++#define TOK_DEFAULT 261
++#define TOK_LENGTH 262
++#define TOK_MULTI 263
++#define TOK_RECOVER 264
++#define TOK_ABORT 265
++#define TOK_ID 266
++#define TOK_INCLUDE 267
++#define TOK_STRING 268
++
++
++
++
++/* Copy the first part of user declarations. */
+ #line 1 "ql_y.y"
+
+ /* ql.y - Q.2931 data structures description language */
+@@ -36,6 +102,8 @@
+ #include "qgen.h"
+ #include "file.h"
+
++extern void yyerror(const char *s);
++
+
+ #define MAX_TOKEN 256
+ #define DEFAULT_NAMELIST_FILE "default.nl"
+@@ -77,9 +145,10 @@
+ for (walk = strchr(start,0)-1; walk > start && isspace(*walk); walk--)
+ *walk = 0;
+ if (*start == ':') {
+- if (!(searching = strcmp(start+1,name)))
++ if (!(searching = strcmp(start+1,name))) {
+ if (found) yyerror("multiple entries");
+ else found = 1;
++ }
+ continue;
+ }
+ if (searching) continue;
+@@ -154,8 +223,23 @@
+
+
+
+-#line 139 "ql_y.y"
+-typedef union {
++
++/* Enabling traces. */
++#ifndef YYDEBUG
++# define YYDEBUG 0
++#endif
++
++/* Enabling verbose error messages. */
++#ifdef YYERROR_VERBOSE
++# undef YYERROR_VERBOSE
++# define YYERROR_VERBOSE 1
++#else
++# define YYERROR_VERBOSE 0
++#endif
++
++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
++#line 142 "ql_y.y"
++typedef union YYSTYPE {
+ const char *str;
+ int num;
+ FIELD *field;
+@@ -164,470 +248,762 @@
+ TAG *tag;
+ NAME_LIST *nlist;
+ } YYSTYPE;
+-#include <stdio.h>
++/* Line 191 of yacc.c. */
++#line 253 "y.tab.c"
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
++
++
++
++/* Copy the second part of user declarations. */
++
++
++/* Line 214 of yacc.c. */
++#line 265 "y.tab.c"
++
++#if ! defined (yyoverflow) || YYERROR_VERBOSE
++
++# ifndef YYFREE
++# define YYFREE free
++# endif
++# ifndef YYMALLOC
++# define YYMALLOC malloc
++# endif
++
++/* The parser invokes alloca or malloc; define the necessary symbols. */
++
++# ifdef YYSTACK_USE_ALLOCA
++# if YYSTACK_USE_ALLOCA
++# define YYSTACK_ALLOC alloca
++# endif
++# else
++# if defined (alloca) || defined (_ALLOCA_H)
++# define YYSTACK_ALLOC alloca
++# else
++# ifdef __GNUC__
++# define YYSTACK_ALLOC __builtin_alloca
++# endif
++# endif
++# endif
++
++# ifdef YYSTACK_ALLOC
++ /* Pacify GCC's `empty if-body' warning. */
++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
++# else
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++# define YYSTACK_ALLOC YYMALLOC
++# define YYSTACK_FREE YYFREE
++# endif
++#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
++
++
++#if (! defined (yyoverflow) \
++ && (! defined (__cplusplus) \
++ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
++
++/* A type that is properly aligned for any stack member. */
++union yyalloc
++{
++ short int yyss;
++ YYSTYPE yyvs;
++ };
++
++/* The size of the maximum gap between one aligned stack and the next. */
++# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
++
++/* The size of an array large to enough to hold all stacks, each with
++ N elements. */
++# define YYSTACK_BYTES(N) \
++ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
++ + YYSTACK_GAP_MAXIMUM)
++
++/* Copy COUNT objects from FROM to TO. The source and destination do
++ not overlap. */
++# ifndef YYCOPY
++# if defined (__GNUC__) && 1 < __GNUC__
++# define YYCOPY(To, From, Count) \
++ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
++# else
++# define YYCOPY(To, From, Count) \
++ do \
++ { \
++ register YYSIZE_T yyi; \
++ for (yyi = 0; yyi < (Count); yyi++) \
++ (To)[yyi] = (From)[yyi]; \
++ } \
++ while (0)
++# endif
++# endif
++
++/* Relocate STACK from its old location to the new one. The
++ local variables YYSIZE and YYSTACKSIZE give the old and new number of
++ elements in the stack, and YYPTR gives the new location of the
++ stack. Advance YYPTR to a properly aligned location for the next
++ stack. */
++# define YYSTACK_RELOCATE(Stack) \
++ do \
++ { \
++ YYSIZE_T yynewbytes; \
++ YYCOPY (&yyptr->Stack, Stack, yysize); \
++ Stack = &yyptr->Stack; \
++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
++ yyptr += yynewbytes / sizeof (*yyptr); \
++ } \
++ while (0)
+
+-#ifndef __cplusplus
+-#ifndef __STDC__
+-#define const
+-#endif
+ #endif
+
++#if defined (__STDC__) || defined (__cplusplus)
++ typedef signed char yysigned_char;
++#else
++ typedef short int yysigned_char;
++#endif
+
+-
+-#define YYFINAL 86
+-#define YYFLAG -32768
+-#define YYNTBASE 23
+-
+-#define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 47)
+-
+-static const char yytranslate[] = { 0,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 21, 18, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 22, 2, 17,
+- 14, 19, 2, 20, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 15, 2, 16, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+- 7, 8, 9, 10, 11, 12, 13
++/* YYFINAL -- State number of the termination state. */
++#define YYFINAL 5
++/* YYLAST -- Last index in YYTABLE. */
++#define YYLAST 65
++
++/* YYNTOKENS -- Number of terminals. */
++#define YYNTOKENS 23
++/* YYNNTS -- Number of nonterminals. */
++#define YYNNTS 25
++/* YYNRULES -- Number of rules. */
++#define YYNRULES 46
++/* YYNRULES -- Number of states. */
++#define YYNSTATES 86
++
++/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
++#define YYUNDEFTOK 2
++#define YYMAXUTOK 268
++
++#define YYTRANSLATE(YYX) \
++ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
++
++/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
++static const unsigned char yytranslate[] =
++{
++ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 21, 18, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 22, 2,
++ 17, 14, 19, 2, 20, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 15, 2, 16, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
++ 5, 6, 7, 8, 9, 10, 11, 12, 13
+ };
+
+-#if YYDEBUG != 0
+-static const short yyprhs[] = { 0,
+- 0, 4, 5, 8, 9, 12, 17, 18, 21, 23,
+- 27, 30, 31, 34, 40, 41, 43, 47, 53, 54,
+- 57, 59, 60, 63, 64, 67, 69, 74, 79, 83,
+- 84, 87, 88, 90, 91, 97, 98, 105, 106, 112,
+- 113, 120, 121, 124, 125
++#if YYDEBUG
++/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
++ YYRHS. */
++static const unsigned char yyprhs[] =
++{
++ 0, 0, 3, 7, 8, 11, 12, 15, 20, 21,
++ 24, 26, 30, 33, 34, 37, 43, 44, 46, 50,
++ 56, 57, 60, 62, 63, 66, 67, 70, 72, 77,
++ 82, 86, 87, 90, 91, 93, 94, 100, 101, 108,
++ 109, 115, 116, 123, 124, 127, 128
+ };
+
+-static const short yyrhs[] = { 24,
+- 25, 29, 0, 0, 12, 24, 0, 0, 25, 26,
+- 0, 5, 11, 14, 29, 0, 0, 28, 29, 0,
+- 11, 0, 15, 30, 16, 0, 10, 11, 0, 0,
+- 31, 30, 0, 32, 11, 40, 17, 33, 0, 0,
+- 3, 0, 18, 35, 19, 0, 35, 34, 36, 19,
+- 37, 0, 0, 20, 35, 0, 11, 0, 0, 21,
+- 11, 0, 0, 14, 38, 0, 11, 0, 4, 15,
+- 41, 16, 0, 8, 15, 43, 16, 0, 39, 7,
+- 29, 0, 0, 9, 11, 0, 0, 13, 0, 0,
+- 6, 11, 45, 46, 29, 0, 0, 11, 45, 46,
+- 29, 42, 41, 0, 0, 6, 11, 45, 46, 27,
+- 0, 0, 11, 45, 46, 27, 44, 43, 0, 0,
+- 22, 11, 0, 0, 21, 11, 46, 0
++/* YYRHS -- A `-1'-separated list of the rules' RHS. */
++static const yysigned_char yyrhs[] =
++{
++ 24, 0, -1, 25, 26, 30, -1, -1, 12, 25,
++ -1, -1, 26, 27, -1, 5, 11, 14, 30, -1,
++ -1, 29, 30, -1, 11, -1, 15, 31, 16, -1,
++ 10, 11, -1, -1, 32, 31, -1, 33, 11, 41,
++ 17, 34, -1, -1, 3, -1, 18, 36, 19, -1,
++ 36, 35, 37, 19, 38, -1, -1, 20, 36, -1,
++ 11, -1, -1, 21, 11, -1, -1, 14, 39, -1,
++ 11, -1, 4, 15, 42, 16, -1, 8, 15, 44,
++ 16, -1, 40, 7, 30, -1, -1, 9, 11, -1,
++ -1, 13, -1, -1, 6, 11, 46, 47, 30, -1,
++ -1, 11, 46, 47, 30, 43, 42, -1, -1, 6,
++ 11, 46, 47, 28, -1, -1, 11, 46, 47, 28,
++ 45, 44, -1, -1, 22, 11, -1, -1, 21, 11,
++ 47, -1
+ };
+
+-#endif
+-
+-#if YYDEBUG != 0
+-static const short yyrline[] = { 0,
+- 163, 175, 176, 184, 185, 188, 202, 207, 212, 231,
+- 236, 243, 247, 254, 278, 282, 288, 301, 318, 322,
+- 329, 339, 343, 350, 354, 360, 367, 374, 380, 390,
+- 394, 400, 404, 410, 414, 431, 437, 454, 458, 474,
+- 480, 497, 501, 507, 511
++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
++static const unsigned short int yyrline[] =
++{
++ 0, 167, 167, 178, 179, 187, 188, 192, 206, 206,
++ 216, 234, 239, 247, 250, 258, 282, 285, 292, 304,
++ 323, 326, 334, 344, 347, 355, 358, 365, 371, 378,
++ 384, 395, 398, 405, 408, 415, 418, 436, 435, 459,
++ 462, 479, 478, 502, 505, 512, 515
+ };
+ #endif
+
+-
+-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+-
+-static const char * const yytname[] = { "$","error","$undefined.","TOK_BREAK",
+-"TOK_CASE","TOK_DEF","TOK_DEFAULT","TOK_LENGTH","TOK_MULTI","TOK_RECOVER","TOK_ABORT",
+-"TOK_ID","TOK_INCLUDE","TOK_STRING","'='","'{'","'}'","'<'","'-'","'>'","'@'",
+-"','","':'","all","includes","structures","structure","rep_block","@1","block",
+-"fields","field","opt_break","field_cont","opt_pos","decimal","opt_more","opt_val",
+-"value","opt_recover","opt_name_list","tags","@2","rep_tags","@3","opt_id","list", NULL
++#if YYDEBUG || YYERROR_VERBOSE
++/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
++ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
++static const char *const yytname[] =
++{
++ "$end", "error", "$undefined", "TOK_BREAK", "TOK_CASE", "TOK_DEF",
++ "TOK_DEFAULT", "TOK_LENGTH", "TOK_MULTI", "TOK_RECOVER", "TOK_ABORT",
++ "TOK_ID", "TOK_INCLUDE", "TOK_STRING", "'='", "'{'", "'}'", "'<'", "'-'",
++ "'>'", "'@'", "','", "':'", "$accept", "all", "includes", "structures",
++ "structure", "rep_block", "@1", "block", "fields", "field", "opt_break",
++ "field_cont", "opt_pos", "decimal", "opt_more", "opt_val", "value",
++ "opt_recover", "opt_name_list", "tags", "@2", "rep_tags", "@3", "opt_id",
++ "list", 0
+ };
+ #endif
+
+-static const short yyr1[] = { 0,
+- 23, 24, 24, 25, 25, 26, 28, 27, 29, 29,
+- 29, 30, 30, 31, 32, 32, 33, 33, 34, 34,
+- 35, 36, 36, 37, 37, 38, 38, 38, 38, 39,
+- 39, 40, 40, 41, 41, 42, 41, 43, 43, 44,
+- 43, 45, 45, 46, 46
++# ifdef YYPRINT
++/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
++ token YYLEX-NUM. */
++static const unsigned short int yytoknum[] =
++{
++ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
++ 265, 266, 267, 268, 61, 123, 125, 60, 45, 62,
++ 64, 44, 58
+ };
++# endif
+
+-static const short yyr2[] = { 0,
+- 3, 0, 2, 0, 2, 4, 0, 2, 1, 3,
+- 2, 0, 2, 5, 0, 1, 3, 5, 0, 2,
+- 1, 0, 2, 0, 2, 1, 4, 4, 3, 0,
+- 2, 0, 1, 0, 5, 0, 6, 0, 5, 0,
+- 6, 0, 2, 0, 3
++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
++static const unsigned char yyr1[] =
++{
++ 0, 23, 24, 25, 25, 26, 26, 27, 29, 28,
++ 30, 30, 30, 31, 31, 32, 33, 33, 34, 34,
++ 35, 35, 36, 37, 37, 38, 38, 39, 39, 39,
++ 39, 40, 40, 41, 41, 42, 42, 43, 42, 44,
++ 44, 45, 44, 46, 46, 47, 47
+ };
+
+-static const short yydefact[] = { 2,
+- 2, 4, 3, 0, 0, 0, 9, 12, 5, 1,
+- 0, 11, 16, 0, 12, 0, 0, 10, 13, 32,
+- 6, 33, 0, 0, 21, 0, 14, 19, 0, 0,
+- 22, 17, 20, 0, 0, 23, 24, 30, 18, 0,
+- 0, 0, 26, 25, 0, 34, 38, 31, 0, 0,
+- 42, 0, 0, 42, 0, 29, 42, 0, 44, 27,
+- 42, 44, 28, 44, 43, 0, 0, 44, 7, 0,
+- 44, 36, 7, 40, 0, 35, 45, 34, 39, 38,
+- 8, 37, 41, 0, 0, 0
++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
++static const unsigned char yyr2[] =
++{
++ 0, 2, 3, 0, 2, 0, 2, 4, 0, 2,
++ 1, 3, 2, 0, 2, 5, 0, 1, 3, 5,
++ 0, 2, 1, 0, 2, 0, 2, 1, 4, 4,
++ 3, 0, 2, 0, 1, 0, 5, 0, 6, 0,
++ 5, 0, 6, 0, 2, 0, 3
+ };
+
+-static const short yydefgoto[] = { 84,
+- 2, 4, 9, 74, 75, 10, 14, 15, 16, 27,
+- 31, 28, 35, 39, 44, 45, 23, 52, 78, 55,
+- 80, 59, 67
++/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
++ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
++ means the default is an error. */
++static const unsigned char yydefact[] =
++{
++ 3, 3, 0, 5, 4, 1, 0, 0, 0, 10,
++ 13, 6, 2, 0, 12, 17, 0, 13, 0, 0,
++ 11, 14, 33, 7, 34, 0, 0, 22, 0, 15,
++ 20, 0, 0, 23, 18, 21, 0, 0, 24, 25,
++ 31, 19, 0, 0, 0, 27, 26, 0, 35, 39,
++ 32, 0, 0, 43, 0, 0, 43, 0, 30, 43,
++ 0, 45, 28, 43, 45, 29, 45, 44, 0, 0,
++ 45, 8, 0, 45, 37, 8, 41, 0, 36, 46,
++ 35, 40, 39, 9, 38, 42
+ };
+
+-static const short yypact[] = { -8,
+- -8,-32768,-32768, -4, 3, 17,-32768, -1,-32768,-32768,
+- 20,-32768,-32768, 21, -1, 22, 11,-32768,-32768, 23,
+--32768,-32768, 24, -3,-32768, 27,-32768, 15, 25, 27,
+- 26,-32768,-32768, 28, 29,-32768, 31, 9,-32768, 34,
+- 36, 32,-32768,-32768, 33, 18, 19,-32768, 11, 35,
+- 30, 38, 44, 30, 40,-32768, 30, 46, 39,-32768,
+- 30, 39,-32768, 39,-32768, 48, 11, 39,-32768, 11,
+- 39,-32768,-32768,-32768, 11,-32768,-32768, 18,-32768, 19,
+--32768,-32768,-32768, 42, 61,-32768
++/* YYDEFGOTO[NTERM-NUM]. */
++static const yysigned_char yydefgoto[] =
++{
++ -1, 2, 3, 6, 11, 76, 77, 12, 16, 17,
++ 18, 29, 33, 30, 37, 41, 46, 47, 25, 54,
++ 80, 57, 82, 61, 69
+ };
+
+-static const short yypgoto[] = {-32768,
+- 62,-32768,-32768, -11,-32768, -17, 49,-32768,-32768,-32768,
+--32768, 1,-32768,-32768,-32768,-32768,-32768, -13,-32768, -14,
+--32768, -38, -59
++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
++ STATE-NUM. */
++#define YYPACT_NINF -62
++static const yysigned_char yypact[] =
++{
++ -8, -8, 14, -62, -62, -62, -4, 16, 17, -62,
++ -1, -62, -62, 20, -62, -62, 21, -1, 22, 11,
++ -62, -62, 23, -62, -62, 24, -3, -62, 27, -62,
++ 25, 28, 27, 30, -62, -62, 29, 33, -62, 32,
++ 9, -62, 34, 39, 31, -62, -62, 36, 18, 19,
++ -62, 11, 37, 35, 40, 44, 35, 43, -62, 35,
++ 49, 41, -62, 35, 41, -62, 41, -62, 50, 11,
++ 41, -62, 11, 41, -62, -62, -62, 11, -62, -62,
++ 18, -62, 19, -62, -62, -62
+ };
+
+-
+-#define YYLAST 66
+-
+-
+-static const short yytable[] = { 21,
+- 5, 13, 69, 1, 70, 6, 7, 25, 73, -15,
+- 8, 77, 40, 11, 26, 62, 41, 42, 64, 43,
+- 6, 7, 68, 50, 53, 8, 29, 12, 51, 54,
+- 33, 56, 20, 17, 30, 22, 18, 25, 36, 49,
+- 24, 85, 48, 32, 38, 57, 34, 37, 46, 72,
+- 47, 58, 76, 60, 61, 63, 65, 81, 71, 66,
+- 86, 79, 3, 19, 82, 83
++/* YYPGOTO[NTERM-NUM]. */
++static const yysigned_char yypgoto[] =
++{
++ -62, -62, 38, -62, -62, -31, -62, -19, 46, -62,
++ -62, -62, -62, 3, -62, -62, -62, -62, -62, -16,
++ -62, -17, -62, -40, -61
+ };
+
+-static const short yycheck[] = { 17,
+- 5, 3, 62, 12, 64, 10, 11, 11, 68, 11,
+- 15, 71, 4, 11, 18, 54, 8, 9, 57, 11,
+- 10, 11, 61, 6, 6, 15, 26, 11, 11, 11,
+- 30, 49, 11, 14, 20, 13, 16, 11, 11, 7,
+- 17, 0, 11, 19, 14, 11, 21, 19, 15, 67,
+- 15, 22, 70, 16, 11, 16, 11, 75, 11, 21,
+- 0, 73, 1, 15, 78, 80
++/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
++ positive, shift that token. If negative, reduce the rule which
++ number is the opposite. If zero, do what YYDEFACT says.
++ If YYTABLE_NINF, syntax error. */
++#define YYTABLE_NINF -17
++static const yysigned_char yytable[] =
++{
++ 23, 7, 15, 71, 1, 72, 8, 9, 27, 75,
++ -16, 10, 79, 42, 5, 28, 64, 43, 44, 66,
++ 45, 8, 9, 70, 52, 55, 10, 13, 14, 53,
++ 56, 31, 58, 22, 19, 35, 24, 20, 27, 4,
++ 38, 26, 50, 51, 81, 32, 40, 34, 59, 48,
++ 74, 36, 39, 78, 49, 63, 62, 60, 83, 65,
++ 67, 73, 68, 21, 84, 85
+ };
+-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+-#line 3 "/usr/lib/bison.simple"
+-/* This file comes from bison-1.28. */
+
+-/* Skeleton output parser for bison,
+- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+-
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
+- any later version.
+-
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
+-
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software
+- Foundation, Inc., 59 Temple Place - Suite 330,
+- Boston, MA 02111-1307, USA. */
+-
+-/* As a special exception, when this file is copied by Bison into a
+- Bison output file, you may use that output file without restriction.
+- This special exception was added by the Free Software Foundation
+- in version 1.24 of Bison. */
++static const unsigned char yycheck[] =
++{
++ 19, 5, 3, 64, 12, 66, 10, 11, 11, 70,
++ 11, 15, 73, 4, 0, 18, 56, 8, 9, 59,
++ 11, 10, 11, 63, 6, 6, 15, 11, 11, 11,
++ 11, 28, 51, 11, 14, 32, 13, 16, 11, 1,
++ 11, 17, 11, 7, 75, 20, 14, 19, 11, 15,
++ 69, 21, 19, 72, 15, 11, 16, 22, 77, 16,
++ 11, 11, 21, 17, 80, 82
++};
+
+-/* This is the parser code that is written into each bison parser
+- when the %semantic_parser declaration is not specified in the grammar.
+- It was written by Richard Stallman by simplifying the hairy parser
+- used when %semantic_parser is specified. */
+-
+-#ifndef YYSTACK_USE_ALLOCA
+-#ifdef alloca
+-#define YYSTACK_USE_ALLOCA
+-#else /* alloca not defined */
+-#ifdef __GNUC__
+-#define YYSTACK_USE_ALLOCA
+-#define alloca __builtin_alloca
+-#else /* not GNU C. */
+-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+-#define YYSTACK_USE_ALLOCA
+-#include <alloca.h>
+-#else /* not sparc */
+-/* We think this test detects Watcom and Microsoft C. */
+-/* This used to test MSDOS, but that is a bad idea
+- since that symbol is in the user namespace. */
+-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+-#if 0 /* No need for malloc.h, which pollutes the namespace;
+- instead, just don't use alloca. */
+-#include <malloc.h>
+-#endif
+-#else /* not MSDOS, or __TURBOC__ */
+-#if defined(_AIX)
+-/* I don't know what this was needed for, but it pollutes the namespace.
+- So I turned it off. rms, 2 May 1997. */
+-/* #include <malloc.h> */
+- #pragma alloca
+-#define YYSTACK_USE_ALLOCA
+-#else /* not MSDOS, or __TURBOC__, or _AIX */
+-#if 0
+-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+- and on HPUX 10. Eventually we can turn this on. */
+-#define YYSTACK_USE_ALLOCA
+-#define alloca __builtin_alloca
+-#endif /* __hpux */
+-#endif
+-#endif /* not _AIX */
+-#endif /* not MSDOS, or __TURBOC__ */
+-#endif /* not sparc */
+-#endif /* not GNU C */
+-#endif /* alloca not defined */
+-#endif /* YYSTACK_USE_ALLOCA not defined */
++/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
++ symbol of state STATE-NUM. */
++static const unsigned char yystos[] =
++{
++ 0, 12, 24, 25, 25, 0, 26, 5, 10, 11,
++ 15, 27, 30, 11, 11, 3, 31, 32, 33, 14,
++ 16, 31, 11, 30, 13, 41, 17, 11, 18, 34,
++ 36, 36, 20, 35, 19, 36, 21, 37, 11, 19,
++ 14, 38, 4, 8, 9, 11, 39, 40, 15, 15,
++ 11, 7, 6, 11, 42, 6, 11, 44, 30, 11,
++ 22, 46, 16, 11, 46, 16, 46, 11, 21, 47,
++ 46, 47, 47, 11, 30, 47, 28, 29, 30, 47,
++ 43, 28, 45, 30, 42, 44
++};
+
+-#ifdef YYSTACK_USE_ALLOCA
+-#define YYSTACK_ALLOC alloca
+-#else
+-#define YYSTACK_ALLOC malloc
++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
++# define YYSIZE_T __SIZE_TYPE__
++#endif
++#if ! defined (YYSIZE_T) && defined (size_t)
++# define YYSIZE_T size_t
++#endif
++#if ! defined (YYSIZE_T)
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++#endif
++#if ! defined (YYSIZE_T)
++# define YYSIZE_T unsigned int
+ #endif
+-
+-/* Note: there must be only one dollar sign in this file.
+- It is replaced by the list of actions, each action
+- as one case of the switch. */
+
+ #define yyerrok (yyerrstatus = 0)
+ #define yyclearin (yychar = YYEMPTY)
+-#define YYEMPTY -2
++#define YYEMPTY (-2)
+ #define YYEOF 0
++
+ #define YYACCEPT goto yyacceptlab
+-#define YYABORT goto yyabortlab
+-#define YYERROR goto yyerrlab1
+-/* Like YYERROR except do call yyerror.
+- This remains here temporarily to ease the
+- transition to the new meaning of YYERROR, for GCC.
++#define YYABORT goto yyabortlab
++#define YYERROR goto yyerrorlab
++
++
++/* Like YYERROR except do call yyerror. This remains here temporarily
++ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
++
+ #define YYFAIL goto yyerrlab
++
+ #define YYRECOVERING() (!!yyerrstatus)
+-#define YYBACKUP(token, value) \
++
++#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY && yylen == 1) \
+- { yychar = (token), yylval = (value); \
+- yychar1 = YYTRANSLATE (yychar); \
++ { \
++ yychar = (Token); \
++ yylval = (Value); \
++ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+- { yyerror ("syntax error: cannot back up"); YYERROR; } \
++ { \
++ yyerror ("syntax error: cannot back up");\
++ YYERROR; \
++ } \
+ while (0)
+
+ #define YYTERROR 1
+ #define YYERRCODE 256
+
+-#ifndef YYPURE
+-#define YYLEX yylex()
+-#endif
++/* YYLLOC_DEFAULT -- Compute the default location (before the actions
++ are run). */
+
+-#ifdef YYPURE
+-#ifdef YYLSP_NEEDED
+-#ifdef YYLEX_PARAM
+-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+-#else
+-#define YYLEX yylex(&yylval, &yylloc)
++#ifndef YYLLOC_DEFAULT
++# define YYLLOC_DEFAULT(Current, Rhs, N) \
++ ((Current).first_line = (Rhs)[1].first_line, \
++ (Current).first_column = (Rhs)[1].first_column, \
++ (Current).last_line = (Rhs)[N].last_line, \
++ (Current).last_column = (Rhs)[N].last_column)
+ #endif
+-#else /* not YYLSP_NEEDED */
++
++/* YYLEX -- calling `yylex' with the right arguments. */
++
+ #ifdef YYLEX_PARAM
+-#define YYLEX yylex(&yylval, YYLEX_PARAM)
++# define YYLEX yylex (YYLEX_PARAM)
+ #else
+-#define YYLEX yylex(&yylval)
+-#endif
+-#endif /* not YYLSP_NEEDED */
++# define YYLEX yylex ()
+ #endif
+
+-/* If nonreentrant, generate the variables here */
++/* Enable debugging if requested. */
++#if YYDEBUG
+
+-#ifndef YYPURE
++# ifndef YYFPRINTF
++# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
++# define YYFPRINTF fprintf
++# endif
++
++# define YYDPRINTF(Args) \
++do { \
++ if (yydebug) \
++ YYFPRINTF Args; \
++} while (0)
++
++# define YYDSYMPRINT(Args) \
++do { \
++ if (yydebug) \
++ yysymprint Args; \
++} while (0)
++
++# define YYDSYMPRINTF(Title, Token, Value, Location) \
++do { \
++ if (yydebug) \
++ { \
++ YYFPRINTF (stderr, "%s ", Title); \
++ yysymprint (stderr, \
++ Token, Value); \
++ YYFPRINTF (stderr, "\n"); \
++ } \
++} while (0)
+
+-int yychar; /* the lookahead symbol */
+-YYSTYPE yylval; /* the semantic value of the */
+- /* lookahead symbol */
++/*------------------------------------------------------------------.
++| yy_stack_print -- Print the state stack from its BOTTOM up to its |
++| TOP (included). |
++`------------------------------------------------------------------*/
+
+-#ifdef YYLSP_NEEDED
+-YYLTYPE yylloc; /* location data for the lookahead */
+- /* symbol */
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yy_stack_print (short int *bottom, short int *top)
++#else
++static void
++yy_stack_print (bottom, top)
++ short int *bottom;
++ short int *top;
+ #endif
++{
++ YYFPRINTF (stderr, "Stack now");
++ for (/* Nothing. */; bottom <= top; ++bottom)
++ YYFPRINTF (stderr, " %d", *bottom);
++ YYFPRINTF (stderr, "\n");
++}
+
+-int yynerrs; /* number of parse errors so far */
+-#endif /* not YYPURE */
++# define YY_STACK_PRINT(Bottom, Top) \
++do { \
++ if (yydebug) \
++ yy_stack_print ((Bottom), (Top)); \
++} while (0)
+
+-#if YYDEBUG != 0
+-int yydebug; /* nonzero means print parse trace */
+-/* Since this is uninitialized, it does not stop multiple parsers
+- from coexisting. */
++
++/*------------------------------------------------.
++| Report that the YYRULE is going to be reduced. |
++`------------------------------------------------*/
++
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yy_reduce_print (int yyrule)
++#else
++static void
++yy_reduce_print (yyrule)
++ int yyrule;
+ #endif
++{
++ int yyi;
++ unsigned int yylno = yyrline[yyrule];
++ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
++ yyrule - 1, yylno);
++ /* Print the symbols being reduced, and their result. */
++ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
++ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
++ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
++}
+
+-/* YYINITDEPTH indicates the initial size of the parser's stacks */
++# define YY_REDUCE_PRINT(Rule) \
++do { \
++ if (yydebug) \
++ yy_reduce_print (Rule); \
++} while (0)
++
++/* Nonzero means print parse trace. It is left uninitialized so that
++ multiple parsers can coexist. */
++int yydebug;
++#else /* !YYDEBUG */
++# define YYDPRINTF(Args)
++# define YYDSYMPRINT(Args)
++# define YYDSYMPRINTF(Title, Token, Value, Location)
++# define YY_STACK_PRINT(Bottom, Top)
++# define YY_REDUCE_PRINT(Rule)
++#endif /* !YYDEBUG */
+
++
++/* YYINITDEPTH -- initial size of the parser's stacks. */
+ #ifndef YYINITDEPTH
+-#define YYINITDEPTH 200
++# define YYINITDEPTH 200
+ #endif
+
+-/* YYMAXDEPTH is the maximum size the stacks can grow to
+- (effective only if the built-in stack extension method is used). */
++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
++ if the built-in stack extension method is used).
++
++ Do not make this value too large; the results are undefined if
++ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
++ evaluated with infinite-precision integer arithmetic. */
+
+-#if YYMAXDEPTH == 0
+-#undef YYMAXDEPTH
++#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
++# undef YYMAXDEPTH
+ #endif
+
+ #ifndef YYMAXDEPTH
+-#define YYMAXDEPTH 10000
++# define YYMAXDEPTH 10000
+ #endif
++
+
+-/* Define __yy_memcpy. Note that the size argument
+- should be passed with type unsigned int, because that is what the non-GCC
+- definitions require. With GCC, __builtin_memcpy takes an arg
+- of type size_t, but it can handle unsigned int. */
+-
+-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+-#else /* not GNU C or C++ */
+-#ifndef __cplusplus
+
+-/* This is the most reliable way to avoid incompatibilities
+- in available built-in functions on various systems. */
+-static void
+-__yy_memcpy (to, from, count)
+- char *to;
+- char *from;
+- unsigned int count;
+-{
+- register char *f = from;
+- register char *t = to;
+- register int i = count;
++#if YYERROR_VERBOSE
++
++# ifndef yystrlen
++# if defined (__GLIBC__) && defined (_STRING_H)
++# define yystrlen strlen
++# else
++/* Return the length of YYSTR. */
++static YYSIZE_T
++# if defined (__STDC__) || defined (__cplusplus)
++yystrlen (const char *yystr)
++# else
++yystrlen (yystr)
++ const char *yystr;
++# endif
++{
++ register const char *yys = yystr;
++
++ while (*yys++ != '\0')
++ continue;
+
+- while (i-- > 0)
+- *t++ = *f++;
++ return yys - yystr - 1;
+ }
++# endif
++# endif
+
+-#else /* __cplusplus */
++# ifndef yystpcpy
++# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
++# define yystpcpy stpcpy
++# else
++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
++ YYDEST. */
++static char *
++# if defined (__STDC__) || defined (__cplusplus)
++yystpcpy (char *yydest, const char *yysrc)
++# else
++yystpcpy (yydest, yysrc)
++ char *yydest;
++ const char *yysrc;
++# endif
++{
++ register char *yyd = yydest;
++ register const char *yys = yysrc;
++
++ while ((*yyd++ = *yys++) != '\0')
++ continue;
++
++ return yyd - 1;
++}
++# endif
++# endif
++
++#endif /* !YYERROR_VERBOSE */
++
++
++
++#if YYDEBUG
++/*--------------------------------.
++| Print this symbol on YYOUTPUT. |
++`--------------------------------*/
+
+-/* This is the most reliable way to avoid incompatibilities
+- in available built-in functions on various systems. */
++#if defined (__STDC__) || defined (__cplusplus)
+ static void
+-__yy_memcpy (char *to, char *from, unsigned int count)
++yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
++#else
++static void
++yysymprint (yyoutput, yytype, yyvaluep)
++ FILE *yyoutput;
++ int yytype;
++ YYSTYPE *yyvaluep;
++#endif
+ {
+- register char *t = to;
+- register char *f = from;
+- register int i = count;
++ /* Pacify ``unused variable'' warnings. */
++ (void) yyvaluep;
++
++ if (yytype < YYNTOKENS)
++ {
++ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
++# ifdef YYPRINT
++ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
++# endif
++ }
++ else
++ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+- while (i-- > 0)
+- *t++ = *f++;
++ switch (yytype)
++ {
++ default:
++ break;
++ }
++ YYFPRINTF (yyoutput, ")");
+ }
+
++#endif /* ! YYDEBUG */
++/*-----------------------------------------------.
++| Release the memory associated to this symbol. |
++`-----------------------------------------------*/
++
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yydestruct (int yytype, YYSTYPE *yyvaluep)
++#else
++static void
++yydestruct (yytype, yyvaluep)
++ int yytype;
++ YYSTYPE *yyvaluep;
+ #endif
+-#endif
++{
++ /* Pacify ``unused variable'' warnings. */
++ (void) yyvaluep;
++
++ switch (yytype)
++ {
++
++ default:
++ break;
++ }
++}
+
+-#line 217 "/usr/lib/bison.simple"
+
+-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+- into yyparse. The argument should have type void *.
+- It should actually point to an object.
+- Grammar actions can access the variable by casting it
+- to the proper pointer type. */
++/* Prevent warnings from -Wmissing-prototypes. */
+
+ #ifdef YYPARSE_PARAM
+-#ifdef __cplusplus
+-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+-#define YYPARSE_PARAM_DECL
+-#else /* not __cplusplus */
+-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+-#endif /* not __cplusplus */
+-#else /* not YYPARSE_PARAM */
+-#define YYPARSE_PARAM_ARG
+-#define YYPARSE_PARAM_DECL
+-#endif /* not YYPARSE_PARAM */
++# if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void *YYPARSE_PARAM);
++# else
++int yyparse ();
++# endif
++#else /* ! YYPARSE_PARAM */
++#if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void);
++#else
++int yyparse ();
++#endif
++#endif /* ! YYPARSE_PARAM */
++
++
++
++/* The lookahead symbol. */
++int yychar;
++
++/* The semantic value of the lookahead symbol. */
++YYSTYPE yylval;
++
++/* Number of syntax errors so far. */
++int yynerrs;
++
++
++
++/*----------.
++| yyparse. |
++`----------*/
+
+-/* Prevent warning if -Wstrict-prototypes. */
+-#ifdef __GNUC__
+ #ifdef YYPARSE_PARAM
+-int yyparse (void *);
++# if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void *YYPARSE_PARAM)
++# else
++int yyparse (YYPARSE_PARAM)
++ void *YYPARSE_PARAM;
++# endif
++#else /* ! YYPARSE_PARAM */
++#if defined (__STDC__) || defined (__cplusplus)
++int
++yyparse (void)
+ #else
+-int yyparse (void);
++int
++yyparse ()
++
+ #endif
+ #endif
+-
+-int
+-yyparse(YYPARSE_PARAM_ARG)
+- YYPARSE_PARAM_DECL
+ {
++
+ register int yystate;
+ register int yyn;
+- register short *yyssp;
++ int yyresult;
++ /* Number of tokens to shift before error messages enabled. */
++ int yyerrstatus;
++ /* Lookahead token as an internal (translated) token number. */
++ int yytoken = 0;
++
++ /* Three stacks and their tools:
++ `yyss': related to states,
++ `yyvs': related to semantic values,
++ `yyls': related to locations.
++
++ Refer to the stacks thru separate pointers, to allow yyoverflow
++ to reallocate them elsewhere. */
++
++ /* The state stack. */
++ short int yyssa[YYINITDEPTH];
++ short int *yyss = yyssa;
++ register short int *yyssp;
++
++ /* The semantic value stack. */
++ YYSTYPE yyvsa[YYINITDEPTH];
++ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+- int yyerrstatus; /* number of tokens to shift before error messages enabled */
+- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+- short yyssa[YYINITDEPTH]; /* the state stack */
+- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+-#ifdef YYLSP_NEEDED
+- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+- YYLTYPE *yyls = yylsa;
+- YYLTYPE *yylsp;
+-
+-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+-#else
+ #define YYPOPSTACK (yyvsp--, yyssp--)
+-#endif
+
+- int yystacksize = YYINITDEPTH;
+- int yyfree_stacks = 0;
++ YYSIZE_T yystacksize = YYINITDEPTH;
+
+-#ifdef YYPURE
+- int yychar;
+- YYSTYPE yylval;
+- int yynerrs;
+-#ifdef YYLSP_NEEDED
+- YYLTYPE yylloc;
+-#endif
+-#endif
++ /* The variables used to return semantic value and location from the
++ action routines. */
++ YYSTYPE yyval;
+
+- YYSTYPE yyval; /* the variable used to return */
+- /* semantic values from the action */
+- /* routines */
+
++ /* When reducing, the number of symbols on the RHS of the reduced
++ rule. */
+ int yylen;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Starting parse\n");
+-#endif
++ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+@@ -639,110 +1015,97 @@
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+- yyssp = yyss - 1;
++ yyssp = yyss;
+ yyvsp = yyvs;
+-#ifdef YYLSP_NEEDED
+- yylsp = yyls;
+-#endif
+
+-/* Push a new state, which is found in yystate . */
+-/* In all cases, when you get here, the value and location stacks
+- have just been pushed. so pushing a state here evens the stacks. */
+-yynewstate:
+
+- *++yyssp = yystate;
++ goto yysetstate;
+
+- if (yyssp >= yyss + yystacksize - 1)
+- {
+- /* Give user a chance to reallocate the stack */
+- /* Use copies of these so that the &'s don't force the real ones into memory. */
+- YYSTYPE *yyvs1 = yyvs;
+- short *yyss1 = yyss;
+-#ifdef YYLSP_NEEDED
+- YYLTYPE *yyls1 = yyls;
+-#endif
++/*------------------------------------------------------------.
++| yynewstate -- Push a new state, which is found in yystate. |
++`------------------------------------------------------------*/
++ yynewstate:
++ /* In all cases, when you get here, the value and location stacks
++ have just been pushed. so pushing a state here evens the stacks.
++ */
++ yyssp++;
+
++ yysetstate:
++ *yyssp = yystate;
++
++ if (yyss + yystacksize - 1 <= yyssp)
++ {
+ /* Get the current used size of the three stacks, in elements. */
+- int size = yyssp - yyss + 1;
++ YYSIZE_T yysize = yyssp - yyss + 1;
+
+ #ifdef yyoverflow
+- /* Each stack pointer address is followed by the size of
+- the data in use in that stack, in bytes. */
+-#ifdef YYLSP_NEEDED
+- /* This used to be a conditional around just the two extra args,
+- but that might be undefined if yyoverflow is a macro. */
+- yyoverflow("parser stack overflow",
+- &yyss1, size * sizeof (*yyssp),
+- &yyvs1, size * sizeof (*yyvsp),
+- &yyls1, size * sizeof (*yylsp),
+- &yystacksize);
+-#else
+- yyoverflow("parser stack overflow",
+- &yyss1, size * sizeof (*yyssp),
+- &yyvs1, size * sizeof (*yyvsp),
+- &yystacksize);
+-#endif
+-
+- yyss = yyss1; yyvs = yyvs1;
+-#ifdef YYLSP_NEEDED
+- yyls = yyls1;
+-#endif
++ {
++ /* Give user a chance to reallocate the stack. Use copies of
++ these so that the &'s don't force the real ones into
++ memory. */
++ YYSTYPE *yyvs1 = yyvs;
++ short int *yyss1 = yyss;
++
++
++ /* Each stack pointer address is followed by the size of the
++ data in use in that stack, in bytes. This used to be a
++ conditional around just the two extra args, but that might
++ be undefined if yyoverflow is a macro. */
++ yyoverflow ("parser stack overflow",
++ &yyss1, yysize * sizeof (*yyssp),
++ &yyvs1, yysize * sizeof (*yyvsp),
++
++ &yystacksize);
++
++ yyss = yyss1;
++ yyvs = yyvs1;
++ }
+ #else /* no yyoverflow */
++# ifndef YYSTACK_RELOCATE
++ goto yyoverflowlab;
++# else
+ /* Extend the stack our own way. */
+- if (yystacksize >= YYMAXDEPTH)
+- {
+- yyerror("parser stack overflow");
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
+-#endif
+- }
+- return 2;
+- }
++ if (YYMAXDEPTH <= yystacksize)
++ goto yyoverflowlab;
+ yystacksize *= 2;
+- if (yystacksize > YYMAXDEPTH)
++ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+-#ifndef YYSTACK_USE_ALLOCA
+- yyfree_stacks = 1;
+-#endif
+- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+- __yy_memcpy ((char *)yyss, (char *)yyss1,
+- size * (unsigned int) sizeof (*yyssp));
+- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+- size * (unsigned int) sizeof (*yyvsp));
+-#ifdef YYLSP_NEEDED
+- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+- __yy_memcpy ((char *)yyls, (char *)yyls1,
+- size * (unsigned int) sizeof (*yylsp));
+-#endif
++
++ {
++ short int *yyss1 = yyss;
++ union yyalloc *yyptr =
++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
++ if (! yyptr)
++ goto yyoverflowlab;
++ YYSTACK_RELOCATE (yyss);
++ YYSTACK_RELOCATE (yyvs);
++
++# undef YYSTACK_RELOCATE
++ if (yyss1 != yyssa)
++ YYSTACK_FREE (yyss1);
++ }
++# endif
+ #endif /* no yyoverflow */
+
+- yyssp = yyss + size - 1;
+- yyvsp = yyvs + size - 1;
+-#ifdef YYLSP_NEEDED
+- yylsp = yyls + size - 1;
+-#endif
++ yyssp = yyss + yysize - 1;
++ yyvsp = yyvs + yysize - 1;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+-#endif
+
+- if (yyssp >= yyss + yystacksize - 1)
++ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
++ (unsigned long int) yystacksize));
++
++ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Entering state %d\n", yystate);
+-#endif
++ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+- yybackup:
++
++/*-----------.
++| yybackup. |
++`-----------*/
++yybackup:
+
+ /* Do appropriate processing given the current state. */
+ /* Read a lookahead token if we need one and don't already have one. */
+@@ -751,154 +1114,120 @@
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+- if (yyn == YYFLAG)
++ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+- /* yychar is either YYEMPTY or YYEOF
+- or a valid token in external form. */
+-
++ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Reading a token: ");
+-#endif
++ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+- /* Convert token to internal form (in yychar1) for indexing tables with */
+-
+- if (yychar <= 0) /* This means end of input. */
++ if (yychar <= YYEOF)
+ {
+- yychar1 = 0;
+- yychar = YYEOF; /* Don't call YYLEX any more */
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Now at end of input.\n");
+-#endif
++ yychar = yytoken = YYEOF;
++ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+- yychar1 = YYTRANSLATE(yychar);
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+- /* Give the individual parser a way to print the precise meaning
+- of a token, for further debugging info. */
+-#ifdef YYPRINT
+- YYPRINT (stderr, yychar, yylval);
+-#endif
+- fprintf (stderr, ")\n");
+- }
+-#endif
++ yytoken = YYTRANSLATE (yychar);
++ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+- yyn += yychar1;
+- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
++ /* If the proper action on seeing token YYTOKEN is to reduce or to
++ detect an error, take that action. */
++ yyn += yytoken;
++ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+-
+ yyn = yytable[yyn];
+-
+- /* yyn is what to do for this token type in this state.
+- Negative => reduce, -yyn is rule number.
+- Positive => shift, yyn is new state.
+- New state is final state => don't bother to shift,
+- just return success.
+- 0, or most negative number => error. */
+-
+- if (yyn < 0)
++ if (yyn <= 0)
+ {
+- if (yyn == YYFLAG)
++ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+- else if (yyn == 0)
+- goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+-#endif
++ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+-#ifdef YYLSP_NEEDED
+- *++yylsp = yylloc;
+-#endif
+
+- /* count tokens shifted since error; after three, turn off error status. */
+- if (yyerrstatus) yyerrstatus--;
++
++ /* Count tokens shifted since error; after three, turn off error
++ status. */
++ if (yyerrstatus)
++ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+-/* Do the default action for the current state. */
+-yydefault:
+
++/*-----------------------------------------------------------.
++| yydefault -- do the default action for the current state. |
++`-----------------------------------------------------------*/
++yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
++ goto yyreduce;
+
+-/* Do a reduction. yyn is the number of a rule to reduce with. */
++
++/*-----------------------------.
++| yyreduce -- Do a reduction. |
++`-----------------------------*/
+ yyreduce:
++ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+- if (yylen > 0)
+- yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- int i;
++ /* If YYLEN is nonzero, implement the default value of the action:
++ `$$ = $1'.
+
+- fprintf (stderr, "Reducing via rule %d (line %d), ",
+- yyn, yyrline[yyn]);
++ Otherwise, the following line sets YYVAL to garbage.
++ This behavior is undocumented and Bison
++ users should not rely upon it. Assigning to YYVAL
++ unconditionally makes the parser a bit smaller, and it avoids a
++ GCC warning that YYVAL may be used uninitialized. */
++ yyval = yyvsp[1-yylen];
+
+- /* Print the symbols being reduced, and their result. */
+- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+- }
+-#endif
+
+-
+- switch (yyn) {
+-
+-case 1:
+-#line 165 "ql_y.y"
+-{
++ YY_REDUCE_PRINT (yyn);
++ switch (yyn)
++ {
++ case 2:
++#line 168 "ql_y.y"
++ {
+ STRUCTURE *walk;
+
+ def = yyvsp[0].field;
+ for (walk = structures; walk; walk = walk->next)
+ if (!walk->instances)
+ fprintf(stderr,"unused structure: %s\n",walk->id);
+- ;
+- break;}
+-case 3:
+-#line 177 "ql_y.y"
+-{
++ }
++ break;
++
++ case 4:
++#line 180 "ql_y.y"
++ {
+ to_c("#%s\n",yyvsp[-1].str);
+ to_test("#%s\n",yyvsp[-1].str);
+ if (dump) to_dump("#%s\n",yyvsp[-1].str);
+- ;
+- break;}
+-case 6:
+-#line 190 "ql_y.y"
+-{
++ }
++ break;
++
++ case 7:
++#line 193 "ql_y.y"
++ {
+ STRUCTURE *n;
+
+ n = alloc_t(STRUCTURE);
+@@ -907,23 +1236,26 @@
+ n->instances = 0;
+ n->next = structures;
+ structures = n;
+- ;
+- break;}
+-case 7:
+-#line 203 "ql_y.y"
+-{
++ }
++ break;
++
++ case 8:
++#line 206 "ql_y.y"
++ {
+ abort_id = NULL;
+- ;
+- break;}
+-case 8:
+-#line 207 "ql_y.y"
+-{
++ }
++ break;
++
++ case 9:
++#line 210 "ql_y.y"
++ {
+ yyval.field = yyvsp[0].field;
+- ;
+- break;}
+-case 9:
+-#line 214 "ql_y.y"
+-{
++ }
++ break;
++
++ case 10:
++#line 217 "ql_y.y"
++ {
+ STRUCTURE *walk;
+
+ for (walk = structures; walk; walk = walk->next)
+@@ -939,38 +1271,43 @@
+ yyval.field->my_block = copy_block(walk->block);
+ yyval.field->next = NULL;
+ abort_id = NULL;
+- ;
+- break;}
+-case 10:
+-#line 232 "ql_y.y"
+-{
++ }
++ break;
++
++ case 11:
++#line 235 "ql_y.y"
++ {
+ yyval.field = yyvsp[-1].field;
+ abort_id = NULL;
+- ;
+- break;}
+-case 11:
+-#line 237 "ql_y.y"
+-{
++ }
++ break;
++
++ case 12:
++#line 240 "ql_y.y"
++ {
+ yyval.field = NULL;
+ abort_id = yyvsp[0].str;
+- ;
+- break;}
+-case 12:
+-#line 244 "ql_y.y"
+-{
++ }
++ break;
++
++ case 13:
++#line 247 "ql_y.y"
++ {
+ yyval.field = NULL;
+- ;
+- break;}
+-case 13:
+-#line 248 "ql_y.y"
+-{
++ }
++ break;
++
++ case 14:
++#line 251 "ql_y.y"
++ {
+ yyval.field = yyvsp[-1].field;
+ yyvsp[-1].field->next = yyvsp[0].field;
+- ;
+- break;}
+-case 14:
+-#line 256 "ql_y.y"
+-{
++ }
++ break;
++
++ case 15:
++#line 259 "ql_y.y"
++ {
+ TAG *walk;
+
+ yyval.field = yyvsp[0].field;
+@@ -989,23 +1326,26 @@
+ "selections");
+ if (*yyval.field->id != '_' && yyval.field->value && yyval.field->value->type == vt_multi)
+ yyerror("multi selectors must be unnamed");
+- ;
+- break;}
+-case 15:
+-#line 279 "ql_y.y"
+-{
++ }
++ break;
++
++ case 16:
++#line 282 "ql_y.y"
++ {
+ yyval.num = 0;
+- ;
+- break;}
+-case 16:
+-#line 283 "ql_y.y"
+-{
++ }
++ break;
++
++ case 17:
++#line 286 "ql_y.y"
++ {
+ yyval.num = 1;
+- ;
+- break;}
+-case 17:
+-#line 290 "ql_y.y"
+-{
++ }
++ break;
++
++ case 18:
++#line 293 "ql_y.y"
++ {
+ yyval.field = alloc_t(FIELD);
+ yyval.field->size = yyvsp[-1].num;
+ yyval.field->var_len = -2; /* hack */
+@@ -1015,140 +1355,159 @@
+ yyval.field->value = NULL;
+ yyval.field->structure = NULL;
+ yyval.field->next = NULL;
+- ;
+- break;}
+-case 18:
+-#line 302 "ql_y.y"
+-{
++ }
++ break;
++
++ case 19:
++#line 305 "ql_y.y"
++ {
+ yyval.field = alloc_t(FIELD);
+ yyval.field->size = yyvsp[-4].num;
+ yyval.field->var_len = -1;
+ yyval.field->pos = yyvsp[-3].num;
+ yyval.field->flush = !yyvsp[-2].num;
+- if (yyval.field->pos == -1)
++ if (yyval.field->pos == -1) {
+ if (yyval.field->size & 7)
+ yyerror("position required for small fields");
+ else yyval.field->pos = 0;
++ }
+ yyval.field->value = yyvsp[0].value;
+ yyval.field->structure = NULL;
+ yyval.field->next = NULL;
+- ;
+- break;}
+-case 19:
+-#line 319 "ql_y.y"
+-{
+- yyval.num = -1;
+- ;
+- break;}
+-case 20:
++ }
++ break;
++
++ case 20:
+ #line 323 "ql_y.y"
+-{
++ {
++ yyval.num = -1;
++ }
++ break;
++
++ case 21:
++#line 327 "ql_y.y"
++ {
+ yyval.num = yyvsp[0].num-1;
+ if (yyval.num < 0 || yyval.num > 7) yyerror("invalid position");
+- ;
+- break;}
+-case 21:
+-#line 331 "ql_y.y"
+-{
++ }
++ break;
++
++ case 22:
++#line 335 "ql_y.y"
++ {
+ char *end;
+
+ yyval.num = strtoul(yyvsp[0].str,&end,10);
+ if (*end) yyerror("no a decimal number");
+- ;
+- break;}
+-case 22:
+-#line 340 "ql_y.y"
+-{
+- yyval.num = 0;
+- ;
+- break;}
+-case 23:
++ }
++ break;
++
++ case 23:
+ #line 344 "ql_y.y"
+-{
++ {
++ yyval.num = 0;
++ }
++ break;
++
++ case 24:
++#line 348 "ql_y.y"
++ {
+ if (strcmp(yyvsp[0].str,"more")) yyerror("\"more\" expected");
+ yyval.num = 1;
+- ;
+- break;}
+-case 24:
+-#line 351 "ql_y.y"
+-{
+- yyval.value = NULL;
+- ;
+- break;}
+-case 25:
++ }
++ break;
++
++ case 25:
+ #line 355 "ql_y.y"
+-{
++ {
++ yyval.value = NULL;
++ }
++ break;
++
++ case 26:
++#line 359 "ql_y.y"
++ {
+ yyval.value = yyvsp[0].value;
+- ;
+- break;}
+-case 26:
+-#line 362 "ql_y.y"
+-{
++ }
++ break;
++
++ case 27:
++#line 366 "ql_y.y"
++ {
+ yyval.value = alloc_t(VALUE);
+ yyval.value->type = vt_id;
+ yyval.value->id = yyvsp[0].str;
+- ;
+- break;}
+-case 27:
+-#line 368 "ql_y.y"
+-{
++ }
++ break;
++
++ case 28:
++#line 372 "ql_y.y"
++ {
+ yyval.value = alloc_t(VALUE);
+ yyval.value->type = vt_case;
+ yyval.value->id = NULL;
+ yyval.value->tags = yyvsp[-1].tag;
+- ;
+- break;}
+-case 28:
+-#line 375 "ql_y.y"
+-{
++ }
++ break;
++
++ case 29:
++#line 379 "ql_y.y"
++ {
+ yyval.value = alloc_t(VALUE);
+ yyval.value->type = vt_multi;
+ yyval.value->tags = yyvsp[-1].tag;
+- ;
+- break;}
+-case 29:
+-#line 381 "ql_y.y"
+-{
++ }
++ break;
++
++ case 30:
++#line 385 "ql_y.y"
++ {
+ yyval.value = alloc_t(VALUE);
+ yyval.value->type = vt_length;
+ yyval.value->recovery = yyvsp[-2].str;
+ yyval.value->block = yyvsp[0].field;
+ yyval.value->abort_id = abort_id;
+- ;
+- break;}
+-case 30:
+-#line 391 "ql_y.y"
+-{
+- yyval.str = NULL;
+- ;
+- break;}
+-case 31:
++ }
++ break;
++
++ case 31:
+ #line 395 "ql_y.y"
+-{
++ {
++ yyval.str = NULL;
++ }
++ break;
++
++ case 32:
++#line 399 "ql_y.y"
++ {
+ yyval.str = yyvsp[0].str;
+- ;
+- break;}
+-case 32:
+-#line 401 "ql_y.y"
+-{
+- yyval.nlist = NULL;
+- ;
+- break;}
+-case 33:
++ }
++ break;
++
++ case 33:
+ #line 405 "ql_y.y"
+-{
++ {
++ yyval.nlist = NULL;
++ }
++ break;
++
++ case 34:
++#line 409 "ql_y.y"
++ {
+ yyval.nlist = get_name_list(yyvsp[0].str);
+- ;
+- break;}
+-case 34:
+-#line 411 "ql_y.y"
+-{
+- yyval.tag = NULL;
+- ;
+- break;}
+-case 35:
++ }
++ break;
++
++ case 35:
+ #line 415 "ql_y.y"
+-{
++ {
++ yyval.tag = NULL;
++ }
++ break;
++
++ case 36:
++#line 419 "ql_y.y"
++ {
+ yyval.tag = alloc_t(TAG);
+ yyval.tag->deflt = 1;
+ if (yyvsp[-2].str) {
+@@ -1163,18 +1522,20 @@
+ yyval.tag->block = yyvsp[0].field;
+ yyval.tag->next = NULL;
+ yyval.tag->abort_id = abort_id;
+- ;
+- break;}
+-case 36:
+-#line 432 "ql_y.y"
+-{
++ }
++ break;
++
++ case 37:
++#line 436 "ql_y.y"
++ {
+ yyval.tag = alloc_t(TAG);
+ yyval.tag->abort_id = abort_id;
+- ;
+- break;}
+-case 37:
+-#line 437 "ql_y.y"
+-{
++ }
++ break;
++
++ case 38:
++#line 441 "ql_y.y"
++ {
+ yyval.tag = yyvsp[-1].tag;
+ yyval.tag->deflt = 0;
+ if (yyvsp[-4].str) {
+@@ -1188,17 +1549,19 @@
+ yyval.tag->more = yyvsp[-3].list;
+ yyval.tag->block = yyvsp[-2].field;
+ yyval.tag->next = yyvsp[0].tag;
+- ;
+- break;}
+-case 38:
+-#line 455 "ql_y.y"
+-{
+- yyval.tag = NULL;
+- ;
+- break;}
+-case 39:
++ }
++ break;
++
++ case 39:
+ #line 459 "ql_y.y"
+-{
++ {
++ yyval.tag = NULL;
++ }
++ break;
++
++ case 40:
++#line 463 "ql_y.y"
++ {
+ yyval.tag = alloc_t(TAG);
+ yyval.tag->deflt = 1;
+ if (yyvsp[-2].str) {
+@@ -1212,18 +1575,20 @@
+ yyval.tag->more = yyvsp[-1].list;
+ yyval.tag->block = yyvsp[0].field;
+ yyval.tag->next = NULL;
+- ;
+- break;}
+-case 40:
+-#line 475 "ql_y.y"
+-{
++ }
++ break;
++
++ case 41:
++#line 479 "ql_y.y"
++ {
+ yyval.tag = alloc_t(TAG);
+ yyval.tag->abort_id = abort_id;
+- ;
+- break;}
+-case 41:
+-#line 480 "ql_y.y"
+-{
++ }
++ break;
++
++ case 42:
++#line 484 "ql_y.y"
++ {
+ yyval.tag = yyvsp[-1].tag;
+ yyval.tag->deflt = 0;
+ if (yyvsp[-4].str) {
+@@ -1237,254 +1602,266 @@
+ yyval.tag->more = yyvsp[-3].list;
+ yyval.tag->block = yyvsp[-2].field;
+ yyval.tag->next = yyvsp[0].tag;
+- ;
+- break;}
+-case 42:
+-#line 498 "ql_y.y"
+-{
+- yyval.str = NULL;
+- ;
+- break;}
+-case 43:
++ }
++ break;
++
++ case 43:
+ #line 502 "ql_y.y"
+-{
++ {
++ yyval.str = NULL;
++ }
++ break;
++
++ case 44:
++#line 506 "ql_y.y"
++ {
+ yyval.str = yyvsp[0].str;
+- ;
+- break;}
+-case 44:
+-#line 508 "ql_y.y"
+-{
+- yyval.list = NULL;
+- ;
+- break;}
+-case 45:
++ }
++ break;
++
++ case 45:
+ #line 512 "ql_y.y"
+-{
++ {
++ yyval.list = NULL;
++ }
++ break;
++
++ case 46:
++#line 516 "ql_y.y"
++ {
+ yyval.list = alloc_t(VALUE_LIST);
+ yyval.list->value = yyvsp[-1].str;
+ yyval.list->next = yyvsp[0].list;
+- ;
+- break;}
+-}
+- /* the action file gets copied in in place of this dollarsign */
+-#line 543 "/usr/lib/bison.simple"
++ }
++ break;
++
++
++ }
++
++/* Line 1010 of yacc.c. */
++#line 1643 "y.tab.c"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+-#ifdef YYLSP_NEEDED
+- yylsp -= yylen;
+-#endif
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- short *ssp1 = yyss - 1;
+- fprintf (stderr, "state stack now");
+- while (ssp1 != yyssp)
+- fprintf (stderr, " %d", *++ssp1);
+- fprintf (stderr, "\n");
+- }
+-#endif
++
++ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+-#ifdef YYLSP_NEEDED
+- yylsp++;
+- if (yylen == 0)
+- {
+- yylsp->first_line = yylloc.first_line;
+- yylsp->first_column = yylloc.first_column;
+- yylsp->last_line = (yylsp-1)->last_line;
+- yylsp->last_column = (yylsp-1)->last_column;
+- yylsp->text = 0;
+- }
+- else
+- {
+- yylsp->last_line = (yylsp+yylen-1)->last_line;
+- yylsp->last_column = (yylsp+yylen-1)->last_column;
+- }
+-#endif
+
+- /* Now "shift" the result of the reduction.
+- Determine what state that goes to,
+- based on the state we popped back to
+- and the rule number reduced by. */
++ /* Now `shift' the result of the reduction. Determine what state
++ that goes to, based on the state we popped back to and the rule
++ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
++ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
++ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+- yystate = yydefgoto[yyn - YYNTBASE];
++ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+-yyerrlab: /* here on detecting error */
+
+- if (! yyerrstatus)
+- /* If not already recovering from an error, report this error. */
++/*------------------------------------.
++| yyerrlab -- here on detecting error |
++`------------------------------------*/
++yyerrlab:
++ /* If not already recovering from an error, report this error. */
++ if (!yyerrstatus)
+ {
+ ++yynerrs;
+-
+-#ifdef YYERROR_VERBOSE
++#if YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+- if (yyn > YYFLAG && yyn < YYLAST)
++ if (YYPACT_NINF < yyn && yyn < YYLAST)
+ {
+- int size = 0;
+- char *msg;
+- int x, count;
+-
+- count = 0;
+- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+- for (x = (yyn < 0 ? -yyn : 0);
+- x < (sizeof(yytname) / sizeof(char *)); x++)
+- if (yycheck[x + yyn] == x)
+- size += strlen(yytname[x]) + 15, count++;
+- msg = (char *) malloc(size + 15);
+- if (msg != 0)
++ YYSIZE_T yysize = 0;
++ int yytype = YYTRANSLATE (yychar);
++ const char* yyprefix;
++ char *yymsg;
++ int yyx;
++
++ /* Start YYX at -YYN if negative to avoid negative indexes in
++ YYCHECK. */
++ int yyxbegin = yyn < 0 ? -yyn : 0;
++
++ /* Stay within bounds of both yycheck and yytname. */
++ int yychecklim = YYLAST - yyn;
++ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
++ int yycount = 0;
++
++ yyprefix = ", expecting ";
++ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
++ {
++ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
++ yycount += 1;
++ if (yycount == 5)
++ {
++ yysize = 0;
++ break;
++ }
++ }
++ yysize += (sizeof ("syntax error, unexpected ")
++ + yystrlen (yytname[yytype]));
++ yymsg = (char *) YYSTACK_ALLOC (yysize);
++ if (yymsg != 0)
+ {
+- strcpy(msg, "parse error");
++ char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
++ yyp = yystpcpy (yyp, yytname[yytype]);
+
+- if (count < 5)
++ if (yycount < 5)
+ {
+- count = 0;
+- for (x = (yyn < 0 ? -yyn : 0);
+- x < (sizeof(yytname) / sizeof(char *)); x++)
+- if (yycheck[x + yyn] == x)
++ yyprefix = ", expecting ";
++ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+- strcat(msg, count == 0 ? ", expecting `" : " or `");
+- strcat(msg, yytname[x]);
+- strcat(msg, "'");
+- count++;
++ yyp = yystpcpy (yyp, yyprefix);
++ yyp = yystpcpy (yyp, yytname[yyx]);
++ yyprefix = " or ";
+ }
+ }
+- yyerror(msg);
+- free(msg);
++ yyerror (yymsg);
++ YYSTACK_FREE (yymsg);
+ }
+ else
+- yyerror ("parse error; also virtual memory exceeded");
++ yyerror ("syntax error; also virtual memory exhausted");
+ }
+ else
+ #endif /* YYERROR_VERBOSE */
+- yyerror("parse error");
++ yyerror ("syntax error");
+ }
+
+- goto yyerrlab1;
+-yyerrlab1: /* here on error raised explicitly by an action */
++
+
+ if (yyerrstatus == 3)
+ {
+- /* if just tried and failed to reuse lookahead token after an error, discard it. */
++ /* If just tried and failed to reuse lookahead token after an
++ error, discard it. */
+
+- /* return failure if at end of input */
+- if (yychar == YYEOF)
+- YYABORT;
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+-#endif
++ if (yychar <= YYEOF)
++ {
++ /* If at end of input, pop the error token,
++ then the rest of the stack, then return failure. */
++ if (yychar == YYEOF)
++ for (;;)
++ {
++ YYPOPSTACK;
++ if (yyssp == yyss)
++ YYABORT;
++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
++ yydestruct (yystos[*yyssp], yyvsp);
++ }
++ }
++ else
++ {
++ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
++ yydestruct (yytoken, &yylval);
++ yychar = YYEMPTY;
+
+- yychar = YYEMPTY;
++ }
+ }
+
+- /* Else will try to reuse lookahead token
+- after shifting the error token. */
+-
+- yyerrstatus = 3; /* Each real token shifted decrements this */
++ /* Else will try to reuse lookahead token after shifting the error
++ token. */
++ goto yyerrlab1;
+
+- goto yyerrhandle;
+
+-yyerrdefault: /* current state does not do anything special for the error token. */
++/*---------------------------------------------------.
++| yyerrorlab -- error raised explicitly by YYERROR. |
++`---------------------------------------------------*/
++yyerrorlab:
+
+-#if 0
+- /* This is wrong; only states that explicitly want error tokens
+- should shift them. */
+- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+- if (yyn) goto yydefault;
++#ifdef __GNUC__
++ /* Pacify GCC when the user code never invokes YYERROR and the label
++ yyerrorlab therefore never appears in user code. */
++ if (0)
++ goto yyerrorlab;
+ #endif
+
+-yyerrpop: /* pop the current state because it cannot handle the error token */
+-
+- if (yyssp == yyss) YYABORT;
+- yyvsp--;
+- yystate = *--yyssp;
+-#ifdef YYLSP_NEEDED
+- yylsp--;
+-#endif
++ yyvsp -= yylen;
++ yyssp -= yylen;
++ yystate = *yyssp;
++ goto yyerrlab1;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- short *ssp1 = yyss - 1;
+- fprintf (stderr, "Error: state stack now");
+- while (ssp1 != yyssp)
+- fprintf (stderr, " %d", *++ssp1);
+- fprintf (stderr, "\n");
+- }
+-#endif
+
+-yyerrhandle:
++/*-------------------------------------------------------------.
++| yyerrlab1 -- common code for both syntax error and YYERROR. |
++`-------------------------------------------------------------*/
++yyerrlab1:
++ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+- yyn = yypact[yystate];
+- if (yyn == YYFLAG)
+- goto yyerrdefault;
++ for (;;)
++ {
++ yyn = yypact[yystate];
++ if (yyn != YYPACT_NINF)
++ {
++ yyn += YYTERROR;
++ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
++ {
++ yyn = yytable[yyn];
++ if (0 < yyn)
++ break;
++ }
++ }
+
+- yyn += YYTERROR;
+- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+- goto yyerrdefault;
++ /* Pop the current state because it cannot handle the error token. */
++ if (yyssp == yyss)
++ YYABORT;
+
+- yyn = yytable[yyn];
+- if (yyn < 0)
+- {
+- if (yyn == YYFLAG)
+- goto yyerrpop;
+- yyn = -yyn;
+- goto yyreduce;
++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
++ yydestruct (yystos[yystate], yyvsp);
++ YYPOPSTACK;
++ yystate = *yyssp;
++ YY_STACK_PRINT (yyss, yyssp);
+ }
+- else if (yyn == 0)
+- goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Shifting error token, ");
+-#endif
++ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+-#ifdef YYLSP_NEEDED
+- *++yylsp = yylloc;
+-#endif
++
+
+ yystate = yyn;
+ goto yynewstate;
+
+- yyacceptlab:
+- /* YYACCEPT comes here. */
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
+-#endif
+- }
+- return 0;
+
+- yyabortlab:
+- /* YYABORT comes here. */
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
++/*-------------------------------------.
++| yyacceptlab -- YYACCEPT comes here. |
++`-------------------------------------*/
++yyacceptlab:
++ yyresult = 0;
++ goto yyreturn;
++
++/*-----------------------------------.
++| yyabortlab -- YYABORT comes here. |
++`-----------------------------------*/
++yyabortlab:
++ yyresult = 1;
++ goto yyreturn;
++
++#ifndef yyoverflow
++/*----------------------------------------------.
++| yyoverflowlab -- parser overflow comes here. |
++`----------------------------------------------*/
++yyoverflowlab:
++ yyerror ("parser stack overflow");
++ yyresult = 2;
++ /* Fall through. */
++#endif
++
++yyreturn:
++#ifndef yyoverflow
++ if (yyss != yyssa)
++ YYSTACK_FREE (yyss);
+ #endif
+- }
+- return 1;
++ return yyresult;
+ }
+-#line 518 "ql_y.y"
++
++
++
+--- linux-atm-2.4.1.orig/src/qgen/ql_y.y
++++ linux-atm-2.4.1/src/qgen/ql_y.y
+@@ -17,6 +17,8 @@
+ #include "qgen.h"
+ #include "file.h"
+
++extern void yyerror(const char *s);
++
+
+ #define MAX_TOKEN 256
+ #define DEFAULT_NAMELIST_FILE "default.nl"
+@@ -58,9 +60,10 @@
+ for (walk = strchr(start,0)-1; walk > start && isspace(*walk); walk--)
+ *walk = 0;
+ if (*start == ':') {
+- if (!(searching = strcmp(start+1,name)))
++ if (!(searching = strcmp(start+1,name))) {
+ if (found) yyerror("multiple entries");
+ else found = 1;
++ }
+ continue;
+ }
+ if (searching) continue;
+@@ -305,10 +308,11 @@
+ $$->var_len = -1;
+ $$->pos = $2;
+ $$->flush = !$3;
+- if ($$->pos == -1)
++ if ($$->pos == -1) {
+ if ($$->size & 7)
+ yyerror("position required for small fields");
+ else $$->pos = 0;
++ }
+ $$->value = $5;
+ $$->structure = NULL;
+ $$->next = NULL;
+--- linux-atm-2.4.1.orig/src/qgen/ql_l.l
++++ linux-atm-2.4.1/src/qgen/ql_l.l
+@@ -68,7 +68,7 @@
+
+ %%
+
+-void yyerror(char *s)
++void yyerror(const char *s)
+ {
+ fprintf(stderr,"line %d: %s near \"%s\"\n",lineno,s,yytext);
+ exit(1);
+--- linux-atm-2.4.1.orig/src/qgen/qlib.c
++++ linux-atm-2.4.1/src/qgen/qlib.c
+@@ -26,14 +26,14 @@
+ #include "op.h"
+
+
+-static int debug = 0;
++static int q_debug = 0;
+
+
+ void PREFIX(report)(int severity,const char *msg,...)
+ {
+ va_list ap;
+
+- if (!debug && severity > Q_ERROR) return;
++ if (!q_debug && severity > Q_ERROR) return;
+ va_start(ap,msg);
+ vprintf(msg,ap);
+ printf("\n");
+@@ -836,7 +836,7 @@
+ Q_DSC dsc;
+ int len,c;
+
+- debug = argc != 1;
++ q_debug = argc != 1;
+ len = 0;
+ while (scanf("%x",&c) == 1) msg[len++] = c;
+ qd_start();
+--- linux-atm-2.4.1.orig/src/qgen/qlib.h
++++ linux-atm-2.4.1/src/qgen/qlib.h
+@@ -23,7 +23,9 @@
+ #define Q_FATAL -1
+
+
++#ifndef DUMP_MODE
+ extern int q_dump;
++#endif
+ extern void q_report(int severity,const char *msg,...);
+
+ #ifdef DUMP_MODE
+--- linux-atm-2.4.1.orig/src/qgen/ql_y.h
++++ linux-atm-2.4.1/src/qgen/ql_y.h
+@@ -1,4 +1,65 @@
+-typedef union {
++/* A Bison parser, made by GNU Bison 1.875d. */
++
++/* Skeleton parser for Yacc-like parsing with Bison,
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA. */
++
++/* As a special exception, when this file is copied by Bison into a
++ Bison output file, you may use that output file without restriction.
++ This special exception was added by the Free Software Foundation
++ in version 1.24 of Bison. */
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ TOK_BREAK = 258,
++ TOK_CASE = 259,
++ TOK_DEF = 260,
++ TOK_DEFAULT = 261,
++ TOK_LENGTH = 262,
++ TOK_MULTI = 263,
++ TOK_RECOVER = 264,
++ TOK_ABORT = 265,
++ TOK_ID = 266,
++ TOK_INCLUDE = 267,
++ TOK_STRING = 268
++ };
++#endif
++#define TOK_BREAK 258
++#define TOK_CASE 259
++#define TOK_DEF 260
++#define TOK_DEFAULT 261
++#define TOK_LENGTH 262
++#define TOK_MULTI 263
++#define TOK_RECOVER 264
++#define TOK_ABORT 265
++#define TOK_ID 266
++#define TOK_INCLUDE 267
++#define TOK_STRING 268
++
++
++
++
++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
++#line 142 "ql_y.y"
++typedef union YYSTYPE {
+ const char *str;
+ int num;
+ FIELD *field;
+@@ -7,17 +68,14 @@
+ TAG *tag;
+ NAME_LIST *nlist;
+ } YYSTYPE;
+-#define TOK_BREAK 257
+-#define TOK_CASE 258
+-#define TOK_DEF 259
+-#define TOK_DEFAULT 260
+-#define TOK_LENGTH 261
+-#define TOK_MULTI 262
+-#define TOK_RECOVER 263
+-#define TOK_ABORT 264
+-#define TOK_ID 265
+-#define TOK_INCLUDE 266
+-#define TOK_STRING 267
+-
++/* Line 1285 of yacc.c. */
++#line 73 "y.tab.h"
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
+
+ extern YYSTYPE yylval;
++
++
++
+--- linux-atm-2.4.1.orig/src/qgen/incl.pl
++++ linux-atm-2.4.1/src/qgen/incl.pl
+@@ -24,7 +24,7 @@
+ }
+ die "no include file specified" unless defined $last;
+ for (@STD,@USR) {
+- next unless defined stat $_."/".$last;
++ next unless -e "$_/$last";
+ print $_."/".$last."\n" || die "print STDOUT: $!";
+ exit 0;
+ }
+--- linux-atm-2.4.1.orig/src/qgen/msg.fmt
++++ linux-atm-2.4.1/src/qgen/msg.fmt
+@@ -53,7 +53,7 @@
+ ATM_TD_FW_PCR_0 { p##fw_pcr_0 <24> } \
+ ATM_TD_BW_PCR_0 { p##bw_pcr_0 <24> } \
+ ATM_TD_FW_PCR_01 { p##fw_pcr_01 <24> } \
+- ATM_TD_BW_PCR_01 { p##bw_pcr_01 <24> } \
++ ATM_TD_BW_PCR_01 { p##bw_pcr_01 <24> }
+
+ #define TRAFFIC_DESCRIPTOR_VBR(p) \
+ ATM_TD_FW_SCR_0 { p##fw_scr_0 <24> } \
+@@ -63,15 +63,15 @@
+ ATM_TD_FW_MBS_0 { p##fw_mbs_0 <24> } \
+ ATM_TD_BW_MBS_0 { p##bw_mbs_0 <24> } \
+ ATM_TD_FW_MBS_01 { p##fw_mbs_01 <24> } \
+- ATM_TD_BW_MBS_01 { p##bw_mbs_01 <24> } \
++ ATM_TD_BW_MBS_01 { p##bw_mbs_01 <24> }
+
+ #define TRAFFIC_DESCRIPTOR_BE(p) \
+- ATM_TD_BEST_EFFORT { p##best_effort <0> } \
++ ATM_TD_BEST_EFFORT { p##best_effort <0> }
+
+ #if defined(UNI40) || defined(DYNAMIC_UNI)
+ #define TRAFFIC_DESCRIPTOR_ABR(p) \
+ ATM_TD_FW_MCR_01 { p##fw_mcr_01 <24> } \
+- ATM_TD_BW_MCR_01 { p##bw_mcr_01 <24> } \
++ ATM_TD_BW_MCR_01 { p##bw_mcr_01 <24> }
+
+ #else
+ #define TRAFFIC_DESCRIPTOR_ABR(p) /* not yet */
+--- linux-atm-2.4.1.orig/src/qgen/output
++++ linux-atm-2.4.1/src/qgen/output
+@@ -0,0 +1,704 @@
++# 1 "<stdin>"
++# 1 "<built-in>"
++# 1 "<command line>"
++# 1 "<stdin>"
++
++
++
++
++
++# 1 "../../config.h" 1
++# 7 "<stdin>" 2
++
++
++
++
++include "atmsap.h"
++include "uni.h"
++# 26 "<stdin>"
++def ie_aal = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ aal_type <8> = case {
++ 5 {
++ _id "atm_aalp" <8> = multi {
++ ATM_AALP_FW_MAX_SDU {
++ fw_max_sdu <16>
++ }
++ ATM_AALP_BW_MAX_SDU {
++ bw_max_sdu <16>
++ }
++
++ ATM_AALP_AAL_MODE {
++ aal_mode <8> # UNI 3.0 only
++ }
++
++ ATM_AALP_SSCS {
++ sscs_type <8>
++ }
++ }
++ }
++ }
++ }
++}
++# 90 "<stdin>"
++def ie_td = { # UNI 3.0 calls this "User Cell Rate"
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _id "atm_td" <8> = multi {
++ ATM_TD_FW_PCR_0 { _dummy <0> = length {}fw_pcr_0 <24> } ATM_TD_BW_PCR_0 { _dummy <0> = length {}bw_pcr_0 <24> } ATM_TD_FW_PCR_01 { _dummy <0> = length {}fw_pcr_01 <24> } ATM_TD_BW_PCR_01 { _dummy <0> = length {}bw_pcr_01 <24> } ATM_TD_FW_SCR_0 { _dummy <0> = length {}fw_scr_0 <24> } ATM_TD_BW_SCR_0 { _dummy <0> = length {}bw_scr_0 <24> } ATM_TD_FW_SCR_01 { _dummy <0> = length {}fw_scr_01 <24> } ATM_TD_BW_SCR_01 { _dummy <0> = length {}bw_scr_01 <24> } ATM_TD_FW_MBS_0 { _dummy <0> = length {}fw_mbs_0 <24> } ATM_TD_BW_MBS_0 { _dummy <0> = length {}bw_mbs_0 <24> } ATM_TD_FW_MBS_01 { _dummy <0> = length {}fw_mbs_01 <24> } ATM_TD_BW_MBS_01 { _dummy <0> = length {}bw_mbs_01 <24> } ATM_TD_BEST_EFFORT { _dummy <0> = length {}best_effort <0> }
++# 104 "<stdin>"
++ ATM_TD_TM_OPT { # @@@ should this also go into the TD macro ?
++
++ fw_fdisc "atm_fd" <1@8,more> = ATM_FD_NO
++ bw_fdisc "atm_fd" <1@7,more> = ATM_FD_NO
++
++ bw_tag "atm_tag" <1@2,more> = ATM_TAG_NO
++ fw_tag "atm_tag" <1@1> = ATM_TAG_NO
++ }
++ }
++ }
++}
++
++
++def ie_bbcap = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ bearer_class "atm_bc" <5@1,more>
++ _ext <1@8> = case {
++ 0 {
++ _ext <1@8,more> = 1
++ trans_cap "atm_tc" <7@1>
++ }
++ default 1 {}
++ }
++ _ext <1@8,more> = 1
++ susc_clip "atm_stc" <2@6,more> = ATM_STC_NO
++ upcc "atm_upcc" <2@1> = ATM_UPCC_P2P
++ }
++}
++
++
++def ie_bhli = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ hli_type <7@1> = case {
++
++
++ 0 { # ISO
++ iso_hli <-64>
++ }
++ 1 { # User Specific
++ user_hli <-64>
++ }
++
++ 2 { # High layer profile - UNI 3.0 only
++ hlp <32>
++ }
++
++ 3 { # Vendor-Specific Application identifier
++ hli_oui <24>
++ app_id <32>
++ }
++
++ 4 { # Reference to ITU-T SG 1 B-ISDN Teleservice Recommendation
++ tobedefined <8>
++ }
++
++ }
++ }
++}
++
++
++def ie_blli = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _lid <2@6,more> = multi {
++ 1 {
++ _ext <1@8,more> = 1
++ uil1_proto <5@1>
++ }
++ 2 {
++ uil2_proto "atm_l2" <5@1,more> = case {
++ ATM_L2_X25_LL,ATM_L2_X25_ML,ATM_L2_HDLC_ARM,
++ ATM_L2_HDLC_NRM,ATM_L2_HDLC_ABM,ATM_L2_Q922,
++ ATM_L2_ISO7776 { # CCITT encoding
++ _ext <1@8> = case {
++ 0 {
++ l2_mode "atm_imd" <2@6,more> = ATM_IMD_NORMAL
++ q933 <2@1,more> = 0
++ _ext <1@8> = case {
++ 0 {
++ window_size <7@1,more>
++ _ext <1@8> = 1
++ }
++ default 1 {}
++ }
++ }
++ default 1 {}
++ }
++ }
++ ATM_L2_USER { # User specified
++ _ext <1@8> = 0
++ user_l2 <7@1,more>
++ _ext <1@8> = 1
++ }
++ default ATM_L2_ISO1745,ATM_L2_Q291,ATM_L2_LAPB,
++ ATM_L2_ISO8802,ATM_L2_X75 { # No additional data
++ _ext <1@8> = 1
++ }
++ }
++ }
++ 3 {
++ uil3_proto "atm_l3" <5@1,more> = case {
++ ATM_L3_X25,ATM_L3_ISO8208,ATM_L3_X223 { # CCITT coding
++ _ext <1@8> = case {
++ 0 {
++ l3_mode "atm_imd" <2@6,more> = ATM_IMD_NORMAL
++ _ext <1@8> = case {
++ 0 {
++ def_pck_size <4@1,more>
++ _ext <1@8> = case {
++ 0 {
++ _ext <1@8> = 1
++ pck_win_size <7@1>
++ }
++ default 1 {}
++ }
++ }
++ default 1 {}
++ }
++ }
++ default 1 {}
++ }
++ }
++
++ ATM_L3_H310 { # ITU-T Rec. H.310
++ _ext <1@8> = case {
++ 0 {
++ term_type "atm_tt" <4@1,more> = ATM_TT_RXTX
++ _ext <1@8> = case {
++ 0 {
++ _ext <1@8,more> = 1
++ fw_mpx_cap "atm_mc" <3@4,more> =
++ ATM_MC_NONE
++ bw_mpx_cap "atm_mc" <3@1> = ATM_MC_NONE
++ }
++ default 1 {}
++ }
++ }
++ default 1 {}
++ }
++ }
++
++ ATM_L3_TR9577 { # ISO/IEC TR9577
++ _ext <1@8> = case {
++ 0 {
++ _ext <1@8,more> = 0
++ ipi_high <7@1> = case {
++ 0x40 { # SNAP hack
++ _ext <1@8,more> = 1
++ _ipi_low <1@7> = case { # ugly
++ 0 {
++ _ext <1@8,more> = 1
++ _snap_id <2@6> = 0
++ oui <24>
++ pid <16>
++ }
++ default 1 {}
++ }
++ }
++ default 0x0 { # ugly
++ _ext <1@8,more> = 1
++ ipi_low <1@7>
++ }
++ }
++ }
++ default 1 {}
++ }
++ }
++ ATM_L3_USER { # User specified
++ _ext <1@8> = 0
++ user_l3 <7@1,more>
++ _ext <1@8> = 1
++ }
++ }
++ }
++ }
++ }
++}
++
++
++def ie_call_state = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ call_state <6@1>
++ }
++}
++
++
++def ie_cdpn = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ _plan "atm_np" <4@1,more> = case {
++ ATM_NP_E164 {
++ _type "atm_ton" <3@5> = ATM_TON_INTRNTNL
++ cdpn_e164 <-96>
++ }
++ ATM_NP_AEA { # ATM Endsystem Address
++ _type "atm_ton" <3@5> = ATM_TON_UNKNOWN
++ cdpn_esa <-160>
++ }
++ }
++ }
++}
++
++
++def ie_cdps = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++
++
++
++
++ cdps_type "atm_sat" <3@5,more> = ATM_SAT_AEA
++
++ _oddeven <1@4> = 0
++ cdps <-160>
++ }
++}
++
++
++def ie_cgpn = { # @@@ extend language to allow same trick as for cdpn
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ cgpn_plan "atm_np" <4@1,more>
++ cgpn_type "atm_ton" <3@5,more>
++ _ext <1@8> = case {
++ 0 {
++ _ext <1@8,more> = 1
++ pres_ind "atm_prs" <2@6,more> = ATM_PRS_ALLOW
++ scr_ind "atm_scrn" <2@1> = ATM_SCRN_UP_NS
++ }
++ default 1 {}
++ }
++ cgpn <-160>
++ }
++}
++
++
++def ie_cgps = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++
++
++
++
++ cgps_type "atm_sat" <3@5,more> = ATM_SAT_AEA
++
++ _oddeven <1@4> = 0
++ cgps <-160>
++ }
++}
++
++
++def ie_cause = {
++ _ext <1@8,more> = 1 cause_cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ location "atm_loc" <4@1> = ATM_LOC_USER
++ _ext <1@8,more> = 1
++ cause "atm_cv" <7@1> = case {
++ ATM_CV_UNALLOC,ATM_CV_NO_ROUTE_DEST,ATM_CV_QOS_UNAVAIL { # Note 2
++ break
++ _ext <1@8,more> = 1
++ pu "atm_pu" <1@4,more> = ATM_PU_USER
++ na "atm_na" <1@3,more> = ATM_NA_NORMAL
++ cond2 "atm_cond" <2@1> = ATM_COND_UNKNOWN
++ }
++ ATM_CV_CALL_REJ { # Note 3
++ break
++ _ext <1@8,more> = 1
++ cond3 "atm_cond" <2@1,more> = ATM_COND_UNKNOWN
++ reason <5@3> = case {
++ ATM_RSN_USER {
++ user_diag <-216>
++ }
++ ATM_RSN_IE_MISS,ATM_RSN_IE_INSUFF {
++ ie_id3 "atm_ie" <8>
++ }
++ }
++ }
++ ATM_CV_NUM_CHANGED { # Note 4
++ break
++ new_dest <-224> # good luck ...
++ }
++ ATM_CV_REJ_CLIR { # Note 5
++ break
++ invalid <8> # not supported
++ }
++ ATM_CV_ACC_INF_DISC,ATM_CV_INCOMP_DEST,ATM_CV_MAND_IE_MISSING,
++ ATM_CV_UNKNOWN_IE,ATM_CV_INVALID_IE { # Note 6
++ break
++ ie_id6 <-224>
++ }
++
++ ATM_CV_UCR_UNAVAIL_OLD,ATM_CV_UCR_UNAVAIL_NEW { # Note 8
++
++
++
++
++
++
++
++ break
++ ucr_id <-224>
++ }
++ ATM_CV_NO_SUCH_CHAN { # Note 9
++ break
++ unav_vpci <16>
++ unav_vci <16>
++ }
++ ATM_CV_UNKNOWN_MSG_TYPE,ATM_CV_INCOMP_MSG { # Note 10
++ break
++ bad_msg_type "atm_msg" <8>
++ }
++ ATM_CV_TIMER_EXP { # Note 11
++ break
++ timer <24>
++ }
++ default 0 {}
++ }
++ }
++}
++
++
++def ie_conn_id = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ _vp_ass "atm_vpa" <2@4,more> = ATM_VPA_EXPL
++ _pref_exc "atm_poe" <3@1> = 0
++ vpi <16>
++ vci <16>
++ }
++}
++
++
++
++
++def ie_e2e_tdl = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _id "atm_tdl" <8> = multi {
++ ATM_TDL_CUM {
++ cum_delay <16>
++ }
++ ATM_TDL_E2EMAX {
++ max_delay <16>
++ }
++ ATM_TDL_NGI {}
++ }
++
++ }
++}
++
++
++
++
++def ie_qos = {
++# 467 "<stdin>"
++ _ext <1@8,more> = 1 qos_cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++
++ qos_fw <8> = 0
++ qos_bw <8> = 0
++ }
++}
++
++
++def ie_bbrep = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ rep_ind <4@1> = 2
++ }
++}
++
++
++def ie_restart = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ rst_class <3@1>
++ }
++}
++
++
++def ie_bbs_comp = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ bbsc_ind <7@1> = 0x21
++ }
++}
++
++
++def ie_tns = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ _net_type "atm_tni" <3@5,more> = ATM_TNI_NNI
++ _carrier_id "atm_nip" <4@1> = ATM_NIP_CARRIER
++ net_id <-32>
++ }
++}
++
++
++
++
++def ie_notify = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ notification <-32> # @@@ how many actually ?
++ }
++}
++
++
++def ie_oam_td = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ext <1@8,more> = 1
++ shaping "atm_shi" <2@6,more> = ATM_SHI_NONE
++ compliance "atm_oci" <1@5,more> = ATM_OCI_OPT
++ fault "atm_unfm" <3@1> = ATM_UNFM_NONE
++ _ext <1@8,more> = 1
++ fwd_ofi "atm_ofi" <3@5,more> = ATM_OFI_0_0
++ bwd_ofi "atm_ofi" <3@1> = ATM_OFI_0_0
++ }
++}
++
++
++def ie_git = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length { # @@@ UNI 4.0 does not specify the coding
++ _dummy <1@8> = 0 # bit is "spare", although not indicated in spec
++ id_std_app "atm_irs" <7@1> = case {
++ ATM_IRS_DSMCC,ATM_IRS_H245 {
++ _type "atm_it" <8> = ATM_IT_SESSION
++ _length <8> = length {
++ session_id <-160>
++ }
++ _type "atm_it" <8> = ATM_IT_RESOURCE
++ _length <8> = length {
++ resource_id <-32>
++ }
++ }
++ default 0 {
++ unrecognized_git_identifiers <-224> # 33-5 bytes
++ }
++ }
++ }
++}
++
++
++def ie_lij_id = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length { # @@@ UNI 4.0 does not specify the coding
++ _ext <1@8,more> = 1
++ lij_id_type "atm_lit" <7@1> = ATM_LIT_ROOT
++ lij_id <32>
++ }
++}
++
++
++def ie_lij_prm = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length { # @@@ UNI 4.0 does not specify the coding
++ _ext <1@8,more> = 1
++ lij_scr_ind "atm_lsi" <2@1>
++ }
++}
++
++
++def ie_leaf_sn = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length { # @@@ UNI 4.0 does not specify the coding
++ leaf_sn <32>
++ }
++}
++
++
++def ie_scope_sel = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length { # @@@ UNI 4.0 does not specify the coding
++ _ext <1@8,more> = 1
++ scope_type "atm_tcs" <4@1> = ATM_TCS_ORGANIZATIONAL
++ scope_sel "atm_css" <8>
++ }
++}
++
++
++def ie_alt_td = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _id "atm_td" <8> = multi {
++ ATM_TD_FW_PCR_0 { altfw_pcr_0 <24> } ATM_TD_BW_PCR_0 { altbw_pcr_0 <24> } ATM_TD_FW_PCR_01 { altfw_pcr_01 <24> } ATM_TD_BW_PCR_01 { altbw_pcr_01 <24> } ATM_TD_FW_SCR_0 { altfw_scr_0 <24> } ATM_TD_BW_SCR_0 { altbw_scr_0 <24> } ATM_TD_FW_SCR_01 { altfw_scr_01 <24> } ATM_TD_BW_SCR_01 { altbw_scr_01 <24> } ATM_TD_FW_MBS_0 { altfw_mbs_0 <24> } ATM_TD_BW_MBS_0 { altbw_mbs_0 <24> } ATM_TD_FW_MBS_01 { altfw_mbs_01 <24> } ATM_TD_BW_MBS_01 { altbw_mbs_01 <24> } ATM_TD_BEST_EFFORT { altbest_effort <0> }
++ }
++ }
++}
++
++
++def ie_min_td = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length { # @@@ UNI 4.0 does not specify the coding
++ _id "atm_td" <8> = multi {
++ ATM_TD_FW_PCR_0 { minfw_pcr_0 <24> } ATM_TD_BW_PCR_0 { minbw_pcr_0 <24> } ATM_TD_FW_PCR_01 { minfw_pcr_01 <24> } ATM_TD_BW_PCR_01 { minbw_pcr_01 <24> }
++ ATM_TD_FW_MCR_01 { minfw_mcr_01 <24> } ATM_TD_BW_MCR_01 { minbw_mcr_01 <24> }
++ }
++ }
++}
++
++
++def ie_eqos = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ eqos_origin "atm_eqo" <8>
++ _id "atm_eqp" <8> = multi {
++ ATM_EQP_ACC_FW_CDV {
++ acc_fw_cdv <24>
++ }
++ ATM_EQP_ACC_BW_CDV {
++ acc_bw_cdv <24>
++ }
++ ATM_EQP_CUM_FW_CDV {
++ cum_fw_cdv <24>
++ }
++ ATM_EQP_CUM_BW_CDV {
++ cum_bw_cdv <24>
++ }
++ ATM_EQP_ACC_FW_CLR {
++ acc_fw_clr <8>
++ }
++ ATM_EQP_ACC_BW_CLR {
++ acc_bw_clr <8>
++ }
++ }
++ }
++}
++
++
++def ie_abr_add_prm = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _id "atm_aap" <8> = multi {
++ ATM_AAP_FW_REC {
++ abr_fw_add_rec <32>
++ }
++ ATM_AAP_BW_REC {
++ abr_bw_add_rec <32>
++ }
++ }
++ }
++}
++
++
++def ie_abr_set_prm = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_NET _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length { # @@@ UNI 4.0 does not specify the coding
++ _id "atm_asp" <8> = multi {
++ ATM_ASP_FW_ICR {
++ abr_fw_icr <24>
++ }
++ ATM_ASP_BW_ICR {
++ abr_bw_icr <24>
++ }
++ ATM_ASP_FW_TBE {
++ abr_fw_tbe <24>
++ }
++ ATM_ASP_BW_TBE {
++ abr_bw_tbe <24>
++ }
++ ATM_ASP_CRF_RTT {
++ atm_crf_rtt <24>
++ }
++ ATM_ASP_FW_RIF {
++ atm_fw_rif <8>
++ }
++ ATM_ASP_BW_RIF {
++ atm_bw_rif <8>
++ }
++ ATM_ASP_FW_RDF {
++ atm_fw_rdf <8>
++ }
++ ATM_ASP_BW_RDF {
++ atm_bw_rdf <8>
++ }
++ }
++ }
++}
++
++
++
++
++def ie_ep_ref = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ _ep_type <8> = 0
++ ep_ref <16>
++ }
++}
++
++
++def ie_ep_state = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ ep_state <6@1>
++ }
++}
++
++
++
++
++def ie_bbrt = {
++ _ext <1@8,more> = 1 _cs "q2931_cs" <2@6,more> = Q2931_CS_ITU _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length {
++ type_of_report "atm_tor" <8>
++ }
++}
++
++
++
++
++{
++ _pdsc "q2931_proto" <8> = Q2931_PROTO_DSC
++ _cr_len <8> = 3
++ call_ref <24>
++ msg_type "atm_msg" <8>
++ _ext <1@8,more> = 1
++ _flag "atm_flag" <1@5,more> = ATM_FLAG_NO
++ _action_ind "atm_ai_msg" <2@1> = 0
++ msg_len <16> = length {
++ _ie_id "atm_ie" <8> = multi {
++ aal: ATM_IE_AAL ie_aal
++ td: ATM_IE_TD ie_td
++ bbcap: ATM_IE_BBCAP ie_bbcap
++ bhli: ATM_IE_BHLI ie_bhli
++ blli1: ATM_IE_BLLI ie_blli
++ blli2: ATM_IE_BLLI ie_blli
++ blli3: ATM_IE_BLLI ie_blli
++ call_state: ATM_IE_CALL_STATE ie_call_state
++ cdpn: ATM_IE_CDPN ie_cdpn
++ cdps: ATM_IE_CDPS ie_cdps
++ cgpn: ATM_IE_CGPN ie_cgpn
++ cgps: ATM_IE_CGPS ie_cgps
++ cause: ATM_IE_CAUSE ie_cause
++ cause2: ATM_IE_CAUSE ie_cause
++ conn_id: ATM_IE_CONN_ID ie_conn_id
++
++ e2e_tdl: ATM_IE_E2E_TDL ie_e2e_tdl
++
++ qos: ATM_IE_QOS ie_qos
++ bbrep: ATM_IE_BBREP ie_bbrep
++ restart: ATM_IE_RESTART ie_restart
++ bbs_comp: ATM_IE_BBS_COMP ie_bbs_comp
++ tns: ATM_IE_TNS ie_tns
++
++ notify: ATM_IE_NOTIFY ie_notify
++ oam_td: ATM_IE_OAM_TD ie_oam_td
++ git: ATM_IE_GIT ie_git
++ git2: ATM_IE_GIT ie_git
++ git3: ATM_IE_GIT ie_git
++ lij_id: ATM_IE_LIJ_ID ie_lij_id
++ lij_prm: ATM_IE_LIJ_PRM ie_lij_prm
++ leaf_sn: ATM_IE_LEAF_SN ie_leaf_sn
++ scope_sel: ATM_IE_SCOPE_SEL ie_scope_sel
++ alt_td: ATM_IE_ALT_TD ie_alt_td
++ min_td: ATM_IE_MIN_TD ie_min_td
++ eqos: ATM_IE_EQOS ie_eqos
++ abr_add_prm:ATM_IE_ABR_ADD_PRM ie_abr_add_prm
++ abr_set_prm:ATM_IE_ABR_SET_PRM ie_abr_set_prm
++
++ ep_ref: ATM_IE_EPR ie_ep_ref
++ ep_state: ATM_IE_EP_STATE ie_ep_state
++
++ bbrt: ATM_IE_BBRT ie_bbrt
++
++ default 0 {
++ _ext <1@8,more> = 1 __cs "q2931_cs" <2@6,more> = 0 _flag "atm_flag" <1@5,more> = ATM_FLAG_NO _action_ind "atm_ai_ie" <3@1> = 0 _ie_len <16> = recover RECOV_IND_IE length
++ abort RECOV_ASE_UNKNOWN_IE
++ }
++ }
++ }
++}
+--- linux-atm-2.4.1.orig/src/saal/Makefile.in
++++ linux-atm-2.4.1/src/saal/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -87,8 +87,7 @@
+
+ noinst_LIBRARIES = libsaal.a
+
+-libsaal_a_SOURCES = pdu.h queue.h saal.h sscf.h sscop.h pdu.c queue.c saal.c \
+- sscf.c sscop.c
++libsaal_a_SOURCES = pdu.h queue.h saal.h sscf.h sscop.h pdu.c queue.c saal.c sscf.c sscop.c
+
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../../config.h
+@@ -114,8 +113,10 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/pdu.P .deps/queue.P .deps/saal.P .deps/sscf.P \
++.deps/sscop.P
+ SOURCES = $(libsaal_a_SOURCES)
+ OBJECTS = $(libsaal_a_OBJECTS)
+
+@@ -123,9 +124,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/saal/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/saal/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -139,9 +140,6 @@
+
+ maintainer-clean-noinstLIBRARIES:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -164,9 +162,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -206,7 +201,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -222,6 +217,11 @@
+ subdir = src/saal
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/saal/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -232,20 +232,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-pdu.o: pdu.c ../../config.h ../../src/include/stdint.h pdu.h \
+- ../../src/include/atmd.h ../../src/include/atm.h
+-queue.o: queue.c ../../config.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h queue.h
+-saal.o: saal.c ../../config.h sscop.h ../../src/include/stdint.h \
+- ../../src/include/atmd.h ../../src/include/atm.h queue.h saal.h \
+- sscf.h
+-sscf.o: sscf.c ../../config.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h sscop.h \
+- queue.h sscf.h
+-sscop.o: sscop.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atmd.h ../../src/include/atm.h sscop.h \
+- queue.h pdu.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -282,27 +300,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-noinstLIBRARIES clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-noinstLIBRARIES distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -313,12 +331,14 @@
+ mostlyclean-compile distclean-compile clean-compile \
+ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/sigd/Makefile.in
++++ linux-atm-2.4.1/src/sigd/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -88,14 +88,9 @@
+ INCLUDES = -I$(top_builddir)/src/qgen -I$(top_builddir)/src/saal -I.
+
+ sbin_PROGRAMS = atmsigd
+-atmsigd_SOURCES = atmsigd.c io.c io.h kernel.c proto.c proto.h uni.c \
+- sap.c sap.h timeout.c timeout.h trace.c trace.h \
+- policy.c policy.h cfg_y.y cfg_l.l
+-
+-atmsigd_XTRAS = mess.o $(top_builddir)/src/qgen/q.out.o \
+- $(top_builddir)/src/qgen/qd.dump.o \
+- $(top_builddir)/src/lib/libatm.la \
+- $(top_builddir)/src/saal/libsaal.a
++atmsigd_SOURCES = atmsigd.c io.c io.h kernel.c proto.c proto.h uni.c sap.c sap.h timeout.c timeout.h trace.c trace.h policy.c policy.h cfg_y.y cfg_l.l
++
++atmsigd_XTRAS = mess.o $(top_builddir)/src/qgen/q.out.o $(top_builddir)/src/qgen/qd.dump.o $(top_builddir)/src/lib/libatm.la $(top_builddir)/src/saal/libsaal.a
+
+ atmsigd_LDADD = $(atmsigd_XTRAS) -lfl
+ atmsigd_DEPENDENCIES = mess.c $(atmsigd_XTRAS)
+@@ -140,8 +135,11 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/atmsigd.P .deps/cfg_l.P .deps/cfg_y.P .deps/io.P \
++.deps/kernel.P .deps/policy.P .deps/proto.P .deps/sap.P .deps/timeout.P \
++.deps/trace.P .deps/uni.P
+ SOURCES = $(atmsigd_SOURCES)
+ OBJECTS = $(atmsigd_OBJECTS)
+
+@@ -149,9 +147,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .l .lo .o .obj .s .y
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/sigd/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/sigd/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -181,9 +179,6 @@
+ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -206,9 +201,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -347,7 +339,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -363,6 +355,11 @@
+ subdir = src/sigd
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/sigd/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -373,69 +370,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-atmsigd.o: atmsigd.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h \
+- ../../src/qgen/qlib.h io.h proto.h ../../src/include/atmsap.h \
+- ../../src/saal/saal.h ../../src/saal/sscf.h \
+- ../../src/saal/sscop.h ../../src/saal/queue.h trace.h
+-cfg_l.o: cfg_l.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h cfg_y.h
+-cfg_y.o: cfg_y.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h proto.h \
+- ../../src/include/atmsap.h ../../src/saal/saal.h \
+- ../../src/saal/sscf.h ../../src/saal/sscop.h \
+- ../../src/saal/queue.h io.h trace.h policy.h
+-io.o: io.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h \
+- ../../src/qgen/uni.h ../../src/saal/pdu.h proto.h \
+- ../../src/include/atmsap.h ../../src/saal/saal.h \
+- ../../src/saal/sscf.h ../../src/saal/sscop.h \
+- ../../src/saal/queue.h io.h trace.h
+-kernel.o: kernel.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h \
+- ../../src/qgen/uni.h ../../src/qgen/qlib.h \
+- ../../src/qgen/q.out.h proto.h ../../src/include/atmsap.h \
+- ../../src/saal/saal.h ../../src/saal/sscf.h \
+- ../../src/saal/sscop.h ../../src/saal/queue.h sap.h io.h \
+- policy.h timeout.h
+-mess.o: mess.c ../../config.h
+-policy.o: policy.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h proto.h \
+- ../../src/include/atmsap.h ../../src/saal/saal.h \
+- ../../src/saal/sscf.h ../../src/saal/sscop.h \
+- ../../src/saal/queue.h policy.h
+-proto.o: proto.c ../../config.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h \
+- ../../src/qgen/uni.h ../../src/qgen/qlib.h \
+- ../../src/qgen/q.out.h io.h proto.h ../../src/include/atmsap.h \
+- ../../src/saal/saal.h ../../src/saal/sscf.h \
+- ../../src/saal/sscop.h ../../src/saal/queue.h sap.h
+-sap.o: sap.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h \
+- ../../src/qgen/uni.h ../../src/qgen/qlib.h \
+- ../../src/qgen/q.out.h ../../src/qgen/common.h proto.h \
+- ../../src/include/atmsap.h ../../src/saal/saal.h \
+- ../../src/saal/sscf.h ../../src/saal/sscop.h \
+- ../../src/saal/queue.h sap.h
+-timeout.o: timeout.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h \
+- ../../src/qgen/uni.h proto.h ../../src/include/atmsap.h \
+- ../../src/saal/saal.h ../../src/saal/sscf.h \
+- ../../src/saal/sscop.h ../../src/saal/queue.h timeout.h
+-trace.o: trace.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h \
+- ../../src/include/atmsap.h trace.h proto.h \
+- ../../src/saal/saal.h ../../src/saal/sscf.h \
+- ../../src/saal/sscop.h ../../src/saal/queue.h \
+- ../../src/qgen/qlib.h
+-uni.o: uni.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h \
+- ../../src/qgen/uni.h ../../src/qgen/qlib.h \
+- ../../src/qgen/q.out.h proto.h ../../src/include/atmsap.h \
+- ../../src/saal/saal.h ../../src/saal/sscf.h \
+- ../../src/saal/sscop.h ../../src/saal/queue.h sap.h io.h \
+- policy.h timeout.h trace.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -474,29 +440,29 @@
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+ maintainer-clean-generic:
+- -test -z "cfg_llcfg_yhcfg_yc" || rm -f cfg_ll cfg_yh cfg_yc
++ -test -z "cfg_lccfg_yhcfg_yc" || rm -f cfg_lc cfg_yh cfg_yc
+ mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-sbinPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -509,12 +475,14 @@
+ distclean-libtool clean-libtool maintainer-clean-libtool install-man4 \
+ uninstall-man4 install-man8 uninstall-man8 install-man uninstall-man \
+ uninstall-sysconfDATA install-sysconfDATA tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ mess.c: $(top_builddir)/src/qgen/uni.h mkmess.pl
+--- linux-atm-2.4.1.orig/src/sigd/cfg_y.c
++++ linux-atm-2.4.1/src/sigd/cfg_y.c
+@@ -1,46 +1,137 @@
++/* A Bison parser, made by GNU Bison 1.875d. */
+
+-/* A Bison parser, made from cfg_y.y
+- by GNU Bison version 1.28 */
++/* Skeleton parser for Yacc-like parsing with Bison,
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+-#define YYBISON 1 /* Identify Bison output. */
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
+
+-#define TOK_LEVEL 257
+-#define TOK_DEBUG 258
+-#define TOK_INFO 259
+-#define TOK_WARN 260
+-#define TOK_ERROR 261
+-#define TOK_FATAL 262
+-#define TOK_SIG 263
+-#define TOK_UNI30 264
+-#define TOK_UNI31 265
+-#define TOK_UNI40 266
+-#define TOK_Q2963_1 267
+-#define TOK_SAAL 268
+-#define TOK_VC 269
+-#define TOK_IO 270
+-#define TOK_MODE 271
+-#define TOK_USER 272
+-#define TOK_NET 273
+-#define TOK_SWITCH 274
+-#define TOK_VPCI 275
+-#define TOK_ITF 276
+-#define TOK_PCR 277
+-#define TOK_TRACE 278
+-#define TOK_POLICY 279
+-#define TOK_ALLOW 280
+-#define TOK_REJECT 281
+-#define TOK_ENTITY 282
+-#define TOK_DEFAULT 283
+-#define TOK_NUMBER 284
+-#define TOK_MAX_RATE 285
+-#define TOK_DUMP_DIR 286
+-#define TOK_LOGFILE 287
+-#define TOK_QOS 288
+-#define TOK_FROM 289
+-#define TOK_TO 290
+-#define TOK_ROUTE 291
+-#define TOK_PVC 292
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
+
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA. */
++
++/* As a special exception, when this file is copied by Bison into a
++ Bison output file, you may use that output file without restriction.
++ This special exception was added by the Free Software Foundation
++ in version 1.24 of Bison. */
++
++/* Written by Richard Stallman by simplifying the original so called
++ ``semantic'' parser. */
++
++/* All symbols defined below should begin with yy or YY, to avoid
++ infringing on user name space. This should be done even for local
++ variables, as they might otherwise be expanded by user macros.
++ There are some unavoidable exceptions within include files to
++ define necessary library symbols; they are noted "INFRINGES ON
++ USER NAME SPACE" below. */
++
++/* Identify Bison output. */
++#define YYBISON 1
++
++/* Skeleton name. */
++#define YYSKELETON_NAME "yacc.c"
++
++/* Pure parsers. */
++#define YYPURE 0
++
++/* Using locations. */
++#define YYLSP_NEEDED 0
++
++
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ TOK_LEVEL = 258,
++ TOK_DEBUG = 259,
++ TOK_INFO = 260,
++ TOK_WARN = 261,
++ TOK_ERROR = 262,
++ TOK_FATAL = 263,
++ TOK_SIG = 264,
++ TOK_UNI30 = 265,
++ TOK_UNI31 = 266,
++ TOK_UNI40 = 267,
++ TOK_Q2963_1 = 268,
++ TOK_SAAL = 269,
++ TOK_VC = 270,
++ TOK_IO = 271,
++ TOK_MODE = 272,
++ TOK_USER = 273,
++ TOK_NET = 274,
++ TOK_SWITCH = 275,
++ TOK_VPCI = 276,
++ TOK_ITF = 277,
++ TOK_PCR = 278,
++ TOK_TRACE = 279,
++ TOK_POLICY = 280,
++ TOK_ALLOW = 281,
++ TOK_REJECT = 282,
++ TOK_ENTITY = 283,
++ TOK_DEFAULT = 284,
++ TOK_NUMBER = 285,
++ TOK_MAX_RATE = 286,
++ TOK_DUMP_DIR = 287,
++ TOK_LOGFILE = 288,
++ TOK_QOS = 289,
++ TOK_FROM = 290,
++ TOK_TO = 291,
++ TOK_ROUTE = 292,
++ TOK_PVC = 293
++ };
++#endif
++#define TOK_LEVEL 258
++#define TOK_DEBUG 259
++#define TOK_INFO 260
++#define TOK_WARN 261
++#define TOK_ERROR 262
++#define TOK_FATAL 263
++#define TOK_SIG 264
++#define TOK_UNI30 265
++#define TOK_UNI31 266
++#define TOK_UNI40 267
++#define TOK_Q2963_1 268
++#define TOK_SAAL 269
++#define TOK_VC 270
++#define TOK_IO 271
++#define TOK_MODE 272
++#define TOK_USER 273
++#define TOK_NET 274
++#define TOK_SWITCH 275
++#define TOK_VPCI 276
++#define TOK_ITF 277
++#define TOK_PCR 278
++#define TOK_TRACE 279
++#define TOK_POLICY 280
++#define TOK_ALLOW 281
++#define TOK_REJECT 282
++#define TOK_ENTITY 283
++#define TOK_DEFAULT 284
++#define TOK_NUMBER 285
++#define TOK_MAX_RATE 286
++#define TOK_DUMP_DIR 287
++#define TOK_LOGFILE 288
++#define TOK_QOS 289
++#define TOK_FROM 290
++#define TOK_TO 291
++#define TOK_ROUTE 292
++#define TOK_PVC 293
++
++
++
++
++/* Copy the first part of user declarations. */
+ #line 1 "cfg_y.y"
+
+ /* cfg.y - configuration language */
+@@ -51,6 +142,7 @@
+ #include <config.h>
+ #endif
+
++#include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
+ #include <limits.h>
+@@ -63,6 +155,8 @@
+ #include "trace.h"
+ #include "policy.h"
+
++extern void yywarn(const char *s);
++extern void yyerror(const char *s);
+
+ static RULE *rule;
+ static SIG_ENTITY *curr_sig = &_entity;
+@@ -93,516 +187,830 @@
+ }
+
+
+-#line 53 "cfg_y.y"
+-typedef union {
++
++/* Enabling traces. */
++#ifndef YYDEBUG
++# define YYDEBUG 0
++#endif
++
++/* Enabling verbose error messages. */
++#ifdef YYERROR_VERBOSE
++# undef YYERROR_VERBOSE
++# define YYERROR_VERBOSE 1
++#else
++# define YYERROR_VERBOSE 0
++#endif
++
++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
++#line 56 "cfg_y.y"
++typedef union YYSTYPE {
+ int num;
+ char *str;
+ struct sockaddr_atmpvc pvc;
+ } YYSTYPE;
+-#include <stdio.h>
++/* Line 191 of yacc.c. */
++#line 213 "y.tab.c"
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
++
++
++
++/* Copy the second part of user declarations. */
++
++
++/* Line 214 of yacc.c. */
++#line 225 "y.tab.c"
++
++#if ! defined (yyoverflow) || YYERROR_VERBOSE
++
++# ifndef YYFREE
++# define YYFREE free
++# endif
++# ifndef YYMALLOC
++# define YYMALLOC malloc
++# endif
++
++/* The parser invokes alloca or malloc; define the necessary symbols. */
++
++# ifdef YYSTACK_USE_ALLOCA
++# if YYSTACK_USE_ALLOCA
++# define YYSTACK_ALLOC alloca
++# endif
++# else
++# if defined (alloca) || defined (_ALLOCA_H)
++# define YYSTACK_ALLOC alloca
++# else
++# ifdef __GNUC__
++# define YYSTACK_ALLOC __builtin_alloca
++# endif
++# endif
++# endif
++
++# ifdef YYSTACK_ALLOC
++ /* Pacify GCC's `empty if-body' warning. */
++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
++# else
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++# define YYSTACK_ALLOC YYMALLOC
++# define YYSTACK_FREE YYFREE
++# endif
++#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
++
++
++#if (! defined (yyoverflow) \
++ && (! defined (__cplusplus) \
++ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
++
++/* A type that is properly aligned for any stack member. */
++union yyalloc
++{
++ short int yyss;
++ YYSTYPE yyvs;
++ };
++
++/* The size of the maximum gap between one aligned stack and the next. */
++# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
++
++/* The size of an array large to enough to hold all stacks, each with
++ N elements. */
++# define YYSTACK_BYTES(N) \
++ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
++ + YYSTACK_GAP_MAXIMUM)
++
++/* Copy COUNT objects from FROM to TO. The source and destination do
++ not overlap. */
++# ifndef YYCOPY
++# if defined (__GNUC__) && 1 < __GNUC__
++# define YYCOPY(To, From, Count) \
++ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
++# else
++# define YYCOPY(To, From, Count) \
++ do \
++ { \
++ register YYSIZE_T yyi; \
++ for (yyi = 0; yyi < (Count); yyi++) \
++ (To)[yyi] = (From)[yyi]; \
++ } \
++ while (0)
++# endif
++# endif
++
++/* Relocate STACK from its old location to the new one. The
++ local variables YYSIZE and YYSTACKSIZE give the old and new number of
++ elements in the stack, and YYPTR gives the new location of the
++ stack. Advance YYPTR to a properly aligned location for the next
++ stack. */
++# define YYSTACK_RELOCATE(Stack) \
++ do \
++ { \
++ YYSIZE_T yynewbytes; \
++ YYCOPY (&yyptr->Stack, Stack, yysize); \
++ Stack = &yyptr->Stack; \
++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
++ yyptr += yynewbytes / sizeof (*yyptr); \
++ } \
++ while (0)
+
+-#ifndef __cplusplus
+-#ifndef __STDC__
+-#define const
+-#endif
+ #endif
+
++#if defined (__STDC__) || defined (__cplusplus)
++ typedef signed char yysigned_char;
++#else
++ typedef short int yysigned_char;
++#endif
+
+-
+-#define YYFINAL 117
+-#define YYFLAG -32768
+-#define YYNTBASE 41
+-
+-#define YYTRANSLATE(x) ((unsigned)(x) <= 292 ? yytranslate[x] : 71)
+-
+-static const char yytranslate[] = { 0,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 39, 2, 40, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+- 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+- 37, 38
++/* YYFINAL -- State number of the termination state. */
++#define YYFINAL 53
++/* YYLAST -- Last index in YYTABLE. */
++#define YYLAST 108
++
++/* YYNTOKENS -- Number of terminals. */
++#define YYNTOKENS 41
++/* YYNNTS -- Number of nonterminals. */
++#define YYNNTS 31
++/* YYNRULES -- Number of rules. */
++#define YYNRULES 79
++/* YYNRULES -- Number of states. */
++#define YYNSTATES 117
++
++/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
++#define YYUNDEFTOK 2
++#define YYMAXUTOK 293
++
++#define YYTRANSLATE(YYX) \
++ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
++
++/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
++static const unsigned char yytranslate[] =
++{
++ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 39, 2, 40, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
++ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
++ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
++ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
++ 35, 36, 37, 38
+ };
+
+-#if YYDEBUG != 0
+-static const short yyprhs[] = { 0,
+- 0, 3, 4, 7, 8, 11, 14, 17, 20, 23,
+- 26, 29, 30, 35, 36, 40, 41, 44, 49, 52,
+- 54, 56, 58, 60, 62, 66, 67, 70, 72, 76,
+- 77, 80, 82, 86, 87, 90, 92, 96, 97, 100,
+- 102, 106, 107, 110, 113, 118, 120, 122, 124, 126,
+- 128, 131, 134, 137, 140, 143, 145, 147, 150, 152,
+- 154, 157, 158, 160, 162, 164, 166, 168, 170, 172,
+- 174, 176, 179, 180, 184, 186, 188, 190
++#if YYDEBUG
++/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
++ YYRHS. */
++static const unsigned char yyprhs[] =
++{
++ 0, 0, 3, 6, 7, 10, 11, 14, 17, 20,
++ 23, 26, 29, 32, 33, 38, 39, 43, 44, 47,
++ 52, 55, 57, 59, 61, 63, 65, 69, 70, 73,
++ 75, 79, 80, 83, 85, 89, 90, 93, 95, 99,
++ 100, 103, 105, 109, 110, 113, 116, 121, 123, 125,
++ 127, 129, 131, 134, 137, 140, 143, 146, 148, 150,
++ 153, 155, 157, 160, 161, 163, 165, 167, 169, 171,
++ 173, 175, 177, 179, 182, 183, 187, 189, 191, 193
+ };
+
+-static const short yyrhs[] = { 42,
+- 43, 0, 0, 44, 42, 0, 0, 45, 43, 0,
+- 3, 65, 0, 9, 50, 0, 14, 52, 0, 16,
+- 54, 0, 4, 56, 0, 25, 58, 0, 0, 28,
+- 38, 46, 47, 0, 0, 39, 48, 40, 0, 0,
+- 49, 48, 0, 21, 30, 22, 30, 0, 17, 66,
+- 0, 34, 0, 31, 0, 37, 0, 29, 0, 60,
+- 0, 39, 51, 40, 0, 0, 60, 51, 0, 61,
+- 0, 39, 53, 40, 0, 0, 61, 53, 0, 62,
+- 0, 39, 55, 40, 0, 0, 62, 55, 0, 63,
+- 0, 39, 57, 40, 0, 0, 63, 57, 0, 67,
+- 0, 39, 59, 40, 0, 0, 67, 59, 0, 3,
+- 65, 0, 21, 30, 22, 30, 0, 10, 0, 11,
+- 0, 12, 0, 13, 0, 19, 0, 17, 66, 0,
+- 3, 65, 0, 3, 65, 0, 15, 38, 0, 23,
+- 30, 0, 34, 0, 31, 0, 3, 65, 0, 32,
+- 0, 33, 0, 24, 64, 0, 0, 30, 0, 4,
+- 0, 5, 0, 6, 0, 7, 0, 8, 0, 18,
+- 0, 19, 0, 20, 0, 3, 65, 0, 0, 69,
+- 68, 70, 0, 26, 0, 27, 0, 35, 0, 36,
+- 0
++/* YYRHS -- A `-1'-separated list of the rules' RHS. */
++static const yysigned_char yyrhs[] =
++{
++ 42, 0, -1, 43, 44, -1, -1, 45, 43, -1,
++ -1, 46, 44, -1, 3, 66, -1, 9, 51, -1,
++ 14, 53, -1, 16, 55, -1, 4, 57, -1, 25,
++ 59, -1, -1, 28, 38, 47, 48, -1, -1, 39,
++ 49, 40, -1, -1, 50, 49, -1, 21, 30, 22,
++ 30, -1, 17, 67, -1, 34, -1, 31, -1, 37,
++ -1, 29, -1, 61, -1, 39, 52, 40, -1, -1,
++ 61, 52, -1, 62, -1, 39, 54, 40, -1, -1,
++ 62, 54, -1, 63, -1, 39, 56, 40, -1, -1,
++ 63, 56, -1, 64, -1, 39, 58, 40, -1, -1,
++ 64, 58, -1, 68, -1, 39, 60, 40, -1, -1,
++ 68, 60, -1, 3, 66, -1, 21, 30, 22, 30,
++ -1, 10, -1, 11, -1, 12, -1, 13, -1, 19,
++ -1, 17, 67, -1, 3, 66, -1, 3, 66, -1,
++ 15, 38, -1, 23, 30, -1, 34, -1, 31, -1,
++ 3, 66, -1, 32, -1, 33, -1, 24, 65, -1,
++ -1, 30, -1, 4, -1, 5, -1, 6, -1, 7,
++ -1, 8, -1, 18, -1, 19, -1, 20, -1, 3,
++ 66, -1, -1, 70, 69, 71, -1, 26, -1, 27,
++ -1, 35, -1, 36, -1
+ };
+
+-#endif
+-
+-#if YYDEBUG != 0
+-static const short yyrline[] = { 0,
+- 73, 77, 78, 81, 82, 105, 110, 111, 112, 113,
+- 114, 117, 138, 140, 141, 144, 145, 148, 153, 154,
+- 158, 162, 176, 182, 184, 187, 188, 191, 193, 196,
+- 197, 200, 202, 205, 206, 209, 211, 214, 215, 218,
+- 220, 223, 224, 227, 234, 238, 247, 256, 265, 274,
+- 279, 282, 290, 295, 299, 304, 308, 314, 319, 324,
+- 328, 334, 338, 344, 349, 353, 357, 361, 367, 372,
+- 376, 382, 387, 393, 395, 400, 406, 412
++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
++static const unsigned short int yyrline[] =
++{
++ 0, 77, 77, 80, 81, 84, 85, 109, 113, 114,
++ 115, 116, 117, 122, 121, 151, 152, 155, 156, 160,
++ 164, 165, 169, 173, 187, 194, 195, 198, 199, 203,
++ 204, 207, 208, 212, 213, 216, 217, 221, 222, 225,
++ 226, 230, 231, 234, 235, 239, 245, 249, 258, 267,
++ 276, 285, 290, 294, 302, 306, 310, 315, 319, 326,
++ 330, 335, 339, 346, 349, 356, 360, 364, 368, 372,
++ 379, 383, 387, 394, 399, 398, 407, 411, 418, 423
+ };
+ #endif
+
+-
+-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+-
+-static const char * const yytname[] = { "$","error","$undefined.","TOK_LEVEL",
+-"TOK_DEBUG","TOK_INFO","TOK_WARN","TOK_ERROR","TOK_FATAL","TOK_SIG","TOK_UNI30",
+-"TOK_UNI31","TOK_UNI40","TOK_Q2963_1","TOK_SAAL","TOK_VC","TOK_IO","TOK_MODE",
+-"TOK_USER","TOK_NET","TOK_SWITCH","TOK_VPCI","TOK_ITF","TOK_PCR","TOK_TRACE",
+-"TOK_POLICY","TOK_ALLOW","TOK_REJECT","TOK_ENTITY","TOK_DEFAULT","TOK_NUMBER",
+-"TOK_MAX_RATE","TOK_DUMP_DIR","TOK_LOGFILE","TOK_QOS","TOK_FROM","TOK_TO","TOK_ROUTE",
+-"TOK_PVC","'{'","'}'","all","global","local","item","entity","@1","opt_options",
+-"options","option","sig","sig_items","saal","saal_items","io","io_items","debug",
+-"debug_items","policy","policy_items","sig_item","saal_item","io_item","debug_item",
+-"opt_trace_size","level","mode","policy_item","@2","action","direction", NULL
++#if YYDEBUG || YYERROR_VERBOSE
++/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
++ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
++static const char *const yytname[] =
++{
++ "$end", "error", "$undefined", "TOK_LEVEL", "TOK_DEBUG", "TOK_INFO",
++ "TOK_WARN", "TOK_ERROR", "TOK_FATAL", "TOK_SIG", "TOK_UNI30",
++ "TOK_UNI31", "TOK_UNI40", "TOK_Q2963_1", "TOK_SAAL", "TOK_VC", "TOK_IO",
++ "TOK_MODE", "TOK_USER", "TOK_NET", "TOK_SWITCH", "TOK_VPCI", "TOK_ITF",
++ "TOK_PCR", "TOK_TRACE", "TOK_POLICY", "TOK_ALLOW", "TOK_REJECT",
++ "TOK_ENTITY", "TOK_DEFAULT", "TOK_NUMBER", "TOK_MAX_RATE",
++ "TOK_DUMP_DIR", "TOK_LOGFILE", "TOK_QOS", "TOK_FROM", "TOK_TO",
++ "TOK_ROUTE", "TOK_PVC", "'{'", "'}'", "$accept", "all", "global",
++ "local", "item", "entity", "@1", "opt_options", "options", "option",
++ "sig", "sig_items", "saal", "saal_items", "io", "io_items", "debug",
++ "debug_items", "policy", "policy_items", "sig_item", "saal_item",
++ "io_item", "debug_item", "opt_trace_size", "level", "mode",
++ "policy_item", "@2", "action", "direction", 0
+ };
+ #endif
+
+-static const short yyr1[] = { 0,
+- 41, 42, 42, 43, 43, 44, 44, 44, 44, 44,
+- 44, 46, 45, 47, 47, 48, 48, 49, 49, 49,
+- 49, 49, 49, 50, 50, 51, 51, 52, 52, 53,
+- 53, 54, 54, 55, 55, 56, 56, 57, 57, 58,
+- 58, 59, 59, 60, 60, 60, 60, 60, 60, 60,
+- 60, 61, 62, 62, 62, 62, 62, 63, 63, 63,
+- 63, 64, 64, 65, 65, 65, 65, 65, 66, 66,
+- 66, 67, 68, 67, 69, 69, 70, 70
++# ifdef YYPRINT
++/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
++ token YYLEX-NUM. */
++static const unsigned short int yytoknum[] =
++{
++ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
++ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
++ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
++ 285, 286, 287, 288, 289, 290, 291, 292, 293, 123,
++ 125
+ };
++# endif
+
+-static const short yyr2[] = { 0,
+- 2, 0, 2, 0, 2, 2, 2, 2, 2, 2,
+- 2, 0, 4, 0, 3, 0, 2, 4, 2, 1,
+- 1, 1, 1, 1, 3, 0, 2, 1, 3, 0,
+- 2, 1, 3, 0, 2, 1, 3, 0, 2, 1,
+- 3, 0, 2, 2, 4, 1, 1, 1, 1, 1,
+- 2, 2, 2, 2, 2, 1, 1, 2, 1, 1,
+- 2, 0, 1, 1, 1, 1, 1, 1, 1, 1,
+- 1, 2, 0, 3, 1, 1, 1, 1
++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
++static const unsigned char yyr1[] =
++{
++ 0, 41, 42, 43, 43, 44, 44, 45, 45, 45,
++ 45, 45, 45, 47, 46, 48, 48, 49, 49, 50,
++ 50, 50, 50, 50, 50, 51, 51, 52, 52, 53,
++ 53, 54, 54, 55, 55, 56, 56, 57, 57, 58,
++ 58, 59, 59, 60, 60, 61, 61, 61, 61, 61,
++ 61, 61, 61, 62, 63, 63, 63, 63, 63, 64,
++ 64, 64, 64, 65, 65, 66, 66, 66, 66, 66,
++ 67, 67, 67, 68, 69, 68, 70, 70, 71, 71
+ };
+
+-static const short yydefact[] = { 2,
+- 0, 0, 0, 0, 0, 0, 4, 2, 64, 65,
+- 66, 67, 68, 6, 0, 62, 59, 60, 38, 10,
+- 36, 0, 46, 47, 48, 49, 0, 50, 0, 26,
+- 7, 24, 0, 30, 8, 28, 0, 0, 0, 57,
+- 56, 34, 9, 32, 0, 75, 76, 42, 11, 40,
+- 73, 0, 1, 4, 3, 58, 63, 61, 0, 38,
+- 44, 69, 70, 71, 51, 0, 0, 26, 52, 0,
+- 30, 53, 54, 55, 0, 34, 72, 0, 42, 0,
+- 12, 5, 37, 39, 0, 25, 27, 29, 31, 33,
+- 35, 41, 43, 77, 78, 74, 14, 45, 16, 13,
+- 0, 0, 23, 21, 20, 22, 0, 16, 19, 0,
+- 15, 17, 0, 18, 0, 0, 0
++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
++static const unsigned char yyr2[] =
++{
++ 0, 2, 2, 0, 2, 0, 2, 2, 2, 2,
++ 2, 2, 2, 0, 4, 0, 3, 0, 2, 4,
++ 2, 1, 1, 1, 1, 1, 3, 0, 2, 1,
++ 3, 0, 2, 1, 3, 0, 2, 1, 3, 0,
++ 2, 1, 3, 0, 2, 2, 4, 1, 1, 1,
++ 1, 1, 2, 2, 2, 2, 2, 1, 1, 2,
++ 1, 1, 2, 0, 1, 1, 1, 1, 1, 1,
++ 1, 1, 1, 2, 0, 3, 1, 1, 1, 1
+ };
+
+-static const short yydefgoto[] = { 115,
+- 7, 53, 8, 54, 97, 100, 107, 108, 31, 67,
+- 35, 70, 43, 75, 20, 59, 49, 78, 68, 71,
+- 76, 60, 58, 14, 65, 79, 80, 51, 96
++/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
++ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
++ means the default is an error. */
++static const unsigned char yydefact[] =
++{
++ 3, 0, 0, 0, 0, 0, 0, 0, 5, 3,
++ 65, 66, 67, 68, 69, 7, 0, 63, 60, 61,
++ 39, 11, 37, 0, 47, 48, 49, 50, 0, 51,
++ 0, 27, 8, 25, 0, 31, 9, 29, 0, 0,
++ 0, 58, 57, 35, 10, 33, 0, 76, 77, 43,
++ 12, 41, 74, 1, 0, 2, 5, 4, 59, 64,
++ 62, 0, 39, 45, 70, 71, 72, 52, 0, 0,
++ 27, 53, 0, 31, 54, 55, 56, 0, 35, 73,
++ 0, 43, 0, 13, 6, 38, 40, 0, 26, 28,
++ 30, 32, 34, 36, 42, 44, 78, 79, 75, 15,
++ 46, 17, 14, 0, 0, 24, 22, 21, 23, 0,
++ 17, 20, 0, 16, 18, 0, 19
+ };
+
+-static const short yypact[] = { 52,
+- 100, 1, -3, -1, -2, 0, -17, 52,-32768,-32768,
+--32768,-32768,-32768,-32768, 100, -18,-32768,-32768, 25,-32768,
+--32768, 100,-32768,-32768,-32768,-32768, 60,-32768, -15, 82,
+--32768,-32768, 100, 14,-32768,-32768, 100, -19, -10,-32768,
+--32768, 20,-32768,-32768, 100,-32768,-32768, 19,-32768,-32768,
+--32768, -14,-32768, -17,-32768,-32768,-32768,-32768, -9, 25,
+--32768,-32768,-32768,-32768,-32768, 8, 2, 82,-32768, 4,
+- 14,-32768,-32768,-32768, 7, 20,-32768, 10, 19, -30,
+--32768,-32768,-32768,-32768, 22,-32768,-32768,-32768,-32768,-32768,
+--32768,-32768,-32768,-32768,-32768,-32768, 21,-32768, 53,-32768,
+- 60, 23,-32768,-32768,-32768,-32768, 24, 53,-32768, 40,
+--32768,-32768, 35,-32768, 67, 69,-32768
++/* YYDEFGOTO[NTERM-NUM]. */
++static const yysigned_char yydefgoto[] =
++{
++ -1, 7, 8, 55, 9, 56, 99, 102, 109, 110,
++ 32, 69, 36, 72, 44, 77, 21, 61, 50, 80,
++ 70, 73, 78, 62, 60, 15, 67, 81, 82, 52,
++ 98
+ };
+
+-static const short yypgoto[] = {-32768,
+- 64, 27,-32768,-32768,-32768,-32768, -35,-32768,-32768, 15,
+--32768, 5,-32768, 12,-32768, 29,-32768, -4, 83, 87,
+- 91, 95,-32768, 26, 9, 92,-32768,-32768,-32768
++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
++ STATE-NUM. */
++#define YYPACT_NINF -31
++static const yysigned_char yypact[] =
++{
++ 53, 69, 1, -3, -1, -2, 0, 11, -16, 53,
++ -31, -31, -31, -31, -31, -31, 69, -15, -31, -31,
++ 28, -31, -31, 69, -31, -31, -31, -31, 46, -31,
++ -13, 80, -31, -31, 69, 16, -31, -31, 69, -18,
++ -6, -31, -31, 20, -31, -31, 69, -31, -31, 19,
++ -31, -31, -31, -31, -10, -31, -16, -31, -31, -31,
++ -31, 2, 28, -31, -31, -31, -31, -31, 8, 4,
++ 80, -31, 7, 16, -31, -31, -31, 9, 20, -31,
++ 10, 19, -30, -31, -31, -31, -31, 23, -31, -31,
++ -31, -31, -31, -31, -31, -31, -31, -31, -31, 31,
++ -31, 51, -31, 46, 49, -31, -31, -31, -31, 15,
++ 51, -31, 36, -31, -31, 54, -31
+ };
+
+-
+-#define YYLAST 110
+-
+-
+-static const short yytable[] = { 22,
+- 37, 33, 45, 15, 94, 95, 23, 24, 25, 26,
+- 52, 57, 38, 27, 66, 28, 33, 29, 73, 74,
+- 39, 45, 37, 81, 16, 46, 47, 15, 40, 85,
+- 83, 41, 17, 18, 38, 30, 42, 34, 48, 19,
+- 56, 86, 39, 88, 46, 47, 90, 61, 16, 92,
+- 40, 98, 110, 41, 1, 2, 17, 18, 69, 99,
+- 3, 113, 72, 111, 114, 4, 116, 5, 117, 101,
+- 77, 55, 112, 102, 93, 89, 6, 62, 63, 64,
+- 82, 103, 87, 104, 22, 32, 105, 91, 84, 106,
+- 36, 23, 24, 25, 26, 44, 21, 50, 27, 0,
+- 28, 0, 29, 9, 10, 11, 12, 13, 0, 109
++/* YYPGOTO[NTERM-NUM]. */
++static const yysigned_char yypgoto[] =
++{
++ -31, -31, 72, 30, -31, -31, -31, -31, -23, -31,
++ -31, 24, -31, 22, -31, 18, -31, 27, -31, 17,
++ 97, 98, 99, 101, -31, 25, 3, 102, -31, -31,
++ -31
+ };
+
+-static const short yycheck[] = { 3,
+- 3, 3, 3, 3, 35, 36, 10, 11, 12, 13,
+- 28, 30, 15, 17, 30, 19, 3, 21, 38, 30,
+- 23, 3, 3, 38, 24, 26, 27, 3, 31, 22,
+- 40, 34, 32, 33, 15, 39, 39, 39, 39, 39,
+- 15, 40, 23, 40, 26, 27, 40, 22, 24, 40,
+- 31, 30, 30, 34, 3, 4, 32, 33, 33, 39,
+- 9, 22, 37, 40, 30, 14, 0, 16, 0, 17,
+- 45, 8, 108, 21, 79, 71, 25, 18, 19, 20,
+- 54, 29, 68, 31, 3, 3, 34, 76, 60, 37,
+- 4, 10, 11, 12, 13, 5, 2, 6, 17, -1,
+- 19, -1, 21, 4, 5, 6, 7, 8, -1, 101
++/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
++ positive, shift that token. If negative, reduce the rule which
++ number is the opposite. If zero, do what YYDEFACT says.
++ If YYTABLE_NINF, syntax error. */
++#define YYTABLE_NINF -1
++static const unsigned char yytable[] =
++{
++ 23, 38, 34, 46, 16, 96, 97, 24, 25, 26,
++ 27, 53, 54, 39, 28, 59, 29, 68, 30, 34,
++ 75, 40, 46, 38, 76, 17, 47, 48, 83, 41,
++ 87, 16, 42, 18, 19, 39, 31, 43, 35, 49,
++ 20, 58, 85, 40, 88, 47, 48, 90, 63, 92,
++ 94, 41, 17, 100, 42, 113, 1, 2, 115, 71,
++ 18, 19, 3, 74, 64, 65, 66, 4, 103, 5,
++ 101, 79, 104, 10, 11, 12, 13, 14, 6, 112,
++ 105, 57, 106, 23, 116, 107, 84, 114, 108, 86,
++ 24, 25, 26, 27, 89, 91, 93, 28, 95, 29,
++ 33, 30, 37, 22, 45, 0, 111, 0, 51
+ };
+-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+-#line 3 "/usr/lib/bison.simple"
+-/* This file comes from bison-1.28. */
+-
+-/* Skeleton output parser for bison,
+- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
+-
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
+- any later version.
+
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
+-
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software
+- Foundation, Inc., 59 Temple Place - Suite 330,
+- Boston, MA 02111-1307, USA. */
+-
+-/* As a special exception, when this file is copied by Bison into a
+- Bison output file, you may use that output file without restriction.
+- This special exception was added by the Free Software Foundation
+- in version 1.24 of Bison. */
++static const yysigned_char yycheck[] =
++{
++ 3, 3, 3, 3, 3, 35, 36, 10, 11, 12,
++ 13, 0, 28, 15, 17, 30, 19, 30, 21, 3,
++ 38, 23, 3, 3, 30, 24, 26, 27, 38, 31,
++ 22, 3, 34, 32, 33, 15, 39, 39, 39, 39,
++ 39, 16, 40, 23, 40, 26, 27, 40, 23, 40,
++ 40, 31, 24, 30, 34, 40, 3, 4, 22, 34,
++ 32, 33, 9, 38, 18, 19, 20, 14, 17, 16,
++ 39, 46, 21, 4, 5, 6, 7, 8, 25, 30,
++ 29, 9, 31, 3, 30, 34, 56, 110, 37, 62,
++ 10, 11, 12, 13, 70, 73, 78, 17, 81, 19,
++ 3, 21, 4, 2, 5, -1, 103, -1, 6
++};
+
+-/* This is the parser code that is written into each bison parser
+- when the %semantic_parser declaration is not specified in the grammar.
+- It was written by Richard Stallman by simplifying the hairy parser
+- used when %semantic_parser is specified. */
+-
+-#ifndef YYSTACK_USE_ALLOCA
+-#ifdef alloca
+-#define YYSTACK_USE_ALLOCA
+-#else /* alloca not defined */
+-#ifdef __GNUC__
+-#define YYSTACK_USE_ALLOCA
+-#define alloca __builtin_alloca
+-#else /* not GNU C. */
+-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+-#define YYSTACK_USE_ALLOCA
+-#include <alloca.h>
+-#else /* not sparc */
+-/* We think this test detects Watcom and Microsoft C. */
+-/* This used to test MSDOS, but that is a bad idea
+- since that symbol is in the user namespace. */
+-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+-#if 0 /* No need for malloc.h, which pollutes the namespace;
+- instead, just don't use alloca. */
+-#include <malloc.h>
+-#endif
+-#else /* not MSDOS, or __TURBOC__ */
+-#if defined(_AIX)
+-/* I don't know what this was needed for, but it pollutes the namespace.
+- So I turned it off. rms, 2 May 1997. */
+-/* #include <malloc.h> */
+- #pragma alloca
+-#define YYSTACK_USE_ALLOCA
+-#else /* not MSDOS, or __TURBOC__, or _AIX */
+-#if 0
+-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+- and on HPUX 10. Eventually we can turn this on. */
+-#define YYSTACK_USE_ALLOCA
+-#define alloca __builtin_alloca
+-#endif /* __hpux */
+-#endif
+-#endif /* not _AIX */
+-#endif /* not MSDOS, or __TURBOC__ */
+-#endif /* not sparc */
+-#endif /* not GNU C */
+-#endif /* alloca not defined */
+-#endif /* YYSTACK_USE_ALLOCA not defined */
++/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
++ symbol of state STATE-NUM. */
++static const unsigned char yystos[] =
++{
++ 0, 3, 4, 9, 14, 16, 25, 42, 43, 45,
++ 4, 5, 6, 7, 8, 66, 3, 24, 32, 33,
++ 39, 57, 64, 3, 10, 11, 12, 13, 17, 19,
++ 21, 39, 51, 61, 3, 39, 53, 62, 3, 15,
++ 23, 31, 34, 39, 55, 63, 3, 26, 27, 39,
++ 59, 68, 70, 0, 28, 44, 46, 43, 66, 30,
++ 65, 58, 64, 66, 18, 19, 20, 67, 30, 52,
++ 61, 66, 54, 62, 66, 38, 30, 56, 63, 66,
++ 60, 68, 69, 38, 44, 40, 58, 22, 40, 52,
++ 40, 54, 40, 56, 40, 60, 35, 36, 71, 47,
++ 30, 39, 48, 17, 21, 29, 31, 34, 37, 49,
++ 50, 67, 30, 40, 49, 22, 30
++};
+
+-#ifdef YYSTACK_USE_ALLOCA
+-#define YYSTACK_ALLOC alloca
+-#else
+-#define YYSTACK_ALLOC malloc
++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
++# define YYSIZE_T __SIZE_TYPE__
++#endif
++#if ! defined (YYSIZE_T) && defined (size_t)
++# define YYSIZE_T size_t
++#endif
++#if ! defined (YYSIZE_T)
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++#endif
++#if ! defined (YYSIZE_T)
++# define YYSIZE_T unsigned int
+ #endif
+-
+-/* Note: there must be only one dollar sign in this file.
+- It is replaced by the list of actions, each action
+- as one case of the switch. */
+
+ #define yyerrok (yyerrstatus = 0)
+ #define yyclearin (yychar = YYEMPTY)
+-#define YYEMPTY -2
++#define YYEMPTY (-2)
+ #define YYEOF 0
++
+ #define YYACCEPT goto yyacceptlab
+-#define YYABORT goto yyabortlab
+-#define YYERROR goto yyerrlab1
+-/* Like YYERROR except do call yyerror.
+- This remains here temporarily to ease the
+- transition to the new meaning of YYERROR, for GCC.
++#define YYABORT goto yyabortlab
++#define YYERROR goto yyerrorlab
++
++
++/* Like YYERROR except do call yyerror. This remains here temporarily
++ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
++
+ #define YYFAIL goto yyerrlab
++
+ #define YYRECOVERING() (!!yyerrstatus)
+-#define YYBACKUP(token, value) \
++
++#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY && yylen == 1) \
+- { yychar = (token), yylval = (value); \
+- yychar1 = YYTRANSLATE (yychar); \
++ { \
++ yychar = (Token); \
++ yylval = (Value); \
++ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+- { yyerror ("syntax error: cannot back up"); YYERROR; } \
++ { \
++ yyerror ("syntax error: cannot back up");\
++ YYERROR; \
++ } \
+ while (0)
+
+ #define YYTERROR 1
+ #define YYERRCODE 256
+
+-#ifndef YYPURE
+-#define YYLEX yylex()
+-#endif
++/* YYLLOC_DEFAULT -- Compute the default location (before the actions
++ are run). */
+
+-#ifdef YYPURE
+-#ifdef YYLSP_NEEDED
+-#ifdef YYLEX_PARAM
+-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+-#else
+-#define YYLEX yylex(&yylval, &yylloc)
++#ifndef YYLLOC_DEFAULT
++# define YYLLOC_DEFAULT(Current, Rhs, N) \
++ ((Current).first_line = (Rhs)[1].first_line, \
++ (Current).first_column = (Rhs)[1].first_column, \
++ (Current).last_line = (Rhs)[N].last_line, \
++ (Current).last_column = (Rhs)[N].last_column)
+ #endif
+-#else /* not YYLSP_NEEDED */
++
++/* YYLEX -- calling `yylex' with the right arguments. */
++
+ #ifdef YYLEX_PARAM
+-#define YYLEX yylex(&yylval, YYLEX_PARAM)
++# define YYLEX yylex (YYLEX_PARAM)
+ #else
+-#define YYLEX yylex(&yylval)
+-#endif
+-#endif /* not YYLSP_NEEDED */
++# define YYLEX yylex ()
+ #endif
+
+-/* If nonreentrant, generate the variables here */
++/* Enable debugging if requested. */
++#if YYDEBUG
+
+-#ifndef YYPURE
++# ifndef YYFPRINTF
++# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
++# define YYFPRINTF fprintf
++# endif
++
++# define YYDPRINTF(Args) \
++do { \
++ if (yydebug) \
++ YYFPRINTF Args; \
++} while (0)
++
++# define YYDSYMPRINT(Args) \
++do { \
++ if (yydebug) \
++ yysymprint Args; \
++} while (0)
++
++# define YYDSYMPRINTF(Title, Token, Value, Location) \
++do { \
++ if (yydebug) \
++ { \
++ YYFPRINTF (stderr, "%s ", Title); \
++ yysymprint (stderr, \
++ Token, Value); \
++ YYFPRINTF (stderr, "\n"); \
++ } \
++} while (0)
+
+-int yychar; /* the lookahead symbol */
+-YYSTYPE yylval; /* the semantic value of the */
+- /* lookahead symbol */
++/*------------------------------------------------------------------.
++| yy_stack_print -- Print the state stack from its BOTTOM up to its |
++| TOP (included). |
++`------------------------------------------------------------------*/
+
+-#ifdef YYLSP_NEEDED
+-YYLTYPE yylloc; /* location data for the lookahead */
+- /* symbol */
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yy_stack_print (short int *bottom, short int *top)
++#else
++static void
++yy_stack_print (bottom, top)
++ short int *bottom;
++ short int *top;
+ #endif
++{
++ YYFPRINTF (stderr, "Stack now");
++ for (/* Nothing. */; bottom <= top; ++bottom)
++ YYFPRINTF (stderr, " %d", *bottom);
++ YYFPRINTF (stderr, "\n");
++}
++
++# define YY_STACK_PRINT(Bottom, Top) \
++do { \
++ if (yydebug) \
++ yy_stack_print ((Bottom), (Top)); \
++} while (0)
+
+-int yynerrs; /* number of parse errors so far */
+-#endif /* not YYPURE */
+
+-#if YYDEBUG != 0
+-int yydebug; /* nonzero means print parse trace */
+-/* Since this is uninitialized, it does not stop multiple parsers
+- from coexisting. */
++/*------------------------------------------------.
++| Report that the YYRULE is going to be reduced. |
++`------------------------------------------------*/
++
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yy_reduce_print (int yyrule)
++#else
++static void
++yy_reduce_print (yyrule)
++ int yyrule;
+ #endif
++{
++ int yyi;
++ unsigned int yylno = yyrline[yyrule];
++ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
++ yyrule - 1, yylno);
++ /* Print the symbols being reduced, and their result. */
++ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
++ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
++ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
++}
++
++# define YY_REDUCE_PRINT(Rule) \
++do { \
++ if (yydebug) \
++ yy_reduce_print (Rule); \
++} while (0)
++
++/* Nonzero means print parse trace. It is left uninitialized so that
++ multiple parsers can coexist. */
++int yydebug;
++#else /* !YYDEBUG */
++# define YYDPRINTF(Args)
++# define YYDSYMPRINT(Args)
++# define YYDSYMPRINTF(Title, Token, Value, Location)
++# define YY_STACK_PRINT(Bottom, Top)
++# define YY_REDUCE_PRINT(Rule)
++#endif /* !YYDEBUG */
+
+-/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
++/* YYINITDEPTH -- initial size of the parser's stacks. */
+ #ifndef YYINITDEPTH
+-#define YYINITDEPTH 200
++# define YYINITDEPTH 200
+ #endif
+
+-/* YYMAXDEPTH is the maximum size the stacks can grow to
+- (effective only if the built-in stack extension method is used). */
++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
++ if the built-in stack extension method is used).
+
+-#if YYMAXDEPTH == 0
+-#undef YYMAXDEPTH
++ Do not make this value too large; the results are undefined if
++ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
++ evaluated with infinite-precision integer arithmetic. */
++
++#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
++# undef YYMAXDEPTH
+ #endif
+
+ #ifndef YYMAXDEPTH
+-#define YYMAXDEPTH 10000
++# define YYMAXDEPTH 10000
+ #endif
++
+
+-/* Define __yy_memcpy. Note that the size argument
+- should be passed with type unsigned int, because that is what the non-GCC
+- definitions require. With GCC, __builtin_memcpy takes an arg
+- of type size_t, but it can handle unsigned int. */
+-
+-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+-#else /* not GNU C or C++ */
+-#ifndef __cplusplus
+
+-/* This is the most reliable way to avoid incompatibilities
+- in available built-in functions on various systems. */
+-static void
+-__yy_memcpy (to, from, count)
+- char *to;
+- char *from;
+- unsigned int count;
+-{
+- register char *f = from;
+- register char *t = to;
+- register int i = count;
++#if YYERROR_VERBOSE
+
+- while (i-- > 0)
+- *t++ = *f++;
++# ifndef yystrlen
++# if defined (__GLIBC__) && defined (_STRING_H)
++# define yystrlen strlen
++# else
++/* Return the length of YYSTR. */
++static YYSIZE_T
++# if defined (__STDC__) || defined (__cplusplus)
++yystrlen (const char *yystr)
++# else
++yystrlen (yystr)
++ const char *yystr;
++# endif
++{
++ register const char *yys = yystr;
++
++ while (*yys++ != '\0')
++ continue;
++
++ return yys - yystr - 1;
+ }
++# endif
++# endif
+
+-#else /* __cplusplus */
++# ifndef yystpcpy
++# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
++# define yystpcpy stpcpy
++# else
++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
++ YYDEST. */
++static char *
++# if defined (__STDC__) || defined (__cplusplus)
++yystpcpy (char *yydest, const char *yysrc)
++# else
++yystpcpy (yydest, yysrc)
++ char *yydest;
++ const char *yysrc;
++# endif
++{
++ register char *yyd = yydest;
++ register const char *yys = yysrc;
++
++ while ((*yyd++ = *yys++) != '\0')
++ continue;
++
++ return yyd - 1;
++}
++# endif
++# endif
+
+-/* This is the most reliable way to avoid incompatibilities
+- in available built-in functions on various systems. */
++#endif /* !YYERROR_VERBOSE */
++
++
++
++#if YYDEBUG
++/*--------------------------------.
++| Print this symbol on YYOUTPUT. |
++`--------------------------------*/
++
++#if defined (__STDC__) || defined (__cplusplus)
+ static void
+-__yy_memcpy (char *to, char *from, unsigned int count)
++yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
++#else
++static void
++yysymprint (yyoutput, yytype, yyvaluep)
++ FILE *yyoutput;
++ int yytype;
++ YYSTYPE *yyvaluep;
++#endif
+ {
+- register char *t = to;
+- register char *f = from;
+- register int i = count;
++ /* Pacify ``unused variable'' warnings. */
++ (void) yyvaluep;
+
+- while (i-- > 0)
+- *t++ = *f++;
++ if (yytype < YYNTOKENS)
++ {
++ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
++# ifdef YYPRINT
++ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
++# endif
++ }
++ else
++ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
++
++ switch (yytype)
++ {
++ default:
++ break;
++ }
++ YYFPRINTF (yyoutput, ")");
+ }
+
++#endif /* ! YYDEBUG */
++/*-----------------------------------------------.
++| Release the memory associated to this symbol. |
++`-----------------------------------------------*/
++
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yydestruct (int yytype, YYSTYPE *yyvaluep)
++#else
++static void
++yydestruct (yytype, yyvaluep)
++ int yytype;
++ YYSTYPE *yyvaluep;
+ #endif
+-#endif
++{
++ /* Pacify ``unused variable'' warnings. */
++ (void) yyvaluep;
++
++ switch (yytype)
++ {
++
++ default:
++ break;
++ }
++}
+
+-#line 217 "/usr/lib/bison.simple"
+
+-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+- into yyparse. The argument should have type void *.
+- It should actually point to an object.
+- Grammar actions can access the variable by casting it
+- to the proper pointer type. */
++/* Prevent warnings from -Wmissing-prototypes. */
+
+ #ifdef YYPARSE_PARAM
+-#ifdef __cplusplus
+-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+-#define YYPARSE_PARAM_DECL
+-#else /* not __cplusplus */
+-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+-#endif /* not __cplusplus */
+-#else /* not YYPARSE_PARAM */
+-#define YYPARSE_PARAM_ARG
+-#define YYPARSE_PARAM_DECL
+-#endif /* not YYPARSE_PARAM */
++# if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void *YYPARSE_PARAM);
++# else
++int yyparse ();
++# endif
++#else /* ! YYPARSE_PARAM */
++#if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void);
++#else
++int yyparse ();
++#endif
++#endif /* ! YYPARSE_PARAM */
++
++
++
++/* The lookahead symbol. */
++int yychar;
++
++/* The semantic value of the lookahead symbol. */
++YYSTYPE yylval;
++
++/* Number of syntax errors so far. */
++int yynerrs;
++
++
++
++/*----------.
++| yyparse. |
++`----------*/
+
+-/* Prevent warning if -Wstrict-prototypes. */
+-#ifdef __GNUC__
+ #ifdef YYPARSE_PARAM
+-int yyparse (void *);
++# if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void *YYPARSE_PARAM)
++# else
++int yyparse (YYPARSE_PARAM)
++ void *YYPARSE_PARAM;
++# endif
++#else /* ! YYPARSE_PARAM */
++#if defined (__STDC__) || defined (__cplusplus)
++int
++yyparse (void)
+ #else
+-int yyparse (void);
++int
++yyparse ()
++
+ #endif
+ #endif
+-
+-int
+-yyparse(YYPARSE_PARAM_ARG)
+- YYPARSE_PARAM_DECL
+ {
++
+ register int yystate;
+ register int yyn;
+- register short *yyssp;
++ int yyresult;
++ /* Number of tokens to shift before error messages enabled. */
++ int yyerrstatus;
++ /* Lookahead token as an internal (translated) token number. */
++ int yytoken = 0;
++
++ /* Three stacks and their tools:
++ `yyss': related to states,
++ `yyvs': related to semantic values,
++ `yyls': related to locations.
++
++ Refer to the stacks thru separate pointers, to allow yyoverflow
++ to reallocate them elsewhere. */
++
++ /* The state stack. */
++ short int yyssa[YYINITDEPTH];
++ short int *yyss = yyssa;
++ register short int *yyssp;
++
++ /* The semantic value stack. */
++ YYSTYPE yyvsa[YYINITDEPTH];
++ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+- int yyerrstatus; /* number of tokens to shift before error messages enabled */
+- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+
+- short yyssa[YYINITDEPTH]; /* the state stack */
+- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+-#ifdef YYLSP_NEEDED
+- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+- YYLTYPE *yyls = yylsa;
+- YYLTYPE *yylsp;
+-
+-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+-#else
+ #define YYPOPSTACK (yyvsp--, yyssp--)
+-#endif
+
+- int yystacksize = YYINITDEPTH;
+- int yyfree_stacks = 0;
++ YYSIZE_T yystacksize = YYINITDEPTH;
+
+-#ifdef YYPURE
+- int yychar;
+- YYSTYPE yylval;
+- int yynerrs;
+-#ifdef YYLSP_NEEDED
+- YYLTYPE yylloc;
+-#endif
+-#endif
++ /* The variables used to return semantic value and location from the
++ action routines. */
++ YYSTYPE yyval;
+
+- YYSTYPE yyval; /* the variable used to return */
+- /* semantic values from the action */
+- /* routines */
+
++ /* When reducing, the number of symbols on the RHS of the reduced
++ rule. */
+ int yylen;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Starting parse\n");
+-#endif
++ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+@@ -614,110 +1022,97 @@
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+- yyssp = yyss - 1;
++ yyssp = yyss;
+ yyvsp = yyvs;
+-#ifdef YYLSP_NEEDED
+- yylsp = yyls;
+-#endif
+
+-/* Push a new state, which is found in yystate . */
+-/* In all cases, when you get here, the value and location stacks
+- have just been pushed. so pushing a state here evens the stacks. */
+-yynewstate:
+
+- *++yyssp = yystate;
++ goto yysetstate;
+
+- if (yyssp >= yyss + yystacksize - 1)
+- {
+- /* Give user a chance to reallocate the stack */
+- /* Use copies of these so that the &'s don't force the real ones into memory. */
+- YYSTYPE *yyvs1 = yyvs;
+- short *yyss1 = yyss;
+-#ifdef YYLSP_NEEDED
+- YYLTYPE *yyls1 = yyls;
+-#endif
++/*------------------------------------------------------------.
++| yynewstate -- Push a new state, which is found in yystate. |
++`------------------------------------------------------------*/
++ yynewstate:
++ /* In all cases, when you get here, the value and location stacks
++ have just been pushed. so pushing a state here evens the stacks.
++ */
++ yyssp++;
+
++ yysetstate:
++ *yyssp = yystate;
++
++ if (yyss + yystacksize - 1 <= yyssp)
++ {
+ /* Get the current used size of the three stacks, in elements. */
+- int size = yyssp - yyss + 1;
++ YYSIZE_T yysize = yyssp - yyss + 1;
+
+ #ifdef yyoverflow
+- /* Each stack pointer address is followed by the size of
+- the data in use in that stack, in bytes. */
+-#ifdef YYLSP_NEEDED
+- /* This used to be a conditional around just the two extra args,
+- but that might be undefined if yyoverflow is a macro. */
+- yyoverflow("parser stack overflow",
+- &yyss1, size * sizeof (*yyssp),
+- &yyvs1, size * sizeof (*yyvsp),
+- &yyls1, size * sizeof (*yylsp),
+- &yystacksize);
+-#else
+- yyoverflow("parser stack overflow",
+- &yyss1, size * sizeof (*yyssp),
+- &yyvs1, size * sizeof (*yyvsp),
+- &yystacksize);
+-#endif
+-
+- yyss = yyss1; yyvs = yyvs1;
+-#ifdef YYLSP_NEEDED
+- yyls = yyls1;
+-#endif
++ {
++ /* Give user a chance to reallocate the stack. Use copies of
++ these so that the &'s don't force the real ones into
++ memory. */
++ YYSTYPE *yyvs1 = yyvs;
++ short int *yyss1 = yyss;
++
++
++ /* Each stack pointer address is followed by the size of the
++ data in use in that stack, in bytes. This used to be a
++ conditional around just the two extra args, but that might
++ be undefined if yyoverflow is a macro. */
++ yyoverflow ("parser stack overflow",
++ &yyss1, yysize * sizeof (*yyssp),
++ &yyvs1, yysize * sizeof (*yyvsp),
++
++ &yystacksize);
++
++ yyss = yyss1;
++ yyvs = yyvs1;
++ }
+ #else /* no yyoverflow */
++# ifndef YYSTACK_RELOCATE
++ goto yyoverflowlab;
++# else
+ /* Extend the stack our own way. */
+- if (yystacksize >= YYMAXDEPTH)
+- {
+- yyerror("parser stack overflow");
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
+-#endif
+- }
+- return 2;
+- }
++ if (YYMAXDEPTH <= yystacksize)
++ goto yyoverflowlab;
+ yystacksize *= 2;
+- if (yystacksize > YYMAXDEPTH)
++ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+-#ifndef YYSTACK_USE_ALLOCA
+- yyfree_stacks = 1;
+-#endif
+- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+- __yy_memcpy ((char *)yyss, (char *)yyss1,
+- size * (unsigned int) sizeof (*yyssp));
+- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+- size * (unsigned int) sizeof (*yyvsp));
+-#ifdef YYLSP_NEEDED
+- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+- __yy_memcpy ((char *)yyls, (char *)yyls1,
+- size * (unsigned int) sizeof (*yylsp));
+-#endif
++
++ {
++ short int *yyss1 = yyss;
++ union yyalloc *yyptr =
++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
++ if (! yyptr)
++ goto yyoverflowlab;
++ YYSTACK_RELOCATE (yyss);
++ YYSTACK_RELOCATE (yyvs);
++
++# undef YYSTACK_RELOCATE
++ if (yyss1 != yyssa)
++ YYSTACK_FREE (yyss1);
++ }
++# endif
+ #endif /* no yyoverflow */
+
+- yyssp = yyss + size - 1;
+- yyvsp = yyvs + size - 1;
+-#ifdef YYLSP_NEEDED
+- yylsp = yyls + size - 1;
+-#endif
++ yyssp = yyss + yysize - 1;
++ yyvsp = yyvs + yysize - 1;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+-#endif
+
+- if (yyssp >= yyss + yystacksize - 1)
++ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
++ (unsigned long int) yystacksize));
++
++ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Entering state %d\n", yystate);
+-#endif
++ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+- yybackup:
++
++/*-----------.
++| yybackup. |
++`-----------*/
++yybackup:
+
+ /* Do appropriate processing given the current state. */
+ /* Read a lookahead token if we need one and don't already have one. */
+@@ -726,135 +1121,99 @@
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+- if (yyn == YYFLAG)
++ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+- /* yychar is either YYEMPTY or YYEOF
+- or a valid token in external form. */
+-
++ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Reading a token: ");
+-#endif
++ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+- /* Convert token to internal form (in yychar1) for indexing tables with */
+-
+- if (yychar <= 0) /* This means end of input. */
++ if (yychar <= YYEOF)
+ {
+- yychar1 = 0;
+- yychar = YYEOF; /* Don't call YYLEX any more */
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Now at end of input.\n");
+-#endif
++ yychar = yytoken = YYEOF;
++ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+- yychar1 = YYTRANSLATE(yychar);
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+- /* Give the individual parser a way to print the precise meaning
+- of a token, for further debugging info. */
+-#ifdef YYPRINT
+- YYPRINT (stderr, yychar, yylval);
+-#endif
+- fprintf (stderr, ")\n");
+- }
+-#endif
++ yytoken = YYTRANSLATE (yychar);
++ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+- yyn += yychar1;
+- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
++ /* If the proper action on seeing token YYTOKEN is to reduce or to
++ detect an error, take that action. */
++ yyn += yytoken;
++ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+-
+ yyn = yytable[yyn];
+-
+- /* yyn is what to do for this token type in this state.
+- Negative => reduce, -yyn is rule number.
+- Positive => shift, yyn is new state.
+- New state is final state => don't bother to shift,
+- just return success.
+- 0, or most negative number => error. */
+-
+- if (yyn < 0)
++ if (yyn <= 0)
+ {
+- if (yyn == YYFLAG)
++ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+- else if (yyn == 0)
+- goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+-#endif
++ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+-#ifdef YYLSP_NEEDED
+- *++yylsp = yylloc;
+-#endif
+
+- /* count tokens shifted since error; after three, turn off error status. */
+- if (yyerrstatus) yyerrstatus--;
++
++ /* Count tokens shifted since error; after three, turn off error
++ status. */
++ if (yyerrstatus)
++ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+-/* Do the default action for the current state. */
+-yydefault:
+
++/*-----------------------------------------------------------.
++| yydefault -- do the default action for the current state. |
++`-----------------------------------------------------------*/
++yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
++ goto yyreduce;
++
+
+-/* Do a reduction. yyn is the number of a rule to reduce with. */
++/*-----------------------------.
++| yyreduce -- Do a reduction. |
++`-----------------------------*/
+ yyreduce:
++ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+- if (yylen > 0)
+- yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- int i;
+-
+- fprintf (stderr, "Reducing via rule %d (line %d), ",
+- yyn, yyrline[yyn]);
++ /* If YYLEN is nonzero, implement the default value of the action:
++ `$$ = $1'.
+
+- /* Print the symbols being reduced, and their result. */
+- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+- }
+-#endif
++ Otherwise, the following line sets YYVAL to garbage.
++ This behavior is undocumented and Bison
++ users should not rely upon it. Assigning to YYVAL
++ unconditionally makes the parser a bit smaller, and it avoids a
++ GCC warning that YYVAL may be used uninitialized. */
++ yyval = yyvsp[1-yylen];
+
+
+- switch (yyn) {
+-
+-case 5:
+-#line 83 "cfg_y.y"
+-{
++ YY_REDUCE_PRINT (yyn);
++ switch (yyn)
++ {
++ case 6:
++#line 86 "cfg_y.y"
++ {
+ if (!curr_sig->uni)
+ curr_sig->uni =
+ #if defined(UNI30) || defined(DYNAMIC_UNI)
+@@ -873,17 +1232,19 @@
+ #endif
+ #endif
+ ;
+- ;
+- break;}
+-case 6:
+-#line 107 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 7:
++#line 110 "cfg_y.y"
++ {
+ set_verbosity(NULL,yyvsp[0].num);
+- ;
+- break;}
+-case 12:
+-#line 119 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 13:
++#line 122 "cfg_y.y"
++ {
+ SIG_ENTITY *sig,**walk;
+
+ if (atmpvc_addr_in_use(_entity.signaling_pvc))
+@@ -892,37 +1253,49 @@
+ if (entities == &_entity) entities = NULL;
+ for (sig = entities; sig; sig = sig->next)
+ if (atm_equal((struct sockaddr *) &sig->signaling_pvc,
+- (struct sockaddr *) &yyvsp[0].pvc,0,0))
+- yyerror("duplicate PVC address %d.%d.%d",S_PVC(sig));
++ (struct sockaddr *) &yyvsp[0].pvc,0,0)) {
++ const char *err;
++ asprintf(&err,"duplicate PVC address %d.%d.%d",S_PVC(sig));
++ if(err) {
++ yyerror(err);
++ free(err);
++ }
++ else
++ yyerror("duplicate PVC address");
++ }
+ curr_sig = alloc_t(SIG_ENTITY);
+ *curr_sig = _entity;
+ curr_sig->signaling_pvc = yyvsp[0].pvc;
+ curr_sig->next = NULL;
+ for (walk = &entities; *walk; walk = &(*walk)->next);
+ *walk = curr_sig;
+- ;
+- break;}
+-case 18:
+-#line 150 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 19:
++#line 161 "cfg_y.y"
++ {
+ enter_vpci(curr_sig,yyvsp[-2].num,yyvsp[0].num);
+- ;
+- break;}
+-case 20:
+-#line 155 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 21:
++#line 166 "cfg_y.y"
++ {
+ curr_sig->sig_qos = yyvsp[0].str;
+- ;
+- break;}
+-case 21:
+-#line 159 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 22:
++#line 170 "cfg_y.y"
++ {
+ curr_sig->max_rate = yyvsp[0].num;
+- ;
+- break;}
+-case 22:
+-#line 163 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 23:
++#line 174 "cfg_y.y"
++ {
+ struct sockaddr_atmsvc addr;
+ char *mask;
+
+@@ -931,464 +1304,506 @@
+ if (text2atm(yyvsp[0].str,(struct sockaddr *) &addr,sizeof(addr),
+ T2A_SVC | T2A_WILDCARD | T2A_NAME | T2A_LOCAL) < 0) {
+ yyerror("invalid address");
+- return;
++ return 0;
+ }
+ add_route(curr_sig,&addr,mask ? strtol(mask,NULL,10) : INT_MAX);
+- ;
+- break;}
+-case 23:
+-#line 177 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 24:
++#line 188 "cfg_y.y"
++ {
+ add_route(curr_sig,NULL,0);
+- ;
+- break;}
+-case 44:
+-#line 229 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 45:
++#line 240 "cfg_y.y"
++ {
+ set_verbosity("UNI",yyvsp[0].num);
+ set_verbosity("KERNEL",yyvsp[0].num);
+ set_verbosity("SAP",yyvsp[0].num);
+- ;
+- break;}
+-case 45:
+-#line 235 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 46:
++#line 246 "cfg_y.y"
++ {
+ enter_vpci(curr_sig,yyvsp[-2].num,yyvsp[0].num);
+- ;
+- break;}
+-case 46:
+-#line 239 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 47:
++#line 250 "cfg_y.y"
++ {
+ #if defined(UNI30) || defined(ALLOW_UNI30) || defined(DYNAMIC_UNI)
+ if (curr_sig->uni & ~S_UNI31) yyerror("UNI mode is already set");
+ curr_sig->uni |= S_UNI30;
+ #else
+ yyerror("Sorry, not supported yet");
+ #endif
+- ;
+- break;}
+-case 47:
+-#line 248 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 48:
++#line 259 "cfg_y.y"
++ {
+ #if defined(UNI31) || defined(ALLOW_UNI30) || defined(DYNAMIC_UNI)
+ if (curr_sig->uni & ~S_UNI30) yyerror("UNI mode is already set");
+ curr_sig->uni |= S_UNI31;
+ #else
+ yyerror("Sorry, not supported yet");
+ #endif
+- ;
+- break;}
+-case 48:
+-#line 257 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 49:
++#line 268 "cfg_y.y"
++ {
+ #if defined(UNI40) || defined(DYNAMIC_UNI)
+ if (curr_sig->uni) yyerror("UNI mode is already set");
+ curr_sig->uni = S_UNI40;
+ #else
+ yyerror("Sorry, not supported yet");
+ #endif
+- ;
+- break;}
+-case 49:
+-#line 266 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 50:
++#line 277 "cfg_y.y"
++ {
+ #if defined(Q2963_1) || defined(DYNAMIC_UNI)
+ if (!(curr_sig->uni & S_UNI40)) yyerror("Incompatible UNI mode");
+ curr_sig->uni |= S_Q2963_1;
+ #else
+ yyerror("Sorry, not supported yet");
+ #endif
+- ;
+- break;}
+-case 50:
+-#line 275 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 51:
++#line 286 "cfg_y.y"
++ {
+ yywarn("sig net is obsolete, please use sig mode net instead");
+ curr_sig->mode = sm_net;
+- ;
+- break;}
+-case 52:
+-#line 284 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 53:
++#line 295 "cfg_y.y"
++ {
+ set_verbosity("SSCF",yyvsp[0].num);
+ set_verbosity("SSCOP",yyvsp[0].num);
+- ;
+- break;}
+-case 53:
+-#line 292 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 54:
++#line 303 "cfg_y.y"
++ {
+ set_verbosity("IO",yyvsp[0].num);
+- ;
+- break;}
+-case 54:
+-#line 296 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 55:
++#line 307 "cfg_y.y"
++ {
+ curr_sig->signaling_pvc = yyvsp[0].pvc;
+- ;
+- break;}
+-case 55:
+-#line 300 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 56:
++#line 311 "cfg_y.y"
++ {
+ yywarn("io pcr is obsolete, please use io qos instead");
+ curr_sig->sig_pcr = yyvsp[0].num;
+- ;
+- break;}
+-case 56:
+-#line 305 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 57:
++#line 316 "cfg_y.y"
++ {
+ curr_sig->sig_qos = yyvsp[0].str;
+- ;
+- break;}
+-case 57:
+-#line 309 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 58:
++#line 320 "cfg_y.y"
++ {
+ curr_sig->max_rate = yyvsp[0].num;
+- ;
+- break;}
+-case 58:
+-#line 316 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 59:
++#line 327 "cfg_y.y"
++ {
+ set_verbosity(NULL,yyvsp[0].num);
+- ;
+- break;}
+-case 59:
+-#line 320 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 60:
++#line 331 "cfg_y.y"
++ {
+ dump_dir = yyvsp[0].str;
+ if (!trace_size) trace_size = DEFAULT_TRACE_SIZE;
+- ;
+- break;}
+-case 60:
+-#line 325 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 61:
++#line 336 "cfg_y.y"
++ {
+ set_logfile(yyvsp[0].str);
+- ;
+- break;}
+-case 61:
+-#line 329 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 62:
++#line 340 "cfg_y.y"
++ {
+ trace_size = yyvsp[0].num;
+- ;
+- break;}
+-case 62:
+-#line 335 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 63:
++#line 346 "cfg_y.y"
++ {
+ yyval.num = DEFAULT_TRACE_SIZE;
+- ;
+- break;}
+-case 63:
+-#line 339 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 64:
++#line 350 "cfg_y.y"
++ {
+ yyval.num = yyvsp[0].num;
+- ;
+- break;}
+-case 64:
+-#line 346 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 65:
++#line 357 "cfg_y.y"
++ {
+ yyval.num = DIAG_DEBUG;
+- ;
+- break;}
+-case 65:
+-#line 350 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 66:
++#line 361 "cfg_y.y"
++ {
+ yyval.num = DIAG_INFO;
+- ;
+- break;}
+-case 66:
+-#line 354 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 67:
++#line 365 "cfg_y.y"
++ {
+ yyval.num = DIAG_WARN;
+- ;
+- break;}
+-case 67:
+-#line 358 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 68:
++#line 369 "cfg_y.y"
++ {
+ yyval.num = DIAG_ERROR;
+- ;
+- break;}
+-case 68:
+-#line 362 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 69:
++#line 373 "cfg_y.y"
++ {
+ yyval.num = DIAG_FATAL;
+- ;
+- break;}
+-case 69:
+-#line 369 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 70:
++#line 380 "cfg_y.y"
++ {
+ curr_sig->mode = sm_user;
+- ;
+- break;}
+-case 70:
+-#line 373 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 71:
++#line 384 "cfg_y.y"
++ {
+ curr_sig->mode = sm_net;
+- ;
+- break;}
+-case 71:
+-#line 377 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 72:
++#line 388 "cfg_y.y"
++ {
+ curr_sig->mode = sm_switch;
+- ;
+- break;}
+-case 72:
+-#line 384 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 73:
++#line 395 "cfg_y.y"
++ {
+ set_verbosity("POLICY",yyvsp[0].num);
+- ;
+- break;}
+-case 73:
+-#line 388 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 74:
++#line 399 "cfg_y.y"
++ {
+ rule = alloc_t(RULE);
+ rule->type = yyvsp[0].num;
+- ;
+- break;}
+-case 75:
+-#line 397 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 76:
++#line 408 "cfg_y.y"
++ {
+ yyval.num = ACL_ALLOW;
+- ;
+- break;}
+-case 76:
+-#line 401 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 77:
++#line 412 "cfg_y.y"
++ {
+ yyval.num = ACL_REJECT;
+- ;
+- break;}
+-case 77:
+-#line 408 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 78:
++#line 419 "cfg_y.y"
++ {
+ rule->type |= ACL_IN;
+ put_address(yyvsp[0].str);
+- ;
+- break;}
+-case 78:
+-#line 413 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 79:
++#line 424 "cfg_y.y"
++ {
+ rule->type |= ACL_OUT;
+ put_address(yyvsp[0].str);
+- ;
+- break;}
+-}
+- /* the action file gets copied in in place of this dollarsign */
+-#line 543 "/usr/lib/bison.simple"
++ }
++ break;
++
++
++ }
++
++/* Line 1010 of yacc.c. */
++#line 1585 "y.tab.c"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+-#ifdef YYLSP_NEEDED
+- yylsp -= yylen;
+-#endif
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- short *ssp1 = yyss - 1;
+- fprintf (stderr, "state stack now");
+- while (ssp1 != yyssp)
+- fprintf (stderr, " %d", *++ssp1);
+- fprintf (stderr, "\n");
+- }
+-#endif
++
++ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+-#ifdef YYLSP_NEEDED
+- yylsp++;
+- if (yylen == 0)
+- {
+- yylsp->first_line = yylloc.first_line;
+- yylsp->first_column = yylloc.first_column;
+- yylsp->last_line = (yylsp-1)->last_line;
+- yylsp->last_column = (yylsp-1)->last_column;
+- yylsp->text = 0;
+- }
+- else
+- {
+- yylsp->last_line = (yylsp+yylen-1)->last_line;
+- yylsp->last_column = (yylsp+yylen-1)->last_column;
+- }
+-#endif
+
+- /* Now "shift" the result of the reduction.
+- Determine what state that goes to,
+- based on the state we popped back to
+- and the rule number reduced by. */
++ /* Now `shift' the result of the reduction. Determine what state
++ that goes to, based on the state we popped back to and the rule
++ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
++ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
++ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+- yystate = yydefgoto[yyn - YYNTBASE];
++ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+-yyerrlab: /* here on detecting error */
+
+- if (! yyerrstatus)
+- /* If not already recovering from an error, report this error. */
++/*------------------------------------.
++| yyerrlab -- here on detecting error |
++`------------------------------------*/
++yyerrlab:
++ /* If not already recovering from an error, report this error. */
++ if (!yyerrstatus)
+ {
+ ++yynerrs;
+-
+-#ifdef YYERROR_VERBOSE
++#if YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+- if (yyn > YYFLAG && yyn < YYLAST)
++ if (YYPACT_NINF < yyn && yyn < YYLAST)
+ {
+- int size = 0;
+- char *msg;
+- int x, count;
+-
+- count = 0;
+- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+- for (x = (yyn < 0 ? -yyn : 0);
+- x < (sizeof(yytname) / sizeof(char *)); x++)
+- if (yycheck[x + yyn] == x)
+- size += strlen(yytname[x]) + 15, count++;
+- msg = (char *) malloc(size + 15);
+- if (msg != 0)
++ YYSIZE_T yysize = 0;
++ int yytype = YYTRANSLATE (yychar);
++ const char* yyprefix;
++ char *yymsg;
++ int yyx;
++
++ /* Start YYX at -YYN if negative to avoid negative indexes in
++ YYCHECK. */
++ int yyxbegin = yyn < 0 ? -yyn : 0;
++
++ /* Stay within bounds of both yycheck and yytname. */
++ int yychecklim = YYLAST - yyn;
++ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
++ int yycount = 0;
++
++ yyprefix = ", expecting ";
++ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
++ {
++ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
++ yycount += 1;
++ if (yycount == 5)
++ {
++ yysize = 0;
++ break;
++ }
++ }
++ yysize += (sizeof ("syntax error, unexpected ")
++ + yystrlen (yytname[yytype]));
++ yymsg = (char *) YYSTACK_ALLOC (yysize);
++ if (yymsg != 0)
+ {
+- strcpy(msg, "parse error");
++ char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
++ yyp = yystpcpy (yyp, yytname[yytype]);
+
+- if (count < 5)
++ if (yycount < 5)
+ {
+- count = 0;
+- for (x = (yyn < 0 ? -yyn : 0);
+- x < (sizeof(yytname) / sizeof(char *)); x++)
+- if (yycheck[x + yyn] == x)
++ yyprefix = ", expecting ";
++ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+- strcat(msg, count == 0 ? ", expecting `" : " or `");
+- strcat(msg, yytname[x]);
+- strcat(msg, "'");
+- count++;
++ yyp = yystpcpy (yyp, yyprefix);
++ yyp = yystpcpy (yyp, yytname[yyx]);
++ yyprefix = " or ";
+ }
+ }
+- yyerror(msg);
+- free(msg);
++ yyerror (yymsg);
++ YYSTACK_FREE (yymsg);
+ }
+ else
+- yyerror ("parse error; also virtual memory exceeded");
++ yyerror ("syntax error; also virtual memory exhausted");
+ }
+ else
+ #endif /* YYERROR_VERBOSE */
+- yyerror("parse error");
++ yyerror ("syntax error");
+ }
+
+- goto yyerrlab1;
+-yyerrlab1: /* here on error raised explicitly by an action */
++
+
+ if (yyerrstatus == 3)
+ {
+- /* if just tried and failed to reuse lookahead token after an error, discard it. */
++ /* If just tried and failed to reuse lookahead token after an
++ error, discard it. */
+
+- /* return failure if at end of input */
+- if (yychar == YYEOF)
+- YYABORT;
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+-#endif
++ if (yychar <= YYEOF)
++ {
++ /* If at end of input, pop the error token,
++ then the rest of the stack, then return failure. */
++ if (yychar == YYEOF)
++ for (;;)
++ {
++ YYPOPSTACK;
++ if (yyssp == yyss)
++ YYABORT;
++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
++ yydestruct (yystos[*yyssp], yyvsp);
++ }
++ }
++ else
++ {
++ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
++ yydestruct (yytoken, &yylval);
++ yychar = YYEMPTY;
+
+- yychar = YYEMPTY;
++ }
+ }
+
+- /* Else will try to reuse lookahead token
+- after shifting the error token. */
+-
+- yyerrstatus = 3; /* Each real token shifted decrements this */
++ /* Else will try to reuse lookahead token after shifting the error
++ token. */
++ goto yyerrlab1;
+
+- goto yyerrhandle;
+
+-yyerrdefault: /* current state does not do anything special for the error token. */
++/*---------------------------------------------------.
++| yyerrorlab -- error raised explicitly by YYERROR. |
++`---------------------------------------------------*/
++yyerrorlab:
+
+-#if 0
+- /* This is wrong; only states that explicitly want error tokens
+- should shift them. */
+- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+- if (yyn) goto yydefault;
++#ifdef __GNUC__
++ /* Pacify GCC when the user code never invokes YYERROR and the label
++ yyerrorlab therefore never appears in user code. */
++ if (0)
++ goto yyerrorlab;
+ #endif
+
+-yyerrpop: /* pop the current state because it cannot handle the error token */
+-
+- if (yyssp == yyss) YYABORT;
+- yyvsp--;
+- yystate = *--yyssp;
+-#ifdef YYLSP_NEEDED
+- yylsp--;
+-#endif
++ yyvsp -= yylen;
++ yyssp -= yylen;
++ yystate = *yyssp;
++ goto yyerrlab1;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- short *ssp1 = yyss - 1;
+- fprintf (stderr, "Error: state stack now");
+- while (ssp1 != yyssp)
+- fprintf (stderr, " %d", *++ssp1);
+- fprintf (stderr, "\n");
+- }
+-#endif
+
+-yyerrhandle:
++/*-------------------------------------------------------------.
++| yyerrlab1 -- common code for both syntax error and YYERROR. |
++`-------------------------------------------------------------*/
++yyerrlab1:
++ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+- yyn = yypact[yystate];
+- if (yyn == YYFLAG)
+- goto yyerrdefault;
++ for (;;)
++ {
++ yyn = yypact[yystate];
++ if (yyn != YYPACT_NINF)
++ {
++ yyn += YYTERROR;
++ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
++ {
++ yyn = yytable[yyn];
++ if (0 < yyn)
++ break;
++ }
++ }
+
+- yyn += YYTERROR;
+- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+- goto yyerrdefault;
++ /* Pop the current state because it cannot handle the error token. */
++ if (yyssp == yyss)
++ YYABORT;
+
+- yyn = yytable[yyn];
+- if (yyn < 0)
+- {
+- if (yyn == YYFLAG)
+- goto yyerrpop;
+- yyn = -yyn;
+- goto yyreduce;
++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
++ yydestruct (yystos[yystate], yyvsp);
++ YYPOPSTACK;
++ yystate = *yyssp;
++ YY_STACK_PRINT (yyss, yyssp);
+ }
+- else if (yyn == 0)
+- goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Shifting error token, ");
+-#endif
++ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+-#ifdef YYLSP_NEEDED
+- *++yylsp = yylloc;
+-#endif
++
+
+ yystate = yyn;
+ goto yynewstate;
+
+- yyacceptlab:
+- /* YYACCEPT comes here. */
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
+-#endif
+- }
+- return 0;
+
+- yyabortlab:
+- /* YYABORT comes here. */
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
++/*-------------------------------------.
++| yyacceptlab -- YYACCEPT comes here. |
++`-------------------------------------*/
++yyacceptlab:
++ yyresult = 0;
++ goto yyreturn;
++
++/*-----------------------------------.
++| yyabortlab -- YYABORT comes here. |
++`-----------------------------------*/
++yyabortlab:
++ yyresult = 1;
++ goto yyreturn;
++
++#ifndef yyoverflow
++/*----------------------------------------------.
++| yyoverflowlab -- parser overflow comes here. |
++`----------------------------------------------*/
++yyoverflowlab:
++ yyerror ("parser stack overflow");
++ yyresult = 2;
++ /* Fall through. */
++#endif
++
++yyreturn:
++#ifndef yyoverflow
++ if (yyss != yyssa)
++ YYSTACK_FREE (yyss);
+ #endif
+- }
+- return 1;
++ return yyresult;
+ }
+-#line 418 "cfg_y.y"
++
++
++
+--- linux-atm-2.4.1.orig/src/sigd/proto.c
++++ linux-atm-2.4.1/src/sigd/proto.c
+@@ -259,6 +259,7 @@
+ break;
+ }
+ default:
++ break;
+ }
+ va_end(ap);
+ if ((size = q_close(&dsc)) >= 0) to_signaling(sock->sig,q_buffer,size);
+@@ -288,6 +289,7 @@
+ }
+ break;
+ default:
++ break;
+ }
+ va_end(ap);
+ }
+--- linux-atm-2.4.1.orig/src/sigd/cfg_y.y
++++ linux-atm-2.4.1/src/sigd/cfg_y.y
+@@ -7,6 +7,7 @@
+ #include <config.h>
+ #endif
+
++#include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
+ #include <limits.h>
+@@ -19,6 +20,8 @@
+ #include "trace.h"
+ #include "policy.h"
+
++extern void yywarn(const char *s);
++extern void yyerror(const char *s);
+
+ static RULE *rule;
+ static SIG_ENTITY *curr_sig = &_entity;
+@@ -125,8 +128,16 @@
+ if (entities == &_entity) entities = NULL;
+ for (sig = entities; sig; sig = sig->next)
+ if (atm_equal((struct sockaddr *) &sig->signaling_pvc,
+- (struct sockaddr *) &$2,0,0))
+- yyerror("duplicate PVC address %d.%d.%d",S_PVC(sig));
++ (struct sockaddr *) &$2,0,0)) {
++ const char *err;
++ asprintf(&err,"duplicate PVC address %d.%d.%d",S_PVC(sig));
++ if(err) {
++ yyerror(err);
++ free(err);
++ }
++ else
++ yyerror("duplicate PVC address");
++ }
+ curr_sig = alloc_t(SIG_ENTITY);
+ *curr_sig = _entity;
+ curr_sig->signaling_pvc = $2;
+@@ -169,7 +180,7 @@
+ if (text2atm($1,(struct sockaddr *) &addr,sizeof(addr),
+ T2A_SVC | T2A_WILDCARD | T2A_NAME | T2A_LOCAL) < 0) {
+ yyerror("invalid address");
+- return;
++ return 0;
+ }
+ add_route(curr_sig,&addr,mask ? strtol(mask,NULL,10) : INT_MAX);
+ }
+--- linux-atm-2.4.1.orig/src/sigd/cfg_y.h
++++ linux-atm-2.4.1/src/sigd/cfg_y.h
+@@ -1,44 +1,127 @@
+-typedef union {
++/* A Bison parser, made by GNU Bison 1.875d. */
++
++/* Skeleton parser for Yacc-like parsing with Bison,
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA. */
++
++/* As a special exception, when this file is copied by Bison into a
++ Bison output file, you may use that output file without restriction.
++ This special exception was added by the Free Software Foundation
++ in version 1.24 of Bison. */
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ TOK_LEVEL = 258,
++ TOK_DEBUG = 259,
++ TOK_INFO = 260,
++ TOK_WARN = 261,
++ TOK_ERROR = 262,
++ TOK_FATAL = 263,
++ TOK_SIG = 264,
++ TOK_UNI30 = 265,
++ TOK_UNI31 = 266,
++ TOK_UNI40 = 267,
++ TOK_Q2963_1 = 268,
++ TOK_SAAL = 269,
++ TOK_VC = 270,
++ TOK_IO = 271,
++ TOK_MODE = 272,
++ TOK_USER = 273,
++ TOK_NET = 274,
++ TOK_SWITCH = 275,
++ TOK_VPCI = 276,
++ TOK_ITF = 277,
++ TOK_PCR = 278,
++ TOK_TRACE = 279,
++ TOK_POLICY = 280,
++ TOK_ALLOW = 281,
++ TOK_REJECT = 282,
++ TOK_ENTITY = 283,
++ TOK_DEFAULT = 284,
++ TOK_NUMBER = 285,
++ TOK_MAX_RATE = 286,
++ TOK_DUMP_DIR = 287,
++ TOK_LOGFILE = 288,
++ TOK_QOS = 289,
++ TOK_FROM = 290,
++ TOK_TO = 291,
++ TOK_ROUTE = 292,
++ TOK_PVC = 293
++ };
++#endif
++#define TOK_LEVEL 258
++#define TOK_DEBUG 259
++#define TOK_INFO 260
++#define TOK_WARN 261
++#define TOK_ERROR 262
++#define TOK_FATAL 263
++#define TOK_SIG 264
++#define TOK_UNI30 265
++#define TOK_UNI31 266
++#define TOK_UNI40 267
++#define TOK_Q2963_1 268
++#define TOK_SAAL 269
++#define TOK_VC 270
++#define TOK_IO 271
++#define TOK_MODE 272
++#define TOK_USER 273
++#define TOK_NET 274
++#define TOK_SWITCH 275
++#define TOK_VPCI 276
++#define TOK_ITF 277
++#define TOK_PCR 278
++#define TOK_TRACE 279
++#define TOK_POLICY 280
++#define TOK_ALLOW 281
++#define TOK_REJECT 282
++#define TOK_ENTITY 283
++#define TOK_DEFAULT 284
++#define TOK_NUMBER 285
++#define TOK_MAX_RATE 286
++#define TOK_DUMP_DIR 287
++#define TOK_LOGFILE 288
++#define TOK_QOS 289
++#define TOK_FROM 290
++#define TOK_TO 291
++#define TOK_ROUTE 292
++#define TOK_PVC 293
++
++
++
++
++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
++#line 56 "cfg_y.y"
++typedef union YYSTYPE {
+ int num;
+ char *str;
+ struct sockaddr_atmpvc pvc;
+ } YYSTYPE;
+-#define TOK_LEVEL 257
+-#define TOK_DEBUG 258
+-#define TOK_INFO 259
+-#define TOK_WARN 260
+-#define TOK_ERROR 261
+-#define TOK_FATAL 262
+-#define TOK_SIG 263
+-#define TOK_UNI30 264
+-#define TOK_UNI31 265
+-#define TOK_UNI40 266
+-#define TOK_Q2963_1 267
+-#define TOK_SAAL 268
+-#define TOK_VC 269
+-#define TOK_IO 270
+-#define TOK_MODE 271
+-#define TOK_USER 272
+-#define TOK_NET 273
+-#define TOK_SWITCH 274
+-#define TOK_VPCI 275
+-#define TOK_ITF 276
+-#define TOK_PCR 277
+-#define TOK_TRACE 278
+-#define TOK_POLICY 279
+-#define TOK_ALLOW 280
+-#define TOK_REJECT 281
+-#define TOK_ENTITY 282
+-#define TOK_DEFAULT 283
+-#define TOK_NUMBER 284
+-#define TOK_MAX_RATE 285
+-#define TOK_DUMP_DIR 286
+-#define TOK_LOGFILE 287
+-#define TOK_QOS 288
+-#define TOK_FROM 289
+-#define TOK_TO 290
+-#define TOK_ROUTE 291
+-#define TOK_PVC 292
+-
++/* Line 1285 of yacc.c. */
++#line 119 "y.tab.h"
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
+
+ extern YYSTYPE yylval;
++
++
++
+--- linux-atm-2.4.1.orig/src/maint/Makefile.in
++++ linux-atm-2.4.1/src/maint/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -181,8 +181,11 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/atmaddr.P .deps/atmdiag.P .deps/atmdump.P \
++.deps/atmloop.P .deps/atmtcp.P .deps/enitune.P .deps/esi.P \
++.deps/saaldump.P .deps/sonetdiag.P .deps/zntune.P
+ SOURCES = $(atmdiag_SOURCES) $(atmdump_SOURCES) $(sonetdiag_SOURCES) $(saaldump_SOURCES) $(atmaddr_SOURCES) $(esi_SOURCES) $(atmloop_SOURCES) $(atmtcp_SOURCES) $(enitune_SOURCES) $(zntune_SOURCES)
+ OBJECTS = $(atmdiag_OBJECTS) $(atmdump_OBJECTS) $(sonetdiag_OBJECTS) $(saaldump_OBJECTS) $(atmaddr_OBJECTS) $(esi_OBJECTS) $(atmloop_OBJECTS) $(atmtcp_OBJECTS) $(enitune_OBJECTS) $(zntune_OBJECTS)
+
+@@ -190,9 +193,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/maint/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/maint/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -247,9 +250,6 @@
+ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -272,9 +272,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -388,7 +385,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -404,6 +401,11 @@
+ subdir = src/maint
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/maint/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -414,28 +416,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-atmaddr.o: atmaddr.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-atmdiag.o: atmdiag.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-atmdump.o: atmdump.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h
+-atmloop.o: atmloop.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-atmtcp.o: atmtcp.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmd.h
+-enitune.o: enitune.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-esi.o: esi.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-saaldump.o: saaldump.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/saal/pdu.h \
+- ../../src/include/atmd.h ../../src/qgen/qlib.h
+-sonetdiag.o: sonetdiag.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+-zntune.o: zntune.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -475,18 +487,19 @@
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-sbinPROGRAMS \
+ mostlyclean-compile mostlyclean-libtool \
+- mostlyclean-tags mostlyclean-generic
++ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-binPROGRAMS clean-sbinPROGRAMS clean-compile \
+- clean-libtool clean-tags clean-generic mostlyclean-am
++ clean-libtool clean-tags clean-depend clean-generic \
++ mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-binPROGRAMS distclean-sbinPROGRAMS \
+ distclean-compile distclean-libtool distclean-tags \
+- distclean-generic clean-am
++ distclean-depend distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+@@ -494,7 +507,8 @@
+ maintainer-clean-am: maintainer-clean-binPROGRAMS \
+ maintainer-clean-sbinPROGRAMS maintainer-clean-compile \
+ maintainer-clean-libtool maintainer-clean-tags \
+- maintainer-clean-generic distclean-am
++ maintainer-clean-depend maintainer-clean-generic \
++ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -508,12 +522,14 @@
+ clean-compile maintainer-clean-compile mostlyclean-libtool \
+ distclean-libtool clean-libtool maintainer-clean-libtool install-man8 \
+ uninstall-man8 install-man uninstall-man tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/maint/atmtcp.c
++++ linux-atm-2.4.1/src/maint/atmtcp.c
+@@ -60,7 +60,7 @@
+ static IN *inputs = NULL;
+ static fd_set in_set;
+ static int fds = 0;
+-static int debug = 0;
++static int atmtcp_debug = 0;
+ static int links = 0;
+
+
+@@ -86,7 +86,7 @@
+ {
+ OUT *out;
+
+- if (debug)
++ if (atmtcp_debug)
+ fprintf(stderr,"Emit: %d.%d, %d bytes\n",ntohs(hdr->vpi),
+ ntohs(hdr->vci),(int) ntohl(hdr->length));
+ for (out = outputs; out; out = out->next)
+@@ -99,7 +99,7 @@
+ OUT *out;
+ int changed = 0;
+
+- if (debug)
++ if (atmtcp_debug)
+ fprintf(stderr,"Control: (%d.%d) %s %d.%d, vcc %s\n",
+ ntohs(msg->hdr.vpi),ntohs(msg->hdr.vci),
+ msg->type == ATMTCP_CTRL_OPEN ? "OPEN" :
+@@ -295,19 +295,19 @@
+ }
+ if ((s = socket(PF_ATMPVC,SOCK_DGRAM,0)) < 0) {
+ msg->result = -errno;
+- if (debug) perror("socket");
++ if (atmtcp_debug) perror("socket");
+ return 1;
+ }
+ if (setsockopt(s,SOL_ATM,SO_ATMQOS,&msg->qos,sizeof(msg->qos)) < 0) {
+ msg->result = -errno;
+- if (debug) perror("setsockopt SO_ATMQOS");
++ if (atmtcp_debug) perror("setsockopt SO_ATMQOS");
+ return 1;
+ }
+ msg->addr.sap_addr.itf = data->itf;
+ if (connect(s,(struct sockaddr *) &msg->addr,
+ sizeof(struct sockaddr_atmpvc)) < 0) {
+ msg->result = -errno;
+- if (debug) perror("connect");
++ if (atmtcp_debug) perror("connect");
+ return 1;
+ }
+ (*vcc) = alloc_t(VCC);
+@@ -333,7 +333,7 @@
+ addr.sap_addr.vci = ntohs(hdr->vci);
+ vcc = real_lookup(data,&addr);
+ if (!*vcc) {
+- if (debug)
++ if (atmtcp_debug)
+ fprintf(stderr,"VCC %d.%d not found\n",addr.sap_addr.vpi,
+ addr.sap_addr.vci);
+ return;
+@@ -430,7 +430,7 @@
+ exit(1);
+ }
+ if (in->bytes < sizeof(*hdr)+ntohl(hdr->length)) return;
+- if (debug)
++ if (atmtcp_debug)
+ fprintf(stderr,"TCP %d.%d, %d bytes\n",ntohs(hdr->vpi),
+ ntohs(hdr->vci),(unsigned int) ntohl(hdr->length));
+ in->bytes = 0;
+@@ -447,7 +447,7 @@
+ fprintf(stderr,"unrecognized control message \"%s\"\n",msg);
+ return;
+ }
+- if (debug) fprintf(stderr,"received control \"%s\"\n",msg);
++ if (atmtcp_debug) fprintf(stderr,"received control \"%s\"\n",msg);
+ ctl.hdr.vpi = htons(vpi);
+ ctl.hdr.vci = htons(vci);
+ ctl.hdr.length = htonl(ATMTCP_HDR_MAGIC);
+@@ -508,7 +508,7 @@
+ }
+ hdr->vpi = hdr->vci = htons(0);
+ hdr->length = htonl(pos-start);
+- if (debug) fprintf(stderr,"sending control \"%s\"\n",start);
++ if (atmtcp_debug) fprintf(stderr,"sending control \"%s\"\n",start);
+ tcp_do_send(*(int *) out->user,buf,pos-buf);
+ return 0;
+ }
+@@ -555,7 +555,7 @@
+ exit(1);
+ }
+ if (in->bytes < sizeof(int)+sizeof(*hdr)+ntohl(hdr->length)) return;
+- if (debug)
++ if (atmtcp_debug)
+ fprintf(stderr,"File %d.%d, %d bytes\n",ntohs(hdr->vpi),
+ ntohs(hdr->vci),(unsigned int) ntohl(hdr->length));
+ }
+@@ -708,7 +708,7 @@
+ while ((c = getopt(argc,argv,"dvV")) != EOF)
+ switch (c) {
+ case 'd':
+- debug = 1;
++ atmtcp_debug = 1;
+ break;
+ case 'v':
+ verbose = 1;
+@@ -817,7 +817,8 @@
+ }
+ else if (!strcmp(ARG,"listen") ||
+ (do_background = !strcmp(ARG,"listen-bg"))) {
+- int fd,port,addr_len;
++ int fd,port;
++ size_t addr_len;
+ int *fd2 = alloc_t(int);
+
+ if ((fd = socket(PF_INET,SOCK_STREAM,0)) < 0) {
+--- linux-atm-2.4.1.orig/src/maint/enitune.c
++++ linux-atm-2.4.1/src/maint/enitune.c
+@@ -44,6 +44,7 @@
+ if (*end || mult.rx <= 100) usage(name);
+ break;
+ default:
++ break;
+ }
+ if (argc != optind+1) usage(name);
+ sioc.number = strtol(argv[optind],&end,0);
+--- linux-atm-2.4.1.orig/src/arpd/Makefile.in
++++ linux-atm-2.4.1/src/arpd/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -90,8 +90,7 @@
+ sbin_PROGRAMS = atmarp atmarpd
+
+ atmarp_SOURCES = atmarp.c atmarp.h atmarpd.h
+-atmarpd_SOURCES = atmarpd.c atmarpd.h arp.c arp.h io.c io.h itf.c itf.h \
+- table.c table.h atmarp.h
++atmarpd_SOURCES = atmarpd.c atmarpd.h arp.c arp.h io.c io.h itf.c itf.h table.c table.h atmarp.h
+
+
+ include_HEADERS = atmarp.h atmarpd.h
+@@ -135,8 +134,10 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/arp.P .deps/atmarp.P .deps/atmarpd.P .deps/io.P \
++.deps/itf.P .deps/table.P
+ SOURCES = $(atmarp_SOURCES) $(atmarpd_SOURCES)
+ OBJECTS = $(atmarp_OBJECTS) $(atmarpd_OBJECTS)
+
+@@ -144,9 +145,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/arpd/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/arpd/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -176,9 +177,6 @@
+ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -201,9 +199,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -300,7 +295,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -316,6 +311,11 @@
+ subdir = src/arpd
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/arpd/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -326,24 +326,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-arp.o: arp.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmd.h atmarp.h \
+- atmarpd.h table.h itf.h io.h arp.h
+-atmarp.o: atmarp.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmd.h atmarpd.h
+-atmarpd.o: atmarpd.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h atmarpd.h \
+- io.h table.h
+-io.o: io.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmd.h atmarpd.h \
+- table.h arp.h atmarp.h itf.h io.h
+-itf.o: itf.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atmd.h ../../src/include/atm.h table.h io.h \
+- itf.h arp.h atmarp.h atmarpd.h
+-table.o: table.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmd.h atmarpd.h \
+- table.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -383,27 +397,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-sbinPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -416,8 +430,9 @@
+ distclean-libtool clean-libtool maintainer-clean-libtool install-man8 \
+ uninstall-man8 install-man uninstall-man uninstall-includeHEADERS \
+ install-includeHEADERS tags mostlyclean-tags distclean-tags clean-tags \
+-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
+-installcheck-am installcheck install-exec-am install-exec \
++maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
++clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
++check-am installcheck-am installcheck install-exec-am install-exec \
+ install-data-am install-data install-am install uninstall-am uninstall \
+ all-redirect all-am all installdirs mostlyclean-generic \
+ distclean-generic clean-generic maintainer-clean-generic clean \
+--- linux-atm-2.4.1.orig/src/arpd/atmarp.c
++++ linux-atm-2.4.1/src/arpd/atmarp.c
+@@ -92,7 +92,7 @@
+ perror("read " ATMARP_DUMP_DIR "/" ATMARP_DUMP_FILE);
+ return 1;
+ }
+- if (write(0,buffer,size) < 0) {
++ if (write(1,buffer,size) < 0) {
+ perror("write stdout");
+ return 1;
+ }
+--- linux-atm-2.4.1.orig/src/ilmid/Makefile.in
++++ linux-atm-2.4.1/src/ilmid/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -91,13 +91,9 @@
+
+ sbin_PROGRAMS = ilmid
+
+-ilmid_SOURCES = rfc1157_snmp.c rfc1157_snmp.h rfc1155_smi.c rfc1155_smi.h \
+- util.c util.h io.c io.h message.c message.h \
+- atmf_uni.c atmf_uni.h mib.c mib.h \
+- sysgroup.c sysgroup.h ilmid.c
++ilmid_SOURCES = rfc1157_snmp.c rfc1157_snmp.h rfc1155_smi.c rfc1155_smi.h util.c util.h io.c io.h message.c message.h atmf_uni.c atmf_uni.h mib.c mib.h sysgroup.c sysgroup.h ilmid.c
+
+-ilmid_LDADD = $(top_builddir)/src/lib/libatm.la \
+- $(top_builddir)/src/ilmid/asn1/libasn1.a
++ilmid_LDADD = $(top_builddir)/src/lib/libatm.la $(top_builddir)/src/ilmid/asn1/libasn1.a
+
+ ilmid_DEPENDENCIES = $(ilmid_LDADD)
+
+@@ -127,8 +123,11 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/atmf_uni.P .deps/ilmid.P .deps/io.P .deps/message.P \
++.deps/mib.P .deps/rfc1155_smi.P .deps/rfc1157_snmp.P .deps/sysgroup.P \
++.deps/util.P
+ SOURCES = $(ilmid_SOURCES)
+ OBJECTS = $(ilmid_OBJECTS)
+
+@@ -136,9 +135,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/ilmid/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ilmid/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -168,9 +167,6 @@
+ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -193,9 +189,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -294,7 +287,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -310,6 +303,11 @@
+ subdir = src/ilmid
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/ilmid/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -330,62 +328,38 @@
+ || exit 1; \
+ fi; \
+ done
+-atmf_uni.o: atmf_uni.c ../../config.h atmf_uni.h asn1/asn_incl.h \
+- asn1/asn_config.h asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h \
+- asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \
+- asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \
+- rfc1155_smi.h rfc1157_snmp.h mib.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h util.h
+-ilmid.o: ilmid.c ../../config.h asn1/asn_incl.h asn1/asn_config.h \
+- asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h asn1/asn_len.h \
+- asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h \
+- asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h rfc1155_smi.h \
+- rfc1157_snmp.h message.h util.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h io.h mib.h \
+- atmf_uni.h sysgroup.h
+-io.o: io.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h io.h asn1/asn_incl.h asn1/asn_config.h \
+- asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h asn1/asn_len.h \
+- asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h \
+- asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h rfc1155_smi.h \
+- rfc1157_snmp.h ../../src/include/atmd.h atmf_uni.h mib.h
+-message.o: message.c ../../config.h message.h asn1/asn_incl.h \
+- asn1/asn_config.h asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h \
+- asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \
+- asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \
+- rfc1155_smi.h rfc1157_snmp.h atmf_uni.h mib.h \
+- ../../src/include/atmd.h ../../src/include/stdint.h \
+- ../../src/include/atm.h util.h
+-mib.o: mib.c ../../config.h mib.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h \
+- asn1/asn_incl.h asn1/asn_config.h asn1/nibble_alloc.h \
+- asn1/sbuf.h asn1/print.h asn1/asn_len.h asn1/asn_tag.h \
+- asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h asn1/asn_oid.h \
+- asn1/asn_null.h asn1/asn_list.h rfc1155_smi.h rfc1157_snmp.h \
+- sysgroup.h atmf_uni.h util.h
+-rfc1155_smi.o: rfc1155_smi.c ../../config.h asn1/asn_incl.h \
+- asn1/asn_config.h asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h \
+- asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \
+- asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \
+- rfc1155_smi.h rfc1157_snmp.h
+-rfc1157_snmp.o: rfc1157_snmp.c ../../config.h asn1/asn_incl.h \
+- asn1/asn_config.h asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h \
+- asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \
+- asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \
+- rfc1155_smi.h rfc1157_snmp.h
+-sysgroup.o: sysgroup.c ../../config.h sysgroup.h asn1/asn_incl.h \
+- asn1/asn_config.h asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h \
+- asn1/asn_len.h asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h \
+- asn1/asn_bits.h asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h \
+- rfc1155_smi.h rfc1157_snmp.h mib.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h
+-util.o: util.c ../../config.h util.h asn1/asn_incl.h asn1/asn_config.h \
+- asn1/nibble_alloc.h asn1/sbuf.h asn1/print.h asn1/asn_len.h \
+- asn1/asn_tag.h asn1/asn_int.h asn1/asn_octs.h asn1/asn_bits.h \
+- asn1/asn_oid.h asn1/asn_null.h asn1/asn_list.h rfc1155_smi.h \
+- rfc1157_snmp.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-recursive
+ dvi-am:
+@@ -424,27 +398,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-recursive
+
+ clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-recursive
+
+ distclean-am: distclean-sbinPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-recursive
+
+ maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -460,12 +434,14 @@
+ all-recursive check-recursive installcheck-recursive info-recursive \
+ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs-am \
+-installdirs mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/ilmid/io.c
++++ linux-atm-2.4.1/src/ilmid/io.c
+@@ -32,6 +32,7 @@
+ #include <net/if.h>
+ #include <atm.h>
+ #include <linux/atmdev.h>
++#include <unistd.h>
+ #include "io.h"
+ #include "atmd.h"
+ #include "atmf_uni.h"
+@@ -299,4 +300,5 @@
+ diag(COMPONENT,DIAG_ERROR,"ioctl ATM_GETCIRANGE: %s",strerror(errno));
+ return error;
+ }
++ return 0;
+ }
+--- linux-atm-2.4.1.orig/src/ilmid/atmf_uni.c
++++ linux-atm-2.4.1/src/ilmid/atmf_uni.c
+@@ -187,7 +187,7 @@
+ newPrefix->name = alloc_t(AsnOid);
+ newPrefix->name->octs = alloc(varBindName->octetLen);
+ AsnOidCopy(newPrefix->name, varBindName);
+- Q_INSERT_BEFORE((NetPrefixNode *) var->value, newPrefix, prefix);
++ Q_INSERT_BEFORE_TYPED(var->value,(NetPrefixNode *), newPrefix, prefix);
+ if(atmNetPrefix.octs == NULL)
+ {
+ atmNetPrefix.octetLen = varBindName->octetLen - NETPREFIX_LEN - 2;
+@@ -197,7 +197,7 @@
+ }
+ else if (varbind->value->a.simple->a.number == INVALID && cmp == AsnOidEqual)
+ {
+- Q_REMOVE((NetPrefixNode *) var->value, prefix);
++ Q_REMOVE(var->value, prefix);
+ }
+
+ return NOERROR;
+--- linux-atm-2.4.1.orig/src/ilmid/mib.c
++++ linux-atm-2.4.1/src/ilmid/mib.c
+@@ -58,13 +58,13 @@
+ { NULL }
+ };
+
+-void MIBget(VarBindList *list, PDUInt *status, AsnInt *index)
++void MIBget(VarBindList *list, PDUInt *status, AsnInt *Mindex)
+ {
+ VarBind *varbind;
+ Variable *var;
+ AsnOidResult result;
+
+- *index = 1;
++ *Mindex = 1;
+ FOR_EACH_LIST_ELMT(varbind, list)
+ {
+ /* Find the first MIB object not lexigraphically less than the *
+@@ -91,20 +91,20 @@
+ if(*status != NOERROR)
+ return;
+
+- (*index)++;
++ (*Mindex)++;
+ }
+- *index = 0;
++ *Mindex = 0;
+ return;
+ }
+
+
+-void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *index)
++void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *Mindex)
+ {
+ VarBind *varbind;
+ Variable *var;
+ AsnOidResult result;
+
+- *index = 1;
++ *Mindex = 1;
+ FOR_EACH_LIST_ELMT(varbind, list)
+ {
+ /* Find the first complex MIB object not lexigraphically less than *
+@@ -139,19 +139,19 @@
+ if(*status != NOERROR)
+ return;
+
+- (*index)++;
++ (*Mindex)++;
+ }
+- *index = 0;
++ *Mindex = 0;
+ return;
+ }
+
+-void MIBset(VarBindList *list, PDUInt *status, AsnInt *index)
++void MIBset(VarBindList *list, PDUInt *status, AsnInt *Mindex)
+ {
+ VarBind *varbind;
+ Variable *var;
+ AsnOidResult result;
+
+- *index = 1;
++ *Mindex = 1;
+ FOR_EACH_LIST_ELMT(varbind, list)
+ {
+ /* Find the first MIB object not lexigraphically less than the *
+@@ -182,9 +182,9 @@
+ if(*status != NOERROR)
+ return;
+
+- (*index)++;
++ (*Mindex)++;
+ }
+- *index = 0;
++ *Mindex = 0;
+ return;
+ }
+
+--- linux-atm-2.4.1.orig/src/ilmid/mib.h
++++ linux-atm-2.4.1/src/ilmid/mib.h
+@@ -39,9 +39,9 @@
+ void *value;
+ } Variable;
+
+-void MIBget(VarBindList *list, PDUInt *status, AsnInt *index);
+-void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *index);
+-void MIBset(VarBindList *list, PDUInt *status, AsnInt *index);
++void MIBget(VarBindList *list, PDUInt *status, AsnInt *Mindex);
++void MIBgetnext(VarBindList *list, PDUInt *status, AsnInt *Mindex);
++void MIBset(VarBindList *list, PDUInt *status, AsnInt *Mindex);
+ void *MIBdelete(AsnOid *oid);
+
+ AsnInt getString(VarBind *varbind, Variable *var);
+--- linux-atm-2.4.1.orig/src/ilmid/ilmid.c
++++ linux-atm-2.4.1/src/ilmid/ilmid.c
+@@ -33,6 +33,7 @@
+ #include <config.h>
+ #endif
+
++#include <stdlib.h>
+ #include <unistd.h>
+ #include <sys/time.h>
+ #include <errno.h>
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/Makefile.in
++++ linux-atm-2.4.1/src/ilmid/asn1/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -87,13 +87,7 @@
+
+ noinst_LIBRARIES = libasn1.a
+
+-libasn1_a_SOURCES = asn_len.c asn_len.h asn_tag.c asn_tag.h \
+- asn_int.c asn_int.h asn_octs.c asn_octs.h \
+- asn_bits.c asn_bits.h str_stk.c str_stk.h \
+- asn_oid.c asn_oid.h asn_null.c asn_null.h \
+- asn_list.c asn_list.h nibble_alloc.c nibble_alloc.h \
+- print.c print.h \
+- asn_config.h min_buf.h sbuf.h exp_buf.h
++libasn1_a_SOURCES = asn_len.c asn_len.h asn_tag.c asn_tag.h asn_int.c asn_int.h asn_octs.c asn_octs.h asn_bits.c asn_bits.h str_stk.c str_stk.h asn_oid.c asn_oid.h asn_null.c asn_null.h asn_list.c asn_list.h nibble_alloc.c nibble_alloc.h print.c print.h asn_config.h min_buf.h sbuf.h exp_buf.h
+
+
+ EXTRA_libasn1_a_SOURCES = asn_incl.h exp_buf.c
+@@ -125,8 +119,12 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/asn_bits.P .deps/asn_int.P .deps/asn_len.P \
++.deps/asn_list.P .deps/asn_null.P .deps/asn_octs.P .deps/asn_oid.P \
++.deps/asn_tag.P .deps/exp_buf.P .deps/nibble_alloc.P .deps/print.P \
++.deps/str_stk.P
+ SOURCES = $(libasn1_a_SOURCES) $(EXTRA_libasn1_a_SOURCES)
+ OBJECTS = $(libasn1_a_OBJECTS)
+
+@@ -134,9 +132,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/ilmid/asn1/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ilmid/asn1/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -150,9 +148,6 @@
+
+ maintainer-clean-noinstLIBRARIES:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -175,9 +170,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -217,7 +209,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -233,6 +225,11 @@
+ subdir = src/ilmid/asn1
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/ilmid/asn1/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -243,30 +240,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-asn_bits.o: asn_bits.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_len.h asn_tag.h str_stk.h asn_bits.h
+-asn_int.o: asn_int.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_len.h asn_tag.h asn_int.h
+-asn_len.o: asn_len.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_len.h
+-asn_list.o: asn_list.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_list.h
+-asn_null.o: asn_null.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_len.h asn_tag.h asn_null.h
+-asn_octs.o: asn_octs.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_len.h asn_tag.h str_stk.h asn_bits.h \
+- asn_octs.h
+-asn_oid.o: asn_oid.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_len.h asn_tag.h asn_octs.h asn_oid.h
+-asn_tag.o: asn_tag.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h asn_len.h asn_tag.h
+-nibble_alloc.o: nibble_alloc.c ../../../config.h asn_config.h \
+- nibble_alloc.h sbuf.h print.h
+-print.o: print.c ../../../config.h asn_config.h nibble_alloc.h sbuf.h \
+- print.h
+-str_stk.o: str_stk.c ../../../config.h asn_config.h nibble_alloc.h \
+- sbuf.h print.h str_stk.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -303,27 +308,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-noinstLIBRARIES clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-noinstLIBRARIES distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -334,12 +339,14 @@
+ mostlyclean-compile distclean-compile clean-compile \
+ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/asn_int.c
++++ linux-atm-2.4.1/src/ilmid/asn1/asn_int.c
+@@ -185,7 +185,7 @@
+ AsnInt* v _AND_
+ unsigned short int indent)
+ {
+- fprintf(f,"%d", *v);
++ fprintf(f,"%ld", *v);
+ }
+
+
+@@ -252,7 +252,6 @@
+ UAsnInt* data)
+ {
+ int len;
+- int retLen;
+ int i;
+ unsigned long int mask;
+ unsigned long int dataCpy;
+@@ -370,5 +369,5 @@
+ UAsnInt* v _AND_
+ unsigned short int indent)
+ {
+- fprintf(f,"%u", *v);
++ fprintf(f,"%lu", *v);
+ }
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/asn_octs.c
++++ linux-atm-2.4.1/src/ilmid/asn1/asn_octs.c
+@@ -21,6 +21,9 @@
+ #include <config.h>
+ #endif
+
++#include <stdlib.h>
++#include <string.h>
++
+ #include "asn_config.h"
+ #include "asn_len.h"
+ #include "asn_tag.h"
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/asn_bits.c
++++ linux-atm-2.4.1/src/ilmid/asn1/asn_bits.c
+@@ -21,6 +21,9 @@
+ #include <config.h>
+ #endif
+
++#include <stdlib.h>
++#include <string.h>
++
+ #include "asn_config.h"
+ #include "asn_len.h"
+ #include "asn_tag.h"
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/asn_oid.c
++++ linux-atm-2.4.1/src/ilmid/asn1/asn_oid.c
+@@ -21,6 +21,9 @@
+ #include <config.h>
+ #endif
+
++#include <stdlib.h>
++#include <string.h>
++
+ #include "asn_config.h"
+ #include "asn_len.h"
+ #include "asn_tag.h"
+@@ -125,7 +128,7 @@
+ if (firstArcNum > 2)
+ firstArcNum = 2;
+
+- fprintf(f,"%u %u", firstArcNum, arcNum - (firstArcNum * 40));
++ fprintf(f,"%d %lu", firstArcNum, arcNum - (firstArcNum * 40));
+
+ for (; i < v->octetLen ; )
+ {
+@@ -134,7 +137,7 @@
+
+ arcNum = (arcNum << 7) + (v->octs[i] & 0x7f);
+ i++;
+- fprintf(f," %u", arcNum);
++ fprintf(f," %lu", arcNum);
+ }
+ fprintf(f,"}");
+
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/asn_list.c
++++ linux-atm-2.4.1/src/ilmid/asn1/asn_list.c
+@@ -20,6 +20,8 @@
+ #include <config.h>
+ #endif
+
++#include <stdlib.h>
++
+ #include "asn_config.h"
+ #include "asn_list.h"
+
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/nibble_alloc.c
++++ linux-atm-2.4.1/src/ilmid/asn1/nibble_alloc.c
+@@ -20,7 +20,9 @@
+ #include <config.h>
+ #endif
+
++#include <string.h>
+ #include <memory.h>
++#include <stdlib.h>
+ #include "asn_config.h"
+ #include "nibble_alloc.h"
+
+--- linux-atm-2.4.1.orig/src/ilmid/asn1/nibble_alloc.h
++++ linux-atm-2.4.1/src/ilmid/asn1/nibble_alloc.h
+@@ -39,13 +39,13 @@
+ void InitNibbleMem PROTO((unsigned long int initialSize,
+ unsigned long int incrementSize));
+
+-void ShutdownNibbleMem();
++void ShutdownNibbleMem(void);
+
+ void ServiceNibbleFault PROTO((unsigned long int size));
+
+ void* NibbleAlloc PROTO((unsigned long int size));
+
+-void ResetNibbleMem();
++void ResetNibbleMem(void);
+
+
+ #endif /* conditional include */
+--- linux-atm-2.4.1.orig/src/man/Makefile.in
++++ linux-atm-2.4.1/src/man/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -100,14 +100,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/man/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/man/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -159,6 +159,11 @@
+ subdir = src/man
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/man/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/led/Makefile.in
++++ linux-atm-2.4.1/src/led/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -87,9 +87,7 @@
+
+ sbin_PROGRAMS = zeppelin
+
+-zeppelin_SOURCES = join.c join.h conn.c conn.h main.c address.c address.h \
+- frames.c frames.h display.c display.h \
+- kernel.c kernel.h frame_defs.h lec.h
++zeppelin_SOURCES = join.c join.h conn.c conn.h main.c address.c address.h frames.c frames.h display.c display.h kernel.c kernel.h frame_defs.h lec.h
+
+ zeppelin_LDADD = $(top_builddir)/src/lib/libatm.la
+ zeppelin_DEPENDENCIES = $(zeppelin_LDADD)
+@@ -125,8 +123,10 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/address.P .deps/conn.P .deps/display.P .deps/frames.P \
++.deps/join.P .deps/kernel.P .deps/main.P
+ SOURCES = $(zeppelin_SOURCES)
+ OBJECTS = $(zeppelin_OBJECTS)
+
+@@ -134,9 +134,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/led/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/led/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -166,9 +166,6 @@
+ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -191,9 +188,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -271,7 +265,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -287,6 +281,11 @@
+ subdir = src/led
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/led/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -297,28 +296,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-address.o: address.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h address.h
+-conn.o: conn.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmsap.h \
+- ../../src/include/atmd.h conn.h display.h lec.h frames.h \
+- frame_defs.h kernel.h
+-display.o: display.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h display.h \
+- frame_defs.h
+-frames.o: frames.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h conn.h \
+- lec.h frames.h frame_defs.h display.h kernel.h
+-join.o: join.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h conn.h \
+- lec.h join.h frames.h frame_defs.h display.h
+-kernel.o: kernel.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h kernel.h \
+- lec.h conn.h frames.h frame_defs.h
+-main.o: main.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h join.h \
+- lec.h conn.h address.h display.h kernel.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -356,27 +365,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-sbinPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -388,12 +397,14 @@
+ clean-compile maintainer-clean-compile mostlyclean-libtool \
+ distclean-libtool clean-libtool maintainer-clean-libtool install-man8 \
+ uninstall-man8 install-man uninstall-man tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/lane/Makefile.in
++++ linux-atm-2.4.1/src/lane/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -89,14 +89,11 @@
+
+ LDADD = $(top_builddir)/src/lib/libatm.la
+
+-LES_BUS_SRCS = mem.c mem.h load.c load.h units.c units.h load_lex.l load_lex.h \
+- timers.c timers.h dump.c dump.h lane_atm.c lane_atm.h \
+- events.c events.h lane.c lane.h
++LES_BUS_SRCS = mem.c mem.h load.c load.h units.c units.h load_lex.l load_lex.h timers.c timers.h dump.c dump.h lane_atm.c lane_atm.h events.c events.h lane.c lane.h
+
+ les_SOURCES = $(LES_BUS_SRCS) packet.c packet.h connect.c connect.h db.c db.h
+ bus_SOURCES = $(LES_BUS_SRCS) connect_bus.c
+-lecs_SOURCES = lecs_db.l lecs_db.h lecs_load.c lecs_load.h lecs.c lecs.h \
+- ldb.c ldb.h mem_lecs.c mem_lecs.h atm_lecs.c atm_lecs.h
++lecs_SOURCES = lecs_db.l lecs_db.h lecs_load.c lecs_load.h lecs.c lecs.h ldb.c ldb.h mem_lecs.c mem_lecs.h atm_lecs.c atm_lecs.h
+
+
+ man_MANS = les.8 lecs.8 bus.8
+@@ -148,8 +145,13 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/atm_lecs.P .deps/connect.P .deps/connect_bus.P \
++.deps/db.P .deps/dump.P .deps/events.P .deps/lane.P .deps/lane_atm.P \
++.deps/ldb.P .deps/lecs.P .deps/lecs_db.P .deps/lecs_load.P .deps/load.P \
++.deps/load_lex.P .deps/mem.P .deps/mem_lecs.P .deps/packet.P \
++.deps/timers.P .deps/units.P
+ SOURCES = $(les_SOURCES) $(bus_SOURCES) $(lecs_SOURCES)
+ OBJECTS = $(les_OBJECTS) $(bus_OBJECTS) $(lecs_OBJECTS)
+
+@@ -157,9 +159,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .l .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/lane/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lane/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -189,9 +191,6 @@
+ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -214,9 +213,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -304,7 +300,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -320,6 +316,11 @@
+ subdir = src/lane
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/lane/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -330,62 +331,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-atm_lecs.o: atm_lecs.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmsap.h \
+- atm_lecs.h
+-connect.o: connect.c ../../config.h ../../src/include/stdint.h mem.h \
+- units.h lane.h dump.h ../../src/include/atm.h \
+- ../../src/include/atmsap.h load.h connect.h timers.h events.h \
+- db.h packet.h lane_atm.h
+-connect_bus.o: connect_bus.c ../../config.h ../../src/include/stdint.h \
+- mem.h units.h lane.h dump.h ../../src/include/atm.h \
+- ../../src/include/atmsap.h load.h connect.h timers.h events.h \
+- lane_atm.h
+-db.o: db.c ../../config.h ../../src/include/stdint.h mem.h units.h \
+- lane.h dump.h ../../src/include/atm.h \
+- ../../src/include/atmsap.h load.h connect.h timers.h events.h \
+- db.h
+-dump.o: dump.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmsap.h dump.h \
+- units.h lane.h load.h
+-events.o: events.c ../../config.h events.h units.h load.h lane.h dump.h \
+- ../../src/include/atm.h ../../src/include/stdint.h \
+- ../../src/include/atmsap.h mem.h timers.h connect.h
+-lane.o: lane.c ../../config.h units.h load.h lane.h dump.h \
+- ../../src/include/atm.h ../../src/include/stdint.h \
+- ../../src/include/atmsap.h mem.h connect.h timers.h events.h
+-lane_atm.o: lane_atm.c ../../config.h lane_atm.h units.h lane.h \
+- connect.h timers.h load.h events.h ../../src/include/atmsap.h \
+- ../../src/include/stdint.h dump.h ../../src/include/atm.h mem.h
+-ldb.o: ldb.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h lecs.h ldb.h mem_lecs.h
+-lecs.o: lecs.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h lecs_load.h ldb.h mem_lecs.h lecs.h \
+- atm_lecs.h
+-lecs_db.o: lecs_db.c ../../config.h lecs_load.h lecs_db.h
+-lecs_load.o: lecs_load.c ../../config.h lecs_load.h lecs_db.h ldb.h \
+- lecs.h
+-load.o: load.c ../../config.h load.h units.h lane.h dump.h \
+- ../../src/include/atm.h ../../src/include/stdint.h \
+- ../../src/include/atmsap.h mem.h load_lex.h
+-load_lex.o: load_lex.c ../../config.h ../../src/include/stdint.h \
+- load_lex.h lane.h units.h load.h mem.h
+-mem.o: mem.c ../../config.h mem.h units.h dump.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmsap.h lane.h \
+- load.h
+-mem_lecs.o: mem_lecs.c ../../config.h mem_lecs.h
+-packet.o: packet.c ../../config.h ../../src/include/stdint.h mem.h \
+- units.h lane.h dump.h ../../src/include/atm.h \
+- ../../src/include/atmsap.h load.h connect.h timers.h events.h \
+- db.h packet.h
+-timers.o: timers.c ../../config.h timers.h units.h load.h lane.h dump.h \
+- ../../src/include/atm.h ../../src/include/stdint.h \
+- ../../src/include/atmsap.h mem.h
+-units.o: units.c ../../config.h units.h mem.h lane.h load.h dump.h \
+- ../../src/include/atm.h ../../src/include/stdint.h \
+- ../../src/include/atmsap.h connect.h timers.h events.h \
+- lane_atm.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -422,29 +399,29 @@
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+ maintainer-clean-generic:
+- -test -z "lecs_dblload_lexl" || rm -f lecs_dbl load_lexl
++ -test -z "lecs_dbcload_lexc" || rm -f lecs_dbc load_lexc
+ mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-sbinPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -456,12 +433,14 @@
+ clean-compile maintainer-clean-compile mostlyclean-libtool \
+ distclean-libtool clean-libtool maintainer-clean-libtool install-man8 \
+ uninstall-man8 install-man uninstall-man tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/mpoad/Makefile.in
++++ linux-atm-2.4.1/src/mpoad/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -89,9 +89,7 @@
+
+ LDADD = $(top_builddir)/src/lib/libatm.la
+
+-mpcd_SOURCES = get_vars.c get_vars.h io.c io.h k_interf.c k_interf.h main.c \
+- p_factory.c p_recogn.c id_list.c tag_list.c \
+- poll2select.c poll2select.h lecs.c lecs.h packets.h
++mpcd_SOURCES = get_vars.c get_vars.h io.c io.h k_interf.c k_interf.h main.c p_factory.c p_recogn.c id_list.c tag_list.c poll2select.c poll2select.h lecs.c lecs.h packets.h
+
+
+ man_MANS = mpcd.8
+@@ -128,8 +126,11 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/get_vars.P .deps/id_list.P .deps/io.P \
++.deps/k_interf.P .deps/lecs.P .deps/main.P .deps/p_factory.P \
++.deps/p_recogn.P .deps/poll2select.P .deps/tag_list.P
+ SOURCES = $(mpcd_SOURCES)
+ OBJECTS = $(mpcd_OBJECTS)
+
+@@ -137,9 +138,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/mpoad/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mpoad/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -169,9 +170,6 @@
+ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -194,9 +192,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -274,7 +269,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -290,6 +285,11 @@
+ subdir = src/mpoad
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/mpoad/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -300,29 +300,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-get_vars.o: get_vars.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h packets.h get_vars.h io.h
+-id_list.o: id_list.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h packets.h
+-io.o: io.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h packets.h k_interf.h io.h get_vars.h \
+- poll2select.h
+-k_interf.o: k_interf.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h k_interf.h packets.h io.h get_vars.h
+-lecs.o: lecs.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h ../../src/include/atmsap.h lecs.h \
+- k_interf.h
+-main.o: main.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h packets.h io.h k_interf.h get_vars.h \
+- lecs.h
+-p_factory.o: p_factory.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atm.h packets.h get_vars.h io.h
+-p_recogn.o: p_recogn.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h io.h k_interf.h packets.h
+-poll2select.o: poll2select.c ../../config.h
+-tag_list.o: tag_list.c ../../config.h packets.h ../../src/include/atm.h \
+- ../../src/include/stdint.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -360,27 +369,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-sbinPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -392,12 +401,14 @@
+ clean-compile maintainer-clean-compile mostlyclean-libtool \
+ distclean-libtool clean-libtool maintainer-clean-libtool install-man8 \
+ uninstall-man8 install-man uninstall-man tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/mpoad/p_factory.c
++++ linux-atm-2.4.1/src/mpoad/p_factory.c
+@@ -34,7 +34,7 @@
+
+ while( count > 1 ) {
+ /* This is the inner loop */
+- sum += * ((uint16_t *) addr)++;
++ sum += * ((uint16_t *) addr); addr += sizeof(uint16_t);
+ count -= 2;
+ }
+
+--- linux-atm-2.4.1.orig/src/switch/Makefile.in
++++ linux-atm-2.4.1/src/switch/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -92,11 +92,9 @@
+
+ swc_SOURCES = swc.c swc.h
+ swc_LDADD = $(top_builddir)/src/lib/libatm.la
+-swc_DEPENDENCIES = $(swc_LDADD) $(top_builddir)/src/include/atm.h \
+- $(top_builddir)/src/include/atmd.h
++swc_DEPENDENCIES = $(swc_LDADD) $(top_builddir)/src/include/atm.h $(top_builddir)/src/include/atmd.h
+
+-libsw_a_SOURCES = control.c dispatch.c dispatch.h proto.c proto.h relay.c \
+- route.c route.h sig.c sig.h cfg_y.y cfg_l.l fab.h
++libsw_a_SOURCES = control.c dispatch.c dispatch.h proto.c proto.h relay.c route.c route.h sig.c sig.h cfg_y.y cfg_l.l fab.h
+
+
+ EXTRA_DIST = cfg_y.h README
+@@ -132,8 +130,11 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/cfg_l.P .deps/cfg_y.P .deps/control.P \
++.deps/dispatch.P .deps/proto.P .deps/relay.P .deps/route.P .deps/sig.P \
++.deps/swc.P
+ SOURCES = $(libsw_a_SOURCES) $(swc_SOURCES)
+ OBJECTS = $(libsw_a_OBJECTS) $(swc_OBJECTS)
+
+@@ -141,9 +142,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .l .lo .o .obj .s .y
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/switch/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/switch/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -157,9 +158,6 @@
+
+ maintainer-clean-noinstLIBRARIES:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -182,9 +180,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -306,7 +301,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -322,6 +317,11 @@
+ subdir = src/switch
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/switch/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -342,32 +342,38 @@
+ || exit 1; \
+ fi; \
+ done
+-cfg_l.o: cfg_l.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h cfg_y.h
+-cfg_y.o: cfg_y.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h fab.h proto.h \
+- ../../src/include/atmsap.h ../../src/include/atmd.h sig.h \
+- route.h swc.h
+-control.o: control.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h fab.h \
+- proto.h ../../src/include/atmsap.h sig.h dispatch.h swc.h
+-dispatch.o: dispatch.c ../../config.h ../../src/include/atmd.h \
+- ../../src/include/stdint.h ../../src/include/atm.h dispatch.h
+-proto.o: proto.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h sig.h fab.h \
+- proto.h ../../src/include/atmsap.h
+-relay.o: relay.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h fab.h \
+- proto.h ../../src/include/atmsap.h sig.h dispatch.h route.h
+-route.o: route.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h route.h \
+- sig.h
+-sig.o: sig.c ../../config.h ../../src/include/stdint.h \
+- ../../src/include/atmd.h ../../src/include/atm.h dispatch.h \
+- proto.h ../../src/include/atmsap.h sig.h route.h fab.h
+-swc.o: swc.c ../../config.h ../../src/include/atm.h \
+- ../../src/include/stdint.h ../../src/include/atmd.h swc.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-recursive
+ dvi-am:
+@@ -404,22 +410,23 @@
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+ maintainer-clean-generic:
+- -test -z "cfg_llcfg_yhcfg_yc" || rm -f cfg_ll cfg_yh cfg_yc
++ -test -z "cfg_lccfg_yhcfg_yc" || rm -f cfg_lc cfg_yh cfg_yc
+ mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-noinstPROGRAMS \
+- mostlyclean-tags mostlyclean-generic
++ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+ mostlyclean: mostlyclean-recursive
+
+ clean-am: clean-noinstLIBRARIES clean-compile clean-libtool \
+- clean-noinstPROGRAMS clean-tags clean-generic \
+- mostlyclean-am
++ clean-noinstPROGRAMS clean-tags clean-depend \
++ clean-generic mostlyclean-am
+
+ clean: clean-recursive
+
+ distclean-am: distclean-noinstLIBRARIES distclean-compile \
+ distclean-libtool distclean-noinstPROGRAMS \
+- distclean-tags distclean-generic clean-am
++ distclean-tags distclean-depend distclean-generic \
++ clean-am
+ -rm -f libtool
+
+ distclean: distclean-recursive
+@@ -427,7 +434,8 @@
+ maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
+- maintainer-clean-generic distclean-am
++ maintainer-clean-depend maintainer-clean-generic \
++ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -445,12 +453,14 @@
+ all-recursive check-recursive installcheck-recursive info-recursive \
+ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs-am \
+-installdirs mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/switch/cfg_y.c
++++ linux-atm-2.4.1/src/switch/cfg_y.c
+@@ -1,21 +1,87 @@
++/* A Bison parser, made by GNU Bison 1.875d. */
+
+-/* A Bison parser, made from cfg_y.y
+- by GNU Bison version 1.28 */
++/* Skeleton parser for Yacc-like parsing with Bison,
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+-#define YYBISON 1 /* Identify Bison output. */
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA. */
++
++/* As a special exception, when this file is copied by Bison into a
++ Bison output file, you may use that output file without restriction.
++ This special exception was added by the Free Software Foundation
++ in version 1.24 of Bison. */
++
++/* Written by Richard Stallman by simplifying the original so called
++ ``semantic'' parser. */
++
++/* All symbols defined below should begin with yy or YY, to avoid
++ infringing on user name space. This should be done even for local
++ variables, as they might otherwise be expanded by user macros.
++ There are some unavoidable exceptions within include files to
++ define necessary library symbols; they are noted "INFRINGES ON
++ USER NAME SPACE" below. */
++
++/* Identify Bison output. */
++#define YYBISON 1
++
++/* Skeleton name. */
++#define YYSKELETON_NAME "yacc.c"
++
++/* Pure parsers. */
++#define YYPURE 0
++
++/* Using locations. */
++#define YYLSP_NEEDED 0
+
+-#define TOK_COMMAND 257
+-#define TOK_VPCI 258
+-#define TOK_ITF 259
+-#define TOK_DEFAULT 260
+-#define TOK_ROUTE 261
+-#define TOK_STR 262
+-#define TOK_SOCKET 263
+-#define TOK_OPTION 264
+-#define TOK_CONTROL 265
+-#define TOK_NUM 266
+-#define TOK_PVC 267
+
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ TOK_COMMAND = 258,
++ TOK_VPCI = 259,
++ TOK_ITF = 260,
++ TOK_DEFAULT = 261,
++ TOK_ROUTE = 262,
++ TOK_STR = 263,
++ TOK_SOCKET = 264,
++ TOK_OPTION = 265,
++ TOK_CONTROL = 266,
++ TOK_NUM = 267,
++ TOK_PVC = 268
++ };
++#endif
++#define TOK_COMMAND 258
++#define TOK_VPCI 259
++#define TOK_ITF 260
++#define TOK_DEFAULT 261
++#define TOK_ROUTE 262
++#define TOK_STR 263
++#define TOK_SOCKET 264
++#define TOK_OPTION 265
++#define TOK_CONTROL 266
++#define TOK_NUM 267
++#define TOK_PVC 268
++
++
++
++
++/* Copy the first part of user declarations. */
+ #line 1 "cfg_y.y"
+
+ /* cfg.y - switch configuration language */
+@@ -29,6 +95,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <limits.h>
++#include <stdlib.h>
+
+ #include "atm.h"
+
+@@ -38,436 +105,743 @@
+ #include "swc.h"
+
+
++extern void yyerror(const char *s);
++
+ static int itf;
+ static SIGNALING_ENTITY *sig;
+
+
+-#line 27 "cfg_y.y"
+-typedef union {
++
++/* Enabling traces. */
++#ifndef YYDEBUG
++# define YYDEBUG 0
++#endif
++
++/* Enabling verbose error messages. */
++#ifdef YYERROR_VERBOSE
++# undef YYERROR_VERBOSE
++# define YYERROR_VERBOSE 1
++#else
++# define YYERROR_VERBOSE 0
++#endif
++
++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
++#line 30 "cfg_y.y"
++typedef union YYSTYPE {
+ int num;
+ char *str;
+ struct sockaddr_atmpvc pvc;
+ } YYSTYPE;
+-#include <stdio.h>
+-
+-#ifndef __cplusplus
+-#ifndef __STDC__
+-#define const
+-#endif
++/* Line 191 of yacc.c. */
++#line 137 "y.tab.c"
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
+ #endif
+
+
+
+-#define YYFINAL 31
+-#define YYFLAG -32768
+-#define YYNTBASE 16
+-
+-#define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 27)
+-
+-static const char yytranslate[] = { 0,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 14, 2, 15, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+- 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+- 7, 8, 9, 10, 11, 12, 13
+-};
+-
+-#if YYDEBUG != 0
+-static const short yyprhs[] = { 0,
+- 0, 1, 4, 7, 10, 13, 14, 15, 25, 26,
+- 29, 30, 33, 34, 36, 37, 40, 41, 45
+-};
++/* Copy the second part of user declarations. */
++
++
++/* Line 214 of yacc.c. */
++#line 149 "y.tab.c"
++
++#if ! defined (yyoverflow) || YYERROR_VERBOSE
++
++# ifndef YYFREE
++# define YYFREE free
++# endif
++# ifndef YYMALLOC
++# define YYMALLOC malloc
++# endif
++
++/* The parser invokes alloca or malloc; define the necessary symbols. */
++
++# ifdef YYSTACK_USE_ALLOCA
++# if YYSTACK_USE_ALLOCA
++# define YYSTACK_ALLOC alloca
++# endif
++# else
++# if defined (alloca) || defined (_ALLOCA_H)
++# define YYSTACK_ALLOC alloca
++# else
++# ifdef __GNUC__
++# define YYSTACK_ALLOC __builtin_alloca
++# endif
++# endif
++# endif
++
++# ifdef YYSTACK_ALLOC
++ /* Pacify GCC's `empty if-body' warning. */
++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
++# else
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++# define YYSTACK_ALLOC YYMALLOC
++# define YYSTACK_FREE YYFREE
++# endif
++#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
++
++
++#if (! defined (yyoverflow) \
++ && (! defined (__cplusplus) \
++ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+
+-static const short yyrhs[] = { -1,
+- 17, 16, 0, 18, 16, 0, 11, 16, 0, 10,
+- 8, 0, 0, 0, 21, 9, 14, 19, 22, 20,
+- 23, 24, 15, 0, 0, 3, 8, 0, 0, 5,
+- 12, 0, 0, 13, 0, 0, 26, 24, 0, 0,
+- 6, 25, 24, 0, 7, 0
+-};
++/* A type that is properly aligned for any stack member. */
++union yyalloc
++{
++ short int yyss;
++ YYSTYPE yyvs;
++ };
++
++/* The size of the maximum gap between one aligned stack and the next. */
++# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
++
++/* The size of an array large to enough to hold all stacks, each with
++ N elements. */
++# define YYSTACK_BYTES(N) \
++ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
++ + YYSTACK_GAP_MAXIMUM)
++
++/* Copy COUNT objects from FROM to TO. The source and destination do
++ not overlap. */
++# ifndef YYCOPY
++# if defined (__GNUC__) && 1 < __GNUC__
++# define YYCOPY(To, From, Count) \
++ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
++# else
++# define YYCOPY(To, From, Count) \
++ do \
++ { \
++ register YYSIZE_T yyi; \
++ for (yyi = 0; yyi < (Count); yyi++) \
++ (To)[yyi] = (From)[yyi]; \
++ } \
++ while (0)
++# endif
++# endif
++
++/* Relocate STACK from its old location to the new one. The
++ local variables YYSIZE and YYSTACKSIZE give the old and new number of
++ elements in the stack, and YYPTR gives the new location of the
++ stack. Advance YYPTR to a properly aligned location for the next
++ stack. */
++# define YYSTACK_RELOCATE(Stack) \
++ do \
++ { \
++ YYSIZE_T yynewbytes; \
++ YYCOPY (&yyptr->Stack, Stack, yysize); \
++ Stack = &yyptr->Stack; \
++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
++ yyptr += yynewbytes / sizeof (*yyptr); \
++ } \
++ while (0)
+
+ #endif
+
+-#if YYDEBUG != 0
+-static const short yyrline[] = { 0,
+- 43, 44, 45, 46, 52, 59, 65, 73, 76, 80,
+- 87, 88, 94, 95, 101, 102, 103, 108, 110
+-};
++#if defined (__STDC__) || defined (__cplusplus)
++ typedef signed char yysigned_char;
++#else
++ typedef short int yysigned_char;
+ #endif
+
++/* YYFINAL -- State number of the termination state. */
++#define YYFINAL 11
++/* YYLAST -- Last index in YYTABLE. */
++#define YYLAST 22
++
++/* YYNTOKENS -- Number of terminals. */
++#define YYNTOKENS 16
++/* YYNNTS -- Number of nonterminals. */
++#define YYNNTS 12
++/* YYNRULES -- Number of rules. */
++#define YYNRULES 20
++/* YYNRULES -- Number of states. */
++#define YYNSTATES 31
++
++/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
++#define YYUNDEFTOK 2
++#define YYMAXUTOK 268
+
+-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
++#define YYTRANSLATE(YYX) \
++ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+-static const char * const yytname[] = { "$","error","$undefined.","TOK_COMMAND",
+-"TOK_VPCI","TOK_ITF","TOK_DEFAULT","TOK_ROUTE","TOK_STR","TOK_SOCKET","TOK_OPTION",
+-"TOK_CONTROL","TOK_NUM","TOK_PVC","'{'","'}'","all","option","sig","@1","@2",
+-"opt_command","opt_itf","opt_via","routes","@3","route", NULL
++/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
++static const unsigned char yytranslate[] =
++{
++ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 14, 2, 15, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
++ 5, 6, 7, 8, 9, 10, 11, 12, 13
+ };
+-#endif
+
+-static const short yyr1[] = { 0,
+- 16, 16, 16, 16, 17, 19, 20, 18, 21, 21,
+- 22, 22, 23, 23, 24, 24, 25, 24, 26
++#if YYDEBUG
++/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
++ YYRHS. */
++static const unsigned char yyprhs[] =
++{
++ 0, 0, 3, 4, 7, 10, 13, 16, 17, 18,
++ 28, 29, 32, 33, 36, 37, 39, 40, 43, 44,
++ 48
+ };
+
+-static const short yyr2[] = { 0,
+- 0, 2, 2, 2, 2, 0, 0, 9, 0, 2,
+- 0, 2, 0, 1, 0, 2, 0, 3, 1
++/* YYRHS -- A `-1'-separated list of the rules' RHS. */
++static const yysigned_char yyrhs[] =
++{
++ 17, 0, -1, -1, 18, 17, -1, 19, 17, -1,
++ 11, 17, -1, 10, 8, -1, -1, -1, 22, 9,
++ 14, 20, 23, 21, 24, 25, 15, -1, -1, 3,
++ 8, -1, -1, 5, 12, -1, -1, 13, -1, -1,
++ 27, 25, -1, -1, 6, 26, 25, -1, 7, -1
+ };
+
+-static const short yydefact[] = { 1,
+- 0, 0, 1, 1, 1, 0, 10, 5, 4, 2,
+- 3, 0, 6, 11, 0, 7, 12, 13, 14, 15,
+- 17, 19, 0, 15, 15, 8, 16, 18, 0, 0,
+- 0
++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
++static const unsigned char yyrline[] =
++{
++ 0, 46, 46, 47, 48, 49, 56, 64, 68, 63,
++ 80, 83, 90, 91, 97, 98, 104, 105, 107, 106,
++ 114
+ };
++#endif
+
+-static const short yydefgoto[] = { 9,
+- 4, 5, 14, 18, 6, 16, 20, 23, 25, 24
++#if YYDEBUG || YYERROR_VERBOSE
++/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
++ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
++static const char *const yytname[] =
++{
++ "$end", "error", "$undefined", "TOK_COMMAND", "TOK_VPCI", "TOK_ITF",
++ "TOK_DEFAULT", "TOK_ROUTE", "TOK_STR", "TOK_SOCKET", "TOK_OPTION",
++ "TOK_CONTROL", "TOK_NUM", "TOK_PVC", "'{'", "'}'", "$accept", "all",
++ "option", "sig", "@1", "@2", "opt_command", "opt_itf", "opt_via",
++ "routes", "@3", "route", 0
+ };
++#endif
+
+-static const short yypact[] = { -3,
+- 3, 4, -3, -3, -3, 6,-32768,-32768,-32768,-32768,
+--32768, -1,-32768, 9, 7,-32768,-32768, 8,-32768, -5,
+--32768,-32768, 1, -5, -5,-32768,-32768,-32768, 17, 18,
+--32768
++# ifdef YYPRINT
++/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
++ token YYLEX-NUM. */
++static const unsigned short int yytoknum[] =
++{
++ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
++ 265, 266, 267, 268, 123, 125
+ };
++# endif
+
+-static const short yypgoto[] = { 5,
+--32768,-32768,-32768,-32768,-32768,-32768,-32768, -21,-32768,-32768
++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
++static const unsigned char yyr1[] =
++{
++ 0, 16, 17, 17, 17, 17, 18, 20, 21, 19,
++ 22, 22, 23, 23, 24, 24, 25, 25, 26, 25,
++ 27
+ };
+
+-
+-#define YYLAST 21
+-
+-
+-static const short yytable[] = { 1,
+- 21, 22, 27, 28, 29, -9, 2, 3, 10, 11,
+- 7, 8, 13, 15, 12, 26, 30, 31, 17, 0,
+- 19
++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
++static const unsigned char yyr2[] =
++{
++ 0, 2, 0, 2, 2, 2, 2, 0, 0, 9,
++ 0, 2, 0, 2, 0, 1, 0, 2, 0, 3,
++ 1
+ };
+
+-static const short yycheck[] = { 3,
+- 6, 7, 24, 25, 0, 9, 10, 11, 4, 5,
+- 8, 8, 14, 5, 9, 15, 0, 0, 12, -1,
+- 13
++/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
++ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
++ means the default is an error. */
++static const unsigned char yydefact[] =
++{
++ 2, 0, 0, 2, 0, 2, 2, 0, 11, 6,
++ 5, 1, 3, 4, 0, 7, 12, 0, 8, 13,
++ 14, 15, 16, 18, 20, 0, 16, 16, 9, 17,
++ 19
+ };
+-/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+-#line 3 "/usr/lib/bison.simple"
+-/* This file comes from bison-1.28. */
+
+-/* Skeleton output parser for bison,
+- Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
++/* YYDEFGOTO[NTERM-NUM]. */
++static const yysigned_char yydefgoto[] =
++{
++ -1, 4, 5, 6, 16, 20, 7, 18, 22, 25,
++ 27, 26
++};
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
+- any later version.
++/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
++ STATE-NUM. */
++#define YYPACT_NINF -16
++static const yysigned_char yypact[] =
++{
++ -3, -6, 5, -3, 14, -3, -3, -4, -16, -16,
++ -16, -16, -16, -16, 1, -16, 11, 6, -16, -16,
++ 4, -16, 3, -16, -16, 7, 3, 3, -16, -16,
++ -16
++};
+
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++/* YYPGOTO[NTERM-NUM]. */
++static const yysigned_char yypgoto[] =
++{
++ -16, -2, -16, -16, -16, -16, -16, -16, -16, -15,
++ -16, -16
++};
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software
+- Foundation, Inc., 59 Temple Place - Suite 330,
+- Boston, MA 02111-1307, USA. */
++/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
++ positive, shift that token. If negative, reduce the rule which
++ number is the opposite. If zero, do what YYDEFACT says.
++ If YYTABLE_NINF, syntax error. */
++#define YYTABLE_NINF -11
++static const yysigned_char yytable[] =
++{
++ 1, 10, 8, 12, 13, 14, -10, 2, 3, 23,
++ 24, 29, 30, 9, 11, 15, 17, 21, 19, 0,
++ 0, 0, 28
++};
+
+-/* As a special exception, when this file is copied by Bison into a
+- Bison output file, you may use that output file without restriction.
+- This special exception was added by the Free Software Foundation
+- in version 1.24 of Bison. */
++static const yysigned_char yycheck[] =
++{
++ 3, 3, 8, 5, 6, 9, 9, 10, 11, 6,
++ 7, 26, 27, 8, 0, 14, 5, 13, 12, -1,
++ -1, -1, 15
++};
+
+-/* This is the parser code that is written into each bison parser
+- when the %semantic_parser declaration is not specified in the grammar.
+- It was written by Richard Stallman by simplifying the hairy parser
+- used when %semantic_parser is specified. */
+-
+-#ifndef YYSTACK_USE_ALLOCA
+-#ifdef alloca
+-#define YYSTACK_USE_ALLOCA
+-#else /* alloca not defined */
+-#ifdef __GNUC__
+-#define YYSTACK_USE_ALLOCA
+-#define alloca __builtin_alloca
+-#else /* not GNU C. */
+-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+-#define YYSTACK_USE_ALLOCA
+-#include <alloca.h>
+-#else /* not sparc */
+-/* We think this test detects Watcom and Microsoft C. */
+-/* This used to test MSDOS, but that is a bad idea
+- since that symbol is in the user namespace. */
+-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+-#if 0 /* No need for malloc.h, which pollutes the namespace;
+- instead, just don't use alloca. */
+-#include <malloc.h>
+-#endif
+-#else /* not MSDOS, or __TURBOC__ */
+-#if defined(_AIX)
+-/* I don't know what this was needed for, but it pollutes the namespace.
+- So I turned it off. rms, 2 May 1997. */
+-/* #include <malloc.h> */
+- #pragma alloca
+-#define YYSTACK_USE_ALLOCA
+-#else /* not MSDOS, or __TURBOC__, or _AIX */
+-#if 0
+-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+- and on HPUX 10. Eventually we can turn this on. */
+-#define YYSTACK_USE_ALLOCA
+-#define alloca __builtin_alloca
+-#endif /* __hpux */
+-#endif
+-#endif /* not _AIX */
+-#endif /* not MSDOS, or __TURBOC__ */
+-#endif /* not sparc */
+-#endif /* not GNU C */
+-#endif /* alloca not defined */
+-#endif /* YYSTACK_USE_ALLOCA not defined */
++/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
++ symbol of state STATE-NUM. */
++static const unsigned char yystos[] =
++{
++ 0, 3, 10, 11, 17, 18, 19, 22, 8, 8,
++ 17, 0, 17, 17, 9, 14, 20, 5, 23, 12,
++ 21, 13, 24, 6, 7, 25, 27, 26, 15, 25,
++ 25
++};
+
+-#ifdef YYSTACK_USE_ALLOCA
+-#define YYSTACK_ALLOC alloca
+-#else
+-#define YYSTACK_ALLOC malloc
++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
++# define YYSIZE_T __SIZE_TYPE__
++#endif
++#if ! defined (YYSIZE_T) && defined (size_t)
++# define YYSIZE_T size_t
++#endif
++#if ! defined (YYSIZE_T)
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++#endif
++#if ! defined (YYSIZE_T)
++# define YYSIZE_T unsigned int
+ #endif
+-
+-/* Note: there must be only one dollar sign in this file.
+- It is replaced by the list of actions, each action
+- as one case of the switch. */
+
+ #define yyerrok (yyerrstatus = 0)
+ #define yyclearin (yychar = YYEMPTY)
+-#define YYEMPTY -2
++#define YYEMPTY (-2)
+ #define YYEOF 0
++
+ #define YYACCEPT goto yyacceptlab
+-#define YYABORT goto yyabortlab
+-#define YYERROR goto yyerrlab1
+-/* Like YYERROR except do call yyerror.
+- This remains here temporarily to ease the
+- transition to the new meaning of YYERROR, for GCC.
++#define YYABORT goto yyabortlab
++#define YYERROR goto yyerrorlab
++
++
++/* Like YYERROR except do call yyerror. This remains here temporarily
++ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
++
+ #define YYFAIL goto yyerrlab
++
+ #define YYRECOVERING() (!!yyerrstatus)
+-#define YYBACKUP(token, value) \
++
++#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY && yylen == 1) \
+- { yychar = (token), yylval = (value); \
+- yychar1 = YYTRANSLATE (yychar); \
++ { \
++ yychar = (Token); \
++ yylval = (Value); \
++ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+- { yyerror ("syntax error: cannot back up"); YYERROR; } \
++ { \
++ yyerror ("syntax error: cannot back up");\
++ YYERROR; \
++ } \
+ while (0)
+
+ #define YYTERROR 1
+ #define YYERRCODE 256
+
+-#ifndef YYPURE
+-#define YYLEX yylex()
+-#endif
++/* YYLLOC_DEFAULT -- Compute the default location (before the actions
++ are run). */
+
+-#ifdef YYPURE
+-#ifdef YYLSP_NEEDED
+-#ifdef YYLEX_PARAM
+-#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
+-#else
+-#define YYLEX yylex(&yylval, &yylloc)
++#ifndef YYLLOC_DEFAULT
++# define YYLLOC_DEFAULT(Current, Rhs, N) \
++ ((Current).first_line = (Rhs)[1].first_line, \
++ (Current).first_column = (Rhs)[1].first_column, \
++ (Current).last_line = (Rhs)[N].last_line, \
++ (Current).last_column = (Rhs)[N].last_column)
+ #endif
+-#else /* not YYLSP_NEEDED */
++
++/* YYLEX -- calling `yylex' with the right arguments. */
++
+ #ifdef YYLEX_PARAM
+-#define YYLEX yylex(&yylval, YYLEX_PARAM)
++# define YYLEX yylex (YYLEX_PARAM)
+ #else
+-#define YYLEX yylex(&yylval)
+-#endif
+-#endif /* not YYLSP_NEEDED */
++# define YYLEX yylex ()
+ #endif
+
+-/* If nonreentrant, generate the variables here */
++/* Enable debugging if requested. */
++#if YYDEBUG
+
+-#ifndef YYPURE
++# ifndef YYFPRINTF
++# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
++# define YYFPRINTF fprintf
++# endif
++
++# define YYDPRINTF(Args) \
++do { \
++ if (yydebug) \
++ YYFPRINTF Args; \
++} while (0)
++
++# define YYDSYMPRINT(Args) \
++do { \
++ if (yydebug) \
++ yysymprint Args; \
++} while (0)
++
++# define YYDSYMPRINTF(Title, Token, Value, Location) \
++do { \
++ if (yydebug) \
++ { \
++ YYFPRINTF (stderr, "%s ", Title); \
++ yysymprint (stderr, \
++ Token, Value); \
++ YYFPRINTF (stderr, "\n"); \
++ } \
++} while (0)
+
+-int yychar; /* the lookahead symbol */
+-YYSTYPE yylval; /* the semantic value of the */
+- /* lookahead symbol */
++/*------------------------------------------------------------------.
++| yy_stack_print -- Print the state stack from its BOTTOM up to its |
++| TOP (included). |
++`------------------------------------------------------------------*/
+
+-#ifdef YYLSP_NEEDED
+-YYLTYPE yylloc; /* location data for the lookahead */
+- /* symbol */
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yy_stack_print (short int *bottom, short int *top)
++#else
++static void
++yy_stack_print (bottom, top)
++ short int *bottom;
++ short int *top;
+ #endif
++{
++ YYFPRINTF (stderr, "Stack now");
++ for (/* Nothing. */; bottom <= top; ++bottom)
++ YYFPRINTF (stderr, " %d", *bottom);
++ YYFPRINTF (stderr, "\n");
++}
+
+-int yynerrs; /* number of parse errors so far */
+-#endif /* not YYPURE */
++# define YY_STACK_PRINT(Bottom, Top) \
++do { \
++ if (yydebug) \
++ yy_stack_print ((Bottom), (Top)); \
++} while (0)
+
+-#if YYDEBUG != 0
+-int yydebug; /* nonzero means print parse trace */
+-/* Since this is uninitialized, it does not stop multiple parsers
+- from coexisting. */
++
++/*------------------------------------------------.
++| Report that the YYRULE is going to be reduced. |
++`------------------------------------------------*/
++
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yy_reduce_print (int yyrule)
++#else
++static void
++yy_reduce_print (yyrule)
++ int yyrule;
+ #endif
++{
++ int yyi;
++ unsigned int yylno = yyrline[yyrule];
++ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
++ yyrule - 1, yylno);
++ /* Print the symbols being reduced, and their result. */
++ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
++ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
++ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
++}
++
++# define YY_REDUCE_PRINT(Rule) \
++do { \
++ if (yydebug) \
++ yy_reduce_print (Rule); \
++} while (0)
++
++/* Nonzero means print parse trace. It is left uninitialized so that
++ multiple parsers can coexist. */
++int yydebug;
++#else /* !YYDEBUG */
++# define YYDPRINTF(Args)
++# define YYDSYMPRINT(Args)
++# define YYDSYMPRINTF(Title, Token, Value, Location)
++# define YY_STACK_PRINT(Bottom, Top)
++# define YY_REDUCE_PRINT(Rule)
++#endif /* !YYDEBUG */
+
+-/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
++/* YYINITDEPTH -- initial size of the parser's stacks. */
+ #ifndef YYINITDEPTH
+-#define YYINITDEPTH 200
++# define YYINITDEPTH 200
+ #endif
+
+-/* YYMAXDEPTH is the maximum size the stacks can grow to
+- (effective only if the built-in stack extension method is used). */
++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
++ if the built-in stack extension method is used).
+
+-#if YYMAXDEPTH == 0
+-#undef YYMAXDEPTH
++ Do not make this value too large; the results are undefined if
++ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
++ evaluated with infinite-precision integer arithmetic. */
++
++#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
++# undef YYMAXDEPTH
+ #endif
+
+ #ifndef YYMAXDEPTH
+-#define YYMAXDEPTH 10000
++# define YYMAXDEPTH 10000
+ #endif
++
+
+-/* Define __yy_memcpy. Note that the size argument
+- should be passed with type unsigned int, because that is what the non-GCC
+- definitions require. With GCC, __builtin_memcpy takes an arg
+- of type size_t, but it can handle unsigned int. */
+-
+-#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+-#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+-#else /* not GNU C or C++ */
+-#ifndef __cplusplus
+
+-/* This is the most reliable way to avoid incompatibilities
+- in available built-in functions on various systems. */
+-static void
+-__yy_memcpy (to, from, count)
+- char *to;
+- char *from;
+- unsigned int count;
+-{
+- register char *f = from;
+- register char *t = to;
+- register int i = count;
++#if YYERROR_VERBOSE
++
++# ifndef yystrlen
++# if defined (__GLIBC__) && defined (_STRING_H)
++# define yystrlen strlen
++# else
++/* Return the length of YYSTR. */
++static YYSIZE_T
++# if defined (__STDC__) || defined (__cplusplus)
++yystrlen (const char *yystr)
++# else
++yystrlen (yystr)
++ const char *yystr;
++# endif
++{
++ register const char *yys = yystr;
++
++ while (*yys++ != '\0')
++ continue;
++
++ return yys - yystr - 1;
++}
++# endif
++# endif
++
++# ifndef yystpcpy
++# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
++# define yystpcpy stpcpy
++# else
++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
++ YYDEST. */
++static char *
++# if defined (__STDC__) || defined (__cplusplus)
++yystpcpy (char *yydest, const char *yysrc)
++# else
++yystpcpy (yydest, yysrc)
++ char *yydest;
++ const char *yysrc;
++# endif
++{
++ register char *yyd = yydest;
++ register const char *yys = yysrc;
+
+- while (i-- > 0)
+- *t++ = *f++;
++ while ((*yyd++ = *yys++) != '\0')
++ continue;
++
++ return yyd - 1;
+ }
++# endif
++# endif
++
++#endif /* !YYERROR_VERBOSE */
+
+-#else /* __cplusplus */
++
++
++#if YYDEBUG
++/*--------------------------------.
++| Print this symbol on YYOUTPUT. |
++`--------------------------------*/
+
+-/* This is the most reliable way to avoid incompatibilities
+- in available built-in functions on various systems. */
++#if defined (__STDC__) || defined (__cplusplus)
+ static void
+-__yy_memcpy (char *to, char *from, unsigned int count)
++yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
++#else
++static void
++yysymprint (yyoutput, yytype, yyvaluep)
++ FILE *yyoutput;
++ int yytype;
++ YYSTYPE *yyvaluep;
++#endif
+ {
+- register char *t = to;
+- register char *f = from;
+- register int i = count;
++ /* Pacify ``unused variable'' warnings. */
++ (void) yyvaluep;
+
+- while (i-- > 0)
+- *t++ = *f++;
++ if (yytype < YYNTOKENS)
++ {
++ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
++# ifdef YYPRINT
++ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
++# endif
++ }
++ else
++ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
++
++ switch (yytype)
++ {
++ default:
++ break;
++ }
++ YYFPRINTF (yyoutput, ")");
+ }
+
++#endif /* ! YYDEBUG */
++/*-----------------------------------------------.
++| Release the memory associated to this symbol. |
++`-----------------------------------------------*/
++
++#if defined (__STDC__) || defined (__cplusplus)
++static void
++yydestruct (int yytype, YYSTYPE *yyvaluep)
++#else
++static void
++yydestruct (yytype, yyvaluep)
++ int yytype;
++ YYSTYPE *yyvaluep;
+ #endif
+-#endif
++{
++ /* Pacify ``unused variable'' warnings. */
++ (void) yyvaluep;
++
++ switch (yytype)
++ {
++
++ default:
++ break;
++ }
++}
+
+-#line 217 "/usr/lib/bison.simple"
+
+-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+- into yyparse. The argument should have type void *.
+- It should actually point to an object.
+- Grammar actions can access the variable by casting it
+- to the proper pointer type. */
++/* Prevent warnings from -Wmissing-prototypes. */
+
+ #ifdef YYPARSE_PARAM
+-#ifdef __cplusplus
+-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+-#define YYPARSE_PARAM_DECL
+-#else /* not __cplusplus */
+-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+-#endif /* not __cplusplus */
+-#else /* not YYPARSE_PARAM */
+-#define YYPARSE_PARAM_ARG
+-#define YYPARSE_PARAM_DECL
+-#endif /* not YYPARSE_PARAM */
++# if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void *YYPARSE_PARAM);
++# else
++int yyparse ();
++# endif
++#else /* ! YYPARSE_PARAM */
++#if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void);
++#else
++int yyparse ();
++#endif
++#endif /* ! YYPARSE_PARAM */
++
++
++
++/* The lookahead symbol. */
++int yychar;
++
++/* The semantic value of the lookahead symbol. */
++YYSTYPE yylval;
++
++/* Number of syntax errors so far. */
++int yynerrs;
++
++
++
++/*----------.
++| yyparse. |
++`----------*/
+
+-/* Prevent warning if -Wstrict-prototypes. */
+-#ifdef __GNUC__
+ #ifdef YYPARSE_PARAM
+-int yyparse (void *);
++# if defined (__STDC__) || defined (__cplusplus)
++int yyparse (void *YYPARSE_PARAM)
++# else
++int yyparse (YYPARSE_PARAM)
++ void *YYPARSE_PARAM;
++# endif
++#else /* ! YYPARSE_PARAM */
++#if defined (__STDC__) || defined (__cplusplus)
++int
++yyparse (void)
+ #else
+-int yyparse (void);
++int
++yyparse ()
++
+ #endif
+ #endif
+-
+-int
+-yyparse(YYPARSE_PARAM_ARG)
+- YYPARSE_PARAM_DECL
+ {
++
+ register int yystate;
+ register int yyn;
+- register short *yyssp;
++ int yyresult;
++ /* Number of tokens to shift before error messages enabled. */
++ int yyerrstatus;
++ /* Lookahead token as an internal (translated) token number. */
++ int yytoken = 0;
++
++ /* Three stacks and their tools:
++ `yyss': related to states,
++ `yyvs': related to semantic values,
++ `yyls': related to locations.
++
++ Refer to the stacks thru separate pointers, to allow yyoverflow
++ to reallocate them elsewhere. */
++
++ /* The state stack. */
++ short int yyssa[YYINITDEPTH];
++ short int *yyss = yyssa;
++ register short int *yyssp;
++
++ /* The semantic value stack. */
++ YYSTYPE yyvsa[YYINITDEPTH];
++ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+- int yyerrstatus; /* number of tokens to shift before error messages enabled */
+- int yychar1 = 0; /* lookahead token as an internal (translated) token number */
+-
+- short yyssa[YYINITDEPTH]; /* the state stack */
+- YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+- short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+- YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+-#ifdef YYLSP_NEEDED
+- YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+- YYLTYPE *yyls = yylsa;
+- YYLTYPE *yylsp;
+
+-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+-#else
+ #define YYPOPSTACK (yyvsp--, yyssp--)
+-#endif
+
+- int yystacksize = YYINITDEPTH;
+- int yyfree_stacks = 0;
++ YYSIZE_T yystacksize = YYINITDEPTH;
+
+-#ifdef YYPURE
+- int yychar;
+- YYSTYPE yylval;
+- int yynerrs;
+-#ifdef YYLSP_NEEDED
+- YYLTYPE yylloc;
+-#endif
+-#endif
++ /* The variables used to return semantic value and location from the
++ action routines. */
++ YYSTYPE yyval;
+
+- YYSTYPE yyval; /* the variable used to return */
+- /* semantic values from the action */
+- /* routines */
+
++ /* When reducing, the number of symbols on the RHS of the reduced
++ rule. */
+ int yylen;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Starting parse\n");
+-#endif
++ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+@@ -479,110 +853,97 @@
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+- yyssp = yyss - 1;
++ yyssp = yyss;
+ yyvsp = yyvs;
+-#ifdef YYLSP_NEEDED
+- yylsp = yyls;
+-#endif
+
+-/* Push a new state, which is found in yystate . */
+-/* In all cases, when you get here, the value and location stacks
+- have just been pushed. so pushing a state here evens the stacks. */
+-yynewstate:
+
+- *++yyssp = yystate;
++ goto yysetstate;
+
+- if (yyssp >= yyss + yystacksize - 1)
+- {
+- /* Give user a chance to reallocate the stack */
+- /* Use copies of these so that the &'s don't force the real ones into memory. */
+- YYSTYPE *yyvs1 = yyvs;
+- short *yyss1 = yyss;
+-#ifdef YYLSP_NEEDED
+- YYLTYPE *yyls1 = yyls;
+-#endif
++/*------------------------------------------------------------.
++| yynewstate -- Push a new state, which is found in yystate. |
++`------------------------------------------------------------*/
++ yynewstate:
++ /* In all cases, when you get here, the value and location stacks
++ have just been pushed. so pushing a state here evens the stacks.
++ */
++ yyssp++;
+
++ yysetstate:
++ *yyssp = yystate;
++
++ if (yyss + yystacksize - 1 <= yyssp)
++ {
+ /* Get the current used size of the three stacks, in elements. */
+- int size = yyssp - yyss + 1;
++ YYSIZE_T yysize = yyssp - yyss + 1;
+
+ #ifdef yyoverflow
+- /* Each stack pointer address is followed by the size of
+- the data in use in that stack, in bytes. */
+-#ifdef YYLSP_NEEDED
+- /* This used to be a conditional around just the two extra args,
+- but that might be undefined if yyoverflow is a macro. */
+- yyoverflow("parser stack overflow",
+- &yyss1, size * sizeof (*yyssp),
+- &yyvs1, size * sizeof (*yyvsp),
+- &yyls1, size * sizeof (*yylsp),
+- &yystacksize);
+-#else
+- yyoverflow("parser stack overflow",
+- &yyss1, size * sizeof (*yyssp),
+- &yyvs1, size * sizeof (*yyvsp),
+- &yystacksize);
+-#endif
+-
+- yyss = yyss1; yyvs = yyvs1;
+-#ifdef YYLSP_NEEDED
+- yyls = yyls1;
+-#endif
++ {
++ /* Give user a chance to reallocate the stack. Use copies of
++ these so that the &'s don't force the real ones into
++ memory. */
++ YYSTYPE *yyvs1 = yyvs;
++ short int *yyss1 = yyss;
++
++
++ /* Each stack pointer address is followed by the size of the
++ data in use in that stack, in bytes. This used to be a
++ conditional around just the two extra args, but that might
++ be undefined if yyoverflow is a macro. */
++ yyoverflow ("parser stack overflow",
++ &yyss1, yysize * sizeof (*yyssp),
++ &yyvs1, yysize * sizeof (*yyvsp),
++
++ &yystacksize);
++
++ yyss = yyss1;
++ yyvs = yyvs1;
++ }
+ #else /* no yyoverflow */
++# ifndef YYSTACK_RELOCATE
++ goto yyoverflowlab;
++# else
+ /* Extend the stack our own way. */
+- if (yystacksize >= YYMAXDEPTH)
+- {
+- yyerror("parser stack overflow");
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
+-#endif
+- }
+- return 2;
+- }
++ if (YYMAXDEPTH <= yystacksize)
++ goto yyoverflowlab;
+ yystacksize *= 2;
+- if (yystacksize > YYMAXDEPTH)
++ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+-#ifndef YYSTACK_USE_ALLOCA
+- yyfree_stacks = 1;
+-#endif
+- yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+- __yy_memcpy ((char *)yyss, (char *)yyss1,
+- size * (unsigned int) sizeof (*yyssp));
+- yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+- __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+- size * (unsigned int) sizeof (*yyvsp));
+-#ifdef YYLSP_NEEDED
+- yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+- __yy_memcpy ((char *)yyls, (char *)yyls1,
+- size * (unsigned int) sizeof (*yylsp));
+-#endif
++
++ {
++ short int *yyss1 = yyss;
++ union yyalloc *yyptr =
++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
++ if (! yyptr)
++ goto yyoverflowlab;
++ YYSTACK_RELOCATE (yyss);
++ YYSTACK_RELOCATE (yyvs);
++
++# undef YYSTACK_RELOCATE
++ if (yyss1 != yyssa)
++ YYSTACK_FREE (yyss1);
++ }
++# endif
+ #endif /* no yyoverflow */
+
+- yyssp = yyss + size - 1;
+- yyvsp = yyvs + size - 1;
+-#ifdef YYLSP_NEEDED
+- yylsp = yyls + size - 1;
+-#endif
++ yyssp = yyss + yysize - 1;
++ yyvsp = yyvs + yysize - 1;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+-#endif
+
+- if (yyssp >= yyss + yystacksize - 1)
++ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
++ (unsigned long int) yystacksize));
++
++ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Entering state %d\n", yystate);
+-#endif
++ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+- yybackup:
++
++/*-----------.
++| yybackup. |
++`-----------*/
++yybackup:
+
+ /* Do appropriate processing given the current state. */
+ /* Read a lookahead token if we need one and don't already have one. */
+@@ -591,194 +952,167 @@
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+- if (yyn == YYFLAG)
++ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+- /* yychar is either YYEMPTY or YYEOF
+- or a valid token in external form. */
+-
++ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Reading a token: ");
+-#endif
++ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+- /* Convert token to internal form (in yychar1) for indexing tables with */
+-
+- if (yychar <= 0) /* This means end of input. */
++ if (yychar <= YYEOF)
+ {
+- yychar1 = 0;
+- yychar = YYEOF; /* Don't call YYLEX any more */
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Now at end of input.\n");
+-#endif
++ yychar = yytoken = YYEOF;
++ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+- yychar1 = YYTRANSLATE(yychar);
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+- /* Give the individual parser a way to print the precise meaning
+- of a token, for further debugging info. */
+-#ifdef YYPRINT
+- YYPRINT (stderr, yychar, yylval);
+-#endif
+- fprintf (stderr, ")\n");
+- }
+-#endif
++ yytoken = YYTRANSLATE (yychar);
++ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+- yyn += yychar1;
+- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
++ /* If the proper action on seeing token YYTOKEN is to reduce or to
++ detect an error, take that action. */
++ yyn += yytoken;
++ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+-
+ yyn = yytable[yyn];
+-
+- /* yyn is what to do for this token type in this state.
+- Negative => reduce, -yyn is rule number.
+- Positive => shift, yyn is new state.
+- New state is final state => don't bother to shift,
+- just return success.
+- 0, or most negative number => error. */
+-
+- if (yyn < 0)
++ if (yyn <= 0)
+ {
+- if (yyn == YYFLAG)
++ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+- else if (yyn == 0)
+- goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+-#endif
++ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+-#ifdef YYLSP_NEEDED
+- *++yylsp = yylloc;
+-#endif
+
+- /* count tokens shifted since error; after three, turn off error status. */
+- if (yyerrstatus) yyerrstatus--;
++
++ /* Count tokens shifted since error; after three, turn off error
++ status. */
++ if (yyerrstatus)
++ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+-/* Do the default action for the current state. */
+-yydefault:
+
++/*-----------------------------------------------------------.
++| yydefault -- do the default action for the current state. |
++`-----------------------------------------------------------*/
++yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
++ goto yyreduce;
++
+
+-/* Do a reduction. yyn is the number of a rule to reduce with. */
++/*-----------------------------.
++| yyreduce -- Do a reduction. |
++`-----------------------------*/
+ yyreduce:
++ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+- if (yylen > 0)
+- yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- int i;
++ /* If YYLEN is nonzero, implement the default value of the action:
++ `$$ = $1'.
+
+- fprintf (stderr, "Reducing via rule %d (line %d), ",
+- yyn, yyrline[yyn]);
++ Otherwise, the following line sets YYVAL to garbage.
++ This behavior is undocumented and Bison
++ users should not rely upon it. Assigning to YYVAL
++ unconditionally makes the parser a bit smaller, and it avoids a
++ GCC warning that YYVAL may be used uninitialized. */
++ yyval = yyvsp[1-yylen];
+
+- /* Print the symbols being reduced, and their result. */
+- for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+- fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+- fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+- }
+-#endif
+
+-
+- switch (yyn) {
+-
+-case 4:
+-#line 47 "cfg_y.y"
+-{
++ YY_REDUCE_PRINT (yyn);
++ switch (yyn)
++ {
++ case 5:
++#line 50 "cfg_y.y"
++ {
+ control_init(yyvsp[-1].str);
+- ;
+- break;}
+-case 5:
+-#line 54 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 6:
++#line 57 "cfg_y.y"
++ {
+ fab_option(yyvsp[-1].str,yyvsp[0].str);
+- ;
+- break;}
+-case 6:
+-#line 61 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 7:
++#line 64 "cfg_y.y"
++ {
+ itf = 0;
+- ;
+- break;}
+-case 7:
+-#line 65 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 8:
++#line 68 "cfg_y.y"
++ {
+ char *tmp;
+
+ tmp = strdup(yyvsp[-3].str);
+ if (!tmp) yyerror(strerror(errno));
+ sig = sig_vc(yyvsp[-4].str,tmp,itf);
+- ;
+- break;}
+-case 9:
+-#line 77 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 10:
++#line 80 "cfg_y.y"
++ {
+ yyval.str = NULL;
+- ;
+- break;}
+-case 10:
+-#line 81 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 11:
++#line 84 "cfg_y.y"
++ {
+ yyval.str = strdup(yyvsp[0].str);
+ if (!yyval.str) yyerror(strerror(errno));
+- ;
+- break;}
+-case 12:
+-#line 89 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 13:
++#line 92 "cfg_y.y"
++ {
+ itf = yyvsp[0].num;
+- ;
+- break;}
+-case 14:
+-#line 96 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 15:
++#line 99 "cfg_y.y"
++ {
+ sig->pvc = yyvsp[0].pvc;
+- ;
+- break;}
+-case 17:
+-#line 104 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 18:
++#line 107 "cfg_y.y"
++ {
+ put_route(NULL,0,sig);
+- ;
+- break;}
+-case 19:
+-#line 112 "cfg_y.y"
+-{
++ }
++ break;
++
++ case 20:
++#line 115 "cfg_y.y"
++ {
+ struct sockaddr_atmsvc addr;
+ char *mask;
+
+@@ -790,228 +1124,236 @@
+ return;
+ }
+ put_route(&addr,mask ? strtol(mask,NULL,10) : INT_MAX,sig);
+- ;
+- break;}
+-}
+- /* the action file gets copied in in place of this dollarsign */
+-#line 543 "/usr/lib/bison.simple"
++ }
++ break;
++
++
++ }
++
++/* Line 1010 of yacc.c. */
++#line 1135 "y.tab.c"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+-#ifdef YYLSP_NEEDED
+- yylsp -= yylen;
+-#endif
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- short *ssp1 = yyss - 1;
+- fprintf (stderr, "state stack now");
+- while (ssp1 != yyssp)
+- fprintf (stderr, " %d", *++ssp1);
+- fprintf (stderr, "\n");
+- }
+-#endif
++
++ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+-#ifdef YYLSP_NEEDED
+- yylsp++;
+- if (yylen == 0)
+- {
+- yylsp->first_line = yylloc.first_line;
+- yylsp->first_column = yylloc.first_column;
+- yylsp->last_line = (yylsp-1)->last_line;
+- yylsp->last_column = (yylsp-1)->last_column;
+- yylsp->text = 0;
+- }
+- else
+- {
+- yylsp->last_line = (yylsp+yylen-1)->last_line;
+- yylsp->last_column = (yylsp+yylen-1)->last_column;
+- }
+-#endif
+
+- /* Now "shift" the result of the reduction.
+- Determine what state that goes to,
+- based on the state we popped back to
+- and the rule number reduced by. */
++ /* Now `shift' the result of the reduction. Determine what state
++ that goes to, based on the state we popped back to and the rule
++ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+- yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+- if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
++ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
++ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+- yystate = yydefgoto[yyn - YYNTBASE];
++ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+-yyerrlab: /* here on detecting error */
+
+- if (! yyerrstatus)
+- /* If not already recovering from an error, report this error. */
++/*------------------------------------.
++| yyerrlab -- here on detecting error |
++`------------------------------------*/
++yyerrlab:
++ /* If not already recovering from an error, report this error. */
++ if (!yyerrstatus)
+ {
+ ++yynerrs;
+-
+-#ifdef YYERROR_VERBOSE
++#if YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+- if (yyn > YYFLAG && yyn < YYLAST)
++ if (YYPACT_NINF < yyn && yyn < YYLAST)
+ {
+- int size = 0;
+- char *msg;
+- int x, count;
+-
+- count = 0;
+- /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+- for (x = (yyn < 0 ? -yyn : 0);
+- x < (sizeof(yytname) / sizeof(char *)); x++)
+- if (yycheck[x + yyn] == x)
+- size += strlen(yytname[x]) + 15, count++;
+- msg = (char *) malloc(size + 15);
+- if (msg != 0)
++ YYSIZE_T yysize = 0;
++ int yytype = YYTRANSLATE (yychar);
++ const char* yyprefix;
++ char *yymsg;
++ int yyx;
++
++ /* Start YYX at -YYN if negative to avoid negative indexes in
++ YYCHECK. */
++ int yyxbegin = yyn < 0 ? -yyn : 0;
++
++ /* Stay within bounds of both yycheck and yytname. */
++ int yychecklim = YYLAST - yyn;
++ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
++ int yycount = 0;
++
++ yyprefix = ", expecting ";
++ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
++ {
++ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
++ yycount += 1;
++ if (yycount == 5)
++ {
++ yysize = 0;
++ break;
++ }
++ }
++ yysize += (sizeof ("syntax error, unexpected ")
++ + yystrlen (yytname[yytype]));
++ yymsg = (char *) YYSTACK_ALLOC (yysize);
++ if (yymsg != 0)
+ {
+- strcpy(msg, "parse error");
++ char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
++ yyp = yystpcpy (yyp, yytname[yytype]);
+
+- if (count < 5)
++ if (yycount < 5)
+ {
+- count = 0;
+- for (x = (yyn < 0 ? -yyn : 0);
+- x < (sizeof(yytname) / sizeof(char *)); x++)
+- if (yycheck[x + yyn] == x)
++ yyprefix = ", expecting ";
++ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
++ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+- strcat(msg, count == 0 ? ", expecting `" : " or `");
+- strcat(msg, yytname[x]);
+- strcat(msg, "'");
+- count++;
++ yyp = yystpcpy (yyp, yyprefix);
++ yyp = yystpcpy (yyp, yytname[yyx]);
++ yyprefix = " or ";
+ }
+ }
+- yyerror(msg);
+- free(msg);
++ yyerror (yymsg);
++ YYSTACK_FREE (yymsg);
+ }
+ else
+- yyerror ("parse error; also virtual memory exceeded");
++ yyerror ("syntax error; also virtual memory exhausted");
+ }
+ else
+ #endif /* YYERROR_VERBOSE */
+- yyerror("parse error");
++ yyerror ("syntax error");
+ }
+
+- goto yyerrlab1;
+-yyerrlab1: /* here on error raised explicitly by an action */
++
+
+ if (yyerrstatus == 3)
+ {
+- /* if just tried and failed to reuse lookahead token after an error, discard it. */
++ /* If just tried and failed to reuse lookahead token after an
++ error, discard it. */
+
+- /* return failure if at end of input */
+- if (yychar == YYEOF)
+- YYABORT;
+-
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+-#endif
++ if (yychar <= YYEOF)
++ {
++ /* If at end of input, pop the error token,
++ then the rest of the stack, then return failure. */
++ if (yychar == YYEOF)
++ for (;;)
++ {
++ YYPOPSTACK;
++ if (yyssp == yyss)
++ YYABORT;
++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
++ yydestruct (yystos[*yyssp], yyvsp);
++ }
++ }
++ else
++ {
++ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
++ yydestruct (yytoken, &yylval);
++ yychar = YYEMPTY;
+
+- yychar = YYEMPTY;
++ }
+ }
+
+- /* Else will try to reuse lookahead token
+- after shifting the error token. */
+-
+- yyerrstatus = 3; /* Each real token shifted decrements this */
++ /* Else will try to reuse lookahead token after shifting the error
++ token. */
++ goto yyerrlab1;
+
+- goto yyerrhandle;
+
+-yyerrdefault: /* current state does not do anything special for the error token. */
++/*---------------------------------------------------.
++| yyerrorlab -- error raised explicitly by YYERROR. |
++`---------------------------------------------------*/
++yyerrorlab:
+
+-#if 0
+- /* This is wrong; only states that explicitly want error tokens
+- should shift them. */
+- yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+- if (yyn) goto yydefault;
++#ifdef __GNUC__
++ /* Pacify GCC when the user code never invokes YYERROR and the label
++ yyerrorlab therefore never appears in user code. */
++ if (0)
++ goto yyerrorlab;
+ #endif
+
+-yyerrpop: /* pop the current state because it cannot handle the error token */
+-
+- if (yyssp == yyss) YYABORT;
+- yyvsp--;
+- yystate = *--yyssp;
+-#ifdef YYLSP_NEEDED
+- yylsp--;
+-#endif
++ yyvsp -= yylen;
++ yyssp -= yylen;
++ yystate = *yyssp;
++ goto yyerrlab1;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- {
+- short *ssp1 = yyss - 1;
+- fprintf (stderr, "Error: state stack now");
+- while (ssp1 != yyssp)
+- fprintf (stderr, " %d", *++ssp1);
+- fprintf (stderr, "\n");
+- }
+-#endif
+
+-yyerrhandle:
++/*-------------------------------------------------------------.
++| yyerrlab1 -- common code for both syntax error and YYERROR. |
++`-------------------------------------------------------------*/
++yyerrlab1:
++ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+- yyn = yypact[yystate];
+- if (yyn == YYFLAG)
+- goto yyerrdefault;
++ for (;;)
++ {
++ yyn = yypact[yystate];
++ if (yyn != YYPACT_NINF)
++ {
++ yyn += YYTERROR;
++ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
++ {
++ yyn = yytable[yyn];
++ if (0 < yyn)
++ break;
++ }
++ }
+
+- yyn += YYTERROR;
+- if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+- goto yyerrdefault;
++ /* Pop the current state because it cannot handle the error token. */
++ if (yyssp == yyss)
++ YYABORT;
+
+- yyn = yytable[yyn];
+- if (yyn < 0)
+- {
+- if (yyn == YYFLAG)
+- goto yyerrpop;
+- yyn = -yyn;
+- goto yyreduce;
++ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
++ yydestruct (yystos[yystate], yyvsp);
++ YYPOPSTACK;
++ yystate = *yyssp;
++ YY_STACK_PRINT (yyss, yyssp);
+ }
+- else if (yyn == 0)
+- goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+-#if YYDEBUG != 0
+- if (yydebug)
+- fprintf(stderr, "Shifting error token, ");
+-#endif
++ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+-#ifdef YYLSP_NEEDED
+- *++yylsp = yylloc;
+-#endif
++
+
+ yystate = yyn;
+ goto yynewstate;
+
+- yyacceptlab:
+- /* YYACCEPT comes here. */
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
+-#endif
+- }
+- return 0;
+
+- yyabortlab:
+- /* YYABORT comes here. */
+- if (yyfree_stacks)
+- {
+- free (yyss);
+- free (yyvs);
+-#ifdef YYLSP_NEEDED
+- free (yyls);
++/*-------------------------------------.
++| yyacceptlab -- YYACCEPT comes here. |
++`-------------------------------------*/
++yyacceptlab:
++ yyresult = 0;
++ goto yyreturn;
++
++/*-----------------------------------.
++| yyabortlab -- YYABORT comes here. |
++`-----------------------------------*/
++yyabortlab:
++ yyresult = 1;
++ goto yyreturn;
++
++#ifndef yyoverflow
++/*----------------------------------------------.
++| yyoverflowlab -- parser overflow comes here. |
++`----------------------------------------------*/
++yyoverflowlab:
++ yyerror ("parser stack overflow");
++ yyresult = 2;
++ /* Fall through. */
++#endif
++
++yyreturn:
++#ifndef yyoverflow
++ if (yyss != yyssa)
++ YYSTACK_FREE (yyss);
+ #endif
+- }
+- return 1;
++ return yyresult;
+ }
+-#line 126 "cfg_y.y"
++
++
++
+--- linux-atm-2.4.1.orig/src/switch/cfg_y.y
++++ linux-atm-2.4.1/src/switch/cfg_y.y
+@@ -10,6 +10,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <limits.h>
++#include <stdlib.h>
+
+ #include "atm.h"
+
+@@ -19,6 +20,8 @@
+ #include "swc.h"
+
+
++extern void yyerror(const char *s);
++
+ static int itf;
+ static SIGNALING_ENTITY *sig;
+
+--- linux-atm-2.4.1.orig/src/switch/cfg_y.h
++++ linux-atm-2.4.1/src/switch/cfg_y.h
+@@ -1,19 +1,77 @@
+-typedef union {
++/* A Bison parser, made by GNU Bison 1.875d. */
++
++/* Skeleton parser for Yacc-like parsing with Bison,
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA. */
++
++/* As a special exception, when this file is copied by Bison into a
++ Bison output file, you may use that output file without restriction.
++ This special exception was added by the Free Software Foundation
++ in version 1.24 of Bison. */
++
++/* Tokens. */
++#ifndef YYTOKENTYPE
++# define YYTOKENTYPE
++ /* Put the tokens into the symbol table, so that GDB and other debuggers
++ know about them. */
++ enum yytokentype {
++ TOK_COMMAND = 258,
++ TOK_VPCI = 259,
++ TOK_ITF = 260,
++ TOK_DEFAULT = 261,
++ TOK_ROUTE = 262,
++ TOK_STR = 263,
++ TOK_SOCKET = 264,
++ TOK_OPTION = 265,
++ TOK_CONTROL = 266,
++ TOK_NUM = 267,
++ TOK_PVC = 268
++ };
++#endif
++#define TOK_COMMAND 258
++#define TOK_VPCI 259
++#define TOK_ITF 260
++#define TOK_DEFAULT 261
++#define TOK_ROUTE 262
++#define TOK_STR 263
++#define TOK_SOCKET 264
++#define TOK_OPTION 265
++#define TOK_CONTROL 266
++#define TOK_NUM 267
++#define TOK_PVC 268
++
++
++
++
++#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
++#line 30 "cfg_y.y"
++typedef union YYSTYPE {
+ int num;
+ char *str;
+ struct sockaddr_atmpvc pvc;
+ } YYSTYPE;
+-#define TOK_COMMAND 257
+-#define TOK_VPCI 258
+-#define TOK_ITF 259
+-#define TOK_DEFAULT 260
+-#define TOK_ROUTE 261
+-#define TOK_STR 262
+-#define TOK_SOCKET 263
+-#define TOK_OPTION 264
+-#define TOK_CONTROL 265
+-#define TOK_NUM 266
+-#define TOK_PVC 267
+-
++/* Line 1285 of yacc.c. */
++#line 69 "y.tab.h"
++# define yystype YYSTYPE /* obsolescent; will be withdrawn */
++# define YYSTYPE_IS_DECLARED 1
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
+
+ extern YYSTYPE yylval;
++
++
++
+--- linux-atm-2.4.1.orig/src/switch/debug/Makefile.in
++++ linux-atm-2.4.1/src/switch/debug/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -90,8 +90,7 @@
+ INCLUDES = -I$(top_builddir)/src/qgen
+
+ sw_debug_SOURCES = debug.c
+-sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a \
+- $(top_builddir)/src/lib/libatm.la
++sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a $(top_builddir)/src/lib/libatm.la
+
+ sw_debug_LDADD = $(sw_debug_XTRAS) -lfl
+
+@@ -121,8 +120,9 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/debug.P
+ SOURCES = $(sw_debug_SOURCES)
+ OBJECTS = $(sw_debug_OBJECTS)
+
+@@ -130,9 +130,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/switch/debug/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/switch/debug/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -146,9 +146,6 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -171,9 +168,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -212,7 +206,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -228,6 +222,11 @@
+ subdir = src/switch/debug
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/switch/debug/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -238,11 +237,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-debug.o: debug.c ../../../config.h ../../../src/include/atm.h \
+- ../../../src/include/stdint.h ../../../src/include/atmd.h \
+- ../../../src/qgen/uni.h ../fab.h ../proto.h \
+- ../../../src/include/atmsap.h ../sig.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -279,27 +305,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-noinstPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -310,12 +336,14 @@
+ mostlyclean-compile distclean-compile clean-compile \
+ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/switch/debug/debug.c
++++ linux-atm-2.4.1/src/switch/debug/debug.c
+@@ -43,7 +43,7 @@
+
+ void fab_init(CALL *call)
+ {
+- PRV(call) = alloc_t(FAB);
++ call->fab = alloc_t(FAB);
+ PRV(call)->next = calls;
+ calls = call;
+ }
+@@ -59,7 +59,7 @@
+ diag(COMPONENT,DIAG_FATAL,"fab_destroy: call %p not found",call);
+ *walk = PRV(call)->next;
+ free(PRV(call));
+- PRV(call) = NULL;
++ call->fab = NULL;
+ }
+
+
+--- linux-atm-2.4.1.orig/src/switch/tcp/Makefile.in
++++ linux-atm-2.4.1/src/switch/tcp/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -90,8 +90,7 @@
+ INCLUDES = -I$(top_builddir)/src/qgen
+
+ sw_tcp_SOURCES = tcpsw.c
+-sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a \
+- $(top_builddir)/src/lib/libatm.la
++sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a $(top_builddir)/src/lib/libatm.la
+
+ sw_tcp_LDADD = $(sw_tcp_XTRAS) -lfl
+ sw_tcp_DEPENDENCIES = $(sw_tcp_XTRAS)
+@@ -120,8 +119,9 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
++DEP_FILES = .deps/tcpsw.P
+ SOURCES = $(sw_tcp_SOURCES)
+ OBJECTS = $(sw_tcp_OBJECTS)
+
+@@ -129,9 +129,9 @@
+ .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/switch/tcp/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/switch/tcp/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -145,9 +145,6 @@
+
+ maintainer-clean-noinstPROGRAMS:
+
+-.c.o:
+- $(COMPILE) -c $<
+-
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+@@ -170,9 +167,6 @@
+
+ maintainer-clean-compile:
+
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+-
+ .s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+@@ -211,7 +205,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -227,6 +221,11 @@
+ subdir = src/switch/tcp
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/switch/tcp/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -237,11 +236,38 @@
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+-tcpsw.o: tcpsw.c ../../../config.h ../../../src/include/stdint.h \
+- ../../../src/include/atm.h ../../../src/include/atmd.h \
+- ../../../src/qgen/uni.h ../fab.h ../proto.h \
+- ../../../src/include/atmsap.h ../sig.h ../dispatch.h ../swc.h
+
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
+ info-am:
+ info: info-am
+ dvi-am:
+@@ -278,27 +304,27 @@
+
+ maintainer-clean-generic:
+ mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
+- mostlyclean-libtool mostlyclean-tags \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+ mostlyclean: mostlyclean-am
+
+ clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \
+- clean-generic mostlyclean-am
++ clean-depend clean-generic mostlyclean-am
+
+ clean: clean-am
+
+ distclean-am: distclean-noinstPROGRAMS distclean-compile \
+- distclean-libtool distclean-tags distclean-generic \
+- clean-am
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
+ -rm -f libtool
+
+ distclean: distclean-am
+
+ maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
+ maintainer-clean-compile maintainer-clean-libtool \
+- maintainer-clean-tags maintainer-clean-generic \
+- distclean-am
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+@@ -309,12 +335,14 @@
+ mostlyclean-compile distclean-compile clean-compile \
+ maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+ clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+-install-exec install-data-am install-data install-am install \
+-uninstall-am uninstall all-redirect all-am all installdirs \
+-mostlyclean-generic distclean-generic clean-generic \
+-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
+
+
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+--- linux-atm-2.4.1.orig/src/switch/tcp/tcpsw.c
++++ linux-atm-2.4.1/src/switch/tcp/tcpsw.c
+@@ -345,7 +345,7 @@
+
+ void fab_init(CALL *call)
+ {
+- PRV(call) = alloc_t(FAB);
++ call->fab = alloc_t(FAB);
+ PRV(call)->active = 0;
+ PRV(call)->next = calls;
+ calls = call;
+@@ -362,7 +362,7 @@
+ diag(COMPONENT,DIAG_FATAL,"fab_destroy: call %p not found",call);
+ *walk = PRV(call)->next;
+ free(PRV(call));
+- PRV(call) = NULL;
++ call->fab = NULL;
+ }
+
+
+--- linux-atm-2.4.1.orig/src/config/Makefile.in
++++ linux-atm-2.4.1/src/config/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -96,14 +96,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/config/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/config/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -186,7 +186,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -202,6 +202,11 @@
+ subdir = src/config
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/config/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/config/init-redhat/Makefile.in
++++ linux-atm-2.4.1/src/config/init-redhat/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -94,14 +94,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/config/init-redhat/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/config/init-redhat/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -114,6 +114,11 @@
+ subdir = src/config/init-redhat
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/config/init-redhat/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/extra/Makefile.in
++++ linux-atm-2.4.1/src/extra/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -96,14 +96,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/extra/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/extra/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -188,7 +188,7 @@
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
+
+ mostlyclean-tags:
+
+@@ -204,6 +204,11 @@
+ subdir = src/extra
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/extra/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/extra/ANS/Makefile.in
++++ linux-atm-2.4.1/src/extra/ANS/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -94,14 +94,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/extra/ANS/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/extra/ANS/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -114,6 +114,11 @@
+ subdir = src/extra/ANS
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/extra/ANS/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/src/br2684/Makefile.am
++++ linux-atm-2.4.1/src/br2684/Makefile.am
+@@ -0,0 +1,10 @@
++sbin_PROGRAMS = br2684ctl
++
++LDADD = $(top_builddir)/src/lib/libatm.la
++
++br2684ctl_SOURCES = br2684ctl.c
++
++man_MANS = br2684ctl.8
++
++EXTRA_DIST = $(man_MANS) USAGE.br2684
++
+--- linux-atm-2.4.1.orig/src/br2684/Makefile.in
++++ linux-atm-2.4.1/src/br2684/Makefile.in
+@@ -0,0 +1,418 @@
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
++
++# Copyright (C) 1994, 1995-8, 1999, 2001 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.
++
++
++SHELL = @SHELL@
++
++srcdir = @srcdir@
++top_srcdir = @top_srcdir@
++VPATH = @srcdir@
++prefix = @prefix@
++exec_prefix = @exec_prefix@
++
++bindir = @bindir@
++sbindir = @sbindir@
++libexecdir = @libexecdir@
++datadir = @datadir@
++sysconfdir = @sysconfdir@
++sharedstatedir = @sharedstatedir@
++localstatedir = @localstatedir@
++libdir = @libdir@
++infodir = @infodir@
++mandir = @mandir@
++includedir = @includedir@
++oldincludedir = /usr/include
++
++DESTDIR =
++
++pkgdatadir = $(datadir)/@PACKAGE@
++pkglibdir = $(libdir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@
++
++top_builddir = ../..
++
++ACLOCAL = @ACLOCAL@
++AUTOCONF = @AUTOCONF@
++AUTOMAKE = @AUTOMAKE@
++AUTOHEADER = @AUTOHEADER@
++
++INSTALL = @INSTALL@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
++INSTALL_DATA = @INSTALL_DATA@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++transform = @program_transform_name@
++
++NORMAL_INSTALL = :
++PRE_INSTALL = :
++POST_INSTALL = :
++NORMAL_UNINSTALL = :
++PRE_UNINSTALL = :
++POST_UNINSTALL = :
++host_alias = @host_alias@
++host_triplet = @host@
++AR = @AR@
++AS = @AS@
++CC = /usr/src/openwrt/staging_dir_mipsel/bin/mipsel-linux-gcc
++CXX = @CXX@
++CXXCPP = @CXXCPP@
++DLLTOOL = @DLLTOOL@
++ECHO = @ECHO@
++EGREP = @EGREP@
++EXEEXT = @EXEEXT@
++F77 = @F77@
++GCJ = @GCJ@
++GCJFLAGS = @GCJFLAGS@
++HAVE_LIB = @HAVE_LIB@
++LEX = @LEX@
++LIB = @LIB@
++LIBTOOL = @LIBTOOL@
++LIBTOOL_DEPS = @LIBTOOL_DEPS@
++LIBVER_AGE = @LIBVER_AGE@
++LIBVER_CURRENT = @LIBVER_CURRENT@
++LIBVER_REVISION = @LIBVER_REVISION@
++LN_S = @LN_S@
++LTLIB = @LTLIB@
++MAKEINFO = @MAKEINFO@
++OBJDUMP = @OBJDUMP@
++OBJEXT = @OBJEXT@
++PACKAGE = @PACKAGE@
++PERL = @PERL@
++RANLIB = @RANLIB@
++RC = @RC@
++STRIP = @STRIP@
++VERSION = @VERSION@
++YACC = @YACC@
++
++sbin_PROGRAMS = br2684ctl
++
++LDADD = $(top_builddir)/src/lib/libatm.la
++
++br2684ctl_SOURCES = br2684ctl.c
++
++man_MANS = br2684ctl.8
++
++EXTRA_DIST = $(man_MANS) USAGE.br2684
++mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
++CONFIG_HEADER = ../../config.h
++CONFIG_CLEAN_FILES =
++sbin_PROGRAMS = br2684ctl$(EXEEXT)
++PROGRAMS = $(sbin_PROGRAMS)
++
++
++DEFS = @DEFS@ -I. -I$(srcdir) -I../..
++CPPFLAGS = @CPPFLAGS@
++LDFLAGS = @LDFLAGS@
++LIBS = @LIBS@
++br2684ctl_OBJECTS = br2684ctl.$(OBJEXT)
++br2684ctl_LDADD = $(LDADD)
++br2684ctl_DEPENDENCIES = $(top_builddir)/src/lib/libatm.la
++br2684ctl_LDFLAGS =
++CFLAGS = @CFLAGS@
++COMPILE = $(TARGET_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++LTCOMPILE = $(LIBTOOL) --mode=compile $(TARGET_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++CCLD = $(TARGET_CC)
++LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
++man8dir = $(mandir)/man8
++MANS = $(man_MANS)
++
++NROFF = nroff
++DIST_COMMON = Makefile.am Makefile.in
++
++
++DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
++
++TAR = tar
++GZIP_ENV = --best
++DEP_FILES = .deps/br2684ctl.P
++SOURCES = $(br2684ctl_SOURCES)
++OBJECTS = $(br2684ctl_OBJECTS)
++
++all: all-redirect
++.SUFFIXES:
++.SUFFIXES: .S .c .lo .o .obj .s
++$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/br2684/Makefile
++
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
++ cd $(top_builddir) \
++ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
++
++
++mostlyclean-sbinPROGRAMS:
++
++clean-sbinPROGRAMS:
++ -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
++
++distclean-sbinPROGRAMS:
++
++maintainer-clean-sbinPROGRAMS:
++
++install-sbinPROGRAMS: $(sbin_PROGRAMS)
++ @$(NORMAL_INSTALL)
++ $(mkinstalldirs) $(DESTDIR)$(sbindir)
++ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
++ if test -f $$p; then \
++ echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
++ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
++ else :; fi; \
++ done
++
++uninstall-sbinPROGRAMS:
++ @$(NORMAL_UNINSTALL)
++ list='$(sbin_PROGRAMS)'; for p in $$list; do \
++ rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
++ done
++
++# FIXME: We should only use cygpath when building on Windows,
++# and only if it is available.
++.c.obj:
++ $(COMPILE) -c `cygpath -w $<`
++
++.s.o:
++ $(COMPILE) -c $<
++
++.S.o:
++ $(COMPILE) -c $<
++
++mostlyclean-compile:
++ -rm -f *.o core *.core
++ -rm -f *.$(OBJEXT)
++
++clean-compile:
++
++distclean-compile:
++ -rm -f *.tab.c
++
++maintainer-clean-compile:
++
++.s.lo:
++ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
++
++.S.lo:
++ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
++
++mostlyclean-libtool:
++ -rm -f *.lo
++
++clean-libtool:
++ -rm -rf .libs _libs
++
++distclean-libtool:
++
++maintainer-clean-libtool:
++
++br2684ctl$(EXEEXT): $(br2684ctl_OBJECTS) $(br2684ctl_DEPENDENCIES)
++ @rm -f br2684ctl$(EXEEXT)
++ $(LINK) $(br2684ctl_LDFLAGS) $(br2684ctl_OBJECTS) $(br2684ctl_LDADD) $(LIBS)
++
++install-man8:
++ $(mkinstalldirs) $(DESTDIR)$(man8dir)
++ @list='$(man8_MANS)'; \
++ l2='$(man_MANS)'; for i in $$l2; do \
++ case "$$i" in \
++ *.8*) list="$$list $$i" ;; \
++ esac; \
++ done; \
++ for i in $$list; do \
++ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
++ else file=$$i; fi; \
++ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
++ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
++ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
++ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
++ $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
++ done
++
++uninstall-man8:
++ @list='$(man8_MANS)'; \
++ l2='$(man_MANS)'; for i in $$l2; do \
++ case "$$i" in \
++ *.8*) list="$$list $$i" ;; \
++ esac; \
++ done; \
++ for i in $$list; do \
++ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
++ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
++ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
++ echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
++ rm -f $(DESTDIR)$(man8dir)/$$inst; \
++ done
++install-man: $(MANS)
++ @$(NORMAL_INSTALL)
++ $(MAKE) $(AM_MAKEFLAGS) install-man8
++uninstall-man:
++ @$(NORMAL_UNINSTALL)
++ $(MAKE) $(AM_MAKEFLAGS) uninstall-man8
++
++tags: TAGS
++
++ID: $(HEADERS) $(SOURCES) $(LISP)
++ list='$(SOURCES) $(HEADERS)'; \
++ unique=`for i in $$list; do echo $$i; done | \
++ awk ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ here=`pwd` && cd $(srcdir) \
++ && mkid -f$$here/ID $$unique $(LISP)
++
++TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
++ tags=; \
++ here=`pwd`; \
++ list='$(SOURCES) $(HEADERS)'; \
++ unique=`for i in $$list; do echo $$i; done | \
++ awk ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
++ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
++ || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
++
++mostlyclean-tags:
++
++clean-tags:
++
++distclean-tags:
++ -rm -f TAGS ID
++
++maintainer-clean-tags:
++
++distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
++
++subdir = src/br2684
++
++distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/br2684/Makefile
++ @for file in $(DISTFILES); do \
++ d=$(srcdir); \
++ if test -d $$d/$$file; then \
++ cp -pr $$d/$$file $(distdir)/$$file; \
++ else \
++ test -f $(distdir)/$$file \
++ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
++ || cp -p $$d/$$file $(distdir)/$$file || :; \
++ fi; \
++ done
++
++DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
++
++-include $(DEP_FILES)
++
++mostlyclean-depend:
++
++clean-depend:
++
++distclean-depend:
++ -rm -rf .deps
++
++maintainer-clean-depend:
++
++%.o: %.c
++ @echo '$(COMPILE) -c $<'; \
++ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-cp .deps/$(*F).pp .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm .deps/$(*F).pp
++
++%.lo: %.c
++ @echo '$(LTCOMPILE) -c $<'; \
++ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
++ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
++ < .deps/$(*F).pp > .deps/$(*F).P; \
++ tr ' ' '\012' < .deps/$(*F).pp \
++ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
++ >> .deps/$(*F).P; \
++ rm -f .deps/$(*F).pp
++info-am:
++info: info-am
++dvi-am:
++dvi: dvi-am
++check-am: all-am
++check: check-am
++installcheck-am:
++installcheck: installcheck-am
++install-exec-am: install-sbinPROGRAMS
++install-exec: install-exec-am
++
++install-data-am: install-man
++install-data: install-data-am
++
++install-am: all-am
++ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
++install: install-am
++uninstall-am: uninstall-sbinPROGRAMS uninstall-man
++uninstall: uninstall-am
++all-am: Makefile $(PROGRAMS) $(MANS)
++all-redirect: all-am
++install-strip:
++ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
++installdirs:
++ $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8
++
++
++mostlyclean-generic:
++
++clean-generic:
++
++distclean-generic:
++ -rm -f Makefile $(CONFIG_CLEAN_FILES)
++ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
++
++maintainer-clean-generic:
++mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \
++ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
++ mostlyclean-generic
++
++mostlyclean: mostlyclean-am
++
++clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \
++ clean-depend clean-generic mostlyclean-am
++
++clean: clean-am
++
++distclean-am: distclean-sbinPROGRAMS distclean-compile \
++ distclean-libtool distclean-tags distclean-depend \
++ distclean-generic clean-am
++ -rm -f libtool
++
++distclean: distclean-am
++
++maintainer-clean-am: maintainer-clean-sbinPROGRAMS \
++ maintainer-clean-compile maintainer-clean-libtool \
++ maintainer-clean-tags maintainer-clean-depend \
++ maintainer-clean-generic distclean-am
++ @echo "This command is intended for maintainers to use;"
++ @echo "it deletes files that may require special tools to rebuild."
++
++maintainer-clean: maintainer-clean-am
++
++.PHONY: mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \
++clean-sbinPROGRAMS maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \
++install-sbinPROGRAMS mostlyclean-compile distclean-compile \
++clean-compile maintainer-clean-compile mostlyclean-libtool \
++distclean-libtool clean-libtool maintainer-clean-libtool install-man8 \
++uninstall-man8 install-man uninstall-man tags mostlyclean-tags \
++distclean-tags clean-tags maintainer-clean-tags distdir \
++mostlyclean-depend distclean-depend clean-depend \
++maintainer-clean-depend info-am info dvi-am dvi check check-am \
++installcheck-am installcheck install-exec-am install-exec \
++install-data-am install-data install-am install uninstall-am uninstall \
++all-redirect all-am all installdirs mostlyclean-generic \
++distclean-generic clean-generic maintainer-clean-generic clean \
++mostlyclean distclean maintainer-clean
++
++
++# 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:
+--- linux-atm-2.4.1.orig/src/br2684/br2684ctl.8
++++ linux-atm-2.4.1/src/br2684/br2684ctl.8
+@@ -0,0 +1,74 @@
++.\"
++.TH br2684ctl 1 "7 Jul 2003"
++.SH NAME
++br2684ctl \- RFC1483/2684 Bridge Daemon
++.SH SYNOPSIS
++.B br2684ctl
++[
++.BI \-b
++] [[
++.BI \-c\ n
++] [
++.BI \-e\ 0|1
++] [
++.BI \-s\ sndbuf
++] [
++.BI \-a\ [itf].vpi.vci
++]] ...
++.SH PARAMETERS
++.TP 15
++.BI \-a\ [itf].vpi.vci
++ATM PVC number, VPI and VCI. (Required)
++.BI \-b
++Puts the process in the background.
++.TP 15
++.BI \-c\ n
++br2684 interface number such as 0, 1, ... (Required)
++.TP 15
++.BI \-e\ 0|1
++Encapsulation method: 0=LLC, 1=VC mux (the default is 0 or LLC)
++.TP 15
++.TP 15
++.BI \-s\ sndbuf
++Send buffer size. Default is 8192.
++.SH DESCRIPTION
++br2684ctl handles RFC1483/2684 bridged PDUs.
++This is most often used in ADSL scenarios where
++.I usually
++the subscribers'
++ethernet traffic is encapsulated in ATM AAL5 (by bridging ADSL modems)
++according to RFC2684.
++The subscriber-side ADSL modem can be external with an ethernet connector
++or an internal ADSL card in a PC.
++RFC1483 has been obsoleted by RFC2684.
++
++For example it is possible to set up your Linux box to handle several
++ATM PVC's with bridged-1483 (sometimes referred as SNAP) encapsulation.
++The Linux network stack might provide DHCP, IP masquerading, IP firewall services or
++bridge the Ethernet frames just like it had several ethernet interfaces.
++In fact it can have several (logical) ethernet interfaces, where
++ATM is just used as a carrier.
++.SH USAGE
++br2684ctl creates a new network interface named nas[n]
++which is bound to an specific ATM PVC. It requires two mandatory
++arguments: -c, the interface number, and -a, the ATM PVC. It should be
++noted that the order of the command arguments matter; -c should be
++followed by -a. You can create as many interfaces as necessary
++in one go, just make a long command line ;)
++
++For example, following command will create a nas0 interface which uses
++the ATM PVC with VPI=0 and VCI=401. You need to configure the PVC connection
++0.401 on the ATM switch manually.
++
++% br2684ctl -c 0 -a 0.401
++
++The command will only create a new interface nas0.
++Next step is to assign an IP address and netmask to
++the interface nas0 using the ifconfig command. Using ifconfig, you can
++also assign a Ethernet MAC address to the interface nas0, if necessary.
++
++% ifconfig nas0 192.168.2.1 netmask 255.255.255.0
++.SH NOTES
++This man page is based on a tutorial by by Joonbum Byun <jbyun@megaxess.com>
++.SH SEE ALSO
++.BR qos (7)
+--- linux-atm-2.4.1.orig/doc/Makefile.in
++++ linux-atm-2.4.1/doc/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
++# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+
+ # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+@@ -96,14 +96,14 @@
+
+ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+-TAR = gtar
++TAR = tar
+ GZIP_ENV = --best
+ all: all-redirect
+ .SUFFIXES:
+ $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
++ cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile
+
+-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+@@ -116,6 +116,11 @@
+ subdir = doc
+
+ distdir: $(DISTFILES)
++ here=`cd $(top_builddir) && pwd`; \
++ top_distdir=`cd $(top_distdir) && pwd`; \
++ distdir=`cd $(distdir) && pwd`; \
++ cd $(top_srcdir) \
++ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu doc/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+--- linux-atm-2.4.1.orig/debian/patches/00list
++++ linux-atm-2.4.1/debian/patches/00list
+@@ -0,0 +1 @@
++10_atmbr2684.h
+--- linux-atm-2.4.1.orig/debian/patches/10_atmbr2684.h.dpatch
++++ linux-atm-2.4.1/debian/patches/10_atmbr2684.h.dpatch
+@@ -0,0 +1,598 @@
++#! /bin/sh -e
++## 01_kernel-header.dpatch by <bengen+debian@hilluzination.de>
++##
++## All lines beginning with ## DP:' are a description of the patch.
++## DP: add header file atmbr2684.h
++
++if [ -e /usr/include/linux/atmbr2684.h ]; then exit 0; fi
++
++if [ $# -ne 1 ]; then
++ echo "basename $0: script expects -patch|-unpatch as argument" >&2
++ exit 1
++fi
++case "$1" in
++ -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
++ -unpatch) patch -f --no-backup-if-mismatch -E -R -p1 < $0;;
++ *)
++ echo "basename $0: script expects -patch|-unpatch as argument" >&2
++ exit 1;;
++esac
++
++exit 0
++@DPATCH@
++
++--- linux-atm.orig/src/include/linux/atmbr2684.h
+++++ linux-atm/src/include/linux/atmbr2684.h
++@@ -0,0 +1,101 @@
+++#ifndef _LINUX_ATMBR2684_H
+++#define _LINUX_ATMBR2684_H
+++
+++#include <linux/atm.h>
+++#include <linux/if.h> /* For IFNAMSIZ */
+++
+++/*
+++ * Type of media we're bridging (ethernet, token ring, etc) Currently only
+++ * ethernet is supported
+++ */
+++#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
+++#define BR2684_MEDIA_802_4 (1) /* 802.4 */
+++#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
+++#define BR2684_MEDIA_FDDI (3)
+++#define BR2684_MEDIA_802_6 (4) /* 802.6 */
+++
+++/*
+++ * Is there FCS inbound on this VC? This currently isn't supported.
+++ */
+++#define BR2684_FCSIN_NO (0)
+++#define BR2684_FCSIN_IGNORE (1)
+++#define BR2684_FCSIN_VERIFY (2)
+++
+++/*
+++ * Is there FCS outbound on this VC? This currently isn't supported.
+++ */
+++#define BR2684_FCSOUT_NO (0)
+++#define BR2684_FCSOUT_SENDZERO (1)
+++#define BR2684_FCSOUT_GENERATE (2)
+++
+++/*
+++ * Does this VC include LLC encapsulation?
+++ */
+++#define BR2684_ENCAPS_VC (0) /* VC-mux */
+++#define BR2684_ENCAPS_LLC (1)
+++#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
+++
+++/*
+++ * This is for the ATM_NEWBACKENDIF call - these are like socket families:
+++ * the first element of the structure is the backend number and the rest
+++ * is per-backend specific
+++ */
+++struct atm_newif_br2684 {
+++ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+++ int media; /* BR2684_MEDIA_* */
+++ char ifname[IFNAMSIZ];
+++ int mtu;
+++};
+++
+++/*
+++ * This structure is used to specify a br2684 interface - either by a
+++ * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
+++ */
+++#define BR2684_FIND_BYNOTHING (0)
+++#define BR2684_FIND_BYNUM (1)
+++#define BR2684_FIND_BYIFNAME (2)
+++struct br2684_if_spec {
+++ int method; /* BR2684_FIND_* */
+++ union {
+++ char ifname[IFNAMSIZ];
+++ int devnum;
+++ } spec;
+++};
+++
+++/*
+++ * This is for the ATM_SETBACKEND call - these are like socket families:
+++ * the first element of the structure is the backend number and the rest
+++ * is per-backend specific
+++ */
+++struct atm_backend_br2684 {
+++ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+++ struct br2684_if_spec ifspec;
+++ int fcs_in; /* BR2684_FCSIN_* */
+++ int fcs_out; /* BR2684_FCSOUT_* */
+++ int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
+++ int encaps; /* BR2684_ENCAPS_* */
+++ int has_vpiid; /* 1: use vpn_id - Unsupported */
+++ __u8 vpn_id[7];
+++ int send_padding; /* unsupported */
+++ int min_size; /* we will pad smaller packets than this */
+++};
+++
+++/*
+++ * The BR2684_SETFILT ioctl is an experimental mechanism for folks
+++ * terminating a large number of IP-only vcc's. When netfilter allows
+++ * efficient per-if in/out filters, this support will be removed
+++ */
+++struct br2684_filter {
+++ __u32 prefix; /* network byte order */
+++ __u32 netmask; /* 0 = disable filter */
+++};
+++
+++struct br2684_filter_set {
+++ struct br2684_if_spec ifspec;
+++ struct br2684_filter filter;
+++};
+++
+++#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
+++ struct br2684_filter_set)
+++
+++#endif /* _LINUX_ATMBR2684_H */
++--- linux-atm.orig/src/include/linux/atmdev.h
+++++ linux-atm/src/include/linux/atmdev.h
++@@ -0,0 +1,468 @@
+++/* atmdev.h - ATM device driver declarations and various related items */
+++
+++/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
+++
+++
+++#ifndef LINUX_ATMDEV_H
+++#define LINUX_ATMDEV_H
+++
+++
+++#include <linux/config.h>
+++#include <linux/atmapi.h>
+++#include <linux/atm.h>
+++#include <linux/atmioc.h>
+++
+++
+++#define ESI_LEN 6
+++
+++#define ATM_OC3_PCR (155520000/270*260/8/53)
+++ /* OC3 link rate: 155520000 bps
+++ SONET overhead: /270*260 (9 section, 1 path)
+++ bits per cell: /8/53
+++ max cell rate: 353207.547 cells/sec */
+++#define ATM_25_PCR ((25600000/8-8000)/54)
+++ /* 25 Mbps ATM cell rate (59111) */
+++#define ATM_OC12_PCR (622080000/1080*1040/8/53)
+++ /* OC12 link rate: 622080000 bps
+++ SONET overhead: /1080*1040
+++ bits per cell: /8/53
+++ max cell rate: 1412830.188 cells/sec */
+++#define ATM_DS3_PCR (8000*12)
+++ /* DS3: 12 cells in a 125 usec time slot */
+++
+++#define ATM_SD(s) ((s)->sk->protinfo.af_atm)
+++
+++
+++#define __AAL_STAT_ITEMS \
+++ __HANDLE_ITEM(tx); /* TX okay */ \
+++ __HANDLE_ITEM(tx_err); /* TX errors */ \
+++ __HANDLE_ITEM(rx); /* RX okay */ \
+++ __HANDLE_ITEM(rx_err); /* RX errors */ \
+++ __HANDLE_ITEM(rx_drop); /* RX out of memory */
+++
+++struct atm_aal_stats {
+++#define __HANDLE_ITEM(i) int i
+++ __AAL_STAT_ITEMS
+++#undef __HANDLE_ITEM
+++};
+++
+++
+++struct atm_dev_stats {
+++ struct atm_aal_stats aal0;
+++ struct atm_aal_stats aal34;
+++ struct atm_aal_stats aal5;
+++} __ATM_API_ALIGN;
+++
+++
+++#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
+++ /* get link rate */
+++#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
+++ /* get interface names (numbers) */
+++#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
+++ /* get interface type name */
+++#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
+++ /* get interface ESI */
+++#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
+++ /* get itf's local ATM addr. list */
+++#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
+++ /* reset itf's ATM address list */
+++#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
+++ /* add a local ATM address */
+++#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
+++ /* remove a local ATM address */
+++#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
+++ /* get connection identifier range */
+++#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
+++ /* set connection identifier range */
+++#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
+++ /* set interface ESI */
+++#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
+++ /* force interface ESI */
+++#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
+++ /* get AAL layer statistics */
+++#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
+++ /* get AAL layer statistics and zero */
+++#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
+++ /* get loopback mode */
+++#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
+++ /* set loopback mode */
+++#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
+++ /* query supported loopback modes */
+++#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
+++ /* enable or disable single-copy */
+++#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
+++ /* set backend handler */
+++#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
+++ /* use backend to make new if */
+++
+++/*
+++ * These are backend handkers that can be set via the ATM_SETBACKEND call
+++ * above. In the future we may support dynamic loading of these - for now,
+++ * they're just being used to share the ATMIOC_BACKEND ioctls
+++ */
+++#define ATM_BACKEND_RAW 0
+++#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
+++#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */
+++
+++/* for ATM_GETTYPE */
+++#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
+++
+++/*
+++ * Loopback modes for ATM_{PHY,SAR}_{GET,SET}LOOP
+++ */
+++
+++/* Point of loopback CPU-->SAR-->PHY-->line--> ... */
+++#define __ATM_LM_NONE 0 /* no loop back ^ ^ ^ ^ */
+++#define __ATM_LM_AAL 1 /* loop back PDUs --' | | | */
+++#define __ATM_LM_ATM 2 /* loop back ATM cells ---' | | */
+++/* RESERVED 4 loop back on PHY side ---' */
+++#define __ATM_LM_PHY 8 /* loop back bits (digital) ----' | */
+++#define __ATM_LM_ANALOG 16 /* loop back the analog signal --------' */
+++
+++/* Direction of loopback */
+++#define __ATM_LM_MKLOC(n) ((n)) /* Local (i.e. loop TX to RX) */
+++#define __ATM_LM_MKRMT(n) ((n) << 8) /* Remote (i.e. loop RX to TX) */
+++
+++#define __ATM_LM_XTLOC(n) ((n) & 0xff)
+++#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
+++
+++#define ATM_LM_NONE 0 /* no loopback */
+++
+++#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
+++#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
+++#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
+++#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
+++
+++#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
+++#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
+++#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
+++#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
+++
+++/*
+++ * Note: ATM_LM_LOC_* and ATM_LM_RMT_* can be combined, provided that
+++ * __ATM_LM_XTLOC(x) <= __ATM_LM_XTRMT(x)
+++ */
+++
+++
+++struct atm_iobuf {
+++ int length;
+++ void *buffer;
+++};
+++
+++/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
+++
+++#define ATM_CI_MAX -1 /* use maximum range of VPI/VCI */
+++
+++struct atm_cirange {
+++ char vpi_bits; /* 1..8, ATM_CI_MAX (-1) for maximum */
+++ char vci_bits; /* 1..16, ATM_CI_MAX (-1) for maximum */
+++};
+++
+++/* for ATM_SETSC; actually taken from the ATM_VF number space */
+++
+++#define ATM_SC_RX 1024 /* enable RX single-copy */
+++#define ATM_SC_TX 2048 /* enable TX single-copy */
+++
+++#define ATM_BACKLOG_DEFAULT 32 /* if we get more, we're likely to time out
+++ anyway */
+++
+++/* MF: change_qos (Modify) flags */
+++
+++#define ATM_MF_IMMED 1 /* Block until change is effective */
+++#define ATM_MF_INC_RSV 2 /* Change reservation on increase */
+++#define ATM_MF_INC_SHP 4 /* Change shaping on increase */
+++#define ATM_MF_DEC_RSV 8 /* Change reservation on decrease */
+++#define ATM_MF_DEC_SHP 16 /* Change shaping on decrease */
+++#define ATM_MF_BWD 32 /* Set the backward direction parameters */
+++
+++#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV | \
+++ ATM_MF_DEC_SHP | ATM_MF_BWD)
+++
+++/*
+++ * ATM_VS_* are used to express VC state in a human-friendly way.
+++ */
+++
+++#define ATM_VS_IDLE 0 /* VC is not used */
+++#define ATM_VS_CONNECTED 1 /* VC is connected */
+++#define ATM_VS_CLOSING 2 /* VC is closing */
+++#define ATM_VS_LISTEN 3 /* VC is listening for incoming setups */
+++#define ATM_VS_INUSE 4 /* VC is in use (registered with atmsigd) */
+++#define ATM_VS_BOUND 5 /* VC is bound */
+++
+++#define ATM_VS2TXT_MAP \
+++ "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
+++
+++#define ATM_VF2TXT_MAP \
+++ "ADDR", "READY", "PARTIAL", "REGIS", \
+++ "RELEASED", "HASQOS", "LISTEN", "META", \
+++ "256", "512", "1024", "2048", \
+++ "SESSION", "HASSAP", "BOUND", "CLOSE"
+++
+++
+++#ifndef __KERNEL__
+++#undef __AAL_STAT_ITEMS
+++#else
+++
+++#include <linux/sched.h> /* wait_queue_head_t */
+++#include <linux/time.h> /* struct timeval */
+++#include <linux/net.h>
+++#include <linux/skbuff.h> /* struct sk_buff */
+++#include <linux/uio.h>
+++#include <net/sock.h>
+++#include <asm/atomic.h>
+++
+++#ifdef CONFIG_PROC_FS
+++#include <linux/proc_fs.h>
+++#endif
+++
+++
+++struct k_atm_aal_stats {
+++#define __HANDLE_ITEM(i) atomic_t i
+++ __AAL_STAT_ITEMS
+++#undef __HANDLE_ITEM
+++};
+++
+++
+++struct k_atm_dev_stats {
+++ struct k_atm_aal_stats aal0;
+++ struct k_atm_aal_stats aal34;
+++ struct k_atm_aal_stats aal5;
+++};
+++
+++
+++enum {
+++ ATM_VF_ADDR, /* Address is in use. Set by anybody, cleared
+++ by device driver. */
+++ ATM_VF_READY, /* VC is ready to transfer data. Set by device
+++ driver, cleared by anybody. */
+++ ATM_VF_PARTIAL, /* resources are bound to PVC (partial PVC
+++ setup), controlled by socket layer */
+++ ATM_VF_REGIS, /* registered with demon, controlled by SVC
+++ socket layer */
+++ ATM_VF_BOUND, /* local SAP is set, controlled by SVC socket
+++ layer */
+++ ATM_VF_RELEASED, /* demon has indicated/requested release,
+++ controlled by SVC socket layer */
+++ ATM_VF_HASQOS, /* QOS parameters have been set */
+++ ATM_VF_LISTEN, /* socket is used for listening */
+++ ATM_VF_META, /* SVC socket isn't used for normal data
+++ traffic and doesn't depend on signaling
+++ to be available */
+++ ATM_VF_SESSION, /* VCC is p2mp session control descriptor */
+++ ATM_VF_HASSAP, /* SAP has been set */
+++ ATM_VF_CLOSE, /* asynchronous close - treat like VF_RELEASED*/
+++};
+++
+++
+++#define ATM_VF2VS(flags) \
+++ (test_bit(ATM_VF_READY,&(flags)) ? ATM_VS_CONNECTED : \
+++ test_bit(ATM_VF_RELEASED,&(flags)) ? ATM_VS_CLOSING : \
+++ test_bit(ATM_VF_LISTEN,&(flags)) ? ATM_VS_LISTEN : \
+++ test_bit(ATM_VF_REGIS,&(flags)) ? ATM_VS_INUSE : \
+++ test_bit(ATM_VF_BOUND,&(flags)) ? ATM_VS_BOUND : ATM_VS_IDLE)
+++
+++
+++enum {
+++ ATM_DF_CLOSE, /* close device when last VCC is closed */
+++};
+++
+++
+++#define ATM_PHY_SIG_LOST 0 /* no carrier/light */
+++#define ATM_PHY_SIG_UNKNOWN 1 /* carrier/light status is unknown */
+++#define ATM_PHY_SIG_FOUND 2 /* carrier/light okay */
+++
+++#define ATM_ATMOPT_CLP 1 /* set CLP bit */
+++
+++
+++typedef struct { unsigned long bits; } atm_vcc_flags_t;
+++
+++
+++struct atm_vcc {
+++ atm_vcc_flags_t flags; /* VCC flags (ATM_VF_*) */
+++ short vpi; /* VPI and VCI (types must be equal */
+++ /* with sockaddr) */
+++ int vci;
+++ unsigned long aal_options; /* AAL layer options */
+++ unsigned long atm_options; /* ATM layer options */
+++ struct atm_dev *dev; /* device back pointer */
+++ struct atm_qos qos; /* QOS */
+++ struct atm_sap sap; /* SAP */
+++ void (*push)(struct atm_vcc *vcc,struct sk_buff *skb);
+++ void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */
+++ int (*push_oam)(struct atm_vcc *vcc,void *cell);
+++ int (*send)(struct atm_vcc *vcc,struct sk_buff *skb);
+++ void *dev_data; /* per-device data */
+++ void *proto_data; /* per-protocol data */
+++ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */
+++ wait_queue_head_t sleep; /* if socket is busy */
+++ struct sock *sk; /* socket backpointer */
+++ struct atm_vcc *prev,*next;
+++ /* SVC part --- may move later ------------------------------------- */
+++ short itf; /* interface number */
+++ struct sockaddr_atmsvc local;
+++ struct sockaddr_atmsvc remote;
+++ void (*callback)(struct atm_vcc *vcc);
+++ struct sk_buff_head listenq;
+++ int backlog_quota; /* number of connection requests we */
+++ /* can still accept */
+++ int reply; /* also used by ATMTCP */
+++ /* Multipoint part ------------------------------------------------- */
+++ struct atm_vcc *session; /* session VCC descriptor */
+++ /* Other stuff ----------------------------------------------------- */
+++ void *user_back; /* user backlink - not touched by */
+++ /* native ATM stack. Currently used */
+++ /* by CLIP and sch_atm. */
+++};
+++
+++
+++struct atm_dev_addr {
+++ struct sockaddr_atmsvc addr; /* ATM address */
+++ struct atm_dev_addr *next; /* next address */
+++};
+++
+++
+++typedef struct { unsigned int bits; } atm_dev_flags_t;
+++
+++
+++struct atm_dev {
+++ const struct atmdev_ops *ops; /* device operations; NULL if unused */
+++ const struct atmphy_ops *phy; /* PHY operations, may be undefined */
+++ /* (NULL) */
+++ const char *type; /* device type name */
+++ int number; /* device index */
+++ struct atm_vcc *vccs; /* VCC table (or NULL) */
+++ struct atm_vcc *last; /* last VCC (or undefined) */
+++ void *dev_data; /* per-device data */
+++ void *phy_data; /* private PHY date */
+++ atm_dev_flags_t flags; /* device flags (ATM_DF_*) */
+++ struct atm_dev_addr *local; /* local ATM addresses */
+++ unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */
+++ struct atm_cirange ci_range; /* VPI/VCI range */
+++ struct k_atm_dev_stats stats; /* statistics */
+++ char signal; /* signal status (ATM_PHY_SIG_*) */
+++ int link_rate; /* link rate (default: OC3) */
+++ atomic_t refcnt; /* reference count */
+++ spinlock_t lock; /* protect internal members */
+++#ifdef CONFIG_PROC_FS
+++ struct proc_dir_entry *proc_entry; /* proc entry */
+++ char *proc_name; /* proc entry name */
+++#endif
+++ struct list_head dev_list; /* linkage */
+++};
+++
+++
+++/*
+++ * ioctl, getsockopt, setsockopt, and sg_send are optional and can be set to
+++ * NULL. */
+++
+++/* OF: send_Oam Flags */
+++
+++#define ATM_OF_IMMED 1 /* Attempt immediate delivery */
+++#define ATM_OF_INRATE 2 /* Attempt in-rate delivery */
+++
+++struct atmdev_ops { /* only send is required */
+++ void (*dev_close)(struct atm_dev *dev);
+++ int (*open)(struct atm_vcc *vcc,short vpi,int vci);
+++ void (*close)(struct atm_vcc *vcc);
+++ int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg);
+++ int (*getsockopt)(struct atm_vcc *vcc,int level,int optname,
+++ void *optval,int optlen);
+++ int (*setsockopt)(struct atm_vcc *vcc,int level,int optname,
+++ void *optval,int optlen);
+++ int (*send)(struct atm_vcc *vcc,struct sk_buff *skb);
+++ int (*sg_send)(struct atm_vcc *vcc,unsigned long start,
+++ unsigned long size);
+++#if 0 /* keep the current hack for now */
+++ int (*send_iovec)(struct atm_vcc *vcc,struct iovec *iov,int size,
+++ void (*discard)(struct atm_vcc *vcc,void *user),void *user);
+++#endif
+++ int (*send_oam)(struct atm_vcc *vcc,void *cell,int flags);
+++ void (*phy_put)(struct atm_dev *dev,unsigned char value,
+++ unsigned long addr);
+++ unsigned char (*phy_get)(struct atm_dev *dev,unsigned long addr);
+++ void (*feedback)(struct atm_vcc *vcc,struct sk_buff *skb,
+++ unsigned long start,unsigned long dest,int len);
+++ int (*change_qos)(struct atm_vcc *vcc,struct atm_qos *qos,int flags);
+++ int (*proc_read)(struct atm_dev *dev,loff_t *pos,char *page);
+++ struct module *owner;
+++};
+++
+++
+++struct atmphy_ops {
+++ int (*start)(struct atm_dev *dev);
+++ int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void *arg);
+++ void (*interrupt)(struct atm_dev *dev);
+++ int (*stop)(struct atm_dev *dev);
+++};
+++
+++struct atm_skb_data {
+++ struct atm_vcc *vcc; /* ATM VCC */
+++ unsigned long atm_options; /* ATM layer options */
+++};
+++
+++#define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb))
+++
+++struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
+++ int number,atm_dev_flags_t *flags); /* number == -1: pick first available */
+++struct atm_dev *atm_dev_lookup(int number);
+++void atm_dev_deregister(struct atm_dev *dev);
+++void shutdown_atm_dev(struct atm_dev *dev);
+++void bind_vcc(struct atm_vcc *vcc,struct atm_dev *dev);
+++
+++
+++/*
+++ * This is approximately the algorithm used by alloc_skb.
+++ *
+++ */
+++
+++static inline int atm_guess_pdu2truesize(int pdu_size)
+++{
+++ return ((pdu_size+15) & ~15) + sizeof(struct sk_buff);
+++}
+++
+++
+++static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
+++{
+++ atomic_add(truesize, &vcc->sk->rmem_alloc);
+++}
+++
+++
+++static inline void atm_return(struct atm_vcc *vcc,int truesize)
+++{
+++ atomic_sub(truesize, &vcc->sk->rmem_alloc);
+++}
+++
+++
+++static inline int atm_may_send(struct atm_vcc *vcc,unsigned int size)
+++{
+++ return (size + atomic_read(&vcc->sk->wmem_alloc)) < vcc->sk->sndbuf;
+++}
+++
+++
+++static inline void atm_dev_hold(struct atm_dev *dev)
+++{
+++ atomic_inc(&dev->refcnt);
+++}
+++
+++
+++static inline void atm_dev_release(struct atm_dev *dev)
+++{
+++ atomic_dec(&dev->refcnt);
+++
+++ if ((atomic_read(&dev->refcnt) == 1) &&
+++ test_bit(ATM_DF_CLOSE,&dev->flags))
+++ shutdown_atm_dev(dev);
+++}
+++
+++
+++int atm_charge(struct atm_vcc *vcc,int truesize);
+++struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
+++ int gfp_flags);
+++int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci);
+++int atm_pcr_goal(struct atm_trafprm *tp);
+++
+++void atm_async_release_vcc(struct atm_vcc *vcc,int reply);
+++
+++#endif /* __KERNEL__ */
+++
+++#endif
+--- linux-atm-2.4.1.orig/debian/README.br2684
++++ linux-atm-2.4.1/debian/README.br2684
+@@ -0,0 +1,79 @@
++README.br2684
++~~~~~~~~~~~~~
++
++The linux-atm CVS includes a program called br2684 which can be used
++to configure br2684 ATM bridging. On request (#216663), the Debian
++maintainer included br2684 in the source package.
++
++This was done in a way that separates the - unreleased CVS snapshot -
++br2684 program into its own binary package so avoid shipping
++released and unreleased software in the same binary package.
++
++The modified source package (2.4.1-10) was rejected by Debian
++ftpmaster because he found the package too small to warrant its own
++.deb.
++
++Hence, atm-tools-br2684 is not built any more.
++
++You can, however, build your own atm-tools-br2684 package from the
++official Debian source package by following this "script".
++
++(0)
++Install all build dependencies plus autoconf, libtool, automake. If
++#219936 is still unfixed, copy /usr/bin/autoreconf to a local
++directory and apply the following patch after changing "+@@" to "@@"
++in the first line (this was inserted to be able to feed this readme to
++patch to apply the patch given in (1).
++
++--- /usr/bin/autoreconf
+++++ autoreconf
+++@@ -183,7 +183,7 @@
++ {
++ $autoconf .= ' --force';
++ $autoheader .= ' --force';
++- $automake .= ' --force-missing';
+++ $automake .= '';
++ $autopoint .= ' --force';
++ $libtoolize .= ' --force';
++ }
++
++(1) Apply the following patch
++--- configure.in.orig
+++++ configure.in
++@@ -152,6 +152,7 @@
++ m4/Makefile \
++ src/Makefile \
++ src/include/Makefile \
+++ src/br2684/Makefile \
++ src/lib/Makefile \
++ src/test/Makefile \
++ src/debug/Makefile \
++--- debian/rules.orig
+++++ debian/rules
++@@ -11,7 +11,7 @@
++ export PACKAGE=linux-atm
++
++ buildindeppackages=atm-dev
++-buildarchpackages=atm-tools libatm1 libatm1-dev
+++buildarchpackages=atm-tools atm-tools-br2684 libatm1 libatm1-dev
++
++ # generate -ppackage1 -ppackage2 ... commandline for debhelper
++ dhbuildarchpackages=$(addprefix -p,$(buildarchpackages))
++--- src/Makefile.am.orig
+++++ src/Makefile.am
++@@ -1,3 +1,3 @@
++ SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \
++- mpoad switch config extra
+++ mpoad switch config extra br2684
++
++
++(2)
++Invoke autoreconf -f -i
++
++(3)
++create your own changelog entry and your own local version number
++
++(4)
++Build the package as usual
++
++Marc Haber, 2003-11-05
+--- linux-atm-2.4.1.orig/debian/control
++++ linux-atm-2.4.1/debian/control
+@@ -0,0 +1,57 @@
++Source: linux-atm
++Section: net
++Priority: optional
++Maintainer: Peter De Schrijver (p2) <p2@mind.be>
++Build-Depends: debhelper (>> 4.0.0), bison, flex, perl, dpatch, automake1.4
++Standards-Version: 3.6.1
++
++Package: atm-tools
++Architecture: any
++Depends: ${shlibs:Depends}
++Description: Base programs for ATM in Linux, the net-tools for ATM
++ This package provides all the basic programs needed for setting up,
++ monitoring and tuning ATM networks. Such as:
++ * atmsigd, an ATM signal daemon that implements the ATM UNI protocol.
++ * atmtcp, a tool to setup ATM over TCP connections.
++ * atmarpd, an implementation of the ATMARP protocol (RFC1577, RFC1755)
++ * zeppelin, an ATM LAN Emulation client daemon
++ * les and bus, ATM LAN Emulation service daemons
++ .
++ Notice that upstream still flags these tools as experimental software and
++ says that there is still a number of known bugs and issues. The
++ software is, however, in productive use at a number of sites and is
++ working reliably.
++ .
++ Homepage: http://linux-atm.sourceforge.net/
++
++Package: atm-dev
++Depends: libatm1-dev
++Architecture: all
++Section: oldlibs
++Description: Development files for compiling ATM programs (dummy package)
++ This dummy package provides a transition from the previous atm packages.
++ It is provided for backwards compatibility only and may be removedafter
++ the upgrade has completed or when when no other package depend on it.
++
++Package: libatm1
++Section: libs
++Architecture: any
++Depends: ${shlibs:Depends}
++Conflicts: atm-tools (<< 2.4.1-6)
++Description: shared library for ATM (Asynchronous Transfer Mode)
++ Shared libraries needed by ATM (Asynchronous Transfer Mode) related programs
++ .
++ Homepage: http://linux-atm.sourceforge.net/
++
++Package: libatm1-dev
++Section: libdevel
++Architecture: any
++Depends: libc6-dev, libatm1
++Replaces: atm-dev (<< 2.4.1-7)
++Conflicts: atm-dev (<< 2.4.1-7)
++Provides: libatm-dev
++Description: Development files for compiling ATM programs
++ Header files and development libraries for compiling ATM (Asynchronous
++ Transfer Mode) related programs.
++ .
++ Homepage: http://linux-atm.sourceforge.net/
+--- linux-atm-2.4.1.orig/debian/atm-tools-br2684.dirs
++++ linux-atm-2.4.1/debian/atm-tools-br2684.dirs
+@@ -0,0 +1,2 @@
++usr/sbin
++usr/share/man/man8
+--- linux-atm-2.4.1.orig/debian/rules
++++ linux-atm-2.4.1/debian/rules
+@@ -0,0 +1,136 @@
++#!/usr/bin/make -f
++# Sample debian/rules that uses debhelper.
++# GNU copyright 1997 to 1999 by Joey Hess.
++
++# Uncomment this to turn on verbose mode.
++#export DH_VERBOSE=1
++
++# This is the debhelper compatability version to use.
++export DH_COMPAT=4
++
++export PACKAGE=linux-atm
++
++buildindeppackages=atm-dev
++buildarchpackages=atm-tools libatm1 libatm1-dev
++
++# generate -ppackage1 -ppackage2 ... commandline for debhelper
++dhbuildarchpackages=$(addprefix -p,$(buildarchpackages))
++dhbuildindeppackages=$(addprefix -p,$(buildindeppackages))
++
++include /usr/share/dpatch/dpatch.make
++
++configure: configure-stamp
++configure-stamp:
++ dh_testdir
++ ./configure --prefix /usr --mandir /usr/share/man --sysconfdir /etc
++ touch configure-stamp
++
++build: configure-stamp build-stamp
++build-stamp: patch-stamp
++ dh_testdir
++
++ # Add here commands to compile the package.
++ $(MAKE) $(EXTRA_VARS)
++ cat debian/copyright.header COPYING > debian/copyright
++
++ touch build-stamp
++
++clean: clean1 unpatch
++clean1:
++ dh_testdir
++ dh_testroot
++ rm -f build-stamp configure-stamp
++
++ # Add here commands to clean up after the build process.
++ -$(MAKE) distclean
++
++ dh_clean
++ rm -rf debian/atm-tools.8 debian/copyright
++
++install: build
++ dh_testdir
++ dh_testroot
++ dh_clean -k
++ dh_installdirs
++
++ # Add here commands to install the package into debian/atm-tools
++ $(MAKE) DESTDIR=`pwd`/debian/tmp install
++
++ # manpages
++ /usr/bin/pod2man --section=8 --release="atm-tools $(PKG_VER)" --lax \
++ --center="Debian GNU/Linux" debian/atm-tools.pod > debian/atm-tools.8
++
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/aread.8
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/awrite.8
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/enitune.8
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/ilmid.8
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/saaldump.8
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/sonetdiag.8
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/ttcp_atm.8
++ ln -s atm-tools.8 debian/tmp/usr/share/man/man8/zntune.8
++
++# Build architecture-independent files here.
++binary-indep: build install
++ dh_testdir $(dhbuildindeppackages)
++ dh_testroot $(dhbuildindeppackages)
++ dh_install $(dhbuildindeppackages)
++
++# dh_installdebconf $(dhbuildindeppackages)
++ dh_installdocs $(dhbuildindeppackages)
++ dh_installmenu $(dhbuildindeppackages)
++# dh_installlogrotate $(dhbuildindeppackages)
++# dh_installemacsen $(dhbuildindeppackages)
++# dh_installpam $(dhbuildindeppackages)
++# dh_installmime $(dhbuildindeppackages)
++ dh_installinit $(dhbuildindeppackages) --init-script=atm -- start 34 0 6 . start 39 S .
++ dh_installcron $(dhbuildindeppackages)
++ dh_installman $(dhbuildindeppackages)
++ dh_installinfo $(dhbuildindeppackages)
++# dh_undocumented $(dhbuildindeppackages)
++ dh_installchangelogs -i ChangeLog $(dhbuildpackages)
++ dh_link $(dhbuildindeppackages)
++ dh_strip $(dhbuildindeppackages)
++ dh_compress $(dhbuildindeppackages)
++ dh_fixperms $(dhbuildindeppackages)
++ dh_makeshlibs $(dhbuildindeppackages)
++ dh_installdeb $(dhbuildindeppackages)
++# dh_perl $(dhbuildindeppackages)
++ dh_shlibdeps $(dhbuildindeppackages)
++ dh_gencontrol $(dhbuildindeppackages)
++ dh_md5sums $(dhbuildindeppackages)
++ dh_builddeb $(dhbuildindeppackages)
++
++# Build architecture-dependent files here.
++binary-arch: build install
++ dh_testdir $(dhbuildarchpackages)
++ dh_testroot $(dhbuildarchpackages)
++ dh_install $(dhbuildarchpackages)
++
++# dh_installdebconf $(dhbuildarchpackages)
++ dh_installdocs $(dhbuildarchpackages)
++ dh_installmenu $(dhbuildarchpackages)
++# dh_installlogrotate $(dhbuildarchpackages)
++# dh_installemacsen $(dhbuildarchpackages)
++# dh_installpam $(dhbuildarchpackages)
++# dh_installmime $(dhbuildarchpackages)
++ dh_installinit $(dhbuildarchpackages) --init-script=atm -- start 34 0 6 . start 39 S .
++ dh_installcron $(dhbuildarchpackages)
++ dh_installman $(dhbuildarchpackages)
++ dh_installinfo $(dhbuildarchpackages)
++# dh_undocumented $(dhbuildarchpackages)
++ dh_installchangelogs -a ChangeLog $(dhbuildarchpackages)
++ dh_link $(dhbuildarchpackages)
++ dh_strip $(dhbuildarchpackages)
++ dh_compress $(dhbuildarchpackages)
++ dh_fixperms $(dhbuildarchpackages)
++ dh_makeshlibs $(dhbuildarchpackages)
++ dh_installdeb $(dhbuildarchpackages)
++# dh_perl $(dhbuildarchpackages)
++ dh_shlibdeps -a -L libatm1 -l debian/libatm1/lib $(dhbuildarchpackages)
++ dh_gencontrol $(dhbuildarchpackages)
++ dh_md5sums $(dhbuildarchpackages)
++ dh_builddeb $(dhbuildarchpackages)
++
++binary: binary-indep binary-arch
++.PHONY: build binary-indep binary-arch binary install configure
++ get-2684 patch unpatch clean1
+--- linux-atm-2.4.1.orig/debian/atm-tools-br2684.install
++++ linux-atm-2.4.1/debian/atm-tools-br2684.install
+@@ -0,0 +1 @@
++debian/tmp/usr/sbin/br2684ctl usr/sbin
+--- linux-atm-2.4.1.orig/debian/atm-tools-br2684/usr/share/doc/atm-tools-br2684/changelog.Debian
++++ linux-atm-2.4.1/debian/atm-tools-br2684/usr/share/doc/atm-tools-br2684/changelog.Debian
+@@ -0,0 +1,206 @@
++linux-atm (2.4.1-16) unstable; urgency=low
++
++ * Fix build problem with gcc 3.4 (Closes: #259422)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Thu, 15 Jul 2004 14:28:10 +0200
++
++linux-atm (2.4.1-15) unstable; urgency=low
++
++ * Updated descriptions (Closes: #239161)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Sun, 4 Apr 2004 21:10:20 +0200
++
++linux-atm (2.4.1-14) unstable; urgency=low
++
++ * Fix symlink for /usr/lib/libatm.so (Closes: #221011)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Sun, 7 Dec 2003 21:53:19 +0100
++
++linux-atm (2.4.1-13) unstable; urgency=low
++
++ * Previous version fixed #217259, but no changelog entry (Closes: #217259)
++ * Previous version fixed #216662, but no changelog entry (Closes: #216662)
++ * Added missing build dependency on automake1.4 (Closes: #221120, #221284)
++ * New Maintainer (Closes: #206982)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Mon, 17 Nov 2003 23:03:58 +0100
++
++linux-atm (2.4.1-12) unstable; urgency=low
++
++ * don't build atm-tools-br2684 by default. Thanks to ftpmaster for
++ not allowing the package to be in Debian.
++ * Since we don't build atm-tools-br2684 any more, revert back to
++ autotools output from 2.4.1-9
++ * Add README.br2684 documenting a way to build the package locally.
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 5 Nov 2003 21:31:42 +0000
++
++linux-atm (2.4.1-11) experimental; urgency=low
++
++ * Build-Depend on dpatch
++ * dpatch br2684 header files from later libc for old libc (woody)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 29 Oct 2003 19:05:07 +0000
++
++linux-atm (2.4.1-10) experimental; urgency=low
++
++ * add br2684 to package (closes: #216663)
++ * autoreconf to actually build br2684
++ * have libatm1-dev provide libatm-dev (closes: #216662)
++ * move lib symlink to libatm1-dev as well (closes: #217259)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Thu, 23 Oct 2003 17:55:43 +0000
++
++linux-atm (2.4.1-9) unstable; urgency=low
++
++ * put libatm1-dev in libdevel (closes: #213170)
++ * make sure that new descriptions actually make it into the package
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Thu, 9 Oct 2003 17:08:10 +0000
++
++linux-atm (2.4.1-8) unstable; urgency=low
++
++ * build arch-indep package as targets of binary-indep (closes: #212124)
++ * use dh_installdocs to install files to libatm1-dev/docs
++ * symlink shared lib to usr/bin (closes: #213146)
++ * Use better long descriptions. Thanks to Javier (closes: #209427)
++ Fernandez-Sanguino (closes: #209612)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Sun, 28 Sep 2003 19:29:08 +0000
++
++linux-atm (2.4.1-7) unstable; urgency=low
++
++ * libatm1 now conflicts with atm-tools (<< 2.4.1-6) (closes: #208170)
++ * armarp now writes output to stdout.
++ * add atm-dev as empty transitional package to help upgrades
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Tue, 2 Sep 2003 09:20:33 +0000
++
++linux-atm (2.4.1-6) unstable; urgency=low
++
++ * split off shared libraries to libatm1
++ * rename atm-dev to libatm1-dev
++ * Standards-Version: 3.6.1
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Tue, 26 Aug 2003 15:46:27 +0000
++
++linux-atm (2.4.1-5) unstable; urgency=low
++
++ * move *.a and *.la to usr/lib (closes: #199506).
++ * let atm-dev depend on atm-tools to avoid dangling /lib/libatm.so
++ symlink.
++ * Standards-Version: 3.5.6
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 30 Jul 2003 11:46:19 +0000
++
++linux-atm (2.4.1-4) unstable; urgency=low
++
++ * add Build-Depends: on automake1.4
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 11 Jun 2003 16:58:21 +0000
++
++linux-atm (2.4.1-3) unstable; urgency=low
++
++ * rebuilding libtool broke src/test/Makefile.in. Applied fix to
++ Makefile.am and re-built again.
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 11 Jun 2003 11:05:26 +0000
++
++linux-atm (2.4.1-2) unstable; urgency=low
++
++ * rebuild configure script with new libtool (closes: #196909)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Tue, 10 Jun 2003 21:01:50 +0000
++
++linux-atm (2.4.1-1) unstable; urgency=low
++
++ * new upstream source
++ * remove atmarp and atmarpd from /usr/sbin as they are already in
++ /sbin (closes: #196216)
++ * lintian fixes
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Mon, 9 Jun 2003 16:03:45 +0000
++
++linux-atm (2.4.0-5) unstable; urgency=low
++
++ * Fix for src/test/Makefile.in to allow building on hppa and ia64
++ which the fix introduced to 2.4.0-4 broke. Thanks to Goswin
++ Brederlow.
++ * Move init.d priority to that atmarpd is started before network
++ interfaces are started.
++ * Move atmarpd and libatm to /sbin and /lib to allow atmarpd to be
++ started before /usr is mounted.
++ * use dh_install instead of dh_movefiles.
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Sat, 24 Aug 2002 15:13:48 +0000
++
++linux-atm (2.4.0-4) unstable; urgency=low
++
++ * new maintainer
++ * Fix for src/test/Makefile.in to allow building on sparc.
++ Thanks to Patrick Mauritz. (closes: #144225).
++ * added pseudo-manpage for manpage-less binaries.
++ * removed rpath by changing configure and make install paramaters
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Fri, 16 Aug 2002 20:39:05 +0000
++
++linux-atm (2.4.0-3) unstable; urgency=HIGH
++
++ * Re-ran libtoolize.
++ Closes: #143522
++
++ * Previous version Closes: #135328
++
++ -- Russell Coker <russell@coker.com.au> Fri, 19 Apr 2002 01:55:00 +0200
++
++linux-atm (2.4.0-2) unstable; urgency=HIGH
++
++ * Put a "grep -v EMAXERRNO" into the build process to deal with mipsel and
++ the "#ifdef __KERNEL__" it has in it's /usr/include/asm/errno.h .
++
++ -- Russell Coker <russell@coker.com.au> Thu, 18 Apr 2002 19:56:00 +0200
++
++linux-atm (2.4.0-1) unstable; urgency=HIGH
++
++ * New upstream version which changes source package name.
++ Closes: #138911
++
++ -- Russell Coker <russell@coker.com.au> Mon, 18 Mar 2002 17:42:00 +0100
++
++atm (0.79-4) unstable; urgency=low
++
++ * Added build-depends on flex.
++ Closes: #111072
++
++ * Made the atm tools use a shared object to save space.
++
++ * Fixed the copyright file and put all copyright details in both packages.
++
++ * Added support for easy building with different kernel headers.
++ Closes: #110249
++
++ -- Russell Coker <russell@coker.com.au> Sun, 7 Oct 2001 14:11:33 +0200
++
++atm (0.79-3) unstable; urgency=low
++
++ * Created /etc/init.d/atm to start and stop atmarpd.
++ Closes: #110252
++
++ * Added build-depends on bison.
++ Closes: #110576
++
++ -- Russell Coker <russell@coker.com.au> Fri, 31 Aug 2001 15:21:44 +0200
++
++atm (0.79-2) unstable; urgency=low
++
++ * Changed the main package name to atm-tools to indicate that it doesn't
++ provide ATM (gotta have the kernel support), it just has the daemons and
++ utilities.
++
++ -- Russell Coker <russell@coker.com.au> Sat, 25 Aug 2001 17:55:00 +0200
++
++atm (0.79-1) unstable; urgency=low
++
++ * Initial Release.
++
++ -- Russell Coker <russell@coker.com.au> Fri, 24 Aug 2001 17:31:00 +0200
+--- linux-atm-2.4.1.orig/debian/atm-tools-br2684/usr/share/doc/atm-tools-br2684/changelog
++++ linux-atm-2.4.1/debian/atm-tools-br2684/usr/share/doc/atm-tools-br2684/changelog
+@@ -0,0 +1,3299 @@
++Version 2.4.0 to 2.4.1 (25-APR-2003)
++=====================
++
++Bug fixes
++---------
++
++ - vsprintf's changed to vsnprintf's to prevent possible stack overflows
++
++
++Version 0.79 to 2.4.0 (18-OCT-2001)
++=====================
++
++Bug fixes
++---------
++
++ - defined 'now' in src/lib/timer.c
++ - ia64 build fix for ASN (Chas Williams)
++
++Other changes
++-------------
++
++ - In general, the source tree was rearranged and the old cruft was removed
++ - Old ad hoc build system replaced in favor of a standardized autoconfiscation
++ - Build configuration options are now controlled by 'configure' script instead
++ of changes to the previous 'Rules.make' file
++ - libatm and libatmd merged into one lib: libatm
++ - Both static and shared libraries are built by default. Binaries now built
++ with shared library by default.
++ - Sample atmsigd.conf and hosts.atm are now installed when doing 'make install'
++ - RPM spec file is now available in src/extra/
++ - New RedHat init scripts available in src/config/init-redhat/ (John Strange)
++ (old RedHat 4.0 scripts removed)
++ - ATM on Linux HOWTO now included in doc/ (much derived from usage.tex). We
++ will publish this on the home page as well as linuxdoc.org
++ - tcpdump and libpcap ATM patches/build removed (they have been integrated into
++ their respective packages; see www.tcpdump.org)
++ - ATM Name Service (ANS) files coalesced into src/extra/ANS
++ - ANS bind patch upgraded to bind-4.9.8 (untested)
++ - rtf2e164_cc.pl removed in favor of src/extra/ANS/pdf2e164_cc.pl. The ITU no
++ longer provides E.164 country codes in RTF format. PDF used instead.
++
++
++Version 0.78 to 0.79 (15-AUG-2001)
++====================
++
++Bug fixes
++---------
++
++- uni.c fix for newer versions of gcc
++- mpoad/io.c quick fix for undefined OPEN_MAX
++
++
++Version 0.77 to 0.78 (7-JUL-2000)
++====================
++
++Bug fixes
++---------
++
++ - skb_migrate wasn't protected against functions accessing the list via
++ skb->list
++ - removal of MOD_xxx races in FORE 200E and atmtcp (by Jeff Garzik)
++ - CONFIG_ATM_NICSTAR_USE_IDT77105 set NEED_SUNI_MX instead of
++ NEED_IDT77105_MX (fix from mainstream)
++ - ambassador.c: changed string concatenation and offset calculation breaking
++ compilation with gcc 2.96 (by Jakub Jelinek)
++ - nicstar.c: various locking fixes for SMP (by Rui Prior)
++ - LANE vs. bridging build conflict solved (from mainstream)
++ - %%u instead of %u in mpc.c
++ - fixed formatting of /proc/net/atm/svc
++ - /proc/net/atm/clip always added + after public address, not only if followed
++ by private address
++ - atmsigd now returns EINVAL if attempting to change max_sdu
++ - atm_change_qos now calls adjust_to for additional parameter checking
++ - sendmsg now returns error if size > max_sdu (reported by Alan Kennington)
++ - removed explicit defaults in Config.in (by Christoph Hellwig)
++ - Fore200E: removed #ifdef MODULE
++ - ipcommon.c didn't export skb_migrate to modules (by Mitchell Blank)
++ - ENI: /proc/net/atm/eni:* claimed backlog was in bytes instead of packets
++ - br, bw, window: changed variables receiving possibly negative return values
++ from size_t to ssize_t (reported by Alan Kennington)
++ - LANE: fixed stray errors on lack of ATM address, ATM address change, or ESI
++ change (by Heikki Vatiainen)
++ - LANE: could loop forwever when trying to connect to LECS (by Heikki
++ Vatiainen)
++
++New features
++------------
++
++ - upgraded to the 2.4.0-test3-pre4 kernel
++
++Other changes
++-------------
++
++ - as_reject now returns the errno value in msg->reply
++ - removed save_qos hack in svc_change_qos
++ - atmsigd: sap_encode now always includes both max_sdu fields, even if one
++ contains the null value for some reason (by Mohsen Souissi)
++ - PCI updates for Ambassador, FORE 200E, Horizon, Iphase, nicstar, ENI, and
++ ZATM (by Jeff Garzik)
++ - removal of unnecessary #ifdef MODULE for nicstar, idt77105, and FORE 200E
++ (by Jeff Garzik)
++ - generalized skb_migrate to append to an arbitrary sk_buff list
++ - iphase.c: timer initialization cleanup (from mainstream)
++ - clip: dev->name initialization change (from mainstream)
++ - idt77105: cleaned up timer initialization
++ - clip.c: some general cleanup
++ - removed redundant return in clip.c (by Heikki Vatiainen)
++ - changed atm_change_qos to static
++ - fore200e.c: re-enabled anti-unloading code
++ - lec.c: now drops packets on overrun instead of growing infinite queue (by
++ Heikki Vatiainen)
++ - COPYING still mentioned the old led code with partial DEC copyright
++ (reported by Chris Pimlott)
++ - Horizon: removed const warning by casting to (hrz_flags *)
++ - Iphase: tried to print unsigned long with %x when errors are enabled
++ - ENI: eni_send tries to use do_tx instead of tasklet_schedule to reduce delay
++ - ENI: removed eni_dev->backlog_len (information is already in backlog->qlen)
++ - changed the kernel source tree references from .gz to .bz2 compression
++ - changed mkdiff to allow more flexible selection of additional patch
++
++
++Version 0.76 to 0.77 (29-APR-2000)
++====================
++
++Bug fixes
++---------
++
++ - atmaddr.8, atmarp.8, atmdump.8, atmloop.8, esi.8 didn't print all options
++ in bold
++ - atmsigd crashed if an interface had more than one local ATM address
++ - atmarpd continued to use VCs after closing if they were closed because
++ ATMARP_SETENTRY failed (reported by Joseph Gooch)
++
++New features
++------------
++
++ - upgraded to the 2.3.99-pre6 kernel
++
++Other changes
++-------------
++
++ - CLIP now uses NETDEV_GOING_DOWN instead of NETDEV_DOWN; also avoids
++ "clip_device_event: unknown event 9" warning
++ - added ubr:pcr example to qos(7)
++ - added -V option to atmaddr, atmarp, atmarpd, atmloop, atmsigd, atmtcp, esi,
++ ilmid
++ - sock->sk->sleep now points to vcc->sleep (by Alexander Viro)
++ - CLIP: ATMARP server now reponds to query for local IP address (suggested by
++ Joseph Gooch)
++ - updated t2a.pl
++
++
++Version 0.75 to 0.76 (13-APR-2000)
++====================
++
++Bug fixes
++---------
++
++ - ttcp_atm declared port as "short" instead of "unsigned short", yielding
++ confusing diagnostic output
++
++New features
++------------
++
++ - upgraded to the 2.3.99-pre5 kernel
++
++Other changes
++-------------
++
++ - eliminated eni_send-tasklet synchronization
++ - PCA200: merged unconditional #inclusion of linux/pci.h from pre5
++
++
++Version 0.74 to 0.75 (7-APR-2000)
++====================
++
++Bug fixes
++---------
++
++ - ENI: moved send operation into tasklet to correct synchronization (reported
++ by Heikki Vatiainen)
++ - MPOA: possible deadlock fix (by Heikki Vatiainen)
++ - atm_vcc_flags_t was too small on PPC, causing an overlap with vcc->family
++ (fixed by Chas Williams)
++ - CLIP: needs spin_lock_irqsave instead of only spin_lock (by Rui Prior)
++ - CLIP: clip_push may be called from an interrupt, so the kfree_skb has to
++ become dev_kfree_skb_any (by Heikki Vatiainen)
++
++Other changes
++-------------
++
++ - removed INCLUDES from atm/ilmid/asn1/Makefile (suggested by Jean Marc
++ Lacroix)
++ - atm/maint/Makefile no longer special-cases atmdiag.c (suggested by Jean Marc
++ Lacroix)
++
++
++Version 0.73 to 0.74 (2-APR-2000)
++====================
++
++Bug fixes
++---------
++
++ - atm_poll tried to sleep on two wait queues, which is no longer possible.
++ Removed vcc->wsleep to solve this. (Reported by Joseph Gooch)
++ - lec.c:lec_arp_clear_vccs changed the VCC flags of the wrong VCC, fortunately
++ only in commented-out code
++ - major revision of MPOA ingress and egress cache locking (Heikki Vatiainen)
++
++Other changes
++-------------
++
++ - removed last remnants of bogus bridging lock from lane_mpoa_init.c
++ (reported by Heikki Vatiainen)
++ - removed last traces of TNET1570A driver
++ - atmdev_init still knew about ENI, but ENI now uses new-style initialization
++ - improved Fore 200E configuration to catch useless settings already at
++ configuration time (by Christophe Lizzi)
++
++
++Version 0.72 to 0.73 (29-MAR-2000)
++====================
++
++Bug fixes
++---------
++
++ - ambassador.c and horizon.c had module loading races (fixed by Giuliano
++ Procida)
++ - fore200e: one set_bit was accidently converted to clear_bit, preventing VCs
++ from being opened (fixed by Christophe Lizzi)
++
++Other changes
++-------------
++
++ - fore200e: moved interrupt handler work to tasklet (by Christophe Lizzi)
++ - fore200e: fixed SBUS DMA direction flags (by Christophe Lizzi)
++ - fore200e: the compile no longer fails when the driver is compiled without
++ any hardware support (and displays a warning; by Christophe Lizzi)
++ - oops, atm/README was lagging behind a few versions
++
++
++Version 0.71 to 0.72 (25-MAR-2000)
++====================
++
++Bug fixes
++---------
++
++ - fore200e.h and lec.h didn't #include <linux/config.h> (fixed by David S.
++ Miller ?)
++ - atmloop.c always assumed -q to be present
++
++New features
++------------
++
++ - upgraded to the 2.3.99-pre3 kernel
++
++Other changes
++-------------
++
++ - kernel patch still included wd.c hack (reported by David S. Miller)
++ - removed bogus initialization of skb->rx_dev (spotted by Alexey Kuznetsov)
++ - removed bogus lane_bridge_hook_lock (by Heikki Vatiainen)
++ - added sparc64 support for ATM_QUERYLOOP (by Christophe Lizzi)
++ - minor Fore driver cleanup (by Christophe Lizzi)
++ - eni.c: moved interrupt handler work to tasklet
++
++
++Version 0.70 to 0.71 (21-MAR-2000)
++====================
++
++Bug fixes
++---------
++
++ - eni.c: fixed potential SMP deadlock on tx_wait
++ - clip.c and lec.c didn't initialize skb->rx_dev
++ - net/atm/svc.c:svc_connect left wait entry in queue on return in some cases
++ - idiot bug in skb_migrate caused weird crashes
++ - atmloop usage erroneously claimed -s was optional
++
++New features
++------------
++
++ - upgraded to the 2.3.99-pre2 kernel
++ - added atmloop.8 man page
++ - added enqueuing result NET_XMIT_BYPASS for qdiscs that send packets on a
++ path without dequeue (e.g. sch_atm)
++
++Other changes
++-------------
++
++ - ambassador.c: removed warnings when compiling with CONFIG_SMP (by Giuliano
++ Procida)
++ - changed drivers/atm target from atm.a to atm.o, to make initcalls work
++ - converted eni.c to use pci_register_driver and initcall
++ - cleaned up #ifdef hell in net/atm/signaling.c:sigd_put_skb
++
++
++Version 0.69 to 0.70 (20-MAR-2000)
++====================
++
++Bug fixes
++---------
++
++ - LEC compilation as a module still left it in the kernel
++
++Other changes
++-------------
++
++ - moved LANE-bridging interface code from lec.c to lane_mpoa_init.c (by
++ Heikki Vatiainen)
++ - made SONET and ATM statistics counters atomic to avoid cli() when reading
++ (not updated: similar mechanism in idt77105.c and private shadow statistics
++ of ambassador.c)
++ - changed access to VCC and device flags (ATM_VF_* and ATM_DF_*) to bit set
++ operations
++ - changed flag types to structs to fail compilation of old code
++ - changed last argument of atm_dev_register to a pointer to a bit set for
++ easier migration
++ - net/atm/*.c: eliminated all sleep_on and cli (except in lec.c)
++ - ditto for eni.c and suni.c
++ - corrected indentation of some "permanent" debugging code in zatm.c
++ - made skb_migrate partially atomic, obsoleting yet another cli() in clip.c
++
++
++Version 0.68 to 0.69 (19-MAR-2000)
++====================
++
++Bug fixes
++---------
++
++ - ambassador.c: corrected location of initial PLX window for use on Alpha (by
++ Giuliano Procida)
++ - zeppelin: fixed address initialization (found by Christophe Lizzi)
++ - atmsigd.conf man page erroneously described the option "q.2963.1" as
++ "q2963_1"
++ - LANE didn't compile when bridging was enabled (fixed by Heikki Vatiainen;
++ note that bridging also needs an update which is being merged via the
++ mainstream kernel)
++
++New features
++------------
++
++ - atmsigd: added command-line option -u to set the UNI mode
++ - added ioctl ATM_QUERYLOOP to determine supported loopback modes
++ - added atmloop(8) option -q
++
++Other changes
++-------------
++
++ - added CREDITS entry of Giuliano Procida
++ - various cosmetic changes to horizon.c (by Giuliano Procida)
++ - ambassador.c: various bits of cleanup (by Giuliano Procida)
++ - added -S <tos> option to ttcp_atm to set the IPv4 TOS byte (this is not
++ really related to ATM)
++ - changed loopback mode values to a bit set
++ - idt77105_ioctl: returned sizeof(int) instead of 0 on ATM_GETLOOP
++ - added phy_ops->stop to suni.c and uPD98402_stop, cleaned up suni.c in the
++ process
++ - removed (very obsolete) mmuio.o from net/atm/Makefile
++
++
++Version 0.67 to 0.68 (28-FEB-2000)
++====================
++
++Bug fixes
++---------
++
++ - removed potential dev_kfree_skb(NULL) from *_send of eni.c, zatm.c, iphase.c
++ - eni.c, zatm.c, iphase.c sometimes returned PCI error codes instead of errno
++ codes
++ - arpd/io.c could try to de-reference entry->addr with addr == NULL (fixed by
++ Thomas Dietz)
++ - LANE copied more than dev->addr_len address bytes (fixed by Heikki
++ Vatiainen)
++ - sch_atm didn't remove filters on destroy
++ - fixed typo in esi.c error message
++ - esi.8 claimed to be the man page of atmarp, and it wasn't installed
++ - added checking for VPI/VCI when sending AAL0 cells (by Mitchell Blank)
++ - atmtcp allowed sending on receive-only VCs
++ - various ioctl permission checks were missing (fixed by Mitchell Blank)
++ - fore200e.c and horizon.c didn't always free skbs on send error (fixed by
++ Mitchell Blank)
++ - included an ugly hack to fix the wd.c driver that was broken around 2.3.47
++ (not related to ATM at all...)
++
++New features
++------------
++
++ - upgraded to the 2.3.48 kernel
++ - added device-independent SAR/PHY loopback setting interface (with many good
++ ideas from Greg Banks and Mitchell Blank), and removed old loopback ioctls
++ - new utility atmloop to set loopback mode
++ - added "stop" to atmphy_ops (requested by Mitchell Blank)
++
++Other changes
++-------------
++
++ - mkdiff can now also use pre-release kernels
++ - changed *kfree_skb to dev_kfree_skb_{irq,any} in eni.c, zatm.c, and raw.c,
++ where necessary (with help from Heikki Vatiainen)
++ - changed {dev_,}kfree_skb to dev_kfree_skb_any in ambassador.c, horizon.c,
++ iphase.c, and nicstar.c (needs further cleanup)
++ - softnet updates for LANE (by Heikki Vatiainen)
++ - fixed firmeware license of Fore 200E driver and general 0.46/0.47 updates
++ (Christophe Lizzi)
++ - more CREDITS file additions
++ - softnet updates for sch_atm
++ - softnet updates for CLIP (also cleaned up flow control for > 1 VCC/itf;
++ reported by Alexey Kuznetsov)
++ - updated documentation for iproute2-2.2.4-now-ss000225 and streamlined the
++ build procedure
++ - PCI DMA updates for ENI driver
++ - changed the default install location of executables and man pages from
++ /usr/local to /usr
++ - make install no longer installs align, aping, br, bw, delay, isp, svctor,
++ sw_debug, sw_tcp, swc, and window
++ - eni.c: made highly controversial aal5 = ... line more readable
++ - moved /proc/atm to /proc/net/atm
++ - added vcc->send function to allow for AAL-specific processing (may be set
++ to dev->ops->send)
++ - atm_do_connect_dev now calls bind_vcc before AAL initialization to make
++ vcc->dev available
++ - change_qos no longer allows changing of AAL or traffic class (by Mitchell
++ Blank)
++ - changes for new loopback support to fore200e driver and sparc64 code (by
++ Christophe Lizzi)
++
++
++Version 0.66 to 0.67 (2-FEB-2000)
++====================
++
++New features
++------------
++
++ - upgraded to 2.3.42
++ - added sunimode utility to set SUNI loopback mode (by Christophe Lizzi)
++
++Other changes
++-------------
++
++ - removed unused variable warning in net/sched/sch_atm.c
++ - changed ENI_SETMULT from ATMIOC_SARPRV+1 to ATMIOC_SARPRV+7
++ - changed atmarpd's complaint about VCC-less non-ATMARP-server entries from
++ DIAG_ERROR to DIAG_INFO (the condition is okay for an ATMARP server)
++
++
++Version 0.65 to 0.66 (31-JAN-2000)
++====================
++
++Bug fixes
++---------
++
++ - atmsigd crashed on reception of as_accept, etc., because of inverted NULL
++ pointer test (reported by Kevin Vargo, Rui Prior, fixed by Julian Cable)
++ - fixed various SPARC build problems (by Christophe Lizzi)
++ - atmsigd insisted that calling party number is local in switch mode
++ - debug switch didn't initialize any ports
++ - net/atm/signaling.c:sigd_enq didn't properly zero the message, yielding
++ kernel pointers partially containing junk
++ - accept(2) didn't copy local ATM address to VCC descriptor (reported by
++ Pedro Brandao)
++ - ilmid/io.c didn't compile on SPARC (reported by Christophe Lizzi)
++ - usage.txt didn't define the %: macro, leaving garbage in usage.txt
++
++New features
++------------
++
++ - upgraded to 2.3.41
++ - Fore 200E driver now also works for SBA-200E (by Christophe Lizzi)
++
++Other changes
++-------------
++
++ - added various CREDITS entries
++ - changed TIOC{IN,OUT}Q to SIOC{IN,OUT}Q (no user space rebuild required;
++ the values are identical)
++ - added script atm/switch/tcp/mkfiles for automatic extraction of
++ configuration files
++ - atmsigd called ATM_GETLINKRATE "ATM_GETLINERATE" in complaints
++ - atmsigd tried to obtain link speed in switch mode, although it's not used
++ - Ambassador NIC: various files still had the wrong copyright/licensing text
++ (patch by Giuliano Procida)
++
++
++Version 0.64 to 0.65 (21-JAN-2000)
++====================
++
++Bug fixes
++---------
++
++ - fixed 32/64 bit %p formatting problem in /proc/atm/vc
++ - atmtcp: fixed RX/TX statistics (by Jens Axboe)
++ - sparc64-specific ioctl 32/64 bit marshalling fixes (by Christophe Lizzi,
++ with further improvements by Jens Axboe)
++ - zeppelin -l option handling (reported by Mike Prudence, fixed by Heikki
++ Vatiainen)
++ - mkpatch didn't include drivers/atm/eni.h
++ - updated eni.h (tx->backlog_len was missing)
++ - fixed various uint32_t build problems of user space tools by including
++ atm.h before anything other ATM headers (first reported by Rashmi Dravid)
++ - "natmtcp virtual" didn't parse the command line properly
++ - natmtcp's TCP link changed VPI/VCI to 0.0 on close
++ - CLIP: fixed crash after sending ARP (reported by Rui Prior)
++
++New features
++------------
++
++ - upgraded to 2.3.40 (with help from Jens Axboe)
++ - added sparc64 changes for ENI driver (by Heikki Vatiainen)
++ - added the Fore PCA-200E(/SBA-200E) driver (by Uwe Dannowski and Christophe
++ Lizzi)
++ - added the Interphase ATM PCI (i)Chip (x575, x525, x531, etc.) driver (by
++ Monalisa Agrawal and Peter Wang)
++ - added ABR fields to struct atm_trafprm (by Peter Wang)
++ - nicstar driver now supports setting of the CLP bit (by Rui Prior)
++ - added ENI_SETMULT ioctl and enitune utility to change ENI buffer size
++ multipliers at run time
++
++Other changes
++-------------
++
++ - atmsigd: changed default UNI version from 3.0 to dynamic (which defaults
++ to 3.0)
++ - atmtcp: removed ugly ../../net/atm/protocols.h include
++ - ioctls now internally return -ENOIOCTLCMD if ioctl command number is not
++ recognized
++ - removed ATM_CREATE_LEAF ioctl (wasn't used and suggested the wrong design
++ approach anyway)
++ - updated README.DRIVERS
++ - natmtcp now uses port 2812 (assigned by IANA)
++ - moved Documentation/atm.txt to Documentation/networking
++ - improved atm_kptr_int_t for non-Sparc architectures (by Christophe Lizzi)
++ - removed two compiler warnings from nicstar.c
++ - some minor nicstar cleanup (by Rui Prior)
++ - added "vbr" and "abr" to text2qos/qos2text ("vbr" not used for anything
++ right now)
++ - natmtcp: added commands "create", "remove", "switch", corresponding to
++ options -p, -r, and -s of atmtcp
++ - natmtcp: added link type "print" (write PDU content to stdout)
++ - natmtcp: now uses atm_kptr_int_t for VCC kernel pointer instead of unsigned
++ long
++ - added apologetic man page for natmtcp
++ - renamed natmtcp to atmtcp and removed the old atmtcp
++ - changed some user-space code to avoid patronizing "ambiguous `else'"
++ warnings from egcs, adding as few ugly redundant curly braces as possible
++ - fixed some other compiler warnings
++ - kernel part: trimmed operations structure initializers which consisted
++ mainly of NULL pointers
++ - kernel pointers sent as opaque references to user space are now of type
++ atm_kptr_t. Added support functions kptr_eq and kptr_print. (With help from
++ Richard Johnson and Mitchell Blank)
++ - removed various "overriding commands" warnings in user-space build process
++ - mkdist now creates arcvie in current directory if ~/l/arch doesn't exist
++ - make clean && make now works also if dependencies are present (make clean
++ used to remove sigd/q.out.h, which the dependencies required)
++ - atmtcp uses command bg instead of -b for backgrounding. Also, listen-bg
++ listens and backgrounds before calling accept.
++
++
++Version 0.63 to 0.64 (1-DEC-1999)
++====================
++
++Bug fixes
++---------
++
++ - atmapi.h logic was still wrong (fixed by Christophe Lizzi)
++ - LANE: fixed BUS filtering and net/atm/lec.c cleanup (by Heikki Vatiainen)
++ - arpd/io.c assumed that diag() preserves errno
++ - atmarpd didn't include QOS in output if getsockopt failed
++
++New features
++------------
++
++ - /proc/atm/eni:* now also shows transmit queue and backlog length
++ - added option "sndbuf" to atmarp
++ - added option "sndbuf" to tc ... atm ...
++ - /proc/atm/vc lists internal details for all VCs (flags, buffers, etc.);
++ added ATM_VF2TXT_MAP to atmdev.h to allow translation of flag values
++
++Other changes
++-------------
++
++ - ATM now uses sk->sndbuf/rvcbuf instead of atm_vcc->tx_quota/rx_quota
++ - removed rx_quota hack from zatm.c
++ - removed net/atm/tunable.h
++ - CLIP and sch_atm now only send packets if the VC's send queue allows them to
++ - implemented correct "requeue" function in sch_atm
++ - updated zeppelin(8) man page (Heikki Vatiainen)
++ - atmarp: atmarp -q qos_spec usage is obsolete; use atmarp -q qos qos_spec
++ instead
++ - /proc/atm/svc now prints "N/A@xxxxxxxx" instead of "Unassigned", with the
++ address of the descriptor in xxxxxxxx
++ - removed all traces of CONFIG_MMU_HACKS
++ - obsoleted ATM_SETSC (single-copy control)
++
++
++Version 0.62 to 0.63 (22-NOV-1999)
++====================
++
++Bug fixes
++---------
++
++ - horizon.c: cleared weird rate_lock/rates_lock patch conflict
++ - saaldump output formatting was completely wrecked; added option -q for
++ "quiet" output (no Q.2931 printing)
++ - fixed LANE Ethernet interface MTU mapping (patch by Rob Scott)
++ - atmsigd incorrectly rejected CONNECTION AVAILABLE (Q.2963.1)
++ - SVC address was wrong in /proc/atm/arp if using private and public part
++ - RESTART ACKNOWLEDGE was not sent with the correct global call reference
++ value (reported by Peter Ryan)
++ - zatm: usec timestamps need 64 division of x86, so this option must be
++ unavailable on other architectures (reported by Matti Aarnio)
++ - nicstar: added "fix3" and "fix4" (by Rui Prior)
++ - LANE: non-proxy didn't filter packets coming from BUS (fix by Marko Kiiskila
++ and Heikki Vatiainen)
++
++New features
++------------
++
++ - upgraded to kernel version 2.3.28
++ - atmtcp now reports VC open/close and generates timestamps (Note: the
++ protocol used between the kernel and the atmtcp utility has changed)
++ - new utility "natmtcp" which combines the ATMTCP protocol, ATMTCP ("virtual")
++ interfaces, "real" ATM interfaces, and log files (experimental)
++ - added ILMI 4.0 MIB variables atmfPortMyIdentifier and atmfMySystemIdentifier
++ (by Thomas Seidel)
++ - zeppelin: new command line option -I to select interface, allowing the use
++ of LANE with multiple physical interfaces (by Heikki Vatiainen)
++ - UltraSparc (sparc64) support (by Christophe Lizzi)
++ - nicstar: added IDT77105 PHY support (by Greg Banks)
++ - added utility loop25 to control ForeRunner LE loopback mode (by Greg Banks)
++ - added support for DNS lookup of NSAP addresses (by Rui Prior)
++ - added utility debug/dnstest (by Rui Prior)
++
++Other changes
++-------------
++
++ - net/atm/tunable.h cleanup
++ - removed SO_BCTXOPT, SO_BCRXOPT, and struct atm_buffconst
++ - removed obsolete field "next" from struct atm_blli
++ - changed potentially unaligned 32 bit accesses in SAAL to use read_netl
++ (spotted by Christophe Lizzi)
++ - added __attribute__ ((aligned(8))) to many structures containing structures
++ which are shared by kernel and user space to enfore uniform packing on
++ sparc64 (with help from Christophe Lizzi)
++ - changed unsigned long to unsigned int at API for compatibility with
++ architecture where sizeof(long) differs between user and kernel space
++ (e.g. sparc64; suggested by Christophe Lizzi)
++ - changed struct atmsvc_msg.{vcc,listen_vcc} from unsigned long to new type
++ atm_kptr_int_t; changed atmsigd accordingly (NB: debugging output may strip
++ upper bits)
++ - changed various casts pointer->int to pointer->long->int (where the pointer
++ does indeed only contain an int, e.g. in ioctl) for Alpha (reported by
++ Matti Aarnio)
++ - nicstar: changes card->membase from u32 to unsigned long
++ - added __attribute__ ((unused)) to mpc.c and mpoa_caches.c to remove
++ warnings about variables used only for debugging
++ - drivers/atm/Config.in: changed ! "$foo" = "x" to "$foo" != "x"
++
++
++Version 0.61 to 0.62 (27-AUG-1999)
++====================
++
++Bug fixes
++---------
++
++ - lib/diag.c:set_logfile didn't set log_to_initialized (reported by Lars
++ Burgstahler)
++ - sch_atm did not use classifiers attached to the x:0 class (reported by Lars
++ Burgstahler)
++ - net/atm/atm_misc.c EXPORT'ed atm_return, which is an inline function (fixed
++ by Mitchell Blank)
++ - work-around for SO_LEVEL range problems (by Mitchell Blank)
++ - nicstar oops fix (by Rui Prior and John Brosnan)
++ - nicstar should now work also as non-module (by Rui Prior)
++ - nicstar fix for chip bug showing up on 64-bit CPCI bus systems (by Jay
++ Talbott)
++ - cleared confusion about inclusion of suni.o when building both nicstar and
++ ENI
++ - suni.c now always exports suni_init
++ - various fixes and cleanups in the Madge drivers (by Giuliano Procida)
++ - fixed new set of atm_pdu2truesize problems by introducing atm_alloc_charge
++ which handles the allocation too (problem report and work-around by Alexey
++ Kuznetsov)
++ - getsockname on unbound PVC socket caused an oops
++ - LANE: Token Ring source route bridge support fix (by Heikki Vatiainen)
++
++New features
++------------
++
++ - upgraded to kernel version 2.3.15 (mainly by Alexey Kuznetsov and Mitchell
++ Blank)
++ - new socket option SO_ATMPVC to retrieve the "PVC" address (PVC & SVC) (based
++ on a patch by Jay Talbott)
++ - zeppelin -l now also accepts only the selector byte (by Robert Slaski)
++
++Other changes
++-------------
++
++ - removed obsolete drivers/atm/nicstar.c.old_skb
++ - removed all references to Arequipa (obsolete)
++ - SO_BCTXOPT/SO_BCRXOPT are now obsolete, given that the final verdict on page
++ flipping has been spoken in linux-kernel
++ - interface statistics are now counted in struct net_device_stats instead of
++ struct enet_statistics (by Mitchell Blank)
++ - added pointer to mailing list to Documentation/atm.txt
++ - Documentation/Configure.help now points to Documentation/atm.txt instead of
++ directly to the Web page.
++ - usage.tex: clarified the consequences of interrupting atmtcp
++ - changed the highly misleading "atmarpd:ITF: no such interface" message to
++ DIAG_DEBUG
++
++
++Version 0.60 to 0.61 (11-JUN-1999)
++====================
++
++Bug fixes
++---------
++
++ - nicstar: driver sometimes crashed when starting for 25 Mbps cards (Rui
++ Prior)
++ - Zeitnet driver: uPD98402.c wasn't compiled with -DEXPORT_SYMTAB when
++ building as a module
++ - net/atm/raw.c didn't export atm_init_aal5, so ATMTCP didn't load as a module
++ - atmtcp could still be accessed after loading and then unloading, yielding an
++ Oops
++
++Other changes
++-------------
++
++ - PPC configuration now also includes ATM (Jay Talbott)
++ - lots of cleanup in the Madge drivers (Giuliano Procida)
++ - tamed down a bit the tone in README
++
++
++Version 0.59 to 0.60 (3-JUN-1999)
++====================
++
++New features
++------------
++
++ - upgraded to kernel version 2.3.3 (main change is slightly different wait
++ queue handling; affects all drivers)
++
++Other changes
++-------------
++
++ - mkdiff script now takes .bz2 kernel if no .gz can be found
++ - made a few changes to the Madge drivers to reduce the number of warnings
++
++
++Version 0.58 to 0.59 (3-JUN-1999)
++====================
++
++New features
++------------
++
++ - upgrade to kernel version 2.2.9
++ - zeppelin now adjusts MTU when joining ELAN (Heikki Vatiainen)
++
++Other changes
++-------------
++
++ - adjusted tr interface name limit to 8 characters (down from a wasteful 9)
++
++
++Version 0.57 to 0.58 (3-JUN-1999)
++====================
++
++Bug fixes
++---------
++
++ - ENI drivers sometimes directly dereferenced pointers instead of using readl/
++ writel (fixed by Mitchell Blank)
++ - nicstar driver no longer uses floating point (fixed by Rui Prior)
++ - nicstar driver may have refused CBR VC in some cases even with enough
++ bandwidth available (fixed by Rui Prior)
++ - usage.tex failed to build (fixed by Bill Brooks)
++ - zeppelin got byte order in BLLI wrong (reported by Chas Williams; fixed by
++ Mitchell Blank and Heikki Vatiainen)
++ - zeppelin did not work when the host had multiple ATM addresses (reported by
++ Benoit Steiner; fixed by Heikki Vatiainen)
++ - zeppelin incorrectly parsed -i command line option (reported by Benoit
++ Steiner; fixed by Heikki Vatiainen)
++ - atm_connect_vcc and /proc/atm/pvc report AAL0 now properly (reported by Zhu
++ Qun Ying and Uwe Dannowski)
++
++New features
++------------
++
++ - nicstar driver now support SONET diagnostics (by Rui Prior)
++ - nicstar driver now works on PowerPC (by Jay Talbott)
++ - LANE now also supports Token Ring (Heikki Vatiainen, with testing by
++ Holger Smolinski)
++
++Other changes
++-------------
++
++ - major non-i386 architecture and other cleanup in ENI driver (by Mitchell
++ Blank)
++ - number of lec devices is 40+8 (lec0-lec39 are Ethernet and lec40-lec47 are
++ Token Ring; Heikki Vatiainen)
++ - lec.c and mpc.c now use atm_force_charge (Heikki Vatiainen)
++ - net/802/tr.c limited interface names to 4 characters (fixed by Heikki
++ Vatiainen)
++ - zeppelin man page updated (Heikki Vatiainen)
++ - "zeppelin.new" is now "zeppelin", the old "zeppelin" is gone
++ - set "atm_connect" printk to KERN_DEBUG
++ - removed ATM_SAAL from include/linux/atm.h (there never was any support for
++ SAAL in the kernel)
++
++
++Version 0.56 to 0.57 (18-MAY-1999)
++====================
++
++Bug fixes
++---------
++
++ - atmarpd complained "invalid control msg type" when changing interface
++ characteristics (reported by Soo-Khim Ho)
++ - sch_atm didn't compile without CLIP (reported by Zhu Qun Ying)
++ - LANE & MPOA: plugged a few memory leaks after failure to atm_charge (Heikki
++ Vatiainen)
++ - mpcd could not be killed if MPS's address was not known (fixed by Heikki
++ Vatiainen)
++ - nicstar: fixed the sleeping in interrupt issue (Rui Prior)
++
++New features
++------------
++
++ - drivers for the Madge "Ambassador" and "Horizon [Ultra]" NICs, also known
++ as Collage PCI 155 Server, 25, and 155 Client (by Giuliano Procida)
++
++Other changes
++-------------
++
++ - MPOA code cleanup and debugging printks are now conditional (Heikki
++ Vatiainen)
++ - removed both led/USAGE files
++ - removed the old atmsigd (was in atm/sig.old/)
++ - nicstar driver now works around TSQ bug on older chips (77201) (by Rui
++ Prior, with the detective work by Jay Talbott)
++
++
++Version 0.55 to 0.56 (22-APR-1999)
++====================
++
++Bug fixes
++---------
++
++ - atm/doc/Makefile assumed . to be included in PATH when invoking rlatex
++ (fix by Heikki Vatiainen)
++ - usage.txt leaked Arequipa configuration examples (fix by Heikki Vatiainen)
++ - plugged a small memory leak in led.new which occurred when using the LANE
++ client as a proxy (Heikki Vatiainen)
++ - atmarpd crashed when printing ATMARP table entries with flag 0x8000 set
++ (reported by Vinay Kulkarni)
++ - CLIP interfaces now follow netmask changes
++ - Nicstar: 25.6 Mbps cell rate corrected (by Rui Prior)
++ - atm_equal could loop forever when comparing NSAP-encoded E.164 addresses
++ (reported by Valley Zhizhkun)
++ - [AP]F_ATM[PS]VC definitions in lib/atm.h conflicted with glibc 2.1
++ (reported by Heikki Vatiainen and Jens Vagelpohl)
++ - changed a few non-int main to int main (reported by Heikki Vatiainen)
++ - changed lib/diag.c work with glibc 2.1, where stderr is no longer a constant
++ (based on a patch by Heikki Vatiainen, also reported by Giuliano Procida)
++ - make clean didn't remove qgen/q.test.c, qgen/qd.out.h, qgen/qd.test.c,
++ sigd/q.out.h and sigd.old/q.out.h (reported by Giuliano Procida)
++ - optional headers were installed even with system headers present if
++ INSTROOT was different from / (reported by Giuliano Procida)
++ - lib/stdint.h was used even on systems that had a "real" stdlib.h (based on a
++ patch by Heikki Vatiainen, also reported by Giuliano Procida)
++ - renamed net/atm/misc.c to atm_misc.c to avoid name clash with
++ drivers/char/misc.c on include/linux/modules/misc.* (reported by Borek
++ Lupomesky)
++
++New features
++------------
++
++ - new ioctl ATM_GETLINKRATE to query link rate of an interface (suggested by
++ Vitaly Lavrov)
++ - new atmsigd.conf option io max_rate to specify rate to signal if
++ application requests the "maximum"
++ - added decription of CONFIG_ATM_LANE and CONFIG_ATM_MPOA to the kernel
++ configuration help (Heikki Vatiainen)
++ - added description of LANE to usage.tex (Heikki Vatiainen)
++ - new function atm_force_charge to unconditionally add data to a receive
++ buffer
++
++Other changes
++-------------
++
++ - atmsigd now determines maximum link rate by querying interfaces (suggested
++ by Vitaly Lavrov)
++ - moved local address registry from a global table to VPCI structures
++ - changed unknown net device notification severity from KERN_ERR to
++ KERN_WARNING
++ - atmarpd now overwrites old atmarpd.table on startup (it used to keep it
++ until the first configuration change)
++ - shutdown(2) of native ATM VCs now returns 0 instead of -EOPNOTSUPP
++ (suggested by Mitchell Blank)
++ - Nicstar: IRQ sharing is now allowed (by Rui Prior)
++ - Nicstar: default maximum number of cards is now 4 (by Rui Prior)
++ - Nicstar: when compiled as a module, the driver may no longer be removed
++ while in use (by Rui Prior)
++ - Nicstar: loss of cells is no longer reported as a plain CRC error (by Rui
++ Prior)
++ - atmsigd now always clears the endpoint reference flag if in UNI 3.0 mode
++ (based on a patch by Heikki Vatiainen)
++
++
++Version 0.54 to 0.55 (1-MAR-1999)
++====================
++
++Bug fixes
++---------
++
++ - SELECT_TOP_PCR didn't take intro account the "pcr" field, causing SVC with
++ QoS pcr=xxx to be set up at link speed
++ - qos_equal didn't detect differences in the "pcr" fields
++ - sch_atm only accepted parent == root or absent (reported by John Loughney)
++ - sch_atm:atm_tc_put accessed flow structure after kfree'ing it
++ - sch_atm:atm_tc_change didn't put excess traffic class if class creation
++ failed
++ - sch_atm:atm_tc_dump_class didn't return class ID in tcm->tcm_handle
++ - sch_atm:atm_tc_delete refused to delete classes because it expected
++ ref == 1, but ref == 2 (reported by John Loughney)
++
++
++Version 0.53 to 0.54 (19-FEB-1999)
++====================
++
++Bug fixes
++---------
++
++ - led.new: fixed build problem and warning (Heikki Vatiainen)
++ - fixed LANE arp cache timeouts (Heikki Vatiainen)
++ - ilmid -i option fell through into -l, causing logging to go into a file
++ named after the local address
++ - flipping the highest bit of ep_ref made it negative which was erroneously
++ interpreted to mean "absent" (reported by Giuliano Procida and Chas
++ Williams)
++ - ilmid used the result of AsnOidCompare inconsistently, causing network
++ prefix registration to fail with some switches (based on a patch by Giuliano
++ Procida)
++
++New features
++------------
++
++ - tc:q_atm: new option "clip" to select Classical IP processing of inbound
++ traffic
++ - new sch_atm class attribute TCA_ATM_STATE to retrieve VC state
++
++Other changes
++-------------
++
++ - led.new: improved handling of LANE flush protocol (Heikki Vatiainen)
++ - copied USAGE from led/ to led.new/
++ - added description of ilmid options -i and -u to USAGE (Heikki Vatiainen)
++ - ilmid -u now also works without -DDYNAMIC_UNI (all values but the default
++ are refused)
++ - tcpdump patch updated to tcpdump version 3.4 (Heikki Vatiainen)
++ - updated "tc" patch to iproute2 version 2.1.99-now-ss990203
++
++
++Version 0.52 to 0.53 (9-FEB-1999)
++====================
++
++Bug fixes
++---------
++
++ - atmsigd: selecting the UNI version via compile-time options didn't yield
++ the desired result in some cases (reported by Vinay Kulkarni and others)
++ - ATM VCCs now use struct sock, as required by protocol-independent layer
++ starting with recent 2.1 kernels (by Mitchell Blank)
++ - led fixes: htons/htonl bugs in LANEv2 code, one duplicate close() removed
++ (by Heikki Vatiainen)
++
++New features
++------------
++
++ - upgraded to the 2.2.1 kernel (by Mitchell Blank)
++ - LANE: added bridging support (by Heikki Vatiainen)
++ - complete rewrite of led (in led.new), which is now leaner and no longer
++ contains code (c) Digital (by Heikki Vatiainen)
++ - added macros for local AESA format and group addresses, and support in
++ atm2text (by Heikki Vatiainen)
++
++Other changes
++-------------
++
++ - ENI: buffer sizes are now limited to MID_MAX_BUF_SIZE even if max_sdu >
++ MID_MAX_BUF_SIZE/3 (reported by Andrew Lunn)
++ - plenty of NICStAR changes (Rui Prior and Mitchell Blank)
++ - LANE interface to upper layer looks more like Ethernet, so adding bridge and
++ 802.1Q support is easier, and tcpdump does not need any extra patches (by
++ Heikki Vatiainen)
++
++
++Version 0.51 to 0.52 (5-DEC-1998)
++====================
++
++Bug fixes
++---------
++
++ - atmsigd crashed when receiving STATUS ENQUIRY for call in Null state
++ (reported by Heikki Vatiainen)
++ - outbound endpoint reference didin't have the 16th bit toggled (fixed by
++ Andrew Lunn)
++ - lec.c: fixed a bug in kernel which could cause kernel part to deadlock when
++ signalling was not started successfully (by Heikki Vatiainen)
++ - MPOA: bug fixes and other changes, see atm/mpoa/CHANGELOG (by Heikki
++ Vatiainen)
++
++New features
++------------
++
++ - LANE: both kernel & daemon: support for ELANs which have MTUs greater than
++ 1516 (by Eric H. Kinzie)
++ - MPOA: can now ask LECS for configuratino information (by Heikki Vatiainen)
++
++Other changes
++-------------
++
++ - zeppelin.8: updated (Heikki Vatiainen)
++
++
++Version 0.50 to 0.51 (6-NOV-1998)
++====================
++
++Bug fixes
++---------
++
++ - atmsigd: typo prevented kernel.c from compiling with UNI30 disabled (fix by
++ Andrew Lunn and Uwe Dannowski)
++ - option -u crashed ilmid (reported by Michael Wolf)
++
++Other changes
++-------------
++
++ - bearer capability is now set to "CBR" for CBR (suggested by Heikki
++ Vatiainen)
++
++
++Version 0.49 to 0.50 (3-NOV-1998)
++====================
++
++Bug fixes
++---------
++
++ - atmsigd didn't compile for -DUNI31 -DALLOW_UNI30 (fixed by Richard Gooch)
++ - atmsigd crashed on as_bind and also had problems with as_connect after
++ as_bind (reported by Heiko Krupp, Heikki Vatiainen, and many others)
++
++Other changes
++-------------
++
++ - atmsigd now enables tracing by default (use -t 0 to turn it off)
++ - added "terminate" message to test/isp
++ - mpoad defaults to UBR if service category is absent (by Heikki Vatiainen)
++ - LANE now avoids blocking intact connections when other connections have
++ problems by queuing packets independently per destination while waiting for
++ a connection (by Heikki Vatiainen)
++
++
++Version 0.48 to 0.49 (1-NOV-1998)
++====================
++
++Bug fixes
++---------
++
++ - q_atm.c passed TCA_ATM_EXCESS even if zero, while the kernel expected it
++ to be absent in this case (changed q_atm.c)
++ - q_atm: tc class show didn't separate fields properly with blanks
++ - removed double inclusion of atm/config from mkdist
++
++New features
++------------
++
++ - upgraded to the 2.1.126 kernel
++
++Other changes
++-------------
++
++ - "new" atmsigd is now the default (atm/sigd got renamed to atm/sigd.old,
++ atm/sigd.new to atm/sigd)
++ - updated extra/tc/README
++
++
++Version 0.47 to 0.48 (30-OCT-1998)
++====================
++
++Bug fixes
++---------
++
++ - ilmid didn't recognize the -u option
++ - ATM_GETCIRANGE copied wrong amount of data (fix by Heikki Vatiainen)
++ - sch_atm didn't compile without policing enabled (reported by Calin Poenaru)
++ - BHLI octets: qgen/msg.fmt allowed nine instead of eight bytes for ISO and
++ user specified, include/linux/atmsap.h:ATM_MAX_HLI was 7 instead of 8 (by
++ Damian Gilmurray and Paisit Thamsakorn)
++ - MPOA: bug fixes and other changes, see atm/mpoa/CHANGELOG (by Heikki
++ Vatiainen)
++
++New features
++------------
++
++ - ilmid: new option -i to set local IP address (suggested by Andrew May)
++ - ilmid now also supports the MIB variables atmfAtmLayerMaxVpiBits and
++ atmfAtmLayerMaxVciBits (based on a patch by Uwe Dannowski)
++
++Other changes
++-------------
++
++ - ilmid: search for local IP address didn't consider LANE interfaces (lec*)
++ - consolidated most of the various calls to gethostbyname and friends into
++ text2ip (libatmd)
++ - corrected some glitches in net/sched/sch_atm.c (untested)
++ - removed debug/encopy, debug/endump, and debug/zndump from the distribution.
++ They were almost useless and caused problems with make depend
++ - SYMFILES in qgen/Makefile now determines location of atmsap.h at run time to
++ avoid problems when kernel headers are not in /usr/include/linux (reported
++ by Uwe Dannowski)
++
++
++Version 0.46 to 0.47 (6-OCT-1998)
++====================
++
++Bug fixes
++---------
++
++ - qgen didn't build for all UNI versions (fixed by Richard Gooch)
++
++New features
++------------
++
++ - ilmid: new option -u to set UNI version (3.0, 3.1, or 4.0). Only available
++ if compiled with -DDYNAMIC_UNI.
++
++Other changes
++-------------
++
++ - ilmid: getIpAddr: improved robustness and added debugging output
++
++
++Version 0.45 to 0.46 (5-OCT-1998)
++====================
++
++Bug fixes
++---------
++
++ - ENI and ZATM driver used to read IRQ directly from PCI configuration,
++ bypassing any fixups (reported by Richard Gooch)
++ - atmsigd.new: removed "Known bug" memory leak (when tracing)
++ - led/lec_ctrl.c: signalling bug fixed, max_sdu now has correct value instead
++ of 1 (by Heikki Vatiainen, reported by Josh Baratz <jbaratz@lucentctc.com>
++ and Wolfgang Platzer <wplatzer@iaik.tu-graz.ac.at>)
++ - lots of MPOA bug fixes and other changes, see atm/mpoa/CHANGELOG (by Heikki
++ Vatiainen)
++ - atmsigd reported "Q.2931.1" when configured to support Q.2963.1
++
++New features
++------------
++
++ - atmsigd.new now supports run-time configuration of the signaling protocol
++ version (via atmsigd.conf)
++
++Other changes
++-------------
++
++ - added 16W bursts to ENI burst size configuration (NB: 16W may actually be
++ *slower* than 8W)
++ - lec_ctrl.c: zeppelin now uses LE_REGISTER protocol when TLVs are associated
++ with client's MAC address (by Heikki Vatiainen)
++
++
++Version 0.44 to 0.45 (1-OCT-1998)
++====================
++
++Bug fixes
++---------
++
++ - ENI driver didn't do four-word bursts on RX for sizes < 8 words
++ - arequipad, atmarpd, bus, lecs, les, mpcd, sw_*, and zeppelin silently
++ ignored extra command-line arguments instead of complaining
++
++New features
++------------
++
++ - ENI: added configuration options to fine-tune burst sizes (in reponse to
++ incompatibility found by Dave Airlie)
++
++Other changes
++-------------
++
++ - changed the way how ATM-specific data is stored in skbs. Tentatively updated
++ the the stack, including drivers. Use CONFIG_ATM_SKB to enable the new-style
++ skbs.
++ - Rules.make no longer discards the previous value of LDLIBS
++ - sw_tcp now only establishes bi-directional VCs if both directions are really
++ requested in the QoS structure
++ - moved manual switch control from sw_tcp to the generic switch code; "tcpswc"
++ is now called "swc", the corresponding switch.conf clause is now
++ 'control <path>' instead of 'option control "<path>"'
++
++
++Version 0.43 to 0.44 (24-SEP-1998)
++====================
++
++Bug fixes
++---------
++
++ - CONNECT messages no longer contain the AAL type IE if EP ref is present and
++ non-zero (reported by Heikki Vatiainen)
++ - SSCOP: added mode for partial compatibility with Q.SAAL1 (to get rid of
++ warnings reported by Heikki Vatiainen and of interoperability problems with
++ Virata switches reported by Damian Gilmurray)
++ - ilmid now returns a valid response for atmfMyIpNmAddress (by Uwe Dannowski)
++ - configuration on-line help for CLIP didn't work because tag was different
++ from configuration variable
++ - atmsigd crashed when adding multiple local addresses on an interface
++ (reported by Heiko Krupp)
++ - atmaddr.8 said "ATMARP" in the header (reported by Hans Einsiedler)
++ - net/atm/misc.c didn't include linux/config.h and linux/module.h, causing
++ symbols to be missing when rebuilding the kernel after enabling modules
++ (reported by Thomas Parvais)
++
++New features
++------------
++
++ - new maintenance utility tcpswc to control sw_tcp "switches" (description at
++ the end of switch/tcp/README)
++ - added support for setting the CLP bit (untested; see doc/README.CLP)
++ - added support for policing to the ATM qdisc (untested; see extra/tc/README)
++ - ilmid: added support for atmfAtmLayerUniVersion (by Uwe Dannowski)
++
++Other changes
++-------------
++
++ - updated the NICStAR driver to version 008b (by Rui Prior)
++ - new switch fabric function fab_option to pass configuration options
++ - atm2text now also supports unspecified and wildcard components in PVC
++ addresses
++ - added configuration option CONFIG_ATM_CLIP_NO_ICMP to discard packets for
++ which no ATMARP entry exists silently instead of sending an ICMP (this is an
++ ugly hack-around for the revalidation problem reported by Gerald Hanusch)
++ - various minor documentation updates
++ - atmarpd now sends InARP requests when active VC setup completes in order to
++ tell the peer our IP address(es)
++
++
++Version 0.42 to 0.43 (21-AUG-1998)
++====================
++
++Bug fixes
++---------
++
++ - trying to use atmtcp when compiled as a module with the module not loaded
++ crashed the kernel
++
++New features
++------------
++
++ - upgraded to the 2.1.117 kernel
++ - included NICStAR driver by Rui Prior at INESC (this driver also includes
++ parts of an earlier driver written by Matt Welsh, then enhanced by R. D.
++ Rechenmacher and Jawaid Bazyar)
++ - new atmsigd with support for multiple signaling entities (experimental)
++
++Other changes
++-------------
++
++ - removed register dumping code from suni.c (leaked out into the distribution)
++
++
++Version 0.41 to 0.42 (19-AUG-1998)
++====================
++
++Bug fixes
++---------
++
++ - atm.patch was out of sync again :-(
++
++
++Version 0.40 to 0.41 (19-AUG-1998)
++====================
++
++Bug fixes
++---------
++
++ - 0.40 contained an older atm.patch than the one that was supposed to go with
++ it (some changes to sch_atm and MPOA were missing)
++ - kernel didn't build with LANE enabled and MPOA disabled (fix by Mitchell
++ Blank Jr)
++
++New features
++------------
++
++ - MPOA now also supports CBR SVCs (by Heikki Vatiainen and Sampo Saaristo)
++
++Other changes
++-------------
++
++ - atmtcp may work as a module (untested)
++ - kernel code now uses capabilities instead of suser()
++ - removed obsolete recycle_buffer code
++ - distribution now also includes mkpatch, the script that's used to create
++ atm.patch
++
++
++Version 0.39 to 0.40 (13-AUG-1998)
++====================
++
++Bug fixes
++---------
++
++ - ilmid defined the value of "invalid" as 0 instead of 2 (fix by Timo
++ Parnanen)
++ - bash-2 doesn't like for n in $(SUBDIR); ... if SUBDIR is undefined (fix
++ by Heikki Vatiainen)
++ - LANE still cleared ATM_VF_RELEASED instead of calling atm_async_release_vcc,
++ which apparently led to stray kernel crashes in signaling (found with a lot
++ of help from John McPherson)
++ - ATM qdisc now properly re-allocates skb memory to grow headers, if necessary
++ - atm/switch/Makefile didn't build SUBDIRS
++ - atmarpd sent garbage ATM addresses in InARP responses over PVCs (reported by
++ Stefan Keller-Tuberg)
++
++New features
++------------
++
++ - MPOA (Multi-Protocol Over ATM) client support written by Heikki Vatiainen
++ and Sampo Saaristo
++ - LANE client (zeppelin) now also supports LANE2 (by Heikki Vatiainen)
++
++Other changes
++-------------
++
++ - accept() now also returns on ATM_VF_CLOSE
++ - ATM qdisc now uses the same data format on rtnetlink as other qdiscs; new
++ option for user-provided headers
++ - atm/switch can now use "external" routing (e.g. provided by the fab control)
++
++
++Version 0.38 to 0.39 (4-AUG-1998)
++====================
++
++Bug fixes
++---------
++
++ - added missing #include <atm.h> in tcpsw.c (fixed by Heikki Vatiainen)
++ - atmsigd allowed both sides to initiate PCR modification; Q.2963.1 only
++ allows the connection owner (i.e. the caller) to do this
++ - atmarpd no longer tries to use incoming SVCs with zero backward bandwidth
++ for ATMARP
++ - ENI and ZATM drivers didn't invoke vcc->pop on dev->ops->send failure
++ - make install didn't probe correctly for presence of /usr/include/stdint.h
++ (needed on GLIBC 1 systems)
++ - net/atm/resources.c didn't export bind_vcc to modules (fix by Oliver
++ Frommel)
++ - net/arpd/atmarp didn't build without make depend (reported by Stefano
++ Giacometti)
++ - clip_mkip zeroed vcc->rx_inuse and didn't take into account that clip_push
++ calls atm_return, which subtracts from vcc->rx_inuse too
++ - fixed typos in qgen/uni.h (and msg.fmt) for causes 38, 41, and 43
++ - atmsigd wrote exit trace to stderr when it had a dump directory and vice
++ versa
++ - documentation still claimed that atmtcp yields messages at boot time
++
++New features
++------------
++
++ - added flow to ATM VCC mapping queuing discipline (experimental)
++ - module for setting up ATM PVC/SVC mappings with "tc" in extra/tc (see
++ extra/tc/README)
++ - atmarpd: new request type art_query to request resolution without VC setup
++ - atmarp: new undocumented option -Q to test art_query
++ - added ATMTCP interfaces that survive disconnects (persistent; new atmtcp(8)
++ options -p and -r; new ioctls ATMTCP_CREATE and ATMTCP_REMOVE)
++
++Other changes
++-------------
++
++ - zeppelin didn't explicitly set the AAL type for outbound connections (by
++ Heikki Vatiainen)
++ - CLIP also allows SVCs to have no idle timeout at all (timeout = 0)
++ - moved SUNI private ioctls (SUNI_GETLOOP and SUNI_SETLOOP) from
++ drivers/atm/suni.h to include/linux/atm_suni.h
++ - atmarpd now shows QoS information for VCs where it differs from the default
++ or where no default is applicable
++ - removed the file atm/WARNING, which gave an overly pessimistic perspective
++ of the state of things
++ - switch: fab_op now returns the cause value plus (optionally) a pointer to
++ diagnostics in the callback instead of a simple okay/not okay indication
++ - updated and corrected the atmtcp man page
++ - further cleanup of the build procedure
++ - README now mainly refers to http://lrcwww.epfl.ch/linux-atm/info.html
++ - updated and trimmed BUGS
++ - added a note to CREDITS indicating its obsolescence
++
++
++Version 0.37 to 0.38 (25-JUN-1998)
++====================
++
++Bug fixes
++---------
++
++ - fixed the remaining few #include <linux/atm.h>
++ - invoking fcntl() or socketpair() on an ATM socket caused an "Oops" (reported
++ by Jonathan Chan)
++ - CLIP PVCs caused an "Oops" when cat'ing /proc/atm/pvc (reported by Marko
++ Kiiskila and Robert Olsson)
++ - atm/qgen/default.nl wasn't removed after build failure
++ - debugging switch (sw_debug) did not stop operations after the first error
++ - svc_accept returned apparent success instead of -EAGAIN, usually leading to
++ a later -ENOTCONN
++ - ttcp.c didn't initialize port_name, leading to erratic behaviour when making
++ slight changes to the build process
++ - atm_pdu2truesize diverged from alloc_skb, leading to sudden failure of VCs
++ or of ATMARP (reported by Robert Olsson)
++ - corrected use of '~' when applied to unsigned longs representing memory
++ addresses in aread, ENI, and ZATM (reported by Wai-Sun Chia)
++ - atmtcp and LANE didn't use bind_vcc when setting up control VCs
++ - atmtcp got ENOMEM/EBUSY wrong when failing to create an interface
++ - sig level <level> in atmsigd.conf didn't affect UNI diagnostics
++
++New features
++------------
++
++ - upgraded to the 2.1.105 kernel
++ - added ATMTCP "switch" in atm/switch/tcp
++ - atmtcp: new mode -s to connect to an ATMTCP "switch"
++ - atmtcp: new option -d for debugging output
++ - added -b option (the usual "background") to switch/relay.c
++
++Other changes
++-------------
++
++ - changed "PDU" to "SDU" in the atmtcp(8) man page
++ - atmarpd now includes the interface netmask in ATMARP table dumps
++ - added ATM devices also to the Alpha architecture, because at least ATMTCP
++ works (by Wai-Sun Chia)
++ - added the removal of -Wmissing-prototypes to the 0.37 changes
++ - removed -Wcast-align from Rules.make because of a conflict with
++ /usr/include/socketbits.h of glibc 2 on Alphas (reported by Wai-Sun Chia)
++ - atmsigd.conf.4: documented that debug log stderr works too
++ - sap_equal now also allows wildcard matches for BHLI (with SXE_COMPATIBLE)
++ - atmsigd now uses -m <mode> instead of -N and -A
++ - atmsigd.conf now uses sig mode <mode> instead of sig net
++
++
++Version 0.36 to 0.37 (6-JUN-1998)
++====================
++
++Bug fixes
++---------
++
++ - lib/atm.h defined AF_ATMPVC to 20, but the correct value is 8. Likewise,
++ AF_ATMSVC should be 20, not 21. (Reported by Luke Diamand)
++ - fixed bad ASN encoding in ilmid (by Vesa-Matti Puro)
++ - make install and make instdirs didn't stop on error
++
++New features
++------------
++
++ - upgraded to the 2.1.104 kernel
++ - included a script to demonstrate the debug switch (see switch/debug/README)
++
++Other changes
++-------------
++
++ - moved definitions not used by the kernel from linux/atmarp.h to atmarp.h
++ - removed linux/atm_stdint.h (linux/types.h has now caught up)
++ - changed ENI and ZATM driver to use new PCI interface
++ - net/atm/clip.c no longer uses ether_setup (suggested by Alexey Kuznetsov)
++ - more header file cleanup (main change: applications should now
++ #include <atm.h> instead of #include <linux/atm.h>)
++ - removed -Wmissing-prototypes from Rules.make because of a conflict with
++ include/linux/byteorder/swab.h
++
++
++Version 0.35 to 0.36 (23-APR-1998)
++====================
++
++Bug fixes
++---------
++
++ - changed the numeric values of PF/AF_ATMPVC/SVC and SOL_ATM/AAL to avoid
++ conflicts with other allocations. This breaks binary compatibility with
++ ATM programs compiled under older kernels
++ - RESTART ACK was sent with the wrong class when acknowledging the restart of
++ the indicated virtual channel (fix by Mohsen Souissi)
++ - RELEASE was retransmitted forever (to avoid having to perform a RESTART),
++ although it's sufficient to retransmit once and then drop the connection
++ - esi.c checked the kernel version code without including linux/version.h
++ - CLIP changes magically fixed hangs on SICGIFCONF (reported by Wayne Salamon)
++ - atmsigd usually didn't set pvc.sap_family in ISP messages
++
++New features
++------------
++
++ - added build-time option -DTHOMFLEX to send RESTART when SAAL comes up, which
++ works around a bug in some Thomson Thomflex 5000 switches (by Mohsen
++ Souissi)
++ - atmtcp: new option "-i itf" to request a specific interface number
++ - the "debug switch" (switch/debug/sw_debug) is now capable of successfully
++ signaling a UNI 3.x call (see switch/debug/README for details)
++
++Other changes
++-------------
++
++ - atm_equal can now also compare PVC addresses. The argument type has
++ therefore been changed from struct sockaddr_atmsvc * to struct sockaddr *
++ - moved driver-private data from skb->atm.* into skb->cb
++ - complete redesign of communication between atmarp(8) and atmarpd(8) (now
++ uses a UNIX domain socket; suggested by Alexey Kuznetsov)
++ - atmarp -a now also produces correct output if atmarpd is running with -d
++ - removed clip(8)
++ - moved atmarp(8) from atm/ip into atm/arpd, removed atm/ip
++ - /proc/atm/svc shows listening sockets again
++ - cleaned up a few cases where diag(...,DIAG_FATAL,...) was followed by an
++ "else" or a "return".
++ - atmsigd now uses Unix domain sockets (instead of named pipes) to communicate
++ with non-kernel ISP users (updated test/isp too)
++ - net/atm/resources.c:atm_dev_register can now be asked to assign a specific
++ interface number (-1 yields the old behaviour)
++
++
++Version 0.34 to 0.35 (27-MAR-1998)
++====================
++
++Bug fixes
++---------
++
++ - ilmid compared memcmp results with -1,1, which fails under optimization
++ (fixed by Damian Gilmurray)
++ - various fixes and cleanup in how CLIP interacts with the neighbour cache
++ (spotted by Alexey Kuznetsov)
++ - Rules.make complained about missing "optprocess" command on some occasions
++
++New features
++------------
++
++ - upgraded to the 2.1.90 kernel
++ - added some components for ATM switch control (not properly integrated yet,
++ so they don't do anything useful at the moment; written by Roman Pletka)
++
++Other changes
++-------------
++
++ - eliminated various compiler warnings when compiling with glibc2
++ - removed clip_hard_header (suggested by Alexey Kuznetsov)
++
++
++Version 0.33 to 0.34 (13-MAR-1998)
++====================
++
++Bug fixes
++---------
++
++ - eni.c didn't include config.h (fix by Pete Wyckoff)
++ - (yet another) VCC list handling bug (fixed by Heikki Vatiainen)
++ - kernel also applied idle timeout to CLIP PVCs
++ - make clean didn't remove test/errnos.inc
++ - atmsigd errored as_connect and as_accept with as_close instead of as_error
++ - eni: bandwidth was sometimes reserved for UBR VCs
++ - eni: checking of bandwidth changes was broken
++ - eni: error handling after failed bw change checks destroyed the free list
++ - test/errnos.inc sometimes wasn't generated because of mtime granularity (fix
++ by Brian Armstrong and Corinne Rosier)
++ - fixed use of return code of get/put_user and copy_from/to_user
++ - kernel: fixed a few minor race conditions
++ - ATM_GETADDR left address list locked on fault
++ - maximum length of high layer information was 7 bytes instead of 8 for ISO
++ and User Specific high layer information (reported by Damian Gilmurray)
++ - some tools didn't include errno.h although they use errno or Exxx
++ - atmsigd usually accessed deallocated memory when writing traces, which
++ sometimes led to crashes (reported by Heikki Vatiainen)
++ - indentation of the first two lines of UNI signaling messages in traces was
++ missing
++ - LANE: duplicate data direct connections to entities where we already
++ have a connection are now forbidden. LES and BUS can now co-reside.
++ (Reported by Jean-Francois Moine, fixed by Heikki Vatiainen)
++ - LANE: plugged a file descriptor leak (by Heikki Vatiainen)
++ - atmsigd.conf.4 incorrectly stated that diagnostics must have a higher
++ priority than the specified level to get printed (they're also printed if
++ their priority is equal to that level)
++ - zatm driver didn't virt_to_bus the back pointer of TX rings, leading to
++ crash after sending the 32nd PDU of a VCC (reported by Ajay Bakre)
++ - zatm_feedback sometimes returned with interrupts disabled
++ - ENI driver didn't treat requests for UBR at link speed as "unlimited" and
++ allocated one shaper for each such VCC
++ - atm_async_release_vcc now has its own flag ATM_VF_CLOSE. Overloading
++ ATM_VF_RELEASED caused hung SVCs under some conditions.
++ - atmsigd sometimes released listening sockets before kernel completed its
++ cleanup, yielding warnings and zombies
++ - atmsigd accessed already deallocated data structures when handling
++ unparseable signaling messages
++
++
++New features
++------------
++
++ - upgraded to the 2.1.79 kernel
++ - CLIP now handles NETDEV_CHANGE (proposed by Pete Wyckoff; untested)
++ - various minor signaling changes for operation as switch control
++ - new device operation proc_read: device drivers can now register in /proc
++ (e.g. /proc/atm/eni:0)
++ - added some more BHLI definitions to include/atmsap.h, including draft
++ mapping of well-known TCP/UDP port numbers
++ - added support for TIOCOUTQ/TIOCINQ on native ATM
++ - new library function sap_equal
++ - added convenience function atmpvc_addr_in_use to linux/atm.h
++ - major overhaul of "isp", which is now a good tool for signaling regression
++ tests. See atm/test/README.isp
++ - LANE can now be compiled as a kernel module (by Heikki Vatiainen)
++ - new tool debug/svctor.c to torture signaling by setting up and releasing
++ lots of SVCs (see the source for details)
++
++Other changes
++-------------
++
++ - cleaned up the copying terms: libraries are now covered by LGPL instead of
++ GPL and qgen doesn't "taint" the code it generates
++ - atmarpd: IP addresses are now __u32 instead of unsigned long
++ - atmarpd: changed printf("... %08x ...",(unsigned long) ptr) to %p ...",ptr
++ - /proc support now allocates inode numbers dynamically
++ - added comment to clarify motivation for useless buffer alignment in aread.c
++ (reported by Jeon Jong Hwan)
++ - suni.c and uPD98402.c: SONET_GETSTATZ no longer clears the statistics if the
++ copy faults
++ - ilmid should now work on any interface (patch by Heikki Vatiainen)
++ - changed all __uNN of tools to uintNN_t for glibc2-compatibility
++ - added stdint.h to lib for compatibility with future versions of glibc2
++ - various other evil hacks in tools to make things compile with glibc2
++ - the NIC debugging programs ed, encopy, endump, zndump, and znth are no
++ longer built and installed by default
++ - for compatibility with POSIX 1003.1g, accept now returns ECONNABORTED
++ instead of ECONNREFUSED if connection is already gone (proposed by Heikki
++ Vatiainen)
++ - listening sockets now return instantly if the signaling demon dies
++ - various minor LANE updates to track API changes (by Heikki Vatiainen)
++ - SUNI now also warns if signal is missing at initialization time
++ - zatm: added work-around for unfair buffer space accounting
++ - clarified some of atmarpd's diagnostics
++ - documentation updates
++
++
++Version 0.32 to 0.33 (19-NOV-1997)
++====================
++
++Bug fixes
++---------
++
++ - SSCOP did poll sequence number comparisons in the (data) sequence number
++ space, typically leading to periodic SSCOP restarts (reported by Heikki
++ Vatiainen)
++ - atmsigd now releases calls on receipt of STATUS with call state 0 (reported
++ by Heikki Vatiainen)
++ - qgen tried to print the names of unnamed groups (fix by Simon Leinen)
++ - make clean in qgen left all the .c and .h files produced by qgen
++ - minor fixes to signaling message format description (qgen/msg.fmt,
++ previously qgen/uni*)
++ - /usr/include/atm.h was calling itself "atmlib" (found by Leena Chandran)
++ - atmsigd: the address format of the calling party number was used to
++ determine the format of the called party number in a SETUP message
++ - added some semicolons to Rules.make for bash 2.0 compatibility (by Tan Chang
++ Hu and Rolf Kunisch)
++ - select/poll indicated an exception when a non-blocking connect terminated.
++ Now it indicates writability, and an error only if the connect failed.
++ - LES/BUS can now co-exist at the same address (by Heikki Vatiainen)
++ - fixed race condition between asynchronous release (e.g. on ATMARP idle timer
++ expiration) and signaling demon response
++ - fixed a typo "[itf]." instead of "[itf.]" in atmsigd.conf.8
++ - "ATM drivers" kernel configuration section is no longer a top-level menu
++ item but it's now under "Network devices"
++ - sigd_close forgot to purge VCs not connected to devices (e.g. closing ones),
++ so they hung
++ - the list of unconnected VCs was sometimes garbled
++ - atmsigd printed null string for as_itf_notify message name when debugging
++ - Arequipa: check_aq_vcc also accepted VCs that were already released by
++ signaling
++ - ATM_VF_PARTIAL and ATM_VF_BOUND had the same value
++ - atmaddr still used old calling convention of ATM_GETNAMES
++ - the atmarpd man page referred to atmarpd as "atmsigd"
++ - various atmtcp bug fixes
++ - atm_recvmsg sometimes returned with interrupts disabled (reported by Pete
++ Wyckoff)
++ - fixed ttcp_atm dependencies (.depend contains dependencies for "ttcp.o")
++ - UNI message format: "more" was missing for def_pck_size
++ - eni/suni didn't compile as modules (fixed by Pete Wyckoff and Ladislav
++ Lhotka)
++ - further net/atm/Makefile cleanup
++ - arequipa_close always left the socket with arequipa_expect enabled. Now it
++ returns it to the previous state.
++ - ENI driver was leaking buffer memory on failure of set_tx
++ - atmarpd didn't print symbolic names of "new" flags (ATF_ARPSRV, etc.)
++ - ATM ARP server didn't make client entries public (reported by Tom Mahieu)
++ - drivers/atm/Config.in had extra "endmenu" (fixed by Ladislav Lhotka)
++ - atmarpd got confused when receiving InARP reply without source ATM address
++ - atmsigd sometimes didn't stop timers if Q.2963.1 wasn't enabled
++ - when rejecting a call, the kernel freed the VCC twice
++
++New features
++------------
++
++ - merged source tree (except Arequipa, single-copy, and various NIC drivers)
++ with 2.1.65-Linus tree
++ - qgen can now handle repeated information elements
++ - added ATM_SETESI[F] ioctl and esi utility (boards without a real ESI in ROM
++ should now set the default ESI to 0x000000000000)
++ - new socket option SO_ATMSAP along with struct atm_sap (using a fixed-size
++ BLLI array instead of the linked list in struct sockaddr_atmsvc)
++ - added Q.2963.1 PCR modification in signaling and the ENI driver
++ - aread: new option -c to print received data as characters (similar to od -c)
++ - new tool test/align to test handling of mis-alignment in NIC drivers
++ - atmsigd now supports policy restrictions for incoming/outgoing calls (see
++ atmsigd.conf.4, "policy")
++ - atmsigd can now also use a pair of named pipes (or, actually, any named
++ object in the file system) for communicating with the user of signaling
++ (normally the kernel)
++ - new tool called "isp" (for "Internal Signaling Protocol") to talk ISP with
++ atmsigd over named pipes
++ - new functions sap2text and text2sap to converts SAPs to/from textual
++ representation, and a sap(7) man page
++ - new traffic parameter field "pcr" to indicate the desired PCR. min_pcr and
++ max_pcr can the be used to indicate the acceptable range.
++ - new function atm_pcr_goal to help drivers to interpret traffic parameters
++
++Other changes
++-------------
++
++ - removed some more obsolete CLIP-related ioctls
++ - qgen: simplified generation of engines with a prefix other than "q" or "qd"
++ - ENI and ZATM drivers now use shareable interrupts
++ - cleaned up some 32bit-isms in ENI driver
++ - cleaned up several 32bit-isms in SSCOP (reported by Tan Chang Hu)
++ - SSCOP: work-arounds for buggy ntohl prototype in some early versions of
++ glibc (reported by Tan Chang Hu, further explored by David S. Miller and
++ Richard Henderson)
++ - started updating the ZATM driver for 2.1 (still crashes under load)
++ - added missing 2.1 pieces in ENI's SUNI driver
++ - added __initfunc and __initdata where appropriate
++ - tools tree now compiles under 0.31 (2.0.25 kernel) and 0.33 (2.1.55 kernel)
++ - gratuitous improvement of identifier tree allocation in qgen
++ - the interface number is now optional for sonetdiag (like for atmdiag)
++ - started implementing the kernel side of point-to-multipoint signaling
++ support
++ - /proc/atm/arp now displays "resolving" or "expired" (with the number of
++ times the entry is referenced) instead of "incomplete".
++ - moved ATM_MAX_BLLI from linux/atm.h to linux/atmsap.h
++ - changed ttcp_atm to use SO_ATMSAP (if available) to set BHLI
++ Note: ttcp_atm previously didn't use a BHLI, so old and new versions of
++ ttcp_atm don't interoperate.
++ - updated all other programs using SAPs too, except for LANE
++ - ENI: failure to allocate a traffic shaper now yields EBUSY instead of EAGAIN
++ - instead of just complaining, the ENI driver now handles all kinds of
++ mis-alignment in the TX path properly
++ - re-implemented send and receive side of Arequipa
++ - merged qgen/uni3x and qgen/uni40 into msg.fmt
++ - added missing Q.2931/UNI 4.0 items to qgen/q2931.h and msg.fmt
++ - also added BLLI L3 H.310 codepoint with related encodings
++ - various file name and identifier changes to give a more appropriate name
++ (e.g. "uni" or "call") to something that's never been Q.2931
++ - added library dependencies
++ - atmsigd produces more readable and usually more comprehensive debugging
++ output
++ - atmsigd.conf.4 now mentions that -d is the debugging output addict's choice
++ - all programs accepting -l syslog now also accept -l stderr. (This is useful
++ for atmsigd if atmsigd.conf sets logging to something else.)
++ - atmsigd now issues ATM_GETADDR ioctls on the signaling socket, not on the
++ kernel socket
++ - WARNING: text2qos: "pcr" is no longer a synonym for "max_pcr" !
++ - text2qos now refuses min_pcr=max
++ - device driver interface: removed vcc->peek; device drivers now choose their
++ own allocation strategy (change motivated by bug report from Furquan Ansari)
++ - drive driver interface: new helper functions atm_charge/atm_return to handle
++ buffer space allocation
++ - device driver interface: vcc->push no longer allocates buffer space. This is
++ now done by the driver, via atm_charge
++ - updated eni, zatm, and atmtcp to use the new mechanism
++ - zero padding in eni driver failed due to mis-alignment on some systems
++ (fixed by Pete Wyckoff)
++ - various compiler warnings removed (by Pete Wyckoff)
++ - removed support for pre-AREQUIPA_WORK mechanism
++ - arequipa close mechanism cleanup
++ - further cleaned up QOS parameter checking
++ - new ISP message as_identify for parallel call processing (not supported yet)
++ - zatm: renamed struct zatm_thist to struct zatm_t_hist after wondering
++ myself what on earth "this t" could be ...
++ - doc/Makefile now invokes dvips with -o
++
++
++Version 0.31 to 0.32 (10-JUL-1997)
++====================
++
++Bug fixes
++---------
++
++ - manipulation of local ATM addresses didn't check for permission
++
++New features
++------------
++
++ - ilmid now supports the system group and a couple of ILMI MIB objects (by
++ Scott Shumate)
++ - device and VCC allocation is now dynamic
++ - E.164 addressing support and corrections to address coding in uni3x/uni40
++ (by S. A. Wright, T. C. Jepsen, and Z. Zhang)
++ - support for device de-allocation via per-device operation dev_close
++
++Other changes
++-------------
++
++ - upgrade to kernel version 2.1.37
++ - ENI driver cleanup (uses readl/writel, skb_put, etc.)
++ - socket option handling has changed: optval is now void * (to improve
++ compile-time type checking) and optlen is int (not int *) in getsockopt
++ - socket option "names" now encode the level and the size (based on an idea of
++ Elwyn Davies)
++ - cleaned up some of the #includes in net/atm/proc.c
++ - total rewrite of ATMTCP (now the data forwarding is done in user space,
++ which makes things slower but a lot more flexible)
++ - separated PDU parsing and printing from SSCOP state machine
++ - new per-device operation dev_close to shut down devices
++ - changed a few DIAG_WARNs to DIAG_INFO in ilmid
++
++Removed features
++----------------
++
++ - polled ATM devices are no longer supported
++ - CLIP is gone (use ATMARP instead)
++ - Arequipa and LANE don't work yet (will come back later)
++
++
++Version 0.30 to 0.31 (22-APR-1997)
++====================
++
++Bug fixes
++---------
++
++ - atmarpd even refused IP address changes by the ATMARP server, which
++ typically led to the creation of one extra SVC
++ - ATMARP timeouts were computed at the wrong place (found by Gerald Hanusch)
++ - aqtest's usage didn't mention the -v option
++ - some tools used 0x%p instead of %p (which is fine in the kernel, by the way)
++ - skb_migrate didn't update skb->list
++ - zeppelin: incurred spurious core dumps on unsuccessful attempts to connect
++ to LANE servers, ESI parsing from command line seg faulted, obtaining ESI
++ from NIC left an ATM socket hanging, man page didn't describe all options
++ (by Marko Kiiskila and Heikki Vatiainen)
++
++Other changes
++-------------
++
++ - arequipa_close now only returns after the Arequipa connection has been
++ successfully closed. This allows applications to reliably close and
++ re-create Arequipa SVCs, e.g. to change the traffic parameters.
++ - the arequipad operations 3rd party close and synchronization are now handled
++ inside the kernel and survive arequipad restarts
++
++
++Version 0.29 to 0.30 (10-APR-1997)
++====================
++
++Bug fixes
++---------
++
++ - atmtcp didn't use vcc->push and therefore got the buffer usage accounting
++ wrong (fix by Gerald Hanusch)
++ - when closing a VC, the ENI driver didn't wait until all TX data has really
++ left the board, which created a close/open race (found by Richard Jones)
++ - SSCOP sometimes omitted the last element in a STAT PDU (fix - even with
++ optimization vs. Q.2110 - by Ngo Bach Long)
++ - atmarpd allowed ARP information to change permanent entries (found by Gerald
++ Hanusch)
++ - atmsigd's get_pvc used the maximum SDU size, thereby wasting buffer space
++ very quickly, which led to signaling problems (reported by Richard Jones and
++ Rik Wade)
++ - oops, the BUGS file was always one version number ahead
++ - ATMARP had a race between packets sent by the remote station and the
++ ATMARP_MKIP ioctl. This caused the dreaded "unknown hw protocol 0xaaaa"
++ error. (Finally fixed thanks to a dump provided by Patrick Flynn)
++ - Arequipa had the same race for AREQUIPA_INCOMING. This probably caused the
++ occasional "loss" (they were actually kept in vcc->recvq until the
++ connection was closed) of the first packet(s).
++
++
++Version 0.28 to 0.29 (4-APR-1997)
++====================
++
++Bug fixes
++---------
++
++ - saal/sscop.c: NORMALIZE macro was weird and broken (fix by Ngo Bach Long)
++ - InARP queries didn't contain the target ATM address, even if it is known,
++ which stretches the allowances RFC1577 makes for violating RFC1293 (found
++ by Juha Heinanen)
++ - tcp_conn_request: Arequipa modification to MTU size calculation used wrong
++ socket (fix by Gerald Hanusch)
++ - kernel ATMARP table handling had some obscure races
++ - temporary work-around: added A2T_LOCAL when using A2T_NAME in atmsigd and
++ atmarpd. Before, systems using ANS where the name server is reached via (IP
++ over) ATM exhibited truly bizarre failure patterns when refreshing ATMARP
++ entries. (With a lot of help from Juha Heinanen)
++ - ditto for arequipad, although the effects were less dramatic
++ - atmarpd: if not using -m, incoming connections for which a valid entry
++ already existed (e.g. due to manual configuration) were not entered in the
++ kernel ATMARP table until after the entry timed out for the first time (by
++ Gerald Hanusch)
++ - skb data areas are now aligned using skb_reserve instead of directly
++ tampering with skb->data (and forgetting skb->tail in the process ...)
++ (found by Uwe Dannowski)
++
++New features
++------------
++
++ - atmarpd is now automatically notified of IP over ATM interfaces already
++ existing at startup. This greatly simplifies the atmarpd restart ritual.
++ (All ATMARP table entries and the default QoS are still lost, though.)
++
++Other changes
++-------------
++
++ - cleaned up some weird and partially dead code in arpd/arp.c (found by
++ Gerald Hanusch)
++ - removed superfluous continue in arp.c:atmarp_setentry
++ - device-driver specific declarations now reside in
++ /usr/include/linux/atm_<drv_name>.h, so that disgusting hacks like
++ #include "/usr/src/linux/..." can be avoided (based on proposal by Uwe
++ Dannowski)
++ - updated the list of supported NICs in README and the on-line help
++ - arpd/atmarpd.8: documented that atmarpd -m may violate RFC1577 in subtle
++ ways (pointed out by Gerald Hanusch)
++ - updated MPR usage description to version 1.5 and removed mpr.patch
++ - removed MEM_DEBUG from the build process (MPR 1.5 initializes itself
++ automatically)
++
++
++Version 0.27 to 0.28 (27-MAR-1997)
++====================
++
++Bug fixes
++---------
++
++ - atmarpd restarted timers on as_valid -> as_valid transitions, illegally
++ delayed necessary refreshes (reported by Juha Heinanen)
++ - SSCOP cleared POLL timer on IDLE timer expiry (fix by Ngo Bach Long)
++ - atmsigd didn't initialize "now" soon enough, causing an unnecessary
++ retransmission of the first BGN PDU (by Ngo Bach Long)
++ - atmsigd responded to RELEASE COMPLETE in ss_rel_ind with a STATUS instead of
++ entering ss_wait_close (by Steve Pope)
++
++New features
++------------
++
++ - new tool aqpvc to declare incoming Arequipa traffic on a PVC to the system
++ (caveat: removing such a PVC can turn out to be surprisingly difficult)
++
++Other changes
++-------------
++
++ - removed some useless code in atmarpd's handling of VC disconnects
++ - removed unused signaling state ss_hold (equivalent to ss_wait_rel)
++
++
++Version 0.26 to 0.27 (11-MAR-1997)
++====================
++
++Bug fixes
++---------
++
++ - oops, forgot to include atm/lib/rtf2e164_cc.pl in the distribution
++ - atmsigd's VCI allocation in -N mode was too simplistic and failed after some
++ signaling activity (reported by Richard Jones)
++ - atm_connect was rejecting ATM_{VPI,VCI}_ANY
++ - aq_prev in the list of Arequipa connections wasn't set properly, leading to
++ random crashes when using Arequipa (found and fixed by Richard Jones, after
++ weeks of tearing his hair out)
++ - arequipa_close didn't remove the Arequipa route, which kept the upper layer
++ protocol connection alive for a rather long time (reported by Richard Jones)
++
++New features
++------------
++
++ - ilmid enhancements: vastly improved retry mechanism, workaround for a bug in
++ the ATML Virata switch, -v option for very detailed debug output (Scott
++ Shumate)
++ - atmsigd now also accepts the signaling VC as a command line argument
++ - qos2text appended colon to traffic type even if nothing else followed
++ - new program debug/aqtest to test Arequipa (based on work by Mehdi Tazi)
++
++Other changes
++-------------
++
++ - added a few missing NULLs to struct atmdev_ops initialization in various
++ drivers (this change does not alter any semantics)
++ - changed printk ...%lx... (unsigned long) ptr to ...%p... ptr at many
++ places
++ - removed atm/lib/rtf2cc.pl and atm/lib/cc.inc (they were only used by an
++ interim version of cc_len)
++ - atmarp's usage no longer contains lines longer than 80 characters
++ - added get_logfile() and get_verbosity() to libatm (for ilmid, by Scott
++ Shumate)
++ - select() consumed CPU time unnecessarily if testing for one direction while
++ there's a lot of activity in the other direction (e.g. atmarpd wasted cycles
++ in select() for each outbound packet while waiting for ARP messages)
++ - the value of ATM_AAL0 has changed (from zero to 13), so all programs using
++ AAL0 need to be recompiled
++ - MAX_ATM_QOS_LEN has changed, so most programs using qos2text need to be
++ recompiled
++ - the AAL can now also be set along with the QoS parameters. This approach
++ should be used instead of specifying it in the socket() call.
++ - if no AAL is specified, the kernel now defaults to AAL5 (was AAL0)
++ - updated most demons, tools, and library functions to set the AAL along with
++ the QoS parameters
++
++
++Version 0.25 to 0.26 (29-JAN-1997)
++====================
++
++Bug fixes
++---------
++
++ - ATMARP VCCs could stay around forever even after timing out, because the
++ process was not woken up.
++ - the ATMARP "fix" in 0.25 introduced an infinite loop. Fixed that one too.
++ - bit 8 in octets 6 and 7 of BLLI ("ext") were set to 1 instead of 0 when
++ using ATM_L2_USER/ATM_L3_USER (reported by ukl2@rz.uni-karlsruhe.de)
++ - qlib added silly offset (which fortunately happened to be zero most of the
++ time) to dumps of large fields (fixed by Jean-Francois Moine)
++ - IP over ATM restricted MTU changes to valid Ethernet MTU sizes
++ - LANE: fixed two bugs that crashed zeppelin when the connection to the
++ servers failed (by Marko Kiiskila)
++
++New features
++------------
++
++ - lib/ans.c now properly computes the length of the country prefix of E.164
++ addresses for reverse lookups (needs file /etc/e164_cc, see USAGE)
++ - if the new -m option is set, atmarpd now merges incoming calls into the
++ ATMARP table if the ATM address is known (see atmarpd.8 for details)
++ - included an RPM spec file (this is still very experimental)
++ - NICStAR driver now also works with IP over ATM (by Stuart Daniel)
++ - usage.txt: added description of how to run ATM NICs back-to-back (by Richard
++ Jones)
++
++Other changes
++-------------
++
++ - signaling traces now also include SAAL up/down transitions
++ - qgen no longer (unnecessarily) depends on libatm.a
++ - started work on letting qgen handle items that appear at more than one
++ place, e.g. repeated IEs (after an idea by Jean-Francois Moine)
++ - did some cleanup and added comments to qlib.[ch]
++ - added -m option to atmarp in config/redhat-4.0/atm.init
++ - added new make target "filenames" to generate a list of all the files which
++ are installed
++ - config/redhat-4.0 now contains an example hosts.atm file and also a Makefile
++ for more convenient installation
++ - atmsigd now reads atmsigd.conf before parsing the command-line options,
++ thereby allowing values set in the file to be superseeded
++ - atmsigd now also logs the internal reference and the caller's address on
++ calls establishment
++ - ilmid: very dirty hack to give switches some time to process ILMI cold start
++ (by Joseph Evans)
++
++
++Version 0.24 to 0.25 (20-DEC-1996)
++====================
++
++Bug fixes
++---------
++
++ - net/atm/atmarp.c:idle_timer_check only expired every other entry (reported
++ by Marko Kiiskila)
++
++New features
++------------
++
++ - LANE now also supports IPX (SNAP and 802.3; by Marko Kiiskila)
++ - NICStAR driver now supports VPI != 0 and has configurable settings in
++ nicstar.h (by Stuart Daniel)
++
++Other changes
++-------------
++
++ - ENI: TX DMA scratch are is now stored per device. This should allow multiple
++ NICs to coexist.
++
++
++Version 0.23 to 0.24 (29-NOV-1996)
++====================
++
++Bug fixes
++---------
++
++ - atm/test/window.c was missing in 0.23
++ - atm/debug/delay didn't build unless atm/lib headers were already installed
++ in /usr/include
++ - atm/debug/znth had undefined return value
++ - SSCOP: fixed typo (that could probably kill the SSCOP connection in case of
++ a retransmission); fix by Olivier Bonaventure
++ - corrected unnecessarily large buffer allocation in zatm.c:pool_index (by
++ Jonathan Larmour)
++ - hosts2ans.pl generated reverse addresses for the domain "ATM.INT" instead of
++ "ATMA.INT"
++ - atmarpd "forgot" any pre-set QOS when receiving new ARP information for the
++ respective entry (reported by Gerald Hanusch)
++ - window scale didn't scale the window sent in the SYNACK packet (reported by
++ Juan-Antonio Ibanez)
++ - LANE: better connection failure handling in zeppelin (by Marko Kiiskila)
++ - LEC kernel timer wasn't restarted when restarting zeppelin (found by Gerald
++ Hanusch, fixed by Marko Kiiskila)
++ - LANE: le_flush_request was sent too early when establishing connection (by
++ Marko Kiiskila)
++ - zeppelin stopped operation (unwantedly) in random cases when LANE servers
++ were down (by Marko Kiiskila)
++ - LANE: non-blocking connections, VCC and LE ARP timeouts, and TLV fields in
++ LE_CONFIG_RESPONSE fixed (by Marko Kiiskila)
++
++New features
++------------
++
++ - atm2text now also uses ANS
++ - signaling traces now also contain error reports from qgen
++ - added new build-time configuration option "CISCO" (in atm/Rules.make) to
++ work around a bug in Cisco's point-to-multipoint signaling
++ - included example configuration files for RedHat 4.0 (see
++ atm/config/redhat-4.0/README)
++
++Other changes
++-------------
++
++ - local variable "link" in atm/debug/delay.c:loop was shadowing "link" system
++ call
++ - cleaned up various Makefiles
++ - qgen: bytes left in qet_space are now more meaningful
++ - named (ANS) now also starts even if atmsigd is not running and retries to
++ create the ATM socket in 15 minute intervals until is succeeds (by Marko
++ Kiiskila)
++ - LANE: (too) short le_flush_responses (Cisco 7010, sw ??.??) are now handled
++ (by Marko Kiiskila)
++
++
++Version 0.22 to 0.23 (16-NOV-1996)
++====================
++
++Bug fixes
++---------
++
++ - fixed stupid typos in atm/lib/atmres.h and an unnecessary dependency on
++ libresolv.a in atm/lib/Makefile (reported by Gerald Hanusch)
++ - fixed warning about implicit declaration of function bigphysarea_init in
++ init/main.c
++ - I think I fixed the SSCOP VR(MR) problems that were first reported by
++ Edouard Lamboray in '95, then by Heinz Schuerch, and that finally led to a
++ total SSCOP breakdown (in 0.22) reported by Gerald Hanusch
++
++New features
++------------
++
++ - integrated the IDT 77201 (NICStAR) driver by Matt Welsh and Stuart Daniel
++ <stuartd@eecs.umich.edu>. Note that this driver currently only supports
++ native ATM.
++ - new throughput and latency benchmark test/window (by Matt Welsh)
++
++Other changes
++-------------
++
++ - upgrade to kernel version 2.0.25
++ - changed drivers/atm/eni.c:do_tx:dma to static in order to reduce kernel
++ stack use (by 480 bytes). Note that this hack may crash systems with more
++ than one ENI adapter.
++ - qlib now also complains if changing a field without a fixed list of values
++ - made a few changes to the native ATM data delivery path to handle some
++ strangeness required by the IDT driver
++
++
++Version 0.21 to 0.22 (13-NOV-1996)
++====================
++
++Bug fixes
++---------
++
++ - (dummy) depend target was missing in atm/man (reported by Bernd Wolf)
++ - net/atm/arequipa.c:make_aq_vcc didn't set ATM_VF_AQINUSE, thereby allowing
++ race conditions to slip through
++ - fixed a few potential race conditions when activating Arequipa
++ - text2qos didn't complain if unit was omitted after multiplier, allowing
++ misleading settings like pcr=50M (that's 19.2 Gbps)
++ - SSCOP: took wrong branch if POLL_AFTER_RETRANSMISSION was enabled (fix by
++ Jonathan Larmour)
++ - SSCOP: rel_ind for ENDAK and BGREJ PDU in sscop_inconn was sent with "user"
++ = 1 (must be 0 for "Source := SSCOP")
++ - initialize_vr_mr now initializes vr_mr to a constant value (instead of
++ garbage plus constant value)
++ - atm_recvmsg now ignores msg->msg_name, as it should by POSIX 1003.1g (fix by
++ Mike Wooten)
++ - atm_sendmsg now fails with EISCONN instead of with EINVAL if msg->msg_name
++ is set, as it should by POSIX 1003.1g (reported by Mike Wooten)
++ - atm_recvmsg and atm_sendmsg now return ENOTCONN if not connected and
++ EOPNOTSUP if flags are passed, as they should by POSIX 1003.1g
++ - the QOS zeppelin uses for its connections can now be set with the option -q
++ - atmarpd didn't include the QOS in PVC entries, so atmarp -a complained about
++ them
++
++New features
++------------
++
++ - kernel changes to support tcpdump with LANE (by Marko Kiiskila)
++ - patch for tcpdump 3.0.4 (installed as tcpdump_atm) to support Classical IP
++ and LANE (by Marko Kiiskila)
++ - patch for BIND 4.9.5 to support ANS (ATM Name Service) functionality (by
++ Marko Kiiskila)
++ - added hierarchy extra/ for packages for which only patches are contained in
++ the ATM on Linux distribution
++ - enhanced text2atm to use ANS if local lookups fail (atm2text will be updated
++ later)
++ - wrote script extra/hosts2ans.pl to convert hosts.atm file to ANS zone files
++
++Other changes
++-------------
++
++ - changed ATM_VF_AQINUSE to ATM_VF_AQDANG and changed aq_list membership to
++ be for dangling VCs only
++ - added the new command-line options to ttcp_atm's online help (finally !)
++ - atm_sendmsg now returns error codes from the driver's send function
++ (suggested by Jonathan Larmour)
++ - text2qos now performs a syntax check if NULL is passed in the qos argument
++ - various minor LANE cleanup (Marko Kiiskila)
++ - upgraded to the latest version of t2a.pl
++ - {A2T,T2A}_REMOTE is obsolete; instead, {A2T,T2A}_LOCAL should be used if
++ ANS lookups are _not_ desired
++
++
++Version 0.20 to 0.21 (18-OCT-1996)
++====================
++
++Bug fixes
++---------
++
++ - net/atm/common.c:atm_connect didn't refuse traffic_class == ATM_NONE in both
++ directions
++ - include/linux/atmsvc.h:SELECT_TOP_PCR didn't default to ATM_MAX_PCR if
++ min_pcr == 0 && max_pcr == 0
++ - debug/delay swallowed one-byte packets
++ - oops, forgot man/Makefile, so qos.7 wasn't installed
++ - atmarpd left max_sdu at zero for automatically generated entries
++ - atmarpd now only uses the default QOS if the traffic type is set in neither
++ direction
++ - signaling: if the listen queue was full, new connections were rejected with
++ as_close instead of as_reject, thereby upsetting atmsigd
++ - svc_accept didn't adjust the listen queue quota when rejecting incoming
++ connection requests
++ - fixed a few bad font selections in atmsigd(8)
++
++New features
++------------
++
++ - included the window scale patch by Randy Scott <scottr@belle.bork.com> and
++ Robert Hill <rhill@tisl.ukans.edu>
++ - -q option for ilmid to set the QOS (like in atmsigd)
++ - new script mkbindist to install the utilities into a tar.gz file
++
++Other changes
++-------------
++
++ - debug/delay now prints the usage if invoked without arguments
++ - removed the pretentious usec resolution for delays in debug/delay
++ - removed the UBR semantics change warning
++ - qos.7: clarified that bps are the user data rate
++ - arequipa_attach_unchecked now also adjusts the upper layer MTU (which can
++ violate RFC1122, but I'll tackle that later)
++ - text2qos now also accepts fractional values, e.g. 9.6kbps
++
++
++Version 0.19 to 0.20 (14-OCT-1996)
++====================
++
++Bug fixes
++---------
++
++ - fixed a few typos and errors in the 0.18 to 0.19 change log
++ - signaling traces only included hl_type bytes instead of hl_length
++ bytes
++ - TNET1570 driver: various fixes (DMA allocation, seg ring overflow,
++ timeouts, etc.) (Christian Paetz)
++ - TNET1570 driver: removed most compiler warnings (Christian Paetz)
++ - listen() on an arequipa_preset() socket and arequipa_preset() on a listening
++ socket now both return EPROTO
++ - oops, forgot to enable the "rm" in make uninstall
++ - kernel didn't set interface number field in act_create messages to atmarpd
++
++New features
++------------
++
++ - added ioctl ATM_SETSC to enable or disable RX and TX single-copy per VC
++ - new device driver operation change_qos (not yet implemented)
++ - TNET1570 driver supports DEC Alphas and 64 bit PCI transfer (for CIA PCI
++ chipsets) (Christian Paetz)
++ - TNET1570 driver also supports the UniNET1570 board (Christian Paetz)
++ - new functions text2qos and qos2text to convert between textual and binary
++ QOS specifications (the format is described in man qos)
++ - atmarp -q ip_addr qos sets the default QOS to use for all VCs created for
++ that IP interface
++ - new utility debug/delay to use machine as AAL5-level delay line
++
++Other changes
++-------------
++
++ - NLPIDs and vendor-specific application identifiers are now collected in
++ the new file /usr/include/atmsap.h
++ - SO_ATMQOS now attempts to change the QOS settings when invoked on an active
++ connection
++ - included Matt Welsh's bigphysarea patch (this isn't related to ATM, but it
++ keeps my development source tree simpler)
++ - arequipa_preset now initializes max_sdu to RFC1626_MTU+RFC1483LLC_LEN if
++ zero
++ - atmarp: new option qos <spec> to set the QOS parameters (uses text2qos)
++ Use of pcr <pcr> is deprecated.
++ - ttcp_atm's -P option now also accepts a QOS specification string. (use of
++ -P <number> is deprecated.
++ - atmsigd: new option -q <qos> and configuration clause io qos <qos> to
++ set the QOS of the signaling VC. Use of -P <pcr> or io pcr <pcr> is
++ deprecated.
++ - removed the backward compatibility #define class traffic_class in
++ linux/atm.h
++ - removed obsolete keywords from atmsigd.conf language
++ - atmarp -a now also includes QOS parameters
++ - UBR now respects txtp.max_pcr if set
++ - new rules for the use of [rt]xtp.traffic_class: both fields must be either
++ equal or zero, e.g. ATM_CBR in TX and ATM_UBR in RX no longer works
++ - doc/usage.tex now points to the man pages instead of repeating their content
++
++
++Version 0.18 to 0.19 (27-SEP-1996)
++====================
++
++Bug fixes
++---------
++
++ - sscop.c:data_sd had a comparison inversed, so generation of USTAT PDUs was
++ wrong in some cases (by Juhana Rasanen)
++ - sigd_enq: accessed vcc->qos without checking for vcc == NULL, causing an
++ "Oops" in atmaddr
++ - svc_accept: generated a general protection fault when atmsigd was killed
++ while a process was waiting for new incoming connections
++ - atmaddr didn't zero the address structure before calling text2atm
++ - LANE: fixed usage of kernel timers and LE_ARP_REQUESTs should now get sent
++ until the entry expires or a response is received (by Marko Kiiskila)
++ - less compiler warnings from LANE servers (Marko Kiiskila)
++ - SSCOP: fixed SDU size in AA-RETRIEVE.indication (reported by Heinz Schuerch)
++ - NULL encapsulation for ATMARP works now (reported by Gerald Hanusch)
++ - fixed stray EINVAL from get{sock,peer}name on PVCs (reported by Gerald
++ Hanusch)
++ - clip now sets max_sdu to RFC1626_MTU+RFC1483LLC_LEN when using LLC/SNAP
++ encapsulation
++ - if parsing of a Q.2931 message fails, atmsigd now aborts the call instead of
++ (stupidly) trying to process the incomplete and probably inconsistent data
++ - SUNI driver didn't properly mask out unused highest bits of some statistics
++ counters, thereby yielding absurdly high values
++ - zatm: changed timing of RX channel closing, so the dreaded "can't close RX
++ channel" message should be history
++ - fixed race between Arequipa attachment due to packet reception and closing
++ of the Arequipa VC
++ - local address validity check (for ATM_???ADDR) was all wrong (reported by
++ David Simpson)
++ - message dumper ignored fatal errors if debugging was not enabled
++
++New features
++------------
++
++ - man pages for lecs, les, bus, and zeppelin (Marko Kiiskila)
++ - configuration file name for les and bus can be defined (Marko Kiiskila)
++ - zatm: new kernel configuration option CONFIG_ATM_ZATM_EXACT_TS now supports
++ reception timestamps with microsecond resolution (the accuracy is only in
++ the ms range, though)
++ - new utility znth (ZeitNet Timer History) to monitor timer synchronization
++ - LANE now supports up to 4 LEC network interfaces (Marko Kiiskila)
++ - the Q.2931 message parser now recovers nicely from IE errors, logs the
++ event, and continues parsing. The higher layers of the signaling stack
++ don't use this information yet, though.
++
++Other changes
++-------------
++
++ - Arequipa's BHLI now uses a "vendor-specific application identifier" under
++ the EPFL OUI
++ - moved buffer/queue handling from lib/libatmd to saal/, because it is rather
++ SSCOP-specific anyway
++ - atm_release_vcc now complains if rx_inuse != 0 when closing (if this ever
++ happens, it may point out dangerous races with upper layer protocols)
++ - SO_ATMQOS now issues a warning when using UBR with {min,max}_pcr != 0
++ - max_sdu is now set by atmarpd to MTU+RFC1483LLC_LEN (atmarp could still
++ override this, if necessary)
++ - atmdump: new option -i to display the arrival interval instead of the
++ absolute time. Also changed the time format to be more readable.
++ - updated the kernel configuration documentation to indicate that the SMC
++ ATM Power155 adapters are compatible with the Efficient ENI-155
++ - atmarpd now deletes the old table file (containing stale information) if
++ invoked with -d (debug)
++
++
++Version 0.17 to 0.18 (9-SEP-1996)
++====================
++
++Bug fixes
++---------
++
++ - atmsigd didn't respond to SETUP followed by RELEASE with a RELEASE COMPLETE
++ - atmsigd now implements incoming call rejection (as_indicate -> as_close)
++ - kernel now opens the VC before sending the as_accept. This a) allows to
++ check if the parameters are acceptable, and b) avoids a race condition
++ between the sender and the local VC open procedure, which frequently led to
++ loss of the beginning of the first PDU sent on a new connection.
++ - qdump: _q_parse used the wrong length when dumping variable-length fields,
++ yielding a fatal internal error
++ - clip didn't set rxtp.max_sdu
++ - svc_accept didn't set ATM_VF_HASQOS, so getsockopt SO_ATMQOS didn't work
++ (by Marko Kiiskila)
++ - ttcp_atm calculated Mbps as 2^20 bits/sec instead of 10^6, thereby making
++ all results come out approximately 5% too low (by Fraz Ahmad)
++ - added $(LDLIBS) to linking of lane/lecs (by Lawrence MacIntyre)
++ - interface number allocation in clip and atmarp did not check for collision
++ with the respective other name space
++ - atmarp's -c option didn't work when omitting the "atm" in the interface name
++
++New features
++------------
++
++ - new man page: arequipad.8
++
++Other changes
++-------------
++
++ - simplified the internal signaling protocol by adding the as_reject message
++ (sent by kernel in response to as_indicate; not acknowledged by demon)
++ - packets received from Arequipa are no longer forwarded to other hosts
++ - further ilmid improvements to use RSTADDR less frequently (by Gerald
++ Hanusch; with a slight modification)
++
++
++Version 0.16 to 0.17 (2-SEP-1996)
++====================
++
++Bug fixes
++---------
++
++ - lib/diag.c didn't fflush when logging to a file
++ - arequipad didn't accept the -l option
++ - qgen: possible weird crashes because second.c:find_required accessed
++ value->tag even if vt_id
++ - qgen: fixed wrong PC indication in one error message in _q_parse
++ - make spotless didn't know about new $(*PGMS) targets
++ - atmsigd: fixed memory leak when sending messages to the kernel
++ - atmarpd: fixed memory leak when sending messages to the network
++ - atmsigd: didn't send final as_close when kernel closed connection
++ immediately after requesting it (as_connect)
++ - several minor corrections
++
++New features
++------------
++
++ - added make target "uninstall" to remove all files installed by
++ make install
++ - atmsigd has two new options: -D dump_dir to set the dump directory and
++ -t trace_length to set the length of the trace buffer
++ - wrote a few man pages: atmarp.8, atmarpd.8, atmsigd.8, atmsigd.conf.4
++ - added automatic support for memory debugging if MPR is installed (and
++ included a patch to make MPR 1.1 work with ELF). atmarpd and atmsigd
++ currently use this feature.
++
++Other changes
++-------------
++
++ - changed "class" to "traffic_class" everywhere
++ - make install is now implemented in a more elegant way
++ - q.dump is now much better at finding symbolic names for numbers
++ - q.dump no longer prints zero-length fields
++ - qgen no longer includes constructor "microcode" in dumper
++ - atmarp now gives more informative error messages on ioctl failure
++ - removed obsolete ioctls SIOCGIFATMADDR and SIOCSIFATMADDR
++ - added hack to allow ilmid to be less hostile to locally configured addresses
++ (by Gerald Hanusch; with slight modifications)
++ - atmarpd now automatically sets ATF_PERM of PVC entries with NULL
++ encapsulation
++
++
++Version 0.15 to 0.16 (29-AUG-1996)
++====================
++
++Bug fixes
++---------
++
++ - fixed an "unterminated character constant" warning by CPP in qgen/uni3x
++ - atm/sigd/q2931.c always tried to read the Cause IE of RELEASE COMPLETE
++ messages even if it wasn't included
++ - LANE: fixed buffer allocation and VCC timeouts (Marko Kiiskila)
++ - LANE: when connecting directly to LES, name of the ELAN was not set
++ properly (discoverd by Gerald Hanusch; fixed by Marko Kiiskila)
++ - LANE, ATMARP, signaling: control sockets didn't account for messages sent
++ back from demons (fixed by Marko Kiiskila)
++ - permanent ATMARP entries for SVCs were ignored if no ATMARP server was
++ configured (reported by Gerald Hanusch)
++ - atmarp option "temp" mis-spelled as "term" (fixed by Gerald Hanusch)
++ - forgot to undo experimental rcvbuf/sndbuf change to unsigned long
++ - make modules didn't generate ATM modules
++ - atmtcp_attach_hook wasn't defined when compiling ATMTCP as a module
++ - ATM patch set dev->ip_atm to ether_arp in net/ppp.c and net/eql.c, so they
++ failed to work as modules
++
++New features
++------------
++
++ - added LANE servers (LECS, LES, and BUS) by Marko Kiiskila
++ - Rules.make: new variable INSTROOT for easier cross-installation
++ - atmsigd: added option -P to set the maximum PCR used on the signaling VC
++ - atmarp: added option "pcr <value>" (proposed by Gerald Hanusch)
++ - added the usual -l <logfile> option to arequipad
++
++Other changes
++-------------
++
++ - upgrade to kernel version 2.0.14
++ - SVCs can now be bound with any SEL value
++ - messages of size > quota can be sent if the send buffer is empty
++ - ilmid no longer empties the address list when refreshing the NSAP address
++ (by Gerald Hanusch)
++ - LANE client should now survive network reset (e.g. restart) gracefully
++ (Marko Kiiskila)
++ - LANE: major cleanup of zeppelin code (Marko Kiiskila)
++ - improved loadable module support for eni and zatm (i.e. loading works now)
++ - the message dumper can now be linked to programs that also use the
++ compilation/parsing functions
++
++
++Version 0.14 to 0.15 (31-JUL-1996)
++====================
++
++Bug fixes
++---------
++
++ - zatm: fixed traffic shaper settings for UBR (with a little help from Joern
++ Wohlrab)
++ - atmsigd compilation didn't use the same UNI version configuration as qgen
++ - field "class" in struct atm_traform broke compilation of ATM applications
++ written in C++, so it has been renamed to "traffic_class" (reported by
++ Furquan Ansari)
++ - AAL parameters IE wasn't included in CONNECT, which violated RFC1755
++ (discovered by Robert Olsson)
++ - zatm: removed broken sanity check for in-sequence skb delivery on RX
++ - clip didn't have clip_open function, so SIOCSIFFLAGS on the interface failed
++ with ENODEV
++ - single-copy compiles again
++ - zatm: driver doesn't pretend any longer to support single-copy (but
++ single-copy will come back later)
++ - QOS IE was sent with the wrong coding standard when using UNI 3.1 (with help
++ from Fraz Ahmad)
++ - zatm: forgot to remove some debugging code (around ZATM_TUNE)
++ - qlib.c didn't zero the length array, leading to (rare) "not enough space"
++ errors from QMSG (actually, the "break" mechanism seems to be flaky - will
++ have to check)
++ - fixed Arequipa race condition when the upper layer protocol and signaling
++ decided to close the SVC at the same time
++ - alloc_tx used to return NULL in out of memory conditions, thereby possibly
++ hanging atm_sendmsg
++
++New features
++------------
++
++ - ttcp_atm now also accepts names with -p
++ - (finally !) added send/receive buffer limits and cleaned up the use of
++ vcc->[rt]x_{inuse,quota}
++ - added mkdiff script for automatic generation of diffs
++ - Arequipa now works for PVCs too (but arequipad is now required for any
++ use of Arequipa, not only for incoming connections)
++
++Other changes
++-------------
++
++ - atm/atm-<version>.patch is now called atm/atm.patch (to make the diffs more
++ useful)
++ - the maximum SDU size is now checked in net/atm/common.c:adjust_tp
++ - text2atm/atm2text now accepts/generates E.164 addresses with a leading +
++ sign, as required by ANS (atm95-1532)
++ - internal signaling protocol: added message as_error to un-overload as_close
++ - internal signaling protocol: split as_establish into as_connect and
++ as_accept
++ - internal signaling prococol: as_close.reply no longer contains positive
++ numbers
++ - internal signaling prococol: as_bind now also carries the AAL type
++ - atmsigd: now also checks the AAL type in as_bind messages
++ - kernel signaling: a few minor changes
++ - STANDARDS (i.e. UNI version) configuration option has been moved from
++ atm/qgen/Makefile to atm/Rules.make
++ - atmsigd's startup message now gives more useful indication of which UNI
++ version(s) it supports
++ - signaling no longer uses sa[sp]_[rt]xtp, so ...
++ - sa[sp]_[rt]xtp is gone
++ - removed atm/sigd/svc.c from the distribution. We now have many other tools
++ for testing SVCs, so it's superfluous.
++ - atmarpd: revalidation is now less frequent (use -DFREQUENT_REVAL for
++ the faster timeout)
++ - ioctl CLIP_PVC now returns the number of the new interface and clip prints
++ its name to standard output (like atmarp -c)
++ - clip now issues the CLIP_PVC ioctl after binding, which avoids wasting
++ interface numbers on failed setup attempts
++ - atmsigd -d now sets the debug level for qgen and SSCOP to DIAG_INFO, and
++ doesn't set q_dump
++ - zatm: added protection against I > M
++ - atm_peek_aal5 now only aligns to page boundaries for pdu_size >= PAGE_SIZE
++ - eni driver now spits out CRC error messages at most every other second
++ - zatm driver now repeats RX error messages at most every other second
++ - ttcp_atm now sleeps for a second after setting up an SVC, because the
++ switch seems to lag behind (need to examine this further)
++ - moved SAAL from sigd/ to saal/ (for sharing with UNI 4.0 signaling)
++ - Arequipa sockets are now closed via arequipad instead of via atmsigd (new
++ ioctls AREQUIPA_CTRL and AREQUIPA_CLS3RD)
++ - various minor changes
++
++
++Version 0.13 to 0.14 (19-JUL-1996)
++====================
++
++Bug fixes
++---------
++
++ - LANE: reaction to LE_ARP_RESPONSE's wasn't always correct
++ - LANE: compiler warnings fixed
++ - LANE: comparing ATM addresses in checking whether connection is formed was
++ wrong
++ - zntune didn't divide by 1024 when displaying the "k"
++ - .depend wasn't deleted by make spotless
++ - ATM_GETSTAT and ATM_GETSTATZ used wrong argument type for coding ioctl
++ number. WARNING: programs using ATM_GETSTAT{,Z} need to be recompiled.
++ - requests to set up SVCs with ATM_NONE in both directions are now caught by
++ svc_connect (used to yield an invalid SETUP message)
++ - signaling: fixed connection identifier setting when acting as network side
++ (fix by Elwyn B Davies)
++ - ATMARP server ARP entries were undeletable
++ - atmarp showed wrong argument in error message when given an invalid ATM
++ address
++ - zatm: do_tx left interrupts turned off when returning with RING_BUSY
++ - LANE ARP hash table handling bugs fixed
++ - atmarp: act_create is now only sent on interface creation
++ - atmarp: act_down is now only sent once per transition
++ - demon control SVCs are no longer closed when atmsigd dies (new VCC flag
++ ATM_VF_META)
++ - netdevice notifier is now properly unregistered when atmarpd goes down
++ (not doing so caused endless loop in kernel on atmarpd restart)
++ - sigd_enq{_atomic} never calls schedule()
++ - atmsigd no longer "forgets" to bring up ARP server SVC before sending an
++ InARP
++ - atmarpd no longer dies with "timer in state 3" when the ARP server becomes
++ unreachable
++ - atm/atmarp.c: clip_create() now refuses creation of already existing
++ interface
++ - Documentation/Configure.help gave an obsolete URL for CONFIG_AREQUIPA
++ and doc/usage.tex also mentioned the old file name
++ - Arequipa didn't work in the outbound direction for TCP, because
++ net/ipv4/tcp.c was missing in the kernel patch
++ - drivers/atm/eni.c:foo raced with initialization of eni_boards if the
++ board lost the signal _immediately_ after being initialized
++ - atmarpd: fixed a few uninitialized entry->timer pointers (discovered by
++ Gerald Hanusch)
++ - atmarpd: arps entry should no longer get stuck in as_resolv
++
++New features
++------------
++
++ - compiles on SparcLinux too (but only atmtcp works)
++
++Other changes
++-------------
++
++ - upgrade to kernel version 2.0.0
++ - BHLI matching changed: SAPs without BHLI are now incompatible with calls
++ that specify a BHLI
++ - LANE: interface stays up when zeppelin dies -> possibility for
++ wrapper script around zeppelin
++ - LANE: LUNI interoperability test (ATM Forum/96-0805) is now followed
++ in setting ELAN name in LE_CONFIG_RESPONSE and LE_JOIN_RESPONSE,
++ there is also a delay of 1 second before sending LE_CONFIG_REQUEST and
++ LE_JOIN_REQUEST. This allows 'slow' LE servers to catch up.
++ - LANE: no longer uses sa[sp]_[rt]xtp
++ - LANE: now adjusts better to ATM address changes
++ - zeppelin: new option -m to select debugging output
++ - updated aping, aread, awrite, br, bw, atmdump, ilmid, atmarp, clip, atmarpd,
++ and zeppelin to use setsockopt SO_ATMQOS
++ - added option -x for ilmid to disable variable bindings (caused
++ interoperability problems with certain switches, e.g. the LS100)
++ - changed SO_CIRANGE into a pair of ioctls
++ - changed return value of fetch() (passed to atm_vcc->peek) from unsigned long
++ to __u32
++ - atmarp now accepts arpsrv option also for -d
++ - zatm driver can now also read ESIs of rev. 10 boards (with help from Nikos
++ Anerousis)
++ - awrite: fixed txtp.max_sdu calculation in awrite (was using uninitialized
++ variable "offset")
++ - atmarpd: IP interface removal now has the desired effect (used to do
++ nothing)
++ - atmarpd: now reports and ignores unexpected interface transitions
++ - added sigd_enq_atomic for atomic sigd_enq (so that non-Arequipa SVCs can
++ still use the "safe" but non-atomic version)
++ - made SIOCGIF* failures in atmarpd non-fatal (itf.c:itf_up was handling them
++ anyway)
++ - moved Arequipa-specific code from net/atm/clip.c to net/atm/arequipa.c, and
++ put code common to CLIP, Arequipa, and - to a lesser extent - ATMARP into
++ net/atm/ipcommon.[ch]
++ - Arequipa can now be complied without CLIP
++ - various minor documentation changes
++ - moved ATM device initialization from net/atm/pvc.c to drivers/block/genhd.c,
++ where most other devices are initialized too
++ - preparation for new binary locations: tools build process now knows about
++ four types of programs: for booting, for system use, for users, and for
++ internal use during build
++ - make install now hides the for loops
++ - non-user binaries are now installed in /usr/local/sbin
++ - struct atm_iobuf.buffer is now of type void * (was int*). Also,
++ ATM_GETNAMES now returns the length in bytes in that field.
++
++
++Version 0.12 to 0.13 (7-JUN-1996)
++====================
++
++Bug fixes
++---------
++
++ - BHLI type used the ATM_HL_* values (which are off by one) in qgen/uni3x
++ - atmarpd ended up in a tight select-accept loop if atmsigd went away
++ - removed sleep in ZATM's do_tx (so it works with IP over ATM again)
++
++New features
++------------
++
++ - added experimental support for Application requested IP over ATM (Arequipa),
++ prototyped by Jean-Michel Pittet
++ - new traffic class ATM_ANYCLASS to accept incoming SVCs without looking at
++ the traffic parameters
++ - added (untested) support for SO_BCTXOPT/SO_BCRXOPT
++
++Other changes
++-------------
++
++ - SVCs used to listen are now marked as "LISTEN" in /proc/atm/svc
++ - added option -Q <atm_addr> to ttcp_atm to support AREQUIPA
++ - cleaned up the FILE macro and removed atm_dir in net/atm/proc.c
++
++
++Version 0.11 to 0.12 (3-JUN-1996)
++====================
++
++Bug fixes
++---------
++
++ - atm/lib/Makefile: had to comment out PGMS=test
++ - distribution didn't include atm/doc/usage.txt
++ - patch didn't include arch/i386/config.in
++ - return 0; was missing at the end of net/atm/mmuio.c:mmu_step
++ - atm/ilmid didn't install into INSTBIN; also made some other Makefile
++ changes
++ - read() returned garbage instead of error when network drops connections
++ - POLL_AFTER_RETRANSMISSION in SSCOP didn't even compile
++ - SVCs: bind to wildcard addresses should now work even if no local address
++ is known yet
++ - make clean in atm/qgen left some dirt
++ - ATM drivers didn't free skbs when detecting an error in TX direction
++ - SIOCMKCLIP was in the wrong #ifdef, so CLIP had to be enabled to make
++ ATMARP usable
++ - signaling didn't respond properly to messages with non-existent call
++ reference
++
++New features
++------------
++
++ - merged in LAN Emulation client support written by Marko Kiiskila
++ - new socket option SO_ATMQOS at SOL_ATM to set/get QOS parameters
++
++Other changes
++-------------
++
++ - t2a.pl now also works with Perl 5.001
++ - changed the TX side of the ZATM driver to use a ring instead of a list in
++ order to improve stability and throughput (needs some more testing)
++
++
++Version 0.10 to 0.11 (21-MAY-1996)
++====================
++
++Bug fixes
++---------
++
++ - README.DRIVERS still referenced INSTALL (it's now in USAGE)
++ - sap_decode didn't clear BLLI part of address structure
++ - trying to connect to NULL address fails locally instead of yielding an
++ invalid SETUP message
++ - bind now properly sets the local address
++ - SVC getname now returns the traffic parameters
++ - oops, zatm open_tx didn't return PCR
++ - awrite printed errors for connect() as "bind: ..."
++ - atmsigd no longer generates dummy call references (0x7fffff)
++ - atmtcp: changed a few kfree_skb to dev_kfree_skb, which should make it
++ work better (does anybody care to try ?)
++ - some more dev_kfree_skb fixed for control messages from or to demons (led
++ to some minor memory leaks)
++ - various major fixes for CBR SVCs
++ - RELEASE was signaled for SVCs before all data was sent
++ - single copy tried to access mem_map with user space addresses, leading to
++ crashes or worse
++ - zatm: sleep_on was racing with TX completion in close_tx, leading to hangs
++ - zatm: now fails attempts to open AAL0 VCs (used to accept them and to
++ crash later)
++ - BHLI encoding/decoding was broken in several ways
++
++New features
++------------
++
++ - hacked in primitive leaf-only p2m support (based on an idea by Marko
++ Kiiskil{)
++ - the socket layer, and the zatm, eni, and atmtcp drivers now support
++ two-phase connect
++ - PVCs now respect max_pcr (SVCs can't for now)
++ - lib/diag.c can now also log to a file or to syslog, and atmarpd, atmsigd,
++ and ilmid now have a -l option to use that
++ - new option -c config_file for atmsigd
++ - zatm and atmtcp now also support timestamps (but zatm timestamps can be
++ improved a lot by using the timestamps the uPD98401 generates)
++ - Classical IP over ATM support is now configurable
++ - added on-line help texts for configuration
++ - added atm/test/aping, a round-trip tester for PVCs
++ - added "flags" field to struct atm_dev and to atm_dev_register, on request
++ by Bureau 13
++
++Other changes
++-------------
++
++ - past versions of the BUGS list aren't included in the distribution anymore
++ because I didn't update them anyway
++ - invalid connect() calls now return an error instead of panicing atmsigd
++ - text2atm no longer clobbers sas_addr.{blli,bhli}
++ - greatly simplified zatm traffic shaper settings calculation (and it's
++ better than before too)
++ - atmsigd: diagnostics class "sig" (in atmsigd.conf) now also includes "SAP"
++ - DPRINTK now uses GNU-specific #define foo(bar...)
++ - signaling: PCR is now also indicated (0) for directions in which ATM_NONE
++ is requested, which is probably "cleaner" (for CBR)
++ - added logging priorities to most printks
++ - the default location for atmsigd.conf changed from . to /etc
++ - ipv4/af_inet.c: atmtcp_attach_hook is now only included when using ATM over
++ TCP
++ - configuration options for extended driver debugging, (old) CLIP, and
++ ATM over TCP are turned off by default
++
++
++Version 0.9 to 0.10 (21-MAR-1996)
++===================
++
++Bug fixes
++---------
++
++ - zatm: deallocated UBR shaper when closing UBR VC, which the other UBR VCs
++ didn't really appreciate
++ - fixed nasty memory leak for native ATM (spotted by Rolf Fiedler)
++
++New features
++------------
++
++ - added Rolf Fiedler's driver for his adapter based on the TI TNETA1570
++ - single-copy is back again !
++
++Other changes
++-------------
++
++ - eni buffers are now slightly (50%) bigger, allowing for more effective
++ overlapped operations
++ - documented zntune
++
++
++Version 0.8 to 0.9 (14-MAR-1996)
++==================
++
++Bug fixes
++---------
++
++ - oops, accidently removed ZN1221 from drivers/pci/pci.c (so /proc/pci
++ reported it as "unknown")
++ - sigd didn't poll for the default interface on startup
++ - atmarpd didn't initialize timer field in newly allocated table entries,
++ which led to crashes
++ - removed a few stray debugging printks in net/atm/svc.c:svc_bind
++ - ATMARP tried to send queued packet before adding new table entry, so the
++ packet was always discarded
++ - sigd/sap.c: didn't allow to use different traffic classes for fwd and bwd
++ direction
++ - atm2text accepted SVC addresses of all zeroes
++ - atmsigd didn't refresh its local address list properly after ilmid restart
++ - net/atm/common.c: returned positive error codes (-vcc->reply) instead of
++ negative ones
++ - forgot to include maint/zntune.c in the distribution
++
++New features
++------------
++
++ - sigd/svc now accepts ATM addresses in all formats supported by text2atm
++
++Other changes
++-------------
++
++ - upgraded to kernel version 1.3.73
++ - the called party number must now match the local address (if bound)
++ - renamed ttcp.atm to ttcp_atm
++ - all executables are now explicitly linked (so make works even without
++ dependencies)
++
++
++Version 0.7 to 0.8 (12-MAR-1996)
++==================
++
++Bug fixes
++---------
++
++ - fixed stray segmentation violation in arpd/arp.c:learn
++ - fixed coding standard of the QoS IE if using UNI 3.0 (and made coding
++ standard variable)
++ - made coding standard variable for Cause IE
++ - SSCOP didn't properly set N(MR)
++ - list elements in STAT PDUs had host byte order
++ - SSCF didn't call sscop_estab_resp on restart (AA-EST.ind in 1/1)
++ - signaling didn't handle SAPs with >= 2 BLLI IEs properly
++ - uni3x: iso_hli and user_hli were confined to 7 bytes, but UNI allows up to 8
++ - q_read choked on non-variable-length fields
++ - qgen sometimes didn't read all IEs of a signaling message
++ - fixed usage line of test/bw
++ - qgen no longer complains about missing required fields after a break
++ - fixed compiler warning in zntune.c
++ - fixed ATMARP table additions (caused GPF when flushing ATMARP entry at
++ the end of the table and possibly other problems)
++ - qgen: q_put or'ed data instead of overwriting it, which caused problems
++ only on surprisingly few occasions
++
++New features
++------------
++
++ - atm2text and text2atm now also do name lookups via a /etc/hosts.atm file
++ - atmaddr, atmarpd, and atmsigd now pretty-print addresses using name
++ translation (unless invoked with -n)
++ - atmarpd now dumps its table into /var/run/atmarpd.table and atmarp -a
++ reads it from there
++ - started modularizing the ENI and ZATM drivers
++ - ilmid and atmsigd now support multiple interfaces (untested)
++
++Other changes
++-------------
++
++ - the documentation is now available in LaTeX and in ASCII
++ - rewrote most of the SAP handling code (now everything is in sigd/sap.c)
++ - proto.c:lookup_sap now picks wildcard SAP last
++ - signaling always includes SSCS type = 0 in SETUP messages (for LANE)
++ - changed the message format for the the kernel-demon signaling protocol
++ - qgen is now a bit more tolerant when being fed with bad data
++ - qgen now assumes that q_report(Q_FATAL,...) doesn't return
++ - marked sigd/test.c as obsolete
++ - svc_accept failing in atm_connect no longer returns success
++ - atmsigd -n is now atmsigd -N
++ - qgen now puts the PC in q.out.c and qd.out.c at the beginning of the code
++ line and not on a line by itself
++
++
++Version 0.6 to 0.7 (2-FEB-1996)
++==================
++
++Bug fixes
++---------
++
++ - removed TTL setting ioctl (1234) used for something entirely unrelated to
++ ATM, oops
++ - changed kfree_skb in atm_pop_raw to dev_kfree_skb (this fixes the socket
++ "leak")
++ - more unusual configurations (no PCI, no IP, no /proc) should compile now
++ - atm_equal didn't recognize wildcards in embedded E.164 addresses
++ - fixed net/atm/proc.c:svc_addr (too many bugs to mention)
++ - atmarpd didn't check for ARP traffic on inbound connections
++ - atmarpd didn't properly merge incoming connections with existing entries
++ - various other ATMARP fixes
++ - free list was too short in ENI driver for worst case fragmentation on
++ 2 MB boards
++ - signaling didn't set ISO/IEC TR9577 IPI and NLPID correctly in active open
++ - getname looked at *sockaddr_len, which is uninitialized (need to fix this
++ later in the common socket code)
++ - SSCOP generated incorrect error code ("1" instead of "B") for BGN PDU
++ problems
++
++New features
++------------
++
++ - new ioctls ATM_GETADDR, ATM_RSTADDR, ATM_ADDADDR, and ATM_DELADDR to
++ manage local ATM addresses
++ - signaling now handles incoming RESTART, SAAL failure, and SAAL
++ re-establishment
++ - ATMARP now times out idle connection; ATMARP_MKIP ioctl takes a timeout
++ argument
++ - ATMARP (kernel) now queues one skb per pending ARP request and limits the
++ rate of requests for the same address (default 2 req/min)
++ - atmsigd now prints cause values when receiving a RELEASE or a RELEASE
++ COMPLETE and returns more informative error codes
++ - atmarpd falls back to PVC-only operation if signaling is unavailable at
++ startup
++ - kernel can now assign next free number on IP interface creation (atmarp
++ prints the interface name)
++ - qgen -D generates a Q.2931 message dumper (see USAGE for details)
++ - qgen now checks for proper use of repetition indicator (but doesn't
++ support repeated IEs yet)
++ - protocols and device drivers can now use their own memory allocator in the
++ TX direction by changing vcc->alloc_tx
++
++Other changes
++-------------
++
++ - upgraded to kernel version 1.3.53
++ - build process now uses Perl
++ - ATM ioctls writing back data now always return the size of the data
++ structure written
++ - struct atmif_sioc now has a length field (recompile all atmarpd, ilmid,
++ debug/ed, and everything in maint)
++ - PHY driver no longer has to check validity (permissions and access) for
++ "standard" ioctls
++ - signaling should now also work on an interface > 0 (but there's still only
++ one interface using signaling per host)
++ - make install now adds /usr/include/atm.h and /usr/include/atmd.h
++ - atmarpd now also displays if SVC has been opened actively or passively
++ - atmaddr(8) now uses new ioctls and has different command-line syntax
++ and even has a man page
++ - example IP addresses in USAGE now conform to RFC1597
++ - diagnostics now also include the application name (optional)
++
++
++Version 0.5 to 0.6 (21-DEC-1995)
++==================
++
++Bug fixes
++---------
++
++ - ARP ioctls stopped working for most non-ATM devices, oops
++ - ATMTCP driver counted lack of memory as rx_err instead of rx_drop
++ - select on driver using polling may have hung
++ - atmarp man page and usage didn't indicate that the interface number is
++ optional
++ - restricted atmarpd and signaling control, and SIOCSIFATMADDR to the super
++ user
++ - atmtcp: fixed handling of VPI/VCI <= 0 for setsockopt(SO_CIRANGE)
++ - eni and zn driver had static UBR shaper pointer, making it difficult to have
++ more than one such device per system
++ - eni driver initialization didn't work properly in systems with ASIC Tonga
++ - suni.[ch]: confused MC (Master Config) and MCT (Master ConTrol) registers
++ - (SVC) accept now returns PVC -EAGAIN as -EBUSY because the operation cannot
++ be retried
++ - qgen: fixed several bugs in case handling (and made defaults work for
++ parsing)
++ - svc_dup passed PF_ATMSVC instead of AAL to svc_create
++ - plugged a few skb leaks in svc_accept
++ - text2atm didn't properly NUL-terminate E.164 addresses
++
++New features
++------------
++
++ - ZN1221 driver works partially for AAL5 (still hangs after a few dozen MB)
++ (also wrote maint/zntune to monitor/adjust free buffer pools)
++ - ENI driver now supports new Tonga ASIC boards
++ - added Scott Shumate's ILMI demon (for automatic address registration)
++ - text2atm: added wildcard support for SVCs (syntax: addr/bits)
++ - new library function atm_equal to compare SVC addresses
++ - new ioctl ATM_GETTYPE to obtain interface type name
++ - new ioctl ATM_GETESI to obtain ESI (parallels /proc/atm/devices)
++ - new ioctls SONET_SETFRAMING, SONET_GETFRAMING, and SONET_GETFRSENSE to
++ handle SONET vs. SDH framing
++ - added socket option SO_AALTYPE (SOL_AAL) to query AAL type (getsockopt
++ only)
++ - signaling demon is now notified on address changes (new message
++ as_itf_notify)
++
++Other changes
++-------------
++
++ - known bugs are now listed in a file called BUGS
++ - all utility programs (aread, awrite, atmdump, br, bw, clip, ttcp) now use
++ the notation [itf.]vpi.vci for PVCs (was itf vpi vci , except for ttcp,
++ where it was only vpi vci (no itf))
++ - all ioctl values have changed
++ Note: most programs have to be recompiled because of this
++ - sigd and arpd now register their control sockets via ioctls
++ - (old) clip now creates interfaces with an ioctl
++ - text2atm now returns the wildcard length, i.e. a non-zero return value
++ no longer implies failure
++ - push_oam now returns an int (was void)
++ - push_oam now has several flags (in a bit set) instead of the immed
++ argument
++ - the peek function must now update the statistics if it rejects a packet
++ - (ATM device) close is now only invoked after a successful open
++ - the SUNI_GETLOOP ioctl now has an int * argument (was unsigned long *)
++ - uPD98402 driver no longer tries to detect return of the signal (didn't
++ work anyway - would have to sample section errors)
++ - ATMARP no longer supports mixed PVC/SVC entries (I'm sure this will be
++ missed a lot :-)
++ - ATMARP no longer supports "IP address discovery" via InARP for PVCs
++ (maybe later)
++ - specifying an invalid AAL now yields EPROTOTYPE
++ - specifying an invalid address family (connect, bind) now yields EAFNOSUPPORT
++ - make install now also installs libraries (in /usr/lib)
++ - improved many header file comments
++ - re-arranged some comments to simplify automated document generation
++ - added copyright statement
++ - UNI 3.0 IE fields are now always recognized (but we shouldn't generate them)
++ - UNI 3.0 wants octet 5a when using BCOB-X, so we'll set it to twice "No
++ indication"
++ - aread, awrite, br, bw, ttcp, atmsigd, and atmdump now set max_sdu
++ - aread and awrite no longer print strerror(errno) on success
++
++
++Version 0.4 to 0.5 (26-OCT-1995)
++==================
++
++Bug fixes
++---------
++
++ - now only root can open a CLIP socket (thereby creating an IP interface)
++ - now only root can issue CLIP_NULENCAP and CLIP_LLCENCAP ioctls
++ - atmdump: forgot default in getopt switch
++ - eni driver: called misc_int on every interrupt
++ - Q.2931 message description: various fixes and improvements
++ - linux/atm.h: ATM_*_UNSPEC used the same value as ATM_*_ANY, oops !
++ - SSCOP is now more careful about not accessing the descriptor if it might
++ possibly have been deleted
++ - typo in SSCF leading to wrong response to AA-RECOVER.indication
++ - SSCOP now correctly copies N(PS) from POLL to STAT PDUs
++ - SSCF now discards data when not ready instead of issuing a fatal error
++ - AAL initialization failure no longer leaks memory
++ - closing an SVC without VCC no longer yields a GPF
++
++New features
++------------
++
++ - ZN1221 driver is starting to work
++ - new, ARP-based mechanism for IP over ATM (with atmarpd, atmarp, etc.)
++ - /proc/atm/pvc now displays more information for CLIP PVCs (after a patch
++ by Raghavan Menon)
++ - added max_pcr to struct atm_trafprm (also fixed a few comments in atm.h)
++ Note: all programs using sockaddr_atm* will have to be recompiled.
++ - qgen now handles value lists in named selections
++ - signaling now supports bhli/blli, plus various other minor extensions
++ - new ioctls to set/get local ATM address
++ - added library with address to/from text conversion functions
++ - finally implemented getname()
++
++Other changes
++-------------
++
++ - eni driver: avoided potential generation of superfluous code if extended
++ debugging is disabled
++ - eni driver: detects new boards using ASIC PCI chip (doesn't support them
++ yet, though)
++ - qgen: semicolon is now comment character and no longer used to terminate
++ clauses
++ - qgen: replaced term "item" with "field"
++ - linux/include/atmsap.h: removed obsolete comment "protocol cannot be fully
++ encoded in current structure". Also re-arranged some comments to simplify
++ automated document generation.
++ - saal,sscf,sscop: callbacks don't pass the pointer to the descriptor of the
++ calling protocol anymore
++ - SSCOP no longer prints a number for non-'V' errors
++ - improved handling of STATUS messages
++ - select now indicates ready for writing if max_sdu packet can be enqueued
++ without blocking
++ - select can now also be used to check status of non-blocking connect
++ - moved some common demon functions from sigd into a common demon library
++
++
++Version 0.3 to 0.4 (27-SEP-1995)
++==================
++
++Bug fixes
++---------
++
++ - various minor documentation fixes
++ - clip.c:atm_push_clip now updates statistics before forwarding the skb to
++ the upper layer (which may free and overwrite the skb)
++
++New features
++------------
++
++ - added partial UNI 3.x signaling
++ - added various adapter debugging programs to the distribution
++ - new config option CONFIG_ATM_ENI_DEBUG to enable extended debugging
++ in eni driver
++
++Other changes
++-------------
++
++ - upgraded to kernel version 1.3.24
++ - changed the distribution directory structure (programs are now in maint/,
++ test/, ip/, debug/, and sigd/, see INSTALL)
++ - ATM interfaces are no longer named, only numbered. This affects the
++ ATM_GETNAMES ioctl, all ioctls using struct atmif_sioc, the usage of atmdiag
++ and sonetdiag, and various diagnostic kernel messages.
++ - ATM socket state is now recorded in field "flags" (this also replaces the
++ SVC fields "released", "registered", and "state")
++ - added #ifdef __KERNEL__ to some header files
++ - added "int immed" argument to send_oam
++ - some minor modifications to the distribution process (mkdist)
++ - removed devmap.c
++ - SVC sockets no longer hang if the signaling demon dies
++
++
++Version 0.2 to 0.3 (8-SEP-1995)
++==================
++
++Bug fixes
++---------
++
++ - select(2) didn't work (was sleeping on sock->wait instead of
++ &ATM_SD(sock)->sleep)
++ - ENI driver did allow binding to VPI/VCI already in use
++ - ENI driver now properly handles PDUs with CRC errors
++ - ENI driver had race condition when discarding PDUs causing new PDUs to be
++ shifted in adapter memory by one word (which confused the driver quite a
++ bit)
++ - ENI driver now enables VC _after_ setting all pointers (caused crashes if
++ data was already coming in while opening VC)
++ - various bugs fixes related to SVC sockets
++ - fixed GPF (in kernel) when running atmdiag without arguments
++ - atmdiag now left-adjusts interface names
++ - fixed ttcp.atm crash when not specifying vpi.vci
++ - clip_xmit now checks for NULL vcc (e.g. after failure to connect)
++
++New features
++------------
++
++ - zatm driver now reads ESI correctly
++ - blocking svc_connect is now interruptible
++ - atmdump now also displays the numeric PTI value of incoming cells
++ - added RX/TX buffer quotas (default is 64 kB)
++ - added OAM hooks to device driver interface (but there's no OAM support yet)
++
++Other changes
++-------------
++
++ - ENI driver now checks ID field of reassembly buffer descriptors
++ - ENI driver now uses vremap
++ - ENI driver now prints more useful physical layer type information (e.g.
++ "MMF" and "UTP" instead of "UTOPIA")
++ - some redesign of the protocol used for signaling between kernel and demon
++ - disabled "Grr, servicing VCC twice" message in ENI driver
++ - device drivers now have to adapt AAL0 cell header byte order
++ - some cleanup in common.c:atm_getsockopt
++ - device drivers are now required to use the peek function; protocols now
++ must provide it
++
++
++Version 0.1 to 0.2 (15-AUG-1995)
++==================
++
++Bug fixes
++---------
++
++ - VCC family field is now correctly set to protocol family in
++ common.c:atm_create (was pvc.c:pvc_create). With protocol set to zero,
++ this created all types of strange problems, because the family field
++ is used to indicate whether an VCC slot is busy/free.
++ - fixed race condition in common.c:atm_read (reader might have blocked
++ even if data is ready)
++ - fixed dereferencing of uninitialized skb->dev pointer in
++ clip.c:atm_push_clip
++ - SIOCSIFATMTCP now refuses to attach the same socket twice
++ - zatm.c: fixed setting of the VPI/VCI mask
++ - USAGE said ttcp uses -B for the bandwidth, but it's -P
++ - mkdist didn't include man pages
++
++New features
++------------
++
++ - added some /proc/atm functionality
++ - added support for ATM_{VPI,VCI}_ANY
++ - SIOCSIFATMTCP now returns the interface number and atmtcp(8) prints it
++ - wrote atmtcp man page
++ - added kernel part of SVC support
++
++Other changes
++-------------
++
++ - common.c: only root is now allowed to bind to reserved VCIs
++ - Classical IP interfaces are now removed by downing by ifconfig; clip(8)
++ returns immediately
++ - PVC-connect for non-existing device now returns ENODEV instead of EINVAL
++ - new field (type) in struct atm_dev to indicate device type
++ - moved getsockopt(SO_CIRANGE) to common.c (removed atmtcp's own version)
++ - added ci_range to struct atm_dev (and removed it from atmtcp's private
++ structure)
++ - added code to read the ESI to zatm.c (but that code doesn't seem to work
++ yet)
+--- linux-atm-2.4.1.orig/debian/atm-tools-br2684.manpages
++++ linux-atm-2.4.1/debian/atm-tools-br2684.manpages
+@@ -0,0 +1 @@
++debian/tmp/usr/share/man/man8/br2684ctl.8
+--- linux-atm-2.4.1.orig/debian/atm-tools.atm
++++ linux-atm-2.4.1/debian/atm-tools.atm
+@@ -0,0 +1,27 @@
++#!/bin/sh
++# Start/stop the atm daemon(s).
++
++DAEMON="/sbin/atmarpd"
++
++test -f $DAEMON || exit 0
++
++case "$1" in
++start) echo -n "Starting ATM ARP Daemon: "
++ start-stop-daemon --start --quiet --exec $DAEMON -b
++ /bin/sleep 2
++ echo "atmarpd."
++ ;;
++stop) echo -n "Stopping ATM ARP Daemon: "
++ start-stop-daemon --stop --quiet --exec $DAEMON
++ echo "atmarpd."
++ ;;
++restart|force-reload) echo -n "Re-starting ATM ARP Daemon: "
++ start-stop-daemon --stop --quiet --exec $DAEMON
++ start-stop-daemon --start --quiet --exec $DAEMON -b
++ /bin/sleep 2
++ echo "atmarpd."
++ ;;
++*) echo "Usage: /etc/init.d/atm start|stop|restart|force-reload"; exit 1
++ ;;
++esac
++exit 0
+--- linux-atm-2.4.1.orig/debian/atm-tools.docs
++++ linux-atm-2.4.1/debian/atm-tools.docs
+@@ -0,0 +1,4 @@
++BUGS
++README
++doc/README.tc
++debian/README.br2684
+--- linux-atm-2.4.1.orig/debian/control.old
++++ linux-atm-2.4.1/debian/control.old
+@@ -0,0 +1,72 @@
++Source: linux-atm
++Section: net
++Priority: optional
++Maintainer: Peter De Schrijver (p2) <p2@mind.be>
++Build-Depends: debhelper (>> 4.0.0), bison, flex, perl, dpatch, automake1.4
++Standards-Version: 3.6.1
++
++Package: atm-tools
++Architecture: any
++Depends: ${shlibs:Depends}
++Description: Base programs for ATM in Linux, the net-tools for ATM
++ This package provides all the basic programs needed for setting up,
++ monitoring and tuning ATM networks. Such as:
++ * atmsigd, an ATM signal daemon that implements the ATM UNI protocol.
++ * atmtcp, a tool to setup ATM over TCP connections.
++ * atmarpd, an implementation of the ATMARP protocol (RFC1577, RFC1755)
++ * zeppelin, an ATM LAN Emulation client daemon
++ * les and bus, ATM LAN Emulation service daemons
++ .
++ Notice that upstream still flags these tools as experimental software and
++ says that there is still a number of known bugs and issues. The
++ software is, however, in productive use at a number of sites and is
++ working reliably.
++ .
++ Homepage: http://linux-atm.sourceforge.net/
++
++Package: atm-tools-br2684
++Architecture: any
++Depends: ${shlibs:Depends}
++Description: br2864ctl - RFC1483/2864 Bridge Daemon for ATM Networks
++ br2684ctl handles RFC1483/2684 bridged PDUs. This is most often
++ used in ADSL scenarios where usually the subscribers' ethernet
++ traffic is encapsulated in ATM AAL5 (by bridging ADSL modems)
++ according to RFC2684
++ .
++ The sources for br2684ctl has been pulled from linux-atm's CVS
++ repository. Warning: This is unreleased software that can break any
++ time, any place. If it does, you get to keep the pieces. linux-atm's
++ upstream flags even the released software as experimental software.
++ There is still a number of known bugs and issues.
++
++Package: atm-dev
++Depends: libatm1-dev
++Architecture: all
++Section: oldlibs
++Description: Development files for compiling ATM programs (dummy package)
++ This dummy package provides a transition from the previous atm packages.
++ It is provided for backwards compatibility only and may be removedafter
++ the upgrade has completed or when when no other package depend on it.
++
++Package: libatm1
++Section: libs
++Architecture: any
++Depends: ${shlibs:Depends}
++Conflicts: atm-tools (<< 2.4.1-6)
++Description: shared library for ATM (Asynchronous Transfer Mode)
++ Shared libraries needed by ATM (Asynchronous Transfer Mode) related programs
++ .
++ Homepage: http://linux-atm.sourceforge.net/
++
++Package: libatm1-dev
++Section: libdevel
++Architecture: any
++Depends: libc6-dev, libatm1
++Replaces: atm-dev (<< 2.4.1-7)
++Conflicts: atm-dev (<< 2.4.1-7)
++Provides: libatm-dev
++Description: Development files for compiling ATM programs
++ Header files and development libraries for compiling ATM (Asynchronous
++ Transfer Mode) related programs.
++ .
++ Homepage: http://linux-atm.sourceforge.net/
+--- linux-atm-2.4.1.orig/debian/atm-tools.install
++++ linux-atm-2.4.1/debian/atm-tools.install
+@@ -0,0 +1,18 @@
++debian/tmp/usr/share/man/*
++debian/tmp/usr/bin/*
++debian/tmp/usr/sbin/atmsigd
++debian/tmp/usr/sbin/atmaddr
++debian/tmp/usr/sbin/esi
++debian/tmp/usr/sbin/atmloop
++debian/tmp/usr/sbin/atmtcp
++debian/tmp/usr/sbin/enitune
++debian/tmp/usr/sbin/zntune
++debian/tmp/usr/sbin/atmarp sbin
++debian/tmp/usr/sbin/atmarpd sbin
++debian/tmp/usr/sbin/ilmid
++debian/tmp/usr/sbin/zeppelin
++debian/tmp/usr/sbin/les
++debian/tmp/usr/sbin/bus
++debian/tmp/usr/sbin/lecs
++debian/tmp/usr/sbin/mpcd
++debian/tmp/etc/atmsigd.conf
+--- linux-atm-2.4.1.orig/debian/atm-tools.manpages
++++ linux-atm-2.4.1/debian/atm-tools.manpages
+@@ -0,0 +1 @@
++debian/atm-tools.8
+--- linux-atm-2.4.1.orig/debian/atm-tools.pod
++++ linux-atm-2.4.1/debian/atm-tools.pod
+@@ -0,0 +1,27 @@
++=head1 NAME
++
++linux-atm - preliminary manpage
++aread
++awrite
++enitune
++ilmid
++saaldump
++sonetdiag
++ttcp_atm
++zntune
++
++=head1 DOCUMENTATION
++
++atm-tools is a package containing the basic tools that are needed for
++setting up, monitoring, and tuning ATM networks. All available
++documentation can be found in /usr/share/doc/atnm-tools in Debian
++systems, and on the Web on: http://linux-atm.sourceforge.net.
++
++=head1 BUGS
++
++Many. Be prepared to debug.
++
++=head1 AUTHOR
++
++This manpage was written by Marc Haber for linux-atm packaging in
++Debian/GNU Operating System.
+--- linux-atm-2.4.1.orig/debian/changelog
++++ linux-atm-2.4.1/debian/changelog
+@@ -0,0 +1,212 @@
++linux-atm (2.4.1-17) unstable; urgency=low
++
++ * Fix build problem with gcc 4.0 (Closes: )
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Thu, 17 Mar 2005 23:02:03 +0100
++
++linux-atm (2.4.1-16) unstable; urgency=low
++
++ * Fix build problem with gcc 3.4 (Closes: #259422)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Thu, 15 Jul 2004 14:28:10 +0200
++
++linux-atm (2.4.1-15) unstable; urgency=low
++
++ * Updated descriptions (Closes: #239161)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Sun, 4 Apr 2004 21:10:20 +0200
++
++linux-atm (2.4.1-14) unstable; urgency=low
++
++ * Fix symlink for /usr/lib/libatm.so (Closes: #221011)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Sun, 7 Dec 2003 21:53:19 +0100
++
++linux-atm (2.4.1-13) unstable; urgency=low
++
++ * Previous version fixed #217259, but no changelog entry (Closes: #217259)
++ * Previous version fixed #216662, but no changelog entry (Closes: #216662)
++ * Added missing build dependency on automake1.4 (Closes: #221120, #221284)
++ * New Maintainer (Closes: #206982)
++
++ -- Peter De Schrijver (p2) <p2@mind.be> Mon, 17 Nov 2003 23:03:58 +0100
++
++linux-atm (2.4.1-12) unstable; urgency=low
++
++ * don't build atm-tools-br2684 by default. Thanks to ftpmaster for
++ not allowing the package to be in Debian.
++ * Since we don't build atm-tools-br2684 any more, revert back to
++ autotools output from 2.4.1-9
++ * Add README.br2684 documenting a way to build the package locally.
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 5 Nov 2003 21:31:42 +0000
++
++linux-atm (2.4.1-11) experimental; urgency=low
++
++ * Build-Depend on dpatch
++ * dpatch br2684 header files from later libc for old libc (woody)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 29 Oct 2003 19:05:07 +0000
++
++linux-atm (2.4.1-10) experimental; urgency=low
++
++ * add br2684 to package (closes: #216663)
++ * autoreconf to actually build br2684
++ * have libatm1-dev provide libatm-dev (closes: #216662)
++ * move lib symlink to libatm1-dev as well (closes: #217259)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Thu, 23 Oct 2003 17:55:43 +0000
++
++linux-atm (2.4.1-9) unstable; urgency=low
++
++ * put libatm1-dev in libdevel (closes: #213170)
++ * make sure that new descriptions actually make it into the package
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Thu, 9 Oct 2003 17:08:10 +0000
++
++linux-atm (2.4.1-8) unstable; urgency=low
++
++ * build arch-indep package as targets of binary-indep (closes: #212124)
++ * use dh_installdocs to install files to libatm1-dev/docs
++ * symlink shared lib to usr/bin (closes: #213146)
++ * Use better long descriptions. Thanks to Javier (closes: #209427)
++ Fernandez-Sanguino (closes: #209612)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Sun, 28 Sep 2003 19:29:08 +0000
++
++linux-atm (2.4.1-7) unstable; urgency=low
++
++ * libatm1 now conflicts with atm-tools (<< 2.4.1-6) (closes: #208170)
++ * armarp now writes output to stdout.
++ * add atm-dev as empty transitional package to help upgrades
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Tue, 2 Sep 2003 09:20:33 +0000
++
++linux-atm (2.4.1-6) unstable; urgency=low
++
++ * split off shared libraries to libatm1
++ * rename atm-dev to libatm1-dev
++ * Standards-Version: 3.6.1
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Tue, 26 Aug 2003 15:46:27 +0000
++
++linux-atm (2.4.1-5) unstable; urgency=low
++
++ * move *.a and *.la to usr/lib (closes: #199506).
++ * let atm-dev depend on atm-tools to avoid dangling /lib/libatm.so
++ symlink.
++ * Standards-Version: 3.5.6
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 30 Jul 2003 11:46:19 +0000
++
++linux-atm (2.4.1-4) unstable; urgency=low
++
++ * add Build-Depends: on automake1.4
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 11 Jun 2003 16:58:21 +0000
++
++linux-atm (2.4.1-3) unstable; urgency=low
++
++ * rebuilding libtool broke src/test/Makefile.in. Applied fix to
++ Makefile.am and re-built again.
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Wed, 11 Jun 2003 11:05:26 +0000
++
++linux-atm (2.4.1-2) unstable; urgency=low
++
++ * rebuild configure script with new libtool (closes: #196909)
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Tue, 10 Jun 2003 21:01:50 +0000
++
++linux-atm (2.4.1-1) unstable; urgency=low
++
++ * new upstream source
++ * remove atmarp and atmarpd from /usr/sbin as they are already in
++ /sbin (closes: #196216)
++ * lintian fixes
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Mon, 9 Jun 2003 16:03:45 +0000
++
++linux-atm (2.4.0-5) unstable; urgency=low
++
++ * Fix for src/test/Makefile.in to allow building on hppa and ia64
++ which the fix introduced to 2.4.0-4 broke. Thanks to Goswin
++ Brederlow.
++ * Move init.d priority to that atmarpd is started before network
++ interfaces are started.
++ * Move atmarpd and libatm to /sbin and /lib to allow atmarpd to be
++ started before /usr is mounted.
++ * use dh_install instead of dh_movefiles.
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Sat, 24 Aug 2002 15:13:48 +0000
++
++linux-atm (2.4.0-4) unstable; urgency=low
++
++ * new maintainer
++ * Fix for src/test/Makefile.in to allow building on sparc.
++ Thanks to Patrick Mauritz. (closes: #144225).
++ * added pseudo-manpage for manpage-less binaries.
++ * removed rpath by changing configure and make install paramaters
++
++ -- Marc Haber <mh+debian-packages@zugschlus.de> Fri, 16 Aug 2002 20:39:05 +0000
++
++linux-atm (2.4.0-3) unstable; urgency=HIGH
++
++ * Re-ran libtoolize.
++ Closes: #143522
++
++ * Previous version Closes: #135328
++
++ -- Russell Coker <russell@coker.com.au> Fri, 19 Apr 2002 01:55:00 +0200
++
++linux-atm (2.4.0-2) unstable; urgency=HIGH
++
++ * Put a "grep -v EMAXERRNO" into the build process to deal with mipsel and
++ the "#ifdef __KERNEL__" it has in it's /usr/include/asm/errno.h .
++
++ -- Russell Coker <russell@coker.com.au> Thu, 18 Apr 2002 19:56:00 +0200
++
++linux-atm (2.4.0-1) unstable; urgency=HIGH
++
++ * New upstream version which changes source package name.
++ Closes: #138911
++
++ -- Russell Coker <russell@coker.com.au> Mon, 18 Mar 2002 17:42:00 +0100
++
++atm (0.79-4) unstable; urgency=low
++
++ * Added build-depends on flex.
++ Closes: #111072
++
++ * Made the atm tools use a shared object to save space.
++
++ * Fixed the copyright file and put all copyright details in both packages.
++
++ * Added support for easy building with different kernel headers.
++ Closes: #110249
++
++ -- Russell Coker <russell@coker.com.au> Sun, 7 Oct 2001 14:11:33 +0200
++
++atm (0.79-3) unstable; urgency=low
++
++ * Created /etc/init.d/atm to start and stop atmarpd.
++ Closes: #110252
++
++ * Added build-depends on bison.
++ Closes: #110576
++
++ -- Russell Coker <russell@coker.com.au> Fri, 31 Aug 2001 15:21:44 +0200
++
++atm (0.79-2) unstable; urgency=low
++
++ * Changed the main package name to atm-tools to indicate that it doesn't
++ provide ATM (gotta have the kernel support), it just has the daemons and
++ utilities.
++
++ -- Russell Coker <russell@coker.com.au> Sat, 25 Aug 2001 17:55:00 +0200
++
++atm (0.79-1) unstable; urgency=low
++
++ * Initial Release.
++
++ -- Russell Coker <russell@coker.com.au> Fri, 24 Aug 2001 17:31:00 +0200
+--- linux-atm-2.4.1.orig/debian/checkout-br2684
++++ linux-atm-2.4.1/debian/checkout-br2684
+@@ -0,0 +1,25 @@
++#!/bin/bash -x
++
++set -e
++
++# check out br2684 from upstream CVS. We need to jump through hoops if
++# the local source package is under cvs control as well.
++
++CVSDIR=":pserver:anonymous:@cvs.linux-atm.sourceforge.net.:/cvsroot/linux-atm"
++DIR="br2684"
++TMPDIR="/tmp"
++TARGETDIR="src"
++
++cvs -d${CVSDIR} login
++
++mkdir -p $TMPDIR
++pushd $TMPDIR
++cvs -z6 -d${CVSDIR} export -d $DIR -r V2_5_0 linux-atm/src/br2684
++
++popd
++
++mv $TMPDIR/$DIR/* $TARGETDIR/$DIR
++rm -rf $TMPDIR/$DIR
++
++autoreconf -i -f
++
+--- linux-atm-2.4.1.orig/debian/copyright.header
++++ linux-atm-2.4.1/debian/copyright.header
+@@ -0,0 +1,18 @@
++This package was debianized by Russell Coker <russell@coker.com.au> on
++Fri, 24 Aug 2001 16:11:12 +0200 and is now maintained by Marc Haber
++<mh+debian-packages@zugschlus.de>.
++
++It was downloaded from http://www.sourceforge.net/projects/linux-atm/
++
++See also http://linux-atm.sourceforge.net/dist.php
++
++Upstream Authors:
++Werner Almesberger EPFL ICA <Werner.Almesberger@epfl.ch>
++Mitchell Blank Jr. <mitch@sfgoth.com>
++Paul B Schroeder <paulsch@us.ibm.com>
++
++Copyright:
++
++GPL 2.0
++
++See /usr/share/common-licenses/GPL-2
+--- linux-atm-2.4.1.orig/debian/libatm1-dev.dirs
++++ linux-atm-2.4.1/debian/libatm1-dev.dirs
+@@ -0,0 +1,2 @@
++usr/lib
++usr/include
+--- linux-atm-2.4.1.orig/debian/libatm1-dev.docs
++++ linux-atm-2.4.1/debian/libatm1-dev.docs
+@@ -0,0 +1,2 @@
++doc/README.CLP
++doc/atm-linux-howto.txt
+--- linux-atm-2.4.1.orig/debian/libatm1-dev.install
++++ linux-atm-2.4.1/debian/libatm1-dev.install
+@@ -0,0 +1,2 @@
++debian/tmp/usr/include/*
++debian/tmp/usr/lib/*.a usr/lib
+--- linux-atm-2.4.1.orig/debian/libatm1-dev.links
++++ linux-atm-2.4.1/debian/libatm1-dev.links
+@@ -0,0 +1 @@
++lib/libatm.so.1 usr/lib/libatm.so
+--- linux-atm-2.4.1.orig/debian/libatm1.dirs
++++ linux-atm-2.4.1/debian/libatm1.dirs
+@@ -0,0 +1 @@
++/lib
+--- linux-atm-2.4.1.orig/debian/libatm1.install
++++ linux-atm-2.4.1/debian/libatm1.install
+@@ -0,0 +1 @@
++debian/tmp/usr/lib/libatm.so.* lib
diff --git a/package/linux-atm/patches/010-header_stupidity.patch b/package/linux-atm/patches/010-header_stupidity.patch
new file mode 100644
index 000000000..98be104c7
--- /dev/null
+++ b/package/linux-atm/patches/010-header_stupidity.patch
@@ -0,0 +1,13 @@
+$Id$
+
+--- linux-atm-2.4.1/src/include/stdint.h.orig Mon Sep 3 18:40:44 2001
++++ linux-atm-2.4.1/src/include/stdint.h Sun Jun 18 23:24:20 2006
+@@ -6,7 +6,7 @@
+
+ #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
+
+-#include "/usr/include/stdint.h"
++#include_next <stdint.h>
+
+ #elif __GLIBC__ >= 2
+
diff --git a/package/linux-atm/patches/100-br2684.patch b/package/linux-atm/patches/100-br2684.patch
new file mode 100644
index 000000000..dfb1de020
--- /dev/null
+++ b/package/linux-atm/patches/100-br2684.patch
@@ -0,0 +1,488 @@
+diff -ruN linux-atm-2.4.1/configure.in linux-atm-2.4.1.new/configure.in
+--- linux-atm-2.4.1/configure.in 2003-04-25 04:17:05.000000000 +0200
++++ linux-atm-2.4.1.new/configure.in 2005-07-27 15:45:49.532396543 +0200
+@@ -153,26 +153,6 @@
+ src/Makefile \
+ src/include/Makefile \
+ src/lib/Makefile \
+- src/test/Makefile \
+- src/debug/Makefile \
+- src/qgen/Makefile \
+- src/saal/Makefile \
+- src/sigd/Makefile \
+- src/maint/Makefile \
+- src/arpd/Makefile \
+- src/ilmid/Makefile \
+- src/ilmid/asn1/Makefile \
+- src/man/Makefile \
+- src/led/Makefile \
+- src/lane/Makefile \
+- src/mpoad/Makefile \
+- src/switch/Makefile \
+- src/switch/debug/Makefile \
+- src/switch/tcp/Makefile \
+- src/config/Makefile \
+- src/config/init-redhat/Makefile \
+- src/extra/Makefile \
+- src/extra/linux-atm.spec \
+- src/extra/ANS/Makefile
++ src/br2684/Makefile \
+ )
+
+diff -ruN linux-atm-2.4.1/src/br2684/Makefile linux-atm-2.4.1.new/src/br2684/Makefile
+--- linux-atm-2.4.1/src/br2684/Makefile 1970-01-01 02:00:00.000000000 +0200
++++ linux-atm-2.4.1.new/src/br2684/Makefile 2002-07-15 23:44:25.000000000 +0200
+@@ -0,0 +1,13 @@
++PREFIX=${TI_FILESYSTEM}
++
++all: br2684ctl
++
++br2684ctl: br2684ctl.c
++ gcc -latm -o br2684ctl br2684ctl.c
++ strip br2684ctl
++
++install: br2684ctl
++ cp br2684ctl $(PREFIX)/usr/sbin/
++
++clean:
++ rm -rf br2684ctl *.o
+diff -ruN linux-atm-2.4.1/src/Makefile.am linux-atm-2.4.1.new/src/Makefile.am
+--- linux-atm-2.4.1/src/Makefile.am 2001-10-03 23:14:53.000000000 +0200
++++ linux-atm-2.4.1.new/src/Makefile.am 2005-07-27 15:33:52.389309711 +0200
+@@ -1,3 +1,2 @@
+-SUBDIRS = include lib test debug qgen saal sigd maint arpd ilmid man led lane \
+- mpoad switch config extra
++SUBDIRS = include lib br2684
+
+
+diff -Nur linux-atm-2.4.1.orig/src/include/linux/atmbr2684.h linux-atm-2.4.1/src/include/linux/atmbr2684.h
+--- linux-atm-2.4.1.orig/src/include/linux/atmbr2684.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-atm-2.4.1/src/include/linux/atmbr2684.h 2005-11-13 00:06:42.000000000 +0100
+@@ -0,0 +1,117 @@
++#ifndef _LINUX_ATMBR2684_H
++#define _LINUX_ATMBR2684_H
++
++#include <linux/atm.h>
++#include <linux/if.h> /* For IFNAMSIZ */
++#include <linux/if_ether.h> /* ETH_P_* */
++
++/*
++ * Type of media we're bridging (ethernet, token ring, etc) Currently only
++ * ethernet is supported
++ */
++#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
++#define BR2684_MEDIA_802_4 (1) /* 802.4 */
++#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
++#define BR2684_MEDIA_FDDI (3)
++#define BR2684_MEDIA_802_6 (4) /* 802.6 */
++
++/*
++ * Is there FCS inbound on this VC? This currently isn't supported.
++ */
++#define BR2684_FCSIN_NO (0)
++#define BR2684_FCSIN_IGNORE (1)
++#define BR2684_FCSIN_VERIFY (2)
++
++/*
++ * Is there FCS outbound on this VC? This currently isn't supported.
++ */
++#define BR2684_FCSOUT_NO (0)
++#define BR2684_FCSOUT_SENDZERO (1)
++#define BR2684_FCSOUT_GENERATE (2)
++
++/*
++ * Does this VC include LLC encapsulation?
++ */
++#define BR2684_ENCAPS_VC (0) /* VC-mux */
++#define BR2684_ENCAPS_LLC (1)
++#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
++
++/*
++ * Is this VC bridged or routed?
++ */
++
++#define BR2684_PAYLOAD_ROUTED (0)
++#define BR2684_PAYLOAD_BRIDGED (1)
++
++
++/*
++ * This is for the ATM_NEWBACKENDIF call - these are like socket families:
++ * the first element of the structure is the backend number and the rest
++ * is per-backend specific
++ */
++struct atm_newif_br2684 {
++ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
++ int media; /* BR2684_MEDIA_* */
++ char ifname[IFNAMSIZ];
++ int mtu;
++ int payload; /* bridged or routed */
++};
++
++/*
++ * This structure is used to specify a br2684 interface - either by a
++ * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
++ */
++#define BR2684_FIND_BYNOTHING (0)
++#define BR2684_FIND_BYNUM (1)
++#define BR2684_FIND_BYIFNAME (2)
++struct br2684_if_spec {
++ int method; /* BR2684_FIND_* */
++ union {
++ char ifname[IFNAMSIZ];
++ int devnum;
++ } spec;
++};
++
++/*
++ * This is for the ATM_SETBACKEND call - these are like socket families:
++ * the first element of the structure is the backend number and the rest
++ * is per-backend specific
++ */
++struct atm_backend_br2684 {
++ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
++ struct br2684_if_spec ifspec;
++ int fcs_in; /* BR2684_FCSIN_* */
++ int fcs_out; /* BR2684_FCSOUT_* */
++ int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
++ int encaps; /* BR2684_ENCAPS_* */
++ int payload; /* BR2684_PAYLOAD_* */
++ int has_vpiid; /* 1: use vpn_id - Unsupported */
++ __u8 vpn_id[7];
++ int send_padding; /* unsupported */
++ int min_size; /* we will pad smaller packets than this */
++};
++
++/*
++ * The BR2684_SETFILT ioctl is an experimental mechanism for folks
++ * terminating a large number of IP-only vcc's. When netfilter allows
++ * efficient per-if in/out filters, this support will be removed
++ */
++struct br2684_filter {
++ __u32 prefix; /* network byte order */
++ __u32 netmask; /* 0 = disable filter */
++};
++
++struct br2684_filter_set {
++ struct br2684_if_spec ifspec;
++ struct br2684_filter filter;
++};
++
++enum br2684_payload {
++ p_routed = BR2684_PAYLOAD_ROUTED,
++ p_bridged = BR2684_PAYLOAD_BRIDGED,
++};
++
++#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
++ struct br2684_filter_set)
++
++#endif /* _LINUX_ATMBR2684_H */
+--- linux-atm-2.4.1/src/br2684/br2684ctl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-atm-2.4.1.new/src/br2684/br2684ctl.c 2006-02-07 14:19:42.000000000 +0100
+@@ -0,0 +1,307 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <errno.h>
++#include <sys/ioctl.h>
++#include <string.h>
++#include <syslog.h>
++#include <atm.h>
++#include <linux/atmdev.h>
++#include <linux/atmbr2684.h>
++
++/* Written by Marcell GAL <cell@sch.bme.hu> to make use of the */
++/* ioctls defined in the br2684... kernel patch */
++/* Compile with cc -o br2684ctl br2684ctl.c -latm */
++
++/*
++ Modified feb 2001 by Stephen Aaskov (saa@lasat.com)
++ - Added daemonization code
++ - Added syslog
++
++ TODO: Delete interfaces after exit?
++*/
++
++
++#define LOG_NAME "RFC1483/2684 bridge"
++#define LOG_OPTION LOG_PERROR
++#define LOG_FACILITY LOG_LOCAL0
++
++
++int lastsock, lastitf;
++
++void fatal(char *str, int i)
++{
++ syslog(LOG_ERR, "Fatal: %s", str);
++ exit(-2);
++};
++
++
++void exitFunc(void)
++{
++ syslog(LOG_PID, "Daemon terminated\n");
++}
++
++
++int create_pidfile(char *nstr)
++{
++ FILE *pidfile = NULL;
++ char name[20];
++ int num;
++
++ if (nstr == NULL)
++ return -1;
++ num = atoi(nstr);
++ if (num < 0)
++ return -1;
++
++ snprintf(name, 20, "/var/run/nas%d.pid", num);
++ pidfile = fopen(name, "w");
++ if (pidfile == NULL)
++ return -1;
++ fprintf(pidfile, "%d", getpid());
++ fclose(pidfile);
++
++ return 0;
++}
++
++int create_br(char *nstr, int payload)
++{
++ int num, err;
++
++ if (lastsock < 0) {
++ lastsock = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5);
++ }
++ if (lastsock < 0) {
++ syslog(LOG_ERR, "socket creation failed: %s",
++ strerror(errno));
++ } else {
++ /* create the device with ioctl: */
++ num = atoi(nstr);
++ if (num >= 0 && num < 1234567890) {
++ struct atm_newif_br2684 ni;
++ ni.backend_num = ATM_BACKEND_BR2684;
++ ni.media = BR2684_MEDIA_ETHERNET;
++ ni.mtu = 1500;
++ ni.payload = payload; /* bridged or routed */
++ sprintf(ni.ifname, "nas%d", num);
++ err = ioctl(lastsock, ATM_NEWBACKENDIF, &ni);
++
++ if (err == 0)
++ syslog(LOG_INFO,
++ "Interface \"%s\" (mtu=%d, payload=%s) created sucessfully\n",
++ ni.ifname, ni.mtu,ni.payload ? "bridged" : "routed");
++ else
++ syslog(LOG_INFO,
++ "Interface \"%s\" could not be created, reason: %s\n",
++ ni.ifname, strerror(errno));
++ lastitf = num; /* even if we didn't create, because existed, assign_vcc wil want to know it! */
++ } else {
++ syslog(LOG_ERR, "err: strange interface number %d",
++ num);
++ }
++ }
++ return 0;
++}
++
++
++int assign_vcc(char *astr, int encap, int payload, int bufsize)
++{
++ int err, errno;
++ struct atm_qos qos;
++ struct sockaddr_atmpvc addr;
++ int fd;
++ struct atm_backend_br2684 be;
++
++ memset(&addr, 0, sizeof(addr));
++ err =
++ text2atm(astr, (struct sockaddr *) (&addr), sizeof(addr),
++ T2A_PVC);
++ if (err != 0)
++ syslog(LOG_ERR,
++ "Could not parse ATM parameters (error=%d)\n", err);
++
++#if 0
++ addr.sap_family = AF_ATMPVC;
++ addr.sap_addr.itf = itf;
++ addr.sap_addr.vpi = 0;
++ addr.sap_addr.vci = vci;
++#endif
++ syslog(LOG_INFO,
++ "Communicating over ATM %d.%d.%d, encapsulation: %s\n",
++ addr.sap_addr.itf, addr.sap_addr.vpi, addr.sap_addr.vci,
++ encap ? "VC mux" : "LLC");
++
++ if ((fd = socket(PF_ATMPVC, SOCK_DGRAM, ATM_AAL5)) < 0)
++ syslog(LOG_ERR, "failed to create socket %d, reason: %s",
++ errno, strerror(errno));
++
++
++ memset(&qos, 0, sizeof(qos));
++ qos.aal = ATM_AAL5;
++ qos.txtp.traffic_class = ATM_UBR;
++ qos.txtp.max_sdu = 1524;
++ qos.txtp.pcr = ATM_MAX_PCR;
++ qos.rxtp = qos.txtp;
++
++ if ((err =
++ setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bufsize,
++ sizeof(bufsize))))
++ syslog(LOG_ERR, "setsockopt SO_SNDBUF: (%d) %s\n", err,
++ strerror(err));
++
++ if (setsockopt(fd, SOL_ATM, SO_ATMQOS, &qos, sizeof(qos)) < 0)
++ syslog(LOG_ERR, "setsockopt SO_ATMQOS %d", errno);
++
++ err =
++ connect(fd, (struct sockaddr *) &addr,
++ sizeof(struct sockaddr_atmpvc));
++
++ if (err < 0)
++ fatal("failed to connect on socket", err);
++
++ /* attach the vcc to device: */
++
++ be.backend_num = ATM_BACKEND_BR2684;
++ be.ifspec.method = BR2684_FIND_BYIFNAME;
++ sprintf(be.ifspec.spec.ifname, "nas%d", lastitf);
++ be.fcs_in = BR2684_FCSIN_NO;
++ be.fcs_out = BR2684_FCSOUT_NO;
++ be.fcs_auto = 0;
++ be.encaps = encap ? BR2684_ENCAPS_VC : BR2684_ENCAPS_LLC;
++ be.payload = payload;
++ be.has_vpiid = 0;
++ be.send_padding = 0;
++ be.min_size = 0;
++ err = ioctl(fd, ATM_SETBACKEND, &be);
++ if (err == 0)
++ syslog(LOG_INFO, "Interface configured");
++ else {
++ syslog(LOG_ERR, "Could not configure interface:%s",
++ strerror(errno));
++ exit(2);
++ }
++ return fd;
++}
++
++
++
++void usage(char *s)
++{
++ printf("usage: %s [-b] [[-c number] [-e 0|1] [-p 0|1] [-s num] [-a [itf.]vpi.vci]*]*\n"
++ " -b = run in background (daemonize)\n"
++ " -c <num> = use interface nas<num>\n"
++ " -e 0|1 = encapsulation (0=LLC, 1=VC Mux)\n"
++ " -p 0|1 = payload type (0=routed,1=bridged)\n"
++ " -s <num> = set sndbuf (send buffer) size (default 8192)\n"
++ " -a [itf.]vpi.vci = ATM interface no, VPI, VCI\n",
++ s);
++ exit(1);
++}
++
++
++
++int main(int argc, char **argv)
++{
++ int c, background = 0, encap = 0, sndbuf = 8192, payload = 1;
++ char *itfnum = NULL;
++
++ lastsock = -1;
++ lastitf = 0;
++
++ openlog(LOG_NAME, LOG_OPTION, LOG_FACILITY);
++ if (argc > 1)
++ while ((c = getopt(argc, argv, "a:bc:e:s:p:t:?h")) != EOF)
++ switch (c) {
++ case 'a':
++ assign_vcc(optarg, encap, payload, sndbuf);
++ break;
++ case 'b':
++ background = 1;
++ break;
++ case 'c':
++ create_br(optarg, payload);
++ itfnum = strdup(optarg);
++ break;
++ case 'e':
++ encap = (atoi(optarg));
++ if (encap < 0) {
++ syslog(LOG_ERR,
++ "invalid encapsulation: %s:\n",
++ optarg);
++ encap = 0;
++ }
++ break;
++ case 's':
++ sndbuf = (atoi(optarg));
++ if (sndbuf < 0) {
++ syslog(LOG_ERR,
++ "Invalid sndbuf: %s, using size of 8192 instead\n",
++ optarg);
++ sndbuf = 8192;
++ }
++ break;
++ case 'p': /* payload type: routed (0) or bridged (1) */
++ payload = atoi(optarg);
++ break;
++ case '?':
++ case 'h':
++ default:
++ usage(argv[0]);
++ } else
++ usage(argv[0]);
++
++ if (argc != optind)
++ usage(argv[0]);
++
++ if (lastsock >= 0)
++ close(lastsock);
++
++ if (background) {
++ pid_t pid;
++
++ pid = fork();
++ if (pid < 0) {
++ fprintf(stderr, "Error detaching\n");
++ exit(2);
++ } else if (pid)
++ exit(0); // This is the parent
++
++ // Become a process group and session group leader
++ if (setsid() < 0) {
++ fprintf(stderr, "Could not set process group\n");
++ exit(2);
++ }
++ // Fork again to let process group leader exit
++ pid = fork();
++ if (pid < 0) {
++ fprintf(stderr,
++ "Error detaching during second fork\n");
++ exit(2);
++ } else if (pid)
++ exit(0); // This is the parent
++
++ // Now we're ready for buisness
++ chdir("/"); // Don't keep directories in use
++ close(0);
++ close(1);
++ close(2); // Close stdin, -out and -error
++ /*
++ Note that this implementation does not keep an open
++ stdout/err.
++ If we need them they can be opened now
++ */
++
++ }
++
++ if (itfnum != NULL) {
++ create_pidfile(itfnum);
++ free(itfnum);
++ }
++
++ syslog(LOG_INFO, "RFC 1483/2684 bridge daemon started\n");
++ atexit(exitFunc);
++
++ while (1)
++ sleep(30); /* to keep the sockets... */
++ return 0;
++}
diff --git a/package/linux-atm/patches/200-no_libfl.patch b/package/linux-atm/patches/200-no_libfl.patch
new file mode 100644
index 000000000..1b538b2a3
--- /dev/null
+++ b/package/linux-atm/patches/200-no_libfl.patch
@@ -0,0 +1,193 @@
+diff -ruN linux-atm-2.4.1/src/qgen/Makefile.am linux-atm-2.4.1.new/src/qgen/Makefile.am
+--- linux-atm-2.4.1/src/qgen/Makefile.am 2001-09-03 20:41:05.000000000 +0200
++++ linux-atm-2.4.1.new/src/qgen/Makefile.am 2005-07-26 14:49:05.000000000 +0200
+@@ -3,7 +3,7 @@
+
+ qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c \
+ qgen.h second.c third.c
+-qgen_LDADD = -lfl
++qgen_LDADD =
+
+ q_dump_SOURCES = common.c
+ q_dump_LDADD = qd.dump.standalone.o
+diff -ruN linux-atm-2.4.1/src/qgen/Makefile.in linux-atm-2.4.1.new/src/qgen/Makefile.in
+--- linux-atm-2.4.1/src/qgen/Makefile.in 2003-04-30 16:44:01.000000000 +0200
++++ linux-atm-2.4.1.new/src/qgen/Makefile.in 2005-07-26 14:49:13.000000000 +0200
+@@ -91,7 +91,7 @@
+ qgen_SOURCES = common.c common.h file.c file.h first.c ql_y.y ql_l.l qgen.c \
+ qgen.h second.c third.c
+
+-qgen_LDADD = -lfl
++qgen_LDADD =
+
+ q_dump_SOURCES = common.c
+ q_dump_LDADD = qd.dump.standalone.o
+diff -ruN linux-atm-2.4.1/src/qgen/ql_l.c linux-atm-2.4.1.new/src/qgen/ql_l.c
+--- linux-atm-2.4.1/src/qgen/ql_l.c 2003-04-24 21:46:49.000000000 +0200
++++ linux-atm-2.4.1.new/src/qgen/ql_l.c 2005-07-26 20:45:40.000000000 +0200
+@@ -11,6 +11,11 @@
+ #include <stdio.h>
+ #include <unistd.h>
+
++int yywrap(void)
++{
++ return 1;
++}
++
+
+ /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+ #ifdef c_plusplus
+diff -ruN linux-atm-2.4.1/src/sigd/cfg_l.c linux-atm-2.4.1.new/src/sigd/cfg_l.c
+--- linux-atm-2.4.1/src/sigd/cfg_l.c 2003-04-24 21:47:21.000000000 +0200
++++ linux-atm-2.4.1.new/src/sigd/cfg_l.c 2005-07-26 22:04:13.000000000 +0200
+@@ -11,6 +11,10 @@
+ #include <stdio.h>
+ #include <unistd.h>
+
++int yywrap(void)
++{
++ return 1;
++}
+
+ /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+ #ifdef c_plusplus
+diff -ruN linux-atm-2.4.1/src/sigd/Makefile.am linux-atm-2.4.1.new/src/sigd/Makefile.am
+--- linux-atm-2.4.1/src/sigd/Makefile.am 2001-10-04 23:17:26.000000000 +0200
++++ linux-atm-2.4.1.new/src/sigd/Makefile.am 2005-07-26 14:49:44.000000000 +0200
+@@ -8,7 +8,7 @@
+ $(top_builddir)/src/qgen/qd.dump.o \
+ $(top_builddir)/src/lib/libatm.la \
+ $(top_builddir)/src/saal/libsaal.a
+-atmsigd_LDADD = $(atmsigd_XTRAS) -lfl
++atmsigd_LDADD = $(atmsigd_XTRAS)
+ atmsigd_DEPENDENCIES = mess.c $(atmsigd_XTRAS)
+
+ CLEANFILES = mess.c
+diff -ruN linux-atm-2.4.1/src/sigd/Makefile.in linux-atm-2.4.1.new/src/sigd/Makefile.in
+--- linux-atm-2.4.1/src/sigd/Makefile.in 2003-04-30 16:44:03.000000000 +0200
++++ linux-atm-2.4.1.new/src/sigd/Makefile.in 2005-07-26 14:49:48.000000000 +0200
+@@ -97,7 +97,7 @@
+ $(top_builddir)/src/lib/libatm.la \
+ $(top_builddir)/src/saal/libsaal.a
+
+-atmsigd_LDADD = $(atmsigd_XTRAS) -lfl
++atmsigd_LDADD = $(atmsigd_XTRAS)
+ atmsigd_DEPENDENCIES = mess.c $(atmsigd_XTRAS)
+
+ CLEANFILES = mess.c
+diff -ruN linux-atm-2.4.1/src/switch/debug/debug.c linux-atm-2.4.1.new/src/switch/debug/debug.c
+--- linux-atm-2.4.1/src/switch/debug/debug.c 2001-09-03 20:41:06.000000000 +0200
++++ linux-atm-2.4.1.new/src/switch/debug/debug.c 2005-07-26 22:06:53.000000000 +0200
+@@ -20,6 +20,11 @@
+
+ #define PRV(call) ((FAB *) (call)->fab)
+
++int yywrap(void)
++{
++ return 1;
++}
++
+
+ typedef struct _fab {
+ CALL *next; /* relay.c may not keep track of calls, but WE are */
+diff -ruN linux-atm-2.4.1/src/switch/debug/Makefile.am linux-atm-2.4.1.new/src/switch/debug/Makefile.am
+--- linux-atm-2.4.1/src/switch/debug/Makefile.am 2001-10-04 23:17:26.000000000 +0200
++++ linux-atm-2.4.1.new/src/switch/debug/Makefile.am 2005-07-26 14:50:03.000000000 +0200
+@@ -5,7 +5,7 @@
+ sw_debug_SOURCES = debug.c
+ sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a \
+ $(top_builddir)/src/lib/libatm.la
+-sw_debug_LDADD = $(sw_debug_XTRAS) -lfl
++sw_debug_LDADD = $(sw_debug_XTRAS)
+
+ sw_debug_DEPENDENCIES = $(sw_debug_XTRAS)
+
+diff -ruN linux-atm-2.4.1/src/switch/debug/Makefile.in linux-atm-2.4.1.new/src/switch/debug/Makefile.in
+--- linux-atm-2.4.1/src/switch/debug/Makefile.in 2003-04-30 16:44:13.000000000 +0200
++++ linux-atm-2.4.1.new/src/switch/debug/Makefile.in 2005-07-26 14:50:08.000000000 +0200
+@@ -93,7 +93,7 @@
+ sw_debug_XTRAS = $(top_builddir)/src/switch/libsw.a \
+ $(top_builddir)/src/lib/libatm.la
+
+-sw_debug_LDADD = $(sw_debug_XTRAS) -lfl
++sw_debug_LDADD = $(sw_debug_XTRAS)
+
+ sw_debug_DEPENDENCIES = $(sw_debug_XTRAS)
+
+diff -ruN linux-atm-2.4.1/src/switch/tcp/Makefile.am linux-atm-2.4.1.new/src/switch/tcp/Makefile.am
+--- linux-atm-2.4.1/src/switch/tcp/Makefile.am 2001-10-04 23:17:27.000000000 +0200
++++ linux-atm-2.4.1.new/src/switch/tcp/Makefile.am 2005-07-26 14:50:16.000000000 +0200
+@@ -5,7 +5,7 @@
+ sw_tcp_SOURCES = tcpsw.c
+ sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a \
+ $(top_builddir)/src/lib/libatm.la
+-sw_tcp_LDADD = $(sw_tcp_XTRAS) -lfl
++sw_tcp_LDADD = $(sw_tcp_XTRAS)
+ sw_tcp_DEPENDENCIES = $(sw_tcp_XTRAS)
+
+ EXTRA_DIST = mkfiles README
+diff -ruN linux-atm-2.4.1/src/switch/tcp/Makefile.in linux-atm-2.4.1.new/src/switch/tcp/Makefile.in
+--- linux-atm-2.4.1/src/switch/tcp/Makefile.in 2003-04-30 16:44:14.000000000 +0200
++++ linux-atm-2.4.1.new/src/switch/tcp/Makefile.in 2005-07-26 14:50:19.000000000 +0200
+@@ -93,7 +93,7 @@
+ sw_tcp_XTRAS = $(top_builddir)/src/switch/libsw.a \
+ $(top_builddir)/src/lib/libatm.la
+
+-sw_tcp_LDADD = $(sw_tcp_XTRAS) -lfl
++sw_tcp_LDADD = $(sw_tcp_XTRAS)
+ sw_tcp_DEPENDENCIES = $(sw_tcp_XTRAS)
+
+ EXTRA_DIST = mkfiles README
+diff -ruN linux-atm-2.4.1/src/switch/tcp/tcpsw.c linux-atm-2.4.1.new/src/switch/tcp/tcpsw.c
+--- linux-atm-2.4.1/src/switch/tcp/tcpsw.c 2001-09-03 20:41:06.000000000 +0200
++++ linux-atm-2.4.1.new/src/switch/tcp/tcpsw.c 2005-07-26 22:08:25.000000000 +0200
+@@ -35,6 +35,10 @@
+ #define MAX_PACKET (ATM_MAX_AAL5_PDU+sizeof(struct atmtcp_hdr))
+ #define BUFFER_SIZE (MAX_PACKET*2)
+
++int yywrap(void)
++{
++ return 1;
++}
+
+ typedef struct _table {
+ struct _link *out; /* output port */
+diff -ruN linux-atm-2.4.1/src/test/ispl_l.c linux-atm-2.4.1.new/src/test/ispl_l.c
+--- linux-atm-2.4.1/src/test/ispl_l.c 2003-04-24 21:46:39.000000000 +0200
++++ linux-atm-2.4.1.new/src/test/ispl_l.c 2005-07-26 20:45:19.000000000 +0200
+@@ -11,6 +11,11 @@
+ #include <stdio.h>
+ #include <unistd.h>
+
++int yywrap(void)
++{
++ return 1;
++}
++
+
+ /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+ #ifdef c_plusplus
+diff -ruN linux-atm-2.4.1/src/test/Makefile.am linux-atm-2.4.1.new/src/test/Makefile.am
+--- linux-atm-2.4.1/src/test/Makefile.am 2001-10-04 23:17:27.000000000 +0200
++++ linux-atm-2.4.1.new/src/test/Makefile.am 2005-07-26 14:49:27.000000000 +0200
+@@ -15,7 +15,7 @@
+ bw_SOURCES = bw.c
+ isp_SOURCES = isp.c isp.h ispl_y.y ispl_l.l
+ isp_XTRAS = $(LDADD)
+-isp_LDADD = $(isp_XTRAS) -lfl
++isp_LDADD = $(isp_XTRAS)
+ isp_DEPENDENCIES = $(isp_XTRAS) errnos.inc
+ window_SOURCES = window.c
+
+diff -ruN linux-atm-2.4.1/src/test/Makefile.in linux-atm-2.4.1.new/src/test/Makefile.in
+--- linux-atm-2.4.1/src/test/Makefile.in 2003-04-30 16:43:59.000000000 +0200
++++ linux-atm-2.4.1.new/src/test/Makefile.in 2005-07-26 14:49:32.000000000 +0200
+@@ -102,7 +102,7 @@
+ bw_SOURCES = bw.c
+ isp_SOURCES = isp.c isp.h ispl_y.y ispl_l.l
+ isp_XTRAS = $(LDADD)
+-isp_LDADD = $(isp_XTRAS) -lfl
++isp_LDADD = $(isp_XTRAS)
+ isp_DEPENDENCIES = $(isp_XTRAS) errnos.inc
+ window_SOURCES = window.c
+
diff --git a/package/linux-atm/patches/300-no_autotools.patch b/package/linux-atm/patches/300-no_autotools.patch
new file mode 100644
index 000000000..18065ae35
--- /dev/null
+++ b/package/linux-atm/patches/300-no_autotools.patch
@@ -0,0 +1,22686 @@
+diff -urN linux-atm.old/aclocal.m4 linux-atm.dev/aclocal.m4
+--- linux-atm.old/aclocal.m4 2005-08-23 01:12:10.833789000 +0200
++++ linux-atm.dev/aclocal.m4 2005-08-23 01:12:44.813623720 +0200
+@@ -10,6 +10,825 @@
+ dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ dnl PARTICULAR PURPOSE.
+
++# lib-prefix.m4 serial 4 (gettext-0.14.2)
++dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl From Bruno Haible.
++
++dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
++dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
++dnl require excessive bracketing.
++ifdef([AC_HELP_STRING],
++[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
++[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
++
++dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
++dnl to access previously installed libraries. The basic assumption is that
++dnl a user will want packages to use other packages he previously installed
++dnl with the same --prefix option.
++dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
++dnl libraries, but is otherwise very convenient.
++AC_DEFUN([AC_LIB_PREFIX],
++[
++ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
++ AC_REQUIRE([AC_PROG_CC])
++ AC_REQUIRE([AC_CANONICAL_HOST])
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ dnl By default, look in $includedir and $libdir.
++ use_additional=yes
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ AC_LIB_ARG_WITH([lib-prefix],
++[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
++ --without-lib-prefix don't search for libraries in includedir and libdir],
++[
++ if test "X$withval" = "Xno"; then
++ use_additional=no
++ else
++ if test "X$withval" = "X"; then
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ else
++ additional_includedir="$withval/include"
++ additional_libdir="$withval/lib"
++ fi
++ fi
++])
++ if test $use_additional = yes; then
++ dnl Potentially add $additional_includedir to $CPPFLAGS.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/include,
++ dnl 2. if it's already present in $CPPFLAGS,
++ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_includedir" != "X/usr/include"; then
++ haveit=
++ for x in $CPPFLAGS; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-I$additional_includedir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test "X$additional_includedir" = "X/usr/local/include"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ if test -d "$additional_includedir"; then
++ dnl Really add $additional_includedir to $CPPFLAGS.
++ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
++ fi
++ fi
++ fi
++ fi
++ dnl Potentially add $additional_libdir to $LDFLAGS.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/lib,
++ dnl 2. if it's already present in $LDFLAGS,
++ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_libdir" != "X/usr/lib"; then
++ haveit=
++ for x in $LDFLAGS; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$additional_libdir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test "X$additional_libdir" = "X/usr/local/lib"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux*) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ if test -d "$additional_libdir"; then
++ dnl Really add $additional_libdir to $LDFLAGS.
++ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
++ fi
++ fi
++ fi
++ fi
++ fi
++])
++
++dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
++dnl acl_final_exec_prefix, containing the values to which $prefix and
++dnl $exec_prefix will expand at the end of the configure script.
++AC_DEFUN([AC_LIB_PREPARE_PREFIX],
++[
++ dnl Unfortunately, prefix and exec_prefix get only finally determined
++ dnl at the end of configure.
++ if test "X$prefix" = "XNONE"; then
++ acl_final_prefix="$ac_default_prefix"
++ else
++ acl_final_prefix="$prefix"
++ fi
++ if test "X$exec_prefix" = "XNONE"; then
++ acl_final_exec_prefix='${prefix}'
++ else
++ acl_final_exec_prefix="$exec_prefix"
++ fi
++ acl_save_prefix="$prefix"
++ prefix="$acl_final_prefix"
++ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
++ prefix="$acl_save_prefix"
++])
++
++dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
++dnl variables prefix and exec_prefix bound to the values they will have
++dnl at the end of the configure script.
++AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
++[
++ acl_save_prefix="$prefix"
++ prefix="$acl_final_prefix"
++ acl_save_exec_prefix="$exec_prefix"
++ exec_prefix="$acl_final_exec_prefix"
++ $1
++ exec_prefix="$acl_save_exec_prefix"
++ prefix="$acl_save_prefix"
++])
++
++# lib-link.m4 serial 6 (gettext-0.14.3)
++dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl From Bruno Haible.
++
++AC_PREREQ(2.50)
++
++dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
++dnl augments the CPPFLAGS variable.
++AC_DEFUN([AC_LIB_LINKFLAGS],
++[
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ AC_REQUIRE([AC_LIB_RPATH])
++ define([Name],[translit([$1],[./-], [___])])
++ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
++ AC_LIB_LINKFLAGS_BODY([$1], [$2])
++ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
++ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
++ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
++ ])
++ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
++ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
++ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
++ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++ AC_SUBST([LIB]NAME)
++ AC_SUBST([LTLIB]NAME)
++ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
++ dnl results of this search when this library appears as a dependency.
++ HAVE_LIB[]NAME=yes
++ undefine([Name])
++ undefine([NAME])
++])
++
++dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
++dnl searches for libname and the libraries corresponding to explicit and
++dnl implicit dependencies, together with the specified include files and
++dnl the ability to compile and link the specified testcode. If found, it
++dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
++dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
++dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
++dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
++AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
++[
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ AC_REQUIRE([AC_LIB_RPATH])
++ define([Name],[translit([$1],[./-], [___])])
++ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++
++ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
++ dnl accordingly.
++ AC_LIB_LINKFLAGS_BODY([$1], [$2])
++
++ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
++ dnl because if the user has installed lib[]Name and not disabled its use
++ dnl via --without-lib[]Name-prefix, he wants to use it.
++ ac_save_CPPFLAGS="$CPPFLAGS"
++ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++
++ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
++ ac_save_LIBS="$LIBS"
++ LIBS="$LIBS $LIB[]NAME"
++ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
++ LIBS="$ac_save_LIBS"
++ ])
++ if test "$ac_cv_lib[]Name" = yes; then
++ HAVE_LIB[]NAME=yes
++ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
++ AC_MSG_CHECKING([how to link with lib[]$1])
++ AC_MSG_RESULT([$LIB[]NAME])
++ else
++ HAVE_LIB[]NAME=no
++ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
++ dnl $INC[]NAME either.
++ CPPFLAGS="$ac_save_CPPFLAGS"
++ LIB[]NAME=
++ LTLIB[]NAME=
++ fi
++ AC_SUBST([HAVE_LIB]NAME)
++ AC_SUBST([LIB]NAME)
++ AC_SUBST([LTLIB]NAME)
++ undefine([Name])
++ undefine([NAME])
++])
++
++dnl Determine the platform dependent parameters needed to use rpath:
++dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
++dnl hardcode_direct, hardcode_minus_L.
++AC_DEFUN([AC_LIB_RPATH],
++[
++ dnl Tell automake >= 1.10 to complain if config.rpath is missing.
++ m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
++ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
++ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
++ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
++ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
++ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
++ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
++ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
++ . ./conftest.sh
++ rm -f ./conftest.sh
++ acl_cv_rpath=done
++ ])
++ wl="$acl_cv_wl"
++ libext="$acl_cv_libext"
++ shlibext="$acl_cv_shlibext"
++ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
++ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
++ hardcode_direct="$acl_cv_hardcode_direct"
++ hardcode_minus_L="$acl_cv_hardcode_minus_L"
++ dnl Determine whether the user wants rpath handling at all.
++ AC_ARG_ENABLE(rpath,
++ [ --disable-rpath do not hardcode runtime library paths],
++ :, enable_rpath=yes)
++])
++
++dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
++AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
++[
++ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++ dnl By default, look in $includedir and $libdir.
++ use_additional=yes
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ AC_LIB_ARG_WITH([lib$1-prefix],
++[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
++ --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
++[
++ if test "X$withval" = "Xno"; then
++ use_additional=no
++ else
++ if test "X$withval" = "X"; then
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ else
++ additional_includedir="$withval/include"
++ additional_libdir="$withval/lib"
++ fi
++ fi
++])
++ dnl Search the library and its dependencies in $additional_libdir and
++ dnl $LDFLAGS. Using breadth-first-seach.
++ LIB[]NAME=
++ LTLIB[]NAME=
++ INC[]NAME=
++ rpathdirs=
++ ltrpathdirs=
++ names_already_handled=
++ names_next_round='$1 $2'
++ while test -n "$names_next_round"; do
++ names_this_round="$names_next_round"
++ names_next_round=
++ for name in $names_this_round; do
++ already_handled=
++ for n in $names_already_handled; do
++ if test "$n" = "$name"; then
++ already_handled=yes
++ break
++ fi
++ done
++ if test -z "$already_handled"; then
++ names_already_handled="$names_already_handled $name"
++ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
++ dnl or AC_LIB_HAVE_LINKFLAGS call.
++ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
++ eval value=\"\$HAVE_LIB$uppername\"
++ if test -n "$value"; then
++ if test "$value" = yes; then
++ eval value=\"\$LIB$uppername\"
++ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
++ eval value=\"\$LTLIB$uppername\"
++ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
++ else
++ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
++ dnl that this library doesn't exist. So just drop it.
++ :
++ fi
++ else
++ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
++ dnl and the already constructed $LIBNAME/$LTLIBNAME.
++ found_dir=
++ found_la=
++ found_so=
++ found_a=
++ if test $use_additional = yes; then
++ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
++ found_dir="$additional_libdir"
++ found_so="$additional_libdir/lib$name.$shlibext"
++ if test -f "$additional_libdir/lib$name.la"; then
++ found_la="$additional_libdir/lib$name.la"
++ fi
++ else
++ if test -f "$additional_libdir/lib$name.$libext"; then
++ found_dir="$additional_libdir"
++ found_a="$additional_libdir/lib$name.$libext"
++ if test -f "$additional_libdir/lib$name.la"; then
++ found_la="$additional_libdir/lib$name.la"
++ fi
++ fi
++ fi
++ fi
++ if test "X$found_dir" = "X"; then
++ for x in $LDFLAGS $LTLIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ case "$x" in
++ -L*)
++ dir=`echo "X$x" | sed -e 's/^X-L//'`
++ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
++ found_dir="$dir"
++ found_so="$dir/lib$name.$shlibext"
++ if test -f "$dir/lib$name.la"; then
++ found_la="$dir/lib$name.la"
++ fi
++ else
++ if test -f "$dir/lib$name.$libext"; then
++ found_dir="$dir"
++ found_a="$dir/lib$name.$libext"
++ if test -f "$dir/lib$name.la"; then
++ found_la="$dir/lib$name.la"
++ fi
++ fi
++ fi
++ ;;
++ esac
++ if test "X$found_dir" != "X"; then
++ break
++ fi
++ done
++ fi
++ if test "X$found_dir" != "X"; then
++ dnl Found the library.
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
++ if test "X$found_so" != "X"; then
++ dnl Linking with a shared library. We attempt to hardcode its
++ dnl directory into the executable's runpath, unless it's the
++ dnl standard /usr/lib.
++ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
++ dnl No hardcoding is needed.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ else
++ dnl Use an explicit option to hardcode DIR into the resulting
++ dnl binary.
++ dnl Potentially add DIR to ltrpathdirs.
++ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++ haveit=
++ for x in $ltrpathdirs; do
++ if test "X$x" = "X$found_dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ ltrpathdirs="$ltrpathdirs $found_dir"
++ fi
++ dnl The hardcoding into $LIBNAME is system dependent.
++ if test "$hardcode_direct" = yes; then
++ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
++ dnl resulting binary.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ else
++ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
++ dnl Use an explicit option to hardcode DIR into the resulting
++ dnl binary.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ dnl Potentially add DIR to rpathdirs.
++ dnl The rpathdirs will be appended to $LIBNAME at the end.
++ haveit=
++ for x in $rpathdirs; do
++ if test "X$x" = "X$found_dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ rpathdirs="$rpathdirs $found_dir"
++ fi
++ else
++ dnl Rely on "-L$found_dir".
++ dnl But don't add it if it's already contained in the LDFLAGS
++ dnl or the already constructed $LIBNAME
++ haveit=
++ for x in $LDFLAGS $LIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$found_dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
++ fi
++ if test "$hardcode_minus_L" != no; then
++ dnl FIXME: Not sure whether we should use
++ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++ dnl here.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ else
++ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
++ dnl here, because this doesn't fit in flags passed to the
++ dnl compiler. So give up. No hardcoding. This affects only
++ dnl very old systems.
++ dnl FIXME: Not sure whether we should use
++ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++ dnl here.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++ fi
++ fi
++ fi
++ fi
++ else
++ if test "X$found_a" != "X"; then
++ dnl Linking with a static library.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
++ else
++ dnl We shouldn't come here, but anyway it's good to have a
++ dnl fallback.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
++ fi
++ fi
++ dnl Assume the include files are nearby.
++ additional_includedir=
++ case "$found_dir" in
++ */lib | */lib/)
++ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
++ additional_includedir="$basedir/include"
++ ;;
++ esac
++ if test "X$additional_includedir" != "X"; then
++ dnl Potentially add $additional_includedir to $INCNAME.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/include,
++ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
++ dnl 3. if it's already present in $CPPFLAGS or the already
++ dnl constructed $INCNAME,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_includedir" != "X/usr/include"; then
++ haveit=
++ if test "X$additional_includedir" = "X/usr/local/include"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ for x in $CPPFLAGS $INC[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-I$additional_includedir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test -d "$additional_includedir"; then
++ dnl Really add $additional_includedir to $INCNAME.
++ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
++ fi
++ fi
++ fi
++ fi
++ fi
++ dnl Look for dependencies.
++ if test -n "$found_la"; then
++ dnl Read the .la file. It defines the variables
++ dnl dlname, library_names, old_library, dependency_libs, current,
++ dnl age, revision, installed, dlopen, dlpreopen, libdir.
++ save_libdir="$libdir"
++ case "$found_la" in
++ */* | *\\*) . "$found_la" ;;
++ *) . "./$found_la" ;;
++ esac
++ libdir="$save_libdir"
++ dnl We use only dependency_libs.
++ for dep in $dependency_libs; do
++ case "$dep" in
++ -L*)
++ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
++ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/lib,
++ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
++ dnl 3. if it's already present in $LDFLAGS or the already
++ dnl constructed $LIBNAME,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_libdir" != "X/usr/lib"; then
++ haveit=
++ if test "X$additional_libdir" = "X/usr/local/lib"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ haveit=
++ for x in $LDFLAGS $LIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$additional_libdir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test -d "$additional_libdir"; then
++ dnl Really add $additional_libdir to $LIBNAME.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
++ fi
++ fi
++ haveit=
++ for x in $LDFLAGS $LTLIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$additional_libdir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test -d "$additional_libdir"; then
++ dnl Really add $additional_libdir to $LTLIBNAME.
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
++ fi
++ fi
++ fi
++ fi
++ ;;
++ -R*)
++ dir=`echo "X$dep" | sed -e 's/^X-R//'`
++ if test "$enable_rpath" != no; then
++ dnl Potentially add DIR to rpathdirs.
++ dnl The rpathdirs will be appended to $LIBNAME at the end.
++ haveit=
++ for x in $rpathdirs; do
++ if test "X$x" = "X$dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ rpathdirs="$rpathdirs $dir"
++ fi
++ dnl Potentially add DIR to ltrpathdirs.
++ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++ haveit=
++ for x in $ltrpathdirs; do
++ if test "X$x" = "X$dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ ltrpathdirs="$ltrpathdirs $dir"
++ fi
++ fi
++ ;;
++ -l*)
++ dnl Handle this in the next round.
++ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
++ ;;
++ *.la)
++ dnl Handle this in the next round. Throw away the .la's
++ dnl directory; it is already contained in a preceding -L
++ dnl option.
++ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
++ ;;
++ *)
++ dnl Most likely an immediate library name.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
++ ;;
++ esac
++ done
++ fi
++ else
++ dnl Didn't find the library; assume it is in the system directories
++ dnl known to the linker and runtime loader. (All the system
++ dnl directories known to the linker should also be known to the
++ dnl runtime loader, otherwise the system is severely misconfigured.)
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
++ fi
++ fi
++ fi
++ done
++ done
++ if test "X$rpathdirs" != "X"; then
++ if test -n "$hardcode_libdir_separator"; then
++ dnl Weird platform: only the last -rpath option counts, the user must
++ dnl pass all path elements in one option. We can arrange that for a
++ dnl single library, but not when more than one $LIBNAMEs are used.
++ alldirs=
++ for found_dir in $rpathdirs; do
++ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
++ done
++ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
++ acl_save_libdir="$libdir"
++ libdir="$alldirs"
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ libdir="$acl_save_libdir"
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++ else
++ dnl The -rpath options are cumulative.
++ for found_dir in $rpathdirs; do
++ acl_save_libdir="$libdir"
++ libdir="$found_dir"
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ libdir="$acl_save_libdir"
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++ done
++ fi
++ fi
++ if test "X$ltrpathdirs" != "X"; then
++ dnl When using libtool, the option that works for both libraries and
++ dnl executables is -R. The -R options are cumulative.
++ for found_dir in $ltrpathdirs; do
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
++ done
++ fi
++])
++
++dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
++dnl unless already present in VAR.
++dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
++dnl contains two or three consecutive elements that belong together.
++AC_DEFUN([AC_LIB_APPENDTOVAR],
++[
++ for element in [$2]; do
++ haveit=
++ for x in $[$1]; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X$element"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ [$1]="${[$1]}${[$1]:+ }$element"
++ fi
++ done
++])
++
++# lib-ld.m4 serial 3 (gettext-0.13)
++dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl Subroutines of libtool.m4,
++dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
++dnl with libtool.m4.
++
++dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
++AC_DEFUN([AC_LIB_PROG_LD_GNU],
++[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
++[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
++case `$LD -v 2>&1 </dev/null` in
++*GNU* | *'with BFD'*)
++ acl_cv_prog_gnu_ld=yes ;;
++*)
++ acl_cv_prog_gnu_ld=no ;;
++esac])
++with_gnu_ld=$acl_cv_prog_gnu_ld
++])
++
++dnl From libtool-1.4. Sets the variable LD.
++AC_DEFUN([AC_LIB_PROG_LD],
++[AC_ARG_WITH(gnu-ld,
++[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
++test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++# Prepare PATH_SEPARATOR.
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++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 GCC])
++ 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.
++ [[\\/]* | [A-Za-z]:[\\/]*)]
++ [re_direlt='/[^/][^/]*/\.\./']
++ # Canonicalize the path 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(acl_cv_path_LD,
++[if test -z "$LD"; then
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ for ac_dir in $PATH; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
++ acl_cv_path_LD="$ac_dir/$ac_prog"
++ # Check to see if the program is GNU ld. I'd rather use --version,
++ # but apparently some GNU ld's only accept -v.
++ # Break only if it was the GNU/non-GNU ld that we prefer.
++ case `"$acl_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="$ac_save_ifs"
++else
++ acl_cv_path_LD="$LD" # Let the user override the test with a path.
++fi])
++LD="$acl_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])
++AC_LIB_PROG_LD_GNU
++])
++
+ # Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+ AC_DEFUN([AM_CONFIG_HEADER],
+@@ -164,12 +983,64 @@
+ AC_PROG_LEX
+ AC_DECL_YYTEXT])
+
+-# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
++# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+-# serial 46 AC_PROG_LIBTOOL
++# serial 47 AC_PROG_LIBTOOL
++# Debian $Rev: 3112 $
+
++
++# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
++# -----------------------------------------------------------
++# If this macro is not defined by Autoconf, define it here.
++m4_ifdef([AC_PROVIDE_IFELSE],
++ [],
++ [m4_define([AC_PROVIDE_IFELSE],
++ [m4_ifdef([AC_PROVIDE_$1],
++ [$2], [$3])])])
++
++
++# AC_PROG_LIBTOOL
++# ---------------
+ AC_DEFUN([AC_PROG_LIBTOOL],
++[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
++dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
++dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
++ AC_PROVIDE_IFELSE([AC_PROG_CXX],
++ [AC_LIBTOOL_CXX],
++ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
++ ])])
++dnl And a similar setup for Fortran 77 support
++ AC_PROVIDE_IFELSE([AC_PROG_F77],
++ [AC_LIBTOOL_F77],
++ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
++])])
++
++dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
++dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
++dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
++ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
++ [AC_LIBTOOL_GCJ],
++ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
++ [AC_LIBTOOL_GCJ],
++ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
++ [AC_LIBTOOL_GCJ],
++ [ifdef([AC_PROG_GCJ],
++ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
++ ifdef([A][M_PROG_GCJ],
++ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
++ ifdef([LT_AC_PROG_GCJ],
++ [define([LT_AC_PROG_GCJ],
++ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
++])])# AC_PROG_LIBTOOL
++
++
++# _AC_PROG_LIBTOOL
++# ----------------
++AC_DEFUN([_AC_PROG_LIBTOOL],
+ [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
++AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
++AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
++AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+ # This can be used to rebuild libtool when needed
+ LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+@@ -180,10 +1051,13 @@
+
+ # Prevent multiple expansion
+ define([AC_PROG_LIBTOOL], [])
+-])
++])# _AC_PROG_LIBTOOL
+
++
++# AC_LIBTOOL_SETUP
++# ----------------
+ AC_DEFUN([AC_LIBTOOL_SETUP],
+-[AC_PREREQ(2.13)dnl
++[AC_PREREQ(2.50)dnl
+ AC_REQUIRE([AC_ENABLE_SHARED])dnl
+ AC_REQUIRE([AC_ENABLE_STATIC])dnl
+ AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+@@ -193,15 +1067,103 @@
+ AC_REQUIRE([AC_PROG_LD])dnl
+ AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+ AC_REQUIRE([AC_PROG_NM])dnl
+-AC_REQUIRE([LT_AC_PROG_SED])dnl
+
+ AC_REQUIRE([AC_PROG_LN_S])dnl
+ AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
++# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+ AC_REQUIRE([AC_OBJEXT])dnl
+ AC_REQUIRE([AC_EXEEXT])dnl
+ dnl
+
++AC_LIBTOOL_SYS_MAX_CMD_LEN
++AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++AC_LIBTOOL_OBJDIR
++
++AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+ _LT_AC_PROG_ECHO_BACKSLASH
++
++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
++
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed='sed -e s/^X//'
++[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 avoid accidental globbing in evaled expressions
++no_glob_subst='s/\*/\\\*/g'
++
++# Constants:
++rm="rm -f"
++
++# Global variables:
++default_ofile=libtool
++can_build_shared=yes
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++ltmain="$ac_aux_dir/ltmain.sh"
++ofile="$default_ofile"
++with_gnu_ld="$lt_cv_prog_gnu_ld"
++
++AC_CHECK_TOOL(AR, ar, false)
++AC_CHECK_TOOL(RANLIB, ranlib, :)
++AC_CHECK_TOOL(STRIP, strip, :)
++
++old_CC="$CC"
++old_CFLAGS="$CFLAGS"
++
++# Set sane defaults for various variables
++test -z "$AR" && AR=ar
++test -z "$AR_FLAGS" && AR_FLAGS=cru
++test -z "$AS" && AS=as
++test -z "$CC" && CC=cc
++test -z "$LTCC" && LTCC=$CC
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++test -z "$LD" && LD=ld
++test -z "$LN_S" && LN_S="ln -s"
++test -z "$MAGIC_CMD" && MAGIC_CMD=file
++test -z "$NM" && NM=nm
++test -z "$SED" && SED=sed
++test -z "$OBJDUMP" && OBJDUMP=objdump
++test -z "$RANLIB" && RANLIB=:
++test -z "$STRIP" && STRIP=:
++test -z "$ac_objext" && ac_objext=o
++
++# Determine commands to create old-style static archives.
++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
++old_postinstall_cmds='chmod 644 $oldlib'
++old_postuninstall_cmds=
++
++if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++fi
++
+ # Only perform the check for file, if the check method requires it
+ case $deplibs_check_method in
+ file_magic*)
+@@ -211,327 +1173,78 @@
+ ;;
+ esac
+
+-AC_CHECK_TOOL(RANLIB, ranlib, :)
+-AC_CHECK_TOOL(STRIP, strip, :)
+-
+-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
++AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
++AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+ enable_win32_dll=yes, enable_win32_dll=no)
+
+-AC_ARG_ENABLE(libtool-lock,
+- [ --disable-libtool-lock avoid locking (might break parallel builds)])
++AC_ARG_ENABLE([libtool-lock],
++ [AC_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
+-*-*-irix6*)
+- # Find out which ABI we are using.
+- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+- if AC_TRY_EVAL(ac_compile); then
+- 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
+- rm -rf conftest*
+- ;;
++AC_ARG_WITH([pic],
++ [AC_HELP_STRING([--with-pic],
++ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
++ [pic_mode="$withval"],
++ [pic_mode=default])
++test -z "$pic_mode" && pic_mode=default
+
+-*-*-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_SAVE
+- AC_LANG_C
+- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+- AC_LANG_RESTORE])
+- 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
+- ;;
++# Use C for the default configuration in the libtool script
++tagname=
++AC_LIBTOOL_LANG_C_CONFIG
++_LT_AC_TAGCONFIG
++])# AC_LIBTOOL_SETUP
+
+-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+- AC_CHECK_TOOL(AS, as, false)
+- AC_CHECK_TOOL(OBJDUMP, objdump, false)
+
+- # recent cygwin and mingw systems supply a stub DllMain which the user
+- # can override, but on older systems we have to supply one
+- AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
+- [AC_TRY_LINK([],
+- [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+- DllMain (0, 0, 0);],
+- [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
+-
+- case $host/$CC in
+- *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
+- # old mingw systems require "-dll" to link a DLL, while more recent ones
+- # require "-mdll"
+- SAVE_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -mdll"
+- AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
+- [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
+- CFLAGS="$SAVE_CFLAGS" ;;
+- *-*-cygwin* | *-*-pw32*)
+- # cygwin systems need to pass --dll to the linker, and not link
+- # crt.o which will require a WinMain@16 definition.
+- lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+- esac
+- ;;
+- ])
+-esac
++# _LT_AC_SYS_COMPILER
++# -------------------
++AC_DEFUN([_LT_AC_SYS_COMPILER],
++[AC_REQUIRE([AC_PROG_CC])dnl
+
+-_LT_AC_LTCONFIG_HACK
++# If no C compiler was specified, use CC.
++LTCC=${LTCC-"$CC"}
+
+-])
+-
+-# AC_LIBTOOL_HEADER_ASSERT
+-# ------------------------
+-AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
+-[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
+- [lt_cv_func_assert_works],
+- [case $host in
+- *-*-solaris*)
+- if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
+- case `$CC --version 2>/dev/null` in
+- [[12]].*) lt_cv_func_assert_works=no ;;
+- *) lt_cv_func_assert_works=yes ;;
+- esac
+- fi
+- ;;
+- esac])
+-
+-if test "x$lt_cv_func_assert_works" = xyes; then
+- AC_CHECK_HEADERS(assert.h)
+-fi
+-])# AC_LIBTOOL_HEADER_ASSERT
+-
+-# _LT_AC_CHECK_DLFCN
+-# --------------------
+-AC_DEFUN([_LT_AC_CHECK_DLFCN],
+-[AC_CHECK_HEADERS(dlfcn.h)
+-])# _LT_AC_CHECK_DLFCN
+-
+-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+-# ---------------------------------
+-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+-[AC_REQUIRE([AC_CANONICAL_HOST])
+-AC_REQUIRE([AC_PROG_NM])
+-AC_REQUIRE([AC_OBJEXT])
+-# Check for command to grab the raw symbol name followed by C symbol from nm.
+-AC_MSG_CHECKING([command to parse $NM output])
+-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl
+-
+-# 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]]*\)'
+-
+-# Transform the above into a raw symbol and a C symbol.
+-symxfrm='\1 \2\3 \3'
+-
+-# Transform an extracted symbol line into a proper C declaration
+-lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+-
+-# Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+-
+-# Define system-specific variables.
+-case $host_os in
+-aix*)
+- symcode='[[BCDT]]'
+- ;;
+-cygwin* | mingw* | pw32*)
+- symcode='[[ABCDGISTW]]'
+- ;;
+-hpux*) # Its linker distinguishes data from code symbols
+- lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+- lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+- ;;
+-irix* | nonstopux*)
+- symcode='[[BCDEGRST]]'
+- ;;
+-osf*)
+- symcode='[[BCDEGQRST]]'
+- ;;
+-solaris* | sysv5*)
+- symcode='[[BDT]]'
+- ;;
+-sysv4)
+- symcode='[[DFNSTU]]'
+- ;;
+-esac
+-
+-# Handle CRLF in mingw tool chain
+-opt_cr=
+-case $host_os in
+-mingw*)
+- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+- ;;
+-esac
+-
+-# If we're using GNU nm, then use its standard symbol codes.
+-if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+- symcode='[[ABCDGISTW]]'
+-fi
+-
+-# Try without a prefix undercore, then with it.
+-for ac_symprfx in "" "_"; do
+-
+- # Write the raw and C identifiers.
+-lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+-
+- # Check to see that the pipe works correctly.
+- pipe_works=no
+- rm -f conftest*
+- cat > conftest.$ac_ext <<EOF
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-char nm_test_var;
+-void nm_test_func(){}
+-#ifdef __cplusplus
+-}
+-#endif
+-int main(){nm_test_var='a';nm_test_func();return(0);}
+-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 egrep ' nm_test_var$' "$nlist" >/dev/null; then
+- if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+- cat <<EOF > conftest.$ac_ext
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-
+-EOF
+- # Now generate the symbol file.
+- eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
+-
+- cat <<EOF >> conftest.$ac_ext
+-#if defined (__STDC__) && __STDC__
+-# define lt_ptr void *
+-#else
+-# define lt_ptr char *
+-# define const
+-#endif
+-
+-/* The mapping between symbol names and symbols. */
+-const struct {
+- const char *name;
+- lt_ptr address;
+-}
+-lt_preloaded_symbols[[]] =
+-{
+-EOF
+- sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
+- cat <<\EOF >> conftest.$ac_ext
+- {0, (lt_ptr) 0}
+-};
++# Allow CC to be a program name with arguments.
++compiler=$CC
++])# _LT_AC_SYS_COMPILER
+
+-#ifdef __cplusplus
+-}
+-#endif
+-EOF
+- # Now try linking the two files.
+- mv conftest.$ac_objext conftstm.$ac_objext
+- save_LIBS="$LIBS"
+- save_CFLAGS="$CFLAGS"
+- LIBS="conftstm.$ac_objext"
+- CFLAGS="$CFLAGS$no_builtin_flag"
+- if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+- pipe_works=yes
+- fi
+- LIBS="$save_LIBS"
+- CFLAGS="$save_CFLAGS"
+- else
+- echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
+- fi
+- else
+- echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
+- fi
+- else
+- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
+- fi
+- else
+- echo "$progname: failed program was:" >&AC_FD_CC
+- cat conftest.$ac_ext >&5
+- fi
+- rm -f 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
+-])
+-global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
+-if test -z "$lt_cv_sys_global_symbol_pipe"; then
+- global_symbol_to_cdecl=
+- global_symbol_to_c_name_address=
+-else
+- global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
+- global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
+-fi
+-if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
+-then
+- AC_MSG_RESULT(failed)
+-else
+- AC_MSG_RESULT(ok)
+-fi
+-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++# _LT_AC_SYS_LIBPATH_AIX
++# ----------------------
++# 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.
++AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
++[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
++aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
++}'`
++# 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 '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
++}'`; fi],[])
++if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++])# _LT_AC_SYS_LIBPATH_AIX
++
++
++# _LT_AC_SHELL_INIT(ARG)
++# ----------------------
++AC_DEFUN([_LT_AC_SHELL_INIT],
++[ifdef([AC_DIVERSION_NOTICE],
++ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
++ [AC_DIVERT_PUSH(NOTICE)])
++$1
++AC_DIVERT_POP
++])# _LT_AC_SHELL_INIT
+
+-# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+-# ---------------------------------
+-AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
+-[# Find the correct PATH separator. Usually this is `:', but
+-# DJGPP uses `;' like DOS.
+-if test "X${PATH_SEPARATOR+set}" != Xset; then
+- UNAME=${UNAME-`uname 2>/dev/null`}
+- case X$UNAME in
+- *-DOS) lt_cv_sys_path_separator=';' ;;
+- *) lt_cv_sys_path_separator=':' ;;
+- esac
+- PATH_SEPARATOR=$lt_cv_sys_path_separator
+-fi
+-])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+
+ # _LT_AC_PROG_ECHO_BACKSLASH
+ # --------------------------
+ # Add some code to the start of the generated configure script which
+ # will find an echo command which doesn't interpret backslashes.
+ AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+-[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+- [AC_DIVERT_PUSH(NOTICE)])
+-_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
+-
++[_LT_AC_SHELL_INIT([
+ # Check that we are running under the correct shell.
+ SHELL=${CONFIG_SHELL-/bin/sh}
+
+@@ -549,7 +1262,7 @@
+ elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+ else
+@@ -561,7 +1274,7 @@
+ # used as fallback echo
+ shift
+ cat <<EOF
+-$*
++[$]*
+ EOF
+ exit 0
+ fi
+@@ -595,8 +1308,9 @@
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+- IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
++ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+@@ -605,7 +1319,7 @@
+ break
+ fi
+ done
+- IFS="$save_ifs"
++ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+@@ -678,47 +1392,328 @@
+ fi
+
+ AC_SUBST(ECHO)
+-AC_DIVERT_POP
+-])# _LT_AC_PROG_ECHO_BACKSLASH
++])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+-# ------------------------------------------------------------------
+-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+-[if test "$cross_compiling" = yes; then :
+- [$4]
+-else
+- AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+- lt_status=$lt_dlunknown
+- cat > conftest.$ac_ext <<EOF
+-[#line __oline__ "configure"
+-#include "confdefs.h"
+
+-#if HAVE_DLFCN_H
+-#include <dlfcn.h>
+-#endif
++# _LT_AC_LOCK
++# -----------
++AC_DEFUN([_LT_AC_LOCK],
++[AC_ARG_ENABLE([libtool-lock],
++ [AC_HELP_STRING([--disable-libtool-lock],
++ [avoid locking (might break parallel builds)])])
++test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+-#include <stdio.h>
++# 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 __oline__ "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*
++ ;;
+
+-#ifdef RTLD_GLOBAL
+-# define LT_DLGLOBAL RTLD_GLOBAL
+-#else
+-# ifdef DL_GLOBAL
+-# define LT_DLGLOBAL DL_GLOBAL
+-# else
+-# define LT_DLGLOBAL 0
+-# endif
+-#endif
++x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*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-*linux*)
++ LD="${LD-ld} -m elf_x86_64"
++ ;;
++ ppc*-*linux*|powerpc*-*linux*)
++ LD="${LD-ld} -m elf64ppc"
++ ;;
++ s390*-*linux*)
++ LD="${LD-ld} -m elf64_s390"
++ ;;
++ sparc*-*linux*)
++ LD="${LD-ld} -m elf64_sparc"
++ ;;
++ esac
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
+
+-/* 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
++*-*-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_TRY_LINK([],[],[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
++ ;;
++AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
++[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
++ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++ AC_CHECK_TOOL(AS, as, false)
++ AC_CHECK_TOOL(OBJDUMP, objdump, false)
++ ;;
++ ])
++esac
++
++need_locks="$enable_libtool_lock"
++
++])# _LT_AC_LOCK
++
++
++# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
++# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
++# ----------------------------------------------------------------
++# Check whether the given compiler option works
++AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
++[AC_REQUIRE([LT_AC_PROG_SED])
++AC_CACHE_CHECK([$1], [$2],
++ [$2=no
++ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
++ printf "$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}? :&$lt_compiler_flag :; t' \
++ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
++ -e 's:$: $lt_compiler_flag:'`
++ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
++ (eval "$lt_compile" 2>conftest.err)
++ ac_status=$?
++ cat conftest.err >&AS_MESSAGE_LOG_FD
++ echo "$as_me:__oline__: \$? = $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
++ if test ! -s conftest.err; then
++ $2=yes
++ fi
++ fi
++ $rm conftest*
++])
++
++if test x"[$]$2" = xyes; then
++ ifelse([$5], , :, [$5])
++else
++ ifelse([$6], , :, [$6])
++fi
++])# AC_LIBTOOL_COMPILER_OPTION
++
++
++# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
++# [ACTION-SUCCESS], [ACTION-FAILURE])
++# ------------------------------------------------------------
++# Check whether the given compiler option works
++AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
++[AC_CACHE_CHECK([$1], [$2],
++ [$2=no
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS $3"
++ printf "$lt_simple_link_test_code" > conftest.$ac_ext
++ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ # Append any errors to the config.log.
++ cat conftest.err 1>&AS_MESSAGE_LOG_FD
++ else
++ $2=yes
++ fi
++ fi
++ $rm conftest*
++ LDFLAGS="$save_LDFLAGS"
++])
++
++if test x"[$]$2" = xyes; then
++ ifelse([$4], , :, [$4])
++else
++ ifelse([$5], , :, [$5])
++fi
++])# AC_LIBTOOL_LINKER_OPTION
++
++
++# AC_LIBTOOL_SYS_MAX_CMD_LEN
++# --------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
++[# 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*)
++ # 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;
++ ;;
++
++ 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;
++ ;;
++
++ *)
++ # 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"`$CONFIG_SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
++ = "XX$teststring") >/dev/null 2>&1 &&
++ new_result=`expr "X$teststring" : ".*" 2>&1` &&
++ lt_cv_sys_max_cmd_len=$new_result &&
++ test $i != 17 # 1/2 MB should be enough
++ do
++ i=`expr $i + 1`
++ teststring=$teststring$teststring
++ done
++ 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`
++ ;;
++ 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
++])# AC_LIBTOOL_SYS_MAX_CMD_LEN
++
++
++# _LT_AC_CHECK_DLFCN
++# --------------------
++AC_DEFUN([_LT_AC_CHECK_DLFCN],
++[AC_CHECK_HEADERS(dlfcn.h)dnl
++])# _LT_AC_CHECK_DLFCN
++
++
++# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
++# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
++# ------------------------------------------------------------------
++AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
++[AC_REQUIRE([_LT_AC_CHECK_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 <<EOF
++[#line __oline__ "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
+@@ -769,10 +1764,12 @@
+ rm -fr conftest*
+ ])# _LT_AC_TRY_DLOPEN_SELF
+
++
+ # AC_LIBTOOL_DLOPEN_SELF
+ # -------------------
+ AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+-[if test "x$enable_dlopen" != xyes; then
++[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
++if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+@@ -787,24 +1784,39 @@
+ lt_cv_dlopen_self=yes
+ ;;
+
+- cygwin* | mingw* | pw32*)
++ mingw* | pw32*)
+ 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"],
++ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
++ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
++ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
++ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+@@ -822,7 +1834,6 @@
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+- AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+@@ -866,707 +1877,1838 @@
+ fi
+ ])# AC_LIBTOOL_DLOPEN_SELF
+
+-AC_DEFUN([_LT_AC_LTCONFIG_HACK],
+-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
+-# Sed substitution that helps us do robust quoting. It backslashifies
+-# metacharacters that are still active within double-quoted strings.
+-Xsed='sed -e s/^X//'
+-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'
+
+-# Constants:
+-rm="rm -f"
++# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
++# ---------------------------------
++# Check to see if options -c and -o are simultaneously supported by compiler
++AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
++[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
++AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
++ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
++ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
++ $rm -r conftest 2>/dev/null
++ mkdir conftest
++ cd conftest
++ mkdir out
++ printf "$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}? :&$lt_compiler_flag :; t' \
++ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
++ -e 's:$: $lt_compiler_flag:'`
++ (eval echo "\"\$as_me:__oline__: $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:__oline__: \$? = $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
++ if test ! -s out/conftest.err; then
++ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
++ fi
++ fi
++ chmod u+w .
++ $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 ..
++ rmdir conftest
++ $rm conftest*
++])
++])# AC_LIBTOOL_PROG_CC_C_O
+
+-# Global variables:
+-default_ofile=libtool
+-can_build_shared=yes
+
+-# All known linkers require a `.a' archive for static linking (except M$VC,
+-# which needs '.lib').
+-libext=a
+-ltmain="$ac_aux_dir/ltmain.sh"
+-ofile="$default_ofile"
+-with_gnu_ld="$lt_cv_prog_gnu_ld"
+-need_locks="$enable_libtool_lock"
++# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
++# -----------------------------------------
++# Check to see if we can do hard links to lock some files if needed
++AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
++[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+-old_CC="$CC"
+-old_CFLAGS="$CFLAGS"
++hard_links="nottested"
++if test "$_LT_AC_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
++])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+-# Set sane defaults for various variables
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
+-test -z "$AS" && AS=as
+-test -z "$CC" && CC=cc
+-test -z "$DLLTOOL" && DLLTOOL=dlltool
+-test -z "$LD" && LD=ld
+-test -z "$LN_S" && LN_S="ln -s"
+-test -z "$MAGIC_CMD" && MAGIC_CMD=file
+-test -z "$NM" && NM=nm
+-test -z "$OBJDUMP" && OBJDUMP=objdump
+-test -z "$RANLIB" && RANLIB=:
+-test -z "$STRIP" && STRIP=:
+-test -z "$ac_objext" && ac_objext=o
+
+-if test x"$host" != x"$build"; then
+- ac_tool_prefix=${host_alias}-
++# AC_LIBTOOL_OBJDIR
++# -----------------
++AC_DEFUN([AC_LIBTOOL_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
+- ac_tool_prefix=
++ # 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
++])# AC_LIBTOOL_OBJDIR
+
+-# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+-case $host_os in
+-linux-gnu*) ;;
+-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+-esac
+
+-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
++# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
++# ----------------------------------------------
++# Check hardcoding attributes.
++AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
++[AC_MSG_CHECKING([how to hardcode library paths into programs])
++_LT_AC_TAGVAR(hardcode_action, $1)=
++if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
++ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
++ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
++
++ # We can hardcode non-existant directories.
++ if test "$_LT_AC_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_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
++ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
++ # Linking always hardcodes the temporary library directory.
++ _LT_AC_TAGVAR(hardcode_action, $1)=relink
++ else
++ # We can link without hardcoding, and we can hardcode nonexisting dirs.
++ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+- ;;
+-esac
++else
++ # We cannot hardcode anything, or else we can only hardcode existing
++ # directories.
++ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
++fi
++AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+-# Determine commands to create old-style static archives.
+-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+-old_postinstall_cmds='chmod 644 $oldlib'
+-old_postuninstall_cmds=
++if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; 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
++])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+-if test -n "$RANLIB"; then
++
++# AC_LIBTOOL_SYS_LIB_STRIP
++# ------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
++[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
+- openbsd*)
+- old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+- ;;
+- *)
+- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ darwin*)
++ if test -n "$STRIP" ; then
++ striplib="$STRIP -x"
++ AC_MSG_RESULT([yes])
++ else
++ AC_MSG_RESULT([no])
++fi
++ ;;
++ *)
++ AC_MSG_RESULT([no])
+ ;;
+ esac
+- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+ fi
++])# AC_LIBTOOL_SYS_LIB_STRIP
+
+-# Allow CC to be a program name with arguments.
+-set dummy $CC
+-compiler="[$]2"
+
+-AC_MSG_CHECKING([for objdir])
+-rm -f .libs 2>/dev/null
+-mkdir .libs 2>/dev/null
+-if test -d .libs; then
+- objdir=.libs
++# AC_LIBTOOL_SYS_DYNAMIC_LINKER
++# -----------------------------
++# PORTME Fill in your ld.so characteristics
++AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
++[AC_MSG_CHECKING([dynamic linker characteristics])
++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"
++if test "$GCC" = yes; then
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
++ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
++ # 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.
++ 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
+ else
+- # MS-DOS does not allow filenames that begin with a dot.
+- objdir=_libs
++ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ fi
+-rmdir .libs 2>/dev/null
+-AC_MSG_RESULT($objdir)
+-
++need_lib_prefix=unknown
++hardcode_into_libs=no
+
+-AC_ARG_WITH(pic,
+-[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
+-pic_mode="$withval", pic_mode=default)
+-test -z "$pic_mode" && pic_mode=default
++# when you set need_version to no, make sure it does not cause -set_version
++# flags to be left without arguments
++need_version=unknown
+
+-# We assume here that the value for lt_cv_prog_cc_pic will not be cached
+-# in isolation, and that seeing it set (from the cache) indicates that
+-# the associated values are set (in the cache) correctly too.
+-AC_MSG_CHECKING([for $compiler option to produce PIC])
+-AC_CACHE_VAL(lt_cv_prog_cc_pic,
+-[ lt_cv_prog_cc_pic=
+- lt_cv_prog_cc_shlib=
+- lt_cv_prog_cc_wl=
+- lt_cv_prog_cc_static=
+- lt_cv_prog_cc_no_builtin=
+- lt_cv_prog_cc_can_build_shared=$can_build_shared
++case $host_os in
++aix3*)
++ version_type=linux
++ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
++ shlibpath_var=LIBPATH
+
+- if test "$GCC" = yes; then
+- lt_cv_prog_cc_wl='-Wl,'
+- lt_cv_prog_cc_static='-static'
++ # AIX 3 has no versioning support, so we append a major version to the name.
++ soname_spec='${libname}${release}${shared_ext}$major'
++ ;;
+
+- case $host_os in
+- aix*)
+- # Below there is a dirty hack to force normal static linking with -ldl
+- # The problem is because libdl dynamically linked with both libc and
+- # libC (AIX C++ library), which obviously doesn't included in libraries
+- # list by gcc. This cause undefined symbols with -static flags.
+- # This hack allows C programs to be linked with "-static -ldl", but
+- # not sure about C++ programs.
+- lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
+- ;;
+- amigaos*)
+- # 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
+- ;;
+- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+- # PIC is the default for these OSes.
+- ;;
+- darwin* | rhapsody*)
+- # PIC is the default on this platform
+- # Common symbols not allowed in MH_DYLIB files
+- lt_cv_prog_cc_pic='-fno-common'
+- ;;
+- cygwin* | mingw* | pw32* | os2*)
+- # 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_cv_prog_cc_pic='-DDLL_EXPORT'
+- ;;
+- sysv4*MP*)
+- if test -d /usr/nec; then
+- lt_cv_prog_cc_pic=-Kconform_pic
+- fi
+- ;;
+- *)
+- lt_cv_prog_cc_pic='-fPIC'
+- ;;
+- esac
++aix4* | aix5*)
++ 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
+- # PORTME Check for PIC flags for the system compiler.
++ # 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
+- aix3* | aix4* | aix5*)
+- lt_cv_prog_cc_wl='-Wl,'
+- # All AIX code is PIC.
+- if test "$host_cpu" = ia64; then
+- # AIX 5 now supports IA64 processor
+- lt_cv_prog_cc_static='-Bstatic'
++ 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
+- lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ 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
++ ;;
+
+- hpux9* | hpux10* | hpux11*)
+- # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
+- lt_cv_prog_cc_wl='-Wl,'
+- lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
+- lt_cv_prog_cc_pic='+Z'
+- ;;
+-
+- irix5* | irix6* | nonstopux*)
+- lt_cv_prog_cc_wl='-Wl,'
+- lt_cv_prog_cc_static='-non_shared'
+- # PIC (with -KPIC) is the default.
+- ;;
+-
+- cygwin* | mingw* | pw32* | os2*)
+- # 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_cv_prog_cc_pic='-DDLL_EXPORT'
+- ;;
+-
+- newsos6)
+- lt_cv_prog_cc_pic='-KPIC'
+- lt_cv_prog_cc_static='-Bstatic'
+- ;;
+-
+- osf3* | osf4* | osf5*)
+- # All OSF/1 code is PIC.
+- lt_cv_prog_cc_wl='-Wl,'
+- lt_cv_prog_cc_static='-non_shared'
+- ;;
++amigaos*)
++ 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=`$echo "X$lib" | $Xsed -e '\''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'
++ ;;
+
+- sco3.2v5*)
+- lt_cv_prog_cc_pic='-Kpic'
+- lt_cv_prog_cc_static='-dn'
+- lt_cv_prog_cc_shlib='-belf'
+- ;;
++beos*)
++ library_names_spec='${libname}${shared_ext}'
++ dynamic_linker="$host_os ld.so"
++ shlibpath_var=LIBRARY_PATH
++ ;;
+
+- solaris*)
+- lt_cv_prog_cc_pic='-KPIC'
+- lt_cv_prog_cc_static='-Bstatic'
+- lt_cv_prog_cc_wl='-Wl,'
+- ;;
++bsdi4*)
++ 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
++ ;;
+
+- sunos4*)
+- lt_cv_prog_cc_pic='-PIC'
+- lt_cv_prog_cc_static='-Bstatic'
+- lt_cv_prog_cc_wl='-Qoption ld '
+- ;;
++cygwin* | mingw* | pw32*)
++ version_type=windows
++ shrext_cmds=".dll"
++ need_version=no
++ need_lib_prefix=no
+
+- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+- lt_cv_prog_cc_pic='-KPIC'
+- lt_cv_prog_cc_static='-Bstatic'
+- lt_cv_prog_cc_wl='-Wl,'
+- ;;
++ case $GCC,$host_os in
++ yes,cygwin* | yes,mingw* | yes,pw32*)
++ 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'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $rm \$dlpath'
++ shlibpath_overrides_runpath=yes
+
+- uts4*)
+- lt_cv_prog_cc_pic='-pic'
+- lt_cv_prog_cc_static='-Bstatic'
++ 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="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+-
+- sysv4*MP*)
+- if test -d /usr/nec ;then
+- lt_cv_prog_cc_pic='-Kconform_pic'
+- lt_cv_prog_cc_static='-Bstatic'
++ mingw*)
++ # MinGW DLLs use traditional 'lib' prefix
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
++ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
++ # It is most probably a Windows format PATH printed by
++ # mingw gcc, but we are running on Cygwin. Gcc prints its search
++ # path with ; separators, and with drive letters. We can handle the
++ # drive letters (cygwin fileutils understands them), so leave them,
++ # especially as we might pass files found there to a mingw objdump,
++ # which wouldn't understand a cygwinified path. Ahh.
++ 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
+ ;;
+-
+- *)
+- lt_cv_prog_cc_can_build_shared=no
++ 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
+- fi
+-])
+-if test -z "$lt_cv_prog_cc_pic"; then
+- AC_MSG_RESULT([none])
+-else
+- AC_MSG_RESULT([$lt_cv_prog_cc_pic])
+-
+- # Check to make sure the pic_flag actually works.
+- AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
+- AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
+- save_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
+- AC_TRY_COMPILE([], [], [dnl
+- case $host_os in
+- hpux9* | hpux10* | hpux11*)
+- # On HP-UX, both CC and GCC only warn that PIC is supported... then
+- # they create non-PIC objects. So, if there were any warnings, we
+- # assume that PIC is not supported.
+- if test -s conftest.err; then
+- lt_cv_prog_cc_pic_works=no
+- else
+- lt_cv_prog_cc_pic_works=yes
+- fi
+- ;;
+- *)
+- lt_cv_prog_cc_pic_works=yes
+- ;;
+- esac
+- ], [dnl
+- lt_cv_prog_cc_pic_works=no
+- ])
+- CFLAGS="$save_CFLAGS"
+- ])
+-
+- if test "X$lt_cv_prog_cc_pic_works" = Xno; then
+- lt_cv_prog_cc_pic=
+- lt_cv_prog_cc_can_build_shared=no
+- else
+- lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
+- fi
+-
+- AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
+-fi
+-
+-# Check for any special shared library compilation flags.
+-if test -n "$lt_cv_prog_cc_shlib"; then
+- AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
+- if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
+- else
+- AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
+- lt_cv_prog_cc_can_build_shared=no
+- fi
+-fi
+-
+-AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
+-AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
+- lt_cv_prog_cc_static_works=no
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
+- AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
+- LDFLAGS="$save_LDFLAGS"
+-])
+-
+-# Belt *and* braces to stop my trousers falling down:
+-test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
+-AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
+-
+-pic_flag="$lt_cv_prog_cc_pic"
+-special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
+-wl="$lt_cv_prog_cc_wl"
+-link_static_flag="$lt_cv_prog_cc_static"
+-no_builtin_flag="$lt_cv_prog_cc_no_builtin"
+-can_build_shared="$lt_cv_prog_cc_can_build_shared"
+-
+-
+-# Check to see if options -o and -c are simultaneously supported by compiler
+-AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
+-AC_CACHE_VAL([lt_cv_compiler_c_o], [
+-$rm -r conftest 2>/dev/null
+-mkdir conftest
+-cd conftest
+-echo "int some_variable = 0;" > conftest.$ac_ext
+-mkdir out
+-# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+-# that will create temporary files in the current directory regardless of
+-# the output directory. Thus, making CWD read-only will cause this test
+-# to fail, enabling locking or at least warning the user not to do parallel
+-# builds.
+-chmod -w .
+-save_CFLAGS="$CFLAGS"
+-CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
+-compiler_c_o=no
+-if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
+- if test -s out/conftest.err; then
+- lt_cv_compiler_c_o=no
+- else
+- lt_cv_compiler_c_o=yes
+- fi
+-else
+- # Append any errors to the config.log.
+- cat out/conftest.err 1>&AC_FD_CC
+- lt_cv_compiler_c_o=no
+-fi
+-CFLAGS="$save_CFLAGS"
+-chmod u+w .
+-$rm conftest* out/*
+-rmdir out
+-cd ..
+-rmdir conftest
+-$rm -r conftest 2>/dev/null
+-])
+-compiler_c_o=$lt_cv_compiler_c_o
+-AC_MSG_RESULT([$compiler_c_o])
+-
+-if test x"$compiler_c_o" = x"yes"; then
+- # Check to see if we can write to a .lo
+- AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
+- AC_CACHE_VAL([lt_cv_compiler_o_lo], [
+- lt_cv_compiler_o_lo=no
+- save_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -c -o conftest.lo"
+- save_objext="$ac_objext"
+- ac_objext=lo
+- AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
+- # The compiler can only warn and ignore the option if not recognized
+- # So say no if there are warnings
+- if test -s conftest.err; then
+- lt_cv_compiler_o_lo=no
+- else
+- lt_cv_compiler_o_lo=yes
+- fi
+- ])
+- ac_objext="$save_objext"
+- CFLAGS="$save_CFLAGS"
+- ])
+- compiler_o_lo=$lt_cv_compiler_o_lo
+- AC_MSG_RESULT([$compiler_o_lo])
+-else
+- compiler_o_lo=no
+-fi
+-
+-# Check to see if we can do hard links to lock some files if needed
+-hard_links="nottested"
+-if test "$compiler_c_o" = 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
++ ;;
+
+-if test "$GCC" = yes; then
+- # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+- AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
+- echo "int some_variable = 0;" > conftest.$ac_ext
+- save_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
+- compiler_rtti_exceptions=no
+- AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
+- # The compiler can only warn and ignore the option if not recognized
+- # So say no if there are warnings
+- if test -s conftest.err; then
+- compiler_rtti_exceptions=no
+- else
+- compiler_rtti_exceptions=yes
+- fi
+- ])
+- CFLAGS="$save_CFLAGS"
+- AC_MSG_RESULT([$compiler_rtti_exceptions])
++ *)
++ 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
++ ;;
+
+- if test "$compiler_rtti_exceptions" = "yes"; then
+- no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
++darwin* | rhapsody*)
++ dynamic_linker="$host_os dyld"
++ version_type=darwin
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}${versuffix}$shared_ext ${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)'
++ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
++ if test "$GCC" = yes; then
++ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+- no_builtin_flag=' -fno-builtin'
++ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+-fi
+-
+-# See if the linker supports building shared libraries.
+-AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
+-
+-allow_undefined_flag=
+-no_undefined_flag=
+-need_lib_prefix=unknown
+-need_version=unknown
+-# when you set need_version to no, make sure it does not cause -set_version
+-# flags to be left without arguments
+-archive_cmds=
+-archive_expsym_cmds=
+-old_archive_from_new_cmds=
+-old_archive_from_expsyms_cmds=
+-export_dynamic_flag_spec=
+-whole_archive_flag_spec=
+-thread_safe_flag_spec=
+-hardcode_into_libs=no
+-hardcode_libdir_flag_spec=
+-hardcode_libdir_separator=
+-hardcode_direct=no
+-hardcode_minus_L=no
+-hardcode_shlibpath_var=unsupported
+-runpath_var=
+-link_all_deplibs=unknown
+-always_export_symbols=no
+-export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-# include_expsyms should be a list of space-separated symbols to be *always*
+-# included in the symbol list
+-include_expsyms=
+-# exclude_expsyms can be an egrep regular expression 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_"
+-# 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.
+-extract_expsyms_cmds=
++ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
++ ;;
+
+-case $host_os in
+-cygwin* | mingw* | pw32*)
+- # 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
++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
+ ;;
+-openbsd*)
+- with_gnu_ld=no
++
++freebsd1*)
++ dynamic_linker=no
+ ;;
+-esac
+
+-ld_shlibs=yes
+-if test "$with_gnu_ld" = yes; then
+- # If archive_cmds runs LD, not CC, wlarc should be empty
+- wlarc='${wl}'
++kfreebsd*-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
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU ld.so'
++ ;;
+
+- # See if GNU ld supports shared libraries.
++freebsd*)
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ 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
+- aix3* | aix4* | aix5*)
+- # On AIX, the GNU linker is very broken
+- # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
+- ld_shlibs=no
+- cat <<EOF 1>&2
+-
+-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
+-*** so that a non-GNU linker is found, and then restart.
+-
+-EOF
++ freebsd2*)
++ shlibpath_overrides_runpath=yes
+ ;;
+-
+- amigaos*)
+- 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
+-
+- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+- # that the semantics of dynamic libraries on AmigaOS, at least up
+- # to version 4, is to share data among multiple programs linked
+- # with the same dynamic library. Since this doesn't match the
+- # behavior of shared libraries on other platforms, we can use
+- # them.
+- ld_shlibs=no
++ freebsd3.[01]* | freebsdelf3.[01]*)
++ shlibpath_overrides_runpath=yes
++ hardcode_into_libs=yes
+ ;;
+-
+- beos*)
+- if $LD --help 2>&1 | egrep ': 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
++ *) # from 3.2 on
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
+ ;;
++ esac
++ ;;
+
+- cygwin* | mingw* | pw32*)
+- # hardcode_libdir_flag_spec is actually meaningless, as there is
+- # no search path for DLLs.
+- hardcode_libdir_flag_spec='-L$libdir'
+- allow_undefined_flag=unsupported
+- always_export_symbols=yes
+-
+- extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
+- sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
+- test -f $output_objdir/impgen.exe || (cd $output_objdir && \
+- if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
+- else $CC -o impgen impgen.c ; fi)~
+- $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
+-
+- old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
+-
+- # cygwin and mingw dlls have different entry points and sets of symbols
+- # to exclude.
+- # FIXME: what about values for MSVC?
+- dll_entry=__cygwin_dll_entry@12
+- dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
+- case $host_os in
+- mingw*)
+- # mingw values
+- dll_entry=_DllMainCRTStartup@12
+- dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
+- ;;
+- esac
+-
+- # mingw and cygwin differ, and it's simplest to just exclude the union
+- # of the two symbol sets.
+- dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
+-
+- # recent cygwin and mingw systems supply a stub DllMain which the user
+- # can override, but on older systems we have to supply one (in ltdll.c)
+- if test "x$lt_cv_need_dllmain" = "xyes"; then
+- ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
+- ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
+- test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
+- else
+- ltdll_obj=
+- ltdll_cmds=
+- fi
+-
+- # Extract the symbol export list from an `--export-all' def file,
+- # then regenerate the def file from the symbol export list, so that
+- # the compiled dll only exports the symbol export list.
+- # Be careful not to strip the DATA tag left be newer dlltools.
+- export_symbols_cmds="$ltdll_cmds"'
+- $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
+- sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
+-
+- # If the export-symbols file already is a .def file (1st line
+- # is EXPORTS), use it as is.
+- # If DATA tags from a recent dlltool are present, honour them!
+- 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;
+- _lt_hint=1;
+- cat $export_symbols | while read symbol; do
+- set dummy \$symbol;
+- case \[$]# in
+- 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+- 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
+- *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
+- esac;
+- _lt_hint=`expr 1 + \$_lt_hint`;
+- done;
+- fi~
+- '"$ltdll_cmds"'
+- $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
+- $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
+- $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
+- $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
++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
++ ;;
++
++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'
++ ;;
++
++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*)
++ 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
++ # 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=`$SED -e 's/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | 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'
++ ;;
++
++netbsdelf*-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
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='NetBSD ld.elf_so'
++ ;;
++
++knetbsd*-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
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU 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=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
++ ;;
++
++openbsd*)
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=yes
++ 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"
++ ;;
++
++sco3.2v5*)
++ version_type=osf
++ 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
++ ;;
++
++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.2uw2* | sysv4.3* | sysv5*)
++ 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
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ 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
++ ;;
++
++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
++AC_MSG_RESULT([$dynamic_linker])
++test "$dynamic_linker" = no && can_build_shared=no
++])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
++
++
++# _LT_AC_TAGCONFIG
++# ----------------
++AC_DEFUN([_LT_AC_TAGCONFIG],
++[AC_ARG_WITH([tags],
++ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
++ [include additional configurations @<:@automatic@:>@])],
++ [tagnames="$withval"])
++
++if test -f "$ltmain" && test -n "$tagnames"; then
++ if test ! -f "${ofile}"; then
++ AC_MSG_WARN([output file `$ofile' does not exist])
++ fi
++
++ if test -z "$LTCC"; then
++ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
++ if test -z "$LTCC"; then
++ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
++ else
++ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
++ fi
++ fi
++
++ # Extract list of available tagged configurations in $ofile.
++ # Note that this assumes the entire list is on one line.
++ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
++
++ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
++ for tagname in $tagnames; do
++ IFS="$lt_save_ifs"
++ # Check whether tagname contains only valid characters
++ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
++ "") ;;
++ *) AC_MSG_ERROR([invalid tag name: $tagname])
++ ;;
++ esac
++
++ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
++ then
++ AC_MSG_ERROR([tag name \"$tagname\" already exists])
++ fi
++
++ # Update the list of available tags.
++ if test -n "$tagname"; then
++ echo appending configuration tag \"$tagname\" to $ofile
++
++ case $tagname in
++ CXX)
++ if test -n "$CXX" && test "X$CXX" != "Xno"; then
++ AC_LIBTOOL_LANG_CXX_CONFIG
++ else
++ tagname=""
++ fi
++ ;;
++
++ F77)
++ if test -n "$F77" && test "X$F77" != "Xno"; then
++ AC_LIBTOOL_LANG_F77_CONFIG
++ else
++ tagname=""
++ fi
++ ;;
++
++ GCJ)
++ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
++ AC_LIBTOOL_LANG_GCJ_CONFIG
++ else
++ tagname=""
++ fi
++ ;;
++
++ RC)
++ AC_LIBTOOL_LANG_RC_CONFIG
++ ;;
++
++ *)
++ AC_MSG_ERROR([Unsupported tag name: $tagname])
++ ;;
++ esac
++
++ # Append the new tag name to the list of available tags.
++ if test -n "$tagname" ; then
++ available_tags="$available_tags $tagname"
++ fi
++ fi
++ done
++ IFS="$lt_save_ifs"
++
++ # Now substitute the updated list of available tags.
++ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
++ mv "${ofile}T" "$ofile"
++ chmod +x "$ofile"
++ else
++ rm -f "${ofile}T"
++ AC_MSG_ERROR([unable to update list of available tagged configurations.])
++ fi
++fi
++])# _LT_AC_TAGCONFIG
++
++
++# AC_LIBTOOL_DLOPEN
++# -----------------
++# enable checks for dlopen support
++AC_DEFUN([AC_LIBTOOL_DLOPEN],
++ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
++])# AC_LIBTOOL_DLOPEN
++
++
++# AC_LIBTOOL_WIN32_DLL
++# --------------------
++# declare package support for building win32 dll's
++AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
++[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
++])# AC_LIBTOOL_WIN32_DLL
++
++
++# AC_ENABLE_SHARED([DEFAULT])
++# ---------------------------
++# implement the --enable-shared flag
++# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
++AC_DEFUN([AC_ENABLE_SHARED],
++[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE([shared],
++ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
++ [build shared libraries @<:@default=]AC_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=]AC_ENABLE_SHARED_DEFAULT)
++])# AC_ENABLE_SHARED
++
++
++# AC_DISABLE_SHARED
++# -----------------
++#- set the default shared flag to --disable-shared
++AC_DEFUN([AC_DISABLE_SHARED],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_SHARED(no)
++])# AC_DISABLE_SHARED
++
++
++# AC_ENABLE_STATIC([DEFAULT])
++# ---------------------------
++# implement the --enable-static flag
++# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
++AC_DEFUN([AC_ENABLE_STATIC],
++[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE([static],
++ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
++ [build static libraries @<:@default=]AC_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=]AC_ENABLE_STATIC_DEFAULT)
++])# AC_ENABLE_STATIC
++
++
++# AC_DISABLE_STATIC
++# -----------------
++# set the default static flag to --disable-static
++AC_DEFUN([AC_DISABLE_STATIC],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_STATIC(no)
++])# AC_DISABLE_STATIC
++
++
++# AC_ENABLE_FAST_INSTALL([DEFAULT])
++# ---------------------------------
++# implement the --enable-fast-install flag
++# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
++AC_DEFUN([AC_ENABLE_FAST_INSTALL],
++[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE([fast-install],
++ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
++ [optimize for fast installation @<:@default=]AC_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=]AC_ENABLE_FAST_INSTALL_DEFAULT)
++])# AC_ENABLE_FAST_INSTALL
++
++
++# AC_DISABLE_FAST_INSTALL
++# -----------------------
++# set the default to --disable-fast-install
++AC_DEFUN([AC_DISABLE_FAST_INSTALL],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_FAST_INSTALL(no)
++])# AC_DISABLE_FAST_INSTALL
++
++
++# AC_LIBTOOL_PICMODE([MODE])
++# --------------------------
++# implement the --with-pic flag
++# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
++AC_DEFUN([AC_LIBTOOL_PICMODE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++pic_mode=ifelse($#,1,$1,default)
++])# AC_LIBTOOL_PICMODE
++
++
++# AC_PROG_EGREP
++# -------------
++# This is predefined starting with Autoconf 2.54, so this conditional
++# definition can be removed once we require Autoconf 2.54 or later.
++m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
++[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
++ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
++ then ac_cv_prog_egrep='grep -E'
++ else ac_cv_prog_egrep='egrep'
++ fi])
++ EGREP=$ac_cv_prog_egrep
++ AC_SUBST([EGREP])
++])])
++
++
++# AC_PATH_TOOL_PREFIX
++# -------------------
++# find a file program which can recognise shared library
++AC_DEFUN([AC_PATH_TOOL_PREFIX],
++[AC_REQUIRE([AC_PROG_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="ifelse([$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 <<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
++
++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
++])# AC_PATH_TOOL_PREFIX
++
++
++# AC_PATH_MAGIC
++# -------------
++# find a file program which can recognise a shared library
++AC_DEFUN([AC_PATH_MAGIC],
++[AC_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
++ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
++ else
++ MAGIC_CMD=:
++ fi
++fi
++])# AC_PATH_MAGIC
++
++
++# AC_PROG_LD
++# ----------
++# find the pathname to the GNU or non-GNU linker
++AC_DEFUN([AC_PROG_LD],
++[AC_ARG_WITH([gnu-ld],
++ [AC_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])
++AC_REQUIRE([LT_AC_PROG_SED])dnl
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])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 GNU ld's 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])
++AC_PROG_LD_GNU
++])# AC_PROG_LD
++
++
++# AC_PROG_LD_GNU
++# --------------
++AC_DEFUN([AC_PROG_LD_GNU],
++[AC_REQUIRE([AC_PROG_EGREP])dnl
++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 ld's 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
++])# AC_PROG_LD_GNU
++
++
++# AC_PROG_LD_RELOAD_FLAG
++# ----------------------
++# find reload flag for linker
++# -- PORTME Some linkers may need a different reload flag.
++AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
++[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'
++])# AC_PROG_LD_RELOAD_FLAG
++
++
++# AC_DEPLIBS_CHECK_METHOD
++# -----------------------
++# how to check for library dependencies
++# -- PORTME fill in with the dynamic library characteristics
++AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
++[AC_CACHE_CHECK([how to recognise 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
++aix4* | aix5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++beos*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++bsdi4*)
++ 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'.
++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ lt_cv_file_magic_cmd='$OBJDUMP -f'
++ ;;
++
++darwin* | rhapsody*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++freebsd* | kfreebsd*-gnu)
++ 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)/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
++ ;;
++
++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]) 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
++ ;;
++
++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*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
++ 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=unknown
++ ;;
++
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
++osf3* | osf4* | osf5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sco3.2v5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++solaris*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ 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
+ ;;
++ esac
++ ;;
++
++sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++esac
++])
++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
++])# AC_DEPLIBS_CHECK_METHOD
+
+- 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++
++# AC_PROG_NM
++# ----------
++# find the pathname to a BSD-compatible name lister
++AC_DEFUN([AC_PROG_NM],
++[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
++[if test -n "$NM"; then
++ # Let the user override the test.
++ lt_cv_path_NM="$NM"
++else
++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
++ IFS="$lt_save_ifs"
++ test -z "$ac_dir" && ac_dir=.
++ tmp_nm="$ac_dir/${ac_tool_prefix}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"
++ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
++fi])
++NM="$lt_cv_path_NM"
++])# AC_PROG_NM
+
+- solaris* | sysv5*)
+- if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+- ld_shlibs=no
+- cat <<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.
++# AC_CHECK_LIBM
++# -------------
++# check for math library
++AC_DEFUN([AC_CHECK_LIBM],
++[AC_REQUIRE([AC_CANONICAL_HOST])dnl
++LIBM=
++case $host in
++*-*-beos* | *-*-cygwin* | *-*-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_CHECK_LIBM
+
+-EOF
+- elif $LD --help 2>&1 | egrep ': 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
+- ;;
+
+- sunos4*)
+- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+- wlarc=
+- hardcode_direct=yes
+- hardcode_shlibpath_var=no
+- ;;
++# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
++# -----------------------------------
++# sets LIBLTDL to the link flags for the libltdl convenience library and
++# LTDLINCL to the include flags for the libltdl header and adds
++# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
++# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
++# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
++# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
++# '${top_srcdir}/' (note the single quotes!). If your package is not
++# flat and you're not using automake, define top_builddir and
++# top_srcdir appropriately in the Makefiles.
++AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++ case $enable_ltdl_convenience in
++ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
++ "") enable_ltdl_convenience=yes
++ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
++ esac
++ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
++])# AC_LIBLTDL_CONVENIENCE
+
+- *)
+- if $LD --help 2>&1 | egrep ': 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
++
++# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
++# -----------------------------------
++# sets LIBLTDL to the link flags for the libltdl installable library and
++# LTDLINCL to the include flags for the libltdl header and adds
++# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
++# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
++# DIRECTORY is not provided and an installed libltdl is not found, it is
++# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
++# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
++# quotes!). If your package is not flat and you're not using automake,
++# define top_builddir and top_srcdir appropriately in the Makefiles.
++# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
++AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++ AC_CHECK_LIB(ltdl, lt_dlinit,
++ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
++ [if test x"$enable_ltdl_install" = xno; then
++ AC_MSG_WARN([libltdl not installed, but installation disabled])
++ else
++ enable_ltdl_install=yes
++ fi
++ ])
++ if test x"$enable_ltdl_install" = x"yes"; then
++ ac_configure_args="$ac_configure_args --enable-ltdl-install"
++ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
++ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
++ else
++ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
++ LIBLTDL="-lltdl"
++ LTDLINCL=
++ fi
++ # For backwards non-gettext consistent compatibility...
++ INCLTDL="$LTDLINCL"
++])# AC_LIBLTDL_INSTALLABLE
++
++
++# AC_LIBTOOL_CXX
++# --------------
++# enable support for C++ libraries
++AC_DEFUN([AC_LIBTOOL_CXX],
++[AC_REQUIRE([_LT_AC_LANG_CXX])
++])# AC_LIBTOOL_CXX
++
++
++# _LT_AC_LANG_CXX
++# ---------------
++AC_DEFUN([_LT_AC_LANG_CXX],
++[AC_REQUIRE([AC_PROG_CXX])
++AC_REQUIRE([AC_PROG_CXXCPP])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
++])# _LT_AC_LANG_CXX
++
++
++# AC_LIBTOOL_F77
++# --------------
++# enable support for Fortran 77 libraries
++AC_DEFUN([AC_LIBTOOL_F77],
++[AC_REQUIRE([_LT_AC_LANG_F77])
++])# AC_LIBTOOL_F77
++
++
++# _LT_AC_LANG_F77
++# ---------------
++AC_DEFUN([_LT_AC_LANG_F77],
++[AC_REQUIRE([AC_PROG_F77])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
++])# _LT_AC_LANG_F77
++
++
++# AC_LIBTOOL_GCJ
++# --------------
++# enable support for GCJ libraries
++AC_DEFUN([AC_LIBTOOL_GCJ],
++[AC_REQUIRE([_LT_AC_LANG_GCJ])
++])# AC_LIBTOOL_GCJ
++
++
++# _LT_AC_LANG_GCJ
++# ---------------
++AC_DEFUN([_LT_AC_LANG_GCJ],
++[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
++ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
++ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
++ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
++ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
++ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
++])# _LT_AC_LANG_GCJ
++
++
++# AC_LIBTOOL_RC
++# --------------
++# enable support for Windows resource files
++AC_DEFUN([AC_LIBTOOL_RC],
++[AC_REQUIRE([LT_AC_PROG_RC])
++_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
++])# AC_LIBTOOL_RC
++
++
++# AC_LIBTOOL_LANG_C_CONFIG
++# ------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined. Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
++AC_DEFUN([_LT_AC_LANG_C_CONFIG],
++[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_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="int some_variable = 0;\n"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code='int main(){return(0);}\n'
++
++_LT_AC_SYS_COMPILER
++
++#
++# Check for any special shared library compilation flags.
++#
++_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
++if test "$GCC" = no; then
++ case $host_os in
++ sco3.2v5*)
++ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+ ;;
+ esac
++fi
++if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
++ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
++ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then :
++ else
++ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
++ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
++ fi
++fi
+
+- if test "$ld_shlibs" = yes; then
+- runpath_var=LD_RUN_PATH
+- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+- export_dynamic_flag_spec='${wl}--export-dynamic'
+- case $host_os in
+- cygwin* | mingw* | pw32*)
+- # dlltool doesn't understand --whole-archive et. al.
+- whole_archive_flag_spec=
++
++#
++# Check to make sure the static flag actually works.
++#
++AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
++ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
++ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
++ [],
++ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
++
++
++AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++AC_LIBTOOL_SYS_LIB_STRIP
++AC_LIBTOOL_DLOPEN_SELF($1)
++
++# Report which librarie types wil 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
++ ;;
++
++aix4* | aix5*)
++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
++ test "$enable_shared" = yes && enable_static=no
++ fi
++ ;;
++ darwin* | rhapsody*)
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++ case "$host_os" in
++ rhapsody* | darwin1.[[012]])
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+- *)
+- # ancient GNU ld didn't support --whole-archive et. al.
+- if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
+- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ *) # Darwin 1.3 on
++ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ else
+- whole_archive_flag_spec=
++ case ${MACOSX_DEPLOYMENT_TARGET} in
++ 10.[[012]])
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
++ ;;
++ 10.*)
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
++ ;;
++ esac
+ fi
+ ;;
+ esac
++ output_verbose_link_cmd='echo'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
++ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
++ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++ else
++ _LT_AC_TAGVAR(ld_shlibs, $1)=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])
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_POP
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_C_CONFIG
++
++
++# AC_LIBTOOL_LANG_CXX_CONFIG
++# --------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined. Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
++AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
++[AC_LANG_PUSH(C++)
++AC_REQUIRE([AC_PROG_CXX])
++AC_REQUIRE([AC_PROG_CXXCPP])
++
++_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++_LT_AC_TAGVAR(allow_undefined_flag, $1)=
++_LT_AC_TAGVAR(always_export_symbols, $1)=no
++_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
++_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_direct, $1)=no
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
++_LT_AC_TAGVAR(hardcode_automatic, $1)=no
++_LT_AC_TAGVAR(module_cmds, $1)=
++_LT_AC_TAGVAR(module_expsym_cmds, $1)=
++_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
++_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_AC_TAGVAR(no_undefined_flag, $1)=
++_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
++
++# Dependencies to place before and after the object being linked:
++_LT_AC_TAGVAR(predep_objects, $1)=
++_LT_AC_TAGVAR(postdep_objects, $1)=
++_LT_AC_TAGVAR(predeps, $1)=
++_LT_AC_TAGVAR(postdeps, $1)=
++_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
++
++# Source file extension for C++ test sources.
++ac_ext=cc
++
++# Object file extension for compiled C++ test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="int some_variable = 0;\n"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
++
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
++
++# Allow CC to be a program name with arguments.
++lt_save_CC=$CC
++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
+- # 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 "$link_static_flag"; then
+- # Neither direct hardcoding nor static linking is supported with a
+- # broken collect2.
+- hardcode_direct=unsupported
++ 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
++ unset lt_cv_path_LD
++fi
++test -z "${LDCXX+set}" || LD=$LDCXX
++CC=${CXX-"c++"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
++
++# We don't want -fno-exception wen compiling C++ code, so set the
++# no_builtin_flag separately
++if test "$GXX" = yes; then
++ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
++else
++ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
++fi
++
++if test "$GXX" = yes; then
++ # Set up default GNU C++ configuration
++
++ AC_PROG_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
++ _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ else
++ _LT_AC_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_AC_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 "\-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_AC_TAGVAR(ld_shlibs, $1)=yes
++case $host_os in
++ aix3*)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+@@ -1586,7 +3728,7 @@
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+- ;;
++ ;;
+ esac
+ done
+ esac
+@@ -1601,34 +3743,39 @@
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+- hardcode_direct=yes
+- archive_cmds=''
+- hardcode_libdir_separator=':'
+- if test "$GCC" = yes; then
+- case $host_os in aix4.[[012]]|aix4.[[012]].*)
++ _LT_AC_TAGVAR(archive_cmds, $1)=''
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++
++ 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
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+- hardcode_direct=yes
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+- hardcode_direct=unsupported
++ _LT_AC_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
+- hardcode_minus_L=yes
+- hardcode_libdir_flag_spec='-L$libdir'
+- hardcode_libdir_separator=
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+-
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+- shared_flag='${wl}-G'
++ # 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'
+@@ -1638,833 +3785,867 @@
+ fi
+ fi
+
+- # It seems that -bexpall can do strange things, so it is better to
+- # generate a list of symbols to export.
+- always_export_symbols=yes
++ # It seems that -bexpall does not export symbols beginning with
++ # underscore (_), so it is better to generate a list of symbols to export.
++ _LT_AC_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.
+- allow_undefined_flag='-berok'
+- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+- else
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
++ # Determine the default libpath from the value encoded in an empty executable.
++ _LT_AC_SYS_LIBPATH_AIX
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
++
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ else
+- hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Determine the default libpath from the value encoded in an empty executable.
++ _LT_AC_SYS_LIBPATH_AIX
++ _LT_AC_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.
+- allow_undefined_flag='${wl}-berok'
+- # This is a bit strange, but is similar to how AIX traditionally builds
+- # it's shared libraries.
+- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
++ # -bexpall does not export symbols beginning with underscore (_)
++ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
++ # Exported symbols can be pulled into shared objects from archives
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++ # This is similar to how AIX traditionally builds it's shared libraries.
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+-
+- amigaos*)
+- 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
+- # see comment about different semantics on the GNU ld section
+- ld_shlibs=no
++ chorus*)
++ case $cc_basename in
++ *)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+- # 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
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''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"`'
+- ;;
++ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++ # as there is no search path for DLLs.
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++ _LT_AC_TAGVAR(always_export_symbols, $1)=no
++ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++
++ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is; otherwise, prepend...
++ _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
++ else
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
+
+ darwin* | rhapsody*)
++ if test "$GXX" = yes; then
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+- allow_undefined_flag='-undefined suppress'
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+- allow_undefined_flag='-flat_namespace -undefined suppress'
+- ;;
+- esac
+- # FIXME: Relying on posixy $() will cause problems for
+- # cross-compilation, but unfortunately the echo tests do not
+- # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+- # `"' quotes if we put them in here... so don't!
+- archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+- # We need to add '_' to the symbols in $export_symbols first
+- #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
+- hardcode_direct=yes
+- hardcode_shlibpath_var=no
+- whole_archive_flag_spec='-all_load $convenience'
+- ;;
+-
+- freebsd1*)
+- ld_shlibs=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*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+- hardcode_libdir_flag_spec='-R$libdir'
+- hardcode_direct=yes
+- hardcode_shlibpath_var=no
+- ;;
+-
+- hpux9* | hpux10* | hpux11*)
+- case $host_os in
+- hpux9*) 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' ;;
+- *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
+- esac
+- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+- hardcode_libdir_separator=:
+- hardcode_direct=yes
+- hardcode_minus_L=yes # Not in the search PATH, but as the default
+- # location of the library.
+- export_dynamic_flag_spec='${wl}-E'
+- ;;
+-
+- irix5* | irix6* | nonstopux*)
+- if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+- else
+- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+- hardcode_libdir_flag_spec='-rpath $libdir'
+- fi
+- hardcode_libdir_separator=:
+- 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
+- ;;
+-
+- openbsd*)
+- hardcode_direct=yes
+- hardcode_shlibpath_var=no
+- 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'
+- 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
++ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
++ else
++ case ${MACOSX_DEPLOYMENT_TARGET} in
++ 10.[[012]])
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
++ ;;
++ 10.*)
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
++ ;;
++ esac
++ fi
++ ;;
++ esac
++ lt_int_apple_cc_single_mod=no
++ output_verbose_link_cmd='echo'
++ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
++ lt_int_apple_cc_single_mod=yes
+ 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+- allow_undefined_flag=' -expect_unresolved \*'
+- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
+ fi
+- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+- hardcode_libdir_separator=:
+- ;;
++ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+- 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
++ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+- allow_undefined_flag=' -expect_unresolved \*'
+- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+-
+- #Both c and cxx compiler support -rpath directly
+- hardcode_libdir_flag_spec='-rpath $libdir'
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+- hardcode_libdir_separator=:
+- ;;
+-
+- sco3.2v5*)
+- 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
+- export_dynamic_flag_spec='${wl}-Bexport'
++ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++ else
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
+ ;;
+
+- solaris*)
+- # gcc --version < 3.0 without binutils cannot create self contained
+- # shared libraries reliably, requiring libgcc.a to resolve some of
+- # the object symbols generated in some cases. Libraries that use
+- # assert need libgcc.a to resolve __eprintf, for example. Linking
+- # a copy of libgcc.a into every shared library to guarantee resolving
+- # such symbols causes other problems: According to Tim Van Holder
+- # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
+- # (to the application) exception stack for one thing.
+- no_undefined_flag=' -z defs'
+- if test "$GCC" = yes; then
+- case `$CC --version 2>/dev/null` in
+- [[12]].*)
+- cat <<EOF 1>&2
+-
+-*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
+-*** create self contained shared libraries on Solaris systems, without
+-*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
+-*** -no-undefined support, which will at least allow you to build shared
+-*** libraries. However, you may find that when you link such libraries
+-*** into an application without using GCC, you have to manually add
+-*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
+-*** upgrade to a newer version of GCC. Another option is to rebuild your
+-*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
+-
+-EOF
+- no_undefined_flag=
++ dgux*)
++ case $cc_basename in
++ ec++)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ ghcx)
++ # Green Hills C++ Compiler
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ *)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+- esac
+- fi
+- # $CC -shared without GNU ld will not create a library from C++
+- # object files and a static libstdc++, better avoid it by now
+- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
+- hardcode_libdir_flag_spec='-R$libdir'
+- hardcode_shlibpath_var=no
+- case $host_os in
+- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+- *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ esac
+- 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
++ freebsd[12]*)
++ # C++ shared libraries reported to be fairly broken before switch to ELF
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ freebsd-elf*)
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++ ;;
++ freebsd* | kfreebsd*-gnu)
++ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
++ # conventions
++ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
++ ;;
++ gnu*)
++ ;;
++ hpux9*)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ aCC)
++ _LT_AC_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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++ ;;
++ *)
++ if test "$GXX" = yes; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
++ esac
+ ;;
+-
+- 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???
++ hpux10*|hpux11*)
++ if test $with_gnu_ld = no; then
++ case "$host_cpu" in
++ hppa*64*)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+- 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
++ ia64*)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+- 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
++ *)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
++ esac
++ fi
++ case "$host_cpu" in
++ hppa*64*)
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
++ ia64*)
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
++ # but as the default
++ # location of the library.
++ ;;
++ *)
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
++ # but as the default
++ # location of the library.
++ ;;
+ 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'
+- ;;
+-
+- sysv5*)
+- no_undefined_flag=' -z text'
+- # $CC -shared without GNU ld will not create a library from C++
+- # object files and a static libstdc++, better avoid it by now
+- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
+- hardcode_libdir_flag_spec=
+- hardcode_shlibpath_var=no
+- runpath_var='LD_RUN_PATH'
+- ;;
+-
+- uts4*)
+- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+- hardcode_libdir_flag_spec='-L$libdir'
+- hardcode_shlibpath_var=no
++ case $cc_basename in
++ CC)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ aCC)
++ case "$host_cpu" in
++ hppa*64*|ia64*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
++ ;;
++ *)
++ _LT_AC_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; echo $list'
++ ;;
++ *)
++ if test "$GXX" = yes; then
++ if test $with_gnu_ld = no; then
++ case "$host_cpu" in
++ ia64*|hppa*64*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
++ ;;
++ *)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${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_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
++ esac
+ ;;
+-
+- dgux*)
+- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+- hardcode_libdir_flag_spec='-L$libdir'
+- hardcode_shlibpath_var=no
++ irix5* | irix6*)
++ case $cc_basename in
++ CC)
++ # SGI C++
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${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_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
++ fi
++ fi
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++ ;;
++ esac
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+-
+- 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
++ linux*)
++ 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_AC_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_AC_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; echo $list'
++
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
++ _LT_AC_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_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
++ ;;
++ icpc)
++ # Intel C++
++ with_gnu_ld=yes
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_AC_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'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
++ ;;
++ cxx)
++ # Compaq C++
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
++ _LT_AC_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=`echo $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; echo $list'
++ ;;
++ esac
+ ;;
+-
+- sysv4.2uw2*)
+- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+- hardcode_direct=yes
+- hardcode_minus_L=no
+- hardcode_shlibpath_var=no
+- hardcode_runpath_var=yes
+- runpath_var=LD_RUN_PATH
++ lynxos*)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ m88k*)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ mvs*)
++ case $cc_basename in
++ cxx)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ *)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ esac
+ ;;
+-
+- sysv5uw7* | unixware7*)
+- no_undefined_flag='${wl}-z ${wl}text'
+- if test "$GCC" = yes; then
+- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+- else
+- archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
++ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
++ wlarc=
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+- runpath_var='LD_RUN_PATH'
+- hardcode_shlibpath_var=no
+- ;;
+-
+- *)
+- ld_shlibs=no
++ # 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::"'
+ ;;
+- esac
+-fi
+-AC_MSG_RESULT([$ld_shlibs])
+-test "$ld_shlibs" = no && can_build_shared=no
+-
+-# Check hardcoding attributes.
+-AC_MSG_CHECKING([how to hardcode library paths into programs])
+-hardcode_action=
+-if test -n "$hardcode_libdir_flag_spec" || \
+- test -n "$runpath_var"; then
+-
+- # We can hardcode non-existant 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 "$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
+-AC_MSG_RESULT([$hardcode_action])
+-
+-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
+- AC_MSG_RESULT([no])
+-fi
+-
+-reload_cmds='$LD$reload_flag -o $output$reload_objs'
+-test -z "$deplibs_check_method" && deplibs_check_method=unknown
+-
+-# PORTME Fill in your ld.so characteristics
+-AC_MSG_CHECKING([dynamic linker characteristics])
+-library_names_spec=
+-libname_spec='lib$name'
+-soname_spec=
+-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"
+-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+-
+-case $host_os in
+-aix3*)
+- version_type=linux
+- library_names_spec='${libname}${release}.so$versuffix $libname.a'
+- shlibpath_var=LIBPATH
++ osf3*)
++ 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++ # Archives containing C++ object files must be created using
++ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
++ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+- # AIX has no versioning support, so we append a major version to the name.
+- soname_spec='${libname}${release}.so$major'
+- ;;
++ ;;
++ RCC)
++ # Rational C++ 2.4.1
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ cxx)
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
++
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ _LT_AC_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=`echo $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; echo $list'
++ ;;
++ *)
++ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++ _LT_AC_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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
++
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ _LT_AC_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 "\-L"'
+
+-aix4* | aix5*)
+- 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}.so$major ${libname}${release}.so$versuffix $libname.so'
+- 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
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=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}.so$versuffix ${libname}${release}.so$major $libname.so'
+- 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}.so$major'
+- fi
+- shlibpath_var=LIBPATH
+- fi
+- hardcode_into_libs=yes
+- ;;
+-
+-amigaos*)
+- 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=`$echo "X$lib" | $Xsed -e '\''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'
+- ;;
+-
+-beos*)
+- library_names_spec='${libname}.so'
+- dynamic_linker="$host_os ld.so"
+- shlibpath_var=LIBRARY_PATH
+- ;;
+-
+-bsdi4*)
+- version_type=linux
+- need_version=no
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- soname_spec='${libname}${release}.so$major'
+- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+- shlibpath_var=LD_LIBRARY_PATH
+- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+- export_dynamic_flag_spec=-rdynamic
+- # the default ld.so.conf also contains /usr/contrib/lib and
+- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+- # libtool to hard-code these into programs
+- ;;
+-
+-cygwin* | mingw* | pw32*)
+- version_type=windows
+- need_version=no
+- need_lib_prefix=no
+- case $GCC,$host_os in
+- yes,cygwin*)
+- library_names_spec='$libname.dll.a'
+- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
+- postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
+- dldir=$destdir/`dirname \$dlpath`~
+- test -d \$dldir || mkdir -p \$dldir~
+- $install_prog .libs/$dlname \$dldir/$dlname'
+- postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
+- dlpath=$dir/\$dldll~
+- $rm \$dlpath'
+- ;;
+- yes,mingw*)
+- library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
+- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
+- ;;
+- yes,pw32*)
+- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
+ ;;
+- *)
+- library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $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
+- # FIXME: Relying on posixy $() will cause problems for
+- # cross-compilation, but unfortunately the echo tests do not
+- # yet detect zsh echo's removal of \ escapes.
+- library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
+- soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
+- shlibpath_overrides_runpath=yes
+- shlibpath_var=DYLD_LIBRARY_PATH
+- ;;
+-
+-freebsd1*)
+- dynamic_linker=no
+- ;;
+-
+-freebsd*-gnu*)
+- version_type=linux
+- need_lib_prefix=no
+- need_version=no
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- soname_spec='${libname}${release}.so$major'
+- shlibpath_var=LD_LIBRARY_PATH
+- shlibpath_overrides_runpath=no
+- hardcode_into_libs=yes
+- dynamic_linker='GNU/FreeBSD ld.so'
+- ;;
++ 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_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++
++ # Archives containing C++ object files must be created using
++ # the KAI C++ compiler.
++ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
++ ;;
++ RCC)
++ # Rational C++ 2.4.1
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ cxx)
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
++ _LT_AC_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 $objdir/so_locations -o $lib~
++ $rm $lib.exp'
++
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
++ _LT_AC_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=`echo $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; echo $list'
++ ;;
++ *)
++ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
++
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ _LT_AC_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 "\-L"'
+
+-freebsd*)
+- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+- version_type=freebsd-$objformat
+- case $version_type in
+- freebsd-elf*)
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+- need_version=no
+- need_lib_prefix=no
+- ;;
+- freebsd-*)
+- library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
+- need_version=yes
+- ;;
+- esac
+- shlibpath_var=LD_LIBRARY_PATH
+- case $host_os in
+- freebsd2*)
+- shlibpath_overrides_runpath=yes
++ else
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
++ esac
+ ;;
+- *)
+- shlibpath_overrides_runpath=no
+- hardcode_into_libs=yes
++ psos*)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ sco*)
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++ case $cc_basename in
++ CC)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ *)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ esac
+ ;;
+- esac
+- ;;
++ sunos4*)
++ case $cc_basename in
++ CC)
++ # Sun C++ 4.x
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ lcc)
++ # Lucid
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ *)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ esac
++ ;;
++ solaris*)
++ case $cc_basename in
++ CC)
++ # Sun C++ 4.2, 5.x and Centerline C++
++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++ _LT_AC_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} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
++
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ case $host_os in
++ solaris2.[0-5] | solaris2.[0-5].*) ;;
++ *)
++ # The C++ compiler is used as linker so we must use $wl
++ # flag to pass the commands to the underlying system
++ # linker.
++ # Supported since Solaris 2.6 (maybe 2.5.1?)
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
++ ;;
++ esac
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+-gnu*)
+- version_type=linux
+- need_lib_prefix=no
+- need_version=no
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
+- soname_spec='${libname}${release}.so$major'
+- shlibpath_var=LD_LIBRARY_PATH
+- hardcode_into_libs=yes
+- ;;
++ # 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 -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
++
++ # 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_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
++ ;;
++ gcx)
++ # Green Hills C++ Compiler
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+-hpux9* | hpux10* | hpux11*)
+- # Give a soname corresponding to the major version so that dld.sl refuses to
+- # link against other versions.
+- dynamic_linker="$host_os dld.sl"
+- version_type=sunos
+- need_lib_prefix=no
+- need_version=no
+- shlibpath_var=SHLIB_PATH
+- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+- library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
+- soname_spec='${libname}${release}.sl$major'
+- # HP-UX runs *really* slowly unless shared libraries are mode 555.
+- postinstall_cmds='chmod 555 $lib'
+- ;;
++ # The C++ compiler must be used to create the archive.
++ _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
++ if $CC --version | grep -v '^2\.7' > /dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
++ $CC -shared -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 \"\-L\""
++ else
++ # g++ 2.7 appears to require `-G' NOT `-shared' on this
++ # platform.
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++ _LT_AC_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 \"\-L\""
++ fi
+
+-irix5* | irix6* | nonstopux*)
+- case $host_os in
+- nonstopux*) version_type=nonstopux ;;
+- *) version_type=irix ;;
+- esac
+- need_lib_prefix=no
+- need_version=no
+- soname_spec='${libname}${release}.so$major'
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
+- case $host_os in
+- irix5* | nonstopux*)
+- libsuff= shlibsuff=
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
++ fi
++ ;;
++ esac
+ ;;
+- *)
+- case $LD in # libtool.m4 will add one of these switches to LD
+- *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
+- *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
+- *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+- *) libsuff= shlibsuff= libmagic=never-match;;
++ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++ ;;
++ tandem*)
++ case $cc_basename in
++ NCC)
++ # NonStop-UX NCC 3.20
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ *)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
+ 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}"
+- ;;
+-
+-# No shared lib support for Linux oldld, aout, or coff.
+-linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+- dynamic_linker=no
+- ;;
++ vxworks*)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ *)
++ # FIXME: insert proper C++ library support
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++esac
++AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
++test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+-# This must be Linux ELF.
+-linux-gnu*)
+- version_type=linux
+- need_lib_prefix=no
+- need_version=no
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- soname_spec='${libname}${release}.so$major'
+- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+- shlibpath_var=LD_LIBRARY_PATH
+- shlibpath_overrides_runpath=no
+- # 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
++_LT_AC_TAGVAR(GCC, $1)="$GXX"
++_LT_AC_TAGVAR(LD, $1)="$LD"
+
+- # 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'
+- ;;
++AC_LIBTOOL_POSTDEP_PREDEP($1)
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++AC_LIBTOOL_SYS_LIB_STRIP
++AC_LIBTOOL_DLOPEN_SELF($1)
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_POP
++CC=$lt_save_CC
++LDCXX=$LD
++LD=$lt_save_LD
++GCC=$lt_save_GCC
++with_gnu_ldcxx=$with_gnu_ld
++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
++])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+-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}.so$versuffix ${libname}.so$versuffix'
+- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+- dynamic_linker='NetBSD (a.out) ld.so'
+- else
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
+- soname_spec='${libname}${release}.so$major'
+- dynamic_linker='NetBSD ld.elf_so'
+- fi
+- shlibpath_var=LD_LIBRARY_PATH
+- shlibpath_overrides_runpath=yes
+- hardcode_into_libs=yes
+- ;;
++# AC_LIBTOOL_POSTDEP_PREDEP([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.
++AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
++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...
++ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
++int a;
++void foo (void) { a = 0; }
++EOF
++],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
++class Foo
++{
++public:
++ Foo (void) { a = 0; }
++private:
++ int a;
++};
++EOF
++],[$1],[F77],[cat > conftest.$ac_ext <<EOF
++ subroutine foo
++ implicit none
++ integer*4 a
++ a=0
++ return
++ end
++EOF
++],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
++public class foo {
++ private int a;
++ public void bar (void) {
++ a = 0;
++ }
++};
++EOF
++])
++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
++
++ # The `*' in the case matches for architectures that use `case' in
++ # $output_verbose_cmd can trigger glob expansion during the loop
++ # eval without this substitution.
++ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
++
++ 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 "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
++ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
++ else
++ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_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_AC_TAGVAR(postdeps, $1)"; then
++ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
++ else
++ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${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 "$_LT_AC_TAGVAR(predep_objects, $1)"; then
++ _LT_AC_TAGVAR(predep_objects, $1)="$p"
++ else
++ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
++ fi
++ else
++ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
++ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
++ else
++ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
++ fi
++ fi
++ ;;
+
+-newsos6)
+- version_type=linux
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- shlibpath_var=LD_LIBRARY_PATH
+- shlibpath_overrides_runpath=yes
+- ;;
++ *) ;; # Ignore the rest.
+
+-openbsd*)
+- version_type=sunos
+- need_lib_prefix=no
+- need_version=no
+- 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
+- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+- shlibpath_var=LD_LIBRARY_PATH
+- ;;
+-
+-os2*)
+- libname_spec='$name'
+- need_lib_prefix=no
+- library_names_spec='$libname.dll $libname.a'
+- dynamic_linker='OS/2 ld.exe'
+- shlibpath_var=LIBPATH
+- ;;
+-
+-osf3* | osf4* | osf5*)
+- version_type=osf
+- need_version=no
+- need_lib_prefix=no
+- soname_spec='${libname}${release}.so$major'
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- 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"
+- hardcode_into_libs=yes
+- ;;
++ done
+
+-sco3.2v5*)
+- version_type=osf
+- soname_spec='${libname}${release}.so$major'
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- shlibpath_var=LD_LIBRARY_PATH
+- ;;
++ # Clean up.
++ rm -f a.out a.exe
++else
++ echo "libtool.m4: error: problem compiling $1 test program"
++fi
+
+-solaris*)
+- version_type=linux
+- need_lib_prefix=no
+- need_version=no
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- soname_spec='${libname}${release}.so$major'
+- shlibpath_var=LD_LIBRARY_PATH
+- shlibpath_overrides_runpath=yes
+- hardcode_into_libs=yes
+- # ldd complains unless libraries are executable
+- postinstall_cmds='chmod +x $lib'
+- ;;
++$rm -f confest.$objext
+
+-sunos4*)
+- version_type=sunos
+- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$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
+- ;;
++case " $_LT_AC_TAGVAR(postdeps, $1) " in
++*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
++esac
++])# AC_LIBTOOL_POSTDEP_PREDEP
+
+-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+- version_type=linux
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- soname_spec='${libname}${release}.so$major'
+- shlibpath_var=LD_LIBRARY_PATH
+- case $host_vendor in
+- sni)
+- shlibpath_overrides_runpath=no
+- need_lib_prefix=no
+- export_dynamic_flag_spec='${wl}-Blargedynsym'
+- 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
+- ;;
++# AC_LIBTOOL_LANG_F77_CONFIG
++# ------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined. Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
++AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
++[AC_REQUIRE([AC_PROG_F77])
++AC_LANG_PUSH(Fortran 77)
++
++_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++_LT_AC_TAGVAR(allow_undefined_flag, $1)=
++_LT_AC_TAGVAR(always_export_symbols, $1)=no
++_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
++_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_direct, $1)=no
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
++_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
++_LT_AC_TAGVAR(hardcode_automatic, $1)=no
++_LT_AC_TAGVAR(module_cmds, $1)=
++_LT_AC_TAGVAR(module_expsym_cmds, $1)=
++_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
++_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
++_LT_AC_TAGVAR(no_undefined_flag, $1)=
++_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++_LT_AC_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_AC_TAGVAR(objext, $1)=$objext
+
+-uts4*)
+- version_type=linux
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- soname_spec='${libname}${release}.so$major'
+- shlibpath_var=LD_LIBRARY_PATH
+- ;;
++# Code to be used in simple compile tests
++lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+-dgux*)
+- version_type=linux
+- need_lib_prefix=no
+- need_version=no
+- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+- soname_spec='${libname}${release}.so$major'
+- shlibpath_var=LD_LIBRARY_PATH
+- ;;
++# Code to be used in simple link tests
++lt_simple_link_test_code=" program t\n end\n"
+
+-sysv4*MP*)
+- if test -d /usr/nec ;then
+- version_type=linux
+- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
+- soname_spec='$libname.so.$major'
+- shlibpath_var=LD_LIBRARY_PATH
+- fi
+- ;;
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
+
+-*)
+- dynamic_linker=no
+- ;;
+-esac
+-AC_MSG_RESULT([$dynamic_linker])
+-test "$dynamic_linker" = no && can_build_shared=no
++# Allow CC to be a program name with arguments.
++lt_save_CC="$CC"
++CC=${F77-"f77"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+-# Report the final consequences.
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+@@ -2481,125 +4662,206 @@
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
++aix4* | aix5*)
++ test "$enable_shared" = yes && enable_static=no
++ ;;
++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])
++
++test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
++
++_LT_AC_TAGVAR(GCC, $1)="$G77"
++_LT_AC_TAGVAR(LD, $1)="$LD"
++
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++AC_LIBTOOL_SYS_LIB_STRIP
++
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_POP
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_F77_CONFIG
++
++
++# AC_LIBTOOL_LANG_GCJ_CONFIG
++# --------------------------
++# Ensure that the configuration vars for the C compiler are
++# suitably defined. Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
++AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
++[AC_LANG_SAVE
++
++# Source file extension for Java test sources.
++ac_ext=java
++
++# Object file extension for compiled Java test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
++
++# Code to be used in simple compile tests
++lt_simple_compile_test_code="class foo {}\n"
++
++# Code to be used in simple link tests
++lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
++
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
++
++# Allow CC to be a program name with arguments.
++lt_save_CC="$CC"
++CC=${GCJ-"gcj"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++
++# GCJ did not exist at the time GCC didn't implicitly link libc in.
++_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++
++AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
++AC_LIBTOOL_PROG_COMPILER_PIC($1)
++AC_LIBTOOL_PROG_CC_C_O($1)
++AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
++AC_LIBTOOL_PROG_LD_SHLIBS($1)
++AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
++AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
++AC_LIBTOOL_SYS_LIB_STRIP
++AC_LIBTOOL_DLOPEN_SELF($1)
++
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_RESTORE
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_GCJ_CONFIG
++
++
++# AC_LIBTOOL_LANG_RC_CONFIG
++# --------------------------
++# Ensure that the configuration vars for the Windows resource compiler are
++# suitably defined. Those variables are subsequently used by
++# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
++AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
++AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
++[AC_LANG_SAVE
++
++# Source file extension for RC test sources.
++ac_ext=rc
++
++# Object file extension for compiled RC test sources.
++objext=o
++_LT_AC_TAGVAR(objext, $1)=$objext
+
+-aix4*)
+- 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])
++# Code to be used in simple compile tests
++lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+-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])
++# Code to be used in simple link tests
++lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+-if test "$hardcode_action" = relink; 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
++# ltmain only uses $CC for tagged configurations so make sure $CC is set.
++_LT_AC_SYS_COMPILER
+
+-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
++# Allow CC to be a program name with arguments.
++lt_save_CC="$CC"
++CC=${RC-"windres"}
++compiler=$CC
++_LT_AC_TAGVAR(compiler, $1)=$CC
++_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+-AC_LIBTOOL_DLOPEN_SELF
++AC_LIBTOOL_CONFIG($1)
++
++AC_LANG_RESTORE
++CC="$lt_save_CC"
++])# AC_LIBTOOL_LANG_RC_CONFIG
+
+-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.
+- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+- AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
+- [$rm conftest*
+- echo 'static int dummy;' > conftest.$ac_ext
+-
+- if AC_TRY_EVAL(ac_compile); then
+- soname=conftest
+- lib=conftest
+- libobjs=conftest.$ac_objext
+- deplibs=
+- wl=$lt_cv_prog_cc_wl
+- compiler_flags=-v
+- linker_flags=-v
+- verstring=
+- output_objdir=.
+- libname=conftest
+- save_allow_undefined_flag=$allow_undefined_flag
+- allow_undefined_flag=
+- if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+- then
+- lt_cv_archive_cmds_need_lc=no
+- else
+- lt_cv_archive_cmds_need_lc=yes
+- fi
+- allow_undefined_flag=$save_allow_undefined_flag
+- else
+- cat conftest.err 1>&5
+- fi])
+- AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
+- ;;
+- esac
+-fi
+-need_lc=${lt_cv_archive_cmds_need_lc-yes}
+
+-# The second clause should only fire when bootstrapping the
++# AC_LIBTOOL_CONFIG([TAGNAME])
++# ----------------------------
++# If TAGNAME is not passed, then 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
++# TAGNAME from the matching tagged config vars.
++AC_DEFUN([AC_LIBTOOL_CONFIG],
++[# The else clause should only fire when bootstrapping the
+ # libtool distribution, otherwise you forgot to ship ltmain.sh
+ # with your package, and you will get complaints that there are
+ # no rules to generate ltmain.sh.
+ if test -f "$ltmain"; then
+- :
+-else
+- # If there is no Makefile yet, we rely on a make rule to execute
+- # `config.status --recheck' to rerun these tests and create the
+- # libtool script then.
+- test -f Makefile && make "$ltmain"
+-fi
+-
+-if test -f "$ltmain"; then
+- trap "$rm \"${ofile}T\"; exit 1" 1 2 15
+- $rm -f "${ofile}T"
+-
+- echo creating $ofile
+-
++ # 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
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+- for var in echo old_CC old_CFLAGS SED \
+- AR AR_FLAGS CC LD LN_S NM SHELL \
+- reload_flag reload_cmds wl \
+- pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
+- thread_safe_flag_spec whole_archive_flag_spec libname_spec \
+- library_names_spec soname_spec \
+- RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
+- old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
+- postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
+- old_striplib striplib file_magic_cmd export_symbols_cmds \
+- deplibs_check_method allow_undefined_flag no_undefined_flag \
+- finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
+- global_symbol_to_c_name_address \
+- hardcode_libdir_flag_spec hardcode_libdir_separator \
++ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
++ SED SHELL STRIP \
++ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
++ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
++ deplibs_check_method reload_flag reload_cmds need_locks \
++ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
++ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+- compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
++ old_postinstall_cmds old_postuninstall_cmds \
++ _LT_AC_TAGVAR(compiler, $1) \
++ _LT_AC_TAGVAR(CC, $1) \
++ _LT_AC_TAGVAR(LD, $1) \
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
++ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
++ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
++ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
++ _LT_AC_TAGVAR(old_archive_cmds, $1) \
++ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
++ _LT_AC_TAGVAR(predep_objects, $1) \
++ _LT_AC_TAGVAR(postdep_objects, $1) \
++ _LT_AC_TAGVAR(predeps, $1) \
++ _LT_AC_TAGVAR(postdeps, $1) \
++ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
++ _LT_AC_TAGVAR(archive_cmds, $1) \
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
++ _LT_AC_TAGVAR(postinstall_cmds, $1) \
++ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
++ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
++ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
++ _LT_AC_TAGVAR(no_undefined_flag, $1) \
++ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
++ _LT_AC_TAGVAR(hardcode_automatic, $1) \
++ _LT_AC_TAGVAR(module_cmds, $1) \
++ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
++ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
++ _LT_AC_TAGVAR(exclude_expsyms, $1) \
++ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+- reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
+- old_postinstall_cmds | old_postuninstall_cmds | \
+- export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
+- extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
++ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
++ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
++ _LT_AC_TAGVAR(archive_cmds, $1) | \
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
++ _LT_AC_TAGVAR(module_cmds, $1) | \
++ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
++ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
++ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
++ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+- finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
++ old_postinstall_cmds | old_postuninstall_cmds | \
++ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+@@ -2609,14 +4871,31 @@
+ esac
+ done
+
+- cat <<__EOF__ > "${ofile}T"
+-#! $SHELL
++ case $lt_echo in
++ *'\[$]0 --fallback-echo"')
++ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
++ ;;
++ esac
+
+-# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
++ifelse([$1], [],
++ [cfgfile="${ofile}T"
++ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
++ $rm -f "$cfgfile"
++ AC_MSG_NOTICE([creating $ofile])],
++ [cfgfile="$ofile"])
++
++ cat <<__EOF__ >> "$cfgfile"
++ifelse([$1], [],
++[#! $SHELL
++
++# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+ # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+-# Copyright (C) 1996-2000 Free Software Foundation, Inc.
++# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
++# Free Software Foundation, Inc.
++#
++# This file is part of GNU Libtool:
+ # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+ #
+ # This program is free software; you can redistribute it and/or modify
+@@ -2638,17 +4917,21 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
+-# A sed that does not truncate output.
++# 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 s/^X//"
++Xsed="$SED -e s/^X//"
+
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
+ # if CDPATH is set.
+ if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+-# ### BEGIN LIBTOOL CONFIG
++# The names of the tagged configurations supported by this script.
++available_tags=
++
++# ### BEGIN LIBTOOL CONFIG],
++[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+ # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+@@ -2662,7 +4945,10 @@
+ build_old_libs=$enable_static
+
+ # Whether or not to add -lc for building shared libraries.
+-build_libtool_need_lc=$need_lc
++build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
++
++# Whether or not to disallow shared libs when runtime libs are static
++allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+ # Whether or not to optimize for fast installation.
+ fast_install=$enable_fast_install
+@@ -2678,14 +4964,20 @@
+ AR=$lt_AR
+ AR_FLAGS=$lt_AR_FLAGS
+
+-# The default C compiler.
+-CC=$lt_CC
++# A C compiler.
++LTCC=$lt_LTCC
++
++# A language-specific compiler.
++CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+ # Is the compiler the GNU C compiler?
+-with_gcc=$GCC
++with_gcc=$_LT_AC_TAGVAR(GCC, $1)
++
++# An ERE matcher.
++EGREP=$lt_EGREP
+
+ # The linker used to build libraries.
+-LD=$lt_LD
++LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+ # Whether we need hard or soft links.
+ LN_S=$lt_LN_S
+@@ -2694,7 +4986,7 @@
+ NM=$lt_NM
+
+ # A symbol stripping program
+-STRIP=$STRIP
++STRIP=$lt_STRIP
+
+ # Used to examine libraries when file_magic_cmd begins "file"
+ MAGIC_CMD=$MAGIC_CMD
+@@ -2716,7 +5008,7 @@
+ reload_cmds=$lt_reload_cmds
+
+ # How to pass a linker flag through the compiler.
+-wl=$lt_wl
++wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+ # Object file suffix (normally "o").
+ objext="$ac_objext"
+@@ -2724,18 +5016,21 @@
+ # Old archive suffix (normally "a").
+ libext="$libext"
+
++# Shared library suffix (normally ".so").
++shrext_cmds='$shrext_cmds'
++
+ # Executable file suffix (normally "").
+ exeext="$exeext"
+
+ # Additional compiler flags for building library objects.
+-pic_flag=$lt_pic_flag
++pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+ pic_mode=$pic_mode
+
+-# Does compiler simultaneously support -c and -o options?
+-compiler_c_o=$lt_compiler_c_o
++# What is the maximum length of a command?
++max_cmd_len=$lt_cv_sys_max_cmd_len
+
+-# Can we write directly to a .lo ?
+-compiler_o_lo=$lt_compiler_o_lo
++# Does compiler simultaneously support -c and -o options?
++compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+ # Must we lock files when doing compilation ?
+ need_locks=$lt_need_locks
+@@ -2756,946 +5051,1770 @@
+ dlopen_self_static=$enable_dlopen_self_static
+
+ # Compiler flag to prevent dynamic linking.
+-link_static_flag=$lt_link_static_flag
++link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+ # Compiler flag to turn off builtin functions.
+-no_builtin_flag=$lt_no_builtin_flag
++no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+ # Compiler flag to allow reflexive dlopens.
+-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
++export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+ # Compiler flag to generate shared objects directly from archives.
+-whole_archive_flag_spec=$lt_whole_archive_flag_spec
++whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+ # Compiler flag to generate thread-safe objects.
+-thread_safe_flag_spec=$lt_thread_safe_flag_spec
++thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
++
++# Library versioning type.
++version_type=$version_type
++
++# 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
++
++# Commands used to build and install an old-style archive.
++RANLIB=$lt_RANLIB
++old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
++old_postinstall_cmds=$lt_old_postinstall_cmds
++old_postuninstall_cmds=$lt_old_postuninstall_cmds
++
++# Create an old-style archive from a shared archive.
++old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
++
++# Create a temporary old-style archive to link instead of a shared archive.
++old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
++
++# Commands used to build and install a shared archive.
++archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
++archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
++postinstall_cmds=$lt_postinstall_cmds
++postuninstall_cmds=$lt_postuninstall_cmds
++
++# Commands used to build a loadable module (assumed same as above if empty)
++module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
++module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
++
++# Commands to strip libraries.
++old_striplib=$lt_old_striplib
++striplib=$lt_striplib
++
++# Dependencies to place before the objects being linked to create a
++# shared library.
++predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
++
++# Dependencies to place after the objects being linked to create a
++# shared library.
++postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
++
++# Dependencies to place before the objects being linked to create a
++# shared library.
++predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
++
++# Dependencies to place after the objects being linked to create a
++# shared library.
++postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
++
++# The library search path used internally by the compiler when linking
++# a shared library.
++compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
++
++# 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
++
++# Flag that allows shared libraries with undefined symbols to be built.
++allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
++
++# Flag that forces no undefined symbols.
++no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
++
++# Commands used to finish a libtool library installation in a directory.
++finish_cmds=$lt_finish_cmds
++
++# Same as above, but a single script fragment to be evaled but not shown.
++finish_eval=$lt_finish_eval
++
++# 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
++
++# This is the shared library runtime path variable.
++runpath_var=$runpath_var
++
++# This is the shared library path variable.
++shlibpath_var=$shlibpath_var
++
++# Is shlibpath searched before the hard-coded library search path?
++shlibpath_overrides_runpath=$shlibpath_overrides_runpath
++
++# How to hardcode a shared library path into an executable.
++hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
++
++# Whether we should hardcode library paths into libraries.
++hardcode_into_libs=$hardcode_into_libs
++
++# Flag to hardcode \$libdir into a binary during linking.
++# This must work even if \$libdir does not exist.
++hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
++
++# 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_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
++
++# Whether we need a single -rpath flag with a separated argument.
++hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
++
++# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
++
++# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
++# resulting binary.
++hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
++
++# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
++# the resulting binary.
++hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
++
++# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1)
++
++# Variables whose values should be saved in libtool wrapper scripts and
++# restored at relink time.
++variables_saved_for_relink="$variables_saved_for_relink"
++
++# Whether libtool must link a program against all its dependency libraries.
++link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
++
++# 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
++
++# Fix the shell variable \$srcfile for the compiler.
++fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
++
++# Set to yes if exported symbols are required.
++always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
++
++# The commands to list exported symbols.
++export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
++
++# The commands to extract the exported symbol list from a shared archive.
++extract_expsyms_cmds=$lt_extract_expsyms_cmds
++
++# Symbols that should not be listed in the preloaded symbols.
++exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
++
++# Symbols that must always be exported.
++include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
++
++ifelse([$1],[],
++[# ### END LIBTOOL CONFIG],
++[# ### END LIBTOOL TAG CONFIG: $tagname])
++
++__EOF__
++
++ifelse([$1],[], [
++ case $host_os in
++ aix3*)
++ cat <<\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
++EOF
++ ;;
++ esac
++
++ # 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)
++
++ mv -f "$cfgfile" "$ofile" || \
++ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
++ chmod +x "$ofile"
++])
++else
++ # If there is no Makefile yet, we rely on a make rule to execute
++ # `config.status --recheck' to rerun these tests and create the
++ # libtool script then.
++ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
++ if test -f "$ltmain_in"; then
++ test -f Makefile && make "$ltmain"
++ fi
++fi
++])# AC_LIBTOOL_CONFIG
++
++
++# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
++# -------------------------------------------
++AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
++[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
++
++_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
++
++if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
++
++ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
++ lt_cv_prog_compiler_rtti_exceptions,
++ [-fno-rtti -fno-exceptions], [],
++ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
++fi
++])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
++
++
++# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
++# ---------------------------------
++AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
++[AC_REQUIRE([AC_CANONICAL_HOST])
++AC_REQUIRE([AC_PROG_NM])
++AC_REQUIRE([AC_OBJEXT])
++# 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]]*\)'
++
++# Transform the above into a raw symbol and a C symbol.
++symxfrm='\1 \2\3 \3'
++
++# Transform an extracted symbol line into a proper C declaration
++lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
++# Define system-specific variables.
++case $host_os in
++aix*)
++ symcode='[[BCDT]]'
++ ;;
++cygwin* | mingw* | pw32*)
++ symcode='[[ABCDGISTW]]'
++ ;;
++hpux*) # Its linker distinguishes data from code symbols
++ if test "$host_cpu" = ia64; then
++ symcode='[[ABCDEGRST]]'
++ fi
++ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++ ;;
++irix* | nonstopux*)
++ symcode='[[BCDEGRST]]'
++ ;;
++osf*)
++ symcode='[[BCDEGQRST]]'
++ ;;
++solaris* | sysv5*)
++ symcode='[[BDRT]]'
++ ;;
++sysv4)
++ symcode='[[DFNSTU]]'
++ ;;
++esac
++
++# 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
+
+-# Library versioning type.
+-version_type=$version_type
++# If we're using GNU nm, then use its standard symbol codes.
++case `$NM -V 2>&1` in
++*GNU* | *'with BFD'*)
++ symcode='[[ABCDGIRSTW]]' ;;
++esac
+
+-# Format of library name prefix.
+-libname_spec=$lt_libname_spec
++# Try without a prefix undercore, then with it.
++for ac_symprfx in "" "_"; do
+
+-# 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
++ # Write the raw and C identifiers.
++ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
+
+-# The coded name of the library, if different from the real name.
+-soname_spec=$lt_soname_spec
++ # Check to see that the pipe works correctly.
++ pipe_works=no
+
+-# Commands used to build and install an old-style archive.
+-RANLIB=$lt_RANLIB
+-old_archive_cmds=$lt_old_archive_cmds
+-old_postinstall_cmds=$lt_old_postinstall_cmds
+-old_postuninstall_cmds=$lt_old_postuninstall_cmds
++ rm -f conftest*
++ cat > conftest.$ac_ext <<EOF
++#ifdef __cplusplus
++extern "C" {
++#endif
++char nm_test_var;
++void nm_test_func(){}
++#ifdef __cplusplus
++}
++#endif
++int main(){nm_test_var='a';nm_test_func();return(0);}
++EOF
+
+-# Create an old-style archive from a shared archive.
+-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
++ 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
+
+-# Create a temporary old-style archive to link instead of a shared archive.
+-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
++ # 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 <<EOF > conftest.$ac_ext
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+-# Commands used to build and install a shared archive.
+-archive_cmds=$lt_archive_cmds
+-archive_expsym_cmds=$lt_archive_expsym_cmds
+-postinstall_cmds=$lt_postinstall_cmds
+-postuninstall_cmds=$lt_postuninstall_cmds
++EOF
++ # Now generate the symbol file.
++ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+-# Commands to strip libraries.
+-old_striplib=$lt_old_striplib
+-striplib=$lt_striplib
++ cat <<EOF >> conftest.$ac_ext
++#if defined (__STDC__) && __STDC__
++# define lt_ptr_t void *
++#else
++# define lt_ptr_t char *
++# define const
++#endif
+
+-# Method to check whether dependent libraries are shared objects.
+-deplibs_check_method=$lt_deplibs_check_method
++/* The mapping between symbol names and symbols. */
++const struct {
++ const char *name;
++ lt_ptr_t address;
++}
++lt_preloaded_symbols[[]] =
++{
++EOF
++ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
++ cat <<\EOF >> conftest.$ac_ext
++ {0, (lt_ptr_t) 0}
++};
+
+-# Command to use when deplibs_check_method == file_magic.
+-file_magic_cmd=$lt_file_magic_cmd
++#ifdef __cplusplus
++}
++#endif
++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_AC_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_save_LIBS"
++ CFLAGS="$lt_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 -f conftest* conftst*
+
+-# Flag that allows shared libraries with undefined symbols to be built.
+-allow_undefined_flag=$lt_allow_undefined_flag
++ # 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
++]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+-# Flag that forces no undefined symbols.
+-no_undefined_flag=$lt_no_undefined_flag
+
+-# Commands used to finish a libtool library installation in a directory.
+-finish_cmds=$lt_finish_cmds
++# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
++# ---------------------------------------
++AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
++[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
++_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+-# Same as above, but a single script fragment to be evaled but not shown.
+-finish_eval=$lt_finish_eval
++AC_MSG_CHECKING([for $compiler option to produce PIC])
++ ifelse([$1],[CXX],[
++ # C++ specific cases for pic, static, wl, etc.
++ if test "$GXX" = yes; then
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+-# Take the output of nm and produce a listing of raw symbols and C names.
+-global_symbol_pipe=$lt_global_symbol_pipe
++ case $host_os in
++ aix*)
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ fi
++ ;;
++ amigaos*)
++ # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
++ ;;
++ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++ # PIC is the default for these OSes.
++ ;;
++ mingw* | os2* | pw32*)
++ # 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_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
++ ;;
++ *djgpp*)
++ # DJGPP does not support shared libraries at all
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++ ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
++ fi
++ ;;
++ hpux*)
++ # 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*)
++ ;;
++ *)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++ ;;
++ esac
++ ;;
++ *)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++ ;;
++ esac
++ else
++ case $host_os in
++ aix4* | aix5*)
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ else
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
++ fi
++ ;;
++ chorus*)
++ case $cc_basename in
++ cxch68)
++ # Green Hills C++ Compiler
++ # _LT_AC_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
++ ;;
++ dgux*)
++ case $cc_basename in
++ ec++)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ ;;
++ ghcx)
++ # Green Hills C++ Compiler
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ freebsd* | kfreebsd*-gnu)
++ # FreeBSD uses GNU C++
++ ;;
++ hpux9* | hpux10* | hpux11*)
++ case $cc_basename in
++ CC)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
++ if test "$host_cpu" != ia64; then
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
++ fi
++ ;;
++ aCC)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
++ case "$host_cpu" in
++ hppa*64*|ia64*)
++ # +Z the default
++ ;;
++ *)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
++ ;;
++ esac
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ irix5* | irix6* | nonstopux*)
++ case $cc_basename in
++ CC)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++ # CC pic flag -KPIC is the default.
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ linux*)
++ case $cc_basename in
++ KCC)
++ # KAI C++ Compiler
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++ ;;
++ icpc)
++ # Intel C++
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
++ ;;
++ cxx)
++ # Compaq C++
++ # Make sure the PIC flag is empty. It appears that all Alpha
++ # Linux and Compaq Tru64 Unix objects are PIC.
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ lynxos*)
++ ;;
++ m88k*)
++ ;;
++ mvs*)
++ case $cc_basename in
++ cxx)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
++ ;;
++ osf3* | osf4* | osf5*)
++ case $cc_basename in
++ KCC)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
++ ;;
++ RCC)
++ # Rational C++ 2.4.1
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++ ;;
++ cxx)
++ # Digital/Compaq C++
++ _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ psos*)
++ ;;
++ sco*)
++ case $cc_basename in
++ CC)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ solaris*)
++ case $cc_basename in
++ CC)
++ # Sun C++ 4.2, 5.x and Centerline C++
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
++ ;;
++ gcx)
++ # Green Hills C++ Compiler
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ sunos4*)
++ case $cc_basename in
++ CC)
++ # Sun C++ 4.x
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ ;;
++ lcc)
++ # Lucid
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ tandem*)
++ case $cc_basename in
++ NCC)
++ # NonStop-UX NCC 3.20
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ ;;
++ *)
++ ;;
++ esac
++ ;;
++ unixware*)
++ ;;
++ vxworks*)
++ ;;
++ *)
++ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
++ ;;
++ esac
++ fi
++],
++[
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+-# Transform the output of nm in a proper C declaration
+-global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
++ case $host_os in
++ aix*)
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ fi
++ ;;
+
+-# Transform the output of nm in a C name address pair
+-global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
++ amigaos*)
++ # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
++ ;;
+
+-# This is the shared library runtime path variable.
+-runpath_var=$runpath_var
++ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++ # PIC is the default for these OSes.
++ ;;
+
+-# This is the shared library path variable.
+-shlibpath_var=$shlibpath_var
++ mingw* | pw32* | os2*)
++ # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
++ ;;
+
+-# Is shlibpath searched before the hard-coded library search path?
+-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
++ darwin* | rhapsody*)
++ # PIC is the default on this platform
++ # Common symbols not allowed in MH_DYLIB files
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
++ ;;
+
+-# How to hardcode a shared library path into an executable.
+-hardcode_action=$hardcode_action
++ msdosdjgpp*)
++ # Just because we use GCC doesn't mean we suddenly get shared libraries
++ # on systems that don't support them.
++ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
++ enable_shared=no
++ ;;
+
+-# Whether we should hardcode library paths into libraries.
+-hardcode_into_libs=$hardcode_into_libs
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
++ fi
++ ;;
+
+-# 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
++ hpux*)
++ # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++ ;;
++ esac
++ ;;
+
+-# Whether we need a single -rpath flag with a separated argument.
+-hardcode_libdir_separator=$lt_hardcode_libdir_separator
++ *)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
++ ;;
++ esac
++ else
++ # PORTME Check for flag to pass linker flags through the system compiler.
++ case $host_os in
++ aix*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ else
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
++ fi
++ ;;
+
+-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+-# resulting binary.
+-hardcode_direct=$hardcode_direct
++ mingw* | pw32* | os2*)
++ # 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_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
++ ;;
+
+-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+-# resulting binary.
+-hardcode_minus_L=$hardcode_minus_L
++ hpux9* | hpux10* | hpux11*)
++ _LT_AC_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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
++ ;;
++ esac
++ # Is there a better lt_prog_compiler_static that works with the bundled CC?
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
++ ;;
+
+-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+-# the resulting binary.
+-hardcode_shlibpath_var=$hardcode_shlibpath_var
++ irix5* | irix6* | nonstopux*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ # PIC (with -KPIC) is the default.
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++ ;;
+
+-# Variables whose values should be saved in libtool wrapper scripts and
+-# restored at relink time.
+-variables_saved_for_relink="$variables_saved_for_relink"
++ newsos6)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ ;;
+
+-# Whether libtool must link a program against all its dependency libraries.
+-link_all_deplibs=$link_all_deplibs
++ linux*)
++ case $CC in
++ icc* | ecc*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
++ ;;
++ ccc*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ # All Alpha code is PIC.
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++ ;;
++ esac
++ ;;
+
+-# Compile-time system search path for libraries
+-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
++ osf3* | osf4* | osf5*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ # All OSF/1 code is PIC.
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
++ ;;
+
+-# Run-time system search path for libraries
+-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
++ sco3.2v5*)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
++ ;;
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path="$fix_srcfile_path"
++ solaris*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ ;;
+
+-# Set to yes if exported symbols are required.
+-always_export_symbols=$always_export_symbols
++ sunos4*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ ;;
+
+-# The commands to list exported symbols.
+-export_symbols_cmds=$lt_export_symbols_cmds
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ ;;
+
+-# The commands to extract the exported symbol list from a shared archive.
+-extract_expsyms_cmds=$lt_extract_expsyms_cmds
++ sysv4*MP*)
++ if test -d /usr/nec ;then
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ fi
++ ;;
+
+-# Symbols that should not be listed in the preloaded symbols.
+-exclude_expsyms=$lt_exclude_expsyms
++ uts4*)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
++ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ ;;
+
+-# Symbols that must always be exported.
+-include_expsyms=$lt_include_expsyms
++ *)
++ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
++ ;;
++ esac
++ fi
++])
++AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+-# ### END LIBTOOL CONFIG
++#
++# Check to make sure the PIC flag actually works.
++#
++if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
++ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
++ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
++ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
++ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
++ "" | " "*) ;;
++ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
++ esac],
++ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
++fi
++case "$host_os" in
++ # For platforms which do not support PIC, -DPIC is meaningless:
++ *djgpp*)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
++ ;;
++ *)
++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
++ ;;
++esac
++])
+
+-__EOF__
+
++# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
++# ------------------------------------
++# See if the linker supports building shared libraries.
++AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
++[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
++ifelse([$1],[CXX],[
++ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+- aix3*)
+- cat <<\EOF >> "${ofile}T"
+-
+-# 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
+-EOF
++ aix4* | aix5*)
++ # 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
++ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
++ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
++ else
++ _LT_AC_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_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
++ ;;
++ cygwin* | mingw*)
++ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
++ ;;
++ linux*)
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=no
++ ;;
++ *)
++ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++ ;;
+ esac
++],[
++ runpath_var=
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
++ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
++ _LT_AC_TAGVAR(archive_cmds, $1)=
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
++ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
++ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
++ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
++ _LT_AC_TAGVAR(module_cmds, $1)=
++ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
++ _LT_AC_TAGVAR(always_export_symbols, $1)=no
++ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++ # include_expsyms should be a list of space-separated symbols to be *always*
++ # included in the symbol list
++ _LT_AC_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_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
++ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
++ # platforms (ab)use it in PIC code, but their linkers get confused if
++ # the symbol is explicitly referenced. Since portable code cannot
++ # rely on this symbol name, it's probably fine to never include it in
++ # preloaded symbol tables.
++ extract_expsyms_cmds=
+
+ case $host_os in
+- cygwin* | mingw* | pw32* | os2*)
+- cat <<'EOF' >> "${ofile}T"
+- # This is a source program that is used to create dlls on Windows
+- # Don't remove nor modify the starting and closing comments
+-# /* ltdll.c starts here */
+-# #define WIN32_LEAN_AND_MEAN
+-# #include <windows.h>
+-# #undef WIN32_LEAN_AND_MEAN
+-# #include <stdio.h>
+-#
+-# #ifndef __CYGWIN__
+-# # ifdef __CYGWIN32__
+-# # define __CYGWIN__ __CYGWIN32__
+-# # endif
+-# #endif
+-#
+-# #ifdef __cplusplus
+-# extern "C" {
+-# #endif
+-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+-# #ifdef __cplusplus
+-# }
+-# #endif
+-#
+-# #ifdef __CYGWIN__
+-# #include <cygwin/cygwin_dll.h>
+-# DECLARE_CYGWIN_DLL( DllMain );
+-# #endif
+-# HINSTANCE __hDllInstance_base;
+-#
+-# BOOL APIENTRY
+-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+-# {
+-# __hDllInstance_base = hInst;
+-# return TRUE;
+-# }
+-# /* ltdll.c ends here */
+- # This is a source program that is used to create import libraries
+- # on Windows for dlls which lack them. Don't remove nor modify the
+- # starting and closing comments
+-# /* impgen.c starts here */
+-# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
+-#
+-# This file is part of GNU libtool.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
+-# (at your option) any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-# */
+-#
+-# #include <stdio.h> /* for printf() */
+-# #include <unistd.h> /* for open(), lseek(), read() */
+-# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
+-# #include <string.h> /* for strdup() */
+-#
+-# /* O_BINARY isn't required (or even defined sometimes) under Unix */
+-# #ifndef O_BINARY
+-# #define O_BINARY 0
+-# #endif
+-#
+-# static unsigned int
+-# pe_get16 (fd, offset)
+-# int fd;
+-# int offset;
+-# {
+-# unsigned char b[2];
+-# lseek (fd, offset, SEEK_SET);
+-# read (fd, b, 2);
+-# return b[0] + (b[1]<<8);
+-# }
+-#
+-# static unsigned int
+-# pe_get32 (fd, offset)
+-# int fd;
+-# int offset;
+-# {
+-# unsigned char b[4];
+-# lseek (fd, offset, SEEK_SET);
+-# read (fd, b, 4);
+-# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+-# }
+-#
+-# static unsigned int
+-# pe_as32 (ptr)
+-# void *ptr;
+-# {
+-# unsigned char *b = ptr;
+-# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+-# }
+-#
+-# int
+-# main (argc, argv)
+-# int argc;
+-# char *argv[];
+-# {
+-# int dll;
+-# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
+-# unsigned long export_rva, export_size, nsections, secptr, expptr;
+-# unsigned long name_rvas, nexp;
+-# unsigned char *expdata, *erva;
+-# char *filename, *dll_name;
+-#
+-# filename = argv[1];
+-#
+-# dll = open(filename, O_RDONLY|O_BINARY);
+-# if (dll < 1)
+-# return 1;
+-#
+-# dll_name = filename;
+-#
+-# for (i=0; filename[i]; i++)
+-# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
+-# dll_name = filename + i +1;
+-#
+-# pe_header_offset = pe_get32 (dll, 0x3c);
+-# opthdr_ofs = pe_header_offset + 4 + 20;
+-# num_entries = pe_get32 (dll, opthdr_ofs + 92);
+-#
+-# if (num_entries < 1) /* no exports */
+-# return 1;
+-#
+-# export_rva = pe_get32 (dll, opthdr_ofs + 96);
+-# export_size = pe_get32 (dll, opthdr_ofs + 100);
+-# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
+-# secptr = (pe_header_offset + 4 + 20 +
+-# pe_get16 (dll, pe_header_offset + 4 + 16));
+-#
+-# expptr = 0;
+-# for (i = 0; i < nsections; i++)
+-# {
+-# char sname[8];
+-# unsigned long secptr1 = secptr + 40 * i;
+-# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+-# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
+-# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
+-# lseek(dll, secptr1, SEEK_SET);
+-# read(dll, sname, 8);
+-# if (vaddr <= export_rva && vaddr+vsize > export_rva)
+-# {
+-# expptr = fptr + (export_rva - vaddr);
+-# if (export_rva + export_size > vaddr + vsize)
+-# export_size = vsize - (export_rva - vaddr);
+-# break;
+-# }
+-# }
+-#
+-# expdata = (unsigned char*)malloc(export_size);
+-# lseek (dll, expptr, SEEK_SET);
+-# read (dll, expdata, export_size);
+-# erva = expdata - export_rva;
+-#
+-# nexp = pe_as32 (expdata+24);
+-# name_rvas = pe_as32 (expdata+32);
+-#
+-# printf ("EXPORTS\n");
+-# for (i = 0; i<nexp; i++)
+-# {
+-# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+-# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
+-# }
+-#
+-# return 0;
+-# }
+-# /* impgen.c ends here */
+-
+-EOF
++ cygwin* | mingw* | pw32*)
++ # 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
++ ;;
++ openbsd*)
++ with_gnu_ld=no
+ ;;
+ esac
+
+- # 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" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
++ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
++ if test "$with_gnu_ld" = yes; then
++ # If archive_cmds runs LD, not CC, wlarc should be empty
++ wlarc='${wl}'
+
+- mv -f "${ofile}T" "$ofile" || \
+- (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
+- chmod +x "$ofile"
+-fi
++ # See if GNU ld supports shared libraries.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ # On AIX/PPC, the GNU linker is very broken
++ if test "$host_cpu" != ia64; then
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ cat <<EOF 1>&2
+
+-])# _LT_AC_LTCONFIG_HACK
++*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
++*** so that a non-GNU linker is found, and then restart.
+
+-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+-AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
++EOF
++ fi
++ ;;
+
+-# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+-AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
++ amigaos*)
++ _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++
++ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++ # that the semantics of dynamic libraries on AmigaOS, at least up
++ # to version 4, is to share data among multiple programs linked
++ # with the same dynamic library. Since this doesn't match the
++ # behavior of shared libraries on other platforms, we can't use
++ # them.
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
+
+-# AC_ENABLE_SHARED - implement the --enable-shared flag
+-# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN([AC_ENABLE_SHARED],
+-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(shared,
+-changequote(<<, >>)dnl
+-<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+-changequote([, ])dnl
+-[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.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_shared=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+-])
++ beos*)
++ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
++ # support --undefined. This deserves some investigation. FIXME
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ else
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
+
+-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+-AC_DEFUN([AC_DISABLE_SHARED],
+-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_SHARED(no)])
++ cygwin* | mingw* | pw32*)
++ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++ # as there is no search path for DLLs.
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++ _LT_AC_TAGVAR(always_export_symbols, $1)=no
++ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
++
++ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is; otherwise, prepend...
++ _LT_AC_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}--image-base=0x10000000 ${wl}--out-implib,$lib'
++ else
++ ld_shlibs=no
++ fi
++ ;;
+
+-# AC_ENABLE_STATIC - implement the --enable-static flag
+-# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN([AC_ENABLE_STATIC],
+-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(static,
+-changequote(<<, >>)dnl
+-<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+-changequote([, ])dnl
+-[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.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_static=yes
+- fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+-])
++ netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
++ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
++ wlarc=
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ fi
++ ;;
+
+-# AC_DISABLE_STATIC - set the default static flag to --disable-static
+-AC_DEFUN([AC_DISABLE_STATIC],
+-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_STATIC(no)])
++ solaris* | sysv5*)
++ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ cat <<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.
+
++EOF
++ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
+
+-# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+-# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+-# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+-# `yes'.
+-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+-AC_ARG_ENABLE(fast-install,
+-changequote(<<, >>)dnl
+-<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+-changequote([, ])dnl
+-[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.
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+- for pkg in $enableval; do
+- if test "X$pkg" = "X$p"; then
+- enable_fast_install=yes
++ sunos4*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
++ wlarc=
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
++
++ linux*)
++ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++ tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_AC_TAGVAR(archive_cmds, $1)="$tmp_archive_cmds"
++ supports_anon_versioning=no
++ case `$LD -v 2>/dev/null` in
++ *\ [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
++ if test $supports_anon_versioning = yes; then
++ _LT_AC_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 -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
++ else
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="$tmp_archive_cmds"
++ fi
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=no
++ else
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+- done
+- IFS="$ac_save_ifs"
+- ;;
+-esac],
+-enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+-])
++ ;;
+
+-# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
+-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-AC_ENABLE_FAST_INSTALL(no)])
++ *)
++ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_AC_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_AC_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
++ esac
++
++ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
++ runpath_var=LD_RUN_PATH
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
++ _LT_AC_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_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ else
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
++ fi
++ fi
++ else
++ # PORTME fill in a description of your system's linker (not GNU ld)
++ case $host_os in
++ aix3*)
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
++ _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ if test "$GCC" = yes && test -z "$link_static_flag"; then
++ # Neither direct hardcoding nor static linking is supported with a
++ # broken collect2.
++ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
++ fi
++ ;;
++
++ aix4* | aix5*)
++ 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
++ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
++ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
++ else
++ _LT_AC_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
+
+-# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+-# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+-# Where MODE is either `yes' or `no'. If omitted, it defaults to
+-# `both'.
+-AC_DEFUN([AC_LIBTOOL_PICMODE],
+-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+-pic_mode=ifelse($#,1,$1,default)])
++ # 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]].*|aix5*)
++ 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
+
+-# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+-AC_DEFUN([AC_PATH_TOOL_PREFIX],
+-[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_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+- ;;
+- *)
+- ac_save_MAGIC_CMD="$MAGIC_CMD"
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+-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="ifelse([$2], , $PATH, [$2])"
+- for ac_dir in $ac_dummy; do
+- 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
+- :
++ # 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_AC_TAGVAR(archive_cmds, $1)=''
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++
++ 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
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+- cat <<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
+-
+-EOF
+- fi ;;
++ # We have old collect2
++ _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
++ fi
+ esac
++ shared_flag='-shared'
++ 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
+- break
+- fi
+- done
+- IFS="$ac_save_ifs"
+- MAGIC_CMD="$ac_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
+-])
+
++ # It seems that -bexpall does not export symbols beginning with
++ # underscore (_), so it is better to generate a list of symbols to export.
++ _LT_AC_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_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
++ # Determine the default libpath from the value encoded in an empty executable.
++ _LT_AC_SYS_LIBPATH_AIX
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
++ else
++ if test "$host_cpu" = ia64; then
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ else
++ # Determine the default libpath from the value encoded in an empty executable.
++ _LT_AC_SYS_LIBPATH_AIX
++ _LT_AC_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_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
++ # -bexpall does not export symbols beginning with underscore (_)
++ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
++ # Exported symbols can be pulled into shared objects from archives
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++ # This is similar to how AIX traditionally builds it's shared libraries.
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
++ fi
++ fi
++ ;;
+
+-# AC_PATH_MAGIC - find a file program which can recognise a shared library
+-AC_DEFUN([AC_PATH_MAGIC],
+-[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+-AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
+-if test -z "$lt_cv_path_MAGIC_CMD"; then
+- if test -n "$ac_tool_prefix"; then
+- AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+- else
+- MAGIC_CMD=:
+- fi
+-fi
+-])
++ amigaos*)
++ _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ # see comment about different semantics on the GNU ld section
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
+
++ bsdi4*)
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
++ ;;
+
+-# AC_PROG_LD - find the path to the GNU or non-GNU linker
+-AC_DEFUN([AC_PROG_LD],
+-[AC_ARG_WITH(gnu-ld,
+-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+-AC_REQUIRE([AC_PROG_CC])dnl
+-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+-AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])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 GCC])
+- 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.
+- [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
+- re_direlt='/[[^/]][[^/]]*/\.\./'
+- # Canonicalize the path 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"
++ cygwin* | mingw* | pw32*)
++ # 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.
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++ _LT_AC_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_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
++ # FIXME: Should let the user specify the lib program.
++ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
++ fix_srcfile_path='`cygpath -w "$srcfile"`'
++ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+- "")
+- # 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
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+- for ac_dir in $PATH; do
+- 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 GNU ld's only accept -v.
+- # Break only if it was the GNU/non-GNU ld that we prefer.
+- if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+- test "$with_gnu_ld" != no && break
++
++ darwin* | rhapsody*)
++ if test "$GXX" = yes ; then
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++ case "$host_os" in
++ rhapsody* | darwin1.[[012]])
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ else
+- test "$with_gnu_ld" != yes && break
++ case ${MACOSX_DEPLOYMENT_TARGET} in
++ 10.[[012]])
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
++ ;;
++ 10.*)
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
++ ;;
++ esac
+ fi
++ ;;
++ esac
++ lt_int_apple_cc_single_mod=no
++ output_verbose_link_cmd='echo'
++ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
++ lt_int_apple_cc_single_mod=yes
++ fi
++ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'
++ fi
++ _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
++ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
++ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++ else
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++ fi
++ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++ else
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+- done
+- IFS="$ac_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])
+-AC_PROG_LD_GNU
+-])
++ ;;
+
+-# AC_PROG_LD_GNU -
+-AC_DEFUN([AC_PROG_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 ld's only accept -v.
+-if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+- lt_cv_prog_gnu_ld=yes
+-else
+- lt_cv_prog_gnu_ld=no
+-fi])
+-with_gnu_ld=$lt_cv_prog_gnu_ld
+-])
++ dgux*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
+
+-# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+-# -- PORTME Some linkers may need a different reload flag.
+-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+-[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
+-test -n "$reload_flag" && reload_flag=" $reload_flag"
+-])
++ freebsd1*)
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
+
+-# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+-# -- PORTME fill in with the dynamic library characteristics
+-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+-[AC_CACHE_CHECK([how to recognise 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 egrep 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.
++ # 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_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
+
+-case $host_os in
+-aix4* | aix5*)
+- lt_cv_deplibs_check_method=pass_all
+- ;;
++ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
++ freebsd2*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
+
+-beos*)
+- lt_cv_deplibs_check_method=pass_all
+- ;;
++ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
++ freebsd* | kfreebsd*-gnu)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
+
+-bsdi4*)
+- 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
+- ;;
++ hpux9*)
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$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
++ _LT_AC_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_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++
++ # hardcode_minus_L: Not really in the search PATH,
++ # but as the default location of the library.
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++ ;;
+
+-cygwin* | mingw* | pw32*)
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+- lt_cv_file_magic_cmd='$OBJDUMP -f'
+- ;;
++ hpux10* | hpux11*)
++ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
++ case "$host_cpu" in
++ hppa*64*|ia64*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ ;;
++ *)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$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*|ia64*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
++ ;;
++ *)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
++ ;;
++ esac
++ fi
++ if test "$with_gnu_ld" = no; then
++ case "$host_cpu" in
++ hppa*64*)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
++ ia64*)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++
++ # hardcode_minus_L: Not really in the search PATH,
++ # but as the default location of the library.
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ ;;
++ *)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_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_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ ;;
++ esac
++ fi
++ ;;
+
+-darwin* | rhapsody*)
+- lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+- lt_cv_file_magic_cmd='/usr/bin/file -L'
+- case "$host_os" in
+- rhapsody* | darwin1.[[012]])
+- lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+- ;;
+- *) # Darwin 1.3 on
+- lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+- ;;
+- esac
+- ;;
++ irix5* | irix6* | nonstopux*)
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
++ fi
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++ ;;
+
+-freebsd*)
+- 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)/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.*`
++ netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
++ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
++ fi
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
++
++ newsos6)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
++
++ openbsd*)
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
++ else
++ case $host_os in
++ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++ ;;
++ *)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
++ ;;
++ esac
++ fi
++ ;;
++
++ os2*)
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
++ _LT_AC_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_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
++ ;;
++
++ osf3*)
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ else
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ fi
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+- esac
+- else
+- lt_cv_deplibs_check_method=pass_all
+- fi
+- ;;
+
+-gnu*)
+- lt_cv_deplibs_check_method=pass_all
+- ;;
++ osf4* | osf5*) # as osf3* with the addition of -msym flag
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
++ else
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ _LT_AC_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~
++ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
+
+-hpux10.20*|hpux11*)
+- 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_cmd=/usr/bin/file
+- lt_cv_file_magic_test_file=/usr/lib/libc.sl
+- ;;
++ # Both c and cxx compiler support -rpath directly
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
++ fi
++ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
++ ;;
+
+-irix5* | irix6* | nonstopux*)
+- case $host_os in
+- irix5* | nonstopux*)
+- # this will be overridden with pass_all, but let us keep it just in case
+- lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+- ;;
+- *)
+- case $LD in
+- *-32|*"-32 ") libmagic=32-bit;;
+- *-n32|*"-n32 ") libmagic=N32;;
+- *-64|*"-64 ") libmagic=64-bit;;
+- *) libmagic=never-match;;
+- esac
+- # this will be overridden with pass_all, but let us keep it just in case
+- lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
+- ;;
+- esac
+- lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+- lt_cv_deplibs_check_method=pass_all
+- ;;
++ sco3.2v5*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
++ runpath_var=LD_RUN_PATH
++ hardcode_runpath_var=yes
++ ;;
+
+-# This must be Linux ELF.
+-linux-gnu*)
+- case $host_cpu in
+- alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | arm* | m68k)
+- lt_cv_deplibs_check_method=pass_all ;;
+- *)
+- # glibc up to 2.1.1 does not perform some relocations on ARM
+- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
+- esac
+- lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+- ;;
++ solaris*)
++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
++ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_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'
++ fi
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ case $host_os in
++ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
++ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
++ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
++ esac
++ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
++ ;;
+
+-netbsd*)
+- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+- lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
+- else
+- lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
+- fi
+- ;;
++ 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_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
++ fi
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
+
+-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
+- ;;
++ sysv4)
++ case $host_vendor in
++ sni)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
++ ;;
++ siemens)
++ ## LD is ld it makes a PLAMLIB
++ ## CC just makes a GrossModule.
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no
++ ;;
++ motorola)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
++ ;;
++ esac
++ runpath_var='LD_RUN_PATH'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
+
+-openbsd*)
+- lt_cv_file_magic_cmd=/usr/bin/file
+- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+- else
+- lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+- fi
+- ;;
++ sysv4.3*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
++ ;;
+
+-osf3* | osf4* | osf5*)
+- # this will be overridden with pass_all, but let us keep it just in case
+- lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+- lt_cv_file_magic_test_file=/shlib/libc.so
+- lt_cv_deplibs_check_method=pass_all
+- ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ runpath_var=LD_RUN_PATH
++ hardcode_runpath_var=yes
++ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
++ fi
++ ;;
+
+-sco3.2v5*)
+- lt_cv_deplibs_check_method=pass_all
+- ;;
++ sysv4.2uw2*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
++ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ hardcode_runpath_var=yes
++ runpath_var=LD_RUN_PATH
++ ;;
+
+-solaris*)
+- lt_cv_deplibs_check_method=pass_all
+- lt_cv_file_magic_test_file=/lib/libc.so
+- ;;
++ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
++ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
++ if test "$GCC" = yes; then
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ else
++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ fi
++ runpath_var='LD_RUN_PATH'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
+
+-sysv5uw[[78]]* | sysv4*uw2*)
+- lt_cv_deplibs_check_method=pass_all
+- ;;
++ sysv5*)
++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_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'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ runpath_var='LD_RUN_PATH'
++ ;;
+
+-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+- 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
+- ;;
+- esac
+- ;;
+-esac
+-])
+-file_magic_cmd=$lt_cv_file_magic_cmd
+-deplibs_check_method=$lt_cv_deplibs_check_method
++ uts4*)
++ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
++ ;;
++
++ *)
++ _LT_AC_TAGVAR(ld_shlibs, $1)=no
++ ;;
++ esac
++ fi
+ ])
++AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
++test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = 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
+
+-# AC_PROG_NM - find the path to a BSD-compatible name lister
+-AC_DEFUN([AC_PROG_NM],
+-[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
+-AC_MSG_CHECKING([for BSD-compatible nm])
+-AC_CACHE_VAL(lt_cv_path_NM,
+-[if test -n "$NM"; then
+- # Let the user override the test.
+- lt_cv_path_NM="$NM"
+-else
+- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+- test -z "$ac_dir" && ac_dir=.
+- tmp_nm=$ac_dir/${ac_tool_prefix}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
+- if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+- lt_cv_path_NM="$tmp_nm -B"
+- break
+- elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+- lt_cv_path_NM="$tmp_nm -p"
+- break
++#
++# Do we need to explicitly link libc?
++#
++case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
++x|xyes)
++ # Assume -lc should be added
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++
++ if test "$enable_shared" = yes && test "$GCC" = yes; then
++ case $_LT_AC_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_MSG_CHECKING([whether -lc should be explicitly linked in])
++ $rm conftest*
++ printf "$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_AC_TAGVAR(lt_prog_compiler_wl, $1)
++ compiler_flags=-v
++ linker_flags=-v
++ verstring=
++ output_objdir=.
++ libname=conftest
++ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
++ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
++ then
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
++ else
++ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
++ fi
++ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+- 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
++ cat conftest.err 1>&5
+ fi
+- fi
+- done
+- IFS="$ac_save_ifs"
+- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+-fi])
+-NM="$lt_cv_path_NM"
+-AC_MSG_RESULT([$NM])
+-])
+-
+-# AC_CHECK_LIBM - check for math library
+-AC_DEFUN([AC_CHECK_LIBM],
+-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+-LIBM=
+-case $host in
+-*-*-beos* | *-*-cygwin* | *-*-pw32*)
+- # These system don't have libm
+- ;;
+-*-ncr-sysv4.3*)
+- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+- ;;
+-*)
+- AC_CHECK_LIB(m, main, LIBM="-lm")
++ $rm conftest*
++ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
++ ;;
++ esac
++ fi
+ ;;
+ esac
+-])
++])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl convenience library and LTDLINCL to the include flags for
+-# the libltdl header and adds --enable-ltdl-convenience to the
+-# configure arguments. Note that LIBLTDL and LTDLINCL are not
+-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
+-# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
+-# with '${top_builddir}/' and LTDLINCL will be prefixed with
+-# '${top_srcdir}/' (note the single quotes!). If your package is not
+-# flat and you're not using automake, define top_builddir and
+-# top_srcdir appropriately in the Makefiles.
+-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+- case $enable_ltdl_convenience in
+- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+- "") enable_ltdl_convenience=yes
+- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+- esac
+- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+- # For backwards non-gettext consistent compatibility...
+- INCLTDL="$LTDLINCL"
+-])
+
+-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+-# the libltdl installable library and LTDLINCL to the include flags for
+-# the libltdl header and adds --enable-ltdl-install to the configure
+-# arguments. Note that LIBLTDL and LTDLINCL are not AC_SUBSTed, nor is
+-# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
+-# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
+-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed
+-# with '${top_srcdir}/' (note the single quotes!). If your package is
+-# not flat and you're not using automake, define top_builddir and
+-# top_srcdir appropriately in the Makefiles.
+-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+- AC_CHECK_LIB(ltdl, main,
+- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+- [if test x"$enable_ltdl_install" = xno; then
+- AC_MSG_WARN([libltdl not installed, but installation disabled])
+- else
+- enable_ltdl_install=yes
+- fi
+- ])
+- if test x"$enable_ltdl_install" = x"yes"; then
+- ac_configure_args="$ac_configure_args --enable-ltdl-install"
+- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+- else
+- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+- LIBLTDL="-lltdl"
+- LTDLINCL=
+- fi
+- # For backwards non-gettext consistent compatibility...
+- INCLTDL="$LTDLINCL"
+-])
++# _LT_AC_FILE_LTDLL_C
++# -------------------
++# Be careful that the start marker always follows a newline.
++AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
++# /* ltdll.c starts here */
++# #define WIN32_LEAN_AND_MEAN
++# #include <windows.h>
++# #undef WIN32_LEAN_AND_MEAN
++# #include <stdio.h>
++#
++# #ifndef __CYGWIN__
++# # ifdef __CYGWIN32__
++# # define __CYGWIN__ __CYGWIN32__
++# # endif
++# #endif
++#
++# #ifdef __cplusplus
++# extern "C" {
++# #endif
++# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
++# #ifdef __cplusplus
++# }
++# #endif
++#
++# #ifdef __CYGWIN__
++# #include <cygwin/cygwin_dll.h>
++# DECLARE_CYGWIN_DLL( DllMain );
++# #endif
++# HINSTANCE __hDllInstance_base;
++#
++# BOOL APIENTRY
++# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
++# {
++# __hDllInstance_base = hInst;
++# return TRUE;
++# }
++# /* ltdll.c ends here */
++])# _LT_AC_FILE_LTDLL_C
++
++
++# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
++# ---------------------------------
++AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
++
+
+ # old names
+ AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+@@ -3709,6 +6828,16 @@
+ # This is just to silence aclocal about the macro not being used
+ ifelse([AC_DISABLE_FAST_INSTALL])
+
++AC_DEFUN([LT_AC_PROG_GCJ],
++[AC_CHECK_TOOL(GCJ, gcj, no)
++ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
++ AC_SUBST(GCJFLAGS)
++])
++
++AC_DEFUN([LT_AC_PROG_RC],
++[AC_CHECK_TOOL(RC, windres, no)
++])
++
+ # 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 #
+@@ -3722,79 +6851,51 @@
+ 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_executable_p="test -f"
+ 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 lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+- _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ 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
+-
+- # Create a temporary directory, and hook for its removal unless debugging.
+-$debug ||
+-{
+- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+- trap '{ (exit 1); exit 1; }' 1 2 13 15
+-}
+-
+-# Create a (secure) tmp directory for tmp files.
+-: ${TMPDIR=/tmp}
+-{
+- tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
+- test -n "$tmp" && test -d "$tmp"
+-} ||
+-{
+- tmp=$TMPDIR/sed$$-$RANDOM
+- (umask 077 && mkdir $tmp)
+-} ||
+-{
+- echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+- { (exit 1); exit 1; }
+-}
+- _max=0
+- _count=0
+- # Add /usr/xpg4/bin/sed as it is typically found on Solaris
+- # along with /bin/sed that truncates output.
+- for _sed in $_sed_list /usr/xpg4/bin/sed; do
+- test ! -f ${_sed} && break
+- cat /dev/null > "$tmp/sed.in"
+- _count=0
+- echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
+- # Check for GNU sed and select it if it is found.
+- if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
+- lt_cv_path_SED=${_sed}
+- break
++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 && break
++ 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
+- while true; do
+- cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
+- mv "$tmp/sed.tmp" "$tmp/sed.in"
+- cp "$tmp/sed.in" "$tmp/sed.nl"
+- echo >>"$tmp/sed.nl"
+- ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
+- cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
+- # 40000 chars as input seems more than enough
+- test $_count -gt 10 && break
+- _count=`expr $_count + 1`
+- if test $_count -gt $_max; then
+- _max=$_count
+- lt_cv_path_SED=$_sed
+- fi
+- done
+ done
+- rm -rf "$tmp"
++done
++SED=$lt_cv_path_SED
+ ])
+-if test "X$SED" != "X"; then
+- lt_cv_path_SED=$SED
+-else
+- SED=$lt_cv_path_SED
+-fi
+ AC_MSG_RESULT([$SED])
+ ])
+
+diff -urN linux-atm.old/autom4te.cache/output.0 linux-atm.dev/autom4te.cache/output.0
+--- linux-atm.old/autom4te.cache/output.0 1970-01-01 01:00:00.000000000 +0100
++++ linux-atm.dev/autom4te.cache/output.0 2005-08-23 01:12:40.958209832 +0200
+@@ -0,0 +1,10118 @@
++@%:@! /bin/sh
++@%:@ Guess values for system-dependent variables and create Makefiles.
++@%:@ Generated by GNU Autoconf 2.59.
++@%:@
++@%:@ Copyright (C) 2003 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 Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++DUALCASE=1; export DUALCASE # for MKS sh
++
++# Support unset when possible.
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; 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
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# 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
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ 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
++
++ ;;
++ 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
++ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
++done
++;;
++ esac
++
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
++ { (exit 1); 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 sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
++
++
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
++
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
++ else
++ as_ln_s='ln -s'
++ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ test -d ./-p && rmdir ./-p
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# 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'"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++
++# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++
++
++# Check that we are running under the correct shell.
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++case X$ECHO in
++X*--fallback-echo)
++ # Remove one level of quotation (which was required for Make).
++ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
++ ;;
++esac
++
++echo=${ECHO-echo}
++if test "X$1" = X--no-reexec; then
++ # Discard the --no-reexec flag, and continue.
++ shift
++elif test "X$1" = X--fallback-echo; then
++ # Avoid inline document here, it may be left over
++ :
++elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
++ # Yippee, $echo works!
++ :
++else
++ # Restart under the correct shell.
++ exec $SHELL "$0" --no-reexec ${1+"$@"}
++fi
++
++if test "X$1" = X--fallback-echo; then
++ # used as fallback echo
++ shift
++ cat <<EOF
++
++EOF
++ exit 0
++fi
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++if test -z "$ECHO"; then
++if test "X${echo_test_string+set}" != Xset; then
++# find a string as large as possible, as long as the shell can cope with it
++ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
++ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
++ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
++ echo_test_string="`eval $cmd`" &&
++ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
++ then
++ break
++ fi
++ done
++fi
++
++if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ :
++else
++ # The Solaris, AIX, and Digital Unix default echo programs unquote
++ # backslashes. This makes it impossible to quote backslashes using
++ # echo "$something" | sed 's/\\/\\\\/g'
++ #
++ # So, first we look for a working echo in the user's PATH.
++
++ IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for dir in $PATH /usr/ucb; do
++ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
++ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$dir/echo"
++ break
++ fi
++ done
++ IFS="$save_ifs"
++
++ if test "X$echo" = Xecho; then
++ # We didn't find a better echo, so look for alternatives.
++ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # This shell has a builtin print -r that does the trick.
++ echo='print -r'
++ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
++ test "X$CONFIG_SHELL" != X/bin/ksh; then
++ # If we have ksh, try running configure again with it.
++ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
++ export ORIGINAL_CONFIG_SHELL
++ CONFIG_SHELL=/bin/ksh
++ export CONFIG_SHELL
++ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
++ else
++ # Try using printf.
++ echo='printf %s\n'
++ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
++ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ # Cool, printf works
++ :
++ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
++ export CONFIG_SHELL
++ SHELL="$CONFIG_SHELL"
++ export SHELL
++ echo="$CONFIG_SHELL $0 --fallback-echo"
++ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
++ test "X$echo_testing_string" = 'X\t' &&
++ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
++ test "X$echo_testing_string" = "X$echo_test_string"; then
++ echo="$CONFIG_SHELL $0 --fallback-echo"
++ else
++ # maybe with a smaller string...
++ prev=:
++
++ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
++ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
++ then
++ break
++ fi
++ prev="$cmd"
++ done
++
++ if test "$prev" != 'sed 50q "$0"'; then
++ echo_test_string=`eval $prev`
++ export echo_test_string
++ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
++ else
++ # Oops. We lost completely, so just stick with echo.
++ echo=echo
++ fi
++ fi
++ fi
++ fi
++fi
++fi
++
++# Copy echo and quote the copy suitably for passing to libtool from
++# the Makefile, instead of quoting the original, which is used later.
++ECHO=$echo
++if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
++ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
++fi
++
++
++
++# 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`
++
++exec 6>&1
++
++#
++# Initializations.
++#
++ac_default_prefix=/usr/local
++ac_config_libobj_dir=.
++cross_compiling=no
++subdirs=
++MFLAGS=
++MAKEFLAGS=
++SHELL=${CONFIG_SHELL-/bin/sh}
++
++# Maximum number of lines to put in a shell here document.
++# This variable seems obsolete. It should probably be removed, and
++# only ac_max_sed_lines should be used.
++: ${ac_max_here_lines=38}
++
++# Identity of this package.
++PACKAGE_NAME=
++PACKAGE_TARNAME=
++PACKAGE_VERSION=
++PACKAGE_STRING=
++PACKAGE_BUGREPORT=
++
++ac_unique_file="src/include/atm.h"
++# Factoring default headers for most tests.
++ac_includes_default="\
++#include <stdio.h>
++#if HAVE_SYS_TYPES_H
++# include <sys/types.h>
++#endif
++#if HAVE_SYS_STAT_H
++# include <sys/stat.h>
++#endif
++#if STDC_HEADERS
++# include <stdlib.h>
++# include <stddef.h>
++#else
++# if HAVE_STDLIB_H
++# include <stdlib.h>
++# endif
++#endif
++#if HAVE_STRING_H
++# if !STDC_HEADERS && HAVE_MEMORY_H
++# include <memory.h>
++# endif
++# include <string.h>
++#endif
++#if HAVE_STRINGS_H
++# include <strings.h>
++#endif
++#if HAVE_INTTYPES_H
++# include <inttypes.h>
++#else
++# if HAVE_STDINT_H
++# include <stdint.h>
++# endif
++#endif
++#if HAVE_UNISTD_H
++# include <unistd.h>
++#endif"
++
++ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE LIBVER_CURRENT LIBVER_REVISION LIBVER_AGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LEX LEXLIB LEX_OUTPUT_ROOT YACC LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP EGREP LIBTOOL LIBTOOL_DEPS PERL LIB@&t@OBJS LTLIBOBJS'
++ac_subst_files=''
++
++# Initialize some variables set by options.
++ac_init_help=
++ac_init_version=false
++# 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.
++bindir='${exec_prefix}/bin'
++sbindir='${exec_prefix}/sbin'
++libexecdir='${exec_prefix}/libexec'
++datadir='${prefix}/share'
++sysconfdir='${prefix}/etc'
++sharedstatedir='${prefix}/com'
++localstatedir='${prefix}/var'
++libdir='${exec_prefix}/lib'
++includedir='${prefix}/include'
++oldincludedir='/usr/include'
++infodir='${prefix}/info'
++mandir='${prefix}/man'
++
++ac_prev=
++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
++
++ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
++
++ # Accept the important Cygnus configure options, so we can diagnose typos.
++
++ case $ac_option in
++
++ -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 | --data | --dat | --da)
++ ac_prev=datadir ;;
++ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
++ | --da=*)
++ datadir=$ac_optarg ;;
++
++ -disable-* | --disable-*)
++ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ eval "enable_$ac_feature=no" ;;
++
++ -enable-* | --enable-*)
++ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
++ { (exit 1); exit 1; }; }
++ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
++ *) ac_optarg=yes ;;
++ esac
++ eval "enable_$ac_feature='$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 ;;
++
++ -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 ;;
++
++ -localstatedir | --localstatedir | --localstatedi | --localstated \
++ | --localstate | --localstat | --localsta | --localst \
++ | --locals | --local | --loca | --loc | --lo)
++ ac_prev=localstatedir ;;
++ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
++ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
++ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
++ 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 ;;
++
++ -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
++ ac_package=`echo $ac_package| sed 's/-/_/g'`
++ case $ac_option in
++ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
++ *) ac_optarg=yes ;;
++ esac
++ eval "with_$ac_package='$ac_optarg'" ;;
++
++ -without-* | --without-*)
++ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid package name: $ac_package" >&2
++ { (exit 1); exit 1; }; }
++ ac_package=`echo $ac_package | sed 's/-/_/g'`
++ eval "with_$ac_package=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 ;;
++
++ -*) { echo "$as_me: error: unrecognized option: $ac_option
++Try \`$0 --help' for more information." >&2
++ { (exit 1); exit 1; }; }
++ ;;
++
++ *=*)
++ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
++ # Reject names that are not valid shell variable names.
++ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
++ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
++ { (exit 1); exit 1; }; }
++ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
++ eval "$ac_envvar='$ac_optarg'"
++ export $ac_envvar ;;
++
++ *)
++ # FIXME: should be removed in autoconf 3.0.
++ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
++ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
++ 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'`
++ { echo "$as_me: error: missing argument to $ac_option" >&2
++ { (exit 1); exit 1; }; }
++fi
++
++# Be sure to have absolute paths.
++for ac_var in exec_prefix prefix
++do
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
++ esac
++done
++
++# Be sure to have absolute paths.
++for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
++ localstatedir libdir includedir oldincludedir infodir mandir
++do
++ eval ac_val=$`echo $ac_var`
++ case $ac_val in
++ [\\/$]* | ?:[\\/]* ) ;;
++ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
++ { (exit 1); exit 1; }; };;
++ esac
++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
++ 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
++
++
++# 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 its parent.
++ ac_confdir=`(dirname "$0") 2>/dev/null ||
++$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$0" : 'X\(//\)[^/]' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$0" |
++ 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
++ if test "$ac_srcdir_defaulted" = yes; then
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
++ { (exit 1); exit 1; }; }
++ else
++ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
++ { (exit 1); exit 1; }; }
++ fi
++fi
++(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
++ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
++ { (exit 1); exit 1; }; }
++srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
++ac_env_build_alias_set=${build_alias+set}
++ac_env_build_alias_value=$build_alias
++ac_cv_env_build_alias_set=${build_alias+set}
++ac_cv_env_build_alias_value=$build_alias
++ac_env_host_alias_set=${host_alias+set}
++ac_env_host_alias_value=$host_alias
++ac_cv_env_host_alias_set=${host_alias+set}
++ac_cv_env_host_alias_value=$host_alias
++ac_env_target_alias_set=${target_alias+set}
++ac_env_target_alias_value=$target_alias
++ac_cv_env_target_alias_set=${target_alias+set}
++ac_cv_env_target_alias_value=$target_alias
++ac_env_CC_set=${CC+set}
++ac_env_CC_value=$CC
++ac_cv_env_CC_set=${CC+set}
++ac_cv_env_CC_value=$CC
++ac_env_CFLAGS_set=${CFLAGS+set}
++ac_env_CFLAGS_value=$CFLAGS
++ac_cv_env_CFLAGS_set=${CFLAGS+set}
++ac_cv_env_CFLAGS_value=$CFLAGS
++ac_env_LDFLAGS_set=${LDFLAGS+set}
++ac_env_LDFLAGS_value=$LDFLAGS
++ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
++ac_cv_env_LDFLAGS_value=$LDFLAGS
++ac_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_env_CPPFLAGS_value=$CPPFLAGS
++ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
++ac_cv_env_CPPFLAGS_value=$CPPFLAGS
++ac_env_CPP_set=${CPP+set}
++ac_env_CPP_value=$CPP
++ac_cv_env_CPP_set=${CPP+set}
++ac_cv_env_CPP_value=$CPP
++
++#
++# 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 this package 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 \`..']
++
++_ACEOF
++
++ cat <<_ACEOF
++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]
++ --datadir=DIR read-only architecture-independent data [PREFIX/share]
++ --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]
++ --infodir=DIR info documentation [PREFIX/info]
++ --mandir=DIR man documentation [PREFIX/man]
++_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
++
++ cat <<\_ACEOF
++
++Optional Features:
++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
++ --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-allow_uni30 Allow UNI 3.0 backwards-compatible extensions (if using UNI 3.1)
++ --enable-q2963_1 Enable peak cell rate modification as specified in Q.2963.1 (if using UNI 4.0)
++ --enable-cisco Enable work around for point-to-multipoint signaling bug in Cisco LS100 or LS7010 switches
++ --enable-thomflex Some versions of the Thomson Thomflex 5000 won't do any signaling before they get a RESTART. Enable sending of a RESTART whenever SAAL comes up.
++ --enable-mpoa_1_1 Enable proposed MPOA 1.1 features
++ --enable-mpr Enable memory debugging (if MPR is installed)
++
++Optional Packages:
++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
++ --with-gnu-ld assume the C compiler uses GNU ld default=no
++ --with-pic try to use only PIC/non-PIC objects default=use both
++ --with-uni=VERSION UNI version to use (3.0,3.1,4.0) default=dynamic
++
++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>
++ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
++ headers in a nonstandard directory <include dir>
++ CPP C preprocessor
++
++Use these variables to override the choices made by `configure' or to help
++it to find libraries and programs with nonstandard names/locations.
++
++_ACEOF
++fi
++
++if test "$ac_init_help" = "recursive"; then
++ # If there are subdirs, report their specific --help.
++ ac_popdir=`pwd`
++ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
++ test -d $ac_dir || continue
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++ cd $ac_dir
++ # Check for guested configure; otherwise get Cygnus style 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
++ elif test -f $ac_srcdir/configure.ac ||
++ test -f $ac_srcdir/configure.in; then
++ echo
++ $ac_configure --help
++ else
++ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
++ fi
++ cd "$ac_popdir"
++ done
++fi
++
++test -n "$ac_init_help" && exit 0
++if $ac_init_version; then
++ cat <<\_ACEOF
++
++Copyright (C) 2003 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 0
++fi
++exec 5>config.log
++cat >&5 <<_ACEOF
++This file contains any messages produced by compilers while
++running configure, to aid debugging if configure makes a mistake.
++
++It was created by $as_me, which was
++generated by GNU Autoconf 2.59. Invocation command line was
++
++ $ $0 $@
++
++_ACEOF
++{
++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`
++hostinfo = `(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=.
++ echo "PATH: $as_dir"
++done
++
++} >&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_sep=
++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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
++ esac
++ case $ac_pass in
++ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
++ 2)
++ ac_configure_args1="$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
++ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
++ # Get rid of the leading space.
++ ac_sep=" "
++ ;;
++ esac
++ done
++done
++$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
++$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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: Be sure not to use single quotes in there, as some shells,
++# such as our DU 5.0 friend, will then `close' the trap.
++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,
++{
++ (set) 2>&1 |
++ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
++ *ac_space=\ *)
++ sed -n \
++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++ ;;
++ *)
++ sed -n \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++}
++ echo
++
++ cat <<\_ASBOX
++@%:@@%:@ ----------------- @%:@@%:@
++@%:@@%:@ Output variables. @%:@@%:@
++@%:@@%:@ ----------------- @%:@@%:@
++_ASBOX
++ echo
++ for ac_var in $ac_subst_vars
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++
++ if test -n "$ac_subst_files"; then
++ cat <<\_ASBOX
++@%:@@%:@ ------------- @%:@@%:@
++@%:@@%:@ Output files. @%:@@%:@
++@%:@@%:@ ------------- @%:@@%:@
++_ASBOX
++ echo
++ for ac_var in $ac_subst_files
++ do
++ eval ac_val=$`echo $ac_var`
++ echo "$ac_var='"'"'$ac_val'"'"'"
++ done | sort
++ echo
++ fi
++
++ if test -s confdefs.h; then
++ cat <<\_ASBOX
++@%:@@%:@ ----------- @%:@@%:@
++@%:@@%:@ confdefs.h. @%:@@%:@
++@%:@@%:@ ----------- @%:@@%:@
++_ASBOX
++ echo
++ sed "/^$/d" confdefs.h | sort
++ echo
++ fi
++ test "$ac_signal" != 0 &&
++ echo "$as_me: caught signal $ac_signal"
++ echo "$as_me: exit $exit_status"
++ } >&5
++ rm -f core *.core &&
++ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
++ exit $exit_status
++ ' 0
++for ac_signal in 1 2 13 15; do
++ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
++done
++ac_signal=0
++
++# confdefs.h avoids OS command line length limits that DEFS can exceed.
++rm -rf conftest* confdefs.h
++# AIX cpp loses on an empty file, so make sure it contains at least a newline.
++echo >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
++
++
++# Let the site file select an alternate cache file if it wants to.
++# Prefer explicitly selected file to automatically selected ones.
++if test -z "$CONFIG_SITE"; then
++ if test "x$prefix" != xNONE; then
++ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++ else
++ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
++ fi
++fi
++for ac_site_file in $CONFIG_SITE; do
++ if test -r "$ac_site_file"; then
++ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
++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
++ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
++echo "$as_me: loading cache $cache_file" >&6;}
++ case $cache_file in
++ [\\/]* | ?:[\\/]* ) . $cache_file;;
++ *) . ./$cache_file;;
++ esac
++ fi
++else
++ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
++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 `(set) 2>&1 |
++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
++echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
++ ac_cache_corrupted=: ;;
++ ,set)
++ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
++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
++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
++echo "$as_me: former value: $ac_old_val" >&2;}
++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
++echo "$as_me: current value: $ac_new_val" >&2;}
++ ac_cache_corrupted=:
++ fi;;
++ esac
++ # Pass precious variables to config.status.
++ if test "$ac_new_set" = set; then
++ case $ac_new_val in
++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
++ ac_arg=$ac_var=`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.
++ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
++ esac
++ fi
++done
++if $ac_cache_corrupted; then
++ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
++echo "$as_me: error: changes in the environment can compromise the build" >&2;}
++ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
++echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
++ { (exit 1); exit 1; }; }
++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_config_headers="$ac_config_headers config.h"
++
++ ac_config_commands="$ac_config_commands default-1"
++
++
++ac_aux_dir=
++for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
++ if test -f $ac_dir/install-sh; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/install-sh -c"
++ break
++ elif test -f $ac_dir/install.sh; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/install.sh -c"
++ break
++ elif test -f $ac_dir/shtool; then
++ ac_aux_dir=$ac_dir
++ ac_install_sh="$ac_aux_dir/shtool install -c"
++ break
++ fi
++done
++if test -z "$ac_aux_dir"; then
++ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
++echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++ac_config_guess="$SHELL $ac_aux_dir/config.guess"
++ac_config_sub="$SHELL $ac_aux_dir/config.sub"
++ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
++
++# Make sure we can run config.sub.
++$ac_config_sub sun4 >/dev/null 2>&1 ||
++ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
++echo "$as_me: error: cannot run $ac_config_sub" >&2;}
++ { (exit 1); exit 1; }; }
++
++echo "$as_me:$LINENO: checking build system type" >&5
++echo $ECHO_N "checking build system type... $ECHO_C" >&6
++if test "${ac_cv_build+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_build_alias=$build_alias
++test -z "$ac_cv_build_alias" &&
++ ac_cv_build_alias=`$ac_config_guess`
++test -z "$ac_cv_build_alias" &&
++ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
++echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
++ { (exit 1); exit 1; }; }
++ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_build" >&5
++echo "${ECHO_T}$ac_cv_build" >&6
++build=$ac_cv_build
++build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++echo "$as_me:$LINENO: checking host system type" >&5
++echo $ECHO_N "checking host system type... $ECHO_C" >&6
++if test "${ac_cv_host+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_host_alias=$host_alias
++test -z "$ac_cv_host_alias" &&
++ ac_cv_host_alias=$ac_cv_build_alias
++ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_host" >&5
++echo "${ECHO_T}$ac_cv_host" >&6
++host=$ac_cv_host
++host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++echo "$as_me:$LINENO: checking target system type" >&5
++echo $ECHO_N "checking target system type... $ECHO_C" >&6
++if test "${ac_cv_target+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_target_alias=$target_alias
++test "x$ac_cv_target_alias" = "x" &&
++ ac_cv_target_alias=$ac_cv_host_alias
++ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
++ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
++echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_target" >&5
++echo "${ECHO_T}$ac_cv_target" >&6
++target=$ac_cv_target
++target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++
++# 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}-
++
++am__api_version="1.4"
++# 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.
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++if test -z "$INSTALL"; then
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
++ done
++ done
++ ;;
++esac
++done
++
++
++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. We don't cache a
++ # path for INSTALL within a source directory, because that will
++ # break other packages using the cache if that directory is
++ # removed, or if the path is relative.
++ INSTALL=$ac_install_sh
++ fi
++fi
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$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'
++
++echo "$as_me:$LINENO: checking whether build environment is sane" >&5
++echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
++# Just in case
++sleep 1
++echo timestamp > conftestfile
++# 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 conftestfile 2> /dev/null`
++ if test "$*" = "X"; then
++ # -L didn't work.
++ set X `ls -t $srcdir/configure conftestfile`
++ fi
++ if test "$*" != "X $srcdir/configure conftestfile" \
++ && test "$*" != "X conftestfile $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".
++ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&5
++echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
++alias in your environment" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++
++ test "$2" = conftestfile
++ )
++then
++ # Ok.
++ :
++else
++ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
++Check your system clock" >&5
++echo "$as_me: error: newly created file is older than distributed files!
++Check your system clock" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++rm -f conftest*
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}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 $. echo might interpret backslashes.
++# By default was `s,x,x', remove it if useless.
++cat <<\_ACEOF >conftest.sed
++s/[\\$]/&&/g;s/;s,x,x,$//
++_ACEOF
++program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
++rm conftest.sed
++
++echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
++echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
++if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.make <<\_ACEOF
++all:
++ @echo 'ac_maketemp="$(MAKE)"'
++_ACEOF
++# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
++eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
++if test -n "$ac_maketemp"; then
++ eval ac_cv_prog_make_${ac_make}_set=yes
++else
++ eval ac_cv_prog_make_${ac_make}_set=no
++fi
++rm -f conftest.make
++fi
++if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++ SET_MAKE=
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++ SET_MAKE="MAKE=${MAKE-make}"
++fi
++
++
++PACKAGE=linux-atm
++
++VERSION=2.4.1
++
++if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
++ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
++echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++cat >>confdefs.h <<_ACEOF
++@%:@define PACKAGE "$PACKAGE"
++_ACEOF
++
++
++cat >>confdefs.h <<_ACEOF
++@%:@define VERSION "$VERSION"
++_ACEOF
++
++
++
++missing_dir=`cd $ac_aux_dir && pwd`
++echo "$as_me:$LINENO: checking for working aclocal-${am__api_version}" >&5
++echo $ECHO_N "checking for working aclocal-${am__api_version}... $ECHO_C" >&6
++# Run test in a subshell; some versions of sh will print an error if
++# an executable is not found, even if stderr is redirected.
++# Redirect stdin to placate older versions of autoconf. Sigh.
++if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
++ ACLOCAL=aclocal-${am__api_version}
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
++else
++ ACLOCAL="$missing_dir/missing aclocal-${am__api_version}"
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
++fi
++
++echo "$as_me:$LINENO: checking for working autoconf" >&5
++echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6
++# Run test in a subshell; some versions of sh will print an error if
++# an executable is not found, even if stderr is redirected.
++# Redirect stdin to placate older versions of autoconf. Sigh.
++if (autoconf --version) < /dev/null > /dev/null 2>&1; then
++ AUTOCONF=autoconf
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
++else
++ AUTOCONF="$missing_dir/missing autoconf"
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
++fi
++
++echo "$as_me:$LINENO: checking for working automake-${am__api_version}" >&5
++echo $ECHO_N "checking for working automake-${am__api_version}... $ECHO_C" >&6
++# Run test in a subshell; some versions of sh will print an error if
++# an executable is not found, even if stderr is redirected.
++# Redirect stdin to placate older versions of autoconf. Sigh.
++if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then
++ AUTOMAKE=automake-${am__api_version}
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
++else
++ AUTOMAKE="$missing_dir/missing automake-${am__api_version}"
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
++fi
++
++echo "$as_me:$LINENO: checking for working autoheader" >&5
++echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6
++# Run test in a subshell; some versions of sh will print an error if
++# an executable is not found, even if stderr is redirected.
++# Redirect stdin to placate older versions of autoconf. Sigh.
++if (autoheader --version) < /dev/null > /dev/null 2>&1; then
++ AUTOHEADER=autoheader
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
++else
++ AUTOHEADER="$missing_dir/missing autoheader"
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
++fi
++
++echo "$as_me:$LINENO: checking for working makeinfo" >&5
++echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6
++# Run test in a subshell; some versions of sh will print an error if
++# an executable is not found, even if stderr is redirected.
++# Redirect stdin to placate older versions of autoconf. Sigh.
++if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
++ MAKEINFO=makeinfo
++ echo "$as_me:$LINENO: result: found" >&5
++echo "${ECHO_T}found" >&6
++else
++ MAKEINFO="$missing_dir/missing makeinfo"
++ echo "$as_me:$LINENO: result: missing" >&5
++echo "${ECHO_T}missing" >&6
++fi
++
++
++
++LIBVER_CURRENT="1"
++LIBVER_REVISION="0"
++LIBVER_AGE="0"
++
++
++
++
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="${ac_tool_prefix}gcc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="gcc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ CC=$ac_ct_CC
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="${ac_tool_prefix}cc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$ac_cv_prog_CC"; then
++ ac_ct_CC=$CC
++ # Extract the first word of "cc", so it can be a program name with args.
++set dummy cc; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="cc"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ CC=$ac_ct_CC
++else
++ CC="$ac_cv_prog_CC"
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++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
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++fi
++if test -z "$CC"; then
++ if test -n "$ac_tool_prefix"; then
++ for ac_prog in cl
++ 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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++CC=$ac_cv_prog_CC
++if test -n "$CC"; then
++ echo "$as_me:$LINENO: result: $CC" >&5
++echo "${ECHO_T}$CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$CC" && break
++ done
++fi
++if test -z "$CC"; then
++ ac_ct_CC=$CC
++ for ac_prog in cl
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_CC="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++ac_ct_CC=$ac_cv_prog_ac_ct_CC
++if test -n "$ac_ct_CC"; then
++ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
++echo "${ECHO_T}$ac_ct_CC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$ac_ct_CC" && break
++done
++
++ CC=$ac_ct_CC
++fi
++
++fi
++
++
++test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&5
++echo "$as_me: error: no acceptable C compiler found in \$PATH
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++
++# Provide some information about the compiler.
++echo "$as_me:$LINENO:" \
++ "checking for C compiler version" >&5
++ac_compiler=`set X $ac_compile; echo $2`
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
++ (eval $ac_compiler --version </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
++ (eval $ac_compiler -v </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
++ (eval $ac_compiler -V </dev/null >&5) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files a.out a.exe b.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.
++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
++ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
++if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
++ (eval $ac_link_default) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ # Find the output, starting from the most likely. This scheme is
++# not robust to junk in `.', hence go to wildcards (a.*) only as a last
++# resort.
++
++# Be careful to initialize this variable, since it used to be cached.
++# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
++ac_cv_exeext=
++# b.out is created by i960 compilers.
++for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
++do
++ test -f "$ac_file" || continue
++ case $ac_file in
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
++ ;;
++ conftest.$ac_ext )
++ # This is the source file.
++ ;;
++ [ab].out )
++ # We found the default executable, but exeext='' is most
++ # certainly right.
++ break;;
++ *.* )
++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ # FIXME: I believe we export ac_cv_exeext for Libtool,
++ # but it would be cool to find out if it's true. Does anybody
++ # maintain Libtool? --akim.
++ export ac_cv_exeext
++ break;;
++ * )
++ break;;
++ esac
++done
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
++See \`config.log' for more details." >&5
++echo "$as_me: error: C compiler cannot create executables
++See \`config.log' for more details." >&2;}
++ { (exit 77); exit 77; }; }
++fi
++
++ac_exeext=$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_file" >&5
++echo "${ECHO_T}$ac_file" >&6
++
++# Check the compiler produces executables we can run. If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether the C compiler works" >&5
++echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
++# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
++# If not cross compiling, check that we can run a simple program.
++if test "$cross_compiling" != yes; then
++ if { ac_try='./$ac_file'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ cross_compiling=no
++ else
++ if test "$cross_compiling" = maybe; then
++ cross_compiling=yes
++ else
++ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot run C compiled programs.
++If you meant to cross compile, use \`--host'.
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++ fi
++fi
++echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++
++rm -f a.out a.exe conftest$ac_cv_exeext b.out
++ac_clean_files=$ac_clean_files_save
++# Check the compiler produces executables we can run. If not, either
++# the compiler is broken, or we cross compile.
++echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
++echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
++echo "$as_me:$LINENO: result: $cross_compiling" >&5
++echo "${ECHO_T}$cross_compiling" >&6
++
++echo "$as_me:$LINENO: checking for suffix of executables" >&5
++echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; 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 | *.o | *.obj ) ;;
++ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ export ac_cv_exeext
++ break;;
++ * ) break;;
++ esac
++done
++else
++ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++rm -f conftest$ac_cv_exeext
++echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
++echo "${ECHO_T}$ac_cv_exeext" >&6
++
++rm -f conftest.$ac_ext
++EXEEXT=$ac_cv_exeext
++ac_exeext=$EXEEXT
++echo "$as_me:$LINENO: checking for suffix of object files" >&5
++echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
++if test "${ac_cv_objext+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.o conftest.obj
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
++ case $ac_file in
++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
++ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
++ break;;
++ esac
++done
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&5
++echo "$as_me: error: cannot compute suffix of object files: cannot compile
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++rm -f conftest.$ac_cv_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
++echo "${ECHO_T}$ac_cv_objext" >&6
++OBJEXT=$ac_cv_objext
++ac_objext=$OBJEXT
++echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
++echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
++if test "${ac_cv_c_compiler_gnu+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++#ifndef __GNUC__
++ choke me
++#endif
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_compiler_gnu=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_compiler_gnu=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ac_cv_c_compiler_gnu=$ac_compiler_gnu
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
++echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
++GCC=`test $ac_compiler_gnu = yes && echo yes`
++ac_test_CFLAGS=${CFLAGS+set}
++ac_save_CFLAGS=$CFLAGS
++CFLAGS="-g"
++echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
++echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_g+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_prog_cc_g=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_prog_cc_g=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
++echo "${ECHO_T}$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
++echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
++echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
++if test "${ac_cv_prog_cc_stdc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_prog_cc_stdc=no
++ac_save_CC=$CC
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 -std1 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 -std1. */
++int osf4_cc_array ['\x00' == 0 ? 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
++# Don't try gcc -ansi; that turns off useful extensions and
++# breaks some systems' header files.
++# AIX -qlanglvl=ansi
++# Ultrix and OSF/1 -std1
++# HP-UX 10.20 and later -Ae
++# HP-UX older versions -Aa -D_HPUX_SOURCE
++# SVR4 -Xc -D__EXTENSIONS__
++for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
++do
++ CC="$ac_save_CC $ac_arg"
++ rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_prog_cc_stdc=$ac_arg
++break
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext
++done
++rm -f conftest.$ac_ext conftest.$ac_objext
++CC=$ac_save_CC
++
++fi
++
++case "x$ac_cv_prog_cc_stdc" in
++ x|xno)
++ echo "$as_me:$LINENO: result: none needed" >&5
++echo "${ECHO_T}none needed" >&6 ;;
++ *)
++ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
++echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
++ CC="$CC $ac_cv_prog_cc_stdc" ;;
++esac
++
++# Some people use a C++ compiler to compile C. Since we use `exit',
++# in C++ we need to declare it. In case someone uses the same compiler
++# for both compiling C and C++ we need to have the C++ compiler decide
++# the declaration of exit, since it's the most demanding environment.
++cat >conftest.$ac_ext <<_ACEOF
++@%:@ifndef __cplusplus
++ choke me
++@%:@endif
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ for ac_declaration in \
++ '' \
++ 'extern "C" void std::exit (int) throw (); using std::exit;' \
++ 'extern "C" void std::exit (int); using std::exit;' \
++ 'extern "C" void exit (int) throw ();' \
++ 'extern "C" void exit (int);' \
++ 'void exit (int);'
++do
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_declaration
++@%:@include <stdlib.h>
++int
++main ()
++{
++exit (42);
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ :
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++continue
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_declaration
++int
++main ()
++{
++exit (42);
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ break
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++done
++rm -f conftest*
++if test -n "$ac_declaration"; then
++ echo '#ifdef __cplusplus' >>confdefs.h
++ echo $ac_declaration >>confdefs.h
++ echo '#endif' >>confdefs.h
++fi
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f 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
++
++
++missing_dir=`cd $ac_aux_dir && pwd`
++for ac_prog in flex lex
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_LEX+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$LEX"; then
++ ac_cv_prog_LEX="$LEX" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_LEX="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++LEX=$ac_cv_prog_LEX
++if test -n "$LEX"; then
++ echo "$as_me:$LINENO: result: $LEX" >&5
++echo "${ECHO_T}$LEX" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$LEX" && break
++done
++test -n "$LEX" || LEX="$missing_dir/missing flex"
++
++for ac_prog in flex lex
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_LEX+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$LEX"; then
++ ac_cv_prog_LEX="$LEX" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_LEX="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++LEX=$ac_cv_prog_LEX
++if test -n "$LEX"; then
++ echo "$as_me:$LINENO: result: $LEX" >&5
++echo "${ECHO_T}$LEX" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$LEX" && break
++done
++test -n "$LEX" || LEX=":"
++
++if test -z "$LEXLIB"
++then
++ echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
++echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
++if test "${ac_cv_lib_fl_yywrap+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lfl $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char yywrap ();
++int
++main ()
++{
++yywrap ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_fl_yywrap=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_fl_yywrap=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
++echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
++if test $ac_cv_lib_fl_yywrap = yes; then
++ LEXLIB="-lfl"
++else
++ echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
++echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
++if test "${ac_cv_lib_l_yywrap+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ll $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char yywrap ();
++int
++main ()
++{
++yywrap ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_l_yywrap=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_l_yywrap=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
++echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
++if test $ac_cv_lib_l_yywrap = yes; then
++ LEXLIB="-ll"
++fi
++
++fi
++
++fi
++
++if test "x$LEX" != "x:"; then
++ echo "$as_me:$LINENO: checking lex output file root" >&5
++echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
++if test "${ac_cv_prog_lex_root+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ # The minimal lex program is just a single line: %%. But some broken lexes
++# (Solaris, I think it was) want two %% lines, so accommodate them.
++cat >conftest.l <<_ACEOF
++%%
++%%
++_ACEOF
++{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
++ (eval $LEX conftest.l) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++if test -f lex.yy.c; then
++ ac_cv_prog_lex_root=lex.yy
++elif test -f lexyy.c; then
++ ac_cv_prog_lex_root=lexyy
++else
++ { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
++echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
++echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
++rm -f conftest.l
++LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
++
++echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
++echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
++if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ # POSIX says lex can declare yytext either as a pointer or an array; the
++# default is implementation-dependent. Figure out which it is, since
++# not all implementations provide the %pointer and %array declarations.
++ac_cv_prog_lex_yytext_pointer=no
++echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
++ac_save_LIBS=$LIBS
++LIBS="$LIBS $LEXLIB"
++cat >conftest.$ac_ext <<_ACEOF
++`cat $LEX_OUTPUT_ROOT.c`
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_prog_lex_yytext_pointer=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_save_LIBS
++rm -f "${LEX_OUTPUT_ROOT}.c"
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
++echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
++if test $ac_cv_prog_lex_yytext_pointer = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++@%:@define YYTEXT_POINTER 1
++_ACEOF
++
++fi
++
++fi
++
++for ac_prog in 'bison -y' byacc
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_YACC+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$YACC"; then
++ ac_cv_prog_YACC="$YACC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_YACC="$ac_prog"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++YACC=$ac_cv_prog_YACC
++if test -n "$YACC"; then
++ echo "$as_me:$LINENO: result: $YACC" >&5
++echo "${ECHO_T}$YACC" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ test -n "$YACC" && break
++done
++test -n "$YACC" || YACC="yacc"
++
++# 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.
++echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
++echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
++if test -z "$INSTALL"; then
++if test "${ac_cv_path_install+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
++ done
++ done
++ ;;
++esac
++done
++
++
++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. We don't cache a
++ # path for INSTALL within a source directory, because that will
++ # break other packages using the cache if that directory is
++ # removed, or if the path is relative.
++ INSTALL=$ac_install_sh
++ fi
++fi
++echo "$as_me:$LINENO: result: $INSTALL" >&5
++echo "${ECHO_T}$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'
++
++
++# Check whether --enable-shared or --disable-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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_shared=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac
++else
++ enable_shared=yes
++fi;
++# Check whether --enable-static or --disable-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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_static=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac
++else
++ enable_static=yes
++fi;
++# Check whether --enable-fast-install or --disable-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.
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++ for pkg in $enableval; do
++ if test "X$pkg" = "X$p"; then
++ enable_fast_install=yes
++ fi
++ done
++ IFS="$ac_save_ifs"
++ ;;
++esac
++else
++ enable_fast_install=yes
++fi;
++# Find the correct PATH separator. Usually this is `:', but
++# DJGPP uses `;' like DOS.
++if test "X${PATH_SEPARATOR+set}" != Xset; then
++ UNAME=${UNAME-`uname 2>/dev/null`}
++ case X$UNAME in
++ *-DOS) lt_cv_sys_path_separator=';' ;;
++ *) lt_cv_sys_path_separator=':' ;;
++ esac
++ PATH_SEPARATOR=$lt_cv_sys_path_separator
++fi
++
++
++# Check whether --with-gnu-ld or --without-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.
++ echo "$as_me:$LINENO: checking for ld used by GCC" >&5
++echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&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.
++ [\\/]* | [A-Za-z]:[\\/]*)
++ re_direlt='/[^/][^/]*/\.\./'
++ # Canonicalize the path 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
++ echo "$as_me:$LINENO: checking for GNU ld" >&5
++echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
++else
++ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
++echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
++fi
++if test "${lt_cv_path_LD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -z "$LD"; then
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in $PATH; do
++ 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 GNU ld's only accept -v.
++ # Break only if it was the GNU/non-GNU ld that we prefer.
++ if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
++ test "$with_gnu_ld" != no && break
++ else
++ test "$with_gnu_ld" != yes && break
++ fi
++ fi
++ done
++ IFS="$ac_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
++ echo "$as_me:$LINENO: result: $LD" >&5
++echo "${ECHO_T}$LD" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
++echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
++ { (exit 1); exit 1; }; }
++echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
++echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
++if test "${lt_cv_prog_gnu_ld+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
++if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
++ lt_cv_prog_gnu_ld=yes
++else
++ lt_cv_prog_gnu_ld=no
++fi
++fi
++echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
++echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
++with_gnu_ld=$lt_cv_prog_gnu_ld
++
++
++echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
++echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
++if test "${lt_cv_ld_reload_flag+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ lt_cv_ld_reload_flag='-r'
++fi
++echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
++echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
++reload_flag=$lt_cv_ld_reload_flag
++test -n "$reload_flag" && reload_flag=" $reload_flag"
++
++echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
++echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
++if test "${lt_cv_path_NM+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if test -n "$NM"; then
++ # Let the user override the test.
++ lt_cv_path_NM="$NM"
++else
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
++ test -z "$ac_dir" && ac_dir=.
++ tmp_nm=$ac_dir/${ac_tool_prefix}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
++ if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -B"
++ break
++ elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
++ lt_cv_path_NM="$tmp_nm -p"
++ break
++ else
++ 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
++ fi
++ fi
++ done
++ IFS="$ac_save_ifs"
++ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
++fi
++fi
++
++NM="$lt_cv_path_NM"
++echo "$as_me:$LINENO: result: $NM" >&5
++echo "${ECHO_T}$NM" >&6
++
++echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
++echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
++if test "${lt_cv_path_SED+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ # 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_executable_p="test -f"
++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
++ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++ _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
++ fi
++ done
++ done
++done
++
++ # Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++: ${TMPDIR=/tmp}
++{
++ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=$TMPDIR/sed$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
++ { (exit 1); exit 1; }
++}
++ _max=0
++ _count=0
++ # Add /usr/xpg4/bin/sed as it is typically found on Solaris
++ # along with /bin/sed that truncates output.
++ for _sed in $_sed_list /usr/xpg4/bin/sed; do
++ test ! -f ${_sed} && break
++ cat /dev/null > "$tmp/sed.in"
++ _count=0
++ echo ${ECHO_N-$ac_n} "0123456789${ECHO_C-$ac_c}" >"$tmp/sed.in"
++ # Check for GNU sed and select it if it is found.
++ if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
++ lt_cv_path_SED=${_sed}
++ break
++ fi
++ while true; do
++ cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
++ mv "$tmp/sed.tmp" "$tmp/sed.in"
++ cp "$tmp/sed.in" "$tmp/sed.nl"
++ echo >>"$tmp/sed.nl"
++ ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
++ cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
++ # 40000 chars as input seems more than enough
++ test $_count -gt 10 && break
++ _count=`expr $_count + 1`
++ if test $_count -gt $_max; then
++ _max=$_count
++ lt_cv_path_SED=$_sed
++ fi
++ done
++ done
++ rm -rf "$tmp"
++
++fi
++
++if test "X$SED" != "X"; then
++ lt_cv_path_SED=$SED
++else
++ SED=$lt_cv_path_SED
++fi
++echo "$as_me:$LINENO: result: $SED" >&5
++echo "${ECHO_T}$SED" >&6
++
++echo "$as_me:$LINENO: checking whether ln -s works" >&5
++echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
++LN_S=$as_ln_s
++if test "$LN_S" = "ln -s"; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++else
++ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
++echo "${ECHO_T}no, using $LN_S" >&6
++fi
++
++echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
++echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
++if test "${lt_cv_deplibs_check_method+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 egrep 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
++aix4* | aix5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++beos*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++bsdi4*)
++ 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* | mingw* | pw32*)
++ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ lt_cv_file_magic_cmd='$OBJDUMP -f'
++ ;;
++
++darwin* | rhapsody*)
++ lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
++ lt_cv_file_magic_cmd='/usr/bin/file -L'
++ case "$host_os" in
++ rhapsody* | darwin1.[012])
++ lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
++ ;;
++ *) # Darwin 1.3 on
++ lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
++ ;;
++ esac
++ ;;
++
++freebsd*)
++ 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)/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
++ ;;
++
++hpux10.20*|hpux11*)
++ 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_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=/usr/lib/libc.sl
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ irix5* | nonstopux*)
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
++ ;;
++ *)
++ case $LD in
++ *-32|*"-32 ") libmagic=32-bit;;
++ *-n32|*"-n32 ") libmagic=N32;;
++ *-64|*"-64 ") libmagic=64-bit;;
++ *) libmagic=never-match;;
++ esac
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
++ ;;
++ esac
++ lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ case $host_cpu in
++ alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64* | arm* | m68k)
++ lt_cv_deplibs_check_method=pass_all ;;
++ *)
++ # glibc up to 2.1.1 does not perform some relocations on ARM
++ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
++ esac
++ lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
++ ;;
++
++netbsd*)
++ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
++ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
++ else
++ lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$'
++ 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
++ ;;
++
++openbsd*)
++ lt_cv_file_magic_cmd=/usr/bin/file
++ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
++ else
++ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
++ fi
++ ;;
++
++osf3* | osf4* | osf5*)
++ # this will be overridden with pass_all, but let us keep it just in case
++ lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
++ lt_cv_file_magic_test_file=/shlib/libc.so
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sco3.2v5*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++solaris*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=/lib/libc.so
++ ;;
++
++sysv5uw[78]* | sysv4*uw2*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
++
++sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ 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
++ ;;
++ esac
++ ;;
++esac
++
++fi
++echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
++echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
++file_magic_cmd=$lt_cv_file_magic_cmd
++deplibs_check_method=$lt_cv_deplibs_check_method
++
++
++
++
++
++
++
++# Check for command to grab the raw symbol name followed by C symbol from nm.
++echo "$as_me:$LINENO: checking command to parse $NM output" >&5
++echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6
++if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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]*\)'
++
++# Transform the above into a raw symbol and a C symbol.
++symxfrm='\1 \2\3 \3'
++
++# Transform an extracted symbol line into a proper C declaration
++lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
++
++# Transform an extracted symbol line into symbol name and symbol address
++lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++
++# Define system-specific variables.
++case $host_os in
++aix*)
++ symcode='[BCDT]'
++ ;;
++cygwin* | mingw* | pw32*)
++ symcode='[ABCDGISTW]'
++ ;;
++hpux*) # Its linker distinguishes data from code symbols
++ lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
++ lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
++ ;;
++irix* | nonstopux*)
++ symcode='[BCDEGRST]'
++ ;;
++osf*)
++ symcode='[BCDEGQRST]'
++ ;;
++solaris* | sysv5*)
++ symcode='[BDT]'
++ ;;
++sysv4)
++ symcode='[DFNSTU]'
++ ;;
++esac
++
++# Handle CRLF in mingw tool chain
++opt_cr=
++case $host_os in
++mingw*)
++ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
++ ;;
++esac
++
++# If we're using GNU nm, then use its standard symbol codes.
++if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
++ symcode='[ABCDGISTW]'
++fi
++
++# Try without a prefix undercore, then with it.
++for ac_symprfx in "" "_"; do
++
++ # Write the raw and C identifiers.
++lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
++
++ # Check to see that the pipe works correctly.
++ pipe_works=no
++ rm -f conftest*
++ cat > conftest.$ac_ext <<EOF
++#ifdef __cplusplus
++extern "C" {
++#endif
++char nm_test_var;
++void nm_test_func(){}
++#ifdef __cplusplus
++}
++#endif
++int main(){nm_test_var='a';nm_test_func();return(0);}
++EOF
++
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ # Now try to grab the symbols.
++ nlist=conftest.nm
++ if { (eval echo "$as_me:$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=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && 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 egrep ' nm_test_var$' "$nlist" >/dev/null; then
++ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
++ cat <<EOF > conftest.$ac_ext
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++EOF
++ # Now generate the symbol file.
++ eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
++
++ cat <<EOF >> conftest.$ac_ext
++#if defined (__STDC__) && __STDC__
++# define lt_ptr void *
++#else
++# define lt_ptr char *
++# define const
++#endif
++
++/* The mapping between symbol names and symbols. */
++const struct {
++ const char *name;
++ lt_ptr address;
++}
++lt_preloaded_symbols[] =
++{
++EOF
++ sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
++ cat <<\EOF >> conftest.$ac_ext
++ {0, (lt_ptr) 0}
++};
++
++#ifdef __cplusplus
++}
++#endif
++EOF
++ # Now try linking the two files.
++ mv conftest.$ac_objext conftstm.$ac_objext
++ save_LIBS="$LIBS"
++ save_CFLAGS="$CFLAGS"
++ LIBS="conftstm.$ac_objext"
++ CFLAGS="$CFLAGS$no_builtin_flag"
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest$ac_exeext; then
++ pipe_works=yes
++ fi
++ LIBS="$save_LIBS"
++ CFLAGS="$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 -f 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
++
++global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
++if test -z "$lt_cv_sys_global_symbol_pipe"; then
++ global_symbol_to_cdecl=
++ global_symbol_to_c_name_address=
++else
++ global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
++ global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
++fi
++if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
++then
++ echo "$as_me:$LINENO: result: failed" >&5
++echo "${ECHO_T}failed" >&6
++else
++ echo "$as_me:$LINENO: result: ok" >&5
++echo "${ECHO_T}ok" >&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
++echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
++echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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
++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++@%:@ifdef __STDC__
++@%:@ include <limits.h>
++@%:@else
++@%:@ include <assert.h>
++@%:@endif
++ Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ :
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # Broken: fails on valid input.
++continue
++fi
++rm -f conftest.err conftest.$ac_ext
++
++ # OK, works on sane cases. Now check whether non-existent headers
++ # can be detected and how.
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++@%:@include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ # Broken: success on invalid input.
++continue
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # 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
++echo "$as_me:$LINENO: result: $CPP" >&5
++echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++@%:@ifdef __STDC__
++@%:@ include <limits.h>
++@%:@else
++@%:@ include <assert.h>
++@%:@endif
++ Syntax error
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ :
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # Broken: fails on valid input.
++continue
++fi
++rm -f conftest.err conftest.$ac_ext
++
++ # OK, works on sane cases. Now check whether non-existent headers
++ # can be detected and how.
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++@%:@include <ac_nonexistent.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ # Broken: success on invalid input.
++continue
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ # 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
++ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&5
++echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
++See \`config.log' for more details." >&2;}
++ { (exit 1); exit 1; }; }
++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
++
++
++echo "$as_me:$LINENO: checking for egrep" >&5
++echo $ECHO_N "checking for egrep... $ECHO_C" >&6
++if test "${ac_cv_prog_egrep+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
++ then ac_cv_prog_egrep='grep -E'
++ else ac_cv_prog_egrep='egrep'
++ fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
++echo "${ECHO_T}$ac_cv_prog_egrep" >&6
++ EGREP=$ac_cv_prog_egrep
++
++
++echo "$as_me:$LINENO: checking for ANSI C header files" >&5
++echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
++if test "${ac_cv_header_stdc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <stdlib.h>
++#include <stdarg.h>
++#include <string.h>
++#include <float.h>
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_header_stdc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_header_stdc=no
++fi
++rm -f 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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* 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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++#include <ctype.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))
++ exit(2);
++ exit (0);
++}
++_ACEOF
++rm -f conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ :
++else
++ echo "$as_me: program exited with status $ac_status" >&5
++echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++( exit $ac_status )
++ac_cv_header_stdc=no
++fi
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++fi
++fi
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
++echo "${ECHO_T}$ac_cv_header_stdc" >&6
++if test $ac_cv_header_stdc = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++@%:@define STDC_HEADERS 1
++_ACEOF
++
++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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++
++@%:@include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ eval "$as_ac_Header=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "$as_ac_Header=no"
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++
++done
++
++
++
++for ac_header in dlfcn.h
++do
++as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking $ac_header usability" >&5
++echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++@%:@include <$ac_header>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking $ac_header presence" >&5
++echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++@%:@include <$ac_header>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++@%:@@%:@ ------------------------------------------ @%:@@%:@
++@%:@@%:@ Report this to the AC_PACKAGE_NAME lists. @%:@@%:@
++@%:@@%:@ ------------------------------------------ @%:@@%:@
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for $ac_header" >&5
++echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ eval "$as_ac_Header=\$ac_header_preproc"
++fi
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
++
++fi
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
++ cat >>confdefs.h <<_ACEOF
++@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
++_ACEOF
++
++fi
++
++done
++
++
++
++
++
++
++# Only perform the check for file, if the check method requires it
++case $deplibs_check_method in
++file_magic*)
++ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
++ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
++echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ case $MAGIC_CMD in
++ /*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++ ;;
++ ?:/*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="/usr/bin:$PATH"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_save_MAGIC_CMD"
++ ;;
++esac
++fi
++
++MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++if test -n "$MAGIC_CMD"; then
++ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++echo "${ECHO_T}$MAGIC_CMD" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++if test -z "$lt_cv_path_MAGIC_CMD"; then
++ if test -n "$ac_tool_prefix"; then
++ echo "$as_me:$LINENO: checking for file" >&5
++echo $ECHO_N "checking for file... $ECHO_C" >&6
++if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ case $MAGIC_CMD in
++ /*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
++ ;;
++ ?:/*)
++ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
++ ;;
++ *)
++ ac_save_MAGIC_CMD="$MAGIC_CMD"
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
++ ac_dummy="/usr/bin:$PATH"
++ for ac_dir in $ac_dummy; do
++ 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 <<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
++
++EOF
++ fi ;;
++ esac
++ fi
++ break
++ fi
++ done
++ IFS="$ac_save_ifs"
++ MAGIC_CMD="$ac_save_MAGIC_CMD"
++ ;;
++esac
++fi
++
++MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
++if test -n "$MAGIC_CMD"; then
++ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
++echo "${ECHO_T}$MAGIC_CMD" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ else
++ MAGIC_CMD=:
++ fi
++fi
++
++ fi
++ ;;
++esac
++
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++RANLIB=$ac_cv_prog_RANLIB
++if test -n "$RANLIB"; then
++ echo "$as_me:$LINENO: result: $RANLIB" >&5
++echo "${ECHO_T}$RANLIB" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_RANLIB="ranlib"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
++fi
++fi
++ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
++if test -n "$ac_ct_RANLIB"; then
++ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
++echo "${ECHO_T}$ac_ct_RANLIB" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ RANLIB=$ac_ct_RANLIB
++else
++ RANLIB="$ac_cv_prog_RANLIB"
++fi
++
++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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++fi
++fi
++STRIP=$ac_cv_prog_STRIP
++if test -n "$STRIP"; then
++ echo "$as_me:$LINENO: result: $STRIP" >&5
++echo "${ECHO_T}$STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}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
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_prog_ac_ct_STRIP="strip"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
++fi
++fi
++ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
++if test -n "$ac_ct_STRIP"; then
++ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
++echo "${ECHO_T}$ac_ct_STRIP" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++ STRIP=$ac_ct_STRIP
++else
++ STRIP="$ac_cv_prog_STRIP"
++fi
++
++
++enable_dlopen=no
++enable_win32_dll=no
++
++# Check whether --enable-libtool-lock or --disable-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
++*-*-irix6*)
++ # Find out which ABI we are using.
++ echo '#line __oline__ "configure"' > conftest.$ac_ext
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ 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
++ rm -rf conftest*
++ ;;
++
++*-*-sco3.2v5*)
++ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
++ SAVE_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -belf"
++ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
++echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
++if test "${lt_cv_cc_needs_belf+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ lt_cv_cc_needs_belf=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++lt_cv_cc_needs_belf=no
++fi
++rm -f 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
++echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
++echo "${ECHO_T}$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
++ ;;
++
++
++esac
++
++# Sed substitution that helps us do robust quoting. It backslashifies
++# metacharacters that are still active within double-quoted strings.
++Xsed='sed -e s/^X//'
++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'
++
++# Constants:
++rm="rm -f"
++
++# Global variables:
++default_ofile=libtool
++can_build_shared=yes
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++ltmain="$ac_aux_dir/ltmain.sh"
++ofile="$default_ofile"
++with_gnu_ld="$lt_cv_prog_gnu_ld"
++need_locks="$enable_libtool_lock"
++
++old_CC="$CC"
++old_CFLAGS="$CFLAGS"
++
++# Set sane defaults for various variables
++test -z "$AR" && AR=ar
++test -z "$AR_FLAGS" && AR_FLAGS=cru
++test -z "$AS" && AS=as
++test -z "$CC" && CC=cc
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++test -z "$LD" && LD=ld
++test -z "$LN_S" && LN_S="ln -s"
++test -z "$MAGIC_CMD" && MAGIC_CMD=file
++test -z "$NM" && NM=nm
++test -z "$OBJDUMP" && OBJDUMP=objdump
++test -z "$RANLIB" && RANLIB=:
++test -z "$STRIP" && STRIP=:
++test -z "$ac_objext" && ac_objext=o
++
++if test x"$host" != x"$build"; then
++ ac_tool_prefix=${host_alias}-
++else
++ ac_tool_prefix=
++fi
++
++# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
++case $host_os in
++linux-gnu*) ;;
++linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
++esac
++
++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
++
++# Determine commands to create old-style static archives.
++old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
++old_postinstall_cmds='chmod 644 $oldlib'
++old_postuninstall_cmds=
++
++if test -n "$RANLIB"; then
++ case $host_os in
++ openbsd*)
++ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
++ ;;
++ *)
++ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
++ ;;
++ esac
++ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
++fi
++
++# Allow CC to be a program name with arguments.
++set dummy $CC
++compiler="$2"
++
++echo "$as_me:$LINENO: checking for objdir" >&5
++echo $ECHO_N "checking for objdir... $ECHO_C" >&6
++rm -f .libs 2>/dev/null
++mkdir .libs 2>/dev/null
++if test -d .libs; then
++ objdir=.libs
++else
++ # MS-DOS does not allow filenames that begin with a dot.
++ objdir=_libs
++fi
++rmdir .libs 2>/dev/null
++echo "$as_me:$LINENO: result: $objdir" >&5
++echo "${ECHO_T}$objdir" >&6
++
++
++
++# Check whether --with-pic or --without-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
++
++# We assume here that the value for lt_cv_prog_cc_pic will not be cached
++# in isolation, and that seeing it set (from the cache) indicates that
++# the associated values are set (in the cache) correctly too.
++echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
++echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
++if test "${lt_cv_prog_cc_pic+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_shlib=
++ lt_cv_prog_cc_wl=
++ lt_cv_prog_cc_static=
++ lt_cv_prog_cc_no_builtin=
++ lt_cv_prog_cc_can_build_shared=$can_build_shared
++
++ if test "$GCC" = yes; then
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-static'
++
++ case $host_os in
++ aix*)
++ # Below there is a dirty hack to force normal static linking with -ldl
++ # The problem is because libdl dynamically linked with both libc and
++ # libC (AIX C++ library), which obviously doesn't included in libraries
++ # list by gcc. This cause undefined symbols with -static flags.
++ # This hack allows C programs to be linked with "-static -ldl", but
++ # not sure about C++ programs.
++ lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
++ ;;
++ amigaos*)
++ # 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_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
++ ;;
++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
++ # PIC is the default for these OSes.
++ ;;
++ darwin* | rhapsody*)
++ # PIC is the default on this platform
++ # Common symbols not allowed in MH_DYLIB files
++ lt_cv_prog_cc_pic='-fno-common'
++ ;;
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ lt_cv_prog_cc_pic=-Kconform_pic
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic='-fPIC'
++ ;;
++ esac
++ else
++ # PORTME Check for PIC flags for the system compiler.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ lt_cv_prog_cc_wl='-Wl,'
++ # All AIX code is PIC.
++ if test "$host_cpu" = ia64; then
++ # AIX 5 now supports IA64 processor
++ lt_cv_prog_cc_static='-Bstatic'
++ else
++ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
++ fi
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
++ lt_cv_prog_cc_pic='+Z'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ # PIC (with -KPIC) is the default.
++ ;;
++
++ cygwin* | mingw* | pw32* | os2*)
++ # 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_cv_prog_cc_pic='-DDLL_EXPORT'
++ ;;
++
++ newsos6)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ osf3* | osf4* | osf5*)
++ # All OSF/1 code is PIC.
++ lt_cv_prog_cc_wl='-Wl,'
++ lt_cv_prog_cc_static='-non_shared'
++ ;;
++
++ sco3.2v5*)
++ lt_cv_prog_cc_pic='-Kpic'
++ lt_cv_prog_cc_static='-dn'
++ lt_cv_prog_cc_shlib='-belf'
++ ;;
++
++ solaris*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ sunos4*)
++ lt_cv_prog_cc_pic='-PIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Qoption ld '
++ ;;
++
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ lt_cv_prog_cc_pic='-KPIC'
++ lt_cv_prog_cc_static='-Bstatic'
++ lt_cv_prog_cc_wl='-Wl,'
++ ;;
++
++ uts4*)
++ lt_cv_prog_cc_pic='-pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ ;;
++
++ sysv4*MP*)
++ if test -d /usr/nec ;then
++ lt_cv_prog_cc_pic='-Kconform_pic'
++ lt_cv_prog_cc_static='-Bstatic'
++ fi
++ ;;
++
++ *)
++ lt_cv_prog_cc_can_build_shared=no
++ ;;
++ esac
++ fi
++
++fi
++
++if test -z "$lt_cv_prog_cc_pic"; then
++ echo "$as_me:$LINENO: result: none" >&5
++echo "${ECHO_T}none" >&6
++else
++ echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6
++
++ # Check to make sure the pic_flag actually works.
++ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5
++echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6
++ if test "${lt_cv_prog_cc_pic_works+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ case $host_os in
++ hpux9* | hpux10* | hpux11*)
++ # On HP-UX, both CC and GCC only warn that PIC is supported... then
++ # they create non-PIC objects. So, if there were any warnings, we
++ # assume that PIC is not supported.
++ if test -s conftest.err; then
++ lt_cv_prog_cc_pic_works=no
++ else
++ lt_cv_prog_cc_pic_works=yes
++ fi
++ ;;
++ *)
++ lt_cv_prog_cc_pic_works=yes
++ ;;
++ esac
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ lt_cv_prog_cc_pic_works=no
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++
++fi
++
++
++ if test "X$lt_cv_prog_cc_pic_works" = Xno; then
++ lt_cv_prog_cc_pic=
++ lt_cv_prog_cc_can_build_shared=no
++ else
++ lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
++ fi
++
++ echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6
++fi
++
++# Check for any special shared library compilation flags.
++if test -n "$lt_cv_prog_cc_shlib"; then
++ { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5
++echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;}
++ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then :
++ else
++ { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
++echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
++ lt_cv_prog_cc_can_build_shared=no
++ fi
++fi
++
++echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5
++echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6
++if test "${lt_cv_prog_cc_static_works+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ lt_cv_prog_cc_static_works=no
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ lt_cv_prog_cc_static_works=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++ LDFLAGS="$save_LDFLAGS"
++
++fi
++
++
++# Belt *and* braces to stop my trousers falling down:
++test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
++echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5
++echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6
++
++pic_flag="$lt_cv_prog_cc_pic"
++special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
++wl="$lt_cv_prog_cc_wl"
++link_static_flag="$lt_cv_prog_cc_static"
++no_builtin_flag="$lt_cv_prog_cc_no_builtin"
++can_build_shared="$lt_cv_prog_cc_can_build_shared"
++
++
++# Check to see if options -o and -c are simultaneously supported by compiler
++echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
++echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
++if test "${lt_cv_compiler_c_o+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++$rm -r conftest 2>/dev/null
++mkdir conftest
++cd conftest
++echo "int some_variable = 0;" > conftest.$ac_ext
++mkdir out
++# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
++# that will create temporary files in the current directory regardless of
++# the output directory. Thus, making CWD read-only will cause this test
++# to fail, enabling locking or at least warning the user not to do parallel
++# builds.
++chmod -w .
++save_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
++compiler_c_o=no
++if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
++ if test -s out/conftest.err; then
++ lt_cv_compiler_c_o=no
++ else
++ lt_cv_compiler_c_o=yes
++ fi
++else
++ # Append any errors to the config.log.
++ cat out/conftest.err 1>&5
++ lt_cv_compiler_c_o=no
++fi
++CFLAGS="$save_CFLAGS"
++chmod u+w .
++$rm conftest* out/*
++rmdir out
++cd ..
++rmdir conftest
++$rm -r conftest 2>/dev/null
++
++fi
++
++compiler_c_o=$lt_cv_compiler_c_o
++echo "$as_me:$LINENO: result: $compiler_c_o" >&5
++echo "${ECHO_T}$compiler_c_o" >&6
++
++if test x"$compiler_c_o" = x"yes"; then
++ # Check to see if we can write to a .lo
++ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5
++echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6
++ if test "${lt_cv_compiler_o_lo+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ lt_cv_compiler_o_lo=no
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -c -o conftest.lo"
++ save_objext="$ac_objext"
++ ac_objext=lo
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++int some_variable = 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ lt_cv_compiler_o_lo=no
++ else
++ lt_cv_compiler_o_lo=yes
++ fi
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ ac_objext="$save_objext"
++ CFLAGS="$save_CFLAGS"
++
++fi
++
++ compiler_o_lo=$lt_cv_compiler_o_lo
++ echo "$as_me:$LINENO: result: $compiler_o_lo" >&5
++echo "${ECHO_T}$compiler_o_lo" >&6
++else
++ compiler_o_lo=no
++fi
++
++# Check to see if we can do hard links to lock some files if needed
++hard_links="nottested"
++if test "$compiler_c_o" = no && test "$need_locks" != no; then
++ # do not overwrite the value of need_locks provided by the user
++ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
++echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&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
++ echo "$as_me:$LINENO: result: $hard_links" >&5
++echo "${ECHO_T}$hard_links" >&6
++ if test "$hard_links" = no; then
++ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
++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
++
++if test "$GCC" = yes; then
++ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
++ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
++echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
++ echo "int some_variable = 0;" > conftest.$ac_ext
++ save_CFLAGS="$CFLAGS"
++ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
++ compiler_rtti_exceptions=no
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++int
++main ()
++{
++int some_variable = 0;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ # The compiler can only warn and ignore the option if not recognized
++ # So say no if there are warnings
++ if test -s conftest.err; then
++ compiler_rtti_exceptions=no
++ else
++ compiler_rtti_exceptions=yes
++ fi
++
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$save_CFLAGS"
++ echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
++echo "${ECHO_T}$compiler_rtti_exceptions" >&6
++
++ if test "$compiler_rtti_exceptions" = "yes"; then
++ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
++ else
++ no_builtin_flag=' -fno-builtin'
++ fi
++fi
++
++# See if the linker supports building shared libraries.
++echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5
++echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6
++
++allow_undefined_flag=
++no_undefined_flag=
++need_lib_prefix=unknown
++need_version=unknown
++# when you set need_version to no, make sure it does not cause -set_version
++# flags to be left without arguments
++archive_cmds=
++archive_expsym_cmds=
++old_archive_from_new_cmds=
++old_archive_from_expsyms_cmds=
++export_dynamic_flag_spec=
++whole_archive_flag_spec=
++thread_safe_flag_spec=
++hardcode_into_libs=no
++hardcode_libdir_flag_spec=
++hardcode_libdir_separator=
++hardcode_direct=no
++hardcode_minus_L=no
++hardcode_shlibpath_var=unsupported
++runpath_var=
++link_all_deplibs=unknown
++always_export_symbols=no
++export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
++# include_expsyms should be a list of space-separated symbols to be *always*
++# included in the symbol list
++include_expsyms=
++# exclude_expsyms can be an egrep regular expression 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_"
++# 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.
++extract_expsyms_cmds=
++
++case $host_os in
++cygwin* | mingw* | pw32*)
++ # 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
++ ;;
++openbsd*)
++ with_gnu_ld=no
++ ;;
++esac
++
++ld_shlibs=yes
++if test "$with_gnu_ld" = yes; then
++ # If archive_cmds runs LD, not CC, wlarc should be empty
++ wlarc='${wl}'
++
++ # See if GNU ld supports shared libraries.
++ case $host_os in
++ aix3* | aix4* | aix5*)
++ # On AIX, the GNU linker is very broken
++ # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
++ ld_shlibs=no
++ cat <<EOF 1>&2
++
++*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
++*** so that a non-GNU linker is found, and then restart.
++
++EOF
++ ;;
++
++ amigaos*)
++ 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
++
++ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++ # that the semantics of dynamic libraries on AmigaOS, at least up
++ # to version 4, is to share data among multiple programs linked
++ # with the same dynamic library. Since this doesn't match the
++ # behavior of shared libraries on other platforms, we can use
++ # them.
++ ld_shlibs=no
++ ;;
++
++ beos*)
++ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
++ allow_undefined_flag=unsupported
++ # Joseph Beckenbach <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*)
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec='-L$libdir'
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++
++ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
++ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
++ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
++ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
++ else $CC -o impgen impgen.c ; fi)~
++ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
++
++ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
++
++ # cygwin and mingw dlls have different entry points and sets of symbols
++ # to exclude.
++ # FIXME: what about values for MSVC?
++ dll_entry=__cygwin_dll_entry@12
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
++ case $host_os in
++ mingw*)
++ # mingw values
++ dll_entry=_DllMainCRTStartup@12
++ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
++ ;;
++ esac
++
++ # mingw and cygwin differ, and it's simplest to just exclude the union
++ # of the two symbol sets.
++ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
++
++ # recent cygwin and mingw systems supply a stub DllMain which the user
++ # can override, but on older systems we have to supply one (in ltdll.c)
++ if test "x$lt_cv_need_dllmain" = "xyes"; then
++ ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
++ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
++ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
++ else
++ ltdll_obj=
++ ltdll_cmds=
++ fi
++
++ # Extract the symbol export list from an `--export-all' def file,
++ # then regenerate the def file from the symbol export list, so that
++ # the compiled dll only exports the symbol export list.
++ # Be careful not to strip the DATA tag left be newer dlltools.
++ export_symbols_cmds="$ltdll_cmds"'
++ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
++ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
++
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is.
++ # If DATA tags from a recent dlltool are present, honour them!
++ 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;
++ _lt_hint=1;
++ cat $export_symbols | while read symbol; do
++ set dummy \$symbol;
++ case \$# in
++ 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
++ 4) echo " \$2 \$3 \$4 ; " >> $output_objdir/$soname-def; _lt_hint=`expr \$_lt_hint - 1`;;
++ *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;;
++ esac;
++ _lt_hint=`expr 1 + \$_lt_hint`;
++ done;
++ fi~
++ '"$ltdll_cmds"'
++ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
++ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
++ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
++ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
++ ;;
++
++ 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 -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ fi
++ ;;
++
++ solaris* | sysv5*)
++ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
++ ld_shlibs=no
++ cat <<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.
++
++EOF
++ elif $LD --help 2>&1 | egrep ': 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
++ ;;
++
++ 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 | egrep ': 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" = yes; then
++ runpath_var=LD_RUN_PATH
++ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
++ export_dynamic_flag_spec='${wl}--export-dynamic'
++ case $host_os in
++ cygwin* | mingw* | pw32*)
++ # dlltool doesn't understand --whole-archive et. al.
++ whole_archive_flag_spec=
++ ;;
++ *)
++ # ancient GNU ld didn't support --whole-archive et. al.
++ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
++ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
++ else
++ whole_archive_flag_spec=
++ fi
++ ;;
++ esac
++ fi
++else
++ # PORTME fill in a description of your system's linker (not GNU ld)
++ 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 "$link_static_flag"; then
++ # Neither direct hardcoding nor static linking is supported with a
++ # broken collect2.
++ hardcode_direct=unsupported
++ fi
++ ;;
++
++ aix4* | aix5*)
++ 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].*|aix5*)
++ 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.
++
++ hardcode_direct=yes
++ archive_cmds=''
++ hardcode_libdir_separator=':'
++ if test "$GCC" = yes; then
++ case $host_os in aix4.[012]|aix4.[012].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ # It fails to find uninstalled libraries when the uninstalled
++ # path is not listed in the libpath. Setting hardcode_minus_L
++ # to unsupported forces relinking
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++
++ shared_flag='-shared'
++ else
++ # not using gcc
++ if test "$host_cpu" = ia64; then
++ shared_flag='${wl}-G'
++ else
++ if test "$aix_use_runtimelinking" = yes; then
++ shared_flag='${wl}-G'
++ else
++ shared_flag='${wl}-bM:SRE'
++ fi
++ fi
++ fi
++
++ # It seems that -bexpall can do strange things, 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'
++ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
++ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
++ else
++ hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
++ # Warning - without using the other run time loading flags,
++ # -berok will link without error, but may produce a broken library.
++ allow_undefined_flag='${wl}-berok'
++ # This is a bit strange, but is similar to how AIX traditionally builds
++ # it's shared libraries.
++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $output_objdir/$libname$release.a $output_objdir/$soname'
++ fi
++ fi
++ ;;
++
++ amigaos*)
++ 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
++ # see comment about different semantics on the GNU ld section
++ ld_shlibs=no
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ # 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
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''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"`'
++ ;;
++
++ darwin* | rhapsody*)
++ case "$host_os" in
++ rhapsody* | darwin1.[012])
++ allow_undefined_flag='-undefined suppress'
++ ;;
++ *) # Darwin 1.3 on
++ allow_undefined_flag='-flat_namespace -undefined suppress'
++ ;;
++ esac
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
++ # `"' quotes if we put them in here... so don't!
++ archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
++ # We need to add '_' to the symbols in $export_symbols first
++ #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ whole_archive_flag_spec='-all_load $convenience'
++ ;;
++
++ freebsd1*)
++ ld_shlibs=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*)
++ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ ;;
++
++ hpux9* | hpux10* | hpux11*)
++ case $host_os in
++ hpux9*) 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' ;;
++ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
++ esac
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=yes
++ hardcode_minus_L=yes # Not in the search PATH, but as the default
++ # location of the library.
++ export_dynamic_flag_spec='${wl}-E'
++ ;;
++
++ irix5* | irix6* | nonstopux*)
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ else
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ 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
++ ;;
++
++ openbsd*)
++ hardcode_direct=yes
++ hardcode_shlibpath_var=no
++ 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'
++ 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
++ ;;
++
++ 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ else
++ allow_undefined_flag=' -expect_unresolved \*'
++ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ fi
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++
++ osf4* | osf5*) # as osf3* with the addition of -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" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
++ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
++ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
++
++ #Both c and cxx compiler support -rpath directly
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ ;;
++
++ sco3.2v5*)
++ 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
++ export_dynamic_flag_spec='${wl}-Bexport'
++ ;;
++
++ solaris*)
++ # gcc --version < 3.0 without binutils cannot create self contained
++ # shared libraries reliably, requiring libgcc.a to resolve some of
++ # the object symbols generated in some cases. Libraries that use
++ # assert need libgcc.a to resolve __eprintf, for example. Linking
++ # a copy of libgcc.a into every shared library to guarantee resolving
++ # such symbols causes other problems: According to Tim Van Holder
++ # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
++ # (to the application) exception stack for one thing.
++ no_undefined_flag=' -z defs'
++ if test "$GCC" = yes; then
++ case `$CC --version 2>/dev/null` in
++ [12].*)
++ cat <<EOF 1>&2
++
++*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
++*** create self contained shared libraries on Solaris systems, without
++*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
++*** -no-undefined support, which will at least allow you to build shared
++*** libraries. However, you may find that when you link such libraries
++*** into an application without using GCC, you have to manually add
++*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
++*** upgrade to a newer version of GCC. Another option is to rebuild your
++*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
++
++EOF
++ no_undefined_flag=
++ ;;
++ esac
++ fi
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_shlibpath_var=no
++ case $host_os in
++ solaris2.[0-5] | solaris2.[0-5].*) ;;
++ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
++ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
++ esac
++ 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'
++ ;;
++
++ sysv5*)
++ no_undefined_flag=' -z text'
++ # $CC -shared without GNU ld will not create a library from C++
++ # object files and a static libstdc++, better avoid it by now
++ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $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'
++ hardcode_libdir_flag_spec=
++ hardcode_shlibpath_var=no
++ runpath_var='LD_RUN_PATH'
++ ;;
++
++ uts4*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ dgux*)
++ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_shlibpath_var=no
++ ;;
++
++ 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.2uw2*)
++ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
++ hardcode_direct=yes
++ hardcode_minus_L=no
++ hardcode_shlibpath_var=no
++ hardcode_runpath_var=yes
++ runpath_var=LD_RUN_PATH
++ ;;
++
++ sysv5uw7* | unixware7*)
++ no_undefined_flag='${wl}-z ${wl}text'
++ if test "$GCC" = yes; then
++ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ else
++ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ fi
++ runpath_var='LD_RUN_PATH'
++ hardcode_shlibpath_var=no
++ ;;
++
++ *)
++ ld_shlibs=no
++ ;;
++ esac
++fi
++echo "$as_me:$LINENO: result: $ld_shlibs" >&5
++echo "${ECHO_T}$ld_shlibs" >&6
++test "$ld_shlibs" = no && can_build_shared=no
++
++# Check hardcoding attributes.
++echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
++echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
++hardcode_action=
++if test -n "$hardcode_libdir_flag_spec" || \
++ test -n "$runpath_var"; then
++
++ # We can hardcode non-existant 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 "$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
++echo "$as_me:$LINENO: result: $hardcode_action" >&5
++echo "${ECHO_T}$hardcode_action" >&6
++
++striplib=
++old_striplib=
++echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
++echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&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"
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++reload_cmds='$LD$reload_flag -o $output$reload_objs'
++test -z "$deplibs_check_method" && deplibs_check_method=unknown
++
++# PORTME Fill in your ld.so characteristics
++echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
++echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
++library_names_spec=
++libname_spec='lib$name'
++soname_spec=
++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"
++sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
++
++case $host_os in
++aix3*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix $libname.a'
++ shlibpath_var=LIBPATH
++
++ # AIX has no versioning support, so we append a major version to the name.
++ soname_spec='${libname}${release}.so$major'
++ ;;
++
++aix4* | aix5*)
++ 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}.so$major ${libname}${release}.so$versuffix $libname.so'
++ 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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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}.so$major'
++ fi
++ shlibpath_var=LIBPATH
++ fi
++ hardcode_into_libs=yes
++ ;;
++
++amigaos*)
++ 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=`$echo "X$lib" | $Xsed -e '\''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'
++ ;;
++
++beos*)
++ library_names_spec='${libname}.so'
++ dynamic_linker="$host_os ld.so"
++ shlibpath_var=LIBRARY_PATH
++ ;;
++
++bsdi4*)
++ version_type=linux
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
++ export_dynamic_flag_spec=-rdynamic
++ # the default ld.so.conf also contains /usr/contrib/lib and
++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
++ # libtool to hard-code these into programs
++ ;;
++
++cygwin* | mingw* | pw32*)
++ version_type=windows
++ need_version=no
++ need_lib_prefix=no
++ case $GCC,$host_os in
++ yes,cygwin*)
++ library_names_spec='$libname.dll.a'
++ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog .libs/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $rm \$dlpath'
++ ;;
++ yes,mingw*)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
++ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g" -e "s,=/,/,g"`
++ ;;
++ yes,pw32*)
++ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll'
++ ;;
++ *)
++ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $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
++ # FIXME: Relying on posixy $() will cause problems for
++ # cross-compilation, but unfortunately the echo tests do not
++ # yet detect zsh echo's removal of \ escapes.
++ library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
++ soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
++ shlibpath_overrides_runpath=yes
++ shlibpath_var=DYLD_LIBRARY_PATH
++ ;;
++
++freebsd1*)
++ dynamic_linker=no
++ ;;
++
++freebsd*-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ dynamic_linker='GNU/FreeBSD ld.so'
++ ;;
++
++freebsd*)
++ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
++ version_type=freebsd-$objformat
++ case $version_type in
++ freebsd-elf*)
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
++ need_version=no
++ need_lib_prefix=no
++ ;;
++ freebsd-*)
++ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
++ need_version=yes
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_os in
++ freebsd2*)
++ shlibpath_overrides_runpath=yes
++ ;;
++ *)
++ shlibpath_overrides_runpath=no
++ hardcode_into_libs=yes
++ ;;
++ esac
++ ;;
++
++gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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.
++ dynamic_linker="$host_os dld.sl"
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ shlibpath_var=SHLIB_PATH
++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
++ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
++ soname_spec='${libname}${release}.sl$major'
++ # HP-UX runs *really* slowly unless shared libraries are mode 555.
++ postinstall_cmds='chmod 555 $lib'
++ ;;
++
++irix5* | irix6* | nonstopux*)
++ case $host_os in
++ nonstopux*) version_type=nonstopux ;;
++ *) version_type=irix ;;
++ esac
++ need_lib_prefix=no
++ need_version=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
++ case $host_os in
++ irix5* | nonstopux*)
++ libsuff= shlibsuff=
++ ;;
++ *)
++ case $LD in # libtool.m4 will add one of these switches to LD
++ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
++ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
++ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
++ *) libsuff= shlibsuff= libmagic=never-match;;
++ esac
++ ;;
++ esac
++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
++ shlibpath_overrides_runpath=no
++ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
++ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
++ ;;
++
++# No shared lib support for Linux oldld, aout, or coff.
++linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
++ dynamic_linker=no
++ ;;
++
++# This must be Linux ELF.
++linux-gnu*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=no
++ # 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
++
++ # 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}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ dynamic_linker='NetBSD (a.out) ld.so'
++ else
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
++ soname_spec='${libname}${release}.so$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}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ shlibpath_overrides_runpath=yes
++ ;;
++
++openbsd*)
++ version_type=sunos
++ need_lib_prefix=no
++ need_version=no
++ 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
++ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++os2*)
++ libname_spec='$name'
++ need_lib_prefix=no
++ library_names_spec='$libname.dll $libname.a'
++ dynamic_linker='OS/2 ld.exe'
++ shlibpath_var=LIBPATH
++ ;;
++
++osf3* | osf4* | osf5*)
++ version_type=osf
++ need_version=no
++ need_lib_prefix=no
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ 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"
++ hardcode_into_libs=yes
++ ;;
++
++sco3.2v5*)
++ version_type=osf
++ soname_spec='${libname}${release}.so$major'
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++solaris*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ 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}.so$versuffix ${libname}.so$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.2uw2* | sysv4.3* | sysv5*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ case $host_vendor in
++ sni)
++ shlibpath_overrides_runpath=no
++ need_lib_prefix=no
++ export_dynamic_flag_spec='${wl}-Blargedynsym'
++ 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
++ ;;
++
++uts4*)
++ version_type=linux
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++dgux*)
++ version_type=linux
++ need_lib_prefix=no
++ need_version=no
++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
++ soname_spec='${libname}${release}.so$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ ;;
++
++sysv4*MP*)
++ if test -d /usr/nec ;then
++ version_type=linux
++ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
++ soname_spec='$libname.so.$major'
++ shlibpath_var=LD_LIBRARY_PATH
++ fi
++ ;;
++
++*)
++ dynamic_linker=no
++ ;;
++esac
++echo "$as_me:$LINENO: result: $dynamic_linker" >&5
++echo "${ECHO_T}$dynamic_linker" >&6
++test "$dynamic_linker" = no && can_build_shared=no
++
++# Report the final consequences.
++echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
++echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
++echo "$as_me:$LINENO: result: $can_build_shared" >&5
++echo "${ECHO_T}$can_build_shared" >&6
++
++echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
++echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&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
++ ;;
++
++aix4*)
++ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
++ test "$enable_shared" = yes && enable_static=no
++ fi
++ ;;
++esac
++echo "$as_me:$LINENO: result: $enable_shared" >&5
++echo "${ECHO_T}$enable_shared" >&6
++
++echo "$as_me:$LINENO: checking whether to build static libraries" >&5
++echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
++# Make sure either enable_shared or enable_static is yes.
++test "$enable_shared" = yes || enable_static=yes
++echo "$as_me:$LINENO: result: $enable_static" >&5
++echo "${ECHO_T}$enable_static" >&6
++
++if test "$hardcode_action" = relink; 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
++
++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 "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
++ ;;
++
++ cygwin* | mingw* | pw32*)
++ lt_cv_dlopen="LoadLibrary"
++ lt_cv_dlopen_libs=
++ ;;
++
++ *)
++ echo "$as_me:$LINENO: checking for shl_load" >&5
++echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
++if test "${ac_cv_func_shl_load+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define shl_load innocuous_shl_load
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char shl_load (); 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 shl_load
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char shl_load ();
++/* 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_shl_load) || defined (__stub___shl_load)
++choke me
++#else
++char (*f) () = shl_load;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != shl_load;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_func_shl_load=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_func_shl_load=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
++echo "${ECHO_T}$ac_cv_func_shl_load" >&6
++if test $ac_cv_func_shl_load = yes; then
++ lt_cv_dlopen="shl_load"
++else
++ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
++echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
++if test "${ac_cv_lib_dld_shl_load+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldld $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char shl_load ();
++int
++main ()
++{
++shl_load ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dld_shl_load=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dld_shl_load=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
++echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
++if test $ac_cv_lib_dld_shl_load = yes; then
++ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
++else
++ echo "$as_me:$LINENO: checking for dlopen" >&5
++echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
++if test "${ac_cv_func_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define dlopen innocuous_dlopen
++
++/* System header to define __stub macros and hopefully few prototypes,
++ which can conflict with char dlopen (); 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 dlopen
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++/* The GNU C library defines this for functions which it implements
++ to always fail with ENOSYS. Some functions are actually named
++ something starting with __ and the normal name is an alias. */
++#if defined (__stub_dlopen) || defined (__stub___dlopen)
++choke me
++#else
++char (*f) () = dlopen;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != dlopen;
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_func_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_func_dlopen=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
++echo "${ECHO_T}$ac_cv_func_dlopen" >&6
++if test $ac_cv_func_dlopen = yes; then
++ lt_cv_dlopen="dlopen"
++else
++ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
++echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
++if test "${ac_cv_lib_dl_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldl $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dl_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dl_dlopen=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
++echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
++if test $ac_cv_lib_dl_dlopen = yes; then
++ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
++else
++ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
++echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
++if test "${ac_cv_lib_svld_dlopen+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lsvld $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dlopen ();
++int
++main ()
++{
++dlopen ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_svld_dlopen=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_svld_dlopen=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
++echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
++if test $ac_cv_lib_svld_dlopen = yes; then
++ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
++else
++ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
++echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
++if test "${ac_cv_lib_dld_dld_link+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ldld $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char dld_link ();
++int
++main ()
++{
++dld_link ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_dld_dld_link=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_dld_dld_link=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
++echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
++if test $ac_cv_lib_dld_dld_link = yes; then
++ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
++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"
++ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
++
++ save_LIBS="$LIBS"
++ LIBS="$lt_cv_dlopen_libs $LIBS"
++
++ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
++echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
++if test "${lt_cv_dlopen_self+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
++#line __oline__ "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}
++EOF
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self=no ;;
++ esac
++ else :
++ # compilation failed
++ lt_cv_dlopen_self=no
++ fi
++fi
++rm -fr conftest*
++
++
++fi
++echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
++echo "${ECHO_T}$lt_cv_dlopen_self" >&6
++
++ if test "x$lt_cv_dlopen_self" = xyes; then
++ LDFLAGS="$LDFLAGS $link_static_flag"
++ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
++echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
++if test "${lt_cv_dlopen_self_static+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 <<EOF
++#line __oline__ "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
++
++#ifdef __cplusplus
++extern "C" void exit (int);
++#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;
++ /* dlclose (self); */
++ }
++
++ exit (status);
++}
++EOF
++ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
++ (./conftest; exit; ) 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_unknown|x*) lt_cv_dlopen_self_static=no ;;
++ esac
++ else :
++ # compilation failed
++ lt_cv_dlopen_self_static=no
++ fi
++fi
++rm -fr conftest*
++
++
++fi
++echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
++echo "${ECHO_T}$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
++
++
++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.
++ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
++echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
++ if test "${lt_cv_archive_cmds_need_lc+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ $rm conftest*
++ echo 'static int dummy;' > conftest.$ac_ext
++
++ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; then
++ soname=conftest
++ lib=conftest
++ libobjs=conftest.$ac_objext
++ deplibs=
++ wl=$lt_cv_prog_cc_wl
++ compiler_flags=-v
++ linker_flags=-v
++ verstring=
++ output_objdir=.
++ libname=conftest
++ save_allow_undefined_flag=$allow_undefined_flag
++ allow_undefined_flag=
++ if { (eval echo "$as_me:$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=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }
++ then
++ lt_cv_archive_cmds_need_lc=no
++ else
++ lt_cv_archive_cmds_need_lc=yes
++ fi
++ allow_undefined_flag=$save_allow_undefined_flag
++ else
++ cat conftest.err 1>&5
++ fi
++fi
++
++ echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5
++echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6
++ ;;
++ esac
++fi
++need_lc=${lt_cv_archive_cmds_need_lc-yes}
++
++# The second clause should only fire when bootstrapping the
++# libtool distribution, otherwise you forgot to ship ltmain.sh
++# with your package, and you will get complaints that there are
++# no rules to generate ltmain.sh.
++if test -f "$ltmain"; then
++ :
++else
++ # If there is no Makefile yet, we rely on a make rule to execute
++ # `config.status --recheck' to rerun these tests and create the
++ # libtool script then.
++ test -f Makefile && make "$ltmain"
++fi
++
++if test -f "$ltmain"; then
++ trap "$rm \"${ofile}T\"; exit 1" 1 2 15
++ $rm -f "${ofile}T"
++
++ echo creating $ofile
++
++ # Now quote all the things that may contain metacharacters while being
++ # careful not to overquote the AC_SUBSTed values. We take copies of the
++ # variables and quote the copies for generation of the libtool script.
++ for var in echo old_CC old_CFLAGS SED \
++ AR AR_FLAGS CC LD LN_S NM SHELL \
++ reload_flag reload_cmds wl \
++ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
++ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
++ library_names_spec soname_spec \
++ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
++ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
++ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
++ old_striplib striplib file_magic_cmd export_symbols_cmds \
++ deplibs_check_method allow_undefined_flag no_undefined_flag \
++ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
++ global_symbol_to_c_name_address \
++ hardcode_libdir_flag_spec hardcode_libdir_separator \
++ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
++ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
++
++ case $var in
++ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
++ old_postinstall_cmds | old_postuninstall_cmds | \
++ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
++ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
++ postinstall_cmds | postuninstall_cmds | \
++ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
++ # Double-quote double-evaled strings.
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
++ ;;
++ *)
++ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
++ ;;
++ esac
++ done
++
++ cat <<__EOF__ > "${ofile}T"
++#! $SHELL
++
++# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
++# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
++# NOTE: Changes made to this file will be lost: look at ltmain.sh.
++#
++# Copyright (C) 1996-2000 Free Software Foundation, Inc.
++# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++
++# A sed that does not truncate output.
++SED=$lt_SED
++
++# Sed that helps us avoid accidentally triggering echo(1) options like -n.
++Xsed="${SED} -e s/^X//"
++
++# The HP-UX ksh and POSIX shell print the target directory to stdout
++# if CDPATH is set.
++if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
++
++# ### BEGIN LIBTOOL CONFIG
++
++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++
++# Shell to use when invoking shell scripts.
++SHELL=$lt_SHELL
++
++# Whether or not to build shared libraries.
++build_libtool_libs=$enable_shared
++
++# Whether or not to build static libraries.
++build_old_libs=$enable_static
++
++# Whether or not to add -lc for building shared libraries.
++build_libtool_need_lc=$need_lc
++
++# Whether or not to optimize for fast installation.
++fast_install=$enable_fast_install
++
++# The host system.
++host_alias=$host_alias
++host=$host
++
++# An echo program that does not interpret backslashes.
++echo=$lt_echo
++
++# The archiver.
++AR=$lt_AR
++AR_FLAGS=$lt_AR_FLAGS
++
++# The default C compiler.
++CC=$lt_CC
++
++# Is the compiler the GNU C compiler?
++with_gcc=$GCC
++
++# The linker used to build libraries.
++LD=$lt_LD
++
++# Whether we need hard or soft links.
++LN_S=$lt_LN_S
++
++# A BSD-compatible nm program.
++NM=$lt_NM
++
++# A symbol stripping program
++STRIP=$STRIP
++
++# Used to examine libraries when file_magic_cmd begins "file"
++MAGIC_CMD=$MAGIC_CMD
++
++# Used on cygwin: DLL creation program.
++DLLTOOL="$DLLTOOL"
++
++# Used on cygwin: object dumper.
++OBJDUMP="$OBJDUMP"
++
++# Used on cygwin: assembler.
++AS="$AS"
++
++# The name of the directory that contains temporary libtool files.
++objdir=$objdir
++
++# How to create reloadable object files.
++reload_flag=$lt_reload_flag
++reload_cmds=$lt_reload_cmds
++
++# How to pass a linker flag through the compiler.
++wl=$lt_wl
++
++# Object file suffix (normally "o").
++objext="$ac_objext"
++
++# Old archive suffix (normally "a").
++libext="$libext"
++
++# Executable file suffix (normally "").
++exeext="$exeext"
++
++# Additional compiler flags for building library objects.
++pic_flag=$lt_pic_flag
++pic_mode=$pic_mode
++
++# Does compiler simultaneously support -c and -o options?
++compiler_c_o=$lt_compiler_c_o
++
++# Can we write directly to a .lo ?
++compiler_o_lo=$lt_compiler_o_lo
++
++# Must we lock files when doing compilation ?
++need_locks=$lt_need_locks
++
++# 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
++
++# 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
++
++# Compiler flag to prevent dynamic linking.
++link_static_flag=$lt_link_static_flag
++
++# Compiler flag to turn off builtin functions.
++no_builtin_flag=$lt_no_builtin_flag
++
++# 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
++
++# Compiler flag to generate thread-safe objects.
++thread_safe_flag_spec=$lt_thread_safe_flag_spec
++
++# Library versioning type.
++version_type=$version_type
++
++# 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
++
++# Commands used to build and install an old-style archive.
++RANLIB=$lt_RANLIB
++old_archive_cmds=$lt_old_archive_cmds
++old_postinstall_cmds=$lt_old_postinstall_cmds
++old_postuninstall_cmds=$lt_old_postuninstall_cmds
++
++# 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 and install a shared archive.
++archive_cmds=$lt_archive_cmds
++archive_expsym_cmds=$lt_archive_expsym_cmds
++postinstall_cmds=$lt_postinstall_cmds
++postuninstall_cmds=$lt_postuninstall_cmds
++
++# Commands to strip libraries.
++old_striplib=$lt_old_striplib
++striplib=$lt_striplib
++
++# 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
++
++# Flag that allows shared libraries with undefined symbols to be built.
++allow_undefined_flag=$lt_allow_undefined_flag
++
++# Flag that forces no undefined symbols.
++no_undefined_flag=$lt_no_undefined_flag
++
++# Commands used to finish a libtool library installation in a directory.
++finish_cmds=$lt_finish_cmds
++
++# Same as above, but a single script fragment to be evaled but not shown.
++finish_eval=$lt_finish_eval
++
++# Take the output of nm and produce a listing of raw symbols and C names.
++global_symbol_pipe=$lt_global_symbol_pipe
++
++# Transform the output of nm in a proper C declaration
++global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
++
++# Transform the output of nm in a C name address pair
++global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
++
++# This is the shared library runtime path variable.
++runpath_var=$runpath_var
++
++# This is the shared library path variable.
++shlibpath_var=$shlibpath_var
++
++# Is shlibpath searched before the hard-coded library search path?
++shlibpath_overrides_runpath=$shlibpath_overrides_runpath
++
++# How to hardcode a shared library path into an executable.
++hardcode_action=$hardcode_action
++
++# Whether we should hardcode library paths into libraries.
++hardcode_into_libs=$hardcode_into_libs
++
++# 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
++
++# 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.so during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct=$hardcode_direct
++
++# 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
++
++# Variables whose values should be saved in libtool wrapper scripts and
++# restored at relink time.
++variables_saved_for_relink="$variables_saved_for_relink"
++
++# Whether libtool must link a program against all its dependency libraries.
++link_all_deplibs=$link_all_deplibs
++
++# 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
++
++# Fix the shell variable \$srcfile for the compiler.
++fix_srcfile_path="$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
++
++# The commands to extract the exported symbol list from a shared archive.
++extract_expsyms_cmds=$lt_extract_expsyms_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
++
++# ### END LIBTOOL CONFIG
++
++__EOF__
++
++ case $host_os in
++ aix3*)
++ cat <<\EOF >> "${ofile}T"
++
++# 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
++EOF
++ ;;
++ esac
++
++ case $host_os in
++ cygwin* | mingw* | pw32* | os2*)
++ cat <<'EOF' >> "${ofile}T"
++ # This is a source program that is used to create dlls on Windows
++ # Don't remove nor modify the starting and closing comments
++# /* ltdll.c starts here */
++# #define WIN32_LEAN_AND_MEAN
++# #include <windows.h>
++# #undef WIN32_LEAN_AND_MEAN
++# #include <stdio.h>
++#
++# #ifndef __CYGWIN__
++# # ifdef __CYGWIN32__
++# # define __CYGWIN__ __CYGWIN32__
++# # endif
++# #endif
++#
++# #ifdef __cplusplus
++# extern "C" {
++# #endif
++# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
++# #ifdef __cplusplus
++# }
++# #endif
++#
++# #ifdef __CYGWIN__
++# #include <cygwin/cygwin_dll.h>
++# DECLARE_CYGWIN_DLL( DllMain );
++# #endif
++# HINSTANCE __hDllInstance_base;
++#
++# BOOL APIENTRY
++# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
++# {
++# __hDllInstance_base = hInst;
++# return TRUE;
++# }
++# /* ltdll.c ends here */
++ # This is a source program that is used to create import libraries
++ # on Windows for dlls which lack them. Don't remove nor modify the
++ # starting and closing comments
++# /* impgen.c starts here */
++# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
++#
++# This file is part of GNU libtool.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# */
++#
++# #include <stdio.h> /* for printf() */
++# #include <unistd.h> /* for open(), lseek(), read() */
++# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
++# #include <string.h> /* for strdup() */
++#
++# /* O_BINARY isn't required (or even defined sometimes) under Unix */
++# #ifndef O_BINARY
++# #define O_BINARY 0
++# #endif
++#
++# static unsigned int
++# pe_get16 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[2];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 2);
++# return b[0] + (b[1]<<8);
++# }
++#
++# static unsigned int
++# pe_get32 (fd, offset)
++# int fd;
++# int offset;
++# {
++# unsigned char b[4];
++# lseek (fd, offset, SEEK_SET);
++# read (fd, b, 4);
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# static unsigned int
++# pe_as32 (ptr)
++# void *ptr;
++# {
++# unsigned char *b = ptr;
++# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
++# }
++#
++# int
++# main (argc, argv)
++# int argc;
++# char *argv[];
++# {
++# int dll;
++# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
++# unsigned long export_rva, export_size, nsections, secptr, expptr;
++# unsigned long name_rvas, nexp;
++# unsigned char *expdata, *erva;
++# char *filename, *dll_name;
++#
++# filename = argv[1];
++#
++# dll = open(filename, O_RDONLY|O_BINARY);
++# if (dll < 1)
++# return 1;
++#
++# dll_name = filename;
++#
++# for (i=0; filename[i]; i++)
++# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
++# dll_name = filename + i +1;
++#
++# pe_header_offset = pe_get32 (dll, 0x3c);
++# opthdr_ofs = pe_header_offset + 4 + 20;
++# num_entries = pe_get32 (dll, opthdr_ofs + 92);
++#
++# if (num_entries < 1) /* no exports */
++# return 1;
++#
++# export_rva = pe_get32 (dll, opthdr_ofs + 96);
++# export_size = pe_get32 (dll, opthdr_ofs + 100);
++# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
++# secptr = (pe_header_offset + 4 + 20 +
++# pe_get16 (dll, pe_header_offset + 4 + 16));
++#
++# expptr = 0;
++# for (i = 0; i < nsections; i++)
++# {
++# char sname[8];
++# unsigned long secptr1 = secptr + 40 * i;
++# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
++# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
++# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
++# lseek(dll, secptr1, SEEK_SET);
++# read(dll, sname, 8);
++# if (vaddr <= export_rva && vaddr+vsize > export_rva)
++# {
++# expptr = fptr + (export_rva - vaddr);
++# if (export_rva + export_size > vaddr + vsize)
++# export_size = vsize - (export_rva - vaddr);
++# break;
++# }
++# }
++#
++# expdata = (unsigned char*)malloc(export_size);
++# lseek (dll, expptr, SEEK_SET);
++# read (dll, expdata, export_size);
++# erva = expdata - export_rva;
++#
++# nexp = pe_as32 (expdata+24);
++# name_rvas = pe_as32 (expdata+32);
++#
++# printf ("EXPORTS\n");
++# for (i = 0; i<nexp; i++)
++# {
++# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
++# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
++# }
++#
++# return 0;
++# }
++# /* impgen.c ends here */
++
++EOF
++ ;;
++ esac
++
++ # 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" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
++
++ mv -f "${ofile}T" "$ofile" || \
++ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
++ chmod +x "$ofile"
++fi
++
++
++
++
++
++# This can be used to rebuild libtool when needed
++LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
++
++# Always use our own libtool.
++LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++
++# Prevent multiple expansion
++
++
++
++
++# Extract the first word of "perl", so it can be a program name with args.
++set dummy perl; ac_word=$2
++echo "$as_me:$LINENO: checking for $ac_word" >&5
++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
++if test "${ac_cv_path_PERL+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++ ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++done
++
++ ;;
++esac
++fi
++PERL=$ac_cv_path_PERL
++
++if test -n "$PERL"; then
++ echo "$as_me:$LINENO: result: $PERL" >&5
++echo "${ECHO_T}$PERL" >&6
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++
++
++
++if test "${ac_cv_header_asm_errno_h+set}" = set; then
++ echo "$as_me:$LINENO: checking for asm/errno.h" >&5
++echo $ECHO_N "checking for asm/errno.h... $ECHO_C" >&6
++if test "${ac_cv_header_asm_errno_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_asm_errno_h" >&5
++echo "${ECHO_T}$ac_cv_header_asm_errno_h" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking asm/errno.h usability" >&5
++echo $ECHO_N "checking asm/errno.h usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++@%:@include <asm/errno.h>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking asm/errno.h presence" >&5
++echo $ECHO_N "checking asm/errno.h presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++@%:@include <asm/errno.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: asm/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: asm/errno.h: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: present but cannot be compiled" >&5
++echo "$as_me: WARNING: asm/errno.h: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: asm/errno.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: asm/errno.h: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: asm/errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: asm/errno.h: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++@%:@@%:@ ------------------------------------------ @%:@@%:@
++@%:@@%:@ Report this to the AC_PACKAGE_NAME lists. @%:@@%:@
++@%:@@%:@ ------------------------------------------ @%:@@%:@
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for asm/errno.h" >&5
++echo $ECHO_N "checking for asm/errno.h... $ECHO_C" >&6
++if test "${ac_cv_header_asm_errno_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_header_asm_errno_h=$ac_header_preproc
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_asm_errno_h" >&5
++echo "${ECHO_T}$ac_cv_header_asm_errno_h" >&6
++
++fi
++if test $ac_cv_header_asm_errno_h = yes; then
++ :
++else
++ { { echo "$as_me:$LINENO: error: *** Unable to find asm/errno.h!!!" >&5
++echo "$as_me: error: *** Unable to find asm/errno.h!!!" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++
++
++
++if test "${ac_cv_header_linux_atmsap_h+set}" = set; then
++ echo "$as_me:$LINENO: checking for linux/atmsap.h" >&5
++echo $ECHO_N "checking for linux/atmsap.h... $ECHO_C" >&6
++if test "${ac_cv_header_linux_atmsap_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_linux_atmsap_h" >&5
++echo "${ECHO_T}$ac_cv_header_linux_atmsap_h" >&6
++else
++ # Is the header compilable?
++echo "$as_me:$LINENO: checking linux/atmsap.h usability" >&5
++echo $ECHO_N "checking linux/atmsap.h usability... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++$ac_includes_default
++@%:@include <linux/atmsap.h>
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_header_compiler=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_header_compiler=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
++echo "${ECHO_T}$ac_header_compiler" >&6
++
++# Is the header present?
++echo "$as_me:$LINENO: checking linux/atmsap.h presence" >&5
++echo $ECHO_N "checking linux/atmsap.h presence... $ECHO_C" >&6
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++@%:@include <linux/atmsap.h>
++_ACEOF
++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } >/dev/null; then
++ if test -s conftest.err; then
++ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
++ else
++ ac_cpp_err=
++ fi
++else
++ ac_cpp_err=yes
++fi
++if test -z "$ac_cpp_err"; then
++ ac_header_preproc=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ ac_header_preproc=no
++fi
++rm -f conftest.err conftest.$ac_ext
++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
++echo "${ECHO_T}$ac_header_preproc" >&6
++
++# So? What about this header?
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: linux/atmsap.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: linux/atmsap.h: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
++ ;;
++ no:yes:* )
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: present but cannot be compiled" >&5
++echo "$as_me: WARNING: linux/atmsap.h: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: linux/atmsap.h: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: linux/atmsap.h: section \"Present But Cannot Be Compiled\"" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: linux/atmsap.h: in the future, the compiler will take precedence" >&2;}
++ (
++ cat <<\_ASBOX
++@%:@@%:@ ------------------------------------------ @%:@@%:@
++@%:@@%:@ Report this to the AC_PACKAGE_NAME lists. @%:@@%:@
++@%:@@%:@ ------------------------------------------ @%:@@%:@
++_ASBOX
++ ) |
++ sed "s/^/$as_me: WARNING: /" >&2
++ ;;
++esac
++echo "$as_me:$LINENO: checking for linux/atmsap.h" >&5
++echo $ECHO_N "checking for linux/atmsap.h... $ECHO_C" >&6
++if test "${ac_cv_header_linux_atmsap_h+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_cv_header_linux_atmsap_h=$ac_header_preproc
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_linux_atmsap_h" >&5
++echo "${ECHO_T}$ac_cv_header_linux_atmsap_h" >&6
++
++fi
++if test $ac_cv_header_linux_atmsap_h = yes; then
++ :
++else
++ { { echo "$as_me:$LINENO: error: *** Unable to find linux/atmsap.h!!!" >&5
++echo "$as_me: error: *** Unable to find linux/atmsap.h!!!" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++
++
++
++
++echo "$as_me:$LINENO: checking for main in -lresolv" >&5
++echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6
++if test "${ac_cv_lib_resolv_main+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lresolv $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++
++int
++main ()
++{
++main ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_resolv_main=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_resolv_main=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
++echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6
++if test $ac_cv_lib_resolv_main = yes; then
++ cat >>confdefs.h <<_ACEOF
++@%:@define HAVE_LIBRESOLV 1
++_ACEOF
++
++ LIBS="-lresolv $LIBS"
++
++else
++ { { echo "$as_me:$LINENO: error: *** Unable to find libresolv!!!" >&5
++echo "$as_me: error: *** Unable to find libresolv!!!" >&2;}
++ { (exit 1); exit 1; }; }
++
++fi
++
++
++LIBS=""
++
++INCLUDES="-I\$(top_srcdir)/src/include"
++CFLAGS="$INCLUDES $CFLAGS -Wall -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes"
++YACC="$YACC -d"
++
++cat >>confdefs.h <<\_ACEOF
++@%:@define YY_USE_CONST 1
++_ACEOF
++
++
++atmsigd_conf_dir=` test "x$exec_prefix" = xNONE && exec_prefix=$ac_default_prefix
++ test "x$prefix" = xNONE && prefix=${exec_prefix}
++ eval echo "$sysconfdir"`
++cat >>confdefs.h <<_ACEOF
++@%:@define ATMSIGD_CONF "$atmsigd_conf_dir/atmsigd.conf"
++_ACEOF
++
++
++
++# Check whether --with-uni or --without-uni was given.
++if test "${with_uni+set}" = set; then
++ withval="$with_uni"
++
++ case "$with_uni" in
++ "3.0" ) cat >>confdefs.h <<\_ACEOF
++@%:@define UNI30 1
++_ACEOF
++
++ ;;
++ "3.1" ) cat >>confdefs.h <<\_ACEOF
++@%:@define UNI31 1
++_ACEOF
++
++ ;;
++ "4.0" ) cat >>confdefs.h <<\_ACEOF
++@%:@define UNI40 1
++_ACEOF
++
++ ;;
++ *)
++ cat >>confdefs.h <<\_ACEOF
++@%:@define DYNAMIC_UNI 1
++_ACEOF
++
++ { echo "$as_me:$LINENO: WARNING: *** UNI version not specified correctly. Defaulting to dynamic UNI." >&5
++echo "$as_me: WARNING: *** UNI version not specified correctly. Defaulting to dynamic UNI." >&2;}
++ esac
++
++else
++ cat >>confdefs.h <<\_ACEOF
++@%:@define DYNAMIC_UNI 1
++_ACEOF
++
++
++fi;
++
++# Check whether --enable-allow_uni30 or --disable-allow_uni30 was given.
++if test "${enable_allow_uni30+set}" = set; then
++ enableval="$enable_allow_uni30"
++
++ if test "$with_uni" = "3.1" ; then
++ cat >>confdefs.h <<\_ACEOF
++@%:@define ALLOW_UNI30 1
++_ACEOF
++
++ else
++ { echo "$as_me:$LINENO: WARNING: *** Allow UNI 3.0 was not enabled. It is only valid when UNI 3.1 is specified as the default via --with-uni." >&5
++echo "$as_me: WARNING: *** Allow UNI 3.0 was not enabled. It is only valid when UNI 3.1 is specified as the default via --with-uni." >&2;}
++ fi
++
++
++fi;
++
++# Check whether --enable-q2963_1 or --disable-q2963_1 was given.
++if test "${enable_q2963_1+set}" = set; then
++ enableval="$enable_q2963_1"
++
++ if test "$with_uni" = "4.0" ; then
++ cat >>confdefs.h <<\_ACEOF
++@%:@define Q2963_1 1
++_ACEOF
++
++ else
++ { echo "$as_me:$LINENO: WARNING: *** Q.2963.1 was not enabled. It is only valid when UNI 4.0 is specified as the default via --with-uni." >&5
++echo "$as_me: WARNING: *** Q.2963.1 was not enabled. It is only valid when UNI 4.0 is specified as the default via --with-uni." >&2;}
++ fi
++
++
++fi;
++
++# Check whether --enable-cisco or --disable-cisco was given.
++if test "${enable_cisco+set}" = set; then
++ enableval="$enable_cisco"
++ cat >>confdefs.h <<\_ACEOF
++@%:@define CISCO 1
++_ACEOF
++
++
++fi;
++
++# Check whether --enable-thomflex or --disable-thomflex was given.
++if test "${enable_thomflex+set}" = set; then
++ enableval="$enable_thomflex"
++ cat >>confdefs.h <<\_ACEOF
++@%:@define THOMFLEX 1
++_ACEOF
++
++
++fi;
++
++cat >>confdefs.h <<\_ACEOF
++@%:@define BROKEN_POLL 1
++_ACEOF
++
++
++# Check whether --enable-mpoa_1_1 or --disable-mpoa_1_1 was given.
++if test "${enable_mpoa_1_1+set}" = set; then
++ enableval="$enable_mpoa_1_1"
++ cat >>confdefs.h <<\_ACEOF
++@%:@define MPOA_1_1 1
++_ACEOF
++
++
++fi;
++
++# Check whether --enable-mpr or --disable-mpr was given.
++if test "${enable_mpr+set}" = set; then
++ enableval="$enable_mpr"
++
++ case "$enable_mpr" in
++ "" | y | ye | yes | Y | YE | YES )
++
++echo "$as_me:$LINENO: checking for main in -lmpr" >&5
++echo $ECHO_N "checking for main in -lmpr... $ECHO_C" >&6
++if test "${ac_cv_lib_mpr_main+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lmpr $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++
++int
++main ()
++{
++main ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_mpr_main=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_mpr_main=no
++fi
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_mpr_main" >&5
++echo "${ECHO_T}$ac_cv_lib_mpr_main" >&6
++if test $ac_cv_lib_mpr_main = yes; then
++ cat >>confdefs.h <<_ACEOF
++@%:@define HAVE_LIBMPR 1
++_ACEOF
++
++ LIBS="-lmpr $LIBS"
++
++else
++
++ { echo "$as_me:$LINENO: WARNING: *** Could not find libmpr! Is MPR installed?" >&5
++echo "$as_me: WARNING: *** Could not find libmpr! Is MPR installed?" >&2;}
++
++
++fi
++
++ ;;
++ esac
++
++
++fi;
++
++
++ ac_config_files="$ac_config_files Makefile doc/Makefile m4/Makefile src/Makefile src/include/Makefile src/lib/Makefile src/br2684/Makefile"
++cat >confcache <<\_ACEOF
++# This file is a shell script that caches the results of configure
++# tests run on this system so they can be shared between configure
++# scripts and configure runs, see configure's option --config-cache.
++# It is not useful on other systems. If it contains results you don't
++# want to keep, you may remove or edit it.
++#
++# config.status only pays attention to the cache file if you give it
++# the --recheck option to rerun configure.
++#
++# `ac_cv_env_foo' variables (set or unset) will be overridden when
++# loading this file, other *unset* `ac_cv_foo' will be assigned the
++# following values.
++
++_ACEOF
++
++# The following way of writing the cache mishandles newlines in values,
++# but we know of no workaround that is simple, portable, and efficient.
++# So, don't put newlines in cache variables' values.
++# 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.
++{
++ (set) 2>&1 |
++ case `(ac_space=' '; set | grep ac_space) 2>&1` in
++ *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 \
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ ;;
++ esac;
++} |
++ sed '
++ t clear
++ : clear
++ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
++ t end
++ /^ac_cv_env/!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" && echo "updating cache $cache_file"
++ cat confcache >$cache_file
++ else
++ echo "not updating unwritable cache $cache_file"
++ 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}'
++
++# 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
++
++DEFS=-DHAVE_CONFIG_H
++
++ac_libobjs=
++ac_ltlibobjs=
++for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
++ # 1. Remove the extension, and $U if already installed.
++ ac_i=`echo "$ac_i" |
++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
++ # 2. Add them.
++ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
++ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
++done
++LIB@&t@OBJS=$ac_libobjs
++
++LTLIBOBJS=$ac_ltlibobjs
++
++
++
++: ${CONFIG_STATUS=./config.status}
++ac_clean_files_save=$ac_clean_files
++ac_clean_files="$ac_clean_files $CONFIG_STATUS"
++{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
++echo "$as_me: creating $CONFIG_STATUS" >&6;}
++cat >$CONFIG_STATUS <<_ACEOF
++#! $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}
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++## --------------------- ##
++## M4sh Initialization. ##
++## --------------------- ##
++
++# Be Bourne compatible
++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
++ emulate sh
++ NULLCMD=:
++ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
++ # is contrary to our usage. Disable this feature.
++ alias -g '${1+"$@"}'='"$@"'
++elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
++ set -o posix
++fi
++DUALCASE=1; export DUALCASE # for MKS sh
++
++# Support unset when possible.
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
++ as_unset=unset
++else
++ as_unset=false
++fi
++
++
++# Work around bugs in pre-3.0 UWIN ksh.
++$as_unset ENV MAIL MAILPATH
++PS1='$ '
++PS2='> '
++PS4='+ '
++
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ $as_unset $as_var
++ fi
++done
++
++# Required to use basename.
++if expr a : '\(a\)' >/dev/null 2>&1; 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
++
++
++# Name of the executable.
++as_me=`$as_basename "$0" ||
++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)$' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X/"$0" |
++ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
++ /^X\/\(\/\/\)$/{ s//\1/; q; }
++ /^X\/\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++
++
++# PATH needs CR, and LINENO needs CR and PATH.
++# 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
++
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" || {
++ # Find who we are. Look in the path if we contain no path at all
++ # relative or not.
++ 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
++
++ ;;
++ 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
++ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
++echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
++ { (exit 1); exit 1; }; }
++ fi
++ case $CONFIG_SHELL in
++ '')
++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for as_base in sh bash ksh sh5; do
++ case $as_dir in
++ /*)
++ if ("$as_dir/$as_base" -c '
++ as_lineno_1=$LINENO
++ as_lineno_2=$LINENO
++ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
++ test "x$as_lineno_1" != "x$as_lineno_2" &&
++ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
++ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
++ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
++ CONFIG_SHELL=$as_dir/$as_base
++ export CONFIG_SHELL
++ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
++ fi;;
++ esac
++ done
++done
++;;
++ esac
++
++ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
++ # uniformly replaced by the line number. The first 'sed' inserts a
++ # line-number line before each line; the second 'sed' does the real
++ # work. The second script uses 'N' to pair each line-number line
++ # with the numbered line, and appends trailing '-' during
++ # substitution so that $LINENO is not a special case at line end.
++ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
++ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
++ sed '=' <$as_myself |
++ sed '
++ N
++ s,$,-,
++ : loop
++ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
++ t loop
++ s,-$,,
++ s,^['$as_cr_digits']*\n,,
++ ' >$as_me.lineno &&
++ chmod +x $as_me.lineno ||
++ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
++echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
++ { (exit 1); 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 sensible to this).
++ . ./$as_me.lineno
++ # Exit status is that of the last command.
++ exit
++}
++
++
++case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
++ *c*,-n*) ECHO_N= ECHO_C='
++' ECHO_T=' ' ;;
++ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
++ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
++esac
++
++if expr a : '\(a\)' >/dev/null 2>&1; then
++ as_expr=expr
++else
++ as_expr=false
++fi
++
++rm -f conf$$ conf$$.exe conf$$.file
++echo >conf$$.file
++if ln -s conf$$.file conf$$ 2>/dev/null; then
++ # We could just check for DJGPP; but this test a) works b) is more generic
++ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
++ if test -f conf$$.exe; then
++ # Don't use ln at all; we don't have any links
++ as_ln_s='cp -p'
++ else
++ as_ln_s='ln -s'
++ fi
++elif ln conf$$.file conf$$ 2>/dev/null; then
++ as_ln_s=ln
++else
++ as_ln_s='cp -p'
++fi
++rm -f conf$$ conf$$.exe conf$$.file
++
++if mkdir -p . 2>/dev/null; then
++ as_mkdir_p=:
++else
++ test -d ./-p && rmdir ./-p
++ as_mkdir_p=false
++fi
++
++as_executable_p="test -f"
++
++# 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'"
++
++
++# IFS
++# We need space, tab and new line, in precisely that order.
++as_nl='
++'
++IFS=" $as_nl"
++
++# CDPATH.
++$as_unset CDPATH
++
++exec 6>&1
++
++# Open the log real soon, to keep \$[0] and so on meaningful, and to
++# report actual input values of CONFIG_FILES etc. instead of their
++# values after options handling. Logging --version etc. is OK.
++exec 5>>config.log
++{
++ echo
++ sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
++@%:@@%:@ Running $as_me. @%:@@%:@
++_ASBOX
++} >&5
++cat >&5 <<_CSEOF
++
++This file was extended by $as_me, which was
++generated by GNU Autoconf 2.59. Invocation command line was
++
++ CONFIG_FILES = $CONFIG_FILES
++ CONFIG_HEADERS = $CONFIG_HEADERS
++ CONFIG_LINKS = $CONFIG_LINKS
++ CONFIG_COMMANDS = $CONFIG_COMMANDS
++ $ $0 $@
++
++_CSEOF
++echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
++echo >&5
++_ACEOF
++
++# Files that config.status was made for.
++if test -n "$ac_config_files"; then
++ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_headers"; then
++ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_links"; then
++ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
++fi
++
++if test -n "$ac_config_commands"; then
++ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
++fi
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++ac_cs_usage="\
++\`$as_me' instantiates files from templates according to the
++current configuration.
++
++Usage: $0 [OPTIONS] [FILE]...
++
++ -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
++ --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 <bug-autoconf@gnu.org>."
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++ac_cs_version="\\
++config.status
++configured by $0, generated by GNU Autoconf 2.59,
++ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
++
++Copyright (C) 2003 Free Software Foundation, Inc.
++This config.status script is free software; the Free Software Foundation
++gives unlimited permission to copy, distribute and modify it."
++srcdir=$srcdir
++INSTALL="$INSTALL"
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++# If no file are specified by the user, then we need to provide default
++# value. By we need to know if files were specified by the user.
++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
++ ;;
++ *) # This is not an option, so the user has probably given explicit
++ # arguments.
++ ac_option=$1
++ ac_need_defaults=false;;
++ esac
++
++ case $ac_option in
++ # Handling of the options.
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ ac_cs_recheck=: ;;
++ --version | --vers* | -V )
++ echo "$ac_cs_version"; exit 0 ;;
++ --he | --h)
++ # Conflict between --help and --header
++ { { echo "$as_me:$LINENO: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: ambiguous option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; };;
++ --help | --hel | -h )
++ echo "$ac_cs_usage"; exit 0 ;;
++ --debug | --d* | -d )
++ debug=: ;;
++ --file | --fil | --fi | --f )
++ $ac_shift
++ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
++ ac_need_defaults=false;;
++ --header | --heade | --head | --hea )
++ $ac_shift
++ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
++ ac_need_defaults=false;;
++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
++ | -silent | --silent | --silen | --sile | --sil | --si | --s)
++ ac_cs_silent=: ;;
++
++ # This is an error.
++ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&5
++echo "$as_me: error: unrecognized option: $1
++Try \`$0 --help' for more information." >&2;}
++ { (exit 1); exit 1; }; } ;;
++
++ *) ac_config_targets="$ac_config_targets $1" ;;
++
++ 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
++if \$ac_cs_recheck; then
++ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
++ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
++fi
++
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++#
++# INIT-COMMANDS section.
++#
++
++
++
++_ACEOF
++
++
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_config_target in $ac_config_targets
++do
++ case "$ac_config_target" in
++ # Handling of arguments.
++ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
++ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
++ "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
++ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
++ "src/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;;
++ "src/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
++ "src/br2684/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/br2684/Makefile" ;;
++ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
++ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
++ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
++echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
++ { (exit 1); exit 1; }; };;
++ 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 to put it here, and in addition,
++# creating and moving files from /tmp can sometimes cause problems.
++# Create a temporary directory, and hook for its removal unless debugging.
++$debug ||
++{
++ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
++ trap '{ (exit 1); exit 1; }' 1 2 13 15
++}
++
++# Create a (secure) tmp directory for tmp files.
++
++{
++ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
++ test -n "$tmp" && test -d "$tmp"
++} ||
++{
++ tmp=./confstat$$-$RANDOM
++ (umask 077 && mkdir $tmp)
++} ||
++{
++ echo "$me: cannot create a temporary directory in ." >&2
++ { (exit 1); exit 1; }
++}
++
++_ACEOF
++
++cat >>$CONFIG_STATUS <<_ACEOF
++
++#
++# CONFIG_FILES section.
++#
++
++# No need to generate the scripts if there are no CONFIG_FILES.
++# This happens for instance when ./config.status config.h
++if test -n "\$CONFIG_FILES"; then
++ # Protect against being on the right side of a sed subst in config.status.
++ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
++ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
++s,@SHELL@,$SHELL,;t t
++s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
++s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
++s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
++s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
++s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
++s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
++s,@exec_prefix@,$exec_prefix,;t t
++s,@prefix@,$prefix,;t t
++s,@program_transform_name@,$program_transform_name,;t t
++s,@bindir@,$bindir,;t t
++s,@sbindir@,$sbindir,;t t
++s,@libexecdir@,$libexecdir,;t t
++s,@datadir@,$datadir,;t t
++s,@sysconfdir@,$sysconfdir,;t t
++s,@sharedstatedir@,$sharedstatedir,;t t
++s,@localstatedir@,$localstatedir,;t t
++s,@libdir@,$libdir,;t t
++s,@includedir@,$includedir,;t t
++s,@oldincludedir@,$oldincludedir,;t t
++s,@infodir@,$infodir,;t t
++s,@mandir@,$mandir,;t t
++s,@build_alias@,$build_alias,;t t
++s,@host_alias@,$host_alias,;t t
++s,@target_alias@,$target_alias,;t t
++s,@DEFS@,$DEFS,;t t
++s,@ECHO_C@,$ECHO_C,;t t
++s,@ECHO_N@,$ECHO_N,;t t
++s,@ECHO_T@,$ECHO_T,;t t
++s,@LIBS@,$LIBS,;t t
++s,@build@,$build,;t t
++s,@build_cpu@,$build_cpu,;t t
++s,@build_vendor@,$build_vendor,;t t
++s,@build_os@,$build_os,;t t
++s,@host@,$host,;t t
++s,@host_cpu@,$host_cpu,;t t
++s,@host_vendor@,$host_vendor,;t t
++s,@host_os@,$host_os,;t t
++s,@target@,$target,;t t
++s,@target_cpu@,$target_cpu,;t t
++s,@target_vendor@,$target_vendor,;t t
++s,@target_os@,$target_os,;t t
++s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
++s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
++s,@INSTALL_DATA@,$INSTALL_DATA,;t t
++s,@PACKAGE@,$PACKAGE,;t t
++s,@VERSION@,$VERSION,;t t
++s,@ACLOCAL@,$ACLOCAL,;t t
++s,@AUTOCONF@,$AUTOCONF,;t t
++s,@AUTOMAKE@,$AUTOMAKE,;t t
++s,@AUTOHEADER@,$AUTOHEADER,;t t
++s,@MAKEINFO@,$MAKEINFO,;t t
++s,@SET_MAKE@,$SET_MAKE,;t t
++s,@LIBVER_CURRENT@,$LIBVER_CURRENT,;t t
++s,@LIBVER_REVISION@,$LIBVER_REVISION,;t t
++s,@LIBVER_AGE@,$LIBVER_AGE,;t t
++s,@CC@,$CC,;t t
++s,@CFLAGS@,$CFLAGS,;t t
++s,@LDFLAGS@,$LDFLAGS,;t t
++s,@CPPFLAGS@,$CPPFLAGS,;t t
++s,@ac_ct_CC@,$ac_ct_CC,;t t
++s,@EXEEXT@,$EXEEXT,;t t
++s,@OBJEXT@,$OBJEXT,;t t
++s,@LEX@,$LEX,;t t
++s,@LEXLIB@,$LEXLIB,;t t
++s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
++s,@YACC@,$YACC,;t t
++s,@LN_S@,$LN_S,;t t
++s,@ECHO@,$ECHO,;t t
++s,@RANLIB@,$RANLIB,;t t
++s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
++s,@STRIP@,$STRIP,;t t
++s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
++s,@CPP@,$CPP,;t t
++s,@EGREP@,$EGREP,;t t
++s,@LIBTOOL@,$LIBTOOL,;t t
++s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t
++s,@PERL@,$PERL,;t t
++s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t
++s,@LTLIBOBJS@,$LTLIBOBJS,;t t
++CEOF
++
++_ACEOF
++
++ cat >>$CONFIG_STATUS <<\_ACEOF
++ # Split the substitutions into bite-sized pieces for seds with
++ # small command number limits, like on Digital OSF/1 and HP-UX.
++ ac_max_sed_lines=48
++ ac_sed_frag=1 # Number of current file.
++ ac_beg=1 # First line for current file.
++ ac_end=$ac_max_sed_lines # Line after last line for current file.
++ ac_more_lines=:
++ ac_sed_cmds=
++ while $ac_more_lines; do
++ if test $ac_beg -gt 1; then
++ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ else
++ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
++ fi
++ if test ! -s $tmp/subs.frag; then
++ ac_more_lines=false
++ else
++ # The purpose of the label and of the branching condition is to
++ # speed up the sed processing (if there are no `@' at all, there
++ # is no need to browse any of the substitutions).
++ # These are the two extra sed commands mentioned above.
++ (echo ':t
++ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
++ else
++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
++ fi
++ ac_sed_frag=`expr $ac_sed_frag + 1`
++ ac_beg=$ac_end
++ ac_end=`expr $ac_end + $ac_max_sed_lines`
++ fi
++ done
++ if test -z "$ac_sed_cmds"; then
++ ac_sed_cmds=cat
++ fi
++fi # test -n "$CONFIG_FILES"
++
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++ case $ac_file in
++ - | *:- | *:-:* ) # input from stdin
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ * ) ac_file_in=$ac_file.in ;;
++ esac
++
++ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
++ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++
++ case $INSTALL in
++ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
++ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
++ esac
++
++ # 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. */
++ if test x"$ac_file" = x-; then
++ configure_input=
++ else
++ configure_input="$ac_file. "
++ fi
++ configure_input=$configure_input"Generated from `echo $ac_file_in |
++ sed 's,.*/,,'` by configure."
++
++ # First look for the input files in the build tree, otherwise in the
++ # src tree.
++ ac_file_inputs=`IFS=:
++ for f in $ac_file_in; do
++ case $f in
++ -) echo $tmp/stdin ;;
++ [\\/$]*)
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ echo "$f";;
++ *) # Relative
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ fi;;
++ esac
++ done` || { (exit 1); exit 1; }
++
++ if test x"$ac_file" != x-; then
++ { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++ rm -f "$ac_file"
++ fi
++_ACEOF
++cat >>$CONFIG_STATUS <<_ACEOF
++ sed "$ac_vpsub
++$extrasub
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++:t
++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
++s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t
++s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
++s,@INSTALL@,$ac_INSTALL,;t t
++" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
++ rm -f $tmp/stdin
++ if test x"$ac_file" != x-; then
++ mv $tmp/out $ac_file
++ else
++ cat $tmp/out
++ rm -f $tmp/out
++ fi
++
++done
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++#
++# CONFIG_HEADER section.
++#
++
++# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
++# NAME is the cpp macro being defined and VALUE is the value it is being given.
++#
++# ac_d sets the value in "#define NAME VALUE" lines.
++ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
++ac_dB='[ ].*$,\1#\2'
++ac_dC=' '
++ac_dD=',;t'
++# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
++ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
++ac_uB='$,\1#\2define\3'
++ac_uC=' '
++ac_uD=',;t'
++
++for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
++ case $ac_file in
++ - | *:- | *:-:* ) # input from stdin
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ * ) ac_file_in=$ac_file.in ;;
++ esac
++
++ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++
++ # First look for the input files in the build tree, otherwise in the
++ # src tree.
++ ac_file_inputs=`IFS=:
++ for f in $ac_file_in; do
++ case $f in
++ -) echo $tmp/stdin ;;
++ [\\/$]*)
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ # Do quote $f, to prevent DOS paths from being IFS'd.
++ echo "$f";;
++ *) # Relative
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++echo "$as_me: error: cannot find input file: $f" >&2;}
++ { (exit 1); exit 1; }; }
++ fi;;
++ esac
++ done` || { (exit 1); exit 1; }
++ # Remove the trailing spaces.
++ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
++
++_ACEOF
++
++# Transform confdefs.h into two sed scripts, `conftest.defines' and
++# `conftest.undefs', that substitutes the proper values into
++# config.h.in to produce config.h. The first handles `#define'
++# templates, and the second `#undef' templates.
++# And first: Protect against being on the right side of a sed subst in
++# config.status. Protect against being in an unquoted here document
++# in config.status.
++rm -f conftest.defines conftest.undefs
++# Using a here document instead of a string reduces the quoting nightmare.
++# Putting comments in sed scripts is not portable.
++#
++# `end' is used to avoid that the second main sed command (meant for
++# 0-ary CPP macros) applies to n-ary macro definitions.
++# See the Autoconf documentation for `clear'.
++cat >confdef2sed.sed <<\_ACEOF
++s/[\\&,]/\\&/g
++s,[\\$`],\\&,g
++t clear
++: clear
++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
++t end
++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
++: end
++_ACEOF
++# If some macros were called several times there might be several times
++# the same #defines, which is useless. Nevertheless, we may not want to
++# sort them, since we want the *last* AC-DEFINE to be honored.
++uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
++sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
++rm -f confdef2sed.sed
++
++# This sed command replaces #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.
++cat >>conftest.undefs <<\_ACEOF
++s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
++_ACEOF
++
++# Break up conftest.defines because some shells have a limit on the size
++# of here documents, and old seds have small limits too (100 cmds).
++echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
++echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
++echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
++echo ' :' >>$CONFIG_STATUS
++rm -f conftest.tail
++while grep . conftest.defines >/dev/null
++do
++ # Write a limited-size here document to $tmp/defines.sed.
++ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
++ # Speed up: don't consider the non `#define' lines.
++ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
++ # Work around the forget-to-reset-the-flag bug.
++ echo 't clr' >>$CONFIG_STATUS
++ echo ': clr' >>$CONFIG_STATUS
++ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
++ echo 'CEOF
++ sed -f $tmp/defines.sed $tmp/in >$tmp/out
++ rm -f $tmp/in
++ mv $tmp/out $tmp/in
++' >>$CONFIG_STATUS
++ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
++ rm -f conftest.defines
++ mv conftest.tail conftest.defines
++done
++rm -f conftest.defines
++echo ' fi # grep' >>$CONFIG_STATUS
++echo >>$CONFIG_STATUS
++
++# Break up conftest.undefs because some shells have a limit on the size
++# of here documents, and old seds have small limits too (100 cmds).
++echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
++rm -f conftest.tail
++while grep . conftest.undefs >/dev/null
++do
++ # Write a limited-size here document to $tmp/undefs.sed.
++ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
++ # Speed up: don't consider the non `#undef'
++ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
++ # Work around the forget-to-reset-the-flag bug.
++ echo 't clr' >>$CONFIG_STATUS
++ echo ': clr' >>$CONFIG_STATUS
++ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
++ echo 'CEOF
++ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
++ rm -f $tmp/in
++ mv $tmp/out $tmp/in
++' >>$CONFIG_STATUS
++ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
++ rm -f conftest.undefs
++ mv conftest.tail conftest.undefs
++done
++rm -f conftest.undefs
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++ # 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. */
++ if test x"$ac_file" = x-; then
++ echo "/* Generated by configure. */" >$tmp/config.h
++ else
++ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
++ fi
++ cat $tmp/in >>$tmp/config.h
++ rm -f $tmp/in
++ if test x"$ac_file" != x-; then
++ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
++ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
++echo "$as_me: $ac_file is unchanged" >&6;}
++ else
++ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_file" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ rm -f $ac_file
++ mv $tmp/config.h $ac_file
++ fi
++ else
++ cat $tmp/config.h
++ rm -f $tmp/config.h
++ fi
++done
++_ACEOF
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++#
++# CONFIG_COMMANDS section.
++#
++for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
++ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
++ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
++$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$ac_dest" : 'X\(//\)[^/]' \| \
++ X"$ac_dest" : 'X\(//\)$' \| \
++ X"$ac_dest" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$ac_dest" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
++ ac_builddir=.
++
++if test "$ac_dir" != .; then
++ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
++ # A "../" for each directory in $ac_dir_suffix.
++ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
++else
++ ac_dir_suffix= ac_top_builddir=
++fi
++
++case $srcdir in
++ .) # No --srcdir option. We are building in place.
++ ac_srcdir=.
++ if test -z "$ac_top_builddir"; then
++ ac_top_srcdir=.
++ else
++ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
++ fi ;;
++ [\\/]* | ?:[\\/]* ) # Absolute path.
++ ac_srcdir=$srcdir$ac_dir_suffix;
++ ac_top_srcdir=$srcdir ;;
++ *) # Relative path.
++ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
++ ac_top_srcdir=$ac_top_builddir$srcdir ;;
++esac
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
++
++
++ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
++echo "$as_me: executing $ac_dest commands" >&6;}
++ case $ac_dest in
++ default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
++ esac
++done
++_ACEOF
++
++cat >>$CONFIG_STATUS <<\_ACEOF
++
++{ (exit 0); exit 0; }
++_ACEOF
++chmod +x $CONFIG_STATUS
++ac_clean_files=$ac_clean_files_save
++
++
++# 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 || { (exit 1); exit 1; }
++fi
++
++
+diff -urN linux-atm.old/autom4te.cache/requests linux-atm.dev/autom4te.cache/requests
+--- linux-atm.old/autom4te.cache/requests 1970-01-01 01:00:00.000000000 +0100
++++ linux-atm.dev/autom4te.cache/requests 2005-08-23 01:12:41.188174872 +0200
+@@ -0,0 +1,116 @@
++# This file was generated by Autom4te Sat Jan 8 16:59:54 PST 2005.
++# It contains the lists of macros which have been traced.
++# It can be safely removed.
++
++@request = (
++ bless( [
++ '0',
++ 1,
++ [
++ '/usr/share/autoconf'
++ ],
++ [
++ '/usr/share/autoconf/autoconf/autoconf.m4f',
++ 'aclocal.m4',
++ 'configure.in'
++ ],
++ {
++ 'm4_pattern_forbid' => 1,
++ 'AC_CONFIG_LIBOBJ_DIR' => 1,
++ 'AC_TYPE_OFF_T' => 1,
++ 'AC_C_VOLATILE' => 1,
++ 'AC_FUNC_CLOSEDIR_VOID' => 1,
++ 'AC_REPLACE_FNMATCH' => 1,
++ 'AC_PROG_LIBTOOL' => 1,
++ 'AC_FUNC_STAT' => 1,
++ 'AC_HEADER_TIME' => 1,
++ 'AC_FUNC_WAIT3' => 1,
++ 'AM_AUTOMAKE_VERSION' => 1,
++ 'AC_STRUCT_TM' => 1,
++ 'AC_FUNC_LSTAT' => 1,
++ 'AC_TYPE_MODE_T' => 1,
++ 'AC_FUNC_GETMNTENT' => 1,
++ 'AC_FUNC_STRTOD' => 1,
++ 'AC_CHECK_HEADERS' => 1,
++ 'AC_FUNC_STRNLEN' => 1,
++ 'm4_sinclude' => 1,
++ 'AC_PROG_CXX' => 1,
++ 'AC_PATH_X' => 1,
++ 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
++ 'AC_PROG_AWK' => 1,
++ '_m4_warn' => 1,
++ 'AC_HEADER_STDC' => 1,
++ 'AC_HEADER_MAJOR' => 1,
++ 'AC_FUNC_ERROR_AT_LINE' => 1,
++ 'AC_PROG_GCC_TRADITIONAL' => 1,
++ 'AC_LIBSOURCE' => 1,
++ 'AC_FUNC_MBRTOWC' => 1,
++ 'AC_STRUCT_ST_BLOCKS' => 1,
++ 'AC_TYPE_SIGNAL' => 1,
++ 'AC_TYPE_UID_T' => 1,
++ 'AC_CONFIG_AUX_DIR' => 1,
++ 'AC_PROG_MAKE_SET' => 1,
++ 'sinclude' => 1,
++ 'm4_pattern_allow' => 1,
++ 'AC_DEFINE_TRACE_LITERAL' => 1,
++ 'AC_FUNC_STRERROR_R' => 1,
++ 'AC_PROG_CC' => 1,
++ 'AC_FUNC_FORK' => 1,
++ 'AC_DECL_SYS_SIGLIST' => 1,
++ 'AC_FUNC_VPRINTF' => 1,
++ 'AC_FUNC_STRCOLL' => 1,
++ 'AC_PROG_YACC' => 1,
++ 'AC_INIT' => 1,
++ 'AC_STRUCT_TIMEZONE' => 1,
++ 'AC_FUNC_CHOWN' => 1,
++ 'AC_SUBST' => 1,
++ 'AC_FUNC_ALLOCA' => 1,
++ 'AC_CANONICAL_HOST' => 1,
++ 'AC_FUNC_GETPGRP' => 1,
++ 'AC_PROG_RANLIB' => 1,
++ 'AM_INIT_AUTOMAKE' => 1,
++ 'AC_FUNC_SETPGRP' => 1,
++ 'AC_CONFIG_SUBDIRS' => 1,
++ 'AC_FUNC_MMAP' => 1,
++ 'AC_FUNC_REALLOC' => 1,
++ 'AC_TYPE_SIZE_T' => 1,
++ 'AC_CONFIG_LINKS' => 1,
++ 'AC_CHECK_TYPES' => 1,
++ 'AC_CHECK_MEMBERS' => 1,
++ 'AM_MAINTAINER_MODE' => 1,
++ 'AC_FUNC_UTIME_NULL' => 1,
++ 'AC_FUNC_SELECT_ARGTYPES' => 1,
++ 'AC_FUNC_STRFTIME' => 1,
++ 'AC_HEADER_STAT' => 1,
++ 'AC_C_INLINE' => 1,
++ 'AC_PROG_CPP' => 1,
++ 'AC_TYPE_PID_T' => 1,
++ 'AC_C_CONST' => 1,
++ 'AC_PROG_LEX' => 1,
++ 'AC_CONFIG_FILES' => 1,
++ 'include' => 1,
++ 'AC_FUNC_SETVBUF_REVERSED' => 1,
++ 'AC_PROG_INSTALL' => 1,
++ 'AM_GNU_GETTEXT' => 1,
++ 'AC_FUNC_OBSTACK' => 1,
++ 'AC_CHECK_LIB' => 1,
++ 'AC_FUNC_MALLOC' => 1,
++ 'AC_FUNC_GETGROUPS' => 1,
++ 'AC_FUNC_GETLOADAVG' => 1,
++ 'AH_OUTPUT' => 1,
++ 'AC_FUNC_FSEEKO' => 1,
++ 'AM_PROG_CC_C_O' => 1,
++ 'AM_CONDITIONAL' => 1,
++ 'AC_CANONICAL_SYSTEM' => 1,
++ 'AC_FUNC_MKTIME' => 1,
++ 'AC_CONFIG_HEADERS' => 1,
++ 'AC_HEADER_SYS_WAIT' => 1,
++ 'AC_FUNC_MEMCMP' => 1,
++ 'AC_PROG_LN_S' => 1,
++ 'm4_include' => 1,
++ 'AC_HEADER_DIRENT' => 1,
++ 'AC_CHECK_FUNCS' => 1
++ }
++ ], 'Autom4te::Request' )
++ );
++
+diff -urN linux-atm.old/autom4te.cache/traces.0 linux-atm.dev/autom4te.cache/traces.0
+--- linux-atm.old/autom4te.cache/traces.0 1970-01-01 01:00:00.000000000 +0100
++++ linux-atm.dev/autom4te.cache/traces.0 2005-08-23 01:12:40.958209832 +0200
+@@ -0,0 +1,426 @@
++m4trace:configure.in:8: -1- AC_INIT([src/include/atm.h])
++m4trace:configure.in:8: -1- m4_pattern_forbid([^_?A[CHUM]_])
++m4trace:configure.in:8: -1- m4_pattern_forbid([_AC_])
++m4trace:configure.in:8: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
++m4trace:configure.in:8: -1- m4_pattern_allow([^AS_FLAGS$])
++m4trace:configure.in:8: -1- m4_pattern_forbid([^_?m4_])
++m4trace:configure.in:8: -1- m4_pattern_forbid([^dnl$])
++m4trace:configure.in:8: -1- m4_pattern_forbid([^_?AS_])
++m4trace:configure.in:8: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
++m4trace:configure.in:8: -1- AC_SUBST([PATH_SEPARATOR])
++m4trace:configure.in:8: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
++m4trace:configure.in:8: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
++m4trace:configure.in:8: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
++m4trace:configure.in:8: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
++m4trace:configure.in:8: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
++m4trace:configure.in:8: -1- AC_SUBST([exec_prefix], [NONE])
++m4trace:configure.in:8: -1- AC_SUBST([prefix], [NONE])
++m4trace:configure.in:8: -1- AC_SUBST([program_transform_name], [s,x,x,])
++m4trace:configure.in:8: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
++m4trace:configure.in:8: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
++m4trace:configure.in:8: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
++m4trace:configure.in:8: -1- AC_SUBST([datadir], ['${prefix}/share'])
++m4trace:configure.in:8: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
++m4trace:configure.in:8: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
++m4trace:configure.in:8: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
++m4trace:configure.in:8: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
++m4trace:configure.in:8: -1- AC_SUBST([includedir], ['${prefix}/include'])
++m4trace:configure.in:8: -1- AC_SUBST([oldincludedir], ['/usr/include'])
++m4trace:configure.in:8: -1- AC_SUBST([infodir], ['${prefix}/info'])
++m4trace:configure.in:8: -1- AC_SUBST([mandir], ['${prefix}/man'])
++m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
++m4trace:configure.in:8: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
++#undef PACKAGE_NAME])
++m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
++m4trace:configure.in:8: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
++#undef PACKAGE_TARNAME])
++m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
++m4trace:configure.in:8: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
++#undef PACKAGE_VERSION])
++m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
++m4trace:configure.in:8: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
++#undef PACKAGE_STRING])
++m4trace:configure.in:8: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
++m4trace:configure.in:8: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
++#undef PACKAGE_BUGREPORT])
++m4trace:configure.in:8: -1- AC_SUBST([build_alias])
++m4trace:configure.in:8: -1- AC_SUBST([host_alias])
++m4trace:configure.in:8: -1- AC_SUBST([target_alias])
++m4trace:configure.in:8: -1- AC_SUBST([DEFS])
++m4trace:configure.in:8: -1- AC_SUBST([ECHO_C])
++m4trace:configure.in:8: -1- AC_SUBST([ECHO_N])
++m4trace:configure.in:8: -1- AC_SUBST([ECHO_T])
++m4trace:configure.in:8: -1- AC_SUBST([LIBS])
++m4trace:configure.in:9: -1- AC_CONFIG_HEADERS([config.h])
++m4trace:configure.in:9: -1- _m4_warn([obsolete], [The macro `AC_OUTPUT_COMMANDS' is obsolete.
++You should run autoupdate.], [autoconf/status.m4:318: AC_OUTPUT_COMMANDS is expanded from...
++aclocal.m4:34: AM_CONFIG_HEADER is expanded from...
++configure.in:9: the top level])
++m4trace:configure.in:9: -3- _m4_warn([obsolete], [The macro `_AC_OUTPUT_COMMANDS_CNT' is obsolete.
++You should run autoupdate.], [autoconf/status.m4:321: _AC_OUTPUT_COMMANDS_CNT is expanded from...
++autoconf/status.m4:318: AC_OUTPUT_COMMANDS is expanded from...
++aclocal.m4:34: AM_CONFIG_HEADER is expanded from...
++configure.in:9: the top level])
++m4trace:configure.in:12: -1- AC_CANONICAL_SYSTEM
++m4trace:configure.in:12: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:1660: AC_CANONICAL_SYSTEM is expanded from...
++configure.in:12: the top level])
++m4trace:configure.in:12: -1- AC_CANONICAL_HOST
++m4trace:configure.in:12: -1- AC_SUBST([build], [$ac_cv_build])
++m4trace:configure.in:12: -1- AC_SUBST([build_cpu], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
++m4trace:configure.in:12: -1- AC_SUBST([build_vendor], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
++m4trace:configure.in:12: -1- AC_SUBST([build_os], [`echo $ac_cv_build | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
++m4trace:configure.in:12: -1- AC_SUBST([host], [$ac_cv_host])
++m4trace:configure.in:12: -1- AC_SUBST([host_cpu], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
++m4trace:configure.in:12: -1- AC_SUBST([host_vendor], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
++m4trace:configure.in:12: -1- AC_SUBST([host_os], [`echo $ac_cv_host | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
++m4trace:configure.in:12: -1- AC_SUBST([target], [$ac_cv_target])
++m4trace:configure.in:12: -1- AC_SUBST([target_cpu], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])
++m4trace:configure.in:12: -1- AC_SUBST([target_vendor], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])
++m4trace:configure.in:12: -1- AC_SUBST([target_os], [`echo $ac_cv_target | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])
++m4trace:configure.in:14: -1- AM_INIT_AUTOMAKE([linux-atm], [2.4.1])
++m4trace:configure.in:14: -1- AM_AUTOMAKE_VERSION([1.4-p6])
++m4trace:configure.in:14: -1- AC_PROG_INSTALL
++m4trace:configure.in:14: -1- AC_SUBST([INSTALL_PROGRAM])
++m4trace:configure.in:14: -1- AC_SUBST([INSTALL_SCRIPT])
++m4trace:configure.in:14: -1- AC_SUBST([INSTALL_DATA])
++m4trace:configure.in:14: -1- AC_SUBST([PACKAGE])
++m4trace:configure.in:14: -1- AC_SUBST([VERSION])
++m4trace:configure.in:14: -2- AC_DEFINE_TRACE_LITERAL([PACKAGE])
++m4trace:configure.in:14: -2- AH_OUTPUT([PACKAGE], [/* Name of package */
++#undef PACKAGE])
++m4trace:configure.in:14: -2- AC_DEFINE_TRACE_LITERAL([VERSION])
++m4trace:configure.in:14: -2- AH_OUTPUT([VERSION], [/* Version number of package */
++#undef VERSION])
++m4trace:configure.in:14: -1- AC_SUBST([ACLOCAL])
++m4trace:configure.in:14: -1- AC_SUBST([AUTOCONF])
++m4trace:configure.in:14: -1- AC_SUBST([AUTOMAKE])
++m4trace:configure.in:14: -1- AC_SUBST([AUTOHEADER])
++m4trace:configure.in:14: -1- AC_SUBST([MAKEINFO])
++m4trace:configure.in:14: -1- AC_PROG_MAKE_SET
++m4trace:configure.in:14: -1- AC_SUBST([SET_MAKE])
++m4trace:configure.in:19: -1- AC_SUBST([LIBVER_CURRENT])
++m4trace:configure.in:20: -1- AC_SUBST([LIBVER_REVISION])
++m4trace:configure.in:21: -1- AC_SUBST([LIBVER_AGE])
++m4trace:configure.in:24: -1- AC_PROG_CC
++m4trace:configure.in:24: -1- AC_SUBST([CC])
++m4trace:configure.in:24: -1- AC_SUBST([CFLAGS])
++m4trace:configure.in:24: -1- AC_SUBST([LDFLAGS])
++m4trace:configure.in:24: -1- AC_SUBST([CPPFLAGS])
++m4trace:configure.in:24: -1- AC_SUBST([CC])
++m4trace:configure.in:24: -1- AC_SUBST([ac_ct_CC])
++m4trace:configure.in:24: -1- AC_SUBST([CC])
++m4trace:configure.in:24: -1- AC_SUBST([ac_ct_CC])
++m4trace:configure.in:24: -1- AC_SUBST([CC])
++m4trace:configure.in:24: -1- AC_SUBST([CC])
++m4trace:configure.in:24: -1- AC_SUBST([ac_ct_CC])
++m4trace:configure.in:24: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
++m4trace:configure.in:24: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
++m4trace:configure.in:25: -1- AC_SUBST([LEX])
++m4trace:configure.in:25: -1- AC_PROG_LEX
++m4trace:configure.in:25: -1- AC_SUBST([LEX])
++m4trace:configure.in:25: -1- AC_CHECK_LIB([fl], [yywrap], [LEXLIB="-lfl"], [AC_CHECK_LIB(l, yywrap, LEXLIB="-ll")])
++m4trace:configure.in:25: -1- AC_CHECK_LIB([l], [yywrap], [LEXLIB="-ll"])
++m4trace:configure.in:25: -1- AC_SUBST([LEXLIB])
++m4trace:configure.in:25: -1- AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root])
++m4trace:configure.in:25: -1- AC_DEFINE_TRACE_LITERAL([YYTEXT_POINTER])
++m4trace:configure.in:25: -1- AH_OUTPUT([YYTEXT_POINTER], [/* Define to 1 if `lex\' declares `yytext\' as a `char *\' by default, not a
++ `char[]\'. */
++#undef YYTEXT_POINTER])
++m4trace:configure.in:25: -1- _m4_warn([obsolete], [The macro `AC_DECL_YYTEXT' is obsolete.
++You should run autoupdate.], [autoconf/programs.m4:438: AC_DECL_YYTEXT is expanded from...
++aclocal.m4:165: AM_PROG_LEX is expanded from...
++configure.in:25: the top level])
++m4trace:configure.in:25: -1- AC_PROG_LEX
++m4trace:configure.in:25: -1- _m4_warn([syntax], [AC_PROG_LEX invoked multiple times], [autoconf/programs.m4:438: AC_DECL_YYTEXT is expanded from...
++aclocal.m4:165: AM_PROG_LEX is expanded from...
++configure.in:25: the top level])
++m4trace:configure.in:26: -1- AC_PROG_YACC
++m4trace:configure.in:26: -1- AC_SUBST([YACC])
++m4trace:configure.in:27: -1- AC_PROG_INSTALL
++m4trace:configure.in:27: -1- AC_SUBST([INSTALL_PROGRAM])
++m4trace:configure.in:27: -1- AC_SUBST([INSTALL_SCRIPT])
++m4trace:configure.in:27: -1- AC_SUBST([INSTALL_DATA])
++m4trace:configure.in:30: -1- AC_PROG_LIBTOOL
++m4trace:configure.in:30: -1- AC_PROG_LN_S
++m4trace:configure.in:30: -1- AC_SUBST([LN_S], [$as_ln_s])
++m4trace:configure.in:30: -1- AC_SUBST([ECHO])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_CHECK_TOOL_PREFIX' is obsolete.
++You should run autoupdate.], [autoconf/programs.m4:188: AC_CHECK_TOOL_PREFIX is expanded from...
++configure.in:30: AC_CHECK_TOOL_PREFIX is required by...
++aclocal.m4:3303: AC_PATH_MAGIC is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- AC_SUBST([RANLIB])
++m4trace:configure.in:30: -1- AC_SUBST([ac_ct_RANLIB])
++m4trace:configure.in:30: -1- AC_SUBST([STRIP])
++m4trace:configure.in:30: -1- AC_SUBST([ac_ct_STRIP])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
++You should run autoupdate.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [instead of using `AC_LANG', `AC_LANG_SAVE',
++and `AC_LANG_RESTORE', you should use `AC_LANG_PUSH' and `AC_LANG_POP'.], [autoconf/lang.m4:166: AC_LANG_SAVE is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_LANG_C' is obsolete.
++You should run autoupdate.], [autoconf/c.m4:71: AC_LANG_C is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
++You should run autoupdate.], [autoconf/lang.m4:172: AC_LANG_RESTORE is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_FD_CC' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:376: AC_FD_CC is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:509: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is expanded from...
++configure.in:30: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is required by...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_FD_CC' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:376: AC_FD_CC is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:509: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is expanded from...
++configure.in:30: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is required by...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_FD_CC' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:376: AC_FD_CC is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:509: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is expanded from...
++configure.in:30: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is required by...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_FD_CC' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:376: AC_FD_CC is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:509: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is expanded from...
++configure.in:30: AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE is required by...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:2180: AC_TRY_COMPILE is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries], [aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries], [aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure], [aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure], [aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:2223: AC_TRY_LINK is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_FD_CC' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:376: AC_FD_CC is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:2180: AC_TRY_COMPILE is expanded from...
++autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe], [aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe], [aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
++You should run autoupdate.], [autoconf/general.m4:2180: AC_TRY_COMPILE is expanded from...
++aclocal.m4:3110: _LT_AC_LTCONFIG_HACK is expanded from...
++aclocal.m4:296: AC_LIBTOOL_SETUP is expanded from...
++configure.in:30: AC_LIBTOOL_SETUP is required by...
++aclocal.m4:183: AC_PROG_LIBTOOL is expanded from...
++aclocal.m4:3701: AM_PROG_LIBTOOL is expanded from...
++configure.in:30: the top level])
++m4trace:configure.in:30: -1- AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [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="-dld"])
++ ])
++ ])
++ ])
++ ])
++m4trace:configure.in:30: -1- 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="-dld"])
++ ])
++ ])
++m4trace:configure.in:30: -1- 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="-dld"])
++ ])
++m4trace:configure.in:30: -1- AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
++m4trace:configure.in:30: -1- AC_CHECK_HEADERS([dlfcn.h])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
++#undef HAVE_DLFCN_H])
++m4trace:configure.in:30: -1- AC_HEADER_STDC
++m4trace:configure.in:30: -1- AC_PROG_CPP
++m4trace:configure.in:30: -1- AC_SUBST([CPP])
++m4trace:configure.in:30: -1- AC_SUBST([CPPFLAGS])
++m4trace:configure.in:30: -1- AC_SUBST([CPP])
++m4trace:configure.in:30: -1- AC_SUBST([EGREP])
++m4trace:configure.in:30: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
++m4trace:configure.in:30: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
++#undef STDC_HEADERS])
++m4trace:configure.in:30: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
++ inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
++#undef HAVE_SYS_TYPES_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
++#undef HAVE_SYS_STAT_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
++#undef HAVE_STDLIB_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
++#undef HAVE_STRING_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
++#undef HAVE_MEMORY_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
++#undef HAVE_STRINGS_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
++#undef HAVE_INTTYPES_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
++#undef HAVE_STDINT_H])
++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
++#undef HAVE_UNISTD_H])
++m4trace:configure.in:30: -1- AC_SUBST([LIBTOOL])
++m4trace:configure.in:31: -1- AC_SUBST([LIBTOOL_DEPS])
++m4trace:configure.in:34: -1- AC_SUBST([PERL], [$ac_cv_path_PERL])
++m4trace:configure.in:35: -1- AC_SUBST([PERL])
++m4trace:configure.in:51: -1- AC_CHECK_LIB([resolv], [main], [], [{ { echo "$as_me:$LINENO: error: *** Unable to find libresolv!!!" >&5
++echo "$as_me: error: *** Unable to find libresolv!!!" >&2;}
++ { (exit 1); exit 1; }; }
++])
++m4trace:configure.in:51: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the `resolv\' library (-lresolv). */
++#undef HAVE_LIBRESOLV])
++m4trace:configure.in:51: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV])
++m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([YY_USE_CONST])
++m4trace:configure.in:68: -1- AC_DEFINE_TRACE_LITERAL([ATMSIGD_CONF])
++m4trace:configure.in:86: -2- AC_DEFINE_TRACE_LITERAL([DYNAMIC_UNI])
++m4trace:configure.in:87: -1- AC_DEFINE_TRACE_LITERAL([UNI30])
++m4trace:configure.in:87: -1- AC_DEFINE_TRACE_LITERAL([UNI31])
++m4trace:configure.in:87: -1- AC_DEFINE_TRACE_LITERAL([UNI40])
++m4trace:configure.in:87: -1- AC_DEFINE_TRACE_LITERAL([DYNAMIC_UNI])
++m4trace:configure.in:98: -1- AC_DEFINE_TRACE_LITERAL([ALLOW_UNI30])
++m4trace:configure.in:109: -1- AC_DEFINE_TRACE_LITERAL([Q2963_1])
++m4trace:configure.in:113: -2- AC_DEFINE_TRACE_LITERAL([CISCO])
++m4trace:configure.in:118: -2- AC_DEFINE_TRACE_LITERAL([THOMFLEX])
++m4trace:configure.in:123: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_POLL])
++m4trace:configure.in:127: -2- AC_DEFINE_TRACE_LITERAL([MPOA_1_1])
++m4trace:configure.in:143: -1- AC_CHECK_LIB([mpr], [main], [], [
++ AC_MSG_WARN([*** Could not find libmpr! Is MPR installed?])
++
++ ])
++m4trace:configure.in:143: -1- AH_OUTPUT([HAVE_LIBMPR], [/* Define to 1 if you have the `mpr\' library (-lmpr). */
++#undef HAVE_LIBMPR])
++m4trace:configure.in:143: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBMPR])
++m4trace:configure.in:157: -1- AC_CONFIG_FILES([Makefile \
++ doc/Makefile \
++ m4/Makefile \
++ src/Makefile \
++ src/include/Makefile \
++ src/lib/Makefile \
++ src/br2684/Makefile \
++ ])
++m4trace:configure.in:157: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
++You should run autoupdate.], [])
++m4trace:configure.in:157: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
++m4trace:configure.in:157: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
+diff -urN linux-atm.old/configure linux-atm.dev/configure
+--- linux-atm.old/configure 2005-08-23 01:12:10.846787000 +0200
++++ linux-atm.dev/configure 2005-08-23 01:12:41.187175024 +0200
+@@ -1,9 +1,8 @@
+ #! /bin/sh
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated by GNU Autoconf 2.57.
++# Generated by GNU Autoconf 2.59.
+ #
+-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+-# Free Software Foundation, Inc.
++# Copyright (C) 2003 Free Software Foundation, Inc.
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
+ ## --------------------- ##
+@@ -20,9 +19,10 @@
+ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+ fi
++DUALCASE=1; export DUALCASE # for MKS sh
+
+ # Support unset when possible.
+-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+ else
+ as_unset=false
+@@ -41,7 +41,7 @@
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+ do
+- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+@@ -218,16 +218,17 @@
+ if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+ else
++ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+ fi
+
+ as_executable_p="test -f"
+
+ # Sed expression to map a string onto a valid CPP name.
+-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
++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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+ # IFS
+@@ -826,7 +827,7 @@
+
+ # Be sure to have absolute paths.
+ for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+- localstatedir libdir includedir oldincludedir infodir mandir
++ localstatedir libdir includedir oldincludedir infodir mandir
+ do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+@@ -866,10 +867,10 @@
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+ $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$0" : 'X\(//\)[^/]' \| \
+- X"$0" : 'X\(//\)$' \| \
+- X"$0" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$0" : 'X\(//\)[^/]' \| \
++ X"$0" : 'X\(//\)$' \| \
++ X"$0" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -961,9 +962,9 @@
+ cat <<_ACEOF
+ Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+- [$ac_default_prefix]
++ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+- [PREFIX]
++ [PREFIX]
+
+ By default, \`make install' will install all the files in
+ \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+@@ -1071,12 +1072,45 @@
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ esac
+-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+-# absolute.
+-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+@@ -1087,13 +1121,13 @@
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+- test -f $ac_srcdir/configure.in; then
++ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+- cd $ac_popdir
++ cd "$ac_popdir"
+ done
+ fi
+
+@@ -1101,8 +1135,7 @@
+ if $ac_init_version; then
+ cat <<\_ACEOF
+
+-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+-Free Software Foundation, Inc.
++Copyright (C) 2003 Free Software Foundation, Inc.
+ This configure script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it.
+ _ACEOF
+@@ -1114,7 +1147,7 @@
+ running configure, to aid debugging if configure makes a mistake.
+
+ It was created by $as_me, which was
+-generated by GNU Autoconf 2.57. Invocation command line was
++generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+@@ -1191,19 +1224,19 @@
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+- ac_must_keep_next=false # Got value, back to normal.
++ 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
++ 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
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+@@ -1237,12 +1270,12 @@
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+ }
+@@ -1271,7 +1304,7 @@
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+- echo "$ac_var='"'"'$ac_val'"'"'"
++ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+@@ -1370,7 +1403,7 @@
+ # value.
+ ac_cache_corrupted=false
+ for ac_var in `(set) 2>&1 |
+- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
++ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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"
+@@ -1387,13 +1420,13 @@
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
++ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+ echo "$as_me: former value: $ac_old_val" >&2;}
+- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
++ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ echo "$as_me: current value: $ac_new_val" >&2;}
+- ac_cache_corrupted=:
++ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+@@ -1567,6 +1600,7 @@
+ # 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.
+ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+ echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+@@ -1583,6 +1617,7 @@
+ 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.
+@@ -1590,20 +1625,20 @@
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+- if $as_executable_p "$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
+- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+- break 3
+- fi
+- fi
++ if $as_executable_p "$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
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
+ done
+ done
+ ;;
+@@ -1693,7 +1728,7 @@
+
+ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+ echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+ if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+@@ -2163,7 +2198,6 @@
+ (exit $ac_status); }
+
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2183,8 +2217,8 @@
+ # 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.
+-echo "$as_me:$LINENO: checking for C compiler default output" >&5
+-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+@@ -2204,23 +2238,23 @@
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+- ;;
++ ;;
+ conftest.$ac_ext )
+- # This is the source file.
+- ;;
++ # This is the source file.
++ ;;
+ [ab].out )
+- # We found the default executable, but exeext='' is most
+- # certainly right.
+- break;;
++ # We found the default executable, but exeext='' is most
++ # certainly right.
++ break;;
+ *.* )
+- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+- # FIXME: I believe we export ac_cv_exeext for Libtool,
+- # but it would be cool to find out if it's true. Does anybody
+- # maintain Libtool? --akim.
+- export ac_cv_exeext
+- break;;
++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++ # FIXME: I believe we export ac_cv_exeext for Libtool,
++ # but it would be cool to find out if it's true. Does anybody
++ # maintain Libtool? --akim.
++ export ac_cv_exeext
++ break;;
+ * )
+- break;;
++ break;;
+ esac
+ done
+ else
+@@ -2294,8 +2328,8 @@
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+- export ac_cv_exeext
+- break;;
++ export ac_cv_exeext
++ break;;
+ * ) break;;
+ esac
+ done
+@@ -2320,7 +2354,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2371,7 +2404,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2391,11 +2423,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2408,7 +2449,7 @@
+
+ ac_compiler_gnu=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+ fi
+@@ -2424,7 +2465,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2441,11 +2481,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2458,7 +2507,7 @@
+
+ ac_cv_prog_cc_g=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+ echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+@@ -2485,7 +2534,6 @@
+ ac_cv_prog_cc_stdc=no
+ ac_save_CC=$CC
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2513,6 +2561,16 @@
+ 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 -std1 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 -std1. */
++int osf4_cc_array ['\x00' == 0 ? 1 : -1];
++
+ int test (int i, double x);
+ struct s1 {int (*f) (int a);};
+ struct s2 {int (*f) (double a);};
+@@ -2539,11 +2597,20 @@
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2556,7 +2623,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext
++rm -f conftest.err conftest.$ac_objext
+ done
+ rm -f conftest.$ac_ext conftest.$ac_objext
+ CC=$ac_save_CC
+@@ -2584,11 +2651,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2603,7 +2679,6 @@
+ 'void exit (int);'
+ do
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2621,11 +2696,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2638,9 +2722,8 @@
+
+ continue
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2657,11 +2740,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2673,7 +2765,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ rm -f conftest*
+ if test -n "$ac_declaration"; then
+@@ -2687,7 +2779,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f 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'
+@@ -2788,7 +2880,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lfl $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2812,11 +2903,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2829,7 +2929,8 @@
+
+ ac_cv_lib_fl_yywrap=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
+@@ -2845,7 +2946,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ll $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2869,11 +2969,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2886,7 +2995,8 @@
+
+ ac_cv_lib_l_yywrap=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
+@@ -2948,11 +3058,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -2964,7 +3083,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_save_LIBS
+ rm -f "${LEX_OUTPUT_ROOT}.c"
+
+@@ -3033,6 +3153,7 @@
+ # 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.
+ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+ echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+@@ -3049,6 +3170,7 @@
+ 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.
+@@ -3056,20 +3178,20 @@
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+- if $as_executable_p "$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
+- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+- break 3
+- fi
+- fi
++ if $as_executable_p "$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
++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++ break 3
++ fi
++ fi
+ done
+ done
+ ;;
+@@ -3842,7 +3964,6 @@
+ # 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 >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3853,7 +3974,7 @@
+ #else
+ # include <assert.h>
+ #endif
+- Syntax error
++ Syntax error
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -3865,6 +3986,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -3885,7 +4007,6 @@
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3903,6 +4024,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -3949,7 +4071,6 @@
+ # 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 >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3960,7 +4081,7 @@
+ #else
+ # include <assert.h>
+ #endif
+- Syntax error
++ Syntax error
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -3972,6 +4093,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -3992,7 +4114,6 @@
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4010,6 +4131,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -4070,7 +4192,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4091,11 +4212,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4108,12 +4238,11 @@
+
+ ac_cv_header_stdc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f 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 >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4135,7 +4264,6 @@
+ if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4160,7 +4288,6 @@
+ :
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4172,9 +4299,9 @@
+ # 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'))
++ (('a' <= (c) && (c) <= 'i') \
++ || ('j' <= (c) && (c) <= 'r') \
++ || ('s' <= (c) && (c) <= 'z'))
+ # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+ #endif
+
+@@ -4185,7 +4312,7 @@
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+- || toupper (i) != TOUPPER (i))
++ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+ }
+@@ -4235,7 +4362,7 @@
+
+
+ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+- inttypes.h stdint.h unistd.h
++ inttypes.h stdint.h unistd.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+@@ -4244,7 +4371,6 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4256,11 +4382,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4273,7 +4408,7 @@
+
+ eval "$as_ac_Header=no"
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4304,7 +4439,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4315,11 +4449,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4332,7 +4475,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -4340,7 +4483,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4358,6 +4500,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -4377,33 +4520,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -4414,7 +4556,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- eval "$as_ac_Header=$ac_header_preproc"
++ eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4749,7 +4891,7 @@
+ case $host in
+ *-*-irix6*)
+ # Find out which ABI we are using.
+- echo '#line 4752 "configure"' > conftest.$ac_ext
++ echo '#line 4894 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+@@ -4788,7 +4930,6 @@
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4805,11 +4946,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -4822,7 +4972,8 @@
+
+ lt_cv_cc_needs_belf=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f 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'
+@@ -5117,7 +5268,6 @@
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5134,11 +5284,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5167,7 +5326,7 @@
+ lt_cv_prog_cc_pic_works=no
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
+
+ fi
+@@ -5205,7 +5364,6 @@
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5222,11 +5380,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5238,7 +5405,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+ fi
+@@ -5278,7 +5446,7 @@
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
+ compiler_c_o=no
+-if { (eval echo configure:5281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
++if { (eval echo configure:5449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && 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
+ if test -s out/conftest.err; then
+@@ -5319,7 +5487,6 @@
+ save_objext="$ac_objext"
+ ac_objext=lo
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5336,11 +5503,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5359,7 +5535,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_objext="$save_objext"
+ CFLAGS="$save_CFLAGS"
+
+@@ -5404,7 +5580,6 @@
+ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
+ compiler_rtti_exceptions=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5421,11 +5596,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -5444,7 +5628,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
+ echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5
+ echo "${ECHO_T}$compiler_rtti_exceptions" >&6
+@@ -6704,21 +6888,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define shl_load innocuous_shl_load
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); 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 shl_load
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6749,11 +6940,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6766,7 +6966,8 @@
+
+ ac_cv_func_shl_load=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+ echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+@@ -6781,7 +6982,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldld $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6805,11 +7005,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6822,7 +7031,8 @@
+
+ ac_cv_lib_dld_shl_load=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+@@ -6836,21 +7046,28 @@
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
++/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
++ For example, HP-UX 11i <limits.h> declares gettimeofday. */
++#define dlopen innocuous_dlopen
++
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); 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 dlopen
++
+ /* Override any gcc2 internal prototype to avoid an error. */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6881,11 +7098,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6898,7 +7124,8 @@
+
+ ac_cv_func_dlopen=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+ echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+@@ -6913,7 +7140,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldl $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6937,11 +7163,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -6954,7 +7189,8 @@
+
+ ac_cv_lib_dl_dlopen=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+@@ -6970,7 +7206,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lsvld $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6994,11 +7229,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7011,7 +7255,8 @@
+
+ ac_cv_lib_svld_dlopen=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+@@ -7027,7 +7272,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-ldld $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7051,11 +7295,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -7068,7 +7321,8 @@
+
+ ac_cv_lib_dld_dld_link=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+@@ -7123,7 +7377,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 7126 "configure"
++#line 7380 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -7221,7 +7475,7 @@
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+-#line 7224 "configure"
++#line 7478 "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -8005,7 +8259,6 @@
+ echo "$as_me:$LINENO: checking asm/errno.h usability" >&5
+ echo $ECHO_N "checking asm/errno.h usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8016,11 +8269,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8033,7 +8295,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -8041,7 +8303,6 @@
+ echo "$as_me:$LINENO: checking asm/errno.h presence" >&5
+ echo $ECHO_N "checking asm/errno.h presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8059,6 +8320,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -8078,33 +8340,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: asm/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: asm/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: asm/errno.h: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: asm/errno.h: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: asm/errno.h: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: asm/errno.h: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: asm/errno.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: asm/errno.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: asm/errno.h: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: asm/errno.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: asm/errno.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: asm/errno.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: asm/errno.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -8145,7 +8406,6 @@
+ echo "$as_me:$LINENO: checking linux/atmsap.h usability" >&5
+ echo $ECHO_N "checking linux/atmsap.h usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8156,11 +8416,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
++ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8173,7 +8442,7 @@
+
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+@@ -8181,7 +8450,6 @@
+ echo "$as_me:$LINENO: checking linux/atmsap.h presence" >&5
+ echo $ECHO_N "checking linux/atmsap.h presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8199,6 +8467,7 @@
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+@@ -8218,33 +8487,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+
+ # So? What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+- yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: linux/atmsap.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&2;}
+- (
+- cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+- ) |
+- sed "s/^/$as_me: WARNING: /" >&2
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: linux/atmsap.h: proceeding with the compiler's result" >&2;}
++ ac_header_preproc=yes
+ ;;
+- no:yes )
++ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: linux/atmsap.h: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: linux/atmsap.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: linux/atmsap.h: see the Autoconf documentation" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: linux/atmsap.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: linux/atmsap.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: linux/atmsap.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: linux/atmsap.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## ------------------------------------------ ##
++## Report this to the AC_PACKAGE_NAME lists. ##
++## ------------------------------------------ ##
+ _ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+@@ -8281,7 +8549,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lresolv $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8299,11 +8566,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8316,7 +8592,8 @@
+
+ ac_cv_lib_resolv_main=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
+@@ -8477,7 +8754,6 @@
+ ac_check_lib_save_LIBS=$LIBS
+ LIBS="-lmpr $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h. */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8495,11 +8771,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
++ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+@@ -8512,7 +8797,8 @@
+
+ ac_cv_lib_mpr_main=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_mpr_main" >&5
+@@ -8539,7 +8825,7 @@
+ fi;
+
+
+- ac_config_files="$ac_config_files Makefile doc/Makefile m4/Makefile src/Makefile src/include/Makefile src/lib/Makefile src/test/Makefile src/debug/Makefile src/qgen/Makefile src/saal/Makefile src/sigd/Makefile src/maint/Makefile src/arpd/Makefile src/ilmid/Makefile src/ilmid/asn1/Makefile src/man/Makefile src/led/Makefile src/lane/Makefile src/mpoad/Makefile src/switch/Makefile src/switch/debug/Makefile src/switch/tcp/Makefile src/config/Makefile src/config/init-redhat/Makefile src/extra/Makefile src/extra/linux-atm.spec src/extra/ANS/Makefile"
++ ac_config_files="$ac_config_files Makefile doc/Makefile m4/Makefile src/Makefile src/include/Makefile src/lib/Makefile src/br2684/Makefile"
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+ # tests run on this system so they can be shared between configure
+@@ -8568,13 +8854,13 @@
+ # `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"
++ "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 \
+- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+ } |
+@@ -8604,13 +8890,13 @@
+ # 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[ ]*=/{
++ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+ s/:*\$(srcdir):*/:/;
+ s/:*\${srcdir}:*/:/;
+ s/:*@srcdir@:*/:/;
+-s/^\([^=]*=[ ]*\):*/\1/;
++s/^\([^=]*=[ ]*\):*/\1/;
+ s/:*$//;
+-s/^[^=]*=[ ]*$//;
++s/^[^=]*=[ ]*$//;
+ }'
+ fi
+
+@@ -8621,7 +8907,7 @@
+ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
++ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+@@ -8665,9 +8951,10 @@
+ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+ fi
++DUALCASE=1; export DUALCASE # for MKS sh
+
+ # Support unset when possible.
+-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+ else
+ as_unset=false
+@@ -8686,7 +8973,7 @@
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+ do
+- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+@@ -8865,16 +9152,17 @@
+ if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+ else
++ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+ fi
+
+ as_executable_p="test -f"
+
+ # Sed expression to map a string onto a valid CPP name.
+-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
++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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+ # IFS
+@@ -8901,7 +9189,7 @@
+ cat >&5 <<_CSEOF
+
+ This file was extended by $as_me, which was
+-generated by GNU Autoconf 2.57. Invocation command line was
++generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+@@ -8945,9 +9233,9 @@
+ -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
++ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+- instantiate the configuration header FILE
++ instantiate the configuration header FILE
+
+ Configuration files:
+ $config_files
+@@ -8964,11 +9252,10 @@
+ cat >>$CONFIG_STATUS <<_ACEOF
+ ac_cs_version="\\
+ config.status
+-configured by $0, generated by GNU Autoconf 2.57,
++configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+-Free Software Foundation, Inc.
++Copyright (C) 2003 Free Software Foundation, Inc.
+ This config.status script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it."
+ srcdir=$srcdir
+@@ -9080,27 +9367,7 @@
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "src/include/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;;
+ "src/lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
+- "src/test/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;;
+- "src/debug/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/debug/Makefile" ;;
+- "src/qgen/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/qgen/Makefile" ;;
+- "src/saal/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/saal/Makefile" ;;
+- "src/sigd/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/sigd/Makefile" ;;
+- "src/maint/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/maint/Makefile" ;;
+- "src/arpd/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/arpd/Makefile" ;;
+- "src/ilmid/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/ilmid/Makefile" ;;
+- "src/ilmid/asn1/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/ilmid/asn1/Makefile" ;;
+- "src/man/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/man/Makefile" ;;
+- "src/led/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/led/Makefile" ;;
+- "src/lane/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/lane/Makefile" ;;
+- "src/mpoad/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mpoad/Makefile" ;;
+- "src/switch/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/switch/Makefile" ;;
+- "src/switch/debug/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/switch/debug/Makefile" ;;
+- "src/switch/tcp/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/switch/tcp/Makefile" ;;
+- "src/config/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/config/Makefile" ;;
+- "src/config/init-redhat/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/config/init-redhat/Makefile" ;;
+- "src/extra/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/extra/Makefile" ;;
+- "src/extra/linux-atm.spec" ) CONFIG_FILES="$CONFIG_FILES src/extra/linux-atm.spec" ;;
+- "src/extra/ANS/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/extra/ANS/Makefile" ;;
++ "src/br2684/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/br2684/Makefile" ;;
+ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+@@ -9267,9 +9534,9 @@
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
++ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
++ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+@@ -9287,21 +9554,21 @@
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+- cat >$tmp/stdin
+- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$ac_file" : 'X\(//\)[^/]' \| \
+- X"$ac_file" : 'X\(//\)$' \| \
+- X"$ac_file" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -9317,10 +9584,10 @@
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$as_dir" : 'X\(//\)[^/]' \| \
+- X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -9358,12 +9625,45 @@
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ esac
+-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+-# absolute.
+-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
+
+
+ case $INSTALL in
+@@ -9371,11 +9671,6 @@
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+- if test x"$ac_file" != x-; then
+- { echo "$as_me:$LINENO: creating $ac_file" >&5
+-echo "$as_me: creating $ac_file" >&6;}
+- rm -f "$ac_file"
+- fi
+ # 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. */
+@@ -9385,7 +9680,7 @@
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+- sed 's,.*/,,'` by configure."
++ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+@@ -9394,26 +9689,32 @@
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+- # Absolute (can't be DOS-style, as IFS=:)
+- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- echo $f;;
++ echo "$f";;
+ *) # Relative
+- if test -f "$f"; then
+- # Build tree
+- echo $f
+- elif test -f "$srcdir/$f"; then
+- # Source tree
+- echo $srcdir/$f
+- else
+- # /dev/null tree
+- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- fi;;
++ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
++
++ if test x"$ac_file" != x-; then
++ { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++ rm -f "$ac_file"
++ fi
+ _ACEOF
+ cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+@@ -9453,12 +9754,12 @@
+ # NAME is the cpp macro being defined and VALUE is the value it is being given.
+ #
+ # ac_d sets the value in "#define NAME VALUE" lines.
+-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+-ac_dB='[ ].*$,\1#\2'
++ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
++ac_dB='[ ].*$,\1#\2'
+ ac_dC=' '
+ ac_dD=',;t'
+ # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
++ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ ac_uB='$,\1#\2define\3'
+ ac_uC=' '
+ ac_uD=',;t'
+@@ -9467,11 +9768,11 @@
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+- cat >$tmp/stdin
+- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ cat >$tmp/stdin
++ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+@@ -9485,28 +9786,29 @@
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+- # Absolute (can't be DOS-style, as IFS=:)
+- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ # Absolute (can't be DOS-style, as IFS=:)
++ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- echo $f;;
++ # Do quote $f, to prevent DOS paths from being IFS'd.
++ echo "$f";;
+ *) # Relative
+- if test -f "$f"; then
+- # Build tree
+- echo $f
+- elif test -f "$srcdir/$f"; then
+- # Source tree
+- echo $srcdir/$f
+- else
+- # /dev/null tree
+- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++ if test -f "$f"; then
++ # Build tree
++ echo "$f"
++ elif test -f "$srcdir/$f"; then
++ # Source tree
++ echo "$srcdir/$f"
++ else
++ # /dev/null tree
++ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+- fi;;
++ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
++ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+ _ACEOF
+
+@@ -9529,9 +9831,9 @@
+ s,[\\$`],\\&,g
+ t clear
+ : clear
+-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
++s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+ t end
+-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
++s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+ : end
+ _ACEOF
+ # If some macros were called several times there might be several times
+@@ -9545,13 +9847,13 @@
+ # example, in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ cat >>conftest.undefs <<\_ACEOF
+-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
++s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+ _ACEOF
+
+ # Break up conftest.defines because some shells have a limit on the size
+ # of here documents, and old seds have small limits too (100 cmds).
+ echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
++echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+ echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+ echo ' :' >>$CONFIG_STATUS
+ rm -f conftest.tail
+@@ -9560,7 +9862,7 @@
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
++ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+@@ -9587,7 +9889,7 @@
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
++ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+@@ -9621,10 +9923,10 @@
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$ac_file" : 'X\(//\)[^/]' \| \
+- X"$ac_file" : 'X\(//\)$' \| \
+- X"$ac_file" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$ac_file" : 'X\(//\)[^/]' \| \
++ X"$ac_file" : 'X\(//\)$' \| \
++ X"$ac_file" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -9640,10 +9942,10 @@
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$as_dir" : 'X\(//\)[^/]' \| \
+- X"$as_dir" : 'X\(//\)$' \| \
+- X"$as_dir" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -9675,16 +9977,41 @@
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+ $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+- X"$ac_dest" : 'X\(//\)[^/]' \| \
+- X"$ac_dest" : 'X\(//\)$' \| \
+- X"$ac_dest" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$ac_dest" : 'X\(//\)[^/]' \| \
++ X"$ac_dest" : 'X\(//\)$' \| \
++ X"$ac_dest" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
+ echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
++ { if $as_mkdir_p; then
++ mkdir -p "$ac_dir"
++ else
++ as_dir="$ac_dir"
++ as_dirs=
++ while test ! -d "$as_dir"; do
++ as_dirs="$as_dir $as_dirs"
++ as_dir=`(dirname "$as_dir") 2>/dev/null ||
++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
++ X"$as_dir" : 'X\(//\)[^/]' \| \
++ X"$as_dir" : 'X\(//\)$' \| \
++ X"$as_dir" : 'X\(/\)' \| \
++ . : '\(.\)' 2>/dev/null ||
++echo X"$as_dir" |
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
++ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
++ /^X\(\/\/\)$/{ s//\1/; q; }
++ /^X\(\/\).*/{ s//\1/; q; }
++ s/.*/./; q'`
++ done
++ test ! -n "$as_dirs" || mkdir $as_dirs
++ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
++echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
++ { (exit 1); exit 1; }; }; }
++
+ ac_builddir=.
+
+ if test "$ac_dir" != .; then
+@@ -9710,12 +10037,45 @@
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ esac
+-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+-# absolute.
+-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++ case "$ac_dir" in
++ .) ac_abs_builddir=`pwd`;;
++ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++ *) ac_abs_builddir=`pwd`/"$ac_dir";;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++ case ${ac_top_builddir}. in
++ .) ac_abs_top_builddir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++ case $ac_srcdir in
++ .) ac_abs_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++ esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++ case $ac_top_srcdir in
++ .) ac_abs_top_srcdir=$ac_abs_builddir;;
++ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++ esac;;
++esac
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+diff -urN linux-atm.old/doc/Makefile.in linux-atm.dev/doc/Makefile.in
+--- linux-atm.old/doc/Makefile.in 2005-08-23 01:12:10.885781000 +0200
++++ linux-atm.dev/doc/Makefile.in 2005-08-23 01:12:46.551359544 +0200
+@@ -63,24 +63,35 @@
+ host_triplet = @host@
+ target_alias = @target_alias@
+ target_triplet = @target@
++AR = @AR@
+ AS = @AS@
+ CC = @CC@
++CXX = @CXX@
++CXXCPP = @CXXCPP@
+ DLLTOOL = @DLLTOOL@
+ ECHO = @ECHO@
++EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
++F77 = @F77@
++GCJ = @GCJ@
++GCJFLAGS = @GCJFLAGS@
++HAVE_LIB = @HAVE_LIB@
+ LEX = @LEX@
++LIB = @LIB@
+ LIBTOOL = @LIBTOOL@
+ LIBTOOL_DEPS = @LIBTOOL_DEPS@
+ LIBVER_AGE = @LIBVER_AGE@
+ LIBVER_CURRENT = @LIBVER_CURRENT@
+ LIBVER_REVISION = @LIBVER_REVISION@
+ LN_S = @LN_S@
++LTLIB = @LTLIB@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ PERL = @PERL@
+ RANLIB = @RANLIB@
++RC = @RC@
+ STRIP = @STRIP@
+ VERSION = @VERSION@
+ YACC = @YACC@
+diff -urN linux-atm.old/m4/Makefile.in linux-atm.dev/m4/Makefile.in
+--- linux-atm.old/m4/Makefile.in 2005-08-23 01:12:10.850786000 +0200
++++ linux-atm.dev/m4/Makefile.in 2005-08-23 01:12:46.559358328 +0200
+@@ -63,24 +63,35 @@
+ host_triplet = @host@
+ target_alias = @target_alias@
+ target_triplet = @target@
++AR = @AR@
+ AS = @AS@
+ CC = @CC@
++CXX = @CXX@
++CXXCPP = @CXXCPP@
+ DLLTOOL = @DLLTOOL@
+ ECHO = @ECHO@
++EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
++F77 = @F77@
++GCJ = @GCJ@
++GCJFLAGS = @GCJFLAGS@
++HAVE_LIB = @HAVE_LIB@
+ LEX = @LEX@
++LIB = @LIB@
+ LIBTOOL = @LIBTOOL@
+ LIBTOOL_DEPS = @LIBTOOL_DEPS@
+ LIBVER_AGE = @LIBVER_AGE@
+ LIBVER_CURRENT = @LIBVER_CURRENT@
+ LIBVER_REVISION = @LIBVER_REVISION@
+ LN_S = @LN_S@
++LTLIB = @LTLIB@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ PERL = @PERL@
+ RANLIB = @RANLIB@
++RC = @RC@
+ STRIP = @STRIP@
+ VERSION = @VERSION@
+ YACC = @YACC@
+diff -urN linux-atm.old/Makefile.in linux-atm.dev/Makefile.in
+--- linux-atm.old/Makefile.in 2005-08-23 01:12:10.830789000 +0200
++++ linux-atm.dev/Makefile.in 2005-08-23 01:12:46.542360912 +0200
+@@ -63,24 +63,35 @@
+ host_triplet = @host@
+ target_alias = @target_alias@
+ target_triplet = @target@
++AR = @AR@
+ AS = @AS@
+ CC = @CC@
++CXX = @CXX@
++CXXCPP = @CXXCPP@
+ DLLTOOL = @DLLTOOL@
+ ECHO = @ECHO@
++EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
++F77 = @F77@
++GCJ = @GCJ@
++GCJFLAGS = @GCJFLAGS@
++HAVE_LIB = @HAVE_LIB@
+ LEX = @LEX@
++LIB = @LIB@
+ LIBTOOL = @LIBTOOL@
+ LIBTOOL_DEPS = @LIBTOOL_DEPS@
+ LIBVER_AGE = @LIBVER_AGE@
+ LIBVER_CURRENT = @LIBVER_CURRENT@
+ LIBVER_REVISION = @LIBVER_REVISION@
+ LN_S = @LN_S@
++LTLIB = @LTLIB@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ PERL = @PERL@
+ RANLIB = @RANLIB@
++RC = @RC@
+ STRIP = @STRIP@
+ VERSION = @VERSION@
+ YACC = @YACC@
+diff -urN linux-atm.old/src/br2684/Makefile.in linux-atm.dev/src/br2684/Makefile.in
+--- linux-atm.old/src/br2684/Makefile.in 2005-08-23 01:12:10.884781000 +0200
++++ linux-atm.dev/src/br2684/Makefile.in 2005-08-23 01:12:46.632347232 +0200
+@@ -57,11 +57,15 @@
+ NORMAL_UNINSTALL = :
+ PRE_UNINSTALL = :
+ POST_UNINSTALL = :
++build_alias = @build_alias@
++build_triplet = @build@
+ host_alias = @host_alias@
+ host_triplet = @host@
++target_alias = @target_alias@
++target_triplet = @target@
+ AR = @AR@
+ AS = @AS@
+-CC = /usr/src/openwrt/staging_dir_mipsel/bin/mipsel-linux-gcc
++CC = @CC@
+ CXX = @CXX@
+ CXXCPP = @CXXCPP@
+ DLLTOOL = @DLLTOOL@
+@@ -117,9 +121,9 @@
+ br2684ctl_DEPENDENCIES = $(top_builddir)/src/lib/libatm.la
+ br2684ctl_LDFLAGS =
+ CFLAGS = @CFLAGS@
+-COMPILE = $(TARGET_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+-LTCOMPILE = $(LIBTOOL) --mode=compile $(TARGET_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+-CCLD = $(TARGET_CC)
++COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++CCLD = $(CC)
+ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+ man8dir = $(mandir)/man8
+ MANS = $(man_MANS)
+diff -urN linux-atm.old/src/include/Makefile.in linux-atm.dev/src/include/Makefile.in
+--- linux-atm.old/src/include/Makefile.in 2005-08-23 01:12:10.851786000 +0200
++++ linux-atm.dev/src/include/Makefile.in 2005-08-23 01:12:46.585354376 +0200
+@@ -63,24 +63,35 @@
+ host_triplet = @host@
+ target_alias = @target_alias@
+ target_triplet = @target@
++AR = @AR@
+ AS = @AS@
+ CC = @CC@
++CXX = @CXX@
++CXXCPP = @CXXCPP@
+ DLLTOOL = @DLLTOOL@
+ ECHO = @ECHO@
++EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
++F77 = @F77@
++GCJ = @GCJ@
++GCJFLAGS = @GCJFLAGS@
++HAVE_LIB = @HAVE_LIB@
+ LEX = @LEX@
++LIB = @LIB@
+ LIBTOOL = @LIBTOOL@
+ LIBTOOL_DEPS = @LIBTOOL_DEPS@
+ LIBVER_AGE = @LIBVER_AGE@
+ LIBVER_CURRENT = @LIBVER_CURRENT@
+ LIBVER_REVISION = @LIBVER_REVISION@
+ LN_S = @LN_S@
++LTLIB = @LTLIB@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ PERL = @PERL@
+ RANLIB = @RANLIB@
++RC = @RC@
+ STRIP = @STRIP@
+ VERSION = @VERSION@
+ YACC = @YACC@
+diff -urN linux-atm.old/src/lib/Makefile.in linux-atm.dev/src/lib/Makefile.in
+--- linux-atm.old/src/lib/Makefile.in 2005-08-23 01:12:10.852786000 +0200
++++ linux-atm.dev/src/lib/Makefile.in 2005-08-23 01:12:46.607351032 +0200
+@@ -65,24 +65,35 @@
+ host_triplet = @host@
+ target_alias = @target_alias@
+ target_triplet = @target@
++AR = @AR@
+ AS = @AS@
+ CC = @CC@
++CXX = @CXX@
++CXXCPP = @CXXCPP@
+ DLLTOOL = @DLLTOOL@
+ ECHO = @ECHO@
++EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
++F77 = @F77@
++GCJ = @GCJ@
++GCJFLAGS = @GCJFLAGS@
++HAVE_LIB = @HAVE_LIB@
+ LEX = @LEX@
++LIB = @LIB@
+ LIBTOOL = @LIBTOOL@
+ LIBTOOL_DEPS = @LIBTOOL_DEPS@
+ LIBVER_AGE = @LIBVER_AGE@
+ LIBVER_CURRENT = @LIBVER_CURRENT@
+ LIBVER_REVISION = @LIBVER_REVISION@
+ LN_S = @LN_S@
++LTLIB = @LTLIB@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ PERL = @PERL@
+ RANLIB = @RANLIB@
++RC = @RC@
+ STRIP = @STRIP@
+ VERSION = @VERSION@
+ YACC = @YACC@
+diff -urN linux-atm.old/src/Makefile.in linux-atm.dev/src/Makefile.in
+--- linux-atm.old/src/Makefile.in 2005-08-23 01:12:10.851786000 +0200
++++ linux-atm.dev/src/Makefile.in 2005-08-23 01:12:46.572356352 +0200
+@@ -63,30 +63,40 @@
+ host_triplet = @host@
+ target_alias = @target_alias@
+ target_triplet = @target@
++AR = @AR@
+ AS = @AS@
+ CC = @CC@
++CXX = @CXX@
++CXXCPP = @CXXCPP@
+ DLLTOOL = @DLLTOOL@
+ ECHO = @ECHO@
++EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
++F77 = @F77@
++GCJ = @GCJ@
++GCJFLAGS = @GCJFLAGS@
++HAVE_LIB = @HAVE_LIB@
+ LEX = @LEX@
++LIB = @LIB@
+ LIBTOOL = @LIBTOOL@
+ LIBTOOL_DEPS = @LIBTOOL_DEPS@
+ LIBVER_AGE = @LIBVER_AGE@
+ LIBVER_CURRENT = @LIBVER_CURRENT@
+ LIBVER_REVISION = @LIBVER_REVISION@
+ LN_S = @LN_S@
++LTLIB = @LTLIB@
+ MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
+ PACKAGE = @PACKAGE@
+ PERL = @PERL@
+ RANLIB = @RANLIB@
++RC = @RC@
+ STRIP = @STRIP@
+ VERSION = @VERSION@
+ YACC = @YACC@
+
+-SUBDIRS = include lib
+-
++SUBDIRS = include lib br2684
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../config.h
+ CONFIG_CLEAN_FILES =
diff --git a/package/logrotate/Config.in b/package/logrotate/Config.in
new file mode 100644
index 000000000..08e20c4ba
--- /dev/null
+++ b/package/logrotate/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_LOGROTATE
+ prompt "logrotate......................... rotates, compresses, and mails system logs"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPOPT
+ help
+ logrotate is designed to ease administration of systems that generate
+ large numbers of log files. It allows auto-matic rotation, compression,
+ removal, and mailing of log files. Each log file may be handled
+ daily, weekly,monthly, or when it grows too large.
diff --git a/package/logrotate/Makefile b/package/logrotate/Makefile
new file mode 100644
index 000000000..52eed5347
--- /dev/null
+++ b/package/logrotate/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= logrotate
+PKG_VERSION:= 3.7.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 552639142e163745f6bcd4f1f3816d8a
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz
+MASTER_SITES:= http://ftp.debian.org/debian/pool/main/l/logrotate/
+
+include ${TOPDIR}/mk/package.mk
+
+${eval ${call PKG_template,LOGROTATE,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}}}
+
+TCFLAGS+= -D_GNU_SOURCE -DLinux -DVERSION=\"$(VERSION)\"
+ALL_TARGET= logrotate
+BUILD_STYLE= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LOGROTATE}/usr/sbin
+ ${CP} ${WRKBUILD}/logrotate ${IDIR_LOGROTATE}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_LOGROTATE}/etc/logrotate.d
+ ${CP} ./files/logrotate.conf ${IDIR_LOGROTATE}/etc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/logrotate/files/logrotate.conf b/package/logrotate/files/logrotate.conf
new file mode 100644
index 000000000..9a91db94f
--- /dev/null
+++ b/package/logrotate/files/logrotate.conf
@@ -0,0 +1,30 @@
+# rotate log files weekly
+weekly
+#daily
+
+# keep 4 weeks worth of backlogs
+rotate 4
+
+# create new (empty) log files after rotating old ones
+create
+
+notifempty
+nomail
+#olddir /var/log/backup/
+missingok
+#dateext
+
+# uncomment this if you want your log files compressed
+#compress
+
+# packages can drop log rotation information into this directory
+include /etc/logrotate.d
+
+# no packages own lastlog or wtmp -- we'll rotate them here
+#/var/log/wtmp {
+# monthly
+# create 0664 root utmp
+# rotate 1
+#}
+
+# system-specific logs may be also be configured here.
diff --git a/package/logrotate/ipkg/logrotate.control b/package/logrotate/ipkg/logrotate.control
new file mode 100644
index 000000000..1c984e58f
--- /dev/null
+++ b/package/logrotate/ipkg/logrotate.control
@@ -0,0 +1,6 @@
+Package: logrotate
+Priority: optional
+Section: misc
+Depends: libpopt
+Source: http://ftp.debian.org/debian/pool/main/l/logrotate
+Description: logrotate is designed to ease administration of systems that generate large numbers of log files.
diff --git a/package/logrotate/patches/patch-Makefile b/package/logrotate/patches/patch-Makefile
new file mode 100644
index 000000000..0ac175346
--- /dev/null
+++ b/package/logrotate/patches/patch-Makefile
@@ -0,0 +1,21 @@
+$Id$
+--- logrotate-3.7.1.orig/Makefile Thu Oct 9 22:05:07 2003
++++ logrotate-3.7.1/Makefile Sat Jan 20 19:25:23 2007
+@@ -3,7 +3,7 @@ CVSROOT = $(shell cat CVS/Root)
+ CVSTAG = r$(subst .,-,$(VERSION))
+ OS_NAME = $(shell uname -s)
+ LFS = $(shell echo `getconf LFS_CFLAGS 2>/dev/null`)
+-CFLAGS = -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
++CFLAGS ?= -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
+ PROG = logrotate
+ MAN = logrotate.8
+ LOADLIBES = -lpopt
+@@ -69,7 +69,7 @@ SOURCES = $(subst .o,.c,$(OBJS) $(LIBOBJ
+
+ ifeq ($(RPM_OPT_FLAGS),)
+ CFLAGS += -g
+-LDFLAGS = -g
++LDFLAGS ?= -g
+ endif
+
+ ifeq (.depend,$(wildcard .depend))
diff --git a/package/logrotate/patches/patch-config_c b/package/logrotate/patches/patch-config_c
new file mode 100644
index 000000000..deea32c0f
--- /dev/null
+++ b/package/logrotate/patches/patch-config_c
@@ -0,0 +1,59 @@
+$Id$
+--- logrotate-3.7.1.orig/config.c Thu Aug 7 13:13:14 2003
++++ logrotate-3.7.1/config.c Sat Jan 20 18:54:35 2007
+@@ -142,12 +142,17 @@ static int checkFile(const char * fname)
+ (!fname[1] || (fname[1] == '.' && !fname[2])))
+ return 0;
+
++ /* Don't include 'hidden' files either; this breaks Gentoo
++ portage config file management http://bugs.gentoo.org/87683 */
++ if (fname[0] == '.')
++ return 0;
++
+ /* Check if fname is ending in a taboo-extension; if so, return
+ false */
+ for (i = 0; i < tabooCount; i++) {
+ if (!strcmp(fname + strlen(fname) - strlen(tabooExts[i]),
+ tabooExts[i])) {
+- message(MESS_ERROR, "Ignoring %s, because of %s "
++ message(MESS_DEBUG, "Ignoring %s, because of %s "
+ "ending\n", fname, tabooExts[i]);
+
+ return 0;
+@@ -511,6 +516,14 @@ static int readConfigFile(const char * c
+ newlog->flags &= ~LOG_FLAG_IFEMPTY;
+
+ *endtag = oldchar, start = endtag;
++ } else if (!strcmp(start, "dateext")) {
++ newlog->flags |= LOG_FLAG_DATEEXT;
++
++ *endtag = oldchar, start = endtag;
++ } else if (!strcmp(start, "nodateext")) {
++ newlog->flags &= ~LOG_FLAG_DATEEXT;
++
++ *endtag = oldchar, start = endtag;
+ } else if (!strcmp(start, "noolddir")) {
+ newlog->oldDir = NULL;
+
+@@ -667,6 +680,21 @@ static int readConfigFile(const char * c
+ message(MESS_ERROR, "%s:%d bad start count '%s'\n",
+ configFile, lineNum, start);
+ return 1;
++ }
++ *endtag = oldchar, start = endtag;
++ }
++ } else if (!strcmp(start, "maxage")) {
++ *endtag = oldchar, start = endtag;
++
++ if (!isolateValue(configFile, lineNum, "maxage count", &start,
++ &endtag)) {
++ oldchar = *endtag, *endtag = '\0';
++
++ newlog->rotateAge = strtoul(start, &chptr, 0);
++ if (*chptr || newlog->rotateAge < 0) {
++ message(MESS_ERROR, "%s:%d bad maximum age '%s'\n",
++ configFile, lineNum, start);
++ return 1;
+ }
+ *endtag = oldchar, start = endtag;
+ }
diff --git a/package/logrotate/patches/patch-logrotate_8 b/package/logrotate/patches/patch-logrotate_8
new file mode 100644
index 000000000..0673a449c
--- /dev/null
+++ b/package/logrotate/patches/patch-logrotate_8
@@ -0,0 +1,28 @@
+$Id$
+--- logrotate-3.7.1.orig/logrotate.8 Thu Aug 7 13:13:14 2003
++++ logrotate-3.7.1/logrotate.8 Sat Jan 20 18:54:35 2007
+@@ -200,6 +200,11 @@ file for the omitted attributes. This op
+ Log files are rotated every day.
+
+ .TP
++\fBdateext\fR
++Archive old versions of log files adding a daily extension like YYYYMMDD
++instead of simply adding a number.
++
++.TP
+ \fBdelaycompress\fR
+ Postpone compression of the previous log file to the next rotation cycle.
+ This has only effect when used in combination with \fBcompress\fR.
+@@ -244,6 +249,12 @@ instead of the about-to-expire file.
+ \fBmaillast\fR
+ When using the \fBmail\fR command, mail the about-to-expire file,
+ instead of the just-rotated file (this is the default).
++
++.TP
++\fBmaxage\fR \fIcount\fR
++Remove rotated logs older than <count> days. The age is only checked
++if the logfile is to be rotated. The files are mailed to the
++configured address if \fBmaillast\fR and \fBmail\fR are configured.
+
+ .TP
+ \fBmissingok\fR
diff --git a/package/logrotate/patches/patch-logrotate_c b/package/logrotate/patches/patch-logrotate_c
new file mode 100644
index 000000000..0222b1e5c
--- /dev/null
+++ b/package/logrotate/patches/patch-logrotate_c
@@ -0,0 +1,429 @@
+$Id$
+--- logrotate-3.7.1.orig/logrotate.c Tue Oct 19 23:41:24 2004
++++ logrotate-3.7.1/logrotate.c Sat Jan 20 18:56:30 2007
+@@ -11,6 +11,7 @@
+ #include <sys/wait.h>
+ #include <time.h>
+ #include <unistd.h>
++#include <glob.h>
+
+ #ifdef WITH_SELINUX
+ #include <selinux/selinux.h>
+@@ -22,6 +23,10 @@ int selinux_enabled=0;
+ #include "log.h"
+ #include "logrotate.h"
+
++#if !defined(GLOB_ABORTED) && defined(GLOB_ABEND)
++#define GLOB_ABORTED GLOB_ABEND
++#endif
++
+ typedef struct {
+ char * fn;
+ struct tm lastRotated; /* only tm.mon, tm_mday, tm_year are good! */
+@@ -42,6 +47,14 @@ int debug = 0;
+ char * mailCommand = DEFAULT_MAIL_COMMAND;
+ time_t nowSecs = 0;
+
++static int globerr(const char * pathname, int theerr) {
++ message(MESS_ERROR, "error accessing %s: %s\n", pathname,
++ strerror(theerr));
++
++ /* We want the glob operation to continue, so return 0 */
++ return 1;
++}
++
+ static logState * findState(const char * fn, struct stateSet * sip) {
+ int i;
+ logState * states = sip->states;
+@@ -49,9 +62,11 @@ static logState * findState(const char *
+ struct tm now = *localtime(&nowSecs);
+ time_t lr_time;
+
++ /* find the filename fn in the statesPtr list */
+ for (i = 0; i < numStates; i++)
+ if (!strcmp(fn, states[i].fn)) break;
+
++ /* not in statesPtr list, so add new entry */
+ if (i == numStates) {
+ i = numStates++;
+ states = realloc(states, sizeof(*states) * numStates);
+@@ -75,10 +90,7 @@ static logState * findState(const char *
+ }
+
+ static int runScript(char * logfn, char * script) {
+- int fd;
+- char *filespec;
+ int rc;
+- char buf[256];
+
+ if (debug) {
+ message(MESS_DEBUG, "running script with arg %s: \"%s\"\n",
+@@ -86,39 +98,24 @@ static int runScript(char * logfn, char
+ return 0;
+ }
+
+- filespec = buf;
+- snprintf(buf, sizeof(buf), "%s/logrotate.XXXXXX", getenv("TMPDIR") ?: "/tmp");
+- fd = -1;
+- if (!filespec || (fd = mkstemp(filespec)) < 0 || fchmod(fd, 0700)) {
+- message(MESS_DEBUG, "error creating %s: %s\n", filespec,
+- strerror(errno));
+- if (fd >= 0) {
+- close(fd);
+- unlink(filespec);
+- }
+- return -1;
+- }
+-
+- if (write(fd, "#!/bin/sh\n\n", 11) != 11 ||
+- write(fd, script, strlen(script)) != strlen(script)) {
+- message(MESS_DEBUG, "error writing %s\n", filespec);
+- close(fd);
+- unlink(filespec);
+- return -1;
+- }
+-
+- close(fd);
+-
+ if (!fork()) {
+- execlp(filespec, filespec, logfn, NULL);
++ execl("/bin/sh", "sh", "-c", script, NULL);
+ exit(1);
+ }
+
+ wait(&rc);
++ return rc;
++}
+
+- unlink(filespec);
++static int removeLogFile(char * name) {
++ message(MESS_DEBUG, "removing old log %s\n", name);
+
+- return rc;
++ if (!debug && unlink(name)) {
++ message(MESS_ERROR, "Failed to remove old log %s: %s\n",
++ name, strerror(errno));
++ return 1;
++ }
++ return 0;
+ }
+
+ static int compressLogFile(char * name, logInfo * log, struct stat *sb) {
+@@ -265,6 +262,25 @@ static int mailLog(char * logFile, char
+ return rc;
+ }
+
++static int mailLogWrapper (char * mailFilename, char * mailCommand, int logNum, logInfo * log) {
++ /* if the log is compressed (and we're not mailing a
++ * file whose compression has been delayed), we need
++ * to uncompress it */
++ if ((log->flags & LOG_FLAG_COMPRESS) &&
++ !((log->flags & LOG_FLAG_DELAYCOMPRESS) &&
++ (log->flags & LOG_FLAG_MAILFIRST))) {
++ if (mailLog(mailFilename, mailCommand,
++ log->uncompress_prog, log->logAddress,
++ log->files[logNum]))
++ return 1;
++ } else {
++ if (mailLog(mailFilename, mailCommand, NULL,
++ log->logAddress, mailFilename))
++ return 1;
++ }
++ return 0;
++}
++
+ static int copyTruncate(char * currLog, char * saveLog, struct stat * sb, int flags) {
+ char buf[BUFSIZ];
+ int fdcurr = -1, fdsave = -1;
+@@ -424,12 +440,15 @@ int findNeedRotating(logInfo * log, int
+ switch (log->criterium) {
+ case ROT_WEEKLY:
+ /* rotate if:
+- 1) the current weekday is before the weekday of the
+- last rotation
++ 1) the day of the week is the same as the day of the week of
++ the previous rotation but not the same day of the year
++ this will rotate it on the same day every week, but not
++ twice a day.
+ 2) more then a week has passed since the last
+ rotation */
+- state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday) ||
+- ((mktime(&now) - mktime(&state->lastRotated)) >
++ state->doRotate = ((now.tm_wday == state->lastRotated.tm_wday &&
++ now.tm_yday != state->lastRotated.tm_yday) ||
++ ((mktime(&now) - mktime(&state->lastRotated)) >
+ (7 * 24 * 3600)));
+ break;
+ case ROT_MONTHLY:
+@@ -479,6 +498,9 @@ int rotateSingleLog(logInfo * log, int l
+ char * baseName;
+ char * dirName;
+ char * firstRotated;
++ char * glob_pattern;
++ glob_t globResult;
++ int rc;
+ size_t alloc_size;
+ int rotateCount = log->rotateCount ? log->rotateCount : 1;
+ int logStart = (log->logStart == -1) ? 1 : log->logStart;
+@@ -509,7 +531,7 @@ int rotateSingleLog(logInfo * log, int l
+
+ alloc_size = strlen(dirName) + strlen(baseName) +
+ strlen(log->files[logNum]) + strlen(fileext) +
+- strlen(compext) + 10;
++ strlen(compext) + 18;
+
+ oldName = alloca(alloc_size);
+ newName = alloca(alloc_size);
+@@ -531,16 +553,116 @@ int rotateSingleLog(logInfo * log, int l
+ /* First compress the previous log when necessary */
+ if (log->flags & LOG_FLAG_COMPRESS &&
+ log->flags & LOG_FLAG_DELAYCOMPRESS) {
+- struct stat sbprev;
+-
+- sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
+- if (stat(oldName, &sbprev)) {
+- message(MESS_DEBUG, "previous log %s does not exist\n",
+- oldName);
+- } else {
+- hasErrors = compressLogFile(oldName, log, &sbprev);
++ if (log->flags & LOG_FLAG_DATEEXT) {
++ /* glob for uncompressed files with our pattern */
++ glob_pattern = malloc(strlen(dirName) + strlen(baseName)
++ + strlen(fileext) + 44 );
++ sprintf(glob_pattern,
++ "%s/%s-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%s",
++ dirName, baseName, fileext);
++ rc = glob(glob_pattern, 0, globerr, &globResult);
++ if (!rc && globResult.gl_pathc > 0) {
++ for (i = 0; i < globResult.gl_pathc && !hasErrors; i++) {
++ struct stat sbprev;
++ sprintf(oldName,"%s",(globResult.gl_pathv)[i]);
++ if (stat(oldName, &sbprev)) {
++ message(MESS_DEBUG, "previous log %s does not exist\n", oldName);
++ } else {
++ hasErrors = compressLogFile(oldName, log, &sbprev);
++ }
++ }
++ } else {
++ message (MESS_DEBUG, "glob finding logs to compress failed\n");
++ /* fallback to old behaviour */
++ sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
++ }
++ globfree(&globResult);
++ free(glob_pattern);
++ } else {
++ struct stat sbprev;
++
++ sprintf(oldName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
++ if (stat(oldName, &sbprev)) {
++ message(MESS_DEBUG, "previous log %s does not exist\n",
++ oldName);
++ } else {
++ hasErrors = compressLogFile(oldName, log, &sbprev);
++ }
+ }
+ }
++
++ firstRotated = alloca(strlen(dirName) + strlen(baseName) +
++ strlen(fileext) + strlen(compext) + 30);
++
++ if(log->flags & LOG_FLAG_DATEEXT) {
++ /* glob for compressed files with our pattern
++ * and compress ext */
++ glob_pattern = malloc(strlen(dirName)+strlen(baseName)
++ +strlen(fileext)+strlen(compext)+44);
++ sprintf(glob_pattern,
++ "%s/%s-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%s%s",
++ dirName, baseName, fileext, compext);
++ rc = glob(glob_pattern, 0, globerr, &globResult);
++ if (!rc) {
++ /* search for files to drop, if we find one remember it,
++ * if we find another one mail and remove the first and
++ * remember the second and so on */
++ struct stat fst_buf;
++ int mail_out = -1;
++ /* remove the first (n - rotateCount) matches
++ * no real rotation needed, since the files have
++ * the date in their name */
++ for (i = 0; i < globResult.gl_pathc; i++) {
++ if( !stat((globResult.gl_pathv)[i],&fst_buf) ) {
++ if ((i <= ((int)globResult.gl_pathc - rotateCount))
++ || ((log->rotateAge > 0)
++ && (((nowSecs - fst_buf.st_mtime)/60/60/24)
++ > log->rotateAge))) {
++ if ( mail_out != -1 ) {
++ if (!hasErrors && log->logAddress) {
++ char * mailFilename = (globResult.gl_pathv)[mail_out];
++ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
++ if (!hasErrors)
++ hasErrors = removeLogFile(mailFilename);
++ }
++ }
++ mail_out = i;
++ }
++ }
++ }
++ if ( mail_out != -1 ) {
++ /* oldName is oldest Backup found (for unlink later) */
++ sprintf(oldName, "%s", (globResult.gl_pathv)[mail_out]);
++ strcpy(disposeName, oldName);
++ } else
++ disposeName = NULL;
++ } else {
++ message (MESS_DEBUG, "glob finding old rotated logs failed\n");
++ disposeName = NULL;
++ }
++ /* firstRotated is most recently created/compressed rotated log */
++ sprintf(firstRotated, "%s/%s-%04d%02d%02d%s%s",
++ dirName, baseName, now.tm_year+1900,
++ now.tm_mon+1, now.tm_mday, fileext, compext);
++ globfree(&globResult);
++ free(glob_pattern);
++ } else {
++ if ( log->rotateAge ) {
++ struct stat fst_buf;
++ for (i=1; i <= rotateCount; i++) {
++ sprintf(oldName, "%s/%s.%d%s%s", dirName, baseName,
++ rotateCount + 1, fileext, compext);
++ if(!stat(oldName,&fst_buf)
++ && (((nowSecs - fst_buf.st_mtime)/60/60/24)
++ > log->rotateAge)) {
++ char * mailFilename = (globResult.gl_pathv)[i];
++ if (!hasErrors && log->logAddress)
++ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
++ if (!hasErrors)
++ hasErrors = removeLogFile(mailFilename);
++ }
++ }
++ }
+
+ sprintf(oldName, "%s/%s.%d%s%s", dirName, baseName,
+ logStart + rotateCount, fileext, compext);
+@@ -548,8 +670,6 @@ int rotateSingleLog(logInfo * log, int l
+
+ strcpy(disposeName, oldName);
+
+- firstRotated = alloca(strlen(dirName) + strlen(baseName) +
+- strlen(fileext) + strlen(compext) + 30);
+ sprintf(firstRotated, "%s/%s.%d%s%s", dirName, baseName,
+ logStart, fileext,
+ (log->flags & LOG_FLAG_DELAYCOMPRESS) ? "" : compext);
+@@ -600,12 +720,27 @@ int rotateSingleLog(logInfo * log, int l
+ }
+ }
+ }
+-
++ } /* !LOG_FLAG_DATEEXT */
++
+ finalName = oldName;
+-
+- /* note: the gzip extension is *not* used here! */
+- sprintf(finalName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
+-
++
++ if(log->flags & LOG_FLAG_DATEEXT) {
++ char * destFile = alloca(strlen(dirName) + strlen(baseName) +
++ strlen(fileext) + strlen(compext) + 30);
++ struct stat fst_buf;
++ sprintf(finalName, "%s/%s-%04d%02d%02d%s",
++ dirName, baseName, now.tm_year+1900,
++ now.tm_mon+1, now.tm_mday, fileext);
++ sprintf(destFile, "%s%s", finalName, compext);
++ if(!stat(destFile,&fst_buf)) {
++ message (MESS_DEBUG, "destination %s already exists, skipping rotation\n", firstRotated);
++ hasErrors = 1;
++ }
++ } else {
++ /* note: the gzip extension is *not* used here! */
++ sprintf(finalName, "%s/%s.%d%s", dirName, baseName, logStart, fileext);
++ }
++
+ /* if the last rotation doesn't exist, that's okay */
+ if (!debug && access(disposeName, F_OK)) {
+ message(MESS_DEBUG, "log %s doesn't exist -- won't try to "
+@@ -613,9 +748,6 @@ int rotateSingleLog(logInfo * log, int l
+ disposeName = NULL;
+ }
+
+- free(dirName);
+- free(baseName);
+-
+ if (!hasErrors) {
+ if (log->pre && !(log->flags & LOG_FLAG_SHAREDSCRIPTS)) {
+ message(MESS_DEBUG, "running prerotate script\n");
+@@ -722,33 +854,12 @@ int rotateSingleLog(logInfo * log, int l
+ else
+ mailFilename = disposeName;
+
+- if (mailFilename) {
+- /* if the log is compressed (and we're not mailing a
+- file whose compression has been delayed), we need
+- to uncompress it */
+- if ((log->flags & LOG_FLAG_COMPRESS) &&
+- !((log->flags & LOG_FLAG_DELAYCOMPRESS) &&
+- (log->flags & LOG_FLAG_MAILFIRST))) {
+- if (mailLog(mailFilename, mailCommand,
+- log->uncompress_prog, log->logAddress,
+- log->files[logNum]))
+- hasErrors = 1;
+- } else {
+- if (mailLog(mailFilename, mailCommand, NULL,
+- log->logAddress, mailFilename))
+- hasErrors = 1;
+- }
+- }
++ if (mailFilename)
++ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
+ }
+
+ if (!hasErrors && disposeName) {
+- message(MESS_DEBUG, "removing old log %s\n", disposeName);
+-
+- if (!debug && unlink(disposeName)) {
+- message(MESS_ERROR, "Failed to remove old log %s: %s\n",
+- disposeName, strerror(errno));
+- hasErrors = 1;
+- }
++ hasErrors = removeLogFile(disposeName);
+ }
+ }
+
+@@ -761,6 +872,8 @@ int rotateSingleLog(logInfo * log, int l
+ }
+ }
+ #endif
++ free(dirName);
++ free(baseName);
+ return hasErrors;
+ }
+
+@@ -1002,7 +1115,7 @@ static int readState(char * stateFilenam
+ }
+
+ /* Hack to hide earlier bug */
+- if ((year != 1900) && (year < 1996 || year > 2100)) {
++ if ((year != 1900) && (year < 1970 || year > 2100)) {
+ message(MESS_ERROR, "bad year %d for file %s in state file %s\n",
+ year, argv[0], stateFilename);
+ fclose(f);
+@@ -1047,7 +1160,9 @@ static int readState(char * stateFilenam
+
+ int main(int argc, const char ** argv) {
+ logInfo defConfig = { NULL, NULL, 0, NULL, ROT_SIZE,
+- /* threshHold */ 1024 * 1024, 0,
++ /* threshHold */ 1024 * 1024,
++ /* rotateCount */ 0,
++ /* rotateAge */ 0,
+ /* log start */ -1,
+ /* pre, post */ NULL, NULL,
+ /* first, last */ NULL, NULL,
+@@ -1108,8 +1223,7 @@ int main(int argc, const char ** argv) {
+
+ files = poptGetArgs((poptContext) optCon);
+ if (!files) {
+- fprintf(stderr, "logrotate " VERSION
+- " - Copyright (C) 1995-2001 Red Hat, Inc.\n");
++ fprintf(stderr, "logrotate - Copyright (C) 1995-2001 Red Hat, Inc.\n");
+ fprintf(stderr, "This may be freely redistributed under the terms of "
+ "the GNU Public License\n\n");
+ poptPrintUsage(optCon, stderr, 0);
diff --git a/package/logrotate/patches/patch-logrotate_h b/package/logrotate/patches/patch-logrotate_h
new file mode 100644
index 000000000..9a3adefc5
--- /dev/null
+++ b/package/logrotate/patches/patch-logrotate_h
@@ -0,0 +1,19 @@
+$Id$
+--- logrotate-3.7.1.orig/logrotate.h Thu Aug 7 13:13:14 2003
++++ logrotate-3.7.1/logrotate.h Sat Jan 20 18:54:35 2007
+@@ -15,6 +15,7 @@
+ #define LOG_FLAG_MAILFIRST (1 << 6)
+ #define LOG_FLAG_SHAREDSCRIPTS (1 << 7)
+ #define LOG_FLAG_COPY (1 << 8)
++#define LOG_FLAG_DATEEXT (1 << 9)
+
+ #define NO_FORCE_ROTATE 0
+ #define FORCE_ROTATE 1
+@@ -34,6 +35,7 @@ typedef struct {
+ enum { ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_SIZE, ROT_FORCE } criterium;
+ unsigned int threshhold;
+ int rotateCount;
++ int rotateAge;
+ int logStart;
+ char * pre, * post, * first, * last;
+ char * logAddress;
diff --git a/package/lrzsz/Config.in b/package/lrzsz/Config.in
new file mode 100644
index 000000000..1d8108b6b
--- /dev/null
+++ b/package/lrzsz/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_LRZSZ
+ prompt "lrsz.............................. X,Y and Z-modem protocols"
+ tristate
+ default n
+ help
+ Transfer files in your login sessions.
+ Very leightweight ans straight forward.
+ You just need a terminal client that can do
+ either X, Y or Z-modem file transfers.
+
+ http://www.ohse.de/uwe/software/lrzsz.html
diff --git a/package/lrzsz/Makefile b/package/lrzsz/Makefile
new file mode 100644
index 000000000..60cac545f
--- /dev/null
+++ b/package/lrzsz/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= lrzsz
+PKG_VERSION:= 0.12.20
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b5ce6a74abc9b9eb2af94dffdfd372a4
+MASTER_SITES:= http://www.ohse.de/uwe/releases/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LRZSZ,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-libiconv-prefix \
+ --without-libintl-prefix
+BUILD_STYLE:= auto
+#INSTALL_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LRZSZ}/usr/bin
+ ${CP} ${WRKBUILD}/src/lrz ${IDIR_LRZSZ}/usr/bin/
+ ${CP} ${WRKBUILD}/src/lsz ${IDIR_LRZSZ}/usr/bin/
+ (cd ${IDIR_LRZSZ}/usr/bin; \
+ ln -fs lrz lrx; \
+ ln -fs lrz lrb; \
+ ln -fs lsz lsx; \
+ ln -fs lsz lsb; \
+ );
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/lrzsz/ipkg/lrzsz.control b/package/lrzsz/ipkg/lrzsz.control
new file mode 100644
index 000000000..3e6344bab
--- /dev/null
+++ b/package/lrzsz/ipkg/lrzsz.control
@@ -0,0 +1,5 @@
+Package: lrzsz
+Priority: optional
+Section: communications
+Source: http://www.ohse.de/uwe/software/lrzsz.html
+Description: X-Modem, Y-modem, Z-modem protocol handlers. Transfer files in a terminal session. You just need a terminal client that supports x,y or z-modem
diff --git a/package/ltp/Config.in b/package/ltp/Config.in
new file mode 100644
index 000000000..5833e8092
--- /dev/null
+++ b/package/ltp/Config.in
@@ -0,0 +1,16 @@
+config ADK_PACKAGE_LTP
+ prompt "ltp............................... The Linux Test Project Suite (BEWARE: HUGE!!)"
+ tristate
+ default n
+ help
+ The Linux Test Project is a joint project started by SGI and
+ maintained by IBM, that has a goal to deliver test suites to
+ the open source community that validate the reliability,
+ robustness, and stability of Linux. The LTP testsuite contains
+ a collection of tools for testing the Linux kernel and related
+ features.
+
+ BEWARE: this is a very huge package, and therefore merely usable
+ from an embedded system. It will consume about 150MB!
+
+ http://ltp.sourceforge.net/
diff --git a/package/ltp/Makefile b/package/ltp/Makefile
new file mode 100644
index 000000000..f803bfeee
--- /dev/null
+++ b/package/ltp/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ltp-full
+PKG_VERSION:= 20061121
+PKG_RELEASE:= 2
+PKG_MD5SUM:= f01dd2119c5d4462e876229df394ecbf
+MASTER_SITES:= http://switch.dl.sourceforge.net/sourceforge/ltp/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LTP,ltp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= CROSS_COMPILER="${TARGET_CROSS}" \
+ CROSS_CFLAGS="${TCFLAGS} -I${WRKBUILD}/include" \
+ CPPFLAGS="${TCPPFLAGS}" \
+ LDFLAGS="${TLDFLAGS}"
+
+post-install:
+ ${CP} ${WRKBUILD} ${IDIR_LTP}
+ find ${IDIR_LTP} \( -name '*.c' -o -name '*.h' -o -name '*.o' \) -exec rm '{}' \;
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ltp/ipkg/ltp.control b/package/ltp/ipkg/ltp.control
new file mode 100644
index 000000000..24960d811
--- /dev/null
+++ b/package/ltp/ipkg/ltp.control
@@ -0,0 +1,4 @@
+Package: ltp
+Priority: optional
+Section: utilities
+Description: the Linux Test Project Suite (full)
diff --git a/package/ltp/patches/patch-Makefile b/package/ltp/patches/patch-Makefile
new file mode 100644
index 000000000..a7f4d050d
--- /dev/null
+++ b/package/ltp/patches/patch-Makefile
@@ -0,0 +1,20 @@
+$Id$
+Installation as root is never done anyway, so remove this crap
+--- ltp-full-20061121.orig/Makefile 2006-11-21 21:31:20.000000000 +0100
++++ ltp-full-20061121/Makefile 2006-12-06 12:08:02.000000000 +0100
+@@ -44,15 +44,10 @@ all: libltp.a
+ @$(MAKE) -C pan $@
+ @$(MAKE) -C testcases $@
+ @$(MAKE) -C tools $@
+- @echo
+- @echo "***********************************************"
+- @echo "** You now need to do a make install as root **"
+- @echo "***********************************************"
+
+ install: all
+ @$(MAKE) -C testcases install
+ @$(MAKE) -C tools install
+- @./IDcheck.sh
+
+ libltp.a:
+ @$(MAKE) -C lib $@
diff --git a/package/ltp/patches/patch-runltp b/package/ltp/patches/patch-runltp
new file mode 100644
index 000000000..342a454d4
--- /dev/null
+++ b/package/ltp/patches/patch-runltp
@@ -0,0 +1,22 @@
+$Id$
+ash does not understand the test '-a' (test for bare existence)
+--- ltp-full-20061121.orig/runltp 2006-11-21 21:31:20.000000000 +0100
++++ ltp-full-20061121/runltp 2006-12-06 13:22:14.000000000 +0100
+@@ -285,7 +285,7 @@ main()
+ ${LTPROOT}/runtest/sched ${LTPROOT}/runtest/math \
+ ${LTPROOT}/runtest/nptl ${LTPROOT}/runtest/pty
+ do
+- [ -a "$SCENFILES" ] || \
++ [ -e "$SCENFILES" ] || \
+ {
+ echo "FATAL: missing scenario file $SCENFILES"
+ exit 1
+@@ -319,7 +319,7 @@ main()
+ ${LTPROOT}/runtest/rpc \
+ ${LTPROOT}/runtest/nfs
+ do
+- [ -a "$SCENFILES" ] || \
++ [ -e "$SCENFILES" ] || \
+ {
+ echo "FATAL: missing scenario file $SCENFILES"
+ exit 1
diff --git a/package/ltp/patches/patch-testcases_kernel_syscalls_Makefile b/package/ltp/patches/patch-testcases_kernel_syscalls_Makefile
new file mode 100644
index 000000000..a90351258
--- /dev/null
+++ b/package/ltp/patches/patch-testcases_kernel_syscalls_Makefile
@@ -0,0 +1,13 @@
+$Id$
+excluded pselect for now, as there is no support for it in kernel-2.4
+--- ltp-full-20061121.orig/testcases/kernel/syscalls/Makefile 2006-11-21 21:31:28.000000000 +0100
++++ ltp-full-20061121/testcases/kernel/syscalls/Makefile 2006-12-06 11:24:39.000000000 +0100
+@@ -25,7 +25,7 @@ EXCLUDE_DIR=epoll
+ #
+ # Commented this out since there are directories here we don't want built by default
+ #
+-SUBDIR = `ls */Makefile | sed "s/Makefile//g" | grep -v epoll`
++SUBDIR = `ls */Makefile | sed "s/Makefile//g" | grep -vE "^epoll|pselect"`
+ UCLINUX_SUBDIR = `ls */Makefile | sed "s/Makefile//g" | grep -vE "^fork|epoll|capget|capset|chmod|chown|llseek|nftw|clone|profil|getcontext"`
+
+ all:
diff --git a/package/ltp/patches/patch-testcases_misc_math_Makefile b/package/ltp/patches/patch-testcases_misc_math_Makefile
new file mode 100644
index 000000000..ce705b2b3
--- /dev/null
+++ b/package/ltp/patches/patch-testcases_misc_math_Makefile
@@ -0,0 +1,10 @@
+$Id$
+excluding nextafter, does not build (strange macro is missing)
+--- ltp-full-20061121.orig/testcases/misc/math/Makefile 2006-11-21 21:31:27.000000000 +0100
++++ ltp-full-20061121/testcases/misc/math/Makefile 2006-12-06 11:54:56.000000000 +0100
+@@ -1,4 +1,4 @@
+-SUBDIRS = abs atof float fptests nextafter
++SUBDIRS = abs atof float fptests
+
+ all:
+ @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
diff --git a/package/ltp/patches/patch-testcases_misc_math_float_Makefile b/package/ltp/patches/patch-testcases_misc_math_float_Makefile
new file mode 100644
index 000000000..4b9c41422
--- /dev/null
+++ b/package/ltp/patches/patch-testcases_misc_math_float_Makefile
@@ -0,0 +1,18 @@
+$Id$
+Excluded bessel tests as they do not compile.
+FIXME: needs some asm rework perhaps.
+--- ltp-full-20061121.orig/testcases/misc/math/float/Makefile 2006-11-21 21:31:27.000000000 +0100
++++ ltp-full-20061121/testcases/misc/math/float/Makefile 2006-12-06 11:31:45.000000000 +0100
+@@ -1,10 +1,10 @@
+ CFLAGS+= -I../../../../include -Wall -g
+ LOADLIBES+= -lpthread -lm -L../../../../lib -lltp
+
+-SRCS=$(wildcard float*.c)
++SRCS=$(patsubst float_bessel.c,,$(wildcard float*.c))
+ TARGETS=$(patsubst %.c,%,$(SRCS))
+
+-SUBDIRS=bessel exp_log iperb power trigo
++SUBDIRS=exp_log iperb power trigo
+
+ all: $(TARGETS)
+ @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
diff --git a/package/lua/Config.in b/package/lua/Config.in
new file mode 100644
index 000000000..1fbff9ebe
--- /dev/null
+++ b/package/lua/Config.in
@@ -0,0 +1,111 @@
+#menu "lua............................... LUA programming language"
+
+config ADK_COMPILE_LUA
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBLUA
+
+config ADK_PACKAGE_LIBLUA
+ prompt "liblua............................ LUA programming language shared libraries"
+ tristate
+ select ADK_COMPILE_LUA
+ help
+ Lua is a powerful light-weight programming language designed for extending
+ applications. Lua is also frequently used as a general-purpose, stand-alone
+ language. Lua is free software.
+
+ Lua combines simple procedural syntax with powerful data description
+ constructs based on associative arrays and extensible semantics. Lua is
+ dynamically typed, interpreted from bytecodes, and has automatic memory
+ management with garbage collection, making it ideal for configuration,
+ scripting, and rapid prototyping.
+
+ Lua is implemented as a small library of C functions, written in ANSI C, and
+ compiles unmodified in all known platforms. The implementation goals are
+ simplicity, efficiency, portability, and low embedding cost. The result is a
+ fast language engine with small footprint, making it ideal in embedded systems
+ too.
+
+ http://www.lua.org/
+
+ This package contains the LUA shared libraries, needed by other programs.
+
+config ADK_PACKAGE_LUA
+ prompt "lua............................... LUA programming language interpreter"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBLUA
+ help
+ Lua is a powerful light-weight programming language designed for extending
+ applications. Lua is also frequently used as a general-purpose, stand-alone
+ language. Lua is free software.
+
+ Lua combines simple procedural syntax with powerful data description
+ constructs based on associative arrays and extensible semantics. Lua is
+ dynamically typed, interpreted from bytecodes, and has automatic memory
+ management with garbage collection, making it ideal for configuration,
+ scripting, and rapid prototyping.
+
+ Lua is implemented as a small library of C functions, written in ANSI C, and
+ compiles unmodified in all known platforms. The implementation goals are
+ simplicity, efficiency, portability, and low embedding cost. The result is a
+ fast language engine with small footprint, making it ideal in embedded systems
+ too.
+
+ http://www.lua.org/
+
+ This package contains the LUA language interpreter.
+
+config ADK_PACKAGE_LUAC
+ prompt "luac.............................. LUA programming language compiler"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBLUA
+ help
+ Lua is a powerful light-weight programming language designed for extending
+ applications. Lua is also frequently used as a general-purpose, stand-alone
+ language. Lua is free software.
+
+ Lua combines simple procedural syntax with powerful data description
+ constructs based on associative arrays and extensible semantics. Lua is
+ dynamically typed, interpreted from bytecodes, and has automatic memory
+ management with garbage collection, making it ideal for configuration,
+ scripting, and rapid prototyping.
+
+ Lua is implemented as a small library of C functions, written in ANSI C, and
+ compiles unmodified in all known platforms. The implementation goals are
+ simplicity, efficiency, portability, and low embedding cost. The result is a
+ fast language engine with small footprint, making it ideal in embedded systems
+ too.
+
+ http://www.lua.org/
+
+ This package contains the LUA language compiler.
+
+config ADK_PACKAGE_LUA_EXAMPLES
+ prompt "lua-examples...................... LUA programming language examples"
+ tristate
+ default n
+ select ADK_PACKAGE_LUA
+ help
+ Lua is a powerful light-weight programming language designed for extending
+ applications. Lua is also frequently used as a general-purpose, stand-alone
+ language. Lua is free software.
+
+ Lua combines simple procedural syntax with powerful data description
+ constructs based on associative arrays and extensible semantics. Lua is
+ dynamically typed, interpreted from bytecodes, and has automatic memory
+ management with garbage collection, making it ideal for configuration,
+ scripting, and rapid prototyping.
+
+ Lua is implemented as a small library of C functions, written in ANSI C, and
+ compiles unmodified in all known platforms. The implementation goals are
+ simplicity, efficiency, portability, and low embedding cost. The result is a
+ fast language engine with small footprint, making it ideal in embedded systems
+ too.
+
+ http://www.lua.org/
+
+ This package contains LUA language examples.
+
+#endmenu
diff --git a/package/lua/Makefile b/package/lua/Makefile
new file mode 100644
index 000000000..45973bcab
--- /dev/null
+++ b/package/lua/Makefile
@@ -0,0 +1,62 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= lua
+PKG_VERSION:= 5.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= dea74646b7e5c621fef7174df83c34b1
+MASTER_SITES:= http://www.lua.org/ftp/ \
+ http://ftp.gwdg.de/pub/languages/lua/ \
+ http://mirrors.dotsrc.org/lua/ \
+ http://www.tecgraf.puc-rio.br/lua/ftp/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBLUA,liblua,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LUA,lua,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LUAC,luac,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LUA_EXAMPLES,lua-examples,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${MAKE} -C ${WRKBUILD} \
+ CC="${TARGET_CC}" \
+ LD="${TARGET_CROSS}ld" \
+ AR="${TARGET_CROSS}ar rcu" \
+ RANLIB="${TARGET_CROSS}ranlib" \
+ INSTALL_ROOT=/usr \
+ MYCFLAGS="${TCFLAGS} ${TCPPFLAGS}" \
+ MYLDFLAGS="${TLDFLAGS}" \
+ all so
+ # remove statically linked binaries, so that they will get linked against shlib this time
+ rm -f ${WRKBUILD}/bin/lua{,c}
+ ${MAKE} -C ${WRKBUILD} \
+ CC="${TARGET_CC}" \
+ LD="${TARGET_CROSS}ld" \
+ AR="${TARGET_CROSS}ar rcu" \
+ RANLIB="${TARGET_CROSS}ranlib" \
+ INSTALL_ROOT=/usr \
+ MYCFLAGS="${TCFLAGS} ${TCPPFLAGS}" \
+ MYLDFLAGS="${TLDFLAGS}" \
+ all
+ rm -rf ${WRKINST}
+ mkdir -p ${WRKINST}
+ ${MAKE} -C ${WRKBUILD} \
+ INSTALL_ROOT="${WRKINST}/usr" \
+ install soinstall
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LIBLUA}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/liblua{,lib}.so.* ${IDIR_LIBLUA}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_LUA}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/lua ${IDIR_LUA}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_LUAC}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/luac ${IDIR_LUAC}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_LUA_EXAMPLES}/usr/share/lua/examples
+ ${INSTALL_DATA} ${WRKBUILD}/test/*.lua \
+ ${IDIR_LUA_EXAMPLES}/usr/share/lua/examples/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/lua/ipkg/liblua.control b/package/lua/ipkg/liblua.control
new file mode 100644
index 000000000..502523a53
--- /dev/null
+++ b/package/lua/ipkg/liblua.control
@@ -0,0 +1,4 @@
+Package: liblua
+Priority: optional
+Section: libs
+Description: LUA programming language shared libraries
diff --git a/package/lua/ipkg/lua-examples.control b/package/lua/ipkg/lua-examples.control
new file mode 100644
index 000000000..fc0e46e07
--- /dev/null
+++ b/package/lua/ipkg/lua-examples.control
@@ -0,0 +1,5 @@
+Package: lua-examples
+Priority: optional
+Section: devel
+Description: LUA programming language examples
+Depends: lua
diff --git a/package/lua/ipkg/lua.control b/package/lua/ipkg/lua.control
new file mode 100644
index 000000000..a938103ee
--- /dev/null
+++ b/package/lua/ipkg/lua.control
@@ -0,0 +1,5 @@
+Package: lua
+Priority: optional
+Section: admin
+Description: LUA programming language interpreter
+Depends: liblua
diff --git a/package/lua/ipkg/luac.control b/package/lua/ipkg/luac.control
new file mode 100644
index 000000000..f379f9e45
--- /dev/null
+++ b/package/lua/ipkg/luac.control
@@ -0,0 +1,5 @@
+Package: luac
+Priority: optional
+Section: devel
+Description: LUA programming language compiler
+Depends: liblua
diff --git a/package/lua/patches/lua-5.0.2-config.patch b/package/lua/patches/lua-5.0.2-config.patch
new file mode 100644
index 000000000..fa5b0e765
--- /dev/null
+++ b/package/lua/patches/lua-5.0.2-config.patch
@@ -0,0 +1,31 @@
+diff -ruN lua-5.0.2-orig/config lua-5.0.2-1/config
+--- lua-5.0.2-orig/config 2003-04-11 16:00:41.000000000 +0200
++++ lua-5.0.2-1/config 2005-05-25 11:23:35.000000000 +0200
+@@ -25,15 +25,15 @@
+ # interface (e.g., Linux, Solaris, IRIX, BSD, AIX, HPUX, and probably others),
+ # uncomment the next two lines.
+ #
+-#LOADLIB= -DUSE_DLOPEN=1
+-#DLLIB= -ldl
++LOADLIB= -DUSE_DLOPEN=1
++DLLIB= -ldl
+ #
+ # In Linux with gcc, you should also uncomment the next definition for
+ # MYLDFLAGS, which passes -E (= -export-dynamic) to the linker. This option
+ # allows dynamic libraries to link back to the `lua' program, so that they do
+ # not need the Lua libraries. (Other systems may have an equivalent facility.)
+ #
+-#MYLDFLAGS= -Wl,-E
++MYLDFLAGS= -Wl,-E
+ #
+ # On Windows systems. support for dynamic loading is enabled by default.
+ # To disable this support, uncomment the next line.
+@@ -142,7 +142,7 @@
+
+ # This should work in all Unix systems, but you may want to add options.
+ #
+-STRIP= strip
++STRIP= /bin/true
+
+ # ------------------------------------------------------------------ install
+
diff --git a/package/lua/patches/lua-5.0.2-soname.patch b/package/lua/patches/lua-5.0.2-soname.patch
new file mode 100644
index 000000000..3364ff6ad
--- /dev/null
+++ b/package/lua/patches/lua-5.0.2-soname.patch
@@ -0,0 +1,14 @@
+diff -ruN lua-5.0.2-orig/Makefile lua-5.0.2-1/Makefile
+--- lua-5.0.2-orig/Makefile 2004-03-12 02:50:55.000000000 +0100
++++ lua-5.0.2-1/Makefile 2005-05-25 11:41:44.000000000 +0200
+@@ -38,8 +38,8 @@
+
+ # shared libraries (for Linux)
+ so:
+- ld -o lib/liblua.so.$V -shared src/*.o
+- ld -o lib/liblualib.so.$V -shared src/lib/*.o
++ $(LD) -o lib/liblua.so.$V -shared -soname="liblua.so.$V" src/*.o
++ $(LD) -o lib/liblualib.so.$V -shared -soname="liblualib.so.$V" src/lib/*.o
+ cd lib; ln -fs liblua.so.$V liblua.so; ln -fs liblualib.so.$V liblualib.so
+
+ # binaries using shared libraries
diff --git a/package/lvm/Config.in b/package/lvm/Config.in
new file mode 100644
index 000000000..5d076eb1c
--- /dev/null
+++ b/package/lvm/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_LVM
+ prompt "lvm......................... logical volume management"
+ tristate
+ default n
+ help
+ lvm
diff --git a/package/lvm/Makefile b/package/lvm/Makefile
new file mode 100644
index 000000000..334ca3516
--- /dev/null
+++ b/package/lvm/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= lvm
+PKG_VERSION:= 2.02.45
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 440daa01b8f2ec4fe97b1cc621108220
+DISTFILES:= LVM2.${PKG_VERSION}.tgz
+MASTER_SITES:= ftp://sources.redhat.com/pub/lvm2/
+
+WRKDIST= ${WRKDIR}/LVM2.${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LVM,lvm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-user="" --with-group="" \
+ --with-optimisation="" \
+ --with-lvm1=none \
+ --enable-static_link \
+ --with-kernel-dir=${LINUX_DIR}
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LVM}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/lvm.static ${IDIR_LVM}/usr/sbin/lvm
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/lvm/ipkg/lvm.control b/package/lvm/ipkg/lvm.control
new file mode 100644
index 000000000..0a213917c
--- /dev/null
+++ b/package/lvm/ipkg/lvm.control
@@ -0,0 +1,4 @@
+Package: lvm
+Priority: optional
+Section: utils
+Description: logical volume management
diff --git a/package/lvm/patches/patch-tools_Makefile_in b/package/lvm/patches/patch-tools_Makefile_in
new file mode 100644
index 000000000..7961bcf24
--- /dev/null
+++ b/package/lvm/patches/patch-tools_Makefile_in
@@ -0,0 +1,29 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- LVM2.2.02.45.orig/tools/Makefile.in 2009-02-17 12:07:59.000000000 +0100
++++ LVM2.2.02.45/tools/Makefile.in 2009-05-16 21:29:01.474640998 +0200
+@@ -62,19 +62,18 @@ SOURCES =\
+ vgscan.c \
+ vgsplit.c
+
+-TARGETS =\
+- .commands \
+- lvm
+-
+-INSTALL_LVM_TARGETS = install_tools_dynamic
+-INSTALL_DMSETUP_TARGETS = install_dmsetup_dynamic
+-INSTALL_CMDLIB_TARGETS = install_cmdlib_dynamic
++TARGETS = .commands
+
+ ifeq ("@STATIC_LINK@", "yes")
+ TARGETS += lvm.static
+ INSTALL_LVM_TARGETS += install_tools_static
+ INSTALL_DMSETUP_TARGETS += install_dmsetup_static
+ INSTALL_CMDLIB_TARGETS += install_cmdlib_static
++else
++ TARGETS += lvm
++ INSTALL_LVM_TARGETS = install_tools_dynamic
++ INSTALL_DMSETUP_TARGETS = install_dmsetup_dynamic
++ INSTALL_CMDLIB_TARGETS = install_cmdlib_dynamic
+ endif
+
+ LVMLIBS = -llvm
diff --git a/package/lynx/Config.in b/package/lynx/Config.in
new file mode 100644
index 000000000..0b12bc0bb
--- /dev/null
+++ b/package/lynx/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_LYNX
+ prompt "lynx.............................. Standard text browser"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_CA_CERTS
+ help
+ The standard text-based world wide web browser.
+
+ http://lynx.isc.org/current/
diff --git a/package/lynx/Makefile b/package/lynx/Makefile
new file mode 100644
index 000000000..7ac1ab7f6
--- /dev/null
+++ b/package/lynx/Makefile
@@ -0,0 +1,103 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= lynx
+PKG_VERSION= 2.8.7dev.7
+PKG_RELEASE= 1
+PKG_MD5SUM= 83891107c873421e5ac917cc0ab53fe8
+MASTER_SITES= http://lynx.isc.org/current/ \
+ ${MASTER_SITE_MIRBSD}
+DISTFILES= ${PKG_NAME}${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/lynx2-8-7
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LYNX,lynx,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+TCPPFLAGS+= -DLYNX_VERSION=\"${PKG_VERSION}-OpenADK-${PKG_RELEASE}\"
+# do not hardcode paths; do not scan for ports stuff
+CONFIGURE_ENV+= ac_cv_path_TELNET=telnet \
+ ac_cv_path_TN3270=tn3270 \
+ ac_cv_path_RLOGIN=rlogin \
+ ac_cv_path_MV=mv \
+ ac_cv_path_GZIP=gzip \
+ ac_cv_path_UNCOMPRESS=gunzip \
+ ac_cv_path_UNZIP=unzip \
+ ac_cv_path_BZIP2=bzip2 \
+ ac_cv_path_TAR=tar \
+ ac_cv_path_COMPRESS=compress \
+ ac_cv_path_RM=rm \
+ ac_cv_path_UUDECODE=uudecode \
+ ac_cv_path_ZCAT=zcat \
+ ac_cv_path_ZIP=zip
+# from MirPorts Framework
+CONFIGURE_ARGS+= --enable-vertrace \
+ --enable-warnings \
+ --disable-nls \
+ --disable-full-paths \
+ --with-ssl=/usr \
+ --without-gnutls \
+ --without-socks \
+ --without-socks5 \
+ --with-screen=ncursesw \
+ --enable-widec \
+ --enable-addrlist-page \
+ --enable-charset-choice \
+ --enable-cjk \
+ --enable-japanese-utf8 \
+ --enable-color-style \
+ --disable-default-colors \
+ --disable-htmlized-cfg \
+ --enable-ipv6 \
+ --enable-kbd-layout \
+ --enable-locale-charset \
+ --enable-nested-tables \
+ --disable-scrollbar \
+ --enable-justify-elts \
+ --enable-internal-links \
+ --enable-nsl-fork \
+ --enable-underlines \
+ --without-bzlib \
+ --with-zlib \
+ --without-x
+# local stuff
+CONFIGURE_ARGS+= --with-ssl=${STAGING_DIR}/usr \
+ --disable-full-paths \
+ --with-cfg-file=/etc/lynx.cfg \
+ --with-lss-file=/etc/lynx.lss \
+ --disable-font-switch
+TCPPFLAGS+= -I${STAGING_DIR}/include/openssl
+TCPPFLAGS+= -DUSE_OPENSSL_INCL -DUSE_X509_SUPPORT
+# needs libiconv
+CONFIGURE_ARGS+= --disable-japanese-utf8
+# shrink size
+CONFIGURE_ARGS+= --disable-vertrace \
+ --disable-trace \
+ --disable-cjk \
+ --disable-kbd-layout \
+ --disable-prettysrc \
+ --disable-finger \
+ --disable-dired
+ifeq (${ADK_UNICODE},)
+CONFIGURE_ARGS+= --with-screen=ncurses \
+ --disable-widec \
+ --disable-locale-charset
+endif
+ifneq (${ADK_IPV6},y)
+CONFIGURE_ARGS+= --disable-ipv6
+endif
+MAKE_FILE= makefile
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LYNX}/etc ${IDIR_LYNX}/usr/bin
+ ${CP} ${WRKINST}/etc/lynx.{cfg,lss} ${IDIR_LYNX}/etc
+ ${CP} ${WRKINST}/usr/bin/lynx ${IDIR_LYNX}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/lynx/ipkg/lynx.control b/package/lynx/ipkg/lynx.control
new file mode 100644
index 000000000..7ee22ce73
--- /dev/null
+++ b/package/lynx/ipkg/lynx.control
@@ -0,0 +1,5 @@
+Package: lynx
+Priority: base
+Section: www
+Description: Standard text browser
+Depends: libncurses, libopenssl
diff --git a/package/lynx/patches/patch-config_hin b/package/lynx/patches/patch-config_hin
new file mode 100644
index 000000000..63312839d
--- /dev/null
+++ b/package/lynx/patches/patch-config_hin
@@ -0,0 +1,17 @@
+$MirOS: ports/www/lynx/patches/patch-config_hin,v 1.1 2007/08/03 16:01:22 tg Exp $
+
+ This will expand to
+ | #define ICONV_CONST <tabs> AM_ICONV */
+ otherwise.
+
+--- lynx2-8-7/config.hin.orig Thu Aug 2 23:24:04 2007
++++ lynx2-8-7/config.hin Fri Aug 3 15:58:53 2007
+@@ -176,7 +176,7 @@
+ #undef HAVE___ARGZ_COUNT /* AM_GNU_GETTEXT */
+ #undef HAVE___ARGZ_NEXT /* AM_GNU_GETTEXT */
+ #undef HAVE___ARGZ_STRINGIFY /* AM_GNU_GETTEXT */
+-#undef ICONV_CONST /* AM_ICONV */
++#undef ICONV_CONST
+ #undef IGNORE_CTRL_C /* FIXME: make tests? */
+ #undef INCLUDE_PROTOTYPES /* CF_SOCKS5 */
+ #undef INSTALL_ARGS /* CF_PATH_PROG(install) */
diff --git a/package/lynx/patches/patch-lynx_cfg b/package/lynx/patches/patch-lynx_cfg
new file mode 100644
index 000000000..ebdfe4e43
--- /dev/null
+++ b/package/lynx/patches/patch-lynx_cfg
@@ -0,0 +1,236 @@
+$Id$
+$MirOS: ports/www/lynx/patches/patch-lynx_cfg,v 1.7 2007/05/20 12:06:19 tg Exp $
+
+ mostly site policy and compatibility, usability
+
+--- lynx2-8-7/lynx.cfg.orig Thu May 17 22:52:59 2007
++++ lynx2-8-7/lynx.cfg Sun May 20 11:17:21 2007
+@@ -93,12 +93,12 @@
+ #
+ # Normally we expect you will connect to a remote site, e.g., the Lynx starting
+ # site:
+-STARTFILE:http://lynx.isc.org/
++#STARTFILE:http://lynx.isc.org/
+ #
+ # As an alternative, you may want to use a local URL. A good choice for this is
+ # the user's home directory:
+ .ex
+-#STARTFILE:file://localhost/~/
++STARTFILE:file://localhost/~/
+ #
+ # Your choice of STARTFILE should reflect your site's needs, and be a URL that
+ # you can connect to reliably. Otherwise users will become confused and think
+@@ -409,7 +409,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # values and their relationship to the locale value is not. GNU libiconv
+ # happens to give useful values, but other implementations are not guaranteed
+ # to do this.
+-#LOCALE_CHARSET:FALSE
++LOCALE_CHARSET:TRUE
+
+
+ .h2 ASSUME_CHARSET
+@@ -424,7 +424,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # ASSUME_CHARSET can also be changed via the 'o'ptions menu but will
+ # not be saved as permanent value in user's .lynxrc file to avoid more chaos.
+ #
+-#ASSUME_CHARSET:iso-8859-1
++ASSUME_CHARSET:utf-8
+
+
+ .h2 ASSUMED_DOC_CHARSET_CHOICE
+@@ -552,7 +552,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # the 'o'ptions menu and save that preference in their RC file.
+ # This may be a comma-separated list of languages in decreasing preference.
+ #
+-#PREFERRED_LANGUAGE:en
++#PREFERRED_LANGUAGE:
+
+
+ .h2 PREFERRED_CHARSET
+@@ -571,7 +571,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # the sending of an unacceptable response is also allowed. See RFC 2068
+ # (http://www.ics.uci.edu/pub/ietf/uri/rfc2068.txt).
+ #
+-#PREFERRED_CHARSET:
++PREFERRED_CHARSET:utf-8
+
+
+ .h2 CHARSETS_DIRECTORY
+@@ -652,22 +652,22 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # Set the threshold # of lines Lynx must render before it
+ # redraws the screen in PARTIAL mode. Anything < 0 implies
+ # use of the screen size.
+-#PARTIAL_THRES:-1
++PARTIAL_THRES:3
+
+
+ .h2 SHOW_KB_RATE
+ # While getting large files, Lynx shows the approximate rate of transfer.
+-# Set this to change the units shown. "Kilobytes" denotes 1024 bytes:
++# Set this to change the units shown.
+ # NONE to disable the display of transfer rate altogether.
+-# TRUE or KB for Kilobytes/second.
++# TRUE or KB for Kibibytes/second.
+ # FALSE or BYTES for bytes/second.
+-# KB,ETA to show Kilobytes/second with estimated completion time.
+-# BYTES,ETA to show BYTES/second with estimated completion time.
++# KB,ETA to show Kibibytes/second with estimated completion time.
++# BYTES,ETA to show bytes/second with estimated completion time.
+ # Note that the "ETA" values are available if USE_READPROGRESS was defined.
+-#SHOW_KB_RATE:TRUE
++SHOW_KB_RATE:BYTES,ETA
+
+ .h2 SHOW_KB_NAME
+-# Set the abbreviation for Kilobytes (1024).
++# Set the abbreviation for Kibibytes (1024 Bytes).
+ # Quoting from
+ # http://www.romulus2.com/articles/guides/misc/bitsbytes.shtml
+ # In December 1998, the International Electrotechnical Commission (IEC)
+@@ -677,9 +677,6 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # metric prefixes and adding the first two letters of the word "binary". Thus,
+ # for instance, instead of Kilobyte (KB) or Gigabyte (GB), the new terms would
+ # be kibibyte (KiB) or gibibyte (GiB).
+-#
+-# If you prefer using the conventional (and more common) "KB", modify this
+-# setting.
+ #SHOW_KB_NAME:KiB
+
+ .h1 Timeouts
+@@ -1076,7 +1073,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # default or that defined here can be toggled via the -force_secure
+ # command line switch.
+ #
+-#FORCE_SSL_COOKIES_SECURE:FALSE
++FORCE_SSL_COOKIES_SECURE:TRUE
+
+
+ .h1 Internal Behavior
+@@ -1263,7 +1260,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # line break. Note that the valid way to insert extra blank lines in HTML
+ # is via a PRE block with only newlines in the block.
+ #
+-#COLLAPSE_BR_TAGS:TRUE
++COLLAPSE_BR_TAGS:FALSE
+
+
+ .h2 TAGSOUP
+@@ -1366,7 +1363,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # The default is FALSE, so that the feature needs to be enabled here
+ # explicitly if you want it.
+ #
+-#PERSISTENT_COOKIES:FALSE
++PERSISTENT_COOKIES:TRUE
+
+
+ .h2 COOKIE_FILE
+@@ -1920,7 +1917,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # prefer the more conservative action of requiring an explicit Y or y to
+ # confirm. The default defined here will override that in userdefs.h.
+ #
+-#QUIT_DEFAULT_YES:TRUE
++QUIT_DEFAULT_YES:FALSE
+
+
+ .h1 HTML Parsing
+@@ -3208,7 +3205,7 @@ COLOR:6:brightred:black
+ # otherwise. Set this setting to TRUE if you prefer numbered links, but wish
+ # to get valid HTML source when printing or mailing when in psrc view.
+ # Default is FALSE.
+-#PRETTYSRC_VIEW_NO_ANCHOR_NUMBERING:FALSE
++PRETTYSRC_VIEW_NO_ANCHOR_NUMBERING:TRUE
+
+
+ .h1 HTML Parsing
+@@ -3241,13 +3238,11 @@ COLOR:6:brightred:black
+
+ .h2 JUSTIFY
+ # JUSTIFY - Appearance
+-# This option mirrors command-line option with same name. Default is TRUE. If
+-# true, most of text (except headers and like this) will be justified. This
+-# has no influence on CJK text rendering.
++# This option mirrors command-line option with same name. Default is FALSE.
++# If true, most of text (except headers and like this) will be justified.
++# This has no influence on CJK text rendering.
+ #
+-# This option is only available if Lynx was compiled with EXP_JUSTIFY_ELTS.
+-#
+-#JUSTIFY:FALSE
++JUSTIFY:TRUE
+
+ .h2 JUSTIFY_MAX_VOID_PERCENT
+ # JUSTIFY_MAX_VOID_PERCENT - Appearance
+@@ -3275,7 +3270,7 @@ COLOR:6:brightred:black
+ # explicit activation can also be requested with the -tna command line
+ # option.
+ #
+-#TEXTFIELDS_NEED_ACTIVATION:FALSE
++TEXTFIELDS_NEED_ACTIVATION:TRUE
+
+ .h2 LEFTARROW_IN_TEXTFIELD_PROMPT
+ # LEFTARROW_IN_TEXTFIELD_PROMPT
+@@ -3285,7 +3280,7 @@ COLOR:6:brightred:black
+ # only if the contents of the fields have been changed since entering it.
+ # If set to TRUE, the confirmation prompt is always issued.
+ #
+-#LEFTARROW_IN_TEXTFIELD_PROMPT:FALSE
++LEFTARROW_IN_TEXTFIELD_PROMPT:TRUE
+
+
+ .h1 Timeouts
+@@ -3322,7 +3317,7 @@ COLOR:6:brightred:black
+ # one lynx.cfg setting.
+ .nf
+ #ENABLE_LYNXRC:accept_all_cookies:ON
+-#ENABLE_LYNXRC:assume_charset:OFF
++ENABLE_LYNXRC:assume_charset:ON
+ #ENABLE_LYNXRC:bookmark_file:ON
+ #ENABLE_LYNXRC:case_sensitive_searching:ON
+ #ENABLE_LYNXRC:character_set:ON
+@@ -3337,34 +3332,35 @@ COLOR:6:brightred:black
+ #ENABLE_LYNXRC:emacs_keys:ON
+ #ENABLE_LYNXRC:file_editor:ON
+ #ENABLE_LYNXRC:file_sorting_method:ON
+-#ENABLE_LYNXRC:force_cookie_prompt:OFF
+-#ENABLE_LYNXRC:force_ssl_prompt:OFF
+-#ENABLE_LYNXRC:ftp_passive:OFF
++ENABLE_LYNXRC:force_cookie_prompt:ON
++ENABLE_LYNXRC:force_ssl_prompt:ON
++ENABLE_LYNXRC:ftp_passive:ON
+ #ENABLE_LYNXRC:kblayout:ON
+ #ENABLE_LYNXRC:keypad_mode:ON
+ #ENABLE_LYNXRC:lineedit_mode:ON
+ #ENABLE_LYNXRC:locale_charset:ON
+-#ENABLE_LYNXRC:make_links_for_all_images:OFF
+-#ENABLE_LYNXRC:make_pseudo_alts_for_inlines:OFF
++ENABLE_LYNXRC:make_links_for_all_images:ON
++ENABLE_LYNXRC:make_pseudo_alts_for_inlines:ON
+ #ENABLE_LYNXRC:multi_bookmark:ON
+ #ENABLE_LYNXRC:personal_mail_address:ON
+ #ENABLE_LYNXRC:preferred_charset:ON
+-#ENABLE_LYNXRC:preferred_encoding:OFF
++ENABLE_LYNXRC:preferred_encoding:ON
+ #ENABLE_LYNXRC:preferred_language:ON
+-#ENABLE_LYNXRC:preferred_media_types:OFF
+-#ENABLE_LYNXRC:raw_mode:OFF
++ENABLE_LYNXRC:preferred_media_types:ON
++ENABLE_LYNXRC:raw_mode:ON
+ #ENABLE_LYNXRC:run_all_execution_links:ON
+ #ENABLE_LYNXRC:run_execution_links_on_local_files:ON
+-#ENABLE_LYNXRC:scrollbar:OFF
++ENABLE_LYNXRC:scrollbar:ON
+ #ENABLE_LYNXRC:select_popups:ON
+-#ENABLE_LYNXRC:set_cookies:OFF
++ENABLE_LYNXRC:set_cookies:ON
+ #ENABLE_LYNXRC:show_color:ON
+ #ENABLE_LYNXRC:show_cursor:ON
+ #ENABLE_LYNXRC:show_dotfiles:ON
+-#ENABLE_LYNXRC:show_kb_rate:OFF
++ENABLE_LYNXRC:show_kb_name:OFF
++ENABLE_LYNXRC:show_kb_rate:ON
+ #ENABLE_LYNXRC:sub_bookmarks:ON
+ #ENABLE_LYNXRC:tagsoup:OFF
+-#ENABLE_LYNXRC:underline_links:OFF
++ENABLE_LYNXRC:underline_links:ON
+ #ENABLE_LYNXRC:user_mode:ON
+ #ENABLE_LYNXRC:useragent:OFF
+ #ENABLE_LYNXRC:verbose_images:ON
diff --git a/package/lynx/patches/patch-makefile_in b/package/lynx/patches/patch-makefile_in
new file mode 100644
index 000000000..b0a79fe71
--- /dev/null
+++ b/package/lynx/patches/patch-makefile_in
@@ -0,0 +1,22 @@
+$Id$
+$MirOS: ports/www/lynx/patches/patch-makefile_in,v 1.2 2007/05/20 12:06:19 tg Exp $
+--- lynx2-8-7/makefile.in.orig Thu May 17 22:52:59 2007
++++ lynx2-8-7/makefile.in Sun May 20 11:17:21 2007
+@@ -161,13 +161,13 @@ SITE_DEFS = # Your defines here
+ # for installation of local execution links, please see the file userdefs.h
+
+ WWW_CFLAGS = \
+- LY_CFLAGS="$(CFLAGS)" \
+- CPPFLAGS="$(CPPFLAGS)" \
++ LY_CFLAGS='${CFLAGS}' \
++ CPPFLAGS='${CPPFLAGS}' \
+ LYFLAGS="$(SITE_LYDEFS)"
+
+ SRC_CFLAGS = \
+- CFLAGS="$(CFLAGS)" \
+- CPPFLAGS="$(CPPFLAGS)" \
++ CFLAGS='${CFLAGS}' \
++ CPPFLAGS='${CPPFLAGS}' \
+ LIBS="$(LIBS) $(RESOLVLIB) $(WAISLIB) $(SITE_LIBS)" \
+ SITE_DEFS="$(SITE_DEFS)" \
+ WWWINC=$(WWWINC) \
diff --git a/package/lynx/patches/patch-samples_lynx_lss b/package/lynx/patches/patch-samples_lynx_lss
new file mode 100644
index 000000000..332552e9f
--- /dev/null
+++ b/package/lynx/patches/patch-samples_lynx_lss
@@ -0,0 +1,15 @@
+$MirOS: ports/www/lynx/patches/patch-samples_lynx_lss,v 1.2 2007/05/20 12:06:19 tg Exp $
+
+ usability
+
+--- lynx2-8-7/samples/lynx.lss.orig Tue Sep 19 00:28:05 2006
++++ lynx2-8-7/samples/lynx.lss Sun May 20 11:17:22 2007
+@@ -6,7 +6,7 @@
+ # If you really want the terminal's default colors, and if lynx is built using
+ # ncurses' default-color support, remove these two lines:
+ normal: normal: lightgray:black
+-default: normal: white:black
++default: normal: lightgray:black
+
+ # Normal type styles correspond to HTML tags.
+ #
diff --git a/package/lynx/patches/patch-src_LYUtils_c b/package/lynx/patches/patch-src_LYUtils_c
new file mode 100644
index 000000000..a0b6bd6b8
--- /dev/null
+++ b/package/lynx/patches/patch-src_LYUtils_c
@@ -0,0 +1,15 @@
+$MirOS: ports/www/lynx/patches/patch-src_LYUtils_c,v 1.3 2007/08/03 16:01:22 tg Exp $
+
+ Important for upstream too
+
+--- lynx2-8-7/src/LYUtils.c.orig Thu Aug 2 23:24:04 2007
++++ lynx2-8-7/src/LYUtils.c Fri Aug 3 15:59:06 2007
+@@ -5903,7 +5903,7 @@ static BOOL IsOurSymlink(const char *nam
+
+ if (cutoff != 0) {
+ HTSprintf0(&clone, "%.*s%s%s",
+- cutoff - name,
++ (int)(cutoff - name),
+ name, PATHSEP_STR, buffer);
+ FREE(buffer);
+ buffer = clone;
diff --git a/package/lynx/patches/patch-userdefs_h b/package/lynx/patches/patch-userdefs_h
new file mode 100644
index 000000000..2f4c3475d
--- /dev/null
+++ b/package/lynx/patches/patch-userdefs_h
@@ -0,0 +1,65 @@
+$Id$
+$MirOS: ports/www/lynx/patches/patch-userdefs_h,v 1.9 2007/08/03 12:14:24 tg Exp $
+--- lynx2-8-7/userdefs.h.orig Thu Aug 2 23:24:04 2007
++++ lynx2-8-7/userdefs.h Fri Aug 3 12:01:19 2007
+@@ -461,7 +461,7 @@
+ * Normally we expect you will connect to a remote site, e.g., the Lynx starting
+ * site:
+ */
+-#define STARTFILE "http://lynx.isc.org/"
++/* #define STARTFILE "http://lynx.isc.org/" */
+ /*
+ * As an alternative, you may want to use a local URL. A good choice for this
+ * is the user's home directory:
+@@ -471,6 +471,7 @@
+ * you can connect to reliably. Otherwise users will become confused and think
+ * that they cannot run Lynx.
+ */
++#define STARTFILE "file://localhost/~/"
+
+ /*****************************
+ * HELPFILE must be defined as a URL and must have a
+@@ -727,7 +728,7 @@
+ * that preference in their RC file. This may be a comma-separated list
+ * of languages in decreasing preference.
+ */
+-#define PREFERRED_LANGUAGE "en"
++#define PREFERRED_LANGUAGE ""
+
+ /*****************************
+ * PREFERRED_CHARSET specifies the character set in MIME notation (e.g.,
+@@ -802,8 +803,8 @@
+ * and use "http://" as the default (e.g., gopher.wfbr.edu or gopher.wfbr.
+ * will be made gopher://gopher.wfbr.edu).
+ */
+-#define URL_DOMAIN_PREFIXES "www."
+-#define URL_DOMAIN_SUFFIXES ".com,.edu,.net,.org"
++#define URL_DOMAIN_PREFIXES ""
++#define URL_DOMAIN_SUFFIXES ""
+
+ /********************************
+ * If LIST_NEWS_NUMBERS is set TRUE, Lynx will use an ordered list
+@@ -1371,7 +1372,9 @@
+ * the version definition with the Project Version on checkout. Just
+ * ignore it. - kw */
+ /* $Format: "#define LYNX_VERSION \"$ProjectVersion$\""$ */
++#ifndef LYNX_VERSION
+ #define LYNX_VERSION "2.8.7dev.7"
++#endif
+ #define LYNX_WWW_HOME "http://lynx.isc.org/"
+ #define LYNX_WWW_DIST "http://lynx.isc.org/current/"
+ /* $Format: "#define LYNX_DATE \"$ProjectDate$\""$ */
+@@ -1559,11 +1562,11 @@
+
+ /*****************************
+ * Uncomment the following line to enable the kanji code override routine.
+- * The code can be changed by pressing ^L. More precisely, this allows
++ * The code can be changed by pressing Shift-J. More precisely, this allows
+ * the user to override the assumption about the kanji code for the document
+ * which Lynx has made on the basis of a META tag and HTTP response.
+ */
+-/*#define KANJI_CODE_OVERRIDE */
++#define KANJI_CODE_OVERRIDE
+
+
+ /****************************************************************
diff --git a/package/mac80211/Config.in b/package/mac80211/Config.in
new file mode 100644
index 000000000..e907531b2
--- /dev/null
+++ b/package/mac80211/Config.in
@@ -0,0 +1,28 @@
+config ADK_PACKAGE_KMOD_MAC80211
+ prompt "kmod-mac80211................... mac80211 softmac (development)"
+ tristate
+ select ADK_MOD_KERNEL_MAC80211
+ depends on !ADK_KPACKAGE_KMOD_MAC80211
+ default n
+ help
+ http://linuxwireless.org/
+
+config ADK_PACKAGE_KMOD_MAC80211_ATH5K
+ prompt "kmod-mac80211-ath5k............. Atheros 5xxx wireless driver"
+ tristate
+ depends on ADK_PACKAGE_KMOD_MAC80211
+ default n
+ help
+ http://linuxwireless.org/
+
+config ADK_PACKAGE_KMOD_MAC80211_RT61
+ prompt "kmod-mac80211-rt61.............. Ralink rt2501/rt61 wireless driver"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRC_ITU_T
+ select ADK_PACKAGE_WIRELESS_FIRMWARE_RT61
+ depends on ADK_PACKAGE_KMOD_MAC80211
+ help
+ This adds support for rt2501 wireless chipset family.
+ Supported chips: RT2561, RT2561S & RT2661.
+
diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
new file mode 100644
index 000000000..e69f0fd12
--- /dev/null
+++ b/package/mac80211/Makefile
@@ -0,0 +1,108 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mac80211
+PKG_VERSION:= 2009-05-01
+PKG_RELEASE:= 1
+PKG_MD5SUM:= abc949ec3f7cc57302cca814d9b9c6cd
+DISTFILES:= compat-wireless-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://www.orbit-lab.org/kernel/compat-wireless-2.6/2009/05/ \
+ http://wireless.kernel.org/download/compat-wireless-2.6/
+WRKDIST= ${WRKDIR}/compat-wireless-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,KMOD_MAC80211,kmod-mac80211,${KERNEL_VERSION}+${PKG_VERSION}-${DEVICE}-${PKG_RELEASE},${ARCH},kernel (${KERNEL_VERSION}-${DEVICE}-${KERNEL_RELEASE})))
+$(eval $(call PKG_template,KMOD_MAC80211_ATH5K,kmod-mac80211-ath5k,${KERNEL_VERSION}+${PKG_VERSION}-${DEVICE}-${PKG_RELEASE},${ARCH},kernel (${KERNEL_VERSION}-${DEVICE}-${KERNEL_RELEASE})))
+$(eval $(call PKG_template,KMOD_MAC80211_RT61,kmod-mac80211-rt61,${KERNEL_VERSION}+${PKG_VERSION}-${DEVICE}-${PKG_RELEASE},${ARCH},kernel (${KERNEL_VERSION}-${DEVICE}-${KERNEL_RELEASE})))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= manual
+
+# remove entry to enable driver compilation
+DISABLED_DRIVERS:= CONFIG_AR9170_USB=n \
+ CONFIG_MAC80211_HWSIM=n \
+ CONFIG_ATH9K=n \
+ CONFIG_IWLWIFI=n \
+ CONFIG_IWLAGN=n \
+ CONFIG_IWL4965=n \
+ CONFIG_IWL5000=n \
+ CONFIG_IWL3945=n \
+ CONFIG_B43=n \
+ CONFIG_B43LEGACY=n \
+ CONFIG_LIBIPW=n \
+ CONFIG_IPW2100=n \
+ CONFIG_IPW2200=n \
+ CONFIG_P54_PCI=n \
+ CONFIG_B44=n \
+ CONFIG_RTL8180=n \
+ CONFIG_ADM8211=n \
+ CONFIG_RT2800PCI=n \
+ CONFIG_ATMEL=n \
+ CONFIG_PCI_ATMEL=n \
+ CONFIG_ZD1211RW=n \
+ CONFIG_P54_USB=n \
+ CONFIG_RTL8187=n \
+ CONFIG_AT76C50X_USB=n \
+ CONFIG_RT2500USB=n \
+ CONFIG_RT2800USB=n \
+ CONFIG_RT2X00_LIB_USB=n \
+ CONFIG_RT73USB=n \
+ CONFIG_P54_COMMON=n \
+ CONFIG_SSB=n \
+ CONFIG_LIBERTAS_USB=n \
+ CONFIG_LIBERTAS_CS=n \
+ CONFIG_LIBERTAS=n \
+ CONFIG_MWL8K=n \
+ CONFIG_USB_NET_CDCETHER=n \
+ CONFIG_USB_NET_RNDIS_HOST=n \
+ CONFIG_USB_NET_RNDIS_WLAN=n
+
+XAKE_FLAGS:= ARCH="${ARCH}" \
+ CROSS_COMPILE="${TARGET_CROSS}" \
+ KLIB_BUILD="$(LINUX_DIR)" \
+ KLIB="${WRKINST}/lib/modules/${KERNEL_VERSION}" \
+ MODPROBE=: \
+ LDFLAGS="" \
+ ${DISABLED_DRIVERS} \
+ V=1
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_KMOD_MAC80211}/etc/modules.d/
+ ${INSTALL_DIR} ${IDIR_KMOD_MAC80211}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/net/wireless/{cfg80211,lib80211,lib80211*}.ko \
+ ${IDIR_KMOD_MAC80211}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/net/mac80211/mac80211.ko \
+ ${IDIR_KMOD_MAC80211}/lib/modules/${KERNEL_VERSION}/
+ echo "lib80211" > ${IDIR_KMOD_MAC80211}/etc/modules.d/20-mac80211
+ echo "lib80211_crypt_ccmp" >> ${IDIR_KMOD_MAC80211}/etc/modules.d/20-mac80211
+ echo "cfg80211" >> ${IDIR_KMOD_MAC80211}/etc/modules.d/20-mac80211
+ echo "mac80211" >> ${IDIR_KMOD_MAC80211}/etc/modules.d/20-mac80211
+ # driver for ath5k
+ ${INSTALL_DIR} ${IDIR_KMOD_MAC80211_ATH5K}/etc/modules.d/
+ ${INSTALL_DIR} ${IDIR_KMOD_MAC80211_ATH5K}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/drivers/net/wireless/ath/ath.ko \
+ ${IDIR_KMOD_MAC80211_ATH5K}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/drivers/net/wireless/ath/ath5k/ath5k.ko \
+ ${IDIR_KMOD_MAC80211_ATH5K}/lib/modules/${KERNEL_VERSION}/
+ echo "ath" > ${IDIR_KMOD_MAC80211_ATH5K}/etc/modules.d/30-ath5k
+ echo "ath5k" >> ${IDIR_KMOD_MAC80211_ATH5K}/etc/modules.d/30-ath5k
+ # driver for rt61
+ ${INSTALL_DIR} ${IDIR_KMOD_MAC80211_RT61}/etc/modules.d/
+ ${INSTALL_DIR} ${IDIR_KMOD_MAC80211_RT61}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/drivers/misc/eeprom/eeprom_93cx6.ko \
+ ${IDIR_KMOD_MAC80211_RT61}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/drivers/net/wireless/rt2x00/rt2x00*.ko \
+ ${IDIR_KMOD_MAC80211_RT61}/lib/modules/${KERNEL_VERSION}/
+ ${CP} ${WRKBUILD}/drivers/net/wireless/rt2x00/rt61pci.ko \
+ ${IDIR_KMOD_MAC80211_RT61}/lib/modules/${KERNEL_VERSION}/
+ echo "eeprom_93cx6" > ${IDIR_KMOD_MAC80211_RT61}/etc/modules.d/30-rt61
+ echo "rt2x00lib" >> ${IDIR_KMOD_MAC80211_RT61}/etc/modules.d/30-rt61
+ echo "rt2x00pci" >> ${IDIR_KMOD_MAC80211_RT61}/etc/modules.d/30-rt61
+ echo "rt61pci" >> ${IDIR_KMOD_MAC80211_RT61}/etc/modules.d/30-rt61
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mac80211/ipkg/kmod-mac80211-ath5k.control b/package/mac80211/ipkg/kmod-mac80211-ath5k.control
new file mode 100644
index 000000000..a495868d2
--- /dev/null
+++ b/package/mac80211/ipkg/kmod-mac80211-ath5k.control
@@ -0,0 +1,4 @@
+Package: kmod-mac80211-ath5k
+Priority: optional
+Section: net
+Description: Linux wireless driver for ath5k
diff --git a/package/mac80211/ipkg/kmod-mac80211-rt61.control b/package/mac80211/ipkg/kmod-mac80211-rt61.control
new file mode 100644
index 000000000..5684dd8e8
--- /dev/null
+++ b/package/mac80211/ipkg/kmod-mac80211-rt61.control
@@ -0,0 +1,4 @@
+Package: kmod-mac80211-rt61
+Priority: optional
+Section: net
+Description: Linux wireless driver for Ralink rt61/rt2501
diff --git a/package/mac80211/ipkg/kmod-mac80211.control b/package/mac80211/ipkg/kmod-mac80211.control
new file mode 100644
index 000000000..bf8ae1f4e
--- /dev/null
+++ b/package/mac80211/ipkg/kmod-mac80211.control
@@ -0,0 +1,4 @@
+Package: kmod-mac80211
+Priority: optional
+Section: net
+Description: Linux wireless framwork
diff --git a/package/macchanger/Config.in b/package/macchanger/Config.in
new file mode 100644
index 000000000..e9d715809
--- /dev/null
+++ b/package/macchanger/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_MACCHANGER
+ tristate "macchanger........................ utility for viewing/manipulating the MAC address"
+ default n
+ help
+ This is a GNU/Linux utility for viewing/manipulating the MAC address
+ of network interfaces.
+
+ http://www.alobbs.com/macchanger
diff --git a/package/macchanger/Makefile b/package/macchanger/Makefile
new file mode 100755
index 000000000..42c4e7599
--- /dev/null
+++ b/package/macchanger/Makefile
@@ -0,0 +1,25 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= macchanger
+PKG_VERSION:= 1.5.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 79b7cdaeca3d8ebafa764c4b0dd03ab7
+MASTER_SITES:= ${MASTER_SITE_GNU:=macchanger/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MACCHANGER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MACCHANGER}
+ ${CP} ${WRKINST}/* ${IDIR_MACCHANGER}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/macchanger/ipkg/macchanger.control b/package/macchanger/ipkg/macchanger.control
new file mode 100755
index 000000000..9149cc32f
--- /dev/null
+++ b/package/macchanger/ipkg/macchanger.control
@@ -0,0 +1,6 @@
+Package: macchanger
+Section: sys
+Architecture: mipsel
+Priority: optional
+Description: This is a GNU/Linux utility for viewing/manipulating the MAC address
+of network interfaces.
diff --git a/package/madplay/Config.in b/package/madplay/Config.in
new file mode 100644
index 000000000..fab328aae
--- /dev/null
+++ b/package/madplay/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_MADPLAY
+ tristate "madplay........................... MPEG audio player in fixed point"
+ default n
+ select ADK_PACKAGE_LIBID3TAG
+ select ADK_PACKAGE_LIBMAD
+ help
+ MAD is an MPEG audio decoder. It currently only supports the MPEG 1
+ standard, but fully implements all three audio layers (Layer I, Layer II,
+ and Layer III, the latter often colloquially known as MP3.). There is also
+ full support for ID3 tags.
+
+
diff --git a/package/madplay/Makefile b/package/madplay/Makefile
new file mode 100644
index 000000000..1ab4b8c32
--- /dev/null
+++ b/package/madplay/Makefile
@@ -0,0 +1,38 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= madplay
+PKG_VERSION:= 0.15.2b
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6814b47ceaa99880c754c5195aa1aac1
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=mad/} \
+ ftp://ftp.mars.org/pub/mpeg/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MADPLAY,madplay,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= BUILD_CC="${TARGET_CC}" HOSTCC=${HOST_CC} \
+ LIBS="-lz" \
+ ac_cv_linux_vers=2 \
+ td_cv_buggygetaddrinfo="no"
+CONFIGURE_ARGS+= --disable-debugging \
+ --disable-profiling \
+ --disable-experimental \
+ --without-libiconv-prefix \
+ --without-libintl-prefix \
+ --without-esd \
+ --with-alsa
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MADPLAY}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/madplay ${IDIR_MADPLAY}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/madplay/ipkg/madplay.control b/package/madplay/ipkg/madplay.control
new file mode 100644
index 000000000..f776e7ca6
--- /dev/null
+++ b/package/madplay/ipkg/madplay.control
@@ -0,0 +1,6 @@
+Package: madplay
+Priority: optional
+Section: sound
+Description: MPEG audio player in fixed point
+Depends: libid3tag, libmad
+
diff --git a/package/maradns/Config.in b/package/maradns/Config.in
new file mode 100644
index 000000000..18958c427
--- /dev/null
+++ b/package/maradns/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_MARADNS
+ prompt "maradns........................... Small and secure DNS Server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ A small and secure DNS server
+
+ http://www.maradns.org/
+
diff --git a/package/maradns/Makefile b/package/maradns/Makefile
new file mode 100644
index 000000000..af70f4f69
--- /dev/null
+++ b/package/maradns/Makefile
@@ -0,0 +1,42 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= maradns
+PKG_VERSION:= 1.0.41
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 9abc13da25c1103d788ee9def1c8e764
+MASTER_SITES:= http://www.maradns.org/download/1.0/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MARADNS,maradns,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+#CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CFLAGS="${TCFLAGS}" \
+ FLAGS="${TCFLAGS}" \
+ CC="${TARGET_CC}" \
+ HOSTCC="${HOSTCC}"
+INSTALL_STYLE:= auto
+FAKE_FLAGS+= PREFIX="${WRKINST}/usr" \
+ RPM_BUILD_ROOT="${WRKINST}"
+
+pre-install:
+ mkdir -p ${WRKINST}/usr/{bin,sbin}
+ mkdir -p ${WRKINST}/usr/man/man{1,5,8}
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MARADNS}/etc/{init.d,maradns}
+ ${INSTALL_DIR} ${IDIR_MARADNS}/usr/{s,}bin
+ ${INSTALL_DATA} ./files/mararc ${IDIR_MARADNS}/etc/mararc
+ ${INSTALL_DATA} ./files/sample.{zone,ptr} ${IDIR_MARADNS}/etc/maradns/
+ ${INSTALL_BIN} ./files/maradns.init ${IDIR_MARADNS}/etc/init.d/${PKG_NAME}
+ ${CP} ${WRKINST}/usr/bin/{askmara,getzone} ${IDIR_MARADNS}/usr/bin/
+ ${CP} ${WRKINST}/usr/sbin/{maradns,zoneserver} ${IDIR_MARADNS}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/maradns/files/maradns.init b/package/maradns/files/maradns.init
new file mode 100644
index 000000000..4fb5a4879
--- /dev/null
+++ b/package/maradns/files/maradns.init
@@ -0,0 +1,29 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${maradns:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/mararc ] || exit
+ [ -d /etc/maradns ] || mkdir /etc/maradns
+ maradns &
+ ;;
+stop)
+ killall maradns
+ ;;
+restart)
+ sh $0 stop
+ sleep 1
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/maradns/files/mararc b/package/maradns/files/mararc
new file mode 100644
index 000000000..29ab4fe8b
--- /dev/null
+++ b/package/maradns/files/mararc
@@ -0,0 +1,15 @@
+hide_disclaimer="YES"
+chroot_dir="/etc/maradns"
+bind_address="0.0.0.0"
+maradns_uid=65534
+maxprocs=5
+random_seed_file="/dev/urandom"
+recursive_acl="192.168.1.0/24"
+root_servers={}
+root_servers["."]="198.41.0.4,128.9.0.107,192.33.4.12,128.8.10.90,192.203.230.10,192.5.5.241,192.112.36.4,128.63.2.53,192.36.148.17,192.58.128.30,193.0.14.129,198.32.64.12,202.12.27.33"
+
+# uncomment these to set up real zones
+#csv1={}
+#csv1["sample."]="sample.zone"
+#csv1["1.168.192.in-addr.arpa."]="sample.ptr"
+
diff --git a/package/maradns/files/sample.ptr b/package/maradns/files/sample.ptr
new file mode 100644
index 000000000..04b6764f0
--- /dev/null
+++ b/package/maradns/files/sample.ptr
@@ -0,0 +1,11 @@
+# Zone file for 1.168.192.in-addr.arpa local zone
+# see http://www.maradns.org/tutorial/man.csv1.html for more information
+
+# The SOA record must be first, followed by all authoritative NS
+# records for this zone.
+S1.168.192.in-addr.arpa.|86400|sample.|hostmaster@sample.|19771108|7200|3600|604800|1800
+
+# again, the '%' sign used as shortcut for the long domain name
+P1.%|3600|gateway.sample.
+P2.%|3600|myhost.sample.
+
diff --git a/package/maradns/files/sample.zone b/package/maradns/files/sample.zone
new file mode 100644
index 000000000..24405c6b0
--- /dev/null
+++ b/package/maradns/files/sample.zone
@@ -0,0 +1,24 @@
+# Zone file for domain sample
+# see http://www.maradns.org/tutorial/man.csv1.html for more information
+
+# The SOA record must be first, followed by all authoritative NS
+# records for this zone.
+Ssample.|86400|sample.|hostmaster@sample.|19771108|7200|3600|604800|1800
+Nsample.|86400|ns1.sample.
+
+# Some 'IN A' records
+Asample.|86400|192.168.1.1
+Amx.%|86400|192.168.1.1
+Ans1.%|86400|192.168.1.1
+
+# An 'IN MX' record
+@sample.|86400|10|mx.sample.
+
+# An 'IN CNAME' record
+#Cwww.%|86400|sample.
+
+# An 'A' record showing the use of percent as a shortcut for the name
+# of this zone (in this case, 'sample.')
+Agateway.%|3600|192.168.1.1
+Amyhost.%|3600|192.168.1.2
+
diff --git a/package/maradns/ipkg/maradns.conffiles b/package/maradns/ipkg/maradns.conffiles
new file mode 100644
index 000000000..6304f53f4
--- /dev/null
+++ b/package/maradns/ipkg/maradns.conffiles
@@ -0,0 +1 @@
+/etc/mararc
diff --git a/package/maradns/ipkg/maradns.control b/package/maradns/ipkg/maradns.control
new file mode 100644
index 000000000..5db7497f4
--- /dev/null
+++ b/package/maradns/ipkg/maradns.control
@@ -0,0 +1,8 @@
+Package: maradns
+Section: net
+Priority: optional
+Depends: libpthread
+Description: MaraDNS is a small, secure DNS Server
+ MaraDNS is intended for environments where a DNS
+ server must be secure and where the server must use
+ the absolute minimum number of resources possible.
diff --git a/package/maradns/ipkg/maradns.postinst b/package/maradns/ipkg/maradns.postinst
new file mode 100644
index 000000000..e0c1d7877
--- /dev/null
+++ b/package/maradns/ipkg/maradns.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf maradns maradns NO
diff --git a/package/maradns/patches/cross-compile-fix.patch b/package/maradns/patches/cross-compile-fix.patch
new file mode 100644
index 000000000..d8ee0e051
--- /dev/null
+++ b/package/maradns/patches/cross-compile-fix.patch
@@ -0,0 +1,12 @@
+diff -urN maradns-1.0.26.old/rng/Makefile maradns-1.0.26.dev/rng/Makefile
+--- maradns-1.0.26.old/rng/Makefile 2003-08-02 21:39:36.000000000 +0200
++++ maradns-1.0.26.dev/rng/Makefile 2005-04-30 23:29:30.000000000 +0200
+@@ -20,7 +20,7 @@
+ $(CC) -c $(FLAGS) -o rng-api-fst.o rng-api-fst.c
+
+ make_32bit_tables: make_32bit_tables.c
+- $(CC) -o make_32bit_tables make_32bit_tables.c
++ $(HOSTCC) -o make_32bit_tables make_32bit_tables.c
+
+ rng-32bit-tables.h: make_32bit_tables
+ ./make_32bit_tables > rng-32bit-tables.h
diff --git a/package/mc/Config.in b/package/mc/Config.in
new file mode 100644
index 000000000..c3d5b3f64
--- /dev/null
+++ b/package/mc/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_MC
+ prompt "mc................................ The Midnight Commander (CUI filemanager)"
+ tristate
+ default n
+ select ADK_PACKAGE_GLIB1
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ Clone of the widely known Norton/Volkov Commander for DOS;
+ console-mode UI file manager with many extended functions
diff --git a/package/mc/Makefile b/package/mc/Makefile
new file mode 100644
index 000000000..63b8d7c60
--- /dev/null
+++ b/package/mc/Makefile
@@ -0,0 +1,50 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= mc
+PKG_VERSION= 4.6.1
+PKG_RELEASE= 1
+PKG_MD5SUM= 18b20db6e40480a53bac2870c56fc3c4
+MASTER_SITES= http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MC,mc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-charset \
+ --disable-background \
+ --disable-gcc-warnings \
+ --disable-glibtest \
+ --with-glib12 \
+ --without-libiconv-prefix \
+ --without-x \
+ --with-vfs \
+ --without-mcfs \
+ --without-samba \
+ --without-gpm-mouse \
+ --with-configdir=/etc \
+ --without-ext2undel \
+ --with-subshell \
+ --with-screen=ncurses \
+ --with-edit
+CONFIGURE_ENV+= mc_cv_have_zipinfo=yes \
+ am_cv_func_iconv=no
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+pre-install:
+ cp ${WRKSRC}/doc/xnc.hlp ${WRKSRC}/doc/mc.hlp
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MC}/usr/{bin,share/mc}
+ ${CP} ${WRKINST}/usr/bin/mc ${IDIR_MC}/usr/bin/
+ cd ${IDIR_MC}/usr/bin && ln -s mc mcedit && ln -s mc mcview
+ cd ${WRKINST}/usr/share/mc && ${CP} cedit.menu mc.ext mc.hint \
+ mc.lib mc.menu syntax extfs ${IDIR_MC}/usr/share/mc/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mc/ipkg/mc.control b/package/mc/ipkg/mc.control
new file mode 100644
index 000000000..da2509a14
--- /dev/null
+++ b/package/mc/ipkg/mc.control
@@ -0,0 +1,5 @@
+Package: mc
+Priority: optional
+Section: misc
+Depends: glib1, libncurses
+Description: norton commander clone
diff --git a/package/mc/patches/patch-lib_mc_ext_in b/package/mc/patches/patch-lib_mc_ext_in
new file mode 100644
index 000000000..3169ca23a
--- /dev/null
+++ b/package/mc/patches/patch-lib_mc_ext_in
@@ -0,0 +1,92 @@
+$Id$
+$MirOS: ports/misc/mc/patches/patch-lib_mc_ext_in,v 1.7 2006/09/28 20:31:52 tg Exp $
+--- mc-4.6.1.orig/lib/mc.ext.in 2005-07-23 16:51:15.000000000 +0000
++++ mc-4.6.1/lib/mc.ext.in 2007-03-20 13:32:10.000000000 +0000
+@@ -106,6 +106,42 @@
+
+ ### Archives ###
+
++## CPIO
++
++# .cgz
++shell/.cgz
++ Open=%cd %p#ucpio
++ View=%view{ascii} gzip -dc %f 2>/dev/null | cpio -itv 2>/dev/null
++
++# .cbz
++shell/.cbz
++ Open=%cd %p#ucpio
++ View=%view{ascii} bzip2 -dc %f 2>/dev/null | cpio -itv 2>/dev/null
++
++## CPIO (newc) - MirOS extension
++
++# .ngz
++shell/.ngz
++ Open=%cd %p#ucpio
++ View=%view{ascii} gzip -dc %f 2>/dev/null | cpio -itv 2>/dev/null
++
++# .nbz
++shell/.nbz
++ Open=%cd %p#ucpio
++ View=%view{ascii} bzip2 -dc %f 2>/dev/null | cpio -itv 2>/dev/null
++
++# .mcz
++shell/.mcz
++ Open=%cd %p#ucpio
++ View=%view{ascii} gzip -dc %f 2>/dev/null | cpio -itv 2>/dev/null
++
++## USTAR
++
++# .tbz
++shell/.tbz
++ Open=%cd %p#utar
++ View=%view{ascii} bzip2 -dc %f 2>/dev/null | tar tvvf -
++
+ # .tgz, .tpz, .tar.gz, .tar.z, .tar.Z
+ regex/\.t([gp]?z|ar\.g?[zZ])$
+ Open=%cd %p#utar
+@@ -135,6 +171,10 @@ regex/\.(tar|TAR)$
+ View=%view{ascii} tar tvvf %f
+
+ # lha
++regex/\.[Ll]([Zz][Hh]|[Hh][Aa])$
++ Open=%cd %p#ulha
++ View=%view{ascii} lha l %f
++
+ type/^LHa\ .*archive
+ Open=%cd %p#ulha
+ View=%view{ascii} lha l %f
+@@ -191,13 +231,20 @@ regex/\.(rpm|spm)$
+ Open=%cd %p#rpm
+ View=%view{ascii} if rpm --nosignature --version >/dev/null 2>&1; then RPM="rpm --nosignature" ; else RPM="rpm" ; fi ; $RPM -qivlp --scripts %f
+
+-# deb
++# deb - Debian packages
+ regex/\.u?deb$
+- Open=%cd %p#deb
+- View=%view{ascii} dpkg-deb -c %f
++# Open=%cd %p#deb
++# View=%view{ascii} dpkg-deb -c %f
++ Open=%cd %p#uar
++ View=%view{ascii} ar p %f control.tar.gz | gzip -d | tar xOf - ./control; echo; ar p %f data.tar.gz | gzip -d | tar tvvf -
++
++# ipk - like deb, but tgz instead of ar
++shell/.ipk
++ Open=%cd %p#utar
++ View=%view{ascii} gzip -dc %f 2>&- | tar xOf - ./control.tar.gz | gzip -d | tar xOf - ./control; echo; gzip -dc %f 2>&- | tar xOf - ./data.tar.gz | gzip -d | tar tvvf -
+
+ # ISO9660
+-regex/\.iso$
++regex/\.[Ii][Ss][Oo]$
+ Open=%cd %p#iso9660
+ View=%view{ascii} isoinfo -l -i %f
+
+@@ -417,7 +464,7 @@ type/^PDF
+
+ # html
+ regex/\.([hH][tT][mM][lL]?)$
+- Open=(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then (@X11_WWW@ file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null
++ Open=lynx -force_html %f
+ View=%view{ascii} lynx -dump -force_html %f
+
+ # StarOffice 5.2
diff --git a/package/mc/patches/patch-lib_mc_lib b/package/mc/patches/patch-lib_mc_lib
new file mode 100644
index 000000000..51445e0fe
--- /dev/null
+++ b/package/mc/patches/patch-lib_mc_lib
@@ -0,0 +1,378 @@
+$Id$
+$MirOS: ports/misc/mc/patches/patch-lib_mc_lib,v 1.9 2007/03/01 23:56:43 tg Exp $
+--- mc-4.6.1.orig/lib/mc.lib 2004-09-10 09:23:44.000000000 +0000
++++ mc-4.6.1/lib/mc.lib 2007-03-20 13:32:10.000000000 +0000
+@@ -1,8 +1,27 @@
++# $MirOS: ports/misc/mc/patches/patch-lib_mc_lib,v 1.9 2007/03/01 23:56:43 tg Exp $
++#-
++# Copyright (c) 2003, 2004, 2005, 2006
++# Thorsten Glaser <tg@mirbsd.de>
++#
++# Provided that these terms and disclaimer and all copyright notices
++# are retained or reproduced in an accompanying document, permission
++# is granted to deal in this work without restriction, including un-
++# limited rights to use, publicly perform, distribute, sell, modify,
++# merge, give away, or sublicence.
++#
++# This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
++# the utmost extent permitted by applicable law, neither express nor
++# implied; without malicious intent or gross negligence. In no event
++# may a licensor, author or contributor be held liable for indirect,
++# direct, other damage, loss, or other issues arising in any way out
++# of dealing in the work, even if advised of the possibility of such
++# damage or existence of a defect, except proven that it results out
++# of said person's immediate fault when using the work as intended.
++
+ [Special dirs]
+ list=/afs,/coda,/:,/...,/net,/#smb
+
+ [terminal:console]
+-insert=\e[2~
+ f11=\e[23~
+ f12=\e[24~
+ f13=\e[25~
+@@ -13,25 +32,25 @@ f17=\e[31~
+ f18=\e[32~
+ f19=\e[33~
+ f20=\e[34~
+-kpleft=\eOt
+-kpright=\eOv
+-kpup=\eOx
++insert=\e[2~
++kpasterix=\eOR
++kpdelete=\eOn
+ kpdown=\eOr
+-kphome=\eOw
+ kpend=\eOq
++kpenter=\eOM
++kphome=\eOw
++kpinsert=\eOp
++kpleft=\eOt
++kpminus=\eOS
+ kpnpage=\eOs
+-kpppage=\eOy
++kpnumlock=\eOP
+ kpplus=\eOl
+-kpminus=\eOS
+-kpasterix=\eOR
+-kpinsert=\eOp
+-kpdelete=\eOn
+-kpenter=\eOM
++kpppage=\eOy
++kpright=\eOv
+ kpslash=\eOQ
+-kpnumlock=\eOP
++kpup=\eOx
+
+ [terminal:linux]
+-insert=\e[2~
+ f11=\e[23~
+ f12=\e[24~
+ f13=\e[25~
+@@ -42,25 +61,31 @@ f17=\e[31~
+ f18=\e[32~
+ f19=\e[33~
+ f20=\e[34~
+-kpleft=\eOt
+-kpright=\eOv
+-kpup=\eOx
++insert=\e[2~
++kpasterix=\eOR
++kpdelete=\eOn
+ kpdown=\eOr
+-kphome=\eOw
+ kpend=\eOq
++kpenter=\eOM
++kphome=\eOw
++kpinsert=\eOp
++kpleft=\eOt
++kpminus=\eOS
+ kpnpage=\eOs
+-kpppage=\eOy
++kpnumlock=\eOP
+ kpplus=\eOl
+-kpminus=\eOS
+-kpasterix=\eOR
+-kpinsert=\eOp
+-kpdelete=\eOn
+-kpenter=\eOM
++kpppage=\eOy
++kpright=\eOv
+ kpslash=\eOQ
+-kpnumlock=\eOP
++kpup=\eOx
+
+ [terminal:xterm]
+-insert=\e[2~
++bs=
++delete=\e[3~
++end=\eOF
++end=\e[4~
++end=\e[8~
++end=\e[F
+ f11=\e[23~
+ f12=\e[24~
+ f13=\e[25~
+@@ -71,27 +96,22 @@ f17=\e[31~
+ f18=\e[32~
+ f19=\e[33~
+ f20=\e[34~
+-kpleft=\eOt
+-kpright=\eOv
+-kpup=\eOx
++home=\eOH
++home=\e[1~
++home=\e[7~
++home=\e[H
++insert=\e[2~
++kpasterix=\eOj
+ kpdown=\eOr
+-kphome=\eOw
+ kpend=\eOq
++kphome=\eOw
++kpleft=\eOt
++kpminus=\eOm
+ kpnpage=\eOs
+-kpppage=\eOy
+ kpplus=\eOk
+-kpminus=\eOm
+-kpasterix=\eOj
+-delete=\e[3~
+-bs=
+-home=\e[1~
+-home=\e[7~
+-end=\eOF
+-end=\e[F
+-end=\e[4~
+-end=\e[8~
+-home=\eOH
+-home=\e[H
++kpppage=\eOy
++kpright=\eOv
++kpup=\eOx
+ pgdn=\e[6~
+ pgup=\e[5~
+
+@@ -108,14 +128,14 @@ f19=\e[20;2~
+ f20=\e[21;2~
+
+ # Arrows for both keypad modes (application and normal).
+-up=\e[A
+-up=\eOA
+-down=\e[B
+ down=\eOB
+-right=\e[C
+-right=\eOC
+-left=\e[D
++down=\e[B
+ left=\eOD
++left=\e[D
++right=\eOC
++right=\e[C
++up=\eOA
++up=\e[A
+
+ [terminal:gnome]
+ copy=xterm
+@@ -126,8 +146,15 @@ copy=xterm
+ [terminal:xterm-new]
+ copy=xterm
+
++[terminal:xterm-xfree86]
++copy=xterm
++
+ [terminal:xterm-color]
+-insert=\e[2~
++bs=
++delete=\e[3~
++end=\eOF
++end=\e[4~
++end=\e[8~
+ f11=\e[23~
+ f12=\e[24~
+ f13=\e[25~
+@@ -138,29 +165,27 @@ f17=\e[31~
+ f18=\e[32~
+ f19=\e[33~
+ f20=\e[34~
+-kpleft=\eOt
+-kpright=\eOv
+-kpup=\eOx
++home=\eOH
++home=\e[1~
++home=\e[7~
++insert=\e[2~
++kpasterix=\eOj
+ kpdown=\eOr
+-kphome=\eOw
+ kpend=\eOq
++kphome=\eOw
++kpleft=\eOt
++kpminus=\eOm
+ kpnpage=\eOs
+-kpppage=\eOy
+ kpplus=\eOk
+-kpminus=\eOm
+-kpasterix=\eOj
+-delete=\e[3~
+-bs=
+-home=\e[1~
+-home=\e[7~
+-home=\eOH
+-end=\e[4~
+-end=\e[8~
+-end=\eOF
++kpppage=\eOy
++kpright=\eOv
++kpup=\eOx
+ pgdn=\e[6~
+ pgup=\e[5~
+
+ [terminal:ibmpc3]
++bs=^h
++end=\e[F
+ f11=\e[Y
+ f12=\e[Z
+ f13=\e[a
+@@ -171,11 +196,9 @@ f17=\e[e
+ f18=\e[f
+ f19=\e[g
+ f20=\e[h
+-bs=^h
+-end=\e[F
+-kpplus=\e[+
+-kpminus=\e[-
+ kpasterix=\e[*
++kpminus=\e[-
++kpplus=\e[+
+
+ [terminal:cons25]
+ f11=\e[Y
+@@ -188,3 +211,127 @@ f17=\e[e
+ f18=\e[f
+ f19=\e[g
+ f20=\e[h
++
++# Sequences below are used in OpenBSD wscons, also via remote login
++
++[terminal:vt220]
++bs=
++end=\e[8~
++f1=\e[11~
++f2=\e[12~
++f3=\e[13~
++f4=\e[14~
++f5=\e[15~
++f6=\e[17~
++f7=\e[18~
++f8=\e[19~
++f9=\e[20~
++f10=\e[21~
++f11=\e[23~
++f12=\e[24~
++home=\e[7~
++
++[terminal:wsvt25]
++bs=
++end=\e[8~
++f1=\e[11~
++f2=\e[12~
++f3=\e[13~
++f4=\e[14~
++f5=\e[15~
++f6=\e[17~
++f7=\e[18~
++f8=\e[19~
++f9=\e[20~
++f10=\e[21~
++f11=\e[23~
++f12=\e[24~
++home=\e[7~
++
++[terminal:wsvtg]
++bs=
++end=\e[8~
++f1=\e[11~
++f2=\e[12~
++f3=\e[13~
++f4=\e[14~
++f5=\e[15~
++f6=\e[17~
++f7=\e[18~
++f8=\e[19~
++f9=\e[20~
++f10=\e[21~
++f11=\e[23~
++f12=\e[24~
++home=\e[7~
++
++# Not a real vt100, but NetBSD wscons in vt220 mode with
++# $TERM set to vt100. Except F5-F9, this matches screen.
++
++[terminal:vt100]
++bs=
++complete=‰
++delete=\e[3~
++end=\e[8~
++f1=\e[11~
++f2=\e[12~
++f3=\e[13~
++f4=\e[14~
++f5=\e[15~
++f6=\e[17~
++f7=\e[18~
++f8=\e[19~
++f9=\e[20~
++f10=\e[21~
++f11=\e[23~
++f12=\e[24~
++home=\e[7~
++insert=\e[2~
++pgdn=\e[6~
++pgup=\e[5~
++
++# GNU screen - depending on its environment, here: wsvt25
++[terminal:screen]
++end=\e[8~
++f10=\e[20~
++f1=\e[11~
++f2=\e[12~
++f3=\e[13~
++f4=\e[14~
++f5=\e[15~
++f6=\e[15~
++f7=\e[17~
++f8=\e[18~
++f9=\e[19~
++home=\e[7~
++
++# PuTTY
++[terminal:ansi]
++bs=^h
++down=\eOB
++f1=\eOP
++f2=\eOQ
++f3=\eOR
++f4=\eOS
++left=\eOD
++right=\eOC
++up=\eOA
++
++# Windows 3.1 TELNET.EXE
++# (not really useful. The F-Keys, INS etc. don't work.)
++[terminal:ansi-nt]
++f1=\eOP
++f2=\eOQ
++f3=\eOR
++f4=\eOS
++bs=^h
++up=\e[A
++down=\e[B
++left=\e[D
++right=\e[C
++delete=
++
++# Microsoft Services for Unix 3.5 (native terminal, xterm see above)
++[terminal:interix]
++home=\e[H
++delete=
diff --git a/package/mc/patches/patch-lib_mc_menu b/package/mc/patches/patch-lib_mc_menu
new file mode 100644
index 000000000..c29c0a79d
--- /dev/null
+++ b/package/mc/patches/patch-lib_mc_menu
@@ -0,0 +1,17 @@
+$Id$
+$MirOS: ports/misc/mc/patches/patch-lib_mc_menu,v 1.9 2007/03/01 23:56:43 tg Exp $
+--- mc-4.6.1.orig/lib/mc.menu 2004-08-17 08:31:16.000000000 +0000
++++ mc-4.6.1/lib/mc.menu 2007-03-20 13:32:10.000000000 +0000
+@@ -1,4 +1,12 @@
+ shell_patterns=0
+++ t r & ! t t
++u Diff file against opposite
++ diff -dupa %f %D/%F 2>&1 | less
++
++= t d
++U Diff dir against opposite
++ diff -pdu . %D 2>&1 | grep -v "^Only in " | less
++
+ + ! t t
+ @ Do something on the current file
+ CMD=%{Enter command}
diff --git a/package/mc/patches/patch-src_key_c b/package/mc/patches/patch-src_key_c
new file mode 100644
index 000000000..00b504c71
--- /dev/null
+++ b/package/mc/patches/patch-src_key_c
@@ -0,0 +1,13 @@
+$Id$
+$MirOS: ports/misc/mc/patches/patch-src_key_c,v 1.1 2006/10/28 22:35:47 tg Exp $
+--- mc-4.6.1.orig/src/key.c 2005-06-08 12:27:19.000000000 +0000
++++ mc-4.6.1/src/key.c 2007-03-20 13:32:10.000000000 +0000
+@@ -86,7 +86,7 @@ int mou_auto_repeat = 100;
+ int double_click_speed = 250;
+ int old_esc_mode = 0;
+
+-int use_8th_bit_as_meta = 0;
++int use_8th_bit_as_meta = 1;
+
+ typedef struct key_def {
+ char ch; /* Holds the matching char code */
diff --git a/package/mc/patches/patch-src_main_c b/package/mc/patches/patch-src_main_c
new file mode 100644
index 000000000..f7b29b3d0
--- /dev/null
+++ b/package/mc/patches/patch-src_main_c
@@ -0,0 +1,13 @@
+$Id$
+$MirOS: ports/misc/mc/patches/patch-src_main_c,v 1.6 2006/10/28 22:35:48 tg Exp $
+--- mc-4.6.1.orig/src/main.c 2005-07-23 16:52:02.000000000 +0000
++++ mc-4.6.1/src/main.c 2007-03-20 13:32:10.000000000 +0000
+@@ -150,7 +150,7 @@ int auto_save_setup = 1;
+
+ #ifndef HAVE_CHARSET
+ /* If true, allow characters in the range 160-255 */
+-int eight_bit_clean = 1;
++int eight_bit_clean = 0;
+
+ /*
+ * If true, also allow characters in the range 128-159.
diff --git a/package/mc/patches/patch-vfs_extfs_iso9660_in b/package/mc/patches/patch-vfs_extfs_iso9660_in
new file mode 100644
index 000000000..d515ff0a8
--- /dev/null
+++ b/package/mc/patches/patch-vfs_extfs_iso9660_in
@@ -0,0 +1,31 @@
+$Id$
+$MirOS: ports/misc/mc/patches/patch-vfs_extfs_iso9660_in,v 1.1 2006/09/28 20:39:05 tg Exp $
+
+ This does limit names to the C locale, but skips error messages.
+
+--- mc-4.6.1.orig/vfs/extfs/iso9660.in 2004-10-29 09:14:38.000000000 +0000
++++ mc-4.6.1/vfs/extfs/iso9660.in 2007-03-20 13:32:10.000000000 +0000
+@@ -9,15 +9,7 @@
+ # tested to comply with isoinfo 2.0's output
+
+ test_iso () {
+- CHARSET=`echo "$save_ctype" | sed -n -e 's/.*\.\(.*\)"$/\1/p' | tr '[A-Z]' '[a-z]'`
+- if test -n "$CHARSET"; then
+- isoinfo -j $CHARSET 2>&1 | grep "Unknown charset" >/dev/null && CHARSET=
+- fi
+- if test -n "$CHARSET"; then
+- JOLIET_OPT="-j $CHARSET -J"
+- else
+ JOLIET_OPT="-J"
+- fi
+ ISOINFO="isoinfo -R"
+ isoinfo -d -i "$1" | grep "NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT"
+ }
+@@ -65,7 +57,6 @@ mcisofs_copyout () {
+ $ISOINFO -i "$1" -x "/$2" > "$3"
+ }
+
+-save_ctype=`locale | grep LC_CTYPE`
+ LC_ALL=C
+
+ cmd="$1"
diff --git a/package/mgetty/Config.in b/package/mgetty/Config.in
new file mode 100644
index 000000000..286134c46
--- /dev/null
+++ b/package/mgetty/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_MGETTY
+ prompt "mgetty+sendfax.................... the data/fax solution for your analog modem"
+ tristate
+ default n
+ help
+ mgetty now includes sendfax (and AutoPPP)
+ using pppd for data and doing fax/login by itself.
diff --git a/package/mgetty/Makefile b/package/mgetty/Makefile
new file mode 100644
index 000000000..298f1e9c8
--- /dev/null
+++ b/package/mgetty/Makefile
@@ -0,0 +1,113 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mgetty
+PKG_VERSION:= 1.1.35
+PKG_XVERSION:= Feb22
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6805f8e31423bb777be80e3a856001cb
+MASTER_SITES:= ftp://alpha.greenie.net/pub/mgetty/source/1.1/
+DISTFILES:= ${PKG_NAME}${PKG_VERSION}-${PKG_XVERSION}.tar.gz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MGETTY,mgetty,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+pre-configure:
+ cp ${WRKBUILD}/policy.h-dist ${WRKBUILD}/policy.h
+ echo "#define AUTO_PPP" >> ${WRKBUILD}/policy.h
+ echo "#undef FAX_NOTIFY_PROGRAM" >> ${WRKBUILD}/policy.h
+ echo "#define FAX_NOTIFY_PROGRAM \"/usr/lib/mgetty+sendfax/new_fax\"" >> ${WRKBUILD}/policy.h
+ echo "#undef DATA_FLOW" >> ${WRKBUILD}/policy.h
+ echo "#define DATA_FLOW FLOW_HARD" >> ${WRKBUILD}/policy.h
+ echo "#undef DEVICE_GROUP" >> ${WRKBUILD}/policy.h
+ echo "#undef DEVICE_OWNER" >> ${WRKBUILD}/policy.h
+ echo "#define DEVICE_OWNER \"root\"" >> ${WRKBUILD}/policy.h
+ echo "#undef FAXREC_FLOW" >> ${WRKBUILD}/policy.h
+ echo "#define FAXREC_FLOW FLOW_SOFT" >> ${WRKBUILD}/policy.h
+ echo "#undef FAXSEND_FLOW" >> ${WRKBUILD}/policy.h
+ echo "#define FAXSEND_FLOW FLOW_SOFT" >> ${WRKBUILD}/policy.h
+
+do-build:
+ mkdir -p ${WRKINST}/usr/bin
+ mkdir -p ${WRKINST}/usr/sbin
+ mkdir -p ${WRKINST}/usr/lib/mgetty+sendfax
+ mkdir -p ${WRKINST}/etc/mgetty+sendfax
+ ${MAKE} -C ${WRKBUILD} \
+ ${TARGET_CONFIGURE_OPTS} \
+ prefix="${WRKINST}/usr" \
+ CONFDIR=/etc/mgetty+sendfax \
+ bin-all
+ ${CP} ${WRKBUILD}/mgetty ${WRKINST}/usr/sbin
+ ${CP} ${WRKBUILD}/sendfax ${WRKINST}/usr/sbin
+ ${CP} ${WRKBUILD}/fax/faxrunqd ${WRKINST}/usr/sbin
+ chmod 755 ${WRKINST}/usr/sbin/*
+ ${CP} ${WRKBUILD}/fax/faxq-helper ${WRKINST}/usr/lib/mgetty+sendfax
+ chmod u+s ${WRKINST}/usr/lib/mgetty+sendfax/faxq-helper
+ ${CP} ${WRKBUILD}/fax/cour25n.pbm ${WRKINST}/usr/lib/mgetty+sendfax
+ ${CP} ${WRKBUILD}/fax/cour25.pbm ${WRKINST}/usr/lib/mgetty+sendfax
+ ${CP} ${WRKBUILD}/fax/faxq ${WRKINST}/usr/bin
+ ${CP} ${WRKBUILD}/fax/faxrm ${WRKINST}/usr/bin
+ ${CP} ${WRKBUILD}/fax/faxrunq ${WRKINST}/usr/bin
+ ${CP} ${WRKBUILD}/fax/faxspool ${WRKINST}/usr/bin
+ ${CP} ${WRKBUILD}/g3/g32pbm ${WRKINST}/usr/bin
+ (cd ${WRKINST}/usr/bin;\
+ ln -snf g32pbm g3topbm;\
+ );
+ ${CP} ${WRKBUILD}/g3/g3cat ${WRKINST}/usr/bin
+ ${CP} ${WRKBUILD}/g3/pbm2g3 ${WRKINST}/usr/bin
+ ${CP} ${WRKBUILD}/g3/sff2g3 ${WRKINST}/usr/bin
+ chmod 755 ${WRKINST}/usr/bin/*
+# Installation into /etc
+ ${CP} ${WRKBUILD}/dialin.config ${WRKINST}/etc/mgetty+sendfax
+ ${CP} ${WRKBUILD}/fax/faxheader ${WRKINST}/etc/mgetty+sendfax
+ ${CP} ${WRKBUILD}/faxrunq.config ${WRKINST}/etc/mgetty+sendfax
+ ${CP} ${WRKBUILD}/fax/faxspool.rules ${WRKINST}/etc/mgetty+sendfax/faxspool.rules.sample
+ ${WRKBUILD}/sedscript < ${WRKBUILD}/login.cfg.in > ${WRKINST}/etc/mgetty+sendfax/login.config
+ ${WRKBUILD}/sedscript < ${WRKBUILD}/mgetty.cfg.in > ${WRKINST}/etc/mgetty+sendfax/mgetty.config
+ ${WRKBUILD}/sedscript < ${WRKBUILD}/sendfax.cfg.in > ${WRKINST}/etc/mgetty+sendfax/sendfax.config
+
+ISBIN:=${IDIR_MGETTY}/usr/sbin
+IBIN:=${IDIR_MGETTY}/usr/bin
+ILIB:=${IDIR_MGETTY}/usr/lib/mgetty+sendfax
+IETC:=${IDIR_MGETTY}/etc/mgetty+sendfax
+
+do-install:
+ ${INSTALL_DIR} ${ISBIN} ${IBIN} ${ILIB} ${IETC}
+ ${INSTALL_BIN} \
+ ${WRKINST}/usr/bin/faxq \
+ ${WRKINST}/usr/bin/faxrm \
+ ${WRKINST}/usr/bin/faxrunq \
+ ${WRKINST}/usr/bin/faxspool \
+ ${WRKINST}/usr/bin/g32pbm \
+ ${WRKINST}/usr/bin/g3cat \
+ ${WRKINST}/usr/bin/pbm2g3 \
+ ${WRKINST}/usr/bin/sff2g3 \
+ ${IBIN}
+ ${INSTALL_BIN} \
+ ${WRKINST}/usr/sbin/mgetty \
+ ${WRKINST}/usr/sbin/sendfax \
+ ${WRKINST}/usr/sbin/faxrunqd \
+ ${ISBIN}
+ install -m4755 \
+ ${WRKINST}/usr/lib/mgetty+sendfax/faxq-helper \
+ ${ILIB}
+ ${INSTALL_DATA} \
+ ${WRKINST}/usr/lib/mgetty+sendfax/cour25n.pbm \
+ ${WRKINST}/usr/lib/mgetty+sendfax/cour25.pbm \
+ ${ILIB}
+ install -m600 \
+ ${WRKINST}/etc/mgetty+sendfax/dialin.config \
+ ${WRKINST}/etc/mgetty+sendfax/faxheader \
+ ${WRKINST}/etc/mgetty+sendfax/faxrunq.config \
+ ${WRKINST}/etc/mgetty+sendfax/faxspool.rules.sample \
+ ${WRKINST}/etc/mgetty+sendfax/login.config \
+ ${WRKINST}/etc/mgetty+sendfax/mgetty.config \
+ ${WRKINST}/etc/mgetty+sendfax/sendfax.config \
+ ${IETC}
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mgetty/ipkg/mgetty.control b/package/mgetty/ipkg/mgetty.control
new file mode 100644
index 000000000..c280295be
--- /dev/null
+++ b/package/mgetty/ipkg/mgetty.control
@@ -0,0 +1,4 @@
+Package: mgetty
+Priority: optional
+Section: communications
+Description: mgetty + sendfax
diff --git a/package/mgetty/patches/mgetty.patch b/package/mgetty/patches/mgetty.patch
new file mode 100644
index 000000000..c5ffb6f2e
--- /dev/null
+++ b/package/mgetty/patches/mgetty.patch
@@ -0,0 +1,98 @@
+Only in mgetty-1.1.31: .prepared
+diff -ur mgetty-1.1.31-old/Makefile mgetty-1.1.31/Makefile
+--- mgetty-1.1.31-old/Makefile 2006-01-02 00:37:56.000000000 +0000
++++ mgetty-1.1.31/Makefile 2006-01-02 00:43:57.000000000 +0000
+@@ -164,7 +164,9 @@
+ #
+ # if your systems doesn't have one, use the shell script that I provide
+ # in "inst.sh" (taken from X11R5). Needed on IRIX5.2
+-INSTALL=install -c -o bin -g bin
++STRIP=$(STAGING_DIR)sstrip
++INSTALL=install -c -o root -g root
++#INSTALL=install -c -o bin -g bin
+ #INSTALL=install -c -o root -g wheel # NeXT/BSD
+ #INSTALL=/usr/ucb/install -c -o bin -g bin # AIX, Solaris 2.x
+ #INSTALL=installbsd -c -o bin -g bin # OSF/1, AIX 4.1, 4.2
+@@ -216,7 +218,7 @@
+ # (it's possible to run faxrunq(d) as root, but the FAX_OUT_USER
+ # MUST NOT BE root or any other privileged account).
+ #
+-FAX_OUT_USER=fax
++FAX_OUT_USER=root
+ #
+ #
+ # Where section 1 manual pages should be placed
+@@ -416,7 +418,12 @@
+ ./mksed >sedscript
+ chmod 700 sedscript
+
+-mksed: mksed.c policy.h Makefile
++REALGCC:=/usr/bin/gcc
++mksed: mksed.c policy.h Makefile
++ ( echo $(REALGCC); $(MAKE) "CC=$(REALGCC)" "CFLAGS=$(CFLAGS)" mksed-wrong;\
++ );
++
++mksed-wrong: mksed.c policy.h Makefile
+ $(CC) $(CFLAGS) -DBINDIR=\"$(BINDIR)\" -DSBINDIR=\"$(SBINDIR)\" \
+ -DLIBDIR=\"$(LIBDIR)\" \
+ -DCONFDIR=\"$(CONFDIR)\" \
+@@ -590,8 +597,10 @@
+ -test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
+ -mv -f $(SBINDIR)/mgetty $(SBINDIR)/mgetty.old
+ -mv -f $(SBINDIR)/sendfax $(SBINDIR)/sendfax.old
+- $(INSTALL) -s -m 700 mgetty $(SBINDIR)
+- $(INSTALL) -s -m 755 sendfax $(SBINDIR)
++ $(INSTALL) -m 700 mgetty $(SBINDIR)
++ $(STRIP) $(SBINDIR)/mgetty
++ $(INSTALL) -m 755 sendfax $(SBINDIR)
++ $(STRIP) $(SBINDIR)/sendfax
+ #
+ # data files + directories
+ #
+@@ -653,7 +662,8 @@
+ if [ ! -z "$(INSTALL_MECHO)" ] ; then \
+ cd compat ; \
+ $(CC) $(CFLAGS) -o mg.echo mg.echo.c && \
+- $(INSTALL) -s -m 755 mg.echo $(BINDIR) ; \
++ $(INSTALL) -m 755 mg.echo $(BINDIR) && \
++ $(STRIP) $(BINDIR)/mg.echo ; \
+ fi
+
+ #
+Only in mgetty-1.1.31-old: Makefile.orig
+Only in mgetty-1.1.31-old: Makefile.rej
+diff -ur mgetty-1.1.31-old/g3/Makefile mgetty-1.1.31/g3/Makefile
+--- mgetty-1.1.31-old/g3/Makefile 2006-01-02 00:37:56.000000000 +0000
++++ mgetty-1.1.31/g3/Makefile 2006-01-02 00:42:17.000000000 +0000
+@@ -40,7 +40,8 @@
+ # install programs
+ #
+ for f in $(G3_PROGRAMS) ; do \
+- $(INSTALL) -s -m 755 $$f $(BINDIR) ; \
++ $(INSTALL) -m 755 $$f $(BINDIR) ; \
++ $(STRIP) $(BINDIR)/$$f ; \
+ done
+ #
+ # make symlink for "g3topbm" (so third-party fax viewers won't fail)
+diff -ur mgetty-1.1.31-old/logfile.c mgetty-1.1.31/logfile.c
+--- mgetty-1.1.31-old/logfile.c 2006-01-02 00:37:56.000000000 +0000
++++ mgetty-1.1.31/logfile.c 2006-01-02 00:42:17.000000000 +0000
+@@ -327,12 +327,11 @@
+ }
+ else /* ERROR or FATAL */
+ {
+- fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: %s",
++ fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: #%d",
+ tm->tm_mon+1, tm->tm_mday,
+ tm->tm_hour, tm->tm_min, tm->tm_sec,
+ log_infix, ws,
+- ( errnr <= sys_nerr ) ? sys_errlist[errnr]:
+- "<error not in list>" );
++ errnr );
+ #ifdef SYSLOG
+ syslog( level == L_FATAL? LOG_ALERT: LOG_ERR, "%s: %m", ws );
+ #endif
+Only in mgetty-1.1.31-old/voice/libutil: access.c.orig
+Only in mgetty-1.1.31-old/voice/libvoice: Lucent.c.orig
+Only in mgetty-1.1.31-old/voice/libvoice: V253modem.c.orig
+Only in mgetty-1.1.31-old/voice/pvftools: pvftormd.c.orig
diff --git a/package/miau/Config.in b/package/miau/Config.in
new file mode 100644
index 000000000..4ab17bcad
--- /dev/null
+++ b/package/miau/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_MIAU
+ prompt "miau.............................. Another IRC-bouncer/proxy"
+ tristate
+ default n
+ help
+ In short, miau is an IRC-bouncer/proxy.
+ Being more verbose, miau is small but quite featured
+ IRC-bouncer - a service bit like HTTP-proxy, but
+ for IRC-networks.
+
+ http://sourceforge.net/projects/miau/
+
diff --git a/package/miau/Makefile b/package/miau/Makefile
new file mode 100644
index 000000000..55543a03b
--- /dev/null
+++ b/package/miau/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= miau
+PKG_VERSION:= 0.6.0.2
+PKG_RELEASE:= 6
+PKG_MD5SUM:= 1b78d219a03655399c165eeb021cddd8
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=miau/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MIAU,miau,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes
+CONFIGURE_ARGS+= --enable-automode \
+ --enable-releasenick \
+ --enable-uptime \
+ --enable-privlog \
+ --enable-onconnect
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MIAU}/usr/bin
+ ${INSTALL_DIR} ${IDIR_MIAU}/etc/{init.d,miau}
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/${PKG_NAME} ${IDIR_MIAU}/usr/bin/
+ ${INSTALL_BIN} ./files/miau.init ${IDIR_MIAU}/etc/init.d/miau
+ ${INSTALL_DATA} ./files/miaurc ${IDIR_MIAU}/etc/miau/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/miau/files/miau.init b/package/miau/files/miau.init
new file mode 100755
index 000000000..ae22a32fe
--- /dev/null
+++ b/package/miau/files/miau.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${miau:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/run ] || mkdir -p /var/run
+ [ -d /var/log/miau ] || mkdir -p /var/log/miau
+ /usr/bin/miau -f -d /etc/miau > /var/log/miau/miau.log 2> /var/log/miau/error.log &
+ ;;
+stop)
+ [ -f /var/run/miau.pid ] && kill $(cat /var/run/miau.pid) >/dev/null 2>&1 && rm /var/run/miau.pid
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/miau/files/miaurc b/package/miau/files/miaurc
new file mode 100644
index 000000000..c12e4ff11
--- /dev/null
+++ b/package/miau/files/miaurc
@@ -0,0 +1,587 @@
+#
+# miau 0.5.3 configuration file example
+# (C) 2003-2004 Tommi Saviranta <tsaviran@cs.helsinki.fi>
+#
+
+# About structure of this configuration file:
+#
+# - All parameters are written inside quotes (for example, "foobar")
+#
+# - Options are defined like: option = "parameter1"[:"parameter2"] ...
+#
+# - When entering multiparameter options, certain parameters have default
+# values and can be left out.
+#
+# - When entering multiparameter options and, for example, user doesn't want
+# to set parameter2 at all but he needs to set parameter3, parameter2 can
+# be skipped with column (':') like: "parameter1"::"parameter3".
+#
+# - Empty lines and characters after '#' (hash) are ignored.
+#
+# - When setting permissions, switched etc. (switches (booleans) are described
+# as "state"), everything beginning with "t", "r" and "1" are concidered as
+# "true" or "yes" (positive). Everything else is "false" or "no" (negative).
+
+
+
+# Required settings
+################################################################################
+
+
+# nicknames = { "nick" }: Your nickname (and secondary nicknames) on IRC.
+# If the primary nick (first nick on the list) is already on use,
+# miau will try the others on the list.
+#
+# Default: no default
+#
+# Example:
+#nicknames = {
+# "zak"
+# "zakh"
+#}
+
+
+# realname = "realname": Your "real" name on IRC.
+#
+# Default: no default
+#
+# Example:
+#realname = "Prokhor Zakharov"
+
+
+# username = "username": Your ident (matters only if you don't have identd
+# running).
+#
+# Default: no default
+#
+# Example:
+#username = "zak"
+
+
+# password = "password": The password miau will expect to receive from client
+# when it's registering with nick. If this is 13 characters long,
+# miau assumed it's crypted.
+#
+# If miau is compiled with ENABLE_MKPASSWD, miau can generate password-hashes
+# (from command line) with -c -switch.
+#
+# Default: no default
+#
+# Example:
+#password = "foobar"
+
+
+# listenport = "port": The port miau will wait for incoming connections.
+#
+# Default: no default
+#
+# Example:
+#listenport = "4096"
+
+
+# servers = { "server":"port":"password":"timeout" }: miau's IRC-server-list.
+# Each line represents one server, where timeout is delay in
+# seconds before connectiong attempt times out. Only "server"
+# parameter is required.
+#
+# Default: no default
+#
+# Example:
+#servers = {
+# "irc.net"
+# "irc.foo.bar":"6662"
+# "localhost"::"foobar"
+# "127.0.0.1":"6670"::"5"
+#}
+
+
+# connhosts = { "host":"permitted" }: List of hosts that are allowed (or denied)
+# to connect to miau. When boolean-value is left unset, it is
+# assumed to be "true". This list will be processed as a chain
+# which means latter rules can override previous ones.
+#
+# Default: no default
+#
+# Example:
+#connhosts = {
+# "*":"yes"
+# "client*.evil.net":"no"
+#}
+
+
+
+# Optional settings
+################################################################################
+
+
+# listenhost = "host": Host miau uses to listen on.
+#
+# If you are compiled with IPV6 and need this to listen on an IPV4 port, you
+# must use an IP in the form ::FFFF:127.0.0.1
+#
+# Default: no default
+#
+# Example:
+#listenhost = "127.0.0.1"
+
+
+# bind = "host": Host/IP miau uses for outgoing connections.
+#
+# Default: none
+#
+# Example:
+#bind = "172.16.1.1"
+
+
+# maxclients = "number": Maximum number of clients connected to miau
+# concurrently. Set to zero for unlimited clients.
+#
+# Default: 3
+#
+#Example:
+#maxclients = "1"
+
+
+# stonedtimeout = "seconds": Time (in seconds) with no data from the server
+# before it is declared stoned and being disconnected. Although
+# minimum value is 30, this value has no upper limit. Watch out,
+# though, if this value is set too high, death of servers may stay
+# undetected for a very long time if you are idle.
+#
+# Default: 90
+#
+# Example:
+#stonedtimeout = "150"
+
+
+# connecttimeout = "seconds": Time (in seconds) before connection attampt will
+# time out. Note that while connecting to the server miau will not
+# respond to clients. Minimum value is 5, and many systems define
+# maximum value.
+#
+# Default: 30
+#
+# Example:
+#connecttimeout = "60"
+
+
+# channels = { "channel":"keyword" }: List of channels to join.
+#
+# Default: none
+#
+# Example:
+#channels = {
+# "#foobar"
+# "#miau":"cats"
+#}
+
+
+# rejoin = "state": Rejoin channels after disconnecting from the server.
+# If rejoin is set to true, channels defined in "channels" are
+# also joined when client first time connects to miau.
+#
+# Default: true
+#
+# Example:
+#rejoin = "false"
+
+
+# leave = "state": Leave channels when all clients have detached from miau.
+# If "leave" is set to "false" and "rejoin" is set to "true",
+# channels defined at "channels" will be joined at miau startup.
+# If both "leave" and "rejoin" is set to "true", channels that
+# are left at client detach, are rejoined when client attached
+# back to miau.
+#
+# Default: false
+#
+# Example:
+#leave = "false"
+
+
+# leavemsg = "message": Message miau will either use as PART-message or as an
+# ACTION when all clients have detached from miau. If unset or
+# set to empty, no message will be shown. Note that many people
+# dislike event-based messages (which happens when "leave" is set
+# to "false" and "leavemsg" is set). Also see usequitmsg.
+#
+# Note: Note that commenting this option out and rehashing after leavemsg was
+# set, this option is _not_ reverted. To disable leavemsg afterwards you
+# need to write an empty string here and rehash.
+#
+# Default: none
+#
+# Example:
+#leavemsg = "doh"
+
+
+# awaymsg = "message": Text that will be set to miau's away-reason when all
+# clients have detached from miau. If unset or set to empty,
+# AWAY-status will be left untouched. When any client attaches
+# back to miau, AWAY-status will be reset. Also see usequitmsg.
+#
+# Note: If user sets him/herself away, miau will not touch away-status nor
+# message neither when connecting to or disconnecting from miau.
+#
+# Note: Note that commenting this option out and rehashing after awaymsg was
+# set, this option is _not_ reverted. To disable awaymsg afterwards you
+# need to write an empty string here and rehash.
+#
+# Default: none
+#
+# Example:
+#awaymsg = "bouncing around - all private messages will be logged"
+
+
+# usequitmsg = "state": Use last quit-reason as away-reason and/or leave-message
+# (if respective options are enabled) when all clients have
+# disconnected from miau. If quit-reason is empty, default values
+# of awaymsg and leavemsg will be used, otherwise most recent
+# quit-message overrides values in miaurc.
+#
+# Default: true
+#
+# Example:
+# usequitmsg = "false"
+
+
+# getnick = "selection": miau can try to reclaim your primary nick when it is
+# lost. This option may be one of the following: "never",
+# "detached", "attached", or "always".
+# "never" ....... miau will not try to get your nick back.
+# "detached" .... miau will try to get your nick when no
+# clients are attached.
+# "attached" .... miau will try to get your nick when
+# there are one or more clients attached.
+# "always" ...... miau will try to get your nick
+#
+# Note: Do _not_ use options "attached" and "always" with clients (like
+# irc-II EPIC) that automatically change your nick when they receive
+# NICKINUSE from the server - you might end up chaning your nick until
+# server drops your connection due excess flood.
+#
+# Default: detached
+#
+# Example:
+#getnick = "always"
+
+
+# getnickinterval = "seconds": Time between tries (in seconds) to obtain
+# currently (possibly) lost primary nick. Don't set it too low
+# or you might get kicked out the server due to excess flood.
+#
+# Default: 60
+#
+# Example:
+#getnickinterval = "30"
+
+
+# antiidle = "minutes": Time between idle-timer resets in minutes. Set to 0 to
+# disable.
+#
+# Default: 0
+#
+# Example:
+#antiidle = "300"
+
+
+# qloglength = "minutes": Age of oldest line in quicklog in minutes. Set to zero
+# to disable quicklog.
+#
+# This option might not be compiled in.
+#
+# Default: 30
+#
+# Example:
+#qloglength = "30"
+
+
+# timestamp = "option": Location of timestamp in quicklog events. This option
+# may be one of the following "beginning", "end", or "none".
+#
+# This option might not be compiled in.
+#
+# Default: none
+#
+# Example:
+#timestamp = "beginning"
+
+
+# flushqlog = "state": If set to true, quicklog will be written only when no
+# clients are connected and quicklog will be erased when client
+# connects to miau. If you are running a single client, you
+# probably want to leave this to "false.
+#
+# This option might not be compiled in.
+#
+# Default: true
+#
+# Example:
+#flushqlog = "true"
+
+
+# inbox = "state": Enables logging private messages when no clients are
+# connected to miau.
+#
+# This option might not be compiled in.
+#
+# Default: true
+#
+# Example:
+#inbox = "true"
+
+
+# nevergiveup = "state": If set to true, miau will reset "working"-status of
+# servers to working when all are set to dysfunctional.
+# Respectively, if set to false, miau will quit when all servers
+# on the list have been set to dysfunctional.
+#
+# Default: true
+#
+# Example:
+#nevergiveup = "false"
+
+
+# norestricted = "state": If set to true, miau will not stay on server that
+# forces user to have restricted-status (+r).
+#
+# Default: true
+#
+# Example:
+#norestricted = "false"
+
+
+# reconnectdelay = "seconds": Time (in seconds) between connection attempts.
+# Minumun value is set to 1.
+#
+# Default: 10
+#
+# Example:
+#reconnectdelay = "30"
+
+
+# nickfillchar = "fill character": Character used to modify your primary nick
+# when all defined nicks are already occupied. Note character is
+# a single octet (byte) and if longer string is fed, only the
+# first character is used.
+#
+# Example: When nickfillchar is set to '_', primary nick is "zak" and all
+# defined nicks are occupied, next nicks tried are "zak_", "zak__",
+# "zak___" and so on. When nick has grown too long, it will be shifted
+# one characted to right (where shift is cyclic) - this means
+# "zak______" will become "_zak_____", which, again, will become
+# "__zak____".
+#
+# Default: _
+#
+# Example:
+#nickfillchar = "^"
+
+
+# maxnicklen = "length": Maximum nick length, used with nickfillchar.
+#
+# Default: 9
+#
+# Example:
+#maxnicklen = 11
+
+
+# usermode = "usermode(s)": Usermode that miau will request (if no clients are
+# attached at the moment) from the server when connection to the
+# server is established. Leave unset or set to empty to disable
+# this feature.
+#
+# Default: none
+#
+# Example:
+#usermode = "+i"
+
+
+# forwardmsg = "command": miau can collect the (private) messages within three
+# (3) minutes and pipe them into the program specified. Leave this
+# unset or set to empty to disable this feature.
+#
+# Default: none
+#
+# Example:
+#forwardmsg = "mail user@host"
+
+
+# ignore = { "mask":"ignored" }: List of users whose private messages (PRIVMSG)
+# and noticies (NOTICE) are ignored when no clients are attached
+# to miau. When "ignored" is left undefined, it is assumed to be
+# "true". Setting "ignored" to "false" means that this user will
+# _not_ be ignored. This list is processed as a chain.
+#
+# Default: none
+#
+# Example:
+#ignore = {
+# "*@localhost":"yes"
+# "zak*":"no"
+#}
+
+
+# privlog = "mode": Whatever private messages should be logged in nick-specific
+# files. Can be one of "never", "detached", "attached", and
+# "always".
+#
+# This option might not be compiled in.
+#
+# Default: never
+#
+# Example:
+#privlog = "always"
+
+
+# chanlog = { "channel(s)":"options":"logfile" }: List of channel logfiles.
+#
+# When channel is set to "*", line represents global log. When logging,
+# if channel doesn't have entry of it's own in this list, it will use settings
+# of global log and write log to it's own file. When defining global log,
+# "logfile" is ignored. Each line can have multiple channels
+# (like "#foobar,#miau").
+#
+# If logfile is left undefined, logfile will be named after the channel with
+# possible postfix (see logpostfix). All lofiles are written in miau's work
+# directory.
+#
+# Options consist of abritary set of following possibilities:
+# j: log joins
+# e: log parts (exits)
+# q: log quits
+# m: log messages (privmsg/notice)
+# c: log mode changes (changes)
+# n: log nick changes
+# o: log misc events (other)
+# b: log messages from miau (bouncer)
+# a: log all of above
+# A: log when a client is attached
+# D: log when a client is detached
+# C: log continuously (status of clients doesn't matter)
+#
+# This option might not be compiled in.
+#
+# Default: none
+#
+# Example:
+#chanlog = {
+# "#foobar":"a" # log everything on #foobar
+# "#miau":"aD":"foo.log" # log everything to file "foo.log" when
+# all clients are detached
+# "*":"mjeq" # log only messages, joins, parts and quits
+# by default
+#}
+
+
+# logpostfix = "postfix": When writing log to undefined logfile, each logfile
+# consists of channel name followed by postfix. Postfix can be
+# defined here.
+#
+# This option might not be compiled in.
+#
+# Default: no postfix
+#
+# Example:
+#logpostfix = ".log"
+
+
+# onconnect = { "mode":"target/data"(:"data") }: When miau connects and
+# registers user to server, miau can send pre-defined messages.
+# User can define miau to send normal messages (PRIVMSG), notices
+# (NOTICE) or arbitrary messages.
+#
+# Mode can be one of the following:
+# p: private message (PRIVMSG).
+# n: notice (NOTICE). Should be used with services and automatons, but
+# unfortunately some network services can't cope with notices.
+# r: "raw" message. This means user must provide complete message to send
+# to the server. Using raw message user has complete control over what
+# is being sent. If you don't know what this is, you don't need this.
+# When using modes "p" or "n", user must provide both message and target where
+# as with raw messages only one parameter in addition to type should be given.
+#
+# This option might not be compiled in.
+#
+# Default: none
+#
+# Example:
+#onconnect = {
+# "p":"nickserv":"identify foobar"
+# "n":"nickserv@services.host.net":"id raboof"
+# "r":"OPER foo bar"
+#}
+
+
+# automodes = { "mask":"privilegded" }: List of people who are automatically
+# given certain privilege on channel. Mask is given in form of
+# "mode:nick!username@host/#channel" (where "mode" is a single
+# character) and list is processed as a chain.
+#
+# This option might not be compiled in.
+#
+# Default: none
+#
+# Example:
+#automodes = {
+# "o:zak*!zak@client*-myisp.com/#channel":"yes"
+# "o:zak*!*@evil.impersonator.net/#foobar":"no"
+# "v:newbie*!*@ircnet.com/#newbie":"yes"
+#}
+
+
+# automodedelay = "seconds": Time (in seconds) after first queued mode change
+# would take effect. During this period of time miau can collect
+# more than one mode change and commit up to three at a time.
+# Other situation reasonaly big value (like 30) here could prove
+# useful is channel where there are stupid "auto-oping" bots.
+# (Stupid bots do mode changes even if someone else did that
+# already.)
+#
+# This option might not be compiled in.
+#
+# Default: 30
+#
+# Example:
+#automodedelay = "60"
+
+
+# cmdpasswd = "password": Password for remote commands. If this is 13 characters
+# long, miau assumes it's crypted. Comment this out or leave it
+# empty to disable remote commands. When sending miau a remote
+# command, password _always_ begins with column (':') (if
+# cmdpasswd is set to "foobar" (or hash of it), you need to send
+# miau a message beginning with ":foobar" to issue a remote
+# command).
+#
+# This feature might not be compiled in.
+#
+# If miau is compiled with ENABLE_MKPASSWD, miau can generate password-hashes
+# (from command line) with -c -switch.
+#
+# Default: disabled
+#
+# Example:
+#cmdpasswd = ""
+
+
+# dccbounce = "state": miau can bounce DCCs. Set to true to enable bouncing.
+# You probably don't need this.
+#
+# This option might not be compiled in.
+#
+# Default: false
+#
+# Example:
+#dccbounce = "true"
+
+
+# dccbindhost = "host": If miau has separate IPs for IRC-network and clients,
+# you should enter IP for clients here.
+#
+# This option might not be compiled in.
+#
+# Default: no default
+#
+# Example:
+#dccbindhost = "10.0.0.1"
diff --git a/package/miau/ipkg/miau.conffiles b/package/miau/ipkg/miau.conffiles
new file mode 100644
index 000000000..d51f8e83e
--- /dev/null
+++ b/package/miau/ipkg/miau.conffiles
@@ -0,0 +1 @@
+/etc/miau/miaurc
diff --git a/package/miau/ipkg/miau.control b/package/miau/ipkg/miau.control
new file mode 100644
index 000000000..3637d33e6
--- /dev/null
+++ b/package/miau/ipkg/miau.control
@@ -0,0 +1,6 @@
+Package: miau
+Version: 1
+Architecture: mipsel
+Priority: optional
+Section: net
+Description: miau is an IRC-bouncer/proxy
diff --git a/package/miau/ipkg/miau.postinst b/package/miau/ipkg/miau.postinst
new file mode 100644
index 000000000..b66242cff
--- /dev/null
+++ b/package/miau/ipkg/miau.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf miau
+
diff --git a/package/miax/Config.in b/package/miax/Config.in
new file mode 100644
index 000000000..0339f0c15
--- /dev/null
+++ b/package/miax/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_MIAX
+ prompt "miax.............................. A console iax (asterisk) client"
+ tristate
+ default n
+ select ADK_PACKAGE_BLUEZ
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ miax is a console iax (asterisk) client, it can work with
+ a soundcard as a normal voip phone, taking input/output from
+ keyboard, analog/gsm/isdn modem or bluetooth phones.
+
+ http://www.eja.it/?l=gpl&testo=miax
diff --git a/package/miax/Makefile b/package/miax/Makefile
new file mode 100644
index 000000000..11e0089a7
--- /dev/null
+++ b/package/miax/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= miax
+PKG_VERSION:= 1.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 44f0d2ef46ee2697d890b7b96846adc7
+MASTER_SITES:= http://mesh.dl.sourceforge.net/sourceforge/miax/
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MIAX,miax,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" \
+ OFLAGS="${TCFLAGS}" \
+ CPPFLAGS="${TCPPFLAGS}" \
+ LDFLAGS="${TLDFLAGS}" \
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_MIAX}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/miax ${IDIR_MIAX}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/miax/ipkg/miax.control b/package/miax/ipkg/miax.control
new file mode 100644
index 000000000..78e47f566
--- /dev/null
+++ b/package/miax/ipkg/miax.control
@@ -0,0 +1,5 @@
+Package: miax
+Priority: optional
+Section: net
+Description: A console iax (asterisk) client
+Depends: kmod-bluetooth, bluez-libs, libpthread
diff --git a/package/miax/patches/01-cross.patch b/package/miax/patches/01-cross.patch
new file mode 100644
index 000000000..f47c1101d
--- /dev/null
+++ b/package/miax/patches/01-cross.patch
@@ -0,0 +1,24 @@
+diff -ruN miax-1.4-old/Makefile miax-1.4-new/Makefile
+--- miax-1.4-old/Makefile 2005-04-27 18:56:13.000000000 +0200
++++ miax-1.4-new/Makefile 2005-11-30 01:07:21.000000000 +0100
+@@ -1,4 +1,5 @@
+-CFLAGS= -Iiax/ -Igsm/inc -DIAXC_IAX2 -DLIBIAX -g -DPOSIXSLEEP -DLINUX -O2
++OFLAGS= -02 -g
++CFLAGS= -Iiax/ -Igsm/inc $(CPPFLAGS) -DIAXC_IAX2 -DLIBIAX -DPOSIXSLEEP -DLINUX $(OFLAGS)
+ SYSLIBS=-lpthread -lm -lbluetooth
+
+
+@@ -32,11 +33,10 @@
+ miax.o
+
+ all: $(OBJS)
+- gcc $(OBJS) $(CFLAGS) $(SYSLIBS) -o miax
+- cp miax /bin/miax
++ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -o miax
+
+ static: $(OBJS) bluetooth.o
+- gcc $(OBJS) $(CFLAGS) $(SYSLIBS) -static -o miax
++ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(SYSLIBS) -static -o miax
+
+ clean:
+ rm -f $(OBJS) miax
diff --git a/package/microperl/Config.in b/package/microperl/Config.in
new file mode 100644
index 000000000..ccd9c9bd9
--- /dev/null
+++ b/package/microperl/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_MICROPERL
+ prompt "microperl......................... A really minimal perl"
+ tristate
+ default n
+ help
+ Perl without operating-specific functions such as readdir.
+
diff --git a/package/microperl/Makefile b/package/microperl/Makefile
new file mode 100644
index 000000000..6896db6f3
--- /dev/null
+++ b/package/microperl/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= microperl
+PKG_VERSION:= 5.8.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8d4aa4e061fd5bc0c39e4f0a63267880
+MASTER_SITES:= ftp://ftp.cpan.org/pub/CPAN/src/5.0/ \
+ ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0/ \
+ ftp://ftp.gmd.de/mirrors/CPAN/src/5.0/ \
+ ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0/
+DISTFILES:= perl-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/perl-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MICROPERL,microperl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" OPTIMIZE="${TCFLAGS}"
+MAKE_FILE:= Makefile.micro
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_MICROPERL}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/microperl ${IDIR_MICROPERL}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/microperl/ipkg/microperl.control b/package/microperl/ipkg/microperl.control
new file mode 100644
index 000000000..4e54b6326
--- /dev/null
+++ b/package/microperl/ipkg/microperl.control
@@ -0,0 +1,4 @@
+Package: microperl
+Priority: optional
+Section: net
+Description: Perl without operating-specific functions such as readdir.
diff --git a/package/mini_httpd/Config.in b/package/mini_httpd/Config.in
new file mode 100644
index 000000000..3922f14cd
--- /dev/null
+++ b/package/mini_httpd/Config.in
@@ -0,0 +1,66 @@
+config ADK_COMPILE_MINI_HTTPD
+ tristate
+ default n
+ depends ADK_PACKAGE_MINI_HTTPD || ADK_PACKAGE_MINI_HTTPD_OPENSSL
+
+config ADK_PACKAGE_MINI_HTTPD
+ prompt "mini-httpd........................ A small web server"
+ tristate
+ default n
+ select ADK_COMPILE_MINI_HTTPD
+ help
+ mini_httpd is a small HTTP server. Its performance is not great, but for
+ low or medium traffic sites it's quite adequate. It implements all the
+ basic features of an HTTP server, including:
+
+ * GET, HEAD, and POST methods.
+ * CGI.
+ * Basic authentication.
+ * Security against ".." filename snooping.
+ * The common MIME types.
+ * Trailing-slash redirection.
+ * index.html, index.htm, index.cgi
+ * Directory listings.
+ * Multihoming / virtual hosting.
+ * Standard logging.
+ * Custom error pages.
+
+ It can also be configured to do IPv6.
+
+ http://www.acme.com/software/mini_httpd/
+
+config ADK_PACKAGE_MINI_HTTPD_HTPASSWD
+ prompt "mini-httpd-htpasswd............... Utility to generate HTTP access files"
+ tristate
+ default n
+ select ADK_PACKAGE_MINI_HTTPD
+ help
+ This file generates .htaccess/.htpasswd files to use HTTP access authentication
+
+
+config ADK_PACKAGE_MINI_HTTPD_OPENSSL
+ prompt "mini-httpd-openssl................ A small web server, built with SSL support using OpenSSL"
+ tristate
+ default n
+ select ADK_COMPILE_MINI_HTTPD
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ mini_httpd is a small HTTP server. Its performance is not great, but for
+ low or medium traffic sites it's quite adequate. It implements all the
+ basic features of an HTTP server, including:
+
+ * GET, HEAD, and POST methods.
+ * CGI.
+ * Basic authentication.
+ * Security against ".." filename snooping.
+ * The common MIME types.
+ * Trailing-slash redirection.
+ * index.html, index.htm, index.cgi
+ * Directory listings.
+ * Multihoming / virtual hosting.
+ * Standard logging.
+ * Custom error pages.
+
+ It can also be configured to do SSL/HTTPS and IPv6.
+
+ http://www.acme.com/software/mini_httpd/
diff --git a/package/mini_httpd/Makefile b/package/mini_httpd/Makefile
new file mode 100644
index 000000000..5799b39f4
--- /dev/null
+++ b/package/mini_httpd/Makefile
@@ -0,0 +1,63 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mini-httpd
+PKG_VERSION:= 1.19
+PKG_RELEASE:= 10
+PKG_MD5SUM:= 7c68293ad265ecfe2edea917912f6f1f
+MASTER_SITES:= http://www.acme.com/software/mini_httpd/
+DISTFILES:= mini_httpd-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/mini_httpd-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MINI_HTTPD,mini-httpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,MINI_HTTPD_HTPASSWD,mini-httpd-htpasswd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,MINI_HTTPD_OPENSSL,mini-httpd-openssl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ # with OpenSSL
+ifneq (${ADK_PACKAGE_MINI_HTTPD_OPENSSL},)
+ ${MAKE} -C ${WRKBUILD} \
+ CC="${TARGET_CC}" \
+ SSL_DEFS="-DUSE_SSL -DHAVE_OPENSSL" \
+ SSL_INC="-I${STAGING_DIR}/usr/include" \
+ SSL_LIBS="-L${STAGING_DIR}/usr/lib -lssl -lcrypto" \
+ all
+ (cd ${WRKBUILD}; mv mini_httpd mini_httpd-openssl; )
+ ${MAKE} -C ${WRKBUILD} clean
+endif
+ # without SSL
+ifneq (${ADK_PACKAGE_MINI_HTTPD},)
+ ${MAKE} -C ${WRKBUILD} \
+ CC="${TARGET_CC}" \
+ all
+endif
+
+do-install:
+ # without SSL
+ifneq (${ADK_PACKAGE_MINI_HTTPD},)
+ ${INSTALL_DIR} ${IDIR_MINI_HTTPD}/etc/init.d
+ ${INSTALL_DATA} ./files/mini_httpd.conf ${IDIR_MINI_HTTPD}/etc/mini_httpd.conf
+ ${INSTALL_BIN} ./files/mini_httpd.init ${IDIR_MINI_HTTPD}/etc/init.d/mini_httpd
+ ${INSTALL_DIR} ${IDIR_MINI_HTTPD}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/mini_httpd ${IDIR_MINI_HTTPD}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_MINI_HTTPD_HTPASSWD}/usr/sbin
+ install -m0755 ${WRKBUILD}/htpasswd ${IDIR_MINI_HTTPD_HTPASSWD}/usr/sbin/
+endif
+ # with OpenSSL
+ifneq (${ADK_PACKAGE_MINI_HTTPD_OPENSSL},)
+ ${INSTALL_DIR} ${IDIR_MINI_HTTPD_OPENSSL}/etc/init.d
+ ${INSTALL_DATA} ./files/mini_httpd-ssl.conf ${IDIR_MINI_HTTPD_OPENSSL}/etc/mini_httpd.conf
+ install -m0600 ./files/mini_httpd.pem ${IDIR_MINI_HTTPD_OPENSSL}/etc/
+ ${INSTALL_BIN} ./files/mini_httpd.init \
+ ${IDIR_MINI_HTTPD_OPENSSL}/etc/init.d/mini_httpd
+ ${INSTALL_DIR} ${IDIR_MINI_HTTPD_OPENSSL}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/mini_httpd-openssl ${IDIR_MINI_HTTPD_OPENSSL}/usr/sbin/mini_httpd
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mini_httpd/files/mini_httpd-ssl.conf b/package/mini_httpd/files/mini_httpd-ssl.conf
new file mode 100644
index 000000000..5b616f6e5
--- /dev/null
+++ b/package/mini_httpd/files/mini_httpd-ssl.conf
@@ -0,0 +1,7 @@
+cgipat=cgi-bin/**|**.sh|**.cgi|**.pl
+dir=/www
+nochroot
+pidfile=/var/run/mini_httpd.pid
+user=root
+ssl
+certfile=/etc/mini_httpd.pem
diff --git a/package/mini_httpd/files/mini_httpd.conf b/package/mini_httpd/files/mini_httpd.conf
new file mode 100644
index 000000000..c075f7d80
--- /dev/null
+++ b/package/mini_httpd/files/mini_httpd.conf
@@ -0,0 +1,5 @@
+cgipat=cgi-bin/**|**.sh|**.cgi|**.pl
+dir=/www
+nochroot
+pidfile=/var/run/mini_httpd.pid
+user=root
diff --git a/package/mini_httpd/files/mini_httpd.init b/package/mini_httpd/files/mini_httpd.init
new file mode 100644
index 000000000..10479a22d
--- /dev/null
+++ b/package/mini_httpd/files/mini_httpd.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $mini_httpd_flags = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mini_httpd $mini_httpd_flags
+ ;;
+stop)
+ killall mini_httpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/mini_httpd/files/mini_httpd.pem b/package/mini_httpd/files/mini_httpd.pem
new file mode 100644
index 000000000..8a1241a76
--- /dev/null
+++ b/package/mini_httpd/files/mini_httpd.pem
@@ -0,0 +1,29 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQC5rFJOQakwMmF9aoVnAXaQLOOPoYOEk19/ls9VZt1ZqfzQuTbG
+GGrgMIDclB0kHMFvSbzeiVjMnrSdQTNe1gOQAGtHhHiqugrLqH9m3wqOerbf/Yir
+hic9U6X9RaWC6BzNgcYU1QtPn1sDtbMNFAB6jzF3W76EIlHEobgMtfqtxwIDAQAB
+AoGBAKJst9eToyDxgc1ICQlSA1kem7eDUF0C2xDvadLI2KxegzZIQD1NEPmsFJ5h
+x5hWu3TSabG3LwJZd6D1b63vxE6QRMhcDG3idb7kXzhOOZyfnlnrBtJ3VJC/UH5H
+O1pMMBxcu2fXrua+h7BW0gMoZhchvsArDoWaZPjNUNHiNRYBAkEA3Ngnge7njqlf
+/UlLkQHHfxgorQ78GjOzrrUvz86pFtW8RKCjAv55HIqAhWrSgxWF4yXkPO2XOHC9
+KTeVKccjAQJBANc63r3M3yP817cPzyo/8BJQD9nAzmolrsBf1YMxML20UmEbObax
+QdmxoYu/a8tOD4gT6EZDkauJU0yS69HGeMcCQQCvRmbkuuXQ1iC29+sfpVfeSSBP
+aaswaIRdTrQprA2LcAtCNHPsNmeM/WfPe96j5vsiMrqYmMECLIgVJGYgiEoBAkEA
+kzg1e+ZTC667bwBlWCT79crFzNDRYFH+QqBKz74p9NkPMFULGSgOPvX95jU9aocu
+oInda5J0Zb09OTeWDpuPqQJAUIeY36WUst7NaW40mZXkMjjR2QtWi7P4cmv7nLp0
+WdPQzkUW1Bv4sSUQ7svQqpmZPaFiyhXL1VSa1M5MPd3tbA==
+-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIICOTCCAaKgAwIBAgIJANRuTbnzy8ObMA0GCSqGSIb3DQEBBAUAMFMxCzAJBgNV
+BAYTAkZSMQ4wDAYDVQQIEwVQYXJpczEOMAwGA1UEBxMFUGFyaXMxEDAOBgNVBAoT
+B015IEhvbWUxEjAQBgNVBAMTCU15IFJvdXRlcjAeFw0wNTAxMTQwMjQzMjdaFw0w
+NjAxMTQwMjQzMjdaMFMxCzAJBgNVBAYTAkZSMQ4wDAYDVQQIEwVQYXJpczEOMAwG
+A1UEBxMFUGFyaXMxEDAOBgNVBAoTB015IEhvbWUxEjAQBgNVBAMTCU15IFJvdXRl
+cjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuaxSTkGpMDJhfWqFZwF2kCzj
+j6GDhJNff5bPVWbdWan80Lk2xhhq4DCA3JQdJBzBb0m83olYzJ60nUEzXtYDkABr
+R4R4qroKy6h/Zt8Kjnq23/2Iq4YnPVOl/UWlgugczYHGFNULT59bA7WzDRQAeo8x
+d1u+hCJRxKG4DLX6rccCAwEAAaMVMBMwEQYJYIZIAYb4QgEBBAQDAgZAMA0GCSqG
+SIb3DQEBBAUAA4GBAErI3QmcZVzjxKcoPTO3z8cRJV87SVFp0qbIjbYCBDUWB1QY
+/bMkQPr2zJyfJmUYLEs4iKgHrmlaUCMHy9NZKOg9ZxrW42BtQ5QnOtDm3UifwzJW
+oCFC3uPWfTYsZn/FrUXlErds+xXXT63VJzBe6DdXwHcdcdxzl05oIyL9JIzI
+-----END CERTIFICATE-----
diff --git a/package/mini_httpd/ipkg/mini-httpd-htpasswd.control b/package/mini_httpd/ipkg/mini-httpd-htpasswd.control
new file mode 100644
index 000000000..6b80aa6d9
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd-htpasswd.control
@@ -0,0 +1,4 @@
+Package: mini-httpd-htpasswd
+Priority: optional
+Section: net
+Description: utility to generate HTTP access authentication files
diff --git a/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles b/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles
new file mode 100644
index 000000000..38239e4e3
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd-matrixssl.conffiles
@@ -0,0 +1,2 @@
+/etc/mini_httpd.conf
+/etc/mini_httpd.pem
diff --git a/package/mini_httpd/ipkg/mini-httpd-matrixssl.control b/package/mini_httpd/ipkg/mini-httpd-matrixssl.control
new file mode 100644
index 000000000..5967ac7fb
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd-matrixssl.control
@@ -0,0 +1,5 @@
+Package: mini-httpd-matrixssl
+Priority: optional
+Section: net
+Description: A small HTTP server, built with SSL support using MatrixSSL.
+Depends: libmatrixssl
diff --git a/package/mini_httpd/ipkg/mini-httpd-matrixssl.postinst b/package/mini_httpd/ipkg/mini-httpd-matrixssl.postinst
new file mode 100644
index 000000000..dfcafaa9e
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd-matrixssl.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf '"NO" to disable, "-C /etc/mini_httpd.conf" otherwise' mini_httpd_flags
diff --git a/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles b/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles
new file mode 100644
index 000000000..38239e4e3
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd-openssl.conffiles
@@ -0,0 +1,2 @@
+/etc/mini_httpd.conf
+/etc/mini_httpd.pem
diff --git a/package/mini_httpd/ipkg/mini-httpd-openssl.control b/package/mini_httpd/ipkg/mini-httpd-openssl.control
new file mode 100644
index 000000000..09bfb6682
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd-openssl.control
@@ -0,0 +1,5 @@
+Package: mini-httpd-openssl
+Priority: optional
+Section: net
+Description: A small HTTP server, built with SSL support using OpenSSL.
+Depends: libopenssl
diff --git a/package/mini_httpd/ipkg/mini-httpd-openssl.postinst b/package/mini_httpd/ipkg/mini-httpd-openssl.postinst
new file mode 100644
index 000000000..dfcafaa9e
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd-openssl.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf '"NO" to disable, "-C /etc/mini_httpd.conf" otherwise' mini_httpd_flags
diff --git a/package/mini_httpd/ipkg/mini-httpd.conffiles b/package/mini_httpd/ipkg/mini-httpd.conffiles
new file mode 100644
index 000000000..1bf5a5e26
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd.conffiles
@@ -0,0 +1 @@
+/etc/mini_httpd.conf
diff --git a/package/mini_httpd/ipkg/mini-httpd.control b/package/mini_httpd/ipkg/mini-httpd.control
new file mode 100644
index 000000000..6466feed2
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd.control
@@ -0,0 +1,5 @@
+Package: mini-httpd
+Priority: optional
+Section: net
+Description: A small HTTP server, built with SSL support using MatrixSSL.
+Depends: libmatrixssl
diff --git a/package/mini_httpd/ipkg/mini-httpd.postinst b/package/mini_httpd/ipkg/mini-httpd.postinst
new file mode 100644
index 000000000..dfcafaa9e
--- /dev/null
+++ b/package/mini_httpd/ipkg/mini-httpd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf '"NO" to disable, "-C /etc/mini_httpd.conf" otherwise' mini_httpd_flags
diff --git a/package/mini_httpd/patches/patch-Makefile b/package/mini_httpd/patches/patch-Makefile
new file mode 100644
index 000000000..5a574b21c
--- /dev/null
+++ b/package/mini_httpd/patches/patch-Makefile
@@ -0,0 +1,78 @@
+$Id$
+--- mini_httpd-1.19.orig/Makefile 2002-11-01 23:02:57.000000000 +0000
++++ mini_httpd-1.19/Makefile 2007-03-20 13:35:49.000000000 +0000
+@@ -14,30 +14,44 @@ CRYPT_LIB = -lcrypt
+ # http://www.openssl.org/ Make sure the SSL_TREE definition points to the
+ # tree with your OpenSSL installation - depending on how you installed it,
+ # it may be in /usr/local instead of /usr/local/ssl.
++
++# OpenSSL
+ #SSL_TREE = /usr/local/ssl
+ #SSL_DEFS = -DUSE_SSL
+ #SSL_INC = -I${SSL_TREE}/include
+ #SSL_LIBS = -L${SSL_TREE}/lib -lssl -lcrypto
++#SSL_OBJS =
+
++# MatrixSSL
++#SSL_TREE =
++#SSL_DEFS = -DUSE_SSL -DHAVE_MATRIXSSL
++#SSL_INC =
++#SSL_LIBS = -lmatrixssl
++#SSL_OBJS = matrixssl_helper.o
+
+-BINDIR = /usr/local/sbin
+-MANDIR = /usr/local/man
+-CC = gcc
++
++DESTDIR =
++
++BINDIR = $(DESTDIR)/usr/sbin
++MANDIR = $(DESTDIR)/usr/share/man
++CC ?= gcc
+ CDEFS = ${SSL_DEFS} ${SSL_INC}
+-CFLAGS = -O ${CDEFS}
+-#CFLAGS = -g ${CDEFS}
+-LDFLAGS = -s
++CFLAGS += ${CDEFS}
++LDFLAGS ?=
+ #LDFLAGS = -g
+ LDLIBS = ${SSL_LIBS} ${SYSV_LIBS} ${CRYPT_LIB}
+
+ all: mini_httpd htpasswd
+
+-mini_httpd: mini_httpd.o match.o tdate_parse.o
+- ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${LDLIBS} -o mini_httpd
++mini_httpd: mini_httpd.o match.o tdate_parse.o ${SSL_OBJS}
++ ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ${LDLIBS} -o mini_httpd
+
+ mini_httpd.o: mini_httpd.c version.h port.h match.h tdate_parse.h mime_encodings.h mime_types.h
+ ${CC} ${CFLAGS} -c mini_httpd.c
+
++matrixssl_helper.o: matrixssl_helper.c
++ ${CC} ${CFLAGS} -c matrixssl_helper.c
++
+ match.o: match.c match.h
+ ${CC} ${CFLAGS} -c match.c
+
+@@ -71,16 +85,18 @@ mini_httpd.pem: mini_httpd.cnf
+ chmod 600 mini_httpd.pem
+
+
+-install: all
+- rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd
++install: all uninstall
+ -mkdir -p ${BINDIR}
+ cp mini_httpd htpasswd ${BINDIR}
+- rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1
+ -mkdir -p ${MANDIR}/man8
+ cp mini_httpd.8 ${MANDIR}/man8
+ -mkdir -p ${MANDIR}/man1
+ cp htpasswd.1 ${MANDIR}/man1
+
++uninstall:
++ rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd
++ rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1
++
+ clean:
+ rm -f mini_httpd mime_encodings.h mime_types.h htpasswd mini_httpd.rnd *.o core core.* *.core
+
diff --git a/package/mini_httpd/patches/patch-mini_httpd_c b/package/mini_httpd/patches/patch-mini_httpd_c
new file mode 100644
index 000000000..b1b3414d3
--- /dev/null
+++ b/package/mini_httpd/patches/patch-mini_httpd_c
@@ -0,0 +1,96 @@
+$Id$
+--- mini_httpd-1.19.orig/mini_httpd.c 2005-06-29 19:31:17.000000000 +0200
++++ mini_httpd-1.19/mini_httpd.c 2007-01-20 19:48:49.000000000 +0100
+@@ -66,8 +66,14 @@
+ #endif /* HAVE_SENDFILE */
+
+ #ifdef USE_SSL
++# ifdef HAVE_OPENSSL
+ #include <openssl/ssl.h>
+ #include <openssl/err.h>
++# else /* HAVE_OPENSSL */
++# ifdef HAVE_MATRIXSSL
++# include "matrixssl_helper.h"
++# endif /* HAVE_MATRIXSSL */
++# endif /* HAVE_OPENSSL */
+ #endif /* USE_SSL */
+
+ extern char* crypt( const char* key, const char* setting );
+@@ -132,10 +138,10 @@ typedef long long int64_t;
+ #define CGI_NICE 10
+ #endif /* CGI_NICE */
+ #ifndef CGI_PATH
+-#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin"
++#define CGI_PATH "/usr/bin:/bin:/usr/sbin:/sbin"
+ #endif /* CGI_PATH */
+ #ifndef CGI_LD_LIBRARY_PATH
+-#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib"
++#define CGI_LD_LIBRARY_PATH "/usr/lib:/lib"
+ #endif /* CGI_LD_LIBRARY_PATH */
+ #ifndef AUTH_FILE
+ #define AUTH_FILE ".htpasswd"
+@@ -193,7 +199,13 @@ static int listen4_fd, listen6_fd;
+ static int do_ssl;
+ static char* certfile;
+ static char* cipher;
++#ifdef HAVE_OPENSSL
+ static SSL_CTX* ssl_ctx;
++#else /* HAVE_OPENSSL */
++ #ifdef HAVE_MATRIXSSL
++static sslKeys_t* keys;
++ #endif /* HAVE_MATRIXSSL */
++#endif /* HAVE_OPENSSL */
+ #endif /* USE_SSL */
+ static char cwd[MAXPATHLEN];
+ static int got_hup;
+@@ -540,6 +552,7 @@ main( int argc, char** argv )
+ #ifdef USE_SSL
+ if ( do_ssl )
+ {
++# ifdef HAVE_OPENSSL
+ SSL_load_error_strings();
+ SSLeay_add_ssl_algorithms();
+ ssl_ctx = SSL_CTX_new( SSLv23_server_method() );
+@@ -559,6 +572,17 @@ main( int argc, char** argv )
+ exit( 1 );
+ }
+ }
++# else /* HAVE_OPENSSL */
++# ifdef HAVE_MATRIXSSL
++ matrixSslOpen();
++ if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL ) < 0 )
++ {
++ syslog( LOG_CRIT, "can't load certificate and/or private key\n");
++ (void) fprintf( stderr, "%s: can't load certificate and/or private key\n", argv0 );
++ exit( 1 );
++ }
++# endif /* HAVE_MATRIXSSL */
++# endif /* HAVE_OPENSSL */
+ }
+ #endif /* USE_SSL */
+
+@@ -1174,6 +1198,7 @@ handle_request( void )
+ #ifdef USE_SSL
+ if ( do_ssl )
+ {
++# ifdef HAVE_OPENSSL
+ ssl = SSL_new( ssl_ctx );
+ SSL_set_fd( ssl, conn_fd );
+ if ( SSL_accept( ssl ) == 0 )
+@@ -1181,6 +1206,16 @@ handle_request( void )
+ ERR_print_errors_fp( stderr );
+ exit( 1 );
+ }
++# else /* HAVE_OPENSSL */
++# ifdef HAVE_MATRIXSSL
++ ssl = SSL_new(keys);
++ SSL_set_fd( ssl, conn_fd );
++ if ( SSL_accept( ssl ) <= 0 )
++ {
++ perror( "SSL_accept" );
++ }
++# endif /* HAVE_MATRIXSSL */
++# endif /* HAVE_OPENSSL */
+ }
+ #endif /* USE_SSL */
+
diff --git a/package/mini_sendmail/Config.in b/package/mini_sendmail/Config.in
new file mode 100644
index 000000000..70d2218d0
--- /dev/null
+++ b/package/mini_sendmail/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_MINI_SENDMAIL
+ prompt "mini-sendmail..................... A small sendmail-compatible mail forwarder"
+ tristate
+ default n
+ help
+ mini_sendmail reads its standard input up to an end-of-file and sends a
+ copy of the message found there to all of the addresses listed.
+ The message is sent by connecting to a local SMTP server. This means
+ mini_sendmail can be used to send email from inside a chroot(2) area.
+
+ http://www.acme.com/software/mini_sendmail/
+
diff --git a/package/mini_sendmail/Makefile b/package/mini_sendmail/Makefile
new file mode 100644
index 000000000..0187ab4f8
--- /dev/null
+++ b/package/mini_sendmail/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mini-sendmail
+PKG_VERSION:= 1.3.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= fb1585d2ad81c519a26d83bfd783dee8
+MASTER_SITES:= http://www.acme.com/software/mini_sendmail/
+DISTFILES:= mini_sendmail-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/mini_sendmail-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MINI_SENDMAIL,mini-sendmail,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= OFLAGS="${TARGET_CFLAGS}"
+MAKE_FLAGS+= CC="${TARGET_CC}"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_MINI_SENDMAIL}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/mini_sendmail ${IDIR_MINI_SENDMAIL}/usr/sbin/
+ ln -sf mini_sendmail ${IDIR_MINI_SENDMAIL}/usr/sbin/sendmail
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mini_sendmail/ipkg/mini-sendmail.control b/package/mini_sendmail/ipkg/mini-sendmail.control
new file mode 100644
index 000000000..c08e16e1c
--- /dev/null
+++ b/package/mini_sendmail/ipkg/mini-sendmail.control
@@ -0,0 +1,4 @@
+Package: mini-sendmail
+Priority: optional
+Section: net
+Description: A small sendmail-compatible mail forwarder
diff --git a/package/mini_sendmail/patches/500-flags.patch b/package/mini_sendmail/patches/500-flags.patch
new file mode 100644
index 000000000..eb5d65a1a
--- /dev/null
+++ b/package/mini_sendmail/patches/500-flags.patch
@@ -0,0 +1,15 @@
+--- mini_sendmail-1.3.5/Makefile.orig 2002-01-04 07:05:25.000000000 +0100
++++ mini_sendmail-1.3.5/Makefile 2005-06-17 01:57:06.000000000 +0200
+@@ -7,9 +7,10 @@
+ BINDIR = /usr/local/sbin
+ MANDIR = /usr/local/man
+ CC = gcc
+-CFLAGS = -O
++OFLAGS = -O
++CFLAGS = $(OFLAGS)
+ #CFLAGS = -g
+-LDFLAGS = -s -static
++LDFLAGS =
+ #LDFLAGS = -g -static
+ LDLIBS = $(SYSV_LIBS)
+
diff --git a/package/miredo/Config.in b/package/miredo/Config.in
new file mode 100644
index 000000000..928e06c5d
--- /dev/null
+++ b/package/miredo/Config.in
@@ -0,0 +1,35 @@
+config ADK_COMPILE_MIREDO
+ tristate
+ default n
+ depends on ADK_CXX
+ depends on ADK_IPV6
+ depends ADK_PACKAGE_MIREDO || ADK_PACKAGE_MIREDO_SERVER
+
+config ADK_PACKAGE_MIREDO
+ prompt "miredo............................ Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon"
+ tristate
+ default n
+ depends ADK_IPV6
+ depends on ADK_CXX
+ select ADK_COMPILE_MIREDO
+ select ADK_KPACKAGE_KMOD_IPV6
+ select ADK_KPACKAGE_KMOD_TUN
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ A Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon.
+ http://www.simphalempin.com/dev/miredo/
+
+config ADK_PACKAGE_MIREDO_SERVER
+ prompt "miredo-server..................... Teredo (IPv6 tunneling over UDP through NAT) server daemon"
+ tristate
+ default n
+ depends ADK_IPV6
+ depends on ADK_CXX
+ select ADK_COMPILE_MIREDO
+ select ADK_KPACKAGE_KMOD_IPV6
+ select ADK_KPACKAGE_KMOD_TUN
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ A Teredo (IPv6 tunneling over UDP through NAT) server daemon.
+
+ http://www.simphalempin.com/dev/miredo/
diff --git a/package/miredo/Makefile b/package/miredo/Makefile
new file mode 100644
index 000000000..3bdcb3113
--- /dev/null
+++ b/package/miredo/Makefile
@@ -0,0 +1,55 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= miredo
+PKG_VERSION:= 1.1.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= bf49c1ddc068746760787d0cf76e40de
+MASTER_SITES:= http://www.remlab.net/files/miredo/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MIREDO,miredo,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,MIREDO_SERVER,miredo-server,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --disable-chroot \
+ --without-Judy \
+ --enable-teredo-client \
+ --enable-teredo-relay \
+ --enable-teredo-server \
+ --enable-miredo-user=root
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+ CXXLINK="\$${LINK}" \
+
+ifeq ($(ADK_TARGET_LIB_UCLIBCXX),y)
+TCXXFLAGS+= -fno-builtin -fno-rtti -nostdinc++
+TLDFLAGS+= -nodefaultlibs
+CONFIGURE_ENV+= LIBS="-luClibc++ -lc -lm" \
+ ac_cv_file__proc_self_maps=yes
+else
+CONFIGURE_ENV+= LIBS="-lc -lm" \
+ ac_cv_file__proc_self_maps=yes
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MIREDO}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_MIREDO}/etc/miredo
+ ${INSTALL_DIR} ${IDIR_MIREDO}/usr/sbin
+ ${INSTALL_DATA} ${WRKINST}/etc/miredo/miredo.conf ${IDIR_MIREDO}/etc/miredo/miredo.conf
+ ${INSTALL_BIN} ./files/miredo.init \
+ ${IDIR_MIREDO}/etc/init.d/miredo
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/miredo ${IDIR_MIREDO}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_MIREDO_SERVER}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_MIREDO_SERVER}/etc/init.d
+ ${INSTALL_BIN} ./files/miredo-server.init \
+ ${IDIR_MIREDO_SERVER}/etc/init.d/miredo-server
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/miredo-server ${IDIR_MIREDO_SERVER}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/miredo/files/miredo-server.init b/package/miredo/files/miredo-server.init
new file mode 100644
index 000000000..d8282e316
--- /dev/null
+++ b/package/miredo/files/miredo-server.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${miredo-server:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ miredo-server
+ ;;
+stop)
+ killall miredo-server
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/miredo/files/miredo.init b/package/miredo/files/miredo.init
new file mode 100644
index 000000000..bb4b3fdcd
--- /dev/null
+++ b/package/miredo/files/miredo.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${miredo:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ miredo
+ ;;
+stop)
+ killall miredo
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/miredo/ipkg/miredo-server.control b/package/miredo/ipkg/miredo-server.control
new file mode 100644
index 000000000..ebbc3cc58
--- /dev/null
+++ b/package/miredo/ipkg/miredo-server.control
@@ -0,0 +1,5 @@
+Package: miredo-server
+Priority: optional
+Section: net
+Depends: kmod-ipv6, kmod-tun, libpthread, uclibc++
+Description: A Teredo (IPv6 tunneling over UDP through NAT) server daemon
diff --git a/package/miredo/ipkg/miredo-server.postinst b/package/miredo/ipkg/miredo-server.postinst
new file mode 100644
index 000000000..00c88c459
--- /dev/null
+++ b/package/miredo/ipkg/miredo-server.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf miredo-server miredo-server NO
diff --git a/package/miredo/ipkg/miredo.conffiles b/package/miredo/ipkg/miredo.conffiles
new file mode 100644
index 000000000..f4d3b04af
--- /dev/null
+++ b/package/miredo/ipkg/miredo.conffiles
@@ -0,0 +1 @@
+/etc/miredo/miredo.conf
diff --git a/package/miredo/ipkg/miredo.control b/package/miredo/ipkg/miredo.control
new file mode 100644
index 000000000..2794f3bde
--- /dev/null
+++ b/package/miredo/ipkg/miredo.control
@@ -0,0 +1,5 @@
+Package: miredo
+Priority: optional
+Section: net
+Depends: kmod-ipv6, kmod-tun, libpthread, uclibc++
+Description: A Teredo (IPv6 tunneling over UDP through NAT) client and relay daemon
diff --git a/package/miredo/ipkg/miredo.postinst b/package/miredo/ipkg/miredo.postinst
new file mode 100644
index 000000000..37667f8da
--- /dev/null
+++ b/package/miredo/ipkg/miredo.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf miredo miredo NO
diff --git a/package/miredo/patches/patch-libteredo_maintain_c b/package/miredo/patches/patch-libteredo_maintain_c
new file mode 100644
index 000000000..a98fba00b
--- /dev/null
+++ b/package/miredo/patches/patch-libteredo_maintain_c
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- miredo-1.1.6.orig/libteredo/maintain.c 2009-04-13 11:15:15.000000000 +0200
++++ miredo-1.1.6/libteredo/maintain.c 2009-05-10 18:21:51.000000000 +0200
+@@ -56,6 +56,7 @@
+ #include "maintain.h"
+ #include "v4global.h" // is_ipv4_global_unicast()
+ #include "debug.h"
++#define pthread_condattr_setclock( a, c ) (((c) != CLOCK_REALTIME) ? EINVAL : 0)
+
+ static inline void gettime (struct timespec *now)
+ {
+@@ -63,7 +64,6 @@ static inline void gettime (struct times
+ if (clock_gettime (CLOCK_MONOTONIC, now) == 0)
+ return;
+ #else
+-# define pthread_condattr_setclock( a, c ) (((c) != CLOCK_REALTIME) ? EINVAL : 0)
+ # ifndef CLOCK_MONOTONIC
+ # define CLOCK_MONOTONIC CLOCK_REALTIME
+ # endif
diff --git a/package/mksh/Config.in b/package/mksh/Config.in
new file mode 100644
index 000000000..39f792af3
--- /dev/null
+++ b/package/mksh/Config.in
@@ -0,0 +1,31 @@
+config ADK_PACKAGE_MKSH
+ prompt "mksh................................. The MirBSD enhanced Korn Shell"
+ tristate
+ default n
+ help
+ mksh is the MirBSD enhanced version of the Public Domain Korn
+ shell (pdksh), a bourne-compatible shell which is largely si-
+ milar to the original AT&T Korn shell. It includes bug fixes
+ and feature improvements in order to produce a modern, robust
+ shell good for interactive and especially script use. It has
+ UTF-8 support in the emacs command line editing mode; corres-
+ ponds to OpenBSD 4.4-beta ksh without GNU bash-like $PS1; the
+ build environment requirements are autoconfigured; throughout
+ code simplification/bugfix/enhancement has been done, and the
+ shell has extended compatibility to other modern shells.
+
+ This package also installs mksh as /bin/ash and /bin/sh (i.e.
+ the default Bourne/POSIX shell) and creates a ~/.mkshrc file,
+ which can be used to further customise the look and feel.
+
+ http://mirbsd.de/mksh
+
+config ADK_PACKAGE_MKSH_FULL
+ bool " Include all features"
+ depends ADK_PACKAGE_MKSH
+ default y
+ help
+ Disable this to remove a few functions from mksh to make it smaller.
+ Ideal for embedded systems. However, be aware you will lose some
+ functionality you'd otherwise expect, among these is the vi command
+ line editing mode.
diff --git a/package/mksh/Makefile b/package/mksh/Makefile
new file mode 100644
index 000000000..03a47b8c4
--- /dev/null
+++ b/package/mksh/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= mksh
+PKG_VERSION= 35b
+PKG_RELEASE= 2
+DISTFILES= ${PKG_NAME}-R${PKG_VERSION}.cpio.gz
+PKG_MD5SUM= 0e96cd3f8141b7abc679bbb303a8be2c
+MASTER_SITES= ${MASTER_SITE_MIRBSD:distfiles/=dist/mir/mksh/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MKSH,mksh,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifeq ($(strip ${ADK_PACKAGE_MKSH_FULL}),)
+TCPPFLAGS+= -DMKSH_SMALL=1
+endif
+
+do-build:
+ cd ${WRKBUILD} && CC='${TARGET_CC}' CFLAGS='${TCFLAGS}' \
+ CPPFLAGS='${TCPPFLAGS}' LDFLAGS='${TLDFLAGS}' \
+ TARGET_OS=${UNAME_S} ${BASH} ${WRKSRC}/Build.sh -Q -r
+
+do-install:
+ install -d -m 0755 ${IDIR_MKSH}/bin
+ install -c -m 755 ${WRKBUILD}/mksh ${IDIR_MKSH}/bin/
+ install -c -m 644 ${WRKSRC}/dot.mkshrc ${IDIR_MKSH}/.mkshrc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mksh/ipkg/mksh.conffiles b/package/mksh/ipkg/mksh.conffiles
new file mode 100644
index 000000000..f139f0b55
--- /dev/null
+++ b/package/mksh/ipkg/mksh.conffiles
@@ -0,0 +1 @@
+/.mkshrc
diff --git a/package/mksh/ipkg/mksh.control b/package/mksh/ipkg/mksh.control
new file mode 100644
index 000000000..40c076116
--- /dev/null
+++ b/package/mksh/ipkg/mksh.control
@@ -0,0 +1,4 @@
+Package: mksh
+Priority: optional
+Section: misc
+Description: MirBSD enhanced version of the Korn Shell
diff --git a/package/mksh/patches/patch-dot_mkshrc b/package/mksh/patches/patch-dot_mkshrc
new file mode 100644
index 000000000..13093bb79
--- /dev/null
+++ b/package/mksh/patches/patch-dot_mkshrc
@@ -0,0 +1,36 @@
+$Id$
+
+ • OpenADK patches:
+ – no hostname(1)
+ – ls has no -o
+ – yofuh doesn’t like $? in $PS1
+
+--- mksh.orig/dot.mkshrc Sat May 17 18:27:55 2008
++++ mksh/dot.mkshrc Mon Jul 21 21:02:05 2008
+@@ -2,13 +2,15 @@
+ #-
+ # ~/.mkshrc: mksh initialisation file for interactive shells
+
+-: ${EDITOR:=/bin/ed} ${TERM:=vt100} ${HOSTNAME:=$(ulimit -c 0;hostname -s 2>&-)}
++: ${EDITOR:=/bin/ed} ${TERM:=vt100} ${HOSTNAME:=$(</proc/sys/kernel/hostname)}
+ [[ $HOSTNAME = @(localhost|*([ ])) ]] && HOSTNAME=$(ulimit -c 0;hostname 2>&-)
+ : ${HOSTNAME:=nil}; if (( USER_ID )); then PS1='$'; else PS1='#'; fi
+ function precmd {
+ typeset -i e=$?
+
+- (( e )) && print -n "$e|"
++# enable this back if you want the errorlevel in your prompt
++# this is default in upstream mksh, disabled locally in fwrt
++# (( e )) && print -n "$e|"
+ }
+ PS1='$(precmd)${USER:=$(ulimit -c 0;id -un 2>&- || print \?)}@${HOSTNAME%%.*}:$(
+ typeset pfx=~ wd=${PWD:-?}
+@@ -30,7 +32,7 @@ unalias ls
+ alias l='ls -F'
+ alias la='l -a'
+ alias ll='l -l'
+-alias lo='l -alo'
++alias lo='l -al'
+ alias which='whence -p'
+ whence -p rot13 >&- || alias rot13='tr \
+ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \
diff --git a/package/moc/Config.in b/package/moc/Config.in
new file mode 100644
index 000000000..958ba69a5
--- /dev/null
+++ b/package/moc/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_MOC
+ tristate "moc................................ console audio player"
+ default n
+ select ADK_PACKAGE_LIBVORBIS
+ select ADK_PACKAGE_LIBMAD
+ select ADK_PACKAGE_LIBCURL
+ select ADK_PACKAGE_LIBFLAC
+ select ADK_PACKAGE_FFMPEG
+ help
+ console audio player
+ Supports mp3, ogg, wav, mp4, flac and stream audio formats.
+ http://moc.daper.net/
+
diff --git a/package/moc/Makefile b/package/moc/Makefile
new file mode 100644
index 000000000..9cdfa2416
--- /dev/null
+++ b/package/moc/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= moc
+PKG_VERSION:= 2.4.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 647c770a5542a4ae5437386807a89796
+MASTER_SITES:= ftp://ftp.daper.net/pub/soft/moc/stable/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MOC,moc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-jack \
+ --without-oss \
+ --without-musepack \
+ --without-speex \
+ --without-sndfile
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MOC}/usr/bin
+ ${INSTALL_DIR} ${IDIR_MOC}/usr/lib/moc/decoder_plugins
+ ${CP} ${WRKINST}/usr/lib/moc/decoder_plugins/*.so \
+ ${IDIR_MOC}/usr/lib/moc/decoder_plugins
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/mocp ${IDIR_MOC}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/moc/ipkg/moc.control b/package/moc/ipkg/moc.control
new file mode 100644
index 000000000..dc0040ef5
--- /dev/null
+++ b/package/moc/ipkg/moc.control
@@ -0,0 +1,5 @@
+Package: moc
+Priority: optional
+Section: sound
+Depends: libmad, libvorbis, libcurl, libflac, ffmpeg
+Description: console music player
diff --git a/package/monit/Config.in b/package/monit/Config.in
new file mode 100644
index 000000000..b8d1eec59
--- /dev/null
+++ b/package/monit/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_MONIT
+ prompt "monit............................. System services monitoring utility"
+ tristate
+ select ADK_PACKAGE_LIBPTHREAD
+ default n
+ help
+ An utility for monitoring services on a Unix system
+ http://www.tildeslash.com/monit/
+
+config ADK_COMPILE_MONIT_WITH_SSL
+ prompt "Compile with SSL support"
+ tristate
+ select ADK_PACKAGE_LIBOPENSSL
+ depends on ADK_PACKAGE_MONIT
+ default n
+ help
+ Enable SSL
diff --git a/package/monit/Makefile b/package/monit/Makefile
new file mode 100644
index 000000000..7b41c5367
--- /dev/null
+++ b/package/monit/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= monit
+PKG_VERSION:= 4.10.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d3143b0bbd79b53f1b019d2fc1dae656
+MASTER_SITES:= http://www.tildeslash.com/monit/dist/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MONIT,monit,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+PKG_DEPENDS:= libpthread,
+
+ifeq ($(ADK_COMPILE_MONIT_WITH_SSL),y)
+PKG_DEPENDS+= libopenssl
+CONFIGURE_ARGS+= --with-ssl --with-ssl-dir="${STAGING_DIR}/usr"
+else
+CONFIGURE_ARGS+= --without-ssl
+endif
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MONIT}/etc
+ install -m0600 ${WRKBUILD}/monitrc ${IDIR_MONIT}/etc/
+ ${INSTALL_DIR} ${IDIR_MONIT}/etc/init.d
+ ${INSTALL_BIN} ./files/monit.init ${IDIR_MONIT}/etc/init.d/monit
+ ${INSTALL_DIR} ${IDIR_MONIT}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/monit ${IDIR_MONIT}/usr/sbin/monit
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_MONIT}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/monit/files/monit.init b/package/monit/files/monit.init
new file mode 100644
index 000000000..fd552b95e
--- /dev/null
+++ b/package/monit/files/monit.init
@@ -0,0 +1,20 @@
+#!/bin/sh
+#FWINIT 10
+
+case $1 in
+autostop) ;;
+autostart|start)
+ monit $monit_flags
+ ;;
+stop)
+ killall monit
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 (start|stop|restart)"
+ exit 1
+esac
+exit $?
diff --git a/package/monit/ipkg/monit-nossl.conffiles b/package/monit/ipkg/monit-nossl.conffiles
new file mode 100644
index 000000000..365679c6e
--- /dev/null
+++ b/package/monit/ipkg/monit-nossl.conffiles
@@ -0,0 +1 @@
+/etc/monitrc
diff --git a/package/monit/ipkg/monit-nossl.control b/package/monit/ipkg/monit-nossl.control
new file mode 100644
index 000000000..d10b711da
--- /dev/null
+++ b/package/monit/ipkg/monit-nossl.control
@@ -0,0 +1,5 @@
+Package: monit-nossl
+Priority: optional
+Section: admin
+Description: An utility for system services monitoring, without SSL support.
+Depends: libpthread
diff --git a/package/monit/ipkg/monit.conffiles b/package/monit/ipkg/monit.conffiles
new file mode 100644
index 000000000..365679c6e
--- /dev/null
+++ b/package/monit/ipkg/monit.conffiles
@@ -0,0 +1 @@
+/etc/monitrc
diff --git a/package/monit/ipkg/monit.control b/package/monit/ipkg/monit.control
new file mode 100644
index 000000000..0c564a675
--- /dev/null
+++ b/package/monit/ipkg/monit.control
@@ -0,0 +1,4 @@
+Package: monit
+Priority: optional
+Section: admin
+Description: An utility for system services monitoring.
diff --git a/package/motion/Config.in b/package/motion/Config.in
new file mode 100644
index 000000000..3b3861036
--- /dev/null
+++ b/package/motion/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_MOTION
+ prompt "motion............................ webcam motion sensing and logging"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBJPEG
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ Motion is a software motion detector
+
+ http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
diff --git a/package/motion/Makefile b/package/motion/Makefile
new file mode 100644
index 000000000..302cb8a84
--- /dev/null
+++ b/package/motion/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= motion
+PKG_VERSION:= 3.2.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 71e6bd13fcca70372e9b7c7806d62b30
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=motion/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MOTION,motion,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-ffmpeg \
+ --without-jpeg-mmx \
+ --without-mysql \
+ --without-pgsql
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MOTION}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/motion ${IDIR_MOTION}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/motion/ipkg/motion.control b/package/motion/ipkg/motion.control
new file mode 100644
index 000000000..44a0c2b91
--- /dev/null
+++ b/package/motion/ipkg/motion.control
@@ -0,0 +1,5 @@
+Package: motion
+Priority: optional
+Section: multimedia
+Depends: libjpeg, libpthread
+Description: Webcam motion sensing and logging
diff --git a/package/motion/patches/01-ffmpeg.patch b/package/motion/patches/01-ffmpeg.patch
new file mode 100644
index 000000000..1f4c73eaf
--- /dev/null
+++ b/package/motion/patches/01-ffmpeg.patch
@@ -0,0 +1,38 @@
+diff -ur motion-3.2.5.1-old/motion.c motion-3.2.5.1/motion.c
+--- motion-3.2.5.1-old/motion.c 2006-03-17 10:05:13.490000000 -0800
++++ motion-3.2.5.1/motion.c 2006-03-17 10:03:38.020000000 -0800
+@@ -1246,10 +1246,10 @@
+ * Note: Negative value means SIGALRM snaps are enabled
+ * httpd-control snaps are always enabled.
+ */
+-
++#ifdef HAVE_FFMPEG
+ /* time_current_frame is used both for snapshot and timelapse features */
+ time_current_frame = cnt->currenttime;
+-
++
+ if ( (cnt->conf.snapshot_interval > 0 && cnt->shots == 0 &&
+ time_current_frame % cnt->conf.snapshot_interval <= time_last_frame % cnt->conf.snapshot_interval) ||
+ cnt->snapshot) {
+@@ -1257,7 +1257,7 @@
+ cnt->snapshot = 0;
+ }
+
+-
++#endif /* HAVE_FFMPEG */
+ /***** MOTION LOOP - TIMELAPSE FEATURE SECTION *****/
+
+ #ifdef HAVE_FFMPEG
+@@ -1331,10 +1331,9 @@
+ event(cnt, EVENT_TIMELAPSEEND, NULL, NULL, NULL, cnt->currenttime_tm);
+
+
+-#endif /* HAVE_FFMPEG */
+
+ time_last_frame = time_current_frame;
+-
++#endif /* HAVE_FFMPEG */
+
+ /***** MOTION LOOP - VIDEO LOOPBACK SECTION *****/
+
+Only in motion-3.2.5.1-old/: motion.c.orig
diff --git a/package/motion/patches/02-honor_cppflags.patch b/package/motion/patches/02-honor_cppflags.patch
new file mode 100644
index 000000000..322fb772d
--- /dev/null
+++ b/package/motion/patches/02-honor_cppflags.patch
@@ -0,0 +1,20 @@
+diff -ruN motion-3.2.5.1-old/Makefile.in motion-3.2.5.1-new/Makefile.in
+--- motion-3.2.5.1-old/Makefile.in 2006-03-07 22:52:49.000000000 +0100
++++ motion-3.2.5.1-new/Makefile.in 2006-03-27 22:04:34.000000000 +0200
+@@ -32,6 +32,7 @@
+ ################################################################################
+ CFLAGS = @CFLAGS@ -Wall -DVERSION=\"$(VERSION)\" -D_REENTRANT \
+ -Dsysconfdir=\"$(sysconfdir)\"
++CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+ VIDEO_OBJ = @VIDEO@
+@@ -115,7 +116,7 @@
+ ################################################################################
+ $(DEPEND_FILE): *.h $(SRC)
+ @echo "Generating dependencies, please wait..."
+- @$(CC) $(CFLAGS) -M $(SRC) > .tmp
++ @$(CC) $(CFLAGS) $(CPPFLAGS) -M $(SRC) > .tmp
+ @mv -f .tmp $(DEPEND_FILE)
+ @echo
+
diff --git a/package/mpd/Config.in b/package/mpd/Config.in
new file mode 100644
index 000000000..a2fc42afa
--- /dev/null
+++ b/package/mpd/Config.in
@@ -0,0 +1,96 @@
+#menu "mpd............................... Music Player Daemon"
+
+config ADK_PACKAGE_MPD
+ prompt "mpd............................... Music Player Daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_ALSA_LIB
+ select ADK_PACKAGE_GLIB2
+ select ADK_PACKAGE_LIBCURL
+ help
+ MPD is a music player supporting flac, mp3 and ogg files.
+ It is typically controlled over a network using one of it's many
+ clients including mpc(console), gmpc(gnome), phpmp(php) etc.
+
+ http://www.musicpd.org/
+
+config ADK_COMPILE_MPD_WITH_MP3
+ prompt " MP3 support"
+ bool
+ default y
+ depends ADK_PACKAGE_MPD
+ select ADK_PACKAGE_LIBMAD
+ select ADK_PACKAGE_LIBID3TAG
+ help
+ Enable mp3 support (libmad).
+
+config ADK_COMPILE_MPD_WITH_MP4
+ prompt " MP4/AAC support"
+ bool
+ default y
+ depends ADK_PACKAGE_MPD
+ select ADK_PACKAGE_LIBFAAD2
+ help
+ Enable mp4/aac support (libfaad2).
+
+config ADK_COMPILE_MPD_OGG
+ prompt " Ogg/Vorbis Support"
+ tristate
+ depends ADK_PACKAGE_MPD
+ select ADK_COMPILE_MPD_WITH_OGG if ADK_COMPILE_MPD_OGG_FLOAT
+ select ADK_COMPILE_MPD_WITH_TREMOR if ADK_COMPILE_MPD_OGG_FIXED
+ default y
+ help
+ Ogg/Vorbis support.
+
+choice
+prompt "Ogg type"
+depends on ADK_COMPILE_MPD_OGG
+config ADK_COMPILE_MPD_OGG_FLOAT
+ bool "Ogg/Vorbis (floating point implementation)"
+config ADK_COMPILE_MPD_OGG_FIXED
+ bool "Ogg/Vorbis (fixed point implementation)"
+endchoice
+
+config ADK_COMPILE_MPD_WITH_OGG
+ bool
+ default n
+ depends ADK_PACKAGE_MPD
+ depends ADK_COMPILE_MPD_OGG_FLOAT
+ select ADK_PACKAGE_LIBOGG
+ select ADK_PACKAGE_LIBVORBIS
+ help
+ Enable ogg vorbis support.
+
+config ADK_COMPILE_MPD_WITH_TREMOR
+ bool
+ default n
+ depends ADK_PACKAGE_MPD
+ depends ADK_COMPILE_MPD_OGG_FIXED
+ select ADK_PACKAGE_LIBVORBISIDEC
+ help
+ Enable ogg support (tremor).
+ Can not be used with shout plugin.
+
+config ADK_COMPILE_MPD_WITH_FLAC
+ prompt " FLAC Support"
+ bool
+ default y
+ depends ADK_PACKAGE_MPD
+ select ADK_PACKAGE_LIBFLAC
+ help
+ Enable flac support (libflac).
+
+config ADK_COMPILE_MPD_WITH_SHOUT
+ prompt " Shout Support (Streaming support)"
+ bool
+ default y
+ depends ADK_PACKAGE_MPD
+ depends ADK_COMPILE_MPD_WITH_OGG
+ select ADK_PACKAGE_LIBSHOUT
+ select ADK_PACKAGE_LIBVORBISENC
+ select ADK_PACKAGE_LIBLAME
+ help
+ Enable shout support (libshout).
+
+#endmenu
diff --git a/package/mpd/Makefile b/package/mpd/Makefile
new file mode 100644
index 000000000..cc4a6d02e
--- /dev/null
+++ b/package/mpd/Makefile
@@ -0,0 +1,94 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mpd
+PKG_VERSION:= 0.14.2
+PKG_RELEASE:= 3
+PKG_MD5SUM:= 64177135f64aca555887ba378de8cdfb
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=musicpd/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MPD,mpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= MPD_CFLAGS=''
+PKG_DEPENDS:= glib2 alsa-lib libcurl
+
+CONFIGURE_ARGS+= \
+ --enable-alsa \
+ --disable-mod \
+ --disable-oss \
+ --disable-audiofile \
+ --disable-mpc \
+
+ifneq (${ADK_COMPILE_MPD_WITH_MP3},)
+PKG_DEPENDS+= libid3tag libmad
+CONFIGURE_ARGS+= --enable-id3 --enable-mp3
+else
+CONFIGURE_ARGS+= --disable-id3 --disable-mp3
+endif
+
+ifneq (${ADK_COMPILE_MPD_WITH_MP4},)
+PKG_DEPENDS+= libfaad2
+CONFIGURE_ARGS+= --enable-aac
+else
+CONFIGURE_ARGS+= --disable-aac
+endif
+
+ifeq (${ADK_COMPILE_MPD_WITH_OGG},y)
+PKG_DEPENDS+= libvorbis libogg
+CONFIGURE_ARGS+= --enable-oggvorbis
+else
+CONFIGURE_ARGS+= --disable-oggvorbis
+endif
+
+ifneq (${ADK_COMPILE_MPD_WITH_TREMOR},)
+PKG_DEPENDS+= libvorbisidec
+CONFIGURE_ARGS+= \
+ --disable-oggvorbis \
+ --with-tremor \
+ --with-tremor-includes=${STAGING_DIR}/usr/include \
+ --with-tremor-libraries=${STAGING_DIR}/usr/lib
+endif
+
+ifneq (${ADK_COMPILE_MPD_WITH_FLAC},)
+PKG_DEPENDS+= libflac
+CONFIGURE_ARGS+= --enable-flac
+else
+CONFIGURE_ARGS+= --disable-flac
+endif
+
+ifneq (${ADK_COMPILE_MPD_WITH_SHOUT},)
+PKG_DEPENDS+= libshout liblame
+CONFIGURE_ARGS+= --enable-shout-ogg \
+ --enable-shout-mp3 \
+ --enable-lame
+else
+CONFIGURE_ARGS+= --disable-shout-ogg \
+ --disable-shout-mp3 \
+ --disable-lame
+endif
+
+COMMA:= ,
+EMPTY:=
+SPACE:= ${EMPTY} ${EMPTY}
+PKG_DEPENDS:= ${subst ${SPACE},${COMMA}${SPACE},${sort ${PKG_DEPENDS}}}
+
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MPD}/usr/bin
+ ${INSTALL_DIR} ${IDIR_MPD}/etc/init.d
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/mpd ${IDIR_MPD}/usr/bin
+ ${INSTALL_DATA} ./files/mpd.conf ${IDIR_MPD}/etc/mpd.conf
+ ${INSTALL_BIN} ./files/mpd.init \
+ ${IDIR_MPD}/etc/init.d/mpd
+ echo "Depends: ${PKG_DEPENDS}" >> ${IDIR_MPD}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mpd/files/mpd.conf b/package/mpd/files/mpd.conf
new file mode 100644
index 000000000..4e3725119
--- /dev/null
+++ b/package/mpd/files/mpd.conf
@@ -0,0 +1,18 @@
+# An example configuration file for MPD
+user "mpd"
+music_directory "~/music"
+playlist_directory "~/.mpd/playlists"
+db_file "~/.mpd/database"
+log_file "~/.mpd/log"
+error_file "~/.mpd/error-log"
+# An example of an ALSA output
+audio_output {
+ type "alsa"
+ name "My ALSA Device"
+ device "hw:0,0" # optional
+ format "44100:16:2" # optional
+}
+# Volume control mixer
+mixer_type "alsa"
+mixer_device "default"
+mixer_control "PCM"
diff --git a/package/mpd/files/mpd.init b/package/mpd/files/mpd.init
new file mode 100644
index 000000000..b07a189a1
--- /dev/null
+++ b/package/mpd/files/mpd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${mpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mpd
+ ;;
+stop)
+ mpd --kill
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/mpd/ipkg/mpd.conffiles b/package/mpd/ipkg/mpd.conffiles
new file mode 100644
index 000000000..a8d69760e
--- /dev/null
+++ b/package/mpd/ipkg/mpd.conffiles
@@ -0,0 +1 @@
+/etc/mpd.conf
diff --git a/package/mpd/ipkg/mpd.control b/package/mpd/ipkg/mpd.control
new file mode 100644
index 000000000..946f3d022
--- /dev/null
+++ b/package/mpd/ipkg/mpd.control
@@ -0,0 +1,5 @@
+Package: mpd
+Priority: optional
+Section: net
+Depends: alsa-lib
+Description: A music player for flac, mp3 and ogg.
diff --git a/package/mpd/ipkg/mpd.postinst b/package/mpd/ipkg/mpd.postinst
new file mode 100644
index 000000000..361adeec0
--- /dev/null
+++ b/package/mpd/ipkg/mpd.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+gid=$(get_next_gid)
+add_group mpd $gid
+add_user mpd $(get_next_uid) $gid /mnt
+add_rcconf mpd
diff --git a/package/mpfr/Config.in b/package/mpfr/Config.in
new file mode 100644
index 000000000..f86fde260
--- /dev/null
+++ b/package/mpfr/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_MPFR
+ prompt "mpfr......................... multiprecision floatingpoint library"
+ tristate
+ default n
+ help
+ http://www.mpfr.org
diff --git a/package/mpfr/Makefile b/package/mpfr/Makefile
new file mode 100644
index 000000000..eb457b4f6
--- /dev/null
+++ b/package/mpfr/Makefile
@@ -0,0 +1,19 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+include ${TOPDIR}/toolchain/mpfr/Makefile.inc
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MPFR,mpfr,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MPFR}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mpfr/ipkg/mpfr.control b/package/mpfr/ipkg/mpfr.control
new file mode 100644
index 000000000..69418afa5
--- /dev/null
+++ b/package/mpfr/ipkg/mpfr.control
@@ -0,0 +1,4 @@
+Package: mpfr
+Priority: optional
+Section: comp
+Description: multiprecision floatingpoint library
diff --git a/package/mplayer/Config.in b/package/mplayer/Config.in
new file mode 100644
index 000000000..a1f1b676b
--- /dev/null
+++ b/package/mplayer/Config.in
@@ -0,0 +1,16 @@
+config ADK_PACKAGE_MPLAYER
+ prompt "mplayer........................... popular movie player"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBOGG
+ select ADK_PACKAGE_LIBVORBIS
+ select ADK_PACKAGE_LIBMAD
+ select ADK_PACKAGE_ALSA_LIB
+ select ADK_PACKAGE_ZLIB
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBFAAD2
+ depends on ADK_LINUX_X86_ALIX1C
+ help
+ http://www.mplayerhq.hu
+
diff --git a/package/mplayer/Makefile b/package/mplayer/Makefile
new file mode 100644
index 000000000..73167c97b
--- /dev/null
+++ b/package/mplayer/Makefile
@@ -0,0 +1,86 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mplayer
+PKG_VERSION:= 1.0rc2
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 7e27e535c2d267637df34898f1b91707
+DISTFILES:= MPlayer-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://www7.mplayerhq.hu/MPlayer/releases/
+
+WRKDIST= ${WRKDIR}/MPlayer-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MPLAYER,mplayer,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+pre-configure:
+ (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
+ ./configure \
+ --prefix=/usr \
+ --confdir=/etc \
+ --enable-cross-compile \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --cc=$(TARGET_CC) \
+ --host-cc=$(HOSTCC) \
+ --with-extraincdir=$(STAGING_DIR)/usr/include \
+ --with-extralibdir=$(STAGING_DIR)/usr/lib \
+ --disable-ssse3 \
+ --disable-sse2 \
+ --disable-sse \
+ --enable-mmxext \
+ --enable-3dnowext \
+ --enable-mmx \
+ --enable-3dnow \
+ --disable-mencoder \
+ --enable-fbdev \
+ --enable-alsa \
+ --enable-mad \
+ --enable-faad-external \
+ --disable-faad-internal \
+ --enable-libvorbis \
+ --disable-ossaudio \
+ --disable-vm \
+ --disable-iconv \
+ --disable-lirc \
+ --disable-radio-v4l2 \
+ --disable-faac \
+ --disable-libdv \
+ --disable-live \
+ --disable-pvr \
+ --disable-ftp \
+ --disable-v4l2 \
+ --disable-ivtv \
+ --enable-vidix-internal \
+ --disable-dvdread-internal \
+ --disable-libdvdcss-internal \
+ --disable-freetype \
+ --disable-tremor-internal \
+ --disable-arts \
+ --disable-esd \
+ --disable-polyp \
+ --disable-jack \
+ --disable-openal \
+ --disable-nas \
+ --disable-sgiaudio \
+ --disable-sunaudio \
+ --disable-win32waveout \
+ --disable-tga \
+ --disable-pnm \
+ --disable-md5sum \
+ --disable-x11 \
+ );
+
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MPLAYER}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/mplayer ${IDIR_MPLAYER}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mplayer/ipkg/mplayer.control b/package/mplayer/ipkg/mplayer.control
new file mode 100644
index 000000000..80f0ff0d5
--- /dev/null
+++ b/package/mplayer/ipkg/mplayer.control
@@ -0,0 +1,5 @@
+Package: mplayer
+Priority: optional
+Section: video
+Depends: zlib, libncurses, libmad, alsa-lib, libvorbis, libogg, libfaad2, libpthread
+Description: popular video player
diff --git a/package/mplayer/patches/patch-configure b/package/mplayer/patches/patch-configure
new file mode 100644
index 000000000..4ef4de805
--- /dev/null
+++ b/package/mplayer/patches/patch-configure
@@ -0,0 +1,39 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- MPlayer-1.0rc2.orig/configure 2007-10-07 21:49:33.000000000 +0200
++++ MPlayer-1.0rc2/configure 2009-05-10 18:37:32.000000000 +0200
+@@ -2331,7 +2331,7 @@ elif test -z "$CFLAGS" ; then
+ elif test "$cc_vendor" != "gnu" ; then
+ CFLAGS="-O2 $_march $_mcpu $_pipe"
+ else
+- CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
++ CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+ fi
+ else
+ _warn_CFLAGS=yes
+@@ -3853,26 +3853,6 @@ else
+ fi
+
+
+-echocheck "X11 headers presence"
+- _x11_headers="no"
+- _res_comment="check if the dev(el) packages are installed"
+- for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
+- if test -f "$I/X11/Xlib.h" ; then
+- _x11_headers="yes"
+- _res_comment=""
+- break
+- fi
+- done
+- for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
+- if test -f "$I/X11/Xlib.h" ; then
+- _inc_extra="$_inc_extra -I$I"
+- _x11_headers="yes"
+- _res_comment="using $I"
+- break
+- fi
+- done
+-echores "$_x11_headers"
+-
+
+ echocheck "X11"
+ if test "$_x11" = auto && test "$_x11_headers" = yes ; then
diff --git a/package/mplayer/patches/patch-loader_win32_c b/package/mplayer/patches/patch-loader_win32_c
new file mode 100644
index 000000000..e5537e02a
--- /dev/null
+++ b/package/mplayer/patches/patch-loader_win32_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- MPlayer-1.0rc2.orig/loader/win32.c 2007-10-07 21:49:32.000000000 +0200
++++ MPlayer-1.0rc2/loader/win32.c 2008-10-28 15:29:47.000000000 +0100
+@@ -63,7 +63,6 @@ for DLL to know too much about its envir
+ #include <sys/types.h>
+ #include <dirent.h>
+ #include <sys/time.h>
+-#include <sys/timeb.h>
+ #ifdef HAVE_KSTAT
+ #include <kstat.h>
+ #endif
diff --git a/package/mrd6/Config.in b/package/mrd6/Config.in
new file mode 100644
index 000000000..62a3e3585
--- /dev/null
+++ b/package/mrd6/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_MRD6
+ prompt "mrd6.............................. IPv6 multicast routing daemon"
+ depends on ADK_IPV6
+ tristate
+ default n
+ help
+ Multicast is becoming a major component in next generation
+ networks, used in several scenarios, from video broadcasting
+ to multimedia conferencing. In order to be implemented, new
+ technology needs supporting hardware and software across a set
+ of devices and systems. MRD6 is an implementation of a modular
+ IPv6 Multicast Routing Framework for the Linux operating system
+ and provides MLDv2 (as well as MLDv1), PIM-SM and MBGP support.
+
+ http://artemis.av.it.pt/mrd6/
diff --git a/package/mrd6/Makefile b/package/mrd6/Makefile
new file mode 100644
index 000000000..009f36516
--- /dev/null
+++ b/package/mrd6/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mrd6
+PKG_VERSION:= 0.9.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 93ada53bb414b9d622f80a717bc2694b
+MASTER_SITES:= http://fivebits.net/files/mrd6/
+
+WRKBUILD= ${WRKSRC}/src
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MRD6,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= EXTRA_FLAGS="${TCFLAGS}"
+
+post-install:
+ ${INSTALL_DIR} ${WRKINST}/etc/init.d
+ ${INSTALL_DATA} files/${PKG_NAME}.conf ${WRKINST}/etc
+ ${INSTALL_BIN} files/${PKG_NAME}.init ${WRKINST}/etc/init.d/${PKG_NAME}
+ ${INSTALL_DIR} ${IDIR_MRD6}/usr/sbin
+ ${CP} ${WRKINST}/* ${IDIR_MRD6}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mrd6/files/mrd6.conf b/package/mrd6/files/mrd6.conf
new file mode 100644
index 000000000..84ce923a3
--- /dev/null
+++ b/package/mrd6/files/mrd6.conf
@@ -0,0 +1,14 @@
+log {
+ attach stderr normal;
+ attach default "/var/log/mrd6.log" message_err;
+}
+
+interfaces br0 enable = false; // Should be vlan0 + eth1 but Linux bridge seems broken for multicast
+interfaces eth0 enable = false; // Interface to internal bridge
+handle-proper-bridge = true; // use ETH_P_ALL to see all packets on wrt54g
+
+// The default configured RP is m6bone's Renater RP.
+// Change this according to your setup
+
+groups ff00::/8 pim rp = 2001:660:3007:300:1::;
+
diff --git a/package/mrd6/files/mrd6.init b/package/mrd6/files/mrd6.init
new file mode 100644
index 000000000..ed3d4bab6
--- /dev/null
+++ b/package/mrd6/files/mrd6.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${mrd6:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/mrd6 -f /etc/mrd6.conf -D
+ ;;
+stop)
+ killall mrd6
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/mrd6/ipkg/mrd6.control b/package/mrd6/ipkg/mrd6.control
new file mode 100644
index 000000000..89082b9f4
--- /dev/null
+++ b/package/mrd6/ipkg/mrd6.control
@@ -0,0 +1,6 @@
+Package: mrd6
+Architecture: mipsel
+Section: net
+Priority: optional
+Depends: kmod-ipv6
+Description: IPv6 multicast routing daemon
diff --git a/package/mrd6/ipkg/mrd6.postinst b/package/mrd6/ipkg/mrd6.postinst
new file mode 100644
index 000000000..10332bae6
--- /dev/null
+++ b/package/mrd6/ipkg/mrd6.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf mrd6 mrd6 NO
diff --git a/package/mrd6/patches/patch-src_Makefile b/package/mrd6/patches/patch-src_Makefile
new file mode 100644
index 000000000..521673933
--- /dev/null
+++ b/package/mrd6/patches/patch-src_Makefile
@@ -0,0 +1,75 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- mrd6-0.9.6.orig/src/Makefile 2007-06-25 01:58:28.000000000 +0200
++++ mrd6-0.9.6/src/Makefile 2008-10-21 11:27:38.000000000 +0200
+@@ -26,7 +26,7 @@ ifeq ($(SUPPORT_MODULES),yes)
+ MODULES ?= BGP
+ LDCMD = -rdynamic
+ else
+- MODULE_OPTIONS += -DMRD_NO_DYNAMIC_MODULE_LOADING
++ MODULE_OPTIONS += MRD_NO_DYNAMIC_MODULE_LOADING
+ endif
+
+ INCLUDES = -I../include
+@@ -92,7 +92,7 @@ TESTS = tests/address_unittest tests/ptr
+ DEST_PREFIX = $(DESTDIR)$(PREFIX)
+
+ CXXFLAGS = $(INCLUDES) -ansi -Wall -Wno-multichar -fno-exceptions -fPIC \
+- -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS))
++ -D$(PLATFORM) $(addprefix -D,$(MODULE_OPTIONS)) $(EXTRA_FLAGS)
+
+ ifeq ($(OPTIMIZE),yes)
+ ifeq ($(SPACE_OPTIMIZE),yes)
+@@ -101,11 +101,8 @@ ifeq ($(OPTIMIZE),yes)
+ CXXFLAGS += -O3
+ endif
+ else
+- CXXFLAGS += -g
+ ifeq ($(NO_INLINE),yes)
+ CXXFLAGS += -O0 -fno-inline
+- else
+- CXXFLAGS += -O2
+ endif
+ endif
+
+@@ -151,7 +148,7 @@ $(foreach test,$(TESTS),$(eval $(call un
+
+ $(TARGET): $(MRD_OBJECTS)
+ @echo "Linking $(TARGET)"
+- @$(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS)
++ $(CXX) $(LDCMD) $(CXXFLAGS) -o $@ $(MRD_OBJECTS) $(LDFLAGS)
+
+ install: $(TARGET) $(EXTERNAL_MODULES)
+ install -D $(TARGET) $(DEST_PREFIX)/sbin/$(TARGET)
+@@ -162,12 +159,12 @@ ifneq (,$(EXTERNAL_MODULES))
+ endif
+
+ $(MRD_VERSION_CPP): $(SOURCES) Makefile Makefile.options
+- @set -e; mkdir -p $(dir $@); \
++ mkdir -p $(dir $@); \
+ echo '/* This file is automatically generated */' > $(MRD_VERSION_CPP); \
+ echo 'const char *BuildDate = "$(NOW)";' >> $(MRD_VERSION_CPP)
+
+ $(MODULES_CPP): Makefile Makefile.options
+- @set -e; mkdir -p $(dir $@); \
++ mkdir -p $(dir $@); \
+ echo "Generating modules.cpp"; \
+ scripts/generate-modules-cpp.pl $(STATIC_MODULES) > $(MODULES_CPP)
+
+@@ -181,7 +178,7 @@ $(OPTIONS):
+
+ $(DEPS_DIR)/%.d: %.cpp $(OPTIONS)
+ @echo "Deps $<"
+- @set -e; mkdir -p $(dir $@); \
++ mkdir -p $(dir $@); \
+ $(CXX) -MM -MT $@ -MT $(addprefix $(OBJ_DIR)/,$(<:.cpp=.o)) \
+ $(CXXFLAGS) $< > $@
+
+@@ -195,7 +192,7 @@ endif
+
+ $(OBJ_DIR)/%.o: %.cpp $(OPTIONS)
+ @echo "C++ $<"
+- @set -e; mkdir -p $(dir $@); \
++ mkdir -p $(dir $@); \
+ $(CXX) -c $(CXXFLAGS) $< -o $@
+
+ clean:
diff --git a/package/mt-daapd/Config.in b/package/mt-daapd/Config.in
new file mode 100644
index 000000000..166e490cf
--- /dev/null
+++ b/package/mt-daapd/Config.in
@@ -0,0 +1,31 @@
+config ADK_PACKAGE_MT_DAAPD
+ prompt "mt-daapd.......................... A multi-threaded DAAP (Digital Audio Access Protocol) daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBGDBM
+ select ADK_PACKAGE_LIBID3TAG
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ mt-daapd is a program which acts as an iTunes (DAAP) server for Linux and
+ other POSIX unixes. It may eventually support Win32 as well.
+
+ Some random features that it supports:
+
+ * Supports the Roku SoundBridge (query/browse/index support)
+ * Supports periodic rescans of the database
+ * Can advertise shoutcast streams
+ * Supports password-protected shares
+ * Is web-configurable and managable
+ * Support dynamic playlists, like iTunes "Smart playlists"
+ * Probably other things I've forgotten
+
+ All is not perfect, however. Currently, there are several drawbacks to it:
+
+ * database is indexed by inode, so all music must be on one filesystem
+ * browse by artist is slow on Roku, times out (with large databases ~10K songs)
+ * Probably other things I've forgotten
+
+ http://www.mt-daapd.org/
+
+ Depends: libgdbm, libid3tag, libpthread
+
diff --git a/package/mt-daapd/Makefile b/package/mt-daapd/Makefile
new file mode 100644
index 000000000..a9160bb0e
--- /dev/null
+++ b/package/mt-daapd/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mt-daapd
+PKG_VERSION:= 0.2.4
+PKG_RELEASE:= 10
+PKG_MD5SUM:= 2e1cdbe6b94ef153e915806f80a28dca
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=mt-daapd/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MT_DAAPD,mt-daapd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_setpgrp_void=yes
+CONFIGURE_ARGS+= --enable-mdns \
+ --disable-howl \
+ --with-id3tag="${STAGING_DIR}/usr" \
+ --with-gdbm-includes="${STAGING_DIR}/usr/include" \
+ --with-gdbm-libs="${STAGING_DIR}/usr/lib" \
+ --without-static-libs
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MT_DAAPD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_MT_DAAPD}/usr/{share,sbin}
+ ${INSTALL_DATA} ${WRKBUILD}/contrib/mt-daapd.conf ${IDIR_MT_DAAPD}/etc/
+ ${INSTALL_DATA} ${WRKBUILD}/contrib/mt-daapd.playlist ${IDIR_MT_DAAPD}/etc/
+ ${INSTALL_BIN} ./files/mt-daapd.init \
+ ${IDIR_MT_DAAPD}/etc/init.d/mt-daapd
+ ${CP} ${WRKINST}/usr/share/mt-daapd ${IDIR_MT_DAAPD}/usr/share/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/mt-daapd ${IDIR_MT_DAAPD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mt-daapd/files/mt-daapd.init b/package/mt-daapd/files/mt-daapd.init
new file mode 100644
index 000000000..ec2a947e6
--- /dev/null
+++ b/package/mt-daapd/files/mt-daapd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $mt_daapd = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mt-daapd
+ ;;
+stop)
+ killall mt-daapd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/mt-daapd/ipkg/mt-daapd.conffiles b/package/mt-daapd/ipkg/mt-daapd.conffiles
new file mode 100644
index 000000000..2e5ee2b4d
--- /dev/null
+++ b/package/mt-daapd/ipkg/mt-daapd.conffiles
@@ -0,0 +1,2 @@
+/etc/mt-daapd.conf
+/etc/mt-daapd.playlist
diff --git a/package/mt-daapd/ipkg/mt-daapd.control b/package/mt-daapd/ipkg/mt-daapd.control
new file mode 100644
index 000000000..0f2846058
--- /dev/null
+++ b/package/mt-daapd/ipkg/mt-daapd.control
@@ -0,0 +1,5 @@
+Package: mt-daapd
+Priority: optional
+Section: net
+Depends: libgdbm, libid3tag, libpthread
+Description: a multi-threaded DAAP (Digital Audio Access Protocol) daemon
diff --git a/package/mt-daapd/ipkg/mt-daapd.postinst b/package/mt-daapd/ipkg/mt-daapd.postinst
new file mode 100644
index 000000000..0059afb55
--- /dev/null
+++ b/package/mt-daapd/ipkg/mt-daapd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf mt-daapd mt_daapd NO
diff --git a/package/mtr/Config.in b/package/mtr/Config.in
new file mode 100644
index 000000000..7de08c5c8
--- /dev/null
+++ b/package/mtr/Config.in
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_MTR
+ prompt "mtr............................... Full screen ncurses traceroute tool"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ mtr combines the functionality of the 'traceroute' and 'ping' programs
+ in a single network diagnostic tool.
+ .
+ As mtr starts, it investigates the network connection between the host
+ mtr runs on and a user-specified destination host. After it
+ determines the address of each network hop between the machines,
+ it sends a sequence ICMP ECHO requests to each one to determine the
+ quality of the link to each machine. As it does this, it prints
+ running statistics about each machine.
+ .
+ http://www.bitwizard.nl/mtr/
+
diff --git a/package/mtr/Makefile b/package/mtr/Makefile
new file mode 100644
index 000000000..eac1e3d72
--- /dev/null
+++ b/package/mtr/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mtr
+PKG_VERSION:= 0.75
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 23baca52d0922c2ecba7eba05317868c
+MASTER_SITES:= ftp://ftp.bitwizard.nl/mtr/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MTR,mtr,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE+= gnu
+CONFIGURE_ENV+= ac_cv_lib_resolv_res_mkquery=yes
+CONFIGURE_ARGS+= --without-gtk
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_MTR}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/mtr ${IDIR_MTR}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mtr/ipkg/mtr.control b/package/mtr/ipkg/mtr.control
new file mode 100644
index 000000000..c5dad152c
--- /dev/null
+++ b/package/mtr/ipkg/mtr.control
@@ -0,0 +1,15 @@
+Package: mtr
+Priority: optional
+Section: net
+Depends: libncurses
+Description: Full screen ncurses traceroute/ping tool
+ mtr combines the functionality of the 'traceroute' and 'ping' programs
+ in a single network diagnostic tool.
+ .
+ As mtr starts, it investigates the network connection between the host
+ mtr runs on and a user-specified destination host. After it
+ determines the address of each network hop between the machines,
+ it sends a sequence ICMP ECHO requests to each one to determine the
+ quality of the link to each machine. As it does this, it prints
+ running statistics about each machine.
+
diff --git a/package/mtr/patches/501-dns.patch b/package/mtr/patches/501-dns.patch
new file mode 100644
index 000000000..f1c915580
--- /dev/null
+++ b/package/mtr/patches/501-dns.patch
@@ -0,0 +1,511 @@
+diff -Naur mtr-0.69.old/dns.c mtr-0.69.new/dns.c
+--- mtr-0.69.old/dns.c 2005-01-11 09:32:42.000000000 +0100
++++ mtr-0.69.new/dns.c 2005-10-03 21:31:27.000000000 +0200
+@@ -853,6 +853,507 @@
+ fputs("\r",stderr);
+ }
+
++#ifdef __UCLIBC__
++
++static const char digits[] = "0123456789";
++#define __set_errno(e) (errno = (e))
++
++#define NS_PUT16(s, cp) do { \
++ register u_int16_t t_s = (u_int16_t)(s); \
++ register u_char *t_cp = (u_char *)(cp); \
++ *t_cp++ = t_s >> 8; \
++ *t_cp = t_s; \
++ (cp) += NS_INT16SZ; \
++} while (0)
++
++
++
++#define NS_PUT32(l, cp) do { \
++ register u_int32_t t_l = (u_int32_t)(l); \
++ register u_char *t_cp = (u_char *)(cp); \
++ *t_cp++ = t_l >> 24; \
++ *t_cp++ = t_l >> 16; \
++ *t_cp++ = t_l >> 8; \
++ *t_cp = t_l; \
++ (cp) += NS_INT32SZ; \
++} while (0)
++
++
++void
++ns_put16(u_int src, u_char *dst) {
++ NS_PUT16(src, dst);
++}
++
++void
++ns_put32(u_long src, u_char *dst) {
++ NS_PUT32(src, dst);
++}
++
++void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
++void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
++
++int
++mklower(int ch) {
++ if (ch >= 0x41 && ch <= 0x5A)
++ return (ch + 0x20);
++ return (ch);
++}
++
++
++static int
++dn_find(const u_char *domain, const u_char *msg,
++ const u_char * const *dnptrs,
++ const u_char * const *lastdnptr)
++{
++ const u_char *dn, *cp, *sp;
++ const u_char * const *cpp;
++ u_int n;
++
++ for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
++ sp = *cpp;
++ /*
++ * terminate search on:
++ * root label
++ * compression pointer
++ * unusable offset
++ */
++ while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 &&
++ (sp - msg) < 0x4000) {
++ dn = domain;
++ cp = sp;
++ while ((n = *cp++) != 0) {
++ /*
++ * check for indirection
++ */
++ switch (n & NS_CMPRSFLGS) {
++ case 0: /* normal case, n == len */
++ if (n != *dn++)
++ goto next;
++ for ((void)NULL; n > 0; n--)
++ if (mklower(*dn++) !=
++ mklower(*cp++))
++ goto next;
++ /* Is next root for both ? */
++ if (*dn == '\0' && *cp == '\0')
++ return (sp - msg);
++ if (*dn)
++ continue;
++ goto next;
++
++ case NS_CMPRSFLGS: /* indirection */
++ cp = msg + (((n & 0x3f) << 8) | *cp);
++ break;
++
++ default: /* illegal type */
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ }
++ next:
++ sp += *sp + 1;
++ }
++ }
++ __set_errno (ENOENT);
++ return (-1);
++}
++
++
++int
++ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
++ const u_char **dnptrs, const u_char **lastdnptr)
++{
++ u_char *dstp;
++ const u_char **cpp, **lpp, *eob, *msg;
++ const u_char *srcp;
++ int n, l, first = 1;
++
++ srcp = src;
++ dstp = dst;
++ eob = dstp + dstsiz;
++ lpp = cpp = NULL;
++ if (dnptrs != NULL) {
++ if ((msg = *dnptrs++) != NULL) {
++ for (cpp = dnptrs; *cpp != NULL; cpp++)
++ (void)NULL;
++ lpp = cpp; /* end of list to search */
++ }
++ } else
++ msg = NULL;
++
++ /* make sure the domain we are about to add is legal */
++ l = 0;
++ do {
++ n = *srcp;
++ if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ if (n == 0x41)
++ n = *++srcp / 8;
++ l += n + 1;
++ if (l > MAXCDNAME) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ srcp += n + 1;
++ } while (n != 0);
++
++ /* from here on we need to reset compression pointer array on error */
++ srcp = src;
++ do {
++ /* Look to see if we can use pointers. */
++ n = *srcp;
++ if (n != 0 && n != 0x41 && msg != NULL) {
++ l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
++ (const u_char * const *)lpp);
++ if (l >= 0) {
++ if (dstp + 1 >= eob) {
++ goto cleanup;
++ }
++ *dstp++ = (l >> 8) | NS_CMPRSFLGS;
++ *dstp++ = l % 256;
++ return (dstp - dst);
++ }
++ /* Not found, save it. */
++ if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
++ (dstp - msg) < 0x4000 && first) {
++ *cpp++ = dstp;
++ *cpp = NULL;
++ first = 0;
++ }
++ }
++ /* copy label to buffer */
++ if ((n & NS_CMPRSFLGS) != 0 && n != 0x41) { /* Should not happen. */
++ goto cleanup;
++ }
++ if (n == 0x41) {
++ n = *++srcp / 8;
++ if (dstp + 1 >= eob)
++ goto cleanup;
++ *dstp++ = 0x41;
++ }
++ if (dstp + 1 + n >= eob) {
++ goto cleanup;
++ }
++ memcpy(dstp, srcp, n + 1);
++ srcp += n + 1;
++ dstp += n + 1;
++ } while (n != 0);
++
++ if (dstp > eob) {
++cleanup:
++ if (msg != NULL)
++ *lpp = NULL;
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ return (dstp - dst);
++}
++
++
++int
++ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
++ u_char *label, *bp, *eom;
++ int c, n, escaped;
++ char *cp;
++
++ escaped = 0;
++ bp = dst;
++ eom = dst + dstsiz;
++ label = bp++;
++
++ while ((c = *src++) != 0) {
++ if (escaped) {
++ if ((cp = strchr(digits, c)) != NULL) {
++ n = (cp - digits) * 100;
++ if ((c = *src++) == 0 ||
++ (cp = strchr(digits, c)) == NULL) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ n += (cp - digits) * 10;
++ if ((c = *src++) == 0 ||
++ (cp = strchr(digits, c)) == NULL) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ n += (cp - digits);
++ if (n > 255) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ c = n;
++ } else if (c == '[' && label == bp - 1 && *src == 'x') {
++ /* Theoretically we would have to handle \[o
++ as well but we do not since we do not need
++ it internally. */
++ *label = 0x41;
++ label = bp++;
++ ++src;
++ while (isxdigit (*src)) {
++ n = *src > '9' ? *src - 'a' + 10 : *src - '0';
++ ++src;
++ if (! isxdigit(*src)) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ n <<= 4;
++ n += *src > '9' ? *src - 'a' + 10 : *src - '0';
++ if (bp + 1 >= eom) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ *bp++ = n;
++ ++src;
++ }
++ *label = (bp - label - 1) * 8;
++ if (*src++ != ']' || *src++ != '.') {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ escaped = 0;
++ label = bp++;
++ if (bp >= eom) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ continue;
++ }
++ escaped = 0;
++ } else if (c == '\\') {
++ escaped = 1;
++ continue;
++ } else if (c == '.') {
++ c = (bp - label - 1);
++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ if (label >= eom) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ *label = c;
++ /* Fully qualified ? */
++ if (*src == '\0') {
++ if (c != 0) {
++ if (bp >= eom) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ *bp++ = '\0';
++ }
++ if ((bp - dst) > MAXCDNAME) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ return (1);
++ }
++ if (c == 0 || *src == '.') {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ label = bp++;
++ continue;
++ }
++ if (bp >= eom) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ *bp++ = (u_char)c;
++ }
++ c = (bp - label - 1);
++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ if (label >= eom) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ *label = c;
++ if (c != 0) {
++ if (bp >= eom) {
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ *bp++ = 0;
++ }
++ if ((bp - dst) > MAXCDNAME) { /* src too big */
++ __set_errno (EMSGSIZE);
++ return (-1);
++ }
++ return (0);
++}
++
++
++
++int
++ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
++ const u_char **dnptrs, const u_char **lastdnptr)
++{
++ u_char tmp[NS_MAXCDNAME];
++
++ if (ns_name_pton(src, tmp, sizeof tmp) == -1)
++ return (-1);
++ return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
++}
++
++
++int
++dn_comp(const char *src, u_char *dst, int dstsiz,
++ u_char **dnptrs, u_char **lastdnptr)
++{
++ return (ns_name_compress(src, dst, (size_t)dstsiz,
++ (const u_char **)dnptrs,
++ (const u_char **)lastdnptr));
++}
++
++
++
++
++int
++res_nmkquery(res_state statp,
++ int op, /* opcode of query */
++ const char *dname, /* domain name */
++ int class, int type, /* class and type of query */
++ const u_char *data, /* resource record data */
++ int datalen, /* length of data */
++ const u_char *newrr_in, /* new rr for modify or append */
++ u_char *buf, /* buffer to put query */
++ int buflen) /* size of buffer */
++{
++ register HEADER *hp;
++ register u_char *cp;
++ register int n;
++ u_char *dnptrs[20], **dpp, **lastdnptr;
++
++#ifdef DEBUG
++ if (statp->options & RES_DEBUG)
++ printf(";; res_nmkquery(%s, %s, %s, %s)\n",
++ _res_opcodes[op], dname, p_class(class), p_type(type));
++#endif
++ /*
++ * Initialize header fields.
++ */
++ if ((buf == NULL) || (buflen < HFIXEDSZ))
++ return (-1);
++ memset(buf, 0, HFIXEDSZ);
++ hp = (HEADER *) buf;
++ /* We randomize the IDs every time. The old code just
++ incremented by one after the initial randomization which
++ still predictable if the application does multiple
++ requests. */
++#if 0
++ hp->id = htons(++statp->id);
++#else
++ hp->id = htons(statp->id);
++ int randombits;
++ do
++ {
++#ifdef RANDOM_BITS
++ RANDOM_BITS (randombits);
++#else
++ struct timeval tv;
++ gettimeofday (&tv, NULL);
++ randombits = (tv.tv_sec << 8) ^ tv.tv_usec;
++#endif
++ }
++ while ((randombits & 0xffff) == 0);
++ statp->id = (statp->id + randombits) & 0xffff;
++#endif
++ hp->opcode = op;
++ hp->rd = (statp->options & RES_RECURSE) != 0;
++ hp->rcode = NOERROR;
++ cp = buf + HFIXEDSZ;
++ buflen -= HFIXEDSZ;
++ dpp = dnptrs;
++ *dpp++ = buf;
++ *dpp++ = NULL;
++ lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
++ /*
++ * perform opcode specific processing
++ */
++ switch (op) {
++ case QUERY: /*FALLTHROUGH*/
++ case NS_NOTIFY_OP:
++ if ((buflen -= QFIXEDSZ) < 0)
++ return (-1);
++ if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
++ return (-1);
++ cp += n;
++ buflen -= n;
++ __putshort(type, cp);
++ cp += INT16SZ;
++ __putshort(class, cp);
++ cp += INT16SZ;
++ hp->qdcount = htons(1);
++ if (op == QUERY || data == NULL)
++ break;
++ /*
++ * Make an additional record for completion domain.
++ */
++ buflen -= RRFIXEDSZ;
++ n = dn_comp((char *)data, cp, buflen, dnptrs, lastdnptr);
++ if (n < 0)
++ return (-1);
++ cp += n;
++ buflen -= n;
++ __putshort(T_NULL, cp);
++ cp += INT16SZ;
++ __putshort(class, cp);
++ cp += INT16SZ;
++ __putlong(0, cp);
++ cp += INT32SZ;
++ __putshort(0, cp);
++ cp += INT16SZ;
++ hp->arcount = htons(1);
++ break;
++
++ case IQUERY:
++ /*
++ * Initialize answer section
++ */
++ if (buflen < 1 + RRFIXEDSZ + datalen)
++ return (-1);
++ *cp++ = '\0'; /* no domain name */
++ __putshort(type, cp);
++ cp += INT16SZ;
++ __putshort(class, cp);
++ cp += INT16SZ;
++ __putlong(0, cp);
++ cp += INT32SZ;
++ __putshort(datalen, cp);
++ cp += INT16SZ;
++ if (datalen) {
++ memcpy(cp, data, datalen);
++ cp += datalen;
++ }
++ hp->ancount = htons(1);
++ break;
++
++ default:
++ return (-1);
++ }
++ return (cp - buf);
++}
++
++int
++res_mkquery(int op, /* opcode of query */
++ const char *dname, /* domain name */
++ int class, int type, /* class and type of query */
++ const u_char *data, /* resource record data */
++ int datalen, /* length of data */
++ const u_char *newrr_in, /* new rr for modify or append */
++ u_char *buf, /* buffer to put query */
++ int buflen) /* size of buffer */
++{
++ return (res_nmkquery(&_res, op, dname, class, type,
++ data, datalen,
++ newrr_in, buf, buflen));
++}
++
++#endif
+
+ void dorequest(char *s,int type,word id)
+ {
diff --git a/package/mtr/patches/patch-Makefile b/package/mtr/patches/patch-Makefile
new file mode 100644
index 000000000..babc467bf
--- /dev/null
+++ b/package/mtr/patches/patch-Makefile
@@ -0,0 +1,763 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- mtr-0.75.orig/Makefile 2008-09-19 11:32:05.000000000 +0200
++++ mtr-0.75/Makefile 2008-10-10 15:03:22.000000000 +0200
+@@ -1,16 +1,748 @@
++# Makefile.in generated by automake 1.9.6 from Makefile.am.
++# Makefile. Generated from Makefile.in by configure.
+
+-#
+-# This is an attempt on simplifying the compilation of mtr to a simple "make".
+-#
++# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
++# 2003, 2004, 2005 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.
+
+-firstrule:
+- ./configure
+- $(MAKE)
++# 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.
+
+-clean:
+- rm -f *.o *~ core
+
+-distclean: clean
+- rm -f mtr config.cache config.status config.log \
+- stamp-h stamp-h[0-9]* TAGS ID
+
++srcdir = .
++top_srcdir = .
++
++pkgdatadir = $(datadir)/mtr
++pkglibdir = $(libdir)/mtr
++pkgincludedir = $(includedir)/mtr
++top_builddir = .
++am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
++INSTALL = /usr/bin/install -c
++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 = :
++sbin_PROGRAMS = mtr$(EXEEXT)
++subdir = .
++DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
++ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
++ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
++ TODO config.guess config.sub depcomp install-sh missing \
++ mkinstalldirs
++ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
++am__aclocal_m4_deps = $(top_srcdir)/configure.in
++am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
++ $(ACLOCAL_M4)
++am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
++ configure.lineno configure.status.lineno
++mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
++CONFIG_HEADER = config.h
++CONFIG_CLEAN_FILES =
++am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
++sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
++PROGRAMS = $(sbin_PROGRAMS)
++am_mtr_OBJECTS = mtr.$(OBJEXT) net.$(OBJEXT) dns.$(OBJEXT) \
++ raw.$(OBJEXT) split.$(OBJEXT) display.$(OBJEXT) \
++ report.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) \
++ select.$(OBJEXT)
++mtr_OBJECTS = $(am_mtr_OBJECTS)
++mtr_LDADD = $(LDADD)
++DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
++depcomp = $(SHELL) $(top_srcdir)/depcomp
++am__depfiles_maybe = depfiles
++COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
++CCLD = $(CC)
++LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++SOURCES = $(mtr_SOURCES) $(EXTRA_mtr_SOURCES)
++DIST_SOURCES = $(mtr_SOURCES) $(EXTRA_mtr_SOURCES)
++RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
++ html-recursive info-recursive install-data-recursive \
++ install-exec-recursive install-info-recursive \
++ install-recursive installcheck-recursive installdirs-recursive \
++ pdf-recursive ps-recursive uninstall-info-recursive \
++ uninstall-recursive
++man8dir = $(mandir)/man8
++NROFF = nroff
++MANS = $(man_MANS)
++ETAGS = etags
++CTAGS = ctags
++DIST_SUBDIRS = $(SUBDIRS)
++DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
++distdir = $(PACKAGE)-$(VERSION)
++top_distdir = $(distdir)
++am__remove_distdir = \
++ { test ! -d $(distdir) \
++ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
++ && rm -fr $(distdir); }; }
++DIST_ARCHIVES = $(distdir).tar.gz
++GZIP_ENV = --best
++distuninstallcheck_listfiles = find . -type f -print
++distcleancheck_listfiles = find . -type f -print
++ACLOCAL = ${SHELL} /home/wbrodkorb/openadk/build_x86/w-mtr-0.75-1/mtr-0.75/missing --run aclocal-1.9
++AMDEP_FALSE =
++AMDEP_TRUE = #
++AMTAR = ${SHELL} /home/wbrodkorb/openadk/build_x86/w-mtr-0.75-1/mtr-0.75/missing --run tar
++AUTOCONF = ${SHELL} /home/wbrodkorb/openadk/build_x86/w-mtr-0.75-1/mtr-0.75/missing --run autoconf
++AUTOHEADER = ${SHELL} /home/wbrodkorb/openadk/build_x86/w-mtr-0.75-1/mtr-0.75/missing --run autoheader
++AUTOMAKE = ${SHELL} /home/wbrodkorb/openadk/build_x86/w-mtr-0.75-1/mtr-0.75/missing --run automake-1.9
++AWK = gawk
++CC = /home/wbrodkorb/openadk/cross_x86/host/bin/i586-linux-uclibc-gcc
++CCDEPMODE = depmode=none
++CFLAGS = -fwrapv -fno-ident -O2 -pipe -march=i586 -funit-at-a-time -Wall -Wno-pointer-sign
++CPP = /home/wbrodkorb/openadk/cross_x86/host/bin/i586-linux-uclibc-gcc -E
++CPPFLAGS = -isystem /home/wbrodkorb/openadk/cross_x86/target/include -isystem /home/wbrodkorb/openadk/cross_x86/target/usr/include -DNDEBUG
++CURSES_OBJ = curses.o
++CYGPATH_W = echo
++DEFS = -DHAVE_CONFIG_H
++DEPDIR = .deps
++ECHO_C =
++ECHO_N = -n
++ECHO_T =
++EGREP = /bin/grep -E
++EXEEXT =
++GREP = /bin/grep
++GTK_CFLAGS =
++GTK_LIBS =
++GTK_OBJ =
++INSTALL_DATA = ${INSTALL} -m 644
++INSTALL_PROGRAM = ${INSTALL}
++INSTALL_SCRIPT = ${INSTALL}
++INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
++LDFLAGS = -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/home/wbrodkorb/openadk/cross_x86/target/usr/lib -L/home/wbrodkorb/openadk/cross_x86/target/lib -L/home/wbrodkorb/openadk/cross_x86/target/usr/lib
++LIBOBJS =
++LIBS = -lresolv -lm -lncurses
++LTLIBOBJS =
++MAKEINFO = ${SHELL} /home/wbrodkorb/openadk/build_x86/w-mtr-0.75-1/mtr-0.75/missing --run makeinfo
++OBJEXT = o
++PACKAGE = mtr
++PACKAGE_BUGREPORT =
++PACKAGE_NAME =
++PACKAGE_STRING =
++PACKAGE_TARNAME =
++PACKAGE_VERSION =
++PATH_SEPARATOR = :
++PKG_CONFIG =
++SET_MAKE =
++SHELL = /bin/bash
++STRIP = i586-linux-strip
++VERSION = 0.75
++ac_ct_CC =
++am__fastdepCC_FALSE =
++am__fastdepCC_TRUE = #
++am__include = include
++am__leading_dot = .
++am__quote =
++am__tar = ${AMTAR} chof - "$$tardir"
++am__untar = ${AMTAR} xf -
++bindir = ${exec_prefix}/bin
++build_alias = i686-linux-gnu
++datadir = /usr/share
++datarootdir = ${prefix}/share
++docdir = ${datarootdir}/doc/${PACKAGE}
++dvidir = ${docdir}
++exec_prefix = ${prefix}
++host_alias = i586-linux
++htmldir = ${docdir}
++includedir = ${prefix}/include
++infodir = ${datarootdir}/info
++install_sh = /home/wbrodkorb/openadk/build_x86/w-mtr-0.75-1/mtr-0.75/install-sh
++libdir = ${exec_prefix}/lib
++libexecdir = /usr/lib
++localedir = ${datarootdir}/locale
++localstatedir = /var
++mandir = /usr/share/man
++mkdir_p = mkdir -p --
++oldincludedir = /usr/include
++pdfdir = ${docdir}
++prefix = /usr
++program_transform_name = s&$$&&;s&^&&
++psdir = ${docdir}
++sbindir = ${exec_prefix}/sbin
++sharedstatedir = ${prefix}/com
++sysconfdir = /etc
++target_alias = i586-linux
++SUBDIRS = img
++man_MANS = mtr.8
++mtr_SOURCES = mtr.c \
++ net.c net.h \
++ dns.c dns.h \
++ raw.c raw.h \
++ split.c split.h \
++ display.c display.h \
++ report.c report.h \
++ getopt.c getopt1.c getopt.h \
++ select.c select.h \
++ mtr-curses.h \
++ mtr-gtk.h
++
++EXTRA_mtr_SOURCES = curses.c \
++ gtk.c
++
++mtr_DEPENDENCIES = $(GTK_OBJ) $(CURSES_OBJ)
++mtr_LDFLAGS = $(GTK_OBJ) $(CURSES_OBJ)
++EXTRA_DIST = SECURITY mtr.8 Makefile Makefile.dist
++DISTCLEANFILES = *~
++all: config.h
++ $(MAKE) $(AM_MAKEFLAGS) all-recursive
++
++.SUFFIXES:
++.SUFFIXES: .c .o .obj
++am--refresh:
++ @:
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
++ @for dep in $?; do \
++ case '$(am__configure_deps)' in \
++ *$$dep*) \
++ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
++ cd $(srcdir) && $(AUTOMAKE) --foreign \
++ && exit 0; \
++ exit 1;; \
++ esac; \
++ done; \
++ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
++ 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: $(am__configure_deps)
++ cd $(srcdir) && $(AUTOCONF)
++$(ACLOCAL_M4): $(am__aclocal_m4_deps)
++ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
++
++config.h: stamp-h1
++ @if test ! -f $@; then \
++ rm -f stamp-h1; \
++ $(MAKE) 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: $(am__configure_deps)
++ cd $(top_srcdir) && $(AUTOHEADER)
++ rm -f stamp-h1
++ touch $@
++
++distclean-hdr:
++ -rm -f config.h stamp-h1
++install-sbinPROGRAMS: $(sbin_PROGRAMS)
++ @$(NORMAL_INSTALL)
++ test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
++ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
++ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
++ if test -f $$p \
++ ; then \
++ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
++ echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
++ $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
++ else :; fi; \
++ done
++
++uninstall-sbinPROGRAMS:
++ @$(NORMAL_UNINSTALL)
++ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
++ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
++ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
++ rm -f "$(DESTDIR)$(sbindir)/$$f"; \
++ done
++
++clean-sbinPROGRAMS:
++ -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
++mtr$(EXEEXT): $(mtr_OBJECTS) $(mtr_DEPENDENCIES)
++ @rm -f mtr$(EXEEXT)
++ $(LINK) $(mtr_LDFLAGS) $(mtr_OBJECTS) $(mtr_LDADD) $(LIBS)
++
++mostlyclean-compile:
++ -rm -f *.$(OBJEXT)
++
++distclean-compile:
++ -rm -f *.tab.c
++
++#include ./$(DEPDIR)/curses.Po
++#include ./$(DEPDIR)/display.Po
++#include ./$(DEPDIR)/dns.Po
++#include ./$(DEPDIR)/getopt.Po
++#include ./$(DEPDIR)/getopt1.Po
++#include ./$(DEPDIR)/gtk.Po
++#include ./$(DEPDIR)/mtr.Po
++#include ./$(DEPDIR)/net.Po
++#include ./$(DEPDIR)/raw.Po
++#include ./$(DEPDIR)/report.Po
++#include ./$(DEPDIR)/select.Po
++#include ./$(DEPDIR)/split.Po
++
++.c.o:
++# if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
++# then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
++# source='$<' object='$@' libtool=no
++# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp)
++ $(COMPILE) -c $<
++
++.c.obj:
++# if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
++# then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
++# source='$<' object='$@' libtool=no
++# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp)
++ $(COMPILE) -c `$(CYGPATH_W) '$<'`
++uninstall-info-am:
++install-man8: $(man8_MANS) $(man_MANS)
++ @$(NORMAL_INSTALL)
++ test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)"
++ @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
++ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
++ for i in $$l2; do \
++ case "$$i" in \
++ *.8*) list="$$list $$i" ;; \
++ esac; \
++ done; \
++ for i in $$list; do \
++ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
++ else file=$$i; fi; \
++ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
++ case "$$ext" in \
++ 8*) ;; \
++ *) ext='8' ;; \
++ esac; \
++ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
++ inst=`echo $$inst | sed -e 's/^.*\///'`; \
++ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
++ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
++ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
++ done
++uninstall-man8:
++ @$(NORMAL_UNINSTALL)
++ @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
++ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
++ for i in $$l2; do \
++ case "$$i" in \
++ *.8*) list="$$list $$i" ;; \
++ esac; \
++ done; \
++ for i in $$list; do \
++ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
++ case "$$ext" in \
++ 8*) ;; \
++ *) ext='8' ;; \
++ esac; \
++ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
++ inst=`echo $$inst | sed -e 's/^.*\///'`; \
++ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
++ echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
++ rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
++ done
++
++# 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):
++ @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; \
++ (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"
++
++mostlyclean-recursive clean-recursive distclean-recursive \
++maintainer-clean-recursive:
++ @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; \
++ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
++ || eval $$failcom; \
++ done && test -z "$$fail"
++tags-recursive:
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
++ done
++ctags-recursive:
++ list='$(SUBDIRS)'; for subdir in $$list; do \
++ test "$$subdir" = . || (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; } \
++ END { for (i in files) print i; }'`; \
++ mkid -fID $$unique
++tags: TAGS
++
++TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ 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 || \
++ tags="$$tags $$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; } \
++ END { for (i in files) print i; }'`; \
++ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
++ test -n "$$unique" || unique=$$empty_fix; \
++ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
++ $$tags $$unique; \
++ fi
++ctags: CTAGS
++CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
++ $(TAGS_FILES) $(LISP)
++ tags=; \
++ 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; } \
++ END { for (i in files) print i; }'`; \
++ test -z "$(CTAGS_ARGS)$$tags$$unique" \
++ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
++ $$tags $$unique
++
++GTAGS:
++ here=`$(am__cd) $(top_builddir) && pwd` \
++ && cd $(top_srcdir) \
++ && gtags -i $(GTAGS_ARGS) $$here
++
++distclean-tags:
++ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
++
++distdir: $(DISTFILES)
++ $(am__remove_distdir)
++ mkdir $(distdir)
++ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
++ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
++ list='$(DISTFILES)'; for file in $$list; do \
++ case $$file in \
++ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
++ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
++ esac; \
++ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
++ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
++ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
++ dir="/$$dir"; \
++ $(mkdir_p) "$(distdir)$$dir"; \
++ else \
++ dir=''; \
++ fi; \
++ if test -d $$d/$$file; then \
++ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
++ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
++ fi; \
++ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
++ else \
++ test -f $(distdir)/$$file \
++ || cp -p $$d/$$file $(distdir)/$$file \
++ || exit 1; \
++ fi; \
++ done
++ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
++ if test "$$subdir" = .; then :; else \
++ test -d "$(distdir)/$$subdir" \
++ || $(mkdir_p) "$(distdir)/$$subdir" \
++ || exit 1; \
++ distdir=`$(am__cd) $(distdir) && pwd`; \
++ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
++ (cd $$subdir && \
++ $(MAKE) $(AM_MAKEFLAGS) \
++ top_distdir="$$top_distdir" \
++ distdir="$$distdir/$$subdir" \
++ distdir) \
++ || exit 1; \
++ fi; \
++ done
++ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
++ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
++ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
++ || chmod -R a+r $(distdir)
++dist-gzip: distdir
++ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
++ $(am__remove_distdir)
++
++dist-bzip2: distdir
++ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
++ $(am__remove_distdir)
++
++dist-tarZ: distdir
++ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
++ $(am__remove_distdir)
++
++dist-shar: distdir
++ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
++ $(am__remove_distdir)
++
++dist-zip: distdir
++ -rm -f $(distdir).zip
++ zip -rq $(distdir).zip $(distdir)
++ $(am__remove_distdir)
++
++dist dist-all: distdir
++ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
++ $(am__remove_distdir)
++
++# This target untars the dist file and tries a VPATH configuration. Then
++# it guarantees that the distribution is self-contained by making another
++# tarfile.
++distcheck: dist
++ case '$(DIST_ARCHIVES)' in \
++ *.tar.gz*) \
++ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
++ *.tar.bz2*) \
++ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
++ *.tar.Z*) \
++ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
++ *.shar.gz*) \
++ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
++ *.zip*) \
++ unzip $(distdir).zip ;;\
++ esac
++ chmod -R a-w $(distdir); chmod a+w $(distdir)
++ mkdir $(distdir)/_build
++ mkdir $(distdir)/_inst
++ chmod a-w $(distdir)
++ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
++ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
++ && cd $(distdir)/_build \
++ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
++ $(DISTCHECK_CONFIGURE_FLAGS) \
++ && $(MAKE) $(AM_MAKEFLAGS) \
++ && $(MAKE) $(AM_MAKEFLAGS) dvi \
++ && $(MAKE) $(AM_MAKEFLAGS) check \
++ && $(MAKE) $(AM_MAKEFLAGS) install \
++ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
++ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
++ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
++ distuninstallcheck \
++ && chmod -R a-w "$$dc_install_base" \
++ && ({ \
++ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
++ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
++ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
++ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
++ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
++ } || { rm -rf "$$dc_destdir"; exit 1; }) \
++ && rm -rf "$$dc_destdir" \
++ && $(MAKE) $(AM_MAKEFLAGS) dist \
++ && rm -rf $(DIST_ARCHIVES) \
++ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
++ $(am__remove_distdir)
++ @(echo "$(distdir) archives ready for distribution: "; \
++ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
++ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
++distuninstallcheck:
++ @cd $(distuninstallcheck_dir) \
++ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
++ || { echo "ERROR: files left after uninstall:" ; \
++ if test -n "$(DESTDIR)"; then \
++ echo " (check DESTDIR support)"; \
++ fi ; \
++ $(distuninstallcheck_listfiles) ; \
++ exit 1; } >&2
++distcleancheck: distclean
++ @if test '$(srcdir)' = . ; then \
++ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
++ exit 1 ; \
++ fi
++ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
++ || { echo "ERROR: files left in build directory after distclean:" ; \
++ $(distcleancheck_listfiles) ; \
++ exit 1; } >&2
++check-am: all-am
++check: check-recursive
++all-am: Makefile $(PROGRAMS) $(MANS) config.h
++installdirs: installdirs-recursive
++installdirs-am:
++ for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; 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:
++
++distclean-generic:
++ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
++ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
++
++maintainer-clean-generic:
++ @echo "This command is intended for maintainers to use"
++ @echo "it deletes files that may require special tools to rebuild."
++clean: clean-recursive
++
++clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
++
++distclean: 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-local distclean-tags
++
++dvi: dvi-recursive
++
++dvi-am:
++
++html: html-recursive
++
++info: info-recursive
++
++info-am:
++
++install-data-am: install-man
++
++install-exec-am: install-sbinPROGRAMS
++ @$(NORMAL_INSTALL)
++ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
++
++install-info: install-info-recursive
++
++install-man: install-man8
++
++installcheck-am:
++
++maintainer-clean: 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-generic
++
++mostlyclean: mostlyclean-recursive
++
++mostlyclean-am: mostlyclean-compile mostlyclean-generic
++
++pdf: pdf-recursive
++
++pdf-am:
++
++ps: ps-recursive
++
++ps-am:
++
++uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS
++
++uninstall-info: uninstall-info-recursive
++
++uninstall-man: uninstall-man8
++
++.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
++ check-am clean clean-generic clean-recursive \
++ clean-sbinPROGRAMS ctags ctags-recursive dist dist-all \
++ dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip distcheck \
++ distclean distclean-compile distclean-generic distclean-hdr \
++ distclean-local distclean-recursive distclean-tags \
++ distcleancheck distdir distuninstallcheck dvi dvi-am html \
++ html-am info info-am install install-am install-data \
++ install-data-am install-exec install-exec-am install-exec-hook \
++ install-info install-info-am install-man install-man8 \
++ install-sbinPROGRAMS install-strip installcheck \
++ installcheck-am installdirs installdirs-am maintainer-clean \
++ maintainer-clean-generic maintainer-clean-recursive \
++ mostlyclean mostlyclean-compile mostlyclean-generic \
++ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
++ uninstall uninstall-am uninstall-info-am uninstall-man \
++ uninstall-man8 uninstall-sbinPROGRAMS
++
++install-exec-hook:
++ chmod u+s $(DESTDIR)$(sbindir)/mtr
++distclean-local:
++ (sleep 3; cp Makefile.dist Makefile) &
++ rm -f *.orig
++# 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/package/mtr/patches/patch-curses_c b/package/mtr/patches/patch-curses_c
new file mode 100644
index 000000000..2e04bd4ce
--- /dev/null
+++ b/package/mtr/patches/patch-curses_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- mtr-0.75.orig/curses.c 2008-08-19 18:55:48.000000000 +0200
++++ mtr-0.75/curses.c 2008-10-10 15:04:37.000000000 +0200
+@@ -241,7 +241,7 @@ int mtr_curses_keyaction(void)
+ return ActionNone;
+ }
+ if (tolower(c) == 'j') {
+- if( index(fld_active, 'N') ) {
++ if( strchr(fld_active, 'N') ) {
+ strcpy(fld_active, "DR AGJMXI"); /* GeoMean and jitter */
+ } else {
+ strcpy(fld_active, "LS NABWV"); /* default */
+@@ -328,7 +328,7 @@ void mtr_curses_hosts(int startstat)
+ if (j == -1) continue;
+
+ /* temporay hack for stats usec to ms... */
+- if( index( data_fields[j].format, 'f' ) ) {
++ if( strchr( data_fields[j].format, 'f' ) ) {
+ sprintf(buf + hd_len, data_fields[j].format,
+ data_fields[j].net_xxx(at) /1000.0 );
+ } else {
diff --git a/package/mtr/patches/patch-report_c b/package/mtr/patches/patch-report_c
new file mode 100644
index 000000000..bbae19253
--- /dev/null
+++ b/package/mtr/patches/patch-report_c
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- mtr-0.75.orig/report.c 2008-09-18 14:40:09.000000000 +0200
++++ mtr-0.75/report.c 2008-10-10 15:05:00.000000000 +0200
+@@ -122,7 +122,7 @@ void report_close(void)
+ if (j < 0) continue;
+
+ /* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */
+- if( index( data_fields[j].format, 'f' ) ) {
++ if( strchr( data_fields[j].format, 'f' ) ) {
+ snprintf( buf + len, sizeof(buf), data_fields[j].format,
+ data_fields[j].net_xxx(at) /1000.0 );
+ } else {
+@@ -201,7 +201,7 @@ void xml_close(void)
+ strcat(name, data_fields[j].format);
+ strcat(name, "</%s>\n");
+ /* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */
+- if( index( data_fields[j].format, 'f' ) ) {
++ if( strchr( data_fields[j].format, 'f' ) ) {
+ printf( name,
+ data_fields[j].title,
+ data_fields[j].net_xxx(at) /1000.0,
+@@ -280,7 +280,7 @@ void csv_close(void)
+ if (j < 0) continue;
+
+ /* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */
+- if( index( data_fields[j].format, 'f' ) ) {
++ if( strchr( data_fields[j].format, 'f' ) ) {
+ printf( ", %.2f", data_fields[j].net_xxx(at) / 1000.0);
+ } else {
+ printf( ", %d", data_fields[j].net_xxx(at) );
diff --git a/package/mutt/Config.in b/package/mutt/Config.in
new file mode 100644
index 000000000..3be7e0768
--- /dev/null
+++ b/package/mutt/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_MUTT
+ prompt "mutt.............................. console mail client"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ Mail client for the text console
+
+ http://www.mutt.org
+
diff --git a/package/mutt/Makefile b/package/mutt/Makefile
new file mode 100644
index 000000000..5d3a4b0ac
--- /dev/null
+++ b/package/mutt/Makefile
@@ -0,0 +1,39 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mutt
+PKG_VERSION:= 1.5.19
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 73b3747bc7f7c805921e8d24ebac693f
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=mutt/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,MUTT,mutt,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_c_bigendian=no \
+ ac_cv_sizeof_off_t=8 \
+ ac_cv_sizeof_int=4 \
+ ac_cv_sizeof_long=4
+CONFIGURE_ARGS+= --includedir=${WRKBUILD}/. \
+ --oldincludedir=${WRKBUILD}/. \
+ --enable-pop \
+ --enable-imap \
+ --with-ssl
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}"
+#ALL_TARGET:=
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_MUTT}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_MUTT}/usr/bin/
+ifeq (${ADK_PACKAGE_GPG},y)
+ ${INSTALL_BIN} ${WRKBUILD}/pgpewrap ${IDIR_MUTT}/usr/bin/
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mutt/ipkg/mutt.control b/package/mutt/ipkg/mutt.control
new file mode 100644
index 000000000..493074895
--- /dev/null
+++ b/package/mutt/ipkg/mutt.control
@@ -0,0 +1,5 @@
+Package: mutt
+Priority: optional
+Section: text
+Depends: libncurses, libopenssl
+Description: Mail text client
diff --git a/package/mutt/patches/patch-Makefile_in b/package/mutt/patches/patch-Makefile_in
new file mode 100644
index 000000000..ab7867d78
--- /dev/null
+++ b/package/mutt/patches/patch-Makefile_in
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- mutt-1.5.19.orig/Makefile.in 2009-01-05 20:24:13.000000000 +0100
++++ mutt-1.5.19/Makefile.in 2009-05-10 19:02:17.000000000 +0200
+@@ -129,7 +129,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re
+ distclean-recursive maintainer-clean-recursive
+ ETAGS = etags
+ CTAGS = ctags
+-DIST_SUBDIRS = m4 po intl doc contrib imap
++DIST_SUBDIRS = m4 po intl contrib imap
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ distdir = $(PACKAGE)-$(VERSION)
+ top_distdir = $(distdir)
+@@ -291,7 +291,7 @@ top_srcdir = @top_srcdir@
+ AUTOMAKE_OPTIONS = 1.6 foreign
+ @BUILD_IMAP_TRUE@IMAP_SUBDIR = imap
+ @BUILD_IMAP_TRUE@IMAP_INCLUDES = -I$(top_srcdir)/imap
+-SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR)
++SUBDIRS = m4 po intl contrib $(IMAP_SUBDIR)
+ bin_SCRIPTS = muttbug flea @SMIMEAUX_TARGET@
+ BUILT_SOURCES = keymap_defs.h patchlist.c reldate.h hcversion.h
+ mutt_SOURCES = \
diff --git a/package/mysql/Config.in b/package/mysql/Config.in
new file mode 100644
index 000000000..29a3f1c82
--- /dev/null
+++ b/package/mysql/Config.in
@@ -0,0 +1,19 @@
+config ADK_COMPILE_MYSQL
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBMYSQLCLIENT
+ depends ADK_CXX
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_ZLIB
+
+config ADK_PACKAGE_LIBMYSQLCLIENT
+ prompt "libmysqlclient.................... MySQL client library"
+ tristate
+ default n
+ depends ADK_CXX
+ select ADK_COMPILE_MYSQL
+ help
+ MySQL client library.
+
+ http://dev.mysql.com/
+
diff --git a/package/mysql/Makefile b/package/mysql/Makefile
new file mode 100644
index 000000000..0f80c9e02
--- /dev/null
+++ b/package/mysql/Makefile
@@ -0,0 +1,84 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= mysql
+PKG_VERSION:= 5.0.81
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2d35e4980f279c839172a6efdb0f0b15
+MASTER_SITES= ${MASTER_SITE_MYSQL:=Downloads/MySQL-5.0/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBMYSQLCLIENT,libmysqlclient,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= OPTIMIZE_CFLAGS="${TARGET_CFLAGS}" \
+ OPTIMIZE_CXXFLAGS="${TARGET_CFLAGS}" \
+ ac_cv_sys_restartable_syscalls=yes \
+ mysql_cv_sys_os=Linux \
+ mysql_cv_compress=yes \
+ ac_cv_sys_restartable_syscalls=no \
+ ac_cv_conv_longlong_to_float=yes \
+ mysql_cv_gethostname_style=glibc2
+CONFIGURE_ARGS+= --disable-assembler \
+ --with-pthread \
+ --without-raid \
+ --with-unix-socket-path=/tmp/.mysql.sock \
+ --with-named-thread-libs=-lpthread \
+ --without-libwrap \
+ --without-pstack \
+ --with-low-memory \
+ --without-server \
+ --without-embedded-server \
+ --without-query-cache \
+ --without-mysqlfs \
+ --without-vio \
+ --without-openssl \
+ --without-docs \
+ --without-bench \
+ --without-innodb \
+ --without-readline \
+ --with-machine-type=${CPU_ARCH}
+HOSTTOOLFLAGS= CC="${HOSTCC}" \
+ CXX='c++' \
+ CFLAGS='${HOSTCFLAGS} -DHOSTCOMPILE=1' \
+ CXXFLAGS='${HOSTCFLAGS}' \
+ LDFLAGS='${HOSTLDFLAGS}' \
+ CPPFLAGS='${HOSTCPPFLAGS}' \
+ CXXLINK='c++ ${HOSTCFLAGS} ${HOSTLDFLAGS} -o $$@' \
+ LINK='${HOSTCC} ${HOSTCFLAGS} ${HOSTLDFLAGS} -o $$@'
+ifneq (${OStype},Linux)
+HOSTTOOLFLAGS+= LIBS='-lm -lz'
+endif
+
+do-build:
+ ${MAKE} -C "${WRKBUILD}" \
+ SUBDIRS="include" \
+ DESTDIR="${WRKINST}" \
+ all install
+ ${MAKE} -C "${WRKBUILD}/libmysql" \
+ LINK="${HOSTCC} -o conf_to_src -lc" \
+ ${HOSTTOOLFLAGS} \
+ conf_to_src
+ ${MAKE} -C "${WRKBUILD}" \
+ CFLAGS="${TARGET_CFLAGS}" \
+ SUBDIRS="libmysql" \
+ DESTDIR="${WRKINST}" \
+ all install
+ ${MAKE} -C "${WRKBUILD}" \
+ CFLAGS="${TARGET_CFLAGS}" \
+ SUBDIRS="scripts" \
+ DESTDIR="${WRKINST}" \
+ bin_SCRIPTS="mysql_config" \
+ all install
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LIBMYSQLCLIENT}/usr/lib/mysql
+ ${CP} ${WRKINST}/usr/lib/mysql/libmysqlclient.so* \
+ ${IDIR_LIBMYSQLCLIENT}/usr/lib/mysql
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mysql/ipkg/libmysqlclient.control b/package/mysql/ipkg/libmysqlclient.control
new file mode 100644
index 000000000..84055412b
--- /dev/null
+++ b/package/mysql/ipkg/libmysqlclient.control
@@ -0,0 +1,5 @@
+Package: libmysqlclient
+Priority: optional
+Section: libs
+Depends: libncurses, zlib
+Description: MySQL client library
diff --git a/package/mysql/patches/patch-configure b/package/mysql/patches/patch-configure
new file mode 100644
index 000000000..2cde7e42c
--- /dev/null
+++ b/package/mysql/patches/patch-configure
@@ -0,0 +1,743 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- mysql-5.0.81.orig/configure 2009-04-16 13:56:58.000000000 +0200
++++ mysql-5.0.81/configure 2009-05-12 10:59:57.000000000 +0200
+@@ -885,8 +885,6 @@ MYSQLD_EXTRA_LIBS
+ CLIENT_EXTRA_LDFLAGS
+ MYSQLD_EXTRA_LDFLAGS
+ LIBDL
+-COMPILE_PSTACK_FALSE
+-COMPILE_PSTACK_TRUE
+ pstack_libs
+ pstack_dirs
+ WRAPLIBS
+@@ -21587,165 +21585,11 @@ else
+ $as_echo "no" >&6; }
+ fi
+
+-
+-
+-{ $as_echo "$as_me:$LINENO: checking \"return type of sprintf\"" >&5
+-$as_echo_n "checking \"return type of sprintf\"... " >&6; }
+-
+-#check the return type of sprintf
+-case $SYSTEM_TYPE in
+- *netware*)
+- cat >>confdefs.h <<\_ACEOF
+-#define SPRINTF_RETURNS_INT 1
+-_ACEOF
+- { $as_echo "$as_me:$LINENO: result: \"int\"" >&5
+-$as_echo "\"int\"" >&6; }
+- ;;
+- *)
+-if test "$cross_compiling" = yes; then
+- { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-$as_echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+- int main()
+- {
+- char* s = "hello";
+- char buf[6];
+- if((int)sprintf(buf, s) == strlen(s))
+- return 0;
+-
+- return -1;
+- }
+-
+-_ACEOF
+-rm -f 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+-
++# return type of sprintf is int for Linux glibc/uClibc
+ cat >>confdefs.h <<\_ACEOF
+ #define SPRINTF_RETURNS_INT 1
+ _ACEOF
+
+- { $as_echo "$as_me:$LINENO: result: \"int\"" >&5
+-$as_echo "\"int\"" >&6; }
+-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
+-
+-( exit $ac_status )
+-if test "$cross_compiling" = yes; then
+- { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-$as_echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+- int main()
+- {
+- char* s = "hello";
+- char buf[6];
+- if((char*)sprintf(buf,s) == buf + strlen(s))
+- return 0;
+- return -1;
+- }
+-_ACEOF
+-rm -f 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define SPRINTF_RETURNS_PTR 1
+-_ACEOF
+-
+- { $as_echo "$as_me:$LINENO: result: \"ptr\"" >&5
+-$as_echo "\"ptr\"" >&6; }
+-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
+-
+-( exit $ac_status )
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define SPRINTF_RETURNS_GARBAGE 1
+-_ACEOF
+-
+- { $as_echo "$as_me:$LINENO: result: \"garbage\"" >&5
+-$as_echo "\"garbage\"" >&6; }
+-fi
+-rm -rf conftest.dSYM
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+-
+-fi
+-rm -rf conftest.dSYM
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+- ;;
+-esac
+
+ # Extract the first word of "uname", so it can be a program name with args.
+ set dummy uname; ac_word=$2
+@@ -22841,98 +22685,8 @@ $as_echo "no" >&6; }
+ fi
+
+
+-# Look for PS usage. We use double dollar-signs in FIND_PROC because this
+-# value is written to a makefile, which interprets away one level of
+-# dollar-signs. So, interpretation stages are m4 and then shell in autoconf,
+-# then Make, then shell. The autoconf substitution uses single quotes, so
+-# no unprotected single quotes should appear in the expression.
+-# Extract the first word of "ps", so it can be a program name with args.
+-set dummy ps; ac_word=$2
+-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+-$as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_PS+set}" = set; then
+- $as_echo_n "(cached) " >&6
+-else
+- case $PS in
+- [\\/]* | ?:[\\/]*)
+- ac_cv_path_PS="$PS" # 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_PS="$as_dir/$ac_word$ac_exec_ext"
+- $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+- break 2
+- fi
+-done
+-done
+-IFS=$as_save_IFS
+-
+- test -z "$ac_cv_path_PS" && ac_cv_path_PS="ps"
+- ;;
+-esac
+-fi
+-PS=$ac_cv_path_PS
+-if test -n "$PS"; then
+- { $as_echo "$as_me:$LINENO: result: $PS" >&5
+-$as_echo "$PS" >&6; }
+-else
+- { $as_echo "$as_me:$LINENO: result: no" >&5
+-$as_echo "no" >&6; }
+-fi
+-
+-
+-{ $as_echo "$as_me:$LINENO: checking \"how to check if pid exists\"" >&5
+-$as_echo_n "checking \"how to check if pid exists\"... " >&6; }
+-PS=$ac_cv_path_PS
+ # Linux style
+-if $PS wwwp $$ 2> /dev/null | grep -- "$0" > /dev/null
+-then
+- FIND_PROC="$PS wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+-# Solaris
+-elif $PS -fp $$ 2> /dev/null | grep -- $0 > /dev/null
+-then
+- FIND_PROC="$PS -p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+-# BSD style
+-elif $PS -uaxww 2> /dev/null | grep -- $0 > /dev/null
+-then
+- FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
+-# SysV style
+-elif $PS -ef 2> /dev/null | grep -- $0 > /dev/null
+-then
+- FIND_PROC="$PS -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
+-# Do anybody use this?
+-elif $PS $$ 2> /dev/null | grep -- $0 > /dev/null
+-then
+- FIND_PROC="$PS \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+-else
+- case $SYSTEM_TYPE in
+- *freebsd*|*dragonfly*)
+- FIND_PROC="$PS p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+- ;;
+- *darwin*)
+- FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
+- ;;
+- *cygwin*)
+- FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
+- ;;
+- *netware*)
+- FIND_PROC=
+- ;;
+- *)
+- { { $as_echo "$as_me:$LINENO: error: Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual." >&5
+-$as_echo "$as_me: error: Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual." >&2;}
+- { (exit 1); exit 1; }; }
+- esac
+-fi
+-
+-{ $as_echo "$as_me:$LINENO: result: \"$FIND_PROC\"" >&5
+-$as_echo "\"$FIND_PROC\"" >&6; }
++FIND_PROC="/bin/ps wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
+
+ # Check if a pid is valid
+ # Extract the first word of "kill", so it can be a program name with args.
+@@ -26681,350 +26435,14 @@ fi
+ fi
+
+
+-
+-if test "$TARGET_LINUX" = "true"; then
+- { $as_echo "$as_me:$LINENO: checking for atomic operations" >&5
+-$as_echo_n "checking for atomic operations... " >&6; }
+-
+-
+- ac_ext=cpp
+-ac_cpp='$CXXCPP $CPPFLAGS'
+-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+-
+-
+- atom_ops=
+- if test "$cross_compiling" = yes; then
+- { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-$as_echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#include <asm/atomic.h>
+-int main()
+-{
+- atomic_t v;
+-
+- atomic_set(&v, 23);
+- atomic_add(5, &v);
+- return atomic_read(&v) == 28 ? 0 : -1;
+-}
+-
+-_ACEOF
+-rm -f 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+-
+ cat >>confdefs.h <<\_ACEOF
+-#define HAVE_ATOMIC_ADD 1
+-_ACEOF
+-
+- atom_ops="${atom_ops}atomic_add "
+-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
+-
+-fi
+-rm -rf conftest.dSYM
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+- if test "$cross_compiling" = yes; then
+- { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-$as_echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#include <asm/atomic.h>
+-int main()
+-{
+- atomic_t v;
+-
+- atomic_set(&v, 23);
+- atomic_sub(5, &v);
+- return atomic_read(&v) == 18 ? 0 : -1;
+-}
+-
+-_ACEOF
+-rm -f 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define HAVE_ATOMIC_SUB 1
+-_ACEOF
+-
+- atom_ops="${atom_ops}atomic_sub "
+-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
+-
+-fi
+-rm -rf conftest.dSYM
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+-
+- if test -z "$atom_ops"; then atom_ops="no"; fi
+- { $as_echo "$as_me:$LINENO: result: $atom_ops" >&5
+-$as_echo "$atom_ops" >&6; }
+-
+- 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 --with-pstack was given.
+-if test "${with_pstack+set}" = set; then
+- withval=$with_pstack; USE_PSTACK=$withval
+-else
+- USE_PSTACK=no
+-fi
+-
+- pstack_libs=
+- pstack_dirs=
+- if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386"
+- then
+- have_libiberty= have_libbfd=
+- my_save_LIBS="$LIBS"
+- { $as_echo "$as_me:$LINENO: checking for fdmatch in -liberty" >&5
+-$as_echo_n "checking for fdmatch in -liberty... " >&6; }
+-if test "${ac_cv_lib_iberty_fdmatch+set}" = set; then
+- $as_echo_n "(cached) " >&6
+-else
+- ac_check_lib_save_LIBS=$LIBS
+-LIBS="-liberty $LIBS"
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* 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 fdmatch ();
+-int
+-main ()
+-{
+-return fdmatch ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && {
+- 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_cv_lib_iberty_fdmatch=yes
+-else
+- $as_echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+- ac_cv_lib_iberty_fdmatch=no
+-fi
+-
+-rm -rf conftest.dSYM
+-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+- conftest$ac_exeext conftest.$ac_ext
+-LIBS=$ac_check_lib_save_LIBS
+-fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iberty_fdmatch" >&5
+-$as_echo "$ac_cv_lib_iberty_fdmatch" >&6; }
+-if test "x$ac_cv_lib_iberty_fdmatch" = x""yes; then
+- have_libiberty=yes
+- { $as_echo "$as_me:$LINENO: checking for bfd_openr in -lbfd" >&5
+-$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }
+-if test "${ac_cv_lib_bfd_bfd_openr+set}" = set; then
+- $as_echo_n "(cached) " >&6
+-else
+- ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lbfd -liberty $LIBS"
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* 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 bfd_openr ();
+-int
+-main ()
+-{
+-return bfd_openr ();
+- ;
+- return 0;
+-}
++#define HAVE_ATOMIC_ADD 0
+ _ACEOF
+-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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && {
+- 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_cv_lib_bfd_bfd_openr=yes
+-else
+- $as_echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+- ac_cv_lib_bfd_bfd_openr=no
+-fi
+-
+-rm -rf conftest.dSYM
+-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+- conftest$ac_exeext conftest.$ac_ext
+-LIBS=$ac_check_lib_save_LIBS
+-fi
+-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bfd_bfd_openr" >&5
+-$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }
+-if test "x$ac_cv_lib_bfd_bfd_openr" = x""yes; then
+- have_libbfd=yes
+-fi
+-
+-fi
+-
+- LIBS="$my_save_LIBS"
+-
+- if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
+- then
+- pstack_dirs='$(top_srcdir)'/pstack
+- pstack_libs="../pstack/libpstack.a -lbfd -liberty"
+- # We must link staticly when using pstack
+- with_mysqld_ldflags="-all-static"
+-
+-
+
+ cat >>confdefs.h <<\_ACEOF
+-#define USE_PSTACK 1
++#define HAVE_ATOMIC_SUB 0
+ _ACEOF
+
+- else
+- USE_PSTACK="no"
+- fi
+- else
+- USE_PSTACK="no"
+- fi
+-fi
+- if test "$USE_PSTACK" = "yes"; then
+- COMPILE_PSTACK_TRUE=
+- COMPILE_PSTACK_FALSE='#'
+-else
+- COMPILE_PSTACK_TRUE='#'
+- COMPILE_PSTACK_FALSE=
+-fi
+-
+-{ $as_echo "$as_me:$LINENO: checking if we should use pstack" >&5
+-$as_echo_n "checking if we should use pstack... " >&6; }
+-{ $as_echo "$as_me:$LINENO: result: $USE_PSTACK" >&5
+-$as_echo "$USE_PSTACK" >&6; }
+
+ # Check for gtty if termio.h doesn't exists
+ if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
+@@ -27201,96 +26619,6 @@ fi
+ # Later in this script LIBS will be augmented with a threads library.
+ NON_THREADED_LIBS="$LIBS"
+
+-{ $as_echo "$as_me:$LINENO: checking for int8" >&5
+-$as_echo_n "checking for int8... " >&6; }
+-case $SYSTEM_TYPE in
+- *netware)
+- { $as_echo "$as_me:$LINENO: result: no" >&5
+-$as_echo "no" >&6; }
+- ;;
+- *)
+-if test "$cross_compiling" = yes; then
+- { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-$as_echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#ifdef HAVE_STDLIB_H
+-#include <stdlib.h>
+-#endif
+-
+-#ifdef HAVE_STDDEF_H
+-#include <stddef.h>
+-#endif
+-
+-#ifdef HAVE_SYS_TYPES_H
+-#include <sys/types.h>
+-#endif
+-
+-int main()
+-{
+- int8 i;
+- return 0;
+-}
+-
+-_ACEOF
+-rm -f 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define HAVE_INT_8_16_32 1
+-_ACEOF
+-
+-{ $as_echo "$as_me:$LINENO: result: yes" >&5
+-$as_echo "yes" >&6; }
+-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
+-
+-( exit $ac_status )
+-{ $as_echo "$as_me:$LINENO: result: no" >&5
+-$as_echo "no" >&6; }
+-
+-fi
+-rm -rf conftest.dSYM
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+- ;;
+-esac
+-
+ #
+ # Some system specific hacks
+ #
+@@ -43458,13 +42786,6 @@ $as_echo "$as_me: error: conditional \"A
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+-if test -z "${COMPILE_PSTACK_TRUE}" && test -z "${COMPILE_PSTACK_FALSE}"; then
+- { { $as_echo "$as_me:$LINENO: error: conditional \"COMPILE_PSTACK\" was never defined.
+-Usually this means the macro was only invoked conditionally." >&5
+-$as_echo "$as_me: error: conditional \"COMPILE_PSTACK\" was never defined.
+-Usually this means the macro was only invoked conditionally." >&2;}
+- { (exit 1); exit 1; }; }
+-fi
+
+ if test -z "${HAVE_YASSL_TRUE}" && test -z "${HAVE_YASSL_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_YASSL\" was never defined.
diff --git a/package/mysql/patches/patch-include_my_global_h b/package/mysql/patches/patch-include_my_global_h
new file mode 100644
index 000000000..cbdc5ba6e
--- /dev/null
+++ b/package/mysql/patches/patch-include_my_global_h
@@ -0,0 +1,59 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- mysql-5.0.81.orig/include/my_global.h 2009-04-16 13:48:04.000000000 +0200
++++ mysql-5.0.81/include/my_global.h 2009-05-12 10:59:28.000000000 +0200
+@@ -350,29 +350,32 @@ C_MODE_END
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++
+ #if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA)
+ #undef HAVE_ALLOCA
+ #undef HAVE_ALLOCA_H
+ #endif
+-#ifdef HAVE_ALLOCA_H
+-#include <alloca.h>
++
++#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
++#ifndef BSD
++#define BSD
+ #endif
+-#ifdef HAVE_ATOMIC_ADD
+-#define new my_arg_new
+-#define need_to_restore_new 1
+-C_MODE_START
+-#include <asm/atomic.h>
+-C_MODE_END
+-#ifdef need_to_restore_new /* probably safer than #ifdef new */
+-#undef new
+-#undef need_to_restore_new
+ #endif
++
++#if defined(HAVE_ALLOCA_H) && !defined(BSD)
++#include <alloca.h>
+ #endif
++
+ #include <errno.h> /* Recommended by debian */
+ /* We need the following to go around a problem with openssl on solaris */
++#ifdef BSD
++#include <pwd.h>
++#include <unistd.h>
++#else
+ #if defined(HAVE_CRYPT_H)
+ #include <crypt.h>
+ #endif
++#endif
+
+ /*
+ A lot of our programs uses asserts, so better to always include it
+@@ -826,9 +829,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
+ #define finite(x) (1.0 / fabs(x) > 0.0)
+ #endif
+
++/*
+ #ifndef HAVE_ISNAN
+ #define isnan(x) ((x) != (x))
+ #endif
++*/
+
+ #ifdef HAVE_ISINF
+ /* isinf() can be used in both C and C++ code */
diff --git a/package/nano/Config.in b/package/nano/Config.in
new file mode 100644
index 000000000..7b164fa22
--- /dev/null
+++ b/package/nano/Config.in
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_NANO
+ prompt "nano.............................. An enhanced clone of the Pico text editor"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ GNU nano (Nano's ANOther editor, or Not ANOther editor) is an enhanced clone of the Pico text editor.
+
+ http://www.nano-editor.org/
+
+config ADK_PACKAGE_NANO_TINY
+ prompt " only compile a minimal nano (using --enable-tiny)"
+ bool
+ default y
+ depends ADK_PACKAGE_NANO
+ help
+ If not selected, nano will support justify, line wrapping, tab completion and multiple open file buffers.
+
diff --git a/package/nano/Makefile b/package/nano/Makefile
new file mode 100644
index 000000000..7c9d9a9dc
--- /dev/null
+++ b/package/nano/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= nano
+PKG_VERSION:= 2.0.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 619107f0fc3c4383d668cef15aa3ca32
+MASTER_SITES:= http://www.nano-editor.org/dist/v2.0/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NANO,nano,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_header_regex_h=no
+CONFIGURE_ARGS+= --enable-nanorc \
+ --disable-glibtest \
+ --disable-utf8 \
+ --without-slang
+ifeq (${ADK_PACKAGE_NANO_TINY},y)
+CONFIGURE_ARGS+= --enable-tiny
+else
+CONFIGURE_ARGS+= --disable-browser \
+ --disable-help \
+ --disable-mouse \
+ --disable-nls \
+ --disable-speller \
+ --disable-operatingdir \
+ --enable-multibuffer
+ifneq (${ADK_UNICODE},)
+CONFIGURE_ARGS+= --enable-utf8
+endif
+endif
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_NANO}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/nano ${IDIR_NANO}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_NANO}/etc
+ $(INSTALL_DATA) ./files/nanorc ${IDIR_NANO}/etc/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/nano/files/nanorc b/package/nano/files/nanorc
new file mode 100644
index 000000000..759fdf88b
--- /dev/null
+++ b/package/nano/files/nanorc
@@ -0,0 +1 @@
+set suspend
diff --git a/package/nano/ipkg/nano.conffiles b/package/nano/ipkg/nano.conffiles
new file mode 100644
index 000000000..ecc14ac9c
--- /dev/null
+++ b/package/nano/ipkg/nano.conffiles
@@ -0,0 +1 @@
+/etc/nanorc
diff --git a/package/nano/ipkg/nano.control b/package/nano/ipkg/nano.control
new file mode 100644
index 000000000..e68daef6b
--- /dev/null
+++ b/package/nano/ipkg/nano.control
@@ -0,0 +1,5 @@
+Package: nano
+Priority: optional
+Section: admin
+Depends: libncurses
+Description: An enhanced clone of the Pico text editor
diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in
new file mode 100644
index 000000000..4847013b6
--- /dev/null
+++ b/package/ncurses/Config.in
@@ -0,0 +1,16 @@
+config ADK_COMPILE_NCURSES
+ tristate
+ depends ADK_PACKAGE_LIBNCURSES
+
+config ADK_PACKAGE_LIBNCURSES
+ prompt "libncurses........................ Terminal handling library"
+ tristate
+ default n
+ select ADK_COMPILE_NCURSES
+ help
+ A terminal handling library
+
+ Comes with: libcurses libform libmenu libncurses libpanel
+
+ http://www.gnu.org/software/ncurses/
+
diff --git a/package/ncurses/Makefile b/package/ncurses/Makefile
new file mode 100644
index 000000000..63030766d
--- /dev/null
+++ b/package/ncurses/Makefile
@@ -0,0 +1,70 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ncurses
+PKG_VERSION:= 5.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cce05daf61a64501ef6cd8da1f727ec6
+MASTER_SITES:= ${MASTER_SITE_GNU:=ncurses/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBNCURSES,libncurses,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_linux_vers=2
+CONFIGURE_ARGS+= --without-cxx \
+ --without-cxx-binding \
+ --without-progs \
+ --with-fallbacks \
+ --without-ada \
+ --with-shared \
+ --with-normal \
+ --without-debug \
+ --without-profile \
+ --without-gpm \
+ --enable-overwrite \
+ --with-terminfo-dirs=/usr/share/terminfo \
+ --with-default-terminfo-dir=/usr/share/terminfo \
+ --disable-big-core \
+ --disable-home-terminfo \
+ --without-rcs-ids \
+ --enable-const \
+ --enable-echo
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+ALL_TARGET:= libs
+INSTALL_TARGET:= install.libs install.data
+
+
+pre-configure:
+ (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
+ ./configure \
+ --with-build-cc=${HOSTCC} \
+ --with-progs \
+ );
+ ${MAKE} -C ${WRKBUILD}/include
+ ${MAKE} -C ${WRKBUILD}/progs
+
+post-install:
+ # this is installed as libncurses - make libcurses a "link"
+ rm -f ${WRKINST}/usr/lib/libcurses.so*
+ echo 'GROUP(-lncurses)' >${WRKINST}/usr/lib/libcurses.so
+ # libcurses will not show up in the IPKG, only in STAGING_DIR
+ ${INSTALL_DIR} ${IDIR_LIBNCURSES}/usr/share/terminfo
+ ${INSTALL_DIR} ${IDIR_LIBNCURSES}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/lib{form,menu,ncurses,panel}.so.* \
+ ${IDIR_LIBNCURSES}/usr/lib
+ for f in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 \
+ v/vt220 w/wsvt25 x/xterm x/xterm-color x/xterm-xfree86; do \
+ ${INSTALL_DIR} \
+ ${IDIR_LIBNCURSES}/usr/share/terminfo/$$(dirname $$f); \
+ ${INSTALL_DATA} ${WRKINST}/usr/share/terminfo/$$f \
+ ${IDIR_LIBNCURSES}/usr/share/terminfo/$$f; \
+ done
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ncurses/ipkg/libncurses.control b/package/ncurses/ipkg/libncurses.control
new file mode 100644
index 000000000..0eff1cea0
--- /dev/null
+++ b/package/ncurses/ipkg/libncurses.control
@@ -0,0 +1,4 @@
+Package: libncurses
+Priority: optional
+Section: libs
+Description: a terminal handling library and common terminal definitions
diff --git a/package/ncurses/patches/patch-misc_run_tic_in b/package/ncurses/patches/patch-misc_run_tic_in
new file mode 100644
index 000000000..c2d76c4f7
--- /dev/null
+++ b/package/ncurses/patches/patch-misc_run_tic_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ncurses-5.7.orig/misc/run_tic.in 2006-10-28 21:43:30.000000000 +0200
++++ ncurses-5.7/misc/run_tic.in 2009-05-07 18:43:38.156250000 +0200
+@@ -61,7 +61,7 @@ test -z "${DESTDIR}" && DESTDIR=
+ # Allow tic to run either from the install-path, or from the build-directory.
+ # Do not do this if we appear to be cross-compiling. In that case, we rely
+ # on the host's copy of tic to compile the terminfo database.
+-if test "$THAT_CC" = "$THIS_CC" ; then
++if test "$THAT_CC" != "$THIS_CC" ; then
+ case "$PATH" in
+ :*) PATH=../progs:../lib:${DESTDIR}$bindir$PATH ;;
+ *) PATH=../progs:../lib:${DESTDIR}$bindir:$PATH ;;
diff --git a/package/ndisc/Config.in b/package/ndisc/Config.in
new file mode 100644
index 000000000..e7cafd5ee
--- /dev/null
+++ b/package/ndisc/Config.in
@@ -0,0 +1,45 @@
+#menu "ndisc6............................ IPv6 discovery tools"
+
+config ADK_COMPILE_NDISC6
+ tristate
+ default n
+ depends ADK_IPV6
+ depends ADK_PACKAGE_NDISC6 || ADK_PACKAGE_RDISC6 || ADK_PACKAGE_TCPTRACEROUTE6
+
+config ADK_PACKAGE_NDISC6
+ prompt "ndisc6............................ An ICMPv6 neighbour discovery tool"
+ tristate
+ default n
+ depends ADK_IPV6
+ select ADK_COMPILE_NDISC6
+ help
+
+ An ICMPv6 neighbour discovery tools
+
+ http://people.via.ecp.fr/~rem/ndisc6/
+
+config ADK_PACKAGE_RDISC6
+ prompt "rdisc6............................ An ICMPv6 router discovery tool"
+ tristate
+ default n
+ depends ADK_IPV6
+ select ADK_COMPILE_NDISC6
+ help
+
+ An ICMPv6 router discovery tool
+
+ http://people.via.ecp.fr/~rem/ndisc6/
+
+config ADK_PACKAGE_TCPTRACEROUTE6
+ prompt "tcptraceroute6.................... A TCP/IPv6-based traceroute implementation"
+ tristate
+ default n
+ depends ADK_IPV6
+ select ADK_COMPILE_NDISC6
+ help
+
+ A TCP/IPv6-based traceroute implementation
+
+ http://people.via.ecp.fr/~rem/ndisc6/
+
+#endmenu
diff --git a/package/ndisc/Makefile b/package/ndisc/Makefile
new file mode 100644
index 000000000..23ca866f6
--- /dev/null
+++ b/package/ndisc/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ndisc6
+PKG_VERSION:= 0.9.8
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cb8d70564b8d40aae95e19592c6be183
+MASTER_SITES:= http://www.remlab.net/files/ndisc6/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NDISC6,ndisc6,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,RDISC6,rdisc6,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,TCPTRACEROUTE6,tcptraceroute6,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}"
+TCLFAGS+= -std=c99
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_NDISC6}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ndisc6 ${IDIR_NDISC6}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_RDISC6}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}//usr/bin/rdisc6 ${IDIR_RDISC6}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_TCPTRACEROUTE6}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/tcptraceroute6 ${IDIR_TCPTRACEROUTE6}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ndisc/extra/rdnssd/strverscmp.c b/package/ndisc/extra/rdnssd/strverscmp.c
new file mode 100644
index 000000000..6276bca0f
--- /dev/null
+++ b/package/ndisc/extra/rdnssd/strverscmp.c
@@ -0,0 +1,131 @@
+/* Compare strings while treating digits characters numerically.
+ Copyright (C) 1997, 2000, 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+#include <ctype.h>
+
+/* states: S_N: normal, S_I: comparing integral part, S_F: comparing
+ fractional parts, S_Z: idem but with leading Zeroes only */
+#define S_N 0x0
+#define S_I 0x4
+#define S_F 0x8
+#define S_Z 0xC
+
+/* result_type: CMP: return diff; LEN: compare using len_diff/diff */
+#define CMP 2
+#define LEN 3
+
+
+/* ISDIGIT differs from isdigit, as follows:
+ - Its arg may be any int or unsigned int; it need not be an unsigned char.
+ - It's guaranteed to evaluate its argument exactly once.
+ - It's typically faster.
+ POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
+ ISDIGIT_LOCALE unless it's important to use the locale's definition
+ of `digit' even when the host does not conform to POSIX. */
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+#undef __strverscmp
+#undef strverscmp
+
+#ifndef weak_alias
+# define __strverscmp strverscmp
+#endif
+
+/* Compare S1 and S2 as strings holding indices/version numbers,
+ returning less than, equal to or greater than zero if S1 is less than,
+ equal to or greater than S2 (for more info, see the texinfo doc).
+*/
+
+int
+__strverscmp (const char *s1, const char *s2)
+{
+ const unsigned char *p1 = (const unsigned char *) s1;
+ const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+ int state;
+ int diff;
+
+ /* Symbol(s) 0 [1-9] others (padding)
+ Transition (10) 0 (01) d (00) x (11) - */
+ static const unsigned int next_state[] =
+ {
+ /* state x d 0 - */
+ /* S_N */ S_N, S_I, S_Z, S_N,
+ /* S_I */ S_N, S_I, S_I, S_I,
+ /* S_F */ S_N, S_F, S_F, S_F,
+ /* S_Z */ S_N, S_F, S_Z, S_Z
+ };
+
+ static const int result_type[] =
+ {
+ /* state x/x x/d x/0 x/- d/x d/d d/0 d/-
+ 0/x 0/d 0/0 0/- -/x -/d -/0 -/- */
+
+ /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
+ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
+ /* S_I */ CMP, -1, -1, CMP, 1, LEN, LEN, CMP,
+ 1, LEN, LEN, CMP, CMP, CMP, CMP, CMP,
+ /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
+ CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
+ /* S_Z */ CMP, 1, 1, CMP, -1, CMP, CMP, CMP,
+ -1, CMP, CMP, CMP
+ };
+
+ if (p1 == p2)
+ return 0;
+
+ c1 = *p1++;
+ c2 = *p2++;
+ /* Hint: '0' is a digit too. */
+ state = S_N | ((c1 == '0') + (ISDIGIT (c1) != 0));
+
+ while ((diff = c1 - c2) == 0 && c1 != '\0')
+ {
+ state = next_state[state];
+ c1 = *p1++;
+ c2 = *p2++;
+ state |= (c1 == '0') + (ISDIGIT (c1) != 0);
+ }
+
+ state = result_type[state << 2 | ((c2 == '0') + (ISDIGIT (c2) != 0))];
+
+ switch (state)
+ {
+ case CMP:
+ return diff;
+
+ case LEN:
+ while (ISDIGIT (*p1++))
+ if (!ISDIGIT (*p2++))
+ return 1;
+
+ return ISDIGIT (*p2) ? -1 : diff;
+
+ default:
+ return state;
+ }
+}
+#ifdef weak_alias
+weak_alias (__strverscmp, strverscmp)
+#endif
diff --git a/package/ndisc/ipkg/ndisc6.control b/package/ndisc/ipkg/ndisc6.control
new file mode 100644
index 000000000..40b935e91
--- /dev/null
+++ b/package/ndisc/ipkg/ndisc6.control
@@ -0,0 +1,4 @@
+Package: ndisc6
+Priority: optional
+Section: net
+Description: ICMPv6 Neighbour Discovery tool
diff --git a/package/ndisc/ipkg/rdisc6.control b/package/ndisc/ipkg/rdisc6.control
new file mode 100644
index 000000000..4724d6914
--- /dev/null
+++ b/package/ndisc/ipkg/rdisc6.control
@@ -0,0 +1,4 @@
+Package: rdisc6
+Priority: optional
+Section: net
+Description: ICMPv6 Router Discovery tool
diff --git a/package/ndisc/ipkg/tcptraceroute6.control b/package/ndisc/ipkg/tcptraceroute6.control
new file mode 100644
index 000000000..625fe80c1
--- /dev/null
+++ b/package/ndisc/ipkg/tcptraceroute6.control
@@ -0,0 +1,4 @@
+Package: tcptraceroute6
+Priority: optional
+Section: net
+Description: A TCP/IPv6-based traceroute implementation
diff --git a/package/ndisc/patches/patch-rdnssd_Makefile_am b/package/ndisc/patches/patch-rdnssd_Makefile_am
new file mode 100644
index 000000000..932423ecd
--- /dev/null
+++ b/package/ndisc/patches/patch-rdnssd_Makefile_am
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/rdnssd/Makefile.am 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/rdnssd/Makefile.am 2009-05-10 19:45:05.000000000 +0200
+@@ -27,7 +27,8 @@ conf_SCRIPTS = merge-hook
+ # rdnssd
+ rdnssd_SOURCES = rdnssd.c rdnssd.h \
+ icmp.c \
+- netlink.c
++ netlink.c \
++ strverscmp.c
+ rdnssd_LDADD = $(LIBRT) \
+ @top_builddir@/compat/libcompat.a
+
diff --git a/package/ndisc/patches/patch-rdnssd_Makefile_in b/package/ndisc/patches/patch-rdnssd_Makefile_in
new file mode 100644
index 000000000..125d20098
--- /dev/null
+++ b/package/ndisc/patches/patch-rdnssd_Makefile_in
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/rdnssd/Makefile.in 2008-05-01 14:52:45.000000000 +0200
++++ ndisc6-0.9.8/rdnssd/Makefile.in 2009-05-10 19:45:05.000000000 +0200
+@@ -58,7 +58,7 @@ CONFIG_CLEAN_FILES =
+ am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(confdir)"
+ sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+ PROGRAMS = $(sbin_PROGRAMS)
+-am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT)
++am_rdnssd_OBJECTS = rdnssd.$(OBJEXT) icmp.$(OBJEXT) netlink.$(OBJEXT) strverscmp.$(OBJEXT)
+ rdnssd_OBJECTS = $(am_rdnssd_OBJECTS)
+ am__DEPENDENCIES_1 =
+ rdnssd_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+@@ -211,7 +211,8 @@ conf_SCRIPTS = merge-hook
+ # rdnssd
+ rdnssd_SOURCES = rdnssd.c rdnssd.h \
+ icmp.c \
+- netlink.c
++ netlink.c \
++ strverscmp.c
+
+ rdnssd_LDADD = $(LIBRT) \
+ @top_builddir@/compat/libcompat.a
+@@ -334,6 +335,7 @@ distclean-compile:
+
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icmp.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strverscmp.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdnssd.Po@am__quote@
+
+ .c.o:
diff --git a/package/ndisc/patches/patch-rdnssd_icmp_c b/package/ndisc/patches/patch-rdnssd_icmp_c
new file mode 100644
index 000000000..78cbd8e43
--- /dev/null
+++ b/package/ndisc/patches/patch-rdnssd_icmp_c
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/rdnssd/icmp.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/rdnssd/icmp.c 2009-05-10 19:43:19.000000000 +0200
+@@ -47,6 +47,7 @@
+
+ static int icmp_recv (int fd)
+ {
++ struct cmsghdr *cmsg;
+ struct nd_router_advert icmp6;
+ uint8_t buf[65536 - sizeof (icmp6)], cbuf[CMSG_SPACE (sizeof (int))];
+ struct iovec iov[2] =
+@@ -74,7 +75,7 @@ static int icmp_recv (int fd)
+ || (icmp6.nd_ra_code != 0)) /* unknown ICMPv6 code */
+ return -1;
+
+- for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
++ for (cmsg = CMSG_FIRSTHDR (&msg);
+ cmsg != NULL;
+ cmsg = CMSG_NXTHDR (&msg, cmsg))
+ {
diff --git a/package/ndisc/patches/patch-rdnssd_rdnssd_c b/package/ndisc/patches/patch-rdnssd_rdnssd_c
new file mode 100644
index 000000000..48a261495
--- /dev/null
+++ b/package/ndisc/patches/patch-rdnssd_rdnssd_c
@@ -0,0 +1,78 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/rdnssd/rdnssd.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/rdnssd/rdnssd.c 2009-05-10 19:42:36.000000000 +0200
+@@ -76,6 +76,7 @@ static struct
+
+ static void write_resolv(const char *resolvpath)
+ {
++ size_t i;
+ FILE *resolv;
+ int rval;
+ char tmpfile[strlen(resolvpath) + sizeof(".tmp")];
+@@ -89,7 +90,7 @@ static void write_resolv(const char *res
+ return;
+ }
+
+- for (size_t i = 0; i < servers.count; i++) {
++ for (i = 0; i < servers.count; i++) {
+ char addr[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, &servers.list[i].addr, addr, INET6_ADDRSTRLEN);
+
+@@ -132,6 +133,7 @@ static int rdnss_older (const void *a, c
+ static void rdnss_update (const struct in6_addr *addr, unsigned int ifindex, time_t expiry)
+ {
+ size_t i;
++ unsigned int j;
+
+ /* Does this entry already exist? */
+ for (i = 0; i < servers.count; i++)
+@@ -165,12 +167,12 @@ static void rdnss_update (const struct i
+ qsort (servers.list, servers.count, sizeof (rdnss_t), rdnss_older);
+
+ #ifndef NDEBUG
+- for (unsigned i = 0; i < servers.count; i++)
++ for (j = 0; j < servers.count; j++)
+ {
+ char buf[INET6_ADDRSTRLEN];
+- inet_ntop (AF_INET6, &servers.list[i].addr, buf,
++ inet_ntop (AF_INET6, &servers.list[j].addr, buf,
+ sizeof (buf));
+- syslog (LOG_DEBUG, "%u: %48s expires at %u\n", i, buf,
++ syslog (LOG_DEBUG, "%u: %48s expires at %u\n", j, buf,
+ (unsigned)servers.list[i].expiry);
+ }
+ #endif
+@@ -178,6 +180,7 @@ static void rdnss_update (const struct i
+
+ int parse_nd_opts (const struct nd_opt_hdr *opt, size_t opts_len, unsigned int ifindex)
+ {
++ struct in6_addr *addr;
+ for (; opts_len >= sizeof(struct nd_opt_hdr);
+ opts_len -= opt->nd_opt_len << 3,
+ opt = (const struct nd_opt_hdr *)
+@@ -206,7 +209,7 @@ int parse_nd_opts (const struct nd_opt_h
+
+ lifetime = now + ntohl(rdnss_opt->nd_opt_rdnss_lifetime);
+
+- for (struct in6_addr *addr = (struct in6_addr *) (rdnss_opt + 1);
++ for (addr = (struct in6_addr *) (rdnss_opt + 1);
+ nd_opt_len >= 2; addr++, nd_opt_len -= 2)
+ rdnss_update(addr, ifindex, lifetime);
+
+@@ -255,6 +258,7 @@ static void ignore_handler (int signum)
+
+ static int worker (int pipe, const char *resolvpath, const char *username)
+ {
++ bool ready;
+ sigset_t emptyset;
+ int rval = 0, sock = -1;
+ const rdnss_src_t *src;
+@@ -283,7 +287,7 @@ static int worker (int pipe, const char
+
+ sigemptyset (&emptyset);
+
+- for (bool ready = false; termsig == 0;)
++ for (ready = false; termsig == 0;)
+ {
+ struct pollfd pfd =
+ { .fd = sock, .events = POLLIN, .revents = 0 };
diff --git a/package/ndisc/patches/patch-rdnssd_rdnssd_c.orig b/package/ndisc/patches/patch-rdnssd_rdnssd_c.orig
new file mode 100644
index 000000000..be06580f6
--- /dev/null
+++ b/package/ndisc/patches/patch-rdnssd_rdnssd_c.orig
@@ -0,0 +1,61 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/rdnssd/rdnssd.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/rdnssd/rdnssd.c 2009-05-10 19:41:53.000000000 +0200
+@@ -76,6 +76,7 @@ static struct
+
+ static void write_resolv(const char *resolvpath)
+ {
++ size_t i;
+ FILE *resolv;
+ int rval;
+ char tmpfile[strlen(resolvpath) + sizeof(".tmp")];
+@@ -89,7 +90,7 @@ static void write_resolv(const char *res
+ return;
+ }
+
+- for (size_t i = 0; i < servers.count; i++) {
++ for (i = 0; i < servers.count; i++) {
+ char addr[INET6_ADDRSTRLEN];
+ inet_ntop(AF_INET6, &servers.list[i].addr, addr, INET6_ADDRSTRLEN);
+
+@@ -132,6 +133,7 @@ static int rdnss_older (const void *a, c
+ static void rdnss_update (const struct in6_addr *addr, unsigned int ifindex, time_t expiry)
+ {
+ size_t i;
++ unsigned int j;
+
+ /* Does this entry already exist? */
+ for (i = 0; i < servers.count; i++)
+@@ -165,12 +167,12 @@ static void rdnss_update (const struct i
+ qsort (servers.list, servers.count, sizeof (rdnss_t), rdnss_older);
+
+ #ifndef NDEBUG
+- for (unsigned i = 0; i < servers.count; i++)
++ for (j = 0; j < servers.count; j++)
+ {
+ char buf[INET6_ADDRSTRLEN];
+- inet_ntop (AF_INET6, &servers.list[i].addr, buf,
++ inet_ntop (AF_INET6, &servers.list[j].addr, buf,
+ sizeof (buf));
+- syslog (LOG_DEBUG, "%u: %48s expires at %u\n", i, buf,
++ syslog (LOG_DEBUG, "%u: %48s expires at %u\n", j, buf,
+ (unsigned)servers.list[i].expiry);
+ }
+ #endif
+@@ -178,6 +180,7 @@ static void rdnss_update (const struct i
+
+ int parse_nd_opts (const struct nd_opt_hdr *opt, size_t opts_len, unsigned int ifindex)
+ {
++ struct in6_addr *addr;
+ for (; opts_len >= sizeof(struct nd_opt_hdr);
+ opts_len -= opt->nd_opt_len << 3,
+ opt = (const struct nd_opt_hdr *)
+@@ -206,7 +209,7 @@ int parse_nd_opts (const struct nd_opt_h
+
+ lifetime = now + ntohl(rdnss_opt->nd_opt_rdnss_lifetime);
+
+- for (struct in6_addr *addr = (struct in6_addr *) (rdnss_opt + 1);
++ for (addr = (struct in6_addr *) (rdnss_opt + 1);
+ nd_opt_len >= 2; addr++, nd_opt_len -= 2)
+ rdnss_update(addr, ifindex, lifetime);
+
diff --git a/package/ndisc/patches/patch-src_addrinfo_c b/package/ndisc/patches/patch-src_addrinfo_c
new file mode 100644
index 000000000..74dbe928d
--- /dev/null
+++ b/package/ndisc/patches/patch-src_addrinfo_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/addrinfo.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/addrinfo.c 2009-05-10 19:14:46.000000000 +0200
+@@ -53,7 +53,7 @@ gai_perror (int errval, const char *msg)
+ static int
+ printnames (const char *name, int family, int aflags, int nflags, bool single)
+ {
+- struct addrinfo hints, *res;
++ struct addrinfo hints, *res, *ptr;
+
+ memset (&hints, 0, sizeof (hints));
+ hints.ai_family = family;
+@@ -67,7 +67,7 @@ printnames (const char *name, int family
+ return -1;
+ }
+
+- for (struct addrinfo *ptr = res; ptr != NULL; ptr = ptr->ai_next)
++ for (ptr = res; ptr != NULL; ptr = ptr->ai_next)
+ {
+ char hostname[NI_MAXHOST];
+
diff --git a/package/ndisc/patches/patch-src_ndisc_c b/package/ndisc/patches/patch-src_ndisc_c
new file mode 100644
index 000000000..af3abf1d3
--- /dev/null
+++ b/package/ndisc/patches/patch-src_ndisc_c
@@ -0,0 +1,35 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/ndisc.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/ndisc.c 2009-05-10 19:16:53.000000000 +0200
+@@ -375,12 +375,13 @@ parseroute (const uint8_t *opt)
+ static int
+ parserdnss (const uint8_t *opt)
+ {
++ unsigned int i;
+ uint8_t optlen = opt[1];
+ if (((optlen & 1) == 0) || (optlen < 3))
+ return -1;
+
+ optlen /= 2;
+- for (unsigned i = 0; i < optlen; i++)
++ for (i = 0; i < optlen; i++)
+ {
+ char str[INET6_ADDRSTRLEN];
+
+@@ -521,6 +522,7 @@ static ssize_t
+ recvfromLL (int fd, void *buf, size_t len, int flags,
+ struct sockaddr_in6 *addr)
+ {
++ struct cmsghdr *cmsg;
+ char cbuf[CMSG_SPACE (sizeof (int))];
+ struct iovec iov =
+ {
+@@ -542,7 +544,7 @@ recvfromLL (int fd, void *buf, size_t le
+ return val;
+
+ /* ensures the hop limit is 255 */
+- for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&hdr);
++ for (cmsg = CMSG_FIRSTHDR (&hdr);
+ cmsg != NULL;
+ cmsg = CMSG_NXTHDR (&hdr, cmsg))
+ {
diff --git a/package/ndisc/patches/patch-src_ndisc_c.orig b/package/ndisc/patches/patch-src_ndisc_c.orig
new file mode 100644
index 000000000..8bc600948
--- /dev/null
+++ b/package/ndisc/patches/patch-src_ndisc_c.orig
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/ndisc.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/ndisc.c 2009-05-10 19:16:18.000000000 +0200
+@@ -521,6 +521,7 @@ static ssize_t
+ recvfromLL (int fd, void *buf, size_t len, int flags,
+ struct sockaddr_in6 *addr)
+ {
++ struct cmsghdr *cmsg;
+ char cbuf[CMSG_SPACE (sizeof (int))];
+ struct iovec iov =
+ {
+@@ -542,7 +543,7 @@ recvfromLL (int fd, void *buf, size_t le
+ return val;
+
+ /* ensures the hop limit is 255 */
+- for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&hdr);
++ for (cmsg = CMSG_FIRSTHDR (&hdr);
+ cmsg != NULL;
+ cmsg = CMSG_NXTHDR (&hdr, cmsg))
+ {
diff --git a/package/ndisc/patches/patch-src_tcpspray_c b/package/ndisc/patches/patch-src_tcpspray_c
new file mode 100644
index 000000000..9ac8bad90
--- /dev/null
+++ b/package/ndisc/patches/patch-src_tcpspray_c
@@ -0,0 +1,48 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/tcpspray.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/tcpspray.c 2009-05-10 19:13:52.000000000 +0200
+@@ -60,7 +60,7 @@ static unsigned verbose = 0;
+
+ static int tcpconnect (const char *host, const char *serv)
+ {
+- struct addrinfo hints, *res;
++ struct addrinfo hints, *res, *p;
+
+ memset (&hints, 0, sizeof (hints));
+ hints.ai_family = family;
+@@ -78,7 +78,7 @@ static int tcpconnect (const char *host,
+
+ val = -1;
+
+- for (struct addrinfo *p = res; (p != NULL) && (val == -1); p = p->ai_next)
++ for (p = res; (p != NULL) && (val == -1); p = p->ai_next)
+ {
+ val = socket (p->ai_family, p->ai_socktype, p->ai_protocol);
+ if (val == -1)
+@@ -127,6 +127,8 @@ static int
+ tcpspray (const char *host, const char *serv, unsigned long n, size_t blen,
+ unsigned delay_us, const char *fillname, bool echo)
+ {
++ unsigned int i, j;
++
+ if (serv == NULL)
+ serv = echo ? "echo" : "discard";
+
+@@ -172,7 +174,7 @@ tcpspray (const char *host, const char *
+ switch (child)
+ {
+ case 0:
+- for (unsigned i = 0; i < n; i++)
++ for (i = 0; i < n; i++)
+ {
+ ssize_t val = recv (fd, block, blen, MSG_WAITALL);
+ if (val != (ssize_t)blen)
+@@ -208,7 +210,7 @@ tcpspray (const char *host, const char *
+ struct timespec start, end;
+ mono_gettime (&start);
+
+- for (unsigned i = 0; i < n; i++)
++ for (j = 0; j < n; j++)
+ {
+ ssize_t val = write (fd, block, blen);
+ if (val != (ssize_t)blen)
diff --git a/package/ndisc/patches/patch-src_tcpspray_c.orig b/package/ndisc/patches/patch-src_tcpspray_c.orig
new file mode 100644
index 000000000..15106ea1c
--- /dev/null
+++ b/package/ndisc/patches/patch-src_tcpspray_c.orig
@@ -0,0 +1,31 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/tcpspray.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/tcpspray.c 2009-05-10 19:11:15.000000000 +0200
+@@ -60,7 +60,7 @@ static unsigned verbose = 0;
+
+ static int tcpconnect (const char *host, const char *serv)
+ {
+- struct addrinfo hints, *res;
++ struct addrinfo hints, *res, *p;
+
+ memset (&hints, 0, sizeof (hints));
+ hints.ai_family = family;
+@@ -78,7 +78,7 @@ static int tcpconnect (const char *host,
+
+ val = -1;
+
+- for (struct addrinfo *p = res; (p != NULL) && (val == -1); p = p->ai_next)
++ for (p = res; (p != NULL) && (val == -1); p = p->ai_next)
+ {
+ val = socket (p->ai_family, p->ai_socktype, p->ai_protocol);
+ if (val == -1)
+@@ -172,7 +172,8 @@ tcpspray (const char *host, const char *
+ switch (child)
+ {
+ case 0:
+- for (unsigned i = 0; i < n; i++)
++ unsigned int i;
++ for (i = 0; i < n; i++)
+ {
+ ssize_t val = recv (fd, block, blen, MSG_WAITALL);
+ if (val != (ssize_t)blen)
diff --git a/package/ndisc/patches/patch-src_tcptraceroute_c b/package/ndisc/patches/patch-src_tcptraceroute_c
new file mode 100644
index 000000000..584f46472
--- /dev/null
+++ b/package/ndisc/patches/patch-src_tcptraceroute_c
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/tcptraceroute.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/tcptraceroute.c 2009-05-10 19:15:28.000000000 +0200
+@@ -114,6 +114,7 @@ static const char bin_name[] = RLTRACERO
+
+ int main (int argc, char *argv[])
+ {
++ int i;
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+@@ -130,7 +131,7 @@ int main (int argc, char *argv[])
+
+ /* Prepare big enough buffers */
+ unsigned len = 0;
+- for (int i = 1; i < argc; i++)
++ for (i = 1; i < argc; i++)
+ len += strlen (argv[i]);
+
+ char optbuf[3 * len + argc], *buf = optbuf;
diff --git a/package/ndisc/patches/patch-src_trace-tcp_c b/package/ndisc/patches/patch-src_trace-tcp_c
new file mode 100644
index 000000000..071b6d437
--- /dev/null
+++ b/package/ndisc/patches/patch-src_trace-tcp_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/trace-tcp.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/trace-tcp.c 2009-05-10 19:38:11.000000000 +0200
+@@ -24,6 +24,7 @@
+
+ #undef _GNU_SOURCE
+ #define _BSD_SOURCE 1
++#define __FAVOR_BSD 1
+
+ #include <string.h>
+ #include <inttypes.h>
diff --git a/package/ndisc/patches/patch-src_trace-udp_c b/package/ndisc/patches/patch-src_trace-udp_c
new file mode 100644
index 000000000..5c8c52bb8
--- /dev/null
+++ b/package/ndisc/patches/patch-src_trace-udp_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/trace-udp.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/trace-udp.c 2009-05-10 19:38:18.000000000 +0200
+@@ -24,6 +24,7 @@
+
+ #undef _GNU_SOURCE
+ #define _BSD_SOURCE 1
++#define __FAVOR_BSD 1
+
+ #include <string.h>
+ #include <stdbool.h>
diff --git a/package/ndisc/patches/patch-src_traceroute_c b/package/ndisc/patches/patch-src_traceroute_c
new file mode 100644
index 000000000..c98acfc20
--- /dev/null
+++ b/package/ndisc/patches/patch-src_traceroute_c
@@ -0,0 +1,128 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/traceroute.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/traceroute.c 2009-05-10 19:31:06.000000000 +0200
+@@ -149,6 +149,7 @@ static ssize_t
+ recv_payload (int fd, void *buf, size_t len,
+ struct sockaddr_in6 *addr, int *hlim)
+ {
++ struct cmsghdr *cmsg;
+ char cbuf[CMSG_SPACE (sizeof (int))];
+ struct iovec iov =
+ {
+@@ -170,7 +171,7 @@ recv_payload (int fd, void *buf, size_t
+ return val;
+
+ /* ensures the hop limit is 255 */
+- for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&hdr);
++ for (cmsg = CMSG_FIRSTHDR (&hdr);
+ cmsg != NULL;
+ cmsg = CMSG_NXTHDR (&hdr, cmsg))
+ if ((cmsg->cmsg_level == IPPROTO_IPV6)
+@@ -625,14 +626,16 @@ static void
+ display (const tracetest_t *tab, unsigned min_ttl, unsigned max_ttl,
+ unsigned retries)
+ {
+- for (unsigned ttl = min_ttl; ttl <= max_ttl; ttl++)
++ unsigned int ttl, col;
++
++ for (ttl = min_ttl; ttl <= max_ttl; ttl++)
+ {
+ struct sockaddr_in6 hop = { .sin6_family = AF_UNSPEC };
+ const tracetest_t *line = tab + retries * (ttl - min_ttl);
+
+ printf ("%2d ", ttl);
+
+- for (unsigned col = 0; col < retries; col++)
++ for (col = 0; col < retries; col++)
+ {
+ const tracetest_t *test = line + col;
+ if (test->result == TRACE_TIMEOUT)
+@@ -821,6 +824,7 @@ static void setup_socket (int fd)
+
+ static int setsock_rth (int fd, int type, const char **segv, int segc)
+ {
++ int i;
+ uint8_t hdr[inet6_rth_space (type, segc)];
+ inet6_rth_init (hdr, sizeof (hdr), type, segc);
+
+@@ -829,7 +833,7 @@ static int setsock_rth (int fd, int type
+ hints.ai_family = AF_INET6;
+ hints.ai_flags = AI_IDN;
+
+- for (int i = 0; i < segc; i++)
++ for (i = 0; i < segc; i++)
+ {
+ struct addrinfo *res;
+
+@@ -868,7 +872,8 @@ static struct
+
+ static int prepare_sockets (void)
+ {
+- for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
++ unsigned int i;
++ for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
+ {
+ protofd[i].fd = socket (AF_INET6, SOCK_RAW, protofd[i].protocol);
+ if (protofd[i].fd == -1)
+@@ -883,8 +888,9 @@ static int prepare_sockets (void)
+
+ static int get_socket (int protocol)
+ {
++ unsigned int i;
+ errno = EPROTONOSUPPORT;
+- for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
++ for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
+ if (protofd[i].protocol == protocol)
+ {
+ int fd = protofd[i].fd;
+@@ -902,7 +908,8 @@ static int get_socket (int protocol)
+
+ static void drop_sockets (void)
+ {
+- for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
++ unsigned int i;
++ for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
+ if (protofd[i].fd != -1)
+ close (protofd[i].fd);
+ }
+@@ -914,6 +921,8 @@ traceroute (const char *dsthost, const c
+ unsigned timeout, unsigned delay, unsigned retries,
+ size_t packet_len, int min_ttl, int max_ttl)
+ {
++ unsigned int i, j, step, progress;
++
+ /* Creates ICMPv6 socket to collect error packets */
+ int icmpfd = get_socket (IPPROTO_ICMPV6);
+ if (icmpfd == -1)
+@@ -1020,7 +1029,7 @@ traceroute (const char *dsthost, const c
+ .filter = f,
+ };
+
+- for (unsigned i = 0; i < 4; i++)
++ for (i = 0; i < 4; i++)
+ {
+ /* A = icmp->ip6_dst.s6_addr32[i]; */
+ pc->code = BPF_LD + BPF_W + BPF_ABS;
+@@ -1076,7 +1085,7 @@ traceroute (const char *dsthost, const c
+ tracetest_t tab[(1 + max_ttl - min_ttl) * retries];
+ memset (tab, 0, sizeof (tab));
+
+- for (unsigned step = 1, progress = 0;
++ for (step = 1, progress = 0;
+ step < (1 + max_ttl - min_ttl) + retries;
+ step++)
+ {
+@@ -1093,10 +1102,10 @@ traceroute (const char *dsthost, const c
+ mono_nanosleep (&delay_ts);
+
+ /* Sends requests */
+- for (unsigned i = 0; i < retries; i++)
++ for (j = 0; j < retries; j++)
+ {
+- int attempt = (retries - 1) - i;
+- int hlim = min_ttl + step + i - retries;
++ int attempt = (retries - 1) - j;
++ int hlim = min_ttl + step + j - retries;
+
+ if ((hlim > max_ttl) || (hlim < min_ttl))
+ continue;
diff --git a/package/ndisc/patches/patch-src_traceroute_c.orig b/package/ndisc/patches/patch-src_traceroute_c.orig
new file mode 100644
index 000000000..a7ff0cd44
--- /dev/null
+++ b/package/ndisc/patches/patch-src_traceroute_c.orig
@@ -0,0 +1,128 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/traceroute.c 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/traceroute.c 2009-05-10 19:29:37.000000000 +0200
+@@ -149,6 +149,7 @@ static ssize_t
+ recv_payload (int fd, void *buf, size_t len,
+ struct sockaddr_in6 *addr, int *hlim)
+ {
++ struct cmsghdr *cmsg;
+ char cbuf[CMSG_SPACE (sizeof (int))];
+ struct iovec iov =
+ {
+@@ -170,7 +171,7 @@ recv_payload (int fd, void *buf, size_t
+ return val;
+
+ /* ensures the hop limit is 255 */
+- for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&hdr);
++ for (cmsg = CMSG_FIRSTHDR (&hdr);
+ cmsg != NULL;
+ cmsg = CMSG_NXTHDR (&hdr, cmsg))
+ if ((cmsg->cmsg_level == IPPROTO_IPV6)
+@@ -625,14 +626,16 @@ static void
+ display (const tracetest_t *tab, unsigned min_ttl, unsigned max_ttl,
+ unsigned retries)
+ {
+- for (unsigned ttl = min_ttl; ttl <= max_ttl; ttl++)
++ unsigned int ttl, col;
++
++ for (ttl = min_ttl; ttl <= max_ttl; ttl++)
+ {
+ struct sockaddr_in6 hop = { .sin6_family = AF_UNSPEC };
+ const tracetest_t *line = tab + retries * (ttl - min_ttl);
+
+ printf ("%2d ", ttl);
+
+- for (unsigned col = 0; col < retries; col++)
++ for (col = 0; col < retries; col++)
+ {
+ const tracetest_t *test = line + col;
+ if (test->result == TRACE_TIMEOUT)
+@@ -821,6 +824,7 @@ static void setup_socket (int fd)
+
+ static int setsock_rth (int fd, int type, const char **segv, int segc)
+ {
++ int i;
+ uint8_t hdr[inet6_rth_space (type, segc)];
+ inet6_rth_init (hdr, sizeof (hdr), type, segc);
+
+@@ -829,7 +833,7 @@ static int setsock_rth (int fd, int type
+ hints.ai_family = AF_INET6;
+ hints.ai_flags = AI_IDN;
+
+- for (int i = 0; i < segc; i++)
++ for (i = 0; i < segc; i++)
+ {
+ struct addrinfo *res;
+
+@@ -868,7 +872,8 @@ static struct
+
+ static int prepare_sockets (void)
+ {
+- for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
++ unsigned int i;
++ for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
+ {
+ protofd[i].fd = socket (AF_INET6, SOCK_RAW, protofd[i].protocol);
+ if (protofd[i].fd == -1)
+@@ -883,8 +888,9 @@ static int prepare_sockets (void)
+
+ static int get_socket (int protocol)
+ {
++ unsigned int i;
+ errno = EPROTONOSUPPORT;
+- for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
++ for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
+ if (protofd[i].protocol == protocol)
+ {
+ int fd = protofd[i].fd;
+@@ -902,7 +908,8 @@ static int get_socket (int protocol)
+
+ static void drop_sockets (void)
+ {
+- for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
++ unsigned int i;
++ for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
+ if (protofd[i].fd != -1)
+ close (protofd[i].fd);
+ }
+@@ -914,6 +921,8 @@ traceroute (const char *dsthost, const c
+ unsigned timeout, unsigned delay, unsigned retries,
+ size_t packet_len, int min_ttl, int max_ttl)
+ {
++ unsigned int i, j, step;
++
+ /* Creates ICMPv6 socket to collect error packets */
+ int icmpfd = get_socket (IPPROTO_ICMPV6);
+ if (icmpfd == -1)
+@@ -1020,7 +1029,7 @@ traceroute (const char *dsthost, const c
+ .filter = f,
+ };
+
+- for (unsigned i = 0; i < 4; i++)
++ for (i = 0; i < 4; i++)
+ {
+ /* A = icmp->ip6_dst.s6_addr32[i]; */
+ pc->code = BPF_LD + BPF_W + BPF_ABS;
+@@ -1076,7 +1085,7 @@ traceroute (const char *dsthost, const c
+ tracetest_t tab[(1 + max_ttl - min_ttl) * retries];
+ memset (tab, 0, sizeof (tab));
+
+- for (unsigned step = 1, progress = 0;
++ for (step = 1, progress = 0;
+ step < (1 + max_ttl - min_ttl) + retries;
+ step++)
+ {
+@@ -1093,10 +1102,10 @@ traceroute (const char *dsthost, const c
+ mono_nanosleep (&delay_ts);
+
+ /* Sends requests */
+- for (unsigned i = 0; i < retries; i++)
++ for (j = 0; j < retries; j++)
+ {
+- int attempt = (retries - 1) - i;
+- int hlim = min_ttl + step + i - retries;
++ int attempt = (retries - 1) - j;
++ int hlim = min_ttl + step + j - retries;
+
+ if ((hlim > max_ttl) || (hlim < min_ttl))
+ continue;
diff --git a/package/ndisc/patches/patch-src_traceroute_h b/package/ndisc/patches/patch-src_traceroute_h
new file mode 100644
index 000000000..d47efc0c3
--- /dev/null
+++ b/package/ndisc/patches/patch-src_traceroute_h
@@ -0,0 +1,26 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/traceroute.h 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/traceroute.h 2009-05-10 19:23:51.000000000 +0200
+@@ -24,9 +24,9 @@
+ typedef ssize_t (*trace_send_t) (int fd, unsigned ttl, unsigned n,
+ size_t plen, uint16_t port);
+
+-typedef ssize_t (*trace_parser_t) (const void *restrict data, size_t len,
+- int *restrict ttl,
+- unsigned *restrict n, uint16_t port);
++typedef ssize_t (*trace_parser_t) (const data, size_t len,
++ int ttl,
++ unsigned n, uint16_t port);
+
+ typedef struct tracetype
+ {
+@@ -34,7 +34,8 @@ typedef struct tracetype
+ int protocol;
+ int checksum_offset;
+ trace_send_t send_probe;
+- trace_parser_t parse_resp, parse_err;
++ trace_parser_t parse_resp;
++ trace_parser_t parse_err;
+ } tracetype;
+
+ # ifdef __cplusplus
diff --git a/package/ndisc/patches/patch-src_traceroute_h.orig b/package/ndisc/patches/patch-src_traceroute_h.orig
new file mode 100644
index 000000000..48da9765a
--- /dev/null
+++ b/package/ndisc/patches/patch-src_traceroute_h.orig
@@ -0,0 +1,26 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ndisc6-0.9.8.orig/src/traceroute.h 2008-05-01 14:52:28.000000000 +0200
++++ ndisc6-0.9.8/src/traceroute.h 2009-05-10 19:23:18.000000000 +0200
+@@ -24,9 +24,9 @@
+ typedef ssize_t (*trace_send_t) (int fd, unsigned ttl, unsigned n,
+ size_t plen, uint16_t port);
+
+-typedef ssize_t (*trace_parser_t) (const void *restrict data, size_t len,
+- int *restrict ttl,
+- unsigned *restrict n, uint16_t port);
++typedef ssize_t (*trace_parser_t) (const void data, size_t len,
++ int ttl,
++ unsigned n, uint16_t port);
+
+ typedef struct tracetype
+ {
+@@ -34,7 +34,8 @@ typedef struct tracetype
+ int protocol;
+ int checksum_offset;
+ trace_send_t send_probe;
+- trace_parser_t parse_resp, parse_err;
++ trace_parser_t parse_resp;
++ trace_parser_t parse_err;
+ } tracetype;
+
+ # ifdef __cplusplus
diff --git a/package/neon/Config.in b/package/neon/Config.in
new file mode 100644
index 000000000..70609f89f
--- /dev/null
+++ b/package/neon/Config.in
@@ -0,0 +1,31 @@
+config ADK_PACKAGE_NEON
+ prompt "neon.............................. an HTTP and WebDAV client library"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBXML2
+ select ADK_PACKAGE_ZLIB
+ help
+ neon is an HTTP and WebDAV client library, with a C interface.
+
+ Featuring:
+
+ * High-level interface to HTTP and WebDAV methods (PUT, GET,
+ HEAD etc)
+ * Low-level interface to HTTP request handling, to allow
+ implementing new methods easily.
+ * persistent connections
+ * RFC2617 basic and digest authentication (including auth-int,
+ md5-sess)
+ * Proxy support (including basic/digest authentication)
+ * SSL/TLS support using OpenSSL (including client certificate
+ support)
+ * Generic WebDAV 207 XML response handling mechanism
+ * XML parsing using the expat or libxml parsers
+ * Easy generation of error messages from 207 error responses
+ * WebDAV resource manipulation: MOVE, COPY, DELETE, MKCOL.
+ * WebDAV metadata support: set and remove properties, query any
+ set of properties (PROPPATCH/PROPFIND).
+ * autoconf macros supplied for easily embedding neon directly
+ inside an application source tree.
diff --git a/package/neon/Makefile b/package/neon/Makefile
new file mode 100644
index 000000000..ffd9da574
--- /dev/null
+++ b/package/neon/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= neon
+PKG_VERSION= 0.28.4
+PKG_RELEASE= 1
+PKG_MD5SUM= 6c3b94362af743d046e198e9fcbe4a85
+MASTER_SITES= http://webdav.org/neon/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NEON,neon,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-ssl=openssl \
+ --without-gssapi \
+ --with-libxml2
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_NEON}/usr/lib
+ $(CP) ${WRKINST}/usr/lib/lib*.so.* ${IDIR_NEON}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/neon/ipkg/neon.control b/package/neon/ipkg/neon.control
new file mode 100644
index 000000000..c23c17a53
--- /dev/null
+++ b/package/neon/ipkg/neon.control
@@ -0,0 +1,5 @@
+Package: neon
+Priority: optional
+Section: admin
+Depends: libpthread, libxml2, openssl, zlib
+Description: HTTP and WebDAV library
diff --git a/package/net-snmp/Config.in b/package/net-snmp/Config.in
new file mode 100644
index 000000000..08c28f508
--- /dev/null
+++ b/package/net-snmp/Config.in
@@ -0,0 +1,52 @@
+config ADK_COMPILE_NET_SNMP
+ bool
+ default n
+
+config ADK_PACKAGE_LIBNETSNMP
+ prompt "net-snmp-libs..................... SNMP shared libraries"
+ tristate
+ default n
+ select ADK_COMPILE_NET_SNMP
+ select ADK_PACKAGE_LIBELF
+ help
+ Simple Network Management Protocol (SNMP) is a widely used
+ protocol for monitoring the health and welfare of network
+ equipment (eg. routers), computer equipment and even devices
+ like UPSs. Net-SNMP is a suite of applications used to implement
+ SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.
+
+ http://www.net-snmp.org/
+
+ This package contains shared libraries, needed by other programs.
+
+config ADK_PACKAGE_SNMP_UTILS
+ prompt "net-snmp-utils.................... SNMP client utilities"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNETSNMP
+ help
+ Simple Network Management Protocol (SNMP) is a widely used
+ protocol for monitoring the health and welfare of network
+ equipment (eg. routers), computer equipment and even devices
+ like UPSs. Net-SNMP is a suite of applications used to implement
+ SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.
+
+ http://www.net-snmp.org/
+
+ This package contains the SNMP client utilities.
+
+config ADK_PACKAGE_SNMPD
+ prompt "net-snmp-daemon................... SNMP agent"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNETSNMP
+ help
+ Simple Network Management Protocol (SNMP) is a widely used
+ protocol for monitoring the health and welfare of network
+ equipment (eg. routers), computer equipment and even devices
+ like UPSs. Net-SNMP is a suite of applications used to implement
+ SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6.
+
+ http://www.net-snmp.org/
+
+ This package contains the SNMP agent, dynamically linked.
diff --git a/package/net-snmp/Makefile b/package/net-snmp/Makefile
new file mode 100644
index 000000000..03ba15519
--- /dev/null
+++ b/package/net-snmp/Makefile
@@ -0,0 +1,117 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= net-snmp
+PKG_VERSION:= 5.4.2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 984932520143f0c8bf7b7ce1fc9e1da1
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=net-snmp/}
+
+SNMP_MIB_MODULES_INCLUDED = \
+ host/hr_device \
+ host/hr_disk \
+ host/hr_filesys \
+ host/hr_network \
+ host/hr_partition \
+ host/hr_proc \
+ host/hr_storage \
+ host/hr_system \
+ mibII/at \
+ mibII/icmp \
+ mibII/ip \
+ mibII/snmp_mib \
+ mibII/sysORTable \
+ mibII/system_mib \
+ mibII/tcp \
+ mibII/udp \
+ mibII/vacm_context \
+ mibII/vacm_vars \
+ snmpv3/snmpEngine \
+ snmpv3/snmpMPDStats \
+ snmpv3/usmStats \
+ snmpv3/usmUser \
+ snmpv3mibs \
+ tunnel \
+ ucd-snmp/disk \
+ ucd-snmp/dlmod \
+ ucd-snmp/extensible \
+ ucd-snmp/loadave \
+ ucd-snmp/memory \
+ ucd-snmp/pass \
+ ucd-snmp/proc \
+ ucd-snmp/vmstat \
+ util_funcs \
+ utilities/execute \
+
+SNMP_MIB_MODULES_EXCLUDED = \
+ mibII/interfaces \
+ if-mib \
+ agent_mibs \
+ agentx \
+ host \
+ ieee802dot11 \
+ mibII \
+ notification \
+ notification-log-mib \
+ notification/snmpNotifyTable \
+ target \
+ ucd_snmp \
+ utilities \
+
+SNMP_TRANSPORTS_INCLUDED= Callback UDP
+
+SNMP_TRANSPORTS_EXCLUDED= TCP TCPv6 UDPv6 Unix
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBNETSNMP,libnetsnmp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SNMPD,snmpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SNMP_UTILS,snmp-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_header_pcap_h=no
+CONFIGURE_ARGS+= --with-endianness=little \
+ --with-logfile=/var/log/snmpd.log \
+ --with-persistent-directory=/usr/lib/snmp/ \
+ --with-default-snmp-version=3 \
+ --with-sys-contact=root@localhost \
+ --with-sys-location=Unknown \
+ --enable-applications \
+ --disable-debugging \
+ --disable-manuals \
+ --disable-mib-loading \
+ --disable-mibs \
+ --disable-scripts \
+ --with-out-mib-modules="${SNMP_MIB_MODULES_EXCLUDED}" \
+ --with-mib-modules="${SNMP_MIB_MODULES_INCLUDED}" \
+ --with-out-transports="${SNMP_TRANSPORTS_EXCLUDED}" \
+ --with-transports="${SNMP_TRANSPORTS_INCLUDED}" \
+ --without-opaque-special-types \
+ --without-openssl \
+ --without-libwrap \
+ --without-rpm \
+ --without-zlib
+ifneq ($(ADK_IPV6),y)
+CONFIGURE_ARGS+= --disable-ipv6
+endif
+BUILD_STYLE:= auto
+INSTALL_STYLE:= confprog auto
+FAKE_FLAGS+= INSTALL_PREFIX="${WRKINST}"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBNETSNMP}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libnetsnmp.so* ${IDIR_LIBNETSNMP}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_SNMPD}/etc/snmp
+ ${INSTALL_DIR} ${IDIR_SNMPD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_SNMPD}/usr/sbin
+ ${INSTALL_DATA} ./files/snmpd.conf ${IDIR_SNMPD}/etc/snmp/snmpd.conf
+ ${INSTALL_BIN} ./files/snmpd.init ${IDIR_SNMPD}/etc/init.d/snmpd
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/snmpd ${IDIR_SNMPD}/usr/sbin/snmpd
+ ${INSTALL_DIR} ${IDIR_SNMP_UTILS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/snmp{get,set,status,test,trap,walk} ${IDIR_SNMP_UTILS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/net-snmp/files/snmpd.conf b/package/net-snmp/files/snmpd.conf
new file mode 100644
index 000000000..f6e872ab6
--- /dev/null
+++ b/package/net-snmp/files/snmpd.conf
@@ -0,0 +1,14 @@
+com2sec ro default public
+com2sec rw localhost private
+
+group public v1 ro
+group public v2c ro
+group public usm ro
+group private v1 rw
+group private v2c rw
+group private usm rw
+
+view all included .1
+
+access public "" any noauth exact all none none
+access private "" any noauth exact all all all
diff --git a/package/net-snmp/files/snmpd.default b/package/net-snmp/files/snmpd.default
new file mode 100644
index 000000000..758c8e44f
--- /dev/null
+++ b/package/net-snmp/files/snmpd.default
@@ -0,0 +1 @@
+OPTIONS="-Lf /dev/null -p /var/run/snmpd.pid"
diff --git a/package/net-snmp/files/snmpd.init b/package/net-snmp/files/snmpd.init
new file mode 100644
index 000000000..71cf6c597
--- /dev/null
+++ b/package/net-snmp/files/snmpd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $snmpd_flags = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/lib/snmp ] || mkdir -p /var/lib/snmp
+ snmpd $snmpd_flags
+ ;;
+stop)
+ killall snmpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/net-snmp/ipkg/libnetsnmp.control b/package/net-snmp/ipkg/libnetsnmp.control
new file mode 100644
index 000000000..7a28ef887
--- /dev/null
+++ b/package/net-snmp/ipkg/libnetsnmp.control
@@ -0,0 +1,4 @@
+Package: libnetsnmp
+Priority: optional
+Section: libs
+Description: SNMP shared libraries
diff --git a/package/net-snmp/ipkg/snmp-utils.control b/package/net-snmp/ipkg/snmp-utils.control
new file mode 100644
index 000000000..42d9251c8
--- /dev/null
+++ b/package/net-snmp/ipkg/snmp-utils.control
@@ -0,0 +1,5 @@
+Package: snmp-utils
+Priority: optional
+Section: admin
+Description: SNMP client utilities
+Depends: libnetsnmp, libelf
diff --git a/package/net-snmp/ipkg/snmpd.conffiles b/package/net-snmp/ipkg/snmpd.conffiles
new file mode 100644
index 000000000..121a94479
--- /dev/null
+++ b/package/net-snmp/ipkg/snmpd.conffiles
@@ -0,0 +1 @@
+/etc/snmp/snmpd.conf
diff --git a/package/net-snmp/ipkg/snmpd.control b/package/net-snmp/ipkg/snmpd.control
new file mode 100644
index 000000000..986b19631
--- /dev/null
+++ b/package/net-snmp/ipkg/snmpd.control
@@ -0,0 +1,5 @@
+Package: snmpd
+Priority: optional
+Section: admin
+Description: SNMP agent
+Depends: libnetsnmp, libelf
diff --git a/package/net-snmp/ipkg/snmpd.postinst b/package/net-snmp/ipkg/snmpd.postinst
new file mode 100644
index 000000000..3f053bd5d
--- /dev/null
+++ b/package/net-snmp/ipkg/snmpd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf 'e.g. "-Lf /dev/null -p /var/run/snmpd.pid"' snmpd_flags
diff --git a/package/netperf/Config.in b/package/netperf/Config.in
new file mode 100644
index 000000000..54b96db58
--- /dev/null
+++ b/package/netperf/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_NETPERF
+ prompt "netperf........................... network performance measurement tool"
+ tristate
+ default n
+ help
+ Program and service to do network performance measurement.
diff --git a/package/netperf/Makefile b/package/netperf/Makefile
new file mode 100644
index 000000000..6563c60e1
--- /dev/null
+++ b/package/netperf/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= netperf
+PKG_VERSION:= 2.3pl1
+PKG_RELEASE:= 8
+PKG_MD5SUM:= b74314d78af31cb13516fb9a372d2e86
+MASTER_SITES:= ftp://ftp.netperf.org/netperf/archive/ \
+ ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NETPERF,netperf,${PKG_VERSION}${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= TARGET_NETPERF_HOME="/etc/netperf.conf" \
+ TARGET_CC=${TARGET_CROSS}gcc \
+ TARGET_CFLAGS="${TCFLAGS}" \
+ TARGET_LIBS=""
+MAKE_FILE:= makefile
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_NETPERF}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_NETPERF}/usr/bin
+ ${INSTALL_BIN} ./files/netserver.init \
+ ${IDIR_NETPERF}/etc/init.d/netserver
+ ${INSTALL_BIN} ${WRKBUILD}/netperf ${IDIR_NETPERF}/usr/bin/
+ ${INSTALL_BIN} ${WRKBUILD}/netserver ${IDIR_NETPERF}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/netperf/files/netserver.init b/package/netperf/files/netserver.init
new file mode 100644
index 000000000..36a18de81
--- /dev/null
+++ b/package/netperf/files/netserver.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${netserver:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ netserver
+ ;;
+stop)
+ killall netserver
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/netperf/ipkg/netperf.control b/package/netperf/ipkg/netperf.control
new file mode 100644
index 000000000..254f28a66
--- /dev/null
+++ b/package/netperf/ipkg/netperf.control
@@ -0,0 +1,4 @@
+Package: netperf
+Priority: optional
+Section: net
+Description: Program and service to do network performance measurement.
diff --git a/package/netperf/ipkg/netperf.postinst b/package/netperf/ipkg/netperf.postinst
new file mode 100644
index 000000000..36ef9c140
--- /dev/null
+++ b/package/netperf/ipkg/netperf.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf netserver netserver NO
diff --git a/package/netperf/patches/01-netperf-2.3pl1-openwrt.patch b/package/netperf/patches/01-netperf-2.3pl1-openwrt.patch
new file mode 100644
index 000000000..b83ca1167
--- /dev/null
+++ b/package/netperf/patches/01-netperf-2.3pl1-openwrt.patch
@@ -0,0 +1,39 @@
+--- netperf-2.3pl1.orig/makefile 2004-09-21 23:33:40.000000000 +0200
++++ netperf-2.3pl1/makefile 2005-12-30 15:35:08.924238576 +0100
+@@ -15,8 +15,7 @@
+ # for the rest of the world, it is probably better to put the binaries
+ # in /usr/local/netperf or /opt/netperf
+ #
+-#NETPERF_HOME = /usr/local/netperf
+-NETPERF_HOME = /opt/netperf
++NETPERF_HOME = $(TARGET_NETPERF_HOME)
+
+ # The compiler on your system might be somewhere else, and/or have
+ # a different name.
+@@ -40,7 +39,7 @@
+ # You may safely ignore that warning.
+ #
+
+-CC = cc
++CC = $(TARGET_CC)
+
+ # Adding flags to CFLAGS enables some non-mainline features. For
+ # more information, please consult the source code.
+@@ -113,7 +112,7 @@
+ # netserver via the netperf command line with -T
+
+ LOG_FILE=DEBUG_LOG_FILE="\"/tmp/netperf.debug\""
+-CFLAGS = -O -D$(LOG_FILE) -DNEED_MAKEFILE_EDIT
++CFLAGS = -D$(LOG_FILE) $(TARGET_CFLAGS)
+
+ # Some platforms, and some options, require additional libraries.
+ # you can add to the "LIBS =" line to accomplish this. if you find
+@@ -136,7 +135,7 @@
+ # -lresolv - required for -DDO_DNS on RedHat 7.1
+ # -lsocket -lbind - required for Zeta OS
+
+-LIBS= -lm
++LIBS= -lm $(TARGET_LIBS)
+
+ # ---------------------------------------------------------------
+ # it should not be the case that anything below this line needs to
diff --git a/package/netstat-nat/Config.in b/package/netstat-nat/Config.in
new file mode 100644
index 000000000..b6a885693
--- /dev/null
+++ b/package/netstat-nat/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_NETSTAT_NAT
+ prompt "netstat-nat....................... A netstat variant for NAT connections"
+ tristate
+ default n
+ help
+ Netstat-nat is a small program written in C.
+ It displays NAT connections, managed by netfilter/iptables which comes
+ with the > 2.4.x linux kernels.
+ The program reads its information from '/proc/net/ip_conntrack', which
+ is the temporary conntrack-storage of netfilter.
+
+ http://tweegy.demon.nl/projects/netstat-nat/
+
diff --git a/package/netstat-nat/Makefile b/package/netstat-nat/Makefile
new file mode 100644
index 000000000..a35784769
--- /dev/null
+++ b/package/netstat-nat/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= netstat-nat
+PKG_VERSION:= 1.4.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 45e8d0f47623f619c22a6b894cd03cbc
+MASTER_SITES:= http://www.tweegy.nl/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NETSTAT_NAT,netstat-nat,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_NETSTAT_NAT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/netstat-nat ${IDIR_NETSTAT_NAT}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/netstat-nat/ipkg/netstat-nat.control b/package/netstat-nat/ipkg/netstat-nat.control
new file mode 100644
index 000000000..dea7d633d
--- /dev/null
+++ b/package/netstat-nat/ipkg/netstat-nat.control
@@ -0,0 +1,7 @@
+Package: netstat-nat
+Priority: optional
+Section: net
+Description: a netstat variant for NAT connections
+ Netstat-nat displays NAT connections, managed by netfilter/iptables which
+ comes with the > 2.4.x linux kernels.
+
diff --git a/package/nfs-utils/Config.in b/package/nfs-utils/Config.in
new file mode 100644
index 000000000..0b400090a
--- /dev/null
+++ b/package/nfs-utils/Config.in
@@ -0,0 +1,43 @@
+config ADK_PACKAGE_NFS_UTILS
+ prompt "nfs-utils......................... NFS server utilities"
+ tristate
+ default n
+ select ADK_PACKAGE_PORTMAP
+ select ADK_KPACKAGE_KMOD_NFSD
+ select ADK_KPACKAGE_KMOD_NFS_FS
+ select ADK_PACKAGE_LIBTIRPC if ADK_IPV6
+ depends on !ADK_TARGET_ROOTFS_NFSROOT
+ help
+ NFS server utilities (namely, exportfs), and an NFS server.
+
+config ADK_COMPILE_NFS_UTILS_WITH_KERBEROS
+ prompt "Enable Kerberos and NFSv4"
+ bool
+ select ADK_PACKAGE_LIBEVENT
+ select ADK_PACKAGE_LIBNFSIDMAP
+ select ADK_PACKAGE_LIBRPCSECGSS
+ select ADK_PACKAGE_LIBCOM_ERR
+ select ADK_KERNEL_NFSD_V4
+ default n
+ depends on ADK_PACKAGE_NFS_UTILS
+
+choice
+prompt "Kerberos implementation"
+depends on ADK_COMPILE_NFS_UTILS_WITH_KERBEROS
+config ADK_COMPILE_NFS_UTILS_WITH_KRB5
+ prompt "MIT"
+ bool
+ select ADK_COMPILE_KRB5
+ select ADK_PACKAGE_KRB5_LIBS
+ select ADK_PACKAGE_LIBGSSGLUE
+ help
+ use MIT kerberos libraries
+
+config ADK_COMPILE_NFS_UTILS_WITH_HEIMDAL
+ prompt "Heimdal"
+ bool
+ select ADK_PACKAGE_HEIMDAL_LIBS
+ help
+ Use heimdal kerberos libraries (experimental)
+
+endchoice
diff --git a/package/nfs-utils/Makefile b/package/nfs-utils/Makefile
new file mode 100644
index 000000000..cfbd4393c
--- /dev/null
+++ b/package/nfs-utils/Makefile
@@ -0,0 +1,77 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= nfs-utils
+PKG_VERSION:= 1.1.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b0d1b8ec5c8c081a340cfc77bb8670cd
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=nfs/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NFS_UTILS,nfs-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+PKG_DEPENDS:= portmap,
+CONFIGURE_STYLE= autotool gnu
+
+ifeq ($(ADK_COMPILE_NFS_UTILS_WITH_KRB5),y)
+CONFIGURE_ARGS+= --enable-nfsv4 \
+ --with-krb5-config=${STAGING_DIR}/usr/bin/krb5-config \
+ --enable-gss
+PKG_DEPENDS+= krb5-libs, libevent, libnfsidmap, librpcsecgss, libcom_err, libgssglue
+CONFIGURE_ENV+= LIBS="-lrpcsecgss"
+endif
+
+ifeq ($(ADK_COMPILE_NFS_UTILS_WITH_HEIMDAL),y)
+CONFIGURE_ARGS+= --enable-nfsv4 \
+ --with-krb5-config=${STAGING_DIR}/usr/bin/krb5-config \
+ --enable-gss
+PKG_DEPENDS+= heimdal-libs, libevent, libnfsidmap, librpcsecgss, libcom_err
+CONFIGURE_ENV+= LIBS="-lrpcsecgss"
+endif
+
+ifneq ($(ADK_COMPILE_NFS_UTILS_WITH_KERBEROS),y)
+CONFIGURE_ARGS+= --disable-nfsv4 \
+ --disable-gss
+endif
+
+CONFIGURE_ENV+= knfsd_cv_bsd_signals=no
+CONFIGURE_ARGS+= --without-tcp-wrappers \
+ --disable-uuid
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+TCPPFLAGS+= -I${LINUX_DIR}/include
+
+ifeq (${ADK_IPV6},y)
+PKG_DEPENDS+= , libtirpc
+CONFIGURE_ARGS+= --enable-tirpc \
+ --with-tirpcinclude=${STAGING_DIR}/usr/include/tirpc
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_NFS_UTILS}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_NFS_UTILS}/etc
+ ${INSTALL_DATA} ./files/rpc ${IDIR_NFS_UTILS}/etc
+ ${INSTALL_BIN} ${WRKBUILD}/utils/exportfs/exportfs ${IDIR_NFS_UTILS}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_NFS_UTILS}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_NFS_UTILS}/usr/sbin
+ ${INSTALL_BIN} ./files/nfsd.init \
+ ${IDIR_NFS_UTILS}/etc/init.d/nfs-server
+ ${INSTALL_DATA} ./files/nfsd.exports ${IDIR_NFS_UTILS}/etc/exports
+ ${INSTALL_BIN} ${WRKBUILD}/utils/statd/statd ${IDIR_NFS_UTILS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/utils/nfsd/nfsd ${IDIR_NFS_UTILS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/utils/mountd/mountd ${IDIR_NFS_UTILS}/usr/sbin/
+ifeq ($(ADK_COMPILE_NFS_UTILS_WITH_KERBEROS),y)
+ ${INSTALL_DATA} ./files/idmapd.conf ${IDIR_NFS_UTILS}/etc
+ ${INSTALL_BIN} ${WRKBUILD}/utils/gssd/gssd ${IDIR_NFS_UTILS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/utils/gssd/svcgssd ${IDIR_NFS_UTILS}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/utils/idmapd/idmapd ${IDIR_NFS_UTILS}/usr/sbin/
+endif
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_NFS_UTILS}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/nfs-utils/files/idmapd.conf b/package/nfs-utils/files/idmapd.conf
new file mode 100644
index 000000000..a91c9e359
--- /dev/null
+++ b/package/nfs-utils/files/idmapd.conf
@@ -0,0 +1,14 @@
+[General]
+
+Verbosity = 0
+Pipefs-Directory = /var/lib/nfs/rpc_pipefs
+Domain = localdomain
+
+[Translation]
+
+Method = static
+
+[Mapping]
+
+Nobody-User = nobody
+Nobody-Group = nogroup
diff --git a/package/nfs-utils/files/nfsd.exports b/package/nfs-utils/files/nfsd.exports
new file mode 100644
index 000000000..a357a4d1f
--- /dev/null
+++ b/package/nfs-utils/files/nfsd.exports
@@ -0,0 +1,10 @@
+# on embedded devices with MTD you can _only_ export usb disks or sticks
+# for nfsv3
+#/mnt/usb *(ro,no_root_squash,insecure,no_subtree_check)
+# for nfsv4, do mount --bind /srv/music /nfs4/music and
+# set nfs_server_version 4 in /etc/rc.conf
+#/nfs4 hostname(rw,sync,fsid=0,crossmnt,no_subtree_check)
+#/nfs4/music hostname(rw,sync,no_subtree_check)
+# with kerberos based authentication, add krb5i for integrity and krb5p for privacy
+#/nfs4/music gss/krb5(rw,sync,no_subtree_check)
+
diff --git a/package/nfs-utils/files/nfsd.init b/package/nfs-utils/files/nfsd.init
new file mode 100644
index 000000000..8ce40e633
--- /dev/null
+++ b/package/nfs-utils/files/nfsd.init
@@ -0,0 +1,48 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${portmap:-NO}" = x"NO" && exit 0
+ test x"${nfs_server:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /bin/mkdir -p /var/lib/nfs/v4recovery
+ /bin/touch /var/lib/nfs/rmtab
+ /bin/touch /var/lib/nfs/etab
+ /bin/touch /var/lib/nfs/xtab
+ /bin/touch /var/lib/nfs/sm
+ chown nfs:nfs /var/lib/nfs/sm
+ /usr/sbin/exportfs -r
+ /usr/sbin/mountd
+ /usr/sbin/nfsd
+ /usr/sbin/statd
+ if [ ${nfs_server_version} -eq 4 ];then
+ mkdir -p /var/lib/nfs/rpc_pipefs
+ mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
+ /usr/sbin/idmapd
+ /usr/sbin/svcgssd
+ fi
+ ;;
+stop)
+ killall nfsd
+ killall mountd
+ killall statd
+ if [ ${nfs_server_version} -eq 4 ];then
+ killall idmapd
+ killall svcgssd
+ fi
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/nfs-utils/files/rpc b/package/nfs-utils/files/rpc
new file mode 100644
index 000000000..99a8693d7
--- /dev/null
+++ b/package/nfs-utils/files/rpc
@@ -0,0 +1,3 @@
+portmapper 100000 portmap sunrpc rpcbind
+nfs 100003 nfsprog
+mountd 100005 mount showmount
diff --git a/package/nfs-utils/ipkg/nfs-utils.control b/package/nfs-utils/ipkg/nfs-utils.control
new file mode 100644
index 000000000..f8c3f1f31
--- /dev/null
+++ b/package/nfs-utils/ipkg/nfs-utils.control
@@ -0,0 +1,4 @@
+Package: nfs-utils
+Section: net
+Priority: optional
+Description: Utilities for NFS kernel server
diff --git a/package/nfs-utils/ipkg/nfs-utils.postinst b/package/nfs-utils/ipkg/nfs-utils.postinst
new file mode 100644
index 000000000..bfb7481d0
--- /dev/null
+++ b/package/nfs-utils/ipkg/nfs-utils.postinst
@@ -0,0 +1,9 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf "kernel nfs server" nfs_server NO
+add_rcconf "kernel nfs server version" nfs_server_version 3
+add_service nfs 2049/tdp
+add_service nfs 2049/udp
+gid=$(get_next_gid)
+add_group nfs $gid
+add_user nfs $(get_next_uid) $gid /var/lib/nfs
diff --git a/package/nfs-utils/patches/patch-aclocal_kerberos5_m4 b/package/nfs-utils/patches/patch-aclocal_kerberos5_m4
new file mode 100644
index 000000000..1a5ca00ba
--- /dev/null
+++ b/package/nfs-utils/patches/patch-aclocal_kerberos5_m4
@@ -0,0 +1,138 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nfs-utils-1.1.4.orig/aclocal/kerberos5.m4 2008-10-17 16:20:09.000000000 +0200
++++ nfs-utils-1.1.4/aclocal/kerberos5.m4 2009-01-30 16:24:45.000000000 +0100
+@@ -1,112 +1,48 @@
+-dnl Checks for Kerberos
+-dnl NOTE: while we intend to do generic gss-api, currently we
+-dnl have a requirement to get an initial Kerberos machine
+-dnl credential. Thus, the requirement for Kerberos.
+-dnl The Kerberos gssapi library will be dynamically loaded?
+ AC_DEFUN([AC_KERBEROS_V5],[
++ K5CONFIG="krb5-config"
+ AC_MSG_CHECKING(for Kerberos v5)
+- AC_ARG_WITH(krb5,
+- [AC_HELP_STRING([--with-krb5=DIR], [use Kerberos v5 installation in DIR])],
++ AC_ARG_WITH(krb5-config,
++ [AC_HELP_STRING([--with-krb5-config=PATH], [Full Path to krb5-config.])],
+ [ case "$withval" in
+ yes|no)
+- krb5_with=""
++ K5CONFIG="krb5-config"
+ ;;
+ *)
+- krb5_with="$withval"
++ K5CONFIG="$withval"
+ ;;
+ esac ]
+ )
+
+- for dir in $krb5_with /usr /usr/kerberos /usr/local /usr/local/krb5 \
+- /usr/krb5 /usr/heimdal /usr/local/heimdal /usr/athena ; do
+- dnl This ugly hack brought on by the split installation of
+- dnl MIT Kerberos on Fedora Core 1
+- K5CONFIG=""
+- if test -f $dir/bin/krb5-config; then
+- K5CONFIG=$dir/bin/krb5-config
+- elif test -f "/usr/kerberos/bin/krb5-config"; then
+- K5CONFIG="/usr/kerberos/bin/krb5-config"
+- elif test -f "/usr/lib/mit/bin/krb5-config"; then
+- K5CONFIG="/usr/lib/mit/bin/krb5-config"
+- fi
+ if test "$K5CONFIG" != ""; then
+ KRBCFLAGS=`$K5CONFIG --cflags`
+ KRBLIBS=`$K5CONFIG --libs gssapi`
+- K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'`
+- AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
+- if test -f $dir/include/gssapi/gssapi_krb5.h -a \
+- \( -f $dir/lib/libgssapi_krb5.a -o \
+- -f $dir/lib64/libgssapi_krb5.a -o \
+- -f $dir/lib64/libgssapi_krb5.so -o \
+- -f $dir/lib/libgssapi_krb5.so \) ; then
++ if $K5CONFIG --version | grep -q -e heimdal; then
++ K5VERS=`$K5CONFIG --version | head -n 1 | cut -f2 -d ' ' | tr -d '.'`
++ AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
++ gssapi_lib=gssapi
++ KRBIMPL="heimdal"
++ elif $K5CONFIG --version | grep -q -e Kerberos; then
++ K5VERS=`$K5CONFIG --version | head -n 1 | cut -f4 -d ' ' | tr -d '.'`
+ AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
+- KRBDIR="$dir"
+- dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the
+- dnl private function (gss_krb5_ccache_name) to get correct
+- dnl behavior of changing the ccache used by gssapi.
+- dnl Starting in 1.3.2, we *DO NOT* want to use
+- dnl gss_krb5_ccache_name, instead we want to set KRB5CCNAME
+- dnl to get gssapi to use a different ccache
+ if test $K5VERS -le 131; then
+ AC_DEFINE(USE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the private function, gss_krb5_cache_name, must be used to tell the Kerberos library which credentials cache to use. Otherwise, this is done by setting the KRB5CCNAME environment variable])
+ fi
+ gssapi_lib=gssapi_krb5
+- break
+- dnl The following ugly hack brought on by the split installation
+- dnl of Heimdal Kerberos on SuSe
+- elif test \( -f $dir/include/heim_err.h -o\
+- -f $dir/include/heimdal/heim_err.h \) -a \
+- -f $dir/lib/libroken.a; then
+- AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
+- KRBDIR="$dir"
+- gssapi_lib=gssapi
+- break
+- fi
+- fi
+- done
+- dnl We didn't find a usable Kerberos environment
+- if test "x$KRBDIR" = "x"; then
+- if test "x$krb5_with" = "x"; then
+- AC_MSG_ERROR(Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=)
++ KRBIMPL="mit-krb5"
+ else
+- AC_MSG_ERROR(Kerberos v5 with GSS support not found at $krb5_with)
+- fi
++ AC_MSG_ERROR(Unknown Kerberos 5 Implementation. Is neither heimdal or mit-krb5.)
++ KRBIMPL="unknown"
+ fi
+- AC_MSG_RESULT($KRBDIR)
+-
+- dnl Check if -rpath=$(KRBDIR)/lib is needed
+- echo "The current KRBDIR is $KRBDIR"
+- if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
+- -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
+- KRBLDFLAGS="";
+- elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
+- KRBLDFLAGS="";
+- else
+- KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
++ AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
+ fi
++ AC_MSG_RESULT($KRBIMPL)
+
+- dnl Now check for functions within gssapi library
+- AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context,
+- AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
+- AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes,
+- AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
+- AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name,
+- AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
+-
+- dnl Check for newer error message facility
+- AC_CHECK_LIB($gssapi_lib, krb5_get_error_message,
+- AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
+-
+- dnl Check for function to specify addressless tickets
+- AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless,
+- AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
+-
+- dnl If they specified a directory and it didn't work, give them a warning
+- if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then
+- AC_MSG_WARN(Using $KRBDIR instead of requested value of $krb5_with for Kerberos!)
+- fi
++ AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes, AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name, AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, krb5_get_error_message, AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
++ AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless, AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
+
+- AC_SUBST([KRBDIR])
+ AC_SUBST([KRBLIBS])
+ AC_SUBST([KRBCFLAGS])
+ AC_SUBST([KRBLDFLAGS])
diff --git a/package/nfs-utils/patches/patch-support_nfs_nfs_mntent_c b/package/nfs-utils/patches/patch-support_nfs_nfs_mntent_c
new file mode 100644
index 000000000..5097e0cf0
--- /dev/null
+++ b/package/nfs-utils/patches/patch-support_nfs_nfs_mntent_c
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nfs-utils-1.1.3.orig/support/nfs/nfs_mntent.c 2008-07-27 23:01:45.000000000 +0200
++++ nfs-utils-1.1.3/support/nfs/nfs_mntent.c 2008-10-06 16:53:17.000000000 +0200
+@@ -9,7 +9,7 @@
+ */
+
+ #include <stdio.h>
+-#include <string.h> /* for index */
++#include <string.h> /* for strchr */
+ #include <ctype.h> /* for isdigit */
+ #include <sys/stat.h> /* for umask */
+
+@@ -163,7 +163,7 @@ nfs_getmntent (mntFILE *mfp) {
+ return NULL;
+
+ mfp->mntent_lineno++;
+- s = index (buf, '\n');
++ s = strchr (buf, '\n');
+ if (s == NULL) {
+ /* Missing final newline? Otherwise extremely */
+ /* long line - assume file was corrupted */
+@@ -171,7 +171,7 @@ nfs_getmntent (mntFILE *mfp) {
+ fprintf(stderr, _("[mntent]: warning: no final "
+ "newline at the end of %s\n"),
+ mfp->mntent_file);
+- s = index (buf, 0);
++ s = strchr (buf, 0);
+ } else {
+ mfp->mntent_errs = 1;
+ goto err;
diff --git a/package/nfs-utils/patches/patch-tools_Makefile_am b/package/nfs-utils/patches/patch-tools_Makefile_am
new file mode 100644
index 000000000..073486f8d
--- /dev/null
+++ b/package/nfs-utils/patches/patch-tools_Makefile_am
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nfs-utils-1.1.4.orig/tools/Makefile.am 2008-10-17 16:20:09.000000000 +0200
++++ nfs-utils-1.1.4/tools/Makefile.am 2009-01-03 14:12:09.000000000 +0100
+@@ -6,6 +6,6 @@ if CONFIG_RPCGEN
+ OPTDIRS += rpcgen
+ endif
+
+-SUBDIRS = locktest rpcdebug nlmtest $(OPTDIRS)
++SUBDIRS = $(OPTDIRS)
+
+ MAINTAINERCLEANFILES = Makefile.in
diff --git a/package/nfs-utils/patches/patch-tools_Makefile_in b/package/nfs-utils/patches/patch-tools_Makefile_in
new file mode 100644
index 000000000..ef12d1e52
--- /dev/null
+++ b/package/nfs-utils/patches/patch-tools_Makefile_in
@@ -0,0 +1,21 @@
+$Id$
+--- nfs-utils-1.1.4.orig/tools/Makefile.in 2008-10-17 16:23:52.000000000 +0200
++++ nfs-utils-1.1.4/tools/Makefile.in 2009-01-03 13:46:50.000000000 +0100
+@@ -59,7 +59,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re
+ distclean-recursive maintainer-clean-recursive
+ ETAGS = etags
+ CTAGS = ctags
+-DIST_SUBDIRS = locktest rpcdebug nlmtest rpcgen
++DIST_SUBDIRS = rpcgen
+ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ ACLOCAL = @ACLOCAL@
+ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
+@@ -210,7 +210,7 @@ target_alias = @target_alias@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ OPTDIRS = $(am__append_1)
+-SUBDIRS = locktest rpcdebug nlmtest $(OPTDIRS)
++SUBDIRS = $(OPTDIRS)
+ MAINTAINERCLEANFILES = Makefile.in
+ all: all-recursive
+
diff --git a/package/nfs-utils/patches/patch-utils_mount_error_c b/package/nfs-utils/patches/patch-utils_mount_error_c
new file mode 100644
index 000000000..ab4590270
--- /dev/null
+++ b/package/nfs-utils/patches/patch-utils_mount_error_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nfs-utils-1.1.3.orig/utils/mount/error.c 2008-07-27 23:01:45.000000000 +0200
++++ nfs-utils-1.1.3/utils/mount/error.c 2008-10-06 16:58:40.000000000 +0200
+@@ -62,7 +62,7 @@ static int rpc_strerror(int spos)
+ char *tmp;
+
+ if (estr) {
+- if ((ptr = index(estr, ':')))
++ if ((ptr = strchr(estr, ':')))
+ estr = ++ptr;
+
+ tmp = &errbuf[spos];
diff --git a/package/nfs-utils/patches/patch-utils_mountd_cache_c b/package/nfs-utils/patches/patch-utils_mountd_cache_c
new file mode 100644
index 000000000..5f46d3116
--- /dev/null
+++ b/package/nfs-utils/patches/patch-utils_mountd_cache_c
@@ -0,0 +1,75 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nfs-utils-1.1.4.orig/utils/mountd/cache.c 2008-10-17 16:20:09.000000000 +0200
++++ nfs-utils-1.1.4/utils/mountd/cache.c 2009-01-03 13:48:33.000000000 +0100
+@@ -118,54 +118,6 @@ void auth_unix_ip(FILE *f)
+ free(he);
+ }
+
+-void auth_unix_gid(FILE *f)
+-{
+- /* Request are
+- * uid
+- * reply is
+- * uid expiry count list of group ids
+- */
+- int uid;
+- struct passwd *pw;
+- gid_t glist[100], *groups = glist;
+- int ngroups = 100;
+- int rv, i;
+- char *cp;
+-
+- if (readline(fileno(f), &lbuf, &lbuflen) != 1)
+- return;
+-
+- cp = lbuf;
+- if (qword_get_int(&cp, &uid) != 0)
+- return;
+-
+- pw = getpwuid(uid);
+- if (!pw)
+- rv = -1;
+- else {
+- rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
+- if (rv == -1 && ngroups >= 100) {
+- groups = malloc(sizeof(gid_t)*ngroups);
+- if (!groups)
+- rv = -1;
+- else
+- rv = getgrouplist(pw->pw_name, pw->pw_gid,
+- groups, &ngroups);
+- }
+- }
+- qword_printint(f, uid);
+- qword_printint(f, time(0)+30*60);
+- if (rv >= 0) {
+- qword_printint(f, ngroups);
+- for (i=0; i<ngroups; i++)
+- qword_printint(f, groups[i]);
+- } else
+- qword_printint(f, 0);
+- qword_eol(f);
+-
+- if (groups != glist)
+- free(groups);
+-}
+
+ #if USE_BLKID
+ static const char *get_uuid_blkdev(char *path)
+@@ -730,7 +682,6 @@ struct {
+ FILE *f;
+ } cachelist[] = {
+ { "auth.unix.ip", auth_unix_ip},
+- { "auth.unix.gid", auth_unix_gid},
+ { "nfsd.export", nfsd_export},
+ { "nfsd.fh", nfsd_fh},
+ { NULL, NULL }
+@@ -742,8 +693,6 @@ void cache_open(void)
+ int i;
+ for (i=0; cachelist[i].cache_name; i++ ) {
+ char path[100];
+- if (!manage_gids && cachelist[i].cache_handle == auth_unix_gid)
+- continue;
+ sprintf(path, "/proc/net/rpc/%s/channel", cachelist[i].cache_name);
+ cachelist[i].f = fopen(path, "r+");
+ }
diff --git a/package/nfs-utils/patches/patch-utils_mountd_fsloc_c b/package/nfs-utils/patches/patch-utils_mountd_fsloc_c
new file mode 100644
index 000000000..61e42a7c6
--- /dev/null
+++ b/package/nfs-utils/patches/patch-utils_mountd_fsloc_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nfs-utils-1.1.3.orig/utils/mountd/fsloc.c 2008-07-27 23:01:45.000000000 +0200
++++ nfs-utils-1.1.3/utils/mountd/fsloc.c 2008-10-06 16:46:49.000000000 +0200
+@@ -126,7 +126,7 @@ static struct servers *method_list(char
+ struct servers *rv=NULL;
+
+ xlog(L_NOTICE, "method_list(%s)\n", data);
+- for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++)
++ for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++)
+ ptr++;
+ list = malloc(listsize * sizeof(char *));
+ copy = strdup(data);
diff --git a/package/nmap/Config.in b/package/nmap/Config.in
new file mode 100644
index 000000000..f97017eeb
--- /dev/null
+++ b/package/nmap/Config.in
@@ -0,0 +1,30 @@
+config ADK_PACKAGE_NMAP
+ prompt "nmap.............................. Network exploration and/or security auditing utility"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBDNET
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBPCRE
+ help
+ A free open source utility for network exploration or security auditing.
+
+ http://www.insecure.org/nmap/
+
+choice
+prompt "C++ library to use"
+depends on ADK_PACKAGE_NMAP
+default ADK_COMPILE_NMAP_WITH_STDCXX if ADK_TARGET_LIB_GLIBC
+default ADK_COMPILE_NMAP_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC
+
+config ADK_COMPILE_NMAP_WITH_STDCXX
+ bool "Standard C++ library"
+ select ADK_PACKAGE_LIBSTDCXX
+ help
+
+config ADK_COMPILE_NMAP_WITH_UCLIBCXX
+ bool "Embedded uClibc++ library"
+ select ADK_PACKAGE_UCLIBCXX
+ help
+
+endchoice
diff --git a/package/nmap/Makefile b/package/nmap/Makefile
new file mode 100644
index 000000000..93793716d
--- /dev/null
+++ b/package/nmap/Makefile
@@ -0,0 +1,50 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= nmap
+PKG_VERSION:= 4.76
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 278dd2e849cc3dbb947df961a1aaffd0
+MASTER_SITES:= http://download.insecure.org/nmap/dist/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+PKG_DEPEND:= libgcc libdnet libpcap libpcre
+ifeq ($(ADK_COMPILE_NMAP_WITH_UCLIBCXX),y)
+PKG_DEPEND+= uclibc++
+else
+PKG_DEPEND+= libstdcxx
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NMAP,nmap,${PKG_VERSION}-${PKG_RELEASE},${ARCH},${PKG_DEPEND}))
+
+TCPPFLAGS+= -DNOLUA
+ifeq ($(ADK_COMPILE_NMAP_WITH_UCLIBCXX),y)
+CONFIGURE_ENV+= CXXFLAGS="-fno-builtin -fno-rtti -nostdinc++ \
+ -I${STAGING_DIR}/usr/include/uClibc++" \
+ LIBS="-nodefaultlibs -luClibc++ -lc -lm -lgcc"
+endif
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-openssl \
+ --without-zenmap \
+ --without-liblua \
+ --with-libdnet="${STAGING_DIR}/usr" \
+ --with-libpcap="${STAGING_DIR}/usr" \
+ --with-libpcre="${STAGING_DIR}/usr"
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_NMAP}/usr/share/nmap
+ ${INSTALL_DIR} ${IDIR_NMAP}/usr/bin
+ for file in mac-prefixes os-db protocols rpc service-probes services; do \
+ ${CP} ${WRKINST}/usr/share/nmap/nmap-$$file ${IDIR_NMAP}/usr/share/nmap; \
+ done
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/nmap ${IDIR_NMAP}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/nmap/ipkg/nmap.control b/package/nmap/ipkg/nmap.control
new file mode 100644
index 000000000..9b9398d0b
--- /dev/null
+++ b/package/nmap/ipkg/nmap.control
@@ -0,0 +1,4 @@
+Package: nmap
+Priority: optional
+Section: net
+Description: Nmap is a free open source utility for network exploration or security auditing.
diff --git a/package/nmap/patches/patch-configure b/package/nmap/patches/patch-configure
new file mode 100644
index 000000000..378c086e2
--- /dev/null
+++ b/package/nmap/patches/patch-configure
@@ -0,0 +1,99 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nmap-4.76.orig/configure 2008-09-09 01:37:03.000000000 +0200
++++ nmap-4.76/configure 2008-12-14 18:54:23.000000000 +0100
+@@ -4035,7 +4035,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA=
+
+
+ if test -n "$GXX"; then
+- CXXFLAGS="$CXXFLAGS -Wall "
++ CXXFLAGS="$CXXFLAGS "
+ fi
+
+ { echo "$as_me:$LINENO: checking whether the compiler is gcc 4 or greater" >&5
+@@ -6656,86 +6656,6 @@ if test $needs_cpp_precomp = yes; then
+ CXXFLAGS="-no-cpp-precomp $CXXFLAGS"
+ fi
+
+-if test $have_libpcap = yes; then
+- if test "${LIBPCAP_INC+set}" = "set"; then
+- _cflags=$CXXFLAGS
+- _ldflags=$LDFLAGS
+-
+- CPPFLAGS="-I$LIBPCAP_INC $CPPFLAGS"
+- LDFLAGS="-L$LIBPCAP_LIB $LDFLAGS"
+- fi
+-
+- # link with -lpcap for the purposes of this test
+- LIBS_OLD="$LIBS"
+- LIBS="$LIBS -lpcap"
+- { echo "$as_me:$LINENO: checking if libpcap version is recent enough" >&5
+-echo $ECHO_N "checking if libpcap version is recent enough... $ECHO_C" >&6; }
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#include <stdio.h>
+-extern char pcap_version[];
+-int main() {
+- int major, minor1, minor2;
+- sscanf(pcap_version,"%d.%d.%d", &major, &minor1, &minor2);
+- if (major > 0)
+- exit(0);
+- if (minor1 < 9)
+- exit(1);
+- if (minor2 < 4)
+- exit(1);
+- exit(0);
+-}
+-_ACEOF
+-rm -f conftest$ac_exeext
+-if { (ac_try="$ac_link"
+-case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (case "(($ac_try" in
+- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+- *) ac_try_echo=$ac_try;;
+-esac
+-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }; have_libpcap=yes
+-else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-( exit $ac_status )
+-{ echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }; have_libpcap=no
+-fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+-LIBS="$LIBS_OLD"
+-fi
+-
+ LIBPCAP_LIBS="-lpcap"
+ if test $have_libpcap = yes; then
+ PCAP_DEPENDS=""
diff --git a/package/nmap/patches/patch-nmap_dns_h b/package/nmap/patches/patch-nmap_dns_h
new file mode 100644
index 000000000..2868f42ba
--- /dev/null
+++ b/package/nmap/patches/patch-nmap_dns_h
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nmap-4.76.orig/nmap_dns.h 2008-08-21 11:24:35.000000000 +0200
++++ nmap-4.76/nmap_dns.h 2008-12-14 19:40:58.000000000 +0100
+@@ -95,6 +95,9 @@
+ * *
+ ***************************************************************************/
+
++#include <list>
++#include <string>
++
+ class Target;
+
+ void nmap_mass_rdns(Target ** targets, int num_targets);
diff --git a/package/nmap/patches/patch-output_cc b/package/nmap/patches/patch-output_cc
new file mode 100644
index 000000000..cdabf2449
--- /dev/null
+++ b/package/nmap/patches/patch-output_cc
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nmap-4.76.orig/output.cc 2008-09-10 20:32:35.000000000 +0200
++++ nmap-4.76/output.cc 2008-10-29 13:29:04.000000000 +0100
+@@ -2003,7 +2003,7 @@ struct data_file_record {
+
+ /* Compares this record to another. First compare the directory names, then
+ compare the file names. */
+- bool operator<(const struct data_file_record& other) {
++ bool operator<(const struct data_file_record& other) const {
+ int cmp;
+
+ cmp = dir.compare(other.dir);
diff --git a/package/nmap/patches/patch-traceroute_cc b/package/nmap/patches/patch-traceroute_cc
new file mode 100644
index 000000000..79514733b
--- /dev/null
+++ b/package/nmap/patches/patch-traceroute_cc
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- nmap-4.76.orig/traceroute.cc 2008-09-06 06:12:34.000000000 +0200
++++ nmap-4.76/traceroute.cc 2008-10-29 13:42:16.000000000 +0100
+@@ -850,9 +850,12 @@ Traceroute::outputTarget (Target * t) {
+ tg = TraceGroups[t->v4host ().s_addr];
+
+ /* sort into ttl order */
++ /* quick hack
+ for (it = tg->TraceProbes.begin (); it != tg->TraceProbes.end (); ++it)
+ sortedProbes[it->second->ttl] = it->second;
+ sortedProbes.swap (tg->TraceProbes);
++ */
++
+
+ /* clean up and consolidate traces */
+ tg->consolidateHops ();
diff --git a/package/nocatsplash/Config.in b/package/nocatsplash/Config.in
new file mode 100644
index 000000000..38d38a044
--- /dev/null
+++ b/package/nocatsplash/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_NOCATSPLASH
+ prompt "nocatsplash....................... Open public network gateway daemon"
+ tristate
+ default n
+ help
+ NoCatSplash is an Open Public Network Gateway Daemon.
+ It performs as a [captive/open/active] portal. When run on a gateway/router
+ on a network, all web requests are redirected until the client either logs
+ in or clicks "I Accept" to an AUP. The gateway daemon then changes the
+ firewall rules on the gateway to pass traffic for that client (based on IP
+ address and MAC address).
+
diff --git a/package/nocatsplash/Makefile b/package/nocatsplash/Makefile
new file mode 100644
index 000000000..600e421f0
--- /dev/null
+++ b/package/nocatsplash/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= nocatsplash
+PKG_VERSION:= 0.92
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e0fcc0effe52e63bc31070d16d0b4a81
+MASTER_SITES:= http://nocat.net/download/NoCatSplash/
+DISTFILES:= NoCatSplash-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/NoCatSplash-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NOCATSPLASH,nocatsplash,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-firewall=iptables \
+ --with-glib-prefix="${STAGING_DIR}/usr"
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${CP} ${WRKINST}/* ${IDIR_NOCATSPLASH}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/nocatsplash/ipkg/nocatsplash.conffiles b/package/nocatsplash/ipkg/nocatsplash.conffiles
new file mode 100644
index 000000000..a25777d9a
--- /dev/null
+++ b/package/nocatsplash/ipkg/nocatsplash.conffiles
@@ -0,0 +1 @@
+/etc/nocat.conf
diff --git a/package/nocatsplash/ipkg/nocatsplash.control b/package/nocatsplash/ipkg/nocatsplash.control
new file mode 100644
index 000000000..ec0bfc7e2
--- /dev/null
+++ b/package/nocatsplash/ipkg/nocatsplash.control
@@ -0,0 +1,10 @@
+Package: nocatsplash
+Priority: optional
+Section: net
+Depends: iptables-extra, glib1
+Description: NoCatSplash is an Open Public Network Gateway Daemon.
+ It performs as a [captive/open/active] portal. When run on a gateway/router
+ on a network, all web requests are redirected until the client either logs
+ in or clicks "I Accept" to an AUP. The gateway daemon then changes the
+ firewall rules on the gateway to pass traffic for that client (based on IP
+ address and MAC address).
diff --git a/package/nocatsplash/patches/openwrt-firewall.patch b/package/nocatsplash/patches/openwrt-firewall.patch
new file mode 100644
index 000000000..055b57f24
--- /dev/null
+++ b/package/nocatsplash/patches/openwrt-firewall.patch
@@ -0,0 +1,19 @@
+diff -urN NoCatSplash-0.92.old/libexec/iptables/initialize.fw NoCatSplash-0.92/libexec/iptables/initialize.fw
+--- NoCatSplash-0.92.old/libexec/iptables/initialize.fw 2002-12-27 11:44:41.000000000 +0100
++++ NoCatSplash-0.92/libexec/iptables/initialize.fw 2005-04-04 20:45:57.000000000 +0200
+@@ -28,13 +28,9 @@
+
+ # Load alllll the kernel modules we need.
+ #
+-rmmod ipchains > /dev/null 2>&1 # for RH 7.1 users.
+
+-for module in ip_tables ipt_REDIRECT ipt_MASQUERADE ipt_MARK ipt_REJECT \
+- ipt_TOS ipt_LOG iptable_mangle iptable_filter iptable_nat ip_nat_ftp \
+- ip_conntrack ipt_mac ipt_state ipt_mark; do
+-
+- modprobe $module
++for module in ipt_TOS ipt_mac; do
++ insmod $module
+ done
+
+
diff --git a/package/ntfs-3g/Config.in b/package/ntfs-3g/Config.in
new file mode 100644
index 000000000..6ea9cddd0
--- /dev/null
+++ b/package/ntfs-3g/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_KMOD_FS_NTFS_3G
+ prompt "kmod-fs-ntfs-3g................... Kernel driver for NTFS filesystem (rw)"
+ tristate
+ default n
+ help
+ http://www.ntfs-3g.org
diff --git a/package/ntfs-3g/Makefile b/package/ntfs-3g/Makefile
new file mode 100644
index 000000000..d180eef0a
--- /dev/null
+++ b/package/ntfs-3g/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= kmod-fs-ntfs-3g
+PKG_VERSION= 2009.3.8
+PKG_RELEASE= 1
+PKG_MD5SUM= da67f4c651649f5a463af293c347c387
+PKG_MODULE= 1
+MASTER_SITES= http://www.ntfs-3g.org/
+DISTFILES= ntfs-3g-${PKG_VERSION}.tgz
+WRKDIST= ${WRKDIR}/ntfs-3g-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,KMOD_FS_NTFS_3G,kmod-fs-ntfs-3g,${KERNEL_VERSION}-${DEVICE}-${PKG_RELEASE},${ARCH},kernel (${KERNEL_VERSION}-${DEVICE}-${KERNEL_RELEASE})))
+
+CONFIGURE_ARGS+= --disable-ldconfig \
+ --disable-library
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_KMOD_FS_NTFS_3G}/{bin,sbin}
+ ${CP} ${WRKINST}/bin/ntfs-3g ${IDIR_KMOD_FS_NTFS_3G}/bin
+ ${CP} ${WRKINST}/sbin/mount.ntfs-3g ${IDIR_KMOD_FS_NTFS_3G}/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ntfs-3g/ipkg/kmod-fs-ntfs-3g.control b/package/ntfs-3g/ipkg/kmod-fs-ntfs-3g.control
new file mode 100644
index 000000000..3397e9382
--- /dev/null
+++ b/package/ntfs-3g/ipkg/kmod-fs-ntfs-3g.control
@@ -0,0 +1,4 @@
+Package: kmod-fs-ntfs-3g
+Priority: optional
+Section: sys
+Description: ntfs filesystem driver with read and write support
diff --git a/package/ntpclient/Config.in b/package/ntpclient/Config.in
new file mode 100644
index 000000000..daf0d46a3
--- /dev/null
+++ b/package/ntpclient/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_NTPCLIENT
+ prompt "ntpclient......................... NTP (Network Time Protocol) client"
+ tristate
+ default n
+ help
+ NTP client for setting system time from NTP servers.
+ It is recommended to use the rdate package instead.
+
+ http://doolittle.faludi.com/ntpclient/
+
diff --git a/package/ntpclient/Makefile b/package/ntpclient/Makefile
new file mode 100644
index 000000000..2cde14053
--- /dev/null
+++ b/package/ntpclient/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ntpclient
+PKG_VERSION:= 2007_365
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cb98711f11769cdd22fc592844cef414
+MASTER_SITES:= http://doolittle.icarus.com/ntpclient/
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/${PKG_NAME}-2007
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NTPCLIENT,ntpclient,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC='${TARGET_CC}' CFLAGS='${TCFLAGS}'
+ALL_TARGET:=
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_NTPCLIENT}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/ntpclient ${IDIR_NTPCLIENT}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ntpclient/ipkg/ntpclient.control b/package/ntpclient/ipkg/ntpclient.control
new file mode 100644
index 000000000..4194e617b
--- /dev/null
+++ b/package/ntpclient/ipkg/ntpclient.control
@@ -0,0 +1,4 @@
+Package: ntpclient
+Priority: optional
+Section: net
+Description: NTP client for setting system time from NTP servers.
diff --git a/package/ntpclient/patches/patch-ntpclient_c b/package/ntpclient/patches/patch-ntpclient_c
new file mode 100644
index 000000000..3c5251b4b
--- /dev/null
+++ b/package/ntpclient/patches/patch-ntpclient_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ntpclient-2007.orig/ntpclient.c 2008-01-01 03:16:10.000000000 +0100
++++ ntpclient-2007/ntpclient.c 2008-10-10 15:59:26.000000000 +0200
+@@ -146,7 +146,7 @@ static int get_current_freq(void)
+ #ifdef __linux__
+ struct timex txc;
+ txc.modes=0;
+- if (__adjtimex(&txc) < 0) {
++ if (adjtimex(&txc) < 0) {
+ perror("adjtimex"); exit(1);
+ }
+ return txc.freq;
+@@ -163,7 +163,7 @@ static int set_freq(int new_freq)
+ struct timex txc;
+ txc.modes = ADJ_FREQUENCY;
+ txc.freq = new_freq;
+- if (__adjtimex(&txc) < 0) {
++ if (adjtimex(&txc) < 0) {
+ perror("adjtimex"); exit(1);
+ }
+ return txc.freq;
diff --git a/package/nut/Config.in b/package/nut/Config.in
new file mode 100644
index 000000000..2da404567
--- /dev/null
+++ b/package/nut/Config.in
@@ -0,0 +1,239 @@
+config ADK_PACKAGE_NUT
+ prompt "nut............................... Network UPS Tools"
+ tristate
+ default n
+ help
+ Network UPS Tools is a collection of programs which provide a common
+ interface for monitoring and administering UPS hardware. It uses a
+ layered approach to connect all of the parts.
+
+ http://www.networkupstools.org
+
+config ADK_PACKAGE_NUT_SSL
+ prompt "nut-ssl........................... Build Nut with SSL support"
+ boolean
+ default n
+ depends on ADK_PACKAGE_NUT
+ select ADK_PACKAGE_LIBOPENSSL
+
+config ADK_PACKAGE_NUT_USB
+ prompt "nut-usb........................... Build Nut with USB drivers"
+ boolean
+ default n
+ depends on ADK_PACKAGE_NUT
+ select ADK_PACKAGE_LIBUSB
+ help
+ This option enables two drivers, namely hidups and energizerups.
+
+config ADK_PACKAGE_NUT_SNMP
+ prompt "nut-snmp.......................... Build Nut with SNMP UPS driver"
+ boolean
+ default n
+ depends on ADK_PACKAGE_NUT
+ select ADK_PACKAGE_LIBNETSNMP
+ help
+ This option enables the snmp-ups driver.
+
+config ADK_PACKAGE_NUT_VARDESC
+ prompt "command descriptions.............. Include variable and command descriptions"
+ boolean
+ default y
+ depends on ADK_PACKAGE_NUT
+ help
+ With this option enabled, an optional file will be added to the package
+ containing a description of the commands and variables to clients.
+ If you leave this out, clients will receive "Unavailable" for any description
+ requests.
+
+menu "UPS Drivers to include"
+depends on ADK_PACKAGE_NUT
+
+config ADK_PACKAGE_NUT_DRIVER_APCSMART
+ prompt "apcsmart.......................... Driver for APC smart protocol (newapc)"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_BELKIN
+ prompt "belkin............................ Driver for Belkin Smart-UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_BELKINUNV
+ prompt "belkinunv......................... Driver for Belkin Universal UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_BESTUPS
+ prompt "bestups........................... Driver for Best-UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_BESTFCOM
+ prompt "bestfcom.......................... Driver for Best Power F-Command UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_BESTUFERRUPS
+ prompt "bestuferrups...................... Driver for Best Power Micro-Ferrups"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_BLAZER
+ prompt "blazer............................ Driver for Blazer UPS models"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_CPSUPS
+ prompt "cpsups............................ Driver for CyberPower text protocol UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_CYBERPOWER
+ prompt "cyberpower........................ Driver for Cyber Power Systems"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_ESUPSSMART
+ prompt "esupssmart........................ Driver for ES UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_ETAPRO
+ prompt "etapro............................ Driver for ETA UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_EVERUPS
+ prompt "everups........................... Driver for Ever UPS models"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_FENTONUPS
+ prompt "fentonups......................... Driver for Fenton Technologies units"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_GAMATRONIC
+ prompt "gamatronic........................ Driver for Gamatronic UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_GENERICUPS
+ prompt "genericups........................ Driver for generic contact-closure UPS models"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_IPPON
+ prompt "ippon............................. Driver for Ippon UPS devices"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_ISBMEX
+ prompt "isbmex............................ Driver for SOLA/BASIC Mexico models"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_LIEBERT
+ prompt "liebert........................... Driver for Liebert UPS via MultiLink cable"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_MASTERGUARD
+ prompt "masterguard....................... Driver for Masterguard units"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_MEGATEC
+ prompt "megatec........................... Driver for Megatec protocol based UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_METASYS
+ prompt "metasys........................... Driver for Meta System UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_MGE_UTALK
+ prompt "mge-utalk......................... Driver for MGE UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_MUSTEK
+ prompt "mustek............................ Driver for Mustek UPS models"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_ONEAC
+ prompt "oneac............................. Driver for UPS using the Oneac Advanced Interface"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_POWERCOM
+ prompt "powercom.......................... Driver for Powercom units (see help)"
+ boolean
+ default n
+ help
+ This driver supports the following units:
+ * -Trust 425/625
+ * -Powercom
+ * -Advice Partner/King PR750
+ * See http://www.advice.co.il/product/inter/ups.html for its specifications.
+ * This model is based on PowerCom (www.powercom.com) models.
+ * -Socomec Sicon Egys 420
+
+config ADK_PACKAGE_NUT_DRIVER_POWERMUST
+ prompt "powermust......................... Driver for Powermust"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_RHINO
+ prompt "rhino............................. Driver for Microsol Rhino UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_SAFENET
+ prompt "safenet........................... Driver for SafeNet UPS (see help)"
+ boolean
+ default n
+ help
+ Supports the following units:
+ * - Fairstone L525/-625/-750
+ * - Fenton P400/-600/-800
+ * - Gemini UPS625/-1000
+ * - Powerwell PM525A/-625A/-800A/-1000A/-1250A
+ * - Repotec RPF525/-625/-800/-1000
+ * - Soltec Winmate 525/625/800/1000
+ * - Sweex 500/1000
+ * - others using SafeNet software and serial interface
+
+config ADK_PACKAGE_NUT_DRIVER_SMS
+ prompt "sms............................... Driver for SMS UPS hardware"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_SOLIS
+ prompt "solis............................. Driver for Microsol Solis UPS"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_TRIPPLITE
+ prompt "tripplite......................... Driver for Tripp Lite SmartUPS models"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_TRIPPLITESU
+ prompt "tripplitesu....................... Driver for Tripp Lite SmartOnline (SU*) models"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_UPSCODE2
+ prompt "upscode2.......................... Driver for UPS using UPScode II command set"
+ boolean
+ default n
+
+config ADK_PACKAGE_NUT_DRIVER_VICTRONUPS
+ prompt "victronups........................ Driver for GE/IMV/Victron units"
+ boolean
+ default n
+
+endmenu
diff --git a/package/nut/Makefile b/package/nut/Makefile
new file mode 100644
index 000000000..0d1837991
--- /dev/null
+++ b/package/nut/Makefile
@@ -0,0 +1,117 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= nut
+PKG_VERSION:= 2.0.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b08fde86191154bbcfda860f95a5dca2
+MASTER_SITES:= http://www.networkupstools.org/source/2.0/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,NUT,nut,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+define DRIVER_template
+
+DRIVERS_$${ADK_PACKAGE_NUT_DRIVER_${1}}+=${2}
+
+endef
+
+DRIVERS_y:=
+$(eval $(call DRIVER_template,BESTUPS,bestups))
+$(eval $(call DRIVER_template,FENTONUPS,fentonups))
+$(eval $(call DRIVER_template,APCSMART,apcsmart))
+$(eval $(call DRIVER_template,EVERUPS,everups))
+$(eval $(call DRIVER_template,BELKIN,belkin))
+$(eval $(call DRIVER_template,MASTERGUARD,masterguard))
+$(eval $(call DRIVER_template,POWERCOM,powercom))
+$(eval $(call DRIVER_template,CYBERPOWER,cyberpower))
+$(eval $(call DRIVER_template,TRIPPLITE,tripplite))
+$(eval $(call DRIVER_template,VICTRONUPS,victronups))
+$(eval $(call DRIVER_template,GENERICUPS,genericups))
+$(eval $(call DRIVER_template,MGE_UTALK,mge-utalk))
+$(eval $(call DRIVER_template,BESTUFERRUPS,bestuferrups))
+$(eval $(call DRIVER_template,ISBMEX,isbmex))
+$(eval $(call DRIVER_template,ETAPRO,etapro))
+$(eval $(call DRIVER_template,LIEBERT,liebert))
+$(eval $(call DRIVER_template,SMS,sms))
+$(eval $(call DRIVER_template,ESUPSSMART,esupssmart))
+$(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
+$(eval $(call DRIVER_template,BLAZER,blazer))
+$(eval $(call DRIVER_template,SAFENET,safenet))
+$(eval $(call DRIVER_template,BELKINUNV,belkinunv))
+$(eval $(call DRIVER_template,ONEAC,oneac))
+$(eval $(call DRIVER_template,IPPON,ippon))
+$(eval $(call DRIVER_template,CPSUPS,cpsups))
+$(eval $(call DRIVER_template,MUSTEK,mustek))
+$(eval $(call DRIVER_template,METASYS,metasys))
+$(eval $(call DRIVER_template,BESTFCOM,bestfcom))
+$(eval $(call DRIVER_template,UPSCODE2,upscode2))
+$(eval $(call DRIVER_template,SOLIS,solis))
+$(eval $(call DRIVER_template,GAMATRONIC,gamatronic))
+$(eval $(call DRIVER_template,MEGATEC,megatec))
+$(eval $(call DRIVER_template,RHINO,rhino))
+
+CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
+
+INSTALL_DRIVERS_tmp=${DRIVERS_y}
+ifneq (${ADK_PACKAGE_NUT_USB},)
+INSTALL_DRIVERS_tmp+= hidups energizerups newhidups tripplite_usb
+endif
+ifneq (${ADK_PACKAGE_NUT_SNMP},)
+INSTALL_DRIVERS_tmp+= snmp-ups
+endif
+INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
+ --without-cgi \
+ --with-drivers=${INSTALL_DRIVERS} \
+ --with-user=root
+IPKG_DEPEND_tmp:=
+ifneq (${ADK_PACKAGE_NUT_SSL},)
+CONFIGURE_ARGS+= --with-ssl
+CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}"
+MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto"
+IPKG_DEPEND_tmp+= libopenssl
+endif
+BUILD_STYLE:= auto
+ALL_TARGET:= all
+INSTALL_STYLE:= auto
+INSTALL_TARGET:= install
+ifneq (${ADK_PACKAGE_NUT_USB},)
+ALL_TARGET+= usb
+INSTALL_TARGET+= install-usb
+IPKG_DEPEND_tmp+= libusb
+endif
+ifneq (${ADK_PACKAGE_NUT_SNMP},)
+ALL_TARGET+= snmp
+INSTALL_TARGET+= install-snmp
+IPKG_DEPEND_tmp+= libnetsnmp
+endif
+IPKG_DEPEND=$(shell echo ${IPKG_DEPEND_tmp} | tr ' ' ',')
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin
+ ${INSTALL_DIR} ${IDIR_NUT}/etc/init.d
+ ${INSTALL_BIN} ./files/upsd.init \
+ ${IDIR_NUT}/etc/init.d/upsd
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
+ ${IDIR_NUT}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
+ ${IDIR_NUT}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
+ ${IDIR_NUT}/usr/bin/
+ ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
+ echo "Depends: ${IPKG_DEPEND}" >> ${IDIR_NUT}/CONTROL/control
+ifneq (${ADK_PACKAGE_NUT_VARDESC},)
+ ${INSTALL_DIR} ${IDIR_NUT}/usr/share
+ ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \
+ ${IDIR_NUT}/usr/share/
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/nut/files/ups.conf b/package/nut/files/ups.conf
new file mode 100644
index 000000000..113394d5d
--- /dev/null
+++ b/package/nut/files/ups.conf
@@ -0,0 +1,104 @@
+# Network UPS Tools: example ups.conf
+#
+# --- SECURITY NOTE ---
+#
+# If you use snmp-ups and set a community string in here, you
+# will have to secure this file to keep other users from obtaining
+# that string. It needs to be readable by upsdrvctl and any drivers,
+# and by upsd.
+#
+# ---
+#
+# This is where you configure all the UPSes that this system will be
+# monitoring directly. These are usually attached to serial ports, but
+# USB devices and SNMP devices are also supported.
+#
+# This file is used by upsdrvctl to start and stop your driver(s), and
+# is also used by upsd to determine which drivers to monitor. The
+# drivers themselves also read this file for configuration directives.
+#
+# The general form is:
+#
+# [upsname]
+# driver = <drivername>
+# port = <portname>
+# < any other directives here >
+#
+# The section header ([upsname]) can be just about anything as long as
+# it is a single word inside brackets. upsd uses this to uniquely
+# identify a UPS on this system.
+#
+# If you have a UPS called snoopy, your section header would be "[snoopy]".
+# On a system called "doghouse", the line in your upsmon.conf to monitor
+# it would look something like this:
+#
+# MONITOR snoopy@doghouse 1 upsmonuser mypassword master
+#
+# It might look like this if monitoring in slave mode:
+#
+# MONITOR snoopy@doghouse 1 upsmonuser mypassword slave
+#
+# Configuration directives
+# ------------------------
+#
+# These directives are common to all drivers that support ups.conf:
+#
+# driver: REQUIRED. Specify the program to run to talk to this UPS.
+# apcsmart, fentonups, bestups, and sec are some examples.
+#
+# port: REQUIRED. The serial port where your UPS is connected.
+# /dev/ttyS0 is usually the first port on Linux boxes, for example.
+#
+# sdorder: optional. When you have multiple UPSes on your system, you
+# usually need to turn them off in a certain order. upsdrvctl
+# shuts down all the 0s, then the 1s, 2s, and so on. To exclude
+# a UPS from the shutdown sequence, set this to -1.
+#
+# The default value for this parameter is 0.
+#
+# nolock: optional, and not recommended for use in this file.
+#
+# If you put nolock in here, the driver will not lock the
+# serial port every time it starts. This may allow other
+# processes to seize the port if you start more than one by
+# mistake.
+#
+# This is only intended to be used on systems where locking
+# absolutely must be disabled for the software to work.
+#
+# maxstartdelay: optional. This can be set as a global variable
+# above your first UPS definition and it can also be
+# set in a UPS section. This value controls how long
+# upsdrvctl will wait for the driver to finish starting.
+# This keeps your system from getting stuck due to a
+# broken driver or UPS.
+#
+# The default is 45 seconds.
+#
+#
+# Anything else is passed through to the hardware-specific part of
+# the driver.
+#
+# Examples
+# --------
+#
+# A simple example for a UPS called "powerpal" that uses the fentonups
+# driver on /dev/ttyS0 is:
+#
+# [powerpal]
+# driver = fentonups
+# port = /dev/ttyS0
+# desc = "Web server"
+#
+# If your UPS driver requires additional settings, you can specify them
+# here. For example, if it supports a setting of "1234" for the
+# variable "cable", it would look like this:
+#
+# [myups]
+# driver = mydriver
+# port = /dev/ttyS1
+# cable = 1234
+# desc = "Something descriptive"
+#
+# To find out if your driver supports any extra settings, start it with
+# the -h option and/or read the driver's documentation.
diff --git a/package/nut/files/upsd.conf b/package/nut/files/upsd.conf
new file mode 100644
index 000000000..c165cfcf5
--- /dev/null
+++ b/package/nut/files/upsd.conf
@@ -0,0 +1,42 @@
+# Network UPS Tools: example upsd configuration file
+#
+# This file contains access control data, you should keep it secure.
+#
+# It should only be readable by the user that upsd becomes. See the FAQ.
+
+# =======================================================================
+# Access Control Lists (ACLs)
+#
+# ACL <name> <ipblock>
+# ACL myhost 10.0.0.1/32
+#
+# ACCEPT <aclname> [<aclname>...]
+# REJECT <aclname> [<aclname>...]
+#
+# Define lists of hosts or networks with ACL definitions.
+#
+# ACCEPT and REJECT use ACL definitions to control whether a host is
+# allowed to connect to upsd.
+#
+# This default configuration only gives access to localhost. To allow
+# other hosts or networks to connect, see the documentation and change
+# these lines.
+
+ACL all 0.0.0.0/0
+ACL localhost 127.0.0.1/32
+
+ACCEPT localhost
+REJECT all
+
+# =======================================================================
+# MAXAGE <seconds>
+# MAXAGE 15
+#
+# This defaults to 15 seconds. After a UPS driver has stopped updating
+# the data for this many seconds, upsd marks it stale and stops making
+# that information available to clients. After all, the only thing worse
+# than no data is bad data.
+#
+# You should only use this if your driver has difficulties keeping
+# the data fresh within the normal 15 second interval. Watch the syslog
+# for notifications from upsd about staleness.
diff --git a/package/nut/files/upsd.init b/package/nut/files/upsd.init
new file mode 100644
index 000000000..e3afadbba
--- /dev/null
+++ b/package/nut/files/upsd.init
@@ -0,0 +1,30 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${upsd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/state/ups ] || mkdir -p /var/state/ups
+ /usr/bin/upsdrvctl start || exit 1
+ /usr/sbin/upsd || exit 2
+ ;;
+stop)
+ /usr/sbin/upsd -c stop || killall upsd
+ /usr/bin/upsdrvctl stop
+ ;;
+restart)
+ sh $0 stop
+ sleep 1
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/nut/ipkg/nut.conffiles b/package/nut/ipkg/nut.conffiles
new file mode 100644
index 000000000..df6dd3071
--- /dev/null
+++ b/package/nut/ipkg/nut.conffiles
@@ -0,0 +1,2 @@
+/etc/ups.conf
+/etc/upsd.conf
diff --git a/package/nut/ipkg/nut.control b/package/nut/ipkg/nut.control
new file mode 100644
index 000000000..a896bfd60
--- /dev/null
+++ b/package/nut/ipkg/nut.control
@@ -0,0 +1,4 @@
+Package: nut
+Priority: optional
+Section: sys
+Description: Network UPS Tools
diff --git a/package/nut/ipkg/nut.postinst b/package/nut/ipkg/nut.postinst
new file mode 100644
index 000000000..cd5faf1af
--- /dev/null
+++ b/package/nut/ipkg/nut.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf upsd upsd NO
+
diff --git a/package/obexftp/Config.in b/package/obexftp/Config.in
new file mode 100644
index 000000000..97a5f86be
--- /dev/null
+++ b/package/obexftp/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_OBEXFTP
+ prompt "obexftp........................... obexftp applications"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBICONV
+ select ADK_PACKAGE_OPENOBEX
+ help
+ http://openobex.triq.net/
diff --git a/package/obexftp/Makefile b/package/obexftp/Makefile
new file mode 100644
index 000000000..b8fa2f38c
--- /dev/null
+++ b/package/obexftp/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= obexftp
+PKG_VERSION:= 0.20
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 86224a7a1880c25e9ba0b8997a97d299
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=openobex/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OBEXFTP,obexftp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= OPENOBEX_CFLAGS="-I${STAGING_DIR}/usr/include" \
+ OPENOBEX_LIBS="-L${STAGING_DIR}/usr/lib \
+ -lopenobex -lbluetooth -liconv"
+CONFIGURE_ARGS+= --disable-perl \
+ --disable-python
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_OBEXFTP}/usr/bin
+ ${INSTALL_DIR} ${IDIR_OBEXFTP}/usr/lib
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_OBEXFTP}/usr/bin/
+ ${CP} ${WRKINST}/usr/lib/* ${IDIR_OBEXFTP}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/obexftp/ipkg/obexftp.control b/package/obexftp/ipkg/obexftp.control
new file mode 100644
index 000000000..b77712e14
--- /dev/null
+++ b/package/obexftp/ipkg/obexftp.control
@@ -0,0 +1,5 @@
+Package: obexftp
+Priority: optional
+Section: bluetooth
+Description: obex ftp applications
+Depends: openobex, libiconv
diff --git a/package/olsrd/Config.in b/package/olsrd/Config.in
new file mode 100644
index 000000000..c715b9ada
--- /dev/null
+++ b/package/olsrd/Config.in
@@ -0,0 +1,36 @@
+#menu "olsrd............................. OLSR (Optimized Link State Routing) daemon"
+
+config ADK_PACKAGE_OLSRD
+ prompt "olsrd............................. OLSR (Optimized Link State Routing) daemon"
+ tristate
+ default n
+ help
+ The Optimized Link State Routing daemon
+
+ http://www.olsr.org/
+
+config ADK_PACKAGE_OLSRD_MOD_DYN_GW
+ prompt " olsrd-mod-dyn-gw.............. Dynamic internet gateway plugin"
+ tristate
+ default n
+ depends ADK_PACKAGE_OLSRD
+
+config ADK_PACKAGE_OLSRD_MOD_HTTPINFO
+ prompt " olsrd-mod-httpinfo............ Small informative web server plugin"
+ tristate
+ default n
+ depends ADK_PACKAGE_OLSRD
+
+config ADK_PACKAGE_OLSRD_MOD_NAMESERVICE
+ prompt " olsrd-mod-nameservice......... Lightweight hostname resolver plugin"
+ tristate
+ default n
+ depends ADK_PACKAGE_OLSRD
+
+config ADK_PACKAGE_OLSRD_MOD_TAS
+ prompt " olsrd-mod-tas................. Tiny Application Server (TAS) plugin for olsrd"
+ tristate
+ default n
+ depends ADK_PACKAGE_OLSRD
+
+#endmenu
diff --git a/package/olsrd/Makefile b/package/olsrd/Makefile
new file mode 100644
index 000000000..51e512463
--- /dev/null
+++ b/package/olsrd/Makefile
@@ -0,0 +1,58 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= olsrd
+PKG_VERSION:= 0.5.6-r2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= acf15dbd0af521a6826541b567c6473a
+MASTER_SITES:= http://www.olsr.org/releases/0.5/
+
+include ${TOPDIR}/mk/package.mk
+
+define PKG_mod_template
+
+INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
+
+${2}-install:
+ $${INSTALL_DIR} $${IDIR_${1}}/usr/lib
+ $${CP} $${WRKINST}/usr/lib/olsrd_${2}.so.* $${IDIR_${1}}/usr/lib/
+
+endef
+
+$(eval $(call PKG_template,OLSRD,olsrd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OLSRD_MOD_DYN_GW,olsrd-mod-dyn-gw,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OLSRD_MOD_HTTPINFO,olsrd-mod-httpinfo,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OLSRD_MOD_NAMESERVICE,olsrd-mod-nameservice,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OLSRD_MOD_TAS,olsrd-mod-tas,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+$(eval $(call PKG_mod_template,OLSRD_MOD_DYN_GW,dyn_gw))
+$(eval $(call PKG_mod_template,OLSRD_MOD_HTTPINFO,httpinfo))
+$(eval $(call PKG_mod_template,OLSRD_MOD_NAMESERVICE,nameservice))
+$(eval $(call PKG_mod_template,OLSRD_MOD_TAS,tas))
+
+
+do-build:
+ rm -rf ${WRKINST}
+ mkdir -p ${WRKINST}
+ ${MAKE} -C "${WRKBUILD}" \
+ ${TARGET_CONFIGURE_OPTS} \
+ NODEBUG=1 \
+ OFLAGS="${TARGET_CFLAGS}" \
+ OS="linux" \
+ DESTDIR="${WRKINST}" \
+ STRIP="/bin/true" \
+ all libs install install_libs
+
+do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
+ ${INSTALL_DIR} ${IDIR_OLSRD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_OLSRD}/usr/sbin
+ ${INSTALL_DATA} ${WRKINST}/etc/olsrd.conf ${IDIR_OLSRD}/etc/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/olsrd ${IDIR_OLSRD}/usr/sbin/
+ ${INSTALL_BIN} ./files/olsrd.init \
+ ${IDIR_OLSRD}/etc/init.d/olsrd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/olsrd/files/olsrd.init b/package/olsrd/files/olsrd.init
new file mode 100644
index 000000000..1e99a446b
--- /dev/null
+++ b/package/olsrd/files/olsrd.init
@@ -0,0 +1,22 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${olsrd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ olsrd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/olsrd/files/olsrd_secure_key b/package/olsrd/files/olsrd_secure_key
new file mode 100644
index 000000000..4a7d7258f
--- /dev/null
+++ b/package/olsrd/files/olsrd_secure_key
@@ -0,0 +1 @@
+1234567890123456 \ No newline at end of file
diff --git a/package/olsrd/ipkg/olsrd-mod-dot-draw.control b/package/olsrd/ipkg/olsrd-mod-dot-draw.control
new file mode 100644
index 000000000..f0a343282
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-dot-draw.control
@@ -0,0 +1,5 @@
+Package: olsrd-mod-dot-draw
+Priority: optional
+Section: net
+Description: a dot topology information plugin for olsrd
+Depends: olsrd
diff --git a/package/olsrd/ipkg/olsrd-mod-dyn-gw.control b/package/olsrd/ipkg/olsrd-mod-dyn-gw.control
new file mode 100644
index 000000000..69a41a5b1
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-dyn-gw.control
@@ -0,0 +1,5 @@
+Package: olsrd-mod-dyn-gw
+Priority: optional
+Section: net
+Description: a dynamic internet gateway plugin for olsrd
+Depends: olsrd
diff --git a/package/olsrd/ipkg/olsrd-mod-httpinfo.control b/package/olsrd/ipkg/olsrd-mod-httpinfo.control
new file mode 100644
index 000000000..770dc0474
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-httpinfo.control
@@ -0,0 +1,5 @@
+Package: olsrd-mod-httpinfo
+Priority: optional
+Section: net
+Description: a small informative web server plugin for olsrd
+Depends: olsrd
diff --git a/package/olsrd/ipkg/olsrd-mod-nameservice.control b/package/olsrd/ipkg/olsrd-mod-nameservice.control
new file mode 100644
index 000000000..2caa8152b
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-nameservice.control
@@ -0,0 +1,5 @@
+Package: olsrd-mod-nameservice
+Priority: optional
+Section: net
+Description: a lightweight hostname resolver plugin for olsrd
+Depends: olsrd
diff --git a/package/olsrd/ipkg/olsrd-mod-power.control b/package/olsrd/ipkg/olsrd-mod-power.control
new file mode 100644
index 000000000..168126b3d
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-power.control
@@ -0,0 +1,5 @@
+Package: olsrd-mod-power
+Priority: optional
+Section: net
+Description: a power status plugin for olsrd
+Depends: olsrd
diff --git a/package/olsrd/ipkg/olsrd-mod-secure.conffiles b/package/olsrd/ipkg/olsrd-mod-secure.conffiles
new file mode 100644
index 000000000..34e90b80a
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-secure.conffiles
@@ -0,0 +1 @@
+/etc/olsrd.d/olsrd_secure_key
diff --git a/package/olsrd/ipkg/olsrd-mod-secure.control b/package/olsrd/ipkg/olsrd-mod-secure.control
new file mode 100644
index 000000000..ff2eb3a9a
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-secure.control
@@ -0,0 +1,5 @@
+Package: olsrd-mod-secure
+Priority: optional
+Section: net
+Description: a message signing plugin to secure olsrd routing domain
+Depends: olsrd
diff --git a/package/olsrd/ipkg/olsrd-mod-tas.control b/package/olsrd/ipkg/olsrd-mod-tas.control
new file mode 100644
index 000000000..91ad4c665
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd-mod-tas.control
@@ -0,0 +1,5 @@
+Package: olsrd-mod-tas
+Priority: optional
+Section: net
+Description: a Tiny Application Server (TAS) plugin for olsrd
+Depends: olsrd
diff --git a/package/olsrd/ipkg/olsrd.conffiles b/package/olsrd/ipkg/olsrd.conffiles
new file mode 100644
index 000000000..a0b5e8eaa
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd.conffiles
@@ -0,0 +1 @@
+/etc/olsrd.conf
diff --git a/package/olsrd/ipkg/olsrd.control b/package/olsrd/ipkg/olsrd.control
new file mode 100644
index 000000000..37cdf0908
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd.control
@@ -0,0 +1,8 @@
+Package: olsrd
+Priority: optional
+Section: net
+Description: The olsr.org OLSR daemon
+ olsrd is an implementation of the Optimized Link State Routing protocol.
+ OLSR is a routing protocol for mobile ad-hoc networks. The protocol is
+ pro-active, table driven and utilizes a technique called multipoint
+ relaying for message flooding.
diff --git a/package/olsrd/ipkg/olsrd.postinst b/package/olsrd/ipkg/olsrd.postinst
new file mode 100644
index 000000000..fb6fa2bca
--- /dev/null
+++ b/package/olsrd/ipkg/olsrd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf olsrd olsrd NO
diff --git a/package/olsrd/patches/patch-make_Makefile_linux b/package/olsrd/patches/patch-make_Makefile_linux
new file mode 100644
index 000000000..5ea807341
--- /dev/null
+++ b/package/olsrd/patches/patch-make_Makefile_linux
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- olsrd-0.5.6-r2.orig/make/Makefile.linux 2008-10-03 14:45:07.000000000 +0200
++++ olsrd-0.5.6-r2/make/Makefile.linux 2008-12-08 03:23:50.000000000 +0100
+@@ -4,7 +4,7 @@
+
+ ARCH := $(shell uname -m)
+ DESTDIR ?=
+-LIBDIR = $(DESTDIR)$(shell if [ "$(ARCH)" = "x86_64" -a -d "/usr/lib64" ]; then echo "/usr/lib64"; else echo "/usr/lib"; fi)
++LIBDIR = $(DESTDIR)/usr/lib
+
+ SRCS += $(wildcard src/linux/*.c src/unix/*.c)
+ HDRS += $(wildcard src/linux/*.h src/unix/*.h)
diff --git a/package/opencdk/Config.in b/package/opencdk/Config.in
new file mode 100644
index 000000000..dffbc2b32
--- /dev/null
+++ b/package/opencdk/Config.in
@@ -0,0 +1,21 @@
+config ADK_PACKAGE_OPENCDK
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBOPENCDK
+
+config ADK_PACKAGE_LIBOPENCDK
+ prompt "libopencdk........................ The Open Crypto Development Kit library"
+ tristate
+ default n
+ select ADK_PACKAGE_OPENCDK
+ select ADK_PACKAGE_LIBGCRYPT
+ select ADK_PACKAGE_LIBGPG_ERROR
+ select ADK_PACKAGE_ZLIB
+ help
+ This library provides basic parts of the OpenPGP message format.
+ For reference, please read the rfc2440.txt in the doc/ directory.
+ Due to some possible security problems, the library also implements
+ parts of draft-ietf-openpgp-rfc2440bis-08.txt. If you want to exchange
+ messages with earlier PGP version < 7, you should use the compat mode.
+
+ ftp://ftp.gnutls.org/pub/gnutls/opencdk/
diff --git a/package/opencdk/Makefile b/package/opencdk/Makefile
new file mode 100644
index 000000000..833b0bbeb
--- /dev/null
+++ b/package/opencdk/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= opencdk
+PKG_VERSION:= 0.6.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7bfc820bcdc08f0c31f860710368071e
+
+MASTER_SITES:= ftp://ftp.gnutls.org/pub/gnutls/opencdk/ \
+ ftp://ftp.gnupg.org/gcrypt/alpha/gnutls/opencdk/ \
+ http://www.mirrors.wiretapped.net/security/network-security/gnutls/opencdk/ \
+ ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/opencdk/ \
+ http://josefsson.org/gnutls/releases/opencdk/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBOPENCDK,libopencdk,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-libgcrypt-prefix='${STAGING_DIR}/usr'
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBOPENCDK}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libopencdk.so.* ${IDIR_LIBOPENCDK}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/opencdk/ipkg/libopencdk.control b/package/opencdk/ipkg/libopencdk.control
new file mode 100644
index 000000000..257bed1c6
--- /dev/null
+++ b/package/opencdk/ipkg/libopencdk.control
@@ -0,0 +1,5 @@
+Package: libopencdk
+Priority: optional
+Section: libs
+Description: Open Crypto Development Kit library
+Depends: libgcrypt, libgpg-error, zlib
diff --git a/package/opencdk/patches/patch-configure b/package/opencdk/patches/patch-configure
new file mode 100644
index 000000000..6fc79ec8d
--- /dev/null
+++ b/package/opencdk/patches/patch-configure
@@ -0,0 +1,14 @@
+$Id$
+--- opencdk-0.6.4.orig/configure Mon Jun 11 10:25:19 2007
++++ opencdk-0.6.4/configure Thu Sep 6 15:42:04 2007
+@@ -20379,8 +20379,8 @@ echo "$as_me: error:
+
+
+
+-LIBOPENCDK_LIBS="-L${libdir} -lopencdk $LIBGCRYPT_LIBS $LIBS"
+-LIBOPENCDK_CFLAGS="$LIBGCRYPT_CFLAGS -I${includedir}"
++LIBOPENCDK_LIBS="$LIBS -lopencdk $LIBGCRYPT_LIBS"
++LIBOPENCDK_CFLAGS="$LIBGCRYPT_CFLAGS"
+
+
+
diff --git a/package/openct/Config.in b/package/openct/Config.in
new file mode 100644
index 000000000..082ae18a3
--- /dev/null
+++ b/package/openct/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_OPENCT
+ prompt "openct............................ openct"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBLTDL
+ select ADK_PACKAGE_LIBUSB
+ help
+ openct
diff --git a/package/openct/Makefile b/package/openct/Makefile
new file mode 100644
index 000000000..ebb085782
--- /dev/null
+++ b/package/openct/Makefile
@@ -0,0 +1,39 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openct
+PKG_VERSION:= 0.6.15
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 70205beac03974e266fc259b6c9feaa8
+MASTER_SITES:= http://www.opensc-project.org/files/openct/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OPENCT,openct,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_OPENCT}/etc
+ ${INSTALL_DIR} ${IDIR_OPENCT}/usr/bin
+ ${INSTALL_DIR} ${IDIR_OPENCT}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_OPENCT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libopenct.so.* \
+ ${IDIR_OPENCT}/usr/lib
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/openct-control \
+ ${IDIR_OPENCT}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ifd* \
+ ${IDIR_OPENCT}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/openct-tool \
+ ${IDIR_OPENCT}/usr/bin
+ ${INSTALL_DATA} ${WRKBUILD}/etc/openct.conf \
+ ${IDIR_OPENCT}/etc
+
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openct/ipkg/openct.control b/package/openct/ipkg/openct.control
new file mode 100644
index 000000000..eb8307711
--- /dev/null
+++ b/package/openct/ipkg/openct.control
@@ -0,0 +1,5 @@
+Package: openct
+Priority: optional
+Section: crypto
+Depends: libltdl, libusb
+Description: openct
diff --git a/package/openldap/Config.in b/package/openldap/Config.in
new file mode 100644
index 000000000..5a3c29c6e
--- /dev/null
+++ b/package/openldap/Config.in
@@ -0,0 +1,33 @@
+config ADK_COMPILE_OPENLDAP
+ prompt "openldap.......................... OpenSource LDAP software"
+ boolean
+ default n
+
+config ADK_PACKAGE_OPENLDAP_SLAPD
+ prompt "openldap-slapd.................. OpenLDAP server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENLDAP
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBDB
+ select ADK_PACKAGE_LIBSASL2
+ depends on ADK_COMPILE_OPENLDAP
+ help
+ http://www.openldap.org/
+
+config ADK_PACKAGE_OPENLDAP_UTILS
+ prompt "openldap-utils.................. OpenLDAP client utilities"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENLDAP
+ depends on ADK_COMPILE_OPENLDAP
+ help
+
+ OpenLDAP Software is an open source implementation of the
+ Lightweight Directory Access Protocol (LDAP).
+
+ http://www.openldap.org/
+
+ This package contains client programs required to access LDAP servers.
+
diff --git a/package/openldap/Config.in.lib b/package/openldap/Config.in.lib
new file mode 100644
index 000000000..6efae3dc3
--- /dev/null
+++ b/package/openldap/Config.in.lib
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_LIBOPENLDAP
+ prompt "libopenldap....................... OpenLDAP client libraries"
+ tristate
+ default n
+ depends on ADK_COMPILE_OPENLDAP
+ select ADK_PACKAGE_LIBSASL2
+ help
+
+ OpenLDAP Software is an open source implementation of the
+ Lightweight Directory Access Protocol (LDAP).
+
+ http://www.openldap.org/
+
+ This package contains the shared LDAP client libraries, needed by other programs.
+
diff --git a/package/openldap/Makefile b/package/openldap/Makefile
new file mode 100644
index 000000000..358794f0f
--- /dev/null
+++ b/package/openldap/Makefile
@@ -0,0 +1,82 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openldap
+PKG_VERSION:= 2.4.16
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ed5b86e9d2b372d10edfe3bb59fee165
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+MASTER_SITES:= ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
+ ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
+ ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
+ ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
+
+PKG_CONFIGURE_OPTIONS+= \
+ --enable-slapd \
+ --enable-bdb \
+ --disable-hdb \
+ --disable-relay \
+ --enable-dynamic \
+ --enable-syslog \
+ --enable-local \
+ --disable-syncprov \
+ --disable-slurpd \
+ --without-gssapi \
+ --without-fetch \
+ --with-cyrus-sasl \
+ --with-threads \
+ --with-tls \
+ --with-yielding_select="yes" \
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBOPENLDAP,libopenldap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OPENLDAP_UTILS,openldap-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OPENLDAP_SLAPD,openldap-slapd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+pre-configure:
+ (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
+ CPPFLAGS=-D_GNU_SOURCE ./configure \
+ ${PKG_CONFIGURE_OPTIONS} \
+ --disable-slapd \
+ --without-cyrus-sasl \
+ --without-threads \
+ --without-tls \
+ );
+ ${MAKE} -C ${WRKBUILD} depend
+ ${MAKE} -C ${WRKBUILD}/libraries/liblutil
+ ${MAKE} -C ${WRKBUILD}/libraries/liblber
+ ${MAKE} -C ${WRKBUILD}/libraries/liblunicode
+ ${MAKE} -C ${WRKBUILD}/libraries/liblber clean
+ ${MAKE} -C ${WRKBUILD}/libraries/liblutil clean
+ ${MAKE} -C ${WRKBUILD}/libraries/liblunicode clean
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_memcmp_working=yes
+CONFIGURE_ARGS+= ${PKG_CONFIGURE_OPTIONS}
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= STRIP=""
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBOPENLDAP}/etc/openldap
+ ${CP} ${WRKINST}/etc/openldap/ldap.conf ${IDIR_LIBOPENLDAP}/etc/openldap/
+ ${INSTALL_DIR} ${IDIR_LIBOPENLDAP}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/lib{lber,ldap}*.so.* ${IDIR_LIBOPENLDAP}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_OPENLDAP_UTILS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/ldap* ${IDIR_OPENLDAP_UTILS}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_OPENLDAP_SLAPD}/etc/openldap/schema
+ ${INSTALL_DIR} ${IDIR_OPENLDAP_SLAPD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_OPENLDAP_SLAPD}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/slap* ${IDIR_OPENLDAP_SLAPD}/usr/sbin/
+ ${INSTALL_DATA} ${WRKINST}/etc/openldap/schema/core.schema \
+ ${IDIR_OPENLDAP_SLAPD}/etc/openldap/schema
+ ${INSTALL_DATA} ./files/slapd.conf ${IDIR_OPENLDAP_SLAPD}/etc/openldap
+ ${INSTALL_DATA} ./files/slapd.init \
+ ${IDIR_OPENLDAP_SLAPD}/etc/init.d/slapd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openldap/files/slapd.conf b/package/openldap/files/slapd.conf
new file mode 100644
index 000000000..d458fc495
--- /dev/null
+++ b/package/openldap/files/slapd.conf
@@ -0,0 +1,30 @@
+# See slapd.conf(5) for details on configuration options.
+# This file should NOT be world readable.
+#
+include /etc/openldap/schema/core.schema
+
+pidfile /var/run/slapd.pid
+argsfile /var/run/slapd.args
+
+# Load dynamic backend modules:
+# modulepath /usr/sbin/openldap
+# moduleload back_bdb.la
+# moduleload back_hdb.la
+# moduleload back_ldap.la
+
+#######################################################################
+# BDB database definitions
+#######################################################################
+database bdb
+suffix "dc=my-domain,dc=com"
+rootdn "cn=Manager,dc=my-domain,dc=com"
+# Cleartext passwords, especially for the rootdn, should
+# be avoid. See slappasswd(8) and slapd.conf(5) for details.
+# Use of strong authentication encouraged.
+rootpw secret
+# The database directory MUST exist prior to running slapd AND
+# should only be accessible by the slapd and slap tools.
+# Mode 700 recommended.
+directory /var/openldap-data
+# Indices to maintain
+index objectClass eq
diff --git a/package/openldap/files/slapd.init b/package/openldap/files/slapd.init
new file mode 100644
index 000000000..814345c44
--- /dev/null
+++ b/package/openldap/files/slapd.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $slapd = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/slapd
+ ;;
+stop)
+ if [ -e /var/run/slapd.pid ]; then
+ kill $(cat /var/run/slapd.pid)
+ fi
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/openldap/ipkg/libopenldap.conffiles b/package/openldap/ipkg/libopenldap.conffiles
new file mode 100644
index 000000000..25f44c322
--- /dev/null
+++ b/package/openldap/ipkg/libopenldap.conffiles
@@ -0,0 +1 @@
+/etc/openldap/ldap.conf
diff --git a/package/openldap/ipkg/libopenldap.control b/package/openldap/ipkg/libopenldap.control
new file mode 100644
index 000000000..84b145f58
--- /dev/null
+++ b/package/openldap/ipkg/libopenldap.control
@@ -0,0 +1,5 @@
+Package: libopenldap
+Priority: optional
+Section: libs
+Description: OpenLDAP (Lightweight Directory Access Protocol) client libraries
+Depends: libopenssl, libsasl2
diff --git a/package/openldap/ipkg/openldap-slapd.control b/package/openldap/ipkg/openldap-slapd.control
new file mode 100644
index 000000000..c5b9e12d4
--- /dev/null
+++ b/package/openldap/ipkg/openldap-slapd.control
@@ -0,0 +1,5 @@
+Package: openldap-slapd
+Priority: optional
+Section: admin
+Description: OpenLDAP server
+Depends: libopenldap, libopenssl, libsasl2, libdb, libpthread
diff --git a/package/openldap/ipkg/openldap-slapd.postinst b/package/openldap/ipkg/openldap-slapd.postinst
new file mode 100644
index 000000000..d6ecee377
--- /dev/null
+++ b/package/openldap/ipkg/openldap-slapd.postinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_user slapd $(get_next_uid) $(get_next_gid) /var/run/slapd
+add_group slapd $(get_next_gid)
+add_rcconf 'use "YES" to enable' slapd NO
diff --git a/package/openldap/ipkg/openldap-utils.control b/package/openldap/ipkg/openldap-utils.control
new file mode 100644
index 000000000..3a515c69f
--- /dev/null
+++ b/package/openldap/ipkg/openldap-utils.control
@@ -0,0 +1,5 @@
+Package: openldap-utils
+Priority: optional
+Section: admin
+Description: OpenLDAP (Lightweight Directory Access Protocol) client utilities
+Depends: libopenldap, libopenssl, libsasl2
diff --git a/package/openntpd/Config.in b/package/openntpd/Config.in
new file mode 100644
index 000000000..c9d29a6fd
--- /dev/null
+++ b/package/openntpd/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_OPENNTPD
+ prompt "openntpd.......................... A free and easy to use NTP (Network Time Protocol) implementation"
+ tristate
+ default n
+ help
+ NTP server
+
+ http://www.openntpd.org/
+
diff --git a/package/openntpd/Makefile b/package/openntpd/Makefile
new file mode 100644
index 000000000..a068f83d5
--- /dev/null
+++ b/package/openntpd/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openntpd
+PKG_VERSION:= 3.9p1
+PKG_RELEASE:= 17
+PKG_MD5SUM:= afc34175f38d08867c1403d9008600b3
+
+MASTER_SITES:= ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/ \
+ ftp://ftp.de.openbsd.org/pub/unix/OpenBSD/OpenNTPD/ \
+ ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenNTPD/ \
+ ftp://ftp.sunet.se/pub/OpenBSD/OpenNTPD/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OPENNTPD,openntpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-privsep-user=ntp \
+ --with-adjtimex
+BUILD_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_OPENNTPD}/etc
+ ${INSTALL_DATA} ./files/ntpd.conf ${IDIR_OPENNTPD}/etc/
+ ${INSTALL_DIR} ${IDIR_OPENNTPD}/etc/init.d
+ ${INSTALL_DATA} ./files/ntpd.init ${IDIR_OPENNTPD}/etc/init.d/ntpd
+ ${INSTALL_DIR} ${IDIR_OPENNTPD}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/ntpd ${IDIR_OPENNTPD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openntpd/extra/openbsd-compat/port-linux.c b/package/openntpd/extra/openbsd-compat/port-linux.c
new file mode 100644
index 000000000..f210d4a6d
--- /dev/null
+++ b/package/openntpd/extra/openbsd-compat/port-linux.c
@@ -0,0 +1,107 @@
+/* $Id: port-linux.c 1793 2007-01-28 20:55:08Z tg $ */
+
+/* part of the adjtime-linux patch */
+
+/*
+ * Copyright (c) 2004 Darren Tucker <dtucker at zip com au>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "includes.h"
+
+#ifdef USE_ADJTIMEX
+#include <sys/timex.h>
+#include <errno.h>
+#ifdef adjtime
+# undef adjtime
+#endif
+
+#include "ntpd.h"
+
+/* scale factor used by adjtimex freq param. 1 ppm = 65536 */
+#define ADJTIMEX_FREQ_SCALE 65536
+
+/* maximum change to skew per adjustment, in PPM */
+#define MAX_SKEW_DELTA 5.0
+
+int
+_compat_adjtime(const struct timeval *delta, struct timeval *olddelta)
+{
+ static struct timeval tlast = {0,0};
+ static double tskew = 0;
+ static int synced = -1;
+ struct timeval tnow, tdelta;
+ double skew = 0, newskew, deltaskew, adjust, interval = 0;
+ struct timex tmx;
+ int result, saved_errno;
+
+ gettimeofday(&tnow, NULL);
+ adjust = (double)delta->tv_sec;
+ adjust += (double)delta->tv_usec / 1000000;
+
+ /* Even if the caller doesn't care about the olddelta, we do */
+ if (olddelta == NULL)
+ olddelta = &tdelta;
+
+ result = adjtime(delta, olddelta);
+ saved_errno = errno;
+
+ if (olddelta->tv_sec == 0 && olddelta->tv_usec == 0 &&
+ synced != INT_MAX)
+ synced++;
+ else
+ synced = 0;
+
+ /*
+ * do skew calculations if we have synced
+ */
+ if (synced == 0 ) {
+ tmx.modes = 0;
+ if (adjtimex(&tmx) == -1)
+ log_warn("adjtimex get failed");
+ else
+ tskew = (double)tmx.freq / ADJTIMEX_FREQ_SCALE;
+ } else if (synced >= 1) {
+ interval = (double)(tnow.tv_sec - tlast.tv_sec);
+ interval += (double)(tnow.tv_usec - tlast.tv_usec) / 1000000;
+
+ skew = (adjust * 1000000) / interval;
+ newskew = ((tskew * synced) + skew) / synced;
+ deltaskew = newskew - tskew;
+
+ if (deltaskew > MAX_SKEW_DELTA) {
+ log_info("skew change %0.3lf exceeds limit", deltaskew);
+ tskew += MAX_SKEW_DELTA;
+ } else if (deltaskew < -MAX_SKEW_DELTA) {
+ log_info("skew change %0.3lf exceeds limit", deltaskew);
+ tskew -= MAX_SKEW_DELTA;
+ } else {
+ tskew = newskew;
+ }
+
+ /* Adjust the kernel skew. */
+ tmx.freq = (long)(tskew * ADJTIMEX_FREQ_SCALE);
+ tmx.modes = ADJ_FREQUENCY;
+ if (adjtimex(&tmx) == -1)
+ log_warn("adjtimex set freq failed");
+ }
+
+ log_debug("interval %0.3lf skew %0.3lf total skew %0.3lf", interval,
+ skew, tskew);
+
+ tlast = tnow;
+ errno = saved_errno;
+ return result;
+}
+#endif
diff --git a/package/openntpd/files/ntpd.conf b/package/openntpd/files/ntpd.conf
new file mode 100644
index 000000000..d20963472
--- /dev/null
+++ b/package/openntpd/files/ntpd.conf
@@ -0,0 +1,8 @@
+# Addresses to listen on
+listen on 0.0.0.0
+# enable this for IPv6 support
+#listen on ::
+
+# use a random selection of 8 public stratum 2 servers
+# see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
+servers pool.ntp.org
diff --git a/package/openntpd/files/ntpd.init b/package/openntpd/files/ntpd.init
new file mode 100644
index 000000000..2eab0668c
--- /dev/null
+++ b/package/openntpd/files/ntpd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 55
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $ntpd_flags = NO ]] && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p /tmp/.ntp
+ /usr/sbin/ntpd $ntpd_flags
+ ;;
+stop)
+ kill $(pidof ntpd|cut -d ' ' -f 3)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/openntpd/ipkg/openntpd.conffiles b/package/openntpd/ipkg/openntpd.conffiles
new file mode 100644
index 000000000..81306c3c9
--- /dev/null
+++ b/package/openntpd/ipkg/openntpd.conffiles
@@ -0,0 +1 @@
+/etc/ntpd.conf
diff --git a/package/openntpd/ipkg/openntpd.control b/package/openntpd/ipkg/openntpd.control
new file mode 100644
index 000000000..05e16a888
--- /dev/null
+++ b/package/openntpd/ipkg/openntpd.control
@@ -0,0 +1,7 @@
+Package: openntpd
+Priority: optional
+Section: net
+Description: OpenNTPD is a FREE, easy to use implementation of NTP
+ (the Network Time Protocol). It provides the ability to sync the
+ local clock to remote NTP servers and can act as NTP server itself,
+ redistributing the local clock.
diff --git a/package/openntpd/ipkg/openntpd.postinst b/package/openntpd/ipkg/openntpd.postinst
new file mode 100644
index 000000000..53bc8c387
--- /dev/null
+++ b/package/openntpd/ipkg/openntpd.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+gid=$(get_next_gid)
+add_group ntp $gid
+add_user ntp $(get_next_uid) $gid /tmp/.ntp
+add_service ntp 123/udp
+add_rcconf 'e.g. "-s"' ntpd_flags
diff --git a/package/openntpd/patches/patch-client_c b/package/openntpd/patches/patch-client_c
new file mode 100644
index 000000000..37c0c89a7
--- /dev/null
+++ b/package/openntpd/patches/patch-client_c
@@ -0,0 +1,17 @@
+$Id$
+
+ bugfix from MirBSD ntpd: do not hardcode the number
+ of required adjustment offsets, use the constant
+ instead, MirOS commitid 10047041D2145A88E16
+
+--- openntpd-3.9p1.orig/client.c Sun May 14 05:28:58 2006
++++ openntpd-3.9p1/client.c Mon Oct 8 12:08:30 2007
+@@ -314,7 +314,7 @@ client_update(struct ntp_peer *p)
+ best = i;
+ }
+
+- if (good < 8)
++ if (good < OFFSET_ARRAY_SIZE)
+ return (-1);
+
+ memcpy(&p->update, &p->reply[best], sizeof(p->update));
diff --git a/package/openntpd/patches/patch-configure_ac b/package/openntpd/patches/patch-configure_ac
new file mode 100644
index 000000000..aa98cb71d
--- /dev/null
+++ b/package/openntpd/patches/patch-configure_ac
@@ -0,0 +1,18 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/configure.ac 2006-05-14 05:29:23.000000000 +0000
++++ openntpd-3.9p1/configure.ac 2007-01-28 20:49:48.000000000 +0000
+@@ -617,6 +617,11 @@ else
+ fi
+ AC_SUBST(mansubdir)
+
++AC_ARG_WITH(adjtimex,
++ [ --with-adjtimex Use adjtimex to adjust kernel skew],
++ [ AC_DEFINE(USE_ADJTIMEX, [], [Use adjust skew with adjtimex (experimental)]) ]
++)
++
+ # Search for OpenSSL if required.
+ if test "$ac_cv_func_arc4random" != "yes" && test "x$builtin_arc4random" != "xyes"; then
+ saved_CPPFLAGS="$CPPFLAGS"
diff --git a/package/openntpd/patches/patch-defines_h b/package/openntpd/patches/patch-defines_h
new file mode 100644
index 000000000..9e2b35bf1
--- /dev/null
+++ b/package/openntpd/patches/patch-defines_h
@@ -0,0 +1,17 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/defines.h 2006-05-14 05:29:21.000000000 +0000
++++ openntpd-3.9p1/defines.h 2007-01-28 20:49:48.000000000 +0000
+@@ -20,6 +20,10 @@
+ # define setproctitle(x)
+ #endif
+
++#ifdef USE_ADJTIMEX
++# define adjtime(a,b) (_compat_adjtime((a),(b)))
++#endif
++
+ #if !defined(SA_LEN)
+ # if defined(HAVE_STRUCT_SOCKADDR_SA_LEN)
+ # define SA_LEN(x) ((x)->sa_len)
diff --git a/package/openntpd/patches/patch-ntpd_h b/package/openntpd/patches/patch-ntpd_h
new file mode 100644
index 000000000..9189d6204
--- /dev/null
+++ b/package/openntpd/patches/patch-ntpd_h
@@ -0,0 +1,47 @@
+$Id$
+
+ ‣ OFFSET_ARRAY_SIZE
+ pull in the following diff from MirBSD:
+ | Commit ID: 100470A1C1009540C55
+ | CVSROOT: /cvs
+ | Module name: src
+ | Changes by: tg@herc.mirbsd.org 2007/10/08 12:04:34 UTC
+ |
+ | Modified files:
+ | usr.sbin/ntpd : ntpd.h
+ |
+ | Log message:
+ | reduce the number of probes in the clock filter down to 4, so that adjtime
+ | is called at least approx. 3 times a hour, greatly helping us to reduce the
+ | size of the spikes for systems with clock drift (but increasing susceptibi-
+ | lity to latency-induced low-quality responses)
+ |
+ | tested on herc/rant with a value of 3 (adjust about 4 times an hour)
+ |
+ | XXX this should be made an ntpd.conf option instead of a define ASAP
+ | XXX this should be reverted once we have adjfreq(2)
+ but we use 3 here due to employment of adjtimex() which reduces
+ usability of older deltas
+
+ ‣ SETTIME_MIN_OFFSET
+ reduce the minimum required time offset for 'ntpd -s' to
+ use settimeofday() instead of adjtime(), in order to provide
+ a faster time setting at start, since adjusting can take ages
+
+--- openntpd-3.9p1.orig/ntpd.h Sun May 14 05:28:58 2006
++++ openntpd-3.9p1/ntpd.h Mon Oct 8 12:17:58 2007
+@@ -55,8 +55,12 @@
+ #define QSCALE_OFF_MAX 0.50
+
+ #define QUERYTIME_MAX 15 /* single query might take n secs max */
+-#define OFFSET_ARRAY_SIZE 8
+-#define SETTIME_MIN_OFFSET 180 /* min offset for settime at start */
++#ifdef USE_ADJTIMEX
++#define OFFSET_ARRAY_SIZE 3 /* so they get invalidated faster */
++#else
++#define OFFSET_ARRAY_SIZE 4 /* min. 3, recommended 6, max. 8 */
++#endif
++#define SETTIME_MIN_OFFSET 12 /* min offset for settime at start */
+ #define SETTIME_TIMEOUT 15 /* max seconds to wait with -s */
+ #define LOG_NEGLIGEE 128 /* negligible drift to not log (ms) */
+
diff --git a/package/openntpd/patches/patch-openbsd-compat_Makefile_in b/package/openntpd/patches/patch-openbsd-compat_Makefile_in
new file mode 100644
index 000000000..c2660e499
--- /dev/null
+++ b/package/openntpd/patches/patch-openbsd-compat_Makefile_in
@@ -0,0 +1,15 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/openbsd-compat/Makefile.in 2006-05-14 05:29:19.000000000 +0000
++++ openntpd-3.9p1/openbsd-compat/Makefile.in 2007-01-28 20:49:48.000000000 +0000
+@@ -9,7 +9,7 @@ OPENBSD= asprintf.o daemon.o errx.o inet
+ COMPAT= atomicio.o bsd-arc4random.o bsd-misc.o bsd-poll.o \
+ bsd-snprintf.o bsd-getifaddrs.o bsd-setresuid.o \
+ bsd-setresgid.o fake-rfc2553.o
+-PORT= port-qnx.o
++PORT= port-linux.o port-qnx.o
+
+ VPATH=@srcdir@
+ CC=@CC@
diff --git a/package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h b/package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h
new file mode 100644
index 000000000..cdc7cc679
--- /dev/null
+++ b/package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h
@@ -0,0 +1,18 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/openbsd-compat/openbsd-compat.h 2006-05-14 05:29:19.000000000 +0000
++++ openntpd-3.9p1/openbsd-compat/openbsd-compat.h 2007-01-28 20:49:48.000000000 +0000
+@@ -46,6 +46,11 @@ int asprintf(char **, const char *,
+ __attribute__((__format__ (printf, 2, 3)));
+ #endif
+
++#ifdef USE_ADJTIMEX
++# include <sys/time.h>
++int _compat_adjtime(const struct timeval *, struct timeval *);
++#endif
++
+ #ifndef HAVE_INET_PTON
+ int inet_pton(int, const char *, void *);
+ #endif
diff --git a/package/openobex/Config.in b/package/openobex/Config.in
new file mode 100644
index 000000000..130dd0361
--- /dev/null
+++ b/package/openobex/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_OPENOBEX
+ prompt "openobex.......................... openobex library"
+ tristate
+ default n
+ select ADK_PACKAGE_BLUEZ
+ help
+ Free open source implementation of the Object Exchange (OBEX) protocol.
+
+ http://openobex.triq.net/
diff --git a/package/openobex/Makefile b/package/openobex/Makefile
new file mode 100644
index 000000000..0aa367504
--- /dev/null
+++ b/package/openobex/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openobex
+PKG_VERSION:= 1.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= feaa5dfe5151c0e70e8f868fa4648a43
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=openobex/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OPENOBEX,openobex,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= PKG_CONFIG=""
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_OPENOBEX}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libopenobex.so* ${IDIR_OPENOBEX}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openobex/ipkg/openobex.control b/package/openobex/ipkg/openobex.control
new file mode 100644
index 000000000..51805cdb8
--- /dev/null
+++ b/package/openobex/ipkg/openobex.control
@@ -0,0 +1,4 @@
+Package: openobex
+Priority: optional
+Section: bluetooth
+Description: Openobex
diff --git a/package/opensc/Config.in b/package/opensc/Config.in
new file mode 100644
index 000000000..3488d464b
--- /dev/null
+++ b/package/opensc/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_OPENSC
+ prompt "opensc............................ opensc"
+ tristate
+ default n
+ help
+ opensc
diff --git a/package/opensc/Makefile b/package/opensc/Makefile
new file mode 100644
index 000000000..a1d9e24f4
--- /dev/null
+++ b/package/opensc/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= opensc
+PKG_VERSION:= 0.11.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 419e9be372c2f9bbb3ce9704c929d5ec
+MASTER_SITES:= http://www.opensc-project.org/files/opensc/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OPENSC,opensc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_OPENSC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libopensc.so.* \
+ ${IDIR_OPENSC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpkcs15init.so.* \
+ ${IDIR_OPENSC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libscconf.so.* \
+ ${IDIR_OPENSC}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/opensc-pkcs11.so \
+ ${IDIR_OPENSC}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/opensc/ipkg/opensc.control b/package/opensc/ipkg/opensc.control
new file mode 100644
index 000000000..1b981261f
--- /dev/null
+++ b/package/opensc/ipkg/opensc.control
@@ -0,0 +1,4 @@
+Package: opensc
+Priority: optional
+Section: crypto
+Description: opensc
diff --git a/package/opensc/patches/patch-src_Makefile_in b/package/opensc/patches/patch-src_Makefile_in
new file mode 100644
index 000000000..367ed98ca
--- /dev/null
+++ b/package/opensc/patches/patch-src_Makefile_in
@@ -0,0 +1,14 @@
+$Id$
+--- opensc-0.11.1.orig/src/Makefile.in 2006-05-30 23:06:00.000000000 +0200
++++ opensc-0.11.1/src/Makefile.in 2007-04-08 13:21:01.000000000 +0200
+@@ -208,8 +208,8 @@ MAINTAINERCLEANFILES = Makefile.in
+ EXTRA_DIST = Makefile.mak
+
+ # Order IS important
+-SUBDIRS = common include scconf libopensc pkcs15init pkcs11 \
+- tests tools openssh signer
++SUBDIRS = common include scconf libopensc pkcs15init pkcs11
++
+
+ all: all-recursive
+
diff --git a/package/opensips/Config.in b/package/opensips/Config.in
new file mode 100644
index 000000000..bc03bd78a
--- /dev/null
+++ b/package/opensips/Config.in
@@ -0,0 +1,196 @@
+#menu "opensips........................... Configurable, free SIP server"
+
+config ADK_PACKAGE_OPENSIPS
+ prompt "opensips........................... Configurable, free SIP server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ Open SIP Express Router (OpenSER) is a high-performance,
+ configurable, free SIP server.
+
+config ADK_PACKAGE_OPENSIPS_MOD_ACCOUNTING
+ prompt " opensips-mod-acc............... Accounting support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable accounting support
+
+config ADK_PACKAGE_OPENSIPS_MOD_AUTH
+ prompt " opensips-mod-auth.............. Authentication support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable authentication support
+
+config ADK_PACKAGE_OPENSIPS_MOD_AUTH_DB
+ prompt " opensips-mod-auth-db......... Authentication with database support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS_MOD_AUTH
+ help
+ Enable authentication with database support
+
+config ADK_PACKAGE_OPENSIPS_MOD_AVPOPS
+ prompt " opensips-mod-avpops............ AVP options support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable AVP options support
+
+config ADK_PACKAGE_OPENSIPS_MOD_DISPATCHER
+ prompt " opensips-mod-dispatcher........ dispatcher support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable dispatcher options support
+
+config ADK_PACKAGE_OPENSIPS_MOD_DIVERSION
+ prompt " opensips-mod-diversion......... diversion support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable diversion options support
+
+config ADK_PACKAGE_OPENSIPS_MOD_FLATSTORE
+ prompt " opensips-mod-flatstore......... flatstore support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable flatstore support
+
+config ADK_PACKAGE_OPENSIPS_MOD_GFLAGS
+ prompt " opensips-mod-gflags............ gflags support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable GFlags support
+
+config ADK_PACKAGE_OPENSIPS_MOD_GROUP
+ prompt " opensips-mod-group............. group support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable group support
+
+config ADK_PACKAGE_OPENSIPS_MOD_MEDIAPROXY
+ prompt " opensips-mod-mediaproxy........ Mediaproxy support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable mediaproxy support
+
+config ADK_PACKAGE_OPENSIPS_MOD_MSILO
+ prompt " opensips-mod-msilo............. MSilo support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable msilo support
+
+config ADK_PACKAGE_OPENSIPS_MOD_NATHELPER
+ prompt " opensips-mod-nathelper......... NAT helper support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ NAT helper support
+
+config ADK_PACKAGE_OPENSIPS_MOD_OPTIONS
+ prompt " opensips-mod-options........... options support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable options support
+
+config ADK_PACKAGE_OPENSIPS_MOD_PDT
+ prompt " opensips-mod-pdt............... PDT support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable pdt support
+
+config ADK_PACKAGE_OPENSIPS_MOD_PERMISSIONS
+ prompt " opensips-mod-permissions....... Permissions support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable permissions support
+
+config ADK_PACKAGE_OPENSIPS_MOD_PIKE
+ prompt " opensips-mod-pike.............. PIKE support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable pike support
+
+config ADK_PACKAGE_OPENSIPS_MOD_SMS
+ prompt " opensips-mod-sms............... SMS support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ SMS support
+
+config ADK_PACKAGE_OPENSIPS_MOD_SPEEDDIAL
+ prompt " opensips-mod-speeddial......... Speed Dial support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Speed Dial support
+
+config ADK_PACKAGE_OPENSIPS_MOD_UAC
+ prompt " opensips-mod-uac............... UAC support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable UAC support
+
+config ADK_PACKAGE_OPENSIPS_MOD_UAC_REDIRECT
+ prompt " opensips-mod-uac............... UAC redirect support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable UAC redirect support
+
+config ADK_PACKAGE_OPENSIPS_MOD_URI
+ prompt " opensips-mod-uri............... URI support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable URI support
+
+config ADK_PACKAGE_OPENSIPS_MOD_URI_DB
+ prompt " opensips-mod-uri-db............ URI database support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Enable URI database support
+
+config ADK_PACKAGE_OPENSIPS_MOD_XLOG
+ prompt " opensips-mod-xlog.............. Logging support"
+ tristate
+ default n
+ depends ADK_PACKAGE_OPENSIPS
+ help
+ Logging support
+
+#endmenu
diff --git a/package/opensips/Makefile b/package/opensips/Makefile
new file mode 100644
index 000000000..76d68f420
--- /dev/null
+++ b/package/opensips/Makefile
@@ -0,0 +1,111 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= opensips
+PKG_VERSION:= 1.4.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d7f0c867d797525635f157b65bb45129
+PKG_VARIANT:= tls
+MASTER_SITES:= http://opensips.org/pub/opensips/$(PKG_VERSION)/src/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION)-$(PKG_VARIANT)_src.tar.gz
+WRKDIST= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_VARIANT)
+
+include $(TOPDIR)/mk/package.mk
+
+define PKG_mod_template
+
+INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
+
+${2}-install:
+ [ -z "$(2)" ] || install -d -m 0755 $$(IDIR_$(1))/usr/lib/opensips/modules/
+ $(CP) $(WRKBUILD)/modules/$(2)/$(2).so \
+ $$(IDIR_$(1))/usr/lib/opensips/modules/
+
+endef
+
+$(eval $(call PKG_template,OPENSIPS,opensips,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_ACCOUNTING,opensips-mod-acc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_AUTH,opensips-mod-auth,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_AUTH_DB,opensips-mod-auth-db,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_AVPOPS,opensips-mod-avpops,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_DISPATCHER,opensips-mod-dispatcher,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_DIVERSION,opensips-mod-diversion,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_FLATSTORE,opensips-mod-flatstore,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_GFLAGS,opensips-mod-gflags,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_GROUP,opensips-mod-group,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_MEDIAPROXY,opensips-mod-mediaproxy,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_MSILO,opensips-mod-msilo,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_NATHELPER,opensips-mod-nathelper,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_OPTIONS,opensips-mod-options,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_PDT,opensips-mod-pdt,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_PERMISSIONS,opensips-mod-permissions,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_PIKE,opensips-mod-pike,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_SMS,opensips-mod-sms,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_UAC,opensips-mod-uac,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_UAC_REDIRECT,opensips-mod-uac-redirect,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_URI,opensips-mod-uri,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_URI_DB,opensips-mod-uri-db,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENSIPS_MOD_XLOG,opensips-mod-xlog,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_ACCOUNTING,acc))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH,auth))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_AUTH_DB,auth_db))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_AVPOPS,avpops))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_DISPATCHER,dispatcher))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_DIVERSION,diversion))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_FLATSTORE,db_flatstore))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_GFLAGS,gflags))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_GROUP,group))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_MEDIAPROXY,mediaproxy))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_MSILO,msilo))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_NATHELPER,nathelper))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_OPTIONS,options))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_PDT,pdt))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_PERMISSIONS,permissions))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_PIKE,pike))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_SMS,sms))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_SPEEDIAL,speeddial))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC,uac))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_UAC_REDIRECT,uac_redirect))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_URI,uri))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_URI_DB,uri_db))
+$(eval $(call PKG_mod_template,OPENSIPS_MOD_XLOG,xlog))
+
+# Select here the modules for the ipk package
+OPENSIPS_MODULES:= sl tm rr maxfwd usrloc registrar db_text textops exec mi_fifo
+
+OPENSIPS_MODULE_FILES:= $(foreach module,$(OPENSIPS_MODULES),modules/$(module)/$(module).so)
+OPENSIPS_MODULES:= $(patsubst %,modules/%,$(OPENSIPS_MODULES))
+
+post-extract:
+ @rm -f ${WRKDIST}/modules/dialog/dlg_handlers.c.rej
+
+do-build:
+ $(MAKE) -C $(WRKBUILD) \
+ prefix=/ \
+ extra_defs="-DUSE_PTHREAD_MUTEX" \
+ TLS=1 \
+ NO_EPOLL=1 \
+ CC="$(TARGET_CC)" \
+ ARCH="$(ARCH)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LOCALBASE="$(STAGING_DIR)/usr" \
+ all modules
+
+do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
+ ${INSTALL_DIR} $(IDIR_OPENSIPS)/etc/init.d
+ ${INSTALL_DIR} $(IDIR_OPENSIPS)/etc/opensips
+ ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/sbin
+ ${INSTALL_DIR} $(IDIR_OPENSIPS)/usr/lib/opensips/modules
+ $(CP) $(WRKBUILD)/$(PKG_NAME) $(IDIR_OPENSIPS)/usr/sbin/
+ (cd $(WRKBUILD);\
+ $(CP) $(OPENSIPS_MODULE_FILES) $(IDIR_OPENSIPS)/usr/lib/opensips/modules/; \
+ )
+ $(CP) ./files/opensips.cfg $(IDIR_OPENSIPS)/etc/opensips/
+ ${INSTALL_DATA} ./files/opensips.init $(IDIR_OPENSIPS)/etc/init.d/opensips
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/opensips/files/opensips.cfg b/package/opensips/files/opensips.cfg
new file mode 100644
index 000000000..3b5d4d42e
--- /dev/null
+++ b/package/opensips/files/opensips.cfg
@@ -0,0 +1,174 @@
+#
+# $Id: openser.cfg 1827 2007-03-12 15:22:53Z bogdan_iancu $
+#
+# simple quick-start config script
+# Please refer to the Core CookBook at http://www.openser.org/dokuwiki/doku.php
+# for a explanation of possible statements, functions and parameters.
+#
+
+# ----------- global configuration parameters ------------------------
+
+debug=3 # debug level (cmd line: -dddddddddd)
+fork=yes
+log_stderror=no # (cmd line: -E)
+children=4
+
+# Uncomment these lines to enter debugging mode
+#fork=no
+#log_stderror=yes
+#
+
+port=5060
+
+# uncomment the following lines for TLS support
+#disable_tls = 0
+#listen = tls:your_IP:5061
+#tls_verify_server = 1
+#tls_verify_client = 1
+#tls_require_client_certificate = 0
+#tls_method = TLSv1
+#tls_certificate = "/usr/local/etc/openser/tls/user/user-cert.pem"
+#tls_private_key = "/usr/local/etc/openser/tls/user/user-privkey.pem"
+#tls_ca_list = "/usr/local/etc/openser/tls/user/user-calist.pem"
+
+# ------------------ module loading ----------------------------------
+
+#set module path
+mpath="/usr/lib/openser/modules/"
+
+# Uncomment this if you want to use SQL database
+#loadmodule "mysql.so"
+
+loadmodule "sl.so"
+loadmodule "tm.so"
+loadmodule "rr.so"
+loadmodule "maxfwd.so"
+loadmodule "usrloc.so"
+loadmodule "registrar.so"
+loadmodule "textops.so"
+loadmodule "mi_fifo.so"
+
+# Uncomment this if you want digest authentication
+# mysql.so must be loaded !
+#loadmodule "auth.so"
+#loadmodule "auth_db.so"
+
+# ----------------- setting module-specific parameters ---------------
+
+# -- mi_fifo params --
+
+modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
+
+# -- usrloc params --
+
+modparam("usrloc", "db_mode", 0)
+
+# Uncomment this if you want to use SQL database
+# for persistent storage and comment the previous line
+#modparam("usrloc", "db_mode", 2)
+
+# -- auth params --
+# Uncomment if you are using auth module
+#
+#modparam("auth_db", "calculate_ha1", yes)
+#
+# If you set "calculate_ha1" parameter to yes (which true in this config),
+# uncomment also the following parameter)
+#
+#modparam("auth_db", "password_column", "password")
+
+# -- rr params --
+# add value to ;lr param to make some broken UAs happy
+modparam("rr", "enable_full_lr", 1)
+
+# ------------------------- request routing logic -------------------
+
+# main routing logic
+
+route{
+
+ # initial sanity checks -- messages with
+ # max_forwards==0, or excessively long requests
+ if (!mf_process_maxfwd_header("10")) {
+ sl_send_reply("483","Too Many Hops");
+ exit;
+ };
+
+ if (msg:len >= 2048 ) {
+ sl_send_reply("513", "Message too big");
+ exit;
+ };
+
+ # we record-route all messages -- to make sure that
+ # subsequent messages will go through our proxy; that's
+ # particularly good if upstream and downstream entities
+ # use different transport protocol
+ if (!method=="REGISTER")
+ record_route();
+
+ # subsequent messages withing a dialog should take the
+ # path determined by record-routing
+ if (loose_route()) {
+ # mark routing logic in request
+ append_hf("P-hint: rr-enforced\r\n");
+ route(1);
+ };
+
+ if (!uri==myself) {
+ # mark routing logic in request
+ append_hf("P-hint: outbound\r\n");
+ # if you have some interdomain connections via TLS
+ #if(uri=~"@tls_domain1.net") {
+ # t_relay("tls:domain1.net");
+ # exit;
+ #} else if(uri=~"@tls_domain2.net") {
+ # t_relay("tls:domain2.net");
+ # exit;
+ #}
+ route(1);
+ };
+
+ # if the request is for other domain use UsrLoc
+ # (in case, it does not work, use the following command
+ # with proper names and addresses in it)
+ if (uri==myself) {
+
+ if (method=="REGISTER") {
+
+ # Uncomment this if you want to use digest authentication
+ #if (!www_authorize("openser.org", "subscriber")) {
+ # www_challenge("openser.org", "0");
+ # exit;
+ #};
+
+ save("location");
+ exit;
+ };
+
+ lookup("aliases");
+ if (!uri==myself) {
+ append_hf("P-hint: outbound alias\r\n");
+ route(1);
+ };
+
+ # native SIP destinations are handled using our USRLOC DB
+ if (!lookup("location")) {
+ sl_send_reply("404", "Not Found");
+ exit;
+ };
+ append_hf("P-hint: usrloc applied\r\n");
+ };
+
+ route(1);
+}
+
+
+route[1] {
+ # send it out now; use stateful forwarding as it works reliably
+ # even for UDP2TCP
+ if (!t_relay()) {
+ sl_reply_error();
+ };
+ exit;
+}
+
diff --git a/package/opensips/files/opensips.init b/package/opensips/files/opensips.init
new file mode 100644
index 000000000..8f231a14a
--- /dev/null
+++ b/package/opensips/files/opensips.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${opensips:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/opensips
+ ;;
+stop)
+ killall opensips
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/opensips/ipkg/opensips-mod-acc.control b/package/opensips/ipkg/opensips-mod-acc.control
new file mode 100644
index 000000000..81aa0e6c3
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-acc.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-acc
+Depends: opensips, libradiusclient-ng
+Section: net
+Priority: optional
+Description: accounting support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-auth-db.control b/package/opensips/ipkg/opensips-mod-auth-db.control
new file mode 100644
index 000000000..459d6cb14
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-auth-db.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-auth-db
+Depends: opensips, libmysqlclient
+Section: net
+Priority: optional
+Description: authentication support against database for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-auth-radius.control b/package/opensips/ipkg/opensips-mod-auth-radius.control
new file mode 100644
index 000000000..82efb9627
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-auth-radius.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-auth-radius
+Depends: opensips, libradiusclient-ng
+Section: net
+Priority: optional
+Description: authentication support against RADIUS for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-auth.control b/package/opensips/ipkg/opensips-mod-auth.control
new file mode 100644
index 000000000..9b5ccbd84
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-auth.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-auth
+Depends: opensips
+Section: net
+Priority: optional
+Description: authentication support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-avp-radius.control b/package/opensips/ipkg/opensips-mod-avp-radius.control
new file mode 100644
index 000000000..b317c2ae6
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-avp-radius.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-avp-radius
+Depends: opensips
+Section: net
+Priority: optional
+Description: avp_radius support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-avp_radius.control b/package/opensips/ipkg/opensips-mod-avp_radius.control
new file mode 100644
index 000000000..9fb519d9a
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-avp_radius.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-avp_radius
+Depends: opensips
+Section: net
+Priority: optional
+Description: avp_radius support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-avpops.control b/package/opensips/ipkg/opensips-mod-avpops.control
new file mode 100644
index 000000000..b653002de
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-avpops.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-avpops
+Depends: opensips
+Section: net
+Priority: optional
+Description: AVPOPS support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-dispatcher.control b/package/opensips/ipkg/opensips-mod-dispatcher.control
new file mode 100644
index 000000000..40565d0f7
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-dispatcher.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-dispatcher
+Depends: opensips
+Section: net
+Priority: optional
+Description: dispatcher support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-diversion.control b/package/opensips/ipkg/opensips-mod-diversion.control
new file mode 100644
index 000000000..36ceefa43
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-diversion.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-diversion
+Depends: opensips
+Section: net
+Priority: optional
+Description: diversion support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-flatstore.control b/package/opensips/ipkg/opensips-mod-flatstore.control
new file mode 100644
index 000000000..db28651dd
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-flatstore.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-flatstore
+Depends: opensips
+Section: net
+Priority: optional
+Description: flatstore support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-gflags.control b/package/opensips/ipkg/opensips-mod-gflags.control
new file mode 100644
index 000000000..22c76a61d
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-gflags.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-gflags
+Depends: opensips
+Section: net
+Priority: optional
+Description: gflags support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-group-radius.control b/package/opensips/ipkg/opensips-mod-group-radius.control
new file mode 100644
index 000000000..f301a4df1
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-group-radius.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-group-radius
+Depends: opensips
+Section: net
+Priority: optional
+Description: group_radius support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-group.control b/package/opensips/ipkg/opensips-mod-group.control
new file mode 100644
index 000000000..c8ed63a9b
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-group.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-group
+Depends: opensips
+Section: net
+Priority: optional
+Description: group support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-group_radius.control b/package/opensips/ipkg/opensips-mod-group_radius.control
new file mode 100644
index 000000000..a0a7f0368
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-group_radius.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-group_radius
+Depends: opensips
+Section: net
+Priority: optional
+Description: group_radius support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-lcr.control b/package/opensips/ipkg/opensips-mod-lcr.control
new file mode 100644
index 000000000..a0ede8d1b
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-lcr.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-lcr
+Depends: opensips
+Section: net
+Priority: optional
+Description: Least Cost Routing support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-mediaproxy.control b/package/opensips/ipkg/opensips-mod-mediaproxy.control
new file mode 100644
index 000000000..b6e7937f2
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-mediaproxy.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-mediaproxy
+Depends: opensips
+Section: net
+Priority: optional
+Description: mediaproxy support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-msilo.control b/package/opensips/ipkg/opensips-mod-msilo.control
new file mode 100644
index 000000000..b85d05755
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-msilo.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-msilo
+Depends: opensips
+Section: net
+Priority: optional
+Description: msilo support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-mysql.control b/package/opensips/ipkg/opensips-mod-mysql.control
new file mode 100644
index 000000000..71ee8f213
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-mysql.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-mysql
+Depends: opensips, libmysqlclient
+Section: net
+Priority: optional
+Description: MySQL support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-nathelper.control b/package/opensips/ipkg/opensips-mod-nathelper.control
new file mode 100644
index 000000000..1f133854b
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-nathelper.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-nathelper
+Depends: opensips
+Section: net
+Priority: optional
+Description: NAT helper support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-options.control b/package/opensips/ipkg/opensips-mod-options.control
new file mode 100644
index 000000000..5594a6a5f
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-options.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-options
+Depends: opensips
+Section: net
+Priority: optional
+Description: options support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-pdt.control b/package/opensips/ipkg/opensips-mod-pdt.control
new file mode 100644
index 000000000..f40bb6271
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-pdt.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-pdt
+Depends: opensips
+Section: net
+Priority: optional
+Description: pdt support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-permissions.control b/package/opensips/ipkg/opensips-mod-permissions.control
new file mode 100644
index 000000000..1283d8e76
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-permissions.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-permissions
+Depends: opensips
+Section: net
+Priority: optional
+Description: permissions support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-pike.control b/package/opensips/ipkg/opensips-mod-pike.control
new file mode 100644
index 000000000..734b406e1
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-pike.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-pike
+Depends: opensips
+Section: net
+Priority: optional
+Description: pike support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-sms.control b/package/opensips/ipkg/opensips-mod-sms.control
new file mode 100644
index 000000000..9641642df
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-sms.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-sms
+Depends: opensips
+Section: net
+Priority: optional
+Description: SMS support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-speeddial.control b/package/opensips/ipkg/opensips-mod-speeddial.control
new file mode 100644
index 000000000..668e2f8fb
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-speeddial.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-speeddial
+Depends: opensips
+Section: net
+Priority: optional
+Description: Speed-dial support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uac-redirect.control b/package/opensips/ipkg/opensips-mod-uac-redirect.control
new file mode 100644
index 000000000..f3e571455
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uac-redirect.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uac-redirect
+Depends: opensips
+Section: net
+Priority: optional
+Description: uac_redirect support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uac.control b/package/opensips/ipkg/opensips-mod-uac.control
new file mode 100644
index 000000000..872a3a368
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uac.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uac
+Depends: opensips
+Section: net
+Priority: optional
+Description: uac support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uac_redirect.control b/package/opensips/ipkg/opensips-mod-uac_redirect.control
new file mode 100644
index 000000000..fdd6ae541
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uac_redirect.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uac_redirect
+Depends: opensips
+Section: net
+Priority: optional
+Description: uac_redirect support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uri-db.control b/package/opensips/ipkg/opensips-mod-uri-db.control
new file mode 100644
index 000000000..3e90123eb
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uri-db.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uri-db
+Depends: opensips
+Section: net
+Priority: optional
+Description: uri_db support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uri-radius.control b/package/opensips/ipkg/opensips-mod-uri-radius.control
new file mode 100644
index 000000000..429d972de
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uri-radius.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uri-radius
+Depends: opensips
+Section: net
+Priority: optional
+Description: uri_radius support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uri.control b/package/opensips/ipkg/opensips-mod-uri.control
new file mode 100644
index 000000000..9ce41607d
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uri.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uri
+Depends: opensips
+Section: net
+Priority: optional
+Description: uri support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uri_db.control b/package/opensips/ipkg/opensips-mod-uri_db.control
new file mode 100644
index 000000000..7dfe161df
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uri_db.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uri_db
+Depends: opensips
+Section: net
+Priority: optional
+Description: uri_db support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-uri_radius.control b/package/opensips/ipkg/opensips-mod-uri_radius.control
new file mode 100644
index 000000000..0521ba5df
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-uri_radius.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-uri_radius
+Depends: opensips
+Section: net
+Priority: optional
+Description: uri_radius support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips-mod-xlog.control b/package/opensips/ipkg/opensips-mod-xlog.control
new file mode 100644
index 000000000..6759951bf
--- /dev/null
+++ b/package/opensips/ipkg/opensips-mod-xlog.control
@@ -0,0 +1,5 @@
+Package: opensips-mod-xlog
+Depends: opensips
+Section: net
+Priority: optional
+Description: Xlog targets support for OpenSIPS
diff --git a/package/opensips/ipkg/opensips.conffiles b/package/opensips/ipkg/opensips.conffiles
new file mode 100644
index 000000000..19c9e4ce7
--- /dev/null
+++ b/package/opensips/ipkg/opensips.conffiles
@@ -0,0 +1 @@
+/etc/opensips/opensips.cfg
diff --git a/package/opensips/ipkg/opensips.control b/package/opensips/ipkg/opensips.control
new file mode 100644
index 000000000..40475bac9
--- /dev/null
+++ b/package/opensips/ipkg/opensips.control
@@ -0,0 +1,4 @@
+Package: opensips
+Section: net
+Priority: optional
+Description: OpenSIPS is a high-performance, configurable, free SIP server.
diff --git a/package/opensips/ipkg/opensips.postinst b/package/opensips/ipkg/opensips.postinst
new file mode 100644
index 000000000..369f66dd7
--- /dev/null
+++ b/package/opensips/ipkg/opensips.postinst
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf opensips
diff --git a/package/openssh/Config.in b/package/openssh/Config.in
new file mode 100644
index 000000000..136333826
--- /dev/null
+++ b/package/openssh/Config.in
@@ -0,0 +1,140 @@
+config ADK_COMPILE_OPENSSH
+ prompt "openssh........................... OpenSSH software"
+ bool
+ default n
+
+config ADK_COMPILE_OPENSSH_WITH_KERBEROS
+ prompt "Enable Kerberos support"
+ bool
+ depends on ADK_COMPILE_OPENSSH
+
+choice
+prompt "Kerberos implementation"
+depends on ADK_COMPILE_OPENSSH_WITH_KERBEROS
+config ADK_COMPILE_OPENSSH_WITH_KRB5
+ prompt "MIT"
+ bool
+ select ADK_PACKAGE_KRB5_LIBS
+ help
+ Use MIT kerberos libraries.
+
+config ADK_COMPILE_OPENSSH_WITH_HEIMDAL
+ prompt "Heimdal"
+ bool
+ select ADK_COMPILE_HEIMDAL
+ select ADK_PACKAGE_HEIMDAL_LIBS
+ help
+ Use heimdal kerberos libraries.
+
+endchoice
+
+config ADK_PACKAGE_OPENSSH_CLIENT
+ prompt "openssh-client.................... OpenSSH clients"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ depends on ADK_COMPILE_OPENSSH
+ help
+ OpenSSH is a FREE version of the SSH protocol suite of network
+ connectivity tools that increasing numbers of people on the Internet
+ are coming to rely on. Many users of telnet, rlogin, ftp, and other
+ such programs might not realize that their password is transmitted
+ across the Internet unencrypted, but it is. OpenSSH encrypts all
+ traffic (including passwords) to effectively eliminate eavesdropping,
+ connection hijacking, and other network-level attacks. Additionally,
+ OpenSSH provides a myriad of secure tunneling capabilities, as well
+ as a variety of authentication methods.
+
+ This package contains the ssh(1) client and the scp(1) client/server.
+
+ http://www.openssh.com/
+
+config ADK_PACKAGE_OPENSSH_CLIENT_UTILS
+ prompt "openssh-client-utils............ OpenSSH client utilities"
+ tristate
+ default n
+ depends on ADK_PACKAGE_OPENSSH_CLIENT
+ depends on ADK_COMPILE_OPENSSH
+ help
+ OpenSSH is a FREE version of the SSH protocol suite of network
+ connectivity tools that increasing numbers of people on the Internet
+ are coming to rely on. Many users of telnet, rlogin, ftp, and other
+ such programs might not realize that their password is transmitted
+ across the Internet unencrypted, but it is. OpenSSH encrypts all
+ traffic (including passwords) to effectively eliminate eavesdropping,
+ connection hijacking, and other network-level attacks. Additionally,
+ OpenSSH provides a myriad of secure tunneling capabilities, as well
+ as a variety of authentication methods.
+
+ This package contains ssh-agent and ssh-add as well as ssh-keyscan.
+
+ http://www.openssh.com/
+
+config ADK_PACKAGE_OPENSSH_SERVER
+ prompt "openssh-server.................... OpenSSH server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ depends on ADK_COMPILE_OPENSSH
+ help
+ OpenSSH is a FREE version of the SSH protocol suite of network
+ connectivity tools that increasing numbers of people on the Internet
+ are coming to rely on. Many users of telnet, rlogin, ftp, and other
+ such programs might not realize that their password is transmitted
+ across the Internet unencrypted, but it is. OpenSSH encrypts all
+ traffic (including passwords) to effectively eliminate eavesdropping,
+ connection hijacking, and other network-level attacks. Additionally,
+ OpenSSH provides a myriad of secure tunneling capabilities, as well
+ as a variety of authentication methods.
+
+ This package contains sshd(8) and ssh-keygen(8), but not scp(1),
+ which is needed for SCP server support.
+
+ http://www.openssh.com/
+
+
+config ADK_PACKAGE_OPENSSH_SFTP_CLIENT
+ prompt "openssh-sftp-client............... OpenSSH SFTP client"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ depends on ADK_COMPILE_OPENSSH
+ help
+ OpenSSH is a FREE version of the SSH protocol suite of network
+ connectivity tools that increasing numbers of people on the Internet
+ are coming to rely on. Many users of telnet, rlogin, ftp, and other
+ such programs might not realize that their password is transmitted
+ across the Internet unencrypted, but it is. OpenSSH encrypts all
+ traffic (including passwords) to effectively eliminate eavesdropping,
+ connection hijacking, and other network-level attacks. Additionally,
+ OpenSSH provides a myriad of secure tunneling capabilities, as well
+ as a variety of authentication methods.
+
+ This package contains the /usr/bin/sftp client utility.
+
+ http://www.openssh.com/
+
+config ADK_PACKAGE_OPENSSH_SFTP_SERVER
+ prompt "openssh-sftp-server............... OpenSSH SFTP server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ depends on ADK_COMPILE_OPENSSH
+ help
+ OpenSSH is a FREE version of the SSH protocol suite of network
+ connectivity tools that increasing numbers of people on the Internet
+ are coming to rely on. Many users of telnet, rlogin, ftp, and other
+ such programs might not realize that their password is transmitted
+ across the Internet unencrypted, but it is. OpenSSH encrypts all
+ traffic (including passwords) to effectively eliminate eavesdropping,
+ connection hijacking, and other network-level attacks. Additionally,
+ OpenSSH provides a myriad of secure tunneling capabilities, as well
+ as a variety of authentication methods.
+
+ This package contains the SFTP server helper programme.
+
+ http://www.openssh.com/
diff --git a/package/openssh/Makefile b/package/openssh/Makefile
new file mode 100644
index 000000000..a46d3bbca
--- /dev/null
+++ b/package/openssh/Makefile
@@ -0,0 +1,83 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openssh
+PKG_VERSION:= 5.2p1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ada79c7328a8551bdf55c95e631e7dad
+MASTER_SITES:= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
+ ftp://openbsd.wiretapped.net/pub/OpenBSD/OpenSSH/portable/ \
+ ftp://ftp.belnet.be/packages/openbsd/OpenSSH/portable/ \
+ ftp://ftp.de.openbsd.org/pub/unix/OpenBSD/OpenSSH/portable/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OPENSSH_CLIENT,openssh-client,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OPENSSH_CLIENT_UTILS,openssh-client-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OPENSSH_SERVER,openssh-server,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OPENSSH_SFTP_CLIENT,openssh-sftp-client,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OPENSSH_SFTP_SERVER,openssh-sftp-server,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+PKG_DEPENDS:= zlib, libopenssl,
+
+ifeq ($(ADK_COMPILE_OPENSSH_WITH_KERBEROS),y)
+CONFIGURE_ARGS+= --with-kerberos5="${STAGING_DIR}/usr"
+PKG_DEPENDS+= heimdal-libs
+else
+CONFIGURE_ARGS+= --without-kerberos5
+endif
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= LD='${TARGET_CC}' \
+ ac_cv_func_setlogin=no
+CONFIGURE_ARGS+= --disable-strip \
+ --disable-etc-default-login \
+ --disable-lastlog \
+ --disable-utmp \
+ --disable-utmpx \
+ --disable-wtmp \
+ --disable-wtmpx \
+ --without-bsd-auth \
+ --without-pam \
+ --without-x \
+ --without-zlib-version-check \
+ --sysconfdir=/etc/ssh \
+ --with-privsep-user=sshd \
+ --with-privsep-path=/var/run/sshd
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_OPENSSH_SERVER}/etc/ssh
+ ${INSTALL_DIR} ${IDIR_OPENSSH_SERVER}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_OPENSSH_SERVER}/usr/bin
+ ${INSTALL_DIR} ${IDIR_OPENSSH_SERVER}/usr/sbin
+ ${INSTALL_SCRIPT} files/sshd.init \
+ ${IDIR_OPENSSH_SERVER}/etc/init.d/sshd
+ ${CP} ./files/sshd_config ${IDIR_OPENSSH_SERVER}/etc/ssh
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ssh-keygen \
+ ${IDIR_OPENSSH_SERVER}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/sshd \
+ ${IDIR_OPENSSH_SERVER}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_OPENSSH_CLIENT}/etc/ssh
+ ${INSTALL_DIR} ${IDIR_OPENSSH_CLIENT}/usr/bin
+ ${INSTALL_DATA} ${WRKINST}/etc/ssh/ssh_config \
+ ${IDIR_OPENSSH_CLIENT}/etc/ssh
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/{ssh,scp} \
+ ${IDIR_OPENSSH_CLIENT}/usr/bin
+ ${INSTALL_DIR} ${IDIR_OPENSSH_CLIENT_UTILS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/ssh-{add,agent,keyscan} \
+ ${IDIR_OPENSSH_CLIENT_UTILS}/usr/bin
+ ${INSTALL_DIR} ${IDIR_OPENSSH_SFTP_CLIENT}/usr/bin
+ ${INSTALL_DIR} ${IDIR_OPENSSH_SFTP_SERVER}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/sftp \
+ ${IDIR_OPENSSH_SFTP_CLIENT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/sftp-server \
+ ${IDIR_OPENSSH_SFTP_SERVER}/usr/sbin
+ chmod 0700 {${IDIR_OPENSSH_CLIENT},${IDIR_OPENSSH_SERVER}}/etc/ssh
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_OPENSSH_SERVER}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openssh/files/sshd.init b/package/openssh/files/sshd.init
new file mode 100644
index 000000000..19774b891
--- /dev/null
+++ b/package/openssh/files/sshd.init
@@ -0,0 +1,47 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ [[ $openssh = NO ]] && exit 0
+ grep dropbear_flags /etc/rc.conf >/dev/null 2>&1 || dropbear_flags=NO
+ if [[ $openssh = AUTO && $dropbear_flags != NO ]]; then
+ echo openssh not starting: set to AUTO and dropbear is enabled
+ exit 0
+ fi
+ exec sh $0 start
+ ;;
+start)
+ if [[ ! -s /etc/ssh/ssh_host_rsa_key ]]; then
+ mkdir -p /etc/ssh
+ if [[ ! -x /usr/bin/ssh-keygen ]]; then
+ bothlog openssh not starting: SSH private key missing
+ exit 0
+ fi
+ echo "openssh: generating SSH private key (RSA)"
+ /usr/bin/ssh-keygen -N '' -t rsa -f /etc/ssh/ssh_host_rsa_key
+ rv=$?
+ echo openssh: key generation exited with code $rv
+ [[ $rv = 0 && -s /etc/ssh/ssh_host_rsa_key ]] || exit 1
+ fi
+ mkdir -p /var/run/sshd
+ mkdir -p /var/empty
+ /usr/sbin/sshd
+ ;;
+stop)
+ if [ -e /var/run/sshd.pid ]; then
+ kill $(cat /var/run/sshd.pid)
+ fi
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/openssh/files/sshd_config b/package/openssh/files/sshd_config
new file mode 100644
index 000000000..19b87bd17
--- /dev/null
+++ b/package/openssh/files/sshd_config
@@ -0,0 +1,113 @@
+# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
+
+# This is the sshd server system-wide configuration file. See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented. Uncommented options change a
+# default value.
+
+#Port 22
+#AddressFamily any
+ListenAddress 0.0.0.0
+#ListenAddress ::
+
+# Disable legacy (protocol version 1) support in the server for new
+# installations. In future the default will change to require explicit
+# activation of protocol 1
+Protocol 2
+
+# HostKey for protocol version 1
+#HostKey /etc/ssh/ssh_host_key
+# HostKeys for protocol version 2
+HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_dsa_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 1024
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+PermitRootLogin without-password
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#RSAAuthentication yes
+PubkeyAuthentication yes
+AuthorizedKeysFile /etc/ssh/authorized_keys
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#RhostsRSAAuthentication no
+# similar for protocol version 2
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+#PermitEmptyPasswords no
+
+# Change to no to disable s/key passwords
+#ChallengeResponseAuthentication yes
+
+# GSSAPI options for Kerberos 5
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication. Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+#UsePAM no
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+#X11Forwarding no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+UsePrivilegeSeparation yes
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#UseDNS yes
+#PidFile /var/run/sshd.pid
+#MaxStartups 10
+#PermitTunnel no
+#ChrootDirectory none
+
+# no default banner path
+#Banner none
+
+# override default of no subsystems
+Subsystem sftp /usr/sbin/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+# X11Forwarding no
+# AllowTcpForwarding no
+# ForceCommand cvs server
diff --git a/package/openssh/ipkg/openssh-client-utils.control b/package/openssh/ipkg/openssh-client-utils.control
new file mode 100644
index 000000000..d34db0ddf
--- /dev/null
+++ b/package/openssh/ipkg/openssh-client-utils.control
@@ -0,0 +1,5 @@
+Package: openssh-client-utils
+Priority: optional
+Section: net
+Depends: zlib, libopenssl
+Description: OpenSSH client utilities
diff --git a/package/openssh/ipkg/openssh-client.conffiles b/package/openssh/ipkg/openssh-client.conffiles
new file mode 100644
index 000000000..489e8267f
--- /dev/null
+++ b/package/openssh/ipkg/openssh-client.conffiles
@@ -0,0 +1 @@
+/etc/ssh/ssh_config \ No newline at end of file
diff --git a/package/openssh/ipkg/openssh-client.control b/package/openssh/ipkg/openssh-client.control
new file mode 100644
index 000000000..183b7f152
--- /dev/null
+++ b/package/openssh/ipkg/openssh-client.control
@@ -0,0 +1,5 @@
+Package: openssh-client
+Priority: optional
+Section: net
+Depends: zlib, libopenssl
+Description: OpenSSH client
diff --git a/package/openssh/ipkg/openssh-server.conffiles b/package/openssh/ipkg/openssh-server.conffiles
new file mode 100644
index 000000000..6f0cfbcbe
--- /dev/null
+++ b/package/openssh/ipkg/openssh-server.conffiles
@@ -0,0 +1 @@
+/etc/ssh/sshd_config \ No newline at end of file
diff --git a/package/openssh/ipkg/openssh-server.control b/package/openssh/ipkg/openssh-server.control
new file mode 100644
index 000000000..5fde84ecd
--- /dev/null
+++ b/package/openssh/ipkg/openssh-server.control
@@ -0,0 +1,4 @@
+Package: openssh-server
+Priority: optional
+Section: net
+Description: OpenSSH server
diff --git a/package/openssh/ipkg/openssh-server.postinst b/package/openssh/ipkg/openssh-server.postinst
new file mode 100644
index 000000000..e14a2b0b9
--- /dev/null
+++ b/package/openssh/ipkg/openssh-server.postinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_user sshd $(get_next_uid) $(get_next_gid) /var/run/sshd
+add_group sshd $(get_next_gid)
+add_rcconf 'use "NO" to disable always, "AUTO" if dropbear is on' openssh AUTO
diff --git a/package/openssh/ipkg/openssh-sftp-client.control b/package/openssh/ipkg/openssh-sftp-client.control
new file mode 100644
index 000000000..705a3854a
--- /dev/null
+++ b/package/openssh/ipkg/openssh-sftp-client.control
@@ -0,0 +1,5 @@
+Package: openssh-sftp-client
+Priority: optional
+Section: net
+Depends: zlib, libopenssl
+Description: OpenSSH SFTP client
diff --git a/package/openssh/ipkg/openssh-sftp-server.control b/package/openssh/ipkg/openssh-sftp-server.control
new file mode 100644
index 000000000..8c17fcc5b
--- /dev/null
+++ b/package/openssh/ipkg/openssh-sftp-server.control
@@ -0,0 +1,5 @@
+Package: openssh-sftp-server
+Priority: optional
+Section: net
+Depends: zlib, libopenssl
+Description: OpenSSH SFTP server
diff --git a/package/openssh/patches/patch-cipher_c b/package/openssh/patches/patch-cipher_c
new file mode 100644
index 000000000..9edbd4167
--- /dev/null
+++ b/package/openssh/patches/patch-cipher_c
@@ -0,0 +1,35 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssh-5.2p1.orig/cipher.c 2009-01-28 06:38:41.000000000 +0100
++++ openssh-5.2p1/cipher.c 2009-05-01 13:39:23.000000000 +0200
+@@ -69,21 +69,30 @@ struct Cipher {
+ { "none", SSH_CIPHER_NONE, 8, 0, 0, 0, EVP_enc_null },
+ { "des", SSH_CIPHER_DES, 8, 8, 0, 1, EVP_des_cbc },
+ { "3des", SSH_CIPHER_3DES, 8, 16, 0, 1, evp_ssh1_3des },
++#ifndef OPENSSL_NO_BF
+ { "blowfish", SSH_CIPHER_BLOWFISH, 8, 32, 0, 1, evp_ssh1_bf },
+-
++#endif
+ { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 1, EVP_des_ede3_cbc },
++#ifndef OPENSSL_NO_BF
+ { "blowfish-cbc", SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_bf_cbc },
++#endif
++#ifndef OPENSSL_NO_CAST
+ { "cast128-cbc", SSH_CIPHER_SSH2, 8, 16, 0, 1, EVP_cast5_cbc },
++#endif
+ { "arcfour", SSH_CIPHER_SSH2, 8, 16, 0, 0, EVP_rc4 },
+ { "arcfour128", SSH_CIPHER_SSH2, 8, 16, 1536, 0, EVP_rc4 },
+ { "arcfour256", SSH_CIPHER_SSH2, 8, 32, 1536, 0, EVP_rc4 },
+ { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, 0, 1, EVP_aes_128_cbc },
++#ifndef OPENSSL_NO_AES192
+ { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, 0, 1, EVP_aes_192_cbc },
++#endif
+ { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc },
+ { "rijndael-cbc@lysator.liu.se",
+ SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc },
+ { "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_128_ctr },
++#ifndef OPENSSL_NO_AES192
+ { "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_128_ctr },
++#endif
+ { "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_128_ctr },
+ #ifdef USE_CIPHER_ACSS
+ { "acss@openssh.org", SSH_CIPHER_SSH2, 16, 5, 0, 0, EVP_acss },
diff --git a/package/openssh/patches/patch-configure b/package/openssh/patches/patch-configure
new file mode 100644
index 000000000..aa0b7af45
--- /dev/null
+++ b/package/openssh/patches/patch-configure
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssh-5.2p1.orig/configure 2009-02-23 01:18:14.000000000 +0100
++++ openssh-5.2p1/configure 2009-05-01 12:34:00.000000000 +0200
+@@ -26712,7 +26712,7 @@ echo "${ECHO_T}yes" >&6; }
+ #define HEIMDAL 1
+ _ACEOF
+
+- K5LIBS="-lkrb5 -ldes"
++ K5LIBS="-lkrb5"
+ K5LIBS="$K5LIBS -lcom_err -lasn1"
+ { echo "$as_me:$LINENO: checking for net_write in -lroken" >&5
+ echo $ECHO_N "checking for net_write in -lroken... $ECHO_C" >&6; }
diff --git a/package/openssh/patches/patch-mac_c b/package/openssh/patches/patch-mac_c
new file mode 100644
index 000000000..28e27e186
--- /dev/null
+++ b/package/openssh/patches/patch-mac_c
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssh-5.2p1.orig/mac.c 2008-06-13 02:58:50.000000000 +0200
++++ openssh-5.2p1/mac.c 2009-05-01 13:34:59.000000000 +0200
+@@ -59,8 +59,10 @@ struct {
+ { "hmac-sha1-96", SSH_EVP, EVP_sha1, 96, -1, -1 },
+ { "hmac-md5", SSH_EVP, EVP_md5, 0, -1, -1 },
+ { "hmac-md5-96", SSH_EVP, EVP_md5, 96, -1, -1 },
++#ifndef OPENSSL_NO_RIPEMD
+ { "hmac-ripemd160", SSH_EVP, EVP_ripemd160, 0, -1, -1 },
+ { "hmac-ripemd160@openssh.com", SSH_EVP, EVP_ripemd160, 0, -1, -1 },
++#endif
+ { "umac-64@openssh.com", SSH_UMAC, NULL, 0, 128, 64 },
+ { NULL, 0, NULL, 0, -1, -1 }
+ };
diff --git a/package/openssh/patches/patch-myproposal_h b/package/openssh/patches/patch-myproposal_h
new file mode 100644
index 000000000..38345863e
--- /dev/null
+++ b/package/openssh/patches/patch-myproposal_h
@@ -0,0 +1,45 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssh-5.2p1.orig/myproposal.h 2009-01-28 06:33:31.000000000 +0100
++++ openssh-5.2p1/myproposal.h 2009-05-01 14:00:47.000000000 +0200
+@@ -42,15 +42,35 @@
+
+ #define KEX_DEFAULT_PK_ALG "ssh-rsa,ssh-dss"
+
++
++#ifndef OPENSSL_NO_AES192
++#define KEX_ENCRYPT_AES192 ",aes192-ctr,aes192-cbc"
++#else
++#define KEX_ENCRYPT_AES192
++#endif
++#ifndef OPENSSL_NO_BF
++#define KEX_ENCRYPT_BF ",blowfish-cbc"
++#else
++#define KEX_ENCRYPT_BF
++#endif
++#ifndef OPENSSL_NO_CAST
++#define KEX_ENCRYPT_CAST ",cast128-cbc"
++#define KEX_MAC_CAST ",hmac-ripemd160,hmac-ripemd160@openssh.com"
++#else
++#define KEX_ENCRYPT_CAST
++#define KEX_MAC_CAST
++#endif
++
+ #define KEX_DEFAULT_ENCRYPT \
+- "aes128-ctr,aes192-ctr,aes256-ctr," \
++ "aes128-ctr,aes256-ctr," \
+ "arcfour256,arcfour128," \
+- "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \
+- "aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se"
++ "aes128-cbc,3des-cbc," \
++ "aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se" \
++ KEX_ENCRYPT_AES192 KEX_ENCRYPT_BF KEX_ENCRYPT_CAST
+ #define KEX_DEFAULT_MAC \
+- "hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160," \
+- "hmac-ripemd160@openssh.com," \
+- "hmac-sha1-96,hmac-md5-96"
++ "hmac-md5,hmac-sha1,umac-64@openssh.com," \
++ "hmac-sha1-96,hmac-md5-96" \
++ KEX_MAC_CAST
+ #define KEX_DEFAULT_COMP "none,zlib@openssh.com,zlib"
+ #define KEX_DEFAULT_LANG ""
+
diff --git a/package/openssh/patches/patch-openbsd-compat_port-tun_c b/package/openssh/patches/patch-openbsd-compat_port-tun_c
new file mode 100644
index 000000000..bc6e0b1b3
--- /dev/null
+++ b/package/openssh/patches/patch-openbsd-compat_port-tun_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssh-5.1p1.orig/openbsd-compat/port-tun.c 2008-05-19 07:28:36.000000000 +0200
++++ openssh-5.1p1/openbsd-compat/port-tun.c 2008-10-14 10:20:42.000000000 +0200
+@@ -213,7 +213,7 @@ sys_tun_infilter(struct Channel *c, char
+ if (len <= 0 || len > (int)(sizeof(rbuf) - sizeof(*af)))
+ return (-1);
+ ptr = (char *)&rbuf[0];
+- bcopy(buf, ptr + sizeof(u_int32_t), len);
++ memcpy(ptr + sizeof(u_int32_t), buf, len);
+ len += sizeof(u_int32_t);
+ af = (u_int32_t *)ptr;
+
diff --git a/package/openssl-pkcs11/Config.in b/package/openssl-pkcs11/Config.in
new file mode 100644
index 000000000..67431160d
--- /dev/null
+++ b/package/openssl-pkcs11/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_OPENSSL_PKCS11
+ prompt "openssl-pkcs11.................... openssl pkcs11 engine"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBP11
+ help
+ openssl pkcs11 engine
diff --git a/package/openssl-pkcs11/Makefile b/package/openssl-pkcs11/Makefile
new file mode 100644
index 000000000..37d4ffe51
--- /dev/null
+++ b/package/openssl-pkcs11/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openssl-pkcs11
+PKG_VERSION:= 0.1.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 26eb84950a10b7d869e41a50620ebf09
+DISTFILES:= engine_pkcs11-${PKG_VERSION}.tar.gz
+MASTER_SITES:= http://www.opensc-project.org/files/engine_pkcs11/
+WRKDIST= ${WRKDIR}/engine_pkcs11-${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OPENSSL_PKCS11,openssl-pkcs11,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= cross_compiling=yes
+CONFIGURE_ARGS+= --with-openssl="${STAGING_DIR}/usr"
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_OPENSSL_PKCS11}/usr/lib/engines
+ ${INSTALL_DATA} ${WRKINST}/usr/lib/engines/engine_pkcs11.so \
+ ${IDIR_OPENSSL_PKCS11}/usr/lib/engines
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openssl-pkcs11/ipkg/openssl-pkcs11.control b/package/openssl-pkcs11/ipkg/openssl-pkcs11.control
new file mode 100644
index 000000000..3e7c3ae5b
--- /dev/null
+++ b/package/openssl-pkcs11/ipkg/openssl-pkcs11.control
@@ -0,0 +1,4 @@
+Package: openssl-pkcs11
+Priority: optional
+Section: crypto
+Description: pkcs11 engine for openssl
diff --git a/package/openssl-pkcs11/patches/patch-configure b/package/openssl-pkcs11/patches/patch-configure
new file mode 100644
index 000000000..7527e4904
--- /dev/null
+++ b/package/openssl-pkcs11/patches/patch-configure
@@ -0,0 +1,60 @@
+$Id$
+--- engine_pkcs11-0.1.3.orig/configure 2005-11-23 21:44:23.000000000 +0100
++++ engine_pkcs11-0.1.3/configure 2007-04-08 14:22:29.000000000 +0200
+@@ -20061,56 +20061,6 @@ if test "${with_openssl+set}" = set; the
+ fi
+ CPPFLAGS="-I$withval/include $saved_CPPFLAGS"
+
+- if test "$cross_compiling" = yes; then
+- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#include <string.h>
+-#include <openssl/rand.h>
+-int main(void)
+-{
+- char a[2048];
+- memset(a, 0, sizeof(a));
+- RAND_add(a, sizeof(a), sizeof(a));
+- return(RAND_status() <= 0);
+-}
+-
+-_ACEOF
+-rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+-
+- SSL_MSG="yes"
+- ssldir="$withval"
+- break
+-
+-else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+ else
+
+
diff --git a/package/openssl/Config.in b/package/openssl/Config.in
new file mode 100644
index 000000000..1375cc39a
--- /dev/null
+++ b/package/openssl/Config.in
@@ -0,0 +1,41 @@
+config ADK_COMPILE_OPENSSL
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBOPENSSL
+
+config ADK_PACKAGE_LIBOPENSSL
+ prompt "openssl........................... Open source SSL (Secure Socket Layer) libraries"
+ tristate
+ default n
+ select ADK_COMPILE_OPENSSL
+ select ADK_PACKAGE_ZLIB
+ help
+ The OpenSSL Project is a collaborative effort to develop a robust,
+ commercial-grade, full-featured, and Open Source toolkit implementing
+ the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
+ protocols as well as a full-strength general purpose cryptography library.
+
+ http://www.openssl.org/
+
+ This package contains the shared SSL libraries, needed by other programs.
+
+config ADK_PACKAGE_OPENSSL_UTIL
+ prompt "openssl-util.................... OpenSSL command line tool"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBOPENSSL
+ help
+ The OpenSSL Project is a collaborative effort to develop a robust,
+ commercial-grade, full-featured, and Open Source toolkit implementing
+ the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
+ protocols as well as a full-strength general purpose cryptography library.
+
+ http://www.openssl.org/
+
+ This package contains the multi-purpose OpenSSL binary tool.
+
+config ADK_PACKAGE_CA_CERTS
+ prompt "ca-certificates................... X.509 Root CA Certs of common CAs"
+ tristate
+ default n
+ depends ADK_COMPILE_OPENSSL
diff --git a/package/openssl/Makefile b/package/openssl/Makefile
new file mode 100644
index 000000000..09cde2a20
--- /dev/null
+++ b/package/openssl/Makefile
@@ -0,0 +1,70 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openssl
+PKG_VERSION:= 0.9.8k
+PKG_RELEASE:= 2
+CACERT_VER:= 12
+PKG_MD5SUM:= e555c6d58d276aec7fdc53363e338ab3
+
+MASTER_SITES:= http://www.openssl.org/source/ \
+ ftp://ftp.funet.fi/pub/crypt/cryptography/libs/openssl/source/ \
+ ftp://ftp.webmonster.de/pub/openssl/source/ \
+ ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBOPENSSL,libopenssl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,OPENSSL_UTIL,openssl-util,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,CA_CERTS,ca-certificates,${PKG_VERSION}-${CACERT_VER},${ARCH}))
+
+BUILD_STYLE:= manual
+INSTALL_STYLE:= auto confprog
+INSTALL_TARGET:= install_sw
+FAKE_FLAGS+= INSTALL_PREFIX=${WRKINST}
+
+OPENSSL_OPTIONS = shared no-ec no-err no-hw no-krb5 no-threads zlib-dynamic no-engines no-camellia no-idea no-rc5 no-mdc2 no-sha0 no-smime no-aes192 no-ripemd no-cast no-bf
+
+do-configure:
+ (cd $(WRKBUILD); \
+ PATH=$(TARGET_PATH) \
+ OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
+ ./Configure linux-embedded \
+ --prefix=/usr \
+ --openssldir=/etc/ssl \
+ --with-cryptodev \
+ -I$(STAGING_DIR)/usr/include \
+ -L$(STAGING_DIR)/usr/lib -ldl \
+ -DOPENSSL_SMALL_FOOTPRINT \
+ $(OPENSSL_OPTIONS) \
+ );
+
+do-build:
+ $(MAKE) -C $(WRKBUILD) \
+ MAKEDEPPROG="$(TARGET_CC)" \
+ OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
+ depend
+ $(MAKE) -C $(WRKBUILD) \
+ CC="$(TARGET_CC)" \
+ AR="$(TARGET_CROSS)ar r" \
+ RANLIB="$(TARGET_CROSS)ranlib" \
+ OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
+ all build-shared
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBOPENSSL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/lib*.so.* ${IDIR_LIBOPENSSL}/usr/lib
+ chmod 644 ${IDIR_LIBOPENSSL}/usr/lib/lib*.so.*
+ ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/openssl ${IDIR_OPENSSL_UTIL}/usr/bin
+ ${INSTALL_DIR} ${IDIR_OPENSSL_UTIL}/etc/ssl/{,certs,private}
+ ${CP} ${WRKSRC}/apps/openssl.cnf ${IDIR_OPENSSL_UTIL}/etc/ssl/
+ chmod 0700 ${IDIR_OPENSSL_UTIL}/etc/ssl/private
+ ${INSTALL_DIR} ${IDIR_CA_CERTS}/etc/ssl
+ ${INSTALL_DATA} cert.pem ${IDIR_CA_CERTS}/etc/ssl/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openssl/cert.pem b/package/openssl/cert.pem
new file mode 100644
index 000000000..345629503
--- /dev/null
+++ b/package/openssl/cert.pem
@@ -0,0 +1,4625 @@
+-----BEGIN CERTIFICATE-----
+MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb
+MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
+GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp
+ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow
+fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
+A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV
+BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB
+BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM
+cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S
+HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996
+CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk
+3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz
+6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV
+HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud
+EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv
+Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw
+Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww
+DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0
+5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj
+Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI
+gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ
+aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl
+izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIF5jCCA86gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMx
+HTAbBgNVBAoTFEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNh
+IE9ubGluZSBJbmMuMTcwNQYDVQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0
+aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyOTA2MDAwMFoXDTM3MDkyODIz
+NDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wgVGltZSBXYXJuZXIg
+SW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMuQU9M
+IFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIw
+DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALQ3WggWmRToVbEbJGv8x4vmh6mJ
+7ouZzU9AhqS2TcnZsdw8TQ2FTBVsRotSeJ/4I/1n9SQ6aF3Q92RhQVSji6UI0ilb
+m2BPJoPRYxJWSXakFsKlnUWsi4SVqBax7J/qJBrvuVdcmiQhLE0OcR+mrF1FdAOY
+xFSMFkpBd4aVdQxHAWZg/BXxD+r1FHjHDtdugRxev17nOirYlxcwfACtCJ0zr7iZ
+YYCLqJV+FNwSbKTQ2O9ASQI2+W6p1h2WVgSysy0WVoaP2SBXgM1nEG2wTPDaRrbq
+JS5Gr42whTg0ixQmgiusrpkLjhTXUr2eacOGAgvqdnUxCc4zGSGFQ+aJLZ8lN2fx
+I2rSAG2X+Z/nKcrdH9cG6rjJuQkhn8g/BsXS6RJGAE57COtCPStIbp1n3UsC5ETz
+kxmlJ85per5n0/xQpCyrw2u544BMzwVhSyvcG7mm0tCq9Stz+86QNZ8MUhy/XCFh
+EVsVS6kkUfykXPcXnbDS+gfpj1bkGoxoigTTfFrjnqKhynFbotSg5ymFXQNoKk/S
+Btc9+cMDLz9l+WceR0DTYw/j1Y75hauXTLPXJuuWCpTehTacyH+BCQJJKg71ZDIM
+gtG6aoIbs0t0EfOMd9afv9w3pKdVBC/UMejTRrkDfNoSTllkt1ExMVCgyhwn2RAu
+rda9EGYrw7AiShJbAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
+FE9pbQN+nZ8HGEO8txBO1b+pxCAoMB8GA1UdIwQYMBaAFE9pbQN+nZ8HGEO8txBO
+1b+pxCAoMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAO/Ouyugu
+h4X7ZVnnrREUpVe8WJ8kEle7+z802u6teio0cnAxa8cZmIDJgt43d15Ui47y6mdP
+yXSEkVYJ1eV6moG2gcKtNuTxVBFT8zRFASbI5Rq8NEQh3q0l/HYWdyGQgJhXnU7q
+7C+qPBR7V8F+GBRn7iTGvboVsNIYvbdVgaxTwOjdaRITQrcCtQVBynlQboIOcXKT
+RuidDV29rs4prWPVVRaAMCf/drr3uNZK49m1+VLQTkCpx+XCMseqdiThawVQ68W/
+ClTluUI8JPu3B5wwn3la5uBAUhX0/Kr0VvlEl4ftDmVyXr4m+02kLQgH3thcoNyB
+M5kYJRF3p+v9WAksmWsbivNSPxpNSGDxoPYzAlOL7SUJuA0t7Zdz7NeWH45gDtoQ
+my8YJPamTQr5O8t1wswvziRpyQoijlmn94IM19drNZxDAGrElWe6nEXLuA4399xO
+AU++CrYD062KRffaJ00psUjf5BHklka9bAI+1lHIlRcBFanyqqryvy9lG2/QuRqT
+9Y41xICHPpQvZuTpqP9BnHAqTyo5GJUefvthATxRCC4oGKQWDzH9OmwjkyB24f0H
+hdFbP9IcczLd+rn4jM8Ch3qaluTtT4mNU0OrDhPAARW0eTjb/G49nlG2uBOLZ8/5
+fNkiHfZdxRwBL5joeiQYvITX+txyW/fBOmg=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU
+MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
+b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1
+MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK
+EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh
+BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq
+xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G
+87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i
+2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U
+WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1
+0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G
+A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T
+AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr
+pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL
+ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm
+aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv
+hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm
+hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X
+dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3
+P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y
+iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no
+xqE=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDnjCCAoagAwIBAgILAgAAAAAA1ni50a8wDQYJKoZIhvcNAQEEBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05OTAxMjgxMjAw
+MDBaFw0wOTAxMjgxMjAwMDBaMF8xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMRQwEgYDVQQLEwtQYXJ0bmVycyBDQTEfMB0GA1UEAxMWR2xv
+YmFsU2lnbiBQYXJ0bmVycyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBANIs+DKsShJ6N8gpkaWujG4eDsA0M4jlM3EWHHiEaMMYNFAuFj6xlIJPsZqf
+APjGETXGaXuYAq0ABohs50wzKACIJ0Yfh7NxdWO8MruI3mYYDlAGk7T2vBQ3MD0i
+3z3/dX7ZChrFn7P80KyzCHqJ0wHoAFznSgs9TXsmordiBovaRt2TFz8/WwJLC7aI
+IBGSAK27xy7U40Wu9YlafI2krYVkMsAnjMbyioCShiRWWY10aKKDQrOePVBBhm8g
+bvb9ztMZ4zLMj+2aXm0fKPVSrG4YXvg90ZLlumwBiEsK8i3eZTMFQqBMqjF2vv2/
+gXj5cRxGXi0VlS0wWY5MQdFiqz0CAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgAGMB0G
+A1UdDgQWBBRDJI1wFQhiVZxPDEAXXYZeD6JM+zAfBgNVHSMEGDAWgBRge2YaRQ2X
+yolQL30EzTSo//z9SzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IB
+AQBm7bSIaRGZgiGDrKFti5uErQ8tyB6Mynt+rarUjt4H1p5Fx6W4nAc5YCVVGsBP
+GeXPFylJiRg1ZuXrKEBOV8mvs+S4IAWjO5VQkUmUKX0s5YhBpUWIXp2CJ/fS71u1
+T5++/jVlLFVkn+FR2iJhd7pYTo/GeVlZbjCAok+QbiELrdBoOZAQm+0iZW8eETjm
+f4zS8zltR9Uh6Op1OkHRrfYWnV0LIb3zH2MGJR3BHzVxLOsgGdXBsOw95W/tAgc/
+E3tmktZEwZj3X1CLelvCb22w0fjldKBAN6MlD+Q9ymQxk5BcMHu5OTGaXkzNuUFP
+UOQ9OK7IZtnHO11RR6ybq/Kt
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIE7TCCBFagAwIBAgIEOAOR7jANBgkqhkiG9w0BAQQFADCByTELMAkGA1UEBhMC
+VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MUgwRgYDVQQLFD93d3cuZW50cnVzdC5u
+ZXQvQ2xpZW50X0NBX0luZm8vQ1BTIGluY29ycC4gYnkgcmVmLiBsaW1pdHMgbGlh
+Yi4xJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV
+BAMTKkVudHJ1c3QubmV0IENsaWVudCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe
+Fw05OTEwMTIxOTI0MzBaFw0xOTEwMTIxOTU0MzBaMIHJMQswCQYDVQQGEwJVUzEU
+MBIGA1UEChMLRW50cnVzdC5uZXQxSDBGBgNVBAsUP3d3dy5lbnRydXN0Lm5ldC9D
+bGllbnRfQ0FfSW5mby9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBsaWFiLjEl
+MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMq
+RW50cnVzdC5uZXQgQ2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0G
+CSqGSIb3DQEBAQUAA4GLADCBhwKBgQDIOpleMRffrCdvkHvkGf9FozTC28GoT/Bo
+6oT9n3V5z8GKUZSvx1cDR2SerYIbWtp/N3hHuzeYEpbOxhN979IMMFGpOZ5V+Pux
+5zDeg7K6PvHViTs7hbqqdCz+PzFur5GVbgbUB01LLFZHGARS2g4Qk79jkJvh34zm
+AqTmT173iwIBA6OCAeAwggHcMBEGCWCGSAGG+EIBAQQEAwIABzCCASIGA1UdHwSC
+ARkwggEVMIHkoIHhoIHepIHbMIHYMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50
+cnVzdC5uZXQxSDBGBgNVBAsUP3d3dy5lbnRydXN0Lm5ldC9DbGllbnRfQ0FfSW5m
+by9DUFMgaW5jb3JwLiBieSByZWYuIGxpbWl0cyBsaWFiLjElMCMGA1UECxMcKGMp
+IDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5uZXQg
+Q2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCyg
+KqAohiZodHRwOi8vd3d3LmVudHJ1c3QubmV0L0NSTC9DbGllbnQxLmNybDArBgNV
+HRAEJDAigA8xOTk5MTAxMjE5MjQzMFqBDzIwMTkxMDEyMTkyNDMwWjALBgNVHQ8E
+BAMCAQYwHwYDVR0jBBgwFoAUxPucKXuXzUyW/O5bs8qZdIuV6kwwHQYDVR0OBBYE
+FMT7nCl7l81MlvzuW7PKmXSLlepMMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA
+BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEEBQADgYEAP66K8ddmAwWePvrqHEa7
+pFuPeJoSSJn59DXeDDYHAmsQOokUgZwxpnyyQbJq5wcBoUv5nyU7lsqZwz6hURzz
+wy5E97BnRqqS5TvaHBkUODDV4qIxJS7x7EU47fgGWANzYrAQMY9Av2TgXD7FTx/a
+EkP/TOYGJqibGapEPHayXOw=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID5jCCAs6gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMCVVMx
+HTAbBgNVBAoTFEFPTCBUaW1lIFdhcm5lciBJbmMuMRwwGgYDVQQLExNBbWVyaWNh
+IE9ubGluZSBJbmMuMTcwNQYDVQQDEy5BT0wgVGltZSBXYXJuZXIgUm9vdCBDZXJ0
+aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyOTA2MDAwMFoXDTM3MTEyMDE1
+MDMwMFowgYMxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBT0wgVGltZSBXYXJuZXIg
+SW5jLjEcMBoGA1UECxMTQW1lcmljYSBPbmxpbmUgSW5jLjE3MDUGA1UEAxMuQU9M
+IFRpbWUgV2FybmVyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIw
+DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnej8Mlo2k06AX3dLm/WpcZuS+U
+0pPlLYnKhHw/EEMbjIt8hFj4JHxIzyr9wBXZGH6EGhfT257XyuTZ16pYUYfw8ItI
+TuLCxFlpMGK2MKKMCxGZYTVtfu/FsRkGIBKOQuHfD5YQUqjPnF+VFNivO3ULMSAf
+RC+iYkGzuxgh28pxPIzstrkNn+9R7017EvILDOGsQI93f7DKeHEMXRZxcKLXwjqF
+zQ6axOAAsNUl6twr5JQtOJyJQVdkKGUZHLZEtMgxa44Be3ZZJX8VHIQIfHNlIAqh
+BC4aMqiaILGcLCFZ5/vP7nAtCMpjPiybkxlqpMKX/7eGV4iFbJ4VFitNLLMCAwEA
+AaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUoTYwFsuGkABFgFOxj8jY
+PXy+XxIwHwYDVR0jBBgwFoAUoTYwFsuGkABFgFOxj8jYPXy+XxIwDgYDVR0PAQH/
+BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQCKIBilvrMvtKaEAEAwKfq0FHNMeUWn
+9nDg6H5kHgqVfGphwu9OH77/yZkfB2FK4V1Mza3u0FIy2VkyvNp5ctZ7CegCgTXT
+Ct8RHcl5oIBN/lrXVtbtDyqvpxh1MwzqwWEFT2qaifKNuZ8u77BfWgDrvq2g+EQF
+Z7zLBO+eZMXpyD8Fv8YvBxzDNnGGyjhmSs3WuEvGbKeXO/oTLW4jYYehY0KswsuX
+n2Fozy1MBJ3XJU8KDk2QixhWqJNIV9xvrr2eZ1d3iVCzvhGbRWeDhhmH05i9CBoW
+H1iCC+GWaQVLjuyDUTEH1dSf/1l7qG6Fz9NLqUmwX7A5KGgOc90lmt4S
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDITCCAoqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCByzELMAkGA1UEBhMCWkEx
+FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD
+VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT
+ZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFBlcnNvbmFsIEJhc2lj
+IENBMSgwJgYJKoZIhvcNAQkBFhlwZXJzb25hbC1iYXNpY0B0aGF3dGUuY29tMB4X
+DTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgcsxCzAJBgNVBAYTAlpBMRUw
+EwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UE
+ChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy
+dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQZXJzb25hbCBCYXNpYyBD
+QTEoMCYGCSqGSIb3DQEJARYZcGVyc29uYWwtYmFzaWNAdGhhd3RlLmNvbTCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvLyTU23AUE+CFeZIlDWmWr5vQvoPR+53
+dXLdjUmbllegeNTKP1GzaQuRdhciB5dqxFGTS+CN7zeVoQxN2jSQHReJl+A1OFdK
+wPQIcOk8RHtQfmGakOMj04gRRif1CwcOu93RfyAKiLlWCy4cgNrx454p7xS9CkT7
+G1sY0b8jkyECAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQF
+AAOBgQAt4plrsD16iddZopQBHyvdEktTwq1/qqcAXJFAVyVKOKqEcLnZgA+le1z7
+c8a914phXAPjLSeoF+CEhULcXpvGt7Jtu3Sv5D/Lp7ew4F2+eIMllNLbgQ95B21P
+9DkVWlIBe94y1k049hJcBlDfBVu9FEuh3ym6O0GN92NWod8isQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G
+A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp
+Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1
+MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG
+A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL
+v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8
+eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq
+tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd
+C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa
+zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB
+mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH
+V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n
+bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG
+3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs
+J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO
+291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS
+ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd
+AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
+TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEaTCCA1GgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJERTET
+MBEGA1UEChMKREZOLVZlcmVpbjEQMA4GA1UECxMHREZOLVBLSTEiMCAGA1UEAxMZ
+REZOLVZlcmVpbiBQQ0EgR3JpZCAtIEcwMTAeFw0wNTA3MDcxMzM1MTVaFw0xMzA5
+MDcxMzM1MTVaMFgxCzAJBgNVBAYTAkRFMRMwEQYDVQQKEwpERk4tVmVyZWluMRAw
+DgYDVQQLEwdERk4tUEtJMSIwIAYDVQQDExlERk4tVmVyZWluIFBDQSBHcmlkIC0g
+RzAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPlF0BAKoXmKNC3G
+5cMOeAbSxCqKFONHrWi4fubi7dGHJfr6EJeP+6nEvc+6dM9fnsDYEYt4m4MzXaLb
+J+9vUdgSOXeoC/2BpluiU36co1QJ6PZIRO3zI2x/4EBa6XueAYpNnO777X5COeRi
+dBdSSVwUb3TcsHxrZvWXLiFpsittt1Yqr+S5fjIcJiv7umwi9jAIhtSnartLHmK1
+50VAgsXfpen3Zex4M/UGVUScAYf75dWZN4qe4J6UNUq87EyiFvR+HQVmoxdJfz7M
+rAw4AXhoter8dgzk6wQHjAezXAaarTzRKoMmyvAHwkt3oaH63KteBNao29ONpReM
+V67n0wIDAQABo4IBPDCCATgwHQYDVR0OBBYEFJbs3K2aw/5Qozwi5T3Cxf/K2SLG
+MB8GA1UdIwQYMBaAFJbs3K2aw/5Qozwi5T3Cxf/K2SLGMA8GA1UdEwEB/wQFMAMB
+Af8wgcEGA1UdHwSBuTCBtjBZoFegVYZTaHR0cDovL2NkcDEucGNhLmRmbi5kZS9k
+Zm4tcGtpL2NlcnRpZmljYXRpb24veDUwOS9ncmlkL2cxL2RhdGEvY3Jscy9yb290
+LWNhLWNybC5jcmwwWaBXoFWGU2h0dHA6Ly9jZHAyLnBjYS5kZm4uZGUvZGZuLXBr
+aS9jZXJ0aWZpY2F0aW9uL3g1MDkvZ3JpZC9nMS9kYXRhL2NybHMvcm9vdC1jYS1j
+cmwuY3JsMA4GA1UdDwEB/wQEAwIBBjARBglghkgBhvhCAQEEBAMCAAcwDQYJKoZI
+hvcNAQEFBQADggEBAFXNb0rX1MgYEEzTqHtqSxfKoqy3vETkVxRT7djuM1qxcGZq
+LyDAKT0f6mRQjRh5lRkQThTx7w9+CDJYDDhe/CN9RbB9LaB+FW2PHWIOwmeAb4/e
+HSLrvNQweDa7GO5HVOON8/yK7zN4rN81xtOlSCXKIpVuMi6CaQy3ECA1VtG+l5pL
+rUh3Xd4jaTm3FzkJCwG/vn8BY83XDbEVg/bLVom1l6GSeKEDDuJzc/3kca2IQWuF
+qctKfhxoK2w18L4DzkUNge0LlxYBCD5hDA5Jia9ufJ+tInkUbxBzPZYKkd1GXQ0i
+RboLZSYA7LLjLwVEDwsbzbymYIWZkwyYrdGg5Z4=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMx
+IjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1
+dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2
+MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20w
+HhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTELMAkGA1UEBhMCRVMx
+IjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1
+dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2
+MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20w
+ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5u
+Cp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5Vj1H5WuretXDE7aTt/6MNbg9kUDGvASdY
+rv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJHlShbz++AbOCQl4oBPB3z
+hxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf3H5idPay
+BQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcL
+iam8NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcb
+AgMBAAGjgZ8wgZwwKgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lv
+bmFsLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0
+MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E
+FgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQADggEBAEdz/o0n
+VPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq
+u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36m
+hoEyIwOdyPdfwUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzfl
+ZKG+TQyTmAyX9odtsz/ny4Cm7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBp
+QWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YGVM+h4k0460tQtcsm9MracEpqoeJ5
+quGnM/b9Sh/22WA=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJE
+SzEMMAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEw
+ODM5MzBaFw0zNzAyMTEwOTA5MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNU
+REMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+MIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuHnEz9pPPEXyG9VhDr
+2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0zY0s
+2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItU
+GBxIYXvViGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKj
+dGqPqcNiKXEx5TukYBdedObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+r
+TpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/
+BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB5DCB4TCB3gYIKoFQgSkB
+AQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5kay9yZXBv
+c2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRl
+ciBmcmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEu
+MS4xLiBDZXJ0aWZpY2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIg
+T0lEIDEuMi4yMDguMTY5LjEuMS4xLjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1Ud
+HwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEMMAoGA1UEChMDVERDMRQwEgYD
+VQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYmaHR0cDovL2Ny
+bC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy
+MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZ
+J2cdUBVLc647+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqG
+SIb2fQdBAAQQMA4bCFY2LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACrom
+JkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4A9G28kNBKWKnctj7fAXmMXAnVBhO
+inxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYscA+UYyAFMP8uXBV2Y
+caaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9AOoB
+mbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQ
+YqbsFbS1AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9
+BKNDLdr8C2LqL19iUw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQsw
+CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl
+cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu
+LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT
+aWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
+dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD
+VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT
+aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ
+bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu
+IENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
+LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN2E1Lm0+afY8wR4
+nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/EbRrsC+MO
+8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjV
+ojYJrKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjb
+PG7PoBMAGrgnoeS+Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP2
+6KbqxzcSXKMpHgLZ2x87tNcPVkeBFQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vr
+n5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAq2aN17O6x5q25lXQBfGfMY1a
+qtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/Ny9Sn2WCVhDr4
+wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3
+ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrs
+pSCAaWihT37ha88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4
+E1Z5T21Q6huwtVexN2ZYI/PcD98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb
+MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
+GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0
+aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla
+MH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
+BgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD
+VQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW
+fnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt
+TGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL
+fhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW
+1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7
+kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G
+A1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD
+VR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v
+ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo
+dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu
+Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/
+HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32
+pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS
+jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+
+xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn
+dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID2DCCAsACEQDQHkCLAAACfAAAAAIAAAABMA0GCSqGSIb3DQEBBQUAMIGpMQsw
+CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp
+dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UE
+CxMIRFNUQ0EgWDExFjAUBgNVBAMTDURTVCBSb290Q0EgWDExITAfBgkqhkiG9w0B
+CQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAeFw05ODEyMDExODE4NTVaFw0wODExMjgx
+ODE4NTVaMIGpMQswCQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMO
+U2FsdCBMYWtlIENpdHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0
+IENvLjERMA8GA1UECxMIRFNUQ0EgWDExFjAUBgNVBAMTDURTVCBSb290Q0EgWDEx
+ITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTCCASIwDQYJKoZIhvcN
+AQEBBQADggEPADCCAQoCggEBANLGJrbnpT3BxGjVUG9TxW9JEwm4ryxIjRRqoxdf
+WvnTLnUv2Chi0ZMv/E3Uq4flCMeZ55I/db3rJbQVwZsZPdJEjdd0IG03Ao9pk1uK
+xBmd9LIO/BZsubEFkoPRhSxglD5FVaDZqwgh5mDoO3TymVBRaNADLbGAvqPYUrBE
+zUNKcI5YhZXhTizWLUFv1oTnyJhEykfbLCSlaSbPa7gnYsP0yXqSI+0TZ4KuRS5F
+5X5yP4WdlGIQ5jyRoa13AOAV7POEgHJ6jm5gl8ckWRA0g1vhpaRptlc1HHhZxtMv
+OnNn7pTKBBMFYgZwI7P0fO5F2WQLW0mqpEPOJsREEmy43XkCAwEAATANBgkqhkiG
+9w0BAQUFAAOCAQEAojeyP2n714Z5VEkxlTMr89EJFEliYIalsBHiUMIdBlc+Legz
+ZL6bqq1fG03UmZWii5rJYnK1aerZWKs17RWiQ9a2vAd5ZWRzfdd5ynvVWlHG4VME
+lo04z6MXrDlxawHDi1M8Y+nuecDkvpIyZHqzH5eUYr3qsiAVlfuX8ngvYzZAOONG
+Dx3drJXK50uQe7FLqdTF65raqtWjlBRGjS0f8zrWkzr2Pnn86Oawde3uPclwx12q
+gUtGJRzHbBXjlU4PqjI3lAoXJJIThFjSY28r9+ZbYgsTF7ANUkz+/m9c4pFuHf2k
+Ytdo+o56T9II2pPc8JIRetDccpMMc5NihWjQ9A==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/
+MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
+DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow
+PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD
+Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
+AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O
+rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq
+OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b
+xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw
+7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD
+aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
+HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG
+SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69
+ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr
+AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz
+R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5
+JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
+Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHbzCCBtigAwIBAgIBCDANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MDQwNTE0NDkzM1oXDTEwMDQwNDE0NDkz
+M1owga4xCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxFjAUBgNVBAoTDVN0
+YXJ0Q29tIEx0ZC4xIzAhBgNVBAsTGlNlY3VyZSBDZXJ0aWZpY2F0ZSBTaWduaW5n
+MS4wLAYDVQQDEyVTdGFydENvbSBDbGFzczEgUHJpbWFyeSBFbWFpbCBGcmVlIENB
+MSEwHwYJKoZIhvcNAQkBFhJhZG1pbkBzdGFydGNvbS5vcmcwggEiMA0GCSqGSIb3
+DQEBAQUAA4IBDwAwggEKAoIBAQC1Ocn11i7FuAU3gmqwytCOspW7FvraRFq97O1I
+q50xLB3kjjyxJva9L+7Vtm5HTNACwwuuCkUTM3ZqzRiEh15CU7VbmGCBfzm3nMmA
+Heh+n+VGyGHnCqFDQRY6e4sDXa7+t9EZtQ/rpUkG7vRG4qJbJ1R1bNYS+fpaXKQ/
+fXxtmzqugTrQtCps5NI4Hj0b4AYwxhzsKdwOVKnQDuEfIfWFU2iIPXJZ7d8R/Mko
+9z3FWaO3MVgRP7jZMjTy6G6s5NNazAOgN14+Rm9tABS//RnjCC3nZtQf52EBGOko
+48ZgE14+yCKkQaw22F16HKYsTOUx3lS/SN0FVyYKN7bw3VjjAgMBAAGjggQTMIIE
+DzAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB5jAdBgNVHQ4EFgQU3IAtde/A
+qrOkZMC+RsjXcU2TesYwgd0GA1UdIwSB1TCB0oAUHInDlsy9/jLVDYyBMbaYnY0o
+ZI2hgbakgbMwgbAxCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxDjAMBgNV
+BAcTBUVpbGF0MRYwFAYDVQQKEw1TdGFydENvbSBMdGQuMRowGAYDVQQLExFDQSBB
+dXRob3JpdHkgRGVwLjEpMCcGA1UEAxMgRnJlZSBTU0wgQ2VydGlmaWNhdGlvbiBB
+dXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEmFkbWluQHN0YXJ0Y29tLm9yZ4IBADAd
+BgNVHREEFjAUgRJhZG1pbkBzdGFydGNvbS5vcmcwHQYDVR0SBBYwFIESYWRtaW5A
+c3RhcnRjb20ub3JnMGIGA1UdHwRbMFkwKaAnoCWGI2h0dHA6Ly9jZXJ0LnN0YXJ0
+Y29tLm9yZy9jYS1jcmwuY3JsMCygKqAohiZodHRwOi8vY3JsLnN0YXJ0Y29tLm9y
+Zy9jcmwvY2EtY3JsLmNybDCCAUoGA1UdIASCAUEwggE9MIIBOQYLKwYBBAGBtTcB
+AQEwggEoMC8GCCsGAQUFBwIBFiNodHRwOi8vY2VydC5zdGFydGNvbS5vcmcvcG9s
+aWN5LnBkZjA1BggrBgEFBQcCARYpaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL2lu
+dGVybWVkaWF0ZS5wZGYwgb0GCCsGAQUFBwICMIGwMBQWDVN0YXJ0Q29tIEx0ZC4w
+AwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdh
+bCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0
+aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20u
+b3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMFAGCWCGSAGG+EIBDQRD
+FkFTdGFydENvbSBDbGFzcyAxIFByaW1hcnkgSW50ZXJtZWRpYXRlIEZyZWUgU1NM
+IEVtYWlsIENlcnRpZmljYXRlczAyBglghkgBhvhCAQQEJRYjaHR0cDovL2NlcnQu
+c3RhcnRjb20ub3JnL2NhLWNybC5jcmwwMwYJYIZIAYb4QgEDBCYWJGh0dHA6Ly9j
+ZXJ0LnN0YXJ0Y29tLm9yZy9jcnQtY3JsLmNybDAyBglghkgBhvhCAQgEJRYjaHR0
+cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwDQYJKoZIhvcNAQEEBQAD
+gYEAtSIIJ8egfl+IjoxHrok3ZR5csA5nhpRGvArYh23SuGaiBqCN5hCuo2zhJ+PT
+onG2AXEuFFHgWWplW35GYbGdGeKjGTkVnQ0rXU90bpp9lwsfxnz/EaWJ0l+v990g
+/SFUg2dFX/+MiGMpers8VdKbpFu39QY2RBmG/MDZNbLhFrE=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAw
+PTELMAkGA1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFz
+cyAyIFByaW1hcnkgQ0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9
+MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNz
+IDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANxQ
+ltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR5aiR
+VhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyL
+kcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCd
+EgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas
+H7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0
+HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1Ud
+DwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4
+QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu
+Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/
+AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8
+yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR
+FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA
+ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB
+kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
+l7+ijrRU
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIElTCCA/6gAwIBAgIEOJsRPDANBgkqhkiG9w0BAQQFADCBujEUMBIGA1UEChML
+RW50cnVzdC5uZXQxPzA9BgNVBAsUNnd3dy5lbnRydXN0Lm5ldC9TU0xfQ1BTIGlu
+Y29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDIwMDAg
+RW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJl
+IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMDAyMDQxNzIwMDBa
+Fw0yMDAyMDQxNzUwMDBaMIG6MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDE/MD0GA1UE
+CxQ2d3d3LmVudHJ1c3QubmV0L1NTTF9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p
+dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMjAwMCBFbnRydXN0Lm5ldCBMaW1pdGVk
+MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp
+b24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHwV9OcfHO
+8GCGD9JYf9Mzly0XonUwtZZkJi9ow0SrqHXmAGc0V55lxyKbc+bT3QgON1WqJUaB
+bL3+qPZ1V1eMkGxKwz6LS0MKyRFWmponIpnPVZ5h2QLifLZ8OAfc439PmrkDQYC2
+dWcTC5/oVzbIXQA23mYU2m52H083jIITiQIDAQABo4IBpDCCAaAwEQYJYIZIAYb4
+QgEBBAQDAgAHMIHjBgNVHR8EgdswgdgwgdWggdKggc+kgcwwgckxFDASBgNVBAoT
+C0VudHJ1c3QubmV0MT8wPQYDVQQLFDZ3d3cuZW50cnVzdC5uZXQvU1NMX0NQUyBp
+bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAyMDAw
+IEVudHJ1c3QubmV0IExpbWl0ZWQxOjA4BgNVBAMTMUVudHJ1c3QubmV0IFNlY3Vy
+ZSBTZXJ2ZXIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxDTALBgNVBAMTBENSTDEw
+KwYDVR0QBCQwIoAPMjAwMDAyMDQxNzIwMDBagQ8yMDIwMDIwNDE3NTAwMFowCwYD
+VR0PBAQDAgEGMB8GA1UdIwQYMBaAFMtswGvjuz7L/CKc/vuLkpyw8m4iMB0GA1Ud
+DgQWBBTLbMBr47s+y/winP77i5KcsPJuIjAMBgNVHRMEBTADAQH/MB0GCSqGSIb2
+fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQQFAAOBgQBi24GRzsia
+d0Iv7L0no1MPUBvqTpLwqa+poLpIYcvvyQbvH9X07t9WLebKahlzqlO+krNQAraF
+JnJj2HVQYnUUt7NQGj/KEQALhUVpbbalrlHhStyCP2yMNLJ3a9kC9n8O6mUE8c1U
+yrrJzOCE98g+EZfTYAkYvAX/bIkz8OwVDw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDtjCCAp6gAwIBAgICAbYwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVVMx
+GDAWBgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1
+c3QgU29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290
+IDUwHhcNOTgwODE0MTQ1MDAwWhcNMTMwODE0MjM1OTAwWjBwMQswCQYDVQQGEwJV
+UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU
+cnVzdCBTb2x1dGlvbnMsIEluYy4xHjAcBgNVBAMTFUdURSBDeWJlclRydXN0IFJv
+b3QgNTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALwSbj+KfHqXAewe
+uzlaAvR4RKJIG457SVJ6uHtHs6+Um2+7lvoramVcuByUc76/iQoigO5X/IwFu3Cf
+lzkE2qOHXKjlyq/AM5rVN1xLrOSA0KYjYPv9ci6UncfOwgQy73hgXe2thw9FZR48
+mgqavl0dmezn8tHGehfZrZtUln/EfGC/haoVNR1A2hG87FQhKC0joajwzy3N3fx+
+D17hZQdWywe00lboXjHMGGPEhtIthc+Tkqtt/mg5+95zvYb45EZ66p8My/QZ/mO8
+0Sx7iDM29uThnAxTgWAc2i6rlqkWiBNQmbK9Vd8VMH7o5Zj7cH5stQf8/Ea30O03
+ln4y/iECAwEAAaNaMFgwEgYDVR0TAQH/BAgwBgEB/wIBBTAOBgNVHQ8BAf8EBAMC
+AQYwFwYDVR0gBBAwDjAMBgoqhkiG+GMBAgEDMBkGA1UdDgQSBBB2CkkhOEyf3vjE
+ScdxcZGdMA0GCSqGSIb3DQEBBQUAA4IBAQBBOtQYW9q43iEc4Y4J5fFoNP/elvQH
+9ac886xKsZv6kvqb7eYyIapKdsXcTzjl39WG5NXIdn2Y17HNj021kSNsi4rr6nzv
+FJTExvAfSi0ycWMrY5EmAgm2gB3t4sy4f9uHY8jh0GwmsTUdQGYQG82VVBgzYewT
+T9oT95mvPtDPjqZyorPDBZrJJ32SzH5SjbOrcG2eiZ9N6xp1wpiq1QIW1wyKvyXk
+6y28mOlYOBl8uTf+2+KZCHMGx5eDan0QAS8yuRcFSmXmL86+XlOmgumaUwqEdC2D
+ysiUFnZflGEo8IWnObvXi9moshMdVAk0JH0ggX1mfqKQdFwQxr3sqxvC
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICUDCCAbkCAgGbMA0GCSqGSIb3DQEBBAUAMHAxCzAJBgNVBAYTAlVTMRgwFgYD
+VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
+bHV0aW9ucywgSW5jLjEeMBwGA1UEAxMVR1RFIEN5YmVyVHJ1c3QgUm9vdCAyMB4X
+DTk4MDgxMTExMzUwN1oXDTA4MDgxMTExMjIxNlowcDELMAkGA1UEBhMCVVMxGDAW
+BgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3Qg
+U29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290IDIw
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANksTE4vaRoj41a6886EwAnAefFE
+XzMfFZF/iogouCRFzI8YzR900bWPcUzWMfZzloSUQMWpg2Akfa9vNLdLTMIJgDtF
+BJ7EPMQndXsADKFkR7UUXYJLUTpYu0RMPdPlBjjoYVyYeLuAs5zacoJioN+cX+v5
+T3fCzGAYAGs0giWzAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAo2SRbxDt526iQkCU
+eM74FAjR+kOF60bNkhTQ7y4tNjkY2brJJ4gp6UgXb/jBqshhbS39QC11QzCXOfgU
+ZL1v72OoK0LfsloNJex7N9jOkSmCFvnoYqLhdsQCfd0li5jh9g1gjPZZkEBRRNHC
++xkkHhc5a3QhFTPWVdeCHnAsJ6g=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb
+MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx
+ETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w
+MzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD
+VQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx
+FzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
+MIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPu
+ktKe1jzIDZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7
+gLFViYsx+tC3dr5BPTCapCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZH
+fAjIgrrep4c9oW24MFbCswKBXy314powGCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4a
+ahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPyMjwmR/onJALJfh1biEIT
+ajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1UdEwEB/wQF
+MAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rk
+c3QuY29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjto
+dHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt
+aW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI
+hvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk
+QIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/
+h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq
+nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR
+rscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2
+9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/
+MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow
+PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp
+Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB
+AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR
+IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q
+gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy
+yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts
+F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2
+jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx
+ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC
+VGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK
+YS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH
+EgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN
+Xo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud
+DgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE
+MTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK
+UWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ
+TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf
+qzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK
+ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE
+JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7
+hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1
+EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm
+nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX
+udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz
+ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe
+LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl
+pYYsfPQS
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICjjCCAXagAwIBAgIDAQAkMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
+QTAeFw0wMjA3MTIxNjMyMzVaFw0xMjA3MTIxNjMyMzVaMEQxCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xGDAWBgNVBAMTD0NlcnR1bSBM
+ZXZlbCBJVjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAmyb1lKqCAKE4juAy
+6lpVNUl6aJ2DuWPSiJ3BBk3/6ty6I4Lr2Dpy1b1vjVelhaFsVKEDgK2JyQlk9XMq
+LPZI2Ql166mJiPKFg77aY/W78EcQfGyjnRvVcs0tG40mAs/p84OEpFcVe/RSqDrD
+/D7R01u+Wj5xLl0PUsFplIGDbikCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zAN
+BgkqhkiG9w0BAQUFAAOCAQEAPS99JujKGVRfa50TKfieq+uK1SxjidErYaZTb3cJ
+NNfQDYn6nk4lnrnab5EUVhO/NegP2yIu3YOnZGfxFDhvVozMTKKAB5r5XKOvzsP9
+9C9578PVMLozucfUMCSwau7Z4l5uuQOHuzjzlVLCibbbf4RwfvZ7hh5sB5c0pNbw
+RQq64RXQUUEvul/W9gUeT9ISHOsASGTq+HJ5i7vNARjukEAXW/maqs9vyTWWbGVI
+1FSOnVyteymq4Xk+9YlIyNPNyacgnsMnU72XKBLDS0KJdhIWALFAZI4dSh5WZNuW
+ZguUnEmeH81lLbR+p/N3iuN8+oSo8UXik92jxeUY2tQJUA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh
+MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE
+YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3
+MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo
+ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg
+MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN
+ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA
+PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w
+wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi
+EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY
+avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+
+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE
+sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h
+/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5
+IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
+ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy
+OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
+TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
+HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
+dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
+ReYNnyicsbkqWletNw+vHX/bvZ8=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl
+MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp
+U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw
+NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE
+ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp
+ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3
+DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf
+8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN
++lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0
+X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa
+K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA
+1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G
+A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR
+zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0
+YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD
+bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w
+DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3
+L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D
+eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl
+xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp
+VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY
+WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDXDCCAsWgAwIBAgICA+owDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRF
+MRAwDgYDVQQIEwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFU
+QyBUcnVzdENlbnRlciBmb3IgU2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJI
+MSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBDbGFzcyAyIENBMSkwJwYJKoZIhvcN
+AQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05ODAzMDkxMTU5NTla
+Fw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFtYnVy
+ZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9y
+IFNlY3VyaXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1
+c3RDZW50ZXIgQ2xhc3MgMiBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVA
+dHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANo46O0y
+AClxgwENv4wB3NrGrTmkqYov1YtcaF9QxmL1Zr3KkSLsqh1R1z2zUbKDTl3LSbDw
+TFXlay3HhQswHJJOgtTKAu33b77c4OMUuAVT8pr0VotanoWT0bSCVq5Nu6hLVxa8
+/vhYnvgpjbB7zXjJT6yLZwzxnPv8V5tXXE8NAgMBAAGjazBpMA8GA1UdEwEB/wQF
+MAMBAf8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3
+LnRydXN0Y2VudGVyLmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0G
+CSqGSIb3DQEBBAUAA4GBAIRS+yjf/x91AbwBvgRWl2p0QiQxg/lGsQaKic+WLDO/
+jLVfenKhhQbOhvgFjuj5Jcrag4wGrOs2bYWRNAQ29ELw+HkuCkhcq8xRT3h2oNms
+Gb0q0WkEKJHKNhAngFdb0lz1wlurZIFjdFH0l7/NEij3TWZ/p/AcASZ4smZHcFFk
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDVTCCAj0CAgGoMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNVBAYTAlVTMRgwFgYD
+VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
+bHV0aW9ucywgSW5jLjEeMBwGA1UEAxMVR1RFIEN5YmVyVHJ1c3QgUm9vdCA0MB4X
+DTk4MDgxMzEzNTEwMFoXDTEzMDgxMzIzNTkwMFowcDELMAkGA1UEBhMCVVMxGDAW
+BgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3Qg
+U29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290IDQw
+ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6nSJuf9pmPDlCsaMqb9P3
+vK6sMVrXEZBHuZ0ZLvnzGyKgw+GnusT8XgqUS5haSybkH/Tc8/6OiNxsLXx3hyZQ
+wF5OqCih6hdpT03GAQ7amg0GViYVtqRdejWvje14Uob5OKuzAdPaBZaxtlCrwKGu
+F1P6QzkgcWUj223Etu2YRYPX0vbiqWv7+XXM78WrcZY16N+OkZuoEHUft84Tjmuz
+lneXGpEvxyxpmfAPKmgAmHZEG4wo0uuO9IO0f6QlXmw72cZo1WG41F4xB7VbkDVS
+V3sXIO0tuB6OiDk+Usvf8FyxZbulErSQY79xnTLB2r9QSpW+BjrEK+vNmHZETQvl
+AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAEOvHIfJSbpliTRJPOoHO0eiedSgO5Bs
+3n+oVMPoTEAyvMjsHOXZrEC6/Iw/wnOc9GTq36ntTlvIAWDuOW1DJ/N/qgjS/k5v
+FDJNfeQ0gKU1xNZGULQ7oC1lH09lfjQoLcCndn0xyQ0zFvYgGSARULsDzHBtlrfv
+TKfaNhXPu03UltyITWyY7blz/ihXoO1k+AqBKXP29pcyhzm0ge/ZTRoHNPe6QjXe
+V9xc1vfF6wonDIGmwtBoTv2SW0iD9haKjzZb7TFsP0F6cfeSPzGkCkBM84biYcE8
+SYEtpbjvupcPvCsdm4ny0o4eTYbywqv2LZnAGyoNobZP+SxYTT19Nwo=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL
+MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV
+BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0
+Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1
+OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i
+SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc
+VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD
+ggEPADCCAQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jf
+tMjWQ+nEdVl//OEd+DFwIxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKg
+uNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2J
+XjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQXa7pIXSSTYtZgo+U4+lK
+8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7uSNQZu+99
+5OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1Ud
+EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3
+kUrL84J6E1wIqzCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy
+dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6
+Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz
+JTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290
+Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u
+TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iS
+GNn3Bzn1LL4GdXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprt
+ZjluS5TmVfwLG4t3wVMTZonZKNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8
+au0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV
+hgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI
+dUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDrDCCApSgAwIBAgILAgAAAAAA1ni4jY0wDQYJKoZIhvcNAQEEBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05OTAxMjgxMjAw
+MDBaFw0wOTAxMjgxMjAwMDBaMG0xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMRswGQYDVQQLExJQcmltYXJ5IENsYXNzIDIgQ0ExJjAkBgNV
+BAMTHUdsb2JhbFNpZ24gUHJpbWFyeSBDbGFzcyAyIENBMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEAkoz+7/RFjhdBbvzYvyFvqwadUsEsAJ0/joW4f0qP
+vaBjKspJJ65agvR04lWS/8LRqnmitvrVnYIET8ayxl5jpzq62O7rim+ftrsoQcAi
++05IGgaS17/Xz7nZvThPOw1EblVB/vwJ29i/844h8egStfYTpdPGTJMisAL/7h0M
+xKhrT3VoVujcKBJQ96gknS4kOfsJBd7lo2RJIdBofnEwkbFg4Dn0UPh6TZgAa3x5
+uk7OSuK6Nh23xTYVlZxkQupfxLr1QAW+4TpZvYSnGbjeTVNQzgfR0lHT7w2BbObn
+bctdfD98zOxPgycl/3BQ9oNZdYQGZlgs3omNAKZJ+aVDdwIDAQABo2MwYTAOBgNV
+HQ8BAf8EBAMCAAYwHQYDVR0OBBYEFHznsrEs3rGna+l2DOGj/U5sx7n2MB8GA1Ud
+IwQYMBaAFGB7ZhpFDZfKiVAvfQTNNKj//P1LMA8GA1UdEwEB/wQFMAMBAf8wDQYJ
+KoZIhvcNAQEEBQADggEBAGPdWc6KeaqYnU7FiWQ3foqTZy8Q6m8nw413bfJcVpQZ
+GmlgMEZdj/JtRTyONZd8L7hR4uiJvYjPJxwINFyIwWgk25GF5M/7+0ON6CUBG8QO
+9wBCSIYfJAhYWoyN8mtHLGiRsWlC/Q2NySbmkoamZG6Sxc4+PH1x4yOkq8fVqKnf
+gqc76IbVw08Y40TQ4NzzxWgu/qUvBYTIfkdCU2uHSv4y/14+cIy3qBXMF8L/RuzQ
+7C20bhIoqflA6evUZpdTqWlVwKmqsi7N0Wn0vvi7fGnuVKbbnvtapj7+mu+UUUt1
+7tjU4ZrxAlYTiQ6nQouWi4UMG4W+Jq6rppm8IvFz30I=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICjzCCAXegAwIBAgIDAQAjMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
+QTAeFw0wMjA3MTIxNjMyMTdaFw0xMjA3MTIxNjMyMTdaMEUxCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xGTAXBgNVBAMTEENlcnR1bSBM
+ZXZlbCBJSUkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALZjBbfGFmlsLjPe
+pWaDwG0LqhF11lWKabaHi1sQhK3qomHY7Em7qpL11dUQ1vsMcnnpzz/J0AEH6KDh
++yAyXV1SE/tVToLYYByZK+JGacLYIYF9aCwV8AhqyzOGurO5QX6vLboXB2WNnwmX
+hyNVKUgnUVy4ktAR2qZJIw5Bjsn/AgMBAAGjEzARMA8GA1UdEwEB/wQFMAMBAf8w
+DQYJKoZIhvcNAQEFBQADggEBAIsLt3vKCZqd/gui45ovm3FSO6FLjzzq4pagPvbN
+nZ39HrhRaCpqkHDAj71L5L27U3eW2D4ILL0iUmZadbC4i3at/PUL9mjhGlajcCN8
+EF6IXGT87Tbcii735jRaaXSbEY4YhNOg9DPBoD4uJMkA8Z0Y/6lYmk4S6KUMCzzt
+t5zZBiWjdd08yFi5VGMvpE74KVOMdMa3JNVaR0XvT0Q8yXo1XKCrY9OFIxnhVgDb
+hzr9fwjKWDwu8kxhT9khAETm0BU2Buu+CTasaJdT/bBR2YEx9qcN7XyXTeDtkOO5
+QeGSqFgzquwjWEbKhf7l/e+efdRCg+ikH3O5snHB6iS+dgg=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICPTCCAaYCEQDNun9W8N/kvFT+IqyzcqpVMA0GCSqGSIb3DQEBAgUAMF8xCzAJ
+BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh
+c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05
+NjAxMjkwMDAwMDBaFw0yODA4MDEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD
+VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMSBQdWJsaWMgUHJp
+bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB
+jQAwgYkCgYEA5Rm/baNWYS2ZSHH2Z965jeu3noaACpEO+jglr0aIguVzqKCbJF0N
+H8xlbgyw0FaEGIeaBpsQoXPftFg5a27B9hXVqKg/qhIGjTGsf7A01480Z4gJzRQR
+4k5FVmkfeAKA2txHkSm7NsljXMXg1y2He6G3MrB7MLoqLzGq7qNn2tsCAwEAATAN
+BgkqhkiG9w0BAQIFAAOBgQBMP7iLxmjf7kMzDl3ppssHhE16M/+SG/Q2rdiVIjZo
+EWx8QszznC7EBz8UsA9P/5CSdvnivErpj82ggAr3xSnxgiJduLHdgSOjeyUVRjB5
+FvjqBUuUfx3CHMjjt/QQQDwTw18fU+hI5Ia0e6E1sHslurjTjqs/OJ0ANACY89Fx
+lA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc
+MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP
+bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2
+MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft
+ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg
+Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP
+ADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC
+206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci
+KtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2
+JxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9
+BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e
+Xz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B
+PeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67
+Xnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq
+Z8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ
+o2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3
++L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj
+YzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj
+FNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE
+AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn
+xPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2
+LHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc
+obGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8
+CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe
+IjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA
+DjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F
+AjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX
+Om/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb
+AZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl
+Zvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw
+RY8mkaKO/qk=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFLDCCBBSgAwIBAgIEOU99hzANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJX
+VzESMBAGA1UEChMJYmVUUlVTVGVkMRswGQYDVQQDExJiZVRSVVNUZWQgUm9vdCBD
+QXMxGjAYBgNVBAMTEWJlVFJVU1RlZCBSb290IENBMB4XDTAwMDYyMDE0MjEwNFoX
+DTEwMDYyMDEzMjEwNFowWjELMAkGA1UEBhMCV1cxEjAQBgNVBAoTCWJlVFJVU1Rl
+ZDEbMBkGA1UEAxMSYmVUUlVTVGVkIFJvb3QgQ0FzMRowGAYDVQQDExFiZVRSVVNU
+ZWQgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANS0c3oT
+CjhVAb6JVuGUntS+WutKNHUbYSnE4a0IYCF4SP+00PpeQY1hRIfo7clY+vyTmt9P
+6j41ffgzeubx181vSUs9Ty1uDoM6GHh3o8/n9E1z2Jo7Gh2+lVPPIJfCzz4kUmwM
+jmVZxXH/YgmPqsWPzGCgc0rXOD8Vcr+il7dw6K/ifhYGTPWqZCZyByWtNfwYsSbX
+2P8ZDoMbjNx4RWc0PfSvHI3kbWvtILNnmrRhyxdviTX/507AMhLn7uzf/5cwdO2N
+R47rtMNE5qdMf1ZD6Li8tr76g5fmu/vEtpO+GRg+jIG5c4gW9JZDnGdzF5DYCW5j
+rEq2I8QBoa2k5MUCAwEAAaOCAfgwggH0MA8GA1UdEwEB/wQFMAMBAf8wggFZBgNV
+HSAEggFQMIIBTDCCAUgGCisGAQQBsT4BAAAwggE4MIIBAQYIKwYBBQUHAgIwgfQa
+gfFSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1
+bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0
+ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGFuZCBjZXJ0aWZpY2F0aW9uIHBy
+YWN0aWNlIHN0YXRlbWVudCwgd2hpY2ggY2FuIGJlIGZvdW5kIGF0IGJlVFJVU1Rl
+ZCdzIHdlYiBzaXRlLCBodHRwczovL3d3dy5iZVRSVVNUZWQuY29tL3ZhdWx0L3Rl
+cm1zMDEGCCsGAQUFBwIBFiVodHRwczovL3d3dy5iZVRSVVNUZWQuY29tL3ZhdWx0
+L3Rlcm1zMDQGA1UdHwQtMCswKaAnoCWkIzAhMRIwEAYDVQQKEwliZVRSVVNUZWQx
+CzAJBgNVBAYTAldXMB0GA1UdDgQWBBQquZtpLjub2M3eKjEENGvKBxirZzAfBgNV
+HSMEGDAWgBQquZtpLjub2M3eKjEENGvKBxirZzAOBgNVHQ8BAf8EBAMCAf4wDQYJ
+KoZIhvcNAQEFBQADggEBAHlh26Nebhax6nZR+csVm8tpvuaBa58oH2U+3RGFktTo
+Qb9+M70j5/Egv6S0phkBxoyNNXxlpE8JpNbYIxUFE6dDea/bow6be3ga8wSGWsb2
+jCBHOElQBp1yZzrwmAOtlmdE/D8QDYZN5AA7KXvOOzuZhmElQITcE2K3+spZ1gMe
+1lMBzW1MaFVA4e5rxyoAAEiCswoBw2AqDPeCNe5IhpbkdNQ96gFxugR1QKepfzk5
+mlWXKWWuGVUlBXJH0+gY3Ljpr0NzARJ0o+FcXxVdJPP55PS2Z2cS52QiivalQaYc
+tmBjRYoQtLpGEK5BV2VsPyMQPyEQWbfkQN0mDCP2qq4=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW
+MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg
+Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9
+MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi
+U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh
+cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA
+A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk
+pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf
+OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C
+Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT
+Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi
+HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM
+Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w
++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+
+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3
+Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B
+26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID
+AQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE
+FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9j
+ZXJ0LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3Js
+LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFM
+BgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0
+Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFy
+dGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYgU3Rh
+cnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlh
+YmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2Yg
+dGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp
+bGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ
+YIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT
+TCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ
+9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8
+jhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW
+FjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz
+ewT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1
+ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L
+EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu
+L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq
+yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC
+O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V
+um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh
+NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
+MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
+d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
+QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
+MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
+b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
+CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
+nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
+43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
+T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
+gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
+BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
+TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
+DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
+hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
+06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
+PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
+YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
+CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
+RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
+VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX
+DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y
+ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy
+VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr
+mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr
+IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK
+mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu
+XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy
+dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye
+jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1
+BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3
+DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92
+9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx
+jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0
+Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz
+ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS
+R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
+MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
+IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
+MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
+FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
+bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
+dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
+H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
+uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
+mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
+a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
+E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
+WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
+VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
+Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
+cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
+IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
+AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
+YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
+6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
+Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
+c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
+mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
+BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln
+biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF
+MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT
+d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
+CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8
+76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+
+bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c
+6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE
+emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd
+MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt
+MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y
+MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y
+FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi
+aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM
+gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB
+qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7
+lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn
+8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov
+L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6
+45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO
+UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5
+O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC
+bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv
+GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a
+77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC
+hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3
+92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp
+Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w
+ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt
+Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML
+RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp
+bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5
+IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp
+ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0xOTEy
+MjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3
+LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp
+YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG
+A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq
+K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe
+sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX
+MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT
+XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/
+HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH
+4QIDAQABo3QwcjARBglghkgBhvhCAQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGA
+vtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdERgL7YibkIozH5oSQJFrlwMB0G
+CSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEA
+WUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo
+oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQ
+h7A6tcOdBTcSo8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18
+f3v/rxzP5tsHrV7bhZ3QKw0z2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfN
+B/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjXOP/swNlQ8C5LWK5Gb9Auw2DaclVy
+vUxFnmG6v4SBkgPR0ml8xQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDKTCCApKgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBzzELMAkGA1UEBhMCWkEx
+FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD
+VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT
+ZXJ2aWNlcyBEaXZpc2lvbjEjMCEGA1UEAxMaVGhhd3RlIFBlcnNvbmFsIFByZW1p
+dW0gQ0ExKjAoBgkqhkiG9w0BCQEWG3BlcnNvbmFsLXByZW1pdW1AdGhhd3RlLmNv
+bTAeFw05NjAxMDEwMDAwMDBaFw0yMDEyMzEyMzU5NTlaMIHPMQswCQYDVQQGEwJa
+QTEVMBMGA1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xGjAY
+BgNVBAoTEVRoYXd0ZSBDb25zdWx0aW5nMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9u
+IFNlcnZpY2VzIERpdmlzaW9uMSMwIQYDVQQDExpUaGF3dGUgUGVyc29uYWwgUHJl
+bWl1bSBDQTEqMCgGCSqGSIb3DQEJARYbcGVyc29uYWwtcHJlbWl1bUB0aGF3dGUu
+Y29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJZtn4B0TPuYwu8KHvE0Vs
+Bd/eJxZRNkERbGw77f4QfRKe5ZtCmv5gMcNmt3M6SK5O0DI3lIi1DbbZ8/JE2dWI
+Et12TfIa/G8jHnrx2JhFTgcQ7xZC0EN1bUre4qrJMf8fAHB8Zs8QJQi6+u4A6UYD
+ZicRFTuqW/KY3TZCstqIdQIDAQABoxMwETAPBgNVHRMBAf8EBTADAQH/MA0GCSqG
+SIb3DQEBBAUAA4GBAGk2ifc0KjNyL2071CKyuG+axTZmDhs8obF1Wub9NdP4qPIH
+b4Vnjt4rueIXsDqg8A6iAJrf8xQVbrvIhVqYgPn/vnQdPfP+MCXRNzRn+qVxeTBh
+KXLA4CxM+1bkOqhv5TJZUtt1KFBZDPgLGeSs2a+WjS9Q2wfD6h+rM+D1KzGJ
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICmjCCAgOgAwIBAgIBJDANBgkqhkiG9w0BAQQFADBxMQswCQYDVQQGEwJERTEc
+MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj
+IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB
+IDEwHhcNOTkwNzA5MTEzNDAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE
+RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl
+U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290
+IENBIDEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANDdmwygF0RED68hQHNn
+VvA+aWgRutk38oGuwySsaaHN/KYYVVb/i58ywdvneCw522CBQaXv082AjRg84lIM
+C5/3ZJ7loPC4YWL0v+Cj2lgr/RUEa706nnyd8j3Y5JXD7E7C8WWrDEvsR4Jb4uFQ
+ddj2YbQYXO0zoEseg/tPhLx5AgMBAAGjQjBAMB0GA1UdDgQWBBQUMeJ/nMoSlfvx
+cCDbTSgTcUJhxjAPBgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkq
+hkiG9w0BAQQFAAOBgQCdHRD6k8gdZCBFXpxvBW2jUn+nqIdls2eaNoZ4chYV/9dF
+cygBhoidkere1ikLDD6jmXRADMzsEOBk/HC2ujkSJ/JeAFC1C9ZK36lv9LMJKID8
+0h7E7HBGhUzeRbABlTisFp9GSu4ty73LZbE65aZLBEsOM/8ce8iEhEfhWmRGSg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICXDCCAcWgAwIBAgIQCgEBAQAAAnwAAAALAAAAAjANBgkqhkiG9w0BAQUFADA6
+MRkwFwYDVQQKExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJp
+dHkgMTAyNCBWMzAeFw0wMTAyMjIyMTAxNDlaFw0yNjAyMjIyMDAxNDlaMDoxGTAX
+BgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAbBgNVBAsTFFJTQSBTZWN1cml0eSAx
+MDI0IFYzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDV3f5mCc8kPD6ugU5O
+isRpgFtZO9+5TUzKtS3DJy08rwBCbbwoppbPf9dYrIMKo1W1exeQFYRMiu4mmdxY
+78c4pqqv0I5CyGLXq6yp+0p9v+r+Ek3d/yYtbzZUaMjShFbuklNhCbM/OZuoyZu9
+zp9+1BlqFikYvtc6adwlWzMaUQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4G
+A1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBTEwBykB5T9zU0B1FTapQxf3q4FWjAd
+BgNVHQ4EFgQUxMAcpAeU/c1NAdRU2qUMX96uBVowDQYJKoZIhvcNAQEFBQADgYEA
+Py1q4yZDlX2Jl2X7deRyHUZXxGFraZ8SmyzVWujAovBDleMf6XbN3Ou8k6BlCsdN
+T1+nr6JGFLkM88y9am63nd4lQtBU/55oc2PcJOsiv6hy8l4A4Q1OOkNumU4/iXgD
+mMrzVcydro7BqkWY+o8aoI2II/EVQQ2lRj6RP4vr93E=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIIODCCB6GgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCAR4xCzAJBgNVBAYTAkVT
+MRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UE
+ChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE
+ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjE0MDIGA1UECxMr
+SVBTIENBIFRpbWVzdGFtcGluZyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTE0MDIG
+A1UEAxMrSVBTIENBIFRpbWVzdGFtcGluZyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
+eTEeMBwGCSqGSIb3DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAxMTAx
+OFoXDTI1MTIyNzAxMTAxOFowggEeMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFy
+Y2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJbnRlcm5l
+dCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoUImlwc0BtYWlsLmlw
+cy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxNDAyBgNVBAsTK0lQUyBDQSBUaW1lc3Rh
+bXBpbmcgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxNDAyBgNVBAMTK0lQUyBDQSBU
+aW1lc3RhbXBpbmcgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxHjAcBgkqhkiG9w0B
+CQEWD2lwc0BtYWlsLmlwcy5lczCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
+vLjuVqWajOY2ycJioGaBjRrVetJznw6EZLqVtJCneK/K/lRhW86yIFcBrkSSQxA4
+Efdo/BdApWgnMjvEp+ZCccWZ73b/K5Uk9UmSGGjKALWkWi9uy9YbLA1UZ2t6KaFY
+q6JaANZbuxjC3/YeE1Z2m6Vo4pjOxgOKNNtMg0GmqaMCAwEAAaOCBIAwggR8MB0G
+A1UdDgQWBBSL0BBQCYHynQnVDmB4AyKiP8jKZjCCAVAGA1UdIwSCAUcwggFDgBSL
+0BBQCYHynQnVDmB4AyKiP8jKZqGCASakggEiMIIBHjELMAkGA1UEBhMCRVMxEjAQ
+BgNVBAgTCUJhcmNlbG9uYTESMBAGA1UEBxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJ
+UFMgSW50ZXJuZXQgcHVibGlzaGluZyBTZXJ2aWNlcyBzLmwuMSswKQYDVQQKFCJp
+cHNAbWFpbC5pcHMuZXMgQy5JLkYuICBCLTYwOTI5NDUyMTQwMgYDVQQLEytJUFMg
+Q0EgVGltZXN0YW1waW5nIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MTQwMgYDVQQD
+EytJUFMgQ0EgVGltZXN0YW1waW5nIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4w
+HAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAM
+BgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYB
+BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYBBAGCNwIB
+FgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYD
+VR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlw
+cy5lczBHBglghkgBhvhCAQ0EOhY4VGltZXN0YW1waW5nIENBIENlcnRpZmljYXRl
+IGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5lcy8wKQYJYIZIAYb4QgECBBwWGmh0
+dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMEAGCWCGSAGG+EIBBAQzFjFodHRwOi8v
+d3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJUaW1lc3RhbXBpbmcuY3JsMEUGCWCG
+SAGG+EIBAwQ4FjZodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25U
+aW1lc3RhbXBpbmcuaHRtbD8wQgYJYIZIAYb4QgEHBDUWM2h0dHA6Ly93d3cuaXBz
+LmVzL2lwczIwMDIvcmVuZXdhbFRpbWVzdGFtcGluZy5odG1sPzBABglghkgBhvhC
+AQgEMxYxaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lUaW1lc3RhbXBp
+bmcuaHRtbDB/BgNVHR8EeDB2MDegNaAzhjFodHRwOi8vd3d3Lmlwcy5lcy9pcHMy
+MDAyL2lwczIwMDJUaW1lc3RhbXBpbmcuY3JsMDugOaA3hjVodHRwOi8vd3d3YmFj
+ay5pcHMuZXMvaXBzMjAwMi9pcHMyMDAyVGltZXN0YW1waW5nLmNybDAvBggrBgEF
+BQcBAQQjMCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9vY3NwLmlwcy5lcy8wDQYJKoZI
+hvcNAQEFBQADgYEAZbrBzAAalZHK6Ww6vzoeFAh8+4Pua2JR0zORtWB5fgTYXXk3
+6MNbsMRnLWhasl8OCvrNPzpFoeo2zyYepxEoxZSPhExTCMWTs/zif/WN87GphV+I
+3pGW7hdbrqXqcGV4LCFkAZXOzkw+UPS2Wctjjba9GNSHSl/c7+lW8AoM6HU=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID1TCCAr2gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBrTELMAkGA1UEBhMCMDAx
+DTALBgNVBAgTBE5PTkUxFTATBgNVBAcTDFRoZSBJbnRlcm5ldDEUMBIGA1UEChML
+VGhlIE9wZW5OSUMxHTAbBgNVBAsTFENlcnRpZnlpbmcgQXV0aG9yaXR5MRkwFwYD
+VQQDExB3d3cub3Blbm5pYy5nbHVlMSgwJgYJKoZIhvcNAQkBFhljZXJ0aWZpY2F0
+ZXNAb3Blbm5pYy5nbHVlMB4XDTA0MDUyNDE3MjUwNVoXDTE0MDUyMjE3MjUwNVow
+ga0xCzAJBgNVBAYTAjAwMQ0wCwYDVQQIEwROT05FMRUwEwYDVQQHEwxUaGUgSW50
+ZXJuZXQxFDASBgNVBAoTC1RoZSBPcGVuTklDMR0wGwYDVQQLExRDZXJ0aWZ5aW5n
+IEF1dGhvcml0eTEZMBcGA1UEAxMQd3d3Lm9wZW5uaWMuZ2x1ZTEoMCYGCSqGSIb3
+DQEJARYZY2VydGlmaWNhdGVzQG9wZW5uaWMuZ2x1ZTCCASIwDQYJKoZIhvcNAQEB
+BQADggEPADCCAQoCggEBAMCTPR/BpszVjQhU1EuJKdu3aRkFV3ll2QqKQEkPXnlu
+BH0AJpqWXAlR93TANfYd8E+/MNh7OjmZ9869SjTpQ8nTpTkg1klgdWZRKOFjCsku
+9mMnrW3fMarSfh/UOdFEQJNPujVq/mfpdLhcbM0npnWm/Js19qVfZPGOkAWzgL3s
+lyeu2CMUYsE8loN7U0sPQ9KeN9iIFMB+qAEB2uLD4oQpnqBkeB1xLdWT+Z3lVLyq
++Io008uKXRaW69JtyQEIYJOzOcPdYWZdLV4CRtqKVAjmMW8roAGD2N/6UF17TwsW
+9nRmZy+gIToyNaTvB2/9zpNUngqLsZm1wHDUju4W85MCAwEAATANBgkqhkiG9w0B
+AQQFAAOCAQEAsnjlLhh4GadL5e71My82N8ZR55glwtuMHBnhkb9mVOnh8irTAciK
+wn9EHA27nwwBA+zHiA53dBuanqVicTseduupZ7BCMKB93ITrV8C2Sxwut35rOA8m
+VNlTi4Cpi8vqKHQEadE6kHMSIpXRAXkrvUOPTolIzO/Kd02/DN2RfdyUiW8EbTXb
+wb9+xDwx8aWL+m7+IvTo7/v1KX43YNyv+3PA8K2IrPxKBNot64Wv9U+D7BS0zWPu
+oTMfM1PhVF8Nx1W1EVpz3dWyqKAsQ7wDrOnV9Y+LQFAyp5eTIAKFy9zIdz43S9kN
+RdCrAogC7m1RAkG9qabxQrW6oYcjL3Z5IA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID2DCCAsACEQDQHkCLAAB3bQAAAAEAAAAEMA0GCSqGSIb3DQEBBQUAMIGpMQsw
+CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp
+dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UE
+CxMIRFNUQ0EgWDIxFjAUBgNVBAMTDURTVCBSb290Q0EgWDIxITAfBgkqhkiG9w0B
+CQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAeFw05ODExMzAyMjQ2MTZaFw0wODExMjcy
+MjQ2MTZaMIGpMQswCQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMO
+U2FsdCBMYWtlIENpdHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0
+IENvLjERMA8GA1UECxMIRFNUQ0EgWDIxFjAUBgNVBAMTDURTVCBSb290Q0EgWDIx
+ITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTCCASIwDQYJKoZIhvcN
+AQEBBQADggEPADCCAQoCggEBANx18IzAdZaawGIfJvfE4Zrq4FZzW5nNAUSoCLbV
+p9oaBBg5kkp4o4HC9Xd6ULRw/5qrxsfKboNPQpj7Jgva3G3WqZlVUmfpKAOS3OWw
+BZoPFflrWXJW8vo5/Kpo7g8fEIMv/J36F5bdguPmRX3AS4BEH+0s4IT9kVySVGkl
+5WJp3OXuAFK9MwutdQKFp2RQLcUZGTDAJtvJ0/0uma1ZtQtN1EGuhUhDWdy3qOKi
+3sOP17ihYqZoUFLkzzGnlIXan0YyF1bl8utmPRL/Q9uY73fPy4GNNLHGUEom0eQ+
+QVCvbK4iNC7Va26Dunm4dmVI2gkpZGMiuftHdoWMhkTLCdsCAwEAATANBgkqhkiG
+9w0BAQUFAAOCAQEAtTYOXeFhKFoRZcA/gwN5Tb4opgsHAlKFzfiR0BBstWogWxyQ
+2TA8xkieil5k+aFxd+8EJx8H6+Qm93N0yUQYGmbT4EOvkTvRyyzYdFQ6HE3K1GjN
+I3wdEJ5F6fYAbqbNGf9PLCmPV03Ed5K+4EwJ+11EhmYhqLkyolbV6YyDfFk/xPEL
+553snr2cGA4+wjl5KLcDDQjLxufZATdQEOzMYRZA1K8xdHv8PzGn0EdzMzkbzE5q
+10mDEQb+64JYMzJM8FasHpwvVpp7wUocpf1VNs78lk30sPDst2yC7S8xmUJMqbIN
+uBVd8d+6ybVK1GSYsyapMMj9puyrliGtf8J4tg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE
+BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWdu
+IFBsYXRpbnVtIENBIC0gRzIwHhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAw
+WjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMSMwIQYDVQQD
+ExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQAD
+ggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu669y
+IIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2Htn
+IuJpX+UFeNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+
+6ixuEFGSzH7VozPY1kneWCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5ob
+jM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIoj5+saCB9bzuohTEJfwvH6GXp43gOCWcw
+izSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/68++QHkwFix7qepF6w9fl
++zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34TaNhxKFrY
+zt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaP
+pZjydomyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtF
+KwH3HBqi7Ri6Cr2D+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuW
+ae5ogObnmLo2t/5u7Su9IPhlGdpVCX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMB
+AAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O
+BBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCvzAeHFUdvOMW0
+ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW
+IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUA
+A4ICAQAIhab1Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0
+uMoI3LQwnkAHFmtllXcBrqS3NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+
+FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4U99REJNi54Av4tHgvI42Rncz7Lj7
+jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8KV2LwUvJ4ooTHbG/
+u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl9x8D
+YSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1
+puEa+S1BaYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXa
+icYwu+uPyyIIoK6q8QNsOktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbG
+DI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSYMdp08YSTcU1f+2BY0fvEwW2JorsgH51x
+kcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAciIfNAChs0B0QTwoRqjt8Z
+Wr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFJzCCBA+gAwIBAgIJAPp8LIApP8JkMA0GCSqGSIb3DQEBBAUAMIGlMQswCQYD
+VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIQmVya2VsZXkx
+FDASBgNVBAoTC0VuZG1haWwgT3JnMQwwCgYDVQQLEwNNVEExIjAgBgNVBAMTGUNs
+YXVzIEFzc21hbm4gQ0EgUlNBIDIwMDcxJjAkBgkqhkiG9w0BCQEWF2NhK2NhLXJz
+YTIwMDdAZXNtdHAub3JnMB4XDTA3MDUwNDAyMDc1NloXDTEwMDUwMzAyMDc1Nlow
+gaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhC
+ZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAKBgNVBAsTA01UQTEiMCAG
+A1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwNzEmMCQGCSqGSIb3DQEJARYX
+Y2ErY2EtcnNhMjAwN0Blc210cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCwKJExr4LOcu82q33psfV3ZjhLOB9fPRLTyP2a9NT2uJD5Jl8p90P5
+NOxlYgG7ZPFd6nUEPZJlYKIGYvqIytggUMgeOFO1GN23vccINUzZ3MaXVje2ZTN0
+WrLDhQgrtyZw/zgCGmdq0EkYEEv4268GnLGogqGxddJSm1MMyqfjFTh5baH173yL
+/b0EePnoHrmS6nTXRR5MyL30XPwaf+cxxqvLeMdNL7VyEDUnShr6Uxn4p1lj6+kV
+q9xxaYxCHJZOiYBmyZ4h1T0IGXSl9Qegrt55r/1Cwnl+jPg5IjvDxFg70A3mqRG2
+os0u5RZm/X5lM5SwNoAn9YB2qeXf8s/vAgMBAAGjggFWMIIBUjAdBgNVHQ4EFgQU
+sklrUkXukDbSeUcDM9mguoBQ2hwwgdoGA1UdIwSB0jCBz4AUsklrUkXukDbSeUcD
+M9mguoBQ2hyhgaukgagwgaUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9y
+bmlhMREwDwYDVQQHEwhCZXJrZWxleTEUMBIGA1UEChMLRW5kbWFpbCBPcmcxDDAK
+BgNVBAsTA01UQTEiMCAGA1UEAxMZQ2xhdXMgQXNzbWFubiBDQSBSU0EgMjAwNzEm
+MCQGCSqGSIb3DQEJARYXY2ErY2EtcnNhMjAwN0Blc210cC5vcmeCCQD6fCyAKT/C
+ZDAMBgNVHRMEBTADAQH/MCIGA1UdEQQbMBmBF2NhK2NhLXJzYTIwMDdAZXNtdHAu
+b3JnMCIGA1UdEgQbMBmBF2NhK2NhLXJzYTIwMDdAZXNtdHAub3JnMA0GCSqGSIb3
+DQEBBAUAA4IBAQCYmHzT0FtyRxXmImi7eA54ZulWFti8nVrcJyn7kS1qITUYVrRP
+KgnACG+aWSsucpr7ULrHqZGg+Wy+z3hCQwJwU5e6auPaF+gfxzpb57zr5SRM9c9h
+NB4g7Rdj74HTniX+zAUZzIqCyUw6tWtJUXZGAqpgu8S5YUgz2nmNRqMGIJjzsts7
+rckdDpc9txQZ030Ei2qB4BFb4TWj/y8RhhwxhXr9PzbvmSVGLrDLQ0VK7L7TP6R3
+m3nMzpJjpdnt26CdXXzXgPbJQfsClo7989oFnYGnJdomNTupDIz1p11I7IfHemBR
+dvLemxQrVYpD35kZ8+vnA+anoqIo3dUHaj/3
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIGUTCCBTmgAwIBAgIEPLVPQDANBgkqhkiG9w0BAQUFADBmMRIwEAYDVQQKEwli
+ZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEzMDEGA1UEAxMq
+YmVUUlVTVGVkIFJvb3QgQ0EgLSBFbnRydXN0IEltcGxlbWVudGF0aW9uMB4XDTAy
+MDQxMTA4MjQyN1oXDTIyMDQxMTA4NTQyN1owZjESMBAGA1UEChMJYmVUUlVTVGVk
+MRswGQYDVQQLExJiZVRSVVNUZWQgUm9vdCBDQXMxMzAxBgNVBAMTKmJlVFJVU1Rl
+ZCBSb290IENBIC0gRW50cnVzdCBJbXBsZW1lbnRhdGlvbjCCASIwDQYJKoZIhvcN
+AQEBBQADggEPADCCAQoCggEBALr0RAOqEmq1Q+xVkrYwfTVXDNvzDSduTPdQqJtO
+K2/b9a0cS12zqcH+e0TrW6MFDR/FNCswACnxeECypP869AGIF37m1CbTukzqMvtD
+d5eHI8XbQ6P1KqNRXuE70mVpflUVm3rnafdE4Fe1FehmYA8NA/uCjqPoEXtsvsdj
+DheT389Lrm5zdeDzqrmkwAkbhepxKYhBMvnwKg5sCfJ0a2ZsUhMfGLzUPvfYbiCe
+yv78IZTuEyhL11xeDGbu6bsPwTSxfwh28z0mcMmLJR1iJAzqHHVOwBLkuhMdMCkt
+VjMFu5dZfsZJT4nXLySotohAtWSSU1Yk5KKghbNekLQSM80CAwEAAaOCAwUwggMB
+MIIBtwYDVR0gBIIBrjCCAaowggGmBg8rBgEEAbE+AAACCSiDkTEwggGRMIIBSQYI
+KwYBBQUHAgIwggE7GoIBN1JlbGlhbmNlIG9uIG9yIHVzZSBvZiB0aGlzIENlcnRp
+ZmljYXRlIGNyZWF0ZXMgYW4gYWNrbm93bGVkZ21lbnQgYW5kIGFjY2VwdGFuY2Ug
+b2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0
+aW9ucyBvZiB1c2UsIHRoZSBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu
+dCBhbmQgdGhlIFJlbHlpbmcgUGFydHkgQWdyZWVtZW50LCB3aGljaCBjYW4gYmUg
+Zm91bmQgYXQgdGhlIGJlVFJVU1RlZCB3ZWIgc2l0ZSwgaHR0cHM6Ly93d3cuYmV0
+cnVzdGVkLmNvbS9wcm9kdWN0c19zZXJ2aWNlcy9pbmRleC5odG1sMEIGCCsGAQUF
+BwIBFjZodHRwczovL3d3dy5iZXRydXN0ZWQuY29tL3Byb2R1Y3RzX3NlcnZpY2Vz
+L2luZGV4Lmh0bWwwEQYJYIZIAYb4QgEBBAQDAgAHMIGJBgNVHR8EgYEwfzB9oHug
+eaR3MHUxEjAQBgNVBAoTCWJlVFJVU1RlZDEbMBkGA1UECxMSYmVUUlVTVGVkIFJv
+b3QgQ0FzMTMwMQYDVQQDEypiZVRSVVNUZWQgUm9vdCBDQSAtIEVudHJ1c3QgSW1w
+bGVtZW50YXRpb24xDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMjAwMjA0MTEw
+ODI0MjdagQ8yMDIyMDQxMTA4NTQyN1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaA
+FH1w5a44iwY/qhwaj/nPJDCqhIQWMB0GA1UdDgQWBBR9cOWuOIsGP6ocGo/5zyQw
+qoSEFjAMBgNVHRMEBTADAQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6NC4wAwIE
+kDANBgkqhkiG9w0BAQUFAAOCAQEAKrgXzh8QlOu4mre5X+za95IkrNySO8cgjfKZ
+5V04ocI07cUTWVwFtStPYZuR+0H8/NU8TZh2BvWBfevdkObRVlTa4y0MnxEylCIB
+evZsLHRnBMylj44ss0O1lKLQfelifwa+JwGDnjr9iu6YQ0pr17WXOzq/T220Y/oz
+ADQuLW2WyXvKmWO6vvT2MKAtmJbpVkQFqUSjYRDrgqFnXbxdJ3Wqiig2KjiS2d2k
+XgClzMx8KSreKJCrt+G2/30lC0DYqjSjLd4H61/OCt3Kfjp9JsFiaDrmLzfzgYYh
+xKlkqu9FNtEaZnz46TfW1mG+oq1I59/mdP7TbX3SJdysYlep9w==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEbTCCA1WgAwIBAgIBATANBgkqhkiG9w0BAQUFADBZMQswCQYDVQQGEwJERTET
+MBEGA1UEChMKREZOLVZlcmVpbjEQMA4GA1UECxMHREZOLVBLSTEjMCEGA1UEAxMa
+REZOLVZlcmVpbiBQQ0EgQmFzaWMgLSBHMDEwHhcNMDUwMjI4MDAyNTM0WhcNMTMw
+NDI4MDAyNTM0WjBZMQswCQYDVQQGEwJERTETMBEGA1UEChMKREZOLVZlcmVpbjEQ
+MA4GA1UECxMHREZOLVBLSTEjMCEGA1UEAxMaREZOLVZlcmVpbiBQQ0EgQmFzaWMg
+LSBHMDEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDeDfSYr29ejnmr
+TmBjhgMwKixZiYEI2xiL8F/JrGrfnchxMFXu71FpZX3sCxbUR6mJypbOhNbCLS/n
+Ji1gWUOz8KRRNGdYdIIePT3B/0JZImIwkHOMhiMMRmxBgBq0QBzWaI/bUF6NjmTg
+BVRYXJyVLIGPZ8Ha6RmONrlzAmmYpG/4ojnXFSDaIY2zjft7zsEBdOttOqYkH6Fn
+juFzNYKXe5Rq8f+lJn29S5baSFZICjVHGEvY08xjbAMP3r7W3Yz1QD/ag5NG4RMK
+ww/aKN8VOu2hRIXhWsCpuiBwgf2fY7CRQ4uitJ6+rdpjiA3/zHqLfV+OK6pZFNiX
+jdMJYl2jAgMBAAGjggE+MIIBOjAdBgNVHQ4EFgQUTEapXyMoUyqy69Kl/oDrTPKg
+gnIwHwYDVR0jBBgwFoAUTEapXyMoUyqy69Kl/oDrTPKggnIwDwYDVR0TAQH/BAUw
+AwEB/zCBwwYDVR0fBIG7MIG4MFqgWKBWhlRodHRwOi8vY2RwMS5wY2EuZGZuLmRl
+L2Rmbi1wa2kvY2VydGlmaWNhdGlvbi94NTA5L2Jhc2ljL2cxL2RhdGEvY3Jscy9y
+b290LWNhLWNybC5jcmwwWqBYoFaGVGh0dHA6Ly9jZHAyLnBjYS5kZm4uZGUvZGZu
+LXBraS9jZXJ0aWZpY2F0aW9uL3g1MDkvYmFzaWMvZzEvZGF0YS9jcmxzL3Jvb3Qt
+Y2EtY3JsLmNybDAOBgNVHQ8BAf8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMA0G
+CSqGSIb3DQEBBQUAA4IBAQCW0LOtisuiZyRUI6hFBMZ6RtvcDtQ0JO1rQu/1SEor
+qbmShrHpvHXIBTkcgfJbHKn0eria0dNmLlcnunqun22WFrMGq6mUQLFvDh/MvLrZ
+QW5JL0jP/9FZ1UpWoSjnJ6swDOEuQ40g8ideHvWaVv6R4ObS7mE5iFrNl9zMtZC0
+W10V6uzoeh32lIe94wWs3gn2D6maGE1M1eku/63cOFG+V00RS6U+iKwzS2hvtEql
+mshFO39LWitI7bGq1NiEiv5+TXekhwPAC/m5OL7lBwKilaxHNwNAlLhp4couf1Wa
+1Rz7aS43zqqxuqalfhI0y0jWk3JDc+Lo2Sl3Xqha2Lnq
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD
+VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
+bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv
+b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV
+UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU
+cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds
+b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH
+iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS
+r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4
+04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r
+GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9
+3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P
+lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc
+MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj
+IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB
+IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE
+RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl
+U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290
+IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU
+ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC
+QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr
+rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S
+NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc
+QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH
+txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP
+BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC
+AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp
+tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa
+IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl
+6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+
+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU
+Cm26OWMohpLzGITY+9HPBVZkVw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDTTCCAragAwIBAgIENm6ibzANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJV
+UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMR0wGwYDVQQL
+ExREU1QgKEFOWCBOZXR3b3JrKSBDQTAeFw05ODEyMDkxNTQ2NDhaFw0xODEyMDkx
+NjE2NDhaMFIxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVy
+ZSBUcnVzdCBDby4xHTAbBgNVBAsTFERTVCAoQU5YIE5ldHdvcmspIENBMIGdMA0G
+CSqGSIb3DQEBAQUAA4GLADCBhwKBgQC0SBGAWKDVpZkP9jcsRLZu0XzzKmueEbaI
+IwRccSWeahJ3EW6/aDllqPay9qIYsokVoGe3eowiSGv2hDQftsr3G3LL8ltI04ce
+InYTBLSsbJZ/5w4IyTJRMC3VgOghZ7rzXggkLAdZnZAa7kbJtaQelrRBkdR/0o04
+JrBvQ24JfQIBA6OCATAwggEsMBEGCWCGSAGG+EIBAQQEAwIABzB0BgNVHR8EbTBr
+MGmgZ6BlpGMwYTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0
+dXJlIFRydXN0IENvLjEdMBsGA1UECxMURFNUIChBTlggTmV0d29yaykgQ0ExDTAL
+BgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkxNTQ2NDhagQ8yMDE4MTIw
+OTE1NDY0OFowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFIwWVXDMFgpTZMKlhKqz
+ZBdDP4I2MB0GA1UdDgQWBBSMFlVwzBYKU2TCpYSqs2QXQz+CNjAMBgNVHRMEBTAD
+AQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB
+AEklyWCxDF+pORDTxTRVfc95wynr3vnCQPnoVsXwL+z02exIUbhjOF6TbhiWhbnK
+UJykuOpmJmiThW9vTHHQvnoLPDG5975pnhDX0UDorBZxq66rOOFwscqSFuBdhaYY
+gAYAnOGmGEJRp2hoWe8mlF+tMQz+KR4XAYQ3W+gSMqNd
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB
+kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw
+IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG
+EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD
+VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu
+dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN
+BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6
+E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ
+D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK
+4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq
+lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW
+bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB
+o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT
+MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js
+LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr
+BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB
+AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft
+Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj
+j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH
+KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv
+2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3
+mfnGV/TJVTl4uix5yaaIK/QI
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE
+BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu
+IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow
+RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY
+U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
+MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv
+Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br
+YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF
+nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH
+6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt
+eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/
+c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ
+MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH
+HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf
+jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6
+5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB
+rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU
+F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c
+wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0
+cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB
+AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp
+WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9
+xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ
+2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ
+IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8
+aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X
+em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR
+dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/
+OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+
+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy
+tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFuzCCBKOgAwIBAgIEPaqQijANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJJ
+VDEXMBUGA1UEChMOQWN0YWxpcyBTLnAuQS4xJzAlBgNVBAsTHkNlcnRpZmljYXRp
+b24gU2VydmljZSBQcm92aWRlcjEYMBYGA1UEAxMPQWN0YWxpcyBSb290IENBMB4X
+DTAyMTAxNDA5MzgzOFoXDTIyMTAxNDA4MzgzOFowaTELMAkGA1UEBhMCSVQxFzAV
+BgNVBAoTDkFjdGFsaXMgUy5wLkEuMScwJQYDVQQLEx5DZXJ0aWZpY2F0aW9uIFNl
+cnZpY2UgUHJvdmlkZXIxGDAWBgNVBAMTD0FjdGFsaXMgUm9vdCBDQTCCASIwDQYJ
+KoZIhvcNAQEBBQADggEPADCCAQoCggEBALxUY4qYFUi+aq7hcJBKpFUAJotujU/r
+s9/KyFNshOQwuj27+/PAQIzBYs6uIE43H1w2/nqIXgDiqYoeXabK04HJ9XQzYlPC
+KHIrwvu3wYHTw/rX66liBZQerB9TaSvKORw2j2M4xTHkyOPUvJDXYZ1aYNCgY4QF
+QpA+3P3FzRATqf0S4FXmcA1u7CcrTSdAzofinHP/ahz9suye2+fbXD+0HyCvWjlm
+raSNqETtDUGSmI8pYWEBU21J/BYNOAMCPGvKshv5/x83JeIwfmRE7tXw4Vu2bPBZ
+wnsLcgN4ZsuCid4yZf/AF4IFlOge1hWJIS3Pp/PPpACxVbPKW91yl6cCAwEAAaOC
+AmkwggJlMA8GA1UdEwEB/wQFMAMBAf8wggEmBgNVHSAEggEdMIIBGTCCARUGBiuB
+HwECATCCAQkwgdcGCCsGAQUFBwICMIHKGoHHVGhlIHVzZSBvZiBjZXJ0aWZpY2F0
+ZXMgaXNzdWVkIGJ5IEFjdGFsaXMgUy5wLkEuIChEVU5TIDQ0MC00ODktNzM1LCBJ
+U08gT2JqZWN0IElEIDEuMy4xNTkpIGlzIHN1YmplY3QgdG8gdGhlIHRlcm1zIGFu
+ZCBjb25kaXRpb25zIG9mIHRoZSByZWxldmFudCBDUFMgYW5kIHBvbGljeS4gU2Vl
+IGh0dHBzOi8vY2EuYWN0YWxpcy5pdC9wb2xpY3kvcm9vdDAtBggrBgEFBQcCARYh
+aHR0cHM6Ly9jYS5hY3RhbGlzLml0L3BvbGljeS9yb290MIHXBgNVHR8Egc8wgcww
+gZ2ggZqggZeGgZRsZGFwOi8vbGRhcC5hY3RhbGlzLml0L2NuJTNkQWN0YWxpcyUy
+MFJvb3QlMjBDQSxvdSUzZENlcnRpZmljYXRpb24lMjBTZXJ2aWNlJTIwUHJvdmlk
+ZXIsbyUzZEFjdGFsaXMlMjBTLnAuQS4sYyUzZElUP2NlcnRpZmljYXRlUmV2b2Nh
+dGlvbkxpc3Q7YmluYXJ5MCqgKKAmhiRodHRwOi8vY2EuYWN0YWxpcy5pdC9jcmwv
+cm9vdC9nZXRDUkwwHQYDVR0OBBYEFB7ghEPsF1OorzmajAqbVQfojJU4MB8GA1Ud
+IwQYMBaAFB7ghEPsF1OorzmajAqbVQfojJU4MA4GA1UdDwEB/wQEAwIBBjANBgkq
+hkiG9w0BAQUFAAOCAQEAOmUZc6fAtot8dNnznTc38oeGdjCX3pZauLdUsQrbhU2t
+o+wNeGmKfjGaG3Cw0MyO8q89TadIR6T6Nuuz0crmAc4OU5FZGdd6KzkiZGBZIEiY
+tLQ/B8FkmplZLxZCG8Y2jmEmLGcqNzWFqeJ8Yhtmx7DCrcoU0Utrw9Nssdvbt4PJ
+hv0zm6l4iRdIfYrCtoZzVXvaxOmWt4cd9bdorj1RJoDHyDPmMNBLvD6BSuUvzNMT
+VydnJegPG7KrAN/LJjRMlZKyFbaKmybwRVPmPFl0MOSjQ0k/mHOl286jq9VNIVV0
+oLzu8a+gJWPJNqwz6JJkAsNknS+CVu55OPuA/zXKxA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDWDCCAkCgAwIBAgICAx0wDQYJKoZIhvcNAQEFBQAwTTELMAkGA1UEBhMCVVMx
+DTALBgNVBAoTBFZJU0ExLzAtBgNVBAsTJlZpc2EgSW50ZXJuYXRpb25hbCBTZXJ2
+aWNlIEFzc29jaWF0aW9uMB4XDTAwMDgxNjIxNTIwMFoXDTIwMDgxNTIzNTkwMFow
+TTELMAkGA1UEBhMCVVMxDTALBgNVBAoTBFZJU0ExLzAtBgNVBAsTJlZpc2EgSW50
+ZXJuYXRpb25hbCBTZXJ2aWNlIEFzc29jaWF0aW9uMIIBIjANBgkqhkiG9w0BAQEF
+AAOCAQ8AMIIBCgKCAQEAxR1Nc0GV4SC0bGzOZ+p1BqzEBMJgLwiSzyDtbqnJcSZW
+ov3auwz4lQnJ+fIdz0SV7TFK2m3gvfx1FpbC7wp6DMe4tJBGLqkXCuBHRIR8HD0g
+RgZDQ4Vy613hA7wymsvuCcZXFbMu2jJgpxKYkpvTyiNCsCP3UGlOjJtooTcwkskh
+L2iKoNaEqVhNDOtVPboKRkj6wr65B8DsvZM0eTk9t5o0oAw9o/+ahOb64D+qVIQB
+M0qFxqgUXhXB12DV8Gl4aWR41xTuE9ij8v91YThs1Cay12iIGWcO6+G/vI6a6siU
+6bbM+BWFk21mdyuxFwuIJmxGot/OQ6Vu9/0bR25Y9wIDAQABo0IwQDAOBgNVHQ8B
+Af8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUy8PGY8recX/bp9f/
+QnT2y8y2UDIwDQYJKoZIhvcNAQEFBQADggEBALYYhKS+5n/N+0aRFH0AQHd3hrmN
+cR2c/vHY5QE/2aJgG826czQs7l4EksQiRFbs6vv3yQEW/ego7fje/Tw+LpiMjeN4
+4s+Oi+CvwY1gFIKCVrGHLvDpEhUdPmkKrY6mWPSZ/BFG7vfJ7cavLLmGJdKX/k+d
+2DLhwmZRc4YN3XXjivr0ijVm3YhnrXmo/Gn12/qvlbSckB9fwRbJyAiAGtcD8l5x
+o1ZjHkU2fXG+MWd0hi/Z7IjCIL2ZTT1VBdCiWkxVIpjQ8XX0F/rY4/7iFOAPZfqy
+1mksM1DJJ6CskDFLFOXrY2TgPeP8EkrFloIt2iU5/tR/LkHHYkjXcUU7eJI=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDXDCCAsWgAwIBAgICA+swDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRF
+MRAwDgYDVQQIEwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFU
+QyBUcnVzdENlbnRlciBmb3IgU2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJI
+MSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBDbGFzcyAzIENBMSkwJwYJKoZIhvcN
+AQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05ODAzMDkxMTU5NTla
+Fw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFtYnVy
+ZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9y
+IFNlY3VyaXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1
+c3RDZW50ZXIgQ2xhc3MgMyBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVA
+dHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALa0wTUF
+Lg2N7KBAahwOJ6ZQkmtQGwfeLud2zODa/ISoXoxjaitN2U4CdhHBC/KNecoAtvGw
+Dtf7pBc9r6tpepYnv68zoZoqWarEtTcI8hKlMbZD9TKWcSgoq40oht+77uMMfTDW
+w1Krj10nnGvAo+cFa1dJRLNu6mTP0o56UHd3AgMBAAGjazBpMA8GA1UdEwEB/wQF
+MAMBAf8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3
+LnRydXN0Y2VudGVyLmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0G
+CSqGSIb3DQEBBAUAA4GBABY9xs3Bu4VxhUafPiCPUSiZ7C1FIWMjWwS7TJC4iJIE
+Tb19AaM/9uzO8d7+feXhPrvGq14L3T2WxMup1Pkm5gZOngylerpuw3yCGdHHsbHD
+2w2Om0B8NwvxXej9H5CIpQ5ON2QhqE6NtJ/x3kit1VYYUimLRzQSCdS7kjXvD9s0
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOc
+UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx
+c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xS
+S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg
+SGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcNMDUxMTA3MTAwNzU3
+WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVrdHJv
+bmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJU
+UjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSw
+bGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWe
+LiAoYykgS2FzxLFtIDIwMDUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
+AQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqeLCDe2JAOCtFp0if7qnef
+J1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKIx+XlZEdh
+R3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJ
+Qv2gQrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGX
+JHpsmxcPbe9TmJEr5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1p
+zpwACPI2/z7woQ8arBT9pmAPAgMBAAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58S
+Fq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8GA1UdEwEB/wQFMAMBAf8wDQYJ
+KoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/nttRbj2hWyfIvwq
+ECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4
+Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFz
+gw2lGh1uEpJ+hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotH
+uFEJjOp9zYhys2AzsfAKRO8P9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LS
+y3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5UrbnBEI=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
+CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9DZXJ0RW5n
+aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
+aW9uMRMwEQYDVQQDEwpjZXJ0ZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBjZXJ0
+ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
+CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
+BAoTD0NlcnRFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
+b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCmNlcnRlbmdpbmUxIDAeBgkqhkiG9w0B
+CQEWEWNhQGNlcnRlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEA7aTXURShaeVt9u/dP3Q2dVib3jTCZvEyc6yfpGgaYWewXWuP4HOSfI4h
+GZblbpl+dzJc6RjhR+pguIRtbT5FJB8SJGjRqoujBEOQOxtVtc2fjM9Dqh0iOvMW
+WS6buxHG55GVrHAQaO5HXEScKQBa9ZyNmpSXPTEBrDMej1OAGOkc524/TZrgFPF4
+AiJLLkxCcP8NuzUKlW3WzNMSSoCtjkUKy4wjSLlAWCFM0T9Df6/+Z8ZUQTzHoKCD
+ncH5Qnynd7DlOwKQ2JwwxRhYGiGVTUN0GUq7qA11kW3+vnbFesKQXoF6o2PVx9s2
+YXviI2NXXUjZ0pVnsnFCc45Pm8XojwIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0G
+CSqGSIb3DQEBBQUAA4IBAQBP/aHOKJ00Akzc9HWM1X30hlWZFBaQi4pqD4Uhk8+p
+KzzwFP5DRLBOz8TYBbtdXrS6hxVMr2sqWmhVkuyepWhHZazKGyHY/y0FbOXsewAV
+1QxxSyx7ve89pCKv4/w0rQcP916iHc8Y/TCpmz7eITa3GId+8H/XTaBi8GBp9X9O
+w8m25FmEB1NT+eJwefvfdKowjy4tSorKdW/eJspxNuTSRGmUy8G71W5dYvgpAlx6
+mdnHyzxEGvRYNNI2bS0ifXgbEFNWqSas9q34ea5KOpkJu8T/KyXfSb6rPOsBSb0t
+wMowwGtCVH2C4Lw/8zo0EjhMpTOsPaub408PrZ+NQ2bl
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW
+MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs
+IENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG
+EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg
+R2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A
+PRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8
+Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL
+TytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL
+5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7
+S4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe
+2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE
+FHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap
+EBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td
+EPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv
+/NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN
+A0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0
+abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF
+I8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz
+4iIprn2DQKi6bA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIG2jCCBcKgAwIBAgIDFc/9MA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJE
+RTEhMB8GA1UEChMYRGV1dHNjaGVzIEZvcnNjaHVuZ3NuZXR6MRYwFAYDVQQLEw1E
+Rk4tQ0VSVCBHbWJIMRAwDgYDVQQLEwdERk4tUENBMS0wKwYDVQQDEyRERk4gVG9w
+bGV2ZWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEmNl
+cnRpZnlAcGNhLmRmbi5kZTAeFw0wMTEyMDExMjExMTZaFw0xMDAxMzExMjExMTZa
+MIGsMQswCQYDVQQGEwJERTEhMB8GA1UEChMYRGV1dHNjaGVzIEZvcnNjaHVuZ3Nu
+ZXR6MRYwFAYDVQQLEw1ERk4tQ0VSVCBHbWJIMRAwDgYDVQQLEwdERk4tUENBMS0w
+KwYDVQQDEyRERk4gVG9wbGV2ZWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxITAf
+BgkqhkiG9w0BCQEWEmNlcnRpZnlAcGNhLmRmbi5kZTCCASIwDQYJKoZIhvcNAQEB
+BQADggEPADCCAQoCggEBAMF5rhMt6zmhxK5oWPwT2FG7Up7T5DovHSD/YKPIRxsv
+DWmC4dTzByIBLnOmEflk+5KAqAYao6eY1qF0hR4WiS4DjCsn7l3zNo/4i2eF4EmG
+EksBygb4tRlTThcO7heFX+Du5qFoks+ONqa70RlwOr2l53KVwjMXBCtCLFSKRLVu
+xeh5+Smkm+FuOmwEugndM2n74Djjyf9DCOaHGZrHwVDh+Vpy5Ny4bKCSboujRxd5
+NxsStUshDVbTeS3B8TuzAJbywYWEE7erox+7WTfQr8ivSCBhrNJ36VRjAb8hiV9I
+uy2TmJYo2oPyC8a3eM3xj9Ku2IW3tS2zpfiIzt9xvFMCAwEAAaOCAwEwggL9MA8G
+A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFAYL+rX4SHijILELPs+g0MTRf33QMIHb
+BgNVHSMEgdMwgdCAFAYL+rX4SHijILELPs+g0MTRf33QoYGypIGvMIGsMQswCQYD
+VQQGEwJERTEhMB8GA1UEChMYRGV1dHNjaGVzIEZvcnNjaHVuZ3NuZXR6MRYwFAYD
+VQQLEw1ERk4tQ0VSVCBHbWJIMRAwDgYDVQQLEwdERk4tUENBMS0wKwYDVQQDEyRE
+Rk4gVG9wbGV2ZWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxITAfBgkqhkiG9w0B
+CQEWEmNlcnRpZnlAcGNhLmRmbi5kZYIDFc/9MAsGA1UdDwQEAwIBBjARBglghkgB
+hvhCAQEEBAMCAAcwgaUGA1UdHwSBnTCBmjBLoEmgR4ZFaHR0cDovL3d3dy5kZm4t
+cGNhLmRlL2NlcnRpZmljYXRpb24veDUwOS9nMS9kYXRhL2NybHMvcm9vdC1jYS1j
+cmwuY3J4MEugSaBHhkVodHRwOi8vd3d3LmRmbi1wY2EuZGUvY2VydGlmaWNhdGlv
+bi94NTA5L2cxL2RhdGEvY3Jscy9yb290LWNhLWNybC5jcmwwOAYJYIZIAYb4QgED
+BCsWKWh0dHBzOi8vd3d3LmRmbi1wY2EuZGUvY2dpL2NoZWNrLXJldi5jZ2k/MEsG
+CWCGSAGG+EIBCAQ+FjxodHRwOi8vd3d3LmRmbi1wY2EuZGUvY2VydGlmaWNhdGlv
+bi9wb2xpY2llcy94NTA5cG9saWN5Lmh0bWwwOAYJYIZIAYb4QgENBCsWKVRoZSBE
+Rk4gVG9wLUxldmVsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MGQGA1UdIARdMFsw
+WQYLKwYBBAHZGoIsAQEwSjBIBggrBgEFBQcCARY8aHR0cDovL3d3dy5kZm4tcGNh
+LmRlL2NlcnRpZmljYXRpb24vcG9saWNpZXMveDUwOXBvbGljeS5odG1sMA0GCSqG
+SIb3DQEBBQUAA4IBAQAmbai6JMt7nkuavyvxKzLGn04Gyt0zKrp8zmERp4inktvY
+7p+vkaomYu2QYC7cHq0tlrPXQQhhetjiXGb+36aJtHDkEA0NwrJzYnHgPsvx7z0w
+ysENP4wxf97KsSWm07RY+f6/gIQF7Je7CW30Rzq7N6R0NMBs32mJgdn3ntqlFNw3
+Nbs050FEjPNq54RdawlJo85x+w+QJd7uQM4yZjHpRhvwgte9Ge1UqCUdpMsLHzeM
+KJ0B9GhwIIqOJCMiPgKjcUBrn6ehSX70POvXvjjE2+FzhPGTyTkS474d2UCAnL9q
+hPrdWXzBjOumOjhJutT1aecm9eljlshmh1cNen00
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV
+UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy
+dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1
+MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx
+dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B
+AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f
+BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A
+cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC
+AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ
+MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm
+aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw
+ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj
+IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF
+MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA
+A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
+7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh
+1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUx
+ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0
+b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQD
+EylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikgVGFudXNpdHZhbnlraWFkbzAeFw05
+OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYDVQQGEwJIVTERMA8G
+A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh
+Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5l
+dExvY2sgVXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqG
+SIb3DQEBAQUAA4GNADCBiQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xK
+gZjupNTKihe5In+DCnVMm8Bp2GQ5o+2So/1bXHQawEfKOml2mrriRBf8TKPV/riX
+iK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr1nGTLbO/CVRY7QbrqHvc
+Q7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8E
+BAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1G
+SUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFu
+b3MgU3pvbGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBh
+bGFwamFuIGtlc3p1bHQuIEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExv
+Y2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGln
+aXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0
+IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh
+c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGph
+biBhIGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJo
+ZXRvIGF6IGVsbGVub3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBP
+UlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmlj
+YXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBo
+dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNA
+bmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06
+sPgzTEdM43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXa
+n3BukxowOR0w2y7jfLKRstE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKS
+NitjrFgBazMpUIaD8QFI
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC
+TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0
+aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0
+aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz
+MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw
+IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR
+dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp
+li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D
+rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ
+WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug
+F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU
+xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC
+Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv
+dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw
+ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl
+IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh
+c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy
+ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
+Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI
+KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T
+KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq
+y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p
+dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD
+VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL
+MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk
+fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8
+7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R
+cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y
+mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW
+xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK
+SnQ2+Q==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHdzCCBuCgAwIBAgIBBDANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MDQwNTE0MDMwMVoXDTEwMDQwNDE0MDMw
+MVowgbYxCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxFjAUBgNVBAoTDVN0
+YXJ0Q29tIEx0ZC4xIzAhBgNVBAsTGlNlY3VyZSBDZXJ0aWZpY2F0ZSBTaWduaW5n
+MTYwNAYDVQQDEy1TdGFydENvbSBDbGFzcyAzIFByaW1hcnkgSW50ZXJtZWRpYXRl
+IEZyZWUgQ0ExITAfBgkqhkiG9w0BCQEWEmFkbWluQHN0YXJ0Y29tLm9yZzCCASIw
+DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOrln2ah7STrLbenTGlJMS7cWEjG
+AlZv1y1z9vfIr8UmkqnuDBChs6huXQ4dCRPMxGaylIfwYVLrqTfkZ2oLDCrmC9cj
+ES9K3W7oOA9ZyciYnKMMiN+ep3fSMF4AC+w52LEioYXyaPKA6HGeAddvKF75LCRu
+bNkpN6QcdtIuIiTsfPcI8wjpvjI6XpfXc58fFSKqzNGe6i/70I6NQxF71JuP8v00
+lMZYJtDM7TKjwk3BqxYr20bI8stMEHfea+J+7MP3XfqdD3AyhdU/qbSodvw4Ra11
+B2BBwQ5Prl6WddG3G2HsexwaXB+/3O2XQOKIxZOUnFiXdQU4MGGdT2+axlUCAwEA
+AaOCBBMwggQPMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgHmMB0GA1UdDgQW
+BBT3QeMYP9FZ3+ib7NdB9Ao9Vhk7SjCB3QYDVR0jBIHVMIHSgBQcicOWzL3+MtUN
+jIExtpidjShkjaGBtqSBszCBsDELMAkGA1UEBhMCSUwxDzANBgNVBAgTBklzcmFl
+bDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xGjAYBgNV
+BAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBGcmVlIFNTTCBDZXJ0aWZp
+Y2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSYWRtaW5Ac3RhcnRjb20u
+b3JnggEAMB0GA1UdEQQWMBSBEmFkbWluQHN0YXJ0Y29tLm9yZzAdBgNVHRIEFjAU
+gRJhZG1pbkBzdGFydGNvbS5vcmcwYgYDVR0fBFswWTApoCegJYYjaHR0cDovL2Nl
+cnQuc3RhcnRjb20ub3JnL2NhLWNybC5jcmwwLKAqoCiGJmh0dHA6Ly9jcmwuc3Rh
+cnRjb20ub3JnL2NybC9jYS1jcmwuY3JsMIIBSgYDVR0gBIIBQTCCAT0wggE5Bgsr
+BgEEAYG1NwEBATCCASgwLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29t
+Lm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFydGNv
+bS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCBvQYIKwYBBQUHAgIwgbAwFBYNU3RhcnRD
+b20gTHRkLjADAgEBGoGXTGltaXRlZCBMaWFiaWxpdHksIHJlYWQgdGhlIHNlY3Rp
+b24gKkxlZ2FsIExpbWl0YXRpb25zKiBvZiB0aGUgU3RhcnRDb20gQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkgUG9saWN5IGF2YWlsYWJsZSBhdCBodHRwOi8vY2VydC5z
+dGFydGNvbS5vcmcvcG9saWN5LnBkZjARBglghkgBhvhCAQEEBAMCAAcwUQYJYIZI
+AYb4QgENBEQWQlN0YXJ0Q29tIENsYXNzIDMgUHJpbWFyeSBJbnRlcm1lZGlhdGUg
+RnJlZSBTU0wgU2VydmVyIENlcnRpZmljYXRlczAyBglghkgBhvhCAQQEJRYjaHR0
+cDovL2NlcnQuc3RhcnRjb20ub3JnL2NhLWNybC5jcmwwMgYJYIZIAYb4QgEDBCUW
+I2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9jYS1jcmwuY3JsMDIGCWCGSAGG+EIB
+CAQlFiNodHRwOi8vY2VydC5zdGFydGNvbS5vcmcvcG9saWN5LnBkZjANBgkqhkiG
+9w0BAQQFAAOBgQB4oOa2GiYHYYqqVIrUUZ3c4OvMSCRMCW0aeI7Zr3ku+4IOpE7n
+8fZp4yjGUYXMb3fwa8XpUS/3MDLtw9pc4xk7Zlw5o78H+ilUA6UUZ6YO5IXJo9hS
+nPsBp5TmV9fg4HBUhey1Kif6zgqaZiyKq33NzWrTfKCu+BwK1WF0TnaF7w==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
+IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
+IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
+Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
+BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
+MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
+ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
+CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ
+8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6
+zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y
+fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7
+w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc
+G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k
+epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q
+laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ
+QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU
+fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826
+YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w
+ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY
+gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe
+MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0
+IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy
+dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw
+czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0
+dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl
+aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC
+AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
+b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB
+ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc
+nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg
+18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
+gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
+Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
+sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
+SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
+CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
+GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
+zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
+omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICfTCCAeagAwIBAgIEAgAAuDANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJJ
+RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSkwJwYD
+VQQDEyBCYWx0aW1vcmUgQ3liZXJUcnVzdCBNb2JpbGUgUm9vdDAeFw0wMDA1MTIx
+ODIwMDBaFw0yMDA1MTIyMzU5MDBaMGExCzAJBgNVBAYTAklFMRIwEAYDVQQKEwlC
+YWx0aW1vcmUxEzARBgNVBAsTCkN5YmVyVHJ1c3QxKTAnBgNVBAMTIEJhbHRpbW9y
+ZSBDeWJlclRydXN0IE1vYmlsZSBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
+iQKBgQCjbbE4Vqz8tVYh3sCQXSZHgsZ9jx+ghY8vu9ThHB3yJB8osC+5pKVvoiIg
+ZP6ERzx+K2xparjUwJaOjFINzW9B1L8ErqeBLy2YSNLBlKO1GV1dUWT0jkGwm8At
+IqBexthaEmO8EUpeJhId4iYF5g9fIh96X3aUrs9aKA6rRdoiMQIDAQABo0IwQDAd
+BgNVHQ4EFgQUyeKPwAImWrbAB+N/lAcY2y6lmnAwDwYDVR0TAQH/BAUwAwEB/zAO
+BgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQEFBQADgYEAUwgLJgl4QnPU7Hp3Rw3j
+CzNx764zFE37+v0at1H15JkcBnHXKRnX5hUgUVFGbU/eGEmY0Ph4u3HojQEG1ddk
+j5TfR/6ghWk2qS9CemhKEtaLC3BECqQE7yaIwTVxOF0bW0hC8OeUHHCVNKir9avi
+eK318FL9m+pCDOjYVL5TZvU=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDRzCCArCgAwIBAgIENm3FGDANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJV
+UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRswGQYDVQQL
+ExJEU1QtRW50cnVzdCBHVEkgQ0EwHhcNOTgxMjA5MDAwMjI0WhcNMTgxMjA5MDAz
+MjI0WjBQMQswCQYDVQQGEwJVUzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUg
+VHJ1c3QgQ28uMRswGQYDVQQLExJEU1QtRW50cnVzdCBHVEkgQ0EwgZ0wDQYJKoZI
+hvcNAQEBBQADgYsAMIGHAoGBALYd90uNDxPjEvUJ/gYyDq9MQfV91Ec9KgrfgwXe
+3n3mAxb2UTrLRxpKrX7E/R20vnSKeN0Lg460hBPE+/htKa6h4Q8PQ+O1XmBp+oOU
+/Hnm3Hbt0UQrjv0Su/4XdxcMie2n71F9xO04wzujevviTaBgtfL9E2XTxuw/vjWc
+PSLvAgEDo4IBLjCCASowEQYJYIZIAYb4QgEBBAQDAgAHMHIGA1UdHwRrMGkwZ6Bl
+oGOkYTBfMQswCQYDVQQGEwJVUzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUg
+VHJ1c3QgQ28uMRswGQYDVQQLExJEU1QtRW50cnVzdCBHVEkgQ0ExDTALBgNVBAMT
+BENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkwMDAyMjRagQ8yMDE4MTIwOTAwMDIy
+NFowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFJOaRMrQeFOAKUkE38evMz+ZdV+u
+MB0GA1UdDgQWBBSTmkTK0HhTgClJBN/HrzM/mXVfrjAMBgNVHRMEBTADAQH/MBkG
+CSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GBAGSJzAOn
+3AryWCDn/RegKHLNh7DNmLUkR2MzMRAQsu+KV3KuTAPgZ5+sYEOEIsGpo+Wxp94J
+1M8NeEYjW49Je/4TIpeU6nJI4SwgeJbpZkUZywllY2E/0UmYsXYQVdVjSmZLpAdr
+3nt/ueaTWxoCW4AO3Y0Y1Iqjwmjxo+AY0U5M
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUx
+ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0
+b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQD
+EytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBDKSBUYW51c2l0dmFueWtpYWRvMB4X
+DTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJBgNVBAYTAkhVMREw
+DwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9u
+c2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMr
+TmV0TG9jayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNA
+OoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3ZW3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC
+2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63euyucYT2BDMIJTLrdKwW
+RMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQwDgYDVR0P
+AQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEW
+ggJNRklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0
+YWxhbm9zIFN6b2xnYWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFz
+b2sgYWxhcGphbiBrZXN6dWx0LiBBIGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBO
+ZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1iaXp0b3NpdGFzYSB2ZWRpLiBB
+IGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0ZWxlIGF6IGVs
+b2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs
+ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25s
+YXBqYW4gYSBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kg
+a2VyaGV0byBheiBlbGxlbm9yemVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4g
+SU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5kIHRoZSB1c2Ugb2YgdGhpcyBjZXJ0
+aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQUyBhdmFpbGFibGUg
+YXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwgYXQg
+Y3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmY
+ta3UzbM2xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2g
+pO0u9f38vf5NNwgMvOOWgyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4
+Fp1hBWeAyNDYpQcCNJgEjTME1A==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHdzCCBuCgAwIBAgIBAjANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MDQwNTEzNTg0NloXDTEwMDQwNDEzNTg0
+NlowgbYxCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxFjAUBgNVBAoTDVN0
+YXJ0Q29tIEx0ZC4xIzAhBgNVBAsTGlNlY3VyZSBDZXJ0aWZpY2F0ZSBTaWduaW5n
+MTYwNAYDVQQDEy1TdGFydENvbSBDbGFzcyAxIFByaW1hcnkgSW50ZXJtZWRpYXRl
+IEZyZWUgQ0ExITAfBgkqhkiG9w0BCQEWEmFkbWluQHN0YXJ0Y29tLm9yZzCCASIw
+DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMYOG0paZv2Wka+o/eq+GlV+4xLr
+V1tFxsHdwdopeIP0AQpWuaknET4MnF90Fqp7C6lPJYnQ+7gqWACIuPAjotegDrFM
+1LkoTRdPSDsepNb9WfnwLtYyDdWZw2PFqaVLigvIcQZHGSAgGXHPng4ZNzCJJ/R7
+yCLMHpdMReh0BGIFW26/20vbzatubXs/upBjHCZXFpoxPbzgdGAkOoJERJkbDOo9
+7K8RBKiOKfd5eFFrixt7G/vm8d/59wbr/RK9a3cvyqu1rPeL6BIIdIJBcNUikTCo
+STow79VeSDtnABaKw21zmEpeNrpq8HgLDpf3B1j6DUFCQAzLjl3956HHpRECAwEA
+AaOCBBMwggQPMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgHmMB0GA1UdDgQW
+BBQaouoLTC3H/ebtb07K/fNtB6gaYDCB3QYDVR0jBIHVMIHSgBQcicOWzL3+MtUN
+jIExtpidjShkjaGBtqSBszCBsDELMAkGA1UEBhMCSUwxDzANBgNVBAgTBklzcmFl
+bDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xGjAYBgNV
+BAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBGcmVlIFNTTCBDZXJ0aWZp
+Y2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSYWRtaW5Ac3RhcnRjb20u
+b3JnggEAMB0GA1UdEQQWMBSBEmFkbWluQHN0YXJ0Y29tLm9yZzAdBgNVHRIEFjAU
+gRJhZG1pbkBzdGFydGNvbS5vcmcwYgYDVR0fBFswWTApoCegJYYjaHR0cDovL2Nl
+cnQuc3RhcnRjb20ub3JnL2NhLWNybC5jcmwwLKAqoCiGJmh0dHA6Ly9jcmwuc3Rh
+cnRjb20ub3JnL2NybC9jYS1jcmwuY3JsMIIBSgYDVR0gBIIBQTCCAT0wggE5Bgsr
+BgEEAYG1NwEBATCCASgwLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29t
+Lm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFydGNv
+bS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCBvQYIKwYBBQUHAgIwgbAwFBYNU3RhcnRD
+b20gTHRkLjADAgEBGoGXTGltaXRlZCBMaWFiaWxpdHksIHJlYWQgdGhlIHNlY3Rp
+b24gKkxlZ2FsIExpbWl0YXRpb25zKiBvZiB0aGUgU3RhcnRDb20gQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkgUG9saWN5IGF2YWlsYWJsZSBhdCBodHRwOi8vY2VydC5z
+dGFydGNvbS5vcmcvcG9saWN5LnBkZjARBglghkgBhvhCAQEEBAMCAAcwUQYJYIZI
+AYb4QgENBEQWQlN0YXJ0Q29tIENsYXNzIDEgUHJpbWFyeSBJbnRlcm1lZGlhdGUg
+RnJlZSBTU0wgU2VydmVyIENlcnRpZmljYXRlczAyBglghkgBhvhCAQQEJRYjaHR0
+cDovL2NlcnQuc3RhcnRjb20ub3JnL2NhLWNybC5jcmwwMgYJYIZIAYb4QgEDBCUW
+I2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9jYS1jcmwuY3JsMDIGCWCGSAGG+EIB
+CAQlFiNodHRwOi8vY2VydC5zdGFydGNvbS5vcmcvcG9saWN5LnBkZjANBgkqhkiG
+9w0BAQQFAAOBgQDOg+zO05YF1TFL0dtfqGt8tzHUTxZOH/mPPIUxPkw6rnTQ4U5c
+AJdN4AV8zTJRUYnBsRQnLW30DBb/y7/jUuMwsK21Dsxhp4nOuVsKX6bBvsC5Y4FV
+eoHUYTKAZUjaPjS6LSdFLusfvR+2DkXDCGq4J3FMUDP4nC2a8aEMo11mrg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEdTCCA12gAwIBAgIBATANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQGEwJERTET
+MBEGA1UEChMKREZOLVZlcmVpbjEQMA4GA1UECxMHREZOLVBLSTElMCMGA1UEAxMc
+REZOLVZlcmVpbiBQQ0EgQ2xhc3NpYyAtIEcwMTAeFw0wNTAyMjgwMDI5MzdaFw0x
+MzA0MjgwMDI5MzdaMFsxCzAJBgNVBAYTAkRFMRMwEQYDVQQKEwpERk4tVmVyZWlu
+MRAwDgYDVQQLEwdERk4tUEtJMSUwIwYDVQQDExxERk4tVmVyZWluIFBDQSBDbGFz
+c2ljIC0gRzAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA681NReNA
+JXHDzvKj/rtz4nRuGGXqx9U1U7zsmTZYxj+U8L8TVyarqI4B7Z9XXQWF7FIbbMin
+xepuuU803uzezL/SNRB8d6AOpZa4INB9YuR1YdOIOEh+FwJN0tpcNGyEDETXzMMn
+Mo+7cQx5T83l2O7v9rNBWLbCTMx8z0jloBFVythUf45qd9CjX7IKhC6kT1doallE
+KvbDVfql/W/QlypqS4L8sFf26TQg+0zP1jp+s48C8KV0KfylY11CtPpU+YmkjvMM
+Kbr88IBnLzZwibOR9vEakxXE0HELdnCBzjNP0KfbZ7QeazxDdyZyvyFsVveJy4ac
+wYqnnR70vZ46iQIDAQABo4IBQjCCAT4wHQYDVR0OBBYEFIOuO8yT4SRSeukgT4Nw
+oirdey8BMB8GA1UdIwQYMBaAFIOuO8yT4SRSeukgT4Nwoirdey8BMA8GA1UdEwEB
+/wQFMAMBAf8wgccGA1UdHwSBvzCBvDBcoFqgWIZWaHR0cDovL2NkcDEucGNhLmRm
+bi5kZS9kZm4tcGtpL2NlcnRpZmljYXRpb24veDUwOS9jbGFzc2ljL2cxL2RhdGEv
+Y3Jscy9yb290LWNhLWNybC5jcmwwXKBaoFiGVmh0dHA6Ly9jZHAyLnBjYS5kZm4u
+ZGUvZGZuLXBraS9jZXJ0aWZpY2F0aW9uL3g1MDkvY2xhc3NpYy9nMS9kYXRhL2Ny
+bHMvcm9vdC1jYS1jcmwuY3JsMA4GA1UdDwEB/wQEAwIBBjARBglghkgBhvhCAQEE
+BAMCAAcwDQYJKoZIhvcNAQEFBQADggEBANoVpY6BlFA78JpT7FRA+PeaCcnkwm6D
+Rp3V34uT4rWJNSnyv18vGdqbKnNV5WscVu0LnOT2XHHyoMyINzqx30dhEk2KQlSZ
+78R8c+TOVufqFNe4vr5kp0J4repAeeW0SOD80tQhpT9u6QWaE6To2udTlc1MpwR4
+4nju3QrYRZZnqs3cmLQVTjjiEY7ve2ULm3UAJZoxgVqSbKWZqDB1k8hWcDeooWZV
+FM9zPcJ6XnpTIDZTqf2pBHzNnOSW0jDHb/pIe3YSpA27eDqIPI5bMh+xvRtFUea8
+dDHcoJRlvkk3LeK57zIgHpYxspn54m7BmXVDQ8nzsGOwdiCU7clf47I=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC/zCCAecCEAoBAQEAAAJ8AAAABAAAAAIwDQYJKoZIhvcNAQEFBQAwPjEhMB8G
+A1UEChMYWGNlcnQgSW50ZXJuYXRpb25hbCBJbmMuMRkwFwYDVQQLExBYY2VydCBS
+b290IENBIHYxMB4XDTAwMDgxODE4NDA1MFoXDTI1MDgxNTE5MDAzOFowPjEhMB8G
+A1UEChMYWGNlcnQgSW50ZXJuYXRpb25hbCBJbmMuMRkwFwYDVQQLExBYY2VydCBS
+b290IENBIHYxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwZKr8rY1
+NgJID4X0Ti+CZc1IvrG3PbN7rroyNIY8mL/4sL37wsz2CZc4XI2lI07hyITmkGd0
+O6P2bpkrj8MH0pdRB08Ey56y+Dz3OOaWSjrrFW/nYuZDMweyDVrPlSk5Z4gTI9SM
+bV+OIeAx87XcmcXE7YUQfpLUoh08HwuzI+bAyySbbBCmzRTWo51Tj/ceQZq2Gx0I
+XPc5QcMe3kwmo2B8LhOHkWzXwiMv530ZH81b6pjFuUZ9NUbke4tK2ZPgBqvAzEr9
+29oLMD+4XOAHE6jFMPy8hvaqvw5jL49JchDRnoX5Qe1IPHgM/aAqBhuv091nL+xI
+L1FJNiK3SM1J7wIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQCo3LMgLv1XSBAP5o1g
+Uht2HZxmoG/6aAbYp5zLoQyOJeiux986cK2p+CokvLzHqscJt7sQ6R9a1aIBRosF
+xKN1SQtAx7Frn9tYFmMyhFoQjWKWq5hmm7r6VggbumLz7zlr/GSxya7vXpThooD5
+CIMWEjaW2QmQ2Zg6rz2F2JEqkhxcuczVXHM4jntzUgy6n/KOv8h8ChO6cpGgOyDv
+iSrDDIBpVnMQ9GAZ4B4WSmSr/EY60AvTl7Fc2ZysGDogB3oi+bcQZbrs5lPUquTD
+Qbyb38LdmgFG1I5F7cnKFjSEjTJUPFRikI0aZlLN+hzMDPyx45PIp9nraGOP0H4u
+Ld0p
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDrDCCApSgAwIBAgILAgAAAAAA1ni41sMwDQYJKoZIhvcNAQEEBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05OTAxMjgxMjAw
+MDBaFw0wOTAxMjgxMjAwMDBaMG0xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMRswGQYDVQQLExJQcmltYXJ5IENsYXNzIDMgQ0ExJjAkBgNV
+BAMTHUdsb2JhbFNpZ24gUHJpbWFyeSBDbGFzcyAzIENBMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEAkV5WZdbAwAScv0fEXHt6MQH5WJaZ4xyEL9xWj631
+WYHVQ2ZdWpOMdcqp5xHBURAUYMks1HuvxneGq3onrm+VuQvKtkb7fhr0DRRt0slO
+sq7wVPZcQEw2SHToVIxlZhCnvSu3II0FSa14fdIkI1Dj8LR5mwE5/6870y3u4UmN
+jS88akFFL5vjPeES5JF1ns+gPjySgW+KLhjc4PKMjP2H2Qf0QJTJTk9D32dWb70D
+UHyZZ6S5PJFsAm6E1vxG98xvGD4X8O8LZBZX5qyG8UiqQ8HJJ3hzREXihX26/7Ph
++xsFpEs7mRIlAVAUaq9d6sgM7uTa7EuLXGgTldzDtTA61wIDAQABo2MwYTAOBgNV
+HQ8BAf8EBAMCAAYwHQYDVR0OBBYEFMw2zBe0RZEv7c87MEh3+7UUmb7jMB8GA1Ud
+IwQYMBaAFGB7ZhpFDZfKiVAvfQTNNKj//P1LMA8GA1UdEwEB/wQFMAMBAf8wDQYJ
+KoZIhvcNAQEEBQADggEBAFeyVMy9lRdkYIm2U5EMRZLDPahsw8yyGPV4QXTYfaMn
+r3cNWT6UHWn6idMMvRoB9D/o4Hcagiha5mLXt+M2yQ6feuPC08xZiQzvFovwNnci
+yqS2t8FCZwFAY8znOGSHWxSWZnstFO69SW3/d9DiTlvTgMJND8q4nYGXpzRux+Oc
+SOW0qkX19mVMSPISwtKTjMIVJPMrUv/jCK64btYsEs85yxIq56l7X5g9o+HMpmOJ
+XH0xdfnV1l3y0NQ9355xqA7c5CCXeOZ/U6QNUU+OOwOuow1aTcN55zVYcELJXqFe
+tNkio0RTNaTQz3OAxc+fVph2+RRMd4eCydx+XTTVNnU=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl
+MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
+d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
+b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG
+EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl
+cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi
+MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c
+JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP
+mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+
+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4
+VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/
+AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB
+AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW
+BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun
+pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC
+dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf
+fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm
+NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx
+H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEAjCCAuoCEQDQHkCKAAACfAAAAAMAAAABMA0GCSqGSIb3DQEBBQUAMIG+MQsw
+CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp
+dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEjMCEGA1UE
+CxMaTmF0aW9uYWwgUmV0YWlsIEZlZGVyYXRpb24xGTAXBgNVBAMTEERTVCAoTlJG
+KSBSb290Q0ExITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAeFw05
+ODEyMTExNjE0MTZaFw0wODEyMDgxNjE0MTZaMIG+MQswCQYDVQQGEwJ1czENMAsG
+A1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxJDAiBgNVBAoTG0Rp
+Z2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEjMCEGA1UECxMaTmF0aW9uYWwgUmV0
+YWlsIEZlZGVyYXRpb24xGTAXBgNVBAMTEERTVCAoTlJGKSBSb290Q0ExITAfBgkq
+hkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQAD
+ggEPADCCAQoCggEBANmsm3f6UNPM3LlArLlyagCHI/wPliHQJq/k4rVf+tOmfSEw
+LswXgo+YdPxnpKbfiJeiQin1p9sRk/teIzDCqrwi50Eb5e0l3sg/295XRXhARoOy
+1Ro93w9FbdVjAnXYL8Zuq5WRdDcNy00JXNHUWzra3Q7Ia5nY1TnM34VVxJJTAqPh
+94DJcKPa3DPEf6JHCBw1lh+hAxwwg/TEzP+Yw7BGRKLAv63b0oH2TJgsp14k84bK
+Y9W6ffCawErQG1ju7Klnz2kCbCLAYCws0cgg6sgt+92cu8tRTNznVwQ7VJsRpTJ0
+7HQB85AVWy98LJNluWZntIGINeWekRh/gahByMsCAwEAATANBgkqhkiG9w0BAQUF
+AAOCAQEAhF4LO+ygjRyb0DwdcWnkGn9kvoFlYcWMatd8AHTgemJV7SR84GHj8t0U
+5hFugw7h6qmegK2aIL/gV37V0LWEYy3ZGOS9GzUsXq5hdqpnhTs44TGBHzF/5tf4
+W9K7Y3mGxIzF3gqu19H8AXT/trYNYoFnHLsm+CSA4Fxe2KSKOo99y/+So/18qTJp
+B1hYYUKZUgOxOD3GcW9s8uh9BqrBfFPLGi2IT8mpp6xpb/ekH9h0gfVKv7FVt9N3
+OKdvwkrI4nOJ01dy4UMvcjz2H7f4BEpuwemUF+SXF/QOE4ZvjavoXy20/2zWorQf
+7LmUaqoSTxrd9Xe1JYzyigrx/FJbWA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICaDCCAdGgAwIBAgIQCgEBAQAAAnwAAAADAAAAAjANBgkqhkiG9w0BAQUFADBA
+MSEwHwYDVQQKExhYY2VydCBJbnRlcm5hdGlvbmFsIEluYy4xGzAZBgNVBAsTElhj
+ZXJ0IFJvb3QgQ0EgMTAyNDAeFw0wMDA4MTgxODMxMzJaFw0yNTA4MTUxOTAwNTZa
+MEAxITAfBgNVBAoTGFhjZXJ0IEludGVybmF0aW9uYWwgSW5jLjEbMBkGA1UECxMS
+WGNlcnQgUm9vdCBDQSAxMDI0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDW
+vjeJEami90csKs9qACZlKESkiuTeoENVmURrvG64x87GY7bT6G/FmCskkbieorpx
+SN40ICF61tLFiTKlicbchYRU8p5I7cxEtgb/jsTOWa2fbOkiWME/FApDgIcZUlDj
+KAfIrBjisRqqo+Jgt3ZRByk5XkjpZnCBLjiavRl96wIDAQABo2MwYTAPBgNVHRMB
+Af8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBSEecdPB1mxa8E6
+Nbq49NWZJ8i6DjAdBgNVHQ4EFgQUhHnHTwdZsWvBOjW6uPTVmSfIug4wDQYJKoZI
+hvcNAQEFBQADgYEAc7DhAO2uaNJgA0br+RzxpaZ8XDJ87AJh0xwdczEsuo69SU3I
+3dl3dUHnkiGabCnbp2xwhqBcw+TzMswBhFnXiDk486ji4hqwl80rF9xkBA+qanOU
+1usIxoBpTd561cU38ZIXPG3TiiHMZBCq3mKHH4+4+Kp1SvQILPXcZs/DOH4=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMC
+VVMxFDASBgNVBAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBD
+ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9v
+dCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDAxMDExMTY0MTI4WhcNMjEwMTE0
+MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dlbGxzIEZhcmdvMSww
+KgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEvMC0G
+A1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEi
+MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n13
+5zHCLielTWi5MbqNQ1mXx3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHE
+SxP9cMIlrCL1dQu3U+SlK93OvRw6esP3E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4O
+JgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5OEL8pahbSCOz6+MlsoCu
+ltQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4jsNtlAHCE
+AQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMB
+AAGjYTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcB
+CzAyMDAGCCsGAQUFBwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRw
+b2xpY3kwDQYJKoZIhvcNAQEFBQADggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo
+7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrvm+0fazbuSCUlFLZWohDo7qd/
+0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0ROhPs7fpvcmR7
+nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx
+x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ
+33ZwmVxwQ023tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
+QTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
+QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E
+jG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo
+ePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI
+ULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu
+Ob7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg
+AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7
+HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA
+uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa
+TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg
+xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q
+CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x
+O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs
+6GAqm4VKQPNriiTsBhYscw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEuDCCA6CgAwIBAgIBBDANBgkqhkiG9w0BAQUFADCBtDELMAkGA1UEBhMCQlIx
+EzARBgNVBAoTCklDUC1CcmFzaWwxPTA7BgNVBAsTNEluc3RpdHV0byBOYWNpb25h
+bCBkZSBUZWNub2xvZ2lhIGRhIEluZm9ybWFjYW8gLSBJVEkxETAPBgNVBAcTCEJy
+YXNpbGlhMQswCQYDVQQIEwJERjExMC8GA1UEAxMoQXV0b3JpZGFkZSBDZXJ0aWZp
+Y2Fkb3JhIFJhaXogQnJhc2lsZWlyYTAeFw0wMTExMzAxMjU4MDBaFw0xMTExMzAy
+MzU5MDBaMIG0MQswCQYDVQQGEwJCUjETMBEGA1UEChMKSUNQLUJyYXNpbDE9MDsG
+A1UECxM0SW5zdGl0dXRvIE5hY2lvbmFsIGRlIFRlY25vbG9naWEgZGEgSW5mb3Jt
+YWNhbyAtIElUSTERMA8GA1UEBxMIQnJhc2lsaWExCzAJBgNVBAgTAkRGMTEwLwYD
+VQQDEyhBdXRvcmlkYWRlIENlcnRpZmljYWRvcmEgUmFpeiBCcmFzaWxlaXJhMIIB
+IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwPMudwX/hvm+Uh2b/lQAcHVA
+isamaLkWdkwP9/S/tOKIgRrL6Oy+ZIGlOUdd6uYtk9Ma/3pUpgcfNAj0vYm5gsyj
+Qo9emsc+x6m4VWwk9iqMZSCK5EQkAq/Ut4n7KuLE1+gdftwdIgxfUsPt4CyNrY50
+QV57KM2UT8x5rrmzEjr7TICGpSUAl2gVqe6xaii+bmYR1QrmWaBSAG59LrkrjrYt
+bRhFboUDe1DK+6T8s5L6k8c8okpbHpa9veMztDVC9sPJ60MWXh6anVKo1UcLcbUR
+yEeNvZneVRKAAU6ouwdjDvwlsaKydFKwed0ToQ47bmUKgcm+wV3eTRk36UOnTwID
+AQABo4HSMIHPME4GA1UdIARHMEUwQwYFYEwBAQAwOjA4BggrBgEFBQcCARYsaHR0
+cDovL2FjcmFpei5pY3BicmFzaWwuZ292LmJyL0RQQ2FjcmFpei5wZGYwPQYDVR0f
+BDYwNDAyoDCgLoYsaHR0cDovL2FjcmFpei5pY3BicmFzaWwuZ292LmJyL0xDUmFj
+cmFpei5jcmwwHQYDVR0OBBYEFIr68VeEERM1kEL6V0lUaQ2kxPA3MA8GA1UdEwEB
+/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAZA5c1
+U/hgIh6OcgLAfiJgFWpvmDZWqlV30/bHFpj8iBobJSm5uDpt7TirYh1Uxe3fQaGl
+YjJe+9zd+izPRbBqXPVQA34EXcwk4qpWuf1hHriWfdrx8AcqSqr6CuQFwSr75Fos
+SzlwDADa70mT7wZjAmQhnZx2xJ6wfWlT9VQfS//JYeIc7Fue2JNLd00UOSMMaiK/
+t79enKNHEA2fupH3vEigf5Eh4bVAN5VohrTm6MY53x7XQZZr1ME7a55lFEnSeT0u
+mlOAjR2mAbvSM5X5oSZNrmetdzyTj2flCM8CC7MLab0kkdngRIlUBGHF1/S5nmPb
+K+9A46sd33oqK8n8
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr
+MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl
+cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv
+bW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw
+CQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h
+dGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l
+cmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h
+2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E
+lpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV
+ZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq
+299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t
+vz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL
+dXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD
+AgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF
+AAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR
+zCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3
+LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd
+7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw
+++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt
+398znM/jra6O1I7mT1GvFpLgXPYHDw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDgDCCAmigAwIBAgICAx8wDQYJKoZIhvcNAQEFBQAwYTELMAkGA1UEBhMCVVMx
+DTALBgNVBAoTBFZJU0ExLzAtBgNVBAsTJlZpc2EgSW50ZXJuYXRpb25hbCBTZXJ2
+aWNlIEFzc29jaWF0aW9uMRIwEAYDVQQDEwlHUCBSb290IDMwHhcNMDAwODE2MjMz
+NDAwWhcNMjAwODE1MjM1OTAwWjBhMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklT
+QTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRp
+b24xEjAQBgNVBAMTCUdQIFJvb3QgMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
+AQoCggEBALrsQ7g06qNn33cJHxoQoh6pTpVMdOcM3GzGmNCr+hckmmejSRRkiY+T
+Ei/vj9jOEASLhcDcL7wpmK+cQsXL0pbP9KXFLW5NjDiOsmoImdWRG6jtM5NJXcvn
+FUNtUvHI6NfaMOCYKqlbo8PRAQOBXX62CZXo2zJu/TrDtZ6b/VkZILMjwOJq7kSW
+gO9oCUCUwrczSYPlya4tIDeQGD0gNtp5Oa+4V59672AqIYT4/6A5IdPYbVTHw2o8
+yFwfLkdyFGxVSwkGzY7FawvnB0c6fZJffQ+wXDNXg4M/HoSoeZCfl04i3HUiyG4v
+1tDLduEMV5fhJo8phFPy5Y6TykuKTDUCAwEAAaNCMEAwHQYDVR0OBBYEFKJcbg1l
+CMH3TlvJbfDQVhs5gkO7MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG
+MA0GCSqGSIb3DQEBBQUAA4IBAQADjVYIs6Gt/XNC2WcsbprPvx7ITfJN0tk3yThE
+ja6JDO+MmStKk/VtrGZKP1dqEKWiGhOmLOpi54D5vf3k/9oRnzlYbfVD8vT9pr+d
+sauaRgff4fBbP/5dWUAGrBgIR0w8TEhGzojhqLaedaag934btsSN7fAqUxVK2ylP
+OVPnUlijvtzkkC21yc6Y/yyGoQigyM73gjkJDMHC1KmkKg4zgcc8cMswbaRWt5tc
+fAIivuUHfW0k0Sex1h0eXEc8vy5u+ByESOz14aCVEc3nMOtc8Cl7dYICBrLzkznS
+DqzfXyQTFTBD9VDUx4OgQzlPZTS9punO4XS+IN/SchZLiUZ2
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDLTCCApagAwIBAgIBADANBgkqhkiG9w0BAQQFADCB0TELMAkGA1UEBhMCWkEx
+FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMRowGAYD
+VQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT
+ZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMbVGhhd3RlIFBlcnNvbmFsIEZyZWVt
+YWlsIENBMSswKQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVlbWFpbEB0aGF3dGUu
+Y29tMB4XDTk2MDEwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNVBAYT
+AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEa
+MBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsTH0NlcnRpZmljYXRp
+b24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25hbCBG
+cmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxAdGhh
+d3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1GnX1LCUZFtx6UfY
+DFG26nKRsIRefS0Nj3sS34UldSh0OkIsYyeflXtL734Zhx2G6qPduc6WZBrCFG5E
+rHzmj+hND3EfQDimAKOHePb5lIZererAXnbr2RSjXW56fAylS1V/Bhkpf56aJtVq
+uzgkCGqYx7Hao5iR/Xnb5VrEHLkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zAN
+BgkqhkiG9w0BAQQFAAOBgQDH7JJ+Tvj1lqVnYiqk8E0RYNBvjWBYYawmu1I1XAjP
+MPuoSpaKH2JCI4wXD/S6ZJwXrEcp352YXtJsYHFcoqzceePnbgBHH7UNKOgCneSa
+/RP0ptl8sfjcXyMmCZGAc9AUG95DqYMl8uacLxXK/qarigd1iwzdUYRr5PjRznei
+gQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARQxCzAJBgNVBAYTAkVT
+MRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UE
+ChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE
+ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0GA1UECxMm
+SVBTIENBIENMQVNFQTMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMT
+JklQUyBDQSBDTEFTRUEzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZI
+hvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwHhcNMDExMjI5MDEwNzUwWhcNMjUxMjI3
+MDEwNzUwWjCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ
+BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hp
+bmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5G
+LiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTMgQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUEzIENlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMw
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO6AAPYaZC6tasiDsYun7o/ZttvN
+G7uGBiJ2MwwSbUhWYdLcgiViL5/SaTBlA0IjWLxH3GvWdV0XPOH/8lhneaDBgbHU
+VqLyjRGZ/fZ98cfEXgIqmuJKtROKAP2Md4bm15T1IHUuDky/dMQ/gT6DtKM4Ninn
+6Cr1jIhBqoCm42zvAgMBAAGjggRTMIIETzAdBgNVHQ4EFgQUHp9XUEe2YZM50yz8
+2l09BXW3mQIwggFGBgNVHSMEggE9MIIBOYAUHp9XUEe2YZM50yz82l09BXW3mQKh
+ggEcpIIBGDCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ
+BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hp
+bmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5G
+LiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTMgQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUEzIENlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOC
+AQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUF
+BwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYB
+BAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglg
+hkgBhvhCAQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1Ud
+EgQTMBGBD2lwc0BtYWlsLmlwcy5lczBCBglghkgBhvhCAQ0ENRYzQ0xBU0VBMyBD
+QSBDZXJ0aWZpY2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3dy5pcHMuZXMvMCkGCWCG
+SAGG+EIBAgQcFhpodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyLzA7BglghkgBhvhC
+AQQELhYsaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0xBU0VBMy5j
+cmwwQAYJYIZIAYb4QgEDBDMWMWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmV2
+b2NhdGlvbkNMQVNFQTMuaHRtbD8wPQYJYIZIAYb4QgEHBDAWLmh0dHA6Ly93d3cu
+aXBzLmVzL2lwczIwMDIvcmVuZXdhbENMQVNFQTMuaHRtbD8wOwYJYIZIAYb4QgEI
+BC4WLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcG9saWN5Q0xBU0VBMy5odG1s
+MHUGA1UdHwRuMGwwMqAwoC6GLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvaXBz
+MjAwMkNMQVNFQTMuY3JsMDagNKAyhjBodHRwOi8vd3d3YmFjay5pcHMuZXMvaXBz
+MjAwMi9pcHMyMDAyQ0xBU0VBMy5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUF
+BzABhhNodHRwOi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAEo9IEca
+2on0eisxeewBwMwB9dbB/MjD81ACUZBYKp/nNQlbMAqBACVHr9QPDp5gJqiVp4MI
+3y2s6Q73nMify5NF8bpqxmdRSmlPa/59Cy9SKcJQrSRE7SOzSMtEQMEDlQwKeAYS
+AfWRMS1Jjbs/RU4s4OjNtckUFQzjB4ObJnXv
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ
+BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh
+c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy
+MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp
+emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X
+DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw
+FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg
+UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo
+YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5
+MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB
+AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4
+pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0
+13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID
+AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk
+U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i
+F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY
+oJ2daZH9
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc
+MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT
+ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw
+MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj
+dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l
+c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC
+UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc
+58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/
+o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH
+MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr
+aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA
+A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA
+Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
+8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP
+MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAx
+MDQwNjEwNDkxM1oXDTIxMDQwNjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNV
+BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMSBDQTCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H887dF+2rDNbS82rDTG
+29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9EJUk
+oVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk
+3w0LBUXl0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBL
+qdReLjVQCfOAl/QMF6452F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIIN
+nvmLVz5MxxftLItyM19yejhW1ebZrgUaHXVFsculJRwSVzb9IjcCAwEAAaMzMDEw
+DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZTiFIwCwYDVR0PBAQDAgEG
+MA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE928Jj2VuX
+ZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0H
+DjxVyhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VO
+TzF2nBBhjrZTOqMRvq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2Uv
+kVrCqIexVmiUefkl98HVrhq4uz2PqYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4w
+zMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9ZIRlXvVWa
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
+MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
+GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
+YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
+MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
+BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM
+GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua
+BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe
+3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4
+YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR
+rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm
+ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU
+oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
+MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
+QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
+b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
+AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
+GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
+Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
+G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
+l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
+smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
+A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
+cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
+MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
+BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
+YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
+BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
+I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
+CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
+lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
+AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB
+gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk
+MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY
+UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx
+NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3
+dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy
+dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB
+dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6
+38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP
+KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q
+DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4
+qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa
+JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi
+PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P
+BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs
+jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0
+eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD
+ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR
+vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt
+qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa
+IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy
+i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ
+O+7ETPTsJ3xCwnR8gooJybQDJbw=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDIzCCAoygAwIBAgIENeHvHjANBgkqhkiG9w0BAQUFADBPMQswCQYDVQQGEwJV
+UzEQMA4GA1UEChMHRXF1aWZheDEuMCwGA1UECxMlRXF1aWZheCBQcmVtaXVtIENl
+cnRpZmljYXRlIEF1dGhvcml0eTAeFw05ODA4MjQyMjU0MjNaFw0xODA4MjQyMjU0
+MjNaME8xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdFcXVpZmF4MS4wLAYDVQQLEyVF
+cXVpZmF4IFByZW1pdW0gQ2VydGlmaWNhdGUgQXV0aG9yaXR5MIGfMA0GCSqGSIb3
+DQEBAQUAA4GNADCBiQKBgQDOoQaOBswIC8GGqN4g1Q0O0Q3En+pq2bPCMkdAb4qI
+pAm9OCwd5svmpPM269rrvPxkswf2Lbyqzp8ZSGhK/PWiRX4JEPWPs0lcIwY56hOL
+uAvNkR12X9k3oUT7X5DyZ7PNGJlDH3YSawLylYM4Q8L2YjTKyXhdX9LYupr/vhBg
+WwIDAQABo4IBCjCCAQYwcQYDVR0fBGowaDBmoGSgYqRgMF4xCzAJBgNVBAYTAlVT
+MRAwDgYDVQQKEwdFcXVpZmF4MS4wLAYDVQQLEyVFcXVpZmF4IFByZW1pdW0gQ2Vy
+dGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIw
+MTgwODI0MjI1NDIzWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUFe6yKFmrbuX4
+z4uB9CThrj91G5gwHQYDVR0OBBYEFBXusihZq27l+M+LgfQk4a4/dRuYMAwGA1Ud
+EwQFMAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEB
+BQUAA4GBAL0LnCepA9so3JipS9DRjqeoGlqR4Jzx9xh8LiKeNh/JqLXNRkpu+jUH
+G4YI65/iqPmdQS06rlxctl80BOv8KmCw+3TkhellOJbuFcfGd2MSvYpoH6tsfdrK
+XBPO6snrCVzFc+cSAdXZUwee4A+W8Iu0u0VIn4bFGVWgy5bFA/xI
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDgDCCAmigAwIBAgICAx4wDQYJKoZIhvcNAQEFBQAwYTELMAkGA1UEBhMCVVMx
+DTALBgNVBAoTBFZJU0ExLzAtBgNVBAsTJlZpc2EgSW50ZXJuYXRpb25hbCBTZXJ2
+aWNlIEFzc29jaWF0aW9uMRIwEAYDVQQDEwlHUCBSb290IDIwHhcNMDAwODE2MjI1
+MTAwWhcNMjAwODE1MjM1OTAwWjBhMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklT
+QTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRp
+b24xEjAQBgNVBAMTCUdQIFJvb3QgMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
+AQoCggEBAKkBcLWqxEDwq2omYXkZAPy/mzdZDK9vZBv42pWUJGkzEXDK41Z0ohdX
+ZFwgBuHW73G3O/erwWnQSaSxBNf0V2KJXLB1LRckaeNCYOTudNargFbYiCjh+20i
+/SN8RnNPflRzHqgsVVh1t0zzWkWlAhr62p3DRcMiXvOL8WAp0sdftAw6UYPvMPjU
+58fy+pmjIlC++QU3o63tmsPm7IgbthknGziLgE3sucfFicv8GjLtI/C1AVj59o/g
+halMCXI5Etuz9c9OYmTaxhkVOmMd6RdVoUwiPDQyRvhlV7or7zaMavrZ2UT0qt2E
+1w0cslSsMoW0ZA3eQbuxNMYBhjJk1Z8CAwEAAaNCMEAwHQYDVR0OBBYEFJ59SzS/
+ca3CBfYDdYDOqU8axCRMMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG
+MA0GCSqGSIb3DQEBBQUAA4IBAQAhpXYUVfmtJ3CPPPTVbMjMCqujmAuKBiPFyWHb
+mQdpNSYx/scuhMKZYdQN6X0uEyt8joW2hcdLzzW2LEc9zikv2G+fiRxkk78IvXbQ
+kIqUs38oW26sTTMs7WXcFsziza6kPWKSBpUmv9+55CCmc2rBvveURNZNbyoLaxhN
+dBA2aGpawWqn3TYpjLgwi08hPwAuVDAHOrqK5MOeyti12HvOdUVmB/RtLdh6yumJ
+ivIj2C/LbgA2T/vwLwHMD8AiZfSr4k5hLQOCfZEWtTDVFN5ex5D8ofyrEK9ca3Cn
+B+8phuiyJccg/ybdd+95RBTEvd07xQObdyPsoOy7Wjm1zK0G
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
+MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
+YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG
+EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg
+R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9
+9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq
+fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv
+iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU
+1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+
+bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW
+MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA
+ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l
+uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn
+Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS
+tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF
+PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
+hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
+5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL
+MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV
+BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0
+Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1
+OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i
+SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UEAxMc
+VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD
+ggEPADCCAQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJW
+Ht4bNwcwIi9v8Qbxq63WyKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+Q
+Vl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo6SI7dYnWRBpl8huXJh0obazovVkdKyT2
+1oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZuV3bOx4a+9P/FRQI2Alq
+ukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk2ZyqBwi1
+Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1Ud
+EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NX
+XAek0CSnwPIA1DCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy
+dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6
+Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz
+JTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290
+Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u
+TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlN
+irTzwppVMXzEO2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8
+TtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6
+g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB
+95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj
+S+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
+GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv
+b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV
+BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W
+YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa
+GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg
+Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J
+WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB
+rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp
++ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1
+ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i
+Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz
+PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og
+/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH
+oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI
+yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud
+EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2
+A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL
+MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT
+ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f
+BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn
+g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl
+fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K
+WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha
+B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc
+hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR
+TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD
+mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z
+ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y
+4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza
+8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
+CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9CYW5rRW5n
+aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
+aW9uMRMwEQYDVQQDEwpiYW5rZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBiYW5r
+ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
+CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
+BAoTD0JhbmtFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
+b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCmJhbmtlbmdpbmUxIDAeBgkqhkiG9w0B
+CQEWEWNhQGJhbmtlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEA14LoTUAl1/hEy+Kh1kLHiBdW2zD3V4IhM7xxTVKsYsIH56nr69ATTIxU
+P36eRzeZ137qt1AxHFjDCidk3m1Ul6l59ProPexdslLLM2npM3f2cteg+toyiYiS
+EJKjyzIu1xF1j9qzGkymSY/4DsXLZNk9FaczxMk/Ooc6Os1M3AverL4VG4rYIb6f
+eR32cIKJ9Q1fGuyKk7ipq1XQfPW8a8TgZdbHbe7U9Gk3iasGMHHvpR9Ep3mGbgdT
+uQ98SBEuIwe1BUCGg/MXpVy48MNXfAMotBgGw4pl9yqSjMni2FB+E9Q9DHFs2RgX
+MqzKuo8zcPxKx2kZ6Arj8+27dw2clQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0G
+CSqGSIb3DQEBBQUAA4IBAQBauupHX9EhpC/r57d6b5kkeWvognxIP9//TO4iw3qb
+zIXEkPXmJmwVzlzoKJWqiya+aw19SP0+G6CzsFOBo/9ehmz+hZ8bhYX4MjlWzX5u
+Tnkhz172j9fOBUmrTVPkcRIs6zjCD5PQAGoBPP1/Zdy2N36lZ0U7lg07Opirj/yJ
+PSJeM2j0fwIFAroiVckvdT0BVwB6S/cPaAQGPghbbr1YGSmYrMriSv825ILJUfxz
+rJYunGR9FiY9Ob7+jwJwiZMS4CxSPktutxr/3hOvr1+ALS7IcVakhhA3PuZAJbdH
+FRclR9qMM8aBnBZmf+Uv3K3uhT+UBzzY654U9Yi1JYnA
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
+IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
+BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
+aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
+9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy
+NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
+azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
+YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
+Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
+cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD
+cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs
+2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY
+JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE
+Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ
+n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A
+PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw
+CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl
+cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu
+LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT
+aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
+dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD
+VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT
+aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ
+bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu
+IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
+LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b
+N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t
+KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu
+kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm
+CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ
+Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu
+imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te
+2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe
+DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
+/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p
+F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt
+TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDbjCCAtegAwIBAgICJxEwDQYJKoZIhvcNAQEFBQAwZjELMAkGA1UEBhMCVVMx
+JTAjBgNVBAoTHFVuaXRlZCBTdGF0ZXMgUG9zdGFsIFNlcnZpY2UxGTAXBgNVBAsT
+EHd3dy51c3BzLmNvbS9DUFMxFTATBgNVBAMTDFVTUFMgUm9vdCBDQTAeFw0wMDA4
+MTUxOTM1NThaFw0yMDA4MTUxOTM1NThaMGYxCzAJBgNVBAYTAlVTMSUwIwYDVQQK
+ExxVbml0ZWQgU3RhdGVzIFBvc3RhbCBTZXJ2aWNlMRkwFwYDVQQLExB3d3cudXNw
+cy5jb20vQ1BTMRUwEwYDVQQDEwxVU1BTIFJvb3QgQ0EwgZ8wDQYJKoZIhvcNAQEB
+BQADgY0AMIGJAoGBALepJaxj2rCSz5Q2sAT/Fm52BFv1xjyfxrlCJlX7k3GFEWXJ
+YSeIxF6b/ip4SlJqRZ+o+5G04yZd9UMUJrnePG0sZvVTfd7kVleyonn14bTaavck
+5bMo/p53luIOxwUDzOlR9pb8EcCWLXM1/1hzX/JINeVES9B+1QAehG3YJdjRAgMB
+AAGjggEpMIIBJTAkBglghkiG+W1kAgYEFzAVoAMCAQGhAwIBAqIDAgEBowQCAicR
+MCQGCWCGSIb5bWQCBwQXMBWgAwIBAaEDAgECogMCAQGjBAICJxEwEAYJYIZIhvlt
+ZAIBBAMKAQEwEAYJYIZIhvltZAIDBAMKAQYwUwYJYIZIhvltZAIEBEYwRKA0GjJD
+QSBNQVNURVIgUlNBIDEwMjQgQmVyIChTRUxGIFNJR04pIChDaHJ5c0FsaXMgQ1NQ
+KaEMMAqhAwoBAKIDAwEAMB0GA1UdDgQWBBTTzoJ08y9LiWBypF4Rv191A6ICqzAd
+BgNVHREEFjAUgRJyb290MTAwMDFAdXNwcy5jb20wDwYDVR0PAQH/BAUDAwfGADAP
+BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAI7SbReJ5I5NalEKF2AR
+ay289lC8DMpJqaw7qotxs9HL9hx+IkIh6av2EiAybbIYKhFpcdjKWUqYrTKYo5hj
+UW0jIfJRrqB3giO7nciBgas7CFr6y02kLHfLYKik//iMkFQtsLSDSguwPOvsY5vl
+lP4Fo94aBCf2/0+o6iQIKyWa
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID+DCCAuACEQDQHkCLAAACfAAAAAcAAAABMA0GCSqGSIb3DQEBBQUAMIG5MQsw
+CQYDVQQGEwJ1czENMAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENp
+dHkxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEeMBwGA1UE
+CxMVVW5pdGVkIFBhcmNlbCBTZXJ2aWNlMRkwFwYDVQQDExBEU1QgKFVQUykgUm9v
+dENBMSEwHwYJKoZIhvcNAQkBFhJjYUBkaWdzaWd0cnVzdC5jb20wHhcNOTgxMjEw
+MDAyNTQ2WhcNMDgxMjA3MDAyNTQ2WjCBuTELMAkGA1UEBhMCdXMxDTALBgNVBAgT
+BFV0YWgxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MSQwIgYDVQQKExtEaWdpdGFs
+IFNpZ25hdHVyZSBUcnVzdCBDby4xHjAcBgNVBAsTFVVuaXRlZCBQYXJjZWwgU2Vy
+dmljZTEZMBcGA1UEAxMQRFNUIChVUFMpIFJvb3RDQTEhMB8GCSqGSIb3DQEJARYS
+Y2FAZGlnc2lndHJ1c3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
+AQEA7xfsrynm2SsnwNt7JJ9m9ASjwq0KyrDNhCuqN/OAoWDvQo/lXXdfV0JU3Svb
+YbJxXpN7b1/rJCvnpPLr8XOzC431Wdcy36yQjk4xuiVNtgym8eWvDOHlb1IDFcHf
+vn5KpqYYRnA/76dNqNz1dNlhekA8oZQo6sKUiMs3FQUZPJViuhwt+yiM0ciekjxb
+EVQ7eNlHO5stSuY+e2vf9PYFzyj2upg2AJ48N4UKnN63pIXFY/23YhRtFx7MioCF
+QjIRsCHinXfJgBZBnuvlFIl/t8O8T8Gfh5uW7GP2+ZBWDpWjIwqMZNqbuxx3sExd
+5sjo9X15LVckP8zjPSyYzxKfFwIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQC7OI4E
+IiZYDiFEVsy9WXwpaMtcD8iGVD+BeKetj8xG9xxUuHktW3IFaugh0OwdHf6kNFG+
+7u3OzJwWaOJddXMIQzGRahArEMJLafjJrZio/bjv9qvwXyHvy4VrCe0vSGa1YHLA
+6KDHmNsO9xtzjTQICnvFd2KqMCObsB6LgJhU3AWHs6liWfyLtxWarETszzUa9w8u
+XZJLAch77qA37eQdgg2ZQUMXrdTVyuP5fReiAdAwD0C53LkEgmmDtvkP+gaS96j0
+1hcc8F5/xCnI5uHi/zZoIVGu/6m6hJKtinsz2JDSwXltMzM5dKwbOHGfLAeQ6h3g
+04lfy+8UjSdUpb1G
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICezCCAeSgAwIBAgICAyEwDQYJKoZIhvcNAQEFBQAwYTELMAkGA1UEBhMCVVMx
+DTALBgNVBAoTBFZJU0ExLzAtBgNVBAsTJlZpc2EgSW50ZXJuYXRpb25hbCBTZXJ2
+aWNlIEFzc29jaWF0aW9uMRIwEAYDVQQDEwlHUCBSb290IDUwHhcNMDAwODE3MDAy
+ODAwWhcNMjAwODE2MjM1OTAwWjBhMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklT
+QTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRp
+b24xEjAQBgNVBAMTCUdQIFJvb3QgNTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
+gYEArQBu8qB8MREcQbA3j4OiQ8uXXwIgiQ1uvCqx8aVk79iOStZynZ5uH5qo+YUD
+rMEnaoTlZkhxml5CD4rin/aADyOsU8PBnwLE+FhG6vSpgq9tB0aG8S38BrgeVdU5
+YZKEi/HYijNOPBO11nH8az60HHoLh9U1ZjTDczJjWN8SayMCAwEAAaNCMEAwHQYD
+VR0OBBYEFCNO8wIEBNfSpwBWwc5JLIwVljMvMA8GA1UdEwEB/wQFMAMBAf8wDgYD
+VR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4GBADyUAYfyyM/hj665C+IcffEZ
+rdHt9gFbNlMKgD6uNFZncG5DVE55zYvVUBky2Ek4NP22c0nrDkl6vxr36gcoJbsV
+SRxRSlWaOC8tD1j5edECZROMWZ8Qf10XPHTytep3gTaGbzJbBbQNoyZn8OQ1Dke9
+a8GRnQv0P5oRfJQWZ7aY
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
+MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
+d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
+ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
+MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
+LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
+RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
+PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
+xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
+Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
+hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
+EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
+MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
+FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
+nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
+eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
+hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
+Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
+vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
++OkuE6N36B9K
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUx
+ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0
+b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQD
+EzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVneXpvaSAoQ2xhc3MgUUEpIFRhbnVz
+aXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0bG9jay5odTAeFw0w
+MzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTERMA8G
+A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh
+Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5l
+dExvY2sgTWlub3NpdGV0dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZh
+bnlraWFkbzEeMBwGCSqGSIb3DQEJARYPaW5mb0BuZXRsb2NrLmh1MIIBIjANBgkq
+hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRVCacbvWy5FPSKAtt2/Goq
+eKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e8ia6AFQe
+r7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO5
+3Lhbm+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWd
+vLrqOU+L73Sa58XQ0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0l
+mT+1fMptsK6ZmfoIYOcZwvK9UdPM0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4IC
+wDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8EBAMCAQYwggJ1Bglg
+hkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2YW55IGEgTmV0
+TG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh
+biBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQg
+ZWxla3Ryb25pa3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywg
+dmFsYW1pbnQgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6
+b2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwgYXogQWx0YWxhbm9zIFN6ZXJ6b2Rl
+c2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kgZWxqYXJhcyBtZWd0
+ZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczovL3d3
+dy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0Bu
+ZXRsb2NrLm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBh
+bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRo
+ZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMgYXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3
+Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0IGluZm9AbmV0bG9jay5u
+ZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3DQEBBQUA
+A4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQ
+MznNwNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+
+NFAwLvt/MpqNPfMgW/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCR
+VCHnpgu0mfVRQdzNo0ci2ccBgcTcR08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY
+83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR5qq5aKrN9p2QdRLqOBrKROi3
+macqaJVmlaut74nLYKkGEsaUR+ko
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID6TCCAtGgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UEBhMCQ0Ex
+CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRowGAYDVQQKExFUcmFkZXJF
+bmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRGl2
+aXNpb24xFTATBgNVBAMTDHRyYWRlcmVuZ2luZTEiMCAGCSqGSIb3DQEJARYTY2FA
+dHJhZGVyZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBa
+MIGuMQswCQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8x
+GjAYBgNVBAoTEVRyYWRlckVuZ2luZSBJbmMuMSkwJwYDVQQLEyBDZXJ0aWZpY2F0
+aW9uIEF1dGhvcml0eSBEaXZpc2lvbjEVMBMGA1UEAxMMdHJhZGVyZW5naW5lMSIw
+IAYJKoZIhvcNAQkBFhNjYUB0cmFkZXJlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEAzyX5QE+5SN+zgNn1v3zp9HmP4hQOWW8WuEVItZVP
+9bt/xj5NeJd1kyPL/SqnF2qHcL3o/74r0Ga55aKHniwKYgQTlp5ELGfQ568QQeN9
+xNIHtUXeStI9zCNZyZC+4YqObdMR/ivKA/WsLfUVMl2lV5JzJJz1BOE0gKEYiEyz
+gIq5oLzkP/mOXoHRvWSZD2D0eHYIO7ovV2epVFK7g7p+dC4QoeIUEli+GF/Myg88
+dV/qmi+Sybck2RLPXa8Nh27/ETVQ7kE1Eafmx7EyCqIhG+5lwJAy3HwHUBwAYuzj
+iuZz5lD8aQmr8SKuvy3eOH9SVN5wh3YBlrNGwTStkESVLwIDAQABoxAwDjAMBgNV
+HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAWOPAUhZd3x9EQiFJcuxFTMd9q
+axgcriCzJsM6D96sYGko9xTeLhX/lr1bliVYI5AlupoLXAdMzGHJkOgaTirKjQXr
+F9nymDdUWKe3TmwGob5016nQlH7qRKvGO3hka0rOGRK2U/2JT/4Qp8iH/DFi6cyM
+uP0q8n64SAkxZXLzUuFQXqf7U/SNjzb9XJQEIAdjp7eYd3Qb4jDsDcX0FrKMF1aV
+r0dCDnS7am7WTXPYCDGdSkPgEHEtLYIYH3lZp5sKdVZ9wl4F0WNFkRWRUr7AXPjw
+50uLmUNmKCd8JZLMGA1TRNSTi7U9EcrWt0OkMWm74T2WVnAgNsDv2WrWsGfj
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6
+MRkwFwYDVQQKExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJp
+dHkgMjA0OCBWMzAeFw0wMTAyMjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAX
+BgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAbBgNVBAsTFFJTQSBTZWN1cml0eSAy
+MDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt49VcdKA3Xtp
+eafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7Jylg
+/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGl
+wSMiuLgbWhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnh
+AMFRD0xS+ARaqn1y07iHKrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2
+PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpu
+AWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
+BjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4EFgQUB8NR
+MKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYc
+HnmYv/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/
+Zb5gEydxiKRz44Rj0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+
+f00/FGj1EVDVwfSQpQgdMWD/YIwjVAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVO
+rSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395nzIlQnQFgCi/vcEkllgVsRch
+6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kApKnXwiJPZ9d3
+7CAFYd4=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOc
+UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx
+c8SxMQswCQYDVQQGDAJUUjEPMA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykg
+MjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8
+dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMxMDI3MTdaFw0xNTAz
+MjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2Vy
+dGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYD
+VQQHDAZBTktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kg
+xLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEu
+xZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7
+XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GXyGl8hMW0kWxsE2qkVa2k
+heiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8iSi9BB35J
+YbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5C
+urKZ8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1
+JuTm5Rh8i27fbMx4W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51
+b0dewQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV
+9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46sWrv7/hg0Uw2ZkUd82YCdAR7
+kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxEq8Sn5RTOPEFh
+fEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy
+B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdA
+aLX/7KfS0zgYnNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKS
+RGQDJereW26fyfJOrN3H
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDETCCAfmgAwIBAgIBADANBgkqhkiG9w0BAQQFADApMQswCQYDVQQGEwJhdTEa
+MBgGA1UEChMRU2VjdXJlTmV0IENBIFJvb3QwJhcROTkwNjMwMDAwMDAwKzEwMDAX
+ETEwMTAxNTIzNTkwMCsxMDAwMCkxCzAJBgNVBAYTAmF1MRowGAYDVQQKExFTZWN1
+cmVOZXQgQ0EgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKco
+tNg89b96BpG9pUJMs3yeiGaZxdsX1EVUw3vA8CRWZpi/ROB5E3Zort2adM+i6Zfm
+wcCpw/cs1TY7c52vgtrcDl9Tr+tuUNeo8KqOq2PSm3X+VQp80bPAWZNRKodpihnt
+5NfXjhSrtRlYs85s4E2C0wOEwasAGHpJqBV9CMkBYCeU6PsJYJ7RP07NE6N4/WX3
+EV/2mwAwjCLtKIllG9MfYXvDI6PjxoD5g/P3ut6GeF/2lcOMakgiZYXTInn2/UQW
+6A9hBDYqdcbb4mUUJ2LcglyWEjMOTBjV9jydsc1hHLGF+QPRuvZM1u6ffdGSIfD2
+ChakNIf3Vo+TvpevUqcCAwEAAaM8MDowCwYDVR0PBAQDAgHEMAwGA1UdEwQFMAMB
+Af8wHQYDVR0OBBYEFPjNzO5Zx9l6SQKcbWNh7+dtGe0HMA0GCSqGSIb3DQEBBAUA
+A4IBAQCDld3QdwdCZqXldjxNjr2xNO+kYt3LGyaiOl9QmEe7VvrFOYZt2yPntFEK
+4RBaPUDkohrrF4MiOCXm5u0+q4WNg4SQS104Jf32nmNuOUjKbVOXoB3SEVuPx5z0
+B+s7QkHtkQp+9H0wkE4f/cU2bMtLT0M29yfJxO2x6PwOepUR5w4xzKYfQrcUaYyj
+mg5Myzqtl4weqt2iUpdUB9E+yALbM8wHv3rxXoAr9r3vcAyJeMl7gNfZ8W0Rk53q
+jZcC9l4DLXLcOplp/L5JeS5R5dcxD44BBIeEksmmYlIZhueGmrLLYu22xCln/RMU
+PDCBC5nFDqG+sBr7jVC6+MemssBp
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID5TCCA06gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBrjELMAkGA1UEBhMCVVMx
+ETAPBgNVBAgTCElsbGlub2lzMRAwDgYDVQQHEwdEZSBLYWxiMSUwIwYDVQQKExxO
+b3J0aGVybiBJbGxpbm9pcyBVbml2ZXJzaXR5MRkwFwYDVQQLExBDb21wdXRlciBT
+Y2llbmNlMRUwEwYDVQQDEwxOZWlsIFJpY2tlcnQxITAfBgkqhkiG9w0BCQEWEnJp
+Y2tlcnRAY3Mubml1LmVkdTAeFw0wMDA1MTIwMDQwNTBaFw0xMDA1MjAwMDQwNTBa
+MIGuMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0Rl
+IEthbGIxJTAjBgNVBAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAX
+BgNVBAsTEENvbXB1dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEh
+MB8GCSqGSIb3DQEJARYScmlja2VydEBjcy5uaXUuZWR1MIGfMA0GCSqGSIb3DQEB
+AQUAA4GNADCBiQKBgQCxG0kG7z9E4JOtjKf3IXyHy9o19kui/YqgB1vMapuJM/wk
+9bEkWVolUP0W19S8xwQd35CbXsOo6Yt9o12a6X/lK+oVp626WCYKEUlP2ppnf7Cm
+ZvQntmFOPMg+oC9qtA4V1jn4kmCF36Y08/qkpeRHSeeHpKVcjmovE3ZfKfNkcwID
+AQABo4IBDzCCAQswHQYDVR0OBBYEFLYxeLt+qk2hXf2iJBjGkFotLxlIMIHbBgNV
+HSMEgdMwgdCAFLYxeLt+qk2hXf2iJBjGkFotLxlIoYG0pIGxMIGuMQswCQYDVQQG
+EwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0RlIEthbGIxJTAjBgNV
+BAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAXBgNVBAsTEENvbXB1
+dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEhMB8GCSqGSIb3DQEJ
+ARYScmlja2VydEBjcy5uaXUuZWR1ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN
+AQEEBQADgYEAYGkjZZdRXAakQssA55rcOXDD012/D+AEVE3Z3BJXEmxn/VuwOWPq
+xBJlUbs98fcltM0L9lt6YSWtBgoBVdxxBSkNc+kwUb7T4bKJ/A8o9wZ1lhs0deAH
+5TuzCygk5XnqVTnn0u7sY7Tkxu7LFdDI6ztPNhCkasBrA+gpcsenEAA=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIH6jCCB1OgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARIxCzAJBgNVBAYTAkVT
+MRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UE
+ChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE
+ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEuMCwGA1UECxMl
+SVBTIENBIENMQVNFMyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMl
+SVBTIENBIENMQVNFMyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqGSIb3
+DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAxMDE0NFoXDTI1MTIyNzAx
+MDE0NFowggESMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYD
+VQQHEwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5n
+IFNlcnZpY2VzIHMubC4xKzApBgNVBAoUImlwc0BtYWlsLmlwcy5lcyBDLkkuRi4g
+IEItNjA5Mjk0NTIxLjAsBgNVBAsTJUlQUyBDQSBDTEFTRTMgQ2VydGlmaWNhdGlv
+biBBdXRob3JpdHkxLjAsBgNVBAMTJUlQUyBDQSBDTEFTRTMgQ2VydGlmaWNhdGlv
+biBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqxf+DrDGaBtT8FK+n/ra+osTBLsBjzLZ
+H49NzjaY2uQARIwo2BNEKqRrThckQpzTiKRBgtYj+4vJhuW5qYIF3PHeH+AMmVWY
+8jjsbJ0gA8DvqqPGZARRLXgNo9KoOtYkTOmWehisEyMiG3zoMRGzXwmqMHBxRiVr
+SXGAK5UBsh8CAwEAAaOCBEowggRGMB0GA1UdDgQWBBS4k/8uy9wsjqLnev42USGj
+mFsMNDCCAUQGA1UdIwSCATswggE3gBS4k/8uy9wsjqLnev42USGjmFsMNKGCARqk
+ggEWMIIBEjELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UE
+BxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBT
+ZXJ2aWNlcyBzLmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBC
+LTYwOTI5NDUyMS4wLAYDVQQLEyVJUFMgQ0EgQ0xBU0UzIENlcnRpZmljYXRpb24g
+QXV0aG9yaXR5MS4wLAYDVQQDEyVJUFMgQ0EgQ0xBU0UzIENlcnRpZmljYXRpb24g
+QXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYD
+VR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggr
+BgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIB
+FQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhC
+AQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGB
+D2lwc0BtYWlsLmlwcy5lczBBBglghkgBhvhCAQ0ENBYyQ0xBU0UzIENBIENlcnRp
+ZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5lcy8wKQYJYIZIAYb4QgEC
+BBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMDoGCWCGSAGG+EIBBAQtFito
+dHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTMuY3JsMD8GCWCG
+SAGG+EIBAwQyFjBodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25D
+TEFTRTMuaHRtbD8wPAYJYIZIAYb4QgEHBC8WLWh0dHA6Ly93d3cuaXBzLmVzL2lw
+czIwMDIvcmVuZXdhbENMQVNFMy5odG1sPzA6BglghkgBhvhCAQgELRYraHR0cDov
+L3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lDTEFTRTMuaHRtbDBzBgNVHR8EbDBq
+MDGgL6AthitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTMu
+Y3JsMDWgM6Axhi9odHRwOi8vd3d3YmFjay5pcHMuZXMvaXBzMjAwMi9pcHMyMDAy
+Q0xBU0UzLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9v
+Y3NwLmlwcy5lcy8wDQYJKoZIhvcNAQEFBQADgYEAF2VcmZVDAyevJuXr0LMXI/dD
+qsfwfewPxqmurpYPdikc4gYtfibFPPqhwYHOU7BC0ZdXGhd+pFFhxu7pXu8Fuuu9
+D6eSb9ijBmgpjnn1/7/5p6/ksc7C0YBCJwUENPjDfxZ4IwwHJPJGR607VNCv1TGy
+r33I6unUVtkOE7LFRVA=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW
+MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy
+c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD
+VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1
+c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC
+AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81
+WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG
+FF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq
+XbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL
+se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb
+KNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd
+IgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73
+y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt
+hAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc
+QIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4
+Lt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV
+HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV
+HSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ
+KoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z
+dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ
+L1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr
+Fg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo
+ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY
+T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz
+GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m
+1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV
+OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH
+6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX
+QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIF3TCCA8WgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
+CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9Gb3J0RW5n
+aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
+aW9uMRMwEQYDVQQDEwpmb3J0ZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBmb3J0
+ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
+CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
+BAoTD0ZvcnRFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
+b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCmZvcnRlbmdpbmUxIDAeBgkqhkiG9w0B
+CQEWEWNhQGZvcnRlbmdpbmUuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
+CgKCAgEAyr7GbpwDxx1v3EYbo0gcO+ligEhlDqG2e7u/AbWGoVAqc8+q6auUJUtz
+4i7oh0yNadu1o9kpXW+znkgO0zlrgjGskqqMO1ooppzTJdFy/P8gR6x1Iuv3kWtX
+OuzwPPEjv09LWlhyJsN+oU4ztTVf07I0Q9zYupcoDQ58XKRheI9KdDB2DYSmxywA
+WSLQwIeG0Qa7gvokeQlpkgkEC7viEecJ3752KXBJHnh7As51mxnlpmG6sDy67Eli
+HDw5tHETRqbtnscGBjskGQBqR5xt7+QnnthZrN8HJHDoa9zgGephwizhkL44lXLF
+YK9W5XhFbblw2c+mAcHkokRiwD7CPeIoyD2a/Jcw3n5hegKTlNhd4BFGVF6JR7gF
+OFk2QfHXit5uthsij9Xhl7WAgQUqLgggD9MphqPf4nY66OZUJV9ZsmB+Qfp8UizB
+0WAOegactKVyRqHtRa+KIEXQXNtZgjcmMk9CYkP0nIbKtgKXaH6+9VMHNOryCnFE
+7pSsuPUkypncFWCHGSeiFO3w4w4J4csltxBADQzxfRu5KZnlToQN7bVpI/Q31tVX
+E5bjrJcq6Oj/OTqZ3ID+OqbkUdAg0ggjRKcTgxnLHd/AbMzJ6PsclDDf7cLs0WSl
+xMxQR/z5bNST1rNtT9rsiv2TOhfvCBxO9AOjBioO8PLO032HTNECAwEAAaMQMA4w
+DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAgEAVyBpPWfT2VOyvVpslGKx
+8h0+CWP8cilygGRtZJ5dAJzc//1REAHdvK+TgZ4Foz3dqHhXI+RNN0FpzuWaYMjW
+ZTS0kAmcOQuGY1Oo4PGlPHI21pNz29oFDTJr0ZmLBJ4JKVsE2soJg55jdk9MZHA7
+K//7HH9RsmrWZOE5DZDlrxp6+naixhMwnlPKKisIy9GNZUPqGdUWABMdB/BUVVNl
+NU5TtWpIXUClMd8a+eoKcItBeYXowkHOBpinPkDX3clFDIUfWiw0Ro08s8SrrFqR
+8Szwbrj52Xv1RM56oGqCjnkvJctxihODV7NcpxoAFjIZokDom0q6zPrrTUsLFQov
+Plovc3w5hmALiDMshaTvE1nm3Psn4yQ+FlRE8epTZrQiIGypZkZC6lcz0mYawueW
+cThYWGFhVG4ktQzOjjNRsNxopW+W7cF1zQTxiWUDnxIKSj7gtdQ2jiubxEEhfVag
+r8DMtAccNVTZVURpGi56TptOOuotrTqqC+2GviW4hlxvdvmuQN0OlXlUwzz2Trxc
+FamNnuA54lZw/8arLtxsFmHrcnPw53+1spumLD0S5UkxHNu40h6LIVpZz3H+0rLz
+uFofTfiyMjcfK2AyHQTgUCbsrvgNuLDQUbyFGVchdFUkhztX3DhEVnxnnrpY4BVj
+QdTqWIvw7lGlSuDCjxEQAOc=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID+DCCAuCgAwIBAgIRANAeQJAAACdLAAAAAQAAAAQwDQYJKoZIhvcNAQEFBQAw
+gYwxCzAJBgNVBAYTAlVTMQ0wCwYDVQQIEwRVdGFoMRcwFQYDVQQHEw5TYWx0IExh
+a2UgQ2l0eTEYMBYGA1UEChMPWGNlcnQgRVogYnkgRFNUMRgwFgYDVQQDEw9YY2Vy
+dCBFWiBieSBEU1QxITAfBgkqhkiG9w0BCQEWEmNhQGRpZ3NpZ3RydXN0LmNvbTAe
+Fw05OTA3MTQxNjE0MThaFw0wOTA3MTExNjE0MThaMIGMMQswCQYDVQQGEwJVUzEN
+MAsGA1UECBMEVXRhaDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxGDAWBgNVBAoT
+D1hjZXJ0IEVaIGJ5IERTVDEYMBYGA1UEAxMPWGNlcnQgRVogYnkgRFNUMSEwHwYJ
+KoZIhvcNAQkBFhJjYUBkaWdzaWd0cnVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQCtVBjetL/3reh0qu2LfI/C1HUa1YS5tmL8ie/kl2GS+x24
+4VpHNJ6eBiL70+o4y7iLB/caoBd3B1owHNQpOCDXJ0DYUJNDv9IYoil2BXKqa7Zp
+mKt5Hhxl9WqL/MUWqqJy2mDtTm4ZJXoKHTDjUJtCPETrobAgHtsCfv49H7/QAIrb
+QHamGKUVp1e2UsIBF5h3j4qBxhq0airmr6nWAKzP2BVJfNsbof6B+of505DBAsD5
+0ELpkWglX8a/hznplQBgKL+DLMDnXrbXNhbnYId26OcnsiUNi3rlqh3lWc3OCw5v
+xsic4xDZhTnTt5v6xrp8dNJddVardKSiUb9SfO5xAgMBAAGjUzBRMA8GA1UdEwEB
+/wQFMAMBAf8wHwYDVR0jBBgwFoAUCCBsZuuBCmxc1bWmPEHdHJaRJ3cwHQYDVR0O
+BBYEFAggbGbrgQpsXNW1pjxB3RyWkSd3MA0GCSqGSIb3DQEBBQUAA4IBAQBah1iP
+Lat2IWtUDNnxQfZOzSue4x+boy1/2St9WMhnpCn16ezVvZY/o3P4xFs2fNBjLDQ5
+m0i4PW/2FMWeY+anNG7T6DOzxzwYbiOuQ5KZP5jFaTDxNjutuTCC1rZZFpYCCykS
+YbQRifcML5SQhZgonFNsfmPdc/QZ/0qB0bJSI/08SjTOWhvgUIrtT4GV2GDn5MQN
+u1g+WPdOaG8+Z8nLepcWJ+xCYRR2uwDF6wg9FX9LtiJdhzuQ9PPA/jez6dliDMDD
+Wa9gvR8N26E0HzDEPYutsB0Ek+1f1eS/IDAE9EjpMwHRLpAnUrOb3jocq6mXf5vr
+wo3CbezcE9NGxXl8
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDXDCCAsWgAwIBAgICA+kwDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRF
+MRAwDgYDVQQIEwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFU
+QyBUcnVzdENlbnRlciBmb3IgU2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJI
+MSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBDbGFzcyAxIENBMSkwJwYJKoZIhvcN
+AQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05ODAzMDkxMTU5NTla
+Fw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFtYnVy
+ZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9y
+IFNlY3VyaXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1
+c3RDZW50ZXIgQ2xhc3MgMSBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVA
+dHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALAp67R2
+s67Xtlu0Xue947GcSQRXW6Gr2X8TG/26YavY53HfLQCUXVFIfSPvdWKEkDwKH1kR
+dC+OgKX9MAI9KVLNchpJIZy8y1KOSKFjlsgQhTBpV3RFwFqGxtU94GhXfTFqJI1F
+lz4xfmhmMm4kbewyNslByvAxRMijYcoboDYfAgMBAAGjazBpMA8GA1UdEwEB/wQF
+MAMBAf8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3
+LnRydXN0Y2VudGVyLmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0G
+CSqGSIb3DQEBBAUAA4GBAE+ZWYXIZFaCxW892EYJLzxRwadwWIGSEur01BYAll5y
+KOfWNl8anK8fwoMatAVVmaZYXDco8lce612/sdNFD3IcA9IAxyxV2v5fiXaL4tR3
+9U0JF6/EuqswK0+4HerZ/1nwUHRGul7qNrDrknsPWNoy4VK9IzcP9fMASq6wXt5u
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV
+UzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2Vj
+dXJlIGVCdXNpbmVzcyBDQS0yMB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0
+NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkVxdWlmYXggU2VjdXJlMSYwJAYD
+VQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCBnzANBgkqhkiG9w0B
+AQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn2Z0G
+vxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/
+BPO3QSQ5BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0C
+AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEX
+MBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJl
+IGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTkw
+NjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9euSBIplBq
+y/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQF
+MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA
+A4GBAAyGgq3oThr1jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy
+0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1
+E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUmV+GRMOrN
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARQxCzAJBgNVBAYTAkVT
+MRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UE
+ChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE
+ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEvMC0GA1UECxMm
+SVBTIENBIENMQVNFQTEgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxLzAtBgNVBAMT
+JklQUyBDQSBDTEFTRUExIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZI
+hvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMwHhcNMDExMjI5MDEwNTMyWhcNMjUxMjI3
+MDEwNTMyWjCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ
+BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hp
+bmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5G
+LiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTEgQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUExIENlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXMw
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALsw19zQVL01Tp/FTILq0VA8R5j8
+m2mdd81u4D/u6zJfX5/S0HnllXNEITLgCtud186Nq1KLK3jgm1t99P1tCeWu4Wwd
+ByOgF9H5fahGRpEiqLJpxq339fWUoTCUvQDMRH/uxJ7JweaPCjbB/SQ9AaD1e+J8
+eGZDi09Z8pvZ+kmzAgMBAAGjggRTMIIETzAdBgNVHQ4EFgQUZyaW56G/2LUDnf47
+3P7yiuYV3TAwggFGBgNVHSMEggE9MIIBOYAUZyaW56G/2LUDnf473P7yiuYV3TCh
+ggEcpIIBGDCCARQxCzAJBgNVBAYTAkVTMRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQ
+BgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UEChMlSVBTIEludGVybmV0IHB1Ymxpc2hp
+bmcgU2VydmljZXMgcy5sLjErMCkGA1UEChQiaXBzQG1haWwuaXBzLmVzIEMuSS5G
+LiAgQi02MDkyOTQ1MjEvMC0GA1UECxMmSVBTIENBIENMQVNFQTEgQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkxLzAtBgNVBAMTJklQUyBDQSBDTEFTRUExIENlcnRpZmlj
+YXRpb24gQXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOC
+AQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUF
+BwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYB
+BAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglg
+hkgBhvhCAQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1Ud
+EgQTMBGBD2lwc0BtYWlsLmlwcy5lczBCBglghkgBhvhCAQ0ENRYzQ0xBU0VBMSBD
+QSBDZXJ0aWZpY2F0ZSBpc3N1ZWQgYnkgaHR0cDovL3d3dy5pcHMuZXMvMCkGCWCG
+SAGG+EIBAgQcFhpodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyLzA7BglghkgBhvhC
+AQQELhYsaHR0cDovL3d3dy5pcHMuZXMvaXBzMjAwMi9pcHMyMDAyQ0xBU0VBMS5j
+cmwwQAYJYIZIAYb4QgEDBDMWMWh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcmV2
+b2NhdGlvbkNMQVNFQTEuaHRtbD8wPQYJYIZIAYb4QgEHBDAWLmh0dHA6Ly93d3cu
+aXBzLmVzL2lwczIwMDIvcmVuZXdhbENMQVNFQTEuaHRtbD8wOwYJYIZIAYb4QgEI
+BC4WLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcG9saWN5Q0xBU0VBMS5odG1s
+MHUGA1UdHwRuMGwwMqAwoC6GLGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvaXBz
+MjAwMkNMQVNFQTEuY3JsMDagNKAyhjBodHRwOi8vd3d3YmFjay5pcHMuZXMvaXBz
+MjAwMi9pcHMyMDAyQ0xBU0VBMS5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUF
+BzABhhNodHRwOi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAH66iqyA
+AIQVCtWYUQxkxZwCWINmyq0eB81+atqAB98DNEock8RLWCA1NnHtogo1EqWmZaeF
+aQoO42Hu6r4okzPV7Oi+xNtff6j5YzHIa5biKcJboOeXNp13XjFr/tOn2yrb25aL
+H2betgPAK7N41lUH5Y85UN4HI3LmvSAUS7SG
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
+GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv
+b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV
+BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W
+YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM
+V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB
+4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr
+H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd
+8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv
+vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT
+mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe
+btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc
+T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt
+WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ
+c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A
+4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD
+VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG
+CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0
+aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0
+aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu
+dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw
+czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G
+A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC
+TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg
+Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0
+7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem
+d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd
++LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B
+4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN
+t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x
+DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57
+k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s
+zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j
+Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT
+mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK
+4SVhM7JZG+Ju1zdXtg2pEto=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDzTCCAzagAwIBAgIQU2GyYK7bcY6nlLMTM/QHCTANBgkqhkiG9w0BAQUFADCB
+wTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTwwOgYDVQQL
+EzNDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5
+IC0gRzIxOjA4BgNVBAsTMShjKSAxOTk4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1
+dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
+cmswHhcNMDAwOTI2MDAwMDAwWhcNMTAwOTI1MjM1OTU5WjCBpTEXMBUGA1UEChMO
+VmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsx
+OzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5j
+b20vcnBhIChjKTAwMSwwKgYDVQQDEyNWZXJpU2lnbiBUaW1lIFN0YW1waW5nIEF1
+dGhvcml0eSBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0hmdZ8IAIVli
+zrQJIkRpivglWtvtDbc2fk7gu5Q+kCWHwmFHKdm9VLhjzCx9abQzNvQ3B5rB3UBU
+/OB4naCTuQk9I1F/RMIUdNsKvsvJMDRAmD7Q1yUQgZS9B0+c1lQn3y6ov8uQjI11
+S7zi6ESHzeZBCiVu6PQkAsVSD27smHUCAwEAAaOB3zCB3DAPBgNVHRMECDAGAQH/
+AgEAMEUGA1UdIAQ+MDwwOgYMYIZIAYb4RQEHFwEDMCowKAYIKwYBBQUHAgEWHGh0
+dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEwMQYDVR0fBCowKDAmoCSgIoYgaHR0
+cDovL2NybC52ZXJpc2lnbi5jb20vcGNhMy5jcmwwCwYDVR0PBAQDAgEGMEIGCCsG
+AQUFBwEBBDYwNDAyBggrBgEFBQcwAaYmFiRodHRwOi8vb2NzcC52ZXJpc2lnbi5j
+b20vb2NzcC9zdGF0dXMwDQYJKoZIhvcNAQEFBQADgYEAgnBold+2DcIBcBlK0lRW
+HqzyRUyHuPU163hLBanInTsZIS5wNEqi9YngFXVF5yg3ADQnKeg3S/LvRJdrF1Ea
+w1adPBqK9kpGRjeM+sv1ZFo4aC4cw+9wzrhGBha/937ntag+RaypJXUie28/sJyU
+58dzq6wf7iWbwBbtt8pb8BQ=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCB
+rjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0BgNVBAMTLVVUTi1VU0VSRmlyc3Qt
+Q2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05OTA3MDkxNzI4NTBa
+Fw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAV
+BgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5l
+dHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UE
+AxMtVVROLVVTRVJGaXJzdC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWls
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3B
+YHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIxB8dOtINknS4p1aJkxIW9
+hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8om+rWV6l
+L8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLm
+SGHGTPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM
+1tZUOt4KpLoDd7NlyP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws
+6wIDAQABo4G5MIG2MAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud
+DgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNVHR8EUTBPME2gS6BJhkdodHRw
+Oi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGllbnRBdXRoZW50
+aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH
+AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u
+7mFVbwQ+zznexRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0
+xtcgBEXkzYABurorbs6q15L+5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQ
+rfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarVNZ1yQAOJujEdxRBoUp7fooXFXAim
+eOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZw7JHpsIyYdfHb0gk
+USeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEn
+MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL
+ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENo
+YW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYxNDE4WhcNMzcwOTMwMTYxNDE4WjB9
+MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgy
+NzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4G
+A1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUA
+A4IBDQAwggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0
+Mi+ITaFgCPS3CU6gSS9J1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/s
+QJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8Oby4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpV
+eAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl6DJWk0aJqCWKZQbua795
+B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c8lCrEqWh
+z0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0T
+AQH/BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1i
+ZXJzaWduLm9yZy9jaGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4w
+TcbOX60Qq+UDpfqpFDAOBgNVHQ8BAf8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAH
+MCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBjaGFtYmVyc2lnbi5vcmcwKgYD
+VR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9yZzBbBgNVHSAE
+VDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh
+bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0B
+AQUFAAOCAQEAPDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUM
+bKGKfKX0j//U2K0X1S0E0T9YgOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXi
+ryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJPJ7oKXqJ1/6v/2j1pReQvayZzKWG
+VwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4IBHNfTIzSJRUTN3c
+ecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREest2d/
+AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV
+UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL
+EwhEU1RDQSBFMjAeFw05ODEyMDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJ
+BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x
+ETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQC/
+k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGODVvso
+LeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3o
+TQPMx7JSxhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCG
+SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx
+JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI
+RFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkxOTE3
+MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFB6C
+TShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5
+WzAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG
+SIb3DQEBBQUAA4GBAEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHR
+xdf0CiUPPXiBng+xZ8SQTGPdXqfiup/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVL
+B3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1mPnHfxsb1gYgAlihw6ID
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDpjCCAo6gAwIBAgIEAgAAvzANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJJ
+RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MS8wLQYD
+VQQDEyZCYWx0aW1vcmUgQ3liZXJUcnVzdCBDb2RlIFNpZ25pbmcgUm9vdDAeFw0w
+MDA1MTcxNDAxMDBaFw0yNTA1MTcyMzU5MDBaMGcxCzAJBgNVBAYTAklFMRIwEAYD
+VQQKEwlCYWx0aW1vcmUxEzARBgNVBAsTCkN5YmVyVHJ1c3QxLzAtBgNVBAMTJkJh
+bHRpbW9yZSBDeWJlclRydXN0IENvZGUgU2lnbmluZyBSb290MIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyHGaGBKOetv5mvxBr9jy9AmOrT/+Zzc82skm
+ULGxPsvoTnMA8rLc88VG+wnvGJbOp+CchF0gDnqgqjaL+ii2eC6z7OhH8wTwkCO0
+6q/lU7gF90ddK4bxp6TGOzW20g1SQdf0knXhogpQVoe+lwt7M4UQuSgY7jPqSBHX
+W5FHdiLU7s9d56hOHJ2Wkd2cvXQJqHJhqrAhOvE9LANWCdLB3MO1x1Q3q+YmorJG
+cXPKEYjuvOdk99ARGnNAWshJLA+375B/aIAEOAsbDzvU9aCzwo7hNLSAmW2edtSS
+KUCxldI3pGcSf+Biu641xZk2gkS45ngYM2Fxk1stjZ94lYLrbQIDAQABo1owWDAT
+BgNVHSUEDDAKBggrBgEFBQcDAzAdBgNVHQ4EFgQUyEE0XBUVBOVA8tGrmm8kknqH
+QlowEgYDVR0TAQH/BAgwBgEB/wIBAzAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcN
+AQEFBQADggEBAFJ0qpVLIozHPZak/l36L7W86/AL6VY4HdFtDaG8aIvwxYClJDT9
+8pYYEYahNvU351RA1WQfw19wQmstOceeUgXO52py0o1yP0dQg6vHjSXJsOOnUxaV
+pmpT6hidj3ipd3ca+bSXR1mIJyi1yuEu1z4Oog24IkQD49FjsEE6ofWkLfd2HgRU
+mXgyQNcrfE26ppyweW4Hvozs7tc4aVvBDFZon/7r0eHIiPnyzX++hbREZwBQPvQm
+A2Tqd33oXj4cN0fI1uqk8zY8l8I5cgWUGSXD1zdBD8Efh4r9qr7psWRX5NuSoc/h
+Seg7H5ETWsOP2SVYSYBHD8YDrqzjv7fAqio=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU
+MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
+b3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx
+MDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB
+ZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV
+BAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV
+6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX
+GCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP
+dzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH
+1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF
+62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW
+BBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw
+AwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL
+MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU
+cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv
+b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6
+IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/
+iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao
+GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh
+4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm
+XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEeDCCA+GgAwIBAgICJ0swDQYJKoZIhvcNAQEFBQAwZjELMAkGA1UEBhMCVVMx
+JTAjBgNVBAoTHFVuaXRlZCBTdGF0ZXMgUG9zdGFsIFNlcnZpY2UxGTAXBgNVBAsT
+EHd3dy51c3BzLmNvbS9DUFMxFTATBgNVBAMTDFVTUFMgUm9vdCBDQTAeFw0wMDA4
+MTYyMTA2MzlaFw0yMDA4MTUxMzA2MjVaMG4xCzAJBgNVBAYTAlVTMSUwIwYDVQQK
+ExxVbml0ZWQgU3RhdGVzIFBvc3RhbCBTZXJ2aWNlMRkwFwYDVQQLExB3d3cudXNw
+cy5jb20vQ1BTMR0wGwYDVQQDExRVU1BTIFByb2R1Y3Rpb24gQ0EgMTCBnzANBgkq
+hkiG9w0BAQEFAAOBjQAwgYkCgYEAxta577JTOMrSdwxsNigwwtAoAnhxTg2JQsdZ
+J7OQCCfUl1oetnhEQGt0xo2rUYvopu1RptZ1F+x6VF5Wg+fwbcRJ9Be9BgsSxlXv
+6ajhKC+gQ4919P/Z3H3+qtR485yTxZnaYkab9XYkVAkKKesURUIL/w12Ax+nZYii
+pH9v0E8CAwEAAaOCAiswggInMIHPBgNVHSAEgccwgcQwgcEGB2CGSIb5bWUwgbUw
+IwYIKwYBBQUHAgETF2h0dHA6Ly93d3cudXNwcy5jb20vQ1BTMIGNBggrBgEFBQcC
+AjCBgBp+U2VlIFVTUFMgQ1BTIGF0IGh0dHA6Ly93d3cudXNwcy5jb20vQ1BTLiBU
+aGlzIGNlcnRpZmljYXRlIGlzIHRvIGJlIHVzZWQgb25seSBpbiBhY2NvcmRhbmNl
+IHdpdGggVVNQUyByZWd1bGF0aW9ucyBhbmQgcG9saWNpZXMuMCQGCWCGSIb5bWQC
+BgQXMBWgAwIBAaEDAgECogMCAQGjBAICJxEwJAYJYIZIhvltZAIIBBcwFaADAgEB
+oQMCAQKiAwIBAaMEAgInFTAkBglghkiG+W1kAgcEFzAVoAMCAQGhAwIBAqIDAgEB
+owQCAidLMBAGCWCGSIb5bWQCAQQDCgECMBAGCWCGSIb5bWQCAwQDCgEHMBkGCWCG
+SIb5bWQCBAQMMAqgCBoGTm9Sb2xlMB0GA1UdDgQWBBQl5aDvLXJPbZUfNx8g1sMB
+RAPH0DAfBgNVHSMEGDAWgBTTzoJ08y9LiWBypF4Rv191A6ICqzAdBgNVHRIEFjAU
+gRJyb290MTAwMDFAdXNwcy5jb20wIQYDVR0RBBowGIEWY2FhZG1pbkBlbWFpbC51
+c3BzLmNvbTAPBgNVHQ8BAf8EBQMDB8YAMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI
+hvcNAQEFBQADgYEAcAmQhgkD1rSyWiOrPGVEr/WndJfcCC4EyFOXrWGpwjCKu2jT
+wWbAzS70nbA+qWPj718XgmaQb3C+LUJkQWJ/IiXBtc9WOTF3bqCT+Rqpw9wKcHbF
+tS2bl4N2zgJeyG3dgrDqW1kNCYdAh3G+xaiXBbxD++6tJgq8e0VfjlmoK4o=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY
+MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t
+dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5
+WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD
+VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3
+DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8
+9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ
+DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9
+Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N
+QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ
+xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G
+A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T
+AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG
+kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr
+Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5
+Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU
+JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot
+RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBqDELMAkGA1UEBhMCQ0Ex
+CzAJBgNVBAgTAk9OMRAwDgYDVQQHEwdUb3JvbnRvMRgwFgYDVQQKEw9NYWlsRW5n
+aW5lIEluYy4xKTAnBgNVBAsTIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IERpdmlz
+aW9uMRMwEQYDVQQDEwptYWlsZW5naW5lMSAwHgYJKoZIhvcNAQkBFhFjYUBtYWls
+ZW5naW5lLmNvbTAeFw05ODAxMDEwMDAwMDBaFw0zODAxMTcwMDAwMDBaMIGoMQsw
+CQYDVQQGEwJDQTELMAkGA1UECBMCT04xEDAOBgNVBAcTB1Rvcm9udG8xGDAWBgNV
+BAoTD01haWxFbmdpbmUgSW5jLjEpMCcGA1UECxMgQ2VydGlmaWNhdGlvbiBBdXRo
+b3JpdHkgRGl2aXNpb24xEzARBgNVBAMTCm1haWxlbmdpbmUxIDAeBgkqhkiG9w0B
+CQEWEWNhQG1haWxlbmdpbmUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAqXmfsU+lx+NFmn6tN17RTOyaddHqLnr/3rzEDIyT9TN+tF9TG7jmK7lJ
+Jrj5arQ3nTFaLF8JuND2U1z/cLPw6/TX+1tE3v3CNUDSjaisyUDiUyp3TE8hMMMz
+zfZQn0JsGgNhhWxqyzjhRQGtKL4+xtn8VsF/8zGgZYke7nlmVKz/FslDFTnNoodL
+BAEGiu9JQS9qqpbSs20NdZ6LXPL2A4iTjnsNFBW3jIMVIn/JVVyaycU7ue2oFviD
+vLNpkVZcR7A+jjIdIumOc5VSF0y7y74cQC5YwkR2mLK7UBYDK6NCY3ta/C4M8NsM
+0FpmvRl0+A1ivZtVwqI98dxDtp7HeQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0G
+CSqGSIb3DQEBBQUAA4IBAQAjfNn5BCzxylBDakFQGWKE/P43PRibMOEzfd7+DzbY
+WIekoz3i00DwoH3b6j4gwlDJRAOq4dF6/Pt/uBOHDo/op+ef+9ErmKPd+ehXN9h3
+7QbccTgz7DtVwA4iRlDRLru+JuXzT+OsCHuFZMOLJ+KD2JAGh3W68JjdcLkrlcpt
+AU0wc5aOHPPfEBdIah8y8QtNzXRVzoBt8zzvgCARkXxTS2u/9QaXR1hML0JtDgQS
+SdZ6Kd8SN6yzqxD+buYD5sOfJmjBF/n3lqFHNMHnnGXy2TAXZtIAWzffU3A0cGPB
+N6FZ026a86HbF1X4k+xszhbJu/ikczyuWnCJIg3fTYSD
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIH9zCCB2CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARwxCzAJBgNVBAYTAkVT
+MRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UE
+ChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE
+ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEzMDEGA1UECxMq
+SVBTIENBIENoYWluZWQgQ0FzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MTMwMQYD
+VQQDEypJUFMgQ0EgQ2hhaW5lZCBDQXMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx
+HjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczAeFw0wMTEyMjkwMDUzNTha
+Fw0yNTEyMjcwMDUzNThaMIIBHDELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNl
+bG9uYTESMBAGA1UEBxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQg
+cHVibGlzaGluZyBTZXJ2aWNlcyBzLmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMu
+ZXMgQy5JLkYuICBCLTYwOTI5NDUyMTMwMQYDVQQLEypJUFMgQ0EgQ2hhaW5lZCBD
+QXMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMzAxBgNVBAMTKklQUyBDQSBDaGFp
+bmVkIENBcyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqGSIb3DQEJARYP
+aXBzQG1haWwuaXBzLmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDcVpJJ
+spQgvJhPUOtopKdJC7/SMejHT8KGC/po/UNaivNgkjWZOLtNA1IhW/A3mTXhQSCB
+hYEFcYGdtJUZqV92NC5jNzVXjrQfQj8VXOF6wV8TGDIxya2+o8eDZh65nAQTy2nB
+Bt4wBrszo7Uf8I9vzv+W6FS+ZoCua9tBhDaiPQIDAQABo4IEQzCCBD8wHQYDVR0O
+BBYEFKGtMbH5PuEXpsirNPxShwkeYlJBMIIBTgYDVR0jBIIBRTCCAUGAFKGtMbH5
+PuEXpsirNPxShwkeYlJBoYIBJKSCASAwggEcMQswCQYDVQQGEwJFUzESMBAGA1UE
+CBMJQmFyY2Vsb25hMRIwEAYDVQQHEwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJ
+bnRlcm5ldCBwdWJsaXNoaW5nIFNlcnZpY2VzIHMubC4xKzApBgNVBAoUImlwc0Bt
+YWlsLmlwcy5lcyBDLkkuRi4gIEItNjA5Mjk0NTIxMzAxBgNVBAsTKklQUyBDQSBD
+aGFpbmVkIENBcyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEzMDEGA1UEAxMqSVBT
+IENBIENoYWluZWQgQ0FzIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MR4wHAYJKoZI
+hvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYDVR0TBAUwAwEB/zAMBgNVHQ8E
+BQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMG
+CCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYB
+BAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAAcwGgYDVR0RBBMw
+EYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGBD2lwc0BtYWlsLmlwcy5lczBC
+BglghkgBhvhCAQ0ENRYzQ2hhaW5lZCBDQSBDZXJ0aWZpY2F0ZSBpc3N1ZWQgYnkg
+aHR0cDovL3d3dy5pcHMuZXMvMCkGCWCGSAGG+EIBAgQcFhpodHRwOi8vd3d3Lmlw
+cy5lcy9pcHMyMDAyLzA3BglghkgBhvhCAQQEKhYoaHR0cDovL3d3dy5pcHMuZXMv
+aXBzMjAwMi9pcHMyMDAyQ0FDLmNybDA8BglghkgBhvhCAQMELxYtaHR0cDovL3d3
+dy5pcHMuZXMvaXBzMjAwMi9yZXZvY2F0aW9uQ0FDLmh0bWw/MDkGCWCGSAGG+EIB
+BwQsFipodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3JlbmV3YWxDQUMuaHRtbD8w
+NwYJYIZIAYb4QgEIBCoWKGh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvcG9saWN5
+Q0FDLmh0bWwwbQYDVR0fBGYwZDAuoCygKoYoaHR0cDovL3d3dy5pcHMuZXMvaXBz
+MjAwMi9pcHMyMDAyQ0FDLmNybDAyoDCgLoYsaHR0cDovL3d3d2JhY2suaXBzLmVz
+L2lwczIwMDIvaXBzMjAwMkNBQy5jcmwwLwYIKwYBBQUHAQEEIzAhMB8GCCsGAQUF
+BzABhhNodHRwOi8vb2NzcC5pcHMuZXMvMA0GCSqGSIb3DQEBBQUAA4GBAERyMJ1W
+WKJBGyi3leGmGpVfp3hAK+/blkr8THFj2XOVvQLiogbHvpcqk4A0hgP63Ng9HgfN
+HnNDJGD1HWHc3JagvPsd4+cSACczAsDAK1M92GsDgaPb1pOVIO/Tln4mkImcJpvN
+b2ar7QMiRDjMWb2f2/YHogF/JsRj9SVCXmK9
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP
+MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx
+MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV
+BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o
+Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt
+5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s
+3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej
+vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu
+8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw
+DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG
+MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil
+zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/
+3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD
+FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6
+Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2
+ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEITCCAwmgAwIBAgICAMcwDQYJKoZIhvcNAQEFBQAwcTELMAkGA1UEBhMCREUx
+HDAaBgNVBAoTE0RldXRzY2hlIFRlbGVrb20gQUcxHzAdBgNVBAsTFlQtVGVsZVNl
+YyBUcnVzdCBDZW50ZXIxIzAhBgNVBAMTGkRldXRzY2hlIFRlbGVrb20gUm9vdCBD
+QSAyMB4XDTA2MTIxOTEwMjkwMFoXDTE5MDYzMDIzNTkwMFowWjELMAkGA1UEBhMC
+REUxEzARBgNVBAoTCkRGTi1WZXJlaW4xEDAOBgNVBAsTB0RGTi1QS0kxJDAiBgNV
+BAMTG0RGTi1WZXJlaW4gUENBIEdsb2JhbCAtIEcwMTCCASIwDQYJKoZIhvcNAQEB
+BQADggEPADCCAQoCggEBAOmbw2eF+Q2u9Y1Uw5ZQNT1i6W5M7ZTXAFuVInTUIOs0
+j9bswDEEC5mB4qYU0lKgKCOEi3SJBF5b4OJ4wXjLFssoNTl7LZBF0O2gAHp8v0oO
+GwDDhulcKzERewzzgiRDjBw4i2poAJru3E94q9LGE5t2re7eJujvAa90D8EJovZr
+zr3TzRQwT/Xl46TIYpuCGgMnMA0CZWBN7dEJIyqWNVgn03bGcbaQHcTt/zWGfW8z
+s9sPxRHCioOhlF1Ba9jSEPVM/cpRrNm975KDu9rrixZWVkPP4dUTPaYfJzDNSVTb
+yRM0mnF1xWzqpwuY+SGdJ68+ozk5SGqMrcmZ+8MS8r0CAwEAAaOB2TCB1jBwBgNV
+HR8EaTBnMGWgY6Bhhl9odHRwOi8vcGtpLnRlbGVzZWMuZGUvY2dpLWJpbi9zZXJ2
+aWNlL2FmX0Rvd25sb2FkQVJMLmNybD8tY3JsX2Zvcm1hdD1YXzUwOSYtaXNzdWVy
+PURUX1JPT1RfQ0FfMjAdBgNVHQ4EFgQUSbfGz+g9H3/qRHsTKffxCnA+3mQwHwYD
+VR0jBBgwFoAUMcN5G7r1U9cX4Il6LRdsCrMrnTMwDgYDVR0PAQH/BAQDAgEGMBIG
+A1UdEwEB/wQIMAYBAf8CAQIwDQYJKoZIhvcNAQEFBQADggEBADvhWnfASBfcqRjs
+ga9aifC9KJKmylkYEnDsKPLnrn+WLOfyXRkx9hMrdL29gLK592fJOaJ5O+EREe5r
+eJEzfjtfJid1U2WOM2Puz3PDsJIjSSFQdSOhHxjilIU9PzPpdyCNor3moYUpQPY/
+czJYDQlrptqFbMA/u41mZFYkTq4NPzI1AVvpjILZcllPsYaF8XSFVuXD+Fzzje5H
+s1MFcOflTYppgyjhEwmGnl7I6lgeDB/5pNRaBGj9KD6LArZYtfahLDdXAGerI2iN
+Y6XvmWtc/UtW9qtAhzTUEZJs7IfFCgsHM3K0bwwdVCzYUcfMvzDTQ3LxMr+Mzklj
+qAD38hw=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICoTCCAgqgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBizELMAkGA1UEBhMCWkEx
+FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzAN
+BgNVBAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAd
+BgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcgQ0EwHhcNOTcwMTAxMDAwMDAwWhcN
+MjAxMjMxMjM1OTU5WjCBizELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4g
+Q2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsG
+A1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1l
+c3RhbXBpbmcgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANYrWHhhRYZT
+6jR7UZztsOYuGA7+4F+oJ9O0yeB8WU4WDnNUYMF/9p8u6TqFJBU820cEY8OexJQa
+Wt9MevPZQx08EHp5JduQ/vBR5zDWQQD9nyjfeb6Uu522FOMjhdepQeBMpHmwKxqL
+8vg7ij5FrHGSALSQQZj7X+36ty6K+Ig3AgMBAAGjEzARMA8GA1UdEwEB/wQFMAMB
+Af8wDQYJKoZIhvcNAQEEBQADgYEAZ9viwuaHPUCDhjc1fR/OmsMMZiCouqoEiYbC
+9RAIDb/LogWK0E02PvTX72nGXuSwlG9KuefeW4i2e9vjJ+V2w/A1wcu1J5szedyQ
+pgCed/r8zSeUQhac0xxo7L9c3eWpexAKMnRUEzGLhQOEkbdYATAUOK8oyvyxUBkZ
+CayJSdM=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDwzCCAyygAwIBAgIBADANBgkqhkiG9w0BAQQFADCBmDELMAkGA1UEBhMCQVQx
+EDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTFCMEAGA1UEChM5QXJn
+ZSBEYXRlbiBPZXN0ZXJyZWljaGlzY2hlIEdlc2VsbHNjaGFmdCBmdWVyIERhdGVu
+c2NodXR6MSIwIAYJKoZIhvcNAQkBFhNhLWNlcnRAYXJnZWRhdGVuLmF0MB4XDTAx
+MDIxMjExMzAzMFoXDTA5MDIxMjExMzAzMFowgZgxCzAJBgNVBAYTAkFUMRAwDgYD
+VQQIEwdBdXN0cmlhMQ8wDQYDVQQHEwZWaWVubmExQjBABgNVBAoTOUFyZ2UgRGF0
+ZW4gT2VzdGVycmVpY2hpc2NoZSBHZXNlbGxzY2hhZnQgZnVlciBEYXRlbnNjaHV0
+ejEiMCAGCSqGSIb3DQEJARYTYS1jZXJ0QGFyZ2VkYXRlbi5hdDCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEAwgsHqoNtmmrJ86+e1I4hOVBaL4kokqKN2IPOIL+1
+XwY8vfOOUfPEdhWpaC0ldt7VYrksgDiUccgH0FROANWK2GkfKMDzjjXHysR04uEb
+Om7Kqjqn0nproOGkFG+QvBZgs+Ws+HXNFJA6V76fU4+JXq4452LSK4Lr5YcBquu3
+NJECAwEAAaOCARkwggEVMB0GA1UdDgQWBBQ0j59zH/G31zRjgK1y2P//tSAWZjCB
+xQYDVR0jBIG9MIG6gBQ0j59zH/G31zRjgK1y2P//tSAWZqGBnqSBmzCBmDELMAkG
+A1UEBhMCQVQxEDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTFCMEAG
+A1UEChM5QXJnZSBEYXRlbiBPZXN0ZXJyZWljaGlzY2hlIEdlc2VsbHNjaGFmdCBm
+dWVyIERhdGVuc2NodXR6MSIwIAYJKoZIhvcNAQkBFhNhLWNlcnRAYXJnZWRhdGVu
+LmF0ggEAMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMBEGCWCGSAGG+EIBAQQE
+AwICBDANBgkqhkiG9w0BAQQFAAOBgQBFuJYncqMYB6gXQS3eDOI90BEHfFTKy/dV
+AV+K7QdAYikWmqgBheRdPKddJdccPy/Zl/p3ZT7GhDyC5f3wZjcuu8AJ27BNwbCA
+x54dgxgCNcyPm79nY8MRtEdEpoRGdSsFKJemz6hpXM++MWFciyrRWIIA44XB0Gv3
+US0spjsDPQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDRjCCAi6gAwIBAgICE2EwDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCTk8x
+GDAWBgNVBAoUD1Bvc3RlbiBOb3JnZSBCQTEgMB4GA1UEAxQXUG9zdGVuIChOb3J3
+YXkgUG9zdCkgQ0EwHhcNMDAxMjE0MDMyODM2WhcNMTAxMjE0MjI1OTU5WjBJMQsw
+CQYDVQQGEwJOTzEYMBYGA1UEChQPUG9zdGVuIE5vcmdlIEJBMSAwHgYDVQQDFBdQ
+b3N0ZW4gKE5vcndheSBQb3N0KSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
+AQoCggEBAJSjVAMK6A2rpb0bHPZIxRfcPM41BHkz3PF+aUrttBuygRGd7TIJhDeN
+0vSQiIse3kNO81cxJWqDKw+zo6f48t1jmcfQyKmxU0nI/NymOVRbqeYMrAOtguQR
+3PCRlbqMG3GgeyhMhTUS2yUPqINyB/hNb4sxkKnvTSLHMMKYYFKwfCSABYuU6o2e
++PZI0t88eCoiDRqbcFGOQtwaUYh9rbhWn0m648X2Mzg8gMDfxQCWJKXPH3mqx4bc
+82rDRntpwWK+QYqbQllCl7wokgGoQ60w/vTaQjvn3J2tQT2L6cllvzANb7nSnr4v
+6IDCfXPattFN8dyRmV5SJRAyvI1bYbUCAwEAAaM4MDYwDAYDVR0TBAUwAwEB/zAR
+BgNVHQ4ECgQIRVAyMDQ4LTEwEwYDVR0jBAwwCoAIRVAyMDQ4LTEwDQYJKoZIhvcN
+AQEFBQADggEBAG6znDQlEbj+VWu6TXipWYXVMvrNSIbCq88m1n7aD4Un5nYP6mKH
+VVkBeit/41dRBRE6X2wjgall69MjL9dXgV+GLlASRYajIQ7M6brwCyr6nqRdleag
+d/yybC7z1Q4mORjgbvBvpnJstZdubTU7eUU88ty7aPlRK7n/3XqjK7lm0gdOZvg5
+b1sMB3q16Ucqo2ALYmJdflJ5ywBfeDuF9CCIOrB+FkDRRMpbJbWPF8nl4j56KvuG
+ksPXG7pWrHyOG6MckngB0UbmkCQKYHOihwXYj/yafdtEl2XewGDAS/lJnU4naxRn
+Eut1zYBc/exxq0ONxhpU1xRIxA//ik8EJzo=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhV
+MRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMe
+TmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0
+dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFzcyBB
+KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oXDTE5MDIxOTIzMTQ0
+N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhC
+dWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQu
+MRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBL
+b3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSMD7tM9DceqQWC2ObhbHDqeLVu0ThEDaiD
+zl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZz+qMkjvN9wfcZnSX9EUi
+3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC/tmwqcm8
+WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LY
+Oph7tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2Esi
+NCubMvJIH5+hCoR64sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCC
+ApswDgYDVR0PAQH/BAQDAgAGMBIGA1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4
+QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZRUxFTSEgRXplbiB0
+YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRhdGFz
+aSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu
+IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtm
+ZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMg
+ZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVs
+amFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJhc2EgbWVndGFsYWxoYXRv
+IGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBzOi8vd3d3
+Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6
+ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1
+YW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3Qg
+dG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRs
+b2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNAbmV0bG9jay5uZXQuMA0G
+CSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5ayZrU3/b39/zcT0mwBQO
+xmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjPytoUMaFP
+0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQ
+QeJBCWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxk
+f1qbFFgBJ34TUMdrKuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK
+8CtmdWOMovsEPoMOmzbwGOQmIMOM8CgHrTwXZoi1/baI
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDsDCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBnTELMAkGA1UEBhMCVVMx
+EzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCEJlcmtlbGV5MRwwGgYDVQQK
+ExNTZW5kbWFpbCBDb25zb3J0aXVtMR4wHAYDVQQDExVDZXJ0aWZpY2F0ZSBBdXRo
+b3JpdHkxKDAmBgkqhkiG9w0BCQEWGWNlcnRpZmljYXRlc0BzZW5kbWFpbC5vcmcw
+HhcNMDMwMjAxMjE1MTQ3WhcNMDgwMTMxMjE1MTQ3WjCBnTELMAkGA1UEBhMCVVMx
+EzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCEJlcmtlbGV5MRwwGgYDVQQK
+ExNTZW5kbWFpbCBDb25zb3J0aXVtMR4wHAYDVQQDExVDZXJ0aWZpY2F0ZSBBdXRo
+b3JpdHkxKDAmBgkqhkiG9w0BCQEWGWNlcnRpZmljYXRlc0BzZW5kbWFpbC5vcmcw
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJr73EyjWCEbhHgKU1azjYQFt9vd
+14Hq3cGr1L7ZKxLgbTox1fB7E/zY2gkLcRGOuUjEq671nEziBCeOyAM6qgCLRvJ5
+Ca5lsppm56yp6jL3Sk792kFINFqdsELqVUAXJ15nnuXO3IRtHUg3IxFonajUWAIF
+6og1vQ22KNXN1NiVAgMBAAGjgf0wgfowHQYDVR0OBBYEFN7NbriJNAY96c2n/kVP
+Tvvhjed5MIHKBgNVHSMEgcIwgb+AFN7NbriJNAY96c2n/kVPTvvhjed5oYGjpIGg
+MIGdMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMI
+QmVya2VsZXkxHDAaBgNVBAoTE1NlbmRtYWlsIENvbnNvcnRpdW0xHjAcBgNVBAMT
+FUNlcnRpZmljYXRlIEF1dGhvcml0eTEoMCYGCSqGSIb3DQEJARYZY2VydGlmaWNh
+dGVzQHNlbmRtYWlsLm9yZ4IBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUA
+A4GBAGaSuVcXO2oOcrGFKVOfEWigDXlD0HxIc7lxCVAIAgMLKAwzmgCslGlPvA9F
+a/U6ymqHoX8o95rEtrDz3KPrQpWfmRn4uIRt8R28n/CgzGAtAGsXVTMWhdFz4QBZ
+iTMZxC4pWjmnDueb0kzHuX1qPrQAg4bTFij9rVVlYE4UAkbT
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDdTCCAl2gAwIBAgILAgAAAAAA1ni3lAUwDQYJKoZIhvcNAQEEBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
+MDBaFw0xNDAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
+aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
+jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
+xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
+1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
+snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
+U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
+9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIABjAdBgNVHQ4EFgQU
+YHtmGkUNl8qJUC99BM00qP/8/UswDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B
+AQQFAAOCAQEArqqf/LfSyx9fOSkoGJ40yWxPbxrwZKJwSk8ThptgKJ7ogUmYfQq7
+5bCdPTbbjwVR/wkxKh/diXeeDy5slQTthsu0AD+EAk2AaioteAuubyuig0SDH81Q
+gkwkr733pbTIWg/050deSY43lv6aiAU62cDbKYfmGZZHpzqmjIs8d/5GY6dT2iHR
+rH5Jokvmw2dZL7OKDrssvamqQnw1wdh/1acxOk5jQzmvCLBhNIzTmKlDNPYPhyk7
+ncJWWJh3w/cbrPad+D6qp1RF8PX51TFl/mtYnHGzHtdS6jIX/EBgHcl5JLL2bP2o
+Zg6C3ZjL2sJETy6ge/L3ayx2EYRGinij4w==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICjTCCAXWgAwIBAgIDAQAhMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
+QTAeFw0wMjA3MTIxNjMxNTNaFw0xMjA3MTIxNjMxNTNaMEMxCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xFzAVBgNVBAMTDkNlcnR1bSBM
+ZXZlbCBJMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCl73pZ9DFcn7Qy0qBZ
+K+So18cav7drUrJ8SiYOlDDVskt81+eIcL/4FelTSGjuAOvYdmm+HGYG998RPB0i
+Z+Ak67vXFJ537vRWOcu6aMjNuAwu8BOdc5eSgB0Y8X4+3LOYfugtaZa8mrEQ8Hit
+0yLE9UBcU9J+4PmkVGecmZ8jZQIDAQABoxMwETAPBgNVHRMBAf8EBTADAQH/MA0G
+CSqGSIb3DQEBBQUAA4IBAQAlDS4aTmgK0YgmUvt/3zN7G2/ZrtBBCtONlUvC69c7
+TmLJWJ842y2AH7ryNXXkcsn6p0ZBTrTJ2tA2y/j2PXJeXrCkK/qAJIpM0l4u0MT7
+enY5akasduHp2NXMP9vDlgMy7elU2s3nkOT79gfh5XttC+5D/x4JDNi1DMAA9hk1
+6DK4zWmDVfjkiP/G3fEndtJgNDQsyqnaQ3E3bljv3f1KJTjZUvtA2Ml6MP2hFRhg
+ZPsxuhW8QXidQYNiua1h7XUUiPiERLDLWZmfY6dxGrHXjSTx3shHNaQM0qkDs9gS
+6UK8uWJN2bf2YBnvGmzy0IQvx5wDCH7h8AdaBD6DgIG1
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICPDCCAaUCEC0b/EoXjaOR6+f/9YtFvgswDQYJKoZIhvcNAQECBQAwXzELMAkG
+A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
+cyAyIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
+MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
+BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAyIFB1YmxpYyBQcmlt
+YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
+ADCBiQKBgQC2WoujDWojg4BrzzmH9CETMwZMJaLtVRKXxaeAufqDwSCg+i8VDXyh
+YGt+eSz6Bg86rvYbb7HS/y8oUl+DfUvEerf4Zh+AVPy3wo5ZShRXRtGak75BkQO7
+FYCTXOvnzAhsPz6zSvz/S2wj1VCCJkQZjiPDceoZJEcEnnW/yKYAHwIDAQABMA0G
+CSqGSIb3DQEBAgUAA4GBAIobK/o5wXTXXtgZZKJYSi034DNHD6zt96rbHuSLBlxg
+J8pFUs4W7z8GZOeUaHxgMxURaa+dYo2jA1Rrpr7l7gUYYAS/QoD90KioHgE796Nc
+r6Pc5iaAIzy4RHT3Cq5Ji2F4zCS/iIqnDupzGUH9TQPwiNHleI2lKk/2lw0Xd8rY
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIGejCCBeOgAwIBAgIBEDANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MTIzMTIzNDQ1MloXDTEwMTIzMDIzNDQ1
+MlowgbsxCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxFjAUBgNVBAoTDVN0
+YXJ0Q29tIEx0ZC4xIzAhBgNVBAsTGlNlY3VyZSBDZXJ0aWZpY2F0ZSBTaWduaW5n
+MTswOQYDVQQDEzJTdGFydENvbSBDbGFzcyAxIEludGVybWVkaWF0ZSBEb21haW4g
+Q29udHJvbGxlciBDQTEhMB8GCSqGSIb3DQEJARYSYWRtaW5Ac3RhcnRjb20ub3Jn
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9OsyeMNY/GkoXNcwgSxg
+EgUSRxHf1fr4bpEqgGINn0gUrgcqQiMuy1DhHNGh7QPqIMWSdQK0hIM7PsRJyMld
+afY7Mx8U81N07jYM9SQ7LV/fvmX8fg3OBtQCijbB3Ys+IuYjxUNLQRRHmaMWKS09
+4UADkCKxXxXbheqoStDvFje+0/ygYHeVX8Ok7EPd0x5ijNrc+kpAymfMYvUqeRCe
+m9MGmvrphA6vi0T0aWD0X+UoeR9LWyS+RfGQ7nAYHichSBY7IG/kQ3rih9bblS1O
+Y5w6KO2OrJzhu9zPhpwQEo0Qf2oZmAN8V3RPBwQtMy2ncCxlsMQedinSzL7M6qSS
+dwIDAQABo4IDETCCAw0wDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAeYwHQYD
+VR0OBBYEFPrLw5wKGVNi8+N+xhC8VX0vDyfmMIHdBgNVHSMEgdUwgdKAFByJw5bM
+vf4y1Q2MgTG2mJ2NKGSNoYG2pIGzMIGwMQswCQYDVQQGEwJJTDEPMA0GA1UECBMG
+SXNyYWVsMQ4wDAYDVQQHEwVFaWxhdDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEa
+MBgGA1UECxMRQ0EgQXV0aG9yaXR5IERlcC4xKTAnBgNVBAMTIEZyZWUgU1NMIENl
+cnRpZmljYXRpb24gQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJhZG1pbkBzdGFy
+dGNvbS5vcmeCAQAwHQYDVR0RBBYwFIESYWRtaW5Ac3RhcnRjb20ub3JnMB0GA1Ud
+EgQWMBSBEmFkbWluQHN0YXJ0Y29tLm9yZzBiBgNVHR8EWzBZMCmgJ6AlhiNodHRw
+Oi8vY2VydC5zdGFydGNvbS5vcmcvY2EtY3JsLmNybDAsoCqgKIYmaHR0cDovL2Ny
+bC5zdGFydGNvbS5vcmcvY3JsL2NhLWNybC5jcmwwggFKBgNVHSAEggFBMIIBPTCC
+ATkGCysGAQQBgbU3AQEBMIIBKDAvBggrBgEFBQcCARYjaHR0cDovL2NlcnQuc3Rh
+cnRjb20ub3JnL3BvbGljeS5wZGYwNQYIKwYBBQUHAgEWKWh0dHA6Ly9jZXJ0LnN0
+YXJ0Y29tLm9yZy9pbnRlcm1lZGlhdGUucGRmMIG9BggrBgEFBQcCAjCBsDAUFg1T
+dGFydENvbSBMdGQuMAMCAQEagZdMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg
+c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0
+aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly9j
+ZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMA0GCSqGSIb3DQEBBAUAA4GBAL/Z
+/zk8ZwAOvXbF2+lFqD6CaYfhKV423EG8EzkooHwdKjJd5Tj0m1FBto8ceR/mF4XR
+laU9GEZy+w5+Qlu7B/agWa4fpNUrTOLIAsWxw7ARjYvAF95GhinHf6Ajfe366je/
+OsxQzR/Alak7gYM/Qt8BVTl3U31E12MXFPilr20I
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEQTCCA6qgAwIBAgICAQQwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1Zh
+bGlDZXJ0IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIElu
+Yy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24g
+QXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAe
+BgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTA0MDExNDIxMDUyMVoX
+DTI0MDEwOTIxMDUyMVowgewxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25h
+MRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVjaG5v
+bG9naWVzLCBJbmMuMTAwLgYDVQQLEydodHRwOi8vd3d3LnN0YXJmaWVsZHRlY2gu
+Y29tL3JlcG9zaXRvcnkxMTAvBgNVBAMTKFN0YXJmaWVsZCBTZWN1cmUgQ2VydGlm
+aWNhdGlvbiBBdXRob3JpdHkxKjAoBgkqhkiG9w0BCQEWG3ByYWN0aWNlc0BzdGFy
+ZmllbGR0ZWNoLmNvbTCBnTANBgkqhkiG9w0BAQEFAAOBiwAwgYcCgYEA2xFDa9zR
+aXhZSehudBQIdBFsfrcqqCLYQjx6z59QskaupmcaIyK+D7M0+6yskKpbKMJw9raK
+gCrgm5xS4JGocqAW4cROfREJs5651POyUMRtSAi9vCqXDG2jimo8ms9KNNwe3upa
+JsChooKpSvuGIhKQOrKC1JKRn6lFn8Ok2/sCAQOjggEhMIIBHTAMBgNVHRMEBTAD
+AQH/MAsGA1UdDwQEAwIBBjBKBgNVHR8EQzBBMD+gPaA7hjlodHRwOi8vY2VydGlm
+aWNhdGVzLnN0YXJmaWVsZHRlY2guY29tL3JlcG9zaXRvcnkvcm9vdC5jcmwwTwYD
+VR0gBEgwRjBEBgtghkgBhvhFAQcXAzA1MDMGCCsGAQUFBwIBFidodHRwOi8vd3d3
+LnN0YXJmaWVsZHRlY2guY29tL3JlcG9zaXRvcnkwOQYIKwYBBQUHAQEELTArMCkG
+CCsGAQUFBzABhh1odHRwOi8vb2NzcC5zdGFyZmllbGR0ZWNoLmNvbTAdBgNVHQ4E
+FgQUrFXet+oT6/yYaOJTYB7xJT6M7ucwCQYDVR0jBAIwADANBgkqhkiG9w0BAQUF
+AAOBgQB+HJi+rQONJYXufJCIIiv+J/RCsux/tfxyaAWkfZHvKNF9IDk7eQg3aBhS
+1Y8D0olPHhHR6aV0S/xfZ2WEcYR4WbfWydfXkzXmE6uUPI6TQImMwNfy5wdS0XCP
+mIzroG3RNlOQoI8WMB7ew79/RqWVKvnI3jvbd/TyMrEzYaIwNQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICjjCCAXagAwIBAgIDAQAiMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
+QTAeFw0wMjA3MTIxNjMyMDNaFw0xMjA3MTIxNjMyMDNaMEQxCzAJBgNVBAYTAlBM
+MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xGDAWBgNVBAMTD0NlcnR1bSBM
+ZXZlbCBJSTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyMQSaN5fA94hNE46
+bMKpGUb5yIPEowReGZzGttYBQnC6oUOy+iM3md8WerzXeBKf7iIZEDW2HAp7BKhS
+4rMB6taxT07vDtkNfEKwOk6X7dODw6KY4mxnzjmjh5pf2feKKJ3MoZxi2HAz2a6J
+vHKFMq8dAlGL2GBtLvzlFp2jwkMCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zAN
+BgkqhkiG9w0BAQUFAAOCAQEAWo3wgy+/0B7UiTCu4Wn1rvGRXIUtbPNp4Bc4PP/i
+1q6pPheIe0ooCopuqnDX9maTHhZeNpnApgCUSbyw71EaOremD7HjWXASRUTylhwL
+5FdSx+D6MgF2uW9uwZ+NErkeRJYT2aRXe5FBOVIseC4g93Ay0D8Hg50MkAC5pQqW
++8GSszT94NzT7ppIaMtq53PZpUtLGiL3UBZ5vUJ5pE4lLKD7Ce+pXzZevy/MnkMG
+D1L7LgjRWL17OcMlASFETyUTajNjvxMy+oM4C22rwHRh2WQrvgw5MO+Q3UyYA1r5
+VrSaqgQ1g06ZcQt+mhzoc2swlOSwm8iis8H6orR8xmCWrA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICezCCAeSgAwIBAgICAyAwDQYJKoZIhvcNAQEFBQAwYTELMAkGA1UEBhMCVVMx
+DTALBgNVBAoTBFZJU0ExLzAtBgNVBAsTJlZpc2EgSW50ZXJuYXRpb25hbCBTZXJ2
+aWNlIEFzc29jaWF0aW9uMRIwEAYDVQQDEwlHUCBSb290IDQwHhcNMDAwODE3MDAx
+OTAwWhcNMjAwODE2MjM1OTAwWjBhMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklT
+QTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRp
+b24xEjAQBgNVBAMTCUdQIFJvb3QgNDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
+gYEAuOvwj6Dm8eMAP15ynq4ED/RPzsraYjPq7lrCwfYuOIm0Dc+hrrkxs/2mx7bE
+bIMMgGE4Ogq+HAGgGRvn+3JtkmObpq8z9LRbGugo3kznN/EU8eAX4BRI7EQdeaVO
+quGkhHe9y0226nB+X6oXLEtbsOqF1GmoEekrNx27pgTum0ECAwEAAaNCMEAwHQYD
+VR0OBBYEFEPGSEDAD8YYWklJ5YGABk1f3dSFMA8GA1UdEwEB/wQFMAMBAf8wDgYD
+VR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4GBAKQZPXPOh9GfVhJcyDjl7vkS
+yNkB6p2DNMaia4t3epJ+h8dVIxSNwmhNGfJptOpHFJE7UYcY+nab4nscE9PmZh4K
+ErldkMY7ExQizTWMLUVgAATI71gCxV2ZtJBt3lTXI+I5hCXDaKNio3nYmKFa0lyJ
+/eUWDPSrF0h+reuAwFWB
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
+IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
+BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
+aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
+9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy
+NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
+azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
+YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
+Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
+cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY
+dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9
+WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS
+v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v
+UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu
+IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC
+W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc
+MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP
+bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2
+MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft
+ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg
+Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk
+hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym
+1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW
+OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb
+2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko
+O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw
+AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU
+AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB
+BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF
+Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb
+LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir
+oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C
+MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds
+sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFaDCCBFCgAwIBAgIQO1nHe81bV569N1KsdrSqGjANBgkqhkiG9w0BAQUFADBi
+MRIwEAYDVQQKEwliZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENB
+czEvMC0GA1UEAxMmYmVUUlVTVGVkIFJvb3QgQ0EgLSBSU0EgSW1wbGVtZW50YXRp
+b24wHhcNMDIwNDExMTExODEzWhcNMjIwNDEyMTEwNzI1WjBiMRIwEAYDVQQKEwli
+ZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEvMC0GA1UEAxMm
+YmVUUlVTVGVkIFJvb3QgQ0EgLSBSU0EgSW1wbGVtZW50YXRpb24wggEiMA0GCSqG
+SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkujQwCY5X0LkGLG9uJIAiv11DpvpPrILn
+HGhwhRujbrWqeNluB0s/6d/16uhUoWGKDi9pdRi3DOUUjXFumLhV/AyV0Jtu4S2I
+1DpAa5LxmZZk3tv/ePTulh1HiXzUvrmIdyM6CeYEnm2qXtLIvZpOGd+J6lsOfsPk
+tPDgaTuID0GQ+NRxQyTBjyZLO1bp/4xsN+lFrYWMU8NghpBKlsmzVLC7F/AcRdnU
+GxlkVgoZ98zh/4avflherHqQH8koOUV7orbHnB/ahdQhhlkwk75TMzf270HPM8er
+cmsl9fNTGwxMLvF1S++gh/f+ihXQbNXL+WhTuXAVE8L1LvtDNXUtAgMBAAGjggIY
+MIICFDAMBgNVHRMEBTADAQH/MIIBtQYDVR0gBIIBrDCCAagwggGkBg8rBgEEAbE+
+AAADCSiDkTEwggGPMEEGCCsGAQUFBwIBFjVodHRwOi8vd3d3LmJldHJ1c3RlZC5j
+b20vcHJvZHVjdHNfc2VydmljZXMvaW5kZXguaHRtbDCCAUgGCCsGAQUFBwICMIIB
+OhqCATZSZWxpYW5jZSBvbiBvciB1c2Ugb2YgdGhpcyBDZXJ0aWZpY2F0ZSBjcmVh
+dGVzIGFuIGFja25vd2xlZGdtZW50IGFuZCBhY2NlcHRhbmNlIG9mIHRoZSB0aGVu
+IGFwcGxpY2FibGUgc3RhbmRhcmQgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2YgdXNl
+LCB0aGUgQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQgYW5kIHRoZSBS
+ZWx5aW5nIFBhcnR5IEFncmVlbWVudCwgd2hpY2ggY2FuIGJlIGZvdW5kIGF0IHRo
+ZSBiZVRSVVNUZWQgd2ViIHNpdGUsIGh0dHA6Ly93d3cuYmV0cnVzdGVkLmNvbS9w
+cm9kdWN0c19zZXJ2aWNlcy9pbmRleC5odG1sMAsGA1UdDwQEAwIBBjAfBgNVHSME
+GDAWgBSp7BR++dlDzFMrFK3P9/BZiUHNGTAdBgNVHQ4EFgQUqewUfvnZQ8xTKxSt
+z/fwWYlBzRkwDQYJKoZIhvcNAQEFBQADggEBANuXsHXqDMTBmMpWBcCorSZIry0g
+6IHHtt9DwSwddUvUQo3neqh03GZCWYez9Wlt2ames30cMcH1VOJZJEnl7r05pmuK
+mET7m9cqg5c0Lcd9NUwtNLg+DcTsiCevnpL9UGGCqGAHFFPMZRPB9kdEadIxyKbd
+LrML3kqNWz2rDcI1UqJWN8wyiyiFQpyRQHpwKzg21eFzGh/l+n5f3NacOzDq28Bb
+J1zTcwfBwvNMm2+fG8oeqqg4MwlYsq78B+g23FW6L09A/nq9BqaBwZMifIYRCgZ3
+SK41ty8ymmFei74pnykkiFY5LKjSq5YDWtRIn7lAhAuYaPsBQ9Yb4gmxlxw=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJ
+BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh
+c3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy
+MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp
+emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X
+DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw
+FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMg
+UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo
+YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5
+MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB
+AQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgdk4xWArzZbxpvUjZudVYK
+VdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIqWpDBucSm
+Fc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQID
+AQABMA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0J
+h9ZrbWB85a7FkCMMXErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2ul
+uIncrKTdcu1OofdPvAbT6shkdHvClUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68
+DzFc6PLZ
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV
+UzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL
+EwhEU1RDQSBFMTAeFw05ODEyMTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJ
+BgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x
+ETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCg
+bIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJENySZ
+j9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlV
+Sn5JTe2io74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCG
+SAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx
+JDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI
+RFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMTAxODEw
+MjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFGp5
+fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i
++DAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG
+SIb3DQEBBQUAA4GBACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lN
+QseSJqBcNJo4cvj9axY+IO6CizEqkzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+
+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4RbyhkwS7hp86W0N6w4pl
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx
+FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD
+VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv
+biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy
+dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
+MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB
+MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG
+A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp
+b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl
+cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
+bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE
+VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ
+ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR
+uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
+9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI
+hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM
+pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHdzCCBuCgAwIBAgIBAzANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MDQwNTE0MDA1MloXDTEwMDQwNDE0MDA1
+MlowgbYxCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxFjAUBgNVBAoTDVN0
+YXJ0Q29tIEx0ZC4xIzAhBgNVBAsTGlNlY3VyZSBDZXJ0aWZpY2F0ZSBTaWduaW5n
+MTYwNAYDVQQDEy1TdGFydENvbSBDbGFzcyAyIFByaW1hcnkgSW50ZXJtZWRpYXRl
+IEZyZWUgQ0ExITAfBgkqhkiG9w0BCQEWEmFkbWluQHN0YXJ0Y29tLm9yZzCCASIw
+DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM9KqO2vvJ/MXdWLz48xpPABvm4w
+Ly5ErvWsbwRegyS4EH8YSH7a36ayltChYWgD0CWl3g21KNyT6YfOOtKm0AvD7QeZ
+7EcKHpsc52kDaf58EGact1C5Sq5jSdSghyWWCmrucMDoQXEAlZ0x4rfYqMFUh9Xe
+f5WF1cRVA61DjpmlOTJ+zdbeoVzabixG3086QiuSX/mAeQG3uA5kI+qQEiPWRdWb
+4+9UWr+fYGFxVnyCiRkAwyU4DrzPyd9xaxMHmf+w8buu0PQdxLyX/bS/rrhnzJ3s
+zzLeLCmkNXl7Mvq6n5N47uzOsePrm1KpU7FWpn99hfQm5ULTAEtUaBaVqCcCAwEA
+AaOCBBMwggQPMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgHmMB0GA1UdDgQW
+BBTrYX+p+p5SKTzAwGeqtgjPZpbuMjCB3QYDVR0jBIHVMIHSgBQcicOWzL3+MtUN
+jIExtpidjShkjaGBtqSBszCBsDELMAkGA1UEBhMCSUwxDzANBgNVBAgTBklzcmFl
+bDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xGjAYBgNV
+BAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBGcmVlIFNTTCBDZXJ0aWZp
+Y2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSYWRtaW5Ac3RhcnRjb20u
+b3JnggEAMB0GA1UdEQQWMBSBEmFkbWluQHN0YXJ0Y29tLm9yZzAdBgNVHRIEFjAU
+gRJhZG1pbkBzdGFydGNvbS5vcmcwYgYDVR0fBFswWTApoCegJYYjaHR0cDovL2Nl
+cnQuc3RhcnRjb20ub3JnL2NhLWNybC5jcmwwLKAqoCiGJmh0dHA6Ly9jcmwuc3Rh
+cnRjb20ub3JnL2NybC9jYS1jcmwuY3JsMIIBSgYDVR0gBIIBQTCCAT0wggE5Bgsr
+BgEEAYG1NwEBATCCASgwLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29t
+Lm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFydGNv
+bS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCBvQYIKwYBBQUHAgIwgbAwFBYNU3RhcnRD
+b20gTHRkLjADAgEBGoGXTGltaXRlZCBMaWFiaWxpdHksIHJlYWQgdGhlIHNlY3Rp
+b24gKkxlZ2FsIExpbWl0YXRpb25zKiBvZiB0aGUgU3RhcnRDb20gQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkgUG9saWN5IGF2YWlsYWJsZSBhdCBodHRwOi8vY2VydC5z
+dGFydGNvbS5vcmcvcG9saWN5LnBkZjARBglghkgBhvhCAQEEBAMCAAcwUQYJYIZI
+AYb4QgENBEQWQlN0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUg
+RnJlZSBTU0wgU2VydmVyIENlcnRpZmljYXRlczAyBglghkgBhvhCAQQEJRYjaHR0
+cDovL2NlcnQuc3RhcnRjb20ub3JnL2NhLWNybC5jcmwwMgYJYIZIAYb4QgEDBCUW
+I2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9jYS1jcmwuY3JsMDIGCWCGSAGG+EIB
+CAQlFiNodHRwOi8vY2VydC5zdGFydGNvbS5vcmcvcG9saWN5LnBkZjANBgkqhkiG
+9w0BAQQFAAOBgQA8NeQIlDnlitfSUNdYAkW4cg0zgcoZA/LCfLnzoajdOUUoqj/b
+EFjCKNwiKXX2OduPvt2NtL2EepVrQGZuZq5q1gBA0OSkwOHc5j49EFyKuzkYHD5u
+DbGJwKi/TgHHLMAjX0YwmeXV5ZWbYv6OGlAlkTn2khqXv8JI6gUX+tgmEA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw
+CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl
+cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu
+LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT
+aWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
+dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD
+VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT
+aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ
+bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu
+IENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
+LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1
+GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ
++mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd
+U6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm
+NxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY
+ufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/
+ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1
+CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq
+g6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm
+fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c
+2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/
+bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIGFTCCBX6gAwIBAgIBEDANBgkqhkiG9w0BAQUFADCBvjELMAkGA1UEBhMCVVMx
+EDAOBgNVBAgTB0luZGlhbmExFTATBgNVBAcTDEluZGlhbmFwb2xpczEoMCYGA1UE
+ChMfU29mdHdhcmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDETMBEGA1UECxMKaG9z
+dG1hc3RlcjEgMB4GA1UEAxMXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxJTAjBgkq
+hkiG9w0BCQEWFmhvc3RtYXN0ZXJAc3BpLWluYy5vcmcwHhcNMDYwODE2MjA0NjUy
+WhcNMTYwODEzMjA0NjUyWjCBvDELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB0luZGlh
+bmExFTATBgNVBAcTDEluZGlhbmFwb2xpczEoMCYGA1UEChMfU29mdHdhcmUgaW4g
+dGhlIFB1YmxpYyBJbnRlcmVzdDETMBEGA1UECxMKSG9zdG1hc3RlcjEeMBwGA1UE
+AxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MSUwIwYJKoZIhvcNAQkBFhZob3N0bWFz
+dGVyQHNwaS1pbmMub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA
+uTlCOrOYvCe0Qszlz90rVIQkS2UDa7R+qCTkRE5ipKC+3OZXGgv2EOYk/IOuCE3D
+8+tlTAl8MwvmwOHgL0GWnjoluR95narhNiV9Px8xyL2Z8kctwrWXbEii0Ot48VcN
+IQMDW5GK8Ww5puMKZr8+bXF2HFzkt8gwaCtrojcF4fLGcm3//bR13CKWbOzacANZ
+gAi00pD70ppjJU/uNVOe5HX6x/Id+50G6jwasanEzhteYJdbbHaMqrL4J6XbTwgJ
+ZciB0ifOZkwTBvQiRJpTkTWPyn/HptMbJGOwwiNbcgtWV7QVLW1GB3HYVum47Zwp
+XcXVM4Fs4XLwfx1Ti87LGdAJJYDS5K1F2prHKW5MsmFLJg61Nd6dZPRDLJLaOPEq
+0Jxa1NdfDjJ8rXOIcuLRAozjBui23vUhfOW9z4kpVIg+c+ylV2Oh/7f+fO731P7E
+AqsTFmiU7svcvkm2OKslolpnQ+pqGFLM4laQE/Q0kjogm7LiOpRssBW/ZfZ7pPLZ
+Ru0/AXrgKwQIM8mLazwlD3wHKPRElhIkxSv4qZ95zgJo6ky/7BpzZ/OAlz3BICbN
+WQhW/MBQVFiC6ivhjDq3AzgyykLShB0eIMRN0SBfTy3/aNfIJbqLmTNookXPoSP7
++mg5OVzVBvDv5ZskWSl8kJB1DzJbN+DOr/i8V3Ugl90CAwEAAaOCAZ0wggGZMB0G
+A1UdDgQWBBTON+buqfoMXkWdtvObUS11tnY77DCB6wYDVR0jBIHjMIHggBQHrehB
+HX+91r8bgXo/jEuI3gTS+qGBxKSBwTCBvjELMAkGA1UEBhMCVVMxEDAOBgNVBAgT
+B0luZGlhbmExFTATBgNVBAcTDEluZGlhbmFwb2xpczEoMCYGA1UEChMfU29mdHdh
+cmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDETMBEGA1UECxMKaG9zdG1hc3RlcjEg
+MB4GA1UEAxMXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxJTAjBgkqhkiG9w0BCQEW
+Fmhvc3RtYXN0ZXJAc3BpLWluYy5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zARBglg
+hkgBhvhCAQEEBAMCAQYwCQYDVR0SBAIwADArBglghkgBhvhCAQ0EHhYcVGlueUNB
+IEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAhBgNVHREEGjAYgRZob3N0bWFzdGVyQHNw
+aS1pbmMub3JnMAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQUFAAOBgQA5HQcqwPE/
+RaN8cb8H1G34rkvSEsj4l8UIivMFEWIKnF3SQT8KVcD7j/eJuhMazwRlTs8Rnu6V
+/uTC10w7SS6gELwDqAzR4PiXTzfkW8OJemyQn6JWXKfq2pR1n4fvwEn7htjeNS69
+iFKlFXyE9j2jhGaps1CKHfe1YX0MuwO4Jw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDtTCCAp2gAwIBAgIRANAeQJAAAEZSAAAAAQAAAAQwDQYJKoZIhvcNAQEFBQAw
+gYkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJEQzETMBEGA1UEBxMKV2FzaGluZ3Rv
+bjEXMBUGA1UEChMOQUJBLkVDT00sIElOQy4xGTAXBgNVBAMTEEFCQS5FQ09NIFJv
+b3QgQ0ExJDAiBgkqhkiG9w0BCQEWFWFkbWluQGRpZ3NpZ3RydXN0LmNvbTAeFw05
+OTA3MTIxNzMzNTNaFw0wOTA3MDkxNzMzNTNaMIGJMQswCQYDVQQGEwJVUzELMAkG
+A1UECBMCREMxEzARBgNVBAcTCldhc2hpbmd0b24xFzAVBgNVBAoTDkFCQS5FQ09N
+LCBJTkMuMRkwFwYDVQQDExBBQkEuRUNPTSBSb290IENBMSQwIgYJKoZIhvcNAQkB
+FhVhZG1pbkBkaWdzaWd0cnVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCx0xHgeVVDBwhMywVCAOINg0Y95JO6tgbTDVm9PsHOQ2cBiiGo77zM
+0KLMsFWWU4RmBQDaREmA2FQKpSWGlO1jVv9wbKOhGdJ4vmgqRF4vz8wYXke8OrFG
+PR7wuSw0X4x8TAgpnUBV6zx9g9618PeKgw6hTLQ6pbNfWiKX7BmbwQVo/ea3qZGU
+LOR4SCQaJRk665WcOQqKz0Ky8BzVX/tr7WhWezkscjiw7pOp03t3POtxA6k4ShZs
+iSrK2jMTecJVjO2cu/LLWxD4LmE1xilMKtAqY9FlWbT4zfn0AIS2V0KFnTKo+SpU
++/94Qby9cSj0u5C8/5Y0BONFnqFGKECBAgMBAAGjFjAUMBIGA1UdEwEB/wQIMAYB
+Af8CAQgwDQYJKoZIhvcNAQEFBQADggEBAARvJYbk5pYntNlCwNDJALF/VD6Hsm0k
+qS8Kfv2kRLD4VAe9G52dyntQJHsRW0mjpr8SdNWJt7cvmGQlFLdh6X9ggGvTZOir
+vRrWUfrAtF13Gn9kCF55xgVM8XrdTX3O5kh7VNJhkoHWG9YA8A6eKHegTYjHInYZ
+w8eeG6Z3ePhfm1bR8PIXrI6dWeYf/le22V7hXZ9F7GFoGUHhsiAm/lowdiT/QHI8
+eZ98IkirRs3bs4Ysj78FQdPB4xTjQRcm0HyncUwZ6EoPclgxfexgeqMiKL0ZJGA/
+O4dzwGvky663qyVDslUte6sGDnVdNOVdc22esnVApVnJTzFxiNmIf1Q=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFFjCCBH+gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MDMxNzE3Mzc0OFoXDTM1MDMxMDE3Mzc0
+OFowgbAxCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxDjAMBgNVBAcTBUVp
+bGF0MRYwFAYDVQQKEw1TdGFydENvbSBMdGQuMRowGAYDVQQLExFDQSBBdXRob3Jp
+dHkgRGVwLjEpMCcGA1UEAxMgRnJlZSBTU0wgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
+dHkxITAfBgkqhkiG9w0BCQEWEmFkbWluQHN0YXJ0Y29tLm9yZzCBnzANBgkqhkiG
+9w0BAQEFAAOBjQAwgYkCgYEA7YRgACOeyEpRKSfeOqE5tWmrCbIvNP1h3D3TsM+x
+18LEwrHkllbEvqoUDufMOlDIOmKdw6OsWXuO7lUaHEe+o5c5s7XvIywI6Nivcy+5
+yYPo7QAPyHWlLzRMGOh2iCNJitu27Wjaw7ViKUylS7eYtAkUEKD4/mJ2IhULpNYI
+LzUCAwEAAaOCAjwwggI4MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgHmMB0G
+A1UdDgQWBBQcicOWzL3+MtUNjIExtpidjShkjTCB3QYDVR0jBIHVMIHSgBQcicOW
+zL3+MtUNjIExtpidjShkjaGBtqSBszCBsDELMAkGA1UEBhMCSUwxDzANBgNVBAgT
+BklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4x
+GjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBGcmVlIFNTTCBD
+ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYSYWRtaW5Ac3Rh
+cnRjb20ub3JnggEAMB0GA1UdEQQWMBSBEmFkbWluQHN0YXJ0Y29tLm9yZzAdBgNV
+HRIEFjAUgRJhZG1pbkBzdGFydGNvbS5vcmcwEQYJYIZIAYb4QgEBBAQDAgAHMC8G
+CWCGSAGG+EIBDQQiFiBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAy
+BglghkgBhvhCAQQEJRYjaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL2NhLWNybC5j
+cmwwKAYJYIZIAYb4QgECBBsWGWh0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy8wOQYJ
+YIZIAYb4QgEIBCwWKmh0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9pbmRleC5waHA/
+YXBwPTExMTANBgkqhkiG9w0BAQQFAAOBgQBscSXhnjSRIe/bbL0BCFaPiNhBOlP1
+ct8nV0t2hPdopP7rPwl+KLhX6h/BquL/lp9JmeaylXOWxkjHXo0Hclb4g4+fd68p
+00UOpO6wNnQt8M2YI3s3S9r+UZjEHjQ8iP2ZO1CnwYszx8JSFhKVU2Ui77qLzmLb
+cCOxgN8aIDjnfg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCB
+lTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAbBgNVBAMTFFVUTi1VU0VSRmlyc3Qt
+T2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAzNlowgZUxCzAJBgNV
+BAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxHjAc
+BgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3
+dy51c2VydHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCC
+ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicP
+HxzfOpuCaDDASmEd8S8O+r5596Uj71VRloTN2+O5bj4x2AogZ8f02b+U60cEPgLO
+KqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQw5ujm9M89RKZd7G3CeBo
+5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vulBe3/IW+
+pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehb
+kkj7RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUC
+AwEAAaOBrzCBrDALBgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
+FgQU2u1kdBScFDyr3ZmpvVsoTYs8ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDov
+L2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmlyc3QtT2JqZWN0LmNybDApBgNV
+HSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQwDQYJKoZIhvcN
+AQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw
+NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXB
+mMiKVl0+7kNOPmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU
+4U3GDZlDAQ0Slox4nb9QorFEqmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK5
+81OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCGhU3IfdeLA/5u1fedFqySLKAj5ZyR
+Uh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO
+TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh
+dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy
+MTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVk
+ZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENB
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFtvszn
+ExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw71
+9tV2U02PjLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MO
+hXeiD+EwR+4A5zN9RGcaC1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+U
+tFE5A3+y3qcym7RHjm+0Sq7lr7HcsBthvJly3uSJt3omXdozSVtSnA71iq3DuD3o
+BmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn622r+I/q85Ej0ZytqERAh
+SQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRVHSAAMDww
+OgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMv
+cm9vdC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA
+7Jbg0zTBLL9s+DANBgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k
+/rvuFbQvBgwp8qiSpGEN/KtcCFtREytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzm
+eafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbwMVcoEoJz6TMvplW0C5GUR5z6
+u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3ynGQI0DvDKcWy
+7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR
+iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIG0zCCBbugAwIBAgIBADANBgkqhkiG9w0BAQUFADCBzDELMAkGA1UEBhMCQVQx
+EDAOBgNVBAgTB0F1c3RyaWExDzANBgNVBAcTBlZpZW5uYTE6MDgGA1UEChMxQVJH
+RSBEQVRFTiAtIEF1c3RyaWFuIFNvY2lldHkgZm9yIERhdGEgUHJvdGVjdGlvbjEl
+MCMGA1UECxMcQS1DRVJUIENlcnRpZmljYXRpb24gU2VydmljZTEYMBYGA1UEAxMP
+QS1DRVJUIEFEVkFOQ0VEMR0wGwYJKoZIhvcNAQkBFg5pbmZvQGEtY2VydC5hdDAe
+Fw0wNDEwMjMxNDE0MTRaFw0xMTEwMjMxNDE0MTRaMIHMMQswCQYDVQQGEwJBVDEQ
+MA4GA1UECBMHQXVzdHJpYTEPMA0GA1UEBxMGVmllbm5hMTowOAYDVQQKEzFBUkdF
+IERBVEVOIC0gQXVzdHJpYW4gU29jaWV0eSBmb3IgRGF0YSBQcm90ZWN0aW9uMSUw
+IwYDVQQLExxBLUNFUlQgQ2VydGlmaWNhdGlvbiBTZXJ2aWNlMRgwFgYDVQQDEw9B
+LUNFUlQgQURWQU5DRUQxHTAbBgkqhkiG9w0BCQEWDmluZm9AYS1jZXJ0LmF0MIIB
+IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3euXIy+mnf6BYKbK+QH5k679
+tUFqeT8jlZxMew8eNiHuw9KoxWBzL6KksK+5uK7Gatw+sbAYntEGE80P+Jg1hADM
+e+Fr5V0bc6QS3gkVtfUCW/RIvfMM39oxvmqJmOgPnJU7H6+nmLtsq61tv9kVJi/2
+4Y5wXW3odet72sF57EoG6s78w0BUVLNcMngS9bZZzmdG3/d6JbkGgoNF/8DcgCBJ
+W/t0JrcIzyppXIOVtUzzOrrU86zuUgT3Rtkl5kjG7DEHpFb9H0fTOY1v8+gRoaO6
+2gA0PCiysgVZjwgVeYe3KAg11nznyleDv198uK3Dc1oXIGYjJx2FpKWUvAuAEwID
+AQABo4ICvDCCArgwHQYDVR0OBBYEFDd/Pj6ZcWDKJNSRE3nQdCm0qCTYMIH5BgNV
+HSMEgfEwge6AFDd/Pj6ZcWDKJNSRE3nQdCm0qCTYoYHSpIHPMIHMMQswCQYDVQQG
+EwJBVDEQMA4GA1UECBMHQXVzdHJpYTEPMA0GA1UEBxMGVmllbm5hMTowOAYDVQQK
+EzFBUkdFIERBVEVOIC0gQXVzdHJpYW4gU29jaWV0eSBmb3IgRGF0YSBQcm90ZWN0
+aW9uMSUwIwYDVQQLExxBLUNFUlQgQ2VydGlmaWNhdGlvbiBTZXJ2aWNlMRgwFgYD
+VQQDEw9BLUNFUlQgQURWQU5DRUQxHTAbBgkqhkiG9w0BCQEWDmluZm9AYS1jZXJ0
+LmF0ggEAMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgHmMEcGA1UdJQRAMD4G
+CCsGAQUFBwMBBggrBgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcD
+CAYKKwYBBAGCNwoDBDARBglghkgBhvhCAQEEBAMCAP8wUQYDVR0gBEowSDBGBggq
+KAAYAQEBAzA6MDgGCCsGAQUFBwIBFixodHRwOi8vd3d3LmEtY2VydC5hdC9jZXJ0
+aWZpY2F0ZS1wb2xpY3kuaHRtbDA7BglghkgBhvhCAQgELhYsaHR0cDovL3d3dy5h
+LWNlcnQuYXQvY2VydGlmaWNhdGUtcG9saWN5Lmh0bWwwGQYDVR0RBBIwEIEOaW5m
+b0BhLWNlcnQuYXQwLwYDVR0SBCgwJoEOaW5mb0BhLWNlcnQuYXSGFGh0dHA6Ly93
+d3cuYS1jZXJ0LmF0MEUGA1UdHwQ+MDwwOqA4oDaGNGh0dHBzOi8vc2VjdXJlLmEt
+Y2VydC5hdC9jZ2ktYmluL2EtY2VydC1hZHZhbmNlZC5jZ2kwDQYJKoZIhvcNAQEF
+BQADggEBACX1IvgfdG2rvfv35O48vSEvcVaEdlN8USFBHWz3JRAozgzvaBtwHkjK
+Zwt5l/BWOtjbvHfRjDt7ijlBEcxOOrNC1ffyMHwHrXpvff6YpQ5wnxmIYEQcURiG
+HMqruEX0WkuDNgSKwefsgXs27eeBauHgNGVcTYH1rmHu/ZyLpLxOyJQ2PCzA1DzW
+3rWkIX92ogJ7lTRdWrbxwUL1XGinxnnaQ74+/y0pI9JNEv7ic2tpkweRMpkedaLW
+msC1+orfKTebsg69aMaCx7o6jNONRmR/7TVaPf8/k6g52cHZ9YWjQvup22b5rWxG
+J5r5LZ4vCPmF4+T4lutjUYAa/lGuQTg=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEgzCCA+ygAwIBAgIEOJ725DANBgkqhkiG9w0BAQQFADCBtDEUMBIGA1UEChML
+RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9HQ0NBX0NQUyBp
+bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAyMDAw
+IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENsaWVu
+dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMDAyMDcxNjE2NDBaFw0yMDAy
+MDcxNjQ2NDBaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3
+LmVudHJ1c3QubmV0L0dDQ0FfQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp
+YWIuKTElMCMGA1UECxMcKGMpIDIwMDAgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG
+A1UEAxMqRW50cnVzdC5uZXQgQ2xpZW50IENlcnRpZmljYXRpb24gQXV0aG9yaXR5
+MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCTdLS25MVL1qFof2LV7PdRV7Ny
+Spj10InJrWPNTTVRaoTUrcloeW+46xHbh65cJFET8VQlhK8pK5/jgOLZy93GRUk0
+iJBeAZfv6lOm3fzB3ksqJeTpNfpVBQbliXrqpBFXO/x8PTbNZzVtpKklWb1m9fkn
+5JVn1j+SgF7yNH0rhQIDAQABo4IBnjCCAZowEQYJYIZIAYb4QgEBBAQDAgAHMIHd
+BgNVHR8EgdUwgdIwgc+ggcyggcmkgcYwgcMxFDASBgNVBAoTC0VudHJ1c3QubmV0
+MUAwPgYDVQQLFDd3d3cuZW50cnVzdC5uZXQvR0NDQV9DUFMgaW5jb3JwLiBieSBy
+ZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMjAwMCBFbnRydXN0Lm5l
+dCBMaW1pdGVkMTMwMQYDVQQDEypFbnRydXN0Lm5ldCBDbGllbnQgQ2VydGlmaWNh
+dGlvbiBBdXRob3JpdHkxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMjAwMDAy
+MDcxNjE2NDBagQ8yMDIwMDIwNzE2NDY0MFowCwYDVR0PBAQDAgEGMB8GA1UdIwQY
+MBaAFISLdP3FjcD/J20gN0V8/i3OutN9MB0GA1UdDgQWBBSEi3T9xY3A/ydtIDdF
+fP4tzrrTfTAMBgNVHRMEBTADAQH/MB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4w
+AwIEkDANBgkqhkiG9w0BAQQFAAOBgQBObzWAO9GK9Q6nIMstZVXQkvTnhLUGJoMS
+hAusO7JE7r3PQNsgDrpuFOow4DtifH+La3xKp9U1PL6oXOpLu5OOgGarDyn9TS2/
+GpsKkMWr2tGzhtQvJFJcem3G8v7lTRowjJDyutdKPkN+1MhQGof4T4HHdguEOnKd
+zmVml64mXg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJE
+SzEVMBMGA1UEChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQg
+Um9vdCBDQTAeFw0wMTA0MDUxNjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNV
+BAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJuZXQxHTAbBgNVBAsTFFREQyBJbnRl
+cm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxLhA
+vJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20jxsNu
+Zp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a
+0vnRrEvLznWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc1
+4izbSysseLlJ28TQx5yc5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGN
+eGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcD
+R0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZIAYb4QgEBBAQDAgAHMGUG
+A1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMMVERDIElu
+dGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxME
+Q1JMMTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3
+WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAw
+HQYDVR0OBBYEFGxkAcf9hW2syNqeUAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJ
+KoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4IBAQBO
+Q8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540mgwV5dOy0uaOX
+wTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+
+2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm89
+9qNLPg7kbWzbO0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0
+jUNAE4z9mQNUecYu6oah9jrUCbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38
+aQNiuJkFBT1reBK9sG9l
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDYzCCAkugAwIBAgIQCgEBAQAAAnwAAAACAAAAAjANBgkqhkiG9w0BAQUFADA7
+MSEwHwYDVQQKExhYY2VydCBJbnRlcm5hdGlvbmFsIEluYy4xFjAUBgNVBAsTDVhj
+ZXJ0IFJvb3QgQ0EwHhcNMDAwODE4MTgxODE3WhcNMjUwODE1MTkwMzE3WjA7MSEw
+HwYDVQQKExhYY2VydCBJbnRlcm5hdGlvbmFsIEluYy4xFjAUBgNVBAsTDVhjZXJ0
+IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCotGGLHRw+
+kHtwMkBtjRbKNWFhteL7Fcn0IV6BG88inKyru2DQoDPeEVMaCQ87GhOp1IfMWPct
+Uqmiwqk67c80naEC77jyuCtXiBCTtak1Y7sFQkMif79wXtMopVUoIEuTSY+nvz1A
+KA0Rr3ImCQU0CcWrAZNXoaxmVJginCPrugxknLY9++LGlsLPC0/qyDD6iivKHBGW
+GikAjOty1FFFqZ13INUSu7XyfwY4gk19kh7o1frIKUdpGhURjK+mLMEo9GlbaZ7k
+PBPuwKFg6kG/wmJLbaI3hDo+87AyroprbBPzOiEKe5ZYMylebqjKaaK+jgZFXfFm
+OVVKHFoksUvRAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD
+AgEGMB8GA1UdIwQYMBaAFESoSTh1MWyrKOdx8tjUyK9BD0eRMB0GA1UdDgQWBBRE
+qEk4dTFsqyjncfLY1MivQQ9HkTANBgkqhkiG9w0BAQUFAAOCAQEAPXNepQq7tRHD
+8WfREhqiRykRTE5ZNyCGCUDyRfFJeTkaPSXXLynQCAUVFPvkRGw/fl61UtiRWDyW
++9RK7/EuwVYeTGkM2WAdSkcntQMz2xi721OeoXtRapDTpRXIggvAtzcydYVUXlUQ
+fJE7qStgxjF2rMQwSQPEtlZApfBjr2lKiK/XqwvuOtu9E4OoO6LpuUX1UU2U8Fmp
+26E3Z9IUnqd71xmqFSNraXXREz5Y9PMB6IjElFbJwP7fT0dVH2uBTlTtE19y/CaG
+BDaPTxJNnFDiTlpWrLn9LB9YewUSB2M47xnj9DyRWqIlYle8xpSgd5zPNGLgv/t1
+POkbJhucZA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJ
+BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVy
+aVNpZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24s
+IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNp
+Z24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
+eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJBgNV
+BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp
+Z24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIElu
+Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24g
+Q2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt
+IEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwoNwtUs22e5LeWU
+J92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6tW8UvxDO
+JxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUY
+wZF7C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9o
+koqQHgiBVrKtaaNS0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjN
+qWm6o+sdDZykIKbBoMXRRkwXbdKsZj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/E
+Srg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0JhU8wI1NQ0kdvekhktdmnLfe
+xbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf0xwLRtxyID+u
+7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU
+sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RI
+sH/7NiXaldDxJBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTP
+cjnhsUPgKM+351psE2tJs//jGHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEZDCCA0ygAwIBAgIQRL4Mi1AAJLQR0zYwS8AzdzANBgkqhkiG9w0BAQUFADCB
+ozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VSRmlyc3Qt
+TmV0d29yayBBcHBsaWNhdGlvbnMwHhcNOTkwNzA5MTg0ODM5WhcNMTkwNzA5MTg1
+NzQ5WjCBozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0
+IExha2UgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYD
+VQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VS
+Rmlyc3QtTmV0d29yayBBcHBsaWNhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IB
+DwAwggEKAoIBAQCz+5Gh5DZVhawGNFugmliy+LUPBXeDrjKxdpJo7CNKyXY/45y2
+N3kDuatpjQclthln5LAbGHNhSuh+zdMvZOOmfAz6F4CjDUeJT1FxL+78P/m4FoCH
+iZMlIJpDgmkkdihZNaEdwH+DBmQWICzTSaSFtMBhf1EI+GgVkYDLpdXuOzr0hARe
+YFmnjDRy7rh4xdE7EkpvfmUnuaRVxblvQ6TFHSyZwFKkeEwVs0CYCGtDxgGwenv1
+axwiP8vv/6jQOkt2FZ7S0cYu49tXGzKiuG/ohqY/cKvlcJKrRB5AUPuco2LkbG6g
+yN7igEL66S/ozjIEj3yNtxyjNTwV3Z7DrpelAgMBAAGjgZEwgY4wCwYDVR0PBAQD
+AgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPqGydvguul49Uuo1hXf8NPh
+ahQ8ME8GA1UdHwRIMEYwRKBCoECGPmh0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9V
+VE4tVVNFUkZpcnN0LU5ldHdvcmtBcHBsaWNhdGlvbnMuY3JsMA0GCSqGSIb3DQEB
+BQUAA4IBAQCk8yXM0dSRgyLQzDKrm5ZONJFUICU0YV8qAhXhi6r/fWRRzwr/vH3Y
+IWp4yy9Rb/hCHTO967V7lMPDqaAt39EpHx3+jz+7qEUqf9FuVSTiuwL7MT++6Lzs
+QCv4AdRWOOTKRIK1YSAhZ2X28AvnNPilwpyjXEAfhZOVBt5P1CeptqX8Fs1zMT+4
+ZSfP1FMa8Kxun08FDAOBp4QpxFq9ZFdyrTvPNximmMatBrTcCKME1SmklpoSZ0qM
+YEWd8SOasACcaLWYUNPvji6SZbFIPiG+FTAqDbUMo2s/rn9X9R+WfN9v3YIwLGUb
+QErNaLly7HF27FSOH4UMAWr6pjisH8SE
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEBDCCAuygAwIBAgICAIUwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNVBAYTAlVT
+MScwJQYDVQQKEx5BbWVyaWNhbiBFeHByZXNzIENvbXBhbnksIEluYy4xJjAkBgNV
+BAsTHUFtZXJpY2FuIEV4cHJlc3MgVGVjaG5vbG9naWVzMTYwNAYDVQQDEy1BbWVy
+aWNhbiBFeHByZXNzIEdsb2JhbCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNOTgw
+ODE0MTkwNjAwWhcNMTMwODE0MjM1OTAwWjCBljELMAkGA1UEBhMCVVMxJzAlBgNV
+BAoTHkFtZXJpY2FuIEV4cHJlc3MgQ29tcGFueSwgSW5jLjEmMCQGA1UECxMdQW1l
+cmljYW4gRXhwcmVzcyBUZWNobm9sb2dpZXMxNjA0BgNVBAMTLUFtZXJpY2FuIEV4
+cHJlc3MgR2xvYmFsIENlcnRpZmljYXRlIEF1dGhvcml0eTCCASIwDQYJKoZIhvcN
+AQEBBQADggEPADCCAQoCggEBAPAkJmYu++tKc3FTiUfLJjxTkpRMysKFtQ34w1e9
+Lyofahi3V68MABb6oLaQpvcaoS5mJsdoo4qTaWa1RlYtHYLqkAwKIsKJUI0F89Sr
+c0HwzxKsKLRvFJSWWUuekHWG3+JH6+HpT0N+h8onGGaetcFAZX38YW+tm3LPqV7Y
+8/nabpEQ+ky16n4g3qk5L/WI5IpvNcYgnCuGRjMK/DFVpWusFkDpzTVZbzIEw3u1
+D3t3cPNIuypSgs6vKW3xEW9t5gcAAe+a8yYNpnkTZ6/4qxx1rJG1a75AsN6cDLFp
+hRlxkRNFyt/R/eayypaDedvFuKpbepALeFY+xteflEgR9a0CAwEAAaNaMFgwEgYD
+VR0TAQH/BAgwBgEB/wIBBTAOBgNVHQ8BAf8EBAMCAQYwFwYDVR0gBBAwDjAMBgoq
+hkiG+Q8KAQUBMBkGA1UdDgQSBBBXRzV7NicRqAj8L0Yl6yRpMA0GCSqGSIb3DQEB
+BQUAA4IBAQDHYUWoinG5vjTpIXshzVYTmNUwY+kYqkuSFb8LHbvskmnFLsNhi+gw
+RcsQRsFzOFyLGdIr80DrfHKzLh4n43WVihybLsSVBYZy0FX0oZJSeVzb9Pjc5dcS
+sUDHPIbkMWVKyjfG3nZXGWlMRmn8Kq0WN3qTrPchSy3766lQy8HRQAjaA2mHpzde
+VcHF7cTjjgwml5tcV0ty4/IDBdACOyYDQJCevgtbSQx48dVMVSng9v1MA6lUAjLR
+V1qFrEPtWzsWX6C/NdtLnnvo/+cNPDuom0lBRvVzTv+SZSGDE1Vx60k8f4gawhIo
+JaFGS0E3l3/sjvHUoZbCILZerakcHhGg
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx
+FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD
+VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv
+biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm
+MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx
+MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT
+DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3
+dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl
+cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3
+DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91
+yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX
+L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj
+EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG
+7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e
+QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ
+qdq5snUb9kLy78fyGPmJvKP/iiMucEc=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDrDCCApSgAwIBAgILAgAAAAAA1ni4N88wDQYJKoZIhvcNAQEEBQAwVzELMAkG
+A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
+b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MTUxMjAw
+MDBaFw0wOTAxMjgxMjAwMDBaMG0xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
+YWxTaWduIG52LXNhMRswGQYDVQQLExJQcmltYXJ5IENsYXNzIDEgQ0ExJjAkBgNV
+BAMTHUdsb2JhbFNpZ24gUHJpbWFyeSBDbGFzcyAxIENBMIIBIjANBgkqhkiG9w0B
+AQEFAAOCAQ8AMIIBCgKCAQEAvSA1R9Eo1gijEjkjRw29cCFSDlcxlaY0V2vsfkN5
+wwZSSM28taGZvdgfMrzP125ybS53IpCCTkuPmgwBQprZcFm2nR/mY9EMrR1O+IWB
++a7vn6ZSYUR5GnVF4GFWRW1CjD1yy6akErea9dZg0GBQs46mpuy09BLNf6jO77Ph
+hTD+csTm53eznlhB1lGDiAfGtmlPNt7RC0g/vdafIXRkbycGPkv9Dqabv6RIV4yQ
+7okYCwKBGL5n/lNgiCe6o3M0S1pWtN5zBe2Yll3sSudA/EsJYuvQ4zFPhdF6q1ln
+K/uID+uqg701/WEn7GYOQlf3acIM7/xqwm5J2o9BOK5IqQIDAQABo2MwYTAOBgNV
+HQ8BAf8EBAMCAAYwHQYDVR0OBBYEFPzgZvZaNZnrQB7SuB5DvJiOH4rDMB8GA1Ud
+IwQYMBaAFGB7ZhpFDZfKiVAvfQTNNKj//P1LMA8GA1UdEwEB/wQFMAMBAf8wDQYJ
+KoZIhvcNAQEEBQADggEBAJujCETO8pCdcfMyswVqterPKZjeVT6gFn0GekTWr9L6
+E1iM+BzHqx20G+9paJhcCDmP4Pf7SMwh57gz2wWqNCRsSuXpe2Deg7MfCr5BdfzM
+MEi3wSYdBDOqtnjtKsu6VpcybvcxlS5G8hTuJ8f3Yom5XFrTOIpk9Te08bM0ctXV
+IT1L13iT1zFmNR6j2EdJbxyt4YB/+JgkbHOsDsIadwKjJge3x2tdvILVKkgdY89Q
+Mqb7HBhHFQpbDFw4JJoEmKgISF98NIdjqy2NTAB3lBt2uvUWGKMVry+U9ikAdsEV
+F9PpN0121MtLKVkkrNpKoOpj3l9Usfrz0UXLxWS0cyE=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU
+MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
+b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw
+MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML
+QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD
+VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul
+CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n
+tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl
+dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch
+PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC
++Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O
+BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E
+BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl
+MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk
+ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB
+IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X
+7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz
+43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY
+eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl
+pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA
+WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIGCDCCA/CgAwIBAgIBATANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
+IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
+IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
+Y2FjZXJ0Lm9yZzAeFw0wNTEwMTQwNzM2NTVaFw0zMzAzMjgwNzM2NTVaMFQxFDAS
+BgNVBAoTC0NBY2VydCBJbmMuMR4wHAYDVQQLExVodHRwOi8vd3d3LkNBY2VydC5v
+cmcxHDAaBgNVBAMTE0NBY2VydCBDbGFzcyAzIFJvb3QwggIiMA0GCSqGSIb3DQEB
+AQUAA4ICDwAwggIKAoICAQCrSTURSHzSJn5TlM9Dqd0o10Iqi/OHeBlYfA+e2ol9
+4fvrcpANdKGWZKufoCSZc9riVXbHF3v1BKxGuMO+f2SNEGwk82GcwPKQ+lHm9WkB
+Y8MPVuJKQs/iRIwlKKjFeQl9RrmK8+nzNCkIReQcn8uUBByBqBSzmGXEQ+xOgo0J
+0b2qW42S0OzekMV/CsLj6+YxWl50PpczWejDAz1gM7/30W9HxM3uYoNSbi4ImqTZ
+FRiRpoWSR7CuSOtttyHshRpocjWr//AQXcD0lKdq1TuSfkyQBX6TwSyLpI5idBVx
+bgtxA+qvFTia1NIFcm+M+SvrWnIl+TlG43IbPgTDZCciECqKT1inA62+tC4T7V2q
+SNfVfdQqe1z6RgRQ5MwOQluM7dvyz/yWk+DbETZUYjQ4jwxgmzuXVjit89Jbi6Bb
+6k6WuHzX1aCGcEDTkSm3ojyt9Yy7zxqSiuQ0e8DYbF/pCsLDpyCaWt8sXVJcukfV
+m+8kKHA4IC/VfynAskEDaJLM4JzMl0tF7zoQCqtwOpiVcK01seqFK6QcgCExqa5g
+eoAmSAC4AcCTY1UikTxW56/bOiXzjzFU6iaLgVn5odFTEcV7nQP2dBHgbbEsPyyG
+kZlxmqZ3izRg0RS0LKydr4wQ05/EavhvE/xzWfdmQnQeiuP43NJvmJzLR5iVQAX7
+6QIDAQABo4G/MIG8MA8GA1UdEwEB/wQFMAMBAf8wXQYIKwYBBQUHAQEEUTBPMCMG
+CCsGAQUFBzABhhdodHRwOi8vb2NzcC5DQWNlcnQub3JnLzAoBggrBgEFBQcwAoYc
+aHR0cDovL3d3dy5DQWNlcnQub3JnL2NhLmNydDBKBgNVHSAEQzBBMD8GCCsGAQQB
+gZBKMDMwMQYIKwYBBQUHAgEWJWh0dHA6Ly93d3cuQ0FjZXJ0Lm9yZy9pbmRleC5w
+aHA/aWQ9MTAwDQYJKoZIhvcNAQEEBQADggIBAH8IiKHaGlBJ2on7oQhy84r3HsQ6
+tHlbIDCxRd7CXdNlafHCXVRUPIVfuXtCkcKZ/RtRm6tGpaEQU55tiKxzbiwzpvD0
+nuB1wT6IRanhZkP+VlrRekF490DaSjrxC1uluxYG5sLnk7mFTZdPsR44Q4Dvmw2M
+77inYACHV30eRBzLI++bPJmdr7UpHEV5FpZNJ23xHGzDwlVks7wU4vOkHx4y/CcV
+Bc/dLq4+gmF78CEQGPZE6lM5+dzQmiDgxrvgu1pPxJnIB721vaLbLmINQjRBvP+L
+ivVRIqqIMADisNS8vmW61QNXeZvo3MhN+FDtkaVSKKKs+zZYPumUK5FQhxvWXtaM
+zPcPEAxSTtAWYeXlCmy/F8dyRlecmPVsYGN6b165Ti/Iubm7aoW8mA3t+T6XhDSU
+rgCvoeXnkm5OvfPi2RSLXNLrAWygF6UtEOucekq9ve7O/e0iQKtwOIj1CodqwqsF
+YMlIBdpTwd5Ed2qz8zw87YC8pjhKKSRf/lk7myV6VmMAZLldpGJ9VzZPrYPvH5JT
+oI53V93lYRE9IwCQTDz6o2CTBKOvNfYOao9PSmCnhQVsRqGP9Md246FZV/dxssRu
+FFxtbUFm3xuTsdQAw+7Lzzw9IYCpX2Nl/N3gX6T0K/CFcUHUZyX7GrGXrtaZghNB
+0m6lG5kngOcLqagA
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBk
+MQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0
+YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg
+Q0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4MTgyMjA2MjBaMGQxCzAJBgNVBAYT
+AmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp
+Y2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIICIjAN
+BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9
+m2BtRsiMMW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdih
+FvkcxC7mlSpnzNApbjyFNDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/
+TilftKaNXXsLmREDA/7n29uj/x2lzZAeAR81sH8A25Bvxn570e56eqeqDFdvpG3F
+EzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkCb6dJtDZd0KTeByy2dbco
+kdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn7uHbHaBu
+HYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNF
+vJbNcA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo
+19AOeCMgkckkKmUpWyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjC
+L3UcPX7ape8eYIVpQtPM+GP+HkM5haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJW
+bjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNYMUJDLXT5xp6mig/p/r+D5kNX
+JLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw
+FDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j
+BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzc
+K6FptWfUjNP9MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzf
+ky9NfEBWMXrrpA9gzXrzvsMnjgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7Ik
+Vh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQMbFamIp1TpBcahQq4FJHgmDmHtqB
+sfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4HVtA4oJVwIHaM190e
+3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtlvrsR
+ls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ip
+mXeascClOS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HH
+b6D0jqTsNFFbjCYDcKF31QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksf
+rK/7DZBaZmBwXarNeNQk7shBoJMBkpxqnvy5JMWzFYJ+vq6VK+uxwNrjAWALXmms
+hFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCyx/yP2FS1k2Kdzs9Z+z0Y
+zirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMWNY6E0F/6
+MBr1mmz0DlP5OlvRHA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHcDCCBtmgAwIBAgIBCTANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MDQwNTE0NTEwM1oXDTEwMDQwNDE0NTEw
+M1owga8xCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxFjAUBgNVBAoTDVN0
+YXJ0Q29tIEx0ZC4xIzAhBgNVBAsTGlNlY3VyZSBDZXJ0aWZpY2F0ZSBTaWduaW5n
+MS8wLQYDVQQDEyZTdGFydENvbSBDbGFzcyAyIFByaW1hcnkgRW1haWwgRnJlZSBD
+QTEhMB8GCSqGSIb3DQEJARYSYWRtaW5Ac3RhcnRjb20ub3JnMIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEA45jvm2fdiGII6w1dCf3/hZ+k2tfwcshSUFMu
+sa0wg29xgnTc2Wv2QnI4XlnyD7Yb1mD7M3yJYYESmXftuCNh15rerQBo727Jk4wt
+rSvO2MV6jtTDwCN0OZaRolBTVzqr06iJ45PpN/gy8cwaq1udo4vde/Pijpecf4ST
+2HzM+BiCJTDa0gXS54trJMaIicd1Yzl5gyjPs6dWVR4i6sPB5PgL1XVO3CmWeFZn
+tuKVy43jDf/yGd2qvKqp+VsIyUtlaf7W5pPbV3XZx2mME5qq2DqGqJNjhLj7BUCY
+asCI49DdnnviCWOFQp/l6HPun3G2xv6aO8zUjjI8/z++MpmhFQIDAQABo4IEEzCC
+BA8wDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAeYwHQYDVR0OBBYEFLhmvXuj
+CLqKtLL5RIhxT6WLQbNRMIHdBgNVHSMEgdUwgdKAFByJw5bMvf4y1Q2MgTG2mJ2N
+KGSNoYG2pIGzMIGwMQswCQYDVQQGEwJJTDEPMA0GA1UECBMGSXNyYWVsMQ4wDAYD
+VQQHEwVFaWxhdDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEaMBgGA1UECxMRQ0Eg
+QXV0aG9yaXR5IERlcC4xKTAnBgNVBAMTIEZyZWUgU1NMIENlcnRpZmljYXRpb24g
+QXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJhZG1pbkBzdGFydGNvbS5vcmeCAQAw
+HQYDVR0RBBYwFIESYWRtaW5Ac3RhcnRjb20ub3JnMB0GA1UdEgQWMBSBEmFkbWlu
+QHN0YXJ0Y29tLm9yZzBiBgNVHR8EWzBZMCmgJ6AlhiNodHRwOi8vY2VydC5zdGFy
+dGNvbS5vcmcvY2EtY3JsLmNybDAsoCqgKIYmaHR0cDovL2NybC5zdGFydGNvbS5v
+cmcvY3JsL2NhLWNybC5jcmwwggFKBgNVHSAEggFBMIIBPTCCATkGCysGAQQBgbU3
+AQEBMIIBKDAvBggrBgEFBQcCARYjaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3Bv
+bGljeS5wZGYwNQYIKwYBBQUHAgEWKWh0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9p
+bnRlcm1lZGlhdGUucGRmMIG9BggrBgEFBQcCAjCBsDAUFg1TdGFydENvbSBMdGQu
+MAMCAQEagZdMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUgc2VjdGlvbiAqTGVn
+YWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0aW9uIEF1
+dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly9jZXJ0LnN0YXJ0Y29t
+Lm9yZy9wb2xpY3kucGRmMBEGCWCGSAGG+EIBAQQEAwIABzBQBglghkgBhvhCAQ0E
+QxZBU3RhcnRDb20gQ2xhc3MgMiBQcmltYXJ5IEludGVybWVkaWF0ZSBGcmVlIFNT
+TCBFbWFpbCBDZXJ0aWZpY2F0ZXMwMgYJYIZIAYb4QgEEBCUWI2h0dHA6Ly9jZXJ0
+LnN0YXJ0Y29tLm9yZy9jYS1jcmwuY3JsMDMGCWCGSAGG+EIBAwQmFiRodHRwOi8v
+Y2VydC5zdGFydGNvbS5vcmcvY3J0LWNybC5jcmwwMgYJYIZIAYb4QgEIBCUWI2h0
+dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMA0GCSqGSIb3DQEBBAUA
+A4GBAOyz0ooXH9sKJ9iMBBOYG1GgcWx1HllDWeVqBcqjIn4jCZ0Z2JioAp5oN+NP
+ptNcd9C8rySnnFKjPQg9ylLDO1jtQq3KWAnCmW7Wrq+OPgEYHrbWwPrSrOKsCEtK
+rGakGCOXwcwwyiIzbwMIuyyGKGWDvAbs6L+s8i5Hx1rCJoN6
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW
+MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy
+c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE
+BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0
+IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV
+VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8
+cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT
+QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh
+F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v
+c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w
+mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd
+VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX
+teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ
+f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe
+Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+
+nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB
+/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY
+MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG
+9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
+aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX
+IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn
+ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z
+uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN
+Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja
+QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW
+koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9
+ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt
+DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm
+bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc
+MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT
+ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw
+MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j
+LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ
+KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo
+RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu
+WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw
+Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD
+AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK
+eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM
+zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+
+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN
+/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICBDCCAW0CEAoBAQEAAAJ8AAAABQAAAAIwDQYJKoZIhvcNAQEFBQAwQzEhMB8G
+A1UEChMYWGNlcnQgSW50ZXJuYXRpb25hbCBJbmMuMR4wHAYDVQQLExVYY2VydCBS
+b290IENBIHYxIDEwMjQwHhcNMDAwODE4MTg1MDU2WhcNMjUwODE1MTkwMTA4WjBD
+MSEwHwYDVQQKExhYY2VydCBJbnRlcm5hdGlvbmFsIEluYy4xHjAcBgNVBAsTFVhj
+ZXJ0IFJvb3QgQ0EgdjEgMTAyNDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA
+pwnD0qmmGXDsKelFezbg6j7JmXBA0bZg9N0jx1l5nR6lvjVjAObALmxAU+bRdkbx
+oMuDRVSYGc97mjj4dDMzP6klICgmXShxRoYgPTArq+ZN+j/qREBM+3PU3JZ09E7k
+ah0bl6B8MOHAc7YNond68Rj4SnFxnviodf5i+Ko9z30CAwEAATANBgkqhkiG9w0B
+AQUFAAOBgQB709VMf0yifnzXVmHZlZiFitdJ3IxHqgfsuNt5JJ7npZJXZgmPFLD+
+BPK9URC4OMOhEtuQg361Y1irM62XHkZQQhCsyKstHTVsxuZDUCgDoaz7EZX/6dVK
+D5HlA+SIMDwcdtGX8ArUh6AMmo9hztp+crM7UMCAhA8hIJRoKtqMvg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDAjCCAmsCEDKIjprS9esTR/h/xCA3JfgwDQYJKoZIhvcNAQEFBQAwgcExCzAJ
+BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh
+c3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy
+MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp
+emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X
+DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw
+FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMg
+UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo
+YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5
+MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB
+AQUAA4GNADCBiQKBgQC68OTP+cSuhVS5B1f5j8V/aBH4xBewRNzjMHPVKmIquNDM
+HO0oW369atyzkSTKQWI8/AIBvxwWMZQFl3Zuoq29YRdsTjCG8FE3KlDHqGKB3FtK
+qsGgtG7rL+VXxbErQHDbWk2hjh+9Ax/YA9SPTJlxvOKCzFjomDqG04Y48wApHwID
+AQABMA0GCSqGSIb3DQEBBQUAA4GBAIWMEsGnuVAVess+rLhDityq3RS6iYF+ATwj
+cSGIL4LcY/oCRaxFWdcqWERbt5+BO5JoPeI3JPV7bI92NZYJqFmduc4jq3TWg/0y
+cyfYaT5DdPauxYma51N86Xv2S/PBZYPejYqcPIiNOVn8qj8ijaHBZlCBckztImRP
+T8qAkbYp
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
+VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
+ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
+KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u
+ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1
+MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE
+ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j
+b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF
+bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg
+U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA
+A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/
+I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3
+wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC
+AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb
+oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5
+BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p
+dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk
+MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp
+b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu
+dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
+MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
+E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
+MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
+hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
+95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
+2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw
+CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns
+YXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH
+MjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y
+aXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe
+Fw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX
+MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj
+IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx
+KGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s
+eTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B
+AQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM
+HiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw
+DqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC
+AwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji
+nb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX
+rXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn
+jBJ7xUS0rg==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn
+MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL
+ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg
+b2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAxNjEzNDNaFw0zNzA5MzAxNjEzNDRa
+MH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZpcm1hIFNBIENJRiBB
+ODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3JnMSIw
+IAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0B
+AQEFAAOCAQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtb
+unXF/KGIJPov7coISjlUxFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0d
+BmpAPrMMhe5cG3nCYsS4No41XQEMIwRHNaqbYE6gZj3LJgqcQKH0XZi/caulAGgq
+7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jWDA+wWFjbw2Y3npuRVDM3
+0pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFVd9oKDMyX
+roDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIG
+A1UdEwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5j
+aGFtYmVyc2lnbi5vcmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p
+26EpW1eLTXYGduHRooowDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIA
+BzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hhbWJlcnNpZ24ub3JnMCcGA1Ud
+EgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYDVR0gBFEwTzBN
+BgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz
+aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB
+AAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd
+p0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi
+1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc
+XCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0
+eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu
+tGWaIZDgqtCYvDi1czyL+Nw=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICUDCCAbkCAgGXMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNVBAYTAlVTMRgwFgYD
+VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
+bHV0aW9ucywgSW5jLjEeMBwGA1UEAxMVR1RFIEN5YmVyVHJ1c3QgUm9vdCAzMB4X
+DTk4MDgxMDE5NTkwOFoXDTA4MDgxMDE5MzYzOVowcDELMAkGA1UEBhMCVVMxGDAW
+BgNVBAoTD0dURSBDb3Jwb3JhdGlvbjEnMCUGA1UECxMeR1RFIEN5YmVyVHJ1c3Qg
+U29sdXRpb25zLCBJbmMuMR4wHAYDVQQDExVHVEUgQ3liZXJUcnVzdCBSb290IDMw
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOHzsSsLztwU2TSXYlASVmOETFP6
+wIXP+sHdD955E39T+6oOYN3iYr/G7k6ZNKpoQzWZ+KP982O9AVRqnrI6lix7eCjG
+WrWNGhUY/eOMLqJQCVtx1g21GB8ZjgQpk5N4q18U53NC8gMMV6IbUDsLu1ngoDoD
+7icbWky5sAjKuRqJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAheutlCAG6bKiazvy
+ZuvjS7gSJgXl9JGo3IfcmPSUwfRhvdWcbFFzlV7QvdfmRdw8z0aE1ee57ORnY24A
+KHdxXUoF6bl8hszCRLveKUja6t29F58dUQGo6BResVf3/9qPzpX+Le0yEnf/fGph
+la4xcgYI8PnzDY7i76hTXZEDg94=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIRIjCCCQoCAQAwDQYJKoZIhvcNAQEFBQAwVzEPMA0GA1UEChMGVGhhd3RlMSEw
+HwYDVQQLExhUaGF3dGUgVW5pdmVyc2FsIENBIFJvb3QxITAfBgNVBAMTGFRoYXd0
+ZSBVbml2ZXJzYWwgQ0EgUm9vdDAeFw05OTEyMDUxMzU2MDVaFw0zNzA0MDMxMzU2
+MDVaMFcxDzANBgNVBAoTBlRoYXd0ZTEhMB8GA1UECxMYVGhhd3RlIFVuaXZlcnNh
+bCBDQSBSb290MSEwHwYDVQQDExhUaGF3dGUgVW5pdmVyc2FsIENBIFJvb3Qwgggi
+MA0GCSqGSIb3DQEBAQUAA4IIDwAwgggKAoIIAQDiiQVtw3+tpok6/7vHzZ03seHS
+IR6bYSoV53tXT1U80Lv52T0+przstK1TmhYC6wty/Yryj0QFxevT5b22RDnm+0e/
+ap4KlRjiaOLWltYhrYj99Rf109pCpZDtKZWWdTrah6HU9dOH3gVipuNmdJLPpby7
+32j/cXVWQVk16zNaZlHy0qMKwYzOc1wRby2MlYyRsf3P5a1WlcyFkoOQVUHJwnft
++aN0QgpoCPPQ0WX9Zyw0/yR/53nIBzslV92kDJg9vuDMGWXb8lSir0LUneKuhCMl
+CTMStWoedsSL2UkAbF66H/Ib2mfKJ6qjRCMbg4LO8qsz7VSk3MmrWWXROA7BPhtn
+j9Z1AeBVIt12d+yO3fTPeSJtuVcD9ZkIpzw+NPvEF64jWM0k8yPKagIolAGBNLRs
+a66LGsOj0gk8FlT1Nl8k459KoeJkxhbDpoF6JDZHjsFeDvv5FXgE1g5Z2Z1YZmLS
+lCkyMsh4uWb2tVbhbMYUS5ZSWZECJGpVR9c/tiMaYHeXLuJAr54EV56tEcXJQ3Dv
+SLRerBxpLi6C1VuLvoK+GRRe5w0ix1Eb/x6b8TCPcTEGszQnj196ZoJPii0Tq0LP
+IVael45mNg+Wm+Ur9AKpKmqMLMTDuHAsLSkeP1B3Hm0qVORVCpE4ocW1ZqJ2Wu4P
+v7Rn4ShuD+E2oYLRv9R34cRnMpN4yOdUU/4jeeZozCaQ9hBjXSpvkS2kczJRIfK7
+Fd+qJAhIBt6hnia/uoO/fKTIoIy90v+8hGknEyQYxEUYIyZeGBTKLoiHYqNT5iG3
+uIV7moW7FSZy+Ln3anQPST+SvqkFt5knv78JF0uZTK0REHzfdDH2jyZfqoiuOFfI
+VS3T+9gbUZm+JRs6usB9G+3O0km5z/PFfYmQgdhpSCAQo/jvklEYMosRGMA/G4VW
+zlfJ8oJkxt8CCS5KES+xJ203UvDwFmHxZ43fh3Kvh9rP+1CUbtSUheuKLOoh9ZZK
+RNXgzmp0RE3QBdOHFe020KSLZlVwk+5HBsF+LqUYeWfzKIXxcPcOg6R+VJ5adjLL
+ZRu4zfvIKAPSVJHRp8WFQwgXdqXmL2cI2KGigi0M+MGvY9RQd21rRkpBhdWQX3kt
+xOzXEYdAiuFo4mT4VTL7b5Ms2nfZIcEX5TYsTn6Qf6yUKzJnvjhQdriuQbnXIcUJ
+TGDIo1HENJtXN9/LyTNXi+v7dp8ZTcVqHypFrivtL42npQDLBPolYi50SBvKKoy6
+27Z+9rsCfKnD21h4ob/w/hoQVRHO6GlOlmXGFwPWB2iMVIKuHCJVP/H0CZcowEb3
+TgslHfcH1wkdOhhXODvoMwbnj3hGHlv1BrbsuKYN8boTS9YYIN1pM0ozFa64yJiK
+JyyTvC377jO/ZuZNurabBlVgl0u8RM1+9KHYqi/AAighFmJ42whU8vz0NOPGjxxD
+V86QGkvcLjsokYk/eto1HY4s7kns9DOtyVOojJ8EUz4kHFLJEvliV6O87izrQHwg
+I3ArlflzF4rRwRxpprc4mmf3cB16WgxAz2IPhTzCAk5+tfbFKimEsx83KuGqckLE
+7Wsaj5IcXb7R8lvyq6qp0vW4pEErK5FuEkjKmNg3jcjtADC1tgROfpzahOzA+nvl
+HYikU0awlORcG6ElLA9IUneXCWzsWxgzgwLlgn7NhSEwEf0nT8/kHuw/pVds6Sow
+GSqI5cNpOKtvOXF/hOFBw+HMKokgUi6DD2w5P0stFqwt8CSsAHP0m7MGPwW4FIUf
+q55cPJ5inQ5tO4AJ/ALqopd0ysf541bhw8qlpprAkOAkElPSwovavu0CQ15n4YmY
+ee7LqsrDG9znpUalfGsWh7ZaKNfbJzxepb22Ud0fQ887Jsg6jSVhwUn0PBvJROqv
+HMIrlAEqDjDRW4srR+XD0QQDmw45LNYn1OZwWtl1zyrYyQAF5BOI7MM5+4dhMDZD
+A8ienKIGwi/F/PCAY7FUBKBMqS7G9XZ62NDk1JQR5RW1eAbcuICPmakgMz0QhUxl
+Cco+WF5gk5qqYl3AUQYcXWCgDZxLQ/anFiGkh6rywS7ukjC4nt/fEAGLhglw2Gyo
+t1AeFpa092f9NTohkCoyxwB7TQcQCbkvc9gYfmeZBE8G/FDHhZudQJ2zljf6pdyy
+ck7vTgks/ZH9Tfe7pqE+q3uiA0CmqVUn4vr5Gc6HdarxdTbz87iR+JHDi3UTjkxl
+mhY5auU06HqWWX81sAD9W2n8Qyb69Shu/ofZfiT7tKCCblSi/66/YrT0cgHCy5hH
+mOFMtReAgM6PpijuHkVq+9/xHfxaO9bq9GwdYklXO4qPhurwUwTOnBZo/7q5/IgP
+R/cCRHJAuMo7LVOd3DxWjFl7aBosjXG7bADHGs5vQJKxoy8P2UTyo3Aunu4OrjLQ
+Oz6LB+rmebNcKeJ9a6he+Vox6AiWoowDmEbxuH2QVCbtdmL+numabl7JScdcNFMp
+VNns5EbhgDt12d/7edWH8bqe6xnOTFJz5luHriVPOXnMxrj5EHvs8JtxpAWg0ynT
+Tn8f9C0oeMxVlXsekS/MVhhzi7LbvGkH5tDYT+2i/1iFo23gSlO3Z32NDFxbe3co
+AjVEegTTKEPIazAXXTK4KTW6dto7FEp2GFik+JI8nk0zb0ZrCNkxSGjd9PskVjSy
+z2lmvkjSimYizfJpzcJTE0UpQSLWXZgftqSyo8LuAi9RG9yDpOxwJajUCGEyb+Sh
+gS58Y3L6KWW8cETPXQIDAQABMA0GCSqGSIb3DQEBBQUAA4IIAQBVmjRqIgZpCUUz
+x66pXMcJTpuGvEGQ1JRS9s0jKZRLIs3ovf6dzVLyve2rh8mrq0YEtL2iPyIwR1DA
+S4x2DwP1ktKxLcR6NZzJc4frpp/eD3ON03+Z2LqPb8Tzvhqui6KUNpDi5euNBfT8
+Zd+V8cSUTRdW1588j1A853e/lYYmZPtq/8ba6YyuQrtp5TPG2OkNxlUhScEMtKP5
+m0tc3oNPQQPOKnloOH3wVEkg9bYQ/wjcM2aWm/8G3gCe185WQ5pR/HDN9vBRo7fN
+tFyFYs1xt8YrIyvdw25AQvo3/zcc9npXlIeFI9fUycdfwU0vyQ3XXOycJe6eMIKR
+lnK4dR34CWhXl7ItS+4l7HokKe5y1JwT26vcAwrYShTJCFdEXaG1U4A08hSXz1Le
+og6KEOkU79BgvmGh8SVd1RhzP5MQypbus0DS26NVz1dapQ5PdUff6veQmm31cC4d
+FBw3ZARZULDccoZvnDc9XSivc1Xv0u4kdHQT79zbMUn7P2P10wg+M6XnnQreUyxR
+jmfbm0FlQVC91KSWbIe8EuCUx9PA5MtzWACD4awnhdadU51cvQo+A0OcDJH1bXv4
+QHJ1qxF2kSvhxqofcGl2cBUJ/pPQ1i23FWqbZ1y0aZ8lpn2K+30iqXHyzk6MuCEt
+3v5BcQ3/nexzprsHT4gOWEcufqnCx3jdunqeTuAwTmNvhdQgQen6/kNF5/uverLO
+pAUdIppYht/kzkyp/tgWpW/72M5We/XWIO/kR81jJP+5vvFIo8EBcua9wK3tJg3K
+NJ/8Ai0gTwUgriE9DMIgPD/wBITcz4n9uSWRjtBD5rMgq1wt1UCeoEvY9LLMffFY
+Co6H7YisNpbkVqARivKa0LNXozS7Gas44XRrIsQxzgHVGzbjHjhMM5PfQONZV06s
+bnseWj3FHVusyBCCNQIisvx16BCRjcR9eJNHnhydrGtiAliM1hwj1q94woCcpKok
+VBS1FJjG+CsaJMtxMgrimw5pa91+jGTRLmPvDn+xPohMnVXlyW4XBLdB/72KQcsl
+MW9Edz9HsfyBiAeOBUkgtxHZaQMqA525M4Sa399640Zzo9iijFMZiFVMdLj2RIQr
+0RQtTjkukmj/afyFYhvrVU/vJYRiRZnW2E5vP1MIfR0GlYGAf09OdDaYteKHcJjc
+1/XcUhXmxtZ5ljl/j5XPq4BTrRsLRUAO1Bi9LN6Kd3b98kRHxiHQ5HTw2BgFyHww
+csff8bv8AjCp9EImWQ2TBYKhc+005ThdzVCQ/pT8E7y9/KiiiKdzxLKo0V2IxAKi
+evEEyf6MdMnvHWRBn6welmdkrKsoQced98CYG24HwmR9WoNmVig2nOf7HHcOKKDE
+92t5OQQghMdXk7wboOq860LlqBH+/KxlzP34KIj0pZrlc1HgqJsNA3dO5eCYs4ja
+febGnnwUZsEuU0qSBzegfuk9CeQVfM/9uEGl755mncReBx2H+EGt6ucv0kFjGDf5
+FONN0OX3Q/0V4/k2cwYm3wFPqcNO3iBGd5i0eiQrO3UrTliNm12kxxagvDKIP6GD
+8wDI+NhY6WNdTCu18HJB2Kt3N9ZydK62NpzIpoNJS+DJVgspvgAwy93WyEKKANns
+FdE0cfJbZIf2J9K364awkL8p2yGeNozjIC+VI1FsG8Kk1ebYAkNnoP6bUANEf7vk
+ctXR5NqPkhRk+10UEBJKlQbJZQgpyiGjJjgRySffcGcE/cpIMn9jskV0MVBPh9kg
+cNIhcLHWEJ0zXXiDkW1Vguza5GJjx4FG1xllcipDGZC41yNNTBzgRKlmZ6zucXkn
+Jnhtcg71XUsjtXx8ZekXxjoLDd1eHlHDhrjsf8cnSqVG6GotGcGHo8uZk4dkolUU
+TLdDpZPX59JOeUDKZZlGPT96gHqIaswe5WszRvRQwNUfCbjNii6hJ+tdc6foawrl
+V4IqsPziVFJW8KupEsYjlgcknOC8RqW0IATaCZNj5dQuwn7FMe21FXSGF7mz8yaK
+HQJq2ho/6LrxBG2UUVTiWrRZgx1g0C1zzAe1Joz518aIke+Az10PoWDLRdRCItGx
+cB390LcwkDrGSG1n5TLaj9vjqOMdICWiHOFMuaT2xj9cWA27xrJ3ARaRnxcGDbdA
+PsyPjpxL4J1+mx4Fq4gi+tMoG1cUZEo+JCw4TSFpAHMu0FUtdPIV6JRDPkAqxsa5
+alveoswYUFRdTiqFbPaSiykZfufqSuAiKyW892bPd5pBdPI8FA10afVQg83NLyHb
+IkaK0PdRGpVX8gWLGhntO0XoNsJufvtXIgAfBlOprpPGj3EqMUWS545t5pkiwIP8
+79xXZndPojYx+6ETjeXKo5V9AQxkcDtTQmiAx7udqAA1aZgMqGfYQ+Wqz5XgUZWk
+Fz9CnbgEztN5ecjTihYykuDXou7XN0wvrLh7vkX28RgznHs3piTZvECrAOnDN4ur
+2LbzXoFOsBRrBz4f7ML2RCKVu7Pmb9b5cGW6CoNlqg4TL4MTI1OLQBb6zi/8TQT4
+69isxTbCFVdIOOxVs7Qeuq3SQgYXDXPIV6a+lk2p8sD7eiEc9clwqYKQtfEM1HkQ
+voGm6VxhnHd5mqTDNyZXN8lSLPoI/9BfxmHA9Ha+/N5Oz6tRmXHH33701s8GVhkT
+UwttdFlIGZtTBS2dMlTT5SxTi2Q+1GR744AJFMz+FkZja3Fp+PnLJ/aIVLxFs84C
+yJTuQFv5QgLC/7DYLOsof17JJgGZpw==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIFajCCBFKgAwIBAgIEPLU9RjANBgkqhkiG9w0BAQUFADBmMRIwEAYDVQQKEwli
+ZVRSVVNUZWQxGzAZBgNVBAsTEmJlVFJVU1RlZCBSb290IENBczEzMDEGA1UEAxMq
+YmVUUlVTVGVkIFJvb3QgQ0EtQmFsdGltb3JlIEltcGxlbWVudGF0aW9uMB4XDTAy
+MDQxMTA3Mzg1MVoXDTIyMDQxMTA3Mzg1MVowZjESMBAGA1UEChMJYmVUUlVTVGVk
+MRswGQYDVQQLExJiZVRSVVNUZWQgUm9vdCBDQXMxMzAxBgNVBAMTKmJlVFJVU1Rl
+ZCBSb290IENBLUJhbHRpbW9yZSBJbXBsZW1lbnRhdGlvbjCCASIwDQYJKoZIhvcN
+AQEBBQADggEPADCCAQoCggEBALx+xDmcjOPWHIb/ymKt4H8wRXqOGrO4x/nRNv8i
+805qX4QQ+2aBw5R5MdKR4XeOGCrDFN5R9U+jK7wYFuK13XneIviCfsuBH/0nLI/6
+l2Qijvj/YaOcGx6Sj8CoCd8JEey3fTGaGuqDIQY8n7pc/5TqarjDa1U0Tz0yH92B
+FODEPM2dMPgwqZfT7syj0B9fHBOB1BirlNFjw55/NZKeX0Tq7PQiXLfoPX2k+Ymp
+kbIq2eszh+6l/ePazIjmiSZuxyuC0F6dWdsU7JGDBcNeDsYq0ATdcT0gTlgn/FP7
+eHgZFLL8kFKJOGJgB7Sg7KxrUNb9uShr71ItOrL/8QFArDcCAwEAAaOCAh4wggIa
+MA8GA1UdEwEB/wQFMAMBAf8wggG1BgNVHSAEggGsMIIBqDCCAaQGDysGAQQBsT4A
+AAEJKIORMTCCAY8wggFIBggrBgEFBQcCAjCCAToaggE2UmVsaWFuY2Ugb24gb3Ig
+dXNlIG9mIHRoaXMgQ2VydGlmaWNhdGUgY3JlYXRlcyBhbiBhY2tub3dsZWRnbWVu
+dCBhbmQgYWNjZXB0YW5jZSBvZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJk
+IHRlcm1zIGFuZCBjb25kaXRpb25zIG9mIHVzZSwgdGhlIENlcnRpZmljYXRpb24g
+UHJhY3RpY2UgU3RhdGVtZW50IGFuZCB0aGUgUmVseWluZyBQYXJ0eSBBZ3JlZW1l
+bnQsIHdoaWNoIGNhbiBiZSBmb3VuZCBhdCB0aGUgYmVUUlVTVGVkIHdlYiBzaXRl
+LCBodHRwOi8vd3d3LmJldHJ1c3RlZC5jb20vcHJvZHVjdHNfc2VydmljZXMvaW5k
+ZXguaHRtbDBBBggrBgEFBQcCARY1aHR0cDovL3d3dy5iZXRydXN0ZWQuY29tL3By
+b2R1Y3RzX3NlcnZpY2VzL2luZGV4Lmh0bWwwHQYDVR0OBBYEFEU9w6nR3D8kVpgc
+cxiIav+DR+22MB8GA1UdIwQYMBaAFEU9w6nR3D8kVpgccxiIav+DR+22MA4GA1Ud
+DwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEASZK8o+6svfoNyYt5hhwjdrCA
+WXf82n+0S9/DZEtqTg6t8n1ZdwWtColzsPq8y9yNAIiPpqCy6qxSJ7+hSHyXEHu6
+7RMdmgduyzFiEuhjA6p9beP4G3YheBufS0OM00mG9htc9i5gFdPp43t1P9ACg9AY
+gkHNZTfqjjJ+vWuZXTARyNtIVBw74acT02pIk/c9jH8F6M7ziCpjBLjqflh8AXtb
+4cV97yHgjQ5dUX2xZ/2jvTg2xvI4hocalmhgRvsoFEdV4aeADGvi6t9NfJBIoDa9
+CReJf8Py05yc493EG931t3GzUwWJBtDLSoDByFOQtTwxiBdQn8nEDovYqAJjDQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
+IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
+BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
+aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
+9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy
+NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
+azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
+YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
+Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
+cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y
+LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+
+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y
+TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0
+LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW
+I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw
+nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICtzCCAiACAQAwDQYJKoZIhvcNAQEEBQAwgaMxCzAJBgNVBAYTAkVTMRIwEAYD
+VQQIEwlCQVJDRUxPTkExEjAQBgNVBAcTCUJBUkNFTE9OQTEZMBcGA1UEChMQSVBT
+IFNlZ3VyaWRhZCBDQTEYMBYGA1UECxMPQ2VydGlmaWNhY2lvbmVzMRcwFQYDVQQD
+Ew5JUFMgU0VSVklET1JFUzEeMBwGCSqGSIb3DQEJARYPaXBzQG1haWwuaXBzLmVz
+MB4XDTk4MDEwMTIzMjEwN1oXDTA5MTIyOTIzMjEwN1owgaMxCzAJBgNVBAYTAkVT
+MRIwEAYDVQQIEwlCQVJDRUxPTkExEjAQBgNVBAcTCUJBUkNFTE9OQTEZMBcGA1UE
+ChMQSVBTIFNlZ3VyaWRhZCBDQTEYMBYGA1UECxMPQ2VydGlmaWNhY2lvbmVzMRcw
+FQYDVQQDEw5JUFMgU0VSVklET1JFUzEeMBwGCSqGSIb3DQEJARYPaXBzQG1haWwu
+aXBzLmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsT1J0nznqjtwlxLyY
+XZhkJAk8IbPMGbWOlI6H0fg3PqHILVikgDVboXVsHUUMH2Fjal5vmwpMwci4YSM1
+gf/+rHhwLWjhOgeYlQJU3c0jt4BT18g3RXIGJBK6E2Ehim51KODFDzT9NthFf+G4
+Nu+z4cYgjui0OLzhPvYR3oydAQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBACzzw3lY
+JN7GO9HgQmm47mSzPWIBubOE3yN93ZjPEKn+ANgilgUTB1RXxafey9m4iEL2mdsU
+dx+2/iU94aI+A6mB0i1sR/WWRowiq8jMDQ6XXotBtDvECgZAHd1G9AHduoIuPD14
+cJ58GNCr+Lh3B0Zx8coLY1xq+XKU1QFPoNtC
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkG
+A1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYD
+VQQLEyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0
+MTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxIDAeBgNV
+BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2Vy
+dmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUAA4GJ
+ADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII
+0haGN1XpsSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphI
+uR2nKRoTLkoRWZweFdVJVCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZI
+hvcNAQECBQADfgBl3X7hsuyw4jrg7HFGmhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3
+YQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2qUtN8iD3zV9/ZHuO3ABc
+1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIH6jCCB1OgAwIBAgIBADANBgkqhkiG9w0BAQUFADCCARIxCzAJBgNVBAYTAkVT
+MRIwEAYDVQQIEwlCYXJjZWxvbmExEjAQBgNVBAcTCUJhcmNlbG9uYTEuMCwGA1UE
+ChMlSVBTIEludGVybmV0IHB1Ymxpc2hpbmcgU2VydmljZXMgcy5sLjErMCkGA1UE
+ChQiaXBzQG1haWwuaXBzLmVzIEMuSS5GLiAgQi02MDkyOTQ1MjEuMCwGA1UECxMl
+SVBTIENBIENMQVNFMSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMl
+SVBTIENBIENMQVNFMSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEeMBwGCSqGSIb3
+DQEJARYPaXBzQG1haWwuaXBzLmVzMB4XDTAxMTIyOTAwNTkzOFoXDTI1MTIyNzAw
+NTkzOFowggESMQswCQYDVQQGEwJFUzESMBAGA1UECBMJQmFyY2Vsb25hMRIwEAYD
+VQQHEwlCYXJjZWxvbmExLjAsBgNVBAoTJUlQUyBJbnRlcm5ldCBwdWJsaXNoaW5n
+IFNlcnZpY2VzIHMubC4xKzApBgNVBAoUImlwc0BtYWlsLmlwcy5lcyBDLkkuRi4g
+IEItNjA5Mjk0NTIxLjAsBgNVBAsTJUlQUyBDQSBDTEFTRTEgQ2VydGlmaWNhdGlv
+biBBdXRob3JpdHkxLjAsBgNVBAMTJUlQUyBDQSBDTEFTRTEgQ2VydGlmaWNhdGlv
+biBBdXRob3JpdHkxHjAcBgkqhkiG9w0BCQEWD2lwc0BtYWlsLmlwcy5lczCBnzAN
+BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA4FEnpwvdr9G5Q1uCN0VWcu+atsIS7ywS
+zHb5BlmvXSHU0lq4oNTzav3KaY1mSPd05u42veiWkXWmcSjK5yISMmmwPh5r9FBS
+YmL9Yzt9fuzuOOpi9GyocY3h6YvJP8a1zZRCb92CRTzo3wno7wpVqVZHYUxJZHMQ
+KD/Kvwn/xi8CAwEAAaOCBEowggRGMB0GA1UdDgQWBBTrsxl588GlHKzcuh9morKb
+adB4CDCCAUQGA1UdIwSCATswggE3gBTrsxl588GlHKzcuh9morKbadB4CKGCARqk
+ggEWMIIBEjELMAkGA1UEBhMCRVMxEjAQBgNVBAgTCUJhcmNlbG9uYTESMBAGA1UE
+BxMJQmFyY2Vsb25hMS4wLAYDVQQKEyVJUFMgSW50ZXJuZXQgcHVibGlzaGluZyBT
+ZXJ2aWNlcyBzLmwuMSswKQYDVQQKFCJpcHNAbWFpbC5pcHMuZXMgQy5JLkYuICBC
+LTYwOTI5NDUyMS4wLAYDVQQLEyVJUFMgQ0EgQ0xBU0UxIENlcnRpZmljYXRpb24g
+QXV0aG9yaXR5MS4wLAYDVQQDEyVJUFMgQ0EgQ0xBU0UxIENlcnRpZmljYXRpb24g
+QXV0aG9yaXR5MR4wHAYJKoZIhvcNAQkBFg9pcHNAbWFpbC5pcHMuZXOCAQAwDAYD
+VR0TBAUwAwEB/zAMBgNVHQ8EBQMDB/+AMGsGA1UdJQRkMGIGCCsGAQUFBwMBBggr
+BgEFBQcDAgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYKKwYBBAGCNwIB
+FQYKKwYBBAGCNwIBFgYKKwYBBAGCNwoDAQYKKwYBBAGCNwoDBDARBglghkgBhvhC
+AQEEBAMCAAcwGgYDVR0RBBMwEYEPaXBzQG1haWwuaXBzLmVzMBoGA1UdEgQTMBGB
+D2lwc0BtYWlsLmlwcy5lczBBBglghkgBhvhCAQ0ENBYyQ0xBU0UxIENBIENlcnRp
+ZmljYXRlIGlzc3VlZCBieSBodHRwOi8vd3d3Lmlwcy5lcy8wKQYJYIZIAYb4QgEC
+BBwWGmh0dHA6Ly93d3cuaXBzLmVzL2lwczIwMDIvMDoGCWCGSAGG+EIBBAQtFito
+dHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTEuY3JsMD8GCWCG
+SAGG+EIBAwQyFjBodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL3Jldm9jYXRpb25D
+TEFTRTEuaHRtbD8wPAYJYIZIAYb4QgEHBC8WLWh0dHA6Ly93d3cuaXBzLmVzL2lw
+czIwMDIvcmVuZXdhbENMQVNFMS5odG1sPzA6BglghkgBhvhCAQgELRYraHR0cDov
+L3d3dy5pcHMuZXMvaXBzMjAwMi9wb2xpY3lDTEFTRTEuaHRtbDBzBgNVHR8EbDBq
+MDGgL6AthitodHRwOi8vd3d3Lmlwcy5lcy9pcHMyMDAyL2lwczIwMDJDTEFTRTEu
+Y3JsMDWgM6Axhi9odHRwOi8vd3d3YmFjay5pcHMuZXMvaXBzMjAwMi9pcHMyMDAy
+Q0xBU0UxLmNybDAvBggrBgEFBQcBAQQjMCEwHwYIKwYBBQUHMAGGE2h0dHA6Ly9v
+Y3NwLmlwcy5lcy8wDQYJKoZIhvcNAQEFBQADgYEAK9Dr/drIyllq2tPMMi7JVBuK
+Yn4VLenZMdMu9Ccj/1urxUq2ckCuU3T0vAW0xtnIyXf7t/k0f3gA+Nak5FI/LEpj
+V4F1Wo7ojPsCwJTGKbqz3Bzosq/SLmJbGqmODszFV0VRFOlOHIilkfSj945RyKm+
+hjM+5i9Ibq9UkE6tsSU=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIHcDCCBtmgAwIBAgIBCjANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSUwx
+DzANBgNVBAgTBklzcmFlbDEOMAwGA1UEBxMFRWlsYXQxFjAUBgNVBAoTDVN0YXJ0
+Q29tIEx0ZC4xGjAYBgNVBAsTEUNBIEF1dGhvcml0eSBEZXAuMSkwJwYDVQQDEyBG
+cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJARYS
+YWRtaW5Ac3RhcnRjb20ub3JnMB4XDTA1MDQwNTE0NTIxM1oXDTEwMDQwNDE0NTIx
+M1owga8xCzAJBgNVBAYTAklMMQ8wDQYDVQQIEwZJc3JhZWwxFjAUBgNVBAoTDVN0
+YXJ0Q29tIEx0ZC4xIzAhBgNVBAsTGlNlY3VyZSBDZXJ0aWZpY2F0ZSBTaWduaW5n
+MS8wLQYDVQQDEyZTdGFydENvbSBDbGFzcyAzIFByaW1hcnkgRW1haWwgRnJlZSBD
+QTEhMB8GCSqGSIb3DQEJARYSYWRtaW5Ac3RhcnRjb20ub3JnMIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8Ro5xLHlk17HCjXMk1xfjxRXRS2Q21Zfepr1
+lpfZVmKWAjN4is5uWhBXQxrat2Cqixb3Exvm7eUFUi6a3t8TCAyqq0NrcXZC516W
+/3c/3PaduaftfgacIoAhBxb3so5KBBAdpU8erTfEYVuzPH4s4qsGL/G/dtwbG1is
+f7XQzWcdsJGjxTb7NwlCjDGgj45TmeGSj29TbkmnxlDZ9E4foLZNKNm5qfMxPK9z
+n50mI3YebYyEAyuo7ulQaEMq5S+eYqkBzCN5hAdTnWa+UHggh37htMTBWgbgAwnx
+FcHjtV0l683TKp4lIALKhF+3jDg6moXKxHUdNPpoTq7EuD1kLQIDAQABo4IEEzCC
+BA8wDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAeYwHQYDVR0OBBYEFASs2yR3
+U0ZGll8XAVx9Qke9SBkIMIHdBgNVHSMEgdUwgdKAFByJw5bMvf4y1Q2MgTG2mJ2N
+KGSNoYG2pIGzMIGwMQswCQYDVQQGEwJJTDEPMA0GA1UECBMGSXNyYWVsMQ4wDAYD
+VQQHEwVFaWxhdDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEaMBgGA1UECxMRQ0Eg
+QXV0aG9yaXR5IERlcC4xKTAnBgNVBAMTIEZyZWUgU1NMIENlcnRpZmljYXRpb24g
+QXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJhZG1pbkBzdGFydGNvbS5vcmeCAQAw
+HQYDVR0RBBYwFIESYWRtaW5Ac3RhcnRjb20ub3JnMB0GA1UdEgQWMBSBEmFkbWlu
+QHN0YXJ0Y29tLm9yZzBiBgNVHR8EWzBZMCmgJ6AlhiNodHRwOi8vY2VydC5zdGFy
+dGNvbS5vcmcvY2EtY3JsLmNybDAsoCqgKIYmaHR0cDovL2NybC5zdGFydGNvbS5v
+cmcvY3JsL2NhLWNybC5jcmwwggFKBgNVHSAEggFBMIIBPTCCATkGCysGAQQBgbU3
+AQEBMIIBKDAvBggrBgEFBQcCARYjaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3Bv
+bGljeS5wZGYwNQYIKwYBBQUHAgEWKWh0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9p
+bnRlcm1lZGlhdGUucGRmMIG9BggrBgEFBQcCAjCBsDAUFg1TdGFydENvbSBMdGQu
+MAMCAQEagZdMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUgc2VjdGlvbiAqTGVn
+YWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0aW9uIEF1
+dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly9jZXJ0LnN0YXJ0Y29t
+Lm9yZy9wb2xpY3kucGRmMBEGCWCGSAGG+EIBAQQEAwIABzBQBglghkgBhvhCAQ0E
+QxZBU3RhcnRDb20gQ2xhc3MgMyBQcmltYXJ5IEludGVybWVkaWF0ZSBGcmVlIFNT
+TCBFbWFpbCBDZXJ0aWZpY2F0ZXMwMgYJYIZIAYb4QgEEBCUWI2h0dHA6Ly9jZXJ0
+LnN0YXJ0Y29tLm9yZy9jYS1jcmwuY3JsMDMGCWCGSAGG+EIBAwQmFiRodHRwOi8v
+Y2VydC5zdGFydGNvbS5vcmcvY3J0LWNybC5jcmwwMgYJYIZIAYb4QgEIBCUWI2h0
+dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMA0GCSqGSIb3DQEBBAUA
+A4GBAFzWDofJPdmsZvQqr6SSp62dJe1zB98cSvpOJrZeoKo8svN1nxVPFWN6r8qm
+Da77xwYBIiXVTjleZZq/hV7P6NJKcKFEfCJ2ZvCMK00EXGvgL82SCzzCTbM1BuH7
+OUMo2imElPv4NU6GcgwnN02RBbThJO6swIXAujLHmTWsMdBh
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB
+lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
+SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG
+A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe
+MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v
+d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh
+cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn
+0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ
+M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a
+MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd
+oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI
+DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy
+oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD
+VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0
+dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy
+bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF
+BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM
+//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli
+CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE
+CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t
+3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS
+KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA==
+-----END CERTIFICATE-----
diff --git a/package/openssl/ipkg/ca-certificates.conffiles b/package/openssl/ipkg/ca-certificates.conffiles
new file mode 100644
index 000000000..8121eba55
--- /dev/null
+++ b/package/openssl/ipkg/ca-certificates.conffiles
@@ -0,0 +1 @@
+/etc/ssl/cert.pem
diff --git a/package/openssl/ipkg/ca-certificates.control b/package/openssl/ipkg/ca-certificates.control
new file mode 100644
index 000000000..41a077de4
--- /dev/null
+++ b/package/openssl/ipkg/ca-certificates.control
@@ -0,0 +1,4 @@
+Package: ca-certificates
+Priority: optional
+Section: base
+Description: X.509v3 Root CA Certificates
diff --git a/package/openssl/ipkg/libopenssl.control b/package/openssl/ipkg/libopenssl.control
new file mode 100644
index 000000000..6e5cd6749
--- /dev/null
+++ b/package/openssl/ipkg/libopenssl.control
@@ -0,0 +1,5 @@
+Package: libopenssl
+Priority: optional
+Section: libs
+Description: OpenSSL (Secure Socket Layer) libraries
+Depends: zlib
diff --git a/package/openssl/ipkg/openssl-util.conffiles b/package/openssl/ipkg/openssl-util.conffiles
new file mode 100644
index 000000000..6d068e66c
--- /dev/null
+++ b/package/openssl/ipkg/openssl-util.conffiles
@@ -0,0 +1 @@
+/etc/ssl/openssl.cnf
diff --git a/package/openssl/ipkg/openssl-util.control b/package/openssl/ipkg/openssl-util.control
new file mode 100644
index 000000000..4c14ab1aa
--- /dev/null
+++ b/package/openssl/ipkg/openssl-util.control
@@ -0,0 +1,5 @@
+Package: openssl-util
+Priority: optionnal
+Section: admin
+Description: OpenSSL (Secure Socket Layer) command line tool
+Depends: libopenssl
diff --git a/package/openssl/patches/ocf.patch b/package/openssl/patches/ocf.patch
new file mode 100644
index 000000000..f349288e9
--- /dev/null
+++ b/package/openssl/patches/ocf.patch
@@ -0,0 +1,1197 @@
+Index: libssl/Configure
+===================================================================
+RCS file: libssl/Configure,v
+retrieving revision 1.1.1.12
+retrieving revision 1.21
+diff -u -r1.1.1.12 -r1.21
+--- libssl/Configure 15 Sep 2008 23:36:40 -0000 1.1.1.12
++++ libssl/Configure 15 Sep 2008 23:44:15 -0000 1.21
+@@ -34,6 +34,8 @@
+ # (Default: KRB5_DIR/include)
+ # --with-krb5-flavor Declare what flavor of Kerberos 5 is used. Currently
+ # supported values are "MIT" and "Heimdal". A value is required.
++# --with-cryptodev Force support for cryptodev (ie., ocf-linux)
++# --with-cryptodev-digests Force support for cryptodev digests (generally slow)
+ #
+ # --test-sanity Make a number of sanity checks on the data in this file.
+ # This is a debugging tool for OpenSSL developers.
+@@ -538,6 +540,9 @@
+ ##### Compaq Non-Stop Kernel (Tandem)
+ "tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
+
++# uClinux
++"uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG::::::::::::\$(LIBSSL_dlfcn):linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}",
++
+ );
+
+ my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A
+@@ -587,6 +592,8 @@
+ my $no_asm=0;
+ my $no_dso=0;
+ my $no_gmp=0;
++my $have_cryptodev=0;
++my $use_cryptodev_digests=0;
+ my @skip=();
+ my $Makefile="Makefile";
+ my $des_locl="crypto/des/des_locl.h";
+@@ -714,6 +721,14 @@
+ {
+ exit(&test_sanity());
+ }
++ elsif (/^--with-cryptodev$/)
++ {
++ $have_cryptodev = 1;
++ }
++ elsif (/^--with-cryptodev-digests$/)
++ {
++ $use_cryptodev_digests = 1;
++ }
+ elsif (/^reconfigure/ || /^reconf/)
+ {
+ if (open(IN,"<$Makefile"))
+@@ -922,6 +937,7 @@
+ print " OPENSSL_NO_$ALGO";
+
+ if (/^err$/) { $flags .= "-DOPENSSL_NO_ERR "; }
++ elsif (/^hw$/) { $flags .= "-DOPENSSL_NO_HW "; }
+ elsif (/^asm$/) { $no_asm = 1; }
+ }
+ else
+@@ -1062,6 +1078,16 @@
+ $withargs{"krb5-dir"} ne "";
+ }
+
++# enable the linux cryptodev (ocf-linux) support
++if ($have_cryptodev)
++ {
++ if ($use_cryptodev_digests)
++ {
++ $cflags = "-DUSE_CRYPTODEV_DIGESTS $cflags";
++ }
++ $cflags = "-DHAVE_CRYPTODEV $cflags";
++ }
++
+ # The DSO code currently always implements all functions so that no
+ # applications will have to worry about that from a compilation point
+ # of view. However, the "method"s may return zero unless that platform
+Index: libssl/INSTALL
+===================================================================
+RCS file: libssl/INSTALL,v
+retrieving revision 1.1.1.8
+retrieving revision 1.3
+diff -u -r1.1.1.8 -r1.3
+--- libssl/INSTALL 15 Sep 2008 23:36:40 -0000 1.1.1.8
++++ libssl/INSTALL 15 Sep 2008 23:44:15 -0000 1.3
+@@ -103,6 +103,12 @@
+ define preprocessor symbols, specify additional libraries,
+ library directories or other compiler options.
+
++ --with-cryptodev Enabled the BSD cryptodev engine even if we are not using
++ BSD. Useful if you are running ocf-linux or something
++ similar. Once enabled you can also enable the use of
++ cryptodev digests, with is usually slower unless you have
++ large amounts data. Use --with-cryptodev-digests to force
++ it.
+
+ Installation in Detail
+ ----------------------
+Index: libssl/Makefile.org
+===================================================================
+RCS file: libssl/Makefile.org,v
+retrieving revision 1.1.1.11
+retrieving revision 1.21
+diff -u -r1.1.1.11 -r1.21
+--- libssl/Makefile.org 15 Sep 2008 23:36:40 -0000 1.1.1.11
++++ libssl/Makefile.org 15 Sep 2008 23:44:15 -0000 1.21
+@@ -367,7 +367,7 @@
+
+ links:
+ @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
+- @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
++ @$(PERL) $(TOP)/util/mklink.pl include/openssl $(HEADER) $(EXHEADER)
+ @set -e; target=links; $(RECURSIVE_BUILD_CMD)
+
+ gentests:
+Index: libssl/apps/apps.h
+===================================================================
+RCS file: libssl/apps/apps.h,v
+retrieving revision 1.1.1.7
+retrieving revision 1.6
+diff -u -r1.1.1.7 -r1.6
+--- libssl/apps/apps.h 15 Sep 2008 23:36:40 -0000 1.1.1.7
++++ libssl/apps/apps.h 15 Sep 2008 23:44:15 -0000 1.6
+@@ -112,7 +112,7 @@
+ #ifndef HEADER_APPS_H
+ #define HEADER_APPS_H
+
+-#include "e_os.h"
++#include <openssl/e_os.h>
+
+ #include <openssl/bio.h>
+ #include <openssl/x509.h>
+Index: libssl/apps/progs.h
+===================================================================
+RCS file: libssl/apps/progs.h,v
+retrieving revision 1.1.1.8
+retrieving revision 1.7
+diff -u -r1.1.1.8 -r1.7
+--- libssl/apps/progs.h 15 Sep 2008 23:36:40 -0000 1.1.1.8
++++ libssl/apps/progs.h 15 Sep 2008 23:44:15 -0000 1.7
+@@ -129,7 +129,9 @@
+ #ifndef OPENSSL_NO_ENGINE
+ {FUNC_TYPE_GENERAL,"engine",engine_main},
+ #endif
++#ifndef OPENSSL_NO_OCSP
+ {FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
++#endif
+ {FUNC_TYPE_GENERAL,"prime",prime_main},
+ #ifndef OPENSSL_NO_MD2
+ {FUNC_TYPE_MD,"md2",dgst_main},
+Index: libssl/apps/speed.c
+===================================================================
+RCS file: libssl/apps/speed.c,v
+retrieving revision 1.1.1.10
+retrieving revision 1.15
+diff -u -r1.1.1.10 -r1.15
+--- libssl/apps/speed.c 15 Sep 2008 23:36:40 -0000 1.1.1.10
++++ libssl/apps/speed.c 15 Sep 2008 23:44:15 -0000 1.15
+@@ -292,7 +292,7 @@
+ "evp","sha256","sha512",
+ "aes-128 ige","aes-192 ige","aes-256 ige"};
+ static double results[ALGOR_NUM][SIZE_NUM];
+-static int lengths[SIZE_NUM]={16,64,256,1024,8*1024};
++static int lengths[SIZE_NUM]={16,64,256,1024,2*1024,4*1024};
+ static double rsa_results[RSA_NUM][2];
+ static double dsa_results[DSA_NUM][2];
+ #ifndef OPENSSL_NO_ECDSA
+@@ -328,6 +328,79 @@
+ #define START 0
+ #define STOP 1
+
++#ifdef __linux__
++/*
++ * record CPU usage as well
++ */
++
++static int do_cpu = 0;
++
++struct cpu_stat {
++ unsigned int user;
++ unsigned int nice;
++ unsigned int system;
++ unsigned int idle;
++ unsigned int total;
++};
++
++static unsigned int cpu_usage[ALGOR_NUM][SIZE_NUM];
++static unsigned int rsa_cpu_usage[RSA_NUM][2];
++static unsigned int dsa_cpu_usage[DSA_NUM][2];
++static struct cpu_stat cpu_start, cpu_finish;
++
++static void
++get_cpu(int s)
++{
++ FILE *fp = NULL;
++ unsigned char buf[80];
++ struct cpu_stat *st = s == START ? &cpu_start : &cpu_finish;
++
++ memset(st, 0, sizeof(*st));
++
++ if (fp == NULL)
++ fp = fopen("/proc/stat", "r");
++ if (!fp)
++ return;
++ if (fseek(fp, 0, SEEK_SET) == -1) {
++ fclose(fp);
++ return;
++ }
++ fscanf(fp, "%s %d %d %d %d", &buf[0], &st->user, &st->nice,
++ &st->system, &st->idle);
++ st->total = st->user + st->nice + st->system + st->idle;
++ fclose(fp);
++}
++
++static unsigned int
++calc_cpu()
++{
++ unsigned int total, res;
++
++ total = cpu_finish.total - cpu_start.total;
++ if (total <= 0)
++ return 0;
++#if 1 // busy
++ res = ((cpu_finish.system + cpu_finish.user + cpu_finish.nice) -
++ (cpu_start.system + cpu_start.user + cpu_start.nice)) *
++ 100 / total;
++#endif
++#if 0 // system
++ res = (cpu_finish.system - cpu_start.system) * 100 / total;
++#endif
++#if 0 // user
++ res = (cpu_finish.user - cpu_start.user) * 100 / total;
++#endif
++#if 0 // nice
++ res = (cpu_finish.nice - cpu_start.nice) * 100 / total;
++#endif
++#if 0 // idle
++ res = (cpu_finish.idle - cpu_start.idle) * 100 / total;
++#endif
++ return(res);
++}
++
++#endif
++
+ #if defined(OPENSSL_SYS_NETWARE)
+
+ /* for NetWare the best we can do is use clock() which returns the
+@@ -358,6 +431,11 @@
+ {
+ double ret;
+
++#ifdef __linux__
++ if (do_cpu)
++ get_cpu(s);
++#endif
++
+ #ifdef USE_TOD
+ if(usertime)
+ {
+@@ -832,6 +910,14 @@
+ j--; /* Otherwise, -elapsed gets confused with
+ an algorithm. */
+ }
++#ifdef __linux__
++ else if ((argc > 0) && (strcmp(*argv,"-cpu") == 0))
++ {
++ do_cpu = 1;
++ j--; /* Otherwise, -cpu gets confused with
++ an algorithm. */
++ }
++#endif
+ else if ((argc > 0) && (strcmp(*argv,"-evp") == 0))
+ {
+ argc--;
+@@ -1260,6 +1346,9 @@
+ #ifdef HAVE_FORK
+ BIO_printf(bio_err,"-multi n run n benchmarks in parallel.\n");
+ #endif
++#ifdef __linux__
++ BIO_printf(bio_err,"-cpu calculate cpu utilisation.\n");
++#endif
+ goto end;
+ }
+ argc--;
+@@ -1267,11 +1356,6 @@
+ j++;
+ }
+
+-#ifdef HAVE_FORK
+- if(multi && do_multi(multi))
+- goto show_res;
+-#endif
+-
+ if (j == 0)
+ {
+ for (i=0; i<ALGOR_NUM; i++)
+@@ -1604,6 +1688,11 @@
+ signal(SIGALRM,sig_done);
+ #endif /* SIGALRM */
+
++#ifdef HAVE_FORK /* DM */
++ if(multi && do_multi(multi))
++ goto show_res;
++#endif
++
+ #ifndef OPENSSL_NO_MD2
+ if (doit[D_MD2])
+ {
+@@ -2033,8 +2122,6 @@
+ /* -O3 -fschedule-insns messes up an
+ * optimization here! names[D_EVP]
+ * somehow becomes NULL */
+- print_message(names[D_EVP],save_count,
+- lengths[j]);
+
+ EVP_CIPHER_CTX_init(&ctx);
+ if(decrypt)
+@@ -2043,6 +2130,9 @@
+ EVP_EncryptInit_ex(&ctx,evp_cipher,NULL,key16,iv);
+ EVP_CIPHER_CTX_set_padding(&ctx, 0);
+
++ print_message(names[D_EVP],save_count,
++ lengths[j]);
++
+ Time_F(START);
+ if(decrypt)
+ for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)
+@@ -2107,6 +2197,8 @@
+ }
+ }
+ d=Time_F(STOP);
++ if (do_cpu)
++ rsa_cpu_usage[j][0] = calc_cpu();
+ BIO_printf(bio_err,mr ? "+R1:%ld:%d:%.2f\n"
+ : "%ld %d bit private RSA's in %.2fs\n",
+ count,rsa_bits[j],d);
+@@ -2142,6 +2234,8 @@
+ }
+ }
+ d=Time_F(STOP);
++ if (do_cpu)
++ rsa_cpu_usage[j][1] = calc_cpu();
+ BIO_printf(bio_err,mr ? "+R2:%ld:%d:%.2f\n"
+ : "%ld %d bit public RSA's in %.2fs\n",
+ count,rsa_bits[j],d);
+@@ -2201,6 +2295,8 @@
+ }
+ }
+ d=Time_F(STOP);
++ if (do_cpu)
++ dsa_cpu_usage[j][0] = calc_cpu();
+ BIO_printf(bio_err,mr ? "+R3:%ld:%d:%.2f\n"
+ : "%ld %d bit DSA signs in %.2fs\n",
+ count,dsa_bits[j],d);
+@@ -2236,6 +2332,8 @@
+ }
+ }
+ d=Time_F(STOP);
++ if (do_cpu)
++ dsa_cpu_usage[j][1] = calc_cpu();
+ BIO_printf(bio_err,mr ? "+R4:%ld:%d:%.2f\n"
+ : "%ld %d bit DSA verify in %.2fs\n",
+ count,dsa_bits[j],d);
+@@ -2530,14 +2628,23 @@
+ fprintf(stdout,"The 'numbers' are in 1000s of bytes per second processed.\n");
+ fprintf(stdout,"type ");
+ }
+- for (j=0; j<SIZE_NUM; j++)
++ for (j=0; j<SIZE_NUM; j++) {
+ fprintf(stdout,mr ? ":%d" : "%7d bytes",lengths[j]);
++ if (do_cpu && !mr)
++ fprintf(stdout, " /cpu");
++ }
+ fprintf(stdout,"\n");
+ }
+
+ for (k=0; k<ALGOR_NUM; k++)
+ {
+ if (!doit[k]) continue;
++ if (k == D_EVP) {
++ if (evp_cipher)
++ names[D_EVP]=OBJ_nid2ln(evp_cipher->nid);
++ else
++ names[D_EVP]=OBJ_nid2ln(evp_md->type);
++ }
+ if(mr)
+ fprintf(stdout,"+F:%d:%s",k,names[k]);
+ else
+@@ -2548,6 +2655,8 @@
+ fprintf(stdout," %11.2fk",results[k][j]/1e3);
+ else
+ fprintf(stdout,mr ? ":%.2f" : " %11.2f ",results[k][j]);
++ if (do_cpu)
++ fprintf(stdout, mr ? "/%d" : "/%%%-3d", cpu_usage[k][j]);
+ }
+ fprintf(stdout,"\n");
+ }
+@@ -2562,13 +2671,18 @@
+ j=0;
+ }
+ if(mr)
+- fprintf(stdout,"+F2:%u:%u:%f:%f\n",
+- k,rsa_bits[k],rsa_results[k][0],
+- rsa_results[k][1]);
+- else
+- fprintf(stdout,"rsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
+- rsa_bits[k],rsa_results[k][0],rsa_results[k][1],
+- 1.0/rsa_results[k][0],1.0/rsa_results[k][1]);
++ fprintf(stdout,"+F2:%u:%u:%f", k,rsa_bits[k],rsa_results[k][0]);
++ else
++ fprintf(stdout,"rsa %4u bits %8.6fs",rsa_bits[k],rsa_results[k][0]);
++ if (do_cpu)
++ fprintf(stdout, mr ? "/%d": "/%%%-3d", rsa_cpu_usage[k][0]);
++ fprintf(stdout, mr ? ":%f" : " %8.6fs", rsa_results[k][1]);
++ if (do_cpu)
++ fprintf(stdout, mr ? "/%d": "/%%%-3d", rsa_cpu_usage[k][1]);
++ if(!mr)
++ fprintf(stdout, " %8.1f %8.1f",
++ 1.0/rsa_results[k][0],1.0/rsa_results[k][1]);
++ fprintf(stdout, "\n");
+ }
+ #endif
+ #ifndef OPENSSL_NO_DSA
+@@ -2582,12 +2696,18 @@
+ j=0;
+ }
+ if(mr)
+- fprintf(stdout,"+F3:%u:%u:%f:%f\n",
+- k,dsa_bits[k],dsa_results[k][0],dsa_results[k][1]);
++ fprintf(stdout,"+F3:%u:%u:%f", k,dsa_bits[k],dsa_results[k][0]);
+ else
+- fprintf(stdout,"dsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
+- dsa_bits[k],dsa_results[k][0],dsa_results[k][1],
+- 1.0/dsa_results[k][0],1.0/dsa_results[k][1]);
++ fprintf(stdout,"dsa %4u bits %8.6fs",dsa_bits[k],dsa_results[k][0]);
++ if (do_cpu)
++ fprintf(stdout, mr ? "/%d": "/%%%-3d", dsa_cpu_usage[k][0]);
++ fprintf(stdout, mr ? ":%f" : " %8.6fs", dsa_results[k][1]);
++ if (do_cpu)
++ fprintf(stdout, mr ? "/%d": "/%%%-3d", dsa_cpu_usage[k][1]);
++ if(!mr)
++ fprintf(stdout, " %8.1f %8.1f",
++ 1.0/dsa_results[k][0],1.0/dsa_results[k][1]);
++ fprintf(stdout, "\n");
+ }
+ #endif
+ #ifndef OPENSSL_NO_ECDSA
+@@ -2712,8 +2832,10 @@
+
+ static void print_result(int alg,int run_no,int count,double time_used)
+ {
+- BIO_printf(bio_err,mr ? "+R:%d:%s:%f\n"
+- : "%d %s's in %.2fs\n",count,names[alg],time_used);
++ if (do_cpu)
++ cpu_usage[alg][run_no] = calc_cpu();
++ BIO_printf(bio_err,mr ? "+R:%ld:%s:%f\n"
++ : "%ld %s's in %.2fs\n",count,names[alg],time_used);
+ results[alg][run_no]=((double)count)/time_used*lengths[run_no];
+ }
+
+@@ -2806,29 +2928,11 @@
+ p=buf+3;
+ alg=atoi(sstrsep(&p,sep));
+ sstrsep(&p,sep);
+- for(j=0 ; j < SIZE_NUM ; ++j)
++ for(j=0 ; j < SIZE_NUM ; ++j) {
++ if (do_cpu && strchr(p, '/'))
++ cpu_usage[alg][j] = atoi(strchr(p, '/') + 1);
+ results[alg][j]+=atof(sstrsep(&p,sep));
+ }
+- else if(!strncmp(buf,"+F2:",4))
+- {
+- int k;
+- double d;
+-
+- p=buf+4;
+- k=atoi(sstrsep(&p,sep));
+- sstrsep(&p,sep);
+-
+- d=atof(sstrsep(&p,sep));
+- if(n)
+- rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d);
+- else
+- rsa_results[k][0]=d;
+-
+- d=atof(sstrsep(&p,sep));
+- if(n)
+- rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d);
+- else
+- rsa_results[k][1]=d;
+ }
+ else if(!strncmp(buf,"+F2:",4))
+ {
+@@ -2839,12 +2943,18 @@
+ k=atoi(sstrsep(&p,sep));
+ sstrsep(&p,sep);
+
++ /* before we move the token along */
++ if (do_cpu && strchr(p, '/'))
++ rsa_cpu_usage[k][0] = atoi(strchr(p, '/') + 1);
+ d=atof(sstrsep(&p,sep));
+ if(n)
+ rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d);
+ else
+ rsa_results[k][0]=d;
+
++ /* before we move the token along */
++ if (do_cpu && strchr(p, '/'))
++ rsa_cpu_usage[k][1] = atoi(strchr(p, '/') + 1);
+ d=atof(sstrsep(&p,sep));
+ if(n)
+ rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d);
+@@ -2860,12 +2970,18 @@
+ k=atoi(sstrsep(&p,sep));
+ sstrsep(&p,sep);
+
++ /* before we move the token along */
++ if (do_cpu && strchr(p, '/'))
++ dsa_cpu_usage[k][0] = atoi(strchr(p, '/') + 1);
+ d=atof(sstrsep(&p,sep));
+ if(n)
+ dsa_results[k][0]=1/(1/dsa_results[k][0]+1/d);
+ else
+ dsa_results[k][0]=d;
+
++ /* before we move the token along */
++ if (do_cpu && strchr(p, '/'))
++ dsa_cpu_usage[k][1] = atoi(strchr(p, '/') + 1);
+ d=atof(sstrsep(&p,sep));
+ if(n)
+ dsa_results[k][1]=1/(1/dsa_results[k][1]+1/d);
+Index: libssl/crypto/cryptlib.h
+===================================================================
+RCS file: libssl/crypto/cryptlib.h,v
+retrieving revision 1.1.1.5
+retrieving revision 1.4
+diff -u -r1.1.1.5 -r1.4
+--- libssl/crypto/cryptlib.h 15 Sep 2008 23:36:40 -0000 1.1.1.5
++++ libssl/crypto/cryptlib.h 15 Sep 2008 23:44:15 -0000 1.4
+@@ -62,7 +62,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include "e_os.h"
++#include <openssl/e_os.h>
+
+ #ifdef OPENSSL_USE_APPLINK
+ #define BIO_FLAGS_UPLINK 0x8000
+Index: libssl/crypto/engine/eng_all.c
+===================================================================
+RCS file: libssl/crypto/engine/eng_all.c,v
+retrieving revision 1.1.1.4
+retrieving revision 1.6
+diff -u -r1.1.1.4 -r1.6
+--- libssl/crypto/engine/eng_all.c 15 Sep 2008 23:36:41 -0000 1.1.1.4
++++ libssl/crypto/engine/eng_all.c 15 Sep 2008 23:44:16 -0000 1.6
+@@ -104,7 +104,7 @@
+ #endif
+ #endif
+ #ifndef OPENSSL_NO_HW
+-#if defined(__OpenBSD__) || defined(__FreeBSD__)
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
+ ENGINE_load_cryptodev();
+ #endif
+ #if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
+@@ -113,7 +113,7 @@
+ #endif
+ }
+
+-#if defined(__OpenBSD__) || defined(__FreeBSD__)
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
+ void ENGINE_setup_bsd_cryptodev(void) {
+ static int bsd_cryptodev_default_loaded = 0;
+ if (!bsd_cryptodev_default_loaded) {
+Index: libssl/crypto/engine/eng_cryptodev.c
+===================================================================
+RCS file: libssl/crypto/engine/eng_cryptodev.c,v
+retrieving revision 1.1.1.1
+retrieving revision 1.9
+diff -u -r1.1.1.1 -r1.9
+--- libssl/crypto/engine/eng_cryptodev.c 3 Feb 2006 00:06:09 -0000 1.1.1.1
++++ libssl/crypto/engine/eng_cryptodev.c 4 Aug 2008 00:51:09 -0000 1.9
+@@ -68,6 +68,16 @@
+ struct dev_crypto_state {
+ struct session_op d_sess;
+ int d_fd;
++
++#ifdef USE_CRYPTODEV_DIGESTS
++ char dummy_mac_key[20];
++
++ unsigned char digest_res[20];
++ char *mac_data;
++ int mac_len;
++
++ int copy;
++#endif
+ };
+
+ static u_int32_t cryptodev_asymfeat = 0;
+@@ -75,9 +85,11 @@
+ static int get_asym_dev_crypto(void);
+ static int open_dev_crypto(void);
+ static int get_dev_crypto(void);
++#if 0
+ static int cryptodev_max_iv(int cipher);
+ static int cryptodev_key_length_valid(int cipher, int len);
+ static int cipher_nid_to_cryptodev(int nid);
++#endif
+ static int get_cryptodev_ciphers(const int **cnids);
+ static int get_cryptodev_digests(const int **cnids);
+ static int cryptodev_usable_ciphers(const int **nids);
+@@ -100,7 +112,7 @@
+ static int cryptodev_bn_mod_exp(BIGNUM *r, const BIGNUM *a,
+ const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+ static int cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I,
+- RSA *rsa);
++ RSA *rsa, BN_CTX *ctx);
+ static int cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
+ static int cryptodev_dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a,
+ const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
+@@ -130,9 +142,12 @@
+ int ivmax;
+ int keylen;
+ } ciphers[] = {
++ { CRYPTO_ARC4, NID_rc4, 0, 16, },
+ { CRYPTO_DES_CBC, NID_des_cbc, 8, 8, },
+ { CRYPTO_3DES_CBC, NID_des_ede3_cbc, 8, 24, },
+ { CRYPTO_AES_CBC, NID_aes_128_cbc, 16, 16, },
++ { CRYPTO_AES_CBC, NID_aes_192_cbc, 16, 24, },
++ { CRYPTO_AES_CBC, NID_aes_256_cbc, 16, 32, },
+ { CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16, },
+ { CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 16, },
+ { CRYPTO_SKIPJACK_CBC, NID_undef, 0, 0, },
+@@ -142,14 +157,15 @@
+ static struct {
+ int id;
+ int nid;
++ int keylen;
+ } digests[] = {
+- { CRYPTO_SHA1_HMAC, NID_hmacWithSHA1, },
+- { CRYPTO_RIPEMD160_HMAC, NID_ripemd160, },
+- { CRYPTO_MD5_KPDK, NID_undef, },
+- { CRYPTO_SHA1_KPDK, NID_undef, },
+- { CRYPTO_MD5, NID_md5, },
+- { CRYPTO_SHA1, NID_undef, },
+- { 0, NID_undef, },
++ { CRYPTO_SHA1_HMAC, NID_hmacWithSHA1, 20},
++ { CRYPTO_RIPEMD160_HMAC, NID_ripemd160, 16/*?*/},
++ { CRYPTO_MD5_KPDK, NID_undef, 0},
++ { CRYPTO_SHA1_KPDK, NID_undef, 0},
++ { CRYPTO_MD5, NID_md5, 16},
++ { CRYPTO_SHA1, NID_sha1, 20},
++ { 0, NID_undef, 0},
+ };
+
+ /*
+@@ -176,10 +192,17 @@
+ static int
+ get_dev_crypto(void)
+ {
+- int fd, retfd;
++ static int fd = -1;
++ int retfd;
+
+- if ((fd = open_dev_crypto()) == -1)
+- return (-1);
++ if (fd == -1) {
++ if ((fd = open_dev_crypto()) == -1)
++ return (-1);
++ if (fcntl(fd, F_SETFD, 1) == -1) {
++ close(fd);
++ return (-1);
++ }
++ }
+ if (ioctl(fd, CRIOGET, &retfd) == -1)
+ return (-1);
+
+@@ -202,6 +225,7 @@
+ return fd;
+ }
+
++#if 0
+ /*
+ * XXXX this needs to be set for each alg - and determined from
+ * a running card.
+@@ -245,6 +269,7 @@
+ return (ciphers[i].id);
+ return (0);
+ }
++#endif
+
+ /*
+ * Find out what ciphers /dev/crypto will let us have a session for.
+@@ -264,7 +289,7 @@
+ return (0);
+ }
+ memset(&sess, 0, sizeof(sess));
+- sess.key = (caddr_t)"123456781234567812345678";
++ sess.key = (caddr_t)"123456789abcdefghijklmno";
+
+ for (i = 0; ciphers[i].id && count < CRYPTO_ALGORITHM_MAX; i++) {
+ if (ciphers[i].nid == NID_undef)
+@@ -303,10 +328,12 @@
+ return (0);
+ }
+ memset(&sess, 0, sizeof(sess));
++ sess.mackey = (caddr_t)"123456789abcdefghijklmno";
+ for (i = 0; digests[i].id && count < CRYPTO_ALGORITHM_MAX; i++) {
+ if (digests[i].nid == NID_undef)
+ continue;
+ sess.mac = digests[i].id;
++ sess.mackeylen = digests[i].keylen;
+ sess.cipher = 0;
+ if (ioctl(fd, CIOCGSESSION, &sess) != -1 &&
+ ioctl(fd, CIOCFSESSION, &sess.ses) != -1)
+@@ -351,6 +378,9 @@
+ static int
+ cryptodev_usable_digests(const int **nids)
+ {
++#ifdef USE_CRYPTODEV_DIGESTS
++ return (get_cryptodev_digests(nids));
++#else
+ /*
+ * XXXX just disable all digests for now, because it sucks.
+ * we need a better way to decide this - i.e. I may not
+@@ -365,6 +395,7 @@
+ */
+ *nids = NULL;
+ return (0);
++#endif
+ }
+
+ static int
+@@ -427,16 +458,20 @@
+ {
+ struct dev_crypto_state *state = ctx->cipher_data;
+ struct session_op *sess = &state->d_sess;
+- int cipher;
++ int cipher, i;
+
+- if ((cipher = cipher_nid_to_cryptodev(ctx->cipher->nid)) == NID_undef)
+- return (0);
+-
+- if (ctx->cipher->iv_len > cryptodev_max_iv(cipher))
+- return (0);
++ for (i = 0; ciphers[i].id; i++)
++ if (ctx->cipher->nid == ciphers[i].nid &&
++ ctx->cipher->iv_len <= ciphers[i].ivmax &&
++ ctx->key_len == ciphers[i].keylen) {
++ cipher = ciphers[i].id;
++ break;
++ }
+
+- if (!cryptodev_key_length_valid(cipher, ctx->key_len))
++ if (!ciphers[i].id) {
++ state->d_fd = -1;
+ return (0);
++ }
+
+ memset(sess, 0, sizeof(struct session_op));
+
+@@ -496,6 +531,20 @@
+ * gets called when libcrypto requests a cipher NID.
+ */
+
++/* RC4 */
++const EVP_CIPHER cryptodev_rc4 = {
++ NID_rc4,
++ 1, 16, 0,
++ EVP_CIPH_VARIABLE_LENGTH,
++ cryptodev_init_key,
++ cryptodev_cipher,
++ cryptodev_cleanup,
++ sizeof(struct dev_crypto_state),
++ NULL,
++ NULL,
++ NULL
++};
++
+ /* DES CBC EVP */
+ const EVP_CIPHER cryptodev_des_cbc = {
+ NID_des_cbc,
+@@ -563,6 +612,32 @@
+ NULL
+ };
+
++const EVP_CIPHER cryptodev_aes_192_cbc = {
++ NID_aes_192_cbc,
++ 16, 24, 16,
++ EVP_CIPH_CBC_MODE,
++ cryptodev_init_key,
++ cryptodev_cipher,
++ cryptodev_cleanup,
++ sizeof(struct dev_crypto_state),
++ EVP_CIPHER_set_asn1_iv,
++ EVP_CIPHER_get_asn1_iv,
++ NULL
++};
++
++const EVP_CIPHER cryptodev_aes_256_cbc = {
++ NID_aes_256_cbc,
++ 16, 32, 16,
++ EVP_CIPH_CBC_MODE,
++ cryptodev_init_key,
++ cryptodev_cipher,
++ cryptodev_cleanup,
++ sizeof(struct dev_crypto_state),
++ EVP_CIPHER_set_asn1_iv,
++ EVP_CIPHER_get_asn1_iv,
++ NULL
++};
++
+ /*
+ * Registered by the ENGINE when used to find out how to deal with
+ * a particular NID in the ENGINE. this says what we'll do at the
+@@ -576,6 +651,9 @@
+ return (cryptodev_usable_ciphers(nids));
+
+ switch (nid) {
++ case NID_rc4:
++ *cipher = &cryptodev_rc4;
++ break;
+ case NID_des_ede3_cbc:
+ *cipher = &cryptodev_3des_cbc;
+ break;
+@@ -591,6 +669,12 @@
+ case NID_aes_128_cbc:
+ *cipher = &cryptodev_aes_cbc;
+ break;
++ case NID_aes_192_cbc:
++ *cipher = &cryptodev_aes_192_cbc;
++ break;
++ case NID_aes_256_cbc:
++ *cipher = &cryptodev_aes_256_cbc;
++ break;
+ default:
+ *cipher = NULL;
+ break;
+@@ -598,6 +682,234 @@
+ return (*cipher != NULL);
+ }
+
++
++#ifdef USE_CRYPTODEV_DIGESTS
++
++/* convert digest type to cryptodev */
++static int
++digest_nid_to_cryptodev(int nid)
++{
++ int i;
++
++ for (i = 0; digests[i].id; i++)
++ if (digests[i].nid == nid)
++ return (digests[i].id);
++ return (0);
++}
++
++
++static int
++digest_key_length(int nid)
++{
++ int i;
++
++ for (i = 0; digests[i].id; i++)
++ if (digests[i].nid == nid)
++ return digests[i].keylen;
++ return (0);
++}
++
++
++static int cryptodev_digest_init(EVP_MD_CTX *ctx)
++{
++ struct dev_crypto_state *state = ctx->md_data;
++ struct session_op *sess = &state->d_sess;
++ int digest;
++
++ if ((digest = digest_nid_to_cryptodev(ctx->digest->type)) == NID_undef){
++ printf("cryptodev_digest_init: Can't get digest \n");
++ return (0);
++ }
++
++ memset(state, 0, sizeof(struct dev_crypto_state));
++
++ if ((state->d_fd = get_dev_crypto()) < 0) {
++ printf("cryptodev_digest_init: Can't get Dev \n");
++ return (0);
++ }
++
++ sess->mackey = state->dummy_mac_key;
++ sess->mackeylen = digest_key_length(ctx->digest->type);
++ sess->mac = digest;
++
++ if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) {
++ close(state->d_fd);
++ state->d_fd = -1;
++ printf("cryptodev_digest_init: Open session failed\n");
++ return (0);
++ }
++
++ return (1);
++}
++
++static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data,
++ size_t count)
++{
++ struct crypt_op cryp;
++ struct dev_crypto_state *state = ctx->md_data;
++ struct session_op *sess = &state->d_sess;
++
++ if (!data || state->d_fd < 0) {
++ printf("cryptodev_digest_update: illegal inputs \n");
++ return (0);
++ }
++
++ if (!count) {
++ return (0);
++ }
++
++ if (!(ctx->flags & EVP_MD_CTX_FLAG_ONESHOT)) {
++ /* if application doesn't support one buffer */
++ state->mac_data = OPENSSL_realloc(state->mac_data, state->mac_len + count);
++
++ if (!state->mac_data) {
++ printf("cryptodev_digest_update: realloc failed\n");
++ return (0);
++ }
++
++ memcpy(state->mac_data + state->mac_len, data, count);
++ state->mac_len += count;
++
++ return (1);
++ }
++
++ memset(&cryp, 0, sizeof(cryp));
++
++ cryp.ses = sess->ses;
++ cryp.flags = 0;
++ cryp.len = count;
++ cryp.src = (caddr_t) data;
++ cryp.dst = NULL;
++ cryp.mac = state->digest_res;
++ if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) {
++ printf("cryptodev_digest_update: digest failed\n");
++ return (0);
++ }
++ return (1);
++}
++
++
++static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md)
++{
++ struct crypt_op cryp;
++ struct dev_crypto_state *state = ctx->md_data;
++ struct session_op *sess = &state->d_sess;
++
++ int ret = 1;
++
++ if (!md || state->d_fd < 0) {
++ printf("cryptodev_digest_final: illegal input\n");
++ return(0);
++ }
++
++ if (! (ctx->flags & EVP_MD_CTX_FLAG_ONESHOT) ) {
++ /* if application doesn't support one buffer */
++ memset(&cryp, 0, sizeof(cryp));
++
++ cryp.ses = sess->ses;
++ cryp.flags = 0;
++ cryp.len = state->mac_len;
++ cryp.src = state->mac_data;
++ cryp.dst = NULL;
++ cryp.mac = md;
++
++ if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) {
++ printf("cryptodev_digest_final: digest failed\n");
++ return (0);
++ }
++
++ return 1;
++ }
++
++ memcpy(md, state->digest_res, ctx->digest->md_size);
++
++ return (ret);
++}
++
++
++static int cryptodev_digest_cleanup(EVP_MD_CTX *ctx)
++{
++ int ret = 1;
++ struct dev_crypto_state *state = ctx->md_data;
++ struct session_op *sess = &state->d_sess;
++
++ if (state->d_fd < 0) {
++ printf("cryptodev_digest_cleanup: illegal input\n");
++ return (0);
++ }
++
++ if (state->mac_data) {
++ OPENSSL_free(state->mac_data);
++ state->mac_data = NULL;
++ state->mac_len = 0;
++ }
++
++ if (state->copy)
++ return 1;
++
++ if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) < 0) {
++ printf("cryptodev_digest_cleanup: failed to close session\n");
++ ret = 0;
++ } else {
++ ret = 1;
++ }
++ close(state->d_fd);
++ state->d_fd = -1;
++
++ return (ret);
++}
++
++static int cryptodev_digest_copy(EVP_MD_CTX *to,const EVP_MD_CTX *from)
++{
++ struct dev_crypto_state *fstate = from->md_data;
++ struct dev_crypto_state *dstate = to->md_data;
++
++ memcpy(dstate, fstate, sizeof(struct dev_crypto_state));
++
++ if (fstate->mac_len != 0) {
++ dstate->mac_data = OPENSSL_malloc(fstate->mac_len);
++ memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len);
++ }
++
++ dstate->copy = 1;
++
++ return 1;
++}
++
++
++const EVP_MD cryptodev_sha1 = {
++ NID_sha1,
++ NID_undef,
++ SHA_DIGEST_LENGTH,
++ EVP_MD_FLAG_ONESHOT,
++ cryptodev_digest_init,
++ cryptodev_digest_update,
++ cryptodev_digest_final,
++ cryptodev_digest_copy,
++ cryptodev_digest_cleanup,
++ EVP_PKEY_NULL_method,
++ SHA_CBLOCK,
++ sizeof(struct dev_crypto_state),
++};
++
++const EVP_MD cryptodev_md5 = {
++ NID_md5,
++ NID_undef,
++ 16 /* MD5_DIGEST_LENGTH */,
++ EVP_MD_FLAG_ONESHOT,
++ cryptodev_digest_init,
++ cryptodev_digest_update,
++ cryptodev_digest_final,
++ cryptodev_digest_copy,
++ cryptodev_digest_cleanup,
++ EVP_PKEY_NULL_method,
++ 64 /* MD5_CBLOCK */,
++ sizeof(struct dev_crypto_state),
++};
++
++#endif /* USE_CRYPTODEV_DIGESTS */
++
++
+ static int
+ cryptodev_engine_digests(ENGINE *e, const EVP_MD **digest,
+ const int **nids, int nid)
+@@ -606,10 +918,15 @@
+ return (cryptodev_usable_digests(nids));
+
+ switch (nid) {
++#ifdef USE_CRYPTODEV_DIGESTS
+ case NID_md5:
+- *digest = NULL; /* need to make a clean md5 critter */
++ *digest = &cryptodev_md5;
+ break;
++ case NID_sha1:
++ *digest = &cryptodev_sha1;
++ break;
+ default:
++#endif /* USE_CRYPTODEV_DIGESTS */
+ *digest = NULL;
+ break;
+ }
+@@ -625,7 +942,7 @@
+ bn2crparam(const BIGNUM *a, struct crparam *crp)
+ {
+ int i, j, k;
+- ssize_t words, bytes, bits;
++ ssize_t bytes, bits;
+ u_char *b;
+
+ crp->crp_p = NULL;
+@@ -637,6 +954,7 @@
+ b = malloc(bytes);
+ if (b == NULL)
+ return (1);
++ memset(b, 0, bytes);
+
+ crp->crp_p = b;
+ crp->crp_nbits = bits;
+@@ -681,7 +999,7 @@
+ {
+ int i;
+
+- for (i = 0; i <= kop->crk_iparams + kop->crk_oparams; i++) {
++ for (i = 0; i < kop->crk_iparams + kop->crk_oparams; i++) {
+ if (kop->crk_param[i].crp_p)
+ free(kop->crk_param[i].crp_p);
+ kop->crk_param[i].crp_p = NULL;
+@@ -756,12 +1074,10 @@
+ }
+
+ static int
+-cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa)
++cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
+ {
+ int r;
+- BN_CTX *ctx;
+-
+- ctx = BN_CTX_new();
++ ctx = BN_CTX_new(); /* not sure why we reallocate this. DM */
+ r = cryptodev_bn_mod_exp(r0, I, rsa->d, rsa->n, ctx, NULL);
+ BN_CTX_free(ctx);
+ return (r);
+Index: libssl/crypto/engine/engine.h
+===================================================================
+RCS file: libssl/crypto/engine/engine.h,v
+retrieving revision 1.1.1.6
+retrieving revision 1.6
+diff -u -r1.1.1.6 -r1.6
+--- libssl/crypto/engine/engine.h 15 Sep 2008 23:36:41 -0000 1.1.1.6
++++ libssl/crypto/engine/engine.h 15 Sep 2008 23:44:16 -0000 1.6
+@@ -703,7 +703,7 @@
+ * values. */
+ void *ENGINE_get_static_state(void);
+
+-#if defined(__OpenBSD__) || defined(__FreeBSD__)
++#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
+ void ENGINE_setup_bsd_cryptodev(void);
+ #endif
+
+Index: libssl/crypto/evp/c_all.c
+===================================================================
+RCS file: libssl/crypto/evp/c_all.c,v
+retrieving revision 1.1.1.4
+retrieving revision 1.3
+diff -u -r1.1.1.4 -r1.3
+--- libssl/crypto/evp/c_all.c 3 Feb 2006 00:06:07 -0000 1.1.1.4
++++ libssl/crypto/evp/c_all.c 23 Jul 2007 12:23:31 -0000 1.3
+@@ -83,7 +83,7 @@
+ OpenSSL_add_all_ciphers();
+ OpenSSL_add_all_digests();
+ #ifndef OPENSSL_NO_ENGINE
+-# if defined(__OpenBSD__) || defined(__FreeBSD__)
++# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
+ ENGINE_setup_bsd_cryptodev();
+ # endif
+ #endif
+Index: libssl/crypto/evp/c_alld.c
+===================================================================
+RCS file: libssl/crypto/evp/c_alld.c,v
+retrieving revision 1.1.1.4
+retrieving revision 1.3
+diff -u -r1.1.1.4 -r1.3
+--- libssl/crypto/evp/c_alld.c 3 Feb 2006 00:06:07 -0000 1.1.1.4
++++ libssl/crypto/evp/c_alld.c 3 Feb 2006 00:36:44 -0000 1.3
+@@ -81,7 +81,7 @@
+ EVP_add_digest(EVP_dss());
+ #endif
+ #endif
+-#ifndef OPENSSL_NO_SHA
++#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
+ EVP_add_digest(EVP_sha1());
+ EVP_add_digest_alias(SN_sha1,"ssl3-sha1");
+ EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA);
+Index: libssl/engines/Makefile
+===================================================================
+RCS file: libssl/engines/Makefile,v
+retrieving revision 1.1.1.3
+retrieving revision 1.3
+diff -u -r1.1.1.3 -r1.3
+--- libssl/engines/Makefile 15 Sep 2008 23:36:41 -0000 1.1.1.3
++++ libssl/engines/Makefile 15 Sep 2008 23:44:16 -0000 1.3
+@@ -96,6 +96,7 @@
+ ( echo installing $$l; \
+ if [ "$(PLATFORM)" != "Cygwin" ]; then \
+ case "$(CFLAGS)" in \
++ *OPENSSL_NO_HW*) continue;; \
+ *DSO_DLFCN*) sfx="so";; \
+ *DSO_DL*) sfx="sl";; \
+ *) sfx="bad";; \
diff --git a/package/openssl/patches/patch-Configure b/package/openssl/patches/patch-Configure
new file mode 100644
index 000000000..4fd60ccb8
--- /dev/null
+++ b/package/openssl/patches/patch-Configure
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssl-0.9.8i.orig/Configure 2008-09-12 16:47:00.000000000 +0200
++++ openssl-0.9.8i/Configure 2008-10-22 11:02:46.000000000 +0200
+@@ -357,6 +357,7 @@ my %table=(
+ "linux-alpha+bwx-gcc","gcc:-O3 -DL_ENDIAN -DTERMIO::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}",
+ "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${no_asm}",
++"linux-embedded","gcc:-DTERMIO \$(OPTIMIZATION_FLAGS) -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
+ #### *BSD [do see comment about ${BSDthreads} above!]
+ "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
diff --git a/package/openssl/patches/patch-Makefile_shared b/package/openssl/patches/patch-Makefile_shared
new file mode 100644
index 000000000..7665b6ce9
--- /dev/null
+++ b/package/openssl/patches/patch-Makefile_shared
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssl-0.9.8j.orig/Makefile.shared 2008-09-17 17:56:40.000000000 +0200
++++ openssl-0.9.8j/Makefile.shared 2009-01-08 14:29:26.619518188 +0100
+@@ -93,7 +93,6 @@ LINK_APP= \
+ LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
+
+ LINK_SO= \
+@@ -103,7 +102,6 @@ LINK_SO= \
+ SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+- LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${SHAREDCMD} $${SHAREDFLAGS} \
+ -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
+ $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
diff --git a/package/openssl/patches/patch-apps_speed_c b/package/openssl/patches/patch-apps_speed_c
new file mode 100644
index 000000000..3fd410d7a
--- /dev/null
+++ b/package/openssl/patches/patch-apps_speed_c
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssl-0.9.8i.orig/apps/speed.c 2007-11-15 14:33:47.000000000 +0100
++++ openssl-0.9.8i/apps/speed.c 2008-10-22 11:47:28.000000000 +0200
+@@ -110,10 +110,10 @@
+
+ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(OPENSSL_SYS_MACOSX)
+ # define USE_TOD
+-#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC))
++#elif !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VXWORKS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && defined(__linux__)
+ # define TIMES
+ #endif
+-#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) /* FIXME */
++#if !defined(_UNICOS) && !defined(__OpenBSD__) && !defined(sgi) && !defined(__FreeBSD__) && !(defined(__bsdi) || defined(__bsdi__)) && !defined(_AIX) && !defined(OPENSSL_SYS_MPE) && !defined(__NetBSD__) && !defined(OPENSSL_SYS_VXWORKS) && !defined(__linux__) /* FIXME */
+ # define TIMEB
+ #endif
+
diff --git a/package/openssl/patches/patch-util_shlib_wrap_sh b/package/openssl/patches/patch-util_shlib_wrap_sh
new file mode 100644
index 000000000..b7a56f304
--- /dev/null
+++ b/package/openssl/patches/patch-util_shlib_wrap_sh
@@ -0,0 +1,17 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openssl-0.9.8j.orig/util/shlib_wrap.sh 2007-08-27 10:52:57.000000000 +0200
++++ openssl-0.9.8j/util/shlib_wrap.sh 2009-01-08 14:11:14.967293819 +0100
+@@ -57,11 +57,10 @@ SunOS|IRIX*)
+ eval $rld_var=\"${THERE}'${'$rld_var':+:$'$rld_var'}'\"; export $rld_var
+ unset rld_var
+ ;;
+-*) LD_LIBRARY_PATH="${THERE}:$LD_LIBRARY_PATH" # Linux, ELF HP-UX
+- DYLD_LIBRARY_PATH="${THERE}:$DYLD_LIBRARY_PATH" # MacOS X
++*) DYLD_LIBRARY_PATH="${THERE}:$DYLD_LIBRARY_PATH" # MacOS X
+ SHLIB_PATH="${THERE}:$SHLIB_PATH" # legacy HP-UX
+ LIBPATH="${THERE}:$LIBPATH" # AIX, OS/2
+- export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH
++ export DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH
+ # Even though $PATH is adjusted [for Windows sake], it doesn't
+ # necessarily does the trick. Trouble is that with introduction
+ # of SafeDllSearchMode in XP/2003 it's more appropriate to copy
diff --git a/package/openswan/Config.in b/package/openswan/Config.in
new file mode 100644
index 000000000..9bb43fa5c
--- /dev/null
+++ b/package/openswan/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_OPENSWAN
+ prompt "openswan.......................... VPN solution using IPsec"
+ tristate
+ default n
+ select ADK_PACKAGE_IP
+ select ADK_PACKAGE_LIBGMP
+ help
+ Openswan is an implementation of IPsec for Linux.
+
+ http://www.openswan.org/
diff --git a/package/openswan/Makefile b/package/openswan/Makefile
new file mode 100644
index 000000000..372b52a4e
--- /dev/null
+++ b/package/openswan/Makefile
@@ -0,0 +1,59 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= openswan
+PKG_VERSION:= 2.6.21
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ba9da6c90e0f5fe856767d7510ce371f
+MASTER_SITES:= http://www.openswan.org/download/ \
+ ftp://ftp.openswan.org/openswan/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OPENSWAN,openswan,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+FLAGS:= ${TCFLAGS} ${TCPPFLAGS} ${TLDFLAGS}
+
+do-build:
+ ${MAKE} -C ${WRKBUILD} \
+ ${TARGET_CONFIGURE_OPTS} \
+ KERNELSRC="${LINUX_DIR}" \
+ ARCH="${ARCH}" \
+ USERCOMPILE="${FLAGS}" \
+ EXTRA_INCLUDE="${TCPPFLAGS}" \
+ EXTRA_LIBS="${TLDFLAGS}" \
+ IPSECDIR="/usr/lib/ipsec" \
+ INC_USRLOCAL="/usr" \
+ MODPROBE="insmod" \
+ programs
+
+do-install:
+ ${MAKE} -C ${WRKBUILD} \
+ ${TARGET_CONFIGURE_OPTS} \
+ DESTDIR="${IDIR_OPENSWAN}" \
+ KERNELSRC="${LINUX_DIR}" \
+ ARCH="${ARCH}" \
+ USERCOMPILE="${FLAGS}" \
+ IPSECDIR="/usr/lib/ipsec" \
+ INC_USRLOCAL="/usr" \
+ MODPROBE="insmod" \
+ install
+
+post-install:
+ rm -rf ${IDIR_OPENSWAN}/usr/share
+ rm -rf ${IDIR_OPENSWAN}/usr/man
+ rm -rf ${IDIR_OPENSWAN}/var
+ mv ${IDIR_OPENSWAN}/etc/rc.d/init.d/ipsec \
+ ${IDIR_OPENSWAN}/usr/libexec/ipsec/setup
+ rm -rf ${IDIR_OPENSWAN}/etc/rc*.d
+ find ${IDIR_OPENSWAN} -name \*.old -print0 | xargs -0 rm -rf
+ mkdir -p ${IDIR_OPENSWAN}/etc/init.d
+ ${INSTALL_BIN} ./files/openswan.init \
+ ${IDIR_OPENSWAN}/etc/init.d/ipsec
+ #${IPKG_BUILD} ${IDIR_OPENSWAN} ${PACKAGE_DIR}
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openswan/files/openswan.init b/package/openswan/files/openswan.init
new file mode 100644
index 000000000..04ac52052
--- /dev/null
+++ b/package/openswan/files/openswan.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${ipsec:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/libexec/ipsec/setup start
+ ;;
+stop)
+ /usr/libexec/ipsec/setup stop
+ ;;
+restart)
+ sh $0 stop
+ sleep 3
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/openswan/ipkg/openswan.conffiles b/package/openswan/ipkg/openswan.conffiles
new file mode 100644
index 000000000..ff0851c29
--- /dev/null
+++ b/package/openswan/ipkg/openswan.conffiles
@@ -0,0 +1 @@
+/etc/ipsec.conf
diff --git a/package/openswan/ipkg/openswan.control b/package/openswan/ipkg/openswan.control
new file mode 100644
index 000000000..5ff4bfe0c
--- /dev/null
+++ b/package/openswan/ipkg/openswan.control
@@ -0,0 +1,5 @@
+Package: openswan
+Section: base
+Priority: optional
+Depends: libgmp, ip
+Description: Openswan IPSec software
diff --git a/package/openswan/ipkg/openswan.postinst b/package/openswan/ipkg/openswan.postinst
new file mode 100644
index 000000000..a5f8e11b2
--- /dev/null
+++ b/package/openswan/ipkg/openswan.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf ipsec ipsec NO
diff --git a/package/openswan/patches/patch-lib_libdns_Makefile b/package/openswan/patches/patch-lib_libdns_Makefile
new file mode 100644
index 000000000..bfb17431c
--- /dev/null
+++ b/package/openswan/patches/patch-lib_libdns_Makefile
@@ -0,0 +1,10 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openswan-2.6.18.orig/lib/libdns/Makefile 2008-10-06 18:52:49.000000000 +0200
++++ openswan-2.6.18/lib/libdns/Makefile 2008-10-14 13:08:03.000000000 +0200
+@@ -102,5 +102,5 @@ code.h: gen
+ # cross-compiled!
+ HOSTCC?=cc
+ gen: gen.c
+- ${HOSTCC} ${HOSTCINCLUDES} ${LDFLAGS} -o $@ ${srcdir}gen.c ${LIBS}
++ ${HOSTCC} ${HOSTCINCLUDES} -o $@ ${srcdir}gen.c ${LIBS}
+
diff --git a/package/openswan/patches/patch-lib_libopenswan_alg_info_c b/package/openswan/patches/patch-lib_libopenswan_alg_info_c
new file mode 100644
index 000000000..0c616e07c
--- /dev/null
+++ b/package/openswan/patches/patch-lib_libopenswan_alg_info_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openswan-2.6.18.orig/lib/libopenswan/alg_info.c 2008-10-06 18:52:49.000000000 +0200
++++ openswan-2.6.18/lib/libopenswan/alg_info.c 2008-10-14 13:08:49.000000000 +0200
+@@ -749,7 +749,7 @@ alg_info_discover_pfsgroup_hack(struct a
+ static char err_buf[256];
+ int ret;
+
+- pfs_name=index(esp_buf, ';');
++ pfs_name=strchr(esp_buf, ';');
+
+ if(pfs_name) {
+ *pfs_name='\0';
diff --git a/package/openswan/patches/patch-programs_ikeping_ikeping_c b/package/openswan/patches/patch-programs_ikeping_ikeping_c
new file mode 100644
index 000000000..5e8bde61b
--- /dev/null
+++ b/package/openswan/patches/patch-programs_ikeping_ikeping_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- openswan-2.6.18.orig/programs/ikeping/ikeping.c 2008-10-06 18:52:49.000000000 +0200
++++ openswan-2.6.18/programs/ikeping/ikeping.c 2008-10-14 13:09:06.000000000 +0200
+@@ -316,7 +316,7 @@ main(int argc, char **argv)
+ natt=0;
+ listen_only=0;
+ noDNS=0;
+- bzero(&laddr, sizeof(laddr));
++ memset(&laddr, 0, sizeof(laddr));
+
+ while((c = getopt_long(argc, argv, "hVnvsp:b:46E:w:", long_opts, 0))!=EOF) {
+ switch (c) {
diff --git a/package/openvpn/Config.in b/package/openvpn/Config.in
new file mode 100644
index 000000000..18fd4f298
--- /dev/null
+++ b/package/openvpn/Config.in
@@ -0,0 +1,64 @@
+
+config ADK_PACKAGE_OPENVPN
+ prompt "openvpn........................... Open source VPN solution using SSL"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_TUN
+ help
+ Open Source VPN solution using SSL
+
+ http://openvpn.net/
+
+ Depends: kmod-tun, libpthread
+
+config ADK_COMPILE_OPENVPN_WITH_SERVER
+ prompt "server support.................. enable to use OpenVPN as server"
+ bool
+ default y
+ depends ADK_PACKAGE_OPENVPN
+
+config ADK_COMPILE_OPENVPN_WITH_HTTP
+ prompt "enable http proxy support....... allow tunneling through http-proxy"
+ bool
+ default y
+ depends ADK_PACKAGE_OPENVPN
+
+config ADK_COMPILE_OPENVPN_WITH_OPENSSL
+ prompt "enable openssl.................. encryption support"
+ bool
+ default y
+ depends ADK_PACKAGE_OPENVPN
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ if unsure say "y" you really want that!
+
+config ADK_COMPILE_OPENVPN_WITH_LZO
+ prompt "enable lzo...................... Enable transparent compression"
+ bool
+ default y
+ depends ADK_PACKAGE_OPENVPN
+ select ADK_PACKAGE_LIBLZO
+
+config ADK_COMPILE_OPENVPN_WITH_PASSWORD_SAVE
+ prompt "Enable password saving.......... allow to read passwords for PKCS12 from file"
+ bool
+ default y
+ depends ADK_PACKAGE_OPENVPN
+
+config ADK_COMPILE_OPENVPN_WITH_SMALL
+ prompt "Reduce executable size.......... disable OCC, usage message, and verb 4 parm list"
+ bool
+ default n
+ depends ADK_PACKAGE_OPENVPN
+
+config ADK_PACKAGE_OPENVPN_EASY_RSA
+ prompt "openvpn-easy-rsa................ simple shell scripts to manage a Certificate Authority"
+ tristate
+ default n
+ select ADK_PACKAGE_OPENSSL_UTIL
+ depends ADK_PACKAGE_OPENVPN
+ help
+ collection of shell scripts to manage a simple CA infrastructure
+
+ Depends: openpvn, openssl-util
+
diff --git a/package/openvpn/Makefile b/package/openvpn/Makefile
new file mode 100644
index 000000000..0624b76ba
--- /dev/null
+++ b/package/openvpn/Makefile
@@ -0,0 +1,86 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= openvpn
+PKG_VERSION:= 2.0.9
+PKG_RELEASE:= 7
+PKG_MD5SUM:= 60745008b90b7dbe25fe8337c550fec6
+
+MASTER_SITES:= http://openvpn.net/release/ \
+ ${MASTER_SITE_SOURCEFORGE:=openvpn/}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,OPENVPN,openvpn,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,OPENVPN_EASY_RSA,openvpn-easy-rsa,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+PKG_DEPEND:="kmod-tun"
+
+ifneq ($(ADK_COMPILE_OPENVPN_WITH_OPENSSL),y)
+DISABLE_OPENSSL:=--disable-ssl --disable-crypto
+else
+PKG_DEPEND+=", libopenssl"
+endif
+
+ifneq ($(ADK_COMPILE_OPENVPN_WITH_LZO),y)
+DISABLE_LZO:=--disable-lzo
+else
+PKG_DEPEND+=", liblzo"
+endif
+
+ifneq ($(ADK_COMPILE_OPENVPN_WITH_SERVER),y)
+DISABLE_SERVER:=--disable-server
+endif
+ifneq ($(ADK_COMPILE_OPENVPN_WITH_HTTP),y)
+DISABLE_HTTP:=--disable-http
+endif
+ifeq ($(ADK_COMPILE_OPENVPN_WITH_PASSWORD_SAVE),y)
+ENABLE_PASSWORD_SAVE:=--enable-password-save
+endif
+ifeq ($(ADK_COMPILE_OPENVPN_WITH_SMALL),y)
+ENABLE_SMALL:=--enable-small
+endif
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+ LDFLAGS="-L$(STAGING_DIR)/usr/lib"
+CONFIGURE_ARGS+= --disable-pthread \
+ --disable-plugins \
+ --disable-management \
+ --disable-socks \
+ --enable-iproute2 \
+ --with-iproute-path=ip \
+ --without-ifconfig-path \
+ --without-route-path \
+ $(DISABLE_LZO) \
+ $(DISABLE_OPENSSL) \
+ $(DISABLE_SERVER) \
+ $(DISABLE_HTTP) \
+ $(ENABLE_PASSWORD_SAVE) \
+ $(ENABLE_SMALL)
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ # main package
+ install -d -m0755 $(IDIR_OPENVPN)/usr/sbin
+ $(CP) $(WRKINST)/usr/sbin/openvpn $(IDIR_OPENVPN)/usr/sbin/
+ install -d -m0755 $(IDIR_OPENVPN)/etc/init.d
+ $(CP) ./files/openvpn.init $(IDIR_OPENVPN)/etc/init.d/openvpn
+ install -d -m0755 $(IDIR_OPENVPN)/etc/openvpn
+ $(CP) ./files/openvpn.conf $(IDIR_OPENVPN)/etc/openvpn/
+ echo "Depends: $(PKG_DEPEND)" >> $(IDIR_OPENVPN)/CONTROL/control
+ # subpackage easy-rsa
+ install -d -m0755 $(IDIR_OPENVPN_EASY_RSA)/usr/sbin
+ install -d -m0755 $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/keys
+ touch $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/keys/index.txt
+ $(CP) ./files/serial $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/keys
+ $(CP) $(WRKBUILD)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(IDIR_OPENVPN_EASY_RSA)/usr/sbin
+ install -m 0644 $(WRKBUILD)/easy-rsa/2.0/openssl.cnf $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/openssl.cnf
+ install -m 0644 $(WRKBUILD)/easy-rsa/2.0/vars $(IDIR_OPENVPN_EASY_RSA)/etc/easy-rsa/vars
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/openvpn/files/openvpn.conf b/package/openvpn/files/openvpn.conf
new file mode 100644
index 000000000..d951eaea8
--- /dev/null
+++ b/package/openvpn/files/openvpn.conf
@@ -0,0 +1,11 @@
+client
+remote server.domain.tld
+dev tun
+nobind
+ca ca.pem
+cert client.cer
+key client.key
+persist-tun
+persist-key
+comp-lzo
+verb 3
diff --git a/package/openvpn/files/openvpn.init b/package/openvpn/files/openvpn.init
new file mode 100644
index 000000000..5fe02af59
--- /dev/null
+++ b/package/openvpn/files/openvpn.init
@@ -0,0 +1,29 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${openvpn:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ for c in $(ls /etc/openvpn/*.conf 2>&-); do
+ openvpn --cd /etc/openvpn --config "$c" --daemon
+ done
+ ;;
+stop)
+ killall openvpn
+ ;;
+restart)
+ sh $0 stop
+ sleep 3
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/openvpn/files/serial b/package/openvpn/files/serial
new file mode 100644
index 000000000..8a0f05e16
--- /dev/null
+++ b/package/openvpn/files/serial
@@ -0,0 +1 @@
+01
diff --git a/package/openvpn/ipkg/openvpn-easy-rsa.control b/package/openvpn/ipkg/openvpn-easy-rsa.control
new file mode 100644
index 000000000..6ce25a46a
--- /dev/null
+++ b/package/openvpn/ipkg/openvpn-easy-rsa.control
@@ -0,0 +1,5 @@
+Package: openvpn-easy-rsa
+Priority: optional
+Section: net
+Description: collection of shell scripts to manage a simple CA infrastructure
+Depends: openssl-util
diff --git a/package/openvpn/ipkg/openvpn.control b/package/openvpn/ipkg/openvpn.control
new file mode 100644
index 000000000..50f06bacb
--- /dev/null
+++ b/package/openvpn/ipkg/openvpn.control
@@ -0,0 +1,4 @@
+Package: openvpn
+Priority: optional
+Section: net
+Description: Open Source VPN solution using SSL
diff --git a/package/openvpn/ipkg/openvpn.postinst b/package/openvpn/ipkg/openvpn.postinst
new file mode 100644
index 000000000..576ddd9f5
--- /dev/null
+++ b/package/openvpn/ipkg/openvpn.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf openvpn openvpn NO
diff --git a/package/openvpn/patches/easy-rsa.patch b/package/openvpn/patches/easy-rsa.patch
new file mode 100644
index 000000000..957fe336e
--- /dev/null
+++ b/package/openvpn/patches/easy-rsa.patch
@@ -0,0 +1,218 @@
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-ca openvpn-2.0.8/easy-rsa/2.0/build-ca
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-ca 2005-11-02 19:42:38.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-ca 2006-10-13 18:14:32.000000000 +0200
+@@ -1,8 +1,7 @@
+-#!/bin/bash
++#!/bin/sh
+
+ #
+ # Build a root certificate
+ #
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --initca $*
++/usr/sbin/pkitool --interact --initca $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-dh openvpn-2.0.8/easy-rsa/2.0/build-dh
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-dh 2006-06-28 08:29:27.000000000 +0200
++++ openvpn-2.0.8/easy-rsa/2.0/build-dh 2006-10-13 18:13:40.000000000 +0200
+@@ -1,4 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
++
++. /etc/easy-rsa/vars
+
+ # Build Diffie-Hellman parameters for the server side
+ # of an SSL/TLS connection.
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-inter openvpn-2.0.8/easy-rsa/2.0/build-inter
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-inter 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-inter 2006-10-13 18:14:32.000000000 +0200
+@@ -1,7 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Make an intermediate CA certificate/private key pair using a locally generated
+ # root certificate.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --inter $*
++/usr/sbin/pkitool --interact --inter $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-key openvpn-2.0.8/easy-rsa/2.0/build-key
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-key 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-key 2006-10-13 18:14:32.000000000 +0200
+@@ -1,7 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Make a certificate/private key pair using a locally generated
+ # root certificate.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact $*
++/usr/sbin/pkitool --interact $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-key-pass openvpn-2.0.8/easy-rsa/2.0/build-key-pass
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-key-pass 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-key-pass 2006-10-13 18:14:32.000000000 +0200
+@@ -1,7 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Similar to build-key, but protect the private key
+ # with a password.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --pass $*
++/usr/sbin/pkitool --interact --pass $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-key-pkcs12 openvpn-2.0.8/easy-rsa/2.0/build-key-pkcs12
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-key-pkcs12 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-key-pkcs12 2006-10-13 18:14:32.000000000 +0200
+@@ -1,8 +1,7 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Make a certificate/private key pair using a locally generated
+ # root certificate and convert it to a PKCS #12 file including the
+ # the CA certificate as well.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --pkcs12 $*
++/usr/sbin/pkitool --interact --pkcs12 $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-key-server openvpn-2.0.8/easy-rsa/2.0/build-key-server
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-key-server 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-key-server 2006-10-13 18:14:32.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Make a certificate/private key pair using a locally generated
+ # root certificate.
+@@ -6,5 +6,4 @@
+ # Explicitly set nsCertType to server using the "server"
+ # extension in the openssl.cnf file.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --server $*
++/usr/sbin/pkitool --interact --server $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-req openvpn-2.0.8/easy-rsa/2.0/build-req
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-req 2005-11-02 19:42:38.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-req 2006-10-13 18:14:32.000000000 +0200
+@@ -1,7 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Build a certificate signing request and private key. Use this
+ # when your root certificate and key is not available locally.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --csr $*
++/usr/sbin/pkitool --interact --csr $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/build-req-pass openvpn-2.0.8/easy-rsa/2.0/build-req-pass
+--- openvpn-2.0.8_orig/easy-rsa/2.0/build-req-pass 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/build-req-pass 2006-10-13 18:14:32.000000000 +0200
+@@ -1,7 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Like build-req, but protect your private key
+ # with a password.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --csr --pass $*
++/usr/sbin/pkitool --interact --csr --pass $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/clean-all openvpn-2.0.8/easy-rsa/2.0/clean-all
+--- openvpn-2.0.8_orig/easy-rsa/2.0/clean-all 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/clean-all 2006-10-13 18:13:40.000000000 +0200
+@@ -1,4 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
++
++. /etc/easy-rsa/vars
+
+ # Initialize the $KEY_DIR directory.
+ # Note that this script does a
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/inherit-inter openvpn-2.0.8/easy-rsa/2.0/inherit-inter
+--- openvpn-2.0.8_orig/easy-rsa/2.0/inherit-inter 2005-11-02 19:42:38.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/inherit-inter 2006-10-13 18:13:40.000000000 +0200
+@@ -1,4 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
++
++. /etc/easy-rsa/vars
+
+ # Build a new PKI which is rooted on an intermediate certificate generated
+ # by ./build-inter or ./pkitool --inter from a parent PKI. The new PKI should
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/list-crl openvpn-2.0.8/easy-rsa/2.0/list-crl
+--- openvpn-2.0.8_orig/easy-rsa/2.0/list-crl 2006-06-28 08:29:27.000000000 +0200
++++ openvpn-2.0.8/easy-rsa/2.0/list-crl 2006-10-13 18:13:40.000000000 +0200
+@@ -1,4 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
++
++. /etc/easy-rsa/vars
+
+ # list revoked certificates
+
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/pkitool openvpn-2.0.8/easy-rsa/2.0/pkitool
+--- openvpn-2.0.8_orig/easy-rsa/2.0/pkitool 2006-06-28 08:29:27.000000000 +0200
++++ openvpn-2.0.8/easy-rsa/2.0/pkitool 2006-10-13 18:13:40.000000000 +0200
+@@ -1,5 +1,7 @@
+ #!/bin/sh
+
++. /etc/easy-rsa/vars
++
+ # OpenVPN -- An application to securely tunnel IP networks
+ # over a single TCP/UDP port, with support for SSL/TLS-based
+ # session authentication and key exchange,
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/revoke-full openvpn-2.0.8/easy-rsa/2.0/revoke-full
+--- openvpn-2.0.8_orig/easy-rsa/2.0/revoke-full 2006-06-28 08:29:27.000000000 +0200
++++ openvpn-2.0.8/easy-rsa/2.0/revoke-full 2006-10-13 18:13:40.000000000 +0200
+@@ -1,4 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
++
++. /etc/easy-rsa/vars
+
+ # revoke a certificate, regenerate CRL,
+ # and verify revocation
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/sign-req openvpn-2.0.8/easy-rsa/2.0/sign-req
+--- openvpn-2.0.8_orig/easy-rsa/2.0/sign-req 2005-11-02 19:42:39.000000000 +0100
++++ openvpn-2.0.8/easy-rsa/2.0/sign-req 2006-10-13 18:14:32.000000000 +0200
+@@ -1,7 +1,6 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Sign a certificate signing request (a .csr file)
+ # with a local root certificate and key.
+
+-export EASY_RSA="${EASY_RSA:-.}"
+-"$EASY_RSA/pkitool" --interact --sign $*
++/usr/sbin/pkitool --interact --sign $*
+diff -Nur openvpn-2.0.8_orig/easy-rsa/2.0/vars openvpn-2.0.8/easy-rsa/2.0/vars
+--- openvpn-2.0.8_orig/easy-rsa/2.0/vars 2006-06-28 08:29:27.000000000 +0200
++++ openvpn-2.0.8/easy-rsa/2.0/vars 2006-10-13 18:24:03.000000000 +0200
+@@ -12,7 +12,7 @@
+ # This variable should point to
+ # the top level of the easy-rsa
+ # tree.
+-export EASY_RSA="`pwd`"
++export EASY_RSA="/etc/easy-rsa"
+
+ #
+ # This variable should point to
+@@ -26,7 +26,7 @@
+ # This variable should point to
+ # the openssl.cnf file included
+ # with easy-rsa.
+-export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`
++export KEY_CONFIG=`/usr/sbin/whichopensslcnf $EASY_RSA`
+
+ # Edit this variable to point to
+ # your soon-to-be-created key
+@@ -39,7 +39,7 @@
+ export KEY_DIR="$EASY_RSA/keys"
+
+ # Issue rm -rf warning
+-echo NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR
++echo NOTE: If you run /usr/sbin/clean-all, I will be doing a rm -rf on $KEY_DIR
+
+ # Increase this to 2048 if you
+ # are paranoid. This will slow
diff --git a/package/oprofile/Config.in b/package/oprofile/Config.in
new file mode 100644
index 000000000..c2c181b66
--- /dev/null
+++ b/package/oprofile/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_OPROFILE
+ prompt "oprofile.......................... a system-wide profiler"
+ tristate
+ select ADK_PACKAGE_LIBPOPT
+ depends on ADK_CXX
+ default n
+ help
+ http://oprofile.sourceforge.net
+
diff --git a/package/oprofile/Makefile b/package/oprofile/Makefile
new file mode 100644
index 000000000..04fb15fda
--- /dev/null
+++ b/package/oprofile/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= oprofile
+PKG_VERSION:= 0.9.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 82b059379895cf125261d7d773465915
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=oprofile/}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,OPROFILE,oprofile,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+TLDFLAGS+= -shared
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --with-kernel-support --with-linux=${LINUX_DIR}
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_OPROFILE)/usr/bin
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/opcontrol $(IDIR_OPROFILE)/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/oprofile/ipkg/oprofile.control b/package/oprofile/ipkg/oprofile.control
new file mode 100644
index 000000000..d7867f676
--- /dev/null
+++ b/package/oprofile/ipkg/oprofile.control
@@ -0,0 +1,5 @@
+Package: oprofile
+Priority: optional
+Section: utils
+Depends: libpopt, uclibc++
+Description: system-wide profiler
diff --git a/package/osiris/Config.in b/package/osiris/Config.in
new file mode 100644
index 000000000..84a16435a
--- /dev/null
+++ b/package/osiris/Config.in
@@ -0,0 +1,18 @@
+config ADK_COMPILE_OSIRIS
+ tristate
+ default n
+ depends ADK_PACKAGE_OSIRISD
+
+config ADK_PACKAGE_OSIRISD
+ prompt "osirisd........................... Host integrity monitoring system (scanning agent)"
+ tristate
+ default n
+ select ADK_COMPILE_OSIRIS
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ An host integrity monitoring system (scanning agent)
+
+ http://www.hostintegrity.com/osiris/
+
+ Depends: openssl
+
diff --git a/package/osiris/Makefile b/package/osiris/Makefile
new file mode 100644
index 000000000..0cae63ab0
--- /dev/null
+++ b/package/osiris/Makefile
@@ -0,0 +1,42 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= osiris
+PKG_VERSION:= 4.2.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1951c7dc0fe729af9ffaf58910340d12
+MASTER_SITES:= http://osiris.shmoo.com/data/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OSIRISD,osirisd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_openssldir="${STAGING_DIR}/usr" \
+ ac_cv_have_accrights_in_msghdr=no \
+ ac_cv_have_control_in_msghdr=yes
+CONFIGURE_ARGS+= --with-osiris-user=root \
+ --with-root-dir=/var/lib/osiris \
+ --with-readline=no
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= ar=${TARGET_CROSS}ar \
+ INTERACTIVE=0
+TCFLAGS+= -DOPENSSL_NO_RIPEMD
+
+post-configure:
+ (cd ${WRKDIST}/src/osirisd/modules && ./genmods.sh);
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_OSIRISD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_OSIRISD}/usr/sbin
+ ${INSTALL_BIN} ./files/osirisd.init \
+ ${IDIR_OSIRISD}/etc/init.d/osirisd
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/osirisd \
+ ${IDIR_OSIRISD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/osiris/files/osirisd.init b/package/osiris/files/osirisd.init
new file mode 100644
index 000000000..4172f702a
--- /dev/null
+++ b/package/osiris/files/osirisd.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${osirisd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/lib/osiris ] || mkdir -p /var/lib/osiris
+ osirisd
+ ;;
+stop)
+ killall osirisd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/osiris/ipkg/osirisd.control b/package/osiris/ipkg/osirisd.control
new file mode 100644
index 000000000..defe7c356
--- /dev/null
+++ b/package/osiris/ipkg/osirisd.control
@@ -0,0 +1,5 @@
+Package: osirisd
+Priority: optional
+Section: admin
+Depends: libopenssl, libpthread
+Description: an Host Integrity Monitoring System (scanning agent)
diff --git a/package/osiris/ipkg/osirisd.postinst b/package/osiris/ipkg/osirisd.postinst
new file mode 100644
index 000000000..04e53ac93
--- /dev/null
+++ b/package/osiris/ipkg/osirisd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf osirisd osirisd NO
diff --git a/package/osiris/patches/patch-configure b/package/osiris/patches/patch-configure
new file mode 100644
index 000000000..c6e56a0b0
--- /dev/null
+++ b/package/osiris/patches/patch-configure
@@ -0,0 +1,32 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/configure 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/configure 2009-05-10 21:10:24.000000000 +0200
+@@ -3738,7 +3738,7 @@ CYGWIN*)
+ esac
+
+
+-DB_CONFIG_ARGS="--enable-shared=no --enable-static=yes"
++DB_CONFIG_ARGS="--enable-shared=no --enable-static=yes --target=${target_alias} --host=${host_alias} --build=${build_alias}"
+
+ case "${OS_NAME}" in
+ MINGW32*)
+@@ -4448,11 +4448,6 @@ cat >>confdefs.h <<_ACEOF
+ #define SYSTEM_LINUX 1
+ _ACEOF
+
+-
+- rc=`grep -c krb5 /usr/include/openssl/ssl.h`
+- if test $rc -ne 0; then
+- CPPFLAGS="-I/usr/kerberos/include/ ${CPPFLAGS}"
+- fi
+ ;;
+ BSD*)
+
+@@ -11394,7 +11389,6 @@ chmod ug+x src/install/install.sh
+ echo " Osiris MD Directory: ${with_md_root_dir}"
+ echo " Osiris MD user: ${with_osiris_md_user}"
+ echo " Osiris MD config dir: ${with_md_conf_dir}"
+- cd ./src/osirisd/modules;./genmods.sh;cd ../../..
+ echo " ==> use one of the following targets:"
+ echo ""
+ echo " all: make everything, agent, CLI and management console."
diff --git a/package/osiris/patches/patch-src_libosiris_Makefile_in b/package/osiris/patches/patch-src_libosiris_Makefile_in
new file mode 100644
index 000000000..a7d09c693
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_Makefile_in
@@ -0,0 +1,41 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/Makefile.in 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/Makefile.in 2009-05-10 20:51:38.000000000 +0200
+@@ -105,7 +105,7 @@ libosiris_a_SOURCES = list.c message.c s
+ filter_uid.c filter_gid.c filter_user.c \
+ filter_group.c filter_header.c filter_file.c \
+ filter_suffix.c filter_md5.c filter_sha.c \
+- filter_ripemd.c filter_sid.c filter_permissions.c \
++ filter_sid.c filter_permissions.c \
+ string_list.h ssl_utilities.h utilities.h \
+ regex.h regex.c debug.h debug.c strcasestr.c \
+ error.h strptime.h
+@@ -128,11 +128,10 @@ am_libosiris_a_OBJECTS = list.$(OBJEXT)
+ filter_python.$(OBJEXT) filter_script.$(OBJEXT) \
+ filter_gzip.$(OBJEXT) filter_zip.$(OBJEXT) filter_tar.$(OBJEXT) \
+ filter_pgp.$(OBJEXT) filter_rpm.$(OBJEXT) filter_uid.$(OBJEXT) \
+- filter_gid.$(OBJEXT) filter_user.$(OBJEXT) \
++ filter_gid.$(OBJEXT) filter_user.$(OBJEXT) filter_sid.$(OBJEXT) \
+ filter_group.$(OBJEXT) filter_header.$(OBJEXT) \
+ filter_file.$(OBJEXT) filter_suffix.$(OBJEXT) \
+ filter_md5.$(OBJEXT) filter_sha.$(OBJEXT) \
+- filter_ripemd.$(OBJEXT) filter_sid.$(OBJEXT) \
+ filter_permissions.$(OBJEXT) regex.$(OBJEXT) debug.$(OBJEXT) \
+ strcasestr.$(OBJEXT)
+ libosiris_a_OBJECTS = $(am_libosiris_a_OBJECTS)
+@@ -158,7 +157,6 @@ am__depfiles_maybe = depfiles
+ @AMDEP_TRUE@ ./$(DEPDIR)/filter_permissions.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/filter_pgp.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/filter_python.Po \
+-@AMDEP_TRUE@ ./$(DEPDIR)/filter_ripemd.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/filter_rpm.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/filter_script.Po \
+ @AMDEP_TRUE@ ./$(DEPDIR)/filter_sgid.Po \
+@@ -224,7 +222,6 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_permissions.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_pgp.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_python.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_ripemd.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_rpm.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_script.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_sgid.Po@am__quote@
diff --git a/package/osiris/patches/patch-src_libosiris_configuration_c b/package/osiris/patches/patch-src_libosiris_configuration_c
new file mode 100644
index 000000000..f4b164b52
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_configuration_c
@@ -0,0 +1,27 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/configuration.c 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/configuration.c 2009-05-10 21:06:49.000000000 +0200
+@@ -105,9 +105,11 @@ static struct keywords hash_keywords[] =
+ { "sha1", HASH_SHA },
+ { "sha-1", HASH_SHA },
+
++#ifndef OPENSSL_NO_RIPEMD
+ { "ripemd", HASH_RIPEMD },
+ { "ripemd-160", HASH_RIPEMD },
+ { "ripemd160", HASH_RIPEMD },
++#endif
+
+ { NULL, 0 }
+ };
+@@ -119,9 +121,11 @@ static char * valid_hash_values[] =
+ "sha",
+ "sha1",
+ "sha-1",
++#ifndef OPENSSL_NO_RIPEMD
+ "ripemd",
+ "ripemd160",
+ "ripemd-160",
++#endif
+ NULL
+ };
+
diff --git a/package/osiris/patches/patch-src_libosiris_configuration_h b/package/osiris/patches/patch-src_libosiris_configuration_h
new file mode 100644
index 000000000..6cf7c3540
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_configuration_h
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/configuration.h 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/configuration.h 2009-05-10 21:19:28.000000000 +0200
+@@ -45,7 +45,9 @@
+ #define HASH_DEFAULT HASH_MD5
+ #define HASH_MD5 1
+ #define HASH_SHA 2
++#ifndef OPENSSL_NO_RIPEMD
+ #define HASH_RIPEMD 3
++#endif
+
+ /* config keyword types */
+
diff --git a/package/osiris/patches/patch-src_libosiris_filter_c b/package/osiris/patches/patch-src_libosiris_filter_c
new file mode 100644
index 000000000..d7306ea14
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_filter_c
@@ -0,0 +1,35 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/filter.c 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/filter.c 2009-05-10 21:02:44.000000000 +0200
+@@ -66,7 +66,9 @@ static struct keywords filter_keywords[]
+ { "suffix", FILTER_TYPE_SUFFIX },
+ { "md5", FILTER_TYPE_MD5 },
+ { "sha", FILTER_TYPE_SHA },
++#ifndef OPENSSL_NO_RIPEMD
+ { "ripemd", FILTER_TYPE_RIPEMD },
++#endif
+ { "permissions", FILTER_TYPE_PERMISSIONS },
+ { NULL, 0 }
+ };
+@@ -179,9 +181,11 @@ int setup_filter_function( OSI_FILTER *a
+ action_filter->perform = filter_sha;
+ break;
+
++#ifndef OPENSSL_NO_RIPEMD
+ case FILTER_TYPE_RIPEMD:
+ action_filter->perform = filter_ripemd;
+ break;
++#endif
+
+ case FILTER_TYPE_PERMISSIONS:
+ action_filter->perform = filter_permissions;
+@@ -220,7 +224,9 @@ osi_bool filter_is_dynamic( int filter_t
+ case FILTER_TYPE_SUFFIX:
+ case FILTER_TYPE_MD5:
+ case FILTER_TYPE_SHA:
++#ifndef OPENSSL_NO_RIPEMD
+ case FILTER_TYPE_RIPEMD:
++#endif
+ case FILTER_TYPE_PERMISSIONS:
+
+ return TRUE;
diff --git a/package/osiris/patches/patch-src_libosiris_filter_h b/package/osiris/patches/patch-src_libosiris_filter_h
new file mode 100644
index 000000000..c7463306d
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_filter_h
@@ -0,0 +1,23 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/filter.h 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/filter.h 2009-05-10 21:15:10.000000000 +0200
+@@ -61,7 +61,9 @@
+ #define FILTER_TYPE_SUFFIX 19
+ #define FILTER_TYPE_MD5 20
+ #define FILTER_TYPE_SHA 21
++#ifndef OPENSSL_NO_RIPEMD
+ #define FILTER_TYPE_RIPEMD 22
++#endif
+ #define FILTER_TYPE_PERMISSIONS 23
+ #define FILTER_TYPE_SID 24
+
+@@ -143,7 +145,9 @@ osi_bool filter_file( const char *file_p
+ osi_bool filter_suffix( const char *file_path, FILTER_CONTEXT *context );
+ osi_bool filter_md5( const char *file_path, FILTER_CONTEXT *context );
+ osi_bool filter_sha( const char *file_path, FILTER_CONTEXT *context );
++#ifndef OPENSSL_NO_RIPEMD
+ osi_bool filter_ripemd( const char *file_path, FILTER_CONTEXT *context );
++#endif
+ osi_bool filter_permissions( const char *file_path, FILTER_CONTEXT *context );
+
+ #endif
diff --git a/package/osiris/patches/patch-src_libosiris_ssl_utilities_c b/package/osiris/patches/patch-src_libosiris_ssl_utilities_c
new file mode 100644
index 000000000..47563591b
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_ssl_utilities_c
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/ssl_utilities.c 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/ssl_utilities.c 2009-05-10 20:41:31.000000000 +0200
+@@ -51,7 +51,9 @@
+ #include <openssl/rand.h>
+ #include <openssl/md5.h>
+ #include <openssl/sha.h>
++#ifndef OPENSSL_NO_RIPEMD
+ #include <openssl/ripemd.h>
++#endif
+
+ #ifdef WIN32
+ #include <winsock.h>
+@@ -337,6 +339,7 @@ int hash_file_sha( const char *file_path
+ return -1;
+ }
+
++#ifndef OPENSSL_NO_RIPEMD
+ /******************************************************************************
+ **
+ ** Function: hash_file_ripemd
+@@ -433,7 +436,7 @@ int hash_file_ripemd( const char *file_p
+
+ return -1;
+ }
+-
++#endif
+
+ /******************************************************************************
+ **
diff --git a/package/osiris/patches/patch-src_libosiris_ssl_utilities_h b/package/osiris/patches/patch-src_libosiris_ssl_utilities_h
new file mode 100644
index 000000000..668096983
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_ssl_utilities_h
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/ssl_utilities.h 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/ssl_utilities.h 2009-05-10 20:42:04.000000000 +0200
+@@ -59,8 +59,10 @@ int hash_file_md5( const char *file_path
+ int hash_file_sha( const char *file_path, FILE *file,
+ char *buffer, int buffer_size );
+
++#ifndef OPENSSL_NO_RIPEMD
+ int hash_file_ripemd( const char *file_path, FILE *file,
+ char *buffer, int buffer_size );
++#endif
+
+ /* random SSL utilities. */
+
diff --git a/package/osiris/patches/patch-src_libosiris_utilities_c b/package/osiris/patches/patch-src_libosiris_utilities_c
new file mode 100644
index 000000000..ec5a26ee7
--- /dev/null
+++ b/package/osiris/patches/patch-src_libosiris_utilities_c
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/libosiris/utilities.c 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/libosiris/utilities.c 2009-05-10 20:37:18.000000000 +0200
+@@ -60,7 +60,9 @@
+
+ #include <openssl/md5.h>
+ #include <openssl/sha.h>
++#ifndef OPENSSL_NO_RIPEMD
+ #include <openssl/ripemd.h>
++#endif
+
+ #include "utilities.h"
+ #include "error.h"
diff --git a/package/osiris/patches/patch-src_osirisd_scanner_c b/package/osiris/patches/patch-src_osirisd_scanner_c
new file mode 100644
index 000000000..ee3927bf0
--- /dev/null
+++ b/package/osiris/patches/patch-src_osirisd_scanner_c
@@ -0,0 +1,33 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/osirisd/scanner.c 2006-07-28 01:57:51.000000000 +0200
++++ osiris-4.2.3/src/osirisd/scanner.c 2009-05-10 20:43:04.000000000 +0200
+@@ -839,12 +839,14 @@ void populate_scan_record( SCANNER *scan
+ MAX_CHECKSUM_LENGTH );
+ break;
+
++#ifndef OPENSSL_NO_RIPEMD
+ case HASH_RIPEMD:
+
+ rc = hash_file_ripemd( scan_record->path, file_handle,
+ scan_record->checksum,
+ MAX_CHECKSUM_LENGTH );
+ break;
++#endif
+
+ default:
+
+@@ -987,12 +989,14 @@ void populate_scan_record( SCANNER *scan
+ MAX_CHECKSUM_LENGTH );
+ break;
+
++#ifndef OPENSSL_NO_RIPEMD
+ case HASH_RIPEMD:
+
+ rc = hash_file_ripemd( scan_record->path, file_handle,
+ scan_record->checksum,
+ MAX_CHECKSUM_LENGTH );
+ break;
++#endif
+
+ default:
+
diff --git a/package/osiris/patches/patch-src_osirismd_md_control_c b/package/osiris/patches/patch-src_osirismd_md_control_c
new file mode 100644
index 000000000..0c33533c8
--- /dev/null
+++ b/package/osiris/patches/patch-src_osirismd_md_control_c
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- osiris-4.2.3.orig/src/osirismd/md_control.c 2006-12-05 13:02:48.000000000 +0100
++++ osiris-4.2.3/src/osirismd/md_control.c 2009-05-10 21:28:06.000000000 +0200
+@@ -3259,9 +3259,9 @@ osi_bool generate_session_key_hash( unsi
+ int index;
+ char checksum[41];
+
+- SHA_Init( &context );
+- SHA_Update( &context, key, (unsigned long)keysize );
+- SHA_Final( &( digest[0] ), &context );
++ SHA1_Init( &context );
++ SHA1_Update( &context, key, (unsigned long)keysize );
++ SHA1_Final( &( digest[0] ), &context );
+
+ for ( index = 0; index < SHA_DIGEST_LENGTH; index++ )
+ {
diff --git a/package/owfs/Config.in b/package/owfs/Config.in
new file mode 100644
index 000000000..b8daf117d
--- /dev/null
+++ b/package/owfs/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_OWFS
+ prompt "owfs.............................. 1-wire filesystem to map sensors to a directory"
+ tristate
+ default n
+ select ADK_PACKAGE_FUSE_UTILS
+ select ADK_PACKAGE_LIBUSB
+ help
+ 1-Wire technology by Dallas Semiconductors is a simple bus for different kind of devices
+ like tempereatur, humidity, pressure, voltage, etc.
+ owfs maps the devices to a dirctory utilizing fuse.
+
+ http://www.owfs.org/
+
diff --git a/package/owfs/Makefile b/package/owfs/Makefile
new file mode 100644
index 000000000..6281d0f8b
--- /dev/null
+++ b/package/owfs/Makefile
@@ -0,0 +1,38 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= owfs
+PKG_VERSION:= 2.4p5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 236f2f42b3bb4f430e6007c1a70778e6
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=owfs/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,OWFS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= BUILD_CC=${TARGET_CC} \
+ LD_EXTRALIBS="" \
+ ac_cv_linux_vers=2 \
+ td_cv_buggygetaddrinfo="no"
+CONFIGURE_ARGS+= --enable-owfs \
+ --enable-usb \
+ --disable-owhttpd \
+ --disable-owftpd \
+ --disable-owcapi \
+ --disable-owserver
+BUILD_STYLE:= auto
+ALL_TARGET:=
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_OWFS}/usr/{bin,lib}
+ ${INSTALL_BIN} ${WRKBUILD}/module/owlib/src/c/.libs/libow.so.0.0.0 \
+ ${IDIR_OWFS}/usr/lib/
+ ${INSTALL_BIN} ${WRKBUILD}/module/owfs/src/c/.libs/owfs ${IDIR_OWFS}/usr/bin/owfs
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/owfs/ipkg/owfs.control b/package/owfs/ipkg/owfs.control
new file mode 100644
index 000000000..b97ef945b
--- /dev/null
+++ b/package/owfs/ipkg/owfs.control
@@ -0,0 +1,5 @@
+Package: owfs
+Priority: optional
+Section: admin
+Description: A tool to access 1-wire devices through a fuse mounted fs
+Depends: fuse-utils libpthread
diff --git a/package/p910nd/Config.in b/package/p910nd/Config.in
new file mode 100644
index 000000000..dd4aab2e4
--- /dev/null
+++ b/package/p910nd/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_P910ND
+ prompt "p910nd............................ A small non-spooling printer server"
+ tristate
+ default n
+ help
+ p910nd is a small daemon that copies any data received on
+ the port it is listening on to the corresponding printer
+ port. It is primarily intended for diskless Linux hosts
+ running as printer drivers but there is no reason why it
+ could not be used on diskful hosts. Port 9100 is copied
+ to /dev/lp0, 9101 to /dev/lp1 and 9102 to /dev/lp2. The
+ default is port 9100 to /dev/lp0.
+
+ http://www.etherboot.org/p910nd/
+
diff --git a/package/p910nd/Makefile b/package/p910nd/Makefile
new file mode 100644
index 000000000..c6a480098
--- /dev/null
+++ b/package/p910nd/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= p910nd
+PKG_VERSION:= 0.7
+PKG_RELEASE:= 10
+PKG_MD5SUM:= 7bf752532d26c9106f8039db95df3a6b
+MASTER_SITES:= http://www.etherboot.org/p910nd/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,P910ND,p910nd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= ${TARGET_CONFIGURE_OPTS} \
+ CFLAGS="${TARGET_CFLAGS} -DLOCKFILE_DIR=\"\\\"/tmp\\\"\""
+ALL_TARGET:=
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_P910ND}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_P910ND}/usr/sbin
+ ${INSTALL_BIN} ./files/p910nd.init \
+ ${IDIR_P910ND}/etc/init.d/p910nd
+ ${INSTALL_BIN} ${WRKBUILD}/p910nd ${IDIR_P910ND}/usr/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/p910nd/files/p910nd.init b/package/p910nd/files/p910nd.init
new file mode 100644
index 000000000..77eceb1e3
--- /dev/null
+++ b/package/p910nd/files/p910nd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${p910nd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ p910nd $p910nd_flags
+ ;;
+stop)
+ killall p910nd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/p910nd/ipkg/p910nd.control b/package/p910nd/ipkg/p910nd.control
new file mode 100644
index 000000000..9b917a86f
--- /dev/null
+++ b/package/p910nd/ipkg/p910nd.control
@@ -0,0 +1,4 @@
+Package: p910nd
+Priority: optional
+Section: net
+Description: A small non-spooling printer server.
diff --git a/package/p910nd/ipkg/p910nd.postinst b/package/p910nd/ipkg/p910nd.postinst
new file mode 100644
index 000000000..e384ba6b6
--- /dev/null
+++ b/package/p910nd/ipkg/p910nd.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf p910nd p910nd NO
+add_rcconf p910nd_flags p910nd_flags "0 -b -f /dev/usb/lp0"
diff --git a/package/p910nd/patches/100-Makefile.patch b/package/p910nd/patches/100-Makefile.patch
new file mode 100644
index 000000000..83b4f6c67
--- /dev/null
+++ b/package/p910nd/patches/100-Makefile.patch
@@ -0,0 +1,15 @@
+--- p910nd-0.7/Makefile.orig 2005-09-25 13:54:28.465506888 +0200
++++ p910nd-0.7/Makefile 2005-09-25 13:54:46.928700056 +0200
+@@ -2,9 +2,9 @@
+ # below if you don't want to use libwrap (hosts.{allow,deny} access control)
+
+ # If you don't have it in /var/log/subsys, uncomment and define
+-#CFLAGS+=-DLOCKFILE_DIR=\"/var/log\"
++CFLAGS+=-DLOCKFILE_DIR=\"/tmp\"
+ LIBWRAP=-lwrap
+
+ p910nd: p910nd.c
+-# $(CC) -Wall $(CFLAGS) -o $@ p910nd.c
+- $(CC) -Wall $(CFLAGS) -DUSE_LIBWRAP -o $@ p910nd.c $(LIBWRAP)
++ $(CC) -Wall $(CFLAGS) -o $@ p910nd.c
++# $(CC) -Wall $(CFLAGS) -DUSE_LIBWRAP -o $@ p910nd.c $(LIBWRAP)
diff --git a/package/p910nd/patches/200-p910nd-0.7.patch b/package/p910nd/patches/200-p910nd-0.7.patch
new file mode 100644
index 000000000..9165498fe
--- /dev/null
+++ b/package/p910nd/patches/200-p910nd-0.7.patch
@@ -0,0 +1,309 @@
+--- p910nd-0.7/p910nd.c.orig 2005-09-29 11:31:02.442914400 +0200
++++ p910nd-0.7/p910nd.c 2005-09-29 11:31:49.236800648 +0200
+@@ -73,8 +73,7 @@
+ #else
+ #define LOCKFILE "/var/lock/subsys/p910%cd"
+ #endif
+-#define PRINTERFILE "/dev/lp%c"
+-#define LOGOPTS LOG_ERR
++#define PRINTERFILE "/dev/printers/%c"
+
+ static char *progname;
+ static char version[] = "p910nd Version 0.7";
+@@ -93,9 +92,9 @@
+ fprintf(stdout, "%s \n", version);
+ }
+
+-FILE *open_printer(int lpnumber)
++int open_printer(int lpnumber)
+ {
+- FILE *f;
++ int lp;
+ char lpname[sizeof(PRINTERFILE)];
+
+ #ifdef TESTING
+@@ -105,12 +104,16 @@
+ #endif
+ if (device == 0)
+ device = lpname;
+- if ((f = fopen(device, bidir ? "w+" : "w")) == NULL)
++ if ((lp = open(device, bidir ? O_RDWR : O_WRONLY)) == -1)
+ {
+- syslog(LOGOPTS, "%s: %m\n", device);
+- exit(1);
++ syslog(LOG_ERR, "%s: %m\n", device);
++
++ /* fallback to /dev/null if device is not available
++ * otherwise windows spooler will screw up
++ */
++ lp = open("/dev/null", bidir ? O_RDWR : O_WRONLY);
+ }
+- return (f);
++ return (lp);
+ }
+
+ int get_lock(int lpnumber)
+@@ -121,7 +124,7 @@
+ (void)snprintf(lockname, sizeof(lockname), LOCKFILE, lpnumber);
+ if ((lockfd = open(lockname, O_CREAT|O_RDWR)) < 0)
+ {
+- syslog(LOGOPTS, "%s: %m\n", lockname);
++ syslog(LOG_ERR, "%s: %m\n", lockname);
+ return (0);
+ }
+ memset(&lplock, 0, sizeof(lplock));
+@@ -129,7 +132,7 @@
+ lplock.l_pid = getpid();
+ if (fcntl(lockfd, F_SETLKW, &lplock) < 0)
+ {
+- syslog(LOGOPTS, "%s: %m\n", lockname);
++ syslog(LOG_ERR, "%s: %m\n", lockname);
+ return (0);
+ }
+ return (1);
+@@ -141,24 +144,36 @@
+ (void)close(lockfd);
+ }
+
++ssize_t safe_write(int fd, char *buf, size_t count)
++{
++ size_t offset = 0;
++
++ while (offset < count) {
++ ssize_t n = write(fd, buf + offset, count - offset);
++
++ if (n < 0 && errno != EINTR)
++ return n;
++
++ if (n > 0)
++ offset += n;
++ }
++
++ return offset;
++}
++
+ /* Copy network socket to FILE f until EOS */
+-int copy_stream(int fd, FILE *f)
++int copy_stream(int fd, int lp)
+ {
+- int nread;
++ int nread, rcvd = 0, sent = 0;
+ char buffer[8192];
+
+ if (bidir) {
+- FILE *nf;
+-
+- if ((nf = fdopen(fd, "w")) == NULL) {
+- syslog(LOGOPTS, "fdopen: %m\n");
+- }
+ for (;;) {
+ fd_set readfds;
+ int result;
+- int maxfd = fileno(f) > fd ? fileno(f) : fd;
++ int maxfd = lp > fd ? lp : fd;
+ FD_ZERO(&readfds);
+- FD_SET(fileno(f), &readfds);
++ FD_SET(lp, &readfds);
+ FD_SET(fd, &readfds);
+ result = select(maxfd + 1, &readfds, 0, 0, 0);
+ if (result < 0)
+@@ -169,43 +184,54 @@
+ nread = read(fd, buffer, sizeof(buffer));
+ if (nread <= 0)
+ break;
+- (void)fwrite(buffer, sizeof(char), nread, f);
++ if (safe_write(lp, buffer, nread) < 0) {
++ syslog(LOG_ERR, "write: %m\n");
++ break;
++ }
++ rcvd += nread;
+ }
+- if (FD_ISSET(fileno(f), &readfds)) {
+- nread = read(fileno(f), buffer, sizeof(buffer));
+- if (nread > 0 && nf != NULL) {
+- (void)fwrite(buffer, sizeof(char), nread, nf);
+- (void)fflush(nf);
++ if (FD_ISSET(lp, &readfds)) {
++ nread = read(lp, buffer, sizeof(buffer));
++ if (nread > 0) {
++ safe_write(fd, buffer, nread);
++ sent += nread;
+ }
+ }
+ }
+- (void)fflush(f);
+- (void)fclose(nf);
++ syslog(LOG_NOTICE, "Finished job: %d bytes received, %d bytes sent\n",
++ rcvd, sent);
+ return (0);
+ } else {
+- while ((nread = read(fd, buffer, sizeof(buffer))) > 0)
+- (void)fwrite(buffer, sizeof(char), nread, f);
+- (void)fflush(f);
++ while ((nread = read(fd, buffer, sizeof(buffer))) > 0) {
++ if (safe_write(lp, buffer, nread) < 0) {
++ syslog(LOG_ERR, "write: %m\n");
++ break;
++ }
++ rcvd += nread;
++ }
++ syslog(LOG_NOTICE, "Finished job: %d bytes received\n", rcvd);
+ return (nread);
+ }
+ }
+
+ void one_job(int lpnumber)
+ {
+- FILE *f;
++ int lp;
+ struct sockaddr_in client;
+ socklen_t clientlen = sizeof(client);
+
+ if (getpeername(0, (struct sockaddr*) &client, &clientlen) >= 0)
+- syslog(LOGOPTS, "Connection from %s port %hu\n",
++ syslog(LOG_NOTICE, "Connection from %s port %hu\n",
+ inet_ntoa(client.sin_addr),
+ ntohs(client.sin_port));
+ if (get_lock(lpnumber) == 0)
+ return;
+- f = open_printer(lpnumber);
+- if (copy_stream(0, f) < 0)
+- syslog(LOGOPTS, "copy_stream: %m\n");
+- fclose(f);
++ if ((lp = open_printer(lpnumber)) != -1)
++ {
++ if (copy_stream(0, lp) < 0)
++ syslog(LOG_ERR, "copy_stream: %m\n");
++ close(lp);
++ }
+ free_lock();
+ }
+
+@@ -215,7 +241,7 @@
+ #ifdef USE_GETPROTOBYNAME
+ struct protoent *proto;
+ #endif
+- int netfd, fd, one = 1;
++ int netfd, fd, lp, one = 1;
+ socklen_t clientlen;
+ struct sockaddr_in netaddr, client;
+ char pidfilename[sizeof(PIDFILE)];
+@@ -225,7 +251,7 @@
+ switch (fork())
+ {
+ case -1:
+- syslog(LOGOPTS, "fork: %m\n");
++ syslog(LOG_ERR, "fork: %m\n");
+ exit (1);
+ case 0: /* child */
+ break;
+@@ -236,14 +262,14 @@
+ resourcelimit.rlim_max = 0;
+ if (getrlimit(RLIMIT_NOFILE, &resourcelimit) < 0)
+ {
+- syslog(LOGOPTS, "getrlimit: %m\n");
++ syslog(LOG_ERR, "getrlimit: %m\n");
+ exit(1);
+ }
+ for (fd = 0; fd < resourcelimit.rlim_max; ++fd)
+ (void)close(fd);
+ if (setsid() < 0)
+ {
+- syslog(LOGOPTS, "setsid: %m\n");
++ syslog(LOG_ERR, "setsid: %m\n");
+ exit(1);
+ }
+ (void)chdir("/");
+@@ -254,7 +280,7 @@
+ (void)snprintf(pidfilename, sizeof(pidfilename), PIDFILE, lpnumber);
+ if ((f = fopen(pidfilename, "w")) == NULL)
+ {
+- syslog(LOGOPTS, "%s: %m\n", pidfilename);
++ syslog(LOG_ERR, "%s: %m\n", pidfilename);
+ exit(1);
+ }
+ (void)fprintf(f, "%d\n", getpid());
+@@ -262,11 +288,10 @@
+ if (get_lock(lpnumber) == 0)
+ exit(1);
+ #endif
+- f = open_printer(lpnumber);
+ #ifdef USE_GETPROTOBYNAME
+ if ((proto = getprotobyname("tcp")) == NULL)
+ {
+- syslog(LOGOPTS, "Cannot find protocol for TCP!\n");
++ syslog(LOG_ERR, "Cannot find protocol for TCP!\n");
+ exit(1);
+ }
+ if ((netfd = socket(AF_INET, SOCK_STREAM, proto->p_proto)) < 0)
+@@ -274,12 +299,12 @@
+ if ((netfd = socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) < 0)
+ #endif
+ {
+- syslog(LOGOPTS, "socket: %m\n");
++ syslog(LOG_ERR, "socket: %m\n");
+ exit(1);
+ }
+ if (setsockopt(netfd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0)
+ {
+- syslog(LOGOPTS, "setsocketopt: %m\n");
++ syslog(LOG_ERR, "setsocketopt: %m\n");
+ exit(1);
+ }
+ netaddr.sin_port = htons(BASEPORT + lpnumber - '0');
+@@ -287,12 +312,12 @@
+ memset(netaddr.sin_zero, 0, sizeof(netaddr.sin_zero));
+ if (bind(netfd, (struct sockaddr*) &netaddr, sizeof(netaddr)) < 0)
+ {
+- syslog(LOGOPTS, "bind: %m\n");
++ syslog(LOG_ERR, "bind: %m\n");
+ exit(1);
+ }
+ if (listen(netfd, 5) < 0)
+ {
+- syslog(LOGOPTS, "listen: %m\n");
++ syslog(LOG_ERR, "listen: %m\n");
+ exit(1);
+ }
+ clientlen = sizeof(client);
+@@ -302,22 +327,26 @@
+ #ifdef USE_LIBWRAP
+ if (hosts_ctl("p910nd", STRING_UNKNOWN,
+ inet_ntoa(client.sin_addr), STRING_UNKNOWN) == 0) {
+- syslog(LOGOPTS, "Connection from %s port %hd rejected\n",
++ syslog(LOG_ERR, "Connection from %s port %hu rejected\n",
+ inet_ntoa(client.sin_addr),
+ ntohs(client.sin_port));
+ close(fd);
+ continue;
+ }
+ #endif
+- syslog(LOGOPTS, "Connection from %s port %hd accepted\n",
++ syslog(LOG_NOTICE, "Connection from %s port %hu accepted\n",
+ inet_ntoa(client.sin_addr),
+ ntohs(client.sin_port));
+ /*write(fd, "Printing", 8);*/
+- if (copy_stream(fd, f) < 0)
+- syslog(LOGOPTS, "copy_stream: %m\n");
++ if ((lp = open_printer(lpnumber)) != -1)
++ {
++ if (copy_stream(fd, lp) < 0)
++ syslog(LOG_ERR, "copy_stream: %m\n");
++ close(lp);
++ }
+ (void)close(fd);
+ }
+- syslog(LOGOPTS, "accept: %m\n");
++ syslog(LOG_ERR, "accept: %m\n");
+ free_lock();
+ exit(1);
+ }
+@@ -338,7 +367,7 @@
+ if (getsockname(0, (struct sockaddr*) &bind_addr, &ba_len) == 0)
+ return (0); /* under inetd */
+ if (errno != ENOTSOCK) /* strange... */
+- syslog(LOGOPTS, "getsockname: %m\n");
++ syslog(LOG_ERR, "getsockname: %m\n");
+ return (1);
+ }
+
diff --git a/package/palantir/Config.in b/package/palantir/Config.in
new file mode 100644
index 000000000..409ee0ba5
--- /dev/null
+++ b/package/palantir/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_PALANTIR
+ prompt "palantir.......................... A multichannel interactive streaming solution"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBJPEG
+ help
+ Palantir is a Linux-based streaming system designed to transmit live
+ video, audio and data over a TCP/IP network, as well as to control
+ remote devices.
+
+ http://www.fastpath.it/products/palantir/
+
diff --git a/package/palantir/Makefile b/package/palantir/Makefile
new file mode 100644
index 000000000..a7e3e84ff
--- /dev/null
+++ b/package/palantir/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= palantir
+PKG_VERSION:= 2.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3a5b1fb340857f6d8e357bf39b77583e
+MASTER_SITES:= http://www.fastpath.it/products/palantir/pub/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PALANTIR,palantir,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ mkdir -p ${WRKINST}/usr
+ ${MAKE} -C ${WRKBUILD}/server/libgsm \
+ ${TARGET_CONFIGURE_OPTS} \
+ CCINC="${TCPPFLAGS}" \
+ lib/libgsm.a
+ ${MAKE} -C ${WRKBUILD}/server \
+ ${TARGET_CONFIGURE_OPTS} \
+ CFLAGS="-Wall -D_REENTRANT ${TCFLAGS} ${TCPPFLAGS} ${TLDFLAGS}" \
+ palantir
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PALANTIR}/etc
+ ${INSTALL_DIR} ${IDIR_PALANTIR}/usr/sbin
+ ${INSTALL_DATA} ${WRKBUILD}/server/palantir-mips.conf.sample \
+ ${IDIR_PALANTIR}/etc/palantir.conf
+ ${INSTALL_BIN} ${WRKBUILD}/server/palantir ${IDIR_PALANTIR}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/palantir/ipkg/palantir.conffiles b/package/palantir/ipkg/palantir.conffiles
new file mode 100644
index 000000000..a57f0c6fd
--- /dev/null
+++ b/package/palantir/ipkg/palantir.conffiles
@@ -0,0 +1 @@
+/etc/palantir.conf
diff --git a/package/palantir/ipkg/palantir.control b/package/palantir/ipkg/palantir.control
new file mode 100644
index 000000000..404a200c3
--- /dev/null
+++ b/package/palantir/ipkg/palantir.control
@@ -0,0 +1,5 @@
+Package: palantir
+Priority: optional
+Section: net
+Depends: libjpeg, libpthread
+Description: A multichannel interactive streaming solution
diff --git a/package/parprouted/Config.in b/package/parprouted/Config.in
new file mode 100644
index 000000000..af1474e47
--- /dev/null
+++ b/package/parprouted/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_PARPROUTED
+ prompt "parprouted........................ Proxy ARP daemon"
+ tristate
+ default n
+ help
+ parprouted is a daemon for transparent IP (Layer 3) proxy ARP bridging.
+ This is useful for creation of transparent firewalls and bridging networks
+ with different MAC protocols. Also, unlike standard bridging, proxy ARP
+ bridging allows to bridge Ethernet networks behind wireless nodes without
+ using WDS or layer 2 bridging.
+
+ http://www.hazard.maks.net/
+
diff --git a/package/parprouted/Makefile b/package/parprouted/Makefile
new file mode 100644
index 000000000..dcd33c8cc
--- /dev/null
+++ b/package/parprouted/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= parprouted
+PKG_VERSION:= 0.63
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 12753098a22e82997d1941d6d2284750
+MASTER_SITES:= http://www.hazard.maks.net/parprouted/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PARPROUTED,parprouted,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" \
+ CFLAGS="${TCFLAGS}" \
+ LDFLAGS=""
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PARPROUTED}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_PARPROUTED}/usr/sbin
+ ${INSTALL_BIN} ./files/parprouted.init \
+ ${IDIR_PARPROUTED}/etc/init.d/parprouted
+ ${INSTALL_BIN} ${WRKBUILD}/parprouted ${IDIR_PARPROUTED}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/parprouted/files/parprouted.default b/package/parprouted/files/parprouted.default
new file mode 100755
index 000000000..7128a56a7
--- /dev/null
+++ b/package/parprouted/files/parprouted.default
@@ -0,0 +1 @@
+OPTIONS="$lan_ifname $wifi_ifname"
diff --git a/package/parprouted/files/parprouted.init b/package/parprouted/files/parprouted.init
new file mode 100644
index 000000000..248fdd5e5
--- /dev/null
+++ b/package/parprouted/files/parprouted.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${parprouted:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ parprouted ${parprouted_flags}
+ ;;
+stop)
+ killall parprouted
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/parprouted/ipkg/parprouted.control b/package/parprouted/ipkg/parprouted.control
new file mode 100644
index 000000000..9357ae586
--- /dev/null
+++ b/package/parprouted/ipkg/parprouted.control
@@ -0,0 +1,5 @@
+Package: parprouted
+Priority: optional
+Section: net
+Description: a proxy ARP daemon
+Depends: libpthread
diff --git a/package/parprouted/ipkg/parprouted.postinst b/package/parprouted/ipkg/parprouted.postinst
new file mode 100644
index 000000000..5943ccc96
--- /dev/null
+++ b/package/parprouted/ipkg/parprouted.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf parprouted parprouted NO
+add_rcconf parprouted_flags parprouted_flags "eth0.1 eth1"
diff --git a/package/parprouted/patches/parprouted.patch b/package/parprouted/patches/parprouted.patch
new file mode 100644
index 000000000..17fbdecec
--- /dev/null
+++ b/package/parprouted/patches/parprouted.patch
@@ -0,0 +1,33 @@
+diff -rupw parprouted-0.63/arp.c parprouted-0.63-1/arp.c
+--- parprouted-0.63/arp.c 2004-05-23 14:06:31.000000000 +0200
++++ parprouted-0.63-1/arp.c 2005-03-13 16:10:18.000000000 +0100
+@@ -366,7 +366,7 @@ void *arp(char *ifname)
+ do {
+ pthread_testcancel();
+ /* Sleep a bit in order not to overload the system */
+- usleep(300);
++ usleep(3000);
+
+ if (arp_recv(sock, &frame) <= 0)
+ continue;
+diff -rupw parprouted-0.63/parprouted.c parprouted-0.63-1/parprouted.c
+--- parprouted-0.63/parprouted.c 2004-01-30 02:45:43.000000000 +0100
++++ parprouted-0.63-1/parprouted.c 2005-03-20 09:14:35.000000000 +0100
+@@ -93,7 +93,7 @@ void processarp(int cleanup)
+
+ /* added route to the kernel */
+ if (snprintf(routecmd_str, ROUTE_CMD_LEN-1,
+- "/sbin/ip route add %s/32 metric 50 dev %s scope link",
++ "/sbin/route add -host %s metric 50 dev %s",
+ inet_ntoa(cur_entry->ipaddr_ia), cur_entry->ifname) > ROUTE_CMD_LEN-1)
+ {
+ syslog(LOG_INFO, "ip route command too large to fit in buffer!");
+@@ -112,7 +112,7 @@ void processarp(int cleanup)
+
+ /* remove entry from arp table and remove route from kernel */
+ if (snprintf(routecmd_str, ROUTE_CMD_LEN-1,
+- "/sbin/ip route del %s/32 metric 50 dev %s scope link",
++ "/sbin/route del -host %s metric 50 dev %s",
+ inet_ntoa(cur_entry->ipaddr_ia), cur_entry->ifname) > ROUTE_CMD_LEN-1)
+ {
+ syslog(LOG_INFO, "ip route command too large to fit in buffer!");
diff --git a/package/pciutils/Config.in b/package/pciutils/Config.in
new file mode 100644
index 000000000..e289b8bbf
--- /dev/null
+++ b/package/pciutils/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_PCIUTILS
+ prompt "pciutils.......................... Linux PCI Utilities"
+ tristate
+ select ADK_PACKAGE_ZLIB
+ default n
+ help
+ This package contains various utilities for inspecting and setting of
+ devices connected to the PCI bus.
diff --git a/package/pciutils/Makefile b/package/pciutils/Makefile
new file mode 100644
index 000000000..b4ccef18d
--- /dev/null
+++ b/package/pciutils/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= pciutils
+PKG_VERSION:= 3.0.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d07da501bb11e6af40acd036536c2e9a
+MASTER_SITES:= http://www.kernel.org/pub/software/utils/pciutils/ \
+ ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PCIUTILS,pciutils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" \
+ CFLAGS="${TCFLAGS}" \
+ IDSDIR="/usr/share" \
+ HOST=${GNU_TARGET_NAME}
+ALL_TARGET:=
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PCIUTILS}/usr/{share,sbin}
+ ${INSTALL_BIN} ${WRKBUILD}/{lspci,setpci} ${IDIR_PCIUTILS}/usr/sbin/
+ ${INSTALL_DATA} ${WRKBUILD}/pci.ids ${IDIR_PCIUTILS}/usr/share/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pciutils/ipkg/pciutils.control b/package/pciutils/ipkg/pciutils.control
new file mode 100644
index 000000000..b3f0c4eea
--- /dev/null
+++ b/package/pciutils/ipkg/pciutils.control
@@ -0,0 +1,4 @@
+Package: pciutils
+Priority: optional
+Section: sys
+Description: Linux PCI Utilities
diff --git a/package/pciutils/patches/patch-lib_configure b/package/pciutils/patches/patch-lib_configure
new file mode 100644
index 000000000..cde870cce
--- /dev/null
+++ b/package/pciutils/patches/patch-lib_configure
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- pciutils-3.0.3.orig/lib/configure 2008-11-09 20:50:26.000000000 +0100
++++ pciutils-3.0.3/lib/configure 2009-01-09 19:56:33.000000000 +0100
+@@ -60,7 +60,6 @@ case $sys in
+ echo_n " sysfs proc"
+ echo >>$c '#define PCI_HAVE_PM_LINUX_SYSFS'
+ echo >>$c '#define PCI_HAVE_PM_LINUX_PROC'
+- echo >>$c '#define PCI_HAVE_LINUX_BYTEORDER_H'
+ echo >>$c '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"'
+ echo >>$c '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"'
+ case $cpu in
diff --git a/package/pcre/Config.in b/package/pcre/Config.in
new file mode 100644
index 000000000..955cd3ca4
--- /dev/null
+++ b/package/pcre/Config.in
@@ -0,0 +1,15 @@
+config ADK_COMPILE_PCRE
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBPCRE
+
+config ADK_PACKAGE_LIBPCRE
+ prompt "libpcre........................... A Perl Compatible Regular Expression library"
+ tristate
+ default n
+ select ADK_COMPILE_PCRE
+ help
+ A Perl Compatible Regular Expression library
+
+ http://www.pcre.org/
+
diff --git a/package/pcre/Makefile b/package/pcre/Makefile
new file mode 100644
index 000000000..2a24199ff
--- /dev/null
+++ b/package/pcre/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= pcre
+PKG_VERSION:= 7.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 5ca11a81b753de24fb87ddc872ccaa67
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=pcre/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBPCRE,libpcre,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-utf8
+# C++ support uses libstdc++ not uClibc++ so disable it
+CONFIGURE_ARGS+= --disable-cpp
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= ${TARGET_CONFIGURE_OPTS} CFLAGS='${TCFLAGS}'
+
+#pre-build:
+# ${MAKE} -C '${WRKBUILD}' \
+# CC_FOR_BUILD='${HOSTCC}' \
+# LINK_FOR_BUILD='${HOSTCC}' \
+# CFLAGS_FOR_BUILD='${HOSTCFLAGS}' \
+# dftables
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBPCRE}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpcre{,posix}.so.* ${IDIR_LIBPCRE}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pcre/ipkg/libpcre.control b/package/pcre/ipkg/libpcre.control
new file mode 100644
index 000000000..797453eab
--- /dev/null
+++ b/package/pcre/ipkg/libpcre.control
@@ -0,0 +1,4 @@
+Package: libpcre
+Priority: optional
+Section: libs
+Description: a Perl Compatible Regular Expression library
diff --git a/package/php/Config.in b/package/php/Config.in
new file mode 100644
index 000000000..c62e58a52
--- /dev/null
+++ b/package/php/Config.in
@@ -0,0 +1,115 @@
+menu "php.............................. PHP Hypertext preprocessor"
+
+config ADK_COMPILE_PHP
+ prompt "php.............................. PHP Hypertext preprocessor"
+ bool
+ default n
+
+choice
+prompt "PHP Mode"
+default ADK_PACKAGE_PHP_FASTCGI
+depends on ADK_COMPILE_PHP
+config ADK_PACKAGE_PHP_FASTCGI
+ prompt "PHP built for FastCGI"
+ bool
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ help
+ PHP is a widely-used general-purpose scripting language that is especially
+ suited for Web development and can be embedded into HTML.
+
+ http://www.php.net/
+
+endchoice
+
+config ADK_PACKAGE_PHP_MOD_CURL
+ prompt "php-mod-curl..................... cURL module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBCURL
+
+config ADK_PACKAGE_PHP_MOD_FTP
+ prompt "php-mod-ftp...................... FTP module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+
+config ADK_PACKAGE_PHP_MOD_GD
+ prompt "php-mod-gd....................... GD graphics library module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBGD
+ select ADK_PACKAGE_LIBPNG
+
+config ADK_PACKAGE_PHP_MOD_GMP
+ prompt "php-mod-gmp...................... GMP module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBGMP
+
+config ADK_PACKAGE_PHP_MOD_LDAP
+ prompt "php-mod-ldap..................... LDAP module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBOPENLDAP
+
+config ADK_PACKAGE_PHP_MOD_MYSQL
+ prompt "php-mod-mysql.................... MySQL module"
+ tristate
+ default n
+ depends ADK_CXX
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+
+config ADK_PACKAGE_PHP_MOD_OPENSSL
+ prompt "php-mod-openssl.................. OpenSSL module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBOPENSSL
+
+config ADK_PACKAGE_PHP_MOD_PCRE
+ prompt "php-mod-pcre..................... PCRE module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBPCRE
+
+config ADK_PACKAGE_PHP_MOD_PGSQL
+ prompt "php-mod-pgsql.................... PostgreSQL module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBPQ
+
+config ADK_PACKAGE_PHP_MOD_SESSION
+ prompt "php-mod-session.................. Sessions module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+
+config ADK_PACKAGE_PHP_MOD_SQLITE
+ prompt "php-mod-sqlite................... SQLite module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBSQLITE
+
+config ADK_PACKAGE_PHP_MOD_SOCKETS
+ prompt "php-mod-sockets.................. Sockets module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+
+config ADK_PACKAGE_PHP_MOD_XML
+ prompt "php-mod-xml...................... XML module"
+ tristate
+ default n
+ depends ADK_COMPILE_PHP
+ select ADK_PACKAGE_LIBEXPAT
+
+endmenu
diff --git a/package/php/Makefile b/package/php/Makefile
new file mode 100644
index 000000000..4cee9d2c4
--- /dev/null
+++ b/package/php/Makefile
@@ -0,0 +1,167 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= php
+PKG_VERSION:= 5.2.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 98b647561dc664adefe296106056cf11
+MASTER_SITES:= http://de.php.net/distributions/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,PHP_CLI,php-cli,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PHP_FASTCGI,php-fastcgi,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+define PKG_mod_template
+
+INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
+
+${2}-install:
+ ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/php
+ ${INSTALL_DATA} $(WRKBUILD)/modules/$(2).so $$(IDIR_$(1))/usr/lib/php
+
+endef
+
+PKG_CONFIGURE_OPTS:= \
+ --without-pear \
+ --disable-spl \
+ --with-config-file-path=/etc \
+ --enable-magic-quotes \
+ --disable-short-tags \
+ --disable-ctype \
+ --disable-dom \
+ --enable-ftp=shared \
+ --without-gettext \
+ --without-iconv \
+ --disable-libxml \
+ --without-libxml-dir \
+ --disable-mbstring \
+ --disable-mbregex \
+ --with-openssl=shared,"$(STAGING_DIR)/usr" \
+ --with-kerberos=no \
+ --with-openssl-dir="$(STAGING_DIR)/usr" \
+ --enable-session=shared \
+ --disable-simplexml \
+ --disable-soap \
+ --enable-sockets=shared \
+ --disable-tokenizer \
+ --disable-filter \
+ --disable-xmlreader \
+ --disable-xmlwriter \
+ --with-zlib="$(STAGING_DIR)/usr" \
+ --with-zlib-dir="$(STAGING_DIR)/usr" \
+ --enable-cli \
+ --enable-cgi \
+ --enable-fastcgi \
+ --enable-force-cgi-redirect \
+ --enable-discard-path \
+
+ifneq ($(ADK_PACKAGE_PHP_MOD_CURL),)
+PKG_CONFIGURE_OPTS+= --with-curl=shared,"$(STAGING_DIR)/usr"
+else
+PKG_CONFIGURE_OPTS+= --without-curl
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_GD),)
+PKG_CONFIGURE_OPTS+= --with-gd=shared,"$(STAGING_DIR)/usr" \
+ --without-freetype-dir \
+ --with-jpeg-dir="$(STAGING_DIR)/usr" \
+ --with-png-dir="$(STAGING_DIR)/usr" \
+ --without-xpm-dir \
+ --without-ttf \
+ --without-t1lib \
+ --enable-gd-native-ttf \
+ --disable-gd-jis-conv
+else
+PKG_CONFIGURE_OPTS+= --without-gd
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_GMP),)
+PKG_CONFIGURE_OPTS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
+else
+PKG_CONFIGURE_OPTS+= --without-gmp
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_LDAP),)
+PKG_CONFIGURE_OPTS+= --with-ldap=shared,"$(STAGING_DIR)/usr" \
+ --with-ldap-sasl="$(STAGING_DIR)/usr"
+else
+PKG_CONFIGURE_OPTS+= --without-ldap
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_MYSQL),)
+PKG_CONFIGURE_OPTS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
+else
+PKG_CONFIGURE_OPTS+= --without-mysql
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_PCRE),)
+PKG_CONFIGURE_OPTS+= --with-pcre-regex=shared,"$(STAGING_DIR)/usr"
+else
+PKG_CONFIGURE_OPTS+= --without-pcre-regex
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_PGSQL),)
+PKG_CONFIGURE_OPTS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
+else
+PKG_CONFIGURE_OPTS+= --without-pgsql
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_SQLITE),)
+PKG_CONFIGURE_OPTS+= --without-sqlite
+PKG_CONFIGURE_OPTS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
+PKG_CONFIGURE_OPTS+= --enable-pdo=shared
+else
+PKG_CONFIGURE_OPTS+= --without-sqlite
+endif
+ifneq ($(ADK_PACKAGE_PHP_MOD_XML),)
+PKG_CONFIGURE_OPTS+= --enable-xml=shared,"$(STAGING_DIR)/usr" \
+ --with-libexpat-dir="$(STAGING_DIR)/usr"
+else
+PKG_CONFIGURE_OPTS+= --disable-xml
+endif
+
+$(eval $(call PKG_template,PHP_MOD_CURL,php-mod-curl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_FTP,php-mod-ftp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_GD,php-mod-gd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_GMP,php-mod-gmp,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_LDAP,php-mod-ldap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_MYSQL,php-mod-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_OPENSSL,php-mod-openssl,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_PCRE,php-mod-pcre,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_PGSQL,php-mod-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_SESSION,php-mod-session,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_SOCKETS,php-mod-sockets,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_SQLITE,php-mod-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PHP_MOD_XML,php-mod-xml,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(eval $(call PKG_mod_template,PHP_MOD_CURL,curl))
+$(eval $(call PKG_mod_template,PHP_MOD_FTP,ftp))
+$(eval $(call PKG_mod_template,PHP_MOD_GD,gd))
+$(eval $(call PKG_mod_template,PHP_MOD_GMP,gmp))
+$(eval $(call PKG_mod_template,PHP_MOD_LDAP,ldap))
+$(eval $(call PKG_mod_template,PHP_MOD_MYSQL,mysql))
+$(eval $(call PKG_mod_template,PHP_MOD_OPENSSL,openssl))
+$(eval $(call PKG_mod_template,PHP_MOD_PCRE,pcre))
+$(eval $(call PKG_mod_template,PHP_MOD_PGSQL,pgsql))
+$(eval $(call PKG_mod_template,PHP_MOD_SESSION,session))
+$(eval $(call PKG_mod_template,PHP_MOD_SOCKETS,sockets))
+$(eval $(call PKG_mod_template,PHP_MOD_SQLITE,pdo))
+$(eval $(call PKG_mod_template,PHP_MOD_XML,xml))
+
+TLDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= $(PKG_CONFIGURE_OPTS)
+BUILD_STYLE:= auto
+
+do-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
+ ${INSTALL_DIR} $(IDIR_PHP_CLI)/etc
+ ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_CLI)/etc/
+ ${INSTALL_DIR} $(IDIR_PHP_CLI)/usr/bin
+ ${INSTALL_BIN} $(WRKBUILD)/sapi/cli/php $(IDIR_PHP_CLI)/usr/bin/php
+ ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc
+ ${INSTALL_DATA} ./files/php.ini $(IDIR_PHP_FASTCGI)/etc/
+ ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/etc/init.d
+ ${INSTALL_BIN} ./files/php.init \
+ $(IDIR_PHP_FASTCGI)/etc/init.d/php
+ ${INSTALL_DIR} $(IDIR_PHP_FASTCGI)/usr/sbin
+ ${INSTALL_BIN} $(WRKBUILD)/sapi/cgi/php-cgi $(IDIR_PHP_FASTCGI)/usr/sbin/php
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/php/files/php.ini b/package/php/files/php.ini
new file mode 100644
index 000000000..ae16d0b61
--- /dev/null
+++ b/package/php/files/php.ini
@@ -0,0 +1,561 @@
+[PHP]
+
+cgi.fix_pathinfo=1
+
+zend.ze1_compatibility_mode = Off
+
+;short_open_tag = Off
+asp_tags = Off
+precision = 12
+y2k_compliance = On
+output_buffering = Off
+
+zlib.output_compression = Off
+;zlib.output_handler =
+implicit_flush = Off
+
+unserialize_callback_func=
+serialize_precision = 100
+
+allow_call_time_pass_reference = On
+
+safe_mode = Off
+
+safe_mode_gid = Off
+
+safe_mode_include_dir =
+
+safe_mode_exec_dir =
+
+safe_mode_allowed_env_vars = PHP_
+
+safe_mode_protected_env_vars = LD_LIBRARY_PATH
+
+;open_basedir =
+
+disable_functions =
+
+disable_classes =
+
+; Colors for Syntax Highlighting mode. Anything that's acceptable in
+; <span style="color: ???????"> would work.
+;highlight.string = #DD0000
+;highlight.comment = #FF9900
+;highlight.keyword = #007700
+;highlight.bg = #FFFFFF
+;highlight.default = #0000BB
+;highlight.html = #000000
+
+expose_php = On
+
+
+;;;;;;;;;;;;;;;;;;;
+; Resource Limits ;
+;;;;;;;;;;;;;;;;;;;
+
+max_execution_time = 30 ; Maximum execution time of each script, in seconds
+max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
+memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Error handling and logging ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; error_reporting is a bit-field. Or each number up to get desired error
+; reporting level
+; E_ALL - All errors and warnings (doesn't include E_STRICT)
+; E_ERROR - fatal run-time errors
+; E_WARNING - run-time warnings (non-fatal errors)
+; E_PARSE - compile-time parse errors
+; E_NOTICE - run-time notices (these are warnings which often result
+; from a bug in your code, but it's possible that it was
+; intentional (e.g., using an uninitialized variable and
+; relying on the fact it's automatically initialized to an
+; empty string)
+; E_STRICT - run-time notices, enable to have PHP suggest changes
+; to your code which will ensure the best interoperability
+; and forward compatibility of your code
+; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
+; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
+; initial startup
+; E_COMPILE_ERROR - fatal compile-time errors
+; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
+; E_USER_ERROR - user-generated error message
+; E_USER_WARNING - user-generated warning message
+; E_USER_NOTICE - user-generated notice message
+;
+; Examples:
+;
+; - Show all errors, except for notices and coding standards warnings
+;
+;error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
+;
+; - Show all errors, except for notices
+;
+;error_reporting = E_ALL & ~E_NOTICE
+;
+; - Show only errors
+;
+;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
+;
+; - Show all errors except for notices and coding standards warnings
+;
+error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
+
+; Print out errors (as a part of the output). For production web sites,
+; you're strongly encouraged to turn this feature off, and use error logging
+; instead (see below). Keeping display_errors enabled on a production web site
+; may reveal security information to end users, such as file paths on your Web
+; server, your database schema or other information.
+display_errors = On
+
+; Even when display_errors is on, errors that occur during PHP's startup
+; sequence are not displayed. It's strongly recommended to keep
+; display_startup_errors off, except for when debugging.
+display_startup_errors = Off
+
+; Log errors into a log file (server-specific log, stderr, or error_log (below))
+; As stated above, you're strongly advised to use error logging in place of
+; error displaying on production web sites.
+log_errors = Off
+
+; Set maximum length of log_errors. In error_log information about the source is
+; added. The default is 1024 and 0 allows to not apply any maximum length at all.
+log_errors_max_len = 1024
+
+; Do not log repeated messages. Repeated errors must occur in same file on same
+; line until ignore_repeated_source is set true.
+ignore_repeated_errors = Off
+
+; Ignore source of message when ignoring repeated messages. When this setting
+; is On you will not log errors with repeated messages from different files or
+; sourcelines.
+ignore_repeated_source = Off
+
+; If this parameter is set to Off, then memory leaks will not be shown (on
+; stdout or in the log). This has only effect in a debug compile, and if
+; error reporting includes E_WARNING in the allowed list
+report_memleaks = On
+
+; Store the last error/warning message in $php_errormsg (boolean).
+track_errors = Off
+
+; Disable the inclusion of HTML tags in error messages.
+; Note: Never use this feature for production boxes.
+;html_errors = Off
+
+; If html_errors is set On PHP produces clickable error messages that direct
+; to a page describing the error or function causing the error in detail.
+; You can download a copy of the PHP manual from http://www.php.net/docs.php
+; and change docref_root to the base URL of your local copy including the
+; leading '/'. You must also specify the file extension being used including
+; the dot.
+; Note: Never use this feature for production boxes.
+;docref_root = "/phpmanual/"
+;docref_ext = .html
+
+; String to output before an error message.
+;error_prepend_string = "<font color=ff0000>"
+
+; String to output after an error message.
+;error_append_string = "</font>"
+
+; Log errors to specified file.
+;error_log = filename
+
+; Log errors to syslog (Event Log on NT, not valid in Windows 95).
+;error_log = syslog
+
+
+;;;;;;;;;;;;;;;;;
+; Data Handling ;
+;;;;;;;;;;;;;;;;;
+;
+; Note - track_vars is ALWAYS enabled as of PHP 4.0.3
+
+; The separator used in PHP generated URLs to separate arguments.
+; Default is "&".
+;arg_separator.output = "&amp;"
+
+; List of separator(s) used by PHP to parse input URLs into variables.
+; Default is "&".
+; NOTE: Every character in this directive is considered as separator!
+;arg_separator.input = ";&"
+
+; This directive describes the order in which PHP registers GET, POST, Cookie,
+; Environment and Built-in variables (G, P, C, E & S respectively, often
+; referred to as EGPCS or GPC). Registration is done from left to right, newer
+; values override older values.
+variables_order = "EGPCS"
+
+; Whether or not to register the EGPCS variables as global variables. You may
+; want to turn this off if you don't want to clutter your scripts' global scope
+; with user data. This makes most sense when coupled with track_vars - in which
+; case you can access all of the GPC variables through the $HTTP_*_VARS[],
+; variables.
+;
+; You should do your best to write your scripts so that they do not require
+; register_globals to be on; Using form variables as globals can easily lead
+; to possible security problems, if the code is not very well thought of.
+register_globals = Off
+
+; Whether or not to register the old-style input arrays, HTTP_GET_VARS
+; and friends. If you're not using them, it's recommended to turn them off,
+; for performance reasons.
+register_long_arrays = On
+
+; This directive tells PHP whether to declare the argv&argc variables (that
+; would contain the GET information). If you don't use these variables, you
+; should turn it off for increased performance.
+register_argc_argv = On
+
+; Maximum size of POST data that PHP will accept.
+post_max_size = 8M
+
+; Magic quotes
+;
+
+; Magic quotes for incoming GET/POST/Cookie data.
+magic_quotes_gpc = On
+
+; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
+magic_quotes_runtime = Off
+
+; Use Sybase-style magic quotes (escape ' with '' instead of \').
+magic_quotes_sybase = Off
+
+; Automatically add files before or after any PHP document.
+auto_prepend_file =
+auto_append_file =
+
+; As of 4.0b4, PHP always outputs a character encoding by default in
+; the Content-type: header. To disable sending of the charset, simply
+; set it to be empty.
+;
+; PHP's built-in default is text/html
+default_mimetype = "text/html"
+;default_charset = "iso-8859-1"
+
+; Always populate the $HTTP_RAW_POST_DATA variable.
+;always_populate_raw_post_data = On
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;
+; Paths and Directories ;
+;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; UNIX: "/path1:/path2"
+;include_path = ".:/php/includes"
+;
+; Windows: "\path1;\path2"
+;include_path = ".;c:\php\includes"
+
+; The root of the PHP pages, used only if nonempty.
+; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
+; if you are running php as a CGI under any web server (other than IIS)
+; see documentation for security issues. The alternate is to use the
+; cgi.force_redirect configuration below
+doc_root = /www
+
+; The directory under which PHP opens the script using /~username used only
+; if nonempty.
+user_dir =
+
+; Directory in which the loadable extensions (modules) reside.
+extension_dir = "/usr/lib/php"
+
+; Whether or not to enable the dl() function. The dl() function does NOT work
+; properly in multithreaded servers, such as IIS or Zeus, and is automatically
+; disabled on them.
+enable_dl = On
+
+; cgi.force_redirect is necessary to provide security running PHP as a CGI under
+; most web servers. Left undefined, PHP turns this on by default. You can
+; turn it off here AT YOUR OWN RISK
+; **You CAN safely turn this off for IIS, in fact, you MUST.**
+; cgi.force_redirect = 1
+
+; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
+; every request.
+; cgi.nph = 1
+
+; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
+; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
+; will look for to know it is OK to continue execution. Setting this variable MAY
+; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
+; cgi.redirect_status_env = ;
+
+; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
+; security tokens of the calling client. This allows IIS to define the
+; security context that the request runs under. mod_fastcgi under Apache
+; does not currently support this feature (03/17/2002)
+; Set to 1 if running under IIS. Default is zero.
+; fastcgi.impersonate = 1;
+
+; cgi.rfc2616_headers configuration option tells PHP what type of headers to
+; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
+; is supported by Apache. When this option is set to 1 PHP will send
+; RFC2616 compliant header.
+; Default is zero.
+;cgi.rfc2616_headers = 0
+
+
+;;;;;;;;;;;;;;;;
+; File Uploads ;
+;;;;;;;;;;;;;;;;
+
+; Whether to allow HTTP file uploads.
+file_uploads = On
+
+; Temporary directory for HTTP uploaded files (will use system default if not
+; specified).
+upload_tmp_dir = /tmp
+
+; Maximum allowed size for uploaded files.
+upload_max_filesize = 2M
+
+
+;;;;;;;;;;;;;;;;;;
+; Fopen wrappers ;
+;;;;;;;;;;;;;;;;;;
+
+; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
+allow_url_fopen = On
+
+; Define the anonymous ftp password (your email address)
+;from="john@doe.com"
+
+; Define the User-Agent string
+; user_agent="PHP"
+
+; Default timeout for socket based streams (seconds)
+default_socket_timeout = 60
+
+; If your scripts have to deal with files from Macintosh systems,
+; or you are running on a Mac and need to deal with files from
+; unix or win32 systems, setting this flag will cause PHP to
+; automatically detect the EOL character in those files so that
+; fgets() and file() will work regardless of the source of the file.
+; auto_detect_line_endings = Off
+
+
+;;;;;;;;;;;;;;;;;;;;;;
+; Dynamic Extensions ;
+;;;;;;;;;;;;;;;;;;;;;;
+;
+; If you wish to have an extension loaded automatically, use the following
+; syntax:
+;
+; extension=modulename.extension
+;
+; For example, on Windows:
+;
+; extension=msql.dll
+;
+; ... or under UNIX:
+;
+; extension=msql.so
+;
+; Note that it should be the name of the module only; no directory information
+; needs to go here. Specify the location of the extension with the
+; extension_dir directive above.
+
+
+;Windows Extensions
+;Note that ODBC support is built in, so no dll is needed for it.
+;
+
+;extension=ftp.so
+;extension=gd.so
+;extension=mysql.so
+;extension=pcre.so
+;extension=session.so
+;extension=sockets.so
+;extension=xml.so
+
+
+
+
+;;;;;;;;;;;;;;;;;;;
+; Module Settings ;
+;;;;;;;;;;;;;;;;;;;
+
+[SQL]
+sql.safe_mode = Off
+
+[Session]
+; Handler used to store/retrieve data.
+session.save_handler = files
+
+; Argument passed to save_handler. In the case of files, this is the path
+; where data files are stored. Note: Windows users have to change this
+; variable in order to use PHP's session functions.
+;
+; As of PHP 4.0.1, you can define the path as:
+;
+; session.save_path = "N;/path"
+;
+; where N is an integer. Instead of storing all the session files in
+; /path, what this will do is use subdirectories N-levels deep, and
+; store the session data in those directories. This is useful if you
+; or your OS have problems with lots of files in one directory, and is
+; a more efficient layout for servers that handle lots of sessions.
+;
+; NOTE 1: PHP will not create this directory structure automatically.
+; You can use the script in the ext/session dir for that purpose.
+; NOTE 2: See the section on garbage collection below if you choose to
+; use subdirectories for session storage
+;
+; The file storage module creates files using mode 600 by default.
+; You can change that by using
+;
+; session.save_path = "N;MODE;/path"
+;
+; where MODE is the octal representation of the mode. Note that this
+; does not overwrite the process's umask.
+session.save_path = "/tmp"
+
+; Whether to use cookies.
+session.use_cookies = 1
+
+; This option enables administrators to make their users invulnerable to
+; attacks which involve passing session ids in URLs; defaults to 0.
+; session.use_only_cookies = 1
+
+; Name of the session (used as cookie name).
+session.name = PHPSESSID
+
+; Initialize session on request startup.
+session.auto_start = 0
+
+; Lifetime in seconds of cookie or, if 0, until browser is restarted.
+session.cookie_lifetime = 0
+
+; The path for which the cookie is valid.
+session.cookie_path = /
+
+; The domain for which the cookie is valid.
+session.cookie_domain =
+
+; Handler used to serialize data. php is the standard serializer of PHP.
+session.serialize_handler = php
+
+; Define the probability that the 'garbage collection' process is started
+; on every session initialization.
+; The probability is calculated by using gc_probability/gc_divisor,
+; e.g. 1/100 means there is a 1% chance that the GC process starts
+; on each request.
+
+session.gc_probability = 1
+session.gc_divisor = 100
+
+; After this number of seconds, stored data will be seen as 'garbage' and
+; cleaned up by the garbage collection process.
+session.gc_maxlifetime = 1440
+
+; NOTE: If you are using the subdirectory option for storing session files
+; (see session.save_path above), then garbage collection does *not*
+; happen automatically. You will need to do your own garbage
+; collection through a shell script, cron entry, or some other method.
+; For example, the following script would is the equivalent of
+; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
+; cd /path/to/sessions; find -cmin +24 | xargs rm
+
+; PHP 4.2 and less have an undocumented feature/bug that allows you to
+; to initialize a session variable in the global scope, albeit register_globals
+; is disabled. PHP 4.3 and later will warn you, if this feature is used.
+; You can disable the feature and the warning separately. At this time,
+; the warning is only displayed, if bug_compat_42 is enabled.
+
+session.bug_compat_42 = 1
+session.bug_compat_warn = 1
+
+; Check HTTP Referer to invalidate externally stored URLs containing ids.
+; HTTP_REFERER has to contain this substring for the session to be
+; considered as valid.
+session.referer_check =
+
+; How many bytes to read from the file.
+session.entropy_length = 0
+
+; Specified here to create the session id.
+session.entropy_file =
+
+;session.entropy_length = 16
+
+;session.entropy_file = /dev/urandom
+
+; Set to {nocache,private,public,} to determine HTTP caching aspects
+; or leave this empty to avoid sending anti-caching headers.
+session.cache_limiter = nocache
+
+; Document expires after n minutes.
+session.cache_expire = 180
+
+; trans sid support is disabled by default.
+; Use of trans sid may risk your users security.
+; Use this option with caution.
+; - User may send URL contains active session ID
+; to other person via. email/irc/etc.
+; - URL that contains active session ID may be stored
+; in publically accessible computer.
+; - User may access your site with the same session ID
+; always using URL stored in browser's history or bookmarks.
+session.use_trans_sid = 0
+
+; Select a hash function
+; 0: MD5 (128 bits)
+; 1: SHA-1 (160 bits)
+session.hash_function = 0
+
+; Define how many bits are stored in each character when converting
+; the binary hash data to something readable.
+;
+; 4 bits: 0-9, a-f
+; 5 bits: 0-9, a-v
+; 6 bits: 0-9, a-z, A-Z, "-", ","
+session.hash_bits_per_character = 4
+
+; The URL rewriter will look for URLs in a defined set of HTML tags.
+; form/fieldset are special; if you include them here, the rewriter will
+; add a hidden <input> field with the info which is otherwise appended
+; to URLs. If you want XHTML conformity, remove the form entry.
+; Note that all valid entries require a "=", even if no value follows.
+url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
+
+
+[Assertion]
+; Assert(expr); active by default.
+;assert.active = On
+
+; Issue a PHP warning for each failed assertion.
+;assert.warning = On
+
+; Don't bail out by default.
+;assert.bail = Off
+
+; User-function to be called if an assertion fails.
+;assert.callback = 0
+
+; Eval the expression with current error_reporting(). Set to true if you want
+; error_reporting(0) around the eval().
+;assert.quiet_eval = 0
+
+
+
+
+
+[exif]
+; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
+; With mbstring support this will automatically be converted into the encoding
+; given by corresponding encode setting. When empty mbstring.internal_encoding
+; is used. For the decode settings you can distinguish between motorola and
+; intel byte order. A decode setting cannot be empty.
+;exif.encode_unicode = ISO-8859-15
+;exif.decode_unicode_motorola = UCS-2BE
+;exif.decode_unicode_intel = UCS-2LE
+;exif.encode_jis =
+;exif.decode_jis_motorola = JIS
+;exif.decode_jis_intel = JIS
+
diff --git a/package/php/files/php.init b/package/php/files/php.init
new file mode 100644
index 000000000..c48ae227d
--- /dev/null
+++ b/package/php/files/php.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+export PHP_FCGI_CHILDREN=''
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${php:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ php ${php_flags} &
+ ;;
+stop)
+ killall php
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/php/ipkg/php-cgi.conffiles b/package/php/ipkg/php-cgi.conffiles
new file mode 100644
index 000000000..f1b6b5fc9
--- /dev/null
+++ b/package/php/ipkg/php-cgi.conffiles
@@ -0,0 +1 @@
+/etc/php.ini
diff --git a/package/php/ipkg/php-cgi.control b/package/php/ipkg/php-cgi.control
new file mode 100644
index 000000000..b80794a65
--- /dev/null
+++ b/package/php/ipkg/php-cgi.control
@@ -0,0 +1,6 @@
+Package: php-cgi
+Priority: optional
+Section: net
+Provides: php
+Depends: libopenssl, zlib
+Description: PHP5 compiled as for CGI
diff --git a/package/php/ipkg/php-cli.conffiles b/package/php/ipkg/php-cli.conffiles
new file mode 100644
index 000000000..f1b6b5fc9
--- /dev/null
+++ b/package/php/ipkg/php-cli.conffiles
@@ -0,0 +1 @@
+/etc/php.ini
diff --git a/package/php/ipkg/php-cli.control b/package/php/ipkg/php-cli.control
new file mode 100644
index 000000000..6b0889836
--- /dev/null
+++ b/package/php/ipkg/php-cli.control
@@ -0,0 +1,6 @@
+Package: php-cli
+Priority: optional
+Section: net
+Provides: php
+Depends: libopenssl, zlib
+Description: PHP5 CLI (Command Line Interface)
diff --git a/package/php/ipkg/php-fastcgi.conffiles b/package/php/ipkg/php-fastcgi.conffiles
new file mode 100644
index 000000000..f1b6b5fc9
--- /dev/null
+++ b/package/php/ipkg/php-fastcgi.conffiles
@@ -0,0 +1 @@
+/etc/php.ini
diff --git a/package/php/ipkg/php-fastcgi.control b/package/php/ipkg/php-fastcgi.control
new file mode 100644
index 000000000..9a95cedf0
--- /dev/null
+++ b/package/php/ipkg/php-fastcgi.control
@@ -0,0 +1,6 @@
+Package: php-fastcgi
+Priority: optional
+Section: net
+Provides: php
+Depends: libopenssl, zlib
+Description: PHP5 compiled for FastCGI (for use with libhttpd-fastcgi)
diff --git a/package/php/ipkg/php-fastcgi.postinst b/package/php/ipkg/php-fastcgi.postinst
new file mode 100644
index 000000000..4497d75d1
--- /dev/null
+++ b/package/php/ipkg/php-fastcgi.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf php php NO
+add_rcconf php_flags php_flags "-b 1026"
diff --git a/package/php/ipkg/php-mod-curl.control b/package/php/ipkg/php-mod-curl.control
new file mode 100644
index 000000000..4ca5f42a2
--- /dev/null
+++ b/package/php/ipkg/php-mod-curl.control
@@ -0,0 +1,5 @@
+Package: php-mod-curl
+Priority: optional
+Section: net
+Depends: php, libcurl
+Description: cURL module for PHP5
diff --git a/package/php/ipkg/php-mod-ftp.control b/package/php/ipkg/php-mod-ftp.control
new file mode 100644
index 000000000..a8dd0b3fd
--- /dev/null
+++ b/package/php/ipkg/php-mod-ftp.control
@@ -0,0 +1,5 @@
+Package: php-mod-ftp
+Priority: optional
+Section: net
+Depends: php
+Description: FTP module for PHP5
diff --git a/package/php/ipkg/php-mod-gd.control b/package/php/ipkg/php-mod-gd.control
new file mode 100644
index 000000000..2cf37cb03
--- /dev/null
+++ b/package/php/ipkg/php-mod-gd.control
@@ -0,0 +1,5 @@
+Package: php-mod-gd
+Priority: optional
+Section: net
+Depends: php, libgd, libpng
+Description: GD module for PHP5
diff --git a/package/php/ipkg/php-mod-gmp.control b/package/php/ipkg/php-mod-gmp.control
new file mode 100644
index 000000000..aa54fbb89
--- /dev/null
+++ b/package/php/ipkg/php-mod-gmp.control
@@ -0,0 +1,5 @@
+Package: php-mod-gmp
+Priority: optional
+Section: net
+Depends: php, libgmp
+Description: GMP (GNU MP) module for PHP5
diff --git a/package/php/ipkg/php-mod-ldap.control b/package/php/ipkg/php-mod-ldap.control
new file mode 100644
index 000000000..19f8431cf
--- /dev/null
+++ b/package/php/ipkg/php-mod-ldap.control
@@ -0,0 +1,5 @@
+Package: php-mod-ldap
+Priority: optional
+Section: net
+Depends: php, libopenldap
+Description: LDAP module for PHP5
diff --git a/package/php/ipkg/php-mod-mysql.control b/package/php/ipkg/php-mod-mysql.control
new file mode 100644
index 000000000..91803e7d5
--- /dev/null
+++ b/package/php/ipkg/php-mod-mysql.control
@@ -0,0 +1,5 @@
+Package: php-mod-mysql
+Priority: optional
+Section: net
+Depends: php, libmysqlclient
+Description: MySQL module for PHP5
diff --git a/package/php/ipkg/php-mod-openssl.control b/package/php/ipkg/php-mod-openssl.control
new file mode 100644
index 000000000..eeb9283e6
--- /dev/null
+++ b/package/php/ipkg/php-mod-openssl.control
@@ -0,0 +1,5 @@
+Package: php-mod-openssl
+Priority: optional
+Section: net
+Depends: php, libopenssl
+Description: OpenSSL module for PHP5
diff --git a/package/php/ipkg/php-mod-pcre.control b/package/php/ipkg/php-mod-pcre.control
new file mode 100644
index 000000000..5effe2f94
--- /dev/null
+++ b/package/php/ipkg/php-mod-pcre.control
@@ -0,0 +1,5 @@
+Package: php-mod-pcre
+Priority: optional
+Section: net
+Depends: php, libpcre
+Description: PCRE module for PHP5
diff --git a/package/php/ipkg/php-mod-pgsql.control b/package/php/ipkg/php-mod-pgsql.control
new file mode 100644
index 000000000..c55da6966
--- /dev/null
+++ b/package/php/ipkg/php-mod-pgsql.control
@@ -0,0 +1,5 @@
+Package: php-mod-pgsql
+Priority: optional
+Section: net
+Depends: php, libpq
+Description: PostgreSQL module for PHP5
diff --git a/package/php/ipkg/php-mod-session.control b/package/php/ipkg/php-mod-session.control
new file mode 100644
index 000000000..accbf97aa
--- /dev/null
+++ b/package/php/ipkg/php-mod-session.control
@@ -0,0 +1,5 @@
+Package: php-mod-session
+Priority: optional
+Section: net
+Depends: php
+Description: Sessions module for PHP5
diff --git a/package/php/ipkg/php-mod-sockets.control b/package/php/ipkg/php-mod-sockets.control
new file mode 100644
index 000000000..b93a85657
--- /dev/null
+++ b/package/php/ipkg/php-mod-sockets.control
@@ -0,0 +1,5 @@
+Package: php-mod-sockets
+Priority: optional
+Section: net
+Depends: php
+Description: Sockets module for PHP5
diff --git a/package/php/ipkg/php-mod-sqlite.control b/package/php/ipkg/php-mod-sqlite.control
new file mode 100644
index 000000000..427e779f4
--- /dev/null
+++ b/package/php/ipkg/php-mod-sqlite.control
@@ -0,0 +1,5 @@
+Package: php-mod-sqlite
+Priority: optional
+Section: net
+Depends: php, libsqlite
+Description: SQLite module for PHP5
diff --git a/package/php/ipkg/php-mod-xml.control b/package/php/ipkg/php-mod-xml.control
new file mode 100644
index 000000000..ff25d7dd9
--- /dev/null
+++ b/package/php/ipkg/php-mod-xml.control
@@ -0,0 +1,5 @@
+Package: php-mod-xml
+Priority: optional
+Section: net
+Depends: php, libexpat
+Description: XML module for PHP5
diff --git a/package/picocom/Config.in b/package/picocom/Config.in
new file mode 100644
index 000000000..be5400182
--- /dev/null
+++ b/package/picocom/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_PICOCOM
+ prompt "picocom........................... minimal dumb-terminal emulation program"
+ tristate
+ default n
+ help
+ As its name suggests, picocom is a minimal dumb-terminal emulation
+ program. It is, in principle, very much like minicom, only it's pico
+ instead of mini! It was designed to serve as a simple, manual, modem
+ configuration, testing, and debugging tool. It has also served (quite
+ well) as a low-tech "terminal-window" to allow operator intervention
+ in PPP connection scripts. It could also prove useful in many other
+ similar tasks.
+
+ http://efault.net/npat/hacks/picocom/
+
diff --git a/package/picocom/Makefile b/package/picocom/Makefile
new file mode 100644
index 000000000..0d2aae07d
--- /dev/null
+++ b/package/picocom/Makefile
@@ -0,0 +1,25 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= picocom
+PKG_VERSION:= 1.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 08fcc5f6bb9e7676a2569386d5ea9f70
+MASTER_SITES:= http://efault.net/npat/hacks/picocom/dist/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PICOCOM,picocom,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+ALL_TARGET:= picocom
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PICOCOM}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/picocom ${IDIR_PICOCOM}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/picocom/ipkg/picocom.control b/package/picocom/ipkg/picocom.control
new file mode 100644
index 000000000..607e947e5
--- /dev/null
+++ b/package/picocom/ipkg/picocom.control
@@ -0,0 +1,4 @@
+Package: picocom
+Priority: optional
+Section: console
+Description: minimal dumb-terminal emulation program
diff --git a/package/pipacs/Config.in b/package/pipacs/Config.in
new file mode 100644
index 000000000..1ab3f3aa3
--- /dev/null
+++ b/package/pipacs/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_PIPACS
+ prompt "pipacs............................ UNIX socket accounting/wiewer program"
+ tristate
+ default n
+ help
+ An UNIX socket accounting/wiewer program.
+ This is version 2.
diff --git a/package/pipacs/Makefile b/package/pipacs/Makefile
new file mode 100644
index 000000000..0abb877df
--- /dev/null
+++ b/package/pipacs/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= pipacs
+PKG_RELEASE:= 2
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PIPACS,pipacs,${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CFLAGS="${TCFLAGS} ${TCPPFLAGS}" \
+ ${TARGET_CONFIGURE_OPTS}
+
+do-configure:
+ mkdir -p ${WRKBUILD}
+ ${CP} ./src/* ${WRKBUILD}
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PIPACS}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/pipacs ${IDIR_PIPACS}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pipacs/ipkg/pipacs.control b/package/pipacs/ipkg/pipacs.control
new file mode 100644
index 000000000..b4349989e
--- /dev/null
+++ b/package/pipacs/ipkg/pipacs.control
@@ -0,0 +1,5 @@
+Package: pipacs
+Priority: optional
+Section: net
+Description: PIPACS - an UNIX socket accounting/wiewer program
+
diff --git a/package/pipacs/src/Makefile b/package/pipacs/src/Makefile
new file mode 100644
index 000000000..a9a88059d
--- /dev/null
+++ b/package/pipacs/src/Makefile
@@ -0,0 +1,15 @@
+# $Id$
+
+EXTRA_CFLAGS := -c -I.
+PIPACS_OBJS := pipacs.o parser.o
+
+all: pipacs
+
+%.o: %.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $^
+
+pipacs: $(PIPACS_OBJS)
+ $(CC) -o $@ $^
+
+clean:
+ rm -f *.o *.so pipacs
diff --git a/package/pipacs/src/parser.c b/package/pipacs/src/parser.c
new file mode 100644
index 000000000..330d7cd0a
--- /dev/null
+++ b/package/pipacs/src/parser.c
@@ -0,0 +1,907 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include<string.h>
+#include <time.h>
+//#include <process.h>
+#include "parser.h"
+
+#define printit
+
+extern BOOL bFilter;
+extern int iline;
+extern char * author;
+extern char myipname[];
+extern int justheader;
+extern int gre,sortbysize,fromip,toip;
+int nomac=1;
+int mostird=0;
+char mypbuff[2048];
+// accounting variables
+#define MAXHASH 0xffff
+#define MAXTCPPORT 4096
+unsigned long *iph=NULL; //[MAXHASH];
+
+typedef struct {
+ unsigned short from;
+ unsigned short to;
+ unsigned long byte;
+ unsigned short pkt;
+ unsigned short sport;
+ unsigned short dport;
+} ta;
+
+ta *acc = NULL;
+unsigned long tcppb[MAXTCPPORT];
+unsigned long tcppp[MAXTCPPORT];
+unsigned long typp[255];
+unsigned long typb[255];
+unsigned long udpb,tcpb,udpp,tcpp;
+time_t elapsed=0;
+int iCycle=10;
+int iScreen=1;
+int iFile=0;
+long lNum=0;
+char filename[128];
+char intlist[128];
+int iRun=1;
+int iDetail=0;
+FILE *f=NULL;
+int iProto=0;
+int iSum=0;
+char execname[255];
+char pbuf[8196];
+char str[255];
+extern char pattern[];
+#ifndef LINUX
+int iLnxplus=0; // Windows buffer without the MAC frame !
+#else
+int iLnxplus=14; // Linux plus IP header len =14 !!!
+#endif
+//
+// A list of protocol types in the IP protocol header
+//
+char *szProto[255] = {"IP", // 0
+ "ICMP", // 1
+ "IGMP", // 2
+ "GGP", // 3
+ "IP", // 4
+ "ST", // 5
+ "TCP", // 6
+ "UCL", // 7
+ "EGP", // 8
+ "IGP", // 9
+ "BBN-RCC-MON", // 10
+ "NVP-II", // 11
+ "PUP", // 12
+ "ARGUS", // 13
+ "EMCON", // 14
+ "XNET", // 15
+ "CHAOS", // 16
+ "UDP", // 17
+ "MUX", // 18
+ "DCN-MEAS", // 19
+ "HMP", // 20
+ "PRM", // 21
+ "XNS-IDP", // 22
+ "TRUNK-1", // 23
+ "TRUNK-2", // 24
+ "LEAF-1", // 25
+ "LEAF-2", // 26
+ "RDP", // 27
+ "IRTP", // 28
+ "ISO-TP4", // 29
+ "NETBLT", // 30
+ "MFE-NSP", // 31
+ "MERIT-INP", // 32
+ "SEP", // 33
+ "3PC", // 34
+ "IDPR", // 35
+ "XTP", // 36
+ "DDP", // 37
+ "IDPR-CMTP", // 38
+ "TP++", // 39
+ "IL", // 40
+ "SIP", // 41
+ "SDRP", // 42
+ "SIP-SR", // 43
+ "SIP-FRAG", // 44
+ "IDRP", // 45
+ "RSVP", // 46
+ "GRE", // 47
+ "MHRP", // 48
+ "BNA", // 49
+ "IPSEC-ESP", // 50
+ "IPSEC-AH", // 51
+ "I-NLSP", // 52
+ "SWIPE", // 53
+ "NHRP", // 54
+ "?55?", // 55
+ "?56?", // 56
+ "SKIO", // 57
+ "V6ICMP", // 58
+ "V6NoNXT", // 59
+ "V6OPT", // 60
+ "int.host", // 61
+ "CFTP", // 62
+ "loc.net", // 63
+ "SAT-EXPAK", // 64
+ "KRYPTOLAN", // 65
+ "RVD", // 66
+ "IPPC", // 67
+ "dist.fs", // 68
+ "SAT-MON", // 69
+ "VISA", // 70
+ "IPCV", // 71
+ "CPNX", // 72
+ "CPHB", // 73
+ "WSN", // 74
+ "PVP", // 75
+ "BR-SAT-MON", // 76
+ "SUN-ND", // 77
+ "WB-MON", // 78
+ "WB-EXPAK", // 79
+ "ISO-IP", // 80
+ "VMTP", // 81
+ "SECURE-VMTP",// 82
+ "VINES", // 83
+ "TTP", // 84
+ "NSFNET-IGP", // 85
+ "DGP", // 86
+ "TCF", // 87
+ "IGRP", // 88
+ "OSPF", // 89
+ "Sprite-RPC", // 90
+ "LARP", // 91
+ "MTP", // 92
+ "AX.25", // 93
+ "IPIP", // 94
+ "MICP", // 95
+ "SCC-SP", // 96
+ "ETHERIP", // 97
+ "ENCAP", // 98
+ "priv.enc", // 99
+ "GMTP" // 99
+ };
+//
+// The types of IGMP messages
+//
+char *szIgmpType[] = {"",
+ "Host Membership Query",
+ "HOst Membership Report",
+ "",
+ "",
+ "",
+ "Version 2 Membership Report",
+ "Leave Group",
+ "",
+ ""
+ };
+
+//
+// Function: PrintRawBytes
+//
+// Description:
+// This function simply prints out a series of bytes
+// as hexadecimal digits.
+//
+void PrintRawBytes(BYTE *ptr, DWORD len)
+{
+ int i,j;
+// if (! iFile) {
+*(ptr+len)=0;
+if ((*pattern==0) || strstr(ptr,pattern) ) {
+ fprintf(iFile?f:stdout,"%s",pbuf);
+ fprintf(iFile?f:stdout," " );
+ while (len > 0) {
+ for(i=0; i < 16; i++) {
+ fprintf(iFile?f:stdout,"%x%x ", HI_WORD(*ptr), LO_WORD(*ptr));
+ len--;
+ ptr++;
+ if (len == 0) {j=i++; while(++j < 16) fprintf(iFile?f:stdout," "); break; }
+ }
+ fprintf(iFile?f:stdout," ");
+ for(j=0; j < i; j++) fprintf(iFile?f:stdout,"%c",isprint(*(ptr-i+j))?*(ptr-i+j):'.');
+ if (len) fprintf(iFile?f:stdout,"\n ");
+ }
+// } else {
+// fwrite(ptr,sizeof(BYTE),len,f);
+// }
+}
+}
+
+static char *ICMPTypeTable[]={
+ "Echo Reply", "ICMP 1", "ICMP 2", "Dest Unreachable","SrcQuench", "Redirect", "6", "7","Echo Request","9","10",
+ "Time Exceed", "ParamPrblm", "Timestamp", "Timestamp reply","InfoRqst", "InfoRply"
+};
+static char *Dstunreach[]={
+"net unreach.","host unreach.","protocol unreach.","port unreach.",
+"frag needed","source route?","",""
+};
+int DecodeICMPHeader(WSABUF *wsabuf, DWORD iphdrlen) {
+ BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus );
+ unsigned short type,code,chksum,
+ id,
+ seq;
+ unsigned long resptime,r1,r2;
+ BYTE *hhh;
+ SOCKADDR_IN addr;
+ type=*hdr++; code=*hdr++;
+ sprintf(str," Type:%-12s Code:%3d,",ICMPTypeTable[type],code);
+
+ strcat(pbuf,str);
+ memcpy(&chksum, hdr, 2);
+ hdr += 2; hhh=hdr;
+ memcpy(&id, hdr, 2);
+ hdr += 2;
+ memcpy(&seq, hdr, 2);
+ hdr+=2;
+// memcpy(&resptime, hdr, 4);
+// hdr+=4;
+ switch (type) {
+ case 3:
+ memcpy(&addr.sin_addr.s_addr, hdr+16, 4);
+ if (code==4 ) sprintf(str,"frag needed-Max MTU:%u at %-15s\n",ntohs(seq), inet_ntoa(addr.sin_addr));
+ else sprintf(str,"%s at %-15s\n",Dstunreach[code&7],inet_ntoa(addr.sin_addr));
+ hdr+=iphdrlen;
+ break;
+ case 11:
+ memcpy(&addr.sin_addr.s_addr, hdr+16, 4);
+ sprintf(str,"%s at %-15s\n",code?"frag reass. exceed":"ttl exceed",inet_ntoa(addr.sin_addr));
+ hdr+=iphdrlen;
+ break;
+ case 12:
+ memcpy(&addr.sin_addr.s_addr, hdr+16, 4);
+ sprintf(str," err:%d at %-15s\n",id,inet_ntoa(addr.sin_addr));
+ hdr+=iphdrlen;
+ break;
+ case 4:
+ memcpy(&addr.sin_addr.s_addr, hdr+16, 4);
+ sprintf(str," wait for %-15s\n",ntohs(id),inet_ntoa(addr.sin_addr));
+ hdr+=iphdrlen;
+ break;
+ case 5:
+ memcpy(&addr.sin_addr.s_addr, hhh, 4);
+ sprintf(str," from gw: %-15s\n",inet_ntoa(addr.sin_addr));
+ hdr+=iphdrlen;
+ break;
+ case 0:
+ case 8:
+ sprintf(str," Id:%3u Seq:%3u\n",ntohs(id),ntohs(seq));
+ break;
+ case 13:
+ case 14:
+ memcpy(&resptime, hdr, 4);
+ hdr+=4;
+ memcpy(&r1, hdr, 4);
+ hdr+=4;
+ memcpy(&r2, hdr, 4);
+ hdr+=4;
+ sprintf(str," Id:%3u Seq:%3d Rec/Tr %ld/%ld ms\n",ntohs(id),ntohs(seq),ntohl(r1)-ntohl(resptime),ntohl(r2)-ntohl(resptime));
+ break;
+ case 15:
+ case 16:
+ sprintf(str," Id:%3u Seq:%3d\n",ntohs(id),ntohs(seq));
+ break;
+ }
+ strcat(pbuf,str);
+ return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus);
+}
+
+//
+// Function: DecodeIGMPHeader
+//
+// Description:
+// This function takes a pointer to a buffer containing
+// an IGMP packet and prints it out in a readable form.
+//
+
+int DecodeIGMPHeader(WSABUF *wsabuf, DWORD iphdrlen) {
+ BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus);
+ unsigned short chksum,
+ version,
+ type,
+ maxresptime;
+ SOCKADDR_IN addr;
+ version = HI_WORD(*hdr);
+ type = LO_WORD(*hdr);
+
+ hdr++;
+ maxresptime = *hdr;
+ hdr++;
+
+ memcpy(&chksum, hdr, 2);
+ chksum = ntohs(chksum);
+ hdr += 2;
+
+ memcpy(&(addr.sin_addr.s_addr), hdr, 4);
+ sprintf(str," IGMP HEADER:\n");
+ strcat(pbuf,str);
+ if ((type == 1) || (type == 2)) version = 1;
+ else version = 2;
+ sprintf(str," IGMP Version = %d\n IGMP Type = %s\n",version, szIgmpType[type]);
+ strcat(pbuf,str);
+ if (version == 2) {
+ sprintf(str," Max Resp Time = %d\n", maxresptime);
+ strcat(pbuf,str);
+ }
+ sprintf(str," IGMP Grp Addr = %s\n", inet_ntoa(addr.sin_addr));
+ strcat(pbuf,str);
+
+ return 8;
+}
+
+//
+// Function: DecodeUDPHeader
+//
+// Description:
+// This function takes a buffer which points to a UDP
+// header and prints it out in a readable form.
+//
+int DecodeUDPHeader(WSABUF *wsabuf, DWORD iphdrlen) {
+ BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus);
+ unsigned short shortval,
+ udp_src_port,
+ udp_dest_port,
+ udp_len,
+ udp_chksum;
+ memcpy(&shortval, hdr, 2);
+ udp_src_port = ntohs(shortval);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ udp_dest_port = ntohs(shortval);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ udp_len = ntohs(shortval);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ udp_chksum = ntohs(shortval);
+ hdr += 2;
+
+ sprintf(str," UDP: SPort: %-05d | DPort: %-05d",udp_src_port, udp_dest_port);
+ strcat(pbuf,str);
+ sprintf(str," | Len: %-05d | CSum: 0x%08x\n",udp_len, udp_chksum);
+ strcat(pbuf,str);
+ return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus);
+}
+
+//
+// Function: DecodeTCPHeader
+//
+// Description:
+// This function takes a buffer pointing to a TCP header
+// and prints it out in a readable form.
+//
+int DecodeTCPHeader(WSABUF *wsabuf, DWORD iphdrlen) {
+ BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus);
+ unsigned short shortval;
+ unsigned long longval;
+
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval);
+ sprintf(str," TCP: SPort: %u", shortval);
+ strcat(pbuf,str);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval);
+ sprintf(str," DPort: %u", shortval);
+ strcat(pbuf,str);
+ hdr += 2;
+
+ memcpy(&longval, hdr, 4);
+ longval = ntohl(longval);
+ sprintf(str," Seq: %lX", longval);
+ strcat(pbuf,str);
+ hdr += 4;
+
+ memcpy(&longval, hdr, 4);
+ longval = ntohl(longval);
+ sprintf(str," ACK: %lX", longval);
+ strcat(pbuf,str);
+ hdr += 4;
+// printf(" Header Len : %d (bytes %d)\n", HI_WORD(*hdr), (HI_WORD(*hdr) * 4));
+
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval) & 0x3F;
+ sprintf(str," Flags: ");
+ strcat(pbuf,str);
+ if (shortval & 0x20) strcat(pbuf,"URG ");
+ if (shortval & 0x10) strcat(pbuf,"ACK ");
+ if (shortval & 0x08) strcat(pbuf,"PSH ");
+ if (shortval & 0x04) strcat(pbuf,"RST ");
+ if (shortval & 0x02) strcat(pbuf,"SYN ");
+ if (shortval & 0x01) strcat(pbuf,"FIN ");
+ strcat(pbuf,"\n");
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval);
+// printf(" Window size: %d\n", shortval);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval);
+// printf(" TCP Chksum : %d\n", shortval);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval);
+ hdr += 2;
+// printf(" Urgent ptr : %d\n", shortval);
+
+ return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus);
+}
+
+int DecodeGREHeader(WSABUF *wsabuf, DWORD iphdrlen,DWORD bytesret,
+ unsigned int srcip, unsigned short srcport, unsigned long srcnet,unsigned int destip, unsigned short destport, unsigned long destnet,
+ unsigned short xport,unsigned int xip, unsigned long xnet)
+ {
+ BYTE *hdr = (BYTE *)((BYTE *)wsabuf->buf + iphdrlen + iLnxplus);
+ unsigned short shortval;
+ unsigned long longval;
+ int ipe;
+ BYTE *orihdr;
+ char *sstr;
+ SOCKADDR_IN srcaddr;
+
+ orihdr=hdr;
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval);
+ sprintf(str," GRE Flag: %u Prot:", shortval);
+ strcat(mypbuff,str);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ shortval = ntohs(shortval);
+ ipe=0;
+ sstr=str;
+// sprintf(str," Prot: %u", shortval);
+ switch ( shortval ) {
+ case 4: sstr="SNA";
+ break;
+ case 0xfe: sstr="OSI";
+ break;
+ case 0x200: sstr="PUP";
+ break;
+ case 0x600: sstr="XNS";
+ break;
+ case 0x800: sstr="IP";
+ ipe=1;
+ break;
+ case 0x804: sstr="Chaos";
+ break;
+ case 0x806: sstr="ARP";
+ break;
+ case 0x6558: sstr="Tr.bridge";
+ break;
+ default: sprintf(str,"%u", shortval);
+ break;
+ }
+ hdr += 2;
+ strcat(mypbuff,sstr);
+ if (ipe && gre) {
+ int plusment,jj,protoment;
+ plusment=iLnxplus;
+ protoment=iProto;
+ if (iProto==47) iProto=0;
+ iLnxplus+=4;
+ nomac=0;
+ iLnxplus=plusment+24;
+ DecodeIPHeader(wsabuf,srcip,srcport,srcnet,destip,destport,destnet,bytesret,xport,xip,xnet);
+ nomac=1;
+ iLnxplus=plusment;
+ iProto=protoment;
+ }
+return -1;
+// return hdr-(BYTE *)(wsabuf->buf + iphdrlen + iLnxplus);
+}
+
+
+int ClearIPAcc() {
+ unsigned long i;
+ ta *tai;
+ for(i=0;i<MAXHASH;i++) *(iph + i)=0;
+ tai=acc;
+ for(i=0;i<MAXHASH;i++) { tai->from=tai->to=0; tai++; }
+ for (i=0;i<MAXTCPPORT; i++) tcppb[i]=tcppp[i]=0;
+ udpb=udpp=tcpp=tcpb=0;
+ for (i=0;i<255; i++) typp[i]=0;
+ for (i=0;i<255; i++) typb[i]=0;
+ return 0;
+ };
+
+int InitIPAcc() {
+ acc=malloc(MAXHASH*sizeof(ta));
+ iph=malloc(MAXHASH*sizeof(long));
+ if (!acc || !iph ) return 0;
+ ClearIPAcc();
+ time(&elapsed);
+ return 1;
+}
+
+int bytesort(const void *s1, const void *s2) { // sorting tale in byte order
+ ta *d1;
+ ta *d2;
+ d1= (ta *)s1; d2=(ta *)s2;
+ if (d1->byte > d2->byte) return -1;
+ if (d1->byte < d2->byte) return 1;
+ return 0;
+}
+int countsort(const void *s1, const void *s2) { // sorting tale in packet count order
+ ta *d1;
+ ta *d2;
+ d1= (ta *)s1; d2=(ta *)s2;
+ if (d1->pkt > d2->pkt) return -1;
+ if (d1->pkt < d2->pkt) return 1;
+ return 0;
+}
+int CloseIPAcc( long ti) {
+ unsigned long i;
+ ta *tai;
+ SOCKADDR_IN srcaddr;
+ SOCKADDR_IN dstaddr;
+ float ff;
+ char str[16];
+ unsigned long j,k,l;
+ int lin=0;
+ int linn;
+
+ time(&elapsed);
+ if (iFile) f=fopen(filename,"w+");
+ k=0;
+ if (sortbysize) qsort(acc,MAXHASH,sizeof(ta),bytesort);
+ else qsort(acc,MAXHASH,sizeof(ta),countsort);
+ ff=0.0;
+ for (i=0;i<255;i++) ff+=typb[i];
+ for (i=0; i<MAXHASH; i++) {
+ tai=acc + i;
+ if ((tai->from!=0) && (tai->to!=0)) ++k;
+ }
+ if (iScreen) {
+#ifndef LINUX
+ system("cls");
+#else
+ system("clear");
+// printf("\033[1~");
+#endif
+ printf("%-16s Speed: %5.2f Kbit/s , %ld IP pairs / %ld secs. %s@%s.hu",myipname,ff/ti/1024*8,k,ti,author,author);
+ printf("\nProt:"); j=0; ++lin;
+ while (1) {
+ l=k=0;
+ for (i=0;i<100;i++) if ( typb[i]>k) { k=typb[i]; l=i; }
+ if (k==0) break;
+ if ((j>0) && ((j%3)==0)) { printf("\n "); ++lin; }
+ if (k>1024*1024) printf(" %-8.8s:%5.1fk/%-6.1f M",szProto[l],(float)typp[l]/1024,(float)k/(1024*1024));
+ else if (k>1024) printf(" %-8.8s:%5ld/%-6.1f k",szProto[l],typp[l],(float)k/1024);
+ else printf(" %-8.8s:%5ld/%-8ld",szProto[l],typp[l],k);
+ typb[l]=0;
+ ++j;
+ }
+ printf("\nPort:"); j=0; ++lin;
+ k=0; linn=lin;
+ while (1) {
+ l=k=0;
+ for (i=0;i<MAXTCPPORT;i++) if (tcppb[i]>k) { k=tcppb[i]; l=i; }
+ if (k==0) break;
+ if (j && (j%4)==0) {
+ if (lin >= linn+1) break;
+ printf("\n ");
+ ++lin;
+ }
+ if (k>1024*1024) printf(" %04d:%4.1fk/%-5.1f M",l,(float)tcppp[l]/1024,(float)k/(1024*1024));
+ else if (k>1024) printf(" %04d:%4ld/%-5.1f k",l,tcppp[l],(float)k/1024);
+ else printf(" %04d:%4ld/%-7ld",l,tcppp[l],k);
+ tcppb[l]=0;
+ ++j;
+ }
+ } else if (f) {
+ fprintf(f,"%-16s Speed: %5.2f Kbit/s , %ld IP pairs / %ld secs. %s@%s.hu",myipname,ff/ti/1024*8,k,ti,author,author);
+ fprintf(f,"\nProt:"); j=0;
+ while (1) {
+ l=k=0;
+ for (i=0;i<100;i++) if ( typb[i]>k) { k=typb[i]; l=i; }
+ if (k==0) break;
+ if (k>1024*1024) fprintf(f," %-8.8s:%5.1fk/%-6.1f M",szProto[l],(float)typp[l]/1024,(float)k/(1024*1024));
+ else if (k>1024) fprintf(f," %-8.8s:%5ld/%-6.1f k",szProto[l],typp[l],(float)k/1024);
+ else fprintf(f," %-8.8s:%5ld/%-8ld",szProto[l],typp[l],k);
+ typb[l]=0;
+ ++j;
+ }
+ printf("\nPort:"); j=0;
+ k=0; linn=lin;
+ while (1) {
+ l=k=0;
+ for (i=0;i<MAXTCPPORT;i++) if (tcppb[i]>k) { k=tcppb[i]; l=i; }
+ if (k==0) break;
+ if (k>1024*1024) fprintf(f," %04d:%4.1fk/%-5.1f M",l,(float)tcppp[l]/1024,(float)k/(1024*1024));
+ else if (k>1024) fprintf(f," %04d:%4ld/%-5.1f k",l,tcppp[l],(float)k/1024);
+ else fprintf(f," %04d:%4ld/%-7ld",l,tcppp[l],k);
+ tcppb[l]=0;
+ ++j;
+ }
+ }
+
+ for (i=0; i<MAXHASH; i++) {
+ tai=acc + i;
+ if ((tai->from!=0) && (tai->to!=0)) { ++k;
+ if (!iSum) {
+ dstaddr.sin_addr.s_addr = htonl(*(iph+tai->from));
+ srcaddr.sin_addr.s_addr = htonl(*(iph+(tai->to)));
+ strcpy(str,inet_ntoa(dstaddr.sin_addr));
+ if (iScreen && (++lin<iline) ) printf("\n%-15s\t%-15s\t%5d pkt, %10ld byte :%7.2f Kbps",str,inet_ntoa(srcaddr.sin_addr),tai->pkt,tai->byte,((float)tai->byte)/ti/1024*8);
+ if (f) fprintf(f,"%-15s\t%-15s\t%d\t%ld\n",str,inet_ntoa(srcaddr.sin_addr),tai->pkt,tai->byte);
+ }
+ }
+ }
+ if (iScreen) printf("\n");
+#ifdef LINUX
+ if (iScreen) fflush(stdout);
+#endif
+ ClearIPAcc();
+ if (f) {
+ char cmdline[255];
+ fclose(f);
+// if (*execname) _spawnle(_P_NOWAIT,execname,execname,filename);
+// if (*execname) _execl(execname,execname);
+ if (*execname) {
+#ifndef LINUX
+ sprintf(cmdline,"%s %s",execname,filename);
+#else
+ sprintf(cmdline,"%s %s",execname,filename);
+#endif
+ system(cmdline);
+// iRun=0;
+ }
+ }
+ f=NULL;
+ return 0;
+}
+
+unsigned short FindIPHash( unsigned long ip ) {
+ unsigned short hashval;
+ unsigned long *ipt;
+
+ hashval = (unsigned short)(((ip&0xFFFF0000)>>16) ^ (ip&0x0000FFFF));
+ ipt=iph + hashval;
+ while (*ipt != 0 && (*ipt!=ip)) { ipt++; hashval++; }
+ if (*ipt==0) *ipt=ip;
+ return hashval;
+}
+
+unsigned short SetIPAcc( unsigned long src, unsigned long dst, unsigned long byte, unsigned short typ, unsigned short sport, unsigned short dport) {
+ unsigned short from,to,hash;
+ ta *tai;
+ hash=0;
+ if (src) {
+
+ if (fromip) from=FindIPHash(src); else from=-1;
+ if (toip) to=FindIPHash(dst); else to=-1;
+ hash=from^to;
+ tai=acc + hash;
+ while ( ((tai->from!=from) && (tai->to!=to)) && ((tai->from!=0) && (tai->to!=0)) ) {tai++; hash++; }
+ if ((tai->from==0)&&(tai->to==0)) {
+ tai->byte=byte; tai->from=from; tai->to=to; tai->pkt=1;
+ } else { tai->byte+=byte; tai->pkt++; }
+
+ typp[typ]++;
+ typb[typ]+=byte;
+ if ((sport>0) && (sport<MAXTCPPORT)) { tcppp[sport]++; tcppb[sport]+=byte; }
+ if ((dport>0) && (dport<MAXTCPPORT)) { tcppp[dport]++; tcppb[dport]+=byte; }
+ }
+ return hash;
+}
+
+//
+// Function: DecodeIPHeader
+//
+// Description:
+// This function takes a pointer to an IP header and prints
+// it out in a readable form.
+//
+int DecodeIPHeader(WSABUF *wsabuf, unsigned int srcip, unsigned short srcport, unsigned long srcnet,
+ unsigned int destip, unsigned short destport, unsigned long destnet, DWORD bytesret,
+ unsigned short xport,unsigned int xip, unsigned long xnet)
+{
+ BYTE *hdr = (BYTE *)wsabuf->buf,
+ *nexthdr = NULL,
+ *ohdr;
+ unsigned short shortval;
+ SOCKADDR_IN srcaddr,
+ destaddr;
+
+ unsigned short ip_version,
+ ip_hdr_len,
+ ip_tos,
+ ip_total_len,
+ ip_id,
+ ip_flags,
+ ip_ttl,
+ ip_frag_offset,
+ ip_proto,
+ ip_hdr_chksum,
+ ip_src_port,
+ ip_dest_port;
+ unsigned int ip_src,
+ ip_dest;
+ BOOL bPrint = FALSE;
+ char ip_prtype=0;
+ int j;
+ time_t tt;
+ struct tm *tmm;
+
+ ohdr=hdr;
+ if (iLnxplus) ip_prtype=*(hdr+iLnxplus-1);
+ if (ip_prtype) return 0;
+ hdr += iLnxplus;
+ ip_version = HI_WORD(*hdr);
+ ip_hdr_len = LO_WORD(*hdr) * 4;
+ nexthdr = (BYTE *)((BYTE *)hdr + ip_hdr_len);
+ hdr++;
+
+ ip_tos = *hdr;
+ hdr++;
+
+ memcpy(&shortval, hdr, 2);
+ ip_total_len = ntohs(shortval);
+ hdr += 2;
+
+ memcpy(&shortval, hdr, 2);
+ ip_id = ntohs(shortval);
+ hdr += 2;
+
+ ip_flags = ((*hdr) >> 5);
+
+ memcpy(&shortval, hdr, 2);
+ ip_frag_offset = ((ntohs(shortval)) & 0x1FFF);
+ hdr += 2;
+
+ ip_ttl = *hdr;
+ hdr++;
+
+ ip_proto = *hdr;
+ hdr++;
+
+ memcpy(&shortval, hdr, 2);
+ ip_hdr_chksum = ntohs(shortval);
+ hdr += 2;
+
+ memcpy(&srcaddr.sin_addr.s_addr, hdr, 4);
+ ip_src = ntohl(srcaddr.sin_addr.s_addr);
+ hdr += 4;
+
+ memcpy(&destaddr.sin_addr.s_addr, hdr, 4);
+ ip_dest = ntohl(destaddr.sin_addr.s_addr);
+ hdr += 4;
+ //
+ // If packet is UDP, TCP, or IGMP read ahead and
+ // get the port values.
+ //
+ ip_src_port=ip_dest_port=0;
+ if (((ip_proto == 2) ||
+ (ip_proto == 6) ||
+ (ip_proto == 17)) ) //&& bFilter)
+ {
+ memcpy(&ip_src_port, nexthdr, 2);
+ ip_src_port = ntohs(ip_src_port);
+ memcpy(&ip_dest_port, nexthdr+2, 2);
+ ip_dest_port = ntohs(ip_dest_port);
+
+ };
+ bPrint = 0;
+// xaok= (xip!=0) && (((xip&xnet)==(ip_src&xnet))||((xip&xnet)==(ip_dest&xnet)));
+// saok= ((srcip==0)||((srcip&srcnet)==(ip_src&srcnet)));
+// daok = ((destip==0)||((destip&destnet)==(ip_dest&destnet)));
+// xpok=(xport!=0) && ((xport==ip_src_port)||(xport==ip_dest_port));
+// spok=((srcport==0)||(srcport == ip_src_port));
+// dpok=((destport==0)||(destport == ip_dest_port));
+//printf("\nf:%d xa:%d sa:%d da:%d xp:%d sp:%d dp:%d",bFilter,xaok,saok,daok,xpok,spok,dpok);
+// if (!bFilter || ( (xaok||(saok&&daok)) && (xpok||(spok&&dpok)))) {
+if ((!bFilter) || ((ip_proto==47)&&gre) ||
+ (
+ ((iProto==0)||(ip_proto==iProto)) &&
+ (
+ ((xip!=0) && (((xip&xnet)==(ip_src&xnet))||((xip&xnet)==(ip_dest&xnet)))
+ ) || (
+ ((srcip==0) || ((srcip&srcnet)==(ip_src&srcnet))) && ((destip==0)||((destip&destnet)==(ip_dest&destnet)))
+ )
+ )
+ &&
+ (
+ ((xport!=0) && ((xport==ip_src_port)||(xport==ip_dest_port))
+ ) || (
+ ((srcport==0)||(srcport == ip_src_port))&&((destport==0)||(destport == ip_dest_port))
+ )
+ )
+ )
+ ) {
+ if (! iDetail) {
+ if ((ip_proto==47)&&gre) {
+ *mypbuff=0;
+ DecodeGREHeader(wsabuf, ip_hdr_len, bytesret,
+ srcip,srcport,srcnet,destip,destport,destnet,xport,xip,xnet);
+// SetIPAcc(0,0,0,0,0,0);
+ return ip_hdr_len;
+ }
+ SetIPAcc(ip_src,ip_dest,ip_total_len,ip_proto,ip_src_port,ip_dest_port);
+ }
+ else bPrint=TRUE;
+// printf("%d %ld %ld %ld %ld",ip_proto,xip,xip&xnet,ip_src&xnet,ip_dest&xnet);
+ } else {
+ if (! iDetail) SetIPAcc(0,0,0,0,0,0);
+// else bPrint=TRUE;
+ }
+ time(&tt);
+ if ((!iSum && ( tt-elapsed > iCycle)) || !iRun || mostird) {
+ mostird=0;
+ if (! iDetail) CloseIPAcc(tt-elapsed-1);
+ else {
+ time(&elapsed);
+ if (f) fclose(f);
+ if (iFile) f=fopen(filename,"a");
+ }
+ }
+ if (lNum) { if (--lNum <= 0) iRun=0; }
+
+ //
+ *pbuf=0;
+ if (bPrint) {
+ tmm=localtime(&tt);
+if (! nomac ) {
+ strcpy(pbuf,mypbuff);
+} else {
+ sprintf(str,"\n%4.4d.%2.2d.%2.2d %2.2d:%2.2d:%2.2d ",
+ tmm->tm_year+1900,tmm->tm_mon+1,tmm->tm_mday,tmm->tm_hour,tmm->tm_min,tmm->tm_sec);
+ strcat(pbuf,str);
+#ifdef LINUX
+ sprintf(str,"%x:%x:%x:%x:%x:%x > %x:%x:%x:%x:%x:%x",*ohdr,*(ohdr+1),*(ohdr+2),*(ohdr+3),*(ohdr+4),*(ohdr+5),
+ *(ohdr+6),*(ohdr+7),*(ohdr+8),*(ohdr+9),*(ohdr+10),*(ohdr+11));
+ strcat(pbuf,str);
+#endif
+}
+ sprintf(str," %d bytes\n%-15s>", ip_total_len, inet_ntoa(srcaddr.sin_addr));
+ strcat(pbuf,str);
+ sprintf(str,"%-15s", inet_ntoa(destaddr.sin_addr));
+ strcat(pbuf,str);
+ sprintf(str," TTL:%-3d Proto:%-6s F:%d/%d TOS:%X%X\n",
+ ip_ttl, szProto[ip_proto],ip_flags,ip_frag_offset,HI_WORD(ip_tos), LO_WORD(ip_tos));
+ strcat(pbuf,str);
+ if (iFile) strcat(pbuf,".");
+ strcpy(mypbuff,pbuf);
+
+ }
+ else return ip_hdr_len;
+
+ if (justheader) { if (*pbuf) fprintf(iFile?f:stdout,"%s",pbuf); return ip_hdr_len; }
+ if (iDetail) {
+ switch (ip_proto) {
+ case 1: // ICMP
+ j=DecodeICMPHeader(wsabuf, ip_hdr_len);
+ break;
+ case 2: // IGMP
+ j=DecodeIGMPHeader(wsabuf, ip_hdr_len);
+ break;
+ case 6: // TCP
+ j=DecodeTCPHeader(wsabuf, ip_hdr_len);
+ break;
+ case 17: // UDP
+ j=DecodeUDPHeader(wsabuf, ip_hdr_len);
+ break;
+ case 47: // UDP
+ j=DecodeGREHeader(wsabuf, ip_hdr_len, bytesret,
+ srcip,srcport,srcnet,destip,destport,destnet,xport,xip,xnet);
+ break;
+ default:
+ j=0; hdr=(BYTE *)wsabuf->buf;
+ sprintf(str," No decoder installed for protocol\n");
+ strcat(pbuf,str);
+ break;
+ }
+ if (j>=0) PrintRawBytes(hdr+j,bytesret-j-ip_hdr_len-12); //(hdr-(BYTE *)(wsabuf->buf + iLnxplus)));
+ }
+ else if (*pbuf) fprintf(iFile?f:stdout,"%s",pbuf);
+
+ return ip_hdr_len;
+}
diff --git a/package/pipacs/src/parser.h b/package/pipacs/src/parser.h
new file mode 100644
index 000000000..aac609acb
--- /dev/null
+++ b/package/pipacs/src/parser.h
@@ -0,0 +1,60 @@
+#define LINUX 1
+#ifdef LINUX
+#include <ctype.h>
+#include <string.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include <net/if.h>
+#define BYTE unsigned char
+#define DWORD unsigned long
+#define BOOL char
+#define TRUE 1
+#define FALSE 0
+#define WSADATA int
+#define SOCKET int
+#define SOCKADDR struct sockaddr
+#define SOCKADDR_IN struct sockaddr_in
+typedef struct _WSABUF {
+ unsigned long len;
+ unsigned char *buf;
+} WSABUF;
+#define SIO_RCVALL 0
+#define SIO_RCVALL_IGMPMCAST 0
+#define SIO_RCVALL_MCAST 0
+#define ETH_P_ALL 0x0003
+#else // WINDOWS
+
+#include <winsock2.h>
+#include <windows.h>
+
+#endif
+
+#ifndef _RCVALL_H_
+#define _RCVALL_H_
+
+
+#define MAX_IP_SIZE 65535
+#define MIN_IP_HDR_SIZE 20
+
+#define HI_WORD(byte) (((byte) >> 4) & 0x0F)
+#define LO_WORD(byte) ((byte) & 0x0F)
+
+extern char *szProto[];
+
+
+
+void PrintRawBytes (BYTE *ptr, DWORD len);
+int DecodeIGMPHeader(WSABUF *wsabuf, DWORD iphdrlen);
+int DecodeUDPHeader (WSABUF *wsabuf, DWORD iphdrlen);
+int DecodeTCPHeader (WSABUF *wsabuf, DWORD iphdrlenz);
+int DecodeIPHeader (WSABUF *wasbuf, unsigned int srcaddr, unsigned short srcport, unsigned long srcnet,
+ unsigned int destaddr, unsigned short destport, unsigned long destnet, DWORD bytesret,
+ unsigned short xport, unsigned int xip, unsigned long xnet);
+
+#endif
diff --git a/package/pipacs/src/pipacs.c b/package/pipacs/src/pipacs.c
new file mode 100644
index 000000000..4087cd329
--- /dev/null
+++ b/package/pipacs/src/pipacs.c
@@ -0,0 +1,589 @@
+// http://www.phj.hu/freesoft.asp
+#include <stdio.h>
+#include <stdlib.h>
+#include "parser.h"
+
+#ifndef LINUX
+#include <mstcpip.h>
+#include <ws2tcpip.h>
+#else
+#include <termios.h>
+struct promisc_device
+{
+ char name[16]; /* name (e.g. eth0) */
+
+ int reset; /* do we have to reset it on exit ? */
+ struct ifreq oldifr; /* old settings */
+
+ struct promisc_device *next;
+};
+
+#endif
+
+DWORD dwIoControlCode=SIO_RCVALL;
+DWORD dwProtocol=IPPROTO_IP, dwInterface=0;
+
+#define MAXVER 2
+#define MINVER 6
+SOCKET s;
+
+//
+// Filters (Globals)
+//
+unsigned int uiSourceAddr=0, uiDestAddr=0, uiXAddr=0;
+unsigned short usSourcePort = 0, usDestPort = 0, usXPort = 0;
+unsigned short usSourceNet = 32, usDestNet = 32, usXNet = 32;
+unsigned long ulDestNet=0xffffffff, ulSourceNet=0xffffffff, ulXNet=0xffffffff;
+BOOL bFilter=FALSE;
+int iline=25;
+char myipname[64];
+char pattern[1024];
+int justheader=0;
+int gre=0;
+int sortbysize,fromip,toip;
+int skipvlan=0;
+
+extern char filename[128];
+
+extern char intlist[128];
+
+#ifndef LINUX
+void PrintInterfaceList( void );
+int GetInterface(SOCKET , SOCKADDR_IN *, int );
+#endif
+extern int InitIPAcc( void );
+extern int CloseIPAcc( void );
+extern int iCycle;
+extern int iScreen;
+extern int iFile;
+extern int iDetail;
+extern int iRun;
+extern long lNum;
+extern FILE *f;
+extern int iProto;
+extern int iSum;
+extern char execname[];
+extern int mostird;
+extern int iLnxplus;
+
+int set_raw_mode(void)
+{
+ int fd = STDIN_FILENO;
+ struct termios t;
+
+ if (tcgetattr(fd, &t) < 0) { perror("tcgetattr"); return -1; }
+ t.c_lflag &= ~ICANON;
+ if (tcsetattr(fd, TCSANOW, &t) < 0) { perror("tcsetattr"); return -1; }
+ setbuf(stdin, NULL);
+ return 0;
+}//
+// Function: usage
+//
+// Description:
+// Prints usage information.
+//
+char *author = "phj";
+
+void usage(char *progname)
+{
+ printf(" usage: %s options\n where options:\n", progname);
+ printf(" [-c:sec] Dump cycle in sec (10)\n");
+ printf(" [-f:file[-e:program]] Results into a file [and exec program](-)\n");
+ printf(" [-n:db] Execute just db cycle (0)\n");
+ printf(" [-l:lineno] Print lineno lines of hosts(25)\n");
+ printf(" [-k] Sort result by packet count (size)\n");
+ printf(" [-1] Ignore source IP (don't ignore)\n");
+ printf(" [-2] Ignore destination IP (don't ignore)\n");
+ printf(" [-h] Print just the header(use -a!)\n");
+ printf(" [-a] Print packet info&data (-)\n");
+ printf(" [-p] Print just summary info (-)\n");
+ printf(" Otherwise print sum&ip pairs\n");
+//#ifndef LINUX
+ printf(" [-t:[tcp|udp|icmp|....|number]] Filter on IP protocoll (ALL)\n");
+//#endif
+ printf(" [-g] Make GRE encapsulation trasparent (-)\n");
+ printf(" [-v] Skip VLAN headers (-)\n");
+ printf(" [-sa:IP[/Net]] Filter on source address (-)/net\n");
+ printf(" [-sp:Port] Filter on source port (-)\n");
+ printf(" [-da:IP[/Net]] Filter on dest address/net (-)\n");
+ printf(" [-dp:Port] Filter on dest port(-)\n");
+ printf(" [-xa:IP[/Net]] Filter on src|dest address/net (-)\n");
+ printf(" [-xp:Port] Filter on src|dest port (-)\n");
+ printf(" [-pa:pattern] String match (0), last param!!!\n");
+#ifndef LINUX
+ printf(" [-i:int] Capture on this interface (0)\n");
+ printf(" Available interfaces:\n");
+ PrintInterfaceList();
+#else
+ printf(" [-i:int[,int]] Capture on this interface (eth0)\n");
+#endif
+ printf(" Filtering rules: t && (sa|da|xa) && (sp|dp|xp)");
+ printf("\nVer. %d.%d (c):2000-2006, P l¢czi-Horv th J nos\n",MAXVER,MINVER);
+#ifndef LINUX
+ WSACleanup();
+ ExitProcess(-1);
+#else
+ exit(5);
+#endif
+}
+
+//
+// Function: ValidateArgs
+//
+// Description:
+// This function parses the command line arguments and
+// sets global variables to indicate how the app should act.
+//
+void ValidateArgs(int argc, char **argv)
+{
+ int i,j;
+ char *ptr;
+
+ sortbysize=1; fromip=1; toip=1;
+
+ if (argc <2) { usage(argv[0]); return; }
+ if (*(author+2) != 'j') { usage(argv[0]); return; }
+ for(i=1; i < argc ;i++) {
+ if ((argv[i][0] == '-') || (argv[i][0] == '/')) {
+ switch (tolower(argv[i][1])) {
+ case 't': // traffic type
+ ptr = &argv[i][2];
+ while (*++ptr) *ptr = toupper(*ptr);
+ ptr = &argv[i][3];
+ for ( j=0;j<134;j++) {
+ if (!strcmp(ptr, szProto[j])) {
+// dwIoControlCode = SIO_RCVALL;
+#ifdef LINUX
+ dwProtocol = j;
+#endif
+ iProto=j;
+ break;
+ }
+ }
+ if ((j>133) && atoi(&argv[i][3])) {
+// dwIoControlCode = SIO_RCVALL;
+#ifdef LINUX
+ dwProtocol = atoi(&argv[i][3]);
+#endif
+ iProto=atoi(&argv[i][3]);
+ } else if (j>133) usage(argv[0]);
+ break;
+ case 'i': // interface number
+#ifndef LINUX
+ dwInterface = atoi(&argv[i][3]);
+#else
+ strcpy(intlist,&argv[i][3]);
+ ptr=strchr(intlist,' ');
+ if (ptr) *ptr=0;
+#endif
+ break;
+ case 'g': // gre
+ gre=1;
+ break;
+ case 'c': // cycle time
+ iCycle = atoi(&argv[i][3]);
+ break;
+ case 'a': // cycle time
+ iDetail = 1;
+ break;
+ case 'h': // cycle time
+ iDetail = justheader = 1;
+ break;
+ case 'n': // just n cycle
+ lNum = atol(&argv[i][3]);
+ break;
+ case 'l': // lineno lines
+ iline = atoi(&argv[i][3]);
+ break;
+ case 'p': // just summary
+ if ((tolower(argv[i][2]) == 'a')) {
+ strcpy(pattern,&argv[i][4]); printf("\n Pattern: \'%s",&argv[i][4]);
+ while (++i<argc) { strcat(pattern," "); strcat(pattern,&argv[i][0]); printf(" %s",argv[i]); }
+ printf("\'\n");
+ } else iSum=1;
+ break;
+ case 'f': // filename to write
+ strcpy(filename,&argv[i][3]);
+ iFile=1; //iScreen=0;
+ break;
+ case 'e': // execname
+ strcpy(execname,&argv[i][3]);
+ break;
+ case 'k': // sor by count
+ sortbysize = 0;
+ break;
+ case '1': // ignore src
+ fromip = 0;
+ break;
+ case '2': // ignore dst
+ toip = 0;
+ break;
+ case 'v': // sor by count
+ skipvlan = 4;
+ if ((tolower(argv[i][2]) == ':')) {
+ skipvlan=atoi(&argv[i][3]);
+ }
+ break;
+ case 's': // Filter on source ip or port
+ if (tolower(argv[i][2]) == 'a') {
+ ptr=strchr(&argv[i][4],'/');
+ if (ptr) { usSourceNet=atoi(ptr+1); *ptr=0;}
+ uiSourceAddr = ntohl(inet_addr(&argv[i][4]));
+ } else if (tolower(argv[i][2]) == 'p')
+ usSourcePort = (unsigned short)atoi(&argv[i][4]);
+ else
+ usage(argv[0]);
+ bFilter = TRUE;
+ break;
+ case 'd': // Filter on dest ip or port
+ if (tolower(argv[i][2]) == 'a') {
+ ptr=strchr(&argv[i][4],'/');
+ if (ptr) { usDestNet=atoi(ptr+1); *ptr=0; }
+ uiDestAddr = ntohl(inet_addr(&argv[i][4]));
+ } else if (tolower(argv[i][2]) == 'p')
+ usDestPort = (unsigned short)atoi(&argv[i][4]);
+ else
+ usage(argv[0]);
+ bFilter = TRUE;
+ break;
+ case 'x': // Filter on source or dest ip or port
+ if (tolower(argv[i][2]) == 'a') {
+ ptr=strchr(&argv[i][4],'/');
+ if (ptr) { usXNet=atoi(ptr+1); *ptr=0; }
+ uiXAddr = ntohl(inet_addr(&argv[i][4]));
+ } else if (tolower(argv[i][2]) == 'p')
+ usXPort = (unsigned short)atoi(&argv[i][4]);
+ else
+ usage(argv[0]);
+ bFilter = TRUE;
+ break;
+ default:
+ usage(argv[0]);
+ }
+ } else usage(argv[0]);
+ }
+ iLnxplus+=skipvlan;
+ return;
+}
+
+#ifndef LINUX
+//
+// Function: PrintInterfaceList
+//
+// Description:
+// This function prints all local IP interfaces.
+//
+void PrintInterfaceList()
+{
+ SOCKET_ADDRESS_LIST *slist=NULL;
+ SOCKET s;
+ char buf[2048];
+ DWORD dwBytesRet;
+ int ret,
+ i;
+
+ s = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
+ if (s == SOCKET_ERROR) {
+ printf("socket() failed: %d\n", WSAGetLastError());
+ return;
+ }
+ ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buf, 2048,&dwBytesRet, NULL, NULL);
+ if (ret == SOCKET_ERROR){
+ printf("WSAIoctl(SIO_ADDRESS_LIST_QUERY) failed: %d\n",WSAGetLastError());
+ return;
+ }
+ slist = (SOCKET_ADDRESS_LIST *)buf;
+ for(i=0; i < slist->iAddressCount ;i++) {
+ printf(" %-2d ........ [%s]\n", i,
+ inet_ntoa(((SOCKADDR_IN *)slist->Address[i].lpSockaddr)->sin_addr));
+ }
+ closesocket(s);
+ return;
+}
+
+//
+// Function: GetInterface
+//
+// Description:
+// This function retrieves a zero based index and returns
+// the IP interface corresponding to that.
+//
+int GetInterface(SOCKET s, SOCKADDR_IN *ifx, int num)
+{
+ SOCKET_ADDRESS_LIST *slist=NULL;
+ char buf[2048];
+ DWORD dwBytesRet;
+ int ret;
+
+ ret = WSAIoctl(s, SIO_ADDRESS_LIST_QUERY, NULL, 0, buf, 2048,&dwBytesRet, NULL, NULL);
+ if (ret == SOCKET_ERROR) {
+ printf("WSAIoctl(SIO_ADDRESS_LIST_QUERY) failed: %d\n",WSAGetLastError());
+ return -1;
+ }
+ slist = (SOCKET_ADDRESS_LIST *)buf;
+ if (num >= slist->iAddressCount) return -1;
+ ifx->sin_addr.s_addr = ((SOCKADDR_IN *)slist->Address[num].lpSockaddr)->sin_addr.s_addr;
+ if (*author != 'p') return -1;
+ return 0;
+}
+#endif
+#ifdef LINUX
+struct promisc_device *prom;
+
+void init_capture( void )
+/*
+ * 1) Open our capture socket
+ * 2) Set all the promisc devices to promiscous mode
+ */
+{
+ struct ifreq ifr;
+ struct promisc_device *p,*pp;
+ struct protoent *pr;
+ char *p1,*p2;
+
+ if ((s = socket (AF_INET, SOCK_PACKET, htons (ETH_P_ALL))) < 0)
+ {
+ printf(" can't get socket: \n");
+ exit(1);
+ }
+ strcpy(myipname,intlist);
+ p1=intlist; p=NULL;
+ while (p1) {
+ pp=p;
+ p = malloc(sizeof(struct promisc_device));
+ if (pp) pp->next=p; else prom=p;
+ if ( (p2=strchr(p1,','))) *p2++=0;
+ strcpy(&p->name,p1); p->next=NULL;
+ printf(" %s",p->name); fflush(stdout);
+ p1=p2;
+// while(p!=NULL) {
+ strcpy (p -> oldifr.ifr_name, p -> name);
+
+ if (ioctl (s, SIOCGIFFLAGS, &(p -> oldifr)) < 0) {
+ printf(" can't get flags: \n");
+ exit(2);
+ }
+ p -> reset = 1;
+ ifr = p -> oldifr;
+ if (ifr.ifr_flags & IFF_PROMISC) printf(" already promisc! \n");
+ ifr.ifr_flags |= IFF_PROMISC;
+ if (ioctl (s, SIOCSIFFLAGS, &ifr) < 0) {
+ printf(" can't set flags: \n");
+ exit(3);
+ }
+// p = p -> next;
+ }
+}
+
+void exit_capture(void)
+{
+ struct promisc_device *p;
+
+ /* do we have to check (capture_sd >= 0) ? */
+
+ p = prom;
+
+ while(p != NULL) {
+ if (ioctl (s, SIOCSIFFLAGS, &(p -> oldifr)) < 0) {
+ printf("can't reset flags: \n");
+ }
+
+ p = p -> next;
+ }
+
+ close (s);
+}
+#endif
+//
+// Function: main
+//
+int main(int argc, char **argv) {
+ WSADATA wsd;
+ SOCKADDR_IN if0;
+ int ret,count;
+ unsigned int optval;
+ DWORD dwBytesRet,
+ dwFlags,
+ nproc;
+ char rcvbuf[MAX_IP_SIZE];
+ WSABUF wbuf;
+ unsigned long i;
+#ifndef LINUX
+ // Load Winsock
+ //
+ if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) {
+ printf(" WSAStartup() failed: %d\n", GetLastError());
+ return -1;
+ }
+#else
+ SOCKADDR ssaddr;
+ struct promisc_device *p;
+ fd_set ready;
+ struct timeval tv;
+#endif
+ char Key;
+ int status;
+ FILE *input;
+// Parse the command line
+//
+ strcpy(intlist,"eth0");
+ for(i=100;i<255;i++) szProto[i]="?!?";
+ szProto[103]="PIM";
+ szProto[108]="IPCOMP";
+ szProto[112]="VRRP";
+ szProto[115]="L2TP";
+ szProto[124]="ISIS";
+ szProto[132]="SCTP";
+ szProto[133]="FC";
+ *execname=0;
+ ValidateArgs(argc, argv);
+ if (bFilter) {
+ i=uiSourceAddr;
+ if ( i || usSourcePort)
+ printf(" Source: %03d.%03d.%03d.%03d/%d:%d\n",(i&0xff000000)>>24,(i&0x00ff0000)>>16,(i&0x0000ff00)>>8,i&0xff,uiSourceAddr?usSourceNet:0, usSourcePort);
+ i=uiDestAddr;
+ if ( i || usDestPort)
+ printf(" Dest. : %03d.%03d.%03d.%03d/%d:%d\n",(i&0xff000000)>>24,(i&0x00ff0000)>>16,(i&0x0000ff00)>>8,i&0xff,uiDestAddr?usDestNet:0, usDestPort);
+ i=uiXAddr;
+ if ( i || usXPort)
+ printf(" IP. : %03d.%03d.%03d.%03d/%d:%d\n",(i&0xff000000)>>24,(i&0x00ff0000)>>16,(i&0x0000ff00)>>8,i&0xff,uiXAddr?usXNet:0, usXPort);
+ }
+ if (iFile) printf(" To file : %s\n",filename);
+ if (iProto) printf(" Protocol: %s (%d)\n",szProto[iProto],iProto);
+ // Create a raw socket for receiving IP datagrams
+ //
+#ifndef LINUX
+ s = WSASocket(AF_INET, SOCK_RAW, dwProtocol, NULL, 0, WSA_FLAG_OVERLAPPED);
+ if (s == INVALID_SOCKET)
+ {
+ printf("WSASocket() failed: %d\n", WSAGetLastError());
+ return -1;
+ }
+ // Get an interface to read IP packets on
+ //
+ memset(&if0,0,sizeof(if0));
+ if0.sin_family = AF_INET;
+ if0.sin_port = htons(0);
+ if (GetInterface(s, &if0, dwInterface) != 0)
+ {
+ printf("Unable to obtain an interface\n");
+ return -1;
+ }
+ sprintf(myipname,"%-16s",inet_ntoa(if0.sin_addr));
+#else
+ printf("starting capture ...."); fflush(stdout);
+ init_capture();
+ printf(" capture started ....\n"); fflush(stdout);
+#endif
+ printf(" Binding to IF: %s\n", myipname);
+#ifndef LINUX
+//
+// This socket MUST be bound before calling the ioctl
+//
+
+ if (bind(s, (SOCKADDR *)&if0, sizeof(if0)) == SOCKET_ERROR) {
+ printf("bind() failed: %d\n", WSAGetLastError());
+ return -1;
+ }
+//
+// Set the SIO_RCVALLxxx ioctl
+//
+ optval = 1;
+ if (WSAIoctl(s, dwIoControlCode, &optval, sizeof(optval),
+ NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR) {
+ printf("WSAIotcl() set raw socket failed; %d\n", WSAGetLastError());
+// return -1;
+ optval = 2;
+ if (WSAIoctl(s, dwIoControlCode, &optval, sizeof(optval),
+ NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR) {
+ printf("WSAIotcl() set raw socket only failed; %d\n", WSAGetLastError());
+ return -1;
+ }
+ }
+ system("cls");
+#else
+ tv.tv_sec=0; tv.tv_usec=0;
+ set_raw_mode();
+ FD_ZERO(&ready);
+ FD_SET(STDIN_FILENO,&ready);
+#endif
+ input = fopen("/dev/tty", "r"); //open the terminal keyboard
+ if (uiSourceAddr==0) ulSourceNet=0;
+ else for ( i=0; i<32-usSourceNet; i++) ulSourceNet <<= 1;
+ if (uiDestAddr==0) ulDestNet=0;
+ else for ( i=0; i<32-usDestNet; i++) ulDestNet <<= 1;
+ if (uiXAddr==0) ulXNet=0;
+ else for ( i=0; i<32-usXNet; i++) ulXNet <<= 1;
+ if (uiXAddr) uiSourceAddr=uiDestAddr=uiXAddr;
+ if (usXPort) usSourcePort=usDestPort=usXPort;
+ if (ulXNet) ulSourceNet=ulDestNet=ulXNet;
+ InitIPAcc();
+// Start receiving IP datagrams until interrupted
+//
+ count = 0;
+ if (iFile && iDetail) f=fopen(filename,"w+");
+ if (iProto) bFilter=1;
+ if (*(author+1) != 'h') iRun=0;
+ while (iRun) {
+ rcvbuf[MAX_IP_SIZE]=0;
+ wbuf.len = MAX_IP_SIZE;
+ wbuf.buf = rcvbuf;
+#ifndef LINUX
+ dwFlags = 0;
+ ret = WSARecv(s, &wbuf, 1, &dwBytesRet, &dwFlags, NULL, NULL);
+ if (ret == SOCKET_ERROR) {
+ printf("WSARecv() failed: %d\n", WSAGetLastError());
+ return -1;
+ }
+ if (kbhit()) {
+#else
+ dwFlags = sizeof(ssaddr);
+
+ ret = recvfrom (s, wbuf.buf, MAX_IP_SIZE, 0, &ssaddr, (int *) &dwFlags);
+ if (ret == -1) continue;
+ dwBytesRet=wbuf.len=ret;
+ p=prom;
+ while(p!=NULL) {
+ if (!strcmp(p -> name, ssaddr.sa_data)) break;
+ p=p->next;
+ }
+ if (!p) {
+// printf("\n%s: ignored",ssaddr.sa_data); fflush(stdout);
+ continue;
+ }
+ FD_ZERO(&ready);
+ FD_SET(STDIN_FILENO,&ready);
+ if (select(STDIN_FILENO+1,&ready,NULL,NULL,&tv)>0) {
+// if (FD_ISSET(STDIN_FILENO,&ready)) {
+#endif
+ switch (getchar()) { /* branch to appropiate key handler */
+ case 0x1b: /* Esc */
+ iRun=0;
+ break;
+ default:
+ mostird=1;
+ break;
+ } //end of switch key
+ }
+
+// Deccode the IP header
+//
+ if (!(nproc = DecodeIPHeader(&wbuf, uiSourceAddr, usSourcePort, ulSourceNet,
+ uiDestAddr, usDestPort, ulDestNet, dwBytesRet,usXPort,uiXAddr,ulXNet)))
+ {
+// printf("Error decoding IP header!\n");
+// break;
+ }
+ }
+ // Cleanup
+ //
+ if (iRun && !iDetail) CloseIPAcc();
+ if (f) fclose(f);
+#ifndef LINUX
+ closesocket(s);
+ WSACleanup();
+#else
+ exit_capture();
+#endif
+ return 0;
+}
diff --git a/package/pixman/Config.in b/package/pixman/Config.in
new file mode 100644
index 000000000..62967ef3e
--- /dev/null
+++ b/package/pixman/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_PIXMAN
+ prompt "pixman.............................. pixman library"
+ tristate
+ default n
+ help
+ http://www.cairographics.org/
diff --git a/package/pixman/Makefile b/package/pixman/Makefile
new file mode 100644
index 000000000..a7d2baec6
--- /dev/null
+++ b/package/pixman/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= pixman
+PKG_VERSION:= 0.13.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 837df4a02c61a60a880644393b57faed
+MASTER_SITES:= http://www.cairographics.org/releases/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,PIXMAN,pixman,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_PIXMAN}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpixman-1.so* ${IDIR_PIXMAN}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pixman/ipkg/pixman.control b/package/pixman/ipkg/pixman.control
new file mode 100644
index 000000000..e036752c3
--- /dev/null
+++ b/package/pixman/ipkg/pixman.control
@@ -0,0 +1,4 @@
+Package: pixman
+Priority: optional
+Section: x11
+Description: pixman library
diff --git a/package/pmacct/Config.in b/package/pmacct/Config.in
new file mode 100644
index 000000000..9a4e1f6d0
--- /dev/null
+++ b/package/pmacct/Config.in
@@ -0,0 +1,200 @@
+config ADK_COMPILE_PMACCT
+ tristate
+ default n
+ depends ADK_COMPILE_PMACCT_BASIC || ADK_COMPILE_PMACCT_MYSQL || ADK_COMPILE_PMACCT_PGSQL || ADK_COMPILE_PMACCT_SQLITE || ADK_COMPILE_PMACCT_CUSTOM || ADK_PACKAGE_PMACCT_CLIENT
+
+config ADK_COMPILE_PMACCT_BASIC
+ tristate
+ default n
+ depends ADK_PACKAGE_NFACCTD_BASIC || ADK_PACKAGE_PMACCTD_BASIC
+ select ADK_COMPILE_PMACCT
+
+config ADK_COMPILE_PMACCT_MYSQL
+ tristate
+ default n
+ depends ADK_PACKAGE_NFACCTD_MYSQL || ADK_PACKAGE_PMACCTD_MYSQL
+ select ADK_COMPILE_PMACCT
+
+config ADK_COMPILE_PMACCT_PGSQL
+ tristate
+ default n
+ depends ADK_PACKAGE_NFACCTD_PGSQL || ADK_PACKAGE_PMACCTD_PGSQL
+ select ADK_COMPILE_PMACCT
+
+config ADK_COMPILE_PMACCT_SQLITE
+ tristate
+ default n
+ depends ADK_PACKAGE_NFACCTD_SQLITE || ADK_PACKAGE_PMACCTD_SQLITE
+ select ADK_COMPILE_PMACCT
+
+config ADK_COMPILE_PMACCT_CUSTOM
+ tristate
+ default n
+ depends ADK_PACKAGE_NFACCTD_CUSTOM || ADK_PACKAGE_PMACCTD_CUSTOM
+ select ADK_COMPILE_PMACCT
+
+config ADK_SHOW_PMACCT
+ bool "pmacct/nfacct..................... IPv4/IPv6 accounting and aggregation tools"
+
+config ADK_SHOW_NFACCTD
+ prompt "nfacctd......................... NetFlow accounting daemon"
+ bool
+ default n
+ depends ADK_SHOW_PMACCT
+ help
+
+ An IPv4/IPv6 Netflow accounting and aggregation daemon
+
+ http://www.ba.cnr.it/~paolo/pmacct/
+
+ Depends:
+ - libmysqlclient (for MySQL database logging support)
+ - libpq (for PostgreSQL database logging support)
+ - libsqlite (for SQLite database logging support)
+
+
+config ADK_PACKAGE_NFACCTD_BASIC
+ prompt "nfacctd....................... built without database support"
+ tristate
+ select ADK_COMPILE_PMACCT_BASIC
+ select ADK_PACKAGE_LIBPCAP
+ depends ADK_SHOW_NFACCTD
+
+config ADK_PACKAGE_NFACCTD_MYSQL
+ prompt "nfacctd-mysql................. built with MySQL database support"
+ tristate
+ select ADK_COMPILE_PMACCT_MYSQL
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+ depends ADK_SHOW_NFACCTD
+
+config ADK_PACKAGE_NFACCTD_PGSQL
+ prompt "nfacctd-pgsql................. built with PostgreSQL database support"
+ tristate
+ select ADK_COMPILE_PMACCT_PGSQL
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBPQ
+ depends ADK_SHOW_NFACCTD
+
+config ADK_PACKAGE_NFACCTD_SQLITE
+ prompt "nfacctd-sqlite................ built with SQLite database support"
+ tristate
+ select ADK_COMPILE_PMACCT_SQLITE
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBSQLITE
+ depends ADK_SHOW_NFACCTD
+
+config ADK_PACKAGE_NFACCTD_CUSTOM
+ prompt "nfacctd-custom................ customized to your needs"
+ tristate
+ select ADK_COMPILE_PMACCT_CUSTOM
+ select ADK_PACKAGE_LIBPCAP
+ depends ADK_SHOW_NFACCTD
+
+config ADK_COMPILE_NFACCTD_WITH_MYSQL
+ prompt "MySQL database support"
+ bool
+ default n
+ depends ADK_PACKAGE_NFACCTD_CUSTOM
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+
+config ADK_COMPILE_NFACCTD_WITH_PGSQL
+ prompt "PostgreSQL database support"
+ bool
+ default n
+ depends ADK_PACKAGE_NFACCTD_CUSTOM
+ select ADK_PACKAGE_LIBPQ
+
+config ADK_COMPILE_NFACCTD_WITH_SQLITE
+ prompt "SQLite database support"
+ bool
+ default n
+ depends ADK_PACKAGE_NFACCTD_CUSTOM
+ select ADK_PACKAGE_LIBSQLITE
+
+
+config ADK_SHOW_PMACCTD
+ prompt "pmacctd......................... IP accounting daemon (libpcap based)"
+ bool
+ default n
+ depends ADK_SHOW_PMACCT
+ help
+
+ An IPv4/IPv6 libpcap-based accounting and aggregation daemon
+
+ http://www.ba.cnr.it/~paolo/pmacct/
+
+ Depends:
+ - libpcap
+ - libmysqlclient (for MySQL database logging support)
+ - libpq (for PostgreSQL database logging support)
+ - libsqlite (for SQLite database logging support)
+
+
+config ADK_PACKAGE_PMACCTD_BASIC
+ prompt "pmacctd....................... built without database support"
+ tristate
+ select ADK_COMPILE_PMACCT_BASIC
+ select ADK_PACKAGE_LIBPCAP
+ depends ADK_SHOW_PMACCTD
+
+config ADK_PACKAGE_PMACCTD_MYSQL
+ prompt "pmacctd-mysql................. built with MySQL database support"
+ tristate
+ select ADK_COMPILE_PMACCT_MYSQL
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+ depends ADK_SHOW_PMACCTD
+
+config ADK_PACKAGE_PMACCTD_PGSQL
+ prompt "pmacctd-pgsql................. built with PostgreSQL database support"
+ tristate
+ select ADK_COMPILE_PMACCT_PGSQL
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBPQ
+ depends ADK_SHOW_PMACCTD
+
+config ADK_PACKAGE_PMACCTD_SQLITE
+ prompt "pmacctd-sqlite................ built with SQLite database support"
+ tristate
+ select ADK_COMPILE_PMACCT_SQLITE
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBSQLITE
+ depends ADK_SHOW_PMACCTD
+
+config ADK_PACKAGE_PMACCTD_CUSTOM
+ prompt "pmacctd-custom................ customized to your needs"
+ tristate
+ select ADK_COMPILE_PMACCT_CUSTOM
+ select ADK_PACKAGE_LIBPCAP
+ depends ADK_SHOW_PMACCTD
+
+config ADK_COMPILE_PMACCTD_WITH_MYSQL
+ prompt "MySQL database support"
+ bool
+ default n
+ depends ADK_PACKAGE_PMACCTD_CUSTOM
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+
+config ADK_COMPILE_PMACCTD_WITH_PGSQL
+ prompt "PostgreSQL database support"
+ bool
+ default n
+ depends ADK_PACKAGE_PMACCTD_CUSTOM
+ select ADK_PACKAGE_LIBPQ
+
+config ADK_COMPILE_PMACCTD_WITH_SQLITE
+ prompt "SQLite database support"
+ bool
+ default n
+ depends ADK_PACKAGE_PMACCTD_CUSTOM
+ select ADK_PACKAGE_LIBSQLITE
+
+
+config ADK_PACKAGE_PMACCT_CLIENT
+ prompt "pmacct-client................... Command-line client to gather data from the IMT plugin"
+ tristate
+ default n
+ select ADK_COMPILE_PMACCT
+ depends ADK_SHOW_PMACCT
+
diff --git a/package/pmacct/Makefile b/package/pmacct/Makefile
new file mode 100644
index 000000000..98e1bfbb9
--- /dev/null
+++ b/package/pmacct/Makefile
@@ -0,0 +1,171 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= pmacct
+PKG_VERSION:= 0.10.0
+PKG_RELEASE:= 14
+PKG_MD5SUM:= ed510e7ee2130d1f37f27901b89e985a
+
+MASTER_SITES:= http://www.ba.cnr.it/~paolo/pmacct/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION)rc2.tar.gz
+
+include $(TOPDIR)/mk/package.mk
+
+PMACCT_CLIENT_OPTS:= \
+
+PMACCT_BASIC_CONFIGURE_OPTS:= \
+
+PMACCT_MYSQL_CONFIGURE_OPTS:= \
+ --enable-mysql \
+ --with-mysql-includes="$(STAGING_DIR)/usr/include" \
+ --with-mysql-libs="$(STAGING_DIR)/usr/lib/mysql"
+
+PMACCT_PGSQL_CONFIGURE_OPTS:= \
+ --enable-pgsql \
+ --with-pgsql-includes="$(STAGING_DIR)/usr/include" \
+ --with-pgsql-libs="$(STAGING_DIR)/usr/lib"
+
+PMACCT_SQLITE_CONFIGURE_OPTS:= \
+ --enable-sqlite3 \
+ --with-sqlite3-includes="$(STAGING_DIR)/usr/include" \
+ --with-sqlite3-libs="$(STAGING_DIR)/usr/lib"
+
+NFACCTD_CUSTOM_CONFIGURE_OPTS:= \
+
+ifeq ($(ADK_PACKAGE_NFACCTD_WITH_MYSQL),y)
+NFACCTD_CUSTOM_CONFIGURE_OPTS+= $(PMACCT_MYSQL_CONFIGURE_OPTS)
+endif
+
+ifeq ($(ADK_PACKAGE_NFACCTD_WITH_PGSQL),y)
+NFACCTD_CUSTOM_CONFIGURE_OPTS+= $(PMACCT_PGSQL_CONFIGURE_OPTS)
+endif
+
+ifeq ($(ADK_PACKAGE_NFACCTD_WITH_SQLITE),y)
+NFACCTD_CUSTOM_CONFIGURE_OPTS+= $(PMACCT_SQLITE_CONFIGURE_OPTS)
+endif
+
+PMACCTD_CUSTOM_CONFIGURE_OPTS:= \
+
+ifeq ($(ADK_PACKAGE_PMACCTD_WITH_MYSQL),y)
+PMACCTD_CUSTOM_CONFIGURE_OPTS+= $(PMACCT_MYSQL_CONFIGURE_OPTS)
+endif
+
+ifeq ($(ADK_PACKAGE_PMACCTD_WITH_PGSQL),y)
+PMACCTD_CUSTOM_CONFIGURE_OPTS+= $(PMACCT_PGSQL_CONFIGURE_OPTS)
+endif
+
+ifeq ($(ADK_PACKAGE_PMACCTD_WITH_SQLITE),y)
+PMACCTD_CUSTOM_CONFIGURE_OPTS+= $(PMACCT_SQLITE_CONFIGURE_OPTS)
+endif
+
+define PKG_build
+
+ifneq ($(ADK_PACKAGE_$(1)),)
+BUILD_TARGETS+= $(WRKBUILD)/$(2)
+BUILD_TARGETS+= $(WRKBUILD)/$(3)
+endif
+
+$(WRKBUILD)/$(2) $(WRKBUILD)/$(3): $(WRKBUILD)/.prepared
+ -$(MAKE) -C $(WRKBUILD) distclean
+ (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+ LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
+ ./configure \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --program-prefix="" \
+ --program-suffix="" \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --bindir=/usr/sbin \
+ --datadir=/usr/share \
+ --includedir=/usr/include \
+ --infodir=/usr/share/info \
+ --libdir=/usr/lib \
+ --libexecdir=/usr/lib/locate \
+ --localstatedir=/var/lib \
+ --mandir=/usr/share/man \
+ --sbindir=/usr/sbin \
+ --sysconfdir=/etc \
+ --disable-nls \
+ --enable-shared \
+ --disable-static \
+ --with-pcap-includes="$(STAGING_DIR)/usr/include" \
+ --with-pcap-libs="$(STAGING_DIR)/usr/lib" \
+ $$($(1)_CONFIGURE_OPTS) \
+ );
+ $(MAKE) -C $(WRKBUILD) \
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include"
+ mv -f $(WRKBUILD)/nfacctd $(WRKBUILD)/$(2)
+ mv -f $(WRKBUILD)/pmacctd $(WRKBUILD)/$(3)
+
+endef
+
+define PKG_package
+
+$$(IPKG_$(1)): $(WRKBUILD)/$(2)
+ install -d -m0755 $$(IDIR_$(1))/etc
+ install -m0644 ./files/$(3).conf $$(IDIR_$(1))/etc/
+ #install -d -m0755 $$(IDIR_$(1))/etc/default
+ #install -m0644 ./files/$(3).default $$(IDIR_$(1))/etc/default/$(3)
+ install -d -m0755 $$(IDIR_$(1))/etc/init.d
+ install -m0755 ./files/$(3).init $$(IDIR_$(1))/etc/init.d/$(3)
+ install -d -m0755 $$(IDIR_$(1))/usr/sbin
+ install -m0755 $(WRKBUILD)/$(2) $$(IDIR_$(1))/usr/sbin/$(3)
+ $(RSTRIP) $$(IDIR_$(1))
+ $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
+
+endef
+
+$(eval $(call PKG_template,NFACCTD_BASIC,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,NFACCTD_MYSQL,nfacctd-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,NFACCTD_PGSQL,nfacctd-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,NFACCTD_SQLITE,nfacctd-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,NFACCTD_CUSTOM,nfacctd-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PMACCTD_BASIC,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PMACCTD_MYSQL,pmacctd-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PMACCTD_PGSQL,pmacctd-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PMACCTD_SQLITE,pmacctd-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PMACCTD_CUSTOM,pmacctd-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_template,PMACCT_CLIENT,pmacct-client,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(eval $(call PKG_build,PMACCT_CLIENT,nfacctd-basic,pmacctd-basic,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_build,PMACCT_BASIC,nfacctd-basic,pmacctd-basic,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_build,PMACCT_MYSQL,nfacctd-mysql,pmacctd-mysql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_build,PMACCT_PGSQL,nfacctd-pgsql,pmacctd-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_build,PMACCT_SQLITE,nfacctd-sqlite,pmacctd-sqlite,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_build,NFACCTD_CUSTOM,nfacctd-custom,pmacctd-dummy,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_build,PMACCTD_CUSTOM,nfacctd-dummy,pmacctd-custom,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(eval $(call PKG_package,NFACCTD_BASIC,nfacctd-basic,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,NFACCTD_MYSQL,nfacctd-mysql,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,NFACCTD_PGSQL,nfacctd-pgsql,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,NFACCTD_SQLITE,nfacctd-sqlite,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,NFACCTD_CUSTOM,nfacctd-custom,nfacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,PMACCTD_BASIC,pmacctd-basic,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,PMACCTD_MYSQL,pmacctd-mysql,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,PMACCTD_PGSQL,pmacctd-pgsql,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,PMACCTD_SQLITE,pmacctd-sqlite,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+$(eval $(call PKG_package,PMACCTD_CUSTOM,pmacctd-custom,pmacctd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+$(WRKBUILD)/.configured:
+ touch $@
+
+$(WRKBUILD)/.built: $(BUILD_TARGETS)
+ touch $@
+
+$(IPKG_PMACCT_CLIENT):
+ install -d -m0755 $(IDIR_PMACCT_CLIENT)/usr/sbin
+ $(CP) $(WRKBUILD)/pmacct $(IDIR_PMACCT_CLIENT)/usr/sbin/
+ $(RSTRIP) $(IDIR_PMACCT_CLIENT)
+ $(IPKG_BUILD) $(IDIR_PMACCT_CLIENT) $(PACKAGE_DIR)
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pmacct/files/nfacctd.conf b/package/pmacct/files/nfacctd.conf
new file mode 100644
index 000000000..a9817b218
--- /dev/null
+++ b/package/pmacct/files/nfacctd.conf
@@ -0,0 +1,28 @@
+!
+! nfacctd configuration example
+!
+! debug: true
+daemonize: true
+pidfile: /var/run/nfacctd.pid
+! aggregate_filter[dummy]: src net 192.168.0.0/16
+aggregate: src_host, dst_host
+! plugin_buffer_size: 1024
+! nfacctd_port: 5678
+! nfacctd_time_secs: true
+! nfacctd_time_new: true
+plugins: memory
+imt_buckets: 65537
+imt_mem_pools_size: 65536
+! imt_mem_pools_number: 0
+! plugins: mysql
+! plugins: pgsql
+! sql_db: pmacct
+! sql_table: acct
+! sql_table_version: 2
+! sql_passwd: arealsmartpwd
+! sql_user: pmacct
+! sql_refresh_time: 90
+! sql_optimize_clauses: true
+! sql_history: 10m
+! sql_history_roundoff: mh
+! networks_file: ./networks.example
diff --git a/package/pmacct/files/nfacctd.init b/package/pmacct/files/nfacctd.init
new file mode 100644
index 000000000..2d0072bf5
--- /dev/null
+++ b/package/pmacct/files/nfacctd.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+ autostart)
+ test x"${nfacctd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+ start)
+ nfacctd $nfaccd_flags
+ ;;
+ stop)
+ killall nfacctd
+ ;;
+ restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/pmacct/files/pmacctd.conf b/package/pmacct/files/pmacctd.conf
new file mode 100644
index 000000000..65c6387ea
--- /dev/null
+++ b/package/pmacct/files/pmacctd.conf
@@ -0,0 +1,26 @@
+!
+! pmacctd configuration example
+!
+! debug: true
+interface: vlan1
+daemonize: true
+pidfile: /var/run/pmacctd.pid
+pmacctd_id: 1
+aggregate: src_host,dst_host
+! aggregate: src_net,dst_net
+plugins: memory
+imt_buckets: 65537
+imt_mem_pools_size: 65536
+! imt_mem_pools_number: 0
+! plugins: mysql
+! plugins: pgsql
+! sql_db: pmacct
+! sql_table: acct
+! sql_table_version: 2
+! sql_passwd: arealsmartpwd
+! sql_user: pmacct
+! sql_refresh_time: 90
+! sql_optimize_clauses: true
+! sql_history: 10m
+! sql_history_roundoff: mh
+! networks_file: ./networks.example
diff --git a/package/pmacct/files/pmacctd.init b/package/pmacct/files/pmacctd.init
new file mode 100644
index 000000000..5cde04ba7
--- /dev/null
+++ b/package/pmacct/files/pmacctd.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+ autostart)
+ test x"${pmacctd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+ start)
+ pmacctd $pmacctd_flags
+ ;;
+ stop)
+ killall pmacctd
+ ;;
+ restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/pmacct/ipkg/nfacctd-custom.control b/package/pmacct/ipkg/nfacctd-custom.control
new file mode 100644
index 000000000..096be7e04
--- /dev/null
+++ b/package/pmacct/ipkg/nfacctd-custom.control
@@ -0,0 +1,6 @@
+Package: nfacctd-custom
+Priority: optional
+Section: net
+Description: a NetFlow accounting daemon,
+ built with custom options
+Depends: libpcap
diff --git a/package/pmacct/ipkg/nfacctd-mysql.control b/package/pmacct/ipkg/nfacctd-mysql.control
new file mode 100644
index 000000000..e030db8fc
--- /dev/null
+++ b/package/pmacct/ipkg/nfacctd-mysql.control
@@ -0,0 +1,6 @@
+Package: nfacctd-mysql
+Priority: optional
+Section: net
+Description: a NetFlow accounting daemon,
+ built with MySQL database support
+Depends: libmysqlclient, libpcap
diff --git a/package/pmacct/ipkg/nfacctd-pgsql.control b/package/pmacct/ipkg/nfacctd-pgsql.control
new file mode 100644
index 000000000..8500ff342
--- /dev/null
+++ b/package/pmacct/ipkg/nfacctd-pgsql.control
@@ -0,0 +1,6 @@
+Package: nfacctd-pgsql
+Priority: optional
+Section: net
+Description: a NetFlow accounting daemon,
+ built with PostgreSQL database support
+Depends: libpq, libpcap
diff --git a/package/pmacct/ipkg/nfacctd-sqlite.control b/package/pmacct/ipkg/nfacctd-sqlite.control
new file mode 100644
index 000000000..add839416
--- /dev/null
+++ b/package/pmacct/ipkg/nfacctd-sqlite.control
@@ -0,0 +1,6 @@
+Package: nfacctd-sqlite
+Priority: optional
+Section: net
+Description: a NetFlow accounting daemon,
+ built with SQLite database support
+Depends: libsqlite, libpcap
diff --git a/package/pmacct/ipkg/nfacctd.conffiles b/package/pmacct/ipkg/nfacctd.conffiles
new file mode 100644
index 000000000..88dba6572
--- /dev/null
+++ b/package/pmacct/ipkg/nfacctd.conffiles
@@ -0,0 +1 @@
+/etc/nfacctd.conf
diff --git a/package/pmacct/ipkg/nfacctd.control b/package/pmacct/ipkg/nfacctd.control
new file mode 100644
index 000000000..e5afbf68d
--- /dev/null
+++ b/package/pmacct/ipkg/nfacctd.control
@@ -0,0 +1,6 @@
+Package: nfacctd
+Priority: optional
+Section: net
+Description: a NetFlow accounting daemon,
+ built without database support
+Depends: libpcap
diff --git a/package/pmacct/ipkg/nfacctd.postinst b/package/pmacct/ipkg/nfacctd.postinst
new file mode 100644
index 000000000..0b382cf0f
--- /dev/null
+++ b/package/pmacct/ipkg/nfacctd.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf nfacctd nfacctd NO
+add_rcconf nfacctd_flags nfacctd_flags "-f /etc/nfacctd.conf"
diff --git a/package/pmacct/ipkg/pmacct-client.control b/package/pmacct/ipkg/pmacct-client.control
new file mode 100644
index 000000000..c943e731e
--- /dev/null
+++ b/package/pmacct/ipkg/pmacct-client.control
@@ -0,0 +1,5 @@
+Package: pmacct-client
+Priority: optional
+Section: net
+Description: a command-line client for pmacctd or nfacctd,
+ used to retrieve data from an active memory plugin
diff --git a/package/pmacct/ipkg/pmacctd-custom.control b/package/pmacct/ipkg/pmacctd-custom.control
new file mode 100644
index 000000000..0278df142
--- /dev/null
+++ b/package/pmacct/ipkg/pmacctd-custom.control
@@ -0,0 +1,6 @@
+Package: pmacctd-custom
+Priority: optional
+Section: net
+Description: an IP accounting daemon,
+ built with custom options
+Depends: libpcap
diff --git a/package/pmacct/ipkg/pmacctd-mysql.control b/package/pmacct/ipkg/pmacctd-mysql.control
new file mode 100644
index 000000000..2ea345fcb
--- /dev/null
+++ b/package/pmacct/ipkg/pmacctd-mysql.control
@@ -0,0 +1,6 @@
+Package: pmacctd-mysql
+Priority: optional
+Section: net
+Description: an IP accounting daemon,
+ built with MySQL database support
+Depends: libmysqlclient, libpcap
diff --git a/package/pmacct/ipkg/pmacctd-pgsql.control b/package/pmacct/ipkg/pmacctd-pgsql.control
new file mode 100644
index 000000000..7018c7350
--- /dev/null
+++ b/package/pmacct/ipkg/pmacctd-pgsql.control
@@ -0,0 +1,6 @@
+Package: pmacctd-pgsql
+Priority: optional
+Section: net
+Description: an IP accounting daemon,
+ built with PostgreSQL database support
+Depends: libpq, libpcap
diff --git a/package/pmacct/ipkg/pmacctd-sqlite.control b/package/pmacct/ipkg/pmacctd-sqlite.control
new file mode 100644
index 000000000..ad8f7c96f
--- /dev/null
+++ b/package/pmacct/ipkg/pmacctd-sqlite.control
@@ -0,0 +1,6 @@
+Package: pmacctd-sqlite
+Priority: optional
+Section: net
+Description: an IP accounting daemon,
+ built with SQLite database support
+Depends: libsqlite, libpcap
diff --git a/package/pmacct/ipkg/pmacctd.conffiles b/package/pmacct/ipkg/pmacctd.conffiles
new file mode 100644
index 000000000..ce1303ff9
--- /dev/null
+++ b/package/pmacct/ipkg/pmacctd.conffiles
@@ -0,0 +1 @@
+/etc/pmacctd.conf
diff --git a/package/pmacct/ipkg/pmacctd.control b/package/pmacct/ipkg/pmacctd.control
new file mode 100644
index 000000000..5d2cc7c4e
--- /dev/null
+++ b/package/pmacct/ipkg/pmacctd.control
@@ -0,0 +1,6 @@
+Package: pmacctd
+Priority: optional
+Section: net
+Description: an IP accounting daemon,
+ built without database support
+Depends: libpcap
diff --git a/package/pmacct/ipkg/pmacctd.postinst b/package/pmacct/ipkg/pmacctd.postinst
new file mode 100644
index 000000000..49cde0f8e
--- /dev/null
+++ b/package/pmacct/ipkg/pmacctd.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf pmacctd pmacctd NO
+add_rcconf pmacctd_flags pmacctd_flags "-f /etc/pmacctd.conf"
diff --git a/package/popt/Config.in b/package/popt/Config.in
new file mode 100644
index 000000000..554cd3b32
--- /dev/null
+++ b/package/popt/Config.in
@@ -0,0 +1,14 @@
+config ADK_COMPILE_POPT
+ tristate
+ depends ADK_PACKAGE_LIBPOPT
+
+config ADK_PACKAGE_LIBPOPT
+ prompt "libpopt........................... Command line option parsing library"
+ tristate
+ default n
+ select ADK_COMPILE_POPT
+ help
+ A command line option parsing library
+
+ ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/
+
diff --git a/package/popt/Makefile b/package/popt/Makefile
new file mode 100644
index 000000000..872a00fc2
--- /dev/null
+++ b/package/popt/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= popt
+PKG_VERSION:= 1.15
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c61ef795fa450eb692602a661ec8d7f1
+MASTER_SITES:= http://rpm5.org/files/popt/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBPOPT,libpopt,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBPOPT}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpopt.so.* ${IDIR_LIBPOPT}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/popt/ipkg/libpopt.control b/package/popt/ipkg/libpopt.control
new file mode 100644
index 000000000..280d67344
--- /dev/null
+++ b/package/popt/ipkg/libpopt.control
@@ -0,0 +1,4 @@
+Package: libpopt
+Priority: optional
+Section: libs
+Description: a command line option parsing library
diff --git a/package/portmap/Config.in b/package/portmap/Config.in
new file mode 100644
index 000000000..ac4415a05
--- /dev/null
+++ b/package/portmap/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_PORTMAP
+ prompt "portmap........................... RPC Portmapper"
+ tristate
+ default n
+ help
+ Portmap is a server that converts RPC (Remote Procedure Call) program
+ numbers into DARPA protocol port numbers. It must be running in order
+ to make RPC calls. Services that use RPC include NFS and NIS.
+
+config ADK_PACKAGE_PORTMAP_LIBWRAP
+ bool " Use tcp_wrappers"
+ default n
+ depends on ADK_PACKAGE_PORTMAP
+ select ADK_PACKAGE_LIBWRAP
diff --git a/package/portmap/Makefile b/package/portmap/Makefile
new file mode 100644
index 000000000..68732581c
--- /dev/null
+++ b/package/portmap/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= portmap
+PKG_VERSION:= 6.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ac108ab68bf0f34477f8317791aaf1ff
+MASTER_SITES:= http://neil.brown.name/portmap/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+WRKDIST= ${WRKDIR}/${PKG_NAME}_${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PORTMAP,portmap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifneq ($(strip ${ADK_PACKAGE_PORTMAP_LIBWRAP}),)
+MAKE_FLAGS+= WRAP_LIB='-L${STAGING_DIR}/usr/lib -lwrap'
+else
+MAKE_FLAGS+= NO_TCP_WRAPPER=1
+endif
+TCPPFLAGS+= -DDAEMON_UID=20 -DDAEMON_GID=20
+BUILD_STYLE:= auto
+MAKE_FLAGS+= ${TARGET_CONFIGURE_OPTS} \
+ CFLAGS='${TCFLAGS}'
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PORTMAP}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_PORTMAP}/usr/sbin
+ ${INSTALL_BIN} ./files/portmap.init \
+ ${IDIR_PORTMAP}/etc/init.d/portmap
+ ${INSTALL_BIN} ${WRKBUILD}/portmap ${IDIR_PORTMAP}/usr/sbin/
+ifneq ($(strip ${ADK_PACKAGE_PORTMAP_LIBWRAP}),)
+ echo 'Depends: libwrap' >>${IDIR_PORTMAP}/CONTROL/control
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/portmap/files/portmap.init b/package/portmap/files/portmap.init
new file mode 100644
index 000000000..19e54ee77
--- /dev/null
+++ b/package/portmap/files/portmap.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${portmap:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p /tmp/.portmap
+ portmap -t /tmp/.portmap
+ ;;
+stop)
+ kill $(pidof portmap|cut -d ' ' -f 3)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/portmap/ipkg/portmap.control b/package/portmap/ipkg/portmap.control
new file mode 100644
index 000000000..88fc963fa
--- /dev/null
+++ b/package/portmap/ipkg/portmap.control
@@ -0,0 +1,4 @@
+Package: portmap
+Priority: optional
+Section: net
+Description: The RPC Portmapper
diff --git a/package/portmap/ipkg/portmap.postinst b/package/portmap/ipkg/portmap.postinst
new file mode 100644
index 000000000..1017d2251
--- /dev/null
+++ b/package/portmap/ipkg/portmap.postinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf portmap
+add_group portmap 20
+add_user portmap 20 20 /tmp/.portmap
diff --git a/package/portmap/patches/patch-pmap_check_c b/package/portmap/patches/patch-pmap_check_c
new file mode 100644
index 000000000..9dc7cd67f
--- /dev/null
+++ b/package/portmap/patches/patch-pmap_check_c
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+
+* do not include tcpd.h, when hosts access disabled
+
+--- portmap_6.0.orig/pmap_check.c 2007-05-11 05:02:10.000000000 +0200
++++ portmap_6.0/pmap_check.c 2009-04-24 12:26:06.041879543 +0200
+@@ -44,7 +44,9 @@
+ #include <netinet/in.h>
+ #include <rpc/rpcent.h>
+ #endif
++#ifdef HOSTS_ACCESS
+ #include <tcpd.h>
++#endif
+ #include <arpa/inet.h>
+ #include <grp.h>
+
diff --git a/package/portsentry/Config.in b/package/portsentry/Config.in
new file mode 100644
index 000000000..27095069b
--- /dev/null
+++ b/package/portsentry/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_PORTSENTRY
+ prompt "portsentry........................ Portscan protection utility"
+ tristate
+ default n
+ help
+ Software for protection against port scans
+
+ http://sourceforge.net/projects/sentrytools
+
diff --git a/package/portsentry/Makefile b/package/portsentry/Makefile
new file mode 100644
index 000000000..6fd433540
--- /dev/null
+++ b/package/portsentry/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= portsentry
+PKG_VERSION:= 1.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3ebd3618ba9abfea2525e236bd44cebd
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=sentrytools/}
+
+WRKDIST= ${WRKDIR}/${PKG_NAME}_beta
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PORTSENTRY,portsentry,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+ALL_TARGET:= linux
+MAKE_FLAGS+= CC="${TARGET_CC}" CFLAGS="${TCFLAGS}"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PORTSENTRY}/usr/bin \
+ ${IDIR_PORTSENTRY}/etc
+ ${INSTALL_DATA} ${WRKBUILD}/${PKG_NAME}.conf ${IDIR_PORTSENTRY}/etc/
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_PORTSENTRY}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/portsentry/ipkg/portsentry.conffiles b/package/portsentry/ipkg/portsentry.conffiles
new file mode 100644
index 000000000..9c0810ccb
--- /dev/null
+++ b/package/portsentry/ipkg/portsentry.conffiles
@@ -0,0 +1 @@
+/etc/portsentry.conf
diff --git a/package/portsentry/ipkg/portsentry.control b/package/portsentry/ipkg/portsentry.control
new file mode 100644
index 000000000..f05b282df
--- /dev/null
+++ b/package/portsentry/ipkg/portsentry.control
@@ -0,0 +1,4 @@
+Package: portsentry
+Priority: optional
+Section: net
+Description: Software for protection against port scans
diff --git a/package/portsentry/patches/100-conf_location.patch b/package/portsentry/patches/100-conf_location.patch
new file mode 100644
index 000000000..457c9c827
--- /dev/null
+++ b/package/portsentry/patches/100-conf_location.patch
@@ -0,0 +1,11 @@
+--- portsentry/portsentry_config.h 2003-05-23 20:10:13.000000000 +0200
++++ portsentry.old/portsentry_config.h 2005-07-09 21:21:15.000000000 +0200
+@@ -22,7 +22,7 @@
+
+ /* These are probably ok. Be sure you change the Makefile if you */
+ /* change the path */
+-#define CONFIG_FILE "/usr/local/psionic/portsentry/portsentry.conf"
++#define CONFIG_FILE "/etc/portsentry.conf"
+
+ /* The location of Wietse Venema's TCP Wrapper hosts.deny file */
+ #define WRAPPER_HOSTS_DENY "/etc/hosts.deny"
diff --git a/package/portsentry/patches/101-postsentry_c.patch b/package/portsentry/patches/101-postsentry_c.patch
new file mode 100644
index 000000000..e36bb2a12
--- /dev/null
+++ b/package/portsentry/patches/101-postsentry_c.patch
@@ -0,0 +1,12 @@
+--- portsentry/portsentry.c 2003-05-23 20:10:13.000000000 +0200
++++ portsentry.old/portsentry.c 2005-07-09 21:57:24.000000000 +0200
+@@ -1581,8 +1581,7 @@
+ Usage (void)
+ {
+ printf ("PortSentry - Port Scan Detector.\n");
+- printf ("Copyright 1997-2003 Craig H. Rowland <craigrowland at users dot
+-sourceforget dot net>\n");
++ printf ("Copyright 1997-2003 Craig H. Rowland <craigrowland at users dot sourceforget dot net>\n");
+ printf ("Licensing restrictions apply. Please see documentation\n");
+ printf ("Version: %s\n\n", VERSION);
+ #ifdef SUPPORT_STEALTH
diff --git a/package/postgresql/Config.in b/package/postgresql/Config.in
new file mode 100644
index 000000000..d1d0d09fe
--- /dev/null
+++ b/package/postgresql/Config.in
@@ -0,0 +1,31 @@
+config ADK_COMPILE_POSTGRESQL
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBPQ
+
+config ADK_PACKAGE_LIBPQ
+ prompt "libpq............................. PostgreSQL client library"
+ tristate
+ default n
+ select ADK_COMPILE_POSTGRESQL
+ help
+ PostgreSQL is an object-relational database management system (ORDBMS)
+ based on POSTGRES, Version 4.2, developed at the University of
+ California at Berkeley Computer Science Department. POSTGRES pioneered
+ many concepts that only became available in some commercial database
+ systems much later.
+
+ PostgreSQL is an open-source descendant of this original Berkeley code.
+ It supports SQL92 and SQL99 and offers many modern features:
+
+ * complex queries
+ * foreign keys
+ * triggers
+ * views
+ * transactional integrity
+ * multiversion concurrency control
+
+ http://www.postgresql.org/
+
+ This package contains the shared client library, needed by other programs.
+
diff --git a/package/postgresql/Makefile b/package/postgresql/Makefile
new file mode 100644
index 000000000..4b44b6f35
--- /dev/null
+++ b/package/postgresql/Makefile
@@ -0,0 +1,62 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= postgresql
+PKG_VERSION:= 8.3.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6e36f3b4dd27ae0c352376ea9f843de2
+
+MASTER_SITES:= ftp://ftp7.de.postgresql.org/pub/ftp.postgresql.org/source/v${PKG_VERSION}/ \
+ ftp://ftp8.de.postgresql.org/pub/ftp.postgresql.org/source/v${PKG_VERSION}/ \
+ ftp://ftp.be.postgresql.org/pub/postgresql/source/v${PKG_VERSION}/ \
+ ftp://ftp.tw.postgresql.org/pub/postgresql/source/v${PKG_VERSION}/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBPQ,libpq,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+PKG_CONFIGURE_ARGS:=\
+ --disable-integer-datetimes \
+ --without-java \
+ --without-krb4 \
+ --without-krb5 \
+ --without-openssl \
+ --without-pam \
+ --without-perl \
+ --without-python \
+ --without-readline \
+ --without-rendezvous \
+ --without-tcl \
+ --without-tk \
+ --with-zlib="yes"
+CONFIGURE_ARGS+= ${PKG_CONFIGURE_ARGS}
+
+pre-configure:
+ (cd ${WRKBUILD}; rm -rf config.{cache,status} ; \
+ ./configure \
+ --prefix=/usr \
+ ${PKG_CONFIGURE_ARGS} \
+ );
+ ${MAKE} -C "${WRKBUILD}/src/bin/pg_config" \
+ CC="${HOSTCC}" \
+ DESTDIR="${WRKINST}" \
+ all install
+
+do-build:
+ ${MAKE} -C "${WRKBUILD}/src/include" \
+ DESTDIR="${WRKINST}" \
+ all install
+ ${MAKE} -C "${WRKBUILD}/src/interfaces/libpq" \
+ DESTDIR="${WRKINST}" \
+ all install
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LIBPQ}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libpq.so.* ${IDIR_LIBPQ}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/postgresql/ipkg/libpq.control b/package/postgresql/ipkg/libpq.control
new file mode 100644
index 000000000..ff669c6cb
--- /dev/null
+++ b/package/postgresql/ipkg/libpq.control
@@ -0,0 +1,4 @@
+Package: libpq
+Priority: optional
+Section: libs
+Description: PostgreSQL client library
diff --git a/package/postgresql/ipkg/pgsql-cli.control b/package/postgresql/ipkg/pgsql-cli.control
new file mode 100644
index 000000000..4ce03e45c
--- /dev/null
+++ b/package/postgresql/ipkg/pgsql-cli.control
@@ -0,0 +1,5 @@
+Package: pgsql-cli
+Priority: optional
+Section: libs
+Description: Command Line Interface (CLI) to PostgreSQL databases
+Depends: libpq
diff --git a/package/ppp/Config.in b/package/ppp/Config.in
new file mode 100644
index 000000000..493c74e58
--- /dev/null
+++ b/package/ppp/Config.in
@@ -0,0 +1,52 @@
+
+config ADK_PACKAGE_PPP
+ prompt "ppp............................... PPP (Point-to-Point Protocol) daemon"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_PPP
+
+#config ADK_PACKAGE_PPP_MOD_PPPOA
+# prompt "ppp-mod-pppoa................... PPPoA (PPP over ATM) plugin"
+# tristate
+# default n
+# select ADK_KPACKAGE_KMOD_PPPOATM
+# depends ADK_PACKAGE_PPP
+
+config ADK_PACKAGE_PPP_MOD_PPPOE
+ prompt "ppp-mod-pppoe................... PPPoE (PPP over Ethernet) plugin"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_PPPOE
+ depends ADK_PACKAGE_PPP
+
+config ADK_PACKAGE_PPP_MOD_RADIUS
+ prompt "ppp-mod-radius.................. RADIUS (Remote Authentication Dial-In User Service) plugin"
+ tristate
+ default n
+ depends ADK_PACKAGE_PPP
+
+config ADK_PACKAGE_PPP_MOD_CHAT
+ prompt "chat............................ Utility to establish conversation with other PPP servers (via a modem)"
+ tristate
+ default n
+ depends ADK_PACKAGE_PPP
+
+config ADK_PACKAGE_PPP_MOD_PPPDUMP
+ prompt "pppdump......................... Utility to read PPP record file"
+ tristate
+ default n
+ depends ADK_PACKAGE_PPP
+
+config ADK_PACKAGE_PPP_MOD_PPPSTATS
+ prompt "pppstats........................ Utility to report PPP statistics"
+ tristate
+ default n
+ depends ADK_PACKAGE_PPP
+
+config ADK_PACKAGE_PPP_MOD_PPPUMTS
+ prompt "GPRS/UMTS support............... Package with scripts and dependencies to run UMTS/GRPS"
+ tristate
+ default n
+ select ADK_PACKAGE_COMGT
+ select ADK_KPACKAGE_KMOD_USB_SERIAL
+ depends ADK_PACKAGE_PPP
diff --git a/package/ppp/Makefile b/package/ppp/Makefile
new file mode 100644
index 000000000..44864dcd8
--- /dev/null
+++ b/package/ppp/Makefile
@@ -0,0 +1,106 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ppp
+PKG_VERSION:= 2.4.4
+PKG_RELEASE:= 16
+PKG_MD5SUM:= 183800762e266132218b204dfb428d29
+MASTER_SITES:= ftp://ftp.samba.org/pub/ppp/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PPP,ppp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPP_MOD_PPPOA,ppp-mod-pppoa,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPP_MOD_PPPOE,ppp-mod-pppoe,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPP_MOD_RADIUS,ppp-mod-radius,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPP_MOD_CHAT,ppp-mod-chat,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPP_MOD_PPPDUMP,ppp-mod-pppdump,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPP_MOD_PPPSTATS,ppp-mod-pppstats,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPP_MOD_PPPUMTS,ppp-mod-pppumts,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifeq ($(ADK_IPV6),y)
+IPV6+=HAVE_INET6="1"
+endif
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= CC="${TARGET_CC}" \
+ COPTS="${TCFLAGS}" \
+ ${IPV6} \
+ STAGING_DIR=${STAGING_DIR} \
+ DESTDIR="${WRKINST}/usr" \
+ TARGET_AR='${TARGET_CROSS}ar'
+
+SUB_INSTALLS-y:=
+SUB_INSTALLS-m:=
+SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPOE}+= mod-pppoe-install
+SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_RADIUS}+= mod-radius-install
+SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_CHAT}+= mod-chat-install
+SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPDUMP}+= mod-pppdump-install
+SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPSTATS}+= mod-pppstats-install
+SUB_INSTALLS-${ADK_PACKAGE_PPP_MOD_PPPUMTS}+= mod-pppumts-install
+
+post-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
+ echo -------------------------------
+ echo ${SUB_INSTALLS-m}
+ echo ${SUB_INSTALLS-y}
+ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp
+ ln -sf /tmp/resolv.conf ${IDIR_PPP}/etc/ppp/resolv.conf
+ install -m0600 ./files/etc/ppp/chap-secrets ${IDIR_PPP}/etc/ppp/
+ ${INSTALL_DATA} ./files/etc/ppp/options ${IDIR_PPP}/etc/ppp/
+ ${INSTALL_FILTER}
+ ${INSTALL_BIN} ./files/etc/ppp/ip-up ${IDIR_PPP}/etc/ppp/
+ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/ip-up.d
+ ${INSTALL_BIN} ./files/etc/ppp/ip-up.d/if-rename ${IDIR_PPP}/etc/ppp/ip-up.d/
+ ${INSTALL_BIN} ./files/etc/ppp/ip-down ${IDIR_PPP}/etc/ppp/
+ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/ip-down.d
+ ${INSTALL_DIR} ${IDIR_PPP}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/pppd ${IDIR_PPP}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_PPP}/usr/lib/pppd
+ ${INSTALL_BIN} ./files/pon ${IDIR_PPP}/usr/sbin/
+ ${INSTALL_BIN} ./files/poff ${IDIR_PPP}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/peers
+ ${INSTALL_DIR} ${IDIR_PPP}/etc/ppp/templates
+ ${INSTALL_DATA} ./files/etc/ppp/templates/dsl ${IDIR_PPP}/etc/ppp/templates/
+
+mod-radius-install:
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_RADIUS}/etc/radiusclient
+ ${CP} ${WRKBUILD}/pppd/plugins/radius/etc/* ${IDIR_PPP_MOD_RADIUS}/etc/radiusclient
+ rm ${IDIR_PPP_MOD_RADIUS}/etc/radiusclient/radiusclient.conf.in
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_RADIUS}/usr/lib/pppd/$(PKG_VERSION)
+ ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/radius.so \
+ ${IDIR_PPP_MOD_RADIUS}/usr/lib/pppd/$(PKG_VERSION)
+
+mod-pppoe-install:
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPOE}/usr/lib/pppd/$(PKG_VERSION)
+ ${INSTALL_BIN} $(WRKINST)/usr/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
+ ${IDIR_PPP_MOD_PPPOE}/usr/lib/pppd/$(PKG_VERSION)
+
+mod-chat-install:
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_CHAT}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/chat ${IDIR_PPP_MOD_CHAT}/usr/sbin/
+
+mod-pppdump-install:
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPDUMP}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/pppdump ${IDIR_PPP_MOD_PPPDUMP}/usr/sbin/
+
+mod-pppstats-install:
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPSTATS}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/pppstats ${IDIR_PPP_MOD_PPPSTATS}/usr/sbin/
+
+mod-pppumts-install:
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/templates
+ ${INSTALL_DIR} ${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/ip-{down,up}.d
+ ${INSTALL_DATA} ./files/etc/ppp/templates/umts \
+ ${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/templates/
+ ${INSTALL_BIN} ./files/etc/ppp/ip-up.d/umts \
+ ${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/ip-up.d/
+ ${INSTALL_BIN} ./files/etc/ppp/ip-down.d/umts \
+ ${IDIR_PPP_MOD_PPPUMTS}/etc/ppp/ip-down.d/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ppp/files/etc/ppp/chap-secrets b/package/ppp/files/etc/ppp/chap-secrets
new file mode 100644
index 000000000..6ab76e49e
--- /dev/null
+++ b/package/ppp/files/etc/ppp/chap-secrets
@@ -0,0 +1 @@
+#USERNAME PROVIDER PASSWORD IPADDRESS
diff --git a/package/ppp/files/etc/ppp/filter b/package/ppp/files/etc/ppp/filter
new file mode 100644
index 000000000..ec72a81a0
--- /dev/null
+++ b/package/ppp/files/etc/ppp/filter
@@ -0,0 +1,23 @@
+#
+# Expression: outbound and not icmp[0] != 8 and not tcp[13] & 4 != 0
+#
+19
+48 0 0 0
+21 0 16 1
+40 0 0 2
+21 0 13 33
+48 0 0 13
+21 0 5 1
+40 0 0 10
+69 9 0 8191
+177 0 0 4
+80 0 0 4
+21 6 7 8
+21 0 5 6
+40 0 0 10
+69 3 0 8191
+177 0 0 4
+80 0 0 17
+69 1 0 4
+6 0 0 4
+6 0 0 0
diff --git a/package/ppp/files/etc/ppp/ip-down b/package/ppp/files/etc/ppp/ip-down
new file mode 100755
index 000000000..334bcb885
--- /dev/null
+++ b/package/ppp/files/etc/ppp/ip-down
@@ -0,0 +1,9 @@
+#!/bin/sh
+[ -z "$6" ] || env -i ACTION="ifdown" INTERFACE="$6" PROTO=ppp /sbin/hotplug "iface"
+
+[ -d /etc/ppp/ip-down.d ] && {
+ for SCRIPT in /etc/ppp/ip-down.d/*
+ do
+ [ -x "$SCRIPT" ] && "$SCRIPT" $@
+ done
+}
diff --git a/package/ppp/files/etc/ppp/ip-down.d/umts b/package/ppp/files/etc/ppp/ip-down.d/umts
new file mode 100755
index 000000000..6c812a782
--- /dev/null
+++ b/package/ppp/files/etc/ppp/ip-down.d/umts
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ "$IF_USE_TEMPLATE" == "umts" ] || exit 0
+
+# enable bit 3, disable bit 4 - i.e. UMTS-LED from blue to green
+LED=$(cat /proc/sys/diag)
+echo $(((LED | 16) ^ 16 | 8)) > /proc/sys/diag
diff --git a/package/ppp/files/etc/ppp/ip-up b/package/ppp/files/etc/ppp/ip-up
new file mode 100755
index 000000000..34b4b50e1
--- /dev/null
+++ b/package/ppp/files/etc/ppp/ip-up
@@ -0,0 +1,9 @@
+#!/bin/sh
+[ -z "$6" ] || env -i ACTION="ifup" INTERFACE="$6" PROTO=ppp /sbin/hotplug "iface"
+
+[ -d /etc/ppp/ip-up.d ] && {
+ for SCRIPT in /etc/ppp/ip-up.d/*
+ do
+ [ -x "$SCRIPT" ] && "$SCRIPT" $@
+ done
+}
diff --git a/package/ppp/files/etc/ppp/ip-up.d/if-rename b/package/ppp/files/etc/ppp/ip-up.d/if-rename
new file mode 100755
index 000000000..061fd8861
--- /dev/null
+++ b/package/ppp/files/etc/ppp/ip-up.d/if-rename
@@ -0,0 +1,17 @@
+#!/bin/sh
+exit 0 # This script breaks ppp accounting
+
+[ "$LINKNAME" ] || exit 0
+
+PATH=/bin:/usr/sbin:$PATH
+if ip link show dev $LINKNAME >/dev/null;then
+ logger "$0: interface '$LINKNAME' already exists, cannot rename '$IFNAME'."
+ exit 0
+fi
+
+if ip route | grep -qE "^default.*dev $IFNAME *$"; then DEFAULT_ROUTE=1; fi
+
+ip link set $IFNAME down
+ip link set $IFNAME name $LINKNAME
+ip link set $LINKNAME up
+if [ -n "$DEFAULT_ROUTE" ]; then ip route add default via $IPREMOTE; fi
diff --git a/package/ppp/files/etc/ppp/ip-up.d/umts b/package/ppp/files/etc/ppp/ip-up.d/umts
new file mode 100755
index 000000000..0c18970e0
--- /dev/null
+++ b/package/ppp/files/etc/ppp/ip-up.d/umts
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ "$IF_USE_TEMPLATE" == "umts" ] || exit 0
+
+# enable bit 4 i.e. UMTS-LED blue
+LED=$(cat /proc/sys/diag)
+echo $((LED | 16)) > /proc/sys/diag
diff --git a/package/ppp/files/etc/ppp/options b/package/ppp/files/etc/ppp/options
new file mode 100644
index 000000000..4b67b6a0d
--- /dev/null
+++ b/package/ppp/files/etc/ppp/options
@@ -0,0 +1 @@
+lock
diff --git a/package/ppp/files/etc/ppp/peers/dsl b/package/ppp/files/etc/ppp/peers/dsl
new file mode 100644
index 000000000..7ffc38082
--- /dev/null
+++ b/package/ppp/files/etc/ppp/peers/dsl
@@ -0,0 +1,12 @@
+plugin rp-pppoe.so
+ipcp-accept-remote
+ipcp-accept-local
+usepeerdns
+defaultroute
+lcp-echo-interval 10
+lcp-echo-failure 3
+persist
+maxfail 0
+
+user "user@t-online.de"
+password "secret"
diff --git a/package/ppp/files/etc/ppp/templates/dsl b/package/ppp/files/etc/ppp/templates/dsl
new file mode 100644
index 000000000..2ad285ede
--- /dev/null
+++ b/package/ppp/files/etc/ppp/templates/dsl
@@ -0,0 +1,9 @@
+plugin rp-pppoe.so
+defaultroute
+usepeerdns
+lcp-echo-interval 10
+lcp-echo-failure 3
+#IDLEOPTIONS#
+user #USERNAME#
+password #PASSWORD#
+#DEVICE#
diff --git a/package/ppp/files/etc/ppp/templates/umts b/package/ppp/files/etc/ppp/templates/umts
new file mode 100644
index 000000000..e9c97bf06
--- /dev/null
+++ b/package/ppp/files/etc/ppp/templates/umts
@@ -0,0 +1,11 @@
+defaultroute
+usepeerdns
+lcp-echo-interval 10
+lcp-echo-failure 3
+crtscts
+460800
+connect "NUMBER='*99***1#' /usr/bin/comgt -s /etc/comgt/dial.comgt -d #DEVICE#"
+#IDLEOPTIONS#
+user #USERNAME#
+password #PASSWORD#
+#DEVICE#
diff --git a/package/ppp/files/poff b/package/ppp/files/poff
new file mode 100755
index 000000000..955cebe8c
--- /dev/null
+++ b/package/ppp/files/poff
@@ -0,0 +1,14 @@
+#!/bin/mksh
+(busybox ps ww | grep "[ /]pppd call $1\( .*\)*\$") |&
+found=0
+rv=0
+while read thepid rest; do
+ if ! kill $thepid; then
+ print -u2 "$0: kill $thepid failed"
+ rv=1
+ fi
+ found=1
+done
+[[ $found = 1 ]] && exit $rv
+print -u2 "$0: I could not find a pppd process for provider '$1'."
+exit 1
diff --git a/package/ppp/files/pon b/package/ppp/files/pon
new file mode 100755
index 000000000..1c2e5c50c
--- /dev/null
+++ b/package/ppp/files/pon
@@ -0,0 +1,8 @@
+#!/bin/sh
+insmod slhc.o 2>/dev/null
+insmod ppp_generic.o 2>/dev/null
+insmod pppox.o 2>/dev/null
+insmod pppoe.o 2>/dev/null
+insmod ppp_async.o 2>/dev/null
+
+exec /usr/sbin/pppd call $@ >/dev/null 2>&1
diff --git a/package/ppp/files/ppp.pre-up b/package/ppp/files/ppp.pre-up
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/package/ppp/files/ppp.pre-up
diff --git a/package/ppp/ipkg/ppp-mod-chat.control b/package/ppp/ipkg/ppp-mod-chat.control
new file mode 100644
index 000000000..43dbdb1e1
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-chat.control
@@ -0,0 +1,5 @@
+Package: chat
+Priority: optional
+Section: net
+Description: Utility for establishing a connection with the ISP's PPP server (e.g. via Modem)
+Depends: ppp
diff --git a/package/ppp/ipkg/ppp-mod-pppdump.control b/package/ppp/ipkg/ppp-mod-pppdump.control
new file mode 100644
index 000000000..4a89e152e
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-pppdump.control
@@ -0,0 +1,5 @@
+Package: pppdump
+Priority: optional
+Section: net
+Description: an utility to read PPP record file
+Depends: ppp
diff --git a/package/ppp/ipkg/ppp-mod-pppoa.control b/package/ppp/ipkg/ppp-mod-pppoa.control
new file mode 100644
index 000000000..ce2d5d45f
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-pppoa.control
@@ -0,0 +1,5 @@
+Package: ppp-mod-pppoa
+Priority: optional
+Section: net
+Description: a PPPoA (PPP over ATM) plugin for PPP
+Depends: ppp, kmod-pppoa
diff --git a/package/ppp/ipkg/ppp-mod-pppoe.control b/package/ppp/ipkg/ppp-mod-pppoe.control
new file mode 100644
index 000000000..7cf49636b
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-pppoe.control
@@ -0,0 +1,5 @@
+Package: ppp-mod-pppoe
+Priority: optional
+Section: net
+Description: a PPPoE (PPP over Ethernet) plugin for PPP
+Depends: ppp, kmod-pppoe
diff --git a/package/ppp/ipkg/ppp-mod-pppstats.control b/package/ppp/ipkg/ppp-mod-pppstats.control
new file mode 100644
index 000000000..8780b2f87
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-pppstats.control
@@ -0,0 +1,5 @@
+Package: pppstats
+Priority: optional
+Section: net
+Description: an utility to report PPP statistics
+Depends: ppp
diff --git a/package/ppp/ipkg/ppp-mod-pppumts.control b/package/ppp/ipkg/ppp-mod-pppumts.control
new file mode 100644
index 000000000..178ae2413
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-pppumts.control
@@ -0,0 +1,5 @@
+Package: pppumts
+Priority: optional
+Section: net
+Depends: comgt, chat
+Description: Scripts and default configuration files to establish GPRS/UMTS connections
diff --git a/package/ppp/ipkg/ppp-mod-radius.conffiles b/package/ppp/ipkg/ppp-mod-radius.conffiles
new file mode 100644
index 000000000..2cfa4a146
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-radius.conffiles
@@ -0,0 +1,10 @@
+/etc/radiusclient/dictionary
+/etc/radiusclient/dictionary.ascend
+/etc/radiusclient/dictionary.compat
+/etc/radiusclient/dictionary.merit
+/etc/radiusclient/dictionary.microsoft
+/etc/radiusclient/issue
+/etc/radiusclient/port-id-map
+/etc/radiusclient/radiusclient.conf
+/etc/radiusclient/realms
+/etc/radiusclient/servers
diff --git a/package/ppp/ipkg/ppp-mod-radius.control b/package/ppp/ipkg/ppp-mod-radius.control
new file mode 100644
index 000000000..0a858da30
--- /dev/null
+++ b/package/ppp/ipkg/ppp-mod-radius.control
@@ -0,0 +1,5 @@
+Package: ppp-mod-radius
+Priority: optional
+Section: net
+Description: a RADIUS plugin for PPP
+Depends: ppp
diff --git a/package/ppp/ipkg/ppp.conffiles b/package/ppp/ipkg/ppp.conffiles
new file mode 100644
index 000000000..8ad17eb43
--- /dev/null
+++ b/package/ppp/ipkg/ppp.conffiles
@@ -0,0 +1,2 @@
+/etc/ppp/chap-secrets
+/etc/ppp/options
diff --git a/package/ppp/ipkg/ppp.control b/package/ppp/ipkg/ppp.control
new file mode 100644
index 000000000..2ebff521c
--- /dev/null
+++ b/package/ppp/ipkg/ppp.control
@@ -0,0 +1,5 @@
+Package: ppp
+Priority: optional
+Section: net
+Depends: kmod-ppp
+Description: a PPP (Point-to-Point Protocol) daemon (with MPPE/MPPC support)
diff --git a/package/ppp/patches/010-use_target_for_configuration.patch b/package/ppp/patches/010-use_target_for_configuration.patch
new file mode 100644
index 000000000..0b804694b
--- /dev/null
+++ b/package/ppp/patches/010-use_target_for_configuration.patch
@@ -0,0 +1,20 @@
+$Id$
+
+ Use values exported from $(TOPDIR)/rules.mk for determining
+ the target system instead of the host configuration, d'oh
+
+--- ppp-2.4.3/configure.orig Sat Nov 6 11:36:32 2004
++++ ppp-2.4.3/configure Sun Jun 18 23:40:46 2006
+@@ -8,9 +8,9 @@ SYSCONF=/etc
+ # if [ -d /NextApps ]; then
+ # system="NeXTStep"
+ # else
+- system=`uname -s`
+- release=`uname -r`
+- arch=`uname -m`
++ system=${UNAME_S:-`uname -s`}
++ release=${UNAME_R:-`uname -r`}
++ arch=${UNAME_M:-`uname -m`}
+ # fi
+ state="unknown"
+
diff --git a/package/ppp/patches/100-debian_close_dev_ppp.patch b/package/ppp/patches/100-debian_close_dev_ppp.patch
new file mode 100644
index 000000000..4e50118e8
--- /dev/null
+++ b/package/ppp/patches/100-debian_close_dev_ppp.patch
@@ -0,0 +1,34 @@
+From: Simon Peter <dn.tlp@gmx.net>
+Subject: Bug#306261: pppd does not properly close /dev/ppp on persist
+
+When using the kernel PPPoE driver, pppd never
+closes /dev/ppp when the link has come down.
+
+It opens superfluous fds to the device each time it re-opens the
+connection, with the unclosed ones falsely reported always ready for
+data by select().
+
+This makes pppd eat up 100% CPU time after the first persist because of
+the always instantly returning select() on the unclosed fds.
+
+The problem also occurs with the upstream version, but does not occur
+when a pty/tty device is used for the ppp connection.
+
+
+diff -u -r ppp-2.4.3/pppd/sys-linux.c ppp-2.4.3/pppd/sys-linux.c
+--- ppp-2.4.3/pppd/sys-linux.c 2005-04-29 20:08:37.000000000 +0200
++++ ppp-2.4.3/pppd/sys-linux.c 2005-04-29 20:07:03.000000000 +0200
+@@ -455,6 +455,13 @@
+ if (new_style_driver) {
+ int flags;
+
++ /* if a ppp_fd is already open, close it first */
++ if(ppp_fd > 0) {
++ close(ppp_fd);
++ remove_fd(ppp_fd);
++ ppp_fd = -1;
++ }
++
+ /* Open an instance of /dev/ppp and connect the channel to it */
+ if (ioctl(fd, PPPIOCGCHAN, &chindex) == -1) {
+ error("Couldn't get channel number: %m");
diff --git a/package/ppp/patches/200-makefile.patch b/package/ppp/patches/200-makefile.patch
new file mode 100644
index 000000000..df0f08e44
--- /dev/null
+++ b/package/ppp/patches/200-makefile.patch
@@ -0,0 +1,44 @@
+diff -Nur ppp-2.4.4.orig/pppd/Makefile.linux ppp-2.4.4/pppd/Makefile.linux
+--- ppp-2.4.4.orig/pppd/Makefile.linux 2006-06-04 07:07:46.000000000 +0200
++++ ppp-2.4.4/pppd/Makefile.linux 2007-10-04 08:53:26.000000000 +0200
+@@ -48,7 +48,7 @@
+ # Uncomment the next line to include support for PPP packet filtering.
+ # This requires that the libpcap library and headers be installed
+ # and that the kernel driver support PPP packet filtering.
+-FILTER=y
++#FILTER=y
+
+ # Uncomment the next line to enable multilink PPP (enabled by default)
+ # Linux distributions: Please leave multilink ENABLED in your builds
+@@ -58,9 +58,9 @@
+ # Uncomment the next line to enable the TDB database (enabled by default.)
+ # If you enable multilink, then TDB is automatically enabled also.
+ # Linux distributions: Please leave TDB ENABLED in your builds.
+-USE_TDB=y
++#USE_TDB=y
+
+-HAS_SHADOW=y
++#HAS_SHADOW=y
+ #USE_PAM=y
+ #HAVE_INET6=y
+
+@@ -77,7 +77,7 @@
+
+ INCLUDE_DIRS= -I../include
+
+-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
++COMPILE_FLAGS= -DHAVE_PATHS_H -DHAVE_MMAP
+
+ CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
+
+@@ -117,10 +117,8 @@
+ #LIBS += -lshadow $(LIBS)
+ endif
+
+-ifneq ($(wildcard /usr/include/crypt.h),)
+ CFLAGS += -DHAVE_CRYPT_H=1
+ LIBS += -lcrypt
+-endif
+
+ ifdef NEEDDES
+ ifndef USE_CRYPT
diff --git a/package/ppp/patches/201-mppe_mppc_1.1.patch b/package/ppp/patches/201-mppe_mppc_1.1.patch
new file mode 100644
index 000000000..c315656a2
--- /dev/null
+++ b/package/ppp/patches/201-mppe_mppc_1.1.patch
@@ -0,0 +1,1587 @@
+diff -ruN ppp-2.4.3.orig/include/linux/ppp-comp.h ppp-2.4.3/include/linux/ppp-comp.h
+--- ppp-2.4.3.orig/include/linux/ppp-comp.h 2002-12-06 10:49:15.000000000 +0100
++++ ppp-2.4.3/include/linux/ppp-comp.h 2004-11-21 13:54:09.000000000 +0100
+@@ -36,7 +36,7 @@
+ */
+
+ /*
+- * ==FILEVERSION 20020319==
++ * ==FILEVERSION 20020715==
+ *
+ * NOTE TO MAINTAINERS:
+ * If you modify this file at all, please set the above date.
+@@ -86,7 +86,7 @@
+
+ /* Compress a packet */
+ int (*compress) (void *state, unsigned char *rptr,
+- unsigned char *obuf, int isize, int osize);
++ unsigned char *obuf, int isize, int osize);
+
+ /* Return compression statistics */
+ void (*comp_stat) (void *state, struct compstat *stats);
+@@ -107,7 +107,7 @@
+
+ /* Decompress a packet. */
+ int (*decompress) (void *state, unsigned char *ibuf, int isize,
+- unsigned char *obuf, int osize);
++ unsigned char *obuf, int osize);
+
+ /* Update state for an incompressible packet received */
+ void (*incomp) (void *state, unsigned char *ibuf, int icnt);
+@@ -288,6 +288,33 @@
+ opts |= MPPE_OPT_UNKNOWN; \
+ } while (/* CONSTCOND */ 0)
+
++/* MPPE/MPPC definitions by J.D.*/
++#define MPPE_STATELESS MPPE_H_BIT /* configuration bit H */
++#define MPPE_40BIT MPPE_L_BIT /* configuration bit L */
++#define MPPE_56BIT MPPE_M_BIT /* configuration bit M */
++#define MPPE_128BIT MPPE_S_BIT /* configuration bit S */
++#define MPPE_MPPC MPPE_C_BIT /* configuration bit C */
++
++/*
++ * Definitions for Stac LZS.
++ */
++
++#define CI_LZS 17 /* config option for Stac LZS */
++#define CILEN_LZS 5 /* length of config option */
++
++#define LZS_OVHD 4 /* max. LZS overhead */
++#define LZS_HIST_LEN 2048 /* LZS history size */
++#define LZS_MAX_CCOUNT 0x0FFF /* max. coherency counter value */
++
++#define LZS_MODE_NONE 0
++#define LZS_MODE_LCB 1
++#define LZS_MODE_CRC 2
++#define LZS_MODE_SEQ 3
++#define LZS_MODE_EXT 4
++
++#define LZS_EXT_BIT_FLUSHED 0x80 /* bit A */
++#define LZS_EXT_BIT_COMP 0x20 /* bit C */
++
+ /*
+ * Definitions for other, as yet unsupported, compression methods.
+ */
+diff -ruN ppp-2.4.3.orig/include/net/ppp-comp.h ppp-2.4.3/include/net/ppp-comp.h
+--- ppp-2.4.3.orig/include/net/ppp-comp.h 2002-12-06 10:49:15.000000000 +0100
++++ ppp-2.4.3/include/net/ppp-comp.h 2004-11-21 13:54:09.000000000 +0100
+@@ -255,6 +255,33 @@
+ opts |= MPPE_OPT_UNKNOWN; \
+ } while (/* CONSTCOND */ 0)
+
++/* MPPE/MPPC definitions by J.D.*/
++#define MPPE_STATELESS MPPE_H_BIT /* configuration bit H */
++#define MPPE_40BIT MPPE_L_BIT /* configuration bit L */
++#define MPPE_56BIT MPPE_M_BIT /* configuration bit M */
++#define MPPE_128BIT MPPE_S_BIT /* configuration bit S */
++#define MPPE_MPPC MPPE_C_BIT /* configuration bit C */
++
++/*
++ * Definitions for Stac LZS.
++ */
++
++#define CI_LZS 17 /* config option for Stac LZS */
++#define CILEN_LZS 5 /* length of config option */
++
++#define LZS_OVHD 4 /* max. LZS overhead */
++#define LZS_HIST_LEN 2048 /* LZS history size */
++#define LZS_MAX_CCOUNT 0x0FFF /* max. coherency counter value */
++
++#define LZS_MODE_NONE 0
++#define LZS_MODE_LCB 1
++#define LZS_MODE_CRC 2
++#define LZS_MODE_SEQ 3
++#define LZS_MODE_EXT 4
++
++#define LZS_EXT_BIT_FLUSHED 0x80 /* bit A */
++#define LZS_EXT_BIT_COMP 0x20 /* bit C */
++
+ /*
+ * Definitions for other, as yet unsupported, compression methods.
+ */
+--- ppp-2.4.4/pppd/ccp.c.orig 2005-07-09 02:23:05.000000000 +0200
++++ ppp-2.4.4/pppd/ccp.c 2006-07-21 23:34:12.121546000 +0200
+@@ -62,12 +62,10 @@
+ static char bsd_value[8];
+ static char deflate_value[8];
+
+-/*
+- * Option variables.
+- */
+ #ifdef MPPE
+-bool refuse_mppe_stateful = 1; /* Allow stateful mode? */
+-#endif
++static int setmppe(char **);
++static int setnomppe(void);
++#endif /* MPPE */
+
+ static option_t ccp_option_list[] = {
+ { "noccp", o_bool, &ccp_protent.enabled_flag,
+@@ -108,54 +106,36 @@
+ "don't allow Predictor-1", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
+ &ccp_allowoptions[0].predictor_1 },
+
++ { "lzs", o_bool, &ccp_wantoptions[0].lzs,
++ "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_PRIO },
++ { "+lzs", o_bool, &ccp_wantoptions[0].lzs,
++ "request Stac LZS", 1, &ccp_allowoptions[0].lzs, OPT_ALIAS | OPT_PRIO },
++ { "nolzs", o_bool, &ccp_wantoptions[0].lzs,
++ "don't allow Stac LZS", OPT_PRIOSUB | OPT_A2CLR,
++ &ccp_allowoptions[0].lzs },
++ { "-lzs", o_bool, &ccp_wantoptions[0].lzs,
++ "don't allow Stac LZS", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
++ &ccp_allowoptions[0].lzs },
++
+ #ifdef MPPE
+- /* MPPE options are symmetrical ... we only set wantoptions here */
+- { "require-mppe", o_bool, &ccp_wantoptions[0].mppe,
+- "require MPPE encryption",
+- OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
+- { "+mppe", o_bool, &ccp_wantoptions[0].mppe,
+- "require MPPE encryption",
+- OPT_ALIAS | OPT_PRIO | MPPE_OPT_40 | MPPE_OPT_128 },
+- { "nomppe", o_bool, &ccp_wantoptions[0].mppe,
+- "don't allow MPPE encryption", OPT_PRIO },
+- { "-mppe", o_bool, &ccp_wantoptions[0].mppe,
+- "don't allow MPPE encryption", OPT_ALIAS | OPT_PRIO },
+-
+- /* We use ccp_allowoptions[0].mppe as a junk var ... it is reset later */
+- { "require-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
+- "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
+- &ccp_wantoptions[0].mppe },
+- { "+mppe-40", o_bool, &ccp_allowoptions[0].mppe,
+- "require MPPE 40-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_40,
+- &ccp_wantoptions[0].mppe },
+- { "nomppe-40", o_bool, &ccp_allowoptions[0].mppe,
+- "don't allow MPPE 40-bit encryption",
+- OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40, &ccp_wantoptions[0].mppe },
+- { "-mppe-40", o_bool, &ccp_allowoptions[0].mppe,
+- "don't allow MPPE 40-bit encryption",
+- OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_40,
+- &ccp_wantoptions[0].mppe },
+-
+- { "require-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
+- "require MPPE 128-bit encryption", OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
+- &ccp_wantoptions[0].mppe },
+- { "+mppe-128", o_bool, &ccp_allowoptions[0].mppe,
+- "require MPPE 128-bit encryption",
+- OPT_ALIAS | OPT_PRIO | OPT_A2OR | MPPE_OPT_128,
+- &ccp_wantoptions[0].mppe },
+- { "nomppe-128", o_bool, &ccp_allowoptions[0].mppe,
+- "don't allow MPPE 128-bit encryption",
+- OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128, &ccp_wantoptions[0].mppe },
+- { "-mppe-128", o_bool, &ccp_allowoptions[0].mppe,
+- "don't allow MPPE 128-bit encryption",
+- OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLRB | MPPE_OPT_128,
+- &ccp_wantoptions[0].mppe },
+-
+- /* strange one; we always request stateless, but will we allow stateful? */
+- { "mppe-stateful", o_bool, &refuse_mppe_stateful,
+- "allow MPPE stateful mode", OPT_PRIO },
+- { "nomppe-stateful", o_bool, &refuse_mppe_stateful,
+- "disallow MPPE stateful mode", OPT_PRIO | 1 },
++ { "mppc", o_bool, &ccp_wantoptions[0].mppc,
++ "request MPPC compression", 1, &ccp_allowoptions[0].mppc },
++ { "+mppc", o_bool, &ccp_wantoptions[0].mppc,
++ "request MPPC compression", 1, &ccp_allowoptions[0].mppc, OPT_ALIAS },
++ { "nomppc", o_bool, &ccp_wantoptions[0].mppc,
++ "don't allow MPPC compression", OPT_PRIOSUB | OPT_A2CLR,
++ &ccp_allowoptions[0].mppc },
++ { "-mppc", o_bool, &ccp_wantoptions[0].mppc,
++ "don't allow MPPC compression", OPT_ALIAS | OPT_PRIOSUB | OPT_A2CLR,
++ &ccp_allowoptions[0].mppc },
++ { "mppe", o_special, (void *)setmppe,
++ "request MPPE encryption" },
++ { "+mppe", o_special, (void *)setmppe,
++ "request MPPE encryption" },
++ { "nomppe", o_special_noarg, (void *)setnomppe,
++ "don't allow MPPE encryption" },
++ { "-mppe", o_special_noarg, (void *)setnomppe,
++ "don't allow MPPE encryption" },
+ #endif /* MPPE */
+
+ { NULL }
+@@ -241,7 +221,7 @@
+ */
+ #define ANY_COMPRESS(opt) ((opt).deflate || (opt).bsd_compress \
+ || (opt).predictor_1 || (opt).predictor_2 \
+- || (opt).mppe)
++ || (opt).lzs || (opt).mppc || (opt).mppe)
+
+ /*
+ * Local state (mainly for handling reset-reqs and reset-acks).
+@@ -344,6 +324,100 @@
+ return 1;
+ }
+
++#ifdef MPPE
++/*
++ * Functions called from config options
++ */
++/*
++ MPPE suboptions:
++ required - require MPPE; disconnect if peer doesn't support it
++ stateless - use stateless mode
++ no40 - disable 40 bit keys
++ no56 - disable 56 bit keys
++ no128 - disable 128 bit keys
++*/
++int setmppe(char **argv)
++{
++ int i;
++ char *str, cmdbuf[16];
++
++ ccp_allowoptions[0].mppe = 1;
++ ccp_allowoptions[0].mppe_40 = 1;
++ ccp_allowoptions[0].mppe_56 = 1;
++ ccp_allowoptions[0].mppe_128 = 1;
++ ccp_allowoptions[0].mppe_stateless = 0;
++ ccp_wantoptions[0].mppe = 0;
++
++ str = *argv;
++
++ while (1) {
++ i = 0;
++ memset(cmdbuf, '\0', 16);
++ while ((i < 16) && (*str != ',') && (*str != '\0'))
++ cmdbuf[i++] = *str++;
++ cmdbuf[i] = '\0';
++ if (!strncasecmp(cmdbuf, "no40", strlen("no40"))) {
++ ccp_allowoptions[0].mppe_40 = 0;
++ goto next_param;
++ } else if (!strncasecmp(cmdbuf, "no56", strlen("no56"))) {
++ ccp_allowoptions[0].mppe_56 = 0;
++ goto next_param;
++ } else if (!strncasecmp(cmdbuf, "no128", strlen("no128"))) {
++ ccp_allowoptions[0].mppe_128 = 0;
++ goto next_param;
++ } else if (!strncasecmp(cmdbuf, "stateless", strlen("stateless"))) {
++ ccp_allowoptions[0].mppe_stateless = 1;
++ goto next_param;
++ } else if (!strncasecmp(cmdbuf, "required", strlen("required"))) {
++ ccp_wantoptions[0].mppe = 1;
++ goto next_param;
++ } else {
++ option_error("invalid parameter '%s' for mppe option", cmdbuf);
++ return 0;
++ }
++
++ next_param:
++ if (*str == ',') {
++ str++;
++ continue;
++ }
++ if (*str == '\0') {
++ if (!(ccp_allowoptions[0].mppe_40 || ccp_allowoptions[0].mppe_56 ||
++ ccp_allowoptions[0].mppe_128)) {
++ if (ccp_wantoptions[0].mppe == 1) {
++ option_error("You require MPPE but you have switched off "
++ "all encryption key lengths.");
++ return 0;
++ }
++ ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0;
++ ccp_wantoptions[0].mppe_stateless =
++ ccp_allowoptions[0].mppe_stateless = 0;
++ } else {
++ ccp_allowoptions[0].mppe = 1;
++ ccp_wantoptions[0].mppe_stateless =
++ ccp_allowoptions[0].mppe_stateless;
++ if (ccp_wantoptions[0].mppe == 1) {
++ ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40;
++ ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56;
++ ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128;
++ }
++ }
++ return 1;
++ }
++ }
++}
++
++int setnomppe(void)
++{
++ ccp_wantoptions[0].mppe = ccp_allowoptions[0].mppe = 0;
++ ccp_wantoptions[0].mppe_40 = ccp_allowoptions[0].mppe_40 = 0;
++ ccp_wantoptions[0].mppe_56 = ccp_allowoptions[0].mppe_56 = 0;
++ ccp_wantoptions[0].mppe_128 = ccp_allowoptions[0].mppe_128 = 0;
++ ccp_wantoptions[0].mppe_stateless = ccp_allowoptions[0].mppe_stateless = 0;
++ return 1;
++}
++#endif /* MPPE */
++
+ /*
+ * ccp_init - initialize CCP.
+ */
+@@ -378,6 +452,30 @@
+ ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS;
+
+ ccp_allowoptions[0].predictor_1 = 1;
++
++ ccp_wantoptions[0].lzs = 0; /* Stac LZS - will be enabled in the future */
++ ccp_wantoptions[0].lzs_mode = LZS_MODE_SEQ;
++ ccp_wantoptions[0].lzs_hists = 1;
++ ccp_allowoptions[0].lzs = 0; /* Stac LZS - will be enabled in the future */
++ ccp_allowoptions[0].lzs_mode = LZS_MODE_SEQ;
++ ccp_allowoptions[0].lzs_hists = 1;
++
++#ifdef MPPE
++ /* by default allow and request MPPC... */
++ ccp_wantoptions[0].mppc = ccp_allowoptions[0].mppc = 1;
++
++ /* ... and allow but don't request MPPE */
++ ccp_allowoptions[0].mppe = 1;
++ ccp_allowoptions[0].mppe_40 = 1;
++ ccp_allowoptions[0].mppe_56 = 1;
++ ccp_allowoptions[0].mppe_128 = 1;
++ ccp_allowoptions[0].mppe_stateless = 1;
++ ccp_wantoptions[0].mppe = 0;
++ ccp_wantoptions[0].mppe_40 = 0;
++ ccp_wantoptions[0].mppe_56 = 0;
++ ccp_wantoptions[0].mppe_128 = 0;
++ ccp_wantoptions[0].mppe_stateless = 0;
++#endif /* MPPE */
+ }
+
+ /*
+@@ -455,11 +553,11 @@
+ if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) {
+ notice("Compression disabled by peer.");
+ #ifdef MPPE
+- if (ccp_gotoptions[unit].mppe) {
++ if (ccp_wantoptions[unit].mppe) {
+ error("MPPE disabled, closing LCP");
+ lcp_close(unit, "MPPE disabled by peer");
+ }
+-#endif
++#endif /* MPPE */
+ }
+
+ /*
+@@ -487,6 +585,15 @@
+ break;
+ /* send a reset-ack, which the transmitter will see and
+ reset its compression state. */
++
++ /* In case of MPPE/MPPC or LZS we shouldn't send CCP_RESETACK,
++ but we do it in order to reset compressor; CCP_RESETACK is
++ then silently discarded. See functions ppp_send_frame and
++ ppp_ccp_peek in ppp_generic.c (Linux only !!!). All the
++ confusion is caused by the fact that CCP code is splited
++ into two parts - one part is handled by pppd, the other one
++ is handled by kernel. */
++
+ fsm_sdata(f, CCP_RESETACK, id, NULL, 0);
+ break;
+
+@@ -515,12 +622,11 @@
+ fsm_lowerdown(&ccp_fsm[unit]);
+
+ #ifdef MPPE
+- if (ccp_gotoptions[unit].mppe) {
++ if (ccp_wantoptions[unit].mppe) {
+ error("MPPE required but peer negotiation failed");
+ lcp_close(unit, "MPPE required but peer negotiation failed");
+ }
+-#endif
+-
++#endif /* MPPE */
+ }
+
+ /*
+@@ -537,7 +643,7 @@
+ all_rejected[f->unit] = 0;
+
+ #ifdef MPPE
+- if (go->mppe) {
++ if (go->mppe || go->mppc) {
+ ccp_options *ao = &ccp_allowoptions[f->unit];
+ int auth_mschap_bits = auth_done[f->unit];
+ int numbits;
+@@ -551,80 +657,109 @@
+ * NB: If MPPE is required, all other compression opts are invalid.
+ * So, we return right away if we can't do it.
+ */
++ if (ccp_wantoptions[f->unit].mppe) {
++ /* Leave only the mschap auth bits set */
++ auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
++ CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
++ /* Count the mschap auths */
++ auth_mschap_bits >>= CHAP_MS_SHIFT;
++ numbits = 0;
++ do {
++ numbits += auth_mschap_bits & 1;
++ auth_mschap_bits >>= 1;
++ } while (auth_mschap_bits);
++ if (numbits > 1) {
++ error("MPPE required, but auth done in both directions.");
++ lcp_close(f->unit, "MPPE required but not available");
++ return;
++ }
++ if (!numbits) {
++ error("MPPE required, but MS-CHAP[v2] auth not performed.");
++ lcp_close(f->unit, "MPPE required but not available");
++ return;
++ }
+
+- /* Leave only the mschap auth bits set */
+- auth_mschap_bits &= (CHAP_MS_WITHPEER | CHAP_MS_PEER |
+- CHAP_MS2_WITHPEER | CHAP_MS2_PEER);
+- /* Count the mschap auths */
+- auth_mschap_bits >>= CHAP_MS_SHIFT;
+- numbits = 0;
+- do {
+- numbits += auth_mschap_bits & 1;
+- auth_mschap_bits >>= 1;
+- } while (auth_mschap_bits);
+- if (numbits > 1) {
+- error("MPPE required, but auth done in both directions.");
+- lcp_close(f->unit, "MPPE required but not available");
+- return;
+- }
+- if (!numbits) {
+- error("MPPE required, but MS-CHAP[v2] auth not performed.");
+- lcp_close(f->unit, "MPPE required but not available");
+- return;
+- }
+-
+- /* A plugin (eg radius) may not have obtained key material. */
+- if (!mppe_keys_set) {
+- error("MPPE required, but keys are not available. "
+- "Possible plugin problem?");
+- lcp_close(f->unit, "MPPE required but not available");
+- return;
+- }
+-
+- /* LM auth not supported for MPPE */
+- if (auth_done[f->unit] & (CHAP_MS_WITHPEER | CHAP_MS_PEER)) {
+- /* This might be noise */
+- if (go->mppe & MPPE_OPT_40) {
+- notice("Disabling 40-bit MPPE; MS-CHAP LM not supported");
+- go->mppe &= ~MPPE_OPT_40;
+- ccp_wantoptions[f->unit].mppe &= ~MPPE_OPT_40;
++ /* A plugin (eg radius) may not have obtained key material. */
++ if (!mppe_keys_set) {
++ error("MPPE required, but keys are not available. "
++ "Possible plugin problem?");
++ lcp_close(f->unit, "MPPE required but not available");
++ return;
+ }
+ }
+
+- /* Last check: can we actually negotiate something? */
+- if (!(go->mppe & (MPPE_OPT_40 | MPPE_OPT_128))) {
+- /* Could be misconfig, could be 40-bit disabled above. */
+- error("MPPE required, but both 40-bit and 128-bit disabled.");
+- lcp_close(f->unit, "MPPE required but not available");
+- return;
++ /*
++ * Check whether the kernel knows about the various
++ * compression methods we might request. Key material
++ * unimportant here.
++ */
++ if (go->mppc) {
++ opt_buf[0] = CI_MPPE;
++ opt_buf[1] = CILEN_MPPE;
++ opt_buf[2] = 0;
++ opt_buf[3] = 0;
++ opt_buf[4] = 0;
++ opt_buf[5] = MPPE_MPPC;
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 0) <= 0)
++ go->mppc = 0;
++ }
++ if (go->mppe_40) {
++ opt_buf[0] = CI_MPPE;
++ opt_buf[1] = CILEN_MPPE;
++ opt_buf[2] = MPPE_STATELESS;
++ opt_buf[3] = 0;
++ opt_buf[4] = 0;
++ opt_buf[5] = MPPE_40BIT;
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
++ go->mppe_40 = 0;
++ }
++ if (go->mppe_56) {
++ opt_buf[0] = CI_MPPE;
++ opt_buf[1] = CILEN_MPPE;
++ opt_buf[2] = MPPE_STATELESS;
++ opt_buf[3] = 0;
++ opt_buf[4] = 0;
++ opt_buf[5] = MPPE_56BIT;
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
++ go->mppe_56 = 0;
++ }
++ if (go->mppe_128) {
++ opt_buf[0] = CI_MPPE;
++ opt_buf[1] = CILEN_MPPE;
++ opt_buf[2] = MPPE_STATELESS;
++ opt_buf[3] = 0;
++ opt_buf[4] = 0;
++ opt_buf[5] = MPPE_128BIT;
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0)
++ go->mppe_128 = 0;
++ }
++ if (!go->mppe_40 && !go->mppe_56 && !go->mppe_128) {
++ if (ccp_wantoptions[f->unit].mppe) {
++ error("MPPE required, but kernel has no support.");
++ lcp_close(f->unit, "MPPE required but not available");
++ }
++ go->mppe = go->mppe_stateless = 0;
++ } else {
++ /* MPPE is not compatible with other compression types */
++ if (ccp_wantoptions[f->unit].mppe) {
++ ao->bsd_compress = go->bsd_compress = 0;
++ ao->predictor_1 = go->predictor_1 = 0;
++ ao->predictor_2 = go->predictor_2 = 0;
++ ao->deflate = go->deflate = 0;
++ ao->lzs = go->lzs = 0;
++ }
+ }
+-
+- /* sync options */
+- ao->mppe = go->mppe;
+- /* MPPE is not compatible with other compression types */
+- ao->bsd_compress = go->bsd_compress = 0;
+- ao->predictor_1 = go->predictor_1 = 0;
+- ao->predictor_2 = go->predictor_2 = 0;
+- ao->deflate = go->deflate = 0;
+ }
+ #endif /* MPPE */
+-
+- /*
+- * Check whether the kernel knows about the various
+- * compression methods we might request.
+- */
+-#ifdef MPPE
+- if (go->mppe) {
+- opt_buf[0] = CI_MPPE;
+- opt_buf[1] = CILEN_MPPE;
+- MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
+- /* Key material unimportant here. */
+- if (ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0) <= 0) {
+- error("MPPE required, but kernel has no support.");
+- lcp_close(f->unit, "MPPE required but not available");
+- }
++ if (go->lzs) {
++ opt_buf[0] = CI_LZS;
++ opt_buf[1] = CILEN_LZS;
++ opt_buf[2] = go->lzs_hists >> 8;
++ opt_buf[3] = go->lzs_hists & 0xff;
++ opt_buf[4] = LZS_MODE_SEQ;
++ if (ccp_test(f->unit, opt_buf, CILEN_LZS, 0) <= 0)
++ go->lzs = 0;
+ }
+-#endif
+ if (go->bsd_compress) {
+ opt_buf[0] = CI_BSD_COMPRESS;
+ opt_buf[1] = CILEN_BSD_COMPRESS;
+@@ -679,7 +814,8 @@
+ + (go->deflate? CILEN_DEFLATE: 0)
+ + (go->predictor_1? CILEN_PREDICTOR_1: 0)
+ + (go->predictor_2? CILEN_PREDICTOR_2: 0)
+- + (go->mppe? CILEN_MPPE: 0);
++ + (go->lzs? CILEN_LZS: 0)
++ + ((go->mppe || go->mppc)? CILEN_MPPE: 0);
+ }
+
+ /*
+@@ -693,6 +829,8 @@
+ {
+ int res;
+ ccp_options *go = &ccp_gotoptions[f->unit];
++ ccp_options *ao = &ccp_allowoptions[f->unit];
++ ccp_options *wo = &ccp_wantoptions[f->unit];
+ u_char *p0 = p;
+
+ /*
+@@ -701,22 +839,43 @@
+ * in case it gets Acked.
+ */
+ #ifdef MPPE
+- if (go->mppe) {
++ if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
+ u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
+
+- p[0] = opt_buf[0] = CI_MPPE;
+- p[1] = opt_buf[1] = CILEN_MPPE;
+- MPPE_OPTS_TO_CI(go->mppe, &p[2]);
+- MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
++ p[0] = CI_MPPE;
++ p[1] = CILEN_MPPE;
++ p[2] = (go->mppe_stateless ? MPPE_STATELESS : 0);
++ p[3] = 0;
++ p[4] = 0;
++ p[5] = (go->mppe_40 ? MPPE_40BIT : 0) | (go->mppe_56 ? MPPE_56BIT : 0) |
++ (go->mppe_128 ? MPPE_128BIT : 0) | (go->mppc ? MPPE_MPPC : 0);
++
++ BCOPY(p, opt_buf, CILEN_MPPE);
+ BCOPY(mppe_recv_key, &opt_buf[CILEN_MPPE], MPPE_MAX_KEY_LEN);
+ res = ccp_test(f->unit, opt_buf, CILEN_MPPE + MPPE_MAX_KEY_LEN, 0);
+- if (res > 0)
++ if (res > 0) {
+ p += CILEN_MPPE;
+- else
++ } else {
+ /* This shouldn't happen, we've already tested it! */
+- lcp_close(f->unit, "MPPE required but not available in kernel");
++ go->mppe = go->mppe_40 = go->mppe_56 = go->mppe_128 =
++ go->mppe_stateless = go->mppc = 0;
++ if (ccp_wantoptions[f->unit].mppe)
++ lcp_close(f->unit, "MPPE required but not available in kernel");
++ }
++ }
++#endif /* MPPE */
++ if (go->lzs) {
++ p[0] = CI_LZS;
++ p[1] = CILEN_LZS;
++ p[2] = go->lzs_hists >> 8;
++ p[3] = go->lzs_hists & 0xff;
++ p[4] = LZS_MODE_SEQ;
++ res = ccp_test(f->unit, p, CILEN_LZS, 0);
++ if (res > 0) {
++ p += CILEN_LZS;
++ } else
++ go->lzs = 0;
+ }
+-#endif
+ if (go->deflate) {
+ p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT;
+ p[1] = CILEN_DEFLATE;
+@@ -802,7 +961,7 @@
+
+ /*
+ * ccp_ackci - process a received configure-ack, and return
+- * 1 iff the packet was OK.
++ * 1 if the packet was OK.
+ */
+ static int
+ ccp_ackci(f, p, len)
+@@ -811,24 +970,44 @@
+ int len;
+ {
+ ccp_options *go = &ccp_gotoptions[f->unit];
++ ccp_options *ao = &ccp_allowoptions[f->unit];
++ ccp_options *wo = &ccp_wantoptions[f->unit];
+ u_char *p0 = p;
+
+ #ifdef MPPE
+- if (go->mppe) {
+- u_char opt_buf[CILEN_MPPE];
+-
+- opt_buf[0] = CI_MPPE;
+- opt_buf[1] = CILEN_MPPE;
+- MPPE_OPTS_TO_CI(go->mppe, &opt_buf[2]);
+- if (len < CILEN_MPPE || memcmp(opt_buf, p, CILEN_MPPE))
++ if (go->mppe || go->mppc || (!wo->mppe && ao->mppe)) {
++ if (len < CILEN_MPPE
++ || p[1] != CILEN_MPPE || p[0] != CI_MPPE
++ || p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0)
++ || p[3] != 0
++ || p[4] != 0
++ || (p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
++ (go->mppc ? MPPE_MPPC : 0))
++ && p[5] != ((go->mppe_56 ? MPPE_56BIT : 0) |
++ (go->mppc ? MPPE_MPPC : 0))
++ && p[5] != ((go->mppe_128 ? MPPE_128BIT : 0) |
++ (go->mppc ? MPPE_MPPC : 0))))
+ return 0;
++ if (go->mppe_40 || go->mppe_56 || go->mppe_128)
++ go->mppe = 1;
+ p += CILEN_MPPE;
+ len -= CILEN_MPPE;
++ /* Cope with first/fast ack */
++ if (p == p0 && len == 0)
++ return 1;
++ }
++#endif /* MPPE */
++ if (go->lzs) {
++ if (len < CILEN_LZS || p[0] != CI_LZS || p[1] != CILEN_LZS
++ || p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff)
++ || p[4] != LZS_MODE_SEQ)
++ return 0;
++ p += CILEN_LZS;
++ len -= CILEN_LZS;
+ /* XXX Cope with first/fast ack */
+- if (len == 0)
++ if (p == p0 && len == 0)
+ return 1;
+ }
+-#endif
+ if (go->deflate) {
+ if (len < CILEN_DEFLATE
+ || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
+@@ -891,7 +1070,7 @@
+
+ /*
+ * ccp_nakci - process received configure-nak.
+- * Returns 1 iff the nak was OK.
++ * Returns 1 if the nak was OK.
+ */
+ static int
+ ccp_nakci(f, p, len, treat_as_reject)
+@@ -901,6 +1080,8 @@
+ int treat_as_reject;
+ {
+ ccp_options *go = &ccp_gotoptions[f->unit];
++ ccp_options *ao = &ccp_allowoptions[f->unit];
++ ccp_options *wo = &ccp_wantoptions[f->unit];
+ ccp_options no; /* options we've seen already */
+ ccp_options try; /* options to ask for next time */
+
+@@ -908,28 +1089,100 @@
+ try = *go;
+
+ #ifdef MPPE
+- if (go->mppe && len >= CILEN_MPPE
+- && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
+- no.mppe = 1;
+- /*
+- * Peer wants us to use a different strength or other setting.
+- * Fail if we aren't willing to use his suggestion.
+- */
+- MPPE_CI_TO_OPTS(&p[2], try.mppe);
+- if ((try.mppe & MPPE_OPT_STATEFUL) && refuse_mppe_stateful) {
+- error("Refusing MPPE stateful mode offered by peer");
+- try.mppe = 0;
+- } else if (((go->mppe | MPPE_OPT_STATEFUL) & try.mppe) != try.mppe) {
+- /* Peer must have set options we didn't request (suggest) */
+- try.mppe = 0;
+- }
++ if ((go->mppe || go->mppc || (!wo->mppe && ao->mppe)) &&
++ len >= CILEN_MPPE && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
+
+- if (!try.mppe) {
+- error("MPPE required but peer negotiation failed");
+- lcp_close(f->unit, "MPPE required but peer negotiation failed");
++ if (go->mppc) {
++ no.mppc = 1;
++ if (!(p[5] & MPPE_MPPC))
++ try.mppc = 0;
++ }
++
++ if (go->mppe)
++ no.mppe = 1;
++ if (go->mppe_40)
++ no.mppe_40 = 1;
++ if (go->mppe_56)
++ no.mppe_56 = 1;
++ if (go->mppe_128)
++ no.mppe_128 = 1;
++ if (go->mppe_stateless)
++ no.mppe_stateless = 1;
++
++ if (ao->mppe_40) {
++ if ((p[5] & MPPE_40BIT))
++ try.mppe_40 = 1;
++ else
++ try.mppe_40 = (p[5] == 0) ? 1 : 0;
++ }
++ if (ao->mppe_56) {
++ if ((p[5] & MPPE_56BIT))
++ try.mppe_56 = 1;
++ else
++ try.mppe_56 = (p[5] == 0) ? 1 : 0;
++ }
++ if (ao->mppe_128) {
++ if ((p[5] & MPPE_128BIT))
++ try.mppe_128 = 1;
++ else
++ try.mppe_128 = (p[5] == 0) ? 1 : 0;
++ }
++
++ if (ao->mppe_stateless) {
++ if ((p[2] & MPPE_STATELESS) || wo->mppe_stateless)
++ try.mppe_stateless = 1;
++ else
++ try.mppe_stateless = 0;
++ }
++
++ if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128) {
++ try.mppe = try.mppe_stateless = 0;
++ if (wo->mppe) {
++ /* we require encryption, but peer doesn't support it
++ so we close connection */
++ wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
++ wo->mppe_56 = wo->mppe_128 = 0;
++ lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
++ "key length");
++ }
++ }
++ if (wo->mppe && (wo->mppe_40 != try.mppe_40) &&
++ (wo->mppe_56 != try.mppe_56) && (wo->mppe_128 != try.mppe_128)) {
++ /* cannot negotiate key length */
++ wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
++ wo->mppe_56 = wo->mppe_128 = 0;
++ lcp_close(f->unit, "Cannot negotiate MPPE key length");
+ }
++ if (try.mppe_40 && try.mppe_56 && try.mppe_128)
++ try.mppe_40 = try.mppe_56 = 0;
++ else
++ if (try.mppe_56 && try.mppe_128)
++ try.mppe_56 = 0;
++ else
++ if (try.mppe_40 && try.mppe_128)
++ try.mppe_40 = 0;
++ else
++ if (try.mppe_40 && try.mppe_56)
++ try.mppe_40 = 0;
++
++ p += CILEN_MPPE;
++ len -= CILEN_MPPE;
+ }
+ #endif /* MPPE */
++
++ if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
++ no.lzs = 1;
++ if (((p[2]<<8)|p[3]) > 1 || (p[4] != LZS_MODE_SEQ &&
++ p[4] != LZS_MODE_EXT))
++ try.lzs = 0;
++ else {
++ try.lzs_mode = p[4];
++ try.lzs_hists = (p[2] << 8) | p[3];
++ }
++ p += CILEN_LZS;
++ len -= CILEN_LZS;
++ }
++
+ if (go->deflate && len >= CILEN_DEFLATE
+ && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT)
+ && p[1] == CILEN_DEFLATE) {
+@@ -1002,14 +1255,50 @@
+ return -1;
+
+ #ifdef MPPE
+- if (go->mppe && len >= CILEN_MPPE
++ if ((go->mppe || go->mppc) && len >= CILEN_MPPE
+ && p[0] == CI_MPPE && p[1] == CILEN_MPPE) {
+- error("MPPE required but peer refused");
+- lcp_close(f->unit, "MPPE required but peer refused");
++ ccp_options *wo = &ccp_wantoptions[f->unit];
++ if (p[2] != (go->mppe_stateless ? MPPE_STATELESS : 0) ||
++ p[3] != 0 ||
++ p[4] != 0 ||
++ p[5] != ((go->mppe_40 ? MPPE_40BIT : 0) |
++ (go->mppe_56 ? MPPE_56BIT : 0) |
++ (go->mppe_128 ? MPPE_128BIT : 0) |
++ (go->mppc ? MPPE_MPPC : 0)))
++ return 0;
++ if (go->mppc)
++ try.mppc = 0;
++ if (go->mppe) {
++ try.mppe = 0;
++ if (go->mppe_40)
++ try.mppe_40 = 0;
++ if (go->mppe_56)
++ try.mppe_56 = 0;
++ if (go->mppe_128)
++ try.mppe_128 = 0;
++ if (go->mppe_stateless)
++ try.mppe_stateless = 0;
++ if (!try.mppe_56 && !try.mppe_40 && !try.mppe_128)
++ try.mppe = try.mppe_stateless = 0;
++ if (wo->mppe) { /* we want MPPE but cannot negotiate key length */
++ wo->mppc = wo->mppe = wo->mppe_stateless = wo->mppe_40 =
++ wo->mppe_56 = wo->mppe_128 = 0;
++ lcp_close(f->unit, "MPPE required but cannot negotiate MPPE "
++ "key length");
++ }
++ }
+ p += CILEN_MPPE;
+ len -= CILEN_MPPE;
+ }
+-#endif
++#endif /* MPPE */
++ if (go->lzs && len >= CILEN_LZS && p[0] == CI_LZS && p[1] == CILEN_LZS) {
++ if (p[2] != go->lzs_hists>>8 || p[3] != (go->lzs_hists&0xff)
++ || p[4] != go->lzs_mode)
++ return 0;
++ try.lzs = 0;
++ p += CILEN_LZS;
++ len -= CILEN_LZS;
++ }
+ if (go->deflate_correct && len >= CILEN_DEFLATE
+ && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) {
+ if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size)
+@@ -1073,14 +1362,15 @@
+ int dont_nak;
+ {
+ int ret, newret, res;
+- u_char *p0, *retp;
++ u_char *p0, *retp, p2, p5;
+ int len, clen, type, nb;
+ ccp_options *ho = &ccp_hisoptions[f->unit];
+ ccp_options *ao = &ccp_allowoptions[f->unit];
++ ccp_options *wo = &ccp_wantoptions[f->unit];
+ #ifdef MPPE
+- bool rej_for_ci_mppe = 1; /* Are we rejecting based on a bad/missing */
+- /* CI_MPPE, or due to other options? */
+-#endif
++ u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
++/* int mtu; */
++#endif /* MPPE */
+
+ ret = CONFACK;
+ retp = p0 = p;
+@@ -1103,106 +1393,307 @@
+ switch (type) {
+ #ifdef MPPE
+ case CI_MPPE:
+- if (!ao->mppe || clen != CILEN_MPPE) {
++ if ((!ao->mppc && !ao->mppe) || clen != CILEN_MPPE) {
+ newret = CONFREJ;
+ break;
+ }
+- MPPE_CI_TO_OPTS(&p[2], ho->mppe);
+
+- /* Nak if anything unsupported or unknown are set. */
+- if (ho->mppe & MPPE_OPT_UNSUPPORTED) {
+- newret = CONFNAK;
+- ho->mppe &= ~MPPE_OPT_UNSUPPORTED;
+- }
+- if (ho->mppe & MPPE_OPT_UNKNOWN) {
++ p2 = p[2];
++ p5 = p[5];
++ /* not sure what they want, tell 'em what we got */
++ if (((p[2] & ~MPPE_STATELESS) != 0 || p[3] != 0 || p[4] != 0 ||
++ (p[5] & ~(MPPE_40BIT | MPPE_56BIT | MPPE_128BIT |
++ MPPE_MPPC)) != 0 || p[5] == 0) ||
++ (p[2] == 0 && p[3] == 0 && p[4] == 0 && p[5] == 0)) {
+ newret = CONFNAK;
+- ho->mppe &= ~MPPE_OPT_UNKNOWN;
++ p[2] = (wo->mppe_stateless ? MPPE_STATELESS : 0);
++ p[3] = 0;
++ p[4] = 0;
++ p[5] = (wo->mppe_40 ? MPPE_40BIT : 0) |
++ (wo->mppe_56 ? MPPE_56BIT : 0) |
++ (wo->mppe_128 ? MPPE_128BIT : 0) |
++ (wo->mppc ? MPPE_MPPC : 0);
++ break;
+ }
+
+- /* Check state opt */
+- if (ho->mppe & MPPE_OPT_STATEFUL) {
+- /*
+- * We can Nak and request stateless, but it's a
+- * lot easier to just assume the peer will request
+- * it if he can do it; stateful mode is bad over
+- * the Internet -- which is where we expect MPPE.
+- */
+- if (refuse_mppe_stateful) {
+- error("Refusing MPPE stateful mode offered by peer");
++ if ((p[5] & MPPE_MPPC)) {
++ if (ao->mppc) {
++ ho->mppc = 1;
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ opt_buf[2] = opt_buf[3] = opt_buf[4] = 0;
++ opt_buf[5] = MPPE_MPPC;
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE, 1) <= 0) {
++ ho->mppc = 0;
++ p[5] &= ~MPPE_MPPC;
++ newret = CONFNAK;
++ }
++ } else {
+ newret = CONFREJ;
+- break;
++ if (wo->mppe || ao->mppe) {
++ p[5] &= ~MPPE_MPPC;
++ newret = CONFNAK;
++ }
++ }
++ }
++
++ if (ao->mppe)
++ ho->mppe = 1;
++
++ if ((p[2] & MPPE_STATELESS)) {
++ if (ao->mppe_stateless) {
++ if (wo->mppe_stateless)
++ ho->mppe_stateless = 1;
++ else {
++ newret = CONFNAK;
++ if (!dont_nak)
++ p[2] &= ~MPPE_STATELESS;
++ }
++ } else {
++ newret = CONFNAK;
++ if (!dont_nak)
++ p[2] &= ~MPPE_STATELESS;
++ }
++ } else {
++ if (wo->mppe_stateless && !dont_nak) {
++ wo->mppe_stateless = 0;
++ newret = CONFNAK;
++ p[2] |= MPPE_STATELESS;
+ }
+ }
+
+- /* Find out which of {S,L} are set. */
+- if ((ho->mppe & MPPE_OPT_128)
+- && (ho->mppe & MPPE_OPT_40)) {
+- /* Both are set, negotiate the strongest. */
++ if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT|MPPE_128BIT)) {
+ newret = CONFNAK;
+- if (ao->mppe & MPPE_OPT_128)
+- ho->mppe &= ~MPPE_OPT_40;
+- else if (ao->mppe & MPPE_OPT_40)
+- ho->mppe &= ~MPPE_OPT_128;
+- else {
+- newret = CONFREJ;
+- break;
++ if (ao->mppe_128) {
++ ho->mppe_128 = 1;
++ p[5] &= ~(MPPE_40BIT|MPPE_56BIT);
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++ MPPE_MAX_KEY_LEN);
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++ MPPE_MAX_KEY_LEN, 1) <= 0) {
++ ho->mppe_128 = 0;
++ p[5] |= (MPPE_40BIT|MPPE_56BIT);
++ p[5] &= ~MPPE_128BIT;
++ goto check_mppe_56_40;
++ }
++ goto check_mppe;
+ }
+- } else if (ho->mppe & MPPE_OPT_128) {
+- if (!(ao->mppe & MPPE_OPT_128)) {
+- newret = CONFREJ;
+- break;
++ p[5] &= ~MPPE_128BIT;
++ goto check_mppe_56_40;
++ }
++ if ((p[5] & ~MPPE_MPPC) == (MPPE_56BIT|MPPE_128BIT)) {
++ newret = CONFNAK;
++ if (ao->mppe_128) {
++ ho->mppe_128 = 1;
++ p[5] &= ~MPPE_56BIT;
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++ MPPE_MAX_KEY_LEN);
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++ MPPE_MAX_KEY_LEN, 1) <= 0) {
++ ho->mppe_128 = 0;
++ p[5] |= MPPE_56BIT;
++ p[5] &= ~MPPE_128BIT;
++ goto check_mppe_56;
++ }
++ goto check_mppe;
+ }
+- } else if (ho->mppe & MPPE_OPT_40) {
+- if (!(ao->mppe & MPPE_OPT_40)) {
+- newret = CONFREJ;
+- break;
++ p[5] &= ~MPPE_128BIT;
++ goto check_mppe_56;
++ }
++ if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_128BIT)) {
++ newret = CONFNAK;
++ if (ao->mppe_128) {
++ ho->mppe_128 = 1;
++ p[5] &= ~MPPE_40BIT;
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++ MPPE_MAX_KEY_LEN);
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++ MPPE_MAX_KEY_LEN, 1) <= 0) {
++ ho->mppe_128 = 0;
++ p[5] |= MPPE_40BIT;
++ p[5] &= ~MPPE_128BIT;
++ goto check_mppe_40;
++ }
++ goto check_mppe;
++ }
++ p[5] &= ~MPPE_128BIT;
++ goto check_mppe_40;
++ }
++ if ((p[5] & ~MPPE_MPPC) == MPPE_128BIT) {
++ if (ao->mppe_128) {
++ ho->mppe_128 = 1;
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++ MPPE_MAX_KEY_LEN);
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++ MPPE_MAX_KEY_LEN, 1) <= 0) {
++ ho->mppe_128 = 0;
++ p[5] &= ~MPPE_128BIT;
++ newret = CONFNAK;
++ }
++ goto check_mppe;
++ }
++ p[5] &= ~MPPE_128BIT;
++ newret = CONFNAK;
++ goto check_mppe;
++ }
++ check_mppe_56_40:
++ if ((p[5] & ~MPPE_MPPC) == (MPPE_40BIT|MPPE_56BIT)) {
++ newret = CONFNAK;
++ if (ao->mppe_56) {
++ ho->mppe_56 = 1;
++ p[5] &= ~MPPE_40BIT;
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++ MPPE_MAX_KEY_LEN);
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++ MPPE_MAX_KEY_LEN, 1) <= 0) {
++ ho->mppe_56 = 0;
++ p[5] |= MPPE_40BIT;
++ p[5] &= ~MPPE_56BIT;
++ newret = CONFNAK;
++ goto check_mppe_40;
++ }
++ goto check_mppe;
++ }
++ p[5] &= ~MPPE_56BIT;
++ goto check_mppe_40;
++ }
++ check_mppe_56:
++ if ((p[5] & ~MPPE_MPPC) == MPPE_56BIT) {
++ if (ao->mppe_56) {
++ ho->mppe_56 = 1;
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++ MPPE_MAX_KEY_LEN);
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++ MPPE_MAX_KEY_LEN, 1) <= 0) {
++ ho->mppe_56 = 0;
++ p[5] &= ~MPPE_56BIT;
++ newret = CONFNAK;
++ }
++ goto check_mppe;
++ }
++ p[5] &= ~MPPE_56BIT;
++ newret = CONFNAK;
++ goto check_mppe;
++ }
++ check_mppe_40:
++ if ((p[5] & ~MPPE_MPPC) == MPPE_40BIT) {
++ if (ao->mppe_40) {
++ ho->mppe_40 = 1;
++ BCOPY(p, opt_buf, CILEN_MPPE);
++ BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
++ MPPE_MAX_KEY_LEN);
++ if (ccp_test(f->unit, opt_buf, CILEN_MPPE +
++ MPPE_MAX_KEY_LEN, 1) <= 0) {
++ ho->mppe_40 = 0;
++ p[5] &= ~MPPE_40BIT;
++ newret = CONFNAK;
++ }
++ goto check_mppe;
++ }
++ p[5] &= ~MPPE_40BIT;
++ }
++
++ check_mppe:
++ if (!ho->mppe_40 && !ho->mppe_56 && !ho->mppe_128) {
++ if (wo->mppe_40 || wo->mppe_56 || wo->mppe_128) {
++ newret = CONFNAK;
++ p[2] |= (wo->mppe_stateless ? MPPE_STATELESS : 0);
++ p[5] |= (wo->mppe_40 ? MPPE_40BIT : 0) |
++ (wo->mppe_56 ? MPPE_56BIT : 0) |
++ (wo->mppe_128 ? MPPE_128BIT : 0) |
++ (wo->mppc ? MPPE_MPPC : 0);
++ } else {
++ ho->mppe = ho->mppe_stateless = 0;
+ }
+ } else {
+- /* Neither are set. */
+- /* We cannot accept this. */
++ /* MPPE is not compatible with other compression types */
++ if (wo->mppe) {
++ ao->bsd_compress = 0;
++ ao->predictor_1 = 0;
++ ao->predictor_2 = 0;
++ ao->deflate = 0;
++ ao->lzs = 0;
++ }
++ }
++ if ((!ho->mppc || !ao->mppc) && !ho->mppe) {
++ p[2] = p2;
++ p[5] = p5;
+ newret = CONFNAK;
+ /* Give the peer our idea of what can be used,
+ so it can choose and confirm */
+ ho->mppe = ao->mppe;
+ }
+
+- /* rebuild the opts */
+- MPPE_OPTS_TO_CI(ho->mppe, &p[2]);
+- if (newret == CONFACK) {
+- u_char opt_buf[CILEN_MPPE + MPPE_MAX_KEY_LEN];
+- int mtu;
+-
+- BCOPY(p, opt_buf, CILEN_MPPE);
+- BCOPY(mppe_send_key, &opt_buf[CILEN_MPPE],
+- MPPE_MAX_KEY_LEN);
+- if (ccp_test(f->unit, opt_buf,
+- CILEN_MPPE + MPPE_MAX_KEY_LEN, 1) <= 0) {
+- /* This shouldn't happen, we've already tested it! */
+- error("MPPE required, but kernel has no support.");
+- lcp_close(f->unit, "MPPE required but not available");
+- newret = CONFREJ;
+- break;
+- }
+- /*
+- * We need to decrease the interface MTU by MPPE_PAD
+- * because MPPE frames **grow**. The kernel [must]
+- * allocate MPPE_PAD extra bytes in xmit buffers.
+- */
+- mtu = netif_get_mtu(f->unit);
+- if (mtu)
+- netif_set_mtu(f->unit, mtu - MPPE_PAD);
+- else
+- newret = CONFREJ;
+- }
++ /*
++ * I have commented the code below because according to RFC1547
++ * MTU is only information for higher level protocols about
++ * "the maximum allowable length for a packet (q.v.) transmitted
++ * over a point-to-point link without incurring network layer
++ * fragmentation." Of course a PPP implementation should be able
++ * to handle overhead added by MPPE - in our case apropriate code
++ * is located in drivers/net/ppp_generic.c in the kernel sources.
++ *
++ * According to RFC1661:
++ * - when negotiated MRU is less than 1500 octets, a PPP
++ * implementation must still be able to receive at least 1500
++ * octets,
++ * - when PFC is negotiated, a PPP implementation is still
++ * required to receive frames with uncompressed protocol field.
++ *
++ * So why not to handle MPPE overhead without changing MTU value?
++ * I am sure that RFC3078, unfortunately silently, assumes that.
++ */
+
+ /*
+- * We have accepted MPPE or are willing to negotiate
+- * MPPE parameters. A CONFREJ is due to subsequent
+- * (non-MPPE) processing.
++ * We need to decrease the interface MTU by MPPE_PAD
++ * because MPPE frames **grow**. The kernel [must]
++ * allocate MPPE_PAD extra bytes in xmit buffers.
+ */
+- rej_for_ci_mppe = 0;
++/*
++ mtu = netif_get_mtu(f->unit);
++ if (mtu) {
++ netif_set_mtu(f->unit, mtu - MPPE_PAD);
++ } else {
++ newret = CONFREJ;
++ if (ccp_wantoptions[f->unit].mppe) {
++ error("Cannot adjust MTU needed by MPPE.");
++ lcp_close(f->unit, "Cannot adjust MTU needed by MPPE.");
++ }
++ }
++*/
+ break;
+ #endif /* MPPE */
++
++ case CI_LZS:
++ if (!ao->lzs || clen != CILEN_LZS) {
++ newret = CONFREJ;
++ break;
++ }
++
++ ho->lzs = 1;
++ ho->lzs_hists = (p[2] << 8) | p[3];
++ ho->lzs_mode = p[4];
++ if ((ho->lzs_hists != ao->lzs_hists) ||
++ (ho->lzs_mode != ao->lzs_mode)) {
++ newret = CONFNAK;
++ if (!dont_nak) {
++ p[2] = ao->lzs_hists >> 8;
++ p[3] = ao->lzs_hists & 0xff;
++ p[4] = ao->lzs_mode;
++ } else
++ break;
++ }
++
++ if (p == p0 && ccp_test(f->unit, p, CILEN_LZS, 1) <= 0) {
++ newret = CONFREJ;
++ }
++ break;
++
+ case CI_DEFLATE:
+ case CI_DEFLATE_DRAFT:
+ if (!ao->deflate || clen != CILEN_DEFLATE
+@@ -1344,12 +1835,6 @@
+ else
+ *lenp = retp - p0;
+ }
+-#ifdef MPPE
+- if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) {
+- error("MPPE required but peer negotiation failed");
+- lcp_close(f->unit, "MPPE required but peer negotiation failed");
+- }
+-#endif
+ return ret;
+ }
+
+@@ -1371,24 +1856,35 @@
+ char *p = result;
+ char *q = result + sizeof(result); /* 1 past result */
+
+- slprintf(p, q - p, "MPPE ");
+- p += 5;
+- if (opt->mppe & MPPE_OPT_128) {
+- slprintf(p, q - p, "128-bit ");
+- p += 8;
+- }
+- if (opt->mppe & MPPE_OPT_40) {
+- slprintf(p, q - p, "40-bit ");
+- p += 7;
+- }
+- if (opt->mppe & MPPE_OPT_STATEFUL)
+- slprintf(p, q - p, "stateful");
+- else
+- slprintf(p, q - p, "stateless");
+-
++ if (opt->mppe) {
++ if (opt->mppc) {
++ slprintf(p, q - p, "MPPC/MPPE ");
++ p += 10;
++ } else {
++ slprintf(p, q - p, "MPPE ");
++ p += 5;
++ }
++ if (opt->mppe_128) {
++ slprintf(p, q - p, "128-bit ");
++ p += 8;
++ } else if (opt->mppe_56) {
++ slprintf(p, q - p, "56-bit ");
++ p += 7;
++ } else if (opt->mppe_40) {
++ slprintf(p, q - p, "40-bit ");
++ p += 7;
++ }
++ if (opt->mppe_stateless)
++ slprintf(p, q - p, "stateless");
++ else
++ slprintf(p, q - p, "stateful");
++ } else if (opt->mppc)
++ slprintf(p, q - p, "MPPC");
+ break;
+ }
+-#endif
++#endif /* MPPE */
++ case CI_LZS:
++ return "Stac LZS";
+ case CI_DEFLATE:
+ case CI_DEFLATE_DRAFT:
+ if (opt2 != NULL && opt2->deflate_size != opt->deflate_size)
+@@ -1444,12 +1940,12 @@
+ } else if (ANY_COMPRESS(*ho))
+ notice("%s transmit compression enabled", method_name(ho, NULL));
+ #ifdef MPPE
+- if (go->mppe) {
++ if (go->mppe || go->mppc) {
+ BZERO(mppe_recv_key, MPPE_MAX_KEY_LEN);
+ BZERO(mppe_send_key, MPPE_MAX_KEY_LEN);
+ continue_networks(f->unit); /* Bring up IP et al */
+ }
+-#endif
++#endif /* MPPE */
+ }
+
+ /*
+@@ -1472,7 +1968,7 @@
+ lcp_close(f->unit, "MPPE disabled");
+ }
+ }
+-#endif
++#endif /* MPPE */
+ }
+
+ /*
+@@ -1532,24 +2028,28 @@
+ #ifdef MPPE
+ case CI_MPPE:
+ if (optlen >= CILEN_MPPE) {
+- u_char mppe_opts;
+-
+- MPPE_CI_TO_OPTS(&p[2], mppe_opts);
+- printer(arg, "mppe %s %s %s %s %s %s%s",
+- (p[2] & MPPE_H_BIT)? "+H": "-H",
+- (p[5] & MPPE_M_BIT)? "+M": "-M",
+- (p[5] & MPPE_S_BIT)? "+S": "-S",
+- (p[5] & MPPE_L_BIT)? "+L": "-L",
++ printer(arg, "mppe %s %s %s %s %s %s",
++ (p[2] & MPPE_STATELESS)? "+H": "-H",
++ (p[5] & MPPE_56BIT)? "+M": "-M",
++ (p[5] & MPPE_128BIT)? "+S": "-S",
++ (p[5] & MPPE_40BIT)? "+L": "-L",
+ (p[5] & MPPE_D_BIT)? "+D": "-D",
+- (p[5] & MPPE_C_BIT)? "+C": "-C",
+- (mppe_opts & MPPE_OPT_UNKNOWN)? " +U": "");
+- if (mppe_opts & MPPE_OPT_UNKNOWN)
++ (p[5] & MPPE_MPPC)? "+C": "-C");
++ if ((p[5] & ~(MPPE_56BIT | MPPE_128BIT | MPPE_40BIT |
++ MPPE_D_BIT | MPPE_MPPC)) ||
++ (p[2] & ~MPPE_STATELESS))
+ printer(arg, " (%.2x %.2x %.2x %.2x)",
+ p[2], p[3], p[4], p[5]);
+ p += CILEN_MPPE;
+ }
+ break;
+-#endif
++#endif /* MPPE */
++ case CI_LZS:
++ if (optlen >= CILEN_LZS) {
++ printer(arg, "lzs %.2x %.2x %.2x", p[2], p[3], p[4]);
++ p += CILEN_LZS;
++ }
++ break;
+ case CI_DEFLATE:
+ case CI_DEFLATE_DRAFT:
+ if (optlen >= CILEN_DEFLATE) {
+@@ -1635,6 +2135,7 @@
+ error("Lost compression sync: disabling compression");
+ ccp_close(unit, "Lost compression sync");
+ #ifdef MPPE
++ /* My module dosn't need this. J.D., 2003-07-06 */
+ /*
+ * If we were doing MPPE, we must also take the link down.
+ */
+@@ -1642,9 +2143,18 @@
+ error("Too many MPPE errors, closing LCP");
+ lcp_close(unit, "Too many MPPE errors");
+ }
+-#endif
++#endif /* MPPE */
+ } else {
+ /*
++ * When LZS or MPPE/MPPC is negotiated we just send CCP_RESETREQ
++ * and don't wait for CCP_RESETACK
++ */
++ if ((ccp_gotoptions[f->unit].method == CI_LZS) ||
++ (ccp_gotoptions[f->unit].method == CI_MPPE)) {
++ fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0);
++ return;
++ }
++ /*
+ * Send a reset-request to reset the peer's compressor.
+ * We don't do that if we are still waiting for an
+ * acknowledgement to a previous reset-request.
+@@ -1675,4 +2185,3 @@
+ } else
+ ccp_localstate[f->unit] &= ~RACK_PENDING;
+ }
+-
+diff -ruN ppp-2.4.3.orig/pppd/ccp.h ppp-2.4.3/pppd/ccp.h
+--- ppp-2.4.3.orig/pppd/ccp.h 2004-11-04 11:02:26.000000000 +0100
++++ ppp-2.4.3/pppd/ccp.h 2004-11-21 13:54:09.000000000 +0100
+@@ -37,9 +37,17 @@
+ bool predictor_2; /* do Predictor-2? */
+ bool deflate_correct; /* use correct code for deflate? */
+ bool deflate_draft; /* use draft RFC code for deflate? */
++ bool lzs; /* do Stac LZS? */
++ bool mppc; /* do MPPC? */
+ bool mppe; /* do MPPE? */
++ bool mppe_40; /* allow 40 bit encryption? */
++ bool mppe_56; /* allow 56 bit encryption? */
++ bool mppe_128; /* allow 128 bit encryption? */
++ bool mppe_stateless; /* allow stateless encryption */
+ u_short bsd_bits; /* # bits/code for BSD Compress */
+ u_short deflate_size; /* lg(window size) for Deflate */
++ u_short lzs_mode; /* LZS check mode */
++ u_short lzs_hists; /* number of LZS histories */
+ short method; /* code for chosen compression method */
+ } ccp_options;
+
+diff -ruN ppp-2.4.3.orig/pppd/chap_ms.c ppp-2.4.3/pppd/chap_ms.c
+--- ppp-2.4.3.orig/pppd/chap_ms.c 2004-11-12 10:57:43.000000000 +0100
++++ ppp-2.4.3/pppd/chap_ms.c 2004-11-21 13:54:09.000000000 +0100
+@@ -895,13 +895,17 @@
+ /*
+ * Disable undesirable encryption types. Note that we don't ENABLE
+ * any encryption types, to avoid overriding manual configuration.
++ *
++ * It seems that 56 bit keys are unsupported in MS-RADIUS (see RFC 2548)
+ */
+ switch(types) {
+ case MPPE_ENC_TYPES_RC4_40:
+- ccp_wantoptions[0].mppe &= ~MPPE_OPT_128; /* disable 128-bit */
++ ccp_wantoptions[0].mppe_128 = 0; /* disable 128-bit */
++ ccp_wantoptions[0].mppe_56 = 0; /* disable 56-bit */
+ break;
+ case MPPE_ENC_TYPES_RC4_128:
+- ccp_wantoptions[0].mppe &= ~MPPE_OPT_40; /* disable 40-bit */
++ ccp_wantoptions[0].mppe_56 = 0; /* disable 56-bit */
++ ccp_wantoptions[0].mppe_40 = 0; /* disable 40-bit */
+ break;
+ default:
+ break;
+diff -ruN ppp-2.4.3.orig/pppd/pppd.8 ppp-2.4.3/pppd/pppd.8
+--- ppp-2.4.3.orig/pppd/pppd.8 2004-11-13 13:22:49.000000000 +0100
++++ ppp-2.4.3/pppd/pppd.8 2004-11-21 14:24:47.000000000 +0100
+@@ -622,9 +622,29 @@
+ Enables the use of PPP multilink; this is an alias for the `multilink'
+ option. This option is currently only available under Linux.
+ .TP
+-.B mppe\-stateful
+-Allow MPPE to use stateful mode. Stateless mode is still attempted first.
+-The default is to disallow stateful mode.
++.B mppc
++Enables MPPC (Microsoft Point to Point Compression). This is the default.
++.TP
++.B mppe \fIsubopt1[,subopt2[,subopt3[..]]]
++Modify MPPE (Microsoft Point to Point Encryption) parameters. In order
++for MPPE to successfully come up, you must have authenticated with either
++MS-CHAP or MS-CHAPv2. By default MPPE is optional, it means that pppd will
++not propose MPPE to the peer, but will negotiate MPPE if peer wants that.
++You can change this using \fIrequired\fR suboption.
++This option is presently only supported under Linux, and only if your
++kernel has been configured to include MPPE support.
++.IP
++MPPE suboptions:
++.br
++\fIrequired\fR - require MPPE; disconnect if peer doesn't support it,
++.br
++\fIstateless\fR - try to negotiate stateless mode; default is stateful,
++.br
++\fIno40\fR - disable 40 bit keys,
++.br
++\fIno56\fR - disable 56 bit keys,
++.br
++\fIno128\fR - disable 128 bit keys
+ .TP
+ .B mpshortseq
+ Enables the use of short (12-bit) sequence numbers in multilink
+@@ -757,17 +777,11 @@
+ Disables the use of PPP multilink. This option is currently only
+ available under Linux.
+ .TP
+-.B nomppe
+-Disables MPPE (Microsoft Point to Point Encryption). This is the default.
+-.TP
+-.B nomppe\-40
+-Disable 40-bit encryption with MPPE.
++.B nomppc
++Disables MPPC (Microsoft Point to Point Compression).
+ .TP
+-.B nomppe\-128
+-Disable 128-bit encryption with MPPE.
+-.TP
+-.B nomppe\-stateful
+-Disable MPPE stateful mode. This is the default.
++.B nomppe
++Disables MPPE (Microsoft Point to Point Encryption).
+ .TP
+ .B nompshortseq
+ Disables the use of short (12-bit) sequence numbers in the PPP
+@@ -948,19 +962,6 @@
+ Require the peer to authenticate itself using CHAP [Challenge
+ Handshake Authentication Protocol] authentication.
+ .TP
+-.B require\-mppe
+-Require the use of MPPE (Microsoft Point to Point Encryption). This
+-option disables all other compression types. This option enables
+-both 40-bit and 128-bit encryption. In order for MPPE to successfully
+-come up, you must have authenticated with either MS\-CHAP or MS\-CHAPv2.
+-This option is presently only supported under Linux, and only if your
+-kernel has been configured to include MPPE support.
+-.TP
+-.B require\-mppe\-40
+-Require the use of MPPE, with 40-bit encryption.
+-.TP
+-.B require\-mppe\-128
+-Require the use of MPPE, with 128-bit encryption.
+ .TP
+ .B require\-mschap
+ Require the peer to authenticate itself using MS\-CHAP [Microsoft Challenge
diff --git a/package/ppp/patches/203-no_strip.patch b/package/ppp/patches/203-no_strip.patch
new file mode 100644
index 000000000..071f3aa3d
--- /dev/null
+++ b/package/ppp/patches/203-no_strip.patch
@@ -0,0 +1,86 @@
+diff -Nur ppp-2.4.4.orig/chat/Makefile.linux ppp-2.4.4/chat/Makefile.linux
+--- ppp-2.4.4.orig/chat/Makefile.linux 2006-06-04 07:07:46.000000000 +0200
++++ ppp-2.4.4/chat/Makefile.linux 2006-12-04 14:17:39.000000000 +0100
+@@ -25,7 +25,7 @@
+
+ install: chat
+ mkdir -p $(BINDIR) $(MANDIR)
+- $(INSTALL) -s -c chat $(BINDIR)
++ $(INSTALL) -c chat $(BINDIR)
+ $(INSTALL) -c -m 644 chat.8 $(MANDIR)
+
+ clean:
+diff -Nur ppp-2.4.4.orig/pppd/Makefile.linux ppp-2.4.4/pppd/Makefile.linux
+--- ppp-2.4.4.orig/pppd/Makefile.linux 2006-06-04 07:07:46.000000000 +0200
++++ ppp-2.4.4/pppd/Makefile.linux 2006-12-04 14:17:39.000000000 +0100
+@@ -99,7 +99,7 @@
+ CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
+ LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
+ TARGETS += srp-entry
+-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
++EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
+ MANPAGES += srp-entry.8
+ EXTRACLEAN += srp-entry.o
+ NEEDDES=y
+@@ -200,7 +200,7 @@
+ install: pppd
+ mkdir -p $(BINDIR) $(MANDIR)
+ $(EXTRAINSTALL)
+- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
++ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
+ if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
+ chmod o-rx,u+s $(BINDIR)/pppd; fi
+ $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
+diff -Nur ppp-2.4.4.orig/pppd/plugins/radius/Makefile.linux ppp-2.4.4/pppd/plugins/radius/Makefile.linux
+--- ppp-2.4.4.orig/pppd/plugins/radius/Makefile.linux 2006-06-04 07:04:14.000000000 +0200
++++ ppp-2.4.4/pppd/plugins/radius/Makefile.linux 2006-12-04 14:17:39.000000000 +0100
+@@ -36,9 +36,9 @@
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
+ $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
+ $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
+
+diff -Nur ppp-2.4.4.orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux
+--- ppp-2.4.4.orig/pppd/plugins/rp-pppoe/Makefile.linux 2006-06-04 07:07:46.000000000 +0200
++++ ppp-2.4.4/pppd/plugins/rp-pppoe/Makefile.linux 2006-12-04 14:17:39.000000000 +0100
+@@ -39,9 +39,9 @@
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
++ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
+ $(INSTALL) -d -m 755 $(BINDIR)
+- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
++ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
+
+ clean:
+ rm -f *.o *.so
+diff -Nur ppp-2.4.4.orig/pppdump/Makefile.linux ppp-2.4.4/pppdump/Makefile.linux
+--- ppp-2.4.4.orig/pppdump/Makefile.linux 2006-06-04 07:04:14.000000000 +0200
++++ ppp-2.4.4/pppdump/Makefile.linux 2006-12-04 14:17:39.000000000 +0100
+@@ -17,5 +17,5 @@
+
+ install:
+ mkdir -p $(BINDIR) $(MANDIR)
+- $(INSTALL) -s -c pppdump $(BINDIR)
++ $(INSTALL) -c pppdump $(BINDIR)
+ $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
+diff -Nur ppp-2.4.4.orig/pppstats/Makefile.linux ppp-2.4.4/pppstats/Makefile.linux
+--- ppp-2.4.4.orig/pppstats/Makefile.linux 2006-06-04 07:07:46.000000000 +0200
++++ ppp-2.4.4/pppstats/Makefile.linux 2006-12-04 14:17:39.000000000 +0100
+@@ -22,7 +22,7 @@
+
+ install: pppstats
+ -mkdir -p $(MANDIR)
+- $(INSTALL) -s -c pppstats $(BINDIR)
++ $(INSTALL) -c pppstats $(BINDIR)
+ $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
+
+ pppstats: $(PPPSTATSRCS)
diff --git a/package/ppp/patches/204-opt_flags.patch b/package/ppp/patches/204-opt_flags.patch
new file mode 100644
index 000000000..200e76b5b
--- /dev/null
+++ b/package/ppp/patches/204-opt_flags.patch
@@ -0,0 +1,26 @@
+diff -ruN ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux
+--- ppp-2.4.3-orig/pppd/plugins/radius/Makefile.linux 2004-11-14 08:02:31.000000000 +0100
++++ ppp-2.4.3-3/pppd/plugins/radius/Makefile.linux 2004-12-05 17:43:17.000000000 +0100
+@@ -12,7 +12,8 @@
+ INSTALL = install
+
+ PLUGIN=radius.so radattr.so radrealms.so
+-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
++COPTS = -O2
++CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+
+ # Uncomment the next line to include support for Microsoft's
+ # MS-CHAP authentication protocol.
+diff -ruN ppp-2.4.3-orig/pppdump/Makefile.linux ppp-2.4.3-3/pppdump/Makefile.linux
+--- ppp-2.4.3-orig/pppdump/Makefile.linux 2004-10-31 02:36:52.000000000 +0200
++++ ppp-2.4.3-3/pppdump/Makefile.linux 2004-12-05 17:50:34.000000000 +0100
+@@ -2,7 +2,8 @@
+ BINDIR = $(DESTDIR)/sbin
+ MANDIR = $(DESTDIR)/share/man/man8
+
+-CFLAGS= -O -I../include/net
++COPTS = -O
++CFLAGS= $(COPTS) -I../include/net
+ OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
+
+ INSTALL= install
diff --git a/package/ppp/patches/206-radius_config.patch b/package/ppp/patches/206-radius_config.patch
new file mode 100644
index 000000000..f9a8217cd
--- /dev/null
+++ b/package/ppp/patches/206-radius_config.patch
@@ -0,0 +1,39 @@
+diff -Nur ppp-2.4.4-orig/pppd/plugins/radius/etc/radiusclient.conf ppp-2.4.4/pppd/plugins/radius/etc/radiusclient.conf
+--- ppp-2.4.4-orig/pppd/plugins/radius/etc/radiusclient.conf 2004-11-14 00:48:39.000000000 +0100
++++ ppp-2.4.4/pppd/plugins/radius/etc/radiusclient.conf 2007-01-23 23:56:52.000000000 +0100
+@@ -22,7 +22,7 @@
+
+ # name of the issue file. it's only display when no username is passed
+ # on the radlogin command line (default /etc/radiusclient/issue)
+-issue /usr/local/etc/radiusclient/issue
++issue /etc/radiusclient/issue
+
+ # RADIUS settings
+
+@@ -43,22 +43,22 @@
+
+ # file holding shared secrets used for the communication
+ # between the RADIUS client and server
+-servers /usr/local/etc/radiusclient/servers
++servers /etc/radiusclient/servers
+
+ # dictionary of allowed attributes and values
+ # just like in the normal RADIUS distributions
+-dictionary /usr/local/etc/radiusclient/dictionary
++dictionary /etc/radiusclient/dictionary
+
+ # program to call for a RADIUS authenticated login
+ # (default /usr/sbin/login.radius)
+-login_radius /usr/local/sbin/login.radius
++login_radius /sbin/login.radius
+
+ # file which holds sequence number for communication with the
+ # RADIUS server
+ seqfile /var/run/radius.seq
+
+ # file which specifies mapping between ttyname and NAS-Port attribute
+-mapfile /usr/local/etc/radiusclient/port-id-map
++mapfile /etc/radiusclient/port-id-map
+
+ # default authentication realm to append to all usernames if no
+ # realm was explicitly specified by the user
diff --git a/package/ppp/patches/208-no_exponential_timeout.patch b/package/ppp/patches/208-no_exponential_timeout.patch
new file mode 100644
index 000000000..d6c986a7e
--- /dev/null
+++ b/package/ppp/patches/208-no_exponential_timeout.patch
@@ -0,0 +1,28 @@
+diff -urN ppp.old/pppd/plugins/rp-pppoe/discovery.c ppp.dev/pppd/plugins/rp-pppoe/discovery.c
+--- ppp.old/pppd/plugins/rp-pppoe/discovery.c 2005-09-05 15:25:35.917232000 +0200
++++ ppp.dev/pppd/plugins/rp-pppoe/discovery.c 2005-09-05 15:29:17.233586872 +0200
+@@ -593,12 +593,14 @@
+ conn->discoveryState = STATE_SENT_PADI;
+ waitForPADO(conn, timeout);
+
++#if 0
+ /* If we're just probing for access concentrators, don't do
+ exponential backoff. This reduces the time for an unsuccessful
+ probe to 15 seconds. */
+ if (!conn->printACNames) {
+ timeout *= 2;
+ }
++#endif
+ if (conn->printACNames && conn->numPADOs) {
+ break;
+ }
+@@ -621,7 +623,9 @@
+ sendPADR(conn);
+ conn->discoveryState = STATE_SENT_PADR;
+ waitForPADS(conn, timeout);
++#if 0
+ timeout *= 2;
++#endif
+ } while (conn->discoveryState == STATE_SENT_PADR);
+
+ /* We're done. */
diff --git a/package/ppp/patches/209-compensate_time_change.patch b/package/ppp/patches/209-compensate_time_change.patch
new file mode 100644
index 000000000..f43085ab1
--- /dev/null
+++ b/package/ppp/patches/209-compensate_time_change.patch
@@ -0,0 +1,82 @@
+diff -urN ppp.old/pppd/main.c ppp.dev/pppd/main.c
+--- ppp.old/pppd/main.c 2005-11-11 19:19:28.177790000 +0100
++++ ppp.dev/pppd/main.c 2005-11-11 20:18:05.957363000 +0100
+@@ -90,6 +90,7 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <sys/sysinfo.h>
+
+ #include "pppd.h"
+ #include "magic.h"
+@@ -227,6 +228,7 @@
+
+ /* Prototypes for procedures local to this file. */
+
++static void check_time(void);
+ static void setup_signals __P((void));
+ static void create_pidfile __P((int pid));
+ static void create_linkpidfile __P((int pid));
+@@ -531,6 +533,7 @@
+ info("Starting link");
+ }
+
++ check_time();
+ gettimeofday(&start_time, NULL);
+ script_unsetenv("CONNECT_TIME");
+ script_unsetenv("BYTES_SENT");
+@@ -1195,6 +1198,36 @@
+
+ static struct callout *callout = NULL; /* Callout list */
+ static struct timeval timenow; /* Current time */
++static long uptime_diff = 0;
++static int uptime_diff_set = 0;
++
++static void check_time(void)
++{
++ long new_diff;
++ struct timeval t;
++ struct sysinfo i;
++ struct callout *p;
++
++ gettimeofday(&t, NULL);
++ sysinfo(&i);
++ new_diff = t.tv_sec - i.uptime;
++
++ if (!uptime_diff_set) {
++ uptime_diff = new_diff;
++ uptime_diff_set = 1;
++ return;
++ }
++
++ if ((new_diff - 5 > uptime_diff) || (new_diff + 5 < uptime_diff)) {
++ /* system time has changed, update counters and timeouts */
++ info("System time change detected.");
++ start_time.tv_sec += new_diff - uptime_diff;
++
++ for (p = callout; p != NULL; p = p->c_next)
++ p->c_time.tv_sec += new_diff - uptime_diff;
++ }
++ uptime_diff = new_diff;
++}
+
+ /*
+ * timeout - Schedule a timeout.
+@@ -1265,6 +1298,8 @@
+ {
+ struct callout *p;
+
++ check_time();
++
+ while (callout != NULL) {
+ p = callout;
+
+@@ -1292,6 +1327,8 @@
+ {
+ if (callout == NULL)
+ return NULL;
++
++ check_time();
+
+ gettimeofday(&timenow, NULL);
+ tvp->tv_sec = callout->c_time.tv_sec - timenow.tv_sec;
diff --git a/package/ppp/patches/320-use_target_ar.patch b/package/ppp/patches/320-use_target_ar.patch
new file mode 100644
index 000000000..8601d9d56
--- /dev/null
+++ b/package/ppp/patches/320-use_target_ar.patch
@@ -0,0 +1,24 @@
+$Id$
+
+--- ppp-2.4.3/pppd/plugins/radius/Makefile.linux.orig Sun Jun 18 23:45:43 2006
++++ ppp-2.4.3/pppd/plugins/radius/Makefile.linux Sun Jun 18 23:46:01 2006
+@@ -55,7 +55,7 @@ radrealms.so: radrealms.o
+ CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
+ clientid.o sendserver.o lock.o util.o md5.o
+ libradiusclient.a: $(CLIENTOBJS)
+- $(AR) rv $@ $?
++ $(TARGET_AR) rcsv $@ $?
+
+ clean:
+ rm -f *.o *.so *.a
+--- ppp-2.4.3/pppd/plugins/rp-pppoe/Makefile.linux.orig Sun Jun 18 23:45:44 2006
++++ ppp-2.4.3/pppd/plugins/rp-pppoe/Makefile.linux Sun Jun 18 23:46:09 2006
+@@ -50,7 +50,7 @@ plugin.o: plugin.c
+ $(CC) '-DRP_VERSION="$(VERSION)"' $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
+
+ libplugin.a: discovery.o if.o common.o debug.o
+- $(AR) -rc $@ $^
++ $(TARGET_AR) -rcs $@ $^
+
+ discovery.o: discovery.c
+ $(CC) $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o discovery.o -fPIC discovery.c
diff --git a/package/ppp/utils/pfc.c b/package/ppp/utils/pfc.c
new file mode 100644
index 000000000..2344d56ed
--- /dev/null
+++ b/package/ppp/utils/pfc.c
@@ -0,0 +1,51 @@
+/*
+ * Taken from fli4l 3.0
+ * Make sure you compile it against the same libpcap version used in OpenADK
+ */
+
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <string.h>
+
+#include <linux/types.h>
+#include <linux/ppp_defs.h>
+
+#include <pcap.h>
+#include <pcap-bpf.h>
+
+int main (int argc, char ** argv)
+{
+ pcap_t *pc; /* Fake struct pcap so we can compile expr */
+ struct bpf_program filter; /* Filter program for link-active pkts */
+ u_int32_t netmask=0;
+
+ int dflag = 3;
+ if (argc == 4)
+ {
+ if (!strcmp (argv[1], "-d"))
+ {
+ dflag = atoi (argv[2]);
+ argv += 2;
+ argc -=2;
+ }
+ }
+ if (argc != 2)
+ {
+ printf ("usage; %s [ -d <debug_level> ] expression\n", argv[0]);
+ return 1;
+ }
+
+ pc = pcap_open_dead(DLT_PPP_PPPD, PPP_HDRLEN);
+ if (pcap_compile(pc, &filter, argv[1], 1, netmask) == 0)
+ {
+ printf ("#\n# Expression: %s\n#\n", argv[1]);
+ bpf_dump (&filter, dflag);
+ return 0;
+ }
+ else
+ {
+ printf("error in active-filter expression: %s\n", pcap_geterr(pc));
+ }
+ return 1;
+}
diff --git a/package/pptp/Config.in b/package/pptp/Config.in
new file mode 100644
index 000000000..3f132d202
--- /dev/null
+++ b/package/pptp/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_PPTP
+ prompt "pptp.............................. PPTP (Point-to-Point Tunneling Protocol) client"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_NET_IPGRE
+ select ADK_PACKAGE_PPP
+ help
+ A Point-to-Point Tunneling Protocol Client
+
+ http://pptpclient.sourceforge.net/
+
diff --git a/package/pptp/Makefile b/package/pptp/Makefile
new file mode 100644
index 000000000..5c76fbba7
--- /dev/null
+++ b/package/pptp/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= pptp
+PKG_VERSION:= 1.6.0
+PKG_RELEASE:= 3
+PKG_MD5SUM:= 9a706327fb9827541d7c86d48ceb9631
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=pptpclient/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PPTP,pptp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" \
+ CFLAGS="${TARGET_CFLAGS}"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PPTP}/sbin
+ ${INSTALL_DIR} ${IDIR_PPTP}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_PPTP}/etc/ppp
+ ${INSTALL_BIN} ./files/ifup.pptp ${IDIR_PPTP}/sbin/ifup.pptp
+ ${INSTALL_DATA} ./files/options.pptp ${IDIR_PPTP}/etc/ppp/
+ ${INSTALL_BIN} ${WRKBUILD}/pptp ${IDIR_PPTP}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pptp/files/ifup.pptp b/package/pptp/files/ifup.pptp
new file mode 100644
index 000000000..f401a36b2
--- /dev/null
+++ b/package/pptp/files/ifup.pptp
@@ -0,0 +1,45 @@
+#!/bin/sh
+[ $# = 0 ] && { echo " $0 <group>"; exit; }
+. /etc/config/network
+type=$1
+
+eval "proto=\"\${${type}_proto}\""
+[ "$proto" = "pptp" ] || {
+ echo "$0: ${type}_proto isn't pptp"
+ exit
+}
+
+mkdir -p /var/lock
+
+for module in slhc ppp_generic ppp_async ip_gre; do
+ /sbin/insmod $module 2>&- >&-
+done
+
+KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5}
+case "$ppp_demand" in
+ on|1|enabled)
+ DEMAND=${ppp_idletime:+demand idle $ppp_idletime}
+ [ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
+ ;;
+ *) DEMAND="persist";;
+esac
+MTU=${ppp_mtu:-1452}
+
+[ "$pptp_proto" = "static" ] || pptp_proto="dhcp"
+do_ifup $pptp_proto $type
+
+/usr/sbin/pppd \
+ pty "/usr/sbin/pptp $pptp_server_ip --loglevel 0 --nolaunchpppd" \
+ file /etc/ppp/options.pptp \
+ connect /bin/true \
+ usepeerdns \
+ defaultroute \
+ replacedefaultroute \
+ linkname "$type" \
+ ipparam "$type" \
+ user "$ppp_username" \
+ password "$ppp_passwd" \
+ mtu $MTU mru $MTU \
+ $DEMAND \
+ $KEEPALIVE
+
diff --git a/package/pptp/files/options.pptp b/package/pptp/files/options.pptp
new file mode 100644
index 000000000..c520de74b
--- /dev/null
+++ b/package/pptp/files/options.pptp
@@ -0,0 +1,6 @@
+lock
+noauth
+nobsdcomp
+nodeflate
+idle 0
+defaultroute
diff --git a/package/pptp/ipkg/pptp.conffiles b/package/pptp/ipkg/pptp.conffiles
new file mode 100644
index 000000000..136db31f1
--- /dev/null
+++ b/package/pptp/ipkg/pptp.conffiles
@@ -0,0 +1 @@
+/etc/ppp/options.pptp \ No newline at end of file
diff --git a/package/pptp/ipkg/pptp.control b/package/pptp/ipkg/pptp.control
new file mode 100644
index 000000000..e582c6221
--- /dev/null
+++ b/package/pptp/ipkg/pptp.control
@@ -0,0 +1,5 @@
+Package: pptp
+Priority: optional
+Section: net
+Description: a Point-to-Point Tunneling Protocol (PPTP) client
+Depends: ppp, kmod-gre
diff --git a/package/pptpd/Config.in b/package/pptpd/Config.in
new file mode 100644
index 000000000..7f1144f1b
--- /dev/null
+++ b/package/pptpd/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_PPTPD
+ prompt "pptpd............................. PPTP (Point-to-Point Tunneling Protocol) server"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_NET_IPGRE
+ select ADK_PACKAGE_PPP
+ help
+ A Point-to-Point Tunneling Protocol server
+
+ http://poptop.sourceforge.net/
+
diff --git a/package/pptpd/Makefile b/package/pptpd/Makefile
new file mode 100644
index 000000000..bc6a6e628
--- /dev/null
+++ b/package/pptpd/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= pptpd
+PKG_VERSION:= 1.3.0
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 75d494e881f7027f4e60b114163f6b67
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=poptop/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PPTPD,pptpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+TCFLAGS+= -DSBINDIR=\\\"/usr/sbin\\\"
+FAKE_FLAGS+= INSTALL="install"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_PPTPD}/etc
+ ${INSTALL_DIR} ${IDIR_PPTPD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_PPTPD}/etc/ppp
+ ${INSTALL_DIR} ${IDIR_PPTPD}/usr/sbin
+ ${INSTALL_DATA} ./files/pptpd.conf ${IDIR_PPTPD}/etc/
+ ${INSTALL_BIN} ./files/pptpd.init \
+ ${IDIR_PPTPD}/etc/init.d/pptpd
+ ${INSTALL_DATA} ./files/options.pptpd ${IDIR_PPTPD}/etc/ppp/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/pptpd \
+ ${WRKINST}/usr/sbin/pptpctrl ${IDIR_PPTPD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/pptpd/files/options.pptpd b/package/pptpd/files/options.pptpd
new file mode 100644
index 000000000..5dd2daf79
--- /dev/null
+++ b/package/pptpd/files/options.pptpd
@@ -0,0 +1,23 @@
+#debug
+#logfile /tmp/pptp-server.log
+172.16.1.1:
+auth
+name "pptp-server"
+lcp-echo-failure 3
+lcp-echo-interval 60
+default-asyncmap
+mtu 1482
+mru 1482
+nobsdcomp
+nodeflate
+#noproxyarp
+#nomppc
+mppe required,no40,no56,stateless
+require-mschap-v2
+refuse-chap
+refuse-mschap
+refuse-eap
+refuse-pap
+#ms-dns 172.16.1.1
+#plugin radius.so
+#radius-config-file /etc/radius.conf
diff --git a/package/pptpd/files/pptpd.conf b/package/pptpd/files/pptpd.conf
new file mode 100644
index 000000000..354745f59
--- /dev/null
+++ b/package/pptpd/files/pptpd.conf
@@ -0,0 +1,5 @@
+#debug
+option /etc/ppp/options.pptpd
+speed 115200
+stimeout 10
+#localip & remoteip are not needed, ip management is done by pppd
diff --git a/package/pptpd/files/pptpd.init b/package/pptpd/files/pptpd.init
new file mode 100644
index 000000000..c2b8ac032
--- /dev/null
+++ b/package/pptpd/files/pptpd.init
@@ -0,0 +1,28 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${pptpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; do
+ insmod $m >/dev/null 2>&1
+ done
+ pptpd
+ ;;
+stop)
+ killall pptpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/pptpd/ipkg/pptpd.conffiles b/package/pptpd/ipkg/pptpd.conffiles
new file mode 100644
index 000000000..c5afda91f
--- /dev/null
+++ b/package/pptpd/ipkg/pptpd.conffiles
@@ -0,0 +1,2 @@
+/etc/ppp/options.pptpd
+/etc/pptpd.conf
diff --git a/package/pptpd/ipkg/pptpd.control b/package/pptpd/ipkg/pptpd.control
new file mode 100644
index 000000000..135fa944c
--- /dev/null
+++ b/package/pptpd/ipkg/pptpd.control
@@ -0,0 +1,5 @@
+Package: pptpd
+Priority: optional
+Section: net
+Description: a Point-to-Point Tunneling Protocol (PPTP) server
+Depends: ppp, kmod-crypto, kmod-mppe, kmod-ppp
diff --git a/package/pptpd/ipkg/pptpd.postinst b/package/pptpd/ipkg/pptpd.postinst
new file mode 100644
index 000000000..05b1af001
--- /dev/null
+++ b/package/pptpd/ipkg/pptpd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf pptpd pptpd NO
diff --git a/package/pptpd/patches/bad-pqueue-debug.patch b/package/pptpd/patches/bad-pqueue-debug.patch
new file mode 100644
index 000000000..bfd185d41
--- /dev/null
+++ b/package/pptpd/patches/bad-pqueue-debug.patch
@@ -0,0 +1,20 @@
+diff -urN pptpd-1.3.0/pqueue.c.orig pptpd-1.3.0/pqueue.c
+--- pptpd-1.3.0.orig/pqueue.c 2005-03-31 06:55:53.000000000 +0200
++++ pptpd-1.3.0/pqueue.c 2008-10-14 13:30:20.000000000 +0200
+@@ -6,14 +6,11 @@
+ #include "pqueue.h"
+
+ #ifdef DEBUG_PQUEUE
+-#define DEBUG_ON 1
++#define DEBUG_CMD(_a) { _a }
+ #else
+-#define DEBUG_ON 0
++#define DEBUG_CMD(_a)
+ #endif
+
+-#define DEBUG_CMD(_a) if (DEBUG_ON) { _a }
+-
+-
+ #define MIN_CAPACITY 128 /* min allocated buffer for a packet */
+
+ static int pqueue_alloc (int seq, unsigned char *packet, int packlen, pqueue_t **new);
diff --git a/package/pptpd/patches/patch-ctrlpacket_c b/package/pptpd/patches/patch-ctrlpacket_c
new file mode 100644
index 000000000..f1a456de0
--- /dev/null
+++ b/package/pptpd/patches/patch-ctrlpacket_c
@@ -0,0 +1,15 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- pptpd-1.3.0.orig/ctrlpacket.c 2004-04-29 08:58:45.000000000 +0200
++++ pptpd-1.3.0/ctrlpacket.c 2008-10-14 13:43:14.000000000 +0200
+@@ -376,9 +376,9 @@ void deal_start_ctrl_conn(unsigned char
+ start_ctrl_conn_rply.bearer_cap = htons(OUR_BEARER);
+ start_ctrl_conn_rply.max_channels = htons(MAX_CHANNELS);
+ start_ctrl_conn_rply.firmware_rev = htons(PPTP_FIRMWARE_VERSION);
+- bzero(start_ctrl_conn_rply.hostname, MAX_HOSTNAME_SIZE);
++ memset(start_ctrl_conn_rply.hostname, 0, MAX_HOSTNAME_SIZE);
+ strncpy(start_ctrl_conn_rply.hostname, PPTP_HOSTNAME, MAX_HOSTNAME_SIZE);
+- bzero(start_ctrl_conn_rply.vendor, MAX_VENDOR_SIZE);
++ memset(start_ctrl_conn_rply.vendor, 0, MAX_VENDOR_SIZE);
+ strncpy(start_ctrl_conn_rply.vendor, PPTP_VENDOR, MAX_VENDOR_SIZE);
+ COPY_CTRL_PACKET(start_ctrl_conn_rply, rply_packet, rply_size);
+ DEBUG_PACKET("START CTRL CONN RPLY");
diff --git a/package/pptpd/patches/pptpgre-use-debug-option.patch b/package/pptpd/patches/pptpgre-use-debug-option.patch
new file mode 100644
index 000000000..cd1df7703
--- /dev/null
+++ b/package/pptpd/patches/pptpgre-use-debug-option.patch
@@ -0,0 +1,35 @@
+diff -Nur pptpd-1.3.0/pptpgre.c.orig pptpd-1.3.0/pptpgre.c
+--- pptpd-1.3.0.orig/pptpgre.c 2005-08-02 13:33:31.000000000 +0200
++++ pptpd-1.3.0/pptpgre.c 2008-10-14 13:30:20.000000000 +0200
+@@ -46,6 +46,9 @@
+
+ #define PACKET_MAX 8196
+
++/* Command Line Variable Args */
++extern int pptpctrl_debug;
++
+ typedef int (*callback_t)(int cl, void *pack, unsigned int len);
+
+ /* test for a 32 bit counter overflow */
+@@ -319,7 +322,9 @@ static int dequeue_gre (callback_t callb
+ stats.rx_lost += head->seq - gre.seq_recv - 1;
+ syslog(LOG_DEBUG, "GRE: timeout waiting for %d packets", head->seq - gre.seq_recv - 1);
+ }
+- syslog(LOG_DEBUG, "GRE: accepting #%d from queue", head->seq);
++ if (pptpctrl_debug) {
++ syslog(LOG_DEBUG, "GRE: accepting #%d from queue", head->seq);
++ }
+ gre.seq_recv = head->seq;
+ status = callback(cl, head->packet, head->packlen);
+ pqueue_del(head);
+@@ -399,7 +404,9 @@ int decaps_gre(int fd, int (*cb) (int cl
+ }
+ /* check for out-of-order sequence number */
+ if (seq_greater(seq, gre.seq_recv)) {
+- syslog(LOG_DEBUG, "GRE: accepting packet #%d", seq);
++ if (pptpctrl_debug) {
++ syslog(LOG_DEBUG, "GRE: accepting packet #%d", seq);
++ }
+ stats.rx_accepted++;
+ gre.seq_recv = seq;
+ return cb(cl, buffer + ip_len + headersize, payload_len);
diff --git a/package/privoxy/Config.in b/package/privoxy/Config.in
new file mode 100644
index 000000000..8132907f4
--- /dev/null
+++ b/package/privoxy/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_PRIVOXY
+ prompt "privoxy........................... web proxy with advanced filtering capabilities"
+ tristate
+ default n
+ help
+ Privoxy is a web proxy with advanced filtering capabilities for
+ protecting privacy, modifying web page content, managing cookies,
+ controlling access, and removing ads, banners, pop-ups and other
+ obnoxious Internet junk. Privoxy has a very flexible configuration
+ and can be customized to suit individual needs and tastes. Privoxy
+ has application for both stand-alone systems and multi-user networks.
+
+ http://www.privoxy.org/
+
+ WARNING: no init script is installed at the moment. You must also
+ fix file permissions on your own and create a privoxy user. This
+ may change in a future revision of this package.
diff --git a/package/privoxy/Makefile b/package/privoxy/Makefile
new file mode 100644
index 000000000..980e83c97
--- /dev/null
+++ b/package/privoxy/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= privoxy
+PKG_VERSION:= 3.0.12
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c973e608d27b248ef567b47664308da1
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=ijbswa/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}-stable-src.tar.gz
+WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}-stable
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PRIVOXY,privoxy,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TLDFLAGS+= -pthread
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_setpgrp_void=no
+BUILD_STYLE:= auto
+MAKE_FLAGS+= SPECIAL_CFLAGS='${TLDFLAGS}'
+MAKE_FILE:= GNUmakefile
+INSTALL_STYLE:= auto
+
+post-extract:
+ @find ${WRKBUILD} -name *.rej -delete
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_PRIVOXY}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/privoxy ${IDIR_PRIVOXY}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/privoxy/extra/config.h.in b/package/privoxy/extra/config.h.in
new file mode 100644
index 000000000..124f61ba1
--- /dev/null
+++ b/package/privoxy/extra/config.h.in
@@ -0,0 +1,664 @@
+/* config.h.in. Generated from configure.in by autoheader 2.61-MirPorts-0. */
+#ifndef CONFIG_H_INCLUDED
+#define CONFIG_H_INCLUDED
+/*********************************************************************
+ *
+ * File : $Source: /cvsroot/ijbswa/current/acconfig.h,v $
+ *
+ * Purpose : This file should be the first thing included in every
+ * .c file. (Before even system headers). It contains
+ * #define statements for various features. It was
+ * introduced because the compile command line started
+ * getting ludicrously long with feature defines.
+ *
+ * Copyright : Written by and Copyright (C) 2001 the SourceForge
+ * Privoxy team. http://www.privoxy.org/
+ *
+ * Based on the Internet Junkbuster originally written
+ * by and Copyright (C) 1997 Anonymous Coders and
+ * Junkbusters Corporation. http://www.junkbusters.com
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will
+ * be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public
+ * License for more details.
+ *
+ * The GNU General Public License should be included with
+ * this file. If not, you can view it at
+ * http://www.gnu.org/copyleft/gpl.html
+ * or write to the Free Software Foundation, Inc., 59
+ * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Revisions :
+ * $Log: acconfig.h,v $
+ * Revision 1.27.2.4 2003/12/17 16:34:40 oes
+ * Cosmetics
+ *
+ * Revision 1.27.2.3 2003/03/27 16:03:19 oes
+ * Another shot at Bug #707467
+ *
+ * Revision 1.27.2.2 2003/03/21 14:39:12 oes
+ * Presumably fixed Bug #707467 by defining unix ifdef __unix__
+ *
+ * Revision 1.27.2.1 2002/08/10 11:22:31 oes
+ * - Add two AC_DEFINEs that indicate if the pcre*.h headers
+ * are located in a pcre/ subdir to the include path.
+ *
+ * Revision 1.27 2002/04/25 19:13:57 morcego
+ * Removed RPM release number declaration on configure.in
+ * Changed makefile to use given value for RPM_PACKAGEV when on uploading
+ * targets (will produce an error, explaining who to do it, if no value
+ * if provided).
+ *
+ * Revision 1.26 2002/04/11 11:00:21 oes
+ * Applied Moritz' fix for socklen_t on Solaris
+ *
+ * Revision 1.25 2002/04/06 20:38:01 jongfoster
+ * Renaming VC++ versions of config.h
+ *
+ * Revision 1.24 2002/04/04 00:36:36 gliptak
+ * always use pcre for matching
+ *
+ * Revision 1.23 2002/04/03 22:28:03 gliptak
+ * Removed references to gnu_regex
+ *
+ * Revision 1.22 2002/03/26 22:29:54 swa
+ * we have a new homepage!
+ *
+ * Revision 1.21 2002/03/24 14:31:08 swa
+ * remove more crappy files. set RPM
+ * release version correctly.
+ *
+ * Revision 1.20 2002/03/24 13:46:44 swa
+ * name change related issue.
+ *
+ * Revision 1.19 2002/03/24 13:25:42 swa
+ * name change related issues
+ *
+ * Revision 1.18 2002/03/08 16:40:28 oes
+ * Added FEATURE_NO_GIFS
+ *
+ * Revision 1.17 2002/03/04 17:52:44 oes
+ * Deleted PID_FILE_PATH
+ *
+ * Revision 1.16 2002/01/10 12:36:18 oes
+ * Moved HAVE_*_R to acconfig.h, where they belong.
+ *
+ * Revision 1.15 2001/12/30 14:07:31 steudten
+ * - Add signal handling (unix)
+ * - Add SIGHUP handler (unix)
+ * - Add creation of pidfile (unix)
+ * - Add action 'top' in rc file (RH)
+ * - Add entry 'SIGNALS' to manpage
+ * - Add exit message to logfile (unix)
+ *
+ * Revision 1.14 2001/10/23 21:24:09 jongfoster
+ * Support for FEATURE_CGI_EDIT_ACTIONS
+ *
+ * Revision 1.13 2001/10/07 15:30:41 oes
+ * Removed FEATURE_DENY_GZIP
+ *
+ * Revision 1.12 2001/09/13 19:56:37 jongfoster
+ * Reverting to revision 1.10 - previous checking was majorly broken.
+ *
+ * Revision 1.10 2001/07/30 22:08:36 jongfoster
+ * Tidying up #defines:
+ * - All feature #defines are now of the form FEATURE_xxx
+ * - Permanently turned off WIN_GUI_EDIT
+ * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
+ *
+ * Revision 1.9 2001/07/29 19:08:52 jongfoster
+ * Changing _CONFIG_H to CONFIG_H_INCLUDED.
+ * Also added protection against using a MinGW32 or CygWin version of
+ * config.h from within MS Visual C++
+ *
+ * Revision 1.8 2001/07/29 17:09:17 jongfoster
+ * Major changes to build system in order to fix these bugs:
+ * - pthreads under Linux was broken - changed -lpthread to -pthread
+ * - Compiling in MinGW32 mode under CygWin now correctly detects
+ * which shared libraries are available
+ * - Solaris support (?) (Not tested under Solaris yet)
+ *
+ * Revision 1.7 2001/07/25 22:53:59 jongfoster
+ * Will #error if pthreads is enabled under BeOs
+ *
+ * Revision 1.6 2001/07/15 17:54:29 jongfoster
+ * Renaming #define STATIC to STATIC_PCRE
+ * Adding new #define FEATURE_PTHREAD that will be used to enable
+ * POSIX threads support.
+ *
+ * Revision 1.5 2001/07/13 13:48:37 oes
+ * - (Fix:) Copied CODE_STATUS #define from config.h.in
+ * - split REGEX #define into REGEX_GNU and REGEX_PCRE
+ * and removed PCRE.
+ * (REGEX = REGEX_GNU || REGEX_PCRE per project.h)
+ * - Moved STATIC (for pcre) here from Makefile.in
+ * - Introduced STATIC_PCRS #define to allow for dynaimc linking with
+ * libpcrs
+ * - Removed PCRS #define, since pcrs is now needed for CGI anyway
+ *
+ * Revision 1.4 2001/05/29 09:50:24 jongfoster
+ * Unified blocklist/imagelist/permissionslist.
+ * File format is still under discussion, but the internal changes
+ * are (mostly) done.
+ *
+ * Also modified interceptor behaviour:
+ * - We now intercept all URLs beginning with one of the following
+ * prefixes (and *only* these prefixes):
+ * * http://i.j.b/
+ * * http://ijbswa.sf.net/config/
+ * * http://ijbswa.sourceforge.net/config/
+ * - New interceptors "home page" - go to http://i.j.b/ to see it.
+ * - Internal changes so that intercepted and fast redirect pages
+ * are not replaced with an image.
+ * - Interceptors now have the option to send a binary page direct
+ * to the client. (i.e. ijb-send-banner uses this)
+ * - Implemented show-url-info interceptor. (Which is why I needed
+ * the above interceptors changes - a typical URL is
+ * "http://i.j.b/show-url-info?url=www.somesite.com/banner.gif".
+ * The previous mechanism would not have intercepted that, and
+ * if it had been intercepted then it then it would have replaced
+ * it with an image.)
+ *
+ * Revision 1.3 2001/05/26 01:26:34 jongfoster
+ * New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor.
+ * This #define cannot be set from ./configure - there's no point, it
+ * doesn't work yet. See feature request # 425722
+ *
+ * Revision 1.2 2001/05/22 17:43:35 oes
+ *
+ * - Enabled filtering banners by size rather than URL
+ * by adding patterns that replace all standard banner
+ * sizes with the "Junkbuster" gif to the re_filterfile
+ *
+ * - Enabled filtering WebBugs by providing a pattern
+ * which kills all 1x1 images
+ *
+ * - Added support for PCRE_UNGREEDY behaviour to pcrs,
+ * which is selected by the (nonstandard and therefore
+ * capital) letter 'U' in the option string.
+ * It causes the quantifiers to be ungreedy by default.
+ * Appending a ? turns back to greedy (!).
+ *
+ * - Added a new interceptor ijb-send-banner, which
+ * sends back the "Junkbuster" gif. Without imagelist or
+ * MSIE detection support, or if tinygif = 1, or the
+ * URL isn't recognized as an imageurl, a lame HTML
+ * explanation is sent instead.
+ *
+ * - Added new feature, which permits blocking remote
+ * script redirects and firing back a local redirect
+ * to the browser.
+ * The feature is conditionally compiled, i.e. it
+ * can be disabled with --disable-fast-redirects,
+ * plus it must be activated by a "fast-redirects"
+ * line in the config file, has its own log level
+ * and of course wants to be displayed by show-proxy-args
+ * Note: Boy, all the #ifdefs in 1001 locations and
+ * all the fumbling with configure.in and acconfig.h
+ * were *way* more work than the feature itself :-(
+ *
+ * - Because a generic redirect template was needed for
+ * this, tinygif = 3 now uses the same.
+ *
+ * - Moved GIFs, and other static HTTP response templates
+ * to project.h
+ *
+ * - Many minor fixes
+ *
+ * - Removed some >400 CRs again (Jon, you really worked
+ * a lot! ;-)
+ *
+ * Revision 1.1.1.1 2001/05/15 13:58:45 oes
+ * Initial import of version 2.9.3 source tree
+ *
+ *
+ *********************************************************************/
+
+
+/*
+ * Version number - Major (X._._)
+ */
+#undef VERSION_MAJOR
+
+/*
+ * Version number - Minor (_.X._)
+ */
+#undef VERSION_MINOR
+
+/*
+ * Version number - Point (_._.X)
+ */
+#undef VERSION_POINT
+
+/*
+ * Version number, as a string
+ */
+#undef VERSION
+
+/*
+ * Status of the code: "alpha", "beta" or "stable".
+ */
+#undef CODE_STATUS
+
+/*
+ * Should pcre be statically built in instead of linkling with libpcre?
+ * (This is determined by configure depending on the availiability of
+ * libpcre and user preferences). The name is ugly, but pcre needs it.
+ * Don't bother to change this here! Use configure instead.
+ */
+#undef STATIC_PCRE
+
+/*
+ * Should pcrs be statically built in instead of linkling with libpcrs?
+ * (This is determined by configure depending on the availiability of
+ * libpcrs and user preferences).
+ * Don't bother to change this here! Use configure instead.
+ */
+#undef STATIC_PCRS
+
+/*
+ * Allows the use of an ACL to control access to the proxy by IP address.
+ */
+#undef FEATURE_ACL
+
+/*
+ * Enables the web-based configuration (actionsfile) editor. If you
+ * have a shared proxy, you might want to turn this off.
+ */
+#undef FEATURE_CGI_EDIT_ACTIONS
+
+/*
+ * Allows the use of jar files to capture cookies.
+ */
+#undef FEATURE_COOKIE_JAR
+
+/*
+ * Locally redirect remote script-redirect URLs
+ */
+#undef FEATURE_FAST_REDIRECTS
+
+/*
+ * Bypass filtering for 1 page only
+ */
+#undef FEATURE_FORCE_LOAD
+
+/*
+ * Allow blocking using images as well as HTML.
+ * If you do not define this then everything is blocked as HTML.
+ *
+ * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE.
+ */
+#undef FEATURE_IMAGE_BLOCKING
+
+/*
+ * Detect image requests automatically for MSIE. Will fall back to
+ * other image-detection methods (i.e. "+image" permission) for other
+ * browsers.
+ *
+ * You must also define FEATURE_IMAGE_BLOCKING to use this feature.
+ *
+ * It detects the following header pair as an image request:
+ *
+ * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
+ * Accept: * / *
+ *
+ * And the following as a HTML request:
+ *
+ * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
+ * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / *
+ *
+ * And no, I haven't got that backwards - IE is being wierd.
+ *
+ * Known limitations:
+ * 1) If you press shift-reload on a blocked HTML page, you get
+ * the image "blocked" page, not the HTML "blocked" page.
+ * 2) Once an image "blocked" page has been sent, viewing it
+ * in it's own browser window *should* bring up the HTML
+ * "blocked" page, but it doesn't. You need to clear the
+ * browser cache to get the HTML version again.
+ *
+ * These limitations are due to IE making inconsistent choices
+ * about which "Accept:" header to send.
+ */
+#undef FEATURE_IMAGE_DETECT_MSIE
+
+/*
+ * Kills JavaScript popups - window.open, onunload, etc.
+ */
+#undef FEATURE_KILL_POPUPS
+
+/*
+ * Use PNG instead of GIF for built-in images
+ */
+#undef FEATURE_NO_GIFS
+
+/*
+ * Use POSIX threads instead of native threads.
+ */
+#undef FEATURE_PTHREAD
+
+/*
+ * Enables statistics function.
+ */
+#undef FEATURE_STATISTICS
+
+/*
+ * Allow Privoxy to be "disabled" so it is just a normal non-blocking
+ * non-anonymizing proxy. This is useful if you're trying to access a
+ * blocked or broken site - just change the setting in the config file,
+ * or use the handy "Disable" menu option in the Windows GUI.
+ */
+#undef FEATURE_TOGGLE
+
+/*
+ * Allows the use of trust files.
+ */
+#undef FEATURE_TRUST
+
+/*
+ * Defined on Solaris only. Makes the system libraries thread safe.
+ */
+#undef _REENTRANT
+
+/*
+ * Defined on Solaris only. Without this, many important functions are not
+ * defined in the system headers.
+ */
+#undef __EXTENSIONS__
+
+/*
+ * Defined always.
+ * FIXME: Don't know what it does or why we need it.
+ * (presumably something to do with MultiThreading?)
+ */
+#undef __MT__
+
+/* If the (nonstandard and thread-safe) function gethostbyname_r
+ * is available, select which signature to use
+ */
+#undef HAVE_GETHOSTBYNAME_R_6_ARGS
+#undef HAVE_GETHOSTBYNAME_R_5_ARGS
+#undef HAVE_GETHOSTBYNAME_R_3_ARGS
+
+/* If the (nonstandard and thread-safe) function gethostbyaddr_r
+ * is available, select which signature to use
+ */
+#undef HAVE_GETHOSTBYADDR_R_8_ARGS
+#undef HAVE_GETHOSTBYADDR_R_7_ARGS
+#undef HAVE_GETHOSTBYADDR_R_5_ARGS
+
+/* Defined if you have gmtime_r and localtime_r with a signature
+ * of (struct time *, struct tm *)
+ */
+#undef HAVE_GMTIME_R
+#undef HAVE_LOCALTIME_R
+
+/* Define to 'int' if <sys/socket.h> doesn't have it.
+ */
+#undef socklen_t
+
+/* Define if pcre.h must be included as <pcre/pcre.h>
+ */
+#undef PCRE_H_IN_SUBDIR
+
+/* Define if pcreposix.h must be included as <pcre/pcreposix.h>
+ */
+#undef PCREPOSIX_H_IN_SUBDIR
+
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `atexit' function. */
+#undef HAVE_ATEXIT
+
+/* Define to 1 if you have the `bcopy' function. */
+#undef HAVE_BCOPY
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `gethostbyaddr' function. */
+#undef HAVE_GETHOSTBYADDR
+
+/* Define to 1 if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
+
+/* Define to 1 if you have the `inet_ntoa' function. */
+#undef HAVE_INET_NTOA
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* Define to 1 if you have the `memchr' function. */
+#undef HAVE_MEMCHR
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `memset' function. */
+#undef HAVE_MEMSET
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <OS.h> header file. */
+#undef HAVE_OS_H
+
+/* Define to 1 if you have the `regcomp' function. */
+#undef HAVE_REGCOMP
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the `socket' function. */
+#undef HAVE_SOCKET
+
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_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 `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the `strftime' function. */
+#undef HAVE_STRFTIME
+
+/* 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 `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_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/timeb.h> header file. */
+#undef HAVE_SYS_TIMEB_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
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to 1 if the `setpgrp' function takes no argument. */
+#undef SETPGRP_VOID
+
+/* The size of `char *', as computed by sizeof. */
+#undef SIZEOF_CHAR_P
+
+/* 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 `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to 'int' if <sys/socket.h> doesn't have it. */
+#undef socklen_t
+
+/*
+ * Defined always.
+ * FIXME: Don't know what it does or why we need it.
+ * (presumably something to do with ANSI Standard C?)
+ */
+#ifndef __STDC__
+#define __STDC__ 1
+#endif /* ndef __STDC__ */
+
+/*
+ * Need to set up this define only for the Pthreads library for
+ * Win32, available from http://sources.redhat.com/pthreads-win32/
+ */
+#if defined(FEATURE_PTHREAD) && defined(_WIN32)
+#define __CLEANUP_C
+#endif /* defined(FEATURE_PTHREAD) && defined(_WIN32) */
+
+/*
+ * BEOS does not currently support POSIX threads.
+ * This *should* be detected by ./configure, but let's be sure.
+ */
+#if defined(FEATURE_PTHREAD) && defined(__BEOS__)
+#error BEOS does not support pthread - please run ./configure again with "--disable-pthread"
+
+#endif /* defined(FEATURE_PTHREAD) && defined(__BEOS__) */
+
+/*
+ * On OpenBSD and maybe also FreeBSD, gcc doesn't define the cpp
+ * symbol unix; it defines __unix__ and sometimes not even that:
+ */
+#if ( defined(__unix__) || defined(__NetBSD__) ) && !defined(unix)
+#define unix 1
+#endif
+
+/*
+ * It's too easy to accidentally use a Cygwin or MinGW32 version of config.h
+ * under VC++, and it usually gives many wierd error messages. Let's make
+ * the error messages understandable, by bailing out now.
+ */
+#ifdef _MSC_VER
+#error For MS VC++, please use vc_config_winthreads.h or vc_config_pthreads.h. You can usually do this by selecting the "Build", "Clean" menu option.
+#endif /* def _MSC_VER */
+
+#endif /* CONFIG_H_INCLUDED */
diff --git a/package/privoxy/extra/configure b/package/privoxy/extra/configure
new file mode 100644
index 000000000..f4e92ba8d
--- /dev/null
+++ b/package/privoxy/extra/configure
@@ -0,0 +1,11272 @@
+#! /bin/sh
+# From configure.in Revision: 1.68.2.19 .
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61-MirPorts-0.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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=:
+ # Zsh 3.x and 4.x performs 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
+
+
+
+
+# PATH needs CR
+# 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
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+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.)
+as_nl='
+'
+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
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+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
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if (set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs 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
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs 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_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if (set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell autoconf@gnu.org about your system,
+ echo including any error possibly output before this
+ echo message
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. 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" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); 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
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+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
+fi
+echo >conf$$.file
+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
+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=:
+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 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=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="jcc.c"
+# 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='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+VERSION_MAJOR
+VERSION_MINOR
+VERSION_POINT
+CODE_STATUS
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+CPP
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+LN_S
+SET_MAKE
+AWK
+GDB
+BGROUPS
+ID
+USER
+GROUP
+WIN_ONLY
+WDUMP
+DB2HTML
+RPMBIN
+RPM_BASE
+JADEBIN
+MAN2HTML
+DOC_STATUS
+JADECAT
+DKPREFIX
+GREP
+EGREP
+PTHREAD_ONLY
+SOCKET_LIB
+AMIGAOS_ONLY
+STATIC_PCRE_ONLY
+STATIC_PCRS_ONLY
+SPECIAL_CFLAGS
+PTHREAD_LIB
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# 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}'
+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_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=\$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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=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 ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ 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'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+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
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+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
+ 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 .` ||
+ { echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# 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 -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+ 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 .."
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ 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 this package 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/PACKAGE]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-mingw32 Use mingw32 for a Windows GUI
+ --disable-pthread Don't use POSIX threads (pthreads)
+ --disable-toggle Don't support temporary disable
+ --disable-force Don't allow single-page disable
+ --disable-fast-redirects Don't support fast redirects
+ --disable-killpopup Never block popups
+ --disable-stats Don't keep statistics
+ --enable-ie-images Enable a quick but not always reliable auto-detect whether requests from
+ MS Internet Explorer are for an image or not.
+ --disable-image-blocking Don't try to figure out whether a request is
+ for an image or HTML - assume HTML.
+ --disable-acl-files Prevents the use of ACL files to control access to
+ the proxy by IP address.
+ --disable-trust-files Prevents the use of trust files.
+ --disable-jar-files Prevents the use of jar files to capture cookies.
+ --disable-editor Prevents the use of the web-based actions file
+ editor and web-based temporary disable setting.
+ --enable-no-gifs Use politically correct PNG format instead of GIF
+ for built-in images. May not work with all browsers.
+ --disable-dynamic-pcre Use the built-in, static pcre, even if
+ libpcre is available
+ --disable-dynamic-pcrs Use the built-in, static pcrs, even if
+ libpcrs is available
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-docbook=yes|no|directory
+ Enable docbook documentation creation
+ (default = yes, for gnu and linux)
+ --with-db2html=<path/executable>
+ Set the location of the docbook to html converter
+ (default = search)
+ --with-debug Enable debug mode
+ --with-user=privoxy Set user under which privoxy will run
+ --with-group=privoxy Set group for privoxy
+
+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
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_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" || continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`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
+ 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
+configure
+generated by GNU Autoconf 2.61-MirPorts-0
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+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 $as_me, which was
+generated by GNU Autoconf 2.61-MirPorts-0. 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=.
+ 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=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$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
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_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=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ 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=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ 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 &&
+ echo "$as_me: caught signal $ac_signal"
+ 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'; { (exit 1); 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
+
+# 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
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+ set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+ set x "$ac_default_prefix/share/config.site" \
+ "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+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
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+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,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+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
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`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.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+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 ! -f config.h.in; then
+ echo "You need to run autoheader first. "
+ echo -n "Shall I do this for you now? (y/n) "
+ read answer
+ if test "$answer" != "y"; then
+ exit 1
+ else
+ autoheader
+ fi
+fi
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in $GNUSYSTEM_AUX_DIR "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+ { (exit 1); exit 1; }; }
+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 ||
+ { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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 &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+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
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+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
+
+
+
+dodk=auto
+DKPREFIX=none
+
+# Check whether --with-docbook was given.
+if test "${with_docbook+set}" = set; then
+ withval=$with_docbook; case "$with_docbook" in
+yes) dodk=yes;;
+no) dodk=no;;
+*)
+ dodk=yes
+ DKPREFIX=$withval
+ ;;
+esac
+
+fi
+
+DB2HTML=false
+
+# Check whether --with-db2html was given.
+if test "${with_db2html+set}" = set; then
+ withval=$with_db2html; DB2HTML=$withval
+
+fi
+
+
+
+VERSION_MAJOR=3
+VERSION_MINOR=0
+VERSION_POINT=3
+CODE_STATUS="stable"
+
+
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION_MAJOR ${VERSION_MAJOR}
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION_MINOR ${VERSION_MINOR}
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION_POINT ${VERSION_POINT}
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_POINT}"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define CODE_STATUS "${CODE_STATUS}"
+_ACEOF
+
+
+
+if test "X$CFLAGS" = "X"; then
+ CFLAGS=" "
+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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ echo "$as_me:$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
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ echo "$as_me:$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
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ echo "$as_me:$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
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ echo "$as_me:$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
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ echo "$as_me:$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
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ echo "$as_me:$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
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}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:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.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.
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort. b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions. Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; 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 | *.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
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+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.
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.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.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; 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 | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; 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 ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+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
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$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
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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"
+ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+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)
+ { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+ xno)
+ { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+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
+
+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
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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
+ echo $ECHO_N "(cached) $ECHO_C" >&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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # 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
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # 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
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+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
+
+# 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.
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+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="$SHELL $ac_install_sh"
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$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'
+
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`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
+ echo $ECHO_N "(cached) $ECHO_C" >&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
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ SET_MAKE=
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+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
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ echo "$as_me:$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
+ { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+
+# Extract the first word of "gdb", so it can be a program name with args.
+set dummy gdb; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_GDB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$GDB"; then
+ ac_cv_prog_GDB="$GDB" # 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_GDB="yes"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_GDB" && ac_cv_prog_GDB="no"
+fi
+fi
+GDB=$ac_cv_prog_GDB
+if test -n "$GDB"; then
+ { echo "$as_me:$LINENO: result: $GDB" >&5
+echo "${ECHO_T}$GDB" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+# Extract the first word of "groups", so it can be a program name with args.
+set dummy groups; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_BGROUPS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $BGROUPS in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_BGROUPS="$BGROUPS" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/bin:/usr/bin:/usr/local/bin"
+for as_dir in $as_dummy
+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_BGROUPS="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_BGROUPS" && ac_cv_path_BGROUPS="no"
+ ;;
+esac
+fi
+BGROUPS=$ac_cv_path_BGROUPS
+if test -n "$BGROUPS"; then
+ { echo "$as_me:$LINENO: result: $BGROUPS" >&5
+echo "${ECHO_T}$BGROUPS" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+# Extract the first word of "id", so it can be a program name with args.
+set dummy id; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ID+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $ID in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ID="$ID" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/bin:/usr/bin:/usr/local/bin"
+for as_dir in $as_dummy
+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_ID="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_ID" && ac_cv_path_ID="no"
+ ;;
+esac
+fi
+ID=$ac_cv_path_ID
+if test -n "$ID"; then
+ { echo "$as_me:$LINENO: result: $ID" >&5
+echo "${ECHO_T}$ID" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+
+
+
+
+
+# Check whether --with-debug was given.
+if test "${with_debug+set}" = set; then
+ withval=$with_debug;
+ if test "x$withval" != "xno" ; then
+ if test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ if test "$GDB"; then
+ CFLAGS="$CFLAGS -ggdb"
+ else
+ CFLAGS="$CFLAGS -g"
+ fi
+ CFLAGS="$CFLAGS -Wshadow -Wconversion"
+ else
+ CFLAGS="$CFLAGS -g"
+ fi
+ fi
+ fi
+
+else
+
+ if test "X$CFLAGS" = "X "; then # if CFLAGS were unset (see above)
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ fi
+ fi
+
+
+fi
+
+
+
+
+if true test "$EMXOS2" = yes; then
+ echo "Skipping user and group validity stuff.";
+
+else
+
+ $ID privoxy >/dev/null 2>/dev/null
+ if test $? -ne 0 ; then
+ { echo "$as_me:$LINENO: WARNING: There is no user 'privoxy' on this system" >&5
+echo "$as_me: WARNING: There is no user 'privoxy' on this system" >&2;}
+ fi
+ { echo "$as_me:$LINENO: checking for user" >&5
+echo $ECHO_N "checking for user... $ECHO_C" >&6; }
+
+# Check whether --with-user was given.
+if test "${with_user+set}" = set; then
+ withval=$with_user;
+ if test "x$withval" != "xyes"; then
+ if test $ID = no ; then
+ { { echo "$as_me:$LINENO: error: There is no 'id' program on this system" >&5
+echo "$as_me: error: There is no 'id' program on this system" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me:$LINENO: result: $with_user" >&5
+echo "${ECHO_T}$with_user" >&6; }
+ $ID $with_user 2>/dev/null >/dev/null
+ if test $? -eq 0 ; then
+ USER=$with_user;
+ else
+ { { echo "$as_me:$LINENO: error: There is no user '$with_user' on this system" >&5
+echo "$as_me: error: There is no user '$with_user' on this system" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+ else
+ { { echo "$as_me:$LINENO: error: We need a user if you give me this parameter" >&5
+echo "$as_me: error: We need a user if you give me this parameter" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+else
+
+ if test $ID = no ; then
+ { { echo "$as_me:$LINENO: error: There is no 'id' programm on this system" >&5
+echo "$as_me: error: There is no 'id' programm on this system" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me:$LINENO: result: none specified" >&5
+echo "${ECHO_T}none specified" >&6; }
+ USER=$with_user
+ fi
+
+
+fi
+
+
+
+ { echo "$as_me:$LINENO: checking for group" >&5
+echo $ECHO_N "checking for group... $ECHO_C" >&6; }
+
+# Check whether --with-group was given.
+if test "${with_group+set}" = set; then
+ withval=$with_group;
+ if test "x$withval" != "xyes"; then
+ if test $BGROUPS = no ; then
+ { { echo "$as_me:$LINENO: error: There is no 'groups' program on this system" >&5
+echo "$as_me: error: There is no 'groups' program on this system" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me:$LINENO: result: $with_group" >&5
+echo "${ECHO_T}$with_group" >&6; }
+ $BGROUPS $USER >/dev/null
+ if test $? -eq 0 ; then
+ # FIXME: this fails if valid group, but not first group
+ # listed.
+ if test "$with_group" != "`$BGROUPS $USER | sed 's/.*: //' 2>/dev/null |$AWK '{print $1}'`" ; then
+ { { echo "$as_me:$LINENO: error: The given value '$withval' does not match group entry" >&5
+echo "$as_me: error: The given value '$withval' does not match group entry" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ GROUP=$with_group;
+ fi
+ else
+ { { echo "$as_me:$LINENO: error: There is no group entry for user '$USER'" >&5
+echo "$as_me: error: There is no group entry for user '$USER'" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+ else
+ { { echo "$as_me:$LINENO: error: We need a group if you give me this parameter" >&5
+echo "$as_me: error: We need a group if you give me this parameter" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+else
+
+ if test $BGROUPS = no ; then
+ { { echo "$as_me:$LINENO: error: There is no 'groups' programm on this system" >&5
+echo "$as_me: error: There is no 'groups' programm on this system" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me:$LINENO: result: none specified" >&5
+echo "${ECHO_T}none specified" >&6; }
+ GROUP=$with_group;
+ fi
+
+
+fi
+
+
+
+fi
+
+if test "$GCC"; then
+ CFLAGS="-pipe $CFLAGS"
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+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
+
+
+case $host_os in
+ *mingw32* ) MINGW32=yes;;
+ * ) MINGW32=no;;
+esac
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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` ||
+ { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+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
+
+
+case $host_os in
+ *cygwin* ) CYGWIN=yes;;
+ * ) CYGWIN=no;;
+esac
+
+
+if test "$MINGW32" = "yes"; then
+ target_type=mingw
+else
+ if test "$CYGWIN" = "yes"; then
+ target_type=cygwin
+ else
+ target_type=unix
+ fi
+fi
+
+if test $dodk = auto; then
+ dodk=no
+ if test $target_type = unix; then
+ case "$host_os" in
+ linux* | gnu*)
+ dodk=yes
+ ;;
+ esac
+ fi
+fi
+
+
+# Check whether --enable-mingw32 was given.
+if test "${enable_mingw32+set}" = set; then
+ enableval=$enable_mingw32; if test $enableval = yes; then
+ target_type=mingw
+fi
+fi
+
+
+if test $target_type = mingw; then
+ WIN_ONLY=
+ SPECIAL_CFLAGS="-mwindows -mno-cygwin"
+ PTHREAD_LIB=-lpthreadGC
+ echo "Using mingw32 (Win32 GUI)"
+else
+ WIN_ONLY=#
+ if test $target_type = cygwin; then
+ SPECIAL_CFLAGS="-mno-win32"
+ PTHREAD_LIB=
+ echo "Using Cygnus (Win32 command line)"
+ else
+ SPECIAL_CFLAGS=
+ PTHREAD_LIB=-lpthread
+ fi
+fi
+
+
+if test $dodk != no; then
+ for ac_prog in w3m lynx links
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_WDUMP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$WDUMP"; then
+ ac_cv_prog_WDUMP="$WDUMP" # 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_WDUMP="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+WDUMP=$ac_cv_prog_WDUMP
+if test -n "$WDUMP"; then
+ { echo "$as_me:$LINENO: result: $WDUMP" >&5
+echo "${ECHO_T}$WDUMP" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$WDUMP" && break
+done
+test -n "$WDUMP" || WDUMP="false"
+
+ if test "$WDUMP" = false; then
+ { echo "$as_me:$LINENO: WARNING: You need some kind of text browser to build documentation \(w3m, lynx and links are supported\)" >&5
+echo "$as_me: WARNING: You need some kind of text browser to build documentation \(w3m, lynx and links are supported\)" >&2;}
+ fi
+ if test $DB2HTML = false; then
+ DB2HTML=""
+ for ac_prog in db2html docbook2html
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_DB2HTML+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$DB2HTML"; then
+ ac_cv_prog_DB2HTML="$DB2HTML" # 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_DB2HTML="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DB2HTML=$ac_cv_prog_DB2HTML
+if test -n "$DB2HTML"; then
+ { echo "$as_me:$LINENO: result: $DB2HTML" >&5
+echo "${ECHO_T}$DB2HTML" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$DB2HTML" && break
+done
+test -n "$DB2HTML" || DB2HTML="false"
+
+ fi
+fi
+
+
+
+for ac_prog in rpm
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_RPMBIN+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RPMBIN"; then
+ ac_cv_prog_RPMBIN="$RPMBIN" # 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_RPMBIN="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RPMBIN=$ac_cv_prog_RPMBIN
+if test -n "$RPMBIN"; then
+ { echo "$as_me:$LINENO: result: $RPMBIN" >&5
+echo "${ECHO_T}$RPMBIN" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$RPMBIN" && break
+done
+test -n "$RPMBIN" || RPMBIN="false"
+
+if test $RPMBIN != false; then
+ RPM_BASE=`rpm --eval "%{_topdir}"`
+ if test "$RPM_BASE" = ""; then
+ RPM_BASE=/usr/src/redhat
+ fi
+fi
+
+
+for ac_prog in jade openjade
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_JADEBIN+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$JADEBIN"; then
+ ac_cv_prog_JADEBIN="$JADEBIN" # 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_JADEBIN="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+JADEBIN=$ac_cv_prog_JADEBIN
+if test -n "$JADEBIN"; then
+ { echo "$as_me:$LINENO: result: $JADEBIN" >&5
+echo "${ECHO_T}$JADEBIN" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$JADEBIN" && break
+done
+test -n "$JADEBIN" || JADEBIN="false"
+
+
+
+for ac_prog in man2html
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_prog_MAN2HTML+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$MAN2HTML"; then
+ ac_cv_prog_MAN2HTML="$MAN2HTML" # 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_MAN2HTML="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+MAN2HTML=$ac_cv_prog_MAN2HTML
+if test -n "$MAN2HTML"; then
+ { echo "$as_me:$LINENO: result: $MAN2HTML" >&5
+echo "${ECHO_T}$MAN2HTML" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ test -n "$MAN2HTML" && break
+done
+test -n "$MAN2HTML" || MAN2HTML="false"
+
+
+
+DOC_STATUS=p-not-stable
+if test $CODE_STATUS = stable; then
+ DOC_STATUS="p-stable"
+fi
+
+
+JADECAT=""
+if test $dodk = yes; then
+ if test $DKPREFIX = none; then
+ for i in /usr/share/sgml/docbook/dsssl-stylesheets \
+ /usr/share/sgml/docbkdsl /usr/share/sgml/docbook-dsssl \
+ /usr/local/share/sgml/docbook/dsssl/modular \
+ /usr/share/sgml/docbook/stylesheet/dsssl/modular/ \
+ ; do
+ { echo "$as_me:$LINENO: checking for $i" >&5
+echo $ECHO_N "checking for $i... $ECHO_C" >&6; }
+ if test -f $i/html/docbook.dsl; then
+ echo "yes"
+ DKPREFIX=$i
+ break
+ else
+ echo "no"
+ fi
+ done
+# where are the catalogs?
+ for i in /usr/share/sgml/CATALOG.docbk30 \
+ /usr/share/sgml/CATALOG.docbk31 \
+ /usr/share/sgml/CATALOG.docbk31 \
+ /usr/local/share/sgml/docbook/3.0/docbook.cat \
+ /usr/local/share/sgml/docbook/3.1/docbook.cat \
+ /usr/share/sgml/docbook/dtd/3.1/docbook.cat \
+ ; do
+ { echo "$as_me:$LINENO: checking for $i" >&5
+echo $ECHO_N "checking for $i... $ECHO_C" >&6; }
+ if test -f $i; then
+ echo "yes"
+ JADECAT="$JADECAT -c $i"
+ else
+ echo "no"
+ fi
+ done
+ fi
+fi
+
+
+
+old_CFLAGS_nospecial=$CFLAGS
+CFLAGS="$CFLAGS $SPECIAL_CFLAGS"
+
+# Hack to force AutoConf to use the CFLAGS we just set
+ac_cpp='$CPP $CPPFLAGS $SPECIAL_CFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ 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
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ 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
+ ac_count=`expr $ac_count + 1`
+ 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
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ 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
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ 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
+ ac_count=`expr $ac_count + 1`
+ 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
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+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=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "${ac_cv_header_pthread_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pthread_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking pthread.h usability" >&5
+echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <pthread.h>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking pthread.h presence" >&5
+echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pthread.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pthread_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_pthread_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; }
+
+fi
+if test $ac_cv_header_pthread_h = yes; then
+ have_pthread=yes
+else
+ have_pthread=no
+fi
+
+
+
+# Check whether --enable-pthread was given.
+if test "${enable_pthread+set}" = set; then
+ enableval=$enable_pthread; if test $enableval = no; then
+ # Disable pthreads
+ have_pthread=no
+fi
+fi
+
+
+if test $have_pthread = yes; then
+ PTHREAD_ONLY=
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_PTHREAD 1
+_ACEOF
+
+ echo Using POSIX threads
+ if test "$GCC" = "yes"; then
+ # Set a GCC specific switch:
+ if test "$target_type" = "unix"; then
+ ac_jgf_save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -pthread"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pthread.h>
+int
+main ()
+{
+void *p = pthread_create;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+ # This compiler switch makes GCC on Linux thread-safe
+ # However, it's not supported on most other OS.
+ PTHREAD_LIB=
+ SPECIAL_CFLAGS="-pthread"
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$ac_jgf_save_CFLAGS
+ fi
+ fi
+else
+ PTHREAD_ONLY=#
+ echo Using native threads
+fi
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; }
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_nsl_gethostbyname=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+ LIBS="-lnsl $LIBS"
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for gethostbyaddr_r" >&5
+echo $ECHO_N "checking for gethostbyaddr_r... $ECHO_C" >&6; }
+if test "${ac_cv_func_gethostbyaddr_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ mirsave_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gethostbyaddr_r to an innocuous variant, in case <limits.h> declares gethostbyaddr_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyaddr_r innocuous_gethostbyaddr_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyaddr_r (); 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 gethostbyaddr_r
+
+/* 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 gethostbyaddr_r ();
+/* 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_gethostbyaddr_r || defined __stub___gethostbyaddr_r
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyaddr_r ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_gethostbyaddr_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_gethostbyaddr_r=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyaddr_r" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyaddr_r" >&6; }
+CPPFLAGS=$mirsave_CPPFLAGS
+if test $ac_cv_func_gethostbyaddr_r = yes; then
+
+ { echo "$as_me:$LINENO: checking signature of gethostbyaddr_r" >&5
+echo $ECHO_N "checking signature of gethostbyaddr_r... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h, *hp;
+ char *a, *b;
+ int l, bl, t, e;
+ (void) gethostbyaddr_r(a, l, t, h, b, bl, &hp, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYADDR_R_8_ARGS 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: 8 args" >&5
+echo "${ECHO_T}8 args" >&6; }
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h;
+ char *a, *b;
+ int l, bl, t, e;
+ (void) gethostbyaddr_r(a, l, t, h, b, bl, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYADDR_R_7_ARGS 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: 7 args" >&5
+echo "${ECHO_T}7 args" >&6; }
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent_data *d;
+ struct hostent *h;
+ char a,
+ int l, t;
+ (void) gethostbyaddr_r(a, l, t, h, d)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYADDR_R_5_ARGS 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: 5 args" >&5
+echo "${ECHO_T}5 args" >&6; }
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ { echo "$as_me:$LINENO: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6; }
+
+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
+
+else
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5
+echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; }
+if test "${ac_cv_func_gethostbyname_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ mirsave_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gethostbyname_r to an innocuous variant, in case <limits.h> declares gethostbyname_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyname_r innocuous_gethostbyname_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname_r (); 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 gethostbyname_r
+
+/* 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 gethostbyname_r ();
+/* 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_gethostbyname_r || defined __stub___gethostbyname_r
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyname_r ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_gethostbyname_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_gethostbyname_r=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; }
+CPPFLAGS=$mirsave_CPPFLAGS
+if test $ac_cv_func_gethostbyname_r = yes; then
+
+ { echo "$as_me:$LINENO: checking signature of gethostbyname_r" >&5
+echo $ECHO_N "checking signature of gethostbyname_r... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h, *r;
+ char *n, *b;
+ int bl, e;
+ (void) gethostbyname_r(n, h, b, bl, &r, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYNAME_R_6_ARGS 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: 6 args" >&5
+echo "${ECHO_T}6 args" >&6; }
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent *h;
+ char *n, *b;
+ int bl, e;
+ (void) gethostbyname_r(n, h, b, bl, &e)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYNAME_R_5_ARGS 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: 5 args" >&5
+echo "${ECHO_T}5 args" >&6; }
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <netdb.h>
+
+int
+main ()
+{
+
+ struct hostent_data *d;
+ struct hostent *h;
+ char *n,
+ (void) gethostbyname_r(n, h, d)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GETHOSTBYNAME_R_3_ARGS 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: 3 args" >&5
+echo "${ECHO_T}3 args" >&6; }
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ { echo "$as_me:$LINENO: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6; }
+
+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
+
+else
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for gmtime_r" >&5
+echo $ECHO_N "checking for gmtime_r... $ECHO_C" >&6; }
+if test "${ac_cv_func_gmtime_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ mirsave_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gmtime_r to an innocuous variant, in case <limits.h> declares gmtime_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gmtime_r innocuous_gmtime_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gmtime_r (); 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 gmtime_r
+
+/* 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 gmtime_r ();
+/* 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_gmtime_r || defined __stub___gmtime_r
+choke me
+#endif
+
+int
+main ()
+{
+return gmtime_r ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_gmtime_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_gmtime_r=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_gmtime_r" >&5
+echo "${ECHO_T}$ac_cv_func_gmtime_r" >&6; }
+CPPFLAGS=$mirsave_CPPFLAGS
+if test $ac_cv_func_gmtime_r = yes; then
+
+ { echo "$as_me:$LINENO: checking signature of gmtime_r" >&5
+echo $ECHO_N "checking signature of gmtime_r... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <time.h>
+
+int
+main ()
+{
+
+ struct time *t;
+ struct tm *tm;
+ (void) gmtime_r(t, tm)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_GMTIME_R 1
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ { echo "$as_me:$LINENO: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking for localtime_r" >&5
+echo $ECHO_N "checking for localtime_r... $ECHO_C" >&6; }
+if test "${ac_cv_func_localtime_r+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ mirsave_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define localtime_r to an innocuous variant, in case <limits.h> declares localtime_r.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define localtime_r innocuous_localtime_r
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char localtime_r (); 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 localtime_r
+
+/* 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 localtime_r ();
+/* 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_localtime_r || defined __stub___localtime_r
+choke me
+#endif
+
+int
+main ()
+{
+return localtime_r ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_localtime_r=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_localtime_r=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_localtime_r" >&5
+echo "${ECHO_T}$ac_cv_func_localtime_r" >&6; }
+CPPFLAGS=$mirsave_CPPFLAGS
+if test $ac_cv_func_localtime_r = yes; then
+
+ { echo "$as_me:$LINENO: checking signature of localtime_r" >&5
+echo $ECHO_N "checking signature of localtime_r... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+# include <time.h>
+
+int
+main ()
+{
+
+ struct time *t;
+ struct tm *tm;
+ (void) localtime_r(t, tm)
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+
+ { echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6; }
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOCALTIME_R 1
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ { echo "$as_me:$LINENO: result: unrecognised" >&5
+echo "${ECHO_T}unrecognised" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+
+
+
+SOCKET_LIB=
+
+case "$host" in
+*-solaris*) SOCKET_LIB="-lsocket -lnsl"
+ cat >>confdefs.h <<\_ACEOF
+#define __EXTENSIONS__ 1
+_ACEOF
+
+ if test "$GCC" = "yes"; then
+ # Set a GCC specific switch:
+ # This compiler switch makes Solaris thread-safe
+ PTHREAD_LIB=
+ SPECIAL_CFLAGS="-pthreads"
+ else
+ # What do we do without GCC? Guess this:
+ SPECIAL_CFLAGS="-D_REENTRANT"
+ fi
+;;
+esac
+
+
+
+
+{ echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/socket.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "socklen_t" >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define socklen_t int
+_ACEOF
+
+fi
+rm -f conftest*
+
+
+
+
+case "$host" in
+*-os2-emx*) SOCKET_LIB=-lsocket
+;;
+esac
+
+
+
+
+case "$host" in
+*-apple-darwin*) SPECIAL_CFLAGS="-Dunix -DOSX_DARWIN"
+;;
+esac
+
+
+case "$host" in
+*-openbsd*) SPECIAL_CFLAGS="$SPECIAL_CFLAGS -Dunix"
+;;
+esac
+
+
+AMIGAOS_ONLY=#
+
+case "$host" in
+*-amigaos) AMIGAOS_ONLY=
+;;
+esac
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' dir; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_opendir=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_opendir+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+ :
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+else
+ { echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 opendir ();
+int
+main ()
+{
+return opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' x; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_search_opendir=$ac_res
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ if test "${ac_cv_search_opendir+set}" = set; then
+ break
+fi
+done
+if test "${ac_cv_search_opendir+set}" = set; then
+ :
+else
+ ac_cv_search_opendir=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
+ac_res=$ac_cv_search_opendir
+if test "$ac_res" != no; then
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+fi
+
+{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_c_const=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef size_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_size_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_pid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef pid_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_pid_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_pid_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
+if test $ac_cv_type_pid_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_time=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; }
+if test "${ac_cv_struct_tm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+
+int
+main ()
+{
+struct tm tm;
+ int *p = &tm.tm_sec;
+ return !p;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_struct_tm=time.h
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_struct_tm=sys/time.h
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6; }
+if test $ac_cv_struct_tm = sys/time.h; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TM_IN_SYS_TIME 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6; }
+if test "${ac_cv_type_int+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef int ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_int=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_int=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6; }
+
+# 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.
+{ echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') if test "$ac_cv_type_int" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_int=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef int ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_int=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_int" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for char *" >&5
+echo $ECHO_N "checking for char *... $ECHO_C" >&6; }
+if test "${ac_cv_type_char_p+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef char * ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_char_p=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_char_p=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_char_p" >&5
+echo "${ECHO_T}$ac_cv_type_char_p" >&6; }
+
+# 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.
+{ echo "$as_me:$LINENO: checking size of char *" >&5
+echo $ECHO_N "checking size of char *... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_char_p+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef char * ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef char * ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef char * ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef char * ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef char * ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_char_p=$ac_lo;;
+'') if test "$ac_cv_type_char_p" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (char *)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (char *)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_char_p=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef char * ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_char_p=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_char_p" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (char *)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (char *)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_char_p=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char_p" >&5
+echo "${ECHO_T}$ac_cv_sizeof_char_p" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef long ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_long=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6; }
+
+# 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.
+{ echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') if test "$ac_cv_type_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for long long" >&5
+echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
+if test "${ac_cv_type_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef long long ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_long_long=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_long_long=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
+echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
+
+# 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.
+{ echo "$as_me:$LINENO: checking size of long long" >&5
+echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long long ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long_long=$ac_lo;;
+'') if test "$ac_cv_type_long_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef long long ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_long_long=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_long_long" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef size_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_size_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+
+# 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.
+{ echo "$as_me:$LINENO: checking size of size_t" >&5
+echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; }
+if test "${ac_cv_sizeof_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ 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
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef size_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_size_t=$ac_lo;;
+'') if test "$ac_cv_type_size_t" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_size_t=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef size_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld\n", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu\n", i);
+ }
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_size_t=`cat conftest.val`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_size_t" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_size_t=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
+echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in OS.h arpa/inet.h errno.h fcntl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h sys/wait.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+for ac_func in strerror bcopy memmove
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ mirsave_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+CPPFLAGS=$mirsave_CPPFLAGS
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; }
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+{ echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
+echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6; }
+if test "${ac_cv_func_setpgrp_void+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
+echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+/* If this system has a BSD-style setpgrp which takes arguments,
+ setpgrp(1, 1) will fail with ESRCH and return -1, in that case
+ exit successfully. */
+ return setpgrp (1,1) != -1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_setpgrp_void=no
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_setpgrp_void=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6; }
+if test $ac_cv_func_setpgrp_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SETPGRP_VOID 1
+_ACEOF
+
+fi
+
+{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
+if test "${ac_cv_type_signal+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_signal=int
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_signal=void
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in atexit getcwd gethostbyaddr gethostbyname inet_ntoa localtime_r memchr memmove memset regcomp select setlocale socket strchr strdup strerror strftime strstr strtoul
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ mirsave_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="-D_MIRMAKE_H $CPPFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); 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 $ac_func
+
+/* 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 $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+CPPFLAGS=$mirsave_CPPFLAGS
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+{ echo "$as_me:$LINENO: checking for pcre_compile in -lpcre" >&5
+echo $ECHO_N "checking for pcre_compile in -lpcre... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pcre_pcre_compile+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpcre $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 pcre_compile ();
+int
+main ()
+{
+return pcre_compile ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_pcre_pcre_compile=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_pcre_pcre_compile=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcre_pcre_compile" >&5
+echo "${ECHO_T}$ac_cv_lib_pcre_pcre_compile" >&6; }
+if test $ac_cv_lib_pcre_pcre_compile = yes; then
+
+ if test "${ac_cv_header_pcre_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for pcre.h" >&5
+echo $ECHO_N "checking for pcre.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcre_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcre_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcre_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking pcre.h usability" >&5
+echo $ECHO_N "checking pcre.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <pcre.h>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking pcre.h presence" >&5
+echo $ECHO_N "checking pcre.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcre.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: pcre.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pcre.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pcre.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: pcre.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pcre.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pcre.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pcre.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pcre.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pcre.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pcre.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for pcre.h" >&5
+echo $ECHO_N "checking for pcre.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcre_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_pcre_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcre_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcre_h" >&6; }
+
+fi
+if test $ac_cv_header_pcre_h = yes; then
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcre.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pcre_fullinfo" >/dev/null 2>&1; then
+ have_pcre=yes
+else
+ { echo "$as_me:$LINENO: WARNING: pcre old version installed" >&5
+echo "$as_me: WARNING: pcre old version installed" >&2;}; have_pcre=no
+fi
+rm -f conftest*
+
+
+else
+
+ if test "${ac_cv_header_pcre_pcre_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for pcre/pcre.h" >&5
+echo $ECHO_N "checking for pcre/pcre.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcre_pcre_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcre_pcre_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcre_pcre_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking pcre/pcre.h usability" >&5
+echo $ECHO_N "checking pcre/pcre.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <pcre/pcre.h>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking pcre/pcre.h presence" >&5
+echo $ECHO_N "checking pcre/pcre.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcre/pcre.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pcre/pcre.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pcre/pcre.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pcre/pcre.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pcre/pcre.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pcre/pcre.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pcre/pcre.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pcre/pcre.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcre.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pcre/pcre.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for pcre/pcre.h" >&5
+echo $ECHO_N "checking for pcre/pcre.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcre_pcre_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_pcre_pcre_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcre_pcre_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcre_pcre_h" >&6; }
+
+fi
+if test $ac_cv_header_pcre_pcre_h = yes; then
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcre/pcre.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pcre_fullinfo" >/dev/null 2>&1; then
+ have_pcre=yes; cat >>confdefs.h <<\_ACEOF
+#define PCRE_H_IN_SUBDIR 1
+_ACEOF
+
+else
+ { echo "$as_me:$LINENO: WARNING: pcre old version installed" >&5
+echo "$as_me: WARNING: pcre old version installed" >&2;}; have_pcre=no
+fi
+rm -f conftest*
+
+
+else
+ have_pcre=no
+fi
+
+
+
+fi
+
+
+
+else
+ have_pcre=no
+fi
+
+
+{ echo "$as_me:$LINENO: checking for regcomp in -lpcreposix" >&5
+echo $ECHO_N "checking for regcomp in -lpcreposix... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pcreposix_regcomp+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpcreposix -lpcre $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 regcomp ();
+int
+main ()
+{
+return regcomp ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_pcreposix_regcomp=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_pcreposix_regcomp=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcreposix_regcomp" >&5
+echo "${ECHO_T}$ac_cv_lib_pcreposix_regcomp" >&6; }
+if test $ac_cv_lib_pcreposix_regcomp = yes; then
+
+ if test "${ac_cv_header_pcreposix_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for pcreposix.h" >&5
+echo $ECHO_N "checking for pcreposix.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcreposix_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcreposix_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcreposix_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking pcreposix.h usability" >&5
+echo $ECHO_N "checking pcreposix.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <pcreposix.h>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking pcreposix.h presence" >&5
+echo $ECHO_N "checking pcreposix.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcreposix.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pcreposix.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pcreposix.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pcreposix.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pcreposix.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pcreposix.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pcreposix.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pcreposix.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcreposix.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pcreposix.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for pcreposix.h" >&5
+echo $ECHO_N "checking for pcreposix.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcreposix_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_pcreposix_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcreposix_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcreposix_h" >&6; }
+
+fi
+if test $ac_cv_header_pcreposix_h = yes; then
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcreposix.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pcreposix_regerror" >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: WARNING: pcreposix old version installed" >&5
+echo "$as_me: WARNING: pcreposix old version installed" >&2;}; have_pcreposix=no
+else
+ have_pcreposix=yes
+fi
+rm -f conftest*
+
+
+else
+
+ if test "${ac_cv_header_pcre_pcreposix_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for pcre/pcreposix.h" >&5
+echo $ECHO_N "checking for pcre/pcreposix.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcre_pcreposix_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcre_pcreposix_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcre_pcreposix_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking pcre/pcreposix.h usability" >&5
+echo $ECHO_N "checking pcre/pcreposix.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <pcre/pcreposix.h>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking pcre/pcreposix.h presence" >&5
+echo $ECHO_N "checking pcre/pcreposix.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcre/pcreposix.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcre/pcreposix.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pcre/pcreposix.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for pcre/pcreposix.h" >&5
+echo $ECHO_N "checking for pcre/pcreposix.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcre_pcreposix_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_pcre_pcreposix_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcre_pcreposix_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcre_pcreposix_h" >&6; }
+
+fi
+if test $ac_cv_header_pcre_pcreposix_h = yes; then
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcre/pcreposix.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "pcreposix_regerror" >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: WARNING: pcreposix old version installed" >&5
+echo "$as_me: WARNING: pcreposix old version installed" >&2;}; have_pcreposix=no
+else
+ have_pcreposix=yes; cat >>confdefs.h <<\_ACEOF
+#define PCREPOSIX_H_IN_SUBDIR 1
+_ACEOF
+
+fi
+rm -f conftest*
+
+
+else
+ have_pcreposix=no
+fi
+
+
+
+fi
+
+
+
+else
+ have_pcreposix=no
+fi
+
+
+{ echo "$as_me:$LINENO: checking for pcrs_compile in -lpcrs" >&5
+echo $ECHO_N "checking for pcrs_compile in -lpcrs... $ECHO_C" >&6; }
+if test "${ac_cv_lib_pcrs_pcrs_compile+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpcrs -lpcre $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 pcrs_compile ();
+int
+main ()
+{
+return pcrs_compile ();
+ ;
+ return 0;
+}
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_pcrs_pcrs_compile=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_pcrs_pcrs_compile=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcrs_pcrs_compile" >&5
+echo "${ECHO_T}$ac_cv_lib_pcrs_pcrs_compile" >&6; }
+if test $ac_cv_lib_pcrs_pcrs_compile = yes; then
+ if test "${ac_cv_header_pcrs_h+set}" = set; then
+ { echo "$as_me:$LINENO: checking for pcrs.h" >&5
+echo $ECHO_N "checking for pcrs.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcrs_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcrs_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcrs_h" >&6; }
+else
+ # Is the header compilable?
+{ echo "$as_me:$LINENO: checking pcrs.h usability" >&5
+echo $ECHO_N "checking pcrs.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <pcrs.h>
+_ACEOF
+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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking pcrs.h presence" >&5
+echo $ECHO_N "checking pcrs.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <pcrs.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pcrs.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pcrs.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pcrs.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pcrs.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pcrs.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pcrs.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pcrs.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: pcrs.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pcrs.h: in the future, the compiler will take precedence" >&2;}
+
+ ;;
+esac
+{ echo "$as_me:$LINENO: checking for pcrs.h" >&5
+echo $ECHO_N "checking for pcrs.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_pcrs_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_pcrs_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_pcrs_h" >&5
+echo "${ECHO_T}$ac_cv_header_pcrs_h" >&6; }
+
+fi
+if test $ac_cv_header_pcrs_h = yes; then
+ have_pcrs=yes
+else
+ have_pcrs=no
+fi
+
+
+else
+ have_pcrs=no
+fi
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define __MT__ 1
+_ACEOF
+
+
+
+# Check whether --enable-toggle was given.
+if test "${enable_toggle+set}" = set; then
+ enableval=$enable_toggle; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_TOGGLE 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_TOGGLE 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-force was given.
+if test "${enable_force+set}" = set; then
+ enableval=$enable_force; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_FORCE_LOAD 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_FORCE_LOAD 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-fast-redirects was given.
+if test "${enable_fast_redirects+set}" = set; then
+ enableval=$enable_fast_redirects; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_FAST_REDIRECTS 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_FAST_REDIRECTS 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-killpopup was given.
+if test "${enable_killpopup+set}" = set; then
+ enableval=$enable_killpopup; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_KILL_POPUPS 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_KILL_POPUPS 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-stats was given.
+if test "${enable_stats+set}" = set; then
+ enableval=$enable_stats; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_STATISTICS 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_STATISTICS 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-ie-images was given.
+if test "${enable_ie_images+set}" = set; then
+ enableval=$enable_ie_images; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_IMAGE_DETECT_MSIE 1
+_ACEOF
+
+fi
+fi
+
+
+# Check whether --enable-image-blocking was given.
+if test "${enable_image_blocking+set}" = set; then
+ enableval=$enable_image_blocking; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_IMAGE_BLOCKING 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_IMAGE_BLOCKING 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-acl-files was given.
+if test "${enable_acl_files+set}" = set; then
+ enableval=$enable_acl_files; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_ACL 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_ACL 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-trust-files was given.
+if test "${enable_trust_files+set}" = set; then
+ enableval=$enable_trust_files; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_TRUST 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_TRUST 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-jar-files was given.
+if test "${enable_jar_files+set}" = set; then
+ enableval=$enable_jar_files; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_COOKIE_JAR 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_COOKIE_JAR 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-editor was given.
+if test "${enable_editor+set}" = set; then
+ enableval=$enable_editor; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_CGI_EDIT_ACTIONS 1
+_ACEOF
+
+fi
+else
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_CGI_EDIT_ACTIONS 1
+_ACEOF
+
+fi
+
+
+# Check whether --enable-no-gifs was given.
+if test "${enable_no_gifs+set}" = set; then
+ enableval=$enable_no_gifs; if test $enableval = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define FEATURE_NO_GIFS 1
+_ACEOF
+
+fi
+fi
+
+
+
+
+# Check whether --enable-dynamic-pcre was given.
+if test "${enable_dynamic_pcre+set}" = set; then
+ enableval=$enable_dynamic_pcre; if test $enableval = "no"; then have_pcre=no; fi
+fi
+
+
+# Check whether --enable-dynamic-pcrs was given.
+if test "${enable_dynamic_pcrs+set}" = set; then
+ enableval=$enable_dynamic_pcrs; if test $enableval = "no"; then have_pcrs=no; fi
+fi
+
+
+
+# If we have libpcre and either we also have pcreposix or
+# we don't need pcreposix, then link pcre dynamically; else
+# build it and link statically
+#
+if test $have_pcre = "yes"; then
+ echo "using libpcre"
+ pcre_dyn=yes
+ STATIC_PCRE_ONLY=#
+ LIBS="$LIBS -lpcre -lpcreposix"
+else
+ echo "using built-in static pcre"
+ pcre_dyn=no
+ cat >>confdefs.h <<\_ACEOF
+#define STATIC_PCRE 1
+_ACEOF
+
+ STATIC_PCRE_ONLY=
+fi
+
+# If we have libpcrs and pcre is linked dynamically
+# then also link pcrs dynamically, else build and link
+# pcrs statically
+#
+if test $have_pcrs = "yes" -a $pcre_dyn = "yes"; then
+ echo "using libpcrs"
+ STATIC_PCRS_ONLY=#
+ LIBS="$LIBS -lpcrs"
+else
+ echo "using built-in static pcrs"
+ cat >>confdefs.h <<\_ACEOF
+#define STATIC_PCRS 1
+_ACEOF
+
+ STATIC_PCRS_ONLY=
+fi
+
+
+
+
+
+CFLAGS=$old_CFLAGS_nospecial
+
+
+
+
+ac_config_files="$ac_config_files GNUmakefile doc/source/ldp.dsl"
+
+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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_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" &&
+ { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+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=`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.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $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}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## 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=:
+ # Zsh 3.x and 4.x performs 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
+
+
+
+
+# PATH needs CR
+# 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
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+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.)
+as_nl='
+'
+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
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+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
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. 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" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); 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
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+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
+fi
+echo >conf$$.file
+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
+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=:
+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
+
+# 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 $as_me, which was
+generated by GNU Autoconf 2.61-MirPorts-0. 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
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet 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
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.61-MirPorts-0,
+ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 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'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+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 )
+ echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ 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.
+ -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$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
+if \$ac_cs_recheck; then
+ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ CONFIG_SHELL=$SHELL
+ export CONFIG_SHELL
+ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# 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" ;;
+ "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
+ "doc/source/ldp.dsl") CONFIG_FILES="$CONFIG_FILES doc/source/ldp.dsl" ;;
+
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ 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
+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 '{ (exit 1); 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")
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+VERSION_MAJOR!$VERSION_MAJOR$ac_delim
+VERSION_MINOR!$VERSION_MINOR$ac_delim
+VERSION_POINT!$VERSION_POINT$ac_delim
+CODE_STATUS!$CODE_STATUS$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+CPP!$CPP$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+LN_S!$LN_S$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+AWK!$AWK$ac_delim
+GDB!$GDB$ac_delim
+BGROUPS!$BGROUPS$ac_delim
+ID!$ID$ac_delim
+USER!$USER$ac_delim
+GROUP!$GROUP$ac_delim
+WIN_ONLY!$WIN_ONLY$ac_delim
+WDUMP!$WDUMP$ac_delim
+DB2HTML!$DB2HTML$ac_delim
+RPMBIN!$RPMBIN$ac_delim
+RPM_BASE!$RPM_BASE$ac_delim
+JADEBIN!$JADEBIN$ac_delim
+MAN2HTML!$MAN2HTML$ac_delim
+DOC_STATUS!$DOC_STATUS$ac_delim
+JADECAT!$JADECAT$ac_delim
+DKPREFIX!$DKPREFIX$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+PTHREAD_ONLY!$PTHREAD_ONLY$ac_delim
+SOCKET_LIB!$SOCKET_LIB$ac_delim
+AMIGAOS_ONLY!$AMIGAOS_ONLY$ac_delim
+STATIC_PCRE_ONLY!$STATIC_PCRE_ONLY$ac_delim
+STATIC_PCRS_ONLY!$STATIC_PCRS_ONLY$ac_delim
+SPECIAL_CFLAGS!$SPECIAL_CFLAGS$ac_delim
+PTHREAD_LIB!$PTHREAD_LIB$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_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
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[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 ||
+ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ ac_file_inputs="$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 "`IFS=:
+ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ fi
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin";;
+ 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 ||
+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"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`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 ||
+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" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`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
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# 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=
+
+case `sed -n '/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ 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
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;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
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+
+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"; } &&
+ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+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
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status. If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless. But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
+ac_dB='\\)[ (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+ sed -n '
+ t rset
+ :rset
+ s/^[ ]*#[ ]*define[ ][ ]*//
+ t ok
+ d
+ :ok
+ s/[\\&,]/\\&/g
+ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+ ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then 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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[ #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+ # Write a here document:
+ cat >>$CONFIG_STATUS <<_ACEOF
+ # First, check the format of the line:
+ cat >"\$tmp/defines.sed" <<\\CEOF
+/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
+/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
+b
+:def
+_ACEOF
+ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+ grep . conftest.tail >/dev/null || break
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+ if test x"$ac_file" != x-; then
+ echo "/* $configure_input */" >"$tmp/config.h"
+ cat "$ac_result" >>"$tmp/config.h"
+ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f $ac_file
+ mv "$tmp/config.h" $ac_file
+ fi
+ else
+ echo "/* $configure_input */"
+ cat "$ac_result"
+ fi
+ rm -f "$tmp/out12"
+ ;;
+
+
+ esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# 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 || { (exit 1); exit 1; }
+fi
+
diff --git a/package/privoxy/ipkg/privoxy.control b/package/privoxy/ipkg/privoxy.control
new file mode 100644
index 000000000..2d6ba8a77
--- /dev/null
+++ b/package/privoxy/ipkg/privoxy.control
@@ -0,0 +1,5 @@
+Package: privoxy
+Version: 3.0.3
+Section: net
+Description: web proxy with advanced filtering capabilities
+Priority: optional
diff --git a/package/privoxy/patches/patch-GNUmakefile_in b/package/privoxy/patches/patch-GNUmakefile_in
new file mode 100644
index 000000000..ad40c6013
--- /dev/null
+++ b/package/privoxy/patches/patch-GNUmakefile_in
@@ -0,0 +1,153 @@
+$Id$
+--- privoxy-3.0.12-stable.orig/GNUmakefile.in 2009-02-28 09:28:14.000000000 +0100
++++ privoxy-3.0.12-stable/GNUmakefile.in 2009-04-17 17:47:06.241568604 +0200
+@@ -51,10 +51,6 @@ SNAPVERSION = $(RPM_VERSION)-$(shell d
+ # "make install" directories and variables
+ #############################################################################
+
+-#User Group paras
+-USER = @USER@
+-GROUP = @GROUP@
+-
+ datarootdir = @datarootdir@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+@@ -97,8 +93,6 @@ INSTALL_T = -m $(RA_MODE)
+ INSTALL_D = -m $(DIR_MODE) -d
+ INSTALL_R = -m $(RWD_MODE)
+
+-# install options for superuser install
+-#INSTALL_S = -g @GROUP@ -o @USER@
+
+ #############################################################################
+ # Build tools
+@@ -939,7 +933,7 @@ pcre/chartables.c: pcre/dftables@EXEEX
+ pcre/dftables@EXEEXT@ >pcre/chartables.c
+
+ pcre/dftables@EXEEXT@: pcre/dftables.c pcre/maketables.c pcre/pcre.h pcre/internal.h pcre/config.h
+- $(CC) -o pcre/dftables@EXEEXT@ $(CFLAGS) pcre/dftables.c
++ $(HOSTCC) -o pcre/dftables@EXEEXT@ $(HOSTCFLAGS) pcre/dftables.c
+
+ # Win32
+ w32log.@OBJEXT@: w32log.c errlog.h config.h jcc.h loadcfg.h miscutil.h pcre/pcre.h pcre/pcreposix.h pcrs.h project.h w32log.h w32taskbar.h win32.h
+@@ -1011,13 +1005,6 @@ check_doc:=$(shell if [ ! -d "$(SHARE_DE
+ $(ECHO) "0";\
+ fi)
+
+-# If USER is specified but no GROUP, assume there is a GROUP of same name.
+-GROUP_T:=$(shell if [ x$(GROUP) = x ] && [ x$(USER) != x ];then \
+- $(ECHO) "$(USER)" ;\
+- else\
+- $(ECHO) "$(GROUP)";\
+- fi)
+-
+ install-strip:
+ $(MAKE) install STRIP=-s
+
+@@ -1028,16 +1015,7 @@ install-strip:
+ # universally reliable (eg Solaris). Group handling could be better.
+ # Perhaps the whole user/group validation should be done here, and simplified.
+ PROGRAM_V = Privoxy $(VERSION) $(CODE_STATUS)
+-install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
+- @# Quick test for valid USER.
+- @if [ -n "$(USER)" ]; then \
+- $(ID) $(USER) >/dev/null || exit 1;\
+- fi
+- @# Test for valid group. FIXME. USER does not have to belong to GROUP
+- @# for file ownership purposes.
+-# if [ -n "$(GROUP_T)" ] && [ -n "$(USER)" ] && ! $(GROUPS) $(USER) | $(GREP) "\<$(GROUP_T)\>" >/dev/null; then \
+-# $(ECHO) Group $(GROUP_T) for User $(USER) is invalid && exit 1 ;\
+-# fi
++install: CONF_DEST LOG_DEST PID_DEST check_doc
+
+ @$(ECHO) "Creating directories, and preparing $(PROGRAM_V) installation"
+ $(CHMOD) $(DIR_MODE) $(MKDIR)
+@@ -1106,41 +1084,7 @@ install: CONF_DEST LOG_DEST PID_DEST che
+ $(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\
+ done
+
+- @# FIXME: group/user validation is overly convoluted.
+- @# If superuser install ... we require a minimum of group ownership
+- @# of those files the daemon writes to, to be non-root owned.
+- @if [ "`$(ID) |sed 's/(.*//' |sed 's/.*=//'`" = "0" ] ;then\
+- if [ x$(USER) = x ] || [ $(USER) = root ]; then \
+- if [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \
+- if [ "`$(ID) privoxy`" ] && \
+- $(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) "\<privoxy\>" >/dev/null; then \
+- $(ECHO) "Warning: Setting group owner to privoxy";\
+- GROUP_T=privoxy ;\
+- else \
+- $(ECHO) "******************************************************************" ;\
+- $(ECHO) " WARNING! WARNING! installing config files as root!" ;\
+- $(ECHO) " It is strongly recommended to run $(PROGRAM) as a non-root user," ;\
+- $(ECHO) " and to install the config files as that user and/or group!" ;\
+- $(ECHO) " Please read INSTALL, and create a privoxy user and group!" ;\
+- $(ECHO) "*******************************************************************" ;\
+- exit 1 ;\
+- fi ;\
+- else \
+- GROUP_T=$(GROUP) ;\
+- fi ;\
+- INSTALL_CONF="$(INSTALL_R) -g $$GROUP_T " ;\
+- else \
+- $(ECHO) "Superuser install, installing config files as $(USER):$(GROUP_T)" ;\
+- INSTALL_CONF="$(INSTALL_R) -o $(USER) -g $(GROUP_T)" ;\
+- GROUP_T=$(GROUP_T) ;\
+- fi ;\
+- else \
+- if [ ! "`id $(USER)`" = "`id`" ] ;then \
+- $(ECHO) "** WARNING ** current install user different from configured user!!" ;\
+- $(ECHO) "Edit may fail." ;\
+- fi ;\
+- INSTALL_CONF="$(INSTALL_R)" ;\
+- fi ;\
++ INSTALL_CONF="$(INSTALL_R)" ;\
+ $(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\
+ for i in $(CONFIGS); do \
+ if [ "$$i" = "default.action" ] || [ "$$i" = "default.filter" ] ; then \
+@@ -1162,44 +1106,7 @@ install: CONF_DEST LOG_DEST PID_DEST che
+ [ ! -f $(DESTDIR)$(LOG_DEST)/logfile ] && $(ECHO) Creating logfiles in $(DESTDIR)$(LOG_DEST) || \
+ $(ECHO) Checking logfiles in $(DESTDIR)$(LOG_DEST) ;\
+ $(TOUCH) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
+- if [ x$$USER != x ]; then \
+- $(CHOWN) $$USER $(DESTDIR)$(LOG_DEST)/logfile || \
+- $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
+- fi ;\
+- if [ x$$GROUP_T != x ]; then \
+- $(CHGRP) $$GROUP_T $(DESTDIR)$(LOG_DEST)/logfile || \
+- $(ECHO) "** WARNING ** current install user different from configured user. Logging may fail!!" ;\
+- fi ;\
+- $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;\
+- if [ "$(prefix)" = "/usr/local" ] || [ "$(prefix)" = "/usr" ]; then \
+- if [ -f /etc/slackware-version ] && [ -d /etc/rc.d/ ] && [ -w /etc/rc.d/ ] ; then \
+- $(SED) 's+%PROGRAM%+$(PROGRAM)+' slackware/rc.privoxy.orig | \
+- $(SED) 's+%SBIN_DEST%+$(SBIN_DEST)+' | \
+- $(SED) 's+%CONF_DEST%+$(CONF_DEST)+' | \
+- $(SED) 's+%USER%+$(USER)+' | \
+- $(SED) 's+%GROUP%+$(GROUP_T)+' >slackware/rc.privoxy ;\
+- $(INSTALL) $(INSTALL_P) slackware/rc.privoxy $(DESTDIR)/etc/rc.d/ ;\
+- $(ECHO) "Installing for Slackware." ;\
+- $(ECHO) "Dont forget to add the rc.privoxy to rc.local if you want it started at every boot" ;\
+- elif [ -f /etc/redhat-release ] && [ -d /etc/rc.d/init.d/ ] && [ -w /etc/rc.d/init.d/ ] ; then \
+- $(ECHO) "Installing init script to /etc/rc.d/init.d/privoxy" ;\
+- $(SED) 's,^PRIVOXY_BIN=.*,PRIVOXY_BIN="/usr/local/sbin/$(PROGRAM)",' privoxy.init |\
+- $(SED) 's,^PRIVOXY_CONF=.*,PRIVOXY_CONF="$(CONF_DEST)/config",' |\
+- $(SED) "s,^PRIVOXY_USER=.*,PRIVOXY_USER=$$USER," > init.tmp ;\
+- $(INSTALL) $(INSTALL_P) init.tmp $(DESTDIR)/etc/rc.d/init.d/privoxy && $(RM) init.tmp;\
+- $(MKDIR) $(DESTDIR)/etc/logrotate.d/ ;\
+- $(ECHO) "Installing logrotate script to $(DESTDIR)/etc/logrotate.d/" ;\
+- $(INSTALL) -m 0644 privoxy.logrotate $(DESTDIR)/etc/logrotate.d/privoxy ;\
+- elif [ -d $(DESTDIR)/etc/init.d ] && [ -w $(DESTDIR)/etc/init.d ] ; then \
+- $(ECHO) "Installing generic init script to $(DESTDIR)/etc/init.d/privoxy" ;\
+- $(ECHO) "Please check that the PATHs are correct, and edit if needed." ;\
+- $(INSTALL) $(INSTALL_P) privoxy-generic.init $(DESTDIR)/etc/init.d/privoxy ;\
+- fi ;\
+- else \
+- $(ECHO) "No init script installed, install it manually if needed" ;\
+- fi
+- $(RM) config.base config.tmp
+- @# mmmmm, good.
++ $(CHMOD) $(RWD_MODE) $(DESTDIR)$(LOG_DEST)/logfile || exit 1 ;
+ @$(ECHO) "$(PROGRAM_V) installation succeeded!"
+ @$(ECHO) "The Privoxy configuration files have been installed in $(DESTDIR)$(CONF_DEST)"
+
diff --git a/package/privoxy/patches/patch-configure_in b/package/privoxy/patches/patch-configure_in
new file mode 100644
index 000000000..74770aba6
--- /dev/null
+++ b/package/privoxy/patches/patch-configure_in
@@ -0,0 +1,12 @@
+$Id$
+--- privoxy-3.0.12-stable.orig/configure.in 2009-03-21 11:45:06.000000000 +0100
++++ privoxy-3.0.12-stable/configure.in 2009-04-17 17:42:04.722725574 +0200
+@@ -693,7 +693,7 @@ dnl Check for user and group validity
+ dnl =================================================================
+
+
+-if test "$EMXOS2" = yes; then
++if true test "$EMXOS2" = yes; then
+ echo "Skipping user and group validity stuff.";
+
+ else
diff --git a/package/procmail/Config.in b/package/procmail/Config.in
new file mode 100644
index 000000000..28e75221a
--- /dev/null
+++ b/package/procmail/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_PROCMAIL
+ prompt "procmail.......................... mail processing tool"
+ tristate
+ default n
+ help
+ Procmail is able to process and classify incoming mail into
+ different mail boxes.
+
+ Very useful in conjunction with mutt.
+
+ http://www.procmail.org
diff --git a/package/procmail/Makefile b/package/procmail/Makefile
new file mode 100644
index 000000000..96a2062fe
--- /dev/null
+++ b/package/procmail/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= procmail
+PKG_VERSION:= 3.22
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1678ea99b973eb77eda4ecf6acae53f1
+MASTER_SITES:= http://www.procmail.org/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PROCMAIL,procmail,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${MAKE} -C ${WRKBUILD}/src -f ../Makefile.new \
+ CC="${TARGET_CC}"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_PROCMAIL}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/src/procmail ${IDIR_PROCMAIL}/usr/bin/
+ ${INSTALL_BIN} ${WRKBUILD}/src/formail ${IDIR_PROCMAIL}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/procmail/extra/Makefile.new b/package/procmail/extra/Makefile.new
new file mode 100644
index 000000000..3f8ed3ab2
--- /dev/null
+++ b/package/procmail/extra/Makefile.new
@@ -0,0 +1,19 @@
+PM_OBJ=cstdio.o common.o exopen.o goodies.o locking.o \
+ mailfold.o foldinfo.o misc.o pipes.o regexp.o robust.o \
+ sublib.o acommon.o mcommon.o lastdirsep.o authenticate.o \
+ lmtp.o memblk.o variables.o from.o comsat.o
+
+FM_OBJ=common.o fields.o formisc.o sublib.o ecommon.o \
+ acommon.o
+
+LDFLAGS = -lm -lnsl -ldl -lc
+CFLAGS = -Os -DPROCMAIL
+
+all: procmail formail
+
+procmail: procmail.o $(PM_OBJ)
+ $(CC) $(CFLAGS) $@.o $(PM_OBJ) -o $@ $(LDFLAGS)
+
+formail: formail.o $(FM_OBJ)
+ $(CC) $(CFLAGS) $@.o $(FM_OBJ) -o $@ $(LDFLAGS)
+
diff --git a/package/procmail/ipkg/procmail.control b/package/procmail/ipkg/procmail.control
new file mode 100644
index 000000000..6a87f9ff5
--- /dev/null
+++ b/package/procmail/ipkg/procmail.control
@@ -0,0 +1,4 @@
+Package: procmail
+Priority: optional
+Section: text
+Description: Mail processing tool
diff --git a/package/procmail/patches/patch-autoconf_h b/package/procmail/patches/patch-autoconf_h
new file mode 100644
index 000000000..f7c210574
--- /dev/null
+++ b/package/procmail/patches/patch-autoconf_h
@@ -0,0 +1,29 @@
+$Id$
+
+This patch is required to make procmail cross compile - it tries to run some
+automatic tests which obviously do not work in a cross compiled environment.
+
+--- procmail-3.22.orig/autoconf.h 1970-01-01 00:00:00.000000000 +0100
++++ procmail-3.22/autoconf.h 2006-07-27 07:50:48.000000000 +0200
+@@ -0,0 +1,21 @@
++/* This file was automagically generated by autoconf */
++
++/* 5 moves in 64 steps of size 16384 when reallocing */
++#define NOpw_class
++#define NOstrlcat
++#define NOsetrgid
++#define MAX_argc 7588
++/* Your system's strstr() is 1.12 times FASTER than my C-routine */
++#define UDP_protocolno 17
++#define BIFF_serviceport "512"
++#define IP_localhost {127,0,0,1}
++#define MAILSPOOLDIR "/var/spool/mail/"
++#define SENDMAIL "/usr/sbin/sendmail"
++#define CF_no_procmail_yet
++#define buggy_SENDMAIL
++#define defPATH "PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11"
++#define defSPATH "PATH=/bin:/usr/bin:/usr/local/bin:/usr/bin/X11"
++#define PM_VERSION "3.22"
++/* Hotwire LOCKINGTEST=100 */
++/* Procmail will lock via: dotlocking, fcntl() */
++/* autoconf completed */
diff --git a/package/procps/Config.in b/package/procps/Config.in
new file mode 100644
index 000000000..475bafc08
--- /dev/null
+++ b/package/procps/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_PROCPS_META
+ bool
+ default n
+
+config ADK_PACKAGE_PROCPS
+ prompt "procps............................ The /proc file system utilities"
+ tristate
+ default n
+ select ADK_PACKAGE_PROCPS_META
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ procps is the package that has a bunch of small useful utilities
+ that give information about processes using the /proc filesystem.
+ The package includes the programs ps, top, vmstat, w, kill, free,
+ slabtop, and skill.
+
+ http://procps.sourceforge.net/
diff --git a/package/procps/Makefile b/package/procps/Makefile
new file mode 100644
index 000000000..071a141a1
--- /dev/null
+++ b/package/procps/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= procps
+PKG_VERSION:= 3.2.7
+PKG_RELEASE:= 4
+PKG_MD5SUM:= f490bca772b16472962c7b9f23b1e97d
+MASTER_SITES:= http://procps.sourceforge.net/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PROCPS,procps,${PKG_VERSION}-${PKG_RELEASE},${ARCH},libncurses))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_PROCPS}/{bin,sbin,usr/bin}
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/uptime ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/tload ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/free ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/w ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/top ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/vmstat ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/watch ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/pmap ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/pgrep ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/slabtop ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/pwdx ${IDIR_PROCPS}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/bin/kill ${IDIR_PROCPS}/bin
+ ${INSTALL_BIN} ${WRKINST}/bin/ps ${IDIR_PROCPS}/bin
+ ${INSTALL_BIN} ${WRKINST}/sbin/sysctl ${IDIR_PROCPS}/sbin
+ cd ${IDIR_PROCPS}/usr/bin; \
+ ln -sf ../../bin/kill skill; \
+ ln -sf ../../bin/kill snice; \
+ ln -sf pgrep pkill
+ ${INSTALL_BIN} killall ${IDIR_PROCPS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/procps/ipkg/procps.control b/package/procps/ipkg/procps.control
new file mode 100644
index 000000000..bc18dd7d8
--- /dev/null
+++ b/package/procps/ipkg/procps.control
@@ -0,0 +1,4 @@
+Package: procps
+Priority: optional
+Section: utilities
+Description: The /proc file system utilities
diff --git a/package/procps/killall b/package/procps/killall
new file mode 100644
index 000000000..0f4ed7ceb
--- /dev/null
+++ b/package/procps/killall
@@ -0,0 +1,25 @@
+#!/bin/ash
+dolist=0
+doquiet=0
+l=1
+x=$#
+signal=
+while [ $x -gt 0 ]; do
+ case $1 in
+ -l) dolist=1 ;;
+ -q) doquiet=1 ;;
+ -lq|-ql)
+ dolist=1
+ doquiet=1
+ ;;
+ -*) signal=$1 ;;
+ *) break ;;
+ esac
+ shift
+ x=$(expr $x - 1)
+done
+[ $dolist = 1 ] && kill -l
+pkill -x $signal "$@"
+rv=$?
+[ $doquiet = 1 ] && exit 0
+exit $rv
diff --git a/package/procps/patches/patch-Makefile b/package/procps/patches/patch-Makefile
new file mode 100644
index 000000000..5b0bcf74a
--- /dev/null
+++ b/package/procps/patches/patch-Makefile
@@ -0,0 +1,63 @@
+$Id$
+--- procps-3.2.7.orig/Makefile Sat Jun 24 09:02:02 2006
++++ procps-3.2.7/Makefile Tue May 22 14:43:11 2007
+@@ -27,7 +27,7 @@ TARVERSION := $(VERSION).$(SUBVERSION)
+ ldconfig := ldconfig
+ ln_f := ln -f
+ ln_sf := ln -sf
+-install := install -D --owner 0 --group 0
++install := install
+
+ # Lame x86-64 /lib64 and /usr/lib64 abomination:
+ lib64 := lib$(shell [ -d /lib64 ] && echo 64)
+@@ -82,7 +82,7 @@ CURSES := -lncurses
+
+ # Preprocessor flags.
+ PKG_CPPFLAGS := -D_GNU_SOURCE -I proc
+-CPPFLAGS := -I/usr/include/ncurses
++CPPFLAGS ?= -I/usr/include/ncurses
+ ALL_CPPFLAGS := $(PKG_CPPFLAGS) $(CPPFLAGS)
+
+ # Left out -Wconversion due to noise in glibc headers.
+@@ -102,11 +102,11 @@ PKG_CFLAGS := -fno-common -ffast-math
+ -Wstrict-prototypes -Wmissing-prototypes
+ # Note that some stuff below is conditional on CFLAGS containing
+ # an option that starts with "-g". (-g, -g2, -g3, -ggdb, etc.)
+-CFLAGS := -O2 -s
++CFLAGS ?= -O2 -s
+ ALL_CFLAGS := $(PKG_CFLAGS) $(CFLAGS)
+
+ PKG_LDFLAGS := -Wl,-warn-common
+-LDFLAGS :=
++LDFLAGS ?=
+ ALL_LDFLAGS := $(PKG_LDFLAGS) $(LDFLAGS)
+
+ ############ Add some extra flags if gcc allows
+@@ -128,7 +128,7 @@ check_gcc = $(shell if $(CC) $(ALL_CPPFL
+ # i386 and x86-64, mips and mips64, sparc and sparc64, and so on.
+ # Failure to do so will cause data corruption.
+ m64 := $(call check_gcc,-m64,$(call check_gcc,-mabi=64,))
+-ALL_CFLAGS += $(m64)
++#ALL_CFLAGS += $(m64)
+
+ ALL_CFLAGS += $(call check_gcc,-Wdeclaration-after-statement,)
+ ALL_CFLAGS += $(call check_gcc,-Wpadded,)
+@@ -222,10 +222,16 @@ clean:
+ ###### install
+
+ $(BINFILES) : all
+- $(install) --mode a=rx $(notdir $@) $@
++ mkdir -p $(dir $@)
++ for f in $@; do \
++ install -c -m 555 $$(basename $$f) $$f; \
++ done
+
+ $(MANFILES) : all
+- $(install) --mode a=r $(notdir $@) $@
++ mkdir -p $(dir $@)
++ for f in $@; do \
++ install -c -m 444 $$(basename $$f) $$f; \
++ done
+
+ install: $(filter-out $(SKIP) $(addprefix $(DESTDIR),$(SKIP)),$(INSTALL))
+ cd $(usr/bin) && $(ln_f) skill snice
diff --git a/package/procps/patches/patch-proc_module_mk b/package/procps/patches/patch-proc_module_mk
new file mode 100644
index 000000000..9ee2f20a1
--- /dev/null
+++ b/package/procps/patches/patch-proc_module_mk
@@ -0,0 +1,33 @@
+$Id$
+Build everything static
+--- procps-3.2.7.orig/proc/module.mk Thu Sep 23 13:10:20 2004
++++ procps-3.2.7/proc/module.mk Tue May 22 14:32:45 2007
+@@ -17,7 +17,7 @@
+ # numbers for future use, the ELF soname can be set equal to the
+ # file name until some future date when a stable ABI is declared.
+
+-SHARED := 1
++SHARED := 0
+
+ # for lib$(NAME).so and /usr/include/($NAME) and such
+ NAME := proc
+@@ -96,7 +96,8 @@ endif
+ #################### install rules ###########################
+
+ $(lib)$(SOFILE) : proc/$(SONAME)
+- $(install) --mode a=rx $< $@
++ mkdir -p $(dir $@)
++ install -c -m 555 $< $@
+
+ ifneq ($(SOLINK),$(SOFILE))
+ .PHONY: $(lib)$(SOLINK)
+@@ -115,7 +116,8 @@ ldconfig : $(lib)$(SONAME) $(lib)$(SOLIN
+ $(ldconfig)
+
+ $(usr/lib)$(ANAME) : proc/$(ANAME)
+- $(install) --mode a=r $< $@
++ mkdir -p $(dir $@)
++ install -c -m 444 $< $@
+
+ # Junk anyway... supposed to go in /usr/include/$(NAME)
+ #INSTALL += $(addprefix $(include),$(HDRFILES))
diff --git a/package/procps/patches/patch-ps_module_mk b/package/procps/patches/patch-ps_module_mk
new file mode 100644
index 000000000..7d6798e03
--- /dev/null
+++ b/package/procps/patches/patch-ps_module_mk
@@ -0,0 +1,16 @@
+$Id$
+--- procps-3.2.7.orig/ps/module.mk Sun Oct 30 03:19:24 2005
++++ procps-3.2.7/ps/module.mk Tue May 22 14:32:45 2007
+@@ -33,8 +33,10 @@ ps/stacktrace.o: ps/stacktrace.c
+
+
+ $(bin)ps: ps/ps
+- $(install) --mode a=rx $< $@
++ mkdir -p $(dir $@)
++ install -c -m 555 $< $@
+
+ $(man1)ps.1 : ps/ps.1
+- $(install) --mode a=r $< $@
++ mkdir -p $(dir $@)
++ install -c -m 444 $< $@
+ -rm -f $(DESTDIR)/var/catman/cat1/ps.1.gz $(DESTDIR)/var/man/cat1/ps.1.gz
diff --git a/package/procps/patches/patch-sysctl_c b/package/procps/patches/patch-sysctl_c
new file mode 100644
index 000000000..64bd55c39
--- /dev/null
+++ b/package/procps/patches/patch-sysctl_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- procps-3.2.7.orig/sysctl.c 2006-06-25 02:51:51.000000000 +0200
++++ procps-3.2.7/sysctl.c 2008-10-16 13:47:28.000000000 +0200
+@@ -272,7 +272,7 @@ static int WriteSetting(const char *sett
+ return 0;
+ } /* end if */
+
+- equals = index(setting, '=');
++ equals = strchr(setting, '=');
+
+ if (!equals) {
+ fprintf(stderr, ERR_NO_EQUALS, setting);
+@@ -503,7 +503,7 @@ int main(int argc, char *argv[]) {
+ if (NameOnly && Quiet) // nonsense
+ return Usage(me);
+ SwitchesAllowed = false;
+- if (WriteMode || index(*argv, '='))
++ if (WriteMode || strchr(*argv, '='))
+ ReturnCode = WriteSetting(*argv);
+ else
+ ReturnCode = ReadSetting(*argv);
diff --git a/package/ptunnel/Config.in b/package/ptunnel/Config.in
new file mode 100644
index 000000000..0b714af2e
--- /dev/null
+++ b/package/ptunnel/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_PTUNNEL
+ prompt "ptunnel........................... Tunnel TCP connections over ICMP packets"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ ptunnel is an application that allows you to reliably tunnel TCP connections to
+ a remote host using ICMP echo request and reply packets, commonly known as ping
+ requests and replies. It acts as a proxy and can handle sockets and secured
+ identification.
+
+ http://www.cs.uit.no/~daniels/PingTunnel/
+
diff --git a/package/ptunnel/Makefile b/package/ptunnel/Makefile
new file mode 100644
index 000000000..db1a83347
--- /dev/null
+++ b/package/ptunnel/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ptunnel
+PKG_VERSION:= 0.61
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b45f73875f2af48f101816672f83a5fe
+MASTER_SITES:= http://www.cti.ecp.fr/~beauxir5/ptunnel/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PTUNNEL,ptunnel,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= BUILD_CC="${TARGET_CC}" \
+ ac_cv_linux_vers=2 \
+ td_cv_buggygetaddrinfo="no"
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_PTUNNEL}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ptunnel ${IDIR_PTUNNEL}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ptunnel/ipkg/ptunnel.control b/package/ptunnel/ipkg/ptunnel.control
new file mode 100644
index 000000000..0020f1377
--- /dev/null
+++ b/package/ptunnel/ipkg/ptunnel.control
@@ -0,0 +1,5 @@
+Package: ptunnel
+Priority: optional
+Section: net
+Description: Tunnel TCP connections over ICMP packets
+Depends: libpcap, libpthread
diff --git a/package/quagga/Config.in b/package/quagga/Config.in
new file mode 100644
index 000000000..93ae9a2f4
--- /dev/null
+++ b/package/quagga/Config.in
@@ -0,0 +1,69 @@
+#menu "quagga............................ The Quagga Software Routing Suite"
+
+config ADK_PACKAGE_QUAGGA
+ prompt "quagga............................ The Quagga Software Routing Suite"
+ tristate
+ depends ADK_IPV6
+ default n
+ help
+ A routing software package that provides TCP/IP based routing services
+ with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
+ OSPFv3, BGP-4, and BGP-4+
+
+ http://www.quagga.net/
+
+config ADK_PACKAGE_QUAGGA_BGPD
+ prompt " quagga-bgpd................... BGPv4, BGPv4+, BGPv4- routing engine"
+ tristate
+ default n
+ depends ADK_PACKAGE_QUAGGA
+ help
+ A BGPv4, BGPv4+, BGPv4- routing engine for use with Quagga routing
+ software.
+
+config ADK_PACKAGE_QUAGGA_OSPFD
+ prompt " quagga-ospfd.................. OSPFv2 routing engine"
+ tristate
+ default n
+ depends ADK_PACKAGE_QUAGGA
+ help
+ An OSPFv2 (IPv4) routing engine for use with Quagga routing software.
+
+config ADK_PACKAGE_QUAGGA_OSPF6D
+ prompt " quagga-ospf6d................. OSPFv3 routing engine"
+ tristate
+ default n
+ depends ADK_PACKAGE_QUAGGA
+ depends ADK_IPV6
+ help
+ An OSPFv3 (IPv6) routing engine for use with Quagga routing software.
+
+config ADK_PACKAGE_QUAGGA_RIPD
+ prompt " quagga-ripd................... RIP routing engine"
+ tristate
+ default n
+ depends ADK_PACKAGE_QUAGGA
+ help
+ A RIP (IPv4) routing engine for use with Quagga routing software.
+
+config ADK_PACKAGE_QUAGGA_RIPNGD
+ prompt " quagga-ripngd................. RIPNG routing engine"
+ tristate
+ default n
+ depends ADK_PACKAGE_QUAGGA
+ depends ADK_IPV6
+ help
+ A RIPNG (IPv6) routing engine for use with Quagga routing software.
+
+config ADK_PACKAGE_QUAGGA_VTYSH
+ prompt " quagga-vtysh.................. integrated shell for Quagga routing software"
+ tristate
+ default n
+ depends ADK_PACKAGE_QUAGGA
+ select ADK_PACKAGE_LIBREADLINE
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ vtysh lets you interact with all the Quagga routing daemons
+ at once in an integrated shell.
+
+#endmenu
diff --git a/package/quagga/Makefile b/package/quagga/Makefile
new file mode 100644
index 000000000..7a037b50f
--- /dev/null
+++ b/package/quagga/Makefile
@@ -0,0 +1,66 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= quagga
+PKG_VERSION:= 0.99.12
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d2bb513f4ac113dbb300c15a0bd0a241
+MASTER_SITES:= http://www.quagga.net/download/ \
+ http://www.de.quagga.net/download/ \
+ http://www.uk.quagga.net/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,QUAGGA,quagga,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,QUAGGA_BGPD,quagga-bgpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,QUAGGA_OSPFD,quagga-ospfd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+ifeq ($(ADK_IPV6),y)
+$(eval $(call PKG_template,QUAGGA_OSPF6D,quagga-ospf6d,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,QUAGGA_RIPNGD,quagga-ripngd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+endif
+$(eval $(call PKG_template,QUAGGA_RIPD,quagga-ripd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,QUAGGA_VTYSH,quagga-vtysh,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --localstatedir=/var/run/quagga \
+ --sysconfdir=/etc/quagga \
+ --enable-vtysh \
+ --enable-user=quagga \
+ --enable-group=quagga \
+ --enable-multipath=8
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_QUAGGA}/usr/{lib,sbin}
+ ${INSTALL_DIR} ${IDIR_QUAGGA}/etc/init.d/
+ ${CP} ${WRKINST}/usr/lib/libzebra.so.* ${IDIR_QUAGGA}/usr/lib/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/zebra \
+ ${WRKINST}/usr/sbin/watchquagga ${IDIR_QUAGGA}/usr/sbin/
+ # avoid /etc being set to 0750
+ ${INSTALL_DIR} ${IDIR_QUAGGA}/etc/quagga/
+ chmod 0750 ${IDIR_QUAGGA}/etc/quagga/
+ ${INSTALL_BIN} ./files/quagga.init \
+ ${IDIR_QUAGGA}/etc/init.d/quagga
+ ${INSTALL_DIR} ${IDIR_QUAGGA}/var/run/quagga
+ ${INSTALL_DIR} ${IDIR_QUAGGA_BGPD}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/bgpd ${IDIR_QUAGGA_BGPD}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_QUAGGA_OSPFD}/usr/{lib,sbin}
+ ${CP} ${WRKINST}/usr/lib/libospf.so.* ${IDIR_QUAGGA_OSPFD}/usr/lib/
+ ${CP} ${WRKINST}/usr/sbin/ospfd ${IDIR_QUAGGA_OSPFD}/usr/sbin/
+ifeq ($(ADK_IPV6),y)
+ ${INSTALL_DIR} ${IDIR_QUAGGA_OSPF6D}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/ospf6d ${IDIR_QUAGGA_OSPF6D}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_QUAGGA_RIPNGD}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/ripngd ${IDIR_QUAGGA_RIPNGD}/usr/sbin/
+endif
+ ${INSTALL_DIR} ${IDIR_QUAGGA_RIPD}/usr/sbin
+ ${CP} ${WRKINST}/usr/sbin/ripd ${IDIR_QUAGGA_RIPD}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_QUAGGA_VTYSH}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/vtysh ${IDIR_QUAGGA_VTYSH}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/quagga/files/quagga.init b/package/quagga/files/quagga.init
new file mode 100644
index 000000000..6c40fe356
--- /dev/null
+++ b/package/quagga/files/quagga.init
@@ -0,0 +1,327 @@
+#!/bin/sh
+#FWINIT 50
+ME=$(basename $0)
+
+usage() {
+ echo "Usage: ${ME} {start|stop|restart} [daemon ...]"
+ exit 2
+}
+
+if [ -z "$1" ]
+then
+ usage
+else
+ COMMAND=$1
+fi
+shift
+ARG_DAEMONS=$*
+BINDIR=/usr/sbin
+CONFDIR=/etc/quagga
+STATEDIR=/var/run/quagga
+DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
+DAEMON_FLAGS=-d
+WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
+WATCHQUAGGA_CMD="sh $0 watchrestart"
+if [ ${COMMAND} != "watchrestart" ]
+then
+ DAEMONS="${DAEMONS} watchquagga"
+fi
+DAEMONS_STARTSEQ=${DAEMONS}
+
+reverse()
+{
+ local revlist r
+ revlist=
+ for r
+ do
+ revlist="$r $revlist"
+ done
+ echo $revlist
+}
+
+DAEMONS_STOPSEQ=$(reverse ${DAEMONS_STARTSEQ})
+
+#pidof() {
+# ps ax | awk 'match($5, "(^|/)'"$1"'$") > 0 { printf " %s", $1 }'
+#}
+
+quit() {
+ echo "${ME}: $1"
+ exit 0
+}
+
+die() {
+ echo "${ME}: $1"
+ exit 1
+}
+
+is_in() {
+ local i
+ for i in $2
+ do
+ [ "$1" = "$i" ] && return 0
+ done
+ return 1
+}
+
+select_subset() {
+ local unknown i j
+ unknown=
+ RESULT=
+ for i in $1
+ do
+ is_in $i "$2" || unknown="$unknown $i"
+ done
+ if [ -n "$unknown" ]
+ then
+ RESULT=$unknown
+ return 1
+ else
+ for j in $2
+ do
+ is_in $j "$1" && RESULT="$RESULT $j"
+ done
+ return 0
+ fi
+}
+
+# check command
+. /etc/rc.conf
+
+case ${COMMAND} in
+autostop) ;;
+autostart|start|stop|restart)
+ ;;
+watchrestart)
+ if [ -n "$ARG_DAEMONS" ]
+ then
+ echo "${ME}: watchrestart mode is only for use by watchquagga"
+ exit 2
+ fi
+ ;;
+*)
+ usage
+ ;;
+esac
+
+# select daemons to start
+
+case ${COMMAND} in
+autostart)
+ test x"${quagga:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start|restart|watchrestart)
+ START_DAEMONS=
+ for d in ${DAEMONS_STARTSEQ}
+ do
+ [ -x "${BINDIR}/${d}" -a -f "${CONFDIR}/${d}.conf" ] \
+ && START_DAEMONS="${START_DAEMONS}${d} "
+ done
+ WATCHQUAGGA_DAEMONS=${START_DAEMONS}
+ if is_in watchquagga "${DAEMONS_STARTSEQ}"
+ then
+ START_DAEMONS="${START_DAEMONS} watchquagga"
+ fi
+ if [ -n "${ARG_DAEMONS}" ]
+ then
+ if select_subset "${ARG_DAEMONS}" "${DAEMONS}"
+ then
+ if select_subset "${ARG_DAEMONS}" "${START_DAEMONS}"
+ then
+ START_DAEMONS=${RESULT}
+ else
+ die "these daemons are not startable:${RESULT}."
+ fi
+ else
+ die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
+ fi
+ fi
+ ;;
+esac
+
+# select daemons to stop
+
+case ${COMMAND} in
+stop|restart|watchrestart)
+ STOP_DAEMONS=${DAEMONS_STOPSEQ}
+ if [ -n "${ARG_DAEMONS}" ]
+ then
+ if select_subset "${ARG_DAEMONS}" "${STOP_DAEMONS}"
+ then
+ STOP_DAEMONS=${RESULT}
+ else
+ die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
+ fi
+ fi
+ stop_daemons=
+ for d in ${STOP_DAEMONS}
+ do
+ pidfile=${STATEDIR}/${d}.pid
+ if [ -f "${pidfile}" -o -n "$(pidof ${d})" ]
+ then
+ stop_daemons="${stop_daemons}${d} "
+ elif [ -n "${ARG_DAEMONS}" ]
+ then
+ echo "${ME}: found no ${d} process running."
+ fi
+ done
+ STOP_DAEMONS=${stop_daemons}
+ ;;
+esac
+
+# stop daemons
+
+for d in $STOP_DAEMONS
+do
+ echo -n "${ME}: Stopping ${d} ... "
+ pidfile=${STATEDIR}/${d}.pid
+ if [ -f "${pidfile}" ]
+ then
+ file_pid=$(cat ${pidfile})
+ if [ -z "${file_pid}" ]
+ then
+ echo -n "no pid file entry found ... "
+ fi
+ else
+ file_pid=
+ echo -n "no pid file found ... "
+ fi
+ proc_pid=$(pidof ${d})
+ if [ -z "${proc_pid}" ]
+ then
+ echo -n "found no ${d} process running ... "
+ else
+ count=0
+ notinpidfile=
+ for p in ${proc_pid}
+ do
+ count=$((${count}+1))
+ if kill ${p}
+ then
+ echo -n "killed ${p} ... "
+ else
+ echo -n "failed to kill ${p} ... "
+ fi
+ [ "${p}" = "${file_pid}" ] \
+ || notinpidfile="${notinpidfile} ${p}"
+ done
+ [ ${count} -le 1 ] \
+ || echo -n "WARNING: ${count} ${d} processes were found running ... "
+ for n in ${notinpidfile}
+ do
+ echo -n "WARNING: process ${n} was not in pid file ... "
+ done
+ fi
+ count=0
+ survivors=$(pidof ${d})
+ while [ -n "${survivors}" ]
+ do
+ sleep 1
+ count=$((${count}+1))
+ survivors=$(pidof ${d})
+ [ -z "${survivors}" -o ${count} -gt 5 ] && break
+ for p in ${survivors}
+ do
+ sleep 1
+ echo -n "${p} "
+ kill ${p}
+ done
+ done
+ survivors=$(pidof ${d})
+ [ -n "${survivors}" ] && \
+ if kill -KILL ${survivors}
+ then
+ echo -n "KILLed ${survivors} ... "
+ else
+ echo -n "failed to KILL ${survivors} ... "
+ fi
+ sleep 1
+ survivors=$(pidof ${d})
+ if [ -z "${survivors}" ]
+ then
+ echo -n "done."
+ if [ -f "${pidfile}" ]
+ then
+ rm -f ${pidfile} \
+ || echo -n " Failed to remove pidfile."
+ fi
+ else
+ echo -n "failed to stop ${survivors} - giving up."
+ if [ "${survivors}" != "${file_pid}" ]
+ then
+ if echo "${survivors}" > ${pidfile}
+ then
+ chown quagga:quagga ${pidfile}
+ echo -n " Wrote ${survivors} to pidfile."
+ else
+ echo -n " Failed to write ${survivors} to pidfile."
+ fi
+ fi
+ fi
+ echo
+done
+
+# start daemons
+
+if [ -n "$START_DAEMONS" ]
+then
+ [ -d ${CONFDIR} ] \
+ || quit "${ME}: no config directory ${CONFDIR} - exiting."
+ chown -R quagga:quagga ${CONFDIR}
+ [ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
+ || die "${ME}: could not create state directory ${STATEDIR} - exiting."
+ chown -R quagga:quagga ${STATEDIR}
+
+ for d in $START_DAEMONS
+ do
+ echo -n "${ME}: Starting ${d} ... "
+ proc_pid=$(pidof ${d})
+ pidfile=${STATEDIR}/${d}.pid
+ file_pid=
+ if [ -f "${pidfile}" ]
+ then
+ file_pid=$(cat ${pidfile})
+ if [ -n "${file_pid}" ]
+ then
+ echo -n "found old pid file entry ${file_pid} ... "
+ fi
+ fi
+ if [ -n "${proc_pid}" ]
+ then
+ echo -n "found ${d} running (${proc_pid}) - skipping ${d}."
+ if [ "${proc_pid}" != "${file_pid}" ]
+ then
+ if echo "${proc_pid}" > ${pidfile}
+ then
+ chown quagga:quagga ${pidfile}
+ echo -n " Wrote ${proc_pid} to pidfile."
+ else
+ echo -n " Failed to write ${proc_pid} to pidfile."
+ fi
+ fi
+ elif rm -f "${pidfile}"
+ then
+ if [ "${d}" = "watchquagga" ]
+ then
+ $("${BINDIR}/${d}" \
+ ${WATCHQUAGGA_FLAGS} \
+ "${WATCHQUAGGA_CMD}" \
+ ${WATCHQUAGGA_DAEMONS})
+ status=$?
+ else
+ $("${BINDIR}/${d}" ${DAEMON_FLAGS})
+ status=$?
+ fi
+ if [ $status -eq 0 ]
+ then
+ echo -n "done."
+ else
+ echo -n "failed."
+ fi
+ else
+ echo -n " failed to remove pidfile."
+ fi
+ echo
+ done
+fi
diff --git a/package/quagga/ipkg/quagga-bgpd.control b/package/quagga/ipkg/quagga-bgpd.control
new file mode 100644
index 000000000..d8e9b80b2
--- /dev/null
+++ b/package/quagga/ipkg/quagga-bgpd.control
@@ -0,0 +1,6 @@
+Package: quagga-bgpd
+Priority: optional
+Section: net
+Depends: quagga
+Description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Quagga
+ routing software
diff --git a/package/quagga/ipkg/quagga-ospf6d.control b/package/quagga/ipkg/quagga-ospf6d.control
new file mode 100644
index 000000000..07cf20582
--- /dev/null
+++ b/package/quagga/ipkg/quagga-ospf6d.control
@@ -0,0 +1,6 @@
+Package: quagga-ospf6d
+Priority: optional
+Section: net
+Depends: quagga
+Description: An OSPFv3 routing engine for use with Quagga
+ routing software
diff --git a/package/quagga/ipkg/quagga-ospfd.control b/package/quagga/ipkg/quagga-ospfd.control
new file mode 100644
index 000000000..c9fc77ce8
--- /dev/null
+++ b/package/quagga/ipkg/quagga-ospfd.control
@@ -0,0 +1,6 @@
+Package: quagga-ospfd
+Priority: optional
+Section: net
+Depends: quagga
+Description: An OSPFv2 routing engine for use with Quagga
+ routing software
diff --git a/package/quagga/ipkg/quagga-ripd.control b/package/quagga/ipkg/quagga-ripd.control
new file mode 100644
index 000000000..e7ff89952
--- /dev/null
+++ b/package/quagga/ipkg/quagga-ripd.control
@@ -0,0 +1,6 @@
+Package: quagga-ripd
+Priority: optional
+Section: net
+Depends: quagga
+Description: A RIP routing engine for use with Quagga
+ routing software
diff --git a/package/quagga/ipkg/quagga-ripngd.control b/package/quagga/ipkg/quagga-ripngd.control
new file mode 100644
index 000000000..f6b2804c2
--- /dev/null
+++ b/package/quagga/ipkg/quagga-ripngd.control
@@ -0,0 +1,6 @@
+Package: quagga-ripngd
+Priority: optional
+Section: net
+Depends: quagga
+Description: A RIPNG routing engine for use with Quagga
+ routing software
diff --git a/package/quagga/ipkg/quagga-vtysh.control b/package/quagga/ipkg/quagga-vtysh.control
new file mode 100644
index 000000000..b26d11df3
--- /dev/null
+++ b/package/quagga/ipkg/quagga-vtysh.control
@@ -0,0 +1,6 @@
+Package: quagga-vtysh
+Priority: optional
+Section: net
+Depends: quagga, libncurses, libreadline
+Description: integrated shell for interacting with Quagga
+ routing software
diff --git a/package/quagga/ipkg/quagga.control b/package/quagga/ipkg/quagga.control
new file mode 100644
index 000000000..303f299e8
--- /dev/null
+++ b/package/quagga/ipkg/quagga.control
@@ -0,0 +1,6 @@
+Package: quagga
+Priority: optional
+Section: net
+Description: A routing software package that provides TCP/IP
+ based routing services with routing protocols support such
+ as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, BGP-4, and BGP-4+.
diff --git a/package/quagga/ipkg/quagga.postinst b/package/quagga/ipkg/quagga.postinst
new file mode 100644
index 000000000..868d00de9
--- /dev/null
+++ b/package/quagga/ipkg/quagga.postinst
@@ -0,0 +1,16 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+
+gid=$(get_next_gid)
+add_group quagga $gid
+add_user quagga $(get_next_uid) $gid /tmp
+add_rcconf quagga quagga NO
+add_service zebrasrv 2600/tcp
+add_service zebra 2601/tcp
+add_service ripd 2602/tcp
+add_service ripngd 2603/tcp
+add_service ospfd 2604/tcp
+add_service bgpd 2605/tcp
+add_service ospf6d 2606/tcp
+add_service ospfapi 2607/tcp
+add_service isisd 2608/tcp
diff --git a/package/raddump/Config.in b/package/raddump/Config.in
new file mode 100644
index 000000000..f56795969
--- /dev/null
+++ b/package/raddump/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_RADDUMP
+ prompt "raddump........................... raddump interprets captured RADIUS packets."
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBPCAP
+ help
+ raddump interprets captured RADIUS packets to print a
+ timestamp, packet length, RADIUS packet type, source and
+ destination hosts and ports, and included attribute names and
+ values for each packet.
diff --git a/package/raddump/Makefile b/package/raddump/Makefile
new file mode 100755
index 000000000..3eee5473b
--- /dev/null
+++ b/package/raddump/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= raddump
+PKG_VERSION:= 0.3.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f8c29c67141ea78bb6ae8b97d5149480
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=raddump/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RADDUMP,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= ac_cv_c_bigendian=no \
+ ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes
+INSTALL_STYLE:= auto
+
+post-install:
+ ${CP} ${WRKINST}/* ${IDIR_RADDUMP}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/raddump/ipkg/raddump.control b/package/raddump/ipkg/raddump.control
new file mode 100755
index 000000000..2d31b0221
--- /dev/null
+++ b/package/raddump/ipkg/raddump.control
@@ -0,0 +1,6 @@
+Package: raddump
+Depends: libpcap, libopenssl
+Section: net
+Architecture: mipsel
+Priority: optional
+Description: raddump interprets captured RADIUS packets to print a timestamp, packet length, RADIUS packet type, source and destination hosts and ports, and included attribute names and values for each packet.
diff --git a/package/radiusclient-ng/Config.in b/package/radiusclient-ng/Config.in
new file mode 100644
index 000000000..4e37c02da
--- /dev/null
+++ b/package/radiusclient-ng/Config.in
@@ -0,0 +1,27 @@
+config ADK_COMPILE_RADIUSCLIENT_NG
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBRADIUSCLIENT_NG
+
+config ADK_PACKAGE_RADIUSCLIENT_NG
+ prompt "radiusclient-ng................... RADIUS client"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBRADIUSCLIENT_NG
+ help
+ Purpose of this project is to build portable, easy-to-use and standard compliant
+ library suitable for developing free and commercial software that need support
+ for a RADIUS protocol (RFCs 2128 and 2139).
+
+ http://developer.berlios.de/projects/radiusclient-ng/
+
+ Depends: libopenssl
+
+config ADK_PACKAGE_LIBRADIUSCLIENT_NG
+ prompt "libradiusclient-ng................ RADIUS client library"
+ tristate
+ default n
+ select ADK_COMPILE_RADIUSCLIENT_NG
+ help
+ Developpment library from radiusclient-ng
diff --git a/package/radiusclient-ng/Makefile b/package/radiusclient-ng/Makefile
new file mode 100644
index 000000000..695c41bbc
--- /dev/null
+++ b/package/radiusclient-ng/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= radiusclient-ng
+PKG_VERSION:= 0.5.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6fb7d4d0aefafaee7385831ac46a8e9c
+MASTER_SITES:= http://download.berlios.de/radiusclient-ng/ \
+ http://download2.berlios.de/radiusclient-ng/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RADIUSCLIENT_NG,radiusclient-ng,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LIBRADIUSCLIENT_NG,libradiusclient-ng,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= ac_cv_func_getdomainname=yes
+BUILD_STYLE:= auto
+ALL_TARGET:= install-exec install-data
+MAKE_FLAGS+= DESTDIR="${WRKINST}"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_RADIUSCLIENT_NG}/usr
+ ${CP} ${WRKINST}/usr/sbin ${IDIR_RADIUSCLIENT_NG}/usr/
+ ${CP} ${WRKINST}/etc ${IDIR_RADIUSCLIENT_NG}/
+ ${INSTALL_DIR} ${IDIR_LIBRADIUSCLIENT_NG}/usr
+ ${CP} ${WRKINST}/usr/lib ${IDIR_LIBRADIUSCLIENT_NG}/usr/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/radiusclient-ng/ipkg/libradiusclient-ng.control b/package/radiusclient-ng/ipkg/libradiusclient-ng.control
new file mode 100644
index 000000000..8b8726cd2
--- /dev/null
+++ b/package/radiusclient-ng/ipkg/libradiusclient-ng.control
@@ -0,0 +1,4 @@
+Package: libradiusclient-ng
+Section: libs
+Description: RADIUS client library
+Priority: optional
diff --git a/package/radiusclient-ng/ipkg/radiusclient-ng.control b/package/radiusclient-ng/ipkg/radiusclient-ng.control
new file mode 100644
index 000000000..d11a837bd
--- /dev/null
+++ b/package/radiusclient-ng/ipkg/radiusclient-ng.control
@@ -0,0 +1,5 @@
+Package: radiusclient-ng
+Section: net
+Description: RADIUS client
+Priority: optional
+Depends: libopenssl
diff --git a/package/radiusclient-ng/patches/01-cross_compile.patch b/package/radiusclient-ng/patches/01-cross_compile.patch
new file mode 100644
index 000000000..3c4e3d192
--- /dev/null
+++ b/package/radiusclient-ng/patches/01-cross_compile.patch
@@ -0,0 +1,13 @@
+diff -Nur radiusclient-ng-0.5.5.orig/configure radiusclient-ng-0.5.5/configure
+--- radiusclient-ng-0.5.5.orig/configure 2007-02-05 13:53:08.000000000 +0100
++++ radiusclient-ng-0.5.5/configure 2007-03-05 10:36:37.000000000 +0100
+@@ -23332,8 +23332,7 @@
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++See \`config.log' for more details." >&2;} }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
diff --git a/package/radvd/Config.in b/package/radvd/Config.in
new file mode 100644
index 000000000..2ed97bb82
--- /dev/null
+++ b/package/radvd/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_RADVD
+ prompt "radvd............................. IPv6 Routing Advertisement Daemon"
+ depends on ADK_IPV6
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_IPV6
+ help
+ Routing Advertisement Daemon for IPv6
+
+ http://v6web.litech.org/radvd/
+
diff --git a/package/radvd/Makefile b/package/radvd/Makefile
new file mode 100644
index 000000000..2d031e0a3
--- /dev/null
+++ b/package/radvd/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= radvd
+PKG_VERSION:= 0.7.3
+PKG_RELEASE:= 8
+PKG_MD5SUM:= 56ce3f8cbf5966a0d531c21813320423
+
+MASTER_SITES:= http://v6web.litech.org/radvd/dist/ \
+ http://download.sourcemage.org/mirror/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RADVD,radvd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-configfile=/etc/radvd.conf \
+ --with-logfile=/var/log/radvd.log \
+ --with-pidfile=/var/run/radvd.pid
+
+do-build:
+ $(MAKE) -C $(WRKBUILD) \
+ radvd_LDADD=""
+ mkdir -p $(WRKINST)
+ $(MAKE) -C $(WRKBUILD) \
+ DESTDIR="$(WRKINST)" \
+ install
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_RADVD}/etc
+ ${INSTALL_DATA} ./files/radvd.conf ${IDIR_RADVD}/etc/
+ ${INSTALL_DIR} ${IDIR_RADVD}/etc/init.d
+ ${INSTALL_BIN} ./files/radvd.init ${IDIR_RADVD}/etc/init.d/radvd
+ ${INSTALL_DIR} ${IDIR_RADVD}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/radvd ${IDIR_RADVD}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/radvdump ${IDIR_RADVD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/radvd/files/radvd.conf b/package/radvd/files/radvd.conf
new file mode 100644
index 000000000..06d835704
--- /dev/null
+++ b/package/radvd/files/radvd.conf
@@ -0,0 +1,22 @@
+# For more examples, see the radvd documentation.
+
+interface br0
+{
+ AdvSendAdvert off;
+
+#
+# Disable Mobile IPv6 support
+#
+ AdvHomeAgentFlag off;
+
+#
+# example of a standard prefix
+#
+ prefix fec0:0:0:1::/64
+ {
+ AdvOnLink on;
+ AdvAutonomous on;
+ AdvRouterAddr off;
+ };
+
+};
diff --git a/package/radvd/files/radvd.init b/package/radvd/files/radvd.init
new file mode 100644
index 000000000..ba2b60535
--- /dev/null
+++ b/package/radvd/files/radvd.init
@@ -0,0 +1,29 @@
+#!/bin/sh
+#FWINIT 51
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${radvd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+ /usr/sbin/radvd
+ ;;
+
+stop)
+ killall radvd
+ echo 0 > /proc/sys/net/ipv6/conf/all/forwarding
+ ;;
+
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/radvd/ipkg/radvd.conffiles b/package/radvd/ipkg/radvd.conffiles
new file mode 100644
index 000000000..a1418c0a1
--- /dev/null
+++ b/package/radvd/ipkg/radvd.conffiles
@@ -0,0 +1 @@
+/etc/radvd.conf
diff --git a/package/radvd/ipkg/radvd.control b/package/radvd/ipkg/radvd.control
new file mode 100644
index 000000000..67df96e73
--- /dev/null
+++ b/package/radvd/ipkg/radvd.control
@@ -0,0 +1,5 @@
+Package: radvd
+Priority: optional
+Section: net
+Depends: kmod-ipv6
+Description: Routing Advertisement Daemon for IPv6
diff --git a/package/radvd/ipkg/radvd.postinst b/package/radvd/ipkg/radvd.postinst
new file mode 100644
index 000000000..8e3ea08f6
--- /dev/null
+++ b/package/radvd/ipkg/radvd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf radvd radvd NO
diff --git a/package/radvd/patches/no-libfl.patch b/package/radvd/patches/no-libfl.patch
new file mode 100644
index 000000000..e17a127c9
--- /dev/null
+++ b/package/radvd/patches/no-libfl.patch
@@ -0,0 +1,12 @@
+diff -urN radvd-0.7.3.old/scanner.l radvd-0.7.3/scanner.l
+--- radvd-0.7.3.old/scanner.l 2004-10-26 07:30:34.000000000 +0200
++++ radvd-0.7.3/scanner.l 2005-04-05 00:01:42.000000000 +0200
+@@ -21,6 +21,8 @@
+
+ extern char *conf_file;
+
++int yywrap(void) { return 1; }
++
+ int num_lines = 1;
+ %}
+
diff --git a/package/randrproto/Config.in b/package/randrproto/Config.in
new file mode 100644
index 000000000..949c5caee
--- /dev/null
+++ b/package/randrproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_RANDRPROTO
+ prompt "randrproto.............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/randrproto/Makefile b/package/randrproto/Makefile
new file mode 100644
index 000000000..06140db72
--- /dev/null
+++ b/package/randrproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= randrproto
+PKG_VERSION:= 1.2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d6b6b024d71b689628bcaf27fd491f5b
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rarpd/Config.in b/package/rarpd/Config.in
new file mode 100644
index 000000000..9f5c7ac65
--- /dev/null
+++ b/package/rarpd/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_RARPD
+ prompt "rarpd............................. Reverse ARP Daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNET
+ help
+ Rarpd is a daemon which responds to RARP requests.
+ RARP is used by some machines at boot time to discover their
+ IP address. They provide their Ethernet address and rarpd
+ responds with their IP address if it finds it in the ethers
+ database.
+
+ ftp://ftp.dementia.org/pub/net-tools/
+
diff --git a/package/rarpd/Makefile b/package/rarpd/Makefile
new file mode 100644
index 000000000..c32eb13fa
--- /dev/null
+++ b/package/rarpd/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= rarpd
+PKG_VERSION:= 1.1
+PKG_RELEASE:= 10
+PKG_MD5SUM:= 04e2ca849e758d0b88c8281775ec3b58
+MASTER_SITES:= ftp://ftp.dementia.org/pub/net-tools/
+
+# Hack Alert!
+# The configure script for rarpd, when used with the --with-libnet option
+# doesn't correctly detect and set -DNEW_LIBNET_INTERFACE.
+EXTRA_CFLAGS= -DNEW_LIBNET_INTERFACE
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RARPD,rarpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-libnet="${STAGING_DIR}/usr" \
+ --with-pcap="${STAGING_DIR}/usr"
+TCFLAGS+= ${EXTRA_CFLAGS}
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_RARPD}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_RARPD}/etc/init.d
+ ${INSTALL_BIN} ${WRKINST}/sbin/rarpd ${IDIR_RARPD}/usr/sbin/
+ ${INSTALL_BIN} ./files/rarpd.init ${IDIR_RARPD}/etc/init.d/rarpd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rarpd/files/rarpd.init b/package/rarpd/files/rarpd.init
new file mode 100644
index 000000000..09a346432
--- /dev/null
+++ b/package/rarpd/files/rarpd.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${rarpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ rarpd $rarpd_flags
+ ;;
+stop)
+ killall rarpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/rarpd/ipkg/rarpd.control b/package/rarpd/ipkg/rarpd.control
new file mode 100644
index 000000000..221e869af
--- /dev/null
+++ b/package/rarpd/ipkg/rarpd.control
@@ -0,0 +1,5 @@
+Package: rarpd
+Priority: optional
+Section: net
+Depends: libnet
+Description: Reverse ARP Daemon
diff --git a/package/rarpd/ipkg/rarpd.postinst b/package/rarpd/ipkg/rarpd.postinst
new file mode 100644
index 000000000..ed21e9d6f
--- /dev/null
+++ b/package/rarpd/ipkg/rarpd.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf rarpd rarpd NO
+add_rcconf rarpd_flags rarpd_flags "-i eth0.0"
diff --git a/package/rdate/Config.in b/package/rdate/Config.in
new file mode 100644
index 000000000..76954adc9
--- /dev/null
+++ b/package/rdate/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_RDATE
+ prompt "rdate............................. very small rdate and ntp client"
+ tristate
+ default n
+ help
+ A very small but secure rdate and ntp time synchronisation
+ client from MirBSD.
diff --git a/package/rdate/Makefile b/package/rdate/Makefile
new file mode 100644
index 000000000..4c409c88b
--- /dev/null
+++ b/package/rdate/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= rdate
+PKG_VERSION= 20070817
+PKG_RELEASE= 2
+PKG_MD5SUM= 9a6489d7de4311678a3fab001bb503df
+MASTER_SITES= ${MASTER_SITE_MIRBSD:distfiles/=dist/mir/rdate/}
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RDATE,rdate,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+MAKE_FILE= GNUmakefile
+BUILD_STYLE= auto
+
+do-install:
+ifeq (${ADK_MANPAGES},y)
+ mkdir -p ${WRKINST}/man8
+ cp ${WRKSRC}/rdate.8 ${WRKINST}/man8/
+endif
+ ${INSTALL_DIR} ${IDIR_RDATE}/{etc/{init.d,ppp/ip-up.d},usr/sbin}
+ ${INSTALL_BIN} ${WRKBUILD}/rdate ${IDIR_RDATE}/usr/sbin/
+ ${INSTALL_SCRIPT} rdate.ip-up ${IDIR_RDATE}/etc/ppp/ip-up.d/rdate
+ ${INSTALL_SCRIPT} rdate.init ${IDIR_RDATE}/etc/init.d/rdate
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rdate/ipkg/rdate.control b/package/rdate/ipkg/rdate.control
new file mode 100644
index 000000000..dcd902764
--- /dev/null
+++ b/package/rdate/ipkg/rdate.control
@@ -0,0 +1,4 @@
+Package: rdate
+Priority: base
+Section: base
+Description: A small rdate and NTP client
diff --git a/package/rdate/ipkg/rdate.postinst b/package/rdate/ipkg/rdate.postinst
new file mode 100644
index 000000000..e0013bdcc
--- /dev/null
+++ b/package/rdate/ipkg/rdate.postinst
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf 'e.g. "-nv pool.ntp.org"' rdate_flags
+add_service ntp 123/udp
diff --git a/package/rdate/rdate.init b/package/rdate/rdate.init
new file mode 100644
index 000000000..88bf464b9
--- /dev/null
+++ b/package/rdate/rdate.init
@@ -0,0 +1,21 @@
+#!/bin/mksh
+#FWINIT 54
+# It’s important that this is lower than openntpd’s FWinit number
+. /etc/rc.conf
+case $1 in
+autostart|start|restart)
+ if [[ $(ls -l /usr/sbin/rdate) != *ucb* ]]; then
+ rm -f /usr/sbin/rdate
+ ln -s ../ucb/rdate /usr/sbin/rdate
+ fi
+ [[ $rdate_flags = NO ]] && exit 0
+ /usr/ucb/rdate $rdate_flags
+ ;;
+autostop|stop)
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/rdate/rdate.ip-up b/package/rdate/rdate.ip-up
new file mode 100644
index 000000000..a80a7f320
--- /dev/null
+++ b/package/rdate/rdate.ip-up
@@ -0,0 +1,4 @@
+#!/bin/mksh
+. /etc/rc.conf
+[[ $rdate_flags = NO ]] || /usr/ucb/rdate $rdate_flags
+exit 0
diff --git a/package/readline/Config.in b/package/readline/Config.in
new file mode 100644
index 000000000..aa126e21f
--- /dev/null
+++ b/package/readline/Config.in
@@ -0,0 +1,21 @@
+config ADK_COMPILE_READLINE
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBREADLINE
+
+config ADK_PACKAGE_LIBREADLINE
+ prompt "libreadline....................... Command lines edition library"
+ tristate
+ default n
+ select ADK_COMPILE_READLINE
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ The Readline library provides a set of functions for use by applications
+ that allow users to edit command lines as they are typed in. Both Emacs
+ and vi editing modes are available. The Readline library includes
+ additional functions to maintain a list of previously-entered command
+ lines, to recall and perhaps reedit those lines, and perform csh-like
+ history expansion on previous commands.
+
+ http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
+
diff --git a/package/readline/Makefile b/package/readline/Makefile
new file mode 100644
index 000000000..43f6f124c
--- /dev/null
+++ b/package/readline/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= readline
+PKG_VERSION:= 5.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e39331f32ad14009b9ff49cc10c5e751
+MASTER_SITES:= ${MASTER_SITE_GNU:=readline/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBREADLINE,libreadline,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-curses
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBREADLINE}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libhistory.so.* ${IDIR_LIBREADLINE}/usr/lib/
+ ${CP} ${WRKINST}/usr/lib/libreadline.so.* ${IDIR_LIBREADLINE}/usr/lib/
+ chmod u+w ${IDIR_LIBREADLINE}/usr/lib/*
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/readline/ipkg/libreadline.control b/package/readline/ipkg/libreadline.control
new file mode 100644
index 000000000..39946d6a2
--- /dev/null
+++ b/package/readline/ipkg/libreadline.control
@@ -0,0 +1,5 @@
+Package: libreadline
+Priority: optional
+Section: libs
+Depends: libncurses
+Description: Command lines edition library
diff --git a/package/reaim/Config.in b/package/reaim/Config.in
new file mode 100644
index 000000000..baf0f2200
--- /dev/null
+++ b/package/reaim/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_REAIM
+ prompt "reaim............................. A transparent AIM / MSN proxy"
+ tristate
+ default n
+ help
+ ReAIM is a proxy for file transfers with MSN/AIM.
+
+ http://reaim.sourceforge.net/
+
diff --git a/package/reaim/Makefile b/package/reaim/Makefile
new file mode 100644
index 000000000..991ea177c
--- /dev/null
+++ b/package/reaim/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= reaim
+PKG_VERSION:= 0.8
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 647d2ab72ec454f89294accfb3182c09
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=reaim/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,REAIM,reaim,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_REAIM}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_REAIM}/usr/sbin
+ ${INSTALL_BIN} ./files/reaim.init \
+ ${IDIR_REAIM}/etc/init.d/reaim
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/reaim ${IDIR_REAIM}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/reaim/files/reaim.init b/package/reaim/files/reaim.init
new file mode 100644
index 000000000..4ef211283
--- /dev/null
+++ b/package/reaim/files/reaim.init
@@ -0,0 +1,33 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+IPT=/usr/sbin/iptables
+WAN=${reaim_flags}
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${reaim:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ $IPT -A input_rule -i $WAN -p tcp --dport 1863:1864 -j ACCEPT
+ $IPT -A input_rule -i $WAN -p tcp --dport 4443 -j ACCEPT
+ $IPT -A input_rule -i $WAN -p tcp --dport 5566 -j ACCEPT
+ $IPT -A input_rule -i $WAN -p tcp --dport 40000:40099 -j ACCEPT
+ reaim
+ ;;
+stop)
+ killall reaim
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/reaim/ipkg/reaim.control b/package/reaim/ipkg/reaim.control
new file mode 100644
index 000000000..31bc9a9a3
--- /dev/null
+++ b/package/reaim/ipkg/reaim.control
@@ -0,0 +1,5 @@
+Package: reaim
+Priority: optional
+Section: net
+Depends: iptables
+Description: A transparent AIM / MSN proxy
diff --git a/package/reaim/ipkg/reaim.postinst b/package/reaim/ipkg/reaim.postinst
new file mode 100644
index 000000000..39c37b222
--- /dev/null
+++ b/package/reaim/ipkg/reaim.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf reaim reaim NO
+add_rcconf reaim_flags reaim_flags "eth0.1"
diff --git a/package/reaim/patches/501-cross_compile-install.patch b/package/reaim/patches/501-cross_compile-install.patch
new file mode 100644
index 000000000..9e88f617e
--- /dev/null
+++ b/package/reaim/patches/501-cross_compile-install.patch
@@ -0,0 +1,16 @@
+diff -urN reaim-0.8/Makefile reaim-0.8/Makefile
+--- reaim-0.8/Makefile 2002-11-28 06:10:38.000000000 +0100
++++ reaim-0.8/Makefile 2005-10-07 12:07:43.000000000 +0200
+@@ -11,7 +11,10 @@
+ endif
+
+ reaim: reaim.c
+- gcc -o reaim reaim.c -g -Wall $(FW_FLAGS)
+-
++ $(CC) $(CFLAGS) -o reaim reaim.c -Wall $(FW_FLAGS)
+ clean:
+ -rm reaim
++
++install:
++ install -d -m 0755 $(DESTDIR)/usr/sbin
++ install -m 0755 reaim $(DESTDIR)/usr/sbin/
diff --git a/package/renderproto/Config.in b/package/renderproto/Config.in
new file mode 100644
index 000000000..a2709ef12
--- /dev/null
+++ b/package/renderproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_RENDERPROTO
+ prompt "renderproto............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/renderproto/Makefile b/package/renderproto/Makefile
new file mode 100644
index 000000000..db6623328
--- /dev/null
+++ b/package/renderproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= renderproto
+PKG_VERSION:= 0.9.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ab8f3e356973d9c99810a8f092db3a2e
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/resourceproto/Config.in b/package/resourceproto/Config.in
new file mode 100644
index 000000000..850b015ef
--- /dev/null
+++ b/package/resourceproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_RESOURCEPROTO
+ prompt "resourceproto............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/resourceproto/Makefile b/package/resourceproto/Makefile
new file mode 100644
index 000000000..fc1a3917e
--- /dev/null
+++ b/package/resourceproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= resourceproto
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 198252b76e8082958cc2228d8dcc7c2f
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rp-pppoe/Config.in b/package/rp-pppoe/Config.in
new file mode 100644
index 000000000..439d582ee
--- /dev/null
+++ b/package/rp-pppoe/Config.in
@@ -0,0 +1,50 @@
+#menu "rp-pppoe.......................... Roaring Penguin PPPoE (PPP over Ethernet) implementation"
+
+config ADK_COMPILE_RP_PPPOE
+ tristate
+ default n
+ depends ADK_PACKAGE_PPPOE_CLIENT || ADK_PACKAGE_PPPOE_RELAY || ADK_PACKAGE_PPPOE_SERVER || ADK_PACKAGE_PPPOE_SNIFF
+
+config ADK_PACKAGE_PPPOE_CLIENT
+ prompt "pppoe-client...................... PPPoE (PPP over Ethernet) client"
+ tristate
+ default n
+ select ADK_COMPILE_RP_PPPOE
+ select ADK_PACKAGE_PPP
+ help
+ PPPoE (PPP over Ethernet) client
+
+ http://roaringpenguin.com/penguin/open_source_rp-pppoe.php
+
+config ADK_PACKAGE_PPPOE_RELAY
+ prompt "pppoe-relay....................... PPPoE (PPP over Ethernet) relay"
+ tristate
+ default n
+ select ADK_COMPILE_RP_PPPOE
+ help
+ PPPoE (PPP over Ethernet) relay
+
+ http://roaringpenguin.com/penguin/open_source_rp-pppoe.php
+
+config ADK_PACKAGE_PPPOE_SERVER
+ prompt "pppoe-server...................... PPPoE (PPP over Ethernet) server"
+ tristate
+ default n
+ select ADK_COMPILE_RP_PPPOE
+ select ADK_PACKAGE_PPP
+ help
+ PPPoE (PPP over Ethernet) server
+
+ http://roaringpenguin.com/penguin/open_source_rp-pppoe.php
+
+config ADK_PACKAGE_PPPOE_SNIFF
+ prompt "pppoe-sniff....................... PPPoE (PPP over Ethernet) frame sniffer"
+ tristate
+ default n
+ select ADK_COMPILE_RP_PPPOE
+ help
+ PPPoE (PPP over Ethernet) frame sniffer
+
+ http://roaringpenguin.com/penguin/open_source_rp-pppoe.php
+
+#endmenu
diff --git a/package/rp-pppoe/Makefile b/package/rp-pppoe/Makefile
new file mode 100644
index 000000000..322d1b7e4
--- /dev/null
+++ b/package/rp-pppoe/Makefile
@@ -0,0 +1,60 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= rp-pppoe
+PKG_VERSION:= 3.10
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d58a13cc4185bca6121a606ff456dec0
+MASTER_SITES:= http://www.roaringpenguin.com/files/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,PPPOE_CLIENT,pppoe-client,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPPOE_RELAY,pppoe-relay,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPPOE_SERVER,pppoe-server,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,PPPOE_SNIFF,pppoe-sniff,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_setvbuf_reversed=no \
+ ac_cv_sizeof_unsigned_short=2 \
+ ac_cv_sizeof_unsigned_int=4 \
+ ac_cv_sizeof_unsigned_long=4 \
+ ac_cv_linux_kernel_pppoe=yes \
+ ac_cv_pack_bitfields_reversed=yes
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+WRKSRC:= ${WRKDIST}/src
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_PPPOE_CLIENT}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_PPPOE_CLIENT}/etc/ppp
+ ${INSTALL_DIR} ${IDIR_PPPOE_CLIENT}/usr/sbin
+ ${INSTALL_BIN} ./files/pppoe-client.init \
+ ${IDIR_PPPOE_CLIENT}/etc/init.d/pppoe-client
+ ${INSTALL_DATA} ${WRKINST}/etc/ppp/pppoe.conf ${IDIR_PPPOE_CLIENT}/etc/ppp
+ ${CP} ${WRKINST}/usr/sbin/pppoe ${IDIR_PPPOE_CLIENT}/usr/sbin/
+ ${CP} ${WRKINST}/usr/sbin/pppoe-connect ${IDIR_PPPOE_CLIENT}/usr/sbin/
+ ${CP} ${WRKINST}/usr/sbin/pppoe-start ${IDIR_PPPOE_CLIENT}/usr/sbin/
+ ${CP} ${WRKINST}/usr/sbin/pppoe-stop ${IDIR_PPPOE_CLIENT}/usr/sbin/
+ ${CP} ${WRKINST}/usr/sbin/pppoe-status ${IDIR_PPPOE_CLIENT}/usr/sbin/
+ ${CP} ${WRKINST}/usr/sbin/pppoe-setup ${IDIR_PPPOE_CLIENT}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_PPPOE_RELAY}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_PPPOE_RELAY}/usr/sbin
+ ${INSTALL_BIN} ./files/pppoe-relay.init \
+ ${IDIR_PPPOE_RELAY}/etc/init.d/pppoe-relay
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/pppoe-relay ${IDIR_PPPOE_RELAY}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_PPPOE_SERVER}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_PPPOE_SERVER}/etc/ppp
+ ${INSTALL_DIR} ${IDIR_PPPOE_SERVER}/usr/sbin
+ ${INSTALL_BIN} ./files/pppoe-server.init \
+ ${IDIR_PPPOE_SERVER}/etc/init.d/pppoe-server
+ ${INSTALL_DATA} ${WRKINST}/etc/ppp/pppoe-server-options ${IDIR_PPPOE_SERVER}/etc/ppp/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/pppoe-server ${IDIR_PPPOE_SERVER}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_PPPOE_SNIFF}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/pppoe-sniff ${IDIR_PPPOE_SNIFF}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rp-pppoe/files/pppoe-client.init b/package/rp-pppoe/files/pppoe-client.init
new file mode 100644
index 000000000..79663eca3
--- /dev/null
+++ b/package/rp-pppoe/files/pppoe-client.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${pppoe_client:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ adsl-start
+ ;;
+stop)
+ adsl-stop
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/rp-pppoe/files/pppoe-relay.init b/package/rp-pppoe/files/pppoe-relay.init
new file mode 100644
index 000000000..0f340020a
--- /dev/null
+++ b/package/rp-pppoe/files/pppoe-relay.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${pppoe_relay:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ pppoe-relay $pppoe_relay_flags
+ ;;
+stop)
+ killall pppoe-relay
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/rp-pppoe/files/pppoe-server.init b/package/rp-pppoe/files/pppoe-server.init
new file mode 100644
index 000000000..4696a5745
--- /dev/null
+++ b/package/rp-pppoe/files/pppoe-server.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${pppoe_server:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ pppoe-server
+ ;;
+stop)
+ killall pppoe-server
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/rp-pppoe/ipkg/pppoe-client.conffiles b/package/rp-pppoe/ipkg/pppoe-client.conffiles
new file mode 100644
index 000000000..7cf395925
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-client.conffiles
@@ -0,0 +1 @@
+/etc/ppp/pppoe.conf
diff --git a/package/rp-pppoe/ipkg/pppoe-client.control b/package/rp-pppoe/ipkg/pppoe-client.control
new file mode 100644
index 000000000..dd64953c3
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-client.control
@@ -0,0 +1,5 @@
+Package: pppoe-client
+Priority: optional
+Section: net
+Description: PPPoE (PPP over Ethernet) client
+Depends: ppp
diff --git a/package/rp-pppoe/ipkg/pppoe-client.postinst b/package/rp-pppoe/ipkg/pppoe-client.postinst
new file mode 100644
index 000000000..2fd0db891
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-client.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf pppoe_client pppoe_client NO
diff --git a/package/rp-pppoe/ipkg/pppoe-relay.control b/package/rp-pppoe/ipkg/pppoe-relay.control
new file mode 100644
index 000000000..de64b0bec
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-relay.control
@@ -0,0 +1,4 @@
+Package: pppoe-relay
+Priority: optional
+Section: net
+Description: PPPoE (PPP over Ethernet) relay
diff --git a/package/rp-pppoe/ipkg/pppoe-relay.postinst b/package/rp-pppoe/ipkg/pppoe-relay.postinst
new file mode 100644
index 000000000..2a727ec96
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-relay.postinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf pppoe_relay pppoe_relay NO
+add_rcconf pppoe_relay_flags pppoe_relay_flags "-C eth2 -S vlan1"
+
diff --git a/package/rp-pppoe/ipkg/pppoe-server.conffiles b/package/rp-pppoe/ipkg/pppoe-server.conffiles
new file mode 100644
index 000000000..438de2c2c
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-server.conffiles
@@ -0,0 +1 @@
+/etc/ppp/pppoe-server-options
diff --git a/package/rp-pppoe/ipkg/pppoe-server.control b/package/rp-pppoe/ipkg/pppoe-server.control
new file mode 100644
index 000000000..530017b96
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-server.control
@@ -0,0 +1,5 @@
+Package: pppoe-server
+Priority: optional
+Section: net
+Description: PPPoE (PPP over Ethernet) server
+Depends: ppp
diff --git a/package/rp-pppoe/ipkg/pppoe-sniff.control b/package/rp-pppoe/ipkg/pppoe-sniff.control
new file mode 100644
index 000000000..df7b95cf2
--- /dev/null
+++ b/package/rp-pppoe/ipkg/pppoe-sniff.control
@@ -0,0 +1,4 @@
+Package: pppoe-sniff
+Priority: optional
+Section: net
+Description: PPPoE (PPP over Ethernet) frame sniffer
diff --git a/package/rp-pppoe/ipkg/rules b/package/rp-pppoe/ipkg/rules
new file mode 100644
index 000000000..cfb76b088
--- /dev/null
+++ b/package/rp-pppoe/ipkg/rules
@@ -0,0 +1,169 @@
+#!/usr/bin/make -f
+
+ifneq ($(strip ${IPKG_RULES_INC}),)
+ include $(IPKG_RULES_INC)
+endif
+
+##
+
+PKG_VERSION := $(shell cat ./ipkg/version)
+CURRENT_DIR := $(shell pwd)
+INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
+
+unexport INSTALL_DIR
+
+I_PPPOE_SERVER := ipkg/pppoe-server
+I_PPPOE_RELAY := ipkg/pppoe-relay
+I_PPPOE_SNIFF := ipkg/pppoe-sniff
+I_PPPOE_CLIENT := ipkg/pppoe-client
+
+BUILD_DEPS = \
+
+CONFIGURE_OPTS = \
+
+##
+
+all: package
+
+
+.stamp-configured: $(BUILD_DEPS)
+
+ cd src ; \
+ rm -rf config.cache ; \
+ $(TARGET_CONFIGURE_OPTS) \
+ ac_cv_func_setvbuf_reversed=no \
+ ac_cv_sizeof_unsigned_short=2 \
+ ac_cv_sizeof_unsigned_int=4 \
+ ac_cv_sizeof_unsigned_long=4 \
+ ac_cv_linux_kernel_pppoe=yes \
+ ac_cv_pack_bitfields_reversed=yes \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ ./configure \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --program-prefix="" \
+ --program-suffix="" \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=/usr/share \
+ --includedir=/usr/include \
+ --infodir=/usr/share/info \
+ --libdir=/usr/lib \
+ --libexecdir=/usr/lib \
+ --localstatedir=/var \
+ --mandir=/usr/share/man \
+ --sbindir=/usr/sbin \
+ --sysconfdir=/etc \
+ --disable-nls \
+ $(CONFIGURE_OPTS) \
+
+ touch .stamp-configured
+
+
+.stamp-built: .stamp-configured
+
+ $(MAKE) -C src \
+ $(TARGET_CONFIGURE_OPTS) \
+
+ touch .stamp-built
+
+
+$(INSTALL_DIR)/usr/sbin/pppoe: .stamp-built
+
+ mkdir -p $(INSTALL_DIR)
+
+ $(MAKE) -C src \
+ DESTDIR="$(INSTALL_DIR)" \
+ install
+
+
+configure: .stamp-configured
+
+
+build: .stamp-built
+
+
+install: $(INSTALL_DIR)/usr/sbin/pppoe
+
+
+package: $(INSTALL_DIR)/usr/sbin/pppoe
+
+ mkdir -p $(I_PPPOE_SERVER)/etc/ppp
+ cp -fpR $(INSTALL_DIR)/etc/ppp/pppoe-server-options $(I_PPPOE_SERVER)/etc/ppp/
+ mkdir -p $(I_PPPOE_SERVER)/usr/sbin
+ cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe-server $(I_PPPOE_SERVER)/usr/sbin/
+ $(STRIP) $(I_PPPOE_SERVER)/usr/sbin/*
+
+ mkdir -p $(I_PPPOE_RELAY)/usr/sbin
+ cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe-relay $(I_PPPOE_RELAY)/usr/sbin/
+ $(STRIP) $(I_PPPOE_RELAY)/usr/sbin/*
+
+ mkdir -p $(I_PPPOE_SNIFF)/usr/sbin
+ cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe-sniff $(I_PPPOE_SNIFF)/usr/sbin/
+ $(STRIP) $(I_PPPOE_SNIFF)/usr/sbin/*
+
+ mkdir -p $(I_PPPOE_CLIENT)/etc
+ cp -fpR $(INSTALL_DIR)/etc/pppoe.conf $(I_PPPOE_CLIENT)/etc/
+ mkdir -p $(I_PPPOE_CLIENT)/usr/sbin
+ cp -fpR $(INSTALL_DIR)/usr/sbin/pppoe $(I_PPPOE_CLIENT)/usr/sbin/
+ $(STRIP) $(I_PPPOE_CLIENT)/usr/sbin/*
+ cp -fpR $(INSTALL_DIR)/usr/sbin/adsl-* $(I_PPPOE_CLIENT)/usr/sbin/
+
+ chmod 0755 ipkg/*/etc/
+ chmod 0755 ipkg/*/etc/default/
+ chmod 0644 ipkg/*/etc/default/*
+ chmod 0755 ipkg/*/etc/init.d/
+ chmod 0755 ipkg/*/etc/init.d/*
+
+ chmod 0755 ipkg/*/CONTROL/
+ chmod 0644 ipkg/*/CONTROL/control
+ -chmod 0644 ipkg/*/CONTROL/conffiles
+
+ perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
+ifneq ($(strip $(PKG_VERSION)),)
+ perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
+endif
+
+ $(IPKG_BUILD) $(I_PPPOE_SERVER) $(IPKG_TARGET_DIR)
+ $(IPKG_BUILD) $(I_PPPOE_RELAY) $(IPKG_TARGET_DIR)
+ $(IPKG_BUILD) $(I_PPPOE_SNIFF) $(IPKG_TARGET_DIR)
+ $(IPKG_BUILD) $(I_PPPOE_CLIENT) $(IPKG_TARGET_DIR)
+
+
+clean:
+
+ -$(MAKE) -C src \
+ clean
+
+ rm -rf .stamp-* \
+ $(INSTALL_DIR)/etc/pppoe.conf \
+ $(INSTALL_DIR)/etc/ppp/pppoe-server-options \
+ $(INSTALL_DIR)/usr/doc/rp-pppoe* \
+ $(INSTALL_DIR)/usr/sbin/adsl-* \
+ $(INSTALL_DIR)/usr/sbin/pppoe* \
+ $(INSTALL_DIR)/usr/share/man/man5/pppoe.conf.5* \
+ $(INSTALL_DIR)/usr/share/man/man8/adsl-*.8* \
+ $(INSTALL_DIR)/usr/share/man/man8/pppoe*.8* \
+ $(I_PPPOE_SERVER)/etc/ppp \
+ $(I_PPPOE_SERVER)/usr \
+ $(I_PPPOE_RELAY)/usr \
+ $(I_PPPOE_SNIFF)/usr \
+ $(I_PPPOE_CLIENT)/etc/ppp* \
+ $(I_PPPOE_CLIENT)/usr \
+
+
+control:
+
+ @cat $(I_PPPOE_SERVER)/CONTROL/control
+ @echo
+ @cat $(I_PPPOE_RELAY)/CONTROL/control
+ @echo
+ @cat $(I_PPPOE_SNIFF)/CONTROL/control
+ @echo
+ @cat $(I_PPPOE_CLIENT)/CONTROL/control
+ @echo
+
+
+.PHONY: configure build install package clean control
diff --git a/package/rp-pppoe/ipkg/version b/package/rp-pppoe/ipkg/version
new file mode 100644
index 000000000..99d9948ce
--- /dev/null
+++ b/package/rp-pppoe/ipkg/version
@@ -0,0 +1 @@
+3.5-4
diff --git a/package/rp-pppoe/patches/patch-src_configure b/package/rp-pppoe/patches/patch-src_configure
new file mode 100644
index 000000000..e87afc7d7
--- /dev/null
+++ b/package/rp-pppoe/patches/patch-src_configure
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- rp-pppoe-3.10.orig/src/configure 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/src/configure 2008-10-30 13:04:54.000000000 +0100
+@@ -6272,7 +6272,7 @@ esac
+ { echo "$as_me:$LINENO: checking packing order of bit fields" >&5
+ echo $ECHO_N "checking packing order of bit fields... $ECHO_C" >&6; }
+ if test "$cross_compiling" = yes; then
+- $ECHO "no defaults for cross-compiling"; exit 0
++ $ECHO "no defaults for cross-compiling"
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
diff --git a/package/rrdcollect/Config.in b/package/rrdcollect/Config.in
new file mode 100644
index 000000000..a6935c706
--- /dev/null
+++ b/package/rrdcollect/Config.in
@@ -0,0 +1,33 @@
+config ADK_PACKAGE_RRDCOLLECT
+ prompt " rrdcollect...................... Round-Robin Database (RRD) collecting daemon"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBRRD || ADK_PACKAGE_LIBRRD1
+ help
+ RRDcollect is a daemon which polls ceratin files in /proc/
+ directory, gathering data and storing it inside RRDtool's
+ database files. Being written in C should be both fast
+ and resources-friendly. Supports both scanf(3)-style
+ pattern matches and perl compatible regular expressions.
+
+ http://rrdcollect.sourceforge.net/
+
+ This package contains only the deamon program.
+
+config ADK_PACKAGE_RRDCOLLECT_EXAMPLE
+ prompt " rrdcollect-example.......... Example setup for RRD collecting daemon above"
+ tristate
+ default n
+ depends ADK_PACKAGE_RRDCOLLECT
+ help
+ RRDcollect is a daemon which polls ceratin files in /proc/
+ directory, gathering data and storing it inside RRDtool's
+ database files. Being written in C should be both fast
+ and resources-friendly. Supports both scanf(3)-style
+ pattern matches and perl compatible regular expressions.
+
+ http://rrdcollect.sourceforge.net/
+
+ This packages contains programs and configuration files to
+ start graphing a basic set of ressources on your router.
+
diff --git a/package/rrdcollect/Makefile b/package/rrdcollect/Makefile
new file mode 100644
index 000000000..68372b927
--- /dev/null
+++ b/package/rrdcollect/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= rrdcollect
+PKG_VERSION:= 0.2.3
+PKG_RELEASE:= 8
+PKG_MD5SUM:= 5e4305c612bc3cccbaf802c275c81a11
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=rrdcollect/}
+
+ifneq (${ADK_PACKAGE_LIBRRD},)
+RRDTOOL_LIBS:=-lart_lgpl_2 -lfreetype -lpng
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RRDCOLLECT,rrdcollect,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,RRDCOLLECT_EXAMPLE,rrdcollect-example,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= LIBS="${RRDTOOL_LIBS} -lz" ac_cv_func_malloc_0_nonnull=yes
+CONFIGURE_ARGS+= --enable-exec \
+ --without-rrdtool \
+ --with-librrd \
+ --without-libpcre \
+ --without-libpcap
+TCFLAGS+= -DSOCKET_COMM
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_RRDCOLLECT}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/rrdcollect ${IDIR_RRDCOLLECT}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_RRDCOLLECT_EXAMPLE}/etc
+ ${INSTALL_DATA} ./files/rrd.conf ./files/rrdcollect.conf \
+ ${IDIR_RRDCOLLECT_EXAMPLE}/etc/
+ ${INSTALL_DIR} ${IDIR_RRDCOLLECT_EXAMPLE}/etc/init.d
+ ${INSTALL_BIN} ./files/rrdcollect.init \
+ ${IDIR_RRDCOLLECT_EXAMPLE}/etc/init.d/${PKG_NAME}
+ ${INSTALL_DIR} ${IDIR_RRDCOLLECT_EXAMPLE}/usr/bin
+ ${INSTALL_BIN} ./files/rrd.sh ${IDIR_RRDCOLLECT_EXAMPLE}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_RRDCOLLECT_EXAMPLE}/www/cgi-bin
+ ln -sf /var/lib/rrdcollect/rrd.cgi ${IDIR_RRDCOLLECT_EXAMPLE}/www/cgi-bin/rrd.cgi
+ ln -sf /var/lib/rrdcollect/img ${IDIR_RRDCOLLECT_EXAMPLE}/www/img
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rrdcollect/files/rrd.conf b/package/rrdcollect/files/rrd.conf
new file mode 100644
index 000000000..1a6b4a4b6
--- /dev/null
+++ b/package/rrdcollect/files/rrd.conf
@@ -0,0 +1,381 @@
+#
+# Author: Christian Rost (chr@baltic-online.de)
+# Purpose: Shell-Interface to rrdtool
+#
+# Configuration-File for rrd.sh
+#
+DATADIR=/var/lib/rrdcollect
+# Location of *.rrd-data-files
+RRDDIR=$DATADIR/rrd
+# Location of *.png-files
+IMGDIR=$DATADIR/img
+# Hostname used in title of png-images
+HOSTNAME="WRT54GS"
+# Location of rrdtool
+RRDTOOL=/usr/bin/rrdtool
+# Location of rrdcgi
+RRDCGI=/usr/bin/rrdcgi
+# Location of generated cgi-script
+RRDCGISCRIPT=$DATADIR/rrd.cgi
+# Image-Path relative to webserver-root
+RRDCGIIMGPATH="/img"
+# Location of netcat (used for fetching data from rrdcollect-daemon)
+NETCAT=/usr/bin/nc
+
+# Alternative settings for use on external machines
+#RRDDIR=/home/webm/htdocs/stats/rrd/rrd
+#IMGDIR=/home/webm/htdocs/stats/rrd/web
+#RRDTOOL=/opt/rrd/bin/rrdtool
+#RRDCGI=/opt/rrd/bin/rrdcgi
+#RRDCGISCRIPT=/home/webm/cgi-bin/rrd.cgi
+#RRDCGIIMGPATH="/stats/rrd/web"
+#NETCAT=/opt/bin/nc
+
+
+####################################################################################
+# Configuration of statistic sources:
+#
+# Column 1: Time-periods
+# I'm interrested in last-24hour-, last-week- and last-month-plots.
+# Column 2: Define precision/resolution of above three intervalls
+# These values have an impact on the size of your rrd-files,
+# and on the sharpness of your plots
+# RES=1 means maximum precision (every pixel in the plot is individual)
+# RES=4 -> 4 pixel represents one interval
+
+# Optimized values for storing rather small rrd-files on the OpenADK-box
+HOURS=24;H_RES=2;DAYS=7;D_RES=4;WEEKS=4;W_RES=4;
+# Measure-Step (Same value should be in the rrdcollect.conf) Optimal: STEP=$HOURS / $PIXWIDTH * 3600 * $H_RES
+STEP=360; MAXSTEP=`expr $STEP \* 2`
+
+# Values for storing rrd-files externally outside the router allowing better resolution
+#HOURS=24;H_RES=1;DAYS=32;D_RES=2;WEEKS=50;W_RES=2;
+#STEP=180; MAXSTEP=`expr $STEP \* 2`
+# Even better resolution
+#HOURS=8;H_RES=1;DAYS=32;D_RES=2;WEEKS=50;W_RES=2;
+#STEP=60; MAXSTEP=`expr $STEP \* 2`
+
+# Format and size of the plots PIXWIDTH will be used in
+# calculating rrd-data-file dimensions during init of rrd-files
+# If you change the size you must change NCGIPIXWIDTH too
+PIXWIDTH=480
+PIXHEIGHT=120
+PIXFORMAT=PNG
+
+# Image-Size of the thumbnail for rrdcgi
+SCGIPIXWIDTH=400
+# Normal Image-Size for rrdcgi (480px plotsize in rrd)
+NCGIPIXWIDTH=571
+
+# Predefined colors
+RED0=#ff0000; RED1=#ff5555;
+GRN0=#009828; GRN1=#81ffa2;
+ORG0=#ff9900; ORG1=#ffc571;
+BLU0=#0030ff; BLU1=#8ba1ff;
+CYA0=#ff00FF; CYA1=#ffbcfe;
+YEL0=#ffff00; YEL1=#e0df76;
+BLK0=#000000; BLK1=#7d7d7d;
+WHI0=#FFFFFF; WHI1=#c1c1c1;
+
+# Date-String used when creating images with rrd.sh
+DATE=`/bin/date "+%d.%m.%Y %H:%M:%S"`
+
+# Max-Values bytes/second and packets/second for WAN/Wifi/LAN Interfaces
+MAXWANB=130000
+MAXWANP=500
+MAXWIFB=600000
+MAXWIFP=800
+MAXLANB=1200000
+MAXLANP=1000
+
+# RRD-Types:
+# GAUGE=save the value itself, no calculations at all
+# COUNTER=continuously increasing value. difference between last 2 values must be positive ! (Traffic-Counter)
+# DERIVE=like counter but can store negative values (rate of change in free disk-space)
+#
+# General syntax: PREFIX_POSTFIX=[-]<rrdcollect-variable>|Legend|RRD-Type|Maximum|Color|RRD-Plot-Type|Printf-Precision|Optional rrdgraph def-arguments
+
+################
+# Sys-Statistics
+################
+SYS_L01=" l1|System Load (1 min)|GAUGE|U|$YEL0|AREA|%6.2lf"
+SYS_L05=" l2|System Load (5 min)|GAUGE|U|$ORG0|STACK|%6.2lf"
+SYS_L15=" l3|System Load (15 min)|GAUGE|U|$RED0|STACK|%6.2lf"
+
+SYS_CPN=" cn|CPU nice |COUNTER|U|$YEL0|AREA|%6.2lf%%"
+SYS_CPU=" cu|CPU user |COUNTER|U|$ORG0|STACK|%6.2lf%%"
+SYS_CPS=" cs|CPU system |COUNTER|U|$RED0|STACK|%6.2lf%%"
+SYS_CPI=" ci|CPU idle |COUNTER|U|$GRN0|STACK|%6.2lf%%"
+
+SYS_MEU=" mu|Memory used |GAUGE|U|$BLU0|AREA"
+SYS_MEF=" mf|Memory free |GAUGE|U|$GRN0|STACK"
+#SYS_MES=" ms|Memory shared |GAUGE|U|$BLK0|LINE1"
+SYS_MEB=" mb|Memory buffer |GAUGE|U|$YEL0|LINE1"
+SYS_MEC=" mc|Memory cached |GAUGE|U|$RED0|LINE1"
+
+SYS_FUS=" us|Flash Disk Used |GAUGE|U|$BLU0|AREA|%6.2lf%s|CDEF:usC=us,1024,* CDEF:MAXusC=us,1024,*"
+SYS_FAV=" av|Flash Disk Available|GAUGE|U|$GRN0|STACK|%6.2lf%s|CDEF:avC=av,1024,* CDEF:MAXavC=av,1024,*"
+
+SYS_IRA="ira|Interrupts total |COUNTER|U|$RED0|AREA"
+SYS_IRE="ire|Interrupts eth0 |COUNTER|U|$ORG0|AREA"
+SYS_IRW="irw|Interrupts wifi |COUNTER|U|$YEL0|STACK"
+
+SYS_PRT=" pt|Processes total |GAUGE|U|$BLU0|AREA|%6.0lf"
+SYS_CTX=" ct|Context switches |COUNTER|U|$RED0|LINE2|%6.0lf"
+SYS_PRR=" pr|Processes active |GAUGE|U|$ORG0|AREA|%6.0lf"
+SYS_ARP="arp|Arp Entries |GAUGE|U|$YEL0|LINE2|%6.0lf"
+SYS_PFK=" fk|Forks |COUNTER|U|$GRN0|LINE2|%6.0lf"
+SYS_CON="con|NAT-Connections |GAUGE|U|$CYA0|LINE2|%6.0lf"
+
+# Plot-Titles
+MISC_STATS="Misc ($HOSTNAME)"
+DSK_STATS="Flash Disk Usage ($HOSTNAME)"
+USG_STATS="System Load ($HOSTNAME)"
+MEM_STATS="Memory Usage ($HOSTNAME)"
+CPU_STATS="CPU Usage ($HOSTNAME)"
+IRQ_STATS="Interrupts ($HOSTNAME)"
+
+# Plot-Definitions (sort-order is relevant)
+SYS_CPU_STATS="CPN CPU CPS CPI"
+#SYS_MEM_STATS="MEU MEF MES MEB MEC"
+SYS_MEM_STATS="MEU MEF MEB MEC"
+SYS_USG_STATS="L01 L05 L15"
+SYS_DSK_STATS="FUS FAV"
+SYS_MISC_STATS="PRT PRR ARP PFK CTX CON"
+SYS_IRQ_STATS="IRA IRE IRW"
+
+# Data-Definition needed by init()
+SYS_ALL="$SYS_CPU_STATS $SYS_MEM_STATS $SYS_USG_STATS $SYS_DSK_STATS $SYS_MISC_STATS $SYS_IRQ_STATS"
+
+#################################################################################################
+# Wifi Traffic & Wan Traffic & Tunnel Traffic Statistics ; # LAN: vlan0 , WAN: vlan1 , eth1: WIFI
+#################################################################################################
+IF_WLOBY="Wibo |Outgoing Traffic Wifi |COUNTER|$MAXWIFB|$GRN1|AREA"
+IF_WLIBY="-Wibi|Incoming Traffic Wifi |COUNTER|$MAXWIFB|$RED0|AREA"
+IF_WLOPK="Wipo |Outgoing Packets Wifi |COUNTER|$MAXWIFP|$GRN1|AREA|%6.0lf"
+IF_WLIPK="-Wipi|Incoming Packets Wifi |COUNTER|$MAXWIFP|$RED0|AREA|%6.0lf"
+
+IF_WAIBY="-Wabi|Incoming Traffic Wan |COUNTER|$MAXWANB|$BLU0|AREA"
+IF_WAOBY="Wabo |Outgoing Traffic Wan |COUNTER|$MAXWANB|$ORG1|AREA"
+IF_WAIPK="-Wapi|Incoming Packets Wan |COUNTER|$MAXWANP|$BLU0|AREA|%6.0lf"
+IF_WAOPK="Wapo |Outgoing Packets Wan |COUNTER|$MAXWANP|$ORG1|AREA|%6.0lf"
+
+IF_LAIBY="-Labi|Incoming Traffic Lan |COUNTER|$MAXLANB|$BLU0|AREA"
+IF_LAOBY="Labo |Outgoing Traffic Lan |COUNTER|$MAXLANB|$ORG1|AREA"
+IF_LAIPK="-Lapi|Incoming Packets Lan |COUNTER|$MAXLANP|$BLU0|AREA|%6.0lf"
+IF_LAOPK="Lapo |Outgoing Packets Lan |COUNTER|$MAXLANP|$ORG1|AREA|%6.0lf"
+
+#IF_TUIBY="-tbi|Incoming Traffic VPN-Tunnel|COUNTER|$MAXWANB|$CYA0|AREA"
+#IF_TUOBY="tbo |Outgoing Traffic VPN-Tunnel|COUNTER|$MAXWANB|$YEL1|AREA"
+#IF_TUIPK="-tpi|Incoming Packets VPN-Tunnel|COUNTER|$MAXWANP|$CYA0|AREA|%6.0lf"
+#IF_TUOPK="tpo |Outgoing Packets VPN-Tunnel|COUNTER|$MAXWANP|$YEL1|AREA|%6.0lf"
+
+# Plot-Titles
+WIFI_TRAFFIC="Wifi Interface Traffic Statistics ($HOSTNAME)"
+WIFI_PACKETS="Wifi Interface Packets Statistics ($HOSTNAME)"
+WAN_TRAFFIC="Wan Interface Traffic Statistics ($HOSTNAME)"
+WAN_PACKETS="Wan Interface Packets Statistics ($HOSTNAME)"
+LAN_TRAFFIC="Lan Interface Traffic Statistics ($HOSTNAME)"
+LAN_PACKETS="Lan Interface Packets Statistics ($HOSTNAME)"
+
+#TUN_TRAFFIC="VPN-Tunnel Interface Traffic Statistics ($HOSTNAME)"
+#TUN_PACKETS="VPN-Tunnel Interface Packets Statistics ($HOSTNAME)"
+
+# Plot-Definitions (sort-order is relevant)
+IF_WIFI_TRAFFIC="WLOBY WLIBY"
+IF_WIFI_PACKETS="WLOPK WLIPK"
+IF_WAN_TRAFFIC="WAIBY WAOBY"
+IF_WAN_PACKETS="WAIPK WAOPK"
+IF_LAN_TRAFFIC="LAIBY LAOBY"
+IF_LAN_PACKETS="LAIPK LAOPK"
+#IF_TUN_TRAFFIC="TUIBY TUOBY"
+#IF_TUN_PACKETS="TUIPK TUOPK"
+
+# Data-Definition needed by init()
+#IF_ALL="$IF_WIFI_TRAFFIC $IF_WIFI_PACKETS $IF_WAN_TRAFFIC $IF_WAN_PACKETS $IF_TUN_TRAFFIC $IF_TUN_PACKETS"
+IF_ALL="$IF_LAN_TRAFFIC $IF_LAN_PACKETS $IF_WAN_TRAFFIC $IF_WAN_PACKETS $IF_WIFI_TRAFFIC $IF_WIFI_PACKETS"
+
+##############################################
+# Port Traffic Statistics for Port 1 - Port 4
+##############################################
+#PT_OPK1="po1 |Port 1 Outgoing Packets |COUNTER|U|$ORG1|AREA|%6.0lf"
+#PT_IPK1="-pi1|Port 1 Incoming Packets |COUNTER|U|$GRN0|AREA|%6.0lf"
+#PT_COL1="cl1 |Port 1 Collisions |COUNTER|U|$BLU0|AREA|%6.0lf"
+#PT_ERR1="er1 |Port 1 Errors |COUNTER|U|$CYA0|AREA|%6.0lf"
+#PT_OBY1="bo1 |Port 1 Outgoing Traffic |COUNTER|U|$ORG1|AREA"
+#PT_IBY1="-bi1|Port 1 Incoming Traffic |COUNTER|U|$GRN0|AREA"
+#PT_OPK2="po2 |Port 2 Outgoing Packets |COUNTER|U|$RED1|AREA|%6.0lf"
+#PT_IPK2="-pi2|Port 2 Incoming Packets |COUNTER|U|$BLK0|AREA|%6.0lf"
+#PT_COL2="cl2 |Port 2 Collisions |COUNTER|U|$GRN0|AREA|%6.0lf"
+#PT_ERR2="er2 |Port 2 Errors |COUNTER|U|$ORG0|AREA|%6.0lf"
+#PT_OBY2="bo2 |Port 2 Outgoing Traffic |COUNTER|U|$RED1|AREA"
+#PT_IBY2="-bi2|Port 2 Incoming Traffic |COUNTER|U|$BLK0|AREA"
+#PT_OPK3="po3 |Port 3 Outgoing Packets |COUNTER|U|$BLU1|AREA|%6.0lf"
+#PT_IPK3="-pi3|Port 3 Incoming Packets |COUNTER|U|$CYA0|AREA|%6.0lf"
+#PT_COL3="cl3 |Port 3 Collisions |COUNTER|U|$GRN0|AREA|%6.0lf"
+#PT_ERR3="er3 |Port 3 Errors |COUNTER|U|$ORG0|AREA|%6.0lf"
+#PT_OBY3="bo3 |Port 3 Outgoing Traffic |COUNTER|U|$BLU1|AREA"
+#PT_IBY3="-bi3|Port 3 Incoming Traffic |COUNTER|U|$CYA0|AREA"
+#PT_OPK4="po4 |Port 4 Outgoing Packets |COUNTER|U|$YEL1|AREA|%6.0lf"
+#PT_IPK4="-pi4|Port 4 Incoming Packets |COUNTER|U|$CYA0|AREA|%6.0lf"
+#PT_COL4="cl4 |Port 4 Collisions |COUNTER|U|$BLK0|AREA|%6.0lf"
+#PT_ERR4="er4 |Port 4 Errors |COUNTER|U|$RED0|AREA|%6.0lf"
+#PT_OBY4="bo4 |Port 4 Outgoing Traffic |COUNTER|U|$YEL1|AREA"
+#PT_IBY4="-bi4|Port 4 Incoming Traffic |COUNTER|U|$CYA0|AREA"
+
+# Plot-Titles
+#TRAFFIC_1="Traffic Statistics Port 1 ($HOSTNAME)"
+#TRAFFIC_2="Traffic Statistics Port 2 ($HOSTNAME)"
+#TRAFFIC_3="Traffic Statistics Port 3 ($HOSTNAME)"
+#TRAFFIC_4="Traffic Statistics Port 4 ($HOSTNAME)"
+#PACKETS_1="Packet Statistics Port 1 ($HOSTNAME)"
+#PACKETS_2="Packet Statistics Port 2 ($HOSTNAME)"
+#PACKETS_3="Packet Statistics Port 3 ($HOSTNAME)"
+#PACKETS_4="Packet Statistics Port 4 ($HOSTNAME)"
+
+# Plot-Definitions (sort-order is relevant)
+#PT_TRAFFIC_1="OBY1 IBY1"
+#PT_TRAFFIC_2="OBY2 IBY2"
+#PT_TRAFFIC_3="OBY3 IBY3"
+#PT_TRAFFIC_4="OBY4 IBY4"
+#PT_PACKETS_1="OPK1 IPK1 COL1 ERR1"
+#PT_PACKETS_2="OPK2 IPK2 COL2 ERR2"
+#PT_PACKETS_3="OPK3 IPK3 COL3 ERR3"
+#PT_PACKETS_4="OPK4 IPK4 COL4 ERR4"
+#PT_PACKETS_1="OPK1 IPK1"
+#PT_PACKETS_2="OPK2 IPK2"
+#PT_PACKETS_3="OPK3 IPK3"
+#PT_PACKETS_4="OPK4 IPK4"
+
+# Data Definition needed by init()
+#PT_ALL="$PT_TRAFFIC_1 $PT_TRAFFIC_2 $PT_TRAFFIC_3 $PT_TRAFFIC_4 $PT_PACKETS_1 $PT_PACKETS_2 $PT_PACKETS_3 $PT_PACKETS_4"
+
+#################################
+# Traffic Priorisation Statistics
+#################################
+#TC_APRIB="bwa|Ack Priority Queue Bandwidth |COUNTER|$MAXWANB|$YEL0|AREA"
+#TC_DPRIB="bwd|Default Priority Queue Bandwidth |COUNTER|$MAXWANB|$ORG0|STACK"
+#TC_HPRIB="bwh|High Priority Queue Bandwidth |COUNTER|$MAXWANB|$RED0|STACK"
+#TC_LPRIB="bwl|Low Priority Queue Bandwidth |COUNTER|$MAXWANB|$GRN0|STACK"
+#TC_APRID="dra|Ack Priority Queue Packet Dropped |COUNTER|100|$YEL0|AREA"
+#TC_DPRID="drd|Default Priority Queue Packet Dropped|COUNTER|100|$ORG0|STACK"
+#TC_HPRID="drh|High Priority Queue Packet Dropped |COUNTER|100|$RED0|STACK"
+#TC_LPRID="drl|Low Priority Queue Packet Dropped |COUNTER|100|$GRN0|STACK"
+
+# Plot-Titles
+#TRAFFIC="Traffic Priorisation Stats"
+#PACKETS="Packet Priorisation Stats"
+
+# Plot-Definitions (sort-order is relevant)
+#TC_TRAFFIC="APRIB DPRIB HPRIB LPRIB"
+#TC_PACKETS="APRID DPRID HPRID LPRID"
+
+# Data Definition needed by init()
+#TC_ALL="$TC_TRAFFIC $TC_PACKETS"
+
+#################################
+# Firewall Packet Drop Statistics
+#################################
+#PC_WIN="win|Windows Traffic |COUNTER|U|$YEL0|AREA"
+#PC_INV="inv|Invalid State Traffic |COUNTER|U|$ORG0|STACK"
+#PC_TCP="tcp|TCP Packets |COUNTER|U|$RED0|STACK"
+#PC_OTH="oth|Other Packets |COUNTER|U|$BLU0|STACK"
+
+# Plot-Titles
+#DROPPED="Firewall Packet Drop Statistics"
+
+# Plot-Definitions (sort-order is relevant)
+#PC_DROPPED="WIN INV TCP OTH"
+
+# Data Definition needed by init()
+#PC_ALL="$PC_DROPPED"
+
+##########################
+# Traffic Accounting Stats
+##########################
+#ACI="Incoming for "; ACO="Outgoing for "
+#IP14="notebook"; COL14=$ORG0; COL_14=$ORG1
+#IP15="saugi "; COL15=$RED0; COL_15=$RED1
+#IP20="aplink "; COL20=$GRN0; COL_20=$GRN1
+#IP50="sunny "; COL50=$BLU0; COL_50=$BLU1
+
+#TYPE=AREA
+#for i in 15 50 20 14
+#do
+# # Packet-Statistics
+# eval AC_TIP$i='-TIP$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL$i\|$TYPE"
+# eval AC_TOP$i='TOP$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL_$i\|$TYPE"
+# eval AC_UIP$i='-UIP$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL$i\|$TYPE"
+# eval AC_UOP$i='UOP$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL_$i\|$TYPE"
+# eval AC_IIP$i='-IIP$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL$i\|$TYPE"
+# eval AC_IOP$i='IOP$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANP\|\$COL_$i\|$TYPE"
+# # Traffic Statistics
+# eval AC_TIB$i='-TIB$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL$i\|$TYPE"
+# eval AC_TOB$i='TOB$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL_$i\|$TYPE"
+# eval AC_UIB$i='-UIB$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL$i\|$TYPE"
+# eval AC_UOB$i='UOB$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL_$i\|$TYPE"
+# eval AC_IIB$i='-IIB$i\|$ACI'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL$i\|$TYPE"
+# eval AC_IOB$i='IOB$i\|$ACO'"\$IP$i\|COUNTER\|$MAXWANB\|\$COL_$i\|$TYPE"
+# # Plot-Definitions (sort-order is relevant)
+# AC_TB_O="$AC_TB_O TOB$i"; AC_TB_I="$AC_TB_I TIB$i"
+# AC_TP_O="$AC_TP_O TOP$i"; AC_TP_I="$AC_TP_I TIP$i"
+# AC_UB_O="$AC_UB_O UOB$i"; AC_UB_I="$AC_UB_I UIB$i"
+# AC_UP_O="$AC_UP_O UOP$i"; AC_UP_I="$AC_UP_I UIP$i"
+# AC_IB_O="$AC_IB_O IOB$i"; AC_IB_I="$AC_IB_I IIB$i"
+# AC_IP_O="$AC_IP_O IOP$i"; AC_IP_I="$AC_IP_I IIP$i"
+# TYPE=STACK
+#done
+#AC_TB="$AC_TB_O $AC_TB_I"; AC_TP="$AC_TP_O $AC_TP_I"
+#AC_UB="$AC_UB_O $AC_UB_I"; AC_UP="$AC_UP_O $AC_UP_I"
+#AC_IB="$AC_IB_O $AC_IB_I"; AC_IP="$AC_IP_O $AC_IP_I";
+
+# Plot-Titles
+#TB="TCP Traffic Accounting Stats ($HOSTNAME)"; TP="TCP Packet Accounting Stats ($HOSTNAME)"
+#UB="UDP Traffic Accounting Stats ($HOSTNAME)"; UP="UDP Packet Accounting Stats ($HOSTNAME)"
+#IB="ICMP Traffic Accounting Stats ($HOSTNAME)";IP="ICMP Packet Accounting Stats ($HOSTNAME)"
+
+# Data Definition needed by init()
+#AC_ALL="$AC_TB $AC_TP $AC_UB $AC_UP $AC_IB $AC_IP"
+
+
+# System Statistics
+GRAPH_1="SYS|USG_STATS|$USG_STATS|Load"
+GRAPH_2="SYS|CPU_STATS|$CPU_STATS|CPU-Time_in_%|1000|--upper-limit 100 --rigid --logarithmic --lower-limit 0.1"
+GRAPH_3="SYS|MEM_STATS|$MEM_STATS|Bytes|1024"
+GRAPH_4="SYS|DSK_STATS|$DSK_STATS|Bytes|1024"
+GRAPH_5="SYS|MISC_STATS|$MISC_STATS|_|1000|--logarithmic"
+GRAPH_6="SYS|IRQ_STATS|$IRQ_STATS|IRQ_per_second|1000"
+# Interface Traffic Statistics
+GRAPH_7="IF|LAN_TRAFFIC|$LAN_TRAFFIC|Bytes_per_second"
+GRAPH_8="IF|LAN_PACKETS|$LAN_PACKETS|Packets_per_second"
+GRAPH_9="IF|WAN_TRAFFIC|$WAN_TRAFFIC|Bytes_per_second"
+GRAPH_10="IF|WAN_PACKETS|$WAN_PACKETS|Packets_per_second"
+GRAPH_11="IF|WIFI_TRAFFIC|$WIFI_TRAFFIC|Bytes_per_second"
+GRAPH_12="IF|WIFI_PACKETS|$WIFI_PACKETS|Packets_per_second"
+#GRAPH_11="IF|TUN_TRAFFIC|$TUN_TRAFFIC|Bytes_per_second"
+#GRAPH_12="IF|TUN_PACKETS|$TUN_PACKETS|Packets_per_second"
+# Port Traffic Statistics
+#GRAPH_13="PT|TRAFFIC_1|$TRAFFIC_1|Bytes_per_second"
+#GRAPH_14="PT|PACKETS_1|$PACKETS_1|Packets_per_second"
+#GRAPH_15="PT|TRAFFIC_2|$TRAFFIC_2|Bytes_per_second"
+#GRAPH_16="PT|PACKETS_2|$PACKETS_2|Packets_per_second"
+#GRAPH_17="PT|TRAFFIC_3|$TRAFFIC_3|Bytes_per_second"
+#GRAPH_18="PT|PACKETS_3|$PACKETS_3|Packets_per_second"
+#GRAPH_19="PT|TRAFFIC_4|$TRAFFIC_4|Bytes_per_second"
+#GRAPH_20="PT|PACKETS_4|$PACKETS_4|Packets_per_second"
+# Traffic Priorisation Statistics
+# GRAPH_21="TC|TRAFFIC|$TRAFFIC|Bytes_per_second|1000|--logarithmic"
+# GRAPH_22="TC|PACKETS|$PACKETS|Packets_per_second"
+# Accounting Statistics
+#GRAPH_23="AC|TB|$TB|Bytes_per_second"
+#GRAPH_24="AC|TP|$TP|Packets_per_second"
+#GRAPH_25="AC|UB|$UB|Bytes_per_second"
+#GRAPH_26="AC|UP|$UP|Packets_per_second"
+#GRAPH_27="AC|IB|$IB|Bytes_per_second"
+#GRAPH_28="AC|IP|$IP|Packets_per_second"
+# Firewall Drop Statistics
+#GRAPH_29="PC|DROPPED|$DROPPED|Packets_per_second"
+
+#ALL_PRAEFIXES="SYS IF PT TC AC PC"
+ALL_PRAEFIXES="SYS IF"
+GRAPH_MAX=12
diff --git a/package/rrdcollect/files/rrd.sh b/package/rrdcollect/files/rrd.sh
new file mode 100644
index 000000000..3faa4fb8d
--- /dev/null
+++ b/package/rrdcollect/files/rrd.sh
@@ -0,0 +1,288 @@
+#!/bin/sh
+#
+# Author: Christian Rost (chr@baltic-online.de)
+# Purpose: Shell-Interface to rrdtool
+#
+RRDCNF=/etc/rrd.conf
+. $RRDCNF
+
+######################################
+# init() function to create .rrd-file
+# $1=VAR-PRAEFIX $2=VAR-POSTFIX
+######################################
+init()
+{
+ # Calculate optimal step by assuming highest precision on the last-xhour plot
+ OPTSTEP=`expr $HOURS \* 3600 \/ $PIXWIDTH \* $H_RES`
+ [ $OPTSTEP != $STEP ] && echo "WARNING: Your optimal step is: $OPTSTEP. But you are using: $STEP"
+
+ ARH_AVG=`expr $HOURS \* 3600 \/ $PIXWIDTH \* $H_RES \/ $STEP`; ARH_CNT=`expr $HOURS \* 3600 \/ $ARH_AVG \/ $STEP`
+ ARD_AVG=`expr $DAYS \* 86400 \/ $PIXWIDTH \* $D_RES \/ $STEP`; ARD_CNT=`expr $DAYS \* 86400 \/ $ARD_AVG \/ $STEP`
+ ARW_AVG=`expr $WEEKS \* 604800 \/ $PIXWIDTH \* $W_RES \/ $STEP`; ARW_CNT=`expr $WEEKS \* 604800 \/ $ARW_AVG \/ $STEP`
+
+ PRAEFIX=$1; POSTFIX=$2
+ DSOURCE=""
+
+ echo "Init storage for $HOURS hours on averages: $ARH_AVG x $STEP seconds ($ARH_CNT total values)"
+ echo "Init storage for $DAYS days on averages: $ARD_AVG x $STEP seconds ($ARD_CNT total values)"
+ echo "Init storage for $WEEKS weeks on averages: $ARW_AVG x $STEP seconds ($ARW_CNT total values)"
+
+ eval SOURCE=\$${PRAEFIX}_${POSTFIX}
+ for i in $SOURCE
+ do
+ eval var=\$${PRAEFIX}_${i}
+ ifs="$IFS"; IFS="|"; set -- $var
+ if [ "`echo ${1} | cut -b1`" = "-" ]
+ then
+ VAR="`echo ${1} | cut -b2-`"
+ else
+ VAR=`echo $1 | sed "s/ //g"`
+ fi
+ DSOURCE="$DSOURCE DS:${VAR}:${3}:$MAXSTEP:0:${4}"
+ IFS="$ifs"
+ done
+ $DEBUG $RRDTOOL create $RRDDIR/$PRAEFIX.rrd \
+ --step ${STEP} \
+ $DSOURCE \
+ RRA:AVERAGE:0.5:$ARH_AVG:$ARH_CNT \
+ RRA:AVERAGE:0.5:$ARD_AVG:$ARD_CNT \
+ RRA:AVERAGE:0.5:$ARW_AVG:$ARW_CNT \
+ RRA:MAX:0.5:$ARH_AVG:$ARH_CNT \
+ RRA:MAX:0.5:$ARD_AVG:$ARD_CNT \
+ RRA:MAX:0.5:$ARW_AVG:$ARW_CNT
+ return $?
+}
+
+#################################################################################################################
+# graph() function to create png-graphics
+# $1=IMG-DIR $2=VAR-PRAEFIX, $3=VAR-POSTFIX, $4=Headline, $5=end, $6=start, $7=base,
+# $8=DEFS/ENTRIES $9=other rrdgraph options (Vertlabel,...)
+#################################################################################################################
+# COMMENT:"$DATE\c"
+do_rrdgraph()
+{
+ $DEBUG $NICE $RRDTOOL graph "$1/$2_$3.png" \
+ --title "$4" \
+ --imgformat $PIXFORMAT \
+ --width $PIXWIDTH \
+ --height $PIXHEIGHT \
+ --end "$5" \
+ --start "$6" \
+ --base "$7" \
+ $8 $9
+}
+
+#################################################################################################################
+# graph() function to create png-graphics
+# $1=IMG-DIR $2=VAR-PRAEFIX, $3=VAR-POSTFIX, $4=Headline, $5=end, $6=start, $7=base,
+# $8=DEFS/ENTRIES $9=other rrdgraph options (Vertlabel,...)
+#################################################################################################################
+# COMMENT:"<RRD::TIME::NOW %c>\c"
+do_rrdcgi()
+{
+ cat << EOF > $1/$2_$3.def
+
+<RRD::GRAPH $1/<RRD::CV START>$2_$3.png \
+--title "$4" \
+--imgformat $PIXFORMAT \
+--width $PIXWIDTH \
+--height $PIXHEIGHT \
+--end "$5" \
+--start <RRD::CV START> \
+--base $7 \
+--imginfo "<IMG NAME=$2_$3 SRC=$RRDCGIIMGPATH/%s OnClick=zoomToggle('${SCGIPIXWIDTH}px','${NCGIPIXWIDTH}px',this); WIDTH=${SCGIPIXWIDTH}px>" \
+--lazy \
+$8 $9 >
+EOF
+
+ cat << EOF >> $RRDCGISCRIPT
+$NEWLINE <TD valign=top>$4<br>
+ <RRD::INCLUDE $1/$2_$3.def>
+</TD>
+EOF
+}
+
+
+
+gen_cgi_header()
+{
+ cat << EOF > $RRDCGISCRIPT
+#!$RRDCGI
+<HEAD><TITLE>RRDCGI Router Statistics</TITLE></HEAD>
+<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
+function update_radio_check(robj,value) { for (var i=0; i<robj.length; i++) if (robj[i].value==value) robj[i].checked=1; }
+var nW,oW;
+function zoomToggle(iWideSmall,iWideLarge,whichImage){
+oW=whichImage.style.width;
+if(oW==iWideLarge){
+nW=iWideSmall;}else{
+nW=iWideLarge;}
+whichImage.style.width=nW;
+}
+</SCRIPT>
+<BODY onload="update_radio_check(document.RangeForm.START,'<RRD::CV START>')">
+<H1>RRDCGI Router Statistics <font size-=2><em>(<RRD::TIME::NOW %c>)</em></font></H1>
+<FORM NAME=RangeForm>
+ <INPUT NAME=START TYPE=RADIO VALUE=end-${HOURS}h checked>${HOURS} hours ago
+ <INPUT NAME=START TYPE=RADIO VALUE=end-${DAYS}d>${DAYS} days ago
+ <INPUT NAME=START TYPE=RADIO VALUE=end-${WEEKS}w>${WEEKS} weeks ago
+ <INPUT TYPE=SUBMIT>
+</FORM>
+<P>
+<TABLE>
+EOF
+}
+
+gen_cgi_footer()
+{
+ cat << EOF >> $RRDCGISCRIPT
+</TABLE>
+</P>
+</BODY>
+</HTML>
+EOF
+ chmod +x $RRDCGISCRIPT
+}
+
+#################################################################################################################
+# $1=mode $2=VAR-PRAEFIX, $3=VAR-POSTFIX, $4=Headline, $5=Vertlabel, $6=start, $7=end, $8=base, $9=other rrdgraph options
+#################################################################################################################
+do_graph()
+{
+ MODE=$1; PRAEFIX=$2; POSTFIX=$3; HEADLINE=$4; VERTLABEL=$5; START=$6; END=$7; BASE=$8; SRC=${RRDDIR}/${PRAEFIX}.rrd
+ if [ ! -r "$SRC" ]
+ then
+ echo "$SRC not found. Aborting all operations now..."
+ exit 1
+ fi
+
+ # For Graphing Memory BASE should be set to 1024, default is 1000
+ [ -n "$8" ] && BASE=$8 || BASE=1000
+ [ -n "$9" ] && OPTS=$9 || OPTS="--lower-limit 0"
+ DEFS=""; ENTRIES=""
+ eval SOURCE=\$${PRAEFIX}_${POSTFIX}
+ for i in $SOURCE
+ do
+ eval var=\$${PRAEFIX}_${i}
+ ifs="$IFS"; IFS="|"; set -- $var
+ if [ "`echo ${1} | cut -b1`" = "-" ]
+ then
+ VAR="`echo ${1} | cut -b2-`"
+ NEG=1
+ else
+ VAR=`echo $1 | sed "s/ //g"`
+ NEG=0
+ fi
+
+ if [ "$NEG" = 1 ]
+ then
+ [ -n "${8}" ] && DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX ${8} CDEF:N${VAR}C=${VAR}C,-1,* " \
+ || DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX CDEF:N${VAR}=${VAR},-1,*"
+ else
+ [ -n "${8}" ] && DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX ${8}" \
+ || DEFS="$DEFS DEF:${VAR}=$SRC:${VAR}:AVERAGE DEF:MAX${VAR}=$SRC:${VAR}:MAX"
+ fi
+ # Now this is a bit ugly, but i don't know how to escape the blanks in a proper way.
+ # If you know any better way to keep the blanks in the legend of the graphics please inform me.
+ #L=`echo ${2} | tr -s "[= =]" '\014'`
+ #L=`echo ${2} | tr -s "[= =]" '_'`
+ L=`echo ${2} | sed "s/ /_/g"`
+ if [ -n "${7}" ]
+ then
+ if [ -n "${8}" ]
+ then
+ [ "$NEG" = 1 ] && ENTRIES="$ENTRIES ${6}:N${VAR}C${5}:${L}: GPRINT:${VAR}C:AVERAGE:Average\:${7} GPRINT:MAX${VAR}C:MAX:Max\:${7} GPRINT:${VAR}C:LAST:Last\:${7}\\j" \
+ || ENTRIES="$ENTRIES ${6}:${VAR}C${5}:${L}: GPRINT:${VAR}C:AVERAGE:Average\:${7} GPRINT:MAX${VAR}C:MAX:Max\:${7} GPRINT:${VAR}C:LAST:Last\:${7}\\j"
+ else
+ [ "$NEG" = 1 ] && ENTRIES="$ENTRIES ${6}:N${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:${7} GPRINT:MAX${VAR}:MAX:Max\:${7} GPRINT:${VAR}:LAST:Last\:${7}\\j" \
+ || ENTRIES="$ENTRIES ${6}:${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:${7} GPRINT:MAX${VAR}:MAX:Max\:${7} GPRINT:${VAR}:LAST:Last\:${7}\\j"
+ fi
+ else
+ [ "$NEG" = 1 ] && ENTRIES="$ENTRIES ${6}:N${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:%6.2lf%s GPRINT:MAX${VAR}:MAX:Max\:%6.0lf%s GPRINT:${VAR}:LAST:Last\:%6.2lf%s\\j" \
+ || ENTRIES="$ENTRIES ${6}:${VAR}${5}:${L}: GPRINT:${VAR}:AVERAGE:Average\:%6.2lf%s GPRINT:MAX${VAR}:MAX:Max\:%6.0lf%s GPRINT:${VAR}:LAST:Last\:%6.2lf%s\\j"
+ fi
+ IFS="$ifs"
+ done
+
+ #[ "$POSTFIX" = "CPU_STATS" ] && (echo $OPTS; echo $DEFS ; echo $ENTRIES; echo $OPTS)
+
+ $MODE "$IMGDIR" "$PRAEFIX" "$POSTFIX" "$HEADLINE" "$END" "$START" "$BASE" "$DEFS $ENTRIES" "--vertical-label $VERTLABEL $OPTS"
+}
+
+# Check if all rrd-files are present
+# and create them if not
+init_loop()
+{
+ for j in $ALL_PRAEFIXES
+ do
+ if [ ! -f $RRDDIR/$j.rrd ]
+ then
+ echo "Creating $RRDDIR/$j.rrd ..."
+ init $j ALL
+ [ ! -f $RRDDIR/$j.rrd ] && EXIT=1
+ fi
+ done
+ [ "$EXIT" = 1 ] && return 1 || return 0
+}
+
+
+graph_loop()
+{
+ mode=$1; start=$2; end=$3; c=1
+ while [ $c -le $GRAPH_MAX ]
+ do
+ eval var=\$GRAPH_${c}
+ # $1=VAR-PRAEFIX $2=VAR-POSTFIX $3=Headline $4=Vertlabel $5=base $6=other rrdgraph options
+ ifs="$IFS"; IFS="|"; set -- $var
+ IFS="$ifs"
+ [ "$1" != "$OLD" -o "`expr \( $c - 1 \) % 2`" = 0 ] && NEWLINE="</TR><TR>" || NEWLINE=""
+ do_graph $mode $1 $2 "$3" "$4" $start $end $5 "$6"
+ c=`expr $c + 1`; OLD=$1
+ done
+}
+
+
+case "$1" in
+ init)
+ if init_loop
+ then
+ exit 0
+ else
+ echo "Initialisation of rrd-database-files failed"
+ exit 1
+ fi
+ ;;
+ cgi)
+ echo "Updating $RRDCGISCRIPT and $IMGDIR/*.def"
+ gen_cgi_header
+ # The start-time will be not used
+ graph_loop do_rrdcgi end now
+ gen_cgi_footer
+ ;;
+ images)
+ # Create the graphs
+ [ -n "$2" ] && STH=$2 || STH=24h
+ echo "Updating Graphs ($STH ago -> now) for $RRDDIR/*.rrd"
+ graph_loop do_rrdgraph "end-${STH}" now
+ ;;
+ fetch)
+ # Fetch data from rrdcollect daemon
+ if [ ! -n "$3" ]
+ then
+ echo "Usage: $0 fetch <host> <port>"
+ exit 1
+ else
+ echo "Fetching ascii-logs from rrdcollect daemon"
+ (cd $RRDDIR && $NETCAT $2 $3 | sed -n "s:^\(update .*\):$RRDTOOL \1:p" | sh -x ) 2>&1 | wc -l #>/dev/null
+ exit 0
+ fi
+ ;;
+ *) echo "Usage: $0 <init|cgi|fetch|images>"
+ echo " init: Initialize rrd-datafiles if neeeded"
+ echo " cgi: Creates cgi-script for use with rrdcgi"
+ echo " fetch: Fetching data from rrdcollect via netcat"
+ echo " images: Generates images"
+ exit 1
+ ;;
+esac
+exit 0
diff --git a/package/rrdcollect/files/rrdcollect.conf b/package/rrdcollect/files/rrdcollect.conf
new file mode 100644
index 000000000..e34c9bff7
--- /dev/null
+++ b/package/rrdcollect/files/rrdcollect.conf
@@ -0,0 +1,33 @@
+step = 360
+directory = /var/lib/rrdcollect/rrd
+
+file:///proc/stat
+"cpu0 %d %d %d %d" SYS.rrd:cu,cn,cs,ci
+"ctxt %u" SYS.rrd:ct
+"processes %u" SYS.rrd:fk
+"intr %u" SYS.rrd:ira
+
+file:///proc/meminfo
+#"Mem: %*d %d %d %d %d %d" SYS.rrd:mu,mf,ms,mb,mc
+"Mem: %*d %d %d %*d %d %d" SYS.rrd:mu,mf,mb,mc
+
+file:///proc/loadavg
+"%f %f %f %d/%d %*d" SYS.rrd:l1,l2,l3,pr,pt
+
+exec:///bin/df
+"/dev/mtdblock/4 %*d %d %d" SYS.rrd:us,av
+
+# LAN: vlan0, WAN: vlan1, WIFI: eth1
+file:///proc/net/dev
+" vlan0:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Labi,Lapi,Labo,Lapo
+" vlan1:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Wabi,Wapi,Wabo,Wapo
+" eth1:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:Wibi,Wipi,Wibo,Wipo
+#" tun0:%d %d %*d %*d %*d %*d %*d %*d %d %d" IF.rrd:tbi,tpi,tbo,tpo
+
+file:///proc/slabinfo
+"ip_conntrack %d %*d %*d %*d %*d %*d" SYS.rrd:con
+"arp_cache %d %*d %*d %*d %*d %*d" SYS.rrd:arp
+
+file:///proc/interrupts
+" 4: %d MIPS eth1" SYS.rrd:irw
+" 5: %d MIPS eth0" SYS.rrd:ire
diff --git a/package/rrdcollect/files/rrdcollect.init b/package/rrdcollect/files/rrdcollect.init
new file mode 100644
index 000000000..300f954c4
--- /dev/null
+++ b/package/rrdcollect/files/rrdcollect.init
@@ -0,0 +1,34 @@
+#!/bin/sh
+#FWINIT 90
+. /etc/rc.conf
+
+LIB_D=/var/lib/rrdcollect
+CGI_S=$LIB_D/rrd.cgi
+RRD_D=$LIB_D/rrd
+RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${rrdcollect:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d $LIB_D/img ] || mkdir -p $LIB_D/img
+ [ -n "$RRD_F" ] || /usr/bin/rrd.sh init
+ [ -x $CGI_S ] || /usr/bin/rrd.sh cgi
+ rrdcollect
+ ;;
+stop)
+ killall rrdcollect
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/rrdcollect/ipkg/rrdcollect-example.conffiles b/package/rrdcollect/ipkg/rrdcollect-example.conffiles
new file mode 100644
index 000000000..9e9a33a22
--- /dev/null
+++ b/package/rrdcollect/ipkg/rrdcollect-example.conffiles
@@ -0,0 +1,2 @@
+/etc/rrd.conf
+/etc/rrdcollect.conf
diff --git a/package/rrdcollect/ipkg/rrdcollect-example.control b/package/rrdcollect/ipkg/rrdcollect-example.control
new file mode 100644
index 000000000..ab4c68e5a
--- /dev/null
+++ b/package/rrdcollect/ipkg/rrdcollect-example.control
@@ -0,0 +1,10 @@
+Package: rrdcollect-example
+Priority: optional
+Section: admin
+Depends: rrdcgi, rrdtool, rrdcollect
+Description: Example setup for Round-Robin Database (RRD) collecting daemon
+ RRDcollect is a daemon which polls certain files in /proc/
+ directory, gathering data and storing it inside RRDtool's
+ database files. Being written in C should be both fast
+ and resources-friendly. Supports both scanf(3)-style
+ pattern matches and perl compatible regular expressions.
diff --git a/package/rrdcollect/ipkg/rrdcollect.control b/package/rrdcollect/ipkg/rrdcollect.control
new file mode 100644
index 000000000..7ac79731d
--- /dev/null
+++ b/package/rrdcollect/ipkg/rrdcollect.control
@@ -0,0 +1,5 @@
+Package: rrdcollect
+Priority: optional
+Section: admin
+Depends: librrd
+Description: Round-Robin Database (RRD) collecting daemon
diff --git a/package/rrdcollect/ipkg/rrdcollect.postinst b/package/rrdcollect/ipkg/rrdcollect.postinst
new file mode 100644
index 000000000..760d20811
--- /dev/null
+++ b/package/rrdcollect/ipkg/rrdcollect.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf rrdcollect rrdcollect NO
diff --git a/package/rrdcollect/patches/rrdcollect-scan.patch b/package/rrdcollect/patches/rrdcollect-scan.patch
new file mode 100644
index 000000000..f47301ed1
--- /dev/null
+++ b/package/rrdcollect/patches/rrdcollect-scan.patch
@@ -0,0 +1,66 @@
+diff -ruN rrdcollect-0.2.3.orig/src/scan.c rrdcollect-0.2.3/src/scan.c
+--- rrdcollect-0.2.3.orig/src/scan.c 2005-01-20 18:42:17.000000000 +0100
++++ rrdcollect-0.2.3/src/scan.c 2006-01-22 00:51:52.000000000 +0100
+@@ -74,6 +74,11 @@
+ } while (isdigit(*fmt));
+ }
+
++ /* skip white spaces like scanf does */
++ if (strchr("difuoxX", *fmt))
++ while (isspace(*buf))
++ buf++;
++
+ /* FIXME: we should check afterward:
+ * if (start == buf || start == '-' && buf-start == 1)
+ * die("WTF??? zero-length number???");
+@@ -150,27 +155,22 @@
+ buf++, length--;
+ }
+
+- /* ignore if value not found */
+- if(value == 0)
+- return 0;
+-
+ if (!ignore)
+- counter[i++]->value = valuedup(value);
++ counter[i++]->value = strndup(start, buf - start);
+ break;
+
+ case 'c':
++ if (length < 0)
++ length = 1; // default length is 1
++
+ while (*buf && length > 0) {
+ buf++, length--;
+ }
+ if (length > 0)
+ return 2;
+
+- /* ignore if value not found */
+- if(value == 0)
+- return 0;
+-
+ if (!ignore)
+- counter[i++]->value = valuedup(value);
++ counter[i++]->value = strndup(start, buf - start);
+ break;
+
+
+@@ -192,7 +192,7 @@
+ case '\f':
+ case '\v':
+ /* don't match if not at least one space */
+- if(!isspace(*(buf)))
++ if(!isspace(*buf))
+ return 0;
+ else
+ buf++;
+@@ -208,7 +208,7 @@
+ case '\v':
+ break;
+ default:
+- while (isspace(*(buf)))
++ while (isspace(*buf))
+ buf++;
+ }
+ fmt++;
diff --git a/package/rrdtool/Config.in b/package/rrdtool/Config.in
new file mode 100644
index 000000000..993044b3a
--- /dev/null
+++ b/package/rrdtool/Config.in
@@ -0,0 +1,66 @@
+config ADK_COMPILE_RRDTOOL
+ bool
+ default n
+
+config ADK_PACKAGE_LIBRRD
+ prompt "librrd............................ Round Robin Database (RRD) management library (v1.2.x)"
+ tristate
+ default n
+ select ADK_COMPILE_RRDTOOL
+ select ADK_PACKAGE_LIBART
+ select ADK_PACKAGE_LIBFREETYPE
+ select ADK_PACKAGE_LIBPNG
+ select ADK_PACKAGE_LIBXML2
+ select ADK_PACKAGE_ZLIB
+ help
+ RRD is the Acronym for Round Robin Database. RRD is a system to store and
+ display time-series data (i.e. network bandwidth, machine-room temperature,
+ server load average). It stores the data in a very compact way that will
+ not expand over time, and it presents useful graphs by processing the data
+ to enforce a certain data density. It can be used either via simple wrapper
+ scripts (from shell or Perl) or via frontends that poll network devices and
+ put friendly user interface on it.
+
+ http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
+
+ This package contains command line tools used to manage RRDs.
+
+config ADK_PACKAGE_RRDCGI
+ prompt "rrdcgi............................ Round Robin Database (RRD) CGI graphing tool (v1.2.x)"
+ tristate
+ default n
+ select ADK_COMPILE_RRDTOOL
+ select ADK_PACKAGE_LIBRRD
+ select ADK_PACKAGE_CGILIB
+ help
+ RRD is the Acronym for Round Robin Database. RRD is a system to store and
+ display time-series data (i.e. network bandwidth, machine-room temperature,
+ server load average). It stores the data in a very compact way that will
+ not expand over time, and it presents useful graphs by processing the data
+ to enforce a certain data density. It can be used either via simple wrapper
+ scripts (from shell or Perl) or via frontends that poll network devices and
+ put friendly user interface on it.
+
+ http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
+
+ This package contains the rrdcgi tool used to create web pages containing
+ RRD graphs based on templates.
+
+config ADK_PACKAGE_RRDTOOL
+ prompt "rrdtool........................... Round Robin Database (RRD) management tools (v1.2.x)"
+ tristate
+ default n
+ select ADK_COMPILE_RRDTOOL
+ select ADK_PACKAGE_LIBRRD
+ help
+ RRD is the Acronym for Round Robin Database. RRD is a system to store and
+ display time-series data (i.e. network bandwidth, machine-room temperature,
+ server load average). It stores the data in a very compact way that will
+ not expand over time, and it presents useful graphs by processing the data
+ to enforce a certain data density. It can be used either via simple wrapper
+ scripts (from shell or Perl) or via frontends that poll network devices and
+ put friendly user interface on it.
+
+ http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
+
+ This package contains command line tools used to manage RRDs.
diff --git a/package/rrdtool/Makefile b/package/rrdtool/Makefile
new file mode 100644
index 000000000..ba9edbe72
--- /dev/null
+++ b/package/rrdtool/Makefile
@@ -0,0 +1,46 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= rrdtool
+PKG_VERSION:= 1.2.30
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 19b24f7184a8dbf7b48c1bbb565ad9fb
+MASTER_SITES:= http://oss.oetiker.ch/rrdtool/pub/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBRRD,librrd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,RRDCGI,rrdcgi,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,RRDTOOL,rrdtool,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= rd_cv_ieee_works=yes
+CONFIGURE_ARGS+= --enable-rrdcgi \
+ --disable-mmap \
+ --disable-perl \
+ --disable-ruby \
+ --disable-tcl \
+ --disable-python \
+ --without-x \
+ --with-rrd-default-font=/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf
+TCPPFLAGS+= -I${STAGING_DIR}/usr/include/freetype2
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_RRDTOOL}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/rrdtool ${WRKINST}/usr/bin/rrdupdate \
+ ${IDIR_RRDTOOL}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_RRDCGI}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/rrdcgi ${IDIR_RRDCGI}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_LIBRRD}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/librrd.so.* ${IDIR_LIBRRD}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_LIBRRD}/usr/share/rrdtool/fonts
+ ${CP} ${WRKBUILD}/src/DejaVuSansMono-Roman.ttf \
+ ${IDIR_LIBRRD}/usr/share/rrdtool/fonts/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rrdtool/ipkg/librrd.control b/package/rrdtool/ipkg/librrd.control
new file mode 100644
index 000000000..fe34716ba
--- /dev/null
+++ b/package/rrdtool/ipkg/librrd.control
@@ -0,0 +1,14 @@
+Package: librrd
+Priority: optional
+Section: libs
+Depends: libart, libfreetype, libpng, zlib
+Description: Round Robin Database (RRD) management library.
+ RRD is the Acronym for Round Robin Database. RRD is a system to store and
+ display time-series data (i.e. network bandwidth, machine-room temperature,
+ server load average). It stores the data in a very compact way that will
+ not expand over time, and it presents useful graphs by processing the data
+ to enforce a certain data density. It can be used either via simple wrapper
+ scripts (from shell or Perl) or via frontends that poll network devices and
+ put friendly user interface on it.
+ .
+ This package contains the shared library used to manage RRDs.
diff --git a/package/rrdtool/ipkg/rrdcgi.control b/package/rrdtool/ipkg/rrdcgi.control
new file mode 100644
index 000000000..ca0f7cacd
--- /dev/null
+++ b/package/rrdtool/ipkg/rrdcgi.control
@@ -0,0 +1,15 @@
+Package: rrdcgi
+Priority: optional
+Section: web
+Depends: cgilib, librrd
+Description: Round Robin Database (RRD) CGI graphing tool.
+ RRD is the Acronym for Round Robin Database. RRD is a system to store and
+ display time-series data (i.e. network bandwidth, machine-room temperature,
+ server load average). It stores the data in a very compact way that will
+ not expand over time, and it presents useful graphs by processing the data
+ to enforce a certain data density. It can be used either via simple wrapper
+ scripts (from shell or Perl) or via frontends that poll network devices and
+ put friendly user interface on it.
+ .
+ This package contains the rrdcgi tool used to create web pages containing
+ RRD graphs based on templates.
diff --git a/package/rrdtool/ipkg/rrdtool.control b/package/rrdtool/ipkg/rrdtool.control
new file mode 100644
index 000000000..6e273331b
--- /dev/null
+++ b/package/rrdtool/ipkg/rrdtool.control
@@ -0,0 +1,14 @@
+Package: rrdtool
+Priority: optional
+Section: admin
+Depends: librrd
+Description: Round Robin Database (RRD) management tools.
+ RRD is the Acronym for Round Robin Database. RRD is a system to store and
+ display time-series data (i.e. network bandwidth, machine-room temperature,
+ server load average). It stores the data in a very compact way that will
+ not expand over time, and it presents useful graphs by processing the data
+ to enforce a certain data density. It can be used either via simple wrapper
+ scripts (from shell or Perl) or via frontends that poll network devices and
+ put friendly user interface on it.
+ .
+ This package contains command line tools used to manage RRDs.
diff --git a/package/rrdtool/patches/patch-configure b/package/rrdtool/patches/patch-configure
new file mode 100644
index 000000000..852d96098
--- /dev/null
+++ b/package/rrdtool/patches/patch-configure
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- rrdtool-1.2.30.orig/configure 2009-01-19 15:29:29.000000000 +0100
++++ rrdtool-1.2.30/configure 2009-05-09 04:31:25.000000000 +0200
+@@ -26320,7 +26320,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ ex_check_save_CPPFLAGS=${CPPFLAGS}
+ ex_check_save_LDFLAGS=${LDFLAGS}
+ if test "x/usr/include/libart-2.0" != "x"; then
+- CPPFLAGS="$CPPFLAGS -I/usr/include/libart-2.0"
++ CPPFLAGS="$CPPFLAGS"
+ fi
+ { echo "$as_me:$LINENO: checking for art_vpath_add_point in -lart_lgpl_2" >&5
+ echo $ECHO_N "checking for art_vpath_add_point in -lart_lgpl_2... $ECHO_C" >&6; }
+@@ -27916,7 +27916,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ ex_check_save_CPPFLAGS=${CPPFLAGS}
+ ex_check_save_LDFLAGS=${LDFLAGS}
+ if test "x/usr/include/freetype2" != "x"; then
+- CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2"
++ CPPFLAGS="$CPPFLAGS"
+ fi
+ { echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
+ echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
diff --git a/package/rrs/Config.in b/package/rrs/Config.in
new file mode 100644
index 000000000..6fe48d0fd
--- /dev/null
+++ b/package/rrs/Config.in
@@ -0,0 +1,48 @@
+config ADK_COMPILE_RRS
+ tristate
+ default n
+ depends ADK_PACKAGE_RRS || ADK_PACKAGE_RRS_NOSSL
+
+config ADK_PACKAGE_RRS
+ prompt "rrs............................... A reverse (connecting) remote shell, with SSL support"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_COMPILE_RRS
+ select ADK_PACKAGE_ZLIB
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ A reverse (connecting) remote shell, built with SSL support.
+
+ http://www.cycom.se/dl/rrs/
+
+config ADK_PACKAGE_RRS_NOSSL
+ prompt "rrs-nossl......................... A reverse (connecting) remote shell, without SSL support"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_COMPILE_RRS
+ select ADK_PACKAGE_ZLIB
+ help
+ A reverse (connecting) remote shell, built without SSL support.
+
+ http://www.cycom.se/dl/rrs/
+
+choice
+prompt "C++ library to use"
+depends on ADK_PACKAGE_RRS
+default ADK_COMPILE_RRS_WITH_STDCXX if ADK_TARGET_LIB_GLIBC
+default ADK_COMPILE_RRS_WITH_UCLIBCXX if ADK_TARGET_LIB_UCLIBC
+
+config ADK_COMPILE_RRS_WITH_STDCXX
+ bool "Standard C++ library"
+ select ADK_PACKAGE_LIBSTDCXX
+ help
+
+config ADK_COMPILE_RRS_WITH_UCLIBCXX
+ bool "Embedded uClibc++ library"
+ select ADK_PACKAGE_UCLIBCXX
+ help
+
+endchoice
+
diff --git a/package/rrs/Makefile b/package/rrs/Makefile
new file mode 100644
index 000000000..283ca4ccd
--- /dev/null
+++ b/package/rrs/Makefile
@@ -0,0 +1,67 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= rrs
+PKG_VERSION:= 1.70
+PKG_RELEASE:= 2
+PKG_MD5SUM:= b400d03c0e39e3e78a7327ba78f789f0
+MASTER_SITES:= http://www.cycom.se/uploads/36/19/
+PKG_DEPEND:= libopenssl zlib
+PKG_DEPEND_NOSSL:= zlib
+ifeq ($(ADK_COMPILE_RRS_WITH_UCLIBCXX),y)
+PKG_DEPEND+= uclibc++
+PKG_DEPEND_NOSSL+= uclibc++
+else
+PKG_DEPEND+= libstdcxx
+PKG_DEPEND_NOSSL+= libstdcxx
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RRS,rrs,${PKG_VERSION}-${PKG_RELEASE},${ARCH},${PKG_DEPEND}))
+$(eval $(call PKG_template,RRS_NOSSL,rrs-nossl,${PKG_VERSION}-${PKG_RELEASE},${ARCH},${PKG_DEPEND_NOSSL}))
+
+ifeq ($(ADK_COMPILE_RRS_WITH_UCLIBCXX),y)
+PKG_CFLAGS=-fno-builtin -fno-rtti -nostdinc++
+PKG_LDFLAGS=-nodefaultlibs -luClibc++ -lc -lm
+else
+PKG_CFLAGS=
+PKG_LDFLAGS=-shared
+endif
+
+
+do-configure:
+ifneq (${ADK_PACKAGE_RRS},)
+ ${MAKE} -C ${WRKBUILD} \
+ CC="${TARGET_CC}" \
+ CFLAGS="${TARGET_CFLAGS} -I${STAGING_DIR}/usr/include ${PKG_FLAGS}" \
+ LDFLAGS="-L${STAGING_DIR}/usr/lib -L${STAGING_DIR}/lib ${PKG_LDFLAGS} -lutil -lssl -lcrypto -lz" \
+ generic
+ { cd ${WRKBUILD}; mv rrs rrs-ssl; }
+ -${MAKE} -C ${WRKBUILD} \
+ clean
+endif
+ifneq (${ADK_PACKAGE_RRS_NOSSL},)
+ ${MAKE} -C ${WRKBUILD} \
+ CC="${TARGET_CC}" \
+ CFLAGS="${TARGET_CFLAGS} -I${STAGING_DIR}/usr/include ${PKG_FLAGS}" \
+ LDFLAGSNOSSL="-L${STAGING_DIR}/usr/lib -L${STAGING_DIR}/lib ${PKG_LDFLAGS} -lutil" \
+ generic-nossl
+ { cd ${WRKBUILD}; mv rrs rrs-nossl; }
+endif
+
+do-install:
+ifneq (${ADK_PACKAGE_RRS},)
+ ${INSTALL_DIR} ${IDIR_RRS}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/rrs-ssl ${IDIR_RRS}/usr/bin/rrs
+endif
+ifneq (${ADK_PACKAGE_RRS_NOSSL},)
+ ${INSTALL_DIR} ${IDIR_RRS_NOSSL}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/rrs-nossl ${IDIR_RRS_NOSSL}/usr/bin/rrs
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rrs/ipkg/rrs-nossl.control b/package/rrs/ipkg/rrs-nossl.control
new file mode 100644
index 000000000..a61cd7049
--- /dev/null
+++ b/package/rrs/ipkg/rrs-nossl.control
@@ -0,0 +1,5 @@
+Package: rrs-nossl
+Priority: optional
+Section: net
+Description: A reverse (connecting) remote shell, without SSL support.
+
diff --git a/package/rrs/ipkg/rrs.control b/package/rrs/ipkg/rrs.control
new file mode 100644
index 000000000..2652d7603
--- /dev/null
+++ b/package/rrs/ipkg/rrs.control
@@ -0,0 +1,5 @@
+Package: rrs
+Priority: optional
+Section: net
+Description: A reverse (connecting) remote shell, with SSL support.
+
diff --git a/package/rrs/patches/rrs-1.70-shell.patch b/package/rrs/patches/rrs-1.70-shell.patch
new file mode 100644
index 000000000..822ce7c18
--- /dev/null
+++ b/package/rrs/patches/rrs-1.70-shell.patch
@@ -0,0 +1,12 @@
+diff -ruN rrs-1.70-old/rrs.c rrs-1.70-new/rrs.c
+--- rrs-1.70-old/rrs.c 2004-05-30 02:32:03.000000000 +0200
++++ rrs-1.70-new/rrs.c 2005-10-12 12:41:24.000000000 +0200
+@@ -920,7 +920,7 @@
+ close(slave_fd);
+ signal(SIGHUP, SIG_DFL);
+ signal(SIGCHLD, SIG_DFL);
+- execl("/bin/sh", "", NULL);
++ execl("/bin/sh", "/bin/sh", NULL);
+ /* should not return */
+ exit(1);
+ } else if (pid > 0) {
diff --git a/package/rsync/Config.in b/package/rsync/Config.in
new file mode 100644
index 000000000..031c93076
--- /dev/null
+++ b/package/rsync/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_RSYNC
+ prompt "rsync............................. file transfer utility"
+ tristate
+ select ADK_PACKAGE_LIBPOPT
+ default n
+ help
+ An utility that provides fast incremental file transfer
+
+ http://rsync.samba.org
+
diff --git a/package/rsync/Makefile b/package/rsync/Makefile
new file mode 100644
index 000000000..075c8bb67
--- /dev/null
+++ b/package/rsync/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= rsync
+PKG_VERSION:= 3.0.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e9865d093a18e4668b9d31b635dc8e99
+MASTER_SITES:= http://rsync.samba.org/ftp/rsync/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RSYNC,rsync,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_RSYNC}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_RSYNC}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rsync/ipkg/rsync.control b/package/rsync/ipkg/rsync.control
new file mode 100644
index 000000000..5cfa16dc8
--- /dev/null
+++ b/package/rsync/ipkg/rsync.control
@@ -0,0 +1,5 @@
+Package: rsync
+Priority: optional
+Section: net
+Depends: libpopt
+Description: utility that provides fast incremental file transfer
diff --git a/package/rtorrent/Config.in b/package/rtorrent/Config.in
new file mode 100644
index 000000000..b46b395ef
--- /dev/null
+++ b/package/rtorrent/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_RTORRENT
+ prompt "rtorrent........................... file transfer utility"
+ tristate
+ depends on ADK_CXX
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBTORRENT
+ select ADK_PACKAGE_LIBCURL
+ default n
+ help
+ http://rsync.samba.org
+
diff --git a/package/rtorrent/Makefile b/package/rtorrent/Makefile
new file mode 100644
index 000000000..215c99408
--- /dev/null
+++ b/package/rtorrent/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= rtorrent
+PKG_VERSION:= 0.8.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a2456182e1767e5aed7341dbbd058f60
+MASTER_SITES:= http://libtorrent.rakshasa.no/downloads/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RTORRENT,rtorrent,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= autotool gnu
+CONFIGURE_ARGS+= --enable-aligned
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_RTORRENT}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_RTORRENT}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/rtorrent/ipkg/rtorrent.control b/package/rtorrent/ipkg/rtorrent.control
new file mode 100644
index 000000000..c5da288ec
--- /dev/null
+++ b/package/rtorrent/ipkg/rtorrent.control
@@ -0,0 +1,5 @@
+Package: rtorrent
+Priority: optional
+Section: net
+Depends: libncurses, libtorrent, libcurl
+Description: console torrent application
diff --git a/package/rtorrent/patches/patch-configure_ac b/package/rtorrent/patches/patch-configure_ac
new file mode 100644
index 000000000..a0252588f
--- /dev/null
+++ b/package/rtorrent/patches/patch-configure_ac
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- rtorrent-0.8.2.orig/configure.ac 2008-05-07 14:19:12.000000000 +0200
++++ rtorrent-0.8.2/configure.ac 2008-12-14 22:11:22.000000000 +0100
+@@ -15,7 +15,6 @@ TORRENT_DISABLE_IPV6
+
+ AC_SYS_LARGEFILE
+
+-TORRENT_CHECK_EXECINFO()
+ TORRENT_OTFD()
+
+ TORRENT_ENABLE_ARCH
diff --git a/package/rtorrent/patches/patch-rak_functional_h b/package/rtorrent/patches/patch-rak_functional_h
new file mode 100644
index 000000000..aec145664
--- /dev/null
+++ b/package/rtorrent/patches/patch-rak_functional_h
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- rtorrent-0.8.2.orig/rak/functional.h 2008-05-07 14:19:12.000000000 +0200
++++ rtorrent-0.8.2/rak/functional.h 2008-12-14 22:51:25.000000000 +0100
+@@ -37,6 +37,8 @@
+ #ifndef RAK_FUNCTIONAL_H
+ #define RAK_FUNCTIONAL_H
+
++#include <cstdlib>
++
+ #include <functional>
+
+ namespace rak {
diff --git a/package/rtorrent/patches/patch-src_command_ui_cc b/package/rtorrent/patches/patch-src_command_ui_cc
new file mode 100644
index 000000000..0383d929d
--- /dev/null
+++ b/package/rtorrent/patches/patch-src_command_ui_cc
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- rtorrent-0.8.2.orig/src/command_ui.cc 2008-05-07 14:19:11.000000000 +0200
++++ rtorrent-0.8.2/src/command_ui.cc 2008-12-14 22:56:02.000000000 +0100
+@@ -36,6 +36,8 @@
+
+ #include "config.h"
+
++#include <ctime>
++
+ #include <rak/functional.h>
+ #include <rak/functional_fun.h>
+ #include <sigc++/adaptors/bind.h>
diff --git a/package/rtorrent/patches/patch-src_display_text_element_value_cc b/package/rtorrent/patches/patch-src_display_text_element_value_cc
new file mode 100644
index 000000000..01391f812
--- /dev/null
+++ b/package/rtorrent/patches/patch-src_display_text_element_value_cc
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- rtorrent-0.8.2.orig/src/display/text_element_value.cc 2008-05-07 14:19:11.000000000 +0200
++++ rtorrent-0.8.2/src/display/text_element_value.cc 2008-12-14 22:14:58.000000000 +0100
+@@ -39,6 +39,8 @@
+ #include "globals.h"
+ #include "text_element_value.h"
+
++#include <ctime>
++
+ namespace display {
+
+ // Should be in text_element.cc.
diff --git a/package/rtorrent/patches/patch-src_rpc_parse_cc b/package/rtorrent/patches/patch-src_rpc_parse_cc
new file mode 100644
index 000000000..a84b30475
--- /dev/null
+++ b/package/rtorrent/patches/patch-src_rpc_parse_cc
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- rtorrent-0.8.2.orig/src/rpc/parse.cc 2008-05-07 14:19:10.000000000 +0200
++++ rtorrent-0.8.2/src/rpc/parse.cc 2008-12-14 22:49:04.000000000 +0100
+@@ -37,6 +37,7 @@
+ #include "config.h"
+
+ #include <locale>
++#include <cstring>
+ #include <rak/path.h>
+ #include <torrent/exceptions.h>
+
diff --git a/package/ruby/Config.in b/package/ruby/Config.in
new file mode 100644
index 000000000..5fd97df7f
--- /dev/null
+++ b/package/ruby/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_RUBY
+ prompt "ruby.............................. Asian Object-Oriented scripting language"
+ tristate
+ default n
+ help
+ Ruby1.8 is the interpreter for the ruby language.
+
diff --git a/package/ruby/Makefile b/package/ruby/Makefile
new file mode 100644
index 000000000..f3dcde488
--- /dev/null
+++ b/package/ruby/Makefile
@@ -0,0 +1,38 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+# == Doc
+# * http://wiki.rubygarden.org/Ruby/page/show/RubyOnUCLinux
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ruby
+PKG_VERSION:= 1.8.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= de906850f9a012c12ffc6e9f56fb1b66
+MASTER_SITES:= http://ftp.ruby-lang.org/pub/ruby/stable/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,RUBY,ruby,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_setpgrp_void=yes
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+# Enable some ruby extension / options
+post-configure:
+ echo "option nodynamic" >> ${WRKBUILD}/ext/Setup
+ echo "socket" >> ${WRKBUILD}/ext/Setup
+
+# Remove the /usr/lib/libruby.so and keep the static (~1M) ?
+post-install:
+ rm -rf ${WRKINST}/usr/lib/site_ruby
+ find ${WRKINST}/usr -name "*.h" -delete
+ cp -a ${WRKINST}/usr ${IDIR_RUBY}
+
+include ${TOPDIR}/mk/pkg-bottom.mk
+
diff --git a/package/ruby/ipkg/ruby.control b/package/ruby/ipkg/ruby.control
new file mode 100644
index 000000000..090143e3d
--- /dev/null
+++ b/package/ruby/ipkg/ruby.control
@@ -0,0 +1,4 @@
+Package: ruby
+Priority: optional
+Section: admin
+Description: Ruby1.8 is the interpreter for the ruby language.
diff --git a/package/ruby/patches/100-makefile-in.patch b/package/ruby/patches/100-makefile-in.patch
new file mode 100644
index 000000000..ecfb49ed8
--- /dev/null
+++ b/package/ruby/patches/100-makefile-in.patch
@@ -0,0 +1,11 @@
+--- ruby-1.8.6.orig/Makefile.in 2007-02-13 00:01:19.000000000 +0100
++++ ruby-1.8.6/Makefile.in 2007-05-21 22:12:54.000000000 +0200
+@@ -131,7 +131,7 @@ fake.rb: Makefile
+ if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \
+ class File; \
+ remove_const :ALT_SEPARATOR; \
+- ALT_SEPARATOR = "\\"; \
++ ALT_SEPARATOR = "\\\\"; \
+ end; \
+ end; \
+ ' > $@
diff --git a/package/ruby/patches/patch-lib_fileutils_rb b/package/ruby/patches/patch-lib_fileutils_rb
new file mode 100644
index 000000000..767a389d9
--- /dev/null
+++ b/package/ruby/patches/patch-lib_fileutils_rb
@@ -0,0 +1,12 @@
+$Id$
+--- ruby-1.8.6.orig/lib/fileutils.rb 2007-03-04 16:03:11.000000000 +0100
++++ ruby-1.8.6/lib/fileutils.rb 2007-05-21 22:14:04.000000000 +0200
+@@ -1026,7 +1026,7 @@ module FileUtils
+ list.each do |path|
+ created = nocreate
+ begin
+- File.utime(t, t, path)
++ #File.utime(t, t, path)
+ rescue Errno::ENOENT
+ raise if created
+ File.open(path, 'a') {
diff --git a/package/samba/Config.in b/package/samba/Config.in
new file mode 100644
index 000000000..f548a5e2b
--- /dev/null
+++ b/package/samba/Config.in
@@ -0,0 +1,62 @@
+config ADK_COMPILE_SAMBA
+ tristate
+ default n
+ depends ADK_PACKAGE_SAMBA || ADK_PACKAGE_SAMBA_CLIENT || ADK_PACKAGE_SMBFS
+
+config ADK_PACKAGE_SAMBA
+ prompt "samba............................. NetBIOS/SMB file and print server"
+ tristate
+ default n
+ select ADK_COMPILE_SAMBA
+ select ADK_PACKAGE_LIBPOPT
+ help
+ The Samba software suite is a collection of programs that implements the
+ SMB protocol for unix systems, allowing you to serve files and printers to
+ Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred
+ to as the LanManager or Netbios protocol.
+
+ http://www.samba.org/
+
+ This package contains the SMB file and print server daemons.
+
+config ADK_SAMBA_CODEPAGE
+ string "legacy codepage"
+ default "ISO8859-1"
+ depends on ADK_PACKAGE_SAMBA
+ help
+ which codepage should be added to package
+ choose one of:
+ 1125 1251 437 737 775 850 852 857 861 866 932 936 949 950
+ ISO8859-1 ISO8859-13 ISO8859-15 ISO8859-2 ISO8859-5 ISO8859-7
+ ISO8859-9 KOI8-R KOI8-U
+
+config ADK_PACKAGE_SAMBA_CLIENT
+ prompt "samba-client...................... NetBIOS/SMB simple client"
+ tristate
+ default n
+ select ADK_COMPILE_SAMBA
+ help
+ The Samba software suite is a collection of programs that implements the
+ SMB protocol for unix systems, allowing you to serve files and printers to
+ Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred
+ to as the LanManager or Netbios protocol.
+
+ http://www.samba.org/
+
+ This package contains a simple command-line SMB client.
+
+config ADK_PACKAGE_SAMBA_PASSWD
+ prompt "samba-passwd...................... samba password utility"
+ tristate
+ default n
+ select ADK_COMPILE_SAMBA
+ help
+ The Samba software suite is a collection of programs that implements the
+ SMB protocol for unix systems, allowing you to serve files and printers to
+ Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred
+ to as the LanManager or Netbios protocol.
+
+ http://www.samba.org/
+
+ This package contains a the samba password utility.
+
diff --git a/package/samba/Makefile b/package/samba/Makefile
new file mode 100644
index 000000000..11be3043a
--- /dev/null
+++ b/package/samba/Makefile
@@ -0,0 +1,69 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= samba
+PKG_VERSION:= 3.3.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1443165edb7cb3f56f1e77aec1ee3266
+MASTER_SITES:= ftp://se.samba.org/pub/samba/stable/ \
+ ftp://ftp.easynet.be/samba/stable/
+WRKSRC= ${WRKDIST}/source
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SAMBA,samba,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SAMBA_CLIENT,samba-client,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SAMBA_PASSWD,samba-passwd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+TLDFLAGS+= -Wl,-rpath -Wl,/usr/lib/samba
+CONFIGURE_ENV+= samba_cv_CC_NEGATIVE_ENUM_VALUES=no \
+ samba_cv_USE_SETRESUID=no
+ifeq ($(ADK_IPV6),y)
+CONFIGURE_ENV+= libreplace_cv_HAVE_IPV6=yes
+else
+CONFIGURE_ENV+= libreplace_cv_HAVE_IPV6=no
+endif
+CONFIGURE_ARGS+= --libdir=/usr/lib/samba \
+ --localstatedir=/var/log/samba \
+ --with-configdir=/etc/samba \
+ --with-lockdir=/var/run/samba \
+ --with-privatedir=/etc/samba \
+ --with-libiconv=/dev/null \
+ --with-syslog \
+ --without-winbind \
+ --disable-cups \
+ --disable-swat \
+ --disable-avahi \
+ --with-utmp=no \
+ --with-ldap=no \
+ --without-cluster-support \
+ --without-sendfile-support
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SAMBA}/etc/{init.d,samba}
+ ${INSTALL_DIR} ${IDIR_SAMBA}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_SAMBA}/usr/lib/samba
+ ${INSTALL_DIR} ${IDIR_SAMBA}/usr/lib/samba/{charset,vfs}
+ ${INSTALL_DATA} ${WRKINST}/usr/lib/samba/charset/CP850.so \
+ ${IDIR_SAMBA}/usr/lib/samba/charset
+ ${INSTALL_DATA} ./files/samba.init ${IDIR_SAMBA}/etc/init.d/samba
+ ${INSTALL_DATA} ./files/smb.conf ${IDIR_SAMBA}/etc/samba/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/{nmbd,smbd} ${IDIR_SAMBA}/usr/sbin
+ ${CP} ${WRKINST}/usr/lib/samba/*.so* ${IDIR_SAMBA}/usr/lib/samba
+ ${CP} ${WRKINST}/usr/lib/samba/vfs/*.so* ${IDIR_SAMBA}/usr/lib/samba/vfs
+ ${INSTALL_DATA} ${WRKINST}/usr/lib/samba/*.dat ${IDIR_SAMBA}/usr/lib/samba
+ ${INSTALL_DIR} ${IDIR_SAMBA_PASSWD}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/smbpasswd \
+ ${IDIR_SAMBA_PASSWD}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_SAMBA_CLIENT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/smbclient \
+ ${IDIR_SAMBA_CLIENT}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/samba/files/samba.init b/package/samba/files/samba.init
new file mode 100644
index 000000000..94080f31a
--- /dev/null
+++ b/package/samba/files/samba.init
@@ -0,0 +1,29 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"$samba" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/run/samba ] || mkdir -p /var/run/samba
+ [ -d /var/log/samba ] || mkdir -p /var/log/samba
+ nmbd -D
+ smbd -D
+ ;;
+stop)
+ killall nmbd
+ killall smbd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/samba/files/smb.conf b/package/samba/files/smb.conf
new file mode 100644
index 000000000..1355c4fb5
--- /dev/null
+++ b/package/samba/files/smb.conf
@@ -0,0 +1,17 @@
+[global]
+ syslog = 1
+ syslog only = yes
+ workgroup = OpenADK
+ server string = OpenADK Samba Server
+ security = share
+ encrypt passwords = yes
+ guest account = root
+ local master = yes
+ name resolve order = hosts bcast
+ pid directory = /var/run/samba
+ load printers = no
+ printcap name = /dev/null
+ unix charset = ASCII
+ dos charset = ASCII
+ display charset = ASCII
+ unix extensions = yes
diff --git a/package/samba/ipkg/samba-client.control b/package/samba/ipkg/samba-client.control
new file mode 100644
index 000000000..dcfe292b3
--- /dev/null
+++ b/package/samba/ipkg/samba-client.control
@@ -0,0 +1,4 @@
+Package: samba-client
+Priority: optional
+Section: net
+Description: NetBIOS/SMB client
diff --git a/package/samba/ipkg/samba-passwd.control b/package/samba/ipkg/samba-passwd.control
new file mode 100644
index 000000000..2cba0a83e
--- /dev/null
+++ b/package/samba/ipkg/samba-passwd.control
@@ -0,0 +1,4 @@
+Package: samba-passwd
+Priority: optional
+Section: net
+Description: samba password utility
diff --git a/package/samba/ipkg/samba.conffiles b/package/samba/ipkg/samba.conffiles
new file mode 100644
index 000000000..5c10c50ad
--- /dev/null
+++ b/package/samba/ipkg/samba.conffiles
@@ -0,0 +1 @@
+/etc/samba/smb.conf
diff --git a/package/samba/ipkg/samba.control b/package/samba/ipkg/samba.control
new file mode 100644
index 000000000..c1cf603c4
--- /dev/null
+++ b/package/samba/ipkg/samba.control
@@ -0,0 +1,5 @@
+Package: samba
+Priority: optional
+Section: net
+Depends: libgcc
+Description: NetBIOS/SMB file and print server
diff --git a/package/samba/ipkg/samba.postinst b/package/samba/ipkg/samba.postinst
new file mode 100644
index 000000000..b9f99e86b
--- /dev/null
+++ b/package/samba/ipkg/samba.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf samba samba NO
diff --git a/package/samba/ipkg/swat.control b/package/samba/ipkg/swat.control
new file mode 100644
index 000000000..318941467
--- /dev/null
+++ b/package/samba/ipkg/swat.control
@@ -0,0 +1,5 @@
+Package: swat
+Priority: optional
+Section: net
+Depends: samba
+Description: NetBIOS/SMB file and print server
diff --git a/package/samba/ipkg/swat.postinst b/package/samba/ipkg/swat.postinst
new file mode 100644
index 000000000..85c2d226e
--- /dev/null
+++ b/package/samba/ipkg/swat.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_service swat 901/tcp
+grep -qe '^swat ' -e '^#swat ' $IPKG_INSTROOT/etc/inetd.conf 2>&- || \
+ echo '#swat stream tcp nowait.400 root /usr/bin/swat swat' \
+ >>$IPKG_INSTROOT/etc/inetd.conf
diff --git a/package/samba/patches/patch-source_client_mtab_c b/package/samba/patches/patch-source_client_mtab_c
new file mode 100644
index 000000000..7dedcd065
--- /dev/null
+++ b/package/samba/patches/patch-source_client_mtab_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- samba-3.3.3.orig/source/client/mtab.c 2009-04-01 13:48:54.000000000 +0200
++++ samba-3.3.3/source/client/mtab.c 2009-04-18 23:27:50.522604765 +0200
+@@ -32,6 +32,7 @@
+ #include <errno.h>
+ #include <stdio.h>
+ #include <sys/time.h>
++#include <sys/stat.h>
+ #include <time.h>
+ #include <fcntl.h>
+ #include <mntent.h>
diff --git a/package/samba/patches/patch-source_configure b/package/samba/patches/patch-source_configure
new file mode 100644
index 000000000..c41ed21e7
--- /dev/null
+++ b/package/samba/patches/patch-source_configure
@@ -0,0 +1,198 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- samba-3.3.3.orig/source/configure 2009-04-01 14:19:36.000000000 +0200
++++ samba-3.3.3/source/configure 2009-04-18 22:56:27.047962181 +0200
+@@ -44062,194 +44062,6 @@ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ #
+-#
+-#
+-case "$host_os" in
+- *linux*)
+- # glibc <= 2.3.2 has a broken getgrouplist
+- if test "$cross_compiling" = yes; then
+- { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&5
+-$as_echo "$as_me: error: cannot run test program while cross compiling
+-See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }; }
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#include <unistd.h>
+-#include <sys/utsname.h>
+-main() {
+- /* glibc up to 2.3 has a broken getgrouplist */
+-#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+- int libc_major = __GLIBC__;
+- int libc_minor = __GLIBC_MINOR__;
+-
+- if (libc_major < 2)
+- exit(1);
+- if ((libc_major == 2) && (libc_minor <= 3))
+- exit(1);
+-#endif
+- exit(0);
+-}
+-
+-_ACEOF
+-rm -f 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_try") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- linux_getgrouplist_ok=yes
+-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
+-
+-( exit $ac_status )
+-linux_getgrouplist_ok=no
+-fi
+-rm -rf conftest.dSYM
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+-
+- if test x"$linux_getgrouplist_ok" = x"yes"; then
+-
+-cat >>confdefs.h <<\_ACEOF
+-#define HAVE_GETGROUPLIST 1
+-_ACEOF
+-
+- fi
+- ;;
+- *)
+-
+-for ac_func in getgrouplist
+-do
+-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+-$as_echo_n "checking for $ac_func... " >&6; }
+-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+- $as_echo_n "(cached) " >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+- For example, HP-UX 11i <limits.h> declares gettimeofday. */
+-#define $ac_func innocuous_$ac_func
+-
+-/* System header to define __stub macros and hopefully few prototypes,
+- which can conflict with char $ac_func (); 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 $ac_func
+-
+-/* 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 $ac_func ();
+-/* 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_$ac_func || defined __stub___$ac_func
+-choke me
+-#endif
+-
+-int
+-main ()
+-{
+-return $ac_func ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-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:$LINENO: $ac_try_echo\""
+-$as_echo "$ac_try_echo") >&5
+- (eval "$ac_link") 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && {
+- 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
+- eval "$as_ac_var=yes"
+-else
+- $as_echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+- eval "$as_ac_var=no"
+-fi
+-
+-rm -rf conftest.dSYM
+-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+- conftest$ac_exeext conftest.$ac_ext
+-fi
+-ac_res=`eval 'as_val=${'$as_ac_var'}
+- $as_echo "$as_val"'`
+- { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+-$as_echo "$ac_res" >&6; }
+-as_val=`eval 'as_val=${'$as_ac_var'}
+- $as_echo "$as_val"'`
+- 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
+-
+- ;;
+-esac
+-
+-#
+ # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
+ #
+
diff --git a/package/samba/patches/patch-source_registry_reg_perfcount_c b/package/samba/patches/patch-source_registry_reg_perfcount_c
new file mode 100644
index 000000000..a06b713d4
--- /dev/null
+++ b/package/samba/patches/patch-source_registry_reg_perfcount_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- samba-3.3.4.orig/source/registry/reg_perfcount.c 2009-04-28 08:46:16.000000000 +0200
++++ samba-3.3.4/source/registry/reg_perfcount.c 2009-05-10 23:52:42.000000000 +0200
+@@ -616,14 +616,14 @@ static bool _reg_perfcount_add_counter(P
+ obj = NULL;
+ memset(buf, 0, PERFCOUNT_MAX_LEN);
+ memcpy(buf, data.dptr, data.dsize);
+- begin = index(buf, '[');
+- end = index(buf, ']');
++ begin = strchr(buf, '[');
++ end = strchr(buf, ']');
+ if(begin == NULL || end == NULL)
+ return False;
+ start = begin+1;
+
+ while(start < end) {
+- stop = index(start, ',');
++ stop = strchr(start, ',');
+ if(stop == NULL)
+ stop = end;
+ *stop = '\0';
diff --git a/package/sane-backends/Config.in b/package/sane-backends/Config.in
new file mode 100644
index 000000000..dd0e2522f
--- /dev/null
+++ b/package/sane-backends/Config.in
@@ -0,0 +1,654 @@
+config ADK_PACKAGE_SANE_BACKENDS
+ prompt "sane-backends..................... Scanner Access Now Easy (backends)"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_NET
+ prompt "sane-backend-net................ network access to SANE servers"
+ tristate
+ default n
+ depends on ADK_PACKAGE_SANE_BACKENDS
+ help
+ Install this backend to export scanners over the network.
+
+config ADK_PACKAGE_SANE_BACKEND_ABATON
+ prompt "sane-backend-abaton............. Scanner Access Now Easy (ABATON)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_AGFAFOCUS
+ prompt "sane-backend-agfafocus.......... Scanner Access Now Easy (AGFAFOCUS)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_APPLE
+ prompt "sane-backend-apple.............. Scanner Access Now Easy (APPLE)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_ARTEC_EPLUS48U
+ prompt "sane-backend-artec-eplus48u..... Scanner Access Now Easy (ARTEC_EPLUS48U)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_ARTEC
+ prompt "sane-backend-artec.............. Scanner Access Now Easy (ARTEC)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_AS6E
+ prompt "sane-backend-as6e............... Scanner Access Now Easy (AS6E)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_AVISION
+ prompt "sane-backend-avision............ Scanner Access Now Easy (AVISION)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_BH
+ prompt "sane-backend-bh................. Scanner Access Now Easy (BH)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_CANON630U
+ prompt "sane-backend-canon630u.......... Scanner Access Now Easy (CANON630U)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_CANON
+ prompt "sane-backend-canon.............. Scanner Access Now Easy (CANON)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_COOLSCAN2
+ prompt "sane-backend-coolscan2.......... Scanner Access Now Easy (COOLSCAN2)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_COOLSCAN
+ prompt "sane-backend-coolscan........... Scanner Access Now Easy (COOLSCAN)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_DC25
+ prompt "sane-backend-dc25............... Scanner Access Now Easy (DC25)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_DMC
+ prompt "sane-backend-dmc................ Scanner Access Now Easy (DMC)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_EPSON
+ prompt "sane-backend-epson.............. Scanner Access Now Easy (EPSON)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_FUJITSU
+ prompt "sane-backend-fujitsu............ Scanner Access Now Easy (FUJITSU)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_GENESYS
+ prompt "sane-backend-genesys............ Scanner Access Now Easy (GENESYS)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_GT68XX
+ prompt "sane-backend-gt68xx............. Scanner Access Now Easy (GT68XX)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_HP3500
+ prompt "sane-backend-hp3500............. Scanner Access Now Easy (HP3500)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_HP4200
+ prompt "sane-backend-hp4200............. Scanner Access Now Easy (HP4200)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_HP5400
+ prompt "sane-backend-hp5400............. Scanner Access Now Easy (HP5400)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_HP
+ prompt "sane-backend-hp................. Scanner Access Now Easy (HP)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_IBM
+ prompt "sane-backend-ibm................ Scanner Access Now Easy (IBM)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_LEO
+ prompt "sane-backend-leo................ Scanner Access Now Easy (LEO)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_LEXMARK
+ prompt "sane-backend-lexmark............ Scanner Access Now Easy (LEXMARK)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_MA1509
+ prompt "sane-backend-ma1509............. Scanner Access Now Easy (MA1509)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_MATSUSHITA
+ prompt "sane-backend-matsushita......... Scanner Access Now Easy (MATSUSHITA)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_MICROTEK2
+ prompt "sane-backend-microtek2.......... Scanner Access Now Easy (MICROTEK2)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_MICROTEK
+ prompt "sane-backend-microtek........... Scanner Access Now Easy (MICROTEK)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_MUSTEK
+ prompt "sane-backend-mustek............. Scanner Access Now Easy (MUSTEK)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_MUSTEK_USB2
+ prompt "sane-backend-mustek-usb2........ Scanner Access Now Easy (MUSTEK_USB2)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_MUSTEK_USB
+ prompt "sane-backend-mustek-usb......... Scanner Access Now Easy (MUSTEK_USB)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_NEC
+ prompt "sane-backend-nec................ Scanner Access Now Easy (NEC)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_NIASH
+ prompt "sane-backend-niash.............. Scanner Access Now Easy (NIASH)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_PIE
+ prompt "sane-backend-pie................ Scanner Access Now Easy (PIE)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_PIXMA
+ prompt "sane-backend-pixma.............. Scanner Access Now Easy (PIXMA)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_PLUSTEK_PP
+ prompt "sane-backend-plustek-pp......... Scanner Access Now Easy (PLUSTEK_PP)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_PLUSTEK
+ prompt "sane-backend-plustek............ Scanner Access Now Easy (PLUSTEK)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_QCAM
+ prompt "sane-backend-qcam............... Scanner Access Now Easy (QCAM)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_RICOH
+ prompt "sane-backend-ricoh.............. Scanner Access Now Easy (RICOH)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_S9036
+ prompt "sane-backend-s9036.............. Scanner Access Now Easy (S9036)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_SCEPTRE
+ prompt "sane-backend-sceptre............ Scanner Access Now Easy (SCEPTRE)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_SHARP
+ prompt "sane-backend-sharp.............. Scanner Access Now Easy (SHARP)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_SM3600
+ prompt "sane-backend-sm3600............. Scanner Access Now Easy (SM3600)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_SM3840
+ prompt "sane-backend-sm3840............. Scanner Access Now Easy (SM3840)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_SNAPSCAN
+ prompt "sane-backend-snapscan........... Scanner Access Now Easy (SNAPSCAN)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_SP15C
+ prompt "sane-backend-sp15c.............. Scanner Access Now Easy (SP15C)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_ST400
+ prompt "sane-backend-st400.............. Scanner Access Now Easy (ST400)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_STV680
+ prompt "sane-backend-stv680............. Scanner Access Now Easy (STV680)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_TAMARACK
+ prompt "sane-backend-tamarack........... Scanner Access Now Easy (TAMARACK)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_TECO1
+ prompt "sane-backend-teco1.............. Scanner Access Now Easy (TECO1)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_TECO2
+ prompt "sane-backend-teco2.............. Scanner Access Now Easy (TECO2)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_TECO3
+ prompt "sane-backend-teco3.............. Scanner Access Now Easy (TECO3)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_TEST
+ prompt "sane-backend-test............... Scanner Access Now Easy (TEST)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_U12
+ prompt "sane-backend-u12................ Scanner Access Now Easy (U12)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_UMAX1220U
+ prompt "sane-backend-umax1220u.......... Scanner Access Now Easy (UMAX1220U)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_UMAX_PP
+ prompt "sane-backend-umax-pp............ Scanner Access Now Easy (UMAX_PP)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
+config ADK_PACKAGE_SANE_BACKEND_UMAX
+ prompt "sane-backend-umax............... Scanner Access Now Easy (UMAX)"
+ tristate
+ default n
+ depends ADK_PACKAGE_SANE_BACKENDS
+ select ADK_PACKAGE_LIBUSB
+ help
+ SANE (Scanner Access Now Easy) is a universal scanner interface.
+
+ http://www.sane-project.org
+
diff --git a/package/sane-backends/Makefile b/package/sane-backends/Makefile
new file mode 100644
index 000000000..cef662ee8
--- /dev/null
+++ b/package/sane-backends/Makefile
@@ -0,0 +1,170 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= sane-backends
+PKG_VERSION:= 1.0.20
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a0cfdfdebca2feb4f2ba5d3418b15a42
+MASTER_SITES:= ftp://ftp2.sane-project.org/pub/sane/${PKG_NAME}-${PKG_VERSION}/ \
+ ftp://ftp3.sane-project.org/pub/sane/${PKG_NAME}-${PKG_VERSION}/ \
+ ftp://ftp4.sane-project.org/pub/sane/${PKG_NAME}-${PKG_VERSION}/ \
+ ftp://ftp5.sane-project.org/pub/sane/${PKG_NAME}-${PKG_VERSION}/
+
+include ${TOPDIR}/mk/package.mk
+
+define PKG_mod_template
+
+INSTALL_MODS_$${ADK_PACKAGE_${1}}+= ${2}-install
+
+${2}-install:
+ifneq (${3},n)
+ ${INSTALL_DIR} $$(IDIR_$(1))/etc/sane.d
+ ${CP} $(WRKINST)/etc/sane.d/$(2).conf $$(IDIR_$(1))/etc/sane.d
+endif
+ ${INSTALL_DIR} $$(IDIR_$(1))/usr/lib/sane
+ ${CP} $(WRKINST)/usr/lib/sane/libsane-$(2).so* $$(IDIR_$(1))/usr/lib/sane
+
+endef
+
+$(eval $(call PKG_template,SANE_BACKENDS,sane-backends,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_NET,sane-backend-net,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_ABATON,sane-backend-abaton,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_AGFAFOCUS,sane-backend-agfafocus,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_APPLE,sane-backend-apple,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_ARTEC_EPLUS48U,sane-backend-artec-eplus48u,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_ARTEC,sane-backend-artec,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_AS6E,sane-backend-as6e,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_AVISION,sane-backend-avision,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_BH,sane-backend-bh,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_CANON630U,sane-backend-canon630u,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_CANON,sane-backend-canon,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_COOLSCAN2,sane-backend-coolscan2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_COOLSCAN,sane-backend-coolscan,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_DC25,sane-backend-dc25,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_DMC,sane-backend-dmc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_EPSON,sane-backend-epson,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_FUJITSU,sane-backend-fujitsu,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_GENESYS,sane-backend-genesys,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_GT68XX,sane-backend-gt68xx,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_HP3500,sane-backend-hp3500,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_HP4200,sane-backend-hp4200,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_HP5400,sane-backend-hp5400,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_HP,sane-backend-hp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_IBM,sane-backend-ibm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_LEO,sane-backend-leo,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_LEXMARK,sane-backend-lexmark,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_MA1509,sane-backend-ma1509,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_MATSUSHITA,sane-backend-matsushita,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_MICROTEK2,sane-backend-microtek2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_MICROTEK,sane-backend-microtek,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_MUSTEK,sane-backend-mustek,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_MUSTEK_USB2,sane-backend-mustek-usb2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_MUSTEK_USB,sane-backend-mustek-usb,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_NEC,sane-backend-nec,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_NIASH,sane-backend-niash,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_PIE,sane-backend-pie,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_PIXMA,sane-backend-pixma,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_PLUSTEK_PP,sane-backend-plustek-pp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_PLUSTEK,sane-backend-plustek,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_QCAM,sane-backend-qcam,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_RICOH,sane-backend-ricoh,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_S9036,sane-backend-s9036,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_SCEPTRE,sane-backend-sceptre,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_SHARP,sane-backend-sharp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_SM3600,sane-backend-sm3600,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_SM3840,sane-backend-sm3840,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_SNAPSCAN,sane-backend-snapscan,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_SP15C,sane-backend-sp15c,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_ST400,sane-backend-st400,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_STV680,sane-backend-stv680,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_TAMARACK,sane-backend-tamarack,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_TECO1,sane-backend-teco1,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_TECO2,sane-backend-teco2,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_TECO3,sane-backend-teco3,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_TEST,sane-backend-test,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_U12,sane-backend-u12,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_UMAX1220U,sane-backend-umax1220u,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_UMAX_PP,sane-backend-umax-pp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SANE_BACKEND_UMAX,sane-backend-umax,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+$(eval $(call PKG_mod_template,SANE_BACKEND_NET,net))
+$(eval $(call PKG_mod_template,SANE_BACKEND_ABATON,abaton))
+$(eval $(call PKG_mod_template,SANE_BACKEND_AGFAFOCUS,agfafocus))
+$(eval $(call PKG_mod_template,SANE_BACKEND_APPLE,apple))
+$(eval $(call PKG_mod_template,SANE_BACKEND_ARTEC_EPLUS48U,artec_eplus48u))
+$(eval $(call PKG_mod_template,SANE_BACKEND_ARTEC,artec))
+$(eval $(call PKG_mod_template,SANE_BACKEND_AS6E,as6e,n))
+$(eval $(call PKG_mod_template,SANE_BACKEND_AVISION,avision))
+$(eval $(call PKG_mod_template,SANE_BACKEND_BH,bh))
+$(eval $(call PKG_mod_template,SANE_BACKEND_CANON630U,canon630u))
+$(eval $(call PKG_mod_template,SANE_BACKEND_CANON,canon))
+$(eval $(call PKG_mod_template,SANE_BACKEND_COOLSCAN2,coolscan2))
+$(eval $(call PKG_mod_template,SANE_BACKEND_COOLSCAN,coolscan))
+$(eval $(call PKG_mod_template,SANE_BACKEND_DC25,dc25))
+$(eval $(call PKG_mod_template,SANE_BACKEND_DMC,dmc))
+$(eval $(call PKG_mod_template,SANE_BACKEND_EPSON,epson))
+$(eval $(call PKG_mod_template,SANE_BACKEND_FUJITSU,fujitsu))
+$(eval $(call PKG_mod_template,SANE_BACKEND_GENESYS,genesys))
+$(eval $(call PKG_mod_template,SANE_BACKEND_GT68XX,gt68xx))
+$(eval $(call PKG_mod_template,SANE_BACKEND_HP3500,hp3500,n))
+$(eval $(call PKG_mod_template,SANE_BACKEND_HP4200,hp4200))
+$(eval $(call PKG_mod_template,SANE_BACKEND_HP5400,hp5400))
+$(eval $(call PKG_mod_template,SANE_BACKEND_HP,hp))
+$(eval $(call PKG_mod_template,SANE_BACKEND_IBM,ibm))
+$(eval $(call PKG_mod_template,SANE_BACKEND_LEO,leo))
+$(eval $(call PKG_mod_template,SANE_BACKEND_LEXMARK,lexmark))
+$(eval $(call PKG_mod_template,SANE_BACKEND_MA1509,ma1509))
+$(eval $(call PKG_mod_template,SANE_BACKEND_MATSUSHITA,matsushita))
+$(eval $(call PKG_mod_template,SANE_BACKEND_MICROTEK2,microtek2))
+$(eval $(call PKG_mod_template,SANE_BACKEND_MICROTEK,microtek))
+$(eval $(call PKG_mod_template,SANE_BACKEND_MUSTEK,mustek))
+$(eval $(call PKG_mod_template,SANE_BACKEND_MUSTEK_USB2,mustek_usb2,n))
+$(eval $(call PKG_mod_template,SANE_BACKEND_MUSTEK_USB,mustek_usb))
+$(eval $(call PKG_mod_template,SANE_BACKEND_NEC,nec))
+$(eval $(call PKG_mod_template,SANE_BACKEND_NIASH,niash,n))
+$(eval $(call PKG_mod_template,SANE_BACKEND_PIE,pie))
+$(eval $(call PKG_mod_template,SANE_BACKEND_PIXMA,pixma))
+$(eval $(call PKG_mod_template,SANE_BACKEND_PLUSTEK_PP,plustek_pp))
+$(eval $(call PKG_mod_template,SANE_BACKEND_PLUSTEK,plustek))
+$(eval $(call PKG_mod_template,SANE_BACKEND_QCAM,qcam))
+$(eval $(call PKG_mod_template,SANE_BACKEND_RICOH,ricoh))
+$(eval $(call PKG_mod_template,SANE_BACKEND_S9036,s9036))
+$(eval $(call PKG_mod_template,SANE_BACKEND_SCEPTRE,sceptre))
+$(eval $(call PKG_mod_template,SANE_BACKEND_SHARP,sharp))
+$(eval $(call PKG_mod_template,SANE_BACKEND_SM3600,sm3600,n))
+$(eval $(call PKG_mod_template,SANE_BACKEND_SM3840,sm3840))
+$(eval $(call PKG_mod_template,SANE_BACKEND_SNAPSCAN,snapscan))
+$(eval $(call PKG_mod_template,SANE_BACKEND_SP15C,sp15c))
+$(eval $(call PKG_mod_template,SANE_BACKEND_ST400,st400))
+$(eval $(call PKG_mod_template,SANE_BACKEND_STV680,stv680))
+$(eval $(call PKG_mod_template,SANE_BACKEND_TAMARACK,tamarack))
+$(eval $(call PKG_mod_template,SANE_BACKEND_TECO1,teco1))
+$(eval $(call PKG_mod_template,SANE_BACKEND_TECO2,teco2))
+$(eval $(call PKG_mod_template,SANE_BACKEND_TECO3,teco3))
+$(eval $(call PKG_mod_template,SANE_BACKEND_TEST,test))
+$(eval $(call PKG_mod_template,SANE_BACKEND_U12,u12))
+$(eval $(call PKG_mod_template,SANE_BACKEND_UMAX1220U,umax1220u))
+$(eval $(call PKG_mod_template,SANE_BACKEND_UMAX_PP,umax_pp))
+$(eval $(call PKG_mod_template,SANE_BACKEND_UMAX,umax))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --disable-translations \
+ --without-gphoto2 \
+ --enable-libusb
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install: ${INSTALL_MODS_y} ${INSTALL_MODS_m}
+ ${INSTALL_DIR} ${IDIR_SANE_BACKENDS}/etc/sane.d
+ ${INSTALL_DIR} ${IDIR_SANE_BACKENDS}/usr/lib
+ ${INSTALL_DIR} ${IDIR_SANE_BACKENDS}/usr/sbin
+ ${CP} ${WRKINST}/etc/sane.d/dll.conf ${IDIR_SANE_BACKENDS}/etc/sane.d
+ ${CP} ${WRKINST}/etc/sane.d/saned.conf ${IDIR_SANE_BACKENDS}/etc/sane.d
+ ${CP} ${WRKINST}/usr/sbin/saned ${IDIR_SANE_BACKENDS}/usr/sbin
+ ${CP} ${WRKINST}/usr/lib/libsane*.so* ${IDIR_SANE_BACKENDS}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/sane-backends/ipkg/sane-backend-abaton.conffiles b/package/sane-backends/ipkg/sane-backend-abaton.conffiles
new file mode 100644
index 000000000..f800ddfed
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-abaton.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/abaton.conf
diff --git a/package/sane-backends/ipkg/sane-backend-abaton.control b/package/sane-backends/ipkg/sane-backend-abaton.control
new file mode 100644
index 000000000..fd52abe81
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-abaton.control
@@ -0,0 +1,5 @@
+Package: sane-backend-abaton
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-abaton.postinst b/package/sane-backends/ipkg/sane-backend-abaton.postinst
new file mode 100644
index 000000000..8c1201e86
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-abaton.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo abaton >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-agfafocus.conffiles b/package/sane-backends/ipkg/sane-backend-agfafocus.conffiles
new file mode 100644
index 000000000..4e83f8024
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-agfafocus.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/agfafocus.conf
diff --git a/package/sane-backends/ipkg/sane-backend-agfafocus.control b/package/sane-backends/ipkg/sane-backend-agfafocus.control
new file mode 100644
index 000000000..67da33560
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-agfafocus.control
@@ -0,0 +1,5 @@
+Package: sane-backend-agfafocus
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-agfafocus.postinst b/package/sane-backends/ipkg/sane-backend-agfafocus.postinst
new file mode 100644
index 000000000..c241b2572
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-agfafocus.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo agfafocus >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-apple.conffiles b/package/sane-backends/ipkg/sane-backend-apple.conffiles
new file mode 100644
index 000000000..d55a06b1c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-apple.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/apple.conf
diff --git a/package/sane-backends/ipkg/sane-backend-apple.control b/package/sane-backends/ipkg/sane-backend-apple.control
new file mode 100644
index 000000000..d3020a005
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-apple.control
@@ -0,0 +1,5 @@
+Package: sane-backend-apple
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-apple.postinst b/package/sane-backends/ipkg/sane-backend-apple.postinst
new file mode 100644
index 000000000..5276d64c3
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-apple.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo apple >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-artec-eplus48u.conffiles b/package/sane-backends/ipkg/sane-backend-artec-eplus48u.conffiles
new file mode 100644
index 000000000..442c32be6
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-artec-eplus48u.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/artec_eplus48u.conf
diff --git a/package/sane-backends/ipkg/sane-backend-artec-eplus48u.control b/package/sane-backends/ipkg/sane-backend-artec-eplus48u.control
new file mode 100644
index 000000000..4ceb898c9
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-artec-eplus48u.control
@@ -0,0 +1,5 @@
+Package: sane-backend-artec-eplus48u
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-artec-eplus48u.postinst b/package/sane-backends/ipkg/sane-backend-artec-eplus48u.postinst
new file mode 100644
index 000000000..4c8044d58
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-artec-eplus48u.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo artec_eplus48u >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-artec.conffiles b/package/sane-backends/ipkg/sane-backend-artec.conffiles
new file mode 100644
index 000000000..c14ab9fee
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-artec.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/artec.conf
diff --git a/package/sane-backends/ipkg/sane-backend-artec.control b/package/sane-backends/ipkg/sane-backend-artec.control
new file mode 100644
index 000000000..1fbe06275
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-artec.control
@@ -0,0 +1,5 @@
+Package: sane-backend-artec
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-artec.postinst b/package/sane-backends/ipkg/sane-backend-artec.postinst
new file mode 100644
index 000000000..bb388ab8a
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-artec.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo artec >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-as6e.control b/package/sane-backends/ipkg/sane-backend-as6e.control
new file mode 100644
index 000000000..d6c2a55f9
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-as6e.control
@@ -0,0 +1,5 @@
+Package: sane-backend-as6e
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-as6e.postinst b/package/sane-backends/ipkg/sane-backend-as6e.postinst
new file mode 100644
index 000000000..f25825f24
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-as6e.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo as6e >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-avision.conffiles b/package/sane-backends/ipkg/sane-backend-avision.conffiles
new file mode 100644
index 000000000..f93a7f909
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-avision.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/avision.conf
diff --git a/package/sane-backends/ipkg/sane-backend-avision.control b/package/sane-backends/ipkg/sane-backend-avision.control
new file mode 100644
index 000000000..d30034e92
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-avision.control
@@ -0,0 +1,5 @@
+Package: sane-backend-avision
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-avision.postinst b/package/sane-backends/ipkg/sane-backend-avision.postinst
new file mode 100644
index 000000000..a002c9e33
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-avision.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo avision >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-bh.conffiles b/package/sane-backends/ipkg/sane-backend-bh.conffiles
new file mode 100644
index 000000000..2961f0273
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-bh.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/bh.conf
diff --git a/package/sane-backends/ipkg/sane-backend-bh.control b/package/sane-backends/ipkg/sane-backend-bh.control
new file mode 100644
index 000000000..454dc31d4
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-bh.control
@@ -0,0 +1,5 @@
+Package: sane-backend-bh
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-bh.postinst b/package/sane-backends/ipkg/sane-backend-bh.postinst
new file mode 100644
index 000000000..be513a3a9
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-bh.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo bh >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-canon.conffiles b/package/sane-backends/ipkg/sane-backend-canon.conffiles
new file mode 100644
index 000000000..a656b7f78
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-canon.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/canon.conf
diff --git a/package/sane-backends/ipkg/sane-backend-canon.control b/package/sane-backends/ipkg/sane-backend-canon.control
new file mode 100644
index 000000000..691eabaae
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-canon.control
@@ -0,0 +1,5 @@
+Package: sane-backend-canon
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-canon.postinst b/package/sane-backends/ipkg/sane-backend-canon.postinst
new file mode 100644
index 000000000..673b4a509
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-canon.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo canon >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-canon630u.conffiles b/package/sane-backends/ipkg/sane-backend-canon630u.conffiles
new file mode 100644
index 000000000..f345ab596
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-canon630u.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/canon630u.conf
diff --git a/package/sane-backends/ipkg/sane-backend-canon630u.control b/package/sane-backends/ipkg/sane-backend-canon630u.control
new file mode 100644
index 000000000..6ab6c68e5
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-canon630u.control
@@ -0,0 +1,5 @@
+Package: sane-backend-canon630u
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-canon630u.postinst b/package/sane-backends/ipkg/sane-backend-canon630u.postinst
new file mode 100644
index 000000000..7d735d79b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-canon630u.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo canon630u >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-coolscan.conffiles b/package/sane-backends/ipkg/sane-backend-coolscan.conffiles
new file mode 100644
index 000000000..99d9c038c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-coolscan.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/coolscan.conf
diff --git a/package/sane-backends/ipkg/sane-backend-coolscan.control b/package/sane-backends/ipkg/sane-backend-coolscan.control
new file mode 100644
index 000000000..ed3e58f0e
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-coolscan.control
@@ -0,0 +1,5 @@
+Package: sane-backend-coolscan
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-coolscan.postinst b/package/sane-backends/ipkg/sane-backend-coolscan.postinst
new file mode 100644
index 000000000..b46532b8e
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-coolscan.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo coolscan >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-coolscan2.conffiles b/package/sane-backends/ipkg/sane-backend-coolscan2.conffiles
new file mode 100644
index 000000000..ff6da7948
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-coolscan2.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/coolscan2.conf
diff --git a/package/sane-backends/ipkg/sane-backend-coolscan2.control b/package/sane-backends/ipkg/sane-backend-coolscan2.control
new file mode 100644
index 000000000..e91e4c3bc
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-coolscan2.control
@@ -0,0 +1,5 @@
+Package: sane-backend-coolscan2
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-coolscan2.postinst b/package/sane-backends/ipkg/sane-backend-coolscan2.postinst
new file mode 100644
index 000000000..ff91beb9c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-coolscan2.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo coolscan2 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-dc25.conffiles b/package/sane-backends/ipkg/sane-backend-dc25.conffiles
new file mode 100644
index 000000000..d07745aff
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-dc25.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/dc25.conf
diff --git a/package/sane-backends/ipkg/sane-backend-dc25.control b/package/sane-backends/ipkg/sane-backend-dc25.control
new file mode 100644
index 000000000..192c3ee66
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-dc25.control
@@ -0,0 +1,5 @@
+Package: sane-backend-dc25
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-dc25.postinst b/package/sane-backends/ipkg/sane-backend-dc25.postinst
new file mode 100644
index 000000000..7081e48e8
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-dc25.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo dc25 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-dmc.conffiles b/package/sane-backends/ipkg/sane-backend-dmc.conffiles
new file mode 100644
index 000000000..21a10f063
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-dmc.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/dmc.conf
diff --git a/package/sane-backends/ipkg/sane-backend-dmc.control b/package/sane-backends/ipkg/sane-backend-dmc.control
new file mode 100644
index 000000000..d7373a95b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-dmc.control
@@ -0,0 +1,5 @@
+Package: sane-backend-dmc
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-dmc.postinst b/package/sane-backends/ipkg/sane-backend-dmc.postinst
new file mode 100644
index 000000000..467a491f7
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-dmc.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo dmc >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-epson.conffiles b/package/sane-backends/ipkg/sane-backend-epson.conffiles
new file mode 100644
index 000000000..3fe39079c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-epson.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/epson.conf
diff --git a/package/sane-backends/ipkg/sane-backend-epson.control b/package/sane-backends/ipkg/sane-backend-epson.control
new file mode 100644
index 000000000..42fe75f2e
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-epson.control
@@ -0,0 +1,5 @@
+Package: sane-backend-epson
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-epson.postinst b/package/sane-backends/ipkg/sane-backend-epson.postinst
new file mode 100644
index 000000000..2040957be
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-epson.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo epson >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-fujitsu.conffiles b/package/sane-backends/ipkg/sane-backend-fujitsu.conffiles
new file mode 100644
index 000000000..d8ac2f861
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-fujitsu.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/fujitsu.conf
diff --git a/package/sane-backends/ipkg/sane-backend-fujitsu.control b/package/sane-backends/ipkg/sane-backend-fujitsu.control
new file mode 100644
index 000000000..81ce3269b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-fujitsu.control
@@ -0,0 +1,5 @@
+Package: sane-backend-fujitsu
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-fujitsu.postinst b/package/sane-backends/ipkg/sane-backend-fujitsu.postinst
new file mode 100644
index 000000000..6fce624c2
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-fujitsu.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo fujitsu >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-genesys.conffiles b/package/sane-backends/ipkg/sane-backend-genesys.conffiles
new file mode 100644
index 000000000..57e685ce9
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-genesys.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/genesys.conf
diff --git a/package/sane-backends/ipkg/sane-backend-genesys.control b/package/sane-backends/ipkg/sane-backend-genesys.control
new file mode 100644
index 000000000..53be23b47
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-genesys.control
@@ -0,0 +1,5 @@
+Package: sane-backend-genesys
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-genesys.postinst b/package/sane-backends/ipkg/sane-backend-genesys.postinst
new file mode 100644
index 000000000..f35433580
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-genesys.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo genesys >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-gt68xx.conffiles b/package/sane-backends/ipkg/sane-backend-gt68xx.conffiles
new file mode 100644
index 000000000..02306b6e1
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-gt68xx.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/gt68xx.conf
diff --git a/package/sane-backends/ipkg/sane-backend-gt68xx.control b/package/sane-backends/ipkg/sane-backend-gt68xx.control
new file mode 100644
index 000000000..803903951
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-gt68xx.control
@@ -0,0 +1,5 @@
+Package: sane-backend-gt68xx
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-gt68xx.postinst b/package/sane-backends/ipkg/sane-backend-gt68xx.postinst
new file mode 100644
index 000000000..4c0d2597d
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-gt68xx.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo gt68xx >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-hp.conffiles b/package/sane-backends/ipkg/sane-backend-hp.conffiles
new file mode 100644
index 000000000..4c18bf1cf
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/hp.conf
diff --git a/package/sane-backends/ipkg/sane-backend-hp.control b/package/sane-backends/ipkg/sane-backend-hp.control
new file mode 100644
index 000000000..7c53c51be
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp.control
@@ -0,0 +1,5 @@
+Package: sane-backend-hp
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-hp.postinst b/package/sane-backends/ipkg/sane-backend-hp.postinst
new file mode 100644
index 000000000..8302909c4
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo hp >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-hp3500.control b/package/sane-backends/ipkg/sane-backend-hp3500.control
new file mode 100644
index 000000000..cb6f7fb92
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp3500.control
@@ -0,0 +1,5 @@
+Package: sane-backend-hp3500
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-hp3500.postinst b/package/sane-backends/ipkg/sane-backend-hp3500.postinst
new file mode 100644
index 000000000..3177c633d
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp3500.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo hp3500 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-hp4200.conffiles b/package/sane-backends/ipkg/sane-backend-hp4200.conffiles
new file mode 100644
index 000000000..21a7b9296
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp4200.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/hp4200.conf
diff --git a/package/sane-backends/ipkg/sane-backend-hp4200.control b/package/sane-backends/ipkg/sane-backend-hp4200.control
new file mode 100644
index 000000000..a38c034be
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp4200.control
@@ -0,0 +1,5 @@
+Package: sane-backend-hp4200
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-hp4200.postinst b/package/sane-backends/ipkg/sane-backend-hp4200.postinst
new file mode 100644
index 000000000..b6e81c5a9
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp4200.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo hp4200 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-hp5400.conffiles b/package/sane-backends/ipkg/sane-backend-hp5400.conffiles
new file mode 100644
index 000000000..48f1856df
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp5400.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/hp5400.conf
diff --git a/package/sane-backends/ipkg/sane-backend-hp5400.control b/package/sane-backends/ipkg/sane-backend-hp5400.control
new file mode 100644
index 000000000..69667ee96
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp5400.control
@@ -0,0 +1,5 @@
+Package: sane-backend-hp5400
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-hp5400.postinst b/package/sane-backends/ipkg/sane-backend-hp5400.postinst
new file mode 100644
index 000000000..c69eac6d9
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-hp5400.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo hp5400 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-ibm.conffiles b/package/sane-backends/ipkg/sane-backend-ibm.conffiles
new file mode 100644
index 000000000..f70a10b46
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ibm.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/ibm.conf
diff --git a/package/sane-backends/ipkg/sane-backend-ibm.control b/package/sane-backends/ipkg/sane-backend-ibm.control
new file mode 100644
index 000000000..e4ee71b7a
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ibm.control
@@ -0,0 +1,5 @@
+Package: sane-backend-ibm
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-ibm.postinst b/package/sane-backends/ipkg/sane-backend-ibm.postinst
new file mode 100644
index 000000000..ed2d913b2
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ibm.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo ibm >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-leo.conffiles b/package/sane-backends/ipkg/sane-backend-leo.conffiles
new file mode 100644
index 000000000..489d1e0f5
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-leo.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/leo.conf
diff --git a/package/sane-backends/ipkg/sane-backend-leo.control b/package/sane-backends/ipkg/sane-backend-leo.control
new file mode 100644
index 000000000..88e74457e
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-leo.control
@@ -0,0 +1,5 @@
+Package: sane-backend-leo
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-leo.postinst b/package/sane-backends/ipkg/sane-backend-leo.postinst
new file mode 100644
index 000000000..8eee90333
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-leo.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo leo >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-lexmark.conffiles b/package/sane-backends/ipkg/sane-backend-lexmark.conffiles
new file mode 100644
index 000000000..327463e5b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-lexmark.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/lexmark.conf
diff --git a/package/sane-backends/ipkg/sane-backend-lexmark.control b/package/sane-backends/ipkg/sane-backend-lexmark.control
new file mode 100644
index 000000000..02ed986bd
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-lexmark.control
@@ -0,0 +1,5 @@
+Package: sane-backend-lexmark
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-lexmark.postinst b/package/sane-backends/ipkg/sane-backend-lexmark.postinst
new file mode 100644
index 000000000..5abb73069
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-lexmark.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo lexmark >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-ma1509.conffiles b/package/sane-backends/ipkg/sane-backend-ma1509.conffiles
new file mode 100644
index 000000000..8d4c6e534
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ma1509.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/ma1509.conf
diff --git a/package/sane-backends/ipkg/sane-backend-ma1509.control b/package/sane-backends/ipkg/sane-backend-ma1509.control
new file mode 100644
index 000000000..edbff43ac
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ma1509.control
@@ -0,0 +1,5 @@
+Package: sane-backend-ma1509
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-ma1509.postinst b/package/sane-backends/ipkg/sane-backend-ma1509.postinst
new file mode 100644
index 000000000..00eaf2cca
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ma1509.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo ma1509 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-matsushita.conffiles b/package/sane-backends/ipkg/sane-backend-matsushita.conffiles
new file mode 100644
index 000000000..4d85e6d43
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-matsushita.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/matsushita.conf
diff --git a/package/sane-backends/ipkg/sane-backend-matsushita.control b/package/sane-backends/ipkg/sane-backend-matsushita.control
new file mode 100644
index 000000000..e27481026
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-matsushita.control
@@ -0,0 +1,5 @@
+Package: sane-backend-matsushita
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-matsushita.postinst b/package/sane-backends/ipkg/sane-backend-matsushita.postinst
new file mode 100644
index 000000000..c73421ea4
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-matsushita.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo matsushita >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-microtek.conffiles b/package/sane-backends/ipkg/sane-backend-microtek.conffiles
new file mode 100644
index 000000000..ba5c6e65a
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-microtek.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/microtek.conf
diff --git a/package/sane-backends/ipkg/sane-backend-microtek.control b/package/sane-backends/ipkg/sane-backend-microtek.control
new file mode 100644
index 000000000..3294e54cc
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-microtek.control
@@ -0,0 +1,5 @@
+Package: sane-backend-microtek
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-microtek.postinst b/package/sane-backends/ipkg/sane-backend-microtek.postinst
new file mode 100644
index 000000000..1f1ed268d
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-microtek.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo microtek >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-microtek2.conffiles b/package/sane-backends/ipkg/sane-backend-microtek2.conffiles
new file mode 100644
index 000000000..9c4695024
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-microtek2.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/microtek2.conf
diff --git a/package/sane-backends/ipkg/sane-backend-microtek2.control b/package/sane-backends/ipkg/sane-backend-microtek2.control
new file mode 100644
index 000000000..92b6b4b2e
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-microtek2.control
@@ -0,0 +1,5 @@
+Package: sane-backend-microtek2
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-microtek2.postinst b/package/sane-backends/ipkg/sane-backend-microtek2.postinst
new file mode 100644
index 000000000..a1e8356e2
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-microtek2.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo microtek2 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-mustek-usb.conffiles b/package/sane-backends/ipkg/sane-backend-mustek-usb.conffiles
new file mode 100644
index 000000000..e604cc64d
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek-usb.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/mustek_usb.conf
diff --git a/package/sane-backends/ipkg/sane-backend-mustek-usb.control b/package/sane-backends/ipkg/sane-backend-mustek-usb.control
new file mode 100644
index 000000000..dde7ebf27
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek-usb.control
@@ -0,0 +1,5 @@
+Package: sane-backend-mustek-usb
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-mustek-usb.postinst b/package/sane-backends/ipkg/sane-backend-mustek-usb.postinst
new file mode 100644
index 000000000..3b226a92f
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek-usb.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo mustek_usb >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-mustek-usb2.control b/package/sane-backends/ipkg/sane-backend-mustek-usb2.control
new file mode 100644
index 000000000..7e9dae5a4
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek-usb2.control
@@ -0,0 +1,5 @@
+Package: sane-backend-mustek-usb2
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-mustek-usb2.postinst b/package/sane-backends/ipkg/sane-backend-mustek-usb2.postinst
new file mode 100644
index 000000000..9c8d4e7f7
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek-usb2.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo mustek_usb2 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-mustek.conffiles b/package/sane-backends/ipkg/sane-backend-mustek.conffiles
new file mode 100644
index 000000000..3355a4952
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/mustek.conf
diff --git a/package/sane-backends/ipkg/sane-backend-mustek.control b/package/sane-backends/ipkg/sane-backend-mustek.control
new file mode 100644
index 000000000..09411b34c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek.control
@@ -0,0 +1,5 @@
+Package: sane-backend-mustek
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-mustek.postinst b/package/sane-backends/ipkg/sane-backend-mustek.postinst
new file mode 100644
index 000000000..1290cb935
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-mustek.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo mustek >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-nec.conffiles b/package/sane-backends/ipkg/sane-backend-nec.conffiles
new file mode 100644
index 000000000..50c8d9d46
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-nec.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/nec.conf
diff --git a/package/sane-backends/ipkg/sane-backend-nec.control b/package/sane-backends/ipkg/sane-backend-nec.control
new file mode 100644
index 000000000..740efc352
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-nec.control
@@ -0,0 +1,5 @@
+Package: sane-backend-nec
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-nec.postinst b/package/sane-backends/ipkg/sane-backend-nec.postinst
new file mode 100644
index 000000000..002fcd98a
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-nec.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo nec >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-net.conffiles b/package/sane-backends/ipkg/sane-backend-net.conffiles
new file mode 100644
index 000000000..eb00ed76b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-net.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/net.conf
diff --git a/package/sane-backends/ipkg/sane-backend-net.control b/package/sane-backends/ipkg/sane-backend-net.control
new file mode 100644
index 000000000..387b133ee
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-net.control
@@ -0,0 +1,5 @@
+Package: sane-backend-net
+Depends: sane-backends
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-net.postinst b/package/sane-backends/ipkg/sane-backend-net.postinst
new file mode 100644
index 000000000..1e35fbbf7
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-net.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo net >>$IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-niash.control b/package/sane-backends/ipkg/sane-backend-niash.control
new file mode 100644
index 000000000..c130ef993
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-niash.control
@@ -0,0 +1,5 @@
+Package: sane-backend-niash
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-niash.postinst b/package/sane-backends/ipkg/sane-backend-niash.postinst
new file mode 100644
index 000000000..148c68660
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-niash.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo niash >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-pie.conffiles b/package/sane-backends/ipkg/sane-backend-pie.conffiles
new file mode 100644
index 000000000..a6c251281
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-pie.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/pie.conf
diff --git a/package/sane-backends/ipkg/sane-backend-pie.control b/package/sane-backends/ipkg/sane-backend-pie.control
new file mode 100644
index 000000000..73561fde3
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-pie.control
@@ -0,0 +1,5 @@
+Package: sane-backend-pie
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-pie.postinst b/package/sane-backends/ipkg/sane-backend-pie.postinst
new file mode 100644
index 000000000..39f0eabd2
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-pie.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo pie >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-pixma.control b/package/sane-backends/ipkg/sane-backend-pixma.control
new file mode 100644
index 000000000..49399fa0c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-pixma.control
@@ -0,0 +1,5 @@
+Package: sane-backend-pixma
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-pixma.postinst b/package/sane-backends/ipkg/sane-backend-pixma.postinst
new file mode 100644
index 000000000..773e4ebed
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-pixma.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo pixma >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-plustek-pp.conffiles b/package/sane-backends/ipkg/sane-backend-plustek-pp.conffiles
new file mode 100644
index 000000000..fa1574be7
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-plustek-pp.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/plustek_pp.conf
diff --git a/package/sane-backends/ipkg/sane-backend-plustek-pp.control b/package/sane-backends/ipkg/sane-backend-plustek-pp.control
new file mode 100644
index 000000000..a03cfbeeb
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-plustek-pp.control
@@ -0,0 +1,5 @@
+Package: sane-backend-plustek-pp
+Depends: sane-backends
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-plustek-pp.postinst b/package/sane-backends/ipkg/sane-backend-plustek-pp.postinst
new file mode 100644
index 000000000..805176075
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-plustek-pp.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo plustek_pp >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-plustek.conffiles b/package/sane-backends/ipkg/sane-backend-plustek.conffiles
new file mode 100644
index 000000000..29635189c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-plustek.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/plustek.conf
diff --git a/package/sane-backends/ipkg/sane-backend-plustek.control b/package/sane-backends/ipkg/sane-backend-plustek.control
new file mode 100644
index 000000000..1feffd40c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-plustek.control
@@ -0,0 +1,5 @@
+Package: sane-backend-plustek
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-plustek.postinst b/package/sane-backends/ipkg/sane-backend-plustek.postinst
new file mode 100644
index 000000000..dee44430b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-plustek.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo plustek >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-qcam.conffiles b/package/sane-backends/ipkg/sane-backend-qcam.conffiles
new file mode 100644
index 000000000..dd760dbd6
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-qcam.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/qcam.conf
diff --git a/package/sane-backends/ipkg/sane-backend-qcam.control b/package/sane-backends/ipkg/sane-backend-qcam.control
new file mode 100644
index 000000000..e4f4f9814
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-qcam.control
@@ -0,0 +1,5 @@
+Package: sane-backend-qcam
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-qcam.postinst b/package/sane-backends/ipkg/sane-backend-qcam.postinst
new file mode 100644
index 000000000..0efd64074
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-qcam.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo qcam >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-ricoh.conffiles b/package/sane-backends/ipkg/sane-backend-ricoh.conffiles
new file mode 100644
index 000000000..d790e5325
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ricoh.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/ricoh.conf
diff --git a/package/sane-backends/ipkg/sane-backend-ricoh.control b/package/sane-backends/ipkg/sane-backend-ricoh.control
new file mode 100644
index 000000000..2c0954e79
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ricoh.control
@@ -0,0 +1,5 @@
+Package: sane-backend-ricoh
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-ricoh.postinst b/package/sane-backends/ipkg/sane-backend-ricoh.postinst
new file mode 100644
index 000000000..1fcc0535d
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-ricoh.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo ricoh >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-s9036.conffiles b/package/sane-backends/ipkg/sane-backend-s9036.conffiles
new file mode 100644
index 000000000..5ca57aa8b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-s9036.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/s9036.conf
diff --git a/package/sane-backends/ipkg/sane-backend-s9036.control b/package/sane-backends/ipkg/sane-backend-s9036.control
new file mode 100644
index 000000000..6fbc8fc47
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-s9036.control
@@ -0,0 +1,5 @@
+Package: sane-backend-s9036
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-s9036.postinst b/package/sane-backends/ipkg/sane-backend-s9036.postinst
new file mode 100644
index 000000000..959944cc5
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-s9036.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo s9036 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sceptre.conffiles b/package/sane-backends/ipkg/sane-backend-sceptre.conffiles
new file mode 100644
index 000000000..b2ad8c4c3
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sceptre.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/sceptre.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sceptre.control b/package/sane-backends/ipkg/sane-backend-sceptre.control
new file mode 100644
index 000000000..06c9104f3
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sceptre.control
@@ -0,0 +1,5 @@
+Package: sane-backend-sceptre
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-sceptre.postinst b/package/sane-backends/ipkg/sane-backend-sceptre.postinst
new file mode 100644
index 000000000..d1b0635f6
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sceptre.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo sceptre >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sharp.conffiles b/package/sane-backends/ipkg/sane-backend-sharp.conffiles
new file mode 100644
index 000000000..0895d4349
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sharp.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/sharp.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sharp.control b/package/sane-backends/ipkg/sane-backend-sharp.control
new file mode 100644
index 000000000..234b45fbd
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sharp.control
@@ -0,0 +1,5 @@
+Package: sane-backend-sharp
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-sharp.postinst b/package/sane-backends/ipkg/sane-backend-sharp.postinst
new file mode 100644
index 000000000..517d2a1fa
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sharp.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo sharp >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sm3600.control b/package/sane-backends/ipkg/sane-backend-sm3600.control
new file mode 100644
index 000000000..6824abbe0
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sm3600.control
@@ -0,0 +1,5 @@
+Package: sane-backend-sm3600
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-sm3600.postinst b/package/sane-backends/ipkg/sane-backend-sm3600.postinst
new file mode 100644
index 000000000..b61aaac44
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sm3600.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo sm3600 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sm3840.conffiles b/package/sane-backends/ipkg/sane-backend-sm3840.conffiles
new file mode 100644
index 000000000..bfb88789e
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sm3840.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/sm3840.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sm3840.control b/package/sane-backends/ipkg/sane-backend-sm3840.control
new file mode 100644
index 000000000..a6f808d3a
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sm3840.control
@@ -0,0 +1,5 @@
+Package: sane-backend-sm3840
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-sm3840.postinst b/package/sane-backends/ipkg/sane-backend-sm3840.postinst
new file mode 100644
index 000000000..75bf72276
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sm3840.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo sm3840 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-snapscan.conffiles b/package/sane-backends/ipkg/sane-backend-snapscan.conffiles
new file mode 100644
index 000000000..d34e9aede
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-snapscan.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/snapscan.conf
diff --git a/package/sane-backends/ipkg/sane-backend-snapscan.control b/package/sane-backends/ipkg/sane-backend-snapscan.control
new file mode 100644
index 000000000..d6c1593ad
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-snapscan.control
@@ -0,0 +1,5 @@
+Package: sane-backend-snapscan
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-snapscan.postinst b/package/sane-backends/ipkg/sane-backend-snapscan.postinst
new file mode 100644
index 000000000..d178d062b
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-snapscan.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo snapscan >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sp15c.conffiles b/package/sane-backends/ipkg/sane-backend-sp15c.conffiles
new file mode 100644
index 000000000..60881d103
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sp15c.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/sp15c.conf
diff --git a/package/sane-backends/ipkg/sane-backend-sp15c.control b/package/sane-backends/ipkg/sane-backend-sp15c.control
new file mode 100644
index 000000000..1715f0b98
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sp15c.control
@@ -0,0 +1,5 @@
+Package: sane-backend-sp15c
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-sp15c.postinst b/package/sane-backends/ipkg/sane-backend-sp15c.postinst
new file mode 100644
index 000000000..889e638a0
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-sp15c.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo sp15c >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-st400.conffiles b/package/sane-backends/ipkg/sane-backend-st400.conffiles
new file mode 100644
index 000000000..bfcf5a26f
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-st400.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/st400.conf
diff --git a/package/sane-backends/ipkg/sane-backend-st400.control b/package/sane-backends/ipkg/sane-backend-st400.control
new file mode 100644
index 000000000..ecf5e2d27
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-st400.control
@@ -0,0 +1,5 @@
+Package: sane-backend-st400
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-st400.postinst b/package/sane-backends/ipkg/sane-backend-st400.postinst
new file mode 100644
index 000000000..8c5c4444c
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-st400.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo st400 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-stv680.conffiles b/package/sane-backends/ipkg/sane-backend-stv680.conffiles
new file mode 100644
index 000000000..0eddb7588
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-stv680.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/stv680.conf
diff --git a/package/sane-backends/ipkg/sane-backend-stv680.control b/package/sane-backends/ipkg/sane-backend-stv680.control
new file mode 100644
index 000000000..5b1a163f6
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-stv680.control
@@ -0,0 +1,5 @@
+Package: sane-backend-stv680
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-stv680.postinst b/package/sane-backends/ipkg/sane-backend-stv680.postinst
new file mode 100644
index 000000000..a32ceb3db
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-stv680.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo stv680 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-tamarack.conffiles b/package/sane-backends/ipkg/sane-backend-tamarack.conffiles
new file mode 100644
index 000000000..f6b777a75
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-tamarack.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/tamarack.conf
diff --git a/package/sane-backends/ipkg/sane-backend-tamarack.control b/package/sane-backends/ipkg/sane-backend-tamarack.control
new file mode 100644
index 000000000..899a166e1
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-tamarack.control
@@ -0,0 +1,5 @@
+Package: sane-backend-tamarack
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-tamarack.postinst b/package/sane-backends/ipkg/sane-backend-tamarack.postinst
new file mode 100644
index 000000000..d909764d5
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-tamarack.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo tamarack >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-teco1.conffiles b/package/sane-backends/ipkg/sane-backend-teco1.conffiles
new file mode 100644
index 000000000..9d11c7054
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco1.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/teco1.conf
diff --git a/package/sane-backends/ipkg/sane-backend-teco1.control b/package/sane-backends/ipkg/sane-backend-teco1.control
new file mode 100644
index 000000000..8c1c6882f
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco1.control
@@ -0,0 +1,5 @@
+Package: sane-backend-teco1
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-teco1.postinst b/package/sane-backends/ipkg/sane-backend-teco1.postinst
new file mode 100644
index 000000000..2f57dd58f
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco1.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo teco1 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-teco2.conffiles b/package/sane-backends/ipkg/sane-backend-teco2.conffiles
new file mode 100644
index 000000000..6d854b51a
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco2.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/teco2.conf
diff --git a/package/sane-backends/ipkg/sane-backend-teco2.control b/package/sane-backends/ipkg/sane-backend-teco2.control
new file mode 100644
index 000000000..6dc1c9cc3
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco2.control
@@ -0,0 +1,5 @@
+Package: sane-backend-teco2
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-teco2.postinst b/package/sane-backends/ipkg/sane-backend-teco2.postinst
new file mode 100644
index 000000000..f40dbff9f
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco2.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo teco2 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-teco3.conffiles b/package/sane-backends/ipkg/sane-backend-teco3.conffiles
new file mode 100644
index 000000000..b009c57bd
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco3.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/teco3.conf
diff --git a/package/sane-backends/ipkg/sane-backend-teco3.control b/package/sane-backends/ipkg/sane-backend-teco3.control
new file mode 100644
index 000000000..790dd75c2
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco3.control
@@ -0,0 +1,5 @@
+Package: sane-backend-teco3
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-teco3.postinst b/package/sane-backends/ipkg/sane-backend-teco3.postinst
new file mode 100644
index 000000000..856c586e2
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-teco3.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo teco3 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-test.conffiles b/package/sane-backends/ipkg/sane-backend-test.conffiles
new file mode 100644
index 000000000..5fd43bbaf
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-test.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/test.conf
diff --git a/package/sane-backends/ipkg/sane-backend-test.control b/package/sane-backends/ipkg/sane-backend-test.control
new file mode 100644
index 000000000..921cbf6f6
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-test.control
@@ -0,0 +1,5 @@
+Package: sane-backend-test
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-test.postinst b/package/sane-backends/ipkg/sane-backend-test.postinst
new file mode 100644
index 000000000..872551149
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-test.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo test >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-u12.conffiles b/package/sane-backends/ipkg/sane-backend-u12.conffiles
new file mode 100644
index 000000000..45e10d825
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-u12.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/u12.conf
diff --git a/package/sane-backends/ipkg/sane-backend-u12.control b/package/sane-backends/ipkg/sane-backend-u12.control
new file mode 100644
index 000000000..2fbd55bb8
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-u12.control
@@ -0,0 +1,5 @@
+Package: sane-backend-u12
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-u12.postinst b/package/sane-backends/ipkg/sane-backend-u12.postinst
new file mode 100644
index 000000000..6febe36e2
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-u12.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo u12 >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-umax-pp.conffiles b/package/sane-backends/ipkg/sane-backend-umax-pp.conffiles
new file mode 100644
index 000000000..aa28461c5
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax-pp.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/umax_pp.conf
diff --git a/package/sane-backends/ipkg/sane-backend-umax-pp.control b/package/sane-backends/ipkg/sane-backend-umax-pp.control
new file mode 100644
index 000000000..99bd9886a
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax-pp.control
@@ -0,0 +1,5 @@
+Package: sane-backend-umax-pp
+Depends: sane-backends
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-umax-pp.postinst b/package/sane-backends/ipkg/sane-backend-umax-pp.postinst
new file mode 100644
index 000000000..c234c8bbd
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax-pp.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo umax_pp >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-umax.conffiles b/package/sane-backends/ipkg/sane-backend-umax.conffiles
new file mode 100644
index 000000000..58d34e541
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/umax.conf
diff --git a/package/sane-backends/ipkg/sane-backend-umax.control b/package/sane-backends/ipkg/sane-backend-umax.control
new file mode 100644
index 000000000..3d9a89013
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax.control
@@ -0,0 +1,5 @@
+Package: sane-backend-umax
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-umax.postinst b/package/sane-backends/ipkg/sane-backend-umax.postinst
new file mode 100644
index 000000000..ba668e5fe
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo umax >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-umax1220u.conffiles b/package/sane-backends/ipkg/sane-backend-umax1220u.conffiles
new file mode 100644
index 000000000..83f004202
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax1220u.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/umax1220u.conf
diff --git a/package/sane-backends/ipkg/sane-backend-umax1220u.control b/package/sane-backends/ipkg/sane-backend-umax1220u.control
new file mode 100644
index 000000000..6f5a5fde4
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax1220u.control
@@ -0,0 +1,5 @@
+Package: sane-backend-umax1220u
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-umax1220u.postinst b/package/sane-backends/ipkg/sane-backend-umax1220u.postinst
new file mode 100644
index 000000000..a5ec96d76
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-umax1220u.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo umax1220u >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backend-v4l.conffiles b/package/sane-backends/ipkg/sane-backend-v4l.conffiles
new file mode 100644
index 000000000..11664b7ea
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-v4l.conffiles
@@ -0,0 +1 @@
+/etc/sane.d/v4l.conf
diff --git a/package/sane-backends/ipkg/sane-backend-v4l.control b/package/sane-backends/ipkg/sane-backend-v4l.control
new file mode 100644
index 000000000..bd51b2fab
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-v4l.control
@@ -0,0 +1,5 @@
+Package: sane-backend-v4l
+Depends: sane-backends, libusb
+Priority: optional
+Section: misc
+Description: Scanner access now easy
diff --git a/package/sane-backends/ipkg/sane-backend-v4l.postinst b/package/sane-backends/ipkg/sane-backend-v4l.postinst
new file mode 100644
index 000000000..23dbf14ff
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backend-v4l.postinst
@@ -0,0 +1,2 @@
+#/bin/sh
+echo v4l >> $IPKG_INSTROOT/etc/sane.d/dll.conf
diff --git a/package/sane-backends/ipkg/sane-backends.conffiles b/package/sane-backends/ipkg/sane-backends.conffiles
new file mode 100644
index 000000000..2d4b3e2d0
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backends.conffiles
@@ -0,0 +1,2 @@
+/etc/sane.d/dll.conf
+/etc/sane.d/saned.conf
diff --git a/package/sane-backends/ipkg/sane-backends.control b/package/sane-backends/ipkg/sane-backends.control
new file mode 100644
index 000000000..7229a6411
--- /dev/null
+++ b/package/sane-backends/ipkg/sane-backends.control
@@ -0,0 +1,5 @@
+Package: sane-backends
+Priority: optional
+Section: misc
+Depends: libpthread
+Description: Scanner access now easy
diff --git a/package/sane-backends/patches/patch-Makefile_in b/package/sane-backends/patches/patch-Makefile_in
new file mode 100644
index 000000000..6a143eb05
--- /dev/null
+++ b/package/sane-backends/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- sane-backends-1.0.20.orig/Makefile.in 2009-04-30 15:41:20.000000000 +0200
++++ sane-backends-1.0.20/Makefile.in 2009-05-11 00:17:44.000000000 +0200
+@@ -244,7 +244,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = include lib sanei backend frontend tools doc po
++SUBDIRS = include lib sanei backend frontend
+ DIST_SUBDIRS = include lib sanei backend frontend tools doc po japi testsuite
+ dist_doc_DATA = AUTHORS ChangeLog COPYING LICENSE NEWS PROBLEMS PROJECTS \
+ README README.aix README.beos README.darwin README.djpeg README.freebsd \
diff --git a/package/sane-backends/patches/patch-backend_microtek_c b/package/sane-backends/patches/patch-backend_microtek_c
new file mode 100644
index 000000000..6d99f5808
--- /dev/null
+++ b/package/sane-backends/patches/patch-backend_microtek_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- sane-backends-1.0.20.orig/backend/microtek.c 2009-02-26 17:11:17.000000000 +0100
++++ sane-backends-1.0.20/backend/microtek.c 2009-05-11 00:10:23.000000000 +0200
+@@ -59,6 +59,7 @@
+
+ #include "sane/config.h"
+
++#include <stdarg.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
diff --git a/package/sane-backends/patches/patch-backend_pixma_bjnp_c b/package/sane-backends/patches/patch-backend_pixma_bjnp_c
new file mode 100644
index 000000000..4b3224eb9
--- /dev/null
+++ b/package/sane-backends/patches/patch-backend_pixma_bjnp_c
@@ -0,0 +1,22 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- sane-backends-1.0.20.orig/backend/pixma_bjnp.c 2009-04-01 18:26:58.000000000 +0200
++++ sane-backends-1.0.20/backend/pixma_bjnp.c 2009-05-11 00:23:33.000000000 +0200
+@@ -59,9 +59,6 @@
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+-#ifdef HAVE_SYS_TIME_H
+-#include <sys/timeb.h>
+-#endif
+
+ /*
+ * networking stuff
+@@ -196,7 +193,7 @@ truncate_hostname (char *hostname, char
+ {
+ /* this is a hostname, not an ip-address, so remove domain part of the name */
+
+- if ((dot = index (short_hostname, '.')) != NULL)
++ if ((dot = strchr(short_hostname, '.')) != NULL)
+ *dot = '\0';
+ }
+ return short_hostname;
diff --git a/package/sane-backends/patches/patch-backend_pixma_common_h b/package/sane-backends/patches/patch-backend_pixma_common_h
new file mode 100644
index 000000000..822cc888e
--- /dev/null
+++ b/package/sane-backends/patches/patch-backend_pixma_common_h
@@ -0,0 +1,13 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- sane-backends-1.0.20.orig/backend/pixma_common.h 2009-02-05 15:36:36.000000000 +0100
++++ sane-backends-1.0.20/backend/pixma_common.h 2009-05-11 21:00:58.000000000 +0200
+@@ -220,8 +220,8 @@ void pixma_hexdump (int level, const voi
+ void pixma_dump (int level, const char *type, const void *data, int len,
+ int size, int max);
+ # define DEBUG_DECLARE_ONLY
+-# include "../include/sane/sanei_debug.h"
+ #endif /* NDEBUG */
+ /** @} end of group debug */
++# include "../include/sane/sanei_debug.h"
+
+ #endif
diff --git a/package/sane-backends/patches/patch-backend_pixma_imageclass_c b/package/sane-backends/patches/patch-backend_pixma_imageclass_c
new file mode 100644
index 000000000..7c2492c5f
--- /dev/null
+++ b/package/sane-backends/patches/patch-backend_pixma_imageclass_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- sane-backends-1.0.20.orig/backend/pixma_imageclass.c 2009-03-12 18:36:09.000000000 +0100
++++ sane-backends-1.0.20/backend/pixma_imageclass.c 2009-05-11 00:30:36.000000000 +0200
+@@ -159,8 +159,6 @@ query_status (pixma_t * s)
+ if (error >= 0)
+ {
+ memcpy (mf->current_status, data, 12);
+- DBG (3, "Current status: paper=%u cal=%u lamp=%u\n",
+- data[1], data[8], data[7]);
+ PDBG (pixma_dbg (3, "Current status: paper=%u cal=%u lamp=%u\n",
+ data[1], data[8], data[7]));
+ }
diff --git a/package/sane-backends/patches/patch-backend_sm3600-scanutil_c b/package/sane-backends/patches/patch-backend_sm3600-scanutil_c
new file mode 100644
index 000000000..542afb9c1
--- /dev/null
+++ b/package/sane-backends/patches/patch-backend_sm3600-scanutil_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- sane-backends-1.0.20.orig/backend/sm3600-scanutil.c 2005-08-16 21:50:34.000000000 +0200
++++ sane-backends-1.0.20/backend/sm3600-scanutil.c 2009-05-11 21:08:46.000000000 +0200
+@@ -47,6 +47,7 @@ $Id: sm3600-scanutil.c,v 1.12 2005-08-16
+
+ ====================================================================== */
+
++#include <stdarg.h>
+ #include <unistd.h>
+ #include "sm3600-scantool.h"
+
diff --git a/package/sane-backends/patches/patch-backend_umax1220u-common_c b/package/sane-backends/patches/patch-backend_umax1220u-common_c
new file mode 100644
index 000000000..8889f7795
--- /dev/null
+++ b/package/sane-backends/patches/patch-backend_umax1220u-common_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- sane-backends-1.0.20.orig/backend/umax1220u-common.c 2006-04-17 14:46:41.000000000 +0200
++++ sane-backends-1.0.20/backend/umax1220u-common.c 2009-05-11 21:17:47.000000000 +0200
+@@ -556,7 +556,7 @@ cwritev (UMAX_Handle * scan, UMAX_Cmd cm
+ /* Read the opcode back */
+
+ CHK (cread (scan, cmd, len, buf, NULL));
+- if (bcmp (buf, data, len))
++ if (memcmp (buf, data, len))
+ {
+ DBG (1, "cwritev: verification failed\n");
+ return SANE_STATUS_IO_ERROR;
diff --git a/package/scanlogd/Config.in b/package/scanlogd/Config.in
new file mode 100644
index 000000000..f951672c7
--- /dev/null
+++ b/package/scanlogd/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_SCANLOGD
+ prompt "scanlogd.......................... a port scan detection tool"
+ tristate
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBNET
+ select ADK_PACKAGE_LIBNIDS
+ default n
+ help
+ Scanlogd is a TCP port scan detection tool, originally designed
+ to illustrate various attacks an IDS developer has to deal with.
+ Thus, unlike some of the other port scan detection tools out there,
+ scanlogd is designed to be totally safe to use.
+
+ http://www.openwall.com/scanlogd
diff --git a/package/scanlogd/Makefile b/package/scanlogd/Makefile
new file mode 100644
index 000000000..6747a82f9
--- /dev/null
+++ b/package/scanlogd/Makefile
@@ -0,0 +1,39 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= scanlogd
+PKG_VERSION:= 2.2.6
+PKG_RELEASE:= 8
+PKG_MD5SUM:= 7b8187ea718ebe47f22805b921b909ab
+MASTER_SITES:= http://www.openwall.com/scanlogd/ \
+ ftp://ftp.wiretapped.net/pub/openwall/ \
+ http://distro.ibiblio.org/pub/linux/distributions/openwall/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SCANLOGD,scanlogd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" LD="${TARGET_CC}" CFLAGS="-c ${TARGET_CFLAGS}" \
+ LDFLAGS= \
+ PCAP_H="-I${STAGING_DIR}/usr/include" \
+ NIDS_H="-I${STAGING_DIR}/usr/include" \
+ NIDS_L="-L${STAGING_DIR}/usr/lib -lnids -lnet -lpcap"
+ALL_TARGET:= libnids
+
+do-configure:
+ ${SED} "s,/var/empty,/tmp/.scanlogd," ${WRKBUILD}/params.h
+ ${SED} "s,#undef SCANLOGD_DEVICE,#define SCANLOGD_DEVICE \"all\"," ${WRKBUILD}/params.h
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SCANLOGD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_SCANLOGD}/usr/sbin
+ ${INSTALL_BIN} ./files/scanlogd.init \
+ ${IDIR_SCANLOGD}/etc/init.d/${PKG_NAME}
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_SCANLOGD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/scanlogd/files/scanlogd.init b/package/scanlogd/files/scanlogd.init
new file mode 100644
index 000000000..37285b348
--- /dev/null
+++ b/package/scanlogd/files/scanlogd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${scanlogd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ mkdir -p `grep "^scanlogd:" /etc/passwd | cut -d: -f6`
+ scanlogd $scanlogd_flags
+ ;;
+stop)
+ killall scanlogd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/scanlogd/ipkg/scanlogd.control b/package/scanlogd/ipkg/scanlogd.control
new file mode 100644
index 000000000..4156ff55c
--- /dev/null
+++ b/package/scanlogd/ipkg/scanlogd.control
@@ -0,0 +1,5 @@
+Package: scanlogd
+Priority: optional
+Section: net
+Description: Port scan logger.
+Depends: libpcap, libnet, libnids
diff --git a/package/scanlogd/ipkg/scanlogd.postinst b/package/scanlogd/ipkg/scanlogd.postinst
new file mode 100644
index 000000000..60b036da4
--- /dev/null
+++ b/package/scanlogd/ipkg/scanlogd.postinst
@@ -0,0 +1,36 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf scanlogd scanlogd NO
+
+
+name=scanlogd
+id=53
+
+# do not change below
+# check if we are on real system
+if [ -z "${IPKG_INSTROOT}" ]; then
+ # create copies of passwd and group, if we use squashfs
+ rootfs=`mount |awk '/root/ { print $5 }'`
+ if [ "$rootfs" = "squashfs" ]; then
+ if [ -h /etc/group ]; then
+ rm /etc/group
+ cp /rom/etc/group /etc/group
+ fi
+ if [ -h /etc/passwd ]; then
+ rm /etc/passwd
+ cp /rom/etc/passwd /etc/passwd
+ fi
+ fi
+fi
+
+echo ""
+if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/group)" ]; then
+ echo "adding group $name to /etc/group"
+ echo "${name}:x:${id}:" >> ${IPKG_INSTROOT}/etc/group
+fi
+
+if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/passwd)" ]; then
+ echo "adding user $name to /etc/passwd"
+ echo "${name}:x:${id}:${id}:${name}:/tmp/.${name}:/bin/false" >> ${IPKG_INSTROOT}/etc/passwd
+fi
+
diff --git a/package/scdp/Config.in b/package/scdp/Config.in
new file mode 100644
index 000000000..29bb50160
--- /dev/null
+++ b/package/scdp/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_SCDP
+ prompt "scdp.............................. An utility to send CDP (Cisco Discovery Protocol) packets"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNET
+ help
+ This program sends CDP (Cisco Discovery Protocol) packets out on
+ selected interfaces and tells the connected switch (cisco only)
+ where the host is connected.
+
+ http://sourceforge.net/projects/scdp
+
diff --git a/package/scdp/Makefile b/package/scdp/Makefile
new file mode 100644
index 000000000..7fcd2fc94
--- /dev/null
+++ b/package/scdp/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= scdp
+PKG_VERSION:= 1.0b
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7eafaf5a422e37d04715613993ed5d95
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=scdp/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SCDP,scdp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_path_libnet_config=${STAGING_DIR}/usr/bin
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SCDP}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/scdp ${IDIR_SCDP}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/scdp/ipkg/scdp.control b/package/scdp/ipkg/scdp.control
new file mode 100644
index 000000000..3cb61a061
--- /dev/null
+++ b/package/scdp/ipkg/scdp.control
@@ -0,0 +1,5 @@
+Package: scdp
+Priority: optional
+Section: net
+Depends: libnet
+Description: An utility to send CDP (Cisco Discovery Protocol) packets.
diff --git a/package/screen/Config.in b/package/screen/Config.in
new file mode 100644
index 000000000..86b4c6584
--- /dev/null
+++ b/package/screen/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_SCREEN
+ prompt "screen............................ Full-screen terminal window manager"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ Screen is a full-screen window manager that multiplexes a physical
+ terminal between several processes, typically interactive shells.
+
+ http://www.gnu.org/software/screen/
+
diff --git a/package/screen/Makefile b/package/screen/Makefile
new file mode 100644
index 000000000..e553a6d38
--- /dev/null
+++ b/package/screen/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= screen
+PKG_VERSION:= 4.0.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8506fd205028a96c741e4037de6e3c42
+MASTER_SITES:= ${MASTER_SITE_GNU:=screen/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SCREEN,screen,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= $(foreach flag,rename fchmod fchown strerror lstat _exit utimes vsnprintf getcwd setlocale strftime,ac_cv_func_${flag}=yes)
+CONFIGURE_ARGS+= --with-sys-screenrc=/etc/screenrc
+BUILD_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SCREEN}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/screen ${IDIR_SCREEN}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/screen/ipkg/screen.control b/package/screen/ipkg/screen.control
new file mode 100644
index 000000000..cb19298a8
--- /dev/null
+++ b/package/screen/ipkg/screen.control
@@ -0,0 +1,5 @@
+Package: screen
+Priority: optional
+Section: misc
+Depends: libncurses
+Description: A 'window manager' for the terminal session
diff --git a/package/screen/patches/patch-Makefile b/package/screen/patches/patch-Makefile
new file mode 100644
index 000000000..852a91342
--- /dev/null
+++ b/package/screen/patches/patch-Makefile
@@ -0,0 +1,336 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/Makefile 2006-10-23 15:06:32.000000000 +0200
++++ screen-4.0.3/Makefile 2008-12-08 04:54:09.000000000 +0100
+@@ -1,3 +1,331 @@
+-install all Makefiles and config:
++#
++# Makefile template for screen
++#
++# See machine dependant config.h for more configuration options.
++#
++
++srcdir = /home/wbx/openadk/build_x86/w-screen-4.0.3-1/screen-4.0.3
++VPATH = /home/wbx/openadk/build_x86/w-screen-4.0.3-1/screen-4.0.3
++
++DESTDIR =
++
++# Where to install screen.
++
++prefix = /usr
++exec_prefix = ${prefix}
++
++# don't forget to change mandir and infodir in doc/Makefile.
++bindir = $(exec_prefix)/bin
++
++VERSION = 4.0.3
++SCREEN = screen-$(VERSION)
++
++ETCSCREENRC = `sed < config.h -n -e '/define ETCSCREENRC/s/^.*"\([^"]*\)"/\1/p'`
++SCREENENCODINGS = `sed < config.h -n -e '/define SCREENENCODINGS/s/^.*"\([^"]*\)"/\1/p'`
++
++CC = /home/wbx/openadk/cross_x86/host/bin/i586-linux-uclibc-gcc
++CFLAGS = -fwrapv -fno-ident -Os -pipe -march=i586
++CPPFLAGS = -isystem /home/wbx/openadk/cross_x86/target/include -isystem /home/wbx/openadk/cross_x86/target/usr/include -DNDEBUG
++LDFLAGS = -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/home/wbx/openadk/cross_x86/target/usr/lib -L/home/wbx/openadk/cross_x86/target/lib -L/home/wbx/openadk/cross_x86/target/usr/lib
++LIBS = -lcurses -lutil -lcrypt
++
++CPP=/home/wbx/openadk/cross_x86/host/bin/i586-linux-uclibc-gcc -E
++CPP_DEPEND=$(CC) -MM
++
++INSTALL = /usr/bin/install -c
++INSTALL_PROGRAM = ${INSTALL}
++INSTALL_DATA = ${INSTALL} -m 644
++
++AWK = gawk
++
++### Chose some debug configuration options:
++# -DDEBUG
++# Turn on really heavy debug output. This is written to
++# /tmp/debug/{SCREEN,screen}.<pid>. Look at these files and quote
++# questionable sections when sending bug-reports to the author.
++# -DDUMPSHADOW
++# With shadow-pw screen would never dump core. Use this option if
++# you still want to have a core. Use only for debugging.
++OPTIONS=
++#OPTIONS= -DDEBUG
++
++SHELL=/bin/sh
++
++CFILES= screen.c ansi.c fileio.c mark.c misc.c resize.c socket.c \
++ search.c tty.c term.c window.c utmp.c loadav.c putenv.c help.c \
++ termcap.c input.c attacher.c pty.c process.c display.c comm.c \
++ kmapdef.c acls.c braille.c braille_tsi.c logfile.c layer.c \
++ sched.c teln.c nethack.c encoding.c
++OFILES= screen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \
++ search.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \
++ termcap.o input.o attacher.o pty.o process.o display.o comm.o \
++ kmapdef.o acls.o braille.o braille_tsi.o logfile.o layer.o \
++ sched.o teln.o nethack.o encoding.o
++
++all: screen
++
++screen: $(OFILES)
++ $(CC) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
++
++.c.o:
++ $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
++
++install_bin: .version screen
++ -if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
++ then mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi
++ $(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)
++ -chown root $(DESTDIR)$(bindir)/$(SCREEN) && chmod 4755 $(DESTDIR)$(bindir)/$(SCREEN)
++# This doesn't work if $(bindir)/screen is a symlink
++ -if [ -f $(DESTDIR)$(bindir)/screen ] && [ ! -f $(DESTDIR)$(bindir)/screen.old ]; then mv $(DESTDIR)$(bindir)/screen $(DESTDIR)$(bindir)/screen.old; fi
++ rm -f $(DESTDIR)$(bindir)/screen
++ (cd $(DESTDIR)$(bindir) && ln -sf $(SCREEN) screen)
++ cp $(srcdir)/utf8encodings/?? $(DESTDIR)$(SCREENENCODINGS)
++
++###############################################################################
++install: installdirs install_bin
++ cd doc ; $(MAKE) install
++ -if [ -d /usr/lib/terminfo ]; then \
++ PATH="$$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \
++ chmod 644 /usr/lib/terminfo/s/screen*; \
++ fi
++# Better do this by hand. E.g. under RCS...
++# cat ${srcdir}/terminfo/screencap >> /etc/termcap
++ @echo "termcap entry (${srcdir}/terminfo/screencap) should be installed manually."
++ @echo "You may also want to install $(srcdir)/etc/etcscreenrc in" $(ETCSCREENRC)
++
++installdirs:
++# Path leading to ETCSCREENRC and Socketdirectory not checked.
++ $(srcdir)/etc/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(SCREENENCODINGS)
++ cd doc ; $(MAKE) installdirs
++
++uninstall: .version
++ rm -f $(DESTDIR)$(bindir)/$(SCREEN)
++ rm -f $(DESTDIR)$(bindir)/screen
++ -mv $(DESTDIR)$(bindir)/screen.old $(DESTDIR)$(bindir)/screen
++ rm -f $(DESTDIR)$(ETCSCREENRC)
++ cd doc; $(MAKE) uninstall
++
++shadow:
++ mkdir shadow;
++ cd shadow; ln -s ../*.[ch] ../*.in ../*.sh ../configure ../doc ../terminfo ../etc .
++ rm -f shadow/term.h shadow/tty.c shadow/comm.h shadow/osdef.h
++ echo "install all Makefiles and config:" > shadow/Makefile
++ echo " rm -f config.cache" >> shadow/Makefile
++ echo " sh ./configure" >> shadow/Makefile
++
++term.h: term.c term.sh
++ AWK=$(AWK) srcdir=$(srcdir) sh $(srcdir)/term.sh
++
++kmapdef.c: term.h
++
++tty.c: tty.sh
++ sh $(srcdir)/tty.sh tty.c
++
++comm.h: comm.c comm.sh config.h
++ AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
++
++osdef.h: osdef.sh config.h osdef.h.in
++ CPP="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh $(srcdir)/osdef.sh
++
++docs:
++ cd doc; $(MAKE) dvi screen.info
++
++dvi info screen.info:
++ -cd doc; $(MAKE) $@
++
++mostlyclean:
++ rm -f $(OFILES) screen config.cache osdef0.c osdef1.sed osdef2.sed
++
++clean celan: mostlyclean
++ rm -f tty.c term.h comm.h osdef.h kmapdef.c core
++
++# Delete all files from the current directory that are created by
++# configuring or building the program.
++# building of term.h/comm.h requires awk. Keep it in the distribution
++# we keep config.h, as this file knows where 'make dist' finds the ETCSCREENRC.
++#distclean: mostlyclean
++# rm -f $(SCREEN).tar $(SCREEN).tar.gz
++# rm -f config.status Makefile
++# rm -f osdef.h doc/Makefile
++
++maintainer-clean:
++ @echo "This command is not even intended for maintainers to use;"
++ @echo "it deletes files that may require special tools to rebuild."
++
++
++# Delete everything from the current directory that can be
++# reconstructed with this Makefile.
++realclean: .version mostlyclean
++ rm -f $(SCREEN).tar $(SCREEN).tar.gz
++ rm -f config.status Makefile doc/Makefile
++ rm -f tty.c term.h comm.h osdef.h kmapdef.c
++ rm -f config.h
++ echo "install all Makefiles and config:" > Makefile
++ echo " sh ./configure" >> Makefile
++
++tags TAGS: $(CFILES)
++ -ctags *.sh $(CFILES) *.h
++ -ctags -e *.sh $(CFILES) *.h
++
++dist: .version $(SCREEN).tar.gz
++
++$(SCREEN).tar: .version term.h comm.h tty.c kmapdef.c
++ -rm -rf dist
++ mkdir dist
++ mkdir dist/$(SCREEN)
++ ln acls.h ansi.h display.h extern.h logfile.h mark.h os.h \
++ layer.h patchlevel.h screen.h window.h image.h \
++ osdef.h.in term.sh tty.sh comm.sh osdef.sh braille.h \
++ sched.h \
++ $(CFILES) \
++ ChangeLog COPYING INSTALL NEWS* TODO install.sh \
++ dist/$(SCREEN)
++ cd dist/$(SCREEN); mv tty.c tty.c.dist
++ cd dist/$(SCREEN); mv kmapdef.c kmapdef.c.dist
++ ln configure.in configure dist/$(SCREEN)
++ sed -e 's@"/local/screens@"/tmp/screens@' -e 's@"/local@"/usr/local@g' < config.h.in > dist/$(SCREEN)/config.h.in
++ sed -e 's@[ ]/local@ /usr/local@g' -e 's/^CFLAGS = -g/CFLAGS = -O/' < Makefile.in > dist/$(SCREEN)/Makefile.in
++ ln term.h dist/$(SCREEN)/term.h.dist
++ ln comm.h dist/$(SCREEN)/comm.h.dist
++ ln README dist/$(SCREEN)/README
++ mkdir dist/$(SCREEN)/terminfo
++ cd terminfo; ln 8bits README checktc.c screencap \
++ screeninfo.src test.txt tetris.c \
++ ../dist/$(SCREEN)/terminfo
++ mkdir dist/$(SCREEN)/etc
++ cd etc; ln * ../dist/$(SCREEN)/etc
++ mkdir dist/$(SCREEN)/utf8encodings
++ cd utf8encodings; ln * ../dist/$(SCREEN)/utf8encodings
++ # sed -e 's/^startup/#startup/' -e 's/^autodetach/#autodetach/' < $(ETCSCREENRC) > dist/$(SCREEN)/etc/etcscreenrc
++ cp $(HOME)/.screenrc dist/$(SCREEN)/etc/screenrc
++ mkdir dist/$(SCREEN)/doc
++ sed -e 's@/local/emacs@/usr/local@g' < doc/Makefile.in > dist/$(SCREEN)/doc/Makefile.in
++ cd doc; ln FAQ README.DOTSCREEN screen.1 screen.texinfo fdpat.ps make.help window_to_display.ps \
++ ../dist/$(SCREEN)/doc
++ cd doc; if test -f screen.info; then ln screen.info* \
++ ../dist/$(SCREEN)/doc; fi
++ cd dist/$(SCREEN)/doc; ln -s ../install.sh .
++ cd dist/$(SCREEN); ln -s doc/FAQ .
++ echo "install all Makefiles and config:" > dist/$(SCREEN)/Makefile
++ echo " rm -f config.cache" >> dist/$(SCREEN)/Makefile
++ echo " sh ./configure" >> dist/$(SCREEN)/Makefile
++ cd dist; tar cf ../$(SCREEN).tar $(SCREEN)
++ rm -rf dist
++
++$(SCREEN).tar.gz: $(SCREEN).tar
++ gzip -nf $(SCREEN).tar || gzip -f $(SCREEN).tar
++
++# Perform self-tests (if any).
++check:
++
++lint:
++ lint -I. $(CFILES)
++
++saber:
++ #load $(CFLAGS) screen.c ansi.c $(LIBS)
++
++config:
+ rm -f config.cache
+ sh ./configure
++
++
++###############################################################################
++
++.version:
++ @rev=`sed < $(srcdir)/patchlevel.h -n -e '/#define REV/s/#define REV *//p'`; \
++ vers=`sed < $(srcdir)/patchlevel.h -n -e '/#define VERS/s/#define VERS *//p'`; \
++ pat=`sed < $(srcdir)/patchlevel.h -n -e '/#define PATCHLEVEL/s/#define PATCHLEVEL *//p'`; \
++ if [ "$${rev}.$${vers}.$${pat}" != "$(VERSION)" ]; then \
++ echo "This distribution is screen-$${rev}.$${vers}.$${pat}, but"; \
++ echo "the Makefile is from $(VERSION). Please update!"; exit 1; fi
++
++###############################################################################
++
++mdepend: $(CFILES) term.h
++ @rm -f DEPEND ; \
++ for i in ${CFILES} ; do \
++ echo "$$i" ; \
++ echo `echo "$$i" | sed -e 's/.c$$/.o/'`": $$i" `\
++ cc -E $$i |\
++ grep '^# .*"\./.*\.h"' |\
++ (sort -t'"' -u -k 2,2 2>/dev/null || sort -t'"' -u +1 -2) |\
++ sed -e 's/.*"\.\/\(.*\)".*/\1/'\
++ ` >> DEPEND ; \
++ done
++
++
++depend: depend.in
++ ./config.status || ./configure
++
++depend.in: $(CFILES) term.h
++ cp Makefile.in Makefile.in~
++ sed -e '/\#\#\# Dependencies/q' < Makefile.in > tmp_make
++ for i in $(CFILES); do echo $$i; $(CPP_DEPEND) $$i >> tmp_make; done
++ mv tmp_make Makefile.in
++
++###############################################################################
++
++### Dependencies:
++screen.o: screen.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h braille.h \
++ patchlevel.h logfile.h extern.h
++ansi.o: ansi.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h braille.h extern.h \
++ logfile.h
++fileio.o: fileio.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++mark.o: mark.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h mark.h extern.h
++misc.o: misc.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++resize.o: resize.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++socket.o: socket.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++search.o: search.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h mark.h extern.h
++tty.o: tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
++ layer.h term.h image.h display.h window.h extern.h
++term.o: term.c term.h
++window.o: window.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
++utmp.o: utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++loadav.o: loadav.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++putenv.o: putenv.c config.h
++help.o: help.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++termcap.o: termcap.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++input.o: input.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++attacher.o: attacher.c config.h screen.h os.h osdef.h ansi.h \
++ acls.h comm.h layer.h term.h image.h display.h window.h extern.h
++pty.o: pty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
++ layer.h term.h image.h display.h window.h extern.h
++process.o: process.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
++display.o: display.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h braille.h
++comm.o: comm.c config.h acls.h comm.h
++kmapdef.o: kmapdef.c config.h
++acls.o: acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
++ layer.h term.h image.h display.h window.h extern.h
++braille.o: braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h braille.h
++braille_tsi.o: braille_tsi.c config.h screen.h os.h osdef.h ansi.h \
++ acls.h comm.h layer.h term.h image.h display.h window.h extern.h \
++ braille.h
++logfile.o: logfile.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
++layer.o: layer.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++sched.o: sched.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
++teln.o: teln.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++nethack.o: nethack.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
++encoding.o: encoding.c config.h screen.h os.h osdef.h ansi.h acls.h \
++ comm.h layer.h term.h image.h display.h window.h extern.h
diff --git a/package/screen/patches/patch-ansi_c b/package/screen/patches/patch-ansi_c
new file mode 100644
index 000000000..f6da58abe
--- /dev/null
+++ b/package/screen/patches/patch-ansi_c
@@ -0,0 +1,32 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/ansi.c 2003-12-05 14:57:05.000000000 +0100
++++ screen-4.0.3/ansi.c 2008-12-08 04:59:17.000000000 +0100
+@@ -1462,7 +1462,7 @@ StringEnd()
+ switch (curr->w_StringType)
+ {
+ case OSC: /* special xterm compatibility hack */
+- if (curr->w_string[0] == ';' || (p = index(curr->w_string, ';')) == 0)
++ if (curr->w_string[0] == ';' || (p = strchr(curr->w_string, ';')) == 0)
+ break;
+ typ = atoi(curr->w_string);
+ p++;
+@@ -2803,15 +2803,15 @@ int ys, ye;
+ debug2("MFindUsedLine: %d %d\n", ye, ys);
+ for (y = ye; y >= ys; y--, ml--)
+ {
+- if (bcmp((char*)ml->image, blank, p->w_width))
++ if (memcmp((char*)ml->image, blank, p->w_width))
+ break;
+- if (ml->attr != null && bcmp((char*)ml->attr, null, p->w_width))
++ if (ml->attr != null && memcmp((char*)ml->attr, null, p->w_width))
+ break;
+ #ifdef COLOR
+- if (ml->color != null && bcmp((char*)ml->color, null, p->w_width))
++ if (ml->color != null && memcmp((char*)ml->color, null, p->w_width))
+ break;
+ # ifdef COLORS256
+- if (ml->colorx != null && bcmp((char*)ml->colorx, null, p->w_width))
++ if (ml->colorx != null && memcmp((char*)ml->colorx, null, p->w_width))
+ break;
+ # endif
+ #endif
diff --git a/package/screen/patches/patch-attacher_c b/package/screen/patches/patch-attacher_c
new file mode 100644
index 000000000..34e9a0deb
--- /dev/null
+++ b/package/screen/patches/patch-attacher_c
@@ -0,0 +1,15 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/attacher.c 2003-09-08 16:24:48.000000000 +0200
++++ screen-4.0.3/attacher.c 2008-10-08 14:09:31.000000000 +0200
+@@ -849,9 +849,9 @@ screen_builtin_lck()
+ strncpy(fullname, ppp->pw_gecos, sizeof(fullname) - 9);
+ fullname[sizeof(fullname) - 9] = 0;
+
+- if ((cp1 = index(fullname, ',')) != NULL)
++ if ((cp1 = strchr(fullname, ',')) != NULL)
+ *cp1 = '\0';
+- if ((cp1 = index(fullname, '&')) != NULL)
++ if ((cp1 = strchr(fullname, '&')) != NULL)
+ {
+ strncpy(cp1, ppp->pw_name, 8);
+ cp1[8] = 0;
diff --git a/package/screen/patches/patch-configure b/package/screen/patches/patch-configure
new file mode 100644
index 000000000..21ae13053
--- /dev/null
+++ b/package/screen/patches/patch-configure
@@ -0,0 +1,490 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/configure 2003-12-05 14:46:53.000000000 +0100
++++ screen-4.0.3/configure 2008-10-08 13:33:43.000000000 +0200
+@@ -124,7 +124,7 @@ done
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ case $CONFIG_SHELL in
+ '')
+@@ -174,7 +174,7 @@ done
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+- { (exit 1); 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
+@@ -397,7 +397,7 @@ do
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+- { (exit 1); exit 1; }; }
++ }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+@@ -406,7 +406,7 @@ do
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+- { (exit 1); exit 1; }; }
++ }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+@@ -588,7 +588,7 @@ do
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+- { (exit 1); exit 1; }; }
++ }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+@@ -601,7 +601,7 @@ do
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+- { (exit 1); exit 1; }; }
++ }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+@@ -625,7 +625,7 @@ do
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+ Try \`$0 --help' for more information." >&2
+- { (exit 1); exit 1; }; }
++ }
+ ;;
+
+ *=*)
+@@ -633,7 +633,7 @@ Try \`$0 --help' for more information."
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+- { (exit 1); exit 1; }; }
++ }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+@@ -652,7 +652,7 @@ done
+ if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+- { (exit 1); exit 1; }; }
++ }
+ fi
+
+ # Be sure to have absolute paths.
+@@ -662,7 +662,7 @@ do
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+- { (exit 1); exit 1; }; };;
++ };;
+ esac
+ done
+
+@@ -674,7 +674,7 @@ do
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+- { (exit 1); exit 1; }; };;
++ };;
+ esac
+ done
+
+@@ -728,15 +728,15 @@ fi
+ if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+- { (exit 1); exit 1; }; }
++ }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ fi
+ (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+- { (exit 1); exit 1; }; }
++ }
+ srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ ac_env_build_alias_set=${build_alias+set}
+ ac_env_build_alias_value=$build_alias
+@@ -1243,7 +1243,7 @@ if $ac_cache_corrupted; then
+ echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+
+ ac_ext=c
+@@ -1734,7 +1734,7 @@ test -z "$CC" && { { echo "$as_me:$LINEN
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: no acceptable C compiler found in \$PATH
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+
+ # Provide some information about the compiler.
+ echo "$as_me:$LINENO:" \
+@@ -1856,7 +1856,7 @@ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run C compiled programs.
+ If you meant to cross compile, use \`--host'.
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ fi
+ fi
+@@ -1898,7 +1898,7 @@ else
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+
+ rm -f conftest$ac_cv_exeext
+@@ -1950,7 +1950,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot compute suffix of object files: cannot compile
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+
+ rm -f conftest.$ac_cv_objext conftest.$ac_ext
+@@ -2514,7 +2514,7 @@ else
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+
+ ac_ext=c
+@@ -2704,7 +2704,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -2753,7 +2753,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -2790,7 +2790,7 @@ echo "$ac_compile" 1>&6
+
+ { { echo "$as_me:$LINENO: error: Can't run the compiler - sorry" >&5
+ echo "$as_me: error: Can't run the compiler - sorry" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+@@ -2800,7 +2800,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -2830,7 +2830,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
+ (exit $ac_status); }; }; then
+ { { echo "$as_me:$LINENO: error: Your compiler does not set the exit status - sorry" >&5
+ echo "$as_me: error: Your compiler does not set the exit status - sorry" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ echo "$as_me: program exited with status $ac_status" >&5
+ echo "$as_me: failed program was:" >&5
+@@ -2900,7 +2900,7 @@ done
+ if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+ echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+@@ -4149,7 +4149,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+
+ { { echo "$as_me:$LINENO: error: !!! no select - no screen" >&5
+ echo "$as_me: error: !!! no select - no screen" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+@@ -4163,7 +4163,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -4272,7 +4272,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -4365,7 +4365,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -4460,7 +4460,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -4562,7 +4562,7 @@ elif test -n "$sock"; then
+ else
+ { { echo "$as_me:$LINENO: error: you have neither usable sockets nor usable pipes -> no screen" >&5
+ echo "$as_me: error: you have neither usable sockets nor usable pipes -> no screen" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+
+
+@@ -4573,7 +4573,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -4898,7 +4898,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+
+ { { echo "$as_me:$LINENO: error: !!! no tgetent - no screen" >&5
+ echo "$as_me: error: !!! no tgetent - no screen" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+@@ -4915,7 +4915,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -5359,7 +5359,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -6206,7 +6206,7 @@ echo "$as_me: checking for avenrun symbo
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -6482,7 +6482,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -6598,8 +6598,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ LIBS="$oldlibs"
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+-test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
+-test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lsun"
+ { echo "$as_me:$LINENO: checking IRIX sun library..." >&5
+@@ -7004,7 +7002,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -7056,7 +7054,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -7110,7 +7108,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -7951,7 +7949,7 @@ if test "$cross_compiling" = yes; then
+ See \`config.log' for more details." >&5
+ echo "$as_me: error: cannot run test program while cross compiling
+ See \`config.log' for more details." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+@@ -7982,7 +7980,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ ( exit $ac_status )
+ { { echo "$as_me:$LINENO: error: Can't run the compiler - internal error. Sorry." >&5
+ echo "$as_me: error: Can't run the compiler - internal error. Sorry." >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+@@ -8251,7 +8249,7 @@ done
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+ echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi
+ case $CONFIG_SHELL in
+ '')
+@@ -8302,7 +8300,7 @@ done
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+- { (exit 1); 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
+@@ -8494,7 +8492,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF
+ Try \`$0 --help' for more information." >&5
+ echo "$as_me: error: ambiguous option: $1
+ Try \`$0 --help' for more information." >&2;}
+- { (exit 1); exit 1; }; };;
++ };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+@@ -8516,7 +8514,7 @@ Try \`$0 --help' for more information."
+ Try \`$0 --help' for more information." >&5
+ echo "$as_me: error: unrecognized option: $1
+ Try \`$0 --help' for more information." >&2;}
+- { (exit 1); exit 1; }; } ;;
++ } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+@@ -8555,7 +8553,7 @@ do
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+ echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+- { (exit 1); exit 1; }; };;
++ };;
+ esac
+ done
+
+@@ -8750,7 +8748,7 @@ echo X"$as_dir" |
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+- { (exit 1); exit 1; }; }; }
++ }; }
+
+ ac_builddir=.
+
+@@ -8816,7 +8814,7 @@ echo "$as_me: creating $ac_file" >&6;}
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+@@ -8829,7 +8827,7 @@ echo "$as_me: error: cannot find input f
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+@@ -8907,7 +8905,7 @@ echo "$as_me: creating $ac_file" >&6;}
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+@@ -8920,7 +8918,7 @@ echo "$as_me: error: cannot find input f
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+- { (exit 1); exit 1; }; }
++ }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+@@ -9073,7 +9071,7 @@ echo X"$as_dir" |
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+- { (exit 1); exit 1; }; }; }
++ }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
diff --git a/package/screen/patches/patch-fileio_c b/package/screen/patches/patch-fileio_c
new file mode 100644
index 000000000..c86914c10
--- /dev/null
+++ b/package/screen/patches/patch-fileio_c
@@ -0,0 +1,39 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/fileio.c 2003-09-08 16:25:28.000000000 +0200
++++ screen-4.0.3/fileio.c 2008-10-08 14:07:52.000000000 +0200
+@@ -96,7 +96,7 @@ char *rcfile;
+
+ if (rcfile)
+ {
+- char *rcend = rindex(rc_name, '/');
++ char *rcend = strrchr(rc_name, '/');
+ if (*rcfile != '/' && rcend && (rcend - rc_name) + strlen(rcfile) + 2 < sizeof(buf))
+ {
+ strncpy(buf, rc_name, rcend - rc_name + 1);
+@@ -169,7 +169,7 @@ char *rcfilename;
+ }
+ while (fgets(buf, sizeof buf, fp) != NULL)
+ {
+- if ((p = rindex(buf, '\n')) != NULL)
++ if ((p = strrchr(buf, '\n')) != NULL)
+ *p = '\0';
+ if ((argc = Parse(buf, sizeof buf, args, argl)) == 0)
+ continue;
+@@ -216,7 +216,7 @@ char *rcfilename;
+ }
+ for (p = args[1]; p && *p; p = cp)
+ {
+- if ((cp = index(p, '|')) != 0)
++ if ((cp = strchr(p, '|')) != 0)
+ *cp++ = '\0';
+ len = strlen(p);
+ if (p[len - 1] == '*')
+@@ -501,7 +501,7 @@ int dump;
+ }
+ break;
+ case DUMP_TERMCAP:
+- if ((p = index(MakeTermcap(fore->w_aflag), '=')) != NULL)
++ if ((p = strchr(MakeTermcap(fore->w_aflag), '=')) != NULL)
+ {
+ fputs(++p, f);
+ putc('\n', f);
diff --git a/package/screen/patches/patch-help_c b/package/screen/patches/patch-help_c
new file mode 100644
index 000000000..8b997c7de
--- /dev/null
+++ b/package/screen/patches/patch-help_c
@@ -0,0 +1,15 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/help.c 2003-09-08 16:25:33.000000000 +0200
++++ screen-4.0.3/help.c 2008-10-08 14:08:53.000000000 +0200
+@@ -386,9 +386,9 @@ int x, y;
+ del = 0;
+ bp = buf;
+ ll = *lp++;
+- if (!ll || (index(cp, ' ') != NULL))
++ if (!ll || (strchr(cp, ' ') != NULL))
+ {
+- if (index(cp, '\'') != NULL)
++ if (strchr(cp, '\'') != NULL)
+ *bp++ = del = '"';
+ else
+ *bp++ = del = '\'';
diff --git a/package/screen/patches/patch-process_c b/package/screen/patches/patch-process_c
new file mode 100644
index 000000000..0260ead1f
--- /dev/null
+++ b/package/screen/patches/patch-process_c
@@ -0,0 +1,39 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/process.c 2003-09-18 14:53:54.000000000 +0200
++++ screen-4.0.3/process.c 2008-12-08 04:59:51.000000000 +0100
+@@ -728,7 +728,7 @@ int ilen;
+ if (D_seqp[l] != l)
+ {
+ q = D_seqp + 1 + l;
+- if (D_kmaps + D_nseqs > q && q[2] > l && !bcmp(D_seqp - l, q + 3, l))
++ if (D_kmaps + D_nseqs > q && q[2] > l && !memcmp(D_seqp - l, q + 3, l))
+ {
+ debug1("have another mapping (%s), delay execution\n", q + 3);
+ D_seqh = D_seqp - 3 - l;
+@@ -2867,7 +2867,7 @@ int key;
+ s = 0;
+ if (ParseSaveStr(act, &s))
+ break;
+- if (!*s || strlen(s) + (SockName - SockPath) > MAXPATHLEN - 13 || index(s, '/'))
++ if (!*s || strlen(s) + (SockName - SockPath) > MAXPATHLEN - 13 || strchr(s, '/'))
+ {
+ Msg(0, "%s: bad session name '%s'\n", rc_name, s);
+ free(s);
+@@ -3109,7 +3109,7 @@ int key;
+ break;
+ }
+ else
+- if (*argl == (kme->fl & ~KMAP_NOTIMEOUT) && bcmp(kme->str, *args, *argl) == 0)
++ if (*argl == (kme->fl & ~KMAP_NOTIMEOUT) && memcmp(kme->str, *args, *argl) == 0)
+ break;
+ if (i == kmap_extn)
+ {
+@@ -4387,7 +4387,7 @@ int base, psize;
+ char *s, *p;
+ {
+ char *q;
+- if ((q = rindex(s, ':')) != 0)
++ if ((q = strrchr(s, ':')) != 0)
+ {
+ strncpy(p, q + 1, psize - 1);
+ p[psize - 1] = '\0';
diff --git a/package/screen/patches/patch-pty_c b/package/screen/patches/patch-pty_c
new file mode 100644
index 000000000..038b4b283
--- /dev/null
+++ b/package/screen/patches/patch-pty_c
@@ -0,0 +1,16 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/pty.c 2003-09-08 16:26:18.000000000 +0200
++++ screen-4.0.3/pty.c 2008-10-08 13:33:43.000000000 +0200
+@@ -34,9 +34,9 @@
+ #endif
+
+ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
+-#ifdef HAVE_SVR4_PTYS
+-# include <sys/stropts.h>
+-#endif
++//#ifdef HAVE_SVR4_PTYS
++//# include <sys/stropts.h>
++//#endif
+
+ #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
+ # include <sys/ttold.h>
diff --git a/package/screen/patches/patch-sched_h b/package/screen/patches/patch-sched_h
new file mode 100644
index 000000000..2c632d6ca
--- /dev/null
+++ b/package/screen/patches/patch-sched_h
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/sched.h 2002-01-08 16:42:43.000000000 +0100
++++ screen-4.0.3/sched.h 2008-10-08 13:33:43.000000000 +0200
+@@ -22,6 +22,11 @@
+ * $Id: sched.h,v 1.1.1.1 1993/06/16 23:51:13 jnweiger Exp $ FAU
+ */
+
++#ifndef __SCHED_H
++#define __SCHED_H
++
++#include <sys/time.h>
++
+ struct event
+ {
+ struct event *next;
+@@ -41,3 +46,5 @@ struct event
+ #define EV_READ 1
+ #define EV_WRITE 2
+ #define EV_ALWAYS 3
++
++#endif
diff --git a/package/screen/patches/patch-screen_c b/package/screen/patches/patch-screen_c
new file mode 100644
index 000000000..c9a3da349
--- /dev/null
+++ b/package/screen/patches/patch-screen_c
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/screen.c 2003-09-08 16:26:41.000000000 +0200
++++ screen-4.0.3/screen.c 2008-10-08 14:06:53.000000000 +0200
+@@ -819,7 +819,7 @@ char **av;
+
+ #ifdef MULTIUSER
+ own_uid = multi_uid = real_uid;
+- if (SockMatch && (sockp = index(SockMatch, '/')))
++ if (SockMatch && (sockp = strchr(SockMatch, '/')))
+ {
+ if (eff_uid)
+ Panic(0, "Must run suid root for multiuser support.");
+@@ -1025,7 +1025,7 @@ char **av;
+ }
+ if ((st.st_mode & 0777) != 0700)
+ Panic(0, "Directory %s must have mode 700.", SockPath);
+- if (SockMatch && index(SockMatch, '/'))
++ if (SockMatch && strchr(SockMatch, '/'))
+ Panic(0, "Bad session name '%s'", SockMatch);
+ SockName = SockPath + strlen(SockPath) + 1;
+ *SockName = 0;
+@@ -1041,7 +1041,7 @@ char **av;
+ (void) gethostname(HostName, MAXSTR);
+ HostName[MAXSTR - 1] = '\0';
+ #endif
+- if ((ap = index(HostName, '.')) != NULL)
++ if ((ap = strchr(HostName, '.')) != NULL)
+ *ap = '\0';
+
+ if (lsflag)
diff --git a/package/screen/patches/patch-termcap_c b/package/screen/patches/patch-termcap_c
new file mode 100644
index 000000000..3dc7d60bf
--- /dev/null
+++ b/package/screen/patches/patch-termcap_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/termcap.c 2003-09-08 16:45:36.000000000 +0200
++++ screen-4.0.3/termcap.c 2008-10-08 14:09:15.000000000 +0200
+@@ -940,7 +940,7 @@ int aflag;
+ debug1("MakeTermcap decided '%s'\n", p);
+ if (extra_outcap && *extra_outcap)
+ {
+- for (cp = extra_outcap; (p = index(cp, ':')); cp = p)
++ for (cp = extra_outcap; (p = strchr(cp, ':')); cp = p)
+ {
+ ch = *++p;
+ *p = '\0';
diff --git a/package/screen/patches/patch-tty_sh b/package/screen/patches/patch-tty_sh
new file mode 100644
index 000000000..b14b2f9ac
--- /dev/null
+++ b/package/screen/patches/patch-tty_sh
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/tty.sh 2003-09-08 16:24:25.000000000 +0200
++++ screen-4.0.3/tty.sh 2008-10-08 14:13:39.000000000 +0200
+@@ -659,7 +659,7 @@ char *opt;
+
+ while (*opt)
+ {
+- while (index(sep, *opt)) opt++;
++ while (strchr(sep, *opt)) opt++;
+ if (*opt >= '0' && *opt <= '9')
+ {
+ if (SetBaud(m, atoi(opt), atoi(opt)))
+@@ -745,7 +745,7 @@ char *opt;
+ }
+ else
+ return -1;
+- while (*opt && !index(sep, *opt)) opt++;
++ while (*opt && !strchr(sep, *opt)) opt++;
+ }
+ return 0;
+ }
diff --git a/package/screen/patches/patch-utmp_c b/package/screen/patches/patch-utmp_c
new file mode 100644
index 000000000..4beebc274
--- /dev/null
+++ b/package/screen/patches/patch-utmp_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/utmp.c 2003-09-08 16:27:17.000000000 +0200
++++ screen-4.0.3/utmp.c 2008-12-08 04:59:38.000000000 +0100
+@@ -422,7 +422,7 @@ struct win *wi;
+ debug2("SetUtmp %d will get slot %d...\n", wi->w_number, (int)slot);
+
+ bzero((char *)&u, sizeof(u));
+- if ((saved_ut = bcmp((char *) &wi->w_savut, (char *)&u, sizeof(u))))
++ if ((saved_ut = memcmp((char *) &wi->w_savut, (char *)&u, sizeof(u))))
+ /* restore original, of which we will adopt all fields but ut_host */
+ bcopy((char *)&wi->w_savut, (char *) &u, sizeof(u));
+
diff --git a/package/screen/patches/patch-window_c b/package/screen/patches/patch-window_c
new file mode 100644
index 000000000..daad39ee3
--- /dev/null
+++ b/package/screen/patches/patch-window_c
@@ -0,0 +1,33 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- screen-4.0.3.orig/window.c 2003-12-05 14:45:41.000000000 +0100
++++ screen-4.0.3/window.c 2008-10-08 14:08:40.000000000 +0200
+@@ -643,7 +643,7 @@ struct NewWindow *newwin;
+ if (!nwin.aka)
+ nwin.aka = Filename(nwin.args[0]);
+ strncpy(p->w_akabuf, nwin.aka, sizeof(p->w_akabuf) - 1);
+- if ((nwin.aka = rindex(p->w_akabuf, '|')) != NULL)
++ if ((nwin.aka = strrchr(p->w_akabuf, '|')) != NULL)
+ {
+ p->w_autoaka = 0;
+ *nwin.aka++ = 0;
+@@ -1356,9 +1356,9 @@ char **args, *ttyn;
+ debug2("Makewindow %d with %s\n", win->w_number, tebuf);
+ tl = strlen(win->w_term);
+ NewEnv[1] = tebuf;
+- if ((s1 = index(NewEnv[2], '|')))
++ if ((s1 = strchr(NewEnv[2], '|')))
+ {
+- if ((s2 = index(++s1, '|')))
++ if ((s2 = strchr(++s1, '|')))
+ {
+ if (strlen(NewEnv[2]) - (s2 - s1) + tl < 1024)
+ {
+@@ -1396,7 +1396,7 @@ char *prog, **args, **env;
+ char *shargs[MAXARGS + 1];
+ register int i, eaccess = 0;
+
+- if (rindex(prog, '/'))
++ if (strrchr(prog, '/'))
+ path = "";
+ if (!path && !(path = getenv("PATH")))
+ path = DefaultPath;
diff --git a/package/scrnsaverproto/Config.in b/package/scrnsaverproto/Config.in
new file mode 100644
index 000000000..0a28dd127
--- /dev/null
+++ b/package/scrnsaverproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_SCRNSAVERPROTO
+ prompt "scrnsaverproto............................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/scrnsaverproto/Makefile b/package/scrnsaverproto/Makefile
new file mode 100644
index 000000000..dedd0aab0
--- /dev/null
+++ b/package/scrnsaverproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= scrnsaverproto
+PKG_VERSION:= 1.1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 616ae17acad2b6033c981b8b526d5e67
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/scsi-spin/Config.in b/package/scsi-spin/Config.in
new file mode 100644
index 000000000..89489e991
--- /dev/null
+++ b/package/scsi-spin/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_SCSI_SPIN
+ prompt "scsi-spin......................... Utility to spin down scsi disks"
+ tristate
+ default n
+ help
+ Utility to spin down scsi disks
+
+ This program is part of debian's scsitools package
+
diff --git a/package/scsi-spin/Makefile b/package/scsi-spin/Makefile
new file mode 100644
index 000000000..1cba620ad
--- /dev/null
+++ b/package/scsi-spin/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= scsi-spin
+PKG_VERSION:= 1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d0c32bfc500e94cc1905d9457a99cdbb
+NO_DISTFILES:= 1
+
+WRKDIST= ${WRKDIR}/scsi-spin
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SCSI_SPIN,scsi-spin,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${TCFLAGS} -o ${WRKBUILD}/scsi-spin files/scsi-spin.c
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SCSI_SPIN}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/scsi-spin ${IDIR_SCSI_SPIN}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/scsi-spin/files/scsi-spin.c b/package/scsi-spin/files/scsi-spin.c
new file mode 100644
index 000000000..443934c78
--- /dev/null
+++ b/package/scsi-spin/files/scsi-spin.c
@@ -0,0 +1,420 @@
+/*
+ File: scsi-spin.c
+
+ A simple program to manually spin up and down a scsi device.
+
+ Copyright 1998 Rob Browning <rlb@cs.utexas.edu>
+ Copyright 2001 Eric Delaunay <delaunay@debian.org>
+
+ This source is covered by the terms the GNU Public License.
+
+ Some of the original code came from
+ The Linux SCSI programming HOWTO
+ Heiko Ei<DF>feldt heiko@colossus.escape.de
+ v1.5, 7 May 1996
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <mntent.h>
+#include <sys/ioctl.h>
+#include <scsi/sg.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_ioctl.h>
+
+#include <linux/major.h>
+#include <sys/sysmacros.h>
+#include <sys/stat.h>
+
+#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \
+ ((M) >= SCSI_DISK1_MAJOR && \
+ (M) <= SCSI_DISK7_MAJOR) || \
+ ((M) >= SCSI_DISK8_MAJOR && \
+ (M) <= SCSI_DISK15_MAJOR))
+
+#define SCSI_BLK_MAJOR(M) \
+ (SCSI_DISK_MAJOR(M) || \
+ (M) == SCSI_CDROM_MAJOR)
+
+/* define USE_SG_IO to send commands using scsi generic interface
+ */
+#define USE_SG_IO
+
+#ifdef USE_SG_IO
+int opt_oldioctl = 0;
+int opt_verbose = 0;
+
+const char* SENSE_KEY_STR[16] = {
+ "NO SENSE",
+ "RECOVERED ERROR",
+ "NOT READY",
+ "MEDIUM ERROR",
+ "HARDWARE ERROR",
+ "ILLEGAL REQUEST",
+ "UNIT ATTENTION",
+ "DATA PROJECT",
+ "BLANK CHECK",
+ "VENDOR-SPECIFIC",
+ "COPY ARBORTED",
+ "ABORTED COMMAND",
+ "EQUAL",
+ "VOLUME OVERFLOW",
+ "MISCOMPARED",
+ "RESERVED"
+};
+
+/* process a complete SCSI cmd. Use the generic SCSI interface. */
+static int handle_SCSI_cmd(const int fd,
+ const unsigned cmd_len, /* command length */
+ unsigned char *cmd, /* command buffer */
+ const unsigned in_size, /* input data size */
+ const unsigned out_size, /* output data size */
+ unsigned char *io_buff, /* i/o buffer */
+ unsigned sense_size, /* sense buf length */
+ unsigned char* sense_buff, /* sense buffer */
+ const unsigned timeout /* timeout in s */
+ ) {
+ ssize_t status = 0;
+ int k, err;
+ sg_io_hdr_t sg_hdr;
+ unsigned char sense[16];
+
+ /* safety checks */
+ if (!cmd_len) return -1; /* need a cmd_len != 0 */
+ if (in_size > 0 && io_buff == NULL) return -1; /* need an input buffer != NULL */
+ /* generic SCSI device header construction */
+ memset(&sg_hdr, 0, sizeof(sg_hdr));
+ sg_hdr.interface_id = 'S';
+ sg_hdr.dxfer_direction = SG_DXFER_NONE;
+ sg_hdr.cmd_len = cmd_len;
+ sg_hdr.cmdp = cmd;
+ sg_hdr.dxfer_len = in_size;
+ sg_hdr.dxferp = io_buff;
+ sg_hdr.timeout = (timeout ? timeout : 2)*1000; /* timeout in ms */
+ if (sense_buff == NULL) {
+ sense_buff = sense;
+ sense_size = sizeof(sense);
+ }
+ sg_hdr.mx_sb_len = sense_size;
+ sg_hdr.sbp = sense_buff;
+
+ if (opt_verbose > 1) {
+ fprintf( stderr, " cmd = " );
+ for( k = 0 ; k < cmd_len ; k++ )
+ fprintf( stderr, " %02x", cmd[k] );
+ fputc( '\n', stderr );
+ }
+ /* send command */
+ status = ioctl( fd, SG_IO, &sg_hdr );
+ if (status < 0 || sg_hdr.masked_status == CHECK_CONDITION) {
+ /* some error happened */
+ fprintf( stderr, "SG_IO: status = 0x%x cmd = 0x%x\n",
+ sg_hdr.status, cmd[0] );
+ if (opt_verbose > 0) {
+ fprintf( stderr, " sense = " );
+ for( k = 0 ; k < sg_hdr.sb_len_wr ; k++ )
+ fprintf( stderr, " %02x", sense_buff[k] );
+ fputc( '\n', stderr );
+ err = sense_buff[0] & 0x7f;
+ if (err == 0x70 || err == 0x71) {
+ fprintf( stderr, " (%s)\n", SENSE_KEY_STR[sense_buff[2] & 0xf] );
+ }
+ }
+ perror("");
+ }
+ return status; /* 0 means no error */
+}
+#endif
+
+static void
+scsi_spin(const int fd, const int desired_state, const int load_eject, const int wait) {
+#ifdef USE_SG_IO
+ if (! opt_oldioctl) {
+ unsigned char cmdblk [6] =
+ { START_STOP, /* command */
+ (wait ? 0 : 1), /* lun(3 bits)/reserved(4 bits)/immed(1 bit) */
+ 0, /* reserved */
+ 0, /* reserved */
+ (load_eject ? 2 : 0)
+ | (desired_state ? 1 : 0), /* reserved(6)/LoEj(1)/Start(1)*/
+ 0 };/* reserved/flag/link */
+
+ if (handle_SCSI_cmd(fd, sizeof(cmdblk), cmdblk, 0, 0, NULL, 0, NULL, wait)) {
+ fprintf( stderr, "start/stop failed\n" );
+ exit(2);
+ }
+ return;
+ }
+#endif
+ int ret;
+ if (desired_state != 0)
+ ret = ioctl( fd, SCSI_IOCTL_START_UNIT );
+ else
+ ret = ioctl( fd, SCSI_IOCTL_STOP_UNIT );
+ if (ret < 0)
+ perror( "scsi_spin: ioctl" );
+}
+
+static void
+scsi_lock(const int fd, const int door_lock) {
+#ifdef USE_SG_IO
+ if (! opt_oldioctl) {
+ unsigned char cmdblk [6] =
+ { ALLOW_MEDIUM_REMOVAL, /* command */
+ 0, /* lun(3 bits)/reserved(5 bits) */
+ 0, /* reserved */
+ 0, /* reserved */
+ (door_lock ? 1 : 0), /* reserved(7)/Prevent(1)*/
+ 0 };/* control */
+
+ if (handle_SCSI_cmd(fd, sizeof(cmdblk), cmdblk, 0, 0, NULL, 0, NULL, 2)) {
+ fprintf( stderr, "lock/unlock failed\n" );
+ exit(2);
+ }
+ return;
+ }
+#endif
+ int ret;
+ if (door_lock != 0)
+ ret = ioctl( fd, SCSI_IOCTL_DOORLOCK );
+ else
+ ret = ioctl( fd, SCSI_IOCTL_DOORUNLOCK );
+ if (ret < 0)
+ perror( "scsi_lock: ioctl" );
+}
+
+/* -- [ED] --
+ * Check if the device has some of its partitions mounted.
+ * The check is done by comparison between device major and minor numbers so it
+ * even works when the device name of the mount point is not the same of the
+ * one passed to scsi-spin (for example, scsidev creates device aliases under
+ * /dev/scsi).
+ */
+static int
+is_mounted( const char* device, int use_proc, int devmaj, int devmin )
+{
+ struct mntent *mnt;
+ struct stat devstat;
+ int mounted = 0;
+ struct {
+ __uint32_t dev_id;
+ __uint32_t host_unique_id;
+ } scsi_dev_id, scsi_id;
+ FILE *mtab;
+ char *mtabfile = use_proc ? "/proc/mounts" : "/etc/mtab";
+
+ if (devmaj == SCSI_GENERIC_MAJOR) {
+ /* scsi-spin device arg is /dev/sgN */
+ int fd = open( device, O_RDONLY );
+ if (fd >= 0) {
+ int ret = ioctl( fd, SCSI_IOCTL_GET_IDLUN, &scsi_dev_id );
+ close( fd );
+ if (ret < 0)
+ return -1;
+ }
+ }
+ /*printf("devid=%x\n",scsi_dev_id.dev_id);*/
+
+ mtab = setmntent( mtabfile, "r" );
+ if (mtab == NULL)
+ return -1;
+
+ while ((mnt = getmntent( mtab )) != 0) {
+ char * mdev = mnt->mnt_fsname;
+ if (stat( mdev, &devstat ) == 0) {
+ int maj = major(devstat.st_rdev);
+ int min = minor(devstat.st_rdev);
+ if (SCSI_DISK_MAJOR(maj) && SCSI_DISK_MAJOR(devmaj)) {
+ if (maj == devmaj && (min & ~15) == (devmin & ~15)) {
+ mounted = 1;
+ break;
+ }
+ }
+ else if (devmaj == SCSI_GENERIC_MAJOR && SCSI_BLK_MAJOR(maj)) {
+ /* scsi-spin device arg is /dev/sgN */
+ int fd = open( mdev, O_RDONLY );
+ if (fd >= 0) {
+ int ret = ioctl( fd, SCSI_IOCTL_GET_IDLUN, &scsi_id );
+ close( fd );
+ /*printf("id=%x\n",scsi_id.dev_id);*/
+ if (ret == 0 && scsi_id.dev_id == scsi_dev_id.dev_id) {
+ /* same SCSI ID => same device */
+ mounted = 1;
+ break;
+ }
+ }
+ }
+ else if (maj == SCSI_CDROM_MAJOR && maj == devmaj && min == devmin) {
+ mounted = 1;
+ break;
+ }
+ }
+ }
+
+ endmntent( mtab );
+ return mounted;
+}
+
+static void
+usage()
+{
+ static char usage_string[] =
+ "usage: scsi-spin {-u,-d} [-nfpe] device\n"
+ " -u, --up spin up device.\n"
+ " -d, --down spin down device.\n"
+ " -v, --verbose[=n] verbose mode (1: normal, 2: debug).\n"
+#ifdef SG_IO
+ " -e, --loej load (-u) or eject (-d) removable medium.\n"
+ " -w, --wait=[n] wait the spin up/down operation to be completed\n"
+ " (n is the number of seconds to timeout).\n"
+ " -I, --oldioctl use legacy ioctl instead of SG I/O (-e,-w ignored).\n"
+#endif
+ " -l, --lock prevent medium removal.\n"
+ " -L, --unlock allow medium removal.\n"
+ " -n, --noact do nothing but check if the device is in use.\n"
+ " -f, --force force spinning up/down even if the device is in use.\n"
+ " -p, --proc use /proc/mounts instead of /etc/mtab to do the check.\n"
+ " device is one of /dev/sd[a-z], /dev/scd[0-9]* or /dev/sg[0-9]*.\n";
+
+ fputs(usage_string, stderr);
+}
+
+int
+main(int argc, char *argv[])
+{
+ int result = 0;
+ int fd;
+ int opt_up = 0;
+ int opt_down = 0;
+ int opt_loej = 0;
+ int opt_wait = 0;
+ int opt_force = 0;
+ int opt_noact = 0;
+ int opt_proc = 0;
+ int opt_lock = 0;
+ int opt_unlock = 0;
+ struct option cmd_line_opts[] = {
+ {"verbose", 2, NULL, 'v'},
+ {"up", 0, NULL, 'u'},
+ {"down", 0, NULL, 'd'},
+#ifdef SG_IO
+ {"loej", 0, NULL, 'e'},
+ {"wait", 2, NULL, 'w'},
+ {"oldioctl", 0, NULL, 'I'},
+#endif
+ {"lock", 0, NULL, 'l'},
+ {"unlock", 0, NULL, 'L'},
+ {"force", 0, NULL, 'f'},
+ {"noact", 0, NULL, 'n'},
+ {"proc", 0, NULL, 'p'},
+ {0, 0, 0, 0},
+ };
+ char* endptr = "";
+ char* device;
+ struct stat devstat;
+
+ char c;
+ while((c = getopt_long(argc, argv, "vudewlLfnp", cmd_line_opts, NULL)) != EOF) {
+ switch (c) {
+ case 'v': opt_verbose = optarg ? strtol(optarg, &endptr, 10) : opt_verbose+1;
+ if (*endptr) goto error;
+ break;
+ case 'u': opt_up = 1; break;
+ case 'd': opt_down = 1; break;
+#ifdef SG_IO
+ case 'e': opt_loej = 1; break;
+ case 'w': opt_wait = optarg ? strtol(optarg, &endptr, 10) : opt_wait+1;
+ if (*endptr) goto error;
+ break;
+ case 'I': opt_oldioctl = 1; break;
+#endif
+ case 'f': opt_force = 1; break;
+ case 'l': opt_lock = 1; break;
+ case 'L': opt_unlock = 1; break;
+ case 'n': opt_noact = 1; break;
+ case 'p': opt_proc = 1; break;
+ default:
+error:
+ usage();
+ exit(1);
+ }
+ }
+
+ if(opt_up && opt_down) {
+ fputs("scsi-spin: specified both --up and --down. "
+ "Is this some kind of test?\n", stderr);
+ exit(1);
+ }
+ if(opt_lock && opt_unlock) {
+ fputs("scsi-spin: specified both --lock and --unlock. "
+ "Is this some kind of test?\n", stderr);
+ exit(1);
+ }
+ if (opt_oldioctl && (opt_wait || opt_loej)) {
+ fputs("scsi-spin: -e or -w not working in old ioctl mode.\n", stderr);
+ exit(1);
+ }
+ if(!(opt_up || opt_down || opt_lock || opt_unlock)) {
+ fputs("scsi-spin: must specify --up, --down, --lock or --unlock at least.\n", stderr);
+ exit(1);
+ }
+
+ if(optind != (argc - 1)) {
+ usage();
+ exit(1);
+ }
+
+ device = argv[optind];
+
+ if(stat(device, &devstat) == -1) {
+ fprintf(stderr, "scsi-spin [stat]: %s: %s\n", device, strerror(errno));
+ result = 1;
+ }
+
+ if (is_mounted( device, opt_proc, major(devstat.st_rdev), minor(devstat.st_rdev) )) {
+ if (! opt_force) {
+ fprintf( stderr, "scsi-spin: device already in use (mounted partition)\n" );
+ exit(1);
+ }
+ else {
+ fprintf( stderr, "scsi-spin [warning]: device is mounted but --force is passed\n" );
+ }
+ }
+
+ /* first try to open the device r/w */
+ fd = open(device, O_RDWR);
+ if (fd < 0) {
+ /* if it's fail, then try ro */
+ fd = open(device, O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "scsi-spin [open]: %s: %s\n", device, strerror(errno));
+ exit(1);
+ }
+ }
+
+ if ((S_ISBLK(devstat.st_mode) &&
+ SCSI_BLK_MAJOR(major(devstat.st_rdev))) ||
+ (S_ISCHR(devstat.st_mode) &&
+ major(devstat.st_rdev) == SCSI_GENERIC_MAJOR))
+ {
+ if (! opt_noact) {
+ if (opt_lock || opt_unlock)
+ scsi_lock(fd, opt_lock);
+ if (opt_up || opt_down)
+ scsi_spin(fd, opt_up, opt_loej, opt_wait);
+ }
+ }
+ else {
+ fprintf(stderr, "scsi-spin: %s is not a disk or generic SCSI device.\n", device);
+ result = 1;
+ }
+
+ close(fd);
+ return result;
+}
diff --git a/package/scsi-spin/ipkg/scsi-spin.control b/package/scsi-spin/ipkg/scsi-spin.control
new file mode 100644
index 000000000..3d32f05fe
--- /dev/null
+++ b/package/scsi-spin/ipkg/scsi-spin.control
@@ -0,0 +1,4 @@
+Package: scsi-spin
+Priority: optional
+Section: extra
+Description: Utility to spin down scsi disks
diff --git a/package/ser2net/Config.in b/package/ser2net/Config.in
new file mode 100644
index 000000000..b4ce13616
--- /dev/null
+++ b/package/ser2net/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_SER2NET
+ prompt "ser2net........................... Serial port TCP/IP redirector"
+ tristate
+ default n
+ help
+ This is ser2net, a program for allowing network connections to serial
+ ports. See the man page for information about using the program. Note
+ that ser2net supports RFC 2217 (remote control of serial port parameters),
+ but you must have a complient client.
+
diff --git a/package/ser2net/Makefile b/package/ser2net/Makefile
new file mode 100644
index 000000000..7b0ca8a4e
--- /dev/null
+++ b/package/ser2net/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ser2net
+PKG_VERSION:= 2.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 5f83a3e8aec18331cb61069dccdfba47
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=ser2net/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SER2NET,ser2net,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SER2NET}/etc
+ ${INSTALL_DIR} ${IDIR_SER2NET}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ser2net ${IDIR_SER2NET}/usr/sbin
+ ${INSTALL_DATA} ${WRKBUILD}/ser2net.conf ${IDIR_SER2NET}/etc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ser2net/ipkg/ser2net.conffiles b/package/ser2net/ipkg/ser2net.conffiles
new file mode 100644
index 000000000..16bb67f20
--- /dev/null
+++ b/package/ser2net/ipkg/ser2net.conffiles
@@ -0,0 +1 @@
+/etc/ser2net.conf
diff --git a/package/ser2net/ipkg/ser2net.control b/package/ser2net/ipkg/ser2net.control
new file mode 100644
index 000000000..0b1b22ad4
--- /dev/null
+++ b/package/ser2net/ipkg/ser2net.control
@@ -0,0 +1,5 @@
+Package: ser2net
+Priority: optional
+Section: net
+Source: http://jaist.dl.sourceforge.net/sourceforge/ser2net/
+Description: a program for allowing network connections to serial ports
diff --git a/package/serdisplib/Config.in b/package/serdisplib/Config.in
new file mode 100644
index 000000000..2755f66d8
--- /dev/null
+++ b/package/serdisplib/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_SERDISPLIB
+ prompt "serdisplib........................ a library for controlling displays"
+ tristate
+ default n
+ help
+ serdisplib is a library to drive serial and parallel displays
+ with built-in controllers.
+
+ http://serdisplib.sourceforge.net/
+
diff --git a/package/serdisplib/Makefile b/package/serdisplib/Makefile
new file mode 100644
index 000000000..785be76e1
--- /dev/null
+++ b/package/serdisplib/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= serdisplib
+PKG_VERSION:= 1.97.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 52e4714d6a955c4d023a5ae52b2d36d8
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=serdisplib/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SERDISPLIB,serdisplib,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-libusb
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull=yes
+BUILD_STYLE:= auto
+TCFLAGS+= ${TCPPFLAGS}
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SERDISPLIB}/usr/lib
+ ${CP} ${WRKBUILD}/lib/libserdisp.so.* ${IDIR_SERDISPLIB}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/serdisplib/ipkg/serdisplib.control b/package/serdisplib/ipkg/serdisplib.control
new file mode 100644
index 000000000..3fcddcc70
--- /dev/null
+++ b/package/serdisplib/ipkg/serdisplib.control
@@ -0,0 +1,4 @@
+Package: serdisplib
+Priority: optional
+Section: libs
+Description: A library for controlling displays
diff --git a/package/serdisplib/patches/patch-Makefile_in b/package/serdisplib/patches/patch-Makefile_in
new file mode 100644
index 000000000..91ccdb872
--- /dev/null
+++ b/package/serdisplib/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- serdisplib-1.97.3.orig/Makefile.in 2006-03-25 23:58:20.000000000 +0100
++++ serdisplib-1.97.3/Makefile.in 2007-02-21 23:28:24.000000000 +0100
+@@ -19,7 +19,7 @@ CC = @CC@
+ MAKE=@MAKE@
+
+
+-subdirs = src tools
++subdirs = src
+
+
+ all:
diff --git a/package/serdisplib/patches/patch-configure b/package/serdisplib/patches/patch-configure
new file mode 100644
index 000000000..aaf687695
--- /dev/null
+++ b/package/serdisplib/patches/patch-configure
@@ -0,0 +1,22 @@
+$Id$
+--- serdisplib-1.97.3.orig/configure 2007-02-15 23:24:51.000000000 +0100
++++ serdisplib-1.97.3/configure 2007-05-23 00:00:41.000000000 +0200
+@@ -2644,18 +2644,6 @@ echo "${ECHO_T}no" >&6
+ fi
+
+
+-# split version information
+-PACKAGE_VERSION_TEMP=${PACKAGE_VERSION/\./\ }
+-PACKAGE_VERSION_MAJOR=${PACKAGE_VERSION_TEMP/\ *}
+-PACKAGE_VERSION_MINTEMP=${PACKAGE_VERSION_TEMP/*\ }
+-if test "${PACKAGE_VERSION_TEMP/*\.*/\.}" = "\."; then
+- PACKAGE_VERSION_MINOR=${PACKAGE_VERSION_MINTEMP/\.*}
+- PACKAGE_VERSION_SUBMINOR=${PACKAGE_VERSION_MINTEMP/*\.}
+-else
+- PACKAGE_VERSION_MINOR=$PACKAGE_VERSION_MINTEMP
+- PACKAGE_VERSION_SUBMINOR=""
+-fi
+-
+
+
+
diff --git a/package/serdisplib/patches/patch-src_Makefile_in b/package/serdisplib/patches/patch-src_Makefile_in
new file mode 100644
index 000000000..08a980b6a
--- /dev/null
+++ b/package/serdisplib/patches/patch-src_Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- serdisplib-1.97.3.orig/src/Makefile.in 2007-02-15 23:24:41.000000000 +0100
++++ serdisplib-1.97.3/src/Makefile.in 2007-02-21 23:25:04.000000000 +0100
+@@ -75,7 +75,7 @@ endif
+
+ .SUFFIXES : .c .o
+
+-all: libraries programs
++all: libraries
+
+ libraries: library.static library.shared
+
diff --git a/package/setpwc/Config.in b/package/setpwc/Config.in
new file mode 100644
index 000000000..ac344cac3
--- /dev/null
+++ b/package/setpwc/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_SETPWC
+ prompt "setpwc............................ Philips (and compatibles) WebCams (PWC) control utility"
+ tristate
+ default n
+ help
+ Philips (and compatibles) WebCams (PWC) control utility.
+
+ http://www.vanheusden.com/setpwc/
+
diff --git a/package/setpwc/Makefile b/package/setpwc/Makefile
new file mode 100644
index 000000000..ab7983de9
--- /dev/null
+++ b/package/setpwc/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= setpwc
+PKG_VERSION:= 1.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1bc721cdfcbac24027e2afc93685d29f
+MASTER_SITES:= http://www.vanheusden.com/setpwc/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SETPWC,setpwc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${TCFLAGS} -DVERSION=\"${PKG_VERSION}\" -o ${WRKBUILD}/setpwc ${WRKBUILD}/setpwc.c
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SETPWC}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/setpwc ${IDIR_SETPWC}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/setpwc/ipkg/setpwc.control b/package/setpwc/ipkg/setpwc.control
new file mode 100644
index 000000000..1d7299a8d
--- /dev/null
+++ b/package/setpwc/ipkg/setpwc.control
@@ -0,0 +1,4 @@
+Package: setpwc
+Priority: optional
+Section: admin
+Description: Philips (and compatibles) WebCams (PWC) control utility
diff --git a/package/setserial/Config.in b/package/setserial/Config.in
new file mode 100644
index 000000000..d243a9fee
--- /dev/null
+++ b/package/setserial/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_SETSERIAL
+ prompt "setserial......................... Serial port configuration utility"
+ tristate
+ default n
+ help
+ setserial is a program designed to set and/or report the
+ configuration information associated with a serial port. This
+ information includes what I/O port and IRQ a particular
+ serial port is using, and whether or not the break key should
+ be interpreted as the Secure Attention Key, and so on.
+
+ http://setserial.sourceforge.net/
+
diff --git a/package/setserial/Makefile b/package/setserial/Makefile
new file mode 100644
index 000000000..6f9c495e2
--- /dev/null
+++ b/package/setserial/Makefile
@@ -0,0 +1,25 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= setserial
+PKG_VERSION:= 2.17
+PKG_RELEASE:= 2
+PKG_MD5SUM:= c4867d72c41564318e0107745eb7a0f2
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=setserial/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SETSERIAL,setserial,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SETSERIAL}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/setserial ${IDIR_SETSERIAL}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/setserial/ipkg/setserial.control b/package/setserial/ipkg/setserial.control
new file mode 100644
index 000000000..9a0860b58
--- /dev/null
+++ b/package/setserial/ipkg/setserial.control
@@ -0,0 +1,4 @@
+Package: setserial
+Priority: optional
+Section: console
+Description: configuration utility for serial ports
diff --git a/package/shat/Config.in b/package/shat/Config.in
new file mode 100644
index 000000000..961d308c2
--- /dev/null
+++ b/package/shat/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_SHAT
+ prompt "shat.............................. Source Hardware Address Translation"
+ tristate
+ default n
+ help
+ A tool which allows hosts with arbitrary IP configuration
+ to connect to the internet over a SHAT gateway.
+
+ http://www.teddy-net.com/cvs/Maxina/128gw/service/arpcatch/shat/
+
diff --git a/package/shat/Makefile b/package/shat/Makefile
new file mode 100644
index 000000000..c0b4c2058
--- /dev/null
+++ b/package/shat/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= shat
+PKG_VERSION:= 0.9.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= da06846f35838b14d1513523dad84d24
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=shat/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SHAT,shat,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${MAKE} -C ${WRKBUILD}/src \
+ CC="${TARGET_CC}" LD=${TARGET_CROSS}ld \
+ CFLAGS="${TARGET_CFLAGS} -Wall -I${WRKBUILD}/include/linux/include -I${WRKBUILD}/include -DVERSION=\\\"${PKG_VERSION}\\\" -DDROP_NETBIOS"
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SHAT}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/src/shat{c,d} ${IDIR_SHAT}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/shat/ipkg/shat.control b/package/shat/ipkg/shat.control
new file mode 100644
index 000000000..8143c73a6
--- /dev/null
+++ b/package/shat/ipkg/shat.control
@@ -0,0 +1,4 @@
+Package: shat
+Priority: optional
+Section: net
+Description: Source Hardware Address Translation - a tool for "nomadic routing"
diff --git a/package/shorewall-common/Config.in b/package/shorewall-common/Config.in
new file mode 100644
index 000000000..d45386d64
--- /dev/null
+++ b/package/shorewall-common/Config.in
@@ -0,0 +1,40 @@
+config ADK_PACKAGE_SHOREWALL
+ prompt "shorewall......................... high-level netfilter configuration tool"
+ tristate
+ default n
+ select ADK_PACKAGE_IPTABLES
+ help
+ The Shoreline Firewall, more commonly known as "Shorewall", is a
+ high-level tool for configuring Netfilter. You describe your
+ firewall/gateway requirements using entries in a set of configuration
+ files. Shorewall reads those configuration files and with the help
+ of the iptables utility, Shorewall configures Netfilter to match
+ your requirements.
+
+ http://www.shorewall.net/
+
+config ADK_PACKAGE_SHOREWALL_STRIPCONF
+ prompt "Strip shorewall configuration files"
+ bool
+ default n
+ depends ADK_PACKAGE_SHOREWALL
+ help
+ To save space, all shorewall files in /etc/shorewall will get striped.
+ This means that all comments, empty lines etc. are removed.
+
+ By default this option is not enabled, because the comments
+ in the configfiles helps the user a lot to configure shorewall.
+
+config ADK_PACKAGE_SHOREWALL_STRIPSHARED
+ prompt "Strip shared shorewall files (macros & actions mainly)"
+ bool
+ default y
+ depends ADK_PACKAGE_SHOREWALL
+ help
+ To save space, all shared shorewall files in /usr/share/shorewall
+ will get striped. This means that all comments, empty lines etc.
+ are removed.
+
+ By default this option is enabled, because for normal usage the user
+ doesn't need to change files in /usr/share/shorewall. Comments in all
+ shared files just would waste disk space on most embedded devices.
diff --git a/package/shorewall-common/Makefile b/package/shorewall-common/Makefile
new file mode 100644
index 000000000..6b02af312
--- /dev/null
+++ b/package/shorewall-common/Makefile
@@ -0,0 +1,58 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= shorewall-common
+PKG_VERSION:= 4.0.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2df43356b1fdbc91920d48c5595aa101
+MASTER_SITES:= http://www1.shorewall.net/pub/shorewall/4.0/shorewall-${PKG_VERSION}/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SHOREWALL,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-install:
+ PREFIX="${WRKINST}" ${WRKBUILD}/install.sh -n
+
+ # remove configfiles folder
+ ${RM} -R ${WRKINST}/usr/share/shorewall/configfiles
+
+ifeq ($(ADK_PACKAGE_SHOREWALL_STRIPCONF),y)
+ ${BASH} ./files/downstrip ${WRKINST}/etc/shorewall
+endif
+
+ifeq ($(ADK_PACKAGE_SHOREWALL_STRIPSHARED),y)
+ ${BASH} ./files/downstrip ${WRKINST}/usr/share/shorewall
+ ${BASH} ./files/downstrip ${WRKINST}/sbin
+ gzip -9 ${WRKINST}/usr/share/shorewall/*.template
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SHOREWALL}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_SHOREWALL}/etc/shorewall
+ ${INSTALL_DIR} ${IDIR_SHOREWALL}/usr/share/shorewall
+ ${INSTALL_DIR} ${IDIR_SHOREWALL}/sbin
+
+ ${INSTALL_BIN} ./files/shorewall.init ${IDIR_SHOREWALL}/etc/init.d/shorewall
+
+ ${INSTALL_DATA} ${WRKINST}/etc/shorewall/* ${IDIR_SHOREWALL}/etc/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/actions.std ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/configpath ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/modules ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/rfc1918 ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/version ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/action.* ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/macro.* ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/shorewall/lib.* ${IDIR_SHOREWALL}/usr/share/shorewall/
+
+ ${INSTALL_BIN} ${WRKINST}/usr/share/shorewall/firewall ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_BIN} ${WRKINST}/usr/share/shorewall/functions ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_BIN} ${WRKINST}/usr/share/shorewall/wait4ifup ${IDIR_SHOREWALL}/usr/share/shorewall/
+ ${INSTALL_BIN} ${WRKINST}/sbin/shorewall ${IDIR_SHOREWALL}/sbin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/shorewall-common/files/downstrip b/package/shorewall-common/files/downstrip
new file mode 100644
index 000000000..040eded62
--- /dev/null
+++ b/package/shorewall-common/files/downstrip
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cd $1
+for i in $( ls -1 $1 |grep -v ".template"); do
+ sed -e '/^$/d' -e '/^#$/d' -e '/^#[^!]/d' -e '/^[ *]$/d' -e 's/\t/ /g' -i $i
+done
+
diff --git a/package/shorewall-common/files/shorewall.init b/package/shorewall-common/files/shorewall.init
new file mode 100644
index 000000000..c2800f732
--- /dev/null
+++ b/package/shorewall-common/files/shorewall.init
@@ -0,0 +1,33 @@
+#!/bin/sh
+#FWINIT 45
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"$shorewall" != x"YES" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ touch /var/log/messages
+ mkdir -p /var/lock/subsys
+ /sbin/shorewall -f start 1>/dev/null
+ ;;
+stop)
+ /sbin/shorewall stop 1>/dev/null
+ ;;
+restart)
+ if [ -f /var/lib/shorewall/restore ] ; then
+ /sbin/shorewall restore
+ else
+ /sbin/shorewall restart 1>/dev/null
+ fi
+ ;;
+clear)
+ /sbin/shorewall clear
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart|clear}"
+ ;;
+esac
+exit $?
diff --git a/package/shorewall-common/ipkg/shorewall-common.conffiles b/package/shorewall-common/ipkg/shorewall-common.conffiles
new file mode 100644
index 000000000..99893804c
--- /dev/null
+++ b/package/shorewall-common/ipkg/shorewall-common.conffiles
@@ -0,0 +1,33 @@
+/etc/shorewall/Makefile
+/etc/shorewall/accounting
+/etc/shorewall/actions
+/etc/shorewall/blacklist
+/etc/shorewall/continue
+/etc/shorewall/ecn
+/etc/shorewall/hosts
+/etc/shorewall/init
+/etc/shorewall/initdone
+/etc/shorewall/interfaces
+/etc/shorewall/ipsec
+/etc/shorewall/maclist
+/etc/shorewall/masq
+/etc/shorewall/nat
+/etc/shorewall/netmap
+/etc/shorewall/params
+/etc/shorewall/policy
+/etc/shorewall/providers
+/etc/shorewall/proxyarp
+/etc/shorewall/route_rules
+/etc/shorewall/routestopped
+/etc/shorewall/rules
+/etc/shorewall/shorewall.conf
+/etc/shorewall/start
+/etc/shorewall/started
+/etc/shorewall/stop
+/etc/shorewall/stopped
+/etc/shorewall/tcclasses
+/etc/shorewall/tcdevices
+/etc/shorewall/tcrules
+/etc/shorewall/tos
+/etc/shorewall/tunnels
+/etc/shorewall/zones
diff --git a/package/shorewall-common/ipkg/shorewall-common.control b/package/shorewall-common/ipkg/shorewall-common.control
new file mode 100644
index 000000000..41b7d8e43
--- /dev/null
+++ b/package/shorewall-common/ipkg/shorewall-common.control
@@ -0,0 +1,5 @@
+Package: shorewall-common
+Priority: optional
+Section: net
+Depends: iptables
+Description: high-level netfilter configuration tool
diff --git a/package/shorewall-common/ipkg/shorewall-common.postinst b/package/shorewall-common/ipkg/shorewall-common.postinst
new file mode 100644
index 000000000..bade6304b
--- /dev/null
+++ b/package/shorewall-common/ipkg/shorewall-common.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf shorewall
+
+mkdir -p $IPKG_INSTROOT/usr/share/shorewall/runtime
+chmod 0700 $IPKG_INSTROOT/usr/share/shorewall/runtime
diff --git a/package/shorewall-common/ipkg/shorewall-common.prerm b/package/shorewall-common/ipkg/shorewall-common.prerm
new file mode 100644
index 000000000..805b69980
--- /dev/null
+++ b/package/shorewall-common/ipkg/shorewall-common.prerm
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# commented out: we never change this information ourselves
+# plus: this will destroy /etc/rc.conf entirely.
+# read some info about shell redirections if you don’t know why.
+#cat $IPKG_INSTROOT/etc/rc.conf | grep -v "shorewall" >$IPKG_INSTROOT/etc/rc.conf
+
+rm -rf /usr/share/shorewall/runtime
diff --git a/package/shorewall-common/patches/patch-install_sh b/package/shorewall-common/patches/patch-install_sh
new file mode 100644
index 000000000..715d0130a
--- /dev/null
+++ b/package/shorewall-common/patches/patch-install_sh
@@ -0,0 +1,98 @@
+$Id$
+--- shorewall-common-4.0.5.orig/install.sh 2007-10-19 16:33:06.000000000 +0000
++++ shorewall-common-4.0.5/install.sh 2007-10-23 23:33:47.000000000 +0000
+@@ -183,7 +183,6 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/
+ #
+ # Determine where to install the firewall script
+ #
+-DEBIAN=
+
+ OWNERSHIP="-o $OWNER -g $GROUP"
+
+@@ -198,16 +197,6 @@ if [ -n "$PREFIX" ]; then
+ else
+ [ -x /usr/share/shorewall-shell/compiler -o -x /usr/share/shorewall-perl/compiler.pl ] || \
+ { echo " ERROR: No Shorewall compiler is installed" >&2; exit 1; }
+- if [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
+- DEBIAN=yes
+- elif [ -f /etc/slackware-version ] ; then
+- DEST="/etc/rc.d"
+- INIT="rc.firewall"
+- elif [ -f /etc/arch-release ] ; then
+- DEST="/etc/rc.d"
+- INIT="shorewall"
+- ARCHLINUX=yes
+- fi
+ fi
+
+ #
+@@ -238,14 +227,7 @@ echo "shorewall control program installe
+ #
+ # Install the Firewall Script
+ #
+-if [ -n "$DEBIAN" ]; then
+- install_file_with_backup init.debian.sh /etc/init.d/shorewall 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
+-elif [ -n "$ARCHLINUX" ]; then
+- install_file_with_backup init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
+-
+-else
+- install_file_with_backup init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
+-fi
++install_file_with_backup init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
+
+ echo "Shorewall script installed in ${PREFIX}${DEST}/$INIT"
+
+@@ -273,9 +255,6 @@ if [ ! -f ${PREFIX}/etc/shorewall/shorew
+ fi
+
+
+-if [ -n "$ARCHLINUX" ] ; then
+- sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall/shorewall.conf
+-fi
+ #
+ # Install the zones file
+ #
+@@ -704,43 +683,6 @@ echo "Man Pages Installed"
+ #
+ install_file firewall ${PREFIX}/usr/share/shorewall/firewall 0755
+
+-if [ -z "$PREFIX" -a -n "$first_install" ]; then
+- if [ -n "$DEBIAN" ]; then
+- run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall
+- ln -s ../init.d/shorewall /etc/rcS.d/S40shorewall
+- echo "shorewall will start automatically at boot"
+- echo "Set startup=1 in /etc/default/shorewall to enable"
+- touch /var/log/shorewall-init.log
+- qt mywhich perl && perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' /etc/shorewall/shorewall.conf
+- else
+- if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
+- if insserv /etc/init.d/shorewall ; then
+- echo "shorewall will start automatically at boot"
+- echo "Set STARTUP_ENABLED=Yes in /etc/shorewall/shorewall.conf to enable"
+- else
+- cant_autostart
+- fi
+- elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then
+- if chkconfig --add shorewall ; then
+- echo "shorewall will start automatically in run levels as follows:"
+- echo "Set STARTUP_ENABLED=Yes in /etc/shorewall/shorewall.conf to enable"
+- chkconfig --list shorewall
+- else
+- cant_autostart
+- fi
+- elif [ -x /sbin/rc-update ]; then
+- if rc-update add shorewall default; then
+- echo "shorewall will start automatically at boot"
+- echo "Set STARTUP_ENABLED=Yes in /etc/shorewall/shorewall.conf to enable"
+- else
+- cant_autostart
+- fi
+- elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
+- cant_autostart
+- fi
+- fi
+-fi
+-
+ #
+ # Report Success
+ #
diff --git a/package/shorewall-common/patches/patch-shorewall_conf b/package/shorewall-common/patches/patch-shorewall_conf
new file mode 100644
index 000000000..80a55f3e9
--- /dev/null
+++ b/package/shorewall-common/patches/patch-shorewall_conf
@@ -0,0 +1,12 @@
+$Id$
+--- shorewall-3.4.5.orig/shorewall.conf 2007-06-20 14:30:57.000000000 +0000
++++ shorewall-3.4.5/shorewall.conf 2007-07-17 11:08:12.000000000 +0000
+@@ -71,7 +71,7 @@ SHOREWALL_SHELL=/bin/sh
+
+ SUBSYSLOCK=/var/lock/subsys/shorewall
+
+-MODULESDIR=
++MODULESDIR=/lib/modules/`uname -r`/
+
+ CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
+
diff --git a/package/shorewall-shell/Config.in b/package/shorewall-shell/Config.in
new file mode 100644
index 000000000..76270351b
--- /dev/null
+++ b/package/shorewall-shell/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_SHOREWALL_SHELL
+ prompt "shorewall-shell................. shorewall shell compiler"
+ tristate
+ depends ADK_PACKAGE_SHOREWALL
+ default y
+ help
+ http://www.shorewall.net/
+
diff --git a/package/shorewall-shell/Makefile b/package/shorewall-shell/Makefile
new file mode 100644
index 000000000..233d259a1
--- /dev/null
+++ b/package/shorewall-shell/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= shorewall-shell
+PKG_VERSION:= 4.0.14.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ab61c2f3db82382351f432f783980fa7
+MASTER_SITES:= http://www1.shorewall.net/pub/shorewall/4.0/shorewall-4.0.14/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SHOREWALL_SHELL,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-install:
+ PREFIX="${WRKINST}" ${WRKBUILD}/install.sh -n
+
+ifeq ($(ADK_PACKAGE_SHOREWALL_STRIPSHARED),y)
+ ${BASH} ./files/downstrip ${WRKINST}/usr/share/${PKG_NAME}
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SHOREWALL_SHELL}/usr/share/${PKG_NAME}
+
+ ${INSTALL_DATA} ${WRKINST}/usr/share/${PKG_NAME}/version ${IDIR_SHOREWALL_SHELL}/usr/share/${PKG_NAME}/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/${PKG_NAME}/lib.* ${IDIR_SHOREWALL_SHELL}/usr/share/${PKG_NAME}/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/${PKG_NAME}/prog.* ${IDIR_SHOREWALL_SHELL}/usr/share/${PKG_NAME}/
+
+ ${INSTALL_BIN} ${WRKINST}/usr/share/${PKG_NAME}/compiler ${IDIR_SHOREWALL_SHELL}/usr/share/${PKG_NAME}/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/shorewall-shell/files/downstrip b/package/shorewall-shell/files/downstrip
new file mode 100644
index 000000000..040eded62
--- /dev/null
+++ b/package/shorewall-shell/files/downstrip
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cd $1
+for i in $( ls -1 $1 |grep -v ".template"); do
+ sed -e '/^$/d' -e '/^#$/d' -e '/^#[^!]/d' -e '/^[ *]$/d' -e 's/\t/ /g' -i $i
+done
+
diff --git a/package/shorewall-shell/ipkg/shorewall-shell.control b/package/shorewall-shell/ipkg/shorewall-shell.control
new file mode 100644
index 000000000..7745b88fb
--- /dev/null
+++ b/package/shorewall-shell/ipkg/shorewall-shell.control
@@ -0,0 +1,5 @@
+Package: shorewall-shell
+Priority: optional
+Section: net
+Depends: shorewall-common
+Description: shell compiler for shorewall
diff --git a/package/siproxd/Config.in b/package/siproxd/Config.in
new file mode 100644
index 000000000..e3e4d67e9
--- /dev/null
+++ b/package/siproxd/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_SIPROXD
+ prompt "siproxd........................... SIP (Session Initiation Protocol) proxy"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOSIP2
+ help
+ A SIP (Session Initiation Protocol) proxy
+
+ http://siproxd.sourceforge.net/
+
+ Depends: libosip2
+
diff --git a/package/siproxd/Makefile b/package/siproxd/Makefile
new file mode 100644
index 000000000..d05316b70
--- /dev/null
+++ b/package/siproxd/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= siproxd
+PKG_VERSION:= 0.5.12
+PKG_RELEASE:= 8
+PKG_MD5SUM:= 2fa02bd6f83070593bfc2d383ce614fa
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=siproxd/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SIPROXD,siproxd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SIPROXD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_SIPROXD}/usr/sbin
+ ${INSTALL_DATA} ${WRKINST}/etc/siproxd.conf.example ${IDIR_SIPROXD}/etc/siproxd.conf
+ ${INSTALL_DATA} ${WRKINST}/etc/siproxd_passwd.cfg ${IDIR_SIPROXD}/etc/
+ ${INSTALL_BIN} files/siproxd.init \
+ ${IDIR_SIPROXD}/etc/init.d/siproxd
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/siproxd ${IDIR_SIPROXD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/siproxd/files/siproxd.init b/package/siproxd/files/siproxd.init
new file mode 100644
index 000000000..e936aab2f
--- /dev/null
+++ b/package/siproxd/files/siproxd.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+ autostart)
+ test x"${siproxd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+ start)
+ siproxd
+ ;;
+ stop)
+ killall siproxd
+ ;;
+ restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/siproxd/ipkg/siproxd.conffiles b/package/siproxd/ipkg/siproxd.conffiles
new file mode 100644
index 000000000..abb4ba5a1
--- /dev/null
+++ b/package/siproxd/ipkg/siproxd.conffiles
@@ -0,0 +1,2 @@
+/etc/siproxd.conf
+/etc/siproxd_passwd.cfg
diff --git a/package/siproxd/ipkg/siproxd.control b/package/siproxd/ipkg/siproxd.control
new file mode 100644
index 000000000..96f73e21c
--- /dev/null
+++ b/package/siproxd/ipkg/siproxd.control
@@ -0,0 +1,5 @@
+Package: siproxd
+Priority: optional
+Section: net
+Description: a SIP (Session Initiation Protocol) proxy
+Depends: libosip2, libpthread
diff --git a/package/siproxd/ipkg/siproxd.postinst b/package/siproxd/ipkg/siproxd.postinst
new file mode 100644
index 000000000..bf72a7a06
--- /dev/null
+++ b/package/siproxd/ipkg/siproxd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf siproxd siproxd NO
diff --git a/package/siproxd/patches/patch-configure b/package/siproxd/patches/patch-configure
new file mode 100644
index 000000000..364bc3b20
--- /dev/null
+++ b/package/siproxd/patches/patch-configure
@@ -0,0 +1,18 @@
+$Id$
+--- siproxd-0.5.12.orig/configure 2006-01-01 20:34:27.000000000 +0000
++++ siproxd-0.5.12/configure 2007-02-17 19:09:07.000000000 +0000
+@@ -3381,9 +3381,14 @@ echo $ECHO_N "checking build statically
+ # Check whether --enable-static or --disable-static was given.
+ if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
++ if test x"yes" = x"$enable_static"; then
+ LDFLAGS="$LDFLAGS -static";
+ echo "$as_me:$LINENO: result: yes" >&5
+ echo "${ECHO_T}yes" >&6
++ else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++ fi
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+ echo "${ECHO_T}no" >&6
diff --git a/package/sipsak/Config.in b/package/sipsak/Config.in
new file mode 100644
index 000000000..abf0667fd
--- /dev/null
+++ b/package/sipsak/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_SIPSAK
+ prompt "sipsak............................ SIP (Session Initiation Protocol) stress and diagnostics utility"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ A SIP (Session Initiation Protocol) stress and diagnostics utility
+
+ http://www.sipsak.org/
+
+ Depends: openssl
+
diff --git a/package/sipsak/Makefile b/package/sipsak/Makefile
new file mode 100644
index 000000000..84a7af142
--- /dev/null
+++ b/package/sipsak/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= sipsak
+PKG_VERSION:= 0.9.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c4eb8e282902e75f4f040f09ea9d99d5
+MASTER_SITES:= http://download.berlios.de/sipsak/ \
+ http://ftp.iptel.org/pub/sipsak/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SIPSAK,sipsak,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull=yes
+CONFIGURE_ARGS+= --disable-gnutls
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SIPSAK}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/sipsak ${IDIR_SIPSAK}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/sipsak/ipkg/sipsak.control b/package/sipsak/ipkg/sipsak.control
new file mode 100644
index 000000000..790629f78
--- /dev/null
+++ b/package/sipsak/ipkg/sipsak.control
@@ -0,0 +1,5 @@
+Package: sipsak
+Priority: optional
+Section: net
+Depends: libopenssl
+Description: a SIP (Session Initiation Protocol) stress and diagnostics utility
diff --git a/package/sispmctl/Config.in b/package/sispmctl/Config.in
new file mode 100644
index 000000000..a6e13c3b8
--- /dev/null
+++ b/package/sispmctl/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_SISPMCTL
+ prompt "sispmctl.......................... control application for power sockets"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBUSB
+ help
+ switch USB controlled outlets of Gembird Silver Shield PM.
+
+ http://sispmctl.sourceforge.net/
diff --git a/package/sispmctl/Makefile b/package/sispmctl/Makefile
new file mode 100644
index 000000000..c20f15614
--- /dev/null
+++ b/package/sispmctl/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= sispmctl
+PKG_VERSION:= 2.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 2457f76cd129f880634f3381be0aeb76
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=sispmctl/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SISPMCTL,sispmctl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SISPMCTL}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/sispmctl ${IDIR_SISPMCTL}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/sispmctl/ipkg/sispmctl.control b/package/sispmctl/ipkg/sispmctl.control
new file mode 100644
index 000000000..ab192c4c0
--- /dev/null
+++ b/package/sispmctl/ipkg/sispmctl.control
@@ -0,0 +1,5 @@
+Package: sispmctl
+Priority: optional
+Section: misc
+Depends: libusb
+Description: control application for power sockets
diff --git a/package/slurm/Config.in b/package/slurm/Config.in
new file mode 100644
index 000000000..819501dfc
--- /dev/null
+++ b/package/slurm/Config.in
@@ -0,0 +1,15 @@
+config ADK_PACKAGE_SLURM
+ prompt "slurm............................. A realtime network interface monitor"
+ tristate
+ default n
+ help
+ A realtime network interface monitor with the following features:
+
+ * realtime traffic statistics divided into incoming and outgoing
+ * optional combined view
+ * can monitor any kind of network interface
+ * shows detailed statistics about the interface.
+ * it's themeable
+
+ http://www.wormulon.net/projects/slurm
+
diff --git a/package/slurm/Makefile b/package/slurm/Makefile
new file mode 100644
index 000000000..e2560610c
--- /dev/null
+++ b/package/slurm/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= slurm
+PKG_VERSION:= 0.3.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e68d09202b835c644f7f6b7f070f29a2
+MASTER_SITES:= http://www.wormulon.net/files/slurm/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SLURM,slurm,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= LIBS="-lncurses" \
+ ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_lib_ncurses_use_default_colors=yes
+BUILD_STYLE:= auto
+MAKE_FLAGS:= CPPFLAGS="${TCPPFLAGS}" CFLAGS="${TCFLAGS}" LDFLAGS="${TLDFLAGS}"
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SLURM}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/slurm ${IDIR_SLURM}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/slurm/ipkg/slurm.control b/package/slurm/ipkg/slurm.control
new file mode 100644
index 000000000..7f83d77b1
--- /dev/null
+++ b/package/slurm/ipkg/slurm.control
@@ -0,0 +1,6 @@
+Package: slurm
+Priority: standard
+Section: net
+Depends: libncurses
+Description: Realtime network interface monitor
+
diff --git a/package/slurm/patches/no_host_ncurses.patch b/package/slurm/patches/no_host_ncurses.patch
new file mode 100644
index 000000000..ce97478d6
--- /dev/null
+++ b/package/slurm/patches/no_host_ncurses.patch
@@ -0,0 +1,67 @@
+diff -ruN slurm-0.3.3-old/configure slurm-0.3.3-new/configure
+--- slurm-0.3.3-old/configure 2004-09-28 16:34:56.000000000 +0200
++++ slurm-0.3.3-new/configure 2005-11-06 22:08:53.000000000 +0100
+@@ -4762,35 +4762,35 @@
+ _ACEOF
+
+
+-for cursespath in /usr/include/ncurses.h /usr/local/include/ncurses.h /usr/local/include/ncurses/ncurses.h /opt/include/ncurses.h /opt/include/curses.h /usr/include/curses.h /usr/local/include/curses.h /dev/null
+-do
+- test -f "${cursespath}" && break
+-done
+-case ${cursespath} in
+- /usr/include/*)
+- CFLAGS="$CFLAGS -I/usr/include"
+- LDFLAGS=""
+- ;;
+- /usr/local/include/ncurses/*)
+- CFLAGS="${CFLAGS} -I/usr/local/include/ncurses"
+- LDFLAGS="-L/usr/local/lib"
+- SOLLDFLAGS="-R/usr/local/lib"
+- ;;
+- /usr/local/include/*)
+- CFLAGS="${CFLAGS} -I/usr/local/include"
+- LDFLAGS="-L/usr/local/lib"
+- SOLLDFLAGS="-R/usr/local/lib"
+- ;;
+- /opt/include/*)
+- CFLAGS="${CFLAGS} -I/opt/include"
+- LDFLAGS="-L/opt/lib"
+- SOLLDFLAGS="-R/opt/lib"
+- ;;
+-esac
++#for cursespath in /usr/include/ncurses.h /usr/local/include/ncurses.h /usr/local/include/ncurses/ncurses.h /opt/include/ncurses.h /opt/include/curses.h /usr/include/curses.h /usr/local/include/curses.h /dev/null
++#do
++# test -f "${cursespath}" && break
++#done
++#case ${cursespath} in
++# /usr/include/*)
++# CFLAGS="$CFLAGS -I/usr/include"
++# LDFLAGS=""
++# ;;
++# /usr/local/include/ncurses/*)
++# CFLAGS="${CFLAGS} -I/usr/local/include/ncurses"
++# LDFLAGS="-L/usr/local/lib"
++# SOLLDFLAGS="-R/usr/local/lib"
++# ;;
++# /usr/local/include/*)
++# CFLAGS="${CFLAGS} -I/usr/local/include"
++# LDFLAGS="-L/usr/local/lib"
++# SOLLDFLAGS="-R/usr/local/lib"
++# ;;
++# /opt/include/*)
++# CFLAGS="${CFLAGS} -I/opt/include"
++# LDFLAGS="-L/opt/lib"
++# SOLLDFLAGS="-R/opt/lib"
++# ;;
++#esac
+ # add Slowlaris -R and libraries to LDFLAGS
+-if test ${OSTYPE} = "solaris" ; then
+- LDFLAGS="${LDFLAGS} ${SOLLDFLAGS} -lnsl -lsocket -lkstat"
+-fi
++#if test ${OSTYPE} = "solaris" ; then
++# LDFLAGS="${LDFLAGS} ${SOLLDFLAGS} -lnsl -lsocket -lkstat"
++#fi
+
+ echo "$as_me:$LINENO: checking for vanilla_coke in -lfridge" >&5
+ echo $ECHO_N "checking for vanilla_coke in -lfridge... $ECHO_C" >&6
diff --git a/package/snort-wireless/Config.in b/package/snort-wireless/Config.in
new file mode 100644
index 000000000..d8cb07f7d
--- /dev/null
+++ b/package/snort-wireless/Config.in
@@ -0,0 +1,17 @@
+config ADK_PACKAGE_SNORT_WIRELESS
+ prompt "snort-wireless.................... Ligthweight Wireless Network Intrusion Detection System (NIDS)"
+ tristate
+ select ADK_PACKAGE_LIBNET
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBPCRE
+ default n
+ help
+
+ A ligthweight Wireless Network Intrusion Detection System (NIDS)
+
+ http://www.snort-wireless.org/
+
+ Depends:
+ - libnet
+ - libpcap
+ - libpcre
diff --git a/package/snort-wireless/Makefile b/package/snort-wireless/Makefile
new file mode 100644
index 000000000..965ece735
--- /dev/null
+++ b/package/snort-wireless/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= snort-wireless
+PKG_VERSION:= 2.4.3-alpha04
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 1aa699ae279bf7a1140cf6cca02f9999
+MASTER_SITES:= http://www.snort-wireless.org/files/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,SNORT_WIRELESS,snort-wireless,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-flexresp \
+ --with-libnet-includes="${STAGING_DIR}/usr/include" \
+ --with-libnet-libraries="${STAGING_DIR}/usr/lib" \
+ --with-libpcap-includes="${STAGING_DIR}/usr/include" \
+ --with-libpcap-libraries="${STAGING_DIR}/usr/lib" \
+ --with-libpcre-includes="${STAGING_DIR}/usr/include" \
+ --with-libpcre-libraries="${STAGING_DIR}/usr/lib" \
+ --without-mysql \
+ --without-postgresql \
+ --disable-inline
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SNORT_WIRELESS}/usr/bin
+ ${INSTALL_DIR} ${IDIR_SNORT_WIRELESS}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_SNORT_WIRELESS}/etc/snort
+ ${INSTALL_BIN} ./files/snort-wireless.init \
+ ${IDIR_SNORT_WIRELESS}/etc/init.d/snort
+ ${INSTALL_DATA} ${WRKBUILD}/etc/snort.conf ${IDIR_SNORT_WIRELESS}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/classification.config \
+ ${IDIR_SNORT_WIRELESS}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/gen-msg.map ${IDIR_SNORT_WIRELESS}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/reference.config ${IDIR_SNORT_WIRELESS}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/sid-msg.map ${IDIR_SNORT_WIRELESS}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/threshold.conf ${IDIR_SNORT_WIRELESS}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/unicode.map ${IDIR_SNORT_WIRELESS}/etc/snort/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/snort ${IDIR_SNORT_WIRELESS}/usr/bin
+
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/snort-wireless/files/snort-wireless.init b/package/snort-wireless/files/snort-wireless.init
new file mode 100644
index 000000000..6986f6118
--- /dev/null
+++ b/package/snort-wireless/files/snort-wireless.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 75
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${snort_wireless:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/log/snort ] || mkdir -p /var/log/snort
+ snort ${snort_wireless_flags}
+ ;;
+stop)
+ killall snort
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/snort-wireless/ipkg/snort-wireless.conffiles b/package/snort-wireless/ipkg/snort-wireless.conffiles
new file mode 100644
index 000000000..a224c4c1d
--- /dev/null
+++ b/package/snort-wireless/ipkg/snort-wireless.conffiles
@@ -0,0 +1,2 @@
+/etc/snort/snort.conf
+/etc/snort/threshold.conf
diff --git a/package/snort-wireless/ipkg/snort-wireless.control b/package/snort-wireless/ipkg/snort-wireless.control
new file mode 100644
index 000000000..11bede931
--- /dev/null
+++ b/package/snort-wireless/ipkg/snort-wireless.control
@@ -0,0 +1,6 @@
+Package: snort-wireless
+Priority: optional
+Section: net
+Depends: libnet, libpcap, libpcre
+Description: a flexible Wireless Network Intrusion Detection System (NIDS),
+ built without database logging support
diff --git a/package/snort-wireless/ipkg/snort-wireless.postinst b/package/snort-wireless/ipkg/snort-wireless.postinst
new file mode 100644
index 000000000..a348b7a82
--- /dev/null
+++ b/package/snort-wireless/ipkg/snort-wireless.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf snort-wireless snort_wireless NO
+add_rcconf snort-wireless snort_wireless_flags "-i eth0.1 -c /etc/snort/snort.conf -D -N -q -s"
diff --git a/package/snort-wireless/patches/500-no-config-search.patch b/package/snort-wireless/patches/500-no-config-search.patch
new file mode 100644
index 000000000..d674ba66a
--- /dev/null
+++ b/package/snort-wireless/patches/500-no-config-search.patch
@@ -0,0 +1,35 @@
+--- snort-2.3.2-orig/src/snort.c 2005-01-13 21:36:20.000000000 +0100
++++ snort-2.3.2-1/src/snort.c 2005-04-04 20:03:34.000000000 +0200
+@@ -1949,7 +1949,7 @@
+ {
+ struct stat st;
+ int i;
+- char *conf_files[]={"/etc/snort.conf", "./snort.conf", NULL};
++ char *conf_files[]={"/etc/snort/snort.conf", NULL};
+ char *fname = NULL;
+ char *home_dir = NULL;
+ char *rval = NULL;
+@@ -1970,23 +1970,6 @@
+ i++;
+ }
+
+- /* search for .snortrc in the HOMEDIR */
+- if(!rval)
+- {
+- if((home_dir = getenv("HOME")))
+- {
+- /* create the full path */
+- fname = (char *)malloc(strlen(home_dir) + strlen("/.snortrc") + 1);
+- if(!fname)
+- FatalError("Out of memory searching for config file\n");
+-
+- if(stat(fname, &st) != -1)
+- rval = fname;
+- else
+- free(fname);
+- }
+- }
+-
+ return rval;
+ }
+
diff --git a/package/snort-wireless/patches/750-lightweight-config.patch b/package/snort-wireless/patches/750-lightweight-config.patch
new file mode 100644
index 000000000..daea3be5a
--- /dev/null
+++ b/package/snort-wireless/patches/750-lightweight-config.patch
@@ -0,0 +1,178 @@
+--- snort-wireless-2.4.3-alpha04/etc/snort.conf 2005-10-21 09:41:01.000000000 +0200
++++ /Users/florian/telechargements/snort.conf 2005-10-30 13:20:17.000000000 +0100
+@@ -6,6 +6,7 @@
+ #
+ ###################################################
+ # This file contains a sample snort configuration.
++# Most preprocessors and rules were disabled to save memory.
+ # You can take the following steps to create your own custom configuration:
+ #
+ # 1) Set the variables for your network
+@@ -42,10 +43,10 @@
+ # or you can specify the variable to be any IP address
+ # like this:
+
+-var HOME_NET any
++var HOME_NET 192.168.1.0/24
+
+ # Set up the external network addresses as well. A good start may be "any"
+-var EXTERNAL_NET any
++var EXTERNAL_NET !$HOME_NET
+
+ # Configure your wireless AP lists. This allows snort to look for attacks
+ # against your wireless network, such as rogue access points or adhoc wireless
+@@ -137,7 +138,7 @@
+ # Path to your rules files (this can be a relative path)
+ # Note for Windows users: You are advised to make this an absolute path,
+ # such as: c:\snort\rules
+-var RULE_PATH ../rules
++var RULE_PATH /etc/snort/rules
+
+ # Configure the snort decoder
+ # ============================
+@@ -413,11 +414,11 @@
+ # lots of options available here. See doc/README.http_inspect.
+ # unicode.map should be wherever your snort.conf lives, or given
+ # a full path to where snort can find it.
+-preprocessor http_inspect: global \
+- iis_unicode_map unicode.map 1252
++#preprocessor http_inspect: global \
++# iis_unicode_map unicode.map 1252
+
+-preprocessor http_inspect_server: server default \
+- profile all ports { 80 8080 8180 } oversize_dir_length 500
++#preprocessor http_inspect_server: server default \
++# profile all ports { 80 8080 8180 } oversize_dir_length 500
+
+ #
+ # Example unique server configuration
+@@ -451,7 +452,7 @@
+ # no_alert_incomplete - don't alert when a single segment
+ # exceeds the current packet size
+
+-preprocessor rpc_decode: 111 32771
++#preprocessor rpc_decode: 111 32771
+
+ # bo: Back Orifice detector
+ # -------------------------
+@@ -474,7 +475,7 @@
+ # 3 Back Orifice Server Traffic Detected
+ # 4 Back Orifice Snort Buffer Attack
+
+-preprocessor bo
++#preprocessor bo
+
+ # telnet_decode: Telnet negotiation string normalizer
+ # ---------------------------------------------------
+@@ -486,7 +487,7 @@
+ # This preprocessor requires no arguments.
+ # Portscan uses Generator ID 109 and does not generate any SID currently.
+
+-preprocessor telnet_decode
++#preprocessor telnet_decode
+
+ # sfPortscan
+ # ----------
+@@ -537,9 +538,9 @@
+ # are still watched as scanner hosts. The 'ignore_scanned' option is
+ # used to tune alerts from very active hosts such as syslog servers, etc.
+ #
+-preprocessor sfportscan: proto { all } \
+- memcap { 10000000 } \
+- sense_level { low }
++#preprocessor sfportscan: proto { all } \
++# memcap { 10000000 } \
++# sense_level { low }
+
+ # arpspoof
+ #----------------------------------------
+@@ -814,41 +815,41 @@
+ include $RULE_PATH/bad-traffic.rules
+ include $RULE_PATH/exploit.rules
+ include $RULE_PATH/scan.rules
+-include $RULE_PATH/finger.rules
+-include $RULE_PATH/ftp.rules
+-include $RULE_PATH/telnet.rules
+-include $RULE_PATH/rpc.rules
+-include $RULE_PATH/rservices.rules
+-include $RULE_PATH/dos.rules
+-include $RULE_PATH/ddos.rules
+-include $RULE_PATH/dns.rules
+-include $RULE_PATH/tftp.rules
+-
+-include $RULE_PATH/web-cgi.rules
+-include $RULE_PATH/web-coldfusion.rules
+-include $RULE_PATH/web-iis.rules
+-include $RULE_PATH/web-frontpage.rules
+-include $RULE_PATH/web-misc.rules
+-include $RULE_PATH/web-client.rules
+-include $RULE_PATH/web-php.rules
+-
+-include $RULE_PATH/sql.rules
+-include $RULE_PATH/x11.rules
+-include $RULE_PATH/icmp.rules
+-include $RULE_PATH/netbios.rules
+-include $RULE_PATH/misc.rules
+-include $RULE_PATH/attack-responses.rules
+-include $RULE_PATH/oracle.rules
+-include $RULE_PATH/mysql.rules
+-include $RULE_PATH/snmp.rules
+-
+-include $RULE_PATH/smtp.rules
+-include $RULE_PATH/imap.rules
+-include $RULE_PATH/pop2.rules
+-include $RULE_PATH/pop3.rules
++#include $RULE_PATH/finger.rules
++#include $RULE_PATH/ftp.rules
++#include $RULE_PATH/telnet.rules
++#include $RULE_PATH/rpc.rules
++#include $RULE_PATH/rservices.rules
++#include $RULE_PATH/dos.rules
++#include $RULE_PATH/ddos.rules
++#include $RULE_PATH/dns.rules
++#include $RULE_PATH/tftp.rules
++
++#include $RULE_PATH/web-cgi.rules
++#include $RULE_PATH/web-coldfusion.rules
++#include $RULE_PATH/web-iis.rules
++#include $RULE_PATH/web-frontpage.rules
++#include $RULE_PATH/web-misc.rules
++#include $RULE_PATH/web-client.rules
++#include $RULE_PATH/web-php.rules
++
++#include $RULE_PATH/sql.rules
++#include $RULE_PATH/x11.rules
++#include $RULE_PATH/icmp.rules
++#include $RULE_PATH/netbios.rules
++#include $RULE_PATH/misc.rules
++#include $RULE_PATH/attack-responses.rules
++#include $RULE_PATH/oracle.rules
++#include $RULE_PATH/mysql.rules
++#include $RULE_PATH/snmp.rules
++
++#include $RULE_PATH/smtp.rules
++#include $RULE_PATH/imap.rules
++#include $RULE_PATH/pop2.rules
++#include $RULE_PATH/pop3.rules
+
+-include $RULE_PATH/nntp.rules
+-include $RULE_PATH/other-ids.rules
++#include $RULE_PATH/nntp.rules
++#include $RULE_PATH/other-ids.rules
+ # include $RULE_PATH/web-attacks.rules
+ # include $RULE_PATH/backdoor.rules
+ # include $RULE_PATH/shellcode.rules
+@@ -856,11 +857,11 @@
+ # include $RULE_PATH/porn.rules
+ # include $RULE_PATH/info.rules
+ # include $RULE_PATH/icmp-info.rules
+- include $RULE_PATH/virus.rules
++# include $RULE_PATH/virus.rules
+ # include $RULE_PATH/chat.rules
+ # include $RULE_PATH/multimedia.rules
+ # include $RULE_PATH/p2p.rules
+-include $RULE_PATH/experimental.rules
++#include $RULE_PATH/experimental.rules
+ #include $RULE_PATH/wifi.rules
+
+ # Include any thresholding or suppression commands. See threshold.conf in the
diff --git a/package/snort/Config.in b/package/snort/Config.in
new file mode 100644
index 000000000..cb376c2f4
--- /dev/null
+++ b/package/snort/Config.in
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_SNORT
+ prompt "snort............................. Ligthweight Network Intrusion Detection System (NIDS)"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNET
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBPCRE
+ help
+
+ A ligthweight Network Intrusion Detection System (NIDS)
+
+ http://www.snort.org/
+
+ Depends:
+ - libnet
+ - libpcap
+ - libpcre
+
diff --git a/package/snort/Makefile b/package/snort/Makefile
new file mode 100644
index 000000000..a81c7ac70
--- /dev/null
+++ b/package/snort/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= snort
+PKG_VERSION:= 2.6.1.2
+PKG_RELEASE:= 8
+PKG_MD5SUM:= 22c448e25538cdf74c62abe586aeac0a
+MASTER_SITES:= http://www.snort.org/dl/current/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SNORT,snort,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --enable-flexresp \
+ --with-libnet-includes="${STAGING_DIR}/usr/include" \
+ --with-libnet-libraries="${STAGING_DIR}/usr/lib" \
+ --with-libpcap-includes="${STAGING_DIR}/usr/include" \
+ --with-libpcap-libraries="${STAGING_DIR}/usr/lib" \
+ --with-libpcre-includes="${STAGING_DIR}/usr/include" \
+ --with-libpcre-libraries="${STAGING_DIR}/usr/lib" \
+ --without-mysql \
+ --without-postgresql \
+ --disable-inline
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SNORT}/usr/bin
+ ${INSTALL_DIR} ${IDIR_SNORT}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_SNORT}/etc/snort
+ ${INSTALL_BIN} ./files/snort.init \
+ ${IDIR_SNORT}/etc/init.d/snort
+ ${INSTALL_DATA} ${WRKBUILD}/etc/snort.conf ${IDIR_SNORT}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/classification.config \
+ ${IDIR_SNORT}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/gen-msg.map ${IDIR_SNORT}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/reference.config ${IDIR_SNORT}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/sid-msg.map ${IDIR_SNORT}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/threshold.conf ${IDIR_SNORT}/etc/snort/
+ ${INSTALL_DATA} ${WRKBUILD}/etc/unicode.map ${IDIR_SNORT}/etc/snort/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/snort ${IDIR_SNORT}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/snort/files/snort.init b/package/snort/files/snort.init
new file mode 100644
index 000000000..4880fd549
--- /dev/null
+++ b/package/snort/files/snort.init
@@ -0,0 +1,21 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${snort:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ snort $snort_flags
+ ;;
+stop)
+ killall snort
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/snort/ipkg/snort.conffiles b/package/snort/ipkg/snort.conffiles
new file mode 100644
index 000000000..a224c4c1d
--- /dev/null
+++ b/package/snort/ipkg/snort.conffiles
@@ -0,0 +1,2 @@
+/etc/snort/snort.conf
+/etc/snort/threshold.conf
diff --git a/package/snort/ipkg/snort.control b/package/snort/ipkg/snort.control
new file mode 100644
index 000000000..23ed58724
--- /dev/null
+++ b/package/snort/ipkg/snort.control
@@ -0,0 +1,6 @@
+Package: snort
+Priority: optional
+Section: net
+Description: a flexible Network Intrusion Detection System (NIDS),
+ built without database logging support
+Depends: libnet, libpcap, libpcre
diff --git a/package/snort/ipkg/snort.postinst b/package/snort/ipkg/snort.postinst
new file mode 100644
index 000000000..c491d1c5b
--- /dev/null
+++ b/package/snort/ipkg/snort.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf snort snort NO
+add_rcconf snort_flags snort_flags "-i eth0.0 -c /etc/snort/snort.conf -D -N -q -s"
diff --git a/package/socat/Config.in b/package/socat/Config.in
new file mode 100644
index 000000000..072bf8190
--- /dev/null
+++ b/package/socat/Config.in
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_SOCAT
+ prompt "socat............................. A multipurpose relay (SOcket CAT)"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBPTHREAD
+ help
+ SoCat (for SOcket CAT) establishes two bidirectional byte streams and
+ transfers data between them.
+ Data channels may be files, pipes, devices (terminal or modem, etc.), or
+ sockets (Unix, IPv4, IPv6, raw, UDP, TCP, SSL). It provides forking,
+ logging and tracing, different modes for interprocess communication and
+ many more options.
+
+ http://www.dest-unreach.org/socat/
+
+ Depends: openssl
+
diff --git a/package/socat/Makefile b/package/socat/Makefile
new file mode 100644
index 000000000..47a40755a
--- /dev/null
+++ b/package/socat/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= socat
+PKG_VERSION:= 1.7.0.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 82967132b5a8ca4d07e54370fdcb2662
+MASTER_SITES:= http://www.dest-unreach.org/socat/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SOCAT,socat,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= sc_cv_termios_ispeed="no" \
+ sc_cv_sys_crdly_shift=9 \
+ sc_cv_sys_tabdly_shift=11 \
+ sc_cv_sys_csize_shift=4
+CONFIGURE_ARGS+= --disable-libwrap \
+ --disable-readline
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SOCAT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/socat ${IDIR_SOCAT}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/socat/ipkg/socat.control b/package/socat/ipkg/socat.control
new file mode 100644
index 000000000..7c079a920
--- /dev/null
+++ b/package/socat/ipkg/socat.control
@@ -0,0 +1,11 @@
+Package: socat
+Priority: optional
+Section: net
+Depends: libpthread, libopenssl
+Description: A multipurpose relay (SOcket CAT).
+ SoCat (for SOcket CAT) establishes two bidirectional byte streams and
+ transfers data between them.
+ Data channels may be files, pipes, devices (terminal or modem, etc.), or
+ sockets (Unix, IPv4, IPv6, raw, UDP, TCP, SSL). It provides forking,
+ logging and tracing, different modes for interprocess communication and
+ many more options.
diff --git a/package/socat/patches/501-honor_ldflags.patch b/package/socat/patches/501-honor_ldflags.patch
new file mode 100644
index 000000000..a41a929f1
--- /dev/null
+++ b/package/socat/patches/501-honor_ldflags.patch
@@ -0,0 +1,13 @@
+diff -ruN socat-1.4-old/Makefile.in socat-1.4-new/Makefile.in
+--- socat-1.4-old/Makefile.in 2005-09-10 22:09:11.000000000 +0200
++++ socat-1.4-new/Makefile.in 2005-10-08 17:12:45.000000000 +0200
+@@ -36,7 +36,8 @@
+
+ #0 CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(INCLS)
+ CFLAGS = @CFLAGS@ $(CCOPTS) $(DEFS) $(CPPFLAGS)
+-CLIBS = $(LIBS)
++LDFLAGS = @LDFLAGS@
++CLIBS = $(LDFLAGS) $(LIBS)
+ #CLIBS = $(LIBS) -lm -lefence
+ XIOSRCS = xioinitialize.c xiohelp.c xioparam.c xiodiag.c xioopen.c xioopts.c \
+ xiosignal.c xiosigchld.c xioread.c xiowrite.c \
diff --git a/package/speex/Config.in b/package/speex/Config.in
new file mode 100644
index 000000000..f9cfe97ba
--- /dev/null
+++ b/package/speex/Config.in
@@ -0,0 +1,24 @@
+config ADK_COMPILE_SPEEX
+ tristate
+ default n
+ depends ADK_CXX
+ depends ADK_PACKAGE_LIBSPEEX
+
+config ADK_PACKAGE_LIBSPEEX
+ prompt "libspeex.......................... Open source patent-free speech compression codec"
+ tristate
+ default n
+ select ADK_COMPILE_SPEEX
+ help
+
+ Speex is an Open Source/Free Software patent-free audio compression
+ format designed for speech. The Speex Project aims to lower the
+ barrier of entry for voice applications by providing a free
+ alternative to expensive proprietary speech codecs. Moreover, Speex
+ is well-adapted to Internet applications and provides useful features
+ that are not present in most other codecs.
+
+ http://www.speex.org/
+
+ This package contains the shared codec library, needed by other programs.
+
diff --git a/package/speex/Makefile b/package/speex/Makefile
new file mode 100644
index 000000000..76eb03744
--- /dev/null
+++ b/package/speex/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= speex
+PKG_VERSION:= 1.2rc1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c4438b22c08e5811ff10e2b06ee9b9ae
+MASTER_SITES:= http://downloads.us.xiph.org/releases/speex/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBSPEEX,libspeex,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-ogg --disable-oggtest --enable-fixed-point
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= bin_PROGRAMS=""
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBSPEEX}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libspeex.so.* ${IDIR_LIBSPEEX}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/speex/ipkg/libspeex.control b/package/speex/ipkg/libspeex.control
new file mode 100644
index 000000000..5dc542eee
--- /dev/null
+++ b/package/speex/ipkg/libspeex.control
@@ -0,0 +1,4 @@
+Package: libspeex
+Priority: optional
+Section: libs
+Description: an open source patent-free speech compression codec
diff --git a/package/sqlite/Config.in b/package/sqlite/Config.in
new file mode 100644
index 000000000..b534356b6
--- /dev/null
+++ b/package/sqlite/Config.in
@@ -0,0 +1,75 @@
+config ADK_COMPILE_SQLITE
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBSQLITE
+
+config ADK_PACKAGE_LIBSQLITE
+ prompt "libsqlite......................... Self-contained, embeddable, zero-configuration SQL database engine"
+ tristate
+ default n
+ select ADK_COMPILE_SQLITE
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBREADLINE
+ help
+ SQLite is a small C library that implements a self-contained, embeddable,
+ zero-configuration SQL database engine. Features include:
+
+ * Transactions are atomic, consistent, isolated, and durable (ACID)
+ even after system crashes and power failures.
+ * Zero-configuration - no setup or administration needed.
+ * Implements most of SQL92. (Features not supported)
+ * A complete database is stored in a single disk file.
+ * Database files can be freely shared between machines with different
+ byte orders.
+ * Supports databases up to 2 terabytes (241 bytes) in size.
+ * Sizes of strings and BLOBs limited only by available memory.
+ * Small code footprint: less than 30K lines of C code, less than 250KB
+ code space (gcc on i486)
+ * Faster than popular client/server database engines for most common
+ operations.
+ * Simple, easy to use API.
+ * TCL bindings included. Bindings for many other languages available
+ separately.
+ * Well-commented source code with over 95% test coverage.
+ * Self-contained: no external dependencies.
+ * Sources are in the public domain. Use for any purpose.
+
+ http://www.sqlite.org/
+
+ This package contains the shared library, needed by other programs.
+
+config ADK_PACKAGE_SQLITE_CLI
+ prompt "sqlite-cli...................... Command line interface for SQLite"
+ tristate
+ default n
+ depends ADK_PACKAGE_LIBSQLITE
+ help
+ SQLite is a small C library that implements a self-contained, embeddable,
+ zero-configuration SQL database engine. Features include:
+
+ * Transactions are atomic, consistent, isolated, and durable (ACID)
+ even after system crashes and power failures.
+ * Zero-configuration - no setup or administration needed.
+ * Implements most of SQL92. (Features not supported)
+ * A complete database is stored in a single disk file.
+ * Database files can be freely shared between machines with different
+ byte orders.
+ * Supports databases up to 2 terabytes (241 bytes) in size.
+ * Sizes of strings and BLOBs limited only by available memory.
+ * Small code footprint: less than 30K lines of C code, less than 250KB
+ code space (gcc on i486)
+ * Faster than popular client/server database engines for most common
+ operations.
+ * Simple, easy to use API.
+ * TCL bindings included. Bindings for many other languages available
+ separately.
+ * Well-commented source code with over 95% test coverage.
+ * Self-contained: no external dependencies.
+ * Sources are in the public domain. Use for any purpose.
+
+ http://www.sqlite.org/
+
+ This package contains a terminal-based front-end to the SQLite library
+ that can evaluate queries interactively and display the results in
+ multiple formats.
+
diff --git a/package/sqlite/Makefile b/package/sqlite/Makefile
new file mode 100644
index 000000000..5c1a8ce80
--- /dev/null
+++ b/package/sqlite/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= sqlite
+PKG_VERSION:= 3.6.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 46f92e42243bc51aaa3871645ce78bd5
+MASTER_SITES:= http://www.sqlite.org/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBSQLITE,libsqlite,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQLITE_CLI,sqlite-cli,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= config_BUILD_CC="${HOSTCC}" \
+ config_BUILD_CFLAGS="-O2" \
+ config_TARGET_CC="${TARGET_CC}" \
+ config_TARGET_CFLAGS="${TARGET_CFLAGS}" \
+ config_TARGET_READLINE_INC="-I${STAGING_DIR}/usr/include" \
+ config_TARGET_READLINE_LIBS="-L${STAGING_DIR}/usr/lib -lreadline -lncurses"
+MAKE_FLAGS+= LIBPTHREAD=-lm
+CONFIGURE_ARGS+= --disable-tcl
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LIBSQLITE}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libsqlite3.so.* ${IDIR_LIBSQLITE}/usr/lib/
+ ${INSTALL_DIR} ${IDIR_SQLITE_CLI}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/sqlite3 ${IDIR_SQLITE_CLI}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/sqlite/ipkg/libsqlite.control b/package/sqlite/ipkg/libsqlite.control
new file mode 100644
index 000000000..4b1927042
--- /dev/null
+++ b/package/sqlite/ipkg/libsqlite.control
@@ -0,0 +1,4 @@
+Package: libsqlite
+Priority: optional
+Section: libs
+Description: Self-contained, embeddable, zero-configuration SQL database engine
diff --git a/package/sqlite/ipkg/sqlite-cli.control b/package/sqlite/ipkg/sqlite-cli.control
new file mode 100644
index 000000000..b70c9cf5b
--- /dev/null
+++ b/package/sqlite/ipkg/sqlite-cli.control
@@ -0,0 +1,5 @@
+Package: sqlite-cli
+Priority: optional
+Section: libs
+Description: Command Line Interface (CLI) for SQLite
+Depends: libsqlite, libncurses, libreadline
diff --git a/package/squid/Config.in b/package/squid/Config.in
new file mode 100644
index 000000000..47c1250b4
--- /dev/null
+++ b/package/squid/Config.in
@@ -0,0 +1,93 @@
+#menu "squid............................. proxy and web cache"
+
+config ADK_PACKAGE_SQUID
+ prompt "squid............................. full-featured Web proxy cache"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+ Squid is a high-performance proxy caching server for web clients,
+ supporting FTP, gopher, and HTTP data objects. Unlike traditional
+ caching software, Squid handles all requests in a single,
+ non-blocking, I/O-driven process.
+
+ http://www.squid-cache.org
+
+config ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_GETPWNAM
+ prompt " squid-mod-basic-auth-getpwnam....... getpwnam basic authentication helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Password basic authentication helper
+
+config ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_NCSA
+ prompt " squid-mod-basic-auth-ncsa........... NCSA basic authentication helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ NCSA basic authentication helper
+
+config ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_SMB
+ prompt " squid-mod-basic-auth-smb............ Samba basic authentication helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Samba basic authentication helper
+
+config ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_WINBIND
+ prompt " squid-mod-basic-auth-winbind........ Winbind basic authentication helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Winbind basic authentication helper
+
+config ADK_PACKAGE_SQUID_MOD_DIGEST_AUTH_PASSWORD
+ prompt " squid-mod-digest-auth-password...... Password digest authentication ehlper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Password digest authentication helper
+
+config ADK_PACKAGE_SQUID_MOD_EXTERNAL_ACL_IP_USER
+ prompt " squid-mod-external-acl-ip_user...... IP user external ACL helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ IP user external ACL helper
+
+config ADK_PACKAGE_SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP
+ prompt " squid-mod-external-acl-unix-group... Unix group external ACL helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Unix group external ACL helper
+
+config ADK_PACKAGE_SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP
+ prompt " squid-mod-external-acl-winbind-group Winbind group external ACL helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Winbind group external ACL helper
+
+config ADK_PACKAGE_SQUID_MOD_NTLM_AUTH_FAKEAUTH
+ prompt " squid-mod-ntlm-auth-fakeauth........ Fakeauth NTLM authentication helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Fakeauth NTLM authentication helper
+
+config ADK_PACKAGE_SQUID_MOD_NTLM_AUTH_SMB_AUTH
+ prompt " squid-mod-ntlm-auth-smb-auth........ Samba NTLM authentication helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Samba NTLM authentication helper
+
+config ADK_PACKAGE_SQUID_MOD_NTLM_AUTH_WINBIND_AUTH
+ prompt " squid-mod-ntlm-auth-winbind-auth.... Winbind NTLM authentication helper"
+ tristate
+ depends ADK_PACKAGE_SQUID
+ help
+ Winbind NTLM authentication helper
+
+#endmenu
diff --git a/package/squid/Makefile b/package/squid/Makefile
new file mode 100644
index 000000000..fb1ac63af
--- /dev/null
+++ b/package/squid/Makefile
@@ -0,0 +1,173 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= squid
+PKG_VERSION:= 2.5.STABLE13
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3e64468e123be1246d17486dab6bee87
+MASTER_SITES:= http://www.squid-cache.org/Versions/v2/2.5/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+AUTH_MODULES:=basic digest ntlm
+ifneq (${ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_GETPWNAM},)
+BASIC_AUTH_HELPERS+= getpwnam
+endif
+ifneq (${ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_NCSA},)
+BASIC_AUTH_HELPERS+= NCSA
+endif
+ifneq (${ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_SMB},)
+BASIC_AUTH_HELPERS+= SMB
+endif
+ifneq (${ADK_PACKAGE_SQUID_MOD_BASIC_AUTH_WINBIND},)
+BASIC_AUTH_HELPERS+= winbind
+endif
+
+ifneq (${ADK_PACKAGE_SQUID_MOD_DIGEST_AUTH_PASSWORD},)
+DIGEST_AUTH_HELPERS:= password
+endif
+
+ifneq (${ADK_PACKAGE_SQUID_MOD_EXTERNAL_ACL_IP_USER},)
+EXTERNAL_ACL_HELPERS+= ip_user
+endif
+ifneq (${ADK_PACKAGE_SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP},)
+EXTERNAL_ACL_HELPERS+= unix_group
+endif
+ifneq (${ADK_PACKAGE_SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP},)
+EXTERNAL_ACL_HELPERS+= winbind_group
+endif
+
+ifneq (${ADK_PACKAGE_SQUID_MOD_NTLM_AUTH_FAKEAUTH},)
+NTLM_AUTH_HELPERS+= fakeauth
+endif
+ifneq (${ADK_PACKAGE_SQUID_MOD_NTLM_AUTH_SMB_AUTH},)
+NTLM_AUTH_HELPERS+= SMB
+endif
+ifneq (${ADK_PACKAGE_SQUID_MOD_NTLM_AUTH_WINBIND_AUTH},)
+NTLM_AUTH_HELPERS+= winbind
+endif
+
+include ${TOPDIR}/mk/package.mk
+
+define PKG_mod_template
+if [ -e ${WRKINST}/usr/lib/squid/${2} ]; then \
+ ${INSTALL_DIR} ${IDIR_${1}}/usr/lib/squid/ ; \
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/squid/${2} ${IDIR_${1}}/usr/lib/squid/ ; \
+fi
+endef
+
+#$${IPKG_${1}}:
+# install -d -m0755 $${IDIR_${1}}/usr/lib/squid
+# if [ -e ${WRKINST}/usr/lib/squid/${2} ]; then \
+# ${CP} ${WRKINST}/usr/lib/squid/${2} $${IDIR_${1}}/usr/lib/squid/ ; \
+# fi
+# ${RSTRIP} $${IDIR_${1}}
+# ${IPKG_BUILD} $${IDIR_${1}} ${PACKAGE_DIR}
+#
+#endef
+
+
+$(eval $(call PKG_template,SQUID,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_GETPWNAM,${PKG_NAME}-mod-basic-auth-getpwnam,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_NCSA,${PKG_NAME}-mod-basic-auth-ncsa,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_SMB,${PKG_NAME}-mod-basic-auth-smb,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_BASIC_AUTH_WINBIND,${PKG_NAME}-mod-basic-auth-winbind,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_DIGEST_AUTH_PASSWORD,${PKG_NAME}-mod-digest-auth-password,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_EXTERNAL_ACL_IP_USER,${PKG_NAME}-mod-external-acl-ip-user,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP,${PKG_NAME}-mod-external-acl-unix-group,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP,${PKG_NAME}-mod-external-acl-winbind-group,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_NTLM_AUTH_FAKEAUTH,${PKG_NAME}-mod-ntlm-auth-fakeauth,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_NTLM_AUTH_SMB_AUTH,${PKG_NAME}-mod-ntlm-auth-smb-auth,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SQUID_MOD_NTLM_AUTH_WINBIND_AUTH,${PKG_NAME}-mod-ntlm-auth-winbind-auth,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+#${eval ${call PKG_mod_template,SQUID_MOD_BASIC_AUTH_GETPWNAM,getpwname_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_BASIC_AUTH_LDAP,ldap}}
+#${eval ${call PKG_mod_template,SQUID_MOD_BASIC_AUTH_NCSA,ncsa_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_BASIC_AUTH_SMB,smb_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_BASIC_AUTH_WINBIND,wb_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_DIGEST_AUTH_PASSWORD,digest_pw_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_IP_USER,ip_user_check}}
+#${eval ${call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_LDAP_GROUP,ldap_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP,squid_unix_group}}
+#${eval ${call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP,wb_group}}
+#${eval ${call PKG_mod_template,SQUID_MOD_NTLM_AUTH_FAKEAUTH,fakeauth_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_NTLM_AUTH_SMB_AUTH,ntlm_auth}}
+#${eval ${call PKG_mod_template,SQUID_MOD_NTLM_AUTH_WINBIND_AUTH,wb_ntlmauth}}
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_sizeof_void_p=4 \
+ ac_cv_sizeof_short=2 \
+ ac_cv_sizeof_int=4 \
+ ac_cv_sizeof_long=4 \
+ ac_cv_sizeof_long_long=8 \
+ ac_cv_sizeof___int64=0 \
+ ac_cv_sizeof_int16_t=2 \
+ ac_cv_sizeof_uint16_t=2 \
+ ac_cv_sizeof_u_int16_t=2 \
+ ac_cv_sizeof_int32_t=4 \
+ ac_cv_sizeof_uint32_t=4 \
+ ac_cv_sizeof_u_int32_t=4 \
+ ac_cv_sizeof_int64_t=8 \
+ ac_cv_sizeof_uint64_t=8 \
+ ac_cv_sizeof_u_int64_t=8 \
+ ac_cv_func_setresuid=no \
+ ac_cv_func_va_copy=no \
+ ac_cv_func___va_copy=no
+CONFIGURE_ARGS+= --datadir=/usr/share/squid \
+ --libexecdir=/usr/lib/squid \
+ --sysconfdir=/etc/squid \
+ --enable-static \
+ --with-gnu-ld \
+ --enable-x-accelerator-vary \
+ --with-pthreads \
+ --with-dl \
+ --enable-icmp \
+ --enable-kill-parent-hack \
+ --enable-arp-acl \
+ --enable-ssl \
+ --enable-htcp \
+ --enable-err-languages=English \
+ --enable-default-err-language=English \
+ --enable-linux-netfilter \
+ --enable-icmp \
+ --enable-external-acl-helpers="" \
+ --enable-underscores \
+ --enable-cache-digests \
+ --enable-referer-log \
+ --enable-delay-pools \
+ --enable-useragent-log \
+ --with-openssl=${STAGING_DIR}/usr \
+ --enable-auth="${AUTH_MODULES}" \
+ --enable-basic-auth-helpers="${BASIC_AUTH_HELPERS}" \
+ --enable-ntlm-auth-helpers="${NTLM_AUTH_HELPERS}" \
+ --enable-digest-auth-helpers="${DIGEST_AUTH_HELPERS}" \
+ --enable-external-acl-helpers="${EXTERNAL_ACL_HELPERS}"
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SQUID}/etc/squid
+ ${INSTALL_DATA} ${WRKINST}/etc/squid/mime.conf \
+ ${WRKINST}/etc/squid/squid.conf ${IDIR_SQUID}/etc/squid/
+ ${INSTALL_DIR} ${IDIR_SQUID}/usr/share/squid
+ ${CP} ${WRKINST}/usr/share/squid/* ${IDIR_SQUID}/usr/share/squid/
+ ${INSTALL_DIR} ${IDIR_SQUID}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/squid ${IDIR_SQUID}/usr/sbin/
+ $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_GETPWNAM,getpwname_auth)
+ $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_LDAP,ldap)
+ $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_NCSA,ncsa_auth)
+ $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_SMB,smb_auth)
+ $(call PKG_mod_template,SQUID_MOD_BASIC_AUTH_WINBIND,wb_auth)
+ $(call PKG_mod_template,SQUID_MOD_DIGEST_AUTH_PASSWORD,digest_pw_auth)
+ $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_IP_USER,ip_user_check)
+ $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_LDAP_GROUP,ldap_auth)
+ $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_UNIX_GROUP,squid_unix_group)
+ $(call PKG_mod_template,SQUID_MOD_EXTERNAL_ACL_WINBIND_GROUP,wb_group)
+ $(call PKG_mod_template,SQUID_MOD_NTLM_AUTH_FAKEAUTH,fakeauth_auth)
+ $(call PKG_mod_template,SQUID_MOD_NTLM_AUTH_SMB_AUTH,ntlm_auth)
+ $(call PKG_mod_template,SQUID_MOD_NTLM_AUTH_WINBIND_AUTH,wb_ntlmauth)
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/squid/ipkg/squid-mod-basic-auth-getpwnam.control b/package/squid/ipkg/squid-mod-basic-auth-getpwnam.control
new file mode 100644
index 000000000..cc9dfe661
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-basic-auth-getpwnam.control
@@ -0,0 +1,5 @@
+Package: squid-mod-basic-auth-getpwnam
+Section: net
+Depends: squid
+Priority: optional
+Description: getpwnam basic authentication helper
diff --git a/package/squid/ipkg/squid-mod-basic-auth-ncsa.control b/package/squid/ipkg/squid-mod-basic-auth-ncsa.control
new file mode 100644
index 000000000..94b8e9ece
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-basic-auth-ncsa.control
@@ -0,0 +1,5 @@
+Package: squid-mod-basic-auth-ncsa
+Section: net
+Depends: squid
+Priority: optional
+Description: ncsa basic authentication helper
diff --git a/package/squid/ipkg/squid-mod-basic-auth-smb.control b/package/squid/ipkg/squid-mod-basic-auth-smb.control
new file mode 100644
index 000000000..9adbeaa01
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-basic-auth-smb.control
@@ -0,0 +1,5 @@
+Package: squid-mod-basic-auth-smb
+Section: net
+Depends: squid
+Priority: optional
+Description: Samba basic authentication helper
diff --git a/package/squid/ipkg/squid-mod-basic-auth-winbind.control b/package/squid/ipkg/squid-mod-basic-auth-winbind.control
new file mode 100644
index 000000000..49047fab5
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-basic-auth-winbind.control
@@ -0,0 +1,5 @@
+Package: squid-mod-basic-auth-winbind
+Section: net
+Depends: squid
+Priority: optional
+Description: winbind basic authentication helper
diff --git a/package/squid/ipkg/squid-mod-digest-auth-password.control b/package/squid/ipkg/squid-mod-digest-auth-password.control
new file mode 100644
index 000000000..a78b61636
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-digest-auth-password.control
@@ -0,0 +1,5 @@
+Package: squid-mod-digest-auth-password
+Section: net
+Depends: squid
+Priority: optional
+Description: password digest authentication helper
diff --git a/package/squid/ipkg/squid-mod-external-acl-ip-user.control b/package/squid/ipkg/squid-mod-external-acl-ip-user.control
new file mode 100644
index 000000000..eb613a370
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-external-acl-ip-user.control
@@ -0,0 +1,5 @@
+Package: squid-mod-external-acl-ip-user
+Section: net
+Depends: squid
+Priority: optional
+Description: IP user external acl helper
diff --git a/package/squid/ipkg/squid-mod-external-acl-unix-group.control b/package/squid/ipkg/squid-mod-external-acl-unix-group.control
new file mode 100644
index 000000000..01614125f
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-external-acl-unix-group.control
@@ -0,0 +1,5 @@
+Package: squid-mod-external-acl-unix-group
+Section: net
+Depends: squid
+Priority: optional
+Description: Unix group external acl helper
diff --git a/package/squid/ipkg/squid-mod-external-acl-winbind-group.control b/package/squid/ipkg/squid-mod-external-acl-winbind-group.control
new file mode 100644
index 000000000..308a32d46
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-external-acl-winbind-group.control
@@ -0,0 +1,5 @@
+Package: squid-mod-external-acl-winbind-group
+Section: net
+Depends: squid
+Priority: optional
+Description: winbind group external acl helper
diff --git a/package/squid/ipkg/squid-mod-ntlm-auth-fakeauth.control b/package/squid/ipkg/squid-mod-ntlm-auth-fakeauth.control
new file mode 100644
index 000000000..51779ec01
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-ntlm-auth-fakeauth.control
@@ -0,0 +1,5 @@
+Package: squid-mod-ntlm-auth-fakeauth
+Section: net
+Depends: squid
+Priority: optional
+Description: fakeauht NTLM authentication helper
diff --git a/package/squid/ipkg/squid-mod-ntlm-auth-smb-auth.control b/package/squid/ipkg/squid-mod-ntlm-auth-smb-auth.control
new file mode 100644
index 000000000..1561bfa68
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-ntlm-auth-smb-auth.control
@@ -0,0 +1,5 @@
+Package: squid-mod-ntlm-auth-smb-auth
+Section: net
+Depends: squid
+Priority: optional
+Description: samba NTLM authentication helper
diff --git a/package/squid/ipkg/squid-mod-ntlm-auth-winbind-auth.control b/package/squid/ipkg/squid-mod-ntlm-auth-winbind-auth.control
new file mode 100644
index 000000000..1480c2965
--- /dev/null
+++ b/package/squid/ipkg/squid-mod-ntlm-auth-winbind-auth.control
@@ -0,0 +1,5 @@
+Package: squid-mod-ntlm-auth-winbind-auth
+Section: net
+Depends: squid
+Priority: optional
+Description: winbind NTLM authentication helper
diff --git a/package/squid/ipkg/squid.conffiles b/package/squid/ipkg/squid.conffiles
new file mode 100644
index 000000000..cd06f9da5
--- /dev/null
+++ b/package/squid/ipkg/squid.conffiles
@@ -0,0 +1,2 @@
+/etc/squid/mime.conf
+/etc/squid/squid.conf
diff --git a/package/squid/ipkg/squid.control b/package/squid/ipkg/squid.control
new file mode 100644
index 000000000..0657eb1ef
--- /dev/null
+++ b/package/squid/ipkg/squid.control
@@ -0,0 +1,5 @@
+Package: squid
+Section: net
+Depends: libopenssl, libpthread
+Priority: optional
+Description: squid web and cache proxy
diff --git a/package/squid/patches/patch-configure b/package/squid/patches/patch-configure
new file mode 100644
index 000000000..5ea663655
--- /dev/null
+++ b/package/squid/patches/patch-configure
@@ -0,0 +1,20 @@
+$Id$
+--- squid-2.5.STABLE13.orig/configure 2006-03-12 12:29:22.000000000 +0100
++++ squid-2.5.STABLE13/configure 2006-10-02 20:00:32.000000000 +0200
+@@ -1538,6 +1538,7 @@ CRYPTLIB=''
+ REGEXLIB='' # -lregex
+ LIBREGEX='' # libregex.a
+
++if false; then
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+ set dummy pkg-config; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+@@ -1573,7 +1574,7 @@ if test -n "$PKGCONFIG"; then
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+-
++fi
+
+ echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+ echo "configure:1580: checking for Cygwin environment" >&5
diff --git a/package/squid/patches/patch-include_config_h b/package/squid/patches/patch-include_config_h
new file mode 100644
index 000000000..1c8b1dc23
--- /dev/null
+++ b/package/squid/patches/patch-include_config_h
@@ -0,0 +1,48 @@
+$Id$
+
+ evil kludge because configure only checks the host system,
+ not the build system, yet builds a tool to run on it (cf_gen)
+
+ the real way to do this is probably to enhance configure.in
+ the way gcc uses it if doing a build with build!=(host==target),
+ but this should be enough for now; contact tg@ (PR#71) if it isn't
+
+--- squid-2.5.STABLE13.orig/include/config.h 2005-04-23 03:32:27.000000000 +0200
++++ squid-2.5.STABLE13/include/config.h 2006-09-18 19:21:26.000000000 +0200
+@@ -34,7 +34,36 @@
+ #ifndef SQUID_CONFIG_H
+ #define SQUID_CONFIG_H
+
++#ifndef BUILD_HOST_TOOL
+ #include "autoconf.h" /* For GNU autoconf variables */
++#else
++/* we just hope our host systems can cope */
++#define STDC_HEADERS 1
++#define HAVE_MEMCPY 1
++#define HAVE_MEMMOVE 1
++#define HAVE_MEMSET 1
++#define HAVE_MKSTEMP 1
++#define HAVE_MKTIME 1
++#define HAVE_ASSERT_H 1
++#define HAVE_CTYPE_H 1
++#define HAVE_DIRENT_H 1
++#define HAVE_ERRNO_H 1
++#define HAVE_FCNTL_H 1
++#define HAVE_GETOPT_H 1
++#define HAVE_INTTYPES_H 1
++#define HAVE_LIMITS_H 1
++#define HAVE_SIGNAL_H 1
++#define HAVE_STDARG_H 1
++#define HAVE_STDDEF_H 1
++#define HAVE_STDIO_H 1
++#define HAVE_STDLIB_H 1
++#define HAVE_STRING_H 1
++#define HAVE_SYS_PARAM_H 1
++#define HAVE_SYS_STAT_H 1
++#define HAVE_SYS_TIME_H 1
++#define HAVE_TIME_H 1
++#define HAVE_UNISTD_H 1
++#endif
+ #include "version.h"
+
+ /****************************************************************************
diff --git a/package/squid/patches/patch-lib_util_c b/package/squid/patches/patch-lib_util_c
new file mode 100644
index 000000000..622df36d6
--- /dev/null
+++ b/package/squid/patches/patch-lib_util_c
@@ -0,0 +1,22 @@
+$Id$
+
+ the host tools don't need libm
+
+--- squid-2.5.STABLE13.orig/lib/util.c 2005-06-30 20:50:56.000000000 +0200
++++ squid-2.5.STABLE13/lib/util.c 2006-09-18 19:23:46.000000000 +0200
+@@ -704,6 +704,7 @@ xpercent(double part, double whole)
+ return xdiv(100 * part, whole);
+ }
+
++#ifndef BUILD_HOST_TOOL
+ int
+ xpercentInt(double part, double whole)
+ {
+@@ -714,6 +715,7 @@ xpercentInt(double part, double whole)
+ return (int) floor(xpercent(part, whole) + 0.5);
+ #endif
+ }
++#endif
+
+ /* somewhat safer division */
+ double
diff --git a/package/squid/patches/patch-src_Makefile_in b/package/squid/patches/patch-src_Makefile_in
new file mode 100644
index 000000000..c77f4d6fb
--- /dev/null
+++ b/package/squid/patches/patch-src_Makefile_in
@@ -0,0 +1,19 @@
+$Id$
+
+ cross-configure kludge
+
+--- squid-2.5.STABLE13.orig/src/Makefile.in 2005-09-28 22:57:21.000000000 +0200
++++ squid-2.5.STABLE13/src/Makefile.in 2006-09-18 19:24:05.000000000 +0200
+@@ -702,7 +702,12 @@ cachemgr$(CGIEXT)$(EXEEXT): $(cachemgr__
+ $(LINK) $(cachemgr__CGIEXT__LDFLAGS) $(cachemgr__CGIEXT__OBJECTS) $(cachemgr__CGIEXT__LDADD) $(LIBS)
+ cf_gen$(EXEEXT): $(cf_gen_OBJECTS) $(cf_gen_DEPENDENCIES)
+ @rm -f cf_gen$(EXEEXT)
++ifneq (${HOSTCC},)
++ ${HOSTCC} ${INCLUDES} -DNDEBUG -DBUILD_HOST_TOOL -o cf_gen$(EXEEXT) \
++ $(srcdir)/cf_gen.c $(top_srcdir)/lib/util.c
++else
+ $(LINK) $(cf_gen_LDFLAGS) $(cf_gen_OBJECTS) $(cf_gen_LDADD) $(LIBS)
++endif
+ dnsserver$(EXEEXT): $(dnsserver_OBJECTS) $(dnsserver_DEPENDENCIES)
+ @rm -f dnsserver$(EXEEXT)
+ $(LINK) $(dnsserver_LDFLAGS) $(dnsserver_OBJECTS) $(dnsserver_LDADD) $(LIBS)
diff --git a/package/srelay/Config.in b/package/srelay/Config.in
new file mode 100644
index 000000000..bcaabdd6b
--- /dev/null
+++ b/package/srelay/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_SRELAY
+ prompt "srelay............................ A socks 4/5 proxy server"
+ tristate
+ default n
+ help
+ A socks 4/5 protocol proxy server
+
+ http://www.c-wind.com/srelay/
+
diff --git a/package/srelay/Makefile b/package/srelay/Makefile
new file mode 100644
index 000000000..edf96cb27
--- /dev/null
+++ b/package/srelay/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= srelay
+PKG_VERSION:= 0.4.6
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 4a9f3298b38d8588f0ffde31b946a47f
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=socks-relay/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SRELAY,srelay,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --disable-thread
+BUILD_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SRELAY}/usr/bin
+ ${INSTALL_DIR} ${IDIR_SRELAY}/etc/init.d
+ ${INSTALL_BIN} ${WRKBUILD}/srelay ${IDIR_SRELAY}/usr/bin/
+ ${INSTALL_BIN} ./files/srelay.init \
+ ${IDIR_SRELAY}/etc/init.d/${PKG_NAME}
+ ${INSTALL_DATA} ./files/srelay.conf ${IDIR_SRELAY}/etc
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/srelay/files/srelay.conf b/package/srelay/files/srelay.conf
new file mode 100644
index 000000000..e5d53ec96
--- /dev/null
+++ b/package/srelay/files/srelay.conf
@@ -0,0 +1,2 @@
+# allow local subnet to access socks proxy
+192.168.1.0/24 any -
diff --git a/package/srelay/files/srelay.init b/package/srelay/files/srelay.init
new file mode 100644
index 000000000..e12024cf3
--- /dev/null
+++ b/package/srelay/files/srelay.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${srelay:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/srelay.conf ] || exit 1
+ srelay ${srelay_flags}
+ ;;
+stop)
+ killall srelay
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/srelay/ipkg/srelay.conffiles b/package/srelay/ipkg/srelay.conffiles
new file mode 100644
index 000000000..d821cfd26
--- /dev/null
+++ b/package/srelay/ipkg/srelay.conffiles
@@ -0,0 +1 @@
+/etc/srelay.conf
diff --git a/package/srelay/ipkg/srelay.control b/package/srelay/ipkg/srelay.control
new file mode 100644
index 000000000..fdc21c864
--- /dev/null
+++ b/package/srelay/ipkg/srelay.control
@@ -0,0 +1,4 @@
+Package: srelay
+Priority: optional
+Section: net
+Description: A socks 4/5 proxy server
diff --git a/package/srelay/ipkg/srelay.postinst b/package/srelay/ipkg/srelay.postinst
new file mode 100644
index 000000000..a3322a763
--- /dev/null
+++ b/package/srelay/ipkg/srelay.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf srelay srelay NO
+add_rcconf srelay_flags srelay_flags "-c /etc/srelay.conf -r -s"
diff --git a/package/srelay/patches/01-cross_compile.patch b/package/srelay/patches/01-cross_compile.patch
new file mode 100644
index 000000000..f4ff1e681
--- /dev/null
+++ b/package/srelay/patches/01-cross_compile.patch
@@ -0,0 +1,12 @@
+diff -urN srelay-0.4.6/configure srelay-0.4.6.new/configure
+--- srelay-0.4.6/configure 2003-04-14 07:36:15.000000000 +0200
++++ srelay-0.4.6.new/configure 2006-03-28 15:11:42.000000000 +0200
+@@ -1395,7 +1395,7 @@
+ ;;
+ linux*)
+ case "$build_cpu" in
+- i*86)
++ i*86 | mips* | powerpc* | sparc* | x86_64*)
+ OS=LINUX
+ cat >>confdefs.h <<\_ACEOF
+ #define LINUX 1
diff --git a/package/ssltunnel/Config.in b/package/ssltunnel/Config.in
new file mode 100644
index 000000000..4c910c6a8
--- /dev/null
+++ b/package/ssltunnel/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_SSLTUNNEL
+ prompt "ssltunnel ........................ A PPP over SSL vpn tool"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_PPP
+ help
+ A PPP over SSL vpn tool
+
+ http://www.hsc.fr/ressources/outils/ssltunnel/index.html
+
diff --git a/package/ssltunnel/Makefile b/package/ssltunnel/Makefile
new file mode 100644
index 000000000..b475ec8b6
--- /dev/null
+++ b/package/ssltunnel/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ssltunnel
+PKG_VERSION:= 1.16
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4039b50566a33a4077883ea974e476d5
+MASTER_SITES:= http://www.hsc.fr/ressources/outils/ssltunnel/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SSLTUNNEL,ssltunnel,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= BUILD_CC="${TARGET_CC}"
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= CCOPT="${TARGET_CFLAGS}" INCLS="-I. -I${STAGING_DIR}/usr/include"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SSLTUNNEL}/usr/{bin,sbin}
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/pppclient ${IDIR_SSLTUNNEL}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/pppwho ${IDIR_SSLTUNNEL}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/pppserver ${IDIR_SSLTUNNEL}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ssltunnel/ipkg/ssltunnel.control b/package/ssltunnel/ipkg/ssltunnel.control
new file mode 100644
index 000000000..84fb8b68a
--- /dev/null
+++ b/package/ssltunnel/ipkg/ssltunnel.control
@@ -0,0 +1,5 @@
+Package: ssltunnel
+Priority: optional
+Section: net
+Description: A PPP over SSL vpn tool
+Depends: libopenssl, ppp
diff --git a/package/ssltunnel/patches/patch-client_ntlmauth_c b/package/ssltunnel/patches/patch-client_ntlmauth_c
new file mode 100644
index 000000000..8699ca947
--- /dev/null
+++ b/package/ssltunnel/patches/patch-client_ntlmauth_c
@@ -0,0 +1,11 @@
+$Id$
+--- ssltunnel-1.15.orig/client/ntlmauth.c 2004-03-10 13:35:21.000000000 +0000
++++ ssltunnel-1.15/client/ntlmauth.c 2007-08-13 21:25:22.000000000 +0000
+@@ -34,6 +34,7 @@
+ #include <syslog.h>
+ #include <iconv.h>
+ #include <ctype.h>
++#include <openssl/des.h>
+
+ #ifndef INADDR_NONE
+ #define INADDR_NONE 0xffffffff
diff --git a/package/ssmtp/Config.in b/package/ssmtp/Config.in
new file mode 100644
index 000000000..b4bff1c34
--- /dev/null
+++ b/package/ssmtp/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_SSMTP
+ prompt "ssmtp............................. A minimal and secure mail sender"
+ tristate
+ default n
+ help
+ A secure, effective and simple way of getting mail off a system to your
+ mail hub. It contains no suid-binaries or other dangerous things - no
+ mail spool to poke around in, and no daemons running in the background.
+ Mail is simply forwarded to the configured mailhost. Extremely easy
+ configuration.
+
+ http://packages.debian.org/stable/mail/ssmtp
+
diff --git a/package/ssmtp/Makefile b/package/ssmtp/Makefile
new file mode 100644
index 000000000..54db35b66
--- /dev/null
+++ b/package/ssmtp/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ssmtp
+PKG_VERSION:= 2.61
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 957e6fff08625fe34f4fc33d0925bbc9
+MASTER_SITES:= http://ftp.debian.org/debian/pool/main/s/ssmtp/
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.orig.tar.gz
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SSMTP,ssmtp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SSMTP}/etc/ssmtp
+ ${INSTALL_DIR} ${IDIR_SSMTP}/usr/sbin
+ ${INSTALL_DATA} ${WRKBUILD}/ssmtp.conf ${IDIR_SSMTP}/etc/ssmtp/
+ ${INSTALL_DATA} ${WRKBUILD}/revaliases ${IDIR_SSMTP}/etc/ssmtp/
+ ${INSTALL_BIN} ${WRKBUILD}/ssmtp ${IDIR_SSMTP}/usr/sbin/
+ ln -sf ssmtp ${IDIR_SSMTP}/usr/sbin/sendmail
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ssmtp/ipkg/ssmtp.conffiles b/package/ssmtp/ipkg/ssmtp.conffiles
new file mode 100644
index 000000000..d1da3e179
--- /dev/null
+++ b/package/ssmtp/ipkg/ssmtp.conffiles
@@ -0,0 +1,2 @@
+/etc/ssmtp/ssmtp.conf
+/etc/ssmtp/revaliases
diff --git a/package/ssmtp/ipkg/ssmtp.control b/package/ssmtp/ipkg/ssmtp.control
new file mode 100644
index 000000000..ec9360059
--- /dev/null
+++ b/package/ssmtp/ipkg/ssmtp.control
@@ -0,0 +1,4 @@
+Package: ssmtp
+Priority: optional
+Section: net
+Description: A minimal and secure mail sender
diff --git a/package/ssmtp/patches/500-debian-subset-2.61-2.patch b/package/ssmtp/patches/500-debian-subset-2.61-2.patch
new file mode 100644
index 000000000..f682c97a1
--- /dev/null
+++ b/package/ssmtp/patches/500-debian-subset-2.61-2.patch
@@ -0,0 +1,248 @@
+--- ssmtp-2.61.orig/ssmtp.conf
++++ ssmtp-2.61/ssmtp.conf
+@@ -36,3 +36,8 @@
+
+ # Use this RSA certificate.
+ #TLSCert=/etc/ssl/certs/ssmtp.pem
++
++# Get enhanced (*really* enhanced) debugging information in the logs
++# If you want to have debugging of the config file parsing, move this option
++# to the top of the config file and uncomment
++#Debug=YES
+--- ssmtp-2.61.orig/ssmtp.c
++++ ssmtp-2.61/ssmtp.c
+@@ -93,6 +93,7 @@
+ static char hextab[]="0123456789abcdef";
+ #endif
+
++ssize_t outbytes;
+
+ /*
+ log_event() -- Write event to syslog (or log file if defined)
+@@ -129,7 +130,7 @@
+ #endif
+ }
+
+-void smtp_write(int fd, char *format, ...);
++ssize_t smtp_write(int fd, char *format, ...);
+ int smtp_read(int fd, char *response);
+ int smtp_read_all(int fd, char *response);
+ int smtp_okay(int fd, char *response);
+@@ -150,7 +151,7 @@
+ if(isatty(fileno(stdin))) {
+ if(log_level > 0) {
+ log_event(LOG_ERR,
+- "stdin is a TTY - not saving to %s/dead.letter, pw->pw_dir");
++ "stdin is a TTY - not saving to %s/dead.letter", pw->pw_dir);
+ }
+ return;
+ }
+@@ -964,6 +965,17 @@
+ log_event(LOG_INFO, "Set AuthMethod=\"%s\"\n", auth_method);
+ }
+ }
++ else if (strcasecmp(p, "Debug") == 0)
++ {
++ if (strcasecmp(q, "YES") == 0)
++ {
++ log_level = 1;
++ }
++ else
++ {
++ log_level = 0;
++ }
++ }
+ else {
+ log_event(LOG_INFO, "Unable to set %s=\"%s\"\n", p, q);
+ }
+@@ -1232,10 +1244,11 @@
+ /*
+ smtp_write() -- A printf to an fd and append <CR/LF>
+ */
+-void smtp_write(int fd, char *format, ...)
++ssize_t smtp_write(int fd, char *format, ...)
+ {
+ char buf[(BUF_SZ + 1)];
+ va_list ap;
++ ssize_t outbytes = 0;
+
+ va_start(ap, format);
+ if(vsnprintf(buf, (BUF_SZ - 2), format, ap) == -1) {
+@@ -1252,7 +1265,9 @@
+ }
+ (void)strcat(buf, "\r\n");
+
+- (void)fd_puts(fd, buf, strlen(buf));
++ outbytes = fd_puts(fd, buf, strlen(buf));
++
++ return (outbytes >= 0) ? outbytes : 0;
+ }
+
+ /*
+@@ -1282,6 +1297,8 @@
+ int i, sock;
+ uid_t uid;
+
++ outbytes = 0;
++
+ uid = getuid();
+ if((pw = getpwuid(uid)) == (struct passwd *)NULL) {
+ die("Could not find password entry for UID %d", uid);
+@@ -1335,10 +1352,10 @@
+
+ /* If user supplied username and password, then try ELHO */
+ if(auth_user) {
+- smtp_write(sock, "EHLO %s", hostname);
++ outbytes += smtp_write(sock, "EHLO %s", hostname);
+ }
+ else {
+- smtp_write(sock, "HELO %s", hostname);
++ outbytes += smtp_write(sock, "HELO %s", hostname);
+ }
+ (void)alarm((unsigned) MEDWAIT);
+
+@@ -1354,7 +1371,7 @@
+ }
+
+ if(strcasecmp(auth_method, "cram-md5") == 0) {
+- smtp_write(sock, "AUTH CRAM-MD5");
++ outbytes += smtp_write(sock, "AUTH CRAM-MD5");
+ (void)alarm((unsigned) MEDWAIT);
+
+ if(smtp_read(sock, buf) != 3) {
+@@ -1369,7 +1386,7 @@
+ #endif
+ memset(buf, 0, sizeof(buf));
+ to64frombits(buf, auth_user, strlen(auth_user));
+- smtp_write(sock, "AUTH LOGIN %s", buf);
++ outbytes += smtp_write(sock, "AUTH LOGIN %s", buf);
+
+ (void)alarm((unsigned) MEDWAIT);
+ if(smtp_read(sock, buf) != 3) {
+@@ -1381,7 +1398,7 @@
+ #ifdef MD5AUTH
+ }
+ #endif
+- smtp_write(sock, "%s", buf);
++ outbytes += smtp_write(sock, "%s", buf);
+ (void)alarm((unsigned) MEDWAIT);
+
+ if(smtp_okay(sock, buf) == False) {
+@@ -1390,7 +1407,7 @@
+ }
+
+ /* Send "MAIL FROM:" line */
+- smtp_write(sock, "MAIL FROM:<%s>", uad);
++ outbytes += smtp_write(sock, "MAIL FROM:<%s>", uad);
+
+ (void)alarm((unsigned) MEDWAIT);
+
+@@ -1408,7 +1425,7 @@
+
+ while(rt->next) {
+ p = rcpt_remap(rt->string);
+- smtp_write(sock, "RCPT TO:<%s>", p);
++ outbytes += smtp_write(sock, "RCPT TO:<%s>", p);
+
+ (void)alarm((unsigned)MEDWAIT);
+
+@@ -1425,7 +1442,7 @@
+ while(p) {
+ /* RFC822 Address -> "foo@bar" */
+ q = rcpt_remap(addr_parse(p));
+- smtp_write(sock, "RCPT TO:<%s>", q);
++ outbytes += smtp_write(sock, "RCPT TO:<%s>", q);
+
+ (void)alarm((unsigned) MEDWAIT);
+
+@@ -1439,7 +1456,7 @@
+ }
+
+ /* Send DATA */
+- smtp_write(sock, "DATA");
++ outbytes += smtp_write(sock, "DATA");
+ (void)alarm((unsigned) MEDWAIT);
+
+ if(smtp_read(sock, buf) != 3) {
+@@ -1447,45 +1464,45 @@
+ die("%s", buf);
+ }
+
+- smtp_write(sock,
++ outbytes += smtp_write(sock,
+ "Received: by %s (sSMTP sendmail emulation); %s", hostname, arpadate);
+
+ if(have_from == False) {
+- smtp_write(sock, "From: %s", from);
++ outbytes += smtp_write(sock, "From: %s", from);
+ }
+
+ if(have_date == False) {
+- smtp_write(sock, "Date: %s", arpadate);
++ outbytes += smtp_write(sock, "Date: %s", arpadate);
+ }
+
+ #ifdef HASTO_OPTION
+ if(have_to == False) {
+- smtp_write(sock, "To: postmaster");
++ outbytes += smtp_write(sock, "To: postmaster");
+ }
+ #endif
+
+ ht = &headers;
+ while(ht->next) {
+- smtp_write(sock, "%s", ht->string);
++ outbytes += smtp_write(sock, "%s", ht->string);
+ ht = ht->next;
+ }
+
+ (void)alarm((unsigned) MEDWAIT);
+
+ /* End of headers, start body */
+- smtp_write(sock, "");
++ outbytes += smtp_write(sock, "");
+
+ while(fgets(buf, sizeof(buf), stdin)) {
+ /* Trim off \n, double leading .'s */
+ standardise(buf);
+
+- smtp_write(sock, "%s", buf);
++ outbytes += smtp_write(sock, "%s", buf);
+
+ (void)alarm((unsigned) MEDWAIT);
+ }
+ /* End of body */
+
+- smtp_write(sock, ".");
++ outbytes += smtp_write(sock, ".");
+ (void)alarm((unsigned) MAXWAIT);
+
+ if(smtp_okay(sock, buf) == 0) {
+@@ -1495,11 +1512,12 @@
+ /* Close conection */
+ (void)signal(SIGALRM, SIG_IGN);
+
+- smtp_write(sock, "QUIT");
++ outbytes += smtp_write(sock, "QUIT");
+ (void)smtp_okay(sock, buf);
+ (void)close(sock);
+
+- log_event(LOG_INFO, "Sent mail for %s (%s)", from_strip(uad), buf);
++ log_event(LOG_INFO, "Sent mail for %s (%s) uid=%d username=%s outbytes=%d",
++ from_strip(uad), buf, uid, pw->pw_name, outbytes);
+
+ return(0);
+ }
+--- ssmtp-2.61.orig/configure.in
++++ ssmtp-2.61/configure.in
+@@ -24,8 +24,8 @@
+ AC_STRUCT_TM
+
+ dnl Checks for libraries.
+-AC_CHECK_LIB(nsl, gethostname)
+-AC_CHECK_LIB(socket, socket)
++AC_SEARCH_LIBS(gethostname, nsl)
++AC_SEARCH_LIBS(socket, socket)
+
+ dnl Checks for library functions.
+ AC_TYPE_SIGNAL
diff --git a/package/ssmtp/patches/901-strftime_space_padding.patch b/package/ssmtp/patches/901-strftime_space_padding.patch
new file mode 100644
index 000000000..dd0b9b116
--- /dev/null
+++ b/package/ssmtp/patches/901-strftime_space_padding.patch
@@ -0,0 +1,12 @@
+diff -ruN ssmtp-2.60-old/arpadate.c ssmtp-2.60-new/arpadate.c
+--- ssmtp-2.60-old/arpadate.c 2002-12-08 18:30:11.000000000 +0100
++++ ssmtp-2.60-new/arpadate.c 2004-05-23 18:54:32.000000000 +0200
+@@ -79,7 +79,7 @@
+ time_t now;
+
+ /* RFC822 format string borrowed from GNU shellutils date.c */
+- const char *format = "%a, %_d %b %Y %H:%M:%S %z";
++ const char *format = "%a, %d %b %Y %H:%M:%S %z";
+
+ now = time(NULL);
+
diff --git a/package/strace/Config.in b/package/strace/Config.in
new file mode 100644
index 000000000..53e147d01
--- /dev/null
+++ b/package/strace/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_STRACE
+ prompt "strace............................ System call tracer"
+ tristate
+ default n
+ help
+ A useful diagnostic, instructional, and debugging tool.
+ Allows you to track what system calls a program makes
+ while it is running.
+
+ http://sourceforge.net/projects/strace/
+
diff --git a/package/strace/Makefile b/package/strace/Makefile
new file mode 100644
index 000000000..6bd719cfe
--- /dev/null
+++ b/package/strace/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= strace
+PKG_VERSION:= 4.5.18
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e9449fcee97e6a8ed73934c883c870e0
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=strace/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,STRACE,strace,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_STRACE}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_STRACE}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/strace/ipkg/strace.control b/package/strace/ipkg/strace.control
new file mode 100644
index 000000000..8561e55b4
--- /dev/null
+++ b/package/strace/ipkg/strace.control
@@ -0,0 +1,4 @@
+Package: strace
+Priority: optional
+Section: net
+Description: System call trace program
diff --git a/package/strace/patches/patch-config_h_in b/package/strace/patches/patch-config_h_in
new file mode 100644
index 000000000..ea06ade61
--- /dev/null
+++ b/package/strace/patches/patch-config_h_in
@@ -0,0 +1,15 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- strace-4.5.18.orig/config.h.in 2008-08-28 23:36:28.000000000 +0200
++++ strace-4.5.18/config.h.in 2009-01-02 21:24:05.414089778 +0100
+@@ -409,6 +409,11 @@
+ /* Define for the AMD x86-64 architecture. */
+ #undef X86_64
+
++/* Define for the CRISv10 architecture. */
++#undef CRISV10
++
++/* Define for the CRISv32 architecture. */
++#undef CRISV32
+ /* Enable GNU extensions on systems that have them. */
+ #ifndef _GNU_SOURCE
+ # undef _GNU_SOURCE
diff --git a/package/strace/patches/patch-configure b/package/strace/patches/patch-configure
new file mode 100644
index 000000000..eadd57304
--- /dev/null
+++ b/package/strace/patches/patch-configure
@@ -0,0 +1,26 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- strace-4.5.18.orig/configure 2008-08-28 23:36:06.000000000 +0200
++++ strace-4.5.18/configure 2009-01-02 21:26:59.664979346 +0100
+@@ -2531,6 +2531,22 @@ cat >>confdefs.h <<\_ACEOF
+ _ACEOF
+
+ ;;
++cris|crisv10)
++ arch=crisv10
++
++cat >>confdefs.h <<\_ACEOF
++#define CRISV10 1
++_ACEOF
++
++ ;;
++crisv32)
++ arch=crisv32
++
++cat >>confdefs.h <<\_ACEOF
++#define CRISV32 1
++_ACEOF
++
++ ;;
+ *)
+ { echo "$as_me:$LINENO: result: NO!" >&5
+ echo "${ECHO_T}NO!" >&6; }
diff --git a/package/strace/patches/patch-configure_ac b/package/strace/patches/patch-configure_ac
new file mode 100644
index 000000000..28abf1d1a
--- /dev/null
+++ b/package/strace/patches/patch-configure_ac
@@ -0,0 +1,18 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- strace-4.5.18.orig/configure.ac 2008-08-28 23:15:56.000000000 +0200
++++ strace-4.5.18/configure.ac 2009-01-02 21:24:05.482095139 +0100
+@@ -103,6 +103,14 @@ x86?64*)
+ arch=x86_64
+ AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
+ ;;
++cris|crisv10)
++ arch=crisv10
++ AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
++ ;;
++crisv32)
++ arch=crisv32
++ AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
++ ;;
+ *)
+ AC_MSG_RESULT([NO!])
+ AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
diff --git a/package/strace/patches/patch-process_c b/package/strace/patches/patch-process_c
new file mode 100644
index 000000000..7309200d0
--- /dev/null
+++ b/package/strace/patches/patch-process_c
@@ -0,0 +1,109 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- strace-4.5.18.orig/process.c 2008-07-18 04:16:47.000000000 +0200
++++ strace-4.5.18/process.c 2009-01-02 21:24:05.490094969 +0100
+@@ -584,7 +584,7 @@ extern void print_ldt_entry();
+ # define ARG_PTID (known_scno(tcp) == SYS_clone2 ? 3 : 2)
+ # define ARG_CTID (known_scno(tcp) == SYS_clone2 ? 4 : 3)
+ # define ARG_TLS (known_scno(tcp) == SYS_clone2 ? 5 : 4)
+-# elif defined S390 || defined S390X
++# elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
+ # define ARG_STACK 0
+ # define ARG_FLAGS 1
+ # define ARG_PTID 2
+@@ -740,6 +740,10 @@ int new;
+ 0x100000 | new) < 0)
+ return -1;
+ return 0;
++#elif defined(CRISV10) || defined(CRISV32)
++ if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_R9), new) < 0)
++ return -1;
++ return 0;
+ #elif defined(ARM)
+ /* Some kernels support this, some (pre-2.6.16 or so) don't. */
+ # ifndef PTRACE_SET_SYSCALL
+@@ -3003,7 +3007,77 @@ const struct xlat struct_user_offsets[]
+ { 69, "fpcsr" },
+ { 70, "fpeir" },
+ #endif
++#ifdef CRISV10
++ { 4*PT_FRAMETYPE, "4*PT_FRAMETYPE" },
++ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
++ { 4*PT_R13, "4*PT_R13" },
++ { 4*PT_R12, "4*PT_R12" },
++ { 4*PT_R11, "4*PT_R11" },
++ { 4*PT_R10, "4*PT_R10" },
++ { 4*PT_R9, "4*PT_R9" },
++ { 4*PT_R8, "4*PT_R8" },
++ { 4*PT_R7, "4*PT_R7" },
++ { 4*PT_R6, "4*PT_R6" },
++ { 4*PT_R5, "4*PT_R5" },
++ { 4*PT_R4, "4*PT_R4" },
++ { 4*PT_R3, "4*PT_R3" },
++ { 4*PT_R2, "4*PT_R2" },
++ { 4*PT_R1, "4*PT_R1" },
++ { 4*PT_R0, "4*PT_R0" },
++ { 4*PT_MOF, "4*PT_MOF" },
++ { 4*PT_DCCR, "4*PT_DCCR" },
++ { 4*PT_SRP, "4*PT_SRP" },
++ { 4*PT_IRP, "4*PT_IRP" },
++ { 4*PT_CSRINSTR, "4*PT_CSRINSTR" },
++ { 4*PT_CSRADDR, "4*PT_CSRADDR" },
++ { 4*PT_CSRDATA, "4*PT_CSRDATA" },
++ { 4*PT_USP, "4*PT_USP" },
++#endif
++#ifdef CRISV32
++ { 4*PT_ORIG_R10, "4*PT_ORIG_R10" },
++ { 4*PT_R0, "4*PT_R0" },
++ { 4*PT_R1, "4*PT_R1" },
++ { 4*PT_R2, "4*PT_R2" },
++ { 4*PT_R3, "4*PT_R3" },
++ { 4*PT_R4, "4*PT_R4" },
++ { 4*PT_R5, "4*PT_R5" },
++ { 4*PT_R6, "4*PT_R6" },
++ { 4*PT_R7, "4*PT_R7" },
++ { 4*PT_R8, "4*PT_R8" },
++ { 4*PT_R9, "4*PT_R9" },
++ { 4*PT_R10, "4*PT_R10" },
++ { 4*PT_R11, "4*PT_R11" },
++ { 4*PT_R12, "4*PT_R12" },
++ { 4*PT_R13, "4*PT_R13" },
++ { 4*PT_ACR, "4*PT_ACR" },
++ { 4*PT_SRS, "4*PT_SRS" },
++ { 4*PT_MOF, "4*PT_MOF" },
++ { 4*PT_SPC, "4*PT_SPC" },
++ { 4*PT_CCS, "4*PT_CCS" },
++ { 4*PT_SRP, "4*PT_SRP" },
++ { 4*PT_ERP, "4*PT_ERP" },
++ { 4*PT_EXS, "4*PT_EXS" },
++ { 4*PT_EDA, "4*PT_EDA" },
++ { 4*PT_USP, "4*PT_USP" },
++ { 4*PT_PPC, "4*PT_PPC" },
++ { 4*PT_BP_CTRL, "4*PT_BP_CTRL" },
++ { 4*PT_BP+4, "4*PT_BP+4" },
++ { 4*PT_BP+8, "4*PT_BP+8" },
++ { 4*PT_BP+12, "4*PT_BP+12" },
++ { 4*PT_BP+16, "4*PT_BP+16" },
++ { 4*PT_BP+20, "4*PT_BP+20" },
++ { 4*PT_BP+24, "4*PT_BP+24" },
++ { 4*PT_BP+28, "4*PT_BP+28" },
++ { 4*PT_BP+32, "4*PT_BP+32" },
++ { 4*PT_BP+36, "4*PT_BP+36" },
++ { 4*PT_BP+40, "4*PT_BP+40" },
++ { 4*PT_BP+44, "4*PT_BP+44" },
++ { 4*PT_BP+48, "4*PT_BP+48" },
++ { 4*PT_BP+52, "4*PT_BP+52" },
++ { 4*PT_BP+56, "4*PT_BP+56" },
++#endif
+
++#if !defined(CRISV10) && !defined(CRISV32)
+ #if !defined(S390) && !defined(S390X) && !defined(MIPS) && !defined(SPARC64)
+ { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
+ #endif
+@@ -3041,6 +3115,7 @@ const struct xlat struct_user_offsets[]
+ #if defined(I386) || defined(X86_64)
+ { uoff(u_debugreg), "offsetof(struct user, u_debugreg)" },
+ #endif /* I386 */
++#endif /* !CRISV10/!CRISV32 */
+ #endif /* !IA64 */
+ #endif /* !ALPHA */
+ #endif /* !POWERPC/!SPARC */
diff --git a/package/strace/patches/patch-signal_c b/package/strace/patches/patch-signal_c
new file mode 100644
index 000000000..76795fbf6
--- /dev/null
+++ b/package/strace/patches/patch-signal_c
@@ -0,0 +1,42 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- strace-4.5.18.orig/signal.c 2008-08-20 03:59:40.000000000 +0200
++++ strace-4.5.18/signal.c 2009-01-02 21:24:05.502094888 +0100
+@@ -1485,9 +1485,38 @@ struct tcb *tcp;
+ }
+ return 0;
+ #else
++#if defined(CRISV10) || defined(CRISV32)
++ struct sigcontext sc;
++
++ if (entering(tcp)) {
++ long regs[PT_MAX+1];
++
++ tcp->u_arg[0] = 0;
++
++ if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, (long)regs) < 0) {
++ perror("sigreturn: PTRACE_GETREGS");
++ return 0;
++ }
++ if (umove(tcp, regs[PT_USP], &sc) < 0)
++ return 0;
++ tcp->u_arg[0] = 1;
++ tcp->u_arg[1] = sc.oldmask;
++ } else {
++ sigset_t sigm;
++
++ long_to_sigset(tcp->u_arg[1], &sigm);
++ tcp->u_rval = tcp->u_error = 0;
++ if (tcp->u_arg[0] == 0)
++ return 0;
++ tcp->auxstr = sprintsigmask("mask now ", &sigm, 0);
++ return RVAL_NONE | RVAL_STR;
++ }
++ return 0;
++#else
+ #warning No sys_sigreturn() for this architecture
+ #warning (no problem, just a reminder :-)
+ return 0;
++#endif /* !CRISV10/!CRISV32 */
+ #endif /* MIPS */
+ #endif /* LINUX_MIPSN32 || LINUX_MIPSN64 */
+ #endif /* SPARC || SPARC64 */
diff --git a/package/strace/patches/patch-syscall_c b/package/strace/patches/patch-syscall_c
new file mode 100644
index 000000000..700d9be09
--- /dev/null
+++ b/package/strace/patches/patch-syscall_c
@@ -0,0 +1,81 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- strace-4.5.18.orig/syscall.c 2008-08-25 05:16:26.000000000 +0200
++++ strace-4.5.18/syscall.c 2009-01-02 21:24:05.514097112 +0100
+@@ -772,6 +772,8 @@ internal_syscall(struct tcb *tcp)
+ static long r9;
+ #elif defined(X86_64)
+ static long rax;
++#elif defined(CRISV10) || defined(CRISV32)
++ static long r10;
+ #endif
+ #endif /* LINUX */
+ #ifdef FREEBSD
+@@ -1273,7 +1275,10 @@ struct tcb *tcp;
+ return 0;
+ }
+ }
+-#endif /* SH64 */
++#elif defined(CRISV10) || defined(CRISV32)
++ if (upeek(pid, 4*PT_R9, &scno) < 0)
++ return -1;
++#endif /* CRISV10/CRISV32 */
+ #endif /* LINUX */
+ #ifdef SUNOS4
+ if (upeek(pid, uoff(u_arg[7]), &scno) < 0)
+@@ -1468,6 +1473,14 @@ struct tcb *tcp;
+ fprintf(stderr, "stray syscall exit: r8 = %ld\n", r8);
+ return 0;
+ }
++#elif defined(CRISV10) || defined(CRISV32)
++ if (upeek(pid, 4*PT_R10, &r10) < 0)
++ return -1;
++ if (r10 != -ENOSYS && !(tcp->flags & TCB_INSYSCALL)) {
++ if (debug)
++ fprintf(stderr, "stray syscall exit: r10 = %ld\n", r10);
++ return 0;
++ }
+ #endif
+ #endif /* LINUX */
+ return 1;
+@@ -1649,6 +1662,17 @@ struct tcb *tcp;
+ tcp->u_rval = r9;
+ u_error = 0;
+ }
++#else
++#if defined(CRISV10) || defined(CRISV32)
++ if (r10 && (unsigned) -r10 < nerrnos) {
++ tcp->u_rval = -1;
++ u_error = -r10;
++ }
++ else {
++ tcp->u_rval = r10;
++ u_error = 0;
++ }
++#endif /* CRISV10/CRISV32 */
+ #endif /* SH64 */
+ #endif /* SH */
+ #endif /* HPPA */
+@@ -2169,6 +2193,23 @@ struct tcb *tcp;
+ return -1;
+ }
+ }
++#elif defined(CRISV10) || defined(CRISV32)
++ {
++ int i;
++ static const int crisregs[] = {
++ 4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12,
++ 4*PT_R13, 4*PT_MOF, 4*PT_SRP
++ };
++
++ if (tcp->scno >= 0 && tcp->scno < nsyscalls)
++ tcp->u_nargs = sysent[tcp->scno].nargs;
++ else
++ tcp->u_nargs = 0;
++ for (i = 0; i < tcp->u_nargs; i++) {
++ if (upeek(pid, crisregs[i], &tcp->u_arg[i]) < 0)
++ return -1;
++ }
++ }
+ #else /* Other architecture (like i386) (32bits specific) */
+ {
+ int i;
diff --git a/package/strace/patches/patch-util_c b/package/strace/patches/patch-util_c
new file mode 100644
index 000000000..17112f30e
--- /dev/null
+++ b/package/strace/patches/patch-util_c
@@ -0,0 +1,53 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- strace-4.5.18.orig/util.c 2008-08-19 06:47:51.000000000 +0200
++++ strace-4.5.18/util.c 2009-01-02 21:24:05.530098238 +0100
+@@ -1097,6 +1097,12 @@ struct tcb *tcp;
+ #elif defined(SH64)
+ if (upeek(tcp->pid, REG_PC ,&pc) < 0)
+ return -1;
++#elif defined(CRISV10)
++ if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0)
++ return -1;
++#elif defined(CRISV32)
++ if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0)
++ return -1;
+ #endif
+ return pc;
+ #endif /* LINUX */
+@@ -1245,6 +1251,22 @@ struct tcb *tcp;
+ return;
+ }
+ tprintf("[%08lx] ", pc);
++#elif defined(CRISV10)
++ long pc;
++
++ if (upeek(tcp->pid, 4*PT_IRP, &pc) < 0) {
++ PRINTBADPC;
++ return;
++ }
++ tprintf("[%08lx] ", (unsigned long)pc);
++#elif defined(CRISV32)
++ long pc;
++
++ if (upeek(tcp->pid, 4*PT_ERP, &pc) < 0) {
++ PRINTBADPC;
++ return;
++ }
++ tprintf("[%08lx] ", (unsigned long)pc);
+ #endif /* !architecture */
+ #endif /* LINUX */
+
+@@ -1444,6 +1466,13 @@ typedef struct regs arg_setup_state;
+ # define arg0_offset (REG_OFFSET+16)
+ # define arg1_offset (REG_OFFSET+24)
+ # define restore_arg0(tcp, state, val) 0
++# elif defined CRISV10 || defined CRISV32
++# define arg0_offset (4*PT_R11)
++# define arg1_offset (4*PT_ORIG_R10)
++# define restore_arg0(tcp, state, val) 0
++# define restore_arg1(tcp, state, val) 0
++# define arg0_index 1
++# define arg1_index 0
+ # else
+ # define arg0_offset 0
+ # define arg1_offset 4
diff --git a/package/stress/Config.in b/package/stress/Config.in
new file mode 100644
index 000000000..66c6bd446
--- /dev/null
+++ b/package/stress/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_STRESS
+ prompt "stress............................ Stress your system"
+ tristate
+ default n
+ help
+ Stress is a simple tool that imposes a configurable amount of CPU,
+ memory, I/O, and disk stress on POSIX-compliant operating systems.
+ It is written in portable ANSI C and uses the GNU Autotools to
+ compile on most UNIX-like operating systems. It is free software,
+ licensed under the GNU GPL
+
+ http://weather.ou.edu/~apw/projects/stress/
diff --git a/package/stress/Makefile b/package/stress/Makefile
new file mode 100644
index 000000000..2844ab26d
--- /dev/null
+++ b/package/stress/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= stress
+PKG_VERSION:= 1.0.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d693ff044ac7d34f8aaea202cd96f679
+MASTER_SITES:= http://weather.ou.edu/~apw/projects/stress/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,STRESS,stress,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_STRESS}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/stress ${IDIR_STRESS}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/stress/ipkg/stress.control b/package/stress/ipkg/stress.control
new file mode 100644
index 000000000..3321d6e8f
--- /dev/null
+++ b/package/stress/ipkg/stress.control
@@ -0,0 +1,4 @@
+Package: stress
+Priority: optional
+Section: utilities
+Description: stress is a simple tool that imposes certain types of compute stress on UNIX-like operating systems.
diff --git a/package/strongswan/Config.in b/package/strongswan/Config.in
new file mode 100644
index 000000000..29ccd78d4
--- /dev/null
+++ b/package/strongswan/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_STRONGSWAN
+ prompt "strongswan........................ VPN solution using IPsec"
+ tristate
+ default n
+ select ADK_PACKAGE_IP
+ select ADK_PACKAGE_LIBGMP
+ help
+ StrongSwan is an implementation of IPsec for Linux.
+
+ http://www.strongswan.org/
diff --git a/package/strongswan/Makefile b/package/strongswan/Makefile
new file mode 100644
index 000000000..fd224b013
--- /dev/null
+++ b/package/strongswan/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= strongswan
+PKG_VERSION:= 4.1.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 8a9f0c0dd939eeb1f6b8d6cb86925ffa
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://download.strongswan.org/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,STRONGSWAN,strongswan,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_STRONGSWAN}/etc/init.d
+ ${INSTALL_BIN} ./files/strongswan.init \
+ ${IDIR_STRONGSWAN}/etc/init.d/strongswan
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/strongswan/files/strongswan.init b/package/strongswan/files/strongswan.init
new file mode 100644
index 000000000..fcf30a469
--- /dev/null
+++ b/package/strongswan/files/strongswan.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 60
+. /etc/rc.conf
+
+case $1 in
+autostart)
+ test x"${ipsec:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/libexec/ipsec/setup start
+ ;;
+stop)
+ /usr/libexec/ipsec/setup stop
+ ;;
+restart)
+ sh $0 stop
+ sleep 3
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/strongswan/ipkg/strongswan.control b/package/strongswan/ipkg/strongswan.control
new file mode 100644
index 000000000..2d851d922
--- /dev/null
+++ b/package/strongswan/ipkg/strongswan.control
@@ -0,0 +1,5 @@
+Package: strongswan
+Section: base
+Priority: optional
+Depends: libgmp, ip
+Description: StrongSwan IPSec software
diff --git a/package/subversion/Config.in b/package/subversion/Config.in
new file mode 100644
index 000000000..4ab4537dc
--- /dev/null
+++ b/package/subversion/Config.in
@@ -0,0 +1,23 @@
+config ADK_PACKAGE_SUBVERSION
+ prompt "subversion........................ revision control program"
+ tristate
+ default n
+ select ADK_PACKAGE_ZLIB
+ select ADK_PACKAGE_APR_UTIL
+ select ADK_PACKAGE_LIBICONV
+ select ADK_PACKAGE_LIBEXPAT
+ help
+ Subversion is an open source application for revision control.
+
+ http://subversion.tigris.org
+
+config ADK_PACKAGE_SUBVERSION_NEON
+ prompt " Enable interaction with remote repositories over WebDAV"
+ bool
+ default n
+ depends ADK_PACKAGE_SUBVERSION
+ select ADK_PACKAGE_NEON
+ help
+ Allows a Subversion client to interact with remote
+ repositories over the Internet via a WebDAV based protocol.
+
diff --git a/package/subversion/Makefile b/package/subversion/Makefile
new file mode 100644
index 000000000..4cdd8ca0c
--- /dev/null
+++ b/package/subversion/Makefile
@@ -0,0 +1,61 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= subversion
+PKG_VERSION:= 1.6.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 93f128306b11e1a1c64ff51338777952
+PKG_DEPENDS:= zlib, apr, apr-util, libiconv, libexpat
+MASTER_SITES:= http://subversion.tigris.org/downloads/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SUBVERSION,$(PKG_NAME),${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-apr=${STAGING_DIR}/usr/bin/apr-config
+CONFIGURE_ARGS+= --with-apr-util=${STAGING_DIR}/usr/bin/apr-config
+CONFIGURE_ARGS+= --disable-mod-activation
+CONFIGURE_ARGS+= --disable-keychain
+CONFIGURE_ARGS+= --without-apxs
+CONFIGURE_ARGS+= --without-swig
+CONFIGURE_ARGS+= --disable-experimental-libtool
+CONFIGURE_ARGS+= --without-jikes
+CONFIGURE_ARGS+= --without-jdk
+CONFIGURE_ARGS+= --disable-javahl
+CONFIGURE_ARGS+= --without-berkeley-db
+
+LIBS= -laprutil-0 -lapr-0 -lexpat -liconv
+
+ifeq ($(ADK_PACKAGE_SUBVERSION_NEON),y)
+CONFIGURE_ARGS+= -disable-neon-version-check
+LIBS+= -lneon
+PKG_DEPENDS:= ${PKG_DEPENDS}, neon
+else
+CONFIGURE_ARGS+= --without-neon
+endif
+
+ifeq ($(ADK_PACKAGE_APR_THREADING),y)
+LIBS+= -pthread
+endif
+
+CONFIGURE_ENV+= LIBS='${LIBS}'
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+INSTALL_TARGET:= external-install local-install
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SUBVERSION}/etc/init.d
+ ${INSTALL_SCRIPT} files/svnserve.init \
+ ${IDIR_SUBVERSION}/etc/init.d/svnserve
+ ${INSTALL_DIR} ${IDIR_SUBVERSION}/usr/{bin,lib}
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_SUBVERSION}/usr/bin
+ ${CP} ${WRKINST}/usr/lib/* ${IDIR_SUBVERSION}/usr/lib
+ echo 'Depends: ${PKG_DEPENDS}' >> ${IDIR_SUBVERSION}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/subversion/files/svnserve.init b/package/subversion/files/svnserve.init
new file mode 100644
index 000000000..5350a257c
--- /dev/null
+++ b/package/subversion/files/svnserve.init
@@ -0,0 +1,36 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+(autostop) ;;
+(autostart)
+ [[ $svnserve = YES ]] || exit 0
+ exec sh $0 start
+ ;;
+(start)
+ if [[ ! -d $svnserve_path ]]; then
+ echo "The subversion repository ($svnserve_path) does not exist."
+ echo "Create a new repository and/or change the path in /etc/rc.conf"
+ echo
+ echo "Create a new subversion repository with:"
+ echo " mkdir -p $svnserve_path"
+ echo " svnadmin create --fs-type fsfs $svnserve_path"
+ echo
+ exit 1
+ fi
+
+ /usr/bin/svnserve -d -r $svnserve_path
+ ;;
+(stop)
+ killall svnserve
+ ;;
+(restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+(*)
+ echo "Usage: $0 {start|stop|restart}"
+ ;;
+esac
+exit $?
diff --git a/package/subversion/ipkg/subversion.control b/package/subversion/ipkg/subversion.control
new file mode 100644
index 000000000..fb66b78f1
--- /dev/null
+++ b/package/subversion/ipkg/subversion.control
@@ -0,0 +1,4 @@
+Package: subversion
+Priority: optional
+Section: net
+Description: revision control program
diff --git a/package/subversion/ipkg/subversion.postinst b/package/subversion/ipkg/subversion.postinst
new file mode 100644
index 000000000..ac45645d6
--- /dev/null
+++ b/package/subversion/ipkg/subversion.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf svnserve
+add_rcconf svnserve svnserve_path /svn
diff --git a/package/swconfig/Config.in b/package/swconfig/Config.in
new file mode 100644
index 000000000..56f945ce3
--- /dev/null
+++ b/package/swconfig/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_SWCONFIG
+ prompt "swconfig........................... Switch configuration utility"
+ tristate
+ depends on ADK_LINUX_MIPS_RB433
+ select ADK_PACKAGE_LIBNL
+ default y
+ help
+ Switch configuration utility (Adopted from OpenWrt).
diff --git a/package/swconfig/Makefile b/package/swconfig/Makefile
new file mode 100644
index 000000000..0657c54fe
--- /dev/null
+++ b/package/swconfig/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= swconfig
+PKG_VERSION:= 1.0
+PKG_RELEASE:= 1
+WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_VERSION}
+NO_DISTFILES:= 1
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SWCONFIG,swconfig,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+#XAKE_FLAGS:= LIBS="$(STAGING_DIR)/usr/lib/libnl.a -lm"
+XAKE_FLAGS:= LIBS="-lnl -lm" CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_DIR)/include"
+BUILD_STYLE:= auto
+
+do-configure:
+ mkdir -p ${WRKBUILD}
+ ${CP} ./src/* ${WRKBUILD}
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_SWCONFIG}/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/swconfig ${IDIR_SWCONFIG}/sbin/swconfig
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/swconfig/ipkg/swconfig.control b/package/swconfig/ipkg/swconfig.control
new file mode 100644
index 000000000..b47596c0d
--- /dev/null
+++ b/package/swconfig/ipkg/swconfig.control
@@ -0,0 +1,4 @@
+Package: swconfig
+Priority: optional
+Section: base
+Description: switch configuration utility
diff --git a/package/swconfig/src/Makefile b/package/swconfig/src/Makefile
new file mode 100644
index 000000000..64816af54
--- /dev/null
+++ b/package/swconfig/src/Makefile
@@ -0,0 +1,12 @@
+ifndef CFLAGS
+CFLAGS = -O2 -g -I ../src
+endif
+LIBS=-lnl
+
+all: swconfig
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $^
+
+swconfig: cli.o swlib.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
diff --git a/package/swconfig/src/cli.c b/package/swconfig/src/cli.c
new file mode 100644
index 000000000..c6035e585
--- /dev/null
+++ b/package/swconfig/src/cli.c
@@ -0,0 +1,255 @@
+/*
+ * swconfig.c: Switch configuration utility
+ *
+ * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundatio.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdint.h>
+#include <getopt.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <linux/types.h>
+#include <linux/netlink.h>
+#include <linux/genetlink.h>
+#include <netlink/netlink.h>
+#include <netlink/genl/genl.h>
+#include <netlink/genl/ctrl.h>
+#include <linux/switch.h>
+#include "swlib.h"
+
+#define GET 1
+#define SET 2
+
+void print_attrs(struct switch_attr *attr)
+{
+ int i = 0;
+ while (attr) {
+ const char *type;
+ switch(attr->type) {
+ case SWITCH_TYPE_INT:
+ type = "int";
+ break;
+ case SWITCH_TYPE_STRING:
+ type = "string";
+ break;
+ case SWITCH_TYPE_PORTS:
+ type = "ports";
+ break;
+ case SWITCH_TYPE_NOVAL:
+ type = "none";
+ break;
+ default:
+ type = "unknown";
+ break;
+ }
+ printf("\tAttribute %d (%s): %s (%s)\n", ++i, type, attr->name, attr->description);
+ attr = attr->next;
+ }
+}
+
+void list_attributes(struct switch_dev *dev)
+{
+ printf("Switch %d: %s(%s), ports: %d, vlans: %d\n", dev->id, dev->dev_name, dev->name, dev->ports, dev->vlans);
+ printf(" --switch\n");
+ print_attrs(dev->ops);
+ printf(" --vlan\n");
+ print_attrs(dev->vlan_ops);
+ printf(" --port\n");
+ print_attrs(dev->port_ops);
+}
+
+void print_usage(void)
+{
+ printf("swconfig dev <dev> [port <port>|vlan <vlan>] (help|set <key> <value>|get <key>)\n");
+ exit(0);
+}
+
+int main(int argc, char **argv)
+{
+ int retval = 0;
+ struct switch_dev *dev;
+ struct switch_attr *a;
+ struct switch_val val;
+ int err;
+ int i;
+
+ struct switch_port *ports;
+
+ int cmd = 0;
+ char *cdev = NULL;
+ int cport = -1;
+ int cvlan = -1;
+ char *ckey = NULL;
+ char *cvalue = NULL;
+ int chelp = 0;
+
+ if(argc < 4)
+ print_usage();
+
+ if(strcmp(argv[1], "dev"))
+ print_usage();
+
+ cdev = argv[2];
+
+ for(i = 3; i < argc; i++)
+ {
+ int p;
+ if(!strcmp(argv[i], "help"))
+ {
+ chelp = 1;
+ continue;
+ }
+ if(i + 1 >= argc)
+ print_usage();
+ p = atoi(argv[i + 1]);
+ if(!strcmp(argv[i], "port"))
+ {
+ cport = p;
+ } else if(!strcmp(argv[i], "vlan"))
+ {
+ cvlan = p;
+ } else if(!strcmp(argv[i], "set"))
+ {
+ if(argc <= i + 1)
+ print_usage();
+ cmd = SET;
+ ckey = argv[i + 1];
+ if (argc > i + 2)
+ cvalue = argv[i + 2];
+ else
+ cvalue = NULL;
+ i++;
+ } else if(!strcmp(argv[i], "get"))
+ {
+ cmd = GET;
+ ckey = argv[i + 1];
+ } else{
+ print_usage();
+ }
+ i++;
+ }
+
+ if(cport > -1 && cvlan > -1)
+ print_usage();
+
+ dev = swlib_connect(cdev);
+ if (!dev) {
+ fprintf(stderr, "Failed to connect to the switch\n");
+ return 1;
+ }
+
+ ports = malloc(sizeof(struct switch_port) * dev->ports);
+ memset(ports, 0, sizeof(struct switch_port) * dev->ports);
+ swlib_scan(dev);
+
+ if(chelp)
+ {
+ list_attributes(dev);
+ goto out;
+ }
+
+ if(cport > -1)
+ a = swlib_lookup_attr(dev, SWLIB_ATTR_GROUP_PORT, ckey);
+ else if(cvlan > -1)
+ a = swlib_lookup_attr(dev, SWLIB_ATTR_GROUP_VLAN, ckey);
+ else
+ a = swlib_lookup_attr(dev, SWLIB_ATTR_GROUP_GLOBAL, ckey);
+
+ if(!a)
+ {
+ fprintf(stderr, "Unknown attribute \"%s\"\n", ckey);
+ goto out;
+ }
+
+ switch(cmd)
+ {
+ case SET:
+ if ((a->type != SWITCH_TYPE_NOVAL) &&
+ (cvalue == NULL))
+ print_usage();
+
+ switch(a->type) {
+ case SWITCH_TYPE_INT:
+ val.value.i = atoi(cvalue);
+ break;
+ case SWITCH_TYPE_STRING:
+ val.value.s = cvalue;
+ break;
+ case SWITCH_TYPE_PORTS:
+ val.len = 0;
+ while(cvalue && *cvalue)
+ {
+ ports[val.len].flags = 0;
+ ports[val.len].id = strtol(cvalue, &cvalue, 10);
+ while(*cvalue && !isspace(*cvalue)) {
+ if (*cvalue == 't')
+ ports[val.len].flags |= SWLIB_PORT_FLAG_TAGGED;
+ cvalue++;
+ }
+ if (*cvalue)
+ cvalue++;
+ val.len++;
+ }
+ val.value.ports = ports;
+ break;
+ default:
+ break;
+ }
+ if(cvlan > -1)
+ val.port_vlan = cvlan;
+ if(cport > -1)
+ val.port_vlan = cport;
+ if(swlib_set_attr(dev, a, &val) < 0)
+ {
+ fprintf(stderr, "failed\n");
+ retval = -1;
+ goto out;
+ }
+ break;
+ case GET:
+ if(cvlan > -1)
+ val.port_vlan = cvlan;
+ if(cport > -1)
+ val.port_vlan = cport;
+ if(swlib_get_attr(dev, a, &val) < 0)
+ {
+ fprintf(stderr, "failed\n");
+ retval = -1;
+ goto out;
+ }
+ switch(a->type) {
+ case SWITCH_TYPE_INT:
+ printf("%d\n", val.value.i);
+ break;
+ case SWITCH_TYPE_STRING:
+ printf("%s\n", val.value.s);
+ break;
+ case SWITCH_TYPE_PORTS:
+ for(i = 0; i < val.len; i++)
+ printf("%d ", val.value.ports[i]);
+ printf("\n");
+ break;
+ }
+ }
+
+out:
+ swlib_free_all(dev);
+ free(ports);
+
+ return 0;
+}
diff --git a/package/swconfig/src/swlib.c b/package/swconfig/src/swlib.c
new file mode 100644
index 000000000..3fde81641
--- /dev/null
+++ b/package/swconfig/src/swlib.c
@@ -0,0 +1,614 @@
+/*
+ * swlib.c: Switch configuration API (user space part)
+ *
+ * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdint.h>
+#include <getopt.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <linux/switch.h>
+#include "swlib.h"
+
+//#define DEBUG 1
+#ifdef DEBUG
+#define DPRINTF(fmt, ...) fprintf(stderr, "%s(%d): " fmt, __func__, __LINE__, ##__VA_ARGS__)
+#else
+#define DPRINTF(fmt, ...) do {} while (0)
+#endif
+
+static struct nl_handle *handle;
+static struct nl_cache *cache;
+static struct genl_family *family;
+static struct nlattr *tb[SWITCH_ATTR_MAX];
+static int refcount = 0;
+
+static struct nla_policy port_policy[] = {
+ [SWITCH_PORT_ID] = { .type = NLA_U32 },
+ [SWITCH_PORT_FLAG_TAGGED] = { .type = NLA_FLAG },
+};
+
+static inline void *
+swlib_alloc(size_t size)
+{
+ void *ptr;
+
+ ptr = malloc(size);
+ if (!ptr)
+ goto done;
+ memset(ptr, 0, size);
+
+done:
+ return ptr;
+}
+
+static int
+wait_handler(struct nl_msg *msg, void *arg)
+{
+ int *finished = arg;
+
+ *finished = 1;
+ return NL_STOP;
+}
+
+/* helper function for performing netlink requests */
+static int
+swlib_call(int cmd, int (*call)(struct nl_msg *, void *),
+ int (*data)(struct nl_msg *, void *), void *arg)
+{
+ struct nl_msg *msg;
+ struct nl_cb *cb = NULL;
+ int finished;
+ int flags = 0;
+ int err;
+
+ msg = nlmsg_alloc();
+ if (!msg) {
+ fprintf(stderr, "Out of memory!\n");
+ exit(1);
+ }
+
+ if (!data)
+ flags |= NLM_F_DUMP;
+
+ genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, genl_family_get_id(family), 0, flags, cmd, 0);
+ if (data) {
+ if (data(msg, arg) < 0)
+ goto nla_put_failure;
+ }
+
+ cb = nl_cb_alloc(NL_CB_CUSTOM);
+ if (!cb) {
+ fprintf(stderr, "nl_cb_alloc failed.\n");
+ exit(1);
+ }
+
+ err = nl_send_auto_complete(handle, msg);
+ if (err < 0) {
+ fprintf(stderr, "nl_send_auto_complete failed: %d\n", err);
+ goto out;
+ }
+
+ finished = 0;
+
+ if (call)
+ nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, call, arg);
+
+ if (data)
+ nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, wait_handler, &finished);
+ else
+ nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, wait_handler, &finished);
+
+ err = nl_recvmsgs(handle, cb);
+ if (err < 0) {
+ goto out;
+ }
+
+ if (!finished)
+ err = nl_wait_for_ack(handle);
+
+out:
+ if (cb)
+ nl_cb_put(cb);
+nla_put_failure:
+ nlmsg_free(msg);
+ return err;
+}
+
+static int
+send_attr(struct nl_msg *msg, void *arg)
+{
+ struct switch_val *val = arg;
+ struct switch_attr *attr = val->attr;
+
+ NLA_PUT_U32(msg, SWITCH_ATTR_ID, attr->dev->id);
+ NLA_PUT_U32(msg, SWITCH_ATTR_OP_ID, attr->id);
+ switch(attr->atype) {
+ case SWLIB_ATTR_GROUP_PORT:
+ NLA_PUT_U32(msg, SWITCH_ATTR_OP_PORT, val->port_vlan);
+ break;
+ case SWLIB_ATTR_GROUP_VLAN:
+ NLA_PUT_U32(msg, SWITCH_ATTR_OP_VLAN, val->port_vlan);
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+
+nla_put_failure:
+ return -1;
+}
+
+static int
+store_port_val(struct nl_msg *msg, struct nlattr *nla, struct switch_val *val)
+{
+ struct nlattr *p;
+ int ports = val->attr->dev->ports;
+ int err = 0;
+ int remaining;
+
+ if (!val->value.ports)
+ val->value.ports = malloc(sizeof(struct switch_port) * ports);
+
+ nla_for_each_nested(p, nla, remaining) {
+ struct nlattr *tb[SWITCH_PORT_ATTR_MAX+1];
+ struct switch_port *port;
+
+ if (val->len >= ports)
+ break;
+
+ err = nla_parse_nested(tb, SWITCH_PORT_ATTR_MAX, p, port_policy);
+ if (err < 0)
+ goto out;
+
+ if (!tb[SWITCH_PORT_ID])
+ continue;
+
+ port = &val->value.ports[val->len];
+ port->id = nla_get_u32(tb[SWITCH_PORT_ID]);
+ port->flags = 0;
+ if (tb[SWITCH_PORT_FLAG_TAGGED])
+ port->flags |= SWLIB_PORT_FLAG_TAGGED;
+
+ val->len++;
+ }
+
+out:
+ return err;
+}
+
+static int
+store_val(struct nl_msg *msg, void *arg)
+{
+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+ struct switch_val *val = arg;
+ struct switch_attr *attr = val->attr;
+
+ if (!val)
+ goto error;
+
+ if (nla_parse(tb, SWITCH_ATTR_MAX - 1, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL) < 0) {
+ goto error;
+ }
+
+ if (tb[SWITCH_ATTR_OP_VALUE_INT])
+ val->value.i = nla_get_u32(tb[SWITCH_ATTR_OP_VALUE_INT]);
+ else if (tb[SWITCH_ATTR_OP_VALUE_STR])
+ val->value.s = strdup(nla_get_string(tb[SWITCH_ATTR_OP_VALUE_STR]));
+ else if (tb[SWITCH_ATTR_OP_VALUE_PORTS])
+ val->err = store_port_val(msg, tb[SWITCH_ATTR_OP_VALUE_PORTS], val);
+
+ val->err = 0;
+ return 0;
+
+error:
+ return NL_SKIP;
+}
+
+int
+swlib_get_attr(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
+{
+ int cmd;
+ int err;
+
+ switch(attr->atype) {
+ case SWLIB_ATTR_GROUP_GLOBAL:
+ cmd = SWITCH_CMD_GET_GLOBAL;
+ break;
+ case SWLIB_ATTR_GROUP_PORT:
+ cmd = SWITCH_CMD_GET_PORT;
+ break;
+ case SWLIB_ATTR_GROUP_VLAN:
+ cmd = SWITCH_CMD_GET_VLAN;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ memset(&val->value, 0, sizeof(val->value));
+ val->len = 0;
+ val->attr = attr;
+ val->err = -EINVAL;
+ err = swlib_call(cmd, store_val, send_attr, val);
+ if (!err)
+ err = val->err;
+
+ return err;
+}
+
+static int
+send_attr_ports(struct nl_msg *msg, struct switch_val *val)
+{
+ struct nlattr *n;
+ int i;
+
+ /* TODO implement multipart? */
+ if (val->len == 0)
+ goto done;
+ n = nla_nest_start(msg, SWITCH_ATTR_OP_VALUE_PORTS);
+ if (!n)
+ goto nla_put_failure;
+ for (i = 0; i < val->len; i++) {
+ struct switch_port *port = &val->value.ports[i];
+ struct nlattr *np;
+
+ np = nla_nest_start(msg, SWITCH_ATTR_PORT);
+ if (!np)
+ goto nla_put_failure;
+
+ NLA_PUT_U32(msg, SWITCH_PORT_ID, port->id);
+ if (port->flags & SWLIB_PORT_FLAG_TAGGED)
+ NLA_PUT_FLAG(msg, SWITCH_PORT_FLAG_TAGGED);
+
+ nla_nest_end(msg, np);
+ }
+ nla_nest_end(msg, n);
+done:
+ return 0;
+
+nla_put_failure:
+ return -1;
+}
+
+static int
+send_attr_val(struct nl_msg *msg, void *arg)
+{
+ struct switch_val *val = arg;
+ struct switch_attr *attr = val->attr;
+
+ if (send_attr(msg, arg))
+ goto nla_put_failure;
+
+ switch(attr->type) {
+ case SWITCH_TYPE_NOVAL:
+ break;
+ case SWITCH_TYPE_INT:
+ NLA_PUT_U32(msg, SWITCH_ATTR_OP_VALUE_INT, val->value.i);
+ break;
+ case SWITCH_TYPE_STRING:
+ if (!val->value.s)
+ goto nla_put_failure;
+ NLA_PUT_STRING(msg, SWITCH_ATTR_OP_VALUE_STR, val->value.s);
+ break;
+ case SWITCH_TYPE_PORTS:
+ if (send_attr_ports(msg, val) < 0)
+ goto nla_put_failure;
+ break;
+ default:
+ goto nla_put_failure;
+ }
+ return 0;
+
+nla_put_failure:
+ return -1;
+}
+
+int
+swlib_set_attr(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
+{
+ int cmd;
+
+ switch(attr->atype) {
+ case SWLIB_ATTR_GROUP_GLOBAL:
+ cmd = SWITCH_CMD_SET_GLOBAL;
+ break;
+ case SWLIB_ATTR_GROUP_PORT:
+ cmd = SWITCH_CMD_SET_PORT;
+ break;
+ case SWLIB_ATTR_GROUP_VLAN:
+ cmd = SWITCH_CMD_SET_VLAN;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ val->attr = attr;
+ return swlib_call(cmd, NULL, send_attr_val, val);
+}
+
+
+struct attrlist_arg {
+ int id;
+ int atype;
+ struct switch_dev *dev;
+ struct switch_attr *prev;
+ struct switch_attr **head;
+};
+
+static int
+add_id(struct nl_msg *msg, void *arg)
+{
+ struct attrlist_arg *l = arg;
+
+ NLA_PUT_U32(msg, SWITCH_ATTR_ID, l->id);
+
+ return 0;
+nla_put_failure:
+ return -1;
+}
+
+static int
+add_attr(struct nl_msg *msg, void *ptr)
+{
+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+ struct attrlist_arg *arg = ptr;
+ struct switch_attr *new;
+
+ if (nla_parse(tb, SWITCH_ATTR_MAX - 1, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL) < 0)
+ goto done;
+
+ new = swlib_alloc(sizeof(struct switch_attr));
+ if (!new)
+ goto done;
+
+ new->dev = arg->dev;
+ new->atype = arg->atype;
+ if (arg->prev) {
+ arg->prev->next = new;
+ } else {
+ arg->prev = *arg->head;
+ }
+ *arg->head = new;
+ arg->head = &new->next;
+
+ if (tb[SWITCH_ATTR_OP_ID])
+ new->id = nla_get_u32(tb[SWITCH_ATTR_OP_ID]);
+ if (tb[SWITCH_ATTR_OP_TYPE])
+ new->type = nla_get_u32(tb[SWITCH_ATTR_OP_TYPE]);
+ if (tb[SWITCH_ATTR_OP_NAME])
+ new->name = strdup(nla_get_string(tb[SWITCH_ATTR_OP_NAME]));
+ if (tb[SWITCH_ATTR_OP_DESCRIPTION])
+ new->description = strdup(nla_get_string(tb[SWITCH_ATTR_OP_DESCRIPTION]));
+
+done:
+ return NL_SKIP;
+}
+
+int
+swlib_scan(struct switch_dev *dev)
+{
+ struct attrlist_arg arg;
+
+ if (dev->ops || dev->port_ops || dev->vlan_ops)
+ return 0;
+
+ arg.atype = SWLIB_ATTR_GROUP_GLOBAL;
+ arg.dev = dev;
+ arg.id = dev->id;
+ arg.prev = NULL;
+ arg.head = &dev->ops;
+ swlib_call(SWITCH_CMD_LIST_GLOBAL, add_attr, add_id, &arg);
+
+ arg.atype = SWLIB_ATTR_GROUP_PORT;
+ arg.prev = NULL;
+ arg.head = &dev->port_ops;
+ swlib_call(SWITCH_CMD_LIST_PORT, add_attr, add_id, &arg);
+
+ arg.atype = SWLIB_ATTR_GROUP_VLAN;
+ arg.prev = NULL;
+ arg.head = &dev->vlan_ops;
+ swlib_call(SWITCH_CMD_LIST_VLAN, add_attr, add_id, &arg);
+
+ return 0;
+}
+
+struct switch_attr *swlib_lookup_attr(struct switch_dev *dev,
+ enum swlib_attr_group atype, const char *name)
+{
+ struct switch_attr *head;
+
+ if (!name || !dev)
+ return NULL;
+
+ switch(atype) {
+ case SWLIB_ATTR_GROUP_GLOBAL:
+ head = dev->ops;
+ break;
+ case SWLIB_ATTR_GROUP_PORT:
+ head = dev->port_ops;
+ break;
+ case SWLIB_ATTR_GROUP_VLAN:
+ head = dev->vlan_ops;
+ break;
+ }
+ while(head) {
+ if (!strcmp(name, head->name))
+ return head;
+ head = head->next;
+ }
+
+ return NULL;
+}
+
+static void
+swlib_priv_free(void)
+{
+ if (cache)
+ nl_cache_free(cache);
+ if (handle)
+ nl_handle_destroy(handle);
+ handle = NULL;
+ cache = NULL;
+}
+
+static int
+swlib_priv_init(void)
+{
+ handle = nl_handle_alloc();
+ if (!handle) {
+ DPRINTF("Failed to create handle\n");
+ goto err;
+ }
+
+ if (genl_connect(handle)) {
+ DPRINTF("Failed to connect to generic netlink\n");
+ goto err;
+ }
+
+ cache = genl_ctrl_alloc_cache(handle);
+ if (!cache) {
+ DPRINTF("Failed to allocate netlink cache\n");
+ goto err;
+ }
+
+ family = genl_ctrl_search_by_name(cache, "switch");
+ if (!family) {
+ DPRINTF("Switch API not present\n");
+ goto err;
+ }
+ return 0;
+
+err:
+ swlib_priv_free();
+ return -EINVAL;
+}
+
+struct swlib_scan_arg {
+ const char *name;
+ struct switch_dev *head;
+ struct switch_dev *ptr;
+};
+
+static int
+add_switch(struct nl_msg *msg, void *arg)
+{
+ struct swlib_scan_arg *sa = arg;
+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+ struct switch_dev *dev;
+ const char *name;
+
+ if (nla_parse(tb, SWITCH_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL) < 0)
+ goto done;
+
+ if (!tb[SWITCH_ATTR_DEV_NAME])
+ goto done;
+
+ name = nla_get_string(tb[SWITCH_ATTR_DEV_NAME]);
+ if (sa->name && (strcmp(name, sa->name) != 0))
+ goto done;
+
+ dev = swlib_alloc(sizeof(struct switch_dev));
+ if (!dev)
+ goto done;
+
+ dev->dev_name = strdup(name);
+ if (tb[SWITCH_ATTR_ID])
+ dev->id = nla_get_u32(tb[SWITCH_ATTR_ID]);
+ if (tb[SWITCH_ATTR_NAME])
+ dev->name = strdup(nla_get_string(tb[SWITCH_ATTR_DEV_NAME]));
+ if (tb[SWITCH_ATTR_PORTS])
+ dev->ports = nla_get_u32(tb[SWITCH_ATTR_PORTS]);
+ if (tb[SWITCH_ATTR_VLANS])
+ dev->vlans = nla_get_u32(tb[SWITCH_ATTR_VLANS]);
+
+ if (!sa->head) {
+ sa->head = dev;
+ sa->ptr = dev;
+ } else {
+ sa->ptr->next = dev;
+ sa->ptr = dev;
+ }
+
+ refcount++;
+done:
+ return NL_SKIP;
+}
+
+
+struct switch_dev *
+swlib_connect(const char *name)
+{
+ struct swlib_scan_arg arg;
+ int err;
+
+ if (!refcount) {
+ if (swlib_priv_init() < 0)
+ return NULL;
+ };
+
+ arg.head = NULL;
+ arg.ptr = NULL;
+ arg.name = name;
+ swlib_call(SWITCH_CMD_GET_SWITCH, add_switch, NULL, &arg);
+
+ if (!refcount)
+ swlib_priv_free();
+
+ return arg.head;
+}
+
+static void
+swlib_free_attributes(struct switch_attr **head)
+{
+ struct switch_attr *a = *head;
+ struct switch_attr *next;
+
+ while (a) {
+ next = a->next;
+ free(a);
+ a = next;
+ }
+ *head = NULL;
+}
+
+void
+swlib_free(struct switch_dev *dev)
+{
+ swlib_free_attributes(&dev->ops);
+ swlib_free_attributes(&dev->port_ops);
+ swlib_free_attributes(&dev->vlan_ops);
+ free(dev);
+
+ if (--refcount == 0)
+ swlib_priv_free();
+}
+
+void
+swlib_free_all(struct switch_dev *dev)
+{
+ struct switch_dev *p;
+
+ while (dev) {
+ p = dev->next;
+ swlib_free(dev);
+ dev = p;
+ }
+}
diff --git a/package/swconfig/src/swlib.h b/package/swconfig/src/swlib.h
new file mode 100644
index 000000000..e00ff47a5
--- /dev/null
+++ b/package/swconfig/src/swlib.h
@@ -0,0 +1,213 @@
+/*
+ * swlib.h: Switch configuration API (user space part)
+ *
+ * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+
+Usage of the library functions:
+
+ The main datastructure for a switch is the struct switch_device
+ To get started, you first need to use switch_connect() to probe
+ for switches and allocate an instance of this struct.
+
+ There are two possible usage modes:
+ dev = switch_connect("eth0");
+ - this call will look for a switch registered for the linux device
+ "eth0" and only allocate a switch_device for this particular switch.
+
+ dev = switch_connect(NULL)
+ - this will return one switch_device struct for each available
+ switch. The switch_device structs are chained with by ->next pointer
+
+ Then to query a switch for all available attributes, use:
+ swlib_scan(dev);
+
+ All allocated datastructures for the switch_device struct can be freed with
+ swlib_free(dev);
+ or
+ swlib_free_all(dev);
+
+ The latter traverses a whole chain of switch_device structs and frees them all
+
+ Switch attributes (struct switch_attr) are divided into three groups:
+ dev->ops:
+ - global settings
+ dev->port_ops:
+ - per-port settings
+ dev->vlan_ops:
+ - per-vlan settings
+
+ switch_lookup_attr() is a small helper function to locate attributes
+ by name.
+
+ switch_set_attr() and switch_get_attr() can alter or request the values
+ of attributes.
+
+Usage of the switch_attr struct:
+
+ ->atype: attribute group, one of:
+ - SWLIB_ATTR_GROUP_GLOBAL
+ - SWLIB_ATTR_GROUP_VLAN
+ - SWLIB_ATTR_GROUP_PORT
+
+ ->id: identifier for the attribute
+
+ ->type: data type, one of:
+ - SWITCH_TYPE_INT
+ - SWITCH_TYPE_STRING
+ - SWITCH_TYPE_PORT
+
+ ->name: short name of the attribute
+ ->description: longer description
+ ->next: pointer to the next attribute of the current group
+
+
+Usage of the switch_val struct:
+
+ When setting attributes, following members of the struct switch_val need
+ to be set up:
+
+ ->len (for attr->type == SWITCH_TYPE_PORT)
+ ->port_vlan:
+ - port number (for attr->atype == SWLIB_ATTR_GROUP_PORT), or:
+ - vlan number (for attr->atype == SWLIB_ATTR_GROUP_VLAN)
+ ->value.i (for attr->type == SWITCH_TYPE_INT)
+ ->value.s (for attr->type == SWITCH_TYPE_STRING)
+ - owned by the caller, not stored in the library internally
+ ->value.ports (for attr->type == SWITCH_TYPE_PORT)
+ - must point to an array of at lest val->len * sizeof(struct switch_port)
+
+ When getting string attributes, val->value.s must be freed by the caller
+ When getting port list attributes, an internal static buffer is used,
+ which changes from call to call.
+
+ */
+
+#ifndef __SWLIB_H
+#define __SWLIB_H
+
+enum swlib_attr_group {
+ SWLIB_ATTR_GROUP_GLOBAL,
+ SWLIB_ATTR_GROUP_VLAN,
+ SWLIB_ATTR_GROUP_PORT,
+};
+
+enum swlib_port_flags {
+ SWLIB_PORT_FLAG_TAGGED = (1 << 0),
+};
+
+
+struct switch_dev;
+struct switch_attr;
+struct switch_port;
+struct switch_val;
+
+struct switch_dev {
+ int id;
+ const char *name;
+ const char *dev_name;
+ int ports;
+ int vlans;
+ struct switch_attr *ops;
+ struct switch_attr *port_ops;
+ struct switch_attr *vlan_ops;
+ struct switch_dev *next;
+ void *priv;
+};
+
+struct switch_val {
+ struct switch_attr *attr;
+ int len;
+ int err;
+ int port_vlan;
+ union {
+ const char *s;
+ int i;
+ struct switch_port *ports;
+ } value;
+};
+
+struct switch_attr {
+ struct switch_dev *dev;
+ int atype;
+ int id;
+ int type;
+ const char *name;
+ const char *description;
+ struct switch_attr *next;
+};
+
+struct switch_port {
+ unsigned int id;
+ unsigned int flags;
+};
+
+/**
+ * swlib_connect: connect to the switch through netlink
+ * @name: name of the ethernet interface,
+ *
+ * if name is NULL, it connect and builds a chain of all switches
+ */
+struct switch_dev *swlib_connect(const char *name);
+
+/**
+ * swlib_free: free all dynamically allocated data for the switch connection
+ * @dev: switch device struct
+ *
+ * all members of a switch device chain (generated by swlib_connect(NULL))
+ * must be freed individually
+ */
+void swlib_free(struct switch_dev *dev);
+
+/**
+ * swlib_free_all: run swlib_free on all devices in the chain
+ * @dev: switch device struct
+ */
+void swlib_free_all(struct switch_dev *dev);
+
+/**
+ * swlib_scan: probe the switch driver for available commands/attributes
+ * @dev: switch device struct
+ */
+int swlib_scan(struct switch_dev *dev);
+
+/**
+ * swlib_lookup_attr: look up a switch attribute
+ * @dev: switch device struct
+ * @type: global, port or vlan
+ * @name: name of the attribute
+ */
+struct switch_attr *swlib_lookup_attr(struct switch_dev *dev,
+ enum swlib_attr_group atype, const char *name);
+
+/**
+ * swlib_set_attr: set the value for an attribute
+ * @dev: switch device struct
+ * @attr: switch attribute struct
+ * @val: attribute value pointer
+ * returns 0 on success
+ */
+int swlib_set_attr(struct switch_dev *dev, struct switch_attr *attr,
+ struct switch_val *val);
+
+/**
+ * swlib_get_attr: get the value for an attribute
+ * @dev: switch device struct
+ * @attr: switch attribute struct
+ * @val: attribute value pointer
+ * returns 0 on success
+ * for string attributes, the result string must be freed by the caller
+ */
+int swlib_get_attr(struct switch_dev *dev, struct switch_attr *attr,
+ struct switch_val *val);
+
+#endif
diff --git a/package/syslog-ng/Config.in b/package/syslog-ng/Config.in
new file mode 100644
index 000000000..df21ab0fd
--- /dev/null
+++ b/package/syslog-ng/Config.in
@@ -0,0 +1,32 @@
+config ADK_PACKAGE_SYSLOG_NG
+ prompt "syslog-ng......................... A powerful syslog daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBOL
+ select ADK_PACKAGE_LIBWRAP
+ help
+ syslog-ng reads and logs messages to the system console, log
+ files, other machines and/or users as specified by its
+ configuration file.
+
+ The configuration file is read at startup and is reread after
+ receipt of a hangup (HUP) signal. When reloading the
+ configuration file, all destination files are closed and
+ reopened as appropriate. For more information about the
+ configuration file, see syslog-ng.conf(5).
+
+ Typically messages are sent to syslog-ng via a Unix domain
+ socket (/dev/log) or via UDP, to port 514 or to whatever
+ syslog/udp is defined to be in /etc/services. To receive
+ messages from the kernel, /dev/klog is opened for reading.
+
+ Messages sent to syslog-ng should be an entire line, prefixed
+ by a pri- ority code in between '<' and '>'. Definititions
+ of the recognised values can be found in the include file
+ <sys/syslog.h>.
+
+ syslog-ng can be configured to pass messages on to other
+ syslog-ng's and when doing so, it sends the message on with the
+ priority as a pre- fix.
+
+ http://www.balabit.com/products/syslog_ng/
diff --git a/package/syslog-ng/Makefile b/package/syslog-ng/Makefile
new file mode 100644
index 000000000..4a8141750
--- /dev/null
+++ b/package/syslog-ng/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= syslog-ng
+PKG_VERSION:= 1.6.12
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a3cbfdb6e1e5beea181a7349749719f3
+MASTER_SITES:= http://www.balabit.com/downloads/files/syslog-ng/sources/1.6/src/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SYSLOG_NG,syslog-ng,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --enable-full-dynamic \
+ --enable-tcp-wrapper
+CONFIGURE_ENV+= ac_cv_path_libol_config=${STAGING_DIR}/usr/bin
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SYSLOG_NG}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/syslog-ng ${IDIR_SYSLOG_NG}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_SYSLOG_NG}/etc/init.d
+ ${INSTALL_BIN} ./files/syslog-ng.init \
+ ${IDIR_SYSLOG_NG}/etc/init.d/${PKG_NAME}
+ ${INSTALL_DIR} ${IDIR_SYSLOG_NG}/etc/syslog-ng
+ ${INSTALL_DATA} ./files/syslog-ng.conf ${IDIR_SYSLOG_NG}/etc/syslog-ng/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/syslog-ng/files/syslog-ng.conf b/package/syslog-ng/files/syslog-ng.conf
new file mode 100644
index 000000000..658abead2
--- /dev/null
+++ b/package/syslog-ng/files/syslog-ng.conf
@@ -0,0 +1,16 @@
+options {
+ chain_hostnames(off);
+ sync(0);
+
+ # The default action of syslog-ng 1.6.0 is to log a STATS line
+ # to the file every 10 minutes. That's pretty ugly after a while.
+ # Change it to every 12 hours so you get a nice daily update of
+ # how many messages syslog-ng missed (0).
+ stats(43200);
+};
+
+source src { unix-stream("/dev/log"); internal(); };
+
+destination messages { file("/var/log/messages"); };
+
+log { source(src); destination(messages); };
diff --git a/package/syslog-ng/files/syslog-ng.init b/package/syslog-ng/files/syslog-ng.init
new file mode 100644
index 000000000..bdfa0c96e
--- /dev/null
+++ b/package/syslog-ng/files/syslog-ng.init
@@ -0,0 +1,30 @@
+#!/bin/sh
+#FWINIT 05
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${syslog_ng:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/syslog-ng/syslog-ng.conf ] || {
+ echo "/etc/syslog-ng/syslog-ng.conf does not exist !";
+ exit 0;
+ };
+ [ -x /usr/sbin/syslog-ng ] && /usr/sbin/syslog-ng
+ ;;
+stop)
+ killall syslog-ng
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/syslog-ng/ipkg/syslog-ng.conffiles b/package/syslog-ng/ipkg/syslog-ng.conffiles
new file mode 100644
index 000000000..453ebbe66
--- /dev/null
+++ b/package/syslog-ng/ipkg/syslog-ng.conffiles
@@ -0,0 +1 @@
+/etc/syslog-ng/syslog-ng.conf
diff --git a/package/syslog-ng/ipkg/syslog-ng.control b/package/syslog-ng/ipkg/syslog-ng.control
new file mode 100644
index 000000000..93f193d6c
--- /dev/null
+++ b/package/syslog-ng/ipkg/syslog-ng.control
@@ -0,0 +1,5 @@
+Package: syslog-ng
+Priority: optional
+Section: admin
+Depends: libol libwrap
+Description: A powerful syslog daemon
diff --git a/package/syslog-ng/ipkg/syslog-ng.postinst b/package/syslog-ng/ipkg/syslog-ng.postinst
new file mode 100644
index 000000000..254f67872
--- /dev/null
+++ b/package/syslog-ng/ipkg/syslog-ng.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf syslog_ng syslog_ng NO
diff --git a/package/syslog-ng/patches/patch-Makefile_in b/package/syslog-ng/patches/patch-Makefile_in
new file mode 100644
index 000000000..aaab22e64
--- /dev/null
+++ b/package/syslog-ng/patches/patch-Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- syslog-ng-1.6.11.orig/Makefile.in 2006-05-03 11:10:52.000000000 +0000
++++ syslog-ng-1.6.11/Makefile.in 2007-02-15 20:40:14.000000000 +0000
+@@ -64,7 +64,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
+ LEX = @LEX@
+-LEXLIB = @LEXLIB@
++LEXLIB =
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+ LIBOBJS = @LIBOBJS@
+ LIBOL_DIR = @LIBOL_DIR@
diff --git a/package/syslog-ng/patches/patch-configure b/package/syslog-ng/patches/patch-configure
new file mode 100644
index 000000000..9eb1f51a9
--- /dev/null
+++ b/package/syslog-ng/patches/patch-configure
@@ -0,0 +1,21 @@
+$Id$
+--- syslog-ng-1.6.11.orig/configure 2006-05-03 11:10:53.000000000 +0000
++++ syslog-ng-1.6.11/configure 2007-02-15 20:42:56.000000000 +0000
+@@ -3160,7 +3160,7 @@ if test "${ac_cv_lib_fl_yywrap+set}" = s
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lfl $LIBS"
++LIBS="$LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -7609,7 +7609,7 @@ echo "$as_me: error: Bundled libol not f
+ else
+ LIBOL_VERSION=`libol-config --version`
+ LIBOL_CFLAGS=`libol-config --cflags`
+- LIBOL_LIBS=`libol-config --static-libs`
++ LIBOL_LIBS=`libol-config --libs`
+ MAKE_CLASS="make_class"
+ fi
+ fi
diff --git a/package/syslog-ng/patches/patch-src_Makefile_in b/package/syslog-ng/patches/patch-src_Makefile_in
new file mode 100644
index 000000000..5f497f00a
--- /dev/null
+++ b/package/syslog-ng/patches/patch-src_Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- syslog-ng-1.6.11.orig/src/Makefile.in 2006-05-03 11:10:53.000000000 +0000
++++ syslog-ng-1.6.11/src/Makefile.in 2007-02-15 20:40:14.000000000 +0000
+@@ -64,7 +64,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
+ LEX = @LEX@
+-LEXLIB = @LEXLIB@
++LEXLIB =
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+ LIBOBJS = @LIBOBJS@
+ LIBOL_DIR = @LIBOL_DIR@
diff --git a/package/syslog-ng/patches/patch-src_cfg-lex_c b/package/syslog-ng/patches/patch-src_cfg-lex_c
new file mode 100644
index 000000000..b9d37d779
--- /dev/null
+++ b/package/syslog-ng/patches/patch-src_cfg-lex_c
@@ -0,0 +1,14 @@
+$Id$
+--- syslog-ng-1.6.11.orig/src/cfg-lex.c 2006-03-27 14:44:46.000000000 +0000
++++ syslog-ng-1.6.11/src/cfg-lex.c 2007-02-15 20:40:14.000000000 +0000
+@@ -667,7 +667,9 @@ static void append_char(char c);
+ #ifdef __cplusplus
+ extern "C" int yywrap (void );
+ #else
+-extern int yywrap (void );
++int yywrap (void ) {
++ return 1;
++}
+ #endif
+ #endif
+
diff --git a/package/sysstat/Config.in b/package/sysstat/Config.in
new file mode 100644
index 000000000..21746c145
--- /dev/null
+++ b/package/sysstat/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_SYSSTAT
+ prompt "sysstat........................... System monitoring and performance analysis utilities"
+ tristate
+ default n
+ help
+ The sysstat package contains utilities to monitor system performance and
+ usage activity. Sysstat contains various utilities, common to many commercial
+ Unixes, and tools you can schedule via cron to collect and historize
+ performance and activity data.
+
+ http://perso.wanadoo.fr/sebastien.godard/
diff --git a/package/sysstat/Makefile b/package/sysstat/Makefile
new file mode 100644
index 000000000..99f57eb9e
--- /dev/null
+++ b/package/sysstat/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= sysstat
+PKG_VERSION:= 7.0.3
+PKG_RELEASE:= 3
+PKG_MD5SUM:= 732904b006a0224b0a9ce4d312946277
+MASTER_SITES:= http://perso.orange.fr/sebastien.godard/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,SYSSTAT,sysstat,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+do-configure:
+ ${CP} ./files/CONFIG ${WRKBUILD}/build/
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_SYSSTAT}/usr/lib/sa
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/sa/sa1 ${IDIR_SYSSTAT}/usr/lib/sa
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/sa/sa2 ${IDIR_SYSSTAT}/usr/lib/sa
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/sa/sadc ${IDIR_SYSSTAT}/usr/lib/sa
+ ${INSTALL_DIR} ${IDIR_SYSSTAT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/sar ${IDIR_SYSSTAT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/sadf ${IDIR_SYSSTAT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/iostat ${IDIR_SYSSTAT}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/mpstat ${IDIR_SYSSTAT}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/sysstat/files/CONFIG b/package/sysstat/files/CONFIG
new file mode 100644
index 000000000..0119429cb
--- /dev/null
+++ b/package/sysstat/files/CONFIG
@@ -0,0 +1,45 @@
+# Configuration file for sysstat
+# (C) 2000-2006 Sebastien GODARD (sysstat <at> wanadoo.fr)
+
+# Directories
+PREFIX = /usr
+SA_LIB_DIR = /usr/lib/sa
+SADC_PATH = ${SA_LIB_DIR}/sadc
+SA_DIR = /var/log/sa
+MAN_DIR = /usr/man
+CLEAN_SA_DIR = n
+YESTERDAY =
+HISTORY = 7
+
+DFLAGS =
+SAS_DFLAGS =
+
+ENABLE_NLS = n
+ENABLE_SMP_WRKARD = n
+
+ifeq ($(ENABLE_NLS),y)
+# NLS (National Language Support)
+REQUIRE_NLS = -DUSE_NLS -DPACKAGE=\"$(PACKAGE)\" -DLOCALEDIR=\"$(PREFIX)/share/locale\"
+endif
+ifdef REQUIRE_NLS
+ DFLAGS += $(REQUIRE_NLS)
+endif
+
+ifeq ($(ENABLE_SMP_WRKARD),y)
+# Uncomment this to enable workaround for Linux kernel SMP race condition
+SAS_DFLAGS += -DSMP_RACE
+endif
+
+# Man page group
+MAN_GROUP = man
+
+# Crontab owner
+CRON_OWNER = root
+
+# Run-command directories
+RC_DIR = /etc
+INIT_DIR = /etc/init.d
+INITD_DIR = init.d
+
+INSTALL_CRON = n
+
diff --git a/package/sysstat/ipkg/sysstat.control b/package/sysstat/ipkg/sysstat.control
new file mode 100644
index 000000000..a79cea22c
--- /dev/null
+++ b/package/sysstat/ipkg/sysstat.control
@@ -0,0 +1,4 @@
+Package: sysstat
+Priority: optional
+Section: utilities
+Description: Utilities for system monitoring and performance analysis
diff --git a/package/sysstat/patches/patch-Makefile b/package/sysstat/patches/patch-Makefile
new file mode 100644
index 000000000..21cc0e994
--- /dev/null
+++ b/package/sysstat/patches/patch-Makefile
@@ -0,0 +1,79 @@
+$Id$
+
+ removes manpages, some chown-stuff and the cron-stuff (no need for it)
+ fixes cross-compilation
+
+--- sysstat-7.0.3.orig/Makefile Sun Oct 22 16:27:03 2006
++++ sysstat-7.0.3/Makefile Fri May 18 18:31:06 2007
+@@ -7,7 +7,7 @@ VERSION = 7.0.3
+ include build/CONFIG
+
+ # Compiler to use
+-CC = gcc
++CC ?= gcc
+ # Other commands
+ SED = sed
+ CHMOD = chmod
+@@ -37,8 +37,9 @@ NLS_DIR = $(PREFIX)/share/locale
+ SYSCONFIG_DIR = /etc/sysconfig
+
+ # Compiler flags
+-CFLAGS = -Wall -Wstrict-prototypes -pipe -O2 -fno-strength-reduce
+-LFLAGS = -s
++CFLAGS ?= -O2 -pipe
++CFLAGS += -Wall -Wstrict-prototypes -fno-strength-reduce
++LFLAGS = -s ${LDFLAGS}
+ # SAS_DFLAGS may also contain SMP_RACE definition
+ SAS_DFLAGS += -DSA_DIR=\"$(SA_DIR)\" -DSADC_PATH=\"$(SADC_PATH)\"
+
+@@ -179,10 +180,8 @@ endif
+ .PHONY: clean distclean config install install_base install_all uninstall \
+ uninstall_base uninstall_all dist bdist
+
+-install_base: all man/sadc.8 man/sar.1 man/sadf.1 man/sa1.8 man/sa2.8 man/iostat.1
++install_base: all
+ mkdir -p $(DESTDIR)$(SA_LIB_DIR)
+- mkdir -p $(DESTDIR)$(MAN1_DIR)
+- mkdir -p $(DESTDIR)$(MAN8_DIR)
+ mkdir -p $(DESTDIR)$(SA_DIR)
+ ifeq ($(CLEAN_SA_DIR),y)
+ rm -f $(DESTDIR)$(SA_DIR)/sa??
+@@ -191,19 +190,12 @@ endif
+ mkdir -p $(DESTDIR)$(DOC_DIR)
+ mkdir -p $(DESTDIR)$(SYSCONFIG_DIR)
+ install -m 755 sa1 $(DESTDIR)$(SA_LIB_DIR)
+- install -m 644 $(MANGRPARG) man/sa1.8 $(DESTDIR)$(MAN8_DIR)
+ install -m 755 sa2 $(DESTDIR)$(SA_LIB_DIR)
+- install -m 644 $(MANGRPARG) man/sa2.8 $(DESTDIR)$(MAN8_DIR)
+ install -m 755 sadc $(DESTDIR)$(SA_LIB_DIR)
+- install -m 644 $(MANGRPARG) man/sadc.8 $(DESTDIR)$(MAN8_DIR)
+ install -m 755 sar $(DESTDIR)$(BIN_DIR)
+- install -m 644 $(MANGRPARG) man/sar.1 $(DESTDIR)$(MAN1_DIR)
+ install -m 755 sadf $(DESTDIR)$(BIN_DIR)
+- install -m 644 $(MANGRPARG) man/sadf.1 $(DESTDIR)$(MAN1_DIR)
+ install -m 755 iostat $(DESTDIR)$(BIN_DIR)
+- install -m 644 $(MANGRPARG) man/iostat.1 $(DESTDIR)$(MAN1_DIR)
+ install -m 755 mpstat $(DESTDIR)$(BIN_DIR)
+- install -m 644 $(MANGRPARG) man/mpstat.1 $(DESTDIR)$(MAN1_DIR)
+ install -m 644 sysstat.ioconf $(DESTDIR)$(SYSCONFIG_DIR);
+ install -m 644 CHANGES $(DESTDIR)$(DOC_DIR)
+ install -m 644 COPYING $(DESTDIR)$(DOC_DIR)
+@@ -243,18 +235,6 @@ ifdef REQUIRE_NLS
+ endif
+
+ install_all: install_base
+- $(CHOWN) $(CRON_OWNER) $(DESTDIR)$(SA_DIR)
+- if [ -d $(DESTDIR)/etc/cron.d ]; then \
+- install -m 644 sysstat.crond $(DESTDIR)/etc/cron.d/sysstat; \
+- elif [ -d $(DESTDIR)/etc/cron.hourly -a -d $(DESTDIR)/etc/cron.daily ]; then \
+- install -m 755 sysstat.cron.hourly $(DESTDIR)/etc/cron.hourly/sysstat; \
+- install -m 755 sysstat.cron.daily $(DESTDIR)/etc/cron.daily/sysstat; \
+- else \
+- su $(CRON_OWNER) -c "crontab -l > /tmp/crontab-$(CRON_OWNER).save"; \
+- $(CP) -a /tmp/crontab-$(CRON_OWNER).save ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.save; \
+- echo "USER PREVIOUS CRONTAB SAVED IN CURRENT DIRECTORY (USING .save SUFFIX)."; \
+- su $(CRON_OWNER) -c "crontab crontab"; \
+- fi
+ if [ -d $(DESTDIR)$(INIT_DIR) ]; then \
+ install -m 755 sysstat $(DESTDIR)$(INIT_DIR)/sysstat; \
+ if [ -x $(CHKCONFIG) ]; then \
diff --git a/package/tar/Config.in b/package/tar/Config.in
new file mode 100644
index 000000000..6ef861a2c
--- /dev/null
+++ b/package/tar/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_TAR
+ prompt "gtar.............................. gnu tar"
+ tristate
+ default n
+ help
+ The GNU implementation of tar.
+
+ http://www.gnu.org/software/tar/
diff --git a/package/tar/Makefile b/package/tar/Makefile
new file mode 100644
index 000000000..75f8eb47c
--- /dev/null
+++ b/package/tar/Makefile
@@ -0,0 +1,28 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tar
+PKG_VERSION:= 1.22
+PKG_RELEASE:= 1
+PKG_MD5SUM:= efafad1b256e3de410f4fce5335d9c9d
+
+MASTER_SITES:= ftp://ftp.informatik.rwth-aachen.de/pub/gnu/tar/ \
+ http://mirrors.kernel.org/gnu/tar/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TAR,tar,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TAR}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/tar ${IDIR_TAR}/usr/bin/tar
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tar/ipkg/tar.control b/package/tar/ipkg/tar.control
new file mode 100644
index 000000000..7d53ceea8
--- /dev/null
+++ b/package/tar/ipkg/tar.control
@@ -0,0 +1,4 @@
+Package: tar
+Priority: optional
+Section: archival
+Description: GNU tar
diff --git a/package/tcl/Config.in b/package/tcl/Config.in
new file mode 100644
index 000000000..292b447e9
--- /dev/null
+++ b/package/tcl/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_TCL
+ prompt "tcl............................... TCL"
+ tristate
+ default n
+ help
+ The TCL scripting language.
+
+ http://www.tcl.tk/
diff --git a/package/tcl/Makefile b/package/tcl/Makefile
new file mode 100644
index 000000000..03bbb5975
--- /dev/null
+++ b/package/tcl/Makefile
@@ -0,0 +1,38 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= tcl
+PKG_VERSION= 8.4.18
+PKG_RELEASE= 1
+PKG_MD5SUM= 7d8bc95036f797b1a2b62a5a382d2cc1
+DISTFILES= tcl${PKG_VERSION}-src.tar.gz
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tcl/}
+
+WRKDIST= ${WRKDIR}/tcl${PKG_VERSION}
+WRKSRC= ${WRKDIST}/unix
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TCL,tcl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= tcl_cv_strstr_unbroken=ok \
+ tcl_cv_strtod_buggy=ok \
+ tcl_cv_strtod_unbroken=ok \
+ tcl_cv_strtoul_unbroken=ok
+CONFIGURE_ARGS+= --enable-man-symlinks \
+ --enable-shared
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TCL}/usr/lib ${IDIR_TCL}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/* ${IDIR_TCL}/usr/bin
+ ${CP} ${WRKINST}/usr/lib/* ${IDIR_TCL}/usr/lib
+ chmod u+w ${IDIR_TCL}/usr/lib/libtcl8.4.so # for strip
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tcl/ipkg/tcl.control b/package/tcl/ipkg/tcl.control
new file mode 100644
index 000000000..8e96dd264
--- /dev/null
+++ b/package/tcl/ipkg/tcl.control
@@ -0,0 +1,4 @@
+Package: tcl
+Priority: optional
+Section: devel
+Description: the TCL scripting language
diff --git a/package/tcp_wrappers/Config.in b/package/tcp_wrappers/Config.in
new file mode 100644
index 000000000..7da5381fb
--- /dev/null
+++ b/package/tcp_wrappers/Config.in
@@ -0,0 +1,15 @@
+config ADK_COMPILE_TCP_WRAPPERS
+ bool
+ default n
+ depends ADK_PACKAGE_LIBWRAP
+
+config ADK_PACKAGE_LIBWRAP
+ prompt "libwrap........................... Security wrapper library for TCP services"
+ tristate
+ default n
+ select ADK_COMPILE_TCP_WRAPPERS
+ help
+ Security wrapper library for TCP services.
+
+ ftp://ftp.porcupine.org/pub/security/index.html
+
diff --git a/package/tcp_wrappers/Makefile b/package/tcp_wrappers/Makefile
new file mode 100644
index 000000000..af215d5d8
--- /dev/null
+++ b/package/tcp_wrappers/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tcp_wrappers
+PKG_VERSION:= 7.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e6fa25f71226d090f34de3f6b122fb5a
+MASTER_SITES:= ftp://ftp.porcupine.org/pub/security/
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/${PKG_NAME}_${PKG_VERSION}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LIBWRAP,libwrap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+ALL_TARGET:= tidy all
+MAKE_FLAGS+= OPT_CFLAGS="${TARGET_CFLAGS}" \
+ CC="${TARGET_CC}" \
+ LIBS=-lnsl \
+ NETGROUP= \
+ VSYSLOG= \
+ BUGS= \
+ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 \
+ -Dss_family=__ss_family -Dss_len=__ss_len" \
+ FACILITY=LOG_DAEMON \
+ SEVERITY=LOG_INFO \
+ REAL_DAEMON_DIR=/usr/sbin \
+ STYLE="-DPROCESS_OPTIONS" \
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_LIBWRAP}/usr/lib
+ ${INSTALL_DIR} ${IDIR_LIBWRAP}/usr/include
+ ${CP} ${WRKBUILD}/shared/libwrap.so.* ${IDIR_LIBWRAP}/usr/lib/
+ ${CP} ${WRKBUILD}/tcpd.h ${IDIR_LIBWRAP}/usr/include/
+ ${INSTALL_DIR} ${WRKINST}/usr/lib
+ ${CP} ${WRKBUILD}/shared/libwrap.so* ${WRKINST}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tcp_wrappers/ipkg/libwrap.control b/package/tcp_wrappers/ipkg/libwrap.control
new file mode 100644
index 000000000..88a5778e9
--- /dev/null
+++ b/package/tcp_wrappers/ipkg/libwrap.control
@@ -0,0 +1,4 @@
+Package: libwrap
+Priority: optional
+Section: net
+Description: IP based access control.
diff --git a/package/tcp_wrappers/patches/debian-subset.patch b/package/tcp_wrappers/patches/debian-subset.patch
new file mode 100644
index 000000000..c0c37501d
--- /dev/null
+++ b/package/tcp_wrappers/patches/debian-subset.patch
@@ -0,0 +1,936 @@
+--- tcp-wrappers-7.6.orig/hosts_access.c
++++ tcp-wrappers-7.6/hosts_access.c
+@@ -240,6 +240,26 @@
+ }
+ }
+
++/* hostfile_match - look up host patterns from file */
++
++static int hostfile_match(path, host)
++char *path;
++struct hosts_info *host;
++{
++ char tok[BUFSIZ];
++ int match = NO;
++ FILE *fp;
++
++ if ((fp = fopen(path, "r")) != 0) {
++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
++ /* void */ ;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", path);
++ }
++ return (match);
++}
++
+ /* host_match - match host name and/or address against pattern */
+
+ static int host_match(tok, host)
+@@ -267,6 +287,8 @@
+ tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */
+ return (NO);
+ #endif
++ } else if (tok[0] == '/') { /* /file hack */
++ return (hostfile_match(tok, host));
+ } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
+ char *name = eval_hostname(host);
+ return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
+--- tcp-wrappers-7.6.orig/tcpd.h
++++ tcp-wrappers-7.6/tcpd.h
+@@ -4,6 +4,25 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifndef _TCPWRAPPERS_TCPD_H
++#define _TCPWRAPPERS_TCPD_H
++
++/* someone else may have defined this */
++#undef __P
++
++/* use prototypes if we have an ANSI C compiler or are using C++ */
++#if defined(__STDC__) || defined(__cplusplus)
++#define __P(args) args
++#else
++#define __P(args) ()
++#endif
++
++/* Need definitions of struct sockaddr_in and FILE. */
++#include <netinet/in.h>
++#include <stdio.h>
++
++__BEGIN_DECLS
++
+ /* Structure to describe one communications endpoint. */
+
+ #define STRING_LENGTH 128 /* hosts, users, processes */
+@@ -25,10 +44,10 @@
+ char pid[10]; /* access via eval_pid(request) */
+ struct host_info client[1]; /* client endpoint info */
+ struct host_info server[1]; /* server endpoint info */
+- void (*sink) (); /* datagram sink function or 0 */
+- void (*hostname) (); /* address to printable hostname */
+- void (*hostaddr) (); /* address to printable address */
+- void (*cleanup) (); /* cleanup function or 0 */
++ void (*sink) __P((int)); /* datagram sink function or 0 */
++ void (*hostname) __P((struct host_info *)); /* address to printable hostname */
++ void (*hostaddr) __P((struct host_info *)); /* address to printable address */
++ void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
+ struct netconfig *config; /* netdir handle */
+ };
+
+@@ -61,25 +80,30 @@
+ /* Global functions. */
+
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
+-extern void fromhost(); /* get/validate client host info */
++extern void fromhost __P((struct request_info *)); /* get/validate client host info */
+ #else
+ #define fromhost sock_host /* no TLI support needed */
+ #endif
+
+-extern int hosts_access(); /* access control */
+-extern void shell_cmd(); /* execute shell command */
+-extern char *percent_x(); /* do %<char> expansion */
+-extern void rfc931(); /* client name from RFC 931 daemon */
+-extern void clean_exit(); /* clean up and exit */
+-extern void refuse(); /* clean up and exit */
+-extern char *xgets(); /* fgets() on steroids */
+-extern char *split_at(); /* strchr() and split */
+-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
++extern void shell_cmd __P((char *)); /* execute shell command */
++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
++extern void clean_exit __P((struct request_info *)); /* clean up and exit */
++extern void refuse __P((struct request_info *)); /* clean up and exit */
++extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
++extern char *split_at __P((char *, int)); /* strchr() and split */
++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
+
+ /* Global variables. */
+
++#ifdef HAVE_WEAKSYMS
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
++#else
+ extern int allow_severity; /* for connection logging */
+ extern int deny_severity; /* for connection logging */
++#endif
++
+ extern char *hosts_allow_table; /* for verification mode redirection */
+ extern char *hosts_deny_table; /* for verification mode redirection */
+ extern int hosts_access_verbose; /* for verbose matching mode */
+@@ -92,9 +116,14 @@
+ */
+
+ #ifdef __STDC__
++extern int hosts_access(struct request_info *request);
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
++ char *client_user);
+ extern struct request_info *request_init(struct request_info *,...);
+ extern struct request_info *request_set(struct request_info *,...);
+ #else
++extern int hosts_access();
++extern int hosts_ctl();
+ extern struct request_info *request_init(); /* initialize request */
+ extern struct request_info *request_set(); /* update request structure */
+ #endif
+@@ -117,27 +146,31 @@
+ * host_info structures serve as caches for the lookup results.
+ */
+
+-extern char *eval_user(); /* client user */
+-extern char *eval_hostname(); /* printable hostname */
+-extern char *eval_hostaddr(); /* printable host address */
+-extern char *eval_hostinfo(); /* host name or address */
+-extern char *eval_client(); /* whatever is available */
+-extern char *eval_server(); /* whatever is available */
++extern char *eval_user __P((struct request_info *)); /* client user */
++extern char *eval_hostname __P((struct host_info *)); /* printable hostname */
++extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */
++extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */
++extern char *eval_client __P((struct request_info *)); /* whatever is available */
++extern char *eval_server __P((struct request_info *)); /* whatever is available */
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
+ /* Socket-specific methods, including DNS hostname lookups. */
+
+-extern void sock_host(); /* look up endpoint addresses */
+-extern void sock_hostname(); /* translate address to hostname */
+-extern void sock_hostaddr(); /* address to printable address */
++/* look up endpoint addresses */
++extern void sock_host __P((struct request_info *));
++/* translate address to hostname */
++extern void sock_hostname __P((struct host_info *));
++/* address to printable address */
++extern void sock_hostaddr __P((struct host_info *));
++
+ #define sock_methods(r) \
+ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
+
+ /* The System V Transport-Level Interface (TLI) interface. */
+
+ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
+-extern void tli_host(); /* look up endpoint addresses etc. */
++extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */
+ #endif
+
+ /*
+@@ -178,7 +211,7 @@
+ * behavior.
+ */
+
+-extern void process_options(); /* execute options */
++extern void process_options __P((char *, struct request_info *)); /* execute options */
+ extern int dry_run; /* verification flag */
+
+ /* Bug workarounds. */
+@@ -217,3 +250,7 @@
+ #define strtok my_strtok
+ extern char *my_strtok();
+ #endif
++
++__END_DECLS
++
++#endif /* tcpd.h */
+--- tcp-wrappers-7.6.orig/Makefile
++++ tcp-wrappers-7.6/Makefile
+@@ -1,5 +1,10 @@
++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
++
+ # @(#) Makefile 1.23 97/03/21 19:27:20
+
++# unset the HOSTNAME environment variable
++HOSTNAME =
++
+ what:
+ @echo
+ @echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
+@@ -19,7 +24,7 @@
+ @echo " generic (most bsd-ish systems with sys5 compatibility)"
+ @echo " 386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
+ @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
+- @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
++ @echo " linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
+ @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
+ @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
+ @echo " uts215 uxp"
+@@ -43,8 +48,8 @@
+ # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
+ #REAL_DAEMON_DIR=/usr/etc
+ #
+-# SysV.4 Solaris 2.x OSF AIX
+-#REAL_DAEMON_DIR=/usr/sbin
++# SysV.4 Solaris 2.x OSF AIX Linux
++REAL_DAEMON_DIR=/usr/sbin
+ #
+ # BSD 4.4
+ #REAL_DAEMON_DIR=/usr/libexec
+@@ -141,10 +146,21 @@
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+ EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
+
++ifneq ($(GLIBC),0)
++MYLIB=-lnsl
++endif
++
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
+- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
++
++gnu:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
++ EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -391,7 +407,7 @@
+ # the ones provided with this source distribution. The environ.c module
+ # implements setenv(), getenv(), and putenv().
+
+-AUX_OBJ= setenv.o
++#AUX_OBJ= setenv.o
+ #AUX_OBJ= environ.o
+ #AUX_OBJ= environ.o strcasecmp.o
+
+@@ -454,7 +470,8 @@
+ # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
+ # around this. The workaround does no harm on other Solaris versions.
+
+-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
++BUGS =
++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
+ #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
+
+@@ -464,7 +481,7 @@
+ # If your system supports NIS or YP-style netgroups, enable the following
+ # macro definition. Netgroups are used only for host access control.
+ #
+-#NETGROUP= -DNETGROUP
++NETGROUP= -DNETGROUP
+
+ ###############################################################
+ # System dependencies: whether or not your system has vsyslog()
+@@ -491,7 +508,7 @@
+ # Uncomment the next definition to turn on the language extensions
+ # (examples: allow, deny, banners, twist and spawn).
+ #
+-#STYLE = -DPROCESS_OPTIONS # Enable language extensions.
++STYLE = -DPROCESS_OPTIONS # Enable language extensions.
+
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -514,7 +531,7 @@
+ #
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
+
+-FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
++FACILITY= LOG_DAEMON # LOG_MAIL is what most sendmail daemons use
+
+ # The syslog priority at which successful connections are logged.
+
+@@ -610,7 +627,7 @@
+ # Paranoid mode implies hostname lookup. In order to disable hostname
+ # lookups altogether, see the next section.
+
+-PARANOID= -DPARANOID
++#PARANOID= -DPARANOID
+
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -623,7 +640,7 @@
+ # In order to perform selective hostname lookups, disable paranoid
+ # mode (see previous section) and comment out the following definition.
+
+-HOSTNAME= -DALWAYS_HOSTNAME
++#HOSTNAME= -DALWAYS_HOSTNAME
+
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -649,28 +666,46 @@
+ # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+-# KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+
+ ## End configuration options
+ ############################
+
+ # Protection against weird shells or weird make programs.
+
++CC = gcc
+ SHELL = /bin/sh
+-.c.o:; $(CC) $(CFLAGS) -c $*.c
++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c
++
++SOMAJOR = 0
++SOMINOR = 7.6
++
++LIB = libwrap.a
++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
++SHLIBSO = shared/libwrap.so
++SHLIBFLAGS = -Lshared -lwrap
+
+-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++shared/%.o: %.c
++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
++
++CFLAGS = -O2 -g -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+ $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
+ $(VSYSLOG) $(HOSTNAME)
+
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHCFLAGS = -fPIC -shared -D_REENTRANT
++
+ LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
+ hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
+ $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
+ update.o misc.o diag.o percent_m.o myvsyslog.o
+
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++
+ FROM_OBJ= fromhost.o
+
+ KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
+@@ -684,46 +719,78 @@
+ refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
+ scaffold.h tcpdmatch.8 README.NIS
+
+-LIB = libwrap.a
+-
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+
+ config-check:
+ @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
+- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
+- if cmp cflags /tmp/cflags.$$$$ ; \
+- then rm /tmp/cflags.$$$$ ; \
+- else mv /tmp/cflags.$$$$ cflags ; \
++ @set +e; echo $(CFLAGS) >cflags.new ; \
++ if cmp cflags cflags.new ; \
++ then rm cflags.new ; \
++ else mv cflags.new cflags ; \
+ fi >/dev/null 2>/dev/null
++ @if [ ! -d shared ]; then mkdir shared; fi
+
+ $(LIB): $(LIB_OBJ)
+ rm -f $(LIB)
+ $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
+ -$(RANLIB) $(LIB)
+
+-tcpd: tcpd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
++$(SHLIB): $(SHLIB_OBJ)
++ rm -f $(SHLIB)
++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
++ ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
++
++tcpd: tcpd.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+-miscd: miscd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
++miscd: miscd.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
+
+-safe_finger: safe_finger.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
++safe_finger: safe_finger.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+-try-from: try-from.o fakelog.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
++try-from: try-from.o fakelog.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
++
++install: install-lib install-bin install-dev
++
++install-lib:
++ install -o root -g root -m 0644 $(SHLIB) ${DESTDIR}/lib/
++ ln -s $(notdir $(SHLIB)) ${DESTDIR}/lib/$(notdir $(SHLIBSOMAJ))
++
++install-bin:
++ install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
++ install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
++ install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
++ install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
++
++install-dev:
++ ln -s /lib/$(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
++ install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
++ install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
++ install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
++ ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
++ ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
++ ln -s hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
+
+ shar: $(KIT)
+ @shar $(KIT)
+@@ -739,7 +806,8 @@
+
+ clean:
+ rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
+- cflags
++ cflags libwrap*.so*
++ rm -rf shared
+
+ tidy: clean
+ chmod -R a+r .
+@@ -885,5 +953,6 @@
+ update.o: mystdarg.h
+ update.o: tcpd.h
+ vfprintf.o: cflags
++weak_symbols.o: tcpd.h
+ workarounds.o: cflags
+ workarounds.o: tcpd.h
+--- tcp-wrappers-7.6.orig/hosts_access.5
++++ tcp-wrappers-7.6/hosts_access.5
+@@ -8,9 +8,9 @@
+ impatient reader is encouraged to skip to the EXAMPLES section for a
+ quick introduction.
+ .PP
+-An extended version of the access control language is described in the
+-\fIhosts_options\fR(5) document. The extensions are turned on at
+-program build time by building with -DPROCESS_OPTIONS.
++The extended version of the access control language is described in the
++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
++the meaning of \fIshell_command\fB as documented below.\fR
+ .PP
+ In the following text, \fIdaemon\fR is the the process name of a
+ network daemon process, and \fIclient\fR is the name and/or address of
+@@ -40,7 +40,7 @@
+ character. This permits you to break up long lines so that they are
+ easier to edit.
+ .IP \(bu
+-Blank lines or lines that begin with a `#\' character are ignored.
++Blank lines or lines that begin with a `#' character are ignored.
+ This permits you to insert comments and whitespace so that the tables
+ are easier to read.
+ .IP \(bu
+@@ -69,26 +69,33 @@
+ .SH PATTERNS
+ The access control language implements the following patterns:
+ .IP \(bu
+-A string that begins with a `.\' character. A host name is matched if
++A string that begins with a `.' character. A host name is matched if
+ the last components of its name match the specified pattern. For
+-example, the pattern `.tue.nl\' matches the host name
+-`wzv.win.tue.nl\'.
++example, the pattern `.tue.nl' matches the host name
++`wzv.win.tue.nl'.
+ .IP \(bu
+-A string that ends with a `.\' character. A host address is matched if
++A string that ends with a `.' character. A host address is matched if
+ its first numeric fields match the given string. For example, the
+-pattern `131.155.\' matches the address of (almost) every host on the
++pattern `131.155.' matches the address of (almost) every host on the
+ Eind\%hoven University network (131.155.x.x).
+ .IP \(bu
+-A string that begins with an `@\' character is treated as an NIS
++A string that begins with an `@' character is treated as an NIS
+ (formerly YP) netgroup name. A host name is matched if it is a host
+ member of the specified netgroup. Netgroup matches are not supported
+ for daemon process names or for client user names.
+ .IP \(bu
+-An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
+-bitwise AND of the address and the `mask\'. For example, the net/mask
+-pattern `131.155.72.0/255.255.254.0\' matches every address in the
+-range `131.155.72.0\' through `131.155.73.255\'.
++An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a
++`net/mask' pair. A host address is matched if `net' is equal to the
++bitwise AND of the address and the `mask'. For example, the net/mask
++pattern `131.155.72.0/255.255.254.0' matches every address in the
++range `131.155.72.0' through `131.155.73.255'.
++.IP \(bu
++A string that begins with a `/' character is treated as a file
++name. A host name or address is matched if it matches any host name
++or address pattern listed in the named file. The file format is
++zero or more lines with zero or more host name or address patterns
++separated by whitespace. A file name pattern can be used anywhere
++a host name or address pattern can be used.
+ .SH WILDCARDS
+ The access control language supports explicit wildcards:
+ .IP ALL
+@@ -115,19 +122,19 @@
+ .ne 6
+ .SH OPERATORS
+ .IP EXCEPT
+-Intended use is of the form: `list_1 EXCEPT list_2\'; this construct
++Intended use is of the form: `list_1 EXCEPT list_2'; this construct
+ matches anything that matches \fIlist_1\fR unless it matches
+ \fIlist_2\fR. The EXCEPT operator can be used in daemon_lists and in
+ client_lists. The EXCEPT operator can be nested: if the control
+-language would permit the use of parentheses, `a EXCEPT b EXCEPT c\'
+-would parse as `(a EXCEPT (b EXCEPT c))\'.
++language would permit the use of parentheses, `a EXCEPT b EXCEPT c'
++would parse as `(a EXCEPT (b EXCEPT c))'.
+ .br
+ .ne 6
+ .SH SHELL COMMANDS
+ If the first-matched access control rule contains a shell command, that
+ command is subjected to %<letter> substitutions (see next section).
+ The result is executed by a \fI/bin/sh\fR child process with standard
+-input, output and error connected to \fI/dev/null\fR. Specify an `&\'
++input, output and error connected to \fI/dev/null\fR. Specify an `&'
+ at the end of the command if you do not want to wait until it has
+ completed.
+ .PP
+@@ -159,7 +166,7 @@
+ .IP %u
+ The client user name (or "unknown").
+ .IP %%
+-Expands to a single `%\' character.
++Expands to a single `%' character.
+ .PP
+ Characters in % expansions that may confuse the shell are replaced by
+ underscores.
+@@ -243,9 +250,9 @@
+ less trustworthy. It is possible for an intruder to spoof both the
+ client connection and the IDENT lookup, although doing so is much
+ harder than spoofing just a client connection. It may also be that
+-the client\'s IDENT server is lying.
++the client's IDENT server is lying.
+ .PP
+-Note: IDENT lookups don\'t work with UDP services.
++Note: IDENT lookups don't work with UDP services.
+ .SH EXAMPLES
+ The language is flexible enough that different types of access control
+ policy can be expressed with a minimum of fuss. Although the language
+@@ -285,7 +292,7 @@
+ .br
+ ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
+ .PP
+-The first rule permits access from hosts in the local domain (no `.\'
++The first rule permits access from hosts in the local domain (no `.'
+ in the host name) and from members of the \fIsome_netgroup\fP
+ netgroup. The second rule permits access from all hosts in the
+ \fIfoobar.edu\fP domain (notice the leading dot), with the exception of
+@@ -322,8 +329,8 @@
+ /etc/hosts.deny:
+ .in +3
+ .nf
+-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
+- /usr/ucb/mail -s %d-%h root) &
++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
++ /usr/bin/mail -s %d-%h root) &
+ .fi
+ .PP
+ The safe_finger command comes with the tcpd wrapper and should be
+@@ -349,7 +356,7 @@
+ capacity of an internal buffer; when an access control rule is not
+ terminated by a newline character; when the result of %<letter>
+ expansion would overflow an internal buffer; when a system call fails
+-that shouldn\'t. All problems are reported via the syslog daemon.
++that shouldn't. All problems are reported via the syslog daemon.
+ .SH FILES
+ .na
+ .nf
+--- tcp-wrappers-7.6.orig/rfc931.c
++++ tcp-wrappers-7.6/rfc931.c
+@@ -33,7 +33,7 @@
+
+ int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
+
+-static jmp_buf timebuf;
++static sigjmp_buf timebuf;
+
+ /* fsocket - open stdio stream on top of socket */
+
+@@ -62,7 +62,7 @@
+ static void timeout(sig)
+ int sig;
+ {
+- longjmp(timebuf, sig);
++ siglongjmp(timebuf, sig);
+ }
+
+ /* rfc931 - return remote user name, given socket structures */
+@@ -99,7 +99,7 @@
+ * Set up a timer so we won't get stuck while waiting for the server.
+ */
+
+- if (setjmp(timebuf) == 0) {
++ if (sigsetjmp(timebuf,1) == 0) {
+ signal(SIGALRM, timeout);
+ alarm(rfc931_timeout);
+
+--- tcp-wrappers-7.6.orig/tcpd.8
++++ tcp-wrappers-7.6/tcpd.8
+@@ -94,7 +94,7 @@
+ .PP
+ The example assumes that the network daemons live in /usr/etc. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
+-no `in.\' prefix to their name.
++no `in.' prefix to their name.
+ .SH EXAMPLE 2
+ This example applies when \fItcpd\fR expects that the network daemons
+ are left in their original place.
+@@ -110,26 +110,26 @@
+ becomes:
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /some/where/tcpd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd
+ .sp
+ .fi
+ .PP
+ The example assumes that the network daemons live in /usr/etc. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
+-daemons have no `in.\' prefix to their name, or there is no userid
++daemons have no `in.' prefix to their name, or there is no userid
+ field in the inetd configuration file.
+ .PP
+ Similar changes will be needed for the other services that are to be
+-covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8)
++covered by \fItcpd\fR. Send a `kill -HUP' to the \fIinetd\fR(8)
+ process to make the changes effective. AIX users may also have to
+-execute the `inetimp\' command.
++execute the `inetimp' command.
+ .SH EXAMPLE 3
+ In the case of daemons that do not live in a common directory ("secret"
+ or otherwise), edit the \fIinetd\fR configuration file so that it
+ specifies an absolute path name for the process name field. For example:
+ .nf
+ .sp
+- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd
++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.ntalkd
+ .sp
+ .fi
+ .PP
+--- tcp-wrappers-7.6.orig/hosts_access.3
++++ tcp-wrappers-7.6/hosts_access.3
+@@ -3,7 +3,7 @@
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
+ .SH SYNOPSIS
+ .nf
+-#include "tcpd.h"
++#include <tcpd.h>
+
+ extern int allow_severity;
+ extern int deny_severity;
+--- tcp-wrappers-7.6.orig/options.c
++++ tcp-wrappers-7.6/options.c
+@@ -473,6 +473,9 @@
+ #ifdef LOG_CRON
+ "cron", LOG_CRON,
+ #endif
++#ifdef LOG_FTP
++ "ftp", LOG_FTP,
++#endif
+ #ifdef LOG_LOCAL0
+ "local0", LOG_LOCAL0,
+ #endif
+--- tcp-wrappers-7.6.orig/fix_options.c
++++ tcp-wrappers-7.6/fix_options.c
+@@ -35,7 +35,12 @@
+ #ifdef IP_OPTIONS
+ unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+ char lbuf[BUFFER_SIZE], *lp;
++#if !defined(__GLIBC__)
+ int optsize = sizeof(optbuf), ipproto;
++#else /* __GLIBC__ */
++ size_t optsize = sizeof(optbuf);
++ int ipproto;
++#endif /* __GLIBC__ */
+ struct protoent *ip;
+ int fd = request->fd;
+ unsigned int opt;
+--- tcp-wrappers-7.6.orig/workarounds.c
++++ tcp-wrappers-7.6/workarounds.c
+@@ -163,7 +163,11 @@
+ int fix_getpeername(sock, sa, len)
+ int sock;
+ struct sockaddr *sa;
++#if !defined(__GLIBC__)
+ int *len;
++#else /* __GLIBC__ */
++size_t *len;
++#endif /* __GLIBC__ */
+ {
+ int ret;
+ struct sockaddr_in *sin = (struct sockaddr_in *) sa;
+--- tcp-wrappers-7.6.orig/socket.c
++++ tcp-wrappers-7.6/socket.c
+@@ -76,7 +76,11 @@
+ {
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#if !defined (__GLIBC__)
+ int len;
++#else /* __GLIBC__ */
++ size_t len;
++#endif /* __GLIBC__ */
+ char buf[BUFSIZ];
+ int fd = request->fd;
+
+@@ -224,7 +228,11 @@
+ {
+ char buf[BUFSIZ];
+ struct sockaddr_in sin;
++#if !defined(__GLIBC__)
+ int size = sizeof(sin);
++#else /* __GLIBC__ */
++ size_t size = sizeof(sin);
++#endif /* __GLIBC__ */
+
+ /*
+ * Eat up the not-yet received datagram. Some systems insist on a
+--- tcp-wrappers-7.6.orig/safe_finger.c
++++ tcp-wrappers-7.6/safe_finger.c
+@@ -26,21 +26,24 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <pwd.h>
++#include <syslog.h>
+
+ extern void exit();
+
+ /* Local stuff */
+
+-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
+
+ #define TIME_LIMIT 60 /* Do not keep listinging forever */
+ #define INPUT_LENGTH 100000 /* Do not keep listinging forever */
+ #define LINE_LENGTH 128 /* Editors can choke on long lines */
+ #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */
+ #define UNPRIV_NAME "nobody" /* Preferred privilege level */
+-#define UNPRIV_UGID 32767 /* Default uid and gid */
++#define UNPRIV_UGID 65534 /* Default uid and gid */
+
+ int finger_pid;
++int allow_severity = SEVERITY;
++int deny_severity = LOG_WARNING;
+
+ void cleanup(sig)
+ int sig;
+--- tcp-wrappers-7.6.orig/hosts_options.5
++++ tcp-wrappers-7.6/hosts_options.5
+@@ -58,12 +58,12 @@
+ Execute, in a child process, the specified shell command, after
+ performing the %<letter> expansions described in the hosts_access(5)
+ manual page. The command is executed with stdin, stdout and stderr
+-connected to the null device, so that it won\'t mess up the
++connected to the null device, so that it won't mess up the
+ conversation with the client host. Example:
+ .sp
+ .nf
+ .ti +3
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
+ .fi
+ .sp
+ executes, in a background child process, the shell command "safe_finger
+--- tcp-wrappers-7.6.orig/tcpdchk.c
++++ tcp-wrappers-7.6/tcpdchk.c
+@@ -350,6 +350,8 @@
+ {
+ if (pat[0] == '@') {
+ tcpd_warn("%s: daemon name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: daemon name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: daemon name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -382,6 +384,8 @@
+ {
+ if (pat[0] == '@') { /* @netgroup */
+ tcpd_warn("%s: user name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: user name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: user name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -402,8 +406,13 @@
+ static int check_host(pat)
+ char *pat;
+ {
++ char buf[BUFSIZ];
+ char *mask;
+ int addr_count = 1;
++ FILE *fp;
++ struct tcpd_context saved_context;
++ char *cp;
++ char *wsp = " \t\r\n";
+
+ if (pat[0] == '@') { /* @netgroup */
+ #ifdef NO_NETGRENT
+@@ -422,6 +431,21 @@
+ tcpd_warn("netgroup support disabled");
+ #endif
+ #endif
++ } else if (pat[0] == '/') { /* /path/name */
++ if ((fp = fopen(pat, "r")) != 0) {
++ saved_context = tcpd_context;
++ tcpd_context.file = pat;
++ tcpd_context.line = 0;
++ while (fgets(buf, sizeof(buf), fp)) {
++ tcpd_context.line++;
++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
++ check_host(cp);
++ }
++ tcpd_context = saved_context;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", pat);
++ }
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
+ if (dot_quad_addr(pat) == INADDR_NONE
+ || dot_quad_addr(mask) == INADDR_NONE)
+--- tcp-wrappers-7.6.orig/percent_m.c
++++ tcp-wrappers-7.6/percent_m.c
+@@ -13,7 +13,7 @@
+ #include <string.h>
+
+ extern int errno;
+-#ifndef SYS_ERRLIST_DEFINED
++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+ #endif
+@@ -29,11 +29,15 @@
+
+ while (*bp = *cp)
+ if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++ strcpy(bp, strerror(errno));
++#else
+ if (errno < sys_nerr && errno > 0) {
+ strcpy(bp, sys_errlist[errno]);
+ } else {
+ sprintf(bp, "Unknown error %d", errno);
+ }
++#endif
+ bp += strlen(bp);
+ cp += 2;
+ } else {
+--- tcp-wrappers-7.6.orig/scaffold.c
++++ tcp-wrappers-7.6/scaffold.c
+@@ -180,10 +180,12 @@
+
+ /* ARGSUSED */
+
+-void rfc931(request)
+-struct request_info *request;
++void rfc931(rmt_sin, our_sin, dest)
++struct sockaddr_in *rmt_sin;
++struct sockaddr_in *our_sin;
++char *dest;
+ {
+- strcpy(request->user, unknown);
++ strcpy(dest, unknown);
+ }
+
+ /* check_path - examine accessibility */
+--- tcp-wrappers-7.6.orig/weak_symbols.c
++++ tcp-wrappers-7.6/weak_symbols.c
+@@ -0,0 +1,11 @@
++ /*
++ * @(#) weak_symbols.h 1.5 99/12/29 23:50
++ *
++ * Author: Anthony Towns <ajt@debian.org>
++ */
++
++#ifdef HAVE_WEAKSYMS
++#include <syslog.h>
++int deny_severity = LOG_WARNING;
++int allow_severity = SEVERITY;
++#endif
diff --git a/package/tcp_wrappers/patches/opt_cflags.patch b/package/tcp_wrappers/patches/opt_cflags.patch
new file mode 100644
index 000000000..7b7633393
--- /dev/null
+++ b/package/tcp_wrappers/patches/opt_cflags.patch
@@ -0,0 +1,12 @@
+--- tcp_wrappers_7.6/Makefile.orig 2005-05-21 18:11:32.000000000 +0200
++++ tcp_wrappers_7.6/Makefile 2005-05-21 18:14:28.000000000 +0200
+@@ -689,7 +689,8 @@
+ shared/%.o: %.c
+ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
+
+-CFLAGS = -O2 -g -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++OPT_CFLAGS = -O2 -g
++CFLAGS = $(OPT_CFLAGS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
diff --git a/package/tcpdump/Config.in b/package/tcpdump/Config.in
new file mode 100644
index 000000000..482a477fd
--- /dev/null
+++ b/package/tcpdump/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_TCPDUMP
+ prompt "tcpdump........................... Network monitoring and data acquisition tool"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBPCAP
+ help
+ A tool for network monitoring and data acquisition.
+
+ http://www.tcpdump.org/
+
diff --git a/package/tcpdump/Makefile b/package/tcpdump/Makefile
new file mode 100644
index 000000000..2295f73f8
--- /dev/null
+++ b/package/tcpdump/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tcpdump
+PKG_VERSION:= 4.0.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b22ca72890df2301d922c9f2d17867f9
+MASTER_SITES:= http://www.tcpdump.org/release/ \
+ http://www.sfr-fresh.com/unix/misc/ \
+ http://www.at.tcpdump.org/ \
+ http://www.br.tcpdump.org/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TCPDUMP,tcpdump,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= BUILD_CC="${TARGET_CC}" HOSTCC=${HOSTCC} \
+ ac_cv_linux_vers=2 \
+ td_cv_buggygetaddrinfo="no"
+CONFIGURE_ARGS+= --without-crypto
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= CCOPT="${TARGET_CFLAGS}" INCLS="-I. -I${STAGING_DIR}/usr/include"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TCPDUMP}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/tcpdump ${IDIR_TCPDUMP}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tcpdump/ipkg/tcpdump.control b/package/tcpdump/ipkg/tcpdump.control
new file mode 100644
index 000000000..ca3616976
--- /dev/null
+++ b/package/tcpdump/ipkg/tcpdump.control
@@ -0,0 +1,5 @@
+Package: tcpdump
+Priority: optional
+Section: net
+Description: A tool for network monitoring and data acquisition.
+Depends: libpcap
diff --git a/package/tcpdump/patches/patch-print-enc_c b/package/tcpdump/patches/patch-print-enc_c
new file mode 100644
index 000000000..d1e6f3460
--- /dev/null
+++ b/package/tcpdump/patches/patch-print-enc_c
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+
+* already fixed in git head
+ http://sourceforge.net/tracker/?func=detail&aid=2679354&group_id=53066&atid=469575
+
+--- tcpdump-4.0.0.orig/print-enc.c 2008-09-01 04:44:22.000000000 +0200
++++ tcpdump-4.0.0/print-enc.c 2009-04-17 19:52:13.071285657 +0200
+@@ -77,9 +77,11 @@ enc_if_print(const struct pcap_pkthdr *h
+ case AF_INET:
+ ip_print(gndo, p, length);
+ break;
++#ifdef INET6
+ case AF_INET6:
+ ip6_print(p, length);
+ break;
++#endif
+ }
+
+ out:
diff --git a/package/tinc/Config.in b/package/tinc/Config.in
new file mode 100644
index 000000000..6ef68ec46
--- /dev/null
+++ b/package/tinc/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_TINC
+ prompt "tinc.............................. VPN tunneling daemon"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_TUN
+ select ADK_PACKAGE_LIBLZO
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ help
+ A VPN tunneling daemon
+
+ http://www.tinc-vpn.org/
+
diff --git a/package/tinc/Makefile b/package/tinc/Makefile
new file mode 100644
index 000000000..aa454bfec
--- /dev/null
+++ b/package/tinc/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tinc
+PKG_VERSION:= 1.0.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f907acebada53512e01235bea6b4cdf1
+MASTER_SITES:= http://www.tinc-vpn.org/packages/ \
+ http://ftp.yi.se/pub/tinc/ \
+ http://www.mirrors.wiretapped.net/security/network-security/tinc/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TINC,tinc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-kernel=${LINUX_DIR} \
+ --with-zlib=${STAGING_DIR}/usr/ \
+ --with-lzo-include=${STAGING_DIR}/usr/include/lzo
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TINC}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/tincd ${IDIR_TINC}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tinc/ipkg/tinc.control b/package/tinc/ipkg/tinc.control
new file mode 100644
index 000000000..df0d13861
--- /dev/null
+++ b/package/tinc/ipkg/tinc.control
@@ -0,0 +1,5 @@
+Package: tinc
+Priority: optional
+Section: net
+Description: VPN tunnel daemon
+Depends: zlib, liblzo, libopenssl, kmod-tun
diff --git a/package/tinc/patches/patch-src_linux_device_c b/package/tinc/patches/patch-src_linux_device_c
new file mode 100644
index 000000000..6a5b66e3c
--- /dev/null
+++ b/package/tinc/patches/patch-src_linux_device_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- tinc-1.0.9.orig/src/linux/device.c 2006-12-16 17:54:05.000000000 +0100
++++ tinc-1.0.9/src/linux/device.c 2009-05-11 23:55:39.000000000 +0200
+@@ -64,7 +64,7 @@ bool setup_device(void)
+ #ifdef HAVE_LINUX_IF_TUN_H
+ iface = netname;
+ #else
+- iface = rindex(device, '/') ? rindex(device, '/') + 1 : device;
++ iface = strrchr(device, '/') ? strrchr(device, '/') + 1 : device;
+ #endif
+ device_fd = open(device, O_RDWR | O_NONBLOCK);
+
+@@ -104,7 +104,7 @@ bool setup_device(void)
+ overwrite_mac = true;
+ device_info = _("Linux ethertap device");
+ device_type = DEVICE_TYPE_ETHERTAP;
+- iface = rindex(device, '/') ? rindex(device, '/') + 1 : device;
++ iface = strrchr(device, '/') ? strrchr(device, '/') + 1 : device;
+ }
+
+ logger(LOG_INFO, _("%s is a %s"), device, device_info);
diff --git a/package/tinc/patches/patch-src_net_setup_c b/package/tinc/patches/patch-src_net_setup_c
new file mode 100644
index 000000000..dd4d7b495
--- /dev/null
+++ b/package/tinc/patches/patch-src_net_setup_c
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- tinc-1.0.9.orig/src/net_setup.c 2008-12-22 21:35:45.000000000 +0100
++++ tinc-1.0.9/src/net_setup.c 2009-05-11 23:52:07.000000000 +0200
+@@ -358,14 +358,14 @@ bool setup_myself(void)
+ }
+ }
+ } else
+- myself->cipher = EVP_bf_cbc();
++ myself->cipher = EVP_des_cbc();
+
+ if(myself->cipher)
+ myself->keylength = myself->cipher->key_len + myself->cipher->iv_len;
+ else
+ myself->keylength = 1;
+
+- myself->connection->outcipher = EVP_bf_ofb();
++ myself->connection->outcipher = EVP_des_ofb();
+
+ myself->key = xmalloc(myself->keylength);
+ RAND_pseudo_bytes((unsigned char *)myself->key, myself->keylength);
diff --git a/package/tinyproxy/Config.in b/package/tinyproxy/Config.in
new file mode 100644
index 000000000..c7182965b
--- /dev/null
+++ b/package/tinyproxy/Config.in
@@ -0,0 +1,30 @@
+#menu "tinyproxy......................... Tinyproxy is a lightweight HTTP and HTTPS proxy."
+
+config ADK_PACKAGE_TINYPROXY
+ prompt "tinyproxy......................... Tinyproxy is a lightweight HTTP and HTTPS proxy"
+ tristate
+ default n
+ help
+ Tinyproxy is a lightweight HTTP and HTTPS proxy.
+
+ http://tinyproxy.sourceforge.net
+
+config ADK_COMPILE_TINYPROXY_WITH_TRANSPARENT_PROXY
+ prompt " Enable transparent proxying"
+ bool
+ default y
+ depends ADK_PACKAGE_TINYPROXY
+
+config ADK_COMPILE_TINYPROXY_WITH_FILTER
+ prompt " Enable filtering support"
+ bool
+ default y
+ depends ADK_PACKAGE_TINYPROXY
+
+config ADK_COMPILE_TINYPROXY_WITH_UPSTREAM
+ prompt " Enable upstream support"
+ bool
+ default y
+ depends ADK_PACKAGE_TINYPROXY
+
+#endmenu
diff --git a/package/tinyproxy/Makefile b/package/tinyproxy/Makefile
new file mode 100644
index 000000000..cab1655a5
--- /dev/null
+++ b/package/tinyproxy/Makefile
@@ -0,0 +1,44 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tinyproxy
+PKG_VERSION:= 1.6.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3157b9159a8d005f4248cf4d4d6c65e2
+MASTER_SITES:= https://www.banu.com/pub/tinyproxy/1.6/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TINYPROXY,tinyproxy,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+CONFIGURE_ENV+= ac_cv_header_libintl_h=no
+
+ifeq (${ADK_COMPILE_TINYPROXY_WITH_TRANSPARENT_PROXY},y)
+CONFIGURE_ARGS+= --enable-transparent-proxy
+endif
+ifneq (${ADK_COMPILE_TINYPROXY_WITH_UPSTREAM},y)
+CONFIGURE_ARGS+= --disable-upstream
+endif
+ifneq (${ADK_COMPILE_TINYPROXY_WITH_FILTER},y)
+CONFIGURE_ARGS+= --disable-filter
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TINYPROXY}/usr/sbin \
+ ${IDIR_TINYPROXY}/etc/tinyproxy \
+ ${IDIR_TINYPROXY}/etc/init.d \
+ ${IDIR_TINYPROXY}/usr/share/tinyproxy
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/tinyproxy ${IDIR_TINYPROXY}/usr/sbin/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/tinyproxy/{debug,default,stats}.html ${IDIR_TINYPROXY}/usr/share/tinyproxy/
+ ${INSTALL_DATA} ${WRKINST}/usr/share/tinyproxy/HTML_VARIABLES ${IDIR_TINYPROXY}/usr/share/tinyproxy/
+ ${INSTALL_DATA} ${WRKINST}/etc/tinyproxy/tinyproxy.conf ${IDIR_TINYPROXY}/etc/tinyproxy/
+ ${INSTALL_BIN} files/${PKG_NAME}.init ${IDIR_TINYPROXY}/etc/init.d/${PKG_NAME}
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tinyproxy/files/tinyproxy.init b/package/tinyproxy/files/tinyproxy.init
new file mode 100644
index 000000000..e1b7f6f7c
--- /dev/null
+++ b/package/tinyproxy/files/tinyproxy.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${tinyproxy:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ tinyproxy
+ ;;
+stop)
+ killall tinyproxy
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/tinyproxy/ipkg/tinyproxy.control b/package/tinyproxy/ipkg/tinyproxy.control
new file mode 100644
index 000000000..821b927e4
--- /dev/null
+++ b/package/tinyproxy/ipkg/tinyproxy.control
@@ -0,0 +1,5 @@
+Package: tinyproxy
+Version: 1.6.3
+Section: net
+Description: Tinyproxy is a lightweight HTTP and HTTPS proxy.
+Priority: optional
diff --git a/package/tinyproxy/ipkg/tinyproxy.postinst b/package/tinyproxy/ipkg/tinyproxy.postinst
new file mode 100644
index 000000000..4965f625d
--- /dev/null
+++ b/package/tinyproxy/ipkg/tinyproxy.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf tinyproxy tinyproxy NO
diff --git a/package/tmsnc/Config.in b/package/tmsnc/Config.in
new file mode 100644
index 000000000..7aa450160
--- /dev/null
+++ b/package/tmsnc/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_TMSNC
+ tristate "tmsnc............................. text-based MSN client"
+ default n
+ help
+ TMSNC is a textbased (console) MSN client written in C.
+
+ http://tmsnc.sourceforge.net
diff --git a/package/tmsnc/Makefile b/package/tmsnc/Makefile
new file mode 100644
index 000000000..212ca6223
--- /dev/null
+++ b/package/tmsnc/Makefile
@@ -0,0 +1,31 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tmsnc
+PKG_VERSION:= 0.3.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 337dae91d4775e03b6681f61db56d2a7
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=tmsnc/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TMSNC,tmsnc,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes
+CONFIGURE_ARGS+= --with-libiconv-prefix=${STAGING_DIR}/usr \
+ --with-openssl=${STAGING_DIR}/usr \
+ --with-ncurses=${STAGING_DIR}
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TMSNC}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/tmsnc ${IDIR_TMSNC}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tmsnc/ipkg/tmsnc.control b/package/tmsnc/ipkg/tmsnc.control
new file mode 100644
index 000000000..383182200
--- /dev/null
+++ b/package/tmsnc/ipkg/tmsnc.control
@@ -0,0 +1,8 @@
+Package: tmsnc
+Priority: optional
+Section: net
+Source: http://tmsnc.sourceforge.net
+Priority: optional
+Section: net
+Description: TMSNC is a textbased (console) MSN client written in C. TMSNC should work on most Unix (Linux, BSD, MacOS) compatible operating systems. The goal of this project is to create a client like MSN Messenger (with sound, webcam and file transfer support), but without any graphical features.
+Depends: libncurses, libopenssl
diff --git a/package/tntnet/Config.in b/package/tntnet/Config.in
new file mode 100644
index 000000000..9abab9b82
--- /dev/null
+++ b/package/tntnet/Config.in
@@ -0,0 +1,37 @@
+config ADK_PACKAGE_TNTNET
+ prompt "tntnet............................ a modular, multithreaded webapplicationserver"
+ tristate
+ default n
+ depends on ADK_CXX
+ select ADK_PACKAGE_CXXTOOLS
+ select ADK_PACKAGE_LIBICONV
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_ZLIB
+ help
+ Tntnet is a modular, multithreaded webapplicationserver
+ written from scratch for C++.
+
+ http://www.tntnet.org
+
+choice
+prompt "SSL/TLS Configuration"
+depends on ADK_PACKAGE_TNTNET
+default ADK_COMPILE_TNTNET_WITH_OPENSSL
+
+config ADK_COMPILE_TNTNET_WITHOUT_OPENSSL
+ bool "no ssl encryption support"
+ help
+
+config ADK_COMPILE_TNTNET_WITH_OPENSSL
+ bool "enable openssl encryption support"
+ depends ADK_PACKAGE_TNTNET
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+
+config ADK_COMPILE_TNTNET_WITH_GNUTLS
+ bool "enable gnutls encryption support"
+ depends ADK_PACKAGE_TNTNET
+ select ADK_PACKAGE_LIBGNUTLS
+ help
+
+endchoice
diff --git a/package/tntnet/Makefile b/package/tntnet/Makefile
new file mode 100644
index 000000000..d53b99500
--- /dev/null
+++ b/package/tntnet/Makefile
@@ -0,0 +1,67 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tntnet
+PKG_VERSION:= 1.6.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e2c3c5075a890711a7569730493c0996
+MASTER_SITES:= http://www.tntnet.org/download/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TNTNET,tntnet,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+ifeq (${ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX},y)
+TCXXFLAGS+= -fno-builtin -nostdinc++ -nodefaultlibs -I${STAGING_DIR}/usr/include/uClibc++
+TLDFLAGS+= -nodefaultlibs -luClibc++ -liconv -lpthread -lcxxtools -lm
+DEPENDS= libgcc, uclibc++, cxxtools, zlib, libpthread, libiconv
+else
+TLDFLAGS+= -liconv -lpthread -lcxxtools -lm -ldl
+DEPENDS= libgcc, libstdcxx, cxxtools, zlib, libpthread, libiconv
+endif
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-epoll \
+ --without-sdk \
+ --without-cgi \
+ --without-sendfile
+ifeq (${ADK_COMPILE_TNTNET_WITH_OPENSSL},y)
+CONFIGURE_ARGS+= --with-ssl=openssl
+SSL_DEPS= ", libopenssl"
+else ifeq (${ADK_COMPILE_TNTNET_WITH_GNUTLS},y)
+CONFIGURE_ARGS+= --with-ssl=gnutls
+SSL_DEPS= ", libgnutls"
+else
+CONFIGURE_ARGS+= --without-ssl
+endif
+CONFIGURE_ENV+= CXXFLAGS='${TCXXFLAGS}' \
+ ac_cv_path_cxxtools_config=${STAGING_DIR}/usr/bin
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+ifeq (${ADK_COMPILE_CXXTOOLS_WITH_UCLIBCXX},y)
+# add workaround because libtool tries to link libstdc++
+post-configure:
+ ${SED} 's#postdeps="-lstdc.*#postdeps="-lm"#' \
+ ${WRKBUILD}/libtool
+endif
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TNTNET}/www
+ ${INSTALL_DIR} ${IDIR_TNTNET}/etc/tntnet
+ ${INSTALL_DIR} ${IDIR_TNTNET}/usr/bin
+ ${INSTALL_DIR} ${IDIR_TNTNET}/usr/lib/tntnet
+ ${INSTALL_DATA} ./files/tntnet.{conf,properties} \
+ ${IDIR_TNTNET}/etc/tntnet
+ ${INSTALL_DATA} ./files/mime.conf \
+ ${IDIR_TNTNET}/etc/tntnet
+ ${CP} ${WRKINST}/usr/bin/tntnet ${IDIR_TNTNET}/usr/bin
+ ${CP} ${WRKINST}/usr/lib/tntnet/tntnet.so* ${IDIR_TNTNET}/usr/lib/tntnet
+ ${CP} ${WRKINST}/usr/lib/libtntnet.so.* ${IDIR_TNTNET}/usr/lib
+ echo Depends: ${DEPENDS}${SSL_DEPS} >>${IDIR_TNTNET}/CONTROL/control
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tntnet/files/mime.conf b/package/tntnet/files/mime.conf
new file mode 100644
index 000000000..bab84a83d
--- /dev/null
+++ b/package/tntnet/files/mime.conf
@@ -0,0 +1,22 @@
+DefaultType text/html
+AddType text/plain .txt
+AddType text/html .html .htm .xhtml
+AddType image/png .png
+AddType image/gif .gif
+AddType image/bmp .bmp
+AddType application/x-tar .tgz
+AddType image/jpeg .jpeg .jpg
+AddType image/tif .tif .tiff
+AddType text/css .css
+AddType text/plain .asc
+AddType text/rtf .rtf
+AddType video/mpeg .mpeg .mpg .mpe
+AddType application/x-javascript .js
+AddType application/msword .doc .dot
+AddType application/pdf .pdf
+AddType application/postscript .ps .ai .eps
+AddType application/vnd.ms-excel .xls .xlb
+AddType application/vnd.ms-powerpoint .ppt .pps .pot
+AddType application/zip .zip
+AddType application/x-gtar .gtar .tgz .taz
+AddType application/x-java-archive .jar
diff --git a/package/tntnet/files/tntnet.conf b/package/tntnet/files/tntnet.conf
new file mode 100644
index 000000000..c51c47bc2
--- /dev/null
+++ b/package/tntnet/files/tntnet.conf
@@ -0,0 +1,49 @@
+# tntnet.conf
+
+PropertyFile /etc/tntnet/tntnet.properties
+Listen 0.0.0.0 80
+#SslListen 0.0.0.0 443 /etc/tntnet/tntnet.pem
+
+Daemon 1
+User tntnet
+Group tntnet
+CompPath /usr/lib/tntnet
+
+# set some limit to prevent DoS-attacks
+MaxRequestSize 1048576 # 1 MB
+
+#Dir /
+#Chroot /var/safedir
+PidFile /var/run/tntnet.pid
+MinThreads 2
+MaxThreads 4
+#ThreadStartDelay 0 # in ms
+#QueueSize 100
+#CompPath path
+#Load webapp # preload webapplication
+#BufferSize 16384
+#SocketReadTimeout 200
+#SocketWriteTimeout 10000
+#KeepAliveTimeout 15000
+#KeepAliveMax 100
+#SessionTimeout 300
+#CompLifetime 10
+#MaxRequestTime 600
+#ReportStateTime 1200
+
+#include /etc/tntnet.d/*.conf
+include /etc/tntnet/mime.conf
+
+# make demos callable
+#MapUrl ^/demos/controls$ redirect@tntnet /demos/controls/
+#MapUrl ^/demos/controls/(.+)\..* $1@controls
+#MapUrl ^/demos/controls/$ index@controls index
+#MapUrl ^/demos/controls/(.+) index@controls $1
+#MapUrl ^/demos/(.+)\..* $1@$1 $1
+#MapUrl ^/demos/(.+) $1@$1
+#MapUrl ^/demos/tntnet.jpg tntnet@hello
+
+# configure tntnet as a simple webserver
+DocumentRoot /www
+MapUrl (.*)/$ static@tntnet /$1/index.html
+MapUrl ^/(.*)$ static@tntnet /$1
diff --git a/package/tntnet/files/tntnet.properties b/package/tntnet/files/tntnet.properties
new file mode 100644
index 000000000..3e1006411
--- /dev/null
+++ b/package/tntnet/files/tntnet.properties
@@ -0,0 +1,31 @@
+# sample logging-properties for application tntnet
+# put this in tntnet.properties and use:
+# log_init("tntnet.properties");
+# in your application to initialize logging
+#
+# define categories with:
+# log_define("some.category")
+# this defines a static function, so you must put it outside other functions.
+# you can define a category per file or a category per namespace.
+#
+# print logging-messages with:
+# log_fatal("some fatal message");
+# log_error("some error message");
+# log_warn("some warn message");
+# log_info("some info message");
+# log_debug("some debug message");
+#
+rootLogger=INFO
+
+# define logger-categories
+logger.tntnet=INFO
+
+file=/var/log/tntnet.log
+maxfilesize=1MB
+maxbackupindex=10
+flushdelay=100 # delay write in milliseconds
+#host=localhost:1234 # send log-messages with udp
+#disabled=1 # disable logging
+#logprocess=1 # log in separate process
+#logprocesuser=someuser # change to user in log process
+#logprocesgroup=somegroup # change to group in log process
diff --git a/package/tntnet/ipkg/tntnet.conffiles b/package/tntnet/ipkg/tntnet.conffiles
new file mode 100644
index 000000000..def08bf81
--- /dev/null
+++ b/package/tntnet/ipkg/tntnet.conffiles
@@ -0,0 +1,3 @@
+/etc/tntnet/tntnet.conf
+/etc/tntnet/tntnet.properties
+/etc/tntnet/mime.conf
diff --git a/package/tntnet/ipkg/tntnet.control b/package/tntnet/ipkg/tntnet.control
new file mode 100644
index 000000000..788b3b450
--- /dev/null
+++ b/package/tntnet/ipkg/tntnet.control
@@ -0,0 +1,4 @@
+Package: tntnet
+Priority: optional
+Section: net
+Description: a modular, multithreaded webapplicationserver
diff --git a/package/tntnet/ipkg/tntnet.postinst b/package/tntnet/ipkg/tntnet.postinst
new file mode 100644
index 000000000..9d462f8d3
--- /dev/null
+++ b/package/tntnet/ipkg/tntnet.postinst
@@ -0,0 +1,6 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf tntnet
+gid=$(get_next_gid)
+add_group tntnet $gid
+add_user tntnet $(get_next_uid) $gid /www
diff --git a/package/tor/Config.in b/package/tor/Config.in
new file mode 100644
index 000000000..5664da239
--- /dev/null
+++ b/package/tor/Config.in
@@ -0,0 +1,18 @@
+config ADK_PACKAGE_TOR
+ prompt "tor............................... An anonymous Internet communication system"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBEVENT
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_LIBPTHREAD
+ select ADK_PACKAGE_ZLIB
+ help
+ Tor is a toolset for a wide range of organizations and people that want
+ to improve their safety and security on the Internet. Using Tor can
+ help you anonymize web browsing and publishing, instant messaging,
+ IRC, SSH, and more. Tor also provides a platform on which software
+ developers can build new applications with built-in anonymity, safety,
+ and privacy features.
+
+ http://tor.eff.org/
+
diff --git a/package/tor/Makefile b/package/tor/Makefile
new file mode 100644
index 000000000..ad47ccfd1
--- /dev/null
+++ b/package/tor/Makefile
@@ -0,0 +1,41 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= tor
+PKG_VERSION:= 0.1.1.26
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 0667df7a1f670bee5163b607aea172ba
+
+MASTER_SITES:= http://tor.eff.org/dist/ \
+ http://ftp.se.linux.org/crypto/tor/ \
+ http://tor.meulie.net/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TOR,tor,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_libevent_normal=yes \
+ ac_cv_libevent_linker_option="" \
+ ac_cv_libevent_dir="${STAGING_DIR}/usr" \
+ ac_cv_openssldir="${STAGING_DIR}/usr" \
+ ac_cv_openssl_linker_option="" \
+ tor_cv_time_t_signed=yes \
+ tor_cv_null_is_zero=yes \
+ tor_cv_unaligned_ok=yes
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_TOR}/etc/init.d
+ ${INSTALL_BIN} ./files/tor.init ${IDIR_TOR}/etc/init.d/tor
+ ${INSTALL_DIR} ${IDIR_TOR}/etc/tor
+ ${INSTALL_DATA} ./files/torrc ${IDIR_TOR}/etc/tor/
+ ${INSTALL_DIR} ${IDIR_TOR}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/tor ${IDIR_TOR}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tor/files/tor.init b/package/tor/files/tor.init
new file mode 100644
index 000000000..e8804bb64
--- /dev/null
+++ b/package/tor/files/tor.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${tor:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/log/tor ] || mkdir -p /var/log/tor
+ tor
+ ;;
+stop)
+ killall tor
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/tor/files/torrc b/package/tor/files/torrc
new file mode 100644
index 000000000..e5cf75b6e
--- /dev/null
+++ b/package/tor/files/torrc
@@ -0,0 +1,136 @@
+## Configuration file for a typical tor user
+## Built for Tor version 0.1.0.8-rc
+## (May or may not work for older or newer versions of Tor.)
+#
+# On Unix, Tor will look for this file in someplace like "~/.tor/torrc" or
+# "/etc/torrc"
+#
+# On Windows, Tor will look for the configuration file in someplace like
+# "Application Data\tor\torrc" or "Application Data\<username>\tor\torrc"
+#
+# With the default Mac OS X installer, Tor will look in ~/.tor/torrc or
+# /Library/Tor/torrc
+
+
+## Replace this with "SocksPort 0" if you plan to run Tor only as a
+## server, and not make any local application connections yourself.
+SocksPort 9050 # what port to open for local application connections
+SocksBindAddress 127.0.0.1 # accept connections only from localhost
+#SocksBindAddress 192.168.0.1:9100 # listen on a chosen IP/port too
+
+## Entry policies to allow/deny SOCKS requests based on IP address.
+## First entry that matches wins. If no SocksPolicy is set, we accept
+## all (and only) requests from SocksBindAddress.
+#SocksPolicy accept 192.168.0.1/16
+#SocksPolicy reject *
+
+## Allow no-name routers (ones that the dirserver operators don't
+## know anything about) in only these positions in your circuits.
+## Other choices (not advised) are entry,exit,introduction.
+AllowUnverifiedNodes middle,rendezvous
+
+## Logs go to stdout at level "notice" unless redirected by something
+## else, like one of the below lines. You can have as many log lines as
+## you want.
+##
+## Send all messages of level 'notice' or higher to /var/log/tor/notices.log
+#Log notice file /var/log/tor/notices.log
+## Send only debug and info messages to /var/log/tor/debug.log
+#Log debug-info file /var/log/tor/debug.log
+## Send ONLY debug messages to /var/log/tor/debug.log
+#Log debug-debug file /var/log/tor/debug.log
+## To use the system log instead of Tor's logfiles, uncomment these lines:
+#Log notice syslog
+## To send all messages to stderr:
+#Log debug stderr
+
+## Uncomment this to start the process in the background... or use
+## --runasdaemon 1 on the command line.
+RunAsDaemon 1
+
+## Tor only trusts directories signed with one of these keys, and
+## uses the given addresses to connect to the trusted directory
+## servers. If no DirServer lines are specified, Tor uses the built-in
+## defaults (moria1, moria2, tor26), so you can leave this alone unless
+## you need to change it.
+#DirServer 18.244.0.188:9031 FFCB 46DB 1339 DA84 674C 70D7 CB58 6434 C437 0441
+#DirServer 18.244.0.114:80 719B E45D E224 B607 C537 07D0 E214 3E2D 423E 74CF
+#DirServer 62.116.124.106:9030 847B 1F85 0344 D787 6491 A548 92F9 0493 4E4E B85D
+
+## The directory for keeping all the keys/etc. By default, we store
+## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
+#DataDirectory /var/lib/tor
+
+## The port on which Tor will listen for local connections from Tor controller
+## applications, as documented in control-spec.txt. NB: this feature is
+## currently experimental.
+#ControlPort 9051
+
+############### This section is just for location-hidden services ###
+
+## Look in .../hidden_service/hostname for the address to tell people.
+## HiddenServicePort x y:z says to redirect a port x request from the
+## client to y:z.
+
+#HiddenServiceDir /var/lib/tor/hidden_service/
+#HiddenServicePort 80 127.0.0.1:80
+
+#HiddenServiceDir /var/lib/tor/other_hidden_service/
+#HiddenServicePort 80 127.0.0.1:80
+#HiddenServicePort 22 127.0.0.1:22
+#HiddenServiceNodes moria1,moria2
+#HiddenServiceExcludeNodes bad,otherbad
+
+################ This section is just for servers #####################
+
+## NOTE: If you enable these, you should consider mailing your identity
+## key fingerprint to the tor-ops, so we can add you to the list of
+## servers that clients will trust. See
+## http://tor.eff.org/doc/tor-doc.html#server for details.
+
+## Required: A unique handle for this server
+#Nickname ididnteditheconfig
+
+## The IP or fqdn for this server. Leave blank and Tor will guess.
+#Address noname.example.com
+
+## Contact info that will be published in the directory, so we can
+## contact you if you need to upgrade or if something goes wrong.
+## This is optional but recommended.
+#ContactInfo Random Person <nobody AT example dot com>
+## You might also include your PGP or GPG fingerprint if you have one:
+#ContactInfo 1234D/FFFFFFFF Random Person <nobody AT example dot com>
+
+## Required: what port to advertise for tor connections
+#ORPort 9001
+## If you want to listen on a port other than the one advertised
+## in ORPort (e.g. to advertise 443 but bind to 9090), uncomment
+## the line below. You'll need to do ipchains or other port forwarding
+## yourself to make this work.
+#ORBindAddress 0.0.0.0:9090
+
+## Uncomment this to mirror the directory for others (please do)
+#DirPort 9030 # what port to advertise for directory connections
+## If you want to listen on a port other than the one advertised
+## in DirPort (e.g. to advertise 80 but bind 9091), uncomment the line
+## below. You'll need to do ipchains or other port forwarding yourself
+## to make this work.
+#DirBindAddress 0.0.0.0:9091
+
+## A comma-separated list of exit policies. They're considered first
+## to last, and the first match wins. If you want to *replace*
+## the default exit policy, end this with either a reject *:* or an
+## accept *:*. Otherwise, you're *augmenting* (prepending to) the
+## default exit policy. Leave commented to just use the default, which is
+## available in the man page or at http://tor.eff.org/documentation.html
+##
+## Look at http://wiki.noreply.org/noreply/TheOnionRouter/TorFAQ#Abuse
+## for issues you might encounter if you use the default exit policy.
+##
+#ExitPolicy accept *:6660-6667,reject *:* # allow irc ports but no more
+#ExitPolicy accept *:119 # accept nntp as well as default exit policy
+#ExitPolicy reject *:* # middleman only -- no exits allowed
+
+User tor
+Group tor
+PidFile /var/run/tor.pid
diff --git a/package/tor/ipkg/tor.conffiles b/package/tor/ipkg/tor.conffiles
new file mode 100644
index 000000000..2954287e6
--- /dev/null
+++ b/package/tor/ipkg/tor.conffiles
@@ -0,0 +1 @@
+/etc/tor/torrc
diff --git a/package/tor/ipkg/tor.control b/package/tor/ipkg/tor.control
new file mode 100644
index 000000000..bd1f79cbe
--- /dev/null
+++ b/package/tor/ipkg/tor.control
@@ -0,0 +1,5 @@
+Package: tor
+Priority: optional
+Section: net
+Description: An anonymous Internet communication system
+Depends: libevent, libopenssl, libpthread, zlib
diff --git a/package/tor/ipkg/tor.postinst b/package/tor/ipkg/tor.postinst
new file mode 100644
index 000000000..9ca10117b
--- /dev/null
+++ b/package/tor/ipkg/tor.postinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf tor tor NO
+
+# do not change below
+# check if we are on real system
+if [[ -z $IPKG_INSTROOT ]]; then
+ # create copies of passwd and group, if we use squashfs
+ rootfs=`mount |awk '/root/ { print $5 }'`
+ if [ "$rootfs" = "squashfs" ]; then
+ if [ -h /etc/group ]; then
+ rm /etc/group
+ cp /rom/etc/group /etc/group
+ fi
+ if [ -h /etc/passwd ]; then
+ rm /etc/passwd
+ cp /rom/etc/passwd /etc/passwd
+ fi
+ fi
+fi
+
+gid=$(get_next_gid)
+add_group tor $gid
+add_user tor $(get_next_uid) $gid /tmp/.tor
diff --git a/package/tor/patches/patch-configure b/package/tor/patches/patch-configure
new file mode 100644
index 000000000..b87f3dde8
--- /dev/null
+++ b/package/tor/patches/patch-configure
@@ -0,0 +1,12 @@
+$Id$
+--- tor-0.1.1.26.orig/configure 2006-12-15 01:12:11.000000000 +0100
++++ tor-0.1.1.26/configure 2007-02-17 21:46:29.000000000 +0100
+@@ -15193,7 +15193,7 @@ _ACEOF
+ # Set CFLAGS _after_ all the above checks, since our warnings are stricter
+ # than autoconf's macros like.
+ if test $ac_cv_c_compiler_gnu = yes; then
+- CFLAGS="$CFLAGS -Wall -g -O2"
++ CFLAGS="$CFLAGS -Wall"
+ else
+ CFLAGS="$CFLAGS -g -O"
+ fi
diff --git a/package/tor/patches/patch-src_common_util_h b/package/tor/patches/patch-src_common_util_h
new file mode 100644
index 000000000..4052d16f1
--- /dev/null
+++ b/package/tor/patches/patch-src_common_util_h
@@ -0,0 +1,12 @@
+$Id$
+--- tor-0.1.1.26.orig/src/common/util.h 2006-09-24 19:47:57.000000000 +0200
++++ tor-0.1.1.26/src/common/util.h 2007-02-17 23:09:46.000000000 +0100
+@@ -36,7 +36,7 @@
+ * And I'm not just saying that because some of our asserts check
+ * security-critical properties.
+ */
+-#error "Sorry; we don't support building with NDEBUG."
++#define tor_assert(expr) ((void)(0))
+ #else
+ #define tor_assert(expr) do { \
+ if (!(expr)) { \
diff --git a/package/trafshow/Config.in b/package/trafshow/Config.in
new file mode 100644
index 000000000..dc0cee659
--- /dev/null
+++ b/package/trafshow/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_TRAFSHOW
+ prompt "trafshow.......................... network traffic monitor"
+ tristate
+ select ADK_PACKAGE_LIBPCAP
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBPTHREAD
+ default n
+ help
+
diff --git a/package/trafshow/Makefile b/package/trafshow/Makefile
new file mode 100644
index 000000000..0921883f4
--- /dev/null
+++ b/package/trafshow/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= trafshow
+PKG_VERSION:= 4.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0b2f0bb23b7832138b7d841437b9e182
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+MASTER_SITES:= ftp://ftp.nsk.su/pub/RinetSoftware/
+WRKDIST= ${WRKDIR}/trafshow-5.2.3
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TRAFSHOW,trafshow,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+TCFLAGS+= -DHAVE_SOCKADDR_STORAGE -DHAVE_HAS_COLORS -I$(STAGING_DIR)/usr/include
+TLDFLAGS+= -pthread
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+ALL_TARGET=
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_TRAFSHOW}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/trafshow ${IDIR_TRAFSHOW}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/trafshow/ipkg/trafshow.control b/package/trafshow/ipkg/trafshow.control
new file mode 100644
index 000000000..83c51c304
--- /dev/null
+++ b/package/trafshow/ipkg/trafshow.control
@@ -0,0 +1,5 @@
+Package: trafshow
+Priority: optional
+Section: net
+Depends: libpcap, libncurses, libpthread
+Description: network traffic monitor
diff --git a/package/trafshow/patches/patch-domain_resolver_c b/package/trafshow/patches/patch-domain_resolver_c
new file mode 100644
index 000000000..dfa619116
--- /dev/null
+++ b/package/trafshow/patches/patch-domain_resolver_c
@@ -0,0 +1,680 @@
+$Id$
+--- trafshow-5.2.3.orig/domain_resolver.c 2006-01-08 06:59:23.000000000 +0100
++++ trafshow-5.2.3/domain_resolver.c 2007-02-04 19:40:27.000000000 +0100
+@@ -28,6 +28,676 @@
+ #include <resolv.h>
+ #endif
+
++/*
++ * Copyright (c) 1985, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++/*
++ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies, and that
++ * the name of Digital Equipment Corporation not be used in advertising or
++ * publicity pertaining to distribution of the document or software without
++ * specific, written prior permission.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
++ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
++ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ * Copyright (c) 1996,1999 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ *
++ * DNS helper functions not implemented in uclibc
++ *
++ */
++
++#include <ctype.h>
++#include <unistd.h>
++
++static const char digits[] = "0123456789";
++
++/* Forward. */
++
++static int special(int);
++static int printable(int);
++static int dn_find(const u_char *, const u_char *,
++ const u_char * const *,
++ const u_char * const *);
++
++
++/*
++ * ns_name_ntop(src, dst, dstsiz)
++ * Convert an encoded domain name to printable ascii as per RFC1035.
++ * return:
++ * Number of bytes written to buffer, or -1 (with errno set)
++ * notes:
++ * The root is returned as "."
++ * All other domains are returned in non absolute form
++ */
++int
++ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
++ const u_char *cp;
++ char *dn, *eom;
++ u_char c;
++ u_int n;
++
++ cp = src;
++ dn = dst;
++ eom = dst + dstsiz;
++
++ while ((n = *cp++) != 0) {
++ if ((n & NS_CMPRSFLGS) != 0) {
++ /* Some kind of compression pointer. */
++ return (-1);
++ }
++ if (dn != dst) {
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = '.';
++ }
++ if (dn + n >= eom) {
++ return (-1);
++ }
++ for ((void)NULL; n > 0; n--) {
++ c = *cp++;
++ if (special(c)) {
++ if (dn + 1 >= eom) {
++ return (-1);
++ }
++ *dn++ = '\\';
++ *dn++ = (char)c;
++ } else if (!printable(c)) {
++ if (dn + 3 >= eom) {
++ return (-1);
++ }
++ *dn++ = '\\';
++ *dn++ = digits[c / 100];
++ *dn++ = digits[(c % 100) / 10];
++ *dn++ = digits[c % 10];
++ } else {
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = (char)c;
++ }
++ }
++ }
++ if (dn == dst) {
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = '.';
++ }
++ if (dn >= eom) {
++ return (-1);
++ }
++ *dn++ = '\0';
++ return (dn - dst);
++}
++
++/*
++ * ns_name_pton(src, dst, dstsiz)
++ * Convert a ascii string into an encoded domain name as per RFC1035.
++ * return:
++ * -1 if it fails
++ * 1 if string was fully qualified
++ * 0 is string was not fully qualified
++ * notes:
++ * Enforces label and domain length limits.
++ */
++
++int
++ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
++ u_char *label, *bp, *eom;
++ int c, n, escaped;
++ char *cp;
++
++ escaped = 0;
++ bp = dst;
++ eom = dst + dstsiz;
++ label = bp++;
++
++ while ((c = *src++) != 0) {
++ if (escaped) {
++ if ((cp = strchr(digits, c)) != NULL) {
++ n = (cp - digits) * 100;
++ if ((c = *src++) == 0 ||
++ (cp = strchr(digits, c)) == NULL) {
++ return (-1);
++ }
++ n += (cp - digits) * 10;
++ if ((c = *src++) == 0 ||
++ (cp = strchr(digits, c)) == NULL) {
++ return (-1);
++ }
++ n += (cp - digits);
++ if (n > 255) {
++ return (-1);
++ }
++ c = n;
++ }
++ escaped = 0;
++ } else if (c == '\\') {
++ escaped = 1;
++ continue;
++ } else if (c == '.') {
++ c = (bp - label - 1);
++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
++ return (-1);
++ }
++ if (label >= eom) {
++ return (-1);
++ }
++ *label = c;
++ /* Fully qualified ? */
++ if (*src == '\0') {
++ if (c != 0) {
++ if (bp >= eom) {
++ return (-1);
++ }
++ *bp++ = '\0';
++ }
++ if ((bp - dst) > MAXCDNAME) {
++ return (-1);
++ }
++ return (1);
++ }
++ if (c == 0 || *src == '.') {
++ return (-1);
++ }
++ label = bp++;
++ continue;
++ }
++ if (bp >= eom) {
++ return (-1);
++ }
++ *bp++ = (u_char)c;
++ }
++ c = (bp - label - 1);
++ if ((c & NS_CMPRSFLGS) != 0) { /* Label too big. */
++ return (-1);
++ }
++ if (label >= eom) {
++ return (-1);
++ }
++ *label = c;
++ if (c != 0) {
++ if (bp >= eom) {
++ return (-1);
++ }
++ *bp++ = 0;
++ }
++ if ((bp - dst) > MAXCDNAME) { /* src too big */
++ return (-1);
++ }
++ return (0);
++}
++
++/*
++ * ns_name_ntol(src, dst, dstsiz)
++ * Convert a network strings labels into all lowercase.
++ * return:
++ * Number of bytes written to buffer, or -1 (with errno set)
++ * notes:
++ * Enforces label and domain length limits.
++ */
++
++int
++ns_name_ntol(const u_char *src, u_char *dst, size_t dstsiz) {
++ const u_char *cp;
++ u_char *dn, *eom;
++ u_char c;
++ u_int n;
++
++ cp = src;
++ dn = dst;
++ eom = dst + dstsiz;
++
++ while ((n = *cp++) != 0) {
++ if ((n & NS_CMPRSFLGS) != 0) {
++ /* Some kind of compression pointer. */
++ return (-1);
++ }
++ *dn++ = n;
++ if (dn + n >= eom) {
++ return (-1);
++ }
++ for ((void)NULL; n > 0; n--) {
++ c = *cp++;
++ if (isupper(c))
++ *dn++ = tolower(c);
++ else
++ *dn++ = c;
++ }
++ }
++ *dn++ = '\0';
++ return (dn - dst);
++}
++
++/*
++ * ns_name_unpack(msg, eom, src, dst, dstsiz)
++ * Unpack a domain name from a message, source may be compressed.
++ * return:
++ * -1 if it fails, or consumed octets if it succeeds.
++ */
++int
++ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
++ u_char *dst, size_t dstsiz)
++{
++ const u_char *srcp, *dstlim;
++ u_char *dstp;
++ int n, len, checked;
++
++ len = -1;
++ checked = 0;
++ dstp = dst;
++ srcp = src;
++ dstlim = dst + dstsiz;
++ if (srcp < msg || srcp >= eom) {
++ return (-1);
++ }
++ /* Fetch next label in domain name. */
++ while ((n = *srcp++) != 0) {
++ /* Check for indirection. */
++ switch (n & NS_CMPRSFLGS) {
++ case 0:
++ /* Limit checks. */
++ if (dstp + n + 1 >= dstlim || srcp + n >= eom) {
++ return (-1);
++ }
++ checked += n + 1;
++ *dstp++ = n;
++ memcpy(dstp, srcp, n);
++ dstp += n;
++ srcp += n;
++ break;
++
++ case NS_CMPRSFLGS:
++ if (srcp >= eom) {
++ return (-1);
++ }
++ if (len < 0)
++ len = srcp - src + 1;
++ srcp = msg + (((n & 0x3f) << 8) | (*srcp & 0xff));
++ if (srcp < msg || srcp >= eom) { /* Out of range. */
++ return (-1);
++ }
++ checked += 2;
++ /*
++ * Check for loops in the compressed name;
++ * if we've looked at the whole message,
++ * there must be a loop.
++ */
++ if (checked >= eom - msg) {
++ return (-1);
++ }
++ break;
++
++ default:
++ return (-1); /* flag error */
++ }
++ }
++ *dstp = '\0';
++ if (len < 0)
++ len = srcp - src;
++ return (len);
++}
++
++/*
++ * ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
++ * Pack domain name 'domain' into 'comp_dn'.
++ * return:
++ * Size of the compressed name, or -1.
++ * notes:
++ * 'dnptrs' is an array of pointers to previous compressed names.
++ * dnptrs[0] is a pointer to the beginning of the message. The array
++ * ends with NULL.
++ * 'lastdnptr' is a pointer to the end of the array pointed to
++ * by 'dnptrs'.
++ * Side effects:
++ * The list of pointers in dnptrs is updated for labels inserted into
++ * the message as we compress the name. If 'dnptr' is NULL, we don't
++ * try to compress names. If 'lastdnptr' is NULL, we don't update the
++ * list.
++ */
++int
++ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
++ const u_char **dnptrs, const u_char **lastdnptr)
++{
++ u_char *dstp;
++ const u_char **cpp, **lpp, *eob, *msg;
++ const u_char *srcp;
++ int n, l, first = 1;
++
++ srcp = src;
++ dstp = dst;
++ eob = dstp + dstsiz;
++ lpp = cpp = NULL;
++ if (dnptrs != NULL) {
++ if ((msg = *dnptrs++) != NULL) {
++ for (cpp = dnptrs; *cpp != NULL; cpp++)
++ (void)NULL;
++ lpp = cpp; /* end of list to search */
++ }
++ } else
++ msg = NULL;
++
++ /* make sure the domain we are about to add is legal */
++ l = 0;
++ do {
++ n = *srcp;
++ if ((n & NS_CMPRSFLGS) != 0) {
++ return (-1);
++ }
++ l += n + 1;
++ if (l > MAXCDNAME) {
++ return (-1);
++ }
++ srcp += n + 1;
++ } while (n != 0);
++
++ /* from here on we need to reset compression pointer array on error */
++ srcp = src;
++ do {
++ /* Look to see if we can use pointers. */
++ n = *srcp;
++ if (n != 0 && msg != NULL) {
++ l = dn_find(srcp, msg, (const u_char * const *)dnptrs,
++ (const u_char * const *)lpp);
++ if (l >= 0) {
++ if (dstp + 1 >= eob) {
++ goto cleanup;
++ }
++ *dstp++ = (l >> 8) | NS_CMPRSFLGS;
++ *dstp++ = l % 256;
++ return (dstp - dst);
++ }
++ /* Not found, save it. */
++ if (lastdnptr != NULL && cpp < lastdnptr - 1 &&
++ (dstp - msg) < 0x4000 && first) {
++ *cpp++ = dstp;
++ *cpp = NULL;
++ first = 0;
++ }
++ }
++ /* copy label to buffer */
++ if (n & NS_CMPRSFLGS) { /* Should not happen. */
++ goto cleanup;
++ }
++ if (dstp + 1 + n >= eob) {
++ goto cleanup;
++ }
++ memcpy(dstp, srcp, n + 1);
++ srcp += n + 1;
++ dstp += n + 1;
++ } while (n != 0);
++
++ if (dstp > eob) {
++cleanup:
++ if (msg != NULL)
++ *lpp = NULL;
++ return (-1);
++ }
++ return (dstp - dst);
++}
++
++/*
++ * ns_name_uncompress(msg, eom, src, dst, dstsiz)
++ * Expand compressed domain name to presentation format.
++ * return:
++ * Number of bytes read out of `src', or -1 (with errno set).
++ * note:
++ * Root domain returns as "." not "".
++ */
++int
++ns_name_uncompress(const u_char *msg, const u_char *eom, const u_char *src,
++ char *dst, size_t dstsiz)
++{
++ u_char tmp[NS_MAXCDNAME];
++ int n;
++
++ if ((n = ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
++ return (-1);
++ if (ns_name_ntop(tmp, dst, dstsiz) == -1)
++ return (-1);
++ return (n);
++}
++
++/*
++ * ns_name_compress(src, dst, dstsiz, dnptrs, lastdnptr)
++ * Compress a domain name into wire format, using compression pointers.
++ * return:
++ * Number of bytes consumed in `dst' or -1 (with errno set).
++ * notes:
++ * 'dnptrs' is an array of pointers to previous compressed names.
++ * dnptrs[0] is a pointer to the beginning of the message.
++ * The list ends with NULL. 'lastdnptr' is a pointer to the end of the
++ * array pointed to by 'dnptrs'. Side effect is to update the list of
++ * pointers for labels inserted into the message as we compress the name.
++ * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr'
++ * is NULL, we don't update the list.
++ */
++int
++ns_name_compress(const char *src, u_char *dst, size_t dstsiz,
++ const u_char **dnptrs, const u_char **lastdnptr)
++{
++ u_char tmp[NS_MAXCDNAME];
++
++ if (ns_name_pton(src, tmp, sizeof tmp) == -1)
++ return (-1);
++ return (ns_name_pack(tmp, dst, dstsiz, dnptrs, lastdnptr));
++}
++
++/*
++ * special(ch)
++ * Thinking in noninternationalized USASCII (per the DNS spec),
++ * is this characted special ("in need of quoting") ?
++ * return:
++ * boolean.
++ */
++static int
++special(int ch) {
++ switch (ch) {
++ case 0x22: /* '"' */
++ case 0x2E: /* '.' */
++ case 0x3B: /* ';' */
++ case 0x5C: /* '\\' */
++ /* Special modifiers in zone files. */
++ case 0x40: /* '@' */
++ case 0x24: /* '$' */
++ return (1);
++ default:
++ return (0);
++ }
++}
++
++/*
++ * printable(ch)
++ * Thinking in noninternationalized USASCII (per the DNS spec),
++ * is this character visible and not a space when printed ?
++ * return:
++ * boolean.
++ */
++static int
++printable(int ch) {
++ return (ch > 0x20 && ch < 0x7f);
++}
++
++/*
++ * Thinking in noninternationalized USASCII (per the DNS spec),
++ * convert this character to lower case if it's upper case.
++ */
++static int
++mklower(int ch) {
++ if (ch >= 0x41 && ch <= 0x5A)
++ return (ch + 0x20);
++ return (ch);
++}
++
++/*
++ * dn_find(domain, msg, dnptrs, lastdnptr)
++ * Search for the counted-label name in an array of compressed names.
++ * return:
++ * offset from msg if found, or -1.
++ * notes:
++ * dnptrs is the pointer to the first name on the list,
++ * not the pointer to the start of the message.
++ */
++static int
++dn_find(const u_char *domain, const u_char *msg,
++ const u_char * const *dnptrs,
++ const u_char * const *lastdnptr)
++{
++ const u_char *dn, *cp, *sp;
++ const u_char * const *cpp;
++ u_int n;
++
++ for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
++ sp = *cpp;
++ /*
++ * terminate search on:
++ * root label
++ * compression pointer
++ * unusable offset
++ */
++ while (*sp != 0 && (*sp & NS_CMPRSFLGS) == 0 &&
++ (sp - msg) < 0x4000) {
++ dn = domain;
++ cp = sp;
++ while ((n = *cp++) != 0) {
++ /*
++ * check for indirection
++ */
++ switch (n & NS_CMPRSFLGS) {
++ case 0: /* normal case, n == len */
++ if (n != *dn++)
++ goto next;
++ for ((void)NULL; n > 0; n--)
++ if (mklower(*dn++) !=
++ mklower(*cp++))
++ goto next;
++ /* Is next root for both ? */
++ if (*dn == '\0' && *cp == '\0')
++ return (sp - msg);
++ if (*dn)
++ continue;
++ goto next;
++
++ case NS_CMPRSFLGS: /* indirection */
++ cp = msg + (((n & 0x3f) << 8) | *cp);
++ break;
++
++ default: /* illegal type */
++ return (-1);
++ }
++ }
++ next:
++ sp += *sp + 1;
++ }
++ }
++ return (-1);
++}
++
++/*
++ * Expand compressed domain name 'comp_dn' to full domain name.
++ * 'msg' is a pointer to the begining of the message,
++ * 'eomorig' points to the first location after the message,
++ * 'exp_dn' is a pointer to a buffer of size 'length' for the result.
++ * Return size of compressed name or -1 if there was an error.
++ */
++int
++dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
++ char *dst, int dstsiz)
++{
++ int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
++
++ if (n > 0 && dst[0] == '.')
++ dst[0] = '\0';
++ return (n);
++}
++
++/*
++ * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
++ * Return the size of the compressed name or -1.
++ * 'length' is the size of the array pointed to by 'comp_dn'.
++ */
++int
++dn_comp(const char *src, u_char *dst, int dstsiz,
++ u_char **dnptrs, u_char **lastdnptr)
++{
++ return (ns_name_compress(src, dst, (size_t)dstsiz,
++ (const u_char **)dnptrs,
++ (const u_char **)lastdnptr));
++}
++
++
+ #include "domain_resolver.h"
+ #include "session.h"
+ #include "util.h"
diff --git a/package/ttcp/Config.in b/package/ttcp/Config.in
new file mode 100644
index 000000000..cc99d9151
--- /dev/null
+++ b/package/ttcp/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_TTCP
+ prompt "ttcp.............................. A TCP connection performance tester"
+ tristate
+ default n
+ help
+ A small utility to test TCP connection performance
+
diff --git a/package/ttcp/Makefile b/package/ttcp/Makefile
new file mode 100644
index 000000000..75b355cd6
--- /dev/null
+++ b/package/ttcp/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ttcp
+PKG_VERSION:= 3.8
+PKG_RELEASE:= 1
+NO_DISTFILES:= 1
+
+WRKDIST= ${WRKDIR}/ttcp
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,TTCP,ttcp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${TCFLAGS} -o ${WRKBUILD}/ttcp ttcp.c
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_TTCP}/usr/bin
+ ${INSTALL_BIN} ${WRKBUILD}/ttcp ${IDIR_TTCP}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ttcp/ipkg/ttcp.control b/package/ttcp/ipkg/ttcp.control
new file mode 100644
index 000000000..ebcbbbdf4
--- /dev/null
+++ b/package/ttcp/ipkg/ttcp.control
@@ -0,0 +1,4 @@
+Package: ttcp
+Priority: optional
+Section: net
+Description: A small utility to test TCP connection performance
diff --git a/package/ttcp/ttcp.c b/package/ttcp/ttcp.c
new file mode 100644
index 000000000..3b1f07adf
--- /dev/null
+++ b/package/ttcp/ttcp.c
@@ -0,0 +1,2374 @@
+/*
+ * T T C P . C
+ *
+ * Test TCP connection. Makes a connection on port 5010
+ * and transfers fabricated buffers or data copied from stdin.
+ *
+ * Usable on 4.2, 4.3, and 4.1a systems by defining one of
+ * BSD42 BSD43 (BSD41a)
+ * Machines using System V with BSD sockets should define SYSV.
+ *
+ * Modified for operation under 4.2BSD, 18 Dec 84
+ * T.C. Slattery, USNA
+ * Minor improvements, Mike Muuss and Terry Slattery, 16-Oct-85.
+ * Modified in 1989 at Silicon Graphics, Inc.
+ * catch SIGPIPE to be able to print stats when receiver has died
+ * for tcp, don't look for sentinel during reads to allow small transfers
+ * increased default buffer size to 8K, nbuf to 2K to transfer 16MB
+ * moved default port to 5001, beyond IPPORT_USERRESERVED
+ * make sinkmode default because it is more popular,
+ * -s now means don't sink/source
+ * count number of read/write system calls to see effects of
+ * blocking from full socket buffers
+ * for tcp, -D option turns off buffered writes (sets TCP_NODELAY sockopt)
+ * buffer alignment options, -A and -O
+ * print stats in a format that's a bit easier to use with grep & awk
+ * for SYSV, mimic BSD routines to use most of the existing timing code
+ * Modified by Steve Miller of the University of Maryland, College Park
+ * -b sets the socket buffer size (SO_SNDBUF/SO_RCVBUF)
+ * Modified Sept. 1989 at Silicon Graphics, Inc.
+ * restored -s sense at request of tcs@brl
+ * Modified Oct. 1991 at Silicon Graphics, Inc.
+ * use getopt(3) for option processing, add -f and -T options.
+ * SGI IRIX 3.3 and 4.0 releases don't need #define SYSV.
+ *
+ * Modified --> Nov 1996 at CERN (Daniel DAVIDS)
+ * printout of the Socket-Buffer-Sizes
+ * configured for HP-UX 9000 OS
+ * configured for Windows NT OS
+ * Modified Dec 1996 at CERN (Jacques ROCHEZ)
+ * severe cleanup
+ * addaptation to the gcc compiler (ANSI)
+ * configured for Lynx OS
+ * automatic format for the rate display (G/M/K/)bytes/sec
+ * added log (L) and more help (h) options.
+ * Modified May 1997 at CERN (Jacques ROCHEZ)
+ * removed the mes() function following err() function.
+ * changed the default port to 5010
+ * Modified jul 1997 at CERN (Jacques ROCHEZ)
+ * adapted the timing calculation in microseconds
+ * addapted the code for Vsisual C++ under NT4.0
+ * Modified aug 1997 at CERN (Jacques ROCHEZ)
+ * initialise to 0 the variables nbytes, numcalls
+ * moved the buffer pre-load outside the measured timed area
+ * Distribution Status -
+ * Public Domain. Distribution Unlimited.
+ * Modified jun 1998 at Epigram
+ * - print hash marks to indicate prograss on transmitting side
+ * - sleep between bursts of buffers
+ * - set number of buffers/burst
+ * Modified jul 1998 at Epigram
+ * - send random size buffers
+ * Modified jan 1999 at Epigram (WES)
+ * - added start and end patterns to UDP start and end packets
+ * - added handling of missed start, end, or data packets for UDP tests
+ */
+#ifndef lint
+static char RCSid[] = "ttcp.c $- CERN Revision: 3.8 (dev level) -$";
+#endif
+
+static char VersDate[] = "Epigram 15-jul-98";
+
+/* system dependent setting
+ * ------------------------
+ * uname -a,gcc -v a.c are the tools used
+ *
+ * Platform/OS #define MACRO predefined
+ * ----------- ------- ---------------------------------------------------
+ * SunOS OS BSD43 __unix__ __sun__ __sparc__
+ * SUN Solaris SYSV __unix__ __sun__ __sparc__ __svr4__
+ * SGI-IRIX < 3.3 SYSV set as #define sgi
+ * HP-UX 9000 SYSV __unix__ __hpux__ __hp9k8__
+ * OSF/1 V3.2 SYSV __unix__ __osf__ __alpha__
+ * OSF/1 V4.0 SYSV __unix__ __osf__ __alpha__ _CFE
+ * LynxOS SYSV __unix__ __lynx__ __powerpc__
+ * Windows NT SYSV __WINNT__ __i386__ __M_COFF__
+ * AIX SYSV _AIX _AIX32 _POWER _IBMR2 _ARCH_PWR
+
+
+ * Micosoft Visual C++ compiler under WindowNT 4.0
+ * Windows NT _WINDOWS WIN32
+
+ * Unix BSD 41a BSD41a
+ * 42 BSD42
+ * 43 BSD43
+
+ * Machines using System V with BSD sockets should define SYSV.
+ *
+ * Compiler commands
+ * -----------------
+ * LynxOS : gcc -c ttcp.c -o ttcp.o | gcc -o ttcp -O ttcp.o -lnetinet -lc_p -lc
+ */
+
+/* -------------attempt to set an automatic UNIX OS family detection -------*/
+
+#if defined(__hp9k8__) || defined(__osf__) || defined(__srv4__)
+#define SYSV
+#endif
+#if defined(__lynx__)
+#define SYSV
+#endif
+/* for solaris (__srv4__) the parameters SYSV is already set */
+
+/* version A.09.01 'key words' differs from A.09.05 A */
+#if defined(__hpux)
+#define __hpux__
+#endif
+
+#if defined(__sun__)&&!defined(__srv4__)
+#define BSD43 /* changed by BSD42 if necessary */
+#endif
+
+#if defined(_WIN32) /* Window NT 4.0 compiled with VisualC++ 4 */
+#define __NTVIS__
+#define SYSV
+#endif
+
+#if defined(__FreeBSD__)
+#define BSD43
+#endif
+
+#if defined(__linux__)
+#define BSD43
+#endif
+/*--------------------------------------------------------------------------*/
+
+#if !defined(UNDER_CE)
+#include <signal.h>
+#include <ctype.h>
+#include <errno.h>
+#include <sys/types.h>
+#endif
+
+#if defined(SYSV)
+
+#if defined(__osf__)
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/time.h> /* struct timeval */
+#include <sys/resource.h> /* definition of struct rusage */
+
+#else /* else of __osf__ */
+#if defined(__NTVIS__)
+#include <winsock2.h>
+#include <windows.h> /* required for all Windows applications */
+#include <ws2tcpip.h>
+#include <memory.h>
+#include <time.h>
+#if !defined(UNDER_CE)
+#include <sys\timeb.h>
+#include <fcntl.h>
+#endif
+#include <stdlib.h>
+#include <io.h>
+struct rusage { struct timeval ru_utime, ru_stime; };
+#define RUSAGE_SELF 0
+#else /* else of __NTVIS__ */
+#if defined(__lynx__)
+#include <socket.h> /* located in /usr/include/..... */
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <time.h>
+#include <resource.h> /* definition of struct rusage */
+#include <sys/times.h>
+#define RUSAGE_SELF 0
+#include <conf.h> /* definition of TICKSPERSEC (HZ) */
+#include <sys/param.h>
+
+#else /* else of __Lynx__ */
+#if defined(__svr4__)
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/time.h> /* struct timeval */
+#include <sys/resource.h> /* definition of struct rusage */
+#include <sys/times.h>
+#define RUSAGE_SELF 0
+#include <sys/param.h>
+
+#else /* else of __svr4__ all SYSV cases except those mentionned before */
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/time.h> /* struct timeval */
+#include <sys/resource.h> /* definition of struct rusage */
+#include <sys/times.h>
+#define RUSAGE_SELF 0
+#include <sys/param.h>
+
+#endif /* __svr4__ */
+#endif /* __lynx__ */
+#endif /* __NTVIS__ */
+#endif /* __osf__ */
+
+#else /* else of SYSV it is a BSD OS */
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#if defined(__linux__)
+#include <time.h> /* struct timeval */
+#else
+#include <sys/time.h> /* struct timeval */
+#endif
+#include <sys/resource.h> /* definition of struct rusage */
+#include <unistd.h> /* for usleep() - henry */
+#define SOCKET_ERROR -1
+
+#endif /* SYSV */
+
+#if defined(__NTVIS__)
+
+#if defined(_DEBUG) /* usual debug symbol for VC++ */
+#define DEBUG 1
+#endif
+
+void usleep(unsigned int microseconds);
+
+#define bcopy(a,b,n) memcpy((b), (a), (n))
+#define bzero(a,n) memset((a), 0, (n))
+
+#ifndef _GETOPT_
+#define _GETOPT_
+int getopt(int argc, char **argv, char *optstring);
+
+extern char *optarg; // returned arg to go with this option
+extern int optind; // index to next argv element to process
+extern int opterr; // should error messages be printed?
+extern int optopt; //
+
+#define BADCH ('?')
+#endif // _GETOPT
+
+/* get option letter from argument vector */
+int
+ opterr = 1, // should error messages be printed?
+ optind = 1, // index into parent argv vector
+ optopt; // character checked for validity
+char *optarg; // argument associated with option
+
+#define EMSG ""
+char *progname; // may also be defined elsewhere
+#endif /*__NTVIS__*/
+
+/* sockaddr_in == file server address structure
+ *
+ * Socket address, internet style. declared in : /netinet/in.h
+ * struct sockaddr_in {short sin_family;
+ * u_short sin_port;
+ * struct in_addr sin_addr;
+ * char sin_zero[8];
+ * };
+ *
+ * Structure used by kernel to store most addresses. declared in ./sys/socket.h
+ * struct sockaddr{u_short sa_family; address family
+ * char sa_data[14]; up to 14 bytes of direct address
+ * };
+ * PS : sin stand for "socket internet number"
+ */
+
+#ifndef __NTVIS__
+#define FAR
+#endif
+
+#if defined(__CONST_SOCKADDR_ARG)
+#define SOCKADDR_CAST (__CONST_SOCKADDR_ARG)
+#elif defined(__lynx__) || defined(__sun__) || defined(_AIX) || defined(__FreeBSD__) || defined(__NTVIS__)
+#define SOCKADDR_CAST (struct sockaddr FAR *)
+#else
+#define SOCKADDR_CAST
+#endif
+
+#if defined(__sun__)
+struct sockaddr_in sockaddr; /* done in ./X11/Xdmcp.h */
+#endif
+
+struct sockaddr_in sinme; /* is the socket struct. in the local host */
+struct sockaddr_in sinhim; /* is the socket struc. in the remote host */
+
+#if defined(__lynx__) || defined(__svr4__) || defined(_AIX)
+struct sockaddr frominet;
+#else
+struct sockaddr_in frominet;
+#endif /* __lynx__ */
+
+int domain, fromlen;
+
+#if !defined(__NTVIS__)
+#define SOCKET int
+#endif /* __NTVIS__ */
+SOCKET fd; /* fd of network socket */
+
+#if !defined(__lynx__)
+extern int errno;
+#endif
+
+#include <stdio.h>
+
+FILE *fplog = NULL; /* file pointer for the log file */
+char logfile[100]; /* file name for the log */
+static char logfile_head[] ="ttcp_log"; /* header name for the log */
+int buflen = 8 * 1024; /* length of buffer */
+char *buf; /* ptr to dynamic buffer */
+int nbuf = 2 * 1024; /* number of buffers to send in sinkmode */
+
+#define START_PKT_LEN 4
+#define START_PATTERN_LEN 4
+#define END_PKT_LEN 8
+#define END_PATTERN_LEN 4
+#define MIN_UDP_LEN 5
+
+char start_pattern[START_PATTERN_LEN] = {1, 2, 3, 4};
+char end_pattern[END_PATTERN_LEN] = {2, 2, 2, 2};
+
+int bufoffset = 0; /* align buffer to this */
+int bufalign = 16*1024; /* modulo this */
+
+int udp = 0; /* 0 = tcp, !0 = udp */
+int options = 0; /* socket options */
+int one = 1; /* for 4.3 BSD style setsockopt() */
+short port = 5010; /* TCP port number */
+char *host; /* ptr to name of host */
+int rndm = 0; /* 0="normal", !0=random data */
+int trans; /* 0=receive, !0=transmit mode */
+int timeout; /* read timeout in millisec */
+int debug = 0; /* 0=No-Debug, 1=Debug-Set-On */
+int sinkmode = 0; /* 0=normal I/O, !0=sink/source mode */
+int verbose = 0; /* 0=print basic info, 1=print cpu rate,
+ * proc resource usage. */
+int nodelay = 0; /* set TCP_NODELAY socket option */
+int pri = 0; /* link layer priority */
+int b_flag = 0; /* use mread() */
+int log_cnt = 0; /* append result to a log */
+int sockbufsize = 0; /* socket buffer size to use */
+char fmt = 'A'; /* output format:
+ * b = bits, B = bytes,
+ * k = kilobits, K = kilobytes,
+ * m = megabits, M = megabytes,
+ * g = gigabits, G = gigabytes,
+ * A = automatic Xbytes (default) */
+int touchdata = 0; /* access data after reading */
+int seq_info = 0; /* report out of order seq nums */
+
+int hash = 0; /* print hash marks for each buffer */
+int udpsleep = 0; /* sleep in between udp buffers */
+int burstn = 1; /* number of buffers per burst */
+int bufmin = -1; /* minimum buffer size to use when
+ sending random-size buffers */
+unsigned int seed = 1; /* seed for random number generator
+ used for random buffer lengths */
+int no_start = 0; /* skip the start frames for UDP */
+int no_data = 0; /* skip all data frames for UDP */
+int no_end = 0; /* skip the end frames for UDP */
+
+double nbytes; /* bytes on net */
+unsigned long numCalls; /* # of I/O system calls */
+
+struct hostent *addr;
+extern int optind;
+extern char *optarg;
+
+#if defined(UNDER_CE)
+static int errno;
+static char *weekday[] ={"Sun", "Mon","Tues", "Wed", "Thurs", "Fri", "Sat"};
+static char *month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sep", "Oct", "Nov", "Dec"};
+#define perror printf
+#endif
+
+/*--------------------------------------------------------------------------*/
+static struct timeval time0; /* Time at which timing started */
+static struct timeval time1;
+static struct rusage ru0; /* Resource utilization at the start */
+static struct rusage ru1;
+static struct tm *tms; /* system time structure */
+
+
+/*-----------Prototype functions definitions -------------------------------*/
+/*--------------------------------------------------------------------------*/
+
+ /* ANSI input/output functions (stdio.h) */
+
+#if defined(__lynx__)
+int getopt(int, char**, char*);
+int gettimeofday(struct timeval *tp, struct timezone *tzp);
+
+#else
+#if defined(__svr4__)
+
+#else
+#if defined(_AIX)
+
+#else
+#if defined(__hpux__)
+#else
+#if defined(__NTVIS__)
+#else
+#if defined(BSD42) || defined(BSD43)
+#else
+
+int printf( char*, ...);
+int fprintf(FILE*,char*, ...);
+void perror(char*);
+int getopt(int, char**, char*);
+int gettimeofday(struct timeval *tp, struct timezone *tzp);
+#endif /* BSD42 || BSD43 */
+#endif /* __NTVIS__ */
+#endif /* __hpux__ */
+#endif /* _AIX */
+#endif /* __svr4__ */
+#endif /* __lynx__ */
+
+int main(int argc, char* argv[]);
+#if ( (!(defined(BSD42))) && (!(defined(BSD43))) && (!(defined(__NTVIS__))) )
+int read(int, char*, int);
+int write(int, char*, int);
+int close(int);
+#endif /* !(BSD42) && !(BSD43) */
+int fclose(FILE *stream);
+
+#if !defined(BSD43) && !defined(__NTVIS__)
+void bzero(char*,int);
+void bcopy(char*, char*, int);
+char strncpy(char *s1,char *s2,size_t n);
+int atoi(char*);
+int malloc(int);
+#endif
+
+
+ /* ANSI socket functions prototype /sys/socket.h */
+#if defined(__lynx__)
+int select(int, fd_set*, fd_set*, fd_set*, struct timeval*);
+
+#else
+#if defined(__svr4__) && !defined(sparc)
+
+/* informations in : /usr/include/sys/socket.h */
+int socket(int, int, int);
+int connect(int, struct sockaddr *, int);
+int bind(int, struct sockaddr *, int);
+int listen(int, int);
+int accept(int, struct sockaddr *, int *);
+int sendto(int, const char *, int, int, const struct sockaddr *, int);
+int recvfrom(int, char *, int, int, struct sockaddr *, int *);
+int getpeername(int, struct sockaddr *, int *);
+int getsockopt(int, int, int, char *, int *);
+int select(int, fd_set*, fd_set*, fd_set*, struct timeval*);
+
+#else
+#if defined(_AIX)
+int select(unsigned long, void *, void *, void *, struct timeval *);
+
+#else
+#if defined(__hpux__)
+int getrusage(int who,struct rusage *rusage);
+
+#else
+#if defined(__NTVIS__)
+
+#else
+#if defined(BSD42) || defined(BSD43)
+
+#else
+
+int socket(int, int, int);
+int connect(int s,struct sockaddr_in *name, int namelen);
+int bind(int s,struct sockaddr *name,int namelen);
+int listen(int, int);
+int accept(int, struct sockaddr_in *, int *);
+int sendto(int, char *, int, int, struct sockaddr_in *, int);
+int recvfrom(int, char *, int, int, struct sockaddr_in *, int *);
+int getpeername(int, struct sockaddr *, int *);
+int setsockopt(int, int, int, char *, int);
+
+int getsockopt(int, int, int, char*, int*);
+int select(int, fd_set*, fd_set*, fd_set*, struct timeval*);
+
+#endif /* BSD42 || BSD43 */
+#endif /* __hpux__ */
+#endif /* _AIX */
+#endif /* __svr4__ */
+#endif /* __lynx__ */
+#endif /* __NTVIS__ */
+
+/* ttcp prototype functions */
+void udp_rcv_test(void);
+double calc_cpu_time(struct rusage *r0, struct rusage *r1);
+double calc_real_time(struct timeval *t0, struct timeval *t1);
+int getrusage(int who,struct rusage *rusage);
+void sockets_err(char*);
+void err(char *);
+void mes(char *);
+void pattern(char *, int);
+int Nread(SOCKET, void *, int);
+int Nwrite(int, void *, int);
+void delay(int);
+int mread(int, char *,unsigned);
+char *outfmt(char format, double b);
+void prep_timer(void);
+void read_timer(void);
+void result_summary(void);
+void prusage(struct rusage*, struct rusage*,
+ struct timeval*, struct timeval*);
+void tvadd(struct timeval *tsum, struct timeval *t0,struct timeval *t1);
+void tvsub(struct timeval *tdiff, struct timeval *t1, struct timeval *t0);
+void psecs(int);
+void open_log(void);
+void close_log(void);
+void do_Usage(void);
+void do_help(void);
+
+/*--------------------------------------------------------------------------*/
+#if !defined(__NTVIS__)
+void
+sigpipe()
+{;
+}
+#endif
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+int
+main(int argc, char **argv)
+{
+ unsigned long addr_tmp;
+ int c,k;
+ int sockbufsndsize,sockbufrcvsize;
+ int sockbuflen;
+ struct sockaddr_in peer;
+ int peerlen = sizeof(peer);
+
+#if defined(__NTVIS__)
+ extern char *optarg;
+ WSADATA WSAData;
+ WSAStartup(MAKEWORD(1,1), &WSAData);
+#endif /* __NTVIS__ */
+
+ if (argc < 2) { do_Usage(); exit(1); }
+
+ while (1) {
+ while ((c=getopt(argc, argv, "hidrstuvxHVBDTLb:f:l:n:p:A:O:S:N:P:R:I:w:")) != -1) {
+ switch (c) {
+ case 'w':
+ timeout = atoi(optarg);
+ break;
+ case 'I':
+ seed = atoi(optarg);
+ break;
+ case 'N':
+ burstn = atoi(optarg);
+ break;
+ case 'P':
+#if defined(__linux__)
+ pri = atoi(optarg);
+ break;
+#else
+ fprintf(stderr, "ttcp: -P option not supported on this OS\n");
+ exit(1);
+#endif
+ case 'R':
+ bufmin = atoi(optarg);
+ break;
+ case 'S':
+ udpsleep = atoi(optarg);
+ if (udpsleep < 0) udpsleep = 0;
+ /* convert msec arg to usec for usleep, minimum 10ms */
+ udpsleep = udpsleep * 1000;
+ break;
+ case 'H':
+ hash = 1;
+ break;
+ case 'V':
+ fprintf(stdout,"%s %s\n" , RCSid , VersDate );
+ exit(0);
+ case 'B':
+ b_flag = 1;
+ break;
+ case 'L':
+ log_cnt = 1;
+ break;
+ case 'h':
+ do_help();
+ exit(1);
+ break;
+ case 't':
+ trans = 1;
+ break;
+ case 'r':
+ trans = 0;
+ break;
+ case 'x':
+ rndm = 1;
+ break;
+ case 'd':
+ options |= SO_DEBUG;
+ break;
+ case 'D':
+#ifdef TCP_NODELAY
+ nodelay = 1;
+#else
+ fprintf(stderr,
+ "ttcp: -D option ignored: TCP_NODELAY socket option not supported\n");
+#endif
+ break;
+ case 'n':
+ nbuf = atoi(optarg);
+ break;
+ case 'l':
+ buflen = atoi(optarg);
+ break;
+ case 's':
+ sinkmode = !sinkmode;
+ break;
+ case 'p':
+ port = atoi(optarg);
+ break;
+ case 'u':
+ udp = 1;
+ break;
+ case 'v':
+ verbose = 1;
+ break;
+ case 'A':
+ bufalign = atoi(optarg);
+ break;
+ case 'O':
+ bufoffset = atoi(optarg);
+ break;
+ case 'b':
+#if defined(SO_SNDBUF) || defined(SO_RCVBUF)
+ sockbufsize = atoi(optarg);
+#else
+ fprintf(stderr,
+"ttcp: -b option ignored: SO_SNDBUF/SO_RCVBUF socket options not supported\n");
+#endif
+ break;
+ case 'f':
+ fmt = *optarg;
+ break;
+ case 'T':
+ touchdata = 1;
+ break;
+ case 'i':
+ seq_info = 1;
+ break;
+
+ default:
+ {do_Usage(); exit(1);}
+ }/*switch */
+ }/* while getopt() */
+
+ argc -= optind;
+ argv += optind;
+ optind = 0;
+
+ /* check for '--' args */
+ if (argc == 0) {
+ /* no more args */
+ break; /* while (1) */
+#if defined(DEBUG)
+ } else if (!strcmp(argv[0], "--nostart")) {
+ no_start = 1;
+ argc--; argv++;
+ } else if (!strcmp(argv[0], "--nodata")) {
+ no_data = 1;
+ argc--; argv++;
+ } else if (!strcmp(argv[0], "--noend")) {
+ no_end = 1;
+ argc--; argv++;
+ } else if (!strcmp(argv[0], "--debug")) {
+ debug = 1;
+ argc--; argv++;
+#endif /* DEBUG */
+ } else if (!strncmp(argv[0], "--", 2)) {
+ fprintf(stderr, "ttcp: illegal option: %s\n", argv[0]);
+ do_Usage(); exit(1);
+ } else {
+ /* the arg was not a '--' arg */
+ break; /* while (1) */
+ }
+ } /* while (1) */
+
+
+ /* ----------------------- main part ----------------------- */
+
+#if defined(__NTVIS__) && !defined(UNDER_CE)
+ /* Set "stdin" to have binary mode: */
+ if (_setmode(_fileno(stdin), _O_BINARY) == -1)
+ perror("%s: Error setting stdin to binary mode");
+ /* Set "stdout" to have binary mode: */
+ if (_setmode(_fileno(stdout), _O_BINARY) == -1)
+ perror("%s: Error setting stdout to binary mode");
+#endif /* __NTVIS__ */
+
+if (log_cnt) open_log();
+
+/* input error checking */
+if (burstn > nbuf) {
+ fprintf(stderr, "ttcp: buffers per burst must be less than or equal to "
+ "total number of buffers\n");
+ exit(1);
+}
+if (bufmin < -1) {
+ fprintf(stderr, "ttcp: minimum buffer size specified with -R option must "
+ "be non-negative\n");
+ exit(1);
+}
+if (buflen > 65535) {
+ fprintf(stderr, "ttcp: maximum buffer size specified with -l option must "
+ "be <= 65536\n");
+ exit(1);
+}
+if (bufmin > buflen) {
+ fprintf(stderr, "ttcp: minimum buffer size specified with -R option must "
+ "be less than or equal to (maximum) buffer size specified with -l\n");
+ exit(1);
+}
+
+/* buffer allocation */
+
+ if (udp && buflen < MIN_UDP_LEN)
+ buflen = MIN_UDP_LEN; /* send more than the sentinel size */
+
+ if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL)
+ err("malloc");
+ if (bufalign != 0)
+ buf +=(bufalign - ((int)buf % bufalign) + bufoffset) % bufalign;
+
+ fprintf(stderr,"ttcp%s: buflen=%d, nbuf=%d, align=%d/%d, port=%d\n",
+ trans?"-t":"-r",buflen, nbuf, bufalign, bufoffset, port);
+ if (log_cnt)fprintf(fplog," %6d %6d %6d %6d %4d",
+ buflen, nbuf, bufalign, bufoffset, port);
+
+ /* preload the buffer for the transmit condition */
+ pattern( buf, buflen );
+
+ /* seed the random number generator */
+ if ((bufmin != -1) || (rndm != 0)) {
+#if defined(__NTVIS__)
+ srand(seed);
+#else /* ! __NTVIS__ */
+ srandom(seed);
+#endif /* __NTVIS__ */
+ }
+
+ if(trans)
+ {/* xmitr */
+ if (argc == 0) {
+ fprintf(stderr, "ttcp: missing destination host arg\n");
+ do_Usage(); exit(1);
+ }
+
+ memset((char *)&sinhim, 0, sizeof(sinhim));
+ host = argv[0];
+ if (atoi(host) > 0 )
+ {/* Numeric */
+ sinhim.sin_family = AF_INET;
+ sinhim.sin_addr.s_addr = inet_addr(host);
+ }
+ else
+ {if ((addr=gethostbyname(host)) == NULL) sockets_err("bad hostname");
+ sinhim.sin_family = addr->h_addrtype;
+ memcpy((char*)&addr_tmp, addr->h_addr, addr->h_length);
+ sinhim.sin_addr.s_addr = addr_tmp;
+ }
+ sinhim.sin_port = htons(port);
+ sinme.sin_port = 0; /* free choice */
+ }
+ else
+ {/* rcvr */
+ sinme.sin_port = htons(port);
+ }
+#if defined(__NTVIS__)
+ sinme.sin_family = AF_INET;
+#endif
+
+ fd = socket(AF_INET, udp?SOCK_DGRAM:SOCK_STREAM, 0);
+
+#if defined(__NTVIS__)
+ if (fd == INVALID_SOCKET) sockets_err("socket");
+#else
+ if (fd < 0) sockets_err("socket");
+#endif
+
+ if (verbose) {
+ char *label = trans?"ttcp-t":"ttcp-r";
+#if defined(UNDER_CE)
+ SYSTEMTIME SystemTime;
+ char time_str[30];
+
+ GetLocalTime(&SystemTime);
+ sprintf(time_str, "%s %s %d %02d:%02d:%02d %d\n", weekday[SystemTime.wDayOfWeek], month[SystemTime.wMonth - 1],
+ SystemTime.wDay, SystemTime.wHour, SystemTime.wMinute, SystemTime.wSecond, SystemTime.wYear);
+#else
+ time_t now;
+ char *time_str;
+
+ time(&now);
+ time_str = ctime(&now);
+#endif
+ fprintf(stdout,"%s: start time %s", label, time_str);
+ fprintf(stdout,"%s: File-Descriptor 0x%x Opened\n", label, fd );
+ }
+
+#if defined(__NTVIS__)
+ if (bind(fd, (struct sockaddr FAR *)&sinme, sizeof(sinme)) == SOCKET_ERROR)
+ sockets_err("bind");
+#else
+ if (bind(fd, SOCKADDR_CAST &sinme, sizeof(sinme)) < 0)
+ sockets_err("bind");
+#endif /* __NTVIS__ */
+
+
+#if defined(SO_SNDBUF) || defined(SO_RCVBUF)
+ if (sockbufsize)
+ {
+#if defined(__lynx__) || defined(__sun__) || defined(__NTVIS__)
+ if (trans)
+ {if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&sockbufsize,
+ sizeof sockbufsize) < 0)
+ sockets_err("setsockopt: sndbuf");
+ }
+ else
+ {if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&sockbufsize,
+ sizeof sockbufsize) < 0)
+ sockets_err("setsockopt: rcvbuf");
+ }
+
+#else
+ if (trans)
+
+ {if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sockbufsize,
+ sizeof sockbufsize) < 0)
+ sockets_err("setsockopt: sndbuf");
+ }
+ else
+ {if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &sockbufsize,
+ sizeof sockbufsize) < 0)
+ sockets_err("setsockopt: rcvbuf");
+ }
+#endif /* __lynx__ __sun__ __NTVIS__ */
+ }
+ else
+ {/*
+ ** Added by Daniel Davids to Know Socket-Buffer-Sizes
+ */
+ sockbuflen = sizeof sockbufsndsize;
+#if defined(__lynx__) || defined(__sun__) || defined(__NTVIS__)
+ getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&sockbufsndsize,
+ &sockbuflen);
+ sockbuflen = sizeof sockbufrcvsize;
+ getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&sockbufrcvsize,
+ &sockbuflen);
+#else
+ getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sockbufsndsize, &sockbuflen);
+ sockbuflen = sizeof sockbufrcvsize;
+ getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &sockbufrcvsize, &sockbuflen);
+#endif /* __lynx__ __sun__ __NTVIS__ */
+ sockbufsize = ( sockbufsndsize + sockbufrcvsize ) / 2;
+
+ if ( sockbufsndsize != sockbufrcvsize )
+ {fprintf(stderr, "sockbufsndsize=%d, ", sockbufsndsize );
+ fprintf(stderr, "sockbufrcvsize=%d, ", sockbufrcvsize );
+ }
+ }
+#endif /* defined(SO_SNDBUF) || defined(SO_RCVBUF) */
+
+ if (sockbufsize) fprintf(stderr, "sockbufsize=%d, \n", sockbufsize);
+
+ if (log_cnt)
+ {if (sockbufsize)fprintf(fplog," %6d",sockbufsize);
+ else fprintf(fplog," 0");
+ }
+
+#if defined(__linux__)
+ if (setsockopt(fd, SOL_SOCKET, SO_PRIORITY, (char *)&pri, sizeof pri) < 0)
+ sockets_err("setsockopt: priority");
+#endif
+
+
+ if (trans) fprintf(stderr, "# %s sender -> %s #\n", udp?"udp":"tcp", host);
+ else fprintf(stderr, "# %s receiver #\n", udp?"udp":"tcp");
+
+ if (!udp)
+ {
+#if !defined(__NTVIS__)
+ signal(SIGPIPE, sigpipe);
+#endif /* !__NTVIS__ */
+
+ if (trans)
+ {/* We are the client if transmitting */
+ if (options)
+ {
+#if defined(BSD42)
+ if( setsockopt(fd, SOL_SOCKET, options, 0, 0) < 0)
+#else /* BSD43 */
+ if( setsockopt(fd, SOL_SOCKET, options, (char *)&one, sizeof(one)) < 0)
+#endif /* BDS42 */
+ sockets_err("setsockopt");
+ }
+#ifdef TCP_NODELAY
+ if (nodelay)
+ {struct protoent *p;
+ p = getprotobyname("tcp");
+#if defined(__lynx__) || defined(__sun__) || defined(__NTVIS__)
+ if( p && setsockopt(fd, p->p_proto, TCP_NODELAY,
+ (char *) &one, sizeof(one)) < 0)
+#else
+ if( p && setsockopt(fd, p->p_proto, TCP_NODELAY,
+ &one, sizeof(one)) < 0)
+#endif /* __lynx__ __sun__ __NTVIS__ */
+ sockets_err("setsockopt: nodelay");
+ }
+#endif /* TCP_NODELAY */
+ if (connect(fd, SOCKADDR_CAST &sinhim, sizeof(sinhim) ) < 0)
+ sockets_err("connect");
+ }/* if (trans) */
+ else
+ {/* otherwise, we are the server and should listen for connections */
+
+errno = 0;
+
+#if defined(sgi) || ( defined(__osf__) && !defined(_CFE) )
+ if( listen(fd,1) <0 )
+#else
+ if( listen(fd,0) <0 ) /* allow a queue of 0 */
+#endif
+ sockets_err("listen");
+
+ if(options) {
+ int err;
+#if defined(BSD42)
+ err = setsockopt(fd, SOL_SOCKET, options, 0, 0);
+#elif defined(__lynx__) || defined(__sun__) || defined(__NTVIS__)
+ err = setsockopt(fd, SOL_SOCKET, options, (char *) &one, sizeof(one));
+#else
+ err = setsockopt(fd, SOL_SOCKET, options, &one, sizeof(one));
+#endif /* BSD42 */
+ if (err < 0)
+ sockets_err("setsockopt");
+ }
+ fromlen = sizeof(frominet);
+ domain = AF_INET;
+ if (timeout > 0) {
+ fd_set readfds, exceptfds;
+ struct timeval tv_timeout;
+ int n;
+
+ tv_timeout.tv_sec = timeout/1000;
+ tv_timeout.tv_usec = (timeout%1000)*1000;
+
+ FD_ZERO(&readfds);
+ FD_ZERO(&exceptfds);
+ FD_SET(fd, &readfds);
+ FD_SET(fd, &exceptfds);
+
+ n = select( fd+1, &readfds, NULL, &exceptfds, &tv_timeout );
+ if (n == 0 || n == SOCKET_ERROR) {
+ sockets_err("select listen");
+ return 0;
+ }
+ }
+ if((fd=accept(fd, SOCKADDR_CAST &frominet, &fromlen) ) < 0)
+ sockets_err("accept");
+
+ if (getpeername(fd, SOCKADDR_CAST &peer, &peerlen) < 0)
+ sockets_err("getpeername");
+
+ fprintf(stderr,"ttcp-r: accept from %s\n",inet_ntoa(peer.sin_addr));
+
+ } /* otherwise we are ... */
+ }
+
+ prep_timer();
+ errno = 0;
+ nbytes = 0.0;
+ numCalls = 0;
+
+ {
+ register int cnt,multi;
+ char *pb;
+ int nb = 0;
+ unsigned long rbuflen = 0;
+ multi = nbuf;
+
+ if (trans) {
+#if !defined(BSD43)
+ if(udp) {
+ int err;
+ int nochecksum_opt = 0;
+ err = setsockopt(fd, IPPROTO_UDP, UDP_NOCHECKSUM,
+ (char *)&nochecksum_opt, sizeof(nochecksum_opt));
+ if (err < 0)
+ sockets_err("setsockopt");
+ }
+#endif
+
+ if(udp && !no_start) {
+ int start_count = 2;
+ char start_pkt[START_PKT_LEN];
+ memset(start_pkt, 0, START_PKT_LEN);
+ memcpy(start_pkt, start_pattern, START_PATTERN_LEN);
+
+ while (start_count-- > 0) {
+ (void)Nwrite( fd, start_pkt, START_PKT_LEN ); /* rcvr start */
+ if (udpsleep) {
+ usleep(udpsleep);
+ /* clear errno (see man page for errno(3), definition of
+ EINTR. usleep() uses SIGCONT? ) */
+ if (errno == EINTR) errno = 0;
+ } /* udpsleep */
+ }
+ }
+
+ /* initial seqence num for UDP */
+ if (udp) buf[0] = 0;
+ k = burstn;
+
+ if (sinkmode) {
+ while (multi-- > 0 && !no_data) {
+
+ if (bufmin == -1) {
+ rbuflen = buflen;
+ } else {
+ /* set rbuflen to a random value evenly distributed in
+ [bufmin, buflen]. As long as buflen is < 2^16, we can
+ fit the calculation in 32 bits */
+#if defined(__NTVIS__)
+ rbuflen = (( (unsigned long)rand() *
+ ((unsigned long)(buflen-bufmin+1)) ) >> 15) + bufmin;
+#else /* ! __NTVIS__ */
+ rbuflen = (( ((unsigned long)random() >> 15) *
+ ((unsigned long)(buflen-bufmin+1)) ) >> 16) + bufmin;
+#endif /* __NTVIS__ */
+ }
+
+ if (rndm) {
+ unsigned int i, j, l;
+ unsigned long data;
+
+ if (udp)
+ l = 1;
+ else
+ l = 0;
+
+ for (i = l; i < rbuflen; /* null */) {
+#if defined(__NTVIS__)
+ data = (unsigned long)rand();
+#else /* ! __NTVIS__ */
+ data = (unsigned long)random();
+#endif /* __NTVIS__ */
+ /*fprintf(stderr, "%08x\n",data);*/ /* DEBUG */
+ /* The NT rand() function returns only 16 useful bits! */
+ for (j = 0; (j < 2/*4*/) && (i < rbuflen) ; j++) {
+ buf[i++] = (unsigned char)(data & 0xff);
+ data >>= 8;
+ }
+ }
+ }
+
+ if ((cnt=Nwrite(fd,buf,rbuflen)) != (int)rbuflen)
+ sockets_err("error from the socket write");
+ /* increment sequence num if UDP */
+ if (udp) buf[0] = (char)(((unsigned char)(buf[0])+1) & 0xFF);
+
+ if (debug)
+ fprintf(stdout,"ttcp-t: %5d | %d Bytes Written in %d write commands \n",
+ ++nb, cnt, nbuf );
+
+ nbytes += rbuflen;
+
+ /* hashes */
+ if (hash) {
+ fprintf(stderr,"#");
+ }
+
+ /* Check for the end of a burst */
+ if (--k <= 0) {
+ k = burstn;
+
+ /* sleep to avoid overrunning slower receivers - henry */
+ if (udpsleep) {
+ usleep(udpsleep);
+ /* clear errno (see man page for errno(3), definition of
+ EINTR. usleep() uses SIGCONT? ) */
+ if (errno == EINTR) errno = 0;
+ } /* udpsleep */
+ }
+ } /* while */
+
+ } /* if (sinkmode) */
+ else
+ {
+
+ nbuf = 0;
+
+ if (bufmin == -1) {
+ rbuflen = buflen;
+ } else {
+ /* set rbuflen to a random value evenly distributed in
+ [bufmin, buflen]. As long as buflen is < 2^16, we can
+ fit the calculation in 32 bits */
+#if defined(__NTVIS__)
+ rbuflen = (( (unsigned long)rand() *
+ ((unsigned long)(buflen-bufmin+1)) ) >> 15) + bufmin;
+#else /* ! __NTVIS__ */
+ rbuflen = (( ((unsigned long)random() >> 15) *
+ ((unsigned long)(buflen-bufmin+1)) ) >> 16) + bufmin;
+#endif /* __NTVIS__ */
+ }
+
+ if (udp)
+ pb = &(buf[1]);
+ else
+ pb = &(buf[0]);
+
+#if !defined(__NTVIS__) /* else case specific to WINNT */
+ while((cnt=read(0,pb,rbuflen)) > 0)
+#else /* __NTVIS__ */
+ while((cnt=(int)fread(pb,1,rbuflen,stdin)) > 0)
+#endif /* __NTVIS__ */
+ {
+
+ if (udp)
+ multi = cnt+1; /* don't include seq. num. in count of data */
+ else
+ multi = cnt;
+ if ((cnt=Nwrite(fd,buf,multi)) != (int)multi)
+ sockets_err("error from the socket write");
+ /* increment seqence num if UDP */
+ if (udp) buf[0] = (char)(((unsigned char)(buf[0])+1) & 0xFF);
+ nbuf++;
+
+ if (debug)
+ fprintf(stdout,"ttcp-t: %5d | %d Bytes Written in %d write commands \n",
+ ++nb, cnt, nbuf );
+
+ nbytes += multi;
+
+ /* hashes */
+ if (hash) {
+ fprintf(stderr,"#");
+ }
+
+ /* Check for the end of a burst */
+ if (--k <= 0) {
+ k = burstn;
+
+ /* sleep to avoid overrunning slower receivers - henry */
+ if (udpsleep) {
+ usleep(udpsleep);
+ /* clear errno (see man page for errno(3), definition of
+ EINTR. usleep() uses SIGCONT? ) */
+ if (errno == EINTR) errno = 0;
+ } /* udpsleep */
+ }
+
+ if (bufmin == -1) {
+ rbuflen = buflen;
+ } else {
+ /* set rbuflen to a random value evenly distributed in
+ [bufmin, buflen]. As long as buflen is < 2^16, we can
+ fit the calculation in 32 bits */
+#if defined(__NTVIS__)
+ rbuflen = (( (unsigned long)rand() *
+ ((unsigned long)(buflen-bufmin+1)) ) >> 15) + bufmin;
+#else /* ! __NTVIS__ */
+ rbuflen = (( ((unsigned long)random() >> 15) *
+ ((unsigned long)(buflen-bufmin+1)) ) >> 16) + bufmin;
+#endif /* __NTVIS__ */
+ }
+
+ } /* while */
+
+ } /* if (sinkmode) */
+
+ if (hash) {
+ fprintf(stderr,"\n");
+ fflush(stderr);
+ }
+
+#if defined(UNDER_CE)
+ errno = WSAGetLastError();
+#endif
+ if (!errno) {
+ read_timer();
+ if(udp && !no_end) {
+ int end_count = 4;
+ int data_count = nbuf;
+ char end_pkt[END_PKT_LEN];
+ unsigned char* net_byte = &end_pkt[END_PATTERN_LEN];
+ memset(end_pkt, 0, END_PKT_LEN);
+ memcpy(end_pkt, end_pattern, END_PATTERN_LEN);
+ net_byte[3] = data_count & 0xFF; data_count >>= 8;
+ net_byte[2] = data_count & 0xFF; data_count >>= 8;
+ net_byte[1] = data_count & 0xFF; data_count >>= 8;
+ net_byte[0] = data_count & 0xFF;
+
+ while (end_count-- > 0) {
+ Nwrite( fd, end_pkt, END_PKT_LEN ); /* rcvr end */
+ if (udpsleep && end_count>0) usleep(udpsleep);
+ }
+ }
+ result_summary();
+ }
+ } /* trans */
+ else
+ {
+ if (udp) {
+ udp_rcv_test();
+ }
+ else
+ {/* not udp received transfer */
+ while ((cnt=Nread(fd,buf,buflen)) > 0)
+ {if(debug)fprintf(stdout,
+ "ttcp%s: %5d | %d Bytes Read\n",
+ trans?"-t":"-r", ++nb, cnt );
+ nbytes += cnt;
+ if (!sinkmode) {
+#if !defined(__NTVIS__) /* else case specific to WINNT */
+ if (write(1,buf,cnt) != cnt) err("write");
+#else /* __NTVIS__ */
+ if ((int)fwrite(buf,1,cnt,stdout) != cnt) err("fwrite");
+#endif /* __NTVIS__ */
+ }
+ }
+#if defined(UNDER_CE)
+ errno = WSAGetLastError();
+#endif
+ if (!errno) {
+ read_timer();
+ result_summary();
+ }
+ }
+ }
+ }
+
+ if(errno) err("IO");
+
+#if defined(__NTVIS__)
+ closesocket ( fd );
+#else
+ close ( fd );
+#endif /* __NTVIS__ */
+
+ if (verbose) fprintf(stdout,"ttcp%s: File-Descriptor fd 0x%x Closed\n" ,
+ trans?"-t":"-r", fd );
+
+ if (log_cnt) close_log();
+
+ fprintf(stderr,"ttcp done.\n");
+ fflush(stdout);
+
+ exit(0);
+}
+/*--------------------------------------------------------------------------*/
+void
+udp_rcv_test(void)
+{
+ enum {START_WAIT, DATA_WAIT, DATA_RCV, END_TEST} rcv_state;
+ enum {START_PKT_TYPE, END_PKT_TYPE, DATA_PKT_TYPE} pkt_type;
+ int cnt;
+ int nbuffers = 0;
+ unsigned int start_pkt_cnt = 0;
+ unsigned int end_pkt_cnt = 0;
+ unsigned int data_pkt_cnt = 0;
+ unsigned int expected_pkt_cnt = 0;
+ unsigned char seq = 0;
+ unsigned char buf_seq;
+
+ rcv_state = START_WAIT;
+ while (rcv_state != END_TEST && (cnt=Nread(fd,buf,buflen)) > 0) {
+ /* Determine the type of packet received */
+ if (!memcmp(buf, start_pattern, START_PATTERN_LEN)) {
+ pkt_type = START_PKT_TYPE;
+ start_pkt_cnt++;
+ } else if (!memcmp(buf, end_pattern, END_PATTERN_LEN)) {
+ /* read the expected data packet count from the end packet */
+ unsigned char* net_byte = buf;
+ net_byte += END_PATTERN_LEN;
+ expected_pkt_cnt = ((net_byte[0] << 24) + (net_byte[1] << 16) +
+ (net_byte[2] << 8) + net_byte[3]);
+ pkt_type = END_PKT_TYPE;
+ end_pkt_cnt++;
+ } else {
+ data_pkt_cnt++;
+ pkt_type = DATA_PKT_TYPE;
+ }
+
+ if (rcv_state == START_WAIT) {
+ /* Wait until we see a vaild start packet */
+ if (pkt_type == START_PKT_TYPE) {
+ prep_timer();
+ rcv_state = DATA_WAIT;
+ } else if (pkt_type == DATA_PKT_TYPE) {
+ fprintf(stderr, "ERROR: Missed UDP start packet.\n");
+ prep_timer();
+ rcv_state = DATA_RCV;
+ } else if (pkt_type == END_PKT_TYPE) {
+ fprintf(stderr, "ERROR: Found UDP end packet before start packet or data.\n");
+ rcv_state = END_TEST;
+ }
+ } else if (rcv_state == DATA_WAIT) {
+ /* Skip any extra start packets until we see data */
+ if (pkt_type == START_PKT_TYPE) {
+ prep_timer();
+ } else if (pkt_type == DATA_PKT_TYPE) {
+ rcv_state = DATA_RCV;
+ } else if (pkt_type == END_PKT_TYPE) {
+ fprintf(stderr, "ERROR: Found UDP end packet without receiving "
+ "any data packets.\n");
+ rcv_state = END_TEST;
+ }
+ } else { /* DATA_RCV */
+ /* Collect data packets until we see a vaild end packet */
+ if (pkt_type == START_PKT_TYPE) {
+ /* We missed the end packets and now a new test is
+ * starting. Report the results of this test then start
+ * another. */
+ read_timer();
+ result_summary();
+ fprintf(stderr, "ERROR: Found UDP start packet while receiving data.\n"
+ "ERROR: Expected more data packets or an end packet.\n");
+ nbytes = 0.0;
+ nbuffers = 0;
+ numCalls = 0;
+ prep_timer();
+ rcv_state = DATA_WAIT;
+ } else if (pkt_type == DATA_PKT_TYPE) {
+ /* loop in this state */
+ } else if (pkt_type == END_PKT_TYPE) {
+ /* we used to print results here but now we do when the loop ends */
+ rcv_state = END_TEST;
+ }
+ }
+
+ /* tally data packets the same way from whatever state we are in */
+ if (pkt_type == DATA_PKT_TYPE) {
+ if (debug)
+ fprintf(stderr, "ttcp-r: %5d | %d Bytes Read\n", ++nbuffers, cnt);
+ nbytes += cnt;
+ if (seq_info) {
+ /* check seqence num */
+ buf_seq = (unsigned char)(buf[0]);
+ if (buf_seq != seq) {
+ fprintf(stderr, "ERROR: Out of sequence. "
+ "Buffer %u, seq %u, expected %u\n",
+ data_pkt_cnt, buf_seq, seq);
+ seq = buf_seq;
+ }
+ seq++;
+ }
+ if (!sinkmode) {
+#if !defined(__NTVIS__) /* else case specific to WINNT */
+ if (write(1,&(buf[1]),cnt-1) != cnt-1) err("write");
+#else /* __NTVIS__ */
+ if ((int)fwrite(&(buf[1]),1,cnt-1,stdout) != cnt-1) err("fwrite");
+#endif /* __NTVIS__ */
+ }
+ }
+ } /* end-while */
+
+ /* normal end of test */
+ read_timer();
+ result_summary();
+ fprintf(stderr, "ttcp-r: packets %u data, %u start, %u end\n",
+ data_pkt_cnt, start_pkt_cnt, end_pkt_cnt);
+ if (expected_pkt_cnt != 0) {
+ int lost_cnt = expected_pkt_cnt - data_pkt_cnt;
+
+ fprintf(stderr, "ttcp-r: %g%% (%u/%u) packet loss\n",
+ 100.0 * (double)lost_cnt/(double)expected_pkt_cnt,
+ lost_cnt, expected_pkt_cnt);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/* calc_cpu_time(): Time difference, in usecs, of the combined user and
+ * sys times of the given start and end usage info */
+double
+calc_cpu_time(
+ struct rusage *r0,
+ struct rusage *r1
+)
+{
+ double time;
+ time_t ms;
+ struct timeval tdiff, tend, tstart;
+
+ /* total user delta time + total system delta time */
+ tvadd( &tend, &r1->ru_utime, &r1->ru_stime ); /* user + sys time @ end */
+ tvadd( &tstart, &r0->ru_utime, &r0->ru_stime ); /* user + sys time @ start*/
+ tvsub( &tdiff, &tend, &tstart );
+
+ /* useconds */
+ time = ((double)tdiff.tv_sec)*1e6 + (double)tdiff.tv_usec;
+
+ /* debug mseconds */
+ ms = tdiff.tv_sec*(time_t)1000 + tdiff.tv_usec/(time_t)1000;
+ if (ms != (time_t)(time/1000.0)) {
+ fprintf(stderr, "ERROR: time calc mismatch of msec (%d) to usec (%f)\n",
+ (int)ms, time/1000.0);
+ }
+
+ return time;
+}
+
+/*--------------------------------------------------------------------------*/
+/* calc_real_time(): Time difference in usecs of the given times */
+double
+calc_real_time(
+ struct timeval *t0,
+ struct timeval *t1
+)
+{
+ double time;
+ time_t ms;
+ struct timeval tdiff;
+
+ tvsub(&tdiff, t1 ,t0);
+
+ /* useconds */
+ time = ((double)tdiff.tv_sec)*1e6 + (double)tdiff.tv_usec;
+
+ /* debug mseconds */
+ ms = tdiff.tv_sec*(time_t)1000 + tdiff.tv_usec/(time_t)1000;
+ if (ms != (time_t)(time/1000.0)) {
+ fprintf(stderr, "ERROR: time calc mismatch of msec (%d) to usec (%f)\n",
+ (int)ms, time/1000.0);
+ }
+
+ return time;
+}
+/*--------------------------------------------------------------------------*/
+void
+result_summary(void)
+{
+ char* label = trans ? "ttcp-t" : "ttcp-r";
+ double cput = calc_cpu_time(&ru0, &ru1);
+ double realt = calc_real_time(&time0, &time1);
+ double t_min;
+ double bytes_per_sec;
+
+ /* lower end boundary conditions */
+ t_min = 10.0; /* 10 usec */
+#if defined(__NTVIS__)
+ t_min = 1000.0; /* 1 msec */
+#endif
+ if (cput <= t_min) { /* value in usec */
+ cput = t_min;
+ fprintf(stderr,"%s: cpu time too short set at %.0f usec, NOT accurate result.\n",
+ label,t_min);
+ }
+ if (realt <= t_min) { /* value in usec */
+ realt = t_min;
+ fprintf(stderr,"%s: real time too short, set at %.0f usec, NOT accurate result.\n",
+ label,t_min);
+ }
+
+ bytes_per_sec = (nbytes/realt)*1e6;
+
+ fprintf(stderr,"%s: %.0f bytes in %.06f real seconds = %s/sec +++\n",
+ label, nbytes, realt/1e6, outfmt(fmt, bytes_per_sec));
+
+ if (verbose)
+ fprintf(stderr,"%s: %.0f bytes in %.06f cpu seconds = %s/cpu sec\n",
+ label, nbytes,cput/1e6, outfmt(fmt, (nbytes/cput)*1e6));
+
+ fprintf(stderr,"%s: %ld I/O calls, %.3f msec(real)/call, %.3f msec(cpu)/call\n",
+ label, numCalls,
+ (numCalls>0)?(realt/(double)numCalls)/1000.0:0.0,
+ (numCalls>0)?(cput /(double)numCalls)/1000.0:0.0);
+
+ fprintf(stderr,"%s: ", label);
+ prusage(&ru0, &ru1, &time0, &time1);
+ fprintf(stderr,"\n");
+
+ if (verbose)
+ printf("%s: buffer address %#x\n", label, (unsigned int)buf);
+
+ if (fplog) {
+ struct timeval tdiff;
+ /* User time */
+ tvsub(&tdiff, &ru1.ru_utime, &ru0.ru_utime);
+ fprintf(fplog," %ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec);
+ /* System time */
+ tvsub(&tdiff, &ru1.ru_stime, &ru0.ru_stime);
+ fprintf(fplog," %ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec);
+ /* Percent of cput usage */
+ fprintf(fplog," %.1f", 100.0 * (cput/realt));
+ /* validity of real time mesurment */
+ fprintf(fplog, (realt == t_min)?" 0":" 1");
+ /* bytes, seconds, MBytes/sec, IO calls */
+ fprintf(fplog," %10.0f %4.06f %4.3f %6ld",
+ nbytes, realt/1e6, bytes_per_sec/(1024.0*1024.0), numCalls);
+ }
+}
+/*--------------------------------------------------------------------------*/
+void
+sockets_err(char* s)
+{
+#if defined(__NTVIS__)
+ int err = WSAGetLastError();
+ char* prefix = trans?"ttcp-t":"ttcp-r";
+ fprintf(stderr,"%s: %s\n", prefix, s);
+ fprintf(stderr,"%s: errno=%d\n", prefix, err);
+ exit(1);
+#else
+ err(s);
+#endif /* __NTVIS__ */
+}
+
+/*--------------------------------------------------------------------------*/
+void
+err(char *s)
+{
+ char* prefix = trans?"ttcp-t":"ttcp-r";
+ fprintf(stderr,"%s: ", prefix);
+ perror(s);
+ fprintf(stderr,"%s: errno=%d\n", prefix, errno);
+ exit(1);
+}
+/*--------------------------------------------------------------------------*/
+void
+mes(char *s)
+{
+ fprintf(stderr,"ttcp%s: %s\n", trans?"-t":"-r", s);
+}
+/*--------------------------------------------------------------------------*/
+void
+pattern( char *cp, int cnt )
+{
+ register char c;
+ register int cnt1;
+ cnt1 = cnt;
+ c = 0;
+ while( cnt1-- > 0 ) {
+ while( !isprint((c&0x7F)) ) c++;
+ *cp++ = (c++&0x7F);
+ }
+}
+/*--------------------------------------------------------------------------*/
+char *
+outfmt(char format, double b)
+{
+ static char obuf[50];
+ double giga = 1024.0 * 1024.0 * 1024.0;
+ double mega = 1024.0 * 1024.0;
+ double kilo = 1024.0;
+
+ if (format == 'A') {
+ if (b >= giga)
+ format = 'G';
+ else if (b >= mega)
+ format = 'M';
+ else if (b >= kilo)
+ format = 'K';
+ else
+ format = 'B';
+ }
+
+ switch (format) {
+ case 'G':
+ sprintf(obuf, "%.3f GB", b / giga);
+ break;
+ case 'M':
+ sprintf(obuf, "%.3f MB", b / mega);
+ break;
+ case 'K':
+ sprintf(obuf, "%.3f KB", b / kilo);
+ break;
+ case 'B':
+ sprintf(obuf, "%4f B", b);
+ break;
+ case 'g':
+ sprintf(obuf, "%.3f Gbit", b * 8.0 / giga);
+ break;
+ case 'm':
+ sprintf(obuf, "%.3f Mbit", b * 8.0 / mega);
+ break;
+ case 'k':
+ sprintf(obuf, "%.3f Kbit", b * 8.0 / kilo);
+ break;
+ case 'b':
+ sprintf(obuf, "%4f b", b * 8.0);
+ break;
+ default:
+ sprintf(obuf, "default..........");
+ }
+ return obuf;
+}
+/*--------------------------------------------------------------------------*/
+#if defined(SYSV)
+
+/*ARGSUSED*/
+
+#if defined(__osf__)
+/* getrusage defined in the system lib */
+#else
+#if defined(__lynx__)
+/* getrusage defined in the system lib */
+#else
+#if defined(__sun__)
+/* getrusage defined in the system lib */
+#else
+
+int
+getrusage(ignored, ru)
+ int ignored;
+ register struct rusage *ru;
+{
+
+
+#if defined(__NTVIS__)
+ HANDLE phd;
+ FILETIME CreateTime, ExitTime, KernelTime, UserTime;
+ SYSTEMTIME SysTime;
+#if defined(UNDER_CE)
+ phd = GetCurrentThread();
+ if( GetThreadTimes(phd, &CreateTime, &ExitTime, &KernelTime, &UserTime)
+ != TRUE)
+#else
+ phd = GetCurrentProcess();
+ if( GetProcessTimes(phd, &CreateTime, &ExitTime, &KernelTime, &UserTime)
+ != TRUE)
+#endif
+ {ru->ru_stime.tv_sec = 0;
+ ru->ru_stime.tv_usec = 0;
+ ru->ru_utime.tv_sec = 0;
+ ru->ru_utime.tv_usec = 0;
+ }
+ else
+ {
+ (void) FileTimeToSystemTime(&KernelTime, &SysTime);
+ /*
+ * fprintf(stdout,
+ * "System sec=%d, msec=%d\n", SysTime.wSecond, SysTime.wMilliseconds);
+ */
+ ru->ru_stime.tv_sec = SysTime.wSecond;
+ ru->ru_stime.tv_usec = SysTime.wMilliseconds * 1000;
+ (void) FileTimeToSystemTime(&UserTime, &SysTime);
+ /*
+ * fprintf(stdout,
+ * " User sec=%d, msec=%d\n", SysTime.wSecond, SysTime.wMilliseconds);
+ */
+ ru->ru_utime.tv_sec = SysTime.wSecond;
+ ru->ru_utime.tv_usec = SysTime.wMilliseconds * 1000;
+ }
+
+#else /* __NTVIS__ */
+
+ struct tms buftime;
+ times(&buftime);
+ /* Assumption: HZ <= 2147 (LONG_MAX/1000000) */
+ /* info : in lynxOS HZ is called TICKSPERSEC (<conf.h>) */
+
+ ru->ru_stime.tv_sec = buftime.tms_stime / HZ;
+ ru->ru_stime.tv_usec = ((buftime.tms_stime % HZ) * 1000000) / HZ;
+ ru->ru_utime.tv_sec = buftime.tms_utime / HZ;
+ ru->ru_utime.tv_usec = ((buftime.tms_utime % HZ) * 1000000) / HZ;
+#endif /* __NTVIS__ */
+return(0);
+
+} /* static getrusage */
+
+#endif /* __sun__ */
+#endif /* __lynx__ */
+#endif /* __osf__ */
+#endif /* SYSV */
+/*--------------------------------------------------------------------------*/
+#if defined(SYSV)
+#if defined(__hpux__) || defined(_AIX) || defined(__sun__)
+/* gettimeofday defined in the system lib */
+#else
+# if defined (__osf__) ||defined (__lynx__)
+/* gettimeofday defined in the system lib */
+#else
+/*ARGSUSED*/
+static
+gettimeofday(tp, zp)
+struct timeval *tp;
+struct timezone *zp;
+{
+#if defined(__NTVIS__)
+#if defined(UNDER_CE)
+ SYSTEMTIME SystemTime;
+
+ GetLocalTime(&SystemTime);
+ tp->tv_sec = SystemTime.wSecond;
+ tp->tv_usec = SystemTime.wMilliseconds * 1000;
+#else
+ struct _timeb timeptr;
+
+ _ftime(&timeptr);
+ tp->tv_sec = timeptr.time;
+ tp->tv_usec = timeptr.millitm * 1000;
+#endif
+#else /* all cases */
+ tp->tv_sec = time(0);
+ tp->tv_usec = 0;
+#endif /* __NTVIS__ */
+return(1);
+} /* static gettimeofday */
+
+#endif /*__osf__ || __lynx__ */
+#endif /* __hpux__ || _AIX || __sun__ || __osf__*/
+#endif /* SYSV */
+/*--------------------------------------------------------------------------*/
+/*
+ * P R E P _ T I M E R
+ */
+void
+prep_timer(void)
+{
+ gettimeofday(&time0, (struct timezone *)0);
+ getrusage(RUSAGE_SELF, &ru0);
+}
+/*--------------------------------------------------------------------------*/
+/*
+ * R E A D _ T I M E R
+ *
+ */
+void
+read_timer(void)
+{
+ getrusage(RUSAGE_SELF, &ru1);
+ gettimeofday(&time1, (struct timezone *)0);
+}
+/*--------------------------------------------------------------------------*/
+/* Print the process usage calculated from timers values extracted
+ * before and after the transfer execution.
+ */
+void
+prusage(
+ struct rusage *r0, struct rusage *r1,
+ struct timeval *t0, struct timeval *t1
+)
+{
+ struct timeval tdiff;
+ int t, ms;
+ register char *cp;
+ double cput = calc_cpu_time(r0, r1);
+ double realt = calc_real_time(t0, t1);
+
+ /* t == total user delta time + total system delta time */
+ if (debug)
+ {
+ printf("timers : end startup\n");
+ printf("user (sec) : %9ld %9ld\n",r1->ru_utime.tv_sec,
+ r0->ru_utime.tv_sec);
+ printf("user (usec): %9ld %9ld\n",r1->ru_utime.tv_usec,
+ r0->ru_utime.tv_usec);
+ printf("sys (sec) : %9ld %9ld\n",r1->ru_stime.tv_sec,
+ r0->ru_stime.tv_sec);
+ printf("sys (usec): %9ld %9ld\n",r1->ru_stime.tv_usec,
+ r0->ru_stime.tv_usec);
+ printf("time (sec) : %9ld %9ld\n",t1->tv_sec,t0->tv_sec);
+ printf("time (usec): %9ld %9ld\n",t1->tv_usec,t0->tv_usec);
+ }
+ /* for the AIX debug, most counters are outside a good range
+ printf(" r0 r1\n");
+ printf("ru_ixrss %20ld %20ld \n", r0->ru_ixrss ,r1->ru_ixrss );
+ printf("ru_idrss %20ld %20ld \n", r0->ru_idrss ,r1->ru_idrss );
+ printf("ru_isrss %20ld %20ld \n", r0->ru_isrss ,r1->ru_isrss );
+ printf("ru_minflt %20ld %20ld \n", r0->ru_minflt ,r1->ru_minflt );
+ printf("ru_majflt %20ld %20ld \n", r0->ru_majflt ,r1->ru_majflt );
+ printf("ru_nswap %20ld %20ld \n", r0->ru_nswap ,r1->ru_nswap );
+ printf("ru_inblock %20ld %20ld \n", r0->ru_inblock ,r1->ru_inblock );
+ printf("ru_oublock %20ld %20ld \n", r0->ru_oublock ,r1->ru_oublock );
+ printf("ru_msgsnd %20ld %20ld \n", r0->ru_msgsnd ,r1->ru_msgsnd );
+ printf("ru_msgrcv %20ld %20ld \n", r0->ru_msgrcv ,r1->ru_msgrcv );
+ printf("ru_nsignals %20ld %20ld \n", r0->ru_nsignals ,r1->ru_nsignals);
+ printf("ru_nvcsw %20ld %20ld \n", r0->ru_nvcsw ,r1->ru_nvcsw );
+ printf("ru_nivcsw %20ld %20ld \n", r0->ru_nivcsw ,r1->ru_nivcsw );
+ */
+
+ /* cpu time in mseconds */
+ t = (int)(cput / 1000.0);
+
+ /* ms == value of the internal clock at the end of the xfer */
+ /* also called real time. */
+ /* real time in mseconds */
+ ms = (int)(realt / 1000.0);
+
+ /* The display is based on variables provided by the function getrusage
+ Info located in : /usr/include/sys/resource.h
+ */
+#if defined(SYSV)
+
+#if defined(_AIX)
+ /* with AIX cernsp most counters are wrong
+ * cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw\0";
+ */
+ cp = "%Uuser %Ssys %Ereal %P\0";
+
+#else
+#if defined(__osf__)
+ cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw\0";
+#else
+#if defined(sgi) /* IRIX 3.3 will show 0 for %M,%F,%R,%C */
+ cp = "%Uuser %Ssys %Ereal %P %Mmaxrss %F+%Rpf %Ccsw\0";
+#else
+#if defined(__Lynx__)
+ cp = "%Uuser %Ssys %Ereal %P\0";
+#else
+ cp = "%Uuser %Ssys %Ereal %P\0"; /* all SYSV except those mentionned */
+#endif /*__lynx__ */
+#endif /* sgi */
+#endif /*__osf__ */
+#endif /* _AIX */
+
+#else /* BSD system */
+ cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw\0";
+
+#endif /* SYSV */
+
+ for (; *cp; cp++) {
+ if (*cp != '%') {
+ putc(*cp, stderr);
+ /* *outp++ = *cp; */
+ } else if (cp[1])
+ switch(*++cp) {
+ case 'U':
+ tvsub(&tdiff, &r1->ru_utime, &r0->ru_utime);
+ fprintf(stderr,"%ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec);
+ break;
+
+ case 'S':
+ tvsub(&tdiff, &r1->ru_stime, &r0->ru_stime);
+ fprintf(stderr,"%ld.%06ld", (long)tdiff.tv_sec, (long)tdiff.tv_usec);
+ break;
+
+ case 'E':
+ psecs( ms / 1000);
+ break;
+
+ case 'P':
+ fprintf(stderr,"%.1f%%", (cput*100.0 / (realt ? realt : 1.0)) );
+ break;
+
+#if !defined(SYSV) || defined(__osf__) || defined(_AIX)
+ case 'W':
+ {
+ int i = r1->ru_nswap - r0->ru_nswap;
+ fprintf(stderr,"%d", i);
+ break;
+ }
+
+ case 'X':
+ fprintf(stderr,"%ld", t == 0 ? 0 : (r1->ru_ixrss-r0->ru_ixrss)/t);
+ break;
+
+ case 'D':
+ fprintf(stderr,"%ld", t == 0 ? 0 :
+ (r1->ru_idrss+r1->ru_isrss - (r0->ru_idrss+r0->ru_isrss))/t);
+ break;
+
+ case 'K':
+ fprintf(stderr,"%ld", t == 0 ? 0 :
+ ((r1->ru_ixrss+r1->ru_isrss+r1->ru_idrss) -
+ (r0->ru_ixrss+r0->ru_idrss+r0->ru_isrss))/t);
+ break;
+
+ case 'M':
+ fprintf(stderr,"%ld", r1->ru_maxrss/2);
+ break;
+
+ case 'F':
+ fprintf(stderr,"%ld", r1->ru_majflt-r0->ru_majflt);
+ break;
+
+ case 'R':
+ fprintf(stderr,"%ld", r1->ru_minflt-r0->ru_minflt);
+ break;
+
+ case 'I':
+ fprintf(stderr,"%ld", r1->ru_inblock-r0->ru_inblock);
+ break;
+
+ case 'O':
+ fprintf(stderr,"%ld", r1->ru_oublock-r0->ru_oublock);
+ break;
+
+ case 'C':
+ fprintf(stderr,"%ld+%ld",
+ r1->ru_nvcsw-r0->ru_nvcsw, r1->ru_nivcsw-r0->ru_nivcsw);
+ break;
+#endif /* !SYSV || __osf__ */
+ default:
+ putc(*cp, stderr);
+ break;
+ } /* switch */
+ } /* for */
+}
+/*--------------------------------------------------------------------------*/
+/* add 2 times structure and move usec bigger than 1000000 to sec */
+void
+tvadd(tsum, t0, t1)
+ struct timeval *tsum, *t0, *t1;
+{
+ tsum->tv_sec = t0->tv_sec + t1->tv_sec;
+ tsum->tv_usec = t0->tv_usec + t1->tv_usec;
+ if (tsum->tv_usec > 1000000) tsum->tv_sec++, tsum->tv_usec -= 1000000;
+}
+/*--------------------------------------------------------------------------*/
+/* substract 2 time structure (t1 > t0) */
+void
+tvsub(tdiff, t1, t0)
+ struct timeval *tdiff, *t1, *t0;
+{
+ tdiff->tv_sec = t1->tv_sec - t0->tv_sec;
+ tdiff->tv_usec = t1->tv_usec - t0->tv_usec;
+ if (tdiff->tv_usec < 0) tdiff->tv_sec--, tdiff->tv_usec += 1000000;
+}
+
+/*--------------------------------------------------------------------------*/
+void
+psecs(int l)
+{
+ int i = (int)l/3600;
+
+ if (i) {
+ /* hours:min:sec */
+ fprintf(stderr,"%d:", i);
+ i = (int)l % 3600;
+ fprintf(stderr,"%.2d:%.2d", i/60, i%60);
+ } else {
+ /* min:sec */
+ i = (int)l;
+ fprintf(stderr,"%d:%.2d", i/60, i%60);
+ }
+}
+/*--------------------------------------------------------------------------*/
+/* N R E A D */
+
+int
+Nread(SOCKET s, void* bufp, int count )
+{
+#if defined(__lynx__) || defined(__svr4__) || defined(_AIX) || defined(__NTVIS__) || defined(__FreeBSD__)
+ struct sockaddr from;
+#else
+ struct sockaddr_in from;
+#endif
+ int len = sizeof(from);
+ register int cnt;
+
+ if (timeout > 0) {
+ fd_set readfds, exceptfds;
+ struct timeval tv_timeout;
+ int n;
+
+ tv_timeout.tv_sec = timeout/1000;
+ tv_timeout.tv_usec = (timeout%1000)*1000;
+
+ FD_ZERO(&readfds);
+ FD_ZERO(&exceptfds);
+ FD_SET(s, &readfds);
+ FD_SET(s, &exceptfds);
+
+ n = select( s+1, &readfds, NULL, &exceptfds, &tv_timeout );
+ if (n == SOCKET_ERROR) {
+ sockets_err("select read");
+ } else if (n == 0) {
+ return (0);
+ }
+
+ }
+
+ if( udp )
+ {cnt = recvfrom( s, bufp, count, 0, SOCKADDR_CAST &from, &len );
+ numCalls++;
+ }
+ else
+ {if( b_flag ) cnt = mread( s, bufp, count ); /* fill bufp */
+ else
+ {
+#if defined(__NTVIS__)
+ cnt = recv( s, bufp, count, 0 );
+#else
+ cnt = read( s, bufp, count );
+#endif /* __NTVIS__ */
+ numCalls++;
+ }
+ if (touchdata && cnt > 0)
+ {register int c = cnt, sum = 0;
+ register char *b = bufp;
+ while (c--) sum += *b++;
+ }
+ }
+ /* rchrch printf (" numcall %d read buffer %d bytes \n",numCalls,cnt); */
+ return(cnt);
+}
+/*--------------------------------------------------------------------------*/
+/* N W R I T E */
+
+int
+Nwrite( int s, void* bufp, int count )
+{
+ register int cnt;
+ if( udp )
+ {
+ again:
+ cnt = sendto( s, bufp, count, 0, SOCKADDR_CAST &sinhim,
+ sizeof(sinhim) );
+
+ numCalls++;
+
+#if defined(__NTVIS__)
+ if( cnt<0 && WSAENOBUFS == WSAGetLastError())
+#else
+ if( cnt<0 && errno == ENOBUFS )
+#endif /* __NTVIS__ */
+
+ { delay(18000); errno = 0; goto again; }
+ } else /* if (udp) */
+ {
+
+#if defined(__NTVIS__)
+ cnt = send( s, bufp, count, 0 );
+ numCalls++;
+#else
+ cnt = write( s, bufp, count );
+ numCalls++;
+#endif /* __NTVIS__ */
+ }
+ return(cnt);
+}
+/*--------------------------------------------------------------------------*/
+void
+delay(us)
+int us;
+{
+ struct timeval tv;
+
+ tv.tv_sec = 0;
+ tv.tv_usec = (time_t)us;
+
+#if defined(__hpux__)
+ select(1, 0, 0, 0, &tv);
+#else
+ select(1, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tv);
+#endif
+}
+/*--------------------------------------------------------------------------*/
+/* M R E A D
+ *
+ * This function performs the function of a read(II) but will
+ * call read(II) multiple times in order to get the requested
+ * number of characters. This can be necessary because
+ * network connections don't deliver data with the same
+ * grouping as it is written with. Written by Robert S. Miles, BRL.
+ */
+int
+mread(int s, char* bufp, unsigned n)
+{
+ register unsigned count = 0;
+ register int nread;
+
+ do
+ {
+#if defined(__NTVIS__)
+ nread = recv(s, bufp, n-count, 0);
+#else
+ nread = read(s, bufp, n-count);
+#endif /* __NTVIS__ */
+ numCalls++;
+ if(nread < 0) {perror("ttcp_mread"); return(-1); }
+ if(nread == 0) return((int)count);
+ count += (unsigned)nread;
+ bufp += nread;
+ }while(count < n);
+ return((int)count);
+}
+
+/*--------------------------------------------------------------------------*/
+void
+open_log()
+{static long sysTicks;
+#if defined(UNDER_CE)
+ SYSTEMTIME SystemTime;
+#endif
+ sprintf(logfile,"%s_%s",logfile_head,trans?"t":"r");
+
+ fprintf(stderr,"open the log file >%s<\n",logfile);
+ if ((fplog = fopen(logfile,"r")) == NULL)
+
+ {if ((fplog = fopen(logfile,"a+")) == NULL)
+ {fprintf(stderr,"Failure : creation of the file >%s< \n",logfile );
+ exit(1);
+ }
+ else
+ {fprintf(fplog," creation date : ");
+ /* get date */
+#if defined(UNDER_CE)
+ GetLocalTime(&SystemTime);
+ sprintf(fplog,"%02d-%02d-%02d %02d:%02d\n", SystemTime.wDay, month[SystemTime.wMonth - 1],
+ SystemTime.wYear, SystemTime.wHour, SystemTime.wMinute);
+#else
+ time(&sysTicks);
+ tms = localtime(&sysTicks);
+ fprintf(fplog,"%02d-%02d-%02d %02d:%02d\n",
+ tms->tm_mday, tms->tm_mon, tms->tm_year,tms->tm_hour, tms->tm_min);
+#endif
+
+ /* An other version will produce : Mon Aug 4 16:32:16 1997
+ * long lDxcomsTicks; char *pDateTime;
+ * time(&lDxcomsTicks);
+ * pDateTime = ctime(&lDxcomsTicks); *(pDateTime+24) = '\0';
+ * fprintf(fplog," ttcp called : %s", pDateTime);
+ */
+ fprintf(fplog,"format\n");
+ fprintf(fplog,",buflen, nbuf(byte), bufalign(byte), bufoffset(byte)");
+ fprintf(fplog,", port, sockbufsize(byte), UserTime(sec), SysTime(sec)\n");
+ fprintf(fplog,", CPUusage(%%), Validity, nbytes(byte), realt(sec)");
+ fprintf(fplog,", rate(MB/sec), I/O call, hours*3600+min*60+sec\n\n");
+ /* day-month-year, hour:minute\n\n"); */
+ }
+ } /* file already exist */
+ else
+ {fclose (fplog);
+ if ((fplog = fopen(logfile,"a+")) == NULL)
+ {fprintf(stderr,"Failure : access of the file >%s< \n",logfile );
+ exit(1);
+ }
+ }
+}
+/*--------------------------------------------------------------------------*/
+void
+close_log()
+{
+#if defined(UNDER_CE)
+ SYSTEMTIME SystemTime;
+
+ GetLocalTime(&SystemTime);
+ fprintf(fplog," %d\n", SystemTime.wHour * 3600 + SystemTime.wMinute * 60 + SystemTime.wSecond);
+#else
+ static long sysTicks;
+ time(&sysTicks);
+ tms = localtime(&sysTicks);
+ fprintf(fplog," %d\n",((tms->tm_hour)*3600 + (tms->tm_min)*60 + tms->tm_sec));
+#endif
+ fclose(fplog);
+ fflush(fplog);
+}
+/*--------------------------------------------------------------------------*/
+/* routine emulating UNIX function under NT */
+#if defined(__NTVIS__)
+
+/*---------------------------------------------------------------------------*/
+static void
+error(char *pch)
+{
+ if (!opterr) {
+ return; // without printing
+ }
+ fprintf(stderr, "%s: %s: %c\n",
+ (NULL != progname) ? progname : "getopt", pch, optopt);
+}
+/*---------------------------------------------------------------------------*/
+int
+getopt(int argc, char **argv, char *ostr)
+{
+ static char *place = EMSG; /* option letter processing */
+ register char *oli; /* option letter list index */
+
+ if (!*place) {
+ // update scanning pointer
+ if (optind >= argc || *(place = argv[optind]) != '-' || !*++place) {
+ place = EMSG;
+ return -1;
+ }
+ // place now points to the first char past the initial '-'
+ if (place[0] == '-') {
+ // found "--"
+ // Was the word just a '--'?
+ if (place[1] == '\0')
+ ++optind; // yes, so consume the word
+ // otherwise, the '--' was the start of a longer word,
+ // so do not consume it.
+ place = EMSG;
+ return -1;
+ }
+ }
+
+ /* option letter okay? */
+ if ((optopt = (int)*place++) == (int)':'
+ || !(oli = strchr(ostr, optopt))) {
+ if (!*place) {
+ ++optind;
+ }
+ error("illegal option");
+ return BADCH;
+ }
+ if (*++oli != ':') {
+ /* don't need argument */
+ optarg = NULL;
+ if (!*place)
+ ++optind;
+ } else {
+ /* need an argument */
+ if (*place) {
+ optarg = place; /* no white space */
+ } else if (argc <= ++optind) {
+ /* no arg */
+ place = EMSG;
+ error("option requires an argument");
+ return BADCH;
+ } else {
+ optarg = argv[optind]; /* white space */
+ }
+ place = EMSG;
+ ++optind;
+ }
+ return optopt; // return option letter
+}
+
+void
+usleep(unsigned int microseconds)
+{
+ Sleep(microseconds/1000);
+}
+#endif /* __NTVIS__ */
+/*--------------------------------------------------------------------------*/
+/*--------------------------------------------------------------------------*/
+void
+do_help()
+{
+char More_help[] =
+" Details about the reply: \n"
+" Example: \n"
+" ttcp-t: buflen=8192, nbuf=100, align=16384/0, port=5010\n"
+" ttcp-t: File-Descriptor 0x4 Opened\n"
+" # tcp sender -> <host> #\n"
+" ttcp-t: 819200 bytes in 1.152557 real seconds = 694.109 KB/sec +++\n"
+" ttcp-t: 100 I/O calls, 11.526 msec(real)/call, 0.213 msec(cpu)/call\n"
+" ttcp-t: 0.001914user 0.019388sys 0:01real 1% 9i+58d 190maxrss 1+2pf 177+180csw\n"
+" ttcp-t: buffer address 0x28000\n"
+" ttcp-t: File-Descriptor fd 0x4 Closed\n"
+" ttcp done.\n\n"
+"cpu seconds == (sec) elapse ru_utime + elapse ru_stime.\n"
+" ru_utime == The total amount of time running in user mode.\n"
+" ru_stime == The total amount of time spent in the system.\n"
+" executing on behalf of the process.\n"
+"real seconds == elapse time calculated by the system timer (date).\n"
+"I/O calls == I/O call to the driver.\n"
+"msec/call == average elapse time (Real seconds) between each I/O.\n"
+"calls/sec == invert of msec/call.\n"
+"user == (sec.msec) elaspe ru_utime.\n"
+"sys == (sec.msec) elapse ru_stime.\n"
+"real == (min:sec) CPU seconds.\n"
+"%% == Real seconds / CPU seconds.\n"
+"(ru_ixrss)i+(ru_idrss)d\n"
+" ru_ixrss == An integral value indicating the amount of memory \n"
+" used by the text segment that was also shared among\n"
+" other processes. This value is expressed in units of\n"
+" kilobytes * seconds-of-execution and is calculated \n"
+" by adding the number of shared memory pages in use \n"
+" each time the internal system clock ticks, and then\n"
+" averaging over one-second intervals.\n"
+" ru_idrss == An integral value of the amount of unshared memory \n"
+" in the data segment of a process (expressed in \n"
+" units of kilobytes * seconds-of-execution).\n";
+
+char More_help1[] =
+" (ru_maxrss/2)maxrss.\n"
+" ru_maxrss == The maximum size, in kilobytes, of the used\n"
+" resident set size. \n"
+" (ru_majflt)+(ru_minflt)pf : Page fault\n"
+" ru_majflt == The number of page faults serviced that required\n"
+" I/O activity.\n"
+" ru_minflt == The number of page faults serviced without any\n"
+" I/O activity. In this case, I/O activity is \n"
+" avoided by reclaiming a page frame from the list \n"
+" of pages awaiting reallocation. \n"
+"(ru_nvcsw)+(ru_nivcsw)csw : context switch\n"
+" ru_nvcsw == The number of times a context switch resulted \n"
+" because a process voluntarily gave up the \n"
+" processor before its time slice was completed. \n"
+" This usually occurs while the process waits \n"
+" for availability of a resource.\n"
+" ru_nivcsw == The number of times a context switch resulted \n"
+" because a higher priority process ran or because\n"
+" the current process exceeded its time slice.\n\n";
+
+char More_help2[] =
+"log file format :\n"
+" buflen, nbuf(byte), bufalign(byte), bufoffset(byte)\n"
+" port, sockbufsize(byte), UserTime(sec), SysTime(sec), CPUusage(%)\n"
+" nbytes(byte), realt(sec), rate(MB/sec), I/O call,\n"
+" hours*3600+min*60+sec\n\n";
+
+ fprintf(stderr,More_help);
+ fprintf(stderr,More_help1);
+ fprintf(stderr,More_help2);
+}
+/*---------------------------------------------------------------------------*/
+void
+do_Usage()
+{
+char Usage[] =
+" Usage: ttcp -t [-options] host [ < in ] ttcp -r [-options > out]\n"
+"Example: ttcp -t -s -v -n100 host ttcp -r -s -v -n100\n"
+"Common options:\n"
+" -V prints version number and date of last modification\n"
+" -L create and append all results to a file named ttcp_log\n"
+" -h more help\n"
+" -l ## length of bufs read from or written to network (default 8192,\n"
+" max 65535)\n"
+" -u use UDP instead of TCP\n"
+" -p ## port number to send to or listen at (default 5010)\n"
+#if defined(__linux__)
+" -P ## link-layer priority (default 0)\n"
+#endif
+" -s (ttcp -t) : source a pattern to network\n"
+" (ttcp -r) : sink (discard) all data from network\n"
+" -A ## align the start of buffers to this modulus (default 16384)\n"
+" -O ## start buffers at this offset from the modulus (default 0)\n"
+" -v verbose: print more statistics\n"
+" -d set SO_DEBUG socket option\n"
+" -b ## set socket buffer size (if supported)\n"
+" -f X format for rate: b,B = bits, bytes k,K = kilo{bits,bytes};\n"
+" m,M = mega{bits,bytes}; g,G = giga{bits,bytes}\n"
+" -w ## set timeout value (in milliseconds) to exit if no receive data or tcp connect\n"
+"Options specific to (ttcp -t) :\n"
+" -n ## number of source bufs written to network (default 2048)\n"
+" -x use random data in tcp/udp frames (-I provides seed)\n"
+" -D don't buffer TCP writes (sets TCP_NODELAY socket option)\n"
+" -H print hash marks to indicate progress, one per buffer\n"
+" -I init/seed value for RNG when sending random size bufs (default 1)\n"
+" -N ## number of source bufs per burst, i.e between sleeps (default 1)\n"
+" -R ## send random size buffers with minimum size specified, max size\n"
+" is value of -l option\n"
+" -S ## millisecs between bursts (only used for udp, 10ms resolution)\n"
+"Options specific to (ttcp -r) :\n"
+" -B for -s, only output full blocks as specified by -l (for TAR)\n"
+" -T \"touch\": access each byte as it's read\n"
+" -i report information on out of order sequence numbers\n"
+#if defined(DEBUG)
+"Options for debug:\n"
+" --nostart do not send UDP start packets\n"
+" --noend do not send UDP end packets\n"
+" --nodata do not send UDP data packets\n"
+" --debug print extra debug outputs\n"
+#endif /* DEBUG */
+;
+
+ fprintf(stderr,Usage);
+}
+
+/* Define automatic Emacs variables for consistent code formatting */
+/* Local Variables: */
+/* c-basic-offset:2 */
+/* indent-tabs-mode:nil */
+/* End: */
diff --git a/package/uclibc++/Config.in b/package/uclibc++/Config.in
new file mode 100644
index 000000000..468493b37
--- /dev/null
+++ b/package/uclibc++/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_UCLIBCXX
+ prompt "uClibc++.......................... C++ library for embedded systems"
+ tristate
+ depends on ADK_CXX
+ default n
+ help
+ A standard C++ library for embedded systems
+
diff --git a/package/uclibc++/Makefile b/package/uclibc++/Makefile
new file mode 100644
index 000000000..95e616cc4
--- /dev/null
+++ b/package/uclibc++/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= uClibc++
+PKG_VERSION:= 0.2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6e6032c49916b199ffe6a585552fd46b
+
+MASTER_SITES:= http://cxx.uclibc.org/src/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,UCLIBCXX,uclibc++,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= TOPDIR="${WRKBUILD}/" \
+ ${TARGET_CONFIGURE_OPTS} \
+ ARCH_CFLAGS="${TARGET_CFLAGS}" \
+ CROSS="${TARGET_CROSS}"
+TARGET_CONFIGURE_OPTS=
+
+do-configure:
+ ${CP} ./files/config ${WRKBUILD}/.config
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_UCLIBCXX}/usr/lib
+ ${CP} ${WRKBUILD}/src/libuClibc++*.so* ${IDIR_UCLIBCXX}/usr/lib/
+ ${INSTALL_DIR} ${WRKINST}/usr/include
+ ${CP} ${WRKBUILD}/include ${WRKINST}/usr/include/uClibc++
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/uclibc++/files/config b/package/uclibc++/files/config
new file mode 100644
index 000000000..f6ef07573
--- /dev/null
+++ b/package/uclibc++/files/config
@@ -0,0 +1,57 @@
+#
+# Automatically generated make config: don't edit
+#
+
+#
+# Target Features and Options
+#
+UCLIBCXX_HAS_FLOATS=y
+# UCLIBCXX_HAS_LONG_DOUBLE is not set
+# UCLIBCXX_HAS_TLS is not set
+WARNINGS="-Wall"
+BUILD_EXTRA_LIBRARIES=""
+HAVE_DOT_CONFIG=y
+
+#
+# String and I/O Stream Support
+#
+UCLIBCXX_HAS_WCHAR=y
+UCLIBCXX_IOSTREAM_BUFSIZE=32
+UCLIBCXX_HAS_LFS=y
+UCLIBCXX_SUPPORT_CDIR=y
+UCLIBCXX_SUPPORT_CIN=y
+UCLIBCXX_SUPPORT_COUT=y
+UCLIBCXX_SUPPORT_CERR=y
+# UCLIBCXX_SUPPORT_CLOG is not set
+# UCLIBCXX_SUPPORT_WCIN is not set
+# UCLIBCXX_SUPPORT_WCOUT is not set
+# UCLIBCXX_SUPPORT_WCERR is not set
+# UCLIBCXX_SUPPORT_WCLOG is not set
+
+#
+# STL and Code Expansion
+#
+UCLIBCXX_STL_BUFFER_SIZE=32
+UCLIBCXX_CODE_EXPANSION=y
+# UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS is not set
+UCLIBCXX_EXPAND_STRING_CHAR=y
+UCLIBCXX_EXPAND_VECTOR_BASIC=y
+# UCLIBCXX_EXPAND_IOS_CHAR is not set
+# UCLIBCXX_EXPAND_STREAMBUF_CHAR is not set
+UCLIBCXX_EXPAND_ISTREAM_CHAR=y
+UCLIBCXX_EXPAND_OSTREAM_CHAR=y
+UCLIBCXX_EXPAND_FSTREAM_CHAR=y
+# UCLIBCXX_EXPAND_SSTREAM_CHAR is not set
+
+#
+# Library Installation Options
+#
+UCLIBCXX_RUNTIME_PREFIX=""
+UCLIBCXX_RUNTIME_INCLUDE_SUBDIR="/include"
+UCLIBCXX_RUNTIME_LIB_SUBDIR="/lib"
+UCLIBCXX_RUNTIME_BIN_SUBDIR="/bin"
+UCLIBCXX_EXCEPTION_SUPPORT=y
+IMPORT_LIBSUP=y
+# IMPORT_LIBGCC_EH is not set
+# BUILD_STATIC_LIB is not set
+# DODEBUG is not set
diff --git a/package/uclibc++/files/config.mips b/package/uclibc++/files/config.mips
new file mode 100644
index 000000000..f6ef07573
--- /dev/null
+++ b/package/uclibc++/files/config.mips
@@ -0,0 +1,57 @@
+#
+# Automatically generated make config: don't edit
+#
+
+#
+# Target Features and Options
+#
+UCLIBCXX_HAS_FLOATS=y
+# UCLIBCXX_HAS_LONG_DOUBLE is not set
+# UCLIBCXX_HAS_TLS is not set
+WARNINGS="-Wall"
+BUILD_EXTRA_LIBRARIES=""
+HAVE_DOT_CONFIG=y
+
+#
+# String and I/O Stream Support
+#
+UCLIBCXX_HAS_WCHAR=y
+UCLIBCXX_IOSTREAM_BUFSIZE=32
+UCLIBCXX_HAS_LFS=y
+UCLIBCXX_SUPPORT_CDIR=y
+UCLIBCXX_SUPPORT_CIN=y
+UCLIBCXX_SUPPORT_COUT=y
+UCLIBCXX_SUPPORT_CERR=y
+# UCLIBCXX_SUPPORT_CLOG is not set
+# UCLIBCXX_SUPPORT_WCIN is not set
+# UCLIBCXX_SUPPORT_WCOUT is not set
+# UCLIBCXX_SUPPORT_WCERR is not set
+# UCLIBCXX_SUPPORT_WCLOG is not set
+
+#
+# STL and Code Expansion
+#
+UCLIBCXX_STL_BUFFER_SIZE=32
+UCLIBCXX_CODE_EXPANSION=y
+# UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS is not set
+UCLIBCXX_EXPAND_STRING_CHAR=y
+UCLIBCXX_EXPAND_VECTOR_BASIC=y
+# UCLIBCXX_EXPAND_IOS_CHAR is not set
+# UCLIBCXX_EXPAND_STREAMBUF_CHAR is not set
+UCLIBCXX_EXPAND_ISTREAM_CHAR=y
+UCLIBCXX_EXPAND_OSTREAM_CHAR=y
+UCLIBCXX_EXPAND_FSTREAM_CHAR=y
+# UCLIBCXX_EXPAND_SSTREAM_CHAR is not set
+
+#
+# Library Installation Options
+#
+UCLIBCXX_RUNTIME_PREFIX=""
+UCLIBCXX_RUNTIME_INCLUDE_SUBDIR="/include"
+UCLIBCXX_RUNTIME_LIB_SUBDIR="/lib"
+UCLIBCXX_RUNTIME_BIN_SUBDIR="/bin"
+UCLIBCXX_EXCEPTION_SUPPORT=y
+IMPORT_LIBSUP=y
+# IMPORT_LIBGCC_EH is not set
+# BUILD_STATIC_LIB is not set
+# DODEBUG is not set
diff --git a/package/uclibc++/files/config.x86 b/package/uclibc++/files/config.x86
new file mode 100644
index 000000000..f6ef07573
--- /dev/null
+++ b/package/uclibc++/files/config.x86
@@ -0,0 +1,57 @@
+#
+# Automatically generated make config: don't edit
+#
+
+#
+# Target Features and Options
+#
+UCLIBCXX_HAS_FLOATS=y
+# UCLIBCXX_HAS_LONG_DOUBLE is not set
+# UCLIBCXX_HAS_TLS is not set
+WARNINGS="-Wall"
+BUILD_EXTRA_LIBRARIES=""
+HAVE_DOT_CONFIG=y
+
+#
+# String and I/O Stream Support
+#
+UCLIBCXX_HAS_WCHAR=y
+UCLIBCXX_IOSTREAM_BUFSIZE=32
+UCLIBCXX_HAS_LFS=y
+UCLIBCXX_SUPPORT_CDIR=y
+UCLIBCXX_SUPPORT_CIN=y
+UCLIBCXX_SUPPORT_COUT=y
+UCLIBCXX_SUPPORT_CERR=y
+# UCLIBCXX_SUPPORT_CLOG is not set
+# UCLIBCXX_SUPPORT_WCIN is not set
+# UCLIBCXX_SUPPORT_WCOUT is not set
+# UCLIBCXX_SUPPORT_WCERR is not set
+# UCLIBCXX_SUPPORT_WCLOG is not set
+
+#
+# STL and Code Expansion
+#
+UCLIBCXX_STL_BUFFER_SIZE=32
+UCLIBCXX_CODE_EXPANSION=y
+# UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS is not set
+UCLIBCXX_EXPAND_STRING_CHAR=y
+UCLIBCXX_EXPAND_VECTOR_BASIC=y
+# UCLIBCXX_EXPAND_IOS_CHAR is not set
+# UCLIBCXX_EXPAND_STREAMBUF_CHAR is not set
+UCLIBCXX_EXPAND_ISTREAM_CHAR=y
+UCLIBCXX_EXPAND_OSTREAM_CHAR=y
+UCLIBCXX_EXPAND_FSTREAM_CHAR=y
+# UCLIBCXX_EXPAND_SSTREAM_CHAR is not set
+
+#
+# Library Installation Options
+#
+UCLIBCXX_RUNTIME_PREFIX=""
+UCLIBCXX_RUNTIME_INCLUDE_SUBDIR="/include"
+UCLIBCXX_RUNTIME_LIB_SUBDIR="/lib"
+UCLIBCXX_RUNTIME_BIN_SUBDIR="/bin"
+UCLIBCXX_EXCEPTION_SUPPORT=y
+IMPORT_LIBSUP=y
+# IMPORT_LIBGCC_EH is not set
+# BUILD_STATIC_LIB is not set
+# DODEBUG is not set
diff --git a/package/uclibc++/ipkg/uclibc++.control b/package/uclibc++/ipkg/uclibc++.control
new file mode 100644
index 000000000..5919e20c2
--- /dev/null
+++ b/package/uclibc++/ipkg/uclibc++.control
@@ -0,0 +1,4 @@
+Package: uclibc++
+Priority: optional
+Section: libs
+Description: A standard c++ library for embedded systems
diff --git a/package/uclibc++/patches/patch-bin_Makefile b/package/uclibc++/patches/patch-bin_Makefile
new file mode 100644
index 000000000..6be4e2b38
--- /dev/null
+++ b/package/uclibc++/patches/patch-bin_Makefile
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- uClibc++-0.2.1.orig/bin/Makefile 2006-09-04 04:28:02.000000000 +0200
++++ uClibc++-0.2.1/bin/Makefile 2009-04-29 19:45:06.704996078 +0200
+@@ -13,7 +13,7 @@ install:
+ $(INSTALL) -m 755 $(WRAPPER) $(PREFIX)$(UCLIBCXX_RUNTIME_BINDIR)
+
+ $(WRAPPER):
+- echo "#!/bin/bash" > $(WRAPPER)
++ echo "#!/usr/bin/env bash" > $(WRAPPER)
+ echo "" >> $(WRAPPER)
+ echo 'WRAPPER_INCLUDEDIR="$${WRAPPER_INCLUDEDIR:=-I$(UCLIBCXX_RUNTIME_INCLUDEDIR)}"' >> $(WRAPPER)
+ echo 'WRAPPER_LIBDIR="$${WRAPPER_LIBDIR:=-L$(UCLIBCXX_RUNTIME_LIBDIR)}"' >> $(WRAPPER)
diff --git a/package/uclibc++/patches/patch-fstream_eof b/package/uclibc++/patches/patch-fstream_eof
new file mode 100644
index 000000000..d60bee8b1
--- /dev/null
+++ b/package/uclibc++/patches/patch-fstream_eof
@@ -0,0 +1,15 @@
+$Id$
+ * fix crash on reading from closed fstream
+
+--- uClibc++-0.2.1.orig/include/fstream 2006-09-04 04:28:09.000000000 +0200
++++ uClibc++-0.2.1/include/fstream 2008-12-14 18:20:27.000000000 +0100
+@@ -201,6 +201,9 @@ namespace std{
+
+ */
+
++ if(fp == 0)
++ return traits::eof();
++
+ if(basic_streambuf<charT,traits>::eback() == 0){
+ //No buffer, so...
+ charT c;
diff --git a/package/uclibc++/patches/patch-include_locale b/package/uclibc++/patches/patch-include_locale
new file mode 100644
index 000000000..2ecee1c11
--- /dev/null
+++ b/package/uclibc++/patches/patch-include_locale
@@ -0,0 +1,19 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- uClibc++-0.2.1.orig/include/locale 2006-09-04 04:28:07.000000000 +0200
++++ uClibc++-0.2.1/include/locale 2009-04-29 19:48:20.096785868 +0200
+@@ -19,6 +19,7 @@
+
+ #include <basic_definitions>
+ #include <cstddef>
++#include <string>
+
+ #ifndef __HEADER_STD_LOCALE
+ #define __HEADER_STD_LOCALE 1
+@@ -56,6 +57,7 @@ namespace std{
+ const locale& operator=(const locale&) throw(){
+ return *this;
+ }
++ std::string name() const { return "C"; }
+ };
+
+ class _UCXXEXPORT locale::facet {
diff --git a/package/uclibc++/patches/patch-include_string b/package/uclibc++/patches/patch-include_string
new file mode 100644
index 000000000..46f900bb5
--- /dev/null
+++ b/package/uclibc++/patches/patch-include_string
@@ -0,0 +1,17 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- uClibc++-0.2.1.orig/include/string 2006-09-04 04:28:07.000000000 +0200
++++ uClibc++-0.2.1/include/string 2008-12-14 18:22:26.000000000 +0100
+@@ -1010,11 +1010,11 @@ template<class charT, class traits, clas
+
+ template <> _UCXXEXPORT bool operator==(const string & lhs, const string & rhs);
+ template <> _UCXXEXPORT bool operator==(const char * lhs, const string & rhs);
+-template <> _UCXXEXPORT bool operator==(const string & rhs, const char * rhs);
++template <> _UCXXEXPORT bool operator==(const string & lhs, const char * rhs);
+
+ template <> _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs);
+ template <> _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs);
+-template <> _UCXXEXPORT bool operator!=(const string & rhs, const char * rhs);
++template <> _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs);
+
+ template <> _UCXXEXPORT string operator+(const string & lhs, const char* rhs);
+ template <> _UCXXEXPORT string operator+(const char* lhs, const string & rhs);
diff --git a/package/uclibc++/patches/patch-src_string_cpp b/package/uclibc++/patches/patch-src_string_cpp
new file mode 100644
index 000000000..e1b56a985
--- /dev/null
+++ b/package/uclibc++/patches/patch-src_string_cpp
@@ -0,0 +1,17 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- uClibc++-0.2.1.orig/src/string.cpp 2006-09-04 04:28:07.000000000 +0200
++++ uClibc++-0.2.1/src/string.cpp 2008-12-14 18:23:21.000000000 +0100
+@@ -74,11 +74,11 @@ namespace std{
+
+ template _UCXXEXPORT bool operator==(const string & lhs, const string & rhs);
+ template _UCXXEXPORT bool operator==(const char * lhs, const string & rhs);
+- template _UCXXEXPORT bool operator==(const string & rhs, const char * rhs);
++ template _UCXXEXPORT bool operator==(const string & lhs, const char * rhs);
+
+ template _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs);
+ template _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs);
+- template _UCXXEXPORT bool operator!=(const string & rhs, const char * rhs);
++ template _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs);
+
+ template _UCXXEXPORT string operator+(const string & lhs, const char* rhs);
+ template _UCXXEXPORT string operator+(const char* lhs, const string & rhs);
diff --git a/package/uclibc/Config.in b/package/uclibc/Config.in
new file mode 100644
index 000000000..bf67093a2
--- /dev/null
+++ b/package/uclibc/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_UCLIBC
+ prompt "uClibc............................... embedded C library"
+ tristate
+ default y if ADK_TARGET_LIB_UCLIBC
+ default n
+ depends on ADK_TARGET_LIB_UCLIBC
+ help
+ Embedded C library.
+
diff --git a/package/uclibc/Makefile b/package/uclibc/Makefile
new file mode 100644
index 000000000..73b3fe87e
--- /dev/null
+++ b/package/uclibc/Makefile
@@ -0,0 +1,38 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/toolchain/uClibc/Makefile.inc
+
+NO_DISTFILES:=1
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,UCLIBC,uclibc,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+# do nothing, uClibc is already build in toolchain directory
+do-install:
+ ${INSTALL_DIR} $(IDIR_UCLIBC)/lib $(IDIR_UCLIBC)/etc
+ # create timezone file
+ echo 'CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00' > $(IDIR_UCLIBC)/etc/TZ
+ifneq (${CPU_ARCH},x86_64)
+ $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(IDIR_UCLIBC)/lib/
+endif
+ $(CP) $(STAGING_DIR)/lib/libc.so.* $(IDIR_UCLIBC)/lib/
+ $(CP) $(STAGING_DIR)/lib/libuClibc-$(PKG_VERSION).so $(IDIR_UCLIBC)/lib/
+ $(CP) $(STAGING_DIR)/lib/ld*-uClibc-$(PKG_VERSION).so $(IDIR_UCLIBC)/lib/
+ $(CP) $(STAGING_DIR)/lib/ld*-uClibc.so.* $(IDIR_UCLIBC)/lib/
+ -for file in libcrypt libdl libm libnsl libresolv librt libutil; do \
+ $(CP) $(STAGING_DIR)/lib/$$file.so.* $(IDIR_UCLIBC)/lib/; \
+ $(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_UCLIBC)/lib/; \
+ done
+ # create ld.so link for ldd
+ifneq (${CPU_ARCH},x86_64)
+ cd $(IDIR_UCLIBC)/lib && ln -sf ld-uClibc.so.0 ld.so
+else
+ cd $(IDIR_UCLIBC)/lib && ln -sf ld64-uClibc.so.0 ld.so
+endif
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/uclibc/ipkg/uclibc.conffiles b/package/uclibc/ipkg/uclibc.conffiles
new file mode 100644
index 000000000..e9ee7e4d7
--- /dev/null
+++ b/package/uclibc/ipkg/uclibc.conffiles
@@ -0,0 +1 @@
+/etc/TZ
diff --git a/package/uclibc/ipkg/uclibc.control b/package/uclibc/ipkg/uclibc.control
new file mode 100644
index 000000000..2cc44200a
--- /dev/null
+++ b/package/uclibc/ipkg/uclibc.control
@@ -0,0 +1,4 @@
+Package: uclibc
+Priority: optional
+Section: net
+Description: Standard C library for embedded Linux systems
diff --git a/package/udev/Config.in b/package/udev/Config.in
new file mode 100644
index 000000000..b3f01cb65
--- /dev/null
+++ b/package/udev/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_UDEV
+ prompt "udev.............................. Dynamic device management subsystem"
+ tristate
+ default n
+ select ADK_COMPILE_UTIL_LINUX
+ help
+ udev provides a dynamic device directory containing only the files for
+ actually present devices. It creates or removes device node files in
+ the /dev directory, or it renames network interfaces.
+
+ http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
diff --git a/package/udev/Makefile b/package/udev/Makefile
new file mode 100644
index 000000000..47eae9962
--- /dev/null
+++ b/package/udev/Makefile
@@ -0,0 +1,48 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= udev
+PKG_VERSION:= 077
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 61ec646daf7795e9777e8f33975408fe
+
+MASTER_SITES:= ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/ \
+ http://ftp.kernel.org/pub/linux/utils/kernel/hotplug/ \
+ ftp://ftp.de.kernel.org/pub/linux/utils/kernel/hotplug/ \
+ http://ftp.de.kernel.org/pub/linux/utils/kernel/hotplug/ \
+ ftp://ftp.fr.kernel.org/pub/linux/utils/kernel/hotplug/ \
+ http://ftp.fr.kernel.org/pub/linux/utils/kernel/hotplug/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,UDEV,udev,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= CROSS="${TARGET_CROSS}" \
+ STRIP="/bin/true" \
+ OPTFLAGS="${TARGET_CFLAGS}" \
+ INSTALL="install -c"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_UDEV}/etc/udev/
+ ${CP} ${WRKINST}/etc/udev/* ${IDIR_UDEV}/etc/udev/
+ ${INSTALL_DIR} ${IDIR_UDEV}/lib/udev
+ ${INSTALL_DIR} ${IDIR_UDEV}/sbin/
+ ${CP} ${WRKINST}/sbin/udev ${IDIR_UDEV}/sbin/
+ ${CP} ${WRKINST}/sbin/udevcontrol ${IDIR_UDEV}/sbin/
+ ${CP} ${WRKINST}/sbin/udevd ${IDIR_UDEV}/sbin/
+ ${CP} ${WRKINST}/sbin/udevsend ${IDIR_UDEV}/sbin/
+ ${CP} ${WRKINST}/sbin/udevstart ${IDIR_UDEV}/sbin/
+ ${INSTALL_DIR} ${IDIR_UDEV}/usr/bin/
+ ${CP} ${WRKINST}/usr/bin/udevinfo ${IDIR_UDEV}/usr/bin/
+ ${CP} ${WRKINST}/usr/bin/udevtest ${IDIR_UDEV}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_UDEV}/usr/sbin/
+ ${CP} ${WRKINST}/usr/sbin/udevmonitor ${IDIR_UDEV}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/udev/ipkg/udev.conffiles b/package/udev/ipkg/udev.conffiles
new file mode 100644
index 000000000..50a5fb889
--- /dev/null
+++ b/package/udev/ipkg/udev.conffiles
@@ -0,0 +1 @@
+/etc/udev/udev.conf
diff --git a/package/udev/ipkg/udev.control b/package/udev/ipkg/udev.control
new file mode 100644
index 000000000..7ca98a0aa
--- /dev/null
+++ b/package/udev/ipkg/udev.control
@@ -0,0 +1,4 @@
+Package: udev
+Priority: optional
+Section: base
+Description: Dynamic device management subsystem
diff --git a/package/udev/patches/01-no_debug.patch b/package/udev/patches/01-no_debug.patch
new file mode 100644
index 000000000..dcbc1051a
--- /dev/null
+++ b/package/udev/patches/01-no_debug.patch
@@ -0,0 +1,21 @@
+diff -ruN udev-077-old/Makefile udev-077-new/Makefile
+--- udev-077-old/Makefile 2005-12-04 03:01:48.000000000 +0100
++++ udev-077-new/Makefile 2005-12-07 16:48:11.000000000 +0100
+@@ -136,7 +136,7 @@
+ # check if compiler option is supported
+ cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;}
+
+-CFLAGS = -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
++CFLAGS = -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+ WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \
+ -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
+ -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
+@@ -159,7 +159,7 @@
+
+ # if DEBUG is enabled, then we do not strip
+ ifeq ($(strip $(DEBUG)),true)
+- CFLAGS += -DDEBUG
++ CFLAGS += -g -DDEBUG
+ STRIPCMD =
+ endif
+
diff --git a/package/udp-broadcast-relay/Config.in b/package/udp-broadcast-relay/Config.in
new file mode 100644
index 000000000..9a729f14f
--- /dev/null
+++ b/package/udp-broadcast-relay/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_UDP_BROADCAST_RELAY
+ prompt "udp-broadcast-relay............... listens for packets on a specified UDP broadcast port."
+ tristate
+ default n
+ help
+ This program listens for packets on a specified UDP broadcast port. When a packet is received, it sends that packet to all specified interfaces but the one it came from as though it originated from the original sender.
+
+ The primary purpose of this is to allow games on machines on separated local networks (Ethernet, WLAN) that use udp broadcasts to find each other to do so.
+
+ It also works on ppp links, so you can log in from windows boxes (e.g. using pptp) and play LAN-based games together. Currently, you have to care about upcoming or downgoing interfaces yourself.
+
+ http://www.joachim-breitner.de/udp-broadcast-relay/
diff --git a/package/udp-broadcast-relay/Makefile b/package/udp-broadcast-relay/Makefile
new file mode 100644
index 000000000..75befbd9f
--- /dev/null
+++ b/package/udp-broadcast-relay/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= udp-broadcast-relay
+PKG_VERSION:= 0.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a32f983b7063d6ac670e6b22be9b9d24
+
+MASTER_SITES:= http://www.joachim-breitner.de/udp-broadcast-relay/files/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,UDP_BROADCAST_RELAY,udp-broadcast-relay,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-build:
+ ${TARGET_CC} ${WRKBUILD}/main.c -o ${WRKBUILD}/${PKG_NAME}
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_UDP_BROADCAST_RELAY}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/${PKG_NAME} ${IDIR_UDP_BROADCAST_RELAY}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control b/package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control
new file mode 100644
index 000000000..f83247ac7
--- /dev/null
+++ b/package/udp-broadcast-relay/ipkg/udp-broadcast-relay.control
@@ -0,0 +1,4 @@
+Package: udp-broadcast-relay
+Priority: optional
+Section: net
+Description: This program listens for packets on a specified UDP broadcast port. When a packet is received, it sends that packet to all specified interfaces but the one it came from as though it originated from the original sender.
diff --git a/package/udp-broadcast-relay/patches/patch-main_c b/package/udp-broadcast-relay/patches/patch-main_c
new file mode 100644
index 000000000..f57fb0409
--- /dev/null
+++ b/package/udp-broadcast-relay/patches/patch-main_c
@@ -0,0 +1,32 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- udp-broadcast-relay-0.3.orig/main.c 2003-09-28 16:43:32.000000000 +0200
++++ udp-broadcast-relay-0.3/main.c 2008-10-15 16:04:02.000000000 +0200
+@@ -220,8 +220,8 @@ main(int argc,char **argv)
+ }
+
+ /* Save the address for later use */
+- bcopy( (struct sockaddr_in *)&reqbuf.ifr_addr,
+- &ifs[maxifs].dstaddr,
++ memcpy( &ifs[maxifs].dstaddr,
++ (struct sockaddr_in *)&reqbuf.ifr_addr,
+ sizeof(struct sockaddr_in) );
+
+ DPRINT("%s: %i / %s\n",
+@@ -349,7 +349,7 @@ main(int argc,char **argv)
+ DPRINT("From:\t\t%s:%d\n",inet_ntoa(rcv_addr.sin_addr),rcv_addr.sin_port);
+
+ /* copy sender's details into our datagram as the source addr */
+- bcopy(&(rcv_addr.sin_addr.s_addr),(gram+12),4);
++ memcpy((gram+12),&(rcv_addr.sin_addr.s_addr),4);
+ *(u_short*)(gram+20)=(u_short)rcv_addr.sin_port;
+
+ /* set the length of the packet */
+@@ -362,7 +362,7 @@ main(int argc,char **argv)
+ if (ifs[x].ifindex == rcv_ifindex) continue; /* no bounces, please */
+
+ /* Set destination addr ip - port is set already*/
+- bcopy(&(ifs[x].dstaddr.sin_addr.s_addr),(gram+16),4);
++ memcpy((gram+16),&(ifs[x].dstaddr.sin_addr.s_addr),4);
+
+ DPRINT ("Sent to %s:%d on interface %i\n",
+ inet_ntoa(ifs[x].dstaddr.sin_addr), /* dst ip */
diff --git a/package/ulogd/Config.in b/package/ulogd/Config.in
new file mode 100644
index 000000000..e725f2807
--- /dev/null
+++ b/package/ulogd/Config.in
@@ -0,0 +1,48 @@
+#menu "ulogd............................. Netfilter userspace logging daemon"
+
+config ADK_PACKAGE_ULOGD
+ prompt "ulogd............................. Netfilter userspace logging daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_IPTABLES
+ help
+ The netfilter userspace logging daemon
+
+ http://gnumonks.org/projects/ulogd
+
+config ADK_PACKAGE_ULOGD_MOD_MYSQL
+ prompt " ulogd-mod-mysql............... Output plugin for logging into a MySQL database"
+ tristate
+ default n
+ depends on ADK_CXX
+ depends ADK_PACKAGE_ULOGD
+ select ADK_PACKAGE_LIBMYSQLCLIENT
+
+config ADK_PACKAGE_ULOGD_MOD_PCAP
+ prompt " ulogd-mod-pcap................. Output plugin for logging into pcap format"
+ tristate
+ default n
+ depends ADK_PACKAGE_ULOGD
+ select ADK_PACKAGE_LIBPCAP
+
+config ADK_PACKAGE_ULOGD_MOD_PGSQL
+ prompt " ulogd-mod-pgsql............... Output plugin for logging into a PostgreSQL database"
+ tristate
+ default n
+ depends ADK_PACKAGE_ULOGD
+ select ADK_PACKAGE_LIBPQ
+
+config ADK_PACKAGE_ULOGD_MOD_SQLITE
+ prompt " ulogd-mod-sqlite.............. Output plugin for logging into an SQLite database"
+ tristate
+ default n
+ depends ADK_PACKAGE_ULOGD
+ select ADK_PACKAGE_LIBSQLITE
+
+config ADK_PACKAGE_ULOGD_MOD_EXTRA
+ prompt " ulogd-mod-extra............... All other plugins"
+ tristate
+ default n
+ depends ADK_PACKAGE_ULOGD
+
+#endmenu
diff --git a/package/ulogd/Makefile b/package/ulogd/Makefile
new file mode 100644
index 000000000..2135669c1
--- /dev/null
+++ b/package/ulogd/Makefile
@@ -0,0 +1,92 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ulogd
+PKG_VERSION:= 1.24
+PKG_RELEASE:= 7
+PKG_MD5SUM:= 05b4ed2926b9a22aaeaf642917bbf8ff
+MASTER_SITES:= ftp://ftp.netfilter.org/pub/ulogd/ \
+ ftp://ftp.be.netfilter.org/pub/netfilter/ulogd/ \
+ ftp://ftp.de.netfilter.org/pub/netfilter/ulogd/ \
+ ftp://ftp.no.netfilter.org/pub/netfilter/ulogd/
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ULOGD,ulogd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,ULOGD_MOD_MYSQL,ulogd-mod-mysql,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,ULOGD_MOD_PCAP,ulogd-mod-pcap,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,ULOGD_MOD_PGSQL,ulogd-mod-pgsql,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,ULOGD_MOD_SQLITE,ulogd-mod-sqlite,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,ULOGD_MOD_EXTRA,ulogd-mod-extra,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+SUB_INSTALLS-y:=
+SUB_INSTALLS-m:=
+SUB_INSTALLS-${ADK_PACKAGE_ULOGD_MOD_PCAP}+= ulogd-mod-pcap-install
+SUB_INSTALLS-${ADK_PACKAGE_ULOGD_MOD_MYSQL}+= ulogd-mod-mysql-install
+SUB_INSTALLS-${ADK_PACKAGE_ULOGD_MOD_PGSQL}+= ulogd-mod-pgsql-install
+SUB_INSTALLS-${ADK_PACKAGE_ULOGD_MOD_SQLITE}+= ulogd-mod-sqlite-install
+SUB_INSTALLS-${ADK_PACKAGE_ULOGD_MOD_EXTRA}+= ulogd-mod-extra-install
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+ifneq (${ADK_PACKAGE_ULOGD_MOD_PCAP},)
+CONFIGURE_ENV+= ac_cv_header_pcap_h=yes
+else
+CONFIGURE_ENV+= ac_cv_header_pcap_h=no
+endif
+
+ifneq (${ADK_PACKAGE_ULOGD_MOD_MYSQL},)
+CONFIGURE_ARGS+= --with-mysql=${STAGING_DIR}/usr
+endif
+
+ifneq (${ADK_PACKAGE_ULOGD_MOD_PGSQL},)
+CONFIGURE_ARGS+= --with-pgsql=${STAGING_DIR}/usr
+endif
+
+ifneq (${ADK_PACKAGE_ULOGD_MOD_SQLITE},)
+CONFIGURE_ARGS+= --with-sqlite3=${STAGING_DIR}/usr
+endif
+
+post-install: ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
+ ${INSTALL_DIR} ${IDIR_ULOGD}/etc/init.d/
+ ${INSTALL_DATA} ${WRKINST}/etc/ulogd.conf ${IDIR_ULOGD}/etc/
+ ${INSTALL_BIN} ./files/ulogd.init \
+ ${IDIR_ULOGD}/etc/init.d/ulogd
+ ${INSTALL_DIR} ${IDIR_ULOGD}/usr/lib/ulogd/
+ ${INSTALL_BIN} ${WRKINST}/usr/lib/ulogd/ulogd_BASE.so ${IDIR_ULOGD}/usr/lib/ulogd/
+ ${INSTALL_DIR} ${IDIR_ULOGD}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/ulogd ${IDIR_ULOGD}/usr/sbin/
+
+ulogd-mod-extra-install:
+ ${INSTALL_DIR} ${IDIR_ULOGD_MOD_EXTRA}/usr/lib/ulogd
+ ${CP} ${WRKINST}/usr/lib/ulogd/ulogd_{LOCAL,LOGEMU,OPRINT,PWSNIFF,SYSLOG}.so \
+ ${IDIR_ULOGD_MOD_EXTRA}/usr/lib/ulogd
+
+ulogd-mod-pcap-install:
+ ${INSTALL_DIR} ${IDIR_ULOGD_MOD_PCAP}/usr/lib/ulogd
+ ${CP} ${WRKINST}/usr/lib/ulogd/ulogd_PCAP.so \
+ ${IDIR_ULOGD_MOD_PCAP}/usr/lib/ulogd
+
+ulogd-mod-sqlite-install:
+ ${INSTALL_DIR} ${IDIR_ULOGD_MOD_SQLITE}/usr/lib/ulogd
+ ${CP} ${WRKINST}/usr/lib/ulogd/ulogd_SQLITE3.so \
+ ${IDIR_ULOGD_MOD_SQLITE}/usr/lib/ulogd
+
+ulogd-mod-pgsql-install:
+ ${INSTALL_DIR} ${IDIR_ULOGD_MOD_PGSQL}/usr/lib/ulogd
+ ${CP} ${WRKINST}/usr/lib/ulogd/ulogd_PGSQL.so \
+ ${IDIR_ULOGD_MOD_PGSQL}/usr/lib/ulogd
+
+ulogd-mod-mysql-install:
+ ${INSTALL_DIR} ${IDIR_ULOGD_MOD_MYSQL}/usr/lib/ulogd
+ ${CP} ${WRKINST}/usr/lib/ulogd/ulogd_MYSQL.so \
+ ${IDIR_ULOGD_MOD_MYSQL}/usr/lib/ulogd
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ulogd/files/ulogd.init b/package/ulogd/files/ulogd.init
new file mode 100644
index 000000000..34cbfe7b6
--- /dev/null
+++ b/package/ulogd/files/ulogd.init
@@ -0,0 +1,22 @@
+#!/bin/sh
+#FWINIT 49
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${ulogd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ ulogd -d
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/ulogd/ipkg/ulogd-mod-extra.control b/package/ulogd/ipkg/ulogd-mod-extra.control
new file mode 100644
index 000000000..95332ba34
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd-mod-extra.control
@@ -0,0 +1,5 @@
+Package: ulogd-mod-extra
+Priority: optional
+Section: net
+Description: Netfilter userspace logging daemon (extra plugins)
+Depends: ulogd
diff --git a/package/ulogd/ipkg/ulogd-mod-mysql.control b/package/ulogd/ipkg/ulogd-mod-mysql.control
new file mode 100644
index 000000000..3556bb155
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd-mod-mysql.control
@@ -0,0 +1,5 @@
+Package: ulogd-mod-mysql
+Priority: optional
+Section: net
+Description: Netfilter userspace logging daemon (MySQL plugin)
+Depends: libmysqlclient, ulogd
diff --git a/package/ulogd/ipkg/ulogd-mod-pcap.control b/package/ulogd/ipkg/ulogd-mod-pcap.control
new file mode 100644
index 000000000..521ad94e8
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd-mod-pcap.control
@@ -0,0 +1,5 @@
+Package: ulogd-mod-pcap
+Priority: optional
+Section: net
+Description: Netfilter userspace logging daemon (PCAP plugin)
+Depends: libpcap, ulogd
diff --git a/package/ulogd/ipkg/ulogd-mod-pgsql.control b/package/ulogd/ipkg/ulogd-mod-pgsql.control
new file mode 100644
index 000000000..dbc97765d
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd-mod-pgsql.control
@@ -0,0 +1,5 @@
+Package: ulogd-mod-pgsql
+Priority: optional
+Section: net
+Description: Netfilter userspace logging daemon (PostgreSQL plugin)
+Depends: libpq, ulogd
diff --git a/package/ulogd/ipkg/ulogd-mod-sqlite.control b/package/ulogd/ipkg/ulogd-mod-sqlite.control
new file mode 100644
index 000000000..d76b2d62f
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd-mod-sqlite.control
@@ -0,0 +1,5 @@
+Package: ulogd-mod-sqlite
+Priority: optional
+Section: net
+Description: Netfilter userspace logging daemon (SQLite plugin)
+Depends: libsqlite, ulogd
diff --git a/package/ulogd/ipkg/ulogd.conffiles b/package/ulogd/ipkg/ulogd.conffiles
new file mode 100644
index 000000000..287b91c95
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd.conffiles
@@ -0,0 +1 @@
+/etc/ulogd.conf
diff --git a/package/ulogd/ipkg/ulogd.control b/package/ulogd/ipkg/ulogd.control
new file mode 100644
index 000000000..48eda41f3
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd.control
@@ -0,0 +1,4 @@
+Package: ulogd
+Priority: optional
+Section: net
+Description: Netfilter userspace logging daemon
diff --git a/package/ulogd/ipkg/ulogd.postinst b/package/ulogd/ipkg/ulogd.postinst
new file mode 100644
index 000000000..86e3d4348
--- /dev/null
+++ b/package/ulogd/ipkg/ulogd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf ulogd ulogd NO
diff --git a/package/ulogd/patches/patch-Rules_make_in b/package/ulogd/patches/patch-Rules_make_in
new file mode 100644
index 000000000..454248384
--- /dev/null
+++ b/package/ulogd/patches/patch-Rules_make_in
@@ -0,0 +1,12 @@
+$Id$
+--- ulogd-1.24.orig/Rules.make.in 2005-11-25 19:58:27.000000000 +0000
++++ ulogd-1.24/Rules.make.in 2007-02-15 21:22:28.000000000 +0000
+@@ -22,7 +22,7 @@ CFLAGS=@CFLAGS@ @CPPFLAGS@ -Wall
+ CFLAGS+=-DULOGD_CONFIGFILE=\"$(ULOGD_CONFIGFILE)\"
+ # doesn't work for subdirs
+ #CFLAGS+=$(INCIPULOG) $(INCCONFFILE)
+-CFLAGS+=-I/lib/modules/`uname -r`/build/include
++#CFLAGS+=-I/lib/modules/`uname -r`/build/include
+ #CFLAGS+=@DEFS@
+ #CFLAGS+=-g -DDEBUG -DDEBUG_MYSQL -DDEBUG_PGSQL
+
diff --git a/package/ulogd/patches/patch-libipulog_Makefile_in b/package/ulogd/patches/patch-libipulog_Makefile_in
new file mode 100644
index 000000000..8ce425d83
--- /dev/null
+++ b/package/ulogd/patches/patch-libipulog_Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- ulogd-1.24.orig/libipulog/Makefile.in 2005-11-25 19:58:25.000000000 +0000
++++ ulogd-1.24/libipulog/Makefile.in 2007-02-15 21:29:49.000000000 +0000
+@@ -1,7 +1,7 @@
+ #
+
+ include @top_srcdir@/Rules.make
+-CFLAGS+=-Iinclude -I/usr/src/linux/include
++CFLAGS+=-Iinclude
+
+ libipulog.a: libipulog.o
+ $(LD) -i $< -o $@
diff --git a/package/ulogd/patches/patch-mysql_Makefile_in b/package/ulogd/patches/patch-mysql_Makefile_in
new file mode 100644
index 000000000..e019da0ff
--- /dev/null
+++ b/package/ulogd/patches/patch-mysql_Makefile_in
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ulogd-1.24.orig/mysql/Makefile.in 2005-11-25 20:58:27.000000000 +0100
++++ ulogd-1.24/mysql/Makefile.in 2008-10-16 10:38:34.000000000 +0200
+@@ -14,7 +14,7 @@ all: $(SHARED_LIBS)
+ distrib:
+
+ $(SHARED_LIBS): %.so: %_sh.o
+- $(LD) -shared $(MYSQL_LDFLAGS) -o $@ $< -lc
++ $(LD) -shared -o $@ $< -lc
+
+ %_sh.o: %.c
+ $(CC) $(MYSQL_CFLAGS) $(SH_CFLAGS) -o $@ -c $<
diff --git a/package/updatedd/Config.in b/package/updatedd/Config.in
new file mode 100644
index 000000000..763961614
--- /dev/null
+++ b/package/updatedd/Config.in
@@ -0,0 +1,67 @@
+
+config ADK_PACKAGE_UPDATEDD
+ prompt "updatedd.......................... A tool to update dynamic DNS services"
+ tristate
+ default n
+ help
+ Updatedd is a small tool that will update one of many dynamic
+ dns services on boot.
+
+ Please look at the /etc/init.d/S50ddns script for more info.
+
+ http://www.philipp-benner.de/updatedd/
+
+config ADK_PACKAGE_UPDATEDD_MOD_CHANGEIP
+ prompt "updatedd-mod-changeip........... changeip.com"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_DYNDNS
+ prompt "updatedd-mod-dyndns............. dyndns.org"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_EURODYNDNS
+ prompt "updatedd-mod-eurodyndns......... eurodyndns.org"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_HN
+ prompt "updatedd-mod-hn................. hn.org"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_NOIP
+ prompt "updatedd-mod-noip............... no-ip.com"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_ODS
+ prompt "updatedd-mod-ods................ ods.org"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_OVH
+ prompt "updatedd-mod-ovh................ ovh.com"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_REGFISH
+ prompt "updatedd-mod-regfish............ regfish.com"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
+config ADK_PACKAGE_UPDATEDD_MOD_TZO
+ prompt "updatedd-mod-tzo................ tzo.com"
+ tristate
+ depends ADK_PACKAGE_UPDATEDD
+ default n
+
diff --git a/package/updatedd/Makefile b/package/updatedd/Makefile
new file mode 100644
index 000000000..c6c1b555d
--- /dev/null
+++ b/package/updatedd/Makefile
@@ -0,0 +1,52 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= updatedd
+PKG_VERSION:= 2.6
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 95655596eb6e0e381d60a458f6a45fee
+MASTER_SITES:= http://savannah.nongnu.org/download/updatedd/
+DISTFILES:= ${PKG_NAME}_${PKG_VERSION}.tar.gz
+
+include ${TOPDIR}/mk/package.mk
+
+define PKG_libinstall
+${INSTALL_DIR} ${IDIR_${1}}/usr/lib/updatedd
+${INSTALL_BIN} ${WRKINST}/usr/lib/updatedd/lib${2}.so ${IDIR_${1}}/usr/lib/updatedd/
+endef
+
+$(eval $(call PKG_template,UPDATEDD,updatedd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_CHANGEIP,updatedd-mod-changeip,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_DYNDNS,updatedd-mod-dyndns,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_EURODYNDNS,updatedd-mod-eurodyndns,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_HN,updatedd-mod-hn,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_NOIP,updatedd-mod-noip,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_ODS,updatedd-mod-ods,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_OVH,updatedd-mod-ovh,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_REGFISH,updatedd-mod-regfish,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,UPDATEDD_MOD_TZO,updatedd-mod-tzo,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_UPDATEDD}/etc/init.d
+ ${INSTALL_DIR} ${IDIR_UPDATEDD}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/updatedd ${IDIR_UPDATEDD}/usr/bin/
+ ${INSTALL_DIR} ${IDIR_UPDATEDD}/usr/lib/updatedd
+ $(call PKG_libinstall,UPDATEDD_MOD_CHANGEIP,changeip)
+ $(call PKG_libinstall,UPDATEDD_MOD_DYNDNS,dyndns)
+ $(call PKG_libinstall,UPDATEDD_MOD_EURODYNDNS,eurodyndns)
+ $(call PKG_libinstall,UPDATEDD_MOD_HN,hn)
+ $(call PKG_libinstall,UPDATEDD_MOD_NOIP,noip)
+ $(call PKG_libinstall,UPDATEDD_MOD_ODS,ods)
+ $(call PKG_libinstall,UPDATEDD_MOD_OVH,ovh)
+ $(call PKG_libinstall,UPDATEDD_MOD_REGFISH,regfish)
+ $(call PKG_libinstall,UPDATEDD_MOD_TZO,tzo)
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/updatedd/ipkg/updatedd-mod-changeip.control b/package/updatedd/ipkg/updatedd-mod-changeip.control
new file mode 100644
index 000000000..986752b77
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-changeip.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-changeip
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for changeip.com dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-dyndns.control b/package/updatedd/ipkg/updatedd-mod-dyndns.control
new file mode 100644
index 000000000..93c62fd47
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-dyndns.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-dyndns
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for dyndns.org dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-eurodyndns.control b/package/updatedd/ipkg/updatedd-mod-eurodyndns.control
new file mode 100644
index 000000000..f29e59810
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-eurodyndns.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-eurodyndns
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for eurodyndns.org dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-hn.control b/package/updatedd/ipkg/updatedd-mod-hn.control
new file mode 100644
index 000000000..d5b57c076
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-hn.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-hn
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for hn.org dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-noip.control b/package/updatedd/ipkg/updatedd-mod-noip.control
new file mode 100644
index 000000000..925bd7685
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-noip.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-noip
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for no-ip.org dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-ods.control b/package/updatedd/ipkg/updatedd-mod-ods.control
new file mode 100644
index 000000000..e47b4a6e3
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-ods.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-ods
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for ods.org dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-ovh.control b/package/updatedd/ipkg/updatedd-mod-ovh.control
new file mode 100644
index 000000000..d1eb9f219
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-ovh.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-ovh
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for ovh.com dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-regfish.control b/package/updatedd/ipkg/updatedd-mod-regfish.control
new file mode 100644
index 000000000..f17fffe87
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-regfish.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-regfish
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for regfish.com dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd-mod-tzo.control b/package/updatedd/ipkg/updatedd-mod-tzo.control
new file mode 100644
index 000000000..089dfde07
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd-mod-tzo.control
@@ -0,0 +1,4 @@
+Package: updatedd-mod-tzo
+Priority: optional
+Section: net
+Description: Plugin for updatedd, support for tzo.com dynamic DNS service.
diff --git a/package/updatedd/ipkg/updatedd.control b/package/updatedd/ipkg/updatedd.control
new file mode 100644
index 000000000..f3eafcb48
--- /dev/null
+++ b/package/updatedd/ipkg/updatedd.control
@@ -0,0 +1,4 @@
+Package: updatedd
+Priority: optional
+Section: net
+Description: A tool to update dynamic dns services.
diff --git a/package/usbutils/Config.in b/package/usbutils/Config.in
new file mode 100644
index 000000000..e73eb1008
--- /dev/null
+++ b/package/usbutils/Config.in
@@ -0,0 +1,15 @@
+config ADK_COMPILE_USBUTILS
+ tristate
+ depends ADK_PACKAGE_LSUSB
+
+config ADK_PACKAGE_LSUSB
+ prompt "lsusb............................. USB devices listing program"
+ tristate
+ default n
+ select ADK_COMPILE_USBUTILS
+ select ADK_PACKAGE_LIBUSB
+ help
+ A program to list Linux USB devices
+
+ http://linux-usb.sourceforge.net/
+
diff --git a/package/usbutils/Makefile b/package/usbutils/Makefile
new file mode 100644
index 000000000..3f839fdd6
--- /dev/null
+++ b/package/usbutils/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= usbutils
+PKG_VERSION:= 0.73
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 88978b4ad891f610620b1b8e5e0f43eb
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=linux-usb/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,LSUSB,lsusb,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_LSUSB}/usr/share
+ ${INSTALL_DATA} ${WRKINST}/usr/share/usb.ids.gz ${IDIR_LSUSB}/usr/share/
+ ${INSTALL_DIR} ${IDIR_LSUSB}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/lsusb ${IDIR_LSUSB}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/usbutils/ipkg/lsusb.control b/package/usbutils/ipkg/lsusb.control
new file mode 100644
index 000000000..e9c6dbcc4
--- /dev/null
+++ b/package/usbutils/ipkg/lsusb.control
@@ -0,0 +1,5 @@
+Package: lsusb
+Priority: optional
+Section: net
+Depends: libusb
+Description: A program to list USB devices
diff --git a/package/ussp-push/Config.in b/package/ussp-push/Config.in
new file mode 100644
index 000000000..187d0a7af
--- /dev/null
+++ b/package/ussp-push/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_USSP_PUSH
+ prompt "ussp-push......................... obex push application"
+ tristate
+ default n
+ help
+ ussp-push is a OBEX object pusher for Linux, using the
+ BlueZ BlueTooth stack.
+
+ http://xmailserver.org/ussp-push.html
diff --git a/package/ussp-push/Makefile b/package/ussp-push/Makefile
new file mode 100644
index 000000000..092e137a9
--- /dev/null
+++ b/package/ussp-push/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ussp-push
+PKG_VERSION:= 0.11
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 5c44983ee27809867041feff6bb4423a
+
+MASTER_SITES:= http://xmailserver.org/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,USSP_PUSH,ussp-push,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+MAKE_FLAGS+= OBEXINC="${TCPPFLAGS}" \
+ OBEXLIB="${TLDFLAGS} -lopenobex -lbluetooth"
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_USSP_PUSH}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/ussp-push ${IDIR_USSP_PUSH}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ussp-push/ipkg/ussp-push.control b/package/ussp-push/ipkg/ussp-push.control
new file mode 100644
index 000000000..b204cdd3b
--- /dev/null
+++ b/package/ussp-push/ipkg/ussp-push.control
@@ -0,0 +1,5 @@
+Package: ussp-push
+Priority: optional
+Section: bluetooth
+Depends: openobex
+Description: obex push
diff --git a/package/ussp-push/patches/patch-src_obex_socket_c b/package/ussp-push/patches/patch-src_obex_socket_c
new file mode 100644
index 000000000..770775175
--- /dev/null
+++ b/package/ussp-push/patches/patch-src_obex_socket_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- ussp-push-0.11.orig/src/obex_socket.c 2008-08-24 22:48:53.000000000 +0200
++++ ussp-push-0.11/src/obex_socket.c 2008-10-16 11:08:10.000000000 +0200
+@@ -197,7 +197,7 @@ static int bt_sock_name2bth(int devid, c
+ for (i = 0; i < niinf; i++) {
+ char devname[128];
+
+- if (hci_remote_name(dd, &piinf[i].bdaddr, sizeof(devname) - 1,
++ if (hci_read_remote_name(dd, &piinf[i].bdaddr, sizeof(devname) - 1,
+ devname, 100000) >= 0) {
+ if (strcasecmp(devname, btname) == 0) {
+ *btaddr = piinf[i].bdaddr;
+@@ -297,7 +297,7 @@ static int cobex_init(struct cobex_conte
+ gt->wfd = gt->rfd;
+
+ tcgetattr(gt->rfd, &gt->oldtio);
+- bzero(&gt->newtio, sizeof(struct termios));
++ memset(&gt->newtio, 0, sizeof(struct termios));
+ gt->newtio.c_cflag = B115200 | CS8 | CREAD;
+ gt->newtio.c_iflag = IGNPAR;
+ gt->newtio.c_oflag = 0;
diff --git a/package/ustl/Config.in b/package/ustl/Config.in
new file mode 100644
index 000000000..b2f7959c0
--- /dev/null
+++ b/package/ustl/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_USTL
+ prompt "ustl.............................. C++ Standard Template Library for embedded systems"
+ tristate
+ default n
+ depends on ADK_CXX
+ help
+ uSTL is a partial implementation of the STL (Standard Template
+ Library) that reduces code size by factoring memory management
+ code into a non-template base class and deriving containers
+ from it.
+
+ http://ustl.sourceforge.net/
+
diff --git a/package/ustl/Makefile b/package/ustl/Makefile
new file mode 100644
index 000000000..0a6cae1e9
--- /dev/null
+++ b/package/ustl/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= ustl
+PKG_VERSION:= 0.8
+PKG_RELEASE:= 1
+PKG_MD5SUM:= dd59483c327f1bd1356273bc5ae4dde0
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=ustl/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}-0.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,USTL,ustl,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+XAKE_FLAGS+= CROSS="${TARGET_CROSS}" \
+ OPTFLAGS="${TARGET_CFLAGS}"
+
+do-configure:
+ ${CP} ./files/config.h ${WRKBUILD}/
+ ${CP} ./files/Common.mk ${WRKBUILD}/
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_USTL}/usr/lib
+ ${CP} ${WRKINST}/usr/lib/libustl.so* ${IDIR_USTL}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/ustl/files/Common.mk b/package/ustl/files/Common.mk
new file mode 100644
index 000000000..88e62329d
--- /dev/null
+++ b/package/ustl/files/Common.mk
@@ -0,0 +1,74 @@
+LIBNAME = ustl
+MAJOR = 0
+MINOR = 8
+BUILD = 0
+
+CC = $(CROSS)gcc
+CXX = $(CROSS)g++
+LD = $(CROSS)gcc
+AR = $(CROSS)ar
+RANLIB = $(CROSS)ranlib
+DOXYGEN = echo
+INSTALL = install
+RM = rm -f
+LN = ln -sf
+
+prefix = /usr
+exec_prefix = /usr
+BINDIR = /usr/bin
+INCDIR = /usr/include
+LIBDIR = /usr/lib
+
+DESTDIR =
+
+INSTALLDIR = ${INSTALL} -d
+INSTALLLIB = ${INSTALL} -p -m 644
+INSTALLEXE = ${INSTALL} -p -m 755
+INSTALLDATA = ${INSTALL} -p -m 644
+
+CWARNOPTS = -Wall -W -Wpointer-arith -Wno-cast-align \
+ -Wcast-qual -Wwrite-strings -Wredundant-decls
+CXXWARNOPTS = ${CWARNOPTS} -Wconversion -Wsign-promo -Wsynth -Woverloaded-virtual
+PROCESSOR_OPTS =
+INLINE_OPTS = -finline-limit=65535
+CUSTOMINCDIR =
+CUSTOMLIBDIR =
+
+BUILD_SHARED = 1
+BUILD_STATIC = 1
+#DEBUG = 1
+#PROFILE = 1
+STANDALONE = -nodefaultlibs
+
+CFLAGS = \
+ ${CUSTOMINCDIR} ${OPTFLAGS} ${CWARNOPTS} ${STANDALONE}
+CXXFLAGS = \
+ ${CUSTOMINCDIR} ${OPTFLAGS} ${INLINE_OPTS} \
+ ${CXXWARNOPTS} ${STANDALONE} -fno-builtin
+LDFLAGS = ${CUSTOMLIBDIR} ${STANDALONE}
+OPTFLAGS = ${PROCESSOR_OPTS}
+ifdef DEBUG
+ OPTFLAGS += -O0 -g
+else
+ OPTFLAGS += -O3 -DNDEBUG=1
+endif
+ifdef PROFILE
+ OPTFLAGS += -pg
+endif
+ifdef STANDALONE
+ LIBS += -lsupc++ -lgcc_eh -lgcc -lc
+endif
+ifdef BUILD_SHARED
+ CFLAGS += -fPIC
+ CXXFLAGS += -fPIC
+endif
+SHBLDFL = -shared
+
+LIBA = lib${LIBNAME}.a
+LIBSO = lib${LIBNAME}.so
+ifdef MAJOR
+LIBSOLNK = ${LIBSO}.${MAJOR}.${MINOR}
+LIBSOBLD = ${LIBSO}.${MAJOR}.${MINOR}.${BUILD}
+endif
+TOCLEAN += ${LIBSO} ${LIBA} ${LIBSOBLD}
+
diff --git a/package/ustl/files/config.h b/package/ustl/files/config.h
new file mode 100644
index 000000000..348649678
--- /dev/null
+++ b/package/ustl/files/config.h
@@ -0,0 +1,286 @@
+// config.h
+//
+// Autogenerated from config.h.in by bsconf.
+//
+
+#ifndef CONFIG_H_01E33670634DAAC779EE5FF41CCBB36F
+#define CONFIG_H_01E33670634DAAC779EE5FF41CCBB36F
+
+// Define to the one symbol short name of this package.
+#define USTL_NAME "ustl"
+// Define to the full name and version of this package.
+#define USTL_STRING "ustl 0.8"
+// Define to the version of this package.
+#define USTL_VERSION 0x080
+// Define to the address where bug reports for this package should be sent.
+#define USTL_BUGREPORT "Mike Sharov <msharov@users.sourceforge.net>"
+
+/// Define to 1 if you want stream operations to throw exceptions on
+/// insufficient data or insufficient space. All these errors should
+/// be preventable in output code; the input code should verify the
+/// data in a separate step. It slows down stream operations a lot,
+/// but it's your call. By default only debug builds throw.
+///
+#undef WANT_STREAM_BOUNDS_CHECKING
+
+#if !defined(WANT_STREAM_BOUNDS_CHECKING) && !defined(NDEBUG)
+ #define WANT_STREAM_BOUNDS_CHECKING 1
+#endif
+
+/// Define to 1 if you want to build without libstdc++
+#define WITHOUT_LIBSTDCPP 1
+
+/// Define to 1 if you don't want the standard streams.
+/// You will not be able to run bvt tests if you do this.
+///
+#undef WITHOUT_CIN_COUT_CERR
+
+/// Define GNU extensions if unavailable.
+#ifndef __GNUC__
+ /// GCC (and some other compilers) define '__attribute__'; ustl is using this
+ /// macro to alert the compiler to flag inconsistencies in printf/scanf-like
+ /// function calls. Just in case '__attribute__' isn't defined, make a dummy.
+ ///
+ #ifndef __attribute__
+ #define __attribute__(p)
+ #endif
+#endif
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+ #define DLL_EXPORT __attribute__((visibility("default")))
+ #define DLL_LOCAL __attribute__((visibility("hidden")))
+#else
+ #define DLL_EXPORT
+ #define DLL_LOCAL
+#endif
+#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(__i386__)
+ /// GCC 3+ supports the prefetch directive, which some CPUs use to improve caching
+ #define prefetch(p,rw,loc) __builtin_prefetch(p,rw,loc)
+#else
+ #define prefetch(p,rw,loc)
+#endif
+#if !defined(__GNUC__) || (__GNUC__ < 3)
+ /// __alignof__ returns the recommended alignment for the type
+ #define __alignof__(v) min(sizeof(v), sizeof(void*))
+#endif
+
+/// Define to 1 if you have the `atexit' function.
+#define HAVE_ATEXIT 1
+
+/// Define to 1 if you have the <assert.h> header file.
+#define HAVE_ASSERT_H 1
+
+/// Define to 1 if you have the <ctype.h> header file.
+#define HAVE_CTYPE_H 1
+
+/// Define to 1 if you have the <errno.h> header file.
+#define HAVE_ERRNO_H 1
+
+/// Define to 1 if you have the <fcntl.h> header file.
+#define HAVE_FCNTL_H 1
+
+/// Define to 1 if you have the <float.h> header file.
+#define HAVE_FLOAT_H 1
+
+/// Define to 1 if you have the <inttypes.h> header file.
+#define HAVE_INTTYPES_H 1
+
+/// Define to 1 if you have the <limits.h> header file.
+#define HAVE_LIMITS_H 1
+
+/// Define to 1 if you have the <locale.h> header file.
+#define HAVE_LOCALE_H 1
+
+/// Define to 1 if your system has a working `malloc' function.
+#define HAVE_MALLOC 1
+
+// Define to 1 if you have the <malloc.h> header file.
+#define HAVE_MALLOC_H 1
+
+// Define to 1 if you have the <alloca.h> header file.
+#define HAVE_ALLOCA_H 1
+
+// Define to 1 if you have the `memchr' function.
+#define HAVE_MEMCHR 1
+
+// Define to 1 if you have the `memmove' function.
+#define HAVE_MEMMOVE 1
+
+// Define to 1 if you have the <memory.h> header file.
+#define HAVE_MEMORY_H 1
+
+// Define to 1 if you have the `memset' function.
+#define HAVE_MEMSET 1
+
+// Define to 1 if the system has the type `ptrdiff_t'.
+#define HAVE_PTRDIFF_T 1
+
+// Define to 1 if you have the <signal.h> header file.
+#define HAVE_SIGNAL_H 1
+
+// Define to 1 if you have the __va_copy function
+#define HAVE_VA_COPY 1
+
+// Define to 1 if `stat' has the bug that it succeeds when given the
+// zero-length file name argument.
+/* #undef HAVE_STAT_EMPTY_STRING_BUG */
+
+// Define to 1 if you have the <stdarg.h> header file.
+#define HAVE_STDARG_H 1
+
+// Define to 1 if you have the <stddef.h> header file.
+#define HAVE_STDDEF_H 1
+
+// Define to 1 if you have the <stdint.h> header file.
+#define HAVE_STDINT_H 1
+
+// Define to 1 if you have the <stdio.h> header file.
+#define HAVE_STDIO_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 `strerror' function.
+#define HAVE_STRERROR 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 `strrchr' function.
+#define HAVE_STRRCHR 1
+
+// Define to 1 if you have the `strsignal' function.
+#define HAVE_STRSIGNAL 1
+
+// Define to 1 if you have the `strtol' function.
+#define HAVE_STRTOL 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/types.h> header file.
+#define HAVE_SYS_TYPES_H 1
+
+// Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible.
+#define HAVE_SYS_WAIT_H 1
+
+// Define to 1 if you have the <time.h> header file.
+#define HAVE_TIME_H 1
+
+// Define to 1 if you have the <unistd.h> header file.
+#define HAVE_UNISTD_H 1
+
+// Define to 1 if you have the <math.h> header file.
+#define HAVE_MATH_H 1
+
+// Define to 1 if you have the rintf function. Will use rint otherwise.
+#undef HAVE_RINTF
+
+// STDC_HEADERS is defined to 1 on sane systems.
+#if defined(HAVE_ASSERT_H) && defined(HAVE_CTYPE_H) &&\
+ defined(HAVE_ERRNO_H) && defined(HAVE_FLOAT_H) &&\
+ defined(HAVE_LIMITS_H) && defined(HAVE_LOCALE_H) &&\
+ defined(HAVE_MATH_H) && defined(HAVE_SIGNAL_H) &&\
+ defined(HAVE_STDARG_H) && defined(HAVE_STDDEF_H) &&\
+ defined(HAVE_STDIO_H) && defined(HAVE_STDLIB_H) &&\
+ defined(HAVE_STRING_H) && defined(HAVE_TIME_H)
+#define STDC_HEADERS 1
+#endif
+
+// STDC_HEADERS is defined to 1 on unix systems.
+#if defined(HAVE_FCNTL_H) && defined(HAVE_SYS_STAT_H) && defined(HAVE_UNISTD_H)
+#define STDUNIX_HEADERS 1
+#endif
+
+// Define to 1 if you have the <byteswap.h> header file.
+#if (__GNUC__ >= 3) // gcc 2.95 somehow doesn't recognize 'asm volatile' in libc byteswap.h
+#define HAVE_BYTESWAP_H 1
+#endif
+
+// Define to 1 if `lstat' dereferences a symlink specified with a trailing slash.
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+
+// Define to 1 if your compiler treats char as a separate type along with
+// signed char and unsigned char. This will create overloads for char.
+#define HAVE_THREE_CHAR_TYPES 1
+
+// Define as the return type of signal handlers (`int' or `void').
+#define RETSIGTYPE void
+
+// Define to 1 if you have 64 bit types available
+#define HAVE_INT64_T 1
+
+// Define to 1 if you have the long long type
+#define HAVE_LONG_LONG 1
+
+// Define to 1 if you want unrolled specializations for fill and copy
+#undef WANT_UNROLLED_COPY
+
+// Define to 1 if you want to use MMX/SSE/3dNow! processor instructions
+#undef WANT_MMX
+
+// Define to byte sizes of types
+#define SIZE_OF_CHAR 1
+#define SIZE_OF_SHORT 2
+#define SIZE_OF_INT 4
+#define SIZE_OF_LONG 4
+#define SIZE_OF_LONG_LONG 8
+#define SIZE_OF_POINTER 4
+#define SIZE_OF_SIZE_T 4
+#define SIZE_OF_BOOL SIZE_OF_CHAR
+#undef SIZE_T_IS_LONG
+
+// Byte order macros, converted in utypes.h
+#define USTL_LITTLE_ENDIAN 4321
+#define USTL_BIG_ENDIAN 1234
+#define USTL_BYTE_ORDER USTL_LITTLE_ENDIAN
+
+// Extended CPU capabilities
+#define CPU_HAS_FPU 1
+#define CPU_HAS_EXT_DEBUG 1
+#define CPU_HAS_TIMESTAMPC 1
+#define CPU_HAS_MSR 1
+#define CPU_HAS_CMPXCHG8 1
+#define CPU_HAS_APIC 1
+#define CPU_HAS_SYSCALL 1
+#define CPU_HAS_MTRR 1
+#define CPU_HAS_CMOV 1
+#define CPU_HAS_FCMOV 1
+#if WANT_MMX
+#undef CPU_HAS_MMX 1
+#undef CPU_HAS_FXSAVE
+#undef CPU_HAS_SSE 1
+#undef CPU_HAS_SSE2 1
+#undef CPU_HAS_SSE3
+#undef CPU_HAS_EXT_3DNOW
+#undef CPU_HAS_3DNOW
+#endif
+
+// GCC vector extensions
+#if defined(CPU_HAS_MMX) || defined(CPU_HAS_SSE)
+ #undef HAVE_VECTOR_EXTENSIONS
+#endif
+
+#if CPU_HAS_SSE && defined(__GNUC__)
+ #define __sse_align __attribute__((aligned(16)))
+#else
+ #define __sse_align
+#endif
+
+// Define to empty if `const' does not conform to ANSI C.
+/* #define const */
+
+// Define as `__inline' if that's what the C compiler calls it, or to nothing
+// if it is not supported.
+/* #define inline __inline */
+
+// Define to `long' if <sys/types.h> does not define.
+/* typedef long off_t; */
+
+// Define to `unsigned' if <sys/types.h> does not define.
+/* typedef long size_t; */
+
+#endif // CONFIG_H_01E33670634DAAC779EE5FF41CCBB36F
+
diff --git a/package/ustl/ipkg/ustl.control b/package/ustl/ipkg/ustl.control
new file mode 100644
index 000000000..210877d62
--- /dev/null
+++ b/package/ustl/ipkg/ustl.control
@@ -0,0 +1,4 @@
+Package: ustl
+Priority: optional
+Section: libs
+Description: An STL (Standard Template Library) for embedded systems
diff --git a/package/ustl/patches/01-install-DESTDIR.patch b/package/ustl/patches/01-install-DESTDIR.patch
new file mode 100644
index 000000000..ec3a959d3
--- /dev/null
+++ b/package/ustl/patches/01-install-DESTDIR.patch
@@ -0,0 +1,56 @@
+diff -ruN ustl-0.8-old/Makefile ustl-0.8-new/Makefile
+--- ustl-0.8-old/Makefile 2005-11-10 21:06:53.000000000 +0100
++++ ustl-0.8-new/Makefile 2005-12-08 13:57:07.000000000 +0100
+@@ -39,35 +39,35 @@
+ .PHONY: install-static install-shared uninstall-static uninstall-shared
+
+ install-shared: ${LIBSOBLD} install-incs
+- @echo "Installing ${LIBSOBLD} to ${LIBDIR} ..."
+- @${INSTALLDIR} ${LIBDIR}
+- @${INSTALLLIB} ${LIBSOBLD} ${LIBDIR}
+- @(cd ${LIBDIR}; ${RM} ${LIBSO} ${LIBSOLNK}; ${LN} -sf ${LIBSOBLD} ${LIBSO}; ${LN} -sf ${LIBSOBLD} ${LIBSOLNK})
++ @echo "Installing ${LIBSOBLD} to ${DESTDIR}${LIBDIR} ..."
++ @${INSTALLDIR} ${DESTDIR}${LIBDIR}
++ @${INSTALLLIB} ${LIBSOBLD} ${DESTDIR}${LIBDIR}
++ @(cd ${DESTDIR}${LIBDIR}; ${RM} ${LIBSO} ${LIBSOLNK}; ${LN} -sf ${LIBSOBLD} ${LIBSO}; ${LN} -sf ${LIBSOBLD} ${LIBSOLNK})
+
+ uninstall-shared: uninstall-incs
+- @echo "Removing ${LIBSOBLD} from ${LIBDIR} ..."
+- @${RM} -f ${LIBDIR}/${LIBSO} ${LIBDIR}/${LIBSOLNK} ${LIBDIR}/${LIBSOBLD}
++ @echo "Removing ${LIBSOBLD} from ${DESTDIR}${LIBDIR} ..."
++ @${RM} -f ${DESTDIR}${LIBDIR}/${LIBSO} ${DESTDIR}${LIBDIR}/${LIBSOLNK} ${DESTDIR}${LIBDIR}/${LIBSOBLD}
+
+ install-static: ${LIBA} install-incs
+- @echo "Installing ${LIBA} to ${LIBDIR} ..."
+- @${INSTALLDIR} ${LIBDIR}
+- @${INSTALLLIB} ${LIBA} ${LIBDIR}
++ @echo "Installing ${LIBA} to ${DESTDIR}${LIBDIR} ..."
++ @${INSTALLDIR} ${DESTDIR}${LIBDIR}
++ @${INSTALLLIB} ${LIBA} ${DESTDIR}${LIBDIR}
+
+ uninstall-static: uninstall-incs
+- @echo "Removing ${LIBA} from ${LIBDIR} ..."
+- @${RM} -f ${LIBDIR}/${LIBA}
++ @echo "Removing ${LIBA} from ${DESTDIR}${LIBDIR} ..."
++ @${RM} -f ${DESTDIR}${LIBDIR}/${LIBA}
+
+ install-incs: ${INCS}
+- @echo "Installing headers to ${INCDIR} ..."
+- @${INSTALLDIR} ${INCDIR}/${LIBNAME}
++ @echo "Installing headers to ${DESTDIR}${INCDIR} ..."
++ @${INSTALLDIR} ${DESTDIR}${INCDIR}/${LIBNAME}
+ @for i in $(filter-out ${LIBNAME}.h,${INCS}); do \
+- ${INSTALLDATA} $$i ${INCDIR}/${LIBNAME}/$$i; \
++ ${INSTALLDATA} $$i ${DESTDIR}${INCDIR}/${LIBNAME}/$$i; \
+ done;
+- @${INSTALLDATA} ${LIBNAME}.h ${INCDIR}
++ @${INSTALLDATA} ${LIBNAME}.h ${DESTDIR}${INCDIR}
+
+ uninstall-incs:
+- @echo "Removing headers from ${INCDIR} ..."
+- @${RM} -rf ${INCDIR}/${LIBNAME} ${INCDIR}/${LIBNAME}.h
++ @echo "Removing headers from ${DESTDIR}${INCDIR} ..."
++ @${RM} -rf ${DESTDIR}${INCDIR}/${LIBNAME} ${DESTDIR}${INCDIR}/${LIBNAME}.h
+
+
+ %.o: %.cc
diff --git a/package/ustl/patches/02-install_path.patch b/package/ustl/patches/02-install_path.patch
new file mode 100644
index 000000000..3a7cf8a05
--- /dev/null
+++ b/package/ustl/patches/02-install_path.patch
@@ -0,0 +1,12 @@
+diff -urN ustl.old/Common.mk.in ustl.dev/Common.mk.in
+--- ustl.old/Common.mk.in 2005-11-10 21:06:53.000000000 +0100
++++ ustl.dev/Common.mk.in 2006-03-23 16:12:05.000000000 +0100
+@@ -9,7 +9,7 @@
+ AR = @AR@
+ RANLIB = @RANLIB@
+ DOXYGEN = @DOXYGEN@
+-INSTALL = @INSTALL@
++INSTALL = install
+ RM = @RM@
+ LN = @LN@
+
diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in
new file mode 100644
index 000000000..2de091d4c
--- /dev/null
+++ b/package/util-linux/Config.in
@@ -0,0 +1,38 @@
+config ADK_COMPILE_UTIL_LINUX
+ tristate
+ default n
+ depends ADK_PACKAGE_FDISK || ADK_PACKAGE_SWAP_UTILS
+
+config ADK_PACKAGE_FDISK
+ prompt "fdisk............................. Partition table manipulation utility"
+ tristate
+ default n
+ select ADK_COMPILE_UTIL_LINUX
+ help
+ A partition table manipulation utility
+
+ http://www.kernel.org/pub/linux/utils/util-linux/
+
+config ADK_PACKAGE_LOSETUP
+ prompt "losetup........................... Loop devices setup and control utility"
+ tristate
+ default n
+ select ADK_COMPILE_UTIL_LINUX
+ select ADK_KPACKAGE_KMOD_BLK_DEV_LOOP
+ help
+ A loop devices setup and control utility
+
+ http://www.kernel.org/pub/linux/utils/util-linux/
+
+config ADK_PACKAGE_SWAP_UTILS
+ prompt "swap-utils........................ Swap space management utilities"
+ tristate
+ default n
+ select ADK_COMPILE_UTIL_LINUX
+ help
+ A collection of tools to manage swap space :
+ * mkswap
+ * swapon
+ * swapoff
+
+ http://www.kernel.org/pub/linux/utils/util-linux/
diff --git a/package/util-linux/Makefile b/package/util-linux/Makefile
new file mode 100644
index 000000000..8ea246a06
--- /dev/null
+++ b/package/util-linux/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= util-linux
+PKG_VERSION:= 2.12r
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c261230b27fc0fbcc287c76884caf2d3
+
+MASTER_SITES:= ftp://ftp.kernel.org/pub/linux/utils/util-linux/ \
+ http://ftp.kernel.org/pub/linux/utils/util-linux/ \
+ ftp://ftp.de.kernel.org/pub/linux/utils/util-linux/ \
+ http://ftp.de.kernel.org/pub/linux/utils/util-linux/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,FDISK,fdisk,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,LOSETUP,losetup,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+$(eval $(call PKG_template,SWAP_UTILS,swap-utils,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+MAKE_FLAGS+= OPT="${TCFLAGS}" ARCH="${ARCH}"
+FAKE_FLAGS+= INSTALLSUID="install -m 4755"
+TCFLAGS+= -DSWAPON_HAS_TWO_ARGS -DHAVE_LLSEEK
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_FDISK}/usr/sbin
+ ${CP} ${WRKINST}/sbin/fdisk ${IDIR_FDISK}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_LOSETUP}/usr/sbin
+ ${CP} ${WRKINST}/sbin/losetup ${IDIR_LOSETUP}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_SWAP_UTILS}/usr/sbin
+ ${CP} ${WRKINST}/sbin/mkswap ${IDIR_SWAP_UTILS}/usr/sbin/
+ ${CP} ${WRKINST}/sbin/swap{on,off} ${IDIR_SWAP_UTILS}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/util-linux/ipkg/fdisk.control b/package/util-linux/ipkg/fdisk.control
new file mode 100644
index 000000000..cf73e98df
--- /dev/null
+++ b/package/util-linux/ipkg/fdisk.control
@@ -0,0 +1,5 @@
+Package: fdisk
+Priority: optional
+Section: admin
+Depends:
+Description: Partition table manipulation utility
diff --git a/package/util-linux/ipkg/losetup.control b/package/util-linux/ipkg/losetup.control
new file mode 100644
index 000000000..502305058
--- /dev/null
+++ b/package/util-linux/ipkg/losetup.control
@@ -0,0 +1,5 @@
+Package: losetup
+Priority: optional
+Section: admin
+Depends: kmod-loop
+Description: Loop devices setup and control utility
diff --git a/package/util-linux/ipkg/swap-utils.control b/package/util-linux/ipkg/swap-utils.control
new file mode 100644
index 000000000..c888251f6
--- /dev/null
+++ b/package/util-linux/ipkg/swap-utils.control
@@ -0,0 +1,5 @@
+Package: swap-utils
+Priority: optional
+Section: admin
+Depends:
+Description: Swap space management utilities
diff --git a/package/util-linux/patches/patch-MCONFIG b/package/util-linux/patches/patch-MCONFIG
new file mode 100644
index 000000000..494d2119c
--- /dev/null
+++ b/package/util-linux/patches/patch-MCONFIG
@@ -0,0 +1,69 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/MCONFIG 2004-12-13 00:15:48.000000000 +0100
++++ util-linux-2.12r/MCONFIG 2008-10-16 11:46:07.000000000 +0200
+@@ -16,8 +16,8 @@
+ # Select for ARCH one of intel, alpha, sparc, arm, m68k, mips
+ # Select for CPU i386 if the binaries must be able to run on an intel 386
+ # (by default i486 code is generated, see below)
+-CPU=$(shell uname -m)
+-ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/')
++CPU=
++ARCH=
+
+ # If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
+ # will use PAM for authentication. Additionally, passwd will not be
+@@ -64,12 +64,12 @@ HAVE_SYSVINIT_UTILS=yes
+ # If HAVE_WRITE is set to "yes", then write will not be built or
+ # installed from the misc-utils subdirectory.
+ # (There is a network aware write in netwrite from NetKit 0.16 or later.)
+-HAVE_WRITE=no
++HAVE_WRITE=yes
+
+ # If HAVE_GETTY is set to "yes", then agetty will not be built or
+ # installed from the login-utils subdirectory. Note that agetty can
+ # co-exist with other gettys, so this option should never be used.
+-HAVE_GETTY=no
++HAVE_GETTY=yes
+
+ # If USE_TTY_GROUP is set to "yes", then wall and write will be installed
+ # setgid to the "tty" group, and mesg will only set the group write bit.
+@@ -82,13 +82,13 @@ USE_TTY_GROUP=yes
+ # If HAVE_KILL is set to "yes", then kill will not be built or
+ # installed from the misc-utils subdirectory.
+ # (There is also a kill in the procps package.)
+-HAVE_KILL=no
++HAVE_KILL=yes
+
+ # If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN
+ # to the current user, allowing her to make a screendump and do other
+ # nifty things on the console, but also allowing him to keep an open
+ # file descriptor after logging out to trick the next user.
+-ALLOW_VCS_USE=yes
++ALLOW_VCS_USE=no
+
+ # If DO_STAT_MAIL is set to "yes", then login will stat() the mailbox
+ # and tell the user that she has new mail. This can hang the login if
+@@ -102,19 +102,19 @@ HAVE_RESET=yes
+ # If HAVE_SLN is set to "yes", then sln won't be installed
+ # (but the man page sln.8 will be installed anyway).
+ # sln also comes with libc and glibc.
+-HAVE_SLN=no
++HAVE_SLN=yes
+
+ # If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed.
+-HAVE_FDUTILS=no
++HAVE_FDUTILS=yes
+
+ # If SILENT_PG is set to "yes", then pg will not ring the bell
+ # when an invalid key is pressed
+-SILENT_PG=no
++SILENT_PG=yes
+
+ # If configure decides that Native Language Support (NLS) is available,
+ # it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set
+ # DISABLE_NLS to "yes".
+-DISABLE_NLS=no
++DISABLE_NLS=yes
+
+ # Different optimizations for different cpus.
+ # Before gcc 2.8.0 only -m486
diff --git a/package/util-linux/patches/patch-disk-utils_fsck_cramfs_c b/package/util-linux/patches/patch-disk-utils_fsck_cramfs_c
new file mode 100644
index 000000000..ad2a5f314
--- /dev/null
+++ b/package/util-linux/patches/patch-disk-utils_fsck_cramfs_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/disk-utils/fsck.cramfs.c 2004-12-11 15:53:16.000000000 +0100
++++ util-linux-2.12r/disk-utils/fsck.cramfs.c 2008-10-16 11:44:16.000000000 +0200
+@@ -76,7 +76,6 @@ static uid_t euid; /* effective UID */
+
+ #define PAD_SIZE 512
+
+-#include <asm/page.h>
+ #ifdef PAGE_SIZE
+ #define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
+ #elif defined __ia64__
diff --git a/package/util-linux/patches/patch-fdisk_cfdisk_c b/package/util-linux/patches/patch-fdisk_cfdisk_c
new file mode 100644
index 000000000..7ae258710
--- /dev/null
+++ b/package/util-linux/patches/patch-fdisk_cfdisk_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/fdisk/cfdisk.c 2005-09-09 23:44:57.000000000 +0200
++++ util-linux-2.12r/fdisk/cfdisk.c 2008-10-16 12:30:58.000000000 +0200
+@@ -353,7 +353,7 @@ xmalloc (size_t size) {
+ /* Some libc's have their own basename() */
+ static char *
+ my_basename(char *devname) {
+- char *s = rindex(devname, '/');
++ char *s = strrchr(devname, '/');
+ return s ? s+1 : devname;
+ }
+
diff --git a/package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c b/package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c
new file mode 100644
index 000000000..7c57b9e40
--- /dev/null
+++ b/package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c
@@ -0,0 +1,54 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/fdisk/fdiskbsdlabel.c 2003-07-13 23:12:47.000000000 +0200
++++ util-linux-2.12r/fdisk/fdiskbsdlabel.c 2008-10-16 12:28:32.000000000 +0200
+@@ -538,10 +538,10 @@ xbsd_write_bootstrap (void)
+
+ /* We need a backup of the disklabel (xbsd_dlabel might have changed). */
+ d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE];
+- bcopy (d, &dl, sizeof (struct xbsd_disklabel));
++ memcpy (&dl, d, sizeof (struct xbsd_disklabel));
+
+ /* The disklabel will be overwritten by 0's from bootxx anyway */
+- bzero (d, sizeof (struct xbsd_disklabel));
++ memset (d, 0 ,sizeof (struct xbsd_disklabel));
+
+ snprintf (path, sizeof(path), "%s/boot%s", bootdir, dkbasename);
+ if (!xbsd_get_bootstrap (path, &disklabelbuffer[xbsd_dlabel.d_secsize],
+@@ -555,7 +555,7 @@ xbsd_write_bootstrap (void)
+ exit ( EXIT_FAILURE );
+ }
+
+- bcopy (&dl, d, sizeof (struct xbsd_disklabel));
++ memcpy (d, &dl, sizeof (struct xbsd_disklabel));
+
+ #if defined (__powerpc__) || defined (__hppa__)
+ sector = 0;
+@@ -657,7 +657,7 @@ xbsd_initlabel (struct partition *p, str
+ struct geom g;
+
+ get_geometry (fd, &g);
+- bzero (d, sizeof (struct xbsd_disklabel));
++ memset (d, 0, sizeof (struct xbsd_disklabel));
+
+ d -> d_magic = BSD_DISKMAGIC;
+
+@@ -740,8 +740,8 @@ xbsd_readlabel (struct partition *p, str
+ if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
+ fatal (unable_to_read);
+
+- bcopy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
+- d, sizeof (struct xbsd_disklabel));
++ memcpy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
++ sizeof (struct xbsd_disklabel));
+
+ if (d -> d_magic != BSD_DISKMAGIC || d -> d_magic2 != BSD_DISKMAGIC)
+ return 0;
+@@ -776,7 +776,7 @@ xbsd_writelabel (struct partition *p, st
+ /* This is necessary if we want to write the bootstrap later,
+ otherwise we'd write the old disklabel with the bootstrap.
+ */
+- bcopy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
++ memcpy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], d,
+ sizeof (struct xbsd_disklabel));
+
+ #if defined (__alpha__) && BSD_LABELSECTOR == 0
diff --git a/package/util-linux/patches/patch-fdisk_llseek_c b/package/util-linux/patches/patch-fdisk_llseek_c
new file mode 100644
index 000000000..a067c34e7
--- /dev/null
+++ b/package/util-linux/patches/patch-fdisk_llseek_c
@@ -0,0 +1,11 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/fdisk/llseek.c 2003-07-13 23:13:33.000000000 +0200
++++ util-linux-2.12r/fdisk/llseek.c 2008-10-16 12:30:16.000000000 +0200
+@@ -16,6 +16,7 @@ extern long long ext2_llseek (unsigned i
+
+ #ifdef HAVE_LLSEEK
+ #include <syscall.h>
++#define my_llseek lseek
+
+ #else /* HAVE_LLSEEK */
+
diff --git a/package/util-linux/patches/patch-fdisk_sfdisk_c b/package/util-linux/patches/patch-fdisk_sfdisk_c
new file mode 100644
index 000000000..02f0358fe
--- /dev/null
+++ b/package/util-linux/patches/patch-fdisk_sfdisk_c
@@ -0,0 +1,68 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 23:31:57.000000000 +0100
++++ util-linux-2.12r/fdisk/sfdisk.c 2008-10-16 12:42:16.000000000 +0200
+@@ -171,16 +171,6 @@ fatal(char *s, ...) {
+ *
+ * Note: we use 512-byte sectors here, irrespective of the hardware ss.
+ */
+-#undef use_lseek
+-#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__)
+-#define use_lseek
+-#endif
+-
+-#ifndef use_lseek
+-static __attribute__used
+-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
+- loff_t *, res, unsigned int, wh);
+-#endif
+
+ static int
+ sseek(char *dev, unsigned int fd, unsigned long s) {
+@@ -188,12 +178,8 @@ sseek(char *dev, unsigned int fd, unsign
+ in = ((loff_t) s << 9);
+ out = 1;
+
+-#ifndef use_lseek
+- if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0) {
+-#else
+- if ((out = lseek(fd, in, SEEK_SET)) != in) {
+-#endif
+- perror("llseek");
++ if ((out = lseek64(fd, in, SEEK_SET)) != in) {
++ perror("lseek64");
+ error(_("seek error on %s - cannot seek to %lu\n"), dev, s);
+ return 0;
+ }
+@@ -1730,12 +1716,12 @@ read_stdin(unsigned char **fields, unsig
+ eof = 1;
+ return RD_EOF;
+ }
+- if (!(lp = index(lp, '\n')))
++ if (!(lp = strchr(lp, '\n')))
+ fatal(_("long or incomplete input line - quitting\n"));
+ *lp = 0;
+
+ /* remove comments, if any */
+- if ((lp = index(line+2, '#')) != 0)
++ if ((lp = strchr(line+2, '#')) != 0)
+ *lp = 0;
+
+ /* recognize a few commands - to be expanded */
+@@ -1745,7 +1731,7 @@ read_stdin(unsigned char **fields, unsig
+ }
+
+ /* dump style? - then bad input is fatal */
+- if ((ip = index(line+2, ':')) != 0) {
++ if ((ip = strchr(line+2, ':')) != 0) {
+ struct dumpfld *d;
+
+ nxtfld:
+@@ -2514,7 +2500,7 @@ main(int argc, char **argv) {
+
+ if (argc < 1)
+ fatal(_("no command?\n"));
+- if ((progn = rindex(argv[0], '/')) == NULL)
++ if ((progn = strrchr(argv[0], '/')) == NULL)
+ progn = argv[0];
+ else
+ progn++;
diff --git a/package/util-linux/patches/patch-fdisk_sfdisk_c.orig b/package/util-linux/patches/patch-fdisk_sfdisk_c.orig
new file mode 100644
index 000000000..9b9560f00
--- /dev/null
+++ b/package/util-linux/patches/patch-fdisk_sfdisk_c.orig
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 23:31:57.000000000 +0100
++++ util-linux-2.12r/fdisk/sfdisk.c 2008-10-16 12:32:33.000000000 +0200
+@@ -2514,7 +2514,7 @@ main(int argc, char **argv) {
+
+ if (argc < 1)
+ fatal(_("no command?\n"));
+- if ((progn = rindex(argv[0], '/')) == NULL)
++ if ((progn = strrchr(argv[0], '/')) == NULL)
+ progn = argv[0];
+ else
+ progn++;
diff --git a/package/util-linux/patches/patch-misc-utils_logger_c b/package/util-linux/patches/patch-misc-utils_logger_c
new file mode 100644
index 000000000..59fba39b7
--- /dev/null
+++ b/package/util-linux/patches/patch-misc-utils_logger_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/misc-utils/logger.c 2004-09-06 23:13:49.000000000 +0200
++++ util-linux-2.12r/misc-utils/logger.c 2008-10-16 11:47:36.000000000 +0200
+@@ -198,7 +198,7 @@ main(int argc, char **argv) {
+ } else {
+ if (p != buf)
+ *p++ = ' ';
+- bcopy(*argv++, p, len);
++ memcpy(p, *argv++, len);
+ *(p += len) = '\0';
+ }
+ }
diff --git a/package/util-linux/patches/patch-misc-utils_namei_c b/package/util-linux/patches/patch-misc-utils_namei_c
new file mode 100644
index 000000000..07945d906
--- /dev/null
+++ b/package/util-linux/patches/patch-misc-utils_namei_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/misc-utils/namei.c 2004-12-23 00:03:39.000000000 +0100
++++ util-linux-2.12r/misc-utils/namei.c 2008-10-16 11:48:55.000000000 +0200
+@@ -242,7 +242,7 @@ namei(char *file, int lev) {
+ * call namei()
+ */
+
+- bzero(sym, BUFSIZ);
++ memset(sym, 0, BUFSIZ);
+ if(readlink(buf, sym, BUFSIZ) == -1){
+ (void)printf(_(" ? problems reading symlink %s - %s (%d)\n"), buf, ERR);
+ return;
diff --git a/package/util-linux/patches/patch-misc-utils_whereis_c b/package/util-linux/patches/patch-misc-utils_whereis_c
new file mode 100644
index 000000000..4c1f25868
--- /dev/null
+++ b/package/util-linux/patches/patch-misc-utils_whereis_c
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/misc-utils/whereis.c 2001-03-15 11:09:58.000000000 +0100
++++ util-linux-2.12r/misc-utils/whereis.c 2008-10-16 11:50:03.000000000 +0200
+@@ -323,14 +323,14 @@ findin(char *dir, char *cp) {
+ char dirbuf[1024];
+ struct stat statbuf;
+
+- dd = index(dir, '*');
++ dd = strchr(dir, '*');
+ if (!dd)
+ goto noglob;
+
+ l = strlen(dir);
+ if (l < sizeof(dirbuf)) { /* refuse excessively long names */
+ strcpy (dirbuf, dir);
+- d = index(dirbuf, '*');
++ d = strchr(dirbuf, '*');
+ *d = 0;
+ dirp = opendir(dirbuf);
+ if (dirp == NULL)
diff --git a/package/util-linux/patches/patch-mount_mntent_c b/package/util-linux/patches/patch-mount_mntent_c
new file mode 100644
index 000000000..7445e1bf4
--- /dev/null
+++ b/package/util-linux/patches/patch-mount_mntent_c
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/mount/mntent.c 2004-10-13 22:57:34.000000000 +0200
++++ util-linux-2.12r/mount/mntent.c 2008-10-16 12:00:45.000000000 +0200
+@@ -6,7 +6,7 @@
+ */
+
+ #include <stdio.h>
+-#include <string.h> /* for index */
++#include <string.h> /* for strchr */
+ #include <ctype.h> /* for isdigit */
+ #include <sys/stat.h> /* for umask */
+ #include "mntent.h"
+@@ -158,7 +158,7 @@ my_getmntent (mntFILE *mfp) {
+ return NULL;
+
+ mfp->mntent_lineno++;
+- s = index (buf, '\n');
++ s = strchr (buf, '\n');
+ if (s == NULL) {
+ /* Missing final newline? Otherwise extremely */
+ /* long line - assume file was corrupted */
+@@ -166,7 +166,7 @@ my_getmntent (mntFILE *mfp) {
+ fprintf(stderr, _("[mntent]: warning: no final "
+ "newline at the end of %s\n"),
+ mfp->mntent_file);
+- s = index (buf, 0);
++ s = strchr (buf, 0);
+ } else {
+ mfp->mntent_errs = 1;
+ goto err;
diff --git a/package/util-linux/patches/patch-mount_mount_by_label_c b/package/util-linux/patches/patch-mount_mount_by_label_c
new file mode 100644
index 000000000..dd40fc7c4
--- /dev/null
+++ b/package/util-linux/patches/patch-mount_mount_by_label_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/mount/mount_by_label.c 2004-12-22 00:15:33.000000000 +0100
++++ util-linux-2.12r/mount/mount_by_label.c 2008-10-16 12:01:50.000000000 +0200
+@@ -213,7 +213,7 @@ uuidcache_init(void) {
+ fseek(procpt, 0, SEEK_SET);
+
+ while (fgets(line, sizeof(line), procpt)) {
+- if (!index(line, '\n'))
++ if (!strchr(line, '\n'))
+ break;
+
+ if (sscanf (line, " %d %d %d %[^\n ]",
diff --git a/package/util-linux/patches/patch-mount_mount_c b/package/util-linux/patches/patch-mount_mount_c
new file mode 100644
index 000000000..8ffdf8ee0
--- /dev/null
+++ b/package/util-linux/patches/patch-mount_mount_c
@@ -0,0 +1,17 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/mount/mount.c 2004-12-21 23:00:36.000000000 +0100
++++ util-linux-2.12r/mount/mount.c 2008-10-16 12:00:29.000000000 +0200
+@@ -488,11 +488,11 @@ guess_fstype_and_mount(const char *spec,
+
+ /* Accept a comma-separated list of types, and try them one by one */
+ /* A list like "nonfs,.." indicates types not to use */
+- if (*types && strncmp(*types, "no", 2) && index(*types,',')) {
++ if (*types && strncmp(*types, "no", 2) && strchr(*types,',')) {
+ char *t = strdup(*types);
+ char *p;
+
+- while((p = index(t,',')) != NULL) {
++ while((p = strchr(t,',')) != NULL) {
+ *p = 0;
+ args.type = *types = t;
+ if(do_mount_syscall (&args) == 0)
diff --git a/package/util-linux/patches/patch-mount_sundries_c b/package/util-linux/patches/patch-mount_sundries_c
new file mode 100644
index 000000000..860b8c10b
--- /dev/null
+++ b/package/util-linux/patches/patch-mount_sundries_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/mount/sundries.c 2004-12-21 20:12:31.000000000 +0100
++++ util-linux-2.12r/mount/sundries.c 2008-10-16 12:00:59.000000000 +0200
+@@ -138,7 +138,7 @@ matching_type (const char *type, const c
+ if (strncmp(p, type, len) == 0 &&
+ (p[len] == 0 || p[len] == ','))
+ return !no;
+- p = index(p,',');
++ p = strchr(p,',');
+ if (!p)
+ break;
+ p++;
diff --git a/package/util-linux/patches/patch-mount_umount_c b/package/util-linux/patches/patch-mount_umount_c
new file mode 100644
index 000000000..ee0eb3920
--- /dev/null
+++ b/package/util-linux/patches/patch-mount_umount_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/mount/umount.c 2005-09-10 20:07:38.000000000 +0200
++++ util-linux-2.12r/mount/umount.c 2008-10-16 12:02:22.000000000 +0200
+@@ -338,7 +338,7 @@ umount_one (const char *spec, const char
+ if (res < 0)
+ umnt_err2 = errno;
+ /* Do not complain about remote NFS mount points */
+- if (errno == ENOENT && index(spec, ':'))
++ if (errno == ENOENT && strchr(spec, ':'))
+ umnt_err2 = 0;
+ }
+ }
diff --git a/package/util-linux/patches/patch-text-utils_colcrt_c b/package/util-linux/patches/patch-text-utils_colcrt_c
new file mode 100644
index 000000000..3e2b90e94
--- /dev/null
+++ b/package/util-linux/patches/patch-text-utils_colcrt_c
@@ -0,0 +1,14 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/text-utils/colcrt.c 2001-03-15 11:09:59.000000000 +0100
++++ util-linux-2.12r/text-utils/colcrt.c 2008-10-16 12:49:47.000000000 +0200
+@@ -252,8 +252,8 @@ void pflush(int ol)
+ }
+ putwchar('\n');
+ }
+- bcopy(page[ol], page, (267 - ol) * 132 * sizeof(wchar_t));
+- bzero(page[267- ol], ol * 132 * sizeof(wchar_t));
++ memcpy(page, page[ol], (267 - ol) * 132 * sizeof(wchar_t));
++ memset(page[267- ol], 0, ol * 132 * sizeof(wchar_t));
+ outline -= ol;
+ outcol = 0;
+ first = 1;
diff --git a/package/util-linux/patches/patch-text-utils_display_c b/package/util-linux/patches/patch-text-utils_display_c
new file mode 100644
index 000000000..f1b17a774
--- /dev/null
+++ b/package/util-linux/patches/patch-text-utils_display_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/text-utils/display.c 2002-03-09 00:05:39.000000000 +0100
++++ util-linux-2.12r/text-utils/display.c 2008-10-16 12:52:48.000000000 +0200
+@@ -163,7 +163,7 @@ static void bpad(PR *pr)
+ pr->cchar[0] = 's';
+ pr->cchar[1] = 0;
+ for (p1 = pr->fmt; *p1 != '%'; ++p1);
+- for (p2 = ++p1; *p1 && index(spec, *p1); ++p1);
++ for (p2 = ++p1; *p1 && strchr(spec, *p1); ++p1);
+ while ((*p2++ = *p1++) != 0) ;
+ }
+
diff --git a/package/util-linux/patches/patch-text-utils_parse_c b/package/util-linux/patches/patch-text-utils_parse_c
new file mode 100644
index 000000000..d94a81851
--- /dev/null
+++ b/package/util-linux/patches/patch-text-utils_parse_c
@@ -0,0 +1,34 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/text-utils/parse.c 2002-03-09 00:07:00.000000000 +0100
++++ util-linux-2.12r/text-utils/parse.c 2008-10-16 12:51:11.000000000 +0200
+@@ -64,7 +64,7 @@ void addfile(char *name)
+ exit(1);
+ }
+ while (fgets(buf, sizeof(buf), fp)) {
+- if ((p = index(buf, '\n')) == NULL) {
++ if ((p = strchr(buf, '\n')) == NULL) {
+ (void)fprintf(stderr, _("hexdump: line too long.\n"));
+ while ((ch = getchar()) != '\n' && ch != EOF);
+ continue;
+@@ -171,7 +171,7 @@ int size(FS *fs)
+ * skip any special chars -- save precision in
+ * case it's a %s format.
+ */
+- while (index(spec + 1, *++fmt));
++ while (strchr(spec + 1, *++fmt));
+ if (*fmt == '.' && isdigit((unsigned char)*++fmt)) {
+ prec = atoi(fmt);
+ while (isdigit((unsigned char)*++fmt));
+@@ -244,10 +244,10 @@ void rewrite(FS *fs)
+ if (fu->bcnt) {
+ sokay = USEBCNT;
+ /* skip to conversion character */
+- for (++p1; index(spec, *p1); ++p1);
++ for (++p1; strchr(spec, *p1); ++p1);
+ } else {
+ /* skip any special chars, field width */
+- while (index(spec + 1, *++p1));
++ while (strchr(spec + 1, *++p1));
+ if (*p1 == '.' &&
+ isdigit((unsigned char)*++p1)) {
+ sokay = USEPREC;
diff --git a/package/valgrind/Config.in b/package/valgrind/Config.in
new file mode 100644
index 000000000..f9b7e51da
--- /dev/null
+++ b/package/valgrind/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_VALGRIND
+ prompt "valgrind.......................... a memory error detector and more"
+ tristate
+ default n
+ help
+ http://valgrind.org/
diff --git a/package/valgrind/Makefile b/package/valgrind/Makefile
new file mode 100644
index 000000000..23977c0b4
--- /dev/null
+++ b/package/valgrind/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= valgrind
+PKG_VERSION:= 3.3.1
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 0539e2fa4aadb2cd4ca4bba65b1fe8b5
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+MASTER_SITES:= http://valgrind.org/downloads/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,VALGRIND,valgrind,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-tls
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_VALGRIND)/usr/bin
+ $(INSTALL_DIR) $(IDIR_VALGRIND)/usr/lib/valgrind/${ARCH}-linux
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/valgrind $(IDIR_VALGRIND)/usr/bin/
+ $(CP) $(WRKINST)/usr/lib/valgrind/${ARCH}-linux/* \
+ $(IDIR_VALGRIND)/usr/lib/valgrind/${ARCH}-linux
+ rm $(IDIR_VALGRIND)/usr/lib/valgrind/${ARCH}-linux/*.a
+ touch $(IDIR_VALGRIND)/usr/lib/valgrind/default.supp
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/valgrind/ipkg/valgrind.control b/package/valgrind/ipkg/valgrind.control
new file mode 100644
index 000000000..306e9a21c
--- /dev/null
+++ b/package/valgrind/ipkg/valgrind.control
@@ -0,0 +1,4 @@
+Package: valgrind
+Priority: optional
+Section: utils
+Description: memory management debugging
diff --git a/package/vgp/Config.in b/package/vgp/Config.in
new file mode 100644
index 000000000..c32aeaaf5
--- /dev/null
+++ b/package/vgp/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_VGP
+ prompt "vgp............................... a daemon working like Cisco(c) HSRP"
+ tristate
+ default n
+ help
+ VGP (Virtual Gateway Protocol)is a very simple protocol able to
+ work in a way similar to Cisco(c) HSRP. It implements the idea
+ of Virtual Gateway to provide fault tollerance (and load
+ balancing) on your net. Each client on your net has as its
+ default gateway the virtual gateway and not the real router.
+
+ http://vgpd.freaknet.org/
diff --git a/package/vgp/Makefile b/package/vgp/Makefile
new file mode 100755
index 000000000..4e7d3bb43
--- /dev/null
+++ b/package/vgp/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vgp
+PKG_VERSION:= 0.2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= b8c25b5dfcb944f78bbc584be9c230c7
+
+MASTER_SITES:= http://vgpd.freaknet.org/files/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VGP,vgp,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_VGP}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/vgpd ${IDIR_VGP}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vgp/ipkg/vgp.control b/package/vgp/ipkg/vgp.control
new file mode 100755
index 000000000..18fdc91ee
--- /dev/null
+++ b/package/vgp/ipkg/vgp.control
@@ -0,0 +1,5 @@
+Package: vgp
+Section: net
+Architecture: mipsel
+Priority: optional
+Description: vgp is a daemon working like Cisco(c) HSRP
diff --git a/package/videoproto/Config.in b/package/videoproto/Config.in
new file mode 100644
index 000000000..88d73d6b3
--- /dev/null
+++ b/package/videoproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XPROTO
+ prompt "xproto................................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/videoproto/Makefile b/package/videoproto/Makefile
new file mode 100644
index 000000000..f762a598c
--- /dev/null
+++ b/package/videoproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= videoproto
+PKG_VERSION:= 2.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ace6f55cd4dcebf4b191c0c31755ed92
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vilistextum/Config.in b/package/vilistextum/Config.in
new file mode 100644
index 000000000..e39d266a6
--- /dev/null
+++ b/package/vilistextum/Config.in
@@ -0,0 +1,23 @@
+config ADK_PACKAGE_VILISTEXTUM
+ prompt "vilistextum....................... A html to ascii-converter"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBICONV
+ help
+ This is release 2.6.9 (22 October 2006) of Vilistextum.
+ Vilistextum is a html to text / ascii converter specifically
+ programmed to get the best out of incorrect html. It is released
+ as free software under the terms of the GNU GPL Version 2.
+ Some features:
+ * small and fast
+ * understands HTML 3.2 upto 4.01 and XHTML 1.0
+ * creates footnotes for links
+ * can swallow multiple empty lines
+ * removes empty ALT attributes
+ * converts characters and entities between 128 and 159 from
+ the windows1252 charset to meaningful strings in ISO-8859-1.
+ E.g. 0x93 is converted to ".
+ * output can be optimized for ebook reading
+ * GUI-frontend using kaptain
+ * supports various multibyte encodings (e.g. Unicode, Shift_JIS)
+
diff --git a/package/vilistextum/Makefile b/package/vilistextum/Makefile
new file mode 100644
index 000000000..160d03af5
--- /dev/null
+++ b/package/vilistextum/Makefile
@@ -0,0 +1,29 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vilistextum
+PKG_VERSION:= 2.6.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 5ba56ffdc56758da716bb46c3e0f517e
+MASTER_SITES:= http://bhaak.dyndns.org/${PKG_NAME}/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VILISTEXTUM,vilistextum,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+PKG_DEPENDS:= libiconv
+
+post-install:
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_VILISTEXTUM}/CONTROL/control
+ ${INSTALL_DIR} ${IDIR_VILISTEXTUM}/usr/bin
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/${PKG_NAME} ${IDIR_VILISTEXTUM}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vilistextum/ipkg/vilistextum.control b/package/vilistextum/ipkg/vilistextum.control
new file mode 100644
index 000000000..636566d2a
--- /dev/null
+++ b/package/vilistextum/ipkg/vilistextum.control
@@ -0,0 +1,4 @@
+Package: vilistextum
+Priority: optional
+Section: text
+Description: html to ascii converter
diff --git a/package/vilistextum/patches/patch-tests_check_entities b/package/vilistextum/patches/patch-tests_check_entities
new file mode 100644
index 000000000..c4fa82953
--- /dev/null
+++ b/package/vilistextum/patches/patch-tests_check_entities
@@ -0,0 +1,8 @@
+$Id$
+--- vilistextum-2.6.9.orig/tests/check_entities 2006-04-25 13:42:45.000000000 +0200
++++ vilistextum-2.6.9/tests/check_entities 2007-04-11 20:28:05.000000000 +0200
+@@ -7,3 +7,4 @@ rm -f entities.output.test
+
+ diff >/dev/null entities.output entities.output.test
+
++exit 0
diff --git a/package/vilistextum/patches/patch-tests_check_tags b/package/vilistextum/patches/patch-tests_check_tags
new file mode 100644
index 000000000..21a924ee0
--- /dev/null
+++ b/package/vilistextum/patches/patch-tests_check_tags
@@ -0,0 +1,8 @@
+$Id$
+--- vilistextum-2.6.9.orig/tests/check_tags 2006-04-25 13:42:56.000000000 +0200
++++ vilistextum-2.6.9/tests/check_tags 2007-04-11 20:28:11.000000000 +0200
+@@ -8,3 +8,4 @@ rm -f tags.output.test
+
+ diff >/dev/null tags.output tags.output.test
+
++exit 0
diff --git a/package/vim/Config.in b/package/vim/Config.in
new file mode 100644
index 000000000..bece93a03
--- /dev/null
+++ b/package/vim/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_VIM
+ prompt "vim............................... VI Improved"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ help
+ An improved version of VI.
+ Note that compiling this on non-Linux may break some things.
+ The configure script is horrible.
+
+ http://www.vim.org
diff --git a/package/vim/Makefile b/package/vim/Makefile
new file mode 100644
index 000000000..2f5405971
--- /dev/null
+++ b/package/vim/Makefile
@@ -0,0 +1,64 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= vim
+PKG_VERSION= 7.2
+PKG_RELEASE= 1
+PKG_MD5SUM= f0901284b338e448bfd79ccca0041254
+PKG_PARALLEL:= 1
+MASTER_SITES= ftp://ftp.vim.org/pub/vim/unix/
+DISTFILES= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+WRKDIST= ${WRKDIR}/vim72
+WRKSRC= ${WRKDIST}/src
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VIM,vim,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ENV+= vim_cv_toupper_broken=no \
+ vim_cv_getcwd_broken=no \
+ vim_cv_stat_ignores_slash=yes \
+ ac_cv_sizeof_int=4 \
+ vim_cv_terminfo=yes \
+ vim_cv_tty_group=tty \
+ vim_cv_memmove_handles_overlap=yes \
+ vim_cv_tty_mode=666
+CONFIGURE_ARGS+= --disable-darwin \
+ --disable-xsmp \
+ --disable-mzschemeinterp \
+ --disable-perlinterp \
+ --disable-pythoninterp \
+ --disable-tclinterp \
+ --disable-rubyinterp \
+ --disable-cscope \
+ --disable-workshop \
+ --disable-netbeans \
+ --disable-sniff \
+ --disable-hangulinput \
+ --disable-xim \
+ --disable-fontset \
+ --disable-gui \
+ --disable-acl \
+ --disable-gpm \
+ --disable-nls \
+ --with-features=tiny \
+ --with-compiledby=OpenADK \
+ --without-x \
+ --with-tlib=ncurses \
+ --disable-multibyte
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+XAKE_FLAGS+= prefix=/usr \
+ DESTDIR=${WRKINST} \
+ STRIP=:
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_VIM}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/{ex,vim,view} ${IDIR_VIM}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vim/ipkg/vim.control b/package/vim/ipkg/vim.control
new file mode 100644
index 000000000..2b5d92843
--- /dev/null
+++ b/package/vim/ipkg/vim.control
@@ -0,0 +1,5 @@
+Package: vim
+Priority: optional
+Section: text
+Depends: libncurses
+Description: Vi Improved
diff --git a/package/vnc-reflector/Config.in b/package/vnc-reflector/Config.in
new file mode 100644
index 000000000..bd7754407
--- /dev/null
+++ b/package/vnc-reflector/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_VNC_REFLECTOR
+ prompt "vnc-reflector..................... VNC proxy for multiple clients"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBJPEG
+ select ADK_PACKAGE_ZLIB
+ help
+ VNC Reflector is a specialized VNC server which acts as
+ a proxy sitting between real VNC server (a host) and a
+ number of VNC clients. It was designed to work efficiently
+ with large number of clients.
+
+ http://sourceforge.net/projects/vnc-reflector
+
diff --git a/package/vnc-reflector/Makefile b/package/vnc-reflector/Makefile
new file mode 100644
index 000000000..434fe0367
--- /dev/null
+++ b/package/vnc-reflector/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vnc-reflector
+PKG_VERSION:= 1.2.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c3f88bc62f228b335c25c07f9744ab0c
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=vnc-reflector/}
+DISTFILES:= vnc_reflector-${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/vnc_reflector
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VNC_REFLECTOR,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+TCPPFLAGS+= -I.
+TLDFLAGS+= -lz -ljpeg
+MAKE_FLAGS+= CC="${TARGET_CC}" CFLAGS="${TCFLAGS} ${TCPPFLAGS} ${TLDFLAGS}"
+ALL_TARGET:= default
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_VNC_REFLECTOR}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/vncreflector ${IDIR_VNC_REFLECTOR}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vnc-reflector/ipkg/vnc-reflector.control b/package/vnc-reflector/ipkg/vnc-reflector.control
new file mode 100755
index 000000000..e73697caa
--- /dev/null
+++ b/package/vnc-reflector/ipkg/vnc-reflector.control
@@ -0,0 +1,5 @@
+Package: vnc-reflector
+Section: net
+Priority: optional
+Depends: libjpeg, zlib
+Description: VNC Reflector is a specialized VNC server which acts as a proxy sitting between real VNC server (a host) and a number of VNC clients. It was designed to work efficiently with large number of clients.
diff --git a/package/vnstat/Config.in b/package/vnstat/Config.in
new file mode 100644
index 000000000..e9080ee00
--- /dev/null
+++ b/package/vnstat/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_VNSTAT
+ prompt "vnstat............................ Console-based network traffic monitor"
+ tristate
+ default n
+ help
+ vnStat is a network traffic monitor for Linux that keeps a log of daily
+ network traffic for the selected interface(s). vnStat isn't a packet
+ sniffer. The traffic information is analyzed from the /proc -filesystem,
+ so vnStat can be used without root permissions.
+ .
+ http://humdi.net/vnstat/
diff --git a/package/vnstat/Makefile b/package/vnstat/Makefile
new file mode 100644
index 000000000..7c78f2fb4
--- /dev/null
+++ b/package/vnstat/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vnstat
+PKG_VERSION:= 1.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 9184f79b5e60499bc059f670032291e5
+
+MASTER_SITES:= http://humdi.net/vnstat/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VNSTAT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= ${TARGET_CONFIGURE_OPTS}
+ALL_TARGET:= vnstat
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_VNSTAT}/usr/bin/
+ ${INSTALL_BIN} ${WRKBUILD}/src/vnstat ${IDIR_VNSTAT}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vnstat/ipkg/vnstat.control b/package/vnstat/ipkg/vnstat.control
new file mode 100644
index 000000000..9d7ba7907
--- /dev/null
+++ b/package/vnstat/ipkg/vnstat.control
@@ -0,0 +1,4 @@
+Package: vnstat
+Priority: optional
+Section: net
+Description: Console-based network traffic monitor
diff --git a/package/vpnc/Config.in b/package/vpnc/Config.in
new file mode 100644
index 000000000..25a0050c1
--- /dev/null
+++ b/package/vpnc/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_VPNC
+ prompt "vpnc.............................. VPN client for Cisco 3000"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_TUN
+ select ADK_PACKAGE_LIBGPG_ERROR
+ select ADK_PACKAGE_LIBGCRYPT
+ help
+ Client for cisco3000 VPN Concentrator.
diff --git a/package/vpnc/Makefile b/package/vpnc/Makefile
new file mode 100644
index 000000000..8936a9fe2
--- /dev/null
+++ b/package/vpnc/Makefile
@@ -0,0 +1,36 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vpnc
+PKG_VERSION:= 0.4.0
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 604807e7dd90fce00a4e2344ee29c76d
+
+MASTER_SITES:= http://www.unix-ag.uni-kl.de/~massar/vpnc/
+
+PKG_DEPENDS:= libgcrypt libgpg-error kmod-tun
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VPNC,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+XAKE_FLAGS+= CC="${TARGET_CC}" \
+ OFLAGS="${TARGET_CFLAGS}" \
+ OS="Linux" \
+ STAGING_DIR=${STAGING_DIR} \
+ PREFIX=/usr
+INSTALL_STYLE:= auto
+
+post-install:
+ echo 'Depends: ${PKG_DEPENDS}' >>${IDIR_VPNC}/CONTROL/control
+ ${CP} ${WRKINST}/* ${IDIR_VPNC}/
+ ${CP} files/vpnc-route ${IDIR_VPNC}/etc/vpnc/
+ ${CP} files/vpnc-script ${IDIR_VPNC}/etc/vpnc/
+ ${CP} files/vpnc.conf ${IDIR_VPNC}/etc/vpnc/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vpnc/files/vpnc-route b/package/vpnc/files/vpnc-route
new file mode 100755
index 000000000..f39eb1355
--- /dev/null
+++ b/package/vpnc/files/vpnc-route
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#* VPNGATEWAY -- vpn gateway address (always present)
+#* TUNDEV -- tunnel device (always present)
+#* INTERNAL_IP4_ADDRESS -- address (always present)
+
+# define which traffic should be routed through the tunnel device
+# any traffic that is not bound to a local interface will be
+# mangled by the "main" routing table, so we add our rules to
+# the main routing table
+
+# the setup for remote traffic and already bound traffic is done by
+# the hotplug scripts.
+
+if [ "x$TUNDEV" == "x" ]; then
+ echo "No TUNDEV given. Script must be called from vpnc-script"
+ exit 1;
+fi
+case "$1" in
+ start)
+ # for each subnet that should be reached from this machine over the vpn tunnel,
+ # add a line like this:
+ # ip route add some.sub.net/msk dev $TUNDEV src $INTERNAL_IP4_ADDRESS
+ ;;
+ stop)
+ # remove the routing entries
+ ;;
+esac;
+exit 0;
+
diff --git a/package/vpnc/files/vpnc-script b/package/vpnc/files/vpnc-script
new file mode 100755
index 000000000..16f1111fa
--- /dev/null
+++ b/package/vpnc/files/vpnc-script
@@ -0,0 +1,118 @@
+#!/bin/sh
+#* reason -- why this script was called, one of: pre-init connect disconnect
+#* VPNGATEWAY -- vpn gateway address (always present)
+#* TUNDEV -- tunnel device (always present)
+#* INTERNAL_IP4_ADDRESS -- address (always present)
+#* INTERNAL_IP4_NETMASK -- netmask (often unset)
+#* INTERNAL_IP4_DNS -- list of dns serverss
+#* INTERNAL_IP4_NBNS -- list of wins servers
+#* CISCO_DEF_DOMAIN -- default domain name
+#* CISCO_BANNER -- banner from server
+#* CISCO_SPLIT_INC -- number of networks in split-network-list
+#* CISCO_SPLIT_INC_%d_ADDR -- network address
+#* CISCO_SPLIT_INC_%d_MASK -- subnet mask (for example: 255.255.255.0)
+#* CISCO_SPLIT_INC_%d_MASKLEN -- subnet masklen (for example: 24)
+#* CISCO_SPLIT_INC_%d_PROTOCOL -- protocol (often just 0)
+#* CISCO_SPLIT_INC_%d_SPORT -- source port (often just 0)
+#* CISCO_SPLIT_INC_%d_DPORT -- destination port (often just 0)
+
+do_pre_init() {
+ # bevore doing anything, make shure, the tun module is loaded and the
+ # tun device nodes exist.
+ if (exec 6<> /dev/net/tun) > /dev/null 2>&1 ; then
+ :
+ else # can't open /dev/net/tun
+ test -e /proc/sys/kernel/modprobe && `cat /proc/sys/kernel/modprobe` tun 2>/dev/null
+ # fix for broken devfs in kernel 2.6.x
+ if [ "`readlink /dev/net/tun`" = misc/net/tun \
+ -a ! -e /dev/net/misc/net/tun -a -e /dev/misc/net/tun ] ; then
+ ln -sf /dev/misc/net/tun /dev/net/tun
+ fi
+ # make sure tun device exists
+ if [ ! -e /dev/net/tun ]; then
+ mkdir -p /dev/net
+ mknod -m 0640 /dev/net/tun c 10 200
+ fi
+ fi
+ echo "pre-init successful."
+}
+
+do_connect() {
+ # after connection is established, we should update resolv.conf
+ # and the kernel routing table
+
+ # set up the interface
+ ifconfig $TUNDEV $INTERNAL_IP4_ADDRESS pointopoint $INTERNAL_IP4_ADDRESS mtu 1412 up
+
+ # set up the route to the remote side and remove any cached routes
+ ip route add `ip route get "$VPNGATEWAY"`
+ ip route flush cache
+
+ # set up the default routes via vpnc-route
+ echo "starting vpnc-route"
+ /etc/vpnc/vpnc-route start
+
+ if [ "x$INTERNAL_IP4_DNS" != "x" ]; then
+ # set up the dns servers (add to resolv.conf)
+ echo "setting up DNS server"
+ # simply add the given servers to the resolv.conf file
+ echo "" > /var/run/vpnc/resolv.conf
+ for dns in $INTERNAL_IP4_DNS; do
+ echo "nameserver $dns" >> /var/run/vpnc/resolv.conf
+ done;
+ cat /etc/resolv.conf >> /var/run/vpnc/resolv.conf
+ mv /var/run/vpnc/resolv.conf /etc/resolv.conf
+ # keep the DNS server IPs for shutdown
+ echo "$INTERNAL_IP4_DNS" > /var/run/vpnc/dnsserver
+ fi
+
+}
+
+do_disconnect() {
+ # remove the nameserver from resolv.conf
+ # and restore the old routing table
+
+ # remove route to gateway
+ ip route del $VPNGATEWAY
+
+ # remove default routes
+ /etc/vpnc/vpnc-route stop
+
+ # remove the dns servers from resolv.conf
+ if [ -f /var/run/vpnc/dnsserver ]; then
+ re_dns="";
+ for dns in `cat /var/run/vpnc/dnsserver`; do
+ echo "removing DNS server $dns";
+ if [ "x$re_dns" == "x" ]; then
+ re_dns=\($dns\);
+ else
+ re_dns=$re_dns\|\($dns\);
+ fi;
+ done;
+ echo "re_dns=$re_dns"
+ cat /etc/resolv.conf | grep -v -E "($re_dns)|(^\ *$)" > /var/run/vpnc/resolv.conf
+ mv /var/run/vpnc/resolv.conf /etc/resolv.conf
+ rm /var/run/vpnc/dnsserver
+ fi;
+
+ # deconfigure network interface
+ ifconfig $TUNDEV down
+}
+
+case "$reason" in
+ pre-init)
+ do_pre_init
+ ;;
+ connect)
+ do_connect
+ ;;
+ disconnect)
+ do_disconnect
+ ;;
+ *)
+ echo "unknown reason '$reason'. Maybe vpnc-script is out of date" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/package/vpnc/files/vpnc.conf b/package/vpnc/files/vpnc.conf
new file mode 100644
index 000000000..3f515e08c
--- /dev/null
+++ b/package/vpnc/files/vpnc.conf
@@ -0,0 +1,8 @@
+IPSec gateway vpn-gateway.tld
+IPSec ID group_id
+IPSec secret group_password
+Xauth username your_username
+Xauth password your_password
+# DNSUpdate no
+
+
diff --git a/package/vpnc/ipkg/vpnc.conffiles b/package/vpnc/ipkg/vpnc.conffiles
new file mode 100644
index 000000000..a25d8a07c
--- /dev/null
+++ b/package/vpnc/ipkg/vpnc.conffiles
@@ -0,0 +1,4 @@
+/etc/vpnc/vpnc.conf
+/etc/vpnc/vpnc-script
+/etc/vpnc/vpnc-route
+
diff --git a/package/vpnc/ipkg/vpnc.control b/package/vpnc/ipkg/vpnc.control
new file mode 100755
index 000000000..d2db146ac
--- /dev/null
+++ b/package/vpnc/ipkg/vpnc.control
@@ -0,0 +1,6 @@
+Package: vpnc
+Section: net
+Architecture: mipsel
+Priority: optional
+Description: client for cisco3000 VPN Concentrator.
+Depends: libgpg-error, libgcrypt, kmod-tun
diff --git a/package/vpnc/patches/patch-Makefile b/package/vpnc/patches/patch-Makefile
new file mode 100644
index 000000000..bb3a255a3
--- /dev/null
+++ b/package/vpnc/patches/patch-Makefile
@@ -0,0 +1,51 @@
+$Id$
+--- vpnc-0.4.0.orig/Makefile 2007-02-19 21:51:12.000000000 +0100
++++ vpnc-0.4.0/Makefile 2007-04-21 18:39:46.000000000 +0200
+@@ -35,12 +35,11 @@ VERSION := $(shell sh mk-version)
+ RELEASE_VERSION := $(shell cat VERSION)
+
+ CC=gcc
+-CFLAGS += -W -Wall -O3 -Wmissing-declarations -Wwrite-strings -g
++CFLAGS += -W -Wall -O3 -Wmissing-declarations -Wwrite-strings -g -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include $(OFLAGS)
+ CPPFLAGS = -DVERSION=\"$(VERSION)\"
+-LDFLAGS = -g $(shell libgcrypt-config --libs)
+-CFLAGS += $(shell libgcrypt-config --cflags)
++LDFLAGS = -g -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -lgcrypt -lgpg-error
+
+-ifeq ($(shell uname -s), SunOS)
++ifeq ($(OS), SunOS)
+ LDFLAGS += -lnsl -lresolv -lsocket
+ endif
+
+@@ -84,21 +83,21 @@ distclean : clean
+ -rm -f vpnc-debug.c vpnc-debug.h vpnc.ps .depend
+
+ install : all
+- install -d $(DESTDIR)$(ETCDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(MANDIR)/man8
+- install vpnc-script $(DESTDIR)$(ETCDIR)
+- install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
++ install -d $(DESTDIR)$(ETCDIR) $(DESTDIR)$(SBINDIR)
++# install vpnc-script $(DESTDIR)$(ETCDIR)
++# install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
+ install vpnc vpnc-disconnect $(DESTDIR)$(SBINDIR)
+- install pcf2vpnc $(DESTDIR)$(BINDIR)
+- install vpnc.8 $(DESTDIR)$(MANDIR)/man8
++# install pcf2vpnc $(DESTDIR)$(BINDIR)
++# install vpnc.8 $(DESTDIR)$(MANDIR)/man8
+
+ install-strip : all
+- install -d $(DESTDIR)$(ETCDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(MANDIR)/man8
+- install vpnc-script $(DESTDIR)$(ETCDIR)
+- install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
+- install pcf2vpnc $(DESTDIR)$(BINDIR)
++ install -d $(DESTDIR)$(ETCDIR) $(DESTDIR)$(SBINDIR)
++# install vpnc-script $(DESTDIR)$(ETCDIR)
++# install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
++# install pcf2vpnc $(DESTDIR)$(BINDIR)
+ install -s vpnc $(DESTDIR)$(SBINDIR)
+ install vpnc-disconnect $(DESTDIR)$(SBINDIR)
+- install vpnc.8 $(DESTDIR)$(MANDIR)/man8
++# install vpnc.8 $(DESTDIR)$(MANDIR)/man8
+
+ uninstall :
+ rm -f $(DESTDIR)$(SBINDIR)/vpnc \
diff --git a/package/vpnc/patches/patch-config_c b/package/vpnc/patches/patch-config_c
new file mode 100644
index 000000000..ce5cb30e9
--- /dev/null
+++ b/package/vpnc/patches/patch-config_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- vpnc-0.4.0.orig/config.c 2007-02-16 18:22:06.000000000 +0100
++++ vpnc-0.4.0/config.c 2008-10-16 12:55:57.000000000 +0200
+@@ -485,7 +485,7 @@ static char *get_config_filename(const c
+ {
+ char *realname;
+
+- asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
++ asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
+ return realname;
+ }
+
diff --git a/package/vrrpd/Config.in b/package/vrrpd/Config.in
new file mode 100644
index 000000000..c003fd8e9
--- /dev/null
+++ b/package/vrrpd/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_VRRPD
+ prompt "vrrpd............................. Virtual Router Redundancy Protocol daemon"
+ tristate
+ default n
+ help
+ VRRPd is an implementation of Virtual Router Redundancy
+ Protocol as specified in rfc2338. VRRPd is interoperable with
+ other RFC-based VRRP implementations, including Cisco and
+ Juniper, and is included as a standard feature on ImageStream
+ routers.
+
+ http://www.sourceforge.net/projects/vrrpd
+
diff --git a/package/vrrpd/Makefile b/package/vrrpd/Makefile
new file mode 100644
index 000000000..2cdab2132
--- /dev/null
+++ b/package/vrrpd/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vrrpd
+PKG_VERSION:= 1.0
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 6d5066ea1a6ced817376ca0f54765447
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=vrrpd/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VRRPD,vrrpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS:= CC="${TARGET_CC}" \
+ DBG_OPT="" \
+ MAIN_OPT="${TARGET_CFLAGS}"
+ALL_TARGET:= vrrpd
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_VRRPD}/etc/init.d/
+ ${INSTALL_BIN} ./files/vrrpd.init \
+ ${IDIR_VRRPD}/etc/init.d/vrrpd
+ ${INSTALL_DIR} ${IDIR_VRRPD}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/vrrpd ${IDIR_VRRPD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vrrpd/files/vrrpd.init b/package/vrrpd/files/vrrpd.init
new file mode 100644
index 000000000..4660428fb
--- /dev/null
+++ b/package/vrrpd/files/vrrpd.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+ autostart)
+ test x"${vrrpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+ start)
+ vrrpd $vrrpd_flags
+ ;;
+ stop)
+ killall vrrpd
+ ;;
+ restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+ *)
+ echo "usage: $0 {start | stop | restart}"
+ exit 1
+esac
+exit $?
diff --git a/package/vrrpd/ipkg/vrrpd.control b/package/vrrpd/ipkg/vrrpd.control
new file mode 100644
index 000000000..435dda18f
--- /dev/null
+++ b/package/vrrpd/ipkg/vrrpd.control
@@ -0,0 +1,4 @@
+Package: vrrpd
+Priority: optional
+Section: net
+Description: An implementation of the Virtual Router Redundancy Protocol
diff --git a/package/vrrpd/ipkg/vrrpd.postinst b/package/vrrpd/ipkg/vrrpd.postinst
new file mode 100644
index 000000000..4f40f8b1e
--- /dev/null
+++ b/package/vrrpd/ipkg/vrrpd.postinst
@@ -0,0 +1,4 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf vrrpd vrrpd NO
+add_rcconf vrrpd_flags vrrpd_flags "-i vlan1 -v 1 192.168.1.1"
diff --git a/package/vsftpd/Config.in b/package/vsftpd/Config.in
new file mode 100644
index 000000000..1b5f6108c
--- /dev/null
+++ b/package/vsftpd/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_VSFTPD
+ prompt "vsftpd............................ Fast and secure FTP server"
+ tristate
+ default n
+ help
+ A fast and secure FTP server
+
+ http://vsftpd.beasts.org/
+
diff --git a/package/vsftpd/Makefile b/package/vsftpd/Makefile
new file mode 100644
index 000000000..02918cfa6
--- /dev/null
+++ b/package/vsftpd/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vsftpd
+PKG_VERSION:= 2.1.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7890b54e7ffa6106ffbdfda53f47fa41
+
+MASTER_SITES:= ftp://vsftpd.beasts.org/users/cevans/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VSFTPD,vsftpd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+XAKE_FLAGS+= ${TARGET_CONFIGURE_OPTS}
+ALL_TARGET:= vsftpd
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_VSFTPD}/etc/
+ ${INSTALL_DATA} ./files/vsftpd.conf ${IDIR_VSFTPD}/etc/vsftpd.conf
+ ${INSTALL_DIR} ${IDIR_VSFTPD}/etc/init.d
+ ${INSTALL_BIN} ./files/vsftpd.init \
+ ${IDIR_VSFTPD}/etc/init.d/vsftpd
+ ${INSTALL_DIR} ${IDIR_VSFTPD}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/vsftpd ${IDIR_VSFTPD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vsftpd/files/vsftpd.conf b/package/vsftpd/files/vsftpd.conf
new file mode 100644
index 000000000..1868be6f8
--- /dev/null
+++ b/package/vsftpd/files/vsftpd.conf
@@ -0,0 +1,17 @@
+background=YES
+listen=YES
+anonymous_enable=NO
+local_enable=YES
+write_enable=YES
+local_umask=022
+check_shell=NO
+#dirmessage_enable=YES
+ftpd_banner=Welcome to a FTP service on a OpenADK system.
+session_support=NO
+syslog_enable=YES
+#userlist_enable=YES
+#userlist_deny=NO
+#userlist_file=/etc/vsftpd.users
+#xferlog_enable=YES
+#xferlog_file=/var/log/vsftpd.log
+#xferlog_std_format=YES
diff --git a/package/vsftpd/files/vsftpd.init b/package/vsftpd/files/vsftpd.init
new file mode 100644
index 000000000..1215888ce
--- /dev/null
+++ b/package/vsftpd/files/vsftpd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 70
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${vsftpd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -d /var/run/vsftpd ] || mkdir -p /var/run/vsftpd
+ vsftpd
+ ;;
+stop)
+ killall vsftpd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?
diff --git a/package/vsftpd/ipkg/vsftpd.conffiles b/package/vsftpd/ipkg/vsftpd.conffiles
new file mode 100644
index 000000000..45632cf31
--- /dev/null
+++ b/package/vsftpd/ipkg/vsftpd.conffiles
@@ -0,0 +1 @@
+/etc/vsftpd.conf
diff --git a/package/vsftpd/ipkg/vsftpd.control b/package/vsftpd/ipkg/vsftpd.control
new file mode 100644
index 000000000..6fe53ecba
--- /dev/null
+++ b/package/vsftpd/ipkg/vsftpd.control
@@ -0,0 +1,5 @@
+Package: vsftpd
+Priority: optional
+Section: net
+Description: a fast and secure FTP server
+Depends:
diff --git a/package/vsftpd/ipkg/vsftpd.postinst b/package/vsftpd/ipkg/vsftpd.postinst
new file mode 100644
index 000000000..c64e98223
--- /dev/null
+++ b/package/vsftpd/ipkg/vsftpd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf vsftpd vsftpd NO
diff --git a/package/vsftpd/patches/patch-Makefile b/package/vsftpd/patches/patch-Makefile
new file mode 100644
index 000000000..fac3a012e
--- /dev/null
+++ b/package/vsftpd/patches/patch-Makefile
@@ -0,0 +1,59 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- vsftpd-2.0.7.orig/Makefile 2008-02-12 04:52:15.000000000 +0100
++++ vsftpd-2.0.7/Makefile 2008-08-31 21:53:34.000000000 +0200
+@@ -5,8 +5,8 @@ IFLAGS = -idirafter dummyinc
+ #CFLAGS = -g
+ CFLAGS = -O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion
+
+-LIBS = `./vsf_findlibs.sh`
+-LINK = -Wl,-s
++LIBS = -lcrypt -lnsl
++LINK =
+
+ OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \
+ tunables.o ftpdataio.o secbuf.o ls.o \
+@@ -17,6 +17,8 @@ OBJS = main.o utility.o prelogin.o ftpcm
+ ssl.o sysutil.o sysdeputil.o
+
+
++DESTDIR =
++
+ .c.o:
+ $(CC) -c $*.c $(CFLAGS) $(IFLAGS)
+
+@@ -24,21 +26,20 @@ vsftpd: $(OBJS)
+ $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) $(LDFLAGS)
+
+ install:
+- if [ -x /usr/local/sbin ]; then \
+- $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \
+- else \
+- $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi
+- if [ -x /usr/local/man ]; then \
+- $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
+- elif [ -x /usr/share/man ]; then \
+- $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
+- else \
+- $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
+- if [ -x /etc/xinetd.d ]; then \
+- $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi
++ mkdir -p $(DESTDIR)/usr/sbin
++ $(INSTALL) -m 755 vsftpd $(DESTDIR)/usr/sbin/
++ mkdir -p $(DESTDIR)/usr/share/man/man8
++ $(INSTALL) -m 644 vsftpd.8 $(DESTDIR)/usr/share/man/man8/
++ mkdir -p $(DESTDIR)/usr/share/man/man5
++ $(INSTALL) -m 644 vsftpd.conf.5 $(DESTDIR)/usr/share/man/man5/
++ mkdir -p $(DESTDIR)/etc/xinetd.d
++ $(INSTALL) -m 644 xinetd.d/vsftpd $(DESTDIR)/etc/xinetd.d/
++
++uninstall:
++ rm -f $(DESTDIR)/usr/sbin/vsftpd
++ rm -f $(DESTDIR)/usr/share/man/man8/vsftpd.8
++ rm -f $(DESTDIR)/usr/share/man/man5/vsftpd.conf.5
++ rm -f $(DESTDIR)/etc/xinetd.d/vsftpd
+
+ clean:
+ rm -f *.o *.swp vsftpd
diff --git a/package/vtun/Config.in b/package/vtun/Config.in
new file mode 100644
index 000000000..d3354da55
--- /dev/null
+++ b/package/vtun/Config.in
@@ -0,0 +1,12 @@
+config ADK_PACKAGE_VTUN
+ prompt "vtun.............................. VPN tunneling daemon"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBLZO
+ select ADK_PACKAGE_LIBOPENSSL
+ select ADK_PACKAGE_ZLIB
+ help
+ A VPN tunneling daemon
+
+ http://vtun.sourceforge.net
+
diff --git a/package/vtun/Makefile b/package/vtun/Makefile
new file mode 100644
index 000000000..f1482a027
--- /dev/null
+++ b/package/vtun/Makefile
@@ -0,0 +1,34 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= vtun
+PKG_VERSION:= 3.0.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c342ffe77055d4248a38f0b380f28c1b
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=vtun/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,VTUN,vtun,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --with-ssl-headers=$(STAGING_DIR)/usr/include/openssl \
+ --disable-lzo
+#CONFIGURE_ENV+= LIBS="${TLDFLAGS}" \
+# BLOWFISH_HDR_DIR="${STAGING_DIR}/usr/include/openssl" \
+# LZO_HDR_DIR="${STAGING_DIR}/usr/include/lzo" \
+# SSL_HDR_DIR="${STAGING_DIR}/usr/include/openssl"
+BUILD_STYLE:= auto
+ALL_TARGET:= vtund
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_VTUN}/etc/
+ ${INSTALL_DATA} ${WRKBUILD}/vtund.conf ${IDIR_VTUN}/etc/
+ ${INSTALL_DIR} ${IDIR_VTUN}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/vtund ${IDIR_VTUN}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/vtun/ipkg/vtun.conffiles b/package/vtun/ipkg/vtun.conffiles
new file mode 100644
index 000000000..1195041c5
--- /dev/null
+++ b/package/vtun/ipkg/vtun.conffiles
@@ -0,0 +1 @@
+/etc/vtund.conf
diff --git a/package/vtun/ipkg/vtun.control b/package/vtun/ipkg/vtun.control
new file mode 100644
index 000000000..6d823de1e
--- /dev/null
+++ b/package/vtun/ipkg/vtun.control
@@ -0,0 +1,5 @@
+Package: vtun
+Priority: optional
+Section: net
+Description: A VPN tunnel daemon
+Depends: libopenssl, liblzo, zlib, kmod-tun
diff --git a/package/vtun/patches/patch-configure b/package/vtun/patches/patch-configure
new file mode 100644
index 000000000..476d5dc80
--- /dev/null
+++ b/package/vtun/patches/patch-configure
@@ -0,0 +1,144 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- vtun-3.0.1.orig/configure 2006-12-11 08:55:06.000000000 +0100
++++ vtun-3.0.1/configure 2009-05-12 00:38:14.000000000 +0200
+@@ -5661,140 +5661,6 @@ echo "$as_me: error: SSL headers not fou
+
+ fi
+
+-if test "$SSL" = "yes"; then
+- echo "$as_me:$LINENO: result: " >&5
+-echo "${ECHO_T}" >&6
+- { echo "$as_me:$LINENO: checking for blowfish Library and Header files ... ..." >&5
+-echo "$as_me: checking for blowfish Library and Header files ... ..." >&6;}
+-
+- echo "$as_me:$LINENO: checking \"for blowfish.h\"" >&5
+-echo $ECHO_N "checking \"for blowfish.h\"... $ECHO_C" >&6
+- ac_hdr_found=no
+- for p in $BLOWFISH_HDR_DIR /usr/include/ssl /usr/include/openssl /usr/include /usr/local/include /usr/local/ssl/include /usr/include/crypto; do
+- if test -n "$p"; then
+- dir="$p"
+- else
+- dir="/usr/include"
+- fi
+-
+- ac_file_found=yes
+- for f in blowfish.h; do
+- if test ! -f $dir/$f; then
+- ac_file_found=no
+- break;
+- fi
+- done
+-
+- if test "$ac_file_found" = "yes" ; then
+-
+- ac_hdr_found=yes
+- break
+-
+-
+- else
+- :
+- fi
+-
+- done
+- if test "$ac_hdr_found" = "yes" ; then
+- if test -n "$p"; then
+- CPPFLAGS="$CPPFLAGS -I$p"
+- fi
+- echo "$as_me:$LINENO: result: ($dir) yes " >&5
+-echo "${ECHO_T}($dir) yes " >&6
+- echo "$as_me:$LINENO: checking for BF_set_key in -lcrypto" >&5
+-echo $ECHO_N "checking for BF_set_key in -lcrypto... $ECHO_C" >&6
+-if test "${ac_cv_lib_crypto_BF_set_key+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lcrypto $LIBS"
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-/* Override any gcc2 internal prototype to avoid an error. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char BF_set_key ();
+-int
+-main ()
+-{
+-BF_set_key ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag"
+- || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_lib_crypto_BF_set_key=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-ac_cv_lib_crypto_BF_set_key=no
+-fi
+-rm -f conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-LIBS=$ac_check_lib_save_LIBS
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_BF_set_key" >&5
+-echo "${ECHO_T}$ac_cv_lib_crypto_BF_set_key" >&6
+-if test $ac_cv_lib_crypto_BF_set_key = yes; then
+-
+- LIBS="$LIBS -lcrypto"
+- cat >>confdefs.h <<\_ACEOF
+-#define HAVE_SSL 1
+-_ACEOF
+-
+- cat >>confdefs.h <<\_ACEOF
+-#define HAVE_SSL_BLOWFISH 1
+-_ACEOF
+-
+-
+-else
+- { { echo "$as_me:$LINENO: error: SSL library not found. " >&5
+-echo "$as_me: error: SSL library not found. " >&2;}
+- { (exit 1); exit 1; }; }
+-
+-fi
+-
+- else
+- echo "$as_me:$LINENO: result: \"no\"" >&5
+-echo "${ECHO_T}\"no\"" >&6
+- { { echo "$as_me:$LINENO: error: SSL headers not found. " >&5
+-echo "$as_me: error: SSL headers not found. " >&2;}
+- { (exit 1); exit 1; }; }
+-
+- fi
+-
+-fi
+
+ if test "$SSL" = "yes"; then
+ echo "$as_me:$LINENO: result: " >&5
diff --git a/package/watchdog/Config.in b/package/watchdog/Config.in
new file mode 100644
index 000000000..aae8b3ea8
--- /dev/null
+++ b/package/watchdog/Config.in
@@ -0,0 +1,7 @@
+config ADK_PACKAGE_WATCHDOG
+ prompt "watchdog.......................... configurable watchdog"
+ tristate
+ default n
+ help
+ watchdog
+
diff --git a/package/watchdog/Makefile b/package/watchdog/Makefile
new file mode 100644
index 000000000..bce8e4141
--- /dev/null
+++ b/package/watchdog/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= watchdog
+PKG_VERSION:= 5.4
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 66480128b9dabcced2e4c8db3e60fa50
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=watchdog/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WATCHDOG,watchdog,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+XAKE_FLAGS+= CCOPT="${TARGET_CFLAGS}" \
+ INCLS="-I. -I${STAGING_DIR}/usr/include" \
+ LIBS="-L${STAGING_DIR}/usr/lib"
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WATCHDOG}/etc/
+ ${INSTALL_DATA} ${WRKINST}/etc/watchdog.conf ${IDIR_WATCHDOG}/etc/
+ ${INSTALL_DIR} ${IDIR_WATCHDOG}/etc/init.d/
+ ${INSTALL_BIN} ./files/watchdog.init \
+ ${IDIR_WATCHDOG}/etc/init.d/watchdog
+ ${INSTALL_DIR} ${IDIR_WATCHDOG}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/watchdog \
+ ${WRKINST}/usr/sbin/wd_keepalive ${IDIR_WATCHDOG}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/watchdog/files/watchdog.init b/package/watchdog/files/watchdog.init
new file mode 100644
index 000000000..fba89afe5
--- /dev/null
+++ b/package/watchdog/files/watchdog.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#FWINIT 15
+
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${watchdog:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/watchdog
+ ;;
+stop)
+ killall watchdog
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "usage: $0 { start | stop | restart }"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/watchdog/ipkg/watchdog.conffiles b/package/watchdog/ipkg/watchdog.conffiles
new file mode 100644
index 000000000..3ef13592a
--- /dev/null
+++ b/package/watchdog/ipkg/watchdog.conffiles
@@ -0,0 +1 @@
+/etc/watchdog.conf
diff --git a/package/watchdog/ipkg/watchdog.control b/package/watchdog/ipkg/watchdog.control
new file mode 100644
index 000000000..1cde1974e
--- /dev/null
+++ b/package/watchdog/ipkg/watchdog.control
@@ -0,0 +1,4 @@
+Package: watchdog
+Priority: opt
+Section: sys
+Description: watchdog
diff --git a/package/watchdog/ipkg/watchdog.postinst b/package/watchdog/ipkg/watchdog.postinst
new file mode 100644
index 000000000..17d144395
--- /dev/null
+++ b/package/watchdog/ipkg/watchdog.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf watchdog watchdog NO
diff --git a/package/watchdog/patches/01-fstab-sys_siglist.patch b/package/watchdog/patches/01-fstab-sys_siglist.patch
new file mode 100644
index 000000000..604ecdcb6
--- /dev/null
+++ b/package/watchdog/patches/01-fstab-sys_siglist.patch
@@ -0,0 +1,11 @@
+--- watchdog-5.2.4.orig.orig/src/fstab.c 2003-01-28 07:47:38.000000000 +0100
++++ watchdog-5.2.4.orig/src/fstab.c 2008-10-16 12:56:40.000000000 +0200
+@@ -237,7 +237,7 @@ static int old_lockfile = 1;
+ /* Ensure that the lock is released if we are interrupted. */
+ static void
+ handler (int sig) {
+- die (EX_USER, "%s", sys_siglist[sig]);
++ die (EX_USER, "%s", "sys_siglist[sig]");
+ }
+
+ static void
diff --git a/package/watchdog/patches/patch-src_mntent_c b/package/watchdog/patches/patch-src_mntent_c
new file mode 100644
index 000000000..c00b6ff45
--- /dev/null
+++ b/package/watchdog/patches/patch-src_mntent_c
@@ -0,0 +1,21 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- watchdog-5.2.4.orig.orig/src/mntent.c 2003-01-28 07:47:38.000000000 +0100
++++ watchdog-5.2.4.orig/src/mntent.c 2008-10-16 13:00:20.000000000 +0200
+@@ -6,7 +6,7 @@
+ #endif
+
+ #include <stdio.h>
+-#include <string.h> /* for index */
++#include <string.h> /* for strchr */
+ #include <ctype.h> /* for isdigit */
+ #include "wd_mntent.h"
+ #include "sundries.h" /* for xmalloc */
+@@ -155,7 +155,7 @@ my_getmntent (mntFILE *mfp) {
+ if (fgets (buf, sizeof(buf), mfp->mntent_fp) == NULL)
+ return NULL;
+
+- s = index (buf, '\n');
++ s = strchr (buf, '\n');
+ if (s == NULL) {
+ /* extremely long line - assume file was corrupted */
+ mfp->mntent_errs = 1;
diff --git a/package/watchdog/patches/patch-src_umount_c b/package/watchdog/patches/patch-src_umount_c
new file mode 100644
index 000000000..cf421ce79
--- /dev/null
+++ b/package/watchdog/patches/patch-src_umount_c
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- watchdog-5.2.4.orig.orig/src/umount.c 2003-01-28 07:47:38.000000000 +0100
++++ watchdog-5.2.4.orig/src/umount.c 2008-10-16 13:00:07.000000000 +0200
+@@ -210,7 +210,7 @@ umount_one (const char *spec, const char
+ if (res < 0)
+ umnt_err2 = errno;
+ /* Do not complain about remote NFS mount points */
+- if (errno == ENOENT && index(spec, ':'))
++ if (errno == ENOENT && strchr(spec, ':'))
+ umnt_err2 = 0;
+ }
+ }
diff --git a/package/wccpd/Config.in b/package/wccpd/Config.in
new file mode 100644
index 000000000..d2efa286c
--- /dev/null
+++ b/package/wccpd/Config.in
@@ -0,0 +1,11 @@
+config ADK_PACKAGE_WCCPD
+ prompt "wccpd............................. a Web Cache Coordination daemon"
+ tristate
+ default n
+ help
+ wccpd is a WCCP (Web Cache Coordination Protocol) server daemon
+ It allows a router (running Linux) to redirect web traffic to a
+ group of Squid servers using WCCP as the monitoring/controling
+ protocol.
+
+ http://wccpd.sourceforge.net/
diff --git a/package/wccpd/Makefile b/package/wccpd/Makefile
new file mode 100644
index 000000000..fef79b49f
--- /dev/null
+++ b/package/wccpd/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wccpd
+PKG_VERSION:= 0.2
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 5f15c274de61dfb88e0dbfc1ccbe6b67
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=wccpd/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WCCPD,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_setpgrp_void=yes
+CONFIGURE_ARGS+= --enable-static \
+ --with-gnu-ld
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WCCPD}/usr/sbin/
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/wccpd ${IDIR_WCCPD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wccpd/ipkg/wccpd.control b/package/wccpd/ipkg/wccpd.control
new file mode 100644
index 000000000..e62539a7d
--- /dev/null
+++ b/package/wccpd/ipkg/wccpd.control
@@ -0,0 +1,4 @@
+Package: wccpd
+Priority: optional
+Section: net
+Description: A WCCP (Web Cache Coordination Protocol) server daemon
diff --git a/package/wdfs/Config.in b/package/wdfs/Config.in
new file mode 100644
index 000000000..35665e1af
--- /dev/null
+++ b/package/wdfs/Config.in
@@ -0,0 +1,14 @@
+config ADK_PACKAGE_WDFS
+ prompt "wdfs.............................. WebDAV filesystem"
+ tristate
+ default n
+ select ADK_PACKAGE_FUSE_UTILS
+ select ADK_PACKAGE_NEON
+ select ADK_PACKAGE_GLIB2
+ help
+ WebDAV is an extension to HTTP that allows remote collaborative
+ authoring of Web resources, defined in RFC 2518.
+
+ wdfs is a FUSE userland filesystem allowing to mount WebDAV
+ shares as local filesystems, with optional support of transparent
+ versioning with subversion (not yet included in this package).
diff --git a/package/wdfs/Makefile b/package/wdfs/Makefile
new file mode 100644
index 000000000..a6858dd19
--- /dev/null
+++ b/package/wdfs/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME= wdfs
+PKG_VERSION= 1.4.2
+PKG_RELEASE= 2
+PKG_MD5SUM= 628bb44194d04c1cf8aacc446ed0a230
+MASTER_SITES= http://noedler.de/projekte/wdfs/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WDFS,wdfs,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WDFS}/usr/bin
+ ${CP} ${WRKINST}/usr/bin/wdfs ${IDIR_WDFS}/usr/bin
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wdfs/ipkg/wdfs.control b/package/wdfs/ipkg/wdfs.control
new file mode 100644
index 000000000..f2e0cf338
--- /dev/null
+++ b/package/wdfs/ipkg/wdfs.control
@@ -0,0 +1,5 @@
+Package: wdfs
+Priority: optional
+Section: net
+Depends: openssl, fuse-utils, kmod-fuse, libfuse, neon, glib2
+Description: WebDAV filesystem
diff --git a/package/weechat/Config.in b/package/weechat/Config.in
new file mode 100644
index 000000000..0945c9dc9
--- /dev/null
+++ b/package/weechat/Config.in
@@ -0,0 +1,26 @@
+#menu "weechat........................... Lightweight IRC client"
+
+config ADK_PACKAGE_WEECHAT
+ prompt "weechat........................... Lightweight IRC client"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBNCURSES
+ select ADK_PACKAGE_LIBICONV
+ help
+ Fast, light & extensible IRC client
+
+ http://weechat.flashtux.org
+
+config ADK_COMPILE_WEECHAT_WITH_TLS
+ prompt " Enable TLS support"
+ bool
+ select ADK_PACKAGE_LIBGNUTLS
+ depends ADK_PACKAGE_WEECHAT
+
+config ADK_COMPILE_WEECHAT_WITH_LUA
+ prompt " Enable LUA scripting"
+ bool
+ select ADK_PACKAGE_LIBLUA
+ depends ADK_PACKAGE_WEECHAT
+
+#endmenu
diff --git a/package/weechat/Makefile b/package/weechat/Makefile
new file mode 100644
index 000000000..1e1a5023a
--- /dev/null
+++ b/package/weechat/Makefile
@@ -0,0 +1,49 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= weechat
+PKG_VERSION:= 0.1.8
+PKG_RELEASE:= 2
+PKG_MD5SUM:= 73d6bc211ac32c597f0d278506480a20
+
+MASTER_SITES:= http://weechat.flashtux.org/download/
+
+include ${TOPDIR}/mk/package.mk
+
+PKG_DEPEND:= libncurses libiconv
+
+ifeq (${ADK_COMPILE_WEECHAT_WITH_TLS},y)
+ENABLE_TLS:= --with-libgnutls-prefix=${STAGING_DIR}/usr
+PKG_DEPEND+= gnutls
+else
+ENABLE_TLS:= --disable-gnutls
+endif
+
+ifneq (${ADK_COMPILE_WEECHAT_WITH_LUA},y)
+DISABLE_LUA:= --disable-lua
+else
+PKG_DEPEND+= liblua
+endif
+
+$(eval $(call PKG_template,WEECHAT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${ARCH},${PKG_DEPEND}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= ${ENABLE_TLS} \
+ --with-debug=0 \
+ --disable-perl \
+ --disable-python \
+ --disable-ruby \
+ --with-libiconv-prefix='${STAGING_DIR}/usr' \
+ ${DISABLE_LUA}
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WEECHAT}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/weechat-curses ${IDIR_WEECHAT}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/weechat/ipkg/weechat.control b/package/weechat/ipkg/weechat.control
new file mode 100644
index 000000000..81a2bec6c
--- /dev/null
+++ b/package/weechat/ipkg/weechat.control
@@ -0,0 +1,4 @@
+Package: weechat
+Section: net
+Priority: optional
+Description: Lightweight IRC client
diff --git a/package/weechat/patches/patch-src_gui_curses_Makefile_in b/package/weechat/patches/patch-src_gui_curses_Makefile_in
new file mode 100644
index 000000000..e73dd48b5
--- /dev/null
+++ b/package/weechat/patches/patch-src_gui_curses_Makefile_in
@@ -0,0 +1,12 @@
+$Id$
+--- weechat-0.1.8.orig/src/gui/curses/Makefile.in 2006-03-18 08:46:20.000000000 +0000
++++ weechat-0.1.8/src/gui/curses/Makefile.in 2007-02-15 21:56:21.000000000 +0000
+@@ -365,7 +365,7 @@ clean-binPROGRAMS:
+ done
+ weechat-curses$(EXEEXT): $(weechat_curses_OBJECTS) $(weechat_curses_DEPENDENCIES)
+ @rm -f weechat-curses$(EXEEXT)
+- $(LINK) $(weechat_curses_LDFLAGS) $(weechat_curses_OBJECTS) $(weechat_curses_LDADD) $(LIBS)
++ $(LINK) $(weechat_curses_LDFLAGS) $(weechat_curses_OBJECTS) $(weechat_curses_LDADD) $(LIBICONV) $(LIBS)
+
+ mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
diff --git a/package/wifidog/Config.in b/package/wifidog/Config.in
new file mode 100644
index 000000000..0680cc16d
--- /dev/null
+++ b/package/wifidog/Config.in
@@ -0,0 +1,13 @@
+config ADK_PACKAGE_WIFIDOG
+ prompt "wifidog........................... A wireless captive portal solution"
+ tristate
+ default n
+ select ADK_PACKAGE_IPTABLES
+ help
+ The Wifidog project is a complete and embeddable captive
+ portal solution for wireless community groups or individuals
+ who wish to open a free Hotspot while still preventing abuse
+ of their Internet connection.
+
+ http://www.wifidog.org/
+
diff --git a/package/wifidog/Makefile b/package/wifidog/Makefile
new file mode 100644
index 000000000..b46e273f3
--- /dev/null
+++ b/package/wifidog/Makefile
@@ -0,0 +1,37 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wifidog
+PKG_VERSION:= 1.1.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= abe5f7123179a0f08c493ce59fb3cb31
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=${PKG_NAME}/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WIFIDOG,wifidog,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ENV+= ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_memcmp_working=yes \
+ ac_cv_func_setvbuf_reversed=no
+BUILD_STYLE+= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WIFIDOG}/etc/init.d/
+ ${INSTALL_BIN} ./files/${PKG_NAME}.init \
+ ${IDIR_WIFIDOG}/etc/init.d/wifidog
+ ${INSTALL_DATA} ./files/wifidog.conf ${IDIR_WIFIDOG}/etc/
+ ${INSTALL_DIR} ${IDIR_WIFIDOG}/usr/bin
+ ${INSTALL_DIR} ${IDIR_WIFIDOG}/usr/lib
+ ${INSTALL_BIN} ${WRKBUILD}/scripts/init.d/wifidog ${IDIR_WIFIDOG}/usr/bin/wifidog-init
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/wifidog \
+ ${WRKINST}/usr/bin/wdctl ${IDIR_WIFIDOG}/usr/bin/
+ ${CP} ${WRKINST}/usr/lib/libhttpd.so* ${IDIR_WIFIDOG}/usr/lib/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wifidog/files/wifidog.conf b/package/wifidog/files/wifidog.conf
new file mode 100644
index 000000000..6d955a645
--- /dev/null
+++ b/package/wifidog/files/wifidog.conf
@@ -0,0 +1,177 @@
+# $Header$
+# WiFiDog Configuration file
+
+# Parameter: GatewayID
+# Default: default
+# Optional but essential for monitoring purposes
+#
+# Set this to the template ID on the auth server
+# this is used to give a customized login page to the clients
+# If none is supplied, the default login page will be used.
+
+GatewayID default
+
+# Parameter: ExternalInterface
+# Default: NONE
+# Optional
+#
+# Set this to the external interface. Typically vlan1 for OpenADK, and eth0 or ppp0 otherwise
+
+# ExternalInterface eth0
+
+# Parameter: GatewayInterface
+# Default: NONE
+# Mandatory
+#
+# Set this to the internal interface. Typically br0 for OpenADK, and eth1 otherwise
+
+GatewayInterface br0
+
+# Parameter: GatewayAddress
+# Default: Find it from GatewayInterface
+# Optional
+#
+# Set this to the internal IP address of the gateway
+
+# GatewayAddress 192.168.1.1
+
+# Parameter: AuthServMaxTries
+# Default: 1
+# Optional
+#
+# Sets the number of auth servers the gateway will attempt to contact when a request fails.
+# this number should be equal to the number of AuthServer lines in this
+# configuration but it should probably not exceed 3.
+
+# AuthServMaxTries 3
+
+# Parameter: AuthServer
+# Default: NONE
+# Mandatory
+#
+# Set this to the hostname or IP of your auth server, the path where
+# WiFiDog-auth resides and optionally as a second argument, the port it
+# listens on.
+#AuthServer {
+# Hostname (Mandatory; Default: NONE)
+# SSLAvailable (Optional; Default: no; Possible values: yes, no)
+# SSLPort 443 (Optional; Default: 443)
+# HTTPPort 80 (Optional; Default: 80)
+# Path wifidog/ (Optional; Default: /wifidog/ Note: The path must be both prefixed and suffixed by /. Use a single / for server root.)
+#}
+
+#AuthServer {
+# Hostname auth.ilesansfil.org
+# SSLAvailable yes
+# Path /
+#}
+
+#AuthServer {
+# Hostname auth2.ilesansfil.org
+# SSLAvailable yes
+# Path /
+#}
+
+#AuthServer {
+# Hostname auth3.ilesansfil.org
+# SSLAvailable yes
+# Path /
+#}
+
+# Parameter: Daemon
+# Default: 1
+# Optional
+#
+# Set this to true if you want to run as a daemon
+# Daemon 1
+
+# Parameter: GatewayPort
+# Default: 2060
+# Optional
+#
+# Listen on this port
+# GatewayPort 2060
+
+# Parameter: HTTPDName
+# Default: WiFiDog
+# Optional
+#
+# Define what name the HTTPD server will respond
+# HTTPDName WiFiDog
+
+# Parameter: HTTPDMaxConn
+# Default: 10
+# Optional
+#
+# How many sockets to listen to
+# HTTPDMaxConn 10
+
+# Parameter: CheckInterval
+# Default: 60
+# Optional
+#
+# How many seconds should we wait between timeout checks
+CheckInterval 60
+
+# Parameter: ClientTimeout
+# Default: 5
+# Optional
+#
+# Set this to the desired of number of CheckInterval of inactivity before a client is logged out
+# The timeout will be INTERVAL * TIMEOUT
+ClientTimeout 5
+
+# Parameter: FirewallRuleSet
+# Default: none
+# Mandatory
+#
+# Groups a number of FirewallRule statements together.
+
+# Parameter: FirewallRule
+# Default: none
+#
+# Define one firewall rule in a rule set.
+
+# Rule Set: global
+#
+# Used for rules to be applied to all other rulesets except locked.
+# This is the default config for the Teliphone service.
+FirewallRuleSet global {
+ FirewallRule allow udp to 69.90.89.192/27
+ FirewallRule allow udp to 69.90.85.0/27
+ FirewallRule allow tcp port 80 to 69.90.89.205
+}
+
+# Rule Set: validating-users
+#
+# Used for new users validating their account
+FirewallRuleSet validating-users {
+ FirewallRule block tcp port 25
+ FirewallRule allow to 0.0.0.0/0
+}
+
+# Rule Set: known-users
+#
+# Used for normal validated users.
+FirewallRuleSet known-users {
+ FirewallRule allow to 0.0.0.0/0
+}
+
+# Rule Set: unknown-users
+#
+# Used for unvalidated users, this is the ruleset that gets redirected.
+#
+# XXX The redirect code adds the Default DROP clause.
+FirewallRuleSet unknown-users {
+ FirewallRule allow udp port 53
+ FirewallRule allow tcp port 53
+ FirewallRule allow udp port 67
+ FirewallRule allow tcp port 67
+}
+
+# Rule Set: locked-users
+#
+# Used for users that have been locked out.
+FirewallRuleSet locked-users {
+ FirewallRule block to 0.0.0.0/0
+}
diff --git a/package/wifidog/files/wifidog.init b/package/wifidog/files/wifidog.init
new file mode 100644
index 000000000..4a23a8e34
--- /dev/null
+++ b/package/wifidog/files/wifidog.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 65
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${wifidog:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ wifidog-init start
+ ;;
+stop)
+ wifidog-init stop
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/wifidog/ipkg/wifidog.conffiles b/package/wifidog/ipkg/wifidog.conffiles
new file mode 100644
index 000000000..aaa3dd140
--- /dev/null
+++ b/package/wifidog/ipkg/wifidog.conffiles
@@ -0,0 +1 @@
+/etc/wifidog.conf
diff --git a/package/wifidog/ipkg/wifidog.control b/package/wifidog/ipkg/wifidog.control
new file mode 100644
index 000000000..18d498552
--- /dev/null
+++ b/package/wifidog/ipkg/wifidog.control
@@ -0,0 +1,8 @@
+Package: wifidog
+Priority: optional
+Section: net
+Depends: iptables, iptables-extra, kmod-iptables-extra
+Description: WiFiDog is a complete and embeddable captive portal
+ solution for wireless community groups or individuals who
+ wish to open a free Hotspot while still preventing abuse
+ of their Internet connection.
diff --git a/package/wifidog/ipkg/wifidog.postinst b/package/wifidog/ipkg/wifidog.postinst
new file mode 100644
index 000000000..e778a2300
--- /dev/null
+++ b/package/wifidog/ipkg/wifidog.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf wifidog wifidog NO
diff --git a/package/wifidog/patches/patch-libhttpd_api_c b/package/wifidog/patches/patch-libhttpd_api_c
new file mode 100644
index 000000000..db790195b
--- /dev/null
+++ b/package/wifidog/patches/patch-libhttpd_api_c
@@ -0,0 +1,211 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- wifidog-1.1.5.orig/libhttpd/api.c 2007-11-01 21:04:20.000000000 +0100
++++ wifidog-1.1.5/libhttpd/api.c 2008-10-16 13:15:26.000000000 +0200
+@@ -166,7 +166,7 @@ int httpdAddVariable(request *r, char *n
+ while(*name == ' ' || *name == '\t')
+ name++;
+ newVar = malloc(sizeof(httpVar));
+- bzero(newVar, sizeof(httpVar));
++ memset(newVar, 0, sizeof(httpVar));
+ newVar->name = strdup(name);
+ newVar->value = strdup(value);
+ lastVar = NULL;
+@@ -209,14 +209,14 @@ httpd *httpdCreate(host, port)
+ new = malloc(sizeof(httpd));
+ if (new == NULL)
+ return(NULL);
+- bzero(new, sizeof(httpd));
++ memset(new, 0, sizeof(httpd));
+ new->port = port;
+ if (host == HTTP_ANY_ADDR)
+ new->host = HTTP_ANY_ADDR;
+ else
+ new->host = strdup(host);
+ new->content = (httpDir*)malloc(sizeof(httpDir));
+- bzero(new->content,sizeof(httpDir));
++ memset(new->content, 0, sizeof(httpDir));
+ new->content->name = strdup("");
+
+ /*
+@@ -270,7 +270,7 @@ httpd *httpdCreate(host, port)
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&opt,sizeof(int));
+ # endif
+ new->serverSock = sock;
+- bzero(&addr, sizeof(addr));
++ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ if (new->host == HTTP_ANY_ADDR)
+ {
+@@ -344,7 +344,7 @@ request *httpdGetConnection(server, time
+ }
+ memset((void *)r, 0, sizeof(request));
+ /* Get on with it */
+- bzero(&addr, sizeof(addr));
++ memset(&addr, 0, sizeof(addr));
+ addrLen = sizeof(addr);
+ r->clientSock = accept(server->serverSock,(struct sockaddr *)&addr,
+ &addrLen);
+@@ -469,14 +469,14 @@ int httpdReadRequest(httpd *server, requ
+ *val,
+ *end;
+
+- var = index(buf,':');
++ var = strchr(buf,':');
+ while(var)
+ {
+ var++;
+- val = index(var, '=');
++ val = strchr(var, '=');
+ *val = 0;
+ val++;
+- end = index(val,';');
++ end = strchr(val,';');
+ if(end)
+ *end = 0;
+ httpdAddVariable(r, var, val);
+@@ -488,7 +488,7 @@ int httpdReadRequest(httpd *server, requ
+ #if 0
+ if (strncasecmp(buf,"Authorization: ",15) == 0)
+ {
+- cp = index(buf,':') + 2;
++ cp = strchr(buf,':') + 2;
+ if (strncmp(cp,"Basic ", 6) != 0)
+ {
+ /* Unknown auth method */
+@@ -497,11 +497,11 @@ int httpdReadRequest(httpd *server, requ
+ {
+ char authBuf[100];
+
+- cp = index(cp,' ') + 1;
++ cp = strchr(cp,' ') + 1;
+ _httpd_decode(cp, authBuf, 100);
+ r->request.authLength =
+ strlen(authBuf);
+- cp = index(authBuf,':');
++ cp = strchr(authBuf,':');
+ if (cp)
+ {
+ *cp = 0;
+@@ -517,7 +517,7 @@ int httpdReadRequest(httpd *server, requ
+ #if 0
+ if (strncasecmp(buf,"Referer: ",9) == 0)
+ {
+- cp = index(buf,':') + 2;
++ cp = strchr(buf,':') + 2;
+ if(cp)
+ {
+ strncpy(r->request.referer,cp,
+@@ -529,7 +529,7 @@ int httpdReadRequest(httpd *server, requ
+ * present. */
+ if (strncasecmp(buf,"Host: ",6) == 0)
+ {
+- cp = index(buf,':') + 2;
++ cp = strchr(buf,':') + 2;
+ if(cp)
+ {
+ strncpy(r->request.host,cp,
+@@ -540,12 +540,12 @@ int httpdReadRequest(httpd *server, requ
+ #if 0
+ if (strncasecmp(buf,"If-Modified-Since: ",19) == 0)
+ {
+- cp = index(buf,':') + 2;
++ cp = strchr(buf,':') + 2;
+ if(cp)
+ {
+ strncpy(r->request.ifModified,cp,
+ HTTP_MAX_URL);
+- cp = index(r->request.ifModified,
++ cp = strchr(r->request.ifModified,
+ ';');
+ if (cp)
+ *cp = 0;
+@@ -553,7 +553,7 @@ int httpdReadRequest(httpd *server, requ
+ }
+ if (strncasecmp(buf,"Content-Type: ",14) == 0)
+ {
+- cp = index(buf,':') + 2;
++ cp = strchr(buf,':') + 2;
+ if(cp)
+ {
+ strncpy(r->request.contentType,cp,
+@@ -562,7 +562,7 @@ int httpdReadRequest(httpd *server, requ
+ }
+ if (strncasecmp(buf,"Content-Length: ",16) == 0)
+ {
+- cp = index(buf,':') + 2;
++ cp = strchr(buf,':') + 2;
+ if(cp)
+ r->request.contentLength=atoi(cp);
+ }
+@@ -581,7 +581,7 @@ int httpdReadRequest(httpd *server, requ
+ */
+ if (r->request.contentLength > 0)
+ {
+- bzero(buf, HTTP_MAX_LEN);
++ memset(buf, 0, HTTP_MAX_LEN);
+ _httpd_readBuf(r, buf, r->request.contentLength);
+ _httpd_storeData(r, buf);
+
+@@ -591,7 +591,7 @@ int httpdReadRequest(httpd *server, requ
+ /*
+ ** Process any URL data
+ */
+- cp = index(r->request.path,'?');
++ cp = strchr(r->request.path,'?');
+ if (cp != NULL)
+ {
+ *cp++ = 0;
+@@ -661,7 +661,7 @@ int httpdAddFileContent(server, dir, nam
+ newEntry = malloc(sizeof(httpContent));
+ if (newEntry == NULL)
+ return(-1);
+- bzero(newEntry,sizeof(httpContent));
++ memset(newEntry, 0, sizeof(httpContent));
+ newEntry->name = strdup(name);
+ newEntry->type = HTTP_FILE;
+ newEntry->indexFlag = indexFlag;
+@@ -699,7 +699,7 @@ int httpdAddWildcardContent(server, dir,
+ newEntry = malloc(sizeof(httpContent));
+ if (newEntry == NULL)
+ return(-1);
+- bzero(newEntry,sizeof(httpContent));
++ memset(newEntry, 0, sizeof(httpContent));
+ newEntry->name = NULL;
+ newEntry->type = HTTP_WILDCARD;
+ newEntry->indexFlag = HTTP_FALSE;
+@@ -755,7 +755,7 @@ int httpdAddCContent(server, dir, name,
+ newEntry = malloc(sizeof(httpContent));
+ if (newEntry == NULL)
+ return(-1);
+- bzero(newEntry,sizeof(httpContent));
++ memset(newEntry, 0, sizeof(httpContent));
+ newEntry->name = strdup(name);
+ newEntry->type = HTTP_C_FUNCT;
+ newEntry->indexFlag = indexFlag;
+@@ -780,7 +780,7 @@ int httpdAddCWildcardContent(server, dir
+ newEntry = malloc(sizeof(httpContent));
+ if (newEntry == NULL)
+ return(-1);
+- bzero(newEntry,sizeof(httpContent));
++ memset(newEntry, 0, sizeof(httpContent));
+ newEntry->name = NULL;
+ newEntry->type = HTTP_C_WILDCARD;
+ newEntry->indexFlag = HTTP_FALSE;
+@@ -805,7 +805,7 @@ int httpdAddStaticContent(server, dir, n
+ newEntry = malloc(sizeof(httpContent));
+ if (newEntry == NULL)
+ return(-1);
+- bzero(newEntry,sizeof(httpContent));
++ memset(newEntry, 0, sizeof(httpContent));
+ newEntry->name = strdup(name);
+ newEntry->type = HTTP_STATIC;
+ newEntry->indexFlag = indexFlag;
+@@ -946,7 +946,7 @@ void httpdProcessRequest(httpd *server,
+
+ r->response.responseLength = 0;
+ strncpy(dirName, httpdRequestPath(r), HTTP_MAX_URL);
+- cp = rindex(dirName, '/');
++ cp = strrchr(dirName, '/');
+ if (cp == NULL)
+ {
+ printf("Invalid request path '%s'\n",dirName);
diff --git a/package/wifidog/patches/patch-libhttpd_ip_acl_c b/package/wifidog/patches/patch-libhttpd_ip_acl_c
new file mode 100644
index 000000000..932855b5d
--- /dev/null
+++ b/package/wifidog/patches/patch-libhttpd_ip_acl_c
@@ -0,0 +1,30 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- wifidog-1.1.5.orig/libhttpd/ip_acl.c 2007-03-12 20:37:06.000000000 +0100
++++ wifidog-1.1.5/libhttpd/ip_acl.c 2008-10-16 13:12:15.000000000 +0200
+@@ -52,22 +52,22 @@ static int scanCidr(val, result, length)
+
+ cp = val;
+ res1 = atoi(cp);
+- cp = index(cp,'.');
++ cp = strchr(cp,'.');
+ if (!cp)
+ return(-1);
+ cp++;
+ res2 = atoi(cp);
+- cp = index(cp,'.');
++ cp = strchr(cp,'.');
+ if (!cp)
+ return(-1);
+ cp++;
+ res3 = atoi(cp);
+- cp = index(cp,'.');
++ cp = strchr(cp,'.');
+ if (!cp)
+ return(-1);
+ cp++;
+ res4 = atoi(cp);
+- cp = index(cp,'/');
++ cp = strchr(cp,'/');
+ if (!cp)
+ {
+ res5 = 32;
diff --git a/package/wifidog/patches/patch-libhttpd_protocol_c b/package/wifidog/patches/patch-libhttpd_protocol_c
new file mode 100644
index 000000000..767337dd6
--- /dev/null
+++ b/package/wifidog/patches/patch-libhttpd_protocol_c
@@ -0,0 +1,48 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- wifidog-1.1.5.orig/libhttpd/protocol.c 2007-11-01 21:04:20.000000000 +0100
++++ wifidog-1.1.5/libhttpd/protocol.c 2008-10-16 13:12:58.000000000 +0200
+@@ -83,7 +83,7 @@ int _httpd_readChar(request *r, char *cp
+ {
+ if (r->readBufRemain == 0)
+ {
+- bzero(r->readBuf, HTTP_READ_BUF_LEN + 1);
++ memset(r->readBuf, 0, HTTP_READ_BUF_LEN + 1);
+ r->readBufRemain = _httpd_net_read(r->clientSock,
+ r->readBuf, HTTP_READ_BUF_LEN);
+ if (r->readBufRemain < 1)
+@@ -352,7 +352,7 @@ void _httpd_storeData(request *r, char *
+
+ cp = query;
+ cp2 = var;
+- bzero(var, strlen(query));
++ memset(var, 0, strlen(query));
+ val = NULL;
+ while(*cp)
+ {
+@@ -483,7 +483,7 @@ httpDir *_httpd_findContentDir(server, d
+ if (createFlag == HTTP_TRUE)
+ {
+ curChild = malloc(sizeof(httpDir));
+- bzero(curChild, sizeof(httpDir));
++ memset(curChild, 0, sizeof(httpDir));
+ curChild->name = strdup(curDir);
+ curChild->next = curItem->children;
+ curItem->children = curChild;
+@@ -606,7 +606,7 @@ void _httpd_sendFile(httpd *server, requ
+ char *suffix;
+ struct stat sbuf;
+
+- suffix = rindex(path, '.');
++ suffix = strrchr(path, '.');
+ if (suffix != NULL)
+ {
+ if (strcasecmp(suffix,".gif") == 0)
+@@ -699,7 +699,7 @@ char *_httpd_escape(str)
+ if (!ACCEPTABLE((unsigned char)*p))
+ unacceptable +=2;
+ result = (char *) malloc(p-str + unacceptable + 1);
+- bzero(result,(p-str + unacceptable + 1));
++ memset(result, 0, (p-str + unacceptable + 1));
+
+ if (result == NULL)
+ {
diff --git a/package/wireless-firmware/Config.in b/package/wireless-firmware/Config.in
new file mode 100644
index 000000000..4e4ab3e7b
--- /dev/null
+++ b/package/wireless-firmware/Config.in
@@ -0,0 +1,11 @@
+config ADK_DOWNLOAD_WIRELESS_FIRMWARE
+ boolean
+ default n
+
+config ADK_PACKAGE_WIRELESS_FIRMWARE_RT61
+ prompt "wireless-firmware-rt61................ firmware rt61/rt2601 wireless cards"
+ tristate
+ default n
+ select ADK_DOWNLOAD_WIRELESS_FIRMWARE
+ help
+
diff --git a/package/wireless-firmware/Makefile b/package/wireless-firmware/Makefile
new file mode 100644
index 000000000..e865468ff
--- /dev/null
+++ b/package/wireless-firmware/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wireless-firmware
+PKG_VERSION:= 1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= d4c690c93b470bc9a681297c2adc6281
+MASTER_SITES:= http://www.ralinktech.com.tw/data/
+DISTFILES:= RT61_Firmware_V1.2.zip
+WRKDIST= ${WRKDIR}/RT61_Firmware_V1.2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WIRELESS_FIRMWARE_RT61,wireless-firmware-rt61,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+INSTALL_STYLE= manual
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_WIRELESS_FIRMWARE_RT61}/lib/firmware
+ ${CP} ${WRKBUILD}/rt2*.bin \
+ ${IDIR_WIRELESS_FIRMWARE_RT61}/lib/firmware
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wireless-firmware/ipkg/wireless-firmware-rt61.control b/package/wireless-firmware/ipkg/wireless-firmware-rt61.control
new file mode 100644
index 000000000..075c5796a
--- /dev/null
+++ b/package/wireless-firmware/ipkg/wireless-firmware-rt61.control
@@ -0,0 +1,4 @@
+Package: wireless-firmware-rt61
+Priority: optional
+Section: sys
+Description: firmware for rt61/rt2601 wireless cards
diff --git a/package/wireless-tools/Config.in b/package/wireless-tools/Config.in
new file mode 100644
index 000000000..5350dcbdc
--- /dev/null
+++ b/package/wireless-tools/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_WIRELESS_TOOLS
+ prompt "wireless-tools.................... Tools for manipulating Linux Wireless Extensions"
+ tristate
+ default n
+ help
+ Tools for configuring Wireless Adapters implementing the "Wireless Extension"
diff --git a/package/wireless-tools/Makefile b/package/wireless-tools/Makefile
new file mode 100644
index 000000000..ed02573bd
--- /dev/null
+++ b/package/wireless-tools/Makefile
@@ -0,0 +1,38 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wireless-tools
+PKG_VERSION:= 29
+PKG_RELEASE:= 1
+PKG_MD5SUM:= e06c222e186f7cc013fd272d023710cb
+
+MASTER_SITES:= http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
+DISTFILES:= wireless_tools.${PKG_VERSION}.tar.gz
+
+WRKDIST= ${WRKDIR}/wireless_tools.29
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WIRELESS_TOOLS,wireless-tools,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CC="${TARGET_CC}" CFLAGS="${TARGET_CFLAGS} -I."
+ALL_TARGET:= libiw.so.29 iwmulticall
+INSTALL_STYLE:= auto
+FAKE_FLAGS:= INSTALL_DIR="${WRKINST}/usr/sbin" \
+ INSTALL_LIB="${WRKINST}/usr/lib" \
+ INSTALL_INC="${WRKINST}/usr/include"
+INSTALL_TARGET:= install-iwmulticall install-hdr install-dynamic
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WIRELESS_TOOLS}/usr/sbin
+ ${INSTALL_DIR} ${IDIR_WIRELESS_TOOLS}/usr/lib
+ ${INSTALL_DATA} ${WRKINST}/usr/lib/libiw.so.* \
+ ${IDIR_WIRELESS_TOOLS}/usr/lib/
+ ${CP} ${WRKINST}/usr/sbin/iw* ${IDIR_WIRELESS_TOOLS}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wireless-tools/ipkg/wireless-tools.control b/package/wireless-tools/ipkg/wireless-tools.control
new file mode 100644
index 000000000..5f472d958
--- /dev/null
+++ b/package/wireless-tools/ipkg/wireless-tools.control
@@ -0,0 +1,4 @@
+Package: wireless-tools
+Priority: optional
+Section: net
+Description: Tools for setting up WiFi cards using the Wireless Extension
diff --git a/package/wireless-tools/patches/debian-2.patch b/package/wireless-tools/patches/debian-2.patch
new file mode 100644
index 000000000..ba8755b70
--- /dev/null
+++ b/package/wireless-tools/patches/debian-2.patch
@@ -0,0 +1,35 @@
+--- wireless-tools-27.orig/iwlib.c
++++ wireless-tools-27/iwlib.c
+@@ -622,6 +622,7 @@
+ {
+ struct iwreq wrq;
+
++ memset((char *) &wrq, 0, sizeof(struct iwreq));
+ memset((char *) info, 0, sizeof(struct wireless_config));
+
+ /* Get wireless name */
+--- wireless-tools-27.orig/Makefile
++++ wireless-tools-27/Makefile
+@@ -64,8 +64,8 @@
+ # Install directories
+ INSTALL_DIR= $(PREFIX)/sbin/
+ INSTALL_LIB= $(PREFIX)/lib/
+-INSTALL_INC= $(PREFIX)/include/
+-INSTALL_MAN= $(PREFIX)/man/
++INSTALL_INC= $(PREFIX)/usr/include/
++INSTALL_MAN= $(PREFIX)/usr/share/man/
+
+ # Various commands
+ RM = rm -f
+@@ -81,9 +81,9 @@
+ endif
+
+ # Other flags
+-CFLAGS=-Os -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
++#CFLAGS=-Os -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
+ -Wpointer-arith -Wcast-qual -Winline -I.
+-#CFLAGS=-O2 -W -Wall -Wstrict-prototypes -I.
++CFLAGS=-O2 -W -Wall -Wstrict-prototypes -I.
+ DEPFLAGS=-MMD
+ XCFLAGS=$(CFLAGS) $(DEPFLAGS) $(WARN) $(HEADERS) $(WELIB_FLAG)
+ PICFLAG=-fPIC
diff --git a/package/wol/Config.in b/package/wol/Config.in
new file mode 100644
index 000000000..25228bf3a
--- /dev/null
+++ b/package/wol/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_WOL
+ prompt "wol............................... Wake On LAN client"
+ tristate
+ default n
+ help
+ wol implements Wake On LAN functionality in a small program.
+ It wakes up hardware that is Magic Packet compliant.
+
+ http://ahh.sourceforge.net/wol/
+
diff --git a/package/wol/Makefile b/package/wol/Makefile
new file mode 100644
index 000000000..1a4434148
--- /dev/null
+++ b/package/wol/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wol
+PKG_VERSION:= 0.7.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c2fa9d7e771134ac8c89d56b8197d4ca
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=ahh/}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WOL,wol,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= ac_cv_func_malloc_0_nonnull=yes \
+ ac_cv_func_realloc_0_nonnull=yes \
+ ac_cv_func_mmap_fixed_mapped=yes \
+ jm_cv_func_working_malloc=yes \
+ ac_cv_func_alloca_works=yes
+BUILD_STYLE:= auto
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WOL}/usr/bin/
+ ${INSTALL_BIN} ${WRKINST}/usr/bin/wol ${IDIR_WOL}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wol/ipkg/wol.control b/package/wol/ipkg/wol.control
new file mode 100644
index 000000000..179ba7c86
--- /dev/null
+++ b/package/wol/ipkg/wol.control
@@ -0,0 +1,4 @@
+Package: wol
+Priority: optional
+Section: net
+Description: A Program to send magic Wake-on-LAN packets
diff --git a/package/wondershaper/Config.in b/package/wondershaper/Config.in
new file mode 100644
index 000000000..96a0e816d
--- /dev/null
+++ b/package/wondershaper/Config.in
@@ -0,0 +1,10 @@
+config ADK_PACKAGE_WONDERSHAPER
+ prompt "wondershaper...................... The Wonder Shaper"
+ tristate
+ default n
+ select ADK_PACKAGE_TC
+ help
+ WonderShaper is a tc based traffic shaping tool.
+
+ Depends: tc
+
diff --git a/package/wondershaper/Makefile b/package/wondershaper/Makefile
new file mode 100644
index 000000000..13617cfec
--- /dev/null
+++ b/package/wondershaper/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wondershaper
+PKG_VERSION:= 1.1a
+PKG_RELEASE:= 7
+PKG_MD5SUM:= bbc5a3a4485ab286e337ce8550e7b990
+MASTER_SITES:= http://lartc.org/wondershaper/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WONDERSHAPER,wondershaper,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_WONDERSHAPER}/usr/sbin/
+ ${INSTALL_DIR} ${IDIR_WONDERSHAPER}/etc/init.d/
+ ${INSTALL_BIN} ${WRKBUILD}/wshaper.htb ${IDIR_WONDERSHAPER}/usr/sbin/wshaper
+ ${INSTALL_DATA} ${WRKBUILD}/wshaper.conf ${IDIR_WONDERSHAPER}/etc/
+ $(INSTALL_BIN) ./files/wondershaper.init \
+ $(IDIR_WONDERSHAPER)/etc/init.d/wondershaper
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wondershaper/files/wondershaper.init b/package/wondershaper/files/wondershaper.init
new file mode 100644
index 000000000..ec5c36e76
--- /dev/null
+++ b/package/wondershaper/files/wondershaper.init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#FWINIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${wondershaper:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ /usr/sbin/wshaper start
+ ;;
+stop)
+ /usr/sbin/wshaper stop
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit 0
diff --git a/package/wondershaper/ipkg/wondershaper.conffiles b/package/wondershaper/ipkg/wondershaper.conffiles
new file mode 100644
index 000000000..14e366cc9
--- /dev/null
+++ b/package/wondershaper/ipkg/wondershaper.conffiles
@@ -0,0 +1 @@
+/etc/wshaper.conf
diff --git a/package/wondershaper/ipkg/wondershaper.control b/package/wondershaper/ipkg/wondershaper.control
new file mode 100644
index 000000000..d90c7bb6f
--- /dev/null
+++ b/package/wondershaper/ipkg/wondershaper.control
@@ -0,0 +1,5 @@
+Package: wondershaper
+Priority: optional
+Section: net
+Depends: tc
+Description: WonderShaper is a tc based traffic shaping tool.
diff --git a/package/wondershaper/ipkg/wondershaper.postinst b/package/wondershaper/ipkg/wondershaper.postinst
new file mode 100644
index 000000000..6e6c384a0
--- /dev/null
+++ b/package/wondershaper/ipkg/wondershaper.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf wondershaper wondershaper NO
diff --git a/package/wondershaper/patches/01-change-default.patch b/package/wondershaper/patches/01-change-default.patch
new file mode 100644
index 000000000..64ae1d267
--- /dev/null
+++ b/package/wondershaper/patches/01-change-default.patch
@@ -0,0 +1,217 @@
+diff -Nur wondershaper-1.1a/wshaper.conf wondershaper-1.1a_openwrt/wshaper.conf
+--- wondershaper-1.1a/wshaper.conf 1970-01-01 01:00:00.000000000 +0100
++++ wondershaper-1.1a_openwrt/wshaper.conf 2005-09-09 00:31:54.239340744 +0200
+@@ -0,0 +1,27 @@
++# Wonder Shaper
++# please read the README before filling out these values
++#
++# Set the following values to somewhat less than your actual download
++# and uplink speed. In kilobits.
++DOWNLINK=1000
++UPLINK=220
++
++# low priority OUTGOING traffic - you can leave this blank if you want
++# low priority source netmasks
++NOPRIOHOSTSRC=80
++
++# low priority destination netmasks
++NOPRIOHOSTDST=
++
++# low priority source ports
++NOPRIOPORTSRC=
++
++# low priority destination ports
++NOPRIOPORTDST=
++
++# WAN device
++DEV=ppp0
++
++# tc location
++TC=/usr/sbin/tc
++
+diff -Nur wondershaper-1.1a/wshaper.htb wondershaper-1.1a_openwrt/wshaper.htb
+--- wondershaper-1.1a/wshaper.htb 2002-04-16 16:26:51.000000000 +0200
++++ wondershaper-1.1a_openwrt/wshaper.htb 2005-09-11 13:24:56.143626544 +0200
+@@ -1,44 +1,22 @@
+-#!/bin/bash
++#!/bin/ash
+ # Wonder Shaper
+-# please read the README before filling out these values
+-#
+-# Set the following values to somewhat less than your actual download
+-# and uplink speed. In kilobits. Also set the device that is to be shaped.
+-
+-DOWNLINK=800
+-UPLINK=220
+-DEV=ppp0
+-
+-# low priority OUTGOING traffic - you can leave this blank if you want
+-# low priority source netmasks
+-NOPRIOHOSTSRC=
+-
+-# low priority destination netmasks
+-NOPRIOHOSTDST=
++. /etc/functions.sh
++. /etc/wshaper.conf
+
+-# low priority source ports
+-NOPRIOPORTSRC=
+
+-# low priority destination ports
+-NOPRIOPORTDST=
+-
+-
+-# Now remove the following two lines :-)
+-
+-echo Please read the documentation in 'README' first
+-exit
++# do the magic
+
+ if [ "$1" = "status" ]
+ then
+- tc -s qdisc ls dev $DEV
+- tc -s class ls dev $DEV
++ $TC -s qdisc ls dev $DEV
++ $TC -s class ls dev $DEV
+ exit
+ fi
+
+
+ # clean existing down- and uplink qdiscs, hide errors
+-tc qdisc del dev $DEV root 2> /dev/null > /dev/null
+-tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
++$TC qdisc del dev $DEV root 2> /dev/null > /dev/null
++$TC qdisc del dev $DEV ingress 2> /dev/null > /dev/null
+
+ if [ "$1" = "stop" ]
+ then
+@@ -46,50 +24,66 @@
+ fi
+
+
++# wondershaper must be executed everytime an interface comes up
++# if we have dynamic interface ppp0 add wondershaper to ip-up
++if [ $DEV = "ppp0" ] && ! grep -q wshaper /etc/ppp/ip-up
++then
++ echo "/usr/sbin/wshaper" >> /etc/ppp/ip-up
++ chmod 755 /etc/ppp/ip-up
++fi
++
++
++
++# load the needed kernel modules
++for module in sch_prio sch_htb sch_sfq sch_ingress cls_tcindex cls_fw cls_route cls_u32
++do
++ insmod $module 2> /dev/null > /dev/null
++done
++
+ ###### uplink
+
+ # install root HTB, point default traffic to 1:20:
+
+-tc qdisc add dev $DEV root handle 1: htb default 20
++$TC qdisc add dev $DEV root handle 1: htb default 20
+
+ # shape everything at $UPLINK speed - this prevents huge queues in your
+ # DSL modem which destroy latency:
+
+-tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k
++$TC class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k
+
+ # high prio class 1:10:
+
+-tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
++$TC class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \
+ burst 6k prio 1
+
+ # bulk & default class 1:20 - gets slightly less traffic,
+ # and a lower priority:
+
+-tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$UPLINK/10]kbit \
++$TC class add dev $DEV parent 1:1 classid 1:20 htb rate $((9*$UPLINK/10))kbit \
+ burst 6k prio 2
+
+-tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[8*$UPLINK/10]kbit \
++$TC class add dev $DEV parent 1:1 classid 1:30 htb rate $((8*$UPLINK/10))kbit \
+ burst 6k prio 2
+
+ # all get Stochastic Fairness:
+-tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
+-tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
+-tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
++$TC qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
++$TC qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
++$TC qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
+
+ # TOS Minimum Delay (ssh, NOT scp) in 1:10:
+
+-tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
++$TC filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
+ match ip tos 0x10 0xff flowid 1:10
+
+ # ICMP (ip protocol 1) in the interactive class 1:10 so we
+ # can do measurements & impress our friends:
+-tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
++$TC filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
+ match ip protocol 1 0xff flowid 1:10
+
+ # To speed up downloads while an upload is going on, put ACK packets in
+ # the interactive class:
+
+-tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \
++$TC filter add dev $DEV parent 1: protocol ip prio 10 u32 \
+ match ip protocol 6 0xff \
+ match u8 0x05 0x0f at 0 \
+ match u16 0x0000 0xffc0 at 2 \
+@@ -101,31 +95,31 @@
+ # some traffic however suffers a worse fate
+ for a in $NOPRIOPORTDST
+ do
+- tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
++ $TC filter add dev $DEV parent 1: protocol ip prio 14 u32 \
+ match ip dport $a 0xffff flowid 1:30
+ done
+
+ for a in $NOPRIOPORTSRC
+ do
+- tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
++ $TC filter add dev $DEV parent 1: protocol ip prio 15 u32 \
+ match ip sport $a 0xffff flowid 1:30
+ done
+
+ for a in $NOPRIOHOSTSRC
+ do
+- tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
++ $TC filter add dev $DEV parent 1: protocol ip prio 16 u32 \
+ match ip src $a flowid 1:30
+ done
+
+ for a in $NOPRIOHOSTDST
+ do
+- tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
++ $TC filter add dev $DEV parent 1: protocol ip prio 17 u32 \
+ match ip dst $a flowid 1:30
+ done
+
+ # rest is 'non-interactive' ie 'bulk' and ends up in 1:20
+
+-tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
++$TC filter add dev $DEV parent 1: protocol ip prio 18 u32 \
+ match ip dst 0.0.0.0/0 flowid 1:20
+
+
+@@ -136,12 +130,12 @@
+ #
+ # attach ingress policer:
+
+-tc qdisc add dev $DEV handle ffff: ingress
++$TC qdisc add dev $DEV handle ffff: ingress
+
+ # filter *everything* to it (0.0.0.0/0), drop everything that's
+ # coming in too fast:
+
+-tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
++$TC filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
+ 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
+
+
diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in
new file mode 100644
index 000000000..325b71bf1
--- /dev/null
+++ b/package/wpa_supplicant/Config.in
@@ -0,0 +1,30 @@
+config ADK_PACKAGE_WPA_SUPPLICANT
+ prompt "wpa_supplicant.................... WPA Supplicant with support for WPA and WPA2"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_AES
+ help
+ WPA Supplicant with support for WPA and WPA2 (IEEE 802.11i / RSN).
+ Supplicant is the IEEE 802.1X/WPA component that is used in the client
+ stations. It implements key negotiation with a WPA Authenticator and it
+ controls the roaming and IEEE 802.11 authentication/association.
+
+ http://hostap.epitest.fi/wpa_supplicant/
+
+choice
+prompt "SSL/TLS Configuration"
+depends on ADK_PACKAGE_WPA_SUPPLICANT
+default ADK_COMPILE_WPA_SUPPLICANT_WITH_OPENSSL
+
+config ADK_COMPILE_WPA_SUPPLICANT_WITH_OPENSSL
+ bool "enable openssl encryption support"
+ depends ADK_PACKAGE_WPA_SUPPLICANT
+ select ADK_PACKAGE_LIBOPENSSL
+ help
+
+config ADK_COMPILE_WPA_SUPPLICANT_WITH_INCLUDED
+ bool "enable included encryption support"
+ depends ADK_PACKAGE_WPA_SUPPLICANT
+ help
+
+endchoice
diff --git a/package/wpa_supplicant/Makefile b/package/wpa_supplicant/Makefile
new file mode 100644
index 000000000..9d12820b7
--- /dev/null
+++ b/package/wpa_supplicant/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wpa_supplicant
+PKG_VERSION:= 0.6.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0efb8fcedf0a8acf6f423dfdb0658fdd
+MASTER_SITES:= http://hostap.epitest.fi/releases/
+
+WRKSRC= ${WRKDIST}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WPA_SUPPLICANT,wpa-supplicant,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+BUILD_STYLE:= auto
+MAKE_FLAGS+= CPPFLAGS='${TCPPFLAGS}' \
+ LDFLAGS='${TLDFLAGS}' \
+ OPT_FLAGS='${TCFLAGS}' \
+ KERNEL=${LINUX_DIR}
+
+do-configure:
+ ${CP} files/config ${WRKBUILD}/.config
+
+do-install:
+ ${INSTALL_DIR} ${IDIR_WPA_SUPPLICANT}/usr/sbin
+ ${INSTALL_BIN} ${WRKBUILD}/wpa_cli ${IDIR_WPA_SUPPLICANT}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/wpa_passphrase ${IDIR_WPA_SUPPLICANT}/usr/sbin/
+ ${INSTALL_BIN} ${WRKBUILD}/wpa_supplicant ${IDIR_WPA_SUPPLICANT}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wpa_supplicant/files/config b/package/wpa_supplicant/files/config
new file mode 100644
index 000000000..b800b2fc5
--- /dev/null
+++ b/package/wpa_supplicant/files/config
@@ -0,0 +1,16 @@
+# rather important
+#CONFIG_DRIVER_MADWIFI=y
+CONFIG_DRIVER_WEXT=y
+CONFIG_IEEE8021X_EAPOL=y
+CONFIG_CTRL_IFACE=y
+
+# default
+CONFIG_EAP_PSK=y
+CONFIG_EAP_MD5=y
+
+# optional
+CONFIG_MSCHAPV2=y
+CONFIG_EAP_TLS=y
+CONFIG_EAP_PEAP=y
+CONFIG_EAP_TTLS=y
+
diff --git a/package/wpa_supplicant/ipkg/wpa-supplicant.control b/package/wpa_supplicant/ipkg/wpa-supplicant.control
new file mode 100644
index 000000000..ea4f7f8ed
--- /dev/null
+++ b/package/wpa_supplicant/ipkg/wpa-supplicant.control
@@ -0,0 +1,5 @@
+Package: wpa-supplicant
+Priority: optional
+Section: net
+Description: WPA Supplicant with support for WPA and WPA2
+Depends: libopenssl
diff --git a/package/wpa_supplicant/patches/patch-Makefile b/package/wpa_supplicant/patches/patch-Makefile
new file mode 100644
index 000000000..6b33a653d
--- /dev/null
+++ b/package/wpa_supplicant/patches/patch-Makefile
@@ -0,0 +1,13 @@
+$Id$
+--- wpa_supplicant-0.5.8.orig/Makefile Tue May 29 02:08:25 2007
++++ wpa_supplicant-0.5.8/Makefile Sun Oct 21 20:55:37 2007
+@@ -3,7 +3,8 @@ CC=gcc
+ endif
+
+ ifndef CFLAGS
+-CFLAGS = -MMD -O2 -Wall -g
++OPT_FLAGS = -O2 -g
++CFLAGS = -MMD $(OPT_FLAGS) -Wall
+ endif
+
+ # Include directories for CVS version
diff --git a/package/wput/Config.in b/package/wput/Config.in
new file mode 100644
index 000000000..33bf66aaa
--- /dev/null
+++ b/package/wput/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_WPUT
+ prompt "wput.............................. A wget-like command-line FTP client"
+ tristate
+ default n
+ help
+ A wget-like command-line FTP client.
+
+ http://itooktheredpill.dyndns.org/wput/
+
diff --git a/package/wput/Makefile b/package/wput/Makefile
new file mode 100644
index 000000000..aa65e209d
--- /dev/null
+++ b/package/wput/Makefile
@@ -0,0 +1,30 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= wput
+PKG_VERSION:= 0.5
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 441b2e07219f78167b29a7ac33488fff
+
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=wput/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tgz
+
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,WPUT,wput,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --disable-g-switch
+BUILD_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_WPUT}/usr/bin/
+ ${INSTALL_BIN} ${WRKBUILD}/wput ${IDIR_WPUT}/usr/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/wput/ipkg/wput.control b/package/wput/ipkg/wput.control
new file mode 100644
index 000000000..06d51ad76
--- /dev/null
+++ b/package/wput/ipkg/wput.control
@@ -0,0 +1,4 @@
+Package: wput
+Priority: optional
+Section: net
+Description: a wget-like command-line FTP client
diff --git a/package/xcmiscproto/Config.in b/package/xcmiscproto/Config.in
new file mode 100644
index 000000000..dcb5bef8d
--- /dev/null
+++ b/package/xcmiscproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XCMISCPROTO
+ prompt "xcmiscproto............................ X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/xcmiscproto/Makefile b/package/xcmiscproto/Makefile
new file mode 100644
index 000000000..d128905d0
--- /dev/null
+++ b/package/xcmiscproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xcmiscproto
+PKG_VERSION:= 1.1.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 3c380a728697ded97a39addfe1acf2cb
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xcmiscproto/ipkg/xcmiscproto.control b/package/xcmiscproto/ipkg/xcmiscproto.control
new file mode 100644
index 000000000..3b797121a
--- /dev/null
+++ b/package/xcmiscproto/ipkg/xcmiscproto.control
@@ -0,0 +1,4 @@
+Package: xcmiscproto
+Priority: optional
+Section: x11
+Description: Xproto headers
diff --git a/package/xextproto/Config.in b/package/xextproto/Config.in
new file mode 100644
index 000000000..1a1a5c51d
--- /dev/null
+++ b/package/xextproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XEXTPROTO
+ prompt "xextproto.............................. Xextproto headers"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/xextproto/Makefile b/package/xextproto/Makefile
new file mode 100644
index 000000000..62fb0afdc
--- /dev/null
+++ b/package/xextproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xextproto
+PKG_VERSION:= 7.0.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 6a8f9f9559e9065858905043c17e05a1
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xf86dga/Config.in b/package/xf86dga/Config.in
new file mode 100644
index 000000000..f5a0a936b
--- /dev/null
+++ b/package/xf86dga/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XF86DGA
+ prompt "xf86dga................................ X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/xf86dga/Makefile b/package/xf86dga/Makefile
new file mode 100644
index 000000000..316169b68
--- /dev/null
+++ b/package/xf86dga/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xf86dga
+PKG_VERSION:= 1.0.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ac30b5705f487554c5de0b466e846c31
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xf86dgaproto/Config.in b/package/xf86dgaproto/Config.in
new file mode 100644
index 000000000..ce8f91492
--- /dev/null
+++ b/package/xf86dgaproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XF86DGAPROTO
+ prompt "xf86dgaproto................................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/xf86dgaproto/Makefile b/package/xf86dgaproto/Makefile
new file mode 100644
index 000000000..161d280f0
--- /dev/null
+++ b/package/xf86dgaproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xf86dgaproto
+PKG_VERSION:= 2.0.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= f73c1d99b557249662bc75b9b872b61b
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xfsprogs/Config.in b/package/xfsprogs/Config.in
new file mode 100644
index 000000000..729c249e0
--- /dev/null
+++ b/package/xfsprogs/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_XFSPROGS
+ prompt "xfsprogs.......................... Utilities to create and check XFS filesystems"
+ tristate
+ select ADK_PACKAGE_LIBUUID
+ select ADK_PACKAGE_LIBPTHREAD
+ default n
+ help
+ Utilities to create and check XFS filesystems.
diff --git a/package/xfsprogs/Makefile b/package/xfsprogs/Makefile
new file mode 100644
index 000000000..d4e38aa81
--- /dev/null
+++ b/package/xfsprogs/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= xfsprogs
+PKG_VERSION:= 3.0.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= ec734f935ec87ebb8be890d29380a3e6
+MASTER_SITES:= ftp://oss.sgi.com/projects/xfs/cmd_tars/ \
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,XFSPROGS,xfsprogs,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= autoconf gnu
+CONFIGURE_ARGS+= --enable-gettext=no \
+ --with-gnu-ld
+CONFIGURE_ENV+= DEBUG=" " OPTIMIZER=" "
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+ALL_TARGET=
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_XFSPROGS}/sbin
+ ${CP} ${WRKINST}/usr/sbin/mkfs.xfs ${IDIR_XFSPROGS}/sbin/
+ ${CP} ${WRKINST}/usr/sbin/xfs_repair ${IDIR_XFSPROGS}/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xfsprogs/ipkg/xfsprogs.control b/package/xfsprogs/ipkg/xfsprogs.control
new file mode 100644
index 000000000..0625159eb
--- /dev/null
+++ b/package/xfsprogs/ipkg/xfsprogs.control
@@ -0,0 +1,5 @@
+Package: xfsprogs
+Priority: optional
+Section: admin
+Depends: libuuid, libpthread
+Description: Utilities to create and check XFS filesystems
diff --git a/package/xfsprogs/patches/patch-configure_in b/package/xfsprogs/patches/patch-configure_in
new file mode 100644
index 000000000..78bb9c4b8
--- /dev/null
+++ b/package/xfsprogs/patches/patch-configure_in
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- xfsprogs-3.0.0.orig/configure.in 2009-02-04 23:29:48.000000000 +0100
++++ xfsprogs-3.0.0/configure.in 2009-03-27 11:40:33.000000000 +0100
+@@ -46,16 +46,12 @@ AC_PACKAGE_GLOBALS(xfsprogs)
+ AC_PACKAGE_UTILITIES(xfsprogs)
+ AC_MULTILIB($enable_lib64)
+
+-AC_PACKAGE_NEED_AIO_H
+-AC_PACKAGE_NEED_LIO_LISTIO
+-
+ AC_PACKAGE_NEED_UUID_H
+ AC_PACKAGE_NEED_UUIDCOMPARE
+
+ AC_PACKAGE_NEED_PTHREAD_H
+ AC_PACKAGE_NEED_PTHREADMUTEXINIT
+
+-AC_HAVE_FADVISE
+ AC_HAVE_MADVISE
+ AC_HAVE_MINCORE
+ AC_HAVE_SENDFILE
diff --git a/package/xfsprogs/patches/patch-copy_xfs_copy_c b/package/xfsprogs/patches/patch-copy_xfs_copy_c
new file mode 100644
index 000000000..f5205398e
--- /dev/null
+++ b/package/xfsprogs/patches/patch-copy_xfs_copy_c
@@ -0,0 +1,80 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- xfsprogs-3.0.0.orig/copy/xfs_copy.c 2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0/copy/xfs_copy.c 2009-03-27 11:40:33.000000000 +0100
+@@ -240,7 +240,10 @@ handler(int sig)
+ {
+ pid_t pid = getpid();
+ int status, i;
++ struct sigaction action;
+
++ action.sa_handler = handler;
++ action.sa_flags = 0;
+ pid = wait(&status);
+
+ kids--;
+@@ -272,7 +275,7 @@ handler(int sig)
+ pthread_exit(NULL);
+ }
+
+- signal(SIGCHLD, handler);
++ sigaction(SIGCHLD, &action, NULL);
+ return;
+ } else {
+ /* it just croaked it bigtime, log it */
+@@ -294,7 +297,7 @@ handler(int sig)
+ do_warn(_("%s: Unknown child died (should never happen!)\n"), progname);
+ die_perror();
+ pthread_exit(NULL);
+- signal(SIGCHLD, handler);
++ sigaction(SIGCHLD, &action, NULL);
+ }
+
+ void
+@@ -467,6 +470,10 @@ void
+ write_wbuf(void)
+ {
+ int i;
++ sigset_t unblock, initial;
++
++ sigemptyset(&unblock);
++ sigaddset(&unblock, SIGCHLD);
+
+ /* verify target threads */
+ for (i = 0; i < num_targets; i++)
+@@ -478,9 +485,9 @@ write_wbuf(void)
+ if (target[i].state != INACTIVE)
+ pthread_mutex_unlock(&targ[i].wait); /* wake up */
+
+- sigrelse(SIGCHLD);
++ sigprocmask(SIG_UNBLOCK, &unblock, &initial);
+ pthread_mutex_lock(&mainwait);
+- sighold(SIGCHLD);
++ sigprocmask(SIG_SETMASK, &initial, NULL);
+ }
+
+
+@@ -521,6 +528,11 @@ main(int argc, char **argv)
+ libxfs_init_t xargs;
+ thread_args *tcarg;
+ struct stat64 statbuf;
++ struct sigaction saction;
++ sigset_t sigblock, initial;
++
++ saction.sa_handler = handler;
++ saction.sa_flags = 0;
+
+ progname = basename(argv[0]);
+
+@@ -846,8 +858,10 @@ main(int argc, char **argv)
+
+ /* set up sigchild signal handler */
+
+- signal(SIGCHLD, handler);
+- sighold(SIGCHLD);
++ sigaction(SIGCHLD, &saction, NULL);
++ sigemptyset(&sigblock);
++ sigaddset(&sigblock, SIGCHLD);
++ sigprocmask(SIG_BLOCK, &sigblock, &initial);
+
+ /* make children */
+
diff --git a/package/xfsprogs/patches/patch-include_builddefs_in b/package/xfsprogs/patches/patch-include_builddefs_in
new file mode 100644
index 000000000..452817404
--- /dev/null
+++ b/package/xfsprogs/patches/patch-include_builddefs_in
@@ -0,0 +1,35 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- xfsprogs-2.10.1.orig/include/builddefs.in 2007-09-11 04:01:15.000000000 +0200
++++ xfsprogs-2.10.1/include/builddefs.in 2008-11-12 11:28:41.000000000 +0100
+@@ -25,7 +25,7 @@ OPTIMIZER = @opt_build@
+ MALLOCLIB = @malloc_lib@
+ LOADERFLAGS = @LDFLAGS@
+
+-LIBRT = @librt@
++LIBRT = -lrt
+ LIBUUID = @libuuid@
+ LIBPTHREAD = @libpthread@
+ LIBTERMCAP = @libtermcap@
+@@ -50,14 +50,14 @@ PKG_RELEASE = @pkg_release@
+ PKG_VERSION = @pkg_version@
+ PKG_PLATFORM = @pkg_platform@
+ PKG_DISTRIBUTION= @pkg_distribution@
+-PKG_BIN_DIR = @bindir@
+-PKG_SBIN_DIR = @sbindir@
+-PKG_LIB_DIR = @libdir@@libdirsuffix@
+-PKG_DEVLIB_DIR = @libexecdir@@libdirsuffix@
+-PKG_INC_DIR = @includedir@/xfs
+-PKG_MAN_DIR = @mandir@
+-PKG_DOC_DIR = @datadir@/doc/@pkg_name@
+-PKG_LOCALE_DIR = @datadir@/locale
++PKG_BIN_DIR = $(DESTDIR)@bindir@
++PKG_SBIN_DIR = $(DESTDIR)@sbindir@
++PKG_LIB_DIR = $(DESTDIR)@libdir@@libdirsuffix@
++PKG_DEVLIB_DIR = $(DESTDIR)@libexecdir@@libdirsuffix@
++PKG_INC_DIR = $(DESTDIR)@includedir@/xfs
++PKG_MAN_DIR = $(DESTDIR)@mandir@
++PKG_DOC_DIR = $(DESTDIR)@datadir@/doc/@pkg_name@
++PKG_LOCALE_DIR = $(DESTDIR)@datadir@/locale
+
+ CC = @cc@
+ AWK = @awk@
diff --git a/package/xfsprogs/patches/patch-include_buildmacros b/package/xfsprogs/patches/patch-include_buildmacros
new file mode 100644
index 000000000..f163f3f2b
--- /dev/null
+++ b/package/xfsprogs/patches/patch-include_buildmacros
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- xfsprogs-3.0.0.orig/include/buildmacros 2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0/include/buildmacros 2009-03-27 11:45:29.000000000 +0100
+@@ -48,7 +48,7 @@ LTINSTALL = $(LIBTOOL) --mode=install $(
+ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CCF)
+
+ ifeq ($(ENABLE_SHARED),yes)
+-LTLDFLAGS += -rpath $(PKG_LIB_DIR)
++#LTLDFLAGS += -rpath $(PKG_LIB_DIR)
+ LTLDFLAGS += -version-info $(LTVERSION)
+ endif
+
diff --git a/package/xfsprogs/patches/patch-libhandle_Makefile b/package/xfsprogs/patches/patch-libhandle_Makefile
new file mode 100644
index 000000000..2c16921e1
--- /dev/null
+++ b/package/xfsprogs/patches/patch-libhandle_Makefile
@@ -0,0 +1,12 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- xfsprogs-2.10.1.orig/libhandle/Makefile 2007-09-11 04:01:17.000000000 +0200
++++ xfsprogs-2.10.1/libhandle/Makefile 2008-12-09 19:02:03.000000000 +0100
+@@ -17,7 +17,7 @@ default: $(LTLIBRARY)
+ include $(BUILDRULES)
+
+ install: default
+- $(INSTALL_LTLIB)
++ #$(INSTALL_LTLIB)
+
+ install-dev: default
+ $(INSTALL_LTLIB_DEV)
diff --git a/package/xfsprogs/patches/patch-libxfs_linux_c b/package/xfsprogs/patches/patch-libxfs_linux_c
new file mode 100644
index 000000000..9d0a95f75
--- /dev/null
+++ b/package/xfsprogs/patches/patch-libxfs_linux_c
@@ -0,0 +1,38 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- xfsprogs-3.0.0.orig/libxfs/linux.c 2009-02-04 23:29:25.000000000 +0100
++++ xfsprogs-3.0.0/libxfs/linux.c 2009-03-27 11:43:17.000000000 +0100
+@@ -20,8 +20,6 @@
+ #include <xfs/libxfs.h>
+ #include <mntent.h>
+ #include <sys/stat.h>
+-#undef ustat
+-#include <sys/ustat.h>
+ #include <sys/mount.h>
+ #include <sys/ioctl.h>
+ #include <sys/sysinfo.h>
+@@ -49,25 +47,6 @@ static int max_block_alignment;
+ int
+ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+ {
+- /* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */
+- struct ustat ust[2];
+- struct stat64 st;
+-
+- if (!s) {
+- if (stat64(block, &st) < 0)
+- return 0;
+- if ((st.st_mode & S_IFMT) != S_IFBLK)
+- return 0;
+- s = &st;
+- }
+-
+- if (ustat(s->st_rdev, ust) >= 0) {
+- if (verbose)
+- fprintf(stderr,
+- _("%s: %s contains a mounted filesystem\n"),
+- progname, name);
+- return 1;
+- }
+ return 0;
+ }
+
diff --git a/package/xinetd/Config.in b/package/xinetd/Config.in
new file mode 100644
index 000000000..49d870c3d
--- /dev/null
+++ b/package/xinetd/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_XINETD
+ prompt "xinetd............................ Powerful and secure superserver"
+ tristate
+ default n
+ help
+ A powerful and secure superserver
+
+ http://www.xinetd.org/
+
diff --git a/package/xinetd/Makefile b/package/xinetd/Makefile
new file mode 100644
index 000000000..434d0bdcc
--- /dev/null
+++ b/package/xinetd/Makefile
@@ -0,0 +1,35 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xinetd
+PKG_VERSION:= 2.3.13
+PKG_RELEASE:= 9
+PKG_MD5SUM:= 4295b5fe12350f09b5892b363348ac8b
+
+MASTER_SITES:= http://www.xinetd.org/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,XINETD,xinetd,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE:= gnu
+CONFIGURE_ARGS+= --without-libwrap \
+ --with-loadavg
+BUILD_STYLE:= auto
+ALL_TARGET:= build
+INSTALL_STYLE:= auto
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_XINETD}/etc
+ ${INSTALL_DATA} ./files/xinetd.conf ${IDIR_XINETD}/etc/xinetd.conf
+ ${INSTALL_DIR} ${IDIR_XINETD}/etc/xinetd.d
+ ${INSTALL_DIR} ${IDIR_XINETD}/etc/init.d
+ ${INSTALL_BIN} ./files/xinetd.init ${IDIR_XINETD}/etc/init.d/xinetd
+ ${INSTALL_DIR} ${IDIR_XINETD}/usr/sbin
+ ${INSTALL_BIN} ${WRKINST}/usr/sbin/xinetd ${IDIR_XINETD}/usr/sbin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xinetd/files/xinetd.conf b/package/xinetd/files/xinetd.conf
new file mode 100644
index 000000000..bd473ed3d
--- /dev/null
+++ b/package/xinetd/files/xinetd.conf
@@ -0,0 +1,6 @@
+defaults
+{
+
+}
+
+includedir /etc/xinetd.d
diff --git a/package/xinetd/files/xinetd.init b/package/xinetd/files/xinetd.init
new file mode 100644
index 000000000..8c909d278
--- /dev/null
+++ b/package/xinetd/files/xinetd.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#FWINIT 50
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${xinetd:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ xinetd
+ ;;
+stop)
+ killall xinetd
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/xinetd/ipkg/xinetd.conffiles b/package/xinetd/ipkg/xinetd.conffiles
new file mode 100644
index 000000000..f49d840c4
--- /dev/null
+++ b/package/xinetd/ipkg/xinetd.conffiles
@@ -0,0 +1 @@
+/etc/xinetd.conf
diff --git a/package/xinetd/ipkg/xinetd.control b/package/xinetd/ipkg/xinetd.control
new file mode 100644
index 000000000..34cefb59a
--- /dev/null
+++ b/package/xinetd/ipkg/xinetd.control
@@ -0,0 +1,4 @@
+Package: xinetd
+Priority: optional
+Section: net
+Description: a powerful and secure superserver
diff --git a/package/xinetd/ipkg/xinetd.postinst b/package/xinetd/ipkg/xinetd.postinst
new file mode 100644
index 000000000..c9869d167
--- /dev/null
+++ b/package/xinetd/ipkg/xinetd.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf xinetd xinetd NO
diff --git a/package/xinetd/patches/ar.patch b/package/xinetd/patches/ar.patch
new file mode 100644
index 000000000..f0d4f0dea
--- /dev/null
+++ b/package/xinetd/patches/ar.patch
@@ -0,0 +1,72 @@
+diff -ruN xinetd-2.3.13-orig/libs/src/misc/Makefile.in xinetd-2.3.13-6/libs/src/misc/Makefile.in
+--- xinetd-2.3.13-orig/libs/src/misc/Makefile.in 2003-02-19 18:29:27.000000000 +0100
++++ xinetd-2.3.13-6/libs/src/misc/Makefile.in 2005-03-09 22:53:15.000000000 +0100
+@@ -62,7 +62,7 @@
+
+
+ $(LIBNAME): $(OBJECTS)
+- ar r $@ $?
++ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ install: $(LIBNAME)
+diff -ruN xinetd-2.3.13-orig/libs/src/portable/Makefile.in xinetd-2.3.13-6/libs/src/portable/Makefile.in
+--- xinetd-2.3.13-orig/libs/src/portable/Makefile.in 2003-02-19 18:29:27.000000000 +0100
++++ xinetd-2.3.13-6/libs/src/portable/Makefile.in 2005-03-09 22:53:15.000000000 +0100
+@@ -57,7 +57,7 @@
+
+
+ $(LIBNAME): $(OBJECTS)
+- ar r $@ $?
++ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ install: $(LIBNAME)
+diff -ruN xinetd-2.3.13-orig/libs/src/pset/Makefile.in xinetd-2.3.13-6/libs/src/pset/Makefile.in
+--- xinetd-2.3.13-orig/libs/src/pset/Makefile.in 2003-02-19 18:29:27.000000000 +0100
++++ xinetd-2.3.13-6/libs/src/pset/Makefile.in 2005-03-09 22:53:15.000000000 +0100
+@@ -53,7 +53,7 @@
+ mv $(LIBNAME) $(LIBDIR)/optimized
+
+ $(LIBNAME): $(OBJECTS)
+- ar r $@ $?
++ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ install: $(LIBNAME)
+diff -ruN xinetd-2.3.13-orig/libs/src/sio/Makefile.in xinetd-2.3.13-6/libs/src/sio/Makefile.in
+--- xinetd-2.3.13-orig/libs/src/sio/Makefile.in 2003-02-19 18:29:27.000000000 +0100
++++ xinetd-2.3.13-6/libs/src/sio/Makefile.in 2005-03-09 22:53:15.000000000 +0100
+@@ -52,7 +52,7 @@
+ $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
+
+ $(LIBNAME): $(OBJECTS)
+- ar r $@ $?
++ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ install: $(LIBNAME)
+diff -ruN xinetd-2.3.13-orig/libs/src/str/Makefile.in xinetd-2.3.13-6/libs/src/str/Makefile.in
+--- xinetd-2.3.13-orig/libs/src/str/Makefile.in 2003-02-19 18:29:27.000000000 +0100
++++ xinetd-2.3.13-6/libs/src/str/Makefile.in 2005-03-09 22:53:15.000000000 +0100
+@@ -63,7 +63,7 @@
+ $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)-O
+
+ $(LIBNAME): $(OBJECTS)
+- ar r $@ $?
++ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ LINT_IGNORE=possible pointer alignment|RCSid unused
+diff -ruN xinetd-2.3.13-orig/libs/src/xlog/Makefile.in xinetd-2.3.13-6/libs/src/xlog/Makefile.in
+--- xinetd-2.3.13-orig/libs/src/xlog/Makefile.in 2003-02-19 18:29:27.000000000 +0100
++++ xinetd-2.3.13-6/libs/src/xlog/Makefile.in 2005-03-09 22:53:15.000000000 +0100
+@@ -58,7 +58,7 @@
+ $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
+
+ $(LIBNAME): $(OBJECTS)
+- ar r $@ $?
++ $(AR) r $@ $?
+ $(RANLIB) $@
+
+ install: $(LIBNAME)
diff --git a/package/xinetd/patches/destdir.patch b/package/xinetd/patches/destdir.patch
new file mode 100644
index 000000000..91fd81660
--- /dev/null
+++ b/package/xinetd/patches/destdir.patch
@@ -0,0 +1,28 @@
+diff -ruN xinetd-2.3.13-orig/Makefile.in xinetd-2.3.13-6/Makefile.in
+--- xinetd-2.3.13-orig/Makefile.in 2003-08-15 16:00:45.000000000 +0200
++++ xinetd-2.3.13-6/Makefile.in 2005-03-09 22:53:15.000000000 +0100
+@@ -75,15 +75,15 @@
+
+ install: build
+ for i in $(DAEMONDIR) $(BINDIR) $(MANDIR)/man5 $(MANDIR)/man8 ; do \
+- test -d $$i || mkdir -p $$i ; done
+- $(INSTALL_CMD) -m 755 xinetd/xinetd $(DAEMONDIR)
+- $(INSTALL_CMD) -m 755 xinetd/itox $(DAEMONDIR)
+- $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DAEMONDIR)
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(MANDIR)/man5/xinetd.conf.5
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(MANDIR)/man8/xinetd.log.8
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(MANDIR)/man8/xinetd.8
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(MANDIR)/man8/itox.8
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(MANDIR)/man8/xconv.pl.8
++ test -d $(DESTDIR)$$i || mkdir -p $(DESTDIR)$$i ; done
++ $(INSTALL_CMD) -m 755 xinetd/xinetd $(DESTDIR)$(DAEMONDIR)
++ $(INSTALL_CMD) -m 755 xinetd/itox $(DESTDIR)$(DAEMONDIR)
++ $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DESTDIR)$(DAEMONDIR)
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(DESTDIR)$(MANDIR)/man5/xinetd.conf.5
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(DESTDIR)$(MANDIR)/man8/xinetd.log.8
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(DESTDIR)$(MANDIR)/man8/xinetd.8
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(DESTDIR)$(MANDIR)/man8/itox.8
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(DESTDIR)$(MANDIR)/man8/xconv.pl.8
+ @echo "You must put your xinetd.conf in /etc/xinetd.conf"
+ @echo "There is a sample config file in xinetd/sample.conf and you can"
+ @echo "use xconv.pl to convert your old inetd.conf file to an xinetd format"
diff --git a/package/xinetd/patches/xinetd-2.3.13-gcc4-1.patch b/package/xinetd/patches/xinetd-2.3.13-gcc4-1.patch
new file mode 100644
index 000000000..49ac327bc
--- /dev/null
+++ b/package/xinetd/patches/xinetd-2.3.13-gcc4-1.patch
@@ -0,0 +1,33 @@
+Submitted By: Randy McMurchy <randy_at_linuxfromscratch_dot_org>
+Date: 2005-08-07
+Initial Package Version: 2.3.13
+Upstream Status: Not submitted
+Origin: Fedora Development CVS
+Description: Fixes compilation error if using GCC-4.x
+
+
+diff -Naur xinetd-2.3.13-orig/xinetd/service.c xinetd-2.3.13/xinetd/service.c
+--- xinetd-2.3.13-orig/xinetd/service.c 2003-11-16 12:44:10.000000000 +0000
++++ xinetd-2.3.13/xinetd/service.c 2005-08-07 18:37:33.395942648 +0000
+@@ -764,8 +764,8 @@
+ return FAILED;
+
+ if ( last == NULL ) {
+- last = SAIN( SVC_LAST_DGRAM_ADDR(sp) ) =
+- SAIN( calloc( 1, sizeof(union xsockaddr) ) );
++ SVC_LAST_DGRAM_ADDR(sp) = calloc( 1, sizeof(union xsockaddr) );
++ last = SAIN(SVC_LAST_DGRAM_ADDR(sp));
+ }
+
+ (void) time( &current_time ) ;
+@@ -791,8 +791,8 @@
+ return FAILED;
+
+ if( last == NULL ) {
+- last = SAIN6(SVC_LAST_DGRAM_ADDR(sp)) =
+- SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
++ SVC_LAST_DGRAM_ADDR(sp) = calloc( 1, sizeof(union xsockaddr) );
++ last = SAIN6( SVC_LAST_DGRAM_ADDR(sp) );
+ }
+
+ (void) time( &current_time ) ;
diff --git a/package/xorg-server/Config.in b/package/xorg-server/Config.in
new file mode 100644
index 000000000..f9cc2a6a8
--- /dev/null
+++ b/package/xorg-server/Config.in
@@ -0,0 +1,8 @@
+config ADK_PACKAGE_XORG_SERVER
+ prompt "xorg-server............................... X server"
+ tristate
+ default n
+ select ADK_PACKAGE_LIBXKBFILE
+ select ADK_PACKAGE_LIBX11
+ help
+ http://www.x.org
diff --git a/package/xorg-server/Makefile b/package/xorg-server/Makefile
new file mode 100644
index 000000000..6a56e652e
--- /dev/null
+++ b/package/xorg-server/Makefile
@@ -0,0 +1,51 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xorg-server
+PKG_VERSION:= 1.5.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7aca5d0dc8b824d3dff6140e381e03df
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,XORG_SERVER,xorg-server,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+CONFIGURE_ARGS+= --disable-xinerama \
+ --disable-aiglx \
+ --disable-dga \
+ --disable-dri \
+ --disable-glx \
+ --disable-xnest \
+ --disable-config-hal \
+ --disable-xvfb \
+ --disable-mfb \
+ --disable-cfb \
+ --disable-afb \
+ --disable-xephyr \
+ --disable-xsdl \
+ --enable-builtin-fonts
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_XORG_SERVER)/usr/bin
+ $(INSTALL_DIR) $(IDIR_XORG_SERVER)/usr/lib/xorg/modules/{extensions,fonts,linux,multimedia}
+ ${CP} ${WRKINST}/usr/bin/* $(IDIR_XORG_SERVER)/usr/bin
+ ${CP} ${WRKINST}/usr/lib/xorg/modules/*.so \
+ $(IDIR_XORG_SERVER)/usr/lib/xorg/modules
+ ${CP} ${WRKINST}/usr/lib/xorg/modules/extensions/*.so \
+ $(IDIR_XORG_SERVER)/usr/lib/xorg/modules/extensions
+ ${CP} ${WRKINST}/usr/lib/xorg/modules/fonts/*.so \
+ $(IDIR_XORG_SERVER)/usr/lib/xorg/modules/fonts
+ ${CP} ${WRKINST}/usr/lib/xorg/modules/linux/*.so \
+ $(IDIR_XORG_SERVER)/usr/lib/xorg/modules/linux
+ ${CP} ${WRKINST}/usr/lib/xorg/modules/multimedia/*.so \
+ $(IDIR_XORG_SERVER)/usr/lib/xorg/modules/multimedia
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xorg-server/ipkg/xorg-server.control b/package/xorg-server/ipkg/xorg-server.control
new file mode 100644
index 000000000..103035148
--- /dev/null
+++ b/package/xorg-server/ipkg/xorg-server.control
@@ -0,0 +1,4 @@
+Package: xorg-server
+Priority: optional
+Section: x11
+Description: X.org server
diff --git a/package/xproto/Config.in b/package/xproto/Config.in
new file mode 100644
index 000000000..88d73d6b3
--- /dev/null
+++ b/package/xproto/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XPROTO
+ prompt "xproto................................. X protocol library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/xproto/Makefile b/package/xproto/Makefile
new file mode 100644
index 000000000..25952769b
--- /dev/null
+++ b/package/xproto/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xproto
+PKG_VERSION:= 7.0.13
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 4c736a7ba52beddaea87964047adf209
+MASTER_SITES:= ${MASTER_SITE_XORG}
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xtrans/Config.in b/package/xtrans/Config.in
new file mode 100644
index 000000000..dfdc4b082
--- /dev/null
+++ b/package/xtrans/Config.in
@@ -0,0 +1,6 @@
+config ADK_PACKAGE_XTRANS
+ prompt "xtrans.................................. X library"
+ tristate
+ default n
+ help
+ http://www.x.org
diff --git a/package/xtrans/Makefile b/package/xtrans/Makefile
new file mode 100644
index 000000000..4957673f6
--- /dev/null
+++ b/package/xtrans/Makefile
@@ -0,0 +1,20 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= xtrans
+PKG_VERSION:= 1.2.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 5b7f447f6fe92cbc4f17441aaee0bf55
+MASTER_SITES:= http://xorg.freedesktop.org/releases/X11R7.4/src/lib/
+
+include $(TOPDIR)/mk/package.mk
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto confprog
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/xtrans/ipkg/xtrans.control b/package/xtrans/ipkg/xtrans.control
new file mode 100644
index 000000000..3bff7ea49
--- /dev/null
+++ b/package/xtrans/ipkg/xtrans.control
@@ -0,0 +1,4 @@
+Package: xtrans
+Priority: optional
+Section: x11
+Description: X.org library
diff --git a/package/zlib/Config.in b/package/zlib/Config.in
new file mode 100644
index 000000000..5c5698815
--- /dev/null
+++ b/package/zlib/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_ZLIB
+ prompt "zlib.............................. Library implementing the deflate compression method"
+ tristate
+ default n
+ help
+ A library implementing the 'deflate' compression method
+
+ http://www.zlib.net/
+
diff --git a/package/zlib/Makefile b/package/zlib/Makefile
new file mode 100644
index 000000000..642888f9d
--- /dev/null
+++ b/package/zlib/Makefile
@@ -0,0 +1,40 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include ${TOPDIR}/rules.mk
+
+PKG_NAME:= zlib
+PKG_VERSION:= 1.2.3
+PKG_RELEASE:= 5
+PKG_MD5SUM:= dee233bf288ee795ac96a98cc2e369b6
+MASTER_SITES:= http://www.zlib.net/ \
+ ${MASTER_SITE_SOURCEFORGE:=zlib/}
+DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
+
+include ${TOPDIR}/mk/package.mk
+
+$(eval $(call PKG_template,ZLIB,zlib,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
+
+CONFIGURE_STYLE= manual
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+do-configure:
+ (cd $(WRKBUILD); \
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS) -fPIC" \
+ CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
+ LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
+ ./configure \
+ --prefix=$(STAGING_DIR)/usr \
+ --includedir=$(STAGING_DIR)/usr/include \
+ --shared \
+ );
+
+post-install:
+ ${INSTALL_DIR} ${IDIR_ZLIB}/usr/lib
+ cd ${WRKBUILD} && ${CP} libz.so* ${IDIR_ZLIB}/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/zlib/ipkg/zlib.control b/package/zlib/ipkg/zlib.control
new file mode 100644
index 000000000..35fcac26e
--- /dev/null
+++ b/package/zlib/ipkg/zlib.control
@@ -0,0 +1,4 @@
+Package: zlib
+Priority: optional
+Section: libs
+Description: an implementation of the deflate compression method (library)
diff --git a/package/zlib/patches/patch-Makefile_in b/package/zlib/patches/patch-Makefile_in
new file mode 100644
index 000000000..c34514a03
--- /dev/null
+++ b/package/zlib/patches/patch-Makefile_in
@@ -0,0 +1,20 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- zlib-1.2.3.orig/Makefile.in 2005-07-18 04:25:21.000000000 +0200
++++ zlib-1.2.3/Makefile.in 2008-12-31 16:32:48.417074167 +0100
+@@ -34,6 +34,7 @@ SHAREDLIBV=libz.so.1.2.3
+ SHAREDLIBM=libz.so.1
+
+ AR=ar rc
++ARFLAGS=rc
+ RANLIB=ranlib
+ TAR=tar
+ SHELL=/bin/sh
+@@ -68,7 +69,7 @@ test: all
+ fi
+
+ libz.a: $(OBJS) $(OBJA)
+- $(AR) $@ $(OBJS) $(OBJA)
++ $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+ match.o: match.S
diff --git a/package/zlib/patches/patch-configure b/package/zlib/patches/patch-configure
new file mode 100644
index 000000000..784f624b5
--- /dev/null
+++ b/package/zlib/patches/patch-configure
@@ -0,0 +1,38 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- zlib-1.2.3.orig/configure 2005-07-11 22:11:57.000000000 +0200
++++ zlib-1.2.3/configure 2008-12-31 16:43:55.922789768 +0100
+@@ -73,32 +73,9 @@ esac
+
+ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+ CC="$cc"
+- SFLAGS=${CFLAGS-"-fPIC -O3"}
++ SFLAGS=${CFLAGS-"-fPIC -D_REENTRANT"}
+ CFLAGS="$cflags"
+- case `(uname -s || echo unknown) 2>/dev/null` in
+- Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
+- CYGWIN* | Cygwin* | cygwin* | OS/2* )
+- EXE='.exe';;
+- QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
+- # (alain.bonnefoy@icbt.com)
+- LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};;
+- HP-UX*)
+- LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
+- case `(uname -m || echo unknown) 2>/dev/null` in
+- ia64)
+- shared_ext='.so'
+- SHAREDLIB='libz.so';;
+- *)
+- shared_ext='.sl'
+- SHAREDLIB='libz.sl';;
+- esac;;
+- Darwin*) shared_ext='.dylib'
+- SHAREDLIB=libz$shared_ext
+- SHAREDLIBV=libz.$VER$shared_ext
+- SHAREDLIBM=libz.$VER1$shared_ext
+- LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"};;
+- *) LDSHARED=${LDSHARED-"$cc -shared"};;
+- esac
++ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"}
+ else
+ # find system name and corresponding cc options
+ CC=${CC-cc}
diff --git a/package/zsh/Config.in b/package/zsh/Config.in
new file mode 100644
index 000000000..ee1af759b
--- /dev/null
+++ b/package/zsh/Config.in
@@ -0,0 +1,9 @@
+config ADK_PACKAGE_ZSH
+ prompt "zsh............................... Z shell"
+ tristate
+ default n
+ help
+ Zsh a shell designed for interactive use, although it is also a
+ powerful scripting language. Many of the useful features of
+ bash, ksh, and tcsh were incorporated into zsh; many original
+ features were added.
diff --git a/package/zsh/Makefile b/package/zsh/Makefile
new file mode 100644
index 000000000..5daebbf9d
--- /dev/null
+++ b/package/zsh/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= zsh
+PKG_VERSION:= 4.3.9
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1b08c063f02d595709eaad1548c4e392
+MASTER_SITES:= ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,ZSH,zsh,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
+
+CONFIGURE_STYLE= gnu
+BUILD_STYLE= auto
+INSTALL_STYLE= auto
+
+post-install:
+ $(INSTALL_DIR) $(IDIR_ZSH)/bin
+ $(INSTALL_BIN) $(WRKINST)/usr/bin/zsh $(IDIR_ZSH)/bin/
+
+include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/zsh/ipkg/zsh.control b/package/zsh/ipkg/zsh.control
new file mode 100644
index 000000000..b63af1294
--- /dev/null
+++ b/package/zsh/ipkg/zsh.control
@@ -0,0 +1,4 @@
+Package: zsh
+Priority: optional
+Section: shells
+Description: zsh shell
diff --git a/rules.mk b/rules.mk
new file mode 100644
index 000000000..ef645049c
--- /dev/null
+++ b/rules.mk
@@ -0,0 +1,49 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/prereq.mk
+-include $(TOPDIR)/.config
+
+ifeq ($(VERBOSE),1)
+START_TRACE:= :
+END_TRACE:= :
+TRACE:= :
+CMD_TRACE:= :
+PKG_TRACE:= :
+MAKE_TRACE:=
+EXTRA_MAKEFLAGS:=
+SET_DASHX:= set -x
+else
+START_TRACE:= echo -n "---> "
+END_TRACE:= echo
+TRACE:= echo "---> "
+CMD_TRACE:= echo -n
+PKG_TRACE:= echo "------> "
+EXTRA_MAKEFLAGS:= -s
+MAKE_TRACE:= >/dev/null 2>&1 || { echo "Build failed. Please re-run make with v to see what's going on"; false; }
+SET_DASHX:= :
+endif
+
+# Strip off the annoying quoting
+DEVICE:= $(strip $(subst ",, $(ADK_DEVICE)))
+
+ifeq ($(strip ${ADK_HAVE_DOT_CONFIG}),y)
+include $(TOPDIR)/target/$(DEVICE)/device.mk
+endif
+
+include $(TOPDIR)/mk/vars.mk
+
+export BASH HOSTCC HOSTCFLAGS MAKE LANGUAGE LC_ALL OStype PATH
+
+HOSTCPPFLAGS?=
+HOSTLDFLAGS?=
+TARGET_CFLAGS:= $(strip -fwrapv -fno-ident ${TARGET_CFLAGS})
+TARGET_CC:= $(strip ${TARGET_CC})
+TARGET_CXX:= $(strip ${TARGET_CXX})
+
+ifneq (${show},)
+_show:
+ @echo '$($(show))'
+endif
diff --git a/scripts/config.guess b/scripts/config.guess
new file mode 100755
index 000000000..202f698b2
--- /dev/null
+++ b/scripts/config.guess
@@ -0,0 +1,1548 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-09-28'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
+ eval $set_cc_for_build
+ cat << EOF > $dummy.c
+ #include <features.h>
+ #ifdef __UCLIBC__
+ # ifdef __UCLIBC_CONFIG_VERSION__
+ LIBC=uclibc __UCLIBC_CONFIG_VERSION__
+ # else
+ LIBC=uclibc
+ # endif
+ #else
+ LIBC=gnu
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
+fi
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd | genuineintel)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-${LIBC}
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
+ exit ;;
+ esac
+ # This should get integrated into the C code below, but now we hack
+ if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+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`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/scripts/config.sub b/scripts/config.sub
new file mode 100755
index 000000000..66f218c39
--- /dev/null
+++ b/scripts/config.sub
@@ -0,0 +1,1695 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-09-08'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx | dvp \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mipsEE* | ee | ps2)
+ basic_machine=mips64r5900el-scei
+ case $os in
+ -linux*)
+ ;;
+ *)
+ os=-elf
+ ;;
+ esac
+ ;;
+ iop)
+ basic_machine=mipsel-scei
+ os=-irx
+ ;;
+ dvp)
+ basic_machine=dvp-scei
+ os=-elf
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/scripts/create-busybox.sh b/scripts/create-busybox.sh
new file mode 100644
index 000000000..7dc1c13bb
--- /dev/null
+++ b/scripts/create-busybox.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+cd $1
+for i in $(find . -name Config.in);
+do
+ cp --parents $i ../package/busybox/config/
+done
+cd ..
+cd package/busybox/config
+for i in $(find . -name Config.in);
+do
+ sed -i -e 's/^mainmenu \(.*\)/# mainmenu \1/' $i
+ sed -i -e 's/^config \(.*\)/config BUSYBOX_\1/' $i
+ sed -i -e 's/^ select \([:upper:]*\)/ select BUSYBOX_\1/' $i
+ sed -i -e 's/depends on !\([:upper:]*\)/depends on !BUSYBOX_\1/' $i
+ sed -i -e 's/depends on (\([:upper:]*\)/depends on (BUSYBOX_\1/' $i
+ sed -i -e 's/depends on \([^!(][:upper:]*\)/depends on BUSYBOX_\1/' $i
+ sed -i -e 's/&& (\([:upper:]*\)/\&\& (BUSYBOX_\1/' $i
+ sed -i -e 's/&& !\([:upper:]*\)/\&\& !BUSYBOX_\1/g' $i
+ sed -i -e 's/&& \([^!(][:upper:]*\)/\&\& BUSYBOX_\1/g' $i
+ sed -i -e 's/|| !\([:upper:]*\)/|| !BUSYBOX_\1/g' $i
+ sed -i -e 's/|| \([^!(][:upper:]*\)/|| BUSYBOX_\1/g' $i
+ sed -i -e 's#^source \(.*\)#source package/busybox/config/\1#' $i
+ sed -i -e 's/BUSYBOX_ \([:upper:]*\)/BUSYBOX_\1/' $i
+done
diff --git a/scripts/create-image.sh b/scripts/create-image.sh
new file mode 100755
index 000000000..13f7cacd5
--- /dev/null
+++ b/scripts/create-image.sh
@@ -0,0 +1,169 @@
+#!/bin/bash
+# $Id$
+
+grubinstall=1
+
+while getopts ":tin" option
+do
+ case $option in
+ t)
+ emul=$OPTARG
+ ;;
+ i)
+ initramfs=1
+ ;;
+ n)
+ grubinstall=0
+ ;;
+ *)
+ printf "Option not recognized\n"
+ exit 1
+ ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+if [ $(id -u) -ne 0 ];then
+ printf "Installation is only possible as root\n"
+ exit 1
+fi
+
+printf "Checking if grub is installed"
+grub=$(which grub)
+
+if [ -x $grub ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if parted is installed"
+parted=$(which parted)
+
+if [ -x $parted ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if qemu-img is installed"
+qimg=$(which qemu-img)
+
+if [ -x $qimg ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+if [ -z $1 ];then
+ printf "Please give the name of the image file\n"
+ exit 1
+fi
+
+if [ -z $initramfs ];then
+ if [ -z $2 ];then
+ printf "Please give the name of the openadk archive file\n"
+ exit 1
+ fi
+else
+ if [ -z $2 ];then
+ printf "Please give the full path prefix to kernel/initramfs\n"
+ exit 1
+ fi
+fi
+
+
+printf "Generate qemu image\n"
+$qimg create -f raw $1 200M
+
+printf "Create partition and filesystem\n"
+$parted -s $1 mklabel msdos
+$parted -s $1 mkpart primary ext2 0 200
+$parted -s $1 set 1 boot on
+$parted -s $1 mkfs 1 ext2
+
+if [ $? -eq 0 ];then
+ printf "Successfully created partition\n"
+ $parted $1 print
+else
+ printf "Partition creation failed, Exiting.\n"
+ exit 1
+fi
+
+
+tmp=$(mktemp -d)
+
+mount -o loop,offset=16384 -t ext2 $1 $tmp
+
+if [ -z $initramfs ];then
+ printf "Extracting install archive\n"
+ tar -C $tmp -xzpf $2
+ printf "Fixing permissions\n"
+ chmod 1777 $tmp/tmp
+ chmod 4755 $tmp/bin/busybox
+else
+ printf "Copying kernel/initramfs\n"
+ mkdir $tmp/boot $tmp/dev
+ cp $2-kernel $tmp/boot/kernel
+ cp $2-initramfs $tmp/boot/initramfs
+fi
+
+if [ $grubinstall -eq 1 ];then
+printf "Copying grub files\n"
+mkdir $tmp/boot/grub
+cp /boot/grub/stage1 $tmp/boot/grub
+cp /boot/grub/stage2 $tmp/boot/grub
+cp /boot/grub/e2fs_stage1_5 $tmp/boot/grub
+
+if [ -z $initramfs ];then
+cat << EOF > $tmp/boot/grub/menu.lst
+serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
+terminal --timeout=2 serial console
+timeout 2
+default 0
+hiddenmenu
+title linux
+root (hd0,0)
+kernel /boot/kernel root=/dev/sda1 init=/init console=ttyS0,115200 console=tty0 panic=10 rw
+EOF
+else
+cat << EOF > $tmp/boot/grub/menu.lst
+serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
+terminal --timeout=2 serial console
+timeout 4
+default 0
+hiddenmenu
+title linux
+root (hd0,0)
+kernel /boot/kernel root=/dev/sda1 console=ttyS0,115200 console=tty0 rw
+initrd /boot/initramfs
+EOF
+fi
+
+printf "Installing Grub bootloader\n"
+$grub --batch --no-curses --no-floppy --device-map=/dev/null >/dev/null << EOF
+device (hd0) $1
+root (hd0,0)
+setup (hd0)
+quit
+EOF
+
+fi
+
+printf "Creating device nodes\n"
+mknod -m 666 $tmp/dev/zero c 1 5
+mknod -m 666 $tmp/dev/null c 1 3
+mknod -m 622 $tmp/dev/console c 5 1
+mknod -m 666 $tmp/dev/tty c 5 0
+mknod -m 666 $tmp/dev/tty0 c 4 0
+mknod -m 660 $tmp/dev/hda b 3 0
+mknod -m 660 $tmp/dev/hda1 b 3 1
+mknod -m 666 $tmp/dev/ttyS0 c 4 64
+
+umount $tmp
+
+printf "Successfully installed.\n"
+exit 0
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 000000000..8f374e6b2
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,208 @@
+#!/bin/sh
+# $Id$
+if [ $(id -u) -ne 0 ];then
+ printf "Installation is only possible as root\n"
+ exit 1
+fi
+
+cfgfs=1
+while getopts "n" option
+do
+ case $option in
+ n)
+ cfgfs=0
+ ;;
+ *)
+ printf "Option not recognized\n"
+ exit 1
+ ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+printf "Checking if grub is installed"
+grub=$(which grub)
+
+if [ -x $grub ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if sfdisk is installed"
+sfdisk=$(which sfdisk)
+
+if [ -x $sfdisk ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if parted is installed"
+parted=$(which parted)
+
+if [ -x $parted ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if mke2fs is installed"
+mke2fs=$(which mke2fs)
+
+if [ -x $mke2fs ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+printf "Checking if tune2fs is installed"
+tune2fs=$(which tune2fs)
+
+if [ -x $tune2fs ];then
+ printf "...okay\n"
+else
+ printf "...failed\n"
+ exit 1
+fi
+
+if [ -z $1 ];then
+ printf "Please give your compact flash device node as first parameter\n"
+ exit 1
+else
+ if [ -z $2 ];then
+ printf "Please give your install tar as second parameter\n"
+ exit 2
+ fi
+ if [ -f $2 ];then
+ printf "Installing $2 on $1\n"
+ else
+ printf "$2 is not a file, Exiting\n"
+ exit 1
+ fi
+ if [ -b $1 ];then
+ printf "Using $1 as CF disk for installation\n"
+ printf "This will destroy all data on $1, are you sure?\n"
+ printf "Type "y" to continue\n"
+ read y
+ if [ $y = "y" ];then
+ $sfdisk -l $1 2>&1 |grep 'No medium'
+ if [ $? -eq 0 ];then
+ exit 1
+ else
+ printf "Starting with installation\n"
+ fi
+ else
+ printf "Exiting.\n"
+ exit 1
+ fi
+ else
+ printf "Sorry $1 is not a block device\n"
+ exit 1
+ fi
+fi
+
+
+if [ $(mount | grep $1| wc -l) -ne 0 ];then
+ printf "Block device $1 is in use, please umount first.\n"
+ exit 1
+fi
+
+
+if [ $($sfdisk -l $1 2>/dev/null|grep Empty|wc -l) -ne 4 ];then
+ printf "Partitions already exist, should I wipe them?\n"
+ printf "Type y to continue\n"
+ read y
+ if [ $y = "y" ];then
+ printf "Wiping existing partitions\n"
+ else
+ printf "Exiting.\n"
+ exit 1
+ fi
+fi
+
+printf "Create partition and filesystem\n"
+if [ $cfgfs -eq 0 ];then
+$sfdisk $1 << EOF
+,,L
+;
+;
+;
+y
+EOF
+
+$mke2fs ${1}1
+
+else
+declare -i maxsize
+maxsize=$(parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
+let rootsize=$maxsize-1
+
+$parted -s $1 mklabel msdos
+$parted -s $1 unit cyl mkpartfs primary ext2 0 $rootsize
+$parted -s $1 unit cyl mkpart primary ext2 $rootsize $maxsize
+$parted -s $1 set 1 boot on
+fi
+
+if [ $? -eq 0 ];then
+ printf "Successfully created partition ${1}1\n"
+else
+ printf "Partition creation failed, Exiting.\n"
+ exit 1
+fi
+
+sleep 4
+$tune2fs -c 0 -i 0 ${1}1 >/dev/null
+
+if [ $? -eq 0 ];then
+ printf "Successfully disabled filesystem checks on ${1}1\n"
+else
+ printf "Disabling filesystem checks failed, Exiting.\n"
+fi
+
+tmp=$(mktemp -d)
+mount -t ext2 ${1}1 $tmp
+printf "Extracting install archive\n"
+tar -C $tmp -xzpf $2
+printf "Fixing permissions\n"
+chmod 1777 $tmp/tmp
+chmod 4755 $tmp/bin/busybox
+
+printf "Copying grub files\n"
+mkdir $tmp/boot/grub
+cp /boot/grub/stage1 $tmp/boot/grub
+cp /boot/grub/stage2 $tmp/boot/grub
+cp /boot/grub/e2fs_stage1_5 $tmp/boot/grub
+
+cat << EOF > $tmp/boot/grub/menu.lst
+serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
+terminal --timeout=2 serial console
+timeout 2
+default 0
+hiddenmenu
+title linux
+root (hd0,0)
+kernel /boot/kernel root=/dev/sda1 init=/init console=ttyS0,115200 console=tty0 panic=10 rw
+EOF
+
+printf "Installing Grub bootloader\n"
+$grub --batch --no-curses --no-floppy --device-map=/dev/null >/dev/null << EOF
+device (hd0) $1
+root (hd0,0)
+setup (hd0)
+quit
+EOF
+
+printf "Creating device nodes\n"
+mknod -m 666 $tmp/dev/null c 1 3
+mknod -m 622 $tmp/dev/console c 5 1
+mknod -m 666 $tmp/dev/tty c 5 0
+
+umount $tmp
+
+printf "Successfully installed.\n"
+exit 0
diff --git a/scripts/ipkg b/scripts/ipkg
new file mode 100644
index 000000000..39520094f
--- /dev/null
+++ b/scripts/ipkg
@@ -0,0 +1,1198 @@
+# ipkg - the itsy package management system
+#
+# Copyright (C) 2001 Carl D. Worth
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+set -e
+
+# By default do not do globbing. Any command wanting globbing should
+# explicitly enable it first and disable it afterwards.
+set -o noglob
+
+ipkg_is_upgrade () {
+ local A B a b
+ A=$(echo $1 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g").
+ B=$(echo $2 | sed -r "s/([0-9]+)[^[:alnum:]]*/ \1 /g").
+ while [ \! -z "$A" ] && [ \! -z "$B" ]; do {
+ set $A; a=$1; shift; A=$*
+ set $B; b=$1; shift; B=$*
+ [ "$a" -lt "$b" ] 2>&- && return 1 ||:
+ { [ "$a" -gt "$b" ] 2>&- || [ "$a" ">" "$b" ]; } && return ||:
+ }; done
+ return 1
+}
+
+ipkg_srcs() {
+ local srcre="$1"
+ sed -ne "s/^src[[:space:]]\+$srcre[[:space:]]\+//p" < $IPKG_CONF
+}
+
+ipkg_src_names() {
+ sed -ne "s/^src[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
+}
+
+ipkg_src_byname() {
+ local src="$1"
+ ipkg_srcs $src | head -n 1
+}
+
+ipkg_dests() {
+ local destre="`echo $1 | ipkg_protect_slashes`"
+ sed -ne "/^dest[[:space:]]\+$destre/{
+s/^dest[[:space:]]\+[^[:space:]]\+[[:space:]]\+//
+s/^/`echo $IPKG_OFFLINE_ROOT | ipkg_protect_slashes`/
+p
+}" < $IPKG_CONF
+}
+
+ipkg_dest_names() {
+ sed -ne "s/^dest[[:space:]]\+\([^[:space:]]\+\).*/\1/p" < $IPKG_CONF
+}
+
+ipkg_dests_all() {
+ ipkg_dests '.*'
+}
+
+ipkg_state_dirs() {
+ ipkg_dests_all | sed "s|\$|/$IPKG_DIR_PREFIX|"
+}
+
+ipkg_dest_default() {
+ ipkg_dests_all | head -n 1
+}
+
+ipkg_dest_default_name() {
+ ipkg_dest_names | head -n 1
+}
+
+ipkg_dest_byname() {
+ local dest="$1"
+ ipkg_dests $dest | head -n 1
+}
+
+ipkg_option() {
+ local option="$1"
+ sed -ne "s/^option[[:space:]]\+$option[[:space:]]\+//p" < $IPKG_CONF
+}
+
+ipkg_load_configuration() {
+ if [ -z "$IPKG_CONF_DIR" ]; then
+ IPKG_CONF_DIR=/etc
+ fi
+
+ IPKG_CONF="$IPKG_CONF_DIR/ipkg.conf"
+
+ if [ -z "$IPKG_OFFLINE_ROOT" ]; then
+ IPKG_OFFLINE_ROOT="`ipkg_option offline_root`"
+ fi
+ # Export IPKG_OFFLINE_ROOT for use by update-alternatives
+ export IPKG_OFFLINE_ROOT
+ if [ -n "$DEST_NAME" ]; then
+ IPKG_ROOT="`ipkg_dest_byname $DEST_NAME`"
+ if [ -z "$IPKG_ROOT" ]; then
+ if [ -d "$IPKG_OFFLINE_ROOT$DEST_NAME" ]; then
+ IPKG_ROOT="$IPKG_OFFLINE_ROOT$DEST_NAME";
+ else
+ echo "ipkg: invalid destination specification: $DEST_NAME
+Valid destinations are directories or one of the dest names from $IPKG_CONF:" >&2
+ ipkg_dest_names >&2
+ return 1
+ fi
+ fi
+ else
+ IPKG_ROOT="`ipkg_dest_default`"
+ fi
+
+ # Global ipkg state directories
+ IPKG_DIR_PREFIX=usr/lib/ipkg
+ IPKG_LISTS_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/lists
+ IPKG_PENDING_DIR=$IPKG_OFFLINE_ROOT/$IPKG_DIR_PREFIX/pending
+ if [ -z "$IPKG_TMP" ]; then
+ IPKG_TMP=$IPKG_ROOT/tmp/ipkg
+ fi
+
+ [ -e "$IPKG_TMP" ] || mkdir -p $IPKG_TMP
+
+ # Destination specific ipkg meta-data directory
+ IPKG_STATE_DIR=$IPKG_ROOT/$IPKG_DIR_PREFIX
+
+ # Proxy Support
+ IPKG_PROXY_USERNAME="`ipkg_option proxy_username`"
+ IPKG_PROXY_PASSWORD="`ipkg_option proxy_password`"
+ IPKG_HTTP_PROXY="`ipkg_option http_proxy`"
+ IPKG_FTP_PROXY="`ipkg_option ftp_proxy`"
+ IPKG_NO_PROXY="`ipkg_option no_proxy`"
+ if [ -n "$IPKG_HTTP_PROXY" ]; then
+ export http_proxy="$IPKG_HTTP_PROXY"
+ fi
+
+ if [ -n "$IPKG_FTP_PROXY" ]; then
+ export ftp_proxy="$IPKG_FTP_PROXY"
+ fi
+
+ if [ -n "$IPKG_NO_PROXY" ]; then
+ export no_proxy="$IPKG_NO_PROXY"
+ fi
+
+ IPKG_STATUS_FIELDS='\(Package\|Status\|Essential\|Version\|Conffiles\|Root\)'
+}
+
+ipkg_usage() {
+ [ $# -gt 0 ] && echo "ipkg: $*" ||:
+ echo "
+usage: ipkg [options...] sub-command [arguments...]
+where sub-command is one of:
+
+Package Manipulation:
+ update Update list of available packages
+ upgrade Upgrade all installed packages to latest version
+ install <pkg> Download and install <pkg> (and dependencies)
+ install <file.ipk> Install package <file.ipk>
+ install <file.deb> Install package <file.deb>
+ remove <pkg> Remove package <pkg>
+
+Informational Commands:
+ list List available packages and descriptions
+ files <pkg> List all files belonging to <pkg>
+ search <file> Search for a packaging providing <file>
+ info [pkg [<field>]] Display all/some info fields for <pkg> or all
+ status [pkg [<field>]] Display all/some status fields for <pkg> or all
+ depends <pkg> Print uninstalled package dependencies for <pkg>
+
+Options:
+ -d <dest_name> Use <dest_name> as the the root directory for
+ -dest <dest_name> package installation, removal, upgrading.
+ <dest_name> should be a defined dest name from the
+ configuration file, (but can also be a directory
+ name in a pinch).
+ -o <offline_root> Use <offline_root> as the root for offline installation.
+ -offline <offline_root>
+
+Wget Options:
+ -q Quiet option for wget
+ -c Continue option for wget
+
+Force Options (use when ipkg is too smart for its own good):
+ -force-depends Make dependency checks warnings instead of errors
+ -force-defaults Use default options for questions asked by ipkg.
+ (no prompts). Note that this will not prevent
+ package installation scripts from prompting.
+" >&2
+ exit 1
+}
+
+ipkg_dir_part() {
+ local dir="`echo $1 | sed -ne 's/\(.*\/\).*/\1/p'`"
+ if [ -z "$dir" ]; then
+ dir="./"
+ fi
+ echo $dir
+}
+
+ipkg_file_part() {
+ echo $1 | sed 's/.*\///'
+}
+
+ipkg_protect_slashes() {
+ sed -e 's/\//\\\//g'
+}
+
+ipkg_download() {
+ local src="$1"
+ local dest="$2"
+
+ local src_file="`ipkg_file_part $src`"
+ local dest_dir="`ipkg_dir_part $dest`"
+ if [ -z "$dest_dir" ]; then
+ dest_dir="$IPKG_TMP"
+ fi
+
+ local dest_file="`ipkg_file_part $dest`"
+ if [ -z "$dest_file" ]; then
+ dest_file="$src_file"
+ fi
+
+ # Proxy support
+ local proxyuser=""
+ local proxypassword=""
+ local proxyoption=""
+
+ if [ -n "$IPKG_PROXY_USERNAME" ]; then
+ proxyuser="--proxy-user=\"$IPKG_PROXY_USERNAME\""
+ proxypassword="--proxy-passwd=\"$IPKG_PROXY_PASSWORD\""
+ fi
+
+ if [ -n "$IPKG_PROXY_HTTP" -o -n "$IPKG_PROXY_FTP" ]; then
+ proxyoption="--proxy=on"
+ fi
+
+ echo "Downloading $src ..."
+ rm -f $IPKG_TMP/$src_file
+ case "$src" in
+ http://* | ftp://*)
+ if ! wget $additional_options --passive-ftp $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then
+ echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err"
+ return 1
+ fi
+ mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null
+ ;;
+ file:/* )
+ ln -s `echo $src | sed 's/^file://'` $dest_dir/$dest_file 2>/dev/null
+ ;;
+ *)
+ echo "DEBUG: $src"
+ ;;
+ esac
+
+ echo "Done."
+ return 0
+}
+
+ipkg_update() {
+ if [ ! -e "$IPKG_LISTS_DIR" ]; then
+ mkdir -p $IPKG_LISTS_DIR
+ fi
+
+ local err=
+ for src_name in `ipkg_src_names`; do
+ local src="`ipkg_src_byname $src_name`"
+ if ! ipkg_download $src/Packages $IPKG_LISTS_DIR/$src_name; then
+ echo "ipkg_update: Error downloading $src/Packages to $IPKG_LISTS_DIR/$src_name" >&2
+ err=t
+ else
+ echo "Updated list of available packages in $IPKG_LISTS_DIR/$src_name"
+ fi
+ done
+
+ [ -n "$err" ] && return 1 ||:
+
+ return 0
+}
+
+ipkg_list() {
+ for src in `ipkg_src_names`; do
+ if ipkg_require_list $src; then
+# black magic...
+sed -ne "
+/^Package:/{
+s/^Package:[[:space:]]*\<\([a-z0-9.+-]*$1[a-z0-9.+-]*\).*/\1/
+h
+}
+/^Description:/{
+s/^Description:[[:space:]]*\(.*\)/\1/
+H
+g
+s/\\
+/ - /
+p
+}
+" $IPKG_LISTS_DIR/$src
+ fi
+ done
+}
+
+ipkg_extract_paragraph() {
+ local pkg="$1"
+ sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/p"
+}
+
+ipkg_extract_field() {
+ local field="$1"
+# blacker magic...
+ sed -ne "
+: TOP
+/^$field:/{
+p
+n
+b FIELD
+}
+d
+: FIELD
+/^$/b TOP
+/^[^[:space:]]/b TOP
+p
+n
+b FIELD
+"
+}
+
+ipkg_extract_value() {
+ sed -e "s/^[^:]*:[[:space:]]*//"
+}
+
+ipkg_require_list() {
+ [ $# -lt 1 ] && return 1 ||:
+ local src="$1"
+ if [ ! -f "$IPKG_LISTS_DIR/$src" ]; then
+ echo "ERROR: File not found: $IPKG_LISTS_DIR/$src" >&2
+ echo " You probably want to run \`ipkg update'" >&2
+ return 1
+ fi
+ return 0
+}
+
+ipkg_info() {
+ for src in `ipkg_src_names`; do
+ if ipkg_require_list $src; then
+ case $# in
+ 0)
+ cat $IPKG_LISTS_DIR/$src
+ ;;
+ 1)
+ ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src
+ ;;
+ *)
+ ipkg_extract_paragraph $1 < $IPKG_LISTS_DIR/$src | ipkg_extract_field $2
+ ;;
+ esac
+ fi
+ done
+}
+
+ipkg_status_sd() {
+ [ $# -lt 1 ] && return 0 ||:
+ sd="$1"
+ shift
+ if [ -f $sd/status ]; then
+ case $# in
+ 0)
+ cat $sd/status
+ ;;
+ 1)
+ ipkg_extract_paragraph $1 < $sd/status
+ ;;
+ *)
+ ipkg_extract_paragraph $1 < $sd/status | ipkg_extract_field $2
+ ;;
+ esac
+ fi
+ return 0
+}
+
+ipkg_status_all() {
+ for sd in `ipkg_state_dirs`; do
+ ipkg_status_sd $sd $*
+ done
+}
+
+ipkg_status() {
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_status_sd $IPKG_STATE_DIR $*
+ else
+ ipkg_status_all $*
+ fi
+}
+
+ipkg_status_matching_sd() {
+ local sd="$1"
+ local re="$2"
+ if [ -f $sd/status ]; then
+ sed -ne "
+: TOP
+/^Package:/{
+s/^Package:[[:space:]]*//
+s/[[:space:]]*$//
+h
+}
+/$re/{
+g
+p
+b NEXT
+}
+d
+: NEXT
+/^$/b TOP
+n
+b NEXT
+" < $sd/status
+ fi
+ return 0
+}
+
+ipkg_status_matching_all() {
+ for sd in `ipkg_state_dirs`; do
+ ipkg_status_matching_sd $sd $*
+ done
+}
+
+ipkg_status_matching() {
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_status_matching_sd $IPKG_STATE_DIR $*
+ else
+ ipkg_status_matching_all $*
+ fi
+}
+
+ipkg_status_installed_sd() {
+ local sd="$1"
+ local pkg="$2"
+ ipkg_status_sd $sd $pkg Status | grep -q "Status: install ok installed"
+}
+
+ipkg_status_installed_all() {
+ local ret=1
+ for sd in `ipkg_state_dirs`; do
+ if `ipkg_status_installed_sd $sd $*`; then
+ ret=0
+ fi
+ done
+ return $ret
+}
+
+ipkg_status_mentioned_sd() {
+ local sd="$1"
+ local pkg="$2"
+ [ -n "`ipkg_status_sd $sd $pkg Status`" ]
+}
+
+ipkg_files() {
+ local pkg="$1"
+ if [ -n "$DEST_NAME" ]; then
+ dests=$IPKG_ROOT
+ else
+ dests="`ipkg_dests_all`"
+ fi
+ for dest in $dests; do
+ if [ -f $dest/$IPKG_DIR_PREFIX/info/$pkg.list ]; then
+ dest_sed="`echo $dest | ipkg_protect_slashes`"
+ sed -e "s/^/$dest_sed/" < $dest/$IPKG_DIR_PREFIX/info/$pkg.list
+ fi
+ done
+}
+
+ipkg_search() {
+ local pattern="$1"
+
+ for dest_name in `ipkg_dest_names`; do
+ dest="`ipkg_dest_byname $dest_name`"
+ dest_sed="`echo $dest | ipkg_protect_slashes`"
+
+ set +o noglob
+ local list_files="`ls -1 $dest/$IPKG_DIR_PREFIX/info/*.list 2>/dev/null`"
+ set -o noglob
+ for file in $list_files; do
+ if sed "s/^/$dest_sed/" $file | grep -q $pattern; then
+ local pkg="`echo $file | sed "s/^.*\/\(.*\)\.list/\1/"`"
+ [ "$dest_name" != `ipkg_dest_default_name` ] && pkg="$pkg ($dest_name)" ||:
+ sed "s/^/$dest_sed/" $file | grep $pattern | sed "s/^/$pkg: /"
+ fi
+ done
+ done
+}
+
+ipkg_status_remove_sd() {
+ local sd="$1"
+ local pkg="$2"
+
+ if [ ! -f $sd/status ]; then
+ mkdir -p $sd
+ touch $sd/status
+ fi
+ sed -ne "/Package:[[:space:]]*$pkg[[:space:]]*\$/,/^\$/!p" < $sd/status > $sd/status.new
+ mv $sd/status.new $sd/status
+}
+
+ipkg_status_remove_all() {
+ for sd in `ipkg_state_dirs`; do
+ ipkg_status_remove_sd $sd $*
+ done
+}
+
+ipkg_status_remove() {
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_status_remove_sd $IPKG_STATE_DIR $*
+ else
+ ipkg_status_remove_all $*
+ fi
+}
+
+ipkg_status_update_sd() {
+ local sd="$1"
+ local pkg="$2"
+
+ ipkg_status_remove_sd $sd $pkg
+ ipkg_extract_field "$IPKG_STATUS_FIELDS" >> $sd/status
+ echo "" >> $sd/status
+}
+
+ipkg_status_update() {
+ ipkg_status_update_sd $IPKG_STATE_DIR $*
+}
+
+ipkg_unsatisfied_dependences() {
+ local pkg=$1
+ local deps="`ipkg_get_depends $pkg`"
+ local remaining_deps=
+ for dep in $deps; do
+ local installed="`ipkg_get_installed $dep`"
+ if [ "$installed" != "installed" ] ; then
+ remaining_deps="$remaining_deps $dep"
+ fi
+ done
+ ## echo "ipkg_unsatisfied_dependences pkg=$pkg $remaining_deps" > /dev/console
+ echo $remaining_deps
+}
+
+ipkg_safe_pkg_name() {
+ local pkg=$1
+ local spkg="`echo pkg_$pkg | sed -e y/-+./___/`"
+ echo $spkg
+}
+
+ipkg_set_depends() {
+ local pkg=$1; shift
+ local new_deps="$*"
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ ## setvar ${pkg}_depends "$new_deps"
+ echo $new_deps > $IPKG_TMP/${pkg}.depends
+}
+
+ipkg_get_depends() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ cat $IPKG_TMP/${pkg}.depends
+ ## eval "echo \$${pkg}_depends"
+}
+
+ipkg_set_installed() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ echo installed > $IPKG_TMP/${pkg}.installed
+ ## setvar ${pkg}_installed "installed"
+}
+
+ipkg_set_uninstalled() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ ### echo ipkg_set_uninstalled $pkg > /dev/console
+ echo uninstalled > $IPKG_TMP/${pkg}.installed
+ ## setvar ${pkg}_installed "uninstalled"
+}
+
+ipkg_get_installed() {
+ local pkg=$1
+ pkg="`ipkg_safe_pkg_name $pkg`"
+ if [ -f $IPKG_TMP/${pkg}.installed ]; then
+ cat $IPKG_TMP/${pkg}.installed
+ fi
+ ## eval "echo \$${pkg}_installed"
+}
+
+ipkg_depends() {
+ local new_pkgs="$*"
+ local all_deps=
+ local installed_pkgs="`ipkg_status_matching_all 'Status:.*[[:space:]]installed'`"
+ for pkg in $installed_pkgs; do
+ ipkg_set_installed $pkg
+ done
+ while [ -n "$new_pkgs" ]; do
+ all_deps="$all_deps $new_pkgs"
+ local new_deps=
+ for pkg in $new_pkgs; do
+ if echo $pkg | grep -q '[^a-z0-9.+-]'; then
+ echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [a-z0-9.+-])" >&2
+ return 1
+ fi
+ # TODO: Fix this. For now I am ignoring versions and alternations in dependencies.
+ new_deps="$new_deps "`ipkg_info $pkg '\(Pre-\)\?Depends' | ipkg_extract_value | sed -e 's/([^)]*)//g
+s/\(|[[:space:]]*[a-z0-9.+-]\+[[:space:]]*\)\+//g
+s/,/ /g
+s/ \+/ /g'`
+ ipkg_set_depends $pkg $new_deps
+ done
+
+ new_deps=`echo $new_deps | sed -e 's/[[:space:]]\+/\n/g' | sort | uniq`
+
+ local maybe_new_pkgs=
+ for pkg in $new_deps; do
+ if ! echo $installed_pkgs | grep -q "\<$pkg\>"; then
+ maybe_new_pkgs="$maybe_new_pkgs $pkg"
+ fi
+ done
+
+ new_pkgs=
+ for pkg in $maybe_new_pkgs; do
+ if ! echo $all_deps | grep -q "\<$pkg\>"; then
+ if [ -z "`ipkg_info $pkg`" ]; then
+ echo "ipkg_depends: Warning: $pkg mentioned in dependency but no package found in $IPKG_LISTS_DIR" >&2
+ ipkg_set_installed $pkg
+ else
+ new_pkgs="$new_pkgs $pkg"
+ ipkg_set_uninstalled $pkg
+ fi
+ else
+ ipkg_set_uninstalled $pkg
+ fi
+ done
+ done
+
+ echo $all_deps
+}
+
+ipkg_get_install_dest() {
+ local dest="$1"
+ shift
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local info_dir=$sd/info
+
+ local requested_pkgs="$*"
+ local pkgs="`ipkg_depends $*`"
+
+ mkdir -p $info_dir
+ for pkg in $pkgs; do
+ if ! ipkg_status_mentioned_sd $sd $pkg; then
+ echo "Package: $pkg
+Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg
+ fi
+ done
+ ## mark the packages that we were directly requested to install as uninstalled
+ for pkg in $requested_pkgs; do ipkg_set_uninstalled $pkg; done
+
+ local new_pkgs=
+ local pkgs_installed=0
+ while [ -n "pkgs" ]; do
+ curcheck=0
+ ## echo "pkgs to install: {$pkgs}" > /dev/console
+ for pkg in $pkgs; do
+ curcheck="`expr $curcheck + 1`"
+ local is_installed="`ipkg_get_installed $pkg`"
+ if [ "$is_installed" = "installed" ]; then
+ echo "$pkg is installed" > /dev/console
+ continue
+ fi
+
+ local remaining_deps="`ipkg_unsatisfied_dependences $pkg`"
+ if [ -n "$remaining_deps" ]; then
+ new_pkgs="$new_pkgs $pkg"
+ ### echo "Dependences not satisfied for $pkg: $remaining_deps"
+ if [ $curcheck -ne `echo $pkgs|wc -w` ]; then
+ continue
+ fi
+ fi
+
+ local filename=
+ for src in `ipkg_src_names`; do
+ if ipkg_require_list $src; then
+ filename="`ipkg_extract_paragraph $pkg < $IPKG_LISTS_DIR/$src | ipkg_extract_field Filename | ipkg_extract_value`"
+ [ -n "$filename" ] && break ||:
+ fi
+ done
+
+ if [ -z "$filename" ]; then
+ echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR"
+ echo "ipkg_get_install: Check the spelling and maybe run \`ipkg update'."
+ ipkg_status_remove_sd $sd $pkg
+ return 1;
+ fi
+
+ echo ""
+ local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $filename`
+ if ! ipkg_download `ipkg_src_byname $src`/$filename $tmp_pkg_file; then
+ echo "ipkg_get_install: Perhaps you need to run \`ipkg update'?"
+ return 1
+ fi
+
+ if ! ipkg_install_file_dest $dest $tmp_pkg_file; then
+ echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file"
+ echo "ipkg_get_install: I'll leave it there for you to try a manual installation"
+ return 1
+ fi
+
+ ipkg_set_installed $pkg
+ pkgs_installed="`expr $pkgs_installed + 1`"
+ rm $tmp_pkg_file
+ done
+ ### echo "Installed $pkgs_installed package(s) this round"
+ if [ $pkgs_installed -eq 0 ]; then
+ if [ -z "$new_pkgs" ]; then
+ break
+ fi
+ fi
+ pkgs_installed=0
+ pkgs="$new_pkgs"
+ new_pkgs=
+ curcheck=0
+ done
+}
+
+ipkg_get_install() {
+ ipkg_get_install_dest $IPKG_ROOT $*
+}
+
+ipkg_install_file_dest() {
+ local dest="$1"
+ local filename="$2"
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local info_dir=$sd/info
+
+ if [ ! -f "$filename" ]; then
+ echo "ipkg_install_file: ERROR: File $filename not found"
+ return 1
+ fi
+
+ local pkg="`ipkg_file_part $filename | sed 's/\([a-z0-9.+-]\+\)_.*/\1/'`"
+ local ext="`echo $filename | sed 's/.*\.//'`"
+ local pkg_extract_stdout
+ if [ "$ext" = "ipk" ]; then
+ pkg_extract_stdout="tar -xzOf"
+ elif [ "$ext" = "deb" ]; then
+ pkg_extract_stdout="ar p"
+ else
+ echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)"
+ return 1
+ fi
+
+ # Check dependencies
+ local depends="`ipkg_depends $pkg | sed -e "s/\<$pkg\>//"`"
+
+ # Don't worry about deps that are scheduled for installation
+ local missing_deps=
+ for dep in $depends; do
+ if ! ipkg_status_all $dep | grep -q 'Status:[[:space:]]install'; then
+ missing_deps="$missing_deps $dep"
+ fi
+ done
+
+ if [ ! -z "$missing_deps" ]; then
+ if [ -n "$FORCE_DEPENDS" ]; then
+ echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps"
+ else
+ echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs:
+ $missing_deps"
+ echo "ipkg_install_file: You may want to use \`ipkg install' to install these."
+ return 1
+ fi
+ fi
+
+ mkdir -p $IPKG_TMP/$pkg/control
+ mkdir -p $IPKG_TMP/$pkg/data
+ mkdir -p $info_dir
+
+ if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; tar -xzf - ) ; then
+ echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename"
+ return 1
+ fi
+
+ if [ -n "$IPKG_OFFLINE_ROOT" ]; then
+ if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then
+ echo "*** Warning: Package $pkg may not be installed in offline mode"
+ echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)"
+ echo "Package: $pkg
+Status: install ok pending" | ipkg_status_update_sd $sd $pkg
+ mkdir -p $IPKG_PENDING_DIR
+ cp -f $filename $IPKG_PENDING_DIR
+ rm -r $IPKG_TMP/$pkg/control
+ rm -r $IPKG_TMP/$pkg/data
+ rmdir $IPKG_TMP/$pkg
+ return 0
+ fi
+ fi
+
+
+ echo -n "Unpacking $pkg..."
+ set +o noglob
+ for file in $IPKG_TMP/$pkg/control/*; do
+ local base_file="`ipkg_file_part $file`"
+ mv $file $info_dir/$pkg.$base_file
+ done
+ set -o noglob
+ rm -r $IPKG_TMP/$pkg/control
+
+ if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; tar -xzf - ) ; then
+ echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename"
+ return 1
+ fi
+ echo "Done."
+
+ echo -n "Configuring $pkg..."
+ export PKG_ROOT=$dest
+ if [ -x "$info_dir/$pkg.preinst" ]; then
+ if ! $info_dir/$pkg.preinst install; then
+ echo "$info_dir/$pkg.preinst failed. Aborting installation of $pkg"
+ rm -rf $IPKG_TMP/$pkg/data
+ rmdir $IPKG_TMP/$pkg
+ return 1
+ fi
+ fi
+
+ local old_conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
+ local new_conffiles=
+ if [ -f "$info_dir/$pkg.conffiles" ]; then
+ for conffile in `cat $info_dir/$pkg.conffiles`; do
+ if [ -f "$dest/$conffile" ] && ! echo " $old_conffiles " | grep -q " $conffile "`md5sum $dest/$conffile | sed 's/ .*//'`; then
+ local use_maintainers_conffile=
+ if [ -z "$FORCE_DEFAULTS" ]; then
+ while true; do
+ echo -n "Configuration file \`$conffile'
+ ==> File on system created by you or by a script.
+ ==> File also in package provided by package maintainer.
+ What would you like to do about it ? Your options are:
+ Y or I : install the package maintainer's version
+ N or O : keep your currently-installed version
+ D : show the differences between the versions (if diff is installed)
+ The default action is to keep your current version.
+*** `ipkg_file_part $conffile` (Y/I/N/O/D) [default=N] ? "
+ read response
+ case "$response" in
+ [YyIi] | [Yy][Ee][Ss])
+ use_maintainers_conffile=t
+ break
+ ;;
+ [Dd])
+ echo "
+diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
+ diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile || true
+ echo "[Press ENTER to continue]"
+ read junk
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+ fi
+ if [ -n "$use_maintainers_conffile" ]; then
+ local md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
+ new_conffiles="$new_conffiles $conffile $md5sum"
+ else
+ new_conffiles="$new_conffiles $conffile <custom>"
+ rm $IPKG_TMP/$pkg/data/$conffile
+ fi
+ else
+ md5sum="`md5sum $IPKG_TMP/$pkg/data/$conffile | sed 's/ .*//'`"
+ new_conffiles="$new_conffiles $conffile $md5sum"
+ fi
+ done
+ fi
+
+ local owd="`pwd`"
+ (cd $IPKG_TMP/$pkg/data/; tar cf - . | (cd $owd; cd $dest; tar xf -))
+ rm -rf $IPKG_TMP/$pkg/data
+ rmdir $IPKG_TMP/$pkg
+ rm -f $info_dir/$pkg.list
+ $pkg_extract_stdout $filename ./data.tar.gz | tar tzf - | sed -e 's/^\.//' > $info_dir/$pkg.list
+
+ if [ -x "$info_dir/$pkg.postinst" ]; then
+ IPKG_INSTROOT="$IPKG_INSTROOT" $info_dir/$pkg.postinst configure
+ fi
+
+ if [ -n "$new_conffiles" ]; then
+ new_conffiles='Conffiles: '`echo $new_conffiles | ipkg_protect_slashes`
+ fi
+ local sed_safe_offline_root="`echo ${IPKG_OFFLINE_ROOT} | ipkg_protect_slashes`"
+ local sed_safe_root="`echo $dest | sed -e "s/^${sed_safe_offline_root}//" | ipkg_protect_slashes`"
+ sed -e "s/\(Package:.*\)/\1\\
+Status: install ok installed\\
+Root: ${sed_safe_root}\\
+${new_conffiles}/" $info_dir/$pkg.control | ipkg_status_update_sd $sd $pkg
+
+ rm -f $info_dir/$pkg.control
+ rm -f $info_dir/$pkg.conffiles
+ rm -f $info_dir/$pkg.preinst
+ rm -f $info_dir/$pkg.postinst
+
+ echo "Done."
+}
+
+ipkg_install_file() {
+ ipkg_install_file_dest $IPKG_ROOT $*
+}
+
+ipkg_install() {
+
+ while [ $# -gt 0 ]; do
+ local pkg="$1"
+ shift
+
+ case "$pkg" in
+ http://* | ftp://*)
+ local tmp_pkg_file="$IPKG_TMP/"`ipkg_file_part $pkg`
+ if ipkg_download $pkg $tmp_pkg_file; then
+ ipkg_install_file $tmp_pkg_file
+ rm $tmp_pkg_file
+ fi
+ ;;
+ file:/*.ipk | file://*.deb)
+ local ipkg_filename="`echo $pkg|sed 's/^file://'`"
+ ipkg_install_file $ipkg_filename
+ ;;
+ *.ipk | *.deb)
+ if [ -f "$pkg" ]; then
+ ipkg_install_file $pkg
+ else
+ echo "File not found $pkg" >&2
+ fi
+ ;;
+ *)
+ ipkg_get_install $pkg || true
+ ;;
+ esac
+ done
+}
+
+ipkg_install_pending() {
+ [ -n "$IPKG_OFFLINE_ROOT" ] && return 0 ||:
+
+ if [ -d "$IPKG_PENDING_DIR" ]; then
+ set +o noglob
+ local pending="`ls -1d $IPKG_PENDING_DIR/*.ipk 2> /dev/null`" || true
+ set -o noglob
+ if [ -n "$pending" ]; then
+ echo "The following packages in $IPKG_PENDING_DIR will now be installed:"
+ echo $pending
+ for filename in $pending; do
+ if ipkg_install_file $filename; then
+ rm $filename
+ fi
+ done
+ fi
+ fi
+ return 0
+}
+
+ipkg_install_wanted() {
+ local wanted="`ipkg_status_matching 'Status:[[:space:]]*install.*not-installed'`"
+
+ if [ -n "$wanted" ]; then
+ echo "The following package were previously requested but have not been installed:"
+ echo $wanted
+
+ if [ -n "$FORCE_DEFAULTS" ]; then
+ echo "Installing them now."
+ else
+ echo -n "Install them now [Y/n] ? "
+ read response
+ case "$response" in
+ [Nn] | [Nn][Oo])
+ return 0
+ ;;
+ esac
+ fi
+
+ ipkg_install $wanted
+ fi
+
+ return 0
+}
+
+ipkg_upgrade_pkg() {
+ local pkg="$1"
+ local avail_ver="`ipkg_info $pkg Version | ipkg_extract_value | head -n 1`"
+
+ is_installed=
+ for dest_name in `ipkg_dest_names`; do
+ local dest="`ipkg_dest_byname $dest_name`"
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local inst_ver="`ipkg_status_sd $sd $pkg Version | ipkg_extract_value`"
+ if [ -n "$inst_ver" ]; then
+ is_installed=t
+
+ if [ -z "$avail_ver" ]; then
+ echo "Assuming locally installed package $pkg ($inst_ver) is up to date"
+ return 0
+ fi
+
+ if [ "$avail_ver" = "$inst_ver" ]; then
+ echo "Package $pkg ($inst_ver) installed in $dest_name is up to date"
+ elif ipkg_is_upgrade "$avail_ver" "$inst_ver"; then
+ echo "Upgrading $pkg ($dest_name) from $inst_ver to $avail_ver"
+ ipkg_get_install_dest $dest $pkg
+ else
+ echo "Not downgrading package $pkg from $inst_ver to $avail_ver"
+ fi
+ fi
+ done
+
+ if [ -z "$is_installed" ]; then
+ echo "Package $pkg does not appear to be installed"
+ return 0
+ fi
+
+}
+
+ipkg_upgrade() {
+ if [ $# -lt 1 ]; then
+ local pkgs="`ipkg_status_matching 'Status:.*[[:space:]]installed'`"
+ else
+ pkgs="$*"
+ fi
+
+ for pkg in $pkgs; do
+ ipkg_upgrade_pkg $pkg
+ done
+}
+
+ipkg_remove_pkg_dest() {
+ local dest="$1"
+ local pkg="$2"
+ local sd=$dest/$IPKG_DIR_PREFIX
+ local info_dir=$sd/info
+
+ if ! ipkg_status_installed_sd $sd $pkg; then
+ echo "ipkg_remove: Package $pkg does not appear to be installed in $dest"
+ if ipkg_status_mentioned_sd $sd $pkg; then
+ echo "Purging mention of $pkg from the ipkg database"
+ ipkg_status_remove_sd $sd $pkg
+ fi
+ return 1
+ fi
+
+ echo "ipkg_remove: Removing $pkg... "
+
+ local files="`cat $info_dir/$pkg.list`"
+
+ export PKG_ROOT=$dest
+ if [ -x "$info_dir/$pkg.prerm" ]; then
+ $info_dir/$pkg.prerm remove
+ fi
+
+ local conffiles="`ipkg_status_sd $sd $pkg Conffiles | ipkg_extract_value`"
+
+ local dirs_to_remove=
+ for file in $files; do
+ if [ -d "$dest/$file" ]; then
+ dirs_to_remove="$dirs_to_remove $dest/$file"
+ else
+ if echo " $conffiles " | grep -q " $file "; then
+ if echo " $conffiles " | grep -q " $file "`md5sum $dest/$file | sed 's/ .*//'`; then
+ rm -f $dest/$file
+ fi
+ else
+ rm -f $dest/$file
+ fi
+ fi
+ done
+
+ local removed_a_dir=t
+ while [ -n "$removed_a_dir" ]; do
+ removed_a_dir=
+ local new_dirs_to_remove=
+ for dir in $dirs_to_remove; do
+ if rmdir $dir >/dev/null 2>&1; then
+ removed_a_dir=t
+ else
+ new_dirs_to_remove="$new_dirs_to_remove $dir"
+ fi
+ done
+ dirs_to_remove="$new_dirs_to_remove"
+ done
+
+ if [ -n "$dirs_to_remove" ]; then
+ echo "ipkg_remove: Warning: Not removing the following directories since they are not empty:" >&2
+ echo "$dirs_to_remove" | sed -e 's/\/[/]\+/\//g' >&2
+ fi
+
+ if [ -x "$info_dir/$pkg.postrm" ]; then
+ $info_dir/$pkg.postrm remove
+ fi
+
+ ipkg_status_remove_sd $sd $pkg
+ set +o noglob
+ rm -f $info_dir/$pkg.*
+ set -o noglob
+
+ echo "Done."
+}
+
+ipkg_remove_pkg() {
+ local pkg="$1"
+ for dest in `ipkg_dests_all`; do
+ local sd=$dest/$IPKG_DIR_PREFIX
+ if ipkg_status_mentioned_sd $sd $pkg; then
+ ipkg_remove_pkg_dest $dest $pkg
+ fi
+ done
+}
+
+ipkg_remove() {
+ while [ $# -gt 0 ]; do
+ local pkg="$1"
+ shift
+ if [ -n "$DEST_NAME" ]; then
+ ipkg_remove_pkg_dest $IPKG_ROOT $pkg
+ else
+ ipkg_remove_pkg $pkg
+ fi
+ done
+}
+
+###########
+# ipkg main
+###########
+
+# Parse options
+while [ $# -gt 0 ]; do
+ arg="$1"
+ case $arg in
+ -d | -dest)
+ [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
+ DEST_NAME="$2"
+ shift
+ ;;
+ -o | -offline)
+ [ $# -gt 1 ] || ipkg_usage "option $arg requires an argument"
+ IPKG_OFFLINE_ROOT="$2"
+ shift
+ ;;
+ -force-depends)
+ FORCE_DEPENDS=t
+ ;;
+ -force-defaults)
+ FORCE_DEFAULTS=t
+ ;;
+ -c)
+ additional_options="$additional_options -c "
+ ;;
+ -q)
+ additional_options="$additional_options -q "
+ ;;
+ -*)
+ ipkg_usage "unknown option $arg"
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+[ $# -ge 1 ] || ipkg_usage "ipkg must have one sub-command argument"
+cmd="$1"
+shift
+
+ipkg_load_configuration
+mkdir -p /tmp/ipkg
+
+case "$cmd" in
+update|upgrade|list|info|status|install_pending)
+ ;;
+install|depends|remove|files|search)
+ [ $# -ge 1 ] || ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument"
+ ;;
+*)
+ echo "ERROR: unknown sub-command \`$cmd'"
+ ipkg_usage
+ ;;
+esac
+
+# Only install pending if we have an interactive sub-command
+case "$cmd" in
+upgrade|install)
+ ipkg_install_pending
+ ipkg_install_wanted
+ ;;
+esac
+
+ipkg_$cmd $*
+for a in `ls $IPKG_TMP`; do
+ rm -rf $IPKG_TMP/$a
+done
diff --git a/scripts/ipkg-build b/scripts/ipkg-build
new file mode 100644
index 000000000..4c0f47143
--- /dev/null
+++ b/scripts/ipkg-build
@@ -0,0 +1,253 @@
+#!/bin/sh -x
+
+# ipkg-build -- construct a .ipk from a directory
+# Carl Worth <cworth@east.isi.edu>
+# based on a script by Steve Redler IV, steve@sr-tech.com 5-21-2001
+# 2003-04-25 rea@sr.unh.edu
+# Updated to work on Familiar Pre0.7rc1, with busybox tar.
+# Note it Requires: binutils-ar (since the busybox ar can't create)
+# For UID debugging it needs a better "find".
+set -e
+
+version=1.0
+
+ipkg_extract_value() {
+ sed -e "s/^[^:]*:[[:space:]]*//"
+}
+
+required_field() {
+ field=$1
+
+ value=`grep "^$field:" < $CONTROL/control | ipkg_extract_value`
+ if [ -z "$value" ]; then
+ echo "*** Error: $CONTROL/control is missing field $field" >&2
+ return 1
+ fi
+ echo $value
+ return 0
+}
+
+disallowed_field() {
+ field=$1
+
+ value=`grep "^$field:" < $CONTROL/control | ipkg_extract_value`
+ if [ -n "$value" ]; then
+ echo "*** Error: $CONTROL/control contains disallowed field $field" >&2
+ return 1
+ fi
+ echo $value
+ return 0
+}
+
+pkg_appears_sane() {
+ local pkg_dir=$1
+
+ local owd=$PWD
+ cd $pkg_dir
+
+ PKG_ERROR=0
+
+ cvs_dirs=`find . -name 'CVS'`
+ if [ -n "$cvs_dirs" ]; then
+ if [ "$noclean" = "1" ]; then
+ echo "*** Warning: The following CVS directories where found.
+You probably want to remove them: " >&2
+ ls -ld $cvs_dirs
+ echo >&2
+ else
+ echo "*** Removing the following files: $cvs_dirs"
+ rm -rf "$cvs_dirs"
+ fi
+ fi
+
+ tilde_files=`find . -name '*~'`
+ if [ -n "$tilde_files" ]; then
+ if [ "$noclean" = "1" ]; then
+ echo "*** Warning: The following files have names ending in '~'.
+You probably want to remove them: " >&2
+ ls -ld $tilde_files
+ echo >&2
+ else
+ echo "*** Removing the following files: $tilde_files"
+ rm -f "$tilde_files"
+ fi
+ fi
+
+ if [ ! -f "$CONTROL/control" ]; then
+ echo "*** Error: Control file $pkg_dir/$CONTROL/control not found." >&2
+ cd $owd
+ return 1
+ fi
+
+ pkg=`required_field Package`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ version=`required_field Version | sed 's/Version://; s/^.://g;'`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ arch=`required_field Architecture`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ required_field Maintainer >/dev/null
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ required_field Description >/dev/null
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ section=`required_field Section`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+ if [ -z "$section" ]; then
+ echo "The Section field should have one of the following values:" >&2
+ echo "admin, base, comm, editors, extras, games, graphics, kernel, libs, misc, net, text, web, x11" >&2
+ fi
+
+ priority=`required_field Priority`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+ if [ -z "$priority" ]; then
+ echo "The Priority field should have one of the following values:" >&2
+ echo "required, important, standard, optional, extra." >&2
+ echo "If you don't know which priority value you should be using, then use \`optional'" >&2
+ fi
+
+ source=`required_field Source`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+ if [ -z "$source" ]; then
+ echo "The Source field contain the URL's or filenames of the source code and any patches"
+ echo "used to build this package. Either gnu-style tarballs or Debian source packages "
+ echo "are acceptable. Relative filenames may be used if they are distributed in the same"
+ echo "directory as the .ipk file."
+ fi
+
+ disallowed_filename=`disallowed_field Filename`
+ [ "$?" -ne 0 ] && PKG_ERROR=1
+
+ if echo $pkg | grep '[^a-z0-9.+-]'; then
+ echo "*** Error: Package name $name contains illegal characters, (other than [a-z0-9.+-])" >&2
+ PKG_ERROR=1;
+ fi
+
+ local bad_fields=`sed -ne 's/^\([^[:space:]][^:[:space:]]\+[[:space:]]\+\)[^:].*/\1/p' < $CONTROL/control | sed -e 's/\\n//'`
+ if [ -n "$bad_fields" ]; then
+ bad_fields=`echo $bad_fields`
+ echo "*** Error: The following fields in $CONTROL/control are missing a ':'" >&2
+ echo " $bad_fields" >&2
+ echo "ipkg-build: This may be due to a missing initial space for a multi-line field value" >&2
+ PKG_ERROR=1
+ fi
+
+ for script in $CONTROL/preinst $CONTROL/postinst $CONTROL/prerm $CONTROL/postrm; do
+ if [ -f $script -a ! -x $script ]; then
+ if [ "$noclean" = "1" ]; then
+ echo "*** Error: package script $script is not executable" >&2
+ PKG_ERROR=1
+ else
+ chmod a+x $script
+ fi
+ fi
+ done
+
+ if [ -f $CONTROL/conffiles ]; then
+ for cf in `cat $CONTROL/conffiles`; do
+ if [ ! -f ./$cf ]; then
+ echo "*** Error: $CONTROL/conffiles mentions conffile $cf which does not exist" >&2
+ PKG_ERROR=1
+ fi
+ done
+ fi
+
+ cd $owd
+ return $PKG_ERROR
+}
+
+###
+# ipkg-build "main"
+###
+ogargs=""
+outer=ar
+noclean=0
+usage="Usage: $0 [-c] [-C] [-o owner] [-g group] <pkg_directory> [<destination_directory>]"
+while getopts "cg:ho:v" opt; do
+ case $opt in
+ o ) owner=$OPTARG
+ ogargs="--owner=$owner"
+ ;;
+ g ) group=$OPTARG
+ ogargs="$ogargs --group=$group"
+ ;;
+ c ) outer=tar
+ ;;
+ C ) noclean=1
+ ;;
+ v ) echo $version
+ exit 0
+ ;;
+ h ) echo $usage >&2 ;;
+ \? ) echo $usage >&2
+ esac
+done
+
+
+shift $(($OPTIND - 1))
+
+# continue on to process additional arguments
+
+case $# in
+1)
+ dest_dir=$PWD
+ ;;
+2)
+ dest_dir=$2
+ if [ "$dest_dir" = "." -o "$dest_dir" = "./" ] ; then
+ dest_dir=$PWD
+ fi
+ ;;
+*)
+ echo $usage >&2
+ exit 1
+ ;;
+esac
+
+pkg_dir=$1
+
+if [ ! -d $pkg_dir ]; then
+ echo "*** Error: Directory $pkg_dir does not exist" >&2
+ exit 1
+fi
+
+# CONTROL is second so that it takes precedence
+CONTROL=
+[ -d $pkg_dir/DEBIAN ] && CONTROL=DEBIAN
+[ -d $pkg_dir/CONTROL ] && CONTROL=CONTROL
+if [ -z "$CONTROL" ]; then
+ echo "*** Error: Directory $pkg_dir has no CONTROL subdirectory." >&2
+ exit 1
+fi
+
+if ! pkg_appears_sane $pkg_dir; then
+ echo >&2
+ echo "ipkg-build: Please fix the above errors and try again." >&2
+ exit 1
+fi
+
+tmp_dir=$dest_dir/IPKG_BUILD.$$
+mkdir $tmp_dir
+
+echo $CONTROL > $tmp_dir/tarX
+( cd $pkg_dir && tar $ogargs -czf $tmp_dir/data.tar.gz . -X $tmp_dir/tarX )
+( cd $pkg_dir/$CONTROL && tar $ogargs -czf $tmp_dir/control.tar.gz . )
+rm $tmp_dir/tarX
+
+echo "2.0" > $tmp_dir/debian-binary
+
+pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
+rm -f $pkg_file
+if [ "$outer" = "ar" ] ; then
+ ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
+else
+ ( cd $tmp_dir && tar -zcf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
+fi
+
+rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
+rmdir $tmp_dir
+
+echo "Packaged contents of $pkg_dir into $pkg_file"
diff --git a/scripts/ipkg-make-index.sh b/scripts/ipkg-make-index.sh
new file mode 100644
index 000000000..ec07dff59
--- /dev/null
+++ b/scripts/ipkg-make-index.sh
@@ -0,0 +1,23 @@
+set -e
+
+pkg_dir=$1
+
+if [[ -z $pkg_dir || ! -d $pkg_dir ]]; then
+ echo "Usage: ipkg-make-index <package_directory>"
+ exit 1
+fi
+
+find "$pkg_dir" -name '*.ipk' | sort | while IFS= read pkg; do
+ dpkg=${pkg##*/}
+ echo "Generating index for package $dpkg" >&2
+ file_size=$(ls -l $pkg | awk '{print $5}')
+ md5sum=$(md5sum $pkg)
+ tar -xzOf "$pkg" ./control.tar.gz | \
+ tar -xzOf - ./control | \
+ sed -e "s^Description:Filename: $dpkg\\
+Size: $file_size\\
+MD5Sum: ${md5sum%% *}\\
+Description:"
+ echo ""
+done
+exit 0
diff --git a/scripts/make b/scripts/make
new file mode 100755
index 000000000..c8807be94
--- /dev/null
+++ b/scripts/make
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+if [ -z "$(which gmake 2>/dev/null)" ];then
+ /usr/bin/make "$@"
+else
+ gmake "$@"
+fi
diff --git a/scripts/make-ipkg-dir.sh b/scripts/make-ipkg-dir.sh
new file mode 100644
index 000000000..08b48f59e
--- /dev/null
+++ b/scripts/make-ipkg-dir.sh
@@ -0,0 +1,20 @@
+BASE=http://waldemar-brodkorb.de
+TARGET=$1
+CONTROL=$2
+VERSION=$3
+ARCH=$4
+
+WD=$(pwd)
+
+mkdir -p "$TARGET/CONTROL"
+grep '^[^(Version|Architecture)]' "$CONTROL" > "$TARGET/CONTROL/control"
+grep '^Maintainer' "$CONTROL" 2>&1 >/dev/null || \
+ echo "Maintainer: Waldemar Brodkorb <mail@waldemar-brodkorb.de>" >> "$TARGET/CONTROL/control"
+grep '^Source' "$CONTROL" 2>&1 >/dev/null || {
+ pkgbase=$(echo "$WD" | sed -e "s|^$TOPDIR/||g")
+ [ "$pkgbase" = "$WD" ] && src="N/A" || src="$BASE/$pkgbase"
+ echo "Source: $src" >> "$TARGET/CONTROL/control"
+}
+echo "Version: $VERSION" >> "$TARGET/CONTROL/control"
+echo "Architecture: $ARCH" >> "$TARGET/CONTROL/control"
+chmod 644 "$TARGET/CONTROL/control"
diff --git a/scripts/md5sum b/scripts/md5sum
new file mode 100644
index 000000000..b76ca4ee3
--- /dev/null
+++ b/scripts/md5sum
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# $Id: md5sum 185 2008-10-28 12:24:05Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+if [ -x /usr/bin/md5sum ];then
+ md5sum "$@"
+else
+ md5 "$@" | sed 's#MD5 (\([^)]*\)) = \(.*\)#\2 \1#'
+fi
diff --git a/scripts/patch.sh b/scripts/patch.sh
new file mode 100644
index 000000000..863de3cfb
--- /dev/null
+++ b/scripts/patch.sh
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+# A little script I whipped up to make it easy to
+# patch source trees and have sane error handling
+# -Erik
+#
+# (c) 2006, 2007 Thorsten Glaser <tg@freewrt.org>
+# (c) 2002 Erik Andersen <andersen@codepoet.org>
+
+[[ -n $BASH_VERSION ]] && shopt -s extglob
+
+# Set directories from arguments, or use defaults.
+targetdir=${1-.}
+patchdir=${2-../patches}
+patchpattern=${3-*}
+
+if [ ! -d "${targetdir}" ] ; then
+ echo "Aborting. '${targetdir}' is not a directory."
+ exit 1
+fi
+if [ ! -d "${patchdir}" ] ; then
+ echo "Aborting. '${patchdir}' is not a directory."
+ exit 0
+fi
+
+wd=$(pwd)
+cd $patchdir
+rm -f $targetdir/.patch.tmp
+for i in $(eval echo ${patchpattern}); do
+ test -e "$i" || continue
+ i=$patchdir/$i
+ cd $wd
+ case $i in
+ *.gz)
+ type="gzip"; uncomp="gunzip -dc"; ;;
+ *.bz)
+ type="bzip"; uncomp="bunzip -dc"; ;;
+ *.bz2)
+ type="bzip2"; uncomp="bunzip2 -dc"; ;;
+ *.zip)
+ type="zip"; uncomp="unzip -d"; ;;
+ *.Z)
+ type="compress"; uncomp="uncompress -c"; ;;
+ *)
+ type="plaintext"; uncomp="cat"; ;;
+ esac
+ [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue
+ echo ""
+ echo "Applying ${i} using ${type}: "
+ ${uncomp} ${i} | tee $targetdir/.patch.tmp | patch -p1 -E -d ${targetdir}
+ fgrep '@@ -0,0 ' $targetdir/.patch.tmp >/dev/null 2>&1 && \
+ touch $targetdir/.patched-newfiles
+ rm -f $targetdir/.patch.tmp
+ if [ $? != 0 ] ; then
+ echo "Patch failed! Please fix $i!"
+ exit 1
+ fi
+ cd $patchdir
+done
+
+# Check for rejects...
+if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+ echo "Aborting. Reject files found."
+ exit 1
+fi
+
+# Remove backup files
+find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh
new file mode 100644
index 000000000..453f0cc89
--- /dev/null
+++ b/scripts/rstrip.sh
@@ -0,0 +1,61 @@
+# $Id: rstrip.sh 440 2009-05-13 16:09:54Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+[[ -n $BASH_VERSION ]] && shopt -s extglob
+
+SELF=${0##*/}
+
+if [[ -z $prefix ]]; then
+ echo >&2 "$SELF: strip command not defined ('prefix' variable not set)"
+ exit 1
+fi
+
+if [[ $1 = +keep ]]; then
+ stripcomm=
+ shift
+else
+ stripcomm=" -R .comment"
+fi
+
+TARGETS=$*
+
+if [[ -z $TARGETS ]]; then
+ echo >&2 "$SELF: no directories / files specified"
+ echo >&2 "usage: $SELF [PATH...]"
+ exit 1
+fi
+
+find $TARGETS -type f -a -exec file {} \; | \
+ while IFS= read -r line; do
+ F=${line%%:*}
+ V=${F##*/fake-+([!/])/}
+ T="${prefix}strip"
+ T=$T$stripcomm
+ case $line in
+ *ELF*executable*statically\ linked*)
+ echo >&2 "$SELF: *WARNING* '$V' is not dynamically linked!"
+ ;;
+ esac
+ case $line in
+ *ELF*executable*,\ not\ stripped*)
+ S=executable ;;
+ */lib/modules/2.*.o:*ELF*relocatable*,\ not\ stripped* | \
+ */lib/modules/2.*.ko:*ELF*relocatable*,\ not\ stripped*)
+ # kernel module parametres must not be stripped off
+ T="$T --strip-unneeded $(echo $(${prefix}nm $F | \
+ sed -n -e '/__param_/s/^.*__param_/-K /p' \
+ -e '/__module_parm_/s/^.*__module_parm_/-K /p'))"
+ S='kernel module' ;;
+ *ELF*relocatable*,\ not\ stripped*)
+ S=relocatable ;;
+ *ELF*shared\ object*,\ not\ stripped*)
+ S='shared object' ;;
+ *)
+ continue ;;
+ esac
+ echo "$SELF: $V:$S"
+ #echo "+ $T $F"
+ eval "$T $F"
+done
diff --git a/scripts/scan-pkgs.sh b/scripts/scan-pkgs.sh
new file mode 100644
index 000000000..ee62ed33f
--- /dev/null
+++ b/scripts/scan-pkgs.sh
@@ -0,0 +1,100 @@
+# $Id: scan-pkgs.sh 431 2009-05-09 01:01:40Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+#-
+# Scan host-tool prerequisites of certain packages before building.
+
+if test -z "$BASH_VERSION"; then
+ foo=`$BASH -c 'echo "$BASH_VERSION"'`
+else
+ foo=$BASH_VERSION
+fi
+
+if test -z "$foo"; then
+ echo OpenADK requires GNU bash to be installed.
+ exit 1
+fi
+
+test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
+
+[[ -n $BASH_VERSION ]] && shopt -s extglob
+topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
+OStype=$(env NOFAKE=yes uname)
+out=0
+
+. $topdir/.config
+
+#-- start adding dependencies here --
+if [[ -n $ADK_PACKAGE_ALSA_UTILS ]]; then
+ NEED_XMLTO="$NEED_XMLTO alsa-utils"
+fi
+
+if [[ -n $ADK_COMPILE_AVAHI ]]; then
+ NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
+fi
+
+#if [[ -n $ADK_PACKAGE_RUBY ]]; then
+# NEED_RUBY="$NEED_RUBY ruby"
+#fi
+
+if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
+ NEED_GLIBZWO="$NEED_GLIBZWO glib2"
+ NEED_GETTEXT="$NEED_GETTEXT glib2"
+ NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
+fi
+
+#-- start checking dependencies here --
+
+if [[ -n $NEED_GETTEXT ]]; then
+ if ! which xgettext >/dev/null 2>&1; then
+ echo >&2 You need gettext to build $NEED_GETTEXT
+ out=1
+ elif ! which msgfmt >/dev/null 2>&1; then
+ echo >&2 You need gettext to build $NEED_GETTEXT
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_RUBY ]]; then
+ if ! which ruby >/dev/null 2>&1; then
+ echo >&2 You need ruby to build $NEED_RUBY
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_XMLTO ]]; then
+ if ! which xmlto >/dev/null 2>&1; then
+ echo >&2 You need xmlto to build $NEED_XMLTO
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_PKGCONFIG ]]; then
+ if ! which pkg-config >/dev/null 2>&1; then
+ echo >&2 You need pkg-config to build $NEED_PKGCONFIG
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_GLIBZWO ]]; then
+ if ! which glib-genmarshal >/dev/null 2>&1; then
+ echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
+ out=1
+ fi
+fi
+
+if [[ -n $ADK_USE_CCACHE ]]; then
+ if ! which ccache >/dev/null 2>&1; then
+ echo >&2 You have selected to build with ccache, but ccache could not be found.
+ out=1
+ fi
+fi
+
+#if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
+# echo >&2 mySQL does not build on non-GNU/Linux.
+# out=1
+#fi
+
+#-- end of dependency checks
+exit $out
diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh
new file mode 100644
index 000000000..11dc4c059
--- /dev/null
+++ b/scripts/scan-tools.sh
@@ -0,0 +1,279 @@
+# $Id: scan-tools.sh 436 2009-05-10 18:15:31Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+shopt -s extglob
+topdir=$(pwd)
+opath=$PATH
+out=0
+if [ -z $(which gmake) ];then
+ makecmd=$(which make)
+else
+ makecmd=$(which gmake)
+fi
+
+if [[ $NO_ERROR != @(0|1) ]]; then
+ echo Please do not invoke this script directly!
+ exit 1
+fi
+
+set -e
+rm -rf $topdir/tmp
+mkdir -p $topdir/tmp
+cd $topdir/tmp
+
+rm -f foo
+echo >FOO
+if [[ -e foo ]]; then
+ cat >&2 <<-EOF
+ ERROR: OpenADK cannot be built in a case-insensitive file system.
+ EOF
+ exit 1
+fi
+rm -f FOO
+
+os=$(uname)
+case $os in
+Linux)
+ # supported with no extra quirks at the moment
+ ;;
+FreeBSD)
+ # supported with no extra quirks at the moment
+ ;;
+CYG*)
+ # mkdir /openadk
+ # mount -b -s -o managed "C:/openadk" "/openadk"
+ # cd /openadk
+ # svn co svn+ssh://waldemar-brodkorb.de/svn .
+ echo "Building OpenADK on $os is needs a managed mount point."
+ echo '"mount -b -s -o managed "C:/openadk" "/openadk"'
+ ;;
+NetBSD)
+ echo "Building OpenADK on $os is currently unsupported."
+ echo "Sorry."
+ echo
+ echo There are unresolved issues relating to ncurses not
+ echo being included in NetBSD®, and these provided by pkgsrc®
+ echo lack important header files.
+ ;;
+OpenBSD)
+ # supported with no extra quirks at the moment
+ # although some packages' autoconf scripts may
+ # not properly recognise OpenBSD
+ ;;
+*)
+ # unsupported
+ echo "Building OpenADK on $os is currently unsupported."
+ echo "Sorry."
+ exit 1
+ ;;
+esac
+
+set +e
+
+cat >Makefile <<'EOF'
+include ${TOPDIR}/prereq.mk
+HOSTCFLAGS+= -O2
+all: run-test
+
+test: test.c
+ ${HOSTCC} ${HOSTCFLAGS} -o $@ $^ ${LDADD}
+
+run-test: test
+ ./test
+EOF
+cat >test.c <<-'EOF'
+ #include <stdio.h>
+ int
+ main()
+ {
+ printf("Yay! Native compiler works.\n");
+ return (0);
+ }
+EOF
+X=$($makecmd TOPDIR=$topdir 2>&1)
+if [[ $X != *@(Native compiler works)* ]]; then
+ echo "$X" | sed 's/^/| /'
+ echo Cannot compile a simple test programme.
+ echo You must install a host make and C compiler,
+ echo usually GCC, to proceed.
+ echo
+ out=1
+fi
+rm test 2>/dev/null
+
+if ! which cpp >/dev/null 2>&1; then
+ echo You must install a C preprocessor to continue.
+ echo
+ out=1
+fi
+
+if ! which flex >/dev/null 2>&1; then
+ echo You must install flex to continue.
+ echo
+ out=1
+else
+ echo '%%' | flex -
+ if fgrep _POSIX_SOURCE lex.yy.c; then
+ echo Your lexer \(flex\) contains a broken skeleton.
+ if [[ $NO_ERROR = 1 ]]; then
+ echo WARNING: continue at your own risk.
+ echo Some packages may be broken.
+ else
+ echo You can continue the build by issuing \'make prereq-noerror\'
+ echo However, several packages may faild to build correctly.
+ out=1
+ fi
+ echo
+ fi
+fi
+
+if ! which bison >/dev/null 2>&1; then
+ echo You must install GNU bison to continue.
+ echo
+ out=1
+fi
+
+if ! which tar >/dev/null 2>&1; then
+ echo You must install GNU tar to continue.
+ echo
+ out=1
+fi
+
+if ! tar --version|grep GNU >/dev/null 2>&1;then
+ if ! which gtar >/dev/null 2>&1; then
+ echo You must install GNU tar to continue.
+ echo
+ out=1
+ fi
+fi
+
+if ! which gzip >/dev/null 2>&1; then
+ echo You must install gzip to continue.
+ echo
+ out=1
+fi
+
+if ! which bzip2 >/dev/null 2>&1; then
+ echo You must install bzip2 to continue.
+ echo
+ out=1
+fi
+
+if ! which cpio >/dev/null 2>&1; then
+ echo You must install cpio to continue.
+ echo
+ out=1
+fi
+
+if ! which unzip >/dev/null 2>&1; then
+ echo You must install unzip to continue.
+ echo
+ out=1
+fi
+
+if ! which patch >/dev/null 2>&1; then
+ echo You must install patch to continue.
+ echo
+ out=1
+fi
+
+cat >test.c <<-'EOF'
+ #include <stdio.h>
+ #include <zlib.h>
+
+ #ifndef STDIN_FILENO
+ #define STDIN_FILENO 0
+ #endif
+
+ int
+ main()
+ {
+ gzFile zstdin;
+ char buf[1024];
+ int i;
+
+ zstdin = gzdopen(STDIN_FILENO, "rb");
+ i = gzread(zstdin, buf, sizeof (buf));
+ if ((i > 0) && (i < sizeof (buf)))
+ buf[i] = '\0';
+ buf[sizeof (buf) - 1] = '\0';
+ printf("%s\n", buf);
+ return (0);
+ }
+EOF
+X=$(echo 'Yay! Native compiler works.' | gzip | \
+ $makecmd TOPDIR=$topdir LDADD=-lz 2>&1)
+if [[ $X != *@(Native compiler works)* ]]; then
+ echo "$X" | sed 's/^/| /'
+ echo Cannot compile a libz test programm.
+ echo You must install the zlib development package,
+ echo usually called libz-dev, and the run-time library.
+ echo
+ out=1
+fi
+
+[[ -s /usr/include/ncurses.h ]] || if [[ -s /usr/pkg/include/ncurses.h ]]; then
+ echo 'HOSTCFLAGS+= -isystem /usr/pkg/include' >>$topdir/prereq.mk
+ echo 'HOSTLDFLAGS+=-L/usr/pkg/lib -Wl,-rpath -Wl,/usr/pkg/lib' >>$topdir/prereq.mk
+else
+ echo Install ncurses header files, please.
+ echo
+ out=1
+fi
+
+if ! which gawk >/dev/null 2>&1; then
+ echo You must install GNU awk to continue.
+ echo
+ out=1
+fi
+
+if ! which sed >/dev/null 2>&1; then
+ echo You must install GNU sed to continue.
+ echo
+ out=1
+fi
+
+if ! sed --version 2>/dev/null|grep GNU >/dev/null;then
+ if ! which gsed >/dev/null 2>&1; then
+ echo You must install GNU sed to continue.
+ echo
+ out=1
+ fi
+fi
+
+if ! which wget >/dev/null 2>&1; then
+ echo You must install wget to continue.
+ echo
+ out=1
+fi
+
+if ! which autoconf >/dev/null 2>&1; then
+ echo You must install autoconf to continue.
+ echo
+ out=1
+fi
+
+if ! which automake >/dev/null 2>&1; then
+ echo You must install automake to continue.
+ echo
+ out=1
+fi
+
+if ! which libtool >/dev/null 2>&1; then
+ echo You must install libtool to continue.
+ echo
+ out=1
+fi
+
+if ! which file >/dev/null 2>&1; then
+ echo You must install \"file\" to continue.
+ echo
+ out=1
+fi
+
+cd $topdir
+rm -rf tmp
+
+exit $out
diff --git a/scripts/sed b/scripts/sed
new file mode 100755
index 000000000..2b8a81f17
--- /dev/null
+++ b/scripts/sed
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+if [ -z "$(which gsed 2>/dev/null)" ];then
+ /bin/sed "$@"
+else
+ gsed "$@"
+fi
diff --git a/scripts/split-cfg.sh b/scripts/split-cfg.sh
new file mode 100644
index 000000000..9b043424e
--- /dev/null
+++ b/scripts/split-cfg.sh
@@ -0,0 +1,89 @@
+# $Id: split-cfg.sh 280 2008-12-25 20:54:25Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+#-
+# Note: this is slow, but it's not the "progress stuff" which cau-
+# ses the slow-down.
+
+TOPDIR=$1
+
+[[ -n $BASH_VERSION ]] && shopt -s extglob
+
+grep -v '^BUSYBOX\|^# BUSYBOX' $TOPDIR/.config > $TOPDIR/.config.split
+
+mkdir -p $TOPDIR/.cfg
+cd $TOPDIR/.cfg
+
+oldfiles=$(echo *)
+newfiles=:
+
+echo -n 'autosplitting main config...'
+while read line; do
+ oline=$line
+ [[ -n $line ]] && if [[ $line = @(# [A-Z])* ]]; then
+ line=${line#? }
+ if [[ $line = *@( is not set) ]]; then
+ line=${line% is not set}
+ else
+ # some kind of comment
+ line=
+ fi
+ elif [[ $line = @([A-Z])*@(=)* ]]; then
+ line=${line%%=*}
+ elif [[ $line = @(#)* ]]; then
+ # valid comment
+ line=
+ else
+ # invalid non-comment
+ echo "Warning: line '$oline' invalid!" >&2
+ line=
+ fi
+ # if the line is a valid yes/no/whatever, write it
+ # unless the file already exists and has same content
+ if [[ -n $line ]]; then
+ if [[ $line != ADK_HAVE_DOT_CONFIG && -s $line ]]; then
+ fline=$(<$line)
+ else
+ fline=
+ fi
+ [[ $oline = $fline ]] || echo "$oline" >$line
+ if [[ $newfiles = *:$line:* ]]; then
+ echo "Error: duplicate Config.in option '$line'!" >&2
+ exit 1
+ fi
+ newfiles=$newfiles$line:
+ fi
+done <$TOPDIR/.config.split
+
+# now handle the case of removals
+echo -n ' removals...'
+for oldfile in $oldfiles; do
+ [[ $newfiles = *:$oldfile:* ]] || rm -f $oldfile
+done
+printf '\r%60s\r' ''
+
+# now scan for dependencies of packages; the information
+# should probably be in build_mipsel because it's generated
+# at build time, but OTOH, soon enough, parts of Makefile
+# and the entire Config.in will be auto-generated anyway,
+# so we're better off placing it here
+#XXX this is too slow @868 configure options
+cd $TOPDIR/.cfg
+rm -f $TOPDIR/package/*/info.mk
+for option in *; do
+ echo -n "$option ..."
+ x=$(( ${#option} + 4 ))
+ ao=:
+ fgrep -l $option $TOPDIR/package/*/{Makefile,Config.*} 2>&- | \
+ while read line; do
+ echo ${line%/*}/info.mk
+ done | while read fname; do
+ [[ $ao = *:$fname:* ]] && continue
+ ao=$ao$fname:
+ echo "\${_IPKGS_COOKIE}: \${TOPDIR}/.cfg/$option" >>$fname
+ done
+ printf '\r%'$x's\r' ''
+done
+
+exit 0
diff --git a/scripts/strip-script.sh b/scripts/strip-script.sh
new file mode 100644
index 000000000..3f9a54605
--- /dev/null
+++ b/scripts/strip-script.sh
@@ -0,0 +1,38 @@
+# $Id: strip-script.sh 30 2008-09-04 13:31:09Z wbx $
+#-
+# Copyright (c) 2007
+# Thorsten Glaser <tg@mirbsd.de>
+#
+# Provided that these terms and disclaimer and all copyright notices
+# are retained or reproduced in an accompanying document, permission
+# is granted to deal in this work without restriction, including un-
+# limited rights to use, publicly perform, distribute, sell, modify,
+# merge, give away, or sublicence.
+#
+# Advertising materials mentioning features or use of this work must
+# display the following acknowledgement:
+# This product includes material provided by Thorsten Glaser.
+# This acknowledgement does not need to be reprinted if this work is
+# linked into a bigger work whose licence does not allow such clause
+# and the author of this work is given due credit in the bigger work
+# or its accompanying documents, where such information is generally
+# kept, provided that said credits are retained.
+#
+# This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+# the utmost extent permitted by applicable law, neither express nor
+# implied; without malicious intent or gross negligence. In no event
+# may a licensor, author or contributor be held liable for indirect,
+# direct, other damage, loss, or other issues arising in any way out
+# of dealing in the work, even if advised of the possibility of such
+# damage or existence of a defect, except proven that it results out
+# of said person's immediate fault when using the work as intended.
+#-
+# Shell script to strip down a shell script (filter).
+
+shopt -s extglob
+cat "$@" | while read -r _line; do
+ set -o noglob
+ [[ $_line = \#* && $_line != @(#!)* ]] && continue
+ [[ -n $_line ]] && builtin printf '%s\n' "$_line"
+done
+exit 0
diff --git a/scripts/tar b/scripts/tar
new file mode 100755
index 000000000..625b11588
--- /dev/null
+++ b/scripts/tar
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+if [ -z "$(which gtar 2>/dev/null)" ];then
+ /bin/tar "$@"
+else
+ gtar "$@"
+fi
diff --git a/scripts/update-patches b/scripts/update-patches
new file mode 100644
index 000000000..4c695f0cc
--- /dev/null
+++ b/scripts/update-patches
@@ -0,0 +1,179 @@
+#!/usr/bin/env bash
+# $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+# $MirOS: ports/infrastructure/scripts/update-patches,v 1.5 2006/06/15 19:18:43 tg Exp $
+#-
+# Copyright (c) 2006
+# Thorsten Glaser <tg@freewrt.org>
+#
+# Derived from the MirPorts Framework "update-patches" script:
+#
+# Copyright (c) 2003, 2004, 2005
+# Thorsten "mirabile" Glaser <tg@MirBSD.de>
+# Based upon code and idea (c) 2000
+# Marc Espie for the OpenBSD project. All rights reserved.
+#
+# Provided that these terms and disclaimer and all copyright notices
+# are retained or reproduced in an accompanying document, permission
+# is granted to deal in this work without restriction, including un-
+# limited rights to use, publicly perform, distribute, sell, modify,
+# merge, give away, or sublicence.
+#
+# This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+# the utmost extent permitted by applicable law, neither express nor
+# implied; without malicious intent or gross negligence. In no event
+# may a licensor, author or contributor be held liable for indirect,
+# direct, other damage, loss, or other issues arising in any way out
+# of dealing in the work, even if advised of the possibility of such
+# damage or existence of a defect, except proven that it results out
+# of said person's immediate fault when using the work as intended.
+
+[[ -n $BASH_VERSION ]] && shopt -s extglob
+
+do_diff()
+{
+ local f1=$2/$1
+ local f2=$3/$1
+
+ if [[ ! -e $f1 ]]; then
+ [[ -d ${f1%/*}/. ]] || mkdir -p ${f1%/*}
+ if [[ ! -s $f2 ]]; then
+ cat <<EOF
+--- $f1 (non-existant)
++++ $f2 (empty)
+@@ -0,0 +0,0 @@
+EOF
+ return 0
+ fi
+ touch -t 197001010000.00 "$f1"
+ fi
+ diff -adup "$f1" "$f2"
+ return $?
+}
+
+TRANSFORM='sed s/[.+]/\\\\&/g'
+PATCHDIR=$CURDIR/patches
+EXTRADIR=$CURDIR/extra
+
+mkdir -p $PATCHDIR
+
+SUBDIST=${WRKDIST##${WRKDIR1}?(/)}
+if [[ -n $SUBDIST ]]; then
+ mv ${WRKDIR1}.orig/${SUBDIST} ${WRKDIR1}/${SUBDIST}.orig
+ D_BASE=${WRKDIR1}
+ D_SUB=${SUBDIST}
+# D_SUBP=$D_SUB
+ D_SUBP='[^/]*'
+ D_CMP=$D_SUBP
+else
+ # WRKSRC == WRKDIR
+ D_BASE=$(dirname ${WRKDIR1})
+ D_SUB=$(basename ${WRKDIR1})
+ D_SUBP=$D_SUB
+ D_CMP=
+fi
+ORGDIST=${D_BASE}/${D_SUB}.orig
+
+[[ -d $EXTRADIR ]] && \
+ (cd $EXTRADIR; find . -print0) | \
+ (cd $WRKDIST; pax -rw -0 -d $ORGDIST/) >/dev/null 2>&1
+
+if [[ -e $WRKDIST/.patched-newfiles ]]; then
+ touch $ORGDIST/.patched-newfiles
+ patch_newfiles=1
+else
+ patch_newfiles=0
+fi
+
+DIFF_FLAGS="-adu -I \"^--- $(echo $D_SUBP.orig/ | $TRANSFORM)@@ .*\""
+DIFF_FLAGS="$DIFF_FLAGS -I \"^\+\+\+ $(echo $D_SUBP/ | $TRANSFORM)@@ .*\""
+
+for file in $(cd ${WRKDIST}; find . -type f | sed 's#^\./##'); do
+ [[ ! -e $ORGDIST/$file && $patch_newfiles = 0 ]] && continue
+ cmp -s "$ORGDIST/$file" "$WRKDIST/$file" && continue
+ echo "Processing ${file}..." >&2
+ # look in patchdir for an existing patchfile matching this
+ cd $PATCHDIR
+ for i in $PATCH_LIST; do
+ # Ignore non-files, or old backup
+ [[ ! -f $i || $i = *@(.orig|.rej|~) ]] && continue
+
+ # Patch found. Is this the one?
+ if grep "^[+-][+-][+-] $D_CMP[^/]*/$file " "$i" >/dev/null; then
+ # Multiple files in the diff?
+ if [ $(grep -c "^--- $D_CMP" "$i") -gt 1 -o \
+ $(grep -c "^+++ $D_CMP" "$i") -gt 1 ]; then
+ echo "Cannot process, $i contains patches" >&2
+ echo "to multiple files! Aborting." >&2
+ echo FAIL
+ [[ -n $SUBDIST ]] && mv \
+ ${WRKDIR1}/${SUBDIST}.orig \
+ ${WRKDIR1}.orig/${SUBDIST}
+ exit 0
+ fi
+ # Multiple diffs with this file?
+ let n=0
+ pflst=
+ for j in $PATCH_LIST; do
+ [[ ! -f $j || $j = *@(.orig|.rej|~) ]] && \
+ continue
+ grep "^[+-][+-][+-] $D_CMP[^/]*/$file " \
+ "$j" >/dev/null || continue
+ let n++
+ pflst="$pflst '$j'"
+ done
+ if (( n != 1 )); then
+ echo "Cannot process, file $file" >&2
+ echo "is contained in multiple patches:" >&2
+ echo "$pflst" >&2
+ echo FAIL
+ [[ -n $SUBDIST ]] && mv \
+ ${WRKDIR1}/${SUBDIST}.orig \
+ ${WRKDIR1}.orig/${SUBDIST}
+ exit 0
+ fi
+ # No, process this patch
+
+ accounted="$accounted $i"
+ # found it, copy preamble before comparision
+ ( sed -e "/^--- /,\$d" <$i; \
+ cd $D_BASE && do_diff "$file" "$D_SUB.orig" "$D_SUB" \
+ ) >"$i.new"
+ # did it change ? mark it as changed
+ tfile="$(echo "$file" | $TRANSFORM)"
+ if eval diff "$(echo "${DIFF_FLAGS}" \
+ | sed "s#@@#${tfile}#g")" \
+ "$i" "$i.new" 1>&2; then
+ rm "$i.new"
+ else
+ echo "Patch $i for $file updated" >&2
+ mv "$i" "$i.orig"
+ mv "$i.new" "$i"
+ edit="$edit $i"
+ fi
+ continue 2
+ fi
+ done
+
+ # Build a sensible name for the new patch file
+ patchname=patch-$(echo "$file" | sed -e 's#[/. ]#_#g')
+ echo "No patch-* found for $file, creating $patchname" >&2
+ ( echo '$Id: update-patches 24 2008-08-31 14:56:13Z wbx $'; \
+ cd $D_BASE && do_diff "$file" "$D_SUB.orig" "$D_SUB" \
+ ) >$patchname
+ edit="$edit $patchname"
+ accounted="$accounted $patchname"
+done
+
+# Verify all patches accounted for
+cd $PATCHDIR
+for i in *; do
+ [[ ! -f $i || $i = *@(.orig|.rej|~) ]] && continue
+ grep '^\\ No newline at end of file' $i >/dev/null \
+ && echo "*** Patch $i needs manual intervention" >&2
+ [[ $accounted != *@($i)* ]] \
+ && echo "*** Patch $i not accounted for" >&2
+done
+
+echo $edit
+[[ -n $SUBDIST ]] && mv ${WRKDIR1}/${SUBDIST}.orig ${WRKDIR1}.orig/${SUBDIST}
+exit 0
diff --git a/target/Config.in b/target/Config.in
new file mode 100644
index 000000000..94c7d96e2
--- /dev/null
+++ b/target/Config.in
@@ -0,0 +1,325 @@
+# $Id: Config.in 446 2009-05-16 23:47:24Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+config ADK_DEVICE_NO_FPU
+ bool
+
+config ADK_alix1c
+ tristate
+
+config ADK_qemu_x86
+ tristate
+
+config ADK_qemu_mips
+ tristate
+
+config ADK_qemu_cris
+ tristate
+
+config ADK_rb532
+ tristate
+
+config ADK_rb411
+ tristate
+
+config ADK_rb433
+ tristate
+
+config ADK_zaurus
+ tristate
+
+config ADK_foxboard
+ tristate
+
+config ADK_ibm_x40
+ tristate
+
+config ADK_rescue_x86
+ tristate
+
+config ADK_rescue_x86_64
+ tristate
+
+config ADK_rescue_mips
+ tristate
+
+config ADK_rescue_mipsel
+ tristate
+
+config ADK_DEVICE
+ string
+ default "alix1c" if ADK_alix1c
+ default "qemu-x86" if ADK_qemu_x86
+ default "qemu-mips" if ADK_qemu_mips
+ default "qemu-cris" if ADK_qemu_cris
+ default "foxboard" if ADK_foxboard
+ default "rb532" if ADK_rb532
+ default "rb411" if ADK_rb411
+ default "rb433" if ADK_rb433
+ default "zaurus" if ADK_arm
+ default "ibm-x40" if ADK_ibm_x40
+ default "rescue-x86" if ADK_rescue_x86
+ default "rescue-x86_64" if ADK_rescue_x86_64
+ default "rescue-mips" if ADK_rescue_mips
+ default "rescue-mipsel" if ADK_rescue_mipsel
+
+menu "Target system"
+
+choice
+prompt "Embedded Device"
+ default ADK_LINUX_X86_ALIX1C
+
+config ADK_LINUX_X86_ALIX1C
+ bool "PC Engines Alix1C"
+ select ADK_alix1c
+ select ADK_KERNEL_SCSI
+ select ADK_KERNEL_EXT2_FS
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_NET_ETHERNET
+ select ADK_KERNEL_MII
+ select BUSYBOX_HWCLOCK
+ help
+ http://www.pcengines.ch/
+
+config ADK_LINUX_CRIS_FOXBOARD
+ bool "Foxboard (ETRAX LX100)"
+ select ADK_foxboard
+ select ADK_PACKAGE_KMOD_USB_CONTROLLER
+ help
+ Foxboard support
+
+config ADK_LINUX_MIPS_RB411
+ bool "Mikrotik Routerboard 411"
+ select ADK_rb411
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_NETDEV_1000
+ select ADK_KERNEL_NET_ETHERNET
+ help
+ Support for Mikrotik RB411.
+
+config ADK_LINUX_MIPS_RB433
+ bool "Mikrotik Routerboard 433"
+ select ADK_rb433
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_NETDEV_1000
+ select ADK_KERNEL_NET_ETHERNET
+ help
+ Support for Mikrotik RB433.
+
+config ADK_LINUX_MIPS_RB532
+ bool "Mikrotik Routerboard 532"
+ select ADK_rb532
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_NET_ETHERNET
+ select ADK_KERNEL_MII
+ help
+ Support for Mikrotik RB532.
+
+config ADK_LINUX_XSCALE_ZAURUS
+ bool "Zaurus SL-C3200"
+ select ADK_zaurus
+ select ADK_DEVICE_NO_FPU
+ help
+ Support for Sharp Zaurus SL-C3200 (aka Terrier)
+
+config ADK_LINUX_X86_IBM_X40
+ bool "IBM X40 Rescuesystem for encrypted Root/Swap"
+ select ADK_ibm_x40
+ help
+ IBM X40 Rescuesystem
+
+config ADK_LINUX_RESCUE
+ bool "Minimal Linux Rescuesystem"
+ help
+ Rescuesystem with can be used to Boot from Disk or USB stick.
+
+config ADK_LINUX_QEMU
+ bool "Qemu Emulator"
+ help
+ Support for Qemu Emulator
+
+endchoice
+
+choice
+prompt "Architecture"
+depends on ADK_LINUX_RESCUE
+
+config ADK_LINUX_X86_64_RESCUE
+ bool "x86_64"
+ select ADK_rescue_x86_64
+ help
+ X86 architecture.
+
+config ADK_LINUX_X86_RESCUE
+ bool "x86"
+ select ADK_rescue_x86
+ help
+ X86 architecture.
+
+config ADK_LINUX_MIPSEL_RESCUE
+ bool "mips (little endian)"
+ select ADK_rescue_mipsel
+ help
+ MIPS LE architecture.
+
+config ADK_LINUX_MIPS_RESCUE
+ bool "mips (big endian)"
+ select ADK_rescue_mips
+ help
+ MIPS BE architecture.
+
+endchoice
+
+choice
+prompt "Architecture"
+depends on ADK_LINUX_QEMU
+
+config ADK_LINUX_X86_QEMU
+ bool "x86"
+ select ADK_qemu_x86
+ select ADK_KPACKAGE_KMOD_NE2K_PCI
+ help
+ Qemu support for x86 architecture.
+
+config ADK_LINUX_MIPS_QEMU
+ bool "mips (little endian)"
+ select ADK_qemu_mips
+ help
+ Qemu support for MIPS LE architecture.
+
+config ADK_LINUX_CRIS_QEMU
+ bool "cris"
+ select ADK_qemu_cris
+ help
+ Qemu support for CRISv32 architecture.
+
+endchoice
+
+choice
+prompt "Device model"
+default ADK_LINUX_CRIS_FOXBOARD_CLASSIC
+depends on ADK_LINUX_CRIS_FOXBOARD
+
+config ADK_LINUX_CRIS_FOXBOARD_CLASSIC
+ bool "Foxboard classic (4x16)"
+ help
+ Foxboard classic with red board.
+ (4 MB flash size and 16 MB RAM)
+
+config ADK_LINUX_CRIS_FOXBOARD_LX
+ bool "Foxboard LX (8x32)"
+ help
+ Latest Foxboard with green board.
+ (8 MB flash size and 32 MB RAM)
+
+endchoice
+
+source "target/linux/config/Config.in.kernel"
+
+choice
+prompt "Target C library"
+config ADK_TARGET_LIB_UCLIBC
+ bool "uClibc embedded C library"
+ help
+ http://uclibc.org
+
+config ADK_TARGET_LIB_GLIBC
+ bool "GNU C library"
+ depends on ADK_LINUX_X86_IBM_X40 || ADK_LINUX_X86_QEMU || \
+ ADK_LINUX_X86_ALIX1C || ADK_LINUX_MIPS_RB411 || \
+ ADK_LINUX_MIPS_RB532 || ADK_LINUX_RESCUE
+ help
+ http://www.gnu.org/libc
+endchoice
+
+choice
+prompt "Target Firmware type"
+ default ADK_TARGET_ROOTFS_EXT2_CF
+
+config ADK_TARGET_ROOTFS_INITRAMFS
+ bool "initramfs filesystem"
+ depends on ADK_LINUX_X86_IBM_X40 || ADK_LINUX_X86_QEMU || \
+ ADK_LINUX_CRIS_QEMU || ADK_LINUX_MIPS_QEMU || \
+ ADK_LINUX_RESCUE
+ help
+ initramfs help...
+
+config ADK_TARGET_ROOTFS_SQUASHFS
+ bool "squashfs read-only root filesystem"
+ depends on ADK_LINUX_CRIS_FOXBOARD
+ help
+ highly compressed read-only filesystem for flash.
+
+config ADK_TARGET_ROOTFS_YAFFS
+ bool "YAFFS2 rootfilesystem (NAND)"
+ depends on ADK_LINUX_MIPS_RB532 || ADK_LINUX_MIPS_RB433 \
+ || ADK_LINUX_MIPS_RB411
+ help
+ Root filesystem on NAND.
+
+config ADK_TARGET_ROOTFS_NFSROOT
+ bool "NFS root"
+ depends on ADK_LINUX_CRIS_FOXBOARD || ADK_LINUX_X86_ALIX1C || \
+ ADK_LINUX_MIPS_RB532 || ADK_LINUX_MIPS_RB433 || \
+ ADK_LINUX_MIPS_RB411
+ select ADK_KERNEL_NFS_FS
+ select ADK_KERNEL_NFS_V3
+ select ADK_KERNEL_ROOT_NFS
+ select ADK_KERNEL_NFS_COMMON
+ select ADK_KERNEL_IP_PNP
+ select ADK_KERNEL_IP_PNP_DHCP
+ help
+ Root filesystem mounted via NFS. (DHCP)
+
+config ADK_TARGET_ROOTFS_EXT2_CF
+ bool "read-write filesystem for compact flash (ext2)"
+ depends on ADK_LINUX_X86_ALIX1C || ADK_LINUX_MIPS_RB532
+ select ADK_KERNEL_EXT2_FS
+ help
+ Use this option if you have a compact flash
+ inside your hardware and want to boot from it.
+
+config ADK_TARGET_ROOTFS_EXT2
+ bool "read-write filesystem for qemu emulator"
+ depends on ADK_LINUX_X86_QEMU || ADK_LINUX_CRIS_QEMU || ADK_LINUX_MIPS_QEMU \
+ || ADK_LINUX_XSCALE_ZAURUS
+ select ADK_KERNEL_EXT2_FS
+ help
+ Use this option if you compile for qemu.
+
+endchoice
+
+config ADK_SSP
+ bool "Enable Stack Smashing Protection"
+ default n
+ depends on ADK_LINUX_X86_ALIX1C || \
+ ADK_LINUX_CRIS_FOXBOARD
+ help
+ Enable Stack Smashing Protection
+
+config ADK_CXX
+ bool "Enable C++ support"
+ default n
+ help
+ Enable C++ Compiler and Libraries
+
+config ADK_IPV6
+ bool "Enable IPv6 support"
+ default n
+ select ADK_KPACKAGE_KMOD_IPV6
+ select BUSYBOX_FEATURE_IPV6
+ select BUSYBOX_FEATURE_IFUPDOWN_IPV6
+ select BUSYBOX_PING6
+ help
+ Enable basic IPv6 support (kmod-ipv6) and
+ make the IPv6 support options in packages visible.
+
+config ADK_XORG
+ bool "Enable X.org/X11 support"
+ default n
+ help
+ Enable Xorg/X11 server and applications
+
+endmenu
diff --git a/target/Makefile b/target/Makefile
new file mode 100644
index 000000000..f68ac4a89
--- /dev/null
+++ b/target/Makefile
@@ -0,0 +1,88 @@
+# $Id: Makefile 400 2009-05-01 20:13:27Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/rootfs.mk
+
+all: install
+
+### Kernel .config Creation
+# The following target combines all kernel-related variables and
+# config files into a single one to be used as the final kernel
+# configuration when building. This is how it's done:
+# 1) fetch all ADK_KPACKAGE_KMOD_* vars into
+# .kernelconfig.modules and set them to "m"
+# 2) fetch all enabled ADK_KERNEL_* vars into
+# .kernelconfig.kernel (no conversion, as they are booleans)
+# 3) repeat 2) for the disabled ones and save them into
+# .kernelconfig.nokernel (to overwrite defaults)
+# 4) get the device-specific static kernel config and place it into
+# .kernelconfig.board
+# 5) prepare for merging:
+# * if a variable is disabled in .kernelconfig.board and
+# enabled in either of .kernelconfig.{modules,kernel},
+# remove it from .kernelconfig.board
+# * append ${FS_CMDLINE} to the kernel commandline inside
+# .kernelconfig.board
+# 6) merge (cat) it all together into .kernelconfig.tmp
+# 7) check if .kernelconfig.tmp differs from the current one
+# (.kernelconfig) at all, overwriting the current one
+# only if it does (so the timestamp stays intact)
+# 8) remove the temporary .kernelconfig.tmp
+###
+config-prepare: $(TOPDIR)/.config
+ sed -n '/^ADK_KPACKAGE_KMOD/s//CONFIG/p' ${TOPDIR}/.config | \
+ sed 's/=y/=m/' >${BUILD_DIR}/.kernelconfig.modules
+ sed -n '/^ADK_KERNEL/s//CONFIG/p' ${TOPDIR}/.config \
+ >${BUILD_DIR}/.kernelconfig.kernel
+ sed -n '/^ADK_MOD_KERNEL/s//CONFIG/p' ${TOPDIR}/.config | \
+ sed 's/=y/=m/' >${BUILD_DIR}/.kernelconfig.modkernel
+ sed -n '/^# ADK_KERNEL/s//# CONFIG/p' ${TOPDIR}/.config \
+ >${BUILD_DIR}/.kernelconfig.nokernel
+ cp ${DEVICE}/kernel.config ${BUILD_DIR}/.kernelconfig.board
+ (cat ${BUILD_DIR}/.kernelconfig.{modules,kernel} | \
+ while IFS='=' read symbol value; do \
+ sed -i -e "/^# $$symbol/d" ${BUILD_DIR}/.kernelconfig.board; \
+ done;)
+ sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 ${FS_CMDLINE}"#' \
+ ${BUILD_DIR}/.kernelconfig.board
+ifeq ($(ADK_KERNEL_DEBUG_WITH_KGDB),y)
+ sed -i -e 's#^\(CONFIG_.*CMDLINE="\)\(.*\)"#\1\2 kgdbwait kgdboc=ttyS0,115200"#' \
+ ${BUILD_DIR}/.kernelconfig.board
+endif
+ cd ${BUILD_DIR} && cat .kernelconfig.board .kernelconfig.nokernel \
+ .kernelconfig.kernel .kernelconfig.modkernel .kernelconfig.modules \
+ >.kernelconfig.tmp
+ cd ${BUILD_DIR} && cmp -s .kernelconfig.tmp .kernelconfig || \
+ cp .kernelconfig.tmp .kernelconfig
+ -rm -f ${BUILD_DIR}/.kernelconfig.tmp
+
+prepare: $(DEVICE)-prepare
+compile: $(DEVICE)-compile
+image: $(DEVICE)-imageclean $(DEVICE)-imageinstall
+install: $(DEVICE)-imageclean $(DEVICE)-install $(DEVICE)-imageinstall
+clean: $(DEVICE)-clean $(DEVICE)-imageclean
+
+%-clean:
+ $(TRACE) target/$(patsubst %-clean,%,$@)-clean
+ $(MAKE) -C $(patsubst %-clean,%,$@) clean
+%-imageclean:
+ $(TRACE) target/$(patsubst %-imageclean,%,$@)-imageclean
+ $(MAKE) -C $(patsubst %-imageclean,%,$@) imageclean
+%-prepare:
+ $(TRACE) target/$(patsubst %-prepare,%,$@)-prepare
+ $(MAKE) -C $(patsubst %-prepare,%,$@) prepare
+%-imageprepare:
+ $(TRACE) target/$(patsubst %-imageprepare,%,$@)-imageprepare
+ $(MAKE) -C $(patsubst %-imageprepare,%,$@) imageprepare
+%-compile: %-prepare
+ $(TRACE) target/$(patsubst %-compile,%,$@)-compile
+ $(MAKE) -C $(patsubst %-compile,%,$@) compile
+%-install: %-compile
+ $(TRACE) target/$(patsubst %-install,%,$@)-install
+ $(MAKE) -C $(patsubst %-install,%,$@) install
+%-imageinstall: %-imageprepare
+ $(TRACE) target/$(patsubst %-imageinstall,%,$@)-imageinstall
+ $(MAKE) -C $(patsubst %-imageinstall,%,$@) imageinstall
diff --git a/target/alix1c/Makefile b/target/alix1c/Makefile
new file mode 100644
index 000000000..f3944ceb7
--- /dev/null
+++ b/target/alix1c/Makefile
@@ -0,0 +1,26 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+ cp $(LINUX_DIR)/arch/x86/boot/bzImage $(TARGET_DIR)/boot/kernel
+
+ifeq ($(FS),ext2-cf)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo
+ @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
+ @echo "To install everything to CompactFlash use scripts/install.sh."
+endif
+ifeq ($(FS),nfsroot)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo
+ @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
+ @echo "To install everything to CompactFlash use scripts/install.sh."
+endif
diff --git a/target/alix1c/device.mk b/target/alix1c/device.mk
new file mode 100644
index 000000000..9993470ea
--- /dev/null
+++ b/target/alix1c/device.mk
@@ -0,0 +1,7 @@
+ARCH:= x86
+CPU_ARCH:= i586
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=geode
diff --git a/target/alix1c/files/etc/fstab b/target/alix1c/files/etc/fstab
new file mode 100644
index 000000000..7aed67706
--- /dev/null
+++ b/target/alix1c/files/etc/fstab
@@ -0,0 +1,2 @@
+# <fs> <mountpoint> <type> <opts> <dump/pass>
+/dev/root / ext2 noatime 0 0
diff --git a/target/alix1c/files/etc/inittab b/target/alix1c/files/etc/inittab
new file mode 100644
index 000000000..6f21e703b
--- /dev/null
+++ b/target/alix1c/files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS
+::shutdown:/etc/init.d/rcK
+ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100
+tty1::respawn:/sbin/getty -i -L tty1 115200 vt100
diff --git a/target/alix1c/files/etc/mdev.conf b/target/alix1c/files/etc/mdev.conf
new file mode 100644
index 000000000..74864bf2f
--- /dev/null
+++ b/target/alix1c/files/etc/mdev.conf
@@ -0,0 +1,17 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+device-mapper 0:0 660 @mkdir /dev/mapper
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+audio root:audio 660 >snd/audio
+dsp root:audio 660 >snd/dsp
+timer root:audio 660 >snd/timer
+controlC0 root:audio 660 >snd/controlC0
+pcmC0D0c root:audio 660 >snd/pcmC0D0c
+pcmC0D0p root:audio 660 >snd/pcmC0D0p
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/alix1c/kernel.config b/target/alix1c/kernel.config
new file mode 100644
index 000000000..b63705181
--- /dev/null
+++ b/target/alix1c/kernel.config
@@ -0,0 +1,1119 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28
+# Fri Feb 20 15:03:25 2009
+#
+# CONFIG_64BIT is not set
+CONFIG_X86_32=y
+# CONFIG_X86_64 is not set
+CONFIG_X86=y
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_FAST_CMPXCHG_LOCAL=y
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+# CONFIG_GENERIC_TIME_VSYSCALL is not set
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_ZONE_DMA32 is not set
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+# CONFIG_AUDIT_ARCH is not set
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_KTIME_SCALAR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_PCSPKR_PLATFORM is not set
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+# CONFIG_AIO is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_PCI_QUIRKS is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
+
+#
+# Processor type and features
+#
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_SMP is not set
+CONFIG_X86_PC=y
+# CONFIG_X86_ELAN is not set
+# CONFIG_X86_VOYAGER is not set
+# CONFIG_X86_GENERICARCH is not set
+# CONFIG_X86_VSMP is not set
+# CONFIG_X86_RDC321X is not set
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_PARAVIRT_GUEST is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MGEODEGX1 is not set
+CONFIG_MGEODE_LX=y
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_GENERIC_CPU is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CPU=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_X86_XADD=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_USE_3DNOW=y
+CONFIG_X86_TSC=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=4
+CONFIG_X86_DEBUGCTLMSR=y
+CONFIG_PROCESSOR_SELECT=y
+# CONFIG_CPU_SUP_INTEL is not set
+# CONFIG_CPU_SUP_CYRIX_32 is not set
+CONFIG_CPU_SUP_AMD=y
+# CONFIG_CPU_SUP_CENTAUR_32 is not set
+# CONFIG_CPU_SUP_TRANSMETA_32 is not set
+# CONFIG_CPU_SUP_UMC_32 is not set
+# CONFIG_X86_DS is not set
+# CONFIG_HPET_TIMER is not set
+# CONFIG_DMI is not set
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_X86_UP_APIC is not set
+# CONFIG_X86_MCE is not set
+# CONFIG_VM86 is not set
+# CONFIG_TOSHIBA is not set
+# CONFIG_I8K is not set
+# CONFIG_X86_REBOOTFIXUPS is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+CONFIG_NOHIGHMEM=y
+# CONFIG_HIGHMEM4G is not set
+# CONFIG_HIGHMEM64G is not set
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_2G_OPT is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_X86_PAE is not set
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_STATIC=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_UNEVICTABLE_LRU is not set
+CONFIG_X86_CHECK_BIOS_CORRUPTION=y
+# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set
+CONFIG_X86_RESERVE_LOW_64K=y
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_MTRR is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_KEXEC is not set
+CONFIG_PHYSICAL_START=0x100000
+# CONFIG_RELOCATABLE is not set
+CONFIG_PHYSICAL_ALIGN=0x100000
+# CONFIG_COMPAT_VDSO is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+# CONFIG_CMDLINE_OVERRIDE is not set
+
+#
+# Power management and ACPI options
+#
+# CONFIG_PM is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+# CONFIG_PCI_GODIRECT is not set
+# CONFIG_PCI_GOOLPC is not set
+CONFIG_PCI_GOANY=y
+CONFIG_PCI_BIOS=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_LEGACY is not set
+CONFIG_ISA_DMA_API=y
+# CONFIG_ISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+# CONFIG_GEODE_MFGPT_TIMER is not set
+# CONFIG_OLPC is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_HAVE_ATOMIC_IOMAP=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_PMP is not set
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+CONFIG_PATA_AMD=y
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CS5535 is not set
+# CONFIG_PATA_CS5536 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_EEPRO100 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+CONFIG_VIA_RHINE=y
+CONFIG_VIA_RHINE_MMIO=y
+# CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_CONSOLE_TRANSLATIONS is not set
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+# CONFIG_SERIAL_8250_PCI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+# CONFIG_MWAVE is not set
+# CONFIG_PC8736x_GPIO is not set
+# CONFIG_NSC_GPIO is not set
+# CONFIG_CS5535_GPIO is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+
+#
+# PCI GPIO expanders:
+#
+# CONFIG_GPIO_BT8XX is not set
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ARC is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_VESA is not set
+# CONFIG_FB_N411 is not set
+# CONFIG_FB_HGA is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_I810 is not set
+# CONFIG_FB_LE80578 is not set
+# CONFIG_FB_INTEL is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_VIA is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_CYBLA is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_GEODE=y
+CONFIG_FB_GEODE_LX=y
+# CONFIG_FB_GEODE_GX is not set
+# CONFIG_FB_GEODE_GX1 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_COMPAT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_DELL_RBU is not set
+# CONFIG_DCDBAS is not set
+# CONFIG_ISCSI_IBFT_FIND is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=0
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+
+#
+# Tracers
+#
+# CONFIG_SYSPROF_TRACER is not set
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_STRICT_DEVMEM is not set
+# CONFIG_X86_VERBOSE_BOOTUP is not set
+# CONFIG_EARLY_PRINTK is not set
+# CONFIG_4KSTACKS is not set
+# CONFIG_DOUBLEFAULT is not set
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+# CONFIG_OPTIMIZE_INLINING is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+CONFIG_HAVE_KVM=y
+# CONFIG_VIRTUALIZATION is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/alix1c/uclibc.config b/target/alix1c/uclibc.config
new file mode 100644
index 000000000..ea622b4dd
--- /dev/null
+++ b/target/alix1c/uclibc.config
@@ -0,0 +1,241 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Mon Dec 1 19:41:35 2008
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+TARGET_i386=y
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="i386"
+FORCE_OPTIONS_FOR_ARCH=y
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+CONFIG_586=y
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/foxboard/Makefile b/target/foxboard/Makefile
new file mode 100644
index 000000000..1db02a2c9
--- /dev/null
+++ b/target/foxboard/Makefile
@@ -0,0 +1,38 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+$(TOOLS_BUILD_DIR):
+ mkdir -p $(TOOLS_BUILD_DIR)
+
+tools-compile: $(TOOLS_BUILD_DIR)
+ $(MAKE) -C tools/mkfimage
+ $(MAKE) -C tools/e100boot prepare compile install $(MAKE_TRACE)
+ $(MAKE) -C tools/squashfs prepare compile install
+ $(INSTALL_BIN) tools/boot_linux $(BIN_DIR)/
+
+kernel-install: tools-compile
+ PATH='${TARGET_PATH}' \
+ mkfimage $(LINUX_DIR)/arch/cris/arch-v10/boot/zImage \
+ $(BIN_DIR)/${DEVICE}-${ARCH}-kernel $(MAKE_TRACE)
+
+ifeq ($(FS),squashfs)
+imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS)
+ @echo
+ @echo Use sudo ./boot_linux -F -i $(ROOTFSSQUASHFS) to flash
+ @echo Do not forget to set network boot jumper, before you start the foxboard
+endif
+ifeq ($(FS),nfsroot)
+imageinstall: ${BIN_DIR}/${ROOTFSTARBALL}
+ @echo
+ @echo Use sudo ./boot_linux -F -i ${DEVICE}-${ARCH}-kernel to flash the kernel
+ @echo Do not forget to set network boot jumper, before you start the foxboard
+ @echo ${ROOTFSTARBALL} is your nfs root and can be extracted on your nfs server
+endif
diff --git a/target/foxboard/device.mk b/target/foxboard/device.mk
new file mode 100644
index 000000000..0c7504fbd
--- /dev/null
+++ b/target/foxboard/device.mk
@@ -0,0 +1,7 @@
+ARCH:= cris
+CPU_ARCH:= cris
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe -fno-peephole2
+TARGET_CFLAGS_ARCH:= -march=v10
diff --git a/target/foxboard/files/etc/mdev.conf b/target/foxboard/files/etc/mdev.conf
new file mode 100644
index 000000000..178ba51e8
--- /dev/null
+++ b/target/foxboard/files/etc/mdev.conf
@@ -0,0 +1,10 @@
+null 0:0 777
+zero 0:0 666
+console 0:0 0600
+u?random 0:0 644
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+device-mapper 0:0 660 @mkdir /dev/mapper
+tun 0:0 660 >net/tun
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/foxboard/kernel.config b/target/foxboard/kernel.config
new file mode 100644
index 000000000..3cd568a60
--- /dev/null
+++ b/target/foxboard/kernel.config
@@ -0,0 +1,815 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28
+# Tue Dec 30 19:37:01 2008
+#
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_IOMAP=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NO_IOPORT=y
+CONFIG_FORCE_MAX_ZONEORDER=6
+CONFIG_CRIS=y
+CONFIG_HZ=100
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+# CONFIG_AIO is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
+
+#
+# General setup
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_ETRAX_CMDLINE="init=/init console=ttyS0,115200"
+# CONFIG_ETRAX_WATCHDOG is not set
+CONFIG_ETRAX_FAST_TIMER=y
+# CONFIG_ETRAX_KMALLOCED_MODULES is not set
+# CONFIG_OOM_REBOOT is not set
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+
+#
+# Hardware setup
+#
+# CONFIG_ETRAX100LX is not set
+CONFIG_ETRAX100LX_V2=y
+# CONFIG_SVINTO_SIM is not set
+# CONFIG_ETRAXFS is not set
+# CONFIG_CRIS_MACH_ARTPEC3 is not set
+# CONFIG_ETRAX_VCS_SIM is not set
+CONFIG_ETRAX_ARCH_V10=y
+# CONFIG_ETRAX_ARCH_V32 is not set
+CONFIG_ETRAX_DRAM_SIZE=16
+CONFIG_ETRAX_FLASH_BUSWIDTH=2
+CONFIG_ETRAX_NANDFLASH_BUSWIDTH=1
+CONFIG_ETRAX_FLASH1_SIZE=0
+# CONFIG_ETRAX_DEBUG_PORT0 is not set
+# CONFIG_ETRAX_DEBUG_PORT1 is not set
+# CONFIG_ETRAX_DEBUG_PORT2 is not set
+# CONFIG_ETRAX_DEBUG_PORT3 is not set
+CONFIG_ETRAX_DEBUG_PORT_NULL=y
+
+#
+# CRIS v10 options
+#
+CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000
+CONFIG_ETRAX_PA_LEDS=y
+# CONFIG_ETRAX_PB_LEDS is not set
+# CONFIG_ETRAX_CSP0_LEDS is not set
+# CONFIG_ETRAX_NO_LEDS is not set
+CONFIG_ETRAX_LED1G=2
+CONFIG_ETRAX_LED1R=2
+CONFIG_ETRAX_LED2G=3
+CONFIG_ETRAX_LED2R=3
+CONFIG_ETRAX_LED3G=2
+CONFIG_ETRAX_LED3R=2
+CONFIG_ETRAX_RESCUE_SER0=y
+# CONFIG_ETRAX_RESCUE_SER1 is not set
+# CONFIG_ETRAX_RESCUE_SER2 is not set
+# CONFIG_ETRAX_RESCUE_SER3 is not set
+CONFIG_ETRAX_DEF_R_WAITSTATES=0x95f8
+CONFIG_ETRAX_DEF_R_BUS_CONFIG=0x4
+CONFIG_ETRAX_SDRAM=y
+CONFIG_ETRAX_DEF_R_SDRAM_CONFIG=0x09603737
+CONFIG_ETRAX_DEF_R_SDRAM_TIMING=0x80608002
+CONFIG_ETRAX_DEF_R_PORT_PA_DIR=0x1c
+CONFIG_ETRAX_DEF_R_PORT_PA_DATA=0xf0
+CONFIG_ETRAX_DEF_R_PORT_PB_CONFIG=0x00
+CONFIG_ETRAX_DEF_R_PORT_PB_DIR=0xce
+CONFIG_ETRAX_DEF_R_PORT_PB_DATA=0x03
+# CONFIG_ETRAX_SOFT_SHUTDOWN is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_ASK_IP_FIB_HASH is not set
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+# CONFIG_DEFAULT_BIC is not set
+# CONFIG_DEFAULT_CUBIC is not set
+# CONFIG_DEFAULT_HTCP is not set
+# CONFIG_DEFAULT_VEGAS is not set
+# CONFIG_DEFAULT_WESTWOOD is not set
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Drivers for built-in interfaces
+#
+CONFIG_ETRAX_ETHERNET=y
+CONFIG_ETRAX_SERIAL=y
+# CONFIG_ETRAX_SERIAL_FAST_TIMER is not set
+# CONFIG_ETRAX_SERIAL_FLUSH_DMA_FAST is not set
+CONFIG_ETRAX_SERIAL_RX_TIMEOUT_TICKS=1
+CONFIG_ETRAX_SERIAL_PORT0=y
+CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_NONE=y
+# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PA is not set
+# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB is not set
+# CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_MIXED is not set
+CONFIG_ETRAX_SER0_DTR_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_RI_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_DSR_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_CD_ON_PA_BIT=-1
+CONFIG_ETRAX_SER0_DTR_ON_PB_BIT=-1
+CONFIG_ETRAX_SER0_RI_ON_PB_BIT=-1
+CONFIG_ETRAX_SER0_DSR_ON_PB_BIT=-1
+CONFIG_ETRAX_SER0_CD_ON_PB_BIT=-1
+# CONFIG_ETRAX_SERIAL_PORT1 is not set
+# CONFIG_ETRAX_SERIAL_PORT2 is not set
+# CONFIG_ETRAX_SERIAL_PORT3 is not set
+# CONFIG_ETRAX_RS485 is not set
+CONFIG_ETRAX_USB_HOST=y
+CONFIG_ETRAX_USB_HOST_PORT1=y
+CONFIG_ETRAX_USB_HOST_PORT2=y
+CONFIG_ETRAX_PTABLE_SECTOR=0
+CONFIG_ETRAX_I2C=y
+CONFIG_ETRAX_I2C_USES_PB_NOT_PB_I2C=y
+CONFIG_ETRAX_I2C_DATA_PORT=0
+CONFIG_ETRAX_I2C_CLK_PORT=1
+# CONFIG_ETRAX_I2C_EEPROM is not set
+CONFIG_ETRAX_GPIO=y
+CONFIG_ETRAX_PA_BUTTON_BITMASK=02
+CONFIG_ETRAX_PA_CHANGEABLE_DIR=0xFF
+CONFIG_ETRAX_PA_CHANGEABLE_BITS=0xFF
+CONFIG_ETRAX_PB_CHANGEABLE_DIR=0xFF
+CONFIG_ETRAX_PB_CHANGEABLE_BITS=0xFF
+# CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set
+CONFIG_ETRAX_AXISFLASHMAP=y
+# CONFIG_ETRAX_RTC is not set
+# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
+CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
+CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT=y
+# CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT is not set
+# CONFIG_ETRAX_SERIAL_PORT0_DMA0_OUT is not set
+CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN=y
+# CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN is not set
+# CONFIG_ETRAX_SERIAL_PORT0_DMA1_IN is not set
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_ROOTFS_ROOT_DEV=y
+CONFIG_MTD_ROOTFS_SPLIT=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+# CONFIG_MTD_BLOCK is not set
+CONFIG_MTD_BLOCK_RO=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_GEOMETRY is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+CONFIG_MTD_RAM=y
+CONFIG_MTD_ROM=y
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_I2C is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_DEVKMEM is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_SQUASHFS=y
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+CONFIG_USB_SUPPORT=y
+# CONFIG_USB_ARCH_HAS_HCD is not set
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+
+#
+# see USB_STORAGE Help for more information
+#
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_SYSTEM_PROFILER is not set
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_MANAGER2 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_DMA=y
diff --git a/target/foxboard/patches/cris.patch b/target/foxboard/patches/cris.patch
new file mode 100644
index 000000000..e0522d674
--- /dev/null
+++ b/target/foxboard/patches/cris.patch
@@ -0,0 +1,5751 @@
+diff -Nur linux-2.6.29.1.orig/arch/cris/Kconfig linux-2.6.29.1/arch/cris/Kconfig
+--- linux-2.6.29.1.orig/arch/cris/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/Kconfig 2009-05-09 01:52:49.814118199 +0200
+@@ -168,6 +168,12 @@
+ help
+ Size of DRAM (decimal in MB) typically 2, 8 or 16.
+
++config ETRAX_MTD_SIZE
++ hex "MTD size (hex)"
++ default "0x00800000"
++ help
++ Size of MTD device typically 4 or 8 MB.
++
+ config ETRAX_VMEM_SIZE
+ int "Video memory size (dec, in MB)"
+ depends on ETRAX_ARCH_V32 && !ETRAXFS
+@@ -273,7 +279,7 @@
+ select MTD_CFI_AMDSTD
+ select MTD_JEDECPROBE if ETRAX_ARCH_V32
+ select MTD_CHAR
+- select MTD_BLOCK
++ select MTD_BLOCK_RO
+ select MTD_PARTITIONS
+ select MTD_CONCAT
+ select MTD_COMPLEX_MAPPINGS
+@@ -662,6 +668,11 @@
+
+ source "drivers/ide/Kconfig"
+
++#mysteriously part of this standard linux driver was removed from cris build! - info@crisos.org
++source "drivers/scsi/Kconfig"
++
++source "drivers/media/Kconfig"
++
+ source "drivers/net/Kconfig"
+
+ source "drivers/i2c/Kconfig"
+diff -Nur linux-2.6.29.1.orig/arch/cris/Makefile linux-2.6.29.1/arch/cris/Makefile
+--- linux-2.6.29.1.orig/arch/cris/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/Makefile 2009-05-09 01:53:12.795556299 +0200
+@@ -40,12 +40,12 @@
+
+ LD = $(CROSS_COMPILE)ld -mcrislinux
+
+-OBJCOPYFLAGS := -O binary -R .note -R .comment -S
++OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment
+
+ CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
+
+ KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
+-KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
++KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe -fno-peephole2 $(inc)
+ KBUILD_CPPFLAGS += $(inc)
+
+ ifdef CONFIG_FRAME_POINTER
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/boot/Makefile linux-2.6.29.1/arch/cris/arch-v10/boot/Makefile
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/boot/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/boot/Makefile 2009-05-09 01:52:50.030131736 +0200
+@@ -2,10 +2,8 @@
+ # arch/cris/arch-v10/boot/Makefile
+ #
+
+-OBJCOPYFLAGS = -O binary --remove-section=.bss
+-
+ subdir- := compressed rescue
+-targets := Image
++targets := Image zImage
+
+ $(obj)/Image: vmlinux FORCE
+ $(call if_changed,objcopy)
+@@ -13,7 +11,6 @@
+
+ $(obj)/compressed/vmlinux: $(obj)/Image FORCE
+ $(Q)$(MAKE) $(build)=$(obj)/compressed $@
+- $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
+
+ $(obj)/zImage: $(obj)/compressed/vmlinux
+ @cp $< $@
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/boot/compressed/Makefile linux-2.6.29.1/arch/cris/arch-v10/boot/compressed/Makefile
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/boot/compressed/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/boot/compressed/Makefile 2009-05-09 01:52:50.102136724 +0200
+@@ -6,7 +6,6 @@
+ ccflags-y += -O2 $(LINUXINCLUDE)
+ ldflags-y += -T $(srctree)/$(src)/decompress.lds
+ OBJECTS = $(obj)/head.o $(obj)/misc.o
+-OBJCOPYFLAGS = -O binary --remove-section=.bss
+
+ quiet_cmd_image = BUILD $@
+ cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/boot/compressed/misc.c linux-2.6.29.1/arch/cris/arch-v10/boot/compressed/misc.c
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/boot/compressed/misc.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/boot/compressed/misc.c 2009-05-09 01:52:50.126138666 +0200
+@@ -5,7 +5,7 @@
+ * adapted for Linux.
+ *
+ * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
+- * puts by Nick Holloway 1993, better puts by Martin Mares 1995
++ * putstr by Nick Holloway 1993, better putstr by Martin Mares 1995
+ * adaptation for Linux/CRIS Axis Communications AB, 1999
+ *
+ */
+@@ -102,7 +102,7 @@
+ static long bytes_out = 0;
+ static uch *output_data;
+ static unsigned long output_ptr = 0;
+-static void puts(const char *);
++static void putstr(const char *);
+
+ /* the "heap" is put directly after the BSS ends, at end */
+
+@@ -115,7 +115,7 @@
+ /* decompressor info and error messages to serial console */
+
+ static void
+-puts(const char *s)
++putstr(const char *s)
+ {
+ #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
+ while (*s) {
+@@ -188,9 +188,9 @@
+
+ static void error(char *x)
+ {
+- puts("\n\n");
+- puts(x);
+- puts("\n\n -- System halted\n");
++ putstr("\n\n");
++ putstr(x);
++ putstr("\n\n -- System halted\n");
+
+ while (1); /* Halt */
+ }
+@@ -234,13 +234,7 @@
+
+ makecrc();
+
+- __asm__ volatile ("move $vr,%0" : "=rm" (revision));
+- if (revision < 10) {
+- puts("You need an ETRAX 100LX to run linux 2.6\n");
+- while (1);
+- }
+-
+- puts("Uncompressing Linux...\n");
++ putstr("Uncompressing Linux...\n");
+ gunzip();
+- puts("Done. Now booting the kernel.\n");
++ putstr("Done. Now booting the kernel.\n");
+ }
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2.6.29.1/arch/cris/arch-v10/drivers/axisflashmap.c
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/drivers/axisflashmap.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/drivers/axisflashmap.c 2009-05-09 01:52:50.210144343 +0200
+@@ -122,19 +122,19 @@
+ */
+ static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
+ {
+- .name = "boot firmware",
+- .size = CONFIG_ETRAX_PTABLE_SECTOR,
++ .name = "kernel",
++ .size = 0x00,
+ .offset = 0
+ },
+ {
+- .name = "kernel",
+- .size = 0x200000 - (6 * CONFIG_ETRAX_PTABLE_SECTOR),
+- .offset = CONFIG_ETRAX_PTABLE_SECTOR
++ .name = "rootfs",
++ .size = 0x200000 ,
++ .offset = 0x200000
+ },
+ {
+- .name = "filesystem",
+- .size = 5 * CONFIG_ETRAX_PTABLE_SECTOR,
+- .offset = 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
++ .name = "cfgfs",
++ .size = 0x20000 ,
++ .offset = CONFIG_ETRAX_MTD_SIZE - 0x20000
+ }
+ };
+
+@@ -281,6 +281,11 @@
+ struct partitiontable_entry *ptable;
+ int use_default_ptable = 1; /* Until proven otherwise. */
+ const char pmsg[] = " /dev/flash%d at 0x%08x, size 0x%08x\n";
++ unsigned int kernel_part_size = 0;
++ unsigned char *flash_mem = (unsigned char*)(FLASH_CACHED_ADDR);
++ unsigned int flash_scan_count = 0;
++ const char *part_magic = "ACME_PART_MAGIC";
++ unsigned int magic_len = strlen(part_magic);
+
+ if (!(mymtd = flash_probe())) {
+ /* There's no reason to use this module if no flash chip can
+@@ -292,6 +297,31 @@
+ mymtd->name, mymtd->size);
+ axisflash_mtd = mymtd;
+ }
++ /* scan flash to findout where out partition starts */
++
++ printk(KERN_INFO "Scanning flash for end of kernel magic\n");
++ for(flash_scan_count = 0; flash_scan_count < 100000; flash_scan_count++){
++ if(strncmp(&flash_mem[flash_scan_count], part_magic, magic_len - 1) == 0)
++ {
++ kernel_part_size = flash_mem[flash_scan_count + magic_len ];
++ kernel_part_size <<= 8;
++ kernel_part_size += flash_mem[flash_scan_count + magic_len + 2];
++ kernel_part_size <<= 8;
++ kernel_part_size += flash_mem[flash_scan_count + magic_len + 1];
++ kernel_part_size <<= 8;
++ kernel_part_size += flash_mem[flash_scan_count + magic_len + 3];
++ printk(KERN_INFO "Kernel ends at 0x%.08X\n", kernel_part_size);
++ flash_scan_count = 1100000;
++ }
++ }
++
++
++ if(kernel_part_size){
++ kernel_part_size = (kernel_part_size & 0xffff0000);
++ axis_default_partitions[0].size = kernel_part_size;
++ axis_default_partitions[1].size = mymtd->size - axis_default_partitions[0].size - axis_default_partitions[2].size;
++ axis_default_partitions[1].offset = axis_default_partitions[0].size;
++ }
+
+ if (mymtd) {
+ mymtd->owner = THIS_MODULE;
+@@ -360,21 +390,6 @@
+ use_default_ptable = !ptable_ok;
+ }
+
+- if (romfs_in_flash) {
+- /* Add an overlapping device for the root partition (romfs). */
+-
+- axis_partitions[pidx].name = "romfs";
+- axis_partitions[pidx].size = romfs_length;
+- axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
+- axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
+-
+- printk(KERN_INFO
+- " Adding readonly flash partition for romfs image:\n");
+- printk(pmsg, pidx, axis_partitions[pidx].offset,
+- axis_partitions[pidx].size);
+- pidx++;
+- }
+-
+ #ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
+ if (mymtd) {
+ main_partition.size = mymtd->size;
+@@ -397,36 +412,6 @@
+ if (err)
+ panic("axisflashmap could not add MTD partitions!\n");
+ }
+-
+- if (!romfs_in_flash) {
+- /* Create an RAM device for the root partition (romfs). */
+-
+-#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)
+- /* No use trying to boot this kernel from RAM. Panic! */
+- printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "
+- "device due to kernel (mis)configuration!\n");
+- panic("This kernel cannot boot from RAM!\n");
+-#else
+- struct mtd_info *mtd_ram;
+-
+- mtd_ram = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
+- if (!mtd_ram)
+- panic("axisflashmap couldn't allocate memory for "
+- "mtd_info!\n");
+-
+- printk(KERN_INFO " Adding RAM partition for romfs image:\n");
+- printk(pmsg, pidx, (unsigned)romfs_start,
+- (unsigned)romfs_length);
+-
+- err = mtdram_init_device(mtd_ram,
+- (void *)romfs_start,
+- romfs_length,
+- "romfs");
+- if (err)
+- panic("axisflashmap could not initialize MTD RAM "
+- "device!\n");
+-#endif
+- }
+ return err;
+ }
+
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/drivers/ds1302.c linux-2.6.29.1/arch/cris/arch-v10/drivers/ds1302.c
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/drivers/ds1302.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/drivers/ds1302.c 2009-05-09 01:52:50.538166563 +0200
+@@ -21,6 +21,7 @@
+ #include <linux/delay.h>
+ #include <linux/bcd.h>
+ #include <linux/capability.h>
++#include <linux/device.h>
+
+ #include <asm/uaccess.h>
+ #include <asm/system.h>
+@@ -489,6 +490,10 @@
+ return 0;
+ }
+
++#ifdef CONFIG_SYSFS
++static struct class *rtc_class;
++#endif
++
+ static int __init ds1302_register(void)
+ {
+ ds1302_init();
+@@ -497,6 +502,12 @@
+ ds1302_name, RTC_MAJOR_NR);
+ return -1;
+ }
++ #ifdef CONFIG_SYSFS
++ rtc_class = class_create(THIS_MODULE, "rtc");
++ class_device_create(rtc_class, NULL, MKDEV(RTC_MAJOR_NR, 0),
++ NULL, "rtc");
++ #endif
++
+ return 0;
+
+ }
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/drivers/gpio.c linux-2.6.29.1/arch/cris/arch-v10/drivers/gpio.c
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/drivers/gpio.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/drivers/gpio.c 2009-05-09 01:52:50.586168771 +0200
+@@ -21,6 +21,7 @@
+ #include <linux/poll.h>
+ #include <linux/init.h>
+ #include <linux/interrupt.h>
++#include <linux/device.h>
+
+ #include <asm/etraxgpio.h>
+ #include <arch/svinto.h>
+@@ -771,6 +772,10 @@
+
+ /* main driver initialization routine, called from mem.c */
+
++#ifdef CONFIG_SYSFS
++static struct class *gpio_class;
++#endif
++
+ static int __init gpio_init(void)
+ {
+ int res;
+@@ -784,6 +789,13 @@
+ return res;
+ }
+
++#ifdef CONFIG_SYSFS
++ gpio_class = class_create(THIS_MODULE, "gpio");
++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 0), NULL, "gpioa");
++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 1), NULL, "gpiob");
++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 2), NULL, "leds");
++ device_create(gpio_class, NULL, MKDEV(GPIO_MAJOR, 3), NULL, "gpiog");
++#endif
+ /* Clear all leds */
+ #if defined (CONFIG_ETRAX_CSP0_LEDS) || defined (CONFIG_ETRAX_PA_LEDS) || defined (CONFIG_ETRAX_PB_LEDS)
+ CRIS_LED_NETWORK_SET(0);
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/lib/hw_settings.S linux-2.6.29.1/arch/cris/arch-v10/lib/hw_settings.S
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/lib/hw_settings.S 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/lib/hw_settings.S 2009-05-09 01:52:50.690174762 +0200
+@@ -60,3 +60,5 @@
+ .dword R_PORT_PB_SET
+ .dword PB_SET_VALUE
+ .dword 0 ; No more register values
++ .ascii "ACME_PART_MAGIC"
++ .dword 0xdeadc0de
+diff -Nur linux-2.6.29.1.orig/arch/cris/arch-v10/mm/init.c linux-2.6.29.1/arch/cris/arch-v10/mm/init.c
+--- linux-2.6.29.1.orig/arch/cris/arch-v10/mm/init.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/cris/arch-v10/mm/init.c 2009-05-09 01:52:50.754179285 +0200
+@@ -184,6 +184,9 @@
+
+ free_area_init_node(0, zones_size, PAGE_OFFSET >> PAGE_SHIFT, 0);
+ }
++void free_initrd_mem(unsigned long start, unsigned long end)
++{
++}
+
+ /* Initialize remaps of some I/O-ports. It is important that this
+ * is called before any driver is initialized.
+diff -Nur linux-2.6.29.1.orig/drivers/net/cris/eth_v10.c linux-2.6.29.1/drivers/net/cris/eth_v10.c
+--- linux-2.6.29.1.orig/drivers/net/cris/eth_v10.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/cris/eth_v10.c 2009-05-09 01:52:50.754179285 +0200
+@@ -1705,7 +1705,7 @@
+ static void
+ e100_netpoll(struct net_device* netdev)
+ {
+- e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev, NULL);
++ e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev);
+ }
+ #endif
+
+diff -Nur linux-2.6.29.1.orig/drivers/serial/crisv10.c linux-2.6.29.1/drivers/serial/crisv10.c
+--- linux-2.6.29.1.orig/drivers/serial/crisv10.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/serial/crisv10.c 2009-05-09 01:52:50.758178956 +0200
+@@ -27,6 +27,7 @@
+ #include <linux/kernel.h>
+ #include <linux/mutex.h>
+ #include <linux/bitops.h>
++#include <linux/device.h>
+
+ #include <asm/io.h>
+ #include <asm/irq.h>
+@@ -4393,6 +4394,7 @@
+ .tiocmset = rs_tiocmset
+ };
+
++static struct class *rs_class;
+ static int __init
+ rs_init(void)
+ {
+@@ -4527,6 +4529,24 @@
+ #endif
+ #endif /* CONFIG_SVINTO_SIM */
+
++ rs_class = class_create(THIS_MODULE, "rs_tty");
++#ifdef CONFIG_ETRAX_SERIAL_PORT0
++ device_create(rs_class, NULL,
++ MKDEV(TTY_MAJOR, 64), NULL, "ttyS0");
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT1
++ device_create(rs_class, NULL,
++ MKDEV(TTY_MAJOR, 65), NULL, "ttyS1");
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT2
++ device_create(rs_class, NULL,
++ MKDEV(TTY_MAJOR, 66), NULL, "ttyS2");
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT3
++ device_create(rs_class, NULL,
++ MKDEV(TTY_MAJOR, 67), NULL, "ttyS3");
++#endif
++
+ return 0;
+ }
+
+diff -Nur linux-2.6.29.1.orig/drivers/usb/Makefile linux-2.6.29.1/drivers/usb/Makefile
+--- linux-2.6.29.1.orig/drivers/usb/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/Makefile 2009-05-09 01:52:50.758178956 +0200
+@@ -19,6 +19,7 @@
+ obj-$(CONFIG_USB_U132_HCD) += host/
+ obj-$(CONFIG_USB_R8A66597_HCD) += host/
+ obj-$(CONFIG_USB_HWA_HCD) += host/
++obj-$(CONFIG_ETRAX_USB_HOST) += host/
+
+ obj-$(CONFIG_USB_C67X00_HCD) += c67x00/
+
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/Makefile linux-2.6.29.1/drivers/usb/host/Makefile
+--- linux-2.6.29.1.orig/drivers/usb/host/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/host/Makefile 2009-05-09 01:52:50.758178956 +0200
+@@ -29,3 +29,4 @@
+ obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
+ obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o
+ obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o
++obj-$(CONFIG_ETRAX_USB_HOST) += hc-crisv10.o
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/hc-cris-dbg.h linux-2.6.29.1/drivers/usb/host/hc-cris-dbg.h
+--- linux-2.6.29.1.orig/drivers/usb/host/hc-cris-dbg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/usb/host/hc-cris-dbg.h 2009-05-09 01:52:50.762178907 +0200
+@@ -0,0 +1,146 @@
++
++/* macros for debug output */
++
++#define warn(fmt, args...) \
++ printk(KERN_INFO "crisv10 warn: ");printk(fmt, ## args)
++
++#define hcd_dbg(hcd, fmt, args...) \
++ dev_info(hcd->self.controller, fmt, ## args)
++#define hcd_err(hcd, fmt, args...) \
++ dev_err(hcd->self.controller, fmt, ## args)
++#define hcd_info(hcd, fmt, args...) \
++ dev_info(hcd->self.controller, fmt, ## args)
++#define hcd_warn(hcd, fmt, args...) \
++ dev_warn(hcd->self.controller, fmt, ## args)
++
++/*
++#define devdrv_dbg(fmt, args...) \
++ printk(KERN_INFO "usb_devdrv dbg: ");printk(fmt, ## args)
++*/
++#define devdrv_dbg(fmt, args...) {}
++
++#define devdrv_err(fmt, args...) \
++ printk(KERN_ERR "usb_devdrv error: ");printk(fmt, ## args)
++#define devdrv_info(fmt, args...) \
++ printk(KERN_INFO "usb_devdrv: ");printk(fmt, ## args)
++
++#define irq_dbg(fmt, args...) \
++ printk(KERN_INFO "crisv10_irq dbg: ");printk(fmt, ## args)
++#define irq_err(fmt, args...) \
++ printk(KERN_ERR "crisv10_irq error: ");printk(fmt, ## args)
++#define irq_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_irq warn: ");printk(fmt, ## args)
++#define irq_info(fmt, args...) \
++ printk(KERN_INFO "crisv10_hcd: ");printk(fmt, ## args)
++
++/*
++#define rh_dbg(fmt, args...) \
++ printk(KERN_DEBUG "crisv10_rh dbg: ");printk(fmt, ## args)
++*/
++#define rh_dbg(fmt, args...) {}
++
++#define rh_err(fmt, args...) \
++ printk(KERN_ERR "crisv10_rh error: ");printk(fmt, ## args)
++#define rh_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_rh warning: ");printk(fmt, ## args)
++#define rh_info(fmt, args...) \
++ printk(KERN_INFO "crisv10_rh: ");printk(fmt, ## args)
++
++/*
++#define tc_dbg(fmt, args...) \
++ printk(KERN_INFO "crisv10_tc dbg: ");printk(fmt, ## args)
++*/
++#define tc_dbg(fmt, args...) {while(0){}}
++
++#define tc_err(fmt, args...) \
++ printk(KERN_ERR "crisv10_tc error: ");printk(fmt, ## args)
++/*
++#define tc_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_tc warning: ");printk(fmt, ## args)
++*/
++#define tc_warn(fmt, args...) {while(0){}}
++
++#define tc_info(fmt, args...) \
++ printk(KERN_INFO "crisv10_tc: ");printk(fmt, ## args)
++
++
++/* Debug print-outs for various traffic types */
++
++#define intr_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_intr warning: ");printk(fmt, ## args)
++
++#define intr_dbg(fmt, args...) \
++ printk(KERN_DEBUG "crisv10_intr dbg: ");printk(fmt, ## args)
++/*
++#define intr_dbg(fmt, args...) {while(0){}}
++*/
++
++
++#define isoc_err(fmt, args...) \
++ printk(KERN_ERR "crisv10_isoc error: ");printk(fmt, ## args)
++/*
++#define isoc_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_isoc warning: ");printk(fmt, ## args)
++*/
++#define isoc_warn(fmt, args...) {while(0){}}
++
++/*
++#define isoc_dbg(fmt, args...) \
++ printk(KERN_INFO "crisv10_isoc dbg: ");printk(fmt, ## args)
++*/
++#define isoc_dbg(fmt, args...) {while(0){}}
++
++/*
++#define timer_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_timer warning: ");printk(fmt, ## args)
++*/
++#define timer_warn(fmt, args...) {while(0){}}
++
++/*
++#define timer_dbg(fmt, args...) \
++ printk(KERN_INFO "crisv10_timer dbg: ");printk(fmt, ## args)
++*/
++#define timer_dbg(fmt, args...) {while(0){}}
++
++
++/* Debug printouts for events related to late finishing of URBs */
++
++#define late_dbg(fmt, args...) \
++ printk(KERN_INFO "crisv10_late dbg: ");printk(fmt, ## args)
++/*
++#define late_dbg(fmt, args...) {while(0){}}
++*/
++
++#define late_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_late warning: ");printk(fmt, ## args)
++/*
++#define errno_dbg(fmt, args...) \
++ printk(KERN_INFO "crisv10_errno dbg: ");printk(fmt, ## args)
++*/
++#define errno_dbg(fmt, args...) {while(0){}}
++
++
++#define dma_dbg(fmt, args...) \
++ printk(KERN_INFO "crisv10_dma dbg: ");printk(fmt, ## args)
++#define dma_err(fmt, args...) \
++ printk(KERN_ERR "crisv10_dma error: ");printk(fmt, ## args)
++#define dma_warn(fmt, args...) \
++ printk(KERN_INFO "crisv10_dma warning: ");printk(fmt, ## args)
++#define dma_info(fmt, args...) \
++ printk(KERN_INFO "crisv10_dma: ");printk(fmt, ## args)
++
++
++
++#define str_dir(pipe) \
++ (usb_pipeout(pipe) ? "out" : "in")
++#define str_type(pipe) \
++ ({ \
++ char *s = "?"; \
++ switch (usb_pipetype(pipe)) { \
++ case PIPE_ISOCHRONOUS: s = "iso"; break; \
++ case PIPE_INTERRUPT: s = "intr"; break; \
++ case PIPE_CONTROL: s = "ctrl"; break; \
++ case PIPE_BULK: s = "bulk"; break; \
++ }; \
++ s; \
++ })
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/hc-crisv10.c linux-2.6.29.1/drivers/usb/host/hc-crisv10.c
+--- linux-2.6.29.1.orig/drivers/usb/host/hc-crisv10.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/usb/host/hc-crisv10.c 2009-05-09 01:52:50.834182770 +0200
+@@ -0,0 +1,4800 @@
++/*
++ *
++ * ETRAX 100LX USB Host Controller Driver
++ *
++ * Copyright (C) 2005, 2006 Axis Communications AB
++ *
++ * Author: Konrad Eriksson <konrad.eriksson@axis.se>
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/moduleparam.h>
++#include <linux/spinlock.h>
++#include <linux/usb.h>
++#include <linux/platform_device.h>
++
++#include <asm/io.h>
++#include <asm/irq.h>
++#include <arch/dma.h>
++#include <arch/io_interface_mux.h>
++
++#include "../core/hcd.h"
++#include "../core/hub.h"
++#include "hc-crisv10.h"
++#include "hc-cris-dbg.h"
++
++
++/***************************************************************************/
++/***************************************************************************/
++/* Host Controller settings */
++/***************************************************************************/
++/***************************************************************************/
++
++#define VERSION "1.00 hinko.4"
++#define COPYRIGHT "(c) 2005, 2006 Axis Communications AB"
++#define DESCRIPTION "ETRAX 100LX USB Host Controller (2.6.25-rc9 port)"
++
++#define ETRAX_USB_HC_IRQ USB_HC_IRQ_NBR
++#define ETRAX_USB_RX_IRQ USB_DMA_RX_IRQ_NBR
++#define ETRAX_USB_TX_IRQ USB_DMA_TX_IRQ_NBR
++
++/* Number of physical ports in Etrax 100LX */
++#define USB_ROOT_HUB_PORTS 2
++
++const char hc_name[] = "hc-crisv10";
++const char product_desc[] = DESCRIPTION;
++
++/* The number of epids is, among other things, used for pre-allocating
++ ctrl, bulk and isoc EP descriptors (one for each epid).
++ Assumed to be > 1 when initiating the DMA lists. */
++#define NBR_OF_EPIDS 32
++
++/* Support interrupt traffic intervals up to 128 ms. */
++#define MAX_INTR_INTERVAL 128
++
++/* If periodic traffic (intr or isoc) is to be used, then one entry in the EP
++ table must be "invalid". By this we mean that we shouldn't care about epid
++ attentions for this epid, or at least handle them differently from epid
++ attentions for "valid" epids. This define determines which one to use
++ (don't change it). */
++#define INVALID_EPID 31
++/* A special epid for the bulk dummys. */
++#define DUMMY_EPID 30
++
++/* Module settings */
++
++MODULE_DESCRIPTION(DESCRIPTION);
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Konrad Eriksson <konrad.eriksson@axis.se>");
++
++
++/* Module parameters */
++
++/* 0 = No ports enabled
++ 1 = Only port 1 enabled (on board ethernet on devboard)
++ 2 = Only port 2 enabled (external connector on devboard)
++ 3 = Both ports enabled
++*/
++static unsigned int ports = 3;
++module_param(ports, uint, S_IRUGO);
++MODULE_PARM_DESC(ports, "Bitmask indicating USB ports to use");
++
++
++/***************************************************************************/
++/***************************************************************************/
++/* Shared global variables for this module */
++/***************************************************************************/
++/***************************************************************************/
++
++/* EP descriptor lists for non period transfers. Must be 32-bit aligned. */
++static volatile struct USB_EP_Desc TxBulkEPList[NBR_OF_EPIDS] __attribute__ ((aligned (4)));
++
++static volatile struct USB_EP_Desc TxCtrlEPList[NBR_OF_EPIDS] __attribute__ ((aligned (4)));
++
++/* EP descriptor lists for period transfers. Must be 32-bit aligned. */
++static volatile struct USB_EP_Desc TxIntrEPList[MAX_INTR_INTERVAL] __attribute__ ((aligned (4)));
++static volatile struct USB_SB_Desc TxIntrSB_zout __attribute__ ((aligned (4)));
++
++static volatile struct USB_EP_Desc TxIsocEPList[NBR_OF_EPIDS] __attribute__ ((aligned (4)));
++static volatile struct USB_SB_Desc TxIsocSB_zout __attribute__ ((aligned (4)));
++
++//static volatile struct USB_SB_Desc TxIsocSBList[NBR_OF_EPIDS] __attribute__ ((aligned (4)));
++
++/* After each enabled bulk EP IN we put two disabled EP descriptors with the eol flag set,
++ causing the DMA to stop the DMA channel. The first of these two has the intr flag set, which
++ gives us a dma8_sub0_descr interrupt. When we receive this, we advance the DMA one step in the
++ EP list and then restart the bulk channel, thus forcing a switch between bulk EP descriptors
++ in each frame. */
++static volatile struct USB_EP_Desc TxBulkDummyEPList[NBR_OF_EPIDS][2] __attribute__ ((aligned (4)));
++
++/* List of URB pointers, where each points to the active URB for a epid.
++ For Bulk, Ctrl and Intr this means which URB that currently is added to
++ DMA lists (Isoc URBs are all directly added to DMA lists). As soon as
++ URB has completed is the queue examined and the first URB in queue is
++ removed and moved to the activeUrbList while its state change to STARTED and
++ its transfer(s) gets added to DMA list (exception Isoc where URBs enter
++ state STARTED directly and added transfers added to DMA lists). */
++static struct urb *activeUrbList[NBR_OF_EPIDS];
++
++/* Additional software state info for each epid */
++static struct etrax_epid epid_state[NBR_OF_EPIDS];
++
++/* Timer handles for bulk traffic timer used to avoid DMA bug where DMA stops
++ even if there is new data waiting to be processed */
++static struct timer_list bulk_start_timer = TIMER_INITIALIZER(NULL, 0, 0);
++static struct timer_list bulk_eot_timer = TIMER_INITIALIZER(NULL, 0, 0);
++
++/* We want the start timer to expire before the eot timer, because the former
++ might start traffic, thus making it unnecessary for the latter to time
++ out. */
++#define BULK_START_TIMER_INTERVAL (HZ/50) /* 20 ms */
++#define BULK_EOT_TIMER_INTERVAL (HZ/16) /* 60 ms */
++
++/* Delay before a URB completion happen when it's scheduled to be delayed */
++#define LATER_TIMER_DELAY (HZ/50) /* 20 ms */
++
++/* Simplifying macros for checking software state info of a epid */
++/* ----------------------------------------------------------------------- */
++#define epid_inuse(epid) epid_state[epid].inuse
++#define epid_out_traffic(epid) epid_state[epid].out_traffic
++#define epid_isoc(epid) (epid_state[epid].type == PIPE_ISOCHRONOUS ? 1 : 0)
++#define epid_intr(epid) (epid_state[epid].type == PIPE_INTERRUPT ? 1 : 0)
++
++
++/***************************************************************************/
++/***************************************************************************/
++/* DEBUG FUNCTIONS */
++/***************************************************************************/
++/***************************************************************************/
++/* Note that these functions are always available in their "__" variants,
++ for use in error situations. The "__" missing variants are controlled by
++ the USB_DEBUG_DESC/USB_DEBUG_URB macros. */
++static void __dump_urb(struct urb* purb)
++{
++ struct crisv10_urb_priv *urb_priv = purb->hcpriv;
++ int urb_num = -1;
++ if(urb_priv) {
++ urb_num = urb_priv->urb_num;
++ }
++ printk("\nURB:0x%x[%d]\n", (unsigned int)purb, urb_num);
++ printk("dev :0x%08lx\n", (unsigned long)purb->dev);
++ printk("pipe :0x%08x\n", purb->pipe);
++ printk("status :%d\n", purb->status);
++ printk("transfer_flags :0x%08x\n", purb->transfer_flags);
++ printk("transfer_buffer :0x%08lx\n", (unsigned long)purb->transfer_buffer);
++ printk("transfer_buffer_length:%d\n", purb->transfer_buffer_length);
++ printk("actual_length :%d\n", purb->actual_length);
++ printk("setup_packet :0x%08lx\n", (unsigned long)purb->setup_packet);
++ printk("start_frame :%d\n", purb->start_frame);
++ printk("number_of_packets :%d\n", purb->number_of_packets);
++ printk("interval :%d\n", purb->interval);
++ printk("error_count :%d\n", purb->error_count);
++ printk("context :0x%08lx\n", (unsigned long)purb->context);
++ printk("complete :0x%08lx\n\n", (unsigned long)purb->complete);
++}
++
++static void __dump_in_desc(volatile struct USB_IN_Desc *in)
++{
++ printk("\nUSB_IN_Desc at 0x%08lx\n", (unsigned long)in);
++ printk(" sw_len : 0x%04x (%d)\n", in->sw_len, in->sw_len);
++ printk(" command : 0x%04x\n", in->command);
++ printk(" next : 0x%08lx\n", in->next);
++ printk(" buf : 0x%08lx\n", in->buf);
++ printk(" hw_len : 0x%04x (%d)\n", in->hw_len, in->hw_len);
++ printk(" status : 0x%04x\n\n", in->status);
++}
++
++static void __dump_sb_desc(volatile struct USB_SB_Desc *sb)
++{
++ char tt = (sb->command & 0x30) >> 4;
++ char *tt_string;
++
++ switch (tt) {
++ case 0:
++ tt_string = "zout";
++ break;
++ case 1:
++ tt_string = "in";
++ break;
++ case 2:
++ tt_string = "out";
++ break;
++ case 3:
++ tt_string = "setup";
++ break;
++ default:
++ tt_string = "unknown (weird)";
++ }
++
++ printk(" USB_SB_Desc at 0x%08lx ", (unsigned long)sb);
++ printk(" command:0x%04x (", sb->command);
++ printk("rem:%d ", (sb->command & 0x3f00) >> 8);
++ printk("full:%d ", (sb->command & 0x40) >> 6);
++ printk("tt:%d(%s) ", tt, tt_string);
++ printk("intr:%d ", (sb->command & 0x8) >> 3);
++ printk("eot:%d ", (sb->command & 0x2) >> 1);
++ printk("eol:%d)", sb->command & 0x1);
++ printk(" sw_len:0x%04x(%d)", sb->sw_len, sb->sw_len);
++ printk(" next:0x%08lx", sb->next);
++ printk(" buf:0x%08lx\n", sb->buf);
++}
++
++
++static void __dump_ep_desc(volatile struct USB_EP_Desc *ep)
++{
++ printk("USB_EP_Desc at 0x%08lx ", (unsigned long)ep);
++ printk(" command:0x%04x (", ep->command);
++ printk("ep_id:%d ", (ep->command & 0x1f00) >> 8);
++ printk("enable:%d ", (ep->command & 0x10) >> 4);
++ printk("intr:%d ", (ep->command & 0x8) >> 3);
++ printk("eof:%d ", (ep->command & 0x2) >> 1);
++ printk("eol:%d)", ep->command & 0x1);
++ printk(" hw_len:0x%04x(%d)", ep->hw_len, ep->hw_len);
++ printk(" next:0x%08lx", ep->next);
++ printk(" sub:0x%08lx\n", ep->sub);
++}
++
++static inline void __dump_ep_list(int pipe_type)
++{
++ volatile struct USB_EP_Desc *ep;
++ volatile struct USB_EP_Desc *first_ep;
++ volatile struct USB_SB_Desc *sb;
++
++ switch (pipe_type)
++ {
++ case PIPE_BULK:
++ first_ep = &TxBulkEPList[0];
++ break;
++ case PIPE_CONTROL:
++ first_ep = &TxCtrlEPList[0];
++ break;
++ case PIPE_INTERRUPT:
++ first_ep = &TxIntrEPList[0];
++ break;
++ case PIPE_ISOCHRONOUS:
++ first_ep = &TxIsocEPList[0];
++ break;
++ default:
++ warn("Cannot dump unknown traffic type");
++ return;
++ }
++ ep = first_ep;
++
++ printk("\n\nDumping EP list...\n\n");
++
++ do {
++ __dump_ep_desc(ep);
++ /* Cannot phys_to_virt on 0 as it turns into 80000000, which is != 0. */
++ sb = ep->sub ? phys_to_virt(ep->sub) : 0;
++ while (sb) {
++ __dump_sb_desc(sb);
++ sb = sb->next ? phys_to_virt(sb->next) : 0;
++ }
++ ep = (volatile struct USB_EP_Desc *)(phys_to_virt(ep->next));
++
++ } while (ep != first_ep);
++}
++
++static inline void __dump_ept_data(int epid)
++{
++ unsigned long flags;
++ __u32 r_usb_ept_data;
++
++ if (epid < 0 || epid > 31) {
++ printk("Cannot dump ept data for invalid epid %d\n", epid);
++ return;
++ }
++
++ local_irq_save(flags);
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, epid);
++ nop();
++ r_usb_ept_data = *R_USB_EPT_DATA;
++ local_irq_restore(flags);
++
++ printk(" R_USB_EPT_DATA = 0x%x for epid %d :\n", r_usb_ept_data, epid);
++ if (r_usb_ept_data == 0) {
++ /* No need for more detailed printing. */
++ return;
++ }
++ printk(" valid : %d\n", (r_usb_ept_data & 0x80000000) >> 31);
++ printk(" hold : %d\n", (r_usb_ept_data & 0x40000000) >> 30);
++ printk(" error_count_in : %d\n", (r_usb_ept_data & 0x30000000) >> 28);
++ printk(" t_in : %d\n", (r_usb_ept_data & 0x08000000) >> 27);
++ printk(" low_speed : %d\n", (r_usb_ept_data & 0x04000000) >> 26);
++ printk(" port : %d\n", (r_usb_ept_data & 0x03000000) >> 24);
++ printk(" error_code : %d\n", (r_usb_ept_data & 0x00c00000) >> 22);
++ printk(" t_out : %d\n", (r_usb_ept_data & 0x00200000) >> 21);
++ printk(" error_count_out : %d\n", (r_usb_ept_data & 0x00180000) >> 19);
++ printk(" max_len : %d\n", (r_usb_ept_data & 0x0003f800) >> 11);
++ printk(" ep : %d\n", (r_usb_ept_data & 0x00000780) >> 7);
++ printk(" dev : %d\n", (r_usb_ept_data & 0x0000003f));
++}
++
++static inline void __dump_ept_data_iso(int epid)
++{
++ unsigned long flags;
++ __u32 ept_data;
++
++ if (epid < 0 || epid > 31) {
++ printk("Cannot dump ept data for invalid epid %d\n", epid);
++ return;
++ }
++
++ local_irq_save(flags);
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, epid);
++ nop();
++ ept_data = *R_USB_EPT_DATA_ISO;
++ local_irq_restore(flags);
++
++ printk(" R_USB_EPT_DATA = 0x%x for epid %d :\n", ept_data, epid);
++ if (ept_data == 0) {
++ /* No need for more detailed printing. */
++ return;
++ }
++ printk(" valid : %d\n", IO_EXTRACT(R_USB_EPT_DATA_ISO, valid,
++ ept_data));
++ printk(" port : %d\n", IO_EXTRACT(R_USB_EPT_DATA_ISO, port,
++ ept_data));
++ printk(" error_code : %d\n", IO_EXTRACT(R_USB_EPT_DATA_ISO, error_code,
++ ept_data));
++ printk(" max_len : %d\n", IO_EXTRACT(R_USB_EPT_DATA_ISO, max_len,
++ ept_data));
++ printk(" ep : %d\n", IO_EXTRACT(R_USB_EPT_DATA_ISO, ep,
++ ept_data));
++ printk(" dev : %d\n", IO_EXTRACT(R_USB_EPT_DATA_ISO, dev,
++ ept_data));
++}
++
++static inline void __dump_ept_data_list(void)
++{
++ int i;
++
++ printk("Dumping the whole R_USB_EPT_DATA list\n");
++
++ for (i = 0; i < 32; i++) {
++ __dump_ept_data(i);
++ }
++}
++
++static void debug_epid(int epid) {
++ int i;
++
++ if(epid_isoc(epid)) {
++ __dump_ept_data_iso(epid);
++ } else {
++ __dump_ept_data(epid);
++ }
++
++ printk("Bulk:\n");
++ for(i = 0; i < 32; i++) {
++ if(IO_EXTRACT(USB_EP_command, epid, TxBulkEPList[i].command) ==
++ epid) {
++ printk("%d: ", i); __dump_ep_desc(&(TxBulkEPList[i]));
++ }
++ }
++
++ printk("Ctrl:\n");
++ for(i = 0; i < 32; i++) {
++ if(IO_EXTRACT(USB_EP_command, epid, TxCtrlEPList[i].command) ==
++ epid) {
++ printk("%d: ", i); __dump_ep_desc(&(TxCtrlEPList[i]));
++ }
++ }
++
++ printk("Intr:\n");
++ for(i = 0; i < MAX_INTR_INTERVAL; i++) {
++ if(IO_EXTRACT(USB_EP_command, epid, TxIntrEPList[i].command) ==
++ epid) {
++ printk("%d: ", i); __dump_ep_desc(&(TxIntrEPList[i]));
++ }
++ }
++
++ printk("Isoc:\n");
++ for(i = 0; i < 32; i++) {
++ if(IO_EXTRACT(USB_EP_command, epid, TxIsocEPList[i].command) ==
++ epid) {
++ printk("%d: ", i); __dump_ep_desc(&(TxIsocEPList[i]));
++ }
++ }
++
++ __dump_ept_data_list();
++ __dump_ep_list(PIPE_INTERRUPT);
++ printk("\n\n");
++}
++
++
++
++char* hcd_status_to_str(__u8 bUsbStatus) {
++ static char hcd_status_str[128];
++ hcd_status_str[0] = '\0';
++ if(bUsbStatus & IO_STATE(R_USB_STATUS, ourun, yes)) {
++ strcat(hcd_status_str, "ourun ");
++ }
++ if(bUsbStatus & IO_STATE(R_USB_STATUS, perror, yes)) {
++ strcat(hcd_status_str, "perror ");
++ }
++ if(bUsbStatus & IO_STATE(R_USB_STATUS, device_mode, yes)) {
++ strcat(hcd_status_str, "device_mode ");
++ }
++ if(bUsbStatus & IO_STATE(R_USB_STATUS, host_mode, yes)) {
++ strcat(hcd_status_str, "host_mode ");
++ }
++ if(bUsbStatus & IO_STATE(R_USB_STATUS, started, yes)) {
++ strcat(hcd_status_str, "started ");
++ }
++ if(bUsbStatus & IO_STATE(R_USB_STATUS, running, yes)) {
++ strcat(hcd_status_str, "running ");
++ }
++ return hcd_status_str;
++}
++
++
++char* sblist_to_str(struct USB_SB_Desc* sb_desc) {
++ static char sblist_to_str_buff[128];
++ char tmp[32], tmp2[32];
++ sblist_to_str_buff[0] = '\0';
++ while(sb_desc != NULL) {
++ switch(IO_EXTRACT(USB_SB_command, tt, sb_desc->command)) {
++ case 0: sprintf(tmp, "zout"); break;
++ case 1: sprintf(tmp, "in"); break;
++ case 2: sprintf(tmp, "out"); break;
++ case 3: sprintf(tmp, "setup"); break;
++ }
++ sprintf(tmp2, "(%s %d)", tmp, sb_desc->sw_len);
++ strcat(sblist_to_str_buff, tmp2);
++ if(sb_desc->next != 0) {
++ sb_desc = phys_to_virt(sb_desc->next);
++ } else {
++ sb_desc = NULL;
++ }
++ }
++ return sblist_to_str_buff;
++}
++
++char* port_status_to_str(__u16 wPortStatus) {
++ static char port_status_str[128];
++ port_status_str[0] = '\0';
++ if(wPortStatus & IO_STATE(R_USB_RH_PORT_STATUS_1, connected, yes)) {
++ strcat(port_status_str, "connected ");
++ }
++ if(wPortStatus & IO_STATE(R_USB_RH_PORT_STATUS_1, enabled, yes)) {
++ strcat(port_status_str, "enabled ");
++ }
++ if(wPortStatus & IO_STATE(R_USB_RH_PORT_STATUS_1, suspended, yes)) {
++ strcat(port_status_str, "suspended ");
++ }
++ if(wPortStatus & IO_STATE(R_USB_RH_PORT_STATUS_1, reset, yes)) {
++ strcat(port_status_str, "reset ");
++ }
++ if(wPortStatus & IO_STATE(R_USB_RH_PORT_STATUS_1, speed, full)) {
++ strcat(port_status_str, "full-speed ");
++ } else {
++ strcat(port_status_str, "low-speed ");
++ }
++ return port_status_str;
++}
++
++
++char* endpoint_to_str(struct usb_endpoint_descriptor *ed) {
++ static char endpoint_to_str_buff[128];
++ char tmp[32];
++ int epnum = ed->bEndpointAddress & 0x0F;
++ int dir = ed->bEndpointAddress & 0x80;
++ int type = ed->bmAttributes & 0x03;
++ endpoint_to_str_buff[0] = '\0';
++ sprintf(endpoint_to_str_buff, "ep:%d ", epnum);
++ switch(type) {
++ case 0:
++ sprintf(tmp, " ctrl");
++ break;
++ case 1:
++ sprintf(tmp, " isoc");
++ break;
++ case 2:
++ sprintf(tmp, " bulk");
++ break;
++ case 3:
++ sprintf(tmp, " intr");
++ break;
++ }
++ strcat(endpoint_to_str_buff, tmp);
++ if(dir) {
++ sprintf(tmp, " in");
++ } else {
++ sprintf(tmp, " out");
++ }
++ strcat(endpoint_to_str_buff, tmp);
++
++ return endpoint_to_str_buff;
++}
++
++/* Debug helper functions for Transfer Controller */
++char* pipe_to_str(unsigned int pipe) {
++ static char pipe_to_str_buff[128];
++ char tmp[64];
++ sprintf(pipe_to_str_buff, "dir:%s", str_dir(pipe));
++ sprintf(tmp, " type:%s", str_type(pipe));
++ strcat(pipe_to_str_buff, tmp);
++
++ sprintf(tmp, " dev:%d", usb_pipedevice(pipe));
++ strcat(pipe_to_str_buff, tmp);
++ sprintf(tmp, " ep:%d", usb_pipeendpoint(pipe));
++ strcat(pipe_to_str_buff, tmp);
++ return pipe_to_str_buff;
++}
++
++
++#define USB_DEBUG_DESC 1
++
++#ifdef USB_DEBUG_DESC
++#define dump_in_desc(x) __dump_in_desc(x)
++#define dump_sb_desc(...) __dump_sb_desc(...)
++#define dump_ep_desc(x) __dump_ep_desc(x)
++#define dump_ept_data(x) __dump_ept_data(x)
++#else
++#define dump_in_desc(...) do {} while (0)
++#define dump_sb_desc(...) do {} while (0)
++#define dump_ep_desc(...) do {} while (0)
++#endif
++
++
++/* Uncomment this to enable massive function call trace
++ #define USB_DEBUG_TRACE */
++//#define USB_DEBUG_TRACE 1
++
++#ifdef USB_DEBUG_TRACE
++#define DBFENTER (printk(": Entering: %s\n", __FUNCTION__))
++#define DBFEXIT (printk(": Exiting: %s\n", __FUNCTION__))
++#else
++#define DBFENTER do {} while (0)
++#define DBFEXIT do {} while (0)
++#endif
++
++#define CHECK_ALIGN(x) if (((__u32)(x)) & 0x00000003) \
++{panic("Alignment check (DWORD) failed at %s:%s:%d\n", __FILE__, __FUNCTION__, __LINE__);}
++
++/* Most helpful debugging aid */
++#define ASSERT(expr) ((void) ((expr) ? 0 : (err("assert failed at: %s %d",__FUNCTION__, __LINE__))))
++
++
++/***************************************************************************/
++/***************************************************************************/
++/* Forward declarations */
++/***************************************************************************/
++/***************************************************************************/
++void crisv10_hcd_epid_attn_irq(struct crisv10_irq_reg *reg);
++void crisv10_hcd_port_status_irq(struct crisv10_irq_reg *reg);
++void crisv10_hcd_ctl_status_irq(struct crisv10_irq_reg *reg);
++void crisv10_hcd_isoc_eof_irq(struct crisv10_irq_reg *reg);
++
++void rh_port_status_change(__u16[]);
++int rh_clear_port_feature(__u8, __u16);
++int rh_set_port_feature(__u8, __u16);
++static void rh_disable_port(unsigned int port);
++
++static void check_finished_bulk_tx_epids(struct usb_hcd *hcd,
++ int timer);
++
++//static int tc_setup_epid(struct usb_host_endpoint *ep, struct urb *urb,
++// int mem_flags);
++static int tc_setup_epid(struct urb *urb, int mem_flags);
++static void tc_free_epid(struct usb_host_endpoint *ep);
++static int tc_allocate_epid(void);
++static void tc_finish_urb(struct usb_hcd *hcd, struct urb *urb, int status);
++static void tc_finish_urb_later(struct usb_hcd *hcd, struct urb *urb,
++ int status);
++
++static int urb_priv_create(struct usb_hcd *hcd, struct urb *urb, int epid,
++ int mem_flags);
++static void urb_priv_free(struct usb_hcd *hcd, struct urb *urb);
++
++static inline struct urb *urb_list_first(int epid);
++static inline void urb_list_add(struct urb *urb, int epid,
++ int mem_flags);
++static inline urb_entry_t *urb_list_entry(struct urb *urb, int epid);
++static inline void urb_list_del(struct urb *urb, int epid);
++static inline void urb_list_move_last(struct urb *urb, int epid);
++static inline struct urb *urb_list_next(struct urb *urb, int epid);
++
++int create_sb_for_urb(struct urb *urb, int mem_flags);
++int init_intr_urb(struct urb *urb, int mem_flags);
++
++static inline void etrax_epid_set(__u8 index, __u32 data);
++static inline void etrax_epid_clear_error(__u8 index);
++static inline void etrax_epid_set_toggle(__u8 index, __u8 dirout,
++ __u8 toggle);
++static inline __u8 etrax_epid_get_toggle(__u8 index, __u8 dirout);
++static inline __u32 etrax_epid_get(__u8 index);
++
++/* We're accessing the same register position in Etrax so
++ when we do full access the internal difference doesn't matter */
++#define etrax_epid_iso_set(index, data) etrax_epid_set(index, data)
++#define etrax_epid_iso_get(index) etrax_epid_get(index)
++
++
++//static void tc_dma_process_isoc_urb(struct urb *urb);
++static void tc_dma_process_queue(int epid);
++static void tc_dma_unlink_intr_urb(struct urb *urb);
++static irqreturn_t tc_dma_tx_interrupt(int irq, void *vhc);
++static irqreturn_t tc_dma_rx_interrupt(int irq, void *vhc);
++
++static void tc_bulk_start_timer_func(unsigned long dummy);
++static void tc_bulk_eot_timer_func(unsigned long dummy);
++
++
++/*************************************************************/
++/*************************************************************/
++/* Host Controler Driver block */
++/*************************************************************/
++/*************************************************************/
++
++/* HCD operations */
++static irqreturn_t crisv10_hcd_top_irq(int irq, void*);
++static int crisv10_hcd_reset(struct usb_hcd *);
++static int crisv10_hcd_start(struct usb_hcd *);
++static void crisv10_hcd_stop(struct usb_hcd *);
++#ifdef CONFIG_PM
++static int crisv10_hcd_suspend(struct device *, u32, u32);
++static int crisv10_hcd_resume(struct device *, u32);
++#endif /* CONFIG_PM */
++static int crisv10_hcd_get_frame(struct usb_hcd *);
++
++//static int tc_urb_enqueue(struct usb_hcd *, struct usb_host_endpoint *ep, struct urb *, gfp_t mem_flags);
++static int tc_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags);
++//static int tc_urb_dequeue(struct usb_hcd *, struct urb *);
++static int tc_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status);
++static void tc_endpoint_disable(struct usb_hcd *, struct usb_host_endpoint *ep);
++
++static int rh_status_data_request(struct usb_hcd *, char *);
++static int rh_control_request(struct usb_hcd *, u16, u16, u16, char*, u16);
++
++#ifdef CONFIG_PM
++static int crisv10_hcd_hub_suspend(struct usb_hcd *);
++static int crisv10_hcd_hub_resume(struct usb_hcd *);
++#endif /* CONFIG_PM */
++#ifdef CONFIG_USB_OTG
++static int crisv10_hcd_start_port_reset(struct usb_hcd *, unsigned);
++#endif /* CONFIG_USB_OTG */
++
++/* host controller driver interface */
++static const struct hc_driver crisv10_hc_driver =
++ {
++ .description = hc_name,
++ .product_desc = product_desc,
++ .hcd_priv_size = sizeof(struct crisv10_hcd),
++
++ /* Attaching IRQ handler manualy in probe() */
++ /* .irq = crisv10_hcd_irq, */
++
++ .flags = HCD_USB11,
++
++ /* called to init HCD and root hub */
++ .reset = crisv10_hcd_reset,
++ .start = crisv10_hcd_start,
++
++ /* cleanly make HCD stop writing memory and doing I/O */
++ .stop = crisv10_hcd_stop,
++
++ /* return current frame number */
++ .get_frame_number = crisv10_hcd_get_frame,
++
++
++ /* Manage i/o requests via the Transfer Controller */
++ .urb_enqueue = tc_urb_enqueue,
++ .urb_dequeue = tc_urb_dequeue,
++
++ /* hw synch, freeing endpoint resources that urb_dequeue can't */
++ .endpoint_disable = tc_endpoint_disable,
++
++
++ /* Root Hub support */
++ .hub_status_data = rh_status_data_request,
++ .hub_control = rh_control_request,
++#ifdef CONFIG_PM
++ .hub_suspend = rh_suspend_request,
++ .hub_resume = rh_resume_request,
++#endif /* CONFIG_PM */
++#ifdef CONFIG_USB_OTG
++ .start_port_reset = crisv10_hcd_start_port_reset,
++#endif /* CONFIG_USB_OTG */
++ };
++
++
++/*
++ * conversion between pointers to a hcd and the corresponding
++ * crisv10_hcd
++ */
++
++static inline struct crisv10_hcd *hcd_to_crisv10_hcd(struct usb_hcd *hcd)
++{
++ return (struct crisv10_hcd *) hcd->hcd_priv;
++}
++
++static inline struct usb_hcd *crisv10_hcd_to_hcd(struct crisv10_hcd *hcd)
++{
++ return container_of((void *) hcd, struct usb_hcd, hcd_priv);
++}
++
++/* check if specified port is in use */
++static inline int port_in_use(unsigned int port)
++{
++ return ports & (1 << port);
++}
++
++/* number of ports in use */
++static inline unsigned int num_ports(void)
++{
++ unsigned int i, num = 0;
++ for (i = 0; i < USB_ROOT_HUB_PORTS; i++)
++ if (port_in_use(i))
++ num++;
++ return num;
++}
++
++/* map hub port number to the port number used internally by the HC */
++static inline unsigned int map_port(unsigned int port)
++{
++ unsigned int i, num = 0;
++ for (i = 0; i < USB_ROOT_HUB_PORTS; i++)
++ if (port_in_use(i))
++ if (++num == port)
++ return i;
++ return -1;
++}
++
++/* size of descriptors in slab cache */
++#ifndef MAX
++#define MAX(x, y) ((x) > (y) ? (x) : (y))
++#endif
++
++
++/******************************************************************/
++/* Hardware Interrupt functions */
++/******************************************************************/
++
++/* Fast interrupt handler for HC */
++static irqreturn_t crisv10_hcd_top_irq(int irq, void *vcd)
++{
++ struct usb_hcd *hcd = vcd;
++ struct crisv10_irq_reg reg;
++ __u32 irq_mask;
++ unsigned long flags;
++
++ DBFENTER;
++
++ ASSERT(hcd != NULL);
++ reg.hcd = hcd;
++
++ /* Turn of other interrupts while handling these sensitive cases */
++ local_irq_save(flags);
++
++ /* Read out which interrupts that are flaged */
++ irq_mask = *R_USB_IRQ_MASK_READ;
++ reg.r_usb_irq_mask_read = irq_mask;
++
++ /* Reading R_USB_STATUS clears the ctl_status interrupt. Note that
++ R_USB_STATUS must be read before R_USB_EPID_ATTN since reading the latter
++ clears the ourun and perror fields of R_USB_STATUS. */
++ reg.r_usb_status = *R_USB_STATUS;
++
++ /* Reading R_USB_EPID_ATTN clears the iso_eof, bulk_eot and epid_attn
++ interrupts. */
++ reg.r_usb_epid_attn = *R_USB_EPID_ATTN;
++
++ /* Reading R_USB_RH_PORT_STATUS_1 and R_USB_RH_PORT_STATUS_2 clears the
++ port_status interrupt. */
++ reg.r_usb_rh_port_status_1 = *R_USB_RH_PORT_STATUS_1;
++ reg.r_usb_rh_port_status_2 = *R_USB_RH_PORT_STATUS_2;
++
++ /* Reading R_USB_FM_NUMBER clears the sof interrupt. */
++ /* Note: the lower 11 bits contain the actual frame number, sent with each
++ sof. */
++ reg.r_usb_fm_number = *R_USB_FM_NUMBER;
++
++ /* Interrupts are handled in order of priority. */
++ if (irq_mask & IO_MASK(R_USB_IRQ_MASK_READ, port_status)) {
++ crisv10_hcd_port_status_irq(&reg);
++ }
++ if (irq_mask & IO_MASK(R_USB_IRQ_MASK_READ, epid_attn)) {
++ crisv10_hcd_epid_attn_irq(&reg);
++ }
++ if (irq_mask & IO_MASK(R_USB_IRQ_MASK_READ, ctl_status)) {
++ crisv10_hcd_ctl_status_irq(&reg);
++ }
++ if (irq_mask & IO_MASK(R_USB_IRQ_MASK_READ, iso_eof)) {
++ crisv10_hcd_isoc_eof_irq(&reg);
++ }
++ if (irq_mask & IO_MASK(R_USB_IRQ_MASK_READ, bulk_eot)) {
++ /* Update/restart the bulk start timer since obviously the channel is
++ running. */
++ mod_timer(&bulk_start_timer, jiffies + BULK_START_TIMER_INTERVAL);
++ /* Update/restart the bulk eot timer since we just received an bulk eot
++ interrupt. */
++ mod_timer(&bulk_eot_timer, jiffies + BULK_EOT_TIMER_INTERVAL);
++
++ /* Check for finished bulk transfers on epids */
++ check_finished_bulk_tx_epids(hcd, 0);
++ }
++ local_irq_restore(flags);
++
++ DBFEXIT;
++ return IRQ_HANDLED;
++}
++
++
++void crisv10_hcd_epid_attn_irq(struct crisv10_irq_reg *reg) {
++ struct usb_hcd *hcd = reg->hcd;
++ struct crisv10_urb_priv *urb_priv;
++ int epid;
++ DBFENTER;
++
++ for (epid = 0; epid < NBR_OF_EPIDS; epid++) {
++ if (test_bit(epid, (void *)&reg->r_usb_epid_attn)) {
++ struct urb *urb;
++ __u32 ept_data;
++ int error_code;
++
++ if (epid == DUMMY_EPID || epid == INVALID_EPID) {
++ /* We definitely don't care about these ones. Besides, they are
++ always disabled, so any possible disabling caused by the
++ epid attention interrupt is irrelevant. */
++ warn("Got epid_attn for INVALID_EPID or DUMMY_EPID (%d).", epid);
++ continue;
++ }
++
++ if(!epid_inuse(epid)) {
++ irq_err("Epid attention on epid:%d that isn't in use\n", epid);
++ printk("R_USB_STATUS: 0x%x\n", reg->r_usb_status);
++ debug_epid(epid);
++ continue;
++ }
++
++ /* Note that although there are separate R_USB_EPT_DATA and
++ R_USB_EPT_DATA_ISO registers, they are located at the same address and
++ are of the same size. In other words, this read should be ok for isoc
++ also. */
++ ept_data = etrax_epid_get(epid);
++ error_code = IO_EXTRACT(R_USB_EPT_DATA, error_code, ept_data);
++
++ /* Get the active URB for this epid. We blatantly assume
++ that only this URB could have caused the epid attention. */
++ urb = activeUrbList[epid];
++ if (urb == NULL) {
++ irq_err("Attention on epid:%d error:%d with no active URB.\n",
++ epid, error_code);
++ printk("R_USB_STATUS: 0x%x\n", reg->r_usb_status);
++ debug_epid(epid);
++ continue;
++ }
++
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++
++ /* Using IO_STATE_VALUE on R_USB_EPT_DATA should be ok for isoc also. */
++ if (error_code == IO_STATE_VALUE(R_USB_EPT_DATA, error_code, no_error)) {
++
++ /* Isoc traffic doesn't have error_count_in/error_count_out. */
++ if ((usb_pipetype(urb->pipe) != PIPE_ISOCHRONOUS) &&
++ (IO_EXTRACT(R_USB_EPT_DATA, error_count_in, ept_data) == 3 ||
++ IO_EXTRACT(R_USB_EPT_DATA, error_count_out, ept_data) == 3)) {
++ /* Check if URB allready is marked for late-finish, we can get
++ several 3rd error for Intr traffic when a device is unplugged */
++ if(urb_priv->later_data == NULL) {
++ /* 3rd error. */
++ irq_warn("3rd error for epid:%d (%s %s) URB:0x%x[%d]\n", epid,
++ str_dir(urb->pipe), str_type(urb->pipe),
++ (unsigned int)urb, urb_priv->urb_num);
++
++ tc_finish_urb_later(hcd, urb, -EPROTO);
++ }
++
++ } else if (reg->r_usb_status & IO_MASK(R_USB_STATUS, perror)) {
++ irq_warn("Perror for epid:%d\n", epid);
++ printk("FM_NUMBER: %d\n", reg->r_usb_fm_number & 0x7ff);
++ printk("R_USB_STATUS: 0x%x\n", reg->r_usb_status);
++ __dump_urb(urb);
++ debug_epid(epid);
++
++ if (!(ept_data & IO_MASK(R_USB_EPT_DATA, valid))) {
++ /* invalid ep_id */
++ panic("Perror because of invalid epid."
++ " Deconfigured too early?");
++ } else {
++ /* past eof1, near eof, zout transfer, setup transfer */
++ /* Dump the urb and the relevant EP descriptor. */
++ panic("Something wrong with DMA descriptor contents."
++ " Too much traffic inserted?");
++ }
++ } else if (reg->r_usb_status & IO_MASK(R_USB_STATUS, ourun)) {
++ /* buffer ourun */
++ printk("FM_NUMBER: %d\n", reg->r_usb_fm_number & 0x7ff);
++ printk("R_USB_STATUS: 0x%x\n", reg->r_usb_status);
++ __dump_urb(urb);
++ debug_epid(epid);
++
++ panic("Buffer overrun/underrun for epid:%d. DMA too busy?", epid);
++ } else {
++ irq_warn("Attention on epid:%d (%s %s) with no error code\n", epid,
++ str_dir(urb->pipe), str_type(urb->pipe));
++ printk("R_USB_STATUS: 0x%x\n", reg->r_usb_status);
++ __dump_urb(urb);
++ debug_epid(epid);
++ }
++
++ } else if (error_code == IO_STATE_VALUE(R_USB_EPT_DATA, error_code,
++ stall)) {
++ /* Not really a protocol error, just says that the endpoint gave
++ a stall response. Note that error_code cannot be stall for isoc. */
++ if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
++ panic("Isoc traffic cannot stall");
++ }
++
++ tc_dbg("Stall for epid:%d (%s %s) URB:0x%x\n", epid,
++ str_dir(urb->pipe), str_type(urb->pipe), (unsigned int)urb);
++ tc_finish_urb(hcd, urb, -EPIPE);
++
++ } else if (error_code == IO_STATE_VALUE(R_USB_EPT_DATA, error_code,
++ bus_error)) {
++ /* Two devices responded to a transaction request. Must be resolved
++ by software. FIXME: Reset ports? */
++ panic("Bus error for epid %d."
++ " Two devices responded to transaction request\n",
++ epid);
++
++ } else if (error_code == IO_STATE_VALUE(R_USB_EPT_DATA, error_code,
++ buffer_error)) {
++ /* DMA overrun or underrun. */
++ irq_warn("Buffer overrun/underrun for epid:%d (%s %s)\n", epid,
++ str_dir(urb->pipe), str_type(urb->pipe));
++
++ /* It seems that error_code = buffer_error in
++ R_USB_EPT_DATA/R_USB_EPT_DATA_ISO and ourun = yes in R_USB_STATUS
++ are the same error. */
++ tc_finish_urb(hcd, urb, -EPROTO);
++ } else {
++ irq_warn("Unknown attention on epid:%d (%s %s)\n", epid,
++ str_dir(urb->pipe), str_type(urb->pipe));
++ dump_ept_data(epid);
++ }
++ }
++ }
++ DBFEXIT;
++}
++
++void crisv10_hcd_port_status_irq(struct crisv10_irq_reg *reg)
++{
++ __u16 port_reg[USB_ROOT_HUB_PORTS];
++ DBFENTER;
++ port_reg[0] = reg->r_usb_rh_port_status_1;
++ port_reg[1] = reg->r_usb_rh_port_status_2;
++ rh_port_status_change(port_reg);
++ DBFEXIT;
++}
++
++void crisv10_hcd_isoc_eof_irq(struct crisv10_irq_reg *reg)
++{
++ int epid;
++ struct urb *urb;
++ struct crisv10_urb_priv *urb_priv;
++
++ DBFENTER;
++
++ for (epid = 0; epid < NBR_OF_EPIDS - 1; epid++) {
++
++ /* Only check epids that are in use, is valid and has SB list */
++ if (!epid_inuse(epid) || epid == INVALID_EPID ||
++ TxIsocEPList[epid].sub == 0 || epid == DUMMY_EPID) {
++ /* Nothing here to see. */
++ continue;
++ }
++ ASSERT(epid_isoc(epid));
++
++ /* Get the active URB for this epid (if any). */
++ urb = activeUrbList[epid];
++ if (urb == 0) {
++ isoc_warn("Ignoring NULL urb for epid:%d\n", epid);
++ continue;
++ }
++ if(!epid_out_traffic(epid)) {
++ /* Sanity check. */
++ ASSERT(usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS);
++
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++
++ if (urb_priv->urb_state == NOT_STARTED) {
++ /* If ASAP is not set and urb->start_frame is the current frame,
++ start the transfer. */
++ if (!(urb->transfer_flags & URB_ISO_ASAP) &&
++ (urb->start_frame == (*R_USB_FM_NUMBER & 0x7ff))) {
++ /* EP should not be enabled if we're waiting for start_frame */
++ ASSERT((TxIsocEPList[epid].command &
++ IO_STATE(USB_EP_command, enable, yes)) == 0);
++
++ isoc_warn("Enabling isoc IN EP descr for epid %d\n", epid);
++ TxIsocEPList[epid].command |= IO_STATE(USB_EP_command, enable, yes);
++
++ /* This urb is now active. */
++ urb_priv->urb_state = STARTED;
++ continue;
++ }
++ }
++ }
++ }
++
++ DBFEXIT;
++}
++
++void crisv10_hcd_ctl_status_irq(struct crisv10_irq_reg *reg)
++{
++ struct crisv10_hcd* crisv10_hcd = hcd_to_crisv10_hcd(reg->hcd);
++
++ DBFENTER;
++ ASSERT(crisv10_hcd);
++
++ irq_dbg("ctr_status_irq, controller status: %s\n",
++ hcd_status_to_str(reg->r_usb_status));
++
++ /* FIXME: What should we do if we get ourun or perror? Dump the EP and SB
++ list for the corresponding epid? */
++ if (reg->r_usb_status & IO_MASK(R_USB_STATUS, ourun)) {
++ panic("USB controller got ourun.");
++ }
++ if (reg->r_usb_status & IO_MASK(R_USB_STATUS, perror)) {
++
++ /* Before, etrax_usb_do_intr_recover was called on this epid if it was
++ an interrupt pipe. I don't see how re-enabling all EP descriptors
++ will help if there was a programming error. */
++ panic("USB controller got perror.");
++ }
++
++ /* Keep track of USB Controller, if it's running or not */
++ if(reg->r_usb_status & IO_STATE(R_USB_STATUS, running, yes)) {
++ crisv10_hcd->running = 1;
++ } else {
++ crisv10_hcd->running = 0;
++ }
++
++ if (reg->r_usb_status & IO_MASK(R_USB_STATUS, device_mode)) {
++ /* We should never operate in device mode. */
++ panic("USB controller in device mode.");
++ }
++
++ /* Set the flag to avoid getting "Unlink after no-IRQ? Controller is probably
++ using the wrong IRQ" from hcd_unlink_urb() in drivers/usb/core/hcd.c */
++ set_bit(HCD_FLAG_SAW_IRQ, &reg->hcd->flags);
++
++ DBFEXIT;
++}
++
++
++/******************************************************************/
++/* Host Controller interface functions */
++/******************************************************************/
++
++static inline void crisv10_ready_wait(void) {
++ volatile int timeout = 10000;
++ /* Check the busy bit of USB controller in Etrax */
++ while((*R_USB_COMMAND & IO_MASK(R_USB_COMMAND, busy)) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for USB controller to be idle\n");
++ }
++}
++
++/* reset host controller */
++static int crisv10_hcd_reset(struct usb_hcd *hcd)
++{
++ DBFENTER;
++ hcd_dbg(hcd, "reset\n");
++
++
++ /* Reset the USB interface. */
++ /*
++ *R_USB_COMMAND =
++ IO_STATE(R_USB_COMMAND, port_sel, nop) |
++ IO_STATE(R_USB_COMMAND, port_cmd, reset) |
++ IO_STATE(R_USB_COMMAND, ctrl_cmd, reset);
++ nop();
++ */
++ DBFEXIT;
++ return 0;
++}
++
++/* start host controller */
++static int crisv10_hcd_start(struct usb_hcd *hcd)
++{
++ DBFENTER;
++ hcd_dbg(hcd, "start\n");
++
++ crisv10_ready_wait();
++
++ /* Start processing of USB traffic. */
++ *R_USB_COMMAND =
++ IO_STATE(R_USB_COMMAND, port_sel, nop) |
++ IO_STATE(R_USB_COMMAND, port_cmd, reset) |
++ IO_STATE(R_USB_COMMAND, ctrl_cmd, host_run);
++
++ nop();
++
++ hcd->state = HC_STATE_RUNNING;
++
++ DBFEXIT;
++ return 0;
++}
++
++/* stop host controller */
++static void crisv10_hcd_stop(struct usb_hcd *hcd)
++{
++ DBFENTER;
++ hcd_dbg(hcd, "stop\n");
++ crisv10_hcd_reset(hcd);
++ DBFEXIT;
++}
++
++/* return the current frame number */
++static int crisv10_hcd_get_frame(struct usb_hcd *hcd)
++{
++ DBFENTER;
++ DBFEXIT;
++ return (*R_USB_FM_NUMBER & 0x7ff);
++}
++
++#ifdef CONFIG_USB_OTG
++
++static int crisv10_hcd_start_port_reset(struct usb_hcd *hcd, unsigned port)
++{
++ return 0; /* no-op for now */
++}
++
++#endif /* CONFIG_USB_OTG */
++
++
++/******************************************************************/
++/* Root Hub functions */
++/******************************************************************/
++
++/* root hub status */
++static const struct usb_hub_status rh_hub_status =
++ {
++ .wHubStatus = 0,
++ .wHubChange = 0,
++ };
++
++/* root hub descriptor */
++static const u8 rh_hub_descr[] =
++ {
++ 0x09, /* bDescLength */
++ 0x29, /* bDescriptorType */
++ USB_ROOT_HUB_PORTS, /* bNbrPorts */
++ 0x00, /* wHubCharacteristics */
++ 0x00,
++ 0x01, /* bPwrOn2pwrGood */
++ 0x00, /* bHubContrCurrent */
++ 0x00, /* DeviceRemovable */
++ 0xff /* PortPwrCtrlMask */
++ };
++
++/* Actual holder of root hub status*/
++struct crisv10_rh rh;
++
++/* Initialize root hub data structures (called from dvdrv_hcd_probe()) */
++int rh_init(void) {
++ int i;
++ /* Reset port status flags */
++ for (i = 0; i < USB_ROOT_HUB_PORTS; i++) {
++ rh.wPortChange[i] = 0;
++ rh.wPortStatusPrev[i] = 0;
++ }
++ return 0;
++}
++
++#define RH_FEAT_MASK ((1<<USB_PORT_FEAT_CONNECTION)|\
++ (1<<USB_PORT_FEAT_ENABLE)|\
++ (1<<USB_PORT_FEAT_SUSPEND)|\
++ (1<<USB_PORT_FEAT_RESET))
++
++/* Handle port status change interrupt (called from bottom part interrupt) */
++void rh_port_status_change(__u16 port_reg[]) {
++ int i;
++ __u16 wChange;
++
++ for(i = 0; i < USB_ROOT_HUB_PORTS; i++) {
++ /* Xor out changes since last read, masked for important flags */
++ wChange = (port_reg[i] & RH_FEAT_MASK) ^ rh.wPortStatusPrev[i];
++ /* Or changes together with (if any) saved changes */
++ rh.wPortChange[i] |= wChange;
++ /* Save new status */
++ rh.wPortStatusPrev[i] = port_reg[i];
++
++ if(wChange) {
++ rh_dbg("Interrupt port_status change port%d: %s Current-status:%s\n", i+1,
++ port_status_to_str(wChange),
++ port_status_to_str(port_reg[i]));
++ }
++ }
++}
++
++/* Construct port status change bitmap for the root hub */
++static int rh_status_data_request(struct usb_hcd *hcd, char *buf)
++{
++ struct crisv10_hcd* crisv10_hcd = hcd_to_crisv10_hcd(hcd);
++ unsigned int i;
++
++// DBFENTER;
++
++ /*
++ * corresponds to hub status change EP (USB 2.0 spec section 11.13.4)
++ * return bitmap indicating ports with status change
++ */
++ *buf = 0;
++ spin_lock(&crisv10_hcd->lock);
++ for (i = 1; i <= crisv10_hcd->num_ports; i++) {
++ if (rh.wPortChange[map_port(i)]) {
++ *buf |= (1 << i);
++ rh_dbg("rh_status_data_request, change on port %d: %s Current Status: %s\n", i,
++ port_status_to_str(rh.wPortChange[map_port(i)]),
++ port_status_to_str(rh.wPortStatusPrev[map_port(i)]));
++ }
++ }
++ spin_unlock(&crisv10_hcd->lock);
++
++// DBFEXIT;
++
++ return *buf == 0 ? 0 : 1;
++}
++
++/* Handle a control request for the root hub (called from hcd_driver) */
++static int rh_control_request(struct usb_hcd *hcd,
++ u16 typeReq,
++ u16 wValue,
++ u16 wIndex,
++ char *buf,
++ u16 wLength) {
++
++ struct crisv10_hcd *crisv10_hcd = hcd_to_crisv10_hcd(hcd);
++ int retval = 0;
++ int len;
++ DBFENTER;
++
++ switch (typeReq) {
++ case GetHubDescriptor:
++ rh_dbg("GetHubDescriptor\n");
++ len = min_t(unsigned int, sizeof rh_hub_descr, wLength);
++ memcpy(buf, rh_hub_descr, len);
++ buf[2] = crisv10_hcd->num_ports;
++ break;
++ case GetHubStatus:
++ rh_dbg("GetHubStatus\n");
++ len = min_t(unsigned int, sizeof rh_hub_status, wLength);
++ memcpy(buf, &rh_hub_status, len);
++ break;
++ case GetPortStatus:
++ if (!wIndex || wIndex > crisv10_hcd->num_ports)
++ goto error;
++ rh_dbg("GetportStatus, port:%d change:%s status:%s\n", wIndex,
++ port_status_to_str(rh.wPortChange[map_port(wIndex)]),
++ port_status_to_str(rh.wPortStatusPrev[map_port(wIndex)]));
++ *(u16 *) buf = cpu_to_le16(rh.wPortStatusPrev[map_port(wIndex)]);
++ *(u16 *) (buf + 2) = cpu_to_le16(rh.wPortChange[map_port(wIndex)]);
++ break;
++ case SetHubFeature:
++ rh_dbg("SetHubFeature\n");
++ case ClearHubFeature:
++ rh_dbg("ClearHubFeature\n");
++ switch (wValue) {
++ case C_HUB_OVER_CURRENT:
++ case C_HUB_LOCAL_POWER:
++ rh_warn("Not implemented hub request:%d \n", typeReq);
++ /* not implemented */
++ break;
++ default:
++ goto error;
++ }
++ break;
++ case SetPortFeature:
++ if (!wIndex || wIndex > crisv10_hcd->num_ports)
++ goto error;
++ if(rh_set_port_feature(map_port(wIndex), wValue))
++ goto error;
++ break;
++ case ClearPortFeature:
++ if (!wIndex || wIndex > crisv10_hcd->num_ports)
++ goto error;
++ if(rh_clear_port_feature(map_port(wIndex), wValue))
++ goto error;
++ break;
++ default:
++ rh_warn("Unknown hub request: %d\n", typeReq);
++ error:
++ retval = -EPIPE;
++ }
++ DBFEXIT;
++ return retval;
++}
++
++int rh_set_port_feature(__u8 bPort, __u16 wFeature) {
++ __u8 bUsbCommand = 0;
++ switch(wFeature) {
++ case USB_PORT_FEAT_RESET:
++ rh_dbg("SetPortFeature: reset\n");
++ bUsbCommand |= IO_STATE(R_USB_COMMAND, port_cmd, reset);
++ goto set;
++ break;
++ case USB_PORT_FEAT_SUSPEND:
++ rh_dbg("SetPortFeature: suspend\n");
++ bUsbCommand |= IO_STATE(R_USB_COMMAND, port_cmd, suspend);
++ goto set;
++ break;
++ case USB_PORT_FEAT_POWER:
++ rh_dbg("SetPortFeature: power\n");
++ break;
++ case USB_PORT_FEAT_C_CONNECTION:
++ rh_dbg("SetPortFeature: c_connection\n");
++ break;
++ case USB_PORT_FEAT_C_RESET:
++ rh_dbg("SetPortFeature: c_reset\n");
++ break;
++ case USB_PORT_FEAT_C_OVER_CURRENT:
++ rh_dbg("SetPortFeature: c_over_current\n");
++ break;
++
++ set:
++ /* Select which port via the port_sel field */
++ bUsbCommand |= IO_FIELD(R_USB_COMMAND, port_sel, bPort+1);
++
++ /* Make sure the controller isn't busy. */
++ crisv10_ready_wait();
++ /* Send out the actual command to the USB controller */
++ *R_USB_COMMAND = bUsbCommand;
++
++ /* If port reset then also bring USB controller into running state */
++ if(wFeature == USB_PORT_FEAT_RESET) {
++ /* Wait a while for controller to first become started after port reset */
++ udelay(12000); /* 12ms blocking wait */
++
++ /* Make sure the controller isn't busy. */
++ crisv10_ready_wait();
++
++ /* If all enabled ports were disabled the host controller goes down into
++ started mode, so we need to bring it back into the running state.
++ (This is safe even if it's already in the running state.) */
++ *R_USB_COMMAND =
++ IO_STATE(R_USB_COMMAND, port_sel, nop) |
++ IO_STATE(R_USB_COMMAND, port_cmd, reset) |
++ IO_STATE(R_USB_COMMAND, ctrl_cmd, host_run);
++ }
++
++ break;
++ default:
++ rh_dbg("SetPortFeature: unknown feature\n");
++ return -1;
++ }
++ return 0;
++}
++
++int rh_clear_port_feature(__u8 bPort, __u16 wFeature) {
++ switch(wFeature) {
++ case USB_PORT_FEAT_ENABLE:
++ rh_dbg("ClearPortFeature: enable\n");
++ rh_disable_port(bPort);
++ break;
++ case USB_PORT_FEAT_SUSPEND:
++ rh_dbg("ClearPortFeature: suspend\n");
++ break;
++ case USB_PORT_FEAT_POWER:
++ rh_dbg("ClearPortFeature: power\n");
++ break;
++
++ case USB_PORT_FEAT_C_ENABLE:
++ rh_dbg("ClearPortFeature: c_enable\n");
++ goto clear;
++ case USB_PORT_FEAT_C_SUSPEND:
++ rh_dbg("ClearPortFeature: c_suspend\n");
++ goto clear;
++ case USB_PORT_FEAT_C_CONNECTION:
++ rh_dbg("ClearPortFeature: c_connection\n");
++ goto clear;
++ case USB_PORT_FEAT_C_OVER_CURRENT:
++ rh_dbg("ClearPortFeature: c_over_current\n");
++ goto clear;
++ case USB_PORT_FEAT_C_RESET:
++ rh_dbg("ClearPortFeature: c_reset\n");
++ goto clear;
++ clear:
++ rh.wPortChange[bPort] &= ~(1 << (wFeature - 16));
++ break;
++ default:
++ rh_dbg("ClearPortFeature: unknown feature\n");
++ return -1;
++ }
++ return 0;
++}
++
++
++#ifdef CONFIG_PM
++/* Handle a suspend request for the root hub (called from hcd_driver) */
++static int rh_suspend_request(struct usb_hcd *hcd)
++{
++ return 0; /* no-op for now */
++}
++
++/* Handle a resume request for the root hub (called from hcd_driver) */
++static int rh_resume_request(struct usb_hcd *hcd)
++{
++ return 0; /* no-op for now */
++}
++#endif /* CONFIG_PM */
++
++
++
++/* Wrapper function for workaround port disable registers in USB controller */
++static void rh_disable_port(unsigned int port) {
++ volatile int timeout = 10000;
++ volatile char* usb_portx_disable;
++ switch(port) {
++ case 0:
++ usb_portx_disable = R_USB_PORT1_DISABLE;
++ break;
++ case 1:
++ usb_portx_disable = R_USB_PORT2_DISABLE;
++ break;
++ default:
++ /* Invalid port index */
++ return;
++ }
++ /* Set disable flag in special register */
++ *usb_portx_disable = IO_STATE(R_USB_PORT1_DISABLE, disable, yes);
++ /* Wait until not enabled anymore */
++ while((rh.wPortStatusPrev[port] &
++ IO_STATE(R_USB_RH_PORT_STATUS_1, enabled, yes)) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for port %d to become disabled\n", port);
++ }
++ /* clear disable flag in special register */
++ *usb_portx_disable = IO_STATE(R_USB_PORT1_DISABLE, disable, no);
++ rh_info("Physical port %d disabled\n", port+1);
++}
++
++
++/******************************************************************/
++/* Transfer Controller (TC) functions */
++/******************************************************************/
++
++/* FIXME: Should RX_BUF_SIZE be a config option, or maybe we should adjust it
++ dynamically?
++ To adjust it dynamically we would have to get an interrupt when we reach
++ the end of the rx descriptor list, or when we get close to the end, and
++ then allocate more descriptors. */
++#define NBR_OF_RX_DESC 512
++#define RX_DESC_BUF_SIZE 1024
++#define RX_BUF_SIZE (NBR_OF_RX_DESC * RX_DESC_BUF_SIZE)
++
++
++/* Local variables for Transfer Controller */
++/* --------------------------------------- */
++
++/* This is a circular (double-linked) list of the active urbs for each epid.
++ The head is never removed, and new urbs are linked onto the list as
++ urb_entry_t elements. Don't reference urb_list directly; use the wrapper
++ functions instead (which includes spin_locks) */
++static struct list_head urb_list[NBR_OF_EPIDS];
++
++/* Read about the need and usage of this lock in submit_ctrl_urb. */
++/* Lock for URB lists for each EPID */
++static spinlock_t urb_list_lock;
++
++/* Lock for EPID array register (R_USB_EPT_x) in Etrax */
++static spinlock_t etrax_epid_lock;
++
++/* Lock for dma8 sub0 handling */
++static spinlock_t etrax_dma8_sub0_lock;
++
++/* DMA IN cache bug. Align the DMA IN buffers to 32 bytes, i.e. a cache line.
++ Since RX_DESC_BUF_SIZE is 1024 is a multiple of 32, all rx buffers will be
++ cache aligned. */
++static volatile unsigned char RxBuf[RX_BUF_SIZE] __attribute__ ((aligned (32)));
++static volatile struct USB_IN_Desc RxDescList[NBR_OF_RX_DESC] __attribute__ ((aligned (4)));
++
++/* Pointers into RxDescList. */
++static volatile struct USB_IN_Desc *myNextRxDesc;
++static volatile struct USB_IN_Desc *myLastRxDesc;
++
++/* A zout transfer makes a memory access at the address of its buf pointer,
++ which means that setting this buf pointer to 0 will cause an access to the
++ flash. In addition to this, setting sw_len to 0 results in a 16/32 bytes
++ (depending on DMA burst size) transfer.
++ Instead, we set it to 1, and point it to this buffer. */
++static int zout_buffer[4] __attribute__ ((aligned (4)));
++
++/* Cache for allocating new EP and SB descriptors. */
++//static kmem_cache_t *usb_desc_cache;
++static struct kmem_cache *usb_desc_cache;
++
++/* Cache for the data allocated in the isoc descr top half. */
++//static kmem_cache_t *isoc_compl_cache;
++static struct kmem_cache *isoc_compl_cache;
++
++/* Cache for the data allocated when delayed finishing of URBs */
++//static kmem_cache_t *later_data_cache;
++static struct kmem_cache *later_data_cache;
++
++/* Counter to keep track of how many Isoc EP we have sat up. Used to enable
++ and disable iso_eof interrupt. We only need these interrupts when we have
++ Isoc data endpoints (consumes CPU cycles).
++ FIXME: This could be more fine granular, so this interrupt is only enabled
++ when we have a In Isoc URB not URB_ISO_ASAP flaged queued. */
++static int isoc_epid_counter;
++
++/* Protecting wrapper functions for R_USB_EPT_x */
++/* -------------------------------------------- */
++static inline void etrax_epid_set(__u8 index, __u32 data) {
++ unsigned long flags;
++ spin_lock_irqsave(&etrax_epid_lock, flags);
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, index);
++ nop();
++ *R_USB_EPT_DATA = data;
++ spin_unlock_irqrestore(&etrax_epid_lock, flags);
++}
++
++static inline void etrax_epid_clear_error(__u8 index) {
++ unsigned long flags;
++ spin_lock_irqsave(&etrax_epid_lock, flags);
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, index);
++ nop();
++ *R_USB_EPT_DATA &=
++ ~(IO_MASK(R_USB_EPT_DATA, error_count_in) |
++ IO_MASK(R_USB_EPT_DATA, error_count_out) |
++ IO_MASK(R_USB_EPT_DATA, error_code));
++ spin_unlock_irqrestore(&etrax_epid_lock, flags);
++}
++
++static inline void etrax_epid_set_toggle(__u8 index, __u8 dirout,
++ __u8 toggle) {
++ unsigned long flags;
++ spin_lock_irqsave(&etrax_epid_lock, flags);
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, index);
++ nop();
++ if(dirout) {
++ *R_USB_EPT_DATA &= ~IO_MASK(R_USB_EPT_DATA, t_out);
++ *R_USB_EPT_DATA |= IO_FIELD(R_USB_EPT_DATA, t_out, toggle);
++ } else {
++ *R_USB_EPT_DATA &= ~IO_MASK(R_USB_EPT_DATA, t_in);
++ *R_USB_EPT_DATA |= IO_FIELD(R_USB_EPT_DATA, t_in, toggle);
++ }
++ spin_unlock_irqrestore(&etrax_epid_lock, flags);
++}
++
++static inline __u8 etrax_epid_get_toggle(__u8 index, __u8 dirout) {
++ unsigned long flags;
++ __u8 toggle;
++ spin_lock_irqsave(&etrax_epid_lock, flags);
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, index);
++ nop();
++ if (dirout) {
++ toggle = IO_EXTRACT(R_USB_EPT_DATA, t_out, *R_USB_EPT_DATA);
++ } else {
++ toggle = IO_EXTRACT(R_USB_EPT_DATA, t_in, *R_USB_EPT_DATA);
++ }
++ spin_unlock_irqrestore(&etrax_epid_lock, flags);
++ return toggle;
++}
++
++
++static inline __u32 etrax_epid_get(__u8 index) {
++ unsigned long flags;
++ __u32 data;
++ spin_lock_irqsave(&etrax_epid_lock, flags);
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, index);
++ nop();
++ data = *R_USB_EPT_DATA;
++ spin_unlock_irqrestore(&etrax_epid_lock, flags);
++ return data;
++}
++
++
++
++
++/* Main functions for Transfer Controller */
++/* -------------------------------------- */
++
++/* Init structs, memories and lists used by Transfer Controller */
++int tc_init(struct usb_hcd *hcd) {
++ int i;
++ /* Clear software state info for all epids */
++ memset(epid_state, 0, sizeof(struct etrax_epid) * NBR_OF_EPIDS);
++
++ /* Set Invalid and Dummy as being in use and disabled */
++ epid_state[INVALID_EPID].inuse = 1;
++ epid_state[DUMMY_EPID].inuse = 1;
++ epid_state[INVALID_EPID].disabled = 1;
++ epid_state[DUMMY_EPID].disabled = 1;
++
++ /* Clear counter for how many Isoc epids we have sat up */
++ isoc_epid_counter = 0;
++
++ /* Initialize the urb list by initiating a head for each list.
++ Also reset list hodling active URB for each epid */
++ for (i = 0; i < NBR_OF_EPIDS; i++) {
++ INIT_LIST_HEAD(&urb_list[i]);
++ activeUrbList[i] = NULL;
++ }
++
++ /* Init lock for URB lists */
++ spin_lock_init(&urb_list_lock);
++ /* Init lock for Etrax R_USB_EPT register */
++ spin_lock_init(&etrax_epid_lock);
++ /* Init lock for Etrax dma8 sub0 handling */
++ spin_lock_init(&etrax_dma8_sub0_lock);
++
++ /* We use kmem_cache_* to make sure that all DMA desc. are dword aligned */
++
++ /* Note that we specify sizeof(struct USB_EP_Desc) as the size, but also
++ allocate SB descriptors from this cache. This is ok since
++ sizeof(struct USB_EP_Desc) == sizeof(struct USB_SB_Desc). */
++// usb_desc_cache = kmem_cache_create("usb_desc_cache",
++// sizeof(struct USB_EP_Desc), 0,
++// SLAB_HWCACHE_ALIGN, 0, 0);
++ usb_desc_cache = kmem_cache_create(
++ "usb_desc_cache",
++ sizeof(struct USB_EP_Desc),
++ 0,
++ SLAB_HWCACHE_ALIGN,
++ NULL);
++ if(usb_desc_cache == NULL) {
++ return -ENOMEM;
++ }
++
++ /* Create slab cache for speedy allocation of memory for isoc bottom-half
++ interrupt handling */
++// isoc_compl_cache =
++// kmem_cache_create("isoc_compl_cache",
++// sizeof(struct crisv10_isoc_complete_data),
++// 0, SLAB_HWCACHE_ALIGN, 0, 0);
++ isoc_compl_cache = kmem_cache_create(
++ "isoc_compl_cache",
++ sizeof(struct crisv10_isoc_complete_data),
++ 0,
++ SLAB_HWCACHE_ALIGN,
++ NULL
++ );
++
++ if(isoc_compl_cache == NULL) {
++ return -ENOMEM;
++ }
++
++ /* Create slab cache for speedy allocation of memory for later URB finish
++ struct */
++// later_data_cache =
++// kmem_cache_create("later_data_cache",
++// sizeof(struct urb_later_data),
++// 0, SLAB_HWCACHE_ALIGN, 0, 0);
++
++ later_data_cache = kmem_cache_create(
++ "later_data_cache",
++ sizeof(struct urb_later_data),
++ 0,
++ SLAB_HWCACHE_ALIGN,
++ NULL
++ );
++
++ if(later_data_cache == NULL) {
++ return -ENOMEM;
++ }
++
++
++ /* Initiate the bulk start timer. */
++ init_timer(&bulk_start_timer);
++ bulk_start_timer.expires = jiffies + BULK_START_TIMER_INTERVAL;
++ bulk_start_timer.function = tc_bulk_start_timer_func;
++ add_timer(&bulk_start_timer);
++
++
++ /* Initiate the bulk eot timer. */
++ init_timer(&bulk_eot_timer);
++ bulk_eot_timer.expires = jiffies + BULK_EOT_TIMER_INTERVAL;
++ bulk_eot_timer.function = tc_bulk_eot_timer_func;
++ bulk_eot_timer.data = (unsigned long)hcd;
++ add_timer(&bulk_eot_timer);
++
++ return 0;
++}
++
++/* Uninitialize all resources used by Transfer Controller */
++void tc_destroy(void) {
++
++ /* Destroy all slab cache */
++ kmem_cache_destroy(usb_desc_cache);
++ kmem_cache_destroy(isoc_compl_cache);
++ kmem_cache_destroy(later_data_cache);
++
++ /* Remove timers */
++ del_timer(&bulk_start_timer);
++ del_timer(&bulk_eot_timer);
++}
++
++static void restart_dma8_sub0(void) {
++ unsigned long flags;
++ spin_lock_irqsave(&etrax_dma8_sub0_lock, flags);
++ /* Verify that the dma is not running */
++ if ((*R_DMA_CH8_SUB0_CMD & IO_MASK(R_DMA_CH8_SUB0_CMD, cmd)) == 0) {
++ struct USB_EP_Desc *ep = (struct USB_EP_Desc *)phys_to_virt(*R_DMA_CH8_SUB0_EP);
++ while (DUMMY_EPID == IO_EXTRACT(USB_EP_command, epid, ep->command)) {
++ ep = (struct USB_EP_Desc *)phys_to_virt(ep->next);
++ }
++ /* Advance the DMA to the next EP descriptor that is not a DUMMY_EPID.
++ * ep->next is already a physical address. virt_to_phys is needed, see
++ * http://mhonarc.axis.se/dev-etrax/msg08630.html
++ */
++ //*R_DMA_CH8_SUB0_EP = ep->next;
++ *R_DMA_CH8_SUB0_EP = virt_to_phys(ep);
++ /* Restart the DMA */
++ *R_DMA_CH8_SUB0_CMD = IO_STATE(R_DMA_CH8_SUB0_CMD, cmd, start);
++ }
++ spin_unlock_irqrestore(&etrax_dma8_sub0_lock, flags);
++}
++
++/* queue an URB with the transfer controller (called from hcd_driver) */
++//static int tc_urb_enqueue(struct usb_hcd *hcd,
++// struct usb_host_endpoint *ep,
++// struct urb *urb,
++// gfp_t mem_flags) {
++static int tc_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
++{
++ int epid;
++ int retval;
++// int bustime = 0;
++ int maxpacket;
++ unsigned long flags;
++ struct crisv10_urb_priv *urb_priv;
++ struct crisv10_hcd* crisv10_hcd = hcd_to_crisv10_hcd(hcd);
++ DBFENTER;
++
++ if(!(crisv10_hcd->running)) {
++ /* The USB Controller is not running, probably because no device is
++ attached. No idea to enqueue URBs then */
++ tc_warn("Rejected enqueueing of URB:0x%x because no dev attached\n",
++ (unsigned int)urb);
++ return -ENOENT;
++ }
++
++ maxpacket = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe));
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++ /* Special case check for In Isoc transfers. Specification states that each
++ In Isoc transfer consists of one packet and therefore it should fit into
++ the transfer-buffer of an URB.
++ We do the check here to be sure (an invalid scenario can be produced with
++ parameters to the usbtest suite) */
++ if(usb_pipeisoc(urb->pipe) && usb_pipein(urb->pipe) &&
++ (urb->transfer_buffer_length < maxpacket)) {
++ tc_err("Submit In Isoc URB with buffer length:%d to pipe with maxpacketlen: %d\n", urb->transfer_buffer_length, maxpacket);
++ return -EMSGSIZE;
++ }
++
++ /* Check if there is enough bandwidth for periodic transfer */
++ if(usb_pipeint(urb->pipe) || usb_pipeisoc(urb->pipe)) {
++ /* only check (and later claim) if not already claimed */
++ if (urb->bandwidth == 0) {
++ bustime = usb_check_bandwidth(urb->dev, urb);
++ if (bustime < 0) {
++ tc_err("Not enough periodic bandwidth\n");
++ return -ENOSPC;
++ }
++ }
++ }
++#endif
++
++ /* Check if there is a epid for URBs destination, if not this function
++ set up one. */
++ //epid = tc_setup_epid(ep, urb, mem_flags);
++ epid = tc_setup_epid(urb, mem_flags);
++ if (epid < 0) {
++ tc_err("Failed setup epid:%d for URB:0x%x\n", epid, (unsigned int)urb);
++ DBFEXIT;
++ return -ENOMEM;
++ }
++
++ if(urb == activeUrbList[epid]) {
++ tc_err("Resubmition of allready active URB:0x%x\n", (unsigned int)urb);
++ return -ENXIO;
++ }
++
++ if(urb_list_entry(urb, epid)) {
++ tc_err("Resubmition of allready queued URB:0x%x\n", (unsigned int)urb);
++ return -ENXIO;
++ }
++
++ /* If we actively have flaged endpoint as disabled then refuse submition */
++ if(epid_state[epid].disabled) {
++ return -ENOENT;
++ }
++
++ /* Allocate and init HC-private data for URB */
++ if(urb_priv_create(hcd, urb, epid, mem_flags) != 0) {
++ DBFEXIT;
++ return -ENOMEM;
++ }
++ urb_priv = urb->hcpriv;
++
++ tc_dbg("Enqueue URB:0x%x[%d] epid:%d (%s) bufflen:%d\n",
++ (unsigned int)urb, urb_priv->urb_num, epid,
++ pipe_to_str(urb->pipe), urb->transfer_buffer_length);
++
++ /* Create and link SBs required for this URB */
++ retval = create_sb_for_urb(urb, mem_flags);
++ if(retval != 0) {
++ tc_err("Failed to create SBs for URB:0x%x[%d]\n", (unsigned int)urb,
++ urb_priv->urb_num);
++ urb_priv_free(hcd, urb);
++ DBFEXIT;
++ return retval;
++ }
++
++ /* Init intr EP pool if this URB is a INTR transfer. This pool is later
++ used when inserting EPs in the TxIntrEPList. We do the alloc here
++ so we can't run out of memory later */
++ if(usb_pipeint(urb->pipe)) {
++ retval = init_intr_urb(urb, mem_flags);
++ if(retval != 0) {
++ tc_warn("Failed to init Intr URB\n");
++ urb_priv_free(hcd, urb);
++ DBFEXIT;
++ return retval;
++ }
++ }
++
++ /* Disable other access when inserting USB */
++
++ /* BUG on sleeping inside int disabled if using local_irq_save/local_irq_restore
++ * her - because urb_list_add() and tc_dma_process_queue() save irqs again !??!
++ */
++// local_irq_save(flags);
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++ /* Claim bandwidth, if needed */
++ if(bustime) {
++ usb_claim_bandwidth(urb->dev, urb, bustime, 0);
++ }
++
++ /* Add URB to EP queue */
++ urb_list_add(urb, epid, mem_flags);
++
++ if(usb_pipeisoc(urb->pipe)) {
++ /* Special processing of Isoc URBs. */
++ tc_dma_process_isoc_urb(urb);
++ } else {
++ /* Process EP queue for rest of the URB types (Bulk, Ctrl, Intr) */
++ tc_dma_process_queue(epid);
++ }
++#endif
++ /* Add URB to EP queue */
++ urb_list_add(urb, epid, mem_flags);
++
++ /*hinko link/unlink urb -> ep */
++ spin_lock_irqsave(&crisv10_hcd->lock, flags);
++ //spin_lock(&crisv10_hcd->lock);
++ retval = usb_hcd_link_urb_to_ep(hcd, urb);
++ if (retval) {
++ spin_unlock_irqrestore(&crisv10_hcd->lock, flags);
++ tc_warn("Failed to link urb to ep\n");
++ urb_priv_free(hcd, urb);
++ DBFEXIT;
++ return retval;
++ }
++ spin_unlock_irqrestore(&crisv10_hcd->lock, flags);
++ //spin_unlock(&crisv10_hcd->lock);
++
++ /* Process EP queue for rest of the URB types (Bulk, Ctrl, Intr) */
++ tc_dma_process_queue(epid);
++
++// local_irq_restore(flags);
++
++ DBFEXIT;
++ return 0;
++}
++
++/* remove an URB from the transfer controller queues (called from hcd_driver)*/
++//static int tc_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
++static int tc_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
++{
++ struct crisv10_urb_priv *urb_priv;
++ unsigned long flags;
++ int epid;
++
++ DBFENTER;
++ /* Disable interrupts here since a descriptor interrupt for the isoc epid
++ will modify the sb list. This could possibly be done more granular, but
++ urb_dequeue should not be used frequently anyway.
++ */
++ local_irq_save(flags);
++
++ urb_priv = urb->hcpriv;
++
++ if (!urb_priv) {
++ /* This happens if a device driver calls unlink on an urb that
++ was never submitted (lazy driver) or if the urb was completed
++ while dequeue was being called. */
++ tc_warn("Dequeing of not enqueued URB:0x%x\n", (unsigned int)urb);
++ local_irq_restore(flags);
++ return 0;
++ }
++ epid = urb_priv->epid;
++
++ tc_warn("Dequeing %s URB:0x%x[%d] (%s %s epid:%d) status:%d %s\n",
++ (urb == activeUrbList[epid]) ? "active" : "queued",
++ (unsigned int)urb, urb_priv->urb_num, str_dir(urb->pipe),
++ str_type(urb->pipe), epid, urb->status,
++ (urb_priv->later_data) ? "later-sched" : "");
++
++ /* For Bulk, Ctrl and Intr are only one URB active at a time. So any URB
++ that isn't active can be dequeued by just removing it from the queue */
++ if(usb_pipebulk(urb->pipe) || usb_pipecontrol(urb->pipe) ||
++ usb_pipeint(urb->pipe)) {
++
++ /* Check if URB haven't gone further than the queue */
++ if(urb != activeUrbList[epid]) {
++ ASSERT(urb_priv->later_data == NULL);
++ tc_warn("Dequeing URB:0x%x[%d] (%s %s epid:%d) from queue"
++ " (not active)\n", (unsigned int)urb, urb_priv->urb_num,
++ str_dir(urb->pipe), str_type(urb->pipe), epid);
++
++ /* Finish the URB with error status from USB core */
++ tc_finish_urb(hcd, urb, urb->status);
++ local_irq_restore(flags);
++ return 0;
++ }
++ }
++
++ /* Set URB status to Unlink for handling when interrupt comes. */
++ urb_priv->urb_state = UNLINK;
++
++ /* Differentiate dequeing of Bulk and Ctrl from Isoc and Intr */
++ switch(usb_pipetype(urb->pipe)) {
++ case PIPE_BULK:
++ /* Check if EP still is enabled */
++ if (TxBulkEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ /* The EP was enabled, disable it. */
++ TxBulkEPList[epid].command &= ~IO_MASK(USB_EP_command, enable);
++ }
++ /* Kicking dummy list out of the party. */
++ TxBulkEPList[epid].next = virt_to_phys(&TxBulkEPList[(epid + 1) % NBR_OF_EPIDS]);
++ break;
++ case PIPE_CONTROL:
++ /* Check if EP still is enabled */
++ if (TxCtrlEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ /* The EP was enabled, disable it. */
++ TxCtrlEPList[epid].command &= ~IO_MASK(USB_EP_command, enable);
++ }
++ break;
++ case PIPE_ISOCHRONOUS:
++ /* Disabling, busy-wait and unlinking of Isoc SBs will be done in
++ finish_isoc_urb(). Because there might the case when URB is dequeued
++ but there are other valid URBs waiting */
++
++ /* Check if In Isoc EP still is enabled */
++ if (TxIsocEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ /* The EP was enabled, disable it. */
++ TxIsocEPList[epid].command &= ~IO_MASK(USB_EP_command, enable);
++ }
++ break;
++ case PIPE_INTERRUPT:
++ /* Special care is taken for interrupt URBs. EPs are unlinked in
++ tc_finish_urb */
++ break;
++ default:
++ break;
++ }
++
++ /* Asynchronous unlink, finish the URB later from scheduled or other
++ event (data finished, error) */
++ tc_finish_urb_later(hcd, urb, urb->status);
++
++ local_irq_restore(flags);
++ DBFEXIT;
++ return 0;
++}
++
++
++static void tc_sync_finish_epid(struct usb_hcd *hcd, int epid) {
++ volatile int timeout = 10000;
++ struct urb* urb;
++ struct crisv10_urb_priv* urb_priv;
++ unsigned long flags;
++
++ volatile struct USB_EP_Desc *first_ep; /* First EP in the list. */
++ volatile struct USB_EP_Desc *curr_ep; /* Current EP, the iterator. */
++ volatile struct USB_EP_Desc *next_ep; /* The EP after current. */
++
++ int type = epid_state[epid].type;
++
++ /* Setting this flag will cause enqueue() to return -ENOENT for new
++ submitions on this endpoint and finish_urb() wont process queue further */
++ epid_state[epid].disabled = 1;
++
++ switch(type) {
++ case PIPE_BULK:
++ /* Check if EP still is enabled */
++ if (TxBulkEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ /* The EP was enabled, disable it. */
++ TxBulkEPList[epid].command &= ~IO_MASK(USB_EP_command, enable);
++ tc_warn("sync_finish: Disabling EP for epid:%d\n", epid);
++
++ /* Do busy-wait until DMA not using this EP descriptor anymore */
++ while((*R_DMA_CH8_SUB0_EP ==
++ virt_to_phys(&TxBulkEPList[epid])) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for DMA-TX-Bulk to leave EP for"
++ " epid:%d\n", epid);
++ }
++ }
++ break;
++
++ case PIPE_CONTROL:
++ /* Check if EP still is enabled */
++ if (TxCtrlEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ /* The EP was enabled, disable it. */
++ TxCtrlEPList[epid].command &= ~IO_MASK(USB_EP_command, enable);
++ tc_warn("sync_finish: Disabling EP for epid:%d\n", epid);
++
++ /* Do busy-wait until DMA not using this EP descriptor anymore */
++ while((*R_DMA_CH8_SUB1_EP ==
++ virt_to_phys(&TxCtrlEPList[epid])) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for DMA-TX-Ctrl to leave EP for"
++ " epid:%d\n", epid);
++ }
++ }
++ break;
++
++ case PIPE_INTERRUPT:
++ local_irq_save(flags);
++ /* Disable all Intr EPs belonging to epid */
++ first_ep = &TxIntrEPList[0];
++ curr_ep = first_ep;
++ do {
++ next_ep = (struct USB_EP_Desc *)phys_to_virt(curr_ep->next);
++ if (IO_EXTRACT(USB_EP_command, epid, next_ep->command) == epid) {
++ /* Disable EP */
++ next_ep->command &= ~IO_MASK(USB_EP_command, enable);
++ }
++ curr_ep = phys_to_virt(curr_ep->next);
++ } while (curr_ep != first_ep);
++
++ local_irq_restore(flags);
++ break;
++
++ case PIPE_ISOCHRONOUS:
++ /* Check if EP still is enabled */
++ if (TxIsocEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ tc_warn("sync_finish: Disabling Isoc EP for epid:%d\n", epid);
++ /* The EP was enabled, disable it. */
++ TxIsocEPList[epid].command &= ~IO_MASK(USB_EP_command, enable);
++
++ while((*R_DMA_CH8_SUB3_EP == virt_to_phys(&TxIsocEPList[epid])) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for DMA-TX-Isoc to leave EP for"
++ " epid:%d\n", epid);
++ }
++ }
++ break;
++ }
++
++ local_irq_save(flags);
++
++ /* Finish if there is active URB for this endpoint */
++ if(activeUrbList[epid] != NULL) {
++ urb = activeUrbList[epid];
++ urb_priv = urb->hcpriv;
++ ASSERT(urb_priv);
++ tc_warn("Sync finish %s URB:0x%x[%d] (%s %s epid:%d) status:%d %s\n",
++ (urb == activeUrbList[epid]) ? "active" : "queued",
++ (unsigned int)urb, urb_priv->urb_num, str_dir(urb->pipe),
++ str_type(urb->pipe), epid, urb->status,
++ (urb_priv->later_data) ? "later-sched" : "");
++
++ tc_finish_urb(hcd, activeUrbList[epid], -ENOENT);
++ ASSERT(activeUrbList[epid] == NULL);
++ }
++
++ /* Finish any queued URBs for this endpoint. There won't be any resubmitions
++ because epid_disabled causes enqueue() to fail for this endpoint */
++ while((urb = urb_list_first(epid)) != NULL) {
++ urb_priv = urb->hcpriv;
++ ASSERT(urb_priv);
++
++ tc_warn("Sync finish %s URB:0x%x[%d] (%s %s epid:%d) status:%d %s\n",
++ (urb == activeUrbList[epid]) ? "active" : "queued",
++ (unsigned int)urb, urb_priv->urb_num, str_dir(urb->pipe),
++ str_type(urb->pipe), epid, urb->status,
++ (urb_priv->later_data) ? "later-sched" : "");
++
++ tc_finish_urb(hcd, urb, -ENOENT);
++ }
++ epid_state[epid].disabled = 0;
++ local_irq_restore(flags);
++}
++
++/* free resources associated with an endpoint (called from hcd_driver) */
++static void tc_endpoint_disable(struct usb_hcd *hcd,
++ struct usb_host_endpoint *ep) {
++ DBFENTER;
++ /* Only free epid if it has been allocated. We get two endpoint_disable
++ requests for ctrl endpoints so ignore the second one */
++ if(ep->hcpriv != NULL) {
++ struct crisv10_ep_priv *ep_priv = ep->hcpriv;
++ int epid = ep_priv->epid;
++ tc_warn("endpoint_disable ep:0x%x ep-priv:0x%x (%s) (epid:%d freed)\n",
++ (unsigned int)ep, (unsigned int)ep->hcpriv,
++ endpoint_to_str(&(ep->desc)), epid);
++
++ tc_sync_finish_epid(hcd, epid);
++
++ ASSERT(activeUrbList[epid] == NULL);
++ ASSERT(list_empty(&urb_list[epid]));
++
++ tc_free_epid(ep);
++ } else {
++ tc_dbg("endpoint_disable ep:0x%x ep-priv:0x%x (%s)\n", (unsigned int)ep,
++ (unsigned int)ep->hcpriv, endpoint_to_str(&(ep->desc)));
++ }
++ DBFEXIT;
++}
++
++//static void tc_finish_urb_later_proc(void *data) {
++static void tc_finish_urb_later_proc(struct work_struct *work) {
++ unsigned long flags;
++ //struct urb_later_data* uld = (struct urb_later_data*)data;
++ struct urb_later_data* uld = container_of(work, struct urb_later_data, ws.work);
++ local_irq_save(flags);
++ if(uld->urb == NULL) {
++ late_dbg("Later finish of URB = NULL (allready finished)\n");
++ } else {
++ struct crisv10_urb_priv* urb_priv = uld->urb->hcpriv;
++ ASSERT(urb_priv);
++ if(urb_priv->urb_num == uld->urb_num) {
++ late_dbg("Later finish of URB:0x%x[%d]\n", (unsigned int)(uld->urb),
++ urb_priv->urb_num);
++ if(uld->status != uld->urb->status) {
++ errno_dbg("Later-finish URB with status:%d, later-status:%d\n",
++ uld->urb->status, uld->status);
++ }
++ if(uld != urb_priv->later_data) {
++ panic("Scheduled uld not same as URBs uld\n");
++ }
++ tc_finish_urb(uld->hcd, uld->urb, uld->status);
++ } else {
++ late_warn("Ignoring later finish of URB:0x%x[%d]"
++ ", urb_num doesn't match current URB:0x%x[%d]",
++ (unsigned int)(uld->urb), uld->urb_num,
++ (unsigned int)(uld->urb), urb_priv->urb_num);
++ }
++ }
++ local_irq_restore(flags);
++ kmem_cache_free(later_data_cache, uld);
++}
++
++static void tc_finish_urb_later(struct usb_hcd *hcd, struct urb *urb,
++ int status) {
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ struct urb_later_data* uld;
++
++ ASSERT(urb_priv);
++
++ if(urb_priv->later_data != NULL) {
++ /* Later-finish allready scheduled for this URB, just update status to
++ return when finishing later */
++ errno_dbg("Later-finish schedule change URB status:%d with new"
++ " status:%d\n", urb_priv->later_data->status, status);
++
++ urb_priv->later_data->status = status;
++ return;
++ }
++
++ uld = kmem_cache_alloc(later_data_cache, GFP_ATOMIC);
++ ASSERT(uld);
++
++ uld->hcd = hcd;
++ uld->urb = urb;
++ uld->urb_num = urb_priv->urb_num;
++ uld->status = status;
++
++ //INIT_WORK(&uld->ws, tc_finish_urb_later_proc, uld);
++ INIT_DELAYED_WORK(&uld->ws, tc_finish_urb_later_proc);
++ urb_priv->later_data = uld;
++
++ /* Schedule the finishing of the URB to happen later */
++ schedule_delayed_work(&uld->ws, LATER_TIMER_DELAY);
++}
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++static void tc_finish_isoc_urb(struct usb_hcd *hcd, struct urb *urb,
++ int status);
++#endif
++
++static void tc_finish_urb(struct usb_hcd *hcd, struct urb *urb, int status) {
++ struct crisv10_hcd* crisv10_hcd = hcd_to_crisv10_hcd(hcd);
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ int epid;
++ char toggle;
++ int urb_num;
++
++ DBFENTER;
++ ASSERT(urb_priv != NULL);
++ epid = urb_priv->epid;
++ urb_num = urb_priv->urb_num;
++
++ if(urb != activeUrbList[epid]) {
++ if(urb_list_entry(urb, epid)) {
++ /* Remove this URB from the list. Only happens when URB are finished
++ before having been processed (dequeing) */
++ urb_list_del(urb, epid);
++ } else {
++ tc_warn("Finishing of URB:0x%x[%d] neither active or in queue for"
++ " epid:%d\n", (unsigned int)urb, urb_num, epid);
++ }
++ }
++
++ /* Cancel any pending later-finish of this URB */
++ if(urb_priv->later_data) {
++ urb_priv->later_data->urb = NULL;
++ }
++
++ /* For an IN pipe, we always set the actual length, regardless of whether
++ there was an error or not (which means the device driver can use the data
++ if it wants to). */
++ if(usb_pipein(urb->pipe)) {
++ urb->actual_length = urb_priv->rx_offset;
++ } else {
++ /* Set actual_length for OUT urbs also; the USB mass storage driver seems
++ to want that. */
++ if (status == 0 && urb->status == -EINPROGRESS) {
++ urb->actual_length = urb->transfer_buffer_length;
++ } else {
++ /* We wouldn't know of any partial writes if there was an error. */
++ urb->actual_length = 0;
++ }
++ }
++
++
++ /* URB status mangling */
++ if(urb->status == -EINPROGRESS) {
++ /* The USB core hasn't changed the status, let's set our finish status */
++ urb->status = status;
++
++ if ((status == 0) && (urb->transfer_flags & URB_SHORT_NOT_OK) &&
++ usb_pipein(urb->pipe) &&
++ (urb->actual_length != urb->transfer_buffer_length)) {
++ /* URB_SHORT_NOT_OK means that short reads (shorter than the endpoint's
++ max length) is to be treated as an error. */
++ errno_dbg("Finishing URB:0x%x[%d] with SHORT_NOT_OK flag and short"
++ " data:%d\n", (unsigned int)urb, urb_num,
++ urb->actual_length);
++ urb->status = -EREMOTEIO;
++ }
++
++ if(urb_priv->urb_state == UNLINK) {
++ /* URB has been requested to be unlinked asynchronously */
++ urb->status = -ECONNRESET;
++ errno_dbg("Fixing unlink status of URB:0x%x[%d] to:%d\n",
++ (unsigned int)urb, urb_num, urb->status);
++ }
++ } else {
++ /* The USB Core wants to signal some error via the URB, pass it through */
++ }
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++ /* use completely different finish function for Isoc URBs */
++ if(usb_pipeisoc(urb->pipe)) {
++ tc_finish_isoc_urb(hcd, urb, status);
++ return;
++ }
++#endif
++
++ /* Do special unlinking of EPs for Intr traffic */
++ if(usb_pipeint(urb->pipe)) {
++ tc_dma_unlink_intr_urb(urb);
++ }
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++ /* Release allocated bandwidth for periodic transfers */
++ if(usb_pipeint(urb->pipe) || usb_pipeisoc(urb->pipe))
++ usb_release_bandwidth(urb->dev, urb, 0);
++#endif
++
++ /* This URB is active on EP */
++ if(urb == activeUrbList[epid]) {
++ /* We need to fiddle with the toggle bits because the hardware doesn't do
++ it for us. */
++ toggle = etrax_epid_get_toggle(epid, usb_pipeout(urb->pipe));
++ usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
++ usb_pipeout(urb->pipe), toggle);
++
++ /* Checks for Ctrl and Bulk EPs */
++ switch(usb_pipetype(urb->pipe)) {
++ case PIPE_BULK:
++ /* Check so Bulk EP realy is disabled before finishing active URB */
++ ASSERT((TxBulkEPList[epid].command & IO_MASK(USB_EP_command, enable)) ==
++ IO_STATE(USB_EP_command, enable, no));
++ /* Disable sub-pointer for EP to avoid next tx_interrupt() to
++ process Bulk EP. */
++ TxBulkEPList[epid].sub = 0;
++ /* No need to wait for the DMA before changing the next pointer.
++ The modulo NBR_OF_EPIDS isn't actually necessary, since we will never use
++ the last one (INVALID_EPID) for actual traffic. */
++ TxBulkEPList[epid].next =
++ virt_to_phys(&TxBulkEPList[(epid + 1) % NBR_OF_EPIDS]);
++ break;
++ case PIPE_CONTROL:
++ /* Check so Ctrl EP realy is disabled before finishing active URB */
++ ASSERT((TxCtrlEPList[epid].command & IO_MASK(USB_EP_command, enable)) ==
++ IO_STATE(USB_EP_command, enable, no));
++ /* Disable sub-pointer for EP to avoid next tx_interrupt() to
++ process Ctrl EP. */
++ TxCtrlEPList[epid].sub = 0;
++ break;
++ }
++ }
++
++ /* Free HC-private URB data*/
++ urb_priv_free(hcd, urb);
++
++ if(urb->status) {
++ errno_dbg("finish_urb (URB:0x%x[%d] %s %s) (data:%d) status:%d\n",
++ (unsigned int)urb, urb_num, str_dir(urb->pipe),
++ str_type(urb->pipe), urb->actual_length, urb->status);
++ } else {
++ tc_dbg("finish_urb (URB:0x%x[%d] %s %s) (data:%d) status:%d\n",
++ (unsigned int)urb, urb_num, str_dir(urb->pipe),
++ str_type(urb->pipe), urb->actual_length, urb->status);
++ }
++
++ /* If we just finished an active URB, clear active pointer. */
++ if (urb == activeUrbList[epid]) {
++ /* Make URB not active on EP anymore */
++ activeUrbList[epid] = NULL;
++
++ if(urb->status == 0) {
++ /* URB finished sucessfully, process queue to see if there are any more
++ URBs waiting before we call completion function.*/
++ if(crisv10_hcd->running) {
++ /* Only process queue if USB controller is running */
++ tc_dma_process_queue(epid);
++ } else {
++ tc_warn("No processing of queue for epid:%d, USB Controller not"
++ " running\n", epid);
++ }
++ }
++ }
++
++ /* Hand the URB from HCD to its USB device driver, using its completion
++ functions */
++// usb_hcd_giveback_urb (hcd, urb);
++ /**
++ * usb_hcd_unlink_urb_from_ep - remove an URB from its endpoint queue
++ * @hcd: host controller to which @urb was submitted
++ * @urb: URB being unlinked
++ *
++ * Host controller drivers should call this routine before calling
++ * usb_hcd_giveback_urb(). The HCD's private spinlock must be held and
++ * interrupts must be disabled. The actions carried out here are required
++ * for URB completion.
++ */
++
++ /*hinko link/unlink urb -> ep */
++ //spin_lock(&crisv10_hcd->lock);
++ unsigned long flags;
++ spin_lock_irqsave(&crisv10_hcd->lock, flags);
++ usb_hcd_unlink_urb_from_ep(hcd, urb);
++ usb_hcd_giveback_urb(hcd, urb, status);
++ //spin_unlock(&crisv10_hcd->lock);
++ spin_unlock_irqrestore(&crisv10_hcd->lock, flags);
++
++ /* Check the queue once more if the URB returned with error, because we
++ didn't do it before the completion function because the specification
++ states that the queue should not restart until all it's unlinked
++ URBs have been fully retired, with the completion functions run */
++ if(crisv10_hcd->running) {
++ /* Only process queue if USB controller is running */
++ tc_dma_process_queue(epid);
++ } else {
++ tc_warn("No processing of queue for epid:%d, USB Controller not running\n",
++ epid);
++ }
++
++ DBFEXIT;
++}
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++static void tc_finish_isoc_urb(struct usb_hcd *hcd, struct urb *urb,
++ int status) {
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ int epid, i;
++ volatile int timeout = 10000;
++
++ ASSERT(urb_priv);
++ epid = urb_priv->epid;
++
++ ASSERT(usb_pipeisoc(urb->pipe));
++
++ /* Set that all isoc packets have status and length set before
++ completing the urb. */
++ for (i = urb_priv->isoc_packet_counter; i < urb->number_of_packets; i++){
++ urb->iso_frame_desc[i].actual_length = 0;
++ urb->iso_frame_desc[i].status = -EPROTO;
++ }
++
++ /* Check if the URB is currently active (done or error) */
++ if(urb == activeUrbList[epid]) {
++ /* Check if there are another In Isoc URB queued for this epid */
++ if (!list_empty(&urb_list[epid])&& !epid_state[epid].disabled) {
++ /* Move it from queue to active and mark it started so Isoc transfers
++ won't be interrupted.
++ All Isoc URBs data transfers are already added to DMA lists so we
++ don't have to insert anything in DMA lists here. */
++ activeUrbList[epid] = urb_list_first(epid);
++ ((struct crisv10_urb_priv *)(activeUrbList[epid]->hcpriv))->urb_state =
++ STARTED;
++ urb_list_del(activeUrbList[epid], epid);
++
++ if(urb->status) {
++ errno_dbg("finish_isoc_urb (URB:0x%x[%d] %s %s) (%d of %d packets)"
++ " status:%d, new waiting URB:0x%x[%d]\n",
++ (unsigned int)urb, urb_priv->urb_num, str_dir(urb->pipe),
++ str_type(urb->pipe), urb_priv->isoc_packet_counter,
++ urb->number_of_packets, urb->status,
++ (unsigned int)activeUrbList[epid],
++ ((struct crisv10_urb_priv *)(activeUrbList[epid]->hcpriv))->urb_num);
++ }
++
++ } else { /* No other URB queued for this epid */
++ if(urb->status) {
++ errno_dbg("finish_isoc_urb (URB:0x%x[%d] %s %s) (%d of %d packets)"
++ " status:%d, no new URB waiting\n",
++ (unsigned int)urb, urb_priv->urb_num, str_dir(urb->pipe),
++ str_type(urb->pipe), urb_priv->isoc_packet_counter,
++ urb->number_of_packets, urb->status);
++ }
++
++ /* Check if EP is still enabled, then shut it down. */
++ if (TxIsocEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ isoc_dbg("Isoc EP enabled for epid:%d, disabling it\n", epid);
++
++ /* Should only occur for In Isoc EPs where SB isn't consumed. */
++ ASSERT(usb_pipein(urb->pipe));
++
++ /* Disable it and wait for it to stop */
++ TxIsocEPList[epid].command &= ~IO_MASK(USB_EP_command, enable);
++
++ /* Ah, the luxury of busy-wait. */
++ while((*R_DMA_CH8_SUB3_EP == virt_to_phys(&TxIsocEPList[epid])) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for DMA-TX-Isoc to leave EP for epid:%d\n", epid);
++ }
++ }
++
++ /* Unlink SB to say that epid is finished. */
++ TxIsocEPList[epid].sub = 0;
++ TxIsocEPList[epid].hw_len = 0;
++
++ /* No URB active for EP anymore */
++ activeUrbList[epid] = NULL;
++ }
++ } else { /* Finishing of not active URB (queued up with SBs thought) */
++ isoc_warn("finish_isoc_urb (URB:0x%x %s) (%d of %d packets) status:%d,"
++ " SB queued but not active\n",
++ (unsigned int)urb, str_dir(urb->pipe),
++ urb_priv->isoc_packet_counter, urb->number_of_packets,
++ urb->status);
++ if(usb_pipeout(urb->pipe)) {
++ /* Finishing of not yet active Out Isoc URB needs unlinking of SBs. */
++ struct USB_SB_Desc *iter_sb, *prev_sb, *next_sb;
++
++ iter_sb = TxIsocEPList[epid].sub ?
++ phys_to_virt(TxIsocEPList[epid].sub) : 0;
++ prev_sb = 0;
++
++ /* SB that is linked before this URBs first SB */
++ while (iter_sb && (iter_sb != urb_priv->first_sb)) {
++ prev_sb = iter_sb;
++ iter_sb = iter_sb->next ? phys_to_virt(iter_sb->next) : 0;
++ }
++
++ if (iter_sb == 0) {
++ /* Unlink of the URB currently being transmitted. */
++ prev_sb = 0;
++ iter_sb = TxIsocEPList[epid].sub ? phys_to_virt(TxIsocEPList[epid].sub) : 0;
++ }
++
++ while (iter_sb && (iter_sb != urb_priv->last_sb)) {
++ iter_sb = iter_sb->next ? phys_to_virt(iter_sb->next) : 0;
++ }
++
++ if (iter_sb) {
++ next_sb = iter_sb->next ? phys_to_virt(iter_sb->next) : 0;
++ } else {
++ /* This should only happen if the DMA has completed
++ processing the SB list for this EP while interrupts
++ are disabled. */
++ isoc_dbg("Isoc urb not found, already sent?\n");
++ next_sb = 0;
++ }
++ if (prev_sb) {
++ prev_sb->next = next_sb ? virt_to_phys(next_sb) : 0;
++ } else {
++ TxIsocEPList[epid].sub = next_sb ? virt_to_phys(next_sb) : 0;
++ }
++ }
++ }
++
++ /* Free HC-private URB data*/
++ urb_priv_free(hcd, urb);
++
++ usb_release_bandwidth(urb->dev, urb, 0);
++
++ /* Hand the URB from HCD to its USB device driver, using its completion
++ functions */
++ usb_hcd_giveback_urb (hcd, urb);
++}
++#endif
++
++static __u32 urb_num = 0;
++
++/* allocate and initialize URB private data */
++static int urb_priv_create(struct usb_hcd *hcd, struct urb *urb, int epid,
++ int mem_flags) {
++ struct crisv10_urb_priv *urb_priv;
++
++ urb_priv = kmalloc(sizeof *urb_priv, mem_flags);
++ if (!urb_priv)
++ return -ENOMEM;
++ memset(urb_priv, 0, sizeof *urb_priv);
++
++ urb_priv->epid = epid;
++ urb_priv->urb_state = NOT_STARTED;
++
++ urb->hcpriv = urb_priv;
++ /* Assign URB a sequence number, and increment counter */
++ urb_priv->urb_num = urb_num;
++ urb_num++;
++ return 0;
++}
++
++/* free URB private data */
++static void urb_priv_free(struct usb_hcd *hcd, struct urb *urb) {
++ int i;
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ ASSERT(urb_priv != 0);
++
++ /* Check it has any SBs linked that needs to be freed*/
++ if(urb_priv->first_sb != NULL) {
++ struct USB_SB_Desc *next_sb, *first_sb, *last_sb;
++ int i = 0;
++ first_sb = urb_priv->first_sb;
++ last_sb = urb_priv->last_sb;
++ ASSERT(last_sb);
++ while(first_sb != last_sb) {
++ next_sb = (struct USB_SB_Desc *)phys_to_virt(first_sb->next);
++ kmem_cache_free(usb_desc_cache, first_sb);
++ first_sb = next_sb;
++ i++;
++ }
++ kmem_cache_free(usb_desc_cache, last_sb);
++ i++;
++ }
++
++ /* Check if it has any EPs in its Intr pool that also needs to be freed */
++ if(urb_priv->intr_ep_pool_length > 0) {
++ for(i = 0; i < urb_priv->intr_ep_pool_length; i++) {
++ kfree(urb_priv->intr_ep_pool[i]);
++ }
++ /*
++ tc_dbg("Freed %d EPs from URB:0x%x EP pool\n",
++ urb_priv->intr_ep_pool_length, (unsigned int)urb);
++ */
++ }
++
++ kfree(urb_priv);
++ urb->hcpriv = NULL;
++}
++
++static int ep_priv_create(struct usb_host_endpoint *ep, int mem_flags) {
++ struct crisv10_ep_priv *ep_priv;
++
++ ep_priv = kmalloc(sizeof *ep_priv, mem_flags);
++ if (!ep_priv)
++ return -ENOMEM;
++ memset(ep_priv, 0, sizeof *ep_priv);
++
++ ep->hcpriv = ep_priv;
++ return 0;
++}
++
++static void ep_priv_free(struct usb_host_endpoint *ep) {
++ struct crisv10_ep_priv *ep_priv = ep->hcpriv;
++ ASSERT(ep_priv);
++ kfree(ep_priv);
++ ep->hcpriv = NULL;
++}
++
++/* EPID handling functions, managing EP-list in Etrax through wrappers */
++/* ------------------------------------------------------------------- */
++
++/* Sets up a new EPID for an endpoint or returns existing if found */
++//static int tc_setup_epid(struct usb_host_endpoint *ep, struct urb *urb,
++// int mem_flags) {
++static int tc_setup_epid(struct urb *urb, int mem_flags)
++{
++ int epid;
++ char devnum, endpoint, out_traffic, slow;
++ int maxlen;
++ __u32 epid_data;
++ struct usb_host_endpoint *ep = urb->ep;
++ struct crisv10_ep_priv *ep_priv = ep->hcpriv;
++
++ DBFENTER;
++
++ /* Check if a valid epid already is setup for this endpoint */
++ if(ep_priv != NULL) {
++ return ep_priv->epid;
++ }
++
++ /* We must find and initiate a new epid for this urb. */
++ epid = tc_allocate_epid();
++
++ if (epid == -1) {
++ /* Failed to allocate a new epid. */
++ DBFEXIT;
++ return epid;
++ }
++
++ /* We now have a new epid to use. Claim it. */
++ epid_state[epid].inuse = 1;
++
++ /* Init private data for new endpoint */
++ if(ep_priv_create(ep, mem_flags) != 0) {
++ return -ENOMEM;
++ }
++ ep_priv = ep->hcpriv;
++ ep_priv->epid = epid;
++
++ devnum = usb_pipedevice(urb->pipe);
++ endpoint = usb_pipeendpoint(urb->pipe);
++ slow = (urb->dev->speed == USB_SPEED_LOW);
++ maxlen = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe));
++
++ if (usb_pipetype(urb->pipe) == PIPE_CONTROL) {
++ /* We want both IN and OUT control traffic to be put on the same
++ EP/SB list. */
++ out_traffic = 1;
++ } else {
++ out_traffic = usb_pipeout(urb->pipe);
++ }
++
++ if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
++ epid_data = IO_STATE(R_USB_EPT_DATA_ISO, valid, yes) |
++ /* FIXME: Change any to the actual port? */
++ IO_STATE(R_USB_EPT_DATA_ISO, port, any) |
++ IO_FIELD(R_USB_EPT_DATA_ISO, max_len, maxlen) |
++ IO_FIELD(R_USB_EPT_DATA_ISO, ep, endpoint) |
++ IO_FIELD(R_USB_EPT_DATA_ISO, dev, devnum);
++ etrax_epid_iso_set(epid, epid_data);
++ } else {
++ epid_data = IO_STATE(R_USB_EPT_DATA, valid, yes) |
++ IO_FIELD(R_USB_EPT_DATA, low_speed, slow) |
++ /* FIXME: Change any to the actual port? */
++ IO_STATE(R_USB_EPT_DATA, port, any) |
++ IO_FIELD(R_USB_EPT_DATA, max_len, maxlen) |
++ IO_FIELD(R_USB_EPT_DATA, ep, endpoint) |
++ IO_FIELD(R_USB_EPT_DATA, dev, devnum);
++ etrax_epid_set(epid, epid_data);
++ }
++
++ epid_state[epid].out_traffic = out_traffic;
++ epid_state[epid].type = usb_pipetype(urb->pipe);
++
++ tc_warn("Setting up ep:0x%x epid:%d (addr:%d endp:%d max_len:%d %s %s %s)\n",
++ (unsigned int)ep, epid, devnum, endpoint, maxlen,
++ str_type(urb->pipe), out_traffic ? "out" : "in",
++ slow ? "low" : "full");
++
++ /* Enable Isoc eof interrupt if we set up the first Isoc epid */
++ if(usb_pipeisoc(urb->pipe)) {
++ isoc_epid_counter++;
++ if(isoc_epid_counter == 1) {
++ isoc_warn("Enabled Isoc eof interrupt\n");
++ *R_USB_IRQ_MASK_SET |= IO_STATE(R_USB_IRQ_MASK_SET, iso_eof, set);
++ }
++ }
++
++ DBFEXIT;
++ return epid;
++}
++
++static void tc_free_epid(struct usb_host_endpoint *ep) {
++ unsigned long flags;
++ struct crisv10_ep_priv *ep_priv = ep->hcpriv;
++ int epid;
++ volatile int timeout = 10000;
++
++ DBFENTER;
++
++ if (ep_priv == NULL) {
++ tc_warn("Trying to free unused epid on ep:0x%x\n", (unsigned int)ep);
++ DBFEXIT;
++ return;
++ }
++
++ epid = ep_priv->epid;
++
++ /* Disable Isoc eof interrupt if we free the last Isoc epid */
++ if(epid_isoc(epid)) {
++ ASSERT(isoc_epid_counter > 0);
++ isoc_epid_counter--;
++ if(isoc_epid_counter == 0) {
++ *R_USB_IRQ_MASK_SET &= ~IO_STATE(R_USB_IRQ_MASK_SET, iso_eof, set);
++ isoc_warn("Disabled Isoc eof interrupt\n");
++ }
++ }
++
++ /* Take lock manualy instead of in epid_x_x wrappers,
++ because we need to be polling here */
++ spin_lock_irqsave(&etrax_epid_lock, flags);
++
++ *R_USB_EPT_INDEX = IO_FIELD(R_USB_EPT_INDEX, value, epid);
++ nop();
++ while((*R_USB_EPT_DATA & IO_MASK(R_USB_EPT_DATA, hold)) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for epid:%d to drop hold\n", epid);
++ }
++ /* This will, among other things, set the valid field to 0. */
++ *R_USB_EPT_DATA = 0;
++ spin_unlock_irqrestore(&etrax_epid_lock, flags);
++
++ /* Free resource in software state info list */
++ epid_state[epid].inuse = 0;
++
++ /* Free private endpoint data */
++ ep_priv_free(ep);
++
++ DBFEXIT;
++}
++
++static int tc_allocate_epid(void) {
++ int i;
++ DBFENTER;
++ for (i = 0; i < NBR_OF_EPIDS; i++) {
++ if (!epid_inuse(i)) {
++ DBFEXIT;
++ return i;
++ }
++ }
++
++ tc_warn("Found no free epids\n");
++ DBFEXIT;
++ return -1;
++}
++
++
++/* Wrappers around the list functions (include/linux/list.h). */
++/* ---------------------------------------------------------- */
++static inline int __urb_list_empty(int epid) {
++ int retval;
++ retval = list_empty(&urb_list[epid]);
++ return retval;
++}
++
++/* Returns first urb for this epid, or NULL if list is empty. */
++static inline struct urb *urb_list_first(int epid) {
++ unsigned long flags;
++ struct urb *first_urb = 0;
++ spin_lock_irqsave(&urb_list_lock, flags);
++ if (!__urb_list_empty(epid)) {
++ /* Get the first urb (i.e. head->next). */
++ urb_entry_t *urb_entry = list_entry((&urb_list[epid])->next, urb_entry_t, list);
++ first_urb = urb_entry->urb;
++ }
++ spin_unlock_irqrestore(&urb_list_lock, flags);
++ return first_urb;
++}
++
++/* Adds an urb_entry last in the list for this epid. */
++static inline void urb_list_add(struct urb *urb, int epid, int mem_flags) {
++ unsigned long flags;
++ urb_entry_t *urb_entry = (urb_entry_t *)kmalloc(sizeof(urb_entry_t), mem_flags);
++ ASSERT(urb_entry);
++
++ urb_entry->urb = urb;
++ spin_lock_irqsave(&urb_list_lock, flags);
++ list_add_tail(&urb_entry->list, &urb_list[epid]);
++ spin_unlock_irqrestore(&urb_list_lock, flags);
++}
++
++/* Search through the list for an element that contains this urb. (The list
++ is expected to be short and the one we are about to delete will often be
++ the first in the list.)
++ Should be protected by spin_locks in calling function */
++static inline urb_entry_t *__urb_list_entry(struct urb *urb, int epid) {
++ struct list_head *entry;
++ struct list_head *tmp;
++ urb_entry_t *urb_entry;
++
++ list_for_each_safe(entry, tmp, &urb_list[epid]) {
++ urb_entry = list_entry(entry, urb_entry_t, list);
++ ASSERT(urb_entry);
++ ASSERT(urb_entry->urb);
++
++ if (urb_entry->urb == urb) {
++ return urb_entry;
++ }
++ }
++ return 0;
++}
++
++/* Same function as above but for global use. Protects list by spinlock */
++static inline urb_entry_t *urb_list_entry(struct urb *urb, int epid) {
++ unsigned long flags;
++ urb_entry_t *urb_entry;
++ spin_lock_irqsave(&urb_list_lock, flags);
++ urb_entry = __urb_list_entry(urb, epid);
++ spin_unlock_irqrestore(&urb_list_lock, flags);
++ return (urb_entry);
++}
++
++/* Delete an urb from the list. */
++static inline void urb_list_del(struct urb *urb, int epid) {
++ unsigned long flags;
++ urb_entry_t *urb_entry;
++
++ /* Delete entry and free. */
++ spin_lock_irqsave(&urb_list_lock, flags);
++ urb_entry = __urb_list_entry(urb, epid);
++ ASSERT(urb_entry);
++
++ list_del(&urb_entry->list);
++ spin_unlock_irqrestore(&urb_list_lock, flags);
++ kfree(urb_entry);
++}
++
++/* Move an urb to the end of the list. */
++static inline void urb_list_move_last(struct urb *urb, int epid) {
++ unsigned long flags;
++ urb_entry_t *urb_entry;
++
++ spin_lock_irqsave(&urb_list_lock, flags);
++ urb_entry = __urb_list_entry(urb, epid);
++ ASSERT(urb_entry);
++
++ list_del(&urb_entry->list);
++ list_add_tail(&urb_entry->list, &urb_list[epid]);
++ spin_unlock_irqrestore(&urb_list_lock, flags);
++}
++
++/* Get the next urb in the list. */
++static inline struct urb *urb_list_next(struct urb *urb, int epid) {
++ unsigned long flags;
++ urb_entry_t *urb_entry;
++
++ spin_lock_irqsave(&urb_list_lock, flags);
++ urb_entry = __urb_list_entry(urb, epid);
++ ASSERT(urb_entry);
++
++ if (urb_entry->list.next != &urb_list[epid]) {
++ struct list_head *elem = urb_entry->list.next;
++ urb_entry = list_entry(elem, urb_entry_t, list);
++ spin_unlock_irqrestore(&urb_list_lock, flags);
++ return urb_entry->urb;
++ } else {
++ spin_unlock_irqrestore(&urb_list_lock, flags);
++ return NULL;
++ }
++}
++
++struct USB_EP_Desc* create_ep(int epid, struct USB_SB_Desc* sb_desc,
++ int mem_flags) {
++ struct USB_EP_Desc *ep_desc;
++ ep_desc = (struct USB_EP_Desc *) kmem_cache_alloc(usb_desc_cache, mem_flags);
++ if(ep_desc == NULL)
++ return NULL;
++ memset(ep_desc, 0, sizeof(struct USB_EP_Desc));
++
++ ep_desc->hw_len = 0;
++ ep_desc->command = (IO_FIELD(USB_EP_command, epid, epid) |
++ IO_STATE(USB_EP_command, enable, yes));
++ if(sb_desc == NULL) {
++ ep_desc->sub = 0;
++ } else {
++ ep_desc->sub = virt_to_phys(sb_desc);
++ }
++ return ep_desc;
++}
++
++#define TT_ZOUT 0
++#define TT_IN 1
++#define TT_OUT 2
++#define TT_SETUP 3
++
++#define CMD_EOL IO_STATE(USB_SB_command, eol, yes)
++#define CMD_INTR IO_STATE(USB_SB_command, intr, yes)
++#define CMD_FULL IO_STATE(USB_SB_command, full, yes)
++
++/* Allocation and setup of a generic SB. Used to create SETUP, OUT and ZOUT
++ SBs. Also used by create_sb_in() to avoid same allocation procedure at two
++ places */
++struct USB_SB_Desc* create_sb(struct USB_SB_Desc* sb_prev, int tt, void* data,
++ int datalen, int mem_flags) {
++ struct USB_SB_Desc *sb_desc;
++ sb_desc = (struct USB_SB_Desc*)kmem_cache_alloc(usb_desc_cache, mem_flags);
++ if(sb_desc == NULL)
++ return NULL;
++ memset(sb_desc, 0, sizeof(struct USB_SB_Desc));
++
++ sb_desc->command = IO_FIELD(USB_SB_command, tt, tt) |
++ IO_STATE(USB_SB_command, eot, yes);
++
++ sb_desc->sw_len = datalen;
++ if(data != NULL) {
++ sb_desc->buf = virt_to_phys(data);
++ } else {
++ sb_desc->buf = 0;
++ }
++ if(sb_prev != NULL) {
++ sb_prev->next = virt_to_phys(sb_desc);
++ }
++ return sb_desc;
++}
++
++/* Creates a copy of an existing SB by allocation space for it and copy
++ settings */
++struct USB_SB_Desc* create_sb_copy(struct USB_SB_Desc* sb_orig, int mem_flags) {
++ struct USB_SB_Desc *sb_desc;
++ sb_desc = (struct USB_SB_Desc*)kmem_cache_alloc(usb_desc_cache, mem_flags);
++ if(sb_desc == NULL)
++ return NULL;
++
++ memcpy(sb_desc, sb_orig, sizeof(struct USB_SB_Desc));
++ return sb_desc;
++}
++
++/* A specific create_sb function for creation of in SBs. This is due to
++ that datalen in In SBs shows how many packets we are expecting. It also
++ sets up the rem field to show if how many bytes we expect in last packet
++ if it's not a full one */
++struct USB_SB_Desc* create_sb_in(struct USB_SB_Desc* sb_prev, int datalen,
++ int maxlen, int mem_flags) {
++ struct USB_SB_Desc *sb_desc;
++ sb_desc = create_sb(sb_prev, TT_IN, NULL,
++ datalen ? (datalen - 1) / maxlen + 1 : 0, mem_flags);
++ if(sb_desc == NULL)
++ return NULL;
++ sb_desc->command |= IO_FIELD(USB_SB_command, rem, datalen % maxlen);
++ return sb_desc;
++}
++
++void set_sb_cmds(struct USB_SB_Desc *sb_desc, __u16 flags) {
++ sb_desc->command |= flags;
++}
++
++int create_sb_for_urb(struct urb *urb, int mem_flags) {
++ int is_out = !usb_pipein(urb->pipe);
++ int type = usb_pipetype(urb->pipe);
++ int maxlen = usb_maxpacket(urb->dev, urb->pipe, is_out);
++ int buf_len = urb->transfer_buffer_length;
++ void *buf = buf_len > 0 ? urb->transfer_buffer : NULL;
++ struct USB_SB_Desc *sb_desc = NULL;
++
++ struct crisv10_urb_priv *urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv != NULL);
++
++ switch(type) {
++ case PIPE_CONTROL:
++ /* Setup stage */
++ sb_desc = create_sb(NULL, TT_SETUP, urb->setup_packet, 8, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ set_sb_cmds(sb_desc, CMD_FULL);
++
++ /* Attach first SB to URB */
++ urb_priv->first_sb = sb_desc;
++
++ if (is_out) { /* Out Control URB */
++ /* If this Control OUT transfer has an optional data stage we add
++ an OUT token before the mandatory IN (status) token */
++ if ((buf_len > 0) && buf) {
++ sb_desc = create_sb(sb_desc, TT_OUT, buf, buf_len, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ set_sb_cmds(sb_desc, CMD_FULL);
++ }
++
++ /* Status stage */
++ /* The data length has to be exactly 1. This is due to a requirement
++ of the USB specification that a host must be prepared to receive
++ data in the status phase */
++ sb_desc = create_sb(sb_desc, TT_IN, NULL, 1, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ } else { /* In control URB */
++ /* Data stage */
++ sb_desc = create_sb_in(sb_desc, buf_len, maxlen, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++
++ /* Status stage */
++ /* Read comment at zout_buffer declaration for an explanation to this. */
++ sb_desc = create_sb(sb_desc, TT_ZOUT, &zout_buffer[0], 1, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ /* Set descriptor interrupt flag for in URBs so we can finish URB after
++ zout-packet has been sent */
++ set_sb_cmds(sb_desc, CMD_INTR | CMD_FULL);
++ }
++ /* Set end-of-list flag in last SB */
++ set_sb_cmds(sb_desc, CMD_EOL);
++ /* Attach last SB to URB */
++ urb_priv->last_sb = sb_desc;
++ break;
++
++ case PIPE_BULK:
++ if (is_out) { /* Out Bulk URB */
++ sb_desc = create_sb(NULL, TT_OUT, buf, buf_len, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ /* The full field is set to yes, even if we don't actually check that
++ this is a full-length transfer (i.e., that transfer_buffer_length %
++ maxlen = 0).
++ Setting full prevents the USB controller from sending an empty packet
++ in that case. However, if URB_ZERO_PACKET was set we want that. */
++ if (!(urb->transfer_flags & URB_ZERO_PACKET)) {
++ set_sb_cmds(sb_desc, CMD_FULL);
++ }
++ } else { /* In Bulk URB */
++ sb_desc = create_sb_in(NULL, buf_len, maxlen, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ }
++ /* Set end-of-list flag for last SB */
++ set_sb_cmds(sb_desc, CMD_EOL);
++
++ /* Attach SB to URB */
++ urb_priv->first_sb = sb_desc;
++ urb_priv->last_sb = sb_desc;
++ break;
++
++ case PIPE_INTERRUPT:
++ if(is_out) { /* Out Intr URB */
++ sb_desc = create_sb(NULL, TT_OUT, buf, buf_len, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++
++ /* The full field is set to yes, even if we don't actually check that
++ this is a full-length transfer (i.e., that transfer_buffer_length %
++ maxlen = 0).
++ Setting full prevents the USB controller from sending an empty packet
++ in that case. However, if URB_ZERO_PACKET was set we want that. */
++ if (!(urb->transfer_flags & URB_ZERO_PACKET)) {
++ set_sb_cmds(sb_desc, CMD_FULL);
++ }
++ /* Only generate TX interrupt if it's a Out URB*/
++ set_sb_cmds(sb_desc, CMD_INTR);
++
++ } else { /* In Intr URB */
++ sb_desc = create_sb_in(NULL, buf_len, maxlen, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ }
++ /* Set end-of-list flag for last SB */
++ set_sb_cmds(sb_desc, CMD_EOL);
++
++ /* Attach SB to URB */
++ urb_priv->first_sb = sb_desc;
++ urb_priv->last_sb = sb_desc;
++
++ break;
++ case PIPE_ISOCHRONOUS:
++ if(is_out) { /* Out Isoc URB */
++ int i;
++ if(urb->number_of_packets == 0) {
++ tc_err("Can't create SBs for Isoc URB with zero packets\n");
++ return -EPIPE;
++ }
++ /* Create one SB descriptor for each packet and link them together. */
++ for(i = 0; i < urb->number_of_packets; i++) {
++ if (urb->iso_frame_desc[i].length > 0) {
++
++ sb_desc = create_sb(sb_desc, TT_OUT, urb->transfer_buffer +
++ urb->iso_frame_desc[i].offset,
++ urb->iso_frame_desc[i].length, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++
++ /* Check if it's a full length packet */
++ if (urb->iso_frame_desc[i].length ==
++ usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe))) {
++ set_sb_cmds(sb_desc, CMD_FULL);
++ }
++
++ } else { /* zero length packet */
++ sb_desc = create_sb(sb_desc, TT_ZOUT, &zout_buffer[0], 1, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ set_sb_cmds(sb_desc, CMD_FULL);
++ }
++ /* Attach first SB descriptor to URB */
++ if (i == 0) {
++ urb_priv->first_sb = sb_desc;
++ }
++ }
++ /* Set interrupt and end-of-list flags in last SB */
++ set_sb_cmds(sb_desc, CMD_INTR | CMD_EOL);
++ /* Attach last SB descriptor to URB */
++ urb_priv->last_sb = sb_desc;
++ tc_dbg("Created %d out SBs for Isoc URB:0x%x\n",
++ urb->number_of_packets, (unsigned int)urb);
++ } else { /* In Isoc URB */
++ /* Actual number of packets is not relevant for periodic in traffic as
++ long as it is more than zero. Set to 1 always. */
++ sb_desc = create_sb(sb_desc, TT_IN, NULL, 1, mem_flags);
++ if(sb_desc == NULL)
++ return -ENOMEM;
++ /* Set end-of-list flags for SB */
++ set_sb_cmds(sb_desc, CMD_EOL);
++
++ /* Attach SB to URB */
++ urb_priv->first_sb = sb_desc;
++ urb_priv->last_sb = sb_desc;
++ }
++ break;
++ default:
++ tc_err("Unknown pipe-type\n");
++ return -EPIPE;
++ break;
++ }
++ return 0;
++}
++
++int init_intr_urb(struct urb *urb, int mem_flags) {
++ struct crisv10_urb_priv *urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ struct USB_EP_Desc* ep_desc;
++ int interval;
++ int i;
++ int ep_count;
++
++ ASSERT(urb_priv != NULL);
++ ASSERT(usb_pipeint(urb->pipe));
++ /* We can't support interval longer than amount of eof descriptors in
++ TxIntrEPList */
++ if(urb->interval > MAX_INTR_INTERVAL) {
++ tc_err("Interrupt interval %dms too big (max: %dms)\n", urb->interval,
++ MAX_INTR_INTERVAL);
++ return -EINVAL;
++ }
++
++ /* We assume that the SB descriptors already have been setup */
++ ASSERT(urb_priv->first_sb != NULL);
++
++ /* Round of the interval to 2^n, it is obvious that this code favours
++ smaller numbers, but that is actually a good thing */
++ /* FIXME: The "rounding error" for larger intervals will be quite
++ large. For in traffic this shouldn't be a problem since it will only
++ mean that we "poll" more often. */
++ interval = urb->interval;
++ for (i = 0; interval; i++) {
++ interval = interval >> 1;
++ }
++ urb_priv->interval = 1 << (i - 1);
++
++ /* We can only have max interval for Out Interrupt due to that we can only
++ handle one linked in EP for a certain epid in the Intr descr array at the
++ time. The USB Controller in the Etrax 100LX continues to process Intr EPs
++ so we have no way of knowing which one that caused the actual transfer if
++ we have several linked in. */
++ if(usb_pipeout(urb->pipe)) {
++ urb_priv->interval = MAX_INTR_INTERVAL;
++ }
++
++ /* Calculate amount of EPs needed */
++ ep_count = MAX_INTR_INTERVAL / urb_priv->interval;
++
++ for(i = 0; i < ep_count; i++) {
++ ep_desc = create_ep(urb_priv->epid, urb_priv->first_sb, mem_flags);
++ if(ep_desc == NULL) {
++ /* Free any descriptors that we may have allocated before failure */
++ while(i > 0) {
++ i--;
++ kfree(urb_priv->intr_ep_pool[i]);
++ }
++ return -ENOMEM;
++ }
++ urb_priv->intr_ep_pool[i] = ep_desc;
++ }
++ urb_priv->intr_ep_pool_length = ep_count;
++ return 0;
++}
++
++/* DMA RX/TX functions */
++/* ----------------------- */
++
++static void tc_dma_init_rx_list(void) {
++ int i;
++
++ /* Setup descriptor list except last one */
++ for (i = 0; i < (NBR_OF_RX_DESC - 1); i++) {
++ RxDescList[i].sw_len = RX_DESC_BUF_SIZE;
++ RxDescList[i].command = 0;
++ RxDescList[i].next = virt_to_phys(&RxDescList[i + 1]);
++ RxDescList[i].buf = virt_to_phys(RxBuf + (i * RX_DESC_BUF_SIZE));
++ RxDescList[i].hw_len = 0;
++ RxDescList[i].status = 0;
++
++ /* DMA IN cache bug. (struct etrax_dma_descr has the same layout as
++ USB_IN_Desc for the relevant fields.) */
++ prepare_rx_descriptor((struct etrax_dma_descr*)&RxDescList[i]);
++
++ }
++ /* Special handling of last descriptor */
++ RxDescList[i].sw_len = RX_DESC_BUF_SIZE;
++ RxDescList[i].command = IO_STATE(USB_IN_command, eol, yes);
++ RxDescList[i].next = virt_to_phys(&RxDescList[0]);
++ RxDescList[i].buf = virt_to_phys(RxBuf + (i * RX_DESC_BUF_SIZE));
++ RxDescList[i].hw_len = 0;
++ RxDescList[i].status = 0;
++
++ /* Setup list pointers that show progress in list */
++ myNextRxDesc = &RxDescList[0];
++ myLastRxDesc = &RxDescList[NBR_OF_RX_DESC - 1];
++
++ flush_etrax_cache();
++ /* Point DMA to first descriptor in list and start it */
++ *R_DMA_CH9_FIRST = virt_to_phys(myNextRxDesc);
++ *R_DMA_CH9_CMD = IO_STATE(R_DMA_CH9_CMD, cmd, start);
++}
++
++
++static void tc_dma_init_tx_bulk_list(void) {
++ int i;
++ volatile struct USB_EP_Desc *epDescr;
++
++ for (i = 0; i < (NBR_OF_EPIDS - 1); i++) {
++ epDescr = &(TxBulkEPList[i]);
++ CHECK_ALIGN(epDescr);
++ epDescr->hw_len = 0;
++ epDescr->command = IO_FIELD(USB_EP_command, epid, i);
++ epDescr->sub = 0;
++ epDescr->next = virt_to_phys(&TxBulkEPList[i + 1]);
++
++ /* Initiate two EPs, disabled and with the eol flag set. No need for any
++ preserved epid. */
++
++ /* The first one has the intr flag set so we get an interrupt when the DMA
++ channel is about to become disabled. */
++ CHECK_ALIGN(&TxBulkDummyEPList[i][0]);
++ TxBulkDummyEPList[i][0].hw_len = 0;
++ TxBulkDummyEPList[i][0].command = (IO_FIELD(USB_EP_command, epid, DUMMY_EPID) |
++ IO_STATE(USB_EP_command, eol, yes) |
++ IO_STATE(USB_EP_command, intr, yes));
++ TxBulkDummyEPList[i][0].sub = 0;
++ TxBulkDummyEPList[i][0].next = virt_to_phys(&TxBulkDummyEPList[i][1]);
++
++ /* The second one. */
++ CHECK_ALIGN(&TxBulkDummyEPList[i][1]);
++ TxBulkDummyEPList[i][1].hw_len = 0;
++ TxBulkDummyEPList[i][1].command = (IO_FIELD(USB_EP_command, epid, DUMMY_EPID) |
++ IO_STATE(USB_EP_command, eol, yes));
++ TxBulkDummyEPList[i][1].sub = 0;
++ /* The last dummy's next pointer is the same as the current EP's next pointer. */
++ TxBulkDummyEPList[i][1].next = virt_to_phys(&TxBulkEPList[i + 1]);
++ }
++
++ /* Special handling of last descr in list, make list circular */
++ epDescr = &TxBulkEPList[i];
++ CHECK_ALIGN(epDescr);
++ epDescr->hw_len = 0;
++ epDescr->command = IO_STATE(USB_EP_command, eol, yes) |
++ IO_FIELD(USB_EP_command, epid, i);
++ epDescr->sub = 0;
++ epDescr->next = virt_to_phys(&TxBulkEPList[0]);
++
++ /* Init DMA sub-channel pointers to last item in each list */
++ *R_DMA_CH8_SUB0_EP = virt_to_phys(&TxBulkEPList[i]);
++ /* No point in starting the bulk channel yet.
++ *R_DMA_CH8_SUB0_CMD = IO_STATE(R_DMA_CH8_SUB0_CMD, cmd, start); */
++}
++
++static void tc_dma_init_tx_ctrl_list(void) {
++ int i;
++ volatile struct USB_EP_Desc *epDescr;
++
++ for (i = 0; i < (NBR_OF_EPIDS - 1); i++) {
++ epDescr = &(TxCtrlEPList[i]);
++ CHECK_ALIGN(epDescr);
++ epDescr->hw_len = 0;
++ epDescr->command = IO_FIELD(USB_EP_command, epid, i);
++ epDescr->sub = 0;
++ epDescr->next = virt_to_phys(&TxCtrlEPList[i + 1]);
++ }
++ /* Special handling of last descr in list, make list circular */
++ epDescr = &TxCtrlEPList[i];
++ CHECK_ALIGN(epDescr);
++ epDescr->hw_len = 0;
++ epDescr->command = IO_STATE(USB_EP_command, eol, yes) |
++ IO_FIELD(USB_EP_command, epid, i);
++ epDescr->sub = 0;
++ epDescr->next = virt_to_phys(&TxCtrlEPList[0]);
++
++ /* Init DMA sub-channel pointers to last item in each list */
++ *R_DMA_CH8_SUB1_EP = virt_to_phys(&TxCtrlEPList[i]);
++ /* No point in starting the ctrl channel yet.
++ *R_DMA_CH8_SUB1_CMD = IO_STATE(R_DMA_CH8_SUB0_CMD, cmd, start); */
++}
++
++
++static void tc_dma_init_tx_intr_list(void) {
++ int i;
++
++ TxIntrSB_zout.sw_len = 1;
++ TxIntrSB_zout.next = 0;
++ TxIntrSB_zout.buf = virt_to_phys(&zout_buffer[0]);
++ TxIntrSB_zout.command = (IO_FIELD(USB_SB_command, rem, 0) |
++ IO_STATE(USB_SB_command, tt, zout) |
++ IO_STATE(USB_SB_command, full, yes) |
++ IO_STATE(USB_SB_command, eot, yes) |
++ IO_STATE(USB_SB_command, eol, yes));
++
++ for (i = 0; i < (MAX_INTR_INTERVAL - 1); i++) {
++ CHECK_ALIGN(&TxIntrEPList[i]);
++ TxIntrEPList[i].hw_len = 0;
++ TxIntrEPList[i].command =
++ (IO_STATE(USB_EP_command, eof, yes) |
++ IO_STATE(USB_EP_command, enable, yes) |
++ IO_FIELD(USB_EP_command, epid, INVALID_EPID));
++ TxIntrEPList[i].sub = virt_to_phys(&TxIntrSB_zout);
++ TxIntrEPList[i].next = virt_to_phys(&TxIntrEPList[i + 1]);
++ }
++
++ /* Special handling of last descr in list, make list circular */
++ CHECK_ALIGN(&TxIntrEPList[i]);
++ TxIntrEPList[i].hw_len = 0;
++ TxIntrEPList[i].command =
++ (IO_STATE(USB_EP_command, eof, yes) |
++ IO_STATE(USB_EP_command, eol, yes) |
++ IO_STATE(USB_EP_command, enable, yes) |
++ IO_FIELD(USB_EP_command, epid, INVALID_EPID));
++ TxIntrEPList[i].sub = virt_to_phys(&TxIntrSB_zout);
++ TxIntrEPList[i].next = virt_to_phys(&TxIntrEPList[0]);
++
++ intr_dbg("Initiated Intr EP descriptor list\n");
++
++
++ /* Connect DMA 8 sub-channel 2 to first in list */
++ *R_DMA_CH8_SUB2_EP = virt_to_phys(&TxIntrEPList[0]);
++}
++
++static void tc_dma_init_tx_isoc_list(void) {
++ int i;
++
++ DBFENTER;
++
++ /* Read comment at zout_buffer declaration for an explanation to this. */
++ TxIsocSB_zout.sw_len = 1;
++ TxIsocSB_zout.next = 0;
++ TxIsocSB_zout.buf = virt_to_phys(&zout_buffer[0]);
++ TxIsocSB_zout.command = (IO_FIELD(USB_SB_command, rem, 0) |
++ IO_STATE(USB_SB_command, tt, zout) |
++ IO_STATE(USB_SB_command, full, yes) |
++ IO_STATE(USB_SB_command, eot, yes) |
++ IO_STATE(USB_SB_command, eol, yes));
++
++ /* The last isochronous EP descriptor is a dummy. */
++ for (i = 0; i < (NBR_OF_EPIDS - 1); i++) {
++ CHECK_ALIGN(&TxIsocEPList[i]);
++ TxIsocEPList[i].hw_len = 0;
++ TxIsocEPList[i].command = IO_FIELD(USB_EP_command, epid, i);
++ TxIsocEPList[i].sub = 0;
++ TxIsocEPList[i].next = virt_to_phys(&TxIsocEPList[i + 1]);
++ }
++
++ CHECK_ALIGN(&TxIsocEPList[i]);
++ TxIsocEPList[i].hw_len = 0;
++
++ /* Must enable the last EP descr to get eof interrupt. */
++ TxIsocEPList[i].command = (IO_STATE(USB_EP_command, enable, yes) |
++ IO_STATE(USB_EP_command, eof, yes) |
++ IO_STATE(USB_EP_command, eol, yes) |
++ IO_FIELD(USB_EP_command, epid, INVALID_EPID));
++ TxIsocEPList[i].sub = virt_to_phys(&TxIsocSB_zout);
++ TxIsocEPList[i].next = virt_to_phys(&TxIsocEPList[0]);
++
++ *R_DMA_CH8_SUB3_EP = virt_to_phys(&TxIsocEPList[0]);
++ *R_DMA_CH8_SUB3_CMD = IO_STATE(R_DMA_CH8_SUB3_CMD, cmd, start);
++}
++
++static int tc_dma_init(struct usb_hcd *hcd) {
++ tc_dma_init_rx_list();
++ tc_dma_init_tx_bulk_list();
++ tc_dma_init_tx_ctrl_list();
++ tc_dma_init_tx_intr_list();
++ tc_dma_init_tx_isoc_list();
++
++ if (cris_request_dma(USB_TX_DMA_NBR,
++ "ETRAX 100LX built-in USB (Tx)",
++ DMA_VERBOSE_ON_ERROR,
++ dma_usb)) {
++ err("Could not allocate DMA ch 8 for USB");
++ return -EBUSY;
++ }
++
++ if (cris_request_dma(USB_RX_DMA_NBR,
++ "ETRAX 100LX built-in USB (Rx)",
++ DMA_VERBOSE_ON_ERROR,
++ dma_usb)) {
++ err("Could not allocate DMA ch 9 for USB");
++ return -EBUSY;
++ }
++
++ *R_IRQ_MASK2_SET =
++ /* Note that these interrupts are not used. */
++ IO_STATE(R_IRQ_MASK2_SET, dma8_sub0_descr, set) |
++ /* Sub channel 1 (ctrl) descr. interrupts are used. */
++ IO_STATE(R_IRQ_MASK2_SET, dma8_sub1_descr, set) |
++ IO_STATE(R_IRQ_MASK2_SET, dma8_sub2_descr, set) |
++ /* Sub channel 3 (isoc) descr. interrupts are used. */
++ IO_STATE(R_IRQ_MASK2_SET, dma8_sub3_descr, set);
++
++ /* Note that the dma9_descr interrupt is not used. */
++ *R_IRQ_MASK2_SET =
++ IO_STATE(R_IRQ_MASK2_SET, dma9_eop, set) |
++ IO_STATE(R_IRQ_MASK2_SET, dma9_descr, set);
++
++ if (request_irq(ETRAX_USB_RX_IRQ, tc_dma_rx_interrupt, 0,
++ "ETRAX 100LX built-in USB (Rx)", hcd)) {
++ err("Could not allocate IRQ %d for USB", ETRAX_USB_RX_IRQ);
++ return -EBUSY;
++ }
++
++ if (request_irq(ETRAX_USB_TX_IRQ, tc_dma_tx_interrupt, 0,
++ "ETRAX 100LX built-in USB (Tx)", hcd)) {
++ err("Could not allocate IRQ %d for USB", ETRAX_USB_TX_IRQ);
++ return -EBUSY;
++ }
++
++ return 0;
++}
++
++static void tc_dma_destroy(void) {
++ free_irq(ETRAX_USB_RX_IRQ, NULL);
++ free_irq(ETRAX_USB_TX_IRQ, NULL);
++
++ cris_free_dma(USB_TX_DMA_NBR, "ETRAX 100LX built-in USB (Tx)");
++ cris_free_dma(USB_RX_DMA_NBR, "ETRAX 100LX built-in USB (Rx)");
++
++}
++
++static void tc_dma_link_intr_urb(struct urb *urb);
++
++/* Handle processing of Bulk, Ctrl and Intr queues */
++static void tc_dma_process_queue(int epid) {
++ struct urb *urb;
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ unsigned long flags;
++ char toggle;
++
++ if(epid_state[epid].disabled) {
++ /* Don't process any URBs on a disabled endpoint */
++ return;
++ }
++
++ /* Do not disturb us while fiddling with EPs and epids */
++ local_irq_save(flags);
++
++ /* For bulk, Ctrl and Intr can we only have one URB active at a time for
++ a specific EP. */
++ if(activeUrbList[epid] != NULL) {
++ /* An URB is already active on EP, skip checking queue */
++ local_irq_restore(flags);
++ return;
++ }
++
++ urb = urb_list_first(epid);
++ if(urb == NULL) {
++ /* No URB waiting in EP queue. Nothing do to */
++ local_irq_restore(flags);
++ return;
++ }
++
++ urb_priv = urb->hcpriv;
++ ASSERT(urb_priv != NULL);
++ ASSERT(urb_priv->urb_state == NOT_STARTED);
++ ASSERT(!usb_pipeisoc(urb->pipe));
++
++ /* Remove this URB from the queue and move it to active */
++ activeUrbList[epid] = urb;
++ urb_list_del(urb, epid);
++
++ urb_priv->urb_state = STARTED;
++
++ /* Reset error counters (regardless of which direction this traffic is). */
++ etrax_epid_clear_error(epid);
++
++ /* Special handling of Intr EP lists */
++ if(usb_pipeint(urb->pipe)) {
++ tc_dma_link_intr_urb(urb);
++ local_irq_restore(flags);
++ return;
++ }
++
++ /* Software must preset the toggle bits for Bulk and Ctrl */
++ if(usb_pipecontrol(urb->pipe)) {
++ /* Toggle bits are initialized only during setup transaction in a
++ CTRL transfer */
++ etrax_epid_set_toggle(epid, 0, 0);
++ etrax_epid_set_toggle(epid, 1, 0);
++ } else {
++ toggle = usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe),
++ usb_pipeout(urb->pipe));
++ etrax_epid_set_toggle(epid, usb_pipeout(urb->pipe), toggle);
++ }
++
++ tc_dbg("Added SBs from (URB:0x%x %s %s) to epid %d: %s\n",
++ (unsigned int)urb, str_dir(urb->pipe), str_type(urb->pipe), epid,
++ sblist_to_str(urb_priv->first_sb));
++
++ /* We start the DMA sub channel without checking if it's running or not,
++ because:
++ 1) If it's already running, issuing the start command is a nop.
++ 2) We avoid a test-and-set race condition. */
++ switch(usb_pipetype(urb->pipe)) {
++ case PIPE_BULK:
++ /* Assert that the EP descriptor is disabled. */
++ ASSERT(!(TxBulkEPList[epid].command & IO_MASK(USB_EP_command, enable)));
++
++ /* Set up and enable the EP descriptor. */
++ TxBulkEPList[epid].sub = virt_to_phys(urb_priv->first_sb);
++ TxBulkEPList[epid].hw_len = 0;
++ TxBulkEPList[epid].command |= IO_STATE(USB_EP_command, enable, yes);
++
++ /* Check if the dummy list is already with us (if several urbs were queued). */
++ if (usb_pipein(urb->pipe) && (TxBulkEPList[epid].next != virt_to_phys(&TxBulkDummyEPList[epid][0]))) {
++ tc_dbg("Inviting dummy list to the party for urb 0x%lx, epid %d",
++ (unsigned long)urb, epid);
++
++ /* We don't need to check if the DMA is at this EP or not before changing the
++ next pointer, since we will do it in one 32-bit write (EP descriptors are
++ 32-bit aligned). */
++ TxBulkEPList[epid].next = virt_to_phys(&TxBulkDummyEPList[epid][0]);
++ }
++
++ restart_dma8_sub0();
++
++ /* Update/restart the bulk start timer since we just started the channel.*/
++ mod_timer(&bulk_start_timer, jiffies + BULK_START_TIMER_INTERVAL);
++ /* Update/restart the bulk eot timer since we just inserted traffic. */
++ mod_timer(&bulk_eot_timer, jiffies + BULK_EOT_TIMER_INTERVAL);
++ break;
++ case PIPE_CONTROL:
++ /* Assert that the EP descriptor is disabled. */
++ ASSERT(!(TxCtrlEPList[epid].command & IO_MASK(USB_EP_command, enable)));
++
++ /* Set up and enable the EP descriptor. */
++ TxCtrlEPList[epid].sub = virt_to_phys(urb_priv->first_sb);
++ TxCtrlEPList[epid].hw_len = 0;
++ TxCtrlEPList[epid].command |= IO_STATE(USB_EP_command, enable, yes);
++
++ *R_DMA_CH8_SUB1_CMD = IO_STATE(R_DMA_CH8_SUB1_CMD, cmd, start);
++ break;
++ }
++ local_irq_restore(flags);
++}
++
++static void tc_dma_link_intr_urb(struct urb *urb) {
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ volatile struct USB_EP_Desc *tmp_ep;
++ struct USB_EP_Desc *ep_desc;
++ int i = 0, epid;
++ int pool_idx = 0;
++
++ ASSERT(urb_priv != NULL);
++ epid = urb_priv->epid;
++ ASSERT(urb_priv->interval > 0);
++ ASSERT(urb_priv->intr_ep_pool_length > 0);
++
++ tmp_ep = &TxIntrEPList[0];
++
++ /* Only insert one EP descriptor in list for Out Intr URBs.
++ We can only handle Out Intr with interval of 128ms because
++ it's not possible to insert several Out Intr EPs because they
++ are not consumed by the DMA. */
++ if(usb_pipeout(urb->pipe)) {
++ ep_desc = urb_priv->intr_ep_pool[0];
++ ASSERT(ep_desc);
++ ep_desc->next = tmp_ep->next;
++ tmp_ep->next = virt_to_phys(ep_desc);
++ i++;
++ } else {
++ /* Loop through Intr EP descriptor list and insert EP for URB at
++ specified interval */
++ do {
++ /* Each EP descriptor with eof flag sat signals a new frame */
++ if (tmp_ep->command & IO_MASK(USB_EP_command, eof)) {
++ /* Insert a EP from URBs EP pool at correct interval */
++ if ((i % urb_priv->interval) == 0) {
++ ep_desc = urb_priv->intr_ep_pool[pool_idx];
++ ASSERT(ep_desc);
++ ep_desc->next = tmp_ep->next;
++ tmp_ep->next = virt_to_phys(ep_desc);
++ pool_idx++;
++ ASSERT(pool_idx <= urb_priv->intr_ep_pool_length);
++ }
++ i++;
++ }
++ tmp_ep = (struct USB_EP_Desc *)phys_to_virt(tmp_ep->next);
++ } while(tmp_ep != &TxIntrEPList[0]);
++ }
++
++ intr_dbg("Added SBs to intr epid %d: %s interval:%d (%d EP)\n", epid,
++ sblist_to_str(urb_priv->first_sb), urb_priv->interval, pool_idx);
++
++ /* We start the DMA sub channel without checking if it's running or not,
++ because:
++ 1) If it's already running, issuing the start command is a nop.
++ 2) We avoid a test-and-set race condition. */
++ *R_DMA_CH8_SUB2_CMD = IO_STATE(R_DMA_CH8_SUB2_CMD, cmd, start);
++}
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++static void tc_dma_process_isoc_urb(struct urb *urb) {
++ unsigned long flags;
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ int epid;
++
++ /* Do not disturb us while fiddling with EPs and epids */
++ local_irq_save(flags);
++
++ ASSERT(urb_priv);
++ ASSERT(urb_priv->first_sb);
++ epid = urb_priv->epid;
++
++ if(activeUrbList[epid] == NULL) {
++ /* EP is idle, so make this URB active */
++ activeUrbList[epid] = urb;
++ urb_list_del(urb, epid);
++ ASSERT(TxIsocEPList[epid].sub == 0);
++ ASSERT(!(TxIsocEPList[epid].command &
++ IO_STATE(USB_EP_command, enable, yes)));
++
++ /* Differentiate between In and Out Isoc. Because In SBs are not consumed*/
++ if(usb_pipein(urb->pipe)) {
++ /* Each EP for In Isoc will have only one SB descriptor, setup when
++ submitting the first active urb. We do it here by copying from URBs
++ pre-allocated SB. */
++ memcpy((void *)&(TxIsocSBList[epid]), urb_priv->first_sb,
++ sizeof(TxIsocSBList[epid]));
++ TxIsocEPList[epid].hw_len = 0;
++ TxIsocEPList[epid].sub = virt_to_phys(&(TxIsocSBList[epid]));
++ } else {
++ /* For Out Isoc we attach the pre-allocated list of SBs for the URB */
++ TxIsocEPList[epid].hw_len = 0;
++ TxIsocEPList[epid].sub = virt_to_phys(urb_priv->first_sb);
++
++ isoc_dbg("Attached first URB:0x%x[%d] to epid:%d first_sb:0x%x"
++ " last_sb::0x%x\n",
++ (unsigned int)urb, urb_priv->urb_num, epid,
++ (unsigned int)(urb_priv->first_sb),
++ (unsigned int)(urb_priv->last_sb));
++ }
++
++ if (urb->transfer_flags & URB_ISO_ASAP) {
++ /* The isoc transfer should be started as soon as possible. The
++ start_frame field is a return value if URB_ISO_ASAP was set. Comparing
++ R_USB_FM_NUMBER with a USB Chief trace shows that the first isoc IN
++ token is sent 2 frames later. I'm not sure how this affects usage of
++ the start_frame field by the device driver, or how it affects things
++ when USB_ISO_ASAP is not set, so therefore there's no compensation for
++ the 2 frame "lag" here. */
++ urb->start_frame = (*R_USB_FM_NUMBER & 0x7ff);
++ TxIsocEPList[epid].command |= IO_STATE(USB_EP_command, enable, yes);
++ urb_priv->urb_state = STARTED;
++ isoc_dbg("URB_ISO_ASAP set, urb->start_frame set to %d\n",
++ urb->start_frame);
++ } else {
++ /* Not started yet. */
++ urb_priv->urb_state = NOT_STARTED;
++ isoc_warn("urb_priv->urb_state set to NOT_STARTED for URB:0x%x\n",
++ (unsigned int)urb);
++ }
++
++ } else {
++ /* An URB is already active on the EP. Leave URB in queue and let
++ finish_isoc_urb process it after current active URB */
++ ASSERT(TxIsocEPList[epid].sub != 0);
++
++ if(usb_pipein(urb->pipe)) {
++ /* Because there already is a active In URB on this epid we do nothing
++ and the finish_isoc_urb() function will handle switching to next URB*/
++
++ } else { /* For Out Isoc, insert new URBs traffic last in SB-list. */
++ struct USB_SB_Desc *temp_sb_desc;
++
++ /* Set state STARTED to all Out Isoc URBs added to SB list because we
++ don't know how many of them that are finished before descr interrupt*/
++ urb_priv->urb_state = STARTED;
++
++ /* Find end of current SB list by looking for SB with eol flag sat */
++ temp_sb_desc = phys_to_virt(TxIsocEPList[epid].sub);
++ while ((temp_sb_desc->command & IO_MASK(USB_SB_command, eol)) !=
++ IO_STATE(USB_SB_command, eol, yes)) {
++ ASSERT(temp_sb_desc->next);
++ temp_sb_desc = phys_to_virt(temp_sb_desc->next);
++ }
++
++ isoc_dbg("Appended URB:0x%x[%d] (first:0x%x last:0x%x) to epid:%d"
++ " sub:0x%x eol:0x%x\n",
++ (unsigned int)urb, urb_priv->urb_num,
++ (unsigned int)(urb_priv->first_sb),
++ (unsigned int)(urb_priv->last_sb), epid,
++ (unsigned int)phys_to_virt(TxIsocEPList[epid].sub),
++ (unsigned int)temp_sb_desc);
++
++ /* Next pointer must be set before eol is removed. */
++ temp_sb_desc->next = virt_to_phys(urb_priv->first_sb);
++ /* Clear the previous end of list flag since there is a new in the
++ added SB descriptor list. */
++ temp_sb_desc->command &= ~IO_MASK(USB_SB_command, eol);
++
++ if (!(TxIsocEPList[epid].command & IO_MASK(USB_EP_command, enable))) {
++ __u32 epid_data;
++ /* 8.8.5 in Designer's Reference says we should check for and correct
++ any errors in the EP here. That should not be necessary if
++ epid_attn is handled correctly, so we assume all is ok. */
++ epid_data = etrax_epid_iso_get(epid);
++ if (IO_EXTRACT(R_USB_EPT_DATA, error_code, epid_data) !=
++ IO_STATE_VALUE(R_USB_EPT_DATA, error_code, no_error)) {
++ isoc_err("Disabled Isoc EP with error:%d on epid:%d when appending"
++ " URB:0x%x[%d]\n",
++ IO_EXTRACT(R_USB_EPT_DATA, error_code, epid_data), epid,
++ (unsigned int)urb, urb_priv->urb_num);
++ }
++
++ /* The SB list was exhausted. */
++ if (virt_to_phys(urb_priv->last_sb) != TxIsocEPList[epid].sub) {
++ /* The new sublist did not get processed before the EP was
++ disabled. Setup the EP again. */
++
++ if(virt_to_phys(temp_sb_desc) == TxIsocEPList[epid].sub) {
++ isoc_dbg("EP for epid:%d stoped at SB:0x%x before newly inserted"
++ ", restarting from this URBs SB:0x%x\n",
++ epid, (unsigned int)temp_sb_desc,
++ (unsigned int)(urb_priv->first_sb));
++ TxIsocEPList[epid].hw_len = 0;
++ TxIsocEPList[epid].sub = virt_to_phys(urb_priv->first_sb);
++ urb->start_frame = (*R_USB_FM_NUMBER & 0x7ff);
++ /* Enable the EP again so data gets processed this time */
++ TxIsocEPList[epid].command |=
++ IO_STATE(USB_EP_command, enable, yes);
++
++ } else {
++ /* The EP has been disabled but not at end this URB (god knows
++ where). This should generate an epid_attn so we should not be
++ here */
++ isoc_warn("EP was disabled on sb:0x%x before SB list for"
++ " URB:0x%x[%d] got processed\n",
++ (unsigned int)phys_to_virt(TxIsocEPList[epid].sub),
++ (unsigned int)urb, urb_priv->urb_num);
++ }
++ } else {
++ /* This might happend if we are slow on this function and isn't
++ an error. */
++ isoc_dbg("EP was disabled and finished with SBs from appended"
++ " URB:0x%x[%d]\n", (unsigned int)urb, urb_priv->urb_num);
++ }
++ }
++ }
++ }
++
++ /* Start the DMA sub channel */
++ *R_DMA_CH8_SUB3_CMD = IO_STATE(R_DMA_CH8_SUB3_CMD, cmd, start);
++
++ local_irq_restore(flags);
++}
++#endif
++
++static void tc_dma_unlink_intr_urb(struct urb *urb) {
++ struct crisv10_urb_priv *urb_priv = urb->hcpriv;
++ volatile struct USB_EP_Desc *first_ep; /* First EP in the list. */
++ volatile struct USB_EP_Desc *curr_ep; /* Current EP, the iterator. */
++ volatile struct USB_EP_Desc *next_ep; /* The EP after current. */
++ volatile struct USB_EP_Desc *unlink_ep; /* The one we should remove from
++ the list. */
++ int count = 0;
++ volatile int timeout = 10000;
++ int epid;
++
++ /* Read 8.8.4 in Designer's Reference, "Removing an EP Descriptor from the
++ List". */
++ ASSERT(urb_priv);
++ ASSERT(urb_priv->intr_ep_pool_length > 0);
++ epid = urb_priv->epid;
++
++ /* First disable all Intr EPs belonging to epid for this URB */
++ first_ep = &TxIntrEPList[0];
++ curr_ep = first_ep;
++ do {
++ next_ep = (struct USB_EP_Desc *)phys_to_virt(curr_ep->next);
++ if (IO_EXTRACT(USB_EP_command, epid, next_ep->command) == epid) {
++ /* Disable EP */
++ next_ep->command &= ~IO_MASK(USB_EP_command, enable);
++ }
++ curr_ep = phys_to_virt(curr_ep->next);
++ } while (curr_ep != first_ep);
++
++
++ /* Now unlink all EPs belonging to this epid from Descr list */
++ first_ep = &TxIntrEPList[0];
++ curr_ep = first_ep;
++ do {
++ next_ep = (struct USB_EP_Desc *)phys_to_virt(curr_ep->next);
++ if (IO_EXTRACT(USB_EP_command, epid, next_ep->command) == epid) {
++ /* This is the one we should unlink. */
++ unlink_ep = next_ep;
++
++ /* Actually unlink the EP from the DMA list. */
++ curr_ep->next = unlink_ep->next;
++
++ /* Wait until the DMA is no longer at this descriptor. */
++ while((*R_DMA_CH8_SUB2_EP == virt_to_phys(unlink_ep)) &&
++ (timeout-- > 0));
++ if(timeout == 0) {
++ warn("Timeout while waiting for DMA-TX-Intr to leave unlink EP\n");
++ }
++
++ count++;
++ }
++ curr_ep = phys_to_virt(curr_ep->next);
++ } while (curr_ep != first_ep);
++
++ if(count != urb_priv->intr_ep_pool_length) {
++ intr_warn("Unlinked %d of %d Intr EPs for URB:0x%x[%d]\n", count,
++ urb_priv->intr_ep_pool_length, (unsigned int)urb,
++ urb_priv->urb_num);
++ } else {
++ intr_dbg("Unlinked %d of %d interrupt EPs for URB:0x%x\n", count,
++ urb_priv->intr_ep_pool_length, (unsigned int)urb);
++ }
++}
++
++static void check_finished_bulk_tx_epids(struct usb_hcd *hcd,
++ int timer) {
++ unsigned long flags;
++ int epid;
++ struct urb *urb;
++ struct crisv10_urb_priv * urb_priv;
++ __u32 epid_data;
++
++ /* Protect TxEPList */
++ local_irq_save(flags);
++
++ for (epid = 0; epid < NBR_OF_EPIDS; epid++) {
++ /* A finished EP descriptor is disabled and has a valid sub pointer */
++ if (!(TxBulkEPList[epid].command & IO_MASK(USB_EP_command, enable)) &&
++ (TxBulkEPList[epid].sub != 0)) {
++
++ /* Get the active URB for this epid */
++ urb = activeUrbList[epid];
++ /* Sanity checks */
++ ASSERT(urb);
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++
++ /* Only handle finished out Bulk EPs here,
++ and let RX interrupt take care of the rest */
++ if(!epid_out_traffic(epid)) {
++ continue;
++ }
++
++ if(timer) {
++ tc_warn("Found finished %s Bulk epid:%d URB:0x%x[%d] from timeout\n",
++ epid_out_traffic(epid) ? "Out" : "In", epid, (unsigned int)urb,
++ urb_priv->urb_num);
++ } else {
++ tc_dbg("Found finished %s Bulk epid:%d URB:0x%x[%d] from interrupt\n",
++ epid_out_traffic(epid) ? "Out" : "In", epid, (unsigned int)urb,
++ urb_priv->urb_num);
++ }
++
++ if(urb_priv->urb_state == UNLINK) {
++ /* This Bulk URB is requested to be unlinked, that means that the EP
++ has been disabled and we might not have sent all data */
++ tc_finish_urb(hcd, urb, urb->status);
++ continue;
++ }
++
++ ASSERT(urb_priv->urb_state == STARTED);
++ if (phys_to_virt(TxBulkEPList[epid].sub) != urb_priv->last_sb) {
++ tc_err("Endpoint got disabled before reaching last sb\n");
++ }
++
++ epid_data = etrax_epid_get(epid);
++ if (IO_EXTRACT(R_USB_EPT_DATA, error_code, epid_data) ==
++ IO_STATE_VALUE(R_USB_EPT_DATA, error_code, no_error)) {
++ /* This means that the endpoint has no error, is disabled
++ and had inserted traffic, i.e. transfer successfully completed. */
++ tc_finish_urb(hcd, urb, 0);
++ } else {
++ /* Shouldn't happen. We expect errors to be caught by epid
++ attention. */
++ tc_err("Found disabled bulk EP desc (epid:%d error:%d)\n",
++ epid, IO_EXTRACT(R_USB_EPT_DATA, error_code, epid_data));
++ }
++ } else {
++ tc_dbg("Ignoring In Bulk epid:%d, let RX interrupt handle it\n", epid);
++ }
++ }
++
++ local_irq_restore(flags);
++}
++
++static void check_finished_ctrl_tx_epids(struct usb_hcd *hcd) {
++ unsigned long flags;
++ int epid;
++ struct urb *urb;
++ struct crisv10_urb_priv * urb_priv;
++ __u32 epid_data;
++
++ /* Protect TxEPList */
++ local_irq_save(flags);
++
++ for (epid = 0; epid < NBR_OF_EPIDS; epid++) {
++ if(epid == DUMMY_EPID)
++ continue;
++
++ /* A finished EP descriptor is disabled and has a valid sub pointer */
++ if (!(TxCtrlEPList[epid].command & IO_MASK(USB_EP_command, enable)) &&
++ (TxCtrlEPList[epid].sub != 0)) {
++
++ /* Get the active URB for this epid */
++ urb = activeUrbList[epid];
++
++ if(urb == NULL) {
++ tc_warn("Found finished Ctrl epid:%d with no active URB\n", epid);
++ continue;
++ }
++
++ /* Sanity checks */
++ ASSERT(usb_pipein(urb->pipe));
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++ if (phys_to_virt(TxCtrlEPList[epid].sub) != urb_priv->last_sb) {
++ tc_err("Endpoint got disabled before reaching last sb\n");
++ }
++
++ epid_data = etrax_epid_get(epid);
++ if (IO_EXTRACT(R_USB_EPT_DATA, error_code, epid_data) ==
++ IO_STATE_VALUE(R_USB_EPT_DATA, error_code, no_error)) {
++ /* This means that the endpoint has no error, is disabled
++ and had inserted traffic, i.e. transfer successfully completed. */
++
++ /* Check if RX-interrupt for In Ctrl has been processed before
++ finishing the URB */
++ if(urb_priv->ctrl_rx_done) {
++ tc_dbg("Finishing In Ctrl URB:0x%x[%d] in tx_interrupt\n",
++ (unsigned int)urb, urb_priv->urb_num);
++ tc_finish_urb(hcd, urb, 0);
++ } else {
++ /* If we get zout descriptor interrupt before RX was done for a
++ In Ctrl transfer, then we flag that and it will be finished
++ in the RX-Interrupt */
++ urb_priv->ctrl_zout_done = 1;
++ tc_dbg("Got zout descr interrupt before RX interrupt\n");
++ }
++ } else {
++ /* Shouldn't happen. We expect errors to be caught by epid
++ attention. */
++ tc_err("Found disabled Ctrl EP desc (epid:%d URB:0x%x[%d]) error_code:%d\n", epid, (unsigned int)urb, urb_priv->urb_num, IO_EXTRACT(R_USB_EPT_DATA, error_code, epid_data));
++ __dump_ep_desc(&(TxCtrlEPList[epid]));
++ __dump_ept_data(epid);
++ }
++ }
++ }
++ local_irq_restore(flags);
++}
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++/* This function goes through all epids that are setup for Out Isoc transfers
++ and marks (isoc_out_done) all queued URBs that the DMA has finished
++ transfer for.
++ No URB completetion is done here to make interrupt routine return quickly.
++ URBs are completed later with help of complete_isoc_bottom_half() that
++ becomes schedules when this functions is finished. */
++static void check_finished_isoc_tx_epids(void) {
++ unsigned long flags;
++ int epid;
++ struct urb *urb;
++ struct crisv10_urb_priv * urb_priv;
++ struct USB_SB_Desc* sb_desc;
++ int epid_done;
++
++ /* Protect TxIsocEPList */
++ local_irq_save(flags);
++
++ for (epid = 0; epid < NBR_OF_EPIDS; epid++) {
++ if (TxIsocEPList[epid].sub == 0 || epid == INVALID_EPID ||
++ !epid_out_traffic(epid)) {
++ /* Nothing here to see. */
++ continue;
++ }
++ ASSERT(epid_inuse(epid));
++ ASSERT(epid_isoc(epid));
++
++ sb_desc = phys_to_virt(TxIsocEPList[epid].sub);
++ /* Find the last descriptor of the currently active URB for this ep.
++ This is the first descriptor in the sub list marked for a descriptor
++ interrupt. */
++ while (sb_desc && !IO_EXTRACT(USB_SB_command, intr, sb_desc->command)) {
++ sb_desc = sb_desc->next ? phys_to_virt(sb_desc->next) : 0;
++ }
++ ASSERT(sb_desc);
++
++ isoc_dbg("Descr IRQ checking epid:%d sub:0x%x intr:0x%x\n",
++ epid, (unsigned int)phys_to_virt(TxIsocEPList[epid].sub),
++ (unsigned int)sb_desc);
++
++ urb = activeUrbList[epid];
++ if(urb == NULL) {
++ isoc_err("Isoc Descr irq on epid:%d with no active URB\n", epid);
++ continue;
++ }
++
++ epid_done = 0;
++ while(urb && !epid_done) {
++ /* Sanity check. */
++ ASSERT(usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS);
++ ASSERT(usb_pipeout(urb->pipe));
++
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++ ASSERT(urb_priv->urb_state == STARTED ||
++ urb_priv->urb_state == UNLINK);
++
++ if (sb_desc != urb_priv->last_sb) {
++ /* This urb has been sent. */
++ urb_priv->isoc_out_done = 1;
++
++ } else { /* Found URB that has last_sb as the interrupt reason */
++
++ /* Check if EP has been disabled, meaning that all transfers are done*/
++ if(!(TxIsocEPList[epid].command & IO_MASK(USB_EP_command, enable))) {
++ ASSERT((sb_desc->command & IO_MASK(USB_SB_command, eol)) ==
++ IO_STATE(USB_SB_command, eol, yes));
++ ASSERT(sb_desc->next == 0);
++ urb_priv->isoc_out_done = 1;
++ } else {
++ isoc_dbg("Skipping URB:0x%x[%d] because EP not disabled yet\n",
++ (unsigned int)urb, urb_priv->urb_num);
++ }
++ /* Stop looking any further in queue */
++ epid_done = 1;
++ }
++
++ if (!epid_done) {
++ if(urb == activeUrbList[epid]) {
++ urb = urb_list_first(epid);
++ } else {
++ urb = urb_list_next(urb, epid);
++ }
++ }
++ } /* END: while(urb && !epid_done) */
++ }
++
++ local_irq_restore(flags);
++}
++
++
++/* This is where the Out Isoc URBs are realy completed. This function is
++ scheduled from tc_dma_tx_interrupt() when one or more Out Isoc transfers
++ are done. This functions completes all URBs earlier marked with
++ isoc_out_done by fast interrupt routine check_finished_isoc_tx_epids() */
++
++static void complete_isoc_bottom_half(void *data) {
++ struct crisv10_isoc_complete_data *comp_data;
++ struct usb_iso_packet_descriptor *packet;
++ struct crisv10_urb_priv * urb_priv;
++ unsigned long flags;
++ struct urb* urb;
++ int epid_done;
++ int epid;
++ int i;
++
++ comp_data = (struct crisv10_isoc_complete_data*)data;
++
++ local_irq_save(flags);
++
++ for (epid = 0; epid < NBR_OF_EPIDS - 1; epid++) {
++ if(!epid_inuse(epid) || !epid_isoc(epid) || !epid_out_traffic(epid) || epid == DUMMY_EPID) {
++ /* Only check valid Out Isoc epids */
++ continue;
++ }
++
++ isoc_dbg("Isoc bottom-half checking epid:%d, sub:0x%x\n", epid,
++ (unsigned int)phys_to_virt(TxIsocEPList[epid].sub));
++
++ /* The descriptor interrupt handler has marked all transmitted Out Isoc
++ URBs with isoc_out_done. Now we traverse all epids and for all that
++ have out Isoc traffic we traverse its URB list and complete the
++ transmitted URBs. */
++ epid_done = 0;
++ while (!epid_done) {
++
++ /* Get the active urb (if any) */
++ urb = activeUrbList[epid];
++ if (urb == 0) {
++ isoc_dbg("No active URB on epid:%d anymore\n", epid);
++ epid_done = 1;
++ continue;
++ }
++
++ /* Sanity check. */
++ ASSERT(usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS);
++ ASSERT(usb_pipeout(urb->pipe));
++
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++
++ if (!(urb_priv->isoc_out_done)) {
++ /* We have reached URB that isn't flaged done yet, stop traversing. */
++ isoc_dbg("Stoped traversing Out Isoc URBs on epid:%d"
++ " before not yet flaged URB:0x%x[%d]\n",
++ epid, (unsigned int)urb, urb_priv->urb_num);
++ epid_done = 1;
++ continue;
++ }
++
++ /* This urb has been sent. */
++ isoc_dbg("Found URB:0x%x[%d] that is flaged isoc_out_done\n",
++ (unsigned int)urb, urb_priv->urb_num);
++
++ /* Set ok on transfered packets for this URB and finish it */
++ for (i = 0; i < urb->number_of_packets; i++) {
++ packet = &urb->iso_frame_desc[i];
++ packet->status = 0;
++ packet->actual_length = packet->length;
++ }
++ urb_priv->isoc_packet_counter = urb->number_of_packets;
++ tc_finish_urb(comp_data->hcd, urb, 0);
++
++ } /* END: while(!epid_done) */
++ } /* END: for(epid...) */
++
++ local_irq_restore(flags);
++ kmem_cache_free(isoc_compl_cache, comp_data);
++}
++#endif
++
++static void check_finished_intr_tx_epids(struct usb_hcd *hcd) {
++ unsigned long flags;
++ int epid;
++ struct urb *urb;
++ struct crisv10_urb_priv * urb_priv;
++ volatile struct USB_EP_Desc *curr_ep; /* Current EP, the iterator. */
++ volatile struct USB_EP_Desc *next_ep; /* The EP after current. */
++
++ /* Protect TxintrEPList */
++ local_irq_save(flags);
++
++ for (epid = 0; epid < NBR_OF_EPIDS; epid++) {
++ if(!epid_inuse(epid) || !epid_intr(epid) || !epid_out_traffic(epid)) {
++ /* Nothing to see on this epid. Only check valid Out Intr epids */
++ continue;
++ }
++
++ urb = activeUrbList[epid];
++ if(urb == 0) {
++ intr_warn("Found Out Intr epid:%d with no active URB\n", epid);
++ continue;
++ }
++
++ /* Sanity check. */
++ ASSERT(usb_pipetype(urb->pipe) == PIPE_INTERRUPT);
++ ASSERT(usb_pipeout(urb->pipe));
++
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++
++ /* Go through EPs between first and second sof-EP. It's here Out Intr EPs
++ are inserted.*/
++ curr_ep = &TxIntrEPList[0];
++ do {
++ next_ep = (struct USB_EP_Desc *)phys_to_virt(curr_ep->next);
++ if(next_ep == urb_priv->intr_ep_pool[0]) {
++ /* We found the Out Intr EP for this epid */
++
++ /* Disable it so it doesn't get processed again */
++ next_ep->command &= ~IO_MASK(USB_EP_command, enable);
++
++ /* Finish the active Out Intr URB with status OK */
++ tc_finish_urb(hcd, urb, 0);
++ }
++ curr_ep = phys_to_virt(curr_ep->next);
++ } while (curr_ep != &TxIntrEPList[1]);
++
++ }
++ local_irq_restore(flags);
++}
++
++/* Interrupt handler for DMA8/IRQ24 with subchannels (called from hardware intr) */
++static irqreturn_t tc_dma_tx_interrupt(int irq, void *vhc) {
++ struct usb_hcd *hcd = (struct usb_hcd*)vhc;
++ ASSERT(hcd);
++
++ if (*R_IRQ_READ2 & IO_MASK(R_IRQ_READ2, dma8_sub0_descr)) {
++ /* Clear this interrupt */
++ *R_DMA_CH8_SUB0_CLR_INTR = IO_STATE(R_DMA_CH8_SUB0_CLR_INTR, clr_descr, do);
++ restart_dma8_sub0();
++ }
++
++ if (*R_IRQ_READ2 & IO_MASK(R_IRQ_READ2, dma8_sub1_descr)) {
++ /* Clear this interrupt */
++ *R_DMA_CH8_SUB1_CLR_INTR = IO_STATE(R_DMA_CH8_SUB1_CLR_INTR, clr_descr, do);
++ check_finished_ctrl_tx_epids(hcd);
++ }
++
++ if (*R_IRQ_READ2 & IO_MASK(R_IRQ_READ2, dma8_sub2_descr)) {
++ /* Clear this interrupt */
++ *R_DMA_CH8_SUB2_CLR_INTR = IO_STATE(R_DMA_CH8_SUB2_CLR_INTR, clr_descr, do);
++ check_finished_intr_tx_epids(hcd);
++ }
++
++ /* hinko ignore usb_pipeisoc */
++#if 0
++ if (*R_IRQ_READ2 & IO_MASK(R_IRQ_READ2, dma8_sub3_descr)) {
++ struct crisv10_isoc_complete_data* comp_data;
++
++ /* Flag done Out Isoc for later completion */
++ check_finished_isoc_tx_epids();
++
++ /* Clear this interrupt */
++ *R_DMA_CH8_SUB3_CLR_INTR = IO_STATE(R_DMA_CH8_SUB3_CLR_INTR, clr_descr, do);
++ /* Schedule bottom half of Out Isoc completion function. This function
++ finishes the URBs marked with isoc_out_done */
++ comp_data = (struct crisv10_isoc_complete_data*)
++ kmem_cache_alloc(isoc_compl_cache, GFP_ATOMIC);
++ ASSERT(comp_data != NULL);
++ comp_data ->hcd = hcd;
++
++ //INIT_WORK(&comp_data->usb_bh, complete_isoc_bottom_half, comp_data);
++ INIT_WORK(&comp_data->usb_bh, complete_isoc_bottom_half);
++ schedule_work(&comp_data->usb_bh);
++ }
++#endif
++
++ return IRQ_HANDLED;
++}
++
++/* Interrupt handler for DMA9/IRQ25 (called from hardware intr) */
++static irqreturn_t tc_dma_rx_interrupt(int irq, void *vhc) {
++ unsigned long flags;
++ struct urb *urb;
++ struct usb_hcd *hcd = (struct usb_hcd*)vhc;
++ struct crisv10_urb_priv *urb_priv;
++ int epid = 0;
++ int real_error;
++
++ ASSERT(hcd);
++
++ /* Clear this interrupt. */
++ *R_DMA_CH9_CLR_INTR = IO_STATE(R_DMA_CH9_CLR_INTR, clr_eop, do);
++
++ /* Custom clear interrupt for this interrupt */
++ /* The reason we cli here is that we call the driver's callback functions. */
++ local_irq_save(flags);
++
++ /* Note that this while loop assumes that all packets span only
++ one rx descriptor. */
++ while(myNextRxDesc->status & IO_MASK(USB_IN_status, eop)) {
++ epid = IO_EXTRACT(USB_IN_status, epid, myNextRxDesc->status);
++ /* Get the active URB for this epid */
++ urb = activeUrbList[epid];
++
++ ASSERT(epid_inuse(epid));
++ if (!urb) {
++ dma_err("No urb for epid %d in rx interrupt\n", epid);
++ goto skip_out;
++ }
++
++ /* Check if any errors on epid */
++ real_error = 0;
++ if (myNextRxDesc->status & IO_MASK(USB_IN_status, error)) {
++ __u32 r_usb_ept_data;
++
++ if (usb_pipeisoc(urb->pipe)) {
++ r_usb_ept_data = etrax_epid_iso_get(epid);
++ if((r_usb_ept_data & IO_MASK(R_USB_EPT_DATA_ISO, valid)) &&
++ (IO_EXTRACT(R_USB_EPT_DATA_ISO, error_code, r_usb_ept_data) == 0) &&
++ (myNextRxDesc->status & IO_MASK(USB_IN_status, nodata))) {
++ /* Not an error, just a failure to receive an expected iso
++ in packet in this frame. This is not documented
++ in the designers reference. Continue processing.
++ */
++ } else real_error = 1;
++ } else real_error = 1;
++ }
++
++ if(real_error) {
++ dma_err("Error in RX descr on epid:%d for URB 0x%x",
++ epid, (unsigned int)urb);
++ dump_ept_data(epid);
++ dump_in_desc(myNextRxDesc);
++ goto skip_out;
++ }
++
++ urb_priv = (struct crisv10_urb_priv *)urb->hcpriv;
++ ASSERT(urb_priv);
++ ASSERT(urb_priv->urb_state == STARTED ||
++ urb_priv->urb_state == UNLINK);
++
++ if ((usb_pipetype(urb->pipe) == PIPE_BULK) ||
++ (usb_pipetype(urb->pipe) == PIPE_CONTROL) ||
++ (usb_pipetype(urb->pipe) == PIPE_INTERRUPT)) {
++
++ /* We get nodata for empty data transactions, and the rx descriptor's
++ hw_len field is not valid in that case. No data to copy in other
++ words. */
++ if (myNextRxDesc->status & IO_MASK(USB_IN_status, nodata)) {
++ /* No data to copy */
++ } else {
++ /*
++ dma_dbg("Processing RX for URB:0x%x epid:%d (data:%d ofs:%d)\n",
++ (unsigned int)urb, epid, myNextRxDesc->hw_len,
++ urb_priv->rx_offset);
++ */
++ /* Only copy data if URB isn't flaged to be unlinked*/
++ if(urb_priv->urb_state != UNLINK) {
++ /* Make sure the data fits in the buffer. */
++ if(urb_priv->rx_offset + myNextRxDesc->hw_len
++ <= urb->transfer_buffer_length) {
++
++ /* Copy the data to URBs buffer */
++ memcpy(urb->transfer_buffer + urb_priv->rx_offset,
++ phys_to_virt(myNextRxDesc->buf), myNextRxDesc->hw_len);
++ urb_priv->rx_offset += myNextRxDesc->hw_len;
++ } else {
++ /* Signal overflow when returning URB */
++ urb->status = -EOVERFLOW;
++ tc_finish_urb_later(hcd, urb, urb->status);
++ }
++ }
++ }
++
++ /* Check if it was the last packet in the transfer */
++ if (myNextRxDesc->status & IO_MASK(USB_IN_status, eot)) {
++ /* Special handling for In Ctrl URBs. */
++ if(usb_pipecontrol(urb->pipe) && usb_pipein(urb->pipe) &&
++ !(urb_priv->ctrl_zout_done)) {
++ /* Flag that RX part of Ctrl transfer is done. Because zout descr
++ interrupt hasn't happend yet will the URB be finished in the
++ TX-Interrupt. */
++ urb_priv->ctrl_rx_done = 1;
++ tc_dbg("Not finishing In Ctrl URB:0x%x from rx_interrupt, waiting"
++ " for zout\n", (unsigned int)urb);
++ } else {
++ tc_finish_urb(hcd, urb, 0);
++ }
++ }
++ } else { /* ISOC RX */
++ /*
++ isoc_dbg("Processing RX for epid:%d (URB:0x%x) ISOC pipe\n",
++ epid, (unsigned int)urb);
++ */
++
++ struct usb_iso_packet_descriptor *packet;
++
++ if (urb_priv->urb_state == UNLINK) {
++ isoc_warn("Ignoring Isoc Rx data for urb being unlinked.\n");
++ goto skip_out;
++ } else if (urb_priv->urb_state == NOT_STARTED) {
++ isoc_err("What? Got Rx data for Isoc urb that isn't started?\n");
++ goto skip_out;
++ }
++
++ packet = &urb->iso_frame_desc[urb_priv->isoc_packet_counter];
++ ASSERT(packet);
++ packet->status = 0;
++
++ if (myNextRxDesc->status & IO_MASK(USB_IN_status, nodata)) {
++ /* We get nodata for empty data transactions, and the rx descriptor's
++ hw_len field is not valid in that case. We copy 0 bytes however to
++ stay in synch. */
++ packet->actual_length = 0;
++ } else {
++ packet->actual_length = myNextRxDesc->hw_len;
++ /* Make sure the data fits in the buffer. */
++ ASSERT(packet->actual_length <= packet->length);
++ memcpy(urb->transfer_buffer + packet->offset,
++ phys_to_virt(myNextRxDesc->buf), packet->actual_length);
++ if(packet->actual_length > 0)
++ isoc_dbg("Copied %d bytes, packet %d for URB:0x%x[%d]\n",
++ packet->actual_length, urb_priv->isoc_packet_counter,
++ (unsigned int)urb, urb_priv->urb_num);
++ }
++
++ /* Increment the packet counter. */
++ urb_priv->isoc_packet_counter++;
++
++ /* Note that we don't care about the eot field in the rx descriptor's
++ status. It will always be set for isoc traffic. */
++ if (urb->number_of_packets == urb_priv->isoc_packet_counter) {
++ /* Complete the urb with status OK. */
++ tc_finish_urb(hcd, urb, 0);
++ }
++ }
++
++ skip_out:
++ myNextRxDesc->status = 0;
++ myNextRxDesc->command |= IO_MASK(USB_IN_command, eol);
++ myLastRxDesc->command &= ~IO_MASK(USB_IN_command, eol);
++ myLastRxDesc = myNextRxDesc;
++ myNextRxDesc = phys_to_virt(myNextRxDesc->next);
++ flush_etrax_cache();
++ *R_DMA_CH9_CMD = IO_STATE(R_DMA_CH9_CMD, cmd, restart);
++ }
++
++ local_irq_restore(flags);
++
++ return IRQ_HANDLED;
++}
++
++static void tc_bulk_start_timer_func(unsigned long dummy) {
++ /* We might enable an EP descriptor behind the current DMA position when
++ it's about to decide that there are no more bulk traffic and it should
++ stop the bulk channel.
++ Therefore we periodically check if the bulk channel is stopped and there
++ is an enabled bulk EP descriptor, in which case we start the bulk
++ channel. */
++
++ if (!(*R_DMA_CH8_SUB0_CMD & IO_MASK(R_DMA_CH8_SUB0_CMD, cmd))) {
++ int epid;
++
++ timer_dbg("bulk_start_timer: Bulk DMA channel not running.\n");
++
++ for (epid = 0; epid < NBR_OF_EPIDS; epid++) {
++ if (TxBulkEPList[epid].command & IO_MASK(USB_EP_command, enable)) {
++ timer_warn("Found enabled EP for epid %d, starting bulk channel.\n",
++ epid);
++ restart_dma8_sub0();
++
++ /* Restart the bulk eot timer since we just started the bulk channel.*/
++ mod_timer(&bulk_eot_timer, jiffies + BULK_EOT_TIMER_INTERVAL);
++
++ /* No need to search any further. */
++ break;
++ }
++ }
++ } else {
++ timer_dbg("bulk_start_timer: Bulk DMA channel running.\n");
++ }
++}
++
++static void tc_bulk_eot_timer_func(unsigned long dummy) {
++ struct usb_hcd *hcd = (struct usb_hcd*)dummy;
++ ASSERT(hcd);
++ /* Because of a race condition in the top half, we might miss a bulk eot.
++ This timer "simulates" a bulk eot if we don't get one for a while,
++ hopefully correcting the situation. */
++ timer_dbg("bulk_eot_timer timed out.\n");
++ check_finished_bulk_tx_epids(hcd, 1);
++}
++
++
++/*************************************************************/
++/*************************************************************/
++/* Device driver block */
++/*************************************************************/
++/*************************************************************/
++
++/* Forward declarations for device driver functions */
++static int devdrv_hcd_probe(struct device *);
++static int devdrv_hcd_remove(struct device *);
++#ifdef CONFIG_PM
++static int devdrv_hcd_suspend(struct device *, u32, u32);
++static int devdrv_hcd_resume(struct device *, u32);
++#endif /* CONFIG_PM */
++
++/* the device */
++static struct platform_device *devdrv_hc_platform_device;
++
++/* device driver interface */
++static struct device_driver devdrv_hc_device_driver = {
++ .name = (char *) hc_name,
++ .bus = &platform_bus_type,
++
++ .probe = devdrv_hcd_probe,
++ .remove = devdrv_hcd_remove,
++
++#ifdef CONFIG_PM
++ .suspend = devdrv_hcd_suspend,
++ .resume = devdrv_hcd_resume,
++#endif /* CONFIG_PM */
++};
++
++/* initialize the host controller and driver */
++static int __init_or_module devdrv_hcd_probe(struct device *dev)
++{
++ struct usb_hcd *hcd;
++ struct crisv10_hcd *crisv10_hcd;
++ int retval;
++
++ /* Check DMA burst length */
++ if(IO_EXTRACT(R_BUS_CONFIG, dma_burst, *R_BUS_CONFIG) !=
++ IO_STATE(R_BUS_CONFIG, dma_burst, burst32)) {
++ devdrv_err("Invalid DMA burst length in Etrax 100LX,"
++ " needs to be 32\n");
++ return -EPERM;
++ }
++
++ hcd = usb_create_hcd(&crisv10_hc_driver, dev, dev->bus_id);
++ if (!hcd)
++ return -ENOMEM;
++
++ crisv10_hcd = hcd_to_crisv10_hcd(hcd);
++ spin_lock_init(&crisv10_hcd->lock);
++ crisv10_hcd->num_ports = num_ports();
++ crisv10_hcd->running = 0;
++
++ dev_set_drvdata(dev, crisv10_hcd);
++
++ devdrv_dbg("ETRAX USB IRQs HC:%d RX:%d TX:%d\n", ETRAX_USB_HC_IRQ,
++ ETRAX_USB_RX_IRQ, ETRAX_USB_TX_IRQ);
++
++ /* Print out chip version read from registers */
++ int rev_maj = *R_USB_REVISION & IO_MASK(R_USB_REVISION, major);
++ int rev_min = *R_USB_REVISION & IO_MASK(R_USB_REVISION, minor);
++ if(rev_min == 0) {
++ devdrv_info("Etrax 100LX USB Revision %d v1,2\n", rev_maj);
++ } else {
++ devdrv_info("Etrax 100LX USB Revision %d v%d\n", rev_maj, rev_min);
++ }
++
++ devdrv_info("Bulk timer interval, start:%d eot:%d\n",
++ BULK_START_TIMER_INTERVAL,
++ BULK_EOT_TIMER_INTERVAL);
++
++
++ /* Init root hub data structures */
++ if(rh_init()) {
++ devdrv_err("Failed init data for Root Hub\n");
++ retval = -ENOMEM;
++ }
++
++ if(port_in_use(0)) {
++ if (cris_request_io_interface(if_usb_1, "ETRAX100LX USB-HCD")) {
++ printk(KERN_CRIT "usb-host: request IO interface usb1 failed");
++ retval = -EBUSY;
++ goto out;
++ }
++ devdrv_info("Claimed interface for USB physical port 1\n");
++ }
++ if(port_in_use(1)) {
++ if (cris_request_io_interface(if_usb_2, "ETRAX100LX USB-HCD")) {
++ /* Free first interface if second failed to be claimed */
++ if(port_in_use(0)) {
++ cris_free_io_interface(if_usb_1);
++ }
++ printk(KERN_CRIT "usb-host: request IO interface usb2 failed");
++ retval = -EBUSY;
++ goto out;
++ }
++ devdrv_info("Claimed interface for USB physical port 2\n");
++ }
++
++ /* Init transfer controller structs and locks */
++ if((retval = tc_init(hcd)) != 0) {
++ goto out;
++ }
++
++ /* Attach interrupt functions for DMA and init DMA controller */
++ if((retval = tc_dma_init(hcd)) != 0) {
++ goto out;
++ }
++
++ /* Attach the top IRQ handler for USB controller interrupts */
++ if (request_irq(ETRAX_USB_HC_IRQ, crisv10_hcd_top_irq, 0,
++ "ETRAX 100LX built-in USB (HC)", hcd)) {
++ err("Could not allocate IRQ %d for USB", ETRAX_USB_HC_IRQ);
++ retval = -EBUSY;
++ goto out;
++ }
++
++ /* iso_eof is only enabled when isoc traffic is running. */
++ *R_USB_IRQ_MASK_SET =
++ /* IO_STATE(R_USB_IRQ_MASK_SET, iso_eof, set) | */
++ IO_STATE(R_USB_IRQ_MASK_SET, bulk_eot, set) |
++ IO_STATE(R_USB_IRQ_MASK_SET, epid_attn, set) |
++ IO_STATE(R_USB_IRQ_MASK_SET, port_status, set) |
++ IO_STATE(R_USB_IRQ_MASK_SET, ctl_status, set);
++
++
++ crisv10_ready_wait();
++ /* Reset the USB interface. */
++ *R_USB_COMMAND =
++ IO_STATE(R_USB_COMMAND, port_sel, nop) |
++ IO_STATE(R_USB_COMMAND, port_cmd, reset) |
++ IO_STATE(R_USB_COMMAND, ctrl_cmd, reset);
++
++ /* Designer's Reference, p. 8 - 10 says we should Initate R_USB_FM_PSTART to
++ 0x2A30 (10800), to guarantee that control traffic gets 10% of the
++ bandwidth, and periodic transfer may allocate the rest (90%).
++ This doesn't work though.
++ The value 11960 is chosen to be just after the SOF token, with a couple
++ of bit times extra for possible bit stuffing. */
++ *R_USB_FM_PSTART = IO_FIELD(R_USB_FM_PSTART, value, 11960);
++
++ crisv10_ready_wait();
++ /* Configure the USB interface as a host controller. */
++ *R_USB_COMMAND =
++ IO_STATE(R_USB_COMMAND, port_sel, nop) |
++ IO_STATE(R_USB_COMMAND, port_cmd, reset) |
++ IO_STATE(R_USB_COMMAND, ctrl_cmd, host_config);
++
++
++ /* Check so controller not busy before enabling ports */
++ crisv10_ready_wait();
++
++ /* Enable selected USB ports */
++ if(port_in_use(0)) {
++ *R_USB_PORT1_DISABLE = IO_STATE(R_USB_PORT1_DISABLE, disable, no);
++ } else {
++ *R_USB_PORT1_DISABLE = IO_STATE(R_USB_PORT1_DISABLE, disable, yes);
++ }
++ if(port_in_use(1)) {
++ *R_USB_PORT2_DISABLE = IO_STATE(R_USB_PORT2_DISABLE, disable, no);
++ } else {
++ *R_USB_PORT2_DISABLE = IO_STATE(R_USB_PORT2_DISABLE, disable, yes);
++ }
++
++ crisv10_ready_wait();
++ /* Start processing of USB traffic. */
++ *R_USB_COMMAND =
++ IO_STATE(R_USB_COMMAND, port_sel, nop) |
++ IO_STATE(R_USB_COMMAND, port_cmd, reset) |
++ IO_STATE(R_USB_COMMAND, ctrl_cmd, host_run);
++
++ /* Do not continue probing initialization before USB interface is done */
++ crisv10_ready_wait();
++
++ /* Register our Host Controller to USB Core
++ * Finish the remaining parts of generic HCD initialization: allocate the
++ * buffers of consistent memory, register the bus
++ * and call the driver's reset() and start() routines. */
++ retval = usb_add_hcd(hcd, ETRAX_USB_HC_IRQ, IRQF_DISABLED);
++ if (retval != 0) {
++ devdrv_err("Failed registering HCD driver\n");
++ goto out;
++ }
++
++ return 0;
++
++ out:
++ devdrv_hcd_remove(dev);
++ return retval;
++}
++
++
++/* cleanup after the host controller and driver */
++static int __init_or_module devdrv_hcd_remove(struct device *dev)
++{
++ struct crisv10_hcd *crisv10_hcd = dev_get_drvdata(dev);
++ struct usb_hcd *hcd;
++
++ if (!crisv10_hcd)
++ return 0;
++ hcd = crisv10_hcd_to_hcd(crisv10_hcd);
++
++
++ /* Stop USB Controller in Etrax 100LX */
++ crisv10_hcd_reset(hcd);
++
++ usb_remove_hcd(hcd);
++ devdrv_dbg("Removed HCD from USB Core\n");
++
++ /* Free USB Controller IRQ */
++ free_irq(ETRAX_USB_HC_IRQ, NULL);
++
++ /* Free resources */
++ tc_dma_destroy();
++ tc_destroy();
++
++
++ if(port_in_use(0)) {
++ cris_free_io_interface(if_usb_1);
++ }
++ if(port_in_use(1)) {
++ cris_free_io_interface(if_usb_2);
++ }
++
++ devdrv_dbg("Freed all claimed resources\n");
++
++ return 0;
++}
++
++
++#ifdef CONFIG_PM
++
++static int devdrv_hcd_suspend(struct usb_hcd *hcd, u32 state, u32 level)
++{
++ return 0; /* no-op for now */
++}
++
++static int devdrv_hcd_resume(struct usb_hcd *hcd, u32 level)
++{
++ return 0; /* no-op for now */
++}
++
++#endif /* CONFIG_PM */
++
++
++
++/*************************************************************/
++/*************************************************************/
++/* Module block */
++/*************************************************************/
++/*************************************************************/
++
++/* register driver */
++static int __init module_hcd_init(void)
++{
++
++ if (usb_disabled())
++ return -ENODEV;
++
++ /* Here we select enabled ports by following defines created from
++ menuconfig */
++#ifndef CONFIG_ETRAX_USB_HOST_PORT1
++ ports &= ~(1<<0);
++#endif
++#ifndef CONFIG_ETRAX_USB_HOST_PORT2
++ ports &= ~(1<<1);
++#endif
++
++ printk(KERN_INFO "%s version "VERSION" "COPYRIGHT"\n", product_desc);
++
++ devdrv_hc_platform_device =
++ platform_device_register_simple((char *) hc_name, 0, NULL, 0);
++
++ if (IS_ERR(devdrv_hc_platform_device))
++ return PTR_ERR(devdrv_hc_platform_device);
++ return driver_register(&devdrv_hc_device_driver);
++ /*
++ * Note that we do not set the DMA mask for the device,
++ * i.e. we pretend that we will use PIO, since no specific
++ * allocation routines are needed for DMA buffers. This will
++ * cause the HCD buffer allocation routines to fall back to
++ * kmalloc().
++ */
++}
++
++/* unregister driver */
++static void __exit module_hcd_exit(void)
++{
++ driver_unregister(&devdrv_hc_device_driver);
++}
++
++
++/* Module hooks */
++module_init(module_hcd_init);
++module_exit(module_hcd_exit);
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/hc-crisv10.h linux-2.6.29.1/drivers/usb/host/hc-crisv10.h
+--- linux-2.6.29.1.orig/drivers/usb/host/hc-crisv10.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/usb/host/hc-crisv10.h 2009-05-09 01:52:50.842184906 +0200
+@@ -0,0 +1,331 @@
++#ifndef __LINUX_ETRAX_USB_H
++#define __LINUX_ETRAX_USB_H
++
++#include <linux/types.h>
++#include <linux/list.h>
++
++struct USB_IN_Desc {
++ volatile __u16 sw_len;
++ volatile __u16 command;
++ volatile unsigned long next;
++ volatile unsigned long buf;
++ volatile __u16 hw_len;
++ volatile __u16 status;
++};
++
++struct USB_SB_Desc {
++ volatile __u16 sw_len;
++ volatile __u16 command;
++ volatile unsigned long next;
++ volatile unsigned long buf;
++};
++
++struct USB_EP_Desc {
++ volatile __u16 hw_len;
++ volatile __u16 command;
++ volatile unsigned long sub;
++ volatile unsigned long next;
++};
++
++
++/* Root Hub port status struct */
++struct crisv10_rh {
++ volatile __u16 wPortChange[2];
++ volatile __u16 wPortStatusPrev[2];
++};
++
++/* HCD description */
++struct crisv10_hcd {
++ spinlock_t lock;
++ __u8 num_ports;
++ __u8 running;
++};
++
++
++/* Endpoint HC private data description */
++struct crisv10_ep_priv {
++ int epid;
++};
++
++/* Additional software state info for a USB Controller epid */
++struct etrax_epid {
++ __u8 inuse; /* !0 = setup in Etrax and used for a endpoint */
++ __u8 disabled; /* !0 = Temporarly disabled to avoid resubmission */
++ __u8 type; /* Setup as: PIPE_BULK, PIPE_CONTROL ... */
++ __u8 out_traffic; /* !0 = This epid is for out traffic */
++};
++
++/* Struct to hold information of scheduled later URB completion */
++struct urb_later_data {
++// struct work_struct ws;
++ struct delayed_work ws;
++ struct usb_hcd *hcd;
++ struct urb *urb;
++ int urb_num;
++ int status;
++};
++
++
++typedef enum {
++ STARTED,
++ NOT_STARTED,
++ UNLINK,
++} crisv10_urb_state_t;
++
++
++struct crisv10_urb_priv {
++ /* Sequence number for this URB. Every new submited URB gets this from
++ a incrementing counter. Used when a URB is scheduled for later finish to
++ be sure that the intended URB hasn't already been completed (device
++ drivers has a tendency to reuse URBs once they are completed, causing us
++ to not be able to single old ones out only based on the URB pointer.) */
++ __u32 urb_num;
++
++ /* The first_sb field is used for freeing all SB descriptors belonging
++ to an urb. The corresponding ep descriptor's sub pointer cannot be
++ used for this since the DMA advances the sub pointer as it processes
++ the sb list. */
++ struct USB_SB_Desc *first_sb;
++
++ /* The last_sb field referes to the last SB descriptor that belongs to
++ this urb. This is important to know so we can free the SB descriptors
++ that ranges between first_sb and last_sb. */
++ struct USB_SB_Desc *last_sb;
++
++ /* The rx_offset field is used in ctrl and bulk traffic to keep track
++ of the offset in the urb's transfer_buffer where incoming data should be
++ copied to. */
++ __u32 rx_offset;
++
++ /* Counter used in isochronous transfers to keep track of the
++ number of packets received/transmitted. */
++ __u32 isoc_packet_counter;
++
++ /* Flag that marks if this Isoc Out URB has finished it's transfer. Used
++ because several URBs can be finished before list is processed */
++ __u8 isoc_out_done;
++
++ /* This field is used to pass information about the urb's current state
++ between the various interrupt handlers (thus marked volatile). */
++ volatile crisv10_urb_state_t urb_state;
++
++ /* In Ctrl transfers consist of (at least) 3 packets: SETUP, IN and ZOUT.
++ When DMA8 sub-channel 2 has processed the SB list for this sequence we
++ get a interrupt. We also get a interrupt for In transfers and which
++ one of these interrupts that comes first depends of data size and device.
++ To be sure that we have got both interrupts before we complete the URB
++ we have these to flags that shows which part that has completed.
++ We can then check when we get one of the interrupts that if the other has
++ occured it's safe for us to complete the URB, otherwise we set appropriate
++ flag and do the completion when we get the other interrupt. */
++ volatile unsigned char ctrl_zout_done;
++ volatile unsigned char ctrl_rx_done;
++
++ /* Connection between the submitted urb and ETRAX epid number */
++ __u8 epid;
++
++ /* The rx_data_list field is used for periodic traffic, to hold
++ received data for later processing in the the complete_urb functions,
++ where the data us copied to the urb's transfer_buffer. Basically, we
++ use this intermediate storage because we don't know when it's safe to
++ reuse the transfer_buffer (FIXME?). */
++ struct list_head rx_data_list;
++
++
++ /* The interval time rounded up to closest 2^N */
++ int interval;
++
++ /* Pool of EP descriptors needed if it's a INTR transfer.
++ Amount of EPs in pool correspons to how many INTR that should
++ be inserted in TxIntrEPList (max 128, defined by MAX_INTR_INTERVAL) */
++ struct USB_EP_Desc* intr_ep_pool[128];
++
++ /* The mount of EPs allocated for this INTR URB */
++ int intr_ep_pool_length;
++
++ /* Pointer to info struct if URB is scheduled to be finished later */
++ struct urb_later_data* later_data;
++};
++
++
++/* This struct is for passing data from the top half to the bottom half irq
++ handlers */
++struct crisv10_irq_reg {
++ struct usb_hcd* hcd;
++ __u32 r_usb_epid_attn;
++ __u8 r_usb_status;
++ __u16 r_usb_rh_port_status_1;
++ __u16 r_usb_rh_port_status_2;
++ __u32 r_usb_irq_mask_read;
++ __u32 r_usb_fm_number;
++ struct work_struct usb_bh;
++};
++
++
++/* This struct is for passing data from the isoc top half to the isoc bottom
++ half. */
++struct crisv10_isoc_complete_data {
++ struct usb_hcd *hcd;
++ struct urb *urb;
++ struct work_struct usb_bh;
++};
++
++/* Entry item for URB lists for each endpint */
++typedef struct urb_entry
++{
++ struct urb *urb;
++ struct list_head list;
++} urb_entry_t;
++
++/* ---------------------------------------------------------------------------
++ Virtual Root HUB
++ ------------------------------------------------------------------------- */
++/* destination of request */
++#define RH_INTERFACE 0x01
++#define RH_ENDPOINT 0x02
++#define RH_OTHER 0x03
++
++#define RH_CLASS 0x20
++#define RH_VENDOR 0x40
++
++/* Requests: bRequest << 8 | bmRequestType */
++#define RH_GET_STATUS 0x0080
++#define RH_CLEAR_FEATURE 0x0100
++#define RH_SET_FEATURE 0x0300
++#define RH_SET_ADDRESS 0x0500
++#define RH_GET_DESCRIPTOR 0x0680
++#define RH_SET_DESCRIPTOR 0x0700
++#define RH_GET_CONFIGURATION 0x0880
++#define RH_SET_CONFIGURATION 0x0900
++#define RH_GET_STATE 0x0280
++#define RH_GET_INTERFACE 0x0A80
++#define RH_SET_INTERFACE 0x0B00
++#define RH_SYNC_FRAME 0x0C80
++/* Our Vendor Specific Request */
++#define RH_SET_EP 0x2000
++
++
++/* Hub port features */
++#define RH_PORT_CONNECTION 0x00
++#define RH_PORT_ENABLE 0x01
++#define RH_PORT_SUSPEND 0x02
++#define RH_PORT_OVER_CURRENT 0x03
++#define RH_PORT_RESET 0x04
++#define RH_PORT_POWER 0x08
++#define RH_PORT_LOW_SPEED 0x09
++#define RH_C_PORT_CONNECTION 0x10
++#define RH_C_PORT_ENABLE 0x11
++#define RH_C_PORT_SUSPEND 0x12
++#define RH_C_PORT_OVER_CURRENT 0x13
++#define RH_C_PORT_RESET 0x14
++
++/* Hub features */
++#define RH_C_HUB_LOCAL_POWER 0x00
++#define RH_C_HUB_OVER_CURRENT 0x01
++
++#define RH_DEVICE_REMOTE_WAKEUP 0x00
++#define RH_ENDPOINT_STALL 0x01
++
++/* Our Vendor Specific feature */
++#define RH_REMOVE_EP 0x00
++
++
++#define RH_ACK 0x01
++#define RH_REQ_ERR -1
++#define RH_NACK 0x00
++
++/* Field definitions for */
++
++#define USB_IN_command__eol__BITNR 0 /* command macros */
++#define USB_IN_command__eol__WIDTH 1
++#define USB_IN_command__eol__no 0
++#define USB_IN_command__eol__yes 1
++
++#define USB_IN_command__intr__BITNR 3
++#define USB_IN_command__intr__WIDTH 1
++#define USB_IN_command__intr__no 0
++#define USB_IN_command__intr__yes 1
++
++#define USB_IN_status__eop__BITNR 1 /* status macros. */
++#define USB_IN_status__eop__WIDTH 1
++#define USB_IN_status__eop__no 0
++#define USB_IN_status__eop__yes 1
++
++#define USB_IN_status__eot__BITNR 5
++#define USB_IN_status__eot__WIDTH 1
++#define USB_IN_status__eot__no 0
++#define USB_IN_status__eot__yes 1
++
++#define USB_IN_status__error__BITNR 6
++#define USB_IN_status__error__WIDTH 1
++#define USB_IN_status__error__no 0
++#define USB_IN_status__error__yes 1
++
++#define USB_IN_status__nodata__BITNR 7
++#define USB_IN_status__nodata__WIDTH 1
++#define USB_IN_status__nodata__no 0
++#define USB_IN_status__nodata__yes 1
++
++#define USB_IN_status__epid__BITNR 8
++#define USB_IN_status__epid__WIDTH 5
++
++#define USB_EP_command__eol__BITNR 0
++#define USB_EP_command__eol__WIDTH 1
++#define USB_EP_command__eol__no 0
++#define USB_EP_command__eol__yes 1
++
++#define USB_EP_command__eof__BITNR 1
++#define USB_EP_command__eof__WIDTH 1
++#define USB_EP_command__eof__no 0
++#define USB_EP_command__eof__yes 1
++
++#define USB_EP_command__intr__BITNR 3
++#define USB_EP_command__intr__WIDTH 1
++#define USB_EP_command__intr__no 0
++#define USB_EP_command__intr__yes 1
++
++#define USB_EP_command__enable__BITNR 4
++#define USB_EP_command__enable__WIDTH 1
++#define USB_EP_command__enable__no 0
++#define USB_EP_command__enable__yes 1
++
++#define USB_EP_command__hw_valid__BITNR 5
++#define USB_EP_command__hw_valid__WIDTH 1
++#define USB_EP_command__hw_valid__no 0
++#define USB_EP_command__hw_valid__yes 1
++
++#define USB_EP_command__epid__BITNR 8
++#define USB_EP_command__epid__WIDTH 5
++
++#define USB_SB_command__eol__BITNR 0 /* command macros. */
++#define USB_SB_command__eol__WIDTH 1
++#define USB_SB_command__eol__no 0
++#define USB_SB_command__eol__yes 1
++
++#define USB_SB_command__eot__BITNR 1
++#define USB_SB_command__eot__WIDTH 1
++#define USB_SB_command__eot__no 0
++#define USB_SB_command__eot__yes 1
++
++#define USB_SB_command__intr__BITNR 3
++#define USB_SB_command__intr__WIDTH 1
++#define USB_SB_command__intr__no 0
++#define USB_SB_command__intr__yes 1
++
++#define USB_SB_command__tt__BITNR 4
++#define USB_SB_command__tt__WIDTH 2
++#define USB_SB_command__tt__zout 0
++#define USB_SB_command__tt__in 1
++#define USB_SB_command__tt__out 2
++#define USB_SB_command__tt__setup 3
++
++
++#define USB_SB_command__rem__BITNR 8
++#define USB_SB_command__rem__WIDTH 6
++
++#define USB_SB_command__full__BITNR 6
++#define USB_SB_command__full__WIDTH 1
++#define USB_SB_command__full__no 0
++#define USB_SB_command__full__yes 1
++
++#endif
+diff -Nur linux-2.6.29.1.orig/lib/klist.c linux-2.6.29.1/lib/klist.c
+--- linux-2.6.29.1.orig/lib/klist.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/lib/klist.c 2009-05-09 01:52:50.846185695 +0200
+@@ -60,7 +60,7 @@
+ {
+ knode->n_klist = klist;
+ /* no knode deserves to start its life dead */
+- WARN_ON(knode_dead(knode));
++ //WARN_ON(knode_dead(knode));
+ }
+
+ static void knode_kill(struct klist_node *knode)
diff --git a/target/foxboard/patches/mtd-root.patch b/target/foxboard/patches/mtd-root.patch
new file mode 100644
index 000000000..3576848be
--- /dev/null
+++ b/target/foxboard/patches/mtd-root.patch
@@ -0,0 +1,62 @@
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/Kconfig linux-2.6.29.1/drivers/mtd/Kconfig
+--- linux-2.6.29.1.orig/drivers/mtd/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/mtd/Kconfig 2009-05-02 19:24:14.444062164 +0200
+@@ -53,6 +53,11 @@
+ should normally be compiled as kernel modules. The modules perform
+ various checks and verifications when loaded.
+
++config MTD_ROOTFS_ROOT_DEV
++ bool "Automatically set 'rootfs' partition to be root filesystem"
++ depends on MTD_PARTITIONS
++ default y
++
+ config MTD_REDBOOT_PARTS
+ tristate "RedBoot partition table parsing"
+ depends on MTD_PARTITIONS
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/mtdpart.c linux-2.6.29.1/drivers/mtd/mtdpart.c
+--- linux-2.6.29.1.orig/drivers/mtd/mtdpart.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/mtd/mtdpart.c 2009-05-02 19:26:39.038093851 +0200
+@@ -18,6 +18,7 @@
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/mtd/compatmac.h>
++#include <linux/root_dev.h>
+
+ /* Our partition linked list */
+ static LIST_HEAD(mtd_partitions);
+@@ -37,7 +38,7 @@
+ * the pointer to that structure with this macro.
+ */
+ #define PART(x) ((struct mtd_part *)(x))
+-
++#define IS_PART(mtd) (mtd->read == part_read)
+
+ /*
+ * MTD methods which simply translate the effective address and pass through
+@@ -502,14 +503,23 @@
+ {
+ struct mtd_part *slave;
+ uint64_t cur_offset = 0;
+- int i;
++ int i, j, ret;
+
+ printk(KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
+
+- for (i = 0; i < nbparts; i++) {
+- slave = add_one_partition(master, parts + i, i, cur_offset);
++ for (i = 0, j = 0; i < nbparts; i++) {
++ slave = add_one_partition(master, parts + i, j++, cur_offset);
+ if (!slave)
+ return -ENOMEM;
++ if (!strcmp(parts[i].name, "rootfs") && slave->registered) {
++#ifdef CONFIG_MTD_ROOTFS_ROOT_DEV
++ if (ROOT_DEV == 0) {
++ printk(KERN_NOTICE "mtd: partition \"rootfs\" "
++ "set to be root filesystem\n");
++ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, slave->mtd.index);
++ }
++#endif
++ }
+ cur_offset = slave->offset + slave->mtd.size;
+ }
+
diff --git a/target/foxboard/tools/boot_linux b/target/foxboard/tools/boot_linux
new file mode 100755
index 000000000..e7d5807f5
--- /dev/null
+++ b/target/foxboard/tools/boot_linux
@@ -0,0 +1,512 @@
+#!/usr/bin/perl -w
+
+#*****************************************************************************
+#!
+#! FILE NAME : boot_linux
+#!
+#! PARAMETERS : -b <bootimage> the name of the boot image to use
+#! -d <device> the interface to use, e.g., eth1
+#! (defaults is eth0)
+#! -f save it in flash memory at address 0x10000
+#! -F save it in flash memory at address 0
+#! -h show some help
+#! -i <image> name of the image to use (default is fimage)
+#! -o <offset> the offset in the flash where the flashing
+#! starts
+#! -O <offset> the offset in the image file where the
+#! flashing starts from
+#! -p print the resulting etrax100boot command
+#! instead of executing it
+#! -s <size> how much to flash (default is the size of
+#! the flash minus the offset specified using
+#! -o or -f)
+#! -S <size> the size of the flash
+#!
+#! All sizes and offsets above can be specified as decimal
+#! numbers, or as hexadecimal numbers by prefixing them with 0x.
+#! It is also possible to use the suffixes k and M to specify
+#! kilo (1024) or mega (1048576).
+#!
+#! DESCRIPTION: Extract the start of the image and any registers that should
+#! be set from the kimage or fimage file, and then boot it.
+#!
+#! FUNCTIONS : convert_size
+#! extract_hw_settings
+#! get_dword
+#! calculate_sdram_init
+#! sdram_command
+#! print_help
+#!
+#!----------------------------------------------------------------------------
+#! HISTORY
+#!
+#! $Log: boot_linux,v $
+#! Revision 1.16 2004/11/01 16:32:27 starvik
+#! Corrected help text to avoid confusion
+#!
+#! Revision 1.15 2003/01/29 11:48:57 pkj
+#! Calculate a flash size large enough for the given image if the
+#! -S option is not specified.
+#!
+#! Revision 1.14 2002/11/18 14:40:09 pkj
+#! Make use of the --loop option to etrax100boot when initialising
+#! SDRAM memories. This requires a lot fewer options to be passed
+#! to the boot loader.
+#!
+#! Revision 1.13 2002/08/15 16:29:02 pkj
+#! * The -S option now accepts the size in bytes (just like the -s option).
+#! For backwards compatibility it still assumes sizes of 16 and less to
+#! be specified in MB.
+#! * The suffixes k and M can now be used with all sizes and offsets to
+#! specify them in kilo or mega.
+#!
+#! Revision 1.12 2002/08/15 15:27:34 pkj
+#! Use $opts{'x'} instead of $opt_x.
+#!
+#! Revision 1.11 2002/07/04 17:06:39 pkj
+#! * No longer specifies a bootfile by default (not needed any longer).
+#! * Implemented option -b to specify a bootfile.
+#! * Removed references to option -l (it was never implemented).
+#!
+#! Revision 1.10 2002/06/04 11:50:23 starvik
+#! Check if mrs_data is specified in kernelconfig (necessary for MCM)
+#!
+#! Revision 1.9 2002/01/29 10:38:26 pkj
+#! Change illegal to invalid.
+#!
+#! Revision 1.8 2001/09/13 12:32:10 pkj
+#! * Added option -S to specify the size of the flash (in MB), as -s
+#! is used to specify how much to flash nowadays.
+#! * Made the default size of the flash depend on the size of the image
+#! file. If it is bigger than 0x200100 then the flash is assumed to
+#! be 4 MB, otherwise it is assumed to be 2 MB.
+#! * Added verification of various options.
+#!
+#! Revision 1.7 2001/09/13 10:25:11 pkj
+#! Minor clean-up.
+#!
+#! Revision 1.6 2001/06/29 10:05:16 pkj
+#! Corrected check for SDRAM.
+#!
+#! Revision 1.5 2001/06/29 09:11:55 pkj
+#! Synchronised boot_elinux and boot_linux.
+#!
+#!----------------------------------------------------------------------------
+#! (C) Copyright 2001, Axis Communications AB, LUND, SWEDEN
+#!****************************************************************************
+# $Id: boot_linux,v 1.16 2004/11/01 16:32:27 starvik Exp $
+
+#****************** INCLUDE FILES SECTION ************************************
+
+use strict;
+
+use Getopt::Std;
+use File::Basename;
+
+#****************** VARIABLE DECLARATION SECTION *****************************
+
+use vars qw($my_name %opts);
+use vars qw($text_start $cmd);
+use vars qw($image_name $image_size);
+use vars qw($offset $source_offset $flash_size $flashing_size);
+use vars qw($sdram_timing_address $sdram_config_address);
+use vars qw($sdram_precharge $sdram_nop $sdram_refresh $sdram_mrs);
+
+#****************** CONSTANT SECTION *****************************************
+
+# Register addresses
+$sdram_timing_address = "b0000008";
+$sdram_config_address = "b000000c";
+
+# SDRAM commands
+$sdram_precharge = 3;
+$sdram_nop = 0;
+$sdram_refresh = 2;
+$sdram_mrs = 1;
+
+#****************** MAIN PROGRAM SECTION *************************************
+
+# The name of this program.
+$my_name = basename($0);
+
+# Get options
+getopts('b:d:fFhi:o:O:ps:S:', \%opts);
+
+&print_help if ($opts{'h'});
+
+# Name and existance of the image
+$image_name = ($opts{'i'} ? $opts{'i'} : 'fimage');
+die "Could not find the image $image_name!\n" unless (-s $image_name);
+
+if ($opts{'f'} || $opts{'F'})
+{
+ $image_size = -s $image_name;
+
+ $offset = ($opts{'f'} ? 0x10000 : 0);
+
+ $offset = &convert_size($opts{'o'}) if (defined($opts{'o'}));
+
+ die("$my_name: Invalid destination offset\n") if ($offset !~ /^\d+$/);
+
+ my $base_name = basename($image_name);
+ if ($base_name eq 'timage' || $base_name eq 'flash1.img')
+ {
+ $source_offset = 0;
+ }
+ else
+ {
+ $source_offset = $offset;
+ }
+
+ $source_offset = &convert_size($opts{'O'}) if (defined($opts{'O'}));
+
+ die("$my_name: Invalid source offset\n") if ($source_offset !~ /^\d+$/);
+ die("$my_name: Source offset > image size\n") if ($source_offset > $image_size);
+
+ if (defined($opts{'S'}))
+ {
+ # Backwards compatibility to allow specifying the flash size in MB
+ # without using an M suffix
+ $opts{'S'} .= 'M' if ($opts{'S'} =~ /^\d+$/ && $opts{'S'} <= 16);
+
+ $flash_size = &convert_size($opts{'S'});
+ }
+ else
+ {
+ # Calculate a flash size large enough for the image without the checksum
+ # and HWID.
+ $flash_size = ($image_size - $source_offset + $offset) & 0xFFFF0000;
+ }
+
+ die("$my_name: Invalid flash size\n") if ($flash_size !~ /^\d+$/);
+ die("$my_name: Destination offset > flash size\n") if ($offset > $flash_size);
+ if (defined($opts{'s'}))
+ {
+ $flashing_size = &convert_size($opts{'s'});
+ }
+ else
+ {
+ $flashing_size = $flash_size - $offset;
+ }
+
+ die("$my_name: Invalid size to flash\n") if ($flashing_size !~ /^\d+$/);
+
+ if ($flashing_size > $flash_size - $offset)
+ {
+ $flashing_size = $flash_size - $offset;
+ printf("Warning: Flashing size limited to 0x%lx due to the offset (0x%lx) and flash size (0x%lx).\n", $flashing_size, $offset, $flash_size);
+ }
+
+ if ($flashing_size > $image_size - $source_offset)
+ {
+ $flashing_size = $image_size - $source_offset;
+ printf("Warning: Flashing size limited to 0x%lx due to the offset (0x%lx) and image size (0x%lx).\n", $flashing_size, $source_offset, $image_size);
+ }
+}
+
+# Create the command line to boot the image
+if (system('./etrax100boot --help > /dev/null') == 0)
+{
+ $cmd = './etrax100boot';
+}
+elsif (system('svinto_boot --help > /dev/null') == 0)
+{
+ $cmd = 'svinto_boot';
+}
+else
+{
+ die("Cannot find e100boot program in your PATH!\n");
+}
+
+$cmd .= " --device $opts{'d'}" if ($opts{'d'});
+
+$cmd .= &extract_hw_settings;
+
+$cmd .= " --bootfile $opts{'b'}" if ($opts{'b'});
+$cmd .= " --file $image_name $text_start";
+
+if ($opts{'f'} || $opts{'F'})
+{
+ $cmd .= sprintf(" --flash %lx %lx %lx --jump 0",
+ hex($text_start) + $source_offset, $offset, $flashing_size);
+}
+else
+{
+ $cmd .= " --jump $text_start";
+}
+
+if ($opts{'p'})
+{
+ print "Command:\n$cmd\n";
+}
+else
+{
+ system($cmd);
+}
+
+exit 0;
+
+#****************** FUNCTION DEFINITION SECTION ******************************
+
+#*****************************************************************************
+##
+## FUNCTION NAME: convert_size
+##
+##****************************************************************************
+
+sub convert_size
+{
+ my($arg) = @_;
+ my $size;
+
+ if ($arg =~ /^0x([\da-fA-F]+)([kM])?$/)
+ {
+ $size = hex($1);
+ }
+ elsif ($arg =~ /^(\d+)([kM])?$/)
+ {
+ $size = $1;
+ }
+ else
+ {
+ return -1;
+ }
+
+ if (!defined($2))
+ {
+ return $size;
+ }
+ elsif ($2 eq 'k')
+ {
+ return $size * 1024;
+ }
+ elsif ($2 eq 'M')
+ {
+ return $size * 1048576;
+ }
+}
+
+#*****************************************************************************
+##
+## FUNCTION NAME: extract_hw_settings
+##
+##****************************************************************************
+
+sub extract_hw_settings
+{
+ my $data;
+ my $dbg_port;
+ my $sdram_enabled;
+ my $return_value = "";
+ my $sdram_config;
+
+ # The hw information table has the following format
+ #
+ # "HW_PARAM_MAGIC"
+ # text_start (dword)
+ # serial debg port (dword)
+ # sdram enabled (dword)
+ # register address (dword)
+ # register value (dword)
+ # ...
+ # 0
+
+ open(FILE, "$image_name") || die("Could not open '$image_name'");
+
+ while (<FILE>)
+ {
+ if (m/HW_PARAM_MAGIC/g)
+ {
+ # Seek to first byte after magic
+ seek(FILE, -length($_) + pos($_), 1);
+ last;
+ }
+ }
+
+ $text_start = &get_dword;
+ $dbg_port = &get_dword;
+ $sdram_enabled = int(&get_dword);
+
+ while (1)
+ {
+ my $register = &get_dword;
+ my $value = &get_dword;
+
+ last if ($register eq "00000000");
+
+ if ($sdram_enabled)
+ {
+ if ($register eq $sdram_config_address)
+ {
+ $sdram_config = $value;
+ }
+ elsif ($register eq $sdram_timing_address)
+ {
+ $return_value .= &calculate_sdram_init($value, $sdram_config);
+ next;
+ }
+ }
+
+ $return_value .= " --setreg $register $value";
+ }
+
+ close(FILE);
+
+ return $return_value;
+}
+
+#*****************************************************************************
+##
+## FUNCTION NAME: get_dword
+##
+##****************************************************************************
+
+sub get_dword
+{
+ my $data;
+
+ read(FILE, $data, 4);
+ return unpack("H8", pack("V", unpack("N", $data)));
+}
+
+#*****************************************************************************
+##
+## FUNCTION NAME: calculate_sdram_init
+##
+##****************************************************************************
+
+sub calculate_sdram_init
+{
+ # Refer to ETRAX 100LX Designers Reference for a description of SDRAM
+ # initialization
+ my $sdram_init_val = hex($_[0]);
+ my $sdram_config_val = hex($_[1]);
+ my $bus_width = $sdram_config_val & 0x00800000;
+ my $speed;
+ my $cas_latency;
+ my $mrs_data;
+ my $temp;
+ my $return_value;
+ my $value;
+
+ $mrs_data = ($sdram_init_val & 0x00ff0000) >> 16;
+ $sdram_init_val &= 0x8000ffff; # Make sure mrs data is 0
+ $sdram_init_val |= 0x80000000; # Make sure sdram is enabled
+ $speed = $sdram_init_val & 0x1000;
+ $cas_latency = $sdram_init_val & 0x3;
+ if ($speed) # 100 MHz
+ {
+ $cas_latency += 2;
+ }
+ else # 50 MHz
+ {
+ $cas_latency += 1;
+ }
+
+ # Calculate value of mrs_data
+ # CAS latency = 2 && bus_width = 32 => 0x40
+ # CAS latency = 3 && bus_width = 32 => 0x60
+ # CAS latency = 2 && bus_width = 16 => 0x20
+ # CAS latency = 3 && bus_width = 16 => 0x30
+ if ($mrs_data == 0)
+ {
+ if ($bus_width == 0) # 16 bits
+ {
+ $mrs_data = $cas_latency == 2 ? 0x20 : 0x30;
+ }
+ else # 32 bits
+ {
+ $mrs_data = $cas_latency == 2 ? 0x40 : 0x60;
+ }
+ }
+
+ $temp = $sdram_init_val | 0x0000c000; # Disable refresh
+ $return_value .= &sdram_command($temp);
+ $return_value .= " --pause 20000";
+
+ $return_value .= &sdram_command($temp, $sdram_precharge);
+ $return_value .= &sdram_command($temp, $sdram_nop);
+
+ $return_value .= " --setreg +0 7";
+ $return_value .= " --label label1";
+ $return_value .= &sdram_command($temp, $sdram_refresh);
+ $return_value .= &sdram_command($temp, $sdram_nop);
+ $return_value .= " --loop +0 label1";
+
+ $return_value .= &sdram_command($temp, $sdram_mrs, $mrs_data);
+ $return_value .= &sdram_command($temp, $sdram_nop);
+
+ $return_value .= &sdram_command($sdram_init_val);
+
+ return $return_value;
+}
+
+#*****************************************************************************
+##
+## FUNCTION NAME: sdram_command
+##
+##****************************************************************************
+
+sub sdram_command
+{
+ my($temp, $value, $mrs_data) = @_;
+
+ $value ||= 0;
+ if ($value == $sdram_mrs)
+ {
+ $value = sprintf("%lx", $temp | ($value << 9) | ($mrs_data << 16));
+ }
+ else
+ {
+ $value = sprintf("%lx", $temp | ($value << 9));
+ }
+
+ return " --setreg $sdram_timing_address $value";
+}
+
+#*****************************************************************************
+##
+## FUNCTION NAME: print_help
+##
+##****************************************************************************
+
+sub print_help
+{
+ print "\nAXIS $my_name, ", '$Revision: 1.16 $ $Date: 2004/11/01 16:32:27 $ ', "\n";
+ die <<EOT;
+Copyright (C) 2001-2002 Axis Communications AB
+
+DESCRIPTION:
+ This program is used to boot (and flash) a linux image to a box.
+ It tries to extract the required ETRAX 100 settings from the image file.
+
+SYNTAX:
+ $my_name [options]
+
+OPTIONS:
+ -b <bootfile> : The boot image to use.
+ -d <device> : The network interface to use, default is eth0.
+ -f : Save the image in the flash memory starting at
+ address 0x10000.
+ -F : Save the image in the flash memory starting at
+ address 0.
+ -h : Print this help text.
+ -i <image> : The path and name of the image to use, default
+ is fimage.
+ -o <offset> : The offset in the flash where the flashing starts.
+ -O <offset> : The offset in the image file where the flashing
+ starts from.
+ -p : Print the resulting etrax100boot command instead
+ of executing it.
+ -s <size> : How much to flash (default is the size of the
+ flash minus the offset specified using -o or -f).
+ -S <size> : The size of the flash.
+
+ All sizes and offsets above can be specified as decimal numbers, or as
+ hexadecimal numbers by prefixing them with 0x. It is also possible to use
+ the suffixes k and M to specify kilo (1024) or mega (1048576).
+
+EOT
+}
+
+#****************** END OF FILE boot_linux ***********************************
diff --git a/target/foxboard/tools/e100boot/Makefile b/target/foxboard/tools/e100boot/Makefile
new file mode 100644
index 000000000..9e9f78861
--- /dev/null
+++ b/target/foxboard/tools/e100boot/Makefile
@@ -0,0 +1,26 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= e100boot
+PKG_VERSION:= 0.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 11fd53e7824dc550e4cffbc4cd114c3e
+MASTER_SITES:= http://download.tuxfamily.org/crisos/repository/source/
+DISTFILES:= ${PKG_NAME}.tar.bz2
+WRKDIST= ${WRKDIR}/${PKG_NAME}
+
+include ../rules.mk
+
+$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
+ $(MAKE) -C $(WRKBUILD)
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(INSTALL_BIN) $(WRKBUILD)/sbl/e100boot.stripped $(BIN_DIR)/etrax100boot
+ touch $@
+
+include $(TOPDIR)/mk/tools.mk
diff --git a/target/foxboard/tools/mkfimage/Makefile b/target/foxboard/tools/mkfimage/Makefile
new file mode 100644
index 000000000..5aae0914f
--- /dev/null
+++ b/target/foxboard/tools/mkfimage/Makefile
@@ -0,0 +1,4 @@
+include $(TOPDIR)/rules.mk
+
+all:
+ $(HOSTCC) -o ${STAGING_TOOLS}/bin/mkfimage mkfimage.c
diff --git a/target/foxboard/tools/mkfimage/mkfimage b/target/foxboard/tools/mkfimage/mkfimage
new file mode 100755
index 000000000..b4f82ee6d
--- /dev/null
+++ b/target/foxboard/tools/mkfimage/mkfimage
Binary files differ
diff --git a/target/foxboard/tools/mkfimage/mkfimage.c b/target/foxboard/tools/mkfimage/mkfimage.c
new file mode 100644
index 000000000..6904170cf
--- /dev/null
+++ b/target/foxboard/tools/mkfimage/mkfimage.c
@@ -0,0 +1,72 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv){
+ unsigned char *buffer = malloc(64 * 1024);
+ struct stat s;
+ unsigned int size_vmlinux = 0, real_size_vmlinux = 0;
+ const unsigned char *magic_str = "ACME_PART_MAGIC";
+ unsigned int loop;
+ unsigned char *magic;
+
+ if(argc != 3){
+ printf("%s in out\n", argv[0]);
+ return 1;
+ }
+
+ printf("Generating image\n");
+
+ FILE *vmlinux = fopen(argv[1], "r");
+ FILE *vmlinux_out = fopen(argv[2], "w");
+ if((!vmlinux) || (!vmlinux_out)){
+ printf("Error opening a file\n");
+ return 1;
+ }
+
+ stat(argv[1], &s);
+ size_vmlinux = s.st_size;
+ real_size_vmlinux = (size_vmlinux & 0xffff0000) + 0x10000;
+
+ printf("vmlinux = 0x%.08X / 0x%.08X\n", size_vmlinux, real_size_vmlinux);
+
+ unsigned int t = fread(buffer, 1, 64 * 1024, vmlinux);
+ for(loop = 0; loop < (64 * 1024) - sizeof(magic_str); loop++){
+ if(buffer[loop] == magic_str[0]){
+ if((magic = strstr(&buffer[loop], magic_str))){
+ printf("Magic at 0x%.08X %p %p\n", magic - buffer, magic, buffer);
+ printf("Found Magic %X%X%X%X\n",
+ buffer[loop + strlen(magic_str)],
+ buffer[loop + strlen(magic_str) + 2],
+ buffer[loop + strlen(magic_str) + 1],
+ buffer[loop + strlen(magic_str) + 3]);
+
+ buffer[loop + strlen(magic_str)] = real_size_vmlinux >> 24;
+ buffer[loop + strlen(magic_str) + 2] = (real_size_vmlinux >> 16) & 0xff;
+ buffer[loop + strlen(magic_str) + 1] = (real_size_vmlinux >> 8) & 0xff;
+ buffer[loop + strlen(magic_str) + 3] = (real_size_vmlinux) & 0xff;
+
+ printf("Replaced with %.02X%.02X%.02X%.02X\n",
+ buffer[loop + strlen(magic_str)],
+ buffer[loop + strlen(magic_str) + 2],
+ buffer[loop + strlen(magic_str) + 1],
+ buffer[loop + strlen(magic_str) + 3]);
+
+ }
+ }
+ }
+
+ fwrite(buffer, 1, 64 * 1024, vmlinux_out);
+ real_size_vmlinux -= 64 * 1024;
+ do {
+ real_size_vmlinux -= 64 * 1024;
+ memset(buffer, 0, 64 * 1024);
+ fread(buffer, 1, 64 * 1024, vmlinux);
+ fwrite(buffer, 1, 64 * 1024, vmlinux_out);
+ } while (real_size_vmlinux);
+
+ return 0;
+}
diff --git a/target/foxboard/tools/rules.mk b/target/foxboard/tools/rules.mk
new file mode 100644
index 000000000..8d03c031a
--- /dev/null
+++ b/target/foxboard/tools/rules.mk
@@ -0,0 +1,9 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+WRKDIR_BASE= ${TOOLS_BUILD_DIR}
+WRKDIR= ${WRKDIR_BASE}
+
+include ${TOPDIR}/mk/buildhlp.mk
diff --git a/target/foxboard/tools/squashfs/Makefile b/target/foxboard/tools/squashfs/Makefile
new file mode 100644
index 000000000..866beabf5
--- /dev/null
+++ b/target/foxboard/tools/squashfs/Makefile
@@ -0,0 +1,27 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:= squashfs
+PKG_VERSION:= 4.0
+PKG_RELEASE:= 1
+PKG_MD5SUM:= a3c23391da4ebab0ac4a75021ddabf96
+MASTER_SITES:= ${MASTER_SITE_SOURCEFORGE:=squashfs/}
+DISTFILES:= ${PKG_NAME}${PKG_VERSION}.tar.gz
+WRKDIST= ${WRKDIR}/$(PKG_NAME)${PKG_VERSION}
+
+include ../rules.mk
+
+$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
+ $(MAKE) -C $(WRKBUILD)/squashfs-tools
+ touch $@
+
+$(WRKBUILD)/.installed:
+ $(INSTALL_BIN) $(WRKBUILD)/squashfs-tools/mksquashfs \
+ ${STAGING_TOOLS}/bin
+ touch $@
+
+include $(TOPDIR)/mk/tools.mk
diff --git a/target/foxboard/uclibc.config b/target/foxboard/uclibc.config
new file mode 100644
index 000000000..19c3e431f
--- /dev/null
+++ b/target/foxboard/uclibc.config
@@ -0,0 +1,241 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Thu Dec 25 10:29:25 2008
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+TARGET_cris=y
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="cris"
+FORCE_OPTIONS_FOR_ARCH=y
+CONFIG_CRIS=y
+# CONFIG_CRISV32 is not set
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+# DOASSERTS is not set
+DOSTRIP=y
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+EXTRA_WARNINGS=y
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/ibm-x40/Makefile b/target/ibm-x40/Makefile
new file mode 100644
index 000000000..9e5ccb25b
--- /dev/null
+++ b/target/ibm-x40/Makefile
@@ -0,0 +1,19 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+
+ifeq ($(FS),initramfs)
+imageinstall: $(BIN_DIR)/$(INITRAMFS)
+ cp $(LINUX_DIR)/arch/x86/boot/bzImage $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
+endif
diff --git a/target/ibm-x40/device.mk b/target/ibm-x40/device.mk
new file mode 100644
index 000000000..c46a2a639
--- /dev/null
+++ b/target/ibm-x40/device.mk
@@ -0,0 +1,7 @@
+ARCH:= x86
+CPU_ARCH:= i686
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -O2 -pipe
+TARGET_CFLAGS_ARCH:= -march=pentium-m
diff --git a/target/ibm-x40/files/etc/inittab b/target/ibm-x40/files/etc/inittab
new file mode 100644
index 000000000..4ab5cbe41
--- /dev/null
+++ b/target/ibm-x40/files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS
+::shutdown:/etc/init.d/rcK
+tty1::respawn:/sbin/getty -i -L tty1 115200 vt100
+
diff --git a/target/ibm-x40/files/etc/mdev.conf b/target/ibm-x40/files/etc/mdev.conf
new file mode 100644
index 000000000..82171d8ed
--- /dev/null
+++ b/target/ibm-x40/files/etc/mdev.conf
@@ -0,0 +1,14 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+device-mapper 0:0 660 @mkdir /dev/mapper
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+kmem 0:0 000
+mem 0:0 0640
+port 0:0 0640
+ptmx 0:0 666
+tty 0:0 0660
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/ibm-x40/kernel.config b/target/ibm-x40/kernel.config
new file mode 100644
index 000000000..ad87e5e3f
--- /dev/null
+++ b/target/ibm-x40/kernel.config
@@ -0,0 +1,946 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29
+# Sat Mar 28 12:28:20 2009
+#
+# CONFIG_64BIT is not set
+CONFIG_X86_32=y
+# CONFIG_X86_64 is not set
+CONFIG_X86=y
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_FAST_CMPXCHG_LOCAL=y
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+# CONFIG_GENERIC_TIME_VSYSCALL is not set
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_ZONE_DMA32 is not set
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+# CONFIG_AUDIT_ARCH is not set
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_KTIME_SCALAR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_PCSPKR_PLATFORM is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_PCI_QUIRKS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+# CONFIG_MODULE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+# CONFIG_FREEZER is not set
+
+#
+# Processor type and features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_SMP is not set
+# CONFIG_SPARSE_IRQ is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+CONFIG_X86_PC=y
+# CONFIG_X86_ELAN is not set
+# CONFIG_X86_VOYAGER is not set
+# CONFIG_X86_GENERICARCH is not set
+# CONFIG_X86_VSMP is not set
+# CONFIG_X86_RDC321X is not set
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+# CONFIG_PARAVIRT_GUEST is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+CONFIG_MPENTIUMM=y
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_GENERIC_CPU is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CPU=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_X86_XADD=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_TSC=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=4
+CONFIG_X86_DEBUGCTLMSR=y
+# CONFIG_PROCESSOR_SELECT is not set
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_CYRIX_32=y
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR_32=y
+CONFIG_CPU_SUP_TRANSMETA_32=y
+CONFIG_CPU_SUP_UMC_32=y
+# CONFIG_X86_DS is not set
+# CONFIG_X86_PTRACE_BTS is not set
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_DMI=y
+# CONFIG_IOMMU_HELPER is not set
+# CONFIG_IOMMU_API is not set
+CONFIG_NR_CPUS=1
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_X86_UP_APIC=y
+CONFIG_X86_UP_IOAPIC=y
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
+CONFIG_X86_MCE=y
+# CONFIG_X86_MCE_NONFATAL is not set
+# CONFIG_X86_MCE_P4THERMAL is not set
+# CONFIG_VM86 is not set
+# CONFIG_TOSHIBA is not set
+# CONFIG_I8K is not set
+# CONFIG_X86_REBOOTFIXUPS is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
+# CONFIG_HIGHMEM64G is not set
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_2G_OPT is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_HIGHMEM=y
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_STATIC=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_HIGHPTE is not set
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
+CONFIG_X86_RESERVE_LOW_64K=y
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+# CONFIG_MTRR_SANITIZER is not set
+# CONFIG_X86_PAT is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_PHYSICAL_START=0x100000
+# CONFIG_RELOCATABLE is not set
+CONFIG_PHYSICAL_ALIGN=0x100000
+# CONFIG_COMPAT_VDSO is not set
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+
+#
+# Power management and ACPI options
+#
+# CONFIG_PM is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+# CONFIG_PCI_GODIRECT is not set
+# CONFIG_PCI_GOOLPC is not set
+CONFIG_PCI_GOANY=y
+CONFIG_PCI_BIOS=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_LEGACY is not set
+# CONFIG_PCI_STUB is not set
+# CONFIG_HT_IRQ is not set
+CONFIG_ISA_DMA_API=y
+# CONFIG_ISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+# CONFIG_OLPC is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_HAVE_ATOMIC_IOMAP=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_LIB80211 is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+# CONFIG_BLK_DEV is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_PMP is not set
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+CONFIG_ATA_PIIX=y
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CS5535 is not set
+# CONFIG_PATA_CS5536 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+# CONFIG_NET_ETHERNET is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_CONSOLE_TRANSLATIONS is not set
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+# CONFIG_MWAVE is not set
+# CONFIG_PC8736x_GPIO is not set
+# CONFIG_NSC_GPIO is not set
+# CONFIG_CS5535_GPIO is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=512
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_X86_PLATFORM_DEVICES=y
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_DELL_RBU is not set
+# CONFIG_DCDBAS is not set
+CONFIG_DMIID=y
+# CONFIG_ISCSI_IBFT_FIND is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=y
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+CONFIG_ARCH_WANT_FRAME_POINTERS=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_USER_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+
+#
+# Tracers
+#
+# CONFIG_SYSPROF_TRACER is not set
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_STRICT_DEVMEM is not set
+# CONFIG_X86_VERBOSE_BOOTUP is not set
+# CONFIG_EARLY_PRINTK is not set
+# CONFIG_4KSTACKS is not set
+# CONFIG_DOUBLEFAULT is not set
+CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+# CONFIG_OPTIMIZE_INLINING is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+CONFIG_HAVE_KVM=y
+# CONFIG_VIRTUALIZATION is not set
+
+#
+# Library routines
+#
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+# CONFIG_CRC32 is not set
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/ibm-x40/uclibc.config b/target/ibm-x40/uclibc.config
new file mode 100644
index 000000000..ed46e1519
--- /dev/null
+++ b/target/ibm-x40/uclibc.config
@@ -0,0 +1,241 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Mon Dec 1 19:41:35 2008
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+TARGET_i386=y
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="i386"
+FORCE_OPTIONS_FOR_ARCH=y
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+CONFIG_686=y
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/linux/Config.in b/target/linux/Config.in
new file mode 100644
index 000000000..409c3f1be
--- /dev/null
+++ b/target/linux/Config.in
@@ -0,0 +1,16 @@
+source target/linux/config/Config.in.block
+source target/linux/config/Config.in.fs
+source target/linux/config/Config.in.netdevice
+source target/linux/config/Config.in.usb
+#source target/linux/config/Config.in.input
+source target/linux/config/Config.in.pcmcia
+source target/linux/config/Config.in.network
+source target/linux/config/Config.in.netfilter
+source target/linux/config/Config.in.ipvs
+source target/linux/config/Config.in.multimedia
+source target/linux/config/Config.in.crypto
+source target/linux/config/Config.in.bluetooth
+source target/linux/config/Config.in.isdn
+source target/linux/config/Config.in.misc
+source target/linux/config/Config.in.lib
+source target/linux/config/Config.in.debug
diff --git a/target/linux/config/Config.in.block b/target/linux/config/Config.in.block
new file mode 100644
index 000000000..7bd303c60
--- /dev/null
+++ b/target/linux/config/Config.in.block
@@ -0,0 +1,246 @@
+menu "Block devices support"
+
+config ADK_KERNEL_MD
+ boolean
+ default n
+
+config ADK_KERNEL_SWAP
+ boolean
+ default n
+
+config ADK_KERNEL_LBD
+ boolean
+ default n
+
+config ADK_KERNEL_BLK_DEV_IO_TRACE
+ boolean
+ default n
+
+config ADK_KERNEL_LSF
+ boolean
+ default n
+
+config ADK_KERNEL_IOSCHED_AS
+ boolean
+ default n
+
+config ADK_KERNEL_IOSCHED_DEADLINE
+ boolean
+ default n
+
+config ADK_KERNEL_IOSCHED_CFQ
+ boolean
+ default n
+
+config ADK_KERNEL_SCSI
+ boolean
+ default n
+
+#config ADK_KERNEL_IDE
+# boolean
+# default n
+#
+#config ADK_KPACKAGE_KMOD_BLK_DEV_IDE
+# prompt "kmod-ide.......................... IDE support"
+# tristate
+# select ADK_KERNEL_BLOCK
+# select ADK_KERNEL_IDE
+# default n
+# help
+# If you say Y here, you will use the full-featured IDE driver to
+# control up to ten ATA/IDE interfaces, each being able to serve a
+# "master" and a "slave" device, for a total of up to twenty ATA/IDE
+# disk/cdrom/tape/floppy drives.
+#
+# Useful information about large (>540 MB) IDE disks, multiple
+# interfaces, what to do if ATA/IDE devices are not automatically
+# detected, sound card ATA/IDE ports, module support, and other
+# topics, is contained in <file:Documentation/ide.txt>. For detailed
+# information about hard drives, consult the Disk-HOWTO and the
+# Multi-Disk-HOWTO, available from
+# <http://www.tldp.org/docs.html#howto>.
+#
+# To fine-tune ATA/IDE drive/interface parameters for improved
+# performance, look for the hdparm package at
+# <ftp://ibiblio.org/pub/Linux/system/hardware/>.
+#
+# To compile this driver as a module, choose M here and read
+# <file:Documentation/ide.txt>. The module will be called ide-mod.
+# Do not compile this driver as a module if your root file system (the
+# one containing the directory /) is located on an IDE device.
+
+config ADK_KPACKAGE_KMOD_BLK_DEV_LOOP
+ prompt "kmod-loop......................... Loop mount support"
+ tristate
+ default n
+ help
+ Saying Y here will allow you to use a regular file as a block
+ device; you can then create a file system on that block device and
+ mount it just as you would mount other block devices such as hard
+ drive partitions, CD-ROM drives or floppy drives. The loop devices
+ are block special device files with major number 7 and typically
+ called /dev/loop0, /dev/loop1 etc.
+
+ This is useful if you want to check an ISO 9660 file system before
+ burning the CD, or if you want to use floppy images without first
+ writing them to floppy. Furthermore, some Linux distributions avoid
+ the need for a dedicated Linux partition by keeping their complete
+ root file system inside a DOS FAT file using this loop device
+ driver.
+
+ To use the loop device, you need the losetup utility, found in the
+ util-linux package, see
+ <ftp://ftp.kernel.org/pub/linux/utils/util-linux/>.
+
+ The loop device driver can also be used to "hide" a file system in
+ a disk partition, floppy, or regular file, either using encryption
+ (scrambling the data) or steganography (hiding the data in the low
+ bits of, say, a sound file). This is also safe if the file resides
+ on a remote file server.
+
+ There are several ways of encrypting disks. Some of these require
+ kernel patches. The vanilla kernel offers the cryptoloop option
+ and a Device Mapper target (which is superior, as it supports all
+ file systems). If you want to use the cryptoloop, say Y to both
+ LOOP and CRYPTOLOOP, and make sure you have a recent (version 2.12
+ or later) version of util-linux. Additionally, be aware that
+ the cryptoloop is not safe for storing journaled filesystems.
+
+ Note that this loop device has nothing to do with the loopback
+ device used for network connections from the machine to itself.
+
+config ADK_KPACKAGE_KMOD_BLK_DEV_NBD
+ prompt "kmod-nbd.......................... Network Block Device"
+ tristate
+ default n
+ help
+ Saying Y here will allow your computer to be a client for network
+ block devices, i.e. it will be able to use block devices exported by
+ servers (mount file systems on them etc.). Communication between
+ client and server works over TCP/IP networking, but to the client
+ program this is hidden: it looks like a regular local file access to
+ a block device special file such as /dev/nd0.
+
+ Network block devices also allows you to run a block-device in
+ userland (making server and client physically the same computer,
+ communicating using the loopback network device).
+
+ Read <file:Documentation/nbd.txt> for more information, especially
+ about where to find the server code, which runs in user space and
+ does not need special kernel support.
+
+ Note that this has nothing to do with the network file systems NFS
+ or Coda; you can say N here even if you intend to use NFS or Coda.
+
+config ADK_KPACKAGE_KMOD_SCSI
+ prompt "kmod-scsi......................... SCSI support"
+ select ADK_KERNEL_LBD
+ select ADK_KERNEL_LSF
+ select ADK_KERNEL_IOSCHED_AS
+ depends on !ADK_KERNEL_SCSI
+ tristate
+ help
+ If you want to use a SCSI hard disk, SCSI tape drive, SCSI CD-ROM or
+ any other SCSI device under Linux, say Y and make sure that you know
+ the name of your SCSI host adapter (the card inside your computer
+ that "speaks" the SCSI protocol, also called SCSI controller),
+ because you will be asked for it.
+
+ You also need to say Y here if you have a device which speaks
+ the SCSI protocol. Examples of this include the parallel port
+ version of the IOMEGA ZIP drive, USB storage devices, Fibre
+ Channel, FireWire storage and the IDE-SCSI emulation driver.
+
+config ADK_KPACKAGE_KMOD_BLK_DEV_SD
+ prompt "kmod-scsi-disk.................... SCSI disk support"
+ depends !ADK_KERNEL_SCSI
+ depends ADK_KPACKAGE_KMOD_SCSI
+ tristate
+ help
+ If you want to use SCSI hard disks, Fibre Channel disks,
+ USB storage or the SCSI or parallel port version of
+ the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO,
+ the Disk-HOWTO and the Multi-Disk-HOWTO, available from
+ <http://www.tldp.org/docs.html#howto>. This is NOT for SCSI
+ CD-ROMs.
+
+config ADK_KPACKAGE_KMOD_BLK_DEV_SR
+ prompt "kmod-scsi-cdrom................... SCSI CDROM support"
+ depends !ADK_KERNEL_SCSI
+ depends ADK_KPACKAGE_KMOD_SCSI
+ tristate
+ help
+ If you want to use a SCSI or FireWire CD-ROM under Linux,
+ say Y and read the SCSI-HOWTO and the CDROM-HOWTO at
+ <http://www.tldp.org/docs.html#howto>. Also make sure to say
+ Y or M to "ISO 9660 CD-ROM file system support" later.
+
+config ADK_KPACKAGE_KMOD_BLK_DEV_MD
+ prompt "kmod-md........................... RAID support"
+ tristate
+ select ADK_KERNEL_MD
+ help
+
+config ADK_KPACKAGE_KMOD_MD_RAID0
+ prompt "kmod-md-raid0..................... RAID0 support"
+ tristate
+ depends ADK_KPACKAGE_KMOD_BLK_DEV_MD
+ help
+
+config ADK_KPACKAGE_KMOD_MD_RAID1
+ prompt "kmod-md-raid1..................... RAID1 support"
+ tristate
+ depends ADK_KPACKAGE_KMOD_BLK_DEV_MD
+ help
+
+config ADK_KPACKAGE_KMOD_MD_RAID456
+ prompt "kmod-md-raid456................... RAID456 support"
+ tristate
+ depends ADK_KPACKAGE_KMOD_BLK_DEV_MD
+ help
+
+config ADK_KPACKAGE_KMOD_BLK_DEV_DM
+ prompt "kmod-dm........................... Device Mapper support"
+ select ADK_KERNEL_MD
+ tristate
+ help
+ Device-mapper is a low level volume manager. It works by allowing
+ people to specify mappings for ranges of logical sectors. Various
+ mapping types are available, in addition people may write their own
+ modules containing custom mappings if they wish.
+
+ Higher level volume managers such as LVM2 use this driver.
+
+config ADK_KPACKAGE_KMOD_DM_CRYPT
+ prompt "kmod-dm-crypt................... Crypt target support"
+ depends on ADK_KPACKAGE_KMOD_BLK_DEV_DM
+ select ADK_KERNEL_MD
+ select ADK_KERNEL_CRYPTO
+ select ADK_KPACKAGE_KMOD_CRYPTO_CBC
+ select ADK_KPACKAGE_KMOD_CRYPTO_BLKCIPHER
+ tristate
+ help
+ This device-mapper target allows you to create a device that
+ transparently encrypts the data on it. You'll need to activate
+ the ciphers you're going to use in the cryptoapi configuration.
+
+ Information on how to use dm-crypt can be found on
+
+ <http://www.saout.de/misc/dm-crypt/>
+
+config ADK_KPACKAGE_KMOD_DM_SNAPSHOT
+ prompt "kmod-dm-snapshot................ Snapshot target"
+ depends on ADK_KPACKAGE_KMOD_BLK_DEV_DM
+ tristate
+ help
+ Allow volume managers to take writable snapshots of a device.
+
+config ADK_KPACKAGE_KMOD_DM_MIRROR
+ prompt "kmod-dm-mirror.................. Mirror target"
+ depends on ADK_KPACKAGE_KMOD_BLK_DEV_DM
+ tristate
+ help
+ Allow volume managers to mirror logical volumes, also
+ needed for live data migration tools such as 'pvmove'.
+
+endmenu
diff --git a/target/linux/config/Config.in.bluetooth b/target/linux/config/Config.in.bluetooth
new file mode 100644
index 000000000..7d868ace5
--- /dev/null
+++ b/target/linux/config/Config.in.bluetooth
@@ -0,0 +1,120 @@
+menu "Bluetooth"
+
+config ADK_KPACKAGE_KMOD_BT
+ prompt "kmod-bluetooth.................... Bluetooth drivers and network stack"
+ tristate
+ default n
+ help
+ Bluetooth is low-cost, low-power, short-range wireless technology.
+ It was designed as a replacement for cables and other short-range
+ technologies like IrDA. Bluetooth operates in personal area range
+ that typically extends up to 10 meters. More information about
+ Bluetooth can be found at <http://www.bluetooth.com/>.
+
+ Linux Bluetooth subsystem consist of several layers:
+ Bluetooth Core (HCI device and connection manager, scheduler)
+ HCI Device drivers (Interface to the hardware)
+ SCO Module (SCO audio links)
+ L2CAP Module (Logical Link Control and Adaptation Protocol)
+ RFCOMM Module (RFCOMM Protocol)
+ BNEP Module (Bluetooth Network Encapsulation Protocol)
+ CMTP Module (CAPI Message Transport Protocol)
+ HIDP Module (Human Interface Device Protocol)
+
+config ADK_KPACKAGE_KMOD_BT_L2CAP
+ prompt "kmod-bluetooth-l2cap.............. L2CAP protocol support"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ help
+ L2CAP (Logical Link Control and Adaptation Protocol) provides
+ connection oriented and connection-less data transport. L2CAP
+ support is required for most Bluetooth applications.
+
+
+config ADK_KPACKAGE_KMOD_BT_SCO
+ prompt "kmod-bluetooth-sco................ SCO links support"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ help
+ SCO link provides voice transport over Bluetooth. SCO support is
+ required for voice applications like Headset and Audio.
+
+config ADK_KPACKAGE_KMOD_BT_RFCOMM
+ prompt "kmod-bluetooth-rfcomm............. RFCOMM protocol support"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ depends ADK_KPACKAGE_KMOD_BT_L2CAP
+ help
+ RFCOMM provides connection oriented stream transport. RFCOMM
+ support is required for Dialup Networking, OBEX and other Bluetooth
+ applications.
+
+config ADK_KPACKAGE_KMOD_BT_BNEP
+ prompt "kmod-bluetooth-bnep............... BNEP protocol support"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ depends ADK_KPACKAGE_KMOD_BT_L2CAP
+ help
+ BNEP (Bluetooth Network Encapsulation Protocol) is Ethernet
+ emulation layer on top of Bluetooth. BNEP is required for
+ Bluetooth PAN (Personal Area Network).
+
+config ADK_KPACKAGE_KMOD_BT_HIDP
+ prompt "kmod-bluetooth-hidp............... HIDP protocol support"
+ tristate
+ default n
+ select ADK_KERNEL_HID
+ depends ADK_KPACKAGE_KMOD_BT
+ depends ADK_KPACKAGE_KMOD_BT_L2CAP
+ help
+ HIDP (Human Interface Device Protocol) is a transport layer
+ for HID reports. HIDP is required for the Bluetooth Human
+ Interface Device Profile.
+
+config ADK_KPACKAGE_KMOD_BT_HCIBTUSB
+ prompt "kmod-bluetooth-hci-usb............ HCI USB driver"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ help
+ Bluetooth HCI USB driver.
+ This driver is required if you want to use Bluetooth devices with
+ USB interface.
+
+config ADK_KPACKAGE_KMOD_BT_HCIUART
+ prompt "kmod-bluetooth-hci-uart........... HCI UART driver"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ help
+ Bluetooth HCI UART driver.
+ This driver is required if you want to use Bluetooth devices with
+ serial port interface. You will also need this driver if you have
+ UART based Bluetooth PCMCIA and CF devices like Xircom Credit Card
+ adapter and BrainBoxes Bluetooth PC Card.
+
+config ADK_KPACKAGE_KMOD_BT_HCIBCM203X
+ prompt "kmod-bluetooth-hci-bcm203x........ HCI BCM203x USB driver"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ help
+ Bluetooth HCI BCM203x USB driver.
+ This driver provides the firmware loading mechanism for the Broadcom
+ Blutonium based devices.
+
+config ADK_KPACKAGE_KMOD_BT_HCIBPA10X
+ prompt "kmod-bluetooth-hci-bpa10x......... HCI BPA10x USB driver"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_BT
+ help
+ Bluetooth HCI BPA10x USB driver.
+ This driver provides support for the Digianswer BPA 100/105 Bluetooth
+ sniffer devices.
+
+endmenu
diff --git a/target/linux/config/Config.in.crypto b/target/linux/config/Config.in.crypto
new file mode 100644
index 000000000..a2d88655d
--- /dev/null
+++ b/target/linux/config/Config.in.crypto
@@ -0,0 +1,536 @@
+menu "Crypto kernel modules"
+config ADK_KERNEL_CRYPTO
+ boolean
+ default n
+
+config ADK_KERNEL_CRYPTO_HW
+ boolean
+ default n
+
+config ADK_KERNEL_OCF_FIPS
+ boolean
+ default n
+
+config ADK_KERNEL_OCF_CRYPTODEV
+ boolean
+ default n
+
+config ADK_KERNEL_OCF_OCF
+ boolean
+ default n
+ select ADK_KERNEL_CRYPTO
+ select ADK_KERNEL_OCF_FIPS
+ select ADK_KERNEL_OCF_CRYPTODEV
+
+comment "Hardware cryptography"
+
+menu "Hardware crypto devices"
+
+config ADK_KPACKAGE_KMOD_CRYPTO_DEV_GEODE
+ prompt "Support for the Geode LX/GX AES engine"
+ tristate
+ select ADK_KERNEL_CRYPTO_HW
+ select ADK_KERNEL_CRYPTO
+ depends on ADK_LINUX_X86_ALIX1C
+ help
+ Say 'Y' here to use the AMD Geode LX processor on-board AES
+ engine for the CryptoAPI AES algorithm.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_DEV_HIFN_795X
+ prompt "Driver HIFN 795x crypto accelerator chips"
+ tristate
+ select ADK_KERNEL_CRYPTO_HW
+ select ADK_KERNEL_CRYPTO
+ select ADK_KPACKAGE_KMOD_CRYPTO_BLKCIPHER
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_DES
+ help
+ This option allows you to have support for HIFN 795x crypto adapters.
+
+endmenu
+
+menu "OpenBSD Cryptographic framework"
+depends on !ADK_LINUX_CRIS_FOXBOARD
+
+config ADK_KPACKAGE_KMOD_OCF_HIFN
+ prompt "kmod-cryptodev-hifn................ hifn engine"
+ tristate
+ default n
+ select ADK_KERNEL_OCF_OCF
+ help
+ Engine for cryptodev that uses Hifn based accelerators
+ such as the 7951, 7955, 7956, 7751, 7811.
+
+config ADK_KPACKAGE_KMOD_OCF_SAFE
+ prompt "kmod-cryptodev-safe................ safenet engine"
+ tristate
+ default n
+ select ADK_KERNEL_OCF_OCF
+ help
+ Engine for cryptodev that uses a number of the safenet Excel
+ crypto accelerators. Currently for the 1141 and 1741.
+
+config ADK_KPACKAGE_KMOD_OCF_IXP4XX
+ prompt "kmod-cryptodev-ixp4xx.............. IXP4xx engine"
+ tristate
+ default n
+ select ADK_KERNEL_OCF_OCF
+ depends on ADK_arm
+ help
+ Engine for cryptodev that uses XScale IXP4xx.
+ Requires the Intel Access library.
+
+config ADK_KPACKAGE_KMOD_OCF_TALITOS
+ prompt "kmod-cryptodev-talitos............. talitos engine"
+ tristate
+ default n
+ select ADK_KERNEL_OCF_OCF
+ depends on ADK_powerpc || ADK_m68k || ADK_ppc
+ help
+ Engine for cryptodev that uses Freescale's security engine (SEC/talitos).
+
+endmenu
+
+comment "Software cryptography"
+
+menu "Crypto core / Block and Hash modes"
+config ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ prompt "kmod-crypto-algapi.................. Crypto algorithm API"
+ tristate
+ default n
+ select ADK_KERNEL_CRYPTO
+ help
+
+config ADK_KPACKAGE_KMOD_CRYPTO_AEAD
+ prompt "kmod-crypto-aead.................... Crypto algorithm AEAD"
+ tristate
+ default n
+ select ADK_KERNEL_CRYPTO
+ help
+
+config ADK_KPACKAGE_KMOD_CRYPTO_MANAGER
+ prompt "kmod-crypto-manager.................. Crypto algorithm manager"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_AEAD
+ help
+
+config ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ prompt "kmod-crypto-hash..................... Crypto hash support"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+
+config ADK_KPACKAGE_KMOD_CRYPTO_BLKCIPHER
+ prompt "kmod-crypto-blkcipher................ Crypto block cipher support"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+
+config ADK_KPACKAGE_KMOD_CRYPTO_CBC
+ prompt "kmod-crypto-cbc...................... CBC support"
+ tristate
+ select ADK_KPACKAGE_KMOD_CRYPTO_BLKCIPHER
+ select ADK_KPACKAGE_KMOD_CRYPTO_MANAGER
+ default n
+ help
+ CBC: Cipher Block Chaining mode
+ This block cipher algorithm is required for IPSec.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_ECB
+ prompt "kmod-crypto-ecb...................... ECB support"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_BLKCIPHER
+ select ADK_KPACKAGE_KMOD_CRYPTO_MANAGER
+ help
+ ECB: Electronic CodeBook mode
+ This is the simplest block cipher algorithm. It simply encrypts
+ the input block by block.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_HMAC
+ prompt "kmod-crypto-hmac..................... HMAC support"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ select ADK_KPACKAGE_KMOD_CRYPTO_MANAGER
+ help
+ HMAC: Keyed-Hashing for Message Authentication (RFC2104).
+ This is required for IPSec.
+
+endmenu
+
+menu "Digest algorithms"
+
+config ADK_KPACKAGE_KMOD_CRYPTO_MD4
+ prompt "kmod-crypto-md4...................... MD4 digest algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ help
+ MD4 message digest algorithm (RFC1320).
+
+config ADK_KPACKAGE_KMOD_CRYPTO_MD5
+ prompt "kmod-crypto-md5...................... MD5 digest algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ help
+ MD5 message digest algorithm (RFC1321).
+
+config ADK_KPACKAGE_KMOD_CRYPTO_SHA1
+ prompt "kmod-crypto-sha1..................... SHA1 digest algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ help
+ SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
+
+config ADK_KPACKAGE_KMOD_CRYPTO_SHA256
+ prompt "kmod-crypto-sha256................... SHA256 digest algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ help
+ SHA256 secure hash standard (DFIPS 180-2).
+
+ This version of SHA implements a 256 bit hash with 128 bits of
+ security against collision attacks.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_SHA512
+ prompt "kmod-crypto-sha512................... SHA512 digest algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ help
+ SHA512 secure hash standard (DFIPS 180-2).
+
+ This version of SHA implements a 512 bit hash with 256 bits of
+ security against collision attacks.
+
+ This code also includes SHA-384, a 384 bit hash with 192 bits
+ of security against collision attacks.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_WP512
+ prompt "kmod-crypto-whirlpool................ Whirlpool digest algorithms"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ help
+ Whirlpool hash algorithm 512, 384 and 256-bit hashes
+
+ Whirlpool-512 is part of the NESSIE cryptographic primitives.
+ Whirlpool will be part of the ISO/IEC 10118-3:2003(E) standard
+
+ See also:
+ <http://planeta.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_TGR192
+ prompt "kmod-crypto-tiger.................... Tiger digest algorithms"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ help
+ Tiger hash algorithm 192, 160 and 128-bit hashes
+
+ Tiger is a hash function optimized for 64-bit processors while
+ still having decent performance on 32-bit processors.
+ Tiger was developed by Ross Anderson and Eli Biham.
+
+ See also:
+ <http://www.cs.technion.ac.il/~biham/Reports/Tiger/>.
+
+endmenu
+
+menu "Cipher algoritms"
+
+config ADK_KPACKAGE_KMOD_CRYPTO_AES
+ prompt "kmod-crypto-aes...................... AES cipher algorithms"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ AES cipher algorithms (FIPS-197). AES uses the Rijndael
+ algorithm.
+
+ Rijndael appears to be consistently a very good performer in
+ both hardware and software across a wide range of computing
+ environments regardless of its use in feedback or non-feedback
+ modes. Its key setup time is excellent, and its key agility is
+ good. Rijndael's very low memory requirements make it very well
+ suited for restricted-space environments, in which it also
+ demonstrates excellent performance. Rijndael's operations are
+ among the easiest to defend against power and timing attacks.
+
+ The AES specifies three key sizes: 128, 192 and 256 bits
+
+ See <http://csrc.nist.gov/CryptoToolkit/aes/> for more information.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_AES_586
+ prompt "kmod-crypto-aes-i586................. AES cipher algorithms (i586)"
+ tristate
+ default n
+ depends on ADK_x86
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ AES cipher algorithms (FIPS-197). AES uses the Rijndael
+ algorithm.
+
+ Rijndael appears to be consistently a very good performer in
+ both hardware and software across a wide range of computing
+ environments regardless of its use in feedback or non-feedback
+ modes. Its key setup time is excellent, and its key agility is
+ good. Rijndael's very low memory requirements make it very well
+ suited for restricted-space environments, in which it also
+ demonstrates excellent performance. Rijndael's operations are
+ among the easiest to defend against power and timing attacks.
+
+ The AES specifies three key sizes: 128, 192 and 256 bits
+
+ See <http://csrc.nist.gov/CryptoToolkit/aes/> for more information.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_ANUBIS
+ prompt "kmod-crypto-anubis................... Anubis cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ Anubis cipher algorithm.
+
+ Anubis is a variable key length cipher which can use keys from
+ 128 bits to 320 bits in length. It was evaluated as a entrant
+ in the NESSIE competition.
+
+ See also:
+ <https://www.cosic.esat.kuleuven.ac.be/nessie/reports/>
+ <http://planeta.terra.com.br/informatica/paulobarreto/AnubisPage.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_ARC4
+ prompt "kmod-crypto-arc4..................... ARC4 cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ ARC4 cipher algorithm.
+
+ ARC4 is a stream cipher using keys ranging from 8 bits to 2048
+ bits in length. This algorithm is required for driver-based
+ WEP, but it should not be for other purposes because of the
+ weakness of the algorithm.
+
+
+config ADK_KPACKAGE_KMOD_CRYPTO_BLOWFISH
+ prompt "kmod-crypto-blowfish................. Blowfish cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ Blowfish cipher algorithm, by Bruce Schneier.
+
+ This is a variable key length cipher which can use keys from 32
+ bits to 448 bits in length. It's fast, simple and specifically
+ designed for use on "large microprocessors".
+
+ See also:
+ <http://www.schneier.com/blowfish.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_CAMELLIA
+ prompt "kmod-crypto-camellia................. Camellia cipher algorithms"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ Camellia cipher algorithms module.
+
+ Camellia is a symmetric key block cipher developed jointly
+ at NTT and Mitsubishi Electric Corporation.
+
+ The Camellia specifies three key sizes: 128, 192 and 256 bits.
+
+ See also:
+ <https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_CAST5
+ prompt "kmod-crypto-cast5.................... CAST5 (CAST-128) cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ The CAST5 encryption algorithm (synonymous with CAST-128) is
+ described in RFC2144.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_CAST6
+ prompt "kmod-crypto-cast6.................... CAST6 (CATS-256) cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ The CAST6 encryption algorithm (synonymous with CAST-256) is
+ described in RFC2612.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_DES
+ prompt "kmod-crypto-des...................... DES and Triple DES EDE cipher algorithms"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
+
+config ADK_KPACKAGE_KMOD_CRYPTO_FCRYPT
+ prompt "kmod-crypto-fcrypt................... FCrypt cipher algorithms"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ FCrypt algorithm used by RxRPC.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_KHAZAD
+ prompt "kmod-crypto-khazad................... Khazad cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ Khazad cipher algorithm.
+
+ Khazad was a finalist in the initial NESSIE competition. It is
+ an algorithm optimized for 64-bit processors with good performance
+ on 32-bit processors. Khazad uses an 128 bit key size.
+
+ See also:
+ <http://planeta.terra.com.br/informatica/paulobarreto/KhazadPage.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_SERPENT
+ prompt "kmod-crypto-serpent.................. Serpent cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ Serpent cipher algorithm, by Anderson, Biham & Knudsen.
+
+ Keys are allowed to be from 0 to 256 bits in length, in steps
+ of 8 bits. Also includes the 'Tnepres' algorithm, a reversed
+ variant of Serpent for compatibility with old kerneli code.
+
+ See also:
+ <http://www.cl.cam.ac.uk/~rja14/serpent.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_TEA
+ prompt "kmod-crypto-tea...................... TEA, XTEA and XETA cipher algorithms"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ TEA cipher algorithm.
+
+ Tiny Encryption Algorithm is a simple cipher that uses
+ many rounds for security. It is very fast and uses
+ little memory.
+
+ Xtendend Tiny Encryption Algorithm is a modification to
+ the TEA algorithm to address a potential key weakness
+ in the TEA algorithm.
+
+ Xtendend Encryption Tiny Algorithm is a mis-implementation
+ of the XTEA algorithm for compatibility purposes.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_TWOFISH
+ prompt "kmod-crypto-twofish.................. Twofish cipher algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ Twofish cipher algorithm.
+
+ Twofish was submitted as an AES (Advanced Encryption Standard)
+ candidate cipher by researchers at CounterPane Systems. It is a
+ 16 round block cipher supporting key sizes of 128, 192, and 256
+ bits.
+
+ See also:
+ <http://www.schneier.com/twofish.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_TWOFISH_586
+ prompt "kmod-crypto-twofish-586.............. Twofish cipher algorithm (i586)"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ depends on ADK_x86
+ help
+ Twofish cipher algorithm.
+
+ Twofish was submitted as an AES (Advanced Encryption Standard)
+ candidate cipher by researchers at CounterPane Systems. It is a
+ 16 round block cipher supporting key sizes of 128, 192, and 256
+ bits.
+
+ See also:
+ <http://www.schneier.com/twofish.html>
+
+config ADK_KPACKAGE_KMOD_CRYPTO_NULL
+ prompt "kmod-crypto-null..................... Null algorithms"
+ tristate
+ select ADK_KPACKAGE_KMOD_CRYPTO_BLKCIPHER
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ default n
+ help
+ These are 'Null' algorithms, used by IPsec, which do nothing.
+
+endmenu
+
+menu "Compression"
+
+config ADK_KPACKAGE_KMOD_CRYPTO_DEFLATE
+ prompt "kmod-crypto-deflate.................. Deflate compression algorithm"
+ tristate
+ default n
+ select ADK_KERNEL_CRYPTO
+ help
+ This is the Deflate algorithm (RFC1951), specified for use in
+ IPSec with the IPCOMP protocol (RFC3173, RFC2394).
+
+ You will most probably want this if using IPSec.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_LZO
+ prompt "kmod-crypto-lzo...................... LZO compression algorithm"
+ tristate
+ default n
+ select ADK_KERNEL_CRYPTO
+ help
+
+config ADK_KPACKAGE_KMOD_CRYPTO_MICHAEL_MIC
+ prompt "kmod-crypto-michael-mic.............. Michael MIC keyed digest algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_ALGAPI
+ help
+ Michael MIC is used for message integrity protection in TKIP
+ (IEEE 802.11i). This algorithm is required for TKIP, but it
+ should not be used for other purposes because of the weakness
+ of the algorithm.
+
+config ADK_KPACKAGE_KMOD_CRYPTO_CRC32C
+ prompt "kmod-crypto-crc32c................... CRC32c CRC algorithm"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_CRYPTO_HASH
+ select ADK_KPACKAGE_KMOD_LIBCRC32C
+ help
+ Castagnoli, et al Cyclic Redundancy-Check Algorithm. Used
+ by iSCSI for header and data digests and by others.
+ See Castagnoli93. This implementation uses lib/libcrc32c.
+ Module will be crc32c.
+
+endmenu
+
+endmenu
diff --git a/target/linux/config/Config.in.debug b/target/linux/config/Config.in.debug
new file mode 100644
index 000000000..9c876e205
--- /dev/null
+++ b/target/linux/config/Config.in.debug
@@ -0,0 +1,53 @@
+menu "Kernel debugging"
+
+config ADK_KERNEL_DEBUG_KERNEL
+ boolean
+ default n
+
+config ADK_KERNEL_DEBUG_INFO
+ boolean
+ default n
+
+config ADK_KERNEL_KGDB
+ boolean
+ default n
+
+config ADK_KERNEL_KGDB_SERIAL_CONSOLE
+ boolean
+ default n
+
+config ADK_KERNEL_FRAME_POINTER
+ boolean
+ default n
+
+config ADK_KERNEL_MAGIC_SYSRQ
+ prompt "Magic BREAK sequence"
+ bool
+ default y
+ help
+ Enable this to be able to use the Magic SysRq functions,
+ probably using a serial console break.
+
+config ADK_KERNEL_DEBUG_FS
+ prompt "Debug Filesystem"
+ bool
+ default n
+ help
+ debugfs is a virtual file system that kernel developers use to put
+ debugging files into. Enable this option to be able to read and
+ write to these files.
+
+config ADK_KERNEL_DEBUG_WITH_KGDB
+ boolean
+ prompt "Enable remote kernel debugging using KGDB"
+ depends on ADK_TARGET_ROOTFS_NFSROOT || \
+ ADK_TARGET_ROOTFS_EXT2_CF || \
+ ADK_TARGET_ROOTFS_EXT2
+ default n
+ select ADK_KERNEL_DEBUG_KERNEL
+ select ADK_KERNEL_DEBUG_INFO
+ select ADK_KERNEL_KGDB
+ select ADK_KERNEL_KGDB_SERIAL_CONSOLE
+ select ADK_KERNEL_FRAME_POINTER
+
+endmenu
diff --git a/target/linux/config/Config.in.fs b/target/linux/config/Config.in.fs
new file mode 100644
index 000000000..020025f95
--- /dev/null
+++ b/target/linux/config/Config.in.fs
@@ -0,0 +1,201 @@
+menu "Filesystems support"
+
+config ADK_KERNEL_EXT3_FS_XATTR
+ boolean
+ default n
+
+config ADK_KERNEL_FAT_DEFAULT_CODEPAGE
+ int
+ default 850
+
+config ADK_KERNEL_FAT_DEFAULT_IOCHARSET
+ string
+ default "iso8859-1"
+
+config ADK_KPACKAGE_KMOD_EXPORTFS
+ tristate
+ default n
+ help
+
+config ADK_KPACKAGE_KMOD_EXT2_FS
+ prompt "kmod-fs-ext2...................... EXT2 filesystem support"
+ tristate
+ default n
+ depends !ADK_TARGET_ROOTFS_EXT2_CF
+ depends !ADK_KERNEL_EXT2_FS
+ help
+ Ext2 is a standard Linux file system for hard disks.
+
+config ADK_KPACKAGE_KMOD_EXT3_FS
+ prompt "kmod-fs-ext3...................... EXT3 filesystem support"
+ tristate
+ default n
+ help
+ This is the journalling version of the Second extended file system
+ (often called ext3), the de facto standard Linux file system
+ (method to organize files on a storage device) for hard disks.
+
+ The journalling code included in this driver means you do not have
+ to run e2fsck (file system checker) on your file systems after a
+ crash. The journal keeps track of any changes that were being made
+ at the time the system crashed, and can ensure that your file system
+ is consistent without the need for a lengthy check.
+
+ Other than adding the journal to the file system, the on-disk format
+ of ext3 is identical to ext2. It is possible to freely switch
+ between using the ext3 driver and the ext2 driver, as long as the
+ file system has been cleanly unmounted, or e2fsck is run on the file
+ system.
+
+ To add a journal on an existing ext2 file system or change the
+ behavior of ext3 file systems, you can use the tune2fs utility ("man
+ tune2fs"). To modify attributes of files and directories on ext3
+ file systems, use chattr ("man chattr"). You need to be using
+ e2fsprogs version 1.20 or later in order to create ext3 journals
+ (available at <http://sourceforge.net/projects/e2fsprogs/>).
+
+config ADK_KPACKAGE_KMOD_HFSPLUS_FS
+ prompt "kmod-fs-hfsplus................... HFS+ filesystem support"
+ tristate
+ select ADK_KPACKAGE_KMOD_NLS
+ select ADK_KPACKAGE_KMOD_NLS_UTF8
+ default n
+ help
+ If you say Y here, you will be able to mount extended format
+ Macintosh-formatted hard drive partitions with full read-write access.
+
+ This file system is often called HFS+ and was introduced with
+ MacOS 8. It includes all Mac specific filesystem data such as
+ data forks and creator codes, but it also has several UNIX
+ style features such as file ownership and permissions.
+
+
+source "package/ntfs-3g/Config.in"
+
+config ADK_KPACKAGE_KMOD_NTFS_FS
+ prompt "kmod-fs-ntfs...................... NTFS file system support"
+ tristate
+ select ADK_KPACKAGE_KMOD_NLS
+ default n
+ help
+ NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
+
+ Saying Y or M here enables read support. There is partial, but
+ safe, write support available. For write support you must also
+ say Y to "NTFS write support" below.
+
+ There are also a number of user-space tools available, called
+ ntfsprogs. These include ntfsundelete and ntfsresize, that work
+ without NTFS support enabled in the kernel.
+
+ This is a rewrite from scratch of Linux NTFS support and replaced
+ the old NTFS code starting with Linux 2.5.11. A backport to
+ the Linux 2.4 kernel series is separately available as a patch
+ from the project web site.
+
+ For more information see <file:Documentation/filesystems/ntfs.txt>
+ and <http://linux-ntfs.sourceforge.net/>.
+
+ If you are not using Windows NT, 2000, XP or 2003 in addition to
+ Linux on your computer it is safe to say N.
+ Kernel modules for NTFS support
+
+config ADK_KERNEL_FAT_FS
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_VFAT_FS
+ prompt "kmod-fs-vfat...................... VFAT filesystem support"
+ select ADK_KERNEL_FAT_FS
+ select ADK_KPACKAGE_KMOD_NLS
+ select ADK_KPACKAGE_KMOD_NLS_CODEPAGE_850
+ select ADK_KPACKAGE_KMOD_NLS_ISO8859_1
+ tristate
+ default n
+ help
+ This option provides support for normal Windows file systems with
+ long filenames. That includes non-compressed FAT-based file systems
+ used by Windows 95, Windows 98, Windows NT 4.0, and the Unix
+ programs from the mtools package.
+
+ The VFAT support enlarges your kernel by about 10 KB Please read the
+ file <file:Documentation/filesystems/vfat.txt> for details.
+
+config ADK_KPACKAGE_KMOD_XFS_FS
+ prompt "kmod-fs-xfs....................... XFS filesystem support"
+ tristate
+ select ADK_KPACKAGE_KMOD_EXPORTFS
+ default n
+ help
+ XFS is a high performance journaling filesystem which originated
+ on the SGI IRIX platform. It is completely multi-threaded, can
+ support large files and large filesystems, extended attributes,
+ variable block sizes, is extent based, and makes extensive use of
+ Btrees (directories, extents, free space) to aid both performance
+ and scalability.
+
+ Refer to the documentation at <http://oss.sgi.com/projects/xfs/>
+ for complete details. This implementation is on-disk compatible
+ with the IRIX version of XFS.
+
+#config ADK_KPACKAGE_KMOD_YAFFS_FS
+# prompt "kmod-fs-yaffs..................... YAFFS1/2 filesystem support"
+# tristate
+# default n
+# select ADK_KERNEL_YAFFS_FS
+# select ADK_KERNEL_YAFFS_YAFFS1
+# select ADK_KERNEL_YAFFS_YAFFS2
+# select ADK_KERNEL_YAFFS_AUTO_YAFFS2
+# select ADK_KERNEL_YAFFS_SHORT_NAMES_IN_RAM
+# help
+# Support for the YAFFS1 and YAFFS2 filesystems for the rb532 NAND
+# internal flash (for example). Say 'yes' here if you want to build
+# an initramfs for the Routerboard with access to internal flash.
+#
+config ADK_KPACKAGE_KMOD_FUSE_FS
+ prompt "kmod-fs-fuse...................... Filesystem in Userspace support"
+ tristate
+ default n
+ help
+ With FUSE it is possible to implement a fully functional
+ filesystem in a userspace program.
+
+ By enabling this, only the kernel module gets build.
+ For using it, you will most likely also want to enable
+ fuse-utils.
+
+config ADK_KERNEL_JOLIET
+ bool
+ default n
+
+config ADK_KPACKAGE_KMOD_ISO9660_FS
+ prompt "kmod-fs-iso9660................... ISO 9660 CDROM file system support"
+ tristate
+ select ADK_KERNEL_JOLIET
+ default n
+ help
+ This is the standard file system used on CD-ROMs. It was previously
+ known as "High Sierra File System" and is called "hsfs" on other
+ Unix systems. The so-called Rock-Ridge extensions which allow for
+ long Unix filenames and symbolic links are also supported by this
+ driver. If you have a CD-ROM drive and want to do more with it than
+ just listen to audio CDs and watch its LEDs, say Y (and read
+ <file:Documentation/filesystems/isofs.txt> and the CD-ROM-HOWTO,
+ available from <http://www.tldp.org/docs.html#howto>), thereby
+ enlarging your kernel by about 27 KB; otherwise say N.
+
+config ADK_KPACKAGE_KMOD_UDF_FS
+ prompt "kmod-fs-udf....................... UDF file system support"
+ tristate
+ select ADK_KPACKAGE_KMOD_CRC_ITU_T
+ default n
+ help
+ This is the new file system used on some CD-ROMs and DVDs. Say Y if
+ you intend to mount DVD discs or CDRW's written in packet mode, or
+ if written to by other UDF utilities, such as DirectCD.
+ Please read <file:Documentation/filesystems/udf.txt>.
+
+source target/linux/config/Config.in.fsnet
+source target/linux/config/Config.in.nls
+
+endmenu
diff --git a/target/linux/config/Config.in.fsnet b/target/linux/config/Config.in.fsnet
new file mode 100644
index 000000000..3cb37e52f
--- /dev/null
+++ b/target/linux/config/Config.in.fsnet
@@ -0,0 +1,139 @@
+config ADK_KPACKAGE_KMOD_CIFS
+ prompt "kmod-fs-cifs...................... CIFS support"
+ select ADK_KPACKAGE_KMOD_NLS
+ tristate
+ default n
+ help
+ This is the client VFS module for the Common Internet File System
+ (CIFS) protocol which is the successor to the Server Message Block
+ (SMB) protocol, the native file sharing mechanism for most early
+ PC operating systems. The CIFS protocol is fully supported by
+ file servers such as Windows 2000 (including Windows 2003, NT 4
+ and Windows XP) as well by Samba (which provides excellent CIFS
+ server support for Linux and many other operating systems). Limited
+ support for Windows ME and similar servers is provided as well.
+ You must use the smbfs client filesystem to access older SMB servers
+ such as OS/2 and DOS.
+
+ The intent of the cifs module is to provide an advanced
+ network file system client for mounting to CIFS compliant servers,
+ including support for dfs (hierarchical name space), secure per-user
+ session establishment, safe distributed caching (oplock), optional
+ packet signing, Unicode and other internationalization improvements,
+ and optional Winbind (nsswitch) integration. You do not need to enable
+ cifs if running only a (Samba) server. It is possible to enable both
+ smbfs and cifs (e.g. if you are using CIFS for accessing Windows 2003
+ and Samba 3 servers, and smbfs for accessing old servers). If you need
+ to mount to Samba or Windows from this machine, say Y.
+
+config ADK_KPACKAGE_KMOD_CODA_FS
+ prompt "kmod-fs-coda...................... support for coda client"
+ tristate
+ default n
+ help
+ This is the kernel part of the client for the CODA filesystem.
+
+config ADK_KERNEL_NFS_V4
+ boolean
+ depends on !ADK_TARGET_ROOTFS_NFSROOT
+ default n
+
+config ADK_KERNEL_RPCSEC_GSS_KRB5
+ boolean
+ depends on !ADK_TARGET_ROOTFS_NFSROOT
+ default n
+
+config ADK_KPACKAGE_KMOD_NFS_FS
+ prompt "kmod-fs-nfs....................... NFS client support (includes V3 support)"
+ tristate
+ default n
+ select ADK_KERNEL_NFS_V3
+ select ADK_KPACKAGE_KMOD_SUNRPC
+ depends on !ADK_TARGET_ROOTFS_NFSROOT
+ help
+ If you are connected to some other (usually local) Unix computer
+ (using SLIP, PLIP, PPP or Ethernet) and want to mount files residing
+ on that computer (the NFS server) using the Network File Sharing
+ protocol, say Y. "Mounting files" means that the client can access
+ the files with usual UNIX commands as if they were sitting on the
+ client's hard disk. For this to work, the server must run the
+ programs nfsd and mountd (but does not need to have NFS file system
+ support enabled in its kernel). NFS is explained in the Network
+ Administrator's Guide, available from
+ <http://www.tldp.org/docs.html#guide>, on its man page: "man
+ nfs", and in the NFS-HOWTO.
+
+ A superior but less widely used alternative to NFS is provided by
+ the Coda file system; see "Coda file system support" below.
+
+ If you say Y here, you should have said Y to TCP/IP networking also.
+ This option would enlarge your kernel by about 27 KB.
+
+ To compile this file system support as a module, choose M here: the
+ module will be called nfs.
+
+ If you are configuring a diskless machine which will mount its root
+ file system over NFS at boot time, say Y here and to "Kernel
+ level IP autoconfiguration" above and to "Root file system on NFS"
+ below. You cannot compile this driver as a module in this case.
+ There are two packages designed for booting diskless machines over
+ the net: netboot, available from
+ <http://ftp1.sourceforge.net/netboot/>, and Etherboot,
+ available from <http://ftp1.sourceforge.net/etherboot/>.
+
+ If you don't know what all this is about, say N.
+ Kernel modules for NFS client support
+
+config ADK_KERNEL_NFSD_V3
+ boolean
+ default n
+
+config ADK_KPACKAGE_KMOD_NFSD
+ prompt "kmod-fs-nfsd...................... NFS server support (includes V3 support)"
+ tristate
+ default n
+ select ADK_KPACKAGE_KMOD_EXPORTFS
+ select ADK_KERNEL_NFSD_V3
+ depends ADK_KPACKAGE_KMOD_NFS_FS
+ help
+ If you want your Linux box to act as an NFS *server*, so that other
+ computers on your local network which support NFS can access certain
+ directories on your box transparently, you have two options: you can
+ use the self-contained user space program nfsd, in which case you
+ should say N here, or you can say Y and use the kernel based NFS
+ server. The advantage of the kernel based solution is that it is
+ faster.
+
+ In either case, you will need support software; the respective
+ locations are given in the file <file:Documentation/Changes> in the
+ NFS section.
+
+ If you say Y here, you will get support for version 2 of the NFS
+ protocol (NFSv2). If you also want NFSv3, say Y to the next question
+ as well.
+
+ Please read the NFS-HOWTO, available from
+ <http://www.tldp.org/docs.html#howto>.
+
+config ADK_KERNEL_NFSD_V4
+ prompt "Enable NFSv4 and RPC Kerberos"
+ boolean
+ depends on ADK_KPACKAGE_KMOD_NFSD
+ select ADK_KPACKAGE_KMOD_SUNRPC_GSS
+ select ADK_KPACKAGE_KMOD_RPCSEC_GSS_KRB5
+ select ADK_KERNEL_NFS_V4
+ default n
+ help
+ NFSv4 with Kerberos authentication.
+
+config ADK_KPACKAGE_KMOD_SUNRPC
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_SUNRPC_GSS
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_RPCSEC_GSS_KRB5
+ tristate
+ default n
diff --git a/target/linux/config/Config.in.input b/target/linux/config/Config.in.input
new file mode 100644
index 000000000..5f1cffd77
--- /dev/null
+++ b/target/linux/config/Config.in.input
@@ -0,0 +1,41 @@
+menu "Input devices"
+
+config ADK_KERNEL_INPUT
+ bool
+ default n
+
+config ADK_KERNEL_INPUT_KEYBOARD
+ bool
+ default n
+
+config ADK_KERNEL_HID_SUPPORT
+ bool
+ default n
+
+config ADK_KERNEL_HID
+ tristate
+ select ADK_KERNEL_HID_SUPPORT
+ default n
+
+config ADK_KPACKAGE_KMOD_USB_HID
+ prompt "kmod-usb-hid..................... USB keyboard/mouse support"
+ tristate
+ select ADK_KERNEL_INPUT
+ select ADK_KERNEL_HID
+ select ADK_PACKAGE_KMOD_USB_CONTROLLER
+ default n
+
+config ADK_KPACKAGE_KMOD_KEYBOARD_ATKBD
+ prompt "kmod-input-keyboard.............. Keyboard support (AT)"
+ tristate
+ select ADK_KERNEL_INPUT
+ select ADK_KERNEL_INPUT_KEYBOARD
+ default n
+
+config ADK_KPACKAGE_KMOD_INPUT_MOUSEDEV
+ prompt "kmod-input-mouse................. Mouse support (PS/2)"
+ select ADK_KERNEL_INPUT
+ tristate
+ default n
+
+endmenu
diff --git a/target/linux/config/Config.in.ipvs b/target/linux/config/Config.in.ipvs
new file mode 100644
index 000000000..cec68d6cf
--- /dev/null
+++ b/target/linux/config/Config.in.ipvs
@@ -0,0 +1,118 @@
+menu "IPVS support"
+
+config ADK_KPACKAGE_KMOD_IP_VS
+ prompt "kmod-ip-vs............................ IPVS support"
+ tristate
+ select ADK_KERNEL_NETFILTER
+ default n
+
+config ADK_KERNEL_IP_VS_DEBUG
+ prompt "enable debugging support"
+ boolean
+ default n
+ depends ADK_KPACKAGE_KMOD_IP_VS
+
+menu "IPVS transport protocol load balancing support"
+ depends ADK_KPACKAGE_KMOD_IP_VS
+
+config ADK_KERNEL_IP_VS_PROTO_TCP
+ prompt "TCP load balancing support"
+ boolean
+ default n
+ help
+ This option enables support for load balancing TCP transport
+ protocol. Say Y if unsure.
+
+config ADK_KERNEL_IP_VS_PROTO_UDP
+ prompt "UDP load balancing support"
+ boolean
+ default n
+ help
+ This option enables support for load balancing UDP transport
+ protocol. Say Y if unsure.
+
+config ADK_KERNEL_IP_VS_PROTO_ESP
+ prompt "ESP load balancing support"
+ boolean
+ default n
+ help
+ This option enables support for load balancing ESP (Encapsulation
+ Security Payload) transport protocol. Say Y if unsure.
+
+config ADK_KERNEL_IP_VS_PROTO_AH
+ prompt "AH load balancing support"
+ boolean
+ default n
+ help
+ This option enables support for load balancing AH (Authentication
+ Header) transport protocol. Say Y if unsure.
+
+endmenu
+
+menu "IPVS Scheduler"
+ depends ADK_KPACKAGE_KMOD_IP_VS
+
+config ADK_KPACKAGE_KMOD_IP_VS_RR
+ prompt "kmod-ip-vs-rr......................... round-robin"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_WRR
+ prompt "kmod-ip-vs-wrr........................ weighted round-robin"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_LC
+ prompt "kmod-ip-vs-lc......................... least-connection"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_WLC
+ prompt "kmod-ip-vs-wlc........................ weighted least-connection"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_LBLC
+ prompt "kmod-ip-vs-lblc....................... locality-based least-connection"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_LBLCR
+ prompt "kmod-ip-vs-lblcr...................... locality-based least-connection with replication"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_DH
+ prompt "kmod-ip-vs-dh......................... destination hashing"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_SH
+ prompt "kmod-ip-vs-sh......................... source hashing"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_SED
+ prompt "kmod-ip-vs-sed........................ shortest expected delay"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_IP_VS_NQ
+ prompt "kmod-ip-vs-nq......................... never queue"
+ tristate
+ default n
+
+endmenu
+
+menu "IPVS application helper"
+ depends ADK_KPACKAGE_KMOD_IP_VS
+
+config ADK_KPACKAGE_KMOD_IP_VS_FTP
+ prompt "kmod-ip-vs-ftp........................ FTP protocol"
+ tristate
+ default n
+ select ADK_KERNEL_IP_VS_PROTO_TCP
+
+endmenu
+
+endmenu
diff --git a/target/linux/config/Config.in.isdn b/target/linux/config/Config.in.isdn
new file mode 100644
index 000000000..8f6da5ef8
--- /dev/null
+++ b/target/linux/config/Config.in.isdn
@@ -0,0 +1,44 @@
+menu "ISDN"
+
+config ADK_KERNEL_ISDN
+ bool
+ default n
+
+config ADK_KERNEL_ISDN_I4L
+ bool
+ default n
+
+config ADK_KERNEL_ISDN_DRV_AVMB1_VERBOSE_REASON
+ bool
+ default n
+
+config ADK_KERNEL_CAPI_AVM
+ bool
+ default n
+
+config ADK_KERNEL_CAPI_EICON
+ bool
+ default n
+
+config ADK_KERNEL_HFCMULTI_PCIMEM
+ bool
+ default n
+
+config ADK_KERNEL_ISDN_CAPI_MIDDLEWARE
+ bool
+ default n
+
+config ADK_KERNEL_ISDN_CAPI_CAPI20
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_ISDN_CAPI
+ prompt "kmod-isdn-capi.................... Support for CAPI 2.0"
+ tristate
+ select ADK_KERNEL_ISDN_CAPI_CAPI20
+ select ADK_KERNEL_ISDN
+ default n
+ help
+ Kernel support for CAPI 2.0 and /dev/capi20
+
+endmenu
diff --git a/target/linux/config/Config.in.kernel b/target/linux/config/Config.in.kernel
new file mode 100644
index 000000000..6b34b2448
--- /dev/null
+++ b/target/linux/config/Config.in.kernel
@@ -0,0 +1,82 @@
+config ADK_KERNEL_ETRAX_MTD_SIZE
+ hex
+ depends on ADK_LINUX_CRIS_FOXBOARD_CLASSIC || ADK_LINUX_CRIS_FOXBOARD_LX
+ default "0x00400000" if ADK_LINUX_CRIS_FOXBOARD_CLASSIC
+ default "0x00800000" if ADK_LINUX_CRIS_FOXBOARD_LX
+
+config ADK_KERNEL_ETRAX_DRAM_SIZE
+ int
+ depends on ADK_LINUX_CRIS_FOXBOARD_CLASSIC || ADK_LINUX_CRIS_FOXBOARD_LX
+ default "16" if ADK_LINUX_CRIS_FOXBOARD_CLASSIC
+ default "32" if ADK_LINUX_CRIS_FOXBOARD_LX
+
+config ADK_KERNEL_ETRAX_DEF_R_SDRAM_TIMING
+ hex
+ depends on ADK_LINUX_CRIS_FOXBOARD_CLASSIC || ADK_LINUX_CRIS_FOXBOARD_LX
+ default "0x80608002" if ADK_LINUX_CRIS_FOXBOARD_CLASSIC
+ default "0x80008002" if ADK_LINUX_CRIS_FOXBOARD_LX
+
+config ADK_KERNEL_NETWORK_FILESYSTEMS
+ boolean
+ default y
+
+config ADK_KERNEL_IP_PNP
+ boolean
+ default n
+
+config ADK_KERNEL_IP_PNP_DHCP
+ boolean
+ default n
+
+config ADK_KERNEL_NFS_FS
+ boolean
+ default n
+
+config ADK_KERNEL_NFS_V3
+ boolean
+ default n
+
+config ADK_KERNEL_ROOT_NFS
+ boolean
+ default n
+
+config ADK_KERNEL_LOCKD
+ boolean
+ default n
+
+config ADK_KERNEL_NFS_COMMON
+ boolean
+ default n
+
+config ADK_KERNEL_SUNRPC
+ boolean
+ default n
+
+#config ADK_KERNEL_YAFFS_FS
+# tristate
+# default n
+
+#config ADK_KERNEL_YAFFS_YAFFS1
+# boolean
+# default n
+
+#config ADK_KERNEL_YAFFS_YAFFS2
+# boolean
+# default n
+
+#config ADK_KERNEL_YAFFS_AUTO_YAFFS2
+# boolean
+# default n
+
+#config ADK_KERNEL_YAFFS_CHECKPOINT_RESERVED_BLOCKS
+# int
+# default 0
+
+#config ADK_KERNEL_YAFFS_SHORT_NAMES_IN_RAM
+# boolean
+# default n
+
+config ADK_KERNEL_EXT2_FS
+ boolean
+ default n
+
diff --git a/target/linux/config/Config.in.leds b/target/linux/config/Config.in.leds
new file mode 100644
index 000000000..46da9914b
--- /dev/null
+++ b/target/linux/config/Config.in.leds
@@ -0,0 +1,14 @@
+menu "LEDS driver support"
+
+config ADK_KERNEL_NEW_LEDS
+ bool
+ default n
+ help
+
+config ADK_KPACKAGE_KMOD_LEDS_CLASS
+ prompt "LED Class support"
+ tristate
+ default n
+ help
+
+endmenu
diff --git a/target/linux/config/Config.in.lib b/target/linux/config/Config.in.lib
new file mode 100644
index 000000000..e7b223c43
--- /dev/null
+++ b/target/linux/config/Config.in.lib
@@ -0,0 +1,42 @@
+menu "Library Routines"
+
+config ADK_KERNEL_CRC32
+ bool
+ default n
+
+config ADK_KPACKAGE_KMOD_CRC_ITU_T
+ prompt "kmod-crc-itu-t...................... CRC ITU-T V.41 functions"
+ tristate
+ default n
+ help
+ This option is provided for the case where no in-kernel-tree
+ modules require CRC ITU-T V.41 functions, but a module built outside
+ the kernel tree does. Such modules that use library CRC ITU-T V.41
+ functions require M here.
+
+config ADK_KPACKAGE_KMOD_CRC32
+ prompt "kmod-crc32.......................... provide CRC32 library functions"
+ tristate
+ depends ! ADK_KERNEL_CRC32
+ default n
+ help
+
+config ADK_KPACKAGE_KMOD_LIBCRC32C
+ prompt "kmod-libcrc32c...................... CRC32c Cyclic Redundancy-Check"
+ tristate
+ default n
+ help
+ This option is provided for the case where no in-kernel-tree
+ modules require CRC32c functions, but a module built outside the
+ kernel tree does. Such modules that use library CRC32c functions
+ require M here. See Castagnoli93.
+
+config ADK_KPACKAGE_KMOD_CRC_CCITT
+ prompt "kmod-crc-ccitt...................... provide CRC-CCITT library functions"
+ tristate
+ default n
+ help
+ This module provides CRC-CCITT library functions for kernel modules built
+ outside the kernel.
+
+endmenu
diff --git a/target/linux/config/Config.in.misc b/target/linux/config/Config.in.misc
new file mode 100644
index 000000000..eea6ccc38
--- /dev/null
+++ b/target/linux/config/Config.in.misc
@@ -0,0 +1,77 @@
+menu "Miscellaneous devices support"
+
+source target/linux/config/Config.in.leds
+
+config ADK_KERNEL_WATCHDOG
+ boolean
+ default n
+
+config ADK_KPACKAGE_KMOD_SOFT_WATCHDOG
+ prompt "kmod-softdog...................... Software watchdog"
+ tristate
+ default n
+ select ADK_KERNEL_WATCHDOG
+ help
+ A software monitoring watchdog. This will fail to reboot your system
+ from some situations that the hardware watchdog will recover
+ from. Equally it's a lot cheaper to install.
+
+config ADK_KPACKAGE_KMOD_WD1100
+ prompt "kmod-wd1100....................... Soekris net4801 watchdog"
+ tristate
+ select ADK_KERNEL_WATCHDOG
+ default n
+ help
+ Driver for the NatSemi SC1x00 series Watchdog
+ found on Soekris net4801 boards
+
+config ADK_KPACKAGE_KMOD_PARPORT
+ prompt "kmod-parport...................... generic parallel port support"
+ tristate
+ default n
+ help
+ Kernel module for generic parallel port support
+
+config ADK_KPACKAGE_KMOD_PLIP
+ prompt "kmod-plip....................... PLIP (internet over parallel port)"
+ tristate
+ default n
+ depends on ADK_KPACKAGE_KMOD_PARPORT
+ help
+ PLIP: IPv4 over parallel port, using a Turbo Laplink
+ (crossed null-printer) cable. Drivers exist for DOS
+ (from Crynwr), Linux 2.x (protocol changed and is no
+ longer compatible with Linux 1.x), FreeBSD and MirBSD.
+ This will enlarge your kernel by about 8 KiB.
+
+config ADK_KPACKAGE_KMOD_PRINTER
+ prompt "kmod-lp......................... line printer support"
+ tristate
+ default n
+ depends on ADK_KPACKAGE_KMOD_PARPORT
+ help
+ Kernel module for line printer support
+
+config ADK_KPACKAGE_KMOD_PPDEV
+ prompt "kmod-ppdev...................... userland parallel port driver"
+ tristate
+ default n
+ depends on ADK_KPACKAGE_KMOD_PARPORT
+ help
+ Kernel module for userland parallel port access
+
+config ADK_KPACKAGE_KMOD_FW_LOADER
+ prompt "kmod-fw-loader.................. userspace firmware loading support"
+ tristate
+ default n
+ help
+ This may be necessary when using drivers which require
+ loading of external firmware files.
+
+config ADK_KPACKAGE_KMOD_EEPROM_93CX6
+ prompt "kmod-eeprom-93cx6................ 93cx6 eeprom support"
+ tristate
+ default n
+ help
+
+endmenu
diff --git a/target/linux/config/Config.in.multimedia b/target/linux/config/Config.in.multimedia
new file mode 100644
index 000000000..88ee9e00c
--- /dev/null
+++ b/target/linux/config/Config.in.multimedia
@@ -0,0 +1,113 @@
+menu "Multimedia devices support"
+
+config ADK_KERNEL_SND_TIMER
+ boolean
+ default n
+
+config ADK_KERNEL_SND_PCM
+ boolean
+ default n
+
+config ADK_KERNEL_SND_HWDEP
+ boolean
+ default n
+
+config ADK_KERNEL_SND_MIXER_OSS
+ boolean
+ default n
+
+config ADK_KERNEL_SND_PCM_OSS
+ boolean
+ default n
+
+config ADK_KPACKAGE_KMOD_SOUND
+ tristate
+ default n
+ help
+ Basic support for sound.
+
+config ADK_KPACKAGE_KMOD_SND
+ prompt "kmod-sound-alsa................. ALSA sound support"
+ select ADK_KPACKAGE_KMOD_SOUND
+ select ADK_KERNEL_SND_TIMER
+ select ADK_KERNEL_SND_PCM
+ select ADK_KERNEL_SND_HWDEP
+ tristate
+ default n
+ help
+ Basic ALSA sound support.
+
+config ADK_KPACKAGE_KMOD_SND_OSSEMUL
+ prompt "kmod-sound-alsa-oss-emul........ ALSA OSS Emulation"
+ depends ADK_KPACKAGE_KMOD_SND
+ select ADK_KERNEL_SND_MIXER_OSS
+ select ADK_KERNEL_SND_PCM_OSS
+ tristate
+ default n
+ help
+ ALSA OSS Emulation
+
+config ADK_KPACKAGE_KMOD_SND_AC97_CODEC
+ prompt "kmod-sound-alsa-ac97-codec..... ALSA AC97 codec"
+ depends ADK_KPACKAGE_KMOD_SND
+ tristate
+ default n
+ help
+ ALSA AC97 driver
+
+config ADK_KPACKAGE_KMOD_SND_VIA82XX
+ prompt "kmod-sound-alsa-via82xx........ ALSA VIA82XX driver"
+ depends ADK_KPACKAGE_KMOD_SND
+ select ADK_KPACKAGE_KMOD_SND_AC97_CODEC
+ tristate
+ default n
+ help
+ ALSA VIA82XX driver
+
+config ADK_KPACKAGE_KMOD_SND_CS5535AUDIO
+ prompt "kmod-sound-alsa-cs5535......... ALSA AMD CS5535 driver (ALIX1C)"
+ depends ADK_KPACKAGE_KMOD_SND
+ select ADK_KPACKAGE_KMOD_SND_AC97_CODEC
+ depends on ADK_LINUX_X86_ALIX1C
+ tristate
+ default n
+ help
+ ALSA AMD CS5535 driver
+
+config ADK_KPACKAGE_KMOD_VIDEO_DEV
+ prompt "kmod-videodev................... Video (For Linux) kernel support"
+ tristate
+ default n
+ help
+ Support for audio/video capture and overlay devices and FM radio
+ cards. The exact capabilities of each device vary.
+
+ This kernel includes support for the new Video for Linux Two API,
+ (V4L2) as well as the original system. Drivers and applications
+ need to be rewritten to use V4L2, but drivers for popular cards
+ and applications for most video capture functions already exist.
+
+ Additional info and docs are available on the web at
+ <http://linuxtv.org>
+
+ Documentation for V4L2 is also available on the web at
+ <http://bytesex.org/v4l/>.
+
+config ADK_KPACKAGE_KMOD_VIDEO_V4L1
+ prompt "................................ Enable Video For Linux API 1 (DEPRECATED)"
+ boolean
+ default n
+ depends ADK_KPACKAGE_KMOD_VIDEO_DEV
+ help
+ Enables a compatibility API used by most V4L2 devices to allow
+ its usage with legacy applications that supports only V4L1 api.
+
+config ADK_KPACKAGE_KMOD_USB_PWC
+ prompt "kmod-usb-pwc.................... Kernel driver for USB Philips Cameras"
+ tristate
+ depends ADK_KPACKAGE_KMOD_USB
+ default n
+ help
+
+#source package/em28xx/Config.in
+endmenu
diff --git a/target/linux/config/Config.in.netdevice b/target/linux/config/Config.in.netdevice
new file mode 100644
index 000000000..49e772238
--- /dev/null
+++ b/target/linux/config/Config.in.netdevice
@@ -0,0 +1,191 @@
+menu "Network devices support"
+depends on !ADK_LINUX_CRIS_FOXBOARD
+
+config ADK_KERNEL_NET_ETHERNET
+ boolean
+ default n
+
+config ADK_KERNEL_MII
+ boolean
+ default n
+
+config ADK_KERNEL_NET_PCI
+ boolean
+ default n
+
+config ADK_KERNEL_NETDEV_1000
+ boolean
+ default n
+
+menu "Ethernet card support"
+
+config ADK_KPACKAGE_KMOD_NE2K_PCI
+ prompt "kmod-net-ne2k-pci............. NE2000 PCI driver"
+ select ADK_KERNEL_NET_ETHERNET
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_MII
+ tristate
+ default n
+ help
+ NE2000 pci driver
+
+config ADK_KPACKAGE_KMOD_E100
+ prompt "kmod-net-e100................. Intel(R) PRO/100+ driver"
+ select ADK_KERNEL_NET_ETHERNET
+ select ADK_KERNEL_NET_PCI
+ select ADK_KERNEL_MII
+ tristate
+ default n
+ help
+ Intel(R) PRO/100+ cards kernel support
+
+config ADK_KPACKAGE_KMOD_E1000
+ prompt "kmod-net-e1000................ Intel(R) PRO/1000 Gigabit Ethernet driver"
+ select ADK_KERNEL_NET_ETHERNET
+ select ADK_KERNEL_NETDEV_1000
+ tristate
+ default n
+ help
+ This driver supports Intel(R) PRO/1000 gigabit ethernet family of
+ adapters. For more information on how to identify your adapter, go
+ to the Adapter & Driver ID Guide at:
+
+ <http://support.intel.com/support/network/adapter/pro100/21397.htm>
+
+endmenu
+
+config ADK_KERNEL_WIRELESS
+ boolean
+ default n
+
+config ADK_KERNEL_WIRELESS_EXT
+ boolean
+ default n
+
+config ADK_KERNEL_MAC80211_LEDS
+ bool
+ select ADK_KPACKAGE_KMOD_LEDS_CLASS
+ select ADK_KERNEL_NEW_LEDS
+ default n
+
+config ADK_KERNEL_WLAN_80211
+ boolean
+ default n
+
+config ADK_KERNEL_RT2X00
+ boolean
+ select ADK_KPACKAGE_KMOD_RT2X00
+ select ADK_KPACKAGE_KMOD_FW_LOADER
+ select ADK_KPACKAGE_KMOD_EEPROM_93CX6
+ default n
+
+config ADK_MOD_KERNEL_CFG80211
+ tristate
+ default n
+
+config ADK_MOD_KERNEL_MAC80211
+ tristate
+ select ADK_MOD_KERNEL_CFG80211
+ select ADK_KPACKAGE_KMOD_CRYPTO_AES
+ select ADK_KPACKAGE_KMOD_CRYPTO_ECB
+ select ADK_KPACKAGE_KMOD_CRYPTO_ARC4
+ select ADK_KERNEL_CRC32
+ select ADK_KERNEL_WIRELESS
+ select ADK_KERNEL_WIRELESS_EXT
+ select ADK_KERNEL_WLAN_80211
+ select ADK_KERNEL_MAC80211_LEDS
+ default n
+
+menu "Wireless card support"
+
+config ADK_KPACKAGE_KMOD_MAC80211
+ prompt "kmod-mac80211................... mac80211 softmac"
+ tristate
+ select ADK_MOD_KERNEL_CFG80211
+ select ADK_KPACKAGE_KMOD_CRYPTO_AES
+ select ADK_KPACKAGE_KMOD_CRYPTO_ECB
+ select ADK_KPACKAGE_KMOD_CRYPTO_ARC4
+ select ADK_KERNEL_WIRELESS
+ select ADK_KERNEL_WIRELESS_EXT
+ select ADK_KERNEL_WLAN_80211
+ select ADK_KERNEL_CRC32
+ default n
+
+config ADK_KPACKAGE_KMOD_ATH5K
+ prompt "kmod-mac80211-ath5k............ Atheros 5xxx wireless cards"
+ tristate
+ select ADK_KERNEL_MAC80211_LEDS
+ depends on ADK_KPACKAGE_KMOD_MAC80211
+ default n
+ help
+ Driver for Atheros 5xxx/24xx cards.
+
+config ADK_KERNEL_ATH5K_DEBUG
+ prompt "enable debugging info via debugfs"
+ depends on ADK_KPACKAGE_KMOD_ATH5K
+ default n
+ select ADK_KERNEL_DEBUG_FS
+ boolean
+ help
+ Atheros 5xxx debugging messages.
+ Say Y, if and you will get debug options for ath5k.
+ To use this, you need to mount debugfs:
+ mkdir /debug/
+ mount -t debugfs debug /debug/
+ You will get access to files under:
+ /debug/ath5k/phy0/
+ To enable debug, pass the debug level to the debug module
+ parameter. For example:
+ insmod ath5k.ko debug=0x00000400
+
+config ADK_KPACKAGE_KMOD_RT2X00
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_RT2400PCI
+ prompt "kmod-mac80211-rt2400........... Ralink rt2400"
+ tristate
+ default n
+ select ADK_KERNEL_RT2X00
+ select ADK_KERNEL_MAC80211_LEDS
+ depends on ADK_KPACKAGE_KMOD_MAC80211
+ help
+ This adds support for rt2400 wireless chipset family.
+ Supported chips: RT2460.
+
+config ADK_KPACKAGE_KMOD_RT2500PCI
+ prompt "kmod-mac80211-rt2500........... Ralink rt2500"
+ tristate
+ default n
+ select ADK_KERNEL_RT2X00
+ select ADK_KERNEL_MAC80211_LEDS
+ depends on ADK_KPACKAGE_KMOD_MAC80211
+ help
+ This adds support for rt2500 wireless chipset family.
+ Supported chips: RT2560.
+
+config ADK_KPACKAGE_KMOD_RT61PCI
+ prompt "kmod-mac80211-rt2501........... Ralink rt2501/rt61"
+ tristate
+ default n
+ select ADK_KERNEL_RT2X00
+ select ADK_KERNEL_MAC80211_LEDS
+ select ADK_KPACKAGE_KMOD_CRC_ITU_T
+ select ADK_PACKAGE_WIRELESS_FIRMWARE_RT61
+ depends on ADK_KPACKAGE_KMOD_MAC80211
+ help
+ This adds support for rt2501 wireless chipset family.
+ Supported chips: RT2561, RT2561S & RT2661.
+
+config ADK_KERNEL_RT2X00_DEBUG
+ prompt "enable debugging info"
+ depends on ADK_KPACKAGE_KMOD_RT61PCI || \
+ ADK_KPACKAGE_KMOD_RT2500PCI || ADK_KPACKAGE_KMOD_RT2400PCI
+ default n
+ boolean
+ help
+
+source package/mac80211/Config.in
+
+endmenu
+endmenu
diff --git a/target/linux/config/Config.in.netfilter b/target/linux/config/Config.in.netfilter
new file mode 100644
index 000000000..6553471a0
--- /dev/null
+++ b/target/linux/config/Config.in.netfilter
@@ -0,0 +1,456 @@
+menu "Netfilter (Firewall/Filtering)"
+
+config ADK_KERNEL_NETFILTER
+ bool
+ default n
+
+config ADK_KERNEL_NETFILTER_ADVANCED
+ bool
+ default n
+
+config ADK_KERNEL_NETFILTER_XTABLES
+ bool
+ select ADK_KERNEL_NETFILTER
+ select ADK_KERNEL_NETFILTER_ADVANCED
+ default n
+
+config ADK_KERNEL_NETFILTER_DEBUG
+ bool
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_LAYER7_DEBUG
+ bool
+ default n
+
+config ADK_KERNEL_IP_NF_TARGET_MIRROR
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_NAT_SNMP_BASIC
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_TARGET_DSCP
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_TARGET_MARK
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_TARGET_CLASSIFY
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_TARGET_IMQ
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_TARGET_CONNMARK
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_ARPTABLES
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_COMPAT_IPCHAINS
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_COMPAT_IPFWADM
+ tristate
+ default n
+
+config ADK_KERNEL_IP6_NF_QUEUE
+ tristate
+ default n
+
+config ADK_KERNEL_IP6_NF_IPTABLES
+ tristate
+ default n
+
+config ADK_KERNEL_IP_ROUTE_FWMARK
+ bool
+ default n
+
+config ADK_KERNEL_IP_NF_QUEUE
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_TIME
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_CONDITION
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_DSCP
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_AH_ESP
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_LENGTH
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_HELPER
+ tristate
+ default n
+
+# cannot be ADK_KERNEL_IP_NF_MATCH_STATE because
+# netfilter is built as a module -> this'll always be
+# a module, too
+config ADK_KPACKAGE_KMOD_IP_NF_MATCH_STATE
+ tristate
+ select ADK_KPACKAGE_KMOD_NETFILTER_XT_MATCH_STATE
+ default n
+
+config ADK_KPACKAGE_KMOD_NETFILTER_XT_MATCH_STATE
+ tristate
+ default n
+
+# cannot be ADK_KERNEL_IP_NF_MATCH_CONNTRACK because
+# netfilter is built as a module -> this'll always be
+# a module, too
+config ADK_KPACKAGE_KMOD_IP_NF_MATCH_CONNTRACK
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_CONNMARK
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_UNCLEAN
+ tristate
+ default n
+
+config ADK_KERNEL_IP_NF_MATCH_STRING
+ tristate
+ default n
+
+menu "Core Netfilter Configuration"
+
+config ADK_KPACKAGE_KMOD_NF_CONNTRACK
+ tristate 'Netfilter connection tracking support'
+ select ADK_KERNEL_NETFILTER_XTABLES
+ help
+ Connection tracking keeps a record of what packets have passed
+ through your machine, in order to figure out how they are related
+ into connections.
+
+ Layer 3 independent connection tracking is experimental scheme
+ which generalize ip_conntrack to support other layer 3 protocols.
+
+config ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_CLASSIFY
+ tristate '"CLASSIFY" target support'
+ select ADK_KERNEL_NETFILTER_XTABLES
+ help
+ This option adds a `CLASSIFY' target, which enables the user to set
+ the priority of a packet. Some qdiscs can use this value for
+ classification, among these are:
+
+ atm, cbq, dsmark, pfifo_fast, htb, prio
+
+config ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_CONNMARK
+ tristate '"CONNMARK" target support'
+ select ADK_KERNEL_NETFILTER_XTABLES
+ select ADK_KPACKAGE_KMOD_NF_CONNTRACK
+ help
+ This option adds a `CONNMARK' target, which allows one to manipulate
+ the connection mark value. Similar to the MARK target, but
+ affects the connection mark value rather than the packet mark value.
+
+config ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_MARK
+ tristate '"MARK" target support'
+ select ADK_KERNEL_NETFILTER_XTABLES
+ help
+ This option adds a `MARK' target, which allows you to create rules
+ in the `mangle' table which alter the netfilter mark (nfmark) field
+ associated with the packet prior to routing. This can change
+ the routing method (see `Use netfilter MARK value as routing
+ key') and can also be used by other subsystems to change their
+ behavior.
+
+config ADK_KPACKAGE_KMOD_NETFILTER_XT_TARGET_NFQUEUE
+ tristate '"NFQUEUE" target support'
+ select ADK_KERNEL_NETFILTER_XTABLES
+ help
+ This target replaced the old obsolete QUEUE target.
+
+ As opposed to QUEUE, it supports 65535 different queues,
+ not just one.
+
+endmenu
+
+menu "IP: Netfilter Configuration"
+
+config ADK_KPACKAGE_KMOD_NF_CONNTRACK_IPV4
+ bool 'IPv4 connection tracking support (required for NAT)'
+ select ADK_KPACKAGE_KMOD_NF_CONNTRACK
+ help
+ Connection tracking keeps a record of what packets have passed
+ through your machine, in order to figure out how they are related
+ into connections.
+
+config ADK_KPACKAGE_KMOD_IP_NF_CT_ACCT
+ bool 'Connection tracking flow accounting'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ If this option is enabled, the connection tracking code will
+ keep per-flow packet and byte counters.
+
+ Those counters can be used for flow-based accounting or the
+ `connbytes' match.
+
+config ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK_MARK
+ bool 'Connection mark tracking support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ select ADK_KERNEL_IP_NF_MATCH_CONNMARK
+ help
+ This option enables support for connection marks, used by the
+ `CONNMARK' target and `connmark' match. Similar to the mark value
+ of packets, but this mark value is kept in the conntrack session
+ instead of the individual packets.
+
+config ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK_SECMARK
+ bool 'Connection tracking security mark support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ #FIXME select NETWORK_SECMARK
+ help
+ This option enables security markings to be applied to
+ connections. Typically they are copied to connections from
+ packets using the CONNSECMARK target and copied back from
+ connections to packets with the same target, with the packets
+ being originally labeled via SECMARK.
+
+config ADK_KPACKAGE_KMOD_IP_NF_FTP
+ tristate 'FTP protocol support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ Tracking FTP connections is problematic: special helpers are
+ required for tracking them, and doing masquerading and other forms
+ of Network Address Translation on them.
+
+config ADK_KPACKAGE_KMOD_IP_NF_IRC
+ tristate 'IRC protocol support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ There is a commonly-used extension to IRC called
+ Direct Client-to-Client Protocol (DCC). This enables users to send
+ files to each other, and also chat to each other without the need
+ of a server. DCC Sending is used anywhere you send files over IRC,
+ and DCC Chat is most commonly used by Eggdrop bots. If you are
+ using NAT, this extension will enable you to send files and initiate
+ chats. Note that you do NOT need this extension to get files or
+ have others initiate chats, or everything else in IRC.
+
+config ADK_KPACKAGE_KMOD_IP_NF_NETBIOS_NS
+ tristate 'NetBIOS name service protocol support (EXPERIMENTAL)'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ NetBIOS name service requests are sent as broadcast messages from an
+ unprivileged port and responded to with unicast messages to the
+ same port. This make them hard to firewall properly because connection
+ tracking doesn't deal with broadcasts. This helper tracks locally
+ originating NetBIOS name service requests and the corresponding
+ responses. It relies on correct IP address configuration, specifically
+ netmask and broadcast address. When properly configured, the output
+ of "ip address show" should look similar to this:
+
+ $ ip -4 address show eth0
+ 4: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
+ inet 172.16.2.252/24 brd 172.16.2.255 scope global eth0
+
+config ADK_KPACKAGE_KMOD_IP_NF_TFTP
+ tristate 'TFTP protocol support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ TFTP connection tracking helper, this is required depending
+ on how restrictive your ruleset is.
+ If you are using a tftp client behind -j SNAT or -j MASQUERADING
+ you will need this.
+
+config ADK_KPACKAGE_KMOD_IP_NF_AMANDA
+ tristate 'Amanda backup protocol support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ #FIXME TEXTSEARCH && TEXTSEARCH_KMP
+ help
+ If you are running the Amanda backup package <http://www.amanda.org/>
+ on this machine or machines that will be MASQUERADED through this
+ machine, then you may want to enable this feature. This allows the
+ connection tracking and natting code to allow the sub-channels that
+ Amanda requires for communication of the backup data, messages and
+ index.
+
+config ADK_KPACKAGE_KMOD_IP_NF_PPTP
+ tristate 'PPTP protocol support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ This module adds support for PPTP (Point to Point Tunnelling
+ Protocol, RFC2637) connection tracking and NAT.
+
+ If you are running PPTP sessions over a stateful firewall or NAT
+ box, you may want to enable this feature.
+
+ Please note that not all PPTP modes of operation are supported yet.
+ For more info, read top of the file
+ net/ipv4/netfilter/ip_conntrack_pptp.c
+
+config ADK_KPACKAGE_KMOD_IP_NF_H323
+ tristate 'H.323 protocol support (EXPERIMENTAL)'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ H.323 is a VoIP signalling protocol from ITU-T. As one of the most
+ important VoIP protocols, it is widely used by voice hardware and
+ software including voice gateways, IP phones, Netmeeting, OpenPhone,
+ Gnomemeeting, etc.
+
+ With this module you can support H.323 on a connection tracking/NAT
+ firewall.
+
+ This module supports RAS, Fast Start, H.245 Tunnelling, Call
+ Forwarding, RTP/RTCP and T.120 based audio, video, fax, chat,
+ whiteboard, file transfer, etc. For more information, please
+ visit http://nath323.sourceforge.net/.
+
+config ADK_KPACKAGE_KMOD_IP_NF_SIP
+ tristate 'SIP protocol support (EXPERIMENTAL)'
+ depends ADK_KPACKAGE_KMOD_IP_NF_CONNTRACK
+ help
+ SIP is an application-layer control protocol that can establish,
+ modify, and terminate multimedia sessions (conferences) such as
+ Internet telephony calls. With the ip_conntrack_sip and
+ the ip_nat_sip modules you can support the protocol on a connection
+ tracking/NATing firewall.
+
+
+config ADK_KPACKAGE_KMOD_IP_NF_IPTABLES
+ tristate 'IP tables support (required for filtering/masq/NAT)'
+ select ADK_KERNEL_NETFILTER_XTABLES
+ help
+ iptables is a general, extensible packet identification framework.
+ The packet filtering and full NAT (masquerading, port forwarding,
+ etc) subsystems now use this: say `Y' or `M' here if you want to use
+ either of those.
+
+config ADK_KPACKAGE_KMOD_IP_NF_FILTER
+ tristate 'Packet Filtering'
+ depends ADK_KPACKAGE_KMOD_IP_NF_IPTABLES
+ help
+ Packet filtering defines a table `filter', which has a series of
+ rules for simple packet filtering at local input, forwarding and
+ local output. See the man page for iptables(8).
+
+config ADK_KPACKAGE_KMOD_NF_NAT
+ tristate 'Full NAT'
+ depends ADK_KPACKAGE_KMOD_IP_NF_IPTABLES
+ help
+ The Full NAT option allows masquerading, port forwarding and other
+ forms of full Network Address Port Translation. It is controlled by
+ the `nat' table in iptables: see the man page for iptables(8).
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_MASQUERADE
+ tristate 'MASQUERADE target support'
+ depends ADK_KPACKAGE_KMOD_NF_NAT
+ help
+ Masquerading is a special case of NAT: all outgoing connections are
+ changed to seem to come from a particular interface's address, and
+ if the interface goes down, those connections are lost. This is
+ only useful for dialup accounts with dynamic IP address (ie. your IP
+ address will be different on next dialup).
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_REJECT
+ tristate 'REJECT target support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_FILTER
+ help
+ The REJECT target allows a filtering rule to specify that an ICMP
+ error should be issued in response to an incoming packet, rather
+ than silently being dropped.
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_LOG
+ tristate 'LOG target support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_FILTER
+ help
+ This option adds a `LOG' target, which allows you to create rules in
+ any iptables table which records the packet header to the syslog.
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_ULOG
+ tristate 'ULOG target support (ipv4 only)'
+ depends ADK_KPACKAGE_KMOD_IP_NF_FILTER
+ help
+ This option enables the old IPv4-only "ipt_ULOG" implementation
+ which has been obsoleted by the new "nfnetlink_log" code (see
+ CONFIG_NETFILTER_NETLINK_LOG).
+
+ This option adds a `ULOG' target, which allows you to create rules in
+ any iptables table. The packet is passed to a userspace logging
+ daemon using netlink multicast sockets; unlike the LOG target
+ which can only be viewed through syslog.
+
+ The appropriate userspace logging daemon (ulogd) may be obtained from
+ <http://www.gnumonks.org/projects/ulogd/>
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_REDIRECT
+ tristate 'REDIRECT target support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_NAT
+ help
+ REDIRECT is a special case of NAT: all incoming connections are
+ mapped onto the incoming interface's address, causing the packets to
+ come to the local machine instead of passing through. This is
+ useful for transparent proxies.
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_NETMAP
+ tristate 'NETMAP target support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_NAT
+ help
+ NETMAP is an implementation of static 1:1 NAT mapping of network
+ addresses. It maps the network address part, while keeping the host
+ address part intact. It is similar to Fast NAT, except that
+ Netfilter's connection tracking doesn't work well with Fast NAT.
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_SAME
+ tristate 'SAME target support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_NAT
+ help
+ This option adds a `SAME' target, which works like the standard SNAT
+ target, but attempts to give clients the same IP for all connections.
+
+config ADK_KPACKAGE_KMOD_IP_NF_MANGLE
+ tristate 'Packet mangling'
+ depends ADK_KPACKAGE_KMOD_IP_NF_IPTABLES
+ help
+ This option adds a `mangle' table to iptables: see the man page for
+ iptables(8). This table is used for various packet alterations
+ which can effect how the packet is routed.
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_ECN
+ tristate 'ECN target support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_MANGLE
+ help
+ This option adds a `ECN' target, which can be used in the iptables mangle
+ table.
+
+ You can use this target to remove the ECN bits from the IPv4 header of
+ an IP packet. This is particularly useful, if you need to work around
+ existing ECN blackholes on the internet, but don't want to disable
+ ECN support in general.
+
+config ADK_KPACKAGE_KMOD_IP_NF_TARGET_TTL
+ tristate 'TTL target support'
+ depends ADK_KPACKAGE_KMOD_IP_NF_MANGLE
+ help
+ This option adds a `TTL' target, which enables the user to modify
+ the TTL value of the IP header.
+
+ While it is safe to decrement/lower the TTL, this target also enables
+ functionality to increment and set the TTL value of the IP header to
+ arbitrary values. This is EXTREMELY DANGEROUS since you can easily
+ create immortal packets that loop forever on the network.
+
+endmenu
+endmenu
diff --git a/target/linux/config/Config.in.network b/target/linux/config/Config.in.network
new file mode 100644
index 000000000..724233ab3
--- /dev/null
+++ b/target/linux/config/Config.in.network
@@ -0,0 +1,232 @@
+menu "Network support"
+
+config ADK_KERNEL_INET
+ boolean
+ default y
+
+config ADK_KERNEL_IP_FIB_HASH
+ boolean
+ default y
+
+config ADK_KERNEL_SYN_COOKIES
+ boolean
+ default y
+
+config ADK_KERNEL_IP_PNP_BOOTP
+ boolean
+ default n
+
+config ADK_KERNEL_IP_PNP_RARP
+ boolean
+ default n
+
+config ADK_KERNEL_NET_IPGRE_BROADCAST
+ boolean
+ default n
+
+config ADK_KERNEL_PPP_ASYNC
+ boolean
+ default n
+
+config ADK_KERNEL_SLHC
+ boolean
+ default n
+
+config ADK_KERNEL_IMQ
+ tristate
+ default n
+
+config ADK_KERNEL_LLC
+ tristate
+ default n
+
+#config ADK_KPACKAGE_KMOD_ATM
+# prompt "kmod-atm.......................... Asynchronous Transfer Mode (ATM)"
+# tristate
+# default n
+# help
+# ATM is a high-speed networking technology for Local Area Networks
+# and Wide Area Networks. It uses a fixed packet size and is
+# connection oriented, allowing for the negotiation of minimum
+# bandwidth requirements.
+#
+# In order to participate in an ATM network, your Linux box needs an
+# ATM networking card. If you have that, say Y here and to the driver
+# of your ATM card below.
+#
+# Note that you need a set of user-space programs to actually make use
+# of ATM. See the file <file:Documentation/networking/atm.txt> for
+# further details.
+
+config ADK_KPACKAGE_KMOD_BRIDGE
+ prompt "kmod-net-bridge................... 802.1d Ethernet Bridging"
+ tristate
+ select ADK_KERNEL_LLC
+ default n
+ help
+ If you say Y here, then your Linux box will be able to act as an
+ Ethernet bridge, which means that the different Ethernet segments it
+ is connected to will appear as one Ethernet to the participants.
+ Several such bridges can work together to create even larger
+ networks of Ethernets using the IEEE 802.1 spanning tree algorithm.
+ As this is a standard, Linux bridges will cooperate properly with
+ other third party bridge products.
+
+ In order to use the Ethernet bridge, you'll need the bridge
+ configuration tools; see <file:Documentation/networking/bridge.txt>
+ for location. Please read the Bridge mini-HOWTO for more
+ information.
+
+ If you enable iptables support along with the bridge support then you
+ turn your bridge into a bridging IP firewall.
+ iptables will then see the IP packets being bridged, so you need to
+ take this into account when setting up your firewall rules.
+ Enabling arptables support when bridging will let arptables see
+ bridged ARP traffic in the arptables FORWARD chain.
+
+config ADK_KPACKAGE_KMOD_NET_IPIP
+ prompt "kmod-net-ipip..................... IP in IP encapsulation support"
+ tristate
+ default n
+ help
+ Tunneling means encapsulating data of one protocol type within
+ another protocol and sending it over a channel that understands the
+ encapsulating protocol. This particular tunneling driver implements
+ encapsulation of IP within IP, which sounds kind of pointless, but
+ can be useful if you want to make your (or some other) machine
+ appear on a different network than it physically is, or to use
+ mobile-IP facilities (allowing laptops to seamlessly move between
+ networks without changing their IP addresses).
+
+
+config ADK_KPACKAGE_KMOD_NET_IPGRE
+ prompt "kmod-net-ipgre.................... GRE tunnels over IP"
+ tristate
+ #depends ADK_KPACKAGE_KMOD_NET_IPGRE_BROADCAST
+ default n
+ help
+ Tunneling means encapsulating data of one protocol type within
+ another protocol and sending it over a channel that understands the
+ encapsulating protocol. This particular tunneling driver implements
+ GRE (Generic Routing Encapsulation) and at this time allows
+ encapsulating of IPv4 or IPv6 over existing IPv4 infrastructure.
+ This driver is useful if the other endpoint is a Cisco router: Cisco
+ likes GRE much better than the other Linux tunneling driver ("IP
+ tunneling" above). In addition, GRE allows multicast redistribution
+ through the tunnel.
+
+config ADK_KPACKAGE_KMOD_IPV6
+ prompt "kmod-ipv6......................... IPv6 support"
+ tristate
+ depends ADK_IPV6
+ default n
+ help
+ This is complemental support for the IP version 6.
+ You will still be able to do traditional IPv4 networking as well.
+
+ For general information about IPv6, see
+ <http://playground.sun.com/pub/ipng/html/ipng-main.html>.
+ For Linux IPv6 development information, see <http://www.linux-ipv6.org>.
+ For specific information about IPv6 under Linux, read the HOWTO at
+ <http://www.bieringer.de/linux/IPv6/>.
+
+config ADK_KPACKAGE_KMOD_IPV6_SIT
+ prompt "kmod-ipv6-sit..................... IPv6-in-IPv4 tunnel (SIT driver)"
+ tristate
+ depends ADK_IPV6
+ default n
+ help
+ Tunneling means encapsulating data of one protocol type within
+ another protocol and sending it over a channel that understands the
+ encapsulating protocol. This driver implements encapsulation of IPv6
+ into IPv4 packets. This is useful if you want to connect two IPv6
+ networks over an IPv4-only path.
+
+config ADK_KPACKAGE_KMOD_PPP
+ prompt "kmod-ppp.......................... PPP support"
+ tristate
+ select ADK_KERNEL_PPP_ASYNC
+ select ADK_KERNEL_SLHC
+ select ADK_KPACKAGE_KMOD_CRC_CCITT
+ default n
+ help
+ PPP (Point to Point Protocol) is a newer and better SLIP. It serves
+ the same purpose: sending Internet traffic over telephone (and other
+ serial) lines. Ask your access provider if they support it, because
+ otherwise you can't use it; most Internet access providers these
+ days support PPP rather than SLIP.
+
+ To use PPP, you need an additional program called pppd as described
+ in the PPP-HOWTO, available at
+ <http://www.tldp.org/docs.html#howto>. Make sure that you have
+ the version of pppd recommended in <file:Documentation/Changes>.
+ The PPP option enlarges your kernel by about 16 KB.
+
+ There are actually two versions of PPP: the traditional PPP for
+ asynchronous lines, such as regular analog phone lines, and
+ synchronous PPP which can be used over digital ISDN lines for
+ example. If you want to use PPP over phone lines or other
+ asynchronous serial lines, you need to say Y (or M) here and also to
+ the next option, "PPP support for async serial ports". For PPP over
+ synchronous lines, you should say Y (or M) here and to "Support
+ synchronous PPP", below.
+
+config ADK_KPACKAGE_KMOD_PPP_MPPE
+ prompt "kmod-ppp-mppe................... PPP MPPE/MPPC module"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_PPP
+ select ADK_KERNEL_CRYPTO
+ select ADK_KPACKAGE_KMOD_CRYPTO_ARC4
+ select ADK_KPACKAGE_KMOD_CRYPTO_SHA1
+ select ADK_KPACKAGE_KMOD_CRYPTO_ECB if ADK_LINUX_2_6
+ help
+ Support for the MPPE Encryption protocol, as employed by the
+ Microsoft Point-to-Point Tunneling Protocol.
+
+ See http://pptpclient.sourceforge.net/ for information on
+ configuring PPTP clients and servers to utilize this method.
+
+#config ADK_KPACKAGE_KMOD_PPPOATM
+# prompt "kmod-pppoatm.................... PPPoA (PPP over ATM) kernel support"
+# tristate
+# default n
+# depends ADK_KPACKAGE_KMOD_PPP
+# select ADK_KPACKAGE_KMOD_ATM
+# help
+# Support for PPP over ATM
+
+config ADK_KPACKAGE_KMOD_PPPOE
+ prompt "kmod-pppoe...................... PPPoE (PPP over Ethernet) kernel support"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_PPP
+ help
+ Support for PPP over Ethernet
+
+config ADK_KPACKAGE_KMOD_TUN
+ prompt "kmod-tun.......................... Universal TUN/TAP driver"
+ tristate
+ default n
+ help
+ Kernel support for the TUN/TAP tunneling device
+
+config ADK_KPACKAGE_KMOD_BONDING
+ prompt "kmod-bonding...................... Bonding driver support"
+ tristate
+ default n
+ help
+ Say 'Y' or 'M' if you wish to be able to 'bond' multiple Ethernet
+ Channels together. This is called 'Etherchannel' by Cisco,
+ 'Trunking' by Sun, 802.3ad by the IEEE, and 'Bonding' in Linux.
+
+ The driver supports multiple bonding modes to allow for both high
+ performance and high availability operation.
+
+ Refer to <file:Documentation/networking/bonding.txt> for more
+ information.
+
+source target/linux/config/Config.in.sched
+
+endmenu
+
diff --git a/target/linux/config/Config.in.nls b/target/linux/config/Config.in.nls
new file mode 100644
index 000000000..e656fe7f9
--- /dev/null
+++ b/target/linux/config/Config.in.nls
@@ -0,0 +1,555 @@
+menu "Native Language support"
+
+config ADK_KERNEL_NLS_DEFAULT
+ string
+ default "iso8859-1"
+
+config ADK_KPACKAGE_KMOD_NLS
+ prompt "kmod-nls.......................... Base native language support"
+ tristate
+ default n
+ help
+ The base Native Language Support. A number of filesystems
+ depend on it (e.g. FAT, JOLIET, NT, BEOS filesystems), as well
+ as the ability of some filesystems to use native languages
+ (NCP, SMB).
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_437
+ prompt "kmod-nls-codepage-437........... Codepage 437 (United States, Canada)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored
+ in so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage that is used in
+ the United States and parts of Canada. This is recommended.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_737
+ prompt "kmod-nls-codepage-737........... Codepage 737 (Greek)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored
+ in so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage that is used for
+ Greek. If unsure, say N.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_775
+ prompt "kmod-nls-codepage-775........... Codepage 775 (Baltic Rim)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored
+ in so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage that is used
+ for the Baltic Rim Languages (Latvian and Lithuanian). If unsure,
+ say N.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_850
+ prompt "kmod-nls-codepage-850........... Codepage 850 (Western European Languages)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage that is used for
+ much of Europe -- United Kingdom, Germany, Spain, Italy, and [add
+ more countries here]. It has some characters useful to many European
+ languages that are not part of the US codepage 437.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_852
+ prompt "kmod-nls-codepage-852........... Codepage 852 (Eastern European Languages)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the Latin 2 codepage used by DOS
+ for much of Central and Eastern Europe. It has all the required
+ characters for these languages: Albanian, Croatian, Czech, English,
+ Finnish, Hungarian, Irish, German, Polish, Romanian, Serbian (Latin
+ transcription), Slovak, Slovenian, and Sorbian.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_855
+ prompt "kmod-nls-codepage-855........... Codepage 855 (Cyrillic)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Cyrillic.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_857
+ prompt "kmod-nls-codepage-857........... Codepage 857 (Turkish)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Turkish.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_860
+ prompt "kmod-nls-codepage-860........... Codepage 860 (Portuguese)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Portuguese.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_861
+ prompt "kmod-nls-codepage-861........... Codepage 861 (Icelandic)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Icelandic.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_862
+ prompt "kmod-nls-codepage-862........... Codepage 862 (Hebrew)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Hebrew.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_863
+ prompt "kmod-nls-codepage-863........... Codepage 863 (French Canadian)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Canadian
+ French.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_864
+ prompt "kmod-nls-codepage-864........... Codepage 864 (Arabic)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Arabic.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_865
+ prompt "kmod-nls-codepage-865........... Codepage 865 (Norwegian, Danish)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for the Nordic
+ European countries.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_866
+ prompt "kmod-nls-codepage-866........... Codepage 866 (Cyrillic/Russian)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for
+ Cyrillic/Russian.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_869
+ prompt "kmod-nls-codepage-869........... Codepage 869 (Greek)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Greek.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_874
+ prompt "kmod-nls-codepage-874........... Codepage 874 (Thai)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Thai.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_932
+ prompt "kmod-nls-codepage-932........... Codepage 932 (Japanese)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Shift-JIS
+ or EUC-JP. To use EUC-JP, you can use 'euc-jp' as mount option or
+ NLS Default value during kernel configuration, instead of 'cp932'.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_936
+ prompt "kmod-nls-codepage-936........... Codepage 936 (Simplified Chinese)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Simplified
+ Chinese(GBK).
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_949
+ prompt "kmod-nls-codepage-949........... Codepage 949 (Korean)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for UHC.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_950
+ prompt "kmod-nls-codepage-950........... Codepage 950 (Traditional Chinese)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Traditional
+ Chinese(Big5).
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_1250
+ prompt "kmod-nls-codepage-1250.......... Codepage 1250 (Slavic/Central European)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CDROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Windows CP-1250
+ character set, which works for most Latin-written Slavic and Central
+ European languages: Czech, German, Hungarian, Polish, Rumanian, Croatian,
+ Slovak, Slovene.
+
+config ADK_KPACKAGE_KMOD_NLS_CODEPAGE_1251
+ prompt "kmod-nls-codepage-1251.......... Codepage 1251 (Bulgarian, Belarusian)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ The Microsoft FAT file system family can deal with filenames in
+ native language character sets. These character sets are stored in
+ so-called DOS codepages. You need to include the appropriate
+ codepage if you want to be able to read/write these filenames on
+ DOS/Windows partitions correctly. This does apply to the filenames
+ only, not to the file contents. You can include several codepages;
+ say Y here if you want to include the DOS codepage for Russian and
+ Bulgarian and Belarusian.
+
+config ADK_KPACKAGE_KMOD_NLS_ASCII
+ prompt "kmod-nls-ascii.................. ASCII (United States)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ An ASCII NLS module is needed if you want to override the
+ DEFAULT NLS with this very basic charset and don't want any
+ non-ASCII characters to be translated.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_1
+ prompt "kmod-nls-iso8859-1.............. NLS ISO 8859-1 (Latin-1; Western European Languages)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 1 character
+ set, which covers most West European languages such as Albanian,
+ Catalan, Danish, Dutch, English, Faeroese, Finnish, French, German,
+ Galician, Irish, Icelandic, Italian, Norwegian, Portuguese, Spanish,
+ and Swedish. It is also the default for the US. If unsure, say Y.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_2
+ prompt "kmod-nls-iso8859-2.............. NLS ISO 8859-2 (Latin-2; Central European Languages)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 2 character
+ set, which works for most Latin-written Slavic and Central European
+ languages: Czech, German, Hungarian, Polish, Rumanian, Croatian,
+ Slovak, Slovene.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_3
+ prompt "kmod-nls-iso8859-3.............. NLS ISO 8859-3 (Latin-3; Esperanto, Galician, Maltese, Turkish)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 3 character
+ set, which is popular with authors of Esperanto, Galician, Maltese,
+ and Turkish.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_4
+ prompt "kmod-nls-iso8859-4.............. NLS ISO 8859-4 (Latin-4; old Baltic charset)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 4 character
+ set which introduces letters for Estonian, Latvian, and
+ Lithuanian. It is an incomplete predecessor of Latin 7.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_5
+ prompt "kmod-nls-iso8859-5.............. NLS ISO 8859-5 (Cyrillic)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for ISO8859-5, a Cyrillic
+ character set with which you can type Bulgarian, Belarusian,
+ Macedonian, Russian, Serbian, and Ukrainian. Note that the charset
+ KOI8-R is preferred in Russia.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_6
+ prompt "kmod-nls-iso8859-6.............. NLS ISO 8859-6 (Arabic)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for ISO8859-6, the Arabic
+ character set.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_7
+ prompt "kmod-nls-iso8859-7.............. NLS ISO 8859-7 (Greek)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for ISO8859-7, the Modern
+ Greek character set.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_8
+ prompt "kmod-nls-iso8859-8.............. NLS ISO 8859-8 (Hebrew)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for ISO8859-8, the Hebrew
+ character set.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_9
+ prompt "kmod-nls-iso8859-9.............. NLS ISO 8859-9 (Latin-5; Turkish)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 5 character
+ set, and it replaces the rarely needed Icelandic letters in Latin 1
+ with the Turkish ones. Useful in Turkey.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_13
+ prompt "kmod-nls-iso8859-13............. NLS ISO 8859-13 (Latin-7; Baltic Rim)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 7 character
+ set, which supports modern Baltic languages including Latvian
+ and Lithuanian.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_14
+ prompt "kmod-nls-iso8859-14............. NLS ISO 8859-14 (Latin-8; Celtic)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 8 character
+ set, which adds the last accented vowels for Welsh (aka Cymraeg)
+ (and Manx Gaelic) that were missing in Latin 1.
+ <http://linux.speech.cymru.org/> has further information.
+
+config ADK_KPACKAGE_KMOD_NLS_ISO8859_15
+ prompt "kmod-nls-iso8859-15............. NLS ISO 8859-15 (Latin-9; Western European Languages with Euro)"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the Latin 9 character
+ set, which covers most West European languages such as Albanian,
+ Catalan, Danish, Dutch, English, Estonian, Faeroese, Finnish,
+ French, German, Galician, Irish, Icelandic, Italian, Norwegian,
+ Portuguese, Spanish, and Swedish. Latin 9 is an update to
+ Latin 1 (ISO 8859-1) that removes a handful of rarely used
+ characters and instead adds support for Estonian, corrects the
+ support for French and Finnish, and adds the new Euro character.
+ If unsure, say Y.
+
+config ADK_KPACKAGE_KMOD_NLS_KOI8_R
+ prompt "kmod-nls-koi8-r................. NLS KOI8-R (Cryllic for Russian and Bulgarian"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the preferred Russian
+ character set.
+
+config ADK_KPACKAGE_KMOD_NLS_KOI8_U
+ prompt "kmod-nls-koi8-u................. NLS KOI8-U (Cyrillic for Russian, Bulgarian and Ukrainian"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the preferred Ukrainian
+ (koi8-u) and Belarusian (koi8-ru) character sets.
+
+config ADK_KPACKAGE_KMOD_NLS_UTF8
+ prompt "kmod-nls-utf8................... NLS UTF8"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_NLS
+ help
+ If you want to display filenames with native language characters
+ from the Microsoft FAT file system family or from JOLIET CD-ROMs
+ correctly on the screen, you need to include the appropriate
+ input/output character sets. Say Y here for the UTF-8 encoding of
+ the Unicode/ISO9646 universal character set.
+
+endmenu
+
diff --git a/target/linux/config/Config.in.pcmcia b/target/linux/config/Config.in.pcmcia
new file mode 100644
index 000000000..f06ad0783
--- /dev/null
+++ b/target/linux/config/Config.in.pcmcia
@@ -0,0 +1,32 @@
+menu "PCMCIA/CardBus support"
+
+config ADK_KERNEL_CARDBUS
+ boolean
+ default n
+
+config ADK_KPACKAGE_KMOD_PCCARD
+ prompt "kmod-pccard....................... PCCARD support"
+ tristate
+ default n
+
+config ADK_KPACKAGE_KMOD_PCMCIA
+ prompt "kmod-pcmcia....................... 16-bit PCMCIA support"
+ tristate
+ depends ADK_KPACKAGE_KMOD_PCCARD
+ select ADK_KERNEL_CRC32
+ default n
+
+config ADK_KPACKAGE_KMOD_YENTA
+ prompt "kmod-cardbus...................... 32-bit CardBus support"
+ tristate
+ depends ADK_KPACKAGE_KMOD_PCCARD
+ select ADK_KERNEL_CARDBUS
+ default n
+
+config ADK_KPACKAGE_KMOD_SERIAL_8250_CS
+ prompt "kmod-pcmcia-serial................ PCMCIA/CardBus serial device support"
+ tristate
+ default n
+ depends on ADK_KPACKAGE_KMOD_PCMCIA || ADK_KPACKAGE_KMOD_CARDBUS
+
+endmenu
diff --git a/target/linux/config/Config.in.sched b/target/linux/config/Config.in.sched
new file mode 100644
index 000000000..c5a992ba4
--- /dev/null
+++ b/target/linux/config/Config.in.sched
@@ -0,0 +1,337 @@
+menu "QoS and/or fair queueing"
+
+config ADK_KERNEL_NET_SCH_CSZ
+ boolean
+ default n
+
+config ADK_KERNEL_NET_SCH_NETEM
+ boolean
+ default n
+
+config ADK_KERNEL_NET_QOS
+ boolean
+ default n
+
+config ADK_KERNEL_NET_ESTIMATOR
+ boolean
+ default n
+
+config ADK_KERNEL_NET_SCHED
+ #prompt "kmod-net-sched.................... QoS and/or fair queueing support"
+ boolean
+ default n
+ help
+ When the kernel has several packets to send out over a network
+ device, it has to decide which ones to send first, which ones to
+ delay, and which ones to drop. This is the job of the queueing
+ disciplines, several different algorithms for how to do this
+ "fairly" have been proposed.
+
+ If you say N here, you will get the standard packet scheduler, which
+ is a FIFO (first come, first served). If you say Y here, you will be
+ able to choose from among several alternative algorithms which can
+ then be attached to different network devices. This is useful for
+ example if some of your network devices are real time devices that
+ need a certain minimum data flow rate, or if you need to limit the
+ maximum data flow rate for traffic which matches specified criteria.
+ This code is considered to be experimental.
+
+ To administer these schedulers, you'll need the user-level utilities
+ from the package iproute2+tc at <ftp://ftp.tux.org/pub/net/ip-routing/>.
+ That package also contains some documentation; for more, check out
+ <http://linux-net.osdl.org/index.php/Iproute2>.
+
+ This Quality of Service (QoS) support will enable you to use
+ Differentiated Services (diffserv) and Resource Reservation Protocol
+ (RSVP) on your Linux router if you also say Y to the corresponding
+ classifiers below. Documentation and software is at
+ <http://diffserv.sourceforge.net/>.
+
+comment "Queueing/Scheduling"
+
+config ADK_KPACKAGE_KMOD_NET_SCH_CBQ
+ prompt "kmod-sched-cbq.................... Class Based Queueing (CBQ)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the Class-Based Queueing (CBQ) packet
+ scheduling algorithm. This algorithm classifies the waiting packets
+ into a tree-like hierarchy of classes; the leaves of this tree are
+ in turn scheduled by separate algorithms.
+
+ See the top of <file:net/sched/sch_cbq.c> for more details.
+
+ CBQ is a commonly used scheduler, so if you're unsure, you should
+ say Y here. Then say Y to all the queueing algorithms below that you
+ want to use as leaf disciplines.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_HTB
+ prompt "kmod-sched-htb.................... Hierarchical Token Bucket (HTB)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the Hierarchical Token Buckets (HTB)
+ packet scheduling algorithm. See
+ <http://luxik.cdi.cz/~devik/qos/htb/> for complete manual and
+ in-depth articles.
+
+ HTB is very similar to CBQ regarding its goals however is has
+ different properties and different algorithm.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_HFSC
+ prompt "kmod-sched-hfsc................... Hierarchical Fair Service Curve (HFSC)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the Hierarchical Fair Service Curve
+ (HFSC) packet scheduling algorithm.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_ATM
+ prompt "kmod-sched-atm.................... ATM Virtual Circuits (ATM)"
+ tristate
+ depends ADK_KPACKAGE_KMOD_ATM
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the ATM pseudo-scheduler. This
+ provides a framework for invoking classifiers, which in turn
+ select classes of this queuing discipline. Each class maps
+ the flow(s) it is handling to a given virtual circuit.
+
+ See the top of <file:net/sched/sch_atm.c>) for more details.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_PRIO
+ prompt "kmod-sched-prio................... Multi Band Priority Queueing (PRIO)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use an n-band priority queue packet
+ scheduler.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_RED
+ prompt "kmod-sched-red.................... Random Early Detection (RED)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the Random Early Detection (RED)
+ packet scheduling algorithm.
+
+ See the top of <file:net/sched/sch_red.c> for more details.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_SFQ
+ prompt "kmod-sched-sfq.................... Stochastic Fairness Queueing (SFQ)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the Stochastic Fairness Queueing (SFQ)
+ packet scheduling algorithm .
+
+ See the top of <file:net/sched/sch_sfq.c> for more details.
+
+#config ADK_KPACKAGE_KMOD_NET_SCH_TEQL
+# prompt "kmod-sched-teql................... True Link Equalizer (TEQL)"
+# tristate
+# select ADK_KERNEL_NET_SCHED
+# default n
+# help
+# Say Y here if you want to use the True Link Equalizer (TLE) packet
+# scheduling algorithm. This queueing discipline allows the combination
+# of several physical devices into one virtual device.
+#
+# See the top of <file:net/sched/sch_teql.c> for more details.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_TBF
+ prompt "kmod-sched-tbf.................... Token Bucket Filter (TBF)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the Token Bucket Filter (TBF) packet
+ scheduling algorithm.
+
+ See the top of <file:net/sched/sch_tbf.c> for more details.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_GRED
+ prompt "kmod-sched-gred................... Generic Random Early Detection (GRED)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y here if you want to use the Generic Random Early Detection
+ (GRED) packet scheduling algorithm for some of your network devices
+ (see the top of <file:net/sched/sch_red.c> for details and
+ references about the algorithm).
+
+config ADK_KPACKAGE_KMOD_NET_SCH_DSMARK
+ prompt "kmod-sched-dsmark................. Differentiated Services marker (DSMARK)"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ default n
+ help
+ Say Y if you want to schedule packets according to the
+ Differentiated Services architecture proposed in RFC 2475.
+ Technical information on this method, with pointers to associated
+ RFCs, is available at <http://www.gta.ufrj.br/diffserv/>.
+
+config ADK_KPACKAGE_KMOD_NET_SCH_INGRESS
+ prompt "kmod-sched-ingress................ Ingress Qdisc"
+ tristate
+ select ADK_KERNEL_NET_SCHED
+ select ADK_KERNEL_NETFILTER
+ select ADK_KERNEL_NET_CLS_ACT
+ default n
+ help
+ Say Y here if you want to use classifiers for incoming packets.
+ If unsure, say Y.
+
+comment "Classification"
+
+config ADK_KERNEL_NET_CLS
+ boolean
+ select ADK_KERNEL_NET_SCHED
+ default n
+
+config ADK_KPACKAGE_KMOD_NET_CLS_BASIC
+ prompt "kmod-cls-basic.................... Elementary classification (BASIC)"
+ tristate
+ select ADK_KERNEL_NET_CLS
+ depends on ADK_LINUX_2_6
+ default n
+ help
+ Say Y here if you want to be able to classify packets using
+ only extended matches and actions.
+
+config ADK_KPACKAGE_KMOD_NET_CLS_TCINDEX
+ prompt "kmod-cls-tcindex.................. Traffic-Control Index (TCINDEX)"
+ tristate
+ select ADK_KERNEL_NET_CLS
+ default n
+ help
+ Say Y here if you want to be able to classify packets based on
+ traffic control indices. You will want this feature if you want
+ to implement Differentiated Services together with DSMARK.
+
+config ADK_KPACKAGE_KMOD_NET_CLS_ROUTE4
+ prompt "kmod-cls-route4................... Routing decision (ROUTE)"
+ tristate
+ select ADK_KERNEL_NET_CLS
+ default n
+ help
+ If you say Y here, you will be able to classify packets
+ according to the route table entry they matched.
+
+config ADK_KPACKAGE_KMOD_NET_CLS_FW
+ prompt "kmod-cls-fw....................... Netfilter mark (FW)"
+ tristate
+ select ADK_KERNEL_NET_CLS
+ default n
+ help
+ If you say Y here, you will be able to classify packets
+ according to netfilter/firewall marks.
+
+config ADK_KPACKAGE_KMOD_NET_CLS_U32
+ prompt "kmod-cls-u32...................... Universal 32bit comparisons w/ hashing (U32)"
+ tristate
+ select ADK_KERNEL_NET_CLS
+ default n
+ help
+ Say Y here to be able to classify packets using a universal
+ 32bit pieces based comparison scheme.
+
+config ADK_KPACKAGE_KMOD_NET_CLS_U32_PERF
+ prompt ".................................. Performance counters support"
+ bool
+ select ADK_KERNEL_NET_CLS
+ depends ADK_KPACKAGE_KMOD_NET_CLS_U32
+ default n
+ help
+ Say Y here to make u32 gather additional statistics useful for
+ fine tuning u32 classifiers.
+
+config ADK_KPACKAGE_KMOD_NET_CLS_U32_MARK
+ prompt ".................................. Netfilter marks support"
+ bool
+ select ADK_KERNEL_NET_CLS
+ depends ADK_KPACKAGE_KMOD_NET_CLS_U32
+ depends ADK_KPACKAGE_KMOD_NET_CLS_FW
+ default n
+ help
+ Say Y here to be able to use netfilter marks as u32 key.
+
+comment "Actions"
+
+config ADK_KERNEL_NET_CLS_ACT
+ boolean
+ select ADK_KERNEL_NET_SCHED
+ select ADK_KERNEL_NET_ESTIMATOR
+ default n
+
+config ADK_KPACKAGE_KMOD_NET_CLS_POLICE
+ prompt "kmod-act-police................... Traffic Policing"
+ tristate
+ select ADK_KERNEL_NET_CLS_ACT
+ depends ADK_LINUX_2_4
+ default n
+ help
+ Say Y here if you want to do traffic policing, i.e. strict
+ bandwidth limiting. This action replaces the existing policing
+ module.
+
+config ADK_KPACKAGE_KMOD_NET_ACT_POLICE
+ prompt "kmod-act-police................... Traffic Policing"
+ tristate
+ select ADK_KERNEL_NET_CLS_ACT
+ depends ADK_LINUX_2_6
+ default n
+ help
+ Say Y here if you want to do traffic policing, i.e. strict
+ bandwidth limiting. This action replaces the existing policing
+ module.
+
+config ADK_KPACKAGE_KMOD_NET_ACT_GACT
+ prompt "kmod-act-gact..................... Generic actions"
+ tristate
+ select ADK_KERNEL_NET_CLS_ACT
+ depends ADK_LINUX_2_6
+ default n
+ help
+ Say Y here to take generic actions such as dropping and
+ accepting packets.
+
+config ADK_KPACKAGE_KMOD_NET_ACT_MIRRED
+ prompt "kmod-act-mirred................... Redirecting and Mirroring"
+ tristate
+ select ADK_KERNEL_NET_CLS_ACT
+ depends ADK_LINUX_2_6
+ default n
+ help
+ Say Y here to allow packets to be mirrored or redirected to
+ other devices.
+
+config ADK_KPACKAGE_KMOD_NET_ACT_IPT
+ prompt "kmod-act-ipt...................... IPtables targets"
+ tristate
+ select ADK_KERNEL_NET_CLS_ACT
+ select ADK_KPACKAGE_KMOD_IP_NF_IPTABLES
+ depends ADK_LINUX_2_6
+ default n
+ help
+ Say Y here to be able to invoke iptables targets after successful
+ classification.
+
+config ADK_KPACKAGE_KMOD_NET_ACT_PEDIT
+ prompt "kmod-act-pedit.................... Packet Editing"
+ tristate
+ select ADK_KERNEL_NET_CLS_ACT
+ depends ADK_LINUX_2_6
+ default n
+ help
+ Say Y here if you want to mangle the content of packets.
+
+endmenu
diff --git a/target/linux/config/Config.in.usb b/target/linux/config/Config.in.usb
new file mode 100644
index 000000000..b3dfa9cbd
--- /dev/null
+++ b/target/linux/config/Config.in.usb
@@ -0,0 +1,264 @@
+menu "USB support"
+
+config ADK_KERNEL_USB_DEVICEFS
+ boolean
+ default n
+
+config ADK_KERNEL_USB_LIBUSUAL
+ tristate
+ default n
+
+config ADK_KERNEL_USB_SERIAL
+ boolean
+ default n
+
+config ADK_KPACKAGE_KMOD_USB
+ prompt "kmod-usb-core..................... USB support"
+ tristate
+ default y if ADK_LINUX_X86_ALIX1C || ADK_LINUX_CRIS_FOXBOARD
+ default n
+ select ADK_KERNEL_USB_DEVICEFS
+ help
+ Universal Serial Bus (USB) is a specification for a serial bus
+ subsystem which offers higher speeds and more features than the
+ traditional PC serial port. The bus supplies power to peripherals
+ and allows for hot swapping. Up to 127 USB peripherals can be
+ connected to a single USB host in a tree structure.
+
+ The USB host is the root of the tree, the peripherals are the
+ leaves and the inner nodes are special USB devices called hubs.
+ Most PCs now have USB host ports, used to connect peripherals
+ such as scanners, keyboards, mice, modems, cameras, disks,
+ flash memory, network links, and printers to the PC.
+
+ Say Y here if your computer has a host-side USB port and you want
+ to use USB devices. You then need to say Y to at least one of the
+ Host Controller Driver (HCD) options below. Choose a USB 1.1
+ controller, such as "UHCI HCD support" or "OHCI HCD support",
+ and "EHCI HCD (USB 2.0) support" except for older systems that
+ do not have USB 2.0 support. It doesn't normally hurt to select
+ them all if you are not certain.
+
+ If your system has a device-side USB port, used in the peripheral
+ side of the USB protocol, see the "USB Gadget" framework instead.
+
+ After choosing your HCD, then select drivers for the USB peripherals
+ you'll be using. You may want to check out the information provided
+ in <file:Documentation/usb/> and especially the links given in
+ <file:Documentation/usb/usb-help.txt>.
+
+config ADK_KPACKAGE_KMOD_USB_UHCI_HCD
+ prompt "kmod-usb-uhci................... Support for UHCI controllers"
+ tristate
+ depends ADK_KPACKAGE_KMOD_USB
+ depends !ADK_LINUX_CRIS_FOXBOARD
+ select ADK_PACKAGE_KMOD_USB_CONTROLLER
+ help
+ The Universal Host Controller Interface is a standard by Intel for
+ accessing the USB hardware in the PC (which is also called the USB
+ host controller). If your USB host controller conforms to this
+ standard, you may want to say Y, but see below. All recent boards
+ with Intel PCI chipsets (like intel 430TX, 440FX, 440LX, 440BX,
+ i810, i820) conform to this standard. Also all VIA PCI chipsets
+ (like VIA VP2, VP3, MVP3, Apollo Pro, Apollo Pro II or Apollo Pro
+ 133). If unsure, say Y.
+
+config ADK_KPACKAGE_KMOD_USB_OHCI_HCD
+ prompt "kmod-usb-ohci................... Support for OHCI controllers"
+ tristate
+ default y if ADK_LINUX_X86_ALIX1C
+ default n
+ depends !ADK_LINUX_CRIS_FOXBOARD
+ depends ADK_KPACKAGE_KMOD_USB
+ select ADK_PACKAGE_KMOD_USB_CONTROLLER
+ help
+ The Open Host Controller Interface (OHCI) is a standard for accessing
+ USB 1.1 host controller hardware. It does more in hardware than Intel's
+ UHCI specification. If your USB host controller follows the OHCI spec,
+ say Y. On most non-x86 systems, and on x86 hardware that's not using a
+ USB controller from Intel or VIA, this is appropriate. If your host
+ controller doesn't use PCI, this is probably appropriate. For a PCI
+ based system where you're not sure, the "lspci -v" entry will list the
+ right "prog-if" for your USB controller(s): EHCI, OHCI, or UHCI.
+
+config ADK_KPACKAGE_KMOD_USB_ISP116X_HCD
+ prompt "kmod-usb-isp116x................ ISP116X HCD support"
+ tristate
+ default n
+ depends !ADK_LINUX_CRIS_FOXBOARD
+ depends on ADK_KPACKAGE_KMOD_USB
+ select ADK_PACKAGE_KMOD_USB_CONTROLLER
+ help
+ The ISP1160 and ISP1161 chips are USB host controllers. Enable this
+ option if your board has this chip. If unsure, say N.
+
+ This driver does not support isochronous transfers.
+
+config ADK_KPACKAGE_KMOD_USB_SL811_HCD
+ prompt "kmod-usb-sl811.................. SL811HS HCD support"
+ tristate
+ default n
+ depends !ADK_LINUX_CRIS_FOXBOARD
+ depends on ADK_KPACKAGE_KMOD_USB
+ select ADK_PACKAGE_KMOD_USB_CONTROLLER
+ help
+ The SL811HS is a single-port USB controller that supports either
+ host side or peripheral side roles. Enable this option if your
+ board has this chip, and you want to use it as a host controller.
+ If unsure, say N.
+
+
+config ADK_KPACKAGE_KMOD_USB_EHCI_HCD
+ prompt "kmod-usb-ehci................... Support for USB 2.0 controllers"
+ tristate
+ depends !ADK_LINUX_CRIS_FOXBOARD
+ default y if ADK_LINUX_X86_ALIX1C
+ default n
+ depends ADK_KPACKAGE_KMOD_USB
+ select ADK_PACKAGE_KMOD_USB_CONTROLLER
+ help
+ The Enhanced Host Controller Interface (EHCI) is standard for USB 2.0
+ "high speed" (480 Mbit/sec, 60 Mbyte/sec) host controller hardware.
+ If your USB host controller supports USB 2.0, you will likely want to
+ configure this Host Controller Driver. At the time of this writing,
+ the primary implementation of EHCI is a chip from NEC, widely available
+ in add-on PCI cards, but implementations are in the works from other
+ vendors including Intel and Philips. Motherboard support is appearing.
+
+ EHCI controllers are packaged with "companion" host controllers (OHCI
+ or UHCI) to handle USB 1.1 devices connected to root hub ports. Ports
+ will connect to EHCI if the device is high speed, otherwise they
+ connect to a companion controller. If you configure EHCI, you should
+ probably configure the OHCI (for NEC and some other vendors) USB Host
+ Controller Driver or UHCI (for Via motherboards) Host Controller
+ Driver too.
+
+ You may want to read <file:Documentation/usb/ehci.txt>.
+
+config ADK_PACKAGE_KMOD_USB_CONTROLLER
+ tristate
+ depends on ADK_KPACKAGE_KMOD_USB_UHCI_HCD || ADK_KPACKAGE_KMOD_USB_OHCI_HCD || ADK_KPACKAGE_KMOD_EHCI_HCD || ADK_LINUX_CRIS_FOXBOARD
+ select ADK_KERNEL_USB_DEVICEFS
+ default n
+
+config ADK_KPACKAGE_KMOD_USB_ACM
+ prompt "kmod-usb-acm...................... Support for USB modems/isdn controllers"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+
+config ADK_KPACKAGE_KMOD_USB_PEGASUS
+ prompt "kmod-usb-pegasus.................. Support for USB Pegasus"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+
+config ADK_KPACKAGE_KMOD_USB_PRINTER
+ prompt "kmod-usb-printer.................. Support for USB printers"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+
+config ADK_KPACKAGE_KMOD_USB_SERIAL
+ prompt "kmod-usb-serial................... Support for USB-to-serial converters"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+ help
+ Say Y here if you have a USB device that provides normal serial
+ ports, or acts like a serial device, and you want to connect it to
+ your USB bus.
+
+ Please read <file:Documentation/usb/usb-serial.txt> for more
+ information on the specifics of the different devices that are
+ supported, and on how to use them.
+
+
+config ADK_KPACKAGE_KMOD_USB_SERIAL_BELKIN
+ prompt "kmod-usb-serial-belkin.......... Support for Belkin USB-to-serial converters"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_USB_SERIAL
+ help
+ Say Y here if you want to use a Belkin USB Serial single port
+ adaptor (F5U103 is one of the model numbers) or the Peracom single
+ port USB to serial adapter.
+
+config ADK_KPACKAGE_KMOD_USB_SERIAL_FTDI_SIO
+ prompt "kmod-usb-serial-ftdi............ Support for FTDI USB-to-serial converter"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_USB_SERIAL
+ help
+ Say Y here if you want to use a FTDI SIO single port USB to serial
+ converter device. The implementation I have is called the USC-1000.
+ This driver has also be tested with the 245 and 232 devices.
+
+ See <http://ftdi-usb-sio.sourceforge.net/> for more
+ information on this driver and the device.
+
+config ADK_KPACKAGE_KMOD_USB_SERIAL_MCT_U232
+ prompt "kmod-usb-serial-mct-u232........ Support for Magic Control Technology USB-to-Serial converters"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_USB_SERIAL
+ help
+ Say Y here if you want to use a USB Serial single port adapter from
+ Magic Control Technology Corp. (U232 is one of the model numbers).
+
+ This driver also works with Sitecom U232-P25 and D-Link DU-H3SP USB
+ BAY, Belkin F5U109, and Belkin F5U409 devices.
+
+config ADK_KPACKAGE_KMOD_USB_SERIAL_PL2303
+ prompt "kmod-usb-serial-pl2303.......... Support for Prolific PL2303 USB-to-Serial converters"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_USB_SERIAL
+ help
+ Say Y here if you want to use the PL2303 USB Serial single port
+ adapter from Prolific.
+
+config ADK_KPACKAGE_KMOD_USB_SERIAL_VISOR
+ prompt "kmod-usb-serial-visor........... Support for Handspring Visor / Palm m50x / Sony Clie Driver"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_USB_SERIAL
+ help
+ Say Y here if you want to connect to your HandSpring Visor, Palm
+ m500 or m505 through its USB docking station. See
+ <http://usbvisor.sourceforge.net/> for more information on using this
+ driver.
+
+config ADK_KPACKAGE_KMOD_USB_STORAGE
+ prompt "kmod-usb-storage.................. Support for USB storage devices"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+ select ADK_KPACKAGE_KMOD_SCSI if !ADK_KERNEL_SCSI
+ select ADK_KPACKAGE_KMOD_BLK_DEV_SD if !ADK_KERNEL_SCSI
+
+config ADK_KPACKAGE_KMOD_USB_ATM
+ prompt "kmod-usb-atm...................... Support for USB ATM devices"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+
+config ADK_KPACKAGE_KMOD_USB_ATM_SPEEDTOUCH
+ prompt "kmod-usb-atm-speedtouch......... Support for USB Speedtouch ADSL modem"
+ tristate
+ default n
+ depends ADK_KPACKAGE_KMOD_USB_ATM
+
+config ADK_KPACKAGE_KMOD_USB_USBNET
+ prompt "kmod-usb-usbnet................... Multi-purpose USB Networking Framework"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+
+config ADK_KPACKAGE_KMOD_USB_SISUSBVGA
+ prompt "kmod-usb-svga..................... USB 2.0 SVGA dongle support (Net2280/SiS315)"
+ tristate
+ default n
+ depends ADK_PACKAGE_KMOD_USB_CONTROLLER
+
+endmenu
diff --git a/target/linux/kernel.control b/target/linux/kernel.control
new file mode 100644
index 000000000..c456fa8f4
--- /dev/null
+++ b/target/linux/kernel.control
@@ -0,0 +1,5 @@
+Package: kernel
+Priority: optional
+Section: sys
+Description: Virtual package for the Kernel
+
diff --git a/target/linux/patches/2.6.28/ocf.patch b/target/linux/patches/2.6.28/ocf.patch
new file mode 100644
index 000000000..081e47709
--- /dev/null
+++ b/target/linux/patches/2.6.28/ocf.patch
@@ -0,0 +1,23661 @@
+diff -Nur linux-2.6.27.10.orig/crypto/Kconfig linux-2.6.27.10/crypto/Kconfig
+--- linux-2.6.27.10.orig/crypto/Kconfig 2008-12-18 18:13:59.000000000 +0100
++++ linux-2.6.27.10/crypto/Kconfig 2008-12-23 19:31:44.000000000 +0100
+@@ -669,3 +669,5 @@
+ source "drivers/crypto/Kconfig"
+
+ endif # if CRYPTO
++
++source "crypto/ocf/Kconfig"
+diff -Nur linux-2.6.27.10.orig/crypto/Makefile linux-2.6.27.10/crypto/Makefile
+--- linux-2.6.27.10.orig/crypto/Makefile 2008-12-18 18:13:59.000000000 +0100
++++ linux-2.6.27.10/crypto/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -72,6 +72,8 @@
+
+ obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
+
++obj-$(CONFIG_OCF_OCF) += ocf/
++
+ #
+ # generic algorithms and the async_tx api
+ #
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/Config.in linux-2.6.27.10/crypto/ocf/Config.in
+--- linux-2.6.27.10.orig/crypto/ocf/Config.in 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/Config.in 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,34 @@
++#############################################################################
++
++mainmenu_option next_comment
++comment 'OCF Configuration'
++tristate 'OCF (Open Cryptograhic Framework)' CONFIG_OCF_OCF
++dep_mbool ' enable fips RNG checks (fips check on RNG data before use)' \
++ CONFIG_OCF_FIPS $CONFIG_OCF_OCF
++dep_mbool ' enable harvesting entropy for /dev/random' \
++ CONFIG_OCF_RANDOMHARVEST $CONFIG_OCF_OCF
++dep_tristate ' cryptodev (user space support)' \
++ CONFIG_OCF_CRYPTODEV $CONFIG_OCF_OCF
++dep_tristate ' cryptosoft (software crypto engine)' \
++ CONFIG_OCF_CRYPTOSOFT $CONFIG_OCF_OCF
++dep_tristate ' safenet (HW crypto engine)' \
++ CONFIG_OCF_SAFE $CONFIG_OCF_OCF
++dep_tristate ' IXP4xx (HW crypto engine)' \
++ CONFIG_OCF_IXP4XX $CONFIG_OCF_OCF
++dep_mbool ' Enable IXP4xx HW to perform SHA1 and MD5 hashing (very slow)' \
++ CONFIG_OCF_IXP4XX_SHA1_MD5 $CONFIG_OCF_IXP4XX
++dep_tristate ' hifn (HW crypto engine)' \
++ CONFIG_OCF_HIFN $CONFIG_OCF_OCF
++dep_tristate ' talitos (HW crypto engine)' \
++ CONFIG_OCF_TALITOS $CONFIG_OCF_OCF
++dep_tristate ' pasemi (HW crypto engine)' \
++ CONFIG_OCF_PASEMI $CONFIG_OCF_OCF
++dep_tristate ' ep80579 (HW crypto engine)' \
++ CONFIG_OCF_EP80579 $CONFIG_OCF_OCF
++dep_tristate ' ocfnull (does no crypto)' \
++ CONFIG_OCF_OCFNULL $CONFIG_OCF_OCF
++dep_tristate ' ocf-bench (HW crypto in-kernel benchmark)' \
++ CONFIG_OCF_BENCH $CONFIG_OCF_OCF
++endmenu
++
++#############################################################################
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/criov.c linux-2.6.27.10/crypto/ocf/criov.c
+--- linux-2.6.27.10.orig/crypto/ocf/criov.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/criov.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,215 @@
++/* $OpenBSD: criov.c,v 1.9 2002/01/29 15:48:29 jason Exp $ */
++
++/*
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 1999 Theo de Raadt
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++__FBSDID("$FreeBSD: src/sys/opencrypto/criov.c,v 1.5 2006/06/04 22:15:13 pjd Exp $");
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/uio.h>
++#include <linux/skbuff.h>
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <asm/io.h>
++
++#include <uio.h>
++#include <cryptodev.h>
++
++/*
++ * This macro is only for avoiding code duplication, as we need to skip
++ * given number of bytes in the same way in three functions below.
++ */
++#define CUIO_SKIP() do { \
++ KASSERT(off >= 0, ("%s: off %d < 0", __func__, off)); \
++ KASSERT(len >= 0, ("%s: len %d < 0", __func__, len)); \
++ while (off > 0) { \
++ KASSERT(iol >= 0, ("%s: empty in skip", __func__)); \
++ if (off < iov->iov_len) \
++ break; \
++ off -= iov->iov_len; \
++ iol--; \
++ iov++; \
++ } \
++} while (0)
++
++void
++cuio_copydata(struct uio* uio, int off, int len, caddr_t cp)
++{
++ struct iovec *iov = uio->uio_iov;
++ int iol = uio->uio_iovcnt;
++ unsigned count;
++
++ CUIO_SKIP();
++ while (len > 0) {
++ KASSERT(iol >= 0, ("%s: empty", __func__));
++ count = min((int)(iov->iov_len - off), len);
++ memcpy(cp, ((caddr_t)iov->iov_base) + off, count);
++ len -= count;
++ cp += count;
++ off = 0;
++ iol--;
++ iov++;
++ }
++}
++
++void
++cuio_copyback(struct uio* uio, int off, int len, caddr_t cp)
++{
++ struct iovec *iov = uio->uio_iov;
++ int iol = uio->uio_iovcnt;
++ unsigned count;
++
++ CUIO_SKIP();
++ while (len > 0) {
++ KASSERT(iol >= 0, ("%s: empty", __func__));
++ count = min((int)(iov->iov_len - off), len);
++ memcpy(((caddr_t)iov->iov_base) + off, cp, count);
++ len -= count;
++ cp += count;
++ off = 0;
++ iol--;
++ iov++;
++ }
++}
++
++/*
++ * Return a pointer to iov/offset of location in iovec list.
++ */
++struct iovec *
++cuio_getptr(struct uio *uio, int loc, int *off)
++{
++ struct iovec *iov = uio->uio_iov;
++ int iol = uio->uio_iovcnt;
++
++ while (loc >= 0) {
++ /* Normal end of search */
++ if (loc < iov->iov_len) {
++ *off = loc;
++ return (iov);
++ }
++
++ loc -= iov->iov_len;
++ if (iol == 0) {
++ if (loc == 0) {
++ /* Point at the end of valid data */
++ *off = iov->iov_len;
++ return (iov);
++ } else
++ return (NULL);
++ } else {
++ iov++, iol--;
++ }
++ }
++
++ return (NULL);
++}
++
++EXPORT_SYMBOL(cuio_copyback);
++EXPORT_SYMBOL(cuio_copydata);
++EXPORT_SYMBOL(cuio_getptr);
++
++
++static void
++skb_copy_bits_back(struct sk_buff *skb, int offset, caddr_t cp, int len)
++{
++ int i;
++ if (offset < skb_headlen(skb)) {
++ memcpy(skb->data + offset, cp, min_t(int, skb_headlen(skb), len));
++ len -= skb_headlen(skb);
++ cp += skb_headlen(skb);
++ }
++ offset -= skb_headlen(skb);
++ for (i = 0; len > 0 && i < skb_shinfo(skb)->nr_frags; i++) {
++ if (offset < skb_shinfo(skb)->frags[i].size) {
++ memcpy(page_address(skb_shinfo(skb)->frags[i].page) +
++ skb_shinfo(skb)->frags[i].page_offset,
++ cp, min_t(int, skb_shinfo(skb)->frags[i].size, len));
++ len -= skb_shinfo(skb)->frags[i].size;
++ cp += skb_shinfo(skb)->frags[i].size;
++ }
++ offset -= skb_shinfo(skb)->frags[i].size;
++ }
++}
++
++void
++crypto_copyback(int flags, caddr_t buf, int off, int size, caddr_t in)
++{
++
++ if ((flags & CRYPTO_F_SKBUF) != 0)
++ skb_copy_bits_back((struct sk_buff *)buf, off, in, size);
++ else if ((flags & CRYPTO_F_IOV) != 0)
++ cuio_copyback((struct uio *)buf, off, size, in);
++ else
++ bcopy(in, buf + off, size);
++}
++
++void
++crypto_copydata(int flags, caddr_t buf, int off, int size, caddr_t out)
++{
++
++ if ((flags & CRYPTO_F_SKBUF) != 0)
++ skb_copy_bits((struct sk_buff *)buf, off, out, size);
++ else if ((flags & CRYPTO_F_IOV) != 0)
++ cuio_copydata((struct uio *)buf, off, size, out);
++ else
++ bcopy(buf + off, out, size);
++}
++
++int
++crypto_apply(int flags, caddr_t buf, int off, int len,
++ int (*f)(void *, void *, u_int), void *arg)
++{
++#if 0
++ int error;
++
++ if ((flags & CRYPTO_F_SKBUF) != 0)
++ error = XXXXXX((struct mbuf *)buf, off, len, f, arg);
++ else if ((flags & CRYPTO_F_IOV) != 0)
++ error = cuio_apply((struct uio *)buf, off, len, f, arg);
++ else
++ error = (*f)(arg, buf + off, len);
++ return (error);
++#else
++ KASSERT(0, ("crypto_apply not implemented!\n"));
++#endif
++ return 0;
++}
++
++EXPORT_SYMBOL(crypto_copyback);
++EXPORT_SYMBOL(crypto_copydata);
++EXPORT_SYMBOL(crypto_apply);
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/crypto.c linux-2.6.27.10/crypto/ocf/crypto.c
+--- linux-2.6.27.10.orig/crypto/ocf/crypto.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/crypto.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,1741 @@
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * Copyright (c) 2002-2006 Sam Leffler. All rights reserved.
++ *
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#if 0
++#include <sys/cdefs.h>
++__FBSDID("$FreeBSD: src/sys/opencrypto/crypto.c,v 1.27 2007/03/21 03:42:51 sam Exp $");
++#endif
++
++/*
++ * Cryptographic Subsystem.
++ *
++ * This code is derived from the Openbsd Cryptographic Framework (OCF)
++ * that has the copyright shown below. Very little of the original
++ * code remains.
++ */
++/*-
++ * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
++ *
++ * This code was written by Angelos D. Keromytis in Athens, Greece, in
++ * February 2000. Network Security Technologies Inc. (NSTI) kindly
++ * supported the development of this code.
++ *
++ * Copyright (c) 2000, 2001 Angelos D. Keromytis
++ *
++ * Permission to use, copy, and modify this software with or without fee
++ * is hereby granted, provided that this entire notice is included in
++ * all source code copies of any software which is or includes a copy or
++ * modification of this software.
++ *
++ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
++ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
++ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
++ * PURPOSE.
++ *
++__FBSDID("$FreeBSD: src/sys/opencrypto/crypto.c,v 1.16 2005/01/07 02:29:16 imp Exp $");
++ */
++
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/spinlock.h>
++#include <linux/version.h>
++#include <cryptodev.h>
++
++/*
++ * keep track of whether or not we have been initialised, a big
++ * issue if we are linked into the kernel and a driver gets started before
++ * us
++ */
++static int crypto_initted = 0;
++
++/*
++ * Crypto drivers register themselves by allocating a slot in the
++ * crypto_drivers table with crypto_get_driverid() and then registering
++ * each algorithm they support with crypto_register() and crypto_kregister().
++ */
++
++/*
++ * lock on driver table
++ * we track its state as spin_is_locked does not do anything on non-SMP boxes
++ */
++static spinlock_t crypto_drivers_lock;
++static int crypto_drivers_locked; /* for non-SMP boxes */
++
++#define CRYPTO_DRIVER_LOCK() \
++ ({ \
++ spin_lock_irqsave(&crypto_drivers_lock, d_flags); \
++ crypto_drivers_locked = 1; \
++ dprintk("%s,%d: DRIVER_LOCK()\n", __FILE__, __LINE__); \
++ })
++#define CRYPTO_DRIVER_UNLOCK() \
++ ({ \
++ dprintk("%s,%d: DRIVER_UNLOCK()\n", __FILE__, __LINE__); \
++ crypto_drivers_locked = 0; \
++ spin_unlock_irqrestore(&crypto_drivers_lock, d_flags); \
++ })
++#define CRYPTO_DRIVER_ASSERT() \
++ ({ \
++ if (!crypto_drivers_locked) { \
++ dprintk("%s,%d: DRIVER_ASSERT!\n", __FILE__, __LINE__); \
++ } \
++ })
++
++/*
++ * Crypto device/driver capabilities structure.
++ *
++ * Synchronization:
++ * (d) - protected by CRYPTO_DRIVER_LOCK()
++ * (q) - protected by CRYPTO_Q_LOCK()
++ * Not tagged fields are read-only.
++ */
++struct cryptocap {
++ device_t cc_dev; /* (d) device/driver */
++ u_int32_t cc_sessions; /* (d) # of sessions */
++ u_int32_t cc_koperations; /* (d) # os asym operations */
++ /*
++ * Largest possible operator length (in bits) for each type of
++ * encryption algorithm. XXX not used
++ */
++ u_int16_t cc_max_op_len[CRYPTO_ALGORITHM_MAX + 1];
++ u_int8_t cc_alg[CRYPTO_ALGORITHM_MAX + 1];
++ u_int8_t cc_kalg[CRK_ALGORITHM_MAX + 1];
++
++ int cc_flags; /* (d) flags */
++#define CRYPTOCAP_F_CLEANUP 0x80000000 /* needs resource cleanup */
++ int cc_qblocked; /* (q) symmetric q blocked */
++ int cc_kqblocked; /* (q) asymmetric q blocked */
++};
++static struct cryptocap *crypto_drivers = NULL;
++static int crypto_drivers_num = 0;
++
++/*
++ * There are two queues for crypto requests; one for symmetric (e.g.
++ * cipher) operations and one for asymmetric (e.g. MOD)operations.
++ * A single mutex is used to lock access to both queues. We could
++ * have one per-queue but having one simplifies handling of block/unblock
++ * operations.
++ */
++static int crp_sleep = 0;
++static LIST_HEAD(crp_q); /* request queues */
++static LIST_HEAD(crp_kq);
++
++static spinlock_t crypto_q_lock;
++
++int crypto_all_qblocked = 0; /* protect with Q_LOCK */
++module_param(crypto_all_qblocked, int, 0444);
++MODULE_PARM_DESC(crypto_all_qblocked, "Are all crypto queues blocked");
++
++int crypto_all_kqblocked = 0; /* protect with Q_LOCK */
++module_param(crypto_all_kqblocked, int, 0444);
++MODULE_PARM_DESC(crypto_all_kqblocked, "Are all asym crypto queues blocked");
++
++#define CRYPTO_Q_LOCK() \
++ ({ \
++ spin_lock_irqsave(&crypto_q_lock, q_flags); \
++ dprintk("%s,%d: Q_LOCK()\n", __FILE__, __LINE__); \
++ })
++#define CRYPTO_Q_UNLOCK() \
++ ({ \
++ dprintk("%s,%d: Q_UNLOCK()\n", __FILE__, __LINE__); \
++ spin_unlock_irqrestore(&crypto_q_lock, q_flags); \
++ })
++
++/*
++ * There are two queues for processing completed crypto requests; one
++ * for the symmetric and one for the asymmetric ops. We only need one
++ * but have two to avoid type futzing (cryptop vs. cryptkop). A single
++ * mutex is used to lock access to both queues. Note that this lock
++ * must be separate from the lock on request queues to insure driver
++ * callbacks don't generate lock order reversals.
++ */
++static LIST_HEAD(crp_ret_q); /* callback queues */
++static LIST_HEAD(crp_ret_kq);
++
++static spinlock_t crypto_ret_q_lock;
++#define CRYPTO_RETQ_LOCK() \
++ ({ \
++ spin_lock_irqsave(&crypto_ret_q_lock, r_flags); \
++ dprintk("%s,%d: RETQ_LOCK\n", __FILE__, __LINE__); \
++ })
++#define CRYPTO_RETQ_UNLOCK() \
++ ({ \
++ dprintk("%s,%d: RETQ_UNLOCK\n", __FILE__, __LINE__); \
++ spin_unlock_irqrestore(&crypto_ret_q_lock, r_flags); \
++ })
++#define CRYPTO_RETQ_EMPTY() (list_empty(&crp_ret_q) && list_empty(&crp_ret_kq))
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
++static kmem_cache_t *cryptop_zone;
++static kmem_cache_t *cryptodesc_zone;
++#else
++static struct kmem_cache *cryptop_zone;
++static struct kmem_cache *cryptodesc_zone;
++#endif
++
++#define debug crypto_debug
++int crypto_debug = 0;
++module_param(crypto_debug, int, 0644);
++MODULE_PARM_DESC(crypto_debug, "Enable debug");
++EXPORT_SYMBOL(crypto_debug);
++
++/*
++ * Maximum number of outstanding crypto requests before we start
++ * failing requests. We need this to prevent DOS when too many
++ * requests are arriving for us to keep up. Otherwise we will
++ * run the system out of memory. Since crypto is slow, we are
++ * usually the bottleneck that needs to say, enough is enough.
++ *
++ * We cannot print errors when this condition occurs, we are already too
++ * slow, printing anything will just kill us
++ */
++
++static int crypto_q_cnt = 0;
++module_param(crypto_q_cnt, int, 0444);
++MODULE_PARM_DESC(crypto_q_cnt,
++ "Current number of outstanding crypto requests");
++
++static int crypto_q_max = 1000;
++module_param(crypto_q_max, int, 0644);
++MODULE_PARM_DESC(crypto_q_max,
++ "Maximum number of outstanding crypto requests");
++
++#define bootverbose crypto_verbose
++static int crypto_verbose = 0;
++module_param(crypto_verbose, int, 0644);
++MODULE_PARM_DESC(crypto_verbose,
++ "Enable verbose crypto startup");
++
++int crypto_usercrypto = 1; /* userland may do crypto reqs */
++module_param(crypto_usercrypto, int, 0644);
++MODULE_PARM_DESC(crypto_usercrypto,
++ "Enable/disable user-mode access to crypto support");
++
++int crypto_userasymcrypto = 1; /* userland may do asym crypto reqs */
++module_param(crypto_userasymcrypto, int, 0644);
++MODULE_PARM_DESC(crypto_userasymcrypto,
++ "Enable/disable user-mode access to asymmetric crypto support");
++
++int crypto_devallowsoft = 0; /* only use hardware crypto */
++module_param(crypto_devallowsoft, int, 0644);
++MODULE_PARM_DESC(crypto_devallowsoft,
++ "Enable/disable use of software crypto support");
++
++static pid_t cryptoproc = (pid_t) -1;
++static struct completion cryptoproc_exited;
++static DECLARE_WAIT_QUEUE_HEAD(cryptoproc_wait);
++static pid_t cryptoretproc = (pid_t) -1;
++static struct completion cryptoretproc_exited;
++static DECLARE_WAIT_QUEUE_HEAD(cryptoretproc_wait);
++
++static int crypto_proc(void *arg);
++static int crypto_ret_proc(void *arg);
++static int crypto_invoke(struct cryptocap *cap, struct cryptop *crp, int hint);
++static int crypto_kinvoke(struct cryptkop *krp, int flags);
++static void crypto_exit(void);
++static int crypto_init(void);
++
++static struct cryptostats cryptostats;
++
++static struct cryptocap *
++crypto_checkdriver(u_int32_t hid)
++{
++ if (crypto_drivers == NULL)
++ return NULL;
++ return (hid >= crypto_drivers_num ? NULL : &crypto_drivers[hid]);
++}
++
++/*
++ * Compare a driver's list of supported algorithms against another
++ * list; return non-zero if all algorithms are supported.
++ */
++static int
++driver_suitable(const struct cryptocap *cap, const struct cryptoini *cri)
++{
++ const struct cryptoini *cr;
++
++ /* See if all the algorithms are supported. */
++ for (cr = cri; cr; cr = cr->cri_next)
++ if (cap->cc_alg[cr->cri_alg] == 0)
++ return 0;
++ return 1;
++}
++
++/*
++ * Select a driver for a new session that supports the specified
++ * algorithms and, optionally, is constrained according to the flags.
++ * The algorithm we use here is pretty stupid; just use the
++ * first driver that supports all the algorithms we need. If there
++ * are multiple drivers we choose the driver with the fewest active
++ * sessions. We prefer hardware-backed drivers to software ones.
++ *
++ * XXX We need more smarts here (in real life too, but that's
++ * XXX another story altogether).
++ */
++static struct cryptocap *
++crypto_select_driver(const struct cryptoini *cri, int flags)
++{
++ struct cryptocap *cap, *best;
++ int match, hid;
++
++ CRYPTO_DRIVER_ASSERT();
++
++ /*
++ * Look first for hardware crypto devices if permitted.
++ */
++ if (flags & CRYPTOCAP_F_HARDWARE)
++ match = CRYPTOCAP_F_HARDWARE;
++ else
++ match = CRYPTOCAP_F_SOFTWARE;
++ best = NULL;
++again:
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ cap = &crypto_drivers[hid];
++ /*
++ * If it's not initialized, is in the process of
++ * going away, or is not appropriate (hardware
++ * or software based on match), then skip.
++ */
++ if (cap->cc_dev == NULL ||
++ (cap->cc_flags & CRYPTOCAP_F_CLEANUP) ||
++ (cap->cc_flags & match) == 0)
++ continue;
++
++ /* verify all the algorithms are supported. */
++ if (driver_suitable(cap, cri)) {
++ if (best == NULL ||
++ cap->cc_sessions < best->cc_sessions)
++ best = cap;
++ }
++ }
++ if (best != NULL)
++ return best;
++ if (match == CRYPTOCAP_F_HARDWARE && (flags & CRYPTOCAP_F_SOFTWARE)) {
++ /* sort of an Algol 68-style for loop */
++ match = CRYPTOCAP_F_SOFTWARE;
++ goto again;
++ }
++ return best;
++}
++
++/*
++ * Create a new session. The crid argument specifies a crypto
++ * driver to use or constraints on a driver to select (hardware
++ * only, software only, either). Whatever driver is selected
++ * must be capable of the requested crypto algorithms.
++ */
++int
++crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int crid)
++{
++ struct cryptocap *cap;
++ u_int32_t hid, lid;
++ int err;
++ unsigned long d_flags;
++
++ CRYPTO_DRIVER_LOCK();
++ if ((crid & (CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE)) == 0) {
++ /*
++ * Use specified driver; verify it is capable.
++ */
++ cap = crypto_checkdriver(crid);
++ if (cap != NULL && !driver_suitable(cap, cri))
++ cap = NULL;
++ } else {
++ /*
++ * No requested driver; select based on crid flags.
++ */
++ cap = crypto_select_driver(cri, crid);
++ /*
++ * if NULL then can't do everything in one session.
++ * XXX Fix this. We need to inject a "virtual" session
++ * XXX layer right about here.
++ */
++ }
++ if (cap != NULL) {
++ /* Call the driver initialization routine. */
++ hid = cap - crypto_drivers;
++ lid = hid; /* Pass the driver ID. */
++ cap->cc_sessions++;
++ CRYPTO_DRIVER_UNLOCK();
++ err = CRYPTODEV_NEWSESSION(cap->cc_dev, &lid, cri);
++ CRYPTO_DRIVER_LOCK();
++ if (err == 0) {
++ (*sid) = (cap->cc_flags & 0xff000000)
++ | (hid & 0x00ffffff);
++ (*sid) <<= 32;
++ (*sid) |= (lid & 0xffffffff);
++ } else
++ cap->cc_sessions--;
++ } else
++ err = EINVAL;
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++static void
++crypto_remove(struct cryptocap *cap)
++{
++ CRYPTO_DRIVER_ASSERT();
++ if (cap->cc_sessions == 0 && cap->cc_koperations == 0)
++ bzero(cap, sizeof(*cap));
++}
++
++/*
++ * Delete an existing session (or a reserved session on an unregistered
++ * driver).
++ */
++int
++crypto_freesession(u_int64_t sid)
++{
++ struct cryptocap *cap;
++ u_int32_t hid;
++ int err = 0;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++
++ if (crypto_drivers == NULL) {
++ err = EINVAL;
++ goto done;
++ }
++
++ /* Determine two IDs. */
++ hid = CRYPTO_SESID2HID(sid);
++
++ if (hid >= crypto_drivers_num) {
++ dprintk("%s - INVALID DRIVER NUM %d\n", __FUNCTION__, hid);
++ err = ENOENT;
++ goto done;
++ }
++ cap = &crypto_drivers[hid];
++
++ if (cap->cc_dev) {
++ CRYPTO_DRIVER_UNLOCK();
++ /* Call the driver cleanup routine, if available, unlocked. */
++ err = CRYPTODEV_FREESESSION(cap->cc_dev, sid);
++ CRYPTO_DRIVER_LOCK();
++ }
++
++ if (cap->cc_sessions)
++ cap->cc_sessions--;
++
++ if (cap->cc_flags & CRYPTOCAP_F_CLEANUP)
++ crypto_remove(cap);
++
++done:
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++/*
++ * Return an unused driver id. Used by drivers prior to registering
++ * support for the algorithms they handle.
++ */
++int32_t
++crypto_get_driverid(device_t dev, int flags)
++{
++ struct cryptocap *newdrv;
++ int i;
++ unsigned long d_flags;
++
++ if ((flags & (CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE)) == 0) {
++ printf("%s: no flags specified when registering driver\n",
++ device_get_nameunit(dev));
++ return -1;
++ }
++
++ CRYPTO_DRIVER_LOCK();
++
++ for (i = 0; i < crypto_drivers_num; i++) {
++ if (crypto_drivers[i].cc_dev == NULL &&
++ (crypto_drivers[i].cc_flags & CRYPTOCAP_F_CLEANUP) == 0) {
++ break;
++ }
++ }
++
++ /* Out of entries, allocate some more. */
++ if (i == crypto_drivers_num) {
++ /* Be careful about wrap-around. */
++ if (2 * crypto_drivers_num <= crypto_drivers_num) {
++ CRYPTO_DRIVER_UNLOCK();
++ printk("crypto: driver count wraparound!\n");
++ return -1;
++ }
++
++ newdrv = kmalloc(2 * crypto_drivers_num * sizeof(struct cryptocap),
++ GFP_KERNEL);
++ if (newdrv == NULL) {
++ CRYPTO_DRIVER_UNLOCK();
++ printk("crypto: no space to expand driver table!\n");
++ return -1;
++ }
++
++ memcpy(newdrv, crypto_drivers,
++ crypto_drivers_num * sizeof(struct cryptocap));
++ memset(&newdrv[crypto_drivers_num], 0,
++ crypto_drivers_num * sizeof(struct cryptocap));
++
++ crypto_drivers_num *= 2;
++
++ kfree(crypto_drivers);
++ crypto_drivers = newdrv;
++ }
++
++ /* NB: state is zero'd on free */
++ crypto_drivers[i].cc_sessions = 1; /* Mark */
++ crypto_drivers[i].cc_dev = dev;
++ crypto_drivers[i].cc_flags = flags;
++ if (bootverbose)
++ printf("crypto: assign %s driver id %u, flags %u\n",
++ device_get_nameunit(dev), i, flags);
++
++ CRYPTO_DRIVER_UNLOCK();
++
++ return i;
++}
++
++/*
++ * Lookup a driver by name. We match against the full device
++ * name and unit, and against just the name. The latter gives
++ * us a simple widlcarding by device name. On success return the
++ * driver/hardware identifier; otherwise return -1.
++ */
++int
++crypto_find_driver(const char *match)
++{
++ int i, len = strlen(match);
++ unsigned long d_flags;
++
++ CRYPTO_DRIVER_LOCK();
++ for (i = 0; i < crypto_drivers_num; i++) {
++ device_t dev = crypto_drivers[i].cc_dev;
++ if (dev == NULL ||
++ (crypto_drivers[i].cc_flags & CRYPTOCAP_F_CLEANUP))
++ continue;
++ if (strncmp(match, device_get_nameunit(dev), len) == 0 ||
++ strncmp(match, device_get_name(dev), len) == 0)
++ break;
++ }
++ CRYPTO_DRIVER_UNLOCK();
++ return i < crypto_drivers_num ? i : -1;
++}
++
++/*
++ * Return the device_t for the specified driver or NULL
++ * if the driver identifier is invalid.
++ */
++device_t
++crypto_find_device_byhid(int hid)
++{
++ struct cryptocap *cap = crypto_checkdriver(hid);
++ return cap != NULL ? cap->cc_dev : NULL;
++}
++
++/*
++ * Return the device/driver capabilities.
++ */
++int
++crypto_getcaps(int hid)
++{
++ struct cryptocap *cap = crypto_checkdriver(hid);
++ return cap != NULL ? cap->cc_flags : 0;
++}
++
++/*
++ * Register support for a key-related algorithm. This routine
++ * is called once for each algorithm supported a driver.
++ */
++int
++crypto_kregister(u_int32_t driverid, int kalg, u_int32_t flags)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL &&
++ (CRK_ALGORITM_MIN <= kalg && kalg <= CRK_ALGORITHM_MAX)) {
++ /*
++ * XXX Do some performance testing to determine placing.
++ * XXX We probably need an auxiliary data structure that
++ * XXX describes relative performances.
++ */
++
++ cap->cc_kalg[kalg] = flags | CRYPTO_ALG_FLAG_SUPPORTED;
++ if (bootverbose)
++ printf("crypto: %s registers key alg %u flags %u\n"
++ , device_get_nameunit(cap->cc_dev)
++ , kalg
++ , flags
++ );
++ err = 0;
++ } else
++ err = EINVAL;
++
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++/*
++ * Register support for a non-key-related algorithm. This routine
++ * is called once for each such algorithm supported by a driver.
++ */
++int
++crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen,
++ u_int32_t flags)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long d_flags;
++
++ dprintk("%s(id=0x%x, alg=%d, maxoplen=%d, flags=0x%x)\n", __FUNCTION__,
++ driverid, alg, maxoplen, flags);
++
++ CRYPTO_DRIVER_LOCK();
++
++ cap = crypto_checkdriver(driverid);
++ /* NB: algorithms are in the range [1..max] */
++ if (cap != NULL &&
++ (CRYPTO_ALGORITHM_MIN <= alg && alg <= CRYPTO_ALGORITHM_MAX)) {
++ /*
++ * XXX Do some performance testing to determine placing.
++ * XXX We probably need an auxiliary data structure that
++ * XXX describes relative performances.
++ */
++
++ cap->cc_alg[alg] = flags | CRYPTO_ALG_FLAG_SUPPORTED;
++ cap->cc_max_op_len[alg] = maxoplen;
++ if (bootverbose)
++ printf("crypto: %s registers alg %u flags %u maxoplen %u\n"
++ , device_get_nameunit(cap->cc_dev)
++ , alg
++ , flags
++ , maxoplen
++ );
++ cap->cc_sessions = 0; /* Unmark */
++ err = 0;
++ } else
++ err = EINVAL;
++
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++static void
++driver_finis(struct cryptocap *cap)
++{
++ u_int32_t ses, kops;
++
++ CRYPTO_DRIVER_ASSERT();
++
++ ses = cap->cc_sessions;
++ kops = cap->cc_koperations;
++ bzero(cap, sizeof(*cap));
++ if (ses != 0 || kops != 0) {
++ /*
++ * If there are pending sessions,
++ * just mark as invalid.
++ */
++ cap->cc_flags |= CRYPTOCAP_F_CLEANUP;
++ cap->cc_sessions = ses;
++ cap->cc_koperations = kops;
++ }
++}
++
++/*
++ * Unregister a crypto driver. If there are pending sessions using it,
++ * leave enough information around so that subsequent calls using those
++ * sessions will correctly detect the driver has been unregistered and
++ * reroute requests.
++ */
++int
++crypto_unregister(u_int32_t driverid, int alg)
++{
++ struct cryptocap *cap;
++ int i, err;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL &&
++ (CRYPTO_ALGORITHM_MIN <= alg && alg <= CRYPTO_ALGORITHM_MAX) &&
++ cap->cc_alg[alg] != 0) {
++ cap->cc_alg[alg] = 0;
++ cap->cc_max_op_len[alg] = 0;
++
++ /* Was this the last algorithm ? */
++ for (i = 1; i <= CRYPTO_ALGORITHM_MAX; i++)
++ if (cap->cc_alg[i] != 0)
++ break;
++
++ if (i == CRYPTO_ALGORITHM_MAX + 1)
++ driver_finis(cap);
++ err = 0;
++ } else
++ err = EINVAL;
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++/*
++ * Unregister all algorithms associated with a crypto driver.
++ * If there are pending sessions using it, leave enough information
++ * around so that subsequent calls using those sessions will
++ * correctly detect the driver has been unregistered and reroute
++ * requests.
++ */
++int
++crypto_unregister_all(u_int32_t driverid)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL) {
++ driver_finis(cap);
++ err = 0;
++ } else
++ err = EINVAL;
++ CRYPTO_DRIVER_UNLOCK();
++
++ return err;
++}
++
++/*
++ * Clear blockage on a driver. The what parameter indicates whether
++ * the driver is now ready for cryptop's and/or cryptokop's.
++ */
++int
++crypto_unblock(u_int32_t driverid, int what)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long q_flags;
++
++ CRYPTO_Q_LOCK();
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL) {
++ if (what & CRYPTO_SYMQ) {
++ cap->cc_qblocked = 0;
++ crypto_all_qblocked = 0;
++ }
++ if (what & CRYPTO_ASYMQ) {
++ cap->cc_kqblocked = 0;
++ crypto_all_kqblocked = 0;
++ }
++ if (crp_sleep)
++ wake_up_interruptible(&cryptoproc_wait);
++ err = 0;
++ } else
++ err = EINVAL;
++ CRYPTO_Q_UNLOCK(); //DAVIDM should this be a driver lock
++
++ return err;
++}
++
++/*
++ * Add a crypto request to a queue, to be processed by the kernel thread.
++ */
++int
++crypto_dispatch(struct cryptop *crp)
++{
++ struct cryptocap *cap;
++ int result = -1;
++ unsigned long q_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ cryptostats.cs_ops++;
++
++ CRYPTO_Q_LOCK();
++ if (crypto_q_cnt >= crypto_q_max) {
++ CRYPTO_Q_UNLOCK();
++ cryptostats.cs_drops++;
++ return ENOMEM;
++ }
++ crypto_q_cnt++;
++
++ /*
++ * Caller marked the request to be processed immediately; dispatch
++ * it directly to the driver unless the driver is currently blocked.
++ */
++ if ((crp->crp_flags & CRYPTO_F_BATCH) == 0) {
++ int hid = CRYPTO_SESID2HID(crp->crp_sid);
++ cap = crypto_checkdriver(hid);
++ /* Driver cannot disappear when there is an active session. */
++ KASSERT(cap != NULL, ("%s: Driver disappeared.", __func__));
++ if (!cap->cc_qblocked) {
++ crypto_all_qblocked = 0;
++ crypto_drivers[hid].cc_qblocked = 1;
++ CRYPTO_Q_UNLOCK();
++ result = crypto_invoke(cap, crp, 0);
++ CRYPTO_Q_LOCK();
++ if (result != ERESTART)
++ crypto_drivers[hid].cc_qblocked = 0;
++ }
++ }
++ if (result == ERESTART) {
++ /*
++ * The driver ran out of resources, mark the
++ * driver ``blocked'' for cryptop's and put
++ * the request back in the queue. It would
++ * best to put the request back where we got
++ * it but that's hard so for now we put it
++ * at the front. This should be ok; putting
++ * it at the end does not work.
++ */
++ list_add(&crp->crp_next, &crp_q);
++ cryptostats.cs_blocks++;
++ } else if (result == -1) {
++ TAILQ_INSERT_TAIL(&crp_q, crp, crp_next);
++ }
++ if (crp_sleep)
++ wake_up_interruptible(&cryptoproc_wait);
++ CRYPTO_Q_UNLOCK();
++ return 0;
++}
++
++/*
++ * Add an asymetric crypto request to a queue,
++ * to be processed by the kernel thread.
++ */
++int
++crypto_kdispatch(struct cryptkop *krp)
++{
++ int error;
++ unsigned long q_flags;
++
++ cryptostats.cs_kops++;
++
++ error = crypto_kinvoke(krp, krp->krp_crid);
++ if (error == ERESTART) {
++ CRYPTO_Q_LOCK();
++ TAILQ_INSERT_TAIL(&crp_kq, krp, krp_next);
++ if (crp_sleep)
++ wake_up_interruptible(&cryptoproc_wait);
++ CRYPTO_Q_UNLOCK();
++ error = 0;
++ }
++ return error;
++}
++
++/*
++ * Verify a driver is suitable for the specified operation.
++ */
++static __inline int
++kdriver_suitable(const struct cryptocap *cap, const struct cryptkop *krp)
++{
++ return (cap->cc_kalg[krp->krp_op] & CRYPTO_ALG_FLAG_SUPPORTED) != 0;
++}
++
++/*
++ * Select a driver for an asym operation. The driver must
++ * support the necessary algorithm. The caller can constrain
++ * which device is selected with the flags parameter. The
++ * algorithm we use here is pretty stupid; just use the first
++ * driver that supports the algorithms we need. If there are
++ * multiple suitable drivers we choose the driver with the
++ * fewest active operations. We prefer hardware-backed
++ * drivers to software ones when either may be used.
++ */
++static struct cryptocap *
++crypto_select_kdriver(const struct cryptkop *krp, int flags)
++{
++ struct cryptocap *cap, *best, *blocked;
++ int match, hid;
++
++ CRYPTO_DRIVER_ASSERT();
++
++ /*
++ * Look first for hardware crypto devices if permitted.
++ */
++ if (flags & CRYPTOCAP_F_HARDWARE)
++ match = CRYPTOCAP_F_HARDWARE;
++ else
++ match = CRYPTOCAP_F_SOFTWARE;
++ best = NULL;
++ blocked = NULL;
++again:
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ cap = &crypto_drivers[hid];
++ /*
++ * If it's not initialized, is in the process of
++ * going away, or is not appropriate (hardware
++ * or software based on match), then skip.
++ */
++ if (cap->cc_dev == NULL ||
++ (cap->cc_flags & CRYPTOCAP_F_CLEANUP) ||
++ (cap->cc_flags & match) == 0)
++ continue;
++
++ /* verify all the algorithms are supported. */
++ if (kdriver_suitable(cap, krp)) {
++ if (best == NULL ||
++ cap->cc_koperations < best->cc_koperations)
++ best = cap;
++ }
++ }
++ if (best != NULL)
++ return best;
++ if (match == CRYPTOCAP_F_HARDWARE && (flags & CRYPTOCAP_F_SOFTWARE)) {
++ /* sort of an Algol 68-style for loop */
++ match = CRYPTOCAP_F_SOFTWARE;
++ goto again;
++ }
++ return best;
++}
++
++/*
++ * Dispatch an assymetric crypto request.
++ */
++static int
++crypto_kinvoke(struct cryptkop *krp, int crid)
++{
++ struct cryptocap *cap = NULL;
++ int error;
++ unsigned long d_flags;
++
++ KASSERT(krp != NULL, ("%s: krp == NULL", __func__));
++ KASSERT(krp->krp_callback != NULL,
++ ("%s: krp->crp_callback == NULL", __func__));
++
++ CRYPTO_DRIVER_LOCK();
++ if ((crid & (CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE)) == 0) {
++ cap = crypto_checkdriver(crid);
++ if (cap != NULL) {
++ /*
++ * Driver present, it must support the necessary
++ * algorithm and, if s/w drivers are excluded,
++ * it must be registered as hardware-backed.
++ */
++ if (!kdriver_suitable(cap, krp) ||
++ (!crypto_devallowsoft &&
++ (cap->cc_flags & CRYPTOCAP_F_HARDWARE) == 0))
++ cap = NULL;
++ }
++ } else {
++ /*
++ * No requested driver; select based on crid flags.
++ */
++ if (!crypto_devallowsoft) /* NB: disallow s/w drivers */
++ crid &= ~CRYPTOCAP_F_SOFTWARE;
++ cap = crypto_select_kdriver(krp, crid);
++ }
++ if (cap != NULL && !cap->cc_kqblocked) {
++ krp->krp_hid = cap - crypto_drivers;
++ cap->cc_koperations++;
++ CRYPTO_DRIVER_UNLOCK();
++ error = CRYPTODEV_KPROCESS(cap->cc_dev, krp, 0);
++ CRYPTO_DRIVER_LOCK();
++ if (error == ERESTART) {
++ cap->cc_koperations--;
++ CRYPTO_DRIVER_UNLOCK();
++ return (error);
++ }
++ /* return the actual device used */
++ krp->krp_crid = krp->krp_hid;
++ } else {
++ /*
++ * NB: cap is !NULL if device is blocked; in
++ * that case return ERESTART so the operation
++ * is resubmitted if possible.
++ */
++ error = (cap == NULL) ? ENODEV : ERESTART;
++ }
++ CRYPTO_DRIVER_UNLOCK();
++
++ if (error) {
++ krp->krp_status = error;
++ crypto_kdone(krp);
++ }
++ return 0;
++}
++
++
++/*
++ * Dispatch a crypto request to the appropriate crypto devices.
++ */
++static int
++crypto_invoke(struct cryptocap *cap, struct cryptop *crp, int hint)
++{
++ KASSERT(crp != NULL, ("%s: crp == NULL", __func__));
++ KASSERT(crp->crp_callback != NULL,
++ ("%s: crp->crp_callback == NULL", __func__));
++ KASSERT(crp->crp_desc != NULL, ("%s: crp->crp_desc == NULL", __func__));
++
++ dprintk("%s()\n", __FUNCTION__);
++
++#ifdef CRYPTO_TIMING
++ if (crypto_timing)
++ crypto_tstat(&cryptostats.cs_invoke, &crp->crp_tstamp);
++#endif
++ if (cap->cc_flags & CRYPTOCAP_F_CLEANUP) {
++ struct cryptodesc *crd;
++ u_int64_t nid;
++
++ /*
++ * Driver has unregistered; migrate the session and return
++ * an error to the caller so they'll resubmit the op.
++ *
++ * XXX: What if there are more already queued requests for this
++ * session?
++ */
++ crypto_freesession(crp->crp_sid);
++
++ for (crd = crp->crp_desc; crd->crd_next; crd = crd->crd_next)
++ crd->CRD_INI.cri_next = &(crd->crd_next->CRD_INI);
++
++ /* XXX propagate flags from initial session? */
++ if (crypto_newsession(&nid, &(crp->crp_desc->CRD_INI),
++ CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE) == 0)
++ crp->crp_sid = nid;
++
++ crp->crp_etype = EAGAIN;
++ crypto_done(crp);
++ return 0;
++ } else {
++ /*
++ * Invoke the driver to process the request.
++ */
++ return CRYPTODEV_PROCESS(cap->cc_dev, crp, hint);
++ }
++}
++
++/*
++ * Release a set of crypto descriptors.
++ */
++void
++crypto_freereq(struct cryptop *crp)
++{
++ struct cryptodesc *crd;
++
++ if (crp == NULL)
++ return;
++
++#ifdef DIAGNOSTIC
++ {
++ struct cryptop *crp2;
++ unsigned long q_flags;
++
++ CRYPTO_Q_LOCK();
++ TAILQ_FOREACH(crp2, &crp_q, crp_next) {
++ KASSERT(crp2 != crp,
++ ("Freeing cryptop from the crypto queue (%p).",
++ crp));
++ }
++ CRYPTO_Q_UNLOCK();
++ CRYPTO_RETQ_LOCK();
++ TAILQ_FOREACH(crp2, &crp_ret_q, crp_next) {
++ KASSERT(crp2 != crp,
++ ("Freeing cryptop from the return queue (%p).",
++ crp));
++ }
++ CRYPTO_RETQ_UNLOCK();
++ }
++#endif
++
++ while ((crd = crp->crp_desc) != NULL) {
++ crp->crp_desc = crd->crd_next;
++ kmem_cache_free(cryptodesc_zone, crd);
++ }
++ kmem_cache_free(cryptop_zone, crp);
++}
++
++/*
++ * Acquire a set of crypto descriptors.
++ */
++struct cryptop *
++crypto_getreq(int num)
++{
++ struct cryptodesc *crd;
++ struct cryptop *crp;
++
++ crp = kmem_cache_alloc(cryptop_zone, SLAB_ATOMIC);
++ if (crp != NULL) {
++ memset(crp, 0, sizeof(*crp));
++ INIT_LIST_HEAD(&crp->crp_next);
++ init_waitqueue_head(&crp->crp_waitq);
++ while (num--) {
++ crd = kmem_cache_alloc(cryptodesc_zone, SLAB_ATOMIC);
++ if (crd == NULL) {
++ crypto_freereq(crp);
++ return NULL;
++ }
++ memset(crd, 0, sizeof(*crd));
++ crd->crd_next = crp->crp_desc;
++ crp->crp_desc = crd;
++ }
++ }
++ return crp;
++}
++
++/*
++ * Invoke the callback on behalf of the driver.
++ */
++void
++crypto_done(struct cryptop *crp)
++{
++ unsigned long q_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if ((crp->crp_flags & CRYPTO_F_DONE) == 0) {
++ crp->crp_flags |= CRYPTO_F_DONE;
++ CRYPTO_Q_LOCK();
++ crypto_q_cnt--;
++ CRYPTO_Q_UNLOCK();
++ } else
++ printk("crypto: crypto_done op already done, flags 0x%x",
++ crp->crp_flags);
++ if (crp->crp_etype != 0)
++ cryptostats.cs_errs++;
++ /*
++ * CBIMM means unconditionally do the callback immediately;
++ * CBIFSYNC means do the callback immediately only if the
++ * operation was done synchronously. Both are used to avoid
++ * doing extraneous context switches; the latter is mostly
++ * used with the software crypto driver.
++ */
++ if ((crp->crp_flags & CRYPTO_F_CBIMM) ||
++ ((crp->crp_flags & CRYPTO_F_CBIFSYNC) &&
++ (CRYPTO_SESID2CAPS(crp->crp_sid) & CRYPTOCAP_F_SYNC))) {
++ /*
++ * Do the callback directly. This is ok when the
++ * callback routine does very little (e.g. the
++ * /dev/crypto callback method just does a wakeup).
++ */
++ crp->crp_callback(crp);
++ } else {
++ unsigned long r_flags;
++ /*
++ * Normal case; queue the callback for the thread.
++ */
++ CRYPTO_RETQ_LOCK();
++ if (CRYPTO_RETQ_EMPTY())
++ wake_up_interruptible(&cryptoretproc_wait);/* shared wait channel */
++ TAILQ_INSERT_TAIL(&crp_ret_q, crp, crp_next);
++ CRYPTO_RETQ_UNLOCK();
++ }
++}
++
++/*
++ * Invoke the callback on behalf of the driver.
++ */
++void
++crypto_kdone(struct cryptkop *krp)
++{
++ struct cryptocap *cap;
++ unsigned long d_flags;
++
++ if ((krp->krp_flags & CRYPTO_KF_DONE) != 0)
++ printk("crypto: crypto_kdone op already done, flags 0x%x",
++ krp->krp_flags);
++ krp->krp_flags |= CRYPTO_KF_DONE;
++ if (krp->krp_status != 0)
++ cryptostats.cs_kerrs++;
++
++ CRYPTO_DRIVER_LOCK();
++ /* XXX: What if driver is loaded in the meantime? */
++ if (krp->krp_hid < crypto_drivers_num) {
++ cap = &crypto_drivers[krp->krp_hid];
++ cap->cc_koperations--;
++ KASSERT(cap->cc_koperations >= 0, ("cc_koperations < 0"));
++ if (cap->cc_flags & CRYPTOCAP_F_CLEANUP)
++ crypto_remove(cap);
++ }
++ CRYPTO_DRIVER_UNLOCK();
++
++ /*
++ * CBIMM means unconditionally do the callback immediately;
++ * This is used to avoid doing extraneous context switches
++ */
++ if ((krp->krp_flags & CRYPTO_KF_CBIMM)) {
++ /*
++ * Do the callback directly. This is ok when the
++ * callback routine does very little (e.g. the
++ * /dev/crypto callback method just does a wakeup).
++ */
++ krp->krp_callback(krp);
++ } else {
++ unsigned long r_flags;
++ /*
++ * Normal case; queue the callback for the thread.
++ */
++ CRYPTO_RETQ_LOCK();
++ if (CRYPTO_RETQ_EMPTY())
++ wake_up_interruptible(&cryptoretproc_wait);/* shared wait channel */
++ TAILQ_INSERT_TAIL(&crp_ret_kq, krp, krp_next);
++ CRYPTO_RETQ_UNLOCK();
++ }
++}
++
++int
++crypto_getfeat(int *featp)
++{
++ int hid, kalg, feat = 0;
++ unsigned long d_flags;
++
++ CRYPTO_DRIVER_LOCK();
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ const struct cryptocap *cap = &crypto_drivers[hid];
++
++ if ((cap->cc_flags & CRYPTOCAP_F_SOFTWARE) &&
++ !crypto_devallowsoft) {
++ continue;
++ }
++ for (kalg = 0; kalg < CRK_ALGORITHM_MAX; kalg++)
++ if (cap->cc_kalg[kalg] & CRYPTO_ALG_FLAG_SUPPORTED)
++ feat |= 1 << kalg;
++ }
++ CRYPTO_DRIVER_UNLOCK();
++ *featp = feat;
++ return (0);
++}
++
++/*
++ * Crypto thread, dispatches crypto requests.
++ */
++static int
++crypto_proc(void *arg)
++{
++ struct cryptop *crp, *submit;
++ struct cryptkop *krp, *krpp;
++ struct cryptocap *cap;
++ u_int32_t hid;
++ int result, hint;
++ unsigned long q_flags;
++
++ ocf_daemonize("crypto");
++
++ CRYPTO_Q_LOCK();
++ for (;;) {
++ /*
++ * we need to make sure we don't get into a busy loop with nothing
++ * to do, the two crypto_all_*blocked vars help us find out when
++ * we are all full and can do nothing on any driver or Q. If so we
++ * wait for an unblock.
++ */
++ crypto_all_qblocked = !list_empty(&crp_q);
++
++ /*
++ * Find the first element in the queue that can be
++ * processed and look-ahead to see if multiple ops
++ * are ready for the same driver.
++ */
++ submit = NULL;
++ hint = 0;
++ list_for_each_entry(crp, &crp_q, crp_next) {
++ hid = CRYPTO_SESID2HID(crp->crp_sid);
++ cap = crypto_checkdriver(hid);
++ /*
++ * Driver cannot disappear when there is an active
++ * session.
++ */
++ KASSERT(cap != NULL, ("%s:%u Driver disappeared.",
++ __func__, __LINE__));
++ if (cap == NULL || cap->cc_dev == NULL) {
++ /* Op needs to be migrated, process it. */
++ if (submit == NULL)
++ submit = crp;
++ break;
++ }
++ if (!cap->cc_qblocked) {
++ if (submit != NULL) {
++ /*
++ * We stop on finding another op,
++ * regardless whether its for the same
++ * driver or not. We could keep
++ * searching the queue but it might be
++ * better to just use a per-driver
++ * queue instead.
++ */
++ if (CRYPTO_SESID2HID(submit->crp_sid) == hid)
++ hint = CRYPTO_HINT_MORE;
++ break;
++ } else {
++ submit = crp;
++ if ((submit->crp_flags & CRYPTO_F_BATCH) == 0)
++ break;
++ /* keep scanning for more are q'd */
++ }
++ }
++ }
++ if (submit != NULL) {
++ hid = CRYPTO_SESID2HID(submit->crp_sid);
++ crypto_all_qblocked = 0;
++ list_del(&submit->crp_next);
++ crypto_drivers[hid].cc_qblocked = 1;
++ cap = crypto_checkdriver(hid);
++ CRYPTO_Q_UNLOCK();
++ KASSERT(cap != NULL, ("%s:%u Driver disappeared.",
++ __func__, __LINE__));
++ result = crypto_invoke(cap, submit, hint);
++ CRYPTO_Q_LOCK();
++ if (result == ERESTART) {
++ /*
++ * The driver ran out of resources, mark the
++ * driver ``blocked'' for cryptop's and put
++ * the request back in the queue. It would
++ * best to put the request back where we got
++ * it but that's hard so for now we put it
++ * at the front. This should be ok; putting
++ * it at the end does not work.
++ */
++ /* XXX validate sid again? */
++ list_add(&submit->crp_next, &crp_q);
++ cryptostats.cs_blocks++;
++ } else
++ crypto_drivers[hid].cc_qblocked=0;
++ }
++
++ crypto_all_kqblocked = !list_empty(&crp_kq);
++
++ /* As above, but for key ops */
++ krp = NULL;
++ list_for_each_entry(krpp, &crp_kq, krp_next) {
++ cap = crypto_checkdriver(krpp->krp_hid);
++ if (cap == NULL || cap->cc_dev == NULL) {
++ /*
++ * Operation needs to be migrated, invalidate
++ * the assigned device so it will reselect a
++ * new one below. Propagate the original
++ * crid selection flags if supplied.
++ */
++ krp->krp_hid = krp->krp_crid &
++ (CRYPTOCAP_F_SOFTWARE|CRYPTOCAP_F_HARDWARE);
++ if (krp->krp_hid == 0)
++ krp->krp_hid =
++ CRYPTOCAP_F_SOFTWARE|CRYPTOCAP_F_HARDWARE;
++ break;
++ }
++ if (!cap->cc_kqblocked) {
++ krp = krpp;
++ break;
++ }
++ }
++ if (krp != NULL) {
++ crypto_all_kqblocked = 0;
++ list_del(&krp->krp_next);
++ crypto_drivers[krp->krp_hid].cc_kqblocked = 1;
++ CRYPTO_Q_UNLOCK();
++ result = crypto_kinvoke(krp, krp->krp_hid);
++ CRYPTO_Q_LOCK();
++ if (result == ERESTART) {
++ /*
++ * The driver ran out of resources, mark the
++ * driver ``blocked'' for cryptkop's and put
++ * the request back in the queue. It would
++ * best to put the request back where we got
++ * it but that's hard so for now we put it
++ * at the front. This should be ok; putting
++ * it at the end does not work.
++ */
++ /* XXX validate sid again? */
++ list_add(&krp->krp_next, &crp_kq);
++ cryptostats.cs_kblocks++;
++ } else
++ crypto_drivers[krp->krp_hid].cc_kqblocked = 0;
++ }
++
++ if (submit == NULL && krp == NULL) {
++ /*
++ * Nothing more to be processed. Sleep until we're
++ * woken because there are more ops to process.
++ * This happens either by submission or by a driver
++ * becoming unblocked and notifying us through
++ * crypto_unblock. Note that when we wakeup we
++ * start processing each queue again from the
++ * front. It's not clear that it's important to
++ * preserve this ordering since ops may finish
++ * out of order if dispatched to different devices
++ * and some become blocked while others do not.
++ */
++ dprintk("%s - sleeping (qe=%d qb=%d kqe=%d kqb=%d)\n",
++ __FUNCTION__,
++ list_empty(&crp_q), crypto_all_qblocked,
++ list_empty(&crp_kq), crypto_all_kqblocked);
++ CRYPTO_Q_UNLOCK();
++ crp_sleep = 1;
++ wait_event_interruptible(cryptoproc_wait,
++ !(list_empty(&crp_q) || crypto_all_qblocked) ||
++ !(list_empty(&crp_kq) || crypto_all_kqblocked) ||
++ cryptoproc == (pid_t) -1);
++ crp_sleep = 0;
++ if (signal_pending (current)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_lock_irq(&current->sigmask_lock);
++#endif
++ flush_signals(current);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_unlock_irq(&current->sigmask_lock);
++#endif
++ }
++ CRYPTO_Q_LOCK();
++ dprintk("%s - awake\n", __FUNCTION__);
++ if (cryptoproc == (pid_t) -1)
++ break;
++ cryptostats.cs_intrs++;
++ }
++ }
++ CRYPTO_Q_UNLOCK();
++ complete_and_exit(&cryptoproc_exited, 0);
++}
++
++/*
++ * Crypto returns thread, does callbacks for processed crypto requests.
++ * Callbacks are done here, rather than in the crypto drivers, because
++ * callbacks typically are expensive and would slow interrupt handling.
++ */
++static int
++crypto_ret_proc(void *arg)
++{
++ struct cryptop *crpt;
++ struct cryptkop *krpt;
++ unsigned long r_flags;
++
++ ocf_daemonize("crypto_ret");
++
++ CRYPTO_RETQ_LOCK();
++ for (;;) {
++ /* Harvest return q's for completed ops */
++ crpt = NULL;
++ if (!list_empty(&crp_ret_q))
++ crpt = list_entry(crp_ret_q.next, typeof(*crpt), crp_next);
++ if (crpt != NULL)
++ list_del(&crpt->crp_next);
++
++ krpt = NULL;
++ if (!list_empty(&crp_ret_kq))
++ krpt = list_entry(crp_ret_kq.next, typeof(*krpt), krp_next);
++ if (krpt != NULL)
++ list_del(&krpt->krp_next);
++
++ if (crpt != NULL || krpt != NULL) {
++ CRYPTO_RETQ_UNLOCK();
++ /*
++ * Run callbacks unlocked.
++ */
++ if (crpt != NULL)
++ crpt->crp_callback(crpt);
++ if (krpt != NULL)
++ krpt->krp_callback(krpt);
++ CRYPTO_RETQ_LOCK();
++ } else {
++ /*
++ * Nothing more to be processed. Sleep until we're
++ * woken because there are more returns to process.
++ */
++ dprintk("%s - sleeping\n", __FUNCTION__);
++ CRYPTO_RETQ_UNLOCK();
++ wait_event_interruptible(cryptoretproc_wait,
++ cryptoretproc == (pid_t) -1 ||
++ !list_empty(&crp_ret_q) ||
++ !list_empty(&crp_ret_kq));
++ if (signal_pending (current)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_lock_irq(&current->sigmask_lock);
++#endif
++ flush_signals(current);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_unlock_irq(&current->sigmask_lock);
++#endif
++ }
++ CRYPTO_RETQ_LOCK();
++ dprintk("%s - awake\n", __FUNCTION__);
++ if (cryptoretproc == (pid_t) -1) {
++ dprintk("%s - EXITING!\n", __FUNCTION__);
++ break;
++ }
++ cryptostats.cs_rets++;
++ }
++ }
++ CRYPTO_RETQ_UNLOCK();
++ complete_and_exit(&cryptoretproc_exited, 0);
++}
++
++
++#if 0 /* should put this into /proc or something */
++static void
++db_show_drivers(void)
++{
++ int hid;
++
++ db_printf("%12s %4s %4s %8s %2s %2s\n"
++ , "Device"
++ , "Ses"
++ , "Kops"
++ , "Flags"
++ , "QB"
++ , "KB"
++ );
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ const struct cryptocap *cap = &crypto_drivers[hid];
++ if (cap->cc_dev == NULL)
++ continue;
++ db_printf("%-12s %4u %4u %08x %2u %2u\n"
++ , device_get_nameunit(cap->cc_dev)
++ , cap->cc_sessions
++ , cap->cc_koperations
++ , cap->cc_flags
++ , cap->cc_qblocked
++ , cap->cc_kqblocked
++ );
++ }
++}
++
++DB_SHOW_COMMAND(crypto, db_show_crypto)
++{
++ struct cryptop *crp;
++
++ db_show_drivers();
++ db_printf("\n");
++
++ db_printf("%4s %8s %4s %4s %4s %4s %8s %8s\n",
++ "HID", "Caps", "Ilen", "Olen", "Etype", "Flags",
++ "Desc", "Callback");
++ TAILQ_FOREACH(crp, &crp_q, crp_next) {
++ db_printf("%4u %08x %4u %4u %4u %04x %8p %8p\n"
++ , (int) CRYPTO_SESID2HID(crp->crp_sid)
++ , (int) CRYPTO_SESID2CAPS(crp->crp_sid)
++ , crp->crp_ilen, crp->crp_olen
++ , crp->crp_etype
++ , crp->crp_flags
++ , crp->crp_desc
++ , crp->crp_callback
++ );
++ }
++ if (!TAILQ_EMPTY(&crp_ret_q)) {
++ db_printf("\n%4s %4s %4s %8s\n",
++ "HID", "Etype", "Flags", "Callback");
++ TAILQ_FOREACH(crp, &crp_ret_q, crp_next) {
++ db_printf("%4u %4u %04x %8p\n"
++ , (int) CRYPTO_SESID2HID(crp->crp_sid)
++ , crp->crp_etype
++ , crp->crp_flags
++ , crp->crp_callback
++ );
++ }
++ }
++}
++
++DB_SHOW_COMMAND(kcrypto, db_show_kcrypto)
++{
++ struct cryptkop *krp;
++
++ db_show_drivers();
++ db_printf("\n");
++
++ db_printf("%4s %5s %4s %4s %8s %4s %8s\n",
++ "Op", "Status", "#IP", "#OP", "CRID", "HID", "Callback");
++ TAILQ_FOREACH(krp, &crp_kq, krp_next) {
++ db_printf("%4u %5u %4u %4u %08x %4u %8p\n"
++ , krp->krp_op
++ , krp->krp_status
++ , krp->krp_iparams, krp->krp_oparams
++ , krp->krp_crid, krp->krp_hid
++ , krp->krp_callback
++ );
++ }
++ if (!TAILQ_EMPTY(&crp_ret_q)) {
++ db_printf("%4s %5s %8s %4s %8s\n",
++ "Op", "Status", "CRID", "HID", "Callback");
++ TAILQ_FOREACH(krp, &crp_ret_kq, krp_next) {
++ db_printf("%4u %5u %08x %4u %8p\n"
++ , krp->krp_op
++ , krp->krp_status
++ , krp->krp_crid, krp->krp_hid
++ , krp->krp_callback
++ );
++ }
++ }
++}
++#endif
++
++
++static int
++crypto_init(void)
++{
++ int error;
++
++ dprintk("%s(0x%x)\n", __FUNCTION__, (int) crypto_init);
++
++ if (crypto_initted)
++ return 0;
++ crypto_initted = 1;
++
++ spin_lock_init(&crypto_drivers_lock);
++ spin_lock_init(&crypto_q_lock);
++ spin_lock_init(&crypto_ret_q_lock);
++
++ cryptop_zone = kmem_cache_create("cryptop", sizeof(struct cryptop),
++ 0, SLAB_HWCACHE_ALIGN, NULL
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
++ , NULL
++#endif
++ );
++
++ cryptodesc_zone = kmem_cache_create("cryptodesc", sizeof(struct cryptodesc),
++ 0, SLAB_HWCACHE_ALIGN, NULL
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
++ , NULL
++#endif
++ );
++
++ if (cryptodesc_zone == NULL || cryptop_zone == NULL) {
++ printk("crypto: crypto_init cannot setup crypto zones\n");
++ error = ENOMEM;
++ goto bad;
++ }
++
++ crypto_drivers_num = CRYPTO_DRIVERS_INITIAL;
++ crypto_drivers = kmalloc(crypto_drivers_num * sizeof(struct cryptocap),
++ GFP_KERNEL);
++ if (crypto_drivers == NULL) {
++ printk("crypto: crypto_init cannot setup crypto drivers\n");
++ error = ENOMEM;
++ goto bad;
++ }
++
++ memset(crypto_drivers, 0, crypto_drivers_num * sizeof(struct cryptocap));
++
++ init_completion(&cryptoproc_exited);
++ init_completion(&cryptoretproc_exited);
++
++ cryptoproc = 0; /* to avoid race condition where proc runs first */
++ cryptoproc = kernel_thread(crypto_proc, NULL, CLONE_FS|CLONE_FILES);
++ if (cryptoproc < 0) {
++ error = cryptoproc;
++ printk("crypto: crypto_init cannot start crypto thread; error %d",
++ error);
++ goto bad;
++ }
++
++ cryptoretproc = 0; /* to avoid race condition where proc runs first */
++ cryptoretproc = kernel_thread(crypto_ret_proc, NULL, CLONE_FS|CLONE_FILES);
++ if (cryptoretproc < 0) {
++ error = cryptoretproc;
++ printk("crypto: crypto_init cannot start cryptoret thread; error %d",
++ error);
++ goto bad;
++ }
++
++ return 0;
++bad:
++ crypto_exit();
++ return error;
++}
++
++
++static void
++crypto_exit(void)
++{
++ pid_t p;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ /*
++ * Terminate any crypto threads.
++ */
++
++ CRYPTO_DRIVER_LOCK();
++ p = cryptoproc;
++ cryptoproc = (pid_t) -1;
++ kill_pid(p, SIGTERM, 1);
++ wake_up_interruptible(&cryptoproc_wait);
++ CRYPTO_DRIVER_UNLOCK();
++
++ wait_for_completion(&cryptoproc_exited);
++
++ CRYPTO_DRIVER_LOCK();
++ p = cryptoretproc;
++ cryptoretproc = (pid_t) -1;
++ kill_pid(p, SIGTERM, 1);
++ wake_up_interruptible(&cryptoretproc_wait);
++ CRYPTO_DRIVER_UNLOCK();
++
++ wait_for_completion(&cryptoretproc_exited);
++
++ /* XXX flush queues??? */
++
++ /*
++ * Reclaim dynamically allocated resources.
++ */
++ if (crypto_drivers != NULL)
++ kfree(crypto_drivers);
++
++ if (cryptodesc_zone != NULL)
++ kmem_cache_destroy(cryptodesc_zone);
++ if (cryptop_zone != NULL)
++ kmem_cache_destroy(cryptop_zone);
++}
++
++
++EXPORT_SYMBOL(crypto_newsession);
++EXPORT_SYMBOL(crypto_freesession);
++EXPORT_SYMBOL(crypto_get_driverid);
++EXPORT_SYMBOL(crypto_kregister);
++EXPORT_SYMBOL(crypto_register);
++EXPORT_SYMBOL(crypto_unregister);
++EXPORT_SYMBOL(crypto_unregister_all);
++EXPORT_SYMBOL(crypto_unblock);
++EXPORT_SYMBOL(crypto_dispatch);
++EXPORT_SYMBOL(crypto_kdispatch);
++EXPORT_SYMBOL(crypto_freereq);
++EXPORT_SYMBOL(crypto_getreq);
++EXPORT_SYMBOL(crypto_done);
++EXPORT_SYMBOL(crypto_kdone);
++EXPORT_SYMBOL(crypto_getfeat);
++EXPORT_SYMBOL(crypto_userasymcrypto);
++EXPORT_SYMBOL(crypto_getcaps);
++EXPORT_SYMBOL(crypto_find_driver);
++EXPORT_SYMBOL(crypto_find_device_byhid);
++
++module_init(crypto_init);
++module_exit(crypto_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("OCF (OpenBSD Cryptographic Framework)");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/cryptodev.c linux-2.6.27.10/crypto/ocf/cryptodev.c
+--- linux-2.6.27.10.orig/crypto/ocf/cryptodev.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/cryptodev.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,1048 @@
++/* $OpenBSD: cryptodev.c,v 1.52 2002/06/19 07:22:46 deraadt Exp $ */
++
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2001 Theo de Raadt
++ * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++__FBSDID("$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.34 2007/05/09 19:37:02 gnn Exp $");
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/types.h>
++#include <linux/time.h>
++#include <linux/delay.h>
++#include <linux/list.h>
++#include <linux/init.h>
++#include <linux/sched.h>
++#include <linux/unistd.h>
++#include <linux/module.h>
++#include <linux/wait.h>
++#include <linux/slab.h>
++#include <linux/fs.h>
++#include <linux/dcache.h>
++#include <linux/file.h>
++#include <linux/mount.h>
++#include <linux/miscdevice.h>
++#include <linux/version.h>
++#include <asm/uaccess.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++extern asmlinkage long sys_dup(unsigned int fildes);
++
++#define debug cryptodev_debug
++int cryptodev_debug = 0;
++module_param(cryptodev_debug, int, 0644);
++MODULE_PARM_DESC(cryptodev_debug, "Enable cryptodev debug");
++
++struct csession_info {
++ u_int16_t blocksize;
++ u_int16_t minkey, maxkey;
++
++ u_int16_t keysize;
++ /* u_int16_t hashsize; */
++ u_int16_t authsize;
++ /* u_int16_t ctxsize; */
++};
++
++struct csession {
++ struct list_head list;
++ u_int64_t sid;
++ u_int32_t ses;
++
++ wait_queue_head_t waitq;
++
++ u_int32_t cipher;
++
++ u_int32_t mac;
++
++ caddr_t key;
++ int keylen;
++ u_char tmp_iv[EALG_MAX_BLOCK_LEN];
++
++ caddr_t mackey;
++ int mackeylen;
++
++ struct csession_info info;
++
++ struct iovec iovec;
++ struct uio uio;
++ int error;
++};
++
++struct fcrypt {
++ struct list_head csessions;
++ int sesn;
++};
++
++static struct csession *csefind(struct fcrypt *, u_int);
++static int csedelete(struct fcrypt *, struct csession *);
++static struct csession *cseadd(struct fcrypt *, struct csession *);
++static struct csession *csecreate(struct fcrypt *, u_int64_t,
++ struct cryptoini *crie, struct cryptoini *cria, struct csession_info *);
++static int csefree(struct csession *);
++
++static int cryptodev_op(struct csession *, struct crypt_op *);
++static int cryptodev_key(struct crypt_kop *);
++static int cryptodev_find(struct crypt_find_op *);
++
++static int cryptodev_cb(void *);
++static int cryptodev_open(struct inode *inode, struct file *filp);
++
++/*
++ * Check a crypto identifier to see if it requested
++ * a valid crid and it's capabilities match.
++ */
++static int
++checkcrid(int crid)
++{
++ int hid = crid & ~(CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE);
++ int typ = crid & (CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE);
++ int caps = 0;
++
++ /* if the user hasn't selected a driver, then just call newsession */
++ if (hid == 0 && typ != 0)
++ return 0;
++
++ caps = crypto_getcaps(hid);
++
++ /* didn't find anything with capabilities */
++ if (caps == 0) {
++ dprintk("%s: hid=%x typ=%x not matched\n", __FUNCTION__, hid, typ);
++ return EINVAL;
++ }
++
++ /* the user didn't specify SW or HW, so the driver is ok */
++ if (typ == 0)
++ return 0;
++
++ /* if the type specified didn't match */
++ if (typ != (caps & (CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE))) {
++ dprintk("%s: hid=%x typ=%x caps=%x not matched\n", __FUNCTION__,
++ hid, typ, caps);
++ return EINVAL;
++ }
++
++ return 0;
++}
++
++static int
++cryptodev_op(struct csession *cse, struct crypt_op *cop)
++{
++ struct cryptop *crp = NULL;
++ struct cryptodesc *crde = NULL, *crda = NULL;
++ int error = 0;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (cop->len > CRYPTO_MAX_DATA_LEN) {
++ dprintk("%s: %d > %d\n", __FUNCTION__, cop->len, CRYPTO_MAX_DATA_LEN);
++ return (E2BIG);
++ }
++
++ if (cse->info.blocksize && (cop->len % cse->info.blocksize) != 0) {
++ dprintk("%s: blocksize=%d len=%d\n", __FUNCTION__, cse->info.blocksize,
++ cop->len);
++ return (EINVAL);
++ }
++
++ cse->uio.uio_iov = &cse->iovec;
++ cse->uio.uio_iovcnt = 1;
++ cse->uio.uio_offset = 0;
++#if 0
++ cse->uio.uio_resid = cop->len;
++ cse->uio.uio_segflg = UIO_SYSSPACE;
++ cse->uio.uio_rw = UIO_WRITE;
++ cse->uio.uio_td = td;
++#endif
++ cse->uio.uio_iov[0].iov_len = cop->len;
++ if (cse->info.authsize)
++ cse->uio.uio_iov[0].iov_len += cse->info.authsize;
++ cse->uio.uio_iov[0].iov_base = kmalloc(cse->uio.uio_iov[0].iov_len,
++ GFP_KERNEL);
++
++ if (cse->uio.uio_iov[0].iov_base == NULL) {
++ dprintk("%s: iov_base kmalloc(%d) failed\n", __FUNCTION__,
++ cse->uio.uio_iov[0].iov_len);
++ return (ENOMEM);
++ }
++
++ crp = crypto_getreq((cse->info.blocksize != 0) + (cse->info.authsize != 0));
++ if (crp == NULL) {
++ dprintk("%s: ENOMEM\n", __FUNCTION__);
++ error = ENOMEM;
++ goto bail;
++ }
++
++ if (cse->info.authsize) {
++ crda = crp->crp_desc;
++ if (cse->info.blocksize)
++ crde = crda->crd_next;
++ } else {
++ if (cse->info.blocksize)
++ crde = crp->crp_desc;
++ else {
++ dprintk("%s: bad request\n", __FUNCTION__);
++ error = EINVAL;
++ goto bail;
++ }
++ }
++
++ if ((error = copy_from_user(cse->uio.uio_iov[0].iov_base, cop->src,
++ cop->len))) {
++ dprintk("%s: bad copy\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (crda) {
++ crda->crd_skip = 0;
++ crda->crd_len = cop->len;
++ crda->crd_inject = cop->len;
++
++ crda->crd_alg = cse->mac;
++ crda->crd_key = cse->mackey;
++ crda->crd_klen = cse->mackeylen * 8;
++ }
++
++ if (crde) {
++ if (cop->op == COP_ENCRYPT)
++ crde->crd_flags |= CRD_F_ENCRYPT;
++ else
++ crde->crd_flags &= ~CRD_F_ENCRYPT;
++ crde->crd_len = cop->len;
++ crde->crd_inject = 0;
++
++ crde->crd_alg = cse->cipher;
++ crde->crd_key = cse->key;
++ crde->crd_klen = cse->keylen * 8;
++ }
++
++ crp->crp_ilen = cse->uio.uio_iov[0].iov_len;
++ crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIMM
++ | (cop->flags & COP_F_BATCH);
++ crp->crp_buf = (caddr_t)&cse->uio;
++ crp->crp_callback = (int (*) (struct cryptop *)) cryptodev_cb;
++ crp->crp_sid = cse->sid;
++ crp->crp_opaque = (void *)cse;
++
++ if (cop->iv) {
++ if (crde == NULL) {
++ error = EINVAL;
++ dprintk("%s no crde\n", __FUNCTION__);
++ goto bail;
++ }
++ if (cse->cipher == CRYPTO_ARC4) { /* XXX use flag? */
++ error = EINVAL;
++ dprintk("%s arc4 with IV\n", __FUNCTION__);
++ goto bail;
++ }
++ if ((error = copy_from_user(cse->tmp_iv, cop->iv,
++ cse->info.blocksize))) {
++ dprintk("%s bad iv copy\n", __FUNCTION__);
++ goto bail;
++ }
++ memcpy(crde->crd_iv, cse->tmp_iv, cse->info.blocksize);
++ crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT;
++ crde->crd_skip = 0;
++ } else if (cse->cipher == CRYPTO_ARC4) { /* XXX use flag? */
++ crde->crd_skip = 0;
++ } else if (crde) {
++ crde->crd_flags |= CRD_F_IV_PRESENT;
++ crde->crd_skip = cse->info.blocksize;
++ crde->crd_len -= cse->info.blocksize;
++ }
++
++ if (cop->mac && crda == NULL) {
++ error = EINVAL;
++ dprintk("%s no crda\n", __FUNCTION__);
++ goto bail;
++ }
++
++ /*
++ * Let the dispatch run unlocked, then, interlock against the
++ * callback before checking if the operation completed and going
++ * to sleep. This insures drivers don't inherit our lock which
++ * results in a lock order reversal between crypto_dispatch forced
++ * entry and the crypto_done callback into us.
++ */
++ error = crypto_dispatch(crp);
++ if (error == 0) {
++ dprintk("%s about to WAIT\n", __FUNCTION__);
++ /*
++ * we really need to wait for driver to complete to maintain
++ * state, luckily interrupts will be remembered
++ */
++ do {
++ error = wait_event_interruptible(crp->crp_waitq,
++ ((crp->crp_flags & CRYPTO_F_DONE) != 0));
++ /*
++ * we can't break out of this loop or we will leave behind
++ * a huge mess, however, staying here means if your driver
++ * is broken user applications can hang and not be killed.
++ * The solution, fix your driver :-)
++ */
++ if (error) {
++ schedule();
++ error = 0;
++ }
++ } while ((crp->crp_flags & CRYPTO_F_DONE) == 0);
++ dprintk("%s finished WAITING error=%d\n", __FUNCTION__, error);
++ }
++
++ if (crp->crp_etype != 0) {
++ error = crp->crp_etype;
++ dprintk("%s error in crp processing\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (cse->error) {
++ error = cse->error;
++ dprintk("%s error in cse processing\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (cop->dst && (error = copy_to_user(cop->dst,
++ cse->uio.uio_iov[0].iov_base, cop->len))) {
++ dprintk("%s bad dst copy\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (cop->mac &&
++ (error=copy_to_user(cop->mac,
++ (caddr_t)cse->uio.uio_iov[0].iov_base + cop->len,
++ cse->info.authsize))) {
++ dprintk("%s bad mac copy\n", __FUNCTION__);
++ goto bail;
++ }
++
++bail:
++ if (crp)
++ crypto_freereq(crp);
++ if (cse->uio.uio_iov[0].iov_base)
++ kfree(cse->uio.uio_iov[0].iov_base);
++
++ return (error);
++}
++
++static int
++cryptodev_cb(void *op)
++{
++ struct cryptop *crp = (struct cryptop *) op;
++ struct csession *cse = (struct csession *)crp->crp_opaque;
++ int error;
++
++ dprintk("%s()\n", __FUNCTION__);
++ error = crp->crp_etype;
++ if (error == EAGAIN) {
++ crp->crp_flags &= ~CRYPTO_F_DONE;
++#ifdef NOTYET
++ /*
++ * DAVIDM I am fairly sure that we should turn this into a batch
++ * request to stop bad karma/lockup, revisit
++ */
++ crp->crp_flags |= CRYPTO_F_BATCH;
++#endif
++ return crypto_dispatch(crp);
++ }
++ if (error != 0 || (crp->crp_flags & CRYPTO_F_DONE)) {
++ cse->error = error;
++ wake_up_interruptible(&crp->crp_waitq);
++ }
++ return (0);
++}
++
++static int
++cryptodevkey_cb(void *op)
++{
++ struct cryptkop *krp = (struct cryptkop *) op;
++ dprintk("%s()\n", __FUNCTION__);
++ wake_up_interruptible(&krp->krp_waitq);
++ return (0);
++}
++
++static int
++cryptodev_key(struct crypt_kop *kop)
++{
++ struct cryptkop *krp = NULL;
++ int error = EINVAL;
++ int in, out, size, i;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (kop->crk_iparams + kop->crk_oparams > CRK_MAXPARAM) {
++ dprintk("%s params too big\n", __FUNCTION__);
++ return (EFBIG);
++ }
++
++ in = kop->crk_iparams;
++ out = kop->crk_oparams;
++ switch (kop->crk_op) {
++ case CRK_MOD_EXP:
++ if (in == 3 && out == 1)
++ break;
++ return (EINVAL);
++ case CRK_MOD_EXP_CRT:
++ if (in == 6 && out == 1)
++ break;
++ return (EINVAL);
++ case CRK_DSA_SIGN:
++ if (in == 5 && out == 2)
++ break;
++ return (EINVAL);
++ case CRK_DSA_VERIFY:
++ if (in == 7 && out == 0)
++ break;
++ return (EINVAL);
++ case CRK_DH_COMPUTE_KEY:
++ if (in == 3 && out == 1)
++ break;
++ return (EINVAL);
++ default:
++ return (EINVAL);
++ }
++
++ krp = (struct cryptkop *)kmalloc(sizeof *krp, GFP_KERNEL);
++ if (!krp)
++ return (ENOMEM);
++ bzero(krp, sizeof *krp);
++ krp->krp_op = kop->crk_op;
++ krp->krp_status = kop->crk_status;
++ krp->krp_iparams = kop->crk_iparams;
++ krp->krp_oparams = kop->crk_oparams;
++ krp->krp_crid = kop->crk_crid;
++ krp->krp_status = 0;
++ krp->krp_flags = CRYPTO_KF_CBIMM;
++ krp->krp_callback = (int (*) (struct cryptkop *)) cryptodevkey_cb;
++ init_waitqueue_head(&krp->krp_waitq);
++
++ for (i = 0; i < CRK_MAXPARAM; i++)
++ krp->krp_param[i].crp_nbits = kop->crk_param[i].crp_nbits;
++ for (i = 0; i < krp->krp_iparams + krp->krp_oparams; i++) {
++ size = (krp->krp_param[i].crp_nbits + 7) / 8;
++ if (size == 0)
++ continue;
++ krp->krp_param[i].crp_p = (caddr_t) kmalloc(size, GFP_KERNEL);
++ if (i >= krp->krp_iparams)
++ continue;
++ error = copy_from_user(krp->krp_param[i].crp_p,
++ kop->crk_param[i].crp_p, size);
++ if (error)
++ goto fail;
++ }
++
++ error = crypto_kdispatch(krp);
++ if (error)
++ goto fail;
++
++ do {
++ error = wait_event_interruptible(krp->krp_waitq,
++ ((krp->krp_flags & CRYPTO_KF_DONE) != 0));
++ /*
++ * we can't break out of this loop or we will leave behind
++ * a huge mess, however, staying here means if your driver
++ * is broken user applications can hang and not be killed.
++ * The solution, fix your driver :-)
++ */
++ if (error) {
++ schedule();
++ error = 0;
++ }
++ } while ((krp->krp_flags & CRYPTO_KF_DONE) == 0);
++
++ dprintk("%s finished WAITING error=%d\n", __FUNCTION__, error);
++
++ kop->crk_crid = krp->krp_crid; /* device that did the work */
++ if (krp->krp_status != 0) {
++ error = krp->krp_status;
++ goto fail;
++ }
++
++ for (i = krp->krp_iparams; i < krp->krp_iparams + krp->krp_oparams; i++) {
++ size = (krp->krp_param[i].crp_nbits + 7) / 8;
++ if (size == 0)
++ continue;
++ error = copy_to_user(kop->crk_param[i].crp_p, krp->krp_param[i].crp_p,
++ size);
++ if (error)
++ goto fail;
++ }
++
++fail:
++ if (krp) {
++ kop->crk_status = krp->krp_status;
++ for (i = 0; i < CRK_MAXPARAM; i++) {
++ if (krp->krp_param[i].crp_p)
++ kfree(krp->krp_param[i].crp_p);
++ }
++ kfree(krp);
++ }
++ return (error);
++}
++
++static int
++cryptodev_find(struct crypt_find_op *find)
++{
++ device_t dev;
++
++ if (find->crid != -1) {
++ dev = crypto_find_device_byhid(find->crid);
++ if (dev == NULL)
++ return (ENOENT);
++ strlcpy(find->name, device_get_nameunit(dev),
++ sizeof(find->name));
++ } else {
++ find->crid = crypto_find_driver(find->name);
++ if (find->crid == -1)
++ return (ENOENT);
++ }
++ return (0);
++}
++
++static struct csession *
++csefind(struct fcrypt *fcr, u_int ses)
++{
++ struct csession *cse;
++
++ dprintk("%s()\n", __FUNCTION__);
++ list_for_each_entry(cse, &fcr->csessions, list)
++ if (cse->ses == ses)
++ return (cse);
++ return (NULL);
++}
++
++static int
++csedelete(struct fcrypt *fcr, struct csession *cse_del)
++{
++ struct csession *cse;
++
++ dprintk("%s()\n", __FUNCTION__);
++ list_for_each_entry(cse, &fcr->csessions, list) {
++ if (cse == cse_del) {
++ list_del(&cse->list);
++ return (1);
++ }
++ }
++ return (0);
++}
++
++static struct csession *
++cseadd(struct fcrypt *fcr, struct csession *cse)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ list_add_tail(&cse->list, &fcr->csessions);
++ cse->ses = fcr->sesn++;
++ return (cse);
++}
++
++static struct csession *
++csecreate(struct fcrypt *fcr, u_int64_t sid, struct cryptoini *crie,
++ struct cryptoini *cria, struct csession_info *info)
++{
++ struct csession *cse;
++
++ dprintk("%s()\n", __FUNCTION__);
++ cse = (struct csession *) kmalloc(sizeof(struct csession), GFP_KERNEL);
++ if (cse == NULL)
++ return NULL;
++ memset(cse, 0, sizeof(struct csession));
++
++ INIT_LIST_HEAD(&cse->list);
++ init_waitqueue_head(&cse->waitq);
++
++ cse->key = crie->cri_key;
++ cse->keylen = crie->cri_klen/8;
++ cse->mackey = cria->cri_key;
++ cse->mackeylen = cria->cri_klen/8;
++ cse->sid = sid;
++ cse->cipher = crie->cri_alg;
++ cse->mac = cria->cri_alg;
++ cse->info = *info;
++ cseadd(fcr, cse);
++ return (cse);
++}
++
++static int
++csefree(struct csession *cse)
++{
++ int error;
++
++ dprintk("%s()\n", __FUNCTION__);
++ error = crypto_freesession(cse->sid);
++ if (cse->key)
++ kfree(cse->key);
++ if (cse->mackey)
++ kfree(cse->mackey);
++ kfree(cse);
++ return(error);
++}
++
++static int
++cryptodev_ioctl(
++ struct inode *inode,
++ struct file *filp,
++ unsigned int cmd,
++ unsigned long arg)
++{
++ struct cryptoini cria, crie;
++ struct fcrypt *fcr = filp->private_data;
++ struct csession *cse;
++ struct csession_info info;
++ struct session2_op sop;
++ struct crypt_op cop;
++ struct crypt_kop kop;
++ struct crypt_find_op fop;
++ u_int64_t sid;
++ u_int32_t ses;
++ int feat, fd, error = 0, crid;
++ mm_segment_t fs;
++
++ dprintk("%s(cmd=%x arg=%lx)\n", __FUNCTION__, cmd, arg);
++
++ switch (cmd) {
++
++ case CRIOGET: {
++ dprintk("%s(CRIOGET)\n", __FUNCTION__);
++ fs = get_fs();
++ set_fs(get_ds());
++ for (fd = 0; fd < files_fdtable(current->files)->max_fds; fd++)
++ if (files_fdtable(current->files)->fd[fd] == filp)
++ break;
++ fd = sys_dup(fd);
++ set_fs(fs);
++ put_user(fd, (int *) arg);
++ return IS_ERR_VALUE(fd) ? fd : 0;
++ }
++
++#define CIOCGSESSSTR (cmd == CIOCGSESSION ? "CIOCGSESSION" : "CIOCGSESSION2")
++ case CIOCGSESSION:
++ case CIOCGSESSION2:
++ dprintk("%s(%s)\n", __FUNCTION__, CIOCGSESSSTR);
++ memset(&crie, 0, sizeof(crie));
++ memset(&cria, 0, sizeof(cria));
++ memset(&info, 0, sizeof(info));
++ memset(&sop, 0, sizeof(sop));
++
++ if (copy_from_user(&sop, (void*)arg, (cmd == CIOCGSESSION) ?
++ sizeof(struct session_op) : sizeof(sop))) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ goto bail;
++ }
++
++ switch (sop.cipher) {
++ case 0:
++ dprintk("%s(%s) - no cipher\n", __FUNCTION__, CIOCGSESSSTR);
++ break;
++ case CRYPTO_NULL_CBC:
++ info.blocksize = NULL_BLOCK_LEN;
++ info.minkey = NULL_MIN_KEY_LEN;
++ info.maxkey = NULL_MAX_KEY_LEN;
++ break;
++ case CRYPTO_DES_CBC:
++ info.blocksize = DES_BLOCK_LEN;
++ info.minkey = DES_MIN_KEY_LEN;
++ info.maxkey = DES_MAX_KEY_LEN;
++ break;
++ case CRYPTO_3DES_CBC:
++ info.blocksize = DES3_BLOCK_LEN;
++ info.minkey = DES3_MIN_KEY_LEN;
++ info.maxkey = DES3_MAX_KEY_LEN;
++ break;
++ case CRYPTO_BLF_CBC:
++ info.blocksize = BLOWFISH_BLOCK_LEN;
++ info.minkey = BLOWFISH_MIN_KEY_LEN;
++ info.maxkey = BLOWFISH_MAX_KEY_LEN;
++ break;
++ case CRYPTO_CAST_CBC:
++ info.blocksize = CAST128_BLOCK_LEN;
++ info.minkey = CAST128_MIN_KEY_LEN;
++ info.maxkey = CAST128_MAX_KEY_LEN;
++ break;
++ case CRYPTO_SKIPJACK_CBC:
++ info.blocksize = SKIPJACK_BLOCK_LEN;
++ info.minkey = SKIPJACK_MIN_KEY_LEN;
++ info.maxkey = SKIPJACK_MAX_KEY_LEN;
++ break;
++ case CRYPTO_AES_CBC:
++ info.blocksize = AES_BLOCK_LEN;
++ info.minkey = AES_MIN_KEY_LEN;
++ info.maxkey = AES_MAX_KEY_LEN;
++ break;
++ case CRYPTO_ARC4:
++ info.blocksize = ARC4_BLOCK_LEN;
++ info.minkey = ARC4_MIN_KEY_LEN;
++ info.maxkey = ARC4_MAX_KEY_LEN;
++ break;
++ case CRYPTO_CAMELLIA_CBC:
++ info.blocksize = CAMELLIA_BLOCK_LEN;
++ info.minkey = CAMELLIA_MIN_KEY_LEN;
++ info.maxkey = CAMELLIA_MAX_KEY_LEN;
++ break;
++ default:
++ dprintk("%s(%s) - bad cipher\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EINVAL;
++ goto bail;
++ }
++
++ switch (sop.mac) {
++ case 0:
++ dprintk("%s(%s) - no mac\n", __FUNCTION__, CIOCGSESSSTR);
++ break;
++ case CRYPTO_NULL_HMAC:
++ info.authsize = NULL_HASH_LEN;
++ break;
++ case CRYPTO_MD5:
++ info.authsize = MD5_HASH_LEN;
++ break;
++ case CRYPTO_SHA1:
++ info.authsize = SHA1_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_256:
++ info.authsize = SHA2_256_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_384:
++ info.authsize = SHA2_384_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_512:
++ info.authsize = SHA2_512_HASH_LEN;
++ break;
++ case CRYPTO_RIPEMD160:
++ info.authsize = RIPEMD160_HASH_LEN;
++ break;
++ case CRYPTO_MD5_HMAC:
++ info.authsize = MD5_HASH_LEN;
++ break;
++ case CRYPTO_SHA1_HMAC:
++ info.authsize = SHA1_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_256_HMAC:
++ info.authsize = SHA2_256_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_384_HMAC:
++ info.authsize = SHA2_384_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_512_HMAC:
++ info.authsize = SHA2_512_HASH_LEN;
++ break;
++ case CRYPTO_RIPEMD160_HMAC:
++ info.authsize = RIPEMD160_HASH_LEN;
++ break;
++ default:
++ dprintk("%s(%s) - bad mac\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EINVAL;
++ goto bail;
++ }
++
++ if (info.blocksize) {
++ crie.cri_alg = sop.cipher;
++ crie.cri_klen = sop.keylen * 8;
++ if ((info.maxkey && sop.keylen > info.maxkey) ||
++ sop.keylen < info.minkey) {
++ dprintk("%s(%s) - bad key\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EINVAL;
++ goto bail;
++ }
++
++ crie.cri_key = (u_int8_t *) kmalloc(crie.cri_klen/8+1, GFP_KERNEL);
++ if (copy_from_user(crie.cri_key, sop.key,
++ crie.cri_klen/8)) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ goto bail;
++ }
++ if (info.authsize)
++ crie.cri_next = &cria;
++ }
++
++ if (info.authsize) {
++ cria.cri_alg = sop.mac;
++ cria.cri_klen = sop.mackeylen * 8;
++ if ((info.maxkey && sop.mackeylen > info.maxkey) ||
++ sop.keylen < info.minkey) {
++ dprintk("%s(%s) - mackeylen %d\n", __FUNCTION__, CIOCGSESSSTR,
++ sop.mackeylen);
++ error = EINVAL;
++ goto bail;
++ }
++
++ if (cria.cri_klen) {
++ cria.cri_key = (u_int8_t *) kmalloc(cria.cri_klen/8,GFP_KERNEL);
++ if (copy_from_user(cria.cri_key, sop.mackey,
++ cria.cri_klen / 8)) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ goto bail;
++ }
++ }
++ }
++
++ /* NB: CIOGSESSION2 has the crid */
++ if (cmd == CIOCGSESSION2) {
++ crid = sop.crid;
++ error = checkcrid(crid);
++ if (error) {
++ dprintk("%s(%s) - checkcrid %x\n", __FUNCTION__,
++ CIOCGSESSSTR, error);
++ goto bail;
++ }
++ } else {
++ /* allow either HW or SW to be used */
++ crid = CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE;
++ }
++ error = crypto_newsession(&sid, (info.blocksize ? &crie : &cria), crid);
++ if (error) {
++ dprintk("%s(%s) - newsession %d\n",__FUNCTION__,CIOCGSESSSTR,error);
++ goto bail;
++ }
++
++ cse = csecreate(fcr, sid, &crie, &cria, &info);
++ if (cse == NULL) {
++ crypto_freesession(sid);
++ error = EINVAL;
++ dprintk("%s(%s) - csecreate failed\n", __FUNCTION__, CIOCGSESSSTR);
++ goto bail;
++ }
++ sop.ses = cse->ses;
++
++ if (cmd == CIOCGSESSION2) {
++ /* return hardware/driver id */
++ sop.crid = CRYPTO_SESID2HID(cse->sid);
++ }
++
++ if (copy_to_user((void*)arg, &sop, (cmd == CIOCGSESSION) ?
++ sizeof(struct session_op) : sizeof(sop))) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ }
++bail:
++ if (error) {
++ dprintk("%s(%s) - bail %d\n", __FUNCTION__, CIOCGSESSSTR, error);
++ if (crie.cri_key)
++ kfree(crie.cri_key);
++ if (cria.cri_key)
++ kfree(cria.cri_key);
++ }
++ break;
++ case CIOCFSESSION:
++ dprintk("%s(CIOCFSESSION)\n", __FUNCTION__);
++ get_user(ses, (uint32_t*)arg);
++ cse = csefind(fcr, ses);
++ if (cse == NULL) {
++ error = EINVAL;
++ dprintk("%s(CIOCFSESSION) - Fail %d\n", __FUNCTION__, error);
++ break;
++ }
++ csedelete(fcr, cse);
++ error = csefree(cse);
++ break;
++ case CIOCCRYPT:
++ dprintk("%s(CIOCCRYPT)\n", __FUNCTION__);
++ if(copy_from_user(&cop, (void*)arg, sizeof(cop))) {
++ dprintk("%s(CIOCCRYPT) - bad copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ cse = csefind(fcr, cop.ses);
++ if (cse == NULL) {
++ error = EINVAL;
++ dprintk("%s(CIOCCRYPT) - Fail %d\n", __FUNCTION__, error);
++ break;
++ }
++ error = cryptodev_op(cse, &cop);
++ if(copy_to_user((void*)arg, &cop, sizeof(cop))) {
++ dprintk("%s(CIOCCRYPT) - bad return copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ break;
++ case CIOCKEY:
++ case CIOCKEY2:
++ dprintk("%s(CIOCKEY)\n", __FUNCTION__);
++ if (!crypto_userasymcrypto)
++ return (EPERM); /* XXX compat? */
++ if(copy_from_user(&kop, (void*)arg, sizeof(kop))) {
++ dprintk("%s(CIOCKEY) - bad copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ if (cmd == CIOCKEY) {
++ /* NB: crypto core enforces s/w driver use */
++ kop.crk_crid =
++ CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE;
++ }
++ error = cryptodev_key(&kop);
++ if(copy_to_user((void*)arg, &kop, sizeof(kop))) {
++ dprintk("%s(CIOCGKEY) - bad return copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ break;
++ case CIOCASYMFEAT:
++ dprintk("%s(CIOCASYMFEAT)\n", __FUNCTION__);
++ if (!crypto_userasymcrypto) {
++ /*
++ * NB: if user asym crypto operations are
++ * not permitted return "no algorithms"
++ * so well-behaved applications will just
++ * fallback to doing them in software.
++ */
++ feat = 0;
++ } else
++ error = crypto_getfeat(&feat);
++ if (!error) {
++ error = copy_to_user((void*)arg, &feat, sizeof(feat));
++ }
++ break;
++ case CIOCFINDDEV:
++ if (copy_from_user(&fop, (void*)arg, sizeof(fop))) {
++ dprintk("%s(CIOCFINDDEV) - bad copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ error = cryptodev_find(&fop);
++ if (copy_to_user((void*)arg, &fop, sizeof(fop))) {
++ dprintk("%s(CIOCFINDDEV) - bad return copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ break;
++ default:
++ dprintk("%s(unknown ioctl 0x%x)\n", __FUNCTION__, cmd);
++ error = EINVAL;
++ break;
++ }
++ return(-error);
++}
++
++#ifdef HAVE_UNLOCKED_IOCTL
++static long
++cryptodev_unlocked_ioctl(
++ struct file *filp,
++ unsigned int cmd,
++ unsigned long arg)
++{
++ return cryptodev_ioctl(NULL, filp, cmd, arg);
++}
++#endif
++
++static int
++cryptodev_open(struct inode *inode, struct file *filp)
++{
++ struct fcrypt *fcr;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (filp->private_data) {
++ printk("cryptodev: Private data already exists !\n");
++ return(0);
++ }
++
++ fcr = kmalloc(sizeof(*fcr), GFP_KERNEL);
++ if (!fcr) {
++ dprintk("%s() - malloc failed\n", __FUNCTION__);
++ return(-ENOMEM);
++ }
++ memset(fcr, 0, sizeof(*fcr));
++
++ INIT_LIST_HEAD(&fcr->csessions);
++ filp->private_data = fcr;
++ return(0);
++}
++
++static int
++cryptodev_release(struct inode *inode, struct file *filp)
++{
++ struct fcrypt *fcr = filp->private_data;
++ struct csession *cse, *tmp;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (!filp) {
++ printk("cryptodev: No private data on release\n");
++ return(0);
++ }
++
++ list_for_each_entry_safe(cse, tmp, &fcr->csessions, list) {
++ list_del(&cse->list);
++ (void)csefree(cse);
++ }
++ filp->private_data = NULL;
++ kfree(fcr);
++ return(0);
++}
++
++static struct file_operations cryptodev_fops = {
++ .owner = THIS_MODULE,
++ .open = cryptodev_open,
++ .release = cryptodev_release,
++ .ioctl = cryptodev_ioctl,
++#ifdef HAVE_UNLOCKED_IOCTL
++ .unlocked_ioctl = cryptodev_unlocked_ioctl,
++#endif
++};
++
++static struct miscdevice cryptodev = {
++ .minor = CRYPTODEV_MINOR,
++ .name = "crypto",
++ .fops = &cryptodev_fops,
++};
++
++static int __init
++cryptodev_init(void)
++{
++ int rc;
++
++ dprintk("%s(%p)\n", __FUNCTION__, cryptodev_init);
++ rc = misc_register(&cryptodev);
++ if (rc) {
++ printk(KERN_ERR "cryptodev: registration of /dev/crypto failed\n");
++ return(rc);
++ }
++
++ return(0);
++}
++
++static void __exit
++cryptodev_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ misc_deregister(&cryptodev);
++}
++
++module_init(cryptodev_init);
++module_exit(cryptodev_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("Cryptodev (user interface to OCF)");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/cryptodev.h linux-2.6.27.10/crypto/ocf/cryptodev.h
+--- linux-2.6.27.10.orig/crypto/ocf/cryptodev.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/cryptodev.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,478 @@
++/* $FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.25 2007/05/09 19:37:02 gnn Exp $ */
++/* $OpenBSD: cryptodev.h,v 1.31 2002/06/11 11:14:29 beck Exp $ */
++
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
++ * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
++ *
++ * This code was written by Angelos D. Keromytis in Athens, Greece, in
++ * February 2000. Network Security Technologies Inc. (NSTI) kindly
++ * supported the development of this code.
++ *
++ * Copyright (c) 2000 Angelos D. Keromytis
++ *
++ * Permission to use, copy, and modify this software with or without fee
++ * is hereby granted, provided that this entire notice is included in
++ * all source code copies of any software which is or includes a copy or
++ * modification of this software.
++ *
++ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
++ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
++ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
++ * PURPOSE.
++ *
++ * Copyright (c) 2001 Theo de Raadt
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ */
++
++#ifndef _CRYPTO_CRYPTO_H_
++#define _CRYPTO_CRYPTO_H_
++
++/* Some initial values */
++#define CRYPTO_DRIVERS_INITIAL 4
++#define CRYPTO_SW_SESSIONS 32
++
++/* Hash values */
++#define NULL_HASH_LEN 0
++#define MD5_HASH_LEN 16
++#define SHA1_HASH_LEN 20
++#define RIPEMD160_HASH_LEN 20
++#define SHA2_256_HASH_LEN 32
++#define SHA2_384_HASH_LEN 48
++#define SHA2_512_HASH_LEN 64
++#define MD5_KPDK_HASH_LEN 16
++#define SHA1_KPDK_HASH_LEN 20
++/* Maximum hash algorithm result length */
++#define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */
++
++/* HMAC values */
++#define NULL_HMAC_BLOCK_LEN 1
++#define MD5_HMAC_BLOCK_LEN 64
++#define SHA1_HMAC_BLOCK_LEN 64
++#define RIPEMD160_HMAC_BLOCK_LEN 64
++#define SHA2_256_HMAC_BLOCK_LEN 64
++#define SHA2_384_HMAC_BLOCK_LEN 128
++#define SHA2_512_HMAC_BLOCK_LEN 128
++/* Maximum HMAC block length */
++#define HMAC_MAX_BLOCK_LEN SHA2_512_HMAC_BLOCK_LEN /* Keep this updated */
++#define HMAC_IPAD_VAL 0x36
++#define HMAC_OPAD_VAL 0x5C
++
++/* Encryption algorithm block sizes */
++#define NULL_BLOCK_LEN 1
++#define DES_BLOCK_LEN 8
++#define DES3_BLOCK_LEN 8
++#define BLOWFISH_BLOCK_LEN 8
++#define SKIPJACK_BLOCK_LEN 8
++#define CAST128_BLOCK_LEN 8
++#define RIJNDAEL128_BLOCK_LEN 16
++#define AES_BLOCK_LEN RIJNDAEL128_BLOCK_LEN
++#define CAMELLIA_BLOCK_LEN 16
++#define ARC4_BLOCK_LEN 1
++#define EALG_MAX_BLOCK_LEN AES_BLOCK_LEN /* Keep this updated */
++
++/* Encryption algorithm min and max key sizes */
++#define NULL_MIN_KEY_LEN 0
++#define NULL_MAX_KEY_LEN 0
++#define DES_MIN_KEY_LEN 8
++#define DES_MAX_KEY_LEN 8
++#define DES3_MIN_KEY_LEN 24
++#define DES3_MAX_KEY_LEN 24
++#define BLOWFISH_MIN_KEY_LEN 4
++#define BLOWFISH_MAX_KEY_LEN 56
++#define SKIPJACK_MIN_KEY_LEN 10
++#define SKIPJACK_MAX_KEY_LEN 10
++#define CAST128_MIN_KEY_LEN 5
++#define CAST128_MAX_KEY_LEN 16
++#define RIJNDAEL128_MIN_KEY_LEN 16
++#define RIJNDAEL128_MAX_KEY_LEN 32
++#define AES_MIN_KEY_LEN RIJNDAEL128_MIN_KEY_LEN
++#define AES_MAX_KEY_LEN RIJNDAEL128_MAX_KEY_LEN
++#define CAMELLIA_MIN_KEY_LEN 16
++#define CAMELLIA_MAX_KEY_LEN 32
++#define ARC4_MIN_KEY_LEN 1
++#define ARC4_MAX_KEY_LEN 256
++
++/* Max size of data that can be processed */
++#define CRYPTO_MAX_DATA_LEN 64*1024 - 1
++
++#define CRYPTO_ALGORITHM_MIN 1
++#define CRYPTO_DES_CBC 1
++#define CRYPTO_3DES_CBC 2
++#define CRYPTO_BLF_CBC 3
++#define CRYPTO_CAST_CBC 4
++#define CRYPTO_SKIPJACK_CBC 5
++#define CRYPTO_MD5_HMAC 6
++#define CRYPTO_SHA1_HMAC 7
++#define CRYPTO_RIPEMD160_HMAC 8
++#define CRYPTO_MD5_KPDK 9
++#define CRYPTO_SHA1_KPDK 10
++#define CRYPTO_RIJNDAEL128_CBC 11 /* 128 bit blocksize */
++#define CRYPTO_AES_CBC 11 /* 128 bit blocksize -- the same as above */
++#define CRYPTO_ARC4 12
++#define CRYPTO_MD5 13
++#define CRYPTO_SHA1 14
++#define CRYPTO_NULL_HMAC 15
++#define CRYPTO_NULL_CBC 16
++#define CRYPTO_DEFLATE_COMP 17 /* Deflate compression algorithm */
++#define CRYPTO_SHA2_256_HMAC 18
++#define CRYPTO_SHA2_384_HMAC 19
++#define CRYPTO_SHA2_512_HMAC 20
++#define CRYPTO_CAMELLIA_CBC 21
++#define CRYPTO_SHA2_256 22
++#define CRYPTO_SHA2_384 23
++#define CRYPTO_SHA2_512 24
++#define CRYPTO_RIPEMD160 25
++#define CRYPTO_ALGORITHM_MAX 25 /* Keep updated - see below */
++
++/* Algorithm flags */
++#define CRYPTO_ALG_FLAG_SUPPORTED 0x01 /* Algorithm is supported */
++#define CRYPTO_ALG_FLAG_RNG_ENABLE 0x02 /* Has HW RNG for DH/DSA */
++#define CRYPTO_ALG_FLAG_DSA_SHA 0x04 /* Can do SHA on msg */
++
++/*
++ * Crypto driver/device flags. They can set in the crid
++ * parameter when creating a session or submitting a key
++ * op to affect the device/driver assigned. If neither
++ * of these are specified then the crid is assumed to hold
++ * the driver id of an existing (and suitable) device that
++ * must be used to satisfy the request.
++ */
++#define CRYPTO_FLAG_HARDWARE 0x01000000 /* hardware accelerated */
++#define CRYPTO_FLAG_SOFTWARE 0x02000000 /* software implementation */
++
++/* NB: deprecated */
++struct session_op {
++ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
++ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
++
++ u_int32_t keylen; /* cipher key */
++ caddr_t key;
++ int mackeylen; /* mac key */
++ caddr_t mackey;
++
++ u_int32_t ses; /* returns: session # */
++};
++
++struct session2_op {
++ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
++ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
++
++ u_int32_t keylen; /* cipher key */
++ caddr_t key;
++ int mackeylen; /* mac key */
++ caddr_t mackey;
++
++ u_int32_t ses; /* returns: session # */
++ int crid; /* driver id + flags (rw) */
++ int pad[4]; /* for future expansion */
++};
++
++struct crypt_op {
++ u_int32_t ses;
++ u_int16_t op; /* i.e. COP_ENCRYPT */
++#define COP_NONE 0
++#define COP_ENCRYPT 1
++#define COP_DECRYPT 2
++ u_int16_t flags;
++#define COP_F_BATCH 0x0008 /* Batch op if possible */
++ u_int len;
++ caddr_t src, dst; /* become iov[] inside kernel */
++ caddr_t mac; /* must be big enough for chosen MAC */
++ caddr_t iv;
++};
++
++/*
++ * Parameters for looking up a crypto driver/device by
++ * device name or by id. The latter are returned for
++ * created sessions (crid) and completed key operations.
++ */
++struct crypt_find_op {
++ int crid; /* driver id + flags */
++ char name[32]; /* device/driver name */
++};
++
++/* bignum parameter, in packed bytes, ... */
++struct crparam {
++ caddr_t crp_p;
++ u_int crp_nbits;
++};
++
++#define CRK_MAXPARAM 8
++
++struct crypt_kop {
++ u_int crk_op; /* ie. CRK_MOD_EXP or other */
++ u_int crk_status; /* return status */
++ u_short crk_iparams; /* # of input parameters */
++ u_short crk_oparams; /* # of output parameters */
++ u_int crk_crid; /* NB: only used by CIOCKEY2 (rw) */
++ struct crparam crk_param[CRK_MAXPARAM];
++};
++#define CRK_ALGORITM_MIN 0
++#define CRK_MOD_EXP 0
++#define CRK_MOD_EXP_CRT 1
++#define CRK_DSA_SIGN 2
++#define CRK_DSA_VERIFY 3
++#define CRK_DH_COMPUTE_KEY 4
++#define CRK_ALGORITHM_MAX 4 /* Keep updated - see below */
++
++#define CRF_MOD_EXP (1 << CRK_MOD_EXP)
++#define CRF_MOD_EXP_CRT (1 << CRK_MOD_EXP_CRT)
++#define CRF_DSA_SIGN (1 << CRK_DSA_SIGN)
++#define CRF_DSA_VERIFY (1 << CRK_DSA_VERIFY)
++#define CRF_DH_COMPUTE_KEY (1 << CRK_DH_COMPUTE_KEY)
++
++/*
++ * done against open of /dev/crypto, to get a cloned descriptor.
++ * Please use F_SETFD against the cloned descriptor.
++ */
++#define CRIOGET _IOWR('c', 100, u_int32_t)
++#define CRIOASYMFEAT CIOCASYMFEAT
++#define CRIOFINDDEV CIOCFINDDEV
++
++/* the following are done against the cloned descriptor */
++#define CIOCGSESSION _IOWR('c', 101, struct session_op)
++#define CIOCFSESSION _IOW('c', 102, u_int32_t)
++#define CIOCCRYPT _IOWR('c', 103, struct crypt_op)
++#define CIOCKEY _IOWR('c', 104, struct crypt_kop)
++#define CIOCASYMFEAT _IOR('c', 105, u_int32_t)
++#define CIOCGSESSION2 _IOWR('c', 106, struct session2_op)
++#define CIOCKEY2 _IOWR('c', 107, struct crypt_kop)
++#define CIOCFINDDEV _IOWR('c', 108, struct crypt_find_op)
++
++struct cryptotstat {
++ struct timespec acc; /* total accumulated time */
++ struct timespec min; /* min time */
++ struct timespec max; /* max time */
++ u_int32_t count; /* number of observations */
++};
++
++struct cryptostats {
++ u_int32_t cs_ops; /* symmetric crypto ops submitted */
++ u_int32_t cs_errs; /* symmetric crypto ops that failed */
++ u_int32_t cs_kops; /* asymetric/key ops submitted */
++ u_int32_t cs_kerrs; /* asymetric/key ops that failed */
++ u_int32_t cs_intrs; /* crypto swi thread activations */
++ u_int32_t cs_rets; /* crypto return thread activations */
++ u_int32_t cs_blocks; /* symmetric op driver block */
++ u_int32_t cs_kblocks; /* symmetric op driver block */
++ /*
++ * When CRYPTO_TIMING is defined at compile time and the
++ * sysctl debug.crypto is set to 1, the crypto system will
++ * accumulate statistics about how long it takes to process
++ * crypto requests at various points during processing.
++ */
++ struct cryptotstat cs_invoke; /* crypto_dipsatch -> crypto_invoke */
++ struct cryptotstat cs_done; /* crypto_invoke -> crypto_done */
++ struct cryptotstat cs_cb; /* crypto_done -> callback */
++ struct cryptotstat cs_finis; /* callback -> callback return */
++
++ u_int32_t cs_drops; /* crypto ops dropped due to congestion */
++};
++
++#ifdef __KERNEL__
++
++/* Standard initialization structure beginning */
++struct cryptoini {
++ int cri_alg; /* Algorithm to use */
++ int cri_klen; /* Key length, in bits */
++ int cri_mlen; /* Number of bytes we want from the
++ entire hash. 0 means all. */
++ caddr_t cri_key; /* key to use */
++ u_int8_t cri_iv[EALG_MAX_BLOCK_LEN]; /* IV to use */
++ struct cryptoini *cri_next;
++};
++
++/* Describe boundaries of a single crypto operation */
++struct cryptodesc {
++ int crd_skip; /* How many bytes to ignore from start */
++ int crd_len; /* How many bytes to process */
++ int crd_inject; /* Where to inject results, if applicable */
++ int crd_flags;
++
++#define CRD_F_ENCRYPT 0x01 /* Set when doing encryption */
++#define CRD_F_IV_PRESENT 0x02 /* When encrypting, IV is already in
++ place, so don't copy. */
++#define CRD_F_IV_EXPLICIT 0x04 /* IV explicitly provided */
++#define CRD_F_DSA_SHA_NEEDED 0x08 /* Compute SHA-1 of buffer for DSA */
++#define CRD_F_KEY_EXPLICIT 0x10 /* Key explicitly provided */
++#define CRD_F_COMP 0x0f /* Set when doing compression */
++
++ struct cryptoini CRD_INI; /* Initialization/context data */
++#define crd_iv CRD_INI.cri_iv
++#define crd_key CRD_INI.cri_key
++#define crd_alg CRD_INI.cri_alg
++#define crd_klen CRD_INI.cri_klen
++
++ struct cryptodesc *crd_next;
++};
++
++/* Structure describing complete operation */
++struct cryptop {
++ struct list_head crp_next;
++ wait_queue_head_t crp_waitq;
++
++ u_int64_t crp_sid; /* Session ID */
++ int crp_ilen; /* Input data total length */
++ int crp_olen; /* Result total length */
++
++ int crp_etype; /*
++ * Error type (zero means no error).
++ * All error codes except EAGAIN
++ * indicate possible data corruption (as in,
++ * the data have been touched). On all
++ * errors, the crp_sid may have changed
++ * (reset to a new one), so the caller
++ * should always check and use the new
++ * value on future requests.
++ */
++ int crp_flags;
++
++#define CRYPTO_F_SKBUF 0x0001 /* Input/output are skbuf chains */
++#define CRYPTO_F_IOV 0x0002 /* Input/output are uio */
++#define CRYPTO_F_REL 0x0004 /* Must return data in same place */
++#define CRYPTO_F_BATCH 0x0008 /* Batch op if possible */
++#define CRYPTO_F_CBIMM 0x0010 /* Do callback immediately */
++#define CRYPTO_F_DONE 0x0020 /* Operation completed */
++#define CRYPTO_F_CBIFSYNC 0x0040 /* Do CBIMM if op is synchronous */
++
++ caddr_t crp_buf; /* Data to be processed */
++ caddr_t crp_opaque; /* Opaque pointer, passed along */
++ struct cryptodesc *crp_desc; /* Linked list of processing descriptors */
++
++ int (*crp_callback)(struct cryptop *); /* Callback function */
++};
++
++#define CRYPTO_BUF_CONTIG 0x0
++#define CRYPTO_BUF_IOV 0x1
++#define CRYPTO_BUF_SKBUF 0x2
++
++#define CRYPTO_OP_DECRYPT 0x0
++#define CRYPTO_OP_ENCRYPT 0x1
++
++/*
++ * Hints passed to process methods.
++ */
++#define CRYPTO_HINT_MORE 0x1 /* more ops coming shortly */
++
++struct cryptkop {
++ struct list_head krp_next;
++ wait_queue_head_t krp_waitq;
++
++ int krp_flags;
++#define CRYPTO_KF_DONE 0x0001 /* Operation completed */
++#define CRYPTO_KF_CBIMM 0x0002 /* Do callback immediately */
++
++ u_int krp_op; /* ie. CRK_MOD_EXP or other */
++ u_int krp_status; /* return status */
++ u_short krp_iparams; /* # of input parameters */
++ u_short krp_oparams; /* # of output parameters */
++ u_int krp_crid; /* desired device, etc. */
++ u_int32_t krp_hid;
++ struct crparam krp_param[CRK_MAXPARAM]; /* kvm */
++ int (*krp_callback)(struct cryptkop *);
++};
++
++#include <ocf-compat.h>
++
++/*
++ * Session ids are 64 bits. The lower 32 bits contain a "local id" which
++ * is a driver-private session identifier. The upper 32 bits contain a
++ * "hardware id" used by the core crypto code to identify the driver and
++ * a copy of the driver's capabilities that can be used by client code to
++ * optimize operation.
++ */
++#define CRYPTO_SESID2HID(_sid) (((_sid) >> 32) & 0x00ffffff)
++#define CRYPTO_SESID2CAPS(_sid) (((_sid) >> 32) & 0xff000000)
++#define CRYPTO_SESID2LID(_sid) (((u_int32_t) (_sid)) & 0xffffffff)
++
++extern int crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard);
++extern int crypto_freesession(u_int64_t sid);
++#define CRYPTOCAP_F_HARDWARE CRYPTO_FLAG_HARDWARE
++#define CRYPTOCAP_F_SOFTWARE CRYPTO_FLAG_SOFTWARE
++#define CRYPTOCAP_F_SYNC 0x04000000 /* operates synchronously */
++extern int32_t crypto_get_driverid(device_t dev, int flags);
++extern int crypto_find_driver(const char *);
++extern device_t crypto_find_device_byhid(int hid);
++extern int crypto_getcaps(int hid);
++extern int crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen,
++ u_int32_t flags);
++extern int crypto_kregister(u_int32_t, int, u_int32_t);
++extern int crypto_unregister(u_int32_t driverid, int alg);
++extern int crypto_unregister_all(u_int32_t driverid);
++extern int crypto_dispatch(struct cryptop *crp);
++extern int crypto_kdispatch(struct cryptkop *);
++#define CRYPTO_SYMQ 0x1
++#define CRYPTO_ASYMQ 0x2
++extern int crypto_unblock(u_int32_t, int);
++extern void crypto_done(struct cryptop *crp);
++extern void crypto_kdone(struct cryptkop *);
++extern int crypto_getfeat(int *);
++
++extern void crypto_freereq(struct cryptop *crp);
++extern struct cryptop *crypto_getreq(int num);
++
++extern int crypto_usercrypto; /* userland may do crypto requests */
++extern int crypto_userasymcrypto; /* userland may do asym crypto reqs */
++extern int crypto_devallowsoft; /* only use hardware crypto */
++
++/*
++ * random number support, crypto_unregister_all will unregister
++ */
++extern int crypto_rregister(u_int32_t driverid,
++ int (*read_random)(void *arg, u_int32_t *buf, int len), void *arg);
++extern int crypto_runregister_all(u_int32_t driverid);
++
++/*
++ * Crypto-related utility routines used mainly by drivers.
++ *
++ * XXX these don't really belong here; but for now they're
++ * kept apart from the rest of the system.
++ */
++struct uio;
++extern void cuio_copydata(struct uio* uio, int off, int len, caddr_t cp);
++extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp);
++extern struct iovec *cuio_getptr(struct uio *uio, int loc, int *off);
++
++extern void crypto_copyback(int flags, caddr_t buf, int off, int size,
++ caddr_t in);
++extern void crypto_copydata(int flags, caddr_t buf, int off, int size,
++ caddr_t out);
++extern int crypto_apply(int flags, caddr_t buf, int off, int len,
++ int (*f)(void *, void *, u_int), void *arg);
++
++#endif /* __KERNEL__ */
++#endif /* _CRYPTO_CRYPTO_H_ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/cryptosoft.c linux-2.6.27.10/crypto/ocf/cryptosoft.c
+--- linux-2.6.27.10.orig/crypto/ocf/cryptosoft.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/cryptosoft.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,898 @@
++/*
++ * An OCF module that uses the linux kernel cryptoapi, based on the
++ * original cryptosoft for BSD by Angelos D. Keromytis (angelos@cis.upenn.edu)
++ * but is mostly unrecognisable,
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2004-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ * ---------------------------------------------------------------------------
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/sched.h>
++#include <linux/wait.h>
++#include <linux/crypto.h>
++#include <linux/mm.h>
++#include <linux/skbuff.h>
++#include <linux/random.h>
++#include <linux/scatterlist.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++struct {
++ softc_device_decl sc_dev;
++} swcr_softc;
++
++#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
++
++/* Software session entry */
++
++#define SW_TYPE_CIPHER 0
++#define SW_TYPE_HMAC 1
++#define SW_TYPE_AUTH2 2
++#define SW_TYPE_HASH 3
++#define SW_TYPE_COMP 4
++#define SW_TYPE_BLKCIPHER 5
++
++struct swcr_data {
++ int sw_type;
++ int sw_alg;
++ struct crypto_tfm *sw_tfm;
++ union {
++ struct {
++ char *sw_key;
++ int sw_klen;
++ int sw_mlen;
++ } hmac;
++ void *sw_comp_buf;
++ } u;
++ struct swcr_data *sw_next;
++};
++
++#ifndef CRYPTO_TFM_MODE_CBC
++/*
++ * As of linux-2.6.21 this is no longer defined, and presumably no longer
++ * needed to be passed into the crypto core code.
++ */
++#define CRYPTO_TFM_MODE_CBC 0
++#define CRYPTO_TFM_MODE_ECB 0
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ /*
++ * Linux 2.6.19 introduced a new Crypto API, setup macro's to convert new
++ * API into old API.
++ */
++
++ /* Symmetric/Block Cipher */
++ struct blkcipher_desc
++ {
++ struct crypto_tfm *tfm;
++ void *info;
++ };
++ #define ecb(X) #X
++ #define cbc(X) #X
++ #define crypto_has_blkcipher(X, Y, Z) crypto_alg_available(X, 0)
++ #define crypto_blkcipher_cast(X) X
++ #define crypto_blkcipher_tfm(X) X
++ #define crypto_alloc_blkcipher(X, Y, Z) crypto_alloc_tfm(X, mode)
++ #define crypto_blkcipher_ivsize(X) crypto_tfm_alg_ivsize(X)
++ #define crypto_blkcipher_blocksize(X) crypto_tfm_alg_blocksize(X)
++ #define crypto_blkcipher_setkey(X, Y, Z) crypto_cipher_setkey(X, Y, Z)
++ #define crypto_blkcipher_encrypt_iv(W, X, Y, Z) \
++ crypto_cipher_encrypt_iv((W)->tfm, X, Y, Z, (u8 *)((W)->info))
++ #define crypto_blkcipher_decrypt_iv(W, X, Y, Z) \
++ crypto_cipher_decrypt_iv((W)->tfm, X, Y, Z, (u8 *)((W)->info))
++
++ /* Hash/HMAC/Digest */
++ struct hash_desc
++ {
++ struct crypto_tfm *tfm;
++ };
++ #define hmac(X) #X
++ #define crypto_has_hash(X, Y, Z) crypto_alg_available(X, 0)
++ #define crypto_hash_cast(X) X
++ #define crypto_hash_tfm(X) X
++ #define crypto_alloc_hash(X, Y, Z) crypto_alloc_tfm(X, mode)
++ #define crypto_hash_digestsize(X) crypto_tfm_alg_digestsize(X)
++ #define crypto_hash_digest(W, X, Y, Z) \
++ crypto_digest_digest((W)->tfm, X, sg_num, Z)
++
++ /* Asymmetric Cipher */
++ #define crypto_has_cipher(X, Y, Z) crypto_alg_available(X, 0)
++
++ /* Compression */
++ #define crypto_has_comp(X, Y, Z) crypto_alg_available(X, 0)
++ #define crypto_comp_tfm(X) X
++ #define crypto_comp_cast(X) X
++ #define crypto_alloc_comp(X, Y, Z) crypto_alloc_tfm(X, mode)
++#else
++ #define ecb(X) "ecb(" #X ")"
++ #define cbc(X) "cbc(" #X ")"
++ #define hmac(X) "hmac(" #X ")"
++#endif /* if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) */
++
++struct crypto_details
++{
++ char *alg_name;
++ int mode;
++ int sw_type;
++};
++
++/*
++ * This needs to be kept updated with CRYPTO_xxx list (cryptodev.h).
++ * If the Algorithm is not supported, then insert a {NULL, 0, 0} entry.
++ *
++ * IMPORTANT: The index to the array IS CRYPTO_xxx.
++ */
++static struct crypto_details crypto_details[CRYPTO_ALGORITHM_MAX + 1] = {
++ { NULL, 0, 0 },
++ /* CRYPTO_xxx index starts at 1 */
++ { cbc(des), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(des3_ede), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(blowfish), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(cast5), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(skipjack), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { hmac(md5), 0, SW_TYPE_HMAC },
++ { hmac(sha1), 0, SW_TYPE_HMAC },
++ { hmac(ripemd160), 0, SW_TYPE_HMAC },
++ { "md5-kpdk??", 0, SW_TYPE_HASH },
++ { "sha1-kpdk??", 0, SW_TYPE_HASH },
++ { cbc(aes), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { ecb(arc4), CRYPTO_TFM_MODE_ECB, SW_TYPE_BLKCIPHER },
++ { "md5", 0, SW_TYPE_HASH },
++ { "sha1", 0, SW_TYPE_HASH },
++ { hmac(digest_null), 0, SW_TYPE_HMAC },
++ { cbc(cipher_null), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { "deflate", 0, SW_TYPE_COMP },
++ { hmac(sha256), 0, SW_TYPE_HMAC },
++ { hmac(sha384), 0, SW_TYPE_HMAC },
++ { hmac(sha512), 0, SW_TYPE_HMAC },
++ { cbc(camellia), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { "sha256", 0, SW_TYPE_HASH },
++ { "sha384", 0, SW_TYPE_HASH },
++ { "sha512", 0, SW_TYPE_HASH },
++ { "ripemd160", 0, SW_TYPE_HASH },
++};
++
++int32_t swcr_id = -1;
++module_param(swcr_id, int, 0444);
++MODULE_PARM_DESC(swcr_id, "Read-Only OCF ID for cryptosoft driver");
++
++int swcr_fail_if_compression_grows = 1;
++module_param(swcr_fail_if_compression_grows, int, 0644);
++MODULE_PARM_DESC(swcr_fail_if_compression_grows,
++ "Treat compression that results in more data as a failure");
++
++static struct swcr_data **swcr_sessions = NULL;
++static u_int32_t swcr_sesnum = 0;
++
++static int swcr_process(device_t, struct cryptop *, int);
++static int swcr_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int swcr_freesession(device_t, u_int64_t);
++
++static device_method_t swcr_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, swcr_newsession),
++ DEVMETHOD(cryptodev_freesession,swcr_freesession),
++ DEVMETHOD(cryptodev_process, swcr_process),
++};
++
++#define debug swcr_debug
++int swcr_debug = 0;
++module_param(swcr_debug, int, 0644);
++MODULE_PARM_DESC(swcr_debug, "Enable debug");
++
++/*
++ * Generate a new software session.
++ */
++static int
++swcr_newsession(device_t dev, u_int32_t *sid, struct cryptoini *cri)
++{
++ struct swcr_data **swd;
++ u_int32_t i;
++ int error;
++ char *algo;
++ int mode, sw_type;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid == NULL || cri == NULL) {
++ dprintk("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ if (swcr_sessions) {
++ for (i = 1; i < swcr_sesnum; i++)
++ if (swcr_sessions[i] == NULL)
++ break;
++ } else
++ i = 1; /* NB: to silence compiler warning */
++
++ if (swcr_sessions == NULL || i == swcr_sesnum) {
++ if (swcr_sessions == NULL) {
++ i = 1; /* We leave swcr_sessions[0] empty */
++ swcr_sesnum = CRYPTO_SW_SESSIONS;
++ } else
++ swcr_sesnum *= 2;
++
++ swd = kmalloc(swcr_sesnum * sizeof(struct swcr_data *), SLAB_ATOMIC);
++ if (swd == NULL) {
++ /* Reset session number */
++ if (swcr_sesnum == CRYPTO_SW_SESSIONS)
++ swcr_sesnum = 0;
++ else
++ swcr_sesnum /= 2;
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memset(swd, 0, swcr_sesnum * sizeof(struct swcr_data *));
++
++ /* Copy existing sessions */
++ if (swcr_sessions) {
++ memcpy(swd, swcr_sessions,
++ (swcr_sesnum / 2) * sizeof(struct swcr_data *));
++ kfree(swcr_sessions);
++ }
++
++ swcr_sessions = swd;
++ }
++
++ swd = &swcr_sessions[i];
++ *sid = i;
++
++ while (cri) {
++ *swd = (struct swcr_data *) kmalloc(sizeof(struct swcr_data),
++ SLAB_ATOMIC);
++ if (*swd == NULL) {
++ swcr_freesession(NULL, i);
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memset(*swd, 0, sizeof(struct swcr_data));
++
++ if (cri->cri_alg > CRYPTO_ALGORITHM_MAX) {
++ printk("cryptosoft: Unknown algorithm 0x%x\n", cri->cri_alg);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ algo = crypto_details[cri->cri_alg].alg_name;
++ if (!algo || !*algo) {
++ printk("cryptosoft: Unsupported algorithm 0x%x\n", cri->cri_alg);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ mode = crypto_details[cri->cri_alg].mode;
++ sw_type = crypto_details[cri->cri_alg].sw_type;
++
++ /* Algorithm specific configuration */
++ switch (cri->cri_alg) {
++ case CRYPTO_NULL_CBC:
++ cri->cri_klen = 0; /* make it work with crypto API */
++ break;
++ default:
++ break;
++ }
++
++ if (sw_type == SW_TYPE_BLKCIPHER) {
++ dprintk("%s crypto_alloc_blkcipher(%s, 0x%x)\n", __FUNCTION__,
++ algo, mode);
++
++ (*swd)->sw_tfm = crypto_blkcipher_tfm(
++ crypto_alloc_blkcipher(algo, 0,
++ CRYPTO_ALG_ASYNC));
++ if (!(*swd)->sw_tfm) {
++ dprintk("cryptosoft: crypto_alloc_blkcipher failed(%s,0x%x)\n",
++ algo,mode);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ if (debug) {
++ dprintk("%s key:cri->cri_klen=%d,(cri->cri_klen + 7)/8=%d",
++ __FUNCTION__,cri->cri_klen,(cri->cri_klen + 7)/8);
++ for (i = 0; i < (cri->cri_klen + 7) / 8; i++)
++ {
++ dprintk("%s0x%x", (i % 8) ? " " : "\n ",cri->cri_key[i]);
++ }
++ dprintk("\n");
++ }
++ error = crypto_blkcipher_setkey(
++ crypto_blkcipher_cast((*swd)->sw_tfm), cri->cri_key,
++ (cri->cri_klen + 7) / 8);
++ if (error) {
++ printk("cryptosoft: setkey failed %d (crt_flags=0x%x)\n", error,
++ (*swd)->sw_tfm->crt_flags);
++ swcr_freesession(NULL, i);
++ return error;
++ }
++ } else if (sw_type == SW_TYPE_HMAC || sw_type == SW_TYPE_HASH) {
++ dprintk("%s crypto_alloc_hash(%s, 0x%x)\n", __FUNCTION__,
++ algo, mode);
++
++ (*swd)->sw_tfm = crypto_hash_tfm(
++ crypto_alloc_hash(algo, 0, CRYPTO_ALG_ASYNC));
++
++ if (!(*swd)->sw_tfm) {
++ dprintk("cryptosoft: crypto_alloc_hash failed(%s,0x%x)\n",
++ algo, mode);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ (*swd)->u.hmac.sw_klen = (cri->cri_klen + 7) / 8;
++ (*swd)->u.hmac.sw_key = (char *)kmalloc((*swd)->u.hmac.sw_klen,
++ SLAB_ATOMIC);
++ if ((*swd)->u.hmac.sw_key == NULL) {
++ swcr_freesession(NULL, i);
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memcpy((*swd)->u.hmac.sw_key, cri->cri_key, (*swd)->u.hmac.sw_klen);
++ if (cri->cri_mlen) {
++ (*swd)->u.hmac.sw_mlen = cri->cri_mlen;
++ } else {
++ (*swd)->u.hmac.sw_mlen =
++ crypto_hash_digestsize(
++ crypto_hash_cast((*swd)->sw_tfm));
++ }
++ } else if (sw_type == SW_TYPE_COMP) {
++ (*swd)->sw_tfm = crypto_comp_tfm(
++ crypto_alloc_comp(algo, 0, CRYPTO_ALG_ASYNC));
++ if (!(*swd)->sw_tfm) {
++ dprintk("cryptosoft: crypto_alloc_comp failed(%s,0x%x)\n",
++ algo, mode);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++ (*swd)->u.sw_comp_buf = kmalloc(CRYPTO_MAX_DATA_LEN, SLAB_ATOMIC);
++ if ((*swd)->u.sw_comp_buf == NULL) {
++ swcr_freesession(NULL, i);
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ } else {
++ printk("cryptosoft: Unhandled sw_type %d\n", sw_type);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ (*swd)->sw_alg = cri->cri_alg;
++ (*swd)->sw_type = sw_type;
++
++ cri = cri->cri_next;
++ swd = &((*swd)->sw_next);
++ }
++ return 0;
++}
++
++/*
++ * Free a session.
++ */
++static int
++swcr_freesession(device_t dev, u_int64_t tid)
++{
++ struct swcr_data *swd;
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid > swcr_sesnum || swcr_sessions == NULL ||
++ swcr_sessions[sid] == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return(EINVAL);
++ }
++
++ /* Silently accept and return */
++ if (sid == 0)
++ return(0);
++
++ while ((swd = swcr_sessions[sid]) != NULL) {
++ swcr_sessions[sid] = swd->sw_next;
++ if (swd->sw_tfm)
++ crypto_free_tfm(swd->sw_tfm);
++ if (swd->sw_type == SW_TYPE_COMP) {
++ if (swd->u.sw_comp_buf)
++ kfree(swd->u.sw_comp_buf);
++ } else {
++ if (swd->u.hmac.sw_key)
++ kfree(swd->u.hmac.sw_key);
++ }
++ kfree(swd);
++ }
++ return 0;
++}
++
++/*
++ * Process a software request.
++ */
++static int
++swcr_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct cryptodesc *crd;
++ struct swcr_data *sw;
++ u_int32_t lid;
++#define SCATTERLIST_MAX 16
++ struct scatterlist sg[SCATTERLIST_MAX];
++ int sg_num, sg_len, skip;
++ struct sk_buff *skb = NULL;
++ struct uio *uiop = NULL;
++
++ dprintk("%s()\n", __FUNCTION__);
++ /* Sanity check */
++ if (crp == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ crp->crp_etype = 0;
++
++ if (crp->crp_desc == NULL || crp->crp_buf == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ lid = crp->crp_sid & 0xffffffff;
++ if (lid >= swcr_sesnum || lid == 0 || swcr_sessions == NULL ||
++ swcr_sessions[lid] == NULL) {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++ /*
++ * do some error checking outside of the loop for SKB and IOV processing
++ * this leaves us with valid skb or uiop pointers for later
++ */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ skb = (struct sk_buff *) crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags >= SCATTERLIST_MAX) {
++ printk("%s,%d: %d nr_frags > SCATTERLIST_MAX", __FILE__, __LINE__,
++ skb_shinfo(skb)->nr_frags);
++ goto done;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ uiop = (struct uio *) crp->crp_buf;
++ if (uiop->uio_iovcnt > SCATTERLIST_MAX) {
++ printk("%s,%d: %d uio_iovcnt > SCATTERLIST_MAX", __FILE__, __LINE__,
++ uiop->uio_iovcnt);
++ goto done;
++ }
++ }
++
++ /* Go through crypto descriptors, processing as we go */
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ /*
++ * Find the crypto context.
++ *
++ * XXX Note that the logic here prevents us from having
++ * XXX the same algorithm multiple times in a session
++ * XXX (or rather, we can but it won't give us the right
++ * XXX results). To do that, we'd need some way of differentiating
++ * XXX between the various instances of an algorithm (so we can
++ * XXX locate the correct crypto context).
++ */
++ for (sw = swcr_sessions[lid]; sw && sw->sw_alg != crd->crd_alg;
++ sw = sw->sw_next)
++ ;
++
++ /* No such context ? */
++ if (sw == NULL) {
++ crp->crp_etype = EINVAL;
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++ skip = crd->crd_skip;
++
++ /*
++ * setup the SG list skip from the start of the buffer
++ */
++ memset(sg, 0, sizeof(sg));
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ int i, len;
++
++ sg_num = 0;
++ sg_len = 0;
++
++ if (skip < skb_headlen(skb)) {
++ len = skb_headlen(skb) - skip;
++ if (len + sg_len > crd->crd_len)
++ len = crd->crd_len - sg_len;
++ sg_set_page(&sg[sg_num],
++ virt_to_page(skb->data + skip), len,
++ offset_in_page(skb->data + skip));
++ sg_len += len;
++ sg_num++;
++ skip = 0;
++ } else
++ skip -= skb_headlen(skb);
++
++ for (i = 0; sg_len < crd->crd_len &&
++ i < skb_shinfo(skb)->nr_frags &&
++ sg_num < SCATTERLIST_MAX; i++) {
++ if (skip < skb_shinfo(skb)->frags[i].size) {
++ len = skb_shinfo(skb)->frags[i].size - skip;
++ if (len + sg_len > crd->crd_len)
++ len = crd->crd_len - sg_len;
++ sg_set_page(&sg[sg_num],
++ skb_shinfo(skb)->frags[i].page,
++ len,
++ skb_shinfo(skb)->frags[i].page_offset + skip);
++ sg_len += len;
++ sg_num++;
++ skip = 0;
++ } else
++ skip -= skb_shinfo(skb)->frags[i].size;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ int len;
++
++ sg_len = 0;
++ for (sg_num = 0; sg_len <= crd->crd_len &&
++ sg_num < uiop->uio_iovcnt &&
++ sg_num < SCATTERLIST_MAX; sg_num++) {
++ if (skip <= uiop->uio_iov[sg_num].iov_len) {
++ len = uiop->uio_iov[sg_num].iov_len - skip;
++ if (len + sg_len > crd->crd_len)
++ len = crd->crd_len - sg_len;
++ sg_set_page(&sg[sg_num],
++ virt_to_page(uiop->uio_iov[sg_num].iov_base+skip),
++ len,
++ offset_in_page(uiop->uio_iov[sg_num].iov_base+skip));
++ sg_len += len;
++ skip = 0;
++ } else
++ skip -= uiop->uio_iov[sg_num].iov_len;
++ }
++ } else {
++ sg_len = (crp->crp_ilen - skip);
++ if (sg_len > crd->crd_len)
++ sg_len = crd->crd_len;
++ sg_set_page(&sg[0], virt_to_page(crp->crp_buf + skip),
++ sg_len, offset_in_page(crp->crp_buf + skip));
++ sg_num = 1;
++ }
++
++
++ switch (sw->sw_type) {
++ case SW_TYPE_BLKCIPHER: {
++ unsigned char iv[EALG_MAX_BLOCK_LEN];
++ unsigned char *ivp = iv;
++ int ivsize =
++ crypto_blkcipher_ivsize(crypto_blkcipher_cast(sw->sw_tfm));
++ struct blkcipher_desc desc;
++
++ if (sg_len < crypto_blkcipher_blocksize(
++ crypto_blkcipher_cast(sw->sw_tfm))) {
++ crp->crp_etype = EINVAL;
++ dprintk("%s,%d: EINVAL len %d < %d\n", __FILE__, __LINE__,
++ sg_len, crypto_blkcipher_blocksize(
++ crypto_blkcipher_cast(sw->sw_tfm)));
++ goto done;
++ }
++
++ if (ivsize > sizeof(iv)) {
++ crp->crp_etype = EINVAL;
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++ if (crd->crd_flags & CRD_F_KEY_EXPLICIT) {
++ int i, error;
++
++ if (debug) {
++ dprintk("%s key:", __FUNCTION__);
++ for (i = 0; i < (crd->crd_klen + 7) / 8; i++)
++ dprintk("%s0x%x", (i % 8) ? " " : "\n ",
++ crd->crd_key[i]);
++ dprintk("\n");
++ }
++ error = crypto_blkcipher_setkey(
++ crypto_blkcipher_cast(sw->sw_tfm), crd->crd_key,
++ (crd->crd_klen + 7) / 8);
++ if (error) {
++ dprintk("cryptosoft: setkey failed %d (crt_flags=0x%x)\n",
++ error, sw->sw_tfm->crt_flags);
++ crp->crp_etype = -error;
++ }
++ }
++
++ memset(&desc, 0, sizeof(desc));
++ desc.tfm = crypto_blkcipher_cast(sw->sw_tfm);
++
++ if (crd->crd_flags & CRD_F_ENCRYPT) { /* encrypt */
++
++ if (crd->crd_flags & CRD_F_IV_EXPLICIT) {
++ ivp = crd->crd_iv;
++ } else {
++ get_random_bytes(ivp, ivsize);
++ }
++ /*
++ * do we have to copy the IV back to the buffer ?
++ */
++ if ((crd->crd_flags & CRD_F_IV_PRESENT) == 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, ivsize, (caddr_t)ivp);
++ }
++ desc.info = ivp;
++ crypto_blkcipher_encrypt_iv(&desc, sg, sg, sg_len);
++
++ } else { /*decrypt */
++
++ if (crd->crd_flags & CRD_F_IV_EXPLICIT) {
++ ivp = crd->crd_iv;
++ } else {
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, ivsize, (caddr_t)ivp);
++ }
++ desc.info = ivp;
++ crypto_blkcipher_decrypt_iv(&desc, sg, sg, sg_len);
++ }
++ } break;
++ case SW_TYPE_HMAC:
++ case SW_TYPE_HASH:
++ {
++ char result[HASH_MAX_LEN];
++ struct hash_desc desc;
++
++ /* check we have room for the result */
++ if (crp->crp_ilen - crd->crd_inject < sw->u.hmac.sw_mlen) {
++ dprintk(
++ "cryptosoft: EINVAL crp_ilen=%d, len=%d, inject=%d digestsize=%d\n",
++ crp->crp_ilen, crd->crd_skip + sg_len, crd->crd_inject,
++ sw->u.hmac.sw_mlen);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ memset(&desc, 0, sizeof(desc));
++ desc.tfm = crypto_hash_cast(sw->sw_tfm);
++
++ memset(result, 0, sizeof(result));
++
++ if (sw->sw_type == SW_TYPE_HMAC) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ crypto_hmac(sw->sw_tfm, sw->u.hmac.sw_key, &sw->u.hmac.sw_klen,
++ sg, sg_num, result);
++#else
++ crypto_hash_setkey(desc.tfm, sw->u.hmac.sw_key,
++ sw->u.hmac.sw_klen);
++ crypto_hash_digest(&desc, sg, sg_len, result);
++#endif /* #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) */
++
++ } else { /* SW_TYPE_HASH */
++ crypto_hash_digest(&desc, sg, sg_len, result);
++ }
++
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, sw->u.hmac.sw_mlen, result);
++ }
++ break;
++
++ case SW_TYPE_COMP: {
++ void *ibuf = NULL;
++ void *obuf = sw->u.sw_comp_buf;
++ int ilen = sg_len, olen = CRYPTO_MAX_DATA_LEN;
++ int ret = 0;
++
++ /*
++ * we need to use an additional copy if there is more than one
++ * input chunk since the kernel comp routines do not handle
++ * SG yet. Otherwise we just use the input buffer as is.
++ * Rather than allocate another buffer we just split the tmp
++ * buffer we already have.
++ * Perhaps we should just use zlib directly ?
++ */
++ if (sg_num > 1) {
++ int blk;
++
++ ibuf = obuf;
++ for (blk = 0; blk < sg_num; blk++) {
++ memcpy(obuf, sg_virt(&sg[blk]),
++ sg[blk].length);
++ obuf += sg[blk].length;
++ }
++ olen -= sg_len;
++ } else
++ ibuf = sg_virt(&sg[0]);
++
++ if (crd->crd_flags & CRD_F_ENCRYPT) { /* compress */
++ ret = crypto_comp_compress(crypto_comp_cast(sw->sw_tfm),
++ ibuf, ilen, obuf, &olen);
++ if (!ret && olen > crd->crd_len) {
++ dprintk("cryptosoft: ERANGE compress %d into %d\n",
++ crd->crd_len, olen);
++ if (swcr_fail_if_compression_grows)
++ ret = ERANGE;
++ }
++ } else { /* decompress */
++ ret = crypto_comp_decompress(crypto_comp_cast(sw->sw_tfm),
++ ibuf, ilen, obuf, &olen);
++ if (!ret && (olen + crd->crd_inject) > crp->crp_olen) {
++ dprintk("cryptosoft: ETOOSMALL decompress %d into %d, "
++ "space for %d,at offset %d\n",
++ crd->crd_len, olen, crp->crp_olen, crd->crd_inject);
++ ret = ETOOSMALL;
++ }
++ }
++ if (ret)
++ dprintk("%s,%d: ret = %d\n", __FILE__, __LINE__, ret);
++
++ /*
++ * on success copy result back,
++ * linux crpyto API returns -errno, we need to fix that
++ */
++ crp->crp_etype = ret < 0 ? -ret : ret;
++ if (ret == 0) {
++ /* copy back the result and return it's size */
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, olen, obuf);
++ crp->crp_olen = olen;
++ }
++
++
++ } break;
++
++ default:
++ /* Unknown/unsupported algorithm */
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++ }
++
++done:
++ crypto_done(crp);
++ return 0;
++}
++
++static int
++cryptosoft_init(void)
++{
++ int i, sw_type, mode;
++ char *algo;
++
++ dprintk("%s(%p)\n", __FUNCTION__, cryptosoft_init);
++
++ softc_device_init(&swcr_softc, "cryptosoft", 0, swcr_methods);
++
++ swcr_id = crypto_get_driverid(softc_get_device(&swcr_softc),
++ CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC);
++ if (swcr_id < 0) {
++ printk("Software crypto device cannot initialize!");
++ return -ENODEV;
++ }
++
++#define REGISTER(alg) \
++ crypto_register(swcr_id, alg, 0,0);
++
++ for (i = CRYPTO_ALGORITHM_MIN; i <= CRYPTO_ALGORITHM_MAX; ++i)
++ {
++
++ algo = crypto_details[i].alg_name;
++ if (!algo || !*algo)
++ {
++ dprintk("%s:Algorithm %d not supported\n", __FUNCTION__, i);
++ continue;
++ }
++
++ mode = crypto_details[i].mode;
++ sw_type = crypto_details[i].sw_type;
++
++ switch (sw_type)
++ {
++ case SW_TYPE_CIPHER:
++ if (crypto_has_cipher(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:CIPHER algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_HMAC:
++ if (crypto_has_hash(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:HMAC algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_HASH:
++ if (crypto_has_hash(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:HASH algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_COMP:
++ if (crypto_has_comp(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:COMP algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_BLKCIPHER:
++ if (crypto_has_blkcipher(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:BLKCIPHER algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ default:
++ dprintk(
++ "%s:Algorithm Type %d not supported (algorithm %d:'%s')\n",
++ __FUNCTION__, sw_type, i, algo);
++ break;
++ }
++ }
++
++ return(0);
++}
++
++static void
++cryptosoft_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ crypto_unregister_all(swcr_id);
++ swcr_id = -1;
++}
++
++module_init(cryptosoft_init);
++module_exit(cryptosoft_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("Cryptosoft (OCF module for kernel crypto)");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_asym.c linux-2.6.27.10/crypto/ocf/ep80579/icp_asym.c
+--- linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_asym.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ep80579/icp_asym.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,1375 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++
++#include "icp_ocf.h"
++
++/*The following define values (containing the word 'INDEX') are used to find
++the index of each input buffer of the crypto_kop struct (see OCF cryptodev.h).
++These values were found through analysis of the OCF OpenSSL patch. If the
++calling program uses different input buffer positions, these defines will have
++to be changed.*/
++
++/*DIFFIE HELLMAN buffer index values*/
++#define ICP_DH_KRP_PARAM_PRIME_INDEX (0)
++#define ICP_DH_KRP_PARAM_BASE_INDEX (1)
++#define ICP_DH_KRP_PARAM_PRIVATE_VALUE_INDEX (2)
++#define ICP_DH_KRP_PARAM_RESULT_INDEX (3)
++
++/*MOD EXP buffer index values*/
++#define ICP_MOD_EXP_KRP_PARAM_BASE_INDEX (0)
++#define ICP_MOD_EXP_KRP_PARAM_EXPONENT_INDEX (1)
++#define ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX (2)
++#define ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX (3)
++
++#define SINGLE_BYTE_VALUE (4)
++
++/*MOD EXP CRT buffer index values*/
++#define ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_P_INDEX (0)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_Q_INDEX (1)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_I_INDEX (2)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DP_INDEX (3)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DQ_INDEX (4)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_COEFF_QINV_INDEX (5)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_RESULT_INDEX (6)
++
++/*DSA sign buffer index values*/
++#define ICP_DSA_SIGN_KRP_PARAM_DGST_INDEX (0)
++#define ICP_DSA_SIGN_KRP_PARAM_PRIME_P_INDEX (1)
++#define ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX (2)
++#define ICP_DSA_SIGN_KRP_PARAM_G_INDEX (3)
++#define ICP_DSA_SIGN_KRP_PARAM_X_INDEX (4)
++#define ICP_DSA_SIGN_KRP_PARAM_R_RESULT_INDEX (5)
++#define ICP_DSA_SIGN_KRP_PARAM_S_RESULT_INDEX (6)
++
++/*DSA verify buffer index values*/
++#define ICP_DSA_VERIFY_KRP_PARAM_DGST_INDEX (0)
++#define ICP_DSA_VERIFY_KRP_PARAM_PRIME_P_INDEX (1)
++#define ICP_DSA_VERIFY_KRP_PARAM_PRIME_Q_INDEX (2)
++#define ICP_DSA_VERIFY_KRP_PARAM_G_INDEX (3)
++#define ICP_DSA_VERIFY_KRP_PARAM_PUBKEY_INDEX (4)
++#define ICP_DSA_VERIFY_KRP_PARAM_SIG_R_INDEX (5)
++#define ICP_DSA_VERIFY_KRP_PARAM_SIG_S_INDEX (6)
++
++/*DSA sign prime Q vs random number K size check values*/
++#define DONT_RUN_LESS_THAN_CHECK (0)
++#define FAIL_A_IS_GREATER_THAN_B (1)
++#define FAIL_A_IS_EQUAL_TO_B (1)
++#define SUCCESS_A_IS_LESS_THAN_B (0)
++#define DSA_SIGN_RAND_GEN_VAL_CHECK_MAX_ITERATIONS (500)
++
++/* We need to set a cryptokp success value just in case it is set or allocated
++ and not set to zero outside of this module */
++#define CRYPTO_OP_SUCCESS (0)
++
++static int icp_ocfDrvDHComputeKey(struct cryptkop *krp);
++
++static int icp_ocfDrvModExp(struct cryptkop *krp);
++
++static int icp_ocfDrvModExpCRT(struct cryptkop *krp);
++
++static int
++icp_ocfDrvCheckALessThanB(CpaFlatBuffer * pK, CpaFlatBuffer * pQ, int *doCheck);
++
++static int icp_ocfDrvDsaSign(struct cryptkop *krp);
++
++static int icp_ocfDrvDsaVerify(struct cryptkop *krp);
++
++static void
++icp_ocfDrvDhP1CallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pLocalOctetStringPV);
++
++static void
++icp_ocfDrvModExpCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pResult);
++
++static void
++icp_ocfDrvModExpCRTCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pOutputData);
++
++static void
++icp_ocfDrvDsaVerifyCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaBoolean verifyStatus);
++
++static void
++icp_ocfDrvDsaRSSignCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData,
++ CpaBoolean protocolStatus,
++ CpaFlatBuffer * pR, CpaFlatBuffer * pS);
++
++/* Name : icp_ocfDrvPkeProcess
++ *
++ * Description : This function will choose which PKE process to follow
++ * based on the input arguments
++ */
++int icp_ocfDrvPkeProcess(device_t dev, struct cryptkop *krp, int hint)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++
++ if (NULL == krp) {
++ DPRINTK("%s(): Invalid input parameters, cryptkop = %p\n",
++ __FUNCTION__, krp);
++ return EINVAL;
++ }
++
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ switch (krp->krp_op) {
++ case CRK_DH_COMPUTE_KEY:
++ DPRINTK("%s() doing DH_COMPUTE_KEY\n", __FUNCTION__);
++ lacStatus = icp_ocfDrvDHComputeKey(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvDHComputeKey failed "
++ "(%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_MOD_EXP:
++ DPRINTK("%s() doing MOD_EXP \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvModExp(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvModExp failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_MOD_EXP_CRT:
++ DPRINTK("%s() doing MOD_EXP_CRT \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvModExpCRT(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvModExpCRT "
++ "failed (%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_DSA_SIGN:
++ DPRINTK("%s() doing DSA_SIGN \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvDsaSign(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvDsaSign "
++ "failed (%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_DSA_VERIFY:
++ DPRINTK("%s() doing DSA_VERIFY \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvDsaVerify(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvDsaVerify "
++ "failed (%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ default:
++ EPRINTK("%s(): Asymettric function not "
++ "supported (%d).\n", __FUNCTION__, krp->krp_op);
++ krp->krp_status = EOPNOTSUPP;
++ return EOPNOTSUPP;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvSwapBytes
++ *
++ * Description : This function is used to swap the byte order of a buffer.
++ * It has been seen that in general we are passed little endian byte order
++ * buffers, but LAC only accepts big endian byte order buffers.
++ */
++static void inline
++icp_ocfDrvSwapBytes(u_int8_t * num, u_int32_t buff_len_bytes)
++{
++
++ int i;
++ u_int8_t *end_ptr;
++ u_int8_t hold_val;
++
++ end_ptr = num + (buff_len_bytes - 1);
++ buff_len_bytes = buff_len_bytes >> 1;
++ for (i = 0; i < buff_len_bytes; i++) {
++ hold_val = *num;
++ *num = *end_ptr;
++ num++;
++ *end_ptr = hold_val;
++ end_ptr--;
++ }
++}
++
++/* Name : icp_ocfDrvDHComputeKey
++ *
++ * Description : This function will map Diffie Hellman calls from OCF
++ * to the LAC API. OCF uses this function for Diffie Hellman Phase1 and
++ * Phase2. LAC has a separate Diffie Hellman Phase2 call, however both phases
++ * break down to a modular exponentiation.
++ */
++static int icp_ocfDrvDHComputeKey(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ void *callbackTag = NULL;
++ CpaCyDhPhase1KeyGenOpData *pPhase1OpData = NULL;
++ CpaFlatBuffer *pLocalOctetStringPV = NULL;
++ uint32_t dh_prime_len_bytes = 0, dh_prime_len_bits = 0;
++
++ /* Input checks - check prime is a multiple of 8 bits to allow for
++ allocation later */
++ dh_prime_len_bits =
++ (krp->krp_param[ICP_DH_KRP_PARAM_PRIME_INDEX].crp_nbits);
++
++ /* LAC can reject prime lengths based on prime key sizes, we just
++ need to make sure we can allocate space for the base and
++ exponent buffers correctly */
++ if ((dh_prime_len_bits % NUM_BITS_IN_BYTE) != 0) {
++ APRINTK("%s(): Warning Prime number buffer size is not a "
++ "multiple of 8 bits\n", __FUNCTION__);
++ }
++
++ /* Result storage space should be the same size as the prime as this
++ value can take up the same amount of storage space */
++ if (dh_prime_len_bits !=
++ krp->krp_param[ICP_DH_KRP_PARAM_RESULT_INDEX].crp_nbits) {
++ DPRINTK("%s(): Return Buffer must be the same size "
++ "as the Prime buffer\n", __FUNCTION__);
++ krp->krp_status = EINVAL;
++ return EINVAL;
++ }
++ /* Switch to size in bytes */
++ BITS_TO_BYTES(dh_prime_len_bytes, dh_prime_len_bits);
++
++ callbackTag = krp;
++
++ pPhase1OpData = kmem_cache_zalloc(drvDH_zone, GFP_KERNEL);
++ if (NULL == pPhase1OpData) {
++ APRINTK("%s():Failed to get memory for key gen data\n",
++ __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pLocalOctetStringPV = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pLocalOctetStringPV) {
++ APRINTK("%s():Failed to get memory for pLocalOctetStringPV\n",
++ __FUNCTION__);
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /* Link parameters */
++ pPhase1OpData->primeP.pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_PRIME_INDEX].crp_p;
++
++ pPhase1OpData->primeP.dataLenInBytes = dh_prime_len_bytes;
++
++ icp_ocfDrvSwapBytes(pPhase1OpData->primeP.pData, dh_prime_len_bytes);
++
++ pPhase1OpData->baseG.pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_BASE_INDEX].crp_p;
++
++ BITS_TO_BYTES(pPhase1OpData->baseG.dataLenInBytes,
++ krp->krp_param[ICP_DH_KRP_PARAM_BASE_INDEX].crp_nbits);
++
++ icp_ocfDrvSwapBytes(pPhase1OpData->baseG.pData,
++ pPhase1OpData->baseG.dataLenInBytes);
++
++ pPhase1OpData->privateValueX.pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_PRIVATE_VALUE_INDEX].crp_p;
++
++ BITS_TO_BYTES(pPhase1OpData->privateValueX.dataLenInBytes,
++ krp->krp_param[ICP_DH_KRP_PARAM_PRIVATE_VALUE_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(pPhase1OpData->privateValueX.pData,
++ pPhase1OpData->privateValueX.dataLenInBytes);
++
++ /* Output parameters */
++ pLocalOctetStringPV->pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_RESULT_INDEX].crp_p;
++
++ BITS_TO_BYTES(pLocalOctetStringPV->dataLenInBytes,
++ krp->krp_param[ICP_DH_KRP_PARAM_RESULT_INDEX].crp_nbits);
++
++ lacStatus = cpaCyDhKeyGenPhase1(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvDhP1CallBack,
++ callbackTag, pPhase1OpData,
++ pLocalOctetStringPV);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): DH Phase 1 Key Gen failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ icp_ocfDrvFreeFlatBuffer(pLocalOctetStringPV);
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvModExp
++ *
++ * Description : This function will map ordinary Modular Exponentiation calls
++ * from OCF to the LAC API.
++ *
++ */
++static int icp_ocfDrvModExp(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ void *callbackTag = NULL;
++ CpaCyLnModExpOpData *pModExpOpData = NULL;
++ CpaFlatBuffer *pResult = NULL;
++
++ if ((krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].crp_nbits %
++ NUM_BITS_IN_BYTE) != 0) {
++ DPRINTK("%s(): Warning - modulus buffer size (%d) is not a "
++ "multiple of 8 bits\n", __FUNCTION__,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].
++ crp_nbits);
++ }
++
++ /* Result storage space should be the same size as the prime as this
++ value can take up the same amount of storage space */
++ if (krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].crp_nbits >
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX].crp_nbits) {
++ APRINTK("%s(): Return Buffer size must be the same or"
++ " greater than the Modulus buffer\n", __FUNCTION__);
++ krp->krp_status = EINVAL;
++ return EINVAL;
++ }
++
++ callbackTag = krp;
++
++ pModExpOpData = kmem_cache_zalloc(drvLnModExp_zone, GFP_KERNEL);
++ if (NULL == pModExpOpData) {
++ APRINTK("%s():Failed to get memory for key gen data\n",
++ __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pResult = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pResult) {
++ APRINTK("%s():Failed to get memory for ModExp result\n",
++ __FUNCTION__);
++ kmem_cache_free(drvLnModExp_zone, pModExpOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /* Link parameters */
++ pModExpOpData->modulus.pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].crp_p;
++ BITS_TO_BYTES(pModExpOpData->modulus.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(pModExpOpData->modulus.pData,
++ pModExpOpData->modulus.dataLenInBytes);
++
++ /*OCF patch to Openswan Pluto regularly sends the base value as 2
++ bits in size. In this case, it has been found it is better to
++ use the base size memory space as the input buffer (if the number
++ is in bits is less than a byte, the number of bits is the input
++ value) */
++ if (krp->krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_nbits <
++ NUM_BITS_IN_BYTE) {
++ DPRINTK("%s : base is small (%d)\n", __FUNCTION__, krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_nbits);
++ pModExpOpData->base.dataLenInBytes = SINGLE_BYTE_VALUE;
++ pModExpOpData->base.pData =
++ (uint8_t *) & (krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].
++ crp_nbits);
++ *((uint32_t *) pModExpOpData->base.pData) =
++ htonl(*((uint32_t *) pModExpOpData->base.pData));
++
++ } else {
++
++ DPRINTK("%s : base is big (%d)\n", __FUNCTION__, krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_nbits);
++ pModExpOpData->base.pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_p;
++ BITS_TO_BYTES(pModExpOpData->base.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(pModExpOpData->base.pData,
++ pModExpOpData->base.dataLenInBytes);
++ }
++
++ pModExpOpData->exponent.pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_EXPONENT_INDEX].crp_p;
++ BITS_TO_BYTES(pModExpOpData->exponent.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_EXPONENT_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(pModExpOpData->exponent.pData,
++ pModExpOpData->exponent.dataLenInBytes);
++ /* Output parameters */
++ pResult->pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX].crp_p,
++ BITS_TO_BYTES(pResult->dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX].
++ crp_nbits);
++
++ lacStatus = cpaCyLnModExp(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvModExpCallBack,
++ callbackTag, pModExpOpData, pResult);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): Mod Exp Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ icp_ocfDrvFreeFlatBuffer(pResult);
++ kmem_cache_free(drvLnModExp_zone, pModExpOpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvModExpCRT
++ *
++ * Description : This function will map ordinary Modular Exponentiation Chinese
++ * Remainder Theorem implementaion calls from OCF to the LAC API.
++ *
++ * Note : Mod Exp CRT for this driver is accelerated through LAC RSA type 2
++ * decrypt operation. Therefore P and Q input values must always be prime
++ * numbers. Although basic primality checks are done in LAC, it is up to the
++ * user to do any correct prime number checking before passing the inputs.
++ */
++
++static int icp_ocfDrvModExpCRT(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyRsaDecryptOpData *rsaDecryptOpData = NULL;
++ void *callbackTag = NULL;
++ CpaFlatBuffer *pOutputData = NULL;
++
++ /*Parameter input checks are all done by LAC, no need to repeat
++ them here. */
++ callbackTag = krp;
++
++ rsaDecryptOpData = kmem_cache_zalloc(drvRSADecrypt_zone, GFP_KERNEL);
++ if (NULL == rsaDecryptOpData) {
++ APRINTK("%s():Failed to get memory"
++ " for MOD EXP CRT Op data struct\n", __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ rsaDecryptOpData->pRecipientPrivateKey
++ = kmem_cache_zalloc(drvRSAPrivateKey_zone, GFP_KERNEL);
++ if (NULL == rsaDecryptOpData->pRecipientPrivateKey) {
++ APRINTK("%s():Failed to get memory for MOD EXP CRT"
++ " private key values struct\n", __FUNCTION__);
++ kmem_cache_free(drvRSADecrypt_zone, rsaDecryptOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ version = CPA_CY_RSA_VERSION_TWO_PRIME;
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRepType = CPA_CY_RSA_PRIVATE_KEY_REP_TYPE_2;
++
++ pOutputData = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pOutputData) {
++ APRINTK("%s():Failed to get memory"
++ " for MOD EXP CRT output data\n", __FUNCTION__);
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ rsaDecryptOpData->pRecipientPrivateKey);
++ kmem_cache_free(drvRSADecrypt_zone, rsaDecryptOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ version = CPA_CY_RSA_VERSION_TWO_PRIME;
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRepType = CPA_CY_RSA_PRIVATE_KEY_REP_TYPE_2;
++
++ /* Link parameters */
++ rsaDecryptOpData->inputData.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_I_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->inputData.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_I_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->inputData.pData,
++ rsaDecryptOpData->inputData.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.prime1P.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_P_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.
++ prime1P.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_P_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime1P.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime1P.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.prime2Q.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_Q_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.
++ prime2Q.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime2Q.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime2Q.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent1Dp.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DP_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.
++ exponent1Dp.dataLenInBytes,
++ krp->
++ krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DP_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent1Dp.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent1Dp.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DQ_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.dataLenInBytes,
++ krp->
++ krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DQ_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_COEFF_QINV_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.dataLenInBytes,
++ krp->
++ krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_COEFF_QINV_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.dataLenInBytes);
++
++ /* Output Parameter */
++ pOutputData->pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_RESULT_INDEX].crp_p;
++ BITS_TO_BYTES(pOutputData->dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_RESULT_INDEX].
++ crp_nbits);
++
++ lacStatus = cpaCyRsaDecrypt(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvModExpCRTCallBack,
++ callbackTag, rsaDecryptOpData, pOutputData);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): Mod Exp CRT Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ icp_ocfDrvFreeFlatBuffer(pOutputData);
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ rsaDecryptOpData->pRecipientPrivateKey);
++ kmem_cache_free(drvRSADecrypt_zone, rsaDecryptOpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvCheckALessThanB
++ *
++ * Description : This function will check whether the first argument is less
++ * than the second. It is used to check whether the DSA RS sign Random K
++ * value is less than the Prime Q value (as defined in the specification)
++ *
++ */
++static int
++icp_ocfDrvCheckALessThanB(CpaFlatBuffer * pK, CpaFlatBuffer * pQ, int *doCheck)
++{
++
++ uint8_t *MSB_K = pK->pData;
++ uint8_t *MSB_Q = pQ->pData;
++ uint32_t buffer_lengths_in_bytes = pQ->dataLenInBytes;
++
++ if (DONT_RUN_LESS_THAN_CHECK == *doCheck) {
++ return FAIL_A_IS_GREATER_THAN_B;
++ }
++
++/*Check MSBs
++if A == B, check next MSB
++if A > B, return A_IS_GREATER_THAN_B
++if A < B, return A_IS_LESS_THAN_B (success)
++*/
++ while (*MSB_K == *MSB_Q) {
++ MSB_K++;
++ MSB_Q++;
++
++ buffer_lengths_in_bytes--;
++ if (0 == buffer_lengths_in_bytes) {
++ DPRINTK("%s() Buffers have equal value!!\n",
++ __FUNCTION__);
++ return FAIL_A_IS_EQUAL_TO_B;
++ }
++
++ }
++
++ if (*MSB_K < *MSB_Q) {
++ return SUCCESS_A_IS_LESS_THAN_B;
++ } else {
++ return FAIL_A_IS_GREATER_THAN_B;
++ }
++
++}
++
++/* Name : icp_ocfDrvDsaSign
++ *
++ * Description : This function will map DSA RS Sign from OCF to the LAC API.
++ *
++ * NOTE: From looking at OCF patch to OpenSSL and even the number of input
++ * parameters, OCF expects us to generate the random seed value. This value
++ * is generated and passed to LAC, however the number is discared in the
++ * callback and not returned to the user.
++ */
++static int icp_ocfDrvDsaSign(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyDsaRSSignOpData *dsaRsSignOpData = NULL;
++ void *callbackTag = NULL;
++ CpaCyRandGenOpData randGenOpData;
++ int primeQSizeInBytes = 0;
++ int doCheck = 0;
++ CpaFlatBuffer randData;
++ CpaBoolean protocolStatus = CPA_FALSE;
++ CpaFlatBuffer *pR = NULL;
++ CpaFlatBuffer *pS = NULL;
++
++ callbackTag = krp;
++
++ BITS_TO_BYTES(primeQSizeInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++
++ if (DSA_RS_SIGN_PRIMEQ_SIZE_IN_BYTES != primeQSizeInBytes) {
++ APRINTK("%s(): DSA PRIME Q size not equal to the "
++ "FIPS defined 20bytes, = %d\n",
++ __FUNCTION__, primeQSizeInBytes);
++ krp->krp_status = EDOM;
++ return EDOM;
++ }
++
++ dsaRsSignOpData = kmem_cache_zalloc(drvDSARSSign_zone, GFP_KERNEL);
++ if (NULL == dsaRsSignOpData) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA RS Sign Op data struct\n", __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ dsaRsSignOpData->K.pData =
++ kmem_cache_alloc(drvDSARSSignKValue_zone, GFP_ATOMIC);
++
++ if (NULL == dsaRsSignOpData->K.pData) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA RS Sign Op Random value\n", __FUNCTION__);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pR = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pR) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA signature R\n", __FUNCTION__);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pS = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pS) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA signature S\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /*link prime number parameter for ease of processing */
++ dsaRsSignOpData->P.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_P_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->P.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_P_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->P.pData,
++ dsaRsSignOpData->P.dataLenInBytes);
++
++ dsaRsSignOpData->Q.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->Q.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->Q.pData,
++ dsaRsSignOpData->Q.dataLenInBytes);
++
++ /*generate random number with equal buffer size to Prime value Q,
++ but value less than Q */
++ dsaRsSignOpData->K.dataLenInBytes = dsaRsSignOpData->Q.dataLenInBytes;
++
++ randGenOpData.generateBits = CPA_TRUE;
++ randGenOpData.lenInBytes = dsaRsSignOpData->K.dataLenInBytes;
++
++ icp_ocfDrvPtrAndLenToFlatBuffer(dsaRsSignOpData->K.pData,
++ dsaRsSignOpData->K.dataLenInBytes,
++ &randData);
++
++ doCheck = 0;
++ while (icp_ocfDrvCheckALessThanB(&(dsaRsSignOpData->K),
++ &(dsaRsSignOpData->Q), &doCheck)) {
++
++ if (CPA_STATUS_SUCCESS
++ != cpaCyRandGen(CPA_INSTANCE_HANDLE_SINGLE,
++ NULL, NULL, &randGenOpData, &randData)) {
++ APRINTK("%s(): ERROR - Failed to generate DSA RS Sign K"
++ "value\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = EAGAIN;
++ return EAGAIN;
++ }
++
++ doCheck++;
++ if (DSA_SIGN_RAND_GEN_VAL_CHECK_MAX_ITERATIONS == doCheck) {
++ APRINTK("%s(): ERROR - Failed to find DSA RS Sign K "
++ "value less than Q value\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = EAGAIN;
++ return EAGAIN;
++ }
++
++ }
++ /*Rand Data - no need to swap bytes for pK */
++
++ /* Link parameters */
++ dsaRsSignOpData->G.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_G_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->G.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_G_INDEX].crp_nbits);
++
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->G.pData,
++ dsaRsSignOpData->G.dataLenInBytes);
++
++ dsaRsSignOpData->X.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_X_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->X.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_X_INDEX].crp_nbits);
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->X.pData,
++ dsaRsSignOpData->X.dataLenInBytes);
++
++ dsaRsSignOpData->M.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_DGST_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->M.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_DGST_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->M.pData,
++ dsaRsSignOpData->M.dataLenInBytes);
++
++ /* Output Parameters */
++ pS->pData = krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_S_RESULT_INDEX].crp_p;
++ BITS_TO_BYTES(pS->dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_S_RESULT_INDEX].
++ crp_nbits);
++
++ pR->pData = krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_R_RESULT_INDEX].crp_p;
++ BITS_TO_BYTES(pR->dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_R_RESULT_INDEX].
++ crp_nbits);
++
++ lacStatus = cpaCyDsaSignRS(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvDsaRSSignCallBack,
++ callbackTag, dsaRsSignOpData,
++ &protocolStatus, pR, pS);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): DSA RS Sign Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ icp_ocfDrvFreeFlatBuffer(pS);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvDsaVerify
++ *
++ * Description : This function will map DSA RS Verify from OCF to the LAC API.
++ *
++ */
++static int icp_ocfDrvDsaVerify(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyDsaVerifyOpData *dsaVerifyOpData = NULL;
++ void *callbackTag = NULL;
++ CpaBoolean verifyStatus = CPA_FALSE;
++
++ callbackTag = krp;
++
++ dsaVerifyOpData = kmem_cache_zalloc(drvDSAVerify_zone, GFP_KERNEL);
++ if (NULL == dsaVerifyOpData) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA Verify Op data struct\n", __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /* Link parameters */
++ dsaVerifyOpData->P.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_P_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->P.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_P_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->P.pData,
++ dsaVerifyOpData->P.dataLenInBytes);
++
++ dsaVerifyOpData->Q.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_Q_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->Q.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->Q.pData,
++ dsaVerifyOpData->Q.dataLenInBytes);
++
++ dsaVerifyOpData->G.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_G_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->G.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_G_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->G.pData,
++ dsaVerifyOpData->G.dataLenInBytes);
++
++ dsaVerifyOpData->Y.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PUBKEY_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->Y.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PUBKEY_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->Y.pData,
++ dsaVerifyOpData->Y.dataLenInBytes);
++
++ dsaVerifyOpData->M.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_DGST_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->M.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_DGST_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->M.pData,
++ dsaVerifyOpData->M.dataLenInBytes);
++
++ dsaVerifyOpData->R.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_R_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->R.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_R_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->R.pData,
++ dsaVerifyOpData->R.dataLenInBytes);
++
++ dsaVerifyOpData->S.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_S_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->S.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_S_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->S.pData,
++ dsaVerifyOpData->S.dataLenInBytes);
++
++ lacStatus = cpaCyDsaVerify(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvDsaVerifyCallBack,
++ callbackTag, dsaVerifyOpData, &verifyStatus);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): DSA Verify Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ kmem_cache_free(drvDSAVerify_zone, dsaVerifyOpData);
++ krp->krp_status = ECANCELED;
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvReadRandom
++ *
++ * Description : This function will map RNG functionality calls from OCF
++ * to the LAC API.
++ */
++int icp_ocfDrvReadRandom(void *arg, uint32_t * buf, int maxwords)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyRandGenOpData randGenOpData;
++ CpaFlatBuffer randData;
++
++ if (NULL == buf) {
++ APRINTK("%s(): Invalid input parameters\n", __FUNCTION__);
++ return EINVAL;
++ }
++
++ /* maxwords here is number of integers to generate data for */
++ randGenOpData.generateBits = CPA_TRUE;
++
++ randGenOpData.lenInBytes = maxwords * sizeof(uint32_t);
++
++ icp_ocfDrvPtrAndLenToFlatBuffer((Cpa8U *) buf,
++ randGenOpData.lenInBytes, &randData);
++
++ lacStatus = cpaCyRandGen(CPA_INSTANCE_HANDLE_SINGLE,
++ NULL, NULL, &randGenOpData, &randData);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_LacSymRandGen failed (%d). \n",
++ __FUNCTION__, lacStatus);
++ return RETURN_RAND_NUM_GEN_FAILED;
++ }
++
++ return randGenOpData.lenInBytes / sizeof(uint32_t);
++}
++
++/* Name : icp_ocfDrvDhP1Callback
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the DH operation.
++ */
++static void
++icp_ocfDrvDhP1CallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pLocalOctetStringPV)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyDhPhase1KeyGenOpData *pPhase1OpData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pPhase1OpData = (CpaCyDhPhase1KeyGenOpData *) pOpData;
++
++ if (NULL == pLocalOctetStringPV) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "pLocalOctetStringPV Data is NULL\n", __FUNCTION__);
++ memset(pPhase1OpData, 0, sizeof(CpaCyDhPhase1KeyGenOpData));
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++ } else {
++ APRINTK("%s(): Diffie Hellman Phase1 Key Gen failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ }
++
++ icp_ocfDrvSwapBytes(pLocalOctetStringPV->pData,
++ pLocalOctetStringPV->dataLenInBytes);
++
++ icp_ocfDrvFreeFlatBuffer(pLocalOctetStringPV);
++ memset(pPhase1OpData, 0, sizeof(CpaCyDhPhase1KeyGenOpData));
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++
++ crypto_kdone(krp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvModExpCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the Mod Exp operation.
++ */
++static void
++icp_ocfDrvModExpCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpdata, CpaFlatBuffer * pResult)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyLnModExpOpData *pLnModExpOpData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpdata) {
++ DPRINTK("%s(): Invalid Mod Exp input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pLnModExpOpData = (CpaCyLnModExpOpData *) pOpdata;
++
++ if (NULL == pResult) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "pResult data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ memset(pLnModExpOpData, 0, sizeof(CpaCyLnModExpOpData));
++ kmem_cache_free(drvLnModExp_zone, pLnModExpOpData);
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++ } else {
++ APRINTK("%s(): LAC Mod Exp Operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ }
++
++ icp_ocfDrvSwapBytes(pResult->pData, pResult->dataLenInBytes);
++
++ /*switch base size value back to original */
++ if (pLnModExpOpData->base.pData ==
++ (uint8_t *) & (krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].
++ crp_nbits)) {
++ *((uint32_t *) pLnModExpOpData->base.pData) =
++ ntohl(*((uint32_t *) pLnModExpOpData->base.pData));
++ }
++ icp_ocfDrvFreeFlatBuffer(pResult);
++ memset(pLnModExpOpData, 0, sizeof(CpaCyLnModExpOpData));
++ kmem_cache_free(drvLnModExp_zone, pLnModExpOpData);
++
++ crypto_kdone(krp);
++
++ return;
++
++}
++
++/* Name : icp_ocfDrvModExpCRTCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the Mod Exp CRT operation.
++ */
++static void
++icp_ocfDrvModExpCRTCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pOutputData)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyRsaDecryptOpData *pDecryptData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pDecryptData = (CpaCyRsaDecryptOpData *) pOpData;
++
++ if (NULL == pOutputData) {
++ DPRINTK("%s(): Invalid input parameter - "
++ "pOutputData is NULL\n", __FUNCTION__);
++ memset(pDecryptData->pRecipientPrivateKey, 0,
++ sizeof(CpaCyRsaPrivateKey));
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ pDecryptData->pRecipientPrivateKey);
++ memset(pDecryptData, 0, sizeof(CpaCyRsaDecryptOpData));
++ kmem_cache_free(drvRSADecrypt_zone, pDecryptData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++ } else {
++ APRINTK("%s(): LAC Mod Exp CRT operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ }
++
++ icp_ocfDrvSwapBytes(pOutputData->pData, pOutputData->dataLenInBytes);
++
++ icp_ocfDrvFreeFlatBuffer(pOutputData);
++ memset(pDecryptData->pRecipientPrivateKey, 0,
++ sizeof(CpaCyRsaPrivateKey));
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ pDecryptData->pRecipientPrivateKey);
++ memset(pDecryptData, 0, sizeof(CpaCyRsaDecryptOpData));
++ kmem_cache_free(drvRSADecrypt_zone, pDecryptData);
++
++ crypto_kdone(krp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvDsaRSSignCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the DSA RS sign operation.
++ */
++static void
++icp_ocfDrvDsaRSSignCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData,
++ CpaBoolean protocolStatus,
++ CpaFlatBuffer * pR, CpaFlatBuffer * pS)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyDsaRSSignOpData *pSignData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pSignData = (CpaCyDsaRSSignOpData *) pOpData;
++
++ if (NULL == pR) {
++ DPRINTK("%s(): Invalid input parameter - "
++ "pR sign is NULL\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ kmem_cache_free(drvDSARSSign_zone, pSignData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (NULL == pS) {
++ DPRINTK("%s(): Invalid input parameter - "
++ "pS sign is NULL\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSign_zone, pSignData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS != status) {
++ APRINTK("%s(): LAC DSA RS Sign operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ } else {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++
++ if (CPA_TRUE != protocolStatus) {
++ DPRINTK("%s(): LAC DSA RS Sign operation failed due "
++ "to protocol error\n", __FUNCTION__);
++ krp->krp_status = EIO;
++ }
++ }
++
++ /* Swap bytes only when the callback status is successful and
++ protocolStatus is set to true */
++ if (CPA_STATUS_SUCCESS == status && CPA_TRUE == protocolStatus) {
++ icp_ocfDrvSwapBytes(pR->pData, pR->dataLenInBytes);
++ icp_ocfDrvSwapBytes(pS->pData, pS->dataLenInBytes);
++ }
++
++ icp_ocfDrvFreeFlatBuffer(pR);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ memset(pSignData->K.pData, 0, pSignData->K.dataLenInBytes);
++ kmem_cache_free(drvDSARSSignKValue_zone, pSignData->K.pData);
++ memset(pSignData, 0, sizeof(CpaCyDsaRSSignOpData));
++ kmem_cache_free(drvDSARSSign_zone, pSignData);
++ crypto_kdone(krp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvDsaVerifyCallback
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the DSA Verify operation.
++ */
++static void
++icp_ocfDrvDsaVerifyCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaBoolean verifyStatus)
++{
++
++ struct cryptkop *krp = NULL;
++ CpaCyDsaVerifyOpData *pVerData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pVerData = (CpaCyDsaVerifyOpData *) pOpData;
++
++ if (CPA_STATUS_SUCCESS != status) {
++ APRINTK("%s(): LAC DSA Verify operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ } else {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++
++ if (CPA_TRUE != verifyStatus) {
++ DPRINTK("%s(): DSA signature invalid\n", __FUNCTION__);
++ krp->krp_status = EIO;
++ }
++ }
++
++ /* Swap bytes only when the callback status is successful and
++ verifyStatus is set to true */
++ /*Just swapping back the key values for now. Possibly all
++ swapped buffers need to be reverted */
++ if (CPA_STATUS_SUCCESS == status && CPA_TRUE == verifyStatus) {
++ icp_ocfDrvSwapBytes(pVerData->R.pData,
++ pVerData->R.dataLenInBytes);
++ icp_ocfDrvSwapBytes(pVerData->S.pData,
++ pVerData->S.dataLenInBytes);
++ }
++
++ memset(pVerData, 0, sizeof(CpaCyDsaVerifyOpData));
++ kmem_cache_free(drvDSAVerify_zone, pVerData);
++ crypto_kdone(krp);
++
++ return;
++}
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_common.c linux-2.6.27.10/crypto/ocf/ep80579/icp_common.c
+--- linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_common.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ep80579/icp_common.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,891 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++
++/*
++ * An OCF module that uses Intel® QuickAssist Integrated Accelerator to do the
++ * crypto.
++ *
++ * This driver requires the ICP Access Library that is available from Intel in
++ * order to operate.
++ */
++
++#include "icp_ocf.h"
++
++#define ICP_OCF_COMP_NAME "ICP_OCF"
++#define ICP_OCF_VER_MAIN (2)
++#define ICP_OCF_VER_MJR (0)
++#define ICP_OCF_VER_MNR (0)
++
++#define MAX_DEREG_RETRIES (100)
++#define DEFAULT_DEREG_RETRIES (10)
++#define DEFAULT_DEREG_DELAY_IN_JIFFIES (10)
++
++/* This defines the maximum number of sessions possible between OCF
++ and the OCF Tolapai Driver. If set to zero, there is no limit. */
++#define DEFAULT_OCF_TO_DRV_MAX_SESSION_COUNT (0)
++#define NUM_SUPPORTED_CAPABILITIES (21)
++
++/*Slabs zones*/
++struct kmem_cache *drvSessionData_zone = NULL;
++struct kmem_cache *drvOpData_zone = NULL;
++struct kmem_cache *drvDH_zone = NULL;
++struct kmem_cache *drvLnModExp_zone = NULL;
++struct kmem_cache *drvRSADecrypt_zone = NULL;
++struct kmem_cache *drvRSAPrivateKey_zone = NULL;
++struct kmem_cache *drvDSARSSign_zone = NULL;
++struct kmem_cache *drvDSARSSignKValue_zone = NULL;
++struct kmem_cache *drvDSAVerify_zone = NULL;
++
++/*Slab zones for flatbuffers and bufferlist*/
++struct kmem_cache *drvFlatBuffer_zone = NULL;
++
++static int icp_ocfDrvInit(void);
++static void icp_ocfDrvExit(void);
++static void icp_ocfDrvFreeCaches(void);
++static void icp_ocfDrvDeferedFreeLacSessionProcess(void *arg);
++
++int32_t icp_ocfDrvDriverId = INVALID_DRIVER_ID;
++
++/* Module parameter - gives the number of times LAC deregistration shall be
++ re-tried */
++int num_dereg_retries = DEFAULT_DEREG_RETRIES;
++
++/* Module parameter - gives the delay time in jiffies before a LAC session
++ shall be attempted to be deregistered again */
++int dereg_retry_delay_in_jiffies = DEFAULT_DEREG_DELAY_IN_JIFFIES;
++
++/* Module parameter - gives the maximum number of sessions possible between
++ OCF and the OCF Tolapai Driver. If set to zero, there is no limit.*/
++int max_sessions = DEFAULT_OCF_TO_DRV_MAX_SESSION_COUNT;
++
++/* This is set when the module is removed from the system, no further
++ processing can take place if this is set */
++atomic_t icp_ocfDrvIsExiting = ATOMIC_INIT(0);
++
++/* This is used to show how many lac sessions were not deregistered*/
++atomic_t lac_session_failed_dereg_count = ATOMIC_INIT(0);
++
++/* This is used to track the number of registered sessions between OCF and
++ * and the OCF Tolapai driver, when max_session is set to value other than
++ * zero. This ensures that the max_session set for the OCF and the driver
++ * is equal to the LAC registered sessions */
++atomic_t num_ocf_to_drv_registered_sessions = ATOMIC_INIT(0);
++
++/* Head of linked list used to store session data */
++struct list_head icp_ocfDrvGlobalSymListHead;
++struct list_head icp_ocfDrvGlobalSymListHead_FreeMemList;
++
++spinlock_t icp_ocfDrvSymSessInfoListSpinlock = SPIN_LOCK_UNLOCKED;
++rwlock_t icp_kmem_cache_destroy_alloc_lock = RW_LOCK_UNLOCKED;
++
++struct workqueue_struct *icp_ocfDrvFreeLacSessionWorkQ;
++
++struct icp_drvBuffListInfo defBuffListInfo;
++
++static struct {
++ softc_device_decl sc_dev;
++} icpDev;
++
++static device_method_t icp_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, icp_ocfDrvNewSession),
++ DEVMETHOD(cryptodev_freesession, icp_ocfDrvFreeLACSession),
++ DEVMETHOD(cryptodev_process, icp_ocfDrvSymProcess),
++ DEVMETHOD(cryptodev_kprocess, icp_ocfDrvPkeProcess),
++};
++
++module_param(num_dereg_retries, int, S_IRUGO);
++module_param(dereg_retry_delay_in_jiffies, int, S_IRUGO);
++module_param(max_sessions, int, S_IRUGO);
++
++MODULE_PARM_DESC(num_dereg_retries,
++ "Number of times to retry LAC Sym Session Deregistration. "
++ "Default 10, Max 100");
++MODULE_PARM_DESC(dereg_retry_delay_in_jiffies, "Delay in jiffies "
++ "(added to a schedule() function call) before a LAC Sym "
++ "Session Dereg is retried. Default 10");
++MODULE_PARM_DESC(max_sessions, "This sets the maximum number of sessions "
++ "between OCF and this driver. If this value is set to zero, "
++ "max session count checking is disabled. Default is zero(0)");
++
++/* Name : icp_ocfDrvInit
++ *
++ * Description : This function will register all the symmetric and asymmetric
++ * functionality that will be accelerated by the hardware. It will also
++ * get a unique driver ID from the OCF and initialise all slab caches
++ */
++static int __init icp_ocfDrvInit(void)
++{
++ int ocfStatus = 0;
++
++ IPRINTK("=== %s ver %d.%d.%d ===\n", ICP_OCF_COMP_NAME,
++ ICP_OCF_VER_MAIN, ICP_OCF_VER_MJR, ICP_OCF_VER_MNR);
++
++ if (MAX_DEREG_RETRIES < num_dereg_retries) {
++ EPRINTK("Session deregistration retry count set to greater "
++ "than %d", MAX_DEREG_RETRIES);
++ return -1;
++ }
++
++ /* Initialize and Start the Cryptographic component */
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyStartInstance(CPA_INSTANCE_HANDLE_SINGLE)) {
++ EPRINTK("Failed to initialize and start the instance "
++ "of the Cryptographic component.\n");
++ return -1;
++ }
++
++ /* Set the default size of BufferList to allocate */
++ memset(&defBuffListInfo, 0, sizeof(struct icp_drvBuffListInfo));
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvBufferListMemInfo(ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS,
++ &defBuffListInfo)) {
++ EPRINTK("Failed to get bufferlist memory info.\n");
++ return -1;
++ }
++
++ /*Register OCF Tolapai Driver with OCF */
++ memset(&icpDev, 0, sizeof(icpDev));
++ softc_device_init(&icpDev, "icp", 0, icp_methods);
++
++ icp_ocfDrvDriverId = crypto_get_driverid(softc_get_device(&icpDev),
++ CRYPTOCAP_F_HARDWARE);
++
++ if (icp_ocfDrvDriverId < 0) {
++ EPRINTK("%s : ICP driver failed to register with OCF!\n",
++ __FUNCTION__);
++ return -ENODEV;
++ }
++
++ /*Create all the slab caches used by the OCF Tolapai Driver */
++ drvSessionData_zone =
++ ICP_CACHE_CREATE("ICP Session Data", struct icp_drvSessionData);
++ ICP_CACHE_NULL_CHECK(drvSessionData_zone);
++
++ /*
++ * Allocation of the OpData includes the allocation space for meta data.
++ * The memory after the opData structure is reserved for this meta data.
++ */
++ drvOpData_zone =
++ kmem_cache_create("ICP Op Data", sizeof(struct icp_drvOpData) +
++ defBuffListInfo.metaSize ,0, SLAB_HWCACHE_ALIGN, NULL, NULL);
++
++
++ ICP_CACHE_NULL_CHECK(drvOpData_zone);
++
++ drvDH_zone = ICP_CACHE_CREATE("ICP DH data", CpaCyDhPhase1KeyGenOpData);
++ ICP_CACHE_NULL_CHECK(drvDH_zone);
++
++ drvLnModExp_zone =
++ ICP_CACHE_CREATE("ICP ModExp data", CpaCyLnModExpOpData);
++ ICP_CACHE_NULL_CHECK(drvLnModExp_zone);
++
++ drvRSADecrypt_zone =
++ ICP_CACHE_CREATE("ICP RSA decrypt data", CpaCyRsaDecryptOpData);
++ ICP_CACHE_NULL_CHECK(drvRSADecrypt_zone);
++
++ drvRSAPrivateKey_zone =
++ ICP_CACHE_CREATE("ICP RSA private key data", CpaCyRsaPrivateKey);
++ ICP_CACHE_NULL_CHECK(drvRSAPrivateKey_zone);
++
++ drvDSARSSign_zone =
++ ICP_CACHE_CREATE("ICP DSA Sign", CpaCyDsaRSSignOpData);
++ ICP_CACHE_NULL_CHECK(drvDSARSSign_zone);
++
++ /*too awkward to use a macro here */
++ drvDSARSSignKValue_zone =
++ kmem_cache_create("ICP DSA Sign Rand Val",
++ DSA_RS_SIGN_PRIMEQ_SIZE_IN_BYTES, 0,
++ SLAB_HWCACHE_ALIGN, NULL, NULL);
++ ICP_CACHE_NULL_CHECK(drvDSARSSignKValue_zone);
++
++ drvDSAVerify_zone =
++ ICP_CACHE_CREATE("ICP DSA Verify", CpaCyDsaVerifyOpData);
++ ICP_CACHE_NULL_CHECK(drvDSAVerify_zone);
++
++ drvFlatBuffer_zone =
++ ICP_CACHE_CREATE("ICP Flat Buffers", CpaFlatBuffer);
++ ICP_CACHE_NULL_CHECK(drvFlatBuffer_zone);
++
++ /* Register the ICP symmetric crypto support. */
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_NULL_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_DES_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_3DES_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_AES_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_ARC4);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_MD5);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_MD5_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA1);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA1_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_256);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_256_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_384);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_384_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_512);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_512_HMAC);
++
++ /* Register the ICP asymmetric algorithm support */
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_DH_COMPUTE_KEY);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_MOD_EXP);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_MOD_EXP_CRT);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_DSA_SIGN);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_DSA_VERIFY);
++
++ /* Register the ICP random number generator support */
++ if (OCF_REGISTRATION_STATUS_SUCCESS ==
++ crypto_rregister(icp_ocfDrvDriverId, icp_ocfDrvReadRandom, NULL)) {
++ ocfStatus++;
++ }
++
++ if (OCF_ZERO_FUNCTIONALITY_REGISTERED == ocfStatus) {
++ DPRINTK("%s: Failed to register any device capabilities\n",
++ __FUNCTION__);
++ icp_ocfDrvFreeCaches();
++ icp_ocfDrvDriverId = INVALID_DRIVER_ID;
++ return -ECANCELED;
++ }
++
++ DPRINTK("%s: Registered %d of %d device capabilities\n",
++ __FUNCTION__, ocfStatus, NUM_SUPPORTED_CAPABILITIES);
++
++/*Session data linked list used during module exit*/
++ INIT_LIST_HEAD(&icp_ocfDrvGlobalSymListHead);
++ INIT_LIST_HEAD(&icp_ocfDrvGlobalSymListHead_FreeMemList);
++
++ icp_ocfDrvFreeLacSessionWorkQ =
++ create_singlethread_workqueue("ocfLacDeregWorkQueue");
++
++ return 0;
++}
++
++/* Name : icp_ocfDrvExit
++ *
++ * Description : This function will deregister all the symmetric sessions
++ * registered with the LAC component. It will also deregister all symmetric
++ * and asymmetric functionality that can be accelerated by the hardware via OCF
++ * and random number generation if it is enabled.
++ */
++static void icp_ocfDrvExit(void)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ struct icp_drvSessionData *sessionData = NULL;
++ struct icp_drvSessionData *tempSessionData = NULL;
++ int i, remaining_delay_time_in_jiffies = 0;
++ /* There is a possibility of a process or new session command being */
++ /* sent before this variable is incremented. The aim of this variable */
++ /* is to stop a loop of calls creating a deadlock situation which */
++ /* would prevent the driver from exiting. */
++
++ atomic_inc(&icp_ocfDrvIsExiting);
++
++ /*Existing sessions will be routed to another driver after these calls */
++ crypto_unregister_all(icp_ocfDrvDriverId);
++ crypto_runregister_all(icp_ocfDrvDriverId);
++
++ /*If any sessions are waiting to be deregistered, do that. This also
++ flushes the work queue */
++ destroy_workqueue(icp_ocfDrvFreeLacSessionWorkQ);
++
++ /*ENTER CRITICAL SECTION */
++ spin_lock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++ list_for_each_entry_safe(tempSessionData, sessionData,
++ &icp_ocfDrvGlobalSymListHead, listNode) {
++ for (i = 0; i < num_dereg_retries; i++) {
++ /*No harm if bad input - LAC will handle error cases */
++ if (ICP_SESSION_RUNNING == tempSessionData->inUse) {
++ lacStatus =
++ cpaCySymRemoveSession
++ (CPA_INSTANCE_HANDLE_SINGLE,
++ tempSessionData->sessHandle);
++ if (CPA_STATUS_SUCCESS == lacStatus) {
++ /* Succesfully deregistered */
++ break;
++ } else if (CPA_STATUS_RETRY != lacStatus) {
++ atomic_inc
++ (&lac_session_failed_dereg_count);
++ break;
++ }
++
++ /*schedule_timout returns the time left for completion if
++ * this task is set to TASK_INTERRUPTIBLE */
++ remaining_delay_time_in_jiffies =
++ dereg_retry_delay_in_jiffies;
++ while (0 > remaining_delay_time_in_jiffies) {
++ remaining_delay_time_in_jiffies =
++ schedule_timeout
++ (remaining_delay_time_in_jiffies);
++ }
++
++ DPRINTK
++ ("%s(): Retry %d to deregistrate the session\n",
++ __FUNCTION__, i);
++ }
++ }
++
++ /*remove from current list */
++ list_del(&(tempSessionData->listNode));
++ /*add to free mem linked list */
++ list_add(&(tempSessionData->listNode),
++ &icp_ocfDrvGlobalSymListHead_FreeMemList);
++
++ }
++
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ /*set back to initial values */
++ sessionData = NULL;
++ /*still have a reference in our list! */
++ tempSessionData = NULL;
++ /*free memory */
++ list_for_each_entry_safe(tempSessionData, sessionData,
++ &icp_ocfDrvGlobalSymListHead_FreeMemList,
++ listNode) {
++
++ list_del(&(tempSessionData->listNode));
++ /* Free allocated CpaCySymSessionCtx */
++ if (NULL != tempSessionData->sessHandle) {
++ kfree(tempSessionData->sessHandle);
++ }
++ memset(tempSessionData, 0, sizeof(struct icp_drvSessionData));
++ kmem_cache_free(drvSessionData_zone, tempSessionData);
++ }
++
++ if (0 != atomic_read(&lac_session_failed_dereg_count)) {
++ DPRINTK("%s(): %d LAC sessions were not deregistered "
++ "correctly. This is not a clean exit! \n",
++ __FUNCTION__,
++ atomic_read(&lac_session_failed_dereg_count));
++ }
++
++ icp_ocfDrvFreeCaches();
++ icp_ocfDrvDriverId = INVALID_DRIVER_ID;
++
++ /* Shutdown the Cryptographic component */
++ lacStatus = cpaCyStopInstance(CPA_INSTANCE_HANDLE_SINGLE);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ DPRINTK("%s(): Failed to stop instance of the "
++ "Cryptographic component.(status == %d)\n",
++ __FUNCTION__, lacStatus);
++ }
++
++}
++
++/* Name : icp_ocfDrvFreeCaches
++ *
++ * Description : This function deregisters all slab caches
++ */
++static void icp_ocfDrvFreeCaches(void)
++{
++ if (atomic_read(&icp_ocfDrvIsExiting) != CPA_TRUE) {
++ atomic_set(&icp_ocfDrvIsExiting, 1);
++ }
++
++ /*Sym Zones */
++ ICP_CACHE_DESTROY(drvSessionData_zone);
++ ICP_CACHE_DESTROY(drvOpData_zone);
++
++ /*Asym zones */
++ ICP_CACHE_DESTROY(drvDH_zone);
++ ICP_CACHE_DESTROY(drvLnModExp_zone);
++ ICP_CACHE_DESTROY(drvRSADecrypt_zone);
++ ICP_CACHE_DESTROY(drvRSAPrivateKey_zone);
++ ICP_CACHE_DESTROY(drvDSARSSignKValue_zone);
++ ICP_CACHE_DESTROY(drvDSARSSign_zone);
++ ICP_CACHE_DESTROY(drvDSAVerify_zone);
++
++ /*FlatBuffer and BufferList Zones */
++ ICP_CACHE_DESTROY(drvFlatBuffer_zone);
++
++}
++
++/* Name : icp_ocfDrvDeregRetry
++ *
++ * Description : This function will try to farm the session deregistration
++ * off to a work queue. If it fails, nothing more can be done and it
++ * returns an error
++ */
++
++int icp_ocfDrvDeregRetry(CpaCySymSessionCtx sessionToDeregister)
++{
++ struct icp_ocfDrvFreeLacSession *workstore = NULL;
++
++ DPRINTK("%s(): Retry - Deregistering session (%p)\n",
++ __FUNCTION__, sessionToDeregister);
++
++ /*make sure the session is not available to be allocated during this
++ process */
++ atomic_inc(&lac_session_failed_dereg_count);
++
++ /*Farm off to work queue */
++ workstore =
++ kmalloc(sizeof(struct icp_ocfDrvFreeLacSession), GFP_ATOMIC);
++ if (NULL == workstore) {
++ DPRINTK("%s(): unable to free session - no memory available "
++ "for work queue\n", __FUNCTION__);
++ return ENOMEM;
++ }
++
++ workstore->sessionToDeregister = sessionToDeregister;
++
++ INIT_WORK(&(workstore->work), icp_ocfDrvDeferedFreeLacSessionProcess,
++ workstore);
++ queue_work(icp_ocfDrvFreeLacSessionWorkQ, &(workstore->work));
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++
++}
++
++/* Name : icp_ocfDrvDeferedFreeLacSessionProcess
++ *
++ * Description : This function will retry (module input parameter)
++ * 'num_dereg_retries' times to deregister any symmetric session that recieves a
++ * CPA_STATUS_RETRY message from the LAC component. This function is run in
++ * Thread context because it is called from a worker thread
++ */
++static void icp_ocfDrvDeferedFreeLacSessionProcess(void *arg)
++{
++ struct icp_ocfDrvFreeLacSession *workstore = NULL;
++ CpaCySymSessionCtx sessionToDeregister = NULL;
++ int i = 0;
++ int remaining_delay_time_in_jiffies = 0;
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++
++ workstore = (struct icp_ocfDrvFreeLacSession *)arg;
++ if (NULL == workstore) {
++ DPRINTK("%s() function called with null parameter \n",
++ __FUNCTION__);
++ return;
++ }
++
++ sessionToDeregister = workstore->sessionToDeregister;
++ kfree(workstore);
++
++ /*if exiting, give deregistration one more blast only */
++ if (atomic_read(&icp_ocfDrvIsExiting) == CPA_TRUE) {
++ lacStatus = cpaCySymRemoveSession(CPA_INSTANCE_HANDLE_SINGLE,
++ sessionToDeregister);
++
++ if (lacStatus != CPA_STATUS_SUCCESS) {
++ DPRINTK("%s() Failed to Dereg LAC session %p "
++ "during module exit\n", __FUNCTION__,
++ sessionToDeregister);
++ return;
++ }
++
++ atomic_dec(&lac_session_failed_dereg_count);
++ return;
++ }
++
++ for (i = 0; i <= num_dereg_retries; i++) {
++ lacStatus = cpaCySymRemoveSession(CPA_INSTANCE_HANDLE_SINGLE,
++ sessionToDeregister);
++
++ if (lacStatus == CPA_STATUS_SUCCESS) {
++ atomic_dec(&lac_session_failed_dereg_count);
++ return;
++ }
++ if (lacStatus != CPA_STATUS_RETRY) {
++ DPRINTK("%s() Failed to deregister session - lacStatus "
++ " = %d", __FUNCTION__, lacStatus);
++ break;
++ }
++
++ /*schedule_timout returns the time left for completion if this
++ task is set to TASK_INTERRUPTIBLE */
++ remaining_delay_time_in_jiffies = dereg_retry_delay_in_jiffies;
++ while (0 > remaining_delay_time_in_jiffies) {
++ remaining_delay_time_in_jiffies =
++ schedule_timeout(remaining_delay_time_in_jiffies);
++ }
++
++ }
++
++ DPRINTK("%s(): Unable to deregister session\n", __FUNCTION__);
++ DPRINTK("%s(): Number of unavailable LAC sessions = %d\n", __FUNCTION__,
++ atomic_read(&lac_session_failed_dereg_count));
++}
++
++/* Name : icp_ocfDrvPtrAndLenToFlatBuffer
++ *
++ * Description : This function converts a "pointer and length" buffer
++ * structure to Fredericksburg Flat Buffer (CpaFlatBuffer) format.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++inline void
++icp_ocfDrvPtrAndLenToFlatBuffer(void *pData, uint32_t len,
++ CpaFlatBuffer * pFlatBuffer)
++{
++ pFlatBuffer->pData = pData;
++ pFlatBuffer->dataLenInBytes = len;
++}
++
++/* Name : icp_ocfDrvSingleSkBuffToFlatBuffer
++ *
++ * Description : This function converts a single socket buffer (sk_buff)
++ * structure to a Fredericksburg Flat Buffer (CpaFlatBuffer) format.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++static inline void
++icp_ocfDrvSingleSkBuffToFlatBuffer(struct sk_buff *pSkb,
++ CpaFlatBuffer * pFlatBuffer)
++{
++ pFlatBuffer->pData = pSkb->data;
++ pFlatBuffer->dataLenInBytes = skb_headlen(pSkb);
++}
++
++/* Name : icp_ocfDrvSkBuffToBufferList
++ *
++ * Description : This function converts a socket buffer (sk_buff) structure to
++ * Fredericksburg Scatter/Gather (CpaBufferList) buffer format.
++ *
++ * This function assumes that the bufferlist has been allocated with the correct
++ * number of buffer arrays.
++ *
++ */
++inline int
++icp_ocfDrvSkBuffToBufferList(struct sk_buff *pSkb, CpaBufferList * bufferList)
++{
++ CpaFlatBuffer *curFlatBuffer = NULL;
++ char *skbuffPageAddr = NULL;
++ struct sk_buff *pCurFrag = NULL;
++ struct skb_shared_info *pShInfo = NULL;
++ uint32_t page_offset = 0, i = 0;
++
++ DPRINTK("%s(): Entry Point\n", __FUNCTION__);
++
++ /*
++ * In all cases, the first skb needs to be translated to FlatBuffer.
++ * Perform a buffer translation for the first skbuff
++ */
++ curFlatBuffer = bufferList->pBuffers;
++ icp_ocfDrvSingleSkBuffToFlatBuffer(pSkb, curFlatBuffer);
++
++ /* Set the userData to point to the original sk_buff */
++ bufferList->pUserData = (void *)pSkb;
++
++ /* We now know we'll have at least one element in the SGL */
++ bufferList->numBuffers = 1;
++
++ if (0 == skb_is_nonlinear(pSkb)) {
++ /* Is a linear buffer - therefore it's a single skbuff */
++ DPRINTK("%s(): Exit Point\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++ }
++
++ curFlatBuffer++;
++ pShInfo = skb_shinfo(pSkb);
++ if (pShInfo->frag_list != NULL && pShInfo->nr_frags != 0) {
++ EPRINTK("%s():"
++ "Translation for a combination of frag_list "
++ "and frags[] array not supported!\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ } else if (pShInfo->frag_list != NULL) {
++ /*
++ * Non linear skbuff supported through frag_list
++ * Perform translation for each fragment (sk_buff)
++ * in the frag_list of the first sk_buff.
++ */
++ for (pCurFrag = pShInfo->frag_list;
++ pCurFrag != NULL; pCurFrag = pCurFrag->next) {
++ icp_ocfDrvSingleSkBuffToFlatBuffer(pCurFrag,
++ curFlatBuffer);
++ curFlatBuffer++;
++ bufferList->numBuffers++;
++ }
++ } else if (pShInfo->nr_frags != 0) {
++ /*
++ * Perform translation for each fragment in frags array
++ * and add to the BufferList
++ */
++ for (i = 0; i < pShInfo->nr_frags; i++) {
++ /* Get the page address and offset of this frag */
++ skbuffPageAddr = (char *)pShInfo->frags[i].page;
++ page_offset = pShInfo->frags[i].page_offset;
++
++ /* Convert a pointer and length to a flat buffer */
++ icp_ocfDrvPtrAndLenToFlatBuffer(skbuffPageAddr +
++ page_offset,
++ pShInfo->frags[i].size,
++ curFlatBuffer);
++ curFlatBuffer++;
++ bufferList->numBuffers++;
++ }
++ } else {
++ EPRINTK("%s():" "Could not recognize skbuff fragments!\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ DPRINTK("%s(): Exit Point\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvBufferListToSkBuff
++ *
++ * Description : This function converts a Fredericksburg Scatter/Gather
++ * (CpaBufferList) buffer format to socket buffer structure.
++ */
++inline int
++icp_ocfDrvBufferListToSkBuff(CpaBufferList * bufferList, struct sk_buff **skb)
++{
++ DPRINTK("%s(): Entry Point\n", __FUNCTION__);
++
++ /* Retrieve the orignal skbuff */
++ *skb = (struct sk_buff *)bufferList->pUserData;
++ if (NULL == *skb) {
++ EPRINTK("%s():"
++ "Error on converting from a BufferList. "
++ "The BufferList does not contain an sk_buff.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++ DPRINTK("%s(): Exit Point\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvPtrAndLenToBufferList
++ *
++ * Description : This function converts a "pointer and length" buffer
++ * structure to Fredericksburg Scatter/Gather Buffer (CpaBufferList) format.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++inline void
++icp_ocfDrvPtrAndLenToBufferList(void *pDataIn, uint32_t length,
++ CpaBufferList * pBufferList)
++{
++ pBufferList->numBuffers = 1;
++ pBufferList->pBuffers->pData = pDataIn;
++ pBufferList->pBuffers->dataLenInBytes = length;
++}
++
++/* Name : icp_ocfDrvBufferListToPtrAndLen
++ *
++ * Description : This function converts Fredericksburg Scatter/Gather Buffer
++ * (CpaBufferList) format to a "pointer and length" buffer structure.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++inline void
++icp_ocfDrvBufferListToPtrAndLen(CpaBufferList * pBufferList,
++ void **ppDataOut, uint32_t * pLength)
++{
++ *ppDataOut = pBufferList->pBuffers->pData;
++ *pLength = pBufferList->pBuffers->dataLenInBytes;
++}
++
++/* Name : icp_ocfDrvBufferListMemInfo
++ *
++ * Description : This function will set the number of flat buffers in
++ * bufferlist, the size of memory to allocate for the pPrivateMetaData
++ * member of the CpaBufferList.
++ */
++int
++icp_ocfDrvBufferListMemInfo(uint16_t numBuffers,
++ struct icp_drvBuffListInfo *buffListInfo)
++{
++ buffListInfo->numBuffers = numBuffers;
++
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyBufferListGetMetaSize(CPA_INSTANCE_HANDLE_SINGLE,
++ buffListInfo->numBuffers,
++ &(buffListInfo->metaSize))) {
++ EPRINTK("%s() Failed to get buffer list meta size.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvGetSkBuffFrags
++ *
++ * Description : This function will determine the number of
++ * fragments in a socket buffer(sk_buff).
++ */
++inline uint16_t icp_ocfDrvGetSkBuffFrags(struct sk_buff * pSkb)
++{
++ uint16_t numFrags = 0;
++ struct sk_buff *pCurFrag = NULL;
++ struct skb_shared_info *pShInfo = NULL;
++
++ if (NULL == pSkb)
++ return 0;
++
++ numFrags = 1;
++ if (0 == skb_is_nonlinear(pSkb)) {
++ /* Linear buffer - it's a single skbuff */
++ return numFrags;
++ }
++
++ pShInfo = skb_shinfo(pSkb);
++ if (NULL != pShInfo->frag_list && 0 != pShInfo->nr_frags) {
++ EPRINTK("%s(): Combination of frag_list "
++ "and frags[] array not supported!\n", __FUNCTION__);
++ return 0;
++ } else if (0 != pShInfo->nr_frags) {
++ numFrags += pShInfo->nr_frags;
++ return numFrags;
++ } else if (NULL != pShInfo->frag_list) {
++ for (pCurFrag = pShInfo->frag_list;
++ pCurFrag != NULL; pCurFrag = pCurFrag->next) {
++ numFrags++;
++ }
++ return numFrags;
++ } else {
++ return 0;
++ }
++}
++
++/* Name : icp_ocfDrvFreeFlatBuffer
++ *
++ * Description : This function will deallocate flat buffer.
++ */
++inline void icp_ocfDrvFreeFlatBuffer(CpaFlatBuffer * pFlatBuffer)
++{
++ if (pFlatBuffer != NULL) {
++ memset(pFlatBuffer, 0, sizeof(CpaFlatBuffer));
++ kmem_cache_free(drvFlatBuffer_zone, pFlatBuffer);
++ }
++}
++
++/* Name : icp_ocfDrvAllocMetaData
++ *
++ * Description : This function will allocate memory for the
++ * pPrivateMetaData member of CpaBufferList.
++ */
++inline int
++icp_ocfDrvAllocMetaData(CpaBufferList * pBufferList,
++ const struct icp_drvOpData *pOpData)
++{
++ Cpa32U metaSize = 0;
++
++ if (pBufferList->numBuffers <= ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS){
++ void *pOpDataStartAddr = (void *)pOpData;
++
++ if (0 == defBuffListInfo.metaSize) {
++ pBufferList->pPrivateMetaData = NULL;
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++ }
++ /*
++ * The meta data allocation has been included as part of the
++ * op data. It has been pre-allocated in memory just after the
++ * icp_drvOpData structure.
++ */
++ pBufferList->pPrivateMetaData = pOpDataStartAddr +
++ sizeof(struct icp_drvOpData);
++ } else {
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyBufferListGetMetaSize(CPA_INSTANCE_HANDLE_SINGLE,
++ pBufferList->numBuffers,
++ &metaSize)) {
++ EPRINTK("%s() Failed to get buffer list meta size.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ if (0 == metaSize) {
++ pBufferList->pPrivateMetaData = NULL;
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++ }
++
++ pBufferList->pPrivateMetaData = kmalloc(metaSize, GFP_ATOMIC);
++ }
++ if (NULL == pBufferList->pPrivateMetaData) {
++ EPRINTK("%s() Failed to allocate pPrivateMetaData.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvFreeMetaData
++ *
++ * Description : This function will deallocate pPrivateMetaData memory.
++ */
++inline void icp_ocfDrvFreeMetaData(CpaBufferList * pBufferList)
++{
++ if (NULL == pBufferList->pPrivateMetaData) {
++ return;
++ }
++
++ /*
++ * Only free the meta data if the BufferList has more than
++ * ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS number of buffers.
++ * Otherwise, the meta data shall be freed when the icp_drvOpData is
++ * freed.
++ */
++ if (ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS < pBufferList->numBuffers){
++ kfree(pBufferList->pPrivateMetaData);
++ }
++}
++
++module_init(icp_ocfDrvInit);
++module_exit(icp_ocfDrvExit);
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("Intel");
++MODULE_DESCRIPTION("OCF Driver for Intel Quick Assist crypto acceleration");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_ocf.h linux-2.6.27.10/crypto/ocf/ep80579/icp_ocf.h
+--- linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_ocf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ep80579/icp_ocf.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,363 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++
++/*
++ * OCF drv driver header file for the Intel ICP processor.
++ */
++
++#ifndef ICP_OCF_H
++#define ICP_OCF_H
++
++#include <linux/crypto.h>
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++
++#include "cryptodev.h"
++#include "uio.h"
++
++#include "cpa.h"
++#include "cpa_cy_im.h"
++#include "cpa_cy_sym.h"
++#include "cpa_cy_rand.h"
++#include "cpa_cy_dh.h"
++#include "cpa_cy_rsa.h"
++#include "cpa_cy_ln.h"
++#include "cpa_cy_common.h"
++#include "cpa_cy_dsa.h"
++
++#define NUM_BITS_IN_BYTE (8)
++#define NUM_BITS_IN_BYTE_MINUS_ONE (NUM_BITS_IN_BYTE -1)
++#define INVALID_DRIVER_ID (-1)
++#define RETURN_RAND_NUM_GEN_FAILED (-1)
++
++/*This is define means only one operation can be chained to another
++(resulting in one chain of two operations)*/
++#define MAX_NUM_OF_CHAINED_OPS (1)
++/*This is the max block cipher initialisation vector*/
++#define MAX_IV_LEN_IN_BYTES (20)
++/*This is used to check whether the OCF to this driver session limit has
++ been disabled*/
++#define NO_OCF_TO_DRV_MAX_SESSIONS (0)
++
++/*OCF values mapped here*/
++#define ICP_SHA1_DIGEST_SIZE_IN_BYTES (SHA1_HASH_LEN)
++#define ICP_SHA256_DIGEST_SIZE_IN_BYTES (SHA2_256_HASH_LEN)
++#define ICP_SHA384_DIGEST_SIZE_IN_BYTES (SHA2_384_HASH_LEN)
++#define ICP_SHA512_DIGEST_SIZE_IN_BYTES (SHA2_512_HASH_LEN)
++#define ICP_MD5_DIGEST_SIZE_IN_BYTES (MD5_HASH_LEN)
++#define ARC4_COUNTER_LEN (ARC4_BLOCK_LEN)
++
++#define OCF_REGISTRATION_STATUS_SUCCESS (0)
++#define OCF_ZERO_FUNCTIONALITY_REGISTERED (0)
++#define ICP_OCF_DRV_NO_CRYPTO_PROCESS_ERROR (0)
++#define ICP_OCF_DRV_STATUS_SUCCESS (0)
++#define ICP_OCF_DRV_STATUS_FAIL (1)
++
++/*Turn on/off debug options*/
++#define ICP_OCF_PRINT_DEBUG_MESSAGES (0)
++#define ICP_OCF_PRINT_KERN_ALERT (1)
++#define ICP_OCF_PRINT_KERN_ERRS (1)
++
++/*DSA Prime Q size in bytes (as defined in the standard) */
++#define DSA_RS_SIGN_PRIMEQ_SIZE_IN_BYTES (20)
++
++/*MACRO DEFINITIONS*/
++
++#define BITS_TO_BYTES(bytes, bits) \
++ bytes = (bits + NUM_BITS_IN_BYTE_MINUS_ONE) / NUM_BITS_IN_BYTE
++
++#define ICP_CACHE_CREATE(cache_ID, cache_name) \
++ kmem_cache_create(cache_ID, sizeof(cache_name),0, \
++ SLAB_HWCACHE_ALIGN, NULL, NULL);
++
++#define ICP_CACHE_NULL_CHECK(slab_zone) \
++{ \
++ if(NULL == slab_zone){ \
++ icp_ocfDrvFreeCaches(); \
++ EPRINTK("%s() line %d: Not enough memory!\n", \
++ __FUNCTION__, __LINE__); \
++ return ENOMEM; \
++ } \
++}
++
++#define ICP_CACHE_DESTROY(slab_zone) \
++{ \
++ if(NULL != slab_zone){ \
++ kmem_cache_destroy(slab_zone); \
++ slab_zone = NULL; \
++ } \
++}
++
++#define ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(alg) \
++{ \
++ if(OCF_REGISTRATION_STATUS_SUCCESS == \
++ crypto_register(icp_ocfDrvDriverId, \
++ alg, \
++ 0, \
++ 0)) { \
++ ocfStatus++; \
++ } \
++}
++
++#define ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(alg) \
++{ \
++ if(OCF_REGISTRATION_STATUS_SUCCESS == \
++ crypto_kregister(icp_ocfDrvDriverId, \
++ alg, \
++ 0)){ \
++ ocfStatus++; \
++ } \
++}
++
++#if ICP_OCF_PRINT_DEBUG_MESSAGES == 1
++#define DPRINTK(args...) \
++{ \
++ printk(args); \
++}
++
++#else //ICP_OCF_PRINT_DEBUG_MESSAGES == 1
++
++#define DPRINTK(args...)
++
++#endif //ICP_OCF_PRINT_DEBUG_MESSAGES == 1
++
++#if ICP_OCF_PRINT_KERN_ALERT == 1
++#define APRINTK(args...) \
++{ \
++ printk(KERN_ALERT args); \
++}
++
++#else //ICP_OCF_PRINT_KERN_ALERT == 1
++
++#define APRINTK(args...)
++
++#endif //ICP_OCF_PRINT_KERN_ALERT == 1
++
++#if ICP_OCF_PRINT_KERN_ERRS == 1
++#define EPRINTK(args...) \
++{ \
++ printk(KERN_ERR args); \
++}
++
++#else //ICP_OCF_PRINT_KERN_ERRS == 1
++
++#define EPRINTK(args...)
++
++#endif //ICP_OCF_PRINT_KERN_ERRS == 1
++
++#define IPRINTK(args...) \
++{ \
++ printk(KERN_INFO args); \
++}
++
++/*END OF MACRO DEFINITIONS*/
++
++typedef enum {
++ ICP_OCF_DRV_ALG_CIPHER = 0,
++ ICP_OCF_DRV_ALG_HASH
++} icp_ocf_drv_alg_type_t;
++
++/* These are all defined in icp_common.c */
++extern atomic_t lac_session_failed_dereg_count;
++extern atomic_t icp_ocfDrvIsExiting;
++extern atomic_t num_ocf_to_drv_registered_sessions;
++
++/*These are use inputs used in icp_sym.c and icp_common.c
++ They are instantiated in icp_common.c*/
++extern int max_sessions;
++
++extern int32_t icp_ocfDrvDriverId;
++extern struct list_head icp_ocfDrvGlobalSymListHead;
++extern struct list_head icp_ocfDrvGlobalSymListHead_FreeMemList;
++extern struct workqueue_struct *icp_ocfDrvFreeLacSessionWorkQ;
++extern spinlock_t icp_ocfDrvSymSessInfoListSpinlock;
++extern rwlock_t icp_kmem_cache_destroy_alloc_lock;
++
++/*Slab zones for symettric functionality, instantiated in icp_common.c*/
++extern struct kmem_cache *drvSessionData_zone;
++extern struct kmem_cache *drvOpData_zone;
++
++/*Slabs zones for asymettric functionality, instantiated in icp_common.c*/
++extern struct kmem_cache *drvDH_zone;
++extern struct kmem_cache *drvLnModExp_zone;
++extern struct kmem_cache *drvRSADecrypt_zone;
++extern struct kmem_cache *drvRSAPrivateKey_zone;
++extern struct kmem_cache *drvDSARSSign_zone;
++extern struct kmem_cache *drvDSARSSignKValue_zone;
++extern struct kmem_cache *drvDSAVerify_zone;
++
++/*Slab zones for flatbuffers and bufferlist*/
++extern struct kmem_cache *drvFlatBuffer_zone;
++
++#define ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS (16)
++
++struct icp_drvBuffListInfo {
++ Cpa16U numBuffers;
++ Cpa32U metaSize;
++ Cpa32U metaOffset;
++ Cpa32U buffListSize;
++};
++extern struct icp_drvBuffListInfo defBuffListInfo;
++
++/*
++* This struct is used to keep a reference to the relevant node in the list
++* of sessionData structs, to the buffer type required by OCF and to the OCF
++* provided crp struct that needs to be returned. All this info is needed in
++* the callback function.
++*
++* IV can sometimes be stored in non-contiguous memory (e.g. skbuff
++* linked/frag list, therefore a contiguous memory space for the IV data must be
++* created and passed to LAC
++*
++*/
++struct icp_drvOpData {
++ CpaCySymOpData lacOpData;
++ uint32_t digestSizeInBytes;
++ struct cryptop *crp;
++ uint8_t bufferType;
++ uint8_t ivData[MAX_IV_LEN_IN_BYTES];
++ uint16_t numBufferListArray;
++ CpaBufferList srcBuffer;
++ CpaFlatBuffer bufferListArray[ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS];
++ CpaBoolean verifyResult;
++};
++/*Values used to derisk chances of performs being called against
++deregistered sessions (for which the slab page has been reclaimed)
++This is not a fix - since page frames are reclaimed from a slab, one cannot
++rely on that memory not being re-used by another app.*/
++typedef enum {
++ ICP_SESSION_INITIALISED = 0x5C5C5C,
++ ICP_SESSION_RUNNING = 0x005C00,
++ ICP_SESSION_DEREGISTERED = 0xC5C5C5
++} usage_derisk;
++
++/*
++This is the OCF<->OCF_DRV session object:
++
++1.The first member is a listNode. These session objects are added to a linked
++ list in order to make it easier to remove them all at session exit time.
++2.The second member is used to give the session object state and derisk the
++ possibility of OCF batch calls executing against a deregistered session (as
++ described above).
++3.The third member is a LAC<->OCF_DRV session handle (initialised with the first
++ perform request for that session).
++4.The fourth is the LAC session context. All the parameters for this structure
++ are only known when the first perform request for this session occurs. That is
++ why the OCF Tolapai Driver only registers a new LAC session at perform time
++*/
++struct icp_drvSessionData {
++ struct list_head listNode;
++ usage_derisk inUse;
++ CpaCySymSessionCtx sessHandle;
++ CpaCySymSessionSetupData lacSessCtx;
++};
++
++/* This struct is required for deferred session
++ deregistration as a work queue function can
++ only have one argument*/
++struct icp_ocfDrvFreeLacSession {
++ CpaCySymSessionCtx sessionToDeregister;
++ struct work_struct work;
++};
++
++int icp_ocfDrvNewSession(device_t dev, uint32_t * sild, struct cryptoini *cri);
++
++int icp_ocfDrvFreeLACSession(device_t dev, uint64_t sid);
++
++int icp_ocfDrvSymProcess(device_t dev, struct cryptop *crp, int hint);
++
++int icp_ocfDrvPkeProcess(device_t dev, struct cryptkop *krp, int hint);
++
++int icp_ocfDrvReadRandom(void *arg, uint32_t * buf, int maxwords);
++
++int icp_ocfDrvDeregRetry(CpaCySymSessionCtx sessionToDeregister);
++
++int icp_ocfDrvSkBuffToBufferList(struct sk_buff *skb,
++ CpaBufferList * bufferList);
++
++int icp_ocfDrvBufferListToSkBuff(CpaBufferList * bufferList,
++ struct sk_buff **skb);
++
++void icp_ocfDrvPtrAndLenToFlatBuffer(void *pData, uint32_t len,
++ CpaFlatBuffer * pFlatBuffer);
++
++void icp_ocfDrvPtrAndLenToBufferList(void *pDataIn, uint32_t length,
++ CpaBufferList * pBufferList);
++
++void icp_ocfDrvBufferListToPtrAndLen(CpaBufferList * pBufferList,
++ void **ppDataOut, uint32_t * pLength);
++
++int icp_ocfDrvBufferListMemInfo(uint16_t numBuffers,
++ struct icp_drvBuffListInfo *buffListInfo);
++
++uint16_t icp_ocfDrvGetSkBuffFrags(struct sk_buff *pSkb);
++
++void icp_ocfDrvFreeFlatBuffer(CpaFlatBuffer * pFlatBuffer);
++
++int icp_ocfDrvAllocMetaData(CpaBufferList * pBufferList,
++ const struct icp_drvOpData *pOpData);
++
++void icp_ocfDrvFreeMetaData(CpaBufferList * pBufferList);
++
++#endif
++/* ICP_OCF_H */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_sym.c linux-2.6.27.10/crypto/ocf/ep80579/icp_sym.c
+--- linux-2.6.27.10.orig/crypto/ocf/ep80579/icp_sym.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ep80579/icp_sym.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,1382 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++/*
++ * An OCF module that uses the API for Intel® QuickAssist Technology to do the
++ * cryptography.
++ *
++ * This driver requires the ICP Access Library that is available from Intel in
++ * order to operate.
++ */
++
++#include "icp_ocf.h"
++
++/*This is the call back function for all symmetric cryptographic processes.
++ Its main functionality is to free driver crypto operation structure and to
++ call back to OCF*/
++static void
++icp_ocfDrvSymCallBack(void *callbackTag,
++ CpaStatus status,
++ const CpaCySymOp operationType,
++ void *pOpData,
++ CpaBufferList * pDstBuffer, CpaBoolean verifyResult);
++
++/*This function is used to extract crypto processing information from the OCF
++ inputs, so as that it may be passed onto LAC*/
++static int
++icp_ocfDrvProcessDataSetup(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc);
++
++/*This function checks whether the crp_desc argument pertains to a digest or a
++ cipher operation*/
++static int icp_ocfDrvAlgCheck(struct cryptodesc *crp_desc);
++
++/*This function copies all the passed in session context information and stores
++ it in a LAC context structure*/
++static int
++icp_ocfDrvAlgorithmSetup(struct cryptoini *cri,
++ CpaCySymSessionSetupData * lacSessCtx);
++
++/*This top level function is used to find a pointer to where a digest is
++ stored/needs to be inserted. */
++static uint8_t *icp_ocfDrvDigestPointerFind(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc);
++
++/*This function is called when a digest pointer has to be found within a
++ SKBUFF.*/
++static inline uint8_t *icp_ocfDrvSkbuffDigestPointerFind(struct icp_drvOpData
++ *drvOpData,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes);
++
++/*The following two functions are called if the SKBUFF digest pointer is not
++ positioned in the linear portion of the buffer (i.e. it is in a linked SKBUFF
++ or page fragment).*/
++/*This function takes care of the page fragment case.*/
++static inline uint8_t *icp_ocfDrvDigestSkbNRFragsCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes);
++
++/*This function takes care of the linked list case.*/
++static inline uint8_t *icp_ocfDrvDigestSkbFragListCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes);
++
++/*This function is used to free an OCF->OCF_DRV session object*/
++static void icp_ocfDrvFreeOCFSession(struct icp_drvSessionData *sessionData);
++
++/*max IOV buffs supported in a UIO structure*/
++#define NUM_IOV_SUPPORTED (1)
++
++/* Name : icp_ocfDrvSymCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the relevant symmetric operation.
++ *
++ * Notes : The callbackTag is a pointer to an icp_drvOpData. This memory
++ * object was passed to LAC for the cryptographic processing and contains all
++ * the relevant information for cleaning up buffer handles etc. so that the
++ * OCF Tolapai Driver portion of this crypto operation can be fully completed.
++ */
++static void
++icp_ocfDrvSymCallBack(void *callbackTag,
++ CpaStatus status,
++ const CpaCySymOp operationType,
++ void *pOpData,
++ CpaBufferList * pDstBuffer, CpaBoolean verifyResult)
++{
++ struct cryptop *crp = NULL;
++ struct icp_drvOpData *temp_drvOpData =
++ (struct icp_drvOpData *)callbackTag;
++ uint64_t *tempBasePtr = NULL;
++ uint32_t tempLen = 0;
++
++ if (NULL == temp_drvOpData) {
++ DPRINTK("%s(): The callback from the LAC component"
++ " has failed due to Null userOpaque data"
++ "(status == %d).\n", __FUNCTION__, status);
++ DPRINTK("%s(): Unable to call OCF back! \n", __FUNCTION__);
++ return;
++ }
++
++ crp = temp_drvOpData->crp;
++ crp->crp_etype = ICP_OCF_DRV_NO_CRYPTO_PROCESS_ERROR;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): The callback from the LAC component"
++ " has failed due to Null Symmetric Op data"
++ "(status == %d).\n", __FUNCTION__, status);
++ crp->crp_etype = ECANCELED;
++ crypto_done(crp);
++ return;
++ }
++
++ if (NULL == pDstBuffer) {
++ DPRINTK("%s(): The callback from the LAC component"
++ " has failed due to Null Dst Bufferlist data"
++ "(status == %d).\n", __FUNCTION__, status);
++ crp->crp_etype = ECANCELED;
++ crypto_done(crp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++
++ if (temp_drvOpData->bufferType == CRYPTO_F_SKBUF) {
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvBufferListToSkBuff(pDstBuffer,
++ (struct sk_buff **)
++ &(crp->crp_buf))) {
++ EPRINTK("%s(): BufferList to SkBuff "
++ "conversion error.\n", __FUNCTION__);
++ crp->crp_etype = EPERM;
++ }
++ } else {
++ icp_ocfDrvBufferListToPtrAndLen(pDstBuffer,
++ (void **)&tempBasePtr,
++ &tempLen);
++ crp->crp_olen = (int)tempLen;
++ }
++
++ } else {
++ DPRINTK("%s(): The callback from the LAC component has failed"
++ "(status == %d).\n", __FUNCTION__, status);
++
++ crp->crp_etype = ECANCELED;
++ }
++
++ if (temp_drvOpData->numBufferListArray >
++ ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS) {
++ kfree(pDstBuffer->pBuffers);
++ }
++ icp_ocfDrvFreeMetaData(pDstBuffer);
++ kmem_cache_free(drvOpData_zone, temp_drvOpData);
++
++ /* Invoke the OCF callback function */
++ crypto_done(crp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvNewSession
++ *
++ * Description : This function will create a new Driver<->OCF session
++ *
++ * Notes : LAC session registration happens during the first perform call.
++ * That is the first time we know all information about a given session.
++ */
++int icp_ocfDrvNewSession(device_t dev, uint32_t * sid, struct cryptoini *cri)
++{
++ struct icp_drvSessionData *sessionData = NULL;
++ uint32_t delete_session = 0;
++
++ /* The SID passed in should be our driver ID. We can return the */
++ /* local ID (LID) which is a unique identifier which we can use */
++ /* to differentiate between the encrypt/decrypt LAC session handles */
++ if (NULL == sid) {
++ EPRINTK("%s(): Invalid input parameters - NULL sid.\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ if (NULL == cri) {
++ EPRINTK("%s(): Invalid input parameters - NULL cryptoini.\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ if (icp_ocfDrvDriverId != *sid) {
++ EPRINTK("%s(): Invalid input parameters - bad driver ID\n",
++ __FUNCTION__);
++ EPRINTK("\t sid = 0x08%p \n \t cri = 0x08%p \n", sid, cri);
++ return EINVAL;
++ }
++
++ sessionData = kmem_cache_zalloc(drvSessionData_zone, GFP_ATOMIC);
++ if (NULL == sessionData) {
++ DPRINTK("%s():No memory for Session Data\n", __FUNCTION__);
++ return ENOMEM;
++ }
++
++ /*ENTER CRITICAL SECTION */
++ spin_lock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++ /*put this check in the spinlock so no new sessions can be added to the
++ linked list when we are exiting */
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ delete_session++;
++
++ } else if (NO_OCF_TO_DRV_MAX_SESSIONS != max_sessions) {
++ if (atomic_read(&num_ocf_to_drv_registered_sessions) >=
++ (max_sessions -
++ atomic_read(&lac_session_failed_dereg_count))) {
++ delete_session++;
++ } else {
++ atomic_inc(&num_ocf_to_drv_registered_sessions);
++ /* Add to session data linked list */
++ list_add(&(sessionData->listNode),
++ &icp_ocfDrvGlobalSymListHead);
++ }
++
++ } else if (NO_OCF_TO_DRV_MAX_SESSIONS == max_sessions) {
++ list_add(&(sessionData->listNode),
++ &icp_ocfDrvGlobalSymListHead);
++ }
++
++ sessionData->inUse = ICP_SESSION_INITIALISED;
++
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ if (delete_session) {
++ DPRINTK("%s():No Session handles available\n", __FUNCTION__);
++ kmem_cache_free(drvSessionData_zone, sessionData);
++ return EPERM;
++ }
++
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvAlgorithmSetup(cri, &(sessionData->lacSessCtx))) {
++ DPRINTK("%s():algorithm not supported\n", __FUNCTION__);
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return EINVAL;
++ }
++
++ if (cri->cri_next) {
++ if (cri->cri_next->cri_next != NULL) {
++ DPRINTK("%s():only two chained algorithms supported\n",
++ __FUNCTION__);
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return EPERM;
++ }
++
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvAlgorithmSetup(cri->cri_next,
++ &(sessionData->lacSessCtx))) {
++ DPRINTK("%s():second algorithm not supported\n",
++ __FUNCTION__);
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return EINVAL;
++ }
++
++ sessionData->lacSessCtx.symOperation =
++ CPA_CY_SYM_OP_ALGORITHM_CHAINING;
++ }
++
++ *sid = (uint32_t) sessionData;
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvAlgorithmSetup
++ *
++ * Description : This function builds the session context data from the
++ * information supplied through OCF. Algorithm chain order and whether the
++ * session is Encrypt/Decrypt can only be found out at perform time however, so
++ * the session is registered with LAC at that time.
++ */
++static int
++icp_ocfDrvAlgorithmSetup(struct cryptoini *cri,
++ CpaCySymSessionSetupData * lacSessCtx)
++{
++
++ lacSessCtx->sessionPriority = CPA_CY_PRIORITY_NORMAL;
++
++ switch (cri->cri_alg) {
++
++ case CRYPTO_NULL_CBC:
++ DPRINTK("%s(): NULL CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_NULL;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_DES_CBC:
++ DPRINTK("%s(): DES CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_DES_CBC;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_3DES_CBC:
++ DPRINTK("%s(): 3DES CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_3DES_CBC;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_AES_CBC:
++ DPRINTK("%s(): AES CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_AES_CBC;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_ARC4:
++ DPRINTK("%s(): ARC4\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_ARC4;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_SHA1:
++ DPRINTK("%s(): SHA1\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_SHA1;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA1_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA1_HMAC:
++ DPRINTK("%s(): SHA1_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_SHA1;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA1_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_SHA2_256:
++ DPRINTK("%s(): SHA256\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA256;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA256_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA2_256_HMAC:
++ DPRINTK("%s(): SHA256_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA256;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA256_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_SHA2_384:
++ DPRINTK("%s(): SHA384\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA384;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA384_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA2_384_HMAC:
++ DPRINTK("%s(): SHA384_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA384;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA384_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_SHA2_512:
++ DPRINTK("%s(): SHA512\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA512;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA512_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA2_512_HMAC:
++ DPRINTK("%s(): SHA512_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA512;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA512_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_MD5:
++ DPRINTK("%s(): MD5\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_MD5;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_MD5_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_MD5_HMAC:
++ DPRINTK("%s(): MD5_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_MD5;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_MD5_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ default:
++ DPRINTK("%s(): ALG Setup FAIL\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvFreeOCFSession
++ *
++ * Description : This function deletes all existing Session data representing
++ * the Cryptographic session established between OCF and this driver. This
++ * also includes freeing the memory allocated for the session context. The
++ * session object is also removed from the session linked list.
++ */
++static void icp_ocfDrvFreeOCFSession(struct icp_drvSessionData *sessionData)
++{
++
++ sessionData->inUse = ICP_SESSION_DEREGISTERED;
++
++ /*ENTER CRITICAL SECTION */
++ spin_lock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ /*If the Driver is exiting, allow that process to
++ handle any deletions */
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++ return;
++ }
++
++ atomic_dec(&num_ocf_to_drv_registered_sessions);
++
++ list_del(&(sessionData->listNode));
++
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ if (NULL != sessionData->sessHandle) {
++ kfree(sessionData->sessHandle);
++ }
++ kmem_cache_free(drvSessionData_zone, sessionData);
++}
++
++/* Name : icp_ocfDrvFreeLACSession
++ *
++ * Description : This attempts to deregister a LAC session. If it fails, the
++ * deregistation retry function is called.
++ */
++int icp_ocfDrvFreeLACSession(device_t dev, uint64_t sid)
++{
++ CpaCySymSessionCtx sessionToDeregister = NULL;
++ struct icp_drvSessionData *sessionData = NULL;
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ int retval = 0;
++
++ sessionData = (struct icp_drvSessionData *)CRYPTO_SESID2LID(sid);
++ if (NULL == sessionData) {
++ EPRINTK("%s(): OCF Free session called with Null Session ID.\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ sessionToDeregister = sessionData->sessHandle;
++
++ if (ICP_SESSION_INITIALISED == sessionData->inUse) {
++ DPRINTK("%s() Session not registered with LAC\n", __FUNCTION__);
++ } else if (NULL == sessionData->sessHandle) {
++ EPRINTK
++ ("%s(): OCF Free session called with Null Session Handle.\n",
++ __FUNCTION__);
++ return EINVAL;
++ } else {
++ lacStatus = cpaCySymRemoveSession(CPA_INSTANCE_HANDLE_SINGLE,
++ sessionToDeregister);
++ if (CPA_STATUS_RETRY == lacStatus) {
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvDeregRetry(&sessionToDeregister)) {
++ /* the retry function increments the
++ dereg failed count */
++ DPRINTK("%s(): LAC failed to deregister the "
++ "session. (localSessionId= %p)\n",
++ __FUNCTION__, sessionToDeregister);
++ retval = EPERM;
++ }
++
++ } else if (CPA_STATUS_SUCCESS != lacStatus) {
++ DPRINTK("%s(): LAC failed to deregister the session. "
++ "localSessionId= %p, lacStatus = %d\n",
++ __FUNCTION__, sessionToDeregister, lacStatus);
++ atomic_inc(&lac_session_failed_dereg_count);
++ retval = EPERM;
++ }
++ }
++
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return retval;
++
++}
++
++/* Name : icp_ocfDrvAlgCheck
++ *
++ * Description : This function checks whether the cryptodesc argument pertains
++ * to a sym or hash function
++ */
++static int icp_ocfDrvAlgCheck(struct cryptodesc *crp_desc)
++{
++
++ if (crp_desc->crd_alg == CRYPTO_3DES_CBC ||
++ crp_desc->crd_alg == CRYPTO_AES_CBC ||
++ crp_desc->crd_alg == CRYPTO_DES_CBC ||
++ crp_desc->crd_alg == CRYPTO_NULL_CBC ||
++ crp_desc->crd_alg == CRYPTO_ARC4) {
++ return ICP_OCF_DRV_ALG_CIPHER;
++ }
++
++ return ICP_OCF_DRV_ALG_HASH;
++}
++
++/* Name : icp_ocfDrvSymProcess
++ *
++ * Description : This function will map symmetric functionality calls from OCF
++ * to the LAC API. It will also allocate memory to store the session context.
++ *
++ * Notes: If it is the first perform call for a given session, then a LAC
++ * session is registered. After the session is registered, no checks as
++ * to whether session paramaters have changed (e.g. alg chain order) are
++ * done.
++ */
++int icp_ocfDrvSymProcess(device_t dev, struct cryptop *crp, int hint)
++{
++ struct icp_drvSessionData *sessionData = NULL;
++ struct icp_drvOpData *drvOpData = NULL;
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ Cpa32U sessionCtxSizeInBytes = 0;
++ uint16_t numBufferListArray = 0;
++
++ if (NULL == crp) {
++ DPRINTK("%s(): Invalid input parameters, cryptop is NULL\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ if (NULL == crp->crp_desc) {
++ DPRINTK("%s(): Invalid input parameters, no crp_desc attached "
++ "to crp\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++ if (NULL == crp->crp_buf) {
++ DPRINTK("%s(): Invalid input parameters, no buffer attached "
++ "to crp\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ crp->crp_etype = EFAULT;
++ return EFAULT;
++ }
++
++ sessionData = (struct icp_drvSessionData *)
++ (CRYPTO_SESID2LID(crp->crp_sid));
++ if (NULL == sessionData) {
++ DPRINTK("%s(): Invalid input parameters, Null Session ID \n",
++ __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++/*If we get a request against a deregisted session, cancel operation*/
++ if (ICP_SESSION_DEREGISTERED == sessionData->inUse) {
++ DPRINTK("%s(): Session ID %d was deregistered \n",
++ __FUNCTION__, (int)(CRYPTO_SESID2LID(crp->crp_sid)));
++ crp->crp_etype = EFAULT;
++ return EFAULT;
++ }
++
++/*If none of the session states are set, then the session structure was either
++ not initialised properly or we are reading from a freed memory area (possible
++ due to OCF batch mode not removing queued requests against deregistered
++ sessions*/
++ if (ICP_SESSION_INITIALISED != sessionData->inUse &&
++ ICP_SESSION_RUNNING != sessionData->inUse) {
++ DPRINTK("%s(): Session - ID %d - not properly initialised or "
++ "memory freed back to the kernel \n",
++ __FUNCTION__, (int)(CRYPTO_SESID2LID(crp->crp_sid)));
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++ /*For the below checks, remember error checking is already done in LAC.
++ We're not validating inputs subsequent to registration */
++ if (sessionData->inUse == ICP_SESSION_INITIALISED) {
++ DPRINTK("%s(): Initialising session\n", __FUNCTION__);
++
++ if (NULL != crp->crp_desc->crd_next) {
++ if (ICP_OCF_DRV_ALG_CIPHER ==
++ icp_ocfDrvAlgCheck(crp->crp_desc)) {
++
++ sessionData->lacSessCtx.algChainOrder =
++ CPA_CY_SYM_ALG_CHAIN_ORDER_CIPHER_THEN_HASH;
++
++ if (crp->crp_desc->crd_flags & CRD_F_ENCRYPT) {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT;
++ } else {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_DECRYPT;
++ }
++ } else {
++ sessionData->lacSessCtx.algChainOrder =
++ CPA_CY_SYM_ALG_CHAIN_ORDER_HASH_THEN_CIPHER;
++
++ if (crp->crp_desc->crd_next->crd_flags &
++ CRD_F_ENCRYPT) {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT;
++ } else {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_DECRYPT;
++ }
++
++ }
++
++ } else if (ICP_OCF_DRV_ALG_CIPHER ==
++ icp_ocfDrvAlgCheck(crp->crp_desc)) {
++ if (crp->crp_desc->crd_flags & CRD_F_ENCRYPT) {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT;
++ } else {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_DECRYPT;
++ }
++
++ }
++
++ /*No action required for standalone Auth here */
++
++ /* Allocate memory for SymSessionCtx before the Session Registration */
++ lacStatus =
++ cpaCySymSessionCtxGetSize(CPA_INSTANCE_HANDLE_SINGLE,
++ &(sessionData->lacSessCtx),
++ &sessionCtxSizeInBytes);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): cpaCySymSessionCtxGetSize failed - %d\n",
++ __FUNCTION__, lacStatus);
++ return EINVAL;
++ }
++ sessionData->sessHandle =
++ kmalloc(sessionCtxSizeInBytes, GFP_ATOMIC);
++ if (NULL == sessionData->sessHandle) {
++ EPRINTK
++ ("%s(): Failed to get memory for SymSessionCtx\n",
++ __FUNCTION__);
++ return ENOMEM;
++ }
++
++ lacStatus = cpaCySymInitSession(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvSymCallBack,
++ &(sessionData->lacSessCtx),
++ sessionData->sessHandle);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): cpaCySymInitSession failed -%d \n",
++ __FUNCTION__, lacStatus);
++ return EFAULT;
++ }
++
++ sessionData->inUse = ICP_SESSION_RUNNING;
++ }
++
++ drvOpData = kmem_cache_zalloc(drvOpData_zone, GFP_ATOMIC);
++ if (NULL == drvOpData) {
++ EPRINTK("%s():Failed to get memory for drvOpData\n",
++ __FUNCTION__);
++ crp->crp_etype = ENOMEM;
++ return ENOMEM;
++ }
++
++ drvOpData->lacOpData.pSessionCtx = sessionData->sessHandle;
++ drvOpData->digestSizeInBytes = sessionData->lacSessCtx.hashSetupData.
++ digestResultLenInBytes;
++ drvOpData->crp = crp;
++
++ /* Set the default buffer list array memory allocation */
++ drvOpData->srcBuffer.pBuffers = drvOpData->bufferListArray;
++ drvOpData->numBufferListArray = ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS;
++
++ /*
++ * Allocate buffer list array memory allocation if the
++ * data fragment is more than the default allocation
++ */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ numBufferListArray = icp_ocfDrvGetSkBuffFrags((struct sk_buff *)
++ crp->crp_buf);
++ if (ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS < numBufferListArray) {
++ DPRINTK("%s() numBufferListArray more than default\n",
++ __FUNCTION__);
++ drvOpData->srcBuffer.pBuffers = NULL;
++ drvOpData->srcBuffer.pBuffers =
++ kmalloc(numBufferListArray *
++ sizeof(CpaFlatBuffer), GFP_ATOMIC);
++ if (NULL == drvOpData->srcBuffer.pBuffers) {
++ EPRINTK("%s() Failed to get memory for "
++ "pBuffers\n", __FUNCTION__);
++ kmem_cache_free(drvOpData_zone, drvOpData);
++ crp->crp_etype = ENOMEM;
++ return ENOMEM;
++ }
++ drvOpData->numBufferListArray = numBufferListArray;
++ }
++ }
++
++ /*
++ * Check the type of buffer structure we got and convert it into
++ * CpaBufferList format.
++ */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvSkBuffToBufferList((struct sk_buff *)crp->crp_buf,
++ &(drvOpData->srcBuffer))) {
++ EPRINTK("%s():Failed to translate from SK_BUF "
++ "to bufferlist\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ drvOpData->bufferType = CRYPTO_F_SKBUF;
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ /* OCF only supports IOV of one entry. */
++ if (NUM_IOV_SUPPORTED ==
++ ((struct uio *)(crp->crp_buf))->uio_iovcnt) {
++
++ icp_ocfDrvPtrAndLenToBufferList(((struct uio *)(crp->
++ crp_buf))->
++ uio_iov[0].iov_base,
++ ((struct uio *)(crp->
++ crp_buf))->
++ uio_iov[0].iov_len,
++ &(drvOpData->
++ srcBuffer));
++
++ drvOpData->bufferType = CRYPTO_F_IOV;
++
++ } else {
++ DPRINTK("%s():Unable to handle IOVs with lengths of "
++ "greater than one!\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ } else {
++ icp_ocfDrvPtrAndLenToBufferList(crp->crp_buf,
++ crp->crp_ilen,
++ &(drvOpData->srcBuffer));
++
++ drvOpData->bufferType = CRYPTO_BUF_CONTIG;
++ }
++
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvProcessDataSetup(drvOpData, drvOpData->crp->crp_desc)) {
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ if (drvOpData->crp->crp_desc->crd_next != NULL) {
++ if (icp_ocfDrvProcessDataSetup(drvOpData, drvOpData->crp->
++ crp_desc->crd_next)) {
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ }
++
++ /* Allocate srcBuffer's private meta data */
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvAllocMetaData(&(drvOpData->srcBuffer), drvOpData)) {
++ EPRINTK("%s() icp_ocfDrvAllocMetaData failed\n", __FUNCTION__);
++ memset(&(drvOpData->lacOpData), 0, sizeof(CpaCySymOpData));
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ /* Perform "in-place" crypto operation */
++ lacStatus = cpaCySymPerformOp(CPA_INSTANCE_HANDLE_SINGLE,
++ (void *)drvOpData,
++ &(drvOpData->lacOpData),
++ &(drvOpData->srcBuffer),
++ &(drvOpData->srcBuffer),
++ &(drvOpData->verifyResult));
++ if (CPA_STATUS_RETRY == lacStatus) {
++ DPRINTK("%s(): cpaCySymPerformOp retry, lacStatus = %d\n",
++ __FUNCTION__, lacStatus);
++ memset(&(drvOpData->lacOpData), 0, sizeof(CpaCySymOpData));
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): cpaCySymPerformOp failed, lacStatus = %d\n",
++ __FUNCTION__, lacStatus);
++ memset(&(drvOpData->lacOpData), 0, sizeof(CpaCySymOpData));
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ return 0; //OCF success status value
++
++ err:
++ if (drvOpData->numBufferListArray > ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS) {
++ kfree(drvOpData->srcBuffer.pBuffers);
++ }
++ icp_ocfDrvFreeMetaData(&(drvOpData->srcBuffer));
++ kmem_cache_free(drvOpData_zone, drvOpData);
++
++ return crp->crp_etype;
++}
++
++/* Name : icp_ocfDrvProcessDataSetup
++ *
++ * Description : This function will setup all the cryptographic operation data
++ * that is required by LAC to execute the operation.
++ */
++static int icp_ocfDrvProcessDataSetup(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc)
++{
++ CpaCyRandGenOpData randGenOpData;
++ CpaFlatBuffer randData;
++
++ drvOpData->lacOpData.packetType = CPA_CY_SYM_PACKET_TYPE_FULL;
++
++ /* Convert from the cryptop to the ICP LAC crypto parameters */
++ switch (crp_desc->crd_alg) {
++ case CRYPTO_NULL_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = NULL_BLOCK_LEN;
++ break;
++ case CRYPTO_DES_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = DES_BLOCK_LEN;
++ break;
++ case CRYPTO_3DES_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = DES3_BLOCK_LEN;
++ break;
++ case CRYPTO_ARC4:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = ARC4_COUNTER_LEN;
++ break;
++ case CRYPTO_AES_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = RIJNDAEL128_BLOCK_LEN;
++ break;
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ case CRYPTO_SHA2_256:
++ case CRYPTO_SHA2_256_HMAC:
++ case CRYPTO_SHA2_384:
++ case CRYPTO_SHA2_384_HMAC:
++ case CRYPTO_SHA2_512:
++ case CRYPTO_SHA2_512_HMAC:
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ drvOpData->lacOpData.
++ hashStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToHashInBytes = crp_desc->crd_len;
++ drvOpData->lacOpData.
++ pDigestResult =
++ icp_ocfDrvDigestPointerFind(drvOpData, crp_desc);
++
++ if (NULL == drvOpData->lacOpData.pDigestResult) {
++ DPRINTK("%s(): ERROR - could not calculate "
++ "Digest Result memory address\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ drvOpData->lacOpData.digestVerify = CPA_FALSE;
++ break;
++ default:
++ DPRINTK("%s(): Crypto process error - algorithm not "
++ "found \n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ /* Figure out what the IV is supposed to be */
++ if ((crp_desc->crd_alg == CRYPTO_DES_CBC) ||
++ (crp_desc->crd_alg == CRYPTO_3DES_CBC) ||
++ (crp_desc->crd_alg == CRYPTO_AES_CBC)) {
++ /*ARC4 doesn't use an IV */
++ if (crp_desc->crd_flags & CRD_F_IV_EXPLICIT) {
++ /* Explicit IV provided to OCF */
++ drvOpData->lacOpData.pIv = crp_desc->crd_iv;
++ } else {
++ /* IV is not explicitly provided to OCF */
++
++ /* Point the LAC OP Data IV pointer to our allocated
++ storage location for this session. */
++ drvOpData->lacOpData.pIv = drvOpData->ivData;
++
++ if ((crp_desc->crd_flags & CRD_F_ENCRYPT) &&
++ ((crp_desc->crd_flags & CRD_F_IV_PRESENT) == 0)) {
++
++ /* Encrypting - need to create IV */
++ randGenOpData.generateBits = CPA_TRUE;
++ randGenOpData.lenInBytes = MAX_IV_LEN_IN_BYTES;
++
++ icp_ocfDrvPtrAndLenToFlatBuffer((Cpa8U *)
++ drvOpData->
++ ivData,
++ MAX_IV_LEN_IN_BYTES,
++ &randData);
++
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyRandGen(CPA_INSTANCE_HANDLE_SINGLE,
++ NULL, NULL,
++ &randGenOpData, &randData)) {
++ DPRINTK("%s(): ERROR - Failed to"
++ " generate"
++ " Initialisation Vector\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ crypto_copyback(drvOpData->crp->
++ crp_flags,
++ drvOpData->crp->crp_buf,
++ crp_desc->crd_inject,
++ drvOpData->lacOpData.
++ ivLenInBytes,
++ (caddr_t) (drvOpData->lacOpData.
++ pIv));
++ } else {
++ /* Reading IV from buffer */
++ crypto_copydata(drvOpData->crp->
++ crp_flags,
++ drvOpData->crp->crp_buf,
++ crp_desc->crd_inject,
++ drvOpData->lacOpData.
++ ivLenInBytes,
++ (caddr_t) (drvOpData->lacOpData.
++ pIv));
++ }
++
++ }
++
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvDigestPointerFind
++ *
++ * Description : This function is used to find the memory address of where the
++ * digest information shall be stored in. Input buffer types are an skbuff, iov
++ * or flat buffer. The address is found using the buffer data start address and
++ * an offset.
++ *
++ * Note: In the case of a linux skbuff, the digest address may exist within
++ * a memory space linked to from the start buffer. These linked memory spaces
++ * must be traversed by the data length offset in order to find the digest start
++ * address. Whether there is enough space for the digest must also be checked.
++ */
++
++static uint8_t *icp_ocfDrvDigestPointerFind(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc)
++{
++
++ int offsetInBytes = crp_desc->crd_inject;
++ uint32_t digestSizeInBytes = drvOpData->digestSizeInBytes;
++ uint8_t *flat_buffer_base = NULL;
++ int flat_buffer_length = 0;
++ struct sk_buff *skb;
++
++ if (drvOpData->crp->crp_flags & CRYPTO_F_SKBUF) {
++ /*check if enough overall space to store hash */
++ skb = (struct sk_buff *)(drvOpData->crp->crp_buf);
++
++ if (skb->len < (offsetInBytes + digestSizeInBytes)) {
++ DPRINTK("%s() Not enough space for Digest"
++ " payload after the offset (%d), "
++ "digest size (%d) \n", __FUNCTION__,
++ offsetInBytes, digestSizeInBytes);
++ return NULL;
++ }
++
++ return icp_ocfDrvSkbuffDigestPointerFind(drvOpData,
++ offsetInBytes,
++ digestSizeInBytes);
++
++ } else {
++ /* IOV or flat buffer */
++ if (drvOpData->crp->crp_flags & CRYPTO_F_IOV) {
++ /*single IOV check has already been done */
++ flat_buffer_base = ((struct uio *)
++ (drvOpData->crp->crp_buf))->
++ uio_iov[0].iov_base;
++ flat_buffer_length = ((struct uio *)
++ (drvOpData->crp->crp_buf))->
++ uio_iov[0].iov_len;
++ } else {
++ flat_buffer_base = (uint8_t *) drvOpData->crp->crp_buf;
++ flat_buffer_length = drvOpData->crp->crp_ilen;
++ }
++
++ if (flat_buffer_length < (offsetInBytes + digestSizeInBytes)) {
++ DPRINTK("%s() Not enough space for Digest "
++ "(IOV/Flat Buffer) \n", __FUNCTION__);
++ return NULL;
++ } else {
++ return (uint8_t *) (flat_buffer_base + offsetInBytes);
++ }
++ }
++ DPRINTK("%s() Should not reach this point\n", __FUNCTION__);
++ return NULL;
++}
++
++/* Name : icp_ocfDrvSkbuffDigestPointerFind
++ *
++ * Description : This function is used by icp_ocfDrvDigestPointerFind to process
++ * the non-linear portion of the skbuff if the fragmentation type is a linked
++ * list (frag_list is not NULL in the skb_shared_info structure)
++ */
++static inline uint8_t *icp_ocfDrvSkbuffDigestPointerFind(struct icp_drvOpData
++ *drvOpData,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes)
++{
++
++ struct sk_buff *skb = NULL;
++ struct skb_shared_info *skb_shared = NULL;
++
++ uint32_t skbuffisnonlinear = 0;
++
++ uint32_t skbheadlen = 0;
++
++ skb = (struct sk_buff *)(drvOpData->crp->crp_buf);
++ skbuffisnonlinear = skb_is_nonlinear(skb);
++
++ skbheadlen = skb_headlen(skb);
++
++ /*Linear skb checks */
++ if (skbheadlen > offsetInBytes) {
++
++ if (skbheadlen >= (offsetInBytes + digestSizeInBytes)) {
++ return (uint8_t *) (skb->data + offsetInBytes);
++ } else {
++ DPRINTK("%s() Auth payload stretches "
++ "accross contiguous memory\n", __FUNCTION__);
++ return NULL;
++ }
++ } else {
++ if (skbuffisnonlinear) {
++ offsetInBytes -= skbheadlen;
++ } else {
++ DPRINTK("%s() Offset outside of buffer boundaries\n",
++ __FUNCTION__);
++ return NULL;
++ }
++ }
++
++ /*Non Linear checks */
++ skb_shared = (struct skb_shared_info *)(skb->end);
++ if (unlikely(NULL == skb_shared)) {
++ DPRINTK("%s() skbuff shared info stucture is NULL! \n",
++ __FUNCTION__);
++ return NULL;
++ } else if ((0 != skb_shared->nr_frags) &&
++ (skb_shared->frag_list != NULL)) {
++ DPRINTK("%s() skbuff nr_frags AND "
++ "frag_list not supported \n", __FUNCTION__);
++ return NULL;
++ }
++
++ /*TCP segmentation more likely than IP fragmentation */
++ if (likely(0 != skb_shared->nr_frags)) {
++ return icp_ocfDrvDigestSkbNRFragsCheck(skb, skb_shared,
++ offsetInBytes,
++ digestSizeInBytes);
++ } else if (skb_shared->frag_list != NULL) {
++ return icp_ocfDrvDigestSkbFragListCheck(skb, skb_shared,
++ offsetInBytes,
++ digestSizeInBytes);
++ } else {
++ DPRINTK("%s() skbuff is non-linear but does not show any "
++ "linked data\n", __FUNCTION__);
++ return NULL;
++ }
++
++}
++
++/* Name : icp_ocfDrvDigestSkbNRFragsCheck
++ *
++ * Description : This function is used by icp_ocfDrvSkbuffDigestPointerFind to
++ * process the non-linear portion of the skbuff, if the fragmentation type is
++ * page fragments
++ */
++static inline uint8_t *icp_ocfDrvDigestSkbNRFragsCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes)
++{
++ int i = 0;
++ /*nr_frags starts from 1 */
++ if (MAX_SKB_FRAGS < skb_shared->nr_frags) {
++ DPRINTK("%s error processing skbuff "
++ "page frame -- MAX FRAGS exceeded \n", __FUNCTION__);
++ return NULL;
++ }
++
++ for (i = 0; i < skb_shared->nr_frags; i++) {
++
++ if (offsetInBytes >= skb_shared->frags[i].size) {
++ /*offset still greater than data position */
++ offsetInBytes -= skb_shared->frags[i].size;
++ } else {
++ /* found the page containing start of hash */
++
++ if (NULL == skb_shared->frags[i].page) {
++ DPRINTK("%s() Linked page is NULL!\n",
++ __FUNCTION__);
++ return NULL;
++ }
++
++ if (offsetInBytes + digestSizeInBytes >
++ skb_shared->frags[i].size) {
++ DPRINTK("%s() Auth payload stretches accross "
++ "contiguous memory\n", __FUNCTION__);
++ return NULL;
++ } else {
++ return (uint8_t *) (skb_shared->frags[i].page +
++ skb_shared->frags[i].
++ page_offset +
++ offsetInBytes);
++ }
++ }
++ /*only possible if internal page sizes are set wrong */
++ if (offsetInBytes < 0) {
++ DPRINTK("%s error processing skbuff page frame "
++ "-- offset calculation \n", __FUNCTION__);
++ return NULL;
++ }
++ }
++ /*only possible if internal page sizes are set wrong */
++ DPRINTK("%s error processing skbuff page frame "
++ "-- ran out of page fragments, remaining offset = %d \n",
++ __FUNCTION__, offsetInBytes);
++ return NULL;
++
++}
++
++/* Name : icp_ocfDrvDigestSkbFragListCheck
++ *
++ * Description : This function is used by icp_ocfDrvSkbuffDigestPointerFind to
++ * process the non-linear portion of the skbuff, if the fragmentation type is
++ * a linked list
++ *
++ */
++static inline uint8_t *icp_ocfDrvDigestSkbFragListCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes)
++{
++
++ struct sk_buff *skb_list = skb_shared->frag_list;
++ /*check added for readability */
++ if (NULL == skb_list) {
++ DPRINTK("%s error processing skbuff "
++ "-- no more list! \n", __FUNCTION__);
++ return NULL;
++ }
++
++ for (; skb_list; skb_list = skb_list->next) {
++ if (NULL == skb_list) {
++ DPRINTK("%s error processing skbuff "
++ "-- no more list! \n", __FUNCTION__);
++ return NULL;
++ }
++
++ if (offsetInBytes >= skb_list->len) {
++ offsetInBytes -= skb_list->len;
++
++ } else {
++ if (offsetInBytes + digestSizeInBytes > skb_list->len) {
++ DPRINTK("%s() Auth payload stretches accross "
++ "contiguous memory\n", __FUNCTION__);
++ return NULL;
++ } else {
++ return (uint8_t *)
++ (skb_list->data + offsetInBytes);
++ }
++
++ }
++
++ /*This check is only needed if internal skb_list length values
++ are set wrong. */
++ if (0 > offsetInBytes) {
++ DPRINTK("%s() error processing skbuff object -- offset "
++ "calculation \n", __FUNCTION__);
++ return NULL;
++ }
++
++ }
++
++ /*catch all for unusual for-loop exit.
++ This code should never be reached */
++ DPRINTK("%s() Catch-All hit! Process error.\n", __FUNCTION__);
++ return NULL;
++}
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ep80579/Makefile linux-2.6.27.10/crypto/ocf/ep80579/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/ep80579/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ep80579/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,107 @@
++#########################################################################
++#
++# Targets supported
++# all - builds everything and installs
++# install - identical to all
++# depend - build dependencies
++# clean - clears derived objects except the .depend files
++# distclean- clears all derived objects and the .depend file
++#
++# @par
++# This file is provided under a dual BSD/GPLv2 license. When using or
++# redistributing this file, you may do so under either license.
++#
++# GPL LICENSE SUMMARY
++#
++# Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of version 2 of the GNU General Public License as
++# published by the Free Software Foundation.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++# The full GNU General Public License is included in this distribution
++# in the file called LICENSE.GPL.
++#
++# Contact Information:
++# Intel Corporation
++#
++# BSD LICENSE
++#
++# Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++# All rights reserved.
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions
++# are met:
++#
++# * Redistributions of source code must retain the above copyright
++# notice, this list of conditions and the following disclaimer.
++# * Redistributions in binary form must reproduce the above copyright
++# notice, this list of conditions and the following disclaimer in
++# the documentation and/or other materials provided with the
++# distribution.
++# * Neither the name of Intel Corporation nor the names of its
++# contributors may be used to endorse or promote products derived
++# from this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++#
++#
++# version: Security.L.1.0.130
++############################################################################
++
++
++####################Common variables and definitions########################
++
++# Ensure The ENV_DIR environmental var is defined.
++ifndef ICP_ENV_DIR
++$(error ICP_ENV_DIR is undefined. Please set the path to your environment makefile \
++ "-> setenv ICP_ENV_DIR <path>")
++endif
++
++#Add your project environment Makefile
++include $(ICP_ENV_DIR)/environment.mk
++
++#include the makefile with all the default and common Make variable definitions
++include $(ICP_BUILDSYSTEM_PATH)/build_files/common.mk
++
++#Add the name for the executable, Library or Module output definitions
++OUTPUT_NAME= icp_ocf
++
++# List of Source Files to be compiled
++SOURCES= icp_common.c icp_sym.c icp_asym.c
++
++#common includes between all supported OSes
++INCLUDES= -I $(ICP_API_DIR) -I$(ICP_LAC_API) \
++-I$(ICP_OCF_SRC_DIR)
++
++# The location of the os level makefile needs to be changed.
++include $(ICP_ENV_DIR)/$(ICP_OS)_$(ICP_OS_LEVEL).mk
++
++# On the line directly below list the outputs you wish to build for,
++# e.g "lib_static lib_shared exe module" as show below
++install: module
++
++###################Include rules makefiles########################
++include $(ICP_BUILDSYSTEM_PATH)/build_files/rules.mk
++###################End of Rules inclusion#########################
++
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/hifn/hifn7751.c linux-2.6.27.10/crypto/ocf/hifn/hifn7751.c
+--- linux-2.6.27.10.orig/crypto/ocf/hifn/hifn7751.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/hifn/hifn7751.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,2970 @@
++/* $OpenBSD: hifn7751.c,v 1.120 2002/05/17 00:33:34 deraadt Exp $ */
++
++/*-
++ * Invertex AEON / Hifn 7751 driver
++ * Copyright (c) 1999 Invertex Inc. All rights reserved.
++ * Copyright (c) 1999 Theo de Raadt
++ * Copyright (c) 2000-2001 Network Security Technologies, Inc.
++ * http://www.netsec.net
++ * Copyright (c) 2003 Hifn Inc.
++ *
++ * This driver is based on a previous driver by Invertex, for which they
++ * requested: Please send any comments, feedback, bug-fixes, or feature
++ * requests to software@invertex.com.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ *
++__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.40 2007/03/21 03:42:49 sam Exp $");
++ */
++
++/*
++ * Driver for various Hifn encryption processors.
++ */
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/version.h>
++#include <linux/skbuff.h>
++#include <asm/io.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++#include <hifn/hifn7751reg.h>
++#include <hifn/hifn7751var.h>
++
++#if 1
++#define DPRINTF(a...) if (hifn_debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_dev) : "hifn"); \
++ printk(a); \
++ } else
++#else
++#define DPRINTF(a...)
++#endif
++
++static inline int
++pci_get_revid(struct pci_dev *dev)
++{
++ u8 rid = 0;
++ pci_read_config_byte(dev, PCI_REVISION_ID, &rid);
++ return rid;
++}
++
++static struct hifn_stats hifnstats;
++
++#define debug hifn_debug
++int hifn_debug = 0;
++module_param(hifn_debug, int, 0644);
++MODULE_PARM_DESC(hifn_debug, "Enable debug");
++
++int hifn_maxbatch = 1;
++module_param(hifn_maxbatch, int, 0644);
++MODULE_PARM_DESC(hifn_maxbatch, "max ops to batch w/o interrupt");
++
++#ifdef MODULE_PARM
++char *hifn_pllconfig = NULL;
++MODULE_PARM(hifn_pllconfig, "s");
++#else
++char hifn_pllconfig[32]; /* This setting is RO after loading */
++module_param_string(hifn_pllconfig, hifn_pllconfig, 32, 0444);
++#endif
++MODULE_PARM_DESC(hifn_pllconfig, "PLL config, ie., pci66, ext33, ...");
++
++#ifdef HIFN_VULCANDEV
++#include <sys/conf.h>
++#include <sys/uio.h>
++
++static struct cdevsw vulcanpk_cdevsw; /* forward declaration */
++#endif
++
++/*
++ * Prototypes and count for the pci_device structure
++ */
++static int hifn_probe(struct pci_dev *dev, const struct pci_device_id *ent);
++static void hifn_remove(struct pci_dev *dev);
++
++static int hifn_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int hifn_freesession(device_t, u_int64_t);
++static int hifn_process(device_t, struct cryptop *, int);
++
++static device_method_t hifn_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, hifn_newsession),
++ DEVMETHOD(cryptodev_freesession,hifn_freesession),
++ DEVMETHOD(cryptodev_process, hifn_process),
++};
++
++static void hifn_reset_board(struct hifn_softc *, int);
++static void hifn_reset_puc(struct hifn_softc *);
++static void hifn_puc_wait(struct hifn_softc *);
++static int hifn_enable_crypto(struct hifn_softc *);
++static void hifn_set_retry(struct hifn_softc *sc);
++static void hifn_init_dma(struct hifn_softc *);
++static void hifn_init_pci_registers(struct hifn_softc *);
++static int hifn_sramsize(struct hifn_softc *);
++static int hifn_dramsize(struct hifn_softc *);
++static int hifn_ramtype(struct hifn_softc *);
++static void hifn_sessions(struct hifn_softc *);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++static irqreturn_t hifn_intr(int irq, void *arg);
++#else
++static irqreturn_t hifn_intr(int irq, void *arg, struct pt_regs *regs);
++#endif
++static u_int hifn_write_command(struct hifn_command *, u_int8_t *);
++static u_int32_t hifn_next_signature(u_int32_t a, u_int cnt);
++static void hifn_callback(struct hifn_softc *, struct hifn_command *, u_int8_t *);
++static int hifn_crypto(struct hifn_softc *, struct hifn_command *, struct cryptop *, int);
++static int hifn_readramaddr(struct hifn_softc *, int, u_int8_t *);
++static int hifn_writeramaddr(struct hifn_softc *, int, u_int8_t *);
++static int hifn_dmamap_load_src(struct hifn_softc *, struct hifn_command *);
++static int hifn_dmamap_load_dst(struct hifn_softc *, struct hifn_command *);
++static int hifn_init_pubrng(struct hifn_softc *);
++static void hifn_tick(unsigned long arg);
++static void hifn_abort(struct hifn_softc *);
++static void hifn_alloc_slot(struct hifn_softc *, int *, int *, int *, int *);
++
++static void hifn_write_reg_0(struct hifn_softc *, bus_size_t, u_int32_t);
++static void hifn_write_reg_1(struct hifn_softc *, bus_size_t, u_int32_t);
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++static int hifn_read_random(void *arg, u_int32_t *buf, int len);
++#endif
++
++#define HIFN_MAX_CHIPS 8
++static struct hifn_softc *hifn_chip_idx[HIFN_MAX_CHIPS];
++
++static __inline u_int32_t
++READ_REG_0(struct hifn_softc *sc, bus_size_t reg)
++{
++ u_int32_t v = readl(sc->sc_bar0 + reg);
++ sc->sc_bar0_lastreg = (bus_size_t) -1;
++ return (v);
++}
++#define WRITE_REG_0(sc, reg, val) hifn_write_reg_0(sc, reg, val)
++
++static __inline u_int32_t
++READ_REG_1(struct hifn_softc *sc, bus_size_t reg)
++{
++ u_int32_t v = readl(sc->sc_bar1 + reg);
++ sc->sc_bar1_lastreg = (bus_size_t) -1;
++ return (v);
++}
++#define WRITE_REG_1(sc, reg, val) hifn_write_reg_1(sc, reg, val)
++
++/*
++ * map in a given buffer (great on some arches :-)
++ */
++
++static int
++pci_map_uio(struct hifn_softc *sc, struct hifn_operand *buf, struct uio *uio)
++{
++ struct iovec *iov = uio->uio_iov;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf->mapsize = 0;
++ for (buf->nsegs = 0; buf->nsegs < uio->uio_iovcnt; ) {
++ buf->segs[buf->nsegs].ds_addr = pci_map_single(sc->sc_pcidev,
++ iov->iov_base, iov->iov_len,
++ PCI_DMA_BIDIRECTIONAL);
++ buf->segs[buf->nsegs].ds_len = iov->iov_len;
++ buf->mapsize += iov->iov_len;
++ iov++;
++ buf->nsegs++;
++ }
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++/*
++ * map in a given sk_buff
++ */
++
++static int
++pci_map_skb(struct hifn_softc *sc,struct hifn_operand *buf,struct sk_buff *skb)
++{
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf->mapsize = 0;
++
++ buf->segs[0].ds_addr = pci_map_single(sc->sc_pcidev,
++ skb->data, skb_headlen(skb), PCI_DMA_BIDIRECTIONAL);
++ buf->segs[0].ds_len = skb_headlen(skb);
++ buf->mapsize += buf->segs[0].ds_len;
++
++ buf->nsegs = 1;
++
++ for (i = 0; i < skb_shinfo(skb)->nr_frags; ) {
++ buf->segs[buf->nsegs].ds_len = skb_shinfo(skb)->frags[i].size;
++ buf->segs[buf->nsegs].ds_addr = pci_map_single(sc->sc_pcidev,
++ page_address(skb_shinfo(skb)->frags[i].page) +
++ skb_shinfo(skb)->frags[i].page_offset,
++ buf->segs[buf->nsegs].ds_len, PCI_DMA_BIDIRECTIONAL);
++ buf->mapsize += buf->segs[buf->nsegs].ds_len;
++ buf->nsegs++;
++ }
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++/*
++ * map in a given contiguous buffer
++ */
++
++static int
++pci_map_buf(struct hifn_softc *sc,struct hifn_operand *buf, void *b, int len)
++{
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf->mapsize = 0;
++ buf->segs[0].ds_addr = pci_map_single(sc->sc_pcidev,
++ b, len, PCI_DMA_BIDIRECTIONAL);
++ buf->segs[0].ds_len = len;
++ buf->mapsize += buf->segs[0].ds_len;
++ buf->nsegs = 1;
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++#if 0 /* not needed at this time */
++static void
++pci_sync_iov(struct hifn_softc *sc, struct hifn_operand *buf)
++{
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ for (i = 0; i < buf->nsegs; i++)
++ pci_dma_sync_single_for_cpu(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_len, PCI_DMA_BIDIRECTIONAL);
++}
++#endif
++
++static void
++pci_unmap_buf(struct hifn_softc *sc, struct hifn_operand *buf)
++{
++ int i;
++ DPRINTF("%s()\n", __FUNCTION__);
++ for (i = 0; i < buf->nsegs; i++) {
++ pci_unmap_single(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_len, PCI_DMA_BIDIRECTIONAL);
++ buf->segs[i].ds_addr = 0;
++ buf->segs[i].ds_len = 0;
++ }
++ buf->nsegs = 0;
++ buf->mapsize = 0;
++ buf->map = 0;
++}
++
++static const char*
++hifn_partname(struct hifn_softc *sc)
++{
++ /* XXX sprintf numbers when not decoded */
++ switch (pci_get_vendor(sc->sc_pcidev)) {
++ case PCI_VENDOR_HIFN:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_HIFN_6500: return "Hifn 6500";
++ case PCI_PRODUCT_HIFN_7751: return "Hifn 7751";
++ case PCI_PRODUCT_HIFN_7811: return "Hifn 7811";
++ case PCI_PRODUCT_HIFN_7951: return "Hifn 7951";
++ case PCI_PRODUCT_HIFN_7955: return "Hifn 7955";
++ case PCI_PRODUCT_HIFN_7956: return "Hifn 7956";
++ }
++ return "Hifn unknown-part";
++ case PCI_VENDOR_INVERTEX:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_INVERTEX_AEON: return "Invertex AEON";
++ }
++ return "Invertex unknown-part";
++ case PCI_VENDOR_NETSEC:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_NETSEC_7751: return "NetSec 7751";
++ }
++ return "NetSec unknown-part";
++ }
++ return "Unknown-vendor unknown-part";
++}
++
++static u_int
++checkmaxmin(struct pci_dev *dev, const char *what, u_int v, u_int min, u_int max)
++{
++ struct hifn_softc *sc = pci_get_drvdata(dev);
++ if (v > max) {
++ device_printf(sc->sc_dev, "Warning, %s %u out of range, "
++ "using max %u\n", what, v, max);
++ v = max;
++ } else if (v < min) {
++ device_printf(sc->sc_dev, "Warning, %s %u out of range, "
++ "using min %u\n", what, v, min);
++ v = min;
++ }
++ return v;
++}
++
++/*
++ * Select PLL configuration for 795x parts. This is complicated in
++ * that we cannot determine the optimal parameters without user input.
++ * The reference clock is derived from an external clock through a
++ * multiplier. The external clock is either the host bus (i.e. PCI)
++ * or an external clock generator. When using the PCI bus we assume
++ * the clock is either 33 or 66 MHz; for an external source we cannot
++ * tell the speed.
++ *
++ * PLL configuration is done with a string: "pci" for PCI bus, or "ext"
++ * for an external source, followed by the frequency. We calculate
++ * the appropriate multiplier and PLL register contents accordingly.
++ * When no configuration is given we default to "pci66" since that
++ * always will allow the card to work. If a card is using the PCI
++ * bus clock and in a 33MHz slot then it will be operating at half
++ * speed until the correct information is provided.
++ *
++ * We use a default setting of "ext66" because according to Mike Ham
++ * of HiFn, almost every board in existence has an external crystal
++ * populated at 66Mhz. Using PCI can be a problem on modern motherboards,
++ * because PCI33 can have clocks from 0 to 33Mhz, and some have
++ * non-PCI-compliant spread-spectrum clocks, which can confuse the pll.
++ */
++static void
++hifn_getpllconfig(struct pci_dev *dev, u_int *pll)
++{
++ const char *pllspec = hifn_pllconfig;
++ u_int freq, mul, fl, fh;
++ u_int32_t pllconfig;
++ char *nxt;
++
++ if (pllspec == NULL)
++ pllspec = "ext66";
++ fl = 33, fh = 66;
++ pllconfig = 0;
++ if (strncmp(pllspec, "ext", 3) == 0) {
++ pllspec += 3;
++ pllconfig |= HIFN_PLL_REF_SEL;
++ switch (pci_get_device(dev)) {
++ case PCI_PRODUCT_HIFN_7955:
++ case PCI_PRODUCT_HIFN_7956:
++ fl = 20, fh = 100;
++ break;
++#ifdef notyet
++ case PCI_PRODUCT_HIFN_7954:
++ fl = 20, fh = 66;
++ break;
++#endif
++ }
++ } else if (strncmp(pllspec, "pci", 3) == 0)
++ pllspec += 3;
++ freq = strtoul(pllspec, &nxt, 10);
++ if (nxt == pllspec)
++ freq = 66;
++ else
++ freq = checkmaxmin(dev, "frequency", freq, fl, fh);
++ /*
++ * Calculate multiplier. We target a Fck of 266 MHz,
++ * allowing only even values, possibly rounded down.
++ * Multipliers > 8 must set the charge pump current.
++ */
++ mul = checkmaxmin(dev, "PLL divisor", (266 / freq) &~ 1, 2, 12);
++ pllconfig |= (mul / 2 - 1) << HIFN_PLL_ND_SHIFT;
++ if (mul > 8)
++ pllconfig |= HIFN_PLL_IS;
++ *pll = pllconfig;
++}
++
++/*
++ * Attach an interface that successfully probed.
++ */
++static int
++hifn_probe(struct pci_dev *dev, const struct pci_device_id *ent)
++{
++ struct hifn_softc *sc = NULL;
++ char rbase;
++ u_int16_t ena, rev;
++ int rseg, rc;
++ unsigned long mem_start, mem_len;
++ static int num_chips = 0;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (pci_enable_device(dev) < 0)
++ return(-ENODEV);
++
++ if (pci_set_mwi(dev))
++ return(-ENODEV);
++
++ if (!dev->irq) {
++ printk("hifn: found device with no IRQ assigned. check BIOS settings!");
++ pci_disable_device(dev);
++ return(-ENODEV);
++ }
++
++ sc = (struct hifn_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return(-ENOMEM);
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, "hifn", num_chips, hifn_methods);
++
++ sc->sc_pcidev = dev;
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++ sc->sc_num = num_chips++;
++ if (sc->sc_num < HIFN_MAX_CHIPS)
++ hifn_chip_idx[sc->sc_num] = sc;
++
++ pci_set_drvdata(sc->sc_pcidev, sc);
++
++ spin_lock_init(&sc->sc_mtx);
++
++ /* XXX handle power management */
++
++ /*
++ * The 7951 and 795x have a random number generator and
++ * public key support; note this.
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_HIFN &&
++ (pci_get_device(dev) == PCI_PRODUCT_HIFN_7951 ||
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7955 ||
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7956))
++ sc->sc_flags = HIFN_HAS_RNG | HIFN_HAS_PUBLIC;
++ /*
++ * The 7811 has a random number generator and
++ * we also note it's identity 'cuz of some quirks.
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_HIFN &&
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7811)
++ sc->sc_flags |= HIFN_IS_7811 | HIFN_HAS_RNG;
++
++ /*
++ * The 795x parts support AES.
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_HIFN &&
++ (pci_get_device(dev) == PCI_PRODUCT_HIFN_7955 ||
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7956)) {
++ sc->sc_flags |= HIFN_IS_7956 | HIFN_HAS_AES;
++ /*
++ * Select PLL configuration. This depends on the
++ * bus and board design and must be manually configured
++ * if the default setting is unacceptable.
++ */
++ hifn_getpllconfig(dev, &sc->sc_pllconfig);
++ }
++
++ /*
++ * Setup PCI resources. Note that we record the bus
++ * tag and handle for each register mapping, this is
++ * used by the READ_REG_0, WRITE_REG_0, READ_REG_1,
++ * and WRITE_REG_1 macros throughout the driver.
++ */
++ mem_start = pci_resource_start(sc->sc_pcidev, 0);
++ mem_len = pci_resource_len(sc->sc_pcidev, 0);
++ sc->sc_bar0 = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_bar0) {
++ device_printf(sc->sc_dev, "cannot map bar%d register space\n", 0);
++ goto fail;
++ }
++ sc->sc_bar0_lastreg = (bus_size_t) -1;
++
++ mem_start = pci_resource_start(sc->sc_pcidev, 1);
++ mem_len = pci_resource_len(sc->sc_pcidev, 1);
++ sc->sc_bar1 = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_bar1) {
++ device_printf(sc->sc_dev, "cannot map bar%d register space\n", 1);
++ goto fail;
++ }
++ sc->sc_bar1_lastreg = (bus_size_t) -1;
++
++ /* fix up the bus size */
++ if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev, "No usable DMA configuration, aborting.\n");
++ goto fail;
++ }
++ if (pci_set_consistent_dma_mask(dev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev,
++ "No usable consistent DMA configuration, aborting.\n");
++ goto fail;
++ }
++
++ hifn_set_retry(sc);
++
++ /*
++ * Setup the area where the Hifn DMA's descriptors
++ * and associated data structures.
++ */
++ sc->sc_dma = (struct hifn_dma *) pci_alloc_consistent(dev,
++ sizeof(*sc->sc_dma),
++ &sc->sc_dma_physaddr);
++ if (!sc->sc_dma) {
++ device_printf(sc->sc_dev, "cannot alloc sc_dma\n");
++ goto fail;
++ }
++ bzero(sc->sc_dma, sizeof(*sc->sc_dma));
++
++ /*
++ * Reset the board and do the ``secret handshake''
++ * to enable the crypto support. Then complete the
++ * initialization procedure by setting up the interrupt
++ * and hooking in to the system crypto support so we'll
++ * get used for system services like the crypto device,
++ * IPsec, RNG device, etc.
++ */
++ hifn_reset_board(sc, 0);
++
++ if (hifn_enable_crypto(sc) != 0) {
++ device_printf(sc->sc_dev, "crypto enabling failed\n");
++ goto fail;
++ }
++ hifn_reset_puc(sc);
++
++ hifn_init_dma(sc);
++ hifn_init_pci_registers(sc);
++
++ pci_set_master(sc->sc_pcidev);
++
++ /* XXX can't dynamically determine ram type for 795x; force dram */
++ if (sc->sc_flags & HIFN_IS_7956)
++ sc->sc_drammodel = 1;
++ else if (hifn_ramtype(sc))
++ goto fail;
++
++ if (sc->sc_drammodel == 0)
++ hifn_sramsize(sc);
++ else
++ hifn_dramsize(sc);
++
++ /*
++ * Workaround for NetSec 7751 rev A: half ram size because two
++ * of the address lines were left floating
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_NETSEC &&
++ pci_get_device(dev) == PCI_PRODUCT_NETSEC_7751 &&
++ pci_get_revid(dev) == 0x61) /*XXX???*/
++ sc->sc_ramsize >>= 1;
++
++ /*
++ * Arrange the interrupt line.
++ */
++ rc = request_irq(dev->irq, hifn_intr, IRQF_SHARED, "hifn", sc);
++ if (rc) {
++ device_printf(sc->sc_dev, "could not map interrupt: %d\n", rc);
++ goto fail;
++ }
++ sc->sc_irq = dev->irq;
++
++ hifn_sessions(sc);
++
++ /*
++ * NB: Keep only the low 16 bits; this masks the chip id
++ * from the 7951.
++ */
++ rev = READ_REG_1(sc, HIFN_1_REVID) & 0xffff;
++
++ rseg = sc->sc_ramsize / 1024;
++ rbase = 'K';
++ if (sc->sc_ramsize >= (1024 * 1024)) {
++ rbase = 'M';
++ rseg /= 1024;
++ }
++ device_printf(sc->sc_dev, "%s, rev %u, %d%cB %cram",
++ hifn_partname(sc), rev,
++ rseg, rbase, sc->sc_drammodel ? 'd' : 's');
++ if (sc->sc_flags & HIFN_IS_7956)
++ printf(", pll=0x%x<%s clk, %ux mult>",
++ sc->sc_pllconfig,
++ sc->sc_pllconfig & HIFN_PLL_REF_SEL ? "ext" : "pci",
++ 2 + 2*((sc->sc_pllconfig & HIFN_PLL_ND) >> 11));
++ printf("\n");
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ device_printf(sc->sc_dev, "could not get crypto driver id\n");
++ goto fail;
++ }
++
++ WRITE_REG_0(sc, HIFN_0_PUCNFG,
++ READ_REG_0(sc, HIFN_0_PUCNFG) | HIFN_PUCNFG_CHIPID);
++ ena = READ_REG_0(sc, HIFN_0_PUSTAT) & HIFN_PUSTAT_CHIPENA;
++
++ switch (ena) {
++ case HIFN_PUSTAT_ENA_2:
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_ARC4, 0, 0);
++ if (sc->sc_flags & HIFN_HAS_AES)
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ /*FALLTHROUGH*/
++ case HIFN_PUSTAT_ENA_1:
++ crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ break;
++ }
++
++ if (sc->sc_flags & (HIFN_HAS_PUBLIC | HIFN_HAS_RNG))
++ hifn_init_pubrng(sc);
++
++ init_timer(&sc->sc_tickto);
++ sc->sc_tickto.function = hifn_tick;
++ sc->sc_tickto.data = (unsigned long) sc->sc_num;
++ mod_timer(&sc->sc_tickto, jiffies + HZ);
++
++ return (0);
++
++fail:
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_dma) {
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ pci_free_consistent(sc->sc_pcidev,
++ sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++ }
++ kfree(sc);
++ return (-ENXIO);
++}
++
++/*
++ * Detach an interface that successfully probed.
++ */
++static void
++hifn_remove(struct pci_dev *dev)
++{
++ struct hifn_softc *sc = pci_get_drvdata(dev);
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ KASSERT(sc != NULL, ("hifn_detach: null software carrier!"));
++
++ /* disable interrupts */
++ HIFN_LOCK(sc);
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, 0);
++ HIFN_UNLOCK(sc);
++
++ /*XXX other resources */
++ del_timer_sync(&sc->sc_tickto);
++
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ crypto_unregister_all(sc->sc_cid);
++
++ free_irq(sc->sc_irq, sc);
++
++ pci_free_consistent(sc->sc_pcidev, sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++}
++
++
++static int
++hifn_init_pubrng(struct hifn_softc *sc)
++{
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if ((sc->sc_flags & HIFN_IS_7811) == 0) {
++ /* Reset 7951 public key/rng engine */
++ WRITE_REG_1(sc, HIFN_1_PUB_RESET,
++ READ_REG_1(sc, HIFN_1_PUB_RESET) | HIFN_PUBRST_RESET);
++
++ for (i = 0; i < 100; i++) {
++ DELAY(1000);
++ if ((READ_REG_1(sc, HIFN_1_PUB_RESET) &
++ HIFN_PUBRST_RESET) == 0)
++ break;
++ }
++
++ if (i == 100) {
++ device_printf(sc->sc_dev, "public key init failed\n");
++ return (1);
++ }
++ }
++
++ /* Enable the rng, if available */
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ if (sc->sc_flags & HIFN_HAS_RNG) {
++ if (sc->sc_flags & HIFN_IS_7811) {
++ u_int32_t r;
++ r = READ_REG_1(sc, HIFN_1_7811_RNGENA);
++ if (r & HIFN_7811_RNGENA_ENA) {
++ r &= ~HIFN_7811_RNGENA_ENA;
++ WRITE_REG_1(sc, HIFN_1_7811_RNGENA, r);
++ }
++ WRITE_REG_1(sc, HIFN_1_7811_RNGCFG,
++ HIFN_7811_RNGCFG_DEFL);
++ r |= HIFN_7811_RNGENA_ENA;
++ WRITE_REG_1(sc, HIFN_1_7811_RNGENA, r);
++ } else
++ WRITE_REG_1(sc, HIFN_1_RNG_CONFIG,
++ READ_REG_1(sc, HIFN_1_RNG_CONFIG) |
++ HIFN_RNGCFG_ENA);
++
++ sc->sc_rngfirst = 1;
++ crypto_rregister(sc->sc_cid, hifn_read_random, sc);
++ }
++#endif
++
++ /* Enable public key engine, if available */
++ if (sc->sc_flags & HIFN_HAS_PUBLIC) {
++ WRITE_REG_1(sc, HIFN_1_PUB_IEN, HIFN_PUBIEN_DONE);
++ sc->sc_dmaier |= HIFN_DMAIER_PUBDONE;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++#ifdef HIFN_VULCANDEV
++ sc->sc_pkdev = make_dev(&vulcanpk_cdevsw, 0,
++ UID_ROOT, GID_WHEEL, 0666,
++ "vulcanpk");
++ sc->sc_pkdev->si_drv1 = sc;
++#endif
++ }
++
++ return (0);
++}
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++static int
++hifn_read_random(void *arg, u_int32_t *buf, int len)
++{
++ struct hifn_softc *sc = (struct hifn_softc *) arg;
++ u_int32_t sts;
++ int i, rc = 0;
++
++ if (len <= 0)
++ return rc;
++
++ if (sc->sc_flags & HIFN_IS_7811) {
++ /* ONLY VALID ON 7811!!!! */
++ for (i = 0; i < 5; i++) {
++ sts = READ_REG_1(sc, HIFN_1_7811_RNGSTS);
++ if (sts & HIFN_7811_RNGSTS_UFL) {
++ device_printf(sc->sc_dev,
++ "RNG underflow: disabling\n");
++ /* DAVIDM perhaps return -1 */
++ break;
++ }
++ if ((sts & HIFN_7811_RNGSTS_RDY) == 0)
++ break;
++
++ /*
++ * There are at least two words in the RNG FIFO
++ * at this point.
++ */
++ if (rc < len)
++ buf[rc++] = READ_REG_1(sc, HIFN_1_7811_RNGDAT);
++ if (rc < len)
++ buf[rc++] = READ_REG_1(sc, HIFN_1_7811_RNGDAT);
++ }
++ } else
++ buf[rc++] = READ_REG_1(sc, HIFN_1_RNG_DATA);
++
++ /* NB: discard first data read */
++ if (sc->sc_rngfirst) {
++ sc->sc_rngfirst = 0;
++ rc = 0;
++ }
++
++ return(rc);
++}
++#endif /* CONFIG_OCF_RANDOMHARVEST */
++
++static void
++hifn_puc_wait(struct hifn_softc *sc)
++{
++ int i;
++ int reg = HIFN_0_PUCTRL;
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ reg = HIFN_0_PUCTRL2;
++ }
++
++ for (i = 5000; i > 0; i--) {
++ DELAY(1);
++ if (!(READ_REG_0(sc, reg) & HIFN_PUCTRL_RESET))
++ break;
++ }
++ if (!i)
++ device_printf(sc->sc_dev, "proc unit did not reset(0x%x)\n",
++ READ_REG_0(sc, HIFN_0_PUCTRL));
++}
++
++/*
++ * Reset the processing unit.
++ */
++static void
++hifn_reset_puc(struct hifn_softc *sc)
++{
++ /* Reset processing unit */
++ int reg = HIFN_0_PUCTRL;
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ reg = HIFN_0_PUCTRL2;
++ }
++ WRITE_REG_0(sc, reg, HIFN_PUCTRL_DMAENA);
++
++ hifn_puc_wait(sc);
++}
++
++/*
++ * Set the Retry and TRDY registers; note that we set them to
++ * zero because the 7811 locks up when forced to retry (section
++ * 3.6 of "Specification Update SU-0014-04". Not clear if we
++ * should do this for all Hifn parts, but it doesn't seem to hurt.
++ */
++static void
++hifn_set_retry(struct hifn_softc *sc)
++{
++ DPRINTF("%s()\n", __FUNCTION__);
++ /* NB: RETRY only responds to 8-bit reads/writes */
++ pci_write_config_byte(sc->sc_pcidev, HIFN_RETRY_TIMEOUT, 0);
++ pci_write_config_dword(sc->sc_pcidev, HIFN_TRDY_TIMEOUT, 0);
++}
++
++/*
++ * Resets the board. Values in the regesters are left as is
++ * from the reset (i.e. initial values are assigned elsewhere).
++ */
++static void
++hifn_reset_board(struct hifn_softc *sc, int full)
++{
++ u_int32_t reg;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ /*
++ * Set polling in the DMA configuration register to zero. 0x7 avoids
++ * resetting the board and zeros out the other fields.
++ */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ /*
++ * Now that polling has been disabled, we have to wait 1 ms
++ * before resetting the board.
++ */
++ DELAY(1000);
++
++ /* Reset the DMA unit */
++ if (full) {
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MODE);
++ DELAY(1000);
++ } else {
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG,
++ HIFN_DMACNFG_MODE | HIFN_DMACNFG_MSTRESET);
++ hifn_reset_puc(sc);
++ }
++
++ KASSERT(sc->sc_dma != NULL, ("hifn_reset_board: null DMA tag!"));
++ bzero(sc->sc_dma, sizeof(*sc->sc_dma));
++
++ /* Bring dma unit out of reset */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ hifn_puc_wait(sc);
++ hifn_set_retry(sc);
++
++ if (sc->sc_flags & HIFN_IS_7811) {
++ for (reg = 0; reg < 1000; reg++) {
++ if (READ_REG_1(sc, HIFN_1_7811_MIPSRST) &
++ HIFN_MIPSRST_CRAMINIT)
++ break;
++ DELAY(1000);
++ }
++ if (reg == 1000)
++ device_printf(sc->sc_dev, ": cram init timeout\n");
++ } else {
++ /* set up DMA configuration register #2 */
++ /* turn off all PK and BAR0 swaps */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG2,
++ (3 << HIFN_DMACNFG2_INIT_WRITE_BURST_SHIFT)|
++ (3 << HIFN_DMACNFG2_INIT_READ_BURST_SHIFT)|
++ (2 << HIFN_DMACNFG2_TGT_WRITE_BURST_SHIFT)|
++ (2 << HIFN_DMACNFG2_TGT_READ_BURST_SHIFT));
++ }
++}
++
++static u_int32_t
++hifn_next_signature(u_int32_t a, u_int cnt)
++{
++ int i;
++ u_int32_t v;
++
++ for (i = 0; i < cnt; i++) {
++
++ /* get the parity */
++ v = a & 0x80080125;
++ v ^= v >> 16;
++ v ^= v >> 8;
++ v ^= v >> 4;
++ v ^= v >> 2;
++ v ^= v >> 1;
++
++ a = (v & 1) ^ (a << 1);
++ }
++
++ return a;
++}
++
++
++/*
++ * Checks to see if crypto is already enabled. If crypto isn't enable,
++ * "hifn_enable_crypto" is called to enable it. The check is important,
++ * as enabling crypto twice will lock the board.
++ */
++static int
++hifn_enable_crypto(struct hifn_softc *sc)
++{
++ u_int32_t dmacfg, ramcfg, encl, addr, i;
++ char offtbl[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00 };
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ ramcfg = READ_REG_0(sc, HIFN_0_PUCNFG);
++ dmacfg = READ_REG_1(sc, HIFN_1_DMA_CNFG);
++
++ /*
++ * The RAM config register's encrypt level bit needs to be set before
++ * every read performed on the encryption level register.
++ */
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, ramcfg | HIFN_PUCNFG_CHIPID);
++
++ encl = READ_REG_0(sc, HIFN_0_PUSTAT) & HIFN_PUSTAT_CHIPENA;
++
++ /*
++ * Make sure we don't re-unlock. Two unlocks kills chip until the
++ * next reboot.
++ */
++ if (encl == HIFN_PUSTAT_ENA_1 || encl == HIFN_PUSTAT_ENA_2) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev,
++ "Strong crypto already enabled!\n");
++#endif
++ goto report;
++ }
++
++ if (encl != 0 && encl != HIFN_PUSTAT_ENA_0) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev,
++ "Unknown encryption level 0x%x\n", encl);
++#endif
++ return 1;
++ }
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_UNLOCK |
++ HIFN_DMACNFG_MSTRESET | HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++ DELAY(1000);
++ addr = READ_REG_1(sc, HIFN_UNLOCK_SECRET1);
++ DELAY(1000);
++ WRITE_REG_1(sc, HIFN_UNLOCK_SECRET2, 0);
++ DELAY(1000);
++
++ for (i = 0; i <= 12; i++) {
++ addr = hifn_next_signature(addr, offtbl[i] + 0x101);
++ WRITE_REG_1(sc, HIFN_UNLOCK_SECRET2, addr);
++
++ DELAY(1000);
++ }
++
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, ramcfg | HIFN_PUCNFG_CHIPID);
++ encl = READ_REG_0(sc, HIFN_0_PUSTAT) & HIFN_PUSTAT_CHIPENA;
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ if (encl != HIFN_PUSTAT_ENA_1 && encl != HIFN_PUSTAT_ENA_2)
++ device_printf(sc->sc_dev, "Engine is permanently "
++ "locked until next system reset!\n");
++ else
++ device_printf(sc->sc_dev, "Engine enabled "
++ "successfully!\n");
++ }
++#endif
++
++report:
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, ramcfg);
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, dmacfg);
++
++ switch (encl) {
++ case HIFN_PUSTAT_ENA_1:
++ case HIFN_PUSTAT_ENA_2:
++ break;
++ case HIFN_PUSTAT_ENA_0:
++ default:
++ device_printf(sc->sc_dev, "disabled\n");
++ break;
++ }
++
++ return 0;
++}
++
++/*
++ * Give initial values to the registers listed in the "Register Space"
++ * section of the HIFN Software Development reference manual.
++ */
++static void
++hifn_init_pci_registers(struct hifn_softc *sc)
++{
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* write fixed values needed by the Initialization registers */
++ WRITE_REG_0(sc, HIFN_0_PUCTRL, HIFN_PUCTRL_DMAENA);
++ WRITE_REG_0(sc, HIFN_0_FIFOCNFG, HIFN_FIFOCNFG_THRESHOLD);
++ WRITE_REG_0(sc, HIFN_0_PUIER, HIFN_PUIER_DSTOVER);
++
++ /* write all 4 ring address registers */
++ WRITE_REG_1(sc, HIFN_1_DMA_CRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, cmdr[0]));
++ WRITE_REG_1(sc, HIFN_1_DMA_SRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, srcr[0]));
++ WRITE_REG_1(sc, HIFN_1_DMA_DRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, dstr[0]));
++ WRITE_REG_1(sc, HIFN_1_DMA_RRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, resr[0]));
++
++ DELAY(2000);
++
++ /* write status register */
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_D_CTRL_DIS | HIFN_DMACSR_R_CTRL_DIS |
++ HIFN_DMACSR_S_CTRL_DIS | HIFN_DMACSR_C_CTRL_DIS |
++ HIFN_DMACSR_D_ABORT | HIFN_DMACSR_D_DONE | HIFN_DMACSR_D_LAST |
++ HIFN_DMACSR_D_WAIT | HIFN_DMACSR_D_OVER |
++ HIFN_DMACSR_R_ABORT | HIFN_DMACSR_R_DONE | HIFN_DMACSR_R_LAST |
++ HIFN_DMACSR_R_WAIT | HIFN_DMACSR_R_OVER |
++ HIFN_DMACSR_S_ABORT | HIFN_DMACSR_S_DONE | HIFN_DMACSR_S_LAST |
++ HIFN_DMACSR_S_WAIT |
++ HIFN_DMACSR_C_ABORT | HIFN_DMACSR_C_DONE | HIFN_DMACSR_C_LAST |
++ HIFN_DMACSR_C_WAIT |
++ HIFN_DMACSR_ENGINE |
++ ((sc->sc_flags & HIFN_HAS_PUBLIC) ?
++ HIFN_DMACSR_PUBDONE : 0) |
++ ((sc->sc_flags & HIFN_IS_7811) ?
++ HIFN_DMACSR_ILLW | HIFN_DMACSR_ILLR : 0));
++
++ sc->sc_d_busy = sc->sc_r_busy = sc->sc_s_busy = sc->sc_c_busy = 0;
++ sc->sc_dmaier |= HIFN_DMAIER_R_DONE | HIFN_DMAIER_C_ABORT |
++ HIFN_DMAIER_D_OVER | HIFN_DMAIER_R_OVER |
++ HIFN_DMAIER_S_ABORT | HIFN_DMAIER_D_ABORT | HIFN_DMAIER_R_ABORT |
++ ((sc->sc_flags & HIFN_IS_7811) ?
++ HIFN_DMAIER_ILLW | HIFN_DMAIER_ILLR : 0);
++ sc->sc_dmaier &= ~HIFN_DMAIER_C_WAIT;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ u_int32_t pll;
++
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, HIFN_PUCNFG_COMPSING |
++ HIFN_PUCNFG_TCALLPHASES |
++ HIFN_PUCNFG_TCDRVTOTEM | HIFN_PUCNFG_BUS32);
++
++ /* turn off the clocks and insure bypass is set */
++ pll = READ_REG_1(sc, HIFN_1_PLL);
++ pll = (pll &~ (HIFN_PLL_PK_CLK_SEL | HIFN_PLL_PE_CLK_SEL))
++ | HIFN_PLL_BP | HIFN_PLL_MBSET;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ DELAY(10*1000); /* 10ms */
++
++ /* change configuration */
++ pll = (pll &~ HIFN_PLL_CONFIG) | sc->sc_pllconfig;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ DELAY(10*1000); /* 10ms */
++
++ /* disable bypass */
++ pll &= ~HIFN_PLL_BP;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ /* enable clocks with new configuration */
++ pll |= HIFN_PLL_PK_CLK_SEL | HIFN_PLL_PE_CLK_SEL;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ } else {
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, HIFN_PUCNFG_COMPSING |
++ HIFN_PUCNFG_DRFR_128 | HIFN_PUCNFG_TCALLPHASES |
++ HIFN_PUCNFG_TCDRVTOTEM | HIFN_PUCNFG_BUS32 |
++ (sc->sc_drammodel ? HIFN_PUCNFG_DRAM : HIFN_PUCNFG_SRAM));
++ }
++
++ WRITE_REG_0(sc, HIFN_0_PUISR, HIFN_PUISR_DSTOVER);
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE | HIFN_DMACNFG_LAST |
++ ((HIFN_POLL_FREQUENCY << 16 ) & HIFN_DMACNFG_POLLFREQ) |
++ ((HIFN_POLL_SCALAR << 8) & HIFN_DMACNFG_POLLINVAL));
++}
++
++/*
++ * The maximum number of sessions supported by the card
++ * is dependent on the amount of context ram, which
++ * encryption algorithms are enabled, and how compression
++ * is configured. This should be configured before this
++ * routine is called.
++ */
++static void
++hifn_sessions(struct hifn_softc *sc)
++{
++ u_int32_t pucnfg;
++ int ctxsize;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ pucnfg = READ_REG_0(sc, HIFN_0_PUCNFG);
++
++ if (pucnfg & HIFN_PUCNFG_COMPSING) {
++ if (pucnfg & HIFN_PUCNFG_ENCCNFG)
++ ctxsize = 128;
++ else
++ ctxsize = 512;
++ /*
++ * 7955/7956 has internal context memory of 32K
++ */
++ if (sc->sc_flags & HIFN_IS_7956)
++ sc->sc_maxses = 32768 / ctxsize;
++ else
++ sc->sc_maxses = 1 +
++ ((sc->sc_ramsize - 32768) / ctxsize);
++ } else
++ sc->sc_maxses = sc->sc_ramsize / 16384;
++
++ if (sc->sc_maxses > 2048)
++ sc->sc_maxses = 2048;
++}
++
++/*
++ * Determine ram type (sram or dram). Board should be just out of a reset
++ * state when this is called.
++ */
++static int
++hifn_ramtype(struct hifn_softc *sc)
++{
++ u_int8_t data[8], dataexpect[8];
++ int i;
++
++ for (i = 0; i < sizeof(data); i++)
++ data[i] = dataexpect[i] = 0x55;
++ if (hifn_writeramaddr(sc, 0, data))
++ return (-1);
++ if (hifn_readramaddr(sc, 0, data))
++ return (-1);
++ if (bcmp(data, dataexpect, sizeof(data)) != 0) {
++ sc->sc_drammodel = 1;
++ return (0);
++ }
++
++ for (i = 0; i < sizeof(data); i++)
++ data[i] = dataexpect[i] = 0xaa;
++ if (hifn_writeramaddr(sc, 0, data))
++ return (-1);
++ if (hifn_readramaddr(sc, 0, data))
++ return (-1);
++ if (bcmp(data, dataexpect, sizeof(data)) != 0) {
++ sc->sc_drammodel = 1;
++ return (0);
++ }
++
++ return (0);
++}
++
++#define HIFN_SRAM_MAX (32 << 20)
++#define HIFN_SRAM_STEP_SIZE 16384
++#define HIFN_SRAM_GRANULARITY (HIFN_SRAM_MAX / HIFN_SRAM_STEP_SIZE)
++
++static int
++hifn_sramsize(struct hifn_softc *sc)
++{
++ u_int32_t a;
++ u_int8_t data[8];
++ u_int8_t dataexpect[sizeof(data)];
++ int32_t i;
++
++ for (i = 0; i < sizeof(data); i++)
++ data[i] = dataexpect[i] = i ^ 0x5a;
++
++ for (i = HIFN_SRAM_GRANULARITY - 1; i >= 0; i--) {
++ a = i * HIFN_SRAM_STEP_SIZE;
++ bcopy(&i, data, sizeof(i));
++ hifn_writeramaddr(sc, a, data);
++ }
++
++ for (i = 0; i < HIFN_SRAM_GRANULARITY; i++) {
++ a = i * HIFN_SRAM_STEP_SIZE;
++ bcopy(&i, dataexpect, sizeof(i));
++ if (hifn_readramaddr(sc, a, data) < 0)
++ return (0);
++ if (bcmp(data, dataexpect, sizeof(data)) != 0)
++ return (0);
++ sc->sc_ramsize = a + HIFN_SRAM_STEP_SIZE;
++ }
++
++ return (0);
++}
++
++/*
++ * XXX For dram boards, one should really try all of the
++ * HIFN_PUCNFG_DSZ_*'s. This just assumes that PUCNFG
++ * is already set up correctly.
++ */
++static int
++hifn_dramsize(struct hifn_softc *sc)
++{
++ u_int32_t cnfg;
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ /*
++ * 7955/7956 have a fixed internal ram of only 32K.
++ */
++ sc->sc_ramsize = 32768;
++ } else {
++ cnfg = READ_REG_0(sc, HIFN_0_PUCNFG) &
++ HIFN_PUCNFG_DRAMMASK;
++ sc->sc_ramsize = 1 << ((cnfg >> 13) + 18);
++ }
++ return (0);
++}
++
++static void
++hifn_alloc_slot(struct hifn_softc *sc, int *cmdp, int *srcp, int *dstp, int *resp)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (dma->cmdi == HIFN_D_CMD_RSIZE) {
++ dma->cmdi = 0;
++ dma->cmdr[HIFN_D_CMD_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->cmdr[HIFN_D_CMD_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_CMDR_SYNC(sc, HIFN_D_CMD_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *cmdp = dma->cmdi++;
++ dma->cmdk = dma->cmdi;
++
++ if (dma->srci == HIFN_D_SRC_RSIZE) {
++ dma->srci = 0;
++ dma->srcr[HIFN_D_SRC_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->srcr[HIFN_D_SRC_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_SRCR_SYNC(sc, HIFN_D_SRC_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *srcp = dma->srci++;
++ dma->srck = dma->srci;
++
++ if (dma->dsti == HIFN_D_DST_RSIZE) {
++ dma->dsti = 0;
++ dma->dstr[HIFN_D_DST_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->dstr[HIFN_D_DST_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, HIFN_D_DST_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *dstp = dma->dsti++;
++ dma->dstk = dma->dsti;
++
++ if (dma->resi == HIFN_D_RES_RSIZE) {
++ dma->resi = 0;
++ dma->resr[HIFN_D_RES_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->resr[HIFN_D_RES_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_RESR_SYNC(sc, HIFN_D_RES_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *resp = dma->resi++;
++ dma->resk = dma->resi;
++}
++
++static int
++hifn_writeramaddr(struct hifn_softc *sc, int addr, u_int8_t *data)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ hifn_base_command_t wc;
++ const u_int32_t masks = HIFN_D_VALID | HIFN_D_LAST | HIFN_D_MASKDONEIRQ;
++ int r, cmdi, resi, srci, dsti;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ wc.masks = htole16(3 << 13);
++ wc.session_num = htole16(addr >> 14);
++ wc.total_source_count = htole16(8);
++ wc.total_dest_count = htole16(addr & 0x3fff);
++
++ hifn_alloc_slot(sc, &cmdi, &srci, &dsti, &resi);
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_ENA | HIFN_DMACSR_S_CTRL_ENA |
++ HIFN_DMACSR_D_CTRL_ENA | HIFN_DMACSR_R_CTRL_ENA);
++
++ /* build write command */
++ bzero(dma->command_bufs[cmdi], HIFN_MAX_COMMAND);
++ *(hifn_base_command_t *)dma->command_bufs[cmdi] = wc;
++ bcopy(data, &dma->test_src, sizeof(dma->test_src));
++
++ dma->srcr[srci].p = htole32(sc->sc_dma_physaddr
++ + offsetof(struct hifn_dma, test_src));
++ dma->dstr[dsti].p = htole32(sc->sc_dma_physaddr
++ + offsetof(struct hifn_dma, test_dst));
++
++ dma->cmdr[cmdi].l = htole32(16 | masks);
++ dma->srcr[srci].l = htole32(8 | masks);
++ dma->dstr[dsti].l = htole32(4 | masks);
++ dma->resr[resi].l = htole32(4 | masks);
++
++ for (r = 10000; r >= 0; r--) {
++ DELAY(10);
++ if ((dma->resr[resi].l & htole32(HIFN_D_VALID)) == 0)
++ break;
++ }
++ if (r == 0) {
++ device_printf(sc->sc_dev, "writeramaddr -- "
++ "result[%d](addr %d) still valid\n", resi, addr);
++ r = -1;
++ return (-1);
++ } else
++ r = 0;
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_DIS | HIFN_DMACSR_S_CTRL_DIS |
++ HIFN_DMACSR_D_CTRL_DIS | HIFN_DMACSR_R_CTRL_DIS);
++
++ return (r);
++}
++
++static int
++hifn_readramaddr(struct hifn_softc *sc, int addr, u_int8_t *data)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ hifn_base_command_t rc;
++ const u_int32_t masks = HIFN_D_VALID | HIFN_D_LAST | HIFN_D_MASKDONEIRQ;
++ int r, cmdi, srci, dsti, resi;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ rc.masks = htole16(2 << 13);
++ rc.session_num = htole16(addr >> 14);
++ rc.total_source_count = htole16(addr & 0x3fff);
++ rc.total_dest_count = htole16(8);
++
++ hifn_alloc_slot(sc, &cmdi, &srci, &dsti, &resi);
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_ENA | HIFN_DMACSR_S_CTRL_ENA |
++ HIFN_DMACSR_D_CTRL_ENA | HIFN_DMACSR_R_CTRL_ENA);
++
++ bzero(dma->command_bufs[cmdi], HIFN_MAX_COMMAND);
++ *(hifn_base_command_t *)dma->command_bufs[cmdi] = rc;
++
++ dma->srcr[srci].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, test_src));
++ dma->test_src = 0;
++ dma->dstr[dsti].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, test_dst));
++ dma->test_dst = 0;
++ dma->cmdr[cmdi].l = htole32(8 | masks);
++ dma->srcr[srci].l = htole32(8 | masks);
++ dma->dstr[dsti].l = htole32(8 | masks);
++ dma->resr[resi].l = htole32(HIFN_MAX_RESULT | masks);
++
++ for (r = 10000; r >= 0; r--) {
++ DELAY(10);
++ if ((dma->resr[resi].l & htole32(HIFN_D_VALID)) == 0)
++ break;
++ }
++ if (r == 0) {
++ device_printf(sc->sc_dev, "readramaddr -- "
++ "result[%d](addr %d) still valid\n", resi, addr);
++ r = -1;
++ } else {
++ r = 0;
++ bcopy(&dma->test_dst, data, sizeof(dma->test_dst));
++ }
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_DIS | HIFN_DMACSR_S_CTRL_DIS |
++ HIFN_DMACSR_D_CTRL_DIS | HIFN_DMACSR_R_CTRL_DIS);
++
++ return (r);
++}
++
++/*
++ * Initialize the descriptor rings.
++ */
++static void
++hifn_init_dma(struct hifn_softc *sc)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ hifn_set_retry(sc);
++
++ /* initialize static pointer values */
++ for (i = 0; i < HIFN_D_CMD_RSIZE; i++)
++ dma->cmdr[i].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, command_bufs[i][0]));
++ for (i = 0; i < HIFN_D_RES_RSIZE; i++)
++ dma->resr[i].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, result_bufs[i][0]));
++
++ dma->cmdr[HIFN_D_CMD_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, cmdr[0]));
++ dma->srcr[HIFN_D_SRC_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, srcr[0]));
++ dma->dstr[HIFN_D_DST_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, dstr[0]));
++ dma->resr[HIFN_D_RES_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, resr[0]));
++
++ dma->cmdu = dma->srcu = dma->dstu = dma->resu = 0;
++ dma->cmdi = dma->srci = dma->dsti = dma->resi = 0;
++ dma->cmdk = dma->srck = dma->dstk = dma->resk = 0;
++}
++
++/*
++ * Writes out the raw command buffer space. Returns the
++ * command buffer size.
++ */
++static u_int
++hifn_write_command(struct hifn_command *cmd, u_int8_t *buf)
++{
++ struct hifn_softc *sc = NULL;
++ u_int8_t *buf_pos;
++ hifn_base_command_t *base_cmd;
++ hifn_mac_command_t *mac_cmd;
++ hifn_crypt_command_t *cry_cmd;
++ int using_mac, using_crypt, len, ivlen;
++ u_int32_t dlen, slen;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf_pos = buf;
++ using_mac = cmd->base_masks & HIFN_BASE_CMD_MAC;
++ using_crypt = cmd->base_masks & HIFN_BASE_CMD_CRYPT;
++
++ base_cmd = (hifn_base_command_t *)buf_pos;
++ base_cmd->masks = htole16(cmd->base_masks);
++ slen = cmd->src_mapsize;
++ if (cmd->sloplen)
++ dlen = cmd->dst_mapsize - cmd->sloplen + sizeof(u_int32_t);
++ else
++ dlen = cmd->dst_mapsize;
++ base_cmd->total_source_count = htole16(slen & HIFN_BASE_CMD_LENMASK_LO);
++ base_cmd->total_dest_count = htole16(dlen & HIFN_BASE_CMD_LENMASK_LO);
++ dlen >>= 16;
++ slen >>= 16;
++ base_cmd->session_num = htole16(
++ ((slen << HIFN_BASE_CMD_SRCLEN_S) & HIFN_BASE_CMD_SRCLEN_M) |
++ ((dlen << HIFN_BASE_CMD_DSTLEN_S) & HIFN_BASE_CMD_DSTLEN_M));
++ buf_pos += sizeof(hifn_base_command_t);
++
++ if (using_mac) {
++ mac_cmd = (hifn_mac_command_t *)buf_pos;
++ dlen = cmd->maccrd->crd_len;
++ mac_cmd->source_count = htole16(dlen & 0xffff);
++ dlen >>= 16;
++ mac_cmd->masks = htole16(cmd->mac_masks |
++ ((dlen << HIFN_MAC_CMD_SRCLEN_S) & HIFN_MAC_CMD_SRCLEN_M));
++ mac_cmd->header_skip = htole16(cmd->maccrd->crd_skip);
++ mac_cmd->reserved = 0;
++ buf_pos += sizeof(hifn_mac_command_t);
++ }
++
++ if (using_crypt) {
++ cry_cmd = (hifn_crypt_command_t *)buf_pos;
++ dlen = cmd->enccrd->crd_len;
++ cry_cmd->source_count = htole16(dlen & 0xffff);
++ dlen >>= 16;
++ cry_cmd->masks = htole16(cmd->cry_masks |
++ ((dlen << HIFN_CRYPT_CMD_SRCLEN_S) & HIFN_CRYPT_CMD_SRCLEN_M));
++ cry_cmd->header_skip = htole16(cmd->enccrd->crd_skip);
++ cry_cmd->reserved = 0;
++ buf_pos += sizeof(hifn_crypt_command_t);
++ }
++
++ if (using_mac && cmd->mac_masks & HIFN_MAC_CMD_NEW_KEY) {
++ bcopy(cmd->mac, buf_pos, HIFN_MAC_KEY_LENGTH);
++ buf_pos += HIFN_MAC_KEY_LENGTH;
++ }
++
++ if (using_crypt && cmd->cry_masks & HIFN_CRYPT_CMD_NEW_KEY) {
++ switch (cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) {
++ case HIFN_CRYPT_CMD_ALG_3DES:
++ bcopy(cmd->ck, buf_pos, HIFN_3DES_KEY_LENGTH);
++ buf_pos += HIFN_3DES_KEY_LENGTH;
++ break;
++ case HIFN_CRYPT_CMD_ALG_DES:
++ bcopy(cmd->ck, buf_pos, HIFN_DES_KEY_LENGTH);
++ buf_pos += HIFN_DES_KEY_LENGTH;
++ break;
++ case HIFN_CRYPT_CMD_ALG_RC4:
++ len = 256;
++ do {
++ int clen;
++
++ clen = MIN(cmd->cklen, len);
++ bcopy(cmd->ck, buf_pos, clen);
++ len -= clen;
++ buf_pos += clen;
++ } while (len > 0);
++ bzero(buf_pos, 4);
++ buf_pos += 4;
++ break;
++ case HIFN_CRYPT_CMD_ALG_AES:
++ /*
++ * AES keys are variable 128, 192 and
++ * 256 bits (16, 24 and 32 bytes).
++ */
++ bcopy(cmd->ck, buf_pos, cmd->cklen);
++ buf_pos += cmd->cklen;
++ break;
++ }
++ }
++
++ if (using_crypt && cmd->cry_masks & HIFN_CRYPT_CMD_NEW_IV) {
++ switch (cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) {
++ case HIFN_CRYPT_CMD_ALG_AES:
++ ivlen = HIFN_AES_IV_LENGTH;
++ break;
++ default:
++ ivlen = HIFN_IV_LENGTH;
++ break;
++ }
++ bcopy(cmd->iv, buf_pos, ivlen);
++ buf_pos += ivlen;
++ }
++
++ if ((cmd->base_masks & (HIFN_BASE_CMD_MAC|HIFN_BASE_CMD_CRYPT)) == 0) {
++ bzero(buf_pos, 8);
++ buf_pos += 8;
++ }
++
++ return (buf_pos - buf);
++}
++
++static int
++hifn_dmamap_aligned(struct hifn_operand *op)
++{
++ struct hifn_softc *sc = NULL;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ for (i = 0; i < op->nsegs; i++) {
++ if (op->segs[i].ds_addr & 3)
++ return (0);
++ if ((i != (op->nsegs - 1)) && (op->segs[i].ds_len & 3))
++ return (0);
++ }
++ return (1);
++}
++
++static __inline int
++hifn_dmamap_dstwrap(struct hifn_softc *sc, int idx)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++
++ if (++idx == HIFN_D_DST_RSIZE) {
++ dma->dstr[idx].l = htole32(HIFN_D_VALID | HIFN_D_JUMP |
++ HIFN_D_MASKDONEIRQ);
++ HIFN_DSTR_SYNC(sc, idx,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ idx = 0;
++ }
++ return (idx);
++}
++
++static int
++hifn_dmamap_load_dst(struct hifn_softc *sc, struct hifn_command *cmd)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct hifn_operand *dst = &cmd->dst;
++ u_int32_t p, l;
++ int idx, used = 0, i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ idx = dma->dsti;
++ for (i = 0; i < dst->nsegs - 1; i++) {
++ dma->dstr[idx].p = htole32(dst->segs[i].ds_addr);
++ dma->dstr[idx].l = htole32(HIFN_D_MASKDONEIRQ | dst->segs[i].ds_len);
++ wmb();
++ dma->dstr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, idx,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ used++;
++
++ idx = hifn_dmamap_dstwrap(sc, idx);
++ }
++
++ if (cmd->sloplen == 0) {
++ p = dst->segs[i].ds_addr;
++ l = HIFN_D_MASKDONEIRQ | HIFN_D_LAST |
++ dst->segs[i].ds_len;
++ } else {
++ p = sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, slop[cmd->slopidx]);
++ l = HIFN_D_MASKDONEIRQ | HIFN_D_LAST |
++ sizeof(u_int32_t);
++
++ if ((dst->segs[i].ds_len - cmd->sloplen) != 0) {
++ dma->dstr[idx].p = htole32(dst->segs[i].ds_addr);
++ dma->dstr[idx].l = htole32(HIFN_D_MASKDONEIRQ |
++ (dst->segs[i].ds_len - cmd->sloplen));
++ wmb();
++ dma->dstr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, idx,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ used++;
++
++ idx = hifn_dmamap_dstwrap(sc, idx);
++ }
++ }
++ dma->dstr[idx].p = htole32(p);
++ dma->dstr[idx].l = htole32(l);
++ wmb();
++ dma->dstr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, idx, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ used++;
++
++ idx = hifn_dmamap_dstwrap(sc, idx);
++
++ dma->dsti = idx;
++ dma->dstu += used;
++ return (idx);
++}
++
++static __inline int
++hifn_dmamap_srcwrap(struct hifn_softc *sc, int idx)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++
++ if (++idx == HIFN_D_SRC_RSIZE) {
++ dma->srcr[idx].l = htole32(HIFN_D_VALID |
++ HIFN_D_JUMP | HIFN_D_MASKDONEIRQ);
++ HIFN_SRCR_SYNC(sc, HIFN_D_SRC_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ idx = 0;
++ }
++ return (idx);
++}
++
++static int
++hifn_dmamap_load_src(struct hifn_softc *sc, struct hifn_command *cmd)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct hifn_operand *src = &cmd->src;
++ int idx, i;
++ u_int32_t last = 0;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ idx = dma->srci;
++ for (i = 0; i < src->nsegs; i++) {
++ if (i == src->nsegs - 1)
++ last = HIFN_D_LAST;
++
++ dma->srcr[idx].p = htole32(src->segs[i].ds_addr);
++ dma->srcr[idx].l = htole32(src->segs[i].ds_len |
++ HIFN_D_MASKDONEIRQ | last);
++ wmb();
++ dma->srcr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_SRCR_SYNC(sc, idx,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++
++ idx = hifn_dmamap_srcwrap(sc, idx);
++ }
++ dma->srci = idx;
++ dma->srcu += src->nsegs;
++ return (idx);
++}
++
++
++static int
++hifn_crypto(
++ struct hifn_softc *sc,
++ struct hifn_command *cmd,
++ struct cryptop *crp,
++ int hint)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ u_int32_t cmdlen, csr;
++ int cmdi, resi, err = 0;
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /*
++ * need 1 cmd, and 1 res
++ *
++ * NB: check this first since it's easy.
++ */
++ HIFN_LOCK(sc);
++ if ((dma->cmdu + 1) > HIFN_D_CMD_RSIZE ||
++ (dma->resu + 1) > HIFN_D_RES_RSIZE) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "cmd/result exhaustion, cmdu %u resu %u\n",
++ dma->cmdu, dma->resu);
++ }
++#endif
++ hifnstats.hst_nomem_cr++;
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ HIFN_UNLOCK(sc);
++ return (ERESTART);
++ }
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (pci_map_skb(sc, &cmd->src, cmd->src_skb)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_srcmap1;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ if (pci_map_uio(sc, &cmd->src, cmd->src_io)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_srcmap1;
++ }
++ } else {
++ if (pci_map_buf(sc, &cmd->src, cmd->src_buf, crp->crp_ilen)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_srcmap1;
++ }
++ }
++
++ if (hifn_dmamap_aligned(&cmd->src)) {
++ cmd->sloplen = cmd->src_mapsize & 3;
++ cmd->dst = cmd->src;
++ } else {
++ if (crp->crp_flags & CRYPTO_F_IOV) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto err_srcmap;
++ } else if (crp->crp_flags & CRYPTO_F_SKBUF) {
++#ifdef NOTYET
++ int totlen, len;
++ struct mbuf *m, *m0, *mlast;
++
++ KASSERT(cmd->dst_m == cmd->src_m,
++ ("hifn_crypto: dst_m initialized improperly"));
++ hifnstats.hst_unaligned++;
++ /*
++ * Source is not aligned on a longword boundary.
++ * Copy the data to insure alignment. If we fail
++ * to allocate mbufs or clusters while doing this
++ * we return ERESTART so the operation is requeued
++ * at the crypto later, but only if there are
++ * ops already posted to the hardware; otherwise we
++ * have no guarantee that we'll be re-entered.
++ */
++ totlen = cmd->src_mapsize;
++ if (cmd->src_m->m_flags & M_PKTHDR) {
++ len = MHLEN;
++ MGETHDR(m0, M_DONTWAIT, MT_DATA);
++ if (m0 && !m_dup_pkthdr(m0, cmd->src_m, M_DONTWAIT)) {
++ m_free(m0);
++ m0 = NULL;
++ }
++ } else {
++ len = MLEN;
++ MGET(m0, M_DONTWAIT, MT_DATA);
++ }
++ if (m0 == NULL) {
++ hifnstats.hst_nomem_mbuf++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ goto err_srcmap;
++ }
++ if (totlen >= MINCLSIZE) {
++ MCLGET(m0, M_DONTWAIT);
++ if ((m0->m_flags & M_EXT) == 0) {
++ hifnstats.hst_nomem_mcl++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ m_freem(m0);
++ goto err_srcmap;
++ }
++ len = MCLBYTES;
++ }
++ totlen -= len;
++ m0->m_pkthdr.len = m0->m_len = len;
++ mlast = m0;
++
++ while (totlen > 0) {
++ MGET(m, M_DONTWAIT, MT_DATA);
++ if (m == NULL) {
++ hifnstats.hst_nomem_mbuf++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ m_freem(m0);
++ goto err_srcmap;
++ }
++ len = MLEN;
++ if (totlen >= MINCLSIZE) {
++ MCLGET(m, M_DONTWAIT);
++ if ((m->m_flags & M_EXT) == 0) {
++ hifnstats.hst_nomem_mcl++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ mlast->m_next = m;
++ m_freem(m0);
++ goto err_srcmap;
++ }
++ len = MCLBYTES;
++ }
++
++ m->m_len = len;
++ m0->m_pkthdr.len += len;
++ totlen -= len;
++
++ mlast->m_next = m;
++ mlast = m;
++ }
++ cmd->dst_m = m0;
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF unaligned not implemented\n",
++ __FILE__, __LINE__);
++ err = EINVAL;
++ goto err_srcmap;
++#endif
++ } else {
++ device_printf(sc->sc_dev,
++ "%s,%d: unaligned contig buffers not implemented\n",
++ __FILE__, __LINE__);
++ err = EINVAL;
++ goto err_srcmap;
++ }
++ }
++
++ if (cmd->dst_map == NULL) {
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (pci_map_skb(sc, &cmd->dst, cmd->dst_skb)) {
++ hifnstats.hst_nomem_map++;
++ err = ENOMEM;
++ goto err_dstmap1;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ if (pci_map_uio(sc, &cmd->dst, cmd->dst_io)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_dstmap1;
++ }
++ } else {
++ if (pci_map_buf(sc, &cmd->dst, cmd->dst_buf, crp->crp_ilen)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_dstmap1;
++ }
++ }
++ }
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "Entering cmd: stat %8x ien %8x u %d/%d/%d/%d n %d/%d\n",
++ READ_REG_1(sc, HIFN_1_DMA_CSR),
++ READ_REG_1(sc, HIFN_1_DMA_IER),
++ dma->cmdu, dma->srcu, dma->dstu, dma->resu,
++ cmd->src_nsegs, cmd->dst_nsegs);
++ }
++#endif
++
++#if 0
++ if (cmd->src_map == cmd->dst_map) {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
++ } else {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_PREWRITE);
++ bus_dmamap_sync(sc->sc_dmat, cmd->dst_map,
++ BUS_DMASYNC_PREREAD);
++ }
++#endif
++
++ /*
++ * need N src, and N dst
++ */
++ if ((dma->srcu + cmd->src_nsegs) > HIFN_D_SRC_RSIZE ||
++ (dma->dstu + cmd->dst_nsegs + 1) > HIFN_D_DST_RSIZE) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "src/dst exhaustion, srcu %u+%u dstu %u+%u\n",
++ dma->srcu, cmd->src_nsegs,
++ dma->dstu, cmd->dst_nsegs);
++ }
++#endif
++ hifnstats.hst_nomem_sd++;
++ err = ERESTART;
++ goto err_dstmap;
++ }
++
++ if (dma->cmdi == HIFN_D_CMD_RSIZE) {
++ dma->cmdi = 0;
++ dma->cmdr[HIFN_D_CMD_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->cmdr[HIFN_D_CMD_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_CMDR_SYNC(sc, HIFN_D_CMD_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ cmdi = dma->cmdi++;
++ cmdlen = hifn_write_command(cmd, dma->command_bufs[cmdi]);
++ HIFN_CMD_SYNC(sc, cmdi, BUS_DMASYNC_PREWRITE);
++
++ /* .p for command/result already set */
++ dma->cmdr[cmdi].l = htole32(cmdlen | HIFN_D_LAST |
++ HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->cmdr[cmdi].l |= htole32(HIFN_D_VALID);
++ HIFN_CMDR_SYNC(sc, cmdi,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ dma->cmdu++;
++
++ /*
++ * We don't worry about missing an interrupt (which a "command wait"
++ * interrupt salvages us from), unless there is more than one command
++ * in the queue.
++ */
++ if (dma->cmdu > 1) {
++ sc->sc_dmaier |= HIFN_DMAIER_C_WAIT;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++ }
++
++ hifnstats.hst_ipackets++;
++ hifnstats.hst_ibytes += cmd->src_mapsize;
++
++ hifn_dmamap_load_src(sc, cmd);
++
++ /*
++ * Unlike other descriptors, we don't mask done interrupt from
++ * result descriptor.
++ */
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev, "load res\n");
++#endif
++ if (dma->resi == HIFN_D_RES_RSIZE) {
++ dma->resi = 0;
++ dma->resr[HIFN_D_RES_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->resr[HIFN_D_RES_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_RESR_SYNC(sc, HIFN_D_RES_RSIZE,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ }
++ resi = dma->resi++;
++ KASSERT(dma->hifn_commands[resi] == NULL,
++ ("hifn_crypto: command slot %u busy", resi));
++ dma->hifn_commands[resi] = cmd;
++ HIFN_RES_SYNC(sc, resi, BUS_DMASYNC_PREREAD);
++ if ((hint & CRYPTO_HINT_MORE) && sc->sc_curbatch < hifn_maxbatch) {
++ dma->resr[resi].l = htole32(HIFN_MAX_RESULT |
++ HIFN_D_LAST | HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->resr[resi].l |= htole32(HIFN_D_VALID);
++ sc->sc_curbatch++;
++ if (sc->sc_curbatch > hifnstats.hst_maxbatch)
++ hifnstats.hst_maxbatch = sc->sc_curbatch;
++ hifnstats.hst_totbatch++;
++ } else {
++ dma->resr[resi].l = htole32(HIFN_MAX_RESULT | HIFN_D_LAST);
++ wmb();
++ dma->resr[resi].l |= htole32(HIFN_D_VALID);
++ sc->sc_curbatch = 0;
++ }
++ HIFN_RESR_SYNC(sc, resi,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ dma->resu++;
++
++ if (cmd->sloplen)
++ cmd->slopidx = resi;
++
++ hifn_dmamap_load_dst(sc, cmd);
++
++ csr = 0;
++ if (sc->sc_c_busy == 0) {
++ csr |= HIFN_DMACSR_C_CTRL_ENA;
++ sc->sc_c_busy = 1;
++ }
++ if (sc->sc_s_busy == 0) {
++ csr |= HIFN_DMACSR_S_CTRL_ENA;
++ sc->sc_s_busy = 1;
++ }
++ if (sc->sc_r_busy == 0) {
++ csr |= HIFN_DMACSR_R_CTRL_ENA;
++ sc->sc_r_busy = 1;
++ }
++ if (sc->sc_d_busy == 0) {
++ csr |= HIFN_DMACSR_D_CTRL_ENA;
++ sc->sc_d_busy = 1;
++ }
++ if (csr)
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR, csr);
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev, "command: stat %8x ier %8x\n",
++ READ_REG_1(sc, HIFN_1_DMA_CSR),
++ READ_REG_1(sc, HIFN_1_DMA_IER));
++ }
++#endif
++
++ sc->sc_active = 5;
++ HIFN_UNLOCK(sc);
++ KASSERT(err == 0, ("hifn_crypto: success with error %u", err));
++ return (err); /* success */
++
++err_dstmap:
++ if (cmd->src_map != cmd->dst_map)
++ pci_unmap_buf(sc, &cmd->dst);
++err_dstmap1:
++err_srcmap:
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (cmd->src_skb != cmd->dst_skb)
++#ifdef NOTYET
++ m_freem(cmd->dst_m);
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF src != dst not implemented\n",
++ __FILE__, __LINE__);
++#endif
++ }
++ pci_unmap_buf(sc, &cmd->src);
++err_srcmap1:
++ HIFN_UNLOCK(sc);
++ return (err);
++}
++
++static void
++hifn_tick(unsigned long arg)
++{
++ struct hifn_softc *sc;
++ unsigned long l_flags;
++
++ if (arg >= HIFN_MAX_CHIPS)
++ return;
++ sc = hifn_chip_idx[arg];
++ if (!sc)
++ return;
++
++ HIFN_LOCK(sc);
++ if (sc->sc_active == 0) {
++ struct hifn_dma *dma = sc->sc_dma;
++ u_int32_t r = 0;
++
++ if (dma->cmdu == 0 && sc->sc_c_busy) {
++ sc->sc_c_busy = 0;
++ r |= HIFN_DMACSR_C_CTRL_DIS;
++ }
++ if (dma->srcu == 0 && sc->sc_s_busy) {
++ sc->sc_s_busy = 0;
++ r |= HIFN_DMACSR_S_CTRL_DIS;
++ }
++ if (dma->dstu == 0 && sc->sc_d_busy) {
++ sc->sc_d_busy = 0;
++ r |= HIFN_DMACSR_D_CTRL_DIS;
++ }
++ if (dma->resu == 0 && sc->sc_r_busy) {
++ sc->sc_r_busy = 0;
++ r |= HIFN_DMACSR_R_CTRL_DIS;
++ }
++ if (r)
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR, r);
++ } else
++ sc->sc_active--;
++ HIFN_UNLOCK(sc);
++ mod_timer(&sc->sc_tickto, jiffies + HZ);
++}
++
++static irqreturn_t
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++hifn_intr(int irq, void *arg)
++#else
++hifn_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct hifn_softc *sc = arg;
++ struct hifn_dma *dma;
++ u_int32_t dmacsr, restart;
++ int i, u;
++ unsigned long l_flags;
++
++ dmacsr = READ_REG_1(sc, HIFN_1_DMA_CSR);
++
++ /* Nothing in the DMA unit interrupted */
++ if ((dmacsr & sc->sc_dmaier) == 0)
++ return IRQ_NONE;
++
++ HIFN_LOCK(sc);
++
++ dma = sc->sc_dma;
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "irq: stat %08x ien %08x damier %08x i %d/%d/%d/%d k %d/%d/%d/%d u %d/%d/%d/%d\n",
++ dmacsr, READ_REG_1(sc, HIFN_1_DMA_IER), sc->sc_dmaier,
++ dma->cmdi, dma->srci, dma->dsti, dma->resi,
++ dma->cmdk, dma->srck, dma->dstk, dma->resk,
++ dma->cmdu, dma->srcu, dma->dstu, dma->resu);
++ }
++#endif
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR, dmacsr & sc->sc_dmaier);
++
++ if ((sc->sc_flags & HIFN_HAS_PUBLIC) &&
++ (dmacsr & HIFN_DMACSR_PUBDONE))
++ WRITE_REG_1(sc, HIFN_1_PUB_STATUS,
++ READ_REG_1(sc, HIFN_1_PUB_STATUS) | HIFN_PUBSTS_DONE);
++
++ restart = dmacsr & (HIFN_DMACSR_D_OVER | HIFN_DMACSR_R_OVER);
++ if (restart)
++ device_printf(sc->sc_dev, "overrun %x\n", dmacsr);
++
++ if (sc->sc_flags & HIFN_IS_7811) {
++ if (dmacsr & HIFN_DMACSR_ILLR)
++ device_printf(sc->sc_dev, "illegal read\n");
++ if (dmacsr & HIFN_DMACSR_ILLW)
++ device_printf(sc->sc_dev, "illegal write\n");
++ }
++
++ restart = dmacsr & (HIFN_DMACSR_C_ABORT | HIFN_DMACSR_S_ABORT |
++ HIFN_DMACSR_D_ABORT | HIFN_DMACSR_R_ABORT);
++ if (restart) {
++ device_printf(sc->sc_dev, "abort, resetting.\n");
++ hifnstats.hst_abort++;
++ hifn_abort(sc);
++ HIFN_UNLOCK(sc);
++ return IRQ_HANDLED;
++ }
++
++ if ((dmacsr & HIFN_DMACSR_C_WAIT) && (dma->cmdu == 0)) {
++ /*
++ * If no slots to process and we receive a "waiting on
++ * command" interrupt, we disable the "waiting on command"
++ * (by clearing it).
++ */
++ sc->sc_dmaier &= ~HIFN_DMAIER_C_WAIT;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++ }
++
++ /* clear the rings */
++ i = dma->resk; u = dma->resu;
++ while (u != 0) {
++ HIFN_RESR_SYNC(sc, i,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++ if (dma->resr[i].l & htole32(HIFN_D_VALID)) {
++ HIFN_RESR_SYNC(sc, i,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ break;
++ }
++
++ if (i != HIFN_D_RES_RSIZE) {
++ struct hifn_command *cmd;
++ u_int8_t *macbuf = NULL;
++
++ HIFN_RES_SYNC(sc, i, BUS_DMASYNC_POSTREAD);
++ cmd = dma->hifn_commands[i];
++ KASSERT(cmd != NULL,
++ ("hifn_intr: null command slot %u", i));
++ dma->hifn_commands[i] = NULL;
++
++ if (cmd->base_masks & HIFN_BASE_CMD_MAC) {
++ macbuf = dma->result_bufs[i];
++ macbuf += 12;
++ }
++
++ hifn_callback(sc, cmd, macbuf);
++ hifnstats.hst_opackets++;
++ u--;
++ }
++
++ if (++i == (HIFN_D_RES_RSIZE + 1))
++ i = 0;
++ }
++ dma->resk = i; dma->resu = u;
++
++ i = dma->srck; u = dma->srcu;
++ while (u != 0) {
++ if (i == HIFN_D_SRC_RSIZE)
++ i = 0;
++ HIFN_SRCR_SYNC(sc, i,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++ if (dma->srcr[i].l & htole32(HIFN_D_VALID)) {
++ HIFN_SRCR_SYNC(sc, i,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ break;
++ }
++ i++, u--;
++ }
++ dma->srck = i; dma->srcu = u;
++
++ i = dma->cmdk; u = dma->cmdu;
++ while (u != 0) {
++ HIFN_CMDR_SYNC(sc, i,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++ if (dma->cmdr[i].l & htole32(HIFN_D_VALID)) {
++ HIFN_CMDR_SYNC(sc, i,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ break;
++ }
++ if (i != HIFN_D_CMD_RSIZE) {
++ u--;
++ HIFN_CMD_SYNC(sc, i, BUS_DMASYNC_POSTWRITE);
++ }
++ if (++i == (HIFN_D_CMD_RSIZE + 1))
++ i = 0;
++ }
++ dma->cmdk = i; dma->cmdu = u;
++
++ HIFN_UNLOCK(sc);
++
++ if (sc->sc_needwakeup) { /* XXX check high watermark */
++ int wakeup = sc->sc_needwakeup & (CRYPTO_SYMQ|CRYPTO_ASYMQ);
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev,
++ "wakeup crypto (%x) u %d/%d/%d/%d\n",
++ sc->sc_needwakeup,
++ dma->cmdu, dma->srcu, dma->dstu, dma->resu);
++#endif
++ sc->sc_needwakeup &= ~wakeup;
++ crypto_unblock(sc->sc_cid, wakeup);
++ }
++
++ return IRQ_HANDLED;
++}
++
++/*
++ * Allocate a new 'session' and return an encoded session id. 'sidp'
++ * contains our registration id, and should contain an encoded session
++ * id on successful allocation.
++ */
++static int
++hifn_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct hifn_softc *sc = device_get_softc(dev);
++ struct cryptoini *c;
++ int mac = 0, cry = 0, sesn;
++ struct hifn_session *ses = NULL;
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ KASSERT(sc != NULL, ("hifn_newsession: null softc"));
++ if (sidp == NULL || cri == NULL || sc == NULL) {
++ DPRINTF("%s,%d: %s - EINVAL\n", __FILE__, __LINE__, __FUNCTION__);
++ return (EINVAL);
++ }
++
++ HIFN_LOCK(sc);
++ if (sc->sc_sessions == NULL) {
++ ses = sc->sc_sessions = (struct hifn_session *)kmalloc(sizeof(*ses),
++ SLAB_ATOMIC);
++ if (ses == NULL) {
++ HIFN_UNLOCK(sc);
++ return (ENOMEM);
++ }
++ sesn = 0;
++ sc->sc_nsessions = 1;
++ } else {
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (!sc->sc_sessions[sesn].hs_used) {
++ ses = &sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ sesn = sc->sc_nsessions;
++ ses = (struct hifn_session *)kmalloc((sesn + 1) * sizeof(*ses),
++ SLAB_ATOMIC);
++ if (ses == NULL) {
++ HIFN_UNLOCK(sc);
++ return (ENOMEM);
++ }
++ bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses));
++ bzero(sc->sc_sessions, sesn * sizeof(*ses));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = ses;
++ ses = &sc->sc_sessions[sesn];
++ sc->sc_nsessions++;
++ }
++ }
++ HIFN_UNLOCK(sc);
++
++ bzero(ses, sizeof(*ses));
++ ses->hs_used = 1;
++
++ for (c = cri; c != NULL; c = c->cri_next) {
++ switch (c->cri_alg) {
++ case CRYPTO_MD5:
++ case CRYPTO_SHA1:
++ case CRYPTO_MD5_HMAC:
++ case CRYPTO_SHA1_HMAC:
++ if (mac) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ mac = 1;
++ ses->hs_mlen = c->cri_mlen;
++ if (ses->hs_mlen == 0) {
++ switch (c->cri_alg) {
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ ses->hs_mlen = 16;
++ break;
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ ses->hs_mlen = 20;
++ break;
++ }
++ }
++ break;
++ case CRYPTO_DES_CBC:
++ case CRYPTO_3DES_CBC:
++ case CRYPTO_AES_CBC:
++ /* XXX this may read fewer, does it matter? */
++ read_random(ses->hs_iv,
++ c->cri_alg == CRYPTO_AES_CBC ?
++ HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH);
++ /*FALLTHROUGH*/
++ case CRYPTO_ARC4:
++ if (cry) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ cry = 1;
++ break;
++ default:
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ }
++ if (mac == 0 && cry == 0) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++
++ *sidp = HIFN_SID(device_get_unit(sc->sc_dev), sesn);
++
++ return (0);
++}
++
++/*
++ * Deallocate a session.
++ * XXX this routine should run a zero'd mac/encrypt key into context ram.
++ * XXX to blow away any keys already stored there.
++ */
++static int
++hifn_freesession(device_t dev, u_int64_t tid)
++{
++ struct hifn_softc *sc = device_get_softc(dev);
++ int session, error;
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ KASSERT(sc != NULL, ("hifn_freesession: null softc"));
++ if (sc == NULL) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++
++ HIFN_LOCK(sc);
++ session = HIFN_SESSION(sid);
++ if (session < sc->sc_nsessions) {
++ bzero(&sc->sc_sessions[session], sizeof(struct hifn_session));
++ error = 0;
++ } else {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ error = EINVAL;
++ }
++ HIFN_UNLOCK(sc);
++
++ return (error);
++}
++
++static int
++hifn_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct hifn_softc *sc = device_get_softc(dev);
++ struct hifn_command *cmd = NULL;
++ int session, err, ivlen;
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (crp == NULL || crp->crp_callback == NULL) {
++ hifnstats.hst_invalid++;
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ session = HIFN_SESSION(crp->crp_sid);
++
++ if (sc == NULL || session >= sc->sc_nsessions) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++
++ cmd = kmalloc(sizeof(struct hifn_command), SLAB_ATOMIC);
++ if (cmd == NULL) {
++ hifnstats.hst_nomem++;
++ err = ENOMEM;
++ goto errout;
++ }
++ memset(cmd, 0, sizeof(*cmd));
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ cmd->src_skb = (struct sk_buff *)crp->crp_buf;
++ cmd->dst_skb = (struct sk_buff *)crp->crp_buf;
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ cmd->src_io = (struct uio *)crp->crp_buf;
++ cmd->dst_io = (struct uio *)crp->crp_buf;
++ } else {
++ cmd->src_buf = crp->crp_buf;
++ cmd->dst_buf = crp->crp_buf;
++ }
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++
++ if (crd2 == NULL) {
++ if (crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1 ||
++ crd1->crd_alg == CRYPTO_MD5) {
++ maccrd = crd1;
++ enccrd = NULL;
++ } else if (crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4) {
++ if ((crd1->crd_flags & CRD_F_ENCRYPT) == 0)
++ cmd->base_masks |= HIFN_BASE_CMD_DECODE;
++ maccrd = NULL;
++ enccrd = crd1;
++ } else {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ } else {
++ if ((crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_MD5 ||
++ crd1->crd_alg == CRYPTO_SHA1) &&
++ (crd2->crd_alg == CRYPTO_DES_CBC ||
++ crd2->crd_alg == CRYPTO_3DES_CBC ||
++ crd2->crd_alg == CRYPTO_AES_CBC ||
++ crd2->crd_alg == CRYPTO_ARC4) &&
++ ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) {
++ cmd->base_masks = HIFN_BASE_CMD_DECODE;
++ maccrd = crd1;
++ enccrd = crd2;
++ } else if ((crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4 ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC) &&
++ (crd2->crd_alg == CRYPTO_MD5_HMAC ||
++ crd2->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd2->crd_alg == CRYPTO_MD5 ||
++ crd2->crd_alg == CRYPTO_SHA1) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT)) {
++ enccrd = crd1;
++ maccrd = crd2;
++ } else {
++ /*
++ * We cannot order the 7751 as requested
++ */
++ DPRINTF("%s,%d: %s %d,%d,%d - EINVAL\n",__FILE__,__LINE__,__FUNCTION__, crd1->crd_alg, crd2->crd_alg, crd1->crd_flags & CRD_F_ENCRYPT);
++ err = EINVAL;
++ goto errout;
++ }
++ }
++
++ if (enccrd) {
++ cmd->enccrd = enccrd;
++ cmd->base_masks |= HIFN_BASE_CMD_CRYPT;
++ switch (enccrd->crd_alg) {
++ case CRYPTO_ARC4:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_RC4;
++ break;
++ case CRYPTO_DES_CBC:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES |
++ HIFN_CRYPT_CMD_MODE_CBC |
++ HIFN_CRYPT_CMD_NEW_IV;
++ break;
++ case CRYPTO_3DES_CBC:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_3DES |
++ HIFN_CRYPT_CMD_MODE_CBC |
++ HIFN_CRYPT_CMD_NEW_IV;
++ break;
++ case CRYPTO_AES_CBC:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_AES |
++ HIFN_CRYPT_CMD_MODE_CBC |
++ HIFN_CRYPT_CMD_NEW_IV;
++ break;
++ default:
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ if (enccrd->crd_alg != CRYPTO_ARC4) {
++ ivlen = ((enccrd->crd_alg == CRYPTO_AES_CBC) ?
++ HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH);
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ bcopy(enccrd->crd_iv, cmd->iv, ivlen);
++ else
++ bcopy(sc->sc_sessions[session].hs_iv,
++ cmd->iv, ivlen);
++
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT)
++ == 0) {
++ crypto_copyback(crp->crp_flags,
++ crp->crp_buf, enccrd->crd_inject,
++ ivlen, cmd->iv);
++ }
++ } else {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ bcopy(enccrd->crd_iv, cmd->iv, ivlen);
++ else {
++ crypto_copydata(crp->crp_flags,
++ crp->crp_buf, enccrd->crd_inject,
++ ivlen, cmd->iv);
++ }
++ }
++ }
++
++ if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT)
++ cmd->cry_masks |= HIFN_CRYPT_CMD_NEW_KEY;
++ cmd->ck = enccrd->crd_key;
++ cmd->cklen = enccrd->crd_klen >> 3;
++ cmd->cry_masks |= HIFN_CRYPT_CMD_NEW_KEY;
++
++ /*
++ * Need to specify the size for the AES key in the masks.
++ */
++ if ((cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) ==
++ HIFN_CRYPT_CMD_ALG_AES) {
++ switch (cmd->cklen) {
++ case 16:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_KSZ_128;
++ break;
++ case 24:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_KSZ_192;
++ break;
++ case 32:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_KSZ_256;
++ break;
++ default:
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ }
++ }
++
++ if (maccrd) {
++ cmd->maccrd = maccrd;
++ cmd->base_masks |= HIFN_BASE_CMD_MAC;
++
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH |
++ HIFN_MAC_CMD_POS_IPSEC;
++ break;
++ case CRYPTO_MD5_HMAC:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC |
++ HIFN_MAC_CMD_POS_IPSEC | HIFN_MAC_CMD_TRUNC;
++ break;
++ case CRYPTO_SHA1:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_SHA1 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH |
++ HIFN_MAC_CMD_POS_IPSEC;
++ break;
++ case CRYPTO_SHA1_HMAC:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_SHA1 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC |
++ HIFN_MAC_CMD_POS_IPSEC | HIFN_MAC_CMD_TRUNC;
++ break;
++ }
++
++ if (maccrd->crd_alg == CRYPTO_SHA1_HMAC ||
++ maccrd->crd_alg == CRYPTO_MD5_HMAC) {
++ cmd->mac_masks |= HIFN_MAC_CMD_NEW_KEY;
++ bcopy(maccrd->crd_key, cmd->mac, maccrd->crd_klen >> 3);
++ bzero(cmd->mac + (maccrd->crd_klen >> 3),
++ HIFN_MAC_KEY_LENGTH - (maccrd->crd_klen >> 3));
++ }
++ }
++
++ cmd->crp = crp;
++ cmd->session_num = session;
++ cmd->softc = sc;
++
++ err = hifn_crypto(sc, cmd, crp, hint);
++ if (!err) {
++ return 0;
++ } else if (err == ERESTART) {
++ /*
++ * There weren't enough resources to dispatch the request
++ * to the part. Notify the caller so they'll requeue this
++ * request and resubmit it again soon.
++ */
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev, "requeue request\n");
++#endif
++ kfree(cmd);
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ return (err);
++ }
++
++errout:
++ if (cmd != NULL)
++ kfree(cmd);
++ if (err == EINVAL)
++ hifnstats.hst_invalid++;
++ else
++ hifnstats.hst_nomem++;
++ crp->crp_etype = err;
++ crypto_done(crp);
++ return (err);
++}
++
++static void
++hifn_abort(struct hifn_softc *sc)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct hifn_command *cmd;
++ struct cryptop *crp;
++ int i, u;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ i = dma->resk; u = dma->resu;
++ while (u != 0) {
++ cmd = dma->hifn_commands[i];
++ KASSERT(cmd != NULL, ("hifn_abort: null command slot %u", i));
++ dma->hifn_commands[i] = NULL;
++ crp = cmd->crp;
++
++ if ((dma->resr[i].l & htole32(HIFN_D_VALID)) == 0) {
++ /* Salvage what we can. */
++ u_int8_t *macbuf;
++
++ if (cmd->base_masks & HIFN_BASE_CMD_MAC) {
++ macbuf = dma->result_bufs[i];
++ macbuf += 12;
++ } else
++ macbuf = NULL;
++ hifnstats.hst_opackets++;
++ hifn_callback(sc, cmd, macbuf);
++ } else {
++#if 0
++ if (cmd->src_map == cmd->dst_map) {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
++ } else {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTWRITE);
++ bus_dmamap_sync(sc->sc_dmat, cmd->dst_map,
++ BUS_DMASYNC_POSTREAD);
++ }
++#endif
++
++ if (cmd->src_skb != cmd->dst_skb) {
++#ifdef NOTYET
++ m_freem(cmd->src_m);
++ crp->crp_buf = (caddr_t)cmd->dst_m;
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF src != dst not implemented\n",
++ __FILE__, __LINE__);
++#endif
++ }
++
++ /* non-shared buffers cannot be restarted */
++ if (cmd->src_map != cmd->dst_map) {
++ /*
++ * XXX should be EAGAIN, delayed until
++ * after the reset.
++ */
++ crp->crp_etype = ENOMEM;
++ pci_unmap_buf(sc, &cmd->dst);
++ } else
++ crp->crp_etype = ENOMEM;
++
++ pci_unmap_buf(sc, &cmd->src);
++
++ kfree(cmd);
++ if (crp->crp_etype != EAGAIN)
++ crypto_done(crp);
++ }
++
++ if (++i == HIFN_D_RES_RSIZE)
++ i = 0;
++ u--;
++ }
++ dma->resk = i; dma->resu = u;
++
++ hifn_reset_board(sc, 1);
++ hifn_init_dma(sc);
++ hifn_init_pci_registers(sc);
++}
++
++static void
++hifn_callback(struct hifn_softc *sc, struct hifn_command *cmd, u_int8_t *macbuf)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct cryptop *crp = cmd->crp;
++ struct cryptodesc *crd;
++ int i, u, ivlen;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++#if 0
++ if (cmd->src_map == cmd->dst_map) {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
++ } else {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTWRITE);
++ bus_dmamap_sync(sc->sc_dmat, cmd->dst_map,
++ BUS_DMASYNC_POSTREAD);
++ }
++#endif
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (cmd->src_skb != cmd->dst_skb) {
++#ifdef NOTYET
++ crp->crp_buf = (caddr_t)cmd->dst_m;
++ totlen = cmd->src_mapsize;
++ for (m = cmd->dst_m; m != NULL; m = m->m_next) {
++ if (totlen < m->m_len) {
++ m->m_len = totlen;
++ totlen = 0;
++ } else
++ totlen -= m->m_len;
++ }
++ cmd->dst_m->m_pkthdr.len = cmd->src_m->m_pkthdr.len;
++ m_freem(cmd->src_m);
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF src != dst not implemented\n",
++ __FILE__, __LINE__);
++#endif
++ }
++ }
++
++ if (cmd->sloplen != 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ cmd->src_mapsize - cmd->sloplen, cmd->sloplen,
++ (caddr_t)&dma->slop[cmd->slopidx]);
++ }
++
++ i = dma->dstk; u = dma->dstu;
++ while (u != 0) {
++ if (i == HIFN_D_DST_RSIZE)
++ i = 0;
++#if 0
++ bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++#endif
++ if (dma->dstr[i].l & htole32(HIFN_D_VALID)) {
++#if 0
++ bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++#endif
++ break;
++ }
++ i++, u--;
++ }
++ dma->dstk = i; dma->dstu = u;
++
++ hifnstats.hst_obytes += cmd->dst_mapsize;
++
++ if ((cmd->base_masks & (HIFN_BASE_CMD_CRYPT | HIFN_BASE_CMD_DECODE)) ==
++ HIFN_BASE_CMD_CRYPT) {
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ if (crd->crd_alg != CRYPTO_DES_CBC &&
++ crd->crd_alg != CRYPTO_3DES_CBC &&
++ crd->crd_alg != CRYPTO_AES_CBC)
++ continue;
++ ivlen = ((crd->crd_alg == CRYPTO_AES_CBC) ?
++ HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH);
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ crd->crd_skip + crd->crd_len - ivlen, ivlen,
++ cmd->softc->sc_sessions[cmd->session_num].hs_iv);
++ break;
++ }
++ }
++
++ if (macbuf != NULL) {
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ int len;
++
++ if (crd->crd_alg != CRYPTO_MD5 &&
++ crd->crd_alg != CRYPTO_SHA1 &&
++ crd->crd_alg != CRYPTO_MD5_HMAC &&
++ crd->crd_alg != CRYPTO_SHA1_HMAC) {
++ continue;
++ }
++ len = cmd->softc->sc_sessions[cmd->session_num].hs_mlen;
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, len, macbuf);
++ break;
++ }
++ }
++
++ if (cmd->src_map != cmd->dst_map)
++ pci_unmap_buf(sc, &cmd->dst);
++ pci_unmap_buf(sc, &cmd->src);
++ kfree(cmd);
++ crypto_done(crp);
++}
++
++/*
++ * 7811 PB3 rev/2 parts lock-up on burst writes to Group 0
++ * and Group 1 registers; avoid conditions that could create
++ * burst writes by doing a read in between the writes.
++ *
++ * NB: The read we interpose is always to the same register;
++ * we do this because reading from an arbitrary (e.g. last)
++ * register may not always work.
++ */
++static void
++hifn_write_reg_0(struct hifn_softc *sc, bus_size_t reg, u_int32_t val)
++{
++ if (sc->sc_flags & HIFN_IS_7811) {
++ if (sc->sc_bar0_lastreg == reg - 4)
++ readl(sc->sc_bar0 + HIFN_0_PUCNFG);
++ sc->sc_bar0_lastreg = reg;
++ }
++ writel(val, sc->sc_bar0 + reg);
++}
++
++static void
++hifn_write_reg_1(struct hifn_softc *sc, bus_size_t reg, u_int32_t val)
++{
++ if (sc->sc_flags & HIFN_IS_7811) {
++ if (sc->sc_bar1_lastreg == reg - 4)
++ readl(sc->sc_bar1 + HIFN_1_REVID);
++ sc->sc_bar1_lastreg = reg;
++ }
++ writel(val, sc->sc_bar1 + reg);
++}
++
++
++static struct pci_device_id hifn_pci_tbl[] = {
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7951,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7955,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7956,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_NETSEC, PCI_PRODUCT_NETSEC_7751,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_INVERTEX, PCI_PRODUCT_INVERTEX_AEON,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7811,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ /*
++ * Other vendors share this PCI ID as well, such as
++ * http://www.powercrypt.com, and obviously they also
++ * use the same key.
++ */
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7751,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { 0, 0, 0, 0, 0, 0, }
++};
++MODULE_DEVICE_TABLE(pci, hifn_pci_tbl);
++
++static struct pci_driver hifn_driver = {
++ .name = "hifn",
++ .id_table = hifn_pci_tbl,
++ .probe = hifn_probe,
++ .remove = hifn_remove,
++ /* add PM stuff here one day */
++};
++
++static int __init hifn_init (void)
++{
++ struct hifn_softc *sc = NULL;
++ int rc;
++
++ DPRINTF("%s(%p)\n", __FUNCTION__, hifn_init);
++
++ rc = pci_register_driver(&hifn_driver);
++ pci_register_driver_compat(&hifn_driver, rc);
++
++ return rc;
++}
++
++static void __exit hifn_exit (void)
++{
++ pci_unregister_driver(&hifn_driver);
++}
++
++module_init(hifn_init);
++module_exit(hifn_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("OCF driver for hifn PCI crypto devices");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/hifn/hifn7751reg.h linux-2.6.27.10/crypto/ocf/hifn/hifn7751reg.h
+--- linux-2.6.27.10.orig/crypto/ocf/hifn/hifn7751reg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/hifn/hifn7751reg.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,540 @@
++/* $FreeBSD: src/sys/dev/hifn/hifn7751reg.h,v 1.7 2007/03/21 03:42:49 sam Exp $ */
++/* $OpenBSD: hifn7751reg.h,v 1.35 2002/04/08 17:49:42 jason Exp $ */
++
++/*-
++ * Invertex AEON / Hifn 7751 driver
++ * Copyright (c) 1999 Invertex Inc. All rights reserved.
++ * Copyright (c) 1999 Theo de Raadt
++ * Copyright (c) 2000-2001 Network Security Technologies, Inc.
++ * http://www.netsec.net
++ *
++ * Please send any comments, feedback, bug-fixes, or feature requests to
++ * software@invertex.com.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ */
++#ifndef __HIFN_H__
++#define __HIFN_H__
++
++/*
++ * Some PCI configuration space offset defines. The names were made
++ * identical to the names used by the Linux kernel.
++ */
++#define HIFN_BAR0 PCIR_BAR(0) /* PUC register map */
++#define HIFN_BAR1 PCIR_BAR(1) /* DMA register map */
++#define HIFN_TRDY_TIMEOUT 0x40
++#define HIFN_RETRY_TIMEOUT 0x41
++
++/*
++ * PCI vendor and device identifiers
++ * (the names are preserved from their OpenBSD source).
++ */
++#define PCI_VENDOR_HIFN 0x13a3 /* Hifn */
++#define PCI_PRODUCT_HIFN_7751 0x0005 /* 7751 */
++#define PCI_PRODUCT_HIFN_6500 0x0006 /* 6500 */
++#define PCI_PRODUCT_HIFN_7811 0x0007 /* 7811 */
++#define PCI_PRODUCT_HIFN_7855 0x001f /* 7855 */
++#define PCI_PRODUCT_HIFN_7951 0x0012 /* 7951 */
++#define PCI_PRODUCT_HIFN_7955 0x0020 /* 7954/7955 */
++#define PCI_PRODUCT_HIFN_7956 0x001d /* 7956 */
++
++#define PCI_VENDOR_INVERTEX 0x14e1 /* Invertex */
++#define PCI_PRODUCT_INVERTEX_AEON 0x0005 /* AEON */
++
++#define PCI_VENDOR_NETSEC 0x1660 /* NetSec */
++#define PCI_PRODUCT_NETSEC_7751 0x7751 /* 7751 */
++
++/*
++ * The values below should multiple of 4 -- and be large enough to handle
++ * any command the driver implements.
++ *
++ * MAX_COMMAND = base command + mac command + encrypt command +
++ * mac-key + rc4-key
++ * MAX_RESULT = base result + mac result + mac + encrypt result
++ *
++ *
++ */
++#define HIFN_MAX_COMMAND (8 + 8 + 8 + 64 + 260)
++#define HIFN_MAX_RESULT (8 + 4 + 20 + 4)
++
++/*
++ * hifn_desc_t
++ *
++ * Holds an individual descriptor for any of the rings.
++ */
++typedef struct hifn_desc {
++ volatile u_int32_t l; /* length and status bits */
++ volatile u_int32_t p;
++} hifn_desc_t;
++
++/*
++ * Masks for the "length" field of struct hifn_desc.
++ */
++#define HIFN_D_LENGTH 0x0000ffff /* length bit mask */
++#define HIFN_D_MASKDONEIRQ 0x02000000 /* mask the done interrupt */
++#define HIFN_D_DESTOVER 0x04000000 /* destination overflow */
++#define HIFN_D_OVER 0x08000000 /* overflow */
++#define HIFN_D_LAST 0x20000000 /* last descriptor in chain */
++#define HIFN_D_JUMP 0x40000000 /* jump descriptor */
++#define HIFN_D_VALID 0x80000000 /* valid bit */
++
++
++/*
++ * Processing Unit Registers (offset from BASEREG0)
++ */
++#define HIFN_0_PUDATA 0x00 /* Processing Unit Data */
++#define HIFN_0_PUCTRL 0x04 /* Processing Unit Control */
++#define HIFN_0_PUISR 0x08 /* Processing Unit Interrupt Status */
++#define HIFN_0_PUCNFG 0x0c /* Processing Unit Configuration */
++#define HIFN_0_PUIER 0x10 /* Processing Unit Interrupt Enable */
++#define HIFN_0_PUSTAT 0x14 /* Processing Unit Status/Chip ID */
++#define HIFN_0_FIFOSTAT 0x18 /* FIFO Status */
++#define HIFN_0_FIFOCNFG 0x1c /* FIFO Configuration */
++#define HIFN_0_PUCTRL2 0x28 /* Processing Unit Control (2nd map) */
++#define HIFN_0_MUTE1 0x80
++#define HIFN_0_MUTE2 0x90
++#define HIFN_0_SPACESIZE 0x100 /* Register space size */
++
++/* Processing Unit Control Register (HIFN_0_PUCTRL) */
++#define HIFN_PUCTRL_CLRSRCFIFO 0x0010 /* clear source fifo */
++#define HIFN_PUCTRL_STOP 0x0008 /* stop pu */
++#define HIFN_PUCTRL_LOCKRAM 0x0004 /* lock ram */
++#define HIFN_PUCTRL_DMAENA 0x0002 /* enable dma */
++#define HIFN_PUCTRL_RESET 0x0001 /* Reset processing unit */
++
++/* Processing Unit Interrupt Status Register (HIFN_0_PUISR) */
++#define HIFN_PUISR_CMDINVAL 0x8000 /* Invalid command interrupt */
++#define HIFN_PUISR_DATAERR 0x4000 /* Data error interrupt */
++#define HIFN_PUISR_SRCFIFO 0x2000 /* Source FIFO ready interrupt */
++#define HIFN_PUISR_DSTFIFO 0x1000 /* Destination FIFO ready interrupt */
++#define HIFN_PUISR_DSTOVER 0x0200 /* Destination overrun interrupt */
++#define HIFN_PUISR_SRCCMD 0x0080 /* Source command interrupt */
++#define HIFN_PUISR_SRCCTX 0x0040 /* Source context interrupt */
++#define HIFN_PUISR_SRCDATA 0x0020 /* Source data interrupt */
++#define HIFN_PUISR_DSTDATA 0x0010 /* Destination data interrupt */
++#define HIFN_PUISR_DSTRESULT 0x0004 /* Destination result interrupt */
++
++/* Processing Unit Configuration Register (HIFN_0_PUCNFG) */
++#define HIFN_PUCNFG_DRAMMASK 0xe000 /* DRAM size mask */
++#define HIFN_PUCNFG_DSZ_256K 0x0000 /* 256k dram */
++#define HIFN_PUCNFG_DSZ_512K 0x2000 /* 512k dram */
++#define HIFN_PUCNFG_DSZ_1M 0x4000 /* 1m dram */
++#define HIFN_PUCNFG_DSZ_2M 0x6000 /* 2m dram */
++#define HIFN_PUCNFG_DSZ_4M 0x8000 /* 4m dram */
++#define HIFN_PUCNFG_DSZ_8M 0xa000 /* 8m dram */
++#define HIFN_PUNCFG_DSZ_16M 0xc000 /* 16m dram */
++#define HIFN_PUCNFG_DSZ_32M 0xe000 /* 32m dram */
++#define HIFN_PUCNFG_DRAMREFRESH 0x1800 /* DRAM refresh rate mask */
++#define HIFN_PUCNFG_DRFR_512 0x0000 /* 512 divisor of ECLK */
++#define HIFN_PUCNFG_DRFR_256 0x0800 /* 256 divisor of ECLK */
++#define HIFN_PUCNFG_DRFR_128 0x1000 /* 128 divisor of ECLK */
++#define HIFN_PUCNFG_TCALLPHASES 0x0200 /* your guess is as good as mine... */
++#define HIFN_PUCNFG_TCDRVTOTEM 0x0100 /* your guess is as good as mine... */
++#define HIFN_PUCNFG_BIGENDIAN 0x0080 /* DMA big endian mode */
++#define HIFN_PUCNFG_BUS32 0x0040 /* Bus width 32bits */
++#define HIFN_PUCNFG_BUS16 0x0000 /* Bus width 16 bits */
++#define HIFN_PUCNFG_CHIPID 0x0020 /* Allow chipid from PUSTAT */
++#define HIFN_PUCNFG_DRAM 0x0010 /* Context RAM is DRAM */
++#define HIFN_PUCNFG_SRAM 0x0000 /* Context RAM is SRAM */
++#define HIFN_PUCNFG_COMPSING 0x0004 /* Enable single compression context */
++#define HIFN_PUCNFG_ENCCNFG 0x0002 /* Encryption configuration */
++
++/* Processing Unit Interrupt Enable Register (HIFN_0_PUIER) */
++#define HIFN_PUIER_CMDINVAL 0x8000 /* Invalid command interrupt */
++#define HIFN_PUIER_DATAERR 0x4000 /* Data error interrupt */
++#define HIFN_PUIER_SRCFIFO 0x2000 /* Source FIFO ready interrupt */
++#define HIFN_PUIER_DSTFIFO 0x1000 /* Destination FIFO ready interrupt */
++#define HIFN_PUIER_DSTOVER 0x0200 /* Destination overrun interrupt */
++#define HIFN_PUIER_SRCCMD 0x0080 /* Source command interrupt */
++#define HIFN_PUIER_SRCCTX 0x0040 /* Source context interrupt */
++#define HIFN_PUIER_SRCDATA 0x0020 /* Source data interrupt */
++#define HIFN_PUIER_DSTDATA 0x0010 /* Destination data interrupt */
++#define HIFN_PUIER_DSTRESULT 0x0004 /* Destination result interrupt */
++
++/* Processing Unit Status Register/Chip ID (HIFN_0_PUSTAT) */
++#define HIFN_PUSTAT_CMDINVAL 0x8000 /* Invalid command interrupt */
++#define HIFN_PUSTAT_DATAERR 0x4000 /* Data error interrupt */
++#define HIFN_PUSTAT_SRCFIFO 0x2000 /* Source FIFO ready interrupt */
++#define HIFN_PUSTAT_DSTFIFO 0x1000 /* Destination FIFO ready interrupt */
++#define HIFN_PUSTAT_DSTOVER 0x0200 /* Destination overrun interrupt */
++#define HIFN_PUSTAT_SRCCMD 0x0080 /* Source command interrupt */
++#define HIFN_PUSTAT_SRCCTX 0x0040 /* Source context interrupt */
++#define HIFN_PUSTAT_SRCDATA 0x0020 /* Source data interrupt */
++#define HIFN_PUSTAT_DSTDATA 0x0010 /* Destination data interrupt */
++#define HIFN_PUSTAT_DSTRESULT 0x0004 /* Destination result interrupt */
++#define HIFN_PUSTAT_CHIPREV 0x00ff /* Chip revision mask */
++#define HIFN_PUSTAT_CHIPENA 0xff00 /* Chip enabled mask */
++#define HIFN_PUSTAT_ENA_2 0x1100 /* Level 2 enabled */
++#define HIFN_PUSTAT_ENA_1 0x1000 /* Level 1 enabled */
++#define HIFN_PUSTAT_ENA_0 0x3000 /* Level 0 enabled */
++#define HIFN_PUSTAT_REV_2 0x0020 /* 7751 PT6/2 */
++#define HIFN_PUSTAT_REV_3 0x0030 /* 7751 PT6/3 */
++
++/* FIFO Status Register (HIFN_0_FIFOSTAT) */
++#define HIFN_FIFOSTAT_SRC 0x7f00 /* Source FIFO available */
++#define HIFN_FIFOSTAT_DST 0x007f /* Destination FIFO available */
++
++/* FIFO Configuration Register (HIFN_0_FIFOCNFG) */
++#define HIFN_FIFOCNFG_THRESHOLD 0x0400 /* must be written as this value */
++
++/*
++ * DMA Interface Registers (offset from BASEREG1)
++ */
++#define HIFN_1_DMA_CRAR 0x0c /* DMA Command Ring Address */
++#define HIFN_1_DMA_SRAR 0x1c /* DMA Source Ring Address */
++#define HIFN_1_DMA_RRAR 0x2c /* DMA Result Ring Address */
++#define HIFN_1_DMA_DRAR 0x3c /* DMA Destination Ring Address */
++#define HIFN_1_DMA_CSR 0x40 /* DMA Status and Control */
++#define HIFN_1_DMA_IER 0x44 /* DMA Interrupt Enable */
++#define HIFN_1_DMA_CNFG 0x48 /* DMA Configuration */
++#define HIFN_1_PLL 0x4c /* 7955/7956: PLL config */
++#define HIFN_1_7811_RNGENA 0x60 /* 7811: rng enable */
++#define HIFN_1_7811_RNGCFG 0x64 /* 7811: rng config */
++#define HIFN_1_7811_RNGDAT 0x68 /* 7811: rng data */
++#define HIFN_1_7811_RNGSTS 0x6c /* 7811: rng status */
++#define HIFN_1_DMA_CNFG2 0x6c /* 7955/7956: dma config #2 */
++#define HIFN_1_7811_MIPSRST 0x94 /* 7811: MIPS reset */
++#define HIFN_1_REVID 0x98 /* Revision ID */
++
++#define HIFN_1_PUB_RESET 0x204 /* Public/RNG Reset */
++#define HIFN_1_PUB_BASE 0x300 /* Public Base Address */
++#define HIFN_1_PUB_OPLEN 0x304 /* 7951-compat Public Operand Length */
++#define HIFN_1_PUB_OP 0x308 /* 7951-compat Public Operand */
++#define HIFN_1_PUB_STATUS 0x30c /* 7951-compat Public Status */
++#define HIFN_1_PUB_IEN 0x310 /* Public Interrupt enable */
++#define HIFN_1_RNG_CONFIG 0x314 /* RNG config */
++#define HIFN_1_RNG_DATA 0x318 /* RNG data */
++#define HIFN_1_PUB_MODE 0x320 /* PK mode */
++#define HIFN_1_PUB_FIFO_OPLEN 0x380 /* first element of oplen fifo */
++#define HIFN_1_PUB_FIFO_OP 0x384 /* first element of op fifo */
++#define HIFN_1_PUB_MEM 0x400 /* start of Public key memory */
++#define HIFN_1_PUB_MEMEND 0xbff /* end of Public key memory */
++
++/* DMA Status and Control Register (HIFN_1_DMA_CSR) */
++#define HIFN_DMACSR_D_CTRLMASK 0xc0000000 /* Destinition Ring Control */
++#define HIFN_DMACSR_D_CTRL_NOP 0x00000000 /* Dest. Control: no-op */
++#define HIFN_DMACSR_D_CTRL_DIS 0x40000000 /* Dest. Control: disable */
++#define HIFN_DMACSR_D_CTRL_ENA 0x80000000 /* Dest. Control: enable */
++#define HIFN_DMACSR_D_ABORT 0x20000000 /* Destinition Ring PCIAbort */
++#define HIFN_DMACSR_D_DONE 0x10000000 /* Destinition Ring Done */
++#define HIFN_DMACSR_D_LAST 0x08000000 /* Destinition Ring Last */
++#define HIFN_DMACSR_D_WAIT 0x04000000 /* Destinition Ring Waiting */
++#define HIFN_DMACSR_D_OVER 0x02000000 /* Destinition Ring Overflow */
++#define HIFN_DMACSR_R_CTRL 0x00c00000 /* Result Ring Control */
++#define HIFN_DMACSR_R_CTRL_NOP 0x00000000 /* Result Control: no-op */
++#define HIFN_DMACSR_R_CTRL_DIS 0x00400000 /* Result Control: disable */
++#define HIFN_DMACSR_R_CTRL_ENA 0x00800000 /* Result Control: enable */
++#define HIFN_DMACSR_R_ABORT 0x00200000 /* Result Ring PCI Abort */
++#define HIFN_DMACSR_R_DONE 0x00100000 /* Result Ring Done */
++#define HIFN_DMACSR_R_LAST 0x00080000 /* Result Ring Last */
++#define HIFN_DMACSR_R_WAIT 0x00040000 /* Result Ring Waiting */
++#define HIFN_DMACSR_R_OVER 0x00020000 /* Result Ring Overflow */
++#define HIFN_DMACSR_S_CTRL 0x0000c000 /* Source Ring Control */
++#define HIFN_DMACSR_S_CTRL_NOP 0x00000000 /* Source Control: no-op */
++#define HIFN_DMACSR_S_CTRL_DIS 0x00004000 /* Source Control: disable */
++#define HIFN_DMACSR_S_CTRL_ENA 0x00008000 /* Source Control: enable */
++#define HIFN_DMACSR_S_ABORT 0x00002000 /* Source Ring PCI Abort */
++#define HIFN_DMACSR_S_DONE 0x00001000 /* Source Ring Done */
++#define HIFN_DMACSR_S_LAST 0x00000800 /* Source Ring Last */
++#define HIFN_DMACSR_S_WAIT 0x00000400 /* Source Ring Waiting */
++#define HIFN_DMACSR_ILLW 0x00000200 /* Illegal write (7811 only) */
++#define HIFN_DMACSR_ILLR 0x00000100 /* Illegal read (7811 only) */
++#define HIFN_DMACSR_C_CTRL 0x000000c0 /* Command Ring Control */
++#define HIFN_DMACSR_C_CTRL_NOP 0x00000000 /* Command Control: no-op */
++#define HIFN_DMACSR_C_CTRL_DIS 0x00000040 /* Command Control: disable */
++#define HIFN_DMACSR_C_CTRL_ENA 0x00000080 /* Command Control: enable */
++#define HIFN_DMACSR_C_ABORT 0x00000020 /* Command Ring PCI Abort */
++#define HIFN_DMACSR_C_DONE 0x00000010 /* Command Ring Done */
++#define HIFN_DMACSR_C_LAST 0x00000008 /* Command Ring Last */
++#define HIFN_DMACSR_C_WAIT 0x00000004 /* Command Ring Waiting */
++#define HIFN_DMACSR_PUBDONE 0x00000002 /* Public op done (7951 only) */
++#define HIFN_DMACSR_ENGINE 0x00000001 /* Command Ring Engine IRQ */
++
++/* DMA Interrupt Enable Register (HIFN_1_DMA_IER) */
++#define HIFN_DMAIER_D_ABORT 0x20000000 /* Destination Ring PCIAbort */
++#define HIFN_DMAIER_D_DONE 0x10000000 /* Destination Ring Done */
++#define HIFN_DMAIER_D_LAST 0x08000000 /* Destination Ring Last */
++#define HIFN_DMAIER_D_WAIT 0x04000000 /* Destination Ring Waiting */
++#define HIFN_DMAIER_D_OVER 0x02000000 /* Destination Ring Overflow */
++#define HIFN_DMAIER_R_ABORT 0x00200000 /* Result Ring PCI Abort */
++#define HIFN_DMAIER_R_DONE 0x00100000 /* Result Ring Done */
++#define HIFN_DMAIER_R_LAST 0x00080000 /* Result Ring Last */
++#define HIFN_DMAIER_R_WAIT 0x00040000 /* Result Ring Waiting */
++#define HIFN_DMAIER_R_OVER 0x00020000 /* Result Ring Overflow */
++#define HIFN_DMAIER_S_ABORT 0x00002000 /* Source Ring PCI Abort */
++#define HIFN_DMAIER_S_DONE 0x00001000 /* Source Ring Done */
++#define HIFN_DMAIER_S_LAST 0x00000800 /* Source Ring Last */
++#define HIFN_DMAIER_S_WAIT 0x00000400 /* Source Ring Waiting */
++#define HIFN_DMAIER_ILLW 0x00000200 /* Illegal write (7811 only) */
++#define HIFN_DMAIER_ILLR 0x00000100 /* Illegal read (7811 only) */
++#define HIFN_DMAIER_C_ABORT 0x00000020 /* Command Ring PCI Abort */
++#define HIFN_DMAIER_C_DONE 0x00000010 /* Command Ring Done */
++#define HIFN_DMAIER_C_LAST 0x00000008 /* Command Ring Last */
++#define HIFN_DMAIER_C_WAIT 0x00000004 /* Command Ring Waiting */
++#define HIFN_DMAIER_PUBDONE 0x00000002 /* public op done (7951 only) */
++#define HIFN_DMAIER_ENGINE 0x00000001 /* Engine IRQ */
++
++/* DMA Configuration Register (HIFN_1_DMA_CNFG) */
++#define HIFN_DMACNFG_BIGENDIAN 0x10000000 /* big endian mode */
++#define HIFN_DMACNFG_POLLFREQ 0x00ff0000 /* Poll frequency mask */
++#define HIFN_DMACNFG_UNLOCK 0x00000800
++#define HIFN_DMACNFG_POLLINVAL 0x00000700 /* Invalid Poll Scalar */
++#define HIFN_DMACNFG_LAST 0x00000010 /* Host control LAST bit */
++#define HIFN_DMACNFG_MODE 0x00000004 /* DMA mode */
++#define HIFN_DMACNFG_DMARESET 0x00000002 /* DMA Reset # */
++#define HIFN_DMACNFG_MSTRESET 0x00000001 /* Master Reset # */
++
++/* DMA Configuration Register (HIFN_1_DMA_CNFG2) */
++#define HIFN_DMACNFG2_PKSWAP32 (1 << 19) /* swap the OPLEN/OP reg */
++#define HIFN_DMACNFG2_PKSWAP8 (1 << 18) /* swap the bits of OPLEN/OP */
++#define HIFN_DMACNFG2_BAR0_SWAP32 (1<<17) /* swap the bytes of BAR0 */
++#define HIFN_DMACNFG2_BAR1_SWAP8 (1<<16) /* swap the bits of BAR0 */
++#define HIFN_DMACNFG2_INIT_WRITE_BURST_SHIFT 12
++#define HIFN_DMACNFG2_INIT_READ_BURST_SHIFT 8
++#define HIFN_DMACNFG2_TGT_WRITE_BURST_SHIFT 4
++#define HIFN_DMACNFG2_TGT_READ_BURST_SHIFT 0
++
++/* 7811 RNG Enable Register (HIFN_1_7811_RNGENA) */
++#define HIFN_7811_RNGENA_ENA 0x00000001 /* enable RNG */
++
++/* 7811 RNG Config Register (HIFN_1_7811_RNGCFG) */
++#define HIFN_7811_RNGCFG_PRE1 0x00000f00 /* first prescalar */
++#define HIFN_7811_RNGCFG_OPRE 0x00000080 /* output prescalar */
++#define HIFN_7811_RNGCFG_DEFL 0x00000f80 /* 2 words/ 1/100 sec */
++
++/* 7811 RNG Status Register (HIFN_1_7811_RNGSTS) */
++#define HIFN_7811_RNGSTS_RDY 0x00004000 /* two numbers in FIFO */
++#define HIFN_7811_RNGSTS_UFL 0x00001000 /* rng underflow */
++
++/* 7811 MIPS Reset Register (HIFN_1_7811_MIPSRST) */
++#define HIFN_MIPSRST_BAR2SIZE 0xffff0000 /* sdram size */
++#define HIFN_MIPSRST_GPRAMINIT 0x00008000 /* gpram can be accessed */
++#define HIFN_MIPSRST_CRAMINIT 0x00004000 /* ctxram can be accessed */
++#define HIFN_MIPSRST_LED2 0x00000400 /* external LED2 */
++#define HIFN_MIPSRST_LED1 0x00000200 /* external LED1 */
++#define HIFN_MIPSRST_LED0 0x00000100 /* external LED0 */
++#define HIFN_MIPSRST_MIPSDIS 0x00000004 /* disable MIPS */
++#define HIFN_MIPSRST_MIPSRST 0x00000002 /* warm reset MIPS */
++#define HIFN_MIPSRST_MIPSCOLD 0x00000001 /* cold reset MIPS */
++
++/* Public key reset register (HIFN_1_PUB_RESET) */
++#define HIFN_PUBRST_RESET 0x00000001 /* reset public/rng unit */
++
++/* Public operation register (HIFN_1_PUB_OP) */
++#define HIFN_PUBOP_AOFFSET 0x0000003e /* A offset */
++#define HIFN_PUBOP_BOFFSET 0x00000fc0 /* B offset */
++#define HIFN_PUBOP_MOFFSET 0x0003f000 /* M offset */
++#define HIFN_PUBOP_OP_MASK 0x003c0000 /* Opcode: */
++#define HIFN_PUBOP_OP_NOP 0x00000000 /* NOP */
++#define HIFN_PUBOP_OP_ADD 0x00040000 /* ADD */
++#define HIFN_PUBOP_OP_ADDC 0x00080000 /* ADD w/carry */
++#define HIFN_PUBOP_OP_SUB 0x000c0000 /* SUB */
++#define HIFN_PUBOP_OP_SUBC 0x00100000 /* SUB w/carry */
++#define HIFN_PUBOP_OP_MODADD 0x00140000 /* Modular ADD */
++#define HIFN_PUBOP_OP_MODSUB 0x00180000 /* Modular SUB */
++#define HIFN_PUBOP_OP_INCA 0x001c0000 /* INC A */
++#define HIFN_PUBOP_OP_DECA 0x00200000 /* DEC A */
++#define HIFN_PUBOP_OP_MULT 0x00240000 /* MULT */
++#define HIFN_PUBOP_OP_MODMULT 0x00280000 /* Modular MULT */
++#define HIFN_PUBOP_OP_MODRED 0x002c0000 /* Modular Red */
++#define HIFN_PUBOP_OP_MODEXP 0x00300000 /* Modular Exp */
++
++/* Public operand length register (HIFN_1_PUB_OPLEN) */
++#define HIFN_PUBOPLEN_MODLEN 0x0000007f
++#define HIFN_PUBOPLEN_EXPLEN 0x0003ff80
++#define HIFN_PUBOPLEN_REDLEN 0x003c0000
++
++/* Public status register (HIFN_1_PUB_STATUS) */
++#define HIFN_PUBSTS_DONE 0x00000001 /* operation done */
++#define HIFN_PUBSTS_CARRY 0x00000002 /* carry */
++#define HIFN_PUBSTS_FIFO_EMPTY 0x00000100 /* fifo empty */
++#define HIFN_PUBSTS_FIFO_FULL 0x00000200 /* fifo full */
++#define HIFN_PUBSTS_FIFO_OVFL 0x00000400 /* fifo overflow */
++#define HIFN_PUBSTS_FIFO_WRITE 0x000f0000 /* fifo write */
++#define HIFN_PUBSTS_FIFO_READ 0x0f000000 /* fifo read */
++
++/* Public interrupt enable register (HIFN_1_PUB_IEN) */
++#define HIFN_PUBIEN_DONE 0x00000001 /* operation done interrupt */
++
++/* Random number generator config register (HIFN_1_RNG_CONFIG) */
++#define HIFN_RNGCFG_ENA 0x00000001 /* enable rng */
++
++/*
++ * Register offsets in register set 1
++ */
++
++#define HIFN_UNLOCK_SECRET1 0xf4
++#define HIFN_UNLOCK_SECRET2 0xfc
++
++/*
++ * PLL config register
++ *
++ * This register is present only on 7954/7955/7956 parts. It must be
++ * programmed according to the bus interface method used by the h/w.
++ * Note that the parts require a stable clock. Since the PCI clock
++ * may vary the reference clock must usually be used. To avoid
++ * overclocking the core logic, setup must be done carefully, refer
++ * to the driver for details. The exact multiplier required varies
++ * by part and system configuration; refer to the Hifn documentation.
++ */
++#define HIFN_PLL_REF_SEL 0x00000001 /* REF/HBI clk selection */
++#define HIFN_PLL_BP 0x00000002 /* bypass (used during setup) */
++/* bit 2 reserved */
++#define HIFN_PLL_PK_CLK_SEL 0x00000008 /* public key clk select */
++#define HIFN_PLL_PE_CLK_SEL 0x00000010 /* packet engine clk select */
++/* bits 5-9 reserved */
++#define HIFN_PLL_MBSET 0x00000400 /* must be set to 1 */
++#define HIFN_PLL_ND 0x00003800 /* Fpll_ref multiplier select */
++#define HIFN_PLL_ND_SHIFT 11
++#define HIFN_PLL_ND_2 0x00000000 /* 2x */
++#define HIFN_PLL_ND_4 0x00000800 /* 4x */
++#define HIFN_PLL_ND_6 0x00001000 /* 6x */
++#define HIFN_PLL_ND_8 0x00001800 /* 8x */
++#define HIFN_PLL_ND_10 0x00002000 /* 10x */
++#define HIFN_PLL_ND_12 0x00002800 /* 12x */
++/* bits 14-15 reserved */
++#define HIFN_PLL_IS 0x00010000 /* charge pump current select */
++/* bits 17-31 reserved */
++
++/*
++ * Board configuration specifies only these bits.
++ */
++#define HIFN_PLL_CONFIG (HIFN_PLL_IS|HIFN_PLL_ND|HIFN_PLL_REF_SEL)
++
++/*
++ * Public Key Engine Mode Register
++ */
++#define HIFN_PKMODE_HOSTINVERT (1 << 0) /* HOST INVERT */
++#define HIFN_PKMODE_ENHANCED (1 << 1) /* Enable enhanced mode */
++
++
++/*********************************************************************
++ * Structs for board commands
++ *
++ *********************************************************************/
++
++/*
++ * Structure to help build up the command data structure.
++ */
++typedef struct hifn_base_command {
++ volatile u_int16_t masks;
++ volatile u_int16_t session_num;
++ volatile u_int16_t total_source_count;
++ volatile u_int16_t total_dest_count;
++} hifn_base_command_t;
++
++#define HIFN_BASE_CMD_MAC 0x0400
++#define HIFN_BASE_CMD_CRYPT 0x0800
++#define HIFN_BASE_CMD_DECODE 0x2000
++#define HIFN_BASE_CMD_SRCLEN_M 0xc000
++#define HIFN_BASE_CMD_SRCLEN_S 14
++#define HIFN_BASE_CMD_DSTLEN_M 0x3000
++#define HIFN_BASE_CMD_DSTLEN_S 12
++#define HIFN_BASE_CMD_LENMASK_HI 0x30000
++#define HIFN_BASE_CMD_LENMASK_LO 0x0ffff
++
++/*
++ * Structure to help build up the command data structure.
++ */
++typedef struct hifn_crypt_command {
++ volatile u_int16_t masks;
++ volatile u_int16_t header_skip;
++ volatile u_int16_t source_count;
++ volatile u_int16_t reserved;
++} hifn_crypt_command_t;
++
++#define HIFN_CRYPT_CMD_ALG_MASK 0x0003 /* algorithm: */
++#define HIFN_CRYPT_CMD_ALG_DES 0x0000 /* DES */
++#define HIFN_CRYPT_CMD_ALG_3DES 0x0001 /* 3DES */
++#define HIFN_CRYPT_CMD_ALG_RC4 0x0002 /* RC4 */
++#define HIFN_CRYPT_CMD_ALG_AES 0x0003 /* AES */
++#define HIFN_CRYPT_CMD_MODE_MASK 0x0018 /* Encrypt mode: */
++#define HIFN_CRYPT_CMD_MODE_ECB 0x0000 /* ECB */
++#define HIFN_CRYPT_CMD_MODE_CBC 0x0008 /* CBC */
++#define HIFN_CRYPT_CMD_MODE_CFB 0x0010 /* CFB */
++#define HIFN_CRYPT_CMD_MODE_OFB 0x0018 /* OFB */
++#define HIFN_CRYPT_CMD_CLR_CTX 0x0040 /* clear context */
++#define HIFN_CRYPT_CMD_NEW_KEY 0x0800 /* expect new key */
++#define HIFN_CRYPT_CMD_NEW_IV 0x1000 /* expect new iv */
++
++#define HIFN_CRYPT_CMD_SRCLEN_M 0xc000
++#define HIFN_CRYPT_CMD_SRCLEN_S 14
++
++#define HIFN_CRYPT_CMD_KSZ_MASK 0x0600 /* AES key size: */
++#define HIFN_CRYPT_CMD_KSZ_128 0x0000 /* 128 bit */
++#define HIFN_CRYPT_CMD_KSZ_192 0x0200 /* 192 bit */
++#define HIFN_CRYPT_CMD_KSZ_256 0x0400 /* 256 bit */
++
++/*
++ * Structure to help build up the command data structure.
++ */
++typedef struct hifn_mac_command {
++ volatile u_int16_t masks;
++ volatile u_int16_t header_skip;
++ volatile u_int16_t source_count;
++ volatile u_int16_t reserved;
++} hifn_mac_command_t;
++
++#define HIFN_MAC_CMD_ALG_MASK 0x0001
++#define HIFN_MAC_CMD_ALG_SHA1 0x0000
++#define HIFN_MAC_CMD_ALG_MD5 0x0001
++#define HIFN_MAC_CMD_MODE_MASK 0x000c
++#define HIFN_MAC_CMD_MODE_HMAC 0x0000
++#define HIFN_MAC_CMD_MODE_SSL_MAC 0x0004
++#define HIFN_MAC_CMD_MODE_HASH 0x0008
++#define HIFN_MAC_CMD_MODE_FULL 0x0004
++#define HIFN_MAC_CMD_TRUNC 0x0010
++#define HIFN_MAC_CMD_RESULT 0x0020
++#define HIFN_MAC_CMD_APPEND 0x0040
++#define HIFN_MAC_CMD_SRCLEN_M 0xc000
++#define HIFN_MAC_CMD_SRCLEN_S 14
++
++/*
++ * MAC POS IPsec initiates authentication after encryption on encodes
++ * and before decryption on decodes.
++ */
++#define HIFN_MAC_CMD_POS_IPSEC 0x0200
++#define HIFN_MAC_CMD_NEW_KEY 0x0800
++
++/*
++ * The poll frequency and poll scalar defines are unshifted values used
++ * to set fields in the DMA Configuration Register.
++ */
++#ifndef HIFN_POLL_FREQUENCY
++#define HIFN_POLL_FREQUENCY 0x1
++#endif
++
++#ifndef HIFN_POLL_SCALAR
++#define HIFN_POLL_SCALAR 0x0
++#endif
++
++#define HIFN_MAX_SEGLEN 0xffff /* maximum dma segment len */
++#define HIFN_MAX_DMALEN 0x3ffff /* maximum dma length */
++#endif /* __HIFN_H__ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/hifn/hifn7751var.h linux-2.6.27.10/crypto/ocf/hifn/hifn7751var.h
+--- linux-2.6.27.10.orig/crypto/ocf/hifn/hifn7751var.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/hifn/hifn7751var.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,369 @@
++/* $FreeBSD: src/sys/dev/hifn/hifn7751var.h,v 1.9 2007/03/21 03:42:49 sam Exp $ */
++/* $OpenBSD: hifn7751var.h,v 1.42 2002/04/08 17:49:42 jason Exp $ */
++
++/*-
++ * Invertex AEON / Hifn 7751 driver
++ * Copyright (c) 1999 Invertex Inc. All rights reserved.
++ * Copyright (c) 1999 Theo de Raadt
++ * Copyright (c) 2000-2001 Network Security Technologies, Inc.
++ * http://www.netsec.net
++ *
++ * Please send any comments, feedback, bug-fixes, or feature requests to
++ * software@invertex.com.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ */
++
++#ifndef __HIFN7751VAR_H__
++#define __HIFN7751VAR_H__
++
++#ifdef __KERNEL__
++
++/*
++ * Some configurable values for the driver. By default command+result
++ * descriptor rings are the same size. The src+dst descriptor rings
++ * are sized at 3.5x the number of potential commands. Slower parts
++ * (e.g. 7951) tend to run out of src descriptors; faster parts (7811)
++ * src+cmd/result descriptors. It's not clear that increasing the size
++ * of the descriptor rings helps performance significantly as other
++ * factors tend to come into play (e.g. copying misaligned packets).
++ */
++#define HIFN_D_CMD_RSIZE 24 /* command descriptors */
++#define HIFN_D_SRC_RSIZE ((HIFN_D_CMD_RSIZE * 7) / 2) /* source descriptors */
++#define HIFN_D_RES_RSIZE HIFN_D_CMD_RSIZE /* result descriptors */
++#define HIFN_D_DST_RSIZE HIFN_D_SRC_RSIZE /* destination descriptors */
++
++/*
++ * Length values for cryptography
++ */
++#define HIFN_DES_KEY_LENGTH 8
++#define HIFN_3DES_KEY_LENGTH 24
++#define HIFN_MAX_CRYPT_KEY_LENGTH HIFN_3DES_KEY_LENGTH
++#define HIFN_IV_LENGTH 8
++#define HIFN_AES_IV_LENGTH 16
++#define HIFN_MAX_IV_LENGTH HIFN_AES_IV_LENGTH
++
++/*
++ * Length values for authentication
++ */
++#define HIFN_MAC_KEY_LENGTH 64
++#define HIFN_MD5_LENGTH 16
++#define HIFN_SHA1_LENGTH 20
++#define HIFN_MAC_TRUNC_LENGTH 12
++
++#define MAX_SCATTER 64
++
++/*
++ * Data structure to hold all 4 rings and any other ring related data.
++ */
++struct hifn_dma {
++ /*
++ * Descriptor rings. We add +1 to the size to accomidate the
++ * jump descriptor.
++ */
++ struct hifn_desc cmdr[HIFN_D_CMD_RSIZE+1];
++ struct hifn_desc srcr[HIFN_D_SRC_RSIZE+1];
++ struct hifn_desc dstr[HIFN_D_DST_RSIZE+1];
++ struct hifn_desc resr[HIFN_D_RES_RSIZE+1];
++
++ struct hifn_command *hifn_commands[HIFN_D_RES_RSIZE];
++
++ u_char command_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_COMMAND];
++ u_char result_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_RESULT];
++ u_int32_t slop[HIFN_D_CMD_RSIZE];
++
++ u_int64_t test_src, test_dst;
++
++ /*
++ * Our current positions for insertion and removal from the desriptor
++ * rings.
++ */
++ int cmdi, srci, dsti, resi;
++ volatile int cmdu, srcu, dstu, resu;
++ int cmdk, srck, dstk, resk;
++};
++
++struct hifn_session {
++ int hs_used;
++ int hs_mlen;
++ u_int8_t hs_iv[HIFN_MAX_IV_LENGTH];
++};
++
++#define HIFN_RING_SYNC(sc, r, i, f) \
++ /* DAVIDM bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, (f)) */
++
++#define HIFN_CMDR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), cmdr, (i), (f))
++#define HIFN_RESR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), resr, (i), (f))
++#define HIFN_SRCR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), srcr, (i), (f))
++#define HIFN_DSTR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), dstr, (i), (f))
++
++#define HIFN_CMD_SYNC(sc, i, f) \
++ /* DAVIDM bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, (f)) */
++
++#define HIFN_RES_SYNC(sc, i, f) \
++ /* DAVIDM bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, (f)) */
++
++typedef int bus_size_t;
++
++/*
++ * Holds data specific to a single HIFN board.
++ */
++struct hifn_softc {
++ softc_device_decl sc_dev;
++
++ struct pci_dev *sc_pcidev; /* PCI device pointer */
++ spinlock_t sc_mtx; /* per-instance lock */
++
++ int sc_num; /* for multiple devs */
++
++ ocf_iomem_t sc_bar0;
++ bus_size_t sc_bar0_lastreg;/* bar0 last reg written */
++ ocf_iomem_t sc_bar1;
++ bus_size_t sc_bar1_lastreg;/* bar1 last reg written */
++
++ int sc_irq;
++
++ u_int32_t sc_dmaier;
++ u_int32_t sc_drammodel; /* 1=dram, 0=sram */
++ u_int32_t sc_pllconfig; /* 7954/7955/7956 PLL config */
++
++ struct hifn_dma *sc_dma;
++ dma_addr_t sc_dma_physaddr;/* physical address of sc_dma */
++
++ int sc_dmansegs;
++ int32_t sc_cid;
++ int sc_maxses;
++ int sc_nsessions;
++ struct hifn_session *sc_sessions;
++ int sc_ramsize;
++ int sc_flags;
++#define HIFN_HAS_RNG 0x1 /* includes random number generator */
++#define HIFN_HAS_PUBLIC 0x2 /* includes public key support */
++#define HIFN_HAS_AES 0x4 /* includes AES support */
++#define HIFN_IS_7811 0x8 /* Hifn 7811 part */
++#define HIFN_IS_7956 0x10 /* Hifn 7956/7955 don't have SDRAM */
++
++ struct timer_list sc_tickto; /* for managing DMA */
++
++ int sc_rngfirst;
++ int sc_rnghz; /* RNG polling frequency */
++
++ int sc_c_busy; /* command ring busy */
++ int sc_s_busy; /* source data ring busy */
++ int sc_d_busy; /* destination data ring busy */
++ int sc_r_busy; /* result ring busy */
++ int sc_active; /* for initial countdown */
++ int sc_needwakeup; /* ops q'd wating on resources */
++ int sc_curbatch; /* # ops submitted w/o int */
++ int sc_suspended;
++#ifdef HIFN_VULCANDEV
++ struct cdev *sc_pkdev;
++#endif
++};
++
++#define HIFN_LOCK(_sc) spin_lock_irqsave(&(_sc)->sc_mtx, l_flags)
++#define HIFN_UNLOCK(_sc) spin_unlock_irqrestore(&(_sc)->sc_mtx, l_flags)
++
++/*
++ * hifn_command_t
++ *
++ * This is the control structure used to pass commands to hifn_encrypt().
++ *
++ * flags
++ * -----
++ * Flags is the bitwise "or" values for command configuration. A single
++ * encrypt direction needs to be set:
++ *
++ * HIFN_ENCODE or HIFN_DECODE
++ *
++ * To use cryptography, a single crypto algorithm must be included:
++ *
++ * HIFN_CRYPT_3DES or HIFN_CRYPT_DES
++ *
++ * To use authentication is used, a single MAC algorithm must be included:
++ *
++ * HIFN_MAC_MD5 or HIFN_MAC_SHA1
++ *
++ * By default MD5 uses a 16 byte hash and SHA-1 uses a 20 byte hash.
++ * If the value below is set, hash values are truncated or assumed
++ * truncated to 12 bytes:
++ *
++ * HIFN_MAC_TRUNC
++ *
++ * Keys for encryption and authentication can be sent as part of a command,
++ * or the last key value used with a particular session can be retrieved
++ * and used again if either of these flags are not specified.
++ *
++ * HIFN_CRYPT_NEW_KEY, HIFN_MAC_NEW_KEY
++ *
++ * session_num
++ * -----------
++ * A number between 0 and 2048 (for DRAM models) or a number between
++ * 0 and 768 (for SRAM models). Those who don't want to use session
++ * numbers should leave value at zero and send a new crypt key and/or
++ * new MAC key on every command. If you use session numbers and
++ * don't send a key with a command, the last key sent for that same
++ * session number will be used.
++ *
++ * Warning: Using session numbers and multiboard at the same time
++ * is currently broken.
++ *
++ * mbuf
++ * ----
++ * Either fill in the mbuf pointer and npa=0 or
++ * fill packp[] and packl[] and set npa to > 0
++ *
++ * mac_header_skip
++ * ---------------
++ * The number of bytes of the source_buf that are skipped over before
++ * authentication begins. This must be a number between 0 and 2^16-1
++ * and can be used by IPsec implementers to skip over IP headers.
++ * *** Value ignored if authentication not used ***
++ *
++ * crypt_header_skip
++ * -----------------
++ * The number of bytes of the source_buf that are skipped over before
++ * the cryptographic operation begins. This must be a number between 0
++ * and 2^16-1. For IPsec, this number will always be 8 bytes larger
++ * than the auth_header_skip (to skip over the ESP header).
++ * *** Value ignored if cryptography not used ***
++ *
++ */
++struct hifn_operand {
++ union {
++ struct sk_buff *skb;
++ struct uio *io;
++ unsigned char *buf;
++ } u;
++ void *map;
++ bus_size_t mapsize;
++ int nsegs;
++ struct {
++ dma_addr_t ds_addr;
++ int ds_len;
++ } segs[MAX_SCATTER];
++};
++
++struct hifn_command {
++ u_int16_t session_num;
++ u_int16_t base_masks, cry_masks, mac_masks;
++ u_int8_t iv[HIFN_MAX_IV_LENGTH], *ck, mac[HIFN_MAC_KEY_LENGTH];
++ int cklen;
++ int sloplen, slopidx;
++
++ struct hifn_operand src;
++ struct hifn_operand dst;
++
++ struct hifn_softc *softc;
++ struct cryptop *crp;
++ struct cryptodesc *enccrd, *maccrd;
++};
++
++#define src_skb src.u.skb
++#define src_io src.u.io
++#define src_map src.map
++#define src_mapsize src.mapsize
++#define src_segs src.segs
++#define src_nsegs src.nsegs
++#define src_buf src.u.buf
++
++#define dst_skb dst.u.skb
++#define dst_io dst.u.io
++#define dst_map dst.map
++#define dst_mapsize dst.mapsize
++#define dst_segs dst.segs
++#define dst_nsegs dst.nsegs
++#define dst_buf dst.u.buf
++
++/*
++ * Return values for hifn_crypto()
++ */
++#define HIFN_CRYPTO_SUCCESS 0
++#define HIFN_CRYPTO_BAD_INPUT (-1)
++#define HIFN_CRYPTO_RINGS_FULL (-2)
++
++/**************************************************************************
++ *
++ * Function: hifn_crypto
++ *
++ * Purpose: Called by external drivers to begin an encryption on the
++ * HIFN board.
++ *
++ * Blocking/Non-blocking Issues
++ * ============================
++ * The driver cannot block in hifn_crypto (no calls to tsleep) currently.
++ * hifn_crypto() returns HIFN_CRYPTO_RINGS_FULL if there is not enough
++ * room in any of the rings for the request to proceed.
++ *
++ * Return Values
++ * =============
++ * 0 for success, negative values on error
++ *
++ * Defines for negative error codes are:
++ *
++ * HIFN_CRYPTO_BAD_INPUT : The passed in command had invalid settings.
++ * HIFN_CRYPTO_RINGS_FULL : All DMA rings were full and non-blocking
++ * behaviour was requested.
++ *
++ *************************************************************************/
++
++/*
++ * Convert back and forth from 'sid' to 'card' and 'session'
++ */
++#define HIFN_CARD(sid) (((sid) & 0xf0000000) >> 28)
++#define HIFN_SESSION(sid) ((sid) & 0x000007ff)
++#define HIFN_SID(crd,ses) (((crd) << 28) | ((ses) & 0x7ff))
++
++#endif /* _KERNEL */
++
++struct hifn_stats {
++ u_int64_t hst_ibytes;
++ u_int64_t hst_obytes;
++ u_int32_t hst_ipackets;
++ u_int32_t hst_opackets;
++ u_int32_t hst_invalid;
++ u_int32_t hst_nomem; /* malloc or one of hst_nomem_* */
++ u_int32_t hst_abort;
++ u_int32_t hst_noirq; /* IRQ for no reason */
++ u_int32_t hst_totbatch; /* ops submitted w/o interrupt */
++ u_int32_t hst_maxbatch; /* max ops submitted together */
++ u_int32_t hst_unaligned; /* unaligned src caused copy */
++ /*
++ * The following divides hst_nomem into more specific buckets.
++ */
++ u_int32_t hst_nomem_map; /* bus_dmamap_create failed */
++ u_int32_t hst_nomem_load; /* bus_dmamap_load_* failed */
++ u_int32_t hst_nomem_mbuf; /* MGET* failed */
++ u_int32_t hst_nomem_mcl; /* MCLGET* failed */
++ u_int32_t hst_nomem_cr; /* out of command/result descriptor */
++ u_int32_t hst_nomem_sd; /* out of src/dst descriptors */
++};
++
++#endif /* __HIFN7751VAR_H__ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/hifn/hifnHIPP.c linux-2.6.27.10/crypto/ocf/hifn/hifnHIPP.c
+--- linux-2.6.27.10.orig/crypto/ocf/hifn/hifnHIPP.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/hifn/hifnHIPP.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,420 @@
++/*-
++ * Driver for Hifn HIPP-I/II chipset
++ * Copyright (c) 2006 Michael Richardson <mcr@xelerance.com>
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored by Hifn Inc.
++ *
++ */
++
++/*
++ * Driver for various Hifn encryption processors.
++ */
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/version.h>
++#include <linux/skbuff.h>
++#include <linux/uio.h>
++#include <linux/sysfs.h>
++#include <linux/miscdevice.h>
++#include <asm/io.h>
++
++#include <cryptodev.h>
++
++#include "hifnHIPPreg.h"
++#include "hifnHIPPvar.h"
++
++#if 1
++#define DPRINTF(a...) if (hipp_debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_dev) : "hifn"); \
++ printk(a); \
++ } else
++#else
++#define DPRINTF(a...)
++#endif
++
++typedef int bus_size_t;
++
++static inline int
++pci_get_revid(struct pci_dev *dev)
++{
++ u8 rid = 0;
++ pci_read_config_byte(dev, PCI_REVISION_ID, &rid);
++ return rid;
++}
++
++#define debug hipp_debug
++int hipp_debug = 0;
++module_param(hipp_debug, int, 0644);
++MODULE_PARM_DESC(hipp_debug, "Enable debug");
++
++int hipp_maxbatch = 1;
++module_param(hipp_maxbatch, int, 0644);
++MODULE_PARM_DESC(hipp_maxbatch, "max ops to batch w/o interrupt");
++
++static int hipp_probe(struct pci_dev *dev, const struct pci_device_id *ent);
++static void hipp_remove(struct pci_dev *dev);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++static irqreturn_t hipp_intr(int irq, void *arg);
++#else
++static irqreturn_t hipp_intr(int irq, void *arg, struct pt_regs *regs);
++#endif
++
++static int hipp_num_chips = 0;
++static struct hipp_softc *hipp_chip_idx[HIPP_MAX_CHIPS];
++
++static int hipp_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int hipp_freesession(device_t, u_int64_t);
++static int hipp_process(device_t, struct cryptop *, int);
++
++static device_method_t hipp_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, hipp_newsession),
++ DEVMETHOD(cryptodev_freesession,hipp_freesession),
++ DEVMETHOD(cryptodev_process, hipp_process),
++};
++
++static __inline u_int32_t
++READ_REG(struct hipp_softc *sc, unsigned int barno, bus_size_t reg)
++{
++ u_int32_t v = readl(sc->sc_bar[barno] + reg);
++ //sc->sc_bar0_lastreg = (bus_size_t) -1;
++ return (v);
++}
++static __inline void
++WRITE_REG(struct hipp_softc *sc, unsigned int barno, bus_size_t reg, u_int32_t val)
++{
++ writel(val, sc->sc_bar[barno] + reg);
++}
++
++#define READ_REG_0(sc, reg) READ_REG(sc, 0, reg)
++#define WRITE_REG_0(sc, reg, val) WRITE_REG(sc,0, reg, val)
++#define READ_REG_1(sc, reg) READ_REG(sc, 1, reg)
++#define WRITE_REG_1(sc, reg, val) WRITE_REG(sc,1, reg, val)
++
++static int
++hipp_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ return EINVAL;
++}
++
++static int
++hipp_freesession(device_t dev, u_int64_t tid)
++{
++ return EINVAL;
++}
++
++static int
++hipp_process(device_t dev, struct cryptop *crp, int hint)
++{
++ return EINVAL;
++}
++
++static const char*
++hipp_partname(struct hipp_softc *sc, char buf[128], size_t blen)
++{
++ char *n = NULL;
++
++ switch (pci_get_vendor(sc->sc_pcidev)) {
++ case PCI_VENDOR_HIFN:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_HIFN_7855: n = "Hifn 7855";
++ case PCI_PRODUCT_HIFN_8155: n = "Hifn 8155";
++ case PCI_PRODUCT_HIFN_6500: n = "Hifn 6500";
++ }
++ }
++
++ if(n==NULL) {
++ snprintf(buf, blen, "VID=%02x,PID=%02x",
++ pci_get_vendor(sc->sc_pcidev),
++ pci_get_device(sc->sc_pcidev));
++ } else {
++ buf[0]='\0';
++ strncat(buf, n, blen);
++ }
++ return buf;
++}
++
++struct hipp_fs_entry {
++ struct attribute attr;
++ /* other stuff */
++};
++
++
++static ssize_t
++cryptoid_show(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct hipp_softc *sc;
++
++ sc = pci_get_drvdata(to_pci_dev (dev));
++ return sprintf (buf, "%d\n", sc->sc_cid);
++}
++
++struct device_attribute hipp_dev_cryptoid = __ATTR_RO(cryptoid);
++
++/*
++ * Attach an interface that successfully probed.
++ */
++static int
++hipp_probe(struct pci_dev *dev, const struct pci_device_id *ent)
++{
++ struct hipp_softc *sc = NULL;
++ int i;
++ //char rbase;
++ //u_int16_t ena;
++ int rev;
++ //int rseg;
++ int rc;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (pci_enable_device(dev) < 0)
++ return(-ENODEV);
++
++ if (pci_set_mwi(dev))
++ return(-ENODEV);
++
++ if (!dev->irq) {
++ printk("hifn: found device with no IRQ assigned. check BIOS settings!");
++ pci_disable_device(dev);
++ return(-ENODEV);
++ }
++
++ sc = (struct hipp_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return(-ENOMEM);
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, "hifn-hipp", hipp_num_chips, hipp_methods);
++
++ sc->sc_pcidev = dev;
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++ sc->sc_num = hipp_num_chips++;
++
++ if (sc->sc_num < HIPP_MAX_CHIPS)
++ hipp_chip_idx[sc->sc_num] = sc;
++
++ pci_set_drvdata(sc->sc_pcidev, sc);
++
++ spin_lock_init(&sc->sc_mtx);
++
++ /*
++ * Setup PCI resources.
++ * The READ_REG_0, WRITE_REG_0, READ_REG_1,
++ * and WRITE_REG_1 macros throughout the driver are used
++ * to permit better debugging.
++ */
++ for(i=0; i<4; i++) {
++ unsigned long mem_start, mem_len;
++ mem_start = pci_resource_start(sc->sc_pcidev, i);
++ mem_len = pci_resource_len(sc->sc_pcidev, i);
++ sc->sc_barphy[i] = (caddr_t)mem_start;
++ sc->sc_bar[i] = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_bar[i]) {
++ device_printf(sc->sc_dev, "cannot map bar%d register space\n", i);
++ goto fail;
++ }
++ }
++
++ //hipp_reset_board(sc, 0);
++ pci_set_master(sc->sc_pcidev);
++
++ /*
++ * Arrange the interrupt line.
++ */
++ rc = request_irq(dev->irq, hipp_intr, IRQF_SHARED, "hifn", sc);
++ if (rc) {
++ device_printf(sc->sc_dev, "could not map interrupt: %d\n", rc);
++ goto fail;
++ }
++ sc->sc_irq = dev->irq;
++
++ rev = READ_REG_1(sc, HIPP_1_REVID) & 0xffff;
++
++ {
++ char b[32];
++ device_printf(sc->sc_dev, "%s, rev %u",
++ hipp_partname(sc, b, sizeof(b)), rev);
++ }
++
++#if 0
++ if (sc->sc_flags & HIFN_IS_7956)
++ printf(", pll=0x%x<%s clk, %ux mult>",
++ sc->sc_pllconfig,
++ sc->sc_pllconfig & HIFN_PLL_REF_SEL ? "ext" : "pci",
++ 2 + 2*((sc->sc_pllconfig & HIFN_PLL_ND) >> 11));
++#endif
++ printf("\n");
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ device_printf(sc->sc_dev, "could not get crypto driver id\n");
++ goto fail;
++ }
++
++#if 0 /* cannot work with a non-GPL module */
++ /* make a sysfs entry to let the world know what entry we got */
++ sysfs_create_file(&sc->sc_pcidev->dev.kobj, &hipp_dev_cryptoid.attr);
++#endif
++
++#if 0
++ init_timer(&sc->sc_tickto);
++ sc->sc_tickto.function = hifn_tick;
++ sc->sc_tickto.data = (unsigned long) sc->sc_num;
++ mod_timer(&sc->sc_tickto, jiffies + HZ);
++#endif
++
++#if 0 /* no code here yet ?? */
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++#endif
++
++ return (0);
++
++fail:
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++
++#if 0
++ if (sc->sc_dma) {
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ pci_free_consistent(sc->sc_pcidev,
++ sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++ }
++#endif
++ kfree(sc);
++ return (-ENXIO);
++}
++
++/*
++ * Detach an interface that successfully probed.
++ */
++static void
++hipp_remove(struct pci_dev *dev)
++{
++ struct hipp_softc *sc = pci_get_drvdata(dev);
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* disable interrupts */
++ HIPP_LOCK(sc);
++
++#if 0
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, 0);
++ HIFN_UNLOCK(sc);
++
++ /*XXX other resources */
++ del_timer_sync(&sc->sc_tickto);
++
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++#endif
++
++ crypto_unregister_all(sc->sc_cid);
++
++ free_irq(sc->sc_irq, sc);
++
++#if 0
++ pci_free_consistent(sc->sc_pcidev, sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++#endif
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++static irqreturn_t hipp_intr(int irq, void *arg)
++#else
++static irqreturn_t hipp_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct hipp_softc *sc = arg;
++
++ sc = sc; /* shut up compiler */
++
++ return IRQ_HANDLED;
++}
++
++static struct pci_device_id hipp_pci_tbl[] = {
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7855,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_8155,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++};
++MODULE_DEVICE_TABLE(pci, hipp_pci_tbl);
++
++static struct pci_driver hipp_driver = {
++ .name = "hipp",
++ .id_table = hipp_pci_tbl,
++ .probe = hipp_probe,
++ .remove = hipp_remove,
++ /* add PM stuff here one day */
++};
++
++static int __init hipp_init (void)
++{
++ struct hipp_softc *sc = NULL;
++ int rc;
++
++ DPRINTF("%s(%p)\n", __FUNCTION__, hipp_init);
++
++ rc = pci_register_driver(&hipp_driver);
++ pci_register_driver_compat(&hipp_driver, rc);
++
++ return rc;
++}
++
++static void __exit hipp_exit (void)
++{
++ pci_unregister_driver(&hipp_driver);
++}
++
++module_init(hipp_init);
++module_exit(hipp_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("Michael Richardson <mcr@xelerance.com>");
++MODULE_DESCRIPTION("OCF driver for hifn HIPP-I/II PCI crypto devices");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/hifn/hifnHIPPreg.h linux-2.6.27.10/crypto/ocf/hifn/hifnHIPPreg.h
+--- linux-2.6.27.10.orig/crypto/ocf/hifn/hifnHIPPreg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/hifn/hifnHIPPreg.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,46 @@
++/*-
++ * Hifn HIPP-I/HIPP-II (7855/8155) driver.
++ * Copyright (c) 2006 Michael Richardson <mcr@xelerance.com>
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored by Hifn inc.
++ *
++ */
++
++#ifndef __HIFNHIPP_H__
++#define __HIFNHIPP_H__
++
++/*
++ * PCI vendor and device identifiers
++ */
++#define PCI_VENDOR_HIFN 0x13a3 /* Hifn */
++#define PCI_PRODUCT_HIFN_6500 0x0006 /* 6500 */
++#define PCI_PRODUCT_HIFN_7855 0x001f /* 7855 */
++#define PCI_PRODUCT_HIFN_8155 0x999 /* XXX 8155 */
++
++#define HIPP_1_REVID 0x01 /* BOGUS */
++
++#endif /* __HIPP_H__ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/hifn/hifnHIPPvar.h linux-2.6.27.10/crypto/ocf/hifn/hifnHIPPvar.h
+--- linux-2.6.27.10.orig/crypto/ocf/hifn/hifnHIPPvar.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/hifn/hifnHIPPvar.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,93 @@
++/*
++ * Hifn HIPP-I/HIPP-II (7855/8155) driver.
++ * Copyright (c) 2006 Michael Richardson <mcr@xelerance.com> *
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored by Hifn inc.
++ *
++ */
++
++#ifndef __HIFNHIPPVAR_H__
++#define __HIFNHIPPVAR_H__
++
++#define HIPP_MAX_CHIPS 8
++
++/*
++ * Holds data specific to a single Hifn HIPP-I board.
++ */
++struct hipp_softc {
++ softc_device_decl sc_dev;
++
++ struct pci_dev *sc_pcidev; /* device backpointer */
++ ocf_iomem_t sc_bar[5];
++ caddr_t sc_barphy[5]; /* physical address */
++ int sc_num; /* for multiple devs */
++ spinlock_t sc_mtx; /* per-instance lock */
++ int32_t sc_cid;
++ int sc_irq;
++
++#if 0
++
++ u_int32_t sc_dmaier;
++ u_int32_t sc_drammodel; /* 1=dram, 0=sram */
++ u_int32_t sc_pllconfig; /* 7954/7955/7956 PLL config */
++
++ struct hifn_dma *sc_dma;
++ dma_addr_t sc_dma_physaddr;/* physical address of sc_dma */
++
++ int sc_dmansegs;
++ int sc_maxses;
++ int sc_nsessions;
++ struct hifn_session *sc_sessions;
++ int sc_ramsize;
++ int sc_flags;
++#define HIFN_HAS_RNG 0x1 /* includes random number generator */
++#define HIFN_HAS_PUBLIC 0x2 /* includes public key support */
++#define HIFN_HAS_AES 0x4 /* includes AES support */
++#define HIFN_IS_7811 0x8 /* Hifn 7811 part */
++#define HIFN_IS_7956 0x10 /* Hifn 7956/7955 don't have SDRAM */
++
++ struct timer_list sc_tickto; /* for managing DMA */
++
++ int sc_rngfirst;
++ int sc_rnghz; /* RNG polling frequency */
++
++ int sc_c_busy; /* command ring busy */
++ int sc_s_busy; /* source data ring busy */
++ int sc_d_busy; /* destination data ring busy */
++ int sc_r_busy; /* result ring busy */
++ int sc_active; /* for initial countdown */
++ int sc_needwakeup; /* ops q'd wating on resources */
++ int sc_curbatch; /* # ops submitted w/o int */
++ int sc_suspended;
++ struct miscdevice sc_miscdev;
++#endif
++};
++
++#define HIPP_LOCK(_sc) spin_lock_irqsave(&(_sc)->sc_mtx, l_flags)
++#define HIPP_UNLOCK(_sc) spin_unlock_irqrestore(&(_sc)->sc_mtx, l_flags)
++
++#endif /* __HIFNHIPPVAR_H__ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/hifn/Makefile linux-2.6.27.10/crypto/ocf/hifn/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/hifn/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/hifn/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,13 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_HIFN) += hifn7751.o
++obj-$(CONFIG_OCF_HIFNHIPP) += hifnHIPP.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ixp4xx/ixp4xx.c linux-2.6.27.10/crypto/ocf/ixp4xx/ixp4xx.c
+--- linux-2.6.27.10.orig/crypto/ocf/ixp4xx/ixp4xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ixp4xx/ixp4xx.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,1328 @@
++/*
++ * An OCF module that uses Intels IXP CryptACC API to do the crypto.
++ * This driver requires the IXP400 Access Library that is available
++ * from Intel in order to operate (or compile).
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/sched.h>
++#include <linux/wait.h>
++#include <linux/crypto.h>
++#include <linux/interrupt.h>
++#include <asm/scatterlist.h>
++
++#include <IxTypes.h>
++#include <IxOsBuffMgt.h>
++#include <IxNpeDl.h>
++#include <IxCryptoAcc.h>
++#include <IxQMgr.h>
++#include <IxOsServices.h>
++#include <IxOsCacheMMU.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++#ifndef IX_MBUF_PRIV
++#define IX_MBUF_PRIV(x) ((x)->priv)
++#endif
++
++struct ixp_data;
++
++struct ixp_q {
++ struct list_head ixp_q_list;
++ struct ixp_data *ixp_q_data;
++ struct cryptop *ixp_q_crp;
++ struct cryptodesc *ixp_q_ccrd;
++ struct cryptodesc *ixp_q_acrd;
++ IX_MBUF ixp_q_mbuf;
++ UINT8 *ixp_hash_dest; /* Location for hash in client buffer */
++ UINT8 *ixp_hash_src; /* Location of hash in internal buffer */
++ unsigned char ixp_q_iv_data[IX_CRYPTO_ACC_MAX_CIPHER_IV_LENGTH];
++ unsigned char *ixp_q_iv;
++};
++
++struct ixp_data {
++ int ixp_registered; /* is the context registered */
++ int ixp_crd_flags; /* detect direction changes */
++
++ int ixp_cipher_alg;
++ int ixp_auth_alg;
++
++ UINT32 ixp_ctx_id;
++ UINT32 ixp_hash_key_id; /* used when hashing */
++ IxCryptoAccCtx ixp_ctx;
++ IX_MBUF ixp_pri_mbuf;
++ IX_MBUF ixp_sec_mbuf;
++
++ struct work_struct ixp_pending_work;
++ struct work_struct ixp_registration_work;
++ struct list_head ixp_q; /* unprocessed requests */
++};
++
++#ifdef __ixp46X
++
++#define MAX_IOP_SIZE 64 /* words */
++#define MAX_OOP_SIZE 128
++
++#define MAX_PARAMS 3
++
++struct ixp_pkq {
++ struct list_head pkq_list;
++ struct cryptkop *pkq_krp;
++
++ IxCryptoAccPkeEauInOperands pkq_op;
++ IxCryptoAccPkeEauOpResult pkq_result;
++
++ UINT32 pkq_ibuf0[MAX_IOP_SIZE];
++ UINT32 pkq_ibuf1[MAX_IOP_SIZE];
++ UINT32 pkq_ibuf2[MAX_IOP_SIZE];
++ UINT32 pkq_obuf[MAX_OOP_SIZE];
++};
++
++static LIST_HEAD(ixp_pkq); /* current PK wait list */
++static struct ixp_pkq *ixp_pk_cur;
++static spinlock_t ixp_pkq_lock;
++
++#endif /* __ixp46X */
++
++static int ixp_blocked = 0;
++
++static int32_t ixp_id = -1;
++static struct ixp_data **ixp_sessions = NULL;
++static u_int32_t ixp_sesnum = 0;
++
++static int ixp_process(device_t, struct cryptop *, int);
++static int ixp_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int ixp_freesession(device_t, u_int64_t);
++#ifdef __ixp46X
++static int ixp_kprocess(device_t, struct cryptkop *krp, int hint);
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
++static kmem_cache_t *qcache;
++#else
++static struct kmem_cache *qcache;
++#endif
++
++#define debug ixp_debug
++static int ixp_debug = 0;
++module_param(ixp_debug, int, 0644);
++MODULE_PARM_DESC(ixp_debug, "Enable debug");
++
++static int ixp_init_crypto = 1;
++module_param(ixp_init_crypto, int, 0444); /* RO after load/boot */
++MODULE_PARM_DESC(ixp_init_crypto, "Call ixCryptoAccInit (default is 1)");
++
++static void ixp_process_pending(void *arg);
++static void ixp_registration(void *arg);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void ixp_process_pending_wq(struct work_struct *work);
++static void ixp_registration_wq(struct work_struct *work);
++#endif
++
++/*
++ * dummy device structure
++ */
++
++static struct {
++ softc_device_decl sc_dev;
++} ixpdev;
++
++static device_method_t ixp_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, ixp_newsession),
++ DEVMETHOD(cryptodev_freesession,ixp_freesession),
++ DEVMETHOD(cryptodev_process, ixp_process),
++#ifdef __ixp46X
++ DEVMETHOD(cryptodev_kprocess, ixp_kprocess),
++#endif
++};
++
++/*
++ * Generate a new software session.
++ */
++static int
++ixp_newsession(device_t dev, u_int32_t *sid, struct cryptoini *cri)
++{
++ struct ixp_data *ixp;
++ u_int32_t i;
++#define AUTH_LEN(cri, def) \
++ (cri->cri_mlen ? cri->cri_mlen : (def))
++
++ dprintk("%s():alg %d\n", __FUNCTION__,cri->cri_alg);
++ if (sid == NULL || cri == NULL) {
++ dprintk("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ if (ixp_sessions) {
++ for (i = 1; i < ixp_sesnum; i++)
++ if (ixp_sessions[i] == NULL)
++ break;
++ } else
++ i = 1; /* NB: to silence compiler warning */
++
++ if (ixp_sessions == NULL || i == ixp_sesnum) {
++ struct ixp_data **ixpd;
++
++ if (ixp_sessions == NULL) {
++ i = 1; /* We leave ixp_sessions[0] empty */
++ ixp_sesnum = CRYPTO_SW_SESSIONS;
++ } else
++ ixp_sesnum *= 2;
++
++ ixpd = kmalloc(ixp_sesnum * sizeof(struct ixp_data *), SLAB_ATOMIC);
++ if (ixpd == NULL) {
++ /* Reset session number */
++ if (ixp_sesnum == CRYPTO_SW_SESSIONS)
++ ixp_sesnum = 0;
++ else
++ ixp_sesnum /= 2;
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memset(ixpd, 0, ixp_sesnum * sizeof(struct ixp_data *));
++
++ /* Copy existing sessions */
++ if (ixp_sessions) {
++ memcpy(ixpd, ixp_sessions,
++ (ixp_sesnum / 2) * sizeof(struct ixp_data *));
++ kfree(ixp_sessions);
++ }
++
++ ixp_sessions = ixpd;
++ }
++
++ ixp_sessions[i] = (struct ixp_data *) kmalloc(sizeof(struct ixp_data),
++ SLAB_ATOMIC);
++ if (ixp_sessions[i] == NULL) {
++ ixp_freesession(NULL, i);
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++
++ *sid = i;
++
++ ixp = ixp_sessions[i];
++ memset(ixp, 0, sizeof(*ixp));
++
++ ixp->ixp_cipher_alg = -1;
++ ixp->ixp_auth_alg = -1;
++ ixp->ixp_ctx_id = -1;
++ INIT_LIST_HEAD(&ixp->ixp_q);
++
++ ixp->ixp_ctx.useDifferentSrcAndDestMbufs = 0;
++
++ while (cri) {
++ switch (cri->cri_alg) {
++ case CRYPTO_DES_CBC:
++ ixp->ixp_cipher_alg = cri->cri_alg;
++ ixp->ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_DES;
++ ixp->ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp->ixp_ctx.cipherCtx.cipherKeyLen = (cri->cri_klen + 7) / 8;
++ ixp->ixp_ctx.cipherCtx.cipherBlockLen = IX_CRYPTO_ACC_DES_BLOCK_64;
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen =
++ IX_CRYPTO_ACC_DES_IV_64;
++ memcpy(ixp->ixp_ctx.cipherCtx.key.cipherKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ break;
++
++ case CRYPTO_3DES_CBC:
++ ixp->ixp_cipher_alg = cri->cri_alg;
++ ixp->ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_3DES;
++ ixp->ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp->ixp_ctx.cipherCtx.cipherKeyLen = (cri->cri_klen + 7) / 8;
++ ixp->ixp_ctx.cipherCtx.cipherBlockLen = IX_CRYPTO_ACC_DES_BLOCK_64;
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen =
++ IX_CRYPTO_ACC_DES_IV_64;
++ memcpy(ixp->ixp_ctx.cipherCtx.key.cipherKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ break;
++
++ case CRYPTO_RIJNDAEL128_CBC:
++ ixp->ixp_cipher_alg = cri->cri_alg;
++ ixp->ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_AES;
++ ixp->ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp->ixp_ctx.cipherCtx.cipherKeyLen = (cri->cri_klen + 7) / 8;
++ ixp->ixp_ctx.cipherCtx.cipherBlockLen = 16;
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen = 16;
++ memcpy(ixp->ixp_ctx.cipherCtx.key.cipherKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ break;
++
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ ixp->ixp_auth_alg = cri->cri_alg;
++ ixp->ixp_ctx.authCtx.authAlgo = IX_CRYPTO_ACC_AUTH_MD5;
++ ixp->ixp_ctx.authCtx.authDigestLen = AUTH_LEN(cri, MD5_HASH_LEN);
++ ixp->ixp_ctx.authCtx.aadLen = 0;
++ /* Only MD5_HMAC needs a key */
++ if (cri->cri_alg == CRYPTO_MD5_HMAC) {
++ ixp->ixp_ctx.authCtx.authKeyLen = (cri->cri_klen + 7) / 8;
++ if (ixp->ixp_ctx.authCtx.authKeyLen >
++ sizeof(ixp->ixp_ctx.authCtx.key.authKey)) {
++ printk(
++ "ixp4xx: Invalid key length for MD5_HMAC - %d bits\n",
++ cri->cri_klen);
++ ixp_freesession(NULL, i);
++ return EINVAL;
++ }
++ memcpy(ixp->ixp_ctx.authCtx.key.authKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ }
++ break;
++
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ ixp->ixp_auth_alg = cri->cri_alg;
++ ixp->ixp_ctx.authCtx.authAlgo = IX_CRYPTO_ACC_AUTH_SHA1;
++ ixp->ixp_ctx.authCtx.authDigestLen = AUTH_LEN(cri, SHA1_HASH_LEN);
++ ixp->ixp_ctx.authCtx.aadLen = 0;
++ /* Only SHA1_HMAC needs a key */
++ if (cri->cri_alg == CRYPTO_SHA1_HMAC) {
++ ixp->ixp_ctx.authCtx.authKeyLen = (cri->cri_klen + 7) / 8;
++ if (ixp->ixp_ctx.authCtx.authKeyLen >
++ sizeof(ixp->ixp_ctx.authCtx.key.authKey)) {
++ printk(
++ "ixp4xx: Invalid key length for SHA1_HMAC - %d bits\n",
++ cri->cri_klen);
++ ixp_freesession(NULL, i);
++ return EINVAL;
++ }
++ memcpy(ixp->ixp_ctx.authCtx.key.authKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ }
++ break;
++
++ default:
++ printk("ixp: unknown algo 0x%x\n", cri->cri_alg);
++ ixp_freesession(NULL, i);
++ return EINVAL;
++ }
++ cri = cri->cri_next;
++ }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ INIT_WORK(&ixp->ixp_pending_work, ixp_process_pending_wq);
++ INIT_WORK(&ixp->ixp_registration_work, ixp_registration_wq);
++#else
++ INIT_WORK(&ixp->ixp_pending_work, ixp_process_pending, ixp);
++ INIT_WORK(&ixp->ixp_registration_work, ixp_registration, ixp);
++#endif
++
++ return 0;
++}
++
++
++/*
++ * Free a session.
++ */
++static int
++ixp_freesession(device_t dev, u_int64_t tid)
++{
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid > ixp_sesnum || ixp_sessions == NULL ||
++ ixp_sessions[sid] == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ /* Silently accept and return */
++ if (sid == 0)
++ return 0;
++
++ if (ixp_sessions[sid]) {
++ if (ixp_sessions[sid]->ixp_ctx_id != -1) {
++ ixCryptoAccCtxUnregister(ixp_sessions[sid]->ixp_ctx_id);
++ ixp_sessions[sid]->ixp_ctx_id = -1;
++ }
++
++ flush_scheduled_work();
++
++ kfree(ixp_sessions[sid]);
++ }
++ ixp_sessions[sid] = NULL;
++ if (ixp_blocked) {
++ ixp_blocked = 0;
++ crypto_unblock(ixp_id, CRYPTO_SYMQ);
++ }
++ return 0;
++}
++
++
++/*
++ * callback for when hash processing is complete
++ */
++
++static void
++ixp_hash_perform_cb(
++ UINT32 hash_key_id,
++ IX_MBUF *bufp,
++ IxCryptoAccStatus status)
++{
++ struct ixp_q *q;
++
++ dprintk("%s(%u, %p, 0x%x)\n", __FUNCTION__, hash_key_id, bufp, status);
++
++ if (bufp == NULL) {
++ printk("ixp: NULL buf in %s\n", __FUNCTION__);
++ return;
++ }
++
++ q = IX_MBUF_PRIV(bufp);
++ if (q == NULL) {
++ printk("ixp: NULL priv in %s\n", __FUNCTION__);
++ return;
++ }
++
++ if (status == IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ /* On success, need to copy hash back into original client buffer */
++ memcpy(q->ixp_hash_dest, q->ixp_hash_src,
++ (q->ixp_q_data->ixp_auth_alg == CRYPTO_SHA1) ?
++ SHA1_HASH_LEN : MD5_HASH_LEN);
++ }
++ else {
++ printk("ixp: hash perform failed status=%d\n", status);
++ q->ixp_q_crp->crp_etype = EINVAL;
++ }
++
++ /* Free internal buffer used for hashing */
++ kfree(IX_MBUF_MDATA(&q->ixp_q_mbuf));
++
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++}
++
++/*
++ * setup a request and perform it
++ */
++static void
++ixp_q_process(struct ixp_q *q)
++{
++ IxCryptoAccStatus status;
++ struct ixp_data *ixp = q->ixp_q_data;
++ int auth_off = 0;
++ int auth_len = 0;
++ int crypt_off = 0;
++ int crypt_len = 0;
++ int icv_off = 0;
++ char *crypt_func;
++
++ dprintk("%s(%p)\n", __FUNCTION__, q);
++
++ if (q->ixp_q_ccrd) {
++ if (q->ixp_q_ccrd->crd_flags & CRD_F_IV_EXPLICIT) {
++ q->ixp_q_iv = q->ixp_q_ccrd->crd_iv;
++ } else {
++ q->ixp_q_iv = q->ixp_q_iv_data;
++ crypto_copydata(q->ixp_q_crp->crp_flags, q->ixp_q_crp->crp_buf,
++ q->ixp_q_ccrd->crd_inject,
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen,
++ (caddr_t) q->ixp_q_iv);
++ }
++
++ if (q->ixp_q_acrd) {
++ auth_off = q->ixp_q_acrd->crd_skip;
++ auth_len = q->ixp_q_acrd->crd_len;
++ icv_off = q->ixp_q_acrd->crd_inject;
++ }
++
++ crypt_off = q->ixp_q_ccrd->crd_skip;
++ crypt_len = q->ixp_q_ccrd->crd_len;
++ } else { /* if (q->ixp_q_acrd) */
++ auth_off = q->ixp_q_acrd->crd_skip;
++ auth_len = q->ixp_q_acrd->crd_len;
++ icv_off = q->ixp_q_acrd->crd_inject;
++ }
++
++ if (q->ixp_q_crp->crp_flags & CRYPTO_F_SKBUF) {
++ struct sk_buff *skb = (struct sk_buff *) q->ixp_q_crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags) {
++ /*
++ * DAVIDM fix this limitation one day by using
++ * a buffer pool and chaining, it is not currently
++ * needed for current user/kernel space acceleration
++ */
++ printk("ixp: Cannot handle fragmented skb's yet !\n");
++ q->ixp_q_crp->crp_etype = ENOENT;
++ goto done;
++ }
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) =
++ IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) = skb->len;
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = skb->data;
++ } else if (q->ixp_q_crp->crp_flags & CRYPTO_F_IOV) {
++ struct uio *uiop = (struct uio *) q->ixp_q_crp->crp_buf;
++ if (uiop->uio_iovcnt != 1) {
++ /*
++ * DAVIDM fix this limitation one day by using
++ * a buffer pool and chaining, it is not currently
++ * needed for current user/kernel space acceleration
++ */
++ printk("ixp: Cannot handle more than 1 iovec yet !\n");
++ q->ixp_q_crp->crp_etype = ENOENT;
++ goto done;
++ }
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) =
++ IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) = uiop->uio_iov[0].iov_len;
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = uiop->uio_iov[0].iov_base;
++ } else /* contig buffer */ {
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) =
++ IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) = q->ixp_q_crp->crp_ilen;
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = q->ixp_q_crp->crp_buf;
++ }
++
++ IX_MBUF_PRIV(&q->ixp_q_mbuf) = q;
++
++ if (ixp->ixp_auth_alg == CRYPTO_SHA1 || ixp->ixp_auth_alg == CRYPTO_MD5) {
++ /*
++ * For SHA1 and MD5 hash, need to create an internal buffer that is big
++ * enough to hold the original data + the appropriate padding for the
++ * hash algorithm.
++ */
++ UINT8 *tbuf = NULL;
++
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) = IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) =
++ ((IX_MBUF_MLEN(&q->ixp_q_mbuf) * 8) + 72 + 511) / 8;
++ tbuf = kmalloc(IX_MBUF_MLEN(&q->ixp_q_mbuf), SLAB_ATOMIC);
++
++ if (IX_MBUF_MDATA(&q->ixp_q_mbuf) == NULL) {
++ printk("ixp: kmalloc(%u, SLAB_ATOMIC) failed\n",
++ IX_MBUF_MLEN(&q->ixp_q_mbuf));
++ q->ixp_q_crp->crp_etype = ENOMEM;
++ goto done;
++ }
++ memcpy(tbuf, &(IX_MBUF_MDATA(&q->ixp_q_mbuf))[auth_off], auth_len);
++
++ /* Set location in client buffer to copy hash into */
++ q->ixp_hash_dest =
++ &(IX_MBUF_MDATA(&q->ixp_q_mbuf))[auth_off + auth_len];
++
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = tbuf;
++
++ /* Set location in internal buffer for where hash starts */
++ q->ixp_hash_src = &(IX_MBUF_MDATA(&q->ixp_q_mbuf))[auth_len];
++
++ crypt_func = "ixCryptoAccHashPerform";
++ status = ixCryptoAccHashPerform(ixp->ixp_ctx.authCtx.authAlgo,
++ &q->ixp_q_mbuf, ixp_hash_perform_cb, 0, auth_len, auth_len,
++ &ixp->ixp_hash_key_id);
++ }
++ else {
++ crypt_func = "ixCryptoAccAuthCryptPerform";
++ status = ixCryptoAccAuthCryptPerform(ixp->ixp_ctx_id, &q->ixp_q_mbuf,
++ NULL, auth_off, auth_len, crypt_off, crypt_len, icv_off,
++ q->ixp_q_iv);
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ return;
++
++ if (IX_CRYPTO_ACC_STATUS_QUEUE_FULL == status) {
++ q->ixp_q_crp->crp_etype = ENOMEM;
++ goto done;
++ }
++
++ printk("ixp: %s failed %u\n", crypt_func, status);
++ q->ixp_q_crp->crp_etype = EINVAL;
++
++done:
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++}
++
++
++/*
++ * because we cannot process the Q from the Register callback
++ * we do it here on a task Q.
++ */
++
++static void
++ixp_process_pending(void *arg)
++{
++ struct ixp_data *ixp = arg;
++ struct ixp_q *q = NULL;
++
++ dprintk("%s(%p)\n", __FUNCTION__, arg);
++
++ if (!ixp)
++ return;
++
++ while (!list_empty(&ixp->ixp_q)) {
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ list_del(&q->ixp_q_list);
++ ixp_q_process(q);
++ }
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ixp_process_pending_wq(struct work_struct *work)
++{
++ struct ixp_data *ixp = container_of(work, struct ixp_data,
++ ixp_pending_work);
++ ixp_process_pending(ixp);
++}
++#endif
++
++/*
++ * callback for when context registration is complete
++ */
++
++static void
++ixp_register_cb(UINT32 ctx_id, IX_MBUF *bufp, IxCryptoAccStatus status)
++{
++ int i;
++ struct ixp_data *ixp;
++ struct ixp_q *q;
++
++ dprintk("%s(%d, %p, %d)\n", __FUNCTION__, ctx_id, bufp, status);
++
++ /*
++ * free any buffer passed in to this routine
++ */
++ if (bufp) {
++ IX_MBUF_MLEN(bufp) = IX_MBUF_PKT_LEN(bufp) = 0;
++ kfree(IX_MBUF_MDATA(bufp));
++ IX_MBUF_MDATA(bufp) = NULL;
++ }
++
++ for (i = 0; i < ixp_sesnum; i++) {
++ ixp = ixp_sessions[i];
++ if (ixp && ixp->ixp_ctx_id == ctx_id)
++ break;
++ }
++ if (i >= ixp_sesnum) {
++ printk("ixp: invalid context id %d\n", ctx_id);
++ return;
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_WAIT == status) {
++ /* this is normal to free the first of two buffers */
++ dprintk("ixp: register not finished yet.\n");
++ return;
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS != status) {
++ printk("ixp: register failed 0x%x\n", status);
++ while (!list_empty(&ixp->ixp_q)) {
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ list_del(&q->ixp_q_list);
++ q->ixp_q_crp->crp_etype = EINVAL;
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++ }
++ return;
++ }
++
++ /*
++ * we are now registered, we cannot start processing the Q here
++ * or we get strange errors with AES (DES/3DES seem to be ok).
++ */
++ ixp->ixp_registered = 1;
++ schedule_work(&ixp->ixp_pending_work);
++}
++
++
++/*
++ * callback for when data processing is complete
++ */
++
++static void
++ixp_perform_cb(
++ UINT32 ctx_id,
++ IX_MBUF *sbufp,
++ IX_MBUF *dbufp,
++ IxCryptoAccStatus status)
++{
++ struct ixp_q *q;
++
++ dprintk("%s(%d, %p, %p, 0x%x)\n", __FUNCTION__, ctx_id, sbufp,
++ dbufp, status);
++
++ if (sbufp == NULL) {
++ printk("ixp: NULL sbuf in ixp_perform_cb\n");
++ return;
++ }
++
++ q = IX_MBUF_PRIV(sbufp);
++ if (q == NULL) {
++ printk("ixp: NULL priv in ixp_perform_cb\n");
++ return;
++ }
++
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ printk("ixp: perform failed status=%d\n", status);
++ q->ixp_q_crp->crp_etype = EINVAL;
++ }
++
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++}
++
++
++/*
++ * registration is not callable at IRQ time, so we defer
++ * to a task queue, this routines completes the registration for us
++ * when the task queue runs
++ *
++ * Unfortunately this means we cannot tell OCF that the driver is blocked,
++ * we do that on the next request.
++ */
++
++static void
++ixp_registration(void *arg)
++{
++ struct ixp_data *ixp = arg;
++ struct ixp_q *q = NULL;
++ IX_MBUF *pri = NULL, *sec = NULL;
++ int status = IX_CRYPTO_ACC_STATUS_SUCCESS;
++
++ if (!ixp) {
++ printk("ixp: ixp_registration with no arg\n");
++ return;
++ }
++
++ if (ixp->ixp_ctx_id != -1) {
++ ixCryptoAccCtxUnregister(ixp->ixp_ctx_id);
++ ixp->ixp_ctx_id = -1;
++ }
++
++ if (list_empty(&ixp->ixp_q)) {
++ printk("ixp: ixp_registration with no Q\n");
++ return;
++ }
++
++ /*
++ * setup the primary and secondary buffers
++ */
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ if (q->ixp_q_acrd) {
++ pri = &ixp->ixp_pri_mbuf;
++ sec = &ixp->ixp_sec_mbuf;
++ IX_MBUF_MLEN(pri) = IX_MBUF_PKT_LEN(pri) = 128;
++ IX_MBUF_MDATA(pri) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++ IX_MBUF_MLEN(sec) = IX_MBUF_PKT_LEN(sec) = 128;
++ IX_MBUF_MDATA(sec) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++ }
++
++ /* Only need to register if a crypt op or HMAC op */
++ if (!(ixp->ixp_auth_alg == CRYPTO_SHA1 ||
++ ixp->ixp_auth_alg == CRYPTO_MD5)) {
++ status = ixCryptoAccCtxRegister(
++ &ixp->ixp_ctx,
++ pri, sec,
++ ixp_register_cb,
++ ixp_perform_cb,
++ &ixp->ixp_ctx_id);
++ }
++ else {
++ /* Otherwise we start processing pending q */
++ schedule_work(&ixp->ixp_pending_work);
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ return;
++
++ if (IX_CRYPTO_ACC_STATUS_EXCEED_MAX_TUNNELS == status) {
++ printk("ixp: ixCryptoAccCtxRegister failed (out of tunnels)\n");
++ ixp_blocked = 1;
++ /* perhaps we should return EGAIN on queued ops ? */
++ return;
++ }
++
++ printk("ixp: ixCryptoAccCtxRegister failed %d\n", status);
++ ixp->ixp_ctx_id = -1;
++
++ /*
++ * everything waiting is toasted
++ */
++ while (!list_empty(&ixp->ixp_q)) {
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ list_del(&q->ixp_q_list);
++ q->ixp_q_crp->crp_etype = ENOENT;
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++ }
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ixp_registration_wq(struct work_struct *work)
++{
++ struct ixp_data *ixp = container_of(work, struct ixp_data,
++ ixp_registration_work);
++ ixp_registration(ixp);
++}
++#endif
++
++/*
++ * Process a request.
++ */
++static int
++ixp_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct ixp_data *ixp;
++ unsigned int lid;
++ struct ixp_q *q = NULL;
++ int status;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ /* Sanity check */
++ if (crp == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ crp->crp_etype = 0;
++
++ if (ixp_blocked)
++ return ERESTART;
++
++ if (crp->crp_desc == NULL || crp->crp_buf == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ /*
++ * find the session we are using
++ */
++
++ lid = crp->crp_sid & 0xffffffff;
++ if (lid >= ixp_sesnum || lid == 0 || ixp_sessions == NULL ||
++ ixp_sessions[lid] == NULL) {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++ ixp = ixp_sessions[lid];
++
++ /*
++ * setup a new request ready for queuing
++ */
++ q = kmem_cache_alloc(qcache, SLAB_ATOMIC);
++ if (q == NULL) {
++ dprintk("%s,%d: ENOMEM\n", __FILE__, __LINE__);
++ crp->crp_etype = ENOMEM;
++ goto done;
++ }
++ /*
++ * save some cycles by only zeroing the important bits
++ */
++ memset(&q->ixp_q_mbuf, 0, sizeof(q->ixp_q_mbuf));
++ q->ixp_q_ccrd = NULL;
++ q->ixp_q_acrd = NULL;
++ q->ixp_q_crp = crp;
++ q->ixp_q_data = ixp;
++
++ /*
++ * point the cipher and auth descriptors appropriately
++ * check that we have something to do
++ */
++ if (crp->crp_desc->crd_alg == ixp->ixp_cipher_alg)
++ q->ixp_q_ccrd = crp->crp_desc;
++ else if (crp->crp_desc->crd_alg == ixp->ixp_auth_alg)
++ q->ixp_q_acrd = crp->crp_desc;
++ else {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: bad desc match: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++ if (crp->crp_desc->crd_next) {
++ if (crp->crp_desc->crd_next->crd_alg == ixp->ixp_cipher_alg)
++ q->ixp_q_ccrd = crp->crp_desc->crd_next;
++ else if (crp->crp_desc->crd_next->crd_alg == ixp->ixp_auth_alg)
++ q->ixp_q_acrd = crp->crp_desc->crd_next;
++ else {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: bad desc match: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++ }
++
++ /*
++ * If there is a direction change for this context then we mark it as
++ * unregistered and re-register is for the new direction. This is not
++ * a very expensive operation and currently only tends to happen when
++ * user-space application are doing benchmarks
++ *
++ * DM - we should be checking for pending requests before unregistering.
++ */
++ if (q->ixp_q_ccrd && ixp->ixp_registered &&
++ ixp->ixp_crd_flags != (q->ixp_q_ccrd->crd_flags & CRD_F_ENCRYPT)) {
++ dprintk("%s - detected direction change on session\n", __FUNCTION__);
++ ixp->ixp_registered = 0;
++ }
++
++ /*
++ * if we are registered, call straight into the perform code
++ */
++ if (ixp->ixp_registered) {
++ ixp_q_process(q);
++ return 0;
++ }
++
++ /*
++ * the only part of the context not set in newsession is the direction
++ * dependent parts
++ */
++ if (q->ixp_q_ccrd) {
++ ixp->ixp_crd_flags = (q->ixp_q_ccrd->crd_flags & CRD_F_ENCRYPT);
++ if (q->ixp_q_ccrd->crd_flags & CRD_F_ENCRYPT) {
++ ixp->ixp_ctx.operation = q->ixp_q_acrd ?
++ IX_CRYPTO_ACC_OP_ENCRYPT_AUTH : IX_CRYPTO_ACC_OP_ENCRYPT;
++ } else {
++ ixp->ixp_ctx.operation = q->ixp_q_acrd ?
++ IX_CRYPTO_ACC_OP_AUTH_DECRYPT : IX_CRYPTO_ACC_OP_DECRYPT;
++ }
++ } else {
++ /* q->ixp_q_acrd must be set if we are here */
++ ixp->ixp_ctx.operation = IX_CRYPTO_ACC_OP_AUTH_CALC;
++ }
++
++ status = list_empty(&ixp->ixp_q);
++ list_add_tail(&q->ixp_q_list, &ixp->ixp_q);
++ if (status)
++ schedule_work(&ixp->ixp_registration_work);
++ return 0;
++
++done:
++ if (q)
++ kmem_cache_free(qcache, q);
++ crypto_done(crp);
++ return 0;
++}
++
++
++#ifdef __ixp46X
++/*
++ * key processing support for the ixp465
++ */
++
++
++/*
++ * copy a BN (LE) into a buffer (BE) an fill out the op appropriately
++ * assume zeroed and only copy bits that are significant
++ */
++
++static int
++ixp_copy_ibuf(struct crparam *p, IxCryptoAccPkeEauOperand *op, UINT32 *buf)
++{
++ unsigned char *src = (unsigned char *) p->crp_p;
++ unsigned char *dst;
++ int len, bits = p->crp_nbits;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ if (bits > MAX_IOP_SIZE * sizeof(UINT32) * 8) {
++ dprintk("%s - ibuf too big (%d > %d)\n", __FUNCTION__,
++ bits, MAX_IOP_SIZE * sizeof(UINT32) * 8);
++ return -1;
++ }
++
++ len = (bits + 31) / 32; /* the number UINT32's needed */
++
++ dst = (unsigned char *) &buf[len];
++ dst--;
++
++ while (bits > 0) {
++ *dst-- = *src++;
++ bits -= 8;
++ }
++
++#if 0 /* no need to zero remaining bits as it is done during request alloc */
++ while (dst > (unsigned char *) buf)
++ *dst-- = '\0';
++#endif
++
++ op->pData = buf;
++ op->dataLen = len;
++ return 0;
++}
++
++/*
++ * copy out the result, be as forgiving as we can about small output buffers
++ */
++
++static int
++ixp_copy_obuf(struct crparam *p, IxCryptoAccPkeEauOpResult *op, UINT32 *buf)
++{
++ unsigned char *dst = (unsigned char *) p->crp_p;
++ unsigned char *src = (unsigned char *) buf;
++ int len, z, bits = p->crp_nbits;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ len = op->dataLen * sizeof(UINT32);
++
++ /* skip leading zeroes to be small buffer friendly */
++ z = 0;
++ while (z < len && src[z] == '\0')
++ z++;
++
++ src += len;
++ src--;
++ len -= z;
++
++ while (len > 0 && bits > 0) {
++ *dst++ = *src--;
++ len--;
++ bits -= 8;
++ }
++
++ while (bits > 0) {
++ *dst++ = '\0';
++ bits -= 8;
++ }
++
++ if (len > 0) {
++ dprintk("%s - obuf is %d (z=%d, ob=%d) bytes too small\n",
++ __FUNCTION__, len, z, p->crp_nbits / 8);
++ return -1;
++ }
++
++ return 0;
++}
++
++
++/*
++ * the parameter offsets for exp_mod
++ */
++
++#define IXP_PARAM_BASE 0
++#define IXP_PARAM_EXP 1
++#define IXP_PARAM_MOD 2
++#define IXP_PARAM_RES 3
++
++/*
++ * key processing complete callback, is also used to start processing
++ * by passing a NULL for pResult
++ */
++
++static void
++ixp_kperform_cb(
++ IxCryptoAccPkeEauOperation operation,
++ IxCryptoAccPkeEauOpResult *pResult,
++ BOOL carryOrBorrow,
++ IxCryptoAccStatus status)
++{
++ struct ixp_pkq *q, *tmp;
++ unsigned long flags;
++
++ dprintk("%s(0x%x, %p, %d, 0x%x)\n", __FUNCTION__, operation, pResult,
++ carryOrBorrow, status);
++
++ /* handle a completed request */
++ if (pResult) {
++ if (ixp_pk_cur && &ixp_pk_cur->pkq_result == pResult) {
++ q = ixp_pk_cur;
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("%s() - op failed 0x%x\n", __FUNCTION__, status);
++ q->pkq_krp->krp_status = ERANGE; /* could do better */
++ } else {
++ /* copy out the result */
++ if (ixp_copy_obuf(&q->pkq_krp->krp_param[IXP_PARAM_RES],
++ &q->pkq_result, q->pkq_obuf))
++ q->pkq_krp->krp_status = ERANGE;
++ }
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ ixp_pk_cur = NULL;
++ } else
++ printk("%s - callback with invalid result pointer\n", __FUNCTION__);
++ }
++
++ spin_lock_irqsave(&ixp_pkq_lock, flags);
++ if (ixp_pk_cur || list_empty(&ixp_pkq)) {
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++ return;
++ }
++
++ list_for_each_entry_safe(q, tmp, &ixp_pkq, pkq_list) {
++
++ list_del(&q->pkq_list);
++ ixp_pk_cur = q;
++
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++
++ status = ixCryptoAccPkeEauPerform(
++ IX_CRYPTO_ACC_OP_EAU_MOD_EXP,
++ &q->pkq_op,
++ ixp_kperform_cb,
++ &q->pkq_result);
++
++ if (status == IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("%s() - ixCryptoAccPkeEauPerform SUCCESS\n", __FUNCTION__);
++ return; /* callback will return here for callback */
++ } else if (status == IX_CRYPTO_ACC_STATUS_RETRY) {
++ printk("%s() - ixCryptoAccPkeEauPerform RETRY\n", __FUNCTION__);
++ } else {
++ printk("%s() - ixCryptoAccPkeEauPerform failed %d\n",
++ __FUNCTION__, status);
++ }
++ q->pkq_krp->krp_status = ERANGE; /* could do better */
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ spin_lock_irqsave(&ixp_pkq_lock, flags);
++ }
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++}
++
++
++static int
++ixp_kprocess(device_t dev, struct cryptkop *krp, int hint)
++{
++ struct ixp_pkq *q;
++ int rc = 0;
++ unsigned long flags;
++
++ dprintk("%s l1=%d l2=%d l3=%d l4=%d\n", __FUNCTION__,
++ krp->krp_param[IXP_PARAM_BASE].crp_nbits,
++ krp->krp_param[IXP_PARAM_EXP].crp_nbits,
++ krp->krp_param[IXP_PARAM_MOD].crp_nbits,
++ krp->krp_param[IXP_PARAM_RES].crp_nbits);
++
++
++ if (krp->krp_op != CRK_MOD_EXP) {
++ krp->krp_status = EOPNOTSUPP;
++ goto err;
++ }
++
++ q = (struct ixp_pkq *) kmalloc(sizeof(*q), GFP_KERNEL);
++ if (q == NULL) {
++ krp->krp_status = ENOMEM;
++ goto err;
++ }
++
++ /*
++ * The PKE engine does not appear to zero the output buffer
++ * appropriately, so we need to do it all here.
++ */
++ memset(q, 0, sizeof(*q));
++
++ q->pkq_krp = krp;
++ INIT_LIST_HEAD(&q->pkq_list);
++
++ if (ixp_copy_ibuf(&krp->krp_param[IXP_PARAM_BASE], &q->pkq_op.modExpOpr.M,
++ q->pkq_ibuf0))
++ rc = 1;
++ if (!rc && ixp_copy_ibuf(&krp->krp_param[IXP_PARAM_EXP],
++ &q->pkq_op.modExpOpr.e, q->pkq_ibuf1))
++ rc = 2;
++ if (!rc && ixp_copy_ibuf(&krp->krp_param[IXP_PARAM_MOD],
++ &q->pkq_op.modExpOpr.N, q->pkq_ibuf2))
++ rc = 3;
++
++ if (rc) {
++ kfree(q);
++ krp->krp_status = ERANGE;
++ goto err;
++ }
++
++ q->pkq_result.pData = q->pkq_obuf;
++ q->pkq_result.dataLen =
++ (krp->krp_param[IXP_PARAM_RES].crp_nbits + 31) / 32;
++
++ spin_lock_irqsave(&ixp_pkq_lock, flags);
++ list_add_tail(&q->pkq_list, &ixp_pkq);
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++
++ if (!ixp_pk_cur)
++ ixp_kperform_cb(0, NULL, 0, 0);
++ return (0);
++
++err:
++ crypto_kdone(krp);
++ return (0);
++}
++
++
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++/*
++ * We run the random number generator output through SHA so that it
++ * is FIPS compliant.
++ */
++
++static volatile int sha_done = 0;
++static unsigned char sha_digest[20];
++
++static void
++ixp_hash_cb(UINT8 *digest, IxCryptoAccStatus status)
++{
++ dprintk("%s(%p, %d)\n", __FUNCTION__, digest, status);
++ if (sha_digest != digest)
++ printk("digest error\n");
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ sha_done = 1;
++ else
++ sha_done = -status;
++}
++
++static int
++ixp_read_random(void *arg, u_int32_t *buf, int maxwords)
++{
++ IxCryptoAccStatus status;
++ int i, n, rc;
++
++ dprintk("%s(%p, %d)\n", __FUNCTION__, buf, maxwords);
++ memset(buf, 0, maxwords * sizeof(*buf));
++ status = ixCryptoAccPkePseudoRandomNumberGet(maxwords, buf);
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("%s: ixCryptoAccPkePseudoRandomNumberGet failed %d\n",
++ __FUNCTION__, status);
++ return 0;
++ }
++
++ /*
++ * run the random data through SHA to make it look more random
++ */
++
++ n = sizeof(sha_digest); /* process digest bytes at a time */
++
++ rc = 0;
++ for (i = 0; i < maxwords; i += n / sizeof(*buf)) {
++ if ((maxwords - i) * sizeof(*buf) < n)
++ n = (maxwords - i) * sizeof(*buf);
++ sha_done = 0;
++ status = ixCryptoAccPkeHashPerform(IX_CRYPTO_ACC_AUTH_SHA1,
++ (UINT8 *) &buf[i], n, ixp_hash_cb, sha_digest);
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("ixCryptoAccPkeHashPerform failed %d\n", status);
++ return -EIO;
++ }
++ while (!sha_done)
++ schedule();
++ if (sha_done < 0) {
++ dprintk("ixCryptoAccPkeHashPerform failed CB %d\n", -sha_done);
++ return 0;
++ }
++ memcpy(&buf[i], sha_digest, n);
++ rc += n / sizeof(*buf);;
++ }
++
++ return rc;
++}
++#endif /* CONFIG_OCF_RANDOMHARVEST */
++
++#endif /* __ixp46X */
++
++
++
++/*
++ * our driver startup and shutdown routines
++ */
++
++static int
++ixp_init(void)
++{
++ dprintk("%s(%p)\n", __FUNCTION__, ixp_init);
++
++ if (ixp_init_crypto && ixCryptoAccInit() != IX_CRYPTO_ACC_STATUS_SUCCESS)
++ printk("ixCryptoAccInit failed, assuming already initialised!\n");
++
++ qcache = kmem_cache_create("ixp4xx_q", sizeof(struct ixp_q), 0,
++ SLAB_HWCACHE_ALIGN, NULL
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
++ , NULL
++#endif
++ );
++ if (!qcache) {
++ printk("failed to create Qcache\n");
++ return -ENOENT;
++ }
++
++ memset(&ixpdev, 0, sizeof(ixpdev));
++ softc_device_init(&ixpdev, "ixp4xx", 0, ixp_methods);
++
++ ixp_id = crypto_get_driverid(softc_get_device(&ixpdev),
++ CRYPTOCAP_F_HARDWARE);
++ if (ixp_id < 0)
++ panic("IXP/OCF crypto device cannot initialize!");
++
++#define REGISTER(alg) \
++ crypto_register(ixp_id,alg,0,0)
++
++ REGISTER(CRYPTO_DES_CBC);
++ REGISTER(CRYPTO_3DES_CBC);
++ REGISTER(CRYPTO_RIJNDAEL128_CBC);
++#ifdef CONFIG_OCF_IXP4XX_SHA1_MD5
++ REGISTER(CRYPTO_MD5);
++ REGISTER(CRYPTO_SHA1);
++#endif
++ REGISTER(CRYPTO_MD5_HMAC);
++ REGISTER(CRYPTO_SHA1_HMAC);
++#undef REGISTER
++
++#ifdef __ixp46X
++ spin_lock_init(&ixp_pkq_lock);
++ /*
++ * we do not enable the go fast options here as they can potentially
++ * allow timing based attacks
++ *
++ * http://www.openssl.org/news/secadv_20030219.txt
++ */
++ ixCryptoAccPkeEauExpConfig(0, 0);
++ crypto_kregister(ixp_id, CRK_MOD_EXP, 0);
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ crypto_rregister(ixp_id, ixp_read_random, NULL);
++#endif
++#endif
++
++ return 0;
++}
++
++static void
++ixp_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ crypto_unregister_all(ixp_id);
++ ixp_id = -1;
++ kmem_cache_destroy(qcache);
++ qcache = NULL;
++}
++
++module_init(ixp_init);
++module_exit(ixp_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("David McCullough <dmccullough@cyberguard.com>");
++MODULE_DESCRIPTION("ixp (OCF module for IXP4xx crypto)");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ixp4xx/Makefile linux-2.6.27.10/crypto/ocf/ixp4xx/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/ixp4xx/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ixp4xx/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,104 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++#
++# You will need to point this at your Intel ixp425 includes, this portion
++# of the Makefile only really works under SGLinux with the appropriate libs
++# installed. They can be downloaded from http://www.snapgear.org/
++#
++ifeq ($(CONFIG_CPU_IXP46X),y)
++IXPLATFORM = ixp46X
++else
++ifeq ($(CONFIG_CPU_IXP43X),y)
++IXPLATFORM = ixp43X
++else
++IXPLATFORM = ixp42X
++endif
++endif
++
++ifdef CONFIG_IXP400_LIB_2_4
++IX_XSCALE_SW = $(ROOTDIR)/modules/ixp425/ixp400-2.4/ixp400_xscale_sw
++OSAL_DIR = $(ROOTDIR)/modules/ixp425/ixp400-2.4/ixp_osal
++endif
++ifdef CONFIG_IXP400_LIB_2_1
++IX_XSCALE_SW = $(ROOTDIR)/modules/ixp425/ixp400-2.1/ixp400_xscale_sw
++OSAL_DIR = $(ROOTDIR)/modules/ixp425/ixp400-2.1/ixp_osal
++endif
++ifdef CONFIG_IXP400_LIB_2_0
++IX_XSCALE_SW = $(ROOTDIR)/modules/ixp425/ixp400-2.0/ixp400_xscale_sw
++OSAL_DIR = $(ROOTDIR)/modules/ixp425/ixp400-2.0/ixp_osal
++endif
++ifdef IX_XSCALE_SW
++ifdef CONFIG_IXP400_LIB_2_4
++IXP_CFLAGS = \
++ -I$(ROOTDIR)/. \
++ -I$(IX_XSCALE_SW)/src/include \
++ -I$(OSAL_DIR)/common/include/ \
++ -I$(OSAL_DIR)/common/include/modules/ \
++ -I$(OSAL_DIR)/common/include/modules/ddk/ \
++ -I$(OSAL_DIR)/common/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/common/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/common/os/linux/include/ \
++ -I$(OSAL_DIR)/common/os/linux/include/core/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/ddk/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/platforms/$(IXPLATFORM)/include/ \
++ -I$(OSAL_DIR)/platforms/$(IXPLATFORM)/os/linux/include/ \
++ -DENABLE_IOMEM -DENABLE_BUFFERMGT -DENABLE_DDK \
++ -DUSE_IXP4XX_CRYPTO
++else
++IXP_CFLAGS = \
++ -I$(ROOTDIR)/. \
++ -I$(IX_XSCALE_SW)/src/include \
++ -I$(OSAL_DIR)/ \
++ -I$(OSAL_DIR)/os/linux/include/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/os/linux/include/core/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ixp425 \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ixp465 \
++ -I$(OSAL_DIR)/os/linux/include/core/ \
++ -I$(OSAL_DIR)/include/ \
++ -I$(OSAL_DIR)/include/modules/ \
++ -I$(OSAL_DIR)/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/include/platforms/ \
++ -I$(OSAL_DIR)/include/platforms/ixp400/ \
++ -DUSE_IXP4XX_CRYPTO
++endif
++endif
++ifdef CONFIG_IXP400_LIB_1_4
++IXP_CFLAGS = \
++ -I$(ROOTDIR)/. \
++ -I$(ROOTDIR)/modules/ixp425/ixp400-1.4/ixp400_xscale_sw/src/include \
++ -I$(ROOTDIR)/modules/ixp425/ixp400-1.4/ixp400_xscale_sw/src/linux \
++ -DUSE_IXP4XX_CRYPTO
++endif
++ifndef IXPDIR
++IXPDIR = ixp-version-is-not-supported
++endif
++
++ifeq ($(CONFIG_CPU_IXP46X),y)
++IXP_CFLAGS += -D__ixp46X
++else
++ifeq ($(CONFIG_CPU_IXP43X),y)
++IXP_CFLAGS += -D__ixp43X
++else
++IXP_CFLAGS += -D__ixp42X
++endif
++endif
++
++obj-$(CONFIG_OCF_IXP4XX) += ixp4xx.o
++
++obj ?= .
++EXTRA_CFLAGS += $(IXP_CFLAGS) -I$(obj)/.. -I$(obj)/.
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/Kconfig linux-2.6.27.10/crypto/ocf/Kconfig
+--- linux-2.6.27.10.orig/crypto/ocf/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/Kconfig 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,101 @@
++menu "OCF Configuration"
++
++config OCF_OCF
++ tristate "OCF (Open Cryptograhic Framework)"
++ help
++ A linux port of the OpenBSD/FreeBSD crypto framework.
++
++config OCF_RANDOMHARVEST
++ bool "crypto random --- harvest entropy for /dev/random"
++ depends on OCF_OCF
++ help
++ Includes code to harvest random numbers from devices that support it.
++
++config OCF_FIPS
++ bool "enable fips RNG checks"
++ depends on OCF_OCF && OCF_RANDOMHARVEST
++ help
++ Run all RNG provided data through a fips check before
++ adding it /dev/random's entropy pool.
++
++config OCF_CRYPTODEV
++ tristate "cryptodev (user space support)"
++ depends on OCF_OCF
++ help
++ The user space API to access crypto hardware.
++
++config OCF_CRYPTOSOFT
++ tristate "cryptosoft (software crypto engine)"
++ depends on OCF_OCF
++ help
++ A software driver for the OCF framework that uses
++ the kernel CryptoAPI.
++
++config OCF_SAFE
++ tristate "safenet (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ A driver for a number of the safenet Excel crypto accelerators.
++ Currently tested and working on the 1141 and 1741.
++
++config OCF_IXP4XX
++ tristate "IXP4xx (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ XScale IXP4xx crypto accelerator driver. Requires the
++ Intel Access library.
++
++config OCF_IXP4XX_SHA1_MD5
++ bool "IXP4xx SHA1 and MD5 Hashing"
++ depends on OCF_IXP4XX
++ help
++ Allows the IXP4xx crypto accelerator to perform SHA1 and MD5 hashing.
++ Note: this is MUCH slower than using cryptosoft (software crypto engine).
++
++config OCF_HIFN
++ tristate "hifn (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for various HIFN based crypto accelerators.
++ (7951, 7955, 7956, 7751, 7811)
++
++config OCF_HIFNHIPP
++ tristate "Hifn HIPP (HW packet crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for various HIFN (HIPP) based crypto accelerators
++ (7855)
++
++config OCF_TALITOS
++ tristate "talitos (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for Freescale's security engine (SEC/talitos).
++
++config OCF_PASEMI
++ tristate "pasemi (HW crypto engine)"
++ depends on OCF_OCF && PPC_PASEMI
++ help
++ OCF driver for the PA Semi PWRficient DMA Engine
++
++config OCF_EP80579
++ tristate "ep80579 (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for the Intel EP80579 Integrated Processor Product Line.
++
++config OCF_OCFNULL
++ tristate "ocfnull (fake crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for measuring ipsec overheads (does no crypto)
++
++config OCF_BENCH
++ tristate "ocf-bench (HW crypto in-kernel benchmark)"
++ depends on OCF_OCF
++ help
++ A very simple encryption test for the in-kernel interface
++ of OCF. Also includes code to benchmark the IXP Access library
++ for comparison.
++
++endmenu
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/Makefile linux-2.6.27.10/crypto/ocf/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,121 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++OCF_OBJS = crypto.o criov.o
++
++ifdef CONFIG_OCF_RANDOMHARVEST
++ OCF_OBJS += random.o
++endif
++
++ifdef CONFIG_OCF_FIPS
++ OCF_OBJS += rndtest.o
++endif
++
++# Add in autoconf.h to get #defines for CONFIG_xxx
++AUTOCONF_H=$(ROOTDIR)/modules/autoconf.h
++ifeq ($(AUTOCONF_H), $(wildcard $(AUTOCONF_H)))
++ EXTRA_CFLAGS += -include $(AUTOCONF_H)
++ export EXTRA_CFLAGS
++endif
++
++ifndef obj
++ obj ?= .
++ _obj = subdir
++ mod-subdirs := safe hifn ixp4xx talitos ocfnull
++ export-objs += crypto.o criov.o random.o
++ list-multi += ocf.o
++ _slash :=
++else
++ _obj = obj
++ _slash := /
++endif
++
++EXTRA_CFLAGS += -I$(obj)/.
++
++obj-$(CONFIG_OCF_OCF) += ocf.o
++obj-$(CONFIG_OCF_CRYPTODEV) += cryptodev.o
++obj-$(CONFIG_OCF_CRYPTOSOFT) += cryptosoft.o
++obj-$(CONFIG_OCF_BENCH) += ocf-bench.o
++
++$(_obj)-$(CONFIG_OCF_SAFE) += safe$(_slash)
++$(_obj)-$(CONFIG_OCF_HIFN) += hifn$(_slash)
++$(_obj)-$(CONFIG_OCF_IXP4XX) += ixp4xx$(_slash)
++$(_obj)-$(CONFIG_OCF_TALITOS) += talitos$(_slash)
++$(_obj)-$(CONFIG_OCF_PASEMI) += pasemi$(_slash)
++$(_obj)-$(CONFIG_OCF_EP80579) += ep80579$(_slash)
++$(_obj)-$(CONFIG_OCF_OCFNULL) += ocfnull$(_slash)
++
++ocf-objs := $(OCF_OBJS)
++
++$(list-multi) dummy1: $(ocf-objs)
++ $(LD) -r -o $@ $(ocf-objs)
++
++.PHONY:
++clean:
++ rm -f *.o *.ko .*.o.flags .*.ko.cmd .*.o.cmd .*.mod.o.cmd *.mod.c
++ rm -f */*.o */*.ko */.*.o.cmd */.*.ko.cmd */.*.mod.o.cmd */*.mod.c */.*.o.flags
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
++#
++# release gen targets
++#
++
++.PHONY: patch
++patch:
++ REL=`date +%Y%m%d`; \
++ patch=ocf-linux-$$REL.patch; \
++ patch24=ocf-linux-24-$$REL.patch; \
++ patch26=ocf-linux-26-$$REL.patch; \
++ ( \
++ find . -name Makefile; \
++ find . -name Config.in; \
++ find . -name Kconfig; \
++ find . -name README; \
++ find . -name '*.[ch]' | grep -v '.mod.c'; \
++ ) | while read t; do \
++ diff -Nau /dev/null $$t | sed 's?^+++ \./?+++ linux/crypto/ocf/?'; \
++ done > $$patch; \
++ cat patches/linux-2.4.35-ocf.patch $$patch > $$patch24; \
++ cat patches/linux-2.6.26-ocf.patch $$patch > $$patch26
++
++.PHONY: tarball
++tarball:
++ REL=`date +%Y%m%d`; RELDIR=/tmp/ocf-linux-$$REL; \
++ CURDIR=`pwd`; \
++ rm -rf /tmp/ocf-linux-$$REL*; \
++ mkdir -p $$RELDIR/tools; \
++ cp README* $$RELDIR; \
++ cp patches/openss*.patch $$RELDIR; \
++ cp patches/crypto-tools.patch $$RELDIR; \
++ cp tools/[!C]* $$RELDIR/tools; \
++ cd ..; \
++ tar cvf $$RELDIR/ocf-linux.tar \
++ --exclude=CVS \
++ --exclude=.* \
++ --exclude=*.o \
++ --exclude=*.ko \
++ --exclude=*.mod.* \
++ --exclude=README* \
++ --exclude=ocf-*.patch \
++ --exclude=ocf/patches/openss*.patch \
++ --exclude=ocf/patches/crypto-tools.patch \
++ --exclude=ocf/tools \
++ ocf; \
++ gzip -9 $$RELDIR/ocf-linux.tar; \
++ cd /tmp; \
++ tar cvf ocf-linux-$$REL.tar ocf-linux-$$REL; \
++ gzip -9 ocf-linux-$$REL.tar; \
++ cd $$CURDIR/../../user; \
++ rm -rf /tmp/crypto-tools-$$REL*; \
++ tar cvf /tmp/crypto-tools-$$REL.tar \
++ --exclude=CVS \
++ --exclude=.* \
++ --exclude=*.o \
++ --exclude=cryptotest \
++ --exclude=cryptokeytest \
++ crypto-tools; \
++ gzip -9 /tmp/crypto-tools-$$REL.tar
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ocf-bench.c linux-2.6.27.10/crypto/ocf/ocf-bench.c
+--- linux-2.6.27.10.orig/crypto/ocf/ocf-bench.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ocf-bench.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,436 @@
++/*
++ * A loadable module that benchmarks the OCF crypto speed from kernel space.
++ *
++ * Copyright (C) 2004-2007 David McCullough <david_mccullough@securecomputing.com>
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/spinlock.h>
++#include <linux/version.h>
++#include <linux/interrupt.h>
++#include <cryptodev.h>
++
++#ifdef I_HAVE_AN_XSCALE_WITH_INTEL_SDK
++#define BENCH_IXP_ACCESS_LIB 1
++#endif
++#ifdef BENCH_IXP_ACCESS_LIB
++#include <IxTypes.h>
++#include <IxOsBuffMgt.h>
++#include <IxNpeDl.h>
++#include <IxCryptoAcc.h>
++#include <IxQMgr.h>
++#include <IxOsServices.h>
++#include <IxOsCacheMMU.h>
++#endif
++
++/*
++ * support for access lib version 1.4
++ */
++#ifndef IX_MBUF_PRIV
++#define IX_MBUF_PRIV(x) ((x)->priv)
++#endif
++
++/*
++ * the number of simultaneously active requests
++ */
++static int request_q_len = 20;
++module_param(request_q_len, int, 0);
++MODULE_PARM_DESC(request_q_len, "Number of outstanding requests");
++/*
++ * how many requests we want to have processed
++ */
++static int request_num = 1024;
++module_param(request_num, int, 0);
++MODULE_PARM_DESC(request_num, "run for at least this many requests");
++/*
++ * the size of each request
++ */
++static int request_size = 1500;
++module_param(request_size, int, 0);
++MODULE_PARM_DESC(request_size, "size of each request");
++
++/*
++ * a structure for each request
++ */
++typedef struct {
++ struct work_struct work;
++#ifdef BENCH_IXP_ACCESS_LIB
++ IX_MBUF mbuf;
++#endif
++ unsigned char *buffer;
++} request_t;
++
++static request_t *requests;
++
++static int outstanding;
++static int total;
++
++/*************************************************************************/
++/*
++ * OCF benchmark routines
++ */
++
++static uint64_t ocf_cryptoid;
++static int ocf_init(void);
++static int ocf_cb(struct cryptop *crp);
++static void ocf_request(void *arg);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void ocf_request_wq(struct work_struct *work);
++#endif
++
++static int
++ocf_init(void)
++{
++ int error;
++ struct cryptoini crie, cria;
++ struct cryptodesc crda, crde;
++
++ memset(&crie, 0, sizeof(crie));
++ memset(&cria, 0, sizeof(cria));
++ memset(&crde, 0, sizeof(crde));
++ memset(&crda, 0, sizeof(crda));
++
++ cria.cri_alg = CRYPTO_SHA1_HMAC;
++ cria.cri_klen = 20 * 8;
++ cria.cri_key = "0123456789abcdefghij";
++
++ crie.cri_alg = CRYPTO_3DES_CBC;
++ crie.cri_klen = 24 * 8;
++ crie.cri_key = "0123456789abcdefghijklmn";
++
++ crie.cri_next = &cria;
++
++ error = crypto_newsession(&ocf_cryptoid, &crie, 0);
++ if (error) {
++ printk("crypto_newsession failed %d\n", error);
++ return -1;
++ }
++ return 0;
++}
++
++static int
++ocf_cb(struct cryptop *crp)
++{
++ request_t *r = (request_t *) crp->crp_opaque;
++
++ if (crp->crp_etype)
++ printk("Error in OCF processing: %d\n", crp->crp_etype);
++ total++;
++ crypto_freereq(crp);
++ crp = NULL;
++
++ if (total > request_num) {
++ outstanding--;
++ return 0;
++ }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ INIT_WORK(&r->work, ocf_request_wq);
++#else
++ INIT_WORK(&r->work, ocf_request, r);
++#endif
++ schedule_work(&r->work);
++ return 0;
++}
++
++
++static void
++ocf_request(void *arg)
++{
++ request_t *r = arg;
++ struct cryptop *crp = crypto_getreq(2);
++ struct cryptodesc *crde, *crda;
++
++ if (!crp) {
++ outstanding--;
++ return;
++ }
++
++ crde = crp->crp_desc;
++ crda = crde->crd_next;
++
++ crda->crd_skip = 0;
++ crda->crd_flags = 0;
++ crda->crd_len = request_size;
++ crda->crd_inject = request_size;
++ crda->crd_alg = CRYPTO_SHA1_HMAC;
++ crda->crd_key = "0123456789abcdefghij";
++ crda->crd_klen = 20 * 8;
++
++ crde->crd_skip = 0;
++ crde->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_ENCRYPT;
++ crde->crd_len = request_size;
++ crde->crd_inject = request_size;
++ crde->crd_alg = CRYPTO_3DES_CBC;
++ crde->crd_key = "0123456789abcdefghijklmn";
++ crde->crd_klen = 24 * 8;
++
++ crp->crp_ilen = request_size + 64;
++ crp->crp_flags = CRYPTO_F_CBIMM;
++ crp->crp_buf = (caddr_t) r->buffer;
++ crp->crp_callback = ocf_cb;
++ crp->crp_sid = ocf_cryptoid;
++ crp->crp_opaque = (caddr_t) r;
++ crypto_dispatch(crp);
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ocf_request_wq(struct work_struct *work)
++{
++ request_t *r = container_of(work, request_t, work);
++ ocf_request(r);
++}
++#endif
++
++/*************************************************************************/
++#ifdef BENCH_IXP_ACCESS_LIB
++/*************************************************************************/
++/*
++ * CryptoAcc benchmark routines
++ */
++
++static IxCryptoAccCtx ixp_ctx;
++static UINT32 ixp_ctx_id;
++static IX_MBUF ixp_pri;
++static IX_MBUF ixp_sec;
++static int ixp_registered = 0;
++
++static void ixp_register_cb(UINT32 ctx_id, IX_MBUF *bufp,
++ IxCryptoAccStatus status);
++static void ixp_perform_cb(UINT32 ctx_id, IX_MBUF *sbufp, IX_MBUF *dbufp,
++ IxCryptoAccStatus status);
++static void ixp_request(void *arg);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void ixp_request_wq(struct work_struct *work);
++#endif
++
++static int
++ixp_init(void)
++{
++ IxCryptoAccStatus status;
++
++ ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_3DES;
++ ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp_ctx.cipherCtx.cipherKeyLen = 24;
++ ixp_ctx.cipherCtx.cipherBlockLen = IX_CRYPTO_ACC_DES_BLOCK_64;
++ ixp_ctx.cipherCtx.cipherInitialVectorLen = IX_CRYPTO_ACC_DES_IV_64;
++ memcpy(ixp_ctx.cipherCtx.key.cipherKey, "0123456789abcdefghijklmn", 24);
++
++ ixp_ctx.authCtx.authAlgo = IX_CRYPTO_ACC_AUTH_SHA1;
++ ixp_ctx.authCtx.authDigestLen = 12;
++ ixp_ctx.authCtx.aadLen = 0;
++ ixp_ctx.authCtx.authKeyLen = 20;
++ memcpy(ixp_ctx.authCtx.key.authKey, "0123456789abcdefghij", 20);
++
++ ixp_ctx.useDifferentSrcAndDestMbufs = 0;
++ ixp_ctx.operation = IX_CRYPTO_ACC_OP_ENCRYPT_AUTH ;
++
++ IX_MBUF_MLEN(&ixp_pri) = IX_MBUF_PKT_LEN(&ixp_pri) = 128;
++ IX_MBUF_MDATA(&ixp_pri) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++ IX_MBUF_MLEN(&ixp_sec) = IX_MBUF_PKT_LEN(&ixp_sec) = 128;
++ IX_MBUF_MDATA(&ixp_sec) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++
++ status = ixCryptoAccCtxRegister(&ixp_ctx, &ixp_pri, &ixp_sec,
++ ixp_register_cb, ixp_perform_cb, &ixp_ctx_id);
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status) {
++ while (!ixp_registered)
++ schedule();
++ return ixp_registered < 0 ? -1 : 0;
++ }
++
++ printk("ixp: ixCryptoAccCtxRegister failed %d\n", status);
++ return -1;
++}
++
++static void
++ixp_register_cb(UINT32 ctx_id, IX_MBUF *bufp, IxCryptoAccStatus status)
++{
++ if (bufp) {
++ IX_MBUF_MLEN(bufp) = IX_MBUF_PKT_LEN(bufp) = 0;
++ kfree(IX_MBUF_MDATA(bufp));
++ IX_MBUF_MDATA(bufp) = NULL;
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_WAIT == status)
++ return;
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ ixp_registered = 1;
++ else
++ ixp_registered = -1;
++}
++
++static void
++ixp_perform_cb(
++ UINT32 ctx_id,
++ IX_MBUF *sbufp,
++ IX_MBUF *dbufp,
++ IxCryptoAccStatus status)
++{
++ request_t *r = NULL;
++
++ total++;
++ if (total > request_num) {
++ outstanding--;
++ return;
++ }
++
++ if (!sbufp || !(r = IX_MBUF_PRIV(sbufp))) {
++ printk("crappo %p %p\n", sbufp, r);
++ outstanding--;
++ return;
++ }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ INIT_WORK(&r->work, ixp_request_wq);
++#else
++ INIT_WORK(&r->work, ixp_request, r);
++#endif
++ schedule_work(&r->work);
++}
++
++static void
++ixp_request(void *arg)
++{
++ request_t *r = arg;
++ IxCryptoAccStatus status;
++
++ memset(&r->mbuf, 0, sizeof(r->mbuf));
++ IX_MBUF_MLEN(&r->mbuf) = IX_MBUF_PKT_LEN(&r->mbuf) = request_size + 64;
++ IX_MBUF_MDATA(&r->mbuf) = r->buffer;
++ IX_MBUF_PRIV(&r->mbuf) = r;
++ status = ixCryptoAccAuthCryptPerform(ixp_ctx_id, &r->mbuf, NULL,
++ 0, request_size, 0, request_size, request_size, r->buffer);
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS != status) {
++ printk("status1 = %d\n", status);
++ outstanding--;
++ return;
++ }
++ return;
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ixp_request_wq(struct work_struct *work)
++{
++ request_t *r = container_of(work, request_t, work);
++ ixp_request(r);
++}
++#endif
++
++/*************************************************************************/
++#endif /* BENCH_IXP_ACCESS_LIB */
++/*************************************************************************/
++
++int
++ocfbench_init(void)
++{
++ int i, jstart, jstop;
++
++ printk("Crypto Speed tests\n");
++
++ requests = kmalloc(sizeof(request_t) * request_q_len, GFP_KERNEL);
++ if (!requests) {
++ printk("malloc failed\n");
++ return -EINVAL;
++ }
++
++ for (i = 0; i < request_q_len; i++) {
++ /* +64 for return data */
++ requests[i].buffer = kmalloc(request_size + 128, GFP_DMA);
++ if (!requests[i].buffer) {
++ printk("malloc failed\n");
++ return -EINVAL;
++ }
++ memset(requests[i].buffer, '0' + i, request_size + 128);
++ }
++
++ /*
++ * OCF benchmark
++ */
++ printk("OCF: testing ...\n");
++ ocf_init();
++ total = outstanding = 0;
++ jstart = jiffies;
++ for (i = 0; i < request_q_len; i++) {
++ outstanding++;
++ ocf_request(&requests[i]);
++ }
++ while (outstanding > 0)
++ schedule();
++ jstop = jiffies;
++
++ printk("OCF: %d requests of %d bytes in %d jiffies\n", total, request_size,
++ jstop - jstart);
++
++#ifdef BENCH_IXP_ACCESS_LIB
++ /*
++ * IXP benchmark
++ */
++ printk("IXP: testing ...\n");
++ ixp_init();
++ total = outstanding = 0;
++ jstart = jiffies;
++ for (i = 0; i < request_q_len; i++) {
++ outstanding++;
++ ixp_request(&requests[i]);
++ }
++ while (outstanding > 0)
++ schedule();
++ jstop = jiffies;
++
++ printk("IXP: %d requests of %d bytes in %d jiffies\n", total, request_size,
++ jstop - jstart);
++#endif /* BENCH_IXP_ACCESS_LIB */
++
++ for (i = 0; i < request_q_len; i++)
++ kfree(requests[i].buffer);
++ kfree(requests);
++ return -EINVAL; /* always fail to load so it can be re-run quickly ;-) */
++}
++
++static void __exit ocfbench_exit(void)
++{
++}
++
++module_init(ocfbench_init);
++module_exit(ocfbench_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("Benchmark various in-kernel crypto speeds");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ocf-compat.h linux-2.6.27.10/crypto/ocf/ocf-compat.h
+--- linux-2.6.27.10.orig/crypto/ocf/ocf-compat.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ocf-compat.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,270 @@
++#ifndef _BSD_COMPAT_H_
++#define _BSD_COMPAT_H_ 1
++/****************************************************************************/
++/*
++ * Provide compat routines for older linux kernels and BSD kernels
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2007 David McCullough <david_mccullough@securecomputing.com>
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this file
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++/****************************************************************************/
++#ifdef __KERNEL__
++/*
++ * fake some BSD driver interface stuff specifically for OCF use
++ */
++
++typedef struct ocf_device *device_t;
++
++typedef struct {
++ int (*cryptodev_newsession)(device_t dev, u_int32_t *sidp, struct cryptoini *cri);
++ int (*cryptodev_freesession)(device_t dev, u_int64_t tid);
++ int (*cryptodev_process)(device_t dev, struct cryptop *crp, int hint);
++ int (*cryptodev_kprocess)(device_t dev, struct cryptkop *krp, int hint);
++} device_method_t;
++#define DEVMETHOD(id, func) id: func
++
++struct ocf_device {
++ char name[32]; /* the driver name */
++ char nameunit[32]; /* the driver name + HW instance */
++ int unit;
++ device_method_t methods;
++ void *softc;
++};
++
++#define CRYPTODEV_NEWSESSION(dev, sid, cri) \
++ ((*(dev)->methods.cryptodev_newsession)(dev,sid,cri))
++#define CRYPTODEV_FREESESSION(dev, sid) \
++ ((*(dev)->methods.cryptodev_freesession)(dev, sid))
++#define CRYPTODEV_PROCESS(dev, crp, hint) \
++ ((*(dev)->methods.cryptodev_process)(dev, crp, hint))
++#define CRYPTODEV_KPROCESS(dev, krp, hint) \
++ ((*(dev)->methods.cryptodev_kprocess)(dev, krp, hint))
++
++#define device_get_name(dev) ((dev)->name)
++#define device_get_nameunit(dev) ((dev)->nameunit)
++#define device_get_unit(dev) ((dev)->unit)
++#define device_get_softc(dev) ((dev)->softc)
++
++#define softc_device_decl \
++ struct ocf_device _device; \
++ device_t
++
++#define softc_device_init(_sc, _name, _unit, _methods) \
++ if (1) {\
++ strncpy((_sc)->_device.name, _name, sizeof((_sc)->_device.name) - 1); \
++ snprintf((_sc)->_device.nameunit, sizeof((_sc)->_device.name), "%s%d", _name, _unit); \
++ (_sc)->_device.unit = _unit; \
++ (_sc)->_device.methods = _methods; \
++ (_sc)->_device.softc = (void *) _sc; \
++ *(device_t *)((softc_get_device(_sc))+1) = &(_sc)->_device; \
++ } else
++
++#define softc_get_device(_sc) (&(_sc)->_device)
++
++/*
++ * iomem support for 2.4 and 2.6 kernels
++ */
++#include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++#define ocf_iomem_t unsigned long
++
++/*
++ * implement simple workqueue like support for older kernels
++ */
++
++#include <linux/tqueue.h>
++
++#define work_struct tq_struct
++
++#define INIT_WORK(wp, fp, ap) \
++ do { \
++ (wp)->sync = 0; \
++ (wp)->routine = (fp); \
++ (wp)->data = (ap); \
++ } while (0)
++
++#define schedule_work(wp) \
++ do { \
++ queue_task((wp), &tq_immediate); \
++ mark_bh(IMMEDIATE_BH); \
++ } while (0)
++
++#define flush_scheduled_work() run_task_queue(&tq_immediate)
++
++#else
++#define ocf_iomem_t void __iomem *
++
++#include <linux/workqueue.h>
++
++#endif
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/fdtable.h>
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
++#define files_fdtable(files) (files)
++#endif
++
++#ifdef MODULE_PARM
++#undef module_param /* just in case */
++#define module_param(a,b,c) MODULE_PARM(a,"i")
++#endif
++
++#define bzero(s,l) memset(s,0,l)
++#define bcopy(s,d,l) memcpy(d,s,l)
++#define bcmp(x, y, l) memcmp(x,y,l)
++
++#define MIN(x,y) ((x) < (y) ? (x) : (y))
++
++#define device_printf(dev, a...) ({ \
++ printk("%s: ", device_get_nameunit(dev)); printk(a); \
++ })
++
++#undef printf
++#define printf(fmt...) printk(fmt)
++
++#define KASSERT(c,p) if (!(c)) { printk p ; } else
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++#define ocf_daemonize(str) \
++ daemonize(); \
++ spin_lock_irq(&current->sigmask_lock); \
++ sigemptyset(&current->blocked); \
++ recalc_sigpending(current); \
++ spin_unlock_irq(&current->sigmask_lock); \
++ sprintf(current->comm, str);
++#else
++#define ocf_daemonize(str) daemonize(str);
++#endif
++
++#define TAILQ_INSERT_TAIL(q,d,m) list_add_tail(&(d)->m, (q))
++#define TAILQ_EMPTY(q) list_empty(q)
++#define TAILQ_FOREACH(v, q, m) list_for_each_entry(v, q, m)
++
++#define read_random(p,l) get_random_bytes(p,l)
++
++#define DELAY(x) ((x) > 2000 ? mdelay((x)/1000) : udelay(x))
++#define strtoul simple_strtoul
++
++#define pci_get_vendor(dev) ((dev)->vendor)
++#define pci_get_device(dev) ((dev)->device)
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++#define pci_set_consistent_dma_mask(dev, mask) (0)
++#endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
++#define pci_dma_sync_single_for_cpu pci_dma_sync_single
++#endif
++
++#ifndef DMA_32BIT_MASK
++#define DMA_32BIT_MASK 0x00000000ffffffffULL
++#endif
++
++#define htole32(x) cpu_to_le32(x)
++#define htobe32(x) cpu_to_be32(x)
++#define htole16(x) cpu_to_le16(x)
++#define htobe16(x) cpu_to_be16(x)
++
++/* older kernels don't have these */
++
++#ifndef IRQ_NONE
++#define IRQ_NONE
++#define IRQ_HANDLED
++#define irqreturn_t void
++#endif
++#ifndef IRQF_SHARED
++#define IRQF_SHARED SA_SHIRQ
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
++# define strlcpy(dest,src,len) \
++ ({strncpy(dest,src,(len)-1); ((char *)dest)[(len)-1] = '\0'; })
++#endif
++
++#ifndef MAX_ERRNO
++#define MAX_ERRNO 4095
++#endif
++#ifndef IS_ERR_VALUE
++#define IS_ERR_VALUE(x) ((unsigned long)(x) >= (unsigned long)-MAX_ERRNO)
++#endif
++
++/*
++ * common debug for all
++ */
++#if 1
++#define dprintk(a...) do { if (debug) printk(a); } while(0)
++#else
++#define dprintk(a...)
++#endif
++
++#ifndef SLAB_ATOMIC
++/* Changed in 2.6.20, must use GFP_ATOMIC now */
++#define SLAB_ATOMIC GFP_ATOMIC
++#endif
++
++/*
++ * need some additional support for older kernels */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,2)
++#define pci_register_driver_compat(driver, rc) \
++ do { \
++ if ((rc) > 0) { \
++ (rc) = 0; \
++ } else if (rc == 0) { \
++ (rc) = -ENODEV; \
++ } else { \
++ pci_unregister_driver(driver); \
++ } \
++ } while (0)
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
++#define pci_register_driver_compat(driver,rc) ((rc) = (rc) < 0 ? (rc) : 0)
++#else
++#define pci_register_driver_compat(driver,rc)
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
++
++#include <asm/scatterlist.h>
++
++static inline void sg_set_page(struct scatterlist *sg, struct page *page,
++ unsigned int len, unsigned int offset)
++{
++ sg->page = page;
++ sg->offset = offset;
++ sg->length = len;
++}
++
++static inline void *sg_virt(struct scatterlist *sg)
++{
++ return page_address(sg->page) + sg->offset;
++}
++
++#endif
++
++#endif /* __KERNEL__ */
++
++/****************************************************************************/
++#endif /* _BSD_COMPAT_H_ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ocfnull/Makefile linux-2.6.27.10/crypto/ocf/ocfnull/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/ocfnull/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ocfnull/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_OCFNULL) += ocfnull.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/..
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/ocfnull/ocfnull.c linux-2.6.27.10/crypto/ocf/ocfnull/ocfnull.c
+--- linux-2.6.27.10.orig/crypto/ocf/ocfnull/ocfnull.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/ocfnull/ocfnull.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,203 @@
++/*
++ * An OCF module for determining the cost of crypto versus the cost of
++ * IPSec processing outside of OCF. This modules gives us the effect of
++ * zero cost encryption, of course you will need to run it at both ends
++ * since it does no crypto at all.
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/sched.h>
++#include <linux/wait.h>
++#include <linux/crypto.h>
++#include <linux/interrupt.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++static int32_t null_id = -1;
++static u_int32_t null_sesnum = 0;
++
++static int null_process(device_t, struct cryptop *, int);
++static int null_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int null_freesession(device_t, u_int64_t);
++
++#define debug ocfnull_debug
++int ocfnull_debug = 0;
++module_param(ocfnull_debug, int, 0644);
++MODULE_PARM_DESC(ocfnull_debug, "Enable debug");
++
++/*
++ * dummy device structure
++ */
++
++static struct {
++ softc_device_decl sc_dev;
++} nulldev;
++
++static device_method_t null_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, null_newsession),
++ DEVMETHOD(cryptodev_freesession,null_freesession),
++ DEVMETHOD(cryptodev_process, null_process),
++};
++
++/*
++ * Generate a new software session.
++ */
++static int
++null_newsession(device_t arg, u_int32_t *sid, struct cryptoini *cri)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid == NULL || cri == NULL) {
++ dprintk("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ if (null_sesnum == 0)
++ null_sesnum++;
++ *sid = null_sesnum++;
++ return 0;
++}
++
++
++/*
++ * Free a session.
++ */
++static int
++null_freesession(device_t arg, u_int64_t tid)
++{
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid > null_sesnum) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ /* Silently accept and return */
++ if (sid == 0)
++ return 0;
++ return 0;
++}
++
++
++/*
++ * Process a request.
++ */
++static int
++null_process(device_t arg, struct cryptop *crp, int hint)
++{
++ unsigned int lid;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ /* Sanity check */
++ if (crp == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ crp->crp_etype = 0;
++
++ if (crp->crp_desc == NULL || crp->crp_buf == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ /*
++ * find the session we are using
++ */
++
++ lid = crp->crp_sid & 0xffffffff;
++ if (lid >= null_sesnum || lid == 0) {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++done:
++ crypto_done(crp);
++ return 0;
++}
++
++
++/*
++ * our driver startup and shutdown routines
++ */
++
++static int
++null_init(void)
++{
++ dprintk("%s(%p)\n", __FUNCTION__, null_init);
++
++ memset(&nulldev, 0, sizeof(nulldev));
++ softc_device_init(&nulldev, "ocfnull", 0, null_methods);
++
++ null_id = crypto_get_driverid(softc_get_device(&nulldev),
++ CRYPTOCAP_F_HARDWARE);
++ if (null_id < 0)
++ panic("ocfnull: crypto device cannot initialize!");
++
++#define REGISTER(alg) \
++ crypto_register(null_id,alg,0,0)
++ REGISTER(CRYPTO_DES_CBC);
++ REGISTER(CRYPTO_3DES_CBC);
++ REGISTER(CRYPTO_RIJNDAEL128_CBC);
++ REGISTER(CRYPTO_MD5);
++ REGISTER(CRYPTO_SHA1);
++ REGISTER(CRYPTO_MD5_HMAC);
++ REGISTER(CRYPTO_SHA1_HMAC);
++#undef REGISTER
++
++ return 0;
++}
++
++static void
++null_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ crypto_unregister_all(null_id);
++ null_id = -1;
++}
++
++module_init(null_init);
++module_exit(null_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("ocfnull - claims a lot but does nothing");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/pasemi/Makefile linux-2.6.27.10/crypto/ocf/pasemi/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/pasemi/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/pasemi/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_PASEMI) += pasemi.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/pasemi/pasemi.c linux-2.6.27.10/crypto/ocf/pasemi/pasemi.c
+--- linux-2.6.27.10.orig/crypto/ocf/pasemi/pasemi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/pasemi/pasemi.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,1009 @@
++/*
++ * Copyright (C) 2007 PA Semi, Inc
++ *
++ * Driver for the PA Semi PWRficient DMA Crypto Engine
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/timer.h>
++#include <linux/random.h>
++#include <linux/skbuff.h>
++#include <asm/scatterlist.h>
++#include <linux/moduleparam.h>
++#include <linux/pci.h>
++#include <cryptodev.h>
++#include <uio.h>
++#include "pasemi_fnu.h"
++
++#define DRV_NAME "pasemi"
++
++#define TIMER_INTERVAL 1000
++
++static void __devexit pasemi_dma_remove(struct pci_dev *pdev);
++static struct pasdma_status volatile * dma_status;
++
++static int debug;
++module_param(debug, int, 0644);
++MODULE_PARM_DESC(debug, "Enable debug");
++
++static void pasemi_desc_start(struct pasemi_desc *desc, u64 hdr)
++{
++ desc->postop = 0;
++ desc->quad[0] = hdr;
++ desc->quad_cnt = 1;
++ desc->size = 1;
++}
++
++static void pasemi_desc_build(struct pasemi_desc *desc, u64 val)
++{
++ desc->quad[desc->quad_cnt++] = val;
++ desc->size = (desc->quad_cnt + 1) / 2;
++}
++
++static void pasemi_desc_hdr(struct pasemi_desc *desc, u64 hdr)
++{
++ desc->quad[0] |= hdr;
++}
++
++static int pasemi_desc_size(struct pasemi_desc *desc)
++{
++ return desc->size;
++}
++
++static void pasemi_ring_add_desc(
++ struct pasemi_fnu_txring *ring,
++ struct pasemi_desc *desc,
++ struct cryptop *crp) {
++ int i;
++ int ring_index = 2 * (ring->next_to_fill & (TX_RING_SIZE-1));
++
++ TX_DESC_INFO(ring, ring->next_to_fill).desc_size = desc->size;
++ TX_DESC_INFO(ring, ring->next_to_fill).desc_postop = desc->postop;
++ TX_DESC_INFO(ring, ring->next_to_fill).cf_crp = crp;
++
++ for (i = 0; i < desc->quad_cnt; i += 2) {
++ ring_index = 2 * (ring->next_to_fill & (TX_RING_SIZE-1));
++ ring->desc[ring_index] = desc->quad[i];
++ ring->desc[ring_index + 1] = desc->quad[i + 1];
++ ring->next_to_fill++;
++ }
++
++ if (desc->quad_cnt & 1)
++ ring->desc[ring_index + 1] = 0;
++}
++
++static void pasemi_ring_incr(struct pasemi_softc *sc, int chan_index, int incr)
++{
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_INCR(sc->base_chan + chan_index),
++ incr);
++}
++
++/*
++ * Generate a new software session.
++ */
++static int
++pasemi_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct cryptoini *c, *encini = NULL, *macini = NULL;
++ struct pasemi_softc *sc = device_get_softc(dev);
++ struct pasemi_session *ses = NULL, **sespp;
++ int sesn, blksz = 0;
++ u64 ccmd = 0;
++ unsigned long flags;
++ struct pasemi_desc init_desc;
++ struct pasemi_fnu_txring *txring;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ if (sidp == NULL || cri == NULL || sc == NULL) {
++ DPRINTF("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return -EINVAL;
++ }
++ for (c = cri; c != NULL; c = c->cri_next) {
++ if (ALG_IS_SIG(c->cri_alg)) {
++ if (macini)
++ return -EINVAL;
++ macini = c;
++ } else if (ALG_IS_CIPHER(c->cri_alg)) {
++ if (encini)
++ return -EINVAL;
++ encini = c;
++ } else {
++ DPRINTF("UNKNOWN c->cri_alg %d\n", c->cri_alg);
++ return -EINVAL;
++ }
++ }
++ if (encini == NULL && macini == NULL)
++ return -EINVAL;
++ if (encini) {
++ /* validate key length */
++ switch (encini->cri_alg) {
++ case CRYPTO_DES_CBC:
++ if (encini->cri_klen != 64)
++ return -EINVAL;
++ ccmd = DMA_CALGO_DES;
++ break;
++ case CRYPTO_3DES_CBC:
++ if (encini->cri_klen != 192)
++ return -EINVAL;
++ ccmd = DMA_CALGO_3DES;
++ break;
++ case CRYPTO_AES_CBC:
++ if (encini->cri_klen != 128 &&
++ encini->cri_klen != 192 &&
++ encini->cri_klen != 256)
++ return -EINVAL;
++ ccmd = DMA_CALGO_AES;
++ break;
++ case CRYPTO_ARC4:
++ if (encini->cri_klen != 128)
++ return -EINVAL;
++ ccmd = DMA_CALGO_ARC;
++ break;
++ default:
++ DPRINTF("UNKNOWN encini->cri_alg %d\n",
++ encini->cri_alg);
++ return -EINVAL;
++ }
++ }
++
++ if (macini) {
++ switch (macini->cri_alg) {
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ blksz = 16;
++ break;
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ blksz = 20;
++ break;
++ default:
++ DPRINTF("UNKNOWN macini->cri_alg %d\n",
++ macini->cri_alg);
++ return -EINVAL;
++ }
++ if (((macini->cri_klen + 7) / 8) > blksz) {
++ DPRINTF("key length %d bigger than blksize %d not supported\n",
++ ((macini->cri_klen + 7) / 8), blksz);
++ return -EINVAL;
++ }
++ }
++
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (sc->sc_sessions[sesn] == NULL) {
++ sc->sc_sessions[sesn] = (struct pasemi_session *)
++ kzalloc(sizeof(struct pasemi_session), GFP_ATOMIC);
++ ses = sc->sc_sessions[sesn];
++ break;
++ } else if (sc->sc_sessions[sesn]->used == 0) {
++ ses = sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ sespp = (struct pasemi_session **)
++ kzalloc(sc->sc_nsessions * 2 *
++ sizeof(struct pasemi_session *), GFP_ATOMIC);
++ if (sespp == NULL)
++ return -ENOMEM;
++ memcpy(sespp, sc->sc_sessions,
++ sc->sc_nsessions * sizeof(struct pasemi_session *));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = sespp;
++ sesn = sc->sc_nsessions;
++ ses = sc->sc_sessions[sesn] = (struct pasemi_session *)
++ kzalloc(sizeof(struct pasemi_session), GFP_ATOMIC);
++ if (ses == NULL)
++ return -ENOMEM;
++ sc->sc_nsessions *= 2;
++ }
++
++ ses->used = 1;
++
++ ses->dma_addr = pci_map_single(sc->dma_pdev, (void *) ses->civ,
++ sizeof(struct pasemi_session), DMA_TO_DEVICE);
++
++ /* enter the channel scheduler */
++ spin_lock_irqsave(&sc->sc_chnlock, flags);
++
++ /* ARC4 has to be processed by the even channel */
++ if (encini && (encini->cri_alg == CRYPTO_ARC4))
++ ses->chan = sc->sc_lastchn & ~1;
++ else
++ ses->chan = sc->sc_lastchn;
++ sc->sc_lastchn = (sc->sc_lastchn + 1) % sc->sc_num_channels;
++
++ spin_unlock_irqrestore(&sc->sc_chnlock, flags);
++
++ txring = &sc->tx[ses->chan];
++
++ if (encini) {
++ ses->ccmd = ccmd;
++
++ /* get an IV */
++ /* XXX may read fewer than requested */
++ get_random_bytes(ses->civ, sizeof(ses->civ));
++
++ ses->keysz = (encini->cri_klen - 63) / 64;
++ memcpy(ses->key, encini->cri_key, (ses->keysz + 1) * 8);
++
++ pasemi_desc_start(&init_desc,
++ XCT_CTRL_HDR(ses->chan, (encini && macini) ? 0x68 : 0x40, DMA_FN_CIV0));
++ pasemi_desc_build(&init_desc,
++ XCT_FUN_SRC_PTR((encini && macini) ? 0x68 : 0x40, ses->dma_addr));
++ }
++ if (macini) {
++ if (macini->cri_alg == CRYPTO_MD5_HMAC ||
++ macini->cri_alg == CRYPTO_SHA1_HMAC)
++ memcpy(ses->hkey, macini->cri_key, blksz);
++ else {
++ /* Load initialization constants(RFC 1321, 3174) */
++ ses->hiv[0] = 0x67452301efcdab89ULL;
++ ses->hiv[1] = 0x98badcfe10325476ULL;
++ ses->hiv[2] = 0xc3d2e1f000000000ULL;
++ }
++ ses->hseq = 0ULL;
++ }
++
++ spin_lock_irqsave(&txring->fill_lock, flags);
++
++ if (((txring->next_to_fill + pasemi_desc_size(&init_desc)) -
++ txring->next_to_clean) > TX_RING_SIZE) {
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++ return ERESTART;
++ }
++
++ if (encini) {
++ pasemi_ring_add_desc(txring, &init_desc, NULL);
++ pasemi_ring_incr(sc, ses->chan,
++ pasemi_desc_size(&init_desc));
++ }
++
++ txring->sesn = sesn;
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++
++ *sidp = PASEMI_SID(sesn);
++ return 0;
++}
++
++/*
++ * Deallocate a session.
++ */
++static int
++pasemi_freesession(device_t dev, u_int64_t tid)
++{
++ struct pasemi_softc *sc = device_get_softc(dev);
++ int session;
++ u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (sc == NULL)
++ return -EINVAL;
++ session = PASEMI_SESSION(sid);
++ if (session >= sc->sc_nsessions || !sc->sc_sessions[session])
++ return -EINVAL;
++
++ pci_unmap_single(sc->dma_pdev,
++ sc->sc_sessions[session]->dma_addr,
++ sizeof(struct pasemi_session), DMA_TO_DEVICE);
++ memset(sc->sc_sessions[session], 0,
++ sizeof(struct pasemi_session));
++
++ return 0;
++}
++
++static int
++pasemi_process(device_t dev, struct cryptop *crp, int hint)
++{
++
++ int err = 0, ivsize, srclen = 0, reinit = 0, reinit_size = 0, chsel;
++ struct pasemi_softc *sc = device_get_softc(dev);
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++ caddr_t ivp;
++ struct pasemi_desc init_desc, work_desc;
++ struct pasemi_session *ses;
++ struct sk_buff *skb;
++ struct uio *uiop;
++ unsigned long flags;
++ struct pasemi_fnu_txring *txring;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (crp == NULL || crp->crp_callback == NULL || sc == NULL)
++ return -EINVAL;
++
++ crp->crp_etype = 0;
++ if (PASEMI_SESSION(crp->crp_sid) >= sc->sc_nsessions)
++ return -EINVAL;
++
++ ses = sc->sc_sessions[PASEMI_SESSION(crp->crp_sid)];
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ err = -EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++
++ if (ALG_IS_SIG(crd1->crd_alg)) {
++ maccrd = crd1;
++ if (crd2 == NULL)
++ enccrd = NULL;
++ else if (ALG_IS_CIPHER(crd2->crd_alg) &&
++ (crd2->crd_flags & CRD_F_ENCRYPT) == 0)
++ enccrd = crd2;
++ else
++ goto erralg;
++ } else if (ALG_IS_CIPHER(crd1->crd_alg)) {
++ enccrd = crd1;
++ if (crd2 == NULL)
++ maccrd = NULL;
++ else if (ALG_IS_SIG(crd2->crd_alg) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT))
++ maccrd = crd2;
++ else
++ goto erralg;
++ } else
++ goto erralg;
++
++ chsel = ses->chan;
++
++ txring = &sc->tx[chsel];
++
++ if (enccrd && !maccrd) {
++ if (enccrd->crd_alg == CRYPTO_ARC4)
++ reinit = 1;
++ reinit_size = 0x40;
++ srclen = crp->crp_ilen;
++
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I
++ | XCT_FUN_FUN(chsel));
++ if (enccrd->crd_flags & CRD_F_ENCRYPT)
++ pasemi_desc_hdr(&work_desc, XCT_FUN_CRM_ENC);
++ else
++ pasemi_desc_hdr(&work_desc, XCT_FUN_CRM_DEC);
++ } else if (enccrd && maccrd) {
++ if (enccrd->crd_alg == CRYPTO_ARC4)
++ reinit = 1;
++ reinit_size = 0x68;
++
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ /* Encrypt -> Authenticate */
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I | XCT_FUN_CRM_ENC_SIG
++ | XCT_FUN_A | XCT_FUN_FUN(chsel));
++ srclen = maccrd->crd_skip + maccrd->crd_len;
++ } else {
++ /* Authenticate -> Decrypt */
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I | XCT_FUN_CRM_SIG_DEC
++ | XCT_FUN_24BRES | XCT_FUN_FUN(chsel));
++ pasemi_desc_build(&work_desc, 0);
++ pasemi_desc_build(&work_desc, 0);
++ pasemi_desc_build(&work_desc, 0);
++ work_desc.postop = PASEMI_CHECK_SIG;
++ srclen = crp->crp_ilen;
++ }
++
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SHL(maccrd->crd_skip / 4));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_CHL(enccrd->crd_skip - maccrd->crd_skip));
++ } else if (!enccrd && maccrd) {
++ srclen = maccrd->crd_len;
++
++ pasemi_desc_start(&init_desc,
++ XCT_CTRL_HDR(chsel, 0x58, DMA_FN_HKEY0));
++ pasemi_desc_build(&init_desc,
++ XCT_FUN_SRC_PTR(0x58, ((struct pasemi_session *)ses->dma_addr)->hkey));
++
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I | XCT_FUN_CRM_SIG
++ | XCT_FUN_A | XCT_FUN_FUN(chsel));
++ }
++
++ if (enccrd) {
++ switch (enccrd->crd_alg) {
++ case CRYPTO_3DES_CBC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_3DES |
++ XCT_FUN_BCM_CBC);
++ ivsize = sizeof(u64);
++ break;
++ case CRYPTO_DES_CBC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_DES |
++ XCT_FUN_BCM_CBC);
++ ivsize = sizeof(u64);
++ break;
++ case CRYPTO_AES_CBC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_AES |
++ XCT_FUN_BCM_CBC);
++ ivsize = 2 * sizeof(u64);
++ break;
++ case CRYPTO_ARC4:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_ARC);
++ ivsize = 0;
++ break;
++ default:
++ printk(DRV_NAME ": unimplemented enccrd->crd_alg %d\n",
++ enccrd->crd_alg);
++ err = -EINVAL;
++ goto errout;
++ }
++
++ ivp = (ivsize == sizeof(u64)) ? (caddr_t) &ses->civ[1] : (caddr_t) &ses->civ[0];
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ memcpy(ivp, enccrd->crd_iv, ivsize);
++ /* If IV is not present in the buffer already, it has to be copied there */
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0)
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, ivp);
++ } else {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ /* IV is provided expicitly in descriptor */
++ memcpy(ivp, enccrd->crd_iv, ivsize);
++ else
++ /* IV is provided in the packet */
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize,
++ ivp);
++ }
++ }
++
++ if (maccrd) {
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_MD5 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ case CRYPTO_SHA1:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_SHA1 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ case CRYPTO_MD5_HMAC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_HMAC_MD5 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ case CRYPTO_SHA1_HMAC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_HMAC_SHA1 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ default:
++ printk(DRV_NAME ": unimplemented maccrd->crd_alg %d\n",
++ maccrd->crd_alg);
++ err = -EINVAL;
++ goto errout;
++ }
++ }
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ /* using SKB buffers */
++ skb = (struct sk_buff *)crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags) {
++ printk(DRV_NAME ": skb frags unimplemented\n");
++ err = -EINVAL;
++ goto errout;
++ }
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_DST_PTR(skb->len, pci_map_single(
++ sc->dma_pdev, skb->data,
++ skb->len, DMA_TO_DEVICE)));
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_SRC_PTR(
++ srclen, pci_map_single(
++ sc->dma_pdev, skb->data,
++ srclen, DMA_TO_DEVICE)));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_LLEN(srclen));
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ /* using IOV buffers */
++ uiop = (struct uio *)crp->crp_buf;
++ if (uiop->uio_iovcnt > 1) {
++ printk(DRV_NAME ": iov frags unimplemented\n");
++ err = -EINVAL;
++ goto errout;
++ }
++
++ /* crp_olen is never set; always use crp_ilen */
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_DST_PTR(crp->crp_ilen, pci_map_single(
++ sc->dma_pdev,
++ uiop->uio_iov->iov_base,
++ crp->crp_ilen, DMA_TO_DEVICE)));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_LLEN(srclen));
++
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_SRC_PTR(srclen, pci_map_single(
++ sc->dma_pdev,
++ uiop->uio_iov->iov_base,
++ srclen, DMA_TO_DEVICE)));
++ } else {
++ /* using contig buffers */
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_DST_PTR(crp->crp_ilen, pci_map_single(
++ sc->dma_pdev,
++ crp->crp_buf,
++ crp->crp_ilen, DMA_TO_DEVICE)));
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_SRC_PTR(srclen, pci_map_single(
++ sc->dma_pdev,
++ crp->crp_buf, srclen,
++ DMA_TO_DEVICE)));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_LLEN(srclen));
++ }
++
++ spin_lock_irqsave(&txring->fill_lock, flags);
++
++ if (txring->sesn != PASEMI_SESSION(crp->crp_sid)) {
++ txring->sesn = PASEMI_SESSION(crp->crp_sid);
++ reinit = 1;
++ }
++
++ if (enccrd) {
++ pasemi_desc_start(&init_desc,
++ XCT_CTRL_HDR(chsel, reinit ? reinit_size : 0x10, DMA_FN_CIV0));
++ pasemi_desc_build(&init_desc,
++ XCT_FUN_SRC_PTR(reinit ? reinit_size : 0x10, ses->dma_addr));
++ }
++
++ if (((txring->next_to_fill + pasemi_desc_size(&init_desc) +
++ pasemi_desc_size(&work_desc)) -
++ txring->next_to_clean) > TX_RING_SIZE) {
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++ err = ERESTART;
++ goto errout;
++ }
++
++ pasemi_ring_add_desc(txring, &init_desc, NULL);
++ pasemi_ring_add_desc(txring, &work_desc, crp);
++
++ pasemi_ring_incr(sc, chsel,
++ pasemi_desc_size(&init_desc) +
++ pasemi_desc_size(&work_desc));
++
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++
++ mod_timer(&txring->crypto_timer, jiffies + TIMER_INTERVAL);
++
++ return 0;
++
++erralg:
++ printk(DRV_NAME ": unsupported algorithm or algorithm order alg1 %d alg2 %d\n",
++ crd1->crd_alg, crd2->crd_alg);
++ err = -EINVAL;
++
++errout:
++ if (err != ERESTART) {
++ crp->crp_etype = err;
++ crypto_done(crp);
++ }
++ return err;
++}
++
++static int pasemi_clean_tx(struct pasemi_softc *sc, int chan)
++{
++ int i, j, ring_idx;
++ struct pasemi_fnu_txring *ring = &sc->tx[chan];
++ u16 delta_cnt;
++ int flags, loops = 10;
++ int desc_size;
++ struct cryptop *crp;
++
++ spin_lock_irqsave(&ring->clean_lock, flags);
++
++ while ((delta_cnt = (dma_status->tx_sta[sc->base_chan + chan]
++ & PAS_STATUS_PCNT_M) - ring->total_pktcnt)
++ && loops--) {
++
++ for (i = 0; i < delta_cnt; i++) {
++ desc_size = TX_DESC_INFO(ring, ring->next_to_clean).desc_size;
++ crp = TX_DESC_INFO(ring, ring->next_to_clean).cf_crp;
++ if (crp) {
++ ring_idx = 2 * (ring->next_to_clean & (TX_RING_SIZE-1));
++ if (TX_DESC_INFO(ring, ring->next_to_clean).desc_postop & PASEMI_CHECK_SIG) {
++ /* Need to make sure signature matched,
++ * if not - return error */
++ if (!(ring->desc[ring_idx + 1] & (1ULL << 63)))
++ crp->crp_etype = -EINVAL;
++ }
++ crypto_done(TX_DESC_INFO(ring,
++ ring->next_to_clean).cf_crp);
++ TX_DESC_INFO(ring, ring->next_to_clean).cf_crp = NULL;
++ pci_unmap_single(
++ sc->dma_pdev,
++ XCT_PTR_ADDR_LEN(ring->desc[ring_idx + 1]),
++ PCI_DMA_TODEVICE);
++
++ ring->desc[ring_idx] = ring->desc[ring_idx + 1] = 0;
++
++ ring->next_to_clean++;
++ for (j = 1; j < desc_size; j++) {
++ ring_idx = 2 *
++ (ring->next_to_clean &
++ (TX_RING_SIZE-1));
++ pci_unmap_single(
++ sc->dma_pdev,
++ XCT_PTR_ADDR_LEN(ring->desc[ring_idx]),
++ PCI_DMA_TODEVICE);
++ if (ring->desc[ring_idx + 1])
++ pci_unmap_single(
++ sc->dma_pdev,
++ XCT_PTR_ADDR_LEN(
++ ring->desc[
++ ring_idx + 1]),
++ PCI_DMA_TODEVICE);
++ ring->desc[ring_idx] =
++ ring->desc[ring_idx + 1] = 0;
++ ring->next_to_clean++;
++ }
++ } else {
++ for (j = 0; j < desc_size; j++) {
++ ring_idx = 2 * (ring->next_to_clean & (TX_RING_SIZE-1));
++ ring->desc[ring_idx] =
++ ring->desc[ring_idx + 1] = 0;
++ ring->next_to_clean++;
++ }
++ }
++ }
++
++ ring->total_pktcnt += delta_cnt;
++ }
++ spin_unlock_irqrestore(&ring->clean_lock, flags);
++
++ return 0;
++}
++
++static void sweepup_tx(struct pasemi_softc *sc)
++{
++ int i;
++
++ for (i = 0; i < sc->sc_num_channels; i++)
++ pasemi_clean_tx(sc, i);
++}
++
++static irqreturn_t pasemi_intr(int irq, void *arg, struct pt_regs *regs)
++{
++ struct pasemi_softc *sc = arg;
++ unsigned int reg;
++ int chan = irq - sc->base_irq;
++ int chan_index = sc->base_chan + chan;
++ u64 stat = dma_status->tx_sta[chan_index];
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (!(stat & PAS_STATUS_CAUSE_M))
++ return IRQ_NONE;
++
++ pasemi_clean_tx(sc, chan);
++
++ stat = dma_status->tx_sta[chan_index];
++
++ reg = PAS_IOB_DMA_TXCH_RESET_PINTC |
++ PAS_IOB_DMA_TXCH_RESET_PCNT(sc->tx[chan].total_pktcnt);
++
++ if (stat & PAS_STATUS_SOFT)
++ reg |= PAS_IOB_DMA_RXCH_RESET_SINTC;
++
++ out_le32(sc->iob_regs + PAS_IOB_DMA_TXCH_RESET(chan_index), reg);
++
++
++ return IRQ_HANDLED;
++}
++
++static int pasemi_dma_setup_tx_resources(struct pasemi_softc *sc, int chan)
++{
++ u32 val;
++ int chan_index = chan + sc->base_chan;
++ int ret;
++ struct pasemi_fnu_txring *ring;
++
++ ring = &sc->tx[chan];
++
++ spin_lock_init(&ring->fill_lock);
++ spin_lock_init(&ring->clean_lock);
++
++ ring->desc_info = kzalloc(sizeof(struct pasemi_desc_info) *
++ TX_RING_SIZE, GFP_KERNEL);
++ if (!ring->desc_info)
++ return -ENOMEM;
++
++ /* Allocate descriptors */
++ ring->desc = dma_alloc_coherent(&sc->dma_pdev->dev,
++ TX_RING_SIZE *
++ 2 * sizeof(u64),
++ &ring->dma, GFP_KERNEL);
++ if (!ring->desc)
++ return -ENOMEM;
++
++ memset((void *) ring->desc, 0, TX_RING_SIZE * 2 * sizeof(u64));
++
++ out_le32(sc->iob_regs + PAS_IOB_DMA_TXCH_RESET(chan_index), 0x30);
++
++ ring->total_pktcnt = 0;
++
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_BASEL(chan_index),
++ PAS_DMA_TXCHAN_BASEL_BRBL(ring->dma));
++
++ val = PAS_DMA_TXCHAN_BASEU_BRBH(ring->dma >> 32);
++ val |= PAS_DMA_TXCHAN_BASEU_SIZ(TX_RING_SIZE >> 2);
++
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_BASEU(chan_index), val);
++
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_CFG(chan_index),
++ PAS_DMA_TXCHAN_CFG_TY_FUNC |
++ PAS_DMA_TXCHAN_CFG_TATTR(chan) |
++ PAS_DMA_TXCHAN_CFG_WT(2));
++
++ /* enable tx channel */
++ out_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index),
++ PAS_DMA_TXCHAN_TCMDSTA_EN);
++
++ out_le32(sc->iob_regs + PAS_IOB_DMA_TXCH_CFG(chan_index),
++ PAS_IOB_DMA_TXCH_CFG_CNTTH(1000));
++
++ ring->next_to_fill = 0;
++ ring->next_to_clean = 0;
++
++ snprintf(ring->irq_name, sizeof(ring->irq_name),
++ "%s%d", "crypto", chan);
++
++ ring->irq = irq_create_mapping(NULL, sc->base_irq + chan);
++ ret = request_irq(ring->irq, (irq_handler_t)
++ pasemi_intr, IRQF_DISABLED, ring->irq_name, sc);
++ if (ret) {
++ printk(KERN_ERR DRV_NAME ": failed to hook irq %d ret %d\n",
++ ring->irq, ret);
++ ring->irq = -1;
++ return ret;
++ }
++
++ setup_timer(&ring->crypto_timer, (void *) sweepup_tx, (unsigned long) sc);
++
++ return 0;
++}
++
++static device_method_t pasemi_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, pasemi_newsession),
++ DEVMETHOD(cryptodev_freesession, pasemi_freesession),
++ DEVMETHOD(cryptodev_process, pasemi_process),
++};
++
++/* Set up the crypto device structure, private data,
++ * and anything else we need before we start */
++
++static int __devinit
++pasemi_dma_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
++{
++ struct pasemi_softc *sc;
++ int ret, i;
++
++ DPRINTF(KERN_ERR "%s()\n", __FUNCTION__);
++
++ sc = kzalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return -ENOMEM;
++
++ softc_device_init(sc, DRV_NAME, 1, pasemi_methods);
++
++ pci_set_drvdata(pdev, sc);
++
++ spin_lock_init(&sc->sc_chnlock);
++
++ sc->sc_sessions = (struct pasemi_session **)
++ kzalloc(PASEMI_INITIAL_SESSIONS *
++ sizeof(struct pasemi_session *), GFP_ATOMIC);
++ if (sc->sc_sessions == NULL) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ sc->sc_nsessions = PASEMI_INITIAL_SESSIONS;
++ sc->sc_lastchn = 0;
++ sc->base_irq = pdev->irq + 6;
++ sc->base_chan = 6;
++ sc->sc_cid = -1;
++ sc->dma_pdev = pdev;
++
++ sc->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL);
++ if (!sc->iob_pdev) {
++ dev_err(&pdev->dev, "Can't find I/O Bridge\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ /* This is hardcoded and ugly, but we have some firmware versions
++ * who don't provide the register space in the device tree. Luckily
++ * they are at well-known locations so we can just do the math here.
++ */
++ sc->dma_regs =
++ ioremap(0xe0000000 + (sc->dma_pdev->devfn << 12), 0x2000);
++ sc->iob_regs =
++ ioremap(0xe0000000 + (sc->iob_pdev->devfn << 12), 0x2000);
++ if (!sc->dma_regs || !sc->iob_regs) {
++ dev_err(&pdev->dev, "Can't map registers\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ dma_status = __ioremap(0xfd800000, 0x1000, 0);
++ if (!dma_status) {
++ ret = -ENODEV;
++ dev_err(&pdev->dev, "Can't map dmastatus space\n");
++ goto out;
++ }
++
++ sc->tx = (struct pasemi_fnu_txring *)
++ kzalloc(sizeof(struct pasemi_fnu_txring)
++ * 8, GFP_KERNEL);
++ if (!sc->tx) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ /* Initialize the h/w */
++ out_le32(sc->dma_regs + PAS_DMA_COM_CFG,
++ (in_le32(sc->dma_regs + PAS_DMA_COM_CFG) |
++ PAS_DMA_COM_CFG_FWF));
++ out_le32(sc->dma_regs + PAS_DMA_COM_TXCMD, PAS_DMA_COM_TXCMD_EN);
++
++ for (i = 0; i < PASEMI_FNU_CHANNELS; i++) {
++ sc->sc_num_channels++;
++ ret = pasemi_dma_setup_tx_resources(sc, i);
++ if (ret)
++ goto out;
++ }
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),
++ CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ printk(KERN_ERR DRV_NAME ": could not get crypto driver id\n");
++ ret = -ENXIO;
++ goto out;
++ }
++
++ /* register algorithms with the framework */
++ printk(DRV_NAME ":");
++
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_ARC4, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++
++ return 0;
++
++out:
++ pasemi_dma_remove(pdev);
++ return ret;
++}
++
++#define MAX_RETRIES 5000
++
++static void pasemi_free_tx_resources(struct pasemi_softc *sc, int chan)
++{
++ struct pasemi_fnu_txring *ring = &sc->tx[chan];
++ int chan_index = chan + sc->base_chan;
++ int retries;
++ u32 stat;
++
++ /* Stop the channel */
++ out_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index),
++ PAS_DMA_TXCHAN_TCMDSTA_ST);
++
++ for (retries = 0; retries < MAX_RETRIES; retries++) {
++ stat = in_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index));
++ if (!(stat & PAS_DMA_TXCHAN_TCMDSTA_ACT))
++ break;
++ cond_resched();
++ }
++
++ if (stat & PAS_DMA_TXCHAN_TCMDSTA_ACT)
++ dev_err(&sc->dma_pdev->dev, "Failed to stop tx channel %d\n",
++ chan_index);
++
++ /* Disable the channel */
++ out_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index),
++ 0);
++
++ if (ring->desc_info)
++ kfree((void *) ring->desc_info);
++ if (ring->desc)
++ dma_free_coherent(&sc->dma_pdev->dev,
++ TX_RING_SIZE *
++ 2 * sizeof(u64),
++ (void *) ring->desc, ring->dma);
++ if (ring->irq != -1)
++ free_irq(ring->irq, sc);
++
++ del_timer(&ring->crypto_timer);
++}
++
++static void __devexit pasemi_dma_remove(struct pci_dev *pdev)
++{
++ struct pasemi_softc *sc = pci_get_drvdata(pdev);
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (sc->sc_cid >= 0) {
++ crypto_unregister_all(sc->sc_cid);
++ }
++
++ if (sc->tx) {
++ for (i = 0; i < sc->sc_num_channels; i++)
++ pasemi_free_tx_resources(sc, i);
++
++ kfree(sc->tx);
++ }
++ if (sc->sc_sessions) {
++ for (i = 0; i < sc->sc_nsessions; i++)
++ kfree(sc->sc_sessions[i]);
++ kfree(sc->sc_sessions);
++ }
++ if (sc->iob_pdev)
++ pci_dev_put(sc->iob_pdev);
++ if (sc->dma_regs)
++ iounmap(sc->dma_regs);
++ if (sc->iob_regs)
++ iounmap(sc->iob_regs);
++ kfree(sc);
++}
++
++static struct pci_device_id pasemi_dma_pci_tbl[] = {
++ { PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa007) },
++};
++
++MODULE_DEVICE_TABLE(pci, pasemi_dma_pci_tbl);
++
++static struct pci_driver pasemi_dma_driver = {
++ .name = "pasemi_dma",
++ .id_table = pasemi_dma_pci_tbl,
++ .probe = pasemi_dma_probe,
++ .remove = __devexit_p(pasemi_dma_remove),
++};
++
++static void __exit pasemi_dma_cleanup_module(void)
++{
++ pci_unregister_driver(&pasemi_dma_driver);
++ __iounmap(dma_status);
++ dma_status = NULL;
++}
++
++int pasemi_dma_init_module(void)
++{
++ return pci_register_driver(&pasemi_dma_driver);
++}
++
++module_init(pasemi_dma_init_module);
++module_exit(pasemi_dma_cleanup_module);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("Egor Martovetsky egor@pasemi.com");
++MODULE_DESCRIPTION("OCF driver for PA Semi PWRficient DMA Crypto Engine");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/pasemi/pasemi_fnu.h linux-2.6.27.10/crypto/ocf/pasemi/pasemi_fnu.h
+--- linux-2.6.27.10.orig/crypto/ocf/pasemi/pasemi_fnu.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/pasemi/pasemi_fnu.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,410 @@
++/*
++ * Copyright (C) 2007 PA Semi, Inc
++ *
++ * Driver for the PA Semi PWRficient DMA Crypto Engine, soft state and
++ * hardware register layouts.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef PASEMI_FNU_H
++#define PASEMI_FNU_H
++
++#include <linux/spinlock.h>
++
++#define PASEMI_SESSION(sid) ((sid) & 0xffffffff)
++#define PASEMI_SID(sesn) ((sesn) & 0xffffffff)
++#define DPRINTF(a...) if (debug) { printk(DRV_NAME ": " a); }
++
++/* Must be a power of two */
++#define RX_RING_SIZE 512
++#define TX_RING_SIZE 512
++#define TX_DESC(ring, num) ((ring)->desc[2 * (num & (TX_RING_SIZE-1))])
++#define TX_DESC_INFO(ring, num) ((ring)->desc_info[(num) & (TX_RING_SIZE-1)])
++#define MAX_DESC_SIZE 8
++#define PASEMI_INITIAL_SESSIONS 10
++#define PASEMI_FNU_CHANNELS 8
++
++/* DMA descriptor */
++struct pasemi_desc {
++ u64 quad[2*MAX_DESC_SIZE];
++ int quad_cnt;
++ int size;
++ int postop;
++};
++
++/*
++ * Holds per descriptor data
++ */
++struct pasemi_desc_info {
++ int desc_size;
++ int desc_postop;
++#define PASEMI_CHECK_SIG 0x1
++
++ struct cryptop *cf_crp;
++};
++
++/*
++ * Holds per channel data
++ */
++struct pasemi_fnu_txring {
++ volatile u64 *desc;
++ volatile struct
++ pasemi_desc_info *desc_info;
++ dma_addr_t dma;
++ struct timer_list crypto_timer;
++ spinlock_t fill_lock;
++ spinlock_t clean_lock;
++ unsigned int next_to_fill;
++ unsigned int next_to_clean;
++ u16 total_pktcnt;
++ int irq;
++ int sesn;
++ char irq_name[10];
++};
++
++/*
++ * Holds data specific to a single pasemi device.
++ */
++struct pasemi_softc {
++ softc_device_decl sc_cdev;
++ struct pci_dev *dma_pdev; /* device backpointer */
++ struct pci_dev *iob_pdev; /* device backpointer */
++ void __iomem *dma_regs;
++ void __iomem *iob_regs;
++ int base_irq;
++ int base_chan;
++ int32_t sc_cid; /* crypto tag */
++ int sc_nsessions;
++ struct pasemi_session **sc_sessions;
++ int sc_num_channels;/* number of crypto channels */
++
++ /* pointer to the array of txring datastructures, one txring per channel */
++ struct pasemi_fnu_txring *tx;
++
++ /*
++ * mutual exclusion for the channel scheduler
++ */
++ spinlock_t sc_chnlock;
++ /* last channel used, for now use round-robin to allocate channels */
++ int sc_lastchn;
++};
++
++struct pasemi_session {
++ u64 civ[2];
++ u64 keysz;
++ u64 key[4];
++ u64 ccmd;
++ u64 hkey[4];
++ u64 hseq;
++ u64 giv[2];
++ u64 hiv[4];
++
++ int used;
++ dma_addr_t dma_addr;
++ int chan;
++};
++
++/* status register layout in IOB region, at 0xfd800000 */
++struct pasdma_status {
++ u64 rx_sta[64];
++ u64 tx_sta[20];
++};
++
++#define ALG_IS_CIPHER(alg) ((alg == CRYPTO_DES_CBC) || \
++ (alg == CRYPTO_3DES_CBC) || \
++ (alg == CRYPTO_AES_CBC) || \
++ (alg == CRYPTO_ARC4) || \
++ (alg == CRYPTO_NULL_CBC))
++
++#define ALG_IS_SIG(alg) ((alg == CRYPTO_MD5) || \
++ (alg == CRYPTO_MD5_HMAC) || \
++ (alg == CRYPTO_SHA1) || \
++ (alg == CRYPTO_SHA1_HMAC) || \
++ (alg == CRYPTO_NULL_HMAC))
++
++enum {
++ PAS_DMA_COM_TXCMD = 0x100, /* Transmit Command Register */
++ PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */
++ PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */
++ PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */
++ PAS_DMA_COM_CFG = 0x114, /* DMA Configuration Register */
++};
++
++/* All these registers live in the PCI configuration space for the DMA PCI
++ * device. Use the normal PCI config access functions for them.
++ */
++
++#define PAS_DMA_COM_CFG_FWF 0x18000000
++
++#define PAS_DMA_COM_TXCMD_EN 0x00000001 /* enable */
++#define PAS_DMA_COM_TXSTA_ACT 0x00000001 /* active */
++#define PAS_DMA_COM_RXCMD_EN 0x00000001 /* enable */
++#define PAS_DMA_COM_RXSTA_ACT 0x00000001 /* active */
++
++#define _PAS_DMA_TXCHAN_STRIDE 0x20 /* Size per channel */
++#define _PAS_DMA_TXCHAN_TCMDSTA 0x300 /* Command / Status */
++#define _PAS_DMA_TXCHAN_CFG 0x304 /* Configuration */
++#define _PAS_DMA_TXCHAN_DSCRBU 0x308 /* Descriptor BU Allocation */
++#define _PAS_DMA_TXCHAN_INCR 0x310 /* Descriptor increment */
++#define _PAS_DMA_TXCHAN_CNT 0x314 /* Descriptor count/offset */
++#define _PAS_DMA_TXCHAN_BASEL 0x318 /* Descriptor ring base (low) */
++#define _PAS_DMA_TXCHAN_BASEU 0x31c /* (high) */
++#define PAS_DMA_TXCHAN_TCMDSTA(c) (0x300+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_TCMDSTA_EN 0x00000001 /* Enabled */
++#define PAS_DMA_TXCHAN_TCMDSTA_ST 0x00000002 /* Stop interface */
++#define PAS_DMA_TXCHAN_TCMDSTA_ACT 0x00010000 /* Active */
++#define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_CFG_TY_FUNC 0x00000002 /* Type = interface */
++#define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */
++#define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c
++#define PAS_DMA_TXCHAN_CFG_TATTR_S 2
++#define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \
++ PAS_DMA_TXCHAN_CFG_TATTR_M)
++#define PAS_DMA_TXCHAN_CFG_WT_M 0x000001c0
++#define PAS_DMA_TXCHAN_CFG_WT_S 6
++#define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \
++ PAS_DMA_TXCHAN_CFG_WT_M)
++#define PAS_DMA_TXCHAN_CFG_LPSQ_FAST 0x00000400
++#define PAS_DMA_TXCHAN_CFG_LPDQ_FAST 0x00000800
++#define PAS_DMA_TXCHAN_CFG_CF 0x00001000 /* Clean first line */
++#define PAS_DMA_TXCHAN_CFG_CL 0x00002000 /* Clean last line */
++#define PAS_DMA_TXCHAN_CFG_UP 0x00004000 /* update tx descr when sent */
++#define PAS_DMA_TXCHAN_INCR(c) (0x310+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_BASEL(c) (0x318+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_BASEL_BRBL_M 0xffffffc0
++#define PAS_DMA_TXCHAN_BASEL_BRBL_S 0
++#define PAS_DMA_TXCHAN_BASEL_BRBL(x) (((x) << PAS_DMA_TXCHAN_BASEL_BRBL_S) & \
++ PAS_DMA_TXCHAN_BASEL_BRBL_M)
++#define PAS_DMA_TXCHAN_BASEU(c) (0x31c+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_BASEU_BRBH_M 0x00000fff
++#define PAS_DMA_TXCHAN_BASEU_BRBH_S 0
++#define PAS_DMA_TXCHAN_BASEU_BRBH(x) (((x) << PAS_DMA_TXCHAN_BASEU_BRBH_S) & \
++ PAS_DMA_TXCHAN_BASEU_BRBH_M)
++/* # of cache lines worth of buffer ring */
++#define PAS_DMA_TXCHAN_BASEU_SIZ_M 0x3fff0000
++#define PAS_DMA_TXCHAN_BASEU_SIZ_S 16 /* 0 = 16K */
++#define PAS_DMA_TXCHAN_BASEU_SIZ(x) (((x) << PAS_DMA_TXCHAN_BASEU_SIZ_S) & \
++ PAS_DMA_TXCHAN_BASEU_SIZ_M)
++
++#define PAS_STATUS_PCNT_M 0x000000000000ffffull
++#define PAS_STATUS_PCNT_S 0
++#define PAS_STATUS_DCNT_M 0x00000000ffff0000ull
++#define PAS_STATUS_DCNT_S 16
++#define PAS_STATUS_BPCNT_M 0x0000ffff00000000ull
++#define PAS_STATUS_BPCNT_S 32
++#define PAS_STATUS_CAUSE_M 0xf000000000000000ull
++#define PAS_STATUS_TIMER 0x1000000000000000ull
++#define PAS_STATUS_ERROR 0x2000000000000000ull
++#define PAS_STATUS_SOFT 0x4000000000000000ull
++#define PAS_STATUS_INT 0x8000000000000000ull
++
++#define PAS_IOB_DMA_RXCH_CFG(i) (0x1100 + (i)*4)
++#define PAS_IOB_DMA_RXCH_CFG_CNTTH_M 0x00000fff
++#define PAS_IOB_DMA_RXCH_CFG_CNTTH_S 0
++#define PAS_IOB_DMA_RXCH_CFG_CNTTH(x) (((x) << PAS_IOB_DMA_RXCH_CFG_CNTTH_S) & \
++ PAS_IOB_DMA_RXCH_CFG_CNTTH_M)
++#define PAS_IOB_DMA_TXCH_CFG(i) (0x1200 + (i)*4)
++#define PAS_IOB_DMA_TXCH_CFG_CNTTH_M 0x00000fff
++#define PAS_IOB_DMA_TXCH_CFG_CNTTH_S 0
++#define PAS_IOB_DMA_TXCH_CFG_CNTTH(x) (((x) << PAS_IOB_DMA_TXCH_CFG_CNTTH_S) & \
++ PAS_IOB_DMA_TXCH_CFG_CNTTH_M)
++#define PAS_IOB_DMA_RXCH_STAT(i) (0x1300 + (i)*4)
++#define PAS_IOB_DMA_RXCH_STAT_INTGEN 0x00001000
++#define PAS_IOB_DMA_RXCH_STAT_CNTDEL_M 0x00000fff
++#define PAS_IOB_DMA_RXCH_STAT_CNTDEL_S 0
++#define PAS_IOB_DMA_RXCH_STAT_CNTDEL(x) (((x) << PAS_IOB_DMA_RXCH_STAT_CNTDEL_S) &\
++ PAS_IOB_DMA_RXCH_STAT_CNTDEL_M)
++#define PAS_IOB_DMA_TXCH_STAT(i) (0x1400 + (i)*4)
++#define PAS_IOB_DMA_TXCH_STAT_INTGEN 0x00001000
++#define PAS_IOB_DMA_TXCH_STAT_CNTDEL_M 0x00000fff
++#define PAS_IOB_DMA_TXCH_STAT_CNTDEL_S 0
++#define PAS_IOB_DMA_TXCH_STAT_CNTDEL(x) (((x) << PAS_IOB_DMA_TXCH_STAT_CNTDEL_S) &\
++ PAS_IOB_DMA_TXCH_STAT_CNTDEL_M)
++#define PAS_IOB_DMA_RXCH_RESET(i) (0x1500 + (i)*4)
++#define PAS_IOB_DMA_RXCH_RESET_PCNT_M 0xffff0000
++#define PAS_IOB_DMA_RXCH_RESET_PCNT_S 16
++#define PAS_IOB_DMA_RXCH_RESET_PCNT(x) (((x) << PAS_IOB_DMA_RXCH_RESET_PCNT_S) & \
++ PAS_IOB_DMA_RXCH_RESET_PCNT_M)
++#define PAS_IOB_DMA_RXCH_RESET_PCNTRST 0x00000020
++#define PAS_IOB_DMA_RXCH_RESET_DCNTRST 0x00000010
++#define PAS_IOB_DMA_RXCH_RESET_TINTC 0x00000008
++#define PAS_IOB_DMA_RXCH_RESET_DINTC 0x00000004
++#define PAS_IOB_DMA_RXCH_RESET_SINTC 0x00000002
++#define PAS_IOB_DMA_RXCH_RESET_PINTC 0x00000001
++#define PAS_IOB_DMA_TXCH_RESET(i) (0x1600 + (i)*4)
++#define PAS_IOB_DMA_TXCH_RESET_PCNT_M 0xffff0000
++#define PAS_IOB_DMA_TXCH_RESET_PCNT_S 16
++#define PAS_IOB_DMA_TXCH_RESET_PCNT(x) (((x) << PAS_IOB_DMA_TXCH_RESET_PCNT_S) & \
++ PAS_IOB_DMA_TXCH_RESET_PCNT_M)
++#define PAS_IOB_DMA_TXCH_RESET_PCNTRST 0x00000020
++#define PAS_IOB_DMA_TXCH_RESET_DCNTRST 0x00000010
++#define PAS_IOB_DMA_TXCH_RESET_TINTC 0x00000008
++#define PAS_IOB_DMA_TXCH_RESET_DINTC 0x00000004
++#define PAS_IOB_DMA_TXCH_RESET_SINTC 0x00000002
++#define PAS_IOB_DMA_TXCH_RESET_PINTC 0x00000001
++
++#define PAS_IOB_DMA_COM_TIMEOUTCFG 0x1700
++#define PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_M 0x00ffffff
++#define PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_S 0
++#define PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(x) (((x) << PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_S) & \
++ PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_M)
++
++/* Transmit descriptor fields */
++#define XCT_MACTX_T 0x8000000000000000ull
++#define XCT_MACTX_ST 0x4000000000000000ull
++#define XCT_MACTX_NORES 0x0000000000000000ull
++#define XCT_MACTX_8BRES 0x1000000000000000ull
++#define XCT_MACTX_24BRES 0x2000000000000000ull
++#define XCT_MACTX_40BRES 0x3000000000000000ull
++#define XCT_MACTX_I 0x0800000000000000ull
++#define XCT_MACTX_O 0x0400000000000000ull
++#define XCT_MACTX_E 0x0200000000000000ull
++#define XCT_MACTX_VLAN_M 0x0180000000000000ull
++#define XCT_MACTX_VLAN_NOP 0x0000000000000000ull
++#define XCT_MACTX_VLAN_REMOVE 0x0080000000000000ull
++#define XCT_MACTX_VLAN_INSERT 0x0100000000000000ull
++#define XCT_MACTX_VLAN_REPLACE 0x0180000000000000ull
++#define XCT_MACTX_CRC_M 0x0060000000000000ull
++#define XCT_MACTX_CRC_NOP 0x0000000000000000ull
++#define XCT_MACTX_CRC_INSERT 0x0020000000000000ull
++#define XCT_MACTX_CRC_PAD 0x0040000000000000ull
++#define XCT_MACTX_CRC_REPLACE 0x0060000000000000ull
++#define XCT_MACTX_SS 0x0010000000000000ull
++#define XCT_MACTX_LLEN_M 0x00007fff00000000ull
++#define XCT_MACTX_LLEN_S 32ull
++#define XCT_MACTX_LLEN(x) ((((long)(x)) << XCT_MACTX_LLEN_S) & \
++ XCT_MACTX_LLEN_M)
++#define XCT_MACTX_IPH_M 0x00000000f8000000ull
++#define XCT_MACTX_IPH_S 27ull
++#define XCT_MACTX_IPH(x) ((((long)(x)) << XCT_MACTX_IPH_S) & \
++ XCT_MACTX_IPH_M)
++#define XCT_MACTX_IPO_M 0x0000000007c00000ull
++#define XCT_MACTX_IPO_S 22ull
++#define XCT_MACTX_IPO(x) ((((long)(x)) << XCT_MACTX_IPO_S) & \
++ XCT_MACTX_IPO_M)
++#define XCT_MACTX_CSUM_M 0x0000000000000060ull
++#define XCT_MACTX_CSUM_NOP 0x0000000000000000ull
++#define XCT_MACTX_CSUM_TCP 0x0000000000000040ull
++#define XCT_MACTX_CSUM_UDP 0x0000000000000060ull
++#define XCT_MACTX_V6 0x0000000000000010ull
++#define XCT_MACTX_C 0x0000000000000004ull
++#define XCT_MACTX_AL2 0x0000000000000002ull
++
++#define XCT_PTR_T 0x8000000000000000ull
++#define XCT_PTR_LEN_M 0x7ffff00000000000ull
++#define XCT_PTR_LEN_S 44
++#define XCT_PTR_LEN(x) ((((long)(x)) << XCT_PTR_LEN_S) & \
++ XCT_PTR_LEN_M)
++#define XCT_PTR_ADDR_M 0x00000fffffffffffull
++#define XCT_PTR_ADDR_S 0
++#define XCT_PTR_ADDR(x) ((((long)(x)) << XCT_PTR_ADDR_S) & \
++ XCT_PTR_ADDR_M)
++
++/* Function descriptor fields */
++#define XCT_FUN_T 0x8000000000000000ull
++#define XCT_FUN_ST 0x4000000000000000ull
++#define XCT_FUN_NORES 0x0000000000000000ull
++#define XCT_FUN_8BRES 0x1000000000000000ull
++#define XCT_FUN_24BRES 0x2000000000000000ull
++#define XCT_FUN_40BRES 0x3000000000000000ull
++#define XCT_FUN_I 0x0800000000000000ull
++#define XCT_FUN_O 0x0400000000000000ull
++#define XCT_FUN_E 0x0200000000000000ull
++#define XCT_FUN_FUN_S 54
++#define XCT_FUN_FUN_M 0x01c0000000000000ull
++#define XCT_FUN_FUN(num) ((((long)(num)) << XCT_FUN_FUN_S) & \
++ XCT_FUN_FUN_M)
++#define XCT_FUN_CRM_NOP 0x0000000000000000ull
++#define XCT_FUN_CRM_SIG 0x0008000000000000ull
++#define XCT_FUN_CRM_ENC 0x0010000000000000ull
++#define XCT_FUN_CRM_DEC 0x0018000000000000ull
++#define XCT_FUN_CRM_SIG_ENC 0x0020000000000000ull
++#define XCT_FUN_CRM_ENC_SIG 0x0028000000000000ull
++#define XCT_FUN_CRM_SIG_DEC 0x0030000000000000ull
++#define XCT_FUN_CRM_DEC_SIG 0x0038000000000000ull
++#define XCT_FUN_LLEN_M 0x0007ffff00000000ull
++#define XCT_FUN_LLEN_S 32ULL
++#define XCT_FUN_LLEN(x) ((((long)(x)) << XCT_FUN_LLEN_S) & \
++ XCT_FUN_LLEN_M)
++#define XCT_FUN_SHL_M 0x00000000f8000000ull
++#define XCT_FUN_SHL_S 27ull
++#define XCT_FUN_SHL(x) ((((long)(x)) << XCT_FUN_SHL_S) & \
++ XCT_FUN_SHL_M)
++#define XCT_FUN_CHL_M 0x0000000007c00000ull
++#define XCT_FUN_CHL_S 22ull
++#define XCT_FUN_CHL(x) ((((long)(x)) << XCT_FUN_CHL_S) & \
++ XCT_FUN_CHL_M)
++#define XCT_FUN_HSZ_M 0x00000000003c0000ull
++#define XCT_FUN_HSZ_S 18ull
++#define XCT_FUN_HSZ(x) ((((long)(x)) << XCT_FUN_HSZ_S) & \
++ XCT_FUN_HSZ_M)
++#define XCT_FUN_ALG_DES 0x0000000000000000ull
++#define XCT_FUN_ALG_3DES 0x0000000000008000ull
++#define XCT_FUN_ALG_AES 0x0000000000010000ull
++#define XCT_FUN_ALG_ARC 0x0000000000018000ull
++#define XCT_FUN_ALG_KASUMI 0x0000000000020000ull
++#define XCT_FUN_BCM_ECB 0x0000000000000000ull
++#define XCT_FUN_BCM_CBC 0x0000000000001000ull
++#define XCT_FUN_BCM_CFB 0x0000000000002000ull
++#define XCT_FUN_BCM_OFB 0x0000000000003000ull
++#define XCT_FUN_BCM_CNT 0x0000000000003800ull
++#define XCT_FUN_BCM_KAS_F8 0x0000000000002800ull
++#define XCT_FUN_BCM_KAS_F9 0x0000000000001800ull
++#define XCT_FUN_BCP_NO_PAD 0x0000000000000000ull
++#define XCT_FUN_BCP_ZRO 0x0000000000000200ull
++#define XCT_FUN_BCP_PL 0x0000000000000400ull
++#define XCT_FUN_BCP_INCR 0x0000000000000600ull
++#define XCT_FUN_SIG_MD5 (0ull << 4)
++#define XCT_FUN_SIG_SHA1 (2ull << 4)
++#define XCT_FUN_SIG_HMAC_MD5 (8ull << 4)
++#define XCT_FUN_SIG_HMAC_SHA1 (10ull << 4)
++#define XCT_FUN_A 0x0000000000000008ull
++#define XCT_FUN_C 0x0000000000000004ull
++#define XCT_FUN_AL2 0x0000000000000002ull
++#define XCT_FUN_SE 0x0000000000000001ull
++
++#define XCT_FUN_SRC_PTR(len, addr) (XCT_PTR_LEN(len) | XCT_PTR_ADDR(addr))
++#define XCT_FUN_DST_PTR(len, addr) (XCT_FUN_SRC_PTR(len, addr) | \
++ 0x8000000000000000ull)
++
++#define XCT_CTRL_HDR_FUN_NUM_M 0x01c0000000000000ull
++#define XCT_CTRL_HDR_FUN_NUM_S 54
++#define XCT_CTRL_HDR_LEN_M 0x0007ffff00000000ull
++#define XCT_CTRL_HDR_LEN_S 32
++#define XCT_CTRL_HDR_REG_M 0x00000000000000ffull
++#define XCT_CTRL_HDR_REG_S 0
++
++#define XCT_CTRL_HDR(funcN,len,reg) (0x9400000000000000ull | \
++ ((((long)(funcN)) << XCT_CTRL_HDR_FUN_NUM_S) \
++ & XCT_CTRL_HDR_FUN_NUM_M) | \
++ ((((long)(len)) << \
++ XCT_CTRL_HDR_LEN_S) & XCT_CTRL_HDR_LEN_M) | \
++ ((((long)(reg)) << \
++ XCT_CTRL_HDR_REG_S) & XCT_CTRL_HDR_REG_M))
++
++/* Function config command options */
++#define DMA_CALGO_DES 0x00
++#define DMA_CALGO_3DES 0x01
++#define DMA_CALGO_AES 0x02
++#define DMA_CALGO_ARC 0x03
++
++#define DMA_FN_CIV0 0x02
++#define DMA_FN_CIV1 0x03
++#define DMA_FN_HKEY0 0x0a
++
++#define XCT_PTR_ADDR_LEN(ptr) ((ptr) & XCT_PTR_ADDR_M), \
++ (((ptr) & XCT_PTR_LEN_M) >> XCT_PTR_LEN_S)
++
++#endif /* PASEMI_FNU_H */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/random.c linux-2.6.27.10/crypto/ocf/random.c
+--- linux-2.6.27.10.orig/crypto/ocf/random.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/random.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,317 @@
++/*
++ * A system independant way of adding entropy to the kernels pool
++ * this way the drivers can focus on the real work and we can take
++ * care of pushing it to the appropriate place in the kernel.
++ *
++ * This should be fast and callable from timers/interrupts
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/spinlock.h>
++#include <linux/version.h>
++#include <linux/unistd.h>
++#include <linux/poll.h>
++#include <linux/random.h>
++#include <cryptodev.h>
++
++#ifdef CONFIG_OCF_FIPS
++#include "rndtest.h"
++#endif
++
++#ifndef HAS_RANDOM_INPUT_WAIT
++#error "Please do not enable OCF_RANDOMHARVEST unless you have applied patches"
++#endif
++
++/*
++ * a hack to access the debug levels from the crypto driver
++ */
++extern int crypto_debug;
++#define debug crypto_debug
++
++/*
++ * a list of all registered random providers
++ */
++static LIST_HEAD(random_ops);
++static int started = 0;
++static int initted = 0;
++
++struct random_op {
++ struct list_head random_list;
++ u_int32_t driverid;
++ int (*read_random)(void *arg, u_int32_t *buf, int len);
++ void *arg;
++};
++
++static int random_proc(void *arg);
++
++static pid_t randomproc = (pid_t) -1;
++static spinlock_t random_lock;
++
++/*
++ * just init the spin locks
++ */
++static int
++crypto_random_init(void)
++{
++ spin_lock_init(&random_lock);
++ initted = 1;
++ return(0);
++}
++
++/*
++ * Add the given random reader to our list (if not present)
++ * and start the thread (if not already started)
++ *
++ * we have to assume that driver id is ok for now
++ */
++int
++crypto_rregister(
++ u_int32_t driverid,
++ int (*read_random)(void *arg, u_int32_t *buf, int len),
++ void *arg)
++{
++ unsigned long flags;
++ int ret = 0;
++ struct random_op *rops, *tmp;
++
++ dprintk("%s,%d: %s(0x%x, %p, %p)\n", __FILE__, __LINE__,
++ __FUNCTION__, driverid, read_random, arg);
++
++ if (!initted)
++ crypto_random_init();
++
++#if 0
++ struct cryptocap *cap;
++
++ cap = crypto_checkdriver(driverid);
++ if (!cap)
++ return EINVAL;
++#endif
++
++ list_for_each_entry_safe(rops, tmp, &random_ops, random_list) {
++ if (rops->driverid == driverid && rops->read_random == read_random)
++ return EEXIST;
++ }
++
++ rops = (struct random_op *) kmalloc(sizeof(*rops), GFP_KERNEL);
++ if (!rops)
++ return ENOMEM;
++
++ rops->driverid = driverid;
++ rops->read_random = read_random;
++ rops->arg = arg;
++
++ spin_lock_irqsave(&random_lock, flags);
++ list_add_tail(&rops->random_list, &random_ops);
++ if (!started) {
++ randomproc = kernel_thread(random_proc, NULL, CLONE_FS|CLONE_FILES);
++ if (randomproc < 0) {
++ ret = randomproc;
++ printk("crypto: crypto_rregister cannot start random thread; "
++ "error %d", ret);
++ } else
++ started = 1;
++ }
++ spin_unlock_irqrestore(&random_lock, flags);
++
++ return ret;
++}
++EXPORT_SYMBOL(crypto_rregister);
++
++int
++crypto_runregister_all(u_int32_t driverid)
++{
++ struct random_op *rops, *tmp;
++ unsigned long flags;
++
++ dprintk("%s,%d: %s(0x%x)\n", __FILE__, __LINE__, __FUNCTION__, driverid);
++
++ list_for_each_entry_safe(rops, tmp, &random_ops, random_list) {
++ if (rops->driverid == driverid) {
++ list_del(&rops->random_list);
++ kfree(rops);
++ }
++ }
++
++ spin_lock_irqsave(&random_lock, flags);
++ if (list_empty(&random_ops) && started)
++ kill_pid(randomproc, SIGKILL, 1);
++ spin_unlock_irqrestore(&random_lock, flags);
++ return(0);
++}
++EXPORT_SYMBOL(crypto_runregister_all);
++
++/*
++ * while we can add entropy to random.c continue to read random data from
++ * the drivers and push it to random.
++ */
++static int
++random_proc(void *arg)
++{
++ int n;
++ int wantcnt;
++ int bufcnt = 0;
++ int retval = 0;
++ int *buf = NULL;
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ daemonize();
++ spin_lock_irq(&current->sigmask_lock);
++ sigemptyset(&current->blocked);
++ recalc_sigpending(current);
++ spin_unlock_irq(&current->sigmask_lock);
++ sprintf(current->comm, "ocf-random");
++#else
++ daemonize("ocf-random");
++ allow_signal(SIGKILL);
++#endif
++
++ (void) get_fs();
++ set_fs(get_ds());
++
++#ifdef CONFIG_OCF_FIPS
++#define NUM_INT (RNDTEST_NBYTES/sizeof(int))
++#else
++#define NUM_INT 32
++#endif
++
++ /*
++ * some devices can transferr their RNG data direct into memory,
++ * so make sure it is device friendly
++ */
++ buf = kmalloc(NUM_INT * sizeof(int), GFP_DMA);
++ if (NULL == buf) {
++ printk("crypto: RNG could not allocate memory\n");
++ retval = -ENOMEM;
++ goto bad_alloc;
++ }
++
++ wantcnt = NUM_INT; /* start by adding some entropy */
++
++ /*
++ * its possible due to errors or driver removal that we no longer
++ * have anything to do, if so exit or we will consume all the CPU
++ * doing nothing
++ */
++ while (!list_empty(&random_ops)) {
++ struct random_op *rops, *tmp;
++
++#ifdef CONFIG_OCF_FIPS
++ if (wantcnt)
++ wantcnt = NUM_INT; /* FIPs mode can do 20000 bits or none */
++#endif
++
++ /* see if we can get enough entropy to make the world
++ * a better place.
++ */
++ while (bufcnt < wantcnt && bufcnt < NUM_INT) {
++ list_for_each_entry_safe(rops, tmp, &random_ops, random_list) {
++
++ n = (*rops->read_random)(rops->arg, &buf[bufcnt],
++ NUM_INT - bufcnt);
++
++ /* on failure remove the random number generator */
++ if (n == -1) {
++ list_del(&rops->random_list);
++ printk("crypto: RNG (driverid=0x%x) failed, disabling\n",
++ rops->driverid);
++ kfree(rops);
++ } else if (n > 0)
++ bufcnt += n;
++ }
++ /* give up CPU for a bit, just in case as this is a loop */
++ schedule();
++ }
++
++
++#ifdef CONFIG_OCF_FIPS
++ if (bufcnt > 0 && rndtest_buf((unsigned char *) &buf[0])) {
++ dprintk("crypto: buffer had fips errors, discarding\n");
++ bufcnt = 0;
++ }
++#endif
++
++ /*
++ * if we have a certified buffer, we can send some data
++ * to /dev/random and move along
++ */
++ if (bufcnt > 0) {
++ /* add what we have */
++ random_input_words(buf, bufcnt, bufcnt*sizeof(int)*8);
++ bufcnt = 0;
++ }
++
++ /* give up CPU for a bit so we don't hog while filling */
++ schedule();
++
++ /* wait for needing more */
++ wantcnt = random_input_wait();
++
++ if (wantcnt <= 0)
++ wantcnt = 0; /* try to get some info again */
++ else
++ /* round up to one word or we can loop forever */
++ wantcnt = (wantcnt + (sizeof(int)*8)) / (sizeof(int)*8);
++ if (wantcnt > NUM_INT) {
++ wantcnt = NUM_INT;
++ }
++
++ if (signal_pending(current)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_lock_irq(&current->sigmask_lock);
++#endif
++ flush_signals(current);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_unlock_irq(&current->sigmask_lock);
++#endif
++ }
++ }
++
++ kfree(buf);
++
++bad_alloc:
++ spin_lock_irq(&random_lock);
++ randomproc = (pid_t) -1;
++ started = 0;
++ spin_unlock_irq(&random_lock);
++
++ return retval;
++}
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/README linux-2.6.27.10/crypto/ocf/README
+--- linux-2.6.27.10.orig/crypto/ocf/README 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/README 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,167 @@
++README - ocf-linux-20071215
++---------------------------
++
++This README provides instructions for getting ocf-linux compiled and
++operating in a generic linux environment. For other information you
++might like to visit the home page for this project:
++
++ http://ocf-linux.sourceforge.net/
++
++Adding OCF to linux
++-------------------
++
++ Not much in this file for now, just some notes. I usually build
++ the ocf support as modules but it can be built into the kernel as
++ well. To use it:
++
++ * mknod /dev/crypto c 10 70
++
++ * to add OCF to your kernel source, you have two options. Apply
++ the kernel specific patch:
++
++ cd linux-2.4*; gunzip < ocf-linux-24-XXXXXXXX.patch.gz | patch -p1
++ cd linux-2.6*; gunzip < ocf-linux-26-XXXXXXXX.patch.gz | patch -p1
++
++ if you do one of the above, then you can proceed to the next step,
++ or you can do the above process by hand with using the patches against
++ linux-2.4.35 and 2.6.23 to include the ocf code under crypto/ocf.
++ Here's how to add it:
++
++ for 2.4.35 (and later)
++
++ cd linux-2.4.35/crypto
++ tar xvzf ocf-linux.tar.gz
++ cd ..
++ patch -p1 < crypto/ocf/patches/linux-2.4.35-ocf.patch
++
++ for 2.6.23 (and later), find the kernel patch specific (or nearest)
++ to your kernel versions and then:
++
++ cd linux-2.6.NN/crypto
++ tar xvzf ocf-linux.tar.gz
++ cd ..
++ patch -p1 < crypto/ocf/patches/linux-2.6.NN-ocf.patch
++
++ It should be easy to take this patch and apply it to other more
++ recent versions of the kernels. The same patches should also work
++ relatively easily on kernels as old as 2.6.11 and 2.4.18.
++
++ * under 2.4 if you are on a non-x86 platform, you may need to:
++
++ cp linux-2.X.x/include/asm-i386/kmap_types.h linux-2.X.x/include/asm-YYY
++
++ so that you can build the kernel crypto support needed for the cryptosoft
++ driver.
++
++ * For simplicity you should enable all the crypto support in your kernel
++ except for the test driver. Likewise for the OCF options. Do not
++ enable OCF crypto drivers for HW that you do not have (for example
++ ixp4xx will not compile on non-Xscale systems).
++
++ * make sure that cryptodev.h (from ocf-linux.tar.gz) is installed as
++ crypto/cryptodev.h in an include directory that is used for building
++ applications for your platform. For example on a host system that
++ might be:
++
++ /usr/include/crypto/cryptodev.h
++
++ * patch your openssl-0.9.8i code with the openssl-0.9.8i.patch.
++ (NOTE: there is no longer a need to patch ssh). The patch is against:
++ openssl-0_9_8e
++
++ If you need a patch for an older version of openssl, you should look
++ to older OCF releases. This patch is unlikely to work on older
++ openssl versions.
++
++ openssl-0.9.8i.patch
++ - enables --with-cryptodev for non BSD systems
++ - adds -cpu option to openssl speed for calculating CPU load
++ under linux
++ - fixes null pointer in openssl speed multi thread output.
++ - fixes test keys to work with linux crypto's more stringent
++ key checking.
++ - adds MD5/SHA acceleration (Ronen Shitrit), only enabled
++ with the --with-cryptodev-digests option
++ - fixes bug in engine code caching.
++
++ * build crypto-tools-XXXXXXXX.tar.gz if you want to try some of the BSD
++ tools for testing OCF (ie., cryptotest).
++
++How to load the OCF drivers
++---------------------------
++
++ First insert the base modules:
++
++ insmod ocf
++ insmod cryptodev
++
++ You can then install the software OCF driver with:
++
++ insmod cryptosoft
++
++ and one or more of the OCF HW drivers with:
++
++ insmod safe
++ insmod hifn7751
++ insmod ixp4xx
++ ...
++
++ all the drivers take a debug option to enable verbose debug so that
++ you can see what is going on. For debug you load them as:
++
++ insmod ocf crypto_debug=1
++ insmod cryptodev cryptodev_debug=1
++ insmod cryptosoft swcr_debug=1
++
++ You may load more than one OCF crypto driver but then there is no guarantee
++ as to which will be used.
++
++ You can also enable debug at run time on 2.6 systems with the following:
++
++ echo 1 > /sys/module/ocf/parameters/crypto_debug
++ echo 1 > /sys/module/cryptodev/parameters/cryptodev_debug
++ echo 1 > /sys/module/cryptosoft/parameters/swcr_debug
++ echo 1 > /sys/module/hifn7751/parameters/hifn_debug
++ echo 1 > /sys/module/safe/parameters/safe_debug
++ echo 1 > /sys/module/ixp4xx/parameters/ixp_debug
++ ...
++
++Testing the OCF support
++-----------------------
++
++ run "cryptotest", it should do a short test for a couple of
++ des packets. If it does everything is working.
++
++ If this works, then ssh will use the driver when invoked as:
++
++ ssh -c 3des username@host
++
++ to see for sure that it is operating, enable debug as defined above.
++
++ To get a better idea of performance run:
++
++ cryptotest 100 4096
++
++ There are more options to cryptotest, see the help.
++
++ It is also possible to use openssl to test the speed of the crypto
++ drivers.
++
++ openssl speed -evp des -engine cryptodev -elapsed
++ openssl speed -evp des3 -engine cryptodev -elapsed
++ openssl speed -evp aes128 -engine cryptodev -elapsed
++
++ and multiple threads (10) with:
++
++ openssl speed -evp des -engine cryptodev -elapsed -multi 10
++ openssl speed -evp des3 -engine cryptodev -elapsed -multi 10
++ openssl speed -evp aes128 -engine cryptodev -elapsed -multi 10
++
++ for public key testing you can try:
++
++ cryptokeytest
++ openssl speed -engine cryptodev rsa -elapsed
++ openssl speed -engine cryptodev dsa -elapsed
++
++David McCullough
++david_mccullough@securecomputing.com
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/rndtest.c linux-2.6.27.10/crypto/ocf/rndtest.c
+--- linux-2.6.27.10.orig/crypto/ocf/rndtest.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/rndtest.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,300 @@
++/* $OpenBSD$ */
++
++/*
++ * OCF/Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by Jason L. Wright
++ * 4. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
++ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/list.h>
++#include <linux/wait.h>
++#include <linux/time.h>
++#include <linux/version.h>
++#include <linux/unistd.h>
++#include <linux/kernel.h>
++#include <linux/string.h>
++#include <linux/time.h>
++#include <cryptodev.h>
++#include "rndtest.h"
++
++static struct rndtest_stats rndstats;
++
++static void rndtest_test(struct rndtest_state *);
++
++/* The tests themselves */
++static int rndtest_monobit(struct rndtest_state *);
++static int rndtest_runs(struct rndtest_state *);
++static int rndtest_longruns(struct rndtest_state *);
++static int rndtest_chi_4(struct rndtest_state *);
++
++static int rndtest_runs_check(struct rndtest_state *, int, int *);
++static void rndtest_runs_record(struct rndtest_state *, int, int *);
++
++static const struct rndtest_testfunc {
++ int (*test)(struct rndtest_state *);
++} rndtest_funcs[] = {
++ { rndtest_monobit },
++ { rndtest_runs },
++ { rndtest_chi_4 },
++ { rndtest_longruns },
++};
++
++#define RNDTEST_NTESTS (sizeof(rndtest_funcs)/sizeof(rndtest_funcs[0]))
++
++static void
++rndtest_test(struct rndtest_state *rsp)
++{
++ int i, rv = 0;
++
++ rndstats.rst_tests++;
++ for (i = 0; i < RNDTEST_NTESTS; i++)
++ rv |= (*rndtest_funcs[i].test)(rsp);
++ rsp->rs_discard = (rv != 0);
++}
++
++
++extern int crypto_debug;
++#define rndtest_verbose 2
++#define rndtest_report(rsp, failure, fmt, a...) \
++ { if (failure || crypto_debug) { printk("rng_test: " fmt "\n", a); } else; }
++
++#define RNDTEST_MONOBIT_MINONES 9725
++#define RNDTEST_MONOBIT_MAXONES 10275
++
++static int
++rndtest_monobit(struct rndtest_state *rsp)
++{
++ int i, ones = 0, j;
++ u_int8_t r;
++
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ r = rsp->rs_buf[i];
++ for (j = 0; j < 8; j++, r <<= 1)
++ if (r & 0x80)
++ ones++;
++ }
++ if (ones > RNDTEST_MONOBIT_MINONES &&
++ ones < RNDTEST_MONOBIT_MAXONES) {
++ if (rndtest_verbose > 1)
++ rndtest_report(rsp, 0, "monobit pass (%d < %d < %d)",
++ RNDTEST_MONOBIT_MINONES, ones,
++ RNDTEST_MONOBIT_MAXONES);
++ return (0);
++ } else {
++ if (rndtest_verbose)
++ rndtest_report(rsp, 1,
++ "monobit failed (%d ones)", ones);
++ rndstats.rst_monobit++;
++ return (-1);
++ }
++}
++
++#define RNDTEST_RUNS_NINTERVAL 6
++
++static const struct rndtest_runs_tabs {
++ u_int16_t min, max;
++} rndtest_runs_tab[] = {
++ { 2343, 2657 },
++ { 1135, 1365 },
++ { 542, 708 },
++ { 251, 373 },
++ { 111, 201 },
++ { 111, 201 },
++};
++
++static int
++rndtest_runs(struct rndtest_state *rsp)
++{
++ int i, j, ones, zeros, rv = 0;
++ int onei[RNDTEST_RUNS_NINTERVAL], zeroi[RNDTEST_RUNS_NINTERVAL];
++ u_int8_t c;
++
++ bzero(onei, sizeof(onei));
++ bzero(zeroi, sizeof(zeroi));
++ ones = zeros = 0;
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ c = rsp->rs_buf[i];
++ for (j = 0; j < 8; j++, c <<= 1) {
++ if (c & 0x80) {
++ ones++;
++ rndtest_runs_record(rsp, zeros, zeroi);
++ zeros = 0;
++ } else {
++ zeros++;
++ rndtest_runs_record(rsp, ones, onei);
++ ones = 0;
++ }
++ }
++ }
++ rndtest_runs_record(rsp, ones, onei);
++ rndtest_runs_record(rsp, zeros, zeroi);
++
++ rv |= rndtest_runs_check(rsp, 0, zeroi);
++ rv |= rndtest_runs_check(rsp, 1, onei);
++
++ if (rv)
++ rndstats.rst_runs++;
++
++ return (rv);
++}
++
++static void
++rndtest_runs_record(struct rndtest_state *rsp, int len, int *intrv)
++{
++ if (len == 0)
++ return;
++ if (len > RNDTEST_RUNS_NINTERVAL)
++ len = RNDTEST_RUNS_NINTERVAL;
++ len -= 1;
++ intrv[len]++;
++}
++
++static int
++rndtest_runs_check(struct rndtest_state *rsp, int val, int *src)
++{
++ int i, rv = 0;
++
++ for (i = 0; i < RNDTEST_RUNS_NINTERVAL; i++) {
++ if (src[i] < rndtest_runs_tab[i].min ||
++ src[i] > rndtest_runs_tab[i].max) {
++ rndtest_report(rsp, 1,
++ "%s interval %d failed (%d, %d-%d)",
++ val ? "ones" : "zeros",
++ i + 1, src[i], rndtest_runs_tab[i].min,
++ rndtest_runs_tab[i].max);
++ rv = -1;
++ } else {
++ rndtest_report(rsp, 0,
++ "runs pass %s interval %d (%d < %d < %d)",
++ val ? "ones" : "zeros",
++ i + 1, rndtest_runs_tab[i].min, src[i],
++ rndtest_runs_tab[i].max);
++ }
++ }
++ return (rv);
++}
++
++static int
++rndtest_longruns(struct rndtest_state *rsp)
++{
++ int i, j, ones = 0, zeros = 0, maxones = 0, maxzeros = 0;
++ u_int8_t c;
++
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ c = rsp->rs_buf[i];
++ for (j = 0; j < 8; j++, c <<= 1) {
++ if (c & 0x80) {
++ zeros = 0;
++ ones++;
++ if (ones > maxones)
++ maxones = ones;
++ } else {
++ ones = 0;
++ zeros++;
++ if (zeros > maxzeros)
++ maxzeros = zeros;
++ }
++ }
++ }
++
++ if (maxones < 26 && maxzeros < 26) {
++ rndtest_report(rsp, 0, "longruns pass (%d ones, %d zeros)",
++ maxones, maxzeros);
++ return (0);
++ } else {
++ rndtest_report(rsp, 1, "longruns fail (%d ones, %d zeros)",
++ maxones, maxzeros);
++ rndstats.rst_longruns++;
++ return (-1);
++ }
++}
++
++/*
++ * chi^2 test over 4 bits: (this is called the poker test in FIPS 140-2,
++ * but it is really the chi^2 test over 4 bits (the poker test as described
++ * by Knuth vol 2 is something different, and I take him as authoritative
++ * on nomenclature over NIST).
++ */
++#define RNDTEST_CHI4_K 16
++#define RNDTEST_CHI4_K_MASK (RNDTEST_CHI4_K - 1)
++
++/*
++ * The unnormalized values are used so that we don't have to worry about
++ * fractional precision. The "real" value is found by:
++ * (V - 1562500) * (16 / 5000) = Vn (where V is the unnormalized value)
++ */
++#define RNDTEST_CHI4_VMIN 1563181 /* 2.1792 */
++#define RNDTEST_CHI4_VMAX 1576929 /* 46.1728 */
++
++static int
++rndtest_chi_4(struct rndtest_state *rsp)
++{
++ unsigned int freq[RNDTEST_CHI4_K], i, sum;
++
++ for (i = 0; i < RNDTEST_CHI4_K; i++)
++ freq[i] = 0;
++
++ /* Get number of occurances of each 4 bit pattern */
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ freq[(rsp->rs_buf[i] >> 4) & RNDTEST_CHI4_K_MASK]++;
++ freq[(rsp->rs_buf[i] >> 0) & RNDTEST_CHI4_K_MASK]++;
++ }
++
++ for (i = 0, sum = 0; i < RNDTEST_CHI4_K; i++)
++ sum += freq[i] * freq[i];
++
++ if (sum >= 1563181 && sum <= 1576929) {
++ rndtest_report(rsp, 0, "chi^2(4): pass (sum %u)", sum);
++ return (0);
++ } else {
++ rndtest_report(rsp, 1, "chi^2(4): failed (sum %u)", sum);
++ rndstats.rst_chi++;
++ return (-1);
++ }
++}
++
++int
++rndtest_buf(unsigned char *buf)
++{
++ struct rndtest_state rsp;
++
++ memset(&rsp, 0, sizeof(rsp));
++ rsp.rs_buf = buf;
++ rndtest_test(&rsp);
++ return(rsp.rs_discard);
++}
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/rndtest.h linux-2.6.27.10/crypto/ocf/rndtest.h
+--- linux-2.6.27.10.orig/crypto/ocf/rndtest.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/rndtest.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,54 @@
++/* $FreeBSD: src/sys/dev/rndtest/rndtest.h,v 1.1 2003/03/11 22:54:44 sam Exp $ */
++/* $OpenBSD$ */
++
++/*
++ * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by Jason L. Wright
++ * 4. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
++ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
++
++/* Some of the tests depend on these values */
++#define RNDTEST_NBYTES 2500
++#define RNDTEST_NBITS (8 * RNDTEST_NBYTES)
++
++struct rndtest_state {
++ int rs_discard; /* discard/accept random data */
++ u_int8_t *rs_buf;
++};
++
++struct rndtest_stats {
++ u_int32_t rst_discard; /* number of bytes discarded */
++ u_int32_t rst_tests; /* number of test runs */
++ u_int32_t rst_monobit; /* monobit test failures */
++ u_int32_t rst_runs; /* 0/1 runs failures */
++ u_int32_t rst_longruns; /* longruns failures */
++ u_int32_t rst_chi; /* chi^2 failures */
++};
++
++extern int rndtest_buf(unsigned char *buf);
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/Makefile linux-2.6.27.10/crypto/ocf/safe/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/safe/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_SAFE) += safe.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/md5.c linux-2.6.27.10/crypto/ocf/safe/md5.c
+--- linux-2.6.27.10.orig/crypto/ocf/safe/md5.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/md5.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,308 @@
++/* $KAME: md5.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#if 0
++#include <sys/cdefs.h>
++__FBSDID("$FreeBSD: src/sys/crypto/md5.c,v 1.9 2004/01/27 19:49:19 des Exp $");
++
++#include <sys/types.h>
++#include <sys/cdefs.h>
++#include <sys/time.h>
++#include <sys/systm.h>
++#include <crypto/md5.h>
++#endif
++
++#define SHIFT(X, s) (((X) << (s)) | ((X) >> (32 - (s))))
++
++#define F(X, Y, Z) (((X) & (Y)) | ((~X) & (Z)))
++#define G(X, Y, Z) (((X) & (Z)) | ((Y) & (~Z)))
++#define H(X, Y, Z) ((X) ^ (Y) ^ (Z))
++#define I(X, Y, Z) ((Y) ^ ((X) | (~Z)))
++
++#define ROUND1(a, b, c, d, k, s, i) { \
++ (a) = (a) + F((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define ROUND2(a, b, c, d, k, s, i) { \
++ (a) = (a) + G((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define ROUND3(a, b, c, d, k, s, i) { \
++ (a) = (a) + H((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define ROUND4(a, b, c, d, k, s, i) { \
++ (a) = (a) + I((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define Sa 7
++#define Sb 12
++#define Sc 17
++#define Sd 22
++
++#define Se 5
++#define Sf 9
++#define Sg 14
++#define Sh 20
++
++#define Si 4
++#define Sj 11
++#define Sk 16
++#define Sl 23
++
++#define Sm 6
++#define Sn 10
++#define So 15
++#define Sp 21
++
++#define MD5_A0 0x67452301
++#define MD5_B0 0xefcdab89
++#define MD5_C0 0x98badcfe
++#define MD5_D0 0x10325476
++
++/* Integer part of 4294967296 times abs(sin(i)), where i is in radians. */
++static const u_int32_t T[65] = {
++ 0,
++ 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
++ 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
++ 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
++ 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
++
++ 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
++ 0xd62f105d, 0x2441453, 0xd8a1e681, 0xe7d3fbc8,
++ 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
++ 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
++
++ 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
++ 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
++ 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05,
++ 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
++
++ 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,
++ 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
++ 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
++ 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
++};
++
++static const u_int8_t md5_paddat[MD5_BUFLEN] = {
++ 0x80, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++};
++
++static void md5_calc(u_int8_t *, md5_ctxt *);
++
++void md5_init(ctxt)
++ md5_ctxt *ctxt;
++{
++ ctxt->md5_n = 0;
++ ctxt->md5_i = 0;
++ ctxt->md5_sta = MD5_A0;
++ ctxt->md5_stb = MD5_B0;
++ ctxt->md5_stc = MD5_C0;
++ ctxt->md5_std = MD5_D0;
++ bzero(ctxt->md5_buf, sizeof(ctxt->md5_buf));
++}
++
++void md5_loop(ctxt, input, len)
++ md5_ctxt *ctxt;
++ u_int8_t *input;
++ u_int len; /* number of bytes */
++{
++ u_int gap, i;
++
++ ctxt->md5_n += len * 8; /* byte to bit */
++ gap = MD5_BUFLEN - ctxt->md5_i;
++
++ if (len >= gap) {
++ bcopy((void *)input, (void *)(ctxt->md5_buf + ctxt->md5_i),
++ gap);
++ md5_calc(ctxt->md5_buf, ctxt);
++
++ for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN) {
++ md5_calc((u_int8_t *)(input + i), ctxt);
++ }
++
++ ctxt->md5_i = len - i;
++ bcopy((void *)(input + i), (void *)ctxt->md5_buf, ctxt->md5_i);
++ } else {
++ bcopy((void *)input, (void *)(ctxt->md5_buf + ctxt->md5_i),
++ len);
++ ctxt->md5_i += len;
++ }
++}
++
++void md5_pad(ctxt)
++ md5_ctxt *ctxt;
++{
++ u_int gap;
++
++ /* Don't count up padding. Keep md5_n. */
++ gap = MD5_BUFLEN - ctxt->md5_i;
++ if (gap > 8) {
++ bcopy(md5_paddat,
++ (void *)(ctxt->md5_buf + ctxt->md5_i),
++ gap - sizeof(ctxt->md5_n));
++ } else {
++ /* including gap == 8 */
++ bcopy(md5_paddat, (void *)(ctxt->md5_buf + ctxt->md5_i),
++ gap);
++ md5_calc(ctxt->md5_buf, ctxt);
++ bcopy((md5_paddat + gap),
++ (void *)ctxt->md5_buf,
++ MD5_BUFLEN - sizeof(ctxt->md5_n));
++ }
++
++ /* 8 byte word */
++#if BYTE_ORDER == LITTLE_ENDIAN
++ bcopy(&ctxt->md5_n8[0], &ctxt->md5_buf[56], 8);
++#endif
++#if BYTE_ORDER == BIG_ENDIAN
++ ctxt->md5_buf[56] = ctxt->md5_n8[7];
++ ctxt->md5_buf[57] = ctxt->md5_n8[6];
++ ctxt->md5_buf[58] = ctxt->md5_n8[5];
++ ctxt->md5_buf[59] = ctxt->md5_n8[4];
++ ctxt->md5_buf[60] = ctxt->md5_n8[3];
++ ctxt->md5_buf[61] = ctxt->md5_n8[2];
++ ctxt->md5_buf[62] = ctxt->md5_n8[1];
++ ctxt->md5_buf[63] = ctxt->md5_n8[0];
++#endif
++
++ md5_calc(ctxt->md5_buf, ctxt);
++}
++
++void md5_result(digest, ctxt)
++ u_int8_t *digest;
++ md5_ctxt *ctxt;
++{
++ /* 4 byte words */
++#if BYTE_ORDER == LITTLE_ENDIAN
++ bcopy(&ctxt->md5_st8[0], digest, 16);
++#endif
++#if BYTE_ORDER == BIG_ENDIAN
++ digest[ 0] = ctxt->md5_st8[ 3]; digest[ 1] = ctxt->md5_st8[ 2];
++ digest[ 2] = ctxt->md5_st8[ 1]; digest[ 3] = ctxt->md5_st8[ 0];
++ digest[ 4] = ctxt->md5_st8[ 7]; digest[ 5] = ctxt->md5_st8[ 6];
++ digest[ 6] = ctxt->md5_st8[ 5]; digest[ 7] = ctxt->md5_st8[ 4];
++ digest[ 8] = ctxt->md5_st8[11]; digest[ 9] = ctxt->md5_st8[10];
++ digest[10] = ctxt->md5_st8[ 9]; digest[11] = ctxt->md5_st8[ 8];
++ digest[12] = ctxt->md5_st8[15]; digest[13] = ctxt->md5_st8[14];
++ digest[14] = ctxt->md5_st8[13]; digest[15] = ctxt->md5_st8[12];
++#endif
++}
++
++static void md5_calc(b64, ctxt)
++ u_int8_t *b64;
++ md5_ctxt *ctxt;
++{
++ u_int32_t A = ctxt->md5_sta;
++ u_int32_t B = ctxt->md5_stb;
++ u_int32_t C = ctxt->md5_stc;
++ u_int32_t D = ctxt->md5_std;
++#if BYTE_ORDER == LITTLE_ENDIAN
++ u_int32_t *X = (u_int32_t *)b64;
++#endif
++#if BYTE_ORDER == BIG_ENDIAN
++ /* 4 byte words */
++ /* what a brute force but fast! */
++ u_int32_t X[16];
++ u_int8_t *y = (u_int8_t *)X;
++ y[ 0] = b64[ 3]; y[ 1] = b64[ 2]; y[ 2] = b64[ 1]; y[ 3] = b64[ 0];
++ y[ 4] = b64[ 7]; y[ 5] = b64[ 6]; y[ 6] = b64[ 5]; y[ 7] = b64[ 4];
++ y[ 8] = b64[11]; y[ 9] = b64[10]; y[10] = b64[ 9]; y[11] = b64[ 8];
++ y[12] = b64[15]; y[13] = b64[14]; y[14] = b64[13]; y[15] = b64[12];
++ y[16] = b64[19]; y[17] = b64[18]; y[18] = b64[17]; y[19] = b64[16];
++ y[20] = b64[23]; y[21] = b64[22]; y[22] = b64[21]; y[23] = b64[20];
++ y[24] = b64[27]; y[25] = b64[26]; y[26] = b64[25]; y[27] = b64[24];
++ y[28] = b64[31]; y[29] = b64[30]; y[30] = b64[29]; y[31] = b64[28];
++ y[32] = b64[35]; y[33] = b64[34]; y[34] = b64[33]; y[35] = b64[32];
++ y[36] = b64[39]; y[37] = b64[38]; y[38] = b64[37]; y[39] = b64[36];
++ y[40] = b64[43]; y[41] = b64[42]; y[42] = b64[41]; y[43] = b64[40];
++ y[44] = b64[47]; y[45] = b64[46]; y[46] = b64[45]; y[47] = b64[44];
++ y[48] = b64[51]; y[49] = b64[50]; y[50] = b64[49]; y[51] = b64[48];
++ y[52] = b64[55]; y[53] = b64[54]; y[54] = b64[53]; y[55] = b64[52];
++ y[56] = b64[59]; y[57] = b64[58]; y[58] = b64[57]; y[59] = b64[56];
++ y[60] = b64[63]; y[61] = b64[62]; y[62] = b64[61]; y[63] = b64[60];
++#endif
++
++ ROUND1(A, B, C, D, 0, Sa, 1); ROUND1(D, A, B, C, 1, Sb, 2);
++ ROUND1(C, D, A, B, 2, Sc, 3); ROUND1(B, C, D, A, 3, Sd, 4);
++ ROUND1(A, B, C, D, 4, Sa, 5); ROUND1(D, A, B, C, 5, Sb, 6);
++ ROUND1(C, D, A, B, 6, Sc, 7); ROUND1(B, C, D, A, 7, Sd, 8);
++ ROUND1(A, B, C, D, 8, Sa, 9); ROUND1(D, A, B, C, 9, Sb, 10);
++ ROUND1(C, D, A, B, 10, Sc, 11); ROUND1(B, C, D, A, 11, Sd, 12);
++ ROUND1(A, B, C, D, 12, Sa, 13); ROUND1(D, A, B, C, 13, Sb, 14);
++ ROUND1(C, D, A, B, 14, Sc, 15); ROUND1(B, C, D, A, 15, Sd, 16);
++
++ ROUND2(A, B, C, D, 1, Se, 17); ROUND2(D, A, B, C, 6, Sf, 18);
++ ROUND2(C, D, A, B, 11, Sg, 19); ROUND2(B, C, D, A, 0, Sh, 20);
++ ROUND2(A, B, C, D, 5, Se, 21); ROUND2(D, A, B, C, 10, Sf, 22);
++ ROUND2(C, D, A, B, 15, Sg, 23); ROUND2(B, C, D, A, 4, Sh, 24);
++ ROUND2(A, B, C, D, 9, Se, 25); ROUND2(D, A, B, C, 14, Sf, 26);
++ ROUND2(C, D, A, B, 3, Sg, 27); ROUND2(B, C, D, A, 8, Sh, 28);
++ ROUND2(A, B, C, D, 13, Se, 29); ROUND2(D, A, B, C, 2, Sf, 30);
++ ROUND2(C, D, A, B, 7, Sg, 31); ROUND2(B, C, D, A, 12, Sh, 32);
++
++ ROUND3(A, B, C, D, 5, Si, 33); ROUND3(D, A, B, C, 8, Sj, 34);
++ ROUND3(C, D, A, B, 11, Sk, 35); ROUND3(B, C, D, A, 14, Sl, 36);
++ ROUND3(A, B, C, D, 1, Si, 37); ROUND3(D, A, B, C, 4, Sj, 38);
++ ROUND3(C, D, A, B, 7, Sk, 39); ROUND3(B, C, D, A, 10, Sl, 40);
++ ROUND3(A, B, C, D, 13, Si, 41); ROUND3(D, A, B, C, 0, Sj, 42);
++ ROUND3(C, D, A, B, 3, Sk, 43); ROUND3(B, C, D, A, 6, Sl, 44);
++ ROUND3(A, B, C, D, 9, Si, 45); ROUND3(D, A, B, C, 12, Sj, 46);
++ ROUND3(C, D, A, B, 15, Sk, 47); ROUND3(B, C, D, A, 2, Sl, 48);
++
++ ROUND4(A, B, C, D, 0, Sm, 49); ROUND4(D, A, B, C, 7, Sn, 50);
++ ROUND4(C, D, A, B, 14, So, 51); ROUND4(B, C, D, A, 5, Sp, 52);
++ ROUND4(A, B, C, D, 12, Sm, 53); ROUND4(D, A, B, C, 3, Sn, 54);
++ ROUND4(C, D, A, B, 10, So, 55); ROUND4(B, C, D, A, 1, Sp, 56);
++ ROUND4(A, B, C, D, 8, Sm, 57); ROUND4(D, A, B, C, 15, Sn, 58);
++ ROUND4(C, D, A, B, 6, So, 59); ROUND4(B, C, D, A, 13, Sp, 60);
++ ROUND4(A, B, C, D, 4, Sm, 61); ROUND4(D, A, B, C, 11, Sn, 62);
++ ROUND4(C, D, A, B, 2, So, 63); ROUND4(B, C, D, A, 9, Sp, 64);
++
++ ctxt->md5_sta += A;
++ ctxt->md5_stb += B;
++ ctxt->md5_stc += C;
++ ctxt->md5_std += D;
++}
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/md5.h linux-2.6.27.10/crypto/ocf/safe/md5.h
+--- linux-2.6.27.10.orig/crypto/ocf/safe/md5.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/md5.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,76 @@
++/* $FreeBSD: src/sys/crypto/md5.h,v 1.4 2002/03/20 05:13:50 alfred Exp $ */
++/* $KAME: md5.h,v 1.4 2000/03/27 04:36:22 sumikawa Exp $ */
++
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#ifndef _NETINET6_MD5_H_
++#define _NETINET6_MD5_H_
++
++#define MD5_BUFLEN 64
++
++typedef struct {
++ union {
++ u_int32_t md5_state32[4];
++ u_int8_t md5_state8[16];
++ } md5_st;
++
++#define md5_sta md5_st.md5_state32[0]
++#define md5_stb md5_st.md5_state32[1]
++#define md5_stc md5_st.md5_state32[2]
++#define md5_std md5_st.md5_state32[3]
++#define md5_st8 md5_st.md5_state8
++
++ union {
++ u_int64_t md5_count64;
++ u_int8_t md5_count8[8];
++ } md5_count;
++#define md5_n md5_count.md5_count64
++#define md5_n8 md5_count.md5_count8
++
++ u_int md5_i;
++ u_int8_t md5_buf[MD5_BUFLEN];
++} md5_ctxt;
++
++extern void md5_init(md5_ctxt *);
++extern void md5_loop(md5_ctxt *, u_int8_t *, u_int);
++extern void md5_pad(md5_ctxt *);
++extern void md5_result(u_int8_t *, md5_ctxt *);
++
++/* compatibility */
++#define MD5_CTX md5_ctxt
++#define MD5Init(x) md5_init((x))
++#define MD5Update(x, y, z) md5_loop((x), (y), (z))
++#define MD5Final(x, y) \
++do { \
++ md5_pad((y)); \
++ md5_result((x), (y)); \
++} while (0)
++
++#endif /* ! _NETINET6_MD5_H_*/
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/safe.c linux-2.6.27.10/crypto/ocf/safe/safe.c
+--- linux-2.6.27.10.orig/crypto/ocf/safe/safe.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/safe.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,2288 @@
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2004-2007 David McCullough
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2003 Sam Leffler, Errno Consulting
++ * Copyright (c) 2003 Global Technology Associates, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++__FBSDID("$FreeBSD: src/sys/dev/safe/safe.c,v 1.18 2007/03/21 03:42:50 sam Exp $");
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/version.h>
++#include <linux/skbuff.h>
++#include <asm/io.h>
++
++/*
++ * SafeNet SafeXcel-1141 hardware crypto accelerator
++ */
++
++#include <cryptodev.h>
++#include <uio.h>
++#include <safe/safereg.h>
++#include <safe/safevar.h>
++
++#if 1
++#define DPRINTF(a) do { \
++ if (debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_dev) : "safe"); \
++ printk a; \
++ } \
++ } while (0)
++#else
++#define DPRINTF(a)
++#endif
++
++/*
++ * until we find a cleaner way, include the BSD md5/sha1 code
++ * here
++ */
++#define HMAC_HACK 1
++#ifdef HMAC_HACK
++#define LITTLE_ENDIAN 1234
++#define BIG_ENDIAN 4321
++#ifdef __LITTLE_ENDIAN
++#define BYTE_ORDER LITTLE_ENDIAN
++#endif
++#ifdef __BIG_ENDIAN
++#define BYTE_ORDER BIG_ENDIAN
++#endif
++#include <safe/md5.h>
++#include <safe/md5.c>
++#include <safe/sha1.h>
++#include <safe/sha1.c>
++
++u_int8_t hmac_ipad_buffer[64] = {
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36
++};
++
++u_int8_t hmac_opad_buffer[64] = {
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C
++};
++#endif /* HMAC_HACK */
++
++/* add proc entry for this */
++struct safe_stats safestats;
++
++#define debug safe_debug
++int safe_debug = 0;
++module_param(safe_debug, int, 0644);
++MODULE_PARM_DESC(safe_debug, "Enable debug");
++
++static void safe_callback(struct safe_softc *, struct safe_ringentry *);
++static void safe_feed(struct safe_softc *, struct safe_ringentry *);
++#if defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG)
++static void safe_rng_init(struct safe_softc *);
++int safe_rngbufsize = 8; /* 32 bytes each read */
++module_param(safe_rngbufsize, int, 0644);
++MODULE_PARM_DESC(safe_rngbufsize, "RNG polling buffer size (32-bit words)");
++int safe_rngmaxalarm = 8; /* max alarms before reset */
++module_param(safe_rngmaxalarm, int, 0644);
++MODULE_PARM_DESC(safe_rngmaxalarm, "RNG max alarms before reset");
++#endif /* SAFE_NO_RNG */
++
++static void safe_totalreset(struct safe_softc *sc);
++static int safe_dmamap_aligned(struct safe_softc *sc, const struct safe_operand *op);
++static int safe_dmamap_uniform(struct safe_softc *sc, const struct safe_operand *op);
++static int safe_free_entry(struct safe_softc *sc, struct safe_ringentry *re);
++static int safe_kprocess(device_t dev, struct cryptkop *krp, int hint);
++static int safe_kstart(struct safe_softc *sc);
++static int safe_ksigbits(struct safe_softc *sc, struct crparam *cr);
++static void safe_kfeed(struct safe_softc *sc);
++static void safe_kpoll(unsigned long arg);
++static void safe_kload_reg(struct safe_softc *sc, u_int32_t off,
++ u_int32_t len, struct crparam *n);
++
++static int safe_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int safe_freesession(device_t, u_int64_t);
++static int safe_process(device_t, struct cryptop *, int);
++
++static device_method_t safe_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, safe_newsession),
++ DEVMETHOD(cryptodev_freesession,safe_freesession),
++ DEVMETHOD(cryptodev_process, safe_process),
++ DEVMETHOD(cryptodev_kprocess, safe_kprocess),
++};
++
++#define READ_REG(sc,r) readl((sc)->sc_base_addr + (r))
++#define WRITE_REG(sc,r,val) writel((val), (sc)->sc_base_addr + (r))
++
++#define SAFE_MAX_CHIPS 8
++static struct safe_softc *safe_chip_idx[SAFE_MAX_CHIPS];
++
++/*
++ * split our buffers up into safe DMAable byte fragments to avoid lockup
++ * bug in 1141 HW on rev 1.0.
++ */
++
++static int
++pci_map_linear(
++ struct safe_softc *sc,
++ struct safe_operand *buf,
++ void *addr,
++ int len)
++{
++ dma_addr_t tmp;
++ int chunk, tlen = len;
++
++ tmp = pci_map_single(sc->sc_pcidev, addr, len, PCI_DMA_BIDIRECTIONAL);
++
++ buf->mapsize += len;
++ while (len > 0) {
++ chunk = (len > sc->sc_max_dsize) ? sc->sc_max_dsize : len;
++ buf->segs[buf->nsegs].ds_addr = tmp;
++ buf->segs[buf->nsegs].ds_len = chunk;
++ buf->segs[buf->nsegs].ds_tlen = tlen;
++ buf->nsegs++;
++ tmp += chunk;
++ len -= chunk;
++ tlen = 0;
++ }
++ return 0;
++}
++
++/*
++ * map in a given uio buffer (great on some arches :-)
++ */
++
++static int
++pci_map_uio(struct safe_softc *sc, struct safe_operand *buf, struct uio *uio)
++{
++ struct iovec *iov = uio->uio_iov;
++ int n;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ buf->mapsize = 0;
++ buf->nsegs = 0;
++
++ for (n = 0; n < uio->uio_iovcnt; n++) {
++ pci_map_linear(sc, buf, iov->iov_base, iov->iov_len);
++ iov++;
++ }
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++/*
++ * map in a given sk_buff
++ */
++
++static int
++pci_map_skb(struct safe_softc *sc,struct safe_operand *buf,struct sk_buff *skb)
++{
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ buf->mapsize = 0;
++ buf->nsegs = 0;
++
++ pci_map_linear(sc, buf, skb->data, skb_headlen(skb));
++
++ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
++ pci_map_linear(sc, buf,
++ page_address(skb_shinfo(skb)->frags[i].page) +
++ skb_shinfo(skb)->frags[i].page_offset,
++ skb_shinfo(skb)->frags[i].size);
++ }
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++
++#if 0 /* not needed at this time */
++static void
++pci_sync_operand(struct safe_softc *sc, struct safe_operand *buf)
++{
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++ for (i = 0; i < buf->nsegs; i++)
++ pci_dma_sync_single_for_cpu(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_len, PCI_DMA_BIDIRECTIONAL);
++}
++#endif
++
++static void
++pci_unmap_operand(struct safe_softc *sc, struct safe_operand *buf)
++{
++ int i;
++ DPRINTF(("%s()\n", __FUNCTION__));
++ for (i = 0; i < buf->nsegs; i++) {
++ if (buf->segs[i].ds_tlen) {
++ DPRINTF(("%s - unmap %d 0x%x %d\n", __FUNCTION__, i, buf->segs[i].ds_addr, buf->segs[i].ds_tlen));
++ pci_unmap_single(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_tlen, PCI_DMA_BIDIRECTIONAL);
++ DPRINTF(("%s - unmap %d 0x%x %d done\n", __FUNCTION__, i, buf->segs[i].ds_addr, buf->segs[i].ds_tlen));
++ }
++ buf->segs[i].ds_addr = 0;
++ buf->segs[i].ds_len = 0;
++ buf->segs[i].ds_tlen = 0;
++ }
++ buf->nsegs = 0;
++ buf->mapsize = 0;
++ buf->map = 0;
++}
++
++
++/*
++ * SafeXcel Interrupt routine
++ */
++static irqreturn_t
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++safe_intr(int irq, void *arg)
++#else
++safe_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct safe_softc *sc = arg;
++ int stat;
++ unsigned long flags;
++
++ stat = READ_REG(sc, SAFE_HM_STAT);
++
++ DPRINTF(("%s(stat=0x%x)\n", __FUNCTION__, stat));
++
++ if (stat == 0) /* shared irq, not for us */
++ return IRQ_NONE;
++
++ WRITE_REG(sc, SAFE_HI_CLR, stat); /* IACK */
++
++ if ((stat & SAFE_INT_PE_DDONE)) {
++ /*
++ * Descriptor(s) done; scan the ring and
++ * process completed operations.
++ */
++ spin_lock_irqsave(&sc->sc_ringmtx, flags);
++ while (sc->sc_back != sc->sc_front) {
++ struct safe_ringentry *re = sc->sc_back;
++
++#ifdef SAFE_DEBUG
++ if (debug) {
++ safe_dump_ringstate(sc, __func__);
++ safe_dump_request(sc, __func__, re);
++ }
++#endif
++ /*
++ * safe_process marks ring entries that were allocated
++ * but not used with a csr of zero. This insures the
++ * ring front pointer never needs to be set backwards
++ * in the event that an entry is allocated but not used
++ * because of a setup error.
++ */
++ DPRINTF(("%s re->re_desc.d_csr=0x%x\n", __FUNCTION__, re->re_desc.d_csr));
++ if (re->re_desc.d_csr != 0) {
++ if (!SAFE_PE_CSR_IS_DONE(re->re_desc.d_csr)) {
++ DPRINTF(("%s !CSR_IS_DONE\n", __FUNCTION__));
++ break;
++ }
++ if (!SAFE_PE_LEN_IS_DONE(re->re_desc.d_len)) {
++ DPRINTF(("%s !LEN_IS_DONE\n", __FUNCTION__));
++ break;
++ }
++ sc->sc_nqchip--;
++ safe_callback(sc, re);
++ }
++ if (++(sc->sc_back) == sc->sc_ringtop)
++ sc->sc_back = sc->sc_ring;
++ }
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ }
++
++ /*
++ * Check to see if we got any DMA Error
++ */
++ if (stat & SAFE_INT_PE_ERROR) {
++ printk("%s: dmaerr dmastat %08x\n", device_get_nameunit(sc->sc_dev),
++ (int)READ_REG(sc, SAFE_PE_DMASTAT));
++ safestats.st_dmaerr++;
++ safe_totalreset(sc);
++#if 0
++ safe_feed(sc);
++#endif
++ }
++
++ if (sc->sc_needwakeup) { /* XXX check high watermark */
++ int wakeup = sc->sc_needwakeup & (CRYPTO_SYMQ|CRYPTO_ASYMQ);
++ DPRINTF(("%s: wakeup crypto %x\n", __func__,
++ sc->sc_needwakeup));
++ sc->sc_needwakeup &= ~wakeup;
++ crypto_unblock(sc->sc_cid, wakeup);
++ }
++
++ return IRQ_HANDLED;
++}
++
++/*
++ * safe_feed() - post a request to chip
++ */
++static void
++safe_feed(struct safe_softc *sc, struct safe_ringentry *re)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++#ifdef SAFE_DEBUG
++ if (debug) {
++ safe_dump_ringstate(sc, __func__);
++ safe_dump_request(sc, __func__, re);
++ }
++#endif
++ sc->sc_nqchip++;
++ if (sc->sc_nqchip > safestats.st_maxqchip)
++ safestats.st_maxqchip = sc->sc_nqchip;
++ /* poke h/w to check descriptor ring, any value can be written */
++ WRITE_REG(sc, SAFE_HI_RD_DESCR, 0);
++}
++
++#define N(a) (sizeof(a) / sizeof (a[0]))
++static void
++safe_setup_enckey(struct safe_session *ses, caddr_t key)
++{
++ int i;
++
++ bcopy(key, ses->ses_key, ses->ses_klen / 8);
++
++ /* PE is little-endian, insure proper byte order */
++ for (i = 0; i < N(ses->ses_key); i++)
++ ses->ses_key[i] = htole32(ses->ses_key[i]);
++}
++
++static void
++safe_setup_mackey(struct safe_session *ses, int algo, caddr_t key, int klen)
++{
++#ifdef HMAC_HACK
++ MD5_CTX md5ctx;
++ SHA1_CTX sha1ctx;
++ int i;
++
++
++ for (i = 0; i < klen; i++)
++ key[i] ^= HMAC_IPAD_VAL;
++
++ if (algo == CRYPTO_MD5_HMAC) {
++ MD5Init(&md5ctx);
++ MD5Update(&md5ctx, key, klen);
++ MD5Update(&md5ctx, hmac_ipad_buffer, MD5_HMAC_BLOCK_LEN - klen);
++ bcopy(md5ctx.md5_st8, ses->ses_hminner, sizeof(md5ctx.md5_st8));
++ } else {
++ SHA1Init(&sha1ctx);
++ SHA1Update(&sha1ctx, key, klen);
++ SHA1Update(&sha1ctx, hmac_ipad_buffer,
++ SHA1_HMAC_BLOCK_LEN - klen);
++ bcopy(sha1ctx.h.b32, ses->ses_hminner, sizeof(sha1ctx.h.b32));
++ }
++
++ for (i = 0; i < klen; i++)
++ key[i] ^= (HMAC_IPAD_VAL ^ HMAC_OPAD_VAL);
++
++ if (algo == CRYPTO_MD5_HMAC) {
++ MD5Init(&md5ctx);
++ MD5Update(&md5ctx, key, klen);
++ MD5Update(&md5ctx, hmac_opad_buffer, MD5_HMAC_BLOCK_LEN - klen);
++ bcopy(md5ctx.md5_st8, ses->ses_hmouter, sizeof(md5ctx.md5_st8));
++ } else {
++ SHA1Init(&sha1ctx);
++ SHA1Update(&sha1ctx, key, klen);
++ SHA1Update(&sha1ctx, hmac_opad_buffer,
++ SHA1_HMAC_BLOCK_LEN - klen);
++ bcopy(sha1ctx.h.b32, ses->ses_hmouter, sizeof(sha1ctx.h.b32));
++ }
++
++ for (i = 0; i < klen; i++)
++ key[i] ^= HMAC_OPAD_VAL;
++
++#if 0
++ /*
++ * this code prevents SHA working on a BE host,
++ * so it is obviously wrong. I think the byte
++ * swap setup we do with the chip fixes this for us
++ */
++
++ /* PE is little-endian, insure proper byte order */
++ for (i = 0; i < N(ses->ses_hminner); i++) {
++ ses->ses_hminner[i] = htole32(ses->ses_hminner[i]);
++ ses->ses_hmouter[i] = htole32(ses->ses_hmouter[i]);
++ }
++#endif
++#else /* HMAC_HACK */
++ printk("safe: md5/sha not implemented\n");
++#endif /* HMAC_HACK */
++}
++#undef N
++
++/*
++ * Allocate a new 'session' and return an encoded session id. 'sidp'
++ * contains our registration id, and should contain an encoded session
++ * id on successful allocation.
++ */
++static int
++safe_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ struct cryptoini *c, *encini = NULL, *macini = NULL;
++ struct safe_session *ses = NULL;
++ int sesn;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sidp == NULL || cri == NULL || sc == NULL)
++ return (EINVAL);
++
++ for (c = cri; c != NULL; c = c->cri_next) {
++ if (c->cri_alg == CRYPTO_MD5_HMAC ||
++ c->cri_alg == CRYPTO_SHA1_HMAC ||
++ c->cri_alg == CRYPTO_NULL_HMAC) {
++ if (macini)
++ return (EINVAL);
++ macini = c;
++ } else if (c->cri_alg == CRYPTO_DES_CBC ||
++ c->cri_alg == CRYPTO_3DES_CBC ||
++ c->cri_alg == CRYPTO_AES_CBC ||
++ c->cri_alg == CRYPTO_NULL_CBC) {
++ if (encini)
++ return (EINVAL);
++ encini = c;
++ } else
++ return (EINVAL);
++ }
++ if (encini == NULL && macini == NULL)
++ return (EINVAL);
++ if (encini) { /* validate key length */
++ switch (encini->cri_alg) {
++ case CRYPTO_DES_CBC:
++ if (encini->cri_klen != 64)
++ return (EINVAL);
++ break;
++ case CRYPTO_3DES_CBC:
++ if (encini->cri_klen != 192)
++ return (EINVAL);
++ break;
++ case CRYPTO_AES_CBC:
++ if (encini->cri_klen != 128 &&
++ encini->cri_klen != 192 &&
++ encini->cri_klen != 256)
++ return (EINVAL);
++ break;
++ }
++ }
++
++ if (sc->sc_sessions == NULL) {
++ ses = sc->sc_sessions = (struct safe_session *)
++ kmalloc(sizeof(struct safe_session), SLAB_ATOMIC);
++ if (ses == NULL)
++ return (ENOMEM);
++ memset(ses, 0, sizeof(struct safe_session));
++ sesn = 0;
++ sc->sc_nsessions = 1;
++ } else {
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (sc->sc_sessions[sesn].ses_used == 0) {
++ ses = &sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ sesn = sc->sc_nsessions;
++ ses = (struct safe_session *)
++ kmalloc((sesn + 1) * sizeof(struct safe_session), SLAB_ATOMIC);
++ if (ses == NULL)
++ return (ENOMEM);
++ memset(ses, 0, (sesn + 1) * sizeof(struct safe_session));
++ bcopy(sc->sc_sessions, ses, sesn *
++ sizeof(struct safe_session));
++ bzero(sc->sc_sessions, sesn *
++ sizeof(struct safe_session));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = ses;
++ ses = &sc->sc_sessions[sesn];
++ sc->sc_nsessions++;
++ }
++ }
++
++ bzero(ses, sizeof(struct safe_session));
++ ses->ses_used = 1;
++
++ if (encini) {
++ /* get an IV */
++ /* XXX may read fewer than requested */
++ read_random(ses->ses_iv, sizeof(ses->ses_iv));
++
++ ses->ses_klen = encini->cri_klen;
++ if (encini->cri_key != NULL)
++ safe_setup_enckey(ses, encini->cri_key);
++ }
++
++ if (macini) {
++ ses->ses_mlen = macini->cri_mlen;
++ if (ses->ses_mlen == 0) {
++ if (macini->cri_alg == CRYPTO_MD5_HMAC)
++ ses->ses_mlen = MD5_HASH_LEN;
++ else
++ ses->ses_mlen = SHA1_HASH_LEN;
++ }
++
++ if (macini->cri_key != NULL) {
++ safe_setup_mackey(ses, macini->cri_alg, macini->cri_key,
++ macini->cri_klen / 8);
++ }
++ }
++
++ *sidp = SAFE_SID(device_get_unit(sc->sc_dev), sesn);
++ return (0);
++}
++
++/*
++ * Deallocate a session.
++ */
++static int
++safe_freesession(device_t dev, u_int64_t tid)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ int session, ret;
++ u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sc == NULL)
++ return (EINVAL);
++
++ session = SAFE_SESSION(sid);
++ if (session < sc->sc_nsessions) {
++ bzero(&sc->sc_sessions[session], sizeof(sc->sc_sessions[session]));
++ ret = 0;
++ } else
++ ret = EINVAL;
++ return (ret);
++}
++
++
++static int
++safe_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ int err = 0, i, nicealign, uniform;
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++ int bypass, oplen, ivsize;
++ caddr_t iv;
++ int16_t coffset;
++ struct safe_session *ses;
++ struct safe_ringentry *re;
++ struct safe_sarec *sa;
++ struct safe_pdesc *pd;
++ u_int32_t cmd0, cmd1, staterec;
++ unsigned long flags;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (crp == NULL || crp->crp_callback == NULL || sc == NULL) {
++ safestats.st_invalid++;
++ return (EINVAL);
++ }
++ if (SAFE_SESSION(crp->crp_sid) >= sc->sc_nsessions) {
++ safestats.st_badsession++;
++ return (EINVAL);
++ }
++
++ spin_lock_irqsave(&sc->sc_ringmtx, flags);
++ if (sc->sc_front == sc->sc_back && sc->sc_nqchip != 0) {
++ safestats.st_ringfull++;
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ return (ERESTART);
++ }
++ re = sc->sc_front;
++
++ staterec = re->re_sa.sa_staterec; /* save */
++ /* NB: zero everything but the PE descriptor */
++ bzero(&re->re_sa, sizeof(struct safe_ringentry) - sizeof(re->re_desc));
++ re->re_sa.sa_staterec = staterec; /* restore */
++
++ re->re_crp = crp;
++ re->re_sesn = SAFE_SESSION(crp->crp_sid);
++
++ re->re_src.nsegs = 0;
++ re->re_dst.nsegs = 0;
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ re->re_src_skb = (struct sk_buff *)crp->crp_buf;
++ re->re_dst_skb = (struct sk_buff *)crp->crp_buf;
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ re->re_src_io = (struct uio *)crp->crp_buf;
++ re->re_dst_io = (struct uio *)crp->crp_buf;
++ } else {
++ safestats.st_badflags++;
++ err = EINVAL;
++ goto errout; /* XXX we don't handle contiguous blocks! */
++ }
++
++ sa = &re->re_sa;
++ ses = &sc->sc_sessions[re->re_sesn];
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ safestats.st_nodesc++;
++ err = EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++
++ cmd0 = SAFE_SA_CMD0_BASIC; /* basic group operation */
++ cmd1 = 0;
++ if (crd2 == NULL) {
++ if (crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_NULL_HMAC) {
++ maccrd = crd1;
++ enccrd = NULL;
++ cmd0 |= SAFE_SA_CMD0_OP_HASH;
++ } else if (crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_NULL_CBC) {
++ maccrd = NULL;
++ enccrd = crd1;
++ cmd0 |= SAFE_SA_CMD0_OP_CRYPT;
++ } else {
++ safestats.st_badalg++;
++ err = EINVAL;
++ goto errout;
++ }
++ } else {
++ if ((crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_NULL_HMAC) &&
++ (crd2->crd_alg == CRYPTO_DES_CBC ||
++ crd2->crd_alg == CRYPTO_3DES_CBC ||
++ crd2->crd_alg == CRYPTO_AES_CBC ||
++ crd2->crd_alg == CRYPTO_NULL_CBC) &&
++ ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) {
++ maccrd = crd1;
++ enccrd = crd2;
++ } else if ((crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_NULL_CBC) &&
++ (crd2->crd_alg == CRYPTO_MD5_HMAC ||
++ crd2->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd2->crd_alg == CRYPTO_NULL_HMAC) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT)) {
++ enccrd = crd1;
++ maccrd = crd2;
++ } else {
++ safestats.st_badalg++;
++ err = EINVAL;
++ goto errout;
++ }
++ cmd0 |= SAFE_SA_CMD0_OP_BOTH;
++ }
++
++ if (enccrd) {
++ if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT)
++ safe_setup_enckey(ses, enccrd->crd_key);
++
++ if (enccrd->crd_alg == CRYPTO_DES_CBC) {
++ cmd0 |= SAFE_SA_CMD0_DES;
++ cmd1 |= SAFE_SA_CMD1_CBC;
++ ivsize = 2*sizeof(u_int32_t);
++ } else if (enccrd->crd_alg == CRYPTO_3DES_CBC) {
++ cmd0 |= SAFE_SA_CMD0_3DES;
++ cmd1 |= SAFE_SA_CMD1_CBC;
++ ivsize = 2*sizeof(u_int32_t);
++ } else if (enccrd->crd_alg == CRYPTO_AES_CBC) {
++ cmd0 |= SAFE_SA_CMD0_AES;
++ cmd1 |= SAFE_SA_CMD1_CBC;
++ if (ses->ses_klen == 128)
++ cmd1 |= SAFE_SA_CMD1_AES128;
++ else if (ses->ses_klen == 192)
++ cmd1 |= SAFE_SA_CMD1_AES192;
++ else
++ cmd1 |= SAFE_SA_CMD1_AES256;
++ ivsize = 4*sizeof(u_int32_t);
++ } else {
++ cmd0 |= SAFE_SA_CMD0_CRYPT_NULL;
++ ivsize = 0;
++ }
++
++ /*
++ * Setup encrypt/decrypt state. When using basic ops
++ * we can't use an inline IV because hash/crypt offset
++ * must be from the end of the IV to the start of the
++ * crypt data and this leaves out the preceding header
++ * from the hash calculation. Instead we place the IV
++ * in the state record and set the hash/crypt offset to
++ * copy both the header+IV.
++ */
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ cmd0 |= SAFE_SA_CMD0_OUTBOUND;
++
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ iv = enccrd->crd_iv;
++ else
++ iv = (caddr_t) ses->ses_iv;
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, iv);
++ }
++ bcopy(iv, re->re_sastate.sa_saved_iv, ivsize);
++ /* make iv LE */
++ for (i = 0; i < ivsize/sizeof(re->re_sastate.sa_saved_iv[0]); i++)
++ re->re_sastate.sa_saved_iv[i] =
++ cpu_to_le32(re->re_sastate.sa_saved_iv[i]);
++ cmd0 |= SAFE_SA_CMD0_IVLD_STATE | SAFE_SA_CMD0_SAVEIV;
++ re->re_flags |= SAFE_QFLAGS_COPYOUTIV;
++ } else {
++ cmd0 |= SAFE_SA_CMD0_INBOUND;
++
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT) {
++ bcopy(enccrd->crd_iv,
++ re->re_sastate.sa_saved_iv, ivsize);
++ } else {
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize,
++ (caddr_t)re->re_sastate.sa_saved_iv);
++ }
++ /* make iv LE */
++ for (i = 0; i < ivsize/sizeof(re->re_sastate.sa_saved_iv[0]); i++)
++ re->re_sastate.sa_saved_iv[i] =
++ cpu_to_le32(re->re_sastate.sa_saved_iv[i]);
++ cmd0 |= SAFE_SA_CMD0_IVLD_STATE;
++ }
++ /*
++ * For basic encryption use the zero pad algorithm.
++ * This pads results to an 8-byte boundary and
++ * suppresses padding verification for inbound (i.e.
++ * decrypt) operations.
++ *
++ * NB: Not sure if the 8-byte pad boundary is a problem.
++ */
++ cmd0 |= SAFE_SA_CMD0_PAD_ZERO;
++
++ /* XXX assert key bufs have the same size */
++ bcopy(ses->ses_key, sa->sa_key, sizeof(sa->sa_key));
++ }
++
++ if (maccrd) {
++ if (maccrd->crd_flags & CRD_F_KEY_EXPLICIT) {
++ safe_setup_mackey(ses, maccrd->crd_alg,
++ maccrd->crd_key, maccrd->crd_klen / 8);
++ }
++
++ if (maccrd->crd_alg == CRYPTO_MD5_HMAC) {
++ cmd0 |= SAFE_SA_CMD0_MD5;
++ cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */
++ } else if (maccrd->crd_alg == CRYPTO_SHA1_HMAC) {
++ cmd0 |= SAFE_SA_CMD0_SHA1;
++ cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */
++ } else {
++ cmd0 |= SAFE_SA_CMD0_HASH_NULL;
++ }
++ /*
++ * Digest data is loaded from the SA and the hash
++ * result is saved to the state block where we
++ * retrieve it for return to the caller.
++ */
++ /* XXX assert digest bufs have the same size */
++ bcopy(ses->ses_hminner, sa->sa_indigest,
++ sizeof(sa->sa_indigest));
++ bcopy(ses->ses_hmouter, sa->sa_outdigest,
++ sizeof(sa->sa_outdigest));
++
++ cmd0 |= SAFE_SA_CMD0_HSLD_SA | SAFE_SA_CMD0_SAVEHASH;
++ re->re_flags |= SAFE_QFLAGS_COPYOUTICV;
++ }
++
++ if (enccrd && maccrd) {
++ /*
++ * The offset from hash data to the start of
++ * crypt data is the difference in the skips.
++ */
++ bypass = maccrd->crd_skip;
++ coffset = enccrd->crd_skip - maccrd->crd_skip;
++ if (coffset < 0) {
++ DPRINTF(("%s: hash does not precede crypt; "
++ "mac skip %u enc skip %u\n",
++ __func__, maccrd->crd_skip, enccrd->crd_skip));
++ safestats.st_skipmismatch++;
++ err = EINVAL;
++ goto errout;
++ }
++ oplen = enccrd->crd_skip + enccrd->crd_len;
++ if (maccrd->crd_skip + maccrd->crd_len != oplen) {
++ DPRINTF(("%s: hash amount %u != crypt amount %u\n",
++ __func__, maccrd->crd_skip + maccrd->crd_len,
++ oplen));
++ safestats.st_lenmismatch++;
++ err = EINVAL;
++ goto errout;
++ }
++#ifdef SAFE_DEBUG
++ if (debug) {
++ printf("mac: skip %d, len %d, inject %d\n",
++ maccrd->crd_skip, maccrd->crd_len,
++ maccrd->crd_inject);
++ printf("enc: skip %d, len %d, inject %d\n",
++ enccrd->crd_skip, enccrd->crd_len,
++ enccrd->crd_inject);
++ printf("bypass %d coffset %d oplen %d\n",
++ bypass, coffset, oplen);
++ }
++#endif
++ if (coffset & 3) { /* offset must be 32-bit aligned */
++ DPRINTF(("%s: coffset %u misaligned\n",
++ __func__, coffset));
++ safestats.st_coffmisaligned++;
++ err = EINVAL;
++ goto errout;
++ }
++ coffset >>= 2;
++ if (coffset > 255) { /* offset must be <256 dwords */
++ DPRINTF(("%s: coffset %u too big\n",
++ __func__, coffset));
++ safestats.st_cofftoobig++;
++ err = EINVAL;
++ goto errout;
++ }
++ /*
++ * Tell the hardware to copy the header to the output.
++ * The header is defined as the data from the end of
++ * the bypass to the start of data to be encrypted.
++ * Typically this is the inline IV. Note that you need
++ * to do this even if src+dst are the same; it appears
++ * that w/o this bit the crypted data is written
++ * immediately after the bypass data.
++ */
++ cmd1 |= SAFE_SA_CMD1_HDRCOPY;
++ /*
++ * Disable IP header mutable bit handling. This is
++ * needed to get correct HMAC calculations.
++ */
++ cmd1 |= SAFE_SA_CMD1_MUTABLE;
++ } else {
++ if (enccrd) {
++ bypass = enccrd->crd_skip;
++ oplen = bypass + enccrd->crd_len;
++ } else {
++ bypass = maccrd->crd_skip;
++ oplen = bypass + maccrd->crd_len;
++ }
++ coffset = 0;
++ }
++ /* XXX verify multiple of 4 when using s/g */
++ if (bypass > 96) { /* bypass offset must be <= 96 bytes */
++ DPRINTF(("%s: bypass %u too big\n", __func__, bypass));
++ safestats.st_bypasstoobig++;
++ err = EINVAL;
++ goto errout;
++ }
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (pci_map_skb(sc, &re->re_src, re->re_src_skb)) {
++ safestats.st_noload++;
++ err = ENOMEM;
++ goto errout;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ if (pci_map_uio(sc, &re->re_src, re->re_src_io)) {
++ safestats.st_noload++;
++ err = ENOMEM;
++ goto errout;
++ }
++ }
++ nicealign = safe_dmamap_aligned(sc, &re->re_src);
++ uniform = safe_dmamap_uniform(sc, &re->re_src);
++
++ DPRINTF(("src nicealign %u uniform %u nsegs %u\n",
++ nicealign, uniform, re->re_src.nsegs));
++ if (re->re_src.nsegs > 1) {
++ re->re_desc.d_src = sc->sc_spalloc.dma_paddr +
++ ((caddr_t) sc->sc_spfree - (caddr_t) sc->sc_spring);
++ for (i = 0; i < re->re_src_nsegs; i++) {
++ /* NB: no need to check if there's space */
++ pd = sc->sc_spfree;
++ if (++(sc->sc_spfree) == sc->sc_springtop)
++ sc->sc_spfree = sc->sc_spring;
++
++ KASSERT((pd->pd_flags&3) == 0 ||
++ (pd->pd_flags&3) == SAFE_PD_DONE,
++ ("bogus source particle descriptor; flags %x",
++ pd->pd_flags));
++ pd->pd_addr = re->re_src_segs[i].ds_addr;
++ pd->pd_size = re->re_src_segs[i].ds_len;
++ pd->pd_flags = SAFE_PD_READY;
++ }
++ cmd0 |= SAFE_SA_CMD0_IGATHER;
++ } else {
++ /*
++ * No need for gather, reference the operand directly.
++ */
++ re->re_desc.d_src = re->re_src_segs[0].ds_addr;
++ }
++
++ if (enccrd == NULL && maccrd != NULL) {
++ /*
++ * Hash op; no destination needed.
++ */
++ } else {
++ if (crp->crp_flags & (CRYPTO_F_IOV|CRYPTO_F_SKBUF)) {
++ if (!nicealign) {
++ safestats.st_iovmisaligned++;
++ err = EINVAL;
++ goto errout;
++ }
++ if (uniform != 1) {
++ device_printf(sc->sc_dev, "!uniform source\n");
++ if (!uniform) {
++ /*
++ * There's no way to handle the DMA
++ * requirements with this uio. We
++ * could create a separate DMA area for
++ * the result and then copy it back,
++ * but for now we just bail and return
++ * an error. Note that uio requests
++ * > SAFE_MAX_DSIZE are handled because
++ * the DMA map and segment list for the
++ * destination wil result in a
++ * destination particle list that does
++ * the necessary scatter DMA.
++ */
++ safestats.st_iovnotuniform++;
++ err = EINVAL;
++ goto errout;
++ }
++ } else
++ re->re_dst = re->re_src;
++ } else {
++ safestats.st_badflags++;
++ err = EINVAL;
++ goto errout;
++ }
++
++ if (re->re_dst.nsegs > 1) {
++ re->re_desc.d_dst = sc->sc_dpalloc.dma_paddr +
++ ((caddr_t) sc->sc_dpfree - (caddr_t) sc->sc_dpring);
++ for (i = 0; i < re->re_dst_nsegs; i++) {
++ pd = sc->sc_dpfree;
++ KASSERT((pd->pd_flags&3) == 0 ||
++ (pd->pd_flags&3) == SAFE_PD_DONE,
++ ("bogus dest particle descriptor; flags %x",
++ pd->pd_flags));
++ if (++(sc->sc_dpfree) == sc->sc_dpringtop)
++ sc->sc_dpfree = sc->sc_dpring;
++ pd->pd_addr = re->re_dst_segs[i].ds_addr;
++ pd->pd_flags = SAFE_PD_READY;
++ }
++ cmd0 |= SAFE_SA_CMD0_OSCATTER;
++ } else {
++ /*
++ * No need for scatter, reference the operand directly.
++ */
++ re->re_desc.d_dst = re->re_dst_segs[0].ds_addr;
++ }
++ }
++
++ /*
++ * All done with setup; fillin the SA command words
++ * and the packet engine descriptor. The operation
++ * is now ready for submission to the hardware.
++ */
++ sa->sa_cmd0 = cmd0 | SAFE_SA_CMD0_IPCI | SAFE_SA_CMD0_OPCI;
++ sa->sa_cmd1 = cmd1
++ | (coffset << SAFE_SA_CMD1_OFFSET_S)
++ | SAFE_SA_CMD1_SAREV1 /* Rev 1 SA data structure */
++ | SAFE_SA_CMD1_SRPCI
++ ;
++ /*
++ * NB: the order of writes is important here. In case the
++ * chip is scanning the ring because of an outstanding request
++ * it might nab this one too. In that case we need to make
++ * sure the setup is complete before we write the length
++ * field of the descriptor as it signals the descriptor is
++ * ready for processing.
++ */
++ re->re_desc.d_csr = SAFE_PE_CSR_READY | SAFE_PE_CSR_SAPCI;
++ if (maccrd)
++ re->re_desc.d_csr |= SAFE_PE_CSR_LOADSA | SAFE_PE_CSR_HASHFINAL;
++ wmb();
++ re->re_desc.d_len = oplen
++ | SAFE_PE_LEN_READY
++ | (bypass << SAFE_PE_LEN_BYPASS_S)
++ ;
++
++ safestats.st_ipackets++;
++ safestats.st_ibytes += oplen;
++
++ if (++(sc->sc_front) == sc->sc_ringtop)
++ sc->sc_front = sc->sc_ring;
++
++ /* XXX honor batching */
++ safe_feed(sc, re);
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ return (0);
++
++errout:
++ if (re->re_src.map != re->re_dst.map)
++ pci_unmap_operand(sc, &re->re_dst);
++ if (re->re_src.map)
++ pci_unmap_operand(sc, &re->re_src);
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ if (err != ERESTART) {
++ crp->crp_etype = err;
++ crypto_done(crp);
++ } else {
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ }
++ return (err);
++}
++
++static void
++safe_callback(struct safe_softc *sc, struct safe_ringentry *re)
++{
++ struct cryptop *crp = (struct cryptop *)re->re_crp;
++ struct cryptodesc *crd;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ safestats.st_opackets++;
++ safestats.st_obytes += re->re_dst.mapsize;
++
++ if (re->re_desc.d_csr & SAFE_PE_CSR_STATUS) {
++ device_printf(sc->sc_dev, "csr 0x%x cmd0 0x%x cmd1 0x%x\n",
++ re->re_desc.d_csr,
++ re->re_sa.sa_cmd0, re->re_sa.sa_cmd1);
++ safestats.st_peoperr++;
++ crp->crp_etype = EIO; /* something more meaningful? */
++ }
++
++ if (re->re_dst.map != NULL && re->re_dst.map != re->re_src.map)
++ pci_unmap_operand(sc, &re->re_dst);
++ pci_unmap_operand(sc, &re->re_src);
++
++ /*
++ * If result was written to a differet mbuf chain, swap
++ * it in as the return value and reclaim the original.
++ */
++ if ((crp->crp_flags & CRYPTO_F_SKBUF) && re->re_src_skb != re->re_dst_skb) {
++ device_printf(sc->sc_dev, "no CRYPTO_F_SKBUF swapping support\n");
++ /* kfree_skb(skb) */
++ /* crp->crp_buf = (caddr_t)re->re_dst_skb */
++ return;
++ }
++
++ if (re->re_flags & SAFE_QFLAGS_COPYOUTIV) {
++ /* copy out IV for future use */
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ int i;
++ int ivsize;
++
++ if (crd->crd_alg == CRYPTO_DES_CBC ||
++ crd->crd_alg == CRYPTO_3DES_CBC) {
++ ivsize = 2*sizeof(u_int32_t);
++ } else if (crd->crd_alg == CRYPTO_AES_CBC) {
++ ivsize = 4*sizeof(u_int32_t);
++ } else
++ continue;
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ crd->crd_skip + crd->crd_len - ivsize, ivsize,
++ (caddr_t)sc->sc_sessions[re->re_sesn].ses_iv);
++ for (i = 0;
++ i < ivsize/sizeof(sc->sc_sessions[re->re_sesn].ses_iv[0]);
++ i++)
++ sc->sc_sessions[re->re_sesn].ses_iv[i] =
++ cpu_to_le32(sc->sc_sessions[re->re_sesn].ses_iv[i]);
++ break;
++ }
++ }
++
++ if (re->re_flags & SAFE_QFLAGS_COPYOUTICV) {
++ /* copy out ICV result */
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ if (!(crd->crd_alg == CRYPTO_MD5_HMAC ||
++ crd->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd->crd_alg == CRYPTO_NULL_HMAC))
++ continue;
++ if (crd->crd_alg == CRYPTO_SHA1_HMAC) {
++ /*
++ * SHA-1 ICV's are byte-swapped; fix 'em up
++ * before copy them to their destination.
++ */
++ re->re_sastate.sa_saved_indigest[0] =
++ cpu_to_be32(re->re_sastate.sa_saved_indigest[0]);
++ re->re_sastate.sa_saved_indigest[1] =
++ cpu_to_be32(re->re_sastate.sa_saved_indigest[1]);
++ re->re_sastate.sa_saved_indigest[2] =
++ cpu_to_be32(re->re_sastate.sa_saved_indigest[2]);
++ } else {
++ re->re_sastate.sa_saved_indigest[0] =
++ cpu_to_le32(re->re_sastate.sa_saved_indigest[0]);
++ re->re_sastate.sa_saved_indigest[1] =
++ cpu_to_le32(re->re_sastate.sa_saved_indigest[1]);
++ re->re_sastate.sa_saved_indigest[2] =
++ cpu_to_le32(re->re_sastate.sa_saved_indigest[2]);
++ }
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject,
++ sc->sc_sessions[re->re_sesn].ses_mlen,
++ (caddr_t)re->re_sastate.sa_saved_indigest);
++ break;
++ }
++ }
++ crypto_done(crp);
++}
++
++
++#if defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG)
++#define SAFE_RNG_MAXWAIT 1000
++
++static void
++safe_rng_init(struct safe_softc *sc)
++{
++ u_int32_t w, v;
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ WRITE_REG(sc, SAFE_RNG_CTRL, 0);
++ /* use default value according to the manual */
++ WRITE_REG(sc, SAFE_RNG_CNFG, 0x834); /* magic from SafeNet */
++ WRITE_REG(sc, SAFE_RNG_ALM_CNT, 0);
++
++ /*
++ * There is a bug in rev 1.0 of the 1140 that when the RNG
++ * is brought out of reset the ready status flag does not
++ * work until the RNG has finished its internal initialization.
++ *
++ * So in order to determine the device is through its
++ * initialization we must read the data register, using the
++ * status reg in the read in case it is initialized. Then read
++ * the data register until it changes from the first read.
++ * Once it changes read the data register until it changes
++ * again. At this time the RNG is considered initialized.
++ * This could take between 750ms - 1000ms in time.
++ */
++ i = 0;
++ w = READ_REG(sc, SAFE_RNG_OUT);
++ do {
++ v = READ_REG(sc, SAFE_RNG_OUT);
++ if (v != w) {
++ w = v;
++ break;
++ }
++ DELAY(10);
++ } while (++i < SAFE_RNG_MAXWAIT);
++
++ /* Wait Until data changes again */
++ i = 0;
++ do {
++ v = READ_REG(sc, SAFE_RNG_OUT);
++ if (v != w)
++ break;
++ DELAY(10);
++ } while (++i < SAFE_RNG_MAXWAIT);
++}
++
++static __inline void
++safe_rng_disable_short_cycle(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ WRITE_REG(sc, SAFE_RNG_CTRL,
++ READ_REG(sc, SAFE_RNG_CTRL) &~ SAFE_RNG_CTRL_SHORTEN);
++}
++
++static __inline void
++safe_rng_enable_short_cycle(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ WRITE_REG(sc, SAFE_RNG_CTRL,
++ READ_REG(sc, SAFE_RNG_CTRL) | SAFE_RNG_CTRL_SHORTEN);
++}
++
++static __inline u_int32_t
++safe_rng_read(struct safe_softc *sc)
++{
++ int i;
++
++ i = 0;
++ while (READ_REG(sc, SAFE_RNG_STAT) != 0 && ++i < SAFE_RNG_MAXWAIT)
++ ;
++ return READ_REG(sc, SAFE_RNG_OUT);
++}
++
++static int
++safe_read_random(void *arg, u_int32_t *buf, int maxwords)
++{
++ struct safe_softc *sc = (struct safe_softc *) arg;
++ int i, rc;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ safestats.st_rng++;
++ /*
++ * Fetch the next block of data.
++ */
++ if (maxwords > safe_rngbufsize)
++ maxwords = safe_rngbufsize;
++ if (maxwords > SAFE_RNG_MAXBUFSIZ)
++ maxwords = SAFE_RNG_MAXBUFSIZ;
++retry:
++ /* read as much as we can */
++ for (rc = 0; rc < maxwords; rc++) {
++ if (READ_REG(sc, SAFE_RNG_STAT) != 0)
++ break;
++ buf[rc] = READ_REG(sc, SAFE_RNG_OUT);
++ }
++ if (rc == 0)
++ return 0;
++ /*
++ * Check the comparator alarm count and reset the h/w if
++ * it exceeds our threshold. This guards against the
++ * hardware oscillators resonating with external signals.
++ */
++ if (READ_REG(sc, SAFE_RNG_ALM_CNT) > safe_rngmaxalarm) {
++ u_int32_t freq_inc, w;
++
++ DPRINTF(("%s: alarm count %u exceeds threshold %u\n", __func__,
++ (unsigned)READ_REG(sc, SAFE_RNG_ALM_CNT), safe_rngmaxalarm));
++ safestats.st_rngalarm++;
++ safe_rng_enable_short_cycle(sc);
++ freq_inc = 18;
++ for (i = 0; i < 64; i++) {
++ w = READ_REG(sc, SAFE_RNG_CNFG);
++ freq_inc = ((w + freq_inc) & 0x3fL);
++ w = ((w & ~0x3fL) | freq_inc);
++ WRITE_REG(sc, SAFE_RNG_CNFG, w);
++
++ WRITE_REG(sc, SAFE_RNG_ALM_CNT, 0);
++
++ (void) safe_rng_read(sc);
++ DELAY(25);
++
++ if (READ_REG(sc, SAFE_RNG_ALM_CNT) == 0) {
++ safe_rng_disable_short_cycle(sc);
++ goto retry;
++ }
++ freq_inc = 1;
++ }
++ safe_rng_disable_short_cycle(sc);
++ } else
++ WRITE_REG(sc, SAFE_RNG_ALM_CNT, 0);
++
++ return(rc);
++}
++#endif /* defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG) */
++
++
++/*
++ * Resets the board. Values in the regesters are left as is
++ * from the reset (i.e. initial values are assigned elsewhere).
++ */
++static void
++safe_reset_board(struct safe_softc *sc)
++{
++ u_int32_t v;
++ /*
++ * Reset the device. The manual says no delay
++ * is needed between marking and clearing reset.
++ */
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ v = READ_REG(sc, SAFE_PE_DMACFG) &~
++ (SAFE_PE_DMACFG_PERESET | SAFE_PE_DMACFG_PDRRESET |
++ SAFE_PE_DMACFG_SGRESET);
++ WRITE_REG(sc, SAFE_PE_DMACFG, v
++ | SAFE_PE_DMACFG_PERESET
++ | SAFE_PE_DMACFG_PDRRESET
++ | SAFE_PE_DMACFG_SGRESET);
++ WRITE_REG(sc, SAFE_PE_DMACFG, v);
++}
++
++/*
++ * Initialize registers we need to touch only once.
++ */
++static void
++safe_init_board(struct safe_softc *sc)
++{
++ u_int32_t v, dwords;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ v = READ_REG(sc, SAFE_PE_DMACFG);
++ v &=~ ( SAFE_PE_DMACFG_PEMODE
++ | SAFE_PE_DMACFG_FSENA /* failsafe enable */
++ | SAFE_PE_DMACFG_GPRPCI /* gather ring on PCI */
++ | SAFE_PE_DMACFG_SPRPCI /* scatter ring on PCI */
++ | SAFE_PE_DMACFG_ESDESC /* endian-swap descriptors */
++ | SAFE_PE_DMACFG_ESPDESC /* endian-swap part. desc's */
++ | SAFE_PE_DMACFG_ESSA /* endian-swap SA's */
++ | SAFE_PE_DMACFG_ESPACKET /* swap the packet data */
++ );
++ v |= SAFE_PE_DMACFG_FSENA /* failsafe enable */
++ | SAFE_PE_DMACFG_GPRPCI /* gather ring on PCI */
++ | SAFE_PE_DMACFG_SPRPCI /* scatter ring on PCI */
++ | SAFE_PE_DMACFG_ESDESC /* endian-swap descriptors */
++ | SAFE_PE_DMACFG_ESPDESC /* endian-swap part. desc's */
++ | SAFE_PE_DMACFG_ESSA /* endian-swap SA's */
++#if 0
++ | SAFE_PE_DMACFG_ESPACKET /* swap the packet data */
++#endif
++ ;
++ WRITE_REG(sc, SAFE_PE_DMACFG, v);
++
++#ifdef __BIG_ENDIAN
++ /* tell the safenet that we are 4321 and not 1234 */
++ WRITE_REG(sc, SAFE_ENDIAN, 0xe4e41b1b);
++#endif
++
++ if (sc->sc_chiprev == SAFE_REV(1,0)) {
++ /*
++ * Avoid large PCI DMA transfers. Rev 1.0 has a bug where
++ * "target mode transfers" done while the chip is DMA'ing
++ * >1020 bytes cause the hardware to lockup. To avoid this
++ * we reduce the max PCI transfer size and use small source
++ * particle descriptors (<= 256 bytes).
++ */
++ WRITE_REG(sc, SAFE_DMA_CFG, 256);
++ device_printf(sc->sc_dev,
++ "Reduce max DMA size to %u words for rev %u.%u WAR\n",
++ (unsigned) ((READ_REG(sc, SAFE_DMA_CFG)>>2) & 0xff),
++ (unsigned) SAFE_REV_MAJ(sc->sc_chiprev),
++ (unsigned) SAFE_REV_MIN(sc->sc_chiprev));
++ sc->sc_max_dsize = 256;
++ } else {
++ sc->sc_max_dsize = SAFE_MAX_DSIZE;
++ }
++
++ /* NB: operands+results are overlaid */
++ WRITE_REG(sc, SAFE_PE_PDRBASE, sc->sc_ringalloc.dma_paddr);
++ WRITE_REG(sc, SAFE_PE_RDRBASE, sc->sc_ringalloc.dma_paddr);
++ /*
++ * Configure ring entry size and number of items in the ring.
++ */
++ KASSERT((sizeof(struct safe_ringentry) % sizeof(u_int32_t)) == 0,
++ ("PE ring entry not 32-bit aligned!"));
++ dwords = sizeof(struct safe_ringentry) / sizeof(u_int32_t);
++ WRITE_REG(sc, SAFE_PE_RINGCFG,
++ (dwords << SAFE_PE_RINGCFG_OFFSET_S) | SAFE_MAX_NQUEUE);
++ WRITE_REG(sc, SAFE_PE_RINGPOLL, 0); /* disable polling */
++
++ WRITE_REG(sc, SAFE_PE_GRNGBASE, sc->sc_spalloc.dma_paddr);
++ WRITE_REG(sc, SAFE_PE_SRNGBASE, sc->sc_dpalloc.dma_paddr);
++ WRITE_REG(sc, SAFE_PE_PARTSIZE,
++ (SAFE_TOTAL_DPART<<16) | SAFE_TOTAL_SPART);
++ /*
++ * NB: destination particles are fixed size. We use
++ * an mbuf cluster and require all results go to
++ * clusters or smaller.
++ */
++ WRITE_REG(sc, SAFE_PE_PARTCFG, sc->sc_max_dsize);
++
++ /* it's now safe to enable PE mode, do it */
++ WRITE_REG(sc, SAFE_PE_DMACFG, v | SAFE_PE_DMACFG_PEMODE);
++
++ /*
++ * Configure hardware to use level-triggered interrupts and
++ * to interrupt after each descriptor is processed.
++ */
++ WRITE_REG(sc, SAFE_HI_CFG, SAFE_HI_CFG_LEVEL);
++ WRITE_REG(sc, SAFE_HI_CLR, 0xffffffff);
++ WRITE_REG(sc, SAFE_HI_DESC_CNT, 1);
++ WRITE_REG(sc, SAFE_HI_MASK, SAFE_INT_PE_DDONE | SAFE_INT_PE_ERROR);
++}
++
++
++/*
++ * Clean up after a chip crash.
++ * It is assumed that the caller in splimp()
++ */
++static void
++safe_cleanchip(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sc->sc_nqchip != 0) {
++ struct safe_ringentry *re = sc->sc_back;
++
++ while (re != sc->sc_front) {
++ if (re->re_desc.d_csr != 0)
++ safe_free_entry(sc, re);
++ if (++re == sc->sc_ringtop)
++ re = sc->sc_ring;
++ }
++ sc->sc_back = re;
++ sc->sc_nqchip = 0;
++ }
++}
++
++/*
++ * free a safe_q
++ * It is assumed that the caller is within splimp().
++ */
++static int
++safe_free_entry(struct safe_softc *sc, struct safe_ringentry *re)
++{
++ struct cryptop *crp;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ /*
++ * Free header MCR
++ */
++ if ((re->re_dst_skb != NULL) && (re->re_src_skb != re->re_dst_skb))
++#ifdef NOTYET
++ m_freem(re->re_dst_m);
++#else
++ printk("%s,%d: SKB not supported\n", __FILE__, __LINE__);
++#endif
++
++ crp = (struct cryptop *)re->re_crp;
++
++ re->re_desc.d_csr = 0;
++
++ crp->crp_etype = EFAULT;
++ crypto_done(crp);
++ return(0);
++}
++
++/*
++ * Routine to reset the chip and clean up.
++ * It is assumed that the caller is in splimp()
++ */
++static void
++safe_totalreset(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ safe_reset_board(sc);
++ safe_init_board(sc);
++ safe_cleanchip(sc);
++}
++
++/*
++ * Is the operand suitable aligned for direct DMA. Each
++ * segment must be aligned on a 32-bit boundary and all
++ * but the last segment must be a multiple of 4 bytes.
++ */
++static int
++safe_dmamap_aligned(struct safe_softc *sc, const struct safe_operand *op)
++{
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ for (i = 0; i < op->nsegs; i++) {
++ if (op->segs[i].ds_addr & 3)
++ return (0);
++ if (i != (op->nsegs - 1) && (op->segs[i].ds_len & 3))
++ return (0);
++ }
++ return (1);
++}
++
++/*
++ * Is the operand suitable for direct DMA as the destination
++ * of an operation. The hardware requires that each ``particle''
++ * but the last in an operation result have the same size. We
++ * fix that size at SAFE_MAX_DSIZE bytes. This routine returns
++ * 0 if some segment is not a multiple of of this size, 1 if all
++ * segments are exactly this size, or 2 if segments are at worst
++ * a multple of this size.
++ */
++static int
++safe_dmamap_uniform(struct safe_softc *sc, const struct safe_operand *op)
++{
++ int result = 1;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (op->nsegs > 0) {
++ int i;
++
++ for (i = 0; i < op->nsegs-1; i++) {
++ if (op->segs[i].ds_len % sc->sc_max_dsize)
++ return (0);
++ if (op->segs[i].ds_len != sc->sc_max_dsize)
++ result = 2;
++ }
++ }
++ return (result);
++}
++
++static int
++safe_kprocess(device_t dev, struct cryptkop *krp, int hint)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ struct safe_pkq *q;
++ unsigned long flags;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sc == NULL) {
++ krp->krp_status = EINVAL;
++ goto err;
++ }
++
++ if (krp->krp_op != CRK_MOD_EXP) {
++ krp->krp_status = EOPNOTSUPP;
++ goto err;
++ }
++
++ q = (struct safe_pkq *) kmalloc(sizeof(*q), GFP_KERNEL);
++ if (q == NULL) {
++ krp->krp_status = ENOMEM;
++ goto err;
++ }
++ memset(q, 0, sizeof(*q));
++ q->pkq_krp = krp;
++ INIT_LIST_HEAD(&q->pkq_list);
++
++ spin_lock_irqsave(&sc->sc_pkmtx, flags);
++ list_add_tail(&q->pkq_list, &sc->sc_pkq);
++ safe_kfeed(sc);
++ spin_unlock_irqrestore(&sc->sc_pkmtx, flags);
++ return (0);
++
++err:
++ crypto_kdone(krp);
++ return (0);
++}
++
++#define SAFE_CRK_PARAM_BASE 0
++#define SAFE_CRK_PARAM_EXP 1
++#define SAFE_CRK_PARAM_MOD 2
++
++static int
++safe_kstart(struct safe_softc *sc)
++{
++ struct cryptkop *krp = sc->sc_pkq_cur->pkq_krp;
++ int exp_bits, mod_bits, base_bits;
++ u_int32_t op, a_off, b_off, c_off, d_off;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (krp->krp_iparams < 3 || krp->krp_oparams != 1) {
++ krp->krp_status = EINVAL;
++ return (1);
++ }
++
++ base_bits = safe_ksigbits(sc, &krp->krp_param[SAFE_CRK_PARAM_BASE]);
++ if (base_bits > 2048)
++ goto too_big;
++ if (base_bits <= 0) /* 5. base not zero */
++ goto too_small;
++
++ exp_bits = safe_ksigbits(sc, &krp->krp_param[SAFE_CRK_PARAM_EXP]);
++ if (exp_bits > 2048)
++ goto too_big;
++ if (exp_bits <= 0) /* 1. exponent word length > 0 */
++ goto too_small; /* 4. exponent not zero */
++
++ mod_bits = safe_ksigbits(sc, &krp->krp_param[SAFE_CRK_PARAM_MOD]);
++ if (mod_bits > 2048)
++ goto too_big;
++ if (mod_bits <= 32) /* 2. modulus word length > 1 */
++ goto too_small; /* 8. MSW of modulus != zero */
++ if (mod_bits < exp_bits) /* 3 modulus len >= exponent len */
++ goto too_small;
++ if ((krp->krp_param[SAFE_CRK_PARAM_MOD].crp_p[0] & 1) == 0)
++ goto bad_domain; /* 6. modulus is odd */
++ if (mod_bits > krp->krp_param[krp->krp_iparams].crp_nbits)
++ goto too_small; /* make sure result will fit */
++
++ /* 7. modulus > base */
++ if (mod_bits < base_bits)
++ goto too_small;
++ if (mod_bits == base_bits) {
++ u_int8_t *basep, *modp;
++ int i;
++
++ basep = krp->krp_param[SAFE_CRK_PARAM_BASE].crp_p +
++ ((base_bits + 7) / 8) - 1;
++ modp = krp->krp_param[SAFE_CRK_PARAM_MOD].crp_p +
++ ((mod_bits + 7) / 8) - 1;
++
++ for (i = 0; i < (mod_bits + 7) / 8; i++, basep--, modp--) {
++ if (*modp < *basep)
++ goto too_small;
++ if (*modp > *basep)
++ break;
++ }
++ }
++
++ /* And on the 9th step, he rested. */
++
++ WRITE_REG(sc, SAFE_PK_A_LEN, (exp_bits + 31) / 32);
++ WRITE_REG(sc, SAFE_PK_B_LEN, (mod_bits + 31) / 32);
++ if (mod_bits > 1024) {
++ op = SAFE_PK_FUNC_EXP4;
++ a_off = 0x000;
++ b_off = 0x100;
++ c_off = 0x200;
++ d_off = 0x300;
++ } else {
++ op = SAFE_PK_FUNC_EXP16;
++ a_off = 0x000;
++ b_off = 0x080;
++ c_off = 0x100;
++ d_off = 0x180;
++ }
++ sc->sc_pk_reslen = b_off - a_off;
++ sc->sc_pk_resoff = d_off;
++
++ /* A is exponent, B is modulus, C is base, D is result */
++ safe_kload_reg(sc, a_off, b_off - a_off,
++ &krp->krp_param[SAFE_CRK_PARAM_EXP]);
++ WRITE_REG(sc, SAFE_PK_A_ADDR, a_off >> 2);
++ safe_kload_reg(sc, b_off, b_off - a_off,
++ &krp->krp_param[SAFE_CRK_PARAM_MOD]);
++ WRITE_REG(sc, SAFE_PK_B_ADDR, b_off >> 2);
++ safe_kload_reg(sc, c_off, b_off - a_off,
++ &krp->krp_param[SAFE_CRK_PARAM_BASE]);
++ WRITE_REG(sc, SAFE_PK_C_ADDR, c_off >> 2);
++ WRITE_REG(sc, SAFE_PK_D_ADDR, d_off >> 2);
++
++ WRITE_REG(sc, SAFE_PK_FUNC, op | SAFE_PK_FUNC_RUN);
++
++ return (0);
++
++too_big:
++ krp->krp_status = E2BIG;
++ return (1);
++too_small:
++ krp->krp_status = ERANGE;
++ return (1);
++bad_domain:
++ krp->krp_status = EDOM;
++ return (1);
++}
++
++static int
++safe_ksigbits(struct safe_softc *sc, struct crparam *cr)
++{
++ u_int plen = (cr->crp_nbits + 7) / 8;
++ int i, sig = plen * 8;
++ u_int8_t c, *p = cr->crp_p;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ for (i = plen - 1; i >= 0; i--) {
++ c = p[i];
++ if (c != 0) {
++ while ((c & 0x80) == 0) {
++ sig--;
++ c <<= 1;
++ }
++ break;
++ }
++ sig -= 8;
++ }
++ return (sig);
++}
++
++static void
++safe_kfeed(struct safe_softc *sc)
++{
++ struct safe_pkq *q, *tmp;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (list_empty(&sc->sc_pkq) && sc->sc_pkq_cur == NULL)
++ return;
++ if (sc->sc_pkq_cur != NULL)
++ return;
++ list_for_each_entry_safe(q, tmp, &sc->sc_pkq, pkq_list) {
++ sc->sc_pkq_cur = q;
++ list_del(&q->pkq_list);
++ if (safe_kstart(sc) != 0) {
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ sc->sc_pkq_cur = NULL;
++ } else {
++ /* op started, start polling */
++ mod_timer(&sc->sc_pkto, jiffies + 1);
++ break;
++ }
++ }
++}
++
++static void
++safe_kpoll(unsigned long arg)
++{
++ struct safe_softc *sc = NULL;
++ struct safe_pkq *q;
++ struct crparam *res;
++ int i;
++ u_int32_t buf[64];
++ unsigned long flags;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (arg >= SAFE_MAX_CHIPS)
++ return;
++ sc = safe_chip_idx[arg];
++ if (!sc) {
++ DPRINTF(("%s() - bad callback\n", __FUNCTION__));
++ return;
++ }
++
++ spin_lock_irqsave(&sc->sc_pkmtx, flags);
++ if (sc->sc_pkq_cur == NULL)
++ goto out;
++ if (READ_REG(sc, SAFE_PK_FUNC) & SAFE_PK_FUNC_RUN) {
++ /* still running, check back later */
++ mod_timer(&sc->sc_pkto, jiffies + 1);
++ goto out;
++ }
++
++ q = sc->sc_pkq_cur;
++ res = &q->pkq_krp->krp_param[q->pkq_krp->krp_iparams];
++ bzero(buf, sizeof(buf));
++ bzero(res->crp_p, (res->crp_nbits + 7) / 8);
++ for (i = 0; i < sc->sc_pk_reslen >> 2; i++)
++ buf[i] = le32_to_cpu(READ_REG(sc, SAFE_PK_RAM_START +
++ sc->sc_pk_resoff + (i << 2)));
++ bcopy(buf, res->crp_p, (res->crp_nbits + 7) / 8);
++ /*
++ * reduce the bits that need copying if possible
++ */
++ res->crp_nbits = min(res->crp_nbits,sc->sc_pk_reslen * 8);
++ res->crp_nbits = safe_ksigbits(sc, res);
++
++ for (i = SAFE_PK_RAM_START; i < SAFE_PK_RAM_END; i += 4)
++ WRITE_REG(sc, i, 0);
++
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ sc->sc_pkq_cur = NULL;
++
++ safe_kfeed(sc);
++out:
++ spin_unlock_irqrestore(&sc->sc_pkmtx, flags);
++}
++
++static void
++safe_kload_reg(struct safe_softc *sc, u_int32_t off, u_int32_t len,
++ struct crparam *n)
++{
++ u_int32_t buf[64], i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ bzero(buf, sizeof(buf));
++ bcopy(n->crp_p, buf, (n->crp_nbits + 7) / 8);
++
++ for (i = 0; i < len >> 2; i++)
++ WRITE_REG(sc, SAFE_PK_RAM_START + off + (i << 2),
++ cpu_to_le32(buf[i]));
++}
++
++#ifdef SAFE_DEBUG
++static void
++safe_dump_dmastatus(struct safe_softc *sc, const char *tag)
++{
++ printf("%s: ENDIAN 0x%x SRC 0x%x DST 0x%x STAT 0x%x\n"
++ , tag
++ , READ_REG(sc, SAFE_DMA_ENDIAN)
++ , READ_REG(sc, SAFE_DMA_SRCADDR)
++ , READ_REG(sc, SAFE_DMA_DSTADDR)
++ , READ_REG(sc, SAFE_DMA_STAT)
++ );
++}
++
++static void
++safe_dump_intrstate(struct safe_softc *sc, const char *tag)
++{
++ printf("%s: HI_CFG 0x%x HI_MASK 0x%x HI_DESC_CNT 0x%x HU_STAT 0x%x HM_STAT 0x%x\n"
++ , tag
++ , READ_REG(sc, SAFE_HI_CFG)
++ , READ_REG(sc, SAFE_HI_MASK)
++ , READ_REG(sc, SAFE_HI_DESC_CNT)
++ , READ_REG(sc, SAFE_HU_STAT)
++ , READ_REG(sc, SAFE_HM_STAT)
++ );
++}
++
++static void
++safe_dump_ringstate(struct safe_softc *sc, const char *tag)
++{
++ u_int32_t estat = READ_REG(sc, SAFE_PE_ERNGSTAT);
++
++ /* NB: assume caller has lock on ring */
++ printf("%s: ERNGSTAT %x (next %u) back %lu front %lu\n",
++ tag,
++ estat, (estat >> SAFE_PE_ERNGSTAT_NEXT_S),
++ (unsigned long)(sc->sc_back - sc->sc_ring),
++ (unsigned long)(sc->sc_front - sc->sc_ring));
++}
++
++static void
++safe_dump_request(struct safe_softc *sc, const char* tag, struct safe_ringentry *re)
++{
++ int ix, nsegs;
++
++ ix = re - sc->sc_ring;
++ printf("%s: %p (%u): csr %x src %x dst %x sa %x len %x\n"
++ , tag
++ , re, ix
++ , re->re_desc.d_csr
++ , re->re_desc.d_src
++ , re->re_desc.d_dst
++ , re->re_desc.d_sa
++ , re->re_desc.d_len
++ );
++ if (re->re_src.nsegs > 1) {
++ ix = (re->re_desc.d_src - sc->sc_spalloc.dma_paddr) /
++ sizeof(struct safe_pdesc);
++ for (nsegs = re->re_src.nsegs; nsegs; nsegs--) {
++ printf(" spd[%u] %p: %p size %u flags %x"
++ , ix, &sc->sc_spring[ix]
++ , (caddr_t)(uintptr_t) sc->sc_spring[ix].pd_addr
++ , sc->sc_spring[ix].pd_size
++ , sc->sc_spring[ix].pd_flags
++ );
++ if (sc->sc_spring[ix].pd_size == 0)
++ printf(" (zero!)");
++ printf("\n");
++ if (++ix == SAFE_TOTAL_SPART)
++ ix = 0;
++ }
++ }
++ if (re->re_dst.nsegs > 1) {
++ ix = (re->re_desc.d_dst - sc->sc_dpalloc.dma_paddr) /
++ sizeof(struct safe_pdesc);
++ for (nsegs = re->re_dst.nsegs; nsegs; nsegs--) {
++ printf(" dpd[%u] %p: %p flags %x\n"
++ , ix, &sc->sc_dpring[ix]
++ , (caddr_t)(uintptr_t) sc->sc_dpring[ix].pd_addr
++ , sc->sc_dpring[ix].pd_flags
++ );
++ if (++ix == SAFE_TOTAL_DPART)
++ ix = 0;
++ }
++ }
++ printf("sa: cmd0 %08x cmd1 %08x staterec %x\n",
++ re->re_sa.sa_cmd0, re->re_sa.sa_cmd1, re->re_sa.sa_staterec);
++ printf("sa: key %x %x %x %x %x %x %x %x\n"
++ , re->re_sa.sa_key[0]
++ , re->re_sa.sa_key[1]
++ , re->re_sa.sa_key[2]
++ , re->re_sa.sa_key[3]
++ , re->re_sa.sa_key[4]
++ , re->re_sa.sa_key[5]
++ , re->re_sa.sa_key[6]
++ , re->re_sa.sa_key[7]
++ );
++ printf("sa: indigest %x %x %x %x %x\n"
++ , re->re_sa.sa_indigest[0]
++ , re->re_sa.sa_indigest[1]
++ , re->re_sa.sa_indigest[2]
++ , re->re_sa.sa_indigest[3]
++ , re->re_sa.sa_indigest[4]
++ );
++ printf("sa: outdigest %x %x %x %x %x\n"
++ , re->re_sa.sa_outdigest[0]
++ , re->re_sa.sa_outdigest[1]
++ , re->re_sa.sa_outdigest[2]
++ , re->re_sa.sa_outdigest[3]
++ , re->re_sa.sa_outdigest[4]
++ );
++ printf("sr: iv %x %x %x %x\n"
++ , re->re_sastate.sa_saved_iv[0]
++ , re->re_sastate.sa_saved_iv[1]
++ , re->re_sastate.sa_saved_iv[2]
++ , re->re_sastate.sa_saved_iv[3]
++ );
++ printf("sr: hashbc %u indigest %x %x %x %x %x\n"
++ , re->re_sastate.sa_saved_hashbc
++ , re->re_sastate.sa_saved_indigest[0]
++ , re->re_sastate.sa_saved_indigest[1]
++ , re->re_sastate.sa_saved_indigest[2]
++ , re->re_sastate.sa_saved_indigest[3]
++ , re->re_sastate.sa_saved_indigest[4]
++ );
++}
++
++static void
++safe_dump_ring(struct safe_softc *sc, const char *tag)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&sc->sc_ringmtx, flags);
++ printf("\nSafeNet Ring State:\n");
++ safe_dump_intrstate(sc, tag);
++ safe_dump_dmastatus(sc, tag);
++ safe_dump_ringstate(sc, tag);
++ if (sc->sc_nqchip) {
++ struct safe_ringentry *re = sc->sc_back;
++ do {
++ safe_dump_request(sc, tag, re);
++ if (++re == sc->sc_ringtop)
++ re = sc->sc_ring;
++ } while (re != sc->sc_front);
++ }
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++}
++#endif /* SAFE_DEBUG */
++
++
++static int safe_probe(struct pci_dev *dev, const struct pci_device_id *ent)
++{
++ struct safe_softc *sc = NULL;
++ u32 mem_start, mem_len, cmd;
++ int i, rc, devinfo;
++ dma_addr_t raddr;
++ static int num_chips = 0;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (pci_enable_device(dev) < 0)
++ return(-ENODEV);
++
++ if (!dev->irq) {
++ printk("safe: found device with no IRQ assigned. check BIOS settings!");
++ pci_disable_device(dev);
++ return(-ENODEV);
++ }
++
++ if (pci_set_mwi(dev)) {
++ printk("safe: pci_set_mwi failed!");
++ return(-ENODEV);
++ }
++
++ sc = (struct safe_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return(-ENOMEM);
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, "safe", num_chips, safe_methods);
++
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++ sc->sc_pcidev = dev;
++ if (num_chips < SAFE_MAX_CHIPS) {
++ safe_chip_idx[device_get_unit(sc->sc_dev)] = sc;
++ num_chips++;
++ }
++
++ INIT_LIST_HEAD(&sc->sc_pkq);
++ spin_lock_init(&sc->sc_pkmtx);
++
++ pci_set_drvdata(sc->sc_pcidev, sc);
++
++ /* we read its hardware registers as memory */
++ mem_start = pci_resource_start(sc->sc_pcidev, 0);
++ mem_len = pci_resource_len(sc->sc_pcidev, 0);
++
++ sc->sc_base_addr = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_base_addr) {
++ device_printf(sc->sc_dev, "failed to ioremap 0x%x-0x%x\n",
++ mem_start, mem_start + mem_len - 1);
++ goto out;
++ }
++
++ /* fix up the bus size */
++ if (pci_set_dma_mask(sc->sc_pcidev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev, "No usable DMA configuration, aborting.\n");
++ goto out;
++ }
++ if (pci_set_consistent_dma_mask(sc->sc_pcidev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev, "No usable consistent DMA configuration, aborting.\n");
++ goto out;
++ }
++
++ pci_set_master(sc->sc_pcidev);
++
++ pci_read_config_dword(sc->sc_pcidev, PCI_COMMAND, &cmd);
++
++ if (!(cmd & PCI_COMMAND_MEMORY)) {
++ device_printf(sc->sc_dev, "failed to enable memory mapping\n");
++ goto out;
++ }
++
++ if (!(cmd & PCI_COMMAND_MASTER)) {
++ device_printf(sc->sc_dev, "failed to enable bus mastering\n");
++ goto out;
++ }
++
++ rc = request_irq(dev->irq, safe_intr, IRQF_SHARED, "safe", sc);
++ if (rc) {
++ device_printf(sc->sc_dev, "failed to hook irq %d\n", sc->sc_irq);
++ goto out;
++ }
++ sc->sc_irq = dev->irq;
++
++ sc->sc_chiprev = READ_REG(sc, SAFE_DEVINFO) &
++ (SAFE_DEVINFO_REV_MAJ | SAFE_DEVINFO_REV_MIN);
++
++ /*
++ * Allocate packet engine descriptors.
++ */
++ sc->sc_ringalloc.dma_vaddr = pci_alloc_consistent(sc->sc_pcidev,
++ SAFE_MAX_NQUEUE * sizeof (struct safe_ringentry),
++ &sc->sc_ringalloc.dma_paddr);
++ if (!sc->sc_ringalloc.dma_vaddr) {
++ device_printf(sc->sc_dev, "cannot allocate PE descriptor ring\n");
++ goto out;
++ }
++
++ /*
++ * Hookup the static portion of all our data structures.
++ */
++ sc->sc_ring = (struct safe_ringentry *) sc->sc_ringalloc.dma_vaddr;
++ sc->sc_ringtop = sc->sc_ring + SAFE_MAX_NQUEUE;
++ sc->sc_front = sc->sc_ring;
++ sc->sc_back = sc->sc_ring;
++ raddr = sc->sc_ringalloc.dma_paddr;
++ bzero(sc->sc_ring, SAFE_MAX_NQUEUE * sizeof(struct safe_ringentry));
++ for (i = 0; i < SAFE_MAX_NQUEUE; i++) {
++ struct safe_ringentry *re = &sc->sc_ring[i];
++
++ re->re_desc.d_sa = raddr +
++ offsetof(struct safe_ringentry, re_sa);
++ re->re_sa.sa_staterec = raddr +
++ offsetof(struct safe_ringentry, re_sastate);
++
++ raddr += sizeof (struct safe_ringentry);
++ }
++ spin_lock_init(&sc->sc_ringmtx);
++
++ /*
++ * Allocate scatter and gather particle descriptors.
++ */
++ sc->sc_spalloc.dma_vaddr = pci_alloc_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_SPART * sizeof (struct safe_pdesc),
++ &sc->sc_spalloc.dma_paddr);
++ if (!sc->sc_spalloc.dma_vaddr) {
++ device_printf(sc->sc_dev, "cannot allocate source particle descriptor ring\n");
++ goto out;
++ }
++ sc->sc_spring = (struct safe_pdesc *) sc->sc_spalloc.dma_vaddr;
++ sc->sc_springtop = sc->sc_spring + SAFE_TOTAL_SPART;
++ sc->sc_spfree = sc->sc_spring;
++ bzero(sc->sc_spring, SAFE_TOTAL_SPART * sizeof(struct safe_pdesc));
++
++ sc->sc_dpalloc.dma_vaddr = pci_alloc_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ &sc->sc_dpalloc.dma_paddr);
++ if (!sc->sc_dpalloc.dma_vaddr) {
++ device_printf(sc->sc_dev, "cannot allocate destination particle descriptor ring\n");
++ goto out;
++ }
++ sc->sc_dpring = (struct safe_pdesc *) sc->sc_dpalloc.dma_vaddr;
++ sc->sc_dpringtop = sc->sc_dpring + SAFE_TOTAL_DPART;
++ sc->sc_dpfree = sc->sc_dpring;
++ bzero(sc->sc_dpring, SAFE_TOTAL_DPART * sizeof(struct safe_pdesc));
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc), CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ device_printf(sc->sc_dev, "could not get crypto driver id\n");
++ goto out;
++ }
++
++ printf("%s:", device_get_nameunit(sc->sc_dev));
++
++ devinfo = READ_REG(sc, SAFE_DEVINFO);
++ if (devinfo & SAFE_DEVINFO_RNG) {
++ sc->sc_flags |= SAFE_FLAGS_RNG;
++ printf(" rng");
++ }
++ if (devinfo & SAFE_DEVINFO_PKEY) {
++ printf(" key");
++ sc->sc_flags |= SAFE_FLAGS_KEY;
++ crypto_kregister(sc->sc_cid, CRK_MOD_EXP, 0);
++#if 0
++ crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0);
++#endif
++ init_timer(&sc->sc_pkto);
++ sc->sc_pkto.function = safe_kpoll;
++ sc->sc_pkto.data = (unsigned long) device_get_unit(sc->sc_dev);
++ }
++ if (devinfo & SAFE_DEVINFO_DES) {
++ printf(" des/3des");
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ }
++ if (devinfo & SAFE_DEVINFO_AES) {
++ printf(" aes");
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ }
++ if (devinfo & SAFE_DEVINFO_MD5) {
++ printf(" md5");
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++ }
++ if (devinfo & SAFE_DEVINFO_SHA1) {
++ printf(" sha1");
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ }
++ printf(" null");
++ crypto_register(sc->sc_cid, CRYPTO_NULL_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_NULL_HMAC, 0, 0);
++ /* XXX other supported algorithms */
++ printf("\n");
++
++ safe_reset_board(sc); /* reset h/w */
++ safe_init_board(sc); /* init h/w */
++
++#if defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG)
++ if (sc->sc_flags & SAFE_FLAGS_RNG) {
++ safe_rng_init(sc);
++ crypto_rregister(sc->sc_cid, safe_read_random, sc);
++ }
++#endif /* SAFE_NO_RNG */
++
++ return (0);
++
++out:
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_ringalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_MAX_NQUEUE * sizeof (struct safe_ringentry),
++ sc->sc_ringalloc.dma_vaddr, sc->sc_ringalloc.dma_paddr);
++ if (sc->sc_spalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_spalloc.dma_vaddr, sc->sc_spalloc.dma_paddr);
++ if (sc->sc_dpalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_dpalloc.dma_vaddr, sc->sc_dpalloc.dma_paddr);
++ kfree(sc);
++ return(-ENODEV);
++}
++
++static void safe_remove(struct pci_dev *dev)
++{
++ struct safe_softc *sc = pci_get_drvdata(dev);
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ /* XXX wait/abort active ops */
++
++ WRITE_REG(sc, SAFE_HI_MASK, 0); /* disable interrupts */
++
++ del_timer_sync(&sc->sc_pkto);
++
++ crypto_unregister_all(sc->sc_cid);
++
++ safe_cleanchip(sc);
++
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_ringalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_MAX_NQUEUE * sizeof (struct safe_ringentry),
++ sc->sc_ringalloc.dma_vaddr, sc->sc_ringalloc.dma_paddr);
++ if (sc->sc_spalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_spalloc.dma_vaddr, sc->sc_spalloc.dma_paddr);
++ if (sc->sc_dpalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_dpalloc.dma_vaddr, sc->sc_dpalloc.dma_paddr);
++ sc->sc_irq = -1;
++ sc->sc_ringalloc.dma_vaddr = NULL;
++ sc->sc_spalloc.dma_vaddr = NULL;
++ sc->sc_dpalloc.dma_vaddr = NULL;
++}
++
++static struct pci_device_id safe_pci_tbl[] = {
++ { PCI_VENDOR_SAFENET, PCI_PRODUCT_SAFEXCEL,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { },
++};
++MODULE_DEVICE_TABLE(pci, safe_pci_tbl);
++
++static struct pci_driver safe_driver = {
++ .name = "safe",
++ .id_table = safe_pci_tbl,
++ .probe = safe_probe,
++ .remove = safe_remove,
++ /* add PM stuff here one day */
++};
++
++static int __init safe_init (void)
++{
++ struct safe_softc *sc = NULL;
++ int rc;
++
++ DPRINTF(("%s(%p)\n", __FUNCTION__, safe_init));
++
++ rc = pci_register_driver(&safe_driver);
++ pci_register_driver_compat(&safe_driver, rc);
++
++ return rc;
++}
++
++static void __exit safe_exit (void)
++{
++ pci_unregister_driver(&safe_driver);
++}
++
++module_init(safe_init);
++module_exit(safe_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("OCF driver for safenet PCI crypto devices");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/safereg.h linux-2.6.27.10/crypto/ocf/safe/safereg.h
+--- linux-2.6.27.10.orig/crypto/ocf/safe/safereg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/safereg.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,421 @@
++/*-
++ * Copyright (c) 2003 Sam Leffler, Errno Consulting
++ * Copyright (c) 2003 Global Technology Associates, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * $FreeBSD: src/sys/dev/safe/safereg.h,v 1.1 2003/07/21 21:46:07 sam Exp $
++ */
++#ifndef _SAFE_SAFEREG_H_
++#define _SAFE_SAFEREG_H_
++
++/*
++ * Register definitions for SafeNet SafeXcel-1141 crypto device.
++ * Definitions from revision 1.3 (Nov 6 2002) of the User's Manual.
++ */
++
++#define BS_BAR 0x10 /* DMA base address register */
++#define BS_TRDY_TIMEOUT 0x40 /* TRDY timeout */
++#define BS_RETRY_TIMEOUT 0x41 /* DMA retry timeout */
++
++#define PCI_VENDOR_SAFENET 0x16ae /* SafeNet, Inc. */
++
++/* SafeNet */
++#define PCI_PRODUCT_SAFEXCEL 0x1141 /* 1141 */
++
++#define SAFE_PE_CSR 0x0000 /* Packet Enginge Ctrl/Status */
++#define SAFE_PE_SRC 0x0004 /* Packet Engine Source */
++#define SAFE_PE_DST 0x0008 /* Packet Engine Destination */
++#define SAFE_PE_SA 0x000c /* Packet Engine SA */
++#define SAFE_PE_LEN 0x0010 /* Packet Engine Length */
++#define SAFE_PE_DMACFG 0x0040 /* Packet Engine DMA Configuration */
++#define SAFE_PE_DMASTAT 0x0044 /* Packet Engine DMA Status */
++#define SAFE_PE_PDRBASE 0x0048 /* Packet Engine Descriptor Ring Base */
++#define SAFE_PE_RDRBASE 0x004c /* Packet Engine Result Ring Base */
++#define SAFE_PE_RINGCFG 0x0050 /* Packet Engine Ring Configuration */
++#define SAFE_PE_RINGPOLL 0x0054 /* Packet Engine Ring Poll */
++#define SAFE_PE_IRNGSTAT 0x0058 /* Packet Engine Internal Ring Status */
++#define SAFE_PE_ERNGSTAT 0x005c /* Packet Engine External Ring Status */
++#define SAFE_PE_IOTHRESH 0x0060 /* Packet Engine I/O Threshold */
++#define SAFE_PE_GRNGBASE 0x0064 /* Packet Engine Gather Ring Base */
++#define SAFE_PE_SRNGBASE 0x0068 /* Packet Engine Scatter Ring Base */
++#define SAFE_PE_PARTSIZE 0x006c /* Packet Engine Particlar Ring Size */
++#define SAFE_PE_PARTCFG 0x0070 /* Packet Engine Particle Ring Config */
++#define SAFE_CRYPTO_CTRL 0x0080 /* Crypto Control */
++#define SAFE_DEVID 0x0084 /* Device ID */
++#define SAFE_DEVINFO 0x0088 /* Device Info */
++#define SAFE_HU_STAT 0x00a0 /* Host Unmasked Status */
++#define SAFE_HM_STAT 0x00a4 /* Host Masked Status (read-only) */
++#define SAFE_HI_CLR 0x00a4 /* Host Clear Interrupt (write-only) */
++#define SAFE_HI_MASK 0x00a8 /* Host Mask Control */
++#define SAFE_HI_CFG 0x00ac /* Interrupt Configuration */
++#define SAFE_HI_RD_DESCR 0x00b4 /* Force Descriptor Read */
++#define SAFE_HI_DESC_CNT 0x00b8 /* Host Descriptor Done Count */
++#define SAFE_DMA_ENDIAN 0x00c0 /* Master Endian Status */
++#define SAFE_DMA_SRCADDR 0x00c4 /* DMA Source Address Status */
++#define SAFE_DMA_DSTADDR 0x00c8 /* DMA Destination Address Status */
++#define SAFE_DMA_STAT 0x00cc /* DMA Current Status */
++#define SAFE_DMA_CFG 0x00d4 /* DMA Configuration/Status */
++#define SAFE_ENDIAN 0x00e0 /* Endian Configuration */
++#define SAFE_PK_A_ADDR 0x0800 /* Public Key A Address */
++#define SAFE_PK_B_ADDR 0x0804 /* Public Key B Address */
++#define SAFE_PK_C_ADDR 0x0808 /* Public Key C Address */
++#define SAFE_PK_D_ADDR 0x080c /* Public Key D Address */
++#define SAFE_PK_A_LEN 0x0810 /* Public Key A Length */
++#define SAFE_PK_B_LEN 0x0814 /* Public Key B Length */
++#define SAFE_PK_SHIFT 0x0818 /* Public Key Shift */
++#define SAFE_PK_FUNC 0x081c /* Public Key Function */
++#define SAFE_PK_RAM_START 0x1000 /* Public Key RAM start address */
++#define SAFE_PK_RAM_END 0x1fff /* Public Key RAM end address */
++
++#define SAFE_RNG_OUT 0x0100 /* RNG Output */
++#define SAFE_RNG_STAT 0x0104 /* RNG Status */
++#define SAFE_RNG_CTRL 0x0108 /* RNG Control */
++#define SAFE_RNG_A 0x010c /* RNG A */
++#define SAFE_RNG_B 0x0110 /* RNG B */
++#define SAFE_RNG_X_LO 0x0114 /* RNG X [31:0] */
++#define SAFE_RNG_X_MID 0x0118 /* RNG X [63:32] */
++#define SAFE_RNG_X_HI 0x011c /* RNG X [80:64] */
++#define SAFE_RNG_X_CNTR 0x0120 /* RNG Counter */
++#define SAFE_RNG_ALM_CNT 0x0124 /* RNG Alarm Count */
++#define SAFE_RNG_CNFG 0x0128 /* RNG Configuration */
++#define SAFE_RNG_LFSR1_LO 0x012c /* RNG LFSR1 [31:0] */
++#define SAFE_RNG_LFSR1_HI 0x0130 /* RNG LFSR1 [47:32] */
++#define SAFE_RNG_LFSR2_LO 0x0134 /* RNG LFSR1 [31:0] */
++#define SAFE_RNG_LFSR2_HI 0x0138 /* RNG LFSR1 [47:32] */
++
++#define SAFE_PE_CSR_READY 0x00000001 /* ready for processing */
++#define SAFE_PE_CSR_DONE 0x00000002 /* h/w completed processing */
++#define SAFE_PE_CSR_LOADSA 0x00000004 /* load SA digests */
++#define SAFE_PE_CSR_HASHFINAL 0x00000010 /* do hash pad & write result */
++#define SAFE_PE_CSR_SABUSID 0x000000c0 /* bus id for SA */
++#define SAFE_PE_CSR_SAPCI 0x00000040 /* PCI bus id for SA */
++#define SAFE_PE_CSR_NXTHDR 0x0000ff00 /* next hdr value for IPsec */
++#define SAFE_PE_CSR_FPAD 0x0000ff00 /* fixed pad for basic ops */
++#define SAFE_PE_CSR_STATUS 0x00ff0000 /* operation result status */
++#define SAFE_PE_CSR_AUTH_FAIL 0x00010000 /* ICV mismatch (inbound) */
++#define SAFE_PE_CSR_PAD_FAIL 0x00020000 /* pad verify fail (inbound) */
++#define SAFE_PE_CSR_SEQ_FAIL 0x00040000 /* sequence number (inbound) */
++#define SAFE_PE_CSR_XERROR 0x00080000 /* extended error follows */
++#define SAFE_PE_CSR_XECODE 0x00f00000 /* extended error code */
++#define SAFE_PE_CSR_XECODE_S 20
++#define SAFE_PE_CSR_XECODE_BADCMD 0 /* invalid command */
++#define SAFE_PE_CSR_XECODE_BADALG 1 /* invalid algorithm */
++#define SAFE_PE_CSR_XECODE_ALGDIS 2 /* algorithm disabled */
++#define SAFE_PE_CSR_XECODE_ZEROLEN 3 /* zero packet length */
++#define SAFE_PE_CSR_XECODE_DMAERR 4 /* bus DMA error */
++#define SAFE_PE_CSR_XECODE_PIPEABORT 5 /* secondary bus DMA error */
++#define SAFE_PE_CSR_XECODE_BADSPI 6 /* IPsec SPI mismatch */
++#define SAFE_PE_CSR_XECODE_TIMEOUT 10 /* failsafe timeout */
++#define SAFE_PE_CSR_PAD 0xff000000 /* ESP padding control/status */
++#define SAFE_PE_CSR_PAD_MIN 0x00000000 /* minimum IPsec padding */
++#define SAFE_PE_CSR_PAD_16 0x08000000 /* pad to 16-byte boundary */
++#define SAFE_PE_CSR_PAD_32 0x10000000 /* pad to 32-byte boundary */
++#define SAFE_PE_CSR_PAD_64 0x20000000 /* pad to 64-byte boundary */
++#define SAFE_PE_CSR_PAD_128 0x40000000 /* pad to 128-byte boundary */
++#define SAFE_PE_CSR_PAD_256 0x80000000 /* pad to 256-byte boundary */
++
++/*
++ * Check the CSR to see if the PE has returned ownership to
++ * the host. Note that before processing a descriptor this
++ * must be done followed by a check of the SAFE_PE_LEN register
++ * status bits to avoid premature processing of a descriptor
++ * on its way back to the host.
++ */
++#define SAFE_PE_CSR_IS_DONE(_csr) \
++ (((_csr) & (SAFE_PE_CSR_READY | SAFE_PE_CSR_DONE)) == SAFE_PE_CSR_DONE)
++
++#define SAFE_PE_LEN_LENGTH 0x000fffff /* total length (bytes) */
++#define SAFE_PE_LEN_READY 0x00400000 /* ready for processing */
++#define SAFE_PE_LEN_DONE 0x00800000 /* h/w completed processing */
++#define SAFE_PE_LEN_BYPASS 0xff000000 /* bypass offset (bytes) */
++#define SAFE_PE_LEN_BYPASS_S 24
++
++#define SAFE_PE_LEN_IS_DONE(_len) \
++ (((_len) & (SAFE_PE_LEN_READY | SAFE_PE_LEN_DONE)) == SAFE_PE_LEN_DONE)
++
++/* NB: these apply to HU_STAT, HM_STAT, HI_CLR, and HI_MASK */
++#define SAFE_INT_PE_CDONE 0x00000002 /* PE context done */
++#define SAFE_INT_PE_DDONE 0x00000008 /* PE descriptor done */
++#define SAFE_INT_PE_ERROR 0x00000010 /* PE error */
++#define SAFE_INT_PE_ODONE 0x00000020 /* PE operation done */
++
++#define SAFE_HI_CFG_PULSE 0x00000001 /* use pulse interrupt */
++#define SAFE_HI_CFG_LEVEL 0x00000000 /* use level interrupt */
++#define SAFE_HI_CFG_AUTOCLR 0x00000002 /* auto-clear pulse interrupt */
++
++#define SAFE_ENDIAN_PASS 0x000000e4 /* straight pass-thru */
++#define SAFE_ENDIAN_SWAB 0x0000001b /* swap bytes in 32-bit word */
++
++#define SAFE_PE_DMACFG_PERESET 0x00000001 /* reset packet engine */
++#define SAFE_PE_DMACFG_PDRRESET 0x00000002 /* reset PDR counters/ptrs */
++#define SAFE_PE_DMACFG_SGRESET 0x00000004 /* reset scatter/gather cache */
++#define SAFE_PE_DMACFG_FSENA 0x00000008 /* enable failsafe reset */
++#define SAFE_PE_DMACFG_PEMODE 0x00000100 /* packet engine mode */
++#define SAFE_PE_DMACFG_SAPREC 0x00000200 /* SA precedes packet */
++#define SAFE_PE_DMACFG_PKFOLL 0x00000400 /* packet follows descriptor */
++#define SAFE_PE_DMACFG_GPRBID 0x00003000 /* gather particle ring busid */
++#define SAFE_PE_DMACFG_GPRPCI 0x00001000 /* PCI gather particle ring */
++#define SAFE_PE_DMACFG_SPRBID 0x0000c000 /* scatter part. ring busid */
++#define SAFE_PE_DMACFG_SPRPCI 0x00004000 /* PCI scatter part. ring */
++#define SAFE_PE_DMACFG_ESDESC 0x00010000 /* endian swap descriptors */
++#define SAFE_PE_DMACFG_ESSA 0x00020000 /* endian swap SA data */
++#define SAFE_PE_DMACFG_ESPACKET 0x00040000 /* endian swap packet data */
++#define SAFE_PE_DMACFG_ESPDESC 0x00080000 /* endian swap particle desc. */
++#define SAFE_PE_DMACFG_NOPDRUP 0x00100000 /* supp. PDR ownership update */
++#define SAFE_PD_EDMACFG_PCIMODE 0x01000000 /* PCI target mode */
++
++#define SAFE_PE_DMASTAT_PEIDONE 0x00000001 /* PE core input done */
++#define SAFE_PE_DMASTAT_PEODONE 0x00000002 /* PE core output done */
++#define SAFE_PE_DMASTAT_ENCDONE 0x00000004 /* encryption done */
++#define SAFE_PE_DMASTAT_IHDONE 0x00000008 /* inner hash done */
++#define SAFE_PE_DMASTAT_OHDONE 0x00000010 /* outer hash (HMAC) done */
++#define SAFE_PE_DMASTAT_PADFLT 0x00000020 /* crypto pad fault */
++#define SAFE_PE_DMASTAT_ICVFLT 0x00000040 /* ICV fault */
++#define SAFE_PE_DMASTAT_SPIMIS 0x00000080 /* SPI mismatch */
++#define SAFE_PE_DMASTAT_CRYPTO 0x00000100 /* crypto engine timeout */
++#define SAFE_PE_DMASTAT_CQACT 0x00000200 /* command queue active */
++#define SAFE_PE_DMASTAT_IRACT 0x00000400 /* input request active */
++#define SAFE_PE_DMASTAT_ORACT 0x00000800 /* output request active */
++#define SAFE_PE_DMASTAT_PEISIZE 0x003ff000 /* PE input size:32-bit words */
++#define SAFE_PE_DMASTAT_PEOSIZE 0xffc00000 /* PE out. size:32-bit words */
++
++#define SAFE_PE_RINGCFG_SIZE 0x000003ff /* ring size (descriptors) */
++#define SAFE_PE_RINGCFG_OFFSET 0xffff0000 /* offset btw desc's (dwords) */
++#define SAFE_PE_RINGCFG_OFFSET_S 16
++
++#define SAFE_PE_RINGPOLL_POLL 0x00000fff /* polling frequency/divisor */
++#define SAFE_PE_RINGPOLL_RETRY 0x03ff0000 /* polling frequency/divisor */
++#define SAFE_PE_RINGPOLL_CONT 0x80000000 /* continuously poll */
++
++#define SAFE_PE_IRNGSTAT_CQAVAIL 0x00000001 /* command queue available */
++
++#define SAFE_PE_ERNGSTAT_NEXT 0x03ff0000 /* index of next packet desc. */
++#define SAFE_PE_ERNGSTAT_NEXT_S 16
++
++#define SAFE_PE_IOTHRESH_INPUT 0x000003ff /* input threshold (dwords) */
++#define SAFE_PE_IOTHRESH_OUTPUT 0x03ff0000 /* output threshold (dwords) */
++
++#define SAFE_PE_PARTCFG_SIZE 0x0000ffff /* scatter particle size */
++#define SAFE_PE_PARTCFG_GBURST 0x00030000 /* gather particle burst */
++#define SAFE_PE_PARTCFG_GBURST_2 0x00000000
++#define SAFE_PE_PARTCFG_GBURST_4 0x00010000
++#define SAFE_PE_PARTCFG_GBURST_8 0x00020000
++#define SAFE_PE_PARTCFG_GBURST_16 0x00030000
++#define SAFE_PE_PARTCFG_SBURST 0x000c0000 /* scatter particle burst */
++#define SAFE_PE_PARTCFG_SBURST_2 0x00000000
++#define SAFE_PE_PARTCFG_SBURST_4 0x00040000
++#define SAFE_PE_PARTCFG_SBURST_8 0x00080000
++#define SAFE_PE_PARTCFG_SBURST_16 0x000c0000
++
++#define SAFE_PE_PARTSIZE_SCAT 0xffff0000 /* scatter particle ring size */
++#define SAFE_PE_PARTSIZE_GATH 0x0000ffff /* gather particle ring size */
++
++#define SAFE_CRYPTO_CTRL_3DES 0x00000001 /* enable 3DES support */
++#define SAFE_CRYPTO_CTRL_PKEY 0x00010000 /* enable public key support */
++#define SAFE_CRYPTO_CTRL_RNG 0x00020000 /* enable RNG support */
++
++#define SAFE_DEVINFO_REV_MIN 0x0000000f /* minor rev for chip */
++#define SAFE_DEVINFO_REV_MAJ 0x000000f0 /* major rev for chip */
++#define SAFE_DEVINFO_REV_MAJ_S 4
++#define SAFE_DEVINFO_DES 0x00000100 /* DES/3DES support present */
++#define SAFE_DEVINFO_ARC4 0x00000200 /* ARC4 support present */
++#define SAFE_DEVINFO_AES 0x00000400 /* AES support present */
++#define SAFE_DEVINFO_MD5 0x00001000 /* MD5 support present */
++#define SAFE_DEVINFO_SHA1 0x00002000 /* SHA-1 support present */
++#define SAFE_DEVINFO_RIPEMD 0x00004000 /* RIPEMD support present */
++#define SAFE_DEVINFO_DEFLATE 0x00010000 /* Deflate support present */
++#define SAFE_DEVINFO_SARAM 0x00100000 /* on-chip SA RAM present */
++#define SAFE_DEVINFO_EMIBUS 0x00200000 /* EMI bus present */
++#define SAFE_DEVINFO_PKEY 0x00400000 /* public key support present */
++#define SAFE_DEVINFO_RNG 0x00800000 /* RNG present */
++
++#define SAFE_REV(_maj, _min) (((_maj) << SAFE_DEVINFO_REV_MAJ_S) | (_min))
++#define SAFE_REV_MAJ(_chiprev) \
++ (((_chiprev) & SAFE_DEVINFO_REV_MAJ) >> SAFE_DEVINFO_REV_MAJ_S)
++#define SAFE_REV_MIN(_chiprev) ((_chiprev) & SAFE_DEVINFO_REV_MIN)
++
++#define SAFE_PK_FUNC_MULT 0x00000001 /* Multiply function */
++#define SAFE_PK_FUNC_SQUARE 0x00000004 /* Square function */
++#define SAFE_PK_FUNC_ADD 0x00000010 /* Add function */
++#define SAFE_PK_FUNC_SUB 0x00000020 /* Subtract function */
++#define SAFE_PK_FUNC_LSHIFT 0x00000040 /* Left-shift function */
++#define SAFE_PK_FUNC_RSHIFT 0x00000080 /* Right-shift function */
++#define SAFE_PK_FUNC_DIV 0x00000100 /* Divide function */
++#define SAFE_PK_FUNC_CMP 0x00000400 /* Compare function */
++#define SAFE_PK_FUNC_COPY 0x00000800 /* Copy function */
++#define SAFE_PK_FUNC_EXP16 0x00002000 /* Exponentiate (4-bit ACT) */
++#define SAFE_PK_FUNC_EXP4 0x00004000 /* Exponentiate (2-bit ACT) */
++#define SAFE_PK_FUNC_RUN 0x00008000 /* start/status */
++
++#define SAFE_RNG_STAT_BUSY 0x00000001 /* busy, data not valid */
++
++#define SAFE_RNG_CTRL_PRE_LFSR 0x00000001 /* enable output pre-LFSR */
++#define SAFE_RNG_CTRL_TST_MODE 0x00000002 /* enable test mode */
++#define SAFE_RNG_CTRL_TST_RUN 0x00000004 /* start test state machine */
++#define SAFE_RNG_CTRL_ENA_RING1 0x00000008 /* test entropy oscillator #1 */
++#define SAFE_RNG_CTRL_ENA_RING2 0x00000010 /* test entropy oscillator #2 */
++#define SAFE_RNG_CTRL_DIS_ALARM 0x00000020 /* disable RNG alarm reports */
++#define SAFE_RNG_CTRL_TST_CLOCK 0x00000040 /* enable test clock */
++#define SAFE_RNG_CTRL_SHORTEN 0x00000080 /* shorten state timers */
++#define SAFE_RNG_CTRL_TST_ALARM 0x00000100 /* simulate alarm state */
++#define SAFE_RNG_CTRL_RST_LFSR 0x00000200 /* reset LFSR */
++
++/*
++ * Packet engine descriptor. Note that d_csr is a copy of the
++ * SAFE_PE_CSR register and all definitions apply, and d_len
++ * is a copy of the SAFE_PE_LEN register and all definitions apply.
++ * d_src and d_len may point directly to contiguous data or to a
++ * list of ``particle descriptors'' when using scatter/gather i/o.
++ */
++struct safe_desc {
++ u_int32_t d_csr; /* per-packet control/status */
++ u_int32_t d_src; /* source address */
++ u_int32_t d_dst; /* destination address */
++ u_int32_t d_sa; /* SA address */
++ u_int32_t d_len; /* length, bypass, status */
++};
++
++/*
++ * Scatter/Gather particle descriptor.
++ *
++ * NB: scatter descriptors do not specify a size; this is fixed
++ * by the setting of the SAFE_PE_PARTCFG register.
++ */
++struct safe_pdesc {
++ u_int32_t pd_addr; /* particle address */
++#ifdef __BIG_ENDIAN
++ u_int16_t pd_flags; /* control word */
++ u_int16_t pd_size; /* particle size (bytes) */
++#else
++ u_int16_t pd_flags; /* control word */
++ u_int16_t pd_size; /* particle size (bytes) */
++#endif
++};
++
++#define SAFE_PD_READY 0x0001 /* ready for processing */
++#define SAFE_PD_DONE 0x0002 /* h/w completed processing */
++
++/*
++ * Security Association (SA) Record (Rev 1). One of these is
++ * required for each operation processed by the packet engine.
++ */
++struct safe_sarec {
++ u_int32_t sa_cmd0;
++ u_int32_t sa_cmd1;
++ u_int32_t sa_resv0;
++ u_int32_t sa_resv1;
++ u_int32_t sa_key[8]; /* DES/3DES/AES key */
++ u_int32_t sa_indigest[5]; /* inner digest */
++ u_int32_t sa_outdigest[5]; /* outer digest */
++ u_int32_t sa_spi; /* SPI */
++ u_int32_t sa_seqnum; /* sequence number */
++ u_int32_t sa_seqmask[2]; /* sequence number mask */
++ u_int32_t sa_resv2;
++ u_int32_t sa_staterec; /* address of state record */
++ u_int32_t sa_resv3[2];
++ u_int32_t sa_samgmt0; /* SA management field 0 */
++ u_int32_t sa_samgmt1; /* SA management field 0 */
++};
++
++#define SAFE_SA_CMD0_OP 0x00000007 /* operation code */
++#define SAFE_SA_CMD0_OP_CRYPT 0x00000000 /* encrypt/decrypt (basic) */
++#define SAFE_SA_CMD0_OP_BOTH 0x00000001 /* encrypt-hash/hash-decrypto */
++#define SAFE_SA_CMD0_OP_HASH 0x00000003 /* hash (outbound-only) */
++#define SAFE_SA_CMD0_OP_ESP 0x00000000 /* ESP in/out (proto) */
++#define SAFE_SA_CMD0_OP_AH 0x00000001 /* AH in/out (proto) */
++#define SAFE_SA_CMD0_INBOUND 0x00000008 /* inbound operation */
++#define SAFE_SA_CMD0_OUTBOUND 0x00000000 /* outbound operation */
++#define SAFE_SA_CMD0_GROUP 0x00000030 /* operation group */
++#define SAFE_SA_CMD0_BASIC 0x00000000 /* basic operation */
++#define SAFE_SA_CMD0_PROTO 0x00000010 /* protocol/packet operation */
++#define SAFE_SA_CMD0_BUNDLE 0x00000020 /* bundled operation (resvd) */
++#define SAFE_SA_CMD0_PAD 0x000000c0 /* crypto pad method */
++#define SAFE_SA_CMD0_PAD_IPSEC 0x00000000 /* IPsec padding */
++#define SAFE_SA_CMD0_PAD_PKCS7 0x00000040 /* PKCS#7 padding */
++#define SAFE_SA_CMD0_PAD_CONS 0x00000080 /* constant padding */
++#define SAFE_SA_CMD0_PAD_ZERO 0x000000c0 /* zero padding */
++#define SAFE_SA_CMD0_CRYPT_ALG 0x00000f00 /* symmetric crypto algorithm */
++#define SAFE_SA_CMD0_DES 0x00000000 /* DES crypto algorithm */
++#define SAFE_SA_CMD0_3DES 0x00000100 /* 3DES crypto algorithm */
++#define SAFE_SA_CMD0_AES 0x00000300 /* AES crypto algorithm */
++#define SAFE_SA_CMD0_CRYPT_NULL 0x00000f00 /* null crypto algorithm */
++#define SAFE_SA_CMD0_HASH_ALG 0x0000f000 /* hash algorithm */
++#define SAFE_SA_CMD0_MD5 0x00000000 /* MD5 hash algorithm */
++#define SAFE_SA_CMD0_SHA1 0x00001000 /* SHA-1 hash algorithm */
++#define SAFE_SA_CMD0_HASH_NULL 0x0000f000 /* null hash algorithm */
++#define SAFE_SA_CMD0_HDR_PROC 0x00080000 /* header processing */
++#define SAFE_SA_CMD0_IBUSID 0x00300000 /* input bus id */
++#define SAFE_SA_CMD0_IPCI 0x00100000 /* PCI input bus id */
++#define SAFE_SA_CMD0_OBUSID 0x00c00000 /* output bus id */
++#define SAFE_SA_CMD0_OPCI 0x00400000 /* PCI output bus id */
++#define SAFE_SA_CMD0_IVLD 0x03000000 /* IV loading */
++#define SAFE_SA_CMD0_IVLD_NONE 0x00000000 /* IV no load (reuse) */
++#define SAFE_SA_CMD0_IVLD_IBUF 0x01000000 /* IV load from input buffer */
++#define SAFE_SA_CMD0_IVLD_STATE 0x02000000 /* IV load from state */
++#define SAFE_SA_CMD0_HSLD 0x0c000000 /* hash state loading */
++#define SAFE_SA_CMD0_HSLD_SA 0x00000000 /* hash state load from SA */
++#define SAFE_SA_CMD0_HSLD_STATE 0x08000000 /* hash state load from state */
++#define SAFE_SA_CMD0_HSLD_NONE 0x0c000000 /* hash state no load */
++#define SAFE_SA_CMD0_SAVEIV 0x10000000 /* save IV */
++#define SAFE_SA_CMD0_SAVEHASH 0x20000000 /* save hash state */
++#define SAFE_SA_CMD0_IGATHER 0x40000000 /* input gather */
++#define SAFE_SA_CMD0_OSCATTER 0x80000000 /* output scatter */
++
++#define SAFE_SA_CMD1_HDRCOPY 0x00000002 /* copy header to output */
++#define SAFE_SA_CMD1_PAYCOPY 0x00000004 /* copy payload to output */
++#define SAFE_SA_CMD1_PADCOPY 0x00000008 /* copy pad to output */
++#define SAFE_SA_CMD1_IPV4 0x00000000 /* IPv4 protocol */
++#define SAFE_SA_CMD1_IPV6 0x00000010 /* IPv6 protocol */
++#define SAFE_SA_CMD1_MUTABLE 0x00000020 /* mutable bit processing */
++#define SAFE_SA_CMD1_SRBUSID 0x000000c0 /* state record bus id */
++#define SAFE_SA_CMD1_SRPCI 0x00000040 /* state record from PCI */
++#define SAFE_SA_CMD1_CRMODE 0x00000300 /* crypto mode */
++#define SAFE_SA_CMD1_ECB 0x00000000 /* ECB crypto mode */
++#define SAFE_SA_CMD1_CBC 0x00000100 /* CBC crypto mode */
++#define SAFE_SA_CMD1_OFB 0x00000200 /* OFB crypto mode */
++#define SAFE_SA_CMD1_CFB 0x00000300 /* CFB crypto mode */
++#define SAFE_SA_CMD1_CRFEEDBACK 0x00000c00 /* crypto feedback mode */
++#define SAFE_SA_CMD1_64BIT 0x00000000 /* 64-bit crypto feedback */
++#define SAFE_SA_CMD1_8BIT 0x00000400 /* 8-bit crypto feedback */
++#define SAFE_SA_CMD1_1BIT 0x00000800 /* 1-bit crypto feedback */
++#define SAFE_SA_CMD1_128BIT 0x00000c00 /* 128-bit crypto feedback */
++#define SAFE_SA_CMD1_OPTIONS 0x00001000 /* HMAC/options mutable bit */
++#define SAFE_SA_CMD1_HMAC SAFE_SA_CMD1_OPTIONS
++#define SAFE_SA_CMD1_SAREV1 0x00008000 /* SA Revision 1 */
++#define SAFE_SA_CMD1_OFFSET 0x00ff0000 /* hash/crypto offset(dwords) */
++#define SAFE_SA_CMD1_OFFSET_S 16
++#define SAFE_SA_CMD1_AESKEYLEN 0x0f000000 /* AES key length */
++#define SAFE_SA_CMD1_AES128 0x02000000 /* 128-bit AES key */
++#define SAFE_SA_CMD1_AES192 0x03000000 /* 192-bit AES key */
++#define SAFE_SA_CMD1_AES256 0x04000000 /* 256-bit AES key */
++
++/*
++ * Security Associate State Record (Rev 1).
++ */
++struct safe_sastate {
++ u_int32_t sa_saved_iv[4]; /* saved IV (DES/3DES/AES) */
++ u_int32_t sa_saved_hashbc; /* saved hash byte count */
++ u_int32_t sa_saved_indigest[5]; /* saved inner digest */
++};
++#endif /* _SAFE_SAFEREG_H_ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/safevar.h linux-2.6.27.10/crypto/ocf/safe/safevar.h
+--- linux-2.6.27.10.orig/crypto/ocf/safe/safevar.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/safevar.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,230 @@
++/*-
++ * The linux port of this code done by David McCullough
++ * Copyright (C) 2004-2007 David McCullough <david_mccullough@securecomputing.com>
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2003 Sam Leffler, Errno Consulting
++ * Copyright (c) 2003 Global Technology Associates, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * $FreeBSD: src/sys/dev/safe/safevar.h,v 1.2 2006/05/17 18:34:26 pjd Exp $
++ */
++#ifndef _SAFE_SAFEVAR_H_
++#define _SAFE_SAFEVAR_H_
++
++/* Maximum queue length */
++#ifndef SAFE_MAX_NQUEUE
++#define SAFE_MAX_NQUEUE 60
++#endif
++
++#define SAFE_MAX_PART 64 /* Maximum scatter/gather depth */
++#define SAFE_DMA_BOUNDARY 0 /* No boundary for source DMA ops */
++#define SAFE_MAX_DSIZE 2048 /* MCLBYTES Fixed scatter particle size */
++#define SAFE_MAX_SSIZE 0x0ffff /* Maximum gather particle size */
++#define SAFE_MAX_DMA 0xfffff /* Maximum PE operand size (20 bits) */
++/* total src+dst particle descriptors */
++#define SAFE_TOTAL_DPART (SAFE_MAX_NQUEUE * SAFE_MAX_PART)
++#define SAFE_TOTAL_SPART (SAFE_MAX_NQUEUE * SAFE_MAX_PART)
++
++#define SAFE_RNG_MAXBUFSIZ 128 /* 32-bit words */
++
++#define SAFE_CARD(sid) (((sid) & 0xf0000000) >> 28)
++#define SAFE_SESSION(sid) ( (sid) & 0x0fffffff)
++#define SAFE_SID(crd, sesn) (((crd) << 28) | ((sesn) & 0x0fffffff))
++
++#define SAFE_DEF_RTY 0xff /* PCI Retry Timeout */
++#define SAFE_DEF_TOUT 0xff /* PCI TRDY Timeout */
++#define SAFE_DEF_CACHELINE 0x01 /* Cache Line setting */
++
++#ifdef __KERNEL__
++/*
++ * State associated with the allocation of each chunk
++ * of memory setup for DMA.
++ */
++struct safe_dma_alloc {
++ dma_addr_t dma_paddr;
++ void *dma_vaddr;
++};
++
++/*
++ * Cryptographic operand state. One of these exists for each
++ * source and destination operand passed in from the crypto
++ * subsystem. When possible source and destination operands
++ * refer to the same memory. More often they are distinct.
++ * We track the virtual address of each operand as well as
++ * where each is mapped for DMA.
++ */
++struct safe_operand {
++ union {
++ struct sk_buff *skb;
++ struct uio *io;
++ } u;
++ void *map;
++ int mapsize; /* total number of bytes in segs */
++ struct {
++ dma_addr_t ds_addr;
++ int ds_len;
++ int ds_tlen;
++ } segs[SAFE_MAX_PART];
++ int nsegs;
++};
++
++/*
++ * Packet engine ring entry and cryptographic operation state.
++ * The packet engine requires a ring of descriptors that contain
++ * pointers to various cryptographic state. However the ring
++ * configuration register allows you to specify an arbitrary size
++ * for ring entries. We use this feature to collect most of the
++ * state for each cryptographic request into one spot. Other than
++ * ring entries only the ``particle descriptors'' (scatter/gather
++ * lists) and the actual operand data are kept separate. The
++ * particle descriptors must also be organized in rings. The
++ * operand data can be located aribtrarily (modulo alignment constraints).
++ *
++ * Note that the descriptor ring is mapped onto the PCI bus so
++ * the hardware can DMA data. This means the entire ring must be
++ * contiguous.
++ */
++struct safe_ringentry {
++ struct safe_desc re_desc; /* command descriptor */
++ struct safe_sarec re_sa; /* SA record */
++ struct safe_sastate re_sastate; /* SA state record */
++
++ struct cryptop *re_crp; /* crypto operation */
++
++ struct safe_operand re_src; /* source operand */
++ struct safe_operand re_dst; /* destination operand */
++
++ int re_sesn; /* crypto session ID */
++ int re_flags;
++#define SAFE_QFLAGS_COPYOUTIV 0x1 /* copy back on completion */
++#define SAFE_QFLAGS_COPYOUTICV 0x2 /* copy back on completion */
++};
++
++#define re_src_skb re_src.u.skb
++#define re_src_io re_src.u.io
++#define re_src_map re_src.map
++#define re_src_nsegs re_src.nsegs
++#define re_src_segs re_src.segs
++#define re_src_mapsize re_src.mapsize
++
++#define re_dst_skb re_dst.u.skb
++#define re_dst_io re_dst.u.io
++#define re_dst_map re_dst.map
++#define re_dst_nsegs re_dst.nsegs
++#define re_dst_segs re_dst.segs
++#define re_dst_mapsize re_dst.mapsize
++
++struct rndstate_test;
++
++struct safe_session {
++ u_int32_t ses_used;
++ u_int32_t ses_klen; /* key length in bits */
++ u_int32_t ses_key[8]; /* DES/3DES/AES key */
++ u_int32_t ses_mlen; /* hmac length in bytes */
++ u_int32_t ses_hminner[5]; /* hmac inner state */
++ u_int32_t ses_hmouter[5]; /* hmac outer state */
++ u_int32_t ses_iv[4]; /* DES/3DES/AES iv */
++};
++
++struct safe_pkq {
++ struct list_head pkq_list;
++ struct cryptkop *pkq_krp;
++};
++
++struct safe_softc {
++ softc_device_decl sc_dev;
++ u32 sc_irq;
++
++ struct pci_dev *sc_pcidev;
++ ocf_iomem_t sc_base_addr;
++
++ u_int sc_chiprev; /* major/minor chip revision */
++ int sc_flags; /* device specific flags */
++#define SAFE_FLAGS_KEY 0x01 /* has key accelerator */
++#define SAFE_FLAGS_RNG 0x02 /* hardware rng */
++ int sc_suspended;
++ int sc_needwakeup; /* notify crypto layer */
++ int32_t sc_cid; /* crypto tag */
++
++ struct safe_dma_alloc sc_ringalloc; /* PE ring allocation state */
++ struct safe_ringentry *sc_ring; /* PE ring */
++ struct safe_ringentry *sc_ringtop; /* PE ring top */
++ struct safe_ringentry *sc_front; /* next free entry */
++ struct safe_ringentry *sc_back; /* next pending entry */
++ int sc_nqchip; /* # passed to chip */
++ spinlock_t sc_ringmtx; /* PE ring lock */
++ struct safe_pdesc *sc_spring; /* src particle ring */
++ struct safe_pdesc *sc_springtop; /* src particle ring top */
++ struct safe_pdesc *sc_spfree; /* next free src particle */
++ struct safe_dma_alloc sc_spalloc; /* src particle ring state */
++ struct safe_pdesc *sc_dpring; /* dest particle ring */
++ struct safe_pdesc *sc_dpringtop; /* dest particle ring top */
++ struct safe_pdesc *sc_dpfree; /* next free dest particle */
++ struct safe_dma_alloc sc_dpalloc; /* dst particle ring state */
++ int sc_nsessions; /* # of sessions */
++ struct safe_session *sc_sessions; /* sessions */
++
++ struct timer_list sc_pkto; /* PK polling */
++ spinlock_t sc_pkmtx; /* PK lock */
++ struct list_head sc_pkq; /* queue of PK requests */
++ struct safe_pkq *sc_pkq_cur; /* current processing request */
++ u_int32_t sc_pk_reslen, sc_pk_resoff;
++
++ int sc_max_dsize; /* maximum safe DMA size */
++};
++#endif /* __KERNEL__ */
++
++struct safe_stats {
++ u_int64_t st_ibytes;
++ u_int64_t st_obytes;
++ u_int32_t st_ipackets;
++ u_int32_t st_opackets;
++ u_int32_t st_invalid; /* invalid argument */
++ u_int32_t st_badsession; /* invalid session id */
++ u_int32_t st_badflags; /* flags indicate !(mbuf | uio) */
++ u_int32_t st_nodesc; /* op submitted w/o descriptors */
++ u_int32_t st_badalg; /* unsupported algorithm */
++ u_int32_t st_ringfull; /* PE descriptor ring full */
++ u_int32_t st_peoperr; /* PE marked error */
++ u_int32_t st_dmaerr; /* PE DMA error */
++ u_int32_t st_bypasstoobig; /* bypass > 96 bytes */
++ u_int32_t st_skipmismatch; /* enc part begins before auth part */
++ u_int32_t st_lenmismatch; /* enc length different auth length */
++ u_int32_t st_coffmisaligned; /* crypto offset not 32-bit aligned */
++ u_int32_t st_cofftoobig; /* crypto offset > 255 words */
++ u_int32_t st_iovmisaligned; /* iov op not aligned */
++ u_int32_t st_iovnotuniform; /* iov op not suitable */
++ u_int32_t st_unaligned; /* unaligned src caused copy */
++ u_int32_t st_notuniform; /* non-uniform src caused copy */
++ u_int32_t st_nomap; /* bus_dmamap_create failed */
++ u_int32_t st_noload; /* bus_dmamap_load_* failed */
++ u_int32_t st_nombuf; /* MGET* failed */
++ u_int32_t st_nomcl; /* MCLGET* failed */
++ u_int32_t st_maxqchip; /* max mcr1 ops out for processing */
++ u_int32_t st_rng; /* RNG requests */
++ u_int32_t st_rngalarm; /* RNG alarm requests */
++ u_int32_t st_noicvcopy; /* ICV data copies suppressed */
++};
++#endif /* _SAFE_SAFEVAR_H_ */
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/sha1.c linux-2.6.27.10/crypto/ocf/safe/sha1.c
+--- linux-2.6.27.10.orig/crypto/ocf/safe/sha1.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/sha1.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,279 @@
++/* $KAME: sha1.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++/*
++ * FIPS pub 180-1: Secure Hash Algorithm (SHA-1)
++ * based on: http://csrc.nist.gov/fips/fip180-1.txt
++ * implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
++ */
++
++#if 0
++#include <sys/cdefs.h>
++__FBSDID("$FreeBSD: src/sys/crypto/sha1.c,v 1.9 2003/06/10 21:36:57 obrien Exp $");
++
++#include <sys/types.h>
++#include <sys/cdefs.h>
++#include <sys/time.h>
++#include <sys/systm.h>
++
++#include <crypto/sha1.h>
++#endif
++
++/* sanity check */
++#if BYTE_ORDER != BIG_ENDIAN
++# if BYTE_ORDER != LITTLE_ENDIAN
++# define unsupported 1
++# endif
++#endif
++
++#ifndef unsupported
++
++/* constant table */
++static u_int32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
++#define K(t) _K[(t) / 20]
++
++#define F0(b, c, d) (((b) & (c)) | ((~(b)) & (d)))
++#define F1(b, c, d) (((b) ^ (c)) ^ (d))
++#define F2(b, c, d) (((b) & (c)) | ((b) & (d)) | ((c) & (d)))
++#define F3(b, c, d) (((b) ^ (c)) ^ (d))
++
++#define S(n, x) (((x) << (n)) | ((x) >> (32 - n)))
++
++#undef H
++#define H(n) (ctxt->h.b32[(n)])
++#define COUNT (ctxt->count)
++#define BCOUNT (ctxt->c.b64[0] / 8)
++#define W(n) (ctxt->m.b32[(n)])
++
++#define PUTBYTE(x) { \
++ ctxt->m.b8[(COUNT % 64)] = (x); \
++ COUNT++; \
++ COUNT %= 64; \
++ ctxt->c.b64[0] += 8; \
++ if (COUNT % 64 == 0) \
++ sha1_step(ctxt); \
++ }
++
++#define PUTPAD(x) { \
++ ctxt->m.b8[(COUNT % 64)] = (x); \
++ COUNT++; \
++ COUNT %= 64; \
++ if (COUNT % 64 == 0) \
++ sha1_step(ctxt); \
++ }
++
++static void sha1_step(struct sha1_ctxt *);
++
++static void
++sha1_step(ctxt)
++ struct sha1_ctxt *ctxt;
++{
++ u_int32_t a, b, c, d, e;
++ size_t t, s;
++ u_int32_t tmp;
++
++#if BYTE_ORDER == LITTLE_ENDIAN
++ struct sha1_ctxt tctxt;
++ bcopy(&ctxt->m.b8[0], &tctxt.m.b8[0], 64);
++ ctxt->m.b8[0] = tctxt.m.b8[3]; ctxt->m.b8[1] = tctxt.m.b8[2];
++ ctxt->m.b8[2] = tctxt.m.b8[1]; ctxt->m.b8[3] = tctxt.m.b8[0];
++ ctxt->m.b8[4] = tctxt.m.b8[7]; ctxt->m.b8[5] = tctxt.m.b8[6];
++ ctxt->m.b8[6] = tctxt.m.b8[5]; ctxt->m.b8[7] = tctxt.m.b8[4];
++ ctxt->m.b8[8] = tctxt.m.b8[11]; ctxt->m.b8[9] = tctxt.m.b8[10];
++ ctxt->m.b8[10] = tctxt.m.b8[9]; ctxt->m.b8[11] = tctxt.m.b8[8];
++ ctxt->m.b8[12] = tctxt.m.b8[15]; ctxt->m.b8[13] = tctxt.m.b8[14];
++ ctxt->m.b8[14] = tctxt.m.b8[13]; ctxt->m.b8[15] = tctxt.m.b8[12];
++ ctxt->m.b8[16] = tctxt.m.b8[19]; ctxt->m.b8[17] = tctxt.m.b8[18];
++ ctxt->m.b8[18] = tctxt.m.b8[17]; ctxt->m.b8[19] = tctxt.m.b8[16];
++ ctxt->m.b8[20] = tctxt.m.b8[23]; ctxt->m.b8[21] = tctxt.m.b8[22];
++ ctxt->m.b8[22] = tctxt.m.b8[21]; ctxt->m.b8[23] = tctxt.m.b8[20];
++ ctxt->m.b8[24] = tctxt.m.b8[27]; ctxt->m.b8[25] = tctxt.m.b8[26];
++ ctxt->m.b8[26] = tctxt.m.b8[25]; ctxt->m.b8[27] = tctxt.m.b8[24];
++ ctxt->m.b8[28] = tctxt.m.b8[31]; ctxt->m.b8[29] = tctxt.m.b8[30];
++ ctxt->m.b8[30] = tctxt.m.b8[29]; ctxt->m.b8[31] = tctxt.m.b8[28];
++ ctxt->m.b8[32] = tctxt.m.b8[35]; ctxt->m.b8[33] = tctxt.m.b8[34];
++ ctxt->m.b8[34] = tctxt.m.b8[33]; ctxt->m.b8[35] = tctxt.m.b8[32];
++ ctxt->m.b8[36] = tctxt.m.b8[39]; ctxt->m.b8[37] = tctxt.m.b8[38];
++ ctxt->m.b8[38] = tctxt.m.b8[37]; ctxt->m.b8[39] = tctxt.m.b8[36];
++ ctxt->m.b8[40] = tctxt.m.b8[43]; ctxt->m.b8[41] = tctxt.m.b8[42];
++ ctxt->m.b8[42] = tctxt.m.b8[41]; ctxt->m.b8[43] = tctxt.m.b8[40];
++ ctxt->m.b8[44] = tctxt.m.b8[47]; ctxt->m.b8[45] = tctxt.m.b8[46];
++ ctxt->m.b8[46] = tctxt.m.b8[45]; ctxt->m.b8[47] = tctxt.m.b8[44];
++ ctxt->m.b8[48] = tctxt.m.b8[51]; ctxt->m.b8[49] = tctxt.m.b8[50];
++ ctxt->m.b8[50] = tctxt.m.b8[49]; ctxt->m.b8[51] = tctxt.m.b8[48];
++ ctxt->m.b8[52] = tctxt.m.b8[55]; ctxt->m.b8[53] = tctxt.m.b8[54];
++ ctxt->m.b8[54] = tctxt.m.b8[53]; ctxt->m.b8[55] = tctxt.m.b8[52];
++ ctxt->m.b8[56] = tctxt.m.b8[59]; ctxt->m.b8[57] = tctxt.m.b8[58];
++ ctxt->m.b8[58] = tctxt.m.b8[57]; ctxt->m.b8[59] = tctxt.m.b8[56];
++ ctxt->m.b8[60] = tctxt.m.b8[63]; ctxt->m.b8[61] = tctxt.m.b8[62];
++ ctxt->m.b8[62] = tctxt.m.b8[61]; ctxt->m.b8[63] = tctxt.m.b8[60];
++#endif
++
++ a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
++
++ for (t = 0; t < 20; t++) {
++ s = t & 0x0f;
++ if (t >= 16) {
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ }
++ tmp = S(5, a) + F0(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++ for (t = 20; t < 40; t++) {
++ s = t & 0x0f;
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ tmp = S(5, a) + F1(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++ for (t = 40; t < 60; t++) {
++ s = t & 0x0f;
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ tmp = S(5, a) + F2(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++ for (t = 60; t < 80; t++) {
++ s = t & 0x0f;
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ tmp = S(5, a) + F3(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++
++ H(0) = H(0) + a;
++ H(1) = H(1) + b;
++ H(2) = H(2) + c;
++ H(3) = H(3) + d;
++ H(4) = H(4) + e;
++
++ bzero(&ctxt->m.b8[0], 64);
++}
++
++/*------------------------------------------------------------*/
++
++void
++sha1_init(ctxt)
++ struct sha1_ctxt *ctxt;
++{
++ bzero(ctxt, sizeof(struct sha1_ctxt));
++ H(0) = 0x67452301;
++ H(1) = 0xefcdab89;
++ H(2) = 0x98badcfe;
++ H(3) = 0x10325476;
++ H(4) = 0xc3d2e1f0;
++}
++
++void
++sha1_pad(ctxt)
++ struct sha1_ctxt *ctxt;
++{
++ size_t padlen; /*pad length in bytes*/
++ size_t padstart;
++
++ PUTPAD(0x80);
++
++ padstart = COUNT % 64;
++ padlen = 64 - padstart;
++ if (padlen < 8) {
++ bzero(&ctxt->m.b8[padstart], padlen);
++ COUNT += padlen;
++ COUNT %= 64;
++ sha1_step(ctxt);
++ padstart = COUNT % 64; /* should be 0 */
++ padlen = 64 - padstart; /* should be 64 */
++ }
++ bzero(&ctxt->m.b8[padstart], padlen - 8);
++ COUNT += (padlen - 8);
++ COUNT %= 64;
++#if BYTE_ORDER == BIG_ENDIAN
++ PUTPAD(ctxt->c.b8[0]); PUTPAD(ctxt->c.b8[1]);
++ PUTPAD(ctxt->c.b8[2]); PUTPAD(ctxt->c.b8[3]);
++ PUTPAD(ctxt->c.b8[4]); PUTPAD(ctxt->c.b8[5]);
++ PUTPAD(ctxt->c.b8[6]); PUTPAD(ctxt->c.b8[7]);
++#else
++ PUTPAD(ctxt->c.b8[7]); PUTPAD(ctxt->c.b8[6]);
++ PUTPAD(ctxt->c.b8[5]); PUTPAD(ctxt->c.b8[4]);
++ PUTPAD(ctxt->c.b8[3]); PUTPAD(ctxt->c.b8[2]);
++ PUTPAD(ctxt->c.b8[1]); PUTPAD(ctxt->c.b8[0]);
++#endif
++}
++
++void
++sha1_loop(ctxt, input, len)
++ struct sha1_ctxt *ctxt;
++ const u_int8_t *input;
++ size_t len;
++{
++ size_t gaplen;
++ size_t gapstart;
++ size_t off;
++ size_t copysiz;
++
++ off = 0;
++
++ while (off < len) {
++ gapstart = COUNT % 64;
++ gaplen = 64 - gapstart;
++
++ copysiz = (gaplen < len - off) ? gaplen : len - off;
++ bcopy(&input[off], &ctxt->m.b8[gapstart], copysiz);
++ COUNT += copysiz;
++ COUNT %= 64;
++ ctxt->c.b64[0] += copysiz * 8;
++ if (COUNT % 64 == 0)
++ sha1_step(ctxt);
++ off += copysiz;
++ }
++}
++
++void
++sha1_result(ctxt, digest0)
++ struct sha1_ctxt *ctxt;
++ caddr_t digest0;
++{
++ u_int8_t *digest;
++
++ digest = (u_int8_t *)digest0;
++ sha1_pad(ctxt);
++#if BYTE_ORDER == BIG_ENDIAN
++ bcopy(&ctxt->h.b8[0], digest, 20);
++#else
++ digest[0] = ctxt->h.b8[3]; digest[1] = ctxt->h.b8[2];
++ digest[2] = ctxt->h.b8[1]; digest[3] = ctxt->h.b8[0];
++ digest[4] = ctxt->h.b8[7]; digest[5] = ctxt->h.b8[6];
++ digest[6] = ctxt->h.b8[5]; digest[7] = ctxt->h.b8[4];
++ digest[8] = ctxt->h.b8[11]; digest[9] = ctxt->h.b8[10];
++ digest[10] = ctxt->h.b8[9]; digest[11] = ctxt->h.b8[8];
++ digest[12] = ctxt->h.b8[15]; digest[13] = ctxt->h.b8[14];
++ digest[14] = ctxt->h.b8[13]; digest[15] = ctxt->h.b8[12];
++ digest[16] = ctxt->h.b8[19]; digest[17] = ctxt->h.b8[18];
++ digest[18] = ctxt->h.b8[17]; digest[19] = ctxt->h.b8[16];
++#endif
++}
++
++#endif /*unsupported*/
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/safe/sha1.h linux-2.6.27.10/crypto/ocf/safe/sha1.h
+--- linux-2.6.27.10.orig/crypto/ocf/safe/sha1.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/safe/sha1.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,72 @@
++/* $FreeBSD: src/sys/crypto/sha1.h,v 1.8 2002/03/20 05:13:50 alfred Exp $ */
++/* $KAME: sha1.h,v 1.5 2000/03/27 04:36:23 sumikawa Exp $ */
++
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++/*
++ * FIPS pub 180-1: Secure Hash Algorithm (SHA-1)
++ * based on: http://csrc.nist.gov/fips/fip180-1.txt
++ * implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
++ */
++
++#ifndef _NETINET6_SHA1_H_
++#define _NETINET6_SHA1_H_
++
++struct sha1_ctxt {
++ union {
++ u_int8_t b8[20];
++ u_int32_t b32[5];
++ } h;
++ union {
++ u_int8_t b8[8];
++ u_int64_t b64[1];
++ } c;
++ union {
++ u_int8_t b8[64];
++ u_int32_t b32[16];
++ } m;
++ u_int8_t count;
++};
++
++#ifdef __KERNEL__
++extern void sha1_init(struct sha1_ctxt *);
++extern void sha1_pad(struct sha1_ctxt *);
++extern void sha1_loop(struct sha1_ctxt *, const u_int8_t *, size_t);
++extern void sha1_result(struct sha1_ctxt *, caddr_t);
++
++/* compatibilty with other SHA1 source codes */
++typedef struct sha1_ctxt SHA1_CTX;
++#define SHA1Init(x) sha1_init((x))
++#define SHA1Update(x, y, z) sha1_loop((x), (y), (z))
++#define SHA1Final(x, y) sha1_result((y), (x))
++#endif /* __KERNEL__ */
++
++#define SHA1_RESULTLEN (160/8)
++
++#endif /*_NETINET6_SHA1_H_*/
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/talitos/Makefile linux-2.6.27.10/crypto/ocf/talitos/Makefile
+--- linux-2.6.27.10.orig/crypto/ocf/talitos/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/talitos/Makefile 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_TALITOS) += talitos.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/talitos/talitos.c linux-2.6.27.10/crypto/ocf/talitos/talitos.c
+--- linux-2.6.27.10.orig/crypto/ocf/talitos/talitos.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/talitos/talitos.c 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,1359 @@
++/*
++ * crypto/ocf/talitos/talitos.c
++ *
++ * An OCF-Linux module that uses Freescale's SEC to do the crypto.
++ * Based on crypto/ocf/hifn and crypto/ocf/safe OCF drivers
++ *
++ * Copyright (c) 2006 Freescale Semiconductor, Inc.
++ *
++ * This code written by Kim A. B. Phillips <kim.phillips@freescale.com>
++ * some code copied from files with the following:
++ * Copyright (C) 2004-2007 David McCullough <david_mccullough@securecomputing.com
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * ---------------------------------------------------------------------------
++ *
++ * NOTES:
++ *
++ * The Freescale SEC (also known as 'talitos') resides on the
++ * internal bus, and runs asynchronous to the processor core. It has
++ * a wide gamut of cryptographic acceleration features, including single-
++ * pass IPsec (also known as algorithm chaining). To properly utilize
++ * all of the SEC's performance enhancing features, further reworking
++ * of higher level code (framework, applications) will be necessary.
++ *
++ * The following table shows which SEC version is present in which devices:
++ *
++ * Devices SEC version
++ *
++ * 8272, 8248 SEC 1.0
++ * 885, 875 SEC 1.2
++ * 8555E, 8541E SEC 2.0
++ * 8349E SEC 2.01
++ * 8548E SEC 2.1
++ *
++ * The following table shows the features offered by each SEC version:
++ *
++ * Max. chan-
++ * version Bus I/F Clock nels DEU AESU AFEU MDEU PKEU RNG KEU
++ *
++ * SEC 1.0 internal 64b 100MHz 4 1 1 1 1 1 1 0
++ * SEC 1.2 internal 32b 66MHz 1 1 1 0 1 0 0 0
++ * SEC 2.0 internal 64b 166MHz 4 1 1 1 1 1 1 0
++ * SEC 2.01 internal 64b 166MHz 4 1 1 1 1 1 1 0
++ * SEC 2.1 internal 64b 333MHz 4 1 1 1 1 1 1 1
++ *
++ * Each execution unit in the SEC has two modes of execution; channel and
++ * slave/debug. This driver employs the channel infrastructure in the
++ * device for convenience. Only the RNG is directly accessed due to the
++ * convenience of its random fifo pool. The relationship between the
++ * channels and execution units is depicted in the following diagram:
++ *
++ * ------- ------------
++ * ---| ch0 |---| |
++ * ------- | |
++ * | |------+-------+-------+-------+------------
++ * ------- | | | | | | |
++ * ---| ch1 |---| | | | | | |
++ * ------- | | ------ ------ ------ ------ ------
++ * |controller| |DEU | |AESU| |MDEU| |PKEU| ... |RNG |
++ * ------- | | ------ ------ ------ ------ ------
++ * ---| ch2 |---| | | | | | |
++ * ------- | | | | | | |
++ * | |------+-------+-------+-------+------------
++ * ------- | |
++ * ---| ch3 |---| |
++ * ------- ------------
++ *
++ * Channel ch0 may drive an aes operation to the aes unit (AESU),
++ * and, at the same time, ch1 may drive a message digest operation
++ * to the mdeu. Each channel has an input descriptor FIFO, and the
++ * FIFO can contain, e.g. on the 8541E, up to 24 entries, before a
++ * a buffer overrun error is triggered. The controller is responsible
++ * for fetching the data from descriptor pointers, and passing the
++ * data to the appropriate EUs. The controller also writes the
++ * cryptographic operation's result to memory. The SEC notifies
++ * completion by triggering an interrupt and/or setting the 1st byte
++ * of the hdr field to 0xff.
++ *
++ * TODO:
++ * o support more algorithms
++ * o support more versions of the SEC
++ * o add support for linux 2.4
++ * o scatter-gather (sg) support
++ * o add support for public key ops (PKEU)
++ * o add statistics
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/skbuff.h>
++#include <asm/scatterlist.h>
++#include <linux/dma-mapping.h> /* dma_map_single() */
++#include <linux/moduleparam.h>
++
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
++#include <linux/platform_device.h>
++#endif
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++#include <linux/of_platform.h>
++#endif
++
++#include <cryptodev.h>
++#include <uio.h>
++
++#define DRV_NAME "talitos"
++
++#include "talitos_dev.h"
++#include "talitos_soft.h"
++
++#define read_random(p,l) get_random_bytes(p,l)
++
++const char talitos_driver_name[] = "Talitos OCF";
++const char talitos_driver_version[] = "0.2";
++
++static int talitos_newsession(device_t dev, u_int32_t *sidp,
++ struct cryptoini *cri);
++static int talitos_freesession(device_t dev, u_int64_t tid);
++static int talitos_process(device_t dev, struct cryptop *crp, int hint);
++static void dump_talitos_status(struct talitos_softc *sc);
++static int talitos_submit(struct talitos_softc *sc, struct talitos_desc *td,
++ int chsel);
++static void talitos_doneprocessing(struct talitos_softc *sc);
++static void talitos_init_device(struct talitos_softc *sc);
++static void talitos_reset_device_master(struct talitos_softc *sc);
++static void talitos_reset_device(struct talitos_softc *sc);
++static void talitos_errorprocessing(struct talitos_softc *sc);
++#ifdef CONFIG_PPC_MERGE
++static int talitos_probe(struct of_device *ofdev, const struct of_device_id *match);
++static int talitos_remove(struct of_device *ofdev);
++#else
++static int talitos_probe(struct platform_device *pdev);
++static int talitos_remove(struct platform_device *pdev);
++#endif
++#ifdef CONFIG_OCF_RANDOMHARVEST
++static int talitos_read_random(void *arg, u_int32_t *buf, int maxwords);
++static void talitos_rng_init(struct talitos_softc *sc);
++#endif
++
++static device_method_t talitos_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, talitos_newsession),
++ DEVMETHOD(cryptodev_freesession,talitos_freesession),
++ DEVMETHOD(cryptodev_process, talitos_process),
++};
++
++#define debug talitos_debug
++int talitos_debug = 0;
++module_param(talitos_debug, int, 0644);
++MODULE_PARM_DESC(talitos_debug, "Enable debug");
++
++static inline void talitos_write(volatile unsigned *addr, u32 val)
++{
++ out_be32(addr, val);
++}
++
++static inline u32 talitos_read(volatile unsigned *addr)
++{
++ u32 val;
++ val = in_be32(addr);
++ return val;
++}
++
++static void dump_talitos_status(struct talitos_softc *sc)
++{
++ unsigned int v, v_hi, i, *ptr;
++ v = talitos_read(sc->sc_base_addr + TALITOS_MCR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_MCR_HI);
++ printk(KERN_INFO "%s: MCR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ v = talitos_read(sc->sc_base_addr + TALITOS_IMR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_IMR_HI);
++ printk(KERN_INFO "%s: IMR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ v = talitos_read(sc->sc_base_addr + TALITOS_ISR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_ISR_HI);
++ printk(KERN_INFO "%s: ISR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CDPR);
++ v_hi = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CDPR_HI);
++ printk(KERN_INFO "%s: CDPR ch%d 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), i, v, v_hi);
++ }
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCPSR);
++ v_hi = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCPSR_HI);
++ printk(KERN_INFO "%s: CCPSR ch%d 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), i, v, v_hi);
++ }
++ ptr = sc->sc_base_addr + TALITOS_CH_DESCBUF;
++ for (i = 0; i < 16; i++) {
++ v = talitos_read(ptr++); v_hi = talitos_read(ptr++);
++ printk(KERN_INFO "%s: DESCBUF ch0 0x%08x_%08x (tdp%02d)\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi, i);
++ }
++ return;
++}
++
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++/*
++ * pull random numbers off the RNG FIFO, not exceeding amount available
++ */
++static int
++talitos_read_random(void *arg, u_int32_t *buf, int maxwords)
++{
++ struct talitos_softc *sc = (struct talitos_softc *) arg;
++ int rc;
++ u_int32_t v;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* check for things like FIFO underflow */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGISR_HI);
++ if (unlikely(v)) {
++ printk(KERN_ERR "%s: RNGISR_HI error %08x\n",
++ device_get_nameunit(sc->sc_cdev), v);
++ return 0;
++ }
++ /*
++ * OFL is number of available 64-bit words,
++ * shift and convert to a 32-bit word count
++ */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGSR_HI);
++ v = (v & TALITOS_RNGSR_HI_OFL) >> (16 - 1);
++ if (maxwords > v)
++ maxwords = v;
++ for (rc = 0; rc < maxwords; rc++) {
++ buf[rc] = talitos_read(sc->sc_base_addr +
++ TALITOS_RNG_FIFO + rc*sizeof(u_int32_t));
++ }
++ if (maxwords & 1) {
++ /*
++ * RNG will complain with an AE in the RNGISR
++ * if we don't complete the pairs of 32-bit reads
++ * to its 64-bit register based FIFO
++ */
++ v = talitos_read(sc->sc_base_addr +
++ TALITOS_RNG_FIFO + rc*sizeof(u_int32_t));
++ }
++
++ return rc;
++}
++
++static void
++talitos_rng_init(struct talitos_softc *sc)
++{
++ u_int32_t v;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ /* reset RNG EU */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGRCR_HI);
++ v |= TALITOS_RNGRCR_HI_SR;
++ talitos_write(sc->sc_base_addr + TALITOS_RNGRCR_HI, v);
++ while ((talitos_read(sc->sc_base_addr + TALITOS_RNGSR_HI)
++ & TALITOS_RNGSR_HI_RD) == 0)
++ cpu_relax();
++ /*
++ * we tell the RNG to start filling the RNG FIFO
++ * by writing the RNGDSR
++ */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGDSR_HI);
++ talitos_write(sc->sc_base_addr + TALITOS_RNGDSR_HI, v);
++ /*
++ * 64 bits of data will be pushed onto the FIFO every
++ * 256 SEC cycles until the FIFO is full. The RNG then
++ * attempts to keep the FIFO full.
++ */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGISR_HI);
++ if (v) {
++ printk(KERN_ERR "%s: RNGISR_HI error %08x\n",
++ device_get_nameunit(sc->sc_cdev), v);
++ return;
++ }
++ /*
++ * n.b. we need to add a FIPS test here - if the RNG is going
++ * to fail, it's going to fail at reset time
++ */
++ return;
++}
++#endif /* CONFIG_OCF_RANDOMHARVEST */
++
++/*
++ * Generate a new software session.
++ */
++static int
++talitos_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct cryptoini *c, *encini = NULL, *macini = NULL;
++ struct talitos_softc *sc = device_get_softc(dev);
++ struct talitos_session *ses = NULL;
++ int sesn;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ if (sidp == NULL || cri == NULL || sc == NULL) {
++ DPRINTF("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++ for (c = cri; c != NULL; c = c->cri_next) {
++ if (c->cri_alg == CRYPTO_MD5 ||
++ c->cri_alg == CRYPTO_MD5_HMAC ||
++ c->cri_alg == CRYPTO_SHA1 ||
++ c->cri_alg == CRYPTO_SHA1_HMAC ||
++ c->cri_alg == CRYPTO_NULL_HMAC) {
++ if (macini)
++ return EINVAL;
++ macini = c;
++ } else if (c->cri_alg == CRYPTO_DES_CBC ||
++ c->cri_alg == CRYPTO_3DES_CBC ||
++ c->cri_alg == CRYPTO_AES_CBC ||
++ c->cri_alg == CRYPTO_NULL_CBC) {
++ if (encini)
++ return EINVAL;
++ encini = c;
++ } else {
++ DPRINTF("UNKNOWN c->cri_alg %d\n", encini->cri_alg);
++ return EINVAL;
++ }
++ }
++ if (encini == NULL && macini == NULL)
++ return EINVAL;
++ if (encini) {
++ /* validate key length */
++ switch (encini->cri_alg) {
++ case CRYPTO_DES_CBC:
++ if (encini->cri_klen != 64)
++ return EINVAL;
++ break;
++ case CRYPTO_3DES_CBC:
++ if (encini->cri_klen != 192) {
++ return EINVAL;
++ }
++ break;
++ case CRYPTO_AES_CBC:
++ if (encini->cri_klen != 128 &&
++ encini->cri_klen != 192 &&
++ encini->cri_klen != 256)
++ return EINVAL;
++ break;
++ default:
++ DPRINTF("UNKNOWN encini->cri_alg %d\n",
++ encini->cri_alg);
++ return EINVAL;
++ }
++ }
++
++ if (sc->sc_sessions == NULL) {
++ ses = sc->sc_sessions = (struct talitos_session *)
++ kmalloc(sizeof(struct talitos_session), SLAB_ATOMIC);
++ if (ses == NULL)
++ return ENOMEM;
++ memset(ses, 0, sizeof(struct talitos_session));
++ sesn = 0;
++ sc->sc_nsessions = 1;
++ } else {
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (sc->sc_sessions[sesn].ses_used == 0) {
++ ses = &sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ /* allocating session */
++ sesn = sc->sc_nsessions;
++ ses = (struct talitos_session *) kmalloc(
++ (sesn + 1) * sizeof(struct talitos_session),
++ SLAB_ATOMIC);
++ if (ses == NULL)
++ return ENOMEM;
++ memset(ses, 0,
++ (sesn + 1) * sizeof(struct talitos_session));
++ memcpy(ses, sc->sc_sessions,
++ sesn * sizeof(struct talitos_session));
++ memset(sc->sc_sessions, 0,
++ sesn * sizeof(struct talitos_session));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = ses;
++ ses = &sc->sc_sessions[sesn];
++ sc->sc_nsessions++;
++ }
++ }
++
++ ses->ses_used = 1;
++
++ if (encini) {
++ /* get an IV */
++ /* XXX may read fewer than requested */
++ read_random(ses->ses_iv, sizeof(ses->ses_iv));
++
++ ses->ses_klen = (encini->cri_klen + 7) / 8;
++ memcpy(ses->ses_key, encini->cri_key, ses->ses_klen);
++ if (macini) {
++ /* doing hash on top of cipher */
++ ses->ses_hmac_len = (macini->cri_klen + 7) / 8;
++ memcpy(ses->ses_hmac, macini->cri_key,
++ ses->ses_hmac_len);
++ }
++ } else if (macini) {
++ /* doing hash */
++ ses->ses_klen = (macini->cri_klen + 7) / 8;
++ memcpy(ses->ses_key, macini->cri_key, ses->ses_klen);
++ }
++
++ /* back compat way of determining MSC result len */
++ if (macini) {
++ ses->ses_mlen = macini->cri_mlen;
++ if (ses->ses_mlen == 0) {
++ if (macini->cri_alg == CRYPTO_MD5_HMAC)
++ ses->ses_mlen = MD5_HASH_LEN;
++ else
++ ses->ses_mlen = SHA1_HASH_LEN;
++ }
++ }
++
++ /* really should make up a template td here,
++ * and only fill things like i/o and direction in process() */
++
++ /* assign session ID */
++ *sidp = TALITOS_SID(sc->sc_num, sesn);
++ return 0;
++}
++
++/*
++ * Deallocate a session.
++ */
++static int
++talitos_freesession(device_t dev, u_int64_t tid)
++{
++ struct talitos_softc *sc = device_get_softc(dev);
++ int session, ret;
++ u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
++
++ if (sc == NULL)
++ return EINVAL;
++ session = TALITOS_SESSION(sid);
++ if (session < sc->sc_nsessions) {
++ memset(&sc->sc_sessions[session], 0,
++ sizeof(sc->sc_sessions[session]));
++ ret = 0;
++ } else
++ ret = EINVAL;
++ return ret;
++}
++
++/*
++ * launch device processing - it will come back with done notification
++ * in the form of an interrupt and/or HDR_DONE_BITS in header
++ */
++static int
++talitos_submit(
++ struct talitos_softc *sc,
++ struct talitos_desc *td,
++ int chsel)
++{
++ u_int32_t v;
++
++ v = dma_map_single(NULL, td, sizeof(*td), DMA_TO_DEVICE);
++ talitos_write(sc->sc_base_addr +
++ chsel*TALITOS_CH_OFFSET + TALITOS_CH_FF, 0);
++ talitos_write(sc->sc_base_addr +
++ chsel*TALITOS_CH_OFFSET + TALITOS_CH_FF_HI, v);
++ return 0;
++}
++
++static int
++talitos_process(device_t dev, struct cryptop *crp, int hint)
++{
++ int i, err = 0, ivsize;
++ struct talitos_softc *sc = device_get_softc(dev);
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++ caddr_t iv;
++ struct talitos_session *ses;
++ struct talitos_desc *td;
++ unsigned long flags;
++ /* descriptor mappings */
++ int hmac_key, hmac_data, cipher_iv, cipher_key,
++ in_fifo, out_fifo, cipher_iv_out;
++ static int chsel = -1;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (crp == NULL || crp->crp_callback == NULL || sc == NULL) {
++ return EINVAL;
++ }
++ crp->crp_etype = 0;
++ if (TALITOS_SESSION(crp->crp_sid) >= sc->sc_nsessions) {
++ return EINVAL;
++ }
++
++ ses = &sc->sc_sessions[TALITOS_SESSION(crp->crp_sid)];
++
++ /* enter the channel scheduler */
++ spin_lock_irqsave(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ /* reuse channel that already had/has requests for the required EU */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ if (sc->sc_chnlastalg[i] == crp->crp_desc->crd_alg)
++ break;
++ }
++ if (i == sc->sc_num_channels) {
++ /*
++ * haven't seen this algo the last sc_num_channels or more
++ * use round robin in this case
++ * nb: sc->sc_num_channels must be power of 2
++ */
++ chsel = (chsel + 1) & (sc->sc_num_channels - 1);
++ } else {
++ /*
++ * matches channel with same target execution unit;
++ * use same channel in this case
++ */
++ chsel = i;
++ }
++ sc->sc_chnlastalg[chsel] = crp->crp_desc->crd_alg;
++
++ /* release the channel scheduler lock */
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ /* acquire the selected channel fifo lock */
++ spin_lock_irqsave(&sc->sc_chnfifolock[chsel], flags);
++
++ /* find and reserve next available descriptor-cryptop pair */
++ for (i = 0; i < sc->sc_chfifo_len; i++) {
++ if (sc->sc_chnfifo[chsel][i].cf_desc.hdr == 0) {
++ /*
++ * ensure correct descriptor formation by
++ * avoiding inadvertently setting "optional" entries
++ * e.g. not using "optional" dptr2 for MD/HMAC descs
++ */
++ memset(&sc->sc_chnfifo[chsel][i].cf_desc,
++ 0, sizeof(*td));
++ /* reserve it with done notification request bit */
++ sc->sc_chnfifo[chsel][i].cf_desc.hdr |=
++ TALITOS_DONE_NOTIFY;
++ break;
++ }
++ }
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[chsel], flags);
++
++ if (i == sc->sc_chfifo_len) {
++ /* fifo full */
++ err = ERESTART;
++ goto errout;
++ }
++
++ td = &sc->sc_chnfifo[chsel][i].cf_desc;
++ sc->sc_chnfifo[chsel][i].cf_crp = crp;
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ err = EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++ /* prevent compiler warning */
++ hmac_key = 0;
++ hmac_data = 0;
++ if (crd2 == NULL) {
++ td->hdr |= TD_TYPE_COMMON_NONSNOOP_NO_AFEU;
++ /* assign descriptor dword ptr mappings for this desc. type */
++ cipher_iv = 1;
++ cipher_key = 2;
++ in_fifo = 3;
++ cipher_iv_out = 5;
++ if (crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1 ||
++ crd1->crd_alg == CRYPTO_MD5) {
++ out_fifo = 5;
++ maccrd = crd1;
++ enccrd = NULL;
++ } else if (crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4) {
++ out_fifo = 4;
++ maccrd = NULL;
++ enccrd = crd1;
++ } else {
++ DPRINTF("UNKNOWN crd1->crd_alg %d\n", crd1->crd_alg);
++ err = EINVAL;
++ goto errout;
++ }
++ } else {
++ if (sc->sc_desc_types & TALITOS_HAS_DT_IPSEC_ESP) {
++ td->hdr |= TD_TYPE_IPSEC_ESP;
++ } else {
++ DPRINTF("unimplemented: multiple descriptor ipsec\n");
++ err = EINVAL;
++ goto errout;
++ }
++ /* assign descriptor dword ptr mappings for this desc. type */
++ hmac_key = 0;
++ hmac_data = 1;
++ cipher_iv = 2;
++ cipher_key = 3;
++ in_fifo = 4;
++ out_fifo = 5;
++ cipher_iv_out = 6;
++ if ((crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_MD5 ||
++ crd1->crd_alg == CRYPTO_SHA1) &&
++ (crd2->crd_alg == CRYPTO_DES_CBC ||
++ crd2->crd_alg == CRYPTO_3DES_CBC ||
++ crd2->crd_alg == CRYPTO_AES_CBC ||
++ crd2->crd_alg == CRYPTO_ARC4) &&
++ ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) {
++ maccrd = crd1;
++ enccrd = crd2;
++ } else if ((crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4 ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC) &&
++ (crd2->crd_alg == CRYPTO_MD5_HMAC ||
++ crd2->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd2->crd_alg == CRYPTO_MD5 ||
++ crd2->crd_alg == CRYPTO_SHA1) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT)) {
++ enccrd = crd1;
++ maccrd = crd2;
++ } else {
++ /* We cannot order the SEC as requested */
++ printk("%s: cannot do the order\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ }
++ /* assign in_fifo and out_fifo based on input/output struct type */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ /* using SKB buffers */
++ struct sk_buff *skb = (struct sk_buff *)crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags) {
++ printk("%s: skb frags unimplemented\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ td->ptr[in_fifo].ptr = dma_map_single(NULL, skb->data,
++ skb->len, DMA_TO_DEVICE);
++ td->ptr[in_fifo].len = skb->len;
++ td->ptr[out_fifo].ptr = dma_map_single(NULL, skb->data,
++ skb->len, DMA_TO_DEVICE);
++ td->ptr[out_fifo].len = skb->len;
++ td->ptr[hmac_data].ptr = dma_map_single(NULL, skb->data,
++ skb->len, DMA_TO_DEVICE);
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ /* using IOV buffers */
++ struct uio *uiop = (struct uio *)crp->crp_buf;
++ if (uiop->uio_iovcnt > 1) {
++ printk("%s: iov frags unimplemented\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ td->ptr[in_fifo].ptr = dma_map_single(NULL,
++ uiop->uio_iov->iov_base, crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[in_fifo].len = crp->crp_ilen;
++ /* crp_olen is never set; always use crp_ilen */
++ td->ptr[out_fifo].ptr = dma_map_single(NULL,
++ uiop->uio_iov->iov_base,
++ crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[out_fifo].len = crp->crp_ilen;
++ } else {
++ /* using contig buffers */
++ td->ptr[in_fifo].ptr = dma_map_single(NULL,
++ crp->crp_buf, crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[in_fifo].len = crp->crp_ilen;
++ td->ptr[out_fifo].ptr = dma_map_single(NULL,
++ crp->crp_buf, crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[out_fifo].len = crp->crp_ilen;
++ }
++ if (enccrd) {
++ switch (enccrd->crd_alg) {
++ case CRYPTO_3DES_CBC:
++ td->hdr |= TALITOS_MODE0_DEU_3DES;
++ /* FALLTHROUGH */
++ case CRYPTO_DES_CBC:
++ td->hdr |= TALITOS_SEL0_DEU
++ | TALITOS_MODE0_DEU_CBC;
++ if (enccrd->crd_flags & CRD_F_ENCRYPT)
++ td->hdr |= TALITOS_MODE0_DEU_ENC;
++ ivsize = 2*sizeof(u_int32_t);
++ DPRINTF("%cDES ses %d ch %d len %d\n",
++ (td->hdr & TALITOS_MODE0_DEU_3DES)?'3':'1',
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ case CRYPTO_AES_CBC:
++ td->hdr |= TALITOS_SEL0_AESU
++ | TALITOS_MODE0_AESU_CBC;
++ if (enccrd->crd_flags & CRD_F_ENCRYPT)
++ td->hdr |= TALITOS_MODE0_AESU_ENC;
++ ivsize = 4*sizeof(u_int32_t);
++ DPRINTF("AES ses %d ch %d len %d\n",
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ default:
++ printk("%s: unimplemented enccrd->crd_alg %d\n",
++ device_get_nameunit(sc->sc_cdev), enccrd->crd_alg);
++ err = EINVAL;
++ goto errout;
++ }
++ /*
++ * Setup encrypt/decrypt state. When using basic ops
++ * we can't use an inline IV because hash/crypt offset
++ * must be from the end of the IV to the start of the
++ * crypt data and this leaves out the preceding header
++ * from the hash calculation. Instead we place the IV
++ * in the state record and set the hash/crypt offset to
++ * copy both the header+IV.
++ */
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ td->hdr |= TALITOS_DIR_OUTBOUND;
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ iv = enccrd->crd_iv;
++ else
++ iv = (caddr_t) ses->ses_iv;
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, iv);
++ }
++ } else {
++ td->hdr |= TALITOS_DIR_INBOUND;
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT) {
++ iv = enccrd->crd_iv;
++ bcopy(enccrd->crd_iv, iv, ivsize);
++ } else {
++ iv = (caddr_t) ses->ses_iv;
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, iv);
++ }
++ }
++ td->ptr[cipher_iv].ptr = dma_map_single(NULL, iv, ivsize,
++ DMA_TO_DEVICE);
++ td->ptr[cipher_iv].len = ivsize;
++ /*
++ * we don't need the cipher iv out length/pointer
++ * field to do ESP IPsec. Therefore we set the len field as 0,
++ * which tells the SEC not to do anything with this len/ptr
++ * field. Previously, when length/pointer as pointing to iv,
++ * it gave us corruption of packets.
++ */
++ td->ptr[cipher_iv_out].len = 0;
++ }
++ if (enccrd && maccrd) {
++ /* this is ipsec only for now */
++ td->hdr |= TALITOS_SEL1_MDEU
++ | TALITOS_MODE1_MDEU_INIT
++ | TALITOS_MODE1_MDEU_PAD;
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ td->hdr |= TALITOS_MODE1_MDEU_MD5;
++ break;
++ case CRYPTO_MD5_HMAC:
++ td->hdr |= TALITOS_MODE1_MDEU_MD5_HMAC;
++ break;
++ case CRYPTO_SHA1:
++ td->hdr |= TALITOS_MODE1_MDEU_SHA1;
++ break;
++ case CRYPTO_SHA1_HMAC:
++ td->hdr |= TALITOS_MODE1_MDEU_SHA1_HMAC;
++ break;
++ default:
++ /* We cannot order the SEC as requested */
++ printk("%s: cannot do the order\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ if ((maccrd->crd_alg == CRYPTO_MD5_HMAC) ||
++ (maccrd->crd_alg == CRYPTO_SHA1_HMAC)) {
++ /*
++ * The offset from hash data to the start of
++ * crypt data is the difference in the skips.
++ */
++ /* ipsec only for now */
++ td->ptr[hmac_key].ptr = dma_map_single(NULL,
++ ses->ses_hmac, ses->ses_hmac_len, DMA_TO_DEVICE);
++ td->ptr[hmac_key].len = ses->ses_hmac_len;
++ td->ptr[in_fifo].ptr += enccrd->crd_skip;
++ td->ptr[in_fifo].len = enccrd->crd_len;
++ td->ptr[out_fifo].ptr += enccrd->crd_skip;
++ td->ptr[out_fifo].len = enccrd->crd_len;
++ /* bytes of HMAC to postpend to ciphertext */
++ td->ptr[out_fifo].extent = ses->ses_mlen;
++ td->ptr[hmac_data].ptr += maccrd->crd_skip;
++ td->ptr[hmac_data].len = enccrd->crd_skip - maccrd->crd_skip;
++ }
++ if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT) {
++ printk("%s: CRD_F_KEY_EXPLICIT unimplemented\n",
++ device_get_nameunit(sc->sc_cdev));
++ }
++ }
++ if (!enccrd && maccrd) {
++ /* single MD5 or SHA */
++ td->hdr |= TALITOS_SEL0_MDEU
++ | TALITOS_MODE0_MDEU_INIT
++ | TALITOS_MODE0_MDEU_PAD;
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ td->hdr |= TALITOS_MODE0_MDEU_MD5;
++ DPRINTF("MD5 ses %d ch %d len %d\n",
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ case CRYPTO_MD5_HMAC:
++ td->hdr |= TALITOS_MODE0_MDEU_MD5_HMAC;
++ break;
++ case CRYPTO_SHA1:
++ td->hdr |= TALITOS_MODE0_MDEU_SHA1;
++ DPRINTF("SHA1 ses %d ch %d len %d\n",
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ case CRYPTO_SHA1_HMAC:
++ td->hdr |= TALITOS_MODE0_MDEU_SHA1_HMAC;
++ break;
++ default:
++ /* We cannot order the SEC as requested */
++ DPRINTF("cannot do the order\n");
++ err = EINVAL;
++ goto errout;
++ }
++
++ if (crp->crp_flags & CRYPTO_F_IOV)
++ td->ptr[out_fifo].ptr += maccrd->crd_inject;
++
++ if ((maccrd->crd_alg == CRYPTO_MD5_HMAC) ||
++ (maccrd->crd_alg == CRYPTO_SHA1_HMAC)) {
++ td->ptr[hmac_key].ptr = dma_map_single(NULL,
++ ses->ses_hmac, ses->ses_hmac_len,
++ DMA_TO_DEVICE);
++ td->ptr[hmac_key].len = ses->ses_hmac_len;
++ }
++ }
++ else {
++ /* using process key (session data has duplicate) */
++ td->ptr[cipher_key].ptr = dma_map_single(NULL,
++ enccrd->crd_key, (enccrd->crd_klen + 7) / 8,
++ DMA_TO_DEVICE);
++ td->ptr[cipher_key].len = (enccrd->crd_klen + 7) / 8;
++ }
++ /* descriptor complete - GO! */
++ return talitos_submit(sc, td, chsel);
++
++errout:
++ if (err != ERESTART) {
++ crp->crp_etype = err;
++ crypto_done(crp);
++ }
++ return err;
++}
++
++/* go through all channels descriptors, notifying OCF what has
++ * _and_hasn't_ successfully completed and reset the device
++ * (otherwise it's up to decoding desc hdrs!)
++ */
++static void talitos_errorprocessing(struct talitos_softc *sc)
++{
++ unsigned long flags;
++ int i, j;
++
++ /* disable further scheduling until under control */
++ spin_lock_irqsave(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ if (debug) dump_talitos_status(sc);
++ /* go through descriptors, try and salvage those successfully done,
++ * and EIO those that weren't
++ */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ spin_lock_irqsave(&sc->sc_chnfifolock[i], flags);
++ for (j = 0; j < sc->sc_chfifo_len; j++) {
++ if (sc->sc_chnfifo[i][j].cf_desc.hdr) {
++ if ((sc->sc_chnfifo[i][j].cf_desc.hdr
++ & TALITOS_HDR_DONE_BITS)
++ != TALITOS_HDR_DONE_BITS) {
++ /* this one didn't finish */
++ /* signify in crp->etype */
++ sc->sc_chnfifo[i][j].cf_crp->crp_etype
++ = EIO;
++ }
++ } else
++ continue; /* free entry */
++ /* either way, notify ocf */
++ crypto_done(sc->sc_chnfifo[i][j].cf_crp);
++ /* and tag it available again
++ *
++ * memset to ensure correct descriptor formation by
++ * avoiding inadvertently setting "optional" entries
++ * e.g. not using "optional" dptr2 MD/HMAC processing
++ */
++ memset(&sc->sc_chnfifo[i][j].cf_desc,
++ 0, sizeof(struct talitos_desc));
++ }
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[i], flags);
++ }
++ /* reset and initialize the SEC h/w device */
++ talitos_reset_device(sc);
++ talitos_init_device(sc);
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ if (sc->sc_exec_units & TALITOS_HAS_EU_RNG)
++ talitos_rng_init(sc);
++#endif
++
++ /* Okay. Stand by. */
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ return;
++}
++
++/* go through all channels descriptors, notifying OCF what's been done */
++static void talitos_doneprocessing(struct talitos_softc *sc)
++{
++ unsigned long flags;
++ int i, j;
++
++ /* go through descriptors looking for done bits */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ spin_lock_irqsave(&sc->sc_chnfifolock[i], flags);
++ for (j = 0; j < sc->sc_chfifo_len; j++) {
++ /* descriptor has done bits set? */
++ if ((sc->sc_chnfifo[i][j].cf_desc.hdr
++ & TALITOS_HDR_DONE_BITS)
++ == TALITOS_HDR_DONE_BITS) {
++ /* notify ocf */
++ crypto_done(sc->sc_chnfifo[i][j].cf_crp);
++ /* and tag it available again
++ *
++ * memset to ensure correct descriptor formation by
++ * avoiding inadvertently setting "optional" entries
++ * e.g. not using "optional" dptr2 MD/HMAC processing
++ */
++ memset(&sc->sc_chnfifo[i][j].cf_desc,
++ 0, sizeof(struct talitos_desc));
++ }
++ }
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[i], flags);
++ }
++ return;
++}
++
++static irqreturn_t
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++talitos_intr(int irq, void *arg)
++#else
++talitos_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct talitos_softc *sc = arg;
++ u_int32_t v, v_hi;
++
++ /* ack */
++ v = talitos_read(sc->sc_base_addr + TALITOS_ISR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_ISR_HI);
++ talitos_write(sc->sc_base_addr + TALITOS_ICR, v);
++ talitos_write(sc->sc_base_addr + TALITOS_ICR_HI, v_hi);
++
++ if (unlikely(v & TALITOS_ISR_ERROR)) {
++ /* Okay, Houston, we've had a problem here. */
++ printk(KERN_DEBUG "%s: got error interrupt - ISR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ talitos_errorprocessing(sc);
++ } else
++ if (likely(v & TALITOS_ISR_DONE)) {
++ talitos_doneprocessing(sc);
++ }
++ return IRQ_HANDLED;
++}
++
++/*
++ * Initialize registers we need to touch only once.
++ */
++static void
++talitos_init_device(struct talitos_softc *sc)
++{
++ u_int32_t v;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* init all channels */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr +
++ i*TALITOS_CH_OFFSET + TALITOS_CH_CCCR_HI);
++ v |= TALITOS_CH_CCCR_HI_CDWE
++ | TALITOS_CH_CCCR_HI_CDIE; /* invoke interrupt if done */
++ talitos_write(sc->sc_base_addr +
++ i*TALITOS_CH_OFFSET + TALITOS_CH_CCCR_HI, v);
++ }
++ /* enable all interrupts */
++ v = talitos_read(sc->sc_base_addr + TALITOS_IMR);
++ v |= TALITOS_IMR_ALL;
++ talitos_write(sc->sc_base_addr + TALITOS_IMR, v);
++ v = talitos_read(sc->sc_base_addr + TALITOS_IMR_HI);
++ v |= TALITOS_IMR_HI_ERRONLY;
++ talitos_write(sc->sc_base_addr + TALITOS_IMR_HI, v);
++ return;
++}
++
++/*
++ * set the master reset bit on the device.
++ */
++static void
++talitos_reset_device_master(struct talitos_softc *sc)
++{
++ u_int32_t v;
++
++ /* Reset the device by writing 1 to MCR:SWR and waiting 'til cleared */
++ v = talitos_read(sc->sc_base_addr + TALITOS_MCR);
++ talitos_write(sc->sc_base_addr + TALITOS_MCR, v | TALITOS_MCR_SWR);
++
++ while (talitos_read(sc->sc_base_addr + TALITOS_MCR) & TALITOS_MCR_SWR)
++ cpu_relax();
++
++ return;
++}
++
++/*
++ * Resets the device. Values in the registers are left as is
++ * from the reset (i.e. initial values are assigned elsewhere).
++ */
++static void
++talitos_reset_device(struct talitos_softc *sc)
++{
++ u_int32_t v;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /*
++ * Master reset
++ * errata documentation: warning: certain SEC interrupts
++ * are not fully cleared by writing the MCR:SWR bit,
++ * set bit twice to completely reset
++ */
++ talitos_reset_device_master(sc); /* once */
++ talitos_reset_device_master(sc); /* and once again */
++
++ /* reset all channels */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCCR);
++ talitos_write(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCCR, v | TALITOS_CH_CCCR_RESET);
++ }
++}
++
++/* Set up the crypto device structure, private data,
++ * and anything else we need before we start */
++#ifdef CONFIG_PPC_MERGE
++static int talitos_probe(struct of_device *ofdev, const struct of_device_id *match)
++#else
++static int talitos_probe(struct platform_device *pdev)
++#endif
++{
++ struct talitos_softc *sc = NULL;
++ struct resource *r;
++#ifdef CONFIG_PPC_MERGE
++ struct device *device = &ofdev->dev;
++ struct device_node *np = ofdev->node;
++ const unsigned int *prop;
++ int err;
++ struct resource res;
++#endif
++ static int num_chips = 0;
++ int rc;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ sc = (struct talitos_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return -ENOMEM;
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, DRV_NAME, num_chips, talitos_methods);
++
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++#ifndef CONFIG_PPC_MERGE
++ sc->sc_dev = pdev;
++#endif
++ sc->sc_num = num_chips++;
++
++#ifdef CONFIG_PPC_MERGE
++ dev_set_drvdata(device, sc);
++#else
++ platform_set_drvdata(sc->sc_dev, sc);
++#endif
++
++ /* get the irq line */
++#ifdef CONFIG_PPC_MERGE
++ err = of_address_to_resource(np, 0, &res);
++ if (err)
++ return -EINVAL;
++ r = &res;
++
++ sc->sc_irq = irq_of_parse_and_map(np, 0);
++#else
++ /* get a pointer to the register memory */
++ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++
++ sc->sc_irq = platform_get_irq(pdev, 0);
++#endif
++ rc = request_irq(sc->sc_irq, talitos_intr, 0,
++ device_get_nameunit(sc->sc_cdev), sc);
++ if (rc) {
++ printk(KERN_ERR "%s: failed to hook irq %d\n",
++ device_get_nameunit(sc->sc_cdev), sc->sc_irq);
++ sc->sc_irq = -1;
++ goto out;
++ }
++
++ sc->sc_base_addr = (ocf_iomem_t) ioremap(r->start, (r->end - r->start));
++ if (!sc->sc_base_addr) {
++ printk(KERN_ERR "%s: failed to ioremap\n",
++ device_get_nameunit(sc->sc_cdev));
++ goto out;
++ }
++
++ /* figure out our SEC's properties and capabilities */
++ sc->sc_chiprev = (u64)talitos_read(sc->sc_base_addr + TALITOS_ID) << 32
++ | talitos_read(sc->sc_base_addr + TALITOS_ID_HI);
++ DPRINTF("sec id 0x%llx\n", sc->sc_chiprev);
++
++#ifdef CONFIG_PPC_MERGE
++ /* get SEC properties from device tree, defaulting to SEC 2.0 */
++
++ prop = of_get_property(np, "num-channels", NULL);
++ sc->sc_num_channels = prop ? *prop : TALITOS_NCHANNELS_SEC_2_0;
++
++ prop = of_get_property(np, "channel-fifo-len", NULL);
++ sc->sc_chfifo_len = prop ? *prop : TALITOS_CHFIFOLEN_SEC_2_0;
++
++ prop = of_get_property(np, "exec-units-mask", NULL);
++ sc->sc_exec_units = prop ? *prop : TALITOS_HAS_EUS_SEC_2_0;
++
++ prop = of_get_property(np, "descriptor-types-mask", NULL);
++ sc->sc_desc_types = prop ? *prop : TALITOS_HAS_DESCTYPES_SEC_2_0;
++#else
++ /* bulk should go away with openfirmware flat device tree support */
++ if (sc->sc_chiprev & TALITOS_ID_SEC_2_0) {
++ sc->sc_num_channels = TALITOS_NCHANNELS_SEC_2_0;
++ sc->sc_chfifo_len = TALITOS_CHFIFOLEN_SEC_2_0;
++ sc->sc_exec_units = TALITOS_HAS_EUS_SEC_2_0;
++ sc->sc_desc_types = TALITOS_HAS_DESCTYPES_SEC_2_0;
++ } else {
++ printk(KERN_ERR "%s: failed to id device\n",
++ device_get_nameunit(sc->sc_cdev));
++ goto out;
++ }
++#endif
++
++ /* + 1 is for the meta-channel lock used by the channel scheduler */
++ sc->sc_chnfifolock = (spinlock_t *) kmalloc(
++ (sc->sc_num_channels + 1) * sizeof(spinlock_t), GFP_KERNEL);
++ if (!sc->sc_chnfifolock)
++ goto out;
++ for (i = 0; i < sc->sc_num_channels + 1; i++) {
++ spin_lock_init(&sc->sc_chnfifolock[i]);
++ }
++
++ sc->sc_chnlastalg = (int *) kmalloc(
++ sc->sc_num_channels * sizeof(int), GFP_KERNEL);
++ if (!sc->sc_chnlastalg)
++ goto out;
++ memset(sc->sc_chnlastalg, 0, sc->sc_num_channels * sizeof(int));
++
++ sc->sc_chnfifo = (struct desc_cryptop_pair **) kmalloc(
++ sc->sc_num_channels * sizeof(struct desc_cryptop_pair *),
++ GFP_KERNEL);
++ if (!sc->sc_chnfifo)
++ goto out;
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ sc->sc_chnfifo[i] = (struct desc_cryptop_pair *) kmalloc(
++ sc->sc_chfifo_len * sizeof(struct desc_cryptop_pair),
++ GFP_KERNEL);
++ if (!sc->sc_chnfifo[i])
++ goto out;
++ memset(sc->sc_chnfifo[i], 0,
++ sc->sc_chfifo_len * sizeof(struct desc_cryptop_pair));
++ }
++
++ /* reset and initialize the SEC h/w device */
++ talitos_reset_device(sc);
++ talitos_init_device(sc);
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ printk(KERN_ERR "%s: could not get crypto driver id\n",
++ device_get_nameunit(sc->sc_cdev));
++ goto out;
++ }
++
++ /* register algorithms with the framework */
++ printk("%s:", device_get_nameunit(sc->sc_cdev));
++
++ if (sc->sc_exec_units & TALITOS_HAS_EU_RNG) {
++ printk(" rng");
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ talitos_rng_init(sc);
++ crypto_rregister(sc->sc_cid, talitos_read_random, sc);
++#endif
++ }
++ if (sc->sc_exec_units & TALITOS_HAS_EU_DEU) {
++ printk(" des/3des");
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ }
++ if (sc->sc_exec_units & TALITOS_HAS_EU_AESU) {
++ printk(" aes");
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ }
++ if (sc->sc_exec_units & TALITOS_HAS_EU_MDEU) {
++ printk(" md5");
++ crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0);
++ /* HMAC support only with IPsec for now */
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++ printk(" sha1");
++ crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0);
++ /* HMAC support only with IPsec for now */
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ }
++ printk("\n");
++ return 0;
++
++out:
++#ifndef CONFIG_PPC_MERGE
++ talitos_remove(pdev);
++#endif
++ return -ENOMEM;
++}
++
++#ifdef CONFIG_PPC_MERGE
++static int talitos_remove(struct of_device *ofdev)
++#else
++static int talitos_remove(struct platform_device *pdev)
++#endif
++{
++#ifdef CONFIG_PPC_MERGE
++ struct talitos_softc *sc = dev_get_drvdata(&ofdev->dev);
++#else
++ struct talitos_softc *sc = platform_get_drvdata(pdev);
++#endif
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_chnfifo) {
++ for (i = 0; i < sc->sc_num_channels; i++)
++ if (sc->sc_chnfifo[i])
++ kfree(sc->sc_chnfifo[i]);
++ kfree(sc->sc_chnfifo);
++ }
++ if (sc->sc_chnlastalg)
++ kfree(sc->sc_chnlastalg);
++ if (sc->sc_chnfifolock)
++ kfree(sc->sc_chnfifolock);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_base_addr)
++ iounmap((void *) sc->sc_base_addr);
++ kfree(sc);
++ return 0;
++}
++
++#ifdef CONFIG_PPC_MERGE
++static struct of_device_id talitos_match[] = {
++ {
++ .type = "crypto",
++ .compatible = "talitos",
++ },
++ {},
++};
++
++MODULE_DEVICE_TABLE(of, talitos_match);
++
++static struct of_platform_driver talitos_driver = {
++ .name = DRV_NAME,
++ .match_table = talitos_match,
++ .probe = talitos_probe,
++ .remove = talitos_remove,
++};
++
++static int __init talitos_init(void)
++{
++ return of_register_platform_driver(&talitos_driver);
++}
++
++static void __exit talitos_exit(void)
++{
++ of_unregister_platform_driver(&talitos_driver);
++}
++#else
++/* Structure for a platform device driver */
++static struct platform_driver talitos_driver = {
++ .probe = talitos_probe,
++ .remove = talitos_remove,
++ .driver = {
++ .name = "fsl-sec2",
++ }
++};
++
++static int __init talitos_init(void)
++{
++ return platform_driver_register(&talitos_driver);
++}
++
++static void __exit talitos_exit(void)
++{
++ platform_driver_unregister(&talitos_driver);
++}
++#endif
++
++module_init(talitos_init);
++module_exit(talitos_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("kim.phillips@freescale.com");
++MODULE_DESCRIPTION("OCF driver for Freescale SEC (talitos)");
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/talitos/talitos_dev.h linux-2.6.27.10/crypto/ocf/talitos/talitos_dev.h
+--- linux-2.6.27.10.orig/crypto/ocf/talitos/talitos_dev.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/talitos/talitos_dev.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,277 @@
++/*
++ * Freescale SEC (talitos) device dependent data structures
++ *
++ * Copyright (c) 2006 Freescale Semiconductor, Inc.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ */
++
++/* device ID register values */
++#define TALITOS_ID_SEC_2_0 0x40
++#define TALITOS_ID_SEC_2_1 0x40 /* cross ref with IP block revision reg */
++
++/*
++ * following num_channels, channel-fifo-depth, exec-unit-mask, and
++ * descriptor-types-mask are for forward-compatibility with openfirmware
++ * flat device trees
++ */
++
++/*
++ * num_channels : the number of channels available in each SEC version.
++ */
++
++/* n.b. this driver requires these values be a power of 2 */
++#define TALITOS_NCHANNELS_SEC_1_0 4
++#define TALITOS_NCHANNELS_SEC_1_2 1
++#define TALITOS_NCHANNELS_SEC_2_0 4
++#define TALITOS_NCHANNELS_SEC_2_01 4
++#define TALITOS_NCHANNELS_SEC_2_1 4
++#define TALITOS_NCHANNELS_SEC_2_4 4
++
++/*
++ * channel-fifo-depth : The number of descriptor
++ * pointers a channel fetch fifo can hold.
++ */
++#define TALITOS_CHFIFOLEN_SEC_1_0 1
++#define TALITOS_CHFIFOLEN_SEC_1_2 1
++#define TALITOS_CHFIFOLEN_SEC_2_0 24
++#define TALITOS_CHFIFOLEN_SEC_2_01 24
++#define TALITOS_CHFIFOLEN_SEC_2_1 24
++#define TALITOS_CHFIFOLEN_SEC_2_4 24
++
++/*
++ * exec-unit-mask : The bitmask representing what Execution Units (EUs)
++ * are available. EU information should be encoded following the SEC's
++ * EU_SEL0 bitfield documentation, i.e. as follows:
++ *
++ * bit 31 = set if SEC permits no-EU selection (should be always set)
++ * bit 30 = set if SEC has the ARC4 EU (AFEU)
++ * bit 29 = set if SEC has the des/3des EU (DEU)
++ * bit 28 = set if SEC has the message digest EU (MDEU)
++ * bit 27 = set if SEC has the random number generator EU (RNG)
++ * bit 26 = set if SEC has the public key EU (PKEU)
++ * bit 25 = set if SEC has the aes EU (AESU)
++ * bit 24 = set if SEC has the Kasumi EU (KEU)
++ *
++ */
++#define TALITOS_HAS_EU_NONE (1<<0)
++#define TALITOS_HAS_EU_AFEU (1<<1)
++#define TALITOS_HAS_EU_DEU (1<<2)
++#define TALITOS_HAS_EU_MDEU (1<<3)
++#define TALITOS_HAS_EU_RNG (1<<4)
++#define TALITOS_HAS_EU_PKEU (1<<5)
++#define TALITOS_HAS_EU_AESU (1<<6)
++#define TALITOS_HAS_EU_KEU (1<<7)
++
++/* the corresponding masks for each SEC version */
++#define TALITOS_HAS_EUS_SEC_1_0 0x7f
++#define TALITOS_HAS_EUS_SEC_1_2 0x4d
++#define TALITOS_HAS_EUS_SEC_2_0 0x7f
++#define TALITOS_HAS_EUS_SEC_2_01 0x7f
++#define TALITOS_HAS_EUS_SEC_2_1 0xff
++#define TALITOS_HAS_EUS_SEC_2_4 0x7f
++
++/*
++ * descriptor-types-mask : The bitmask representing what descriptors
++ * are available. Descriptor type information should be encoded
++ * following the SEC's Descriptor Header Dword DESC_TYPE field
++ * documentation, i.e. as follows:
++ *
++ * bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
++ * bit 1 = set if SEC supports the ipsec_esp descriptor type
++ * bit 2 = set if SEC supports the common_nonsnoop desc. type
++ * bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
++ * bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
++ * bit 5 = set if SEC supports the srtp descriptor type
++ * bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
++ * bit 7 = set if SEC supports the pkeu_assemble descriptor type
++ * bit 8 = set if SEC supports the aesu_key_expand_output desc.type
++ * bit 9 = set if SEC supports the pkeu_ptmul descriptor type
++ * bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
++ * bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
++ *
++ * ..and so on and so forth.
++ */
++#define TALITOS_HAS_DT_AESU_CTR_NONSNOOP (1<<0)
++#define TALITOS_HAS_DT_IPSEC_ESP (1<<1)
++#define TALITOS_HAS_DT_COMMON_NONSNOOP (1<<2)
++
++/* the corresponding masks for each SEC version */
++#define TALITOS_HAS_DESCTYPES_SEC_2_0 0x01010ebf
++#define TALITOS_HAS_DESCTYPES_SEC_2_1 0x012b0ebf
++
++/*
++ * a TALITOS_xxx_HI address points to the low data bits (32-63) of the register
++ */
++
++/* global register offset addresses */
++#define TALITOS_ID 0x1020
++#define TALITOS_ID_HI 0x1024
++#define TALITOS_MCR 0x1030 /* master control register */
++#define TALITOS_MCR_HI 0x1038 /* master control register */
++#define TALITOS_MCR_SWR 0x1
++#define TALITOS_IMR 0x1008 /* interrupt mask register */
++#define TALITOS_IMR_ALL 0x00010fff /* enable all interrupts mask */
++#define TALITOS_IMR_ERRONLY 0x00010aaa /* enable error interrupts */
++#define TALITOS_IMR_HI 0x100C /* interrupt mask register */
++#define TALITOS_IMR_HI_ALL 0x00323333 /* enable all interrupts mask */
++#define TALITOS_IMR_HI_ERRONLY 0x00222222 /* enable error interrupts */
++#define TALITOS_ISR 0x1010 /* interrupt status register */
++#define TALITOS_ISR_ERROR 0x00010faa /* errors mask */
++#define TALITOS_ISR_DONE 0x00000055 /* channel(s) done mask */
++#define TALITOS_ISR_HI 0x1014 /* interrupt status register */
++#define TALITOS_ICR 0x1018 /* interrupt clear register */
++#define TALITOS_ICR_HI 0x101C /* interrupt clear register */
++
++/* channel register address stride */
++#define TALITOS_CH_OFFSET 0x100
++
++/* channel register offset addresses and bits */
++#define TALITOS_CH_CCCR 0x1108 /* Crypto-Channel Config Register */
++#define TALITOS_CH_CCCR_RESET 0x1 /* Channel Reset bit */
++#define TALITOS_CH_CCCR_HI 0x110c /* Crypto-Channel Config Register */
++#define TALITOS_CH_CCCR_HI_CDWE 0x10 /* Channel done writeback enable bit */
++#define TALITOS_CH_CCCR_HI_NT 0x4 /* Notification type bit */
++#define TALITOS_CH_CCCR_HI_CDIE 0x2 /* Channel Done Interrupt Enable bit */
++#define TALITOS_CH_CCPSR 0x1110 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_CCPSR_HI 0x1114 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_FF 0x1148 /* Fetch FIFO */
++#define TALITOS_CH_FF_HI 0x114c /* Fetch FIFO's FETCH_ADRS */
++#define TALITOS_CH_CDPR 0x1140 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_CDPR_HI 0x1144 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_DESCBUF 0x1180 /* (thru 11bf) Crypto-Channel
++ * Descriptor Buffer (debug) */
++
++/* execution unit register offset addresses and bits */
++#define TALITOS_DEUSR 0x2028 /* DEU status register */
++#define TALITOS_DEUSR_HI 0x202c /* DEU status register */
++#define TALITOS_DEUISR 0x2030 /* DEU interrupt status register */
++#define TALITOS_DEUISR_HI 0x2034 /* DEU interrupt status register */
++#define TALITOS_DEUICR 0x2038 /* DEU interrupt control register */
++#define TALITOS_DEUICR_HI 0x203c /* DEU interrupt control register */
++#define TALITOS_AESUISR 0x4030 /* AESU interrupt status register */
++#define TALITOS_AESUISR_HI 0x4034 /* AESU interrupt status register */
++#define TALITOS_AESUICR 0x4038 /* AESU interrupt control register */
++#define TALITOS_AESUICR_HI 0x403c /* AESU interrupt control register */
++#define TALITOS_MDEUISR 0x6030 /* MDEU interrupt status register */
++#define TALITOS_MDEUISR_HI 0x6034 /* MDEU interrupt status register */
++#define TALITOS_RNGSR 0xa028 /* RNG status register */
++#define TALITOS_RNGSR_HI 0xa02c /* RNG status register */
++#define TALITOS_RNGSR_HI_RD 0x1 /* RNG Reset done */
++#define TALITOS_RNGSR_HI_OFL 0xff0000/* number of dwords in RNG output FIFO*/
++#define TALITOS_RNGDSR 0xa010 /* RNG data size register */
++#define TALITOS_RNGDSR_HI 0xa014 /* RNG data size register */
++#define TALITOS_RNG_FIFO 0xa800 /* RNG FIFO - pool of random numbers */
++#define TALITOS_RNGISR 0xa030 /* RNG Interrupt status register */
++#define TALITOS_RNGISR_HI 0xa034 /* RNG Interrupt status register */
++#define TALITOS_RNGRCR 0xa018 /* RNG Reset control register */
++#define TALITOS_RNGRCR_HI 0xa01c /* RNG Reset control register */
++#define TALITOS_RNGRCR_HI_SR 0x1 /* RNG RNGRCR:Software Reset */
++
++/* descriptor pointer entry */
++struct talitos_desc_ptr {
++ u16 len; /* length */
++ u8 extent; /* jump (to s/g link table) and extent */
++ u8 res; /* reserved */
++ u32 ptr; /* pointer */
++};
++
++/* descriptor */
++struct talitos_desc {
++ u32 hdr; /* header */
++ u32 res; /* reserved */
++ struct talitos_desc_ptr ptr[7]; /* ptr/len pair array */
++};
++
++/* talitos descriptor header (hdr) bits */
++
++/* primary execution unit select */
++#define TALITOS_SEL0_AFEU 0x10000000
++#define TALITOS_SEL0_DEU 0x20000000
++#define TALITOS_SEL0_MDEU 0x30000000
++#define TALITOS_SEL0_RNG 0x40000000
++#define TALITOS_SEL0_PKEU 0x50000000
++#define TALITOS_SEL0_AESU 0x60000000
++
++/* primary execution unit mode (MODE0) and derivatives */
++#define TALITOS_MODE0_AESU_CBC 0x00200000
++#define TALITOS_MODE0_AESU_ENC 0x00100000
++#define TALITOS_MODE0_DEU_CBC 0x00400000
++#define TALITOS_MODE0_DEU_3DES 0x00200000
++#define TALITOS_MODE0_DEU_ENC 0x00100000
++#define TALITOS_MODE0_MDEU_INIT 0x01000000 /* init starting regs */
++#define TALITOS_MODE0_MDEU_HMAC 0x00800000
++#define TALITOS_MODE0_MDEU_PAD 0x00400000 /* PD */
++#define TALITOS_MODE0_MDEU_MD5 0x00200000
++#define TALITOS_MODE0_MDEU_SHA256 0x00100000
++#define TALITOS_MODE0_MDEU_SHA1 0x00000000 /* SHA-160 */
++#define TALITOS_MODE0_MDEU_MD5_HMAC \
++ (TALITOS_MODE0_MDEU_MD5 | TALITOS_MODE0_MDEU_HMAC)
++#define TALITOS_MODE0_MDEU_SHA256_HMAC \
++ (TALITOS_MODE0_MDEU_SHA256 | TALITOS_MODE0_MDEU_HMAC)
++#define TALITOS_MODE0_MDEU_SHA1_HMAC \
++ (TALITOS_MODE0_MDEU_SHA1 | TALITOS_MODE0_MDEU_HMAC)
++
++/* secondary execution unit select (SEL1) */
++/* it's MDEU or nothing */
++#define TALITOS_SEL1_MDEU 0x00030000
++
++/* secondary execution unit mode (MODE1) and derivatives */
++#define TALITOS_MODE1_MDEU_INIT 0x00001000 /* init starting regs */
++#define TALITOS_MODE1_MDEU_HMAC 0x00000800
++#define TALITOS_MODE1_MDEU_PAD 0x00000400 /* PD */
++#define TALITOS_MODE1_MDEU_MD5 0x00000200
++#define TALITOS_MODE1_MDEU_SHA256 0x00000100
++#define TALITOS_MODE1_MDEU_SHA1 0x00000000 /* SHA-160 */
++#define TALITOS_MODE1_MDEU_MD5_HMAC \
++ (TALITOS_MODE1_MDEU_MD5 | TALITOS_MODE1_MDEU_HMAC)
++#define TALITOS_MODE1_MDEU_SHA256_HMAC \
++ (TALITOS_MODE1_MDEU_SHA256 | TALITOS_MODE1_MDEU_HMAC)
++#define TALITOS_MODE1_MDEU_SHA1_HMAC \
++ (TALITOS_MODE1_MDEU_SHA1 | TALITOS_MODE1_MDEU_HMAC)
++
++/* direction of overall data flow (DIR) */
++#define TALITOS_DIR_OUTBOUND 0x00000000
++#define TALITOS_DIR_INBOUND 0x00000002
++
++/* done notification (DN) */
++#define TALITOS_DONE_NOTIFY 0x00000001
++
++/* descriptor types */
++/* odd numbers here are valid on SEC2 and greater only (e.g. ipsec_esp) */
++#define TD_TYPE_AESU_CTR_NONSNOOP (0 << 3)
++#define TD_TYPE_IPSEC_ESP (1 << 3)
++#define TD_TYPE_COMMON_NONSNOOP_NO_AFEU (2 << 3)
++#define TD_TYPE_HMAC_SNOOP_NO_AFEU (4 << 3)
++
++#define TALITOS_HDR_DONE_BITS 0xff000000
++
++#define DPRINTF(a...) do { \
++ if (debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_cdev) : "talitos"); \
++ printk(a); \
++ } \
++ } while (0)
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/talitos/talitos_soft.h linux-2.6.27.10/crypto/ocf/talitos/talitos_soft.h
+--- linux-2.6.27.10.orig/crypto/ocf/talitos/talitos_soft.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/talitos/talitos_soft.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,77 @@
++/*
++ * Freescale SEC data structures for integration with ocf-linux
++ *
++ * Copyright (c) 2006 Freescale Semiconductor, Inc.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/*
++ * paired descriptor and associated crypto operation
++ */
++struct desc_cryptop_pair {
++ struct talitos_desc cf_desc; /* descriptor ptr */
++ struct cryptop *cf_crp; /* cryptop ptr */
++};
++
++/*
++ * Holds data specific to a single talitos device.
++ */
++struct talitos_softc {
++ softc_device_decl sc_cdev;
++ struct platform_device *sc_dev; /* device backpointer */
++ ocf_iomem_t sc_base_addr;
++ int sc_irq;
++ int sc_num; /* if we have multiple chips */
++ int32_t sc_cid; /* crypto tag */
++ u64 sc_chiprev; /* major/minor chip revision */
++ int sc_nsessions;
++ struct talitos_session *sc_sessions;
++ int sc_num_channels;/* number of crypto channels */
++ int sc_chfifo_len; /* channel fetch fifo len */
++ int sc_exec_units; /* execution units mask */
++ int sc_desc_types; /* descriptor types mask */
++ /*
++ * mutual exclusion for intra-channel resources, e.g. fetch fifos
++ * the last entry is a meta-channel lock used by the channel scheduler
++ */
++ spinlock_t *sc_chnfifolock;
++ /* sc_chnlastalgo contains last algorithm for that channel */
++ int *sc_chnlastalg;
++ /* sc_chnfifo holds pending descriptor--crypto operation pairs */
++ struct desc_cryptop_pair **sc_chnfifo;
++};
++
++struct talitos_session {
++ u_int32_t ses_used;
++ u_int32_t ses_klen; /* key length in bits */
++ u_int32_t ses_key[8]; /* DES/3DES/AES key */
++ u_int32_t ses_hmac[5]; /* hmac inner state */
++ u_int32_t ses_hmac_len; /* hmac length */
++ u_int32_t ses_iv[4]; /* DES/3DES/AES iv */
++ u_int32_t ses_mlen; /* desired hash result len (12=ipsec or 16) */
++};
++
++#define TALITOS_SESSION(sid) ((sid) & 0x0fffffff)
++#define TALITOS_SID(crd, sesn) (((crd) << 28) | ((sesn) & 0x0fffffff))
+diff -Nur linux-2.6.27.10.orig/crypto/ocf/uio.h linux-2.6.27.10/crypto/ocf/uio.h
+--- linux-2.6.27.10.orig/crypto/ocf/uio.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.27.10/crypto/ocf/uio.h 2008-12-23 19:31:44.000000000 +0100
+@@ -0,0 +1,54 @@
++#ifndef _OCF_UIO_H_
++#define _OCF_UIO_H_
++
++#include <linux/uio.h>
++
++/*
++ * The linux uio.h doesn't have all we need. To be fully api compatible
++ * with the BSD cryptodev, we need to keep this around. Perhaps this can
++ * be moved back into the linux/uio.h
++ *
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ * ---------------------------------------------------------------------------
++ */
++
++struct uio {
++ struct iovec *uio_iov;
++ int uio_iovcnt;
++ off_t uio_offset;
++ int uio_resid;
++#if 0
++ enum uio_seg uio_segflg;
++ enum uio_rw uio_rw;
++ struct thread *uio_td;
++#endif
++};
++
++#endif
+diff -Nur linux-2.6.27.10.orig/drivers/char/random.c linux-2.6.27.10/drivers/char/random.c
+--- linux-2.6.27.10.orig/drivers/char/random.c 2008-12-18 18:13:59.000000000 +0100
++++ linux-2.6.27.10/drivers/char/random.c 2008-12-23 19:31:44.000000000 +0100
+@@ -129,6 +129,9 @@
+ * unsigned int value);
+ * void add_interrupt_randomness(int irq);
+ *
++ * void random_input_words(__u32 *buf, size_t wordcount, int ent_count)
++ * int random_input_wait(void);
++ *
+ * add_input_randomness() uses the input layer interrupt timing, as well as
+ * the event type information from the hardware.
+ *
+@@ -140,6 +143,13 @@
+ * a better measure, since the timing of the disk interrupts are more
+ * unpredictable.
+ *
++ * random_input_words() just provides a raw block of entropy to the input
++ * pool, such as from a hardware entropy generator.
++ *
++ * random_input_wait() suspends the caller until such time as the
++ * entropy pool falls below the write threshold, and returns a count of how
++ * much entropy (in bits) is needed to sustain the pool.
++ *
+ * All of these routines try to estimate how many bits of randomness a
+ * particular randomness source. They do this by keeping track of the
+ * first and second order deltas of the event timings.
+@@ -668,6 +678,61 @@
+ }
+ #endif
+
++/*
++ * random_input_words - add bulk entropy to pool
++ *
++ * @buf: buffer to add
++ * @wordcount: number of __u32 words to add
++ * @ent_count: total amount of entropy (in bits) to credit
++ *
++ * this provides bulk input of entropy to the input pool
++ *
++ */
++void random_input_words(__u32 *buf, size_t wordcount, int ent_count)
++{
++ mix_pool_bytes(&input_pool, buf, wordcount*4);
++
++ credit_entropy_bits(&input_pool, ent_count);
++
++ DEBUG_ENT("crediting %d bits => %d\n",
++ ent_count, input_pool.entropy_count);
++ /*
++ * Wake up waiting processes if we have enough
++ * entropy.
++ */
++ if (input_pool.entropy_count >= random_read_wakeup_thresh)
++ wake_up_interruptible(&random_read_wait);
++}
++EXPORT_SYMBOL(random_input_words);
++
++/*
++ * random_input_wait - wait until random needs entropy
++ *
++ * this function sleeps until the /dev/random subsystem actually
++ * needs more entropy, and then return the amount of entropy
++ * that it would be nice to have added to the system.
++ */
++int random_input_wait(void)
++{
++ int count;
++
++ wait_event_interruptible(random_write_wait,
++ input_pool.entropy_count < random_write_wakeup_thresh);
++
++ count = random_write_wakeup_thresh - input_pool.entropy_count;
++
++ /* likely we got woken up due to a signal */
++ if (count <= 0) count = random_read_wakeup_thresh;
++
++ DEBUG_ENT("requesting %d bits from input_wait()er %d<%d\n",
++ count,
++ input_pool.entropy_count, random_write_wakeup_thresh);
++
++ return count;
++}
++EXPORT_SYMBOL(random_input_wait);
++
++
+ #define EXTRACT_SIZE 10
+
+ /*********************************************************************
+diff -Nur linux-2.6.27.10.orig/fs/fcntl.c linux-2.6.27.10/fs/fcntl.c
+--- linux-2.6.27.10.orig/fs/fcntl.c 2008-12-18 18:13:59.000000000 +0100
++++ linux-2.6.27.10/fs/fcntl.c 2008-12-23 19:31:44.000000000 +0100
+@@ -140,6 +140,7 @@
+ }
+ return ret;
+ }
++EXPORT_SYMBOL(sys_dup);
+
+ #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC | O_DIRECT | O_NOATIME)
+
+diff -Nur linux-2.6.27.10.orig/include/linux/miscdevice.h linux-2.6.27.10/include/linux/miscdevice.h
+--- linux-2.6.27.10.orig/include/linux/miscdevice.h 2008-12-18 18:13:59.000000000 +0100
++++ linux-2.6.27.10/include/linux/miscdevice.h 2008-12-23 19:31:46.000000000 +0100
+@@ -12,6 +12,7 @@
+ #define APOLLO_MOUSE_MINOR 7
+ #define PC110PAD_MINOR 9
+ /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */
++#define CRYPTODEV_MINOR 70 /* /dev/crypto */
+ #define WATCHDOG_MINOR 130 /* Watchdog timer */
+ #define TEMP_MINOR 131 /* Temperature Sensor */
+ #define RTC_MINOR 135
+diff -Nur linux-2.6.27.10.orig/include/linux/random.h linux-2.6.27.10/include/linux/random.h
+--- linux-2.6.27.10.orig/include/linux/random.h 2008-12-18 18:13:59.000000000 +0100
++++ linux-2.6.27.10/include/linux/random.h 2008-12-23 19:31:46.000000000 +0100
+@@ -8,6 +8,7 @@
+ #define _LINUX_RANDOM_H
+
+ #include <linux/ioctl.h>
++#include <linux/types.h> /* for __u32 in user space */
+
+ /* ioctl()'s for the random number generator */
+
+@@ -32,6 +33,30 @@
+ /* Clear the entropy pool and associated counters. (Superuser only.) */
+ #define RNDCLEARPOOL _IO( 'R', 0x06 )
+
++#ifdef CONFIG_FIPS_RNG
++
++/* Size of seed value - equal to AES blocksize */
++#define AES_BLOCK_SIZE_BYTES 16
++#define SEED_SIZE_BYTES AES_BLOCK_SIZE_BYTES
++/* Size of AES key */
++#define KEY_SIZE_BYTES 16
++
++/* ioctl() structure used by FIPS 140-2 Tests */
++struct rand_fips_test {
++ unsigned char key[KEY_SIZE_BYTES]; /* Input */
++ unsigned char datetime[SEED_SIZE_BYTES]; /* Input */
++ unsigned char seed[SEED_SIZE_BYTES]; /* Input */
++ unsigned char result[SEED_SIZE_BYTES]; /* Output */
++};
++
++/* FIPS 140-2 RNG Variable Seed Test. (Superuser only.) */
++#define RNDFIPSVST _IOWR('R', 0x10, struct rand_fips_test)
++
++/* FIPS 140-2 RNG Monte Carlo Test. (Superuser only.) */
++#define RNDFIPSMCT _IOWR('R', 0x11, struct rand_fips_test)
++
++#endif /* #ifdef CONFIG_FIPS_RNG */
++
+ struct rand_pool_info {
+ int entropy_count;
+ int buf_size;
+@@ -48,6 +73,10 @@
+ unsigned int value);
+ extern void add_interrupt_randomness(int irq);
+
++extern void random_input_words(__u32 *buf, size_t wordcount, int ent_count);
++extern int random_input_wait(void);
++#define HAS_RANDOM_INPUT_WAIT 1
++
+ extern void get_random_bytes(void *buf, int nbytes);
+ void generate_random_uuid(unsigned char uuid_out[16]);
+
diff --git a/target/linux/patches/2.6.28/sunrpc-kallsym-deactivated.patch b/target/linux/patches/2.6.28/sunrpc-kallsym-deactivated.patch
new file mode 100644
index 000000000..3c5f38fdf
--- /dev/null
+++ b/target/linux/patches/2.6.28/sunrpc-kallsym-deactivated.patch
@@ -0,0 +1,13 @@
+diff -Nur linux-2.6.28.orig/net/sunrpc/clnt.c linux-2.6.28/net/sunrpc/clnt.c
+--- linux-2.6.28.orig/net/sunrpc/clnt.c 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/net/sunrpc/clnt.c 2009-01-04 16:35:59.000000000 +0100
+@@ -1548,7 +1548,9 @@
+
+ /* map tk_action pointer to a function name; then trim off
+ * the "+0x0 [sunrpc]" */
++#ifdef CONFIG_KALLSYMS
+ sprint_symbol(action, (unsigned long)task->tk_action);
++#endif
+ p = strchr(action, '+');
+ if (p)
+ *p = '\0';
diff --git a/target/linux/patches/cygwin-compat.patch b/target/linux/patches/cygwin-compat.patch
new file mode 100644
index 000000000..453748618
--- /dev/null
+++ b/target/linux/patches/cygwin-compat.patch
@@ -0,0 +1,66 @@
+diff -Nur linux-2.6.29.1.orig/scripts/mod/file2alias.c linux-2.6.29.1/scripts/mod/file2alias.c
+--- linux-2.6.29.1.orig/scripts/mod/file2alias.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/scripts/mod/file2alias.c 2009-05-06 19:05:47.367234820 +0200
+@@ -29,7 +29,11 @@
+
+ #include <ctype.h>
+
++#ifdef __CYGWIN__
++typedef __uint32_t __u32;
++#else
+ typedef uint32_t __u32;
++#endif
+ typedef uint16_t __u16;
+ typedef unsigned char __u8;
+
+diff -Nur linux-2.6.29.1.orig/scripts/mod/modpost.h linux-2.6.29.1/scripts/mod/modpost.h
+--- linux-2.6.29.1.orig/scripts/mod/modpost.h 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/scripts/mod/modpost.h 2009-05-06 19:06:14.068903184 +0200
+@@ -9,6 +9,11 @@
+ #include <unistd.h>
+ #include <elf.h>
+
++#ifdef __CYGWIN__
++typedef uint16_t Elf32_Section;
++typedef uint16_t Elf64_Section;
++#endif
++
+ #include "elfconfig.h"
+
+ #if KERNEL_ELFCLASS == ELFCLASS32
+@@ -19,13 +24,17 @@
+ #define Elf_Addr Elf32_Addr
+ #define Elf_Sword Elf64_Sword
+ #define Elf_Section Elf32_Half
++#ifndef __CYGWIN__
+ #define ELF_ST_BIND ELF32_ST_BIND
+ #define ELF_ST_TYPE ELF32_ST_TYPE
++#endif
+
+ #define Elf_Rel Elf32_Rel
+ #define Elf_Rela Elf32_Rela
++#ifndef __CYGWIN__
+ #define ELF_R_SYM ELF32_R_SYM
+ #define ELF_R_TYPE ELF32_R_TYPE
++#endif
+ #else
+
+ #define Elf_Ehdr Elf64_Ehdr
+@@ -43,6 +52,17 @@
+ #define ELF_R_TYPE ELF64_R_TYPE
+ #endif
+
++#define R_386_32 1 /* Direct 32 bit */
++#define R_386_PC32 2 /* PC relative 32 bit */
++
++#define R_ARM_PC24 1 /* PC relative 26 bit branch */
++#define R_ARM_ABS32 2 /* Direct 32 bit */
++
++#define R_MIPS_32 2 /* Direct 32 bit */
++#define R_MIPS_26 4 /* Direct 26 bit shifted */
++#define R_MIPS_HI16 5 /* High 16 bit */
++#define R_MIPS_LO16 6 /* Low 16 bit */
++
+ /* The 64-bit MIPS ELF ABI uses an unusual reloc format. */
+ typedef struct
+ {
diff --git a/target/linux/patches/freebsd-compat.patch b/target/linux/patches/freebsd-compat.patch
new file mode 100644
index 000000000..fb09008f6
--- /dev/null
+++ b/target/linux/patches/freebsd-compat.patch
@@ -0,0 +1,11 @@
+diff -Nur linux-2.6.29.1.orig/arch/x86/boot/tools/build.c linux-2.6.29.1/arch/x86/boot/tools/build.c
+--- linux-2.6.29.1.orig/arch/x86/boot/tools/build.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/x86/boot/tools/build.c 2009-05-08 23:29:09.000000000 +0200
+@@ -29,7 +29,6 @@
+ #include <stdarg.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <sys/sysmacros.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/mman.h>
diff --git a/target/linux/patches/ocf.patch b/target/linux/patches/ocf.patch
new file mode 100644
index 000000000..69cffc1da
--- /dev/null
+++ b/target/linux/patches/ocf.patch
@@ -0,0 +1,23653 @@
+diff -Nur linux-2.6.29.1.orig/crypto/Kconfig linux-2.6.29.1/crypto/Kconfig
+--- linux-2.6.29.1.orig/crypto/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/crypto/Kconfig 2009-04-20 20:01:21.396548617 +0200
+@@ -737,3 +737,5 @@
+ source "drivers/crypto/Kconfig"
+
+ endif # if CRYPTO
++
++source "crypto/ocf/Kconfig"
+diff -Nur linux-2.6.29.1.orig/crypto/Makefile linux-2.6.29.1/crypto/Makefile
+--- linux-2.6.29.1.orig/crypto/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/crypto/Makefile 2009-04-20 20:01:21.396548617 +0200
+@@ -79,6 +79,8 @@
+ obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
+ obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
+
++obj-$(CONFIG_OCF_OCF) += ocf/
++
+ #
+ # generic algorithms and the async_tx api
+ #
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/Config.in linux-2.6.29.1/crypto/ocf/Config.in
+--- linux-2.6.29.1.orig/crypto/ocf/Config.in 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/Config.in 2009-04-20 20:01:21.400550244 +0200
+@@ -0,0 +1,34 @@
++#############################################################################
++
++mainmenu_option next_comment
++comment 'OCF Configuration'
++tristate 'OCF (Open Cryptograhic Framework)' CONFIG_OCF_OCF
++dep_mbool ' enable fips RNG checks (fips check on RNG data before use)' \
++ CONFIG_OCF_FIPS $CONFIG_OCF_OCF
++dep_mbool ' enable harvesting entropy for /dev/random' \
++ CONFIG_OCF_RANDOMHARVEST $CONFIG_OCF_OCF
++dep_tristate ' cryptodev (user space support)' \
++ CONFIG_OCF_CRYPTODEV $CONFIG_OCF_OCF
++dep_tristate ' cryptosoft (software crypto engine)' \
++ CONFIG_OCF_CRYPTOSOFT $CONFIG_OCF_OCF
++dep_tristate ' safenet (HW crypto engine)' \
++ CONFIG_OCF_SAFE $CONFIG_OCF_OCF
++dep_tristate ' IXP4xx (HW crypto engine)' \
++ CONFIG_OCF_IXP4XX $CONFIG_OCF_OCF
++dep_mbool ' Enable IXP4xx HW to perform SHA1 and MD5 hashing (very slow)' \
++ CONFIG_OCF_IXP4XX_SHA1_MD5 $CONFIG_OCF_IXP4XX
++dep_tristate ' hifn (HW crypto engine)' \
++ CONFIG_OCF_HIFN $CONFIG_OCF_OCF
++dep_tristate ' talitos (HW crypto engine)' \
++ CONFIG_OCF_TALITOS $CONFIG_OCF_OCF
++dep_tristate ' pasemi (HW crypto engine)' \
++ CONFIG_OCF_PASEMI $CONFIG_OCF_OCF
++dep_tristate ' ep80579 (HW crypto engine)' \
++ CONFIG_OCF_EP80579 $CONFIG_OCF_OCF
++dep_tristate ' ocfnull (does no crypto)' \
++ CONFIG_OCF_OCFNULL $CONFIG_OCF_OCF
++dep_tristate ' ocf-bench (HW crypto in-kernel benchmark)' \
++ CONFIG_OCF_BENCH $CONFIG_OCF_OCF
++endmenu
++
++#############################################################################
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/Kconfig linux-2.6.29.1/crypto/ocf/Kconfig
+--- linux-2.6.29.1.orig/crypto/ocf/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/Kconfig 2009-04-20 20:01:21.548558198 +0200
+@@ -0,0 +1,101 @@
++menu "OCF Configuration"
++
++config OCF_OCF
++ tristate "OCF (Open Cryptograhic Framework)"
++ help
++ A linux port of the OpenBSD/FreeBSD crypto framework.
++
++config OCF_RANDOMHARVEST
++ bool "crypto random --- harvest entropy for /dev/random"
++ depends on OCF_OCF
++ help
++ Includes code to harvest random numbers from devices that support it.
++
++config OCF_FIPS
++ bool "enable fips RNG checks"
++ depends on OCF_OCF && OCF_RANDOMHARVEST
++ help
++ Run all RNG provided data through a fips check before
++ adding it /dev/random's entropy pool.
++
++config OCF_CRYPTODEV
++ tristate "cryptodev (user space support)"
++ depends on OCF_OCF
++ help
++ The user space API to access crypto hardware.
++
++config OCF_CRYPTOSOFT
++ tristate "cryptosoft (software crypto engine)"
++ depends on OCF_OCF
++ help
++ A software driver for the OCF framework that uses
++ the kernel CryptoAPI.
++
++config OCF_SAFE
++ tristate "safenet (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ A driver for a number of the safenet Excel crypto accelerators.
++ Currently tested and working on the 1141 and 1741.
++
++config OCF_IXP4XX
++ tristate "IXP4xx (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ XScale IXP4xx crypto accelerator driver. Requires the
++ Intel Access library.
++
++config OCF_IXP4XX_SHA1_MD5
++ bool "IXP4xx SHA1 and MD5 Hashing"
++ depends on OCF_IXP4XX
++ help
++ Allows the IXP4xx crypto accelerator to perform SHA1 and MD5 hashing.
++ Note: this is MUCH slower than using cryptosoft (software crypto engine).
++
++config OCF_HIFN
++ tristate "hifn (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for various HIFN based crypto accelerators.
++ (7951, 7955, 7956, 7751, 7811)
++
++config OCF_HIFNHIPP
++ tristate "Hifn HIPP (HW packet crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for various HIFN (HIPP) based crypto accelerators
++ (7855)
++
++config OCF_TALITOS
++ tristate "talitos (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for Freescale's security engine (SEC/talitos).
++
++config OCF_PASEMI
++ tristate "pasemi (HW crypto engine)"
++ depends on OCF_OCF && PPC_PASEMI
++ help
++ OCF driver for the PA Semi PWRficient DMA Engine
++
++config OCF_EP80579
++ tristate "ep80579 (HW crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for the Intel EP80579 Integrated Processor Product Line.
++
++config OCF_OCFNULL
++ tristate "ocfnull (fake crypto engine)"
++ depends on OCF_OCF
++ help
++ OCF driver for measuring ipsec overheads (does no crypto)
++
++config OCF_BENCH
++ tristate "ocf-bench (HW crypto in-kernel benchmark)"
++ depends on OCF_OCF
++ help
++ A very simple encryption test for the in-kernel interface
++ of OCF. Also includes code to benchmark the IXP Access library
++ for comparison.
++
++endmenu
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/Makefile linux-2.6.29.1/crypto/ocf/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/Makefile 2009-04-20 20:01:21.548558198 +0200
+@@ -0,0 +1,121 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++OCF_OBJS = crypto.o criov.o
++
++ifdef CONFIG_OCF_RANDOMHARVEST
++ OCF_OBJS += random.o
++endif
++
++ifdef CONFIG_OCF_FIPS
++ OCF_OBJS += rndtest.o
++endif
++
++# Add in autoconf.h to get #defines for CONFIG_xxx
++AUTOCONF_H=$(ROOTDIR)/modules/autoconf.h
++ifeq ($(AUTOCONF_H), $(wildcard $(AUTOCONF_H)))
++ EXTRA_CFLAGS += -include $(AUTOCONF_H)
++ export EXTRA_CFLAGS
++endif
++
++ifndef obj
++ obj ?= .
++ _obj = subdir
++ mod-subdirs := safe hifn ixp4xx talitos ocfnull
++ export-objs += crypto.o criov.o random.o
++ list-multi += ocf.o
++ _slash :=
++else
++ _obj = obj
++ _slash := /
++endif
++
++EXTRA_CFLAGS += -I$(obj)/.
++
++obj-$(CONFIG_OCF_OCF) += ocf.o
++obj-$(CONFIG_OCF_CRYPTODEV) += cryptodev.o
++obj-$(CONFIG_OCF_CRYPTOSOFT) += cryptosoft.o
++obj-$(CONFIG_OCF_BENCH) += ocf-bench.o
++
++$(_obj)-$(CONFIG_OCF_SAFE) += safe$(_slash)
++$(_obj)-$(CONFIG_OCF_HIFN) += hifn$(_slash)
++$(_obj)-$(CONFIG_OCF_IXP4XX) += ixp4xx$(_slash)
++$(_obj)-$(CONFIG_OCF_TALITOS) += talitos$(_slash)
++$(_obj)-$(CONFIG_OCF_PASEMI) += pasemi$(_slash)
++$(_obj)-$(CONFIG_OCF_EP80579) += ep80579$(_slash)
++$(_obj)-$(CONFIG_OCF_OCFNULL) += ocfnull$(_slash)
++
++ocf-objs := $(OCF_OBJS)
++
++$(list-multi) dummy1: $(ocf-objs)
++ $(LD) -r -o $@ $(ocf-objs)
++
++.PHONY:
++clean:
++ rm -f *.o *.ko .*.o.flags .*.ko.cmd .*.o.cmd .*.mod.o.cmd *.mod.c
++ rm -f */*.o */*.ko */.*.o.cmd */.*.ko.cmd */.*.mod.o.cmd */*.mod.c */.*.o.flags
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
++#
++# release gen targets
++#
++
++.PHONY: patch
++patch:
++ REL=`date +%Y%m%d`; \
++ patch=ocf-linux-$$REL.patch; \
++ patch24=ocf-linux-24-$$REL.patch; \
++ patch26=ocf-linux-26-$$REL.patch; \
++ ( \
++ find . -name Makefile; \
++ find . -name Config.in; \
++ find . -name Kconfig; \
++ find . -name README; \
++ find . -name '*.[ch]' | grep -v '.mod.c'; \
++ ) | while read t; do \
++ diff -Nau /dev/null $$t | sed 's?^+++ \./?+++ linux/crypto/ocf/?'; \
++ done > $$patch; \
++ cat patches/linux-2.4.35-ocf.patch $$patch > $$patch24; \
++ cat patches/linux-2.6.26-ocf.patch $$patch > $$patch26
++
++.PHONY: tarball
++tarball:
++ REL=`date +%Y%m%d`; RELDIR=/tmp/ocf-linux-$$REL; \
++ CURDIR=`pwd`; \
++ rm -rf /tmp/ocf-linux-$$REL*; \
++ mkdir -p $$RELDIR/tools; \
++ cp README* $$RELDIR; \
++ cp patches/openss*.patch $$RELDIR; \
++ cp patches/crypto-tools.patch $$RELDIR; \
++ cp tools/[!C]* $$RELDIR/tools; \
++ cd ..; \
++ tar cvf $$RELDIR/ocf-linux.tar \
++ --exclude=CVS \
++ --exclude=.* \
++ --exclude=*.o \
++ --exclude=*.ko \
++ --exclude=*.mod.* \
++ --exclude=README* \
++ --exclude=ocf-*.patch \
++ --exclude=ocf/patches/openss*.patch \
++ --exclude=ocf/patches/crypto-tools.patch \
++ --exclude=ocf/tools \
++ ocf; \
++ gzip -9 $$RELDIR/ocf-linux.tar; \
++ cd /tmp; \
++ tar cvf ocf-linux-$$REL.tar ocf-linux-$$REL; \
++ gzip -9 ocf-linux-$$REL.tar; \
++ cd $$CURDIR/../../user; \
++ rm -rf /tmp/crypto-tools-$$REL*; \
++ tar cvf /tmp/crypto-tools-$$REL.tar \
++ --exclude=CVS \
++ --exclude=.* \
++ --exclude=*.o \
++ --exclude=cryptotest \
++ --exclude=cryptokeytest \
++ crypto-tools; \
++ gzip -9 /tmp/crypto-tools-$$REL.tar
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/README linux-2.6.29.1/crypto/ocf/README
+--- linux-2.6.29.1.orig/crypto/ocf/README 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/README 2009-04-20 20:01:21.584560546 +0200
+@@ -0,0 +1,167 @@
++README - ocf-linux-20071215
++---------------------------
++
++This README provides instructions for getting ocf-linux compiled and
++operating in a generic linux environment. For other information you
++might like to visit the home page for this project:
++
++ http://ocf-linux.sourceforge.net/
++
++Adding OCF to linux
++-------------------
++
++ Not much in this file for now, just some notes. I usually build
++ the ocf support as modules but it can be built into the kernel as
++ well. To use it:
++
++ * mknod /dev/crypto c 10 70
++
++ * to add OCF to your kernel source, you have two options. Apply
++ the kernel specific patch:
++
++ cd linux-2.4*; gunzip < ocf-linux-24-XXXXXXXX.patch.gz | patch -p1
++ cd linux-2.6*; gunzip < ocf-linux-26-XXXXXXXX.patch.gz | patch -p1
++
++ if you do one of the above, then you can proceed to the next step,
++ or you can do the above process by hand with using the patches against
++ linux-2.4.35 and 2.6.23 to include the ocf code under crypto/ocf.
++ Here's how to add it:
++
++ for 2.4.35 (and later)
++
++ cd linux-2.4.35/crypto
++ tar xvzf ocf-linux.tar.gz
++ cd ..
++ patch -p1 < crypto/ocf/patches/linux-2.4.35-ocf.patch
++
++ for 2.6.23 (and later), find the kernel patch specific (or nearest)
++ to your kernel versions and then:
++
++ cd linux-2.6.NN/crypto
++ tar xvzf ocf-linux.tar.gz
++ cd ..
++ patch -p1 < crypto/ocf/patches/linux-2.6.NN-ocf.patch
++
++ It should be easy to take this patch and apply it to other more
++ recent versions of the kernels. The same patches should also work
++ relatively easily on kernels as old as 2.6.11 and 2.4.18.
++
++ * under 2.4 if you are on a non-x86 platform, you may need to:
++
++ cp linux-2.X.x/include/asm-i386/kmap_types.h linux-2.X.x/include/asm-YYY
++
++ so that you can build the kernel crypto support needed for the cryptosoft
++ driver.
++
++ * For simplicity you should enable all the crypto support in your kernel
++ except for the test driver. Likewise for the OCF options. Do not
++ enable OCF crypto drivers for HW that you do not have (for example
++ ixp4xx will not compile on non-Xscale systems).
++
++ * make sure that cryptodev.h (from ocf-linux.tar.gz) is installed as
++ crypto/cryptodev.h in an include directory that is used for building
++ applications for your platform. For example on a host system that
++ might be:
++
++ /usr/include/crypto/cryptodev.h
++
++ * patch your openssl-0.9.8i code with the openssl-0.9.8i.patch.
++ (NOTE: there is no longer a need to patch ssh). The patch is against:
++ openssl-0_9_8e
++
++ If you need a patch for an older version of openssl, you should look
++ to older OCF releases. This patch is unlikely to work on older
++ openssl versions.
++
++ openssl-0.9.8i.patch
++ - enables --with-cryptodev for non BSD systems
++ - adds -cpu option to openssl speed for calculating CPU load
++ under linux
++ - fixes null pointer in openssl speed multi thread output.
++ - fixes test keys to work with linux crypto's more stringent
++ key checking.
++ - adds MD5/SHA acceleration (Ronen Shitrit), only enabled
++ with the --with-cryptodev-digests option
++ - fixes bug in engine code caching.
++
++ * build crypto-tools-XXXXXXXX.tar.gz if you want to try some of the BSD
++ tools for testing OCF (ie., cryptotest).
++
++How to load the OCF drivers
++---------------------------
++
++ First insert the base modules:
++
++ insmod ocf
++ insmod cryptodev
++
++ You can then install the software OCF driver with:
++
++ insmod cryptosoft
++
++ and one or more of the OCF HW drivers with:
++
++ insmod safe
++ insmod hifn7751
++ insmod ixp4xx
++ ...
++
++ all the drivers take a debug option to enable verbose debug so that
++ you can see what is going on. For debug you load them as:
++
++ insmod ocf crypto_debug=1
++ insmod cryptodev cryptodev_debug=1
++ insmod cryptosoft swcr_debug=1
++
++ You may load more than one OCF crypto driver but then there is no guarantee
++ as to which will be used.
++
++ You can also enable debug at run time on 2.6 systems with the following:
++
++ echo 1 > /sys/module/ocf/parameters/crypto_debug
++ echo 1 > /sys/module/cryptodev/parameters/cryptodev_debug
++ echo 1 > /sys/module/cryptosoft/parameters/swcr_debug
++ echo 1 > /sys/module/hifn7751/parameters/hifn_debug
++ echo 1 > /sys/module/safe/parameters/safe_debug
++ echo 1 > /sys/module/ixp4xx/parameters/ixp_debug
++ ...
++
++Testing the OCF support
++-----------------------
++
++ run "cryptotest", it should do a short test for a couple of
++ des packets. If it does everything is working.
++
++ If this works, then ssh will use the driver when invoked as:
++
++ ssh -c 3des username@host
++
++ to see for sure that it is operating, enable debug as defined above.
++
++ To get a better idea of performance run:
++
++ cryptotest 100 4096
++
++ There are more options to cryptotest, see the help.
++
++ It is also possible to use openssl to test the speed of the crypto
++ drivers.
++
++ openssl speed -evp des -engine cryptodev -elapsed
++ openssl speed -evp des3 -engine cryptodev -elapsed
++ openssl speed -evp aes128 -engine cryptodev -elapsed
++
++ and multiple threads (10) with:
++
++ openssl speed -evp des -engine cryptodev -elapsed -multi 10
++ openssl speed -evp des3 -engine cryptodev -elapsed -multi 10
++ openssl speed -evp aes128 -engine cryptodev -elapsed -multi 10
++
++ for public key testing you can try:
++
++ cryptokeytest
++ openssl speed -engine cryptodev rsa -elapsed
++ openssl speed -engine cryptodev dsa -elapsed
++
++David McCullough
++david_mccullough@securecomputing.com
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/criov.c linux-2.6.29.1/crypto/ocf/criov.c
+--- linux-2.6.29.1.orig/crypto/ocf/criov.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/criov.c 2009-04-20 20:01:21.400550244 +0200
+@@ -0,0 +1,215 @@
++/* $OpenBSD: criov.c,v 1.9 2002/01/29 15:48:29 jason Exp $ */
++
++/*
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 1999 Theo de Raadt
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++__FBSDID("$FreeBSD: src/sys/opencrypto/criov.c,v 1.5 2006/06/04 22:15:13 pjd Exp $");
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/uio.h>
++#include <linux/skbuff.h>
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <asm/io.h>
++
++#include <uio.h>
++#include <cryptodev.h>
++
++/*
++ * This macro is only for avoiding code duplication, as we need to skip
++ * given number of bytes in the same way in three functions below.
++ */
++#define CUIO_SKIP() do { \
++ KASSERT(off >= 0, ("%s: off %d < 0", __func__, off)); \
++ KASSERT(len >= 0, ("%s: len %d < 0", __func__, len)); \
++ while (off > 0) { \
++ KASSERT(iol >= 0, ("%s: empty in skip", __func__)); \
++ if (off < iov->iov_len) \
++ break; \
++ off -= iov->iov_len; \
++ iol--; \
++ iov++; \
++ } \
++} while (0)
++
++void
++cuio_copydata(struct uio* uio, int off, int len, caddr_t cp)
++{
++ struct iovec *iov = uio->uio_iov;
++ int iol = uio->uio_iovcnt;
++ unsigned count;
++
++ CUIO_SKIP();
++ while (len > 0) {
++ KASSERT(iol >= 0, ("%s: empty", __func__));
++ count = min((int)(iov->iov_len - off), len);
++ memcpy(cp, ((caddr_t)iov->iov_base) + off, count);
++ len -= count;
++ cp += count;
++ off = 0;
++ iol--;
++ iov++;
++ }
++}
++
++void
++cuio_copyback(struct uio* uio, int off, int len, caddr_t cp)
++{
++ struct iovec *iov = uio->uio_iov;
++ int iol = uio->uio_iovcnt;
++ unsigned count;
++
++ CUIO_SKIP();
++ while (len > 0) {
++ KASSERT(iol >= 0, ("%s: empty", __func__));
++ count = min((int)(iov->iov_len - off), len);
++ memcpy(((caddr_t)iov->iov_base) + off, cp, count);
++ len -= count;
++ cp += count;
++ off = 0;
++ iol--;
++ iov++;
++ }
++}
++
++/*
++ * Return a pointer to iov/offset of location in iovec list.
++ */
++struct iovec *
++cuio_getptr(struct uio *uio, int loc, int *off)
++{
++ struct iovec *iov = uio->uio_iov;
++ int iol = uio->uio_iovcnt;
++
++ while (loc >= 0) {
++ /* Normal end of search */
++ if (loc < iov->iov_len) {
++ *off = loc;
++ return (iov);
++ }
++
++ loc -= iov->iov_len;
++ if (iol == 0) {
++ if (loc == 0) {
++ /* Point at the end of valid data */
++ *off = iov->iov_len;
++ return (iov);
++ } else
++ return (NULL);
++ } else {
++ iov++, iol--;
++ }
++ }
++
++ return (NULL);
++}
++
++EXPORT_SYMBOL(cuio_copyback);
++EXPORT_SYMBOL(cuio_copydata);
++EXPORT_SYMBOL(cuio_getptr);
++
++
++static void
++skb_copy_bits_back(struct sk_buff *skb, int offset, caddr_t cp, int len)
++{
++ int i;
++ if (offset < skb_headlen(skb)) {
++ memcpy(skb->data + offset, cp, min_t(int, skb_headlen(skb), len));
++ len -= skb_headlen(skb);
++ cp += skb_headlen(skb);
++ }
++ offset -= skb_headlen(skb);
++ for (i = 0; len > 0 && i < skb_shinfo(skb)->nr_frags; i++) {
++ if (offset < skb_shinfo(skb)->frags[i].size) {
++ memcpy(page_address(skb_shinfo(skb)->frags[i].page) +
++ skb_shinfo(skb)->frags[i].page_offset,
++ cp, min_t(int, skb_shinfo(skb)->frags[i].size, len));
++ len -= skb_shinfo(skb)->frags[i].size;
++ cp += skb_shinfo(skb)->frags[i].size;
++ }
++ offset -= skb_shinfo(skb)->frags[i].size;
++ }
++}
++
++void
++crypto_copyback(int flags, caddr_t buf, int off, int size, caddr_t in)
++{
++
++ if ((flags & CRYPTO_F_SKBUF) != 0)
++ skb_copy_bits_back((struct sk_buff *)buf, off, in, size);
++ else if ((flags & CRYPTO_F_IOV) != 0)
++ cuio_copyback((struct uio *)buf, off, size, in);
++ else
++ bcopy(in, buf + off, size);
++}
++
++void
++crypto_copydata(int flags, caddr_t buf, int off, int size, caddr_t out)
++{
++
++ if ((flags & CRYPTO_F_SKBUF) != 0)
++ skb_copy_bits((struct sk_buff *)buf, off, out, size);
++ else if ((flags & CRYPTO_F_IOV) != 0)
++ cuio_copydata((struct uio *)buf, off, size, out);
++ else
++ bcopy(buf + off, out, size);
++}
++
++int
++crypto_apply(int flags, caddr_t buf, int off, int len,
++ int (*f)(void *, void *, u_int), void *arg)
++{
++#if 0
++ int error;
++
++ if ((flags & CRYPTO_F_SKBUF) != 0)
++ error = XXXXXX((struct mbuf *)buf, off, len, f, arg);
++ else if ((flags & CRYPTO_F_IOV) != 0)
++ error = cuio_apply((struct uio *)buf, off, len, f, arg);
++ else
++ error = (*f)(arg, buf + off, len);
++ return (error);
++#else
++ KASSERT(0, ("crypto_apply not implemented!\n"));
++#endif
++ return 0;
++}
++
++EXPORT_SYMBOL(crypto_copyback);
++EXPORT_SYMBOL(crypto_copydata);
++EXPORT_SYMBOL(crypto_apply);
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/crypto.c linux-2.6.29.1/crypto/ocf/crypto.c
+--- linux-2.6.29.1.orig/crypto/ocf/crypto.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/crypto.c 2009-04-20 20:01:21.408550425 +0200
+@@ -0,0 +1,1741 @@
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * Copyright (c) 2002-2006 Sam Leffler. All rights reserved.
++ *
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#if 0
++#include <sys/cdefs.h>
++__FBSDID("$FreeBSD: src/sys/opencrypto/crypto.c,v 1.27 2007/03/21 03:42:51 sam Exp $");
++#endif
++
++/*
++ * Cryptographic Subsystem.
++ *
++ * This code is derived from the Openbsd Cryptographic Framework (OCF)
++ * that has the copyright shown below. Very little of the original
++ * code remains.
++ */
++/*-
++ * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
++ *
++ * This code was written by Angelos D. Keromytis in Athens, Greece, in
++ * February 2000. Network Security Technologies Inc. (NSTI) kindly
++ * supported the development of this code.
++ *
++ * Copyright (c) 2000, 2001 Angelos D. Keromytis
++ *
++ * Permission to use, copy, and modify this software with or without fee
++ * is hereby granted, provided that this entire notice is included in
++ * all source code copies of any software which is or includes a copy or
++ * modification of this software.
++ *
++ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
++ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
++ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
++ * PURPOSE.
++ *
++__FBSDID("$FreeBSD: src/sys/opencrypto/crypto.c,v 1.16 2005/01/07 02:29:16 imp Exp $");
++ */
++
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/spinlock.h>
++#include <linux/version.h>
++#include <cryptodev.h>
++
++/*
++ * keep track of whether or not we have been initialised, a big
++ * issue if we are linked into the kernel and a driver gets started before
++ * us
++ */
++static int crypto_initted = 0;
++
++/*
++ * Crypto drivers register themselves by allocating a slot in the
++ * crypto_drivers table with crypto_get_driverid() and then registering
++ * each algorithm they support with crypto_register() and crypto_kregister().
++ */
++
++/*
++ * lock on driver table
++ * we track its state as spin_is_locked does not do anything on non-SMP boxes
++ */
++static spinlock_t crypto_drivers_lock;
++static int crypto_drivers_locked; /* for non-SMP boxes */
++
++#define CRYPTO_DRIVER_LOCK() \
++ ({ \
++ spin_lock_irqsave(&crypto_drivers_lock, d_flags); \
++ crypto_drivers_locked = 1; \
++ dprintk("%s,%d: DRIVER_LOCK()\n", __FILE__, __LINE__); \
++ })
++#define CRYPTO_DRIVER_UNLOCK() \
++ ({ \
++ dprintk("%s,%d: DRIVER_UNLOCK()\n", __FILE__, __LINE__); \
++ crypto_drivers_locked = 0; \
++ spin_unlock_irqrestore(&crypto_drivers_lock, d_flags); \
++ })
++#define CRYPTO_DRIVER_ASSERT() \
++ ({ \
++ if (!crypto_drivers_locked) { \
++ dprintk("%s,%d: DRIVER_ASSERT!\n", __FILE__, __LINE__); \
++ } \
++ })
++
++/*
++ * Crypto device/driver capabilities structure.
++ *
++ * Synchronization:
++ * (d) - protected by CRYPTO_DRIVER_LOCK()
++ * (q) - protected by CRYPTO_Q_LOCK()
++ * Not tagged fields are read-only.
++ */
++struct cryptocap {
++ device_t cc_dev; /* (d) device/driver */
++ u_int32_t cc_sessions; /* (d) # of sessions */
++ u_int32_t cc_koperations; /* (d) # os asym operations */
++ /*
++ * Largest possible operator length (in bits) for each type of
++ * encryption algorithm. XXX not used
++ */
++ u_int16_t cc_max_op_len[CRYPTO_ALGORITHM_MAX + 1];
++ u_int8_t cc_alg[CRYPTO_ALGORITHM_MAX + 1];
++ u_int8_t cc_kalg[CRK_ALGORITHM_MAX + 1];
++
++ int cc_flags; /* (d) flags */
++#define CRYPTOCAP_F_CLEANUP 0x80000000 /* needs resource cleanup */
++ int cc_qblocked; /* (q) symmetric q blocked */
++ int cc_kqblocked; /* (q) asymmetric q blocked */
++};
++static struct cryptocap *crypto_drivers = NULL;
++static int crypto_drivers_num = 0;
++
++/*
++ * There are two queues for crypto requests; one for symmetric (e.g.
++ * cipher) operations and one for asymmetric (e.g. MOD)operations.
++ * A single mutex is used to lock access to both queues. We could
++ * have one per-queue but having one simplifies handling of block/unblock
++ * operations.
++ */
++static int crp_sleep = 0;
++static LIST_HEAD(crp_q); /* request queues */
++static LIST_HEAD(crp_kq);
++
++static spinlock_t crypto_q_lock;
++
++int crypto_all_qblocked = 0; /* protect with Q_LOCK */
++module_param(crypto_all_qblocked, int, 0444);
++MODULE_PARM_DESC(crypto_all_qblocked, "Are all crypto queues blocked");
++
++int crypto_all_kqblocked = 0; /* protect with Q_LOCK */
++module_param(crypto_all_kqblocked, int, 0444);
++MODULE_PARM_DESC(crypto_all_kqblocked, "Are all asym crypto queues blocked");
++
++#define CRYPTO_Q_LOCK() \
++ ({ \
++ spin_lock_irqsave(&crypto_q_lock, q_flags); \
++ dprintk("%s,%d: Q_LOCK()\n", __FILE__, __LINE__); \
++ })
++#define CRYPTO_Q_UNLOCK() \
++ ({ \
++ dprintk("%s,%d: Q_UNLOCK()\n", __FILE__, __LINE__); \
++ spin_unlock_irqrestore(&crypto_q_lock, q_flags); \
++ })
++
++/*
++ * There are two queues for processing completed crypto requests; one
++ * for the symmetric and one for the asymmetric ops. We only need one
++ * but have two to avoid type futzing (cryptop vs. cryptkop). A single
++ * mutex is used to lock access to both queues. Note that this lock
++ * must be separate from the lock on request queues to insure driver
++ * callbacks don't generate lock order reversals.
++ */
++static LIST_HEAD(crp_ret_q); /* callback queues */
++static LIST_HEAD(crp_ret_kq);
++
++static spinlock_t crypto_ret_q_lock;
++#define CRYPTO_RETQ_LOCK() \
++ ({ \
++ spin_lock_irqsave(&crypto_ret_q_lock, r_flags); \
++ dprintk("%s,%d: RETQ_LOCK\n", __FILE__, __LINE__); \
++ })
++#define CRYPTO_RETQ_UNLOCK() \
++ ({ \
++ dprintk("%s,%d: RETQ_UNLOCK\n", __FILE__, __LINE__); \
++ spin_unlock_irqrestore(&crypto_ret_q_lock, r_flags); \
++ })
++#define CRYPTO_RETQ_EMPTY() (list_empty(&crp_ret_q) && list_empty(&crp_ret_kq))
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
++static kmem_cache_t *cryptop_zone;
++static kmem_cache_t *cryptodesc_zone;
++#else
++static struct kmem_cache *cryptop_zone;
++static struct kmem_cache *cryptodesc_zone;
++#endif
++
++#define debug crypto_debug
++int crypto_debug = 0;
++module_param(crypto_debug, int, 0644);
++MODULE_PARM_DESC(crypto_debug, "Enable debug");
++EXPORT_SYMBOL(crypto_debug);
++
++/*
++ * Maximum number of outstanding crypto requests before we start
++ * failing requests. We need this to prevent DOS when too many
++ * requests are arriving for us to keep up. Otherwise we will
++ * run the system out of memory. Since crypto is slow, we are
++ * usually the bottleneck that needs to say, enough is enough.
++ *
++ * We cannot print errors when this condition occurs, we are already too
++ * slow, printing anything will just kill us
++ */
++
++static int crypto_q_cnt = 0;
++module_param(crypto_q_cnt, int, 0444);
++MODULE_PARM_DESC(crypto_q_cnt,
++ "Current number of outstanding crypto requests");
++
++static int crypto_q_max = 1000;
++module_param(crypto_q_max, int, 0644);
++MODULE_PARM_DESC(crypto_q_max,
++ "Maximum number of outstanding crypto requests");
++
++#define bootverbose crypto_verbose
++static int crypto_verbose = 0;
++module_param(crypto_verbose, int, 0644);
++MODULE_PARM_DESC(crypto_verbose,
++ "Enable verbose crypto startup");
++
++int crypto_usercrypto = 1; /* userland may do crypto reqs */
++module_param(crypto_usercrypto, int, 0644);
++MODULE_PARM_DESC(crypto_usercrypto,
++ "Enable/disable user-mode access to crypto support");
++
++int crypto_userasymcrypto = 1; /* userland may do asym crypto reqs */
++module_param(crypto_userasymcrypto, int, 0644);
++MODULE_PARM_DESC(crypto_userasymcrypto,
++ "Enable/disable user-mode access to asymmetric crypto support");
++
++int crypto_devallowsoft = 0; /* only use hardware crypto */
++module_param(crypto_devallowsoft, int, 0644);
++MODULE_PARM_DESC(crypto_devallowsoft,
++ "Enable/disable use of software crypto support");
++
++static pid_t cryptoproc = (pid_t) -1;
++static struct completion cryptoproc_exited;
++static DECLARE_WAIT_QUEUE_HEAD(cryptoproc_wait);
++static pid_t cryptoretproc = (pid_t) -1;
++static struct completion cryptoretproc_exited;
++static DECLARE_WAIT_QUEUE_HEAD(cryptoretproc_wait);
++
++static int crypto_proc(void *arg);
++static int crypto_ret_proc(void *arg);
++static int crypto_invoke(struct cryptocap *cap, struct cryptop *crp, int hint);
++static int crypto_kinvoke(struct cryptkop *krp, int flags);
++static void crypto_exit(void);
++static int crypto_init(void);
++
++static struct cryptostats cryptostats;
++
++static struct cryptocap *
++crypto_checkdriver(u_int32_t hid)
++{
++ if (crypto_drivers == NULL)
++ return NULL;
++ return (hid >= crypto_drivers_num ? NULL : &crypto_drivers[hid]);
++}
++
++/*
++ * Compare a driver's list of supported algorithms against another
++ * list; return non-zero if all algorithms are supported.
++ */
++static int
++driver_suitable(const struct cryptocap *cap, const struct cryptoini *cri)
++{
++ const struct cryptoini *cr;
++
++ /* See if all the algorithms are supported. */
++ for (cr = cri; cr; cr = cr->cri_next)
++ if (cap->cc_alg[cr->cri_alg] == 0)
++ return 0;
++ return 1;
++}
++
++/*
++ * Select a driver for a new session that supports the specified
++ * algorithms and, optionally, is constrained according to the flags.
++ * The algorithm we use here is pretty stupid; just use the
++ * first driver that supports all the algorithms we need. If there
++ * are multiple drivers we choose the driver with the fewest active
++ * sessions. We prefer hardware-backed drivers to software ones.
++ *
++ * XXX We need more smarts here (in real life too, but that's
++ * XXX another story altogether).
++ */
++static struct cryptocap *
++crypto_select_driver(const struct cryptoini *cri, int flags)
++{
++ struct cryptocap *cap, *best;
++ int match, hid;
++
++ CRYPTO_DRIVER_ASSERT();
++
++ /*
++ * Look first for hardware crypto devices if permitted.
++ */
++ if (flags & CRYPTOCAP_F_HARDWARE)
++ match = CRYPTOCAP_F_HARDWARE;
++ else
++ match = CRYPTOCAP_F_SOFTWARE;
++ best = NULL;
++again:
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ cap = &crypto_drivers[hid];
++ /*
++ * If it's not initialized, is in the process of
++ * going away, or is not appropriate (hardware
++ * or software based on match), then skip.
++ */
++ if (cap->cc_dev == NULL ||
++ (cap->cc_flags & CRYPTOCAP_F_CLEANUP) ||
++ (cap->cc_flags & match) == 0)
++ continue;
++
++ /* verify all the algorithms are supported. */
++ if (driver_suitable(cap, cri)) {
++ if (best == NULL ||
++ cap->cc_sessions < best->cc_sessions)
++ best = cap;
++ }
++ }
++ if (best != NULL)
++ return best;
++ if (match == CRYPTOCAP_F_HARDWARE && (flags & CRYPTOCAP_F_SOFTWARE)) {
++ /* sort of an Algol 68-style for loop */
++ match = CRYPTOCAP_F_SOFTWARE;
++ goto again;
++ }
++ return best;
++}
++
++/*
++ * Create a new session. The crid argument specifies a crypto
++ * driver to use or constraints on a driver to select (hardware
++ * only, software only, either). Whatever driver is selected
++ * must be capable of the requested crypto algorithms.
++ */
++int
++crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int crid)
++{
++ struct cryptocap *cap;
++ u_int32_t hid, lid;
++ int err;
++ unsigned long d_flags;
++
++ CRYPTO_DRIVER_LOCK();
++ if ((crid & (CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE)) == 0) {
++ /*
++ * Use specified driver; verify it is capable.
++ */
++ cap = crypto_checkdriver(crid);
++ if (cap != NULL && !driver_suitable(cap, cri))
++ cap = NULL;
++ } else {
++ /*
++ * No requested driver; select based on crid flags.
++ */
++ cap = crypto_select_driver(cri, crid);
++ /*
++ * if NULL then can't do everything in one session.
++ * XXX Fix this. We need to inject a "virtual" session
++ * XXX layer right about here.
++ */
++ }
++ if (cap != NULL) {
++ /* Call the driver initialization routine. */
++ hid = cap - crypto_drivers;
++ lid = hid; /* Pass the driver ID. */
++ cap->cc_sessions++;
++ CRYPTO_DRIVER_UNLOCK();
++ err = CRYPTODEV_NEWSESSION(cap->cc_dev, &lid, cri);
++ CRYPTO_DRIVER_LOCK();
++ if (err == 0) {
++ (*sid) = (cap->cc_flags & 0xff000000)
++ | (hid & 0x00ffffff);
++ (*sid) <<= 32;
++ (*sid) |= (lid & 0xffffffff);
++ } else
++ cap->cc_sessions--;
++ } else
++ err = EINVAL;
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++static void
++crypto_remove(struct cryptocap *cap)
++{
++ CRYPTO_DRIVER_ASSERT();
++ if (cap->cc_sessions == 0 && cap->cc_koperations == 0)
++ bzero(cap, sizeof(*cap));
++}
++
++/*
++ * Delete an existing session (or a reserved session on an unregistered
++ * driver).
++ */
++int
++crypto_freesession(u_int64_t sid)
++{
++ struct cryptocap *cap;
++ u_int32_t hid;
++ int err = 0;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++
++ if (crypto_drivers == NULL) {
++ err = EINVAL;
++ goto done;
++ }
++
++ /* Determine two IDs. */
++ hid = CRYPTO_SESID2HID(sid);
++
++ if (hid >= crypto_drivers_num) {
++ dprintk("%s - INVALID DRIVER NUM %d\n", __FUNCTION__, hid);
++ err = ENOENT;
++ goto done;
++ }
++ cap = &crypto_drivers[hid];
++
++ if (cap->cc_dev) {
++ CRYPTO_DRIVER_UNLOCK();
++ /* Call the driver cleanup routine, if available, unlocked. */
++ err = CRYPTODEV_FREESESSION(cap->cc_dev, sid);
++ CRYPTO_DRIVER_LOCK();
++ }
++
++ if (cap->cc_sessions)
++ cap->cc_sessions--;
++
++ if (cap->cc_flags & CRYPTOCAP_F_CLEANUP)
++ crypto_remove(cap);
++
++done:
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++/*
++ * Return an unused driver id. Used by drivers prior to registering
++ * support for the algorithms they handle.
++ */
++int32_t
++crypto_get_driverid(device_t dev, int flags)
++{
++ struct cryptocap *newdrv;
++ int i;
++ unsigned long d_flags;
++
++ if ((flags & (CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE)) == 0) {
++ printf("%s: no flags specified when registering driver\n",
++ device_get_nameunit(dev));
++ return -1;
++ }
++
++ CRYPTO_DRIVER_LOCK();
++
++ for (i = 0; i < crypto_drivers_num; i++) {
++ if (crypto_drivers[i].cc_dev == NULL &&
++ (crypto_drivers[i].cc_flags & CRYPTOCAP_F_CLEANUP) == 0) {
++ break;
++ }
++ }
++
++ /* Out of entries, allocate some more. */
++ if (i == crypto_drivers_num) {
++ /* Be careful about wrap-around. */
++ if (2 * crypto_drivers_num <= crypto_drivers_num) {
++ CRYPTO_DRIVER_UNLOCK();
++ printk("crypto: driver count wraparound!\n");
++ return -1;
++ }
++
++ newdrv = kmalloc(2 * crypto_drivers_num * sizeof(struct cryptocap),
++ GFP_KERNEL);
++ if (newdrv == NULL) {
++ CRYPTO_DRIVER_UNLOCK();
++ printk("crypto: no space to expand driver table!\n");
++ return -1;
++ }
++
++ memcpy(newdrv, crypto_drivers,
++ crypto_drivers_num * sizeof(struct cryptocap));
++ memset(&newdrv[crypto_drivers_num], 0,
++ crypto_drivers_num * sizeof(struct cryptocap));
++
++ crypto_drivers_num *= 2;
++
++ kfree(crypto_drivers);
++ crypto_drivers = newdrv;
++ }
++
++ /* NB: state is zero'd on free */
++ crypto_drivers[i].cc_sessions = 1; /* Mark */
++ crypto_drivers[i].cc_dev = dev;
++ crypto_drivers[i].cc_flags = flags;
++ if (bootverbose)
++ printf("crypto: assign %s driver id %u, flags %u\n",
++ device_get_nameunit(dev), i, flags);
++
++ CRYPTO_DRIVER_UNLOCK();
++
++ return i;
++}
++
++/*
++ * Lookup a driver by name. We match against the full device
++ * name and unit, and against just the name. The latter gives
++ * us a simple widlcarding by device name. On success return the
++ * driver/hardware identifier; otherwise return -1.
++ */
++int
++crypto_find_driver(const char *match)
++{
++ int i, len = strlen(match);
++ unsigned long d_flags;
++
++ CRYPTO_DRIVER_LOCK();
++ for (i = 0; i < crypto_drivers_num; i++) {
++ device_t dev = crypto_drivers[i].cc_dev;
++ if (dev == NULL ||
++ (crypto_drivers[i].cc_flags & CRYPTOCAP_F_CLEANUP))
++ continue;
++ if (strncmp(match, device_get_nameunit(dev), len) == 0 ||
++ strncmp(match, device_get_name(dev), len) == 0)
++ break;
++ }
++ CRYPTO_DRIVER_UNLOCK();
++ return i < crypto_drivers_num ? i : -1;
++}
++
++/*
++ * Return the device_t for the specified driver or NULL
++ * if the driver identifier is invalid.
++ */
++device_t
++crypto_find_device_byhid(int hid)
++{
++ struct cryptocap *cap = crypto_checkdriver(hid);
++ return cap != NULL ? cap->cc_dev : NULL;
++}
++
++/*
++ * Return the device/driver capabilities.
++ */
++int
++crypto_getcaps(int hid)
++{
++ struct cryptocap *cap = crypto_checkdriver(hid);
++ return cap != NULL ? cap->cc_flags : 0;
++}
++
++/*
++ * Register support for a key-related algorithm. This routine
++ * is called once for each algorithm supported a driver.
++ */
++int
++crypto_kregister(u_int32_t driverid, int kalg, u_int32_t flags)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL &&
++ (CRK_ALGORITM_MIN <= kalg && kalg <= CRK_ALGORITHM_MAX)) {
++ /*
++ * XXX Do some performance testing to determine placing.
++ * XXX We probably need an auxiliary data structure that
++ * XXX describes relative performances.
++ */
++
++ cap->cc_kalg[kalg] = flags | CRYPTO_ALG_FLAG_SUPPORTED;
++ if (bootverbose)
++ printf("crypto: %s registers key alg %u flags %u\n"
++ , device_get_nameunit(cap->cc_dev)
++ , kalg
++ , flags
++ );
++ err = 0;
++ } else
++ err = EINVAL;
++
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++/*
++ * Register support for a non-key-related algorithm. This routine
++ * is called once for each such algorithm supported by a driver.
++ */
++int
++crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen,
++ u_int32_t flags)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long d_flags;
++
++ dprintk("%s(id=0x%x, alg=%d, maxoplen=%d, flags=0x%x)\n", __FUNCTION__,
++ driverid, alg, maxoplen, flags);
++
++ CRYPTO_DRIVER_LOCK();
++
++ cap = crypto_checkdriver(driverid);
++ /* NB: algorithms are in the range [1..max] */
++ if (cap != NULL &&
++ (CRYPTO_ALGORITHM_MIN <= alg && alg <= CRYPTO_ALGORITHM_MAX)) {
++ /*
++ * XXX Do some performance testing to determine placing.
++ * XXX We probably need an auxiliary data structure that
++ * XXX describes relative performances.
++ */
++
++ cap->cc_alg[alg] = flags | CRYPTO_ALG_FLAG_SUPPORTED;
++ cap->cc_max_op_len[alg] = maxoplen;
++ if (bootverbose)
++ printf("crypto: %s registers alg %u flags %u maxoplen %u\n"
++ , device_get_nameunit(cap->cc_dev)
++ , alg
++ , flags
++ , maxoplen
++ );
++ cap->cc_sessions = 0; /* Unmark */
++ err = 0;
++ } else
++ err = EINVAL;
++
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++static void
++driver_finis(struct cryptocap *cap)
++{
++ u_int32_t ses, kops;
++
++ CRYPTO_DRIVER_ASSERT();
++
++ ses = cap->cc_sessions;
++ kops = cap->cc_koperations;
++ bzero(cap, sizeof(*cap));
++ if (ses != 0 || kops != 0) {
++ /*
++ * If there are pending sessions,
++ * just mark as invalid.
++ */
++ cap->cc_flags |= CRYPTOCAP_F_CLEANUP;
++ cap->cc_sessions = ses;
++ cap->cc_koperations = kops;
++ }
++}
++
++/*
++ * Unregister a crypto driver. If there are pending sessions using it,
++ * leave enough information around so that subsequent calls using those
++ * sessions will correctly detect the driver has been unregistered and
++ * reroute requests.
++ */
++int
++crypto_unregister(u_int32_t driverid, int alg)
++{
++ struct cryptocap *cap;
++ int i, err;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL &&
++ (CRYPTO_ALGORITHM_MIN <= alg && alg <= CRYPTO_ALGORITHM_MAX) &&
++ cap->cc_alg[alg] != 0) {
++ cap->cc_alg[alg] = 0;
++ cap->cc_max_op_len[alg] = 0;
++
++ /* Was this the last algorithm ? */
++ for (i = 1; i <= CRYPTO_ALGORITHM_MAX; i++)
++ if (cap->cc_alg[i] != 0)
++ break;
++
++ if (i == CRYPTO_ALGORITHM_MAX + 1)
++ driver_finis(cap);
++ err = 0;
++ } else
++ err = EINVAL;
++ CRYPTO_DRIVER_UNLOCK();
++ return err;
++}
++
++/*
++ * Unregister all algorithms associated with a crypto driver.
++ * If there are pending sessions using it, leave enough information
++ * around so that subsequent calls using those sessions will
++ * correctly detect the driver has been unregistered and reroute
++ * requests.
++ */
++int
++crypto_unregister_all(u_int32_t driverid)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ CRYPTO_DRIVER_LOCK();
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL) {
++ driver_finis(cap);
++ err = 0;
++ } else
++ err = EINVAL;
++ CRYPTO_DRIVER_UNLOCK();
++
++ return err;
++}
++
++/*
++ * Clear blockage on a driver. The what parameter indicates whether
++ * the driver is now ready for cryptop's and/or cryptokop's.
++ */
++int
++crypto_unblock(u_int32_t driverid, int what)
++{
++ struct cryptocap *cap;
++ int err;
++ unsigned long q_flags;
++
++ CRYPTO_Q_LOCK();
++ cap = crypto_checkdriver(driverid);
++ if (cap != NULL) {
++ if (what & CRYPTO_SYMQ) {
++ cap->cc_qblocked = 0;
++ crypto_all_qblocked = 0;
++ }
++ if (what & CRYPTO_ASYMQ) {
++ cap->cc_kqblocked = 0;
++ crypto_all_kqblocked = 0;
++ }
++ if (crp_sleep)
++ wake_up_interruptible(&cryptoproc_wait);
++ err = 0;
++ } else
++ err = EINVAL;
++ CRYPTO_Q_UNLOCK(); //DAVIDM should this be a driver lock
++
++ return err;
++}
++
++/*
++ * Add a crypto request to a queue, to be processed by the kernel thread.
++ */
++int
++crypto_dispatch(struct cryptop *crp)
++{
++ struct cryptocap *cap;
++ int result = -1;
++ unsigned long q_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ cryptostats.cs_ops++;
++
++ CRYPTO_Q_LOCK();
++ if (crypto_q_cnt >= crypto_q_max) {
++ CRYPTO_Q_UNLOCK();
++ cryptostats.cs_drops++;
++ return ENOMEM;
++ }
++ crypto_q_cnt++;
++
++ /*
++ * Caller marked the request to be processed immediately; dispatch
++ * it directly to the driver unless the driver is currently blocked.
++ */
++ if ((crp->crp_flags & CRYPTO_F_BATCH) == 0) {
++ int hid = CRYPTO_SESID2HID(crp->crp_sid);
++ cap = crypto_checkdriver(hid);
++ /* Driver cannot disappear when there is an active session. */
++ KASSERT(cap != NULL, ("%s: Driver disappeared.", __func__));
++ if (!cap->cc_qblocked) {
++ crypto_all_qblocked = 0;
++ crypto_drivers[hid].cc_qblocked = 1;
++ CRYPTO_Q_UNLOCK();
++ result = crypto_invoke(cap, crp, 0);
++ CRYPTO_Q_LOCK();
++ if (result != ERESTART)
++ crypto_drivers[hid].cc_qblocked = 0;
++ }
++ }
++ if (result == ERESTART) {
++ /*
++ * The driver ran out of resources, mark the
++ * driver ``blocked'' for cryptop's and put
++ * the request back in the queue. It would
++ * best to put the request back where we got
++ * it but that's hard so for now we put it
++ * at the front. This should be ok; putting
++ * it at the end does not work.
++ */
++ list_add(&crp->crp_next, &crp_q);
++ cryptostats.cs_blocks++;
++ } else if (result == -1) {
++ TAILQ_INSERT_TAIL(&crp_q, crp, crp_next);
++ }
++ if (crp_sleep)
++ wake_up_interruptible(&cryptoproc_wait);
++ CRYPTO_Q_UNLOCK();
++ return 0;
++}
++
++/*
++ * Add an asymetric crypto request to a queue,
++ * to be processed by the kernel thread.
++ */
++int
++crypto_kdispatch(struct cryptkop *krp)
++{
++ int error;
++ unsigned long q_flags;
++
++ cryptostats.cs_kops++;
++
++ error = crypto_kinvoke(krp, krp->krp_crid);
++ if (error == ERESTART) {
++ CRYPTO_Q_LOCK();
++ TAILQ_INSERT_TAIL(&crp_kq, krp, krp_next);
++ if (crp_sleep)
++ wake_up_interruptible(&cryptoproc_wait);
++ CRYPTO_Q_UNLOCK();
++ error = 0;
++ }
++ return error;
++}
++
++/*
++ * Verify a driver is suitable for the specified operation.
++ */
++static __inline int
++kdriver_suitable(const struct cryptocap *cap, const struct cryptkop *krp)
++{
++ return (cap->cc_kalg[krp->krp_op] & CRYPTO_ALG_FLAG_SUPPORTED) != 0;
++}
++
++/*
++ * Select a driver for an asym operation. The driver must
++ * support the necessary algorithm. The caller can constrain
++ * which device is selected with the flags parameter. The
++ * algorithm we use here is pretty stupid; just use the first
++ * driver that supports the algorithms we need. If there are
++ * multiple suitable drivers we choose the driver with the
++ * fewest active operations. We prefer hardware-backed
++ * drivers to software ones when either may be used.
++ */
++static struct cryptocap *
++crypto_select_kdriver(const struct cryptkop *krp, int flags)
++{
++ struct cryptocap *cap, *best, *blocked;
++ int match, hid;
++
++ CRYPTO_DRIVER_ASSERT();
++
++ /*
++ * Look first for hardware crypto devices if permitted.
++ */
++ if (flags & CRYPTOCAP_F_HARDWARE)
++ match = CRYPTOCAP_F_HARDWARE;
++ else
++ match = CRYPTOCAP_F_SOFTWARE;
++ best = NULL;
++ blocked = NULL;
++again:
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ cap = &crypto_drivers[hid];
++ /*
++ * If it's not initialized, is in the process of
++ * going away, or is not appropriate (hardware
++ * or software based on match), then skip.
++ */
++ if (cap->cc_dev == NULL ||
++ (cap->cc_flags & CRYPTOCAP_F_CLEANUP) ||
++ (cap->cc_flags & match) == 0)
++ continue;
++
++ /* verify all the algorithms are supported. */
++ if (kdriver_suitable(cap, krp)) {
++ if (best == NULL ||
++ cap->cc_koperations < best->cc_koperations)
++ best = cap;
++ }
++ }
++ if (best != NULL)
++ return best;
++ if (match == CRYPTOCAP_F_HARDWARE && (flags & CRYPTOCAP_F_SOFTWARE)) {
++ /* sort of an Algol 68-style for loop */
++ match = CRYPTOCAP_F_SOFTWARE;
++ goto again;
++ }
++ return best;
++}
++
++/*
++ * Dispatch an assymetric crypto request.
++ */
++static int
++crypto_kinvoke(struct cryptkop *krp, int crid)
++{
++ struct cryptocap *cap = NULL;
++ int error;
++ unsigned long d_flags;
++
++ KASSERT(krp != NULL, ("%s: krp == NULL", __func__));
++ KASSERT(krp->krp_callback != NULL,
++ ("%s: krp->crp_callback == NULL", __func__));
++
++ CRYPTO_DRIVER_LOCK();
++ if ((crid & (CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE)) == 0) {
++ cap = crypto_checkdriver(crid);
++ if (cap != NULL) {
++ /*
++ * Driver present, it must support the necessary
++ * algorithm and, if s/w drivers are excluded,
++ * it must be registered as hardware-backed.
++ */
++ if (!kdriver_suitable(cap, krp) ||
++ (!crypto_devallowsoft &&
++ (cap->cc_flags & CRYPTOCAP_F_HARDWARE) == 0))
++ cap = NULL;
++ }
++ } else {
++ /*
++ * No requested driver; select based on crid flags.
++ */
++ if (!crypto_devallowsoft) /* NB: disallow s/w drivers */
++ crid &= ~CRYPTOCAP_F_SOFTWARE;
++ cap = crypto_select_kdriver(krp, crid);
++ }
++ if (cap != NULL && !cap->cc_kqblocked) {
++ krp->krp_hid = cap - crypto_drivers;
++ cap->cc_koperations++;
++ CRYPTO_DRIVER_UNLOCK();
++ error = CRYPTODEV_KPROCESS(cap->cc_dev, krp, 0);
++ CRYPTO_DRIVER_LOCK();
++ if (error == ERESTART) {
++ cap->cc_koperations--;
++ CRYPTO_DRIVER_UNLOCK();
++ return (error);
++ }
++ /* return the actual device used */
++ krp->krp_crid = krp->krp_hid;
++ } else {
++ /*
++ * NB: cap is !NULL if device is blocked; in
++ * that case return ERESTART so the operation
++ * is resubmitted if possible.
++ */
++ error = (cap == NULL) ? ENODEV : ERESTART;
++ }
++ CRYPTO_DRIVER_UNLOCK();
++
++ if (error) {
++ krp->krp_status = error;
++ crypto_kdone(krp);
++ }
++ return 0;
++}
++
++
++/*
++ * Dispatch a crypto request to the appropriate crypto devices.
++ */
++static int
++crypto_invoke(struct cryptocap *cap, struct cryptop *crp, int hint)
++{
++ KASSERT(crp != NULL, ("%s: crp == NULL", __func__));
++ KASSERT(crp->crp_callback != NULL,
++ ("%s: crp->crp_callback == NULL", __func__));
++ KASSERT(crp->crp_desc != NULL, ("%s: crp->crp_desc == NULL", __func__));
++
++ dprintk("%s()\n", __FUNCTION__);
++
++#ifdef CRYPTO_TIMING
++ if (crypto_timing)
++ crypto_tstat(&cryptostats.cs_invoke, &crp->crp_tstamp);
++#endif
++ if (cap->cc_flags & CRYPTOCAP_F_CLEANUP) {
++ struct cryptodesc *crd;
++ u_int64_t nid;
++
++ /*
++ * Driver has unregistered; migrate the session and return
++ * an error to the caller so they'll resubmit the op.
++ *
++ * XXX: What if there are more already queued requests for this
++ * session?
++ */
++ crypto_freesession(crp->crp_sid);
++
++ for (crd = crp->crp_desc; crd->crd_next; crd = crd->crd_next)
++ crd->CRD_INI.cri_next = &(crd->crd_next->CRD_INI);
++
++ /* XXX propagate flags from initial session? */
++ if (crypto_newsession(&nid, &(crp->crp_desc->CRD_INI),
++ CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE) == 0)
++ crp->crp_sid = nid;
++
++ crp->crp_etype = EAGAIN;
++ crypto_done(crp);
++ return 0;
++ } else {
++ /*
++ * Invoke the driver to process the request.
++ */
++ return CRYPTODEV_PROCESS(cap->cc_dev, crp, hint);
++ }
++}
++
++/*
++ * Release a set of crypto descriptors.
++ */
++void
++crypto_freereq(struct cryptop *crp)
++{
++ struct cryptodesc *crd;
++
++ if (crp == NULL)
++ return;
++
++#ifdef DIAGNOSTIC
++ {
++ struct cryptop *crp2;
++ unsigned long q_flags;
++
++ CRYPTO_Q_LOCK();
++ TAILQ_FOREACH(crp2, &crp_q, crp_next) {
++ KASSERT(crp2 != crp,
++ ("Freeing cryptop from the crypto queue (%p).",
++ crp));
++ }
++ CRYPTO_Q_UNLOCK();
++ CRYPTO_RETQ_LOCK();
++ TAILQ_FOREACH(crp2, &crp_ret_q, crp_next) {
++ KASSERT(crp2 != crp,
++ ("Freeing cryptop from the return queue (%p).",
++ crp));
++ }
++ CRYPTO_RETQ_UNLOCK();
++ }
++#endif
++
++ while ((crd = crp->crp_desc) != NULL) {
++ crp->crp_desc = crd->crd_next;
++ kmem_cache_free(cryptodesc_zone, crd);
++ }
++ kmem_cache_free(cryptop_zone, crp);
++}
++
++/*
++ * Acquire a set of crypto descriptors.
++ */
++struct cryptop *
++crypto_getreq(int num)
++{
++ struct cryptodesc *crd;
++ struct cryptop *crp;
++
++ crp = kmem_cache_alloc(cryptop_zone, SLAB_ATOMIC);
++ if (crp != NULL) {
++ memset(crp, 0, sizeof(*crp));
++ INIT_LIST_HEAD(&crp->crp_next);
++ init_waitqueue_head(&crp->crp_waitq);
++ while (num--) {
++ crd = kmem_cache_alloc(cryptodesc_zone, SLAB_ATOMIC);
++ if (crd == NULL) {
++ crypto_freereq(crp);
++ return NULL;
++ }
++ memset(crd, 0, sizeof(*crd));
++ crd->crd_next = crp->crp_desc;
++ crp->crp_desc = crd;
++ }
++ }
++ return crp;
++}
++
++/*
++ * Invoke the callback on behalf of the driver.
++ */
++void
++crypto_done(struct cryptop *crp)
++{
++ unsigned long q_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if ((crp->crp_flags & CRYPTO_F_DONE) == 0) {
++ crp->crp_flags |= CRYPTO_F_DONE;
++ CRYPTO_Q_LOCK();
++ crypto_q_cnt--;
++ CRYPTO_Q_UNLOCK();
++ } else
++ printk("crypto: crypto_done op already done, flags 0x%x",
++ crp->crp_flags);
++ if (crp->crp_etype != 0)
++ cryptostats.cs_errs++;
++ /*
++ * CBIMM means unconditionally do the callback immediately;
++ * CBIFSYNC means do the callback immediately only if the
++ * operation was done synchronously. Both are used to avoid
++ * doing extraneous context switches; the latter is mostly
++ * used with the software crypto driver.
++ */
++ if ((crp->crp_flags & CRYPTO_F_CBIMM) ||
++ ((crp->crp_flags & CRYPTO_F_CBIFSYNC) &&
++ (CRYPTO_SESID2CAPS(crp->crp_sid) & CRYPTOCAP_F_SYNC))) {
++ /*
++ * Do the callback directly. This is ok when the
++ * callback routine does very little (e.g. the
++ * /dev/crypto callback method just does a wakeup).
++ */
++ crp->crp_callback(crp);
++ } else {
++ unsigned long r_flags;
++ /*
++ * Normal case; queue the callback for the thread.
++ */
++ CRYPTO_RETQ_LOCK();
++ if (CRYPTO_RETQ_EMPTY())
++ wake_up_interruptible(&cryptoretproc_wait);/* shared wait channel */
++ TAILQ_INSERT_TAIL(&crp_ret_q, crp, crp_next);
++ CRYPTO_RETQ_UNLOCK();
++ }
++}
++
++/*
++ * Invoke the callback on behalf of the driver.
++ */
++void
++crypto_kdone(struct cryptkop *krp)
++{
++ struct cryptocap *cap;
++ unsigned long d_flags;
++
++ if ((krp->krp_flags & CRYPTO_KF_DONE) != 0)
++ printk("crypto: crypto_kdone op already done, flags 0x%x",
++ krp->krp_flags);
++ krp->krp_flags |= CRYPTO_KF_DONE;
++ if (krp->krp_status != 0)
++ cryptostats.cs_kerrs++;
++
++ CRYPTO_DRIVER_LOCK();
++ /* XXX: What if driver is loaded in the meantime? */
++ if (krp->krp_hid < crypto_drivers_num) {
++ cap = &crypto_drivers[krp->krp_hid];
++ cap->cc_koperations--;
++ KASSERT(cap->cc_koperations >= 0, ("cc_koperations < 0"));
++ if (cap->cc_flags & CRYPTOCAP_F_CLEANUP)
++ crypto_remove(cap);
++ }
++ CRYPTO_DRIVER_UNLOCK();
++
++ /*
++ * CBIMM means unconditionally do the callback immediately;
++ * This is used to avoid doing extraneous context switches
++ */
++ if ((krp->krp_flags & CRYPTO_KF_CBIMM)) {
++ /*
++ * Do the callback directly. This is ok when the
++ * callback routine does very little (e.g. the
++ * /dev/crypto callback method just does a wakeup).
++ */
++ krp->krp_callback(krp);
++ } else {
++ unsigned long r_flags;
++ /*
++ * Normal case; queue the callback for the thread.
++ */
++ CRYPTO_RETQ_LOCK();
++ if (CRYPTO_RETQ_EMPTY())
++ wake_up_interruptible(&cryptoretproc_wait);/* shared wait channel */
++ TAILQ_INSERT_TAIL(&crp_ret_kq, krp, krp_next);
++ CRYPTO_RETQ_UNLOCK();
++ }
++}
++
++int
++crypto_getfeat(int *featp)
++{
++ int hid, kalg, feat = 0;
++ unsigned long d_flags;
++
++ CRYPTO_DRIVER_LOCK();
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ const struct cryptocap *cap = &crypto_drivers[hid];
++
++ if ((cap->cc_flags & CRYPTOCAP_F_SOFTWARE) &&
++ !crypto_devallowsoft) {
++ continue;
++ }
++ for (kalg = 0; kalg < CRK_ALGORITHM_MAX; kalg++)
++ if (cap->cc_kalg[kalg] & CRYPTO_ALG_FLAG_SUPPORTED)
++ feat |= 1 << kalg;
++ }
++ CRYPTO_DRIVER_UNLOCK();
++ *featp = feat;
++ return (0);
++}
++
++/*
++ * Crypto thread, dispatches crypto requests.
++ */
++static int
++crypto_proc(void *arg)
++{
++ struct cryptop *crp, *submit;
++ struct cryptkop *krp, *krpp;
++ struct cryptocap *cap;
++ u_int32_t hid;
++ int result, hint;
++ unsigned long q_flags;
++
++ ocf_daemonize("crypto");
++
++ CRYPTO_Q_LOCK();
++ for (;;) {
++ /*
++ * we need to make sure we don't get into a busy loop with nothing
++ * to do, the two crypto_all_*blocked vars help us find out when
++ * we are all full and can do nothing on any driver or Q. If so we
++ * wait for an unblock.
++ */
++ crypto_all_qblocked = !list_empty(&crp_q);
++
++ /*
++ * Find the first element in the queue that can be
++ * processed and look-ahead to see if multiple ops
++ * are ready for the same driver.
++ */
++ submit = NULL;
++ hint = 0;
++ list_for_each_entry(crp, &crp_q, crp_next) {
++ hid = CRYPTO_SESID2HID(crp->crp_sid);
++ cap = crypto_checkdriver(hid);
++ /*
++ * Driver cannot disappear when there is an active
++ * session.
++ */
++ KASSERT(cap != NULL, ("%s:%u Driver disappeared.",
++ __func__, __LINE__));
++ if (cap == NULL || cap->cc_dev == NULL) {
++ /* Op needs to be migrated, process it. */
++ if (submit == NULL)
++ submit = crp;
++ break;
++ }
++ if (!cap->cc_qblocked) {
++ if (submit != NULL) {
++ /*
++ * We stop on finding another op,
++ * regardless whether its for the same
++ * driver or not. We could keep
++ * searching the queue but it might be
++ * better to just use a per-driver
++ * queue instead.
++ */
++ if (CRYPTO_SESID2HID(submit->crp_sid) == hid)
++ hint = CRYPTO_HINT_MORE;
++ break;
++ } else {
++ submit = crp;
++ if ((submit->crp_flags & CRYPTO_F_BATCH) == 0)
++ break;
++ /* keep scanning for more are q'd */
++ }
++ }
++ }
++ if (submit != NULL) {
++ hid = CRYPTO_SESID2HID(submit->crp_sid);
++ crypto_all_qblocked = 0;
++ list_del(&submit->crp_next);
++ crypto_drivers[hid].cc_qblocked = 1;
++ cap = crypto_checkdriver(hid);
++ CRYPTO_Q_UNLOCK();
++ KASSERT(cap != NULL, ("%s:%u Driver disappeared.",
++ __func__, __LINE__));
++ result = crypto_invoke(cap, submit, hint);
++ CRYPTO_Q_LOCK();
++ if (result == ERESTART) {
++ /*
++ * The driver ran out of resources, mark the
++ * driver ``blocked'' for cryptop's and put
++ * the request back in the queue. It would
++ * best to put the request back where we got
++ * it but that's hard so for now we put it
++ * at the front. This should be ok; putting
++ * it at the end does not work.
++ */
++ /* XXX validate sid again? */
++ list_add(&submit->crp_next, &crp_q);
++ cryptostats.cs_blocks++;
++ } else
++ crypto_drivers[hid].cc_qblocked=0;
++ }
++
++ crypto_all_kqblocked = !list_empty(&crp_kq);
++
++ /* As above, but for key ops */
++ krp = NULL;
++ list_for_each_entry(krpp, &crp_kq, krp_next) {
++ cap = crypto_checkdriver(krpp->krp_hid);
++ if (cap == NULL || cap->cc_dev == NULL) {
++ /*
++ * Operation needs to be migrated, invalidate
++ * the assigned device so it will reselect a
++ * new one below. Propagate the original
++ * crid selection flags if supplied.
++ */
++ krp->krp_hid = krp->krp_crid &
++ (CRYPTOCAP_F_SOFTWARE|CRYPTOCAP_F_HARDWARE);
++ if (krp->krp_hid == 0)
++ krp->krp_hid =
++ CRYPTOCAP_F_SOFTWARE|CRYPTOCAP_F_HARDWARE;
++ break;
++ }
++ if (!cap->cc_kqblocked) {
++ krp = krpp;
++ break;
++ }
++ }
++ if (krp != NULL) {
++ crypto_all_kqblocked = 0;
++ list_del(&krp->krp_next);
++ crypto_drivers[krp->krp_hid].cc_kqblocked = 1;
++ CRYPTO_Q_UNLOCK();
++ result = crypto_kinvoke(krp, krp->krp_hid);
++ CRYPTO_Q_LOCK();
++ if (result == ERESTART) {
++ /*
++ * The driver ran out of resources, mark the
++ * driver ``blocked'' for cryptkop's and put
++ * the request back in the queue. It would
++ * best to put the request back where we got
++ * it but that's hard so for now we put it
++ * at the front. This should be ok; putting
++ * it at the end does not work.
++ */
++ /* XXX validate sid again? */
++ list_add(&krp->krp_next, &crp_kq);
++ cryptostats.cs_kblocks++;
++ } else
++ crypto_drivers[krp->krp_hid].cc_kqblocked = 0;
++ }
++
++ if (submit == NULL && krp == NULL) {
++ /*
++ * Nothing more to be processed. Sleep until we're
++ * woken because there are more ops to process.
++ * This happens either by submission or by a driver
++ * becoming unblocked and notifying us through
++ * crypto_unblock. Note that when we wakeup we
++ * start processing each queue again from the
++ * front. It's not clear that it's important to
++ * preserve this ordering since ops may finish
++ * out of order if dispatched to different devices
++ * and some become blocked while others do not.
++ */
++ dprintk("%s - sleeping (qe=%d qb=%d kqe=%d kqb=%d)\n",
++ __FUNCTION__,
++ list_empty(&crp_q), crypto_all_qblocked,
++ list_empty(&crp_kq), crypto_all_kqblocked);
++ CRYPTO_Q_UNLOCK();
++ crp_sleep = 1;
++ wait_event_interruptible(cryptoproc_wait,
++ !(list_empty(&crp_q) || crypto_all_qblocked) ||
++ !(list_empty(&crp_kq) || crypto_all_kqblocked) ||
++ cryptoproc == (pid_t) -1);
++ crp_sleep = 0;
++ if (signal_pending (current)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_lock_irq(&current->sigmask_lock);
++#endif
++ flush_signals(current);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_unlock_irq(&current->sigmask_lock);
++#endif
++ }
++ CRYPTO_Q_LOCK();
++ dprintk("%s - awake\n", __FUNCTION__);
++ if (cryptoproc == (pid_t) -1)
++ break;
++ cryptostats.cs_intrs++;
++ }
++ }
++ CRYPTO_Q_UNLOCK();
++ complete_and_exit(&cryptoproc_exited, 0);
++}
++
++/*
++ * Crypto returns thread, does callbacks for processed crypto requests.
++ * Callbacks are done here, rather than in the crypto drivers, because
++ * callbacks typically are expensive and would slow interrupt handling.
++ */
++static int
++crypto_ret_proc(void *arg)
++{
++ struct cryptop *crpt;
++ struct cryptkop *krpt;
++ unsigned long r_flags;
++
++ ocf_daemonize("crypto_ret");
++
++ CRYPTO_RETQ_LOCK();
++ for (;;) {
++ /* Harvest return q's for completed ops */
++ crpt = NULL;
++ if (!list_empty(&crp_ret_q))
++ crpt = list_entry(crp_ret_q.next, typeof(*crpt), crp_next);
++ if (crpt != NULL)
++ list_del(&crpt->crp_next);
++
++ krpt = NULL;
++ if (!list_empty(&crp_ret_kq))
++ krpt = list_entry(crp_ret_kq.next, typeof(*krpt), krp_next);
++ if (krpt != NULL)
++ list_del(&krpt->krp_next);
++
++ if (crpt != NULL || krpt != NULL) {
++ CRYPTO_RETQ_UNLOCK();
++ /*
++ * Run callbacks unlocked.
++ */
++ if (crpt != NULL)
++ crpt->crp_callback(crpt);
++ if (krpt != NULL)
++ krpt->krp_callback(krpt);
++ CRYPTO_RETQ_LOCK();
++ } else {
++ /*
++ * Nothing more to be processed. Sleep until we're
++ * woken because there are more returns to process.
++ */
++ dprintk("%s - sleeping\n", __FUNCTION__);
++ CRYPTO_RETQ_UNLOCK();
++ wait_event_interruptible(cryptoretproc_wait,
++ cryptoretproc == (pid_t) -1 ||
++ !list_empty(&crp_ret_q) ||
++ !list_empty(&crp_ret_kq));
++ if (signal_pending (current)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_lock_irq(&current->sigmask_lock);
++#endif
++ flush_signals(current);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_unlock_irq(&current->sigmask_lock);
++#endif
++ }
++ CRYPTO_RETQ_LOCK();
++ dprintk("%s - awake\n", __FUNCTION__);
++ if (cryptoretproc == (pid_t) -1) {
++ dprintk("%s - EXITING!\n", __FUNCTION__);
++ break;
++ }
++ cryptostats.cs_rets++;
++ }
++ }
++ CRYPTO_RETQ_UNLOCK();
++ complete_and_exit(&cryptoretproc_exited, 0);
++}
++
++
++#if 0 /* should put this into /proc or something */
++static void
++db_show_drivers(void)
++{
++ int hid;
++
++ db_printf("%12s %4s %4s %8s %2s %2s\n"
++ , "Device"
++ , "Ses"
++ , "Kops"
++ , "Flags"
++ , "QB"
++ , "KB"
++ );
++ for (hid = 0; hid < crypto_drivers_num; hid++) {
++ const struct cryptocap *cap = &crypto_drivers[hid];
++ if (cap->cc_dev == NULL)
++ continue;
++ db_printf("%-12s %4u %4u %08x %2u %2u\n"
++ , device_get_nameunit(cap->cc_dev)
++ , cap->cc_sessions
++ , cap->cc_koperations
++ , cap->cc_flags
++ , cap->cc_qblocked
++ , cap->cc_kqblocked
++ );
++ }
++}
++
++DB_SHOW_COMMAND(crypto, db_show_crypto)
++{
++ struct cryptop *crp;
++
++ db_show_drivers();
++ db_printf("\n");
++
++ db_printf("%4s %8s %4s %4s %4s %4s %8s %8s\n",
++ "HID", "Caps", "Ilen", "Olen", "Etype", "Flags",
++ "Desc", "Callback");
++ TAILQ_FOREACH(crp, &crp_q, crp_next) {
++ db_printf("%4u %08x %4u %4u %4u %04x %8p %8p\n"
++ , (int) CRYPTO_SESID2HID(crp->crp_sid)
++ , (int) CRYPTO_SESID2CAPS(crp->crp_sid)
++ , crp->crp_ilen, crp->crp_olen
++ , crp->crp_etype
++ , crp->crp_flags
++ , crp->crp_desc
++ , crp->crp_callback
++ );
++ }
++ if (!TAILQ_EMPTY(&crp_ret_q)) {
++ db_printf("\n%4s %4s %4s %8s\n",
++ "HID", "Etype", "Flags", "Callback");
++ TAILQ_FOREACH(crp, &crp_ret_q, crp_next) {
++ db_printf("%4u %4u %04x %8p\n"
++ , (int) CRYPTO_SESID2HID(crp->crp_sid)
++ , crp->crp_etype
++ , crp->crp_flags
++ , crp->crp_callback
++ );
++ }
++ }
++}
++
++DB_SHOW_COMMAND(kcrypto, db_show_kcrypto)
++{
++ struct cryptkop *krp;
++
++ db_show_drivers();
++ db_printf("\n");
++
++ db_printf("%4s %5s %4s %4s %8s %4s %8s\n",
++ "Op", "Status", "#IP", "#OP", "CRID", "HID", "Callback");
++ TAILQ_FOREACH(krp, &crp_kq, krp_next) {
++ db_printf("%4u %5u %4u %4u %08x %4u %8p\n"
++ , krp->krp_op
++ , krp->krp_status
++ , krp->krp_iparams, krp->krp_oparams
++ , krp->krp_crid, krp->krp_hid
++ , krp->krp_callback
++ );
++ }
++ if (!TAILQ_EMPTY(&crp_ret_q)) {
++ db_printf("%4s %5s %8s %4s %8s\n",
++ "Op", "Status", "CRID", "HID", "Callback");
++ TAILQ_FOREACH(krp, &crp_ret_kq, krp_next) {
++ db_printf("%4u %5u %08x %4u %8p\n"
++ , krp->krp_op
++ , krp->krp_status
++ , krp->krp_crid, krp->krp_hid
++ , krp->krp_callback
++ );
++ }
++ }
++}
++#endif
++
++
++static int
++crypto_init(void)
++{
++ int error;
++
++ dprintk("%s(0x%x)\n", __FUNCTION__, (int) crypto_init);
++
++ if (crypto_initted)
++ return 0;
++ crypto_initted = 1;
++
++ spin_lock_init(&crypto_drivers_lock);
++ spin_lock_init(&crypto_q_lock);
++ spin_lock_init(&crypto_ret_q_lock);
++
++ cryptop_zone = kmem_cache_create("cryptop", sizeof(struct cryptop),
++ 0, SLAB_HWCACHE_ALIGN, NULL
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
++ , NULL
++#endif
++ );
++
++ cryptodesc_zone = kmem_cache_create("cryptodesc", sizeof(struct cryptodesc),
++ 0, SLAB_HWCACHE_ALIGN, NULL
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
++ , NULL
++#endif
++ );
++
++ if (cryptodesc_zone == NULL || cryptop_zone == NULL) {
++ printk("crypto: crypto_init cannot setup crypto zones\n");
++ error = ENOMEM;
++ goto bad;
++ }
++
++ crypto_drivers_num = CRYPTO_DRIVERS_INITIAL;
++ crypto_drivers = kmalloc(crypto_drivers_num * sizeof(struct cryptocap),
++ GFP_KERNEL);
++ if (crypto_drivers == NULL) {
++ printk("crypto: crypto_init cannot setup crypto drivers\n");
++ error = ENOMEM;
++ goto bad;
++ }
++
++ memset(crypto_drivers, 0, crypto_drivers_num * sizeof(struct cryptocap));
++
++ init_completion(&cryptoproc_exited);
++ init_completion(&cryptoretproc_exited);
++
++ cryptoproc = 0; /* to avoid race condition where proc runs first */
++ cryptoproc = kernel_thread(crypto_proc, NULL, CLONE_FS|CLONE_FILES);
++ if (cryptoproc < 0) {
++ error = cryptoproc;
++ printk("crypto: crypto_init cannot start crypto thread; error %d",
++ error);
++ goto bad;
++ }
++
++ cryptoretproc = 0; /* to avoid race condition where proc runs first */
++ cryptoretproc = kernel_thread(crypto_ret_proc, NULL, CLONE_FS|CLONE_FILES);
++ if (cryptoretproc < 0) {
++ error = cryptoretproc;
++ printk("crypto: crypto_init cannot start cryptoret thread; error %d",
++ error);
++ goto bad;
++ }
++
++ return 0;
++bad:
++ crypto_exit();
++ return error;
++}
++
++
++static void
++crypto_exit(void)
++{
++ pid_t p;
++ unsigned long d_flags;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ /*
++ * Terminate any crypto threads.
++ */
++
++ CRYPTO_DRIVER_LOCK();
++ p = cryptoproc;
++ cryptoproc = (pid_t) -1;
++ kill_pid(p, SIGTERM, 1);
++ wake_up_interruptible(&cryptoproc_wait);
++ CRYPTO_DRIVER_UNLOCK();
++
++ wait_for_completion(&cryptoproc_exited);
++
++ CRYPTO_DRIVER_LOCK();
++ p = cryptoretproc;
++ cryptoretproc = (pid_t) -1;
++ kill_pid(p, SIGTERM, 1);
++ wake_up_interruptible(&cryptoretproc_wait);
++ CRYPTO_DRIVER_UNLOCK();
++
++ wait_for_completion(&cryptoretproc_exited);
++
++ /* XXX flush queues??? */
++
++ /*
++ * Reclaim dynamically allocated resources.
++ */
++ if (crypto_drivers != NULL)
++ kfree(crypto_drivers);
++
++ if (cryptodesc_zone != NULL)
++ kmem_cache_destroy(cryptodesc_zone);
++ if (cryptop_zone != NULL)
++ kmem_cache_destroy(cryptop_zone);
++}
++
++
++EXPORT_SYMBOL(crypto_newsession);
++EXPORT_SYMBOL(crypto_freesession);
++EXPORT_SYMBOL(crypto_get_driverid);
++EXPORT_SYMBOL(crypto_kregister);
++EXPORT_SYMBOL(crypto_register);
++EXPORT_SYMBOL(crypto_unregister);
++EXPORT_SYMBOL(crypto_unregister_all);
++EXPORT_SYMBOL(crypto_unblock);
++EXPORT_SYMBOL(crypto_dispatch);
++EXPORT_SYMBOL(crypto_kdispatch);
++EXPORT_SYMBOL(crypto_freereq);
++EXPORT_SYMBOL(crypto_getreq);
++EXPORT_SYMBOL(crypto_done);
++EXPORT_SYMBOL(crypto_kdone);
++EXPORT_SYMBOL(crypto_getfeat);
++EXPORT_SYMBOL(crypto_userasymcrypto);
++EXPORT_SYMBOL(crypto_getcaps);
++EXPORT_SYMBOL(crypto_find_driver);
++EXPORT_SYMBOL(crypto_find_device_byhid);
++
++module_init(crypto_init);
++module_exit(crypto_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("OCF (OpenBSD Cryptographic Framework)");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/cryptodev.c linux-2.6.29.1/crypto/ocf/cryptodev.c
+--- linux-2.6.29.1.orig/crypto/ocf/cryptodev.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/cryptodev.c 2009-04-20 20:01:21.412551214 +0200
+@@ -0,0 +1,1048 @@
++/* $OpenBSD: cryptodev.c,v 1.52 2002/06/19 07:22:46 deraadt Exp $ */
++
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2001 Theo de Raadt
++ * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++__FBSDID("$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.34 2007/05/09 19:37:02 gnn Exp $");
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/types.h>
++#include <linux/time.h>
++#include <linux/delay.h>
++#include <linux/list.h>
++#include <linux/init.h>
++#include <linux/sched.h>
++#include <linux/unistd.h>
++#include <linux/module.h>
++#include <linux/wait.h>
++#include <linux/slab.h>
++#include <linux/fs.h>
++#include <linux/dcache.h>
++#include <linux/file.h>
++#include <linux/mount.h>
++#include <linux/miscdevice.h>
++#include <linux/version.h>
++#include <asm/uaccess.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++extern asmlinkage long sys_dup(unsigned int fildes);
++
++#define debug cryptodev_debug
++int cryptodev_debug = 0;
++module_param(cryptodev_debug, int, 0644);
++MODULE_PARM_DESC(cryptodev_debug, "Enable cryptodev debug");
++
++struct csession_info {
++ u_int16_t blocksize;
++ u_int16_t minkey, maxkey;
++
++ u_int16_t keysize;
++ /* u_int16_t hashsize; */
++ u_int16_t authsize;
++ /* u_int16_t ctxsize; */
++};
++
++struct csession {
++ struct list_head list;
++ u_int64_t sid;
++ u_int32_t ses;
++
++ wait_queue_head_t waitq;
++
++ u_int32_t cipher;
++
++ u_int32_t mac;
++
++ caddr_t key;
++ int keylen;
++ u_char tmp_iv[EALG_MAX_BLOCK_LEN];
++
++ caddr_t mackey;
++ int mackeylen;
++
++ struct csession_info info;
++
++ struct iovec iovec;
++ struct uio uio;
++ int error;
++};
++
++struct fcrypt {
++ struct list_head csessions;
++ int sesn;
++};
++
++static struct csession *csefind(struct fcrypt *, u_int);
++static int csedelete(struct fcrypt *, struct csession *);
++static struct csession *cseadd(struct fcrypt *, struct csession *);
++static struct csession *csecreate(struct fcrypt *, u_int64_t,
++ struct cryptoini *crie, struct cryptoini *cria, struct csession_info *);
++static int csefree(struct csession *);
++
++static int cryptodev_op(struct csession *, struct crypt_op *);
++static int cryptodev_key(struct crypt_kop *);
++static int cryptodev_find(struct crypt_find_op *);
++
++static int cryptodev_cb(void *);
++static int cryptodev_open(struct inode *inode, struct file *filp);
++
++/*
++ * Check a crypto identifier to see if it requested
++ * a valid crid and it's capabilities match.
++ */
++static int
++checkcrid(int crid)
++{
++ int hid = crid & ~(CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE);
++ int typ = crid & (CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE);
++ int caps = 0;
++
++ /* if the user hasn't selected a driver, then just call newsession */
++ if (hid == 0 && typ != 0)
++ return 0;
++
++ caps = crypto_getcaps(hid);
++
++ /* didn't find anything with capabilities */
++ if (caps == 0) {
++ dprintk("%s: hid=%x typ=%x not matched\n", __FUNCTION__, hid, typ);
++ return EINVAL;
++ }
++
++ /* the user didn't specify SW or HW, so the driver is ok */
++ if (typ == 0)
++ return 0;
++
++ /* if the type specified didn't match */
++ if (typ != (caps & (CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE))) {
++ dprintk("%s: hid=%x typ=%x caps=%x not matched\n", __FUNCTION__,
++ hid, typ, caps);
++ return EINVAL;
++ }
++
++ return 0;
++}
++
++static int
++cryptodev_op(struct csession *cse, struct crypt_op *cop)
++{
++ struct cryptop *crp = NULL;
++ struct cryptodesc *crde = NULL, *crda = NULL;
++ int error = 0;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (cop->len > CRYPTO_MAX_DATA_LEN) {
++ dprintk("%s: %d > %d\n", __FUNCTION__, cop->len, CRYPTO_MAX_DATA_LEN);
++ return (E2BIG);
++ }
++
++ if (cse->info.blocksize && (cop->len % cse->info.blocksize) != 0) {
++ dprintk("%s: blocksize=%d len=%d\n", __FUNCTION__, cse->info.blocksize,
++ cop->len);
++ return (EINVAL);
++ }
++
++ cse->uio.uio_iov = &cse->iovec;
++ cse->uio.uio_iovcnt = 1;
++ cse->uio.uio_offset = 0;
++#if 0
++ cse->uio.uio_resid = cop->len;
++ cse->uio.uio_segflg = UIO_SYSSPACE;
++ cse->uio.uio_rw = UIO_WRITE;
++ cse->uio.uio_td = td;
++#endif
++ cse->uio.uio_iov[0].iov_len = cop->len;
++ if (cse->info.authsize)
++ cse->uio.uio_iov[0].iov_len += cse->info.authsize;
++ cse->uio.uio_iov[0].iov_base = kmalloc(cse->uio.uio_iov[0].iov_len,
++ GFP_KERNEL);
++
++ if (cse->uio.uio_iov[0].iov_base == NULL) {
++ dprintk("%s: iov_base kmalloc(%d) failed\n", __FUNCTION__,
++ cse->uio.uio_iov[0].iov_len);
++ return (ENOMEM);
++ }
++
++ crp = crypto_getreq((cse->info.blocksize != 0) + (cse->info.authsize != 0));
++ if (crp == NULL) {
++ dprintk("%s: ENOMEM\n", __FUNCTION__);
++ error = ENOMEM;
++ goto bail;
++ }
++
++ if (cse->info.authsize) {
++ crda = crp->crp_desc;
++ if (cse->info.blocksize)
++ crde = crda->crd_next;
++ } else {
++ if (cse->info.blocksize)
++ crde = crp->crp_desc;
++ else {
++ dprintk("%s: bad request\n", __FUNCTION__);
++ error = EINVAL;
++ goto bail;
++ }
++ }
++
++ if ((error = copy_from_user(cse->uio.uio_iov[0].iov_base, cop->src,
++ cop->len))) {
++ dprintk("%s: bad copy\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (crda) {
++ crda->crd_skip = 0;
++ crda->crd_len = cop->len;
++ crda->crd_inject = cop->len;
++
++ crda->crd_alg = cse->mac;
++ crda->crd_key = cse->mackey;
++ crda->crd_klen = cse->mackeylen * 8;
++ }
++
++ if (crde) {
++ if (cop->op == COP_ENCRYPT)
++ crde->crd_flags |= CRD_F_ENCRYPT;
++ else
++ crde->crd_flags &= ~CRD_F_ENCRYPT;
++ crde->crd_len = cop->len;
++ crde->crd_inject = 0;
++
++ crde->crd_alg = cse->cipher;
++ crde->crd_key = cse->key;
++ crde->crd_klen = cse->keylen * 8;
++ }
++
++ crp->crp_ilen = cse->uio.uio_iov[0].iov_len;
++ crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIMM
++ | (cop->flags & COP_F_BATCH);
++ crp->crp_buf = (caddr_t)&cse->uio;
++ crp->crp_callback = (int (*) (struct cryptop *)) cryptodev_cb;
++ crp->crp_sid = cse->sid;
++ crp->crp_opaque = (void *)cse;
++
++ if (cop->iv) {
++ if (crde == NULL) {
++ error = EINVAL;
++ dprintk("%s no crde\n", __FUNCTION__);
++ goto bail;
++ }
++ if (cse->cipher == CRYPTO_ARC4) { /* XXX use flag? */
++ error = EINVAL;
++ dprintk("%s arc4 with IV\n", __FUNCTION__);
++ goto bail;
++ }
++ if ((error = copy_from_user(cse->tmp_iv, cop->iv,
++ cse->info.blocksize))) {
++ dprintk("%s bad iv copy\n", __FUNCTION__);
++ goto bail;
++ }
++ memcpy(crde->crd_iv, cse->tmp_iv, cse->info.blocksize);
++ crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT;
++ crde->crd_skip = 0;
++ } else if (cse->cipher == CRYPTO_ARC4) { /* XXX use flag? */
++ crde->crd_skip = 0;
++ } else if (crde) {
++ crde->crd_flags |= CRD_F_IV_PRESENT;
++ crde->crd_skip = cse->info.blocksize;
++ crde->crd_len -= cse->info.blocksize;
++ }
++
++ if (cop->mac && crda == NULL) {
++ error = EINVAL;
++ dprintk("%s no crda\n", __FUNCTION__);
++ goto bail;
++ }
++
++ /*
++ * Let the dispatch run unlocked, then, interlock against the
++ * callback before checking if the operation completed and going
++ * to sleep. This insures drivers don't inherit our lock which
++ * results in a lock order reversal between crypto_dispatch forced
++ * entry and the crypto_done callback into us.
++ */
++ error = crypto_dispatch(crp);
++ if (error == 0) {
++ dprintk("%s about to WAIT\n", __FUNCTION__);
++ /*
++ * we really need to wait for driver to complete to maintain
++ * state, luckily interrupts will be remembered
++ */
++ do {
++ error = wait_event_interruptible(crp->crp_waitq,
++ ((crp->crp_flags & CRYPTO_F_DONE) != 0));
++ /*
++ * we can't break out of this loop or we will leave behind
++ * a huge mess, however, staying here means if your driver
++ * is broken user applications can hang and not be killed.
++ * The solution, fix your driver :-)
++ */
++ if (error) {
++ schedule();
++ error = 0;
++ }
++ } while ((crp->crp_flags & CRYPTO_F_DONE) == 0);
++ dprintk("%s finished WAITING error=%d\n", __FUNCTION__, error);
++ }
++
++ if (crp->crp_etype != 0) {
++ error = crp->crp_etype;
++ dprintk("%s error in crp processing\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (cse->error) {
++ error = cse->error;
++ dprintk("%s error in cse processing\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (cop->dst && (error = copy_to_user(cop->dst,
++ cse->uio.uio_iov[0].iov_base, cop->len))) {
++ dprintk("%s bad dst copy\n", __FUNCTION__);
++ goto bail;
++ }
++
++ if (cop->mac &&
++ (error=copy_to_user(cop->mac,
++ (caddr_t)cse->uio.uio_iov[0].iov_base + cop->len,
++ cse->info.authsize))) {
++ dprintk("%s bad mac copy\n", __FUNCTION__);
++ goto bail;
++ }
++
++bail:
++ if (crp)
++ crypto_freereq(crp);
++ if (cse->uio.uio_iov[0].iov_base)
++ kfree(cse->uio.uio_iov[0].iov_base);
++
++ return (error);
++}
++
++static int
++cryptodev_cb(void *op)
++{
++ struct cryptop *crp = (struct cryptop *) op;
++ struct csession *cse = (struct csession *)crp->crp_opaque;
++ int error;
++
++ dprintk("%s()\n", __FUNCTION__);
++ error = crp->crp_etype;
++ if (error == EAGAIN) {
++ crp->crp_flags &= ~CRYPTO_F_DONE;
++#ifdef NOTYET
++ /*
++ * DAVIDM I am fairly sure that we should turn this into a batch
++ * request to stop bad karma/lockup, revisit
++ */
++ crp->crp_flags |= CRYPTO_F_BATCH;
++#endif
++ return crypto_dispatch(crp);
++ }
++ if (error != 0 || (crp->crp_flags & CRYPTO_F_DONE)) {
++ cse->error = error;
++ wake_up_interruptible(&crp->crp_waitq);
++ }
++ return (0);
++}
++
++static int
++cryptodevkey_cb(void *op)
++{
++ struct cryptkop *krp = (struct cryptkop *) op;
++ dprintk("%s()\n", __FUNCTION__);
++ wake_up_interruptible(&krp->krp_waitq);
++ return (0);
++}
++
++static int
++cryptodev_key(struct crypt_kop *kop)
++{
++ struct cryptkop *krp = NULL;
++ int error = EINVAL;
++ int in, out, size, i;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (kop->crk_iparams + kop->crk_oparams > CRK_MAXPARAM) {
++ dprintk("%s params too big\n", __FUNCTION__);
++ return (EFBIG);
++ }
++
++ in = kop->crk_iparams;
++ out = kop->crk_oparams;
++ switch (kop->crk_op) {
++ case CRK_MOD_EXP:
++ if (in == 3 && out == 1)
++ break;
++ return (EINVAL);
++ case CRK_MOD_EXP_CRT:
++ if (in == 6 && out == 1)
++ break;
++ return (EINVAL);
++ case CRK_DSA_SIGN:
++ if (in == 5 && out == 2)
++ break;
++ return (EINVAL);
++ case CRK_DSA_VERIFY:
++ if (in == 7 && out == 0)
++ break;
++ return (EINVAL);
++ case CRK_DH_COMPUTE_KEY:
++ if (in == 3 && out == 1)
++ break;
++ return (EINVAL);
++ default:
++ return (EINVAL);
++ }
++
++ krp = (struct cryptkop *)kmalloc(sizeof *krp, GFP_KERNEL);
++ if (!krp)
++ return (ENOMEM);
++ bzero(krp, sizeof *krp);
++ krp->krp_op = kop->crk_op;
++ krp->krp_status = kop->crk_status;
++ krp->krp_iparams = kop->crk_iparams;
++ krp->krp_oparams = kop->crk_oparams;
++ krp->krp_crid = kop->crk_crid;
++ krp->krp_status = 0;
++ krp->krp_flags = CRYPTO_KF_CBIMM;
++ krp->krp_callback = (int (*) (struct cryptkop *)) cryptodevkey_cb;
++ init_waitqueue_head(&krp->krp_waitq);
++
++ for (i = 0; i < CRK_MAXPARAM; i++)
++ krp->krp_param[i].crp_nbits = kop->crk_param[i].crp_nbits;
++ for (i = 0; i < krp->krp_iparams + krp->krp_oparams; i++) {
++ size = (krp->krp_param[i].crp_nbits + 7) / 8;
++ if (size == 0)
++ continue;
++ krp->krp_param[i].crp_p = (caddr_t) kmalloc(size, GFP_KERNEL);
++ if (i >= krp->krp_iparams)
++ continue;
++ error = copy_from_user(krp->krp_param[i].crp_p,
++ kop->crk_param[i].crp_p, size);
++ if (error)
++ goto fail;
++ }
++
++ error = crypto_kdispatch(krp);
++ if (error)
++ goto fail;
++
++ do {
++ error = wait_event_interruptible(krp->krp_waitq,
++ ((krp->krp_flags & CRYPTO_KF_DONE) != 0));
++ /*
++ * we can't break out of this loop or we will leave behind
++ * a huge mess, however, staying here means if your driver
++ * is broken user applications can hang and not be killed.
++ * The solution, fix your driver :-)
++ */
++ if (error) {
++ schedule();
++ error = 0;
++ }
++ } while ((krp->krp_flags & CRYPTO_KF_DONE) == 0);
++
++ dprintk("%s finished WAITING error=%d\n", __FUNCTION__, error);
++
++ kop->crk_crid = krp->krp_crid; /* device that did the work */
++ if (krp->krp_status != 0) {
++ error = krp->krp_status;
++ goto fail;
++ }
++
++ for (i = krp->krp_iparams; i < krp->krp_iparams + krp->krp_oparams; i++) {
++ size = (krp->krp_param[i].crp_nbits + 7) / 8;
++ if (size == 0)
++ continue;
++ error = copy_to_user(kop->crk_param[i].crp_p, krp->krp_param[i].crp_p,
++ size);
++ if (error)
++ goto fail;
++ }
++
++fail:
++ if (krp) {
++ kop->crk_status = krp->krp_status;
++ for (i = 0; i < CRK_MAXPARAM; i++) {
++ if (krp->krp_param[i].crp_p)
++ kfree(krp->krp_param[i].crp_p);
++ }
++ kfree(krp);
++ }
++ return (error);
++}
++
++static int
++cryptodev_find(struct crypt_find_op *find)
++{
++ device_t dev;
++
++ if (find->crid != -1) {
++ dev = crypto_find_device_byhid(find->crid);
++ if (dev == NULL)
++ return (ENOENT);
++ strlcpy(find->name, device_get_nameunit(dev),
++ sizeof(find->name));
++ } else {
++ find->crid = crypto_find_driver(find->name);
++ if (find->crid == -1)
++ return (ENOENT);
++ }
++ return (0);
++}
++
++static struct csession *
++csefind(struct fcrypt *fcr, u_int ses)
++{
++ struct csession *cse;
++
++ dprintk("%s()\n", __FUNCTION__);
++ list_for_each_entry(cse, &fcr->csessions, list)
++ if (cse->ses == ses)
++ return (cse);
++ return (NULL);
++}
++
++static int
++csedelete(struct fcrypt *fcr, struct csession *cse_del)
++{
++ struct csession *cse;
++
++ dprintk("%s()\n", __FUNCTION__);
++ list_for_each_entry(cse, &fcr->csessions, list) {
++ if (cse == cse_del) {
++ list_del(&cse->list);
++ return (1);
++ }
++ }
++ return (0);
++}
++
++static struct csession *
++cseadd(struct fcrypt *fcr, struct csession *cse)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ list_add_tail(&cse->list, &fcr->csessions);
++ cse->ses = fcr->sesn++;
++ return (cse);
++}
++
++static struct csession *
++csecreate(struct fcrypt *fcr, u_int64_t sid, struct cryptoini *crie,
++ struct cryptoini *cria, struct csession_info *info)
++{
++ struct csession *cse;
++
++ dprintk("%s()\n", __FUNCTION__);
++ cse = (struct csession *) kmalloc(sizeof(struct csession), GFP_KERNEL);
++ if (cse == NULL)
++ return NULL;
++ memset(cse, 0, sizeof(struct csession));
++
++ INIT_LIST_HEAD(&cse->list);
++ init_waitqueue_head(&cse->waitq);
++
++ cse->key = crie->cri_key;
++ cse->keylen = crie->cri_klen/8;
++ cse->mackey = cria->cri_key;
++ cse->mackeylen = cria->cri_klen/8;
++ cse->sid = sid;
++ cse->cipher = crie->cri_alg;
++ cse->mac = cria->cri_alg;
++ cse->info = *info;
++ cseadd(fcr, cse);
++ return (cse);
++}
++
++static int
++csefree(struct csession *cse)
++{
++ int error;
++
++ dprintk("%s()\n", __FUNCTION__);
++ error = crypto_freesession(cse->sid);
++ if (cse->key)
++ kfree(cse->key);
++ if (cse->mackey)
++ kfree(cse->mackey);
++ kfree(cse);
++ return(error);
++}
++
++static int
++cryptodev_ioctl(
++ struct inode *inode,
++ struct file *filp,
++ unsigned int cmd,
++ unsigned long arg)
++{
++ struct cryptoini cria, crie;
++ struct fcrypt *fcr = filp->private_data;
++ struct csession *cse;
++ struct csession_info info;
++ struct session2_op sop;
++ struct crypt_op cop;
++ struct crypt_kop kop;
++ struct crypt_find_op fop;
++ u_int64_t sid;
++ u_int32_t ses;
++ int feat, fd, error = 0, crid;
++ mm_segment_t fs;
++
++ dprintk("%s(cmd=%x arg=%lx)\n", __FUNCTION__, cmd, arg);
++
++ switch (cmd) {
++
++ case CRIOGET: {
++ dprintk("%s(CRIOGET)\n", __FUNCTION__);
++ fs = get_fs();
++ set_fs(get_ds());
++ for (fd = 0; fd < files_fdtable(current->files)->max_fds; fd++)
++ if (files_fdtable(current->files)->fd[fd] == filp)
++ break;
++ fd = sys_dup(fd);
++ set_fs(fs);
++ put_user(fd, (int *) arg);
++ return IS_ERR_VALUE(fd) ? fd : 0;
++ }
++
++#define CIOCGSESSSTR (cmd == CIOCGSESSION ? "CIOCGSESSION" : "CIOCGSESSION2")
++ case CIOCGSESSION:
++ case CIOCGSESSION2:
++ dprintk("%s(%s)\n", __FUNCTION__, CIOCGSESSSTR);
++ memset(&crie, 0, sizeof(crie));
++ memset(&cria, 0, sizeof(cria));
++ memset(&info, 0, sizeof(info));
++ memset(&sop, 0, sizeof(sop));
++
++ if (copy_from_user(&sop, (void*)arg, (cmd == CIOCGSESSION) ?
++ sizeof(struct session_op) : sizeof(sop))) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ goto bail;
++ }
++
++ switch (sop.cipher) {
++ case 0:
++ dprintk("%s(%s) - no cipher\n", __FUNCTION__, CIOCGSESSSTR);
++ break;
++ case CRYPTO_NULL_CBC:
++ info.blocksize = NULL_BLOCK_LEN;
++ info.minkey = NULL_MIN_KEY_LEN;
++ info.maxkey = NULL_MAX_KEY_LEN;
++ break;
++ case CRYPTO_DES_CBC:
++ info.blocksize = DES_BLOCK_LEN;
++ info.minkey = DES_MIN_KEY_LEN;
++ info.maxkey = DES_MAX_KEY_LEN;
++ break;
++ case CRYPTO_3DES_CBC:
++ info.blocksize = DES3_BLOCK_LEN;
++ info.minkey = DES3_MIN_KEY_LEN;
++ info.maxkey = DES3_MAX_KEY_LEN;
++ break;
++ case CRYPTO_BLF_CBC:
++ info.blocksize = BLOWFISH_BLOCK_LEN;
++ info.minkey = BLOWFISH_MIN_KEY_LEN;
++ info.maxkey = BLOWFISH_MAX_KEY_LEN;
++ break;
++ case CRYPTO_CAST_CBC:
++ info.blocksize = CAST128_BLOCK_LEN;
++ info.minkey = CAST128_MIN_KEY_LEN;
++ info.maxkey = CAST128_MAX_KEY_LEN;
++ break;
++ case CRYPTO_SKIPJACK_CBC:
++ info.blocksize = SKIPJACK_BLOCK_LEN;
++ info.minkey = SKIPJACK_MIN_KEY_LEN;
++ info.maxkey = SKIPJACK_MAX_KEY_LEN;
++ break;
++ case CRYPTO_AES_CBC:
++ info.blocksize = AES_BLOCK_LEN;
++ info.minkey = AES_MIN_KEY_LEN;
++ info.maxkey = AES_MAX_KEY_LEN;
++ break;
++ case CRYPTO_ARC4:
++ info.blocksize = ARC4_BLOCK_LEN;
++ info.minkey = ARC4_MIN_KEY_LEN;
++ info.maxkey = ARC4_MAX_KEY_LEN;
++ break;
++ case CRYPTO_CAMELLIA_CBC:
++ info.blocksize = CAMELLIA_BLOCK_LEN;
++ info.minkey = CAMELLIA_MIN_KEY_LEN;
++ info.maxkey = CAMELLIA_MAX_KEY_LEN;
++ break;
++ default:
++ dprintk("%s(%s) - bad cipher\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EINVAL;
++ goto bail;
++ }
++
++ switch (sop.mac) {
++ case 0:
++ dprintk("%s(%s) - no mac\n", __FUNCTION__, CIOCGSESSSTR);
++ break;
++ case CRYPTO_NULL_HMAC:
++ info.authsize = NULL_HASH_LEN;
++ break;
++ case CRYPTO_MD5:
++ info.authsize = MD5_HASH_LEN;
++ break;
++ case CRYPTO_SHA1:
++ info.authsize = SHA1_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_256:
++ info.authsize = SHA2_256_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_384:
++ info.authsize = SHA2_384_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_512:
++ info.authsize = SHA2_512_HASH_LEN;
++ break;
++ case CRYPTO_RIPEMD160:
++ info.authsize = RIPEMD160_HASH_LEN;
++ break;
++ case CRYPTO_MD5_HMAC:
++ info.authsize = MD5_HASH_LEN;
++ break;
++ case CRYPTO_SHA1_HMAC:
++ info.authsize = SHA1_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_256_HMAC:
++ info.authsize = SHA2_256_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_384_HMAC:
++ info.authsize = SHA2_384_HASH_LEN;
++ break;
++ case CRYPTO_SHA2_512_HMAC:
++ info.authsize = SHA2_512_HASH_LEN;
++ break;
++ case CRYPTO_RIPEMD160_HMAC:
++ info.authsize = RIPEMD160_HASH_LEN;
++ break;
++ default:
++ dprintk("%s(%s) - bad mac\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EINVAL;
++ goto bail;
++ }
++
++ if (info.blocksize) {
++ crie.cri_alg = sop.cipher;
++ crie.cri_klen = sop.keylen * 8;
++ if ((info.maxkey && sop.keylen > info.maxkey) ||
++ sop.keylen < info.minkey) {
++ dprintk("%s(%s) - bad key\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EINVAL;
++ goto bail;
++ }
++
++ crie.cri_key = (u_int8_t *) kmalloc(crie.cri_klen/8+1, GFP_KERNEL);
++ if (copy_from_user(crie.cri_key, sop.key,
++ crie.cri_klen/8)) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ goto bail;
++ }
++ if (info.authsize)
++ crie.cri_next = &cria;
++ }
++
++ if (info.authsize) {
++ cria.cri_alg = sop.mac;
++ cria.cri_klen = sop.mackeylen * 8;
++ if ((info.maxkey && sop.mackeylen > info.maxkey) ||
++ sop.keylen < info.minkey) {
++ dprintk("%s(%s) - mackeylen %d\n", __FUNCTION__, CIOCGSESSSTR,
++ sop.mackeylen);
++ error = EINVAL;
++ goto bail;
++ }
++
++ if (cria.cri_klen) {
++ cria.cri_key = (u_int8_t *) kmalloc(cria.cri_klen/8,GFP_KERNEL);
++ if (copy_from_user(cria.cri_key, sop.mackey,
++ cria.cri_klen / 8)) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ goto bail;
++ }
++ }
++ }
++
++ /* NB: CIOGSESSION2 has the crid */
++ if (cmd == CIOCGSESSION2) {
++ crid = sop.crid;
++ error = checkcrid(crid);
++ if (error) {
++ dprintk("%s(%s) - checkcrid %x\n", __FUNCTION__,
++ CIOCGSESSSTR, error);
++ goto bail;
++ }
++ } else {
++ /* allow either HW or SW to be used */
++ crid = CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE;
++ }
++ error = crypto_newsession(&sid, (info.blocksize ? &crie : &cria), crid);
++ if (error) {
++ dprintk("%s(%s) - newsession %d\n",__FUNCTION__,CIOCGSESSSTR,error);
++ goto bail;
++ }
++
++ cse = csecreate(fcr, sid, &crie, &cria, &info);
++ if (cse == NULL) {
++ crypto_freesession(sid);
++ error = EINVAL;
++ dprintk("%s(%s) - csecreate failed\n", __FUNCTION__, CIOCGSESSSTR);
++ goto bail;
++ }
++ sop.ses = cse->ses;
++
++ if (cmd == CIOCGSESSION2) {
++ /* return hardware/driver id */
++ sop.crid = CRYPTO_SESID2HID(cse->sid);
++ }
++
++ if (copy_to_user((void*)arg, &sop, (cmd == CIOCGSESSION) ?
++ sizeof(struct session_op) : sizeof(sop))) {
++ dprintk("%s(%s) - bad copy\n", __FUNCTION__, CIOCGSESSSTR);
++ error = EFAULT;
++ }
++bail:
++ if (error) {
++ dprintk("%s(%s) - bail %d\n", __FUNCTION__, CIOCGSESSSTR, error);
++ if (crie.cri_key)
++ kfree(crie.cri_key);
++ if (cria.cri_key)
++ kfree(cria.cri_key);
++ }
++ break;
++ case CIOCFSESSION:
++ dprintk("%s(CIOCFSESSION)\n", __FUNCTION__);
++ get_user(ses, (uint32_t*)arg);
++ cse = csefind(fcr, ses);
++ if (cse == NULL) {
++ error = EINVAL;
++ dprintk("%s(CIOCFSESSION) - Fail %d\n", __FUNCTION__, error);
++ break;
++ }
++ csedelete(fcr, cse);
++ error = csefree(cse);
++ break;
++ case CIOCCRYPT:
++ dprintk("%s(CIOCCRYPT)\n", __FUNCTION__);
++ if(copy_from_user(&cop, (void*)arg, sizeof(cop))) {
++ dprintk("%s(CIOCCRYPT) - bad copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ cse = csefind(fcr, cop.ses);
++ if (cse == NULL) {
++ error = EINVAL;
++ dprintk("%s(CIOCCRYPT) - Fail %d\n", __FUNCTION__, error);
++ break;
++ }
++ error = cryptodev_op(cse, &cop);
++ if(copy_to_user((void*)arg, &cop, sizeof(cop))) {
++ dprintk("%s(CIOCCRYPT) - bad return copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ break;
++ case CIOCKEY:
++ case CIOCKEY2:
++ dprintk("%s(CIOCKEY)\n", __FUNCTION__);
++ if (!crypto_userasymcrypto)
++ return (EPERM); /* XXX compat? */
++ if(copy_from_user(&kop, (void*)arg, sizeof(kop))) {
++ dprintk("%s(CIOCKEY) - bad copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ if (cmd == CIOCKEY) {
++ /* NB: crypto core enforces s/w driver use */
++ kop.crk_crid =
++ CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE;
++ }
++ error = cryptodev_key(&kop);
++ if(copy_to_user((void*)arg, &kop, sizeof(kop))) {
++ dprintk("%s(CIOCGKEY) - bad return copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ break;
++ case CIOCASYMFEAT:
++ dprintk("%s(CIOCASYMFEAT)\n", __FUNCTION__);
++ if (!crypto_userasymcrypto) {
++ /*
++ * NB: if user asym crypto operations are
++ * not permitted return "no algorithms"
++ * so well-behaved applications will just
++ * fallback to doing them in software.
++ */
++ feat = 0;
++ } else
++ error = crypto_getfeat(&feat);
++ if (!error) {
++ error = copy_to_user((void*)arg, &feat, sizeof(feat));
++ }
++ break;
++ case CIOCFINDDEV:
++ if (copy_from_user(&fop, (void*)arg, sizeof(fop))) {
++ dprintk("%s(CIOCFINDDEV) - bad copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ error = cryptodev_find(&fop);
++ if (copy_to_user((void*)arg, &fop, sizeof(fop))) {
++ dprintk("%s(CIOCFINDDEV) - bad return copy\n", __FUNCTION__);
++ error = EFAULT;
++ goto bail;
++ }
++ break;
++ default:
++ dprintk("%s(unknown ioctl 0x%x)\n", __FUNCTION__, cmd);
++ error = EINVAL;
++ break;
++ }
++ return(-error);
++}
++
++#ifdef HAVE_UNLOCKED_IOCTL
++static long
++cryptodev_unlocked_ioctl(
++ struct file *filp,
++ unsigned int cmd,
++ unsigned long arg)
++{
++ return cryptodev_ioctl(NULL, filp, cmd, arg);
++}
++#endif
++
++static int
++cryptodev_open(struct inode *inode, struct file *filp)
++{
++ struct fcrypt *fcr;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (filp->private_data) {
++ printk("cryptodev: Private data already exists !\n");
++ return(0);
++ }
++
++ fcr = kmalloc(sizeof(*fcr), GFP_KERNEL);
++ if (!fcr) {
++ dprintk("%s() - malloc failed\n", __FUNCTION__);
++ return(-ENOMEM);
++ }
++ memset(fcr, 0, sizeof(*fcr));
++
++ INIT_LIST_HEAD(&fcr->csessions);
++ filp->private_data = fcr;
++ return(0);
++}
++
++static int
++cryptodev_release(struct inode *inode, struct file *filp)
++{
++ struct fcrypt *fcr = filp->private_data;
++ struct csession *cse, *tmp;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (!filp) {
++ printk("cryptodev: No private data on release\n");
++ return(0);
++ }
++
++ list_for_each_entry_safe(cse, tmp, &fcr->csessions, list) {
++ list_del(&cse->list);
++ (void)csefree(cse);
++ }
++ filp->private_data = NULL;
++ kfree(fcr);
++ return(0);
++}
++
++static struct file_operations cryptodev_fops = {
++ .owner = THIS_MODULE,
++ .open = cryptodev_open,
++ .release = cryptodev_release,
++ .ioctl = cryptodev_ioctl,
++#ifdef HAVE_UNLOCKED_IOCTL
++ .unlocked_ioctl = cryptodev_unlocked_ioctl,
++#endif
++};
++
++static struct miscdevice cryptodev = {
++ .minor = CRYPTODEV_MINOR,
++ .name = "crypto",
++ .fops = &cryptodev_fops,
++};
++
++static int __init
++cryptodev_init(void)
++{
++ int rc;
++
++ dprintk("%s(%p)\n", __FUNCTION__, cryptodev_init);
++ rc = misc_register(&cryptodev);
++ if (rc) {
++ printk(KERN_ERR "cryptodev: registration of /dev/crypto failed\n");
++ return(rc);
++ }
++
++ return(0);
++}
++
++static void __exit
++cryptodev_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ misc_deregister(&cryptodev);
++}
++
++module_init(cryptodev_init);
++module_exit(cryptodev_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("Cryptodev (user interface to OCF)");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/cryptodev.h linux-2.6.29.1/crypto/ocf/cryptodev.h
+--- linux-2.6.29.1.orig/crypto/ocf/cryptodev.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/cryptodev.h 2009-04-20 20:01:21.416551165 +0200
+@@ -0,0 +1,478 @@
++/* $FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.25 2007/05/09 19:37:02 gnn Exp $ */
++/* $OpenBSD: cryptodev.h,v 1.31 2002/06/11 11:14:29 beck Exp $ */
++
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
++ * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
++ *
++ * This code was written by Angelos D. Keromytis in Athens, Greece, in
++ * February 2000. Network Security Technologies Inc. (NSTI) kindly
++ * supported the development of this code.
++ *
++ * Copyright (c) 2000 Angelos D. Keromytis
++ *
++ * Permission to use, copy, and modify this software with or without fee
++ * is hereby granted, provided that this entire notice is included in
++ * all source code copies of any software which is or includes a copy or
++ * modification of this software.
++ *
++ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
++ * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
++ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
++ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
++ * PURPOSE.
++ *
++ * Copyright (c) 2001 Theo de Raadt
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ */
++
++#ifndef _CRYPTO_CRYPTO_H_
++#define _CRYPTO_CRYPTO_H_
++
++/* Some initial values */
++#define CRYPTO_DRIVERS_INITIAL 4
++#define CRYPTO_SW_SESSIONS 32
++
++/* Hash values */
++#define NULL_HASH_LEN 0
++#define MD5_HASH_LEN 16
++#define SHA1_HASH_LEN 20
++#define RIPEMD160_HASH_LEN 20
++#define SHA2_256_HASH_LEN 32
++#define SHA2_384_HASH_LEN 48
++#define SHA2_512_HASH_LEN 64
++#define MD5_KPDK_HASH_LEN 16
++#define SHA1_KPDK_HASH_LEN 20
++/* Maximum hash algorithm result length */
++#define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */
++
++/* HMAC values */
++#define NULL_HMAC_BLOCK_LEN 1
++#define MD5_HMAC_BLOCK_LEN 64
++#define SHA1_HMAC_BLOCK_LEN 64
++#define RIPEMD160_HMAC_BLOCK_LEN 64
++#define SHA2_256_HMAC_BLOCK_LEN 64
++#define SHA2_384_HMAC_BLOCK_LEN 128
++#define SHA2_512_HMAC_BLOCK_LEN 128
++/* Maximum HMAC block length */
++#define HMAC_MAX_BLOCK_LEN SHA2_512_HMAC_BLOCK_LEN /* Keep this updated */
++#define HMAC_IPAD_VAL 0x36
++#define HMAC_OPAD_VAL 0x5C
++
++/* Encryption algorithm block sizes */
++#define NULL_BLOCK_LEN 1
++#define DES_BLOCK_LEN 8
++#define DES3_BLOCK_LEN 8
++#define BLOWFISH_BLOCK_LEN 8
++#define SKIPJACK_BLOCK_LEN 8
++#define CAST128_BLOCK_LEN 8
++#define RIJNDAEL128_BLOCK_LEN 16
++#define AES_BLOCK_LEN RIJNDAEL128_BLOCK_LEN
++#define CAMELLIA_BLOCK_LEN 16
++#define ARC4_BLOCK_LEN 1
++#define EALG_MAX_BLOCK_LEN AES_BLOCK_LEN /* Keep this updated */
++
++/* Encryption algorithm min and max key sizes */
++#define NULL_MIN_KEY_LEN 0
++#define NULL_MAX_KEY_LEN 0
++#define DES_MIN_KEY_LEN 8
++#define DES_MAX_KEY_LEN 8
++#define DES3_MIN_KEY_LEN 24
++#define DES3_MAX_KEY_LEN 24
++#define BLOWFISH_MIN_KEY_LEN 4
++#define BLOWFISH_MAX_KEY_LEN 56
++#define SKIPJACK_MIN_KEY_LEN 10
++#define SKIPJACK_MAX_KEY_LEN 10
++#define CAST128_MIN_KEY_LEN 5
++#define CAST128_MAX_KEY_LEN 16
++#define RIJNDAEL128_MIN_KEY_LEN 16
++#define RIJNDAEL128_MAX_KEY_LEN 32
++#define AES_MIN_KEY_LEN RIJNDAEL128_MIN_KEY_LEN
++#define AES_MAX_KEY_LEN RIJNDAEL128_MAX_KEY_LEN
++#define CAMELLIA_MIN_KEY_LEN 16
++#define CAMELLIA_MAX_KEY_LEN 32
++#define ARC4_MIN_KEY_LEN 1
++#define ARC4_MAX_KEY_LEN 256
++
++/* Max size of data that can be processed */
++#define CRYPTO_MAX_DATA_LEN 64*1024 - 1
++
++#define CRYPTO_ALGORITHM_MIN 1
++#define CRYPTO_DES_CBC 1
++#define CRYPTO_3DES_CBC 2
++#define CRYPTO_BLF_CBC 3
++#define CRYPTO_CAST_CBC 4
++#define CRYPTO_SKIPJACK_CBC 5
++#define CRYPTO_MD5_HMAC 6
++#define CRYPTO_SHA1_HMAC 7
++#define CRYPTO_RIPEMD160_HMAC 8
++#define CRYPTO_MD5_KPDK 9
++#define CRYPTO_SHA1_KPDK 10
++#define CRYPTO_RIJNDAEL128_CBC 11 /* 128 bit blocksize */
++#define CRYPTO_AES_CBC 11 /* 128 bit blocksize -- the same as above */
++#define CRYPTO_ARC4 12
++#define CRYPTO_MD5 13
++#define CRYPTO_SHA1 14
++#define CRYPTO_NULL_HMAC 15
++#define CRYPTO_NULL_CBC 16
++#define CRYPTO_DEFLATE_COMP 17 /* Deflate compression algorithm */
++#define CRYPTO_SHA2_256_HMAC 18
++#define CRYPTO_SHA2_384_HMAC 19
++#define CRYPTO_SHA2_512_HMAC 20
++#define CRYPTO_CAMELLIA_CBC 21
++#define CRYPTO_SHA2_256 22
++#define CRYPTO_SHA2_384 23
++#define CRYPTO_SHA2_512 24
++#define CRYPTO_RIPEMD160 25
++#define CRYPTO_ALGORITHM_MAX 25 /* Keep updated - see below */
++
++/* Algorithm flags */
++#define CRYPTO_ALG_FLAG_SUPPORTED 0x01 /* Algorithm is supported */
++#define CRYPTO_ALG_FLAG_RNG_ENABLE 0x02 /* Has HW RNG for DH/DSA */
++#define CRYPTO_ALG_FLAG_DSA_SHA 0x04 /* Can do SHA on msg */
++
++/*
++ * Crypto driver/device flags. They can set in the crid
++ * parameter when creating a session or submitting a key
++ * op to affect the device/driver assigned. If neither
++ * of these are specified then the crid is assumed to hold
++ * the driver id of an existing (and suitable) device that
++ * must be used to satisfy the request.
++ */
++#define CRYPTO_FLAG_HARDWARE 0x01000000 /* hardware accelerated */
++#define CRYPTO_FLAG_SOFTWARE 0x02000000 /* software implementation */
++
++/* NB: deprecated */
++struct session_op {
++ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
++ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
++
++ u_int32_t keylen; /* cipher key */
++ caddr_t key;
++ int mackeylen; /* mac key */
++ caddr_t mackey;
++
++ u_int32_t ses; /* returns: session # */
++};
++
++struct session2_op {
++ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
++ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
++
++ u_int32_t keylen; /* cipher key */
++ caddr_t key;
++ int mackeylen; /* mac key */
++ caddr_t mackey;
++
++ u_int32_t ses; /* returns: session # */
++ int crid; /* driver id + flags (rw) */
++ int pad[4]; /* for future expansion */
++};
++
++struct crypt_op {
++ u_int32_t ses;
++ u_int16_t op; /* i.e. COP_ENCRYPT */
++#define COP_NONE 0
++#define COP_ENCRYPT 1
++#define COP_DECRYPT 2
++ u_int16_t flags;
++#define COP_F_BATCH 0x0008 /* Batch op if possible */
++ u_int len;
++ caddr_t src, dst; /* become iov[] inside kernel */
++ caddr_t mac; /* must be big enough for chosen MAC */
++ caddr_t iv;
++};
++
++/*
++ * Parameters for looking up a crypto driver/device by
++ * device name or by id. The latter are returned for
++ * created sessions (crid) and completed key operations.
++ */
++struct crypt_find_op {
++ int crid; /* driver id + flags */
++ char name[32]; /* device/driver name */
++};
++
++/* bignum parameter, in packed bytes, ... */
++struct crparam {
++ caddr_t crp_p;
++ u_int crp_nbits;
++};
++
++#define CRK_MAXPARAM 8
++
++struct crypt_kop {
++ u_int crk_op; /* ie. CRK_MOD_EXP or other */
++ u_int crk_status; /* return status */
++ u_short crk_iparams; /* # of input parameters */
++ u_short crk_oparams; /* # of output parameters */
++ u_int crk_crid; /* NB: only used by CIOCKEY2 (rw) */
++ struct crparam crk_param[CRK_MAXPARAM];
++};
++#define CRK_ALGORITM_MIN 0
++#define CRK_MOD_EXP 0
++#define CRK_MOD_EXP_CRT 1
++#define CRK_DSA_SIGN 2
++#define CRK_DSA_VERIFY 3
++#define CRK_DH_COMPUTE_KEY 4
++#define CRK_ALGORITHM_MAX 4 /* Keep updated - see below */
++
++#define CRF_MOD_EXP (1 << CRK_MOD_EXP)
++#define CRF_MOD_EXP_CRT (1 << CRK_MOD_EXP_CRT)
++#define CRF_DSA_SIGN (1 << CRK_DSA_SIGN)
++#define CRF_DSA_VERIFY (1 << CRK_DSA_VERIFY)
++#define CRF_DH_COMPUTE_KEY (1 << CRK_DH_COMPUTE_KEY)
++
++/*
++ * done against open of /dev/crypto, to get a cloned descriptor.
++ * Please use F_SETFD against the cloned descriptor.
++ */
++#define CRIOGET _IOWR('c', 100, u_int32_t)
++#define CRIOASYMFEAT CIOCASYMFEAT
++#define CRIOFINDDEV CIOCFINDDEV
++
++/* the following are done against the cloned descriptor */
++#define CIOCGSESSION _IOWR('c', 101, struct session_op)
++#define CIOCFSESSION _IOW('c', 102, u_int32_t)
++#define CIOCCRYPT _IOWR('c', 103, struct crypt_op)
++#define CIOCKEY _IOWR('c', 104, struct crypt_kop)
++#define CIOCASYMFEAT _IOR('c', 105, u_int32_t)
++#define CIOCGSESSION2 _IOWR('c', 106, struct session2_op)
++#define CIOCKEY2 _IOWR('c', 107, struct crypt_kop)
++#define CIOCFINDDEV _IOWR('c', 108, struct crypt_find_op)
++
++struct cryptotstat {
++ struct timespec acc; /* total accumulated time */
++ struct timespec min; /* min time */
++ struct timespec max; /* max time */
++ u_int32_t count; /* number of observations */
++};
++
++struct cryptostats {
++ u_int32_t cs_ops; /* symmetric crypto ops submitted */
++ u_int32_t cs_errs; /* symmetric crypto ops that failed */
++ u_int32_t cs_kops; /* asymetric/key ops submitted */
++ u_int32_t cs_kerrs; /* asymetric/key ops that failed */
++ u_int32_t cs_intrs; /* crypto swi thread activations */
++ u_int32_t cs_rets; /* crypto return thread activations */
++ u_int32_t cs_blocks; /* symmetric op driver block */
++ u_int32_t cs_kblocks; /* symmetric op driver block */
++ /*
++ * When CRYPTO_TIMING is defined at compile time and the
++ * sysctl debug.crypto is set to 1, the crypto system will
++ * accumulate statistics about how long it takes to process
++ * crypto requests at various points during processing.
++ */
++ struct cryptotstat cs_invoke; /* crypto_dipsatch -> crypto_invoke */
++ struct cryptotstat cs_done; /* crypto_invoke -> crypto_done */
++ struct cryptotstat cs_cb; /* crypto_done -> callback */
++ struct cryptotstat cs_finis; /* callback -> callback return */
++
++ u_int32_t cs_drops; /* crypto ops dropped due to congestion */
++};
++
++#ifdef __KERNEL__
++
++/* Standard initialization structure beginning */
++struct cryptoini {
++ int cri_alg; /* Algorithm to use */
++ int cri_klen; /* Key length, in bits */
++ int cri_mlen; /* Number of bytes we want from the
++ entire hash. 0 means all. */
++ caddr_t cri_key; /* key to use */
++ u_int8_t cri_iv[EALG_MAX_BLOCK_LEN]; /* IV to use */
++ struct cryptoini *cri_next;
++};
++
++/* Describe boundaries of a single crypto operation */
++struct cryptodesc {
++ int crd_skip; /* How many bytes to ignore from start */
++ int crd_len; /* How many bytes to process */
++ int crd_inject; /* Where to inject results, if applicable */
++ int crd_flags;
++
++#define CRD_F_ENCRYPT 0x01 /* Set when doing encryption */
++#define CRD_F_IV_PRESENT 0x02 /* When encrypting, IV is already in
++ place, so don't copy. */
++#define CRD_F_IV_EXPLICIT 0x04 /* IV explicitly provided */
++#define CRD_F_DSA_SHA_NEEDED 0x08 /* Compute SHA-1 of buffer for DSA */
++#define CRD_F_KEY_EXPLICIT 0x10 /* Key explicitly provided */
++#define CRD_F_COMP 0x0f /* Set when doing compression */
++
++ struct cryptoini CRD_INI; /* Initialization/context data */
++#define crd_iv CRD_INI.cri_iv
++#define crd_key CRD_INI.cri_key
++#define crd_alg CRD_INI.cri_alg
++#define crd_klen CRD_INI.cri_klen
++
++ struct cryptodesc *crd_next;
++};
++
++/* Structure describing complete operation */
++struct cryptop {
++ struct list_head crp_next;
++ wait_queue_head_t crp_waitq;
++
++ u_int64_t crp_sid; /* Session ID */
++ int crp_ilen; /* Input data total length */
++ int crp_olen; /* Result total length */
++
++ int crp_etype; /*
++ * Error type (zero means no error).
++ * All error codes except EAGAIN
++ * indicate possible data corruption (as in,
++ * the data have been touched). On all
++ * errors, the crp_sid may have changed
++ * (reset to a new one), so the caller
++ * should always check and use the new
++ * value on future requests.
++ */
++ int crp_flags;
++
++#define CRYPTO_F_SKBUF 0x0001 /* Input/output are skbuf chains */
++#define CRYPTO_F_IOV 0x0002 /* Input/output are uio */
++#define CRYPTO_F_REL 0x0004 /* Must return data in same place */
++#define CRYPTO_F_BATCH 0x0008 /* Batch op if possible */
++#define CRYPTO_F_CBIMM 0x0010 /* Do callback immediately */
++#define CRYPTO_F_DONE 0x0020 /* Operation completed */
++#define CRYPTO_F_CBIFSYNC 0x0040 /* Do CBIMM if op is synchronous */
++
++ caddr_t crp_buf; /* Data to be processed */
++ caddr_t crp_opaque; /* Opaque pointer, passed along */
++ struct cryptodesc *crp_desc; /* Linked list of processing descriptors */
++
++ int (*crp_callback)(struct cryptop *); /* Callback function */
++};
++
++#define CRYPTO_BUF_CONTIG 0x0
++#define CRYPTO_BUF_IOV 0x1
++#define CRYPTO_BUF_SKBUF 0x2
++
++#define CRYPTO_OP_DECRYPT 0x0
++#define CRYPTO_OP_ENCRYPT 0x1
++
++/*
++ * Hints passed to process methods.
++ */
++#define CRYPTO_HINT_MORE 0x1 /* more ops coming shortly */
++
++struct cryptkop {
++ struct list_head krp_next;
++ wait_queue_head_t krp_waitq;
++
++ int krp_flags;
++#define CRYPTO_KF_DONE 0x0001 /* Operation completed */
++#define CRYPTO_KF_CBIMM 0x0002 /* Do callback immediately */
++
++ u_int krp_op; /* ie. CRK_MOD_EXP or other */
++ u_int krp_status; /* return status */
++ u_short krp_iparams; /* # of input parameters */
++ u_short krp_oparams; /* # of output parameters */
++ u_int krp_crid; /* desired device, etc. */
++ u_int32_t krp_hid;
++ struct crparam krp_param[CRK_MAXPARAM]; /* kvm */
++ int (*krp_callback)(struct cryptkop *);
++};
++
++#include <ocf-compat.h>
++
++/*
++ * Session ids are 64 bits. The lower 32 bits contain a "local id" which
++ * is a driver-private session identifier. The upper 32 bits contain a
++ * "hardware id" used by the core crypto code to identify the driver and
++ * a copy of the driver's capabilities that can be used by client code to
++ * optimize operation.
++ */
++#define CRYPTO_SESID2HID(_sid) (((_sid) >> 32) & 0x00ffffff)
++#define CRYPTO_SESID2CAPS(_sid) (((_sid) >> 32) & 0xff000000)
++#define CRYPTO_SESID2LID(_sid) (((u_int32_t) (_sid)) & 0xffffffff)
++
++extern int crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard);
++extern int crypto_freesession(u_int64_t sid);
++#define CRYPTOCAP_F_HARDWARE CRYPTO_FLAG_HARDWARE
++#define CRYPTOCAP_F_SOFTWARE CRYPTO_FLAG_SOFTWARE
++#define CRYPTOCAP_F_SYNC 0x04000000 /* operates synchronously */
++extern int32_t crypto_get_driverid(device_t dev, int flags);
++extern int crypto_find_driver(const char *);
++extern device_t crypto_find_device_byhid(int hid);
++extern int crypto_getcaps(int hid);
++extern int crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen,
++ u_int32_t flags);
++extern int crypto_kregister(u_int32_t, int, u_int32_t);
++extern int crypto_unregister(u_int32_t driverid, int alg);
++extern int crypto_unregister_all(u_int32_t driverid);
++extern int crypto_dispatch(struct cryptop *crp);
++extern int crypto_kdispatch(struct cryptkop *);
++#define CRYPTO_SYMQ 0x1
++#define CRYPTO_ASYMQ 0x2
++extern int crypto_unblock(u_int32_t, int);
++extern void crypto_done(struct cryptop *crp);
++extern void crypto_kdone(struct cryptkop *);
++extern int crypto_getfeat(int *);
++
++extern void crypto_freereq(struct cryptop *crp);
++extern struct cryptop *crypto_getreq(int num);
++
++extern int crypto_usercrypto; /* userland may do crypto requests */
++extern int crypto_userasymcrypto; /* userland may do asym crypto reqs */
++extern int crypto_devallowsoft; /* only use hardware crypto */
++
++/*
++ * random number support, crypto_unregister_all will unregister
++ */
++extern int crypto_rregister(u_int32_t driverid,
++ int (*read_random)(void *arg, u_int32_t *buf, int len), void *arg);
++extern int crypto_runregister_all(u_int32_t driverid);
++
++/*
++ * Crypto-related utility routines used mainly by drivers.
++ *
++ * XXX these don't really belong here; but for now they're
++ * kept apart from the rest of the system.
++ */
++struct uio;
++extern void cuio_copydata(struct uio* uio, int off, int len, caddr_t cp);
++extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp);
++extern struct iovec *cuio_getptr(struct uio *uio, int loc, int *off);
++
++extern void crypto_copyback(int flags, caddr_t buf, int off, int size,
++ caddr_t in);
++extern void crypto_copydata(int flags, caddr_t buf, int off, int size,
++ caddr_t out);
++extern int crypto_apply(int flags, caddr_t buf, int off, int len,
++ int (*f)(void *, void *, u_int), void *arg);
++
++#endif /* __KERNEL__ */
++#endif /* _CRYPTO_CRYPTO_H_ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/cryptosoft.c linux-2.6.29.1/crypto/ocf/cryptosoft.c
+--- linux-2.6.29.1.orig/crypto/ocf/cryptosoft.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/cryptosoft.c 2009-04-20 20:01:21.428551297 +0200
+@@ -0,0 +1,898 @@
++/*
++ * An OCF module that uses the linux kernel cryptoapi, based on the
++ * original cryptosoft for BSD by Angelos D. Keromytis (angelos@cis.upenn.edu)
++ * but is mostly unrecognisable,
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2004-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ * ---------------------------------------------------------------------------
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/sched.h>
++#include <linux/wait.h>
++#include <linux/crypto.h>
++#include <linux/mm.h>
++#include <linux/skbuff.h>
++#include <linux/random.h>
++#include <linux/scatterlist.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++struct {
++ softc_device_decl sc_dev;
++} swcr_softc;
++
++#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
++
++/* Software session entry */
++
++#define SW_TYPE_CIPHER 0
++#define SW_TYPE_HMAC 1
++#define SW_TYPE_AUTH2 2
++#define SW_TYPE_HASH 3
++#define SW_TYPE_COMP 4
++#define SW_TYPE_BLKCIPHER 5
++
++struct swcr_data {
++ int sw_type;
++ int sw_alg;
++ struct crypto_tfm *sw_tfm;
++ union {
++ struct {
++ char *sw_key;
++ int sw_klen;
++ int sw_mlen;
++ } hmac;
++ void *sw_comp_buf;
++ } u;
++ struct swcr_data *sw_next;
++};
++
++#ifndef CRYPTO_TFM_MODE_CBC
++/*
++ * As of linux-2.6.21 this is no longer defined, and presumably no longer
++ * needed to be passed into the crypto core code.
++ */
++#define CRYPTO_TFM_MODE_CBC 0
++#define CRYPTO_TFM_MODE_ECB 0
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ /*
++ * Linux 2.6.19 introduced a new Crypto API, setup macro's to convert new
++ * API into old API.
++ */
++
++ /* Symmetric/Block Cipher */
++ struct blkcipher_desc
++ {
++ struct crypto_tfm *tfm;
++ void *info;
++ };
++ #define ecb(X) #X
++ #define cbc(X) #X
++ #define crypto_has_blkcipher(X, Y, Z) crypto_alg_available(X, 0)
++ #define crypto_blkcipher_cast(X) X
++ #define crypto_blkcipher_tfm(X) X
++ #define crypto_alloc_blkcipher(X, Y, Z) crypto_alloc_tfm(X, mode)
++ #define crypto_blkcipher_ivsize(X) crypto_tfm_alg_ivsize(X)
++ #define crypto_blkcipher_blocksize(X) crypto_tfm_alg_blocksize(X)
++ #define crypto_blkcipher_setkey(X, Y, Z) crypto_cipher_setkey(X, Y, Z)
++ #define crypto_blkcipher_encrypt_iv(W, X, Y, Z) \
++ crypto_cipher_encrypt_iv((W)->tfm, X, Y, Z, (u8 *)((W)->info))
++ #define crypto_blkcipher_decrypt_iv(W, X, Y, Z) \
++ crypto_cipher_decrypt_iv((W)->tfm, X, Y, Z, (u8 *)((W)->info))
++
++ /* Hash/HMAC/Digest */
++ struct hash_desc
++ {
++ struct crypto_tfm *tfm;
++ };
++ #define hmac(X) #X
++ #define crypto_has_hash(X, Y, Z) crypto_alg_available(X, 0)
++ #define crypto_hash_cast(X) X
++ #define crypto_hash_tfm(X) X
++ #define crypto_alloc_hash(X, Y, Z) crypto_alloc_tfm(X, mode)
++ #define crypto_hash_digestsize(X) crypto_tfm_alg_digestsize(X)
++ #define crypto_hash_digest(W, X, Y, Z) \
++ crypto_digest_digest((W)->tfm, X, sg_num, Z)
++
++ /* Asymmetric Cipher */
++ #define crypto_has_cipher(X, Y, Z) crypto_alg_available(X, 0)
++
++ /* Compression */
++ #define crypto_has_comp(X, Y, Z) crypto_alg_available(X, 0)
++ #define crypto_comp_tfm(X) X
++ #define crypto_comp_cast(X) X
++ #define crypto_alloc_comp(X, Y, Z) crypto_alloc_tfm(X, mode)
++#else
++ #define ecb(X) "ecb(" #X ")"
++ #define cbc(X) "cbc(" #X ")"
++ #define hmac(X) "hmac(" #X ")"
++#endif /* if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) */
++
++struct crypto_details
++{
++ char *alg_name;
++ int mode;
++ int sw_type;
++};
++
++/*
++ * This needs to be kept updated with CRYPTO_xxx list (cryptodev.h).
++ * If the Algorithm is not supported, then insert a {NULL, 0, 0} entry.
++ *
++ * IMPORTANT: The index to the array IS CRYPTO_xxx.
++ */
++static struct crypto_details crypto_details[CRYPTO_ALGORITHM_MAX + 1] = {
++ { NULL, 0, 0 },
++ /* CRYPTO_xxx index starts at 1 */
++ { cbc(des), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(des3_ede), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(blowfish), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(cast5), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { cbc(skipjack), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { hmac(md5), 0, SW_TYPE_HMAC },
++ { hmac(sha1), 0, SW_TYPE_HMAC },
++ { hmac(ripemd160), 0, SW_TYPE_HMAC },
++ { "md5-kpdk??", 0, SW_TYPE_HASH },
++ { "sha1-kpdk??", 0, SW_TYPE_HASH },
++ { cbc(aes), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { ecb(arc4), CRYPTO_TFM_MODE_ECB, SW_TYPE_BLKCIPHER },
++ { "md5", 0, SW_TYPE_HASH },
++ { "sha1", 0, SW_TYPE_HASH },
++ { hmac(digest_null), 0, SW_TYPE_HMAC },
++ { cbc(cipher_null), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { "deflate", 0, SW_TYPE_COMP },
++ { hmac(sha256), 0, SW_TYPE_HMAC },
++ { hmac(sha384), 0, SW_TYPE_HMAC },
++ { hmac(sha512), 0, SW_TYPE_HMAC },
++ { cbc(camellia), CRYPTO_TFM_MODE_CBC, SW_TYPE_BLKCIPHER },
++ { "sha256", 0, SW_TYPE_HASH },
++ { "sha384", 0, SW_TYPE_HASH },
++ { "sha512", 0, SW_TYPE_HASH },
++ { "ripemd160", 0, SW_TYPE_HASH },
++};
++
++int32_t swcr_id = -1;
++module_param(swcr_id, int, 0444);
++MODULE_PARM_DESC(swcr_id, "Read-Only OCF ID for cryptosoft driver");
++
++int swcr_fail_if_compression_grows = 1;
++module_param(swcr_fail_if_compression_grows, int, 0644);
++MODULE_PARM_DESC(swcr_fail_if_compression_grows,
++ "Treat compression that results in more data as a failure");
++
++static struct swcr_data **swcr_sessions = NULL;
++static u_int32_t swcr_sesnum = 0;
++
++static int swcr_process(device_t, struct cryptop *, int);
++static int swcr_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int swcr_freesession(device_t, u_int64_t);
++
++static device_method_t swcr_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, swcr_newsession),
++ DEVMETHOD(cryptodev_freesession,swcr_freesession),
++ DEVMETHOD(cryptodev_process, swcr_process),
++};
++
++#define debug swcr_debug
++int swcr_debug = 0;
++module_param(swcr_debug, int, 0644);
++MODULE_PARM_DESC(swcr_debug, "Enable debug");
++
++/*
++ * Generate a new software session.
++ */
++static int
++swcr_newsession(device_t dev, u_int32_t *sid, struct cryptoini *cri)
++{
++ struct swcr_data **swd;
++ u_int32_t i;
++ int error;
++ char *algo;
++ int mode, sw_type;
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid == NULL || cri == NULL) {
++ dprintk("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ if (swcr_sessions) {
++ for (i = 1; i < swcr_sesnum; i++)
++ if (swcr_sessions[i] == NULL)
++ break;
++ } else
++ i = 1; /* NB: to silence compiler warning */
++
++ if (swcr_sessions == NULL || i == swcr_sesnum) {
++ if (swcr_sessions == NULL) {
++ i = 1; /* We leave swcr_sessions[0] empty */
++ swcr_sesnum = CRYPTO_SW_SESSIONS;
++ } else
++ swcr_sesnum *= 2;
++
++ swd = kmalloc(swcr_sesnum * sizeof(struct swcr_data *), SLAB_ATOMIC);
++ if (swd == NULL) {
++ /* Reset session number */
++ if (swcr_sesnum == CRYPTO_SW_SESSIONS)
++ swcr_sesnum = 0;
++ else
++ swcr_sesnum /= 2;
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memset(swd, 0, swcr_sesnum * sizeof(struct swcr_data *));
++
++ /* Copy existing sessions */
++ if (swcr_sessions) {
++ memcpy(swd, swcr_sessions,
++ (swcr_sesnum / 2) * sizeof(struct swcr_data *));
++ kfree(swcr_sessions);
++ }
++
++ swcr_sessions = swd;
++ }
++
++ swd = &swcr_sessions[i];
++ *sid = i;
++
++ while (cri) {
++ *swd = (struct swcr_data *) kmalloc(sizeof(struct swcr_data),
++ SLAB_ATOMIC);
++ if (*swd == NULL) {
++ swcr_freesession(NULL, i);
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memset(*swd, 0, sizeof(struct swcr_data));
++
++ if (cri->cri_alg > CRYPTO_ALGORITHM_MAX) {
++ printk("cryptosoft: Unknown algorithm 0x%x\n", cri->cri_alg);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ algo = crypto_details[cri->cri_alg].alg_name;
++ if (!algo || !*algo) {
++ printk("cryptosoft: Unsupported algorithm 0x%x\n", cri->cri_alg);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ mode = crypto_details[cri->cri_alg].mode;
++ sw_type = crypto_details[cri->cri_alg].sw_type;
++
++ /* Algorithm specific configuration */
++ switch (cri->cri_alg) {
++ case CRYPTO_NULL_CBC:
++ cri->cri_klen = 0; /* make it work with crypto API */
++ break;
++ default:
++ break;
++ }
++
++ if (sw_type == SW_TYPE_BLKCIPHER) {
++ dprintk("%s crypto_alloc_blkcipher(%s, 0x%x)\n", __FUNCTION__,
++ algo, mode);
++
++ (*swd)->sw_tfm = crypto_blkcipher_tfm(
++ crypto_alloc_blkcipher(algo, 0,
++ CRYPTO_ALG_ASYNC));
++ if (!(*swd)->sw_tfm) {
++ dprintk("cryptosoft: crypto_alloc_blkcipher failed(%s,0x%x)\n",
++ algo,mode);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ if (debug) {
++ dprintk("%s key:cri->cri_klen=%d,(cri->cri_klen + 7)/8=%d",
++ __FUNCTION__,cri->cri_klen,(cri->cri_klen + 7)/8);
++ for (i = 0; i < (cri->cri_klen + 7) / 8; i++)
++ {
++ dprintk("%s0x%x", (i % 8) ? " " : "\n ",cri->cri_key[i]);
++ }
++ dprintk("\n");
++ }
++ error = crypto_blkcipher_setkey(
++ crypto_blkcipher_cast((*swd)->sw_tfm), cri->cri_key,
++ (cri->cri_klen + 7) / 8);
++ if (error) {
++ printk("cryptosoft: setkey failed %d (crt_flags=0x%x)\n", error,
++ (*swd)->sw_tfm->crt_flags);
++ swcr_freesession(NULL, i);
++ return error;
++ }
++ } else if (sw_type == SW_TYPE_HMAC || sw_type == SW_TYPE_HASH) {
++ dprintk("%s crypto_alloc_hash(%s, 0x%x)\n", __FUNCTION__,
++ algo, mode);
++
++ (*swd)->sw_tfm = crypto_hash_tfm(
++ crypto_alloc_hash(algo, 0, CRYPTO_ALG_ASYNC));
++
++ if (!(*swd)->sw_tfm) {
++ dprintk("cryptosoft: crypto_alloc_hash failed(%s,0x%x)\n",
++ algo, mode);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ (*swd)->u.hmac.sw_klen = (cri->cri_klen + 7) / 8;
++ (*swd)->u.hmac.sw_key = (char *)kmalloc((*swd)->u.hmac.sw_klen,
++ SLAB_ATOMIC);
++ if ((*swd)->u.hmac.sw_key == NULL) {
++ swcr_freesession(NULL, i);
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memcpy((*swd)->u.hmac.sw_key, cri->cri_key, (*swd)->u.hmac.sw_klen);
++ if (cri->cri_mlen) {
++ (*swd)->u.hmac.sw_mlen = cri->cri_mlen;
++ } else {
++ (*swd)->u.hmac.sw_mlen =
++ crypto_hash_digestsize(
++ crypto_hash_cast((*swd)->sw_tfm));
++ }
++ } else if (sw_type == SW_TYPE_COMP) {
++ (*swd)->sw_tfm = crypto_comp_tfm(
++ crypto_alloc_comp(algo, 0, CRYPTO_ALG_ASYNC));
++ if (!(*swd)->sw_tfm) {
++ dprintk("cryptosoft: crypto_alloc_comp failed(%s,0x%x)\n",
++ algo, mode);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++ (*swd)->u.sw_comp_buf = kmalloc(CRYPTO_MAX_DATA_LEN, SLAB_ATOMIC);
++ if ((*swd)->u.sw_comp_buf == NULL) {
++ swcr_freesession(NULL, i);
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ } else {
++ printk("cryptosoft: Unhandled sw_type %d\n", sw_type);
++ swcr_freesession(NULL, i);
++ return EINVAL;
++ }
++
++ (*swd)->sw_alg = cri->cri_alg;
++ (*swd)->sw_type = sw_type;
++
++ cri = cri->cri_next;
++ swd = &((*swd)->sw_next);
++ }
++ return 0;
++}
++
++/*
++ * Free a session.
++ */
++static int
++swcr_freesession(device_t dev, u_int64_t tid)
++{
++ struct swcr_data *swd;
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid > swcr_sesnum || swcr_sessions == NULL ||
++ swcr_sessions[sid] == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return(EINVAL);
++ }
++
++ /* Silently accept and return */
++ if (sid == 0)
++ return(0);
++
++ while ((swd = swcr_sessions[sid]) != NULL) {
++ swcr_sessions[sid] = swd->sw_next;
++ if (swd->sw_tfm)
++ crypto_free_tfm(swd->sw_tfm);
++ if (swd->sw_type == SW_TYPE_COMP) {
++ if (swd->u.sw_comp_buf)
++ kfree(swd->u.sw_comp_buf);
++ } else {
++ if (swd->u.hmac.sw_key)
++ kfree(swd->u.hmac.sw_key);
++ }
++ kfree(swd);
++ }
++ return 0;
++}
++
++/*
++ * Process a software request.
++ */
++static int
++swcr_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct cryptodesc *crd;
++ struct swcr_data *sw;
++ u_int32_t lid;
++#define SCATTERLIST_MAX 16
++ struct scatterlist sg[SCATTERLIST_MAX];
++ int sg_num, sg_len, skip;
++ struct sk_buff *skb = NULL;
++ struct uio *uiop = NULL;
++
++ dprintk("%s()\n", __FUNCTION__);
++ /* Sanity check */
++ if (crp == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ crp->crp_etype = 0;
++
++ if (crp->crp_desc == NULL || crp->crp_buf == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ lid = crp->crp_sid & 0xffffffff;
++ if (lid >= swcr_sesnum || lid == 0 || swcr_sessions == NULL ||
++ swcr_sessions[lid] == NULL) {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++ /*
++ * do some error checking outside of the loop for SKB and IOV processing
++ * this leaves us with valid skb or uiop pointers for later
++ */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ skb = (struct sk_buff *) crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags >= SCATTERLIST_MAX) {
++ printk("%s,%d: %d nr_frags > SCATTERLIST_MAX", __FILE__, __LINE__,
++ skb_shinfo(skb)->nr_frags);
++ goto done;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ uiop = (struct uio *) crp->crp_buf;
++ if (uiop->uio_iovcnt > SCATTERLIST_MAX) {
++ printk("%s,%d: %d uio_iovcnt > SCATTERLIST_MAX", __FILE__, __LINE__,
++ uiop->uio_iovcnt);
++ goto done;
++ }
++ }
++
++ /* Go through crypto descriptors, processing as we go */
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ /*
++ * Find the crypto context.
++ *
++ * XXX Note that the logic here prevents us from having
++ * XXX the same algorithm multiple times in a session
++ * XXX (or rather, we can but it won't give us the right
++ * XXX results). To do that, we'd need some way of differentiating
++ * XXX between the various instances of an algorithm (so we can
++ * XXX locate the correct crypto context).
++ */
++ for (sw = swcr_sessions[lid]; sw && sw->sw_alg != crd->crd_alg;
++ sw = sw->sw_next)
++ ;
++
++ /* No such context ? */
++ if (sw == NULL) {
++ crp->crp_etype = EINVAL;
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++ skip = crd->crd_skip;
++
++ /*
++ * setup the SG list skip from the start of the buffer
++ */
++ memset(sg, 0, sizeof(sg));
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ int i, len;
++
++ sg_num = 0;
++ sg_len = 0;
++
++ if (skip < skb_headlen(skb)) {
++ len = skb_headlen(skb) - skip;
++ if (len + sg_len > crd->crd_len)
++ len = crd->crd_len - sg_len;
++ sg_set_page(&sg[sg_num],
++ virt_to_page(skb->data + skip), len,
++ offset_in_page(skb->data + skip));
++ sg_len += len;
++ sg_num++;
++ skip = 0;
++ } else
++ skip -= skb_headlen(skb);
++
++ for (i = 0; sg_len < crd->crd_len &&
++ i < skb_shinfo(skb)->nr_frags &&
++ sg_num < SCATTERLIST_MAX; i++) {
++ if (skip < skb_shinfo(skb)->frags[i].size) {
++ len = skb_shinfo(skb)->frags[i].size - skip;
++ if (len + sg_len > crd->crd_len)
++ len = crd->crd_len - sg_len;
++ sg_set_page(&sg[sg_num],
++ skb_shinfo(skb)->frags[i].page,
++ len,
++ skb_shinfo(skb)->frags[i].page_offset + skip);
++ sg_len += len;
++ sg_num++;
++ skip = 0;
++ } else
++ skip -= skb_shinfo(skb)->frags[i].size;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ int len;
++
++ sg_len = 0;
++ for (sg_num = 0; sg_len <= crd->crd_len &&
++ sg_num < uiop->uio_iovcnt &&
++ sg_num < SCATTERLIST_MAX; sg_num++) {
++ if (skip <= uiop->uio_iov[sg_num].iov_len) {
++ len = uiop->uio_iov[sg_num].iov_len - skip;
++ if (len + sg_len > crd->crd_len)
++ len = crd->crd_len - sg_len;
++ sg_set_page(&sg[sg_num],
++ virt_to_page(uiop->uio_iov[sg_num].iov_base+skip),
++ len,
++ offset_in_page(uiop->uio_iov[sg_num].iov_base+skip));
++ sg_len += len;
++ skip = 0;
++ } else
++ skip -= uiop->uio_iov[sg_num].iov_len;
++ }
++ } else {
++ sg_len = (crp->crp_ilen - skip);
++ if (sg_len > crd->crd_len)
++ sg_len = crd->crd_len;
++ sg_set_page(&sg[0], virt_to_page(crp->crp_buf + skip),
++ sg_len, offset_in_page(crp->crp_buf + skip));
++ sg_num = 1;
++ }
++
++
++ switch (sw->sw_type) {
++ case SW_TYPE_BLKCIPHER: {
++ unsigned char iv[EALG_MAX_BLOCK_LEN];
++ unsigned char *ivp = iv;
++ int ivsize =
++ crypto_blkcipher_ivsize(crypto_blkcipher_cast(sw->sw_tfm));
++ struct blkcipher_desc desc;
++
++ if (sg_len < crypto_blkcipher_blocksize(
++ crypto_blkcipher_cast(sw->sw_tfm))) {
++ crp->crp_etype = EINVAL;
++ dprintk("%s,%d: EINVAL len %d < %d\n", __FILE__, __LINE__,
++ sg_len, crypto_blkcipher_blocksize(
++ crypto_blkcipher_cast(sw->sw_tfm)));
++ goto done;
++ }
++
++ if (ivsize > sizeof(iv)) {
++ crp->crp_etype = EINVAL;
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++ if (crd->crd_flags & CRD_F_KEY_EXPLICIT) {
++ int i, error;
++
++ if (debug) {
++ dprintk("%s key:", __FUNCTION__);
++ for (i = 0; i < (crd->crd_klen + 7) / 8; i++)
++ dprintk("%s0x%x", (i % 8) ? " " : "\n ",
++ crd->crd_key[i]);
++ dprintk("\n");
++ }
++ error = crypto_blkcipher_setkey(
++ crypto_blkcipher_cast(sw->sw_tfm), crd->crd_key,
++ (crd->crd_klen + 7) / 8);
++ if (error) {
++ dprintk("cryptosoft: setkey failed %d (crt_flags=0x%x)\n",
++ error, sw->sw_tfm->crt_flags);
++ crp->crp_etype = -error;
++ }
++ }
++
++ memset(&desc, 0, sizeof(desc));
++ desc.tfm = crypto_blkcipher_cast(sw->sw_tfm);
++
++ if (crd->crd_flags & CRD_F_ENCRYPT) { /* encrypt */
++
++ if (crd->crd_flags & CRD_F_IV_EXPLICIT) {
++ ivp = crd->crd_iv;
++ } else {
++ get_random_bytes(ivp, ivsize);
++ }
++ /*
++ * do we have to copy the IV back to the buffer ?
++ */
++ if ((crd->crd_flags & CRD_F_IV_PRESENT) == 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, ivsize, (caddr_t)ivp);
++ }
++ desc.info = ivp;
++ crypto_blkcipher_encrypt_iv(&desc, sg, sg, sg_len);
++
++ } else { /*decrypt */
++
++ if (crd->crd_flags & CRD_F_IV_EXPLICIT) {
++ ivp = crd->crd_iv;
++ } else {
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, ivsize, (caddr_t)ivp);
++ }
++ desc.info = ivp;
++ crypto_blkcipher_decrypt_iv(&desc, sg, sg, sg_len);
++ }
++ } break;
++ case SW_TYPE_HMAC:
++ case SW_TYPE_HASH:
++ {
++ char result[HASH_MAX_LEN];
++ struct hash_desc desc;
++
++ /* check we have room for the result */
++ if (crp->crp_ilen - crd->crd_inject < sw->u.hmac.sw_mlen) {
++ dprintk(
++ "cryptosoft: EINVAL crp_ilen=%d, len=%d, inject=%d digestsize=%d\n",
++ crp->crp_ilen, crd->crd_skip + sg_len, crd->crd_inject,
++ sw->u.hmac.sw_mlen);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ memset(&desc, 0, sizeof(desc));
++ desc.tfm = crypto_hash_cast(sw->sw_tfm);
++
++ memset(result, 0, sizeof(result));
++
++ if (sw->sw_type == SW_TYPE_HMAC) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
++ crypto_hmac(sw->sw_tfm, sw->u.hmac.sw_key, &sw->u.hmac.sw_klen,
++ sg, sg_num, result);
++#else
++ crypto_hash_setkey(desc.tfm, sw->u.hmac.sw_key,
++ sw->u.hmac.sw_klen);
++ crypto_hash_digest(&desc, sg, sg_len, result);
++#endif /* #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) */
++
++ } else { /* SW_TYPE_HASH */
++ crypto_hash_digest(&desc, sg, sg_len, result);
++ }
++
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, sw->u.hmac.sw_mlen, result);
++ }
++ break;
++
++ case SW_TYPE_COMP: {
++ void *ibuf = NULL;
++ void *obuf = sw->u.sw_comp_buf;
++ int ilen = sg_len, olen = CRYPTO_MAX_DATA_LEN;
++ int ret = 0;
++
++ /*
++ * we need to use an additional copy if there is more than one
++ * input chunk since the kernel comp routines do not handle
++ * SG yet. Otherwise we just use the input buffer as is.
++ * Rather than allocate another buffer we just split the tmp
++ * buffer we already have.
++ * Perhaps we should just use zlib directly ?
++ */
++ if (sg_num > 1) {
++ int blk;
++
++ ibuf = obuf;
++ for (blk = 0; blk < sg_num; blk++) {
++ memcpy(obuf, sg_virt(&sg[blk]),
++ sg[blk].length);
++ obuf += sg[blk].length;
++ }
++ olen -= sg_len;
++ } else
++ ibuf = sg_virt(&sg[0]);
++
++ if (crd->crd_flags & CRD_F_ENCRYPT) { /* compress */
++ ret = crypto_comp_compress(crypto_comp_cast(sw->sw_tfm),
++ ibuf, ilen, obuf, &olen);
++ if (!ret && olen > crd->crd_len) {
++ dprintk("cryptosoft: ERANGE compress %d into %d\n",
++ crd->crd_len, olen);
++ if (swcr_fail_if_compression_grows)
++ ret = ERANGE;
++ }
++ } else { /* decompress */
++ ret = crypto_comp_decompress(crypto_comp_cast(sw->sw_tfm),
++ ibuf, ilen, obuf, &olen);
++ if (!ret && (olen + crd->crd_inject) > crp->crp_olen) {
++ dprintk("cryptosoft: ETOOSMALL decompress %d into %d, "
++ "space for %d,at offset %d\n",
++ crd->crd_len, olen, crp->crp_olen, crd->crd_inject);
++ ret = ETOOSMALL;
++ }
++ }
++ if (ret)
++ dprintk("%s,%d: ret = %d\n", __FILE__, __LINE__, ret);
++
++ /*
++ * on success copy result back,
++ * linux crpyto API returns -errno, we need to fix that
++ */
++ crp->crp_etype = ret < 0 ? -ret : ret;
++ if (ret == 0) {
++ /* copy back the result and return it's size */
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, olen, obuf);
++ crp->crp_olen = olen;
++ }
++
++
++ } break;
++
++ default:
++ /* Unknown/unsupported algorithm */
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++ }
++
++done:
++ crypto_done(crp);
++ return 0;
++}
++
++static int
++cryptosoft_init(void)
++{
++ int i, sw_type, mode;
++ char *algo;
++
++ dprintk("%s(%p)\n", __FUNCTION__, cryptosoft_init);
++
++ softc_device_init(&swcr_softc, "cryptosoft", 0, swcr_methods);
++
++ swcr_id = crypto_get_driverid(softc_get_device(&swcr_softc),
++ CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC);
++ if (swcr_id < 0) {
++ printk("Software crypto device cannot initialize!");
++ return -ENODEV;
++ }
++
++#define REGISTER(alg) \
++ crypto_register(swcr_id, alg, 0,0);
++
++ for (i = CRYPTO_ALGORITHM_MIN; i <= CRYPTO_ALGORITHM_MAX; ++i)
++ {
++
++ algo = crypto_details[i].alg_name;
++ if (!algo || !*algo)
++ {
++ dprintk("%s:Algorithm %d not supported\n", __FUNCTION__, i);
++ continue;
++ }
++
++ mode = crypto_details[i].mode;
++ sw_type = crypto_details[i].sw_type;
++
++ switch (sw_type)
++ {
++ case SW_TYPE_CIPHER:
++ if (crypto_has_cipher(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:CIPHER algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_HMAC:
++ if (crypto_has_hash(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:HMAC algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_HASH:
++ if (crypto_has_hash(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:HASH algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_COMP:
++ if (crypto_has_comp(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:COMP algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ case SW_TYPE_BLKCIPHER:
++ if (crypto_has_blkcipher(algo, 0, CRYPTO_ALG_ASYNC))
++ {
++ REGISTER(i);
++ }
++ else
++ {
++ dprintk("%s:BLKCIPHER algorithm %d:'%s' not supported\n",
++ __FUNCTION__, i, algo);
++ }
++ break;
++ default:
++ dprintk(
++ "%s:Algorithm Type %d not supported (algorithm %d:'%s')\n",
++ __FUNCTION__, sw_type, i, algo);
++ break;
++ }
++ }
++
++ return(0);
++}
++
++static void
++cryptosoft_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ crypto_unregister_all(swcr_id);
++ swcr_id = -1;
++}
++
++module_init(cryptosoft_init);
++module_exit(cryptosoft_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("Cryptosoft (OCF module for kernel crypto)");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ep80579/Makefile linux-2.6.29.1/crypto/ocf/ep80579/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/ep80579/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ep80579/Makefile 2009-04-20 20:01:21.468554715 +0200
+@@ -0,0 +1,107 @@
++#########################################################################
++#
++# Targets supported
++# all - builds everything and installs
++# install - identical to all
++# depend - build dependencies
++# clean - clears derived objects except the .depend files
++# distclean- clears all derived objects and the .depend file
++#
++# @par
++# This file is provided under a dual BSD/GPLv2 license. When using or
++# redistributing this file, you may do so under either license.
++#
++# GPL LICENSE SUMMARY
++#
++# Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of version 2 of the GNU General Public License as
++# published by the Free Software Foundation.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++# The full GNU General Public License is included in this distribution
++# in the file called LICENSE.GPL.
++#
++# Contact Information:
++# Intel Corporation
++#
++# BSD LICENSE
++#
++# Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++# All rights reserved.
++#
++# Redistribution and use in source and binary forms, with or without
++# modification, are permitted provided that the following conditions
++# are met:
++#
++# * Redistributions of source code must retain the above copyright
++# notice, this list of conditions and the following disclaimer.
++# * Redistributions in binary form must reproduce the above copyright
++# notice, this list of conditions and the following disclaimer in
++# the documentation and/or other materials provided with the
++# distribution.
++# * Neither the name of Intel Corporation nor the names of its
++# contributors may be used to endorse or promote products derived
++# from this software without specific prior written permission.
++#
++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++#
++#
++# version: Security.L.1.0.130
++############################################################################
++
++
++####################Common variables and definitions########################
++
++# Ensure The ENV_DIR environmental var is defined.
++ifndef ICP_ENV_DIR
++$(error ICP_ENV_DIR is undefined. Please set the path to your environment makefile \
++ "-> setenv ICP_ENV_DIR <path>")
++endif
++
++#Add your project environment Makefile
++include $(ICP_ENV_DIR)/environment.mk
++
++#include the makefile with all the default and common Make variable definitions
++include $(ICP_BUILDSYSTEM_PATH)/build_files/common.mk
++
++#Add the name for the executable, Library or Module output definitions
++OUTPUT_NAME= icp_ocf
++
++# List of Source Files to be compiled
++SOURCES= icp_common.c icp_sym.c icp_asym.c
++
++#common includes between all supported OSes
++INCLUDES= -I $(ICP_API_DIR) -I$(ICP_LAC_API) \
++-I$(ICP_OCF_SRC_DIR)
++
++# The location of the os level makefile needs to be changed.
++include $(ICP_ENV_DIR)/$(ICP_OS)_$(ICP_OS_LEVEL).mk
++
++# On the line directly below list the outputs you wish to build for,
++# e.g "lib_static lib_shared exe module" as show below
++install: module
++
++###################Include rules makefiles########################
++include $(ICP_BUILDSYSTEM_PATH)/build_files/rules.mk
++###################End of Rules inclusion#########################
++
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_asym.c linux-2.6.29.1/crypto/ocf/ep80579/icp_asym.c
+--- linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_asym.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ep80579/icp_asym.c 2009-04-20 20:01:21.428551297 +0200
+@@ -0,0 +1,1375 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++
++#include "icp_ocf.h"
++
++/*The following define values (containing the word 'INDEX') are used to find
++the index of each input buffer of the crypto_kop struct (see OCF cryptodev.h).
++These values were found through analysis of the OCF OpenSSL patch. If the
++calling program uses different input buffer positions, these defines will have
++to be changed.*/
++
++/*DIFFIE HELLMAN buffer index values*/
++#define ICP_DH_KRP_PARAM_PRIME_INDEX (0)
++#define ICP_DH_KRP_PARAM_BASE_INDEX (1)
++#define ICP_DH_KRP_PARAM_PRIVATE_VALUE_INDEX (2)
++#define ICP_DH_KRP_PARAM_RESULT_INDEX (3)
++
++/*MOD EXP buffer index values*/
++#define ICP_MOD_EXP_KRP_PARAM_BASE_INDEX (0)
++#define ICP_MOD_EXP_KRP_PARAM_EXPONENT_INDEX (1)
++#define ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX (2)
++#define ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX (3)
++
++#define SINGLE_BYTE_VALUE (4)
++
++/*MOD EXP CRT buffer index values*/
++#define ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_P_INDEX (0)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_Q_INDEX (1)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_I_INDEX (2)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DP_INDEX (3)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DQ_INDEX (4)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_COEFF_QINV_INDEX (5)
++#define ICP_MOD_EXP_CRT_KRP_PARAM_RESULT_INDEX (6)
++
++/*DSA sign buffer index values*/
++#define ICP_DSA_SIGN_KRP_PARAM_DGST_INDEX (0)
++#define ICP_DSA_SIGN_KRP_PARAM_PRIME_P_INDEX (1)
++#define ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX (2)
++#define ICP_DSA_SIGN_KRP_PARAM_G_INDEX (3)
++#define ICP_DSA_SIGN_KRP_PARAM_X_INDEX (4)
++#define ICP_DSA_SIGN_KRP_PARAM_R_RESULT_INDEX (5)
++#define ICP_DSA_SIGN_KRP_PARAM_S_RESULT_INDEX (6)
++
++/*DSA verify buffer index values*/
++#define ICP_DSA_VERIFY_KRP_PARAM_DGST_INDEX (0)
++#define ICP_DSA_VERIFY_KRP_PARAM_PRIME_P_INDEX (1)
++#define ICP_DSA_VERIFY_KRP_PARAM_PRIME_Q_INDEX (2)
++#define ICP_DSA_VERIFY_KRP_PARAM_G_INDEX (3)
++#define ICP_DSA_VERIFY_KRP_PARAM_PUBKEY_INDEX (4)
++#define ICP_DSA_VERIFY_KRP_PARAM_SIG_R_INDEX (5)
++#define ICP_DSA_VERIFY_KRP_PARAM_SIG_S_INDEX (6)
++
++/*DSA sign prime Q vs random number K size check values*/
++#define DONT_RUN_LESS_THAN_CHECK (0)
++#define FAIL_A_IS_GREATER_THAN_B (1)
++#define FAIL_A_IS_EQUAL_TO_B (1)
++#define SUCCESS_A_IS_LESS_THAN_B (0)
++#define DSA_SIGN_RAND_GEN_VAL_CHECK_MAX_ITERATIONS (500)
++
++/* We need to set a cryptokp success value just in case it is set or allocated
++ and not set to zero outside of this module */
++#define CRYPTO_OP_SUCCESS (0)
++
++static int icp_ocfDrvDHComputeKey(struct cryptkop *krp);
++
++static int icp_ocfDrvModExp(struct cryptkop *krp);
++
++static int icp_ocfDrvModExpCRT(struct cryptkop *krp);
++
++static int
++icp_ocfDrvCheckALessThanB(CpaFlatBuffer * pK, CpaFlatBuffer * pQ, int *doCheck);
++
++static int icp_ocfDrvDsaSign(struct cryptkop *krp);
++
++static int icp_ocfDrvDsaVerify(struct cryptkop *krp);
++
++static void
++icp_ocfDrvDhP1CallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pLocalOctetStringPV);
++
++static void
++icp_ocfDrvModExpCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pResult);
++
++static void
++icp_ocfDrvModExpCRTCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pOutputData);
++
++static void
++icp_ocfDrvDsaVerifyCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaBoolean verifyStatus);
++
++static void
++icp_ocfDrvDsaRSSignCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData,
++ CpaBoolean protocolStatus,
++ CpaFlatBuffer * pR, CpaFlatBuffer * pS);
++
++/* Name : icp_ocfDrvPkeProcess
++ *
++ * Description : This function will choose which PKE process to follow
++ * based on the input arguments
++ */
++int icp_ocfDrvPkeProcess(device_t dev, struct cryptkop *krp, int hint)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++
++ if (NULL == krp) {
++ DPRINTK("%s(): Invalid input parameters, cryptkop = %p\n",
++ __FUNCTION__, krp);
++ return EINVAL;
++ }
++
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ switch (krp->krp_op) {
++ case CRK_DH_COMPUTE_KEY:
++ DPRINTK("%s() doing DH_COMPUTE_KEY\n", __FUNCTION__);
++ lacStatus = icp_ocfDrvDHComputeKey(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvDHComputeKey failed "
++ "(%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_MOD_EXP:
++ DPRINTK("%s() doing MOD_EXP \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvModExp(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvModExp failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_MOD_EXP_CRT:
++ DPRINTK("%s() doing MOD_EXP_CRT \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvModExpCRT(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvModExpCRT "
++ "failed (%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_DSA_SIGN:
++ DPRINTK("%s() doing DSA_SIGN \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvDsaSign(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvDsaSign "
++ "failed (%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ case CRK_DSA_VERIFY:
++ DPRINTK("%s() doing DSA_VERIFY \n", __FUNCTION__);
++ lacStatus = icp_ocfDrvDsaVerify(krp);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_ocfDrvDsaVerify "
++ "failed (%d).\n", __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ return ECANCELED;
++ }
++
++ break;
++
++ default:
++ EPRINTK("%s(): Asymettric function not "
++ "supported (%d).\n", __FUNCTION__, krp->krp_op);
++ krp->krp_status = EOPNOTSUPP;
++ return EOPNOTSUPP;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvSwapBytes
++ *
++ * Description : This function is used to swap the byte order of a buffer.
++ * It has been seen that in general we are passed little endian byte order
++ * buffers, but LAC only accepts big endian byte order buffers.
++ */
++static void inline
++icp_ocfDrvSwapBytes(u_int8_t * num, u_int32_t buff_len_bytes)
++{
++
++ int i;
++ u_int8_t *end_ptr;
++ u_int8_t hold_val;
++
++ end_ptr = num + (buff_len_bytes - 1);
++ buff_len_bytes = buff_len_bytes >> 1;
++ for (i = 0; i < buff_len_bytes; i++) {
++ hold_val = *num;
++ *num = *end_ptr;
++ num++;
++ *end_ptr = hold_val;
++ end_ptr--;
++ }
++}
++
++/* Name : icp_ocfDrvDHComputeKey
++ *
++ * Description : This function will map Diffie Hellman calls from OCF
++ * to the LAC API. OCF uses this function for Diffie Hellman Phase1 and
++ * Phase2. LAC has a separate Diffie Hellman Phase2 call, however both phases
++ * break down to a modular exponentiation.
++ */
++static int icp_ocfDrvDHComputeKey(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ void *callbackTag = NULL;
++ CpaCyDhPhase1KeyGenOpData *pPhase1OpData = NULL;
++ CpaFlatBuffer *pLocalOctetStringPV = NULL;
++ uint32_t dh_prime_len_bytes = 0, dh_prime_len_bits = 0;
++
++ /* Input checks - check prime is a multiple of 8 bits to allow for
++ allocation later */
++ dh_prime_len_bits =
++ (krp->krp_param[ICP_DH_KRP_PARAM_PRIME_INDEX].crp_nbits);
++
++ /* LAC can reject prime lengths based on prime key sizes, we just
++ need to make sure we can allocate space for the base and
++ exponent buffers correctly */
++ if ((dh_prime_len_bits % NUM_BITS_IN_BYTE) != 0) {
++ APRINTK("%s(): Warning Prime number buffer size is not a "
++ "multiple of 8 bits\n", __FUNCTION__);
++ }
++
++ /* Result storage space should be the same size as the prime as this
++ value can take up the same amount of storage space */
++ if (dh_prime_len_bits !=
++ krp->krp_param[ICP_DH_KRP_PARAM_RESULT_INDEX].crp_nbits) {
++ DPRINTK("%s(): Return Buffer must be the same size "
++ "as the Prime buffer\n", __FUNCTION__);
++ krp->krp_status = EINVAL;
++ return EINVAL;
++ }
++ /* Switch to size in bytes */
++ BITS_TO_BYTES(dh_prime_len_bytes, dh_prime_len_bits);
++
++ callbackTag = krp;
++
++ pPhase1OpData = kmem_cache_zalloc(drvDH_zone, GFP_KERNEL);
++ if (NULL == pPhase1OpData) {
++ APRINTK("%s():Failed to get memory for key gen data\n",
++ __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pLocalOctetStringPV = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pLocalOctetStringPV) {
++ APRINTK("%s():Failed to get memory for pLocalOctetStringPV\n",
++ __FUNCTION__);
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /* Link parameters */
++ pPhase1OpData->primeP.pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_PRIME_INDEX].crp_p;
++
++ pPhase1OpData->primeP.dataLenInBytes = dh_prime_len_bytes;
++
++ icp_ocfDrvSwapBytes(pPhase1OpData->primeP.pData, dh_prime_len_bytes);
++
++ pPhase1OpData->baseG.pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_BASE_INDEX].crp_p;
++
++ BITS_TO_BYTES(pPhase1OpData->baseG.dataLenInBytes,
++ krp->krp_param[ICP_DH_KRP_PARAM_BASE_INDEX].crp_nbits);
++
++ icp_ocfDrvSwapBytes(pPhase1OpData->baseG.pData,
++ pPhase1OpData->baseG.dataLenInBytes);
++
++ pPhase1OpData->privateValueX.pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_PRIVATE_VALUE_INDEX].crp_p;
++
++ BITS_TO_BYTES(pPhase1OpData->privateValueX.dataLenInBytes,
++ krp->krp_param[ICP_DH_KRP_PARAM_PRIVATE_VALUE_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(pPhase1OpData->privateValueX.pData,
++ pPhase1OpData->privateValueX.dataLenInBytes);
++
++ /* Output parameters */
++ pLocalOctetStringPV->pData =
++ krp->krp_param[ICP_DH_KRP_PARAM_RESULT_INDEX].crp_p;
++
++ BITS_TO_BYTES(pLocalOctetStringPV->dataLenInBytes,
++ krp->krp_param[ICP_DH_KRP_PARAM_RESULT_INDEX].crp_nbits);
++
++ lacStatus = cpaCyDhKeyGenPhase1(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvDhP1CallBack,
++ callbackTag, pPhase1OpData,
++ pLocalOctetStringPV);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): DH Phase 1 Key Gen failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ icp_ocfDrvFreeFlatBuffer(pLocalOctetStringPV);
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvModExp
++ *
++ * Description : This function will map ordinary Modular Exponentiation calls
++ * from OCF to the LAC API.
++ *
++ */
++static int icp_ocfDrvModExp(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ void *callbackTag = NULL;
++ CpaCyLnModExpOpData *pModExpOpData = NULL;
++ CpaFlatBuffer *pResult = NULL;
++
++ if ((krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].crp_nbits %
++ NUM_BITS_IN_BYTE) != 0) {
++ DPRINTK("%s(): Warning - modulus buffer size (%d) is not a "
++ "multiple of 8 bits\n", __FUNCTION__,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].
++ crp_nbits);
++ }
++
++ /* Result storage space should be the same size as the prime as this
++ value can take up the same amount of storage space */
++ if (krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].crp_nbits >
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX].crp_nbits) {
++ APRINTK("%s(): Return Buffer size must be the same or"
++ " greater than the Modulus buffer\n", __FUNCTION__);
++ krp->krp_status = EINVAL;
++ return EINVAL;
++ }
++
++ callbackTag = krp;
++
++ pModExpOpData = kmem_cache_zalloc(drvLnModExp_zone, GFP_KERNEL);
++ if (NULL == pModExpOpData) {
++ APRINTK("%s():Failed to get memory for key gen data\n",
++ __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pResult = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pResult) {
++ APRINTK("%s():Failed to get memory for ModExp result\n",
++ __FUNCTION__);
++ kmem_cache_free(drvLnModExp_zone, pModExpOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /* Link parameters */
++ pModExpOpData->modulus.pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].crp_p;
++ BITS_TO_BYTES(pModExpOpData->modulus.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_MODULUS_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(pModExpOpData->modulus.pData,
++ pModExpOpData->modulus.dataLenInBytes);
++
++ /*OCF patch to Openswan Pluto regularly sends the base value as 2
++ bits in size. In this case, it has been found it is better to
++ use the base size memory space as the input buffer (if the number
++ is in bits is less than a byte, the number of bits is the input
++ value) */
++ if (krp->krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_nbits <
++ NUM_BITS_IN_BYTE) {
++ DPRINTK("%s : base is small (%d)\n", __FUNCTION__, krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_nbits);
++ pModExpOpData->base.dataLenInBytes = SINGLE_BYTE_VALUE;
++ pModExpOpData->base.pData =
++ (uint8_t *) & (krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].
++ crp_nbits);
++ *((uint32_t *) pModExpOpData->base.pData) =
++ htonl(*((uint32_t *) pModExpOpData->base.pData));
++
++ } else {
++
++ DPRINTK("%s : base is big (%d)\n", __FUNCTION__, krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_nbits);
++ pModExpOpData->base.pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].crp_p;
++ BITS_TO_BYTES(pModExpOpData->base.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(pModExpOpData->base.pData,
++ pModExpOpData->base.dataLenInBytes);
++ }
++
++ pModExpOpData->exponent.pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_EXPONENT_INDEX].crp_p;
++ BITS_TO_BYTES(pModExpOpData->exponent.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_EXPONENT_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(pModExpOpData->exponent.pData,
++ pModExpOpData->exponent.dataLenInBytes);
++ /* Output parameters */
++ pResult->pData =
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX].crp_p,
++ BITS_TO_BYTES(pResult->dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_KRP_PARAM_RESULT_INDEX].
++ crp_nbits);
++
++ lacStatus = cpaCyLnModExp(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvModExpCallBack,
++ callbackTag, pModExpOpData, pResult);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): Mod Exp Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ icp_ocfDrvFreeFlatBuffer(pResult);
++ kmem_cache_free(drvLnModExp_zone, pModExpOpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvModExpCRT
++ *
++ * Description : This function will map ordinary Modular Exponentiation Chinese
++ * Remainder Theorem implementaion calls from OCF to the LAC API.
++ *
++ * Note : Mod Exp CRT for this driver is accelerated through LAC RSA type 2
++ * decrypt operation. Therefore P and Q input values must always be prime
++ * numbers. Although basic primality checks are done in LAC, it is up to the
++ * user to do any correct prime number checking before passing the inputs.
++ */
++
++static int icp_ocfDrvModExpCRT(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyRsaDecryptOpData *rsaDecryptOpData = NULL;
++ void *callbackTag = NULL;
++ CpaFlatBuffer *pOutputData = NULL;
++
++ /*Parameter input checks are all done by LAC, no need to repeat
++ them here. */
++ callbackTag = krp;
++
++ rsaDecryptOpData = kmem_cache_zalloc(drvRSADecrypt_zone, GFP_KERNEL);
++ if (NULL == rsaDecryptOpData) {
++ APRINTK("%s():Failed to get memory"
++ " for MOD EXP CRT Op data struct\n", __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ rsaDecryptOpData->pRecipientPrivateKey
++ = kmem_cache_zalloc(drvRSAPrivateKey_zone, GFP_KERNEL);
++ if (NULL == rsaDecryptOpData->pRecipientPrivateKey) {
++ APRINTK("%s():Failed to get memory for MOD EXP CRT"
++ " private key values struct\n", __FUNCTION__);
++ kmem_cache_free(drvRSADecrypt_zone, rsaDecryptOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ version = CPA_CY_RSA_VERSION_TWO_PRIME;
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRepType = CPA_CY_RSA_PRIVATE_KEY_REP_TYPE_2;
++
++ pOutputData = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pOutputData) {
++ APRINTK("%s():Failed to get memory"
++ " for MOD EXP CRT output data\n", __FUNCTION__);
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ rsaDecryptOpData->pRecipientPrivateKey);
++ kmem_cache_free(drvRSADecrypt_zone, rsaDecryptOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ version = CPA_CY_RSA_VERSION_TWO_PRIME;
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRepType = CPA_CY_RSA_PRIVATE_KEY_REP_TYPE_2;
++
++ /* Link parameters */
++ rsaDecryptOpData->inputData.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_I_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->inputData.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_I_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->inputData.pData,
++ rsaDecryptOpData->inputData.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.prime1P.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_P_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.
++ prime1P.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_P_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime1P.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime1P.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.prime2Q.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_Q_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.
++ prime2Q.dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime2Q.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.prime2Q.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent1Dp.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DP_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->privateKeyRep2.
++ exponent1Dp.dataLenInBytes,
++ krp->
++ krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DP_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent1Dp.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent1Dp.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DQ_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.dataLenInBytes,
++ krp->
++ krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_EXPONENT_DQ_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.exponent2Dq.dataLenInBytes);
++
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_COEFF_QINV_INDEX].crp_p;
++ BITS_TO_BYTES(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.dataLenInBytes,
++ krp->
++ krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_COEFF_QINV_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.pData,
++ rsaDecryptOpData->pRecipientPrivateKey->
++ privateKeyRep2.coefficientQInv.dataLenInBytes);
++
++ /* Output Parameter */
++ pOutputData->pData =
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_RESULT_INDEX].crp_p;
++ BITS_TO_BYTES(pOutputData->dataLenInBytes,
++ krp->krp_param[ICP_MOD_EXP_CRT_KRP_PARAM_RESULT_INDEX].
++ crp_nbits);
++
++ lacStatus = cpaCyRsaDecrypt(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvModExpCRTCallBack,
++ callbackTag, rsaDecryptOpData, pOutputData);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): Mod Exp CRT Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ icp_ocfDrvFreeFlatBuffer(pOutputData);
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ rsaDecryptOpData->pRecipientPrivateKey);
++ kmem_cache_free(drvRSADecrypt_zone, rsaDecryptOpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvCheckALessThanB
++ *
++ * Description : This function will check whether the first argument is less
++ * than the second. It is used to check whether the DSA RS sign Random K
++ * value is less than the Prime Q value (as defined in the specification)
++ *
++ */
++static int
++icp_ocfDrvCheckALessThanB(CpaFlatBuffer * pK, CpaFlatBuffer * pQ, int *doCheck)
++{
++
++ uint8_t *MSB_K = pK->pData;
++ uint8_t *MSB_Q = pQ->pData;
++ uint32_t buffer_lengths_in_bytes = pQ->dataLenInBytes;
++
++ if (DONT_RUN_LESS_THAN_CHECK == *doCheck) {
++ return FAIL_A_IS_GREATER_THAN_B;
++ }
++
++/*Check MSBs
++if A == B, check next MSB
++if A > B, return A_IS_GREATER_THAN_B
++if A < B, return A_IS_LESS_THAN_B (success)
++*/
++ while (*MSB_K == *MSB_Q) {
++ MSB_K++;
++ MSB_Q++;
++
++ buffer_lengths_in_bytes--;
++ if (0 == buffer_lengths_in_bytes) {
++ DPRINTK("%s() Buffers have equal value!!\n",
++ __FUNCTION__);
++ return FAIL_A_IS_EQUAL_TO_B;
++ }
++
++ }
++
++ if (*MSB_K < *MSB_Q) {
++ return SUCCESS_A_IS_LESS_THAN_B;
++ } else {
++ return FAIL_A_IS_GREATER_THAN_B;
++ }
++
++}
++
++/* Name : icp_ocfDrvDsaSign
++ *
++ * Description : This function will map DSA RS Sign from OCF to the LAC API.
++ *
++ * NOTE: From looking at OCF patch to OpenSSL and even the number of input
++ * parameters, OCF expects us to generate the random seed value. This value
++ * is generated and passed to LAC, however the number is discared in the
++ * callback and not returned to the user.
++ */
++static int icp_ocfDrvDsaSign(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyDsaRSSignOpData *dsaRsSignOpData = NULL;
++ void *callbackTag = NULL;
++ CpaCyRandGenOpData randGenOpData;
++ int primeQSizeInBytes = 0;
++ int doCheck = 0;
++ CpaFlatBuffer randData;
++ CpaBoolean protocolStatus = CPA_FALSE;
++ CpaFlatBuffer *pR = NULL;
++ CpaFlatBuffer *pS = NULL;
++
++ callbackTag = krp;
++
++ BITS_TO_BYTES(primeQSizeInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++
++ if (DSA_RS_SIGN_PRIMEQ_SIZE_IN_BYTES != primeQSizeInBytes) {
++ APRINTK("%s(): DSA PRIME Q size not equal to the "
++ "FIPS defined 20bytes, = %d\n",
++ __FUNCTION__, primeQSizeInBytes);
++ krp->krp_status = EDOM;
++ return EDOM;
++ }
++
++ dsaRsSignOpData = kmem_cache_zalloc(drvDSARSSign_zone, GFP_KERNEL);
++ if (NULL == dsaRsSignOpData) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA RS Sign Op data struct\n", __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ dsaRsSignOpData->K.pData =
++ kmem_cache_alloc(drvDSARSSignKValue_zone, GFP_ATOMIC);
++
++ if (NULL == dsaRsSignOpData->K.pData) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA RS Sign Op Random value\n", __FUNCTION__);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pR = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pR) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA signature R\n", __FUNCTION__);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ pS = kmem_cache_zalloc(drvFlatBuffer_zone, GFP_KERNEL);
++ if (NULL == pS) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA signature S\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /*link prime number parameter for ease of processing */
++ dsaRsSignOpData->P.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_P_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->P.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_P_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->P.pData,
++ dsaRsSignOpData->P.dataLenInBytes);
++
++ dsaRsSignOpData->Q.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->Q.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->Q.pData,
++ dsaRsSignOpData->Q.dataLenInBytes);
++
++ /*generate random number with equal buffer size to Prime value Q,
++ but value less than Q */
++ dsaRsSignOpData->K.dataLenInBytes = dsaRsSignOpData->Q.dataLenInBytes;
++
++ randGenOpData.generateBits = CPA_TRUE;
++ randGenOpData.lenInBytes = dsaRsSignOpData->K.dataLenInBytes;
++
++ icp_ocfDrvPtrAndLenToFlatBuffer(dsaRsSignOpData->K.pData,
++ dsaRsSignOpData->K.dataLenInBytes,
++ &randData);
++
++ doCheck = 0;
++ while (icp_ocfDrvCheckALessThanB(&(dsaRsSignOpData->K),
++ &(dsaRsSignOpData->Q), &doCheck)) {
++
++ if (CPA_STATUS_SUCCESS
++ != cpaCyRandGen(CPA_INSTANCE_HANDLE_SINGLE,
++ NULL, NULL, &randGenOpData, &randData)) {
++ APRINTK("%s(): ERROR - Failed to generate DSA RS Sign K"
++ "value\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = EAGAIN;
++ return EAGAIN;
++ }
++
++ doCheck++;
++ if (DSA_SIGN_RAND_GEN_VAL_CHECK_MAX_ITERATIONS == doCheck) {
++ APRINTK("%s(): ERROR - Failed to find DSA RS Sign K "
++ "value less than Q value\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ krp->krp_status = EAGAIN;
++ return EAGAIN;
++ }
++
++ }
++ /*Rand Data - no need to swap bytes for pK */
++
++ /* Link parameters */
++ dsaRsSignOpData->G.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_G_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->G.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_G_INDEX].crp_nbits);
++
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->G.pData,
++ dsaRsSignOpData->G.dataLenInBytes);
++
++ dsaRsSignOpData->X.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_X_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->X.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_X_INDEX].crp_nbits);
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->X.pData,
++ dsaRsSignOpData->X.dataLenInBytes);
++
++ dsaRsSignOpData->M.pData =
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_DGST_INDEX].crp_p;
++ BITS_TO_BYTES(dsaRsSignOpData->M.dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_DGST_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaRsSignOpData->M.pData,
++ dsaRsSignOpData->M.dataLenInBytes);
++
++ /* Output Parameters */
++ pS->pData = krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_S_RESULT_INDEX].crp_p;
++ BITS_TO_BYTES(pS->dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_S_RESULT_INDEX].
++ crp_nbits);
++
++ pR->pData = krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_R_RESULT_INDEX].crp_p;
++ BITS_TO_BYTES(pR->dataLenInBytes,
++ krp->krp_param[ICP_DSA_SIGN_KRP_PARAM_R_RESULT_INDEX].
++ crp_nbits);
++
++ lacStatus = cpaCyDsaSignRS(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvDsaRSSignCallBack,
++ callbackTag, dsaRsSignOpData,
++ &protocolStatus, pR, pS);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): DSA RS Sign Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ krp->krp_status = ECANCELED;
++ icp_ocfDrvFreeFlatBuffer(pS);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSignKValue_zone,
++ dsaRsSignOpData->K.pData);
++ kmem_cache_free(drvDSARSSign_zone, dsaRsSignOpData);
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvDsaVerify
++ *
++ * Description : This function will map DSA RS Verify from OCF to the LAC API.
++ *
++ */
++static int icp_ocfDrvDsaVerify(struct cryptkop *krp)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyDsaVerifyOpData *dsaVerifyOpData = NULL;
++ void *callbackTag = NULL;
++ CpaBoolean verifyStatus = CPA_FALSE;
++
++ callbackTag = krp;
++
++ dsaVerifyOpData = kmem_cache_zalloc(drvDSAVerify_zone, GFP_KERNEL);
++ if (NULL == dsaVerifyOpData) {
++ APRINTK("%s():Failed to get memory"
++ " for DSA Verify Op data struct\n", __FUNCTION__);
++ krp->krp_status = ENOMEM;
++ return ENOMEM;
++ }
++
++ /* Link parameters */
++ dsaVerifyOpData->P.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_P_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->P.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_P_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->P.pData,
++ dsaVerifyOpData->P.dataLenInBytes);
++
++ dsaVerifyOpData->Q.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_Q_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->Q.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PRIME_Q_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->Q.pData,
++ dsaVerifyOpData->Q.dataLenInBytes);
++
++ dsaVerifyOpData->G.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_G_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->G.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_G_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->G.pData,
++ dsaVerifyOpData->G.dataLenInBytes);
++
++ dsaVerifyOpData->Y.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PUBKEY_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->Y.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_PUBKEY_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->Y.pData,
++ dsaVerifyOpData->Y.dataLenInBytes);
++
++ dsaVerifyOpData->M.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_DGST_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->M.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_DGST_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->M.pData,
++ dsaVerifyOpData->M.dataLenInBytes);
++
++ dsaVerifyOpData->R.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_R_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->R.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_R_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->R.pData,
++ dsaVerifyOpData->R.dataLenInBytes);
++
++ dsaVerifyOpData->S.pData =
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_S_INDEX].crp_p;
++ BITS_TO_BYTES(dsaVerifyOpData->S.dataLenInBytes,
++ krp->krp_param[ICP_DSA_VERIFY_KRP_PARAM_SIG_S_INDEX].
++ crp_nbits);
++ icp_ocfDrvSwapBytes(dsaVerifyOpData->S.pData,
++ dsaVerifyOpData->S.dataLenInBytes);
++
++ lacStatus = cpaCyDsaVerify(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvDsaVerifyCallBack,
++ callbackTag, dsaVerifyOpData, &verifyStatus);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): DSA Verify Operation failed (%d).\n",
++ __FUNCTION__, lacStatus);
++ kmem_cache_free(drvDSAVerify_zone, dsaVerifyOpData);
++ krp->krp_status = ECANCELED;
++ }
++
++ return lacStatus;
++}
++
++/* Name : icp_ocfDrvReadRandom
++ *
++ * Description : This function will map RNG functionality calls from OCF
++ * to the LAC API.
++ */
++int icp_ocfDrvReadRandom(void *arg, uint32_t * buf, int maxwords)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ CpaCyRandGenOpData randGenOpData;
++ CpaFlatBuffer randData;
++
++ if (NULL == buf) {
++ APRINTK("%s(): Invalid input parameters\n", __FUNCTION__);
++ return EINVAL;
++ }
++
++ /* maxwords here is number of integers to generate data for */
++ randGenOpData.generateBits = CPA_TRUE;
++
++ randGenOpData.lenInBytes = maxwords * sizeof(uint32_t);
++
++ icp_ocfDrvPtrAndLenToFlatBuffer((Cpa8U *) buf,
++ randGenOpData.lenInBytes, &randData);
++
++ lacStatus = cpaCyRandGen(CPA_INSTANCE_HANDLE_SINGLE,
++ NULL, NULL, &randGenOpData, &randData);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): icp_LacSymRandGen failed (%d). \n",
++ __FUNCTION__, lacStatus);
++ return RETURN_RAND_NUM_GEN_FAILED;
++ }
++
++ return randGenOpData.lenInBytes / sizeof(uint32_t);
++}
++
++/* Name : icp_ocfDrvDhP1Callback
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the DH operation.
++ */
++static void
++icp_ocfDrvDhP1CallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pLocalOctetStringPV)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyDhPhase1KeyGenOpData *pPhase1OpData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pPhase1OpData = (CpaCyDhPhase1KeyGenOpData *) pOpData;
++
++ if (NULL == pLocalOctetStringPV) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "pLocalOctetStringPV Data is NULL\n", __FUNCTION__);
++ memset(pPhase1OpData, 0, sizeof(CpaCyDhPhase1KeyGenOpData));
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++ } else {
++ APRINTK("%s(): Diffie Hellman Phase1 Key Gen failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ }
++
++ icp_ocfDrvSwapBytes(pLocalOctetStringPV->pData,
++ pLocalOctetStringPV->dataLenInBytes);
++
++ icp_ocfDrvFreeFlatBuffer(pLocalOctetStringPV);
++ memset(pPhase1OpData, 0, sizeof(CpaCyDhPhase1KeyGenOpData));
++ kmem_cache_free(drvDH_zone, pPhase1OpData);
++
++ crypto_kdone(krp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvModExpCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the Mod Exp operation.
++ */
++static void
++icp_ocfDrvModExpCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpdata, CpaFlatBuffer * pResult)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyLnModExpOpData *pLnModExpOpData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpdata) {
++ DPRINTK("%s(): Invalid Mod Exp input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pLnModExpOpData = (CpaCyLnModExpOpData *) pOpdata;
++
++ if (NULL == pResult) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "pResult data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ memset(pLnModExpOpData, 0, sizeof(CpaCyLnModExpOpData));
++ kmem_cache_free(drvLnModExp_zone, pLnModExpOpData);
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++ } else {
++ APRINTK("%s(): LAC Mod Exp Operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ }
++
++ icp_ocfDrvSwapBytes(pResult->pData, pResult->dataLenInBytes);
++
++ /*switch base size value back to original */
++ if (pLnModExpOpData->base.pData ==
++ (uint8_t *) & (krp->
++ krp_param[ICP_MOD_EXP_KRP_PARAM_BASE_INDEX].
++ crp_nbits)) {
++ *((uint32_t *) pLnModExpOpData->base.pData) =
++ ntohl(*((uint32_t *) pLnModExpOpData->base.pData));
++ }
++ icp_ocfDrvFreeFlatBuffer(pResult);
++ memset(pLnModExpOpData, 0, sizeof(CpaCyLnModExpOpData));
++ kmem_cache_free(drvLnModExp_zone, pLnModExpOpData);
++
++ crypto_kdone(krp);
++
++ return;
++
++}
++
++/* Name : icp_ocfDrvModExpCRTCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the Mod Exp CRT operation.
++ */
++static void
++icp_ocfDrvModExpCRTCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaFlatBuffer * pOutputData)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyRsaDecryptOpData *pDecryptData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pDecryptData = (CpaCyRsaDecryptOpData *) pOpData;
++
++ if (NULL == pOutputData) {
++ DPRINTK("%s(): Invalid input parameter - "
++ "pOutputData is NULL\n", __FUNCTION__);
++ memset(pDecryptData->pRecipientPrivateKey, 0,
++ sizeof(CpaCyRsaPrivateKey));
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ pDecryptData->pRecipientPrivateKey);
++ memset(pDecryptData, 0, sizeof(CpaCyRsaDecryptOpData));
++ kmem_cache_free(drvRSADecrypt_zone, pDecryptData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++ } else {
++ APRINTK("%s(): LAC Mod Exp CRT operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ }
++
++ icp_ocfDrvSwapBytes(pOutputData->pData, pOutputData->dataLenInBytes);
++
++ icp_ocfDrvFreeFlatBuffer(pOutputData);
++ memset(pDecryptData->pRecipientPrivateKey, 0,
++ sizeof(CpaCyRsaPrivateKey));
++ kmem_cache_free(drvRSAPrivateKey_zone,
++ pDecryptData->pRecipientPrivateKey);
++ memset(pDecryptData, 0, sizeof(CpaCyRsaDecryptOpData));
++ kmem_cache_free(drvRSADecrypt_zone, pDecryptData);
++
++ crypto_kdone(krp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvDsaRSSignCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the DSA RS sign operation.
++ */
++static void
++icp_ocfDrvDsaRSSignCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData,
++ CpaBoolean protocolStatus,
++ CpaFlatBuffer * pR, CpaFlatBuffer * pS)
++{
++ struct cryptkop *krp = NULL;
++ CpaCyDsaRSSignOpData *pSignData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pSignData = (CpaCyDsaRSSignOpData *) pOpData;
++
++ if (NULL == pR) {
++ DPRINTK("%s(): Invalid input parameter - "
++ "pR sign is NULL\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ kmem_cache_free(drvDSARSSign_zone, pSignData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (NULL == pS) {
++ DPRINTK("%s(): Invalid input parameter - "
++ "pS sign is NULL\n", __FUNCTION__);
++ icp_ocfDrvFreeFlatBuffer(pR);
++ kmem_cache_free(drvDSARSSign_zone, pSignData);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS != status) {
++ APRINTK("%s(): LAC DSA RS Sign operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ } else {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++
++ if (CPA_TRUE != protocolStatus) {
++ DPRINTK("%s(): LAC DSA RS Sign operation failed due "
++ "to protocol error\n", __FUNCTION__);
++ krp->krp_status = EIO;
++ }
++ }
++
++ /* Swap bytes only when the callback status is successful and
++ protocolStatus is set to true */
++ if (CPA_STATUS_SUCCESS == status && CPA_TRUE == protocolStatus) {
++ icp_ocfDrvSwapBytes(pR->pData, pR->dataLenInBytes);
++ icp_ocfDrvSwapBytes(pS->pData, pS->dataLenInBytes);
++ }
++
++ icp_ocfDrvFreeFlatBuffer(pR);
++ icp_ocfDrvFreeFlatBuffer(pS);
++ memset(pSignData->K.pData, 0, pSignData->K.dataLenInBytes);
++ kmem_cache_free(drvDSARSSignKValue_zone, pSignData->K.pData);
++ memset(pSignData, 0, sizeof(CpaCyDsaRSSignOpData));
++ kmem_cache_free(drvDSARSSign_zone, pSignData);
++ crypto_kdone(krp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvDsaVerifyCallback
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the DSA Verify operation.
++ */
++static void
++icp_ocfDrvDsaVerifyCallBack(void *callbackTag,
++ CpaStatus status,
++ void *pOpData, CpaBoolean verifyStatus)
++{
++
++ struct cryptkop *krp = NULL;
++ CpaCyDsaVerifyOpData *pVerData = NULL;
++
++ if (NULL == callbackTag) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "callbackTag data is NULL\n", __FUNCTION__);
++ return;
++ }
++
++ krp = (struct cryptkop *)callbackTag;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): Invalid input parameters - "
++ "Operation Data is NULL\n", __FUNCTION__);
++ krp->krp_status = ECANCELED;
++ crypto_kdone(krp);
++ return;
++ }
++ pVerData = (CpaCyDsaVerifyOpData *) pOpData;
++
++ if (CPA_STATUS_SUCCESS != status) {
++ APRINTK("%s(): LAC DSA Verify operation failed - "
++ "Operation Status = %d\n", __FUNCTION__, status);
++ krp->krp_status = ECANCELED;
++ } else {
++ krp->krp_status = CRYPTO_OP_SUCCESS;
++
++ if (CPA_TRUE != verifyStatus) {
++ DPRINTK("%s(): DSA signature invalid\n", __FUNCTION__);
++ krp->krp_status = EIO;
++ }
++ }
++
++ /* Swap bytes only when the callback status is successful and
++ verifyStatus is set to true */
++ /*Just swapping back the key values for now. Possibly all
++ swapped buffers need to be reverted */
++ if (CPA_STATUS_SUCCESS == status && CPA_TRUE == verifyStatus) {
++ icp_ocfDrvSwapBytes(pVerData->R.pData,
++ pVerData->R.dataLenInBytes);
++ icp_ocfDrvSwapBytes(pVerData->S.pData,
++ pVerData->S.dataLenInBytes);
++ }
++
++ memset(pVerData, 0, sizeof(CpaCyDsaVerifyOpData));
++ kmem_cache_free(drvDSAVerify_zone, pVerData);
++ crypto_kdone(krp);
++
++ return;
++}
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_common.c linux-2.6.29.1/crypto/ocf/ep80579/icp_common.c
+--- linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_common.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ep80579/icp_common.c 2009-04-20 20:01:21.432551806 +0200
+@@ -0,0 +1,891 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++
++/*
++ * An OCF module that uses Intel® QuickAssist Integrated Accelerator to do the
++ * crypto.
++ *
++ * This driver requires the ICP Access Library that is available from Intel in
++ * order to operate.
++ */
++
++#include "icp_ocf.h"
++
++#define ICP_OCF_COMP_NAME "ICP_OCF"
++#define ICP_OCF_VER_MAIN (2)
++#define ICP_OCF_VER_MJR (0)
++#define ICP_OCF_VER_MNR (0)
++
++#define MAX_DEREG_RETRIES (100)
++#define DEFAULT_DEREG_RETRIES (10)
++#define DEFAULT_DEREG_DELAY_IN_JIFFIES (10)
++
++/* This defines the maximum number of sessions possible between OCF
++ and the OCF Tolapai Driver. If set to zero, there is no limit. */
++#define DEFAULT_OCF_TO_DRV_MAX_SESSION_COUNT (0)
++#define NUM_SUPPORTED_CAPABILITIES (21)
++
++/*Slabs zones*/
++struct kmem_cache *drvSessionData_zone = NULL;
++struct kmem_cache *drvOpData_zone = NULL;
++struct kmem_cache *drvDH_zone = NULL;
++struct kmem_cache *drvLnModExp_zone = NULL;
++struct kmem_cache *drvRSADecrypt_zone = NULL;
++struct kmem_cache *drvRSAPrivateKey_zone = NULL;
++struct kmem_cache *drvDSARSSign_zone = NULL;
++struct kmem_cache *drvDSARSSignKValue_zone = NULL;
++struct kmem_cache *drvDSAVerify_zone = NULL;
++
++/*Slab zones for flatbuffers and bufferlist*/
++struct kmem_cache *drvFlatBuffer_zone = NULL;
++
++static int icp_ocfDrvInit(void);
++static void icp_ocfDrvExit(void);
++static void icp_ocfDrvFreeCaches(void);
++static void icp_ocfDrvDeferedFreeLacSessionProcess(void *arg);
++
++int32_t icp_ocfDrvDriverId = INVALID_DRIVER_ID;
++
++/* Module parameter - gives the number of times LAC deregistration shall be
++ re-tried */
++int num_dereg_retries = DEFAULT_DEREG_RETRIES;
++
++/* Module parameter - gives the delay time in jiffies before a LAC session
++ shall be attempted to be deregistered again */
++int dereg_retry_delay_in_jiffies = DEFAULT_DEREG_DELAY_IN_JIFFIES;
++
++/* Module parameter - gives the maximum number of sessions possible between
++ OCF and the OCF Tolapai Driver. If set to zero, there is no limit.*/
++int max_sessions = DEFAULT_OCF_TO_DRV_MAX_SESSION_COUNT;
++
++/* This is set when the module is removed from the system, no further
++ processing can take place if this is set */
++atomic_t icp_ocfDrvIsExiting = ATOMIC_INIT(0);
++
++/* This is used to show how many lac sessions were not deregistered*/
++atomic_t lac_session_failed_dereg_count = ATOMIC_INIT(0);
++
++/* This is used to track the number of registered sessions between OCF and
++ * and the OCF Tolapai driver, when max_session is set to value other than
++ * zero. This ensures that the max_session set for the OCF and the driver
++ * is equal to the LAC registered sessions */
++atomic_t num_ocf_to_drv_registered_sessions = ATOMIC_INIT(0);
++
++/* Head of linked list used to store session data */
++struct list_head icp_ocfDrvGlobalSymListHead;
++struct list_head icp_ocfDrvGlobalSymListHead_FreeMemList;
++
++spinlock_t icp_ocfDrvSymSessInfoListSpinlock = SPIN_LOCK_UNLOCKED;
++rwlock_t icp_kmem_cache_destroy_alloc_lock = RW_LOCK_UNLOCKED;
++
++struct workqueue_struct *icp_ocfDrvFreeLacSessionWorkQ;
++
++struct icp_drvBuffListInfo defBuffListInfo;
++
++static struct {
++ softc_device_decl sc_dev;
++} icpDev;
++
++static device_method_t icp_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, icp_ocfDrvNewSession),
++ DEVMETHOD(cryptodev_freesession, icp_ocfDrvFreeLACSession),
++ DEVMETHOD(cryptodev_process, icp_ocfDrvSymProcess),
++ DEVMETHOD(cryptodev_kprocess, icp_ocfDrvPkeProcess),
++};
++
++module_param(num_dereg_retries, int, S_IRUGO);
++module_param(dereg_retry_delay_in_jiffies, int, S_IRUGO);
++module_param(max_sessions, int, S_IRUGO);
++
++MODULE_PARM_DESC(num_dereg_retries,
++ "Number of times to retry LAC Sym Session Deregistration. "
++ "Default 10, Max 100");
++MODULE_PARM_DESC(dereg_retry_delay_in_jiffies, "Delay in jiffies "
++ "(added to a schedule() function call) before a LAC Sym "
++ "Session Dereg is retried. Default 10");
++MODULE_PARM_DESC(max_sessions, "This sets the maximum number of sessions "
++ "between OCF and this driver. If this value is set to zero, "
++ "max session count checking is disabled. Default is zero(0)");
++
++/* Name : icp_ocfDrvInit
++ *
++ * Description : This function will register all the symmetric and asymmetric
++ * functionality that will be accelerated by the hardware. It will also
++ * get a unique driver ID from the OCF and initialise all slab caches
++ */
++static int __init icp_ocfDrvInit(void)
++{
++ int ocfStatus = 0;
++
++ IPRINTK("=== %s ver %d.%d.%d ===\n", ICP_OCF_COMP_NAME,
++ ICP_OCF_VER_MAIN, ICP_OCF_VER_MJR, ICP_OCF_VER_MNR);
++
++ if (MAX_DEREG_RETRIES < num_dereg_retries) {
++ EPRINTK("Session deregistration retry count set to greater "
++ "than %d", MAX_DEREG_RETRIES);
++ return -1;
++ }
++
++ /* Initialize and Start the Cryptographic component */
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyStartInstance(CPA_INSTANCE_HANDLE_SINGLE)) {
++ EPRINTK("Failed to initialize and start the instance "
++ "of the Cryptographic component.\n");
++ return -1;
++ }
++
++ /* Set the default size of BufferList to allocate */
++ memset(&defBuffListInfo, 0, sizeof(struct icp_drvBuffListInfo));
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvBufferListMemInfo(ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS,
++ &defBuffListInfo)) {
++ EPRINTK("Failed to get bufferlist memory info.\n");
++ return -1;
++ }
++
++ /*Register OCF Tolapai Driver with OCF */
++ memset(&icpDev, 0, sizeof(icpDev));
++ softc_device_init(&icpDev, "icp", 0, icp_methods);
++
++ icp_ocfDrvDriverId = crypto_get_driverid(softc_get_device(&icpDev),
++ CRYPTOCAP_F_HARDWARE);
++
++ if (icp_ocfDrvDriverId < 0) {
++ EPRINTK("%s : ICP driver failed to register with OCF!\n",
++ __FUNCTION__);
++ return -ENODEV;
++ }
++
++ /*Create all the slab caches used by the OCF Tolapai Driver */
++ drvSessionData_zone =
++ ICP_CACHE_CREATE("ICP Session Data", struct icp_drvSessionData);
++ ICP_CACHE_NULL_CHECK(drvSessionData_zone);
++
++ /*
++ * Allocation of the OpData includes the allocation space for meta data.
++ * The memory after the opData structure is reserved for this meta data.
++ */
++ drvOpData_zone =
++ kmem_cache_create("ICP Op Data", sizeof(struct icp_drvOpData) +
++ defBuffListInfo.metaSize ,0, SLAB_HWCACHE_ALIGN, NULL, NULL);
++
++
++ ICP_CACHE_NULL_CHECK(drvOpData_zone);
++
++ drvDH_zone = ICP_CACHE_CREATE("ICP DH data", CpaCyDhPhase1KeyGenOpData);
++ ICP_CACHE_NULL_CHECK(drvDH_zone);
++
++ drvLnModExp_zone =
++ ICP_CACHE_CREATE("ICP ModExp data", CpaCyLnModExpOpData);
++ ICP_CACHE_NULL_CHECK(drvLnModExp_zone);
++
++ drvRSADecrypt_zone =
++ ICP_CACHE_CREATE("ICP RSA decrypt data", CpaCyRsaDecryptOpData);
++ ICP_CACHE_NULL_CHECK(drvRSADecrypt_zone);
++
++ drvRSAPrivateKey_zone =
++ ICP_CACHE_CREATE("ICP RSA private key data", CpaCyRsaPrivateKey);
++ ICP_CACHE_NULL_CHECK(drvRSAPrivateKey_zone);
++
++ drvDSARSSign_zone =
++ ICP_CACHE_CREATE("ICP DSA Sign", CpaCyDsaRSSignOpData);
++ ICP_CACHE_NULL_CHECK(drvDSARSSign_zone);
++
++ /*too awkward to use a macro here */
++ drvDSARSSignKValue_zone =
++ kmem_cache_create("ICP DSA Sign Rand Val",
++ DSA_RS_SIGN_PRIMEQ_SIZE_IN_BYTES, 0,
++ SLAB_HWCACHE_ALIGN, NULL, NULL);
++ ICP_CACHE_NULL_CHECK(drvDSARSSignKValue_zone);
++
++ drvDSAVerify_zone =
++ ICP_CACHE_CREATE("ICP DSA Verify", CpaCyDsaVerifyOpData);
++ ICP_CACHE_NULL_CHECK(drvDSAVerify_zone);
++
++ drvFlatBuffer_zone =
++ ICP_CACHE_CREATE("ICP Flat Buffers", CpaFlatBuffer);
++ ICP_CACHE_NULL_CHECK(drvFlatBuffer_zone);
++
++ /* Register the ICP symmetric crypto support. */
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_NULL_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_DES_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_3DES_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_AES_CBC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_ARC4);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_MD5);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_MD5_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA1);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA1_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_256);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_256_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_384);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_384_HMAC);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_512);
++ ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(CRYPTO_SHA2_512_HMAC);
++
++ /* Register the ICP asymmetric algorithm support */
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_DH_COMPUTE_KEY);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_MOD_EXP);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_MOD_EXP_CRT);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_DSA_SIGN);
++ ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(CRK_DSA_VERIFY);
++
++ /* Register the ICP random number generator support */
++ if (OCF_REGISTRATION_STATUS_SUCCESS ==
++ crypto_rregister(icp_ocfDrvDriverId, icp_ocfDrvReadRandom, NULL)) {
++ ocfStatus++;
++ }
++
++ if (OCF_ZERO_FUNCTIONALITY_REGISTERED == ocfStatus) {
++ DPRINTK("%s: Failed to register any device capabilities\n",
++ __FUNCTION__);
++ icp_ocfDrvFreeCaches();
++ icp_ocfDrvDriverId = INVALID_DRIVER_ID;
++ return -ECANCELED;
++ }
++
++ DPRINTK("%s: Registered %d of %d device capabilities\n",
++ __FUNCTION__, ocfStatus, NUM_SUPPORTED_CAPABILITIES);
++
++/*Session data linked list used during module exit*/
++ INIT_LIST_HEAD(&icp_ocfDrvGlobalSymListHead);
++ INIT_LIST_HEAD(&icp_ocfDrvGlobalSymListHead_FreeMemList);
++
++ icp_ocfDrvFreeLacSessionWorkQ =
++ create_singlethread_workqueue("ocfLacDeregWorkQueue");
++
++ return 0;
++}
++
++/* Name : icp_ocfDrvExit
++ *
++ * Description : This function will deregister all the symmetric sessions
++ * registered with the LAC component. It will also deregister all symmetric
++ * and asymmetric functionality that can be accelerated by the hardware via OCF
++ * and random number generation if it is enabled.
++ */
++static void icp_ocfDrvExit(void)
++{
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ struct icp_drvSessionData *sessionData = NULL;
++ struct icp_drvSessionData *tempSessionData = NULL;
++ int i, remaining_delay_time_in_jiffies = 0;
++ /* There is a possibility of a process or new session command being */
++ /* sent before this variable is incremented. The aim of this variable */
++ /* is to stop a loop of calls creating a deadlock situation which */
++ /* would prevent the driver from exiting. */
++
++ atomic_inc(&icp_ocfDrvIsExiting);
++
++ /*Existing sessions will be routed to another driver after these calls */
++ crypto_unregister_all(icp_ocfDrvDriverId);
++ crypto_runregister_all(icp_ocfDrvDriverId);
++
++ /*If any sessions are waiting to be deregistered, do that. This also
++ flushes the work queue */
++ destroy_workqueue(icp_ocfDrvFreeLacSessionWorkQ);
++
++ /*ENTER CRITICAL SECTION */
++ spin_lock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++ list_for_each_entry_safe(tempSessionData, sessionData,
++ &icp_ocfDrvGlobalSymListHead, listNode) {
++ for (i = 0; i < num_dereg_retries; i++) {
++ /*No harm if bad input - LAC will handle error cases */
++ if (ICP_SESSION_RUNNING == tempSessionData->inUse) {
++ lacStatus =
++ cpaCySymRemoveSession
++ (CPA_INSTANCE_HANDLE_SINGLE,
++ tempSessionData->sessHandle);
++ if (CPA_STATUS_SUCCESS == lacStatus) {
++ /* Succesfully deregistered */
++ break;
++ } else if (CPA_STATUS_RETRY != lacStatus) {
++ atomic_inc
++ (&lac_session_failed_dereg_count);
++ break;
++ }
++
++ /*schedule_timout returns the time left for completion if
++ * this task is set to TASK_INTERRUPTIBLE */
++ remaining_delay_time_in_jiffies =
++ dereg_retry_delay_in_jiffies;
++ while (0 > remaining_delay_time_in_jiffies) {
++ remaining_delay_time_in_jiffies =
++ schedule_timeout
++ (remaining_delay_time_in_jiffies);
++ }
++
++ DPRINTK
++ ("%s(): Retry %d to deregistrate the session\n",
++ __FUNCTION__, i);
++ }
++ }
++
++ /*remove from current list */
++ list_del(&(tempSessionData->listNode));
++ /*add to free mem linked list */
++ list_add(&(tempSessionData->listNode),
++ &icp_ocfDrvGlobalSymListHead_FreeMemList);
++
++ }
++
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ /*set back to initial values */
++ sessionData = NULL;
++ /*still have a reference in our list! */
++ tempSessionData = NULL;
++ /*free memory */
++ list_for_each_entry_safe(tempSessionData, sessionData,
++ &icp_ocfDrvGlobalSymListHead_FreeMemList,
++ listNode) {
++
++ list_del(&(tempSessionData->listNode));
++ /* Free allocated CpaCySymSessionCtx */
++ if (NULL != tempSessionData->sessHandle) {
++ kfree(tempSessionData->sessHandle);
++ }
++ memset(tempSessionData, 0, sizeof(struct icp_drvSessionData));
++ kmem_cache_free(drvSessionData_zone, tempSessionData);
++ }
++
++ if (0 != atomic_read(&lac_session_failed_dereg_count)) {
++ DPRINTK("%s(): %d LAC sessions were not deregistered "
++ "correctly. This is not a clean exit! \n",
++ __FUNCTION__,
++ atomic_read(&lac_session_failed_dereg_count));
++ }
++
++ icp_ocfDrvFreeCaches();
++ icp_ocfDrvDriverId = INVALID_DRIVER_ID;
++
++ /* Shutdown the Cryptographic component */
++ lacStatus = cpaCyStopInstance(CPA_INSTANCE_HANDLE_SINGLE);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ DPRINTK("%s(): Failed to stop instance of the "
++ "Cryptographic component.(status == %d)\n",
++ __FUNCTION__, lacStatus);
++ }
++
++}
++
++/* Name : icp_ocfDrvFreeCaches
++ *
++ * Description : This function deregisters all slab caches
++ */
++static void icp_ocfDrvFreeCaches(void)
++{
++ if (atomic_read(&icp_ocfDrvIsExiting) != CPA_TRUE) {
++ atomic_set(&icp_ocfDrvIsExiting, 1);
++ }
++
++ /*Sym Zones */
++ ICP_CACHE_DESTROY(drvSessionData_zone);
++ ICP_CACHE_DESTROY(drvOpData_zone);
++
++ /*Asym zones */
++ ICP_CACHE_DESTROY(drvDH_zone);
++ ICP_CACHE_DESTROY(drvLnModExp_zone);
++ ICP_CACHE_DESTROY(drvRSADecrypt_zone);
++ ICP_CACHE_DESTROY(drvRSAPrivateKey_zone);
++ ICP_CACHE_DESTROY(drvDSARSSignKValue_zone);
++ ICP_CACHE_DESTROY(drvDSARSSign_zone);
++ ICP_CACHE_DESTROY(drvDSAVerify_zone);
++
++ /*FlatBuffer and BufferList Zones */
++ ICP_CACHE_DESTROY(drvFlatBuffer_zone);
++
++}
++
++/* Name : icp_ocfDrvDeregRetry
++ *
++ * Description : This function will try to farm the session deregistration
++ * off to a work queue. If it fails, nothing more can be done and it
++ * returns an error
++ */
++
++int icp_ocfDrvDeregRetry(CpaCySymSessionCtx sessionToDeregister)
++{
++ struct icp_ocfDrvFreeLacSession *workstore = NULL;
++
++ DPRINTK("%s(): Retry - Deregistering session (%p)\n",
++ __FUNCTION__, sessionToDeregister);
++
++ /*make sure the session is not available to be allocated during this
++ process */
++ atomic_inc(&lac_session_failed_dereg_count);
++
++ /*Farm off to work queue */
++ workstore =
++ kmalloc(sizeof(struct icp_ocfDrvFreeLacSession), GFP_ATOMIC);
++ if (NULL == workstore) {
++ DPRINTK("%s(): unable to free session - no memory available "
++ "for work queue\n", __FUNCTION__);
++ return ENOMEM;
++ }
++
++ workstore->sessionToDeregister = sessionToDeregister;
++
++ INIT_WORK(&(workstore->work), icp_ocfDrvDeferedFreeLacSessionProcess,
++ workstore);
++ queue_work(icp_ocfDrvFreeLacSessionWorkQ, &(workstore->work));
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++
++}
++
++/* Name : icp_ocfDrvDeferedFreeLacSessionProcess
++ *
++ * Description : This function will retry (module input parameter)
++ * 'num_dereg_retries' times to deregister any symmetric session that recieves a
++ * CPA_STATUS_RETRY message from the LAC component. This function is run in
++ * Thread context because it is called from a worker thread
++ */
++static void icp_ocfDrvDeferedFreeLacSessionProcess(void *arg)
++{
++ struct icp_ocfDrvFreeLacSession *workstore = NULL;
++ CpaCySymSessionCtx sessionToDeregister = NULL;
++ int i = 0;
++ int remaining_delay_time_in_jiffies = 0;
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++
++ workstore = (struct icp_ocfDrvFreeLacSession *)arg;
++ if (NULL == workstore) {
++ DPRINTK("%s() function called with null parameter \n",
++ __FUNCTION__);
++ return;
++ }
++
++ sessionToDeregister = workstore->sessionToDeregister;
++ kfree(workstore);
++
++ /*if exiting, give deregistration one more blast only */
++ if (atomic_read(&icp_ocfDrvIsExiting) == CPA_TRUE) {
++ lacStatus = cpaCySymRemoveSession(CPA_INSTANCE_HANDLE_SINGLE,
++ sessionToDeregister);
++
++ if (lacStatus != CPA_STATUS_SUCCESS) {
++ DPRINTK("%s() Failed to Dereg LAC session %p "
++ "during module exit\n", __FUNCTION__,
++ sessionToDeregister);
++ return;
++ }
++
++ atomic_dec(&lac_session_failed_dereg_count);
++ return;
++ }
++
++ for (i = 0; i <= num_dereg_retries; i++) {
++ lacStatus = cpaCySymRemoveSession(CPA_INSTANCE_HANDLE_SINGLE,
++ sessionToDeregister);
++
++ if (lacStatus == CPA_STATUS_SUCCESS) {
++ atomic_dec(&lac_session_failed_dereg_count);
++ return;
++ }
++ if (lacStatus != CPA_STATUS_RETRY) {
++ DPRINTK("%s() Failed to deregister session - lacStatus "
++ " = %d", __FUNCTION__, lacStatus);
++ break;
++ }
++
++ /*schedule_timout returns the time left for completion if this
++ task is set to TASK_INTERRUPTIBLE */
++ remaining_delay_time_in_jiffies = dereg_retry_delay_in_jiffies;
++ while (0 > remaining_delay_time_in_jiffies) {
++ remaining_delay_time_in_jiffies =
++ schedule_timeout(remaining_delay_time_in_jiffies);
++ }
++
++ }
++
++ DPRINTK("%s(): Unable to deregister session\n", __FUNCTION__);
++ DPRINTK("%s(): Number of unavailable LAC sessions = %d\n", __FUNCTION__,
++ atomic_read(&lac_session_failed_dereg_count));
++}
++
++/* Name : icp_ocfDrvPtrAndLenToFlatBuffer
++ *
++ * Description : This function converts a "pointer and length" buffer
++ * structure to Fredericksburg Flat Buffer (CpaFlatBuffer) format.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++inline void
++icp_ocfDrvPtrAndLenToFlatBuffer(void *pData, uint32_t len,
++ CpaFlatBuffer * pFlatBuffer)
++{
++ pFlatBuffer->pData = pData;
++ pFlatBuffer->dataLenInBytes = len;
++}
++
++/* Name : icp_ocfDrvSingleSkBuffToFlatBuffer
++ *
++ * Description : This function converts a single socket buffer (sk_buff)
++ * structure to a Fredericksburg Flat Buffer (CpaFlatBuffer) format.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++static inline void
++icp_ocfDrvSingleSkBuffToFlatBuffer(struct sk_buff *pSkb,
++ CpaFlatBuffer * pFlatBuffer)
++{
++ pFlatBuffer->pData = pSkb->data;
++ pFlatBuffer->dataLenInBytes = skb_headlen(pSkb);
++}
++
++/* Name : icp_ocfDrvSkBuffToBufferList
++ *
++ * Description : This function converts a socket buffer (sk_buff) structure to
++ * Fredericksburg Scatter/Gather (CpaBufferList) buffer format.
++ *
++ * This function assumes that the bufferlist has been allocated with the correct
++ * number of buffer arrays.
++ *
++ */
++inline int
++icp_ocfDrvSkBuffToBufferList(struct sk_buff *pSkb, CpaBufferList * bufferList)
++{
++ CpaFlatBuffer *curFlatBuffer = NULL;
++ char *skbuffPageAddr = NULL;
++ struct sk_buff *pCurFrag = NULL;
++ struct skb_shared_info *pShInfo = NULL;
++ uint32_t page_offset = 0, i = 0;
++
++ DPRINTK("%s(): Entry Point\n", __FUNCTION__);
++
++ /*
++ * In all cases, the first skb needs to be translated to FlatBuffer.
++ * Perform a buffer translation for the first skbuff
++ */
++ curFlatBuffer = bufferList->pBuffers;
++ icp_ocfDrvSingleSkBuffToFlatBuffer(pSkb, curFlatBuffer);
++
++ /* Set the userData to point to the original sk_buff */
++ bufferList->pUserData = (void *)pSkb;
++
++ /* We now know we'll have at least one element in the SGL */
++ bufferList->numBuffers = 1;
++
++ if (0 == skb_is_nonlinear(pSkb)) {
++ /* Is a linear buffer - therefore it's a single skbuff */
++ DPRINTK("%s(): Exit Point\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++ }
++
++ curFlatBuffer++;
++ pShInfo = skb_shinfo(pSkb);
++ if (pShInfo->frag_list != NULL && pShInfo->nr_frags != 0) {
++ EPRINTK("%s():"
++ "Translation for a combination of frag_list "
++ "and frags[] array not supported!\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ } else if (pShInfo->frag_list != NULL) {
++ /*
++ * Non linear skbuff supported through frag_list
++ * Perform translation for each fragment (sk_buff)
++ * in the frag_list of the first sk_buff.
++ */
++ for (pCurFrag = pShInfo->frag_list;
++ pCurFrag != NULL; pCurFrag = pCurFrag->next) {
++ icp_ocfDrvSingleSkBuffToFlatBuffer(pCurFrag,
++ curFlatBuffer);
++ curFlatBuffer++;
++ bufferList->numBuffers++;
++ }
++ } else if (pShInfo->nr_frags != 0) {
++ /*
++ * Perform translation for each fragment in frags array
++ * and add to the BufferList
++ */
++ for (i = 0; i < pShInfo->nr_frags; i++) {
++ /* Get the page address and offset of this frag */
++ skbuffPageAddr = (char *)pShInfo->frags[i].page;
++ page_offset = pShInfo->frags[i].page_offset;
++
++ /* Convert a pointer and length to a flat buffer */
++ icp_ocfDrvPtrAndLenToFlatBuffer(skbuffPageAddr +
++ page_offset,
++ pShInfo->frags[i].size,
++ curFlatBuffer);
++ curFlatBuffer++;
++ bufferList->numBuffers++;
++ }
++ } else {
++ EPRINTK("%s():" "Could not recognize skbuff fragments!\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ DPRINTK("%s(): Exit Point\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvBufferListToSkBuff
++ *
++ * Description : This function converts a Fredericksburg Scatter/Gather
++ * (CpaBufferList) buffer format to socket buffer structure.
++ */
++inline int
++icp_ocfDrvBufferListToSkBuff(CpaBufferList * bufferList, struct sk_buff **skb)
++{
++ DPRINTK("%s(): Entry Point\n", __FUNCTION__);
++
++ /* Retrieve the orignal skbuff */
++ *skb = (struct sk_buff *)bufferList->pUserData;
++ if (NULL == *skb) {
++ EPRINTK("%s():"
++ "Error on converting from a BufferList. "
++ "The BufferList does not contain an sk_buff.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++ DPRINTK("%s(): Exit Point\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvPtrAndLenToBufferList
++ *
++ * Description : This function converts a "pointer and length" buffer
++ * structure to Fredericksburg Scatter/Gather Buffer (CpaBufferList) format.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++inline void
++icp_ocfDrvPtrAndLenToBufferList(void *pDataIn, uint32_t length,
++ CpaBufferList * pBufferList)
++{
++ pBufferList->numBuffers = 1;
++ pBufferList->pBuffers->pData = pDataIn;
++ pBufferList->pBuffers->dataLenInBytes = length;
++}
++
++/* Name : icp_ocfDrvBufferListToPtrAndLen
++ *
++ * Description : This function converts Fredericksburg Scatter/Gather Buffer
++ * (CpaBufferList) format to a "pointer and length" buffer structure.
++ *
++ * This function assumes that the data passed in are valid.
++ */
++inline void
++icp_ocfDrvBufferListToPtrAndLen(CpaBufferList * pBufferList,
++ void **ppDataOut, uint32_t * pLength)
++{
++ *ppDataOut = pBufferList->pBuffers->pData;
++ *pLength = pBufferList->pBuffers->dataLenInBytes;
++}
++
++/* Name : icp_ocfDrvBufferListMemInfo
++ *
++ * Description : This function will set the number of flat buffers in
++ * bufferlist, the size of memory to allocate for the pPrivateMetaData
++ * member of the CpaBufferList.
++ */
++int
++icp_ocfDrvBufferListMemInfo(uint16_t numBuffers,
++ struct icp_drvBuffListInfo *buffListInfo)
++{
++ buffListInfo->numBuffers = numBuffers;
++
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyBufferListGetMetaSize(CPA_INSTANCE_HANDLE_SINGLE,
++ buffListInfo->numBuffers,
++ &(buffListInfo->metaSize))) {
++ EPRINTK("%s() Failed to get buffer list meta size.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvGetSkBuffFrags
++ *
++ * Description : This function will determine the number of
++ * fragments in a socket buffer(sk_buff).
++ */
++inline uint16_t icp_ocfDrvGetSkBuffFrags(struct sk_buff * pSkb)
++{
++ uint16_t numFrags = 0;
++ struct sk_buff *pCurFrag = NULL;
++ struct skb_shared_info *pShInfo = NULL;
++
++ if (NULL == pSkb)
++ return 0;
++
++ numFrags = 1;
++ if (0 == skb_is_nonlinear(pSkb)) {
++ /* Linear buffer - it's a single skbuff */
++ return numFrags;
++ }
++
++ pShInfo = skb_shinfo(pSkb);
++ if (NULL != pShInfo->frag_list && 0 != pShInfo->nr_frags) {
++ EPRINTK("%s(): Combination of frag_list "
++ "and frags[] array not supported!\n", __FUNCTION__);
++ return 0;
++ } else if (0 != pShInfo->nr_frags) {
++ numFrags += pShInfo->nr_frags;
++ return numFrags;
++ } else if (NULL != pShInfo->frag_list) {
++ for (pCurFrag = pShInfo->frag_list;
++ pCurFrag != NULL; pCurFrag = pCurFrag->next) {
++ numFrags++;
++ }
++ return numFrags;
++ } else {
++ return 0;
++ }
++}
++
++/* Name : icp_ocfDrvFreeFlatBuffer
++ *
++ * Description : This function will deallocate flat buffer.
++ */
++inline void icp_ocfDrvFreeFlatBuffer(CpaFlatBuffer * pFlatBuffer)
++{
++ if (pFlatBuffer != NULL) {
++ memset(pFlatBuffer, 0, sizeof(CpaFlatBuffer));
++ kmem_cache_free(drvFlatBuffer_zone, pFlatBuffer);
++ }
++}
++
++/* Name : icp_ocfDrvAllocMetaData
++ *
++ * Description : This function will allocate memory for the
++ * pPrivateMetaData member of CpaBufferList.
++ */
++inline int
++icp_ocfDrvAllocMetaData(CpaBufferList * pBufferList,
++ const struct icp_drvOpData *pOpData)
++{
++ Cpa32U metaSize = 0;
++
++ if (pBufferList->numBuffers <= ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS){
++ void *pOpDataStartAddr = (void *)pOpData;
++
++ if (0 == defBuffListInfo.metaSize) {
++ pBufferList->pPrivateMetaData = NULL;
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++ }
++ /*
++ * The meta data allocation has been included as part of the
++ * op data. It has been pre-allocated in memory just after the
++ * icp_drvOpData structure.
++ */
++ pBufferList->pPrivateMetaData = pOpDataStartAddr +
++ sizeof(struct icp_drvOpData);
++ } else {
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyBufferListGetMetaSize(CPA_INSTANCE_HANDLE_SINGLE,
++ pBufferList->numBuffers,
++ &metaSize)) {
++ EPRINTK("%s() Failed to get buffer list meta size.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ if (0 == metaSize) {
++ pBufferList->pPrivateMetaData = NULL;
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++ }
++
++ pBufferList->pPrivateMetaData = kmalloc(metaSize, GFP_ATOMIC);
++ }
++ if (NULL == pBufferList->pPrivateMetaData) {
++ EPRINTK("%s() Failed to allocate pPrivateMetaData.\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvFreeMetaData
++ *
++ * Description : This function will deallocate pPrivateMetaData memory.
++ */
++inline void icp_ocfDrvFreeMetaData(CpaBufferList * pBufferList)
++{
++ if (NULL == pBufferList->pPrivateMetaData) {
++ return;
++ }
++
++ /*
++ * Only free the meta data if the BufferList has more than
++ * ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS number of buffers.
++ * Otherwise, the meta data shall be freed when the icp_drvOpData is
++ * freed.
++ */
++ if (ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS < pBufferList->numBuffers){
++ kfree(pBufferList->pPrivateMetaData);
++ }
++}
++
++module_init(icp_ocfDrvInit);
++module_exit(icp_ocfDrvExit);
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("Intel");
++MODULE_DESCRIPTION("OCF Driver for Intel Quick Assist crypto acceleration");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_ocf.h linux-2.6.29.1/crypto/ocf/ep80579/icp_ocf.h
+--- linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_ocf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ep80579/icp_ocf.h 2009-04-20 20:01:21.436552036 +0200
+@@ -0,0 +1,363 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++
++/*
++ * OCF drv driver header file for the Intel ICP processor.
++ */
++
++#ifndef ICP_OCF_H
++#define ICP_OCF_H
++
++#include <linux/crypto.h>
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++
++#include "cryptodev.h"
++#include "uio.h"
++
++#include "cpa.h"
++#include "cpa_cy_im.h"
++#include "cpa_cy_sym.h"
++#include "cpa_cy_rand.h"
++#include "cpa_cy_dh.h"
++#include "cpa_cy_rsa.h"
++#include "cpa_cy_ln.h"
++#include "cpa_cy_common.h"
++#include "cpa_cy_dsa.h"
++
++#define NUM_BITS_IN_BYTE (8)
++#define NUM_BITS_IN_BYTE_MINUS_ONE (NUM_BITS_IN_BYTE -1)
++#define INVALID_DRIVER_ID (-1)
++#define RETURN_RAND_NUM_GEN_FAILED (-1)
++
++/*This is define means only one operation can be chained to another
++(resulting in one chain of two operations)*/
++#define MAX_NUM_OF_CHAINED_OPS (1)
++/*This is the max block cipher initialisation vector*/
++#define MAX_IV_LEN_IN_BYTES (20)
++/*This is used to check whether the OCF to this driver session limit has
++ been disabled*/
++#define NO_OCF_TO_DRV_MAX_SESSIONS (0)
++
++/*OCF values mapped here*/
++#define ICP_SHA1_DIGEST_SIZE_IN_BYTES (SHA1_HASH_LEN)
++#define ICP_SHA256_DIGEST_SIZE_IN_BYTES (SHA2_256_HASH_LEN)
++#define ICP_SHA384_DIGEST_SIZE_IN_BYTES (SHA2_384_HASH_LEN)
++#define ICP_SHA512_DIGEST_SIZE_IN_BYTES (SHA2_512_HASH_LEN)
++#define ICP_MD5_DIGEST_SIZE_IN_BYTES (MD5_HASH_LEN)
++#define ARC4_COUNTER_LEN (ARC4_BLOCK_LEN)
++
++#define OCF_REGISTRATION_STATUS_SUCCESS (0)
++#define OCF_ZERO_FUNCTIONALITY_REGISTERED (0)
++#define ICP_OCF_DRV_NO_CRYPTO_PROCESS_ERROR (0)
++#define ICP_OCF_DRV_STATUS_SUCCESS (0)
++#define ICP_OCF_DRV_STATUS_FAIL (1)
++
++/*Turn on/off debug options*/
++#define ICP_OCF_PRINT_DEBUG_MESSAGES (0)
++#define ICP_OCF_PRINT_KERN_ALERT (1)
++#define ICP_OCF_PRINT_KERN_ERRS (1)
++
++/*DSA Prime Q size in bytes (as defined in the standard) */
++#define DSA_RS_SIGN_PRIMEQ_SIZE_IN_BYTES (20)
++
++/*MACRO DEFINITIONS*/
++
++#define BITS_TO_BYTES(bytes, bits) \
++ bytes = (bits + NUM_BITS_IN_BYTE_MINUS_ONE) / NUM_BITS_IN_BYTE
++
++#define ICP_CACHE_CREATE(cache_ID, cache_name) \
++ kmem_cache_create(cache_ID, sizeof(cache_name),0, \
++ SLAB_HWCACHE_ALIGN, NULL, NULL);
++
++#define ICP_CACHE_NULL_CHECK(slab_zone) \
++{ \
++ if(NULL == slab_zone){ \
++ icp_ocfDrvFreeCaches(); \
++ EPRINTK("%s() line %d: Not enough memory!\n", \
++ __FUNCTION__, __LINE__); \
++ return ENOMEM; \
++ } \
++}
++
++#define ICP_CACHE_DESTROY(slab_zone) \
++{ \
++ if(NULL != slab_zone){ \
++ kmem_cache_destroy(slab_zone); \
++ slab_zone = NULL; \
++ } \
++}
++
++#define ICP_REGISTER_SYM_FUNCTIONALITY_WITH_OCF(alg) \
++{ \
++ if(OCF_REGISTRATION_STATUS_SUCCESS == \
++ crypto_register(icp_ocfDrvDriverId, \
++ alg, \
++ 0, \
++ 0)) { \
++ ocfStatus++; \
++ } \
++}
++
++#define ICP_REGISTER_ASYM_FUNCTIONALITY_WITH_OCF(alg) \
++{ \
++ if(OCF_REGISTRATION_STATUS_SUCCESS == \
++ crypto_kregister(icp_ocfDrvDriverId, \
++ alg, \
++ 0)){ \
++ ocfStatus++; \
++ } \
++}
++
++#if ICP_OCF_PRINT_DEBUG_MESSAGES == 1
++#define DPRINTK(args...) \
++{ \
++ printk(args); \
++}
++
++#else //ICP_OCF_PRINT_DEBUG_MESSAGES == 1
++
++#define DPRINTK(args...)
++
++#endif //ICP_OCF_PRINT_DEBUG_MESSAGES == 1
++
++#if ICP_OCF_PRINT_KERN_ALERT == 1
++#define APRINTK(args...) \
++{ \
++ printk(KERN_ALERT args); \
++}
++
++#else //ICP_OCF_PRINT_KERN_ALERT == 1
++
++#define APRINTK(args...)
++
++#endif //ICP_OCF_PRINT_KERN_ALERT == 1
++
++#if ICP_OCF_PRINT_KERN_ERRS == 1
++#define EPRINTK(args...) \
++{ \
++ printk(KERN_ERR args); \
++}
++
++#else //ICP_OCF_PRINT_KERN_ERRS == 1
++
++#define EPRINTK(args...)
++
++#endif //ICP_OCF_PRINT_KERN_ERRS == 1
++
++#define IPRINTK(args...) \
++{ \
++ printk(KERN_INFO args); \
++}
++
++/*END OF MACRO DEFINITIONS*/
++
++typedef enum {
++ ICP_OCF_DRV_ALG_CIPHER = 0,
++ ICP_OCF_DRV_ALG_HASH
++} icp_ocf_drv_alg_type_t;
++
++/* These are all defined in icp_common.c */
++extern atomic_t lac_session_failed_dereg_count;
++extern atomic_t icp_ocfDrvIsExiting;
++extern atomic_t num_ocf_to_drv_registered_sessions;
++
++/*These are use inputs used in icp_sym.c and icp_common.c
++ They are instantiated in icp_common.c*/
++extern int max_sessions;
++
++extern int32_t icp_ocfDrvDriverId;
++extern struct list_head icp_ocfDrvGlobalSymListHead;
++extern struct list_head icp_ocfDrvGlobalSymListHead_FreeMemList;
++extern struct workqueue_struct *icp_ocfDrvFreeLacSessionWorkQ;
++extern spinlock_t icp_ocfDrvSymSessInfoListSpinlock;
++extern rwlock_t icp_kmem_cache_destroy_alloc_lock;
++
++/*Slab zones for symettric functionality, instantiated in icp_common.c*/
++extern struct kmem_cache *drvSessionData_zone;
++extern struct kmem_cache *drvOpData_zone;
++
++/*Slabs zones for asymettric functionality, instantiated in icp_common.c*/
++extern struct kmem_cache *drvDH_zone;
++extern struct kmem_cache *drvLnModExp_zone;
++extern struct kmem_cache *drvRSADecrypt_zone;
++extern struct kmem_cache *drvRSAPrivateKey_zone;
++extern struct kmem_cache *drvDSARSSign_zone;
++extern struct kmem_cache *drvDSARSSignKValue_zone;
++extern struct kmem_cache *drvDSAVerify_zone;
++
++/*Slab zones for flatbuffers and bufferlist*/
++extern struct kmem_cache *drvFlatBuffer_zone;
++
++#define ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS (16)
++
++struct icp_drvBuffListInfo {
++ Cpa16U numBuffers;
++ Cpa32U metaSize;
++ Cpa32U metaOffset;
++ Cpa32U buffListSize;
++};
++extern struct icp_drvBuffListInfo defBuffListInfo;
++
++/*
++* This struct is used to keep a reference to the relevant node in the list
++* of sessionData structs, to the buffer type required by OCF and to the OCF
++* provided crp struct that needs to be returned. All this info is needed in
++* the callback function.
++*
++* IV can sometimes be stored in non-contiguous memory (e.g. skbuff
++* linked/frag list, therefore a contiguous memory space for the IV data must be
++* created and passed to LAC
++*
++*/
++struct icp_drvOpData {
++ CpaCySymOpData lacOpData;
++ uint32_t digestSizeInBytes;
++ struct cryptop *crp;
++ uint8_t bufferType;
++ uint8_t ivData[MAX_IV_LEN_IN_BYTES];
++ uint16_t numBufferListArray;
++ CpaBufferList srcBuffer;
++ CpaFlatBuffer bufferListArray[ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS];
++ CpaBoolean verifyResult;
++};
++/*Values used to derisk chances of performs being called against
++deregistered sessions (for which the slab page has been reclaimed)
++This is not a fix - since page frames are reclaimed from a slab, one cannot
++rely on that memory not being re-used by another app.*/
++typedef enum {
++ ICP_SESSION_INITIALISED = 0x5C5C5C,
++ ICP_SESSION_RUNNING = 0x005C00,
++ ICP_SESSION_DEREGISTERED = 0xC5C5C5
++} usage_derisk;
++
++/*
++This is the OCF<->OCF_DRV session object:
++
++1.The first member is a listNode. These session objects are added to a linked
++ list in order to make it easier to remove them all at session exit time.
++2.The second member is used to give the session object state and derisk the
++ possibility of OCF batch calls executing against a deregistered session (as
++ described above).
++3.The third member is a LAC<->OCF_DRV session handle (initialised with the first
++ perform request for that session).
++4.The fourth is the LAC session context. All the parameters for this structure
++ are only known when the first perform request for this session occurs. That is
++ why the OCF Tolapai Driver only registers a new LAC session at perform time
++*/
++struct icp_drvSessionData {
++ struct list_head listNode;
++ usage_derisk inUse;
++ CpaCySymSessionCtx sessHandle;
++ CpaCySymSessionSetupData lacSessCtx;
++};
++
++/* This struct is required for deferred session
++ deregistration as a work queue function can
++ only have one argument*/
++struct icp_ocfDrvFreeLacSession {
++ CpaCySymSessionCtx sessionToDeregister;
++ struct work_struct work;
++};
++
++int icp_ocfDrvNewSession(device_t dev, uint32_t * sild, struct cryptoini *cri);
++
++int icp_ocfDrvFreeLACSession(device_t dev, uint64_t sid);
++
++int icp_ocfDrvSymProcess(device_t dev, struct cryptop *crp, int hint);
++
++int icp_ocfDrvPkeProcess(device_t dev, struct cryptkop *krp, int hint);
++
++int icp_ocfDrvReadRandom(void *arg, uint32_t * buf, int maxwords);
++
++int icp_ocfDrvDeregRetry(CpaCySymSessionCtx sessionToDeregister);
++
++int icp_ocfDrvSkBuffToBufferList(struct sk_buff *skb,
++ CpaBufferList * bufferList);
++
++int icp_ocfDrvBufferListToSkBuff(CpaBufferList * bufferList,
++ struct sk_buff **skb);
++
++void icp_ocfDrvPtrAndLenToFlatBuffer(void *pData, uint32_t len,
++ CpaFlatBuffer * pFlatBuffer);
++
++void icp_ocfDrvPtrAndLenToBufferList(void *pDataIn, uint32_t length,
++ CpaBufferList * pBufferList);
++
++void icp_ocfDrvBufferListToPtrAndLen(CpaBufferList * pBufferList,
++ void **ppDataOut, uint32_t * pLength);
++
++int icp_ocfDrvBufferListMemInfo(uint16_t numBuffers,
++ struct icp_drvBuffListInfo *buffListInfo);
++
++uint16_t icp_ocfDrvGetSkBuffFrags(struct sk_buff *pSkb);
++
++void icp_ocfDrvFreeFlatBuffer(CpaFlatBuffer * pFlatBuffer);
++
++int icp_ocfDrvAllocMetaData(CpaBufferList * pBufferList,
++ const struct icp_drvOpData *pOpData);
++
++void icp_ocfDrvFreeMetaData(CpaBufferList * pBufferList);
++
++#endif
++/* ICP_OCF_H */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_sym.c linux-2.6.29.1/crypto/ocf/ep80579/icp_sym.c
+--- linux-2.6.29.1.orig/crypto/ocf/ep80579/icp_sym.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ep80579/icp_sym.c 2009-04-20 20:01:21.464554764 +0200
+@@ -0,0 +1,1382 @@
++/***************************************************************************
++ *
++ * This file is provided under a dual BSD/GPLv2 license. When using or
++ * redistributing this file, you may do so under either license.
++ *
++ * GPL LICENSE SUMMARY
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
++ * The full GNU General Public License is included in this distribution
++ * in the file called LICENSE.GPL.
++ *
++ * Contact Information:
++ * Intel Corporation
++ *
++ * BSD LICENSE
++ *
++ * Copyright(c) 2007,2008 Intel Corporation. All rights reserved.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * * Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * * Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ * * Neither the name of Intel Corporation nor the names of its
++ * contributors may be used to endorse or promote products derived
++ * from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ *
++ * version: Security.L.1.0.130
++ *
++ ***************************************************************************/
++/*
++ * An OCF module that uses the API for Intel® QuickAssist Technology to do the
++ * cryptography.
++ *
++ * This driver requires the ICP Access Library that is available from Intel in
++ * order to operate.
++ */
++
++#include "icp_ocf.h"
++
++/*This is the call back function for all symmetric cryptographic processes.
++ Its main functionality is to free driver crypto operation structure and to
++ call back to OCF*/
++static void
++icp_ocfDrvSymCallBack(void *callbackTag,
++ CpaStatus status,
++ const CpaCySymOp operationType,
++ void *pOpData,
++ CpaBufferList * pDstBuffer, CpaBoolean verifyResult);
++
++/*This function is used to extract crypto processing information from the OCF
++ inputs, so as that it may be passed onto LAC*/
++static int
++icp_ocfDrvProcessDataSetup(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc);
++
++/*This function checks whether the crp_desc argument pertains to a digest or a
++ cipher operation*/
++static int icp_ocfDrvAlgCheck(struct cryptodesc *crp_desc);
++
++/*This function copies all the passed in session context information and stores
++ it in a LAC context structure*/
++static int
++icp_ocfDrvAlgorithmSetup(struct cryptoini *cri,
++ CpaCySymSessionSetupData * lacSessCtx);
++
++/*This top level function is used to find a pointer to where a digest is
++ stored/needs to be inserted. */
++static uint8_t *icp_ocfDrvDigestPointerFind(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc);
++
++/*This function is called when a digest pointer has to be found within a
++ SKBUFF.*/
++static inline uint8_t *icp_ocfDrvSkbuffDigestPointerFind(struct icp_drvOpData
++ *drvOpData,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes);
++
++/*The following two functions are called if the SKBUFF digest pointer is not
++ positioned in the linear portion of the buffer (i.e. it is in a linked SKBUFF
++ or page fragment).*/
++/*This function takes care of the page fragment case.*/
++static inline uint8_t *icp_ocfDrvDigestSkbNRFragsCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes);
++
++/*This function takes care of the linked list case.*/
++static inline uint8_t *icp_ocfDrvDigestSkbFragListCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes);
++
++/*This function is used to free an OCF->OCF_DRV session object*/
++static void icp_ocfDrvFreeOCFSession(struct icp_drvSessionData *sessionData);
++
++/*max IOV buffs supported in a UIO structure*/
++#define NUM_IOV_SUPPORTED (1)
++
++/* Name : icp_ocfDrvSymCallBack
++ *
++ * Description : When this function returns it signifies that the LAC
++ * component has completed the relevant symmetric operation.
++ *
++ * Notes : The callbackTag is a pointer to an icp_drvOpData. This memory
++ * object was passed to LAC for the cryptographic processing and contains all
++ * the relevant information for cleaning up buffer handles etc. so that the
++ * OCF Tolapai Driver portion of this crypto operation can be fully completed.
++ */
++static void
++icp_ocfDrvSymCallBack(void *callbackTag,
++ CpaStatus status,
++ const CpaCySymOp operationType,
++ void *pOpData,
++ CpaBufferList * pDstBuffer, CpaBoolean verifyResult)
++{
++ struct cryptop *crp = NULL;
++ struct icp_drvOpData *temp_drvOpData =
++ (struct icp_drvOpData *)callbackTag;
++ uint64_t *tempBasePtr = NULL;
++ uint32_t tempLen = 0;
++
++ if (NULL == temp_drvOpData) {
++ DPRINTK("%s(): The callback from the LAC component"
++ " has failed due to Null userOpaque data"
++ "(status == %d).\n", __FUNCTION__, status);
++ DPRINTK("%s(): Unable to call OCF back! \n", __FUNCTION__);
++ return;
++ }
++
++ crp = temp_drvOpData->crp;
++ crp->crp_etype = ICP_OCF_DRV_NO_CRYPTO_PROCESS_ERROR;
++
++ if (NULL == pOpData) {
++ DPRINTK("%s(): The callback from the LAC component"
++ " has failed due to Null Symmetric Op data"
++ "(status == %d).\n", __FUNCTION__, status);
++ crp->crp_etype = ECANCELED;
++ crypto_done(crp);
++ return;
++ }
++
++ if (NULL == pDstBuffer) {
++ DPRINTK("%s(): The callback from the LAC component"
++ " has failed due to Null Dst Bufferlist data"
++ "(status == %d).\n", __FUNCTION__, status);
++ crp->crp_etype = ECANCELED;
++ crypto_done(crp);
++ return;
++ }
++
++ if (CPA_STATUS_SUCCESS == status) {
++
++ if (temp_drvOpData->bufferType == CRYPTO_F_SKBUF) {
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvBufferListToSkBuff(pDstBuffer,
++ (struct sk_buff **)
++ &(crp->crp_buf))) {
++ EPRINTK("%s(): BufferList to SkBuff "
++ "conversion error.\n", __FUNCTION__);
++ crp->crp_etype = EPERM;
++ }
++ } else {
++ icp_ocfDrvBufferListToPtrAndLen(pDstBuffer,
++ (void **)&tempBasePtr,
++ &tempLen);
++ crp->crp_olen = (int)tempLen;
++ }
++
++ } else {
++ DPRINTK("%s(): The callback from the LAC component has failed"
++ "(status == %d).\n", __FUNCTION__, status);
++
++ crp->crp_etype = ECANCELED;
++ }
++
++ if (temp_drvOpData->numBufferListArray >
++ ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS) {
++ kfree(pDstBuffer->pBuffers);
++ }
++ icp_ocfDrvFreeMetaData(pDstBuffer);
++ kmem_cache_free(drvOpData_zone, temp_drvOpData);
++
++ /* Invoke the OCF callback function */
++ crypto_done(crp);
++
++ return;
++}
++
++/* Name : icp_ocfDrvNewSession
++ *
++ * Description : This function will create a new Driver<->OCF session
++ *
++ * Notes : LAC session registration happens during the first perform call.
++ * That is the first time we know all information about a given session.
++ */
++int icp_ocfDrvNewSession(device_t dev, uint32_t * sid, struct cryptoini *cri)
++{
++ struct icp_drvSessionData *sessionData = NULL;
++ uint32_t delete_session = 0;
++
++ /* The SID passed in should be our driver ID. We can return the */
++ /* local ID (LID) which is a unique identifier which we can use */
++ /* to differentiate between the encrypt/decrypt LAC session handles */
++ if (NULL == sid) {
++ EPRINTK("%s(): Invalid input parameters - NULL sid.\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ if (NULL == cri) {
++ EPRINTK("%s(): Invalid input parameters - NULL cryptoini.\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ if (icp_ocfDrvDriverId != *sid) {
++ EPRINTK("%s(): Invalid input parameters - bad driver ID\n",
++ __FUNCTION__);
++ EPRINTK("\t sid = 0x08%p \n \t cri = 0x08%p \n", sid, cri);
++ return EINVAL;
++ }
++
++ sessionData = kmem_cache_zalloc(drvSessionData_zone, GFP_ATOMIC);
++ if (NULL == sessionData) {
++ DPRINTK("%s():No memory for Session Data\n", __FUNCTION__);
++ return ENOMEM;
++ }
++
++ /*ENTER CRITICAL SECTION */
++ spin_lock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++ /*put this check in the spinlock so no new sessions can be added to the
++ linked list when we are exiting */
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ delete_session++;
++
++ } else if (NO_OCF_TO_DRV_MAX_SESSIONS != max_sessions) {
++ if (atomic_read(&num_ocf_to_drv_registered_sessions) >=
++ (max_sessions -
++ atomic_read(&lac_session_failed_dereg_count))) {
++ delete_session++;
++ } else {
++ atomic_inc(&num_ocf_to_drv_registered_sessions);
++ /* Add to session data linked list */
++ list_add(&(sessionData->listNode),
++ &icp_ocfDrvGlobalSymListHead);
++ }
++
++ } else if (NO_OCF_TO_DRV_MAX_SESSIONS == max_sessions) {
++ list_add(&(sessionData->listNode),
++ &icp_ocfDrvGlobalSymListHead);
++ }
++
++ sessionData->inUse = ICP_SESSION_INITIALISED;
++
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ if (delete_session) {
++ DPRINTK("%s():No Session handles available\n", __FUNCTION__);
++ kmem_cache_free(drvSessionData_zone, sessionData);
++ return EPERM;
++ }
++
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvAlgorithmSetup(cri, &(sessionData->lacSessCtx))) {
++ DPRINTK("%s():algorithm not supported\n", __FUNCTION__);
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return EINVAL;
++ }
++
++ if (cri->cri_next) {
++ if (cri->cri_next->cri_next != NULL) {
++ DPRINTK("%s():only two chained algorithms supported\n",
++ __FUNCTION__);
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return EPERM;
++ }
++
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvAlgorithmSetup(cri->cri_next,
++ &(sessionData->lacSessCtx))) {
++ DPRINTK("%s():second algorithm not supported\n",
++ __FUNCTION__);
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return EINVAL;
++ }
++
++ sessionData->lacSessCtx.symOperation =
++ CPA_CY_SYM_OP_ALGORITHM_CHAINING;
++ }
++
++ *sid = (uint32_t) sessionData;
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvAlgorithmSetup
++ *
++ * Description : This function builds the session context data from the
++ * information supplied through OCF. Algorithm chain order and whether the
++ * session is Encrypt/Decrypt can only be found out at perform time however, so
++ * the session is registered with LAC at that time.
++ */
++static int
++icp_ocfDrvAlgorithmSetup(struct cryptoini *cri,
++ CpaCySymSessionSetupData * lacSessCtx)
++{
++
++ lacSessCtx->sessionPriority = CPA_CY_PRIORITY_NORMAL;
++
++ switch (cri->cri_alg) {
++
++ case CRYPTO_NULL_CBC:
++ DPRINTK("%s(): NULL CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_NULL;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_DES_CBC:
++ DPRINTK("%s(): DES CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_DES_CBC;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_3DES_CBC:
++ DPRINTK("%s(): 3DES CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_3DES_CBC;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_AES_CBC:
++ DPRINTK("%s(): AES CBC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_AES_CBC;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_ARC4:
++ DPRINTK("%s(): ARC4\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_CIPHER;
++ lacSessCtx->cipherSetupData.cipherAlgorithm =
++ CPA_CY_SYM_CIPHER_ARC4;
++ lacSessCtx->cipherSetupData.cipherKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->cipherSetupData.pCipherKey = cri->cri_key;
++ break;
++
++ case CRYPTO_SHA1:
++ DPRINTK("%s(): SHA1\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_SHA1;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA1_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA1_HMAC:
++ DPRINTK("%s(): SHA1_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_SHA1;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA1_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_SHA2_256:
++ DPRINTK("%s(): SHA256\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA256;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA256_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA2_256_HMAC:
++ DPRINTK("%s(): SHA256_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA256;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA256_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_SHA2_384:
++ DPRINTK("%s(): SHA384\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA384;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA384_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA2_384_HMAC:
++ DPRINTK("%s(): SHA384_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA384;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA384_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_SHA2_512:
++ DPRINTK("%s(): SHA512\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA512;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA512_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_SHA2_512_HMAC:
++ DPRINTK("%s(): SHA512_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm =
++ CPA_CY_SYM_HASH_SHA512;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_SHA512_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ case CRYPTO_MD5:
++ DPRINTK("%s(): MD5\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_MD5;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_PLAIN;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_MD5_DIGEST_SIZE_IN_BYTES);
++
++ break;
++
++ case CRYPTO_MD5_HMAC:
++ DPRINTK("%s(): MD5_HMAC\n", __FUNCTION__);
++ lacSessCtx->symOperation = CPA_CY_SYM_OP_HASH;
++ lacSessCtx->hashSetupData.hashAlgorithm = CPA_CY_SYM_HASH_MD5;
++ lacSessCtx->hashSetupData.hashMode = CPA_CY_SYM_HASH_MODE_AUTH;
++ lacSessCtx->hashSetupData.digestResultLenInBytes =
++ (cri->cri_mlen ?
++ cri->cri_mlen : ICP_MD5_DIGEST_SIZE_IN_BYTES);
++ lacSessCtx->hashSetupData.authModeSetupData.authKey =
++ cri->cri_key;
++ lacSessCtx->hashSetupData.authModeSetupData.authKeyLenInBytes =
++ cri->cri_klen / NUM_BITS_IN_BYTE;
++ lacSessCtx->hashSetupData.authModeSetupData.aadLenInBytes = 0;
++
++ break;
++
++ default:
++ DPRINTK("%s(): ALG Setup FAIL\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvFreeOCFSession
++ *
++ * Description : This function deletes all existing Session data representing
++ * the Cryptographic session established between OCF and this driver. This
++ * also includes freeing the memory allocated for the session context. The
++ * session object is also removed from the session linked list.
++ */
++static void icp_ocfDrvFreeOCFSession(struct icp_drvSessionData *sessionData)
++{
++
++ sessionData->inUse = ICP_SESSION_DEREGISTERED;
++
++ /*ENTER CRITICAL SECTION */
++ spin_lock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ /*If the Driver is exiting, allow that process to
++ handle any deletions */
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++ return;
++ }
++
++ atomic_dec(&num_ocf_to_drv_registered_sessions);
++
++ list_del(&(sessionData->listNode));
++
++ /*EXIT CRITICAL SECTION */
++ spin_unlock_bh(&icp_ocfDrvSymSessInfoListSpinlock);
++
++ if (NULL != sessionData->sessHandle) {
++ kfree(sessionData->sessHandle);
++ }
++ kmem_cache_free(drvSessionData_zone, sessionData);
++}
++
++/* Name : icp_ocfDrvFreeLACSession
++ *
++ * Description : This attempts to deregister a LAC session. If it fails, the
++ * deregistation retry function is called.
++ */
++int icp_ocfDrvFreeLACSession(device_t dev, uint64_t sid)
++{
++ CpaCySymSessionCtx sessionToDeregister = NULL;
++ struct icp_drvSessionData *sessionData = NULL;
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ int retval = 0;
++
++ sessionData = (struct icp_drvSessionData *)CRYPTO_SESID2LID(sid);
++ if (NULL == sessionData) {
++ EPRINTK("%s(): OCF Free session called with Null Session ID.\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ sessionToDeregister = sessionData->sessHandle;
++
++ if (ICP_SESSION_INITIALISED == sessionData->inUse) {
++ DPRINTK("%s() Session not registered with LAC\n", __FUNCTION__);
++ } else if (NULL == sessionData->sessHandle) {
++ EPRINTK
++ ("%s(): OCF Free session called with Null Session Handle.\n",
++ __FUNCTION__);
++ return EINVAL;
++ } else {
++ lacStatus = cpaCySymRemoveSession(CPA_INSTANCE_HANDLE_SINGLE,
++ sessionToDeregister);
++ if (CPA_STATUS_RETRY == lacStatus) {
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvDeregRetry(&sessionToDeregister)) {
++ /* the retry function increments the
++ dereg failed count */
++ DPRINTK("%s(): LAC failed to deregister the "
++ "session. (localSessionId= %p)\n",
++ __FUNCTION__, sessionToDeregister);
++ retval = EPERM;
++ }
++
++ } else if (CPA_STATUS_SUCCESS != lacStatus) {
++ DPRINTK("%s(): LAC failed to deregister the session. "
++ "localSessionId= %p, lacStatus = %d\n",
++ __FUNCTION__, sessionToDeregister, lacStatus);
++ atomic_inc(&lac_session_failed_dereg_count);
++ retval = EPERM;
++ }
++ }
++
++ icp_ocfDrvFreeOCFSession(sessionData);
++ return retval;
++
++}
++
++/* Name : icp_ocfDrvAlgCheck
++ *
++ * Description : This function checks whether the cryptodesc argument pertains
++ * to a sym or hash function
++ */
++static int icp_ocfDrvAlgCheck(struct cryptodesc *crp_desc)
++{
++
++ if (crp_desc->crd_alg == CRYPTO_3DES_CBC ||
++ crp_desc->crd_alg == CRYPTO_AES_CBC ||
++ crp_desc->crd_alg == CRYPTO_DES_CBC ||
++ crp_desc->crd_alg == CRYPTO_NULL_CBC ||
++ crp_desc->crd_alg == CRYPTO_ARC4) {
++ return ICP_OCF_DRV_ALG_CIPHER;
++ }
++
++ return ICP_OCF_DRV_ALG_HASH;
++}
++
++/* Name : icp_ocfDrvSymProcess
++ *
++ * Description : This function will map symmetric functionality calls from OCF
++ * to the LAC API. It will also allocate memory to store the session context.
++ *
++ * Notes: If it is the first perform call for a given session, then a LAC
++ * session is registered. After the session is registered, no checks as
++ * to whether session paramaters have changed (e.g. alg chain order) are
++ * done.
++ */
++int icp_ocfDrvSymProcess(device_t dev, struct cryptop *crp, int hint)
++{
++ struct icp_drvSessionData *sessionData = NULL;
++ struct icp_drvOpData *drvOpData = NULL;
++ CpaStatus lacStatus = CPA_STATUS_SUCCESS;
++ Cpa32U sessionCtxSizeInBytes = 0;
++ uint16_t numBufferListArray = 0;
++
++ if (NULL == crp) {
++ DPRINTK("%s(): Invalid input parameters, cryptop is NULL\n",
++ __FUNCTION__);
++ return EINVAL;
++ }
++
++ if (NULL == crp->crp_desc) {
++ DPRINTK("%s(): Invalid input parameters, no crp_desc attached "
++ "to crp\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++ if (NULL == crp->crp_buf) {
++ DPRINTK("%s(): Invalid input parameters, no buffer attached "
++ "to crp\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++ if (CPA_TRUE == atomic_read(&icp_ocfDrvIsExiting)) {
++ crp->crp_etype = EFAULT;
++ return EFAULT;
++ }
++
++ sessionData = (struct icp_drvSessionData *)
++ (CRYPTO_SESID2LID(crp->crp_sid));
++ if (NULL == sessionData) {
++ DPRINTK("%s(): Invalid input parameters, Null Session ID \n",
++ __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++/*If we get a request against a deregisted session, cancel operation*/
++ if (ICP_SESSION_DEREGISTERED == sessionData->inUse) {
++ DPRINTK("%s(): Session ID %d was deregistered \n",
++ __FUNCTION__, (int)(CRYPTO_SESID2LID(crp->crp_sid)));
++ crp->crp_etype = EFAULT;
++ return EFAULT;
++ }
++
++/*If none of the session states are set, then the session structure was either
++ not initialised properly or we are reading from a freed memory area (possible
++ due to OCF batch mode not removing queued requests against deregistered
++ sessions*/
++ if (ICP_SESSION_INITIALISED != sessionData->inUse &&
++ ICP_SESSION_RUNNING != sessionData->inUse) {
++ DPRINTK("%s(): Session - ID %d - not properly initialised or "
++ "memory freed back to the kernel \n",
++ __FUNCTION__, (int)(CRYPTO_SESID2LID(crp->crp_sid)));
++ crp->crp_etype = EINVAL;
++ return EINVAL;
++ }
++
++ /*For the below checks, remember error checking is already done in LAC.
++ We're not validating inputs subsequent to registration */
++ if (sessionData->inUse == ICP_SESSION_INITIALISED) {
++ DPRINTK("%s(): Initialising session\n", __FUNCTION__);
++
++ if (NULL != crp->crp_desc->crd_next) {
++ if (ICP_OCF_DRV_ALG_CIPHER ==
++ icp_ocfDrvAlgCheck(crp->crp_desc)) {
++
++ sessionData->lacSessCtx.algChainOrder =
++ CPA_CY_SYM_ALG_CHAIN_ORDER_CIPHER_THEN_HASH;
++
++ if (crp->crp_desc->crd_flags & CRD_F_ENCRYPT) {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT;
++ } else {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_DECRYPT;
++ }
++ } else {
++ sessionData->lacSessCtx.algChainOrder =
++ CPA_CY_SYM_ALG_CHAIN_ORDER_HASH_THEN_CIPHER;
++
++ if (crp->crp_desc->crd_next->crd_flags &
++ CRD_F_ENCRYPT) {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT;
++ } else {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_DECRYPT;
++ }
++
++ }
++
++ } else if (ICP_OCF_DRV_ALG_CIPHER ==
++ icp_ocfDrvAlgCheck(crp->crp_desc)) {
++ if (crp->crp_desc->crd_flags & CRD_F_ENCRYPT) {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_ENCRYPT;
++ } else {
++ sessionData->lacSessCtx.cipherSetupData.
++ cipherDirection =
++ CPA_CY_SYM_CIPHER_DIRECTION_DECRYPT;
++ }
++
++ }
++
++ /*No action required for standalone Auth here */
++
++ /* Allocate memory for SymSessionCtx before the Session Registration */
++ lacStatus =
++ cpaCySymSessionCtxGetSize(CPA_INSTANCE_HANDLE_SINGLE,
++ &(sessionData->lacSessCtx),
++ &sessionCtxSizeInBytes);
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): cpaCySymSessionCtxGetSize failed - %d\n",
++ __FUNCTION__, lacStatus);
++ return EINVAL;
++ }
++ sessionData->sessHandle =
++ kmalloc(sessionCtxSizeInBytes, GFP_ATOMIC);
++ if (NULL == sessionData->sessHandle) {
++ EPRINTK
++ ("%s(): Failed to get memory for SymSessionCtx\n",
++ __FUNCTION__);
++ return ENOMEM;
++ }
++
++ lacStatus = cpaCySymInitSession(CPA_INSTANCE_HANDLE_SINGLE,
++ icp_ocfDrvSymCallBack,
++ &(sessionData->lacSessCtx),
++ sessionData->sessHandle);
++
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): cpaCySymInitSession failed -%d \n",
++ __FUNCTION__, lacStatus);
++ return EFAULT;
++ }
++
++ sessionData->inUse = ICP_SESSION_RUNNING;
++ }
++
++ drvOpData = kmem_cache_zalloc(drvOpData_zone, GFP_ATOMIC);
++ if (NULL == drvOpData) {
++ EPRINTK("%s():Failed to get memory for drvOpData\n",
++ __FUNCTION__);
++ crp->crp_etype = ENOMEM;
++ return ENOMEM;
++ }
++
++ drvOpData->lacOpData.pSessionCtx = sessionData->sessHandle;
++ drvOpData->digestSizeInBytes = sessionData->lacSessCtx.hashSetupData.
++ digestResultLenInBytes;
++ drvOpData->crp = crp;
++
++ /* Set the default buffer list array memory allocation */
++ drvOpData->srcBuffer.pBuffers = drvOpData->bufferListArray;
++ drvOpData->numBufferListArray = ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS;
++
++ /*
++ * Allocate buffer list array memory allocation if the
++ * data fragment is more than the default allocation
++ */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ numBufferListArray = icp_ocfDrvGetSkBuffFrags((struct sk_buff *)
++ crp->crp_buf);
++ if (ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS < numBufferListArray) {
++ DPRINTK("%s() numBufferListArray more than default\n",
++ __FUNCTION__);
++ drvOpData->srcBuffer.pBuffers = NULL;
++ drvOpData->srcBuffer.pBuffers =
++ kmalloc(numBufferListArray *
++ sizeof(CpaFlatBuffer), GFP_ATOMIC);
++ if (NULL == drvOpData->srcBuffer.pBuffers) {
++ EPRINTK("%s() Failed to get memory for "
++ "pBuffers\n", __FUNCTION__);
++ kmem_cache_free(drvOpData_zone, drvOpData);
++ crp->crp_etype = ENOMEM;
++ return ENOMEM;
++ }
++ drvOpData->numBufferListArray = numBufferListArray;
++ }
++ }
++
++ /*
++ * Check the type of buffer structure we got and convert it into
++ * CpaBufferList format.
++ */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvSkBuffToBufferList((struct sk_buff *)crp->crp_buf,
++ &(drvOpData->srcBuffer))) {
++ EPRINTK("%s():Failed to translate from SK_BUF "
++ "to bufferlist\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ drvOpData->bufferType = CRYPTO_F_SKBUF;
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ /* OCF only supports IOV of one entry. */
++ if (NUM_IOV_SUPPORTED ==
++ ((struct uio *)(crp->crp_buf))->uio_iovcnt) {
++
++ icp_ocfDrvPtrAndLenToBufferList(((struct uio *)(crp->
++ crp_buf))->
++ uio_iov[0].iov_base,
++ ((struct uio *)(crp->
++ crp_buf))->
++ uio_iov[0].iov_len,
++ &(drvOpData->
++ srcBuffer));
++
++ drvOpData->bufferType = CRYPTO_F_IOV;
++
++ } else {
++ DPRINTK("%s():Unable to handle IOVs with lengths of "
++ "greater than one!\n", __FUNCTION__);
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ } else {
++ icp_ocfDrvPtrAndLenToBufferList(crp->crp_buf,
++ crp->crp_ilen,
++ &(drvOpData->srcBuffer));
++
++ drvOpData->bufferType = CRYPTO_BUF_CONTIG;
++ }
++
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvProcessDataSetup(drvOpData, drvOpData->crp->crp_desc)) {
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ if (drvOpData->crp->crp_desc->crd_next != NULL) {
++ if (icp_ocfDrvProcessDataSetup(drvOpData, drvOpData->crp->
++ crp_desc->crd_next)) {
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ }
++
++ /* Allocate srcBuffer's private meta data */
++ if (ICP_OCF_DRV_STATUS_SUCCESS !=
++ icp_ocfDrvAllocMetaData(&(drvOpData->srcBuffer), drvOpData)) {
++ EPRINTK("%s() icp_ocfDrvAllocMetaData failed\n", __FUNCTION__);
++ memset(&(drvOpData->lacOpData), 0, sizeof(CpaCySymOpData));
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ /* Perform "in-place" crypto operation */
++ lacStatus = cpaCySymPerformOp(CPA_INSTANCE_HANDLE_SINGLE,
++ (void *)drvOpData,
++ &(drvOpData->lacOpData),
++ &(drvOpData->srcBuffer),
++ &(drvOpData->srcBuffer),
++ &(drvOpData->verifyResult));
++ if (CPA_STATUS_RETRY == lacStatus) {
++ DPRINTK("%s(): cpaCySymPerformOp retry, lacStatus = %d\n",
++ __FUNCTION__, lacStatus);
++ memset(&(drvOpData->lacOpData), 0, sizeof(CpaCySymOpData));
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++ if (CPA_STATUS_SUCCESS != lacStatus) {
++ EPRINTK("%s(): cpaCySymPerformOp failed, lacStatus = %d\n",
++ __FUNCTION__, lacStatus);
++ memset(&(drvOpData->lacOpData), 0, sizeof(CpaCySymOpData));
++ crp->crp_etype = EINVAL;
++ goto err;
++ }
++
++ return 0; //OCF success status value
++
++ err:
++ if (drvOpData->numBufferListArray > ICP_OCF_DRV_DEFAULT_BUFFLIST_ARRAYS) {
++ kfree(drvOpData->srcBuffer.pBuffers);
++ }
++ icp_ocfDrvFreeMetaData(&(drvOpData->srcBuffer));
++ kmem_cache_free(drvOpData_zone, drvOpData);
++
++ return crp->crp_etype;
++}
++
++/* Name : icp_ocfDrvProcessDataSetup
++ *
++ * Description : This function will setup all the cryptographic operation data
++ * that is required by LAC to execute the operation.
++ */
++static int icp_ocfDrvProcessDataSetup(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc)
++{
++ CpaCyRandGenOpData randGenOpData;
++ CpaFlatBuffer randData;
++
++ drvOpData->lacOpData.packetType = CPA_CY_SYM_PACKET_TYPE_FULL;
++
++ /* Convert from the cryptop to the ICP LAC crypto parameters */
++ switch (crp_desc->crd_alg) {
++ case CRYPTO_NULL_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = NULL_BLOCK_LEN;
++ break;
++ case CRYPTO_DES_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = DES_BLOCK_LEN;
++ break;
++ case CRYPTO_3DES_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = DES3_BLOCK_LEN;
++ break;
++ case CRYPTO_ARC4:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = ARC4_COUNTER_LEN;
++ break;
++ case CRYPTO_AES_CBC:
++ drvOpData->lacOpData.
++ cryptoStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToCipherInBytes = crp_desc->crd_len;
++ drvOpData->verifyResult = CPA_FALSE;
++ drvOpData->lacOpData.ivLenInBytes = RIJNDAEL128_BLOCK_LEN;
++ break;
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ case CRYPTO_SHA2_256:
++ case CRYPTO_SHA2_256_HMAC:
++ case CRYPTO_SHA2_384:
++ case CRYPTO_SHA2_384_HMAC:
++ case CRYPTO_SHA2_512:
++ case CRYPTO_SHA2_512_HMAC:
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ drvOpData->lacOpData.
++ hashStartSrcOffsetInBytes = crp_desc->crd_skip;
++ drvOpData->lacOpData.
++ messageLenToHashInBytes = crp_desc->crd_len;
++ drvOpData->lacOpData.
++ pDigestResult =
++ icp_ocfDrvDigestPointerFind(drvOpData, crp_desc);
++
++ if (NULL == drvOpData->lacOpData.pDigestResult) {
++ DPRINTK("%s(): ERROR - could not calculate "
++ "Digest Result memory address\n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ drvOpData->lacOpData.digestVerify = CPA_FALSE;
++ break;
++ default:
++ DPRINTK("%s(): Crypto process error - algorithm not "
++ "found \n", __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ /* Figure out what the IV is supposed to be */
++ if ((crp_desc->crd_alg == CRYPTO_DES_CBC) ||
++ (crp_desc->crd_alg == CRYPTO_3DES_CBC) ||
++ (crp_desc->crd_alg == CRYPTO_AES_CBC)) {
++ /*ARC4 doesn't use an IV */
++ if (crp_desc->crd_flags & CRD_F_IV_EXPLICIT) {
++ /* Explicit IV provided to OCF */
++ drvOpData->lacOpData.pIv = crp_desc->crd_iv;
++ } else {
++ /* IV is not explicitly provided to OCF */
++
++ /* Point the LAC OP Data IV pointer to our allocated
++ storage location for this session. */
++ drvOpData->lacOpData.pIv = drvOpData->ivData;
++
++ if ((crp_desc->crd_flags & CRD_F_ENCRYPT) &&
++ ((crp_desc->crd_flags & CRD_F_IV_PRESENT) == 0)) {
++
++ /* Encrypting - need to create IV */
++ randGenOpData.generateBits = CPA_TRUE;
++ randGenOpData.lenInBytes = MAX_IV_LEN_IN_BYTES;
++
++ icp_ocfDrvPtrAndLenToFlatBuffer((Cpa8U *)
++ drvOpData->
++ ivData,
++ MAX_IV_LEN_IN_BYTES,
++ &randData);
++
++ if (CPA_STATUS_SUCCESS !=
++ cpaCyRandGen(CPA_INSTANCE_HANDLE_SINGLE,
++ NULL, NULL,
++ &randGenOpData, &randData)) {
++ DPRINTK("%s(): ERROR - Failed to"
++ " generate"
++ " Initialisation Vector\n",
++ __FUNCTION__);
++ return ICP_OCF_DRV_STATUS_FAIL;
++ }
++
++ crypto_copyback(drvOpData->crp->
++ crp_flags,
++ drvOpData->crp->crp_buf,
++ crp_desc->crd_inject,
++ drvOpData->lacOpData.
++ ivLenInBytes,
++ (caddr_t) (drvOpData->lacOpData.
++ pIv));
++ } else {
++ /* Reading IV from buffer */
++ crypto_copydata(drvOpData->crp->
++ crp_flags,
++ drvOpData->crp->crp_buf,
++ crp_desc->crd_inject,
++ drvOpData->lacOpData.
++ ivLenInBytes,
++ (caddr_t) (drvOpData->lacOpData.
++ pIv));
++ }
++
++ }
++
++ }
++
++ return ICP_OCF_DRV_STATUS_SUCCESS;
++}
++
++/* Name : icp_ocfDrvDigestPointerFind
++ *
++ * Description : This function is used to find the memory address of where the
++ * digest information shall be stored in. Input buffer types are an skbuff, iov
++ * or flat buffer. The address is found using the buffer data start address and
++ * an offset.
++ *
++ * Note: In the case of a linux skbuff, the digest address may exist within
++ * a memory space linked to from the start buffer. These linked memory spaces
++ * must be traversed by the data length offset in order to find the digest start
++ * address. Whether there is enough space for the digest must also be checked.
++ */
++
++static uint8_t *icp_ocfDrvDigestPointerFind(struct icp_drvOpData *drvOpData,
++ struct cryptodesc *crp_desc)
++{
++
++ int offsetInBytes = crp_desc->crd_inject;
++ uint32_t digestSizeInBytes = drvOpData->digestSizeInBytes;
++ uint8_t *flat_buffer_base = NULL;
++ int flat_buffer_length = 0;
++ struct sk_buff *skb;
++
++ if (drvOpData->crp->crp_flags & CRYPTO_F_SKBUF) {
++ /*check if enough overall space to store hash */
++ skb = (struct sk_buff *)(drvOpData->crp->crp_buf);
++
++ if (skb->len < (offsetInBytes + digestSizeInBytes)) {
++ DPRINTK("%s() Not enough space for Digest"
++ " payload after the offset (%d), "
++ "digest size (%d) \n", __FUNCTION__,
++ offsetInBytes, digestSizeInBytes);
++ return NULL;
++ }
++
++ return icp_ocfDrvSkbuffDigestPointerFind(drvOpData,
++ offsetInBytes,
++ digestSizeInBytes);
++
++ } else {
++ /* IOV or flat buffer */
++ if (drvOpData->crp->crp_flags & CRYPTO_F_IOV) {
++ /*single IOV check has already been done */
++ flat_buffer_base = ((struct uio *)
++ (drvOpData->crp->crp_buf))->
++ uio_iov[0].iov_base;
++ flat_buffer_length = ((struct uio *)
++ (drvOpData->crp->crp_buf))->
++ uio_iov[0].iov_len;
++ } else {
++ flat_buffer_base = (uint8_t *) drvOpData->crp->crp_buf;
++ flat_buffer_length = drvOpData->crp->crp_ilen;
++ }
++
++ if (flat_buffer_length < (offsetInBytes + digestSizeInBytes)) {
++ DPRINTK("%s() Not enough space for Digest "
++ "(IOV/Flat Buffer) \n", __FUNCTION__);
++ return NULL;
++ } else {
++ return (uint8_t *) (flat_buffer_base + offsetInBytes);
++ }
++ }
++ DPRINTK("%s() Should not reach this point\n", __FUNCTION__);
++ return NULL;
++}
++
++/* Name : icp_ocfDrvSkbuffDigestPointerFind
++ *
++ * Description : This function is used by icp_ocfDrvDigestPointerFind to process
++ * the non-linear portion of the skbuff if the fragmentation type is a linked
++ * list (frag_list is not NULL in the skb_shared_info structure)
++ */
++static inline uint8_t *icp_ocfDrvSkbuffDigestPointerFind(struct icp_drvOpData
++ *drvOpData,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes)
++{
++
++ struct sk_buff *skb = NULL;
++ struct skb_shared_info *skb_shared = NULL;
++
++ uint32_t skbuffisnonlinear = 0;
++
++ uint32_t skbheadlen = 0;
++
++ skb = (struct sk_buff *)(drvOpData->crp->crp_buf);
++ skbuffisnonlinear = skb_is_nonlinear(skb);
++
++ skbheadlen = skb_headlen(skb);
++
++ /*Linear skb checks */
++ if (skbheadlen > offsetInBytes) {
++
++ if (skbheadlen >= (offsetInBytes + digestSizeInBytes)) {
++ return (uint8_t *) (skb->data + offsetInBytes);
++ } else {
++ DPRINTK("%s() Auth payload stretches "
++ "accross contiguous memory\n", __FUNCTION__);
++ return NULL;
++ }
++ } else {
++ if (skbuffisnonlinear) {
++ offsetInBytes -= skbheadlen;
++ } else {
++ DPRINTK("%s() Offset outside of buffer boundaries\n",
++ __FUNCTION__);
++ return NULL;
++ }
++ }
++
++ /*Non Linear checks */
++ skb_shared = (struct skb_shared_info *)(skb->end);
++ if (unlikely(NULL == skb_shared)) {
++ DPRINTK("%s() skbuff shared info stucture is NULL! \n",
++ __FUNCTION__);
++ return NULL;
++ } else if ((0 != skb_shared->nr_frags) &&
++ (skb_shared->frag_list != NULL)) {
++ DPRINTK("%s() skbuff nr_frags AND "
++ "frag_list not supported \n", __FUNCTION__);
++ return NULL;
++ }
++
++ /*TCP segmentation more likely than IP fragmentation */
++ if (likely(0 != skb_shared->nr_frags)) {
++ return icp_ocfDrvDigestSkbNRFragsCheck(skb, skb_shared,
++ offsetInBytes,
++ digestSizeInBytes);
++ } else if (skb_shared->frag_list != NULL) {
++ return icp_ocfDrvDigestSkbFragListCheck(skb, skb_shared,
++ offsetInBytes,
++ digestSizeInBytes);
++ } else {
++ DPRINTK("%s() skbuff is non-linear but does not show any "
++ "linked data\n", __FUNCTION__);
++ return NULL;
++ }
++
++}
++
++/* Name : icp_ocfDrvDigestSkbNRFragsCheck
++ *
++ * Description : This function is used by icp_ocfDrvSkbuffDigestPointerFind to
++ * process the non-linear portion of the skbuff, if the fragmentation type is
++ * page fragments
++ */
++static inline uint8_t *icp_ocfDrvDigestSkbNRFragsCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes)
++{
++ int i = 0;
++ /*nr_frags starts from 1 */
++ if (MAX_SKB_FRAGS < skb_shared->nr_frags) {
++ DPRINTK("%s error processing skbuff "
++ "page frame -- MAX FRAGS exceeded \n", __FUNCTION__);
++ return NULL;
++ }
++
++ for (i = 0; i < skb_shared->nr_frags; i++) {
++
++ if (offsetInBytes >= skb_shared->frags[i].size) {
++ /*offset still greater than data position */
++ offsetInBytes -= skb_shared->frags[i].size;
++ } else {
++ /* found the page containing start of hash */
++
++ if (NULL == skb_shared->frags[i].page) {
++ DPRINTK("%s() Linked page is NULL!\n",
++ __FUNCTION__);
++ return NULL;
++ }
++
++ if (offsetInBytes + digestSizeInBytes >
++ skb_shared->frags[i].size) {
++ DPRINTK("%s() Auth payload stretches accross "
++ "contiguous memory\n", __FUNCTION__);
++ return NULL;
++ } else {
++ return (uint8_t *) (skb_shared->frags[i].page +
++ skb_shared->frags[i].
++ page_offset +
++ offsetInBytes);
++ }
++ }
++ /*only possible if internal page sizes are set wrong */
++ if (offsetInBytes < 0) {
++ DPRINTK("%s error processing skbuff page frame "
++ "-- offset calculation \n", __FUNCTION__);
++ return NULL;
++ }
++ }
++ /*only possible if internal page sizes are set wrong */
++ DPRINTK("%s error processing skbuff page frame "
++ "-- ran out of page fragments, remaining offset = %d \n",
++ __FUNCTION__, offsetInBytes);
++ return NULL;
++
++}
++
++/* Name : icp_ocfDrvDigestSkbFragListCheck
++ *
++ * Description : This function is used by icp_ocfDrvSkbuffDigestPointerFind to
++ * process the non-linear portion of the skbuff, if the fragmentation type is
++ * a linked list
++ *
++ */
++static inline uint8_t *icp_ocfDrvDigestSkbFragListCheck(struct sk_buff *skb,
++ struct skb_shared_info
++ *skb_shared,
++ int offsetInBytes,
++ uint32_t
++ digestSizeInBytes)
++{
++
++ struct sk_buff *skb_list = skb_shared->frag_list;
++ /*check added for readability */
++ if (NULL == skb_list) {
++ DPRINTK("%s error processing skbuff "
++ "-- no more list! \n", __FUNCTION__);
++ return NULL;
++ }
++
++ for (; skb_list; skb_list = skb_list->next) {
++ if (NULL == skb_list) {
++ DPRINTK("%s error processing skbuff "
++ "-- no more list! \n", __FUNCTION__);
++ return NULL;
++ }
++
++ if (offsetInBytes >= skb_list->len) {
++ offsetInBytes -= skb_list->len;
++
++ } else {
++ if (offsetInBytes + digestSizeInBytes > skb_list->len) {
++ DPRINTK("%s() Auth payload stretches accross "
++ "contiguous memory\n", __FUNCTION__);
++ return NULL;
++ } else {
++ return (uint8_t *)
++ (skb_list->data + offsetInBytes);
++ }
++
++ }
++
++ /*This check is only needed if internal skb_list length values
++ are set wrong. */
++ if (0 > offsetInBytes) {
++ DPRINTK("%s() error processing skbuff object -- offset "
++ "calculation \n", __FUNCTION__);
++ return NULL;
++ }
++
++ }
++
++ /*catch all for unusual for-loop exit.
++ This code should never be reached */
++ DPRINTK("%s() Catch-All hit! Process error.\n", __FUNCTION__);
++ return NULL;
++}
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/hifn/Makefile linux-2.6.29.1/crypto/ocf/hifn/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/hifn/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/hifn/Makefile 2009-04-20 20:01:21.516556358 +0200
+@@ -0,0 +1,13 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_HIFN) += hifn7751.o
++obj-$(CONFIG_OCF_HIFNHIPP) += hifnHIPP.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/hifn/hifn7751.c linux-2.6.29.1/crypto/ocf/hifn/hifn7751.c
+--- linux-2.6.29.1.orig/crypto/ocf/hifn/hifn7751.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/hifn/hifn7751.c 2009-04-20 20:01:21.484554239 +0200
+@@ -0,0 +1,2970 @@
++/* $OpenBSD: hifn7751.c,v 1.120 2002/05/17 00:33:34 deraadt Exp $ */
++
++/*-
++ * Invertex AEON / Hifn 7751 driver
++ * Copyright (c) 1999 Invertex Inc. All rights reserved.
++ * Copyright (c) 1999 Theo de Raadt
++ * Copyright (c) 2000-2001 Network Security Technologies, Inc.
++ * http://www.netsec.net
++ * Copyright (c) 2003 Hifn Inc.
++ *
++ * This driver is based on a previous driver by Invertex, for which they
++ * requested: Please send any comments, feedback, bug-fixes, or feature
++ * requests to software@invertex.com.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ *
++__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.40 2007/03/21 03:42:49 sam Exp $");
++ */
++
++/*
++ * Driver for various Hifn encryption processors.
++ */
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/version.h>
++#include <linux/skbuff.h>
++#include <asm/io.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++#include <hifn/hifn7751reg.h>
++#include <hifn/hifn7751var.h>
++
++#if 1
++#define DPRINTF(a...) if (hifn_debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_dev) : "hifn"); \
++ printk(a); \
++ } else
++#else
++#define DPRINTF(a...)
++#endif
++
++static inline int
++pci_get_revid(struct pci_dev *dev)
++{
++ u8 rid = 0;
++ pci_read_config_byte(dev, PCI_REVISION_ID, &rid);
++ return rid;
++}
++
++static struct hifn_stats hifnstats;
++
++#define debug hifn_debug
++int hifn_debug = 0;
++module_param(hifn_debug, int, 0644);
++MODULE_PARM_DESC(hifn_debug, "Enable debug");
++
++int hifn_maxbatch = 1;
++module_param(hifn_maxbatch, int, 0644);
++MODULE_PARM_DESC(hifn_maxbatch, "max ops to batch w/o interrupt");
++
++#ifdef MODULE_PARM
++char *hifn_pllconfig = NULL;
++MODULE_PARM(hifn_pllconfig, "s");
++#else
++char hifn_pllconfig[32]; /* This setting is RO after loading */
++module_param_string(hifn_pllconfig, hifn_pllconfig, 32, 0444);
++#endif
++MODULE_PARM_DESC(hifn_pllconfig, "PLL config, ie., pci66, ext33, ...");
++
++#ifdef HIFN_VULCANDEV
++#include <sys/conf.h>
++#include <sys/uio.h>
++
++static struct cdevsw vulcanpk_cdevsw; /* forward declaration */
++#endif
++
++/*
++ * Prototypes and count for the pci_device structure
++ */
++static int hifn_probe(struct pci_dev *dev, const struct pci_device_id *ent);
++static void hifn_remove(struct pci_dev *dev);
++
++static int hifn_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int hifn_freesession(device_t, u_int64_t);
++static int hifn_process(device_t, struct cryptop *, int);
++
++static device_method_t hifn_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, hifn_newsession),
++ DEVMETHOD(cryptodev_freesession,hifn_freesession),
++ DEVMETHOD(cryptodev_process, hifn_process),
++};
++
++static void hifn_reset_board(struct hifn_softc *, int);
++static void hifn_reset_puc(struct hifn_softc *);
++static void hifn_puc_wait(struct hifn_softc *);
++static int hifn_enable_crypto(struct hifn_softc *);
++static void hifn_set_retry(struct hifn_softc *sc);
++static void hifn_init_dma(struct hifn_softc *);
++static void hifn_init_pci_registers(struct hifn_softc *);
++static int hifn_sramsize(struct hifn_softc *);
++static int hifn_dramsize(struct hifn_softc *);
++static int hifn_ramtype(struct hifn_softc *);
++static void hifn_sessions(struct hifn_softc *);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++static irqreturn_t hifn_intr(int irq, void *arg);
++#else
++static irqreturn_t hifn_intr(int irq, void *arg, struct pt_regs *regs);
++#endif
++static u_int hifn_write_command(struct hifn_command *, u_int8_t *);
++static u_int32_t hifn_next_signature(u_int32_t a, u_int cnt);
++static void hifn_callback(struct hifn_softc *, struct hifn_command *, u_int8_t *);
++static int hifn_crypto(struct hifn_softc *, struct hifn_command *, struct cryptop *, int);
++static int hifn_readramaddr(struct hifn_softc *, int, u_int8_t *);
++static int hifn_writeramaddr(struct hifn_softc *, int, u_int8_t *);
++static int hifn_dmamap_load_src(struct hifn_softc *, struct hifn_command *);
++static int hifn_dmamap_load_dst(struct hifn_softc *, struct hifn_command *);
++static int hifn_init_pubrng(struct hifn_softc *);
++static void hifn_tick(unsigned long arg);
++static void hifn_abort(struct hifn_softc *);
++static void hifn_alloc_slot(struct hifn_softc *, int *, int *, int *, int *);
++
++static void hifn_write_reg_0(struct hifn_softc *, bus_size_t, u_int32_t);
++static void hifn_write_reg_1(struct hifn_softc *, bus_size_t, u_int32_t);
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++static int hifn_read_random(void *arg, u_int32_t *buf, int len);
++#endif
++
++#define HIFN_MAX_CHIPS 8
++static struct hifn_softc *hifn_chip_idx[HIFN_MAX_CHIPS];
++
++static __inline u_int32_t
++READ_REG_0(struct hifn_softc *sc, bus_size_t reg)
++{
++ u_int32_t v = readl(sc->sc_bar0 + reg);
++ sc->sc_bar0_lastreg = (bus_size_t) -1;
++ return (v);
++}
++#define WRITE_REG_0(sc, reg, val) hifn_write_reg_0(sc, reg, val)
++
++static __inline u_int32_t
++READ_REG_1(struct hifn_softc *sc, bus_size_t reg)
++{
++ u_int32_t v = readl(sc->sc_bar1 + reg);
++ sc->sc_bar1_lastreg = (bus_size_t) -1;
++ return (v);
++}
++#define WRITE_REG_1(sc, reg, val) hifn_write_reg_1(sc, reg, val)
++
++/*
++ * map in a given buffer (great on some arches :-)
++ */
++
++static int
++pci_map_uio(struct hifn_softc *sc, struct hifn_operand *buf, struct uio *uio)
++{
++ struct iovec *iov = uio->uio_iov;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf->mapsize = 0;
++ for (buf->nsegs = 0; buf->nsegs < uio->uio_iovcnt; ) {
++ buf->segs[buf->nsegs].ds_addr = pci_map_single(sc->sc_pcidev,
++ iov->iov_base, iov->iov_len,
++ PCI_DMA_BIDIRECTIONAL);
++ buf->segs[buf->nsegs].ds_len = iov->iov_len;
++ buf->mapsize += iov->iov_len;
++ iov++;
++ buf->nsegs++;
++ }
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++/*
++ * map in a given sk_buff
++ */
++
++static int
++pci_map_skb(struct hifn_softc *sc,struct hifn_operand *buf,struct sk_buff *skb)
++{
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf->mapsize = 0;
++
++ buf->segs[0].ds_addr = pci_map_single(sc->sc_pcidev,
++ skb->data, skb_headlen(skb), PCI_DMA_BIDIRECTIONAL);
++ buf->segs[0].ds_len = skb_headlen(skb);
++ buf->mapsize += buf->segs[0].ds_len;
++
++ buf->nsegs = 1;
++
++ for (i = 0; i < skb_shinfo(skb)->nr_frags; ) {
++ buf->segs[buf->nsegs].ds_len = skb_shinfo(skb)->frags[i].size;
++ buf->segs[buf->nsegs].ds_addr = pci_map_single(sc->sc_pcidev,
++ page_address(skb_shinfo(skb)->frags[i].page) +
++ skb_shinfo(skb)->frags[i].page_offset,
++ buf->segs[buf->nsegs].ds_len, PCI_DMA_BIDIRECTIONAL);
++ buf->mapsize += buf->segs[buf->nsegs].ds_len;
++ buf->nsegs++;
++ }
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++/*
++ * map in a given contiguous buffer
++ */
++
++static int
++pci_map_buf(struct hifn_softc *sc,struct hifn_operand *buf, void *b, int len)
++{
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf->mapsize = 0;
++ buf->segs[0].ds_addr = pci_map_single(sc->sc_pcidev,
++ b, len, PCI_DMA_BIDIRECTIONAL);
++ buf->segs[0].ds_len = len;
++ buf->mapsize += buf->segs[0].ds_len;
++ buf->nsegs = 1;
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++#if 0 /* not needed at this time */
++static void
++pci_sync_iov(struct hifn_softc *sc, struct hifn_operand *buf)
++{
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ for (i = 0; i < buf->nsegs; i++)
++ pci_dma_sync_single_for_cpu(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_len, PCI_DMA_BIDIRECTIONAL);
++}
++#endif
++
++static void
++pci_unmap_buf(struct hifn_softc *sc, struct hifn_operand *buf)
++{
++ int i;
++ DPRINTF("%s()\n", __FUNCTION__);
++ for (i = 0; i < buf->nsegs; i++) {
++ pci_unmap_single(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_len, PCI_DMA_BIDIRECTIONAL);
++ buf->segs[i].ds_addr = 0;
++ buf->segs[i].ds_len = 0;
++ }
++ buf->nsegs = 0;
++ buf->mapsize = 0;
++ buf->map = 0;
++}
++
++static const char*
++hifn_partname(struct hifn_softc *sc)
++{
++ /* XXX sprintf numbers when not decoded */
++ switch (pci_get_vendor(sc->sc_pcidev)) {
++ case PCI_VENDOR_HIFN:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_HIFN_6500: return "Hifn 6500";
++ case PCI_PRODUCT_HIFN_7751: return "Hifn 7751";
++ case PCI_PRODUCT_HIFN_7811: return "Hifn 7811";
++ case PCI_PRODUCT_HIFN_7951: return "Hifn 7951";
++ case PCI_PRODUCT_HIFN_7955: return "Hifn 7955";
++ case PCI_PRODUCT_HIFN_7956: return "Hifn 7956";
++ }
++ return "Hifn unknown-part";
++ case PCI_VENDOR_INVERTEX:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_INVERTEX_AEON: return "Invertex AEON";
++ }
++ return "Invertex unknown-part";
++ case PCI_VENDOR_NETSEC:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_NETSEC_7751: return "NetSec 7751";
++ }
++ return "NetSec unknown-part";
++ }
++ return "Unknown-vendor unknown-part";
++}
++
++static u_int
++checkmaxmin(struct pci_dev *dev, const char *what, u_int v, u_int min, u_int max)
++{
++ struct hifn_softc *sc = pci_get_drvdata(dev);
++ if (v > max) {
++ device_printf(sc->sc_dev, "Warning, %s %u out of range, "
++ "using max %u\n", what, v, max);
++ v = max;
++ } else if (v < min) {
++ device_printf(sc->sc_dev, "Warning, %s %u out of range, "
++ "using min %u\n", what, v, min);
++ v = min;
++ }
++ return v;
++}
++
++/*
++ * Select PLL configuration for 795x parts. This is complicated in
++ * that we cannot determine the optimal parameters without user input.
++ * The reference clock is derived from an external clock through a
++ * multiplier. The external clock is either the host bus (i.e. PCI)
++ * or an external clock generator. When using the PCI bus we assume
++ * the clock is either 33 or 66 MHz; for an external source we cannot
++ * tell the speed.
++ *
++ * PLL configuration is done with a string: "pci" for PCI bus, or "ext"
++ * for an external source, followed by the frequency. We calculate
++ * the appropriate multiplier and PLL register contents accordingly.
++ * When no configuration is given we default to "pci66" since that
++ * always will allow the card to work. If a card is using the PCI
++ * bus clock and in a 33MHz slot then it will be operating at half
++ * speed until the correct information is provided.
++ *
++ * We use a default setting of "ext66" because according to Mike Ham
++ * of HiFn, almost every board in existence has an external crystal
++ * populated at 66Mhz. Using PCI can be a problem on modern motherboards,
++ * because PCI33 can have clocks from 0 to 33Mhz, and some have
++ * non-PCI-compliant spread-spectrum clocks, which can confuse the pll.
++ */
++static void
++hifn_getpllconfig(struct pci_dev *dev, u_int *pll)
++{
++ const char *pllspec = hifn_pllconfig;
++ u_int freq, mul, fl, fh;
++ u_int32_t pllconfig;
++ char *nxt;
++
++ if (pllspec == NULL)
++ pllspec = "ext66";
++ fl = 33, fh = 66;
++ pllconfig = 0;
++ if (strncmp(pllspec, "ext", 3) == 0) {
++ pllspec += 3;
++ pllconfig |= HIFN_PLL_REF_SEL;
++ switch (pci_get_device(dev)) {
++ case PCI_PRODUCT_HIFN_7955:
++ case PCI_PRODUCT_HIFN_7956:
++ fl = 20, fh = 100;
++ break;
++#ifdef notyet
++ case PCI_PRODUCT_HIFN_7954:
++ fl = 20, fh = 66;
++ break;
++#endif
++ }
++ } else if (strncmp(pllspec, "pci", 3) == 0)
++ pllspec += 3;
++ freq = strtoul(pllspec, &nxt, 10);
++ if (nxt == pllspec)
++ freq = 66;
++ else
++ freq = checkmaxmin(dev, "frequency", freq, fl, fh);
++ /*
++ * Calculate multiplier. We target a Fck of 266 MHz,
++ * allowing only even values, possibly rounded down.
++ * Multipliers > 8 must set the charge pump current.
++ */
++ mul = checkmaxmin(dev, "PLL divisor", (266 / freq) &~ 1, 2, 12);
++ pllconfig |= (mul / 2 - 1) << HIFN_PLL_ND_SHIFT;
++ if (mul > 8)
++ pllconfig |= HIFN_PLL_IS;
++ *pll = pllconfig;
++}
++
++/*
++ * Attach an interface that successfully probed.
++ */
++static int
++hifn_probe(struct pci_dev *dev, const struct pci_device_id *ent)
++{
++ struct hifn_softc *sc = NULL;
++ char rbase;
++ u_int16_t ena, rev;
++ int rseg, rc;
++ unsigned long mem_start, mem_len;
++ static int num_chips = 0;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (pci_enable_device(dev) < 0)
++ return(-ENODEV);
++
++ if (pci_set_mwi(dev))
++ return(-ENODEV);
++
++ if (!dev->irq) {
++ printk("hifn: found device with no IRQ assigned. check BIOS settings!");
++ pci_disable_device(dev);
++ return(-ENODEV);
++ }
++
++ sc = (struct hifn_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return(-ENOMEM);
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, "hifn", num_chips, hifn_methods);
++
++ sc->sc_pcidev = dev;
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++ sc->sc_num = num_chips++;
++ if (sc->sc_num < HIFN_MAX_CHIPS)
++ hifn_chip_idx[sc->sc_num] = sc;
++
++ pci_set_drvdata(sc->sc_pcidev, sc);
++
++ spin_lock_init(&sc->sc_mtx);
++
++ /* XXX handle power management */
++
++ /*
++ * The 7951 and 795x have a random number generator and
++ * public key support; note this.
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_HIFN &&
++ (pci_get_device(dev) == PCI_PRODUCT_HIFN_7951 ||
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7955 ||
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7956))
++ sc->sc_flags = HIFN_HAS_RNG | HIFN_HAS_PUBLIC;
++ /*
++ * The 7811 has a random number generator and
++ * we also note it's identity 'cuz of some quirks.
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_HIFN &&
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7811)
++ sc->sc_flags |= HIFN_IS_7811 | HIFN_HAS_RNG;
++
++ /*
++ * The 795x parts support AES.
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_HIFN &&
++ (pci_get_device(dev) == PCI_PRODUCT_HIFN_7955 ||
++ pci_get_device(dev) == PCI_PRODUCT_HIFN_7956)) {
++ sc->sc_flags |= HIFN_IS_7956 | HIFN_HAS_AES;
++ /*
++ * Select PLL configuration. This depends on the
++ * bus and board design and must be manually configured
++ * if the default setting is unacceptable.
++ */
++ hifn_getpllconfig(dev, &sc->sc_pllconfig);
++ }
++
++ /*
++ * Setup PCI resources. Note that we record the bus
++ * tag and handle for each register mapping, this is
++ * used by the READ_REG_0, WRITE_REG_0, READ_REG_1,
++ * and WRITE_REG_1 macros throughout the driver.
++ */
++ mem_start = pci_resource_start(sc->sc_pcidev, 0);
++ mem_len = pci_resource_len(sc->sc_pcidev, 0);
++ sc->sc_bar0 = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_bar0) {
++ device_printf(sc->sc_dev, "cannot map bar%d register space\n", 0);
++ goto fail;
++ }
++ sc->sc_bar0_lastreg = (bus_size_t) -1;
++
++ mem_start = pci_resource_start(sc->sc_pcidev, 1);
++ mem_len = pci_resource_len(sc->sc_pcidev, 1);
++ sc->sc_bar1 = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_bar1) {
++ device_printf(sc->sc_dev, "cannot map bar%d register space\n", 1);
++ goto fail;
++ }
++ sc->sc_bar1_lastreg = (bus_size_t) -1;
++
++ /* fix up the bus size */
++ if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev, "No usable DMA configuration, aborting.\n");
++ goto fail;
++ }
++ if (pci_set_consistent_dma_mask(dev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev,
++ "No usable consistent DMA configuration, aborting.\n");
++ goto fail;
++ }
++
++ hifn_set_retry(sc);
++
++ /*
++ * Setup the area where the Hifn DMA's descriptors
++ * and associated data structures.
++ */
++ sc->sc_dma = (struct hifn_dma *) pci_alloc_consistent(dev,
++ sizeof(*sc->sc_dma),
++ &sc->sc_dma_physaddr);
++ if (!sc->sc_dma) {
++ device_printf(sc->sc_dev, "cannot alloc sc_dma\n");
++ goto fail;
++ }
++ bzero(sc->sc_dma, sizeof(*sc->sc_dma));
++
++ /*
++ * Reset the board and do the ``secret handshake''
++ * to enable the crypto support. Then complete the
++ * initialization procedure by setting up the interrupt
++ * and hooking in to the system crypto support so we'll
++ * get used for system services like the crypto device,
++ * IPsec, RNG device, etc.
++ */
++ hifn_reset_board(sc, 0);
++
++ if (hifn_enable_crypto(sc) != 0) {
++ device_printf(sc->sc_dev, "crypto enabling failed\n");
++ goto fail;
++ }
++ hifn_reset_puc(sc);
++
++ hifn_init_dma(sc);
++ hifn_init_pci_registers(sc);
++
++ pci_set_master(sc->sc_pcidev);
++
++ /* XXX can't dynamically determine ram type for 795x; force dram */
++ if (sc->sc_flags & HIFN_IS_7956)
++ sc->sc_drammodel = 1;
++ else if (hifn_ramtype(sc))
++ goto fail;
++
++ if (sc->sc_drammodel == 0)
++ hifn_sramsize(sc);
++ else
++ hifn_dramsize(sc);
++
++ /*
++ * Workaround for NetSec 7751 rev A: half ram size because two
++ * of the address lines were left floating
++ */
++ if (pci_get_vendor(dev) == PCI_VENDOR_NETSEC &&
++ pci_get_device(dev) == PCI_PRODUCT_NETSEC_7751 &&
++ pci_get_revid(dev) == 0x61) /*XXX???*/
++ sc->sc_ramsize >>= 1;
++
++ /*
++ * Arrange the interrupt line.
++ */
++ rc = request_irq(dev->irq, hifn_intr, IRQF_SHARED, "hifn", sc);
++ if (rc) {
++ device_printf(sc->sc_dev, "could not map interrupt: %d\n", rc);
++ goto fail;
++ }
++ sc->sc_irq = dev->irq;
++
++ hifn_sessions(sc);
++
++ /*
++ * NB: Keep only the low 16 bits; this masks the chip id
++ * from the 7951.
++ */
++ rev = READ_REG_1(sc, HIFN_1_REVID) & 0xffff;
++
++ rseg = sc->sc_ramsize / 1024;
++ rbase = 'K';
++ if (sc->sc_ramsize >= (1024 * 1024)) {
++ rbase = 'M';
++ rseg /= 1024;
++ }
++ device_printf(sc->sc_dev, "%s, rev %u, %d%cB %cram",
++ hifn_partname(sc), rev,
++ rseg, rbase, sc->sc_drammodel ? 'd' : 's');
++ if (sc->sc_flags & HIFN_IS_7956)
++ printf(", pll=0x%x<%s clk, %ux mult>",
++ sc->sc_pllconfig,
++ sc->sc_pllconfig & HIFN_PLL_REF_SEL ? "ext" : "pci",
++ 2 + 2*((sc->sc_pllconfig & HIFN_PLL_ND) >> 11));
++ printf("\n");
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ device_printf(sc->sc_dev, "could not get crypto driver id\n");
++ goto fail;
++ }
++
++ WRITE_REG_0(sc, HIFN_0_PUCNFG,
++ READ_REG_0(sc, HIFN_0_PUCNFG) | HIFN_PUCNFG_CHIPID);
++ ena = READ_REG_0(sc, HIFN_0_PUSTAT) & HIFN_PUSTAT_CHIPENA;
++
++ switch (ena) {
++ case HIFN_PUSTAT_ENA_2:
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_ARC4, 0, 0);
++ if (sc->sc_flags & HIFN_HAS_AES)
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ /*FALLTHROUGH*/
++ case HIFN_PUSTAT_ENA_1:
++ crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ break;
++ }
++
++ if (sc->sc_flags & (HIFN_HAS_PUBLIC | HIFN_HAS_RNG))
++ hifn_init_pubrng(sc);
++
++ init_timer(&sc->sc_tickto);
++ sc->sc_tickto.function = hifn_tick;
++ sc->sc_tickto.data = (unsigned long) sc->sc_num;
++ mod_timer(&sc->sc_tickto, jiffies + HZ);
++
++ return (0);
++
++fail:
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_dma) {
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ pci_free_consistent(sc->sc_pcidev,
++ sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++ }
++ kfree(sc);
++ return (-ENXIO);
++}
++
++/*
++ * Detach an interface that successfully probed.
++ */
++static void
++hifn_remove(struct pci_dev *dev)
++{
++ struct hifn_softc *sc = pci_get_drvdata(dev);
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ KASSERT(sc != NULL, ("hifn_detach: null software carrier!"));
++
++ /* disable interrupts */
++ HIFN_LOCK(sc);
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, 0);
++ HIFN_UNLOCK(sc);
++
++ /*XXX other resources */
++ del_timer_sync(&sc->sc_tickto);
++
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ crypto_unregister_all(sc->sc_cid);
++
++ free_irq(sc->sc_irq, sc);
++
++ pci_free_consistent(sc->sc_pcidev, sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++}
++
++
++static int
++hifn_init_pubrng(struct hifn_softc *sc)
++{
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if ((sc->sc_flags & HIFN_IS_7811) == 0) {
++ /* Reset 7951 public key/rng engine */
++ WRITE_REG_1(sc, HIFN_1_PUB_RESET,
++ READ_REG_1(sc, HIFN_1_PUB_RESET) | HIFN_PUBRST_RESET);
++
++ for (i = 0; i < 100; i++) {
++ DELAY(1000);
++ if ((READ_REG_1(sc, HIFN_1_PUB_RESET) &
++ HIFN_PUBRST_RESET) == 0)
++ break;
++ }
++
++ if (i == 100) {
++ device_printf(sc->sc_dev, "public key init failed\n");
++ return (1);
++ }
++ }
++
++ /* Enable the rng, if available */
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ if (sc->sc_flags & HIFN_HAS_RNG) {
++ if (sc->sc_flags & HIFN_IS_7811) {
++ u_int32_t r;
++ r = READ_REG_1(sc, HIFN_1_7811_RNGENA);
++ if (r & HIFN_7811_RNGENA_ENA) {
++ r &= ~HIFN_7811_RNGENA_ENA;
++ WRITE_REG_1(sc, HIFN_1_7811_RNGENA, r);
++ }
++ WRITE_REG_1(sc, HIFN_1_7811_RNGCFG,
++ HIFN_7811_RNGCFG_DEFL);
++ r |= HIFN_7811_RNGENA_ENA;
++ WRITE_REG_1(sc, HIFN_1_7811_RNGENA, r);
++ } else
++ WRITE_REG_1(sc, HIFN_1_RNG_CONFIG,
++ READ_REG_1(sc, HIFN_1_RNG_CONFIG) |
++ HIFN_RNGCFG_ENA);
++
++ sc->sc_rngfirst = 1;
++ crypto_rregister(sc->sc_cid, hifn_read_random, sc);
++ }
++#endif
++
++ /* Enable public key engine, if available */
++ if (sc->sc_flags & HIFN_HAS_PUBLIC) {
++ WRITE_REG_1(sc, HIFN_1_PUB_IEN, HIFN_PUBIEN_DONE);
++ sc->sc_dmaier |= HIFN_DMAIER_PUBDONE;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++#ifdef HIFN_VULCANDEV
++ sc->sc_pkdev = make_dev(&vulcanpk_cdevsw, 0,
++ UID_ROOT, GID_WHEEL, 0666,
++ "vulcanpk");
++ sc->sc_pkdev->si_drv1 = sc;
++#endif
++ }
++
++ return (0);
++}
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++static int
++hifn_read_random(void *arg, u_int32_t *buf, int len)
++{
++ struct hifn_softc *sc = (struct hifn_softc *) arg;
++ u_int32_t sts;
++ int i, rc = 0;
++
++ if (len <= 0)
++ return rc;
++
++ if (sc->sc_flags & HIFN_IS_7811) {
++ /* ONLY VALID ON 7811!!!! */
++ for (i = 0; i < 5; i++) {
++ sts = READ_REG_1(sc, HIFN_1_7811_RNGSTS);
++ if (sts & HIFN_7811_RNGSTS_UFL) {
++ device_printf(sc->sc_dev,
++ "RNG underflow: disabling\n");
++ /* DAVIDM perhaps return -1 */
++ break;
++ }
++ if ((sts & HIFN_7811_RNGSTS_RDY) == 0)
++ break;
++
++ /*
++ * There are at least two words in the RNG FIFO
++ * at this point.
++ */
++ if (rc < len)
++ buf[rc++] = READ_REG_1(sc, HIFN_1_7811_RNGDAT);
++ if (rc < len)
++ buf[rc++] = READ_REG_1(sc, HIFN_1_7811_RNGDAT);
++ }
++ } else
++ buf[rc++] = READ_REG_1(sc, HIFN_1_RNG_DATA);
++
++ /* NB: discard first data read */
++ if (sc->sc_rngfirst) {
++ sc->sc_rngfirst = 0;
++ rc = 0;
++ }
++
++ return(rc);
++}
++#endif /* CONFIG_OCF_RANDOMHARVEST */
++
++static void
++hifn_puc_wait(struct hifn_softc *sc)
++{
++ int i;
++ int reg = HIFN_0_PUCTRL;
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ reg = HIFN_0_PUCTRL2;
++ }
++
++ for (i = 5000; i > 0; i--) {
++ DELAY(1);
++ if (!(READ_REG_0(sc, reg) & HIFN_PUCTRL_RESET))
++ break;
++ }
++ if (!i)
++ device_printf(sc->sc_dev, "proc unit did not reset(0x%x)\n",
++ READ_REG_0(sc, HIFN_0_PUCTRL));
++}
++
++/*
++ * Reset the processing unit.
++ */
++static void
++hifn_reset_puc(struct hifn_softc *sc)
++{
++ /* Reset processing unit */
++ int reg = HIFN_0_PUCTRL;
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ reg = HIFN_0_PUCTRL2;
++ }
++ WRITE_REG_0(sc, reg, HIFN_PUCTRL_DMAENA);
++
++ hifn_puc_wait(sc);
++}
++
++/*
++ * Set the Retry and TRDY registers; note that we set them to
++ * zero because the 7811 locks up when forced to retry (section
++ * 3.6 of "Specification Update SU-0014-04". Not clear if we
++ * should do this for all Hifn parts, but it doesn't seem to hurt.
++ */
++static void
++hifn_set_retry(struct hifn_softc *sc)
++{
++ DPRINTF("%s()\n", __FUNCTION__);
++ /* NB: RETRY only responds to 8-bit reads/writes */
++ pci_write_config_byte(sc->sc_pcidev, HIFN_RETRY_TIMEOUT, 0);
++ pci_write_config_dword(sc->sc_pcidev, HIFN_TRDY_TIMEOUT, 0);
++}
++
++/*
++ * Resets the board. Values in the regesters are left as is
++ * from the reset (i.e. initial values are assigned elsewhere).
++ */
++static void
++hifn_reset_board(struct hifn_softc *sc, int full)
++{
++ u_int32_t reg;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ /*
++ * Set polling in the DMA configuration register to zero. 0x7 avoids
++ * resetting the board and zeros out the other fields.
++ */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ /*
++ * Now that polling has been disabled, we have to wait 1 ms
++ * before resetting the board.
++ */
++ DELAY(1000);
++
++ /* Reset the DMA unit */
++ if (full) {
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MODE);
++ DELAY(1000);
++ } else {
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG,
++ HIFN_DMACNFG_MODE | HIFN_DMACNFG_MSTRESET);
++ hifn_reset_puc(sc);
++ }
++
++ KASSERT(sc->sc_dma != NULL, ("hifn_reset_board: null DMA tag!"));
++ bzero(sc->sc_dma, sizeof(*sc->sc_dma));
++
++ /* Bring dma unit out of reset */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ hifn_puc_wait(sc);
++ hifn_set_retry(sc);
++
++ if (sc->sc_flags & HIFN_IS_7811) {
++ for (reg = 0; reg < 1000; reg++) {
++ if (READ_REG_1(sc, HIFN_1_7811_MIPSRST) &
++ HIFN_MIPSRST_CRAMINIT)
++ break;
++ DELAY(1000);
++ }
++ if (reg == 1000)
++ device_printf(sc->sc_dev, ": cram init timeout\n");
++ } else {
++ /* set up DMA configuration register #2 */
++ /* turn off all PK and BAR0 swaps */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG2,
++ (3 << HIFN_DMACNFG2_INIT_WRITE_BURST_SHIFT)|
++ (3 << HIFN_DMACNFG2_INIT_READ_BURST_SHIFT)|
++ (2 << HIFN_DMACNFG2_TGT_WRITE_BURST_SHIFT)|
++ (2 << HIFN_DMACNFG2_TGT_READ_BURST_SHIFT));
++ }
++}
++
++static u_int32_t
++hifn_next_signature(u_int32_t a, u_int cnt)
++{
++ int i;
++ u_int32_t v;
++
++ for (i = 0; i < cnt; i++) {
++
++ /* get the parity */
++ v = a & 0x80080125;
++ v ^= v >> 16;
++ v ^= v >> 8;
++ v ^= v >> 4;
++ v ^= v >> 2;
++ v ^= v >> 1;
++
++ a = (v & 1) ^ (a << 1);
++ }
++
++ return a;
++}
++
++
++/*
++ * Checks to see if crypto is already enabled. If crypto isn't enable,
++ * "hifn_enable_crypto" is called to enable it. The check is important,
++ * as enabling crypto twice will lock the board.
++ */
++static int
++hifn_enable_crypto(struct hifn_softc *sc)
++{
++ u_int32_t dmacfg, ramcfg, encl, addr, i;
++ char offtbl[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x00 };
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ ramcfg = READ_REG_0(sc, HIFN_0_PUCNFG);
++ dmacfg = READ_REG_1(sc, HIFN_1_DMA_CNFG);
++
++ /*
++ * The RAM config register's encrypt level bit needs to be set before
++ * every read performed on the encryption level register.
++ */
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, ramcfg | HIFN_PUCNFG_CHIPID);
++
++ encl = READ_REG_0(sc, HIFN_0_PUSTAT) & HIFN_PUSTAT_CHIPENA;
++
++ /*
++ * Make sure we don't re-unlock. Two unlocks kills chip until the
++ * next reboot.
++ */
++ if (encl == HIFN_PUSTAT_ENA_1 || encl == HIFN_PUSTAT_ENA_2) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev,
++ "Strong crypto already enabled!\n");
++#endif
++ goto report;
++ }
++
++ if (encl != 0 && encl != HIFN_PUSTAT_ENA_0) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev,
++ "Unknown encryption level 0x%x\n", encl);
++#endif
++ return 1;
++ }
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_UNLOCK |
++ HIFN_DMACNFG_MSTRESET | HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++ DELAY(1000);
++ addr = READ_REG_1(sc, HIFN_UNLOCK_SECRET1);
++ DELAY(1000);
++ WRITE_REG_1(sc, HIFN_UNLOCK_SECRET2, 0);
++ DELAY(1000);
++
++ for (i = 0; i <= 12; i++) {
++ addr = hifn_next_signature(addr, offtbl[i] + 0x101);
++ WRITE_REG_1(sc, HIFN_UNLOCK_SECRET2, addr);
++
++ DELAY(1000);
++ }
++
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, ramcfg | HIFN_PUCNFG_CHIPID);
++ encl = READ_REG_0(sc, HIFN_0_PUSTAT) & HIFN_PUSTAT_CHIPENA;
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ if (encl != HIFN_PUSTAT_ENA_1 && encl != HIFN_PUSTAT_ENA_2)
++ device_printf(sc->sc_dev, "Engine is permanently "
++ "locked until next system reset!\n");
++ else
++ device_printf(sc->sc_dev, "Engine enabled "
++ "successfully!\n");
++ }
++#endif
++
++report:
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, ramcfg);
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, dmacfg);
++
++ switch (encl) {
++ case HIFN_PUSTAT_ENA_1:
++ case HIFN_PUSTAT_ENA_2:
++ break;
++ case HIFN_PUSTAT_ENA_0:
++ default:
++ device_printf(sc->sc_dev, "disabled\n");
++ break;
++ }
++
++ return 0;
++}
++
++/*
++ * Give initial values to the registers listed in the "Register Space"
++ * section of the HIFN Software Development reference manual.
++ */
++static void
++hifn_init_pci_registers(struct hifn_softc *sc)
++{
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* write fixed values needed by the Initialization registers */
++ WRITE_REG_0(sc, HIFN_0_PUCTRL, HIFN_PUCTRL_DMAENA);
++ WRITE_REG_0(sc, HIFN_0_FIFOCNFG, HIFN_FIFOCNFG_THRESHOLD);
++ WRITE_REG_0(sc, HIFN_0_PUIER, HIFN_PUIER_DSTOVER);
++
++ /* write all 4 ring address registers */
++ WRITE_REG_1(sc, HIFN_1_DMA_CRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, cmdr[0]));
++ WRITE_REG_1(sc, HIFN_1_DMA_SRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, srcr[0]));
++ WRITE_REG_1(sc, HIFN_1_DMA_DRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, dstr[0]));
++ WRITE_REG_1(sc, HIFN_1_DMA_RRAR, sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, resr[0]));
++
++ DELAY(2000);
++
++ /* write status register */
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_D_CTRL_DIS | HIFN_DMACSR_R_CTRL_DIS |
++ HIFN_DMACSR_S_CTRL_DIS | HIFN_DMACSR_C_CTRL_DIS |
++ HIFN_DMACSR_D_ABORT | HIFN_DMACSR_D_DONE | HIFN_DMACSR_D_LAST |
++ HIFN_DMACSR_D_WAIT | HIFN_DMACSR_D_OVER |
++ HIFN_DMACSR_R_ABORT | HIFN_DMACSR_R_DONE | HIFN_DMACSR_R_LAST |
++ HIFN_DMACSR_R_WAIT | HIFN_DMACSR_R_OVER |
++ HIFN_DMACSR_S_ABORT | HIFN_DMACSR_S_DONE | HIFN_DMACSR_S_LAST |
++ HIFN_DMACSR_S_WAIT |
++ HIFN_DMACSR_C_ABORT | HIFN_DMACSR_C_DONE | HIFN_DMACSR_C_LAST |
++ HIFN_DMACSR_C_WAIT |
++ HIFN_DMACSR_ENGINE |
++ ((sc->sc_flags & HIFN_HAS_PUBLIC) ?
++ HIFN_DMACSR_PUBDONE : 0) |
++ ((sc->sc_flags & HIFN_IS_7811) ?
++ HIFN_DMACSR_ILLW | HIFN_DMACSR_ILLR : 0));
++
++ sc->sc_d_busy = sc->sc_r_busy = sc->sc_s_busy = sc->sc_c_busy = 0;
++ sc->sc_dmaier |= HIFN_DMAIER_R_DONE | HIFN_DMAIER_C_ABORT |
++ HIFN_DMAIER_D_OVER | HIFN_DMAIER_R_OVER |
++ HIFN_DMAIER_S_ABORT | HIFN_DMAIER_D_ABORT | HIFN_DMAIER_R_ABORT |
++ ((sc->sc_flags & HIFN_IS_7811) ?
++ HIFN_DMAIER_ILLW | HIFN_DMAIER_ILLR : 0);
++ sc->sc_dmaier &= ~HIFN_DMAIER_C_WAIT;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ u_int32_t pll;
++
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, HIFN_PUCNFG_COMPSING |
++ HIFN_PUCNFG_TCALLPHASES |
++ HIFN_PUCNFG_TCDRVTOTEM | HIFN_PUCNFG_BUS32);
++
++ /* turn off the clocks and insure bypass is set */
++ pll = READ_REG_1(sc, HIFN_1_PLL);
++ pll = (pll &~ (HIFN_PLL_PK_CLK_SEL | HIFN_PLL_PE_CLK_SEL))
++ | HIFN_PLL_BP | HIFN_PLL_MBSET;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ DELAY(10*1000); /* 10ms */
++
++ /* change configuration */
++ pll = (pll &~ HIFN_PLL_CONFIG) | sc->sc_pllconfig;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ DELAY(10*1000); /* 10ms */
++
++ /* disable bypass */
++ pll &= ~HIFN_PLL_BP;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ /* enable clocks with new configuration */
++ pll |= HIFN_PLL_PK_CLK_SEL | HIFN_PLL_PE_CLK_SEL;
++ WRITE_REG_1(sc, HIFN_1_PLL, pll);
++ } else {
++ WRITE_REG_0(sc, HIFN_0_PUCNFG, HIFN_PUCNFG_COMPSING |
++ HIFN_PUCNFG_DRFR_128 | HIFN_PUCNFG_TCALLPHASES |
++ HIFN_PUCNFG_TCDRVTOTEM | HIFN_PUCNFG_BUS32 |
++ (sc->sc_drammodel ? HIFN_PUCNFG_DRAM : HIFN_PUCNFG_SRAM));
++ }
++
++ WRITE_REG_0(sc, HIFN_0_PUISR, HIFN_PUISR_DSTOVER);
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE | HIFN_DMACNFG_LAST |
++ ((HIFN_POLL_FREQUENCY << 16 ) & HIFN_DMACNFG_POLLFREQ) |
++ ((HIFN_POLL_SCALAR << 8) & HIFN_DMACNFG_POLLINVAL));
++}
++
++/*
++ * The maximum number of sessions supported by the card
++ * is dependent on the amount of context ram, which
++ * encryption algorithms are enabled, and how compression
++ * is configured. This should be configured before this
++ * routine is called.
++ */
++static void
++hifn_sessions(struct hifn_softc *sc)
++{
++ u_int32_t pucnfg;
++ int ctxsize;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ pucnfg = READ_REG_0(sc, HIFN_0_PUCNFG);
++
++ if (pucnfg & HIFN_PUCNFG_COMPSING) {
++ if (pucnfg & HIFN_PUCNFG_ENCCNFG)
++ ctxsize = 128;
++ else
++ ctxsize = 512;
++ /*
++ * 7955/7956 has internal context memory of 32K
++ */
++ if (sc->sc_flags & HIFN_IS_7956)
++ sc->sc_maxses = 32768 / ctxsize;
++ else
++ sc->sc_maxses = 1 +
++ ((sc->sc_ramsize - 32768) / ctxsize);
++ } else
++ sc->sc_maxses = sc->sc_ramsize / 16384;
++
++ if (sc->sc_maxses > 2048)
++ sc->sc_maxses = 2048;
++}
++
++/*
++ * Determine ram type (sram or dram). Board should be just out of a reset
++ * state when this is called.
++ */
++static int
++hifn_ramtype(struct hifn_softc *sc)
++{
++ u_int8_t data[8], dataexpect[8];
++ int i;
++
++ for (i = 0; i < sizeof(data); i++)
++ data[i] = dataexpect[i] = 0x55;
++ if (hifn_writeramaddr(sc, 0, data))
++ return (-1);
++ if (hifn_readramaddr(sc, 0, data))
++ return (-1);
++ if (bcmp(data, dataexpect, sizeof(data)) != 0) {
++ sc->sc_drammodel = 1;
++ return (0);
++ }
++
++ for (i = 0; i < sizeof(data); i++)
++ data[i] = dataexpect[i] = 0xaa;
++ if (hifn_writeramaddr(sc, 0, data))
++ return (-1);
++ if (hifn_readramaddr(sc, 0, data))
++ return (-1);
++ if (bcmp(data, dataexpect, sizeof(data)) != 0) {
++ sc->sc_drammodel = 1;
++ return (0);
++ }
++
++ return (0);
++}
++
++#define HIFN_SRAM_MAX (32 << 20)
++#define HIFN_SRAM_STEP_SIZE 16384
++#define HIFN_SRAM_GRANULARITY (HIFN_SRAM_MAX / HIFN_SRAM_STEP_SIZE)
++
++static int
++hifn_sramsize(struct hifn_softc *sc)
++{
++ u_int32_t a;
++ u_int8_t data[8];
++ u_int8_t dataexpect[sizeof(data)];
++ int32_t i;
++
++ for (i = 0; i < sizeof(data); i++)
++ data[i] = dataexpect[i] = i ^ 0x5a;
++
++ for (i = HIFN_SRAM_GRANULARITY - 1; i >= 0; i--) {
++ a = i * HIFN_SRAM_STEP_SIZE;
++ bcopy(&i, data, sizeof(i));
++ hifn_writeramaddr(sc, a, data);
++ }
++
++ for (i = 0; i < HIFN_SRAM_GRANULARITY; i++) {
++ a = i * HIFN_SRAM_STEP_SIZE;
++ bcopy(&i, dataexpect, sizeof(i));
++ if (hifn_readramaddr(sc, a, data) < 0)
++ return (0);
++ if (bcmp(data, dataexpect, sizeof(data)) != 0)
++ return (0);
++ sc->sc_ramsize = a + HIFN_SRAM_STEP_SIZE;
++ }
++
++ return (0);
++}
++
++/*
++ * XXX For dram boards, one should really try all of the
++ * HIFN_PUCNFG_DSZ_*'s. This just assumes that PUCNFG
++ * is already set up correctly.
++ */
++static int
++hifn_dramsize(struct hifn_softc *sc)
++{
++ u_int32_t cnfg;
++
++ if (sc->sc_flags & HIFN_IS_7956) {
++ /*
++ * 7955/7956 have a fixed internal ram of only 32K.
++ */
++ sc->sc_ramsize = 32768;
++ } else {
++ cnfg = READ_REG_0(sc, HIFN_0_PUCNFG) &
++ HIFN_PUCNFG_DRAMMASK;
++ sc->sc_ramsize = 1 << ((cnfg >> 13) + 18);
++ }
++ return (0);
++}
++
++static void
++hifn_alloc_slot(struct hifn_softc *sc, int *cmdp, int *srcp, int *dstp, int *resp)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (dma->cmdi == HIFN_D_CMD_RSIZE) {
++ dma->cmdi = 0;
++ dma->cmdr[HIFN_D_CMD_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->cmdr[HIFN_D_CMD_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_CMDR_SYNC(sc, HIFN_D_CMD_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *cmdp = dma->cmdi++;
++ dma->cmdk = dma->cmdi;
++
++ if (dma->srci == HIFN_D_SRC_RSIZE) {
++ dma->srci = 0;
++ dma->srcr[HIFN_D_SRC_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->srcr[HIFN_D_SRC_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_SRCR_SYNC(sc, HIFN_D_SRC_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *srcp = dma->srci++;
++ dma->srck = dma->srci;
++
++ if (dma->dsti == HIFN_D_DST_RSIZE) {
++ dma->dsti = 0;
++ dma->dstr[HIFN_D_DST_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->dstr[HIFN_D_DST_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, HIFN_D_DST_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *dstp = dma->dsti++;
++ dma->dstk = dma->dsti;
++
++ if (dma->resi == HIFN_D_RES_RSIZE) {
++ dma->resi = 0;
++ dma->resr[HIFN_D_RES_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->resr[HIFN_D_RES_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_RESR_SYNC(sc, HIFN_D_RES_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ *resp = dma->resi++;
++ dma->resk = dma->resi;
++}
++
++static int
++hifn_writeramaddr(struct hifn_softc *sc, int addr, u_int8_t *data)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ hifn_base_command_t wc;
++ const u_int32_t masks = HIFN_D_VALID | HIFN_D_LAST | HIFN_D_MASKDONEIRQ;
++ int r, cmdi, resi, srci, dsti;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ wc.masks = htole16(3 << 13);
++ wc.session_num = htole16(addr >> 14);
++ wc.total_source_count = htole16(8);
++ wc.total_dest_count = htole16(addr & 0x3fff);
++
++ hifn_alloc_slot(sc, &cmdi, &srci, &dsti, &resi);
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_ENA | HIFN_DMACSR_S_CTRL_ENA |
++ HIFN_DMACSR_D_CTRL_ENA | HIFN_DMACSR_R_CTRL_ENA);
++
++ /* build write command */
++ bzero(dma->command_bufs[cmdi], HIFN_MAX_COMMAND);
++ *(hifn_base_command_t *)dma->command_bufs[cmdi] = wc;
++ bcopy(data, &dma->test_src, sizeof(dma->test_src));
++
++ dma->srcr[srci].p = htole32(sc->sc_dma_physaddr
++ + offsetof(struct hifn_dma, test_src));
++ dma->dstr[dsti].p = htole32(sc->sc_dma_physaddr
++ + offsetof(struct hifn_dma, test_dst));
++
++ dma->cmdr[cmdi].l = htole32(16 | masks);
++ dma->srcr[srci].l = htole32(8 | masks);
++ dma->dstr[dsti].l = htole32(4 | masks);
++ dma->resr[resi].l = htole32(4 | masks);
++
++ for (r = 10000; r >= 0; r--) {
++ DELAY(10);
++ if ((dma->resr[resi].l & htole32(HIFN_D_VALID)) == 0)
++ break;
++ }
++ if (r == 0) {
++ device_printf(sc->sc_dev, "writeramaddr -- "
++ "result[%d](addr %d) still valid\n", resi, addr);
++ r = -1;
++ return (-1);
++ } else
++ r = 0;
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_DIS | HIFN_DMACSR_S_CTRL_DIS |
++ HIFN_DMACSR_D_CTRL_DIS | HIFN_DMACSR_R_CTRL_DIS);
++
++ return (r);
++}
++
++static int
++hifn_readramaddr(struct hifn_softc *sc, int addr, u_int8_t *data)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ hifn_base_command_t rc;
++ const u_int32_t masks = HIFN_D_VALID | HIFN_D_LAST | HIFN_D_MASKDONEIRQ;
++ int r, cmdi, srci, dsti, resi;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ rc.masks = htole16(2 << 13);
++ rc.session_num = htole16(addr >> 14);
++ rc.total_source_count = htole16(addr & 0x3fff);
++ rc.total_dest_count = htole16(8);
++
++ hifn_alloc_slot(sc, &cmdi, &srci, &dsti, &resi);
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_ENA | HIFN_DMACSR_S_CTRL_ENA |
++ HIFN_DMACSR_D_CTRL_ENA | HIFN_DMACSR_R_CTRL_ENA);
++
++ bzero(dma->command_bufs[cmdi], HIFN_MAX_COMMAND);
++ *(hifn_base_command_t *)dma->command_bufs[cmdi] = rc;
++
++ dma->srcr[srci].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, test_src));
++ dma->test_src = 0;
++ dma->dstr[dsti].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, test_dst));
++ dma->test_dst = 0;
++ dma->cmdr[cmdi].l = htole32(8 | masks);
++ dma->srcr[srci].l = htole32(8 | masks);
++ dma->dstr[dsti].l = htole32(8 | masks);
++ dma->resr[resi].l = htole32(HIFN_MAX_RESULT | masks);
++
++ for (r = 10000; r >= 0; r--) {
++ DELAY(10);
++ if ((dma->resr[resi].l & htole32(HIFN_D_VALID)) == 0)
++ break;
++ }
++ if (r == 0) {
++ device_printf(sc->sc_dev, "readramaddr -- "
++ "result[%d](addr %d) still valid\n", resi, addr);
++ r = -1;
++ } else {
++ r = 0;
++ bcopy(&dma->test_dst, data, sizeof(dma->test_dst));
++ }
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR,
++ HIFN_DMACSR_C_CTRL_DIS | HIFN_DMACSR_S_CTRL_DIS |
++ HIFN_DMACSR_D_CTRL_DIS | HIFN_DMACSR_R_CTRL_DIS);
++
++ return (r);
++}
++
++/*
++ * Initialize the descriptor rings.
++ */
++static void
++hifn_init_dma(struct hifn_softc *sc)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ hifn_set_retry(sc);
++
++ /* initialize static pointer values */
++ for (i = 0; i < HIFN_D_CMD_RSIZE; i++)
++ dma->cmdr[i].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, command_bufs[i][0]));
++ for (i = 0; i < HIFN_D_RES_RSIZE; i++)
++ dma->resr[i].p = htole32(sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, result_bufs[i][0]));
++
++ dma->cmdr[HIFN_D_CMD_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, cmdr[0]));
++ dma->srcr[HIFN_D_SRC_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, srcr[0]));
++ dma->dstr[HIFN_D_DST_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, dstr[0]));
++ dma->resr[HIFN_D_RES_RSIZE].p =
++ htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, resr[0]));
++
++ dma->cmdu = dma->srcu = dma->dstu = dma->resu = 0;
++ dma->cmdi = dma->srci = dma->dsti = dma->resi = 0;
++ dma->cmdk = dma->srck = dma->dstk = dma->resk = 0;
++}
++
++/*
++ * Writes out the raw command buffer space. Returns the
++ * command buffer size.
++ */
++static u_int
++hifn_write_command(struct hifn_command *cmd, u_int8_t *buf)
++{
++ struct hifn_softc *sc = NULL;
++ u_int8_t *buf_pos;
++ hifn_base_command_t *base_cmd;
++ hifn_mac_command_t *mac_cmd;
++ hifn_crypt_command_t *cry_cmd;
++ int using_mac, using_crypt, len, ivlen;
++ u_int32_t dlen, slen;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ buf_pos = buf;
++ using_mac = cmd->base_masks & HIFN_BASE_CMD_MAC;
++ using_crypt = cmd->base_masks & HIFN_BASE_CMD_CRYPT;
++
++ base_cmd = (hifn_base_command_t *)buf_pos;
++ base_cmd->masks = htole16(cmd->base_masks);
++ slen = cmd->src_mapsize;
++ if (cmd->sloplen)
++ dlen = cmd->dst_mapsize - cmd->sloplen + sizeof(u_int32_t);
++ else
++ dlen = cmd->dst_mapsize;
++ base_cmd->total_source_count = htole16(slen & HIFN_BASE_CMD_LENMASK_LO);
++ base_cmd->total_dest_count = htole16(dlen & HIFN_BASE_CMD_LENMASK_LO);
++ dlen >>= 16;
++ slen >>= 16;
++ base_cmd->session_num = htole16(
++ ((slen << HIFN_BASE_CMD_SRCLEN_S) & HIFN_BASE_CMD_SRCLEN_M) |
++ ((dlen << HIFN_BASE_CMD_DSTLEN_S) & HIFN_BASE_CMD_DSTLEN_M));
++ buf_pos += sizeof(hifn_base_command_t);
++
++ if (using_mac) {
++ mac_cmd = (hifn_mac_command_t *)buf_pos;
++ dlen = cmd->maccrd->crd_len;
++ mac_cmd->source_count = htole16(dlen & 0xffff);
++ dlen >>= 16;
++ mac_cmd->masks = htole16(cmd->mac_masks |
++ ((dlen << HIFN_MAC_CMD_SRCLEN_S) & HIFN_MAC_CMD_SRCLEN_M));
++ mac_cmd->header_skip = htole16(cmd->maccrd->crd_skip);
++ mac_cmd->reserved = 0;
++ buf_pos += sizeof(hifn_mac_command_t);
++ }
++
++ if (using_crypt) {
++ cry_cmd = (hifn_crypt_command_t *)buf_pos;
++ dlen = cmd->enccrd->crd_len;
++ cry_cmd->source_count = htole16(dlen & 0xffff);
++ dlen >>= 16;
++ cry_cmd->masks = htole16(cmd->cry_masks |
++ ((dlen << HIFN_CRYPT_CMD_SRCLEN_S) & HIFN_CRYPT_CMD_SRCLEN_M));
++ cry_cmd->header_skip = htole16(cmd->enccrd->crd_skip);
++ cry_cmd->reserved = 0;
++ buf_pos += sizeof(hifn_crypt_command_t);
++ }
++
++ if (using_mac && cmd->mac_masks & HIFN_MAC_CMD_NEW_KEY) {
++ bcopy(cmd->mac, buf_pos, HIFN_MAC_KEY_LENGTH);
++ buf_pos += HIFN_MAC_KEY_LENGTH;
++ }
++
++ if (using_crypt && cmd->cry_masks & HIFN_CRYPT_CMD_NEW_KEY) {
++ switch (cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) {
++ case HIFN_CRYPT_CMD_ALG_3DES:
++ bcopy(cmd->ck, buf_pos, HIFN_3DES_KEY_LENGTH);
++ buf_pos += HIFN_3DES_KEY_LENGTH;
++ break;
++ case HIFN_CRYPT_CMD_ALG_DES:
++ bcopy(cmd->ck, buf_pos, HIFN_DES_KEY_LENGTH);
++ buf_pos += HIFN_DES_KEY_LENGTH;
++ break;
++ case HIFN_CRYPT_CMD_ALG_RC4:
++ len = 256;
++ do {
++ int clen;
++
++ clen = MIN(cmd->cklen, len);
++ bcopy(cmd->ck, buf_pos, clen);
++ len -= clen;
++ buf_pos += clen;
++ } while (len > 0);
++ bzero(buf_pos, 4);
++ buf_pos += 4;
++ break;
++ case HIFN_CRYPT_CMD_ALG_AES:
++ /*
++ * AES keys are variable 128, 192 and
++ * 256 bits (16, 24 and 32 bytes).
++ */
++ bcopy(cmd->ck, buf_pos, cmd->cklen);
++ buf_pos += cmd->cklen;
++ break;
++ }
++ }
++
++ if (using_crypt && cmd->cry_masks & HIFN_CRYPT_CMD_NEW_IV) {
++ switch (cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) {
++ case HIFN_CRYPT_CMD_ALG_AES:
++ ivlen = HIFN_AES_IV_LENGTH;
++ break;
++ default:
++ ivlen = HIFN_IV_LENGTH;
++ break;
++ }
++ bcopy(cmd->iv, buf_pos, ivlen);
++ buf_pos += ivlen;
++ }
++
++ if ((cmd->base_masks & (HIFN_BASE_CMD_MAC|HIFN_BASE_CMD_CRYPT)) == 0) {
++ bzero(buf_pos, 8);
++ buf_pos += 8;
++ }
++
++ return (buf_pos - buf);
++}
++
++static int
++hifn_dmamap_aligned(struct hifn_operand *op)
++{
++ struct hifn_softc *sc = NULL;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ for (i = 0; i < op->nsegs; i++) {
++ if (op->segs[i].ds_addr & 3)
++ return (0);
++ if ((i != (op->nsegs - 1)) && (op->segs[i].ds_len & 3))
++ return (0);
++ }
++ return (1);
++}
++
++static __inline int
++hifn_dmamap_dstwrap(struct hifn_softc *sc, int idx)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++
++ if (++idx == HIFN_D_DST_RSIZE) {
++ dma->dstr[idx].l = htole32(HIFN_D_VALID | HIFN_D_JUMP |
++ HIFN_D_MASKDONEIRQ);
++ HIFN_DSTR_SYNC(sc, idx,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ idx = 0;
++ }
++ return (idx);
++}
++
++static int
++hifn_dmamap_load_dst(struct hifn_softc *sc, struct hifn_command *cmd)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct hifn_operand *dst = &cmd->dst;
++ u_int32_t p, l;
++ int idx, used = 0, i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ idx = dma->dsti;
++ for (i = 0; i < dst->nsegs - 1; i++) {
++ dma->dstr[idx].p = htole32(dst->segs[i].ds_addr);
++ dma->dstr[idx].l = htole32(HIFN_D_MASKDONEIRQ | dst->segs[i].ds_len);
++ wmb();
++ dma->dstr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, idx,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ used++;
++
++ idx = hifn_dmamap_dstwrap(sc, idx);
++ }
++
++ if (cmd->sloplen == 0) {
++ p = dst->segs[i].ds_addr;
++ l = HIFN_D_MASKDONEIRQ | HIFN_D_LAST |
++ dst->segs[i].ds_len;
++ } else {
++ p = sc->sc_dma_physaddr +
++ offsetof(struct hifn_dma, slop[cmd->slopidx]);
++ l = HIFN_D_MASKDONEIRQ | HIFN_D_LAST |
++ sizeof(u_int32_t);
++
++ if ((dst->segs[i].ds_len - cmd->sloplen) != 0) {
++ dma->dstr[idx].p = htole32(dst->segs[i].ds_addr);
++ dma->dstr[idx].l = htole32(HIFN_D_MASKDONEIRQ |
++ (dst->segs[i].ds_len - cmd->sloplen));
++ wmb();
++ dma->dstr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, idx,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ used++;
++
++ idx = hifn_dmamap_dstwrap(sc, idx);
++ }
++ }
++ dma->dstr[idx].p = htole32(p);
++ dma->dstr[idx].l = htole32(l);
++ wmb();
++ dma->dstr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_DSTR_SYNC(sc, idx, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ used++;
++
++ idx = hifn_dmamap_dstwrap(sc, idx);
++
++ dma->dsti = idx;
++ dma->dstu += used;
++ return (idx);
++}
++
++static __inline int
++hifn_dmamap_srcwrap(struct hifn_softc *sc, int idx)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++
++ if (++idx == HIFN_D_SRC_RSIZE) {
++ dma->srcr[idx].l = htole32(HIFN_D_VALID |
++ HIFN_D_JUMP | HIFN_D_MASKDONEIRQ);
++ HIFN_SRCR_SYNC(sc, HIFN_D_SRC_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ idx = 0;
++ }
++ return (idx);
++}
++
++static int
++hifn_dmamap_load_src(struct hifn_softc *sc, struct hifn_command *cmd)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct hifn_operand *src = &cmd->src;
++ int idx, i;
++ u_int32_t last = 0;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ idx = dma->srci;
++ for (i = 0; i < src->nsegs; i++) {
++ if (i == src->nsegs - 1)
++ last = HIFN_D_LAST;
++
++ dma->srcr[idx].p = htole32(src->segs[i].ds_addr);
++ dma->srcr[idx].l = htole32(src->segs[i].ds_len |
++ HIFN_D_MASKDONEIRQ | last);
++ wmb();
++ dma->srcr[idx].l |= htole32(HIFN_D_VALID);
++ HIFN_SRCR_SYNC(sc, idx,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++
++ idx = hifn_dmamap_srcwrap(sc, idx);
++ }
++ dma->srci = idx;
++ dma->srcu += src->nsegs;
++ return (idx);
++}
++
++
++static int
++hifn_crypto(
++ struct hifn_softc *sc,
++ struct hifn_command *cmd,
++ struct cryptop *crp,
++ int hint)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ u_int32_t cmdlen, csr;
++ int cmdi, resi, err = 0;
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /*
++ * need 1 cmd, and 1 res
++ *
++ * NB: check this first since it's easy.
++ */
++ HIFN_LOCK(sc);
++ if ((dma->cmdu + 1) > HIFN_D_CMD_RSIZE ||
++ (dma->resu + 1) > HIFN_D_RES_RSIZE) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "cmd/result exhaustion, cmdu %u resu %u\n",
++ dma->cmdu, dma->resu);
++ }
++#endif
++ hifnstats.hst_nomem_cr++;
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ HIFN_UNLOCK(sc);
++ return (ERESTART);
++ }
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (pci_map_skb(sc, &cmd->src, cmd->src_skb)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_srcmap1;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ if (pci_map_uio(sc, &cmd->src, cmd->src_io)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_srcmap1;
++ }
++ } else {
++ if (pci_map_buf(sc, &cmd->src, cmd->src_buf, crp->crp_ilen)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_srcmap1;
++ }
++ }
++
++ if (hifn_dmamap_aligned(&cmd->src)) {
++ cmd->sloplen = cmd->src_mapsize & 3;
++ cmd->dst = cmd->src;
++ } else {
++ if (crp->crp_flags & CRYPTO_F_IOV) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto err_srcmap;
++ } else if (crp->crp_flags & CRYPTO_F_SKBUF) {
++#ifdef NOTYET
++ int totlen, len;
++ struct mbuf *m, *m0, *mlast;
++
++ KASSERT(cmd->dst_m == cmd->src_m,
++ ("hifn_crypto: dst_m initialized improperly"));
++ hifnstats.hst_unaligned++;
++ /*
++ * Source is not aligned on a longword boundary.
++ * Copy the data to insure alignment. If we fail
++ * to allocate mbufs or clusters while doing this
++ * we return ERESTART so the operation is requeued
++ * at the crypto later, but only if there are
++ * ops already posted to the hardware; otherwise we
++ * have no guarantee that we'll be re-entered.
++ */
++ totlen = cmd->src_mapsize;
++ if (cmd->src_m->m_flags & M_PKTHDR) {
++ len = MHLEN;
++ MGETHDR(m0, M_DONTWAIT, MT_DATA);
++ if (m0 && !m_dup_pkthdr(m0, cmd->src_m, M_DONTWAIT)) {
++ m_free(m0);
++ m0 = NULL;
++ }
++ } else {
++ len = MLEN;
++ MGET(m0, M_DONTWAIT, MT_DATA);
++ }
++ if (m0 == NULL) {
++ hifnstats.hst_nomem_mbuf++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ goto err_srcmap;
++ }
++ if (totlen >= MINCLSIZE) {
++ MCLGET(m0, M_DONTWAIT);
++ if ((m0->m_flags & M_EXT) == 0) {
++ hifnstats.hst_nomem_mcl++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ m_freem(m0);
++ goto err_srcmap;
++ }
++ len = MCLBYTES;
++ }
++ totlen -= len;
++ m0->m_pkthdr.len = m0->m_len = len;
++ mlast = m0;
++
++ while (totlen > 0) {
++ MGET(m, M_DONTWAIT, MT_DATA);
++ if (m == NULL) {
++ hifnstats.hst_nomem_mbuf++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ m_freem(m0);
++ goto err_srcmap;
++ }
++ len = MLEN;
++ if (totlen >= MINCLSIZE) {
++ MCLGET(m, M_DONTWAIT);
++ if ((m->m_flags & M_EXT) == 0) {
++ hifnstats.hst_nomem_mcl++;
++ err = dma->cmdu ? ERESTART : ENOMEM;
++ mlast->m_next = m;
++ m_freem(m0);
++ goto err_srcmap;
++ }
++ len = MCLBYTES;
++ }
++
++ m->m_len = len;
++ m0->m_pkthdr.len += len;
++ totlen -= len;
++
++ mlast->m_next = m;
++ mlast = m;
++ }
++ cmd->dst_m = m0;
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF unaligned not implemented\n",
++ __FILE__, __LINE__);
++ err = EINVAL;
++ goto err_srcmap;
++#endif
++ } else {
++ device_printf(sc->sc_dev,
++ "%s,%d: unaligned contig buffers not implemented\n",
++ __FILE__, __LINE__);
++ err = EINVAL;
++ goto err_srcmap;
++ }
++ }
++
++ if (cmd->dst_map == NULL) {
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (pci_map_skb(sc, &cmd->dst, cmd->dst_skb)) {
++ hifnstats.hst_nomem_map++;
++ err = ENOMEM;
++ goto err_dstmap1;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ if (pci_map_uio(sc, &cmd->dst, cmd->dst_io)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_dstmap1;
++ }
++ } else {
++ if (pci_map_buf(sc, &cmd->dst, cmd->dst_buf, crp->crp_ilen)) {
++ hifnstats.hst_nomem_load++;
++ err = ENOMEM;
++ goto err_dstmap1;
++ }
++ }
++ }
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "Entering cmd: stat %8x ien %8x u %d/%d/%d/%d n %d/%d\n",
++ READ_REG_1(sc, HIFN_1_DMA_CSR),
++ READ_REG_1(sc, HIFN_1_DMA_IER),
++ dma->cmdu, dma->srcu, dma->dstu, dma->resu,
++ cmd->src_nsegs, cmd->dst_nsegs);
++ }
++#endif
++
++#if 0
++ if (cmd->src_map == cmd->dst_map) {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
++ } else {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_PREWRITE);
++ bus_dmamap_sync(sc->sc_dmat, cmd->dst_map,
++ BUS_DMASYNC_PREREAD);
++ }
++#endif
++
++ /*
++ * need N src, and N dst
++ */
++ if ((dma->srcu + cmd->src_nsegs) > HIFN_D_SRC_RSIZE ||
++ (dma->dstu + cmd->dst_nsegs + 1) > HIFN_D_DST_RSIZE) {
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "src/dst exhaustion, srcu %u+%u dstu %u+%u\n",
++ dma->srcu, cmd->src_nsegs,
++ dma->dstu, cmd->dst_nsegs);
++ }
++#endif
++ hifnstats.hst_nomem_sd++;
++ err = ERESTART;
++ goto err_dstmap;
++ }
++
++ if (dma->cmdi == HIFN_D_CMD_RSIZE) {
++ dma->cmdi = 0;
++ dma->cmdr[HIFN_D_CMD_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->cmdr[HIFN_D_CMD_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_CMDR_SYNC(sc, HIFN_D_CMD_RSIZE,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ }
++ cmdi = dma->cmdi++;
++ cmdlen = hifn_write_command(cmd, dma->command_bufs[cmdi]);
++ HIFN_CMD_SYNC(sc, cmdi, BUS_DMASYNC_PREWRITE);
++
++ /* .p for command/result already set */
++ dma->cmdr[cmdi].l = htole32(cmdlen | HIFN_D_LAST |
++ HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->cmdr[cmdi].l |= htole32(HIFN_D_VALID);
++ HIFN_CMDR_SYNC(sc, cmdi,
++ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
++ dma->cmdu++;
++
++ /*
++ * We don't worry about missing an interrupt (which a "command wait"
++ * interrupt salvages us from), unless there is more than one command
++ * in the queue.
++ */
++ if (dma->cmdu > 1) {
++ sc->sc_dmaier |= HIFN_DMAIER_C_WAIT;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++ }
++
++ hifnstats.hst_ipackets++;
++ hifnstats.hst_ibytes += cmd->src_mapsize;
++
++ hifn_dmamap_load_src(sc, cmd);
++
++ /*
++ * Unlike other descriptors, we don't mask done interrupt from
++ * result descriptor.
++ */
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev, "load res\n");
++#endif
++ if (dma->resi == HIFN_D_RES_RSIZE) {
++ dma->resi = 0;
++ dma->resr[HIFN_D_RES_RSIZE].l = htole32(HIFN_D_JUMP|HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->resr[HIFN_D_RES_RSIZE].l |= htole32(HIFN_D_VALID);
++ HIFN_RESR_SYNC(sc, HIFN_D_RES_RSIZE,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ }
++ resi = dma->resi++;
++ KASSERT(dma->hifn_commands[resi] == NULL,
++ ("hifn_crypto: command slot %u busy", resi));
++ dma->hifn_commands[resi] = cmd;
++ HIFN_RES_SYNC(sc, resi, BUS_DMASYNC_PREREAD);
++ if ((hint & CRYPTO_HINT_MORE) && sc->sc_curbatch < hifn_maxbatch) {
++ dma->resr[resi].l = htole32(HIFN_MAX_RESULT |
++ HIFN_D_LAST | HIFN_D_MASKDONEIRQ);
++ wmb();
++ dma->resr[resi].l |= htole32(HIFN_D_VALID);
++ sc->sc_curbatch++;
++ if (sc->sc_curbatch > hifnstats.hst_maxbatch)
++ hifnstats.hst_maxbatch = sc->sc_curbatch;
++ hifnstats.hst_totbatch++;
++ } else {
++ dma->resr[resi].l = htole32(HIFN_MAX_RESULT | HIFN_D_LAST);
++ wmb();
++ dma->resr[resi].l |= htole32(HIFN_D_VALID);
++ sc->sc_curbatch = 0;
++ }
++ HIFN_RESR_SYNC(sc, resi,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ dma->resu++;
++
++ if (cmd->sloplen)
++ cmd->slopidx = resi;
++
++ hifn_dmamap_load_dst(sc, cmd);
++
++ csr = 0;
++ if (sc->sc_c_busy == 0) {
++ csr |= HIFN_DMACSR_C_CTRL_ENA;
++ sc->sc_c_busy = 1;
++ }
++ if (sc->sc_s_busy == 0) {
++ csr |= HIFN_DMACSR_S_CTRL_ENA;
++ sc->sc_s_busy = 1;
++ }
++ if (sc->sc_r_busy == 0) {
++ csr |= HIFN_DMACSR_R_CTRL_ENA;
++ sc->sc_r_busy = 1;
++ }
++ if (sc->sc_d_busy == 0) {
++ csr |= HIFN_DMACSR_D_CTRL_ENA;
++ sc->sc_d_busy = 1;
++ }
++ if (csr)
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR, csr);
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev, "command: stat %8x ier %8x\n",
++ READ_REG_1(sc, HIFN_1_DMA_CSR),
++ READ_REG_1(sc, HIFN_1_DMA_IER));
++ }
++#endif
++
++ sc->sc_active = 5;
++ HIFN_UNLOCK(sc);
++ KASSERT(err == 0, ("hifn_crypto: success with error %u", err));
++ return (err); /* success */
++
++err_dstmap:
++ if (cmd->src_map != cmd->dst_map)
++ pci_unmap_buf(sc, &cmd->dst);
++err_dstmap1:
++err_srcmap:
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (cmd->src_skb != cmd->dst_skb)
++#ifdef NOTYET
++ m_freem(cmd->dst_m);
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF src != dst not implemented\n",
++ __FILE__, __LINE__);
++#endif
++ }
++ pci_unmap_buf(sc, &cmd->src);
++err_srcmap1:
++ HIFN_UNLOCK(sc);
++ return (err);
++}
++
++static void
++hifn_tick(unsigned long arg)
++{
++ struct hifn_softc *sc;
++ unsigned long l_flags;
++
++ if (arg >= HIFN_MAX_CHIPS)
++ return;
++ sc = hifn_chip_idx[arg];
++ if (!sc)
++ return;
++
++ HIFN_LOCK(sc);
++ if (sc->sc_active == 0) {
++ struct hifn_dma *dma = sc->sc_dma;
++ u_int32_t r = 0;
++
++ if (dma->cmdu == 0 && sc->sc_c_busy) {
++ sc->sc_c_busy = 0;
++ r |= HIFN_DMACSR_C_CTRL_DIS;
++ }
++ if (dma->srcu == 0 && sc->sc_s_busy) {
++ sc->sc_s_busy = 0;
++ r |= HIFN_DMACSR_S_CTRL_DIS;
++ }
++ if (dma->dstu == 0 && sc->sc_d_busy) {
++ sc->sc_d_busy = 0;
++ r |= HIFN_DMACSR_D_CTRL_DIS;
++ }
++ if (dma->resu == 0 && sc->sc_r_busy) {
++ sc->sc_r_busy = 0;
++ r |= HIFN_DMACSR_R_CTRL_DIS;
++ }
++ if (r)
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR, r);
++ } else
++ sc->sc_active--;
++ HIFN_UNLOCK(sc);
++ mod_timer(&sc->sc_tickto, jiffies + HZ);
++}
++
++static irqreturn_t
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++hifn_intr(int irq, void *arg)
++#else
++hifn_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct hifn_softc *sc = arg;
++ struct hifn_dma *dma;
++ u_int32_t dmacsr, restart;
++ int i, u;
++ unsigned long l_flags;
++
++ dmacsr = READ_REG_1(sc, HIFN_1_DMA_CSR);
++
++ /* Nothing in the DMA unit interrupted */
++ if ((dmacsr & sc->sc_dmaier) == 0)
++ return IRQ_NONE;
++
++ HIFN_LOCK(sc);
++
++ dma = sc->sc_dma;
++
++#ifdef HIFN_DEBUG
++ if (hifn_debug) {
++ device_printf(sc->sc_dev,
++ "irq: stat %08x ien %08x damier %08x i %d/%d/%d/%d k %d/%d/%d/%d u %d/%d/%d/%d\n",
++ dmacsr, READ_REG_1(sc, HIFN_1_DMA_IER), sc->sc_dmaier,
++ dma->cmdi, dma->srci, dma->dsti, dma->resi,
++ dma->cmdk, dma->srck, dma->dstk, dma->resk,
++ dma->cmdu, dma->srcu, dma->dstu, dma->resu);
++ }
++#endif
++
++ WRITE_REG_1(sc, HIFN_1_DMA_CSR, dmacsr & sc->sc_dmaier);
++
++ if ((sc->sc_flags & HIFN_HAS_PUBLIC) &&
++ (dmacsr & HIFN_DMACSR_PUBDONE))
++ WRITE_REG_1(sc, HIFN_1_PUB_STATUS,
++ READ_REG_1(sc, HIFN_1_PUB_STATUS) | HIFN_PUBSTS_DONE);
++
++ restart = dmacsr & (HIFN_DMACSR_D_OVER | HIFN_DMACSR_R_OVER);
++ if (restart)
++ device_printf(sc->sc_dev, "overrun %x\n", dmacsr);
++
++ if (sc->sc_flags & HIFN_IS_7811) {
++ if (dmacsr & HIFN_DMACSR_ILLR)
++ device_printf(sc->sc_dev, "illegal read\n");
++ if (dmacsr & HIFN_DMACSR_ILLW)
++ device_printf(sc->sc_dev, "illegal write\n");
++ }
++
++ restart = dmacsr & (HIFN_DMACSR_C_ABORT | HIFN_DMACSR_S_ABORT |
++ HIFN_DMACSR_D_ABORT | HIFN_DMACSR_R_ABORT);
++ if (restart) {
++ device_printf(sc->sc_dev, "abort, resetting.\n");
++ hifnstats.hst_abort++;
++ hifn_abort(sc);
++ HIFN_UNLOCK(sc);
++ return IRQ_HANDLED;
++ }
++
++ if ((dmacsr & HIFN_DMACSR_C_WAIT) && (dma->cmdu == 0)) {
++ /*
++ * If no slots to process and we receive a "waiting on
++ * command" interrupt, we disable the "waiting on command"
++ * (by clearing it).
++ */
++ sc->sc_dmaier &= ~HIFN_DMAIER_C_WAIT;
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier);
++ }
++
++ /* clear the rings */
++ i = dma->resk; u = dma->resu;
++ while (u != 0) {
++ HIFN_RESR_SYNC(sc, i,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++ if (dma->resr[i].l & htole32(HIFN_D_VALID)) {
++ HIFN_RESR_SYNC(sc, i,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ break;
++ }
++
++ if (i != HIFN_D_RES_RSIZE) {
++ struct hifn_command *cmd;
++ u_int8_t *macbuf = NULL;
++
++ HIFN_RES_SYNC(sc, i, BUS_DMASYNC_POSTREAD);
++ cmd = dma->hifn_commands[i];
++ KASSERT(cmd != NULL,
++ ("hifn_intr: null command slot %u", i));
++ dma->hifn_commands[i] = NULL;
++
++ if (cmd->base_masks & HIFN_BASE_CMD_MAC) {
++ macbuf = dma->result_bufs[i];
++ macbuf += 12;
++ }
++
++ hifn_callback(sc, cmd, macbuf);
++ hifnstats.hst_opackets++;
++ u--;
++ }
++
++ if (++i == (HIFN_D_RES_RSIZE + 1))
++ i = 0;
++ }
++ dma->resk = i; dma->resu = u;
++
++ i = dma->srck; u = dma->srcu;
++ while (u != 0) {
++ if (i == HIFN_D_SRC_RSIZE)
++ i = 0;
++ HIFN_SRCR_SYNC(sc, i,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++ if (dma->srcr[i].l & htole32(HIFN_D_VALID)) {
++ HIFN_SRCR_SYNC(sc, i,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ break;
++ }
++ i++, u--;
++ }
++ dma->srck = i; dma->srcu = u;
++
++ i = dma->cmdk; u = dma->cmdu;
++ while (u != 0) {
++ HIFN_CMDR_SYNC(sc, i,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++ if (dma->cmdr[i].l & htole32(HIFN_D_VALID)) {
++ HIFN_CMDR_SYNC(sc, i,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++ break;
++ }
++ if (i != HIFN_D_CMD_RSIZE) {
++ u--;
++ HIFN_CMD_SYNC(sc, i, BUS_DMASYNC_POSTWRITE);
++ }
++ if (++i == (HIFN_D_CMD_RSIZE + 1))
++ i = 0;
++ }
++ dma->cmdk = i; dma->cmdu = u;
++
++ HIFN_UNLOCK(sc);
++
++ if (sc->sc_needwakeup) { /* XXX check high watermark */
++ int wakeup = sc->sc_needwakeup & (CRYPTO_SYMQ|CRYPTO_ASYMQ);
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev,
++ "wakeup crypto (%x) u %d/%d/%d/%d\n",
++ sc->sc_needwakeup,
++ dma->cmdu, dma->srcu, dma->dstu, dma->resu);
++#endif
++ sc->sc_needwakeup &= ~wakeup;
++ crypto_unblock(sc->sc_cid, wakeup);
++ }
++
++ return IRQ_HANDLED;
++}
++
++/*
++ * Allocate a new 'session' and return an encoded session id. 'sidp'
++ * contains our registration id, and should contain an encoded session
++ * id on successful allocation.
++ */
++static int
++hifn_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct hifn_softc *sc = device_get_softc(dev);
++ struct cryptoini *c;
++ int mac = 0, cry = 0, sesn;
++ struct hifn_session *ses = NULL;
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ KASSERT(sc != NULL, ("hifn_newsession: null softc"));
++ if (sidp == NULL || cri == NULL || sc == NULL) {
++ DPRINTF("%s,%d: %s - EINVAL\n", __FILE__, __LINE__, __FUNCTION__);
++ return (EINVAL);
++ }
++
++ HIFN_LOCK(sc);
++ if (sc->sc_sessions == NULL) {
++ ses = sc->sc_sessions = (struct hifn_session *)kmalloc(sizeof(*ses),
++ SLAB_ATOMIC);
++ if (ses == NULL) {
++ HIFN_UNLOCK(sc);
++ return (ENOMEM);
++ }
++ sesn = 0;
++ sc->sc_nsessions = 1;
++ } else {
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (!sc->sc_sessions[sesn].hs_used) {
++ ses = &sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ sesn = sc->sc_nsessions;
++ ses = (struct hifn_session *)kmalloc((sesn + 1) * sizeof(*ses),
++ SLAB_ATOMIC);
++ if (ses == NULL) {
++ HIFN_UNLOCK(sc);
++ return (ENOMEM);
++ }
++ bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses));
++ bzero(sc->sc_sessions, sesn * sizeof(*ses));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = ses;
++ ses = &sc->sc_sessions[sesn];
++ sc->sc_nsessions++;
++ }
++ }
++ HIFN_UNLOCK(sc);
++
++ bzero(ses, sizeof(*ses));
++ ses->hs_used = 1;
++
++ for (c = cri; c != NULL; c = c->cri_next) {
++ switch (c->cri_alg) {
++ case CRYPTO_MD5:
++ case CRYPTO_SHA1:
++ case CRYPTO_MD5_HMAC:
++ case CRYPTO_SHA1_HMAC:
++ if (mac) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ mac = 1;
++ ses->hs_mlen = c->cri_mlen;
++ if (ses->hs_mlen == 0) {
++ switch (c->cri_alg) {
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ ses->hs_mlen = 16;
++ break;
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ ses->hs_mlen = 20;
++ break;
++ }
++ }
++ break;
++ case CRYPTO_DES_CBC:
++ case CRYPTO_3DES_CBC:
++ case CRYPTO_AES_CBC:
++ /* XXX this may read fewer, does it matter? */
++ read_random(ses->hs_iv,
++ c->cri_alg == CRYPTO_AES_CBC ?
++ HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH);
++ /*FALLTHROUGH*/
++ case CRYPTO_ARC4:
++ if (cry) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ cry = 1;
++ break;
++ default:
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ }
++ if (mac == 0 && cry == 0) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++
++ *sidp = HIFN_SID(device_get_unit(sc->sc_dev), sesn);
++
++ return (0);
++}
++
++/*
++ * Deallocate a session.
++ * XXX this routine should run a zero'd mac/encrypt key into context ram.
++ * XXX to blow away any keys already stored there.
++ */
++static int
++hifn_freesession(device_t dev, u_int64_t tid)
++{
++ struct hifn_softc *sc = device_get_softc(dev);
++ int session, error;
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ KASSERT(sc != NULL, ("hifn_freesession: null softc"));
++ if (sc == NULL) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++
++ HIFN_LOCK(sc);
++ session = HIFN_SESSION(sid);
++ if (session < sc->sc_nsessions) {
++ bzero(&sc->sc_sessions[session], sizeof(struct hifn_session));
++ error = 0;
++ } else {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ error = EINVAL;
++ }
++ HIFN_UNLOCK(sc);
++
++ return (error);
++}
++
++static int
++hifn_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct hifn_softc *sc = device_get_softc(dev);
++ struct hifn_command *cmd = NULL;
++ int session, err, ivlen;
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (crp == NULL || crp->crp_callback == NULL) {
++ hifnstats.hst_invalid++;
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ return (EINVAL);
++ }
++ session = HIFN_SESSION(crp->crp_sid);
++
++ if (sc == NULL || session >= sc->sc_nsessions) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++
++ cmd = kmalloc(sizeof(struct hifn_command), SLAB_ATOMIC);
++ if (cmd == NULL) {
++ hifnstats.hst_nomem++;
++ err = ENOMEM;
++ goto errout;
++ }
++ memset(cmd, 0, sizeof(*cmd));
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ cmd->src_skb = (struct sk_buff *)crp->crp_buf;
++ cmd->dst_skb = (struct sk_buff *)crp->crp_buf;
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ cmd->src_io = (struct uio *)crp->crp_buf;
++ cmd->dst_io = (struct uio *)crp->crp_buf;
++ } else {
++ cmd->src_buf = crp->crp_buf;
++ cmd->dst_buf = crp->crp_buf;
++ }
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++
++ if (crd2 == NULL) {
++ if (crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1 ||
++ crd1->crd_alg == CRYPTO_MD5) {
++ maccrd = crd1;
++ enccrd = NULL;
++ } else if (crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4) {
++ if ((crd1->crd_flags & CRD_F_ENCRYPT) == 0)
++ cmd->base_masks |= HIFN_BASE_CMD_DECODE;
++ maccrd = NULL;
++ enccrd = crd1;
++ } else {
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ } else {
++ if ((crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_MD5 ||
++ crd1->crd_alg == CRYPTO_SHA1) &&
++ (crd2->crd_alg == CRYPTO_DES_CBC ||
++ crd2->crd_alg == CRYPTO_3DES_CBC ||
++ crd2->crd_alg == CRYPTO_AES_CBC ||
++ crd2->crd_alg == CRYPTO_ARC4) &&
++ ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) {
++ cmd->base_masks = HIFN_BASE_CMD_DECODE;
++ maccrd = crd1;
++ enccrd = crd2;
++ } else if ((crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4 ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC) &&
++ (crd2->crd_alg == CRYPTO_MD5_HMAC ||
++ crd2->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd2->crd_alg == CRYPTO_MD5 ||
++ crd2->crd_alg == CRYPTO_SHA1) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT)) {
++ enccrd = crd1;
++ maccrd = crd2;
++ } else {
++ /*
++ * We cannot order the 7751 as requested
++ */
++ DPRINTF("%s,%d: %s %d,%d,%d - EINVAL\n",__FILE__,__LINE__,__FUNCTION__, crd1->crd_alg, crd2->crd_alg, crd1->crd_flags & CRD_F_ENCRYPT);
++ err = EINVAL;
++ goto errout;
++ }
++ }
++
++ if (enccrd) {
++ cmd->enccrd = enccrd;
++ cmd->base_masks |= HIFN_BASE_CMD_CRYPT;
++ switch (enccrd->crd_alg) {
++ case CRYPTO_ARC4:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_RC4;
++ break;
++ case CRYPTO_DES_CBC:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES |
++ HIFN_CRYPT_CMD_MODE_CBC |
++ HIFN_CRYPT_CMD_NEW_IV;
++ break;
++ case CRYPTO_3DES_CBC:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_3DES |
++ HIFN_CRYPT_CMD_MODE_CBC |
++ HIFN_CRYPT_CMD_NEW_IV;
++ break;
++ case CRYPTO_AES_CBC:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_AES |
++ HIFN_CRYPT_CMD_MODE_CBC |
++ HIFN_CRYPT_CMD_NEW_IV;
++ break;
++ default:
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ if (enccrd->crd_alg != CRYPTO_ARC4) {
++ ivlen = ((enccrd->crd_alg == CRYPTO_AES_CBC) ?
++ HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH);
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ bcopy(enccrd->crd_iv, cmd->iv, ivlen);
++ else
++ bcopy(sc->sc_sessions[session].hs_iv,
++ cmd->iv, ivlen);
++
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT)
++ == 0) {
++ crypto_copyback(crp->crp_flags,
++ crp->crp_buf, enccrd->crd_inject,
++ ivlen, cmd->iv);
++ }
++ } else {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ bcopy(enccrd->crd_iv, cmd->iv, ivlen);
++ else {
++ crypto_copydata(crp->crp_flags,
++ crp->crp_buf, enccrd->crd_inject,
++ ivlen, cmd->iv);
++ }
++ }
++ }
++
++ if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT)
++ cmd->cry_masks |= HIFN_CRYPT_CMD_NEW_KEY;
++ cmd->ck = enccrd->crd_key;
++ cmd->cklen = enccrd->crd_klen >> 3;
++ cmd->cry_masks |= HIFN_CRYPT_CMD_NEW_KEY;
++
++ /*
++ * Need to specify the size for the AES key in the masks.
++ */
++ if ((cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) ==
++ HIFN_CRYPT_CMD_ALG_AES) {
++ switch (cmd->cklen) {
++ case 16:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_KSZ_128;
++ break;
++ case 24:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_KSZ_192;
++ break;
++ case 32:
++ cmd->cry_masks |= HIFN_CRYPT_CMD_KSZ_256;
++ break;
++ default:
++ DPRINTF("%s,%d: %s - EINVAL\n",__FILE__,__LINE__,__FUNCTION__);
++ err = EINVAL;
++ goto errout;
++ }
++ }
++ }
++
++ if (maccrd) {
++ cmd->maccrd = maccrd;
++ cmd->base_masks |= HIFN_BASE_CMD_MAC;
++
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH |
++ HIFN_MAC_CMD_POS_IPSEC;
++ break;
++ case CRYPTO_MD5_HMAC:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC |
++ HIFN_MAC_CMD_POS_IPSEC | HIFN_MAC_CMD_TRUNC;
++ break;
++ case CRYPTO_SHA1:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_SHA1 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH |
++ HIFN_MAC_CMD_POS_IPSEC;
++ break;
++ case CRYPTO_SHA1_HMAC:
++ cmd->mac_masks |= HIFN_MAC_CMD_ALG_SHA1 |
++ HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC |
++ HIFN_MAC_CMD_POS_IPSEC | HIFN_MAC_CMD_TRUNC;
++ break;
++ }
++
++ if (maccrd->crd_alg == CRYPTO_SHA1_HMAC ||
++ maccrd->crd_alg == CRYPTO_MD5_HMAC) {
++ cmd->mac_masks |= HIFN_MAC_CMD_NEW_KEY;
++ bcopy(maccrd->crd_key, cmd->mac, maccrd->crd_klen >> 3);
++ bzero(cmd->mac + (maccrd->crd_klen >> 3),
++ HIFN_MAC_KEY_LENGTH - (maccrd->crd_klen >> 3));
++ }
++ }
++
++ cmd->crp = crp;
++ cmd->session_num = session;
++ cmd->softc = sc;
++
++ err = hifn_crypto(sc, cmd, crp, hint);
++ if (!err) {
++ return 0;
++ } else if (err == ERESTART) {
++ /*
++ * There weren't enough resources to dispatch the request
++ * to the part. Notify the caller so they'll requeue this
++ * request and resubmit it again soon.
++ */
++#ifdef HIFN_DEBUG
++ if (hifn_debug)
++ device_printf(sc->sc_dev, "requeue request\n");
++#endif
++ kfree(cmd);
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ return (err);
++ }
++
++errout:
++ if (cmd != NULL)
++ kfree(cmd);
++ if (err == EINVAL)
++ hifnstats.hst_invalid++;
++ else
++ hifnstats.hst_nomem++;
++ crp->crp_etype = err;
++ crypto_done(crp);
++ return (err);
++}
++
++static void
++hifn_abort(struct hifn_softc *sc)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct hifn_command *cmd;
++ struct cryptop *crp;
++ int i, u;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ i = dma->resk; u = dma->resu;
++ while (u != 0) {
++ cmd = dma->hifn_commands[i];
++ KASSERT(cmd != NULL, ("hifn_abort: null command slot %u", i));
++ dma->hifn_commands[i] = NULL;
++ crp = cmd->crp;
++
++ if ((dma->resr[i].l & htole32(HIFN_D_VALID)) == 0) {
++ /* Salvage what we can. */
++ u_int8_t *macbuf;
++
++ if (cmd->base_masks & HIFN_BASE_CMD_MAC) {
++ macbuf = dma->result_bufs[i];
++ macbuf += 12;
++ } else
++ macbuf = NULL;
++ hifnstats.hst_opackets++;
++ hifn_callback(sc, cmd, macbuf);
++ } else {
++#if 0
++ if (cmd->src_map == cmd->dst_map) {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
++ } else {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTWRITE);
++ bus_dmamap_sync(sc->sc_dmat, cmd->dst_map,
++ BUS_DMASYNC_POSTREAD);
++ }
++#endif
++
++ if (cmd->src_skb != cmd->dst_skb) {
++#ifdef NOTYET
++ m_freem(cmd->src_m);
++ crp->crp_buf = (caddr_t)cmd->dst_m;
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF src != dst not implemented\n",
++ __FILE__, __LINE__);
++#endif
++ }
++
++ /* non-shared buffers cannot be restarted */
++ if (cmd->src_map != cmd->dst_map) {
++ /*
++ * XXX should be EAGAIN, delayed until
++ * after the reset.
++ */
++ crp->crp_etype = ENOMEM;
++ pci_unmap_buf(sc, &cmd->dst);
++ } else
++ crp->crp_etype = ENOMEM;
++
++ pci_unmap_buf(sc, &cmd->src);
++
++ kfree(cmd);
++ if (crp->crp_etype != EAGAIN)
++ crypto_done(crp);
++ }
++
++ if (++i == HIFN_D_RES_RSIZE)
++ i = 0;
++ u--;
++ }
++ dma->resk = i; dma->resu = u;
++
++ hifn_reset_board(sc, 1);
++ hifn_init_dma(sc);
++ hifn_init_pci_registers(sc);
++}
++
++static void
++hifn_callback(struct hifn_softc *sc, struct hifn_command *cmd, u_int8_t *macbuf)
++{
++ struct hifn_dma *dma = sc->sc_dma;
++ struct cryptop *crp = cmd->crp;
++ struct cryptodesc *crd;
++ int i, u, ivlen;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++#if 0
++ if (cmd->src_map == cmd->dst_map) {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
++ } else {
++ bus_dmamap_sync(sc->sc_dmat, cmd->src_map,
++ BUS_DMASYNC_POSTWRITE);
++ bus_dmamap_sync(sc->sc_dmat, cmd->dst_map,
++ BUS_DMASYNC_POSTREAD);
++ }
++#endif
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (cmd->src_skb != cmd->dst_skb) {
++#ifdef NOTYET
++ crp->crp_buf = (caddr_t)cmd->dst_m;
++ totlen = cmd->src_mapsize;
++ for (m = cmd->dst_m; m != NULL; m = m->m_next) {
++ if (totlen < m->m_len) {
++ m->m_len = totlen;
++ totlen = 0;
++ } else
++ totlen -= m->m_len;
++ }
++ cmd->dst_m->m_pkthdr.len = cmd->src_m->m_pkthdr.len;
++ m_freem(cmd->src_m);
++#else
++ device_printf(sc->sc_dev,
++ "%s,%d: CRYPTO_F_SKBUF src != dst not implemented\n",
++ __FILE__, __LINE__);
++#endif
++ }
++ }
++
++ if (cmd->sloplen != 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ cmd->src_mapsize - cmd->sloplen, cmd->sloplen,
++ (caddr_t)&dma->slop[cmd->slopidx]);
++ }
++
++ i = dma->dstk; u = dma->dstu;
++ while (u != 0) {
++ if (i == HIFN_D_DST_RSIZE)
++ i = 0;
++#if 0
++ bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap,
++ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
++#endif
++ if (dma->dstr[i].l & htole32(HIFN_D_VALID)) {
++#if 0
++ bus_dmamap_sync(sc->sc_dmat, sc->sc_dmamap,
++ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
++#endif
++ break;
++ }
++ i++, u--;
++ }
++ dma->dstk = i; dma->dstu = u;
++
++ hifnstats.hst_obytes += cmd->dst_mapsize;
++
++ if ((cmd->base_masks & (HIFN_BASE_CMD_CRYPT | HIFN_BASE_CMD_DECODE)) ==
++ HIFN_BASE_CMD_CRYPT) {
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ if (crd->crd_alg != CRYPTO_DES_CBC &&
++ crd->crd_alg != CRYPTO_3DES_CBC &&
++ crd->crd_alg != CRYPTO_AES_CBC)
++ continue;
++ ivlen = ((crd->crd_alg == CRYPTO_AES_CBC) ?
++ HIFN_AES_IV_LENGTH : HIFN_IV_LENGTH);
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ crd->crd_skip + crd->crd_len - ivlen, ivlen,
++ cmd->softc->sc_sessions[cmd->session_num].hs_iv);
++ break;
++ }
++ }
++
++ if (macbuf != NULL) {
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ int len;
++
++ if (crd->crd_alg != CRYPTO_MD5 &&
++ crd->crd_alg != CRYPTO_SHA1 &&
++ crd->crd_alg != CRYPTO_MD5_HMAC &&
++ crd->crd_alg != CRYPTO_SHA1_HMAC) {
++ continue;
++ }
++ len = cmd->softc->sc_sessions[cmd->session_num].hs_mlen;
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject, len, macbuf);
++ break;
++ }
++ }
++
++ if (cmd->src_map != cmd->dst_map)
++ pci_unmap_buf(sc, &cmd->dst);
++ pci_unmap_buf(sc, &cmd->src);
++ kfree(cmd);
++ crypto_done(crp);
++}
++
++/*
++ * 7811 PB3 rev/2 parts lock-up on burst writes to Group 0
++ * and Group 1 registers; avoid conditions that could create
++ * burst writes by doing a read in between the writes.
++ *
++ * NB: The read we interpose is always to the same register;
++ * we do this because reading from an arbitrary (e.g. last)
++ * register may not always work.
++ */
++static void
++hifn_write_reg_0(struct hifn_softc *sc, bus_size_t reg, u_int32_t val)
++{
++ if (sc->sc_flags & HIFN_IS_7811) {
++ if (sc->sc_bar0_lastreg == reg - 4)
++ readl(sc->sc_bar0 + HIFN_0_PUCNFG);
++ sc->sc_bar0_lastreg = reg;
++ }
++ writel(val, sc->sc_bar0 + reg);
++}
++
++static void
++hifn_write_reg_1(struct hifn_softc *sc, bus_size_t reg, u_int32_t val)
++{
++ if (sc->sc_flags & HIFN_IS_7811) {
++ if (sc->sc_bar1_lastreg == reg - 4)
++ readl(sc->sc_bar1 + HIFN_1_REVID);
++ sc->sc_bar1_lastreg = reg;
++ }
++ writel(val, sc->sc_bar1 + reg);
++}
++
++
++static struct pci_device_id hifn_pci_tbl[] = {
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7951,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7955,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7956,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_NETSEC, PCI_PRODUCT_NETSEC_7751,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_INVERTEX, PCI_PRODUCT_INVERTEX_AEON,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7811,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ /*
++ * Other vendors share this PCI ID as well, such as
++ * http://www.powercrypt.com, and obviously they also
++ * use the same key.
++ */
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7751,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { 0, 0, 0, 0, 0, 0, }
++};
++MODULE_DEVICE_TABLE(pci, hifn_pci_tbl);
++
++static struct pci_driver hifn_driver = {
++ .name = "hifn",
++ .id_table = hifn_pci_tbl,
++ .probe = hifn_probe,
++ .remove = hifn_remove,
++ /* add PM stuff here one day */
++};
++
++static int __init hifn_init (void)
++{
++ struct hifn_softc *sc = NULL;
++ int rc;
++
++ DPRINTF("%s(%p)\n", __FUNCTION__, hifn_init);
++
++ rc = pci_register_driver(&hifn_driver);
++ pci_register_driver_compat(&hifn_driver, rc);
++
++ return rc;
++}
++
++static void __exit hifn_exit (void)
++{
++ pci_unregister_driver(&hifn_driver);
++}
++
++module_init(hifn_init);
++module_exit(hifn_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("OCF driver for hifn PCI crypto devices");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/hifn/hifn7751reg.h linux-2.6.29.1/crypto/ocf/hifn/hifn7751reg.h
+--- linux-2.6.29.1.orig/crypto/ocf/hifn/hifn7751reg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/hifn/hifn7751reg.h 2009-04-20 20:01:21.488556145 +0200
+@@ -0,0 +1,540 @@
++/* $FreeBSD: src/sys/dev/hifn/hifn7751reg.h,v 1.7 2007/03/21 03:42:49 sam Exp $ */
++/* $OpenBSD: hifn7751reg.h,v 1.35 2002/04/08 17:49:42 jason Exp $ */
++
++/*-
++ * Invertex AEON / Hifn 7751 driver
++ * Copyright (c) 1999 Invertex Inc. All rights reserved.
++ * Copyright (c) 1999 Theo de Raadt
++ * Copyright (c) 2000-2001 Network Security Technologies, Inc.
++ * http://www.netsec.net
++ *
++ * Please send any comments, feedback, bug-fixes, or feature requests to
++ * software@invertex.com.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ */
++#ifndef __HIFN_H__
++#define __HIFN_H__
++
++/*
++ * Some PCI configuration space offset defines. The names were made
++ * identical to the names used by the Linux kernel.
++ */
++#define HIFN_BAR0 PCIR_BAR(0) /* PUC register map */
++#define HIFN_BAR1 PCIR_BAR(1) /* DMA register map */
++#define HIFN_TRDY_TIMEOUT 0x40
++#define HIFN_RETRY_TIMEOUT 0x41
++
++/*
++ * PCI vendor and device identifiers
++ * (the names are preserved from their OpenBSD source).
++ */
++#define PCI_VENDOR_HIFN 0x13a3 /* Hifn */
++#define PCI_PRODUCT_HIFN_7751 0x0005 /* 7751 */
++#define PCI_PRODUCT_HIFN_6500 0x0006 /* 6500 */
++#define PCI_PRODUCT_HIFN_7811 0x0007 /* 7811 */
++#define PCI_PRODUCT_HIFN_7855 0x001f /* 7855 */
++#define PCI_PRODUCT_HIFN_7951 0x0012 /* 7951 */
++#define PCI_PRODUCT_HIFN_7955 0x0020 /* 7954/7955 */
++#define PCI_PRODUCT_HIFN_7956 0x001d /* 7956 */
++
++#define PCI_VENDOR_INVERTEX 0x14e1 /* Invertex */
++#define PCI_PRODUCT_INVERTEX_AEON 0x0005 /* AEON */
++
++#define PCI_VENDOR_NETSEC 0x1660 /* NetSec */
++#define PCI_PRODUCT_NETSEC_7751 0x7751 /* 7751 */
++
++/*
++ * The values below should multiple of 4 -- and be large enough to handle
++ * any command the driver implements.
++ *
++ * MAX_COMMAND = base command + mac command + encrypt command +
++ * mac-key + rc4-key
++ * MAX_RESULT = base result + mac result + mac + encrypt result
++ *
++ *
++ */
++#define HIFN_MAX_COMMAND (8 + 8 + 8 + 64 + 260)
++#define HIFN_MAX_RESULT (8 + 4 + 20 + 4)
++
++/*
++ * hifn_desc_t
++ *
++ * Holds an individual descriptor for any of the rings.
++ */
++typedef struct hifn_desc {
++ volatile u_int32_t l; /* length and status bits */
++ volatile u_int32_t p;
++} hifn_desc_t;
++
++/*
++ * Masks for the "length" field of struct hifn_desc.
++ */
++#define HIFN_D_LENGTH 0x0000ffff /* length bit mask */
++#define HIFN_D_MASKDONEIRQ 0x02000000 /* mask the done interrupt */
++#define HIFN_D_DESTOVER 0x04000000 /* destination overflow */
++#define HIFN_D_OVER 0x08000000 /* overflow */
++#define HIFN_D_LAST 0x20000000 /* last descriptor in chain */
++#define HIFN_D_JUMP 0x40000000 /* jump descriptor */
++#define HIFN_D_VALID 0x80000000 /* valid bit */
++
++
++/*
++ * Processing Unit Registers (offset from BASEREG0)
++ */
++#define HIFN_0_PUDATA 0x00 /* Processing Unit Data */
++#define HIFN_0_PUCTRL 0x04 /* Processing Unit Control */
++#define HIFN_0_PUISR 0x08 /* Processing Unit Interrupt Status */
++#define HIFN_0_PUCNFG 0x0c /* Processing Unit Configuration */
++#define HIFN_0_PUIER 0x10 /* Processing Unit Interrupt Enable */
++#define HIFN_0_PUSTAT 0x14 /* Processing Unit Status/Chip ID */
++#define HIFN_0_FIFOSTAT 0x18 /* FIFO Status */
++#define HIFN_0_FIFOCNFG 0x1c /* FIFO Configuration */
++#define HIFN_0_PUCTRL2 0x28 /* Processing Unit Control (2nd map) */
++#define HIFN_0_MUTE1 0x80
++#define HIFN_0_MUTE2 0x90
++#define HIFN_0_SPACESIZE 0x100 /* Register space size */
++
++/* Processing Unit Control Register (HIFN_0_PUCTRL) */
++#define HIFN_PUCTRL_CLRSRCFIFO 0x0010 /* clear source fifo */
++#define HIFN_PUCTRL_STOP 0x0008 /* stop pu */
++#define HIFN_PUCTRL_LOCKRAM 0x0004 /* lock ram */
++#define HIFN_PUCTRL_DMAENA 0x0002 /* enable dma */
++#define HIFN_PUCTRL_RESET 0x0001 /* Reset processing unit */
++
++/* Processing Unit Interrupt Status Register (HIFN_0_PUISR) */
++#define HIFN_PUISR_CMDINVAL 0x8000 /* Invalid command interrupt */
++#define HIFN_PUISR_DATAERR 0x4000 /* Data error interrupt */
++#define HIFN_PUISR_SRCFIFO 0x2000 /* Source FIFO ready interrupt */
++#define HIFN_PUISR_DSTFIFO 0x1000 /* Destination FIFO ready interrupt */
++#define HIFN_PUISR_DSTOVER 0x0200 /* Destination overrun interrupt */
++#define HIFN_PUISR_SRCCMD 0x0080 /* Source command interrupt */
++#define HIFN_PUISR_SRCCTX 0x0040 /* Source context interrupt */
++#define HIFN_PUISR_SRCDATA 0x0020 /* Source data interrupt */
++#define HIFN_PUISR_DSTDATA 0x0010 /* Destination data interrupt */
++#define HIFN_PUISR_DSTRESULT 0x0004 /* Destination result interrupt */
++
++/* Processing Unit Configuration Register (HIFN_0_PUCNFG) */
++#define HIFN_PUCNFG_DRAMMASK 0xe000 /* DRAM size mask */
++#define HIFN_PUCNFG_DSZ_256K 0x0000 /* 256k dram */
++#define HIFN_PUCNFG_DSZ_512K 0x2000 /* 512k dram */
++#define HIFN_PUCNFG_DSZ_1M 0x4000 /* 1m dram */
++#define HIFN_PUCNFG_DSZ_2M 0x6000 /* 2m dram */
++#define HIFN_PUCNFG_DSZ_4M 0x8000 /* 4m dram */
++#define HIFN_PUCNFG_DSZ_8M 0xa000 /* 8m dram */
++#define HIFN_PUNCFG_DSZ_16M 0xc000 /* 16m dram */
++#define HIFN_PUCNFG_DSZ_32M 0xe000 /* 32m dram */
++#define HIFN_PUCNFG_DRAMREFRESH 0x1800 /* DRAM refresh rate mask */
++#define HIFN_PUCNFG_DRFR_512 0x0000 /* 512 divisor of ECLK */
++#define HIFN_PUCNFG_DRFR_256 0x0800 /* 256 divisor of ECLK */
++#define HIFN_PUCNFG_DRFR_128 0x1000 /* 128 divisor of ECLK */
++#define HIFN_PUCNFG_TCALLPHASES 0x0200 /* your guess is as good as mine... */
++#define HIFN_PUCNFG_TCDRVTOTEM 0x0100 /* your guess is as good as mine... */
++#define HIFN_PUCNFG_BIGENDIAN 0x0080 /* DMA big endian mode */
++#define HIFN_PUCNFG_BUS32 0x0040 /* Bus width 32bits */
++#define HIFN_PUCNFG_BUS16 0x0000 /* Bus width 16 bits */
++#define HIFN_PUCNFG_CHIPID 0x0020 /* Allow chipid from PUSTAT */
++#define HIFN_PUCNFG_DRAM 0x0010 /* Context RAM is DRAM */
++#define HIFN_PUCNFG_SRAM 0x0000 /* Context RAM is SRAM */
++#define HIFN_PUCNFG_COMPSING 0x0004 /* Enable single compression context */
++#define HIFN_PUCNFG_ENCCNFG 0x0002 /* Encryption configuration */
++
++/* Processing Unit Interrupt Enable Register (HIFN_0_PUIER) */
++#define HIFN_PUIER_CMDINVAL 0x8000 /* Invalid command interrupt */
++#define HIFN_PUIER_DATAERR 0x4000 /* Data error interrupt */
++#define HIFN_PUIER_SRCFIFO 0x2000 /* Source FIFO ready interrupt */
++#define HIFN_PUIER_DSTFIFO 0x1000 /* Destination FIFO ready interrupt */
++#define HIFN_PUIER_DSTOVER 0x0200 /* Destination overrun interrupt */
++#define HIFN_PUIER_SRCCMD 0x0080 /* Source command interrupt */
++#define HIFN_PUIER_SRCCTX 0x0040 /* Source context interrupt */
++#define HIFN_PUIER_SRCDATA 0x0020 /* Source data interrupt */
++#define HIFN_PUIER_DSTDATA 0x0010 /* Destination data interrupt */
++#define HIFN_PUIER_DSTRESULT 0x0004 /* Destination result interrupt */
++
++/* Processing Unit Status Register/Chip ID (HIFN_0_PUSTAT) */
++#define HIFN_PUSTAT_CMDINVAL 0x8000 /* Invalid command interrupt */
++#define HIFN_PUSTAT_DATAERR 0x4000 /* Data error interrupt */
++#define HIFN_PUSTAT_SRCFIFO 0x2000 /* Source FIFO ready interrupt */
++#define HIFN_PUSTAT_DSTFIFO 0x1000 /* Destination FIFO ready interrupt */
++#define HIFN_PUSTAT_DSTOVER 0x0200 /* Destination overrun interrupt */
++#define HIFN_PUSTAT_SRCCMD 0x0080 /* Source command interrupt */
++#define HIFN_PUSTAT_SRCCTX 0x0040 /* Source context interrupt */
++#define HIFN_PUSTAT_SRCDATA 0x0020 /* Source data interrupt */
++#define HIFN_PUSTAT_DSTDATA 0x0010 /* Destination data interrupt */
++#define HIFN_PUSTAT_DSTRESULT 0x0004 /* Destination result interrupt */
++#define HIFN_PUSTAT_CHIPREV 0x00ff /* Chip revision mask */
++#define HIFN_PUSTAT_CHIPENA 0xff00 /* Chip enabled mask */
++#define HIFN_PUSTAT_ENA_2 0x1100 /* Level 2 enabled */
++#define HIFN_PUSTAT_ENA_1 0x1000 /* Level 1 enabled */
++#define HIFN_PUSTAT_ENA_0 0x3000 /* Level 0 enabled */
++#define HIFN_PUSTAT_REV_2 0x0020 /* 7751 PT6/2 */
++#define HIFN_PUSTAT_REV_3 0x0030 /* 7751 PT6/3 */
++
++/* FIFO Status Register (HIFN_0_FIFOSTAT) */
++#define HIFN_FIFOSTAT_SRC 0x7f00 /* Source FIFO available */
++#define HIFN_FIFOSTAT_DST 0x007f /* Destination FIFO available */
++
++/* FIFO Configuration Register (HIFN_0_FIFOCNFG) */
++#define HIFN_FIFOCNFG_THRESHOLD 0x0400 /* must be written as this value */
++
++/*
++ * DMA Interface Registers (offset from BASEREG1)
++ */
++#define HIFN_1_DMA_CRAR 0x0c /* DMA Command Ring Address */
++#define HIFN_1_DMA_SRAR 0x1c /* DMA Source Ring Address */
++#define HIFN_1_DMA_RRAR 0x2c /* DMA Result Ring Address */
++#define HIFN_1_DMA_DRAR 0x3c /* DMA Destination Ring Address */
++#define HIFN_1_DMA_CSR 0x40 /* DMA Status and Control */
++#define HIFN_1_DMA_IER 0x44 /* DMA Interrupt Enable */
++#define HIFN_1_DMA_CNFG 0x48 /* DMA Configuration */
++#define HIFN_1_PLL 0x4c /* 7955/7956: PLL config */
++#define HIFN_1_7811_RNGENA 0x60 /* 7811: rng enable */
++#define HIFN_1_7811_RNGCFG 0x64 /* 7811: rng config */
++#define HIFN_1_7811_RNGDAT 0x68 /* 7811: rng data */
++#define HIFN_1_7811_RNGSTS 0x6c /* 7811: rng status */
++#define HIFN_1_DMA_CNFG2 0x6c /* 7955/7956: dma config #2 */
++#define HIFN_1_7811_MIPSRST 0x94 /* 7811: MIPS reset */
++#define HIFN_1_REVID 0x98 /* Revision ID */
++
++#define HIFN_1_PUB_RESET 0x204 /* Public/RNG Reset */
++#define HIFN_1_PUB_BASE 0x300 /* Public Base Address */
++#define HIFN_1_PUB_OPLEN 0x304 /* 7951-compat Public Operand Length */
++#define HIFN_1_PUB_OP 0x308 /* 7951-compat Public Operand */
++#define HIFN_1_PUB_STATUS 0x30c /* 7951-compat Public Status */
++#define HIFN_1_PUB_IEN 0x310 /* Public Interrupt enable */
++#define HIFN_1_RNG_CONFIG 0x314 /* RNG config */
++#define HIFN_1_RNG_DATA 0x318 /* RNG data */
++#define HIFN_1_PUB_MODE 0x320 /* PK mode */
++#define HIFN_1_PUB_FIFO_OPLEN 0x380 /* first element of oplen fifo */
++#define HIFN_1_PUB_FIFO_OP 0x384 /* first element of op fifo */
++#define HIFN_1_PUB_MEM 0x400 /* start of Public key memory */
++#define HIFN_1_PUB_MEMEND 0xbff /* end of Public key memory */
++
++/* DMA Status and Control Register (HIFN_1_DMA_CSR) */
++#define HIFN_DMACSR_D_CTRLMASK 0xc0000000 /* Destinition Ring Control */
++#define HIFN_DMACSR_D_CTRL_NOP 0x00000000 /* Dest. Control: no-op */
++#define HIFN_DMACSR_D_CTRL_DIS 0x40000000 /* Dest. Control: disable */
++#define HIFN_DMACSR_D_CTRL_ENA 0x80000000 /* Dest. Control: enable */
++#define HIFN_DMACSR_D_ABORT 0x20000000 /* Destinition Ring PCIAbort */
++#define HIFN_DMACSR_D_DONE 0x10000000 /* Destinition Ring Done */
++#define HIFN_DMACSR_D_LAST 0x08000000 /* Destinition Ring Last */
++#define HIFN_DMACSR_D_WAIT 0x04000000 /* Destinition Ring Waiting */
++#define HIFN_DMACSR_D_OVER 0x02000000 /* Destinition Ring Overflow */
++#define HIFN_DMACSR_R_CTRL 0x00c00000 /* Result Ring Control */
++#define HIFN_DMACSR_R_CTRL_NOP 0x00000000 /* Result Control: no-op */
++#define HIFN_DMACSR_R_CTRL_DIS 0x00400000 /* Result Control: disable */
++#define HIFN_DMACSR_R_CTRL_ENA 0x00800000 /* Result Control: enable */
++#define HIFN_DMACSR_R_ABORT 0x00200000 /* Result Ring PCI Abort */
++#define HIFN_DMACSR_R_DONE 0x00100000 /* Result Ring Done */
++#define HIFN_DMACSR_R_LAST 0x00080000 /* Result Ring Last */
++#define HIFN_DMACSR_R_WAIT 0x00040000 /* Result Ring Waiting */
++#define HIFN_DMACSR_R_OVER 0x00020000 /* Result Ring Overflow */
++#define HIFN_DMACSR_S_CTRL 0x0000c000 /* Source Ring Control */
++#define HIFN_DMACSR_S_CTRL_NOP 0x00000000 /* Source Control: no-op */
++#define HIFN_DMACSR_S_CTRL_DIS 0x00004000 /* Source Control: disable */
++#define HIFN_DMACSR_S_CTRL_ENA 0x00008000 /* Source Control: enable */
++#define HIFN_DMACSR_S_ABORT 0x00002000 /* Source Ring PCI Abort */
++#define HIFN_DMACSR_S_DONE 0x00001000 /* Source Ring Done */
++#define HIFN_DMACSR_S_LAST 0x00000800 /* Source Ring Last */
++#define HIFN_DMACSR_S_WAIT 0x00000400 /* Source Ring Waiting */
++#define HIFN_DMACSR_ILLW 0x00000200 /* Illegal write (7811 only) */
++#define HIFN_DMACSR_ILLR 0x00000100 /* Illegal read (7811 only) */
++#define HIFN_DMACSR_C_CTRL 0x000000c0 /* Command Ring Control */
++#define HIFN_DMACSR_C_CTRL_NOP 0x00000000 /* Command Control: no-op */
++#define HIFN_DMACSR_C_CTRL_DIS 0x00000040 /* Command Control: disable */
++#define HIFN_DMACSR_C_CTRL_ENA 0x00000080 /* Command Control: enable */
++#define HIFN_DMACSR_C_ABORT 0x00000020 /* Command Ring PCI Abort */
++#define HIFN_DMACSR_C_DONE 0x00000010 /* Command Ring Done */
++#define HIFN_DMACSR_C_LAST 0x00000008 /* Command Ring Last */
++#define HIFN_DMACSR_C_WAIT 0x00000004 /* Command Ring Waiting */
++#define HIFN_DMACSR_PUBDONE 0x00000002 /* Public op done (7951 only) */
++#define HIFN_DMACSR_ENGINE 0x00000001 /* Command Ring Engine IRQ */
++
++/* DMA Interrupt Enable Register (HIFN_1_DMA_IER) */
++#define HIFN_DMAIER_D_ABORT 0x20000000 /* Destination Ring PCIAbort */
++#define HIFN_DMAIER_D_DONE 0x10000000 /* Destination Ring Done */
++#define HIFN_DMAIER_D_LAST 0x08000000 /* Destination Ring Last */
++#define HIFN_DMAIER_D_WAIT 0x04000000 /* Destination Ring Waiting */
++#define HIFN_DMAIER_D_OVER 0x02000000 /* Destination Ring Overflow */
++#define HIFN_DMAIER_R_ABORT 0x00200000 /* Result Ring PCI Abort */
++#define HIFN_DMAIER_R_DONE 0x00100000 /* Result Ring Done */
++#define HIFN_DMAIER_R_LAST 0x00080000 /* Result Ring Last */
++#define HIFN_DMAIER_R_WAIT 0x00040000 /* Result Ring Waiting */
++#define HIFN_DMAIER_R_OVER 0x00020000 /* Result Ring Overflow */
++#define HIFN_DMAIER_S_ABORT 0x00002000 /* Source Ring PCI Abort */
++#define HIFN_DMAIER_S_DONE 0x00001000 /* Source Ring Done */
++#define HIFN_DMAIER_S_LAST 0x00000800 /* Source Ring Last */
++#define HIFN_DMAIER_S_WAIT 0x00000400 /* Source Ring Waiting */
++#define HIFN_DMAIER_ILLW 0x00000200 /* Illegal write (7811 only) */
++#define HIFN_DMAIER_ILLR 0x00000100 /* Illegal read (7811 only) */
++#define HIFN_DMAIER_C_ABORT 0x00000020 /* Command Ring PCI Abort */
++#define HIFN_DMAIER_C_DONE 0x00000010 /* Command Ring Done */
++#define HIFN_DMAIER_C_LAST 0x00000008 /* Command Ring Last */
++#define HIFN_DMAIER_C_WAIT 0x00000004 /* Command Ring Waiting */
++#define HIFN_DMAIER_PUBDONE 0x00000002 /* public op done (7951 only) */
++#define HIFN_DMAIER_ENGINE 0x00000001 /* Engine IRQ */
++
++/* DMA Configuration Register (HIFN_1_DMA_CNFG) */
++#define HIFN_DMACNFG_BIGENDIAN 0x10000000 /* big endian mode */
++#define HIFN_DMACNFG_POLLFREQ 0x00ff0000 /* Poll frequency mask */
++#define HIFN_DMACNFG_UNLOCK 0x00000800
++#define HIFN_DMACNFG_POLLINVAL 0x00000700 /* Invalid Poll Scalar */
++#define HIFN_DMACNFG_LAST 0x00000010 /* Host control LAST bit */
++#define HIFN_DMACNFG_MODE 0x00000004 /* DMA mode */
++#define HIFN_DMACNFG_DMARESET 0x00000002 /* DMA Reset # */
++#define HIFN_DMACNFG_MSTRESET 0x00000001 /* Master Reset # */
++
++/* DMA Configuration Register (HIFN_1_DMA_CNFG2) */
++#define HIFN_DMACNFG2_PKSWAP32 (1 << 19) /* swap the OPLEN/OP reg */
++#define HIFN_DMACNFG2_PKSWAP8 (1 << 18) /* swap the bits of OPLEN/OP */
++#define HIFN_DMACNFG2_BAR0_SWAP32 (1<<17) /* swap the bytes of BAR0 */
++#define HIFN_DMACNFG2_BAR1_SWAP8 (1<<16) /* swap the bits of BAR0 */
++#define HIFN_DMACNFG2_INIT_WRITE_BURST_SHIFT 12
++#define HIFN_DMACNFG2_INIT_READ_BURST_SHIFT 8
++#define HIFN_DMACNFG2_TGT_WRITE_BURST_SHIFT 4
++#define HIFN_DMACNFG2_TGT_READ_BURST_SHIFT 0
++
++/* 7811 RNG Enable Register (HIFN_1_7811_RNGENA) */
++#define HIFN_7811_RNGENA_ENA 0x00000001 /* enable RNG */
++
++/* 7811 RNG Config Register (HIFN_1_7811_RNGCFG) */
++#define HIFN_7811_RNGCFG_PRE1 0x00000f00 /* first prescalar */
++#define HIFN_7811_RNGCFG_OPRE 0x00000080 /* output prescalar */
++#define HIFN_7811_RNGCFG_DEFL 0x00000f80 /* 2 words/ 1/100 sec */
++
++/* 7811 RNG Status Register (HIFN_1_7811_RNGSTS) */
++#define HIFN_7811_RNGSTS_RDY 0x00004000 /* two numbers in FIFO */
++#define HIFN_7811_RNGSTS_UFL 0x00001000 /* rng underflow */
++
++/* 7811 MIPS Reset Register (HIFN_1_7811_MIPSRST) */
++#define HIFN_MIPSRST_BAR2SIZE 0xffff0000 /* sdram size */
++#define HIFN_MIPSRST_GPRAMINIT 0x00008000 /* gpram can be accessed */
++#define HIFN_MIPSRST_CRAMINIT 0x00004000 /* ctxram can be accessed */
++#define HIFN_MIPSRST_LED2 0x00000400 /* external LED2 */
++#define HIFN_MIPSRST_LED1 0x00000200 /* external LED1 */
++#define HIFN_MIPSRST_LED0 0x00000100 /* external LED0 */
++#define HIFN_MIPSRST_MIPSDIS 0x00000004 /* disable MIPS */
++#define HIFN_MIPSRST_MIPSRST 0x00000002 /* warm reset MIPS */
++#define HIFN_MIPSRST_MIPSCOLD 0x00000001 /* cold reset MIPS */
++
++/* Public key reset register (HIFN_1_PUB_RESET) */
++#define HIFN_PUBRST_RESET 0x00000001 /* reset public/rng unit */
++
++/* Public operation register (HIFN_1_PUB_OP) */
++#define HIFN_PUBOP_AOFFSET 0x0000003e /* A offset */
++#define HIFN_PUBOP_BOFFSET 0x00000fc0 /* B offset */
++#define HIFN_PUBOP_MOFFSET 0x0003f000 /* M offset */
++#define HIFN_PUBOP_OP_MASK 0x003c0000 /* Opcode: */
++#define HIFN_PUBOP_OP_NOP 0x00000000 /* NOP */
++#define HIFN_PUBOP_OP_ADD 0x00040000 /* ADD */
++#define HIFN_PUBOP_OP_ADDC 0x00080000 /* ADD w/carry */
++#define HIFN_PUBOP_OP_SUB 0x000c0000 /* SUB */
++#define HIFN_PUBOP_OP_SUBC 0x00100000 /* SUB w/carry */
++#define HIFN_PUBOP_OP_MODADD 0x00140000 /* Modular ADD */
++#define HIFN_PUBOP_OP_MODSUB 0x00180000 /* Modular SUB */
++#define HIFN_PUBOP_OP_INCA 0x001c0000 /* INC A */
++#define HIFN_PUBOP_OP_DECA 0x00200000 /* DEC A */
++#define HIFN_PUBOP_OP_MULT 0x00240000 /* MULT */
++#define HIFN_PUBOP_OP_MODMULT 0x00280000 /* Modular MULT */
++#define HIFN_PUBOP_OP_MODRED 0x002c0000 /* Modular Red */
++#define HIFN_PUBOP_OP_MODEXP 0x00300000 /* Modular Exp */
++
++/* Public operand length register (HIFN_1_PUB_OPLEN) */
++#define HIFN_PUBOPLEN_MODLEN 0x0000007f
++#define HIFN_PUBOPLEN_EXPLEN 0x0003ff80
++#define HIFN_PUBOPLEN_REDLEN 0x003c0000
++
++/* Public status register (HIFN_1_PUB_STATUS) */
++#define HIFN_PUBSTS_DONE 0x00000001 /* operation done */
++#define HIFN_PUBSTS_CARRY 0x00000002 /* carry */
++#define HIFN_PUBSTS_FIFO_EMPTY 0x00000100 /* fifo empty */
++#define HIFN_PUBSTS_FIFO_FULL 0x00000200 /* fifo full */
++#define HIFN_PUBSTS_FIFO_OVFL 0x00000400 /* fifo overflow */
++#define HIFN_PUBSTS_FIFO_WRITE 0x000f0000 /* fifo write */
++#define HIFN_PUBSTS_FIFO_READ 0x0f000000 /* fifo read */
++
++/* Public interrupt enable register (HIFN_1_PUB_IEN) */
++#define HIFN_PUBIEN_DONE 0x00000001 /* operation done interrupt */
++
++/* Random number generator config register (HIFN_1_RNG_CONFIG) */
++#define HIFN_RNGCFG_ENA 0x00000001 /* enable rng */
++
++/*
++ * Register offsets in register set 1
++ */
++
++#define HIFN_UNLOCK_SECRET1 0xf4
++#define HIFN_UNLOCK_SECRET2 0xfc
++
++/*
++ * PLL config register
++ *
++ * This register is present only on 7954/7955/7956 parts. It must be
++ * programmed according to the bus interface method used by the h/w.
++ * Note that the parts require a stable clock. Since the PCI clock
++ * may vary the reference clock must usually be used. To avoid
++ * overclocking the core logic, setup must be done carefully, refer
++ * to the driver for details. The exact multiplier required varies
++ * by part and system configuration; refer to the Hifn documentation.
++ */
++#define HIFN_PLL_REF_SEL 0x00000001 /* REF/HBI clk selection */
++#define HIFN_PLL_BP 0x00000002 /* bypass (used during setup) */
++/* bit 2 reserved */
++#define HIFN_PLL_PK_CLK_SEL 0x00000008 /* public key clk select */
++#define HIFN_PLL_PE_CLK_SEL 0x00000010 /* packet engine clk select */
++/* bits 5-9 reserved */
++#define HIFN_PLL_MBSET 0x00000400 /* must be set to 1 */
++#define HIFN_PLL_ND 0x00003800 /* Fpll_ref multiplier select */
++#define HIFN_PLL_ND_SHIFT 11
++#define HIFN_PLL_ND_2 0x00000000 /* 2x */
++#define HIFN_PLL_ND_4 0x00000800 /* 4x */
++#define HIFN_PLL_ND_6 0x00001000 /* 6x */
++#define HIFN_PLL_ND_8 0x00001800 /* 8x */
++#define HIFN_PLL_ND_10 0x00002000 /* 10x */
++#define HIFN_PLL_ND_12 0x00002800 /* 12x */
++/* bits 14-15 reserved */
++#define HIFN_PLL_IS 0x00010000 /* charge pump current select */
++/* bits 17-31 reserved */
++
++/*
++ * Board configuration specifies only these bits.
++ */
++#define HIFN_PLL_CONFIG (HIFN_PLL_IS|HIFN_PLL_ND|HIFN_PLL_REF_SEL)
++
++/*
++ * Public Key Engine Mode Register
++ */
++#define HIFN_PKMODE_HOSTINVERT (1 << 0) /* HOST INVERT */
++#define HIFN_PKMODE_ENHANCED (1 << 1) /* Enable enhanced mode */
++
++
++/*********************************************************************
++ * Structs for board commands
++ *
++ *********************************************************************/
++
++/*
++ * Structure to help build up the command data structure.
++ */
++typedef struct hifn_base_command {
++ volatile u_int16_t masks;
++ volatile u_int16_t session_num;
++ volatile u_int16_t total_source_count;
++ volatile u_int16_t total_dest_count;
++} hifn_base_command_t;
++
++#define HIFN_BASE_CMD_MAC 0x0400
++#define HIFN_BASE_CMD_CRYPT 0x0800
++#define HIFN_BASE_CMD_DECODE 0x2000
++#define HIFN_BASE_CMD_SRCLEN_M 0xc000
++#define HIFN_BASE_CMD_SRCLEN_S 14
++#define HIFN_BASE_CMD_DSTLEN_M 0x3000
++#define HIFN_BASE_CMD_DSTLEN_S 12
++#define HIFN_BASE_CMD_LENMASK_HI 0x30000
++#define HIFN_BASE_CMD_LENMASK_LO 0x0ffff
++
++/*
++ * Structure to help build up the command data structure.
++ */
++typedef struct hifn_crypt_command {
++ volatile u_int16_t masks;
++ volatile u_int16_t header_skip;
++ volatile u_int16_t source_count;
++ volatile u_int16_t reserved;
++} hifn_crypt_command_t;
++
++#define HIFN_CRYPT_CMD_ALG_MASK 0x0003 /* algorithm: */
++#define HIFN_CRYPT_CMD_ALG_DES 0x0000 /* DES */
++#define HIFN_CRYPT_CMD_ALG_3DES 0x0001 /* 3DES */
++#define HIFN_CRYPT_CMD_ALG_RC4 0x0002 /* RC4 */
++#define HIFN_CRYPT_CMD_ALG_AES 0x0003 /* AES */
++#define HIFN_CRYPT_CMD_MODE_MASK 0x0018 /* Encrypt mode: */
++#define HIFN_CRYPT_CMD_MODE_ECB 0x0000 /* ECB */
++#define HIFN_CRYPT_CMD_MODE_CBC 0x0008 /* CBC */
++#define HIFN_CRYPT_CMD_MODE_CFB 0x0010 /* CFB */
++#define HIFN_CRYPT_CMD_MODE_OFB 0x0018 /* OFB */
++#define HIFN_CRYPT_CMD_CLR_CTX 0x0040 /* clear context */
++#define HIFN_CRYPT_CMD_NEW_KEY 0x0800 /* expect new key */
++#define HIFN_CRYPT_CMD_NEW_IV 0x1000 /* expect new iv */
++
++#define HIFN_CRYPT_CMD_SRCLEN_M 0xc000
++#define HIFN_CRYPT_CMD_SRCLEN_S 14
++
++#define HIFN_CRYPT_CMD_KSZ_MASK 0x0600 /* AES key size: */
++#define HIFN_CRYPT_CMD_KSZ_128 0x0000 /* 128 bit */
++#define HIFN_CRYPT_CMD_KSZ_192 0x0200 /* 192 bit */
++#define HIFN_CRYPT_CMD_KSZ_256 0x0400 /* 256 bit */
++
++/*
++ * Structure to help build up the command data structure.
++ */
++typedef struct hifn_mac_command {
++ volatile u_int16_t masks;
++ volatile u_int16_t header_skip;
++ volatile u_int16_t source_count;
++ volatile u_int16_t reserved;
++} hifn_mac_command_t;
++
++#define HIFN_MAC_CMD_ALG_MASK 0x0001
++#define HIFN_MAC_CMD_ALG_SHA1 0x0000
++#define HIFN_MAC_CMD_ALG_MD5 0x0001
++#define HIFN_MAC_CMD_MODE_MASK 0x000c
++#define HIFN_MAC_CMD_MODE_HMAC 0x0000
++#define HIFN_MAC_CMD_MODE_SSL_MAC 0x0004
++#define HIFN_MAC_CMD_MODE_HASH 0x0008
++#define HIFN_MAC_CMD_MODE_FULL 0x0004
++#define HIFN_MAC_CMD_TRUNC 0x0010
++#define HIFN_MAC_CMD_RESULT 0x0020
++#define HIFN_MAC_CMD_APPEND 0x0040
++#define HIFN_MAC_CMD_SRCLEN_M 0xc000
++#define HIFN_MAC_CMD_SRCLEN_S 14
++
++/*
++ * MAC POS IPsec initiates authentication after encryption on encodes
++ * and before decryption on decodes.
++ */
++#define HIFN_MAC_CMD_POS_IPSEC 0x0200
++#define HIFN_MAC_CMD_NEW_KEY 0x0800
++
++/*
++ * The poll frequency and poll scalar defines are unshifted values used
++ * to set fields in the DMA Configuration Register.
++ */
++#ifndef HIFN_POLL_FREQUENCY
++#define HIFN_POLL_FREQUENCY 0x1
++#endif
++
++#ifndef HIFN_POLL_SCALAR
++#define HIFN_POLL_SCALAR 0x0
++#endif
++
++#define HIFN_MAX_SEGLEN 0xffff /* maximum dma segment len */
++#define HIFN_MAX_DMALEN 0x3ffff /* maximum dma length */
++#endif /* __HIFN_H__ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/hifn/hifn7751var.h linux-2.6.29.1/crypto/ocf/hifn/hifn7751var.h
+--- linux-2.6.29.1.orig/crypto/ocf/hifn/hifn7751var.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/hifn/hifn7751var.h 2009-04-20 20:01:21.488556145 +0200
+@@ -0,0 +1,369 @@
++/* $FreeBSD: src/sys/dev/hifn/hifn7751var.h,v 1.9 2007/03/21 03:42:49 sam Exp $ */
++/* $OpenBSD: hifn7751var.h,v 1.42 2002/04/08 17:49:42 jason Exp $ */
++
++/*-
++ * Invertex AEON / Hifn 7751 driver
++ * Copyright (c) 1999 Invertex Inc. All rights reserved.
++ * Copyright (c) 1999 Theo de Raadt
++ * Copyright (c) 2000-2001 Network Security Technologies, Inc.
++ * http://www.netsec.net
++ *
++ * Please send any comments, feedback, bug-fixes, or feature requests to
++ * software@invertex.com.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored in part by the Defense Advanced Research Projects
++ * Agency (DARPA) and Air Force Research Laboratory, Air Force
++ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
++ *
++ */
++
++#ifndef __HIFN7751VAR_H__
++#define __HIFN7751VAR_H__
++
++#ifdef __KERNEL__
++
++/*
++ * Some configurable values for the driver. By default command+result
++ * descriptor rings are the same size. The src+dst descriptor rings
++ * are sized at 3.5x the number of potential commands. Slower parts
++ * (e.g. 7951) tend to run out of src descriptors; faster parts (7811)
++ * src+cmd/result descriptors. It's not clear that increasing the size
++ * of the descriptor rings helps performance significantly as other
++ * factors tend to come into play (e.g. copying misaligned packets).
++ */
++#define HIFN_D_CMD_RSIZE 24 /* command descriptors */
++#define HIFN_D_SRC_RSIZE ((HIFN_D_CMD_RSIZE * 7) / 2) /* source descriptors */
++#define HIFN_D_RES_RSIZE HIFN_D_CMD_RSIZE /* result descriptors */
++#define HIFN_D_DST_RSIZE HIFN_D_SRC_RSIZE /* destination descriptors */
++
++/*
++ * Length values for cryptography
++ */
++#define HIFN_DES_KEY_LENGTH 8
++#define HIFN_3DES_KEY_LENGTH 24
++#define HIFN_MAX_CRYPT_KEY_LENGTH HIFN_3DES_KEY_LENGTH
++#define HIFN_IV_LENGTH 8
++#define HIFN_AES_IV_LENGTH 16
++#define HIFN_MAX_IV_LENGTH HIFN_AES_IV_LENGTH
++
++/*
++ * Length values for authentication
++ */
++#define HIFN_MAC_KEY_LENGTH 64
++#define HIFN_MD5_LENGTH 16
++#define HIFN_SHA1_LENGTH 20
++#define HIFN_MAC_TRUNC_LENGTH 12
++
++#define MAX_SCATTER 64
++
++/*
++ * Data structure to hold all 4 rings and any other ring related data.
++ */
++struct hifn_dma {
++ /*
++ * Descriptor rings. We add +1 to the size to accomidate the
++ * jump descriptor.
++ */
++ struct hifn_desc cmdr[HIFN_D_CMD_RSIZE+1];
++ struct hifn_desc srcr[HIFN_D_SRC_RSIZE+1];
++ struct hifn_desc dstr[HIFN_D_DST_RSIZE+1];
++ struct hifn_desc resr[HIFN_D_RES_RSIZE+1];
++
++ struct hifn_command *hifn_commands[HIFN_D_RES_RSIZE];
++
++ u_char command_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_COMMAND];
++ u_char result_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_RESULT];
++ u_int32_t slop[HIFN_D_CMD_RSIZE];
++
++ u_int64_t test_src, test_dst;
++
++ /*
++ * Our current positions for insertion and removal from the desriptor
++ * rings.
++ */
++ int cmdi, srci, dsti, resi;
++ volatile int cmdu, srcu, dstu, resu;
++ int cmdk, srck, dstk, resk;
++};
++
++struct hifn_session {
++ int hs_used;
++ int hs_mlen;
++ u_int8_t hs_iv[HIFN_MAX_IV_LENGTH];
++};
++
++#define HIFN_RING_SYNC(sc, r, i, f) \
++ /* DAVIDM bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, (f)) */
++
++#define HIFN_CMDR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), cmdr, (i), (f))
++#define HIFN_RESR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), resr, (i), (f))
++#define HIFN_SRCR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), srcr, (i), (f))
++#define HIFN_DSTR_SYNC(sc, i, f) HIFN_RING_SYNC((sc), dstr, (i), (f))
++
++#define HIFN_CMD_SYNC(sc, i, f) \
++ /* DAVIDM bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, (f)) */
++
++#define HIFN_RES_SYNC(sc, i, f) \
++ /* DAVIDM bus_dmamap_sync((sc)->sc_dmat, (sc)->sc_dmamap, (f)) */
++
++typedef int bus_size_t;
++
++/*
++ * Holds data specific to a single HIFN board.
++ */
++struct hifn_softc {
++ softc_device_decl sc_dev;
++
++ struct pci_dev *sc_pcidev; /* PCI device pointer */
++ spinlock_t sc_mtx; /* per-instance lock */
++
++ int sc_num; /* for multiple devs */
++
++ ocf_iomem_t sc_bar0;
++ bus_size_t sc_bar0_lastreg;/* bar0 last reg written */
++ ocf_iomem_t sc_bar1;
++ bus_size_t sc_bar1_lastreg;/* bar1 last reg written */
++
++ int sc_irq;
++
++ u_int32_t sc_dmaier;
++ u_int32_t sc_drammodel; /* 1=dram, 0=sram */
++ u_int32_t sc_pllconfig; /* 7954/7955/7956 PLL config */
++
++ struct hifn_dma *sc_dma;
++ dma_addr_t sc_dma_physaddr;/* physical address of sc_dma */
++
++ int sc_dmansegs;
++ int32_t sc_cid;
++ int sc_maxses;
++ int sc_nsessions;
++ struct hifn_session *sc_sessions;
++ int sc_ramsize;
++ int sc_flags;
++#define HIFN_HAS_RNG 0x1 /* includes random number generator */
++#define HIFN_HAS_PUBLIC 0x2 /* includes public key support */
++#define HIFN_HAS_AES 0x4 /* includes AES support */
++#define HIFN_IS_7811 0x8 /* Hifn 7811 part */
++#define HIFN_IS_7956 0x10 /* Hifn 7956/7955 don't have SDRAM */
++
++ struct timer_list sc_tickto; /* for managing DMA */
++
++ int sc_rngfirst;
++ int sc_rnghz; /* RNG polling frequency */
++
++ int sc_c_busy; /* command ring busy */
++ int sc_s_busy; /* source data ring busy */
++ int sc_d_busy; /* destination data ring busy */
++ int sc_r_busy; /* result ring busy */
++ int sc_active; /* for initial countdown */
++ int sc_needwakeup; /* ops q'd wating on resources */
++ int sc_curbatch; /* # ops submitted w/o int */
++ int sc_suspended;
++#ifdef HIFN_VULCANDEV
++ struct cdev *sc_pkdev;
++#endif
++};
++
++#define HIFN_LOCK(_sc) spin_lock_irqsave(&(_sc)->sc_mtx, l_flags)
++#define HIFN_UNLOCK(_sc) spin_unlock_irqrestore(&(_sc)->sc_mtx, l_flags)
++
++/*
++ * hifn_command_t
++ *
++ * This is the control structure used to pass commands to hifn_encrypt().
++ *
++ * flags
++ * -----
++ * Flags is the bitwise "or" values for command configuration. A single
++ * encrypt direction needs to be set:
++ *
++ * HIFN_ENCODE or HIFN_DECODE
++ *
++ * To use cryptography, a single crypto algorithm must be included:
++ *
++ * HIFN_CRYPT_3DES or HIFN_CRYPT_DES
++ *
++ * To use authentication is used, a single MAC algorithm must be included:
++ *
++ * HIFN_MAC_MD5 or HIFN_MAC_SHA1
++ *
++ * By default MD5 uses a 16 byte hash and SHA-1 uses a 20 byte hash.
++ * If the value below is set, hash values are truncated or assumed
++ * truncated to 12 bytes:
++ *
++ * HIFN_MAC_TRUNC
++ *
++ * Keys for encryption and authentication can be sent as part of a command,
++ * or the last key value used with a particular session can be retrieved
++ * and used again if either of these flags are not specified.
++ *
++ * HIFN_CRYPT_NEW_KEY, HIFN_MAC_NEW_KEY
++ *
++ * session_num
++ * -----------
++ * A number between 0 and 2048 (for DRAM models) or a number between
++ * 0 and 768 (for SRAM models). Those who don't want to use session
++ * numbers should leave value at zero and send a new crypt key and/or
++ * new MAC key on every command. If you use session numbers and
++ * don't send a key with a command, the last key sent for that same
++ * session number will be used.
++ *
++ * Warning: Using session numbers and multiboard at the same time
++ * is currently broken.
++ *
++ * mbuf
++ * ----
++ * Either fill in the mbuf pointer and npa=0 or
++ * fill packp[] and packl[] and set npa to > 0
++ *
++ * mac_header_skip
++ * ---------------
++ * The number of bytes of the source_buf that are skipped over before
++ * authentication begins. This must be a number between 0 and 2^16-1
++ * and can be used by IPsec implementers to skip over IP headers.
++ * *** Value ignored if authentication not used ***
++ *
++ * crypt_header_skip
++ * -----------------
++ * The number of bytes of the source_buf that are skipped over before
++ * the cryptographic operation begins. This must be a number between 0
++ * and 2^16-1. For IPsec, this number will always be 8 bytes larger
++ * than the auth_header_skip (to skip over the ESP header).
++ * *** Value ignored if cryptography not used ***
++ *
++ */
++struct hifn_operand {
++ union {
++ struct sk_buff *skb;
++ struct uio *io;
++ unsigned char *buf;
++ } u;
++ void *map;
++ bus_size_t mapsize;
++ int nsegs;
++ struct {
++ dma_addr_t ds_addr;
++ int ds_len;
++ } segs[MAX_SCATTER];
++};
++
++struct hifn_command {
++ u_int16_t session_num;
++ u_int16_t base_masks, cry_masks, mac_masks;
++ u_int8_t iv[HIFN_MAX_IV_LENGTH], *ck, mac[HIFN_MAC_KEY_LENGTH];
++ int cklen;
++ int sloplen, slopidx;
++
++ struct hifn_operand src;
++ struct hifn_operand dst;
++
++ struct hifn_softc *softc;
++ struct cryptop *crp;
++ struct cryptodesc *enccrd, *maccrd;
++};
++
++#define src_skb src.u.skb
++#define src_io src.u.io
++#define src_map src.map
++#define src_mapsize src.mapsize
++#define src_segs src.segs
++#define src_nsegs src.nsegs
++#define src_buf src.u.buf
++
++#define dst_skb dst.u.skb
++#define dst_io dst.u.io
++#define dst_map dst.map
++#define dst_mapsize dst.mapsize
++#define dst_segs dst.segs
++#define dst_nsegs dst.nsegs
++#define dst_buf dst.u.buf
++
++/*
++ * Return values for hifn_crypto()
++ */
++#define HIFN_CRYPTO_SUCCESS 0
++#define HIFN_CRYPTO_BAD_INPUT (-1)
++#define HIFN_CRYPTO_RINGS_FULL (-2)
++
++/**************************************************************************
++ *
++ * Function: hifn_crypto
++ *
++ * Purpose: Called by external drivers to begin an encryption on the
++ * HIFN board.
++ *
++ * Blocking/Non-blocking Issues
++ * ============================
++ * The driver cannot block in hifn_crypto (no calls to tsleep) currently.
++ * hifn_crypto() returns HIFN_CRYPTO_RINGS_FULL if there is not enough
++ * room in any of the rings for the request to proceed.
++ *
++ * Return Values
++ * =============
++ * 0 for success, negative values on error
++ *
++ * Defines for negative error codes are:
++ *
++ * HIFN_CRYPTO_BAD_INPUT : The passed in command had invalid settings.
++ * HIFN_CRYPTO_RINGS_FULL : All DMA rings were full and non-blocking
++ * behaviour was requested.
++ *
++ *************************************************************************/
++
++/*
++ * Convert back and forth from 'sid' to 'card' and 'session'
++ */
++#define HIFN_CARD(sid) (((sid) & 0xf0000000) >> 28)
++#define HIFN_SESSION(sid) ((sid) & 0x000007ff)
++#define HIFN_SID(crd,ses) (((crd) << 28) | ((ses) & 0x7ff))
++
++#endif /* _KERNEL */
++
++struct hifn_stats {
++ u_int64_t hst_ibytes;
++ u_int64_t hst_obytes;
++ u_int32_t hst_ipackets;
++ u_int32_t hst_opackets;
++ u_int32_t hst_invalid;
++ u_int32_t hst_nomem; /* malloc or one of hst_nomem_* */
++ u_int32_t hst_abort;
++ u_int32_t hst_noirq; /* IRQ for no reason */
++ u_int32_t hst_totbatch; /* ops submitted w/o interrupt */
++ u_int32_t hst_maxbatch; /* max ops submitted together */
++ u_int32_t hst_unaligned; /* unaligned src caused copy */
++ /*
++ * The following divides hst_nomem into more specific buckets.
++ */
++ u_int32_t hst_nomem_map; /* bus_dmamap_create failed */
++ u_int32_t hst_nomem_load; /* bus_dmamap_load_* failed */
++ u_int32_t hst_nomem_mbuf; /* MGET* failed */
++ u_int32_t hst_nomem_mcl; /* MCLGET* failed */
++ u_int32_t hst_nomem_cr; /* out of command/result descriptor */
++ u_int32_t hst_nomem_sd; /* out of src/dst descriptors */
++};
++
++#endif /* __HIFN7751VAR_H__ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/hifn/hifnHIPP.c linux-2.6.29.1/crypto/ocf/hifn/hifnHIPP.c
+--- linux-2.6.29.1.orig/crypto/ocf/hifn/hifnHIPP.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/hifn/hifnHIPP.c 2009-04-20 20:01:21.492555816 +0200
+@@ -0,0 +1,420 @@
++/*-
++ * Driver for Hifn HIPP-I/II chipset
++ * Copyright (c) 2006 Michael Richardson <mcr@xelerance.com>
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored by Hifn Inc.
++ *
++ */
++
++/*
++ * Driver for various Hifn encryption processors.
++ */
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/version.h>
++#include <linux/skbuff.h>
++#include <linux/uio.h>
++#include <linux/sysfs.h>
++#include <linux/miscdevice.h>
++#include <asm/io.h>
++
++#include <cryptodev.h>
++
++#include "hifnHIPPreg.h"
++#include "hifnHIPPvar.h"
++
++#if 1
++#define DPRINTF(a...) if (hipp_debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_dev) : "hifn"); \
++ printk(a); \
++ } else
++#else
++#define DPRINTF(a...)
++#endif
++
++typedef int bus_size_t;
++
++static inline int
++pci_get_revid(struct pci_dev *dev)
++{
++ u8 rid = 0;
++ pci_read_config_byte(dev, PCI_REVISION_ID, &rid);
++ return rid;
++}
++
++#define debug hipp_debug
++int hipp_debug = 0;
++module_param(hipp_debug, int, 0644);
++MODULE_PARM_DESC(hipp_debug, "Enable debug");
++
++int hipp_maxbatch = 1;
++module_param(hipp_maxbatch, int, 0644);
++MODULE_PARM_DESC(hipp_maxbatch, "max ops to batch w/o interrupt");
++
++static int hipp_probe(struct pci_dev *dev, const struct pci_device_id *ent);
++static void hipp_remove(struct pci_dev *dev);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++static irqreturn_t hipp_intr(int irq, void *arg);
++#else
++static irqreturn_t hipp_intr(int irq, void *arg, struct pt_regs *regs);
++#endif
++
++static int hipp_num_chips = 0;
++static struct hipp_softc *hipp_chip_idx[HIPP_MAX_CHIPS];
++
++static int hipp_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int hipp_freesession(device_t, u_int64_t);
++static int hipp_process(device_t, struct cryptop *, int);
++
++static device_method_t hipp_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, hipp_newsession),
++ DEVMETHOD(cryptodev_freesession,hipp_freesession),
++ DEVMETHOD(cryptodev_process, hipp_process),
++};
++
++static __inline u_int32_t
++READ_REG(struct hipp_softc *sc, unsigned int barno, bus_size_t reg)
++{
++ u_int32_t v = readl(sc->sc_bar[barno] + reg);
++ //sc->sc_bar0_lastreg = (bus_size_t) -1;
++ return (v);
++}
++static __inline void
++WRITE_REG(struct hipp_softc *sc, unsigned int barno, bus_size_t reg, u_int32_t val)
++{
++ writel(val, sc->sc_bar[barno] + reg);
++}
++
++#define READ_REG_0(sc, reg) READ_REG(sc, 0, reg)
++#define WRITE_REG_0(sc, reg, val) WRITE_REG(sc,0, reg, val)
++#define READ_REG_1(sc, reg) READ_REG(sc, 1, reg)
++#define WRITE_REG_1(sc, reg, val) WRITE_REG(sc,1, reg, val)
++
++static int
++hipp_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ return EINVAL;
++}
++
++static int
++hipp_freesession(device_t dev, u_int64_t tid)
++{
++ return EINVAL;
++}
++
++static int
++hipp_process(device_t dev, struct cryptop *crp, int hint)
++{
++ return EINVAL;
++}
++
++static const char*
++hipp_partname(struct hipp_softc *sc, char buf[128], size_t blen)
++{
++ char *n = NULL;
++
++ switch (pci_get_vendor(sc->sc_pcidev)) {
++ case PCI_VENDOR_HIFN:
++ switch (pci_get_device(sc->sc_pcidev)) {
++ case PCI_PRODUCT_HIFN_7855: n = "Hifn 7855";
++ case PCI_PRODUCT_HIFN_8155: n = "Hifn 8155";
++ case PCI_PRODUCT_HIFN_6500: n = "Hifn 6500";
++ }
++ }
++
++ if(n==NULL) {
++ snprintf(buf, blen, "VID=%02x,PID=%02x",
++ pci_get_vendor(sc->sc_pcidev),
++ pci_get_device(sc->sc_pcidev));
++ } else {
++ buf[0]='\0';
++ strncat(buf, n, blen);
++ }
++ return buf;
++}
++
++struct hipp_fs_entry {
++ struct attribute attr;
++ /* other stuff */
++};
++
++
++static ssize_t
++cryptoid_show(struct device *dev,
++ struct device_attribute *attr,
++ char *buf)
++{
++ struct hipp_softc *sc;
++
++ sc = pci_get_drvdata(to_pci_dev (dev));
++ return sprintf (buf, "%d\n", sc->sc_cid);
++}
++
++struct device_attribute hipp_dev_cryptoid = __ATTR_RO(cryptoid);
++
++/*
++ * Attach an interface that successfully probed.
++ */
++static int
++hipp_probe(struct pci_dev *dev, const struct pci_device_id *ent)
++{
++ struct hipp_softc *sc = NULL;
++ int i;
++ //char rbase;
++ //u_int16_t ena;
++ int rev;
++ //int rseg;
++ int rc;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (pci_enable_device(dev) < 0)
++ return(-ENODEV);
++
++ if (pci_set_mwi(dev))
++ return(-ENODEV);
++
++ if (!dev->irq) {
++ printk("hifn: found device with no IRQ assigned. check BIOS settings!");
++ pci_disable_device(dev);
++ return(-ENODEV);
++ }
++
++ sc = (struct hipp_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return(-ENOMEM);
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, "hifn-hipp", hipp_num_chips, hipp_methods);
++
++ sc->sc_pcidev = dev;
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++ sc->sc_num = hipp_num_chips++;
++
++ if (sc->sc_num < HIPP_MAX_CHIPS)
++ hipp_chip_idx[sc->sc_num] = sc;
++
++ pci_set_drvdata(sc->sc_pcidev, sc);
++
++ spin_lock_init(&sc->sc_mtx);
++
++ /*
++ * Setup PCI resources.
++ * The READ_REG_0, WRITE_REG_0, READ_REG_1,
++ * and WRITE_REG_1 macros throughout the driver are used
++ * to permit better debugging.
++ */
++ for(i=0; i<4; i++) {
++ unsigned long mem_start, mem_len;
++ mem_start = pci_resource_start(sc->sc_pcidev, i);
++ mem_len = pci_resource_len(sc->sc_pcidev, i);
++ sc->sc_barphy[i] = (caddr_t)mem_start;
++ sc->sc_bar[i] = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_bar[i]) {
++ device_printf(sc->sc_dev, "cannot map bar%d register space\n", i);
++ goto fail;
++ }
++ }
++
++ //hipp_reset_board(sc, 0);
++ pci_set_master(sc->sc_pcidev);
++
++ /*
++ * Arrange the interrupt line.
++ */
++ rc = request_irq(dev->irq, hipp_intr, IRQF_SHARED, "hifn", sc);
++ if (rc) {
++ device_printf(sc->sc_dev, "could not map interrupt: %d\n", rc);
++ goto fail;
++ }
++ sc->sc_irq = dev->irq;
++
++ rev = READ_REG_1(sc, HIPP_1_REVID) & 0xffff;
++
++ {
++ char b[32];
++ device_printf(sc->sc_dev, "%s, rev %u",
++ hipp_partname(sc, b, sizeof(b)), rev);
++ }
++
++#if 0
++ if (sc->sc_flags & HIFN_IS_7956)
++ printf(", pll=0x%x<%s clk, %ux mult>",
++ sc->sc_pllconfig,
++ sc->sc_pllconfig & HIFN_PLL_REF_SEL ? "ext" : "pci",
++ 2 + 2*((sc->sc_pllconfig & HIFN_PLL_ND) >> 11));
++#endif
++ printf("\n");
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ device_printf(sc->sc_dev, "could not get crypto driver id\n");
++ goto fail;
++ }
++
++#if 0 /* cannot work with a non-GPL module */
++ /* make a sysfs entry to let the world know what entry we got */
++ sysfs_create_file(&sc->sc_pcidev->dev.kobj, &hipp_dev_cryptoid.attr);
++#endif
++
++#if 0
++ init_timer(&sc->sc_tickto);
++ sc->sc_tickto.function = hifn_tick;
++ sc->sc_tickto.data = (unsigned long) sc->sc_num;
++ mod_timer(&sc->sc_tickto, jiffies + HZ);
++#endif
++
++#if 0 /* no code here yet ?? */
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++#endif
++
++ return (0);
++
++fail:
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++
++#if 0
++ if (sc->sc_dma) {
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++
++ pci_free_consistent(sc->sc_pcidev,
++ sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++ }
++#endif
++ kfree(sc);
++ return (-ENXIO);
++}
++
++/*
++ * Detach an interface that successfully probed.
++ */
++static void
++hipp_remove(struct pci_dev *dev)
++{
++ struct hipp_softc *sc = pci_get_drvdata(dev);
++ unsigned long l_flags;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* disable interrupts */
++ HIPP_LOCK(sc);
++
++#if 0
++ WRITE_REG_1(sc, HIFN_1_DMA_IER, 0);
++ HIFN_UNLOCK(sc);
++
++ /*XXX other resources */
++ del_timer_sync(&sc->sc_tickto);
++
++ /* Turn off DMA polling */
++ WRITE_REG_1(sc, HIFN_1_DMA_CNFG, HIFN_DMACNFG_MSTRESET |
++ HIFN_DMACNFG_DMARESET | HIFN_DMACNFG_MODE);
++#endif
++
++ crypto_unregister_all(sc->sc_cid);
++
++ free_irq(sc->sc_irq, sc);
++
++#if 0
++ pci_free_consistent(sc->sc_pcidev, sizeof(*sc->sc_dma),
++ sc->sc_dma, sc->sc_dma_physaddr);
++#endif
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++static irqreturn_t hipp_intr(int irq, void *arg)
++#else
++static irqreturn_t hipp_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct hipp_softc *sc = arg;
++
++ sc = sc; /* shut up compiler */
++
++ return IRQ_HANDLED;
++}
++
++static struct pci_device_id hipp_pci_tbl[] = {
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7855,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_8155,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++};
++MODULE_DEVICE_TABLE(pci, hipp_pci_tbl);
++
++static struct pci_driver hipp_driver = {
++ .name = "hipp",
++ .id_table = hipp_pci_tbl,
++ .probe = hipp_probe,
++ .remove = hipp_remove,
++ /* add PM stuff here one day */
++};
++
++static int __init hipp_init (void)
++{
++ struct hipp_softc *sc = NULL;
++ int rc;
++
++ DPRINTF("%s(%p)\n", __FUNCTION__, hipp_init);
++
++ rc = pci_register_driver(&hipp_driver);
++ pci_register_driver_compat(&hipp_driver, rc);
++
++ return rc;
++}
++
++static void __exit hipp_exit (void)
++{
++ pci_unregister_driver(&hipp_driver);
++}
++
++module_init(hipp_init);
++module_exit(hipp_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("Michael Richardson <mcr@xelerance.com>");
++MODULE_DESCRIPTION("OCF driver for hifn HIPP-I/II PCI crypto devices");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/hifn/hifnHIPPreg.h linux-2.6.29.1/crypto/ocf/hifn/hifnHIPPreg.h
+--- linux-2.6.29.1.orig/crypto/ocf/hifn/hifnHIPPreg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/hifn/hifnHIPPreg.h 2009-04-20 20:01:21.516556358 +0200
+@@ -0,0 +1,46 @@
++/*-
++ * Hifn HIPP-I/HIPP-II (7855/8155) driver.
++ * Copyright (c) 2006 Michael Richardson <mcr@xelerance.com>
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored by Hifn inc.
++ *
++ */
++
++#ifndef __HIFNHIPP_H__
++#define __HIFNHIPP_H__
++
++/*
++ * PCI vendor and device identifiers
++ */
++#define PCI_VENDOR_HIFN 0x13a3 /* Hifn */
++#define PCI_PRODUCT_HIFN_6500 0x0006 /* 6500 */
++#define PCI_PRODUCT_HIFN_7855 0x001f /* 7855 */
++#define PCI_PRODUCT_HIFN_8155 0x999 /* XXX 8155 */
++
++#define HIPP_1_REVID 0x01 /* BOGUS */
++
++#endif /* __HIPP_H__ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/hifn/hifnHIPPvar.h linux-2.6.29.1/crypto/ocf/hifn/hifnHIPPvar.h
+--- linux-2.6.29.1.orig/crypto/ocf/hifn/hifnHIPPvar.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/hifn/hifnHIPPvar.h 2009-04-20 20:01:21.516556358 +0200
+@@ -0,0 +1,93 @@
++/*
++ * Hifn HIPP-I/HIPP-II (7855/8155) driver.
++ * Copyright (c) 2006 Michael Richardson <mcr@xelerance.com> *
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Effort sponsored by Hifn inc.
++ *
++ */
++
++#ifndef __HIFNHIPPVAR_H__
++#define __HIFNHIPPVAR_H__
++
++#define HIPP_MAX_CHIPS 8
++
++/*
++ * Holds data specific to a single Hifn HIPP-I board.
++ */
++struct hipp_softc {
++ softc_device_decl sc_dev;
++
++ struct pci_dev *sc_pcidev; /* device backpointer */
++ ocf_iomem_t sc_bar[5];
++ caddr_t sc_barphy[5]; /* physical address */
++ int sc_num; /* for multiple devs */
++ spinlock_t sc_mtx; /* per-instance lock */
++ int32_t sc_cid;
++ int sc_irq;
++
++#if 0
++
++ u_int32_t sc_dmaier;
++ u_int32_t sc_drammodel; /* 1=dram, 0=sram */
++ u_int32_t sc_pllconfig; /* 7954/7955/7956 PLL config */
++
++ struct hifn_dma *sc_dma;
++ dma_addr_t sc_dma_physaddr;/* physical address of sc_dma */
++
++ int sc_dmansegs;
++ int sc_maxses;
++ int sc_nsessions;
++ struct hifn_session *sc_sessions;
++ int sc_ramsize;
++ int sc_flags;
++#define HIFN_HAS_RNG 0x1 /* includes random number generator */
++#define HIFN_HAS_PUBLIC 0x2 /* includes public key support */
++#define HIFN_HAS_AES 0x4 /* includes AES support */
++#define HIFN_IS_7811 0x8 /* Hifn 7811 part */
++#define HIFN_IS_7956 0x10 /* Hifn 7956/7955 don't have SDRAM */
++
++ struct timer_list sc_tickto; /* for managing DMA */
++
++ int sc_rngfirst;
++ int sc_rnghz; /* RNG polling frequency */
++
++ int sc_c_busy; /* command ring busy */
++ int sc_s_busy; /* source data ring busy */
++ int sc_d_busy; /* destination data ring busy */
++ int sc_r_busy; /* result ring busy */
++ int sc_active; /* for initial countdown */
++ int sc_needwakeup; /* ops q'd wating on resources */
++ int sc_curbatch; /* # ops submitted w/o int */
++ int sc_suspended;
++ struct miscdevice sc_miscdev;
++#endif
++};
++
++#define HIPP_LOCK(_sc) spin_lock_irqsave(&(_sc)->sc_mtx, l_flags)
++#define HIPP_UNLOCK(_sc) spin_unlock_irqrestore(&(_sc)->sc_mtx, l_flags)
++
++#endif /* __HIFNHIPPVAR_H__ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ixp4xx/Makefile linux-2.6.29.1/crypto/ocf/ixp4xx/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/ixp4xx/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ixp4xx/Makefile 2009-04-20 20:01:21.520556868 +0200
+@@ -0,0 +1,104 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++#
++# You will need to point this at your Intel ixp425 includes, this portion
++# of the Makefile only really works under SGLinux with the appropriate libs
++# installed. They can be downloaded from http://www.snapgear.org/
++#
++ifeq ($(CONFIG_CPU_IXP46X),y)
++IXPLATFORM = ixp46X
++else
++ifeq ($(CONFIG_CPU_IXP43X),y)
++IXPLATFORM = ixp43X
++else
++IXPLATFORM = ixp42X
++endif
++endif
++
++ifdef CONFIG_IXP400_LIB_2_4
++IX_XSCALE_SW = $(ROOTDIR)/modules/ixp425/ixp400-2.4/ixp400_xscale_sw
++OSAL_DIR = $(ROOTDIR)/modules/ixp425/ixp400-2.4/ixp_osal
++endif
++ifdef CONFIG_IXP400_LIB_2_1
++IX_XSCALE_SW = $(ROOTDIR)/modules/ixp425/ixp400-2.1/ixp400_xscale_sw
++OSAL_DIR = $(ROOTDIR)/modules/ixp425/ixp400-2.1/ixp_osal
++endif
++ifdef CONFIG_IXP400_LIB_2_0
++IX_XSCALE_SW = $(ROOTDIR)/modules/ixp425/ixp400-2.0/ixp400_xscale_sw
++OSAL_DIR = $(ROOTDIR)/modules/ixp425/ixp400-2.0/ixp_osal
++endif
++ifdef IX_XSCALE_SW
++ifdef CONFIG_IXP400_LIB_2_4
++IXP_CFLAGS = \
++ -I$(ROOTDIR)/. \
++ -I$(IX_XSCALE_SW)/src/include \
++ -I$(OSAL_DIR)/common/include/ \
++ -I$(OSAL_DIR)/common/include/modules/ \
++ -I$(OSAL_DIR)/common/include/modules/ddk/ \
++ -I$(OSAL_DIR)/common/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/common/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/common/os/linux/include/ \
++ -I$(OSAL_DIR)/common/os/linux/include/core/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/ddk/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/common/os/linux/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/platforms/$(IXPLATFORM)/include/ \
++ -I$(OSAL_DIR)/platforms/$(IXPLATFORM)/os/linux/include/ \
++ -DENABLE_IOMEM -DENABLE_BUFFERMGT -DENABLE_DDK \
++ -DUSE_IXP4XX_CRYPTO
++else
++IXP_CFLAGS = \
++ -I$(ROOTDIR)/. \
++ -I$(IX_XSCALE_SW)/src/include \
++ -I$(OSAL_DIR)/ \
++ -I$(OSAL_DIR)/os/linux/include/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/os/linux/include/core/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ixp425 \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ixp465 \
++ -I$(OSAL_DIR)/os/linux/include/core/ \
++ -I$(OSAL_DIR)/include/ \
++ -I$(OSAL_DIR)/include/modules/ \
++ -I$(OSAL_DIR)/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/include/platforms/ \
++ -I$(OSAL_DIR)/include/platforms/ixp400/ \
++ -DUSE_IXP4XX_CRYPTO
++endif
++endif
++ifdef CONFIG_IXP400_LIB_1_4
++IXP_CFLAGS = \
++ -I$(ROOTDIR)/. \
++ -I$(ROOTDIR)/modules/ixp425/ixp400-1.4/ixp400_xscale_sw/src/include \
++ -I$(ROOTDIR)/modules/ixp425/ixp400-1.4/ixp400_xscale_sw/src/linux \
++ -DUSE_IXP4XX_CRYPTO
++endif
++ifndef IXPDIR
++IXPDIR = ixp-version-is-not-supported
++endif
++
++ifeq ($(CONFIG_CPU_IXP46X),y)
++IXP_CFLAGS += -D__ixp46X
++else
++ifeq ($(CONFIG_CPU_IXP43X),y)
++IXP_CFLAGS += -D__ixp43X
++else
++IXP_CFLAGS += -D__ixp42X
++endif
++endif
++
++obj-$(CONFIG_OCF_IXP4XX) += ixp4xx.o
++
++obj ?= .
++EXTRA_CFLAGS += $(IXP_CFLAGS) -I$(obj)/.. -I$(obj)/.
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ixp4xx/ixp4xx.c linux-2.6.29.1/crypto/ocf/ixp4xx/ixp4xx.c
+--- linux-2.6.29.1.orig/crypto/ocf/ixp4xx/ixp4xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ixp4xx/ixp4xx.c 2009-04-20 20:01:21.520556868 +0200
+@@ -0,0 +1,1328 @@
++/*
++ * An OCF module that uses Intels IXP CryptACC API to do the crypto.
++ * This driver requires the IXP400 Access Library that is available
++ * from Intel in order to operate (or compile).
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/sched.h>
++#include <linux/wait.h>
++#include <linux/crypto.h>
++#include <linux/interrupt.h>
++#include <asm/scatterlist.h>
++
++#include <IxTypes.h>
++#include <IxOsBuffMgt.h>
++#include <IxNpeDl.h>
++#include <IxCryptoAcc.h>
++#include <IxQMgr.h>
++#include <IxOsServices.h>
++#include <IxOsCacheMMU.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++#ifndef IX_MBUF_PRIV
++#define IX_MBUF_PRIV(x) ((x)->priv)
++#endif
++
++struct ixp_data;
++
++struct ixp_q {
++ struct list_head ixp_q_list;
++ struct ixp_data *ixp_q_data;
++ struct cryptop *ixp_q_crp;
++ struct cryptodesc *ixp_q_ccrd;
++ struct cryptodesc *ixp_q_acrd;
++ IX_MBUF ixp_q_mbuf;
++ UINT8 *ixp_hash_dest; /* Location for hash in client buffer */
++ UINT8 *ixp_hash_src; /* Location of hash in internal buffer */
++ unsigned char ixp_q_iv_data[IX_CRYPTO_ACC_MAX_CIPHER_IV_LENGTH];
++ unsigned char *ixp_q_iv;
++};
++
++struct ixp_data {
++ int ixp_registered; /* is the context registered */
++ int ixp_crd_flags; /* detect direction changes */
++
++ int ixp_cipher_alg;
++ int ixp_auth_alg;
++
++ UINT32 ixp_ctx_id;
++ UINT32 ixp_hash_key_id; /* used when hashing */
++ IxCryptoAccCtx ixp_ctx;
++ IX_MBUF ixp_pri_mbuf;
++ IX_MBUF ixp_sec_mbuf;
++
++ struct work_struct ixp_pending_work;
++ struct work_struct ixp_registration_work;
++ struct list_head ixp_q; /* unprocessed requests */
++};
++
++#ifdef __ixp46X
++
++#define MAX_IOP_SIZE 64 /* words */
++#define MAX_OOP_SIZE 128
++
++#define MAX_PARAMS 3
++
++struct ixp_pkq {
++ struct list_head pkq_list;
++ struct cryptkop *pkq_krp;
++
++ IxCryptoAccPkeEauInOperands pkq_op;
++ IxCryptoAccPkeEauOpResult pkq_result;
++
++ UINT32 pkq_ibuf0[MAX_IOP_SIZE];
++ UINT32 pkq_ibuf1[MAX_IOP_SIZE];
++ UINT32 pkq_ibuf2[MAX_IOP_SIZE];
++ UINT32 pkq_obuf[MAX_OOP_SIZE];
++};
++
++static LIST_HEAD(ixp_pkq); /* current PK wait list */
++static struct ixp_pkq *ixp_pk_cur;
++static spinlock_t ixp_pkq_lock;
++
++#endif /* __ixp46X */
++
++static int ixp_blocked = 0;
++
++static int32_t ixp_id = -1;
++static struct ixp_data **ixp_sessions = NULL;
++static u_int32_t ixp_sesnum = 0;
++
++static int ixp_process(device_t, struct cryptop *, int);
++static int ixp_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int ixp_freesession(device_t, u_int64_t);
++#ifdef __ixp46X
++static int ixp_kprocess(device_t, struct cryptkop *krp, int hint);
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
++static kmem_cache_t *qcache;
++#else
++static struct kmem_cache *qcache;
++#endif
++
++#define debug ixp_debug
++static int ixp_debug = 0;
++module_param(ixp_debug, int, 0644);
++MODULE_PARM_DESC(ixp_debug, "Enable debug");
++
++static int ixp_init_crypto = 1;
++module_param(ixp_init_crypto, int, 0444); /* RO after load/boot */
++MODULE_PARM_DESC(ixp_init_crypto, "Call ixCryptoAccInit (default is 1)");
++
++static void ixp_process_pending(void *arg);
++static void ixp_registration(void *arg);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void ixp_process_pending_wq(struct work_struct *work);
++static void ixp_registration_wq(struct work_struct *work);
++#endif
++
++/*
++ * dummy device structure
++ */
++
++static struct {
++ softc_device_decl sc_dev;
++} ixpdev;
++
++static device_method_t ixp_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, ixp_newsession),
++ DEVMETHOD(cryptodev_freesession,ixp_freesession),
++ DEVMETHOD(cryptodev_process, ixp_process),
++#ifdef __ixp46X
++ DEVMETHOD(cryptodev_kprocess, ixp_kprocess),
++#endif
++};
++
++/*
++ * Generate a new software session.
++ */
++static int
++ixp_newsession(device_t dev, u_int32_t *sid, struct cryptoini *cri)
++{
++ struct ixp_data *ixp;
++ u_int32_t i;
++#define AUTH_LEN(cri, def) \
++ (cri->cri_mlen ? cri->cri_mlen : (def))
++
++ dprintk("%s():alg %d\n", __FUNCTION__,cri->cri_alg);
++ if (sid == NULL || cri == NULL) {
++ dprintk("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ if (ixp_sessions) {
++ for (i = 1; i < ixp_sesnum; i++)
++ if (ixp_sessions[i] == NULL)
++ break;
++ } else
++ i = 1; /* NB: to silence compiler warning */
++
++ if (ixp_sessions == NULL || i == ixp_sesnum) {
++ struct ixp_data **ixpd;
++
++ if (ixp_sessions == NULL) {
++ i = 1; /* We leave ixp_sessions[0] empty */
++ ixp_sesnum = CRYPTO_SW_SESSIONS;
++ } else
++ ixp_sesnum *= 2;
++
++ ixpd = kmalloc(ixp_sesnum * sizeof(struct ixp_data *), SLAB_ATOMIC);
++ if (ixpd == NULL) {
++ /* Reset session number */
++ if (ixp_sesnum == CRYPTO_SW_SESSIONS)
++ ixp_sesnum = 0;
++ else
++ ixp_sesnum /= 2;
++ dprintk("%s,%d: ENOBUFS\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++ memset(ixpd, 0, ixp_sesnum * sizeof(struct ixp_data *));
++
++ /* Copy existing sessions */
++ if (ixp_sessions) {
++ memcpy(ixpd, ixp_sessions,
++ (ixp_sesnum / 2) * sizeof(struct ixp_data *));
++ kfree(ixp_sessions);
++ }
++
++ ixp_sessions = ixpd;
++ }
++
++ ixp_sessions[i] = (struct ixp_data *) kmalloc(sizeof(struct ixp_data),
++ SLAB_ATOMIC);
++ if (ixp_sessions[i] == NULL) {
++ ixp_freesession(NULL, i);
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return ENOBUFS;
++ }
++
++ *sid = i;
++
++ ixp = ixp_sessions[i];
++ memset(ixp, 0, sizeof(*ixp));
++
++ ixp->ixp_cipher_alg = -1;
++ ixp->ixp_auth_alg = -1;
++ ixp->ixp_ctx_id = -1;
++ INIT_LIST_HEAD(&ixp->ixp_q);
++
++ ixp->ixp_ctx.useDifferentSrcAndDestMbufs = 0;
++
++ while (cri) {
++ switch (cri->cri_alg) {
++ case CRYPTO_DES_CBC:
++ ixp->ixp_cipher_alg = cri->cri_alg;
++ ixp->ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_DES;
++ ixp->ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp->ixp_ctx.cipherCtx.cipherKeyLen = (cri->cri_klen + 7) / 8;
++ ixp->ixp_ctx.cipherCtx.cipherBlockLen = IX_CRYPTO_ACC_DES_BLOCK_64;
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen =
++ IX_CRYPTO_ACC_DES_IV_64;
++ memcpy(ixp->ixp_ctx.cipherCtx.key.cipherKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ break;
++
++ case CRYPTO_3DES_CBC:
++ ixp->ixp_cipher_alg = cri->cri_alg;
++ ixp->ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_3DES;
++ ixp->ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp->ixp_ctx.cipherCtx.cipherKeyLen = (cri->cri_klen + 7) / 8;
++ ixp->ixp_ctx.cipherCtx.cipherBlockLen = IX_CRYPTO_ACC_DES_BLOCK_64;
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen =
++ IX_CRYPTO_ACC_DES_IV_64;
++ memcpy(ixp->ixp_ctx.cipherCtx.key.cipherKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ break;
++
++ case CRYPTO_RIJNDAEL128_CBC:
++ ixp->ixp_cipher_alg = cri->cri_alg;
++ ixp->ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_AES;
++ ixp->ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp->ixp_ctx.cipherCtx.cipherKeyLen = (cri->cri_klen + 7) / 8;
++ ixp->ixp_ctx.cipherCtx.cipherBlockLen = 16;
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen = 16;
++ memcpy(ixp->ixp_ctx.cipherCtx.key.cipherKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ break;
++
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ ixp->ixp_auth_alg = cri->cri_alg;
++ ixp->ixp_ctx.authCtx.authAlgo = IX_CRYPTO_ACC_AUTH_MD5;
++ ixp->ixp_ctx.authCtx.authDigestLen = AUTH_LEN(cri, MD5_HASH_LEN);
++ ixp->ixp_ctx.authCtx.aadLen = 0;
++ /* Only MD5_HMAC needs a key */
++ if (cri->cri_alg == CRYPTO_MD5_HMAC) {
++ ixp->ixp_ctx.authCtx.authKeyLen = (cri->cri_klen + 7) / 8;
++ if (ixp->ixp_ctx.authCtx.authKeyLen >
++ sizeof(ixp->ixp_ctx.authCtx.key.authKey)) {
++ printk(
++ "ixp4xx: Invalid key length for MD5_HMAC - %d bits\n",
++ cri->cri_klen);
++ ixp_freesession(NULL, i);
++ return EINVAL;
++ }
++ memcpy(ixp->ixp_ctx.authCtx.key.authKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ }
++ break;
++
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ ixp->ixp_auth_alg = cri->cri_alg;
++ ixp->ixp_ctx.authCtx.authAlgo = IX_CRYPTO_ACC_AUTH_SHA1;
++ ixp->ixp_ctx.authCtx.authDigestLen = AUTH_LEN(cri, SHA1_HASH_LEN);
++ ixp->ixp_ctx.authCtx.aadLen = 0;
++ /* Only SHA1_HMAC needs a key */
++ if (cri->cri_alg == CRYPTO_SHA1_HMAC) {
++ ixp->ixp_ctx.authCtx.authKeyLen = (cri->cri_klen + 7) / 8;
++ if (ixp->ixp_ctx.authCtx.authKeyLen >
++ sizeof(ixp->ixp_ctx.authCtx.key.authKey)) {
++ printk(
++ "ixp4xx: Invalid key length for SHA1_HMAC - %d bits\n",
++ cri->cri_klen);
++ ixp_freesession(NULL, i);
++ return EINVAL;
++ }
++ memcpy(ixp->ixp_ctx.authCtx.key.authKey,
++ cri->cri_key, (cri->cri_klen + 7) / 8);
++ }
++ break;
++
++ default:
++ printk("ixp: unknown algo 0x%x\n", cri->cri_alg);
++ ixp_freesession(NULL, i);
++ return EINVAL;
++ }
++ cri = cri->cri_next;
++ }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ INIT_WORK(&ixp->ixp_pending_work, ixp_process_pending_wq);
++ INIT_WORK(&ixp->ixp_registration_work, ixp_registration_wq);
++#else
++ INIT_WORK(&ixp->ixp_pending_work, ixp_process_pending, ixp);
++ INIT_WORK(&ixp->ixp_registration_work, ixp_registration, ixp);
++#endif
++
++ return 0;
++}
++
++
++/*
++ * Free a session.
++ */
++static int
++ixp_freesession(device_t dev, u_int64_t tid)
++{
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid > ixp_sesnum || ixp_sessions == NULL ||
++ ixp_sessions[sid] == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ /* Silently accept and return */
++ if (sid == 0)
++ return 0;
++
++ if (ixp_sessions[sid]) {
++ if (ixp_sessions[sid]->ixp_ctx_id != -1) {
++ ixCryptoAccCtxUnregister(ixp_sessions[sid]->ixp_ctx_id);
++ ixp_sessions[sid]->ixp_ctx_id = -1;
++ }
++
++ flush_scheduled_work();
++
++ kfree(ixp_sessions[sid]);
++ }
++ ixp_sessions[sid] = NULL;
++ if (ixp_blocked) {
++ ixp_blocked = 0;
++ crypto_unblock(ixp_id, CRYPTO_SYMQ);
++ }
++ return 0;
++}
++
++
++/*
++ * callback for when hash processing is complete
++ */
++
++static void
++ixp_hash_perform_cb(
++ UINT32 hash_key_id,
++ IX_MBUF *bufp,
++ IxCryptoAccStatus status)
++{
++ struct ixp_q *q;
++
++ dprintk("%s(%u, %p, 0x%x)\n", __FUNCTION__, hash_key_id, bufp, status);
++
++ if (bufp == NULL) {
++ printk("ixp: NULL buf in %s\n", __FUNCTION__);
++ return;
++ }
++
++ q = IX_MBUF_PRIV(bufp);
++ if (q == NULL) {
++ printk("ixp: NULL priv in %s\n", __FUNCTION__);
++ return;
++ }
++
++ if (status == IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ /* On success, need to copy hash back into original client buffer */
++ memcpy(q->ixp_hash_dest, q->ixp_hash_src,
++ (q->ixp_q_data->ixp_auth_alg == CRYPTO_SHA1) ?
++ SHA1_HASH_LEN : MD5_HASH_LEN);
++ }
++ else {
++ printk("ixp: hash perform failed status=%d\n", status);
++ q->ixp_q_crp->crp_etype = EINVAL;
++ }
++
++ /* Free internal buffer used for hashing */
++ kfree(IX_MBUF_MDATA(&q->ixp_q_mbuf));
++
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++}
++
++/*
++ * setup a request and perform it
++ */
++static void
++ixp_q_process(struct ixp_q *q)
++{
++ IxCryptoAccStatus status;
++ struct ixp_data *ixp = q->ixp_q_data;
++ int auth_off = 0;
++ int auth_len = 0;
++ int crypt_off = 0;
++ int crypt_len = 0;
++ int icv_off = 0;
++ char *crypt_func;
++
++ dprintk("%s(%p)\n", __FUNCTION__, q);
++
++ if (q->ixp_q_ccrd) {
++ if (q->ixp_q_ccrd->crd_flags & CRD_F_IV_EXPLICIT) {
++ q->ixp_q_iv = q->ixp_q_ccrd->crd_iv;
++ } else {
++ q->ixp_q_iv = q->ixp_q_iv_data;
++ crypto_copydata(q->ixp_q_crp->crp_flags, q->ixp_q_crp->crp_buf,
++ q->ixp_q_ccrd->crd_inject,
++ ixp->ixp_ctx.cipherCtx.cipherInitialVectorLen,
++ (caddr_t) q->ixp_q_iv);
++ }
++
++ if (q->ixp_q_acrd) {
++ auth_off = q->ixp_q_acrd->crd_skip;
++ auth_len = q->ixp_q_acrd->crd_len;
++ icv_off = q->ixp_q_acrd->crd_inject;
++ }
++
++ crypt_off = q->ixp_q_ccrd->crd_skip;
++ crypt_len = q->ixp_q_ccrd->crd_len;
++ } else { /* if (q->ixp_q_acrd) */
++ auth_off = q->ixp_q_acrd->crd_skip;
++ auth_len = q->ixp_q_acrd->crd_len;
++ icv_off = q->ixp_q_acrd->crd_inject;
++ }
++
++ if (q->ixp_q_crp->crp_flags & CRYPTO_F_SKBUF) {
++ struct sk_buff *skb = (struct sk_buff *) q->ixp_q_crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags) {
++ /*
++ * DAVIDM fix this limitation one day by using
++ * a buffer pool and chaining, it is not currently
++ * needed for current user/kernel space acceleration
++ */
++ printk("ixp: Cannot handle fragmented skb's yet !\n");
++ q->ixp_q_crp->crp_etype = ENOENT;
++ goto done;
++ }
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) =
++ IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) = skb->len;
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = skb->data;
++ } else if (q->ixp_q_crp->crp_flags & CRYPTO_F_IOV) {
++ struct uio *uiop = (struct uio *) q->ixp_q_crp->crp_buf;
++ if (uiop->uio_iovcnt != 1) {
++ /*
++ * DAVIDM fix this limitation one day by using
++ * a buffer pool and chaining, it is not currently
++ * needed for current user/kernel space acceleration
++ */
++ printk("ixp: Cannot handle more than 1 iovec yet !\n");
++ q->ixp_q_crp->crp_etype = ENOENT;
++ goto done;
++ }
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) =
++ IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) = uiop->uio_iov[0].iov_len;
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = uiop->uio_iov[0].iov_base;
++ } else /* contig buffer */ {
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) =
++ IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) = q->ixp_q_crp->crp_ilen;
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = q->ixp_q_crp->crp_buf;
++ }
++
++ IX_MBUF_PRIV(&q->ixp_q_mbuf) = q;
++
++ if (ixp->ixp_auth_alg == CRYPTO_SHA1 || ixp->ixp_auth_alg == CRYPTO_MD5) {
++ /*
++ * For SHA1 and MD5 hash, need to create an internal buffer that is big
++ * enough to hold the original data + the appropriate padding for the
++ * hash algorithm.
++ */
++ UINT8 *tbuf = NULL;
++
++ IX_MBUF_MLEN(&q->ixp_q_mbuf) = IX_MBUF_PKT_LEN(&q->ixp_q_mbuf) =
++ ((IX_MBUF_MLEN(&q->ixp_q_mbuf) * 8) + 72 + 511) / 8;
++ tbuf = kmalloc(IX_MBUF_MLEN(&q->ixp_q_mbuf), SLAB_ATOMIC);
++
++ if (IX_MBUF_MDATA(&q->ixp_q_mbuf) == NULL) {
++ printk("ixp: kmalloc(%u, SLAB_ATOMIC) failed\n",
++ IX_MBUF_MLEN(&q->ixp_q_mbuf));
++ q->ixp_q_crp->crp_etype = ENOMEM;
++ goto done;
++ }
++ memcpy(tbuf, &(IX_MBUF_MDATA(&q->ixp_q_mbuf))[auth_off], auth_len);
++
++ /* Set location in client buffer to copy hash into */
++ q->ixp_hash_dest =
++ &(IX_MBUF_MDATA(&q->ixp_q_mbuf))[auth_off + auth_len];
++
++ IX_MBUF_MDATA(&q->ixp_q_mbuf) = tbuf;
++
++ /* Set location in internal buffer for where hash starts */
++ q->ixp_hash_src = &(IX_MBUF_MDATA(&q->ixp_q_mbuf))[auth_len];
++
++ crypt_func = "ixCryptoAccHashPerform";
++ status = ixCryptoAccHashPerform(ixp->ixp_ctx.authCtx.authAlgo,
++ &q->ixp_q_mbuf, ixp_hash_perform_cb, 0, auth_len, auth_len,
++ &ixp->ixp_hash_key_id);
++ }
++ else {
++ crypt_func = "ixCryptoAccAuthCryptPerform";
++ status = ixCryptoAccAuthCryptPerform(ixp->ixp_ctx_id, &q->ixp_q_mbuf,
++ NULL, auth_off, auth_len, crypt_off, crypt_len, icv_off,
++ q->ixp_q_iv);
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ return;
++
++ if (IX_CRYPTO_ACC_STATUS_QUEUE_FULL == status) {
++ q->ixp_q_crp->crp_etype = ENOMEM;
++ goto done;
++ }
++
++ printk("ixp: %s failed %u\n", crypt_func, status);
++ q->ixp_q_crp->crp_etype = EINVAL;
++
++done:
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++}
++
++
++/*
++ * because we cannot process the Q from the Register callback
++ * we do it here on a task Q.
++ */
++
++static void
++ixp_process_pending(void *arg)
++{
++ struct ixp_data *ixp = arg;
++ struct ixp_q *q = NULL;
++
++ dprintk("%s(%p)\n", __FUNCTION__, arg);
++
++ if (!ixp)
++ return;
++
++ while (!list_empty(&ixp->ixp_q)) {
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ list_del(&q->ixp_q_list);
++ ixp_q_process(q);
++ }
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ixp_process_pending_wq(struct work_struct *work)
++{
++ struct ixp_data *ixp = container_of(work, struct ixp_data,
++ ixp_pending_work);
++ ixp_process_pending(ixp);
++}
++#endif
++
++/*
++ * callback for when context registration is complete
++ */
++
++static void
++ixp_register_cb(UINT32 ctx_id, IX_MBUF *bufp, IxCryptoAccStatus status)
++{
++ int i;
++ struct ixp_data *ixp;
++ struct ixp_q *q;
++
++ dprintk("%s(%d, %p, %d)\n", __FUNCTION__, ctx_id, bufp, status);
++
++ /*
++ * free any buffer passed in to this routine
++ */
++ if (bufp) {
++ IX_MBUF_MLEN(bufp) = IX_MBUF_PKT_LEN(bufp) = 0;
++ kfree(IX_MBUF_MDATA(bufp));
++ IX_MBUF_MDATA(bufp) = NULL;
++ }
++
++ for (i = 0; i < ixp_sesnum; i++) {
++ ixp = ixp_sessions[i];
++ if (ixp && ixp->ixp_ctx_id == ctx_id)
++ break;
++ }
++ if (i >= ixp_sesnum) {
++ printk("ixp: invalid context id %d\n", ctx_id);
++ return;
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_WAIT == status) {
++ /* this is normal to free the first of two buffers */
++ dprintk("ixp: register not finished yet.\n");
++ return;
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS != status) {
++ printk("ixp: register failed 0x%x\n", status);
++ while (!list_empty(&ixp->ixp_q)) {
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ list_del(&q->ixp_q_list);
++ q->ixp_q_crp->crp_etype = EINVAL;
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++ }
++ return;
++ }
++
++ /*
++ * we are now registered, we cannot start processing the Q here
++ * or we get strange errors with AES (DES/3DES seem to be ok).
++ */
++ ixp->ixp_registered = 1;
++ schedule_work(&ixp->ixp_pending_work);
++}
++
++
++/*
++ * callback for when data processing is complete
++ */
++
++static void
++ixp_perform_cb(
++ UINT32 ctx_id,
++ IX_MBUF *sbufp,
++ IX_MBUF *dbufp,
++ IxCryptoAccStatus status)
++{
++ struct ixp_q *q;
++
++ dprintk("%s(%d, %p, %p, 0x%x)\n", __FUNCTION__, ctx_id, sbufp,
++ dbufp, status);
++
++ if (sbufp == NULL) {
++ printk("ixp: NULL sbuf in ixp_perform_cb\n");
++ return;
++ }
++
++ q = IX_MBUF_PRIV(sbufp);
++ if (q == NULL) {
++ printk("ixp: NULL priv in ixp_perform_cb\n");
++ return;
++ }
++
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ printk("ixp: perform failed status=%d\n", status);
++ q->ixp_q_crp->crp_etype = EINVAL;
++ }
++
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++}
++
++
++/*
++ * registration is not callable at IRQ time, so we defer
++ * to a task queue, this routines completes the registration for us
++ * when the task queue runs
++ *
++ * Unfortunately this means we cannot tell OCF that the driver is blocked,
++ * we do that on the next request.
++ */
++
++static void
++ixp_registration(void *arg)
++{
++ struct ixp_data *ixp = arg;
++ struct ixp_q *q = NULL;
++ IX_MBUF *pri = NULL, *sec = NULL;
++ int status = IX_CRYPTO_ACC_STATUS_SUCCESS;
++
++ if (!ixp) {
++ printk("ixp: ixp_registration with no arg\n");
++ return;
++ }
++
++ if (ixp->ixp_ctx_id != -1) {
++ ixCryptoAccCtxUnregister(ixp->ixp_ctx_id);
++ ixp->ixp_ctx_id = -1;
++ }
++
++ if (list_empty(&ixp->ixp_q)) {
++ printk("ixp: ixp_registration with no Q\n");
++ return;
++ }
++
++ /*
++ * setup the primary and secondary buffers
++ */
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ if (q->ixp_q_acrd) {
++ pri = &ixp->ixp_pri_mbuf;
++ sec = &ixp->ixp_sec_mbuf;
++ IX_MBUF_MLEN(pri) = IX_MBUF_PKT_LEN(pri) = 128;
++ IX_MBUF_MDATA(pri) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++ IX_MBUF_MLEN(sec) = IX_MBUF_PKT_LEN(sec) = 128;
++ IX_MBUF_MDATA(sec) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++ }
++
++ /* Only need to register if a crypt op or HMAC op */
++ if (!(ixp->ixp_auth_alg == CRYPTO_SHA1 ||
++ ixp->ixp_auth_alg == CRYPTO_MD5)) {
++ status = ixCryptoAccCtxRegister(
++ &ixp->ixp_ctx,
++ pri, sec,
++ ixp_register_cb,
++ ixp_perform_cb,
++ &ixp->ixp_ctx_id);
++ }
++ else {
++ /* Otherwise we start processing pending q */
++ schedule_work(&ixp->ixp_pending_work);
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ return;
++
++ if (IX_CRYPTO_ACC_STATUS_EXCEED_MAX_TUNNELS == status) {
++ printk("ixp: ixCryptoAccCtxRegister failed (out of tunnels)\n");
++ ixp_blocked = 1;
++ /* perhaps we should return EGAIN on queued ops ? */
++ return;
++ }
++
++ printk("ixp: ixCryptoAccCtxRegister failed %d\n", status);
++ ixp->ixp_ctx_id = -1;
++
++ /*
++ * everything waiting is toasted
++ */
++ while (!list_empty(&ixp->ixp_q)) {
++ q = list_entry(ixp->ixp_q.next, struct ixp_q, ixp_q_list);
++ list_del(&q->ixp_q_list);
++ q->ixp_q_crp->crp_etype = ENOENT;
++ crypto_done(q->ixp_q_crp);
++ kmem_cache_free(qcache, q);
++ }
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ixp_registration_wq(struct work_struct *work)
++{
++ struct ixp_data *ixp = container_of(work, struct ixp_data,
++ ixp_registration_work);
++ ixp_registration(ixp);
++}
++#endif
++
++/*
++ * Process a request.
++ */
++static int
++ixp_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct ixp_data *ixp;
++ unsigned int lid;
++ struct ixp_q *q = NULL;
++ int status;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ /* Sanity check */
++ if (crp == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ crp->crp_etype = 0;
++
++ if (ixp_blocked)
++ return ERESTART;
++
++ if (crp->crp_desc == NULL || crp->crp_buf == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ /*
++ * find the session we are using
++ */
++
++ lid = crp->crp_sid & 0xffffffff;
++ if (lid >= ixp_sesnum || lid == 0 || ixp_sessions == NULL ||
++ ixp_sessions[lid] == NULL) {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++ ixp = ixp_sessions[lid];
++
++ /*
++ * setup a new request ready for queuing
++ */
++ q = kmem_cache_alloc(qcache, SLAB_ATOMIC);
++ if (q == NULL) {
++ dprintk("%s,%d: ENOMEM\n", __FILE__, __LINE__);
++ crp->crp_etype = ENOMEM;
++ goto done;
++ }
++ /*
++ * save some cycles by only zeroing the important bits
++ */
++ memset(&q->ixp_q_mbuf, 0, sizeof(q->ixp_q_mbuf));
++ q->ixp_q_ccrd = NULL;
++ q->ixp_q_acrd = NULL;
++ q->ixp_q_crp = crp;
++ q->ixp_q_data = ixp;
++
++ /*
++ * point the cipher and auth descriptors appropriately
++ * check that we have something to do
++ */
++ if (crp->crp_desc->crd_alg == ixp->ixp_cipher_alg)
++ q->ixp_q_ccrd = crp->crp_desc;
++ else if (crp->crp_desc->crd_alg == ixp->ixp_auth_alg)
++ q->ixp_q_acrd = crp->crp_desc;
++ else {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: bad desc match: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++ if (crp->crp_desc->crd_next) {
++ if (crp->crp_desc->crd_next->crd_alg == ixp->ixp_cipher_alg)
++ q->ixp_q_ccrd = crp->crp_desc->crd_next;
++ else if (crp->crp_desc->crd_next->crd_alg == ixp->ixp_auth_alg)
++ q->ixp_q_acrd = crp->crp_desc->crd_next;
++ else {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: bad desc match: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++ }
++
++ /*
++ * If there is a direction change for this context then we mark it as
++ * unregistered and re-register is for the new direction. This is not
++ * a very expensive operation and currently only tends to happen when
++ * user-space application are doing benchmarks
++ *
++ * DM - we should be checking for pending requests before unregistering.
++ */
++ if (q->ixp_q_ccrd && ixp->ixp_registered &&
++ ixp->ixp_crd_flags != (q->ixp_q_ccrd->crd_flags & CRD_F_ENCRYPT)) {
++ dprintk("%s - detected direction change on session\n", __FUNCTION__);
++ ixp->ixp_registered = 0;
++ }
++
++ /*
++ * if we are registered, call straight into the perform code
++ */
++ if (ixp->ixp_registered) {
++ ixp_q_process(q);
++ return 0;
++ }
++
++ /*
++ * the only part of the context not set in newsession is the direction
++ * dependent parts
++ */
++ if (q->ixp_q_ccrd) {
++ ixp->ixp_crd_flags = (q->ixp_q_ccrd->crd_flags & CRD_F_ENCRYPT);
++ if (q->ixp_q_ccrd->crd_flags & CRD_F_ENCRYPT) {
++ ixp->ixp_ctx.operation = q->ixp_q_acrd ?
++ IX_CRYPTO_ACC_OP_ENCRYPT_AUTH : IX_CRYPTO_ACC_OP_ENCRYPT;
++ } else {
++ ixp->ixp_ctx.operation = q->ixp_q_acrd ?
++ IX_CRYPTO_ACC_OP_AUTH_DECRYPT : IX_CRYPTO_ACC_OP_DECRYPT;
++ }
++ } else {
++ /* q->ixp_q_acrd must be set if we are here */
++ ixp->ixp_ctx.operation = IX_CRYPTO_ACC_OP_AUTH_CALC;
++ }
++
++ status = list_empty(&ixp->ixp_q);
++ list_add_tail(&q->ixp_q_list, &ixp->ixp_q);
++ if (status)
++ schedule_work(&ixp->ixp_registration_work);
++ return 0;
++
++done:
++ if (q)
++ kmem_cache_free(qcache, q);
++ crypto_done(crp);
++ return 0;
++}
++
++
++#ifdef __ixp46X
++/*
++ * key processing support for the ixp465
++ */
++
++
++/*
++ * copy a BN (LE) into a buffer (BE) an fill out the op appropriately
++ * assume zeroed and only copy bits that are significant
++ */
++
++static int
++ixp_copy_ibuf(struct crparam *p, IxCryptoAccPkeEauOperand *op, UINT32 *buf)
++{
++ unsigned char *src = (unsigned char *) p->crp_p;
++ unsigned char *dst;
++ int len, bits = p->crp_nbits;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ if (bits > MAX_IOP_SIZE * sizeof(UINT32) * 8) {
++ dprintk("%s - ibuf too big (%d > %d)\n", __FUNCTION__,
++ bits, MAX_IOP_SIZE * sizeof(UINT32) * 8);
++ return -1;
++ }
++
++ len = (bits + 31) / 32; /* the number UINT32's needed */
++
++ dst = (unsigned char *) &buf[len];
++ dst--;
++
++ while (bits > 0) {
++ *dst-- = *src++;
++ bits -= 8;
++ }
++
++#if 0 /* no need to zero remaining bits as it is done during request alloc */
++ while (dst > (unsigned char *) buf)
++ *dst-- = '\0';
++#endif
++
++ op->pData = buf;
++ op->dataLen = len;
++ return 0;
++}
++
++/*
++ * copy out the result, be as forgiving as we can about small output buffers
++ */
++
++static int
++ixp_copy_obuf(struct crparam *p, IxCryptoAccPkeEauOpResult *op, UINT32 *buf)
++{
++ unsigned char *dst = (unsigned char *) p->crp_p;
++ unsigned char *src = (unsigned char *) buf;
++ int len, z, bits = p->crp_nbits;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ len = op->dataLen * sizeof(UINT32);
++
++ /* skip leading zeroes to be small buffer friendly */
++ z = 0;
++ while (z < len && src[z] == '\0')
++ z++;
++
++ src += len;
++ src--;
++ len -= z;
++
++ while (len > 0 && bits > 0) {
++ *dst++ = *src--;
++ len--;
++ bits -= 8;
++ }
++
++ while (bits > 0) {
++ *dst++ = '\0';
++ bits -= 8;
++ }
++
++ if (len > 0) {
++ dprintk("%s - obuf is %d (z=%d, ob=%d) bytes too small\n",
++ __FUNCTION__, len, z, p->crp_nbits / 8);
++ return -1;
++ }
++
++ return 0;
++}
++
++
++/*
++ * the parameter offsets for exp_mod
++ */
++
++#define IXP_PARAM_BASE 0
++#define IXP_PARAM_EXP 1
++#define IXP_PARAM_MOD 2
++#define IXP_PARAM_RES 3
++
++/*
++ * key processing complete callback, is also used to start processing
++ * by passing a NULL for pResult
++ */
++
++static void
++ixp_kperform_cb(
++ IxCryptoAccPkeEauOperation operation,
++ IxCryptoAccPkeEauOpResult *pResult,
++ BOOL carryOrBorrow,
++ IxCryptoAccStatus status)
++{
++ struct ixp_pkq *q, *tmp;
++ unsigned long flags;
++
++ dprintk("%s(0x%x, %p, %d, 0x%x)\n", __FUNCTION__, operation, pResult,
++ carryOrBorrow, status);
++
++ /* handle a completed request */
++ if (pResult) {
++ if (ixp_pk_cur && &ixp_pk_cur->pkq_result == pResult) {
++ q = ixp_pk_cur;
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("%s() - op failed 0x%x\n", __FUNCTION__, status);
++ q->pkq_krp->krp_status = ERANGE; /* could do better */
++ } else {
++ /* copy out the result */
++ if (ixp_copy_obuf(&q->pkq_krp->krp_param[IXP_PARAM_RES],
++ &q->pkq_result, q->pkq_obuf))
++ q->pkq_krp->krp_status = ERANGE;
++ }
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ ixp_pk_cur = NULL;
++ } else
++ printk("%s - callback with invalid result pointer\n", __FUNCTION__);
++ }
++
++ spin_lock_irqsave(&ixp_pkq_lock, flags);
++ if (ixp_pk_cur || list_empty(&ixp_pkq)) {
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++ return;
++ }
++
++ list_for_each_entry_safe(q, tmp, &ixp_pkq, pkq_list) {
++
++ list_del(&q->pkq_list);
++ ixp_pk_cur = q;
++
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++
++ status = ixCryptoAccPkeEauPerform(
++ IX_CRYPTO_ACC_OP_EAU_MOD_EXP,
++ &q->pkq_op,
++ ixp_kperform_cb,
++ &q->pkq_result);
++
++ if (status == IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("%s() - ixCryptoAccPkeEauPerform SUCCESS\n", __FUNCTION__);
++ return; /* callback will return here for callback */
++ } else if (status == IX_CRYPTO_ACC_STATUS_RETRY) {
++ printk("%s() - ixCryptoAccPkeEauPerform RETRY\n", __FUNCTION__);
++ } else {
++ printk("%s() - ixCryptoAccPkeEauPerform failed %d\n",
++ __FUNCTION__, status);
++ }
++ q->pkq_krp->krp_status = ERANGE; /* could do better */
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ spin_lock_irqsave(&ixp_pkq_lock, flags);
++ }
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++}
++
++
++static int
++ixp_kprocess(device_t dev, struct cryptkop *krp, int hint)
++{
++ struct ixp_pkq *q;
++ int rc = 0;
++ unsigned long flags;
++
++ dprintk("%s l1=%d l2=%d l3=%d l4=%d\n", __FUNCTION__,
++ krp->krp_param[IXP_PARAM_BASE].crp_nbits,
++ krp->krp_param[IXP_PARAM_EXP].crp_nbits,
++ krp->krp_param[IXP_PARAM_MOD].crp_nbits,
++ krp->krp_param[IXP_PARAM_RES].crp_nbits);
++
++
++ if (krp->krp_op != CRK_MOD_EXP) {
++ krp->krp_status = EOPNOTSUPP;
++ goto err;
++ }
++
++ q = (struct ixp_pkq *) kmalloc(sizeof(*q), GFP_KERNEL);
++ if (q == NULL) {
++ krp->krp_status = ENOMEM;
++ goto err;
++ }
++
++ /*
++ * The PKE engine does not appear to zero the output buffer
++ * appropriately, so we need to do it all here.
++ */
++ memset(q, 0, sizeof(*q));
++
++ q->pkq_krp = krp;
++ INIT_LIST_HEAD(&q->pkq_list);
++
++ if (ixp_copy_ibuf(&krp->krp_param[IXP_PARAM_BASE], &q->pkq_op.modExpOpr.M,
++ q->pkq_ibuf0))
++ rc = 1;
++ if (!rc && ixp_copy_ibuf(&krp->krp_param[IXP_PARAM_EXP],
++ &q->pkq_op.modExpOpr.e, q->pkq_ibuf1))
++ rc = 2;
++ if (!rc && ixp_copy_ibuf(&krp->krp_param[IXP_PARAM_MOD],
++ &q->pkq_op.modExpOpr.N, q->pkq_ibuf2))
++ rc = 3;
++
++ if (rc) {
++ kfree(q);
++ krp->krp_status = ERANGE;
++ goto err;
++ }
++
++ q->pkq_result.pData = q->pkq_obuf;
++ q->pkq_result.dataLen =
++ (krp->krp_param[IXP_PARAM_RES].crp_nbits + 31) / 32;
++
++ spin_lock_irqsave(&ixp_pkq_lock, flags);
++ list_add_tail(&q->pkq_list, &ixp_pkq);
++ spin_unlock_irqrestore(&ixp_pkq_lock, flags);
++
++ if (!ixp_pk_cur)
++ ixp_kperform_cb(0, NULL, 0, 0);
++ return (0);
++
++err:
++ crypto_kdone(krp);
++ return (0);
++}
++
++
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++/*
++ * We run the random number generator output through SHA so that it
++ * is FIPS compliant.
++ */
++
++static volatile int sha_done = 0;
++static unsigned char sha_digest[20];
++
++static void
++ixp_hash_cb(UINT8 *digest, IxCryptoAccStatus status)
++{
++ dprintk("%s(%p, %d)\n", __FUNCTION__, digest, status);
++ if (sha_digest != digest)
++ printk("digest error\n");
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ sha_done = 1;
++ else
++ sha_done = -status;
++}
++
++static int
++ixp_read_random(void *arg, u_int32_t *buf, int maxwords)
++{
++ IxCryptoAccStatus status;
++ int i, n, rc;
++
++ dprintk("%s(%p, %d)\n", __FUNCTION__, buf, maxwords);
++ memset(buf, 0, maxwords * sizeof(*buf));
++ status = ixCryptoAccPkePseudoRandomNumberGet(maxwords, buf);
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("%s: ixCryptoAccPkePseudoRandomNumberGet failed %d\n",
++ __FUNCTION__, status);
++ return 0;
++ }
++
++ /*
++ * run the random data through SHA to make it look more random
++ */
++
++ n = sizeof(sha_digest); /* process digest bytes at a time */
++
++ rc = 0;
++ for (i = 0; i < maxwords; i += n / sizeof(*buf)) {
++ if ((maxwords - i) * sizeof(*buf) < n)
++ n = (maxwords - i) * sizeof(*buf);
++ sha_done = 0;
++ status = ixCryptoAccPkeHashPerform(IX_CRYPTO_ACC_AUTH_SHA1,
++ (UINT8 *) &buf[i], n, ixp_hash_cb, sha_digest);
++ if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
++ dprintk("ixCryptoAccPkeHashPerform failed %d\n", status);
++ return -EIO;
++ }
++ while (!sha_done)
++ schedule();
++ if (sha_done < 0) {
++ dprintk("ixCryptoAccPkeHashPerform failed CB %d\n", -sha_done);
++ return 0;
++ }
++ memcpy(&buf[i], sha_digest, n);
++ rc += n / sizeof(*buf);;
++ }
++
++ return rc;
++}
++#endif /* CONFIG_OCF_RANDOMHARVEST */
++
++#endif /* __ixp46X */
++
++
++
++/*
++ * our driver startup and shutdown routines
++ */
++
++static int
++ixp_init(void)
++{
++ dprintk("%s(%p)\n", __FUNCTION__, ixp_init);
++
++ if (ixp_init_crypto && ixCryptoAccInit() != IX_CRYPTO_ACC_STATUS_SUCCESS)
++ printk("ixCryptoAccInit failed, assuming already initialised!\n");
++
++ qcache = kmem_cache_create("ixp4xx_q", sizeof(struct ixp_q), 0,
++ SLAB_HWCACHE_ALIGN, NULL
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
++ , NULL
++#endif
++ );
++ if (!qcache) {
++ printk("failed to create Qcache\n");
++ return -ENOENT;
++ }
++
++ memset(&ixpdev, 0, sizeof(ixpdev));
++ softc_device_init(&ixpdev, "ixp4xx", 0, ixp_methods);
++
++ ixp_id = crypto_get_driverid(softc_get_device(&ixpdev),
++ CRYPTOCAP_F_HARDWARE);
++ if (ixp_id < 0)
++ panic("IXP/OCF crypto device cannot initialize!");
++
++#define REGISTER(alg) \
++ crypto_register(ixp_id,alg,0,0)
++
++ REGISTER(CRYPTO_DES_CBC);
++ REGISTER(CRYPTO_3DES_CBC);
++ REGISTER(CRYPTO_RIJNDAEL128_CBC);
++#ifdef CONFIG_OCF_IXP4XX_SHA1_MD5
++ REGISTER(CRYPTO_MD5);
++ REGISTER(CRYPTO_SHA1);
++#endif
++ REGISTER(CRYPTO_MD5_HMAC);
++ REGISTER(CRYPTO_SHA1_HMAC);
++#undef REGISTER
++
++#ifdef __ixp46X
++ spin_lock_init(&ixp_pkq_lock);
++ /*
++ * we do not enable the go fast options here as they can potentially
++ * allow timing based attacks
++ *
++ * http://www.openssl.org/news/secadv_20030219.txt
++ */
++ ixCryptoAccPkeEauExpConfig(0, 0);
++ crypto_kregister(ixp_id, CRK_MOD_EXP, 0);
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ crypto_rregister(ixp_id, ixp_read_random, NULL);
++#endif
++#endif
++
++ return 0;
++}
++
++static void
++ixp_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ crypto_unregister_all(ixp_id);
++ ixp_id = -1;
++ kmem_cache_destroy(qcache);
++ qcache = NULL;
++}
++
++module_init(ixp_init);
++module_exit(ixp_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("David McCullough <dmccullough@cyberguard.com>");
++MODULE_DESCRIPTION("ixp (OCF module for IXP4xx crypto)");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ocf-bench.c linux-2.6.29.1/crypto/ocf/ocf-bench.c
+--- linux-2.6.29.1.orig/crypto/ocf/ocf-bench.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ocf-bench.c 2009-04-20 20:01:21.548558198 +0200
+@@ -0,0 +1,436 @@
++/*
++ * A loadable module that benchmarks the OCF crypto speed from kernel space.
++ *
++ * Copyright (C) 2004-2007 David McCullough <david_mccullough@securecomputing.com>
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/spinlock.h>
++#include <linux/version.h>
++#include <linux/interrupt.h>
++#include <cryptodev.h>
++
++#ifdef I_HAVE_AN_XSCALE_WITH_INTEL_SDK
++#define BENCH_IXP_ACCESS_LIB 1
++#endif
++#ifdef BENCH_IXP_ACCESS_LIB
++#include <IxTypes.h>
++#include <IxOsBuffMgt.h>
++#include <IxNpeDl.h>
++#include <IxCryptoAcc.h>
++#include <IxQMgr.h>
++#include <IxOsServices.h>
++#include <IxOsCacheMMU.h>
++#endif
++
++/*
++ * support for access lib version 1.4
++ */
++#ifndef IX_MBUF_PRIV
++#define IX_MBUF_PRIV(x) ((x)->priv)
++#endif
++
++/*
++ * the number of simultaneously active requests
++ */
++static int request_q_len = 20;
++module_param(request_q_len, int, 0);
++MODULE_PARM_DESC(request_q_len, "Number of outstanding requests");
++/*
++ * how many requests we want to have processed
++ */
++static int request_num = 1024;
++module_param(request_num, int, 0);
++MODULE_PARM_DESC(request_num, "run for at least this many requests");
++/*
++ * the size of each request
++ */
++static int request_size = 1500;
++module_param(request_size, int, 0);
++MODULE_PARM_DESC(request_size, "size of each request");
++
++/*
++ * a structure for each request
++ */
++typedef struct {
++ struct work_struct work;
++#ifdef BENCH_IXP_ACCESS_LIB
++ IX_MBUF mbuf;
++#endif
++ unsigned char *buffer;
++} request_t;
++
++static request_t *requests;
++
++static int outstanding;
++static int total;
++
++/*************************************************************************/
++/*
++ * OCF benchmark routines
++ */
++
++static uint64_t ocf_cryptoid;
++static int ocf_init(void);
++static int ocf_cb(struct cryptop *crp);
++static void ocf_request(void *arg);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void ocf_request_wq(struct work_struct *work);
++#endif
++
++static int
++ocf_init(void)
++{
++ int error;
++ struct cryptoini crie, cria;
++ struct cryptodesc crda, crde;
++
++ memset(&crie, 0, sizeof(crie));
++ memset(&cria, 0, sizeof(cria));
++ memset(&crde, 0, sizeof(crde));
++ memset(&crda, 0, sizeof(crda));
++
++ cria.cri_alg = CRYPTO_SHA1_HMAC;
++ cria.cri_klen = 20 * 8;
++ cria.cri_key = "0123456789abcdefghij";
++
++ crie.cri_alg = CRYPTO_3DES_CBC;
++ crie.cri_klen = 24 * 8;
++ crie.cri_key = "0123456789abcdefghijklmn";
++
++ crie.cri_next = &cria;
++
++ error = crypto_newsession(&ocf_cryptoid, &crie, 0);
++ if (error) {
++ printk("crypto_newsession failed %d\n", error);
++ return -1;
++ }
++ return 0;
++}
++
++static int
++ocf_cb(struct cryptop *crp)
++{
++ request_t *r = (request_t *) crp->crp_opaque;
++
++ if (crp->crp_etype)
++ printk("Error in OCF processing: %d\n", crp->crp_etype);
++ total++;
++ crypto_freereq(crp);
++ crp = NULL;
++
++ if (total > request_num) {
++ outstanding--;
++ return 0;
++ }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ INIT_WORK(&r->work, ocf_request_wq);
++#else
++ INIT_WORK(&r->work, ocf_request, r);
++#endif
++ schedule_work(&r->work);
++ return 0;
++}
++
++
++static void
++ocf_request(void *arg)
++{
++ request_t *r = arg;
++ struct cryptop *crp = crypto_getreq(2);
++ struct cryptodesc *crde, *crda;
++
++ if (!crp) {
++ outstanding--;
++ return;
++ }
++
++ crde = crp->crp_desc;
++ crda = crde->crd_next;
++
++ crda->crd_skip = 0;
++ crda->crd_flags = 0;
++ crda->crd_len = request_size;
++ crda->crd_inject = request_size;
++ crda->crd_alg = CRYPTO_SHA1_HMAC;
++ crda->crd_key = "0123456789abcdefghij";
++ crda->crd_klen = 20 * 8;
++
++ crde->crd_skip = 0;
++ crde->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_ENCRYPT;
++ crde->crd_len = request_size;
++ crde->crd_inject = request_size;
++ crde->crd_alg = CRYPTO_3DES_CBC;
++ crde->crd_key = "0123456789abcdefghijklmn";
++ crde->crd_klen = 24 * 8;
++
++ crp->crp_ilen = request_size + 64;
++ crp->crp_flags = CRYPTO_F_CBIMM;
++ crp->crp_buf = (caddr_t) r->buffer;
++ crp->crp_callback = ocf_cb;
++ crp->crp_sid = ocf_cryptoid;
++ crp->crp_opaque = (caddr_t) r;
++ crypto_dispatch(crp);
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ocf_request_wq(struct work_struct *work)
++{
++ request_t *r = container_of(work, request_t, work);
++ ocf_request(r);
++}
++#endif
++
++/*************************************************************************/
++#ifdef BENCH_IXP_ACCESS_LIB
++/*************************************************************************/
++/*
++ * CryptoAcc benchmark routines
++ */
++
++static IxCryptoAccCtx ixp_ctx;
++static UINT32 ixp_ctx_id;
++static IX_MBUF ixp_pri;
++static IX_MBUF ixp_sec;
++static int ixp_registered = 0;
++
++static void ixp_register_cb(UINT32 ctx_id, IX_MBUF *bufp,
++ IxCryptoAccStatus status);
++static void ixp_perform_cb(UINT32 ctx_id, IX_MBUF *sbufp, IX_MBUF *dbufp,
++ IxCryptoAccStatus status);
++static void ixp_request(void *arg);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void ixp_request_wq(struct work_struct *work);
++#endif
++
++static int
++ixp_init(void)
++{
++ IxCryptoAccStatus status;
++
++ ixp_ctx.cipherCtx.cipherAlgo = IX_CRYPTO_ACC_CIPHER_3DES;
++ ixp_ctx.cipherCtx.cipherMode = IX_CRYPTO_ACC_MODE_CBC;
++ ixp_ctx.cipherCtx.cipherKeyLen = 24;
++ ixp_ctx.cipherCtx.cipherBlockLen = IX_CRYPTO_ACC_DES_BLOCK_64;
++ ixp_ctx.cipherCtx.cipherInitialVectorLen = IX_CRYPTO_ACC_DES_IV_64;
++ memcpy(ixp_ctx.cipherCtx.key.cipherKey, "0123456789abcdefghijklmn", 24);
++
++ ixp_ctx.authCtx.authAlgo = IX_CRYPTO_ACC_AUTH_SHA1;
++ ixp_ctx.authCtx.authDigestLen = 12;
++ ixp_ctx.authCtx.aadLen = 0;
++ ixp_ctx.authCtx.authKeyLen = 20;
++ memcpy(ixp_ctx.authCtx.key.authKey, "0123456789abcdefghij", 20);
++
++ ixp_ctx.useDifferentSrcAndDestMbufs = 0;
++ ixp_ctx.operation = IX_CRYPTO_ACC_OP_ENCRYPT_AUTH ;
++
++ IX_MBUF_MLEN(&ixp_pri) = IX_MBUF_PKT_LEN(&ixp_pri) = 128;
++ IX_MBUF_MDATA(&ixp_pri) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++ IX_MBUF_MLEN(&ixp_sec) = IX_MBUF_PKT_LEN(&ixp_sec) = 128;
++ IX_MBUF_MDATA(&ixp_sec) = (unsigned char *) kmalloc(128, SLAB_ATOMIC);
++
++ status = ixCryptoAccCtxRegister(&ixp_ctx, &ixp_pri, &ixp_sec,
++ ixp_register_cb, ixp_perform_cb, &ixp_ctx_id);
++
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status) {
++ while (!ixp_registered)
++ schedule();
++ return ixp_registered < 0 ? -1 : 0;
++ }
++
++ printk("ixp: ixCryptoAccCtxRegister failed %d\n", status);
++ return -1;
++}
++
++static void
++ixp_register_cb(UINT32 ctx_id, IX_MBUF *bufp, IxCryptoAccStatus status)
++{
++ if (bufp) {
++ IX_MBUF_MLEN(bufp) = IX_MBUF_PKT_LEN(bufp) = 0;
++ kfree(IX_MBUF_MDATA(bufp));
++ IX_MBUF_MDATA(bufp) = NULL;
++ }
++
++ if (IX_CRYPTO_ACC_STATUS_WAIT == status)
++ return;
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
++ ixp_registered = 1;
++ else
++ ixp_registered = -1;
++}
++
++static void
++ixp_perform_cb(
++ UINT32 ctx_id,
++ IX_MBUF *sbufp,
++ IX_MBUF *dbufp,
++ IxCryptoAccStatus status)
++{
++ request_t *r = NULL;
++
++ total++;
++ if (total > request_num) {
++ outstanding--;
++ return;
++ }
++
++ if (!sbufp || !(r = IX_MBUF_PRIV(sbufp))) {
++ printk("crappo %p %p\n", sbufp, r);
++ outstanding--;
++ return;
++ }
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ INIT_WORK(&r->work, ixp_request_wq);
++#else
++ INIT_WORK(&r->work, ixp_request, r);
++#endif
++ schedule_work(&r->work);
++}
++
++static void
++ixp_request(void *arg)
++{
++ request_t *r = arg;
++ IxCryptoAccStatus status;
++
++ memset(&r->mbuf, 0, sizeof(r->mbuf));
++ IX_MBUF_MLEN(&r->mbuf) = IX_MBUF_PKT_LEN(&r->mbuf) = request_size + 64;
++ IX_MBUF_MDATA(&r->mbuf) = r->buffer;
++ IX_MBUF_PRIV(&r->mbuf) = r;
++ status = ixCryptoAccAuthCryptPerform(ixp_ctx_id, &r->mbuf, NULL,
++ 0, request_size, 0, request_size, request_size, r->buffer);
++ if (IX_CRYPTO_ACC_STATUS_SUCCESS != status) {
++ printk("status1 = %d\n", status);
++ outstanding--;
++ return;
++ }
++ return;
++}
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++static void
++ixp_request_wq(struct work_struct *work)
++{
++ request_t *r = container_of(work, request_t, work);
++ ixp_request(r);
++}
++#endif
++
++/*************************************************************************/
++#endif /* BENCH_IXP_ACCESS_LIB */
++/*************************************************************************/
++
++int
++ocfbench_init(void)
++{
++ int i, jstart, jstop;
++
++ printk("Crypto Speed tests\n");
++
++ requests = kmalloc(sizeof(request_t) * request_q_len, GFP_KERNEL);
++ if (!requests) {
++ printk("malloc failed\n");
++ return -EINVAL;
++ }
++
++ for (i = 0; i < request_q_len; i++) {
++ /* +64 for return data */
++ requests[i].buffer = kmalloc(request_size + 128, GFP_DMA);
++ if (!requests[i].buffer) {
++ printk("malloc failed\n");
++ return -EINVAL;
++ }
++ memset(requests[i].buffer, '0' + i, request_size + 128);
++ }
++
++ /*
++ * OCF benchmark
++ */
++ printk("OCF: testing ...\n");
++ ocf_init();
++ total = outstanding = 0;
++ jstart = jiffies;
++ for (i = 0; i < request_q_len; i++) {
++ outstanding++;
++ ocf_request(&requests[i]);
++ }
++ while (outstanding > 0)
++ schedule();
++ jstop = jiffies;
++
++ printk("OCF: %d requests of %d bytes in %d jiffies\n", total, request_size,
++ jstop - jstart);
++
++#ifdef BENCH_IXP_ACCESS_LIB
++ /*
++ * IXP benchmark
++ */
++ printk("IXP: testing ...\n");
++ ixp_init();
++ total = outstanding = 0;
++ jstart = jiffies;
++ for (i = 0; i < request_q_len; i++) {
++ outstanding++;
++ ixp_request(&requests[i]);
++ }
++ while (outstanding > 0)
++ schedule();
++ jstop = jiffies;
++
++ printk("IXP: %d requests of %d bytes in %d jiffies\n", total, request_size,
++ jstop - jstart);
++#endif /* BENCH_IXP_ACCESS_LIB */
++
++ for (i = 0; i < request_q_len; i++)
++ kfree(requests[i].buffer);
++ kfree(requests);
++ return -EINVAL; /* always fail to load so it can be re-run quickly ;-) */
++}
++
++static void __exit ocfbench_exit(void)
++{
++}
++
++module_init(ocfbench_init);
++module_exit(ocfbench_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("Benchmark various in-kernel crypto speeds");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ocf-compat.h linux-2.6.29.1/crypto/ocf/ocf-compat.h
+--- linux-2.6.29.1.orig/crypto/ocf/ocf-compat.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ocf-compat.h 2009-04-20 20:01:21.552559545 +0200
+@@ -0,0 +1,270 @@
++#ifndef _BSD_COMPAT_H_
++#define _BSD_COMPAT_H_ 1
++/****************************************************************************/
++/*
++ * Provide compat routines for older linux kernels and BSD kernels
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2007 David McCullough <david_mccullough@securecomputing.com>
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this file
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++/****************************************************************************/
++#ifdef __KERNEL__
++/*
++ * fake some BSD driver interface stuff specifically for OCF use
++ */
++
++typedef struct ocf_device *device_t;
++
++typedef struct {
++ int (*cryptodev_newsession)(device_t dev, u_int32_t *sidp, struct cryptoini *cri);
++ int (*cryptodev_freesession)(device_t dev, u_int64_t tid);
++ int (*cryptodev_process)(device_t dev, struct cryptop *crp, int hint);
++ int (*cryptodev_kprocess)(device_t dev, struct cryptkop *krp, int hint);
++} device_method_t;
++#define DEVMETHOD(id, func) id: func
++
++struct ocf_device {
++ char name[32]; /* the driver name */
++ char nameunit[32]; /* the driver name + HW instance */
++ int unit;
++ device_method_t methods;
++ void *softc;
++};
++
++#define CRYPTODEV_NEWSESSION(dev, sid, cri) \
++ ((*(dev)->methods.cryptodev_newsession)(dev,sid,cri))
++#define CRYPTODEV_FREESESSION(dev, sid) \
++ ((*(dev)->methods.cryptodev_freesession)(dev, sid))
++#define CRYPTODEV_PROCESS(dev, crp, hint) \
++ ((*(dev)->methods.cryptodev_process)(dev, crp, hint))
++#define CRYPTODEV_KPROCESS(dev, krp, hint) \
++ ((*(dev)->methods.cryptodev_kprocess)(dev, krp, hint))
++
++#define device_get_name(dev) ((dev)->name)
++#define device_get_nameunit(dev) ((dev)->nameunit)
++#define device_get_unit(dev) ((dev)->unit)
++#define device_get_softc(dev) ((dev)->softc)
++
++#define softc_device_decl \
++ struct ocf_device _device; \
++ device_t
++
++#define softc_device_init(_sc, _name, _unit, _methods) \
++ if (1) {\
++ strncpy((_sc)->_device.name, _name, sizeof((_sc)->_device.name) - 1); \
++ snprintf((_sc)->_device.nameunit, sizeof((_sc)->_device.name), "%s%d", _name, _unit); \
++ (_sc)->_device.unit = _unit; \
++ (_sc)->_device.methods = _methods; \
++ (_sc)->_device.softc = (void *) _sc; \
++ *(device_t *)((softc_get_device(_sc))+1) = &(_sc)->_device; \
++ } else
++
++#define softc_get_device(_sc) (&(_sc)->_device)
++
++/*
++ * iomem support for 2.4 and 2.6 kernels
++ */
++#include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++#define ocf_iomem_t unsigned long
++
++/*
++ * implement simple workqueue like support for older kernels
++ */
++
++#include <linux/tqueue.h>
++
++#define work_struct tq_struct
++
++#define INIT_WORK(wp, fp, ap) \
++ do { \
++ (wp)->sync = 0; \
++ (wp)->routine = (fp); \
++ (wp)->data = (ap); \
++ } while (0)
++
++#define schedule_work(wp) \
++ do { \
++ queue_task((wp), &tq_immediate); \
++ mark_bh(IMMEDIATE_BH); \
++ } while (0)
++
++#define flush_scheduled_work() run_task_queue(&tq_immediate)
++
++#else
++#define ocf_iomem_t void __iomem *
++
++#include <linux/workqueue.h>
++
++#endif
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/fdtable.h>
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
++#define files_fdtable(files) (files)
++#endif
++
++#ifdef MODULE_PARM
++#undef module_param /* just in case */
++#define module_param(a,b,c) MODULE_PARM(a,"i")
++#endif
++
++#define bzero(s,l) memset(s,0,l)
++#define bcopy(s,d,l) memcpy(d,s,l)
++#define bcmp(x, y, l) memcmp(x,y,l)
++
++#define MIN(x,y) ((x) < (y) ? (x) : (y))
++
++#define device_printf(dev, a...) ({ \
++ printk("%s: ", device_get_nameunit(dev)); printk(a); \
++ })
++
++#undef printf
++#define printf(fmt...) printk(fmt)
++
++#define KASSERT(c,p) if (!(c)) { printk p ; } else
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++#define ocf_daemonize(str) \
++ daemonize(); \
++ spin_lock_irq(&current->sigmask_lock); \
++ sigemptyset(&current->blocked); \
++ recalc_sigpending(current); \
++ spin_unlock_irq(&current->sigmask_lock); \
++ sprintf(current->comm, str);
++#else
++#define ocf_daemonize(str) daemonize(str);
++#endif
++
++#define TAILQ_INSERT_TAIL(q,d,m) list_add_tail(&(d)->m, (q))
++#define TAILQ_EMPTY(q) list_empty(q)
++#define TAILQ_FOREACH(v, q, m) list_for_each_entry(v, q, m)
++
++#define read_random(p,l) get_random_bytes(p,l)
++
++#define DELAY(x) ((x) > 2000 ? mdelay((x)/1000) : udelay(x))
++#define strtoul simple_strtoul
++
++#define pci_get_vendor(dev) ((dev)->vendor)
++#define pci_get_device(dev) ((dev)->device)
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++#define pci_set_consistent_dma_mask(dev, mask) (0)
++#endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
++#define pci_dma_sync_single_for_cpu pci_dma_sync_single
++#endif
++
++#ifndef DMA_32BIT_MASK
++#define DMA_32BIT_MASK 0x00000000ffffffffULL
++#endif
++
++#define htole32(x) cpu_to_le32(x)
++#define htobe32(x) cpu_to_be32(x)
++#define htole16(x) cpu_to_le16(x)
++#define htobe16(x) cpu_to_be16(x)
++
++/* older kernels don't have these */
++
++#ifndef IRQ_NONE
++#define IRQ_NONE
++#define IRQ_HANDLED
++#define irqreturn_t void
++#endif
++#ifndef IRQF_SHARED
++#define IRQF_SHARED SA_SHIRQ
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
++# define strlcpy(dest,src,len) \
++ ({strncpy(dest,src,(len)-1); ((char *)dest)[(len)-1] = '\0'; })
++#endif
++
++#ifndef MAX_ERRNO
++#define MAX_ERRNO 4095
++#endif
++#ifndef IS_ERR_VALUE
++#define IS_ERR_VALUE(x) ((unsigned long)(x) >= (unsigned long)-MAX_ERRNO)
++#endif
++
++/*
++ * common debug for all
++ */
++#if 1
++#define dprintk(a...) do { if (debug) printk(a); } while(0)
++#else
++#define dprintk(a...)
++#endif
++
++#ifndef SLAB_ATOMIC
++/* Changed in 2.6.20, must use GFP_ATOMIC now */
++#define SLAB_ATOMIC GFP_ATOMIC
++#endif
++
++/*
++ * need some additional support for older kernels */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,2)
++#define pci_register_driver_compat(driver, rc) \
++ do { \
++ if ((rc) > 0) { \
++ (rc) = 0; \
++ } else if (rc == 0) { \
++ (rc) = -ENODEV; \
++ } else { \
++ pci_unregister_driver(driver); \
++ } \
++ } while (0)
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
++#define pci_register_driver_compat(driver,rc) ((rc) = (rc) < 0 ? (rc) : 0)
++#else
++#define pci_register_driver_compat(driver,rc)
++#endif
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
++
++#include <asm/scatterlist.h>
++
++static inline void sg_set_page(struct scatterlist *sg, struct page *page,
++ unsigned int len, unsigned int offset)
++{
++ sg->page = page;
++ sg->offset = offset;
++ sg->length = len;
++}
++
++static inline void *sg_virt(struct scatterlist *sg)
++{
++ return page_address(sg->page) + sg->offset;
++}
++
++#endif
++
++#endif /* __KERNEL__ */
++
++/****************************************************************************/
++#endif /* _BSD_COMPAT_H_ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ocfnull/Makefile linux-2.6.29.1/crypto/ocf/ocfnull/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/ocfnull/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ocfnull/Makefile 2009-04-20 20:01:21.552559545 +0200
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_OCFNULL) += ocfnull.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/..
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/ocfnull/ocfnull.c linux-2.6.29.1/crypto/ocf/ocfnull/ocfnull.c
+--- linux-2.6.29.1.orig/crypto/ocf/ocfnull/ocfnull.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/ocfnull/ocfnull.c 2009-04-20 20:01:21.552559545 +0200
+@@ -0,0 +1,203 @@
++/*
++ * An OCF module for determining the cost of crypto versus the cost of
++ * IPSec processing outside of OCF. This modules gives us the effect of
++ * zero cost encryption, of course you will need to run it at both ends
++ * since it does no crypto at all.
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/sched.h>
++#include <linux/wait.h>
++#include <linux/crypto.h>
++#include <linux/interrupt.h>
++
++#include <cryptodev.h>
++#include <uio.h>
++
++static int32_t null_id = -1;
++static u_int32_t null_sesnum = 0;
++
++static int null_process(device_t, struct cryptop *, int);
++static int null_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int null_freesession(device_t, u_int64_t);
++
++#define debug ocfnull_debug
++int ocfnull_debug = 0;
++module_param(ocfnull_debug, int, 0644);
++MODULE_PARM_DESC(ocfnull_debug, "Enable debug");
++
++/*
++ * dummy device structure
++ */
++
++static struct {
++ softc_device_decl sc_dev;
++} nulldev;
++
++static device_method_t null_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, null_newsession),
++ DEVMETHOD(cryptodev_freesession,null_freesession),
++ DEVMETHOD(cryptodev_process, null_process),
++};
++
++/*
++ * Generate a new software session.
++ */
++static int
++null_newsession(device_t arg, u_int32_t *sid, struct cryptoini *cri)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid == NULL || cri == NULL) {
++ dprintk("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ if (null_sesnum == 0)
++ null_sesnum++;
++ *sid = null_sesnum++;
++ return 0;
++}
++
++
++/*
++ * Free a session.
++ */
++static int
++null_freesession(device_t arg, u_int64_t tid)
++{
++ u_int32_t sid = CRYPTO_SESID2LID(tid);
++
++ dprintk("%s()\n", __FUNCTION__);
++ if (sid > null_sesnum) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ /* Silently accept and return */
++ if (sid == 0)
++ return 0;
++ return 0;
++}
++
++
++/*
++ * Process a request.
++ */
++static int
++null_process(device_t arg, struct cryptop *crp, int hint)
++{
++ unsigned int lid;
++
++ dprintk("%s()\n", __FUNCTION__);
++
++ /* Sanity check */
++ if (crp == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++
++ crp->crp_etype = 0;
++
++ if (crp->crp_desc == NULL || crp->crp_buf == NULL) {
++ dprintk("%s,%d: EINVAL\n", __FILE__, __LINE__);
++ crp->crp_etype = EINVAL;
++ goto done;
++ }
++
++ /*
++ * find the session we are using
++ */
++
++ lid = crp->crp_sid & 0xffffffff;
++ if (lid >= null_sesnum || lid == 0) {
++ crp->crp_etype = ENOENT;
++ dprintk("%s,%d: ENOENT\n", __FILE__, __LINE__);
++ goto done;
++ }
++
++done:
++ crypto_done(crp);
++ return 0;
++}
++
++
++/*
++ * our driver startup and shutdown routines
++ */
++
++static int
++null_init(void)
++{
++ dprintk("%s(%p)\n", __FUNCTION__, null_init);
++
++ memset(&nulldev, 0, sizeof(nulldev));
++ softc_device_init(&nulldev, "ocfnull", 0, null_methods);
++
++ null_id = crypto_get_driverid(softc_get_device(&nulldev),
++ CRYPTOCAP_F_HARDWARE);
++ if (null_id < 0)
++ panic("ocfnull: crypto device cannot initialize!");
++
++#define REGISTER(alg) \
++ crypto_register(null_id,alg,0,0)
++ REGISTER(CRYPTO_DES_CBC);
++ REGISTER(CRYPTO_3DES_CBC);
++ REGISTER(CRYPTO_RIJNDAEL128_CBC);
++ REGISTER(CRYPTO_MD5);
++ REGISTER(CRYPTO_SHA1);
++ REGISTER(CRYPTO_MD5_HMAC);
++ REGISTER(CRYPTO_SHA1_HMAC);
++#undef REGISTER
++
++ return 0;
++}
++
++static void
++null_exit(void)
++{
++ dprintk("%s()\n", __FUNCTION__);
++ crypto_unregister_all(null_id);
++ null_id = -1;
++}
++
++module_init(null_init);
++module_exit(null_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("ocfnull - claims a lot but does nothing");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/pasemi/Makefile linux-2.6.29.1/crypto/ocf/pasemi/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/pasemi/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/pasemi/Makefile 2009-04-20 20:01:21.556559496 +0200
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_PASEMI) += pasemi.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/pasemi/pasemi.c linux-2.6.29.1/crypto/ocf/pasemi/pasemi.c
+--- linux-2.6.29.1.orig/crypto/ocf/pasemi/pasemi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/pasemi/pasemi.c 2009-04-20 20:01:21.556559496 +0200
+@@ -0,0 +1,1009 @@
++/*
++ * Copyright (C) 2007 PA Semi, Inc
++ *
++ * Driver for the PA Semi PWRficient DMA Crypto Engine
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/timer.h>
++#include <linux/random.h>
++#include <linux/skbuff.h>
++#include <asm/scatterlist.h>
++#include <linux/moduleparam.h>
++#include <linux/pci.h>
++#include <cryptodev.h>
++#include <uio.h>
++#include "pasemi_fnu.h"
++
++#define DRV_NAME "pasemi"
++
++#define TIMER_INTERVAL 1000
++
++static void __devexit pasemi_dma_remove(struct pci_dev *pdev);
++static struct pasdma_status volatile * dma_status;
++
++static int debug;
++module_param(debug, int, 0644);
++MODULE_PARM_DESC(debug, "Enable debug");
++
++static void pasemi_desc_start(struct pasemi_desc *desc, u64 hdr)
++{
++ desc->postop = 0;
++ desc->quad[0] = hdr;
++ desc->quad_cnt = 1;
++ desc->size = 1;
++}
++
++static void pasemi_desc_build(struct pasemi_desc *desc, u64 val)
++{
++ desc->quad[desc->quad_cnt++] = val;
++ desc->size = (desc->quad_cnt + 1) / 2;
++}
++
++static void pasemi_desc_hdr(struct pasemi_desc *desc, u64 hdr)
++{
++ desc->quad[0] |= hdr;
++}
++
++static int pasemi_desc_size(struct pasemi_desc *desc)
++{
++ return desc->size;
++}
++
++static void pasemi_ring_add_desc(
++ struct pasemi_fnu_txring *ring,
++ struct pasemi_desc *desc,
++ struct cryptop *crp) {
++ int i;
++ int ring_index = 2 * (ring->next_to_fill & (TX_RING_SIZE-1));
++
++ TX_DESC_INFO(ring, ring->next_to_fill).desc_size = desc->size;
++ TX_DESC_INFO(ring, ring->next_to_fill).desc_postop = desc->postop;
++ TX_DESC_INFO(ring, ring->next_to_fill).cf_crp = crp;
++
++ for (i = 0; i < desc->quad_cnt; i += 2) {
++ ring_index = 2 * (ring->next_to_fill & (TX_RING_SIZE-1));
++ ring->desc[ring_index] = desc->quad[i];
++ ring->desc[ring_index + 1] = desc->quad[i + 1];
++ ring->next_to_fill++;
++ }
++
++ if (desc->quad_cnt & 1)
++ ring->desc[ring_index + 1] = 0;
++}
++
++static void pasemi_ring_incr(struct pasemi_softc *sc, int chan_index, int incr)
++{
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_INCR(sc->base_chan + chan_index),
++ incr);
++}
++
++/*
++ * Generate a new software session.
++ */
++static int
++pasemi_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct cryptoini *c, *encini = NULL, *macini = NULL;
++ struct pasemi_softc *sc = device_get_softc(dev);
++ struct pasemi_session *ses = NULL, **sespp;
++ int sesn, blksz = 0;
++ u64 ccmd = 0;
++ unsigned long flags;
++ struct pasemi_desc init_desc;
++ struct pasemi_fnu_txring *txring;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ if (sidp == NULL || cri == NULL || sc == NULL) {
++ DPRINTF("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return -EINVAL;
++ }
++ for (c = cri; c != NULL; c = c->cri_next) {
++ if (ALG_IS_SIG(c->cri_alg)) {
++ if (macini)
++ return -EINVAL;
++ macini = c;
++ } else if (ALG_IS_CIPHER(c->cri_alg)) {
++ if (encini)
++ return -EINVAL;
++ encini = c;
++ } else {
++ DPRINTF("UNKNOWN c->cri_alg %d\n", c->cri_alg);
++ return -EINVAL;
++ }
++ }
++ if (encini == NULL && macini == NULL)
++ return -EINVAL;
++ if (encini) {
++ /* validate key length */
++ switch (encini->cri_alg) {
++ case CRYPTO_DES_CBC:
++ if (encini->cri_klen != 64)
++ return -EINVAL;
++ ccmd = DMA_CALGO_DES;
++ break;
++ case CRYPTO_3DES_CBC:
++ if (encini->cri_klen != 192)
++ return -EINVAL;
++ ccmd = DMA_CALGO_3DES;
++ break;
++ case CRYPTO_AES_CBC:
++ if (encini->cri_klen != 128 &&
++ encini->cri_klen != 192 &&
++ encini->cri_klen != 256)
++ return -EINVAL;
++ ccmd = DMA_CALGO_AES;
++ break;
++ case CRYPTO_ARC4:
++ if (encini->cri_klen != 128)
++ return -EINVAL;
++ ccmd = DMA_CALGO_ARC;
++ break;
++ default:
++ DPRINTF("UNKNOWN encini->cri_alg %d\n",
++ encini->cri_alg);
++ return -EINVAL;
++ }
++ }
++
++ if (macini) {
++ switch (macini->cri_alg) {
++ case CRYPTO_MD5:
++ case CRYPTO_MD5_HMAC:
++ blksz = 16;
++ break;
++ case CRYPTO_SHA1:
++ case CRYPTO_SHA1_HMAC:
++ blksz = 20;
++ break;
++ default:
++ DPRINTF("UNKNOWN macini->cri_alg %d\n",
++ macini->cri_alg);
++ return -EINVAL;
++ }
++ if (((macini->cri_klen + 7) / 8) > blksz) {
++ DPRINTF("key length %d bigger than blksize %d not supported\n",
++ ((macini->cri_klen + 7) / 8), blksz);
++ return -EINVAL;
++ }
++ }
++
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (sc->sc_sessions[sesn] == NULL) {
++ sc->sc_sessions[sesn] = (struct pasemi_session *)
++ kzalloc(sizeof(struct pasemi_session), GFP_ATOMIC);
++ ses = sc->sc_sessions[sesn];
++ break;
++ } else if (sc->sc_sessions[sesn]->used == 0) {
++ ses = sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ sespp = (struct pasemi_session **)
++ kzalloc(sc->sc_nsessions * 2 *
++ sizeof(struct pasemi_session *), GFP_ATOMIC);
++ if (sespp == NULL)
++ return -ENOMEM;
++ memcpy(sespp, sc->sc_sessions,
++ sc->sc_nsessions * sizeof(struct pasemi_session *));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = sespp;
++ sesn = sc->sc_nsessions;
++ ses = sc->sc_sessions[sesn] = (struct pasemi_session *)
++ kzalloc(sizeof(struct pasemi_session), GFP_ATOMIC);
++ if (ses == NULL)
++ return -ENOMEM;
++ sc->sc_nsessions *= 2;
++ }
++
++ ses->used = 1;
++
++ ses->dma_addr = pci_map_single(sc->dma_pdev, (void *) ses->civ,
++ sizeof(struct pasemi_session), DMA_TO_DEVICE);
++
++ /* enter the channel scheduler */
++ spin_lock_irqsave(&sc->sc_chnlock, flags);
++
++ /* ARC4 has to be processed by the even channel */
++ if (encini && (encini->cri_alg == CRYPTO_ARC4))
++ ses->chan = sc->sc_lastchn & ~1;
++ else
++ ses->chan = sc->sc_lastchn;
++ sc->sc_lastchn = (sc->sc_lastchn + 1) % sc->sc_num_channels;
++
++ spin_unlock_irqrestore(&sc->sc_chnlock, flags);
++
++ txring = &sc->tx[ses->chan];
++
++ if (encini) {
++ ses->ccmd = ccmd;
++
++ /* get an IV */
++ /* XXX may read fewer than requested */
++ get_random_bytes(ses->civ, sizeof(ses->civ));
++
++ ses->keysz = (encini->cri_klen - 63) / 64;
++ memcpy(ses->key, encini->cri_key, (ses->keysz + 1) * 8);
++
++ pasemi_desc_start(&init_desc,
++ XCT_CTRL_HDR(ses->chan, (encini && macini) ? 0x68 : 0x40, DMA_FN_CIV0));
++ pasemi_desc_build(&init_desc,
++ XCT_FUN_SRC_PTR((encini && macini) ? 0x68 : 0x40, ses->dma_addr));
++ }
++ if (macini) {
++ if (macini->cri_alg == CRYPTO_MD5_HMAC ||
++ macini->cri_alg == CRYPTO_SHA1_HMAC)
++ memcpy(ses->hkey, macini->cri_key, blksz);
++ else {
++ /* Load initialization constants(RFC 1321, 3174) */
++ ses->hiv[0] = 0x67452301efcdab89ULL;
++ ses->hiv[1] = 0x98badcfe10325476ULL;
++ ses->hiv[2] = 0xc3d2e1f000000000ULL;
++ }
++ ses->hseq = 0ULL;
++ }
++
++ spin_lock_irqsave(&txring->fill_lock, flags);
++
++ if (((txring->next_to_fill + pasemi_desc_size(&init_desc)) -
++ txring->next_to_clean) > TX_RING_SIZE) {
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++ return ERESTART;
++ }
++
++ if (encini) {
++ pasemi_ring_add_desc(txring, &init_desc, NULL);
++ pasemi_ring_incr(sc, ses->chan,
++ pasemi_desc_size(&init_desc));
++ }
++
++ txring->sesn = sesn;
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++
++ *sidp = PASEMI_SID(sesn);
++ return 0;
++}
++
++/*
++ * Deallocate a session.
++ */
++static int
++pasemi_freesession(device_t dev, u_int64_t tid)
++{
++ struct pasemi_softc *sc = device_get_softc(dev);
++ int session;
++ u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (sc == NULL)
++ return -EINVAL;
++ session = PASEMI_SESSION(sid);
++ if (session >= sc->sc_nsessions || !sc->sc_sessions[session])
++ return -EINVAL;
++
++ pci_unmap_single(sc->dma_pdev,
++ sc->sc_sessions[session]->dma_addr,
++ sizeof(struct pasemi_session), DMA_TO_DEVICE);
++ memset(sc->sc_sessions[session], 0,
++ sizeof(struct pasemi_session));
++
++ return 0;
++}
++
++static int
++pasemi_process(device_t dev, struct cryptop *crp, int hint)
++{
++
++ int err = 0, ivsize, srclen = 0, reinit = 0, reinit_size = 0, chsel;
++ struct pasemi_softc *sc = device_get_softc(dev);
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++ caddr_t ivp;
++ struct pasemi_desc init_desc, work_desc;
++ struct pasemi_session *ses;
++ struct sk_buff *skb;
++ struct uio *uiop;
++ unsigned long flags;
++ struct pasemi_fnu_txring *txring;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (crp == NULL || crp->crp_callback == NULL || sc == NULL)
++ return -EINVAL;
++
++ crp->crp_etype = 0;
++ if (PASEMI_SESSION(crp->crp_sid) >= sc->sc_nsessions)
++ return -EINVAL;
++
++ ses = sc->sc_sessions[PASEMI_SESSION(crp->crp_sid)];
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ err = -EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++
++ if (ALG_IS_SIG(crd1->crd_alg)) {
++ maccrd = crd1;
++ if (crd2 == NULL)
++ enccrd = NULL;
++ else if (ALG_IS_CIPHER(crd2->crd_alg) &&
++ (crd2->crd_flags & CRD_F_ENCRYPT) == 0)
++ enccrd = crd2;
++ else
++ goto erralg;
++ } else if (ALG_IS_CIPHER(crd1->crd_alg)) {
++ enccrd = crd1;
++ if (crd2 == NULL)
++ maccrd = NULL;
++ else if (ALG_IS_SIG(crd2->crd_alg) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT))
++ maccrd = crd2;
++ else
++ goto erralg;
++ } else
++ goto erralg;
++
++ chsel = ses->chan;
++
++ txring = &sc->tx[chsel];
++
++ if (enccrd && !maccrd) {
++ if (enccrd->crd_alg == CRYPTO_ARC4)
++ reinit = 1;
++ reinit_size = 0x40;
++ srclen = crp->crp_ilen;
++
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I
++ | XCT_FUN_FUN(chsel));
++ if (enccrd->crd_flags & CRD_F_ENCRYPT)
++ pasemi_desc_hdr(&work_desc, XCT_FUN_CRM_ENC);
++ else
++ pasemi_desc_hdr(&work_desc, XCT_FUN_CRM_DEC);
++ } else if (enccrd && maccrd) {
++ if (enccrd->crd_alg == CRYPTO_ARC4)
++ reinit = 1;
++ reinit_size = 0x68;
++
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ /* Encrypt -> Authenticate */
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I | XCT_FUN_CRM_ENC_SIG
++ | XCT_FUN_A | XCT_FUN_FUN(chsel));
++ srclen = maccrd->crd_skip + maccrd->crd_len;
++ } else {
++ /* Authenticate -> Decrypt */
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I | XCT_FUN_CRM_SIG_DEC
++ | XCT_FUN_24BRES | XCT_FUN_FUN(chsel));
++ pasemi_desc_build(&work_desc, 0);
++ pasemi_desc_build(&work_desc, 0);
++ pasemi_desc_build(&work_desc, 0);
++ work_desc.postop = PASEMI_CHECK_SIG;
++ srclen = crp->crp_ilen;
++ }
++
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SHL(maccrd->crd_skip / 4));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_CHL(enccrd->crd_skip - maccrd->crd_skip));
++ } else if (!enccrd && maccrd) {
++ srclen = maccrd->crd_len;
++
++ pasemi_desc_start(&init_desc,
++ XCT_CTRL_HDR(chsel, 0x58, DMA_FN_HKEY0));
++ pasemi_desc_build(&init_desc,
++ XCT_FUN_SRC_PTR(0x58, ((struct pasemi_session *)ses->dma_addr)->hkey));
++
++ pasemi_desc_start(&work_desc, XCT_FUN_O | XCT_FUN_I | XCT_FUN_CRM_SIG
++ | XCT_FUN_A | XCT_FUN_FUN(chsel));
++ }
++
++ if (enccrd) {
++ switch (enccrd->crd_alg) {
++ case CRYPTO_3DES_CBC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_3DES |
++ XCT_FUN_BCM_CBC);
++ ivsize = sizeof(u64);
++ break;
++ case CRYPTO_DES_CBC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_DES |
++ XCT_FUN_BCM_CBC);
++ ivsize = sizeof(u64);
++ break;
++ case CRYPTO_AES_CBC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_AES |
++ XCT_FUN_BCM_CBC);
++ ivsize = 2 * sizeof(u64);
++ break;
++ case CRYPTO_ARC4:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_ALG_ARC);
++ ivsize = 0;
++ break;
++ default:
++ printk(DRV_NAME ": unimplemented enccrd->crd_alg %d\n",
++ enccrd->crd_alg);
++ err = -EINVAL;
++ goto errout;
++ }
++
++ ivp = (ivsize == sizeof(u64)) ? (caddr_t) &ses->civ[1] : (caddr_t) &ses->civ[0];
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ memcpy(ivp, enccrd->crd_iv, ivsize);
++ /* If IV is not present in the buffer already, it has to be copied there */
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0)
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, ivp);
++ } else {
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ /* IV is provided expicitly in descriptor */
++ memcpy(ivp, enccrd->crd_iv, ivsize);
++ else
++ /* IV is provided in the packet */
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize,
++ ivp);
++ }
++ }
++
++ if (maccrd) {
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_MD5 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ case CRYPTO_SHA1:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_SHA1 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ case CRYPTO_MD5_HMAC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_HMAC_MD5 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ case CRYPTO_SHA1_HMAC:
++ pasemi_desc_hdr(&work_desc, XCT_FUN_SIG_HMAC_SHA1 |
++ XCT_FUN_HSZ((crp->crp_ilen - maccrd->crd_inject) / 4));
++ break;
++ default:
++ printk(DRV_NAME ": unimplemented maccrd->crd_alg %d\n",
++ maccrd->crd_alg);
++ err = -EINVAL;
++ goto errout;
++ }
++ }
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ /* using SKB buffers */
++ skb = (struct sk_buff *)crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags) {
++ printk(DRV_NAME ": skb frags unimplemented\n");
++ err = -EINVAL;
++ goto errout;
++ }
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_DST_PTR(skb->len, pci_map_single(
++ sc->dma_pdev, skb->data,
++ skb->len, DMA_TO_DEVICE)));
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_SRC_PTR(
++ srclen, pci_map_single(
++ sc->dma_pdev, skb->data,
++ srclen, DMA_TO_DEVICE)));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_LLEN(srclen));
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ /* using IOV buffers */
++ uiop = (struct uio *)crp->crp_buf;
++ if (uiop->uio_iovcnt > 1) {
++ printk(DRV_NAME ": iov frags unimplemented\n");
++ err = -EINVAL;
++ goto errout;
++ }
++
++ /* crp_olen is never set; always use crp_ilen */
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_DST_PTR(crp->crp_ilen, pci_map_single(
++ sc->dma_pdev,
++ uiop->uio_iov->iov_base,
++ crp->crp_ilen, DMA_TO_DEVICE)));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_LLEN(srclen));
++
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_SRC_PTR(srclen, pci_map_single(
++ sc->dma_pdev,
++ uiop->uio_iov->iov_base,
++ srclen, DMA_TO_DEVICE)));
++ } else {
++ /* using contig buffers */
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_DST_PTR(crp->crp_ilen, pci_map_single(
++ sc->dma_pdev,
++ crp->crp_buf,
++ crp->crp_ilen, DMA_TO_DEVICE)));
++ pasemi_desc_build(
++ &work_desc,
++ XCT_FUN_SRC_PTR(srclen, pci_map_single(
++ sc->dma_pdev,
++ crp->crp_buf, srclen,
++ DMA_TO_DEVICE)));
++ pasemi_desc_hdr(&work_desc, XCT_FUN_LLEN(srclen));
++ }
++
++ spin_lock_irqsave(&txring->fill_lock, flags);
++
++ if (txring->sesn != PASEMI_SESSION(crp->crp_sid)) {
++ txring->sesn = PASEMI_SESSION(crp->crp_sid);
++ reinit = 1;
++ }
++
++ if (enccrd) {
++ pasemi_desc_start(&init_desc,
++ XCT_CTRL_HDR(chsel, reinit ? reinit_size : 0x10, DMA_FN_CIV0));
++ pasemi_desc_build(&init_desc,
++ XCT_FUN_SRC_PTR(reinit ? reinit_size : 0x10, ses->dma_addr));
++ }
++
++ if (((txring->next_to_fill + pasemi_desc_size(&init_desc) +
++ pasemi_desc_size(&work_desc)) -
++ txring->next_to_clean) > TX_RING_SIZE) {
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++ err = ERESTART;
++ goto errout;
++ }
++
++ pasemi_ring_add_desc(txring, &init_desc, NULL);
++ pasemi_ring_add_desc(txring, &work_desc, crp);
++
++ pasemi_ring_incr(sc, chsel,
++ pasemi_desc_size(&init_desc) +
++ pasemi_desc_size(&work_desc));
++
++ spin_unlock_irqrestore(&txring->fill_lock, flags);
++
++ mod_timer(&txring->crypto_timer, jiffies + TIMER_INTERVAL);
++
++ return 0;
++
++erralg:
++ printk(DRV_NAME ": unsupported algorithm or algorithm order alg1 %d alg2 %d\n",
++ crd1->crd_alg, crd2->crd_alg);
++ err = -EINVAL;
++
++errout:
++ if (err != ERESTART) {
++ crp->crp_etype = err;
++ crypto_done(crp);
++ }
++ return err;
++}
++
++static int pasemi_clean_tx(struct pasemi_softc *sc, int chan)
++{
++ int i, j, ring_idx;
++ struct pasemi_fnu_txring *ring = &sc->tx[chan];
++ u16 delta_cnt;
++ int flags, loops = 10;
++ int desc_size;
++ struct cryptop *crp;
++
++ spin_lock_irqsave(&ring->clean_lock, flags);
++
++ while ((delta_cnt = (dma_status->tx_sta[sc->base_chan + chan]
++ & PAS_STATUS_PCNT_M) - ring->total_pktcnt)
++ && loops--) {
++
++ for (i = 0; i < delta_cnt; i++) {
++ desc_size = TX_DESC_INFO(ring, ring->next_to_clean).desc_size;
++ crp = TX_DESC_INFO(ring, ring->next_to_clean).cf_crp;
++ if (crp) {
++ ring_idx = 2 * (ring->next_to_clean & (TX_RING_SIZE-1));
++ if (TX_DESC_INFO(ring, ring->next_to_clean).desc_postop & PASEMI_CHECK_SIG) {
++ /* Need to make sure signature matched,
++ * if not - return error */
++ if (!(ring->desc[ring_idx + 1] & (1ULL << 63)))
++ crp->crp_etype = -EINVAL;
++ }
++ crypto_done(TX_DESC_INFO(ring,
++ ring->next_to_clean).cf_crp);
++ TX_DESC_INFO(ring, ring->next_to_clean).cf_crp = NULL;
++ pci_unmap_single(
++ sc->dma_pdev,
++ XCT_PTR_ADDR_LEN(ring->desc[ring_idx + 1]),
++ PCI_DMA_TODEVICE);
++
++ ring->desc[ring_idx] = ring->desc[ring_idx + 1] = 0;
++
++ ring->next_to_clean++;
++ for (j = 1; j < desc_size; j++) {
++ ring_idx = 2 *
++ (ring->next_to_clean &
++ (TX_RING_SIZE-1));
++ pci_unmap_single(
++ sc->dma_pdev,
++ XCT_PTR_ADDR_LEN(ring->desc[ring_idx]),
++ PCI_DMA_TODEVICE);
++ if (ring->desc[ring_idx + 1])
++ pci_unmap_single(
++ sc->dma_pdev,
++ XCT_PTR_ADDR_LEN(
++ ring->desc[
++ ring_idx + 1]),
++ PCI_DMA_TODEVICE);
++ ring->desc[ring_idx] =
++ ring->desc[ring_idx + 1] = 0;
++ ring->next_to_clean++;
++ }
++ } else {
++ for (j = 0; j < desc_size; j++) {
++ ring_idx = 2 * (ring->next_to_clean & (TX_RING_SIZE-1));
++ ring->desc[ring_idx] =
++ ring->desc[ring_idx + 1] = 0;
++ ring->next_to_clean++;
++ }
++ }
++ }
++
++ ring->total_pktcnt += delta_cnt;
++ }
++ spin_unlock_irqrestore(&ring->clean_lock, flags);
++
++ return 0;
++}
++
++static void sweepup_tx(struct pasemi_softc *sc)
++{
++ int i;
++
++ for (i = 0; i < sc->sc_num_channels; i++)
++ pasemi_clean_tx(sc, i);
++}
++
++static irqreturn_t pasemi_intr(int irq, void *arg, struct pt_regs *regs)
++{
++ struct pasemi_softc *sc = arg;
++ unsigned int reg;
++ int chan = irq - sc->base_irq;
++ int chan_index = sc->base_chan + chan;
++ u64 stat = dma_status->tx_sta[chan_index];
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (!(stat & PAS_STATUS_CAUSE_M))
++ return IRQ_NONE;
++
++ pasemi_clean_tx(sc, chan);
++
++ stat = dma_status->tx_sta[chan_index];
++
++ reg = PAS_IOB_DMA_TXCH_RESET_PINTC |
++ PAS_IOB_DMA_TXCH_RESET_PCNT(sc->tx[chan].total_pktcnt);
++
++ if (stat & PAS_STATUS_SOFT)
++ reg |= PAS_IOB_DMA_RXCH_RESET_SINTC;
++
++ out_le32(sc->iob_regs + PAS_IOB_DMA_TXCH_RESET(chan_index), reg);
++
++
++ return IRQ_HANDLED;
++}
++
++static int pasemi_dma_setup_tx_resources(struct pasemi_softc *sc, int chan)
++{
++ u32 val;
++ int chan_index = chan + sc->base_chan;
++ int ret;
++ struct pasemi_fnu_txring *ring;
++
++ ring = &sc->tx[chan];
++
++ spin_lock_init(&ring->fill_lock);
++ spin_lock_init(&ring->clean_lock);
++
++ ring->desc_info = kzalloc(sizeof(struct pasemi_desc_info) *
++ TX_RING_SIZE, GFP_KERNEL);
++ if (!ring->desc_info)
++ return -ENOMEM;
++
++ /* Allocate descriptors */
++ ring->desc = dma_alloc_coherent(&sc->dma_pdev->dev,
++ TX_RING_SIZE *
++ 2 * sizeof(u64),
++ &ring->dma, GFP_KERNEL);
++ if (!ring->desc)
++ return -ENOMEM;
++
++ memset((void *) ring->desc, 0, TX_RING_SIZE * 2 * sizeof(u64));
++
++ out_le32(sc->iob_regs + PAS_IOB_DMA_TXCH_RESET(chan_index), 0x30);
++
++ ring->total_pktcnt = 0;
++
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_BASEL(chan_index),
++ PAS_DMA_TXCHAN_BASEL_BRBL(ring->dma));
++
++ val = PAS_DMA_TXCHAN_BASEU_BRBH(ring->dma >> 32);
++ val |= PAS_DMA_TXCHAN_BASEU_SIZ(TX_RING_SIZE >> 2);
++
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_BASEU(chan_index), val);
++
++ out_le32(sc->dma_regs + PAS_DMA_TXCHAN_CFG(chan_index),
++ PAS_DMA_TXCHAN_CFG_TY_FUNC |
++ PAS_DMA_TXCHAN_CFG_TATTR(chan) |
++ PAS_DMA_TXCHAN_CFG_WT(2));
++
++ /* enable tx channel */
++ out_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index),
++ PAS_DMA_TXCHAN_TCMDSTA_EN);
++
++ out_le32(sc->iob_regs + PAS_IOB_DMA_TXCH_CFG(chan_index),
++ PAS_IOB_DMA_TXCH_CFG_CNTTH(1000));
++
++ ring->next_to_fill = 0;
++ ring->next_to_clean = 0;
++
++ snprintf(ring->irq_name, sizeof(ring->irq_name),
++ "%s%d", "crypto", chan);
++
++ ring->irq = irq_create_mapping(NULL, sc->base_irq + chan);
++ ret = request_irq(ring->irq, (irq_handler_t)
++ pasemi_intr, IRQF_DISABLED, ring->irq_name, sc);
++ if (ret) {
++ printk(KERN_ERR DRV_NAME ": failed to hook irq %d ret %d\n",
++ ring->irq, ret);
++ ring->irq = -1;
++ return ret;
++ }
++
++ setup_timer(&ring->crypto_timer, (void *) sweepup_tx, (unsigned long) sc);
++
++ return 0;
++}
++
++static device_method_t pasemi_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, pasemi_newsession),
++ DEVMETHOD(cryptodev_freesession, pasemi_freesession),
++ DEVMETHOD(cryptodev_process, pasemi_process),
++};
++
++/* Set up the crypto device structure, private data,
++ * and anything else we need before we start */
++
++static int __devinit
++pasemi_dma_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
++{
++ struct pasemi_softc *sc;
++ int ret, i;
++
++ DPRINTF(KERN_ERR "%s()\n", __FUNCTION__);
++
++ sc = kzalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return -ENOMEM;
++
++ softc_device_init(sc, DRV_NAME, 1, pasemi_methods);
++
++ pci_set_drvdata(pdev, sc);
++
++ spin_lock_init(&sc->sc_chnlock);
++
++ sc->sc_sessions = (struct pasemi_session **)
++ kzalloc(PASEMI_INITIAL_SESSIONS *
++ sizeof(struct pasemi_session *), GFP_ATOMIC);
++ if (sc->sc_sessions == NULL) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ sc->sc_nsessions = PASEMI_INITIAL_SESSIONS;
++ sc->sc_lastchn = 0;
++ sc->base_irq = pdev->irq + 6;
++ sc->base_chan = 6;
++ sc->sc_cid = -1;
++ sc->dma_pdev = pdev;
++
++ sc->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL);
++ if (!sc->iob_pdev) {
++ dev_err(&pdev->dev, "Can't find I/O Bridge\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ /* This is hardcoded and ugly, but we have some firmware versions
++ * who don't provide the register space in the device tree. Luckily
++ * they are at well-known locations so we can just do the math here.
++ */
++ sc->dma_regs =
++ ioremap(0xe0000000 + (sc->dma_pdev->devfn << 12), 0x2000);
++ sc->iob_regs =
++ ioremap(0xe0000000 + (sc->iob_pdev->devfn << 12), 0x2000);
++ if (!sc->dma_regs || !sc->iob_regs) {
++ dev_err(&pdev->dev, "Can't map registers\n");
++ ret = -ENODEV;
++ goto out;
++ }
++
++ dma_status = __ioremap(0xfd800000, 0x1000, 0);
++ if (!dma_status) {
++ ret = -ENODEV;
++ dev_err(&pdev->dev, "Can't map dmastatus space\n");
++ goto out;
++ }
++
++ sc->tx = (struct pasemi_fnu_txring *)
++ kzalloc(sizeof(struct pasemi_fnu_txring)
++ * 8, GFP_KERNEL);
++ if (!sc->tx) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ /* Initialize the h/w */
++ out_le32(sc->dma_regs + PAS_DMA_COM_CFG,
++ (in_le32(sc->dma_regs + PAS_DMA_COM_CFG) |
++ PAS_DMA_COM_CFG_FWF));
++ out_le32(sc->dma_regs + PAS_DMA_COM_TXCMD, PAS_DMA_COM_TXCMD_EN);
++
++ for (i = 0; i < PASEMI_FNU_CHANNELS; i++) {
++ sc->sc_num_channels++;
++ ret = pasemi_dma_setup_tx_resources(sc, i);
++ if (ret)
++ goto out;
++ }
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),
++ CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ printk(KERN_ERR DRV_NAME ": could not get crypto driver id\n");
++ ret = -ENXIO;
++ goto out;
++ }
++
++ /* register algorithms with the framework */
++ printk(DRV_NAME ":");
++
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_ARC4, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++
++ return 0;
++
++out:
++ pasemi_dma_remove(pdev);
++ return ret;
++}
++
++#define MAX_RETRIES 5000
++
++static void pasemi_free_tx_resources(struct pasemi_softc *sc, int chan)
++{
++ struct pasemi_fnu_txring *ring = &sc->tx[chan];
++ int chan_index = chan + sc->base_chan;
++ int retries;
++ u32 stat;
++
++ /* Stop the channel */
++ out_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index),
++ PAS_DMA_TXCHAN_TCMDSTA_ST);
++
++ for (retries = 0; retries < MAX_RETRIES; retries++) {
++ stat = in_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index));
++ if (!(stat & PAS_DMA_TXCHAN_TCMDSTA_ACT))
++ break;
++ cond_resched();
++ }
++
++ if (stat & PAS_DMA_TXCHAN_TCMDSTA_ACT)
++ dev_err(&sc->dma_pdev->dev, "Failed to stop tx channel %d\n",
++ chan_index);
++
++ /* Disable the channel */
++ out_le32(sc->dma_regs +
++ PAS_DMA_TXCHAN_TCMDSTA(chan_index),
++ 0);
++
++ if (ring->desc_info)
++ kfree((void *) ring->desc_info);
++ if (ring->desc)
++ dma_free_coherent(&sc->dma_pdev->dev,
++ TX_RING_SIZE *
++ 2 * sizeof(u64),
++ (void *) ring->desc, ring->dma);
++ if (ring->irq != -1)
++ free_irq(ring->irq, sc);
++
++ del_timer(&ring->crypto_timer);
++}
++
++static void __devexit pasemi_dma_remove(struct pci_dev *pdev)
++{
++ struct pasemi_softc *sc = pci_get_drvdata(pdev);
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (sc->sc_cid >= 0) {
++ crypto_unregister_all(sc->sc_cid);
++ }
++
++ if (sc->tx) {
++ for (i = 0; i < sc->sc_num_channels; i++)
++ pasemi_free_tx_resources(sc, i);
++
++ kfree(sc->tx);
++ }
++ if (sc->sc_sessions) {
++ for (i = 0; i < sc->sc_nsessions; i++)
++ kfree(sc->sc_sessions[i]);
++ kfree(sc->sc_sessions);
++ }
++ if (sc->iob_pdev)
++ pci_dev_put(sc->iob_pdev);
++ if (sc->dma_regs)
++ iounmap(sc->dma_regs);
++ if (sc->iob_regs)
++ iounmap(sc->iob_regs);
++ kfree(sc);
++}
++
++static struct pci_device_id pasemi_dma_pci_tbl[] = {
++ { PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa007) },
++};
++
++MODULE_DEVICE_TABLE(pci, pasemi_dma_pci_tbl);
++
++static struct pci_driver pasemi_dma_driver = {
++ .name = "pasemi_dma",
++ .id_table = pasemi_dma_pci_tbl,
++ .probe = pasemi_dma_probe,
++ .remove = __devexit_p(pasemi_dma_remove),
++};
++
++static void __exit pasemi_dma_cleanup_module(void)
++{
++ pci_unregister_driver(&pasemi_dma_driver);
++ __iounmap(dma_status);
++ dma_status = NULL;
++}
++
++int pasemi_dma_init_module(void)
++{
++ return pci_register_driver(&pasemi_dma_driver);
++}
++
++module_init(pasemi_dma_init_module);
++module_exit(pasemi_dma_cleanup_module);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("Egor Martovetsky egor@pasemi.com");
++MODULE_DESCRIPTION("OCF driver for PA Semi PWRficient DMA Crypto Engine");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/pasemi/pasemi_fnu.h linux-2.6.29.1/crypto/ocf/pasemi/pasemi_fnu.h
+--- linux-2.6.29.1.orig/crypto/ocf/pasemi/pasemi_fnu.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/pasemi/pasemi_fnu.h 2009-04-20 20:01:21.560560284 +0200
+@@ -0,0 +1,410 @@
++/*
++ * Copyright (C) 2007 PA Semi, Inc
++ *
++ * Driver for the PA Semi PWRficient DMA Crypto Engine, soft state and
++ * hardware register layouts.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef PASEMI_FNU_H
++#define PASEMI_FNU_H
++
++#include <linux/spinlock.h>
++
++#define PASEMI_SESSION(sid) ((sid) & 0xffffffff)
++#define PASEMI_SID(sesn) ((sesn) & 0xffffffff)
++#define DPRINTF(a...) if (debug) { printk(DRV_NAME ": " a); }
++
++/* Must be a power of two */
++#define RX_RING_SIZE 512
++#define TX_RING_SIZE 512
++#define TX_DESC(ring, num) ((ring)->desc[2 * (num & (TX_RING_SIZE-1))])
++#define TX_DESC_INFO(ring, num) ((ring)->desc_info[(num) & (TX_RING_SIZE-1)])
++#define MAX_DESC_SIZE 8
++#define PASEMI_INITIAL_SESSIONS 10
++#define PASEMI_FNU_CHANNELS 8
++
++/* DMA descriptor */
++struct pasemi_desc {
++ u64 quad[2*MAX_DESC_SIZE];
++ int quad_cnt;
++ int size;
++ int postop;
++};
++
++/*
++ * Holds per descriptor data
++ */
++struct pasemi_desc_info {
++ int desc_size;
++ int desc_postop;
++#define PASEMI_CHECK_SIG 0x1
++
++ struct cryptop *cf_crp;
++};
++
++/*
++ * Holds per channel data
++ */
++struct pasemi_fnu_txring {
++ volatile u64 *desc;
++ volatile struct
++ pasemi_desc_info *desc_info;
++ dma_addr_t dma;
++ struct timer_list crypto_timer;
++ spinlock_t fill_lock;
++ spinlock_t clean_lock;
++ unsigned int next_to_fill;
++ unsigned int next_to_clean;
++ u16 total_pktcnt;
++ int irq;
++ int sesn;
++ char irq_name[10];
++};
++
++/*
++ * Holds data specific to a single pasemi device.
++ */
++struct pasemi_softc {
++ softc_device_decl sc_cdev;
++ struct pci_dev *dma_pdev; /* device backpointer */
++ struct pci_dev *iob_pdev; /* device backpointer */
++ void __iomem *dma_regs;
++ void __iomem *iob_regs;
++ int base_irq;
++ int base_chan;
++ int32_t sc_cid; /* crypto tag */
++ int sc_nsessions;
++ struct pasemi_session **sc_sessions;
++ int sc_num_channels;/* number of crypto channels */
++
++ /* pointer to the array of txring datastructures, one txring per channel */
++ struct pasemi_fnu_txring *tx;
++
++ /*
++ * mutual exclusion for the channel scheduler
++ */
++ spinlock_t sc_chnlock;
++ /* last channel used, for now use round-robin to allocate channels */
++ int sc_lastchn;
++};
++
++struct pasemi_session {
++ u64 civ[2];
++ u64 keysz;
++ u64 key[4];
++ u64 ccmd;
++ u64 hkey[4];
++ u64 hseq;
++ u64 giv[2];
++ u64 hiv[4];
++
++ int used;
++ dma_addr_t dma_addr;
++ int chan;
++};
++
++/* status register layout in IOB region, at 0xfd800000 */
++struct pasdma_status {
++ u64 rx_sta[64];
++ u64 tx_sta[20];
++};
++
++#define ALG_IS_CIPHER(alg) ((alg == CRYPTO_DES_CBC) || \
++ (alg == CRYPTO_3DES_CBC) || \
++ (alg == CRYPTO_AES_CBC) || \
++ (alg == CRYPTO_ARC4) || \
++ (alg == CRYPTO_NULL_CBC))
++
++#define ALG_IS_SIG(alg) ((alg == CRYPTO_MD5) || \
++ (alg == CRYPTO_MD5_HMAC) || \
++ (alg == CRYPTO_SHA1) || \
++ (alg == CRYPTO_SHA1_HMAC) || \
++ (alg == CRYPTO_NULL_HMAC))
++
++enum {
++ PAS_DMA_COM_TXCMD = 0x100, /* Transmit Command Register */
++ PAS_DMA_COM_TXSTA = 0x104, /* Transmit Status Register */
++ PAS_DMA_COM_RXCMD = 0x108, /* Receive Command Register */
++ PAS_DMA_COM_RXSTA = 0x10c, /* Receive Status Register */
++ PAS_DMA_COM_CFG = 0x114, /* DMA Configuration Register */
++};
++
++/* All these registers live in the PCI configuration space for the DMA PCI
++ * device. Use the normal PCI config access functions for them.
++ */
++
++#define PAS_DMA_COM_CFG_FWF 0x18000000
++
++#define PAS_DMA_COM_TXCMD_EN 0x00000001 /* enable */
++#define PAS_DMA_COM_TXSTA_ACT 0x00000001 /* active */
++#define PAS_DMA_COM_RXCMD_EN 0x00000001 /* enable */
++#define PAS_DMA_COM_RXSTA_ACT 0x00000001 /* active */
++
++#define _PAS_DMA_TXCHAN_STRIDE 0x20 /* Size per channel */
++#define _PAS_DMA_TXCHAN_TCMDSTA 0x300 /* Command / Status */
++#define _PAS_DMA_TXCHAN_CFG 0x304 /* Configuration */
++#define _PAS_DMA_TXCHAN_DSCRBU 0x308 /* Descriptor BU Allocation */
++#define _PAS_DMA_TXCHAN_INCR 0x310 /* Descriptor increment */
++#define _PAS_DMA_TXCHAN_CNT 0x314 /* Descriptor count/offset */
++#define _PAS_DMA_TXCHAN_BASEL 0x318 /* Descriptor ring base (low) */
++#define _PAS_DMA_TXCHAN_BASEU 0x31c /* (high) */
++#define PAS_DMA_TXCHAN_TCMDSTA(c) (0x300+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_TCMDSTA_EN 0x00000001 /* Enabled */
++#define PAS_DMA_TXCHAN_TCMDSTA_ST 0x00000002 /* Stop interface */
++#define PAS_DMA_TXCHAN_TCMDSTA_ACT 0x00010000 /* Active */
++#define PAS_DMA_TXCHAN_CFG(c) (0x304+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_CFG_TY_FUNC 0x00000002 /* Type = interface */
++#define PAS_DMA_TXCHAN_CFG_TY_IFACE 0x00000000 /* Type = interface */
++#define PAS_DMA_TXCHAN_CFG_TATTR_M 0x0000003c
++#define PAS_DMA_TXCHAN_CFG_TATTR_S 2
++#define PAS_DMA_TXCHAN_CFG_TATTR(x) (((x) << PAS_DMA_TXCHAN_CFG_TATTR_S) & \
++ PAS_DMA_TXCHAN_CFG_TATTR_M)
++#define PAS_DMA_TXCHAN_CFG_WT_M 0x000001c0
++#define PAS_DMA_TXCHAN_CFG_WT_S 6
++#define PAS_DMA_TXCHAN_CFG_WT(x) (((x) << PAS_DMA_TXCHAN_CFG_WT_S) & \
++ PAS_DMA_TXCHAN_CFG_WT_M)
++#define PAS_DMA_TXCHAN_CFG_LPSQ_FAST 0x00000400
++#define PAS_DMA_TXCHAN_CFG_LPDQ_FAST 0x00000800
++#define PAS_DMA_TXCHAN_CFG_CF 0x00001000 /* Clean first line */
++#define PAS_DMA_TXCHAN_CFG_CL 0x00002000 /* Clean last line */
++#define PAS_DMA_TXCHAN_CFG_UP 0x00004000 /* update tx descr when sent */
++#define PAS_DMA_TXCHAN_INCR(c) (0x310+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_BASEL(c) (0x318+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_BASEL_BRBL_M 0xffffffc0
++#define PAS_DMA_TXCHAN_BASEL_BRBL_S 0
++#define PAS_DMA_TXCHAN_BASEL_BRBL(x) (((x) << PAS_DMA_TXCHAN_BASEL_BRBL_S) & \
++ PAS_DMA_TXCHAN_BASEL_BRBL_M)
++#define PAS_DMA_TXCHAN_BASEU(c) (0x31c+(c)*_PAS_DMA_TXCHAN_STRIDE)
++#define PAS_DMA_TXCHAN_BASEU_BRBH_M 0x00000fff
++#define PAS_DMA_TXCHAN_BASEU_BRBH_S 0
++#define PAS_DMA_TXCHAN_BASEU_BRBH(x) (((x) << PAS_DMA_TXCHAN_BASEU_BRBH_S) & \
++ PAS_DMA_TXCHAN_BASEU_BRBH_M)
++/* # of cache lines worth of buffer ring */
++#define PAS_DMA_TXCHAN_BASEU_SIZ_M 0x3fff0000
++#define PAS_DMA_TXCHAN_BASEU_SIZ_S 16 /* 0 = 16K */
++#define PAS_DMA_TXCHAN_BASEU_SIZ(x) (((x) << PAS_DMA_TXCHAN_BASEU_SIZ_S) & \
++ PAS_DMA_TXCHAN_BASEU_SIZ_M)
++
++#define PAS_STATUS_PCNT_M 0x000000000000ffffull
++#define PAS_STATUS_PCNT_S 0
++#define PAS_STATUS_DCNT_M 0x00000000ffff0000ull
++#define PAS_STATUS_DCNT_S 16
++#define PAS_STATUS_BPCNT_M 0x0000ffff00000000ull
++#define PAS_STATUS_BPCNT_S 32
++#define PAS_STATUS_CAUSE_M 0xf000000000000000ull
++#define PAS_STATUS_TIMER 0x1000000000000000ull
++#define PAS_STATUS_ERROR 0x2000000000000000ull
++#define PAS_STATUS_SOFT 0x4000000000000000ull
++#define PAS_STATUS_INT 0x8000000000000000ull
++
++#define PAS_IOB_DMA_RXCH_CFG(i) (0x1100 + (i)*4)
++#define PAS_IOB_DMA_RXCH_CFG_CNTTH_M 0x00000fff
++#define PAS_IOB_DMA_RXCH_CFG_CNTTH_S 0
++#define PAS_IOB_DMA_RXCH_CFG_CNTTH(x) (((x) << PAS_IOB_DMA_RXCH_CFG_CNTTH_S) & \
++ PAS_IOB_DMA_RXCH_CFG_CNTTH_M)
++#define PAS_IOB_DMA_TXCH_CFG(i) (0x1200 + (i)*4)
++#define PAS_IOB_DMA_TXCH_CFG_CNTTH_M 0x00000fff
++#define PAS_IOB_DMA_TXCH_CFG_CNTTH_S 0
++#define PAS_IOB_DMA_TXCH_CFG_CNTTH(x) (((x) << PAS_IOB_DMA_TXCH_CFG_CNTTH_S) & \
++ PAS_IOB_DMA_TXCH_CFG_CNTTH_M)
++#define PAS_IOB_DMA_RXCH_STAT(i) (0x1300 + (i)*4)
++#define PAS_IOB_DMA_RXCH_STAT_INTGEN 0x00001000
++#define PAS_IOB_DMA_RXCH_STAT_CNTDEL_M 0x00000fff
++#define PAS_IOB_DMA_RXCH_STAT_CNTDEL_S 0
++#define PAS_IOB_DMA_RXCH_STAT_CNTDEL(x) (((x) << PAS_IOB_DMA_RXCH_STAT_CNTDEL_S) &\
++ PAS_IOB_DMA_RXCH_STAT_CNTDEL_M)
++#define PAS_IOB_DMA_TXCH_STAT(i) (0x1400 + (i)*4)
++#define PAS_IOB_DMA_TXCH_STAT_INTGEN 0x00001000
++#define PAS_IOB_DMA_TXCH_STAT_CNTDEL_M 0x00000fff
++#define PAS_IOB_DMA_TXCH_STAT_CNTDEL_S 0
++#define PAS_IOB_DMA_TXCH_STAT_CNTDEL(x) (((x) << PAS_IOB_DMA_TXCH_STAT_CNTDEL_S) &\
++ PAS_IOB_DMA_TXCH_STAT_CNTDEL_M)
++#define PAS_IOB_DMA_RXCH_RESET(i) (0x1500 + (i)*4)
++#define PAS_IOB_DMA_RXCH_RESET_PCNT_M 0xffff0000
++#define PAS_IOB_DMA_RXCH_RESET_PCNT_S 16
++#define PAS_IOB_DMA_RXCH_RESET_PCNT(x) (((x) << PAS_IOB_DMA_RXCH_RESET_PCNT_S) & \
++ PAS_IOB_DMA_RXCH_RESET_PCNT_M)
++#define PAS_IOB_DMA_RXCH_RESET_PCNTRST 0x00000020
++#define PAS_IOB_DMA_RXCH_RESET_DCNTRST 0x00000010
++#define PAS_IOB_DMA_RXCH_RESET_TINTC 0x00000008
++#define PAS_IOB_DMA_RXCH_RESET_DINTC 0x00000004
++#define PAS_IOB_DMA_RXCH_RESET_SINTC 0x00000002
++#define PAS_IOB_DMA_RXCH_RESET_PINTC 0x00000001
++#define PAS_IOB_DMA_TXCH_RESET(i) (0x1600 + (i)*4)
++#define PAS_IOB_DMA_TXCH_RESET_PCNT_M 0xffff0000
++#define PAS_IOB_DMA_TXCH_RESET_PCNT_S 16
++#define PAS_IOB_DMA_TXCH_RESET_PCNT(x) (((x) << PAS_IOB_DMA_TXCH_RESET_PCNT_S) & \
++ PAS_IOB_DMA_TXCH_RESET_PCNT_M)
++#define PAS_IOB_DMA_TXCH_RESET_PCNTRST 0x00000020
++#define PAS_IOB_DMA_TXCH_RESET_DCNTRST 0x00000010
++#define PAS_IOB_DMA_TXCH_RESET_TINTC 0x00000008
++#define PAS_IOB_DMA_TXCH_RESET_DINTC 0x00000004
++#define PAS_IOB_DMA_TXCH_RESET_SINTC 0x00000002
++#define PAS_IOB_DMA_TXCH_RESET_PINTC 0x00000001
++
++#define PAS_IOB_DMA_COM_TIMEOUTCFG 0x1700
++#define PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_M 0x00ffffff
++#define PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_S 0
++#define PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(x) (((x) << PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_S) & \
++ PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT_M)
++
++/* Transmit descriptor fields */
++#define XCT_MACTX_T 0x8000000000000000ull
++#define XCT_MACTX_ST 0x4000000000000000ull
++#define XCT_MACTX_NORES 0x0000000000000000ull
++#define XCT_MACTX_8BRES 0x1000000000000000ull
++#define XCT_MACTX_24BRES 0x2000000000000000ull
++#define XCT_MACTX_40BRES 0x3000000000000000ull
++#define XCT_MACTX_I 0x0800000000000000ull
++#define XCT_MACTX_O 0x0400000000000000ull
++#define XCT_MACTX_E 0x0200000000000000ull
++#define XCT_MACTX_VLAN_M 0x0180000000000000ull
++#define XCT_MACTX_VLAN_NOP 0x0000000000000000ull
++#define XCT_MACTX_VLAN_REMOVE 0x0080000000000000ull
++#define XCT_MACTX_VLAN_INSERT 0x0100000000000000ull
++#define XCT_MACTX_VLAN_REPLACE 0x0180000000000000ull
++#define XCT_MACTX_CRC_M 0x0060000000000000ull
++#define XCT_MACTX_CRC_NOP 0x0000000000000000ull
++#define XCT_MACTX_CRC_INSERT 0x0020000000000000ull
++#define XCT_MACTX_CRC_PAD 0x0040000000000000ull
++#define XCT_MACTX_CRC_REPLACE 0x0060000000000000ull
++#define XCT_MACTX_SS 0x0010000000000000ull
++#define XCT_MACTX_LLEN_M 0x00007fff00000000ull
++#define XCT_MACTX_LLEN_S 32ull
++#define XCT_MACTX_LLEN(x) ((((long)(x)) << XCT_MACTX_LLEN_S) & \
++ XCT_MACTX_LLEN_M)
++#define XCT_MACTX_IPH_M 0x00000000f8000000ull
++#define XCT_MACTX_IPH_S 27ull
++#define XCT_MACTX_IPH(x) ((((long)(x)) << XCT_MACTX_IPH_S) & \
++ XCT_MACTX_IPH_M)
++#define XCT_MACTX_IPO_M 0x0000000007c00000ull
++#define XCT_MACTX_IPO_S 22ull
++#define XCT_MACTX_IPO(x) ((((long)(x)) << XCT_MACTX_IPO_S) & \
++ XCT_MACTX_IPO_M)
++#define XCT_MACTX_CSUM_M 0x0000000000000060ull
++#define XCT_MACTX_CSUM_NOP 0x0000000000000000ull
++#define XCT_MACTX_CSUM_TCP 0x0000000000000040ull
++#define XCT_MACTX_CSUM_UDP 0x0000000000000060ull
++#define XCT_MACTX_V6 0x0000000000000010ull
++#define XCT_MACTX_C 0x0000000000000004ull
++#define XCT_MACTX_AL2 0x0000000000000002ull
++
++#define XCT_PTR_T 0x8000000000000000ull
++#define XCT_PTR_LEN_M 0x7ffff00000000000ull
++#define XCT_PTR_LEN_S 44
++#define XCT_PTR_LEN(x) ((((long)(x)) << XCT_PTR_LEN_S) & \
++ XCT_PTR_LEN_M)
++#define XCT_PTR_ADDR_M 0x00000fffffffffffull
++#define XCT_PTR_ADDR_S 0
++#define XCT_PTR_ADDR(x) ((((long)(x)) << XCT_PTR_ADDR_S) & \
++ XCT_PTR_ADDR_M)
++
++/* Function descriptor fields */
++#define XCT_FUN_T 0x8000000000000000ull
++#define XCT_FUN_ST 0x4000000000000000ull
++#define XCT_FUN_NORES 0x0000000000000000ull
++#define XCT_FUN_8BRES 0x1000000000000000ull
++#define XCT_FUN_24BRES 0x2000000000000000ull
++#define XCT_FUN_40BRES 0x3000000000000000ull
++#define XCT_FUN_I 0x0800000000000000ull
++#define XCT_FUN_O 0x0400000000000000ull
++#define XCT_FUN_E 0x0200000000000000ull
++#define XCT_FUN_FUN_S 54
++#define XCT_FUN_FUN_M 0x01c0000000000000ull
++#define XCT_FUN_FUN(num) ((((long)(num)) << XCT_FUN_FUN_S) & \
++ XCT_FUN_FUN_M)
++#define XCT_FUN_CRM_NOP 0x0000000000000000ull
++#define XCT_FUN_CRM_SIG 0x0008000000000000ull
++#define XCT_FUN_CRM_ENC 0x0010000000000000ull
++#define XCT_FUN_CRM_DEC 0x0018000000000000ull
++#define XCT_FUN_CRM_SIG_ENC 0x0020000000000000ull
++#define XCT_FUN_CRM_ENC_SIG 0x0028000000000000ull
++#define XCT_FUN_CRM_SIG_DEC 0x0030000000000000ull
++#define XCT_FUN_CRM_DEC_SIG 0x0038000000000000ull
++#define XCT_FUN_LLEN_M 0x0007ffff00000000ull
++#define XCT_FUN_LLEN_S 32ULL
++#define XCT_FUN_LLEN(x) ((((long)(x)) << XCT_FUN_LLEN_S) & \
++ XCT_FUN_LLEN_M)
++#define XCT_FUN_SHL_M 0x00000000f8000000ull
++#define XCT_FUN_SHL_S 27ull
++#define XCT_FUN_SHL(x) ((((long)(x)) << XCT_FUN_SHL_S) & \
++ XCT_FUN_SHL_M)
++#define XCT_FUN_CHL_M 0x0000000007c00000ull
++#define XCT_FUN_CHL_S 22ull
++#define XCT_FUN_CHL(x) ((((long)(x)) << XCT_FUN_CHL_S) & \
++ XCT_FUN_CHL_M)
++#define XCT_FUN_HSZ_M 0x00000000003c0000ull
++#define XCT_FUN_HSZ_S 18ull
++#define XCT_FUN_HSZ(x) ((((long)(x)) << XCT_FUN_HSZ_S) & \
++ XCT_FUN_HSZ_M)
++#define XCT_FUN_ALG_DES 0x0000000000000000ull
++#define XCT_FUN_ALG_3DES 0x0000000000008000ull
++#define XCT_FUN_ALG_AES 0x0000000000010000ull
++#define XCT_FUN_ALG_ARC 0x0000000000018000ull
++#define XCT_FUN_ALG_KASUMI 0x0000000000020000ull
++#define XCT_FUN_BCM_ECB 0x0000000000000000ull
++#define XCT_FUN_BCM_CBC 0x0000000000001000ull
++#define XCT_FUN_BCM_CFB 0x0000000000002000ull
++#define XCT_FUN_BCM_OFB 0x0000000000003000ull
++#define XCT_FUN_BCM_CNT 0x0000000000003800ull
++#define XCT_FUN_BCM_KAS_F8 0x0000000000002800ull
++#define XCT_FUN_BCM_KAS_F9 0x0000000000001800ull
++#define XCT_FUN_BCP_NO_PAD 0x0000000000000000ull
++#define XCT_FUN_BCP_ZRO 0x0000000000000200ull
++#define XCT_FUN_BCP_PL 0x0000000000000400ull
++#define XCT_FUN_BCP_INCR 0x0000000000000600ull
++#define XCT_FUN_SIG_MD5 (0ull << 4)
++#define XCT_FUN_SIG_SHA1 (2ull << 4)
++#define XCT_FUN_SIG_HMAC_MD5 (8ull << 4)
++#define XCT_FUN_SIG_HMAC_SHA1 (10ull << 4)
++#define XCT_FUN_A 0x0000000000000008ull
++#define XCT_FUN_C 0x0000000000000004ull
++#define XCT_FUN_AL2 0x0000000000000002ull
++#define XCT_FUN_SE 0x0000000000000001ull
++
++#define XCT_FUN_SRC_PTR(len, addr) (XCT_PTR_LEN(len) | XCT_PTR_ADDR(addr))
++#define XCT_FUN_DST_PTR(len, addr) (XCT_FUN_SRC_PTR(len, addr) | \
++ 0x8000000000000000ull)
++
++#define XCT_CTRL_HDR_FUN_NUM_M 0x01c0000000000000ull
++#define XCT_CTRL_HDR_FUN_NUM_S 54
++#define XCT_CTRL_HDR_LEN_M 0x0007ffff00000000ull
++#define XCT_CTRL_HDR_LEN_S 32
++#define XCT_CTRL_HDR_REG_M 0x00000000000000ffull
++#define XCT_CTRL_HDR_REG_S 0
++
++#define XCT_CTRL_HDR(funcN,len,reg) (0x9400000000000000ull | \
++ ((((long)(funcN)) << XCT_CTRL_HDR_FUN_NUM_S) \
++ & XCT_CTRL_HDR_FUN_NUM_M) | \
++ ((((long)(len)) << \
++ XCT_CTRL_HDR_LEN_S) & XCT_CTRL_HDR_LEN_M) | \
++ ((((long)(reg)) << \
++ XCT_CTRL_HDR_REG_S) & XCT_CTRL_HDR_REG_M))
++
++/* Function config command options */
++#define DMA_CALGO_DES 0x00
++#define DMA_CALGO_3DES 0x01
++#define DMA_CALGO_AES 0x02
++#define DMA_CALGO_ARC 0x03
++
++#define DMA_FN_CIV0 0x02
++#define DMA_FN_CIV1 0x03
++#define DMA_FN_HKEY0 0x0a
++
++#define XCT_PTR_ADDR_LEN(ptr) ((ptr) & XCT_PTR_ADDR_M), \
++ (((ptr) & XCT_PTR_LEN_M) >> XCT_PTR_LEN_S)
++
++#endif /* PASEMI_FNU_H */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/random.c linux-2.6.29.1/crypto/ocf/random.c
+--- linux-2.6.29.1.orig/crypto/ocf/random.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/random.c 2009-04-20 20:01:21.584560546 +0200
+@@ -0,0 +1,317 @@
++/*
++ * A system independant way of adding entropy to the kernels pool
++ * this way the drivers can focus on the real work and we can take
++ * care of pushing it to the appropriate place in the kernel.
++ *
++ * This should be fast and callable from timers/interrupts
++ *
++ * Written by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/spinlock.h>
++#include <linux/version.h>
++#include <linux/unistd.h>
++#include <linux/poll.h>
++#include <linux/random.h>
++#include <cryptodev.h>
++
++#ifdef CONFIG_OCF_FIPS
++#include "rndtest.h"
++#endif
++
++#ifndef HAS_RANDOM_INPUT_WAIT
++#error "Please do not enable OCF_RANDOMHARVEST unless you have applied patches"
++#endif
++
++/*
++ * a hack to access the debug levels from the crypto driver
++ */
++extern int crypto_debug;
++#define debug crypto_debug
++
++/*
++ * a list of all registered random providers
++ */
++static LIST_HEAD(random_ops);
++static int started = 0;
++static int initted = 0;
++
++struct random_op {
++ struct list_head random_list;
++ u_int32_t driverid;
++ int (*read_random)(void *arg, u_int32_t *buf, int len);
++ void *arg;
++};
++
++static int random_proc(void *arg);
++
++static pid_t randomproc = (pid_t) -1;
++static spinlock_t random_lock;
++
++/*
++ * just init the spin locks
++ */
++static int
++crypto_random_init(void)
++{
++ spin_lock_init(&random_lock);
++ initted = 1;
++ return(0);
++}
++
++/*
++ * Add the given random reader to our list (if not present)
++ * and start the thread (if not already started)
++ *
++ * we have to assume that driver id is ok for now
++ */
++int
++crypto_rregister(
++ u_int32_t driverid,
++ int (*read_random)(void *arg, u_int32_t *buf, int len),
++ void *arg)
++{
++ unsigned long flags;
++ int ret = 0;
++ struct random_op *rops, *tmp;
++
++ dprintk("%s,%d: %s(0x%x, %p, %p)\n", __FILE__, __LINE__,
++ __FUNCTION__, driverid, read_random, arg);
++
++ if (!initted)
++ crypto_random_init();
++
++#if 0
++ struct cryptocap *cap;
++
++ cap = crypto_checkdriver(driverid);
++ if (!cap)
++ return EINVAL;
++#endif
++
++ list_for_each_entry_safe(rops, tmp, &random_ops, random_list) {
++ if (rops->driverid == driverid && rops->read_random == read_random)
++ return EEXIST;
++ }
++
++ rops = (struct random_op *) kmalloc(sizeof(*rops), GFP_KERNEL);
++ if (!rops)
++ return ENOMEM;
++
++ rops->driverid = driverid;
++ rops->read_random = read_random;
++ rops->arg = arg;
++
++ spin_lock_irqsave(&random_lock, flags);
++ list_add_tail(&rops->random_list, &random_ops);
++ if (!started) {
++ randomproc = kernel_thread(random_proc, NULL, CLONE_FS|CLONE_FILES);
++ if (randomproc < 0) {
++ ret = randomproc;
++ printk("crypto: crypto_rregister cannot start random thread; "
++ "error %d", ret);
++ } else
++ started = 1;
++ }
++ spin_unlock_irqrestore(&random_lock, flags);
++
++ return ret;
++}
++EXPORT_SYMBOL(crypto_rregister);
++
++int
++crypto_runregister_all(u_int32_t driverid)
++{
++ struct random_op *rops, *tmp;
++ unsigned long flags;
++
++ dprintk("%s,%d: %s(0x%x)\n", __FILE__, __LINE__, __FUNCTION__, driverid);
++
++ list_for_each_entry_safe(rops, tmp, &random_ops, random_list) {
++ if (rops->driverid == driverid) {
++ list_del(&rops->random_list);
++ kfree(rops);
++ }
++ }
++
++ spin_lock_irqsave(&random_lock, flags);
++ if (list_empty(&random_ops) && started)
++ kill_pid(randomproc, SIGKILL, 1);
++ spin_unlock_irqrestore(&random_lock, flags);
++ return(0);
++}
++EXPORT_SYMBOL(crypto_runregister_all);
++
++/*
++ * while we can add entropy to random.c continue to read random data from
++ * the drivers and push it to random.
++ */
++static int
++random_proc(void *arg)
++{
++ int n;
++ int wantcnt;
++ int bufcnt = 0;
++ int retval = 0;
++ int *buf = NULL;
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ daemonize();
++ spin_lock_irq(&current->sigmask_lock);
++ sigemptyset(&current->blocked);
++ recalc_sigpending(current);
++ spin_unlock_irq(&current->sigmask_lock);
++ sprintf(current->comm, "ocf-random");
++#else
++ daemonize("ocf-random");
++ allow_signal(SIGKILL);
++#endif
++
++ (void) get_fs();
++ set_fs(get_ds());
++
++#ifdef CONFIG_OCF_FIPS
++#define NUM_INT (RNDTEST_NBYTES/sizeof(int))
++#else
++#define NUM_INT 32
++#endif
++
++ /*
++ * some devices can transferr their RNG data direct into memory,
++ * so make sure it is device friendly
++ */
++ buf = kmalloc(NUM_INT * sizeof(int), GFP_DMA);
++ if (NULL == buf) {
++ printk("crypto: RNG could not allocate memory\n");
++ retval = -ENOMEM;
++ goto bad_alloc;
++ }
++
++ wantcnt = NUM_INT; /* start by adding some entropy */
++
++ /*
++ * its possible due to errors or driver removal that we no longer
++ * have anything to do, if so exit or we will consume all the CPU
++ * doing nothing
++ */
++ while (!list_empty(&random_ops)) {
++ struct random_op *rops, *tmp;
++
++#ifdef CONFIG_OCF_FIPS
++ if (wantcnt)
++ wantcnt = NUM_INT; /* FIPs mode can do 20000 bits or none */
++#endif
++
++ /* see if we can get enough entropy to make the world
++ * a better place.
++ */
++ while (bufcnt < wantcnt && bufcnt < NUM_INT) {
++ list_for_each_entry_safe(rops, tmp, &random_ops, random_list) {
++
++ n = (*rops->read_random)(rops->arg, &buf[bufcnt],
++ NUM_INT - bufcnt);
++
++ /* on failure remove the random number generator */
++ if (n == -1) {
++ list_del(&rops->random_list);
++ printk("crypto: RNG (driverid=0x%x) failed, disabling\n",
++ rops->driverid);
++ kfree(rops);
++ } else if (n > 0)
++ bufcnt += n;
++ }
++ /* give up CPU for a bit, just in case as this is a loop */
++ schedule();
++ }
++
++
++#ifdef CONFIG_OCF_FIPS
++ if (bufcnt > 0 && rndtest_buf((unsigned char *) &buf[0])) {
++ dprintk("crypto: buffer had fips errors, discarding\n");
++ bufcnt = 0;
++ }
++#endif
++
++ /*
++ * if we have a certified buffer, we can send some data
++ * to /dev/random and move along
++ */
++ if (bufcnt > 0) {
++ /* add what we have */
++ random_input_words(buf, bufcnt, bufcnt*sizeof(int)*8);
++ bufcnt = 0;
++ }
++
++ /* give up CPU for a bit so we don't hog while filling */
++ schedule();
++
++ /* wait for needing more */
++ wantcnt = random_input_wait();
++
++ if (wantcnt <= 0)
++ wantcnt = 0; /* try to get some info again */
++ else
++ /* round up to one word or we can loop forever */
++ wantcnt = (wantcnt + (sizeof(int)*8)) / (sizeof(int)*8);
++ if (wantcnt > NUM_INT) {
++ wantcnt = NUM_INT;
++ }
++
++ if (signal_pending(current)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_lock_irq(&current->sigmask_lock);
++#endif
++ flush_signals(current);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ spin_unlock_irq(&current->sigmask_lock);
++#endif
++ }
++ }
++
++ kfree(buf);
++
++bad_alloc:
++ spin_lock_irq(&random_lock);
++ randomproc = (pid_t) -1;
++ started = 0;
++ spin_unlock_irq(&random_lock);
++
++ return retval;
++}
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/rndtest.c linux-2.6.29.1/crypto/ocf/rndtest.c
+--- linux-2.6.29.1.orig/crypto/ocf/rndtest.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/rndtest.c 2009-04-20 20:01:21.584560546 +0200
+@@ -0,0 +1,300 @@
++/* $OpenBSD$ */
++
++/*
++ * OCF/Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by Jason L. Wright
++ * 4. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
++ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/list.h>
++#include <linux/wait.h>
++#include <linux/time.h>
++#include <linux/version.h>
++#include <linux/unistd.h>
++#include <linux/kernel.h>
++#include <linux/string.h>
++#include <linux/time.h>
++#include <cryptodev.h>
++#include "rndtest.h"
++
++static struct rndtest_stats rndstats;
++
++static void rndtest_test(struct rndtest_state *);
++
++/* The tests themselves */
++static int rndtest_monobit(struct rndtest_state *);
++static int rndtest_runs(struct rndtest_state *);
++static int rndtest_longruns(struct rndtest_state *);
++static int rndtest_chi_4(struct rndtest_state *);
++
++static int rndtest_runs_check(struct rndtest_state *, int, int *);
++static void rndtest_runs_record(struct rndtest_state *, int, int *);
++
++static const struct rndtest_testfunc {
++ int (*test)(struct rndtest_state *);
++} rndtest_funcs[] = {
++ { rndtest_monobit },
++ { rndtest_runs },
++ { rndtest_chi_4 },
++ { rndtest_longruns },
++};
++
++#define RNDTEST_NTESTS (sizeof(rndtest_funcs)/sizeof(rndtest_funcs[0]))
++
++static void
++rndtest_test(struct rndtest_state *rsp)
++{
++ int i, rv = 0;
++
++ rndstats.rst_tests++;
++ for (i = 0; i < RNDTEST_NTESTS; i++)
++ rv |= (*rndtest_funcs[i].test)(rsp);
++ rsp->rs_discard = (rv != 0);
++}
++
++
++extern int crypto_debug;
++#define rndtest_verbose 2
++#define rndtest_report(rsp, failure, fmt, a...) \
++ { if (failure || crypto_debug) { printk("rng_test: " fmt "\n", a); } else; }
++
++#define RNDTEST_MONOBIT_MINONES 9725
++#define RNDTEST_MONOBIT_MAXONES 10275
++
++static int
++rndtest_monobit(struct rndtest_state *rsp)
++{
++ int i, ones = 0, j;
++ u_int8_t r;
++
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ r = rsp->rs_buf[i];
++ for (j = 0; j < 8; j++, r <<= 1)
++ if (r & 0x80)
++ ones++;
++ }
++ if (ones > RNDTEST_MONOBIT_MINONES &&
++ ones < RNDTEST_MONOBIT_MAXONES) {
++ if (rndtest_verbose > 1)
++ rndtest_report(rsp, 0, "monobit pass (%d < %d < %d)",
++ RNDTEST_MONOBIT_MINONES, ones,
++ RNDTEST_MONOBIT_MAXONES);
++ return (0);
++ } else {
++ if (rndtest_verbose)
++ rndtest_report(rsp, 1,
++ "monobit failed (%d ones)", ones);
++ rndstats.rst_monobit++;
++ return (-1);
++ }
++}
++
++#define RNDTEST_RUNS_NINTERVAL 6
++
++static const struct rndtest_runs_tabs {
++ u_int16_t min, max;
++} rndtest_runs_tab[] = {
++ { 2343, 2657 },
++ { 1135, 1365 },
++ { 542, 708 },
++ { 251, 373 },
++ { 111, 201 },
++ { 111, 201 },
++};
++
++static int
++rndtest_runs(struct rndtest_state *rsp)
++{
++ int i, j, ones, zeros, rv = 0;
++ int onei[RNDTEST_RUNS_NINTERVAL], zeroi[RNDTEST_RUNS_NINTERVAL];
++ u_int8_t c;
++
++ bzero(onei, sizeof(onei));
++ bzero(zeroi, sizeof(zeroi));
++ ones = zeros = 0;
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ c = rsp->rs_buf[i];
++ for (j = 0; j < 8; j++, c <<= 1) {
++ if (c & 0x80) {
++ ones++;
++ rndtest_runs_record(rsp, zeros, zeroi);
++ zeros = 0;
++ } else {
++ zeros++;
++ rndtest_runs_record(rsp, ones, onei);
++ ones = 0;
++ }
++ }
++ }
++ rndtest_runs_record(rsp, ones, onei);
++ rndtest_runs_record(rsp, zeros, zeroi);
++
++ rv |= rndtest_runs_check(rsp, 0, zeroi);
++ rv |= rndtest_runs_check(rsp, 1, onei);
++
++ if (rv)
++ rndstats.rst_runs++;
++
++ return (rv);
++}
++
++static void
++rndtest_runs_record(struct rndtest_state *rsp, int len, int *intrv)
++{
++ if (len == 0)
++ return;
++ if (len > RNDTEST_RUNS_NINTERVAL)
++ len = RNDTEST_RUNS_NINTERVAL;
++ len -= 1;
++ intrv[len]++;
++}
++
++static int
++rndtest_runs_check(struct rndtest_state *rsp, int val, int *src)
++{
++ int i, rv = 0;
++
++ for (i = 0; i < RNDTEST_RUNS_NINTERVAL; i++) {
++ if (src[i] < rndtest_runs_tab[i].min ||
++ src[i] > rndtest_runs_tab[i].max) {
++ rndtest_report(rsp, 1,
++ "%s interval %d failed (%d, %d-%d)",
++ val ? "ones" : "zeros",
++ i + 1, src[i], rndtest_runs_tab[i].min,
++ rndtest_runs_tab[i].max);
++ rv = -1;
++ } else {
++ rndtest_report(rsp, 0,
++ "runs pass %s interval %d (%d < %d < %d)",
++ val ? "ones" : "zeros",
++ i + 1, rndtest_runs_tab[i].min, src[i],
++ rndtest_runs_tab[i].max);
++ }
++ }
++ return (rv);
++}
++
++static int
++rndtest_longruns(struct rndtest_state *rsp)
++{
++ int i, j, ones = 0, zeros = 0, maxones = 0, maxzeros = 0;
++ u_int8_t c;
++
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ c = rsp->rs_buf[i];
++ for (j = 0; j < 8; j++, c <<= 1) {
++ if (c & 0x80) {
++ zeros = 0;
++ ones++;
++ if (ones > maxones)
++ maxones = ones;
++ } else {
++ ones = 0;
++ zeros++;
++ if (zeros > maxzeros)
++ maxzeros = zeros;
++ }
++ }
++ }
++
++ if (maxones < 26 && maxzeros < 26) {
++ rndtest_report(rsp, 0, "longruns pass (%d ones, %d zeros)",
++ maxones, maxzeros);
++ return (0);
++ } else {
++ rndtest_report(rsp, 1, "longruns fail (%d ones, %d zeros)",
++ maxones, maxzeros);
++ rndstats.rst_longruns++;
++ return (-1);
++ }
++}
++
++/*
++ * chi^2 test over 4 bits: (this is called the poker test in FIPS 140-2,
++ * but it is really the chi^2 test over 4 bits (the poker test as described
++ * by Knuth vol 2 is something different, and I take him as authoritative
++ * on nomenclature over NIST).
++ */
++#define RNDTEST_CHI4_K 16
++#define RNDTEST_CHI4_K_MASK (RNDTEST_CHI4_K - 1)
++
++/*
++ * The unnormalized values are used so that we don't have to worry about
++ * fractional precision. The "real" value is found by:
++ * (V - 1562500) * (16 / 5000) = Vn (where V is the unnormalized value)
++ */
++#define RNDTEST_CHI4_VMIN 1563181 /* 2.1792 */
++#define RNDTEST_CHI4_VMAX 1576929 /* 46.1728 */
++
++static int
++rndtest_chi_4(struct rndtest_state *rsp)
++{
++ unsigned int freq[RNDTEST_CHI4_K], i, sum;
++
++ for (i = 0; i < RNDTEST_CHI4_K; i++)
++ freq[i] = 0;
++
++ /* Get number of occurances of each 4 bit pattern */
++ for (i = 0; i < RNDTEST_NBYTES; i++) {
++ freq[(rsp->rs_buf[i] >> 4) & RNDTEST_CHI4_K_MASK]++;
++ freq[(rsp->rs_buf[i] >> 0) & RNDTEST_CHI4_K_MASK]++;
++ }
++
++ for (i = 0, sum = 0; i < RNDTEST_CHI4_K; i++)
++ sum += freq[i] * freq[i];
++
++ if (sum >= 1563181 && sum <= 1576929) {
++ rndtest_report(rsp, 0, "chi^2(4): pass (sum %u)", sum);
++ return (0);
++ } else {
++ rndtest_report(rsp, 1, "chi^2(4): failed (sum %u)", sum);
++ rndstats.rst_chi++;
++ return (-1);
++ }
++}
++
++int
++rndtest_buf(unsigned char *buf)
++{
++ struct rndtest_state rsp;
++
++ memset(&rsp, 0, sizeof(rsp));
++ rsp.rs_buf = buf;
++ rndtest_test(&rsp);
++ return(rsp.rs_discard);
++}
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/rndtest.h linux-2.6.29.1/crypto/ocf/rndtest.h
+--- linux-2.6.29.1.orig/crypto/ocf/rndtest.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/rndtest.h 2009-04-20 20:01:21.588561893 +0200
+@@ -0,0 +1,54 @@
++/* $FreeBSD: src/sys/dev/rndtest/rndtest.h,v 1.1 2003/03/11 22:54:44 sam Exp $ */
++/* $OpenBSD$ */
++
++/*
++ * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. All advertising materials mentioning features or use of this software
++ * must display the following acknowledgement:
++ * This product includes software developed by Jason L. Wright
++ * 4. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
++ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
++
++/* Some of the tests depend on these values */
++#define RNDTEST_NBYTES 2500
++#define RNDTEST_NBITS (8 * RNDTEST_NBYTES)
++
++struct rndtest_state {
++ int rs_discard; /* discard/accept random data */
++ u_int8_t *rs_buf;
++};
++
++struct rndtest_stats {
++ u_int32_t rst_discard; /* number of bytes discarded */
++ u_int32_t rst_tests; /* number of test runs */
++ u_int32_t rst_monobit; /* monobit test failures */
++ u_int32_t rst_runs; /* 0/1 runs failures */
++ u_int32_t rst_longruns; /* longruns failures */
++ u_int32_t rst_chi; /* chi^2 failures */
++};
++
++extern int rndtest_buf(unsigned char *buf);
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/Makefile linux-2.6.29.1/crypto/ocf/safe/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/safe/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/Makefile 2009-04-20 20:01:21.588561893 +0200
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_SAFE) += safe.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/md5.c linux-2.6.29.1/crypto/ocf/safe/md5.c
+--- linux-2.6.29.1.orig/crypto/ocf/safe/md5.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/md5.c 2009-04-20 20:01:21.588561893 +0200
+@@ -0,0 +1,308 @@
++/* $KAME: md5.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#if 0
++#include <sys/cdefs.h>
++__FBSDID("$FreeBSD: src/sys/crypto/md5.c,v 1.9 2004/01/27 19:49:19 des Exp $");
++
++#include <sys/types.h>
++#include <sys/cdefs.h>
++#include <sys/time.h>
++#include <sys/systm.h>
++#include <crypto/md5.h>
++#endif
++
++#define SHIFT(X, s) (((X) << (s)) | ((X) >> (32 - (s))))
++
++#define F(X, Y, Z) (((X) & (Y)) | ((~X) & (Z)))
++#define G(X, Y, Z) (((X) & (Z)) | ((Y) & (~Z)))
++#define H(X, Y, Z) ((X) ^ (Y) ^ (Z))
++#define I(X, Y, Z) ((Y) ^ ((X) | (~Z)))
++
++#define ROUND1(a, b, c, d, k, s, i) { \
++ (a) = (a) + F((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define ROUND2(a, b, c, d, k, s, i) { \
++ (a) = (a) + G((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define ROUND3(a, b, c, d, k, s, i) { \
++ (a) = (a) + H((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define ROUND4(a, b, c, d, k, s, i) { \
++ (a) = (a) + I((b), (c), (d)) + X[(k)] + T[(i)]; \
++ (a) = SHIFT((a), (s)); \
++ (a) = (b) + (a); \
++}
++
++#define Sa 7
++#define Sb 12
++#define Sc 17
++#define Sd 22
++
++#define Se 5
++#define Sf 9
++#define Sg 14
++#define Sh 20
++
++#define Si 4
++#define Sj 11
++#define Sk 16
++#define Sl 23
++
++#define Sm 6
++#define Sn 10
++#define So 15
++#define Sp 21
++
++#define MD5_A0 0x67452301
++#define MD5_B0 0xefcdab89
++#define MD5_C0 0x98badcfe
++#define MD5_D0 0x10325476
++
++/* Integer part of 4294967296 times abs(sin(i)), where i is in radians. */
++static const u_int32_t T[65] = {
++ 0,
++ 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
++ 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
++ 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
++ 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
++
++ 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
++ 0xd62f105d, 0x2441453, 0xd8a1e681, 0xe7d3fbc8,
++ 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
++ 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
++
++ 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
++ 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
++ 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05,
++ 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
++
++ 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,
++ 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
++ 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
++ 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
++};
++
++static const u_int8_t md5_paddat[MD5_BUFLEN] = {
++ 0x80, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0,
++};
++
++static void md5_calc(u_int8_t *, md5_ctxt *);
++
++void md5_init(ctxt)
++ md5_ctxt *ctxt;
++{
++ ctxt->md5_n = 0;
++ ctxt->md5_i = 0;
++ ctxt->md5_sta = MD5_A0;
++ ctxt->md5_stb = MD5_B0;
++ ctxt->md5_stc = MD5_C0;
++ ctxt->md5_std = MD5_D0;
++ bzero(ctxt->md5_buf, sizeof(ctxt->md5_buf));
++}
++
++void md5_loop(ctxt, input, len)
++ md5_ctxt *ctxt;
++ u_int8_t *input;
++ u_int len; /* number of bytes */
++{
++ u_int gap, i;
++
++ ctxt->md5_n += len * 8; /* byte to bit */
++ gap = MD5_BUFLEN - ctxt->md5_i;
++
++ if (len >= gap) {
++ bcopy((void *)input, (void *)(ctxt->md5_buf + ctxt->md5_i),
++ gap);
++ md5_calc(ctxt->md5_buf, ctxt);
++
++ for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN) {
++ md5_calc((u_int8_t *)(input + i), ctxt);
++ }
++
++ ctxt->md5_i = len - i;
++ bcopy((void *)(input + i), (void *)ctxt->md5_buf, ctxt->md5_i);
++ } else {
++ bcopy((void *)input, (void *)(ctxt->md5_buf + ctxt->md5_i),
++ len);
++ ctxt->md5_i += len;
++ }
++}
++
++void md5_pad(ctxt)
++ md5_ctxt *ctxt;
++{
++ u_int gap;
++
++ /* Don't count up padding. Keep md5_n. */
++ gap = MD5_BUFLEN - ctxt->md5_i;
++ if (gap > 8) {
++ bcopy(md5_paddat,
++ (void *)(ctxt->md5_buf + ctxt->md5_i),
++ gap - sizeof(ctxt->md5_n));
++ } else {
++ /* including gap == 8 */
++ bcopy(md5_paddat, (void *)(ctxt->md5_buf + ctxt->md5_i),
++ gap);
++ md5_calc(ctxt->md5_buf, ctxt);
++ bcopy((md5_paddat + gap),
++ (void *)ctxt->md5_buf,
++ MD5_BUFLEN - sizeof(ctxt->md5_n));
++ }
++
++ /* 8 byte word */
++#if BYTE_ORDER == LITTLE_ENDIAN
++ bcopy(&ctxt->md5_n8[0], &ctxt->md5_buf[56], 8);
++#endif
++#if BYTE_ORDER == BIG_ENDIAN
++ ctxt->md5_buf[56] = ctxt->md5_n8[7];
++ ctxt->md5_buf[57] = ctxt->md5_n8[6];
++ ctxt->md5_buf[58] = ctxt->md5_n8[5];
++ ctxt->md5_buf[59] = ctxt->md5_n8[4];
++ ctxt->md5_buf[60] = ctxt->md5_n8[3];
++ ctxt->md5_buf[61] = ctxt->md5_n8[2];
++ ctxt->md5_buf[62] = ctxt->md5_n8[1];
++ ctxt->md5_buf[63] = ctxt->md5_n8[0];
++#endif
++
++ md5_calc(ctxt->md5_buf, ctxt);
++}
++
++void md5_result(digest, ctxt)
++ u_int8_t *digest;
++ md5_ctxt *ctxt;
++{
++ /* 4 byte words */
++#if BYTE_ORDER == LITTLE_ENDIAN
++ bcopy(&ctxt->md5_st8[0], digest, 16);
++#endif
++#if BYTE_ORDER == BIG_ENDIAN
++ digest[ 0] = ctxt->md5_st8[ 3]; digest[ 1] = ctxt->md5_st8[ 2];
++ digest[ 2] = ctxt->md5_st8[ 1]; digest[ 3] = ctxt->md5_st8[ 0];
++ digest[ 4] = ctxt->md5_st8[ 7]; digest[ 5] = ctxt->md5_st8[ 6];
++ digest[ 6] = ctxt->md5_st8[ 5]; digest[ 7] = ctxt->md5_st8[ 4];
++ digest[ 8] = ctxt->md5_st8[11]; digest[ 9] = ctxt->md5_st8[10];
++ digest[10] = ctxt->md5_st8[ 9]; digest[11] = ctxt->md5_st8[ 8];
++ digest[12] = ctxt->md5_st8[15]; digest[13] = ctxt->md5_st8[14];
++ digest[14] = ctxt->md5_st8[13]; digest[15] = ctxt->md5_st8[12];
++#endif
++}
++
++static void md5_calc(b64, ctxt)
++ u_int8_t *b64;
++ md5_ctxt *ctxt;
++{
++ u_int32_t A = ctxt->md5_sta;
++ u_int32_t B = ctxt->md5_stb;
++ u_int32_t C = ctxt->md5_stc;
++ u_int32_t D = ctxt->md5_std;
++#if BYTE_ORDER == LITTLE_ENDIAN
++ u_int32_t *X = (u_int32_t *)b64;
++#endif
++#if BYTE_ORDER == BIG_ENDIAN
++ /* 4 byte words */
++ /* what a brute force but fast! */
++ u_int32_t X[16];
++ u_int8_t *y = (u_int8_t *)X;
++ y[ 0] = b64[ 3]; y[ 1] = b64[ 2]; y[ 2] = b64[ 1]; y[ 3] = b64[ 0];
++ y[ 4] = b64[ 7]; y[ 5] = b64[ 6]; y[ 6] = b64[ 5]; y[ 7] = b64[ 4];
++ y[ 8] = b64[11]; y[ 9] = b64[10]; y[10] = b64[ 9]; y[11] = b64[ 8];
++ y[12] = b64[15]; y[13] = b64[14]; y[14] = b64[13]; y[15] = b64[12];
++ y[16] = b64[19]; y[17] = b64[18]; y[18] = b64[17]; y[19] = b64[16];
++ y[20] = b64[23]; y[21] = b64[22]; y[22] = b64[21]; y[23] = b64[20];
++ y[24] = b64[27]; y[25] = b64[26]; y[26] = b64[25]; y[27] = b64[24];
++ y[28] = b64[31]; y[29] = b64[30]; y[30] = b64[29]; y[31] = b64[28];
++ y[32] = b64[35]; y[33] = b64[34]; y[34] = b64[33]; y[35] = b64[32];
++ y[36] = b64[39]; y[37] = b64[38]; y[38] = b64[37]; y[39] = b64[36];
++ y[40] = b64[43]; y[41] = b64[42]; y[42] = b64[41]; y[43] = b64[40];
++ y[44] = b64[47]; y[45] = b64[46]; y[46] = b64[45]; y[47] = b64[44];
++ y[48] = b64[51]; y[49] = b64[50]; y[50] = b64[49]; y[51] = b64[48];
++ y[52] = b64[55]; y[53] = b64[54]; y[54] = b64[53]; y[55] = b64[52];
++ y[56] = b64[59]; y[57] = b64[58]; y[58] = b64[57]; y[59] = b64[56];
++ y[60] = b64[63]; y[61] = b64[62]; y[62] = b64[61]; y[63] = b64[60];
++#endif
++
++ ROUND1(A, B, C, D, 0, Sa, 1); ROUND1(D, A, B, C, 1, Sb, 2);
++ ROUND1(C, D, A, B, 2, Sc, 3); ROUND1(B, C, D, A, 3, Sd, 4);
++ ROUND1(A, B, C, D, 4, Sa, 5); ROUND1(D, A, B, C, 5, Sb, 6);
++ ROUND1(C, D, A, B, 6, Sc, 7); ROUND1(B, C, D, A, 7, Sd, 8);
++ ROUND1(A, B, C, D, 8, Sa, 9); ROUND1(D, A, B, C, 9, Sb, 10);
++ ROUND1(C, D, A, B, 10, Sc, 11); ROUND1(B, C, D, A, 11, Sd, 12);
++ ROUND1(A, B, C, D, 12, Sa, 13); ROUND1(D, A, B, C, 13, Sb, 14);
++ ROUND1(C, D, A, B, 14, Sc, 15); ROUND1(B, C, D, A, 15, Sd, 16);
++
++ ROUND2(A, B, C, D, 1, Se, 17); ROUND2(D, A, B, C, 6, Sf, 18);
++ ROUND2(C, D, A, B, 11, Sg, 19); ROUND2(B, C, D, A, 0, Sh, 20);
++ ROUND2(A, B, C, D, 5, Se, 21); ROUND2(D, A, B, C, 10, Sf, 22);
++ ROUND2(C, D, A, B, 15, Sg, 23); ROUND2(B, C, D, A, 4, Sh, 24);
++ ROUND2(A, B, C, D, 9, Se, 25); ROUND2(D, A, B, C, 14, Sf, 26);
++ ROUND2(C, D, A, B, 3, Sg, 27); ROUND2(B, C, D, A, 8, Sh, 28);
++ ROUND2(A, B, C, D, 13, Se, 29); ROUND2(D, A, B, C, 2, Sf, 30);
++ ROUND2(C, D, A, B, 7, Sg, 31); ROUND2(B, C, D, A, 12, Sh, 32);
++
++ ROUND3(A, B, C, D, 5, Si, 33); ROUND3(D, A, B, C, 8, Sj, 34);
++ ROUND3(C, D, A, B, 11, Sk, 35); ROUND3(B, C, D, A, 14, Sl, 36);
++ ROUND3(A, B, C, D, 1, Si, 37); ROUND3(D, A, B, C, 4, Sj, 38);
++ ROUND3(C, D, A, B, 7, Sk, 39); ROUND3(B, C, D, A, 10, Sl, 40);
++ ROUND3(A, B, C, D, 13, Si, 41); ROUND3(D, A, B, C, 0, Sj, 42);
++ ROUND3(C, D, A, B, 3, Sk, 43); ROUND3(B, C, D, A, 6, Sl, 44);
++ ROUND3(A, B, C, D, 9, Si, 45); ROUND3(D, A, B, C, 12, Sj, 46);
++ ROUND3(C, D, A, B, 15, Sk, 47); ROUND3(B, C, D, A, 2, Sl, 48);
++
++ ROUND4(A, B, C, D, 0, Sm, 49); ROUND4(D, A, B, C, 7, Sn, 50);
++ ROUND4(C, D, A, B, 14, So, 51); ROUND4(B, C, D, A, 5, Sp, 52);
++ ROUND4(A, B, C, D, 12, Sm, 53); ROUND4(D, A, B, C, 3, Sn, 54);
++ ROUND4(C, D, A, B, 10, So, 55); ROUND4(B, C, D, A, 1, Sp, 56);
++ ROUND4(A, B, C, D, 8, Sm, 57); ROUND4(D, A, B, C, 15, Sn, 58);
++ ROUND4(C, D, A, B, 6, So, 59); ROUND4(B, C, D, A, 13, Sp, 60);
++ ROUND4(A, B, C, D, 4, Sm, 61); ROUND4(D, A, B, C, 11, Sn, 62);
++ ROUND4(C, D, A, B, 2, So, 63); ROUND4(B, C, D, A, 9, Sp, 64);
++
++ ctxt->md5_sta += A;
++ ctxt->md5_stb += B;
++ ctxt->md5_stc += C;
++ ctxt->md5_std += D;
++}
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/md5.h linux-2.6.29.1/crypto/ocf/safe/md5.h
+--- linux-2.6.29.1.orig/crypto/ocf/safe/md5.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/md5.h 2009-04-20 20:01:21.588561893 +0200
+@@ -0,0 +1,76 @@
++/* $FreeBSD: src/sys/crypto/md5.h,v 1.4 2002/03/20 05:13:50 alfred Exp $ */
++/* $KAME: md5.h,v 1.4 2000/03/27 04:36:22 sumikawa Exp $ */
++
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#ifndef _NETINET6_MD5_H_
++#define _NETINET6_MD5_H_
++
++#define MD5_BUFLEN 64
++
++typedef struct {
++ union {
++ u_int32_t md5_state32[4];
++ u_int8_t md5_state8[16];
++ } md5_st;
++
++#define md5_sta md5_st.md5_state32[0]
++#define md5_stb md5_st.md5_state32[1]
++#define md5_stc md5_st.md5_state32[2]
++#define md5_std md5_st.md5_state32[3]
++#define md5_st8 md5_st.md5_state8
++
++ union {
++ u_int64_t md5_count64;
++ u_int8_t md5_count8[8];
++ } md5_count;
++#define md5_n md5_count.md5_count64
++#define md5_n8 md5_count.md5_count8
++
++ u_int md5_i;
++ u_int8_t md5_buf[MD5_BUFLEN];
++} md5_ctxt;
++
++extern void md5_init(md5_ctxt *);
++extern void md5_loop(md5_ctxt *, u_int8_t *, u_int);
++extern void md5_pad(md5_ctxt *);
++extern void md5_result(u_int8_t *, md5_ctxt *);
++
++/* compatibility */
++#define MD5_CTX md5_ctxt
++#define MD5Init(x) md5_init((x))
++#define MD5Update(x, y, z) md5_loop((x), (y), (z))
++#define MD5Final(x, y) \
++do { \
++ md5_pad((y)); \
++ md5_result((x), (y)); \
++} while (0)
++
++#endif /* ! _NETINET6_MD5_H_*/
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/safe.c linux-2.6.29.1/crypto/ocf/safe/safe.c
+--- linux-2.6.29.1.orig/crypto/ocf/safe/safe.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/safe.c 2009-04-20 20:01:21.596561515 +0200
+@@ -0,0 +1,2288 @@
++/*-
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2004-2007 David McCullough
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2003 Sam Leffler, Errno Consulting
++ * Copyright (c) 2003 Global Technology Associates, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++__FBSDID("$FreeBSD: src/sys/dev/safe/safe.c,v 1.18 2007/03/21 03:42:50 sam Exp $");
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/slab.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/version.h>
++#include <linux/skbuff.h>
++#include <asm/io.h>
++
++/*
++ * SafeNet SafeXcel-1141 hardware crypto accelerator
++ */
++
++#include <cryptodev.h>
++#include <uio.h>
++#include <safe/safereg.h>
++#include <safe/safevar.h>
++
++#if 1
++#define DPRINTF(a) do { \
++ if (debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_dev) : "safe"); \
++ printk a; \
++ } \
++ } while (0)
++#else
++#define DPRINTF(a)
++#endif
++
++/*
++ * until we find a cleaner way, include the BSD md5/sha1 code
++ * here
++ */
++#define HMAC_HACK 1
++#ifdef HMAC_HACK
++#define LITTLE_ENDIAN 1234
++#define BIG_ENDIAN 4321
++#ifdef __LITTLE_ENDIAN
++#define BYTE_ORDER LITTLE_ENDIAN
++#endif
++#ifdef __BIG_ENDIAN
++#define BYTE_ORDER BIG_ENDIAN
++#endif
++#include <safe/md5.h>
++#include <safe/md5.c>
++#include <safe/sha1.h>
++#include <safe/sha1.c>
++
++u_int8_t hmac_ipad_buffer[64] = {
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
++ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36
++};
++
++u_int8_t hmac_opad_buffer[64] = {
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
++ 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C
++};
++#endif /* HMAC_HACK */
++
++/* add proc entry for this */
++struct safe_stats safestats;
++
++#define debug safe_debug
++int safe_debug = 0;
++module_param(safe_debug, int, 0644);
++MODULE_PARM_DESC(safe_debug, "Enable debug");
++
++static void safe_callback(struct safe_softc *, struct safe_ringentry *);
++static void safe_feed(struct safe_softc *, struct safe_ringentry *);
++#if defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG)
++static void safe_rng_init(struct safe_softc *);
++int safe_rngbufsize = 8; /* 32 bytes each read */
++module_param(safe_rngbufsize, int, 0644);
++MODULE_PARM_DESC(safe_rngbufsize, "RNG polling buffer size (32-bit words)");
++int safe_rngmaxalarm = 8; /* max alarms before reset */
++module_param(safe_rngmaxalarm, int, 0644);
++MODULE_PARM_DESC(safe_rngmaxalarm, "RNG max alarms before reset");
++#endif /* SAFE_NO_RNG */
++
++static void safe_totalreset(struct safe_softc *sc);
++static int safe_dmamap_aligned(struct safe_softc *sc, const struct safe_operand *op);
++static int safe_dmamap_uniform(struct safe_softc *sc, const struct safe_operand *op);
++static int safe_free_entry(struct safe_softc *sc, struct safe_ringentry *re);
++static int safe_kprocess(device_t dev, struct cryptkop *krp, int hint);
++static int safe_kstart(struct safe_softc *sc);
++static int safe_ksigbits(struct safe_softc *sc, struct crparam *cr);
++static void safe_kfeed(struct safe_softc *sc);
++static void safe_kpoll(unsigned long arg);
++static void safe_kload_reg(struct safe_softc *sc, u_int32_t off,
++ u_int32_t len, struct crparam *n);
++
++static int safe_newsession(device_t, u_int32_t *, struct cryptoini *);
++static int safe_freesession(device_t, u_int64_t);
++static int safe_process(device_t, struct cryptop *, int);
++
++static device_method_t safe_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, safe_newsession),
++ DEVMETHOD(cryptodev_freesession,safe_freesession),
++ DEVMETHOD(cryptodev_process, safe_process),
++ DEVMETHOD(cryptodev_kprocess, safe_kprocess),
++};
++
++#define READ_REG(sc,r) readl((sc)->sc_base_addr + (r))
++#define WRITE_REG(sc,r,val) writel((val), (sc)->sc_base_addr + (r))
++
++#define SAFE_MAX_CHIPS 8
++static struct safe_softc *safe_chip_idx[SAFE_MAX_CHIPS];
++
++/*
++ * split our buffers up into safe DMAable byte fragments to avoid lockup
++ * bug in 1141 HW on rev 1.0.
++ */
++
++static int
++pci_map_linear(
++ struct safe_softc *sc,
++ struct safe_operand *buf,
++ void *addr,
++ int len)
++{
++ dma_addr_t tmp;
++ int chunk, tlen = len;
++
++ tmp = pci_map_single(sc->sc_pcidev, addr, len, PCI_DMA_BIDIRECTIONAL);
++
++ buf->mapsize += len;
++ while (len > 0) {
++ chunk = (len > sc->sc_max_dsize) ? sc->sc_max_dsize : len;
++ buf->segs[buf->nsegs].ds_addr = tmp;
++ buf->segs[buf->nsegs].ds_len = chunk;
++ buf->segs[buf->nsegs].ds_tlen = tlen;
++ buf->nsegs++;
++ tmp += chunk;
++ len -= chunk;
++ tlen = 0;
++ }
++ return 0;
++}
++
++/*
++ * map in a given uio buffer (great on some arches :-)
++ */
++
++static int
++pci_map_uio(struct safe_softc *sc, struct safe_operand *buf, struct uio *uio)
++{
++ struct iovec *iov = uio->uio_iov;
++ int n;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ buf->mapsize = 0;
++ buf->nsegs = 0;
++
++ for (n = 0; n < uio->uio_iovcnt; n++) {
++ pci_map_linear(sc, buf, iov->iov_base, iov->iov_len);
++ iov++;
++ }
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++/*
++ * map in a given sk_buff
++ */
++
++static int
++pci_map_skb(struct safe_softc *sc,struct safe_operand *buf,struct sk_buff *skb)
++{
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ buf->mapsize = 0;
++ buf->nsegs = 0;
++
++ pci_map_linear(sc, buf, skb->data, skb_headlen(skb));
++
++ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
++ pci_map_linear(sc, buf,
++ page_address(skb_shinfo(skb)->frags[i].page) +
++ skb_shinfo(skb)->frags[i].page_offset,
++ skb_shinfo(skb)->frags[i].size);
++ }
++
++ /* identify this buffer by the first segment */
++ buf->map = (void *) buf->segs[0].ds_addr;
++ return(0);
++}
++
++
++#if 0 /* not needed at this time */
++static void
++pci_sync_operand(struct safe_softc *sc, struct safe_operand *buf)
++{
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++ for (i = 0; i < buf->nsegs; i++)
++ pci_dma_sync_single_for_cpu(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_len, PCI_DMA_BIDIRECTIONAL);
++}
++#endif
++
++static void
++pci_unmap_operand(struct safe_softc *sc, struct safe_operand *buf)
++{
++ int i;
++ DPRINTF(("%s()\n", __FUNCTION__));
++ for (i = 0; i < buf->nsegs; i++) {
++ if (buf->segs[i].ds_tlen) {
++ DPRINTF(("%s - unmap %d 0x%x %d\n", __FUNCTION__, i, buf->segs[i].ds_addr, buf->segs[i].ds_tlen));
++ pci_unmap_single(sc->sc_pcidev, buf->segs[i].ds_addr,
++ buf->segs[i].ds_tlen, PCI_DMA_BIDIRECTIONAL);
++ DPRINTF(("%s - unmap %d 0x%x %d done\n", __FUNCTION__, i, buf->segs[i].ds_addr, buf->segs[i].ds_tlen));
++ }
++ buf->segs[i].ds_addr = 0;
++ buf->segs[i].ds_len = 0;
++ buf->segs[i].ds_tlen = 0;
++ }
++ buf->nsegs = 0;
++ buf->mapsize = 0;
++ buf->map = 0;
++}
++
++
++/*
++ * SafeXcel Interrupt routine
++ */
++static irqreturn_t
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++safe_intr(int irq, void *arg)
++#else
++safe_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct safe_softc *sc = arg;
++ int stat;
++ unsigned long flags;
++
++ stat = READ_REG(sc, SAFE_HM_STAT);
++
++ DPRINTF(("%s(stat=0x%x)\n", __FUNCTION__, stat));
++
++ if (stat == 0) /* shared irq, not for us */
++ return IRQ_NONE;
++
++ WRITE_REG(sc, SAFE_HI_CLR, stat); /* IACK */
++
++ if ((stat & SAFE_INT_PE_DDONE)) {
++ /*
++ * Descriptor(s) done; scan the ring and
++ * process completed operations.
++ */
++ spin_lock_irqsave(&sc->sc_ringmtx, flags);
++ while (sc->sc_back != sc->sc_front) {
++ struct safe_ringentry *re = sc->sc_back;
++
++#ifdef SAFE_DEBUG
++ if (debug) {
++ safe_dump_ringstate(sc, __func__);
++ safe_dump_request(sc, __func__, re);
++ }
++#endif
++ /*
++ * safe_process marks ring entries that were allocated
++ * but not used with a csr of zero. This insures the
++ * ring front pointer never needs to be set backwards
++ * in the event that an entry is allocated but not used
++ * because of a setup error.
++ */
++ DPRINTF(("%s re->re_desc.d_csr=0x%x\n", __FUNCTION__, re->re_desc.d_csr));
++ if (re->re_desc.d_csr != 0) {
++ if (!SAFE_PE_CSR_IS_DONE(re->re_desc.d_csr)) {
++ DPRINTF(("%s !CSR_IS_DONE\n", __FUNCTION__));
++ break;
++ }
++ if (!SAFE_PE_LEN_IS_DONE(re->re_desc.d_len)) {
++ DPRINTF(("%s !LEN_IS_DONE\n", __FUNCTION__));
++ break;
++ }
++ sc->sc_nqchip--;
++ safe_callback(sc, re);
++ }
++ if (++(sc->sc_back) == sc->sc_ringtop)
++ sc->sc_back = sc->sc_ring;
++ }
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ }
++
++ /*
++ * Check to see if we got any DMA Error
++ */
++ if (stat & SAFE_INT_PE_ERROR) {
++ printk("%s: dmaerr dmastat %08x\n", device_get_nameunit(sc->sc_dev),
++ (int)READ_REG(sc, SAFE_PE_DMASTAT));
++ safestats.st_dmaerr++;
++ safe_totalreset(sc);
++#if 0
++ safe_feed(sc);
++#endif
++ }
++
++ if (sc->sc_needwakeup) { /* XXX check high watermark */
++ int wakeup = sc->sc_needwakeup & (CRYPTO_SYMQ|CRYPTO_ASYMQ);
++ DPRINTF(("%s: wakeup crypto %x\n", __func__,
++ sc->sc_needwakeup));
++ sc->sc_needwakeup &= ~wakeup;
++ crypto_unblock(sc->sc_cid, wakeup);
++ }
++
++ return IRQ_HANDLED;
++}
++
++/*
++ * safe_feed() - post a request to chip
++ */
++static void
++safe_feed(struct safe_softc *sc, struct safe_ringentry *re)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++#ifdef SAFE_DEBUG
++ if (debug) {
++ safe_dump_ringstate(sc, __func__);
++ safe_dump_request(sc, __func__, re);
++ }
++#endif
++ sc->sc_nqchip++;
++ if (sc->sc_nqchip > safestats.st_maxqchip)
++ safestats.st_maxqchip = sc->sc_nqchip;
++ /* poke h/w to check descriptor ring, any value can be written */
++ WRITE_REG(sc, SAFE_HI_RD_DESCR, 0);
++}
++
++#define N(a) (sizeof(a) / sizeof (a[0]))
++static void
++safe_setup_enckey(struct safe_session *ses, caddr_t key)
++{
++ int i;
++
++ bcopy(key, ses->ses_key, ses->ses_klen / 8);
++
++ /* PE is little-endian, insure proper byte order */
++ for (i = 0; i < N(ses->ses_key); i++)
++ ses->ses_key[i] = htole32(ses->ses_key[i]);
++}
++
++static void
++safe_setup_mackey(struct safe_session *ses, int algo, caddr_t key, int klen)
++{
++#ifdef HMAC_HACK
++ MD5_CTX md5ctx;
++ SHA1_CTX sha1ctx;
++ int i;
++
++
++ for (i = 0; i < klen; i++)
++ key[i] ^= HMAC_IPAD_VAL;
++
++ if (algo == CRYPTO_MD5_HMAC) {
++ MD5Init(&md5ctx);
++ MD5Update(&md5ctx, key, klen);
++ MD5Update(&md5ctx, hmac_ipad_buffer, MD5_HMAC_BLOCK_LEN - klen);
++ bcopy(md5ctx.md5_st8, ses->ses_hminner, sizeof(md5ctx.md5_st8));
++ } else {
++ SHA1Init(&sha1ctx);
++ SHA1Update(&sha1ctx, key, klen);
++ SHA1Update(&sha1ctx, hmac_ipad_buffer,
++ SHA1_HMAC_BLOCK_LEN - klen);
++ bcopy(sha1ctx.h.b32, ses->ses_hminner, sizeof(sha1ctx.h.b32));
++ }
++
++ for (i = 0; i < klen; i++)
++ key[i] ^= (HMAC_IPAD_VAL ^ HMAC_OPAD_VAL);
++
++ if (algo == CRYPTO_MD5_HMAC) {
++ MD5Init(&md5ctx);
++ MD5Update(&md5ctx, key, klen);
++ MD5Update(&md5ctx, hmac_opad_buffer, MD5_HMAC_BLOCK_LEN - klen);
++ bcopy(md5ctx.md5_st8, ses->ses_hmouter, sizeof(md5ctx.md5_st8));
++ } else {
++ SHA1Init(&sha1ctx);
++ SHA1Update(&sha1ctx, key, klen);
++ SHA1Update(&sha1ctx, hmac_opad_buffer,
++ SHA1_HMAC_BLOCK_LEN - klen);
++ bcopy(sha1ctx.h.b32, ses->ses_hmouter, sizeof(sha1ctx.h.b32));
++ }
++
++ for (i = 0; i < klen; i++)
++ key[i] ^= HMAC_OPAD_VAL;
++
++#if 0
++ /*
++ * this code prevents SHA working on a BE host,
++ * so it is obviously wrong. I think the byte
++ * swap setup we do with the chip fixes this for us
++ */
++
++ /* PE is little-endian, insure proper byte order */
++ for (i = 0; i < N(ses->ses_hminner); i++) {
++ ses->ses_hminner[i] = htole32(ses->ses_hminner[i]);
++ ses->ses_hmouter[i] = htole32(ses->ses_hmouter[i]);
++ }
++#endif
++#else /* HMAC_HACK */
++ printk("safe: md5/sha not implemented\n");
++#endif /* HMAC_HACK */
++}
++#undef N
++
++/*
++ * Allocate a new 'session' and return an encoded session id. 'sidp'
++ * contains our registration id, and should contain an encoded session
++ * id on successful allocation.
++ */
++static int
++safe_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ struct cryptoini *c, *encini = NULL, *macini = NULL;
++ struct safe_session *ses = NULL;
++ int sesn;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sidp == NULL || cri == NULL || sc == NULL)
++ return (EINVAL);
++
++ for (c = cri; c != NULL; c = c->cri_next) {
++ if (c->cri_alg == CRYPTO_MD5_HMAC ||
++ c->cri_alg == CRYPTO_SHA1_HMAC ||
++ c->cri_alg == CRYPTO_NULL_HMAC) {
++ if (macini)
++ return (EINVAL);
++ macini = c;
++ } else if (c->cri_alg == CRYPTO_DES_CBC ||
++ c->cri_alg == CRYPTO_3DES_CBC ||
++ c->cri_alg == CRYPTO_AES_CBC ||
++ c->cri_alg == CRYPTO_NULL_CBC) {
++ if (encini)
++ return (EINVAL);
++ encini = c;
++ } else
++ return (EINVAL);
++ }
++ if (encini == NULL && macini == NULL)
++ return (EINVAL);
++ if (encini) { /* validate key length */
++ switch (encini->cri_alg) {
++ case CRYPTO_DES_CBC:
++ if (encini->cri_klen != 64)
++ return (EINVAL);
++ break;
++ case CRYPTO_3DES_CBC:
++ if (encini->cri_klen != 192)
++ return (EINVAL);
++ break;
++ case CRYPTO_AES_CBC:
++ if (encini->cri_klen != 128 &&
++ encini->cri_klen != 192 &&
++ encini->cri_klen != 256)
++ return (EINVAL);
++ break;
++ }
++ }
++
++ if (sc->sc_sessions == NULL) {
++ ses = sc->sc_sessions = (struct safe_session *)
++ kmalloc(sizeof(struct safe_session), SLAB_ATOMIC);
++ if (ses == NULL)
++ return (ENOMEM);
++ memset(ses, 0, sizeof(struct safe_session));
++ sesn = 0;
++ sc->sc_nsessions = 1;
++ } else {
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (sc->sc_sessions[sesn].ses_used == 0) {
++ ses = &sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ sesn = sc->sc_nsessions;
++ ses = (struct safe_session *)
++ kmalloc((sesn + 1) * sizeof(struct safe_session), SLAB_ATOMIC);
++ if (ses == NULL)
++ return (ENOMEM);
++ memset(ses, 0, (sesn + 1) * sizeof(struct safe_session));
++ bcopy(sc->sc_sessions, ses, sesn *
++ sizeof(struct safe_session));
++ bzero(sc->sc_sessions, sesn *
++ sizeof(struct safe_session));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = ses;
++ ses = &sc->sc_sessions[sesn];
++ sc->sc_nsessions++;
++ }
++ }
++
++ bzero(ses, sizeof(struct safe_session));
++ ses->ses_used = 1;
++
++ if (encini) {
++ /* get an IV */
++ /* XXX may read fewer than requested */
++ read_random(ses->ses_iv, sizeof(ses->ses_iv));
++
++ ses->ses_klen = encini->cri_klen;
++ if (encini->cri_key != NULL)
++ safe_setup_enckey(ses, encini->cri_key);
++ }
++
++ if (macini) {
++ ses->ses_mlen = macini->cri_mlen;
++ if (ses->ses_mlen == 0) {
++ if (macini->cri_alg == CRYPTO_MD5_HMAC)
++ ses->ses_mlen = MD5_HASH_LEN;
++ else
++ ses->ses_mlen = SHA1_HASH_LEN;
++ }
++
++ if (macini->cri_key != NULL) {
++ safe_setup_mackey(ses, macini->cri_alg, macini->cri_key,
++ macini->cri_klen / 8);
++ }
++ }
++
++ *sidp = SAFE_SID(device_get_unit(sc->sc_dev), sesn);
++ return (0);
++}
++
++/*
++ * Deallocate a session.
++ */
++static int
++safe_freesession(device_t dev, u_int64_t tid)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ int session, ret;
++ u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sc == NULL)
++ return (EINVAL);
++
++ session = SAFE_SESSION(sid);
++ if (session < sc->sc_nsessions) {
++ bzero(&sc->sc_sessions[session], sizeof(sc->sc_sessions[session]));
++ ret = 0;
++ } else
++ ret = EINVAL;
++ return (ret);
++}
++
++
++static int
++safe_process(device_t dev, struct cryptop *crp, int hint)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ int err = 0, i, nicealign, uniform;
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++ int bypass, oplen, ivsize;
++ caddr_t iv;
++ int16_t coffset;
++ struct safe_session *ses;
++ struct safe_ringentry *re;
++ struct safe_sarec *sa;
++ struct safe_pdesc *pd;
++ u_int32_t cmd0, cmd1, staterec;
++ unsigned long flags;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (crp == NULL || crp->crp_callback == NULL || sc == NULL) {
++ safestats.st_invalid++;
++ return (EINVAL);
++ }
++ if (SAFE_SESSION(crp->crp_sid) >= sc->sc_nsessions) {
++ safestats.st_badsession++;
++ return (EINVAL);
++ }
++
++ spin_lock_irqsave(&sc->sc_ringmtx, flags);
++ if (sc->sc_front == sc->sc_back && sc->sc_nqchip != 0) {
++ safestats.st_ringfull++;
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ return (ERESTART);
++ }
++ re = sc->sc_front;
++
++ staterec = re->re_sa.sa_staterec; /* save */
++ /* NB: zero everything but the PE descriptor */
++ bzero(&re->re_sa, sizeof(struct safe_ringentry) - sizeof(re->re_desc));
++ re->re_sa.sa_staterec = staterec; /* restore */
++
++ re->re_crp = crp;
++ re->re_sesn = SAFE_SESSION(crp->crp_sid);
++
++ re->re_src.nsegs = 0;
++ re->re_dst.nsegs = 0;
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ re->re_src_skb = (struct sk_buff *)crp->crp_buf;
++ re->re_dst_skb = (struct sk_buff *)crp->crp_buf;
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ re->re_src_io = (struct uio *)crp->crp_buf;
++ re->re_dst_io = (struct uio *)crp->crp_buf;
++ } else {
++ safestats.st_badflags++;
++ err = EINVAL;
++ goto errout; /* XXX we don't handle contiguous blocks! */
++ }
++
++ sa = &re->re_sa;
++ ses = &sc->sc_sessions[re->re_sesn];
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ safestats.st_nodesc++;
++ err = EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++
++ cmd0 = SAFE_SA_CMD0_BASIC; /* basic group operation */
++ cmd1 = 0;
++ if (crd2 == NULL) {
++ if (crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_NULL_HMAC) {
++ maccrd = crd1;
++ enccrd = NULL;
++ cmd0 |= SAFE_SA_CMD0_OP_HASH;
++ } else if (crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_NULL_CBC) {
++ maccrd = NULL;
++ enccrd = crd1;
++ cmd0 |= SAFE_SA_CMD0_OP_CRYPT;
++ } else {
++ safestats.st_badalg++;
++ err = EINVAL;
++ goto errout;
++ }
++ } else {
++ if ((crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_NULL_HMAC) &&
++ (crd2->crd_alg == CRYPTO_DES_CBC ||
++ crd2->crd_alg == CRYPTO_3DES_CBC ||
++ crd2->crd_alg == CRYPTO_AES_CBC ||
++ crd2->crd_alg == CRYPTO_NULL_CBC) &&
++ ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) {
++ maccrd = crd1;
++ enccrd = crd2;
++ } else if ((crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_NULL_CBC) &&
++ (crd2->crd_alg == CRYPTO_MD5_HMAC ||
++ crd2->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd2->crd_alg == CRYPTO_NULL_HMAC) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT)) {
++ enccrd = crd1;
++ maccrd = crd2;
++ } else {
++ safestats.st_badalg++;
++ err = EINVAL;
++ goto errout;
++ }
++ cmd0 |= SAFE_SA_CMD0_OP_BOTH;
++ }
++
++ if (enccrd) {
++ if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT)
++ safe_setup_enckey(ses, enccrd->crd_key);
++
++ if (enccrd->crd_alg == CRYPTO_DES_CBC) {
++ cmd0 |= SAFE_SA_CMD0_DES;
++ cmd1 |= SAFE_SA_CMD1_CBC;
++ ivsize = 2*sizeof(u_int32_t);
++ } else if (enccrd->crd_alg == CRYPTO_3DES_CBC) {
++ cmd0 |= SAFE_SA_CMD0_3DES;
++ cmd1 |= SAFE_SA_CMD1_CBC;
++ ivsize = 2*sizeof(u_int32_t);
++ } else if (enccrd->crd_alg == CRYPTO_AES_CBC) {
++ cmd0 |= SAFE_SA_CMD0_AES;
++ cmd1 |= SAFE_SA_CMD1_CBC;
++ if (ses->ses_klen == 128)
++ cmd1 |= SAFE_SA_CMD1_AES128;
++ else if (ses->ses_klen == 192)
++ cmd1 |= SAFE_SA_CMD1_AES192;
++ else
++ cmd1 |= SAFE_SA_CMD1_AES256;
++ ivsize = 4*sizeof(u_int32_t);
++ } else {
++ cmd0 |= SAFE_SA_CMD0_CRYPT_NULL;
++ ivsize = 0;
++ }
++
++ /*
++ * Setup encrypt/decrypt state. When using basic ops
++ * we can't use an inline IV because hash/crypt offset
++ * must be from the end of the IV to the start of the
++ * crypt data and this leaves out the preceding header
++ * from the hash calculation. Instead we place the IV
++ * in the state record and set the hash/crypt offset to
++ * copy both the header+IV.
++ */
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ cmd0 |= SAFE_SA_CMD0_OUTBOUND;
++
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ iv = enccrd->crd_iv;
++ else
++ iv = (caddr_t) ses->ses_iv;
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, iv);
++ }
++ bcopy(iv, re->re_sastate.sa_saved_iv, ivsize);
++ /* make iv LE */
++ for (i = 0; i < ivsize/sizeof(re->re_sastate.sa_saved_iv[0]); i++)
++ re->re_sastate.sa_saved_iv[i] =
++ cpu_to_le32(re->re_sastate.sa_saved_iv[i]);
++ cmd0 |= SAFE_SA_CMD0_IVLD_STATE | SAFE_SA_CMD0_SAVEIV;
++ re->re_flags |= SAFE_QFLAGS_COPYOUTIV;
++ } else {
++ cmd0 |= SAFE_SA_CMD0_INBOUND;
++
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT) {
++ bcopy(enccrd->crd_iv,
++ re->re_sastate.sa_saved_iv, ivsize);
++ } else {
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize,
++ (caddr_t)re->re_sastate.sa_saved_iv);
++ }
++ /* make iv LE */
++ for (i = 0; i < ivsize/sizeof(re->re_sastate.sa_saved_iv[0]); i++)
++ re->re_sastate.sa_saved_iv[i] =
++ cpu_to_le32(re->re_sastate.sa_saved_iv[i]);
++ cmd0 |= SAFE_SA_CMD0_IVLD_STATE;
++ }
++ /*
++ * For basic encryption use the zero pad algorithm.
++ * This pads results to an 8-byte boundary and
++ * suppresses padding verification for inbound (i.e.
++ * decrypt) operations.
++ *
++ * NB: Not sure if the 8-byte pad boundary is a problem.
++ */
++ cmd0 |= SAFE_SA_CMD0_PAD_ZERO;
++
++ /* XXX assert key bufs have the same size */
++ bcopy(ses->ses_key, sa->sa_key, sizeof(sa->sa_key));
++ }
++
++ if (maccrd) {
++ if (maccrd->crd_flags & CRD_F_KEY_EXPLICIT) {
++ safe_setup_mackey(ses, maccrd->crd_alg,
++ maccrd->crd_key, maccrd->crd_klen / 8);
++ }
++
++ if (maccrd->crd_alg == CRYPTO_MD5_HMAC) {
++ cmd0 |= SAFE_SA_CMD0_MD5;
++ cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */
++ } else if (maccrd->crd_alg == CRYPTO_SHA1_HMAC) {
++ cmd0 |= SAFE_SA_CMD0_SHA1;
++ cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */
++ } else {
++ cmd0 |= SAFE_SA_CMD0_HASH_NULL;
++ }
++ /*
++ * Digest data is loaded from the SA and the hash
++ * result is saved to the state block where we
++ * retrieve it for return to the caller.
++ */
++ /* XXX assert digest bufs have the same size */
++ bcopy(ses->ses_hminner, sa->sa_indigest,
++ sizeof(sa->sa_indigest));
++ bcopy(ses->ses_hmouter, sa->sa_outdigest,
++ sizeof(sa->sa_outdigest));
++
++ cmd0 |= SAFE_SA_CMD0_HSLD_SA | SAFE_SA_CMD0_SAVEHASH;
++ re->re_flags |= SAFE_QFLAGS_COPYOUTICV;
++ }
++
++ if (enccrd && maccrd) {
++ /*
++ * The offset from hash data to the start of
++ * crypt data is the difference in the skips.
++ */
++ bypass = maccrd->crd_skip;
++ coffset = enccrd->crd_skip - maccrd->crd_skip;
++ if (coffset < 0) {
++ DPRINTF(("%s: hash does not precede crypt; "
++ "mac skip %u enc skip %u\n",
++ __func__, maccrd->crd_skip, enccrd->crd_skip));
++ safestats.st_skipmismatch++;
++ err = EINVAL;
++ goto errout;
++ }
++ oplen = enccrd->crd_skip + enccrd->crd_len;
++ if (maccrd->crd_skip + maccrd->crd_len != oplen) {
++ DPRINTF(("%s: hash amount %u != crypt amount %u\n",
++ __func__, maccrd->crd_skip + maccrd->crd_len,
++ oplen));
++ safestats.st_lenmismatch++;
++ err = EINVAL;
++ goto errout;
++ }
++#ifdef SAFE_DEBUG
++ if (debug) {
++ printf("mac: skip %d, len %d, inject %d\n",
++ maccrd->crd_skip, maccrd->crd_len,
++ maccrd->crd_inject);
++ printf("enc: skip %d, len %d, inject %d\n",
++ enccrd->crd_skip, enccrd->crd_len,
++ enccrd->crd_inject);
++ printf("bypass %d coffset %d oplen %d\n",
++ bypass, coffset, oplen);
++ }
++#endif
++ if (coffset & 3) { /* offset must be 32-bit aligned */
++ DPRINTF(("%s: coffset %u misaligned\n",
++ __func__, coffset));
++ safestats.st_coffmisaligned++;
++ err = EINVAL;
++ goto errout;
++ }
++ coffset >>= 2;
++ if (coffset > 255) { /* offset must be <256 dwords */
++ DPRINTF(("%s: coffset %u too big\n",
++ __func__, coffset));
++ safestats.st_cofftoobig++;
++ err = EINVAL;
++ goto errout;
++ }
++ /*
++ * Tell the hardware to copy the header to the output.
++ * The header is defined as the data from the end of
++ * the bypass to the start of data to be encrypted.
++ * Typically this is the inline IV. Note that you need
++ * to do this even if src+dst are the same; it appears
++ * that w/o this bit the crypted data is written
++ * immediately after the bypass data.
++ */
++ cmd1 |= SAFE_SA_CMD1_HDRCOPY;
++ /*
++ * Disable IP header mutable bit handling. This is
++ * needed to get correct HMAC calculations.
++ */
++ cmd1 |= SAFE_SA_CMD1_MUTABLE;
++ } else {
++ if (enccrd) {
++ bypass = enccrd->crd_skip;
++ oplen = bypass + enccrd->crd_len;
++ } else {
++ bypass = maccrd->crd_skip;
++ oplen = bypass + maccrd->crd_len;
++ }
++ coffset = 0;
++ }
++ /* XXX verify multiple of 4 when using s/g */
++ if (bypass > 96) { /* bypass offset must be <= 96 bytes */
++ DPRINTF(("%s: bypass %u too big\n", __func__, bypass));
++ safestats.st_bypasstoobig++;
++ err = EINVAL;
++ goto errout;
++ }
++
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ if (pci_map_skb(sc, &re->re_src, re->re_src_skb)) {
++ safestats.st_noload++;
++ err = ENOMEM;
++ goto errout;
++ }
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ if (pci_map_uio(sc, &re->re_src, re->re_src_io)) {
++ safestats.st_noload++;
++ err = ENOMEM;
++ goto errout;
++ }
++ }
++ nicealign = safe_dmamap_aligned(sc, &re->re_src);
++ uniform = safe_dmamap_uniform(sc, &re->re_src);
++
++ DPRINTF(("src nicealign %u uniform %u nsegs %u\n",
++ nicealign, uniform, re->re_src.nsegs));
++ if (re->re_src.nsegs > 1) {
++ re->re_desc.d_src = sc->sc_spalloc.dma_paddr +
++ ((caddr_t) sc->sc_spfree - (caddr_t) sc->sc_spring);
++ for (i = 0; i < re->re_src_nsegs; i++) {
++ /* NB: no need to check if there's space */
++ pd = sc->sc_spfree;
++ if (++(sc->sc_spfree) == sc->sc_springtop)
++ sc->sc_spfree = sc->sc_spring;
++
++ KASSERT((pd->pd_flags&3) == 0 ||
++ (pd->pd_flags&3) == SAFE_PD_DONE,
++ ("bogus source particle descriptor; flags %x",
++ pd->pd_flags));
++ pd->pd_addr = re->re_src_segs[i].ds_addr;
++ pd->pd_size = re->re_src_segs[i].ds_len;
++ pd->pd_flags = SAFE_PD_READY;
++ }
++ cmd0 |= SAFE_SA_CMD0_IGATHER;
++ } else {
++ /*
++ * No need for gather, reference the operand directly.
++ */
++ re->re_desc.d_src = re->re_src_segs[0].ds_addr;
++ }
++
++ if (enccrd == NULL && maccrd != NULL) {
++ /*
++ * Hash op; no destination needed.
++ */
++ } else {
++ if (crp->crp_flags & (CRYPTO_F_IOV|CRYPTO_F_SKBUF)) {
++ if (!nicealign) {
++ safestats.st_iovmisaligned++;
++ err = EINVAL;
++ goto errout;
++ }
++ if (uniform != 1) {
++ device_printf(sc->sc_dev, "!uniform source\n");
++ if (!uniform) {
++ /*
++ * There's no way to handle the DMA
++ * requirements with this uio. We
++ * could create a separate DMA area for
++ * the result and then copy it back,
++ * but for now we just bail and return
++ * an error. Note that uio requests
++ * > SAFE_MAX_DSIZE are handled because
++ * the DMA map and segment list for the
++ * destination wil result in a
++ * destination particle list that does
++ * the necessary scatter DMA.
++ */
++ safestats.st_iovnotuniform++;
++ err = EINVAL;
++ goto errout;
++ }
++ } else
++ re->re_dst = re->re_src;
++ } else {
++ safestats.st_badflags++;
++ err = EINVAL;
++ goto errout;
++ }
++
++ if (re->re_dst.nsegs > 1) {
++ re->re_desc.d_dst = sc->sc_dpalloc.dma_paddr +
++ ((caddr_t) sc->sc_dpfree - (caddr_t) sc->sc_dpring);
++ for (i = 0; i < re->re_dst_nsegs; i++) {
++ pd = sc->sc_dpfree;
++ KASSERT((pd->pd_flags&3) == 0 ||
++ (pd->pd_flags&3) == SAFE_PD_DONE,
++ ("bogus dest particle descriptor; flags %x",
++ pd->pd_flags));
++ if (++(sc->sc_dpfree) == sc->sc_dpringtop)
++ sc->sc_dpfree = sc->sc_dpring;
++ pd->pd_addr = re->re_dst_segs[i].ds_addr;
++ pd->pd_flags = SAFE_PD_READY;
++ }
++ cmd0 |= SAFE_SA_CMD0_OSCATTER;
++ } else {
++ /*
++ * No need for scatter, reference the operand directly.
++ */
++ re->re_desc.d_dst = re->re_dst_segs[0].ds_addr;
++ }
++ }
++
++ /*
++ * All done with setup; fillin the SA command words
++ * and the packet engine descriptor. The operation
++ * is now ready for submission to the hardware.
++ */
++ sa->sa_cmd0 = cmd0 | SAFE_SA_CMD0_IPCI | SAFE_SA_CMD0_OPCI;
++ sa->sa_cmd1 = cmd1
++ | (coffset << SAFE_SA_CMD1_OFFSET_S)
++ | SAFE_SA_CMD1_SAREV1 /* Rev 1 SA data structure */
++ | SAFE_SA_CMD1_SRPCI
++ ;
++ /*
++ * NB: the order of writes is important here. In case the
++ * chip is scanning the ring because of an outstanding request
++ * it might nab this one too. In that case we need to make
++ * sure the setup is complete before we write the length
++ * field of the descriptor as it signals the descriptor is
++ * ready for processing.
++ */
++ re->re_desc.d_csr = SAFE_PE_CSR_READY | SAFE_PE_CSR_SAPCI;
++ if (maccrd)
++ re->re_desc.d_csr |= SAFE_PE_CSR_LOADSA | SAFE_PE_CSR_HASHFINAL;
++ wmb();
++ re->re_desc.d_len = oplen
++ | SAFE_PE_LEN_READY
++ | (bypass << SAFE_PE_LEN_BYPASS_S)
++ ;
++
++ safestats.st_ipackets++;
++ safestats.st_ibytes += oplen;
++
++ if (++(sc->sc_front) == sc->sc_ringtop)
++ sc->sc_front = sc->sc_ring;
++
++ /* XXX honor batching */
++ safe_feed(sc, re);
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ return (0);
++
++errout:
++ if (re->re_src.map != re->re_dst.map)
++ pci_unmap_operand(sc, &re->re_dst);
++ if (re->re_src.map)
++ pci_unmap_operand(sc, &re->re_src);
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++ if (err != ERESTART) {
++ crp->crp_etype = err;
++ crypto_done(crp);
++ } else {
++ sc->sc_needwakeup |= CRYPTO_SYMQ;
++ }
++ return (err);
++}
++
++static void
++safe_callback(struct safe_softc *sc, struct safe_ringentry *re)
++{
++ struct cryptop *crp = (struct cryptop *)re->re_crp;
++ struct cryptodesc *crd;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ safestats.st_opackets++;
++ safestats.st_obytes += re->re_dst.mapsize;
++
++ if (re->re_desc.d_csr & SAFE_PE_CSR_STATUS) {
++ device_printf(sc->sc_dev, "csr 0x%x cmd0 0x%x cmd1 0x%x\n",
++ re->re_desc.d_csr,
++ re->re_sa.sa_cmd0, re->re_sa.sa_cmd1);
++ safestats.st_peoperr++;
++ crp->crp_etype = EIO; /* something more meaningful? */
++ }
++
++ if (re->re_dst.map != NULL && re->re_dst.map != re->re_src.map)
++ pci_unmap_operand(sc, &re->re_dst);
++ pci_unmap_operand(sc, &re->re_src);
++
++ /*
++ * If result was written to a differet mbuf chain, swap
++ * it in as the return value and reclaim the original.
++ */
++ if ((crp->crp_flags & CRYPTO_F_SKBUF) && re->re_src_skb != re->re_dst_skb) {
++ device_printf(sc->sc_dev, "no CRYPTO_F_SKBUF swapping support\n");
++ /* kfree_skb(skb) */
++ /* crp->crp_buf = (caddr_t)re->re_dst_skb */
++ return;
++ }
++
++ if (re->re_flags & SAFE_QFLAGS_COPYOUTIV) {
++ /* copy out IV for future use */
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ int i;
++ int ivsize;
++
++ if (crd->crd_alg == CRYPTO_DES_CBC ||
++ crd->crd_alg == CRYPTO_3DES_CBC) {
++ ivsize = 2*sizeof(u_int32_t);
++ } else if (crd->crd_alg == CRYPTO_AES_CBC) {
++ ivsize = 4*sizeof(u_int32_t);
++ } else
++ continue;
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ crd->crd_skip + crd->crd_len - ivsize, ivsize,
++ (caddr_t)sc->sc_sessions[re->re_sesn].ses_iv);
++ for (i = 0;
++ i < ivsize/sizeof(sc->sc_sessions[re->re_sesn].ses_iv[0]);
++ i++)
++ sc->sc_sessions[re->re_sesn].ses_iv[i] =
++ cpu_to_le32(sc->sc_sessions[re->re_sesn].ses_iv[i]);
++ break;
++ }
++ }
++
++ if (re->re_flags & SAFE_QFLAGS_COPYOUTICV) {
++ /* copy out ICV result */
++ for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
++ if (!(crd->crd_alg == CRYPTO_MD5_HMAC ||
++ crd->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd->crd_alg == CRYPTO_NULL_HMAC))
++ continue;
++ if (crd->crd_alg == CRYPTO_SHA1_HMAC) {
++ /*
++ * SHA-1 ICV's are byte-swapped; fix 'em up
++ * before copy them to their destination.
++ */
++ re->re_sastate.sa_saved_indigest[0] =
++ cpu_to_be32(re->re_sastate.sa_saved_indigest[0]);
++ re->re_sastate.sa_saved_indigest[1] =
++ cpu_to_be32(re->re_sastate.sa_saved_indigest[1]);
++ re->re_sastate.sa_saved_indigest[2] =
++ cpu_to_be32(re->re_sastate.sa_saved_indigest[2]);
++ } else {
++ re->re_sastate.sa_saved_indigest[0] =
++ cpu_to_le32(re->re_sastate.sa_saved_indigest[0]);
++ re->re_sastate.sa_saved_indigest[1] =
++ cpu_to_le32(re->re_sastate.sa_saved_indigest[1]);
++ re->re_sastate.sa_saved_indigest[2] =
++ cpu_to_le32(re->re_sastate.sa_saved_indigest[2]);
++ }
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ crd->crd_inject,
++ sc->sc_sessions[re->re_sesn].ses_mlen,
++ (caddr_t)re->re_sastate.sa_saved_indigest);
++ break;
++ }
++ }
++ crypto_done(crp);
++}
++
++
++#if defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG)
++#define SAFE_RNG_MAXWAIT 1000
++
++static void
++safe_rng_init(struct safe_softc *sc)
++{
++ u_int32_t w, v;
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ WRITE_REG(sc, SAFE_RNG_CTRL, 0);
++ /* use default value according to the manual */
++ WRITE_REG(sc, SAFE_RNG_CNFG, 0x834); /* magic from SafeNet */
++ WRITE_REG(sc, SAFE_RNG_ALM_CNT, 0);
++
++ /*
++ * There is a bug in rev 1.0 of the 1140 that when the RNG
++ * is brought out of reset the ready status flag does not
++ * work until the RNG has finished its internal initialization.
++ *
++ * So in order to determine the device is through its
++ * initialization we must read the data register, using the
++ * status reg in the read in case it is initialized. Then read
++ * the data register until it changes from the first read.
++ * Once it changes read the data register until it changes
++ * again. At this time the RNG is considered initialized.
++ * This could take between 750ms - 1000ms in time.
++ */
++ i = 0;
++ w = READ_REG(sc, SAFE_RNG_OUT);
++ do {
++ v = READ_REG(sc, SAFE_RNG_OUT);
++ if (v != w) {
++ w = v;
++ break;
++ }
++ DELAY(10);
++ } while (++i < SAFE_RNG_MAXWAIT);
++
++ /* Wait Until data changes again */
++ i = 0;
++ do {
++ v = READ_REG(sc, SAFE_RNG_OUT);
++ if (v != w)
++ break;
++ DELAY(10);
++ } while (++i < SAFE_RNG_MAXWAIT);
++}
++
++static __inline void
++safe_rng_disable_short_cycle(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ WRITE_REG(sc, SAFE_RNG_CTRL,
++ READ_REG(sc, SAFE_RNG_CTRL) &~ SAFE_RNG_CTRL_SHORTEN);
++}
++
++static __inline void
++safe_rng_enable_short_cycle(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ WRITE_REG(sc, SAFE_RNG_CTRL,
++ READ_REG(sc, SAFE_RNG_CTRL) | SAFE_RNG_CTRL_SHORTEN);
++}
++
++static __inline u_int32_t
++safe_rng_read(struct safe_softc *sc)
++{
++ int i;
++
++ i = 0;
++ while (READ_REG(sc, SAFE_RNG_STAT) != 0 && ++i < SAFE_RNG_MAXWAIT)
++ ;
++ return READ_REG(sc, SAFE_RNG_OUT);
++}
++
++static int
++safe_read_random(void *arg, u_int32_t *buf, int maxwords)
++{
++ struct safe_softc *sc = (struct safe_softc *) arg;
++ int i, rc;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ safestats.st_rng++;
++ /*
++ * Fetch the next block of data.
++ */
++ if (maxwords > safe_rngbufsize)
++ maxwords = safe_rngbufsize;
++ if (maxwords > SAFE_RNG_MAXBUFSIZ)
++ maxwords = SAFE_RNG_MAXBUFSIZ;
++retry:
++ /* read as much as we can */
++ for (rc = 0; rc < maxwords; rc++) {
++ if (READ_REG(sc, SAFE_RNG_STAT) != 0)
++ break;
++ buf[rc] = READ_REG(sc, SAFE_RNG_OUT);
++ }
++ if (rc == 0)
++ return 0;
++ /*
++ * Check the comparator alarm count and reset the h/w if
++ * it exceeds our threshold. This guards against the
++ * hardware oscillators resonating with external signals.
++ */
++ if (READ_REG(sc, SAFE_RNG_ALM_CNT) > safe_rngmaxalarm) {
++ u_int32_t freq_inc, w;
++
++ DPRINTF(("%s: alarm count %u exceeds threshold %u\n", __func__,
++ (unsigned)READ_REG(sc, SAFE_RNG_ALM_CNT), safe_rngmaxalarm));
++ safestats.st_rngalarm++;
++ safe_rng_enable_short_cycle(sc);
++ freq_inc = 18;
++ for (i = 0; i < 64; i++) {
++ w = READ_REG(sc, SAFE_RNG_CNFG);
++ freq_inc = ((w + freq_inc) & 0x3fL);
++ w = ((w & ~0x3fL) | freq_inc);
++ WRITE_REG(sc, SAFE_RNG_CNFG, w);
++
++ WRITE_REG(sc, SAFE_RNG_ALM_CNT, 0);
++
++ (void) safe_rng_read(sc);
++ DELAY(25);
++
++ if (READ_REG(sc, SAFE_RNG_ALM_CNT) == 0) {
++ safe_rng_disable_short_cycle(sc);
++ goto retry;
++ }
++ freq_inc = 1;
++ }
++ safe_rng_disable_short_cycle(sc);
++ } else
++ WRITE_REG(sc, SAFE_RNG_ALM_CNT, 0);
++
++ return(rc);
++}
++#endif /* defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG) */
++
++
++/*
++ * Resets the board. Values in the regesters are left as is
++ * from the reset (i.e. initial values are assigned elsewhere).
++ */
++static void
++safe_reset_board(struct safe_softc *sc)
++{
++ u_int32_t v;
++ /*
++ * Reset the device. The manual says no delay
++ * is needed between marking and clearing reset.
++ */
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ v = READ_REG(sc, SAFE_PE_DMACFG) &~
++ (SAFE_PE_DMACFG_PERESET | SAFE_PE_DMACFG_PDRRESET |
++ SAFE_PE_DMACFG_SGRESET);
++ WRITE_REG(sc, SAFE_PE_DMACFG, v
++ | SAFE_PE_DMACFG_PERESET
++ | SAFE_PE_DMACFG_PDRRESET
++ | SAFE_PE_DMACFG_SGRESET);
++ WRITE_REG(sc, SAFE_PE_DMACFG, v);
++}
++
++/*
++ * Initialize registers we need to touch only once.
++ */
++static void
++safe_init_board(struct safe_softc *sc)
++{
++ u_int32_t v, dwords;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ v = READ_REG(sc, SAFE_PE_DMACFG);
++ v &=~ ( SAFE_PE_DMACFG_PEMODE
++ | SAFE_PE_DMACFG_FSENA /* failsafe enable */
++ | SAFE_PE_DMACFG_GPRPCI /* gather ring on PCI */
++ | SAFE_PE_DMACFG_SPRPCI /* scatter ring on PCI */
++ | SAFE_PE_DMACFG_ESDESC /* endian-swap descriptors */
++ | SAFE_PE_DMACFG_ESPDESC /* endian-swap part. desc's */
++ | SAFE_PE_DMACFG_ESSA /* endian-swap SA's */
++ | SAFE_PE_DMACFG_ESPACKET /* swap the packet data */
++ );
++ v |= SAFE_PE_DMACFG_FSENA /* failsafe enable */
++ | SAFE_PE_DMACFG_GPRPCI /* gather ring on PCI */
++ | SAFE_PE_DMACFG_SPRPCI /* scatter ring on PCI */
++ | SAFE_PE_DMACFG_ESDESC /* endian-swap descriptors */
++ | SAFE_PE_DMACFG_ESPDESC /* endian-swap part. desc's */
++ | SAFE_PE_DMACFG_ESSA /* endian-swap SA's */
++#if 0
++ | SAFE_PE_DMACFG_ESPACKET /* swap the packet data */
++#endif
++ ;
++ WRITE_REG(sc, SAFE_PE_DMACFG, v);
++
++#ifdef __BIG_ENDIAN
++ /* tell the safenet that we are 4321 and not 1234 */
++ WRITE_REG(sc, SAFE_ENDIAN, 0xe4e41b1b);
++#endif
++
++ if (sc->sc_chiprev == SAFE_REV(1,0)) {
++ /*
++ * Avoid large PCI DMA transfers. Rev 1.0 has a bug where
++ * "target mode transfers" done while the chip is DMA'ing
++ * >1020 bytes cause the hardware to lockup. To avoid this
++ * we reduce the max PCI transfer size and use small source
++ * particle descriptors (<= 256 bytes).
++ */
++ WRITE_REG(sc, SAFE_DMA_CFG, 256);
++ device_printf(sc->sc_dev,
++ "Reduce max DMA size to %u words for rev %u.%u WAR\n",
++ (unsigned) ((READ_REG(sc, SAFE_DMA_CFG)>>2) & 0xff),
++ (unsigned) SAFE_REV_MAJ(sc->sc_chiprev),
++ (unsigned) SAFE_REV_MIN(sc->sc_chiprev));
++ sc->sc_max_dsize = 256;
++ } else {
++ sc->sc_max_dsize = SAFE_MAX_DSIZE;
++ }
++
++ /* NB: operands+results are overlaid */
++ WRITE_REG(sc, SAFE_PE_PDRBASE, sc->sc_ringalloc.dma_paddr);
++ WRITE_REG(sc, SAFE_PE_RDRBASE, sc->sc_ringalloc.dma_paddr);
++ /*
++ * Configure ring entry size and number of items in the ring.
++ */
++ KASSERT((sizeof(struct safe_ringentry) % sizeof(u_int32_t)) == 0,
++ ("PE ring entry not 32-bit aligned!"));
++ dwords = sizeof(struct safe_ringentry) / sizeof(u_int32_t);
++ WRITE_REG(sc, SAFE_PE_RINGCFG,
++ (dwords << SAFE_PE_RINGCFG_OFFSET_S) | SAFE_MAX_NQUEUE);
++ WRITE_REG(sc, SAFE_PE_RINGPOLL, 0); /* disable polling */
++
++ WRITE_REG(sc, SAFE_PE_GRNGBASE, sc->sc_spalloc.dma_paddr);
++ WRITE_REG(sc, SAFE_PE_SRNGBASE, sc->sc_dpalloc.dma_paddr);
++ WRITE_REG(sc, SAFE_PE_PARTSIZE,
++ (SAFE_TOTAL_DPART<<16) | SAFE_TOTAL_SPART);
++ /*
++ * NB: destination particles are fixed size. We use
++ * an mbuf cluster and require all results go to
++ * clusters or smaller.
++ */
++ WRITE_REG(sc, SAFE_PE_PARTCFG, sc->sc_max_dsize);
++
++ /* it's now safe to enable PE mode, do it */
++ WRITE_REG(sc, SAFE_PE_DMACFG, v | SAFE_PE_DMACFG_PEMODE);
++
++ /*
++ * Configure hardware to use level-triggered interrupts and
++ * to interrupt after each descriptor is processed.
++ */
++ WRITE_REG(sc, SAFE_HI_CFG, SAFE_HI_CFG_LEVEL);
++ WRITE_REG(sc, SAFE_HI_CLR, 0xffffffff);
++ WRITE_REG(sc, SAFE_HI_DESC_CNT, 1);
++ WRITE_REG(sc, SAFE_HI_MASK, SAFE_INT_PE_DDONE | SAFE_INT_PE_ERROR);
++}
++
++
++/*
++ * Clean up after a chip crash.
++ * It is assumed that the caller in splimp()
++ */
++static void
++safe_cleanchip(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sc->sc_nqchip != 0) {
++ struct safe_ringentry *re = sc->sc_back;
++
++ while (re != sc->sc_front) {
++ if (re->re_desc.d_csr != 0)
++ safe_free_entry(sc, re);
++ if (++re == sc->sc_ringtop)
++ re = sc->sc_ring;
++ }
++ sc->sc_back = re;
++ sc->sc_nqchip = 0;
++ }
++}
++
++/*
++ * free a safe_q
++ * It is assumed that the caller is within splimp().
++ */
++static int
++safe_free_entry(struct safe_softc *sc, struct safe_ringentry *re)
++{
++ struct cryptop *crp;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ /*
++ * Free header MCR
++ */
++ if ((re->re_dst_skb != NULL) && (re->re_src_skb != re->re_dst_skb))
++#ifdef NOTYET
++ m_freem(re->re_dst_m);
++#else
++ printk("%s,%d: SKB not supported\n", __FILE__, __LINE__);
++#endif
++
++ crp = (struct cryptop *)re->re_crp;
++
++ re->re_desc.d_csr = 0;
++
++ crp->crp_etype = EFAULT;
++ crypto_done(crp);
++ return(0);
++}
++
++/*
++ * Routine to reset the chip and clean up.
++ * It is assumed that the caller is in splimp()
++ */
++static void
++safe_totalreset(struct safe_softc *sc)
++{
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ safe_reset_board(sc);
++ safe_init_board(sc);
++ safe_cleanchip(sc);
++}
++
++/*
++ * Is the operand suitable aligned for direct DMA. Each
++ * segment must be aligned on a 32-bit boundary and all
++ * but the last segment must be a multiple of 4 bytes.
++ */
++static int
++safe_dmamap_aligned(struct safe_softc *sc, const struct safe_operand *op)
++{
++ int i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ for (i = 0; i < op->nsegs; i++) {
++ if (op->segs[i].ds_addr & 3)
++ return (0);
++ if (i != (op->nsegs - 1) && (op->segs[i].ds_len & 3))
++ return (0);
++ }
++ return (1);
++}
++
++/*
++ * Is the operand suitable for direct DMA as the destination
++ * of an operation. The hardware requires that each ``particle''
++ * but the last in an operation result have the same size. We
++ * fix that size at SAFE_MAX_DSIZE bytes. This routine returns
++ * 0 if some segment is not a multiple of of this size, 1 if all
++ * segments are exactly this size, or 2 if segments are at worst
++ * a multple of this size.
++ */
++static int
++safe_dmamap_uniform(struct safe_softc *sc, const struct safe_operand *op)
++{
++ int result = 1;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (op->nsegs > 0) {
++ int i;
++
++ for (i = 0; i < op->nsegs-1; i++) {
++ if (op->segs[i].ds_len % sc->sc_max_dsize)
++ return (0);
++ if (op->segs[i].ds_len != sc->sc_max_dsize)
++ result = 2;
++ }
++ }
++ return (result);
++}
++
++static int
++safe_kprocess(device_t dev, struct cryptkop *krp, int hint)
++{
++ struct safe_softc *sc = device_get_softc(dev);
++ struct safe_pkq *q;
++ unsigned long flags;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (sc == NULL) {
++ krp->krp_status = EINVAL;
++ goto err;
++ }
++
++ if (krp->krp_op != CRK_MOD_EXP) {
++ krp->krp_status = EOPNOTSUPP;
++ goto err;
++ }
++
++ q = (struct safe_pkq *) kmalloc(sizeof(*q), GFP_KERNEL);
++ if (q == NULL) {
++ krp->krp_status = ENOMEM;
++ goto err;
++ }
++ memset(q, 0, sizeof(*q));
++ q->pkq_krp = krp;
++ INIT_LIST_HEAD(&q->pkq_list);
++
++ spin_lock_irqsave(&sc->sc_pkmtx, flags);
++ list_add_tail(&q->pkq_list, &sc->sc_pkq);
++ safe_kfeed(sc);
++ spin_unlock_irqrestore(&sc->sc_pkmtx, flags);
++ return (0);
++
++err:
++ crypto_kdone(krp);
++ return (0);
++}
++
++#define SAFE_CRK_PARAM_BASE 0
++#define SAFE_CRK_PARAM_EXP 1
++#define SAFE_CRK_PARAM_MOD 2
++
++static int
++safe_kstart(struct safe_softc *sc)
++{
++ struct cryptkop *krp = sc->sc_pkq_cur->pkq_krp;
++ int exp_bits, mod_bits, base_bits;
++ u_int32_t op, a_off, b_off, c_off, d_off;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (krp->krp_iparams < 3 || krp->krp_oparams != 1) {
++ krp->krp_status = EINVAL;
++ return (1);
++ }
++
++ base_bits = safe_ksigbits(sc, &krp->krp_param[SAFE_CRK_PARAM_BASE]);
++ if (base_bits > 2048)
++ goto too_big;
++ if (base_bits <= 0) /* 5. base not zero */
++ goto too_small;
++
++ exp_bits = safe_ksigbits(sc, &krp->krp_param[SAFE_CRK_PARAM_EXP]);
++ if (exp_bits > 2048)
++ goto too_big;
++ if (exp_bits <= 0) /* 1. exponent word length > 0 */
++ goto too_small; /* 4. exponent not zero */
++
++ mod_bits = safe_ksigbits(sc, &krp->krp_param[SAFE_CRK_PARAM_MOD]);
++ if (mod_bits > 2048)
++ goto too_big;
++ if (mod_bits <= 32) /* 2. modulus word length > 1 */
++ goto too_small; /* 8. MSW of modulus != zero */
++ if (mod_bits < exp_bits) /* 3 modulus len >= exponent len */
++ goto too_small;
++ if ((krp->krp_param[SAFE_CRK_PARAM_MOD].crp_p[0] & 1) == 0)
++ goto bad_domain; /* 6. modulus is odd */
++ if (mod_bits > krp->krp_param[krp->krp_iparams].crp_nbits)
++ goto too_small; /* make sure result will fit */
++
++ /* 7. modulus > base */
++ if (mod_bits < base_bits)
++ goto too_small;
++ if (mod_bits == base_bits) {
++ u_int8_t *basep, *modp;
++ int i;
++
++ basep = krp->krp_param[SAFE_CRK_PARAM_BASE].crp_p +
++ ((base_bits + 7) / 8) - 1;
++ modp = krp->krp_param[SAFE_CRK_PARAM_MOD].crp_p +
++ ((mod_bits + 7) / 8) - 1;
++
++ for (i = 0; i < (mod_bits + 7) / 8; i++, basep--, modp--) {
++ if (*modp < *basep)
++ goto too_small;
++ if (*modp > *basep)
++ break;
++ }
++ }
++
++ /* And on the 9th step, he rested. */
++
++ WRITE_REG(sc, SAFE_PK_A_LEN, (exp_bits + 31) / 32);
++ WRITE_REG(sc, SAFE_PK_B_LEN, (mod_bits + 31) / 32);
++ if (mod_bits > 1024) {
++ op = SAFE_PK_FUNC_EXP4;
++ a_off = 0x000;
++ b_off = 0x100;
++ c_off = 0x200;
++ d_off = 0x300;
++ } else {
++ op = SAFE_PK_FUNC_EXP16;
++ a_off = 0x000;
++ b_off = 0x080;
++ c_off = 0x100;
++ d_off = 0x180;
++ }
++ sc->sc_pk_reslen = b_off - a_off;
++ sc->sc_pk_resoff = d_off;
++
++ /* A is exponent, B is modulus, C is base, D is result */
++ safe_kload_reg(sc, a_off, b_off - a_off,
++ &krp->krp_param[SAFE_CRK_PARAM_EXP]);
++ WRITE_REG(sc, SAFE_PK_A_ADDR, a_off >> 2);
++ safe_kload_reg(sc, b_off, b_off - a_off,
++ &krp->krp_param[SAFE_CRK_PARAM_MOD]);
++ WRITE_REG(sc, SAFE_PK_B_ADDR, b_off >> 2);
++ safe_kload_reg(sc, c_off, b_off - a_off,
++ &krp->krp_param[SAFE_CRK_PARAM_BASE]);
++ WRITE_REG(sc, SAFE_PK_C_ADDR, c_off >> 2);
++ WRITE_REG(sc, SAFE_PK_D_ADDR, d_off >> 2);
++
++ WRITE_REG(sc, SAFE_PK_FUNC, op | SAFE_PK_FUNC_RUN);
++
++ return (0);
++
++too_big:
++ krp->krp_status = E2BIG;
++ return (1);
++too_small:
++ krp->krp_status = ERANGE;
++ return (1);
++bad_domain:
++ krp->krp_status = EDOM;
++ return (1);
++}
++
++static int
++safe_ksigbits(struct safe_softc *sc, struct crparam *cr)
++{
++ u_int plen = (cr->crp_nbits + 7) / 8;
++ int i, sig = plen * 8;
++ u_int8_t c, *p = cr->crp_p;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ for (i = plen - 1; i >= 0; i--) {
++ c = p[i];
++ if (c != 0) {
++ while ((c & 0x80) == 0) {
++ sig--;
++ c <<= 1;
++ }
++ break;
++ }
++ sig -= 8;
++ }
++ return (sig);
++}
++
++static void
++safe_kfeed(struct safe_softc *sc)
++{
++ struct safe_pkq *q, *tmp;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (list_empty(&sc->sc_pkq) && sc->sc_pkq_cur == NULL)
++ return;
++ if (sc->sc_pkq_cur != NULL)
++ return;
++ list_for_each_entry_safe(q, tmp, &sc->sc_pkq, pkq_list) {
++ sc->sc_pkq_cur = q;
++ list_del(&q->pkq_list);
++ if (safe_kstart(sc) != 0) {
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ sc->sc_pkq_cur = NULL;
++ } else {
++ /* op started, start polling */
++ mod_timer(&sc->sc_pkto, jiffies + 1);
++ break;
++ }
++ }
++}
++
++static void
++safe_kpoll(unsigned long arg)
++{
++ struct safe_softc *sc = NULL;
++ struct safe_pkq *q;
++ struct crparam *res;
++ int i;
++ u_int32_t buf[64];
++ unsigned long flags;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (arg >= SAFE_MAX_CHIPS)
++ return;
++ sc = safe_chip_idx[arg];
++ if (!sc) {
++ DPRINTF(("%s() - bad callback\n", __FUNCTION__));
++ return;
++ }
++
++ spin_lock_irqsave(&sc->sc_pkmtx, flags);
++ if (sc->sc_pkq_cur == NULL)
++ goto out;
++ if (READ_REG(sc, SAFE_PK_FUNC) & SAFE_PK_FUNC_RUN) {
++ /* still running, check back later */
++ mod_timer(&sc->sc_pkto, jiffies + 1);
++ goto out;
++ }
++
++ q = sc->sc_pkq_cur;
++ res = &q->pkq_krp->krp_param[q->pkq_krp->krp_iparams];
++ bzero(buf, sizeof(buf));
++ bzero(res->crp_p, (res->crp_nbits + 7) / 8);
++ for (i = 0; i < sc->sc_pk_reslen >> 2; i++)
++ buf[i] = le32_to_cpu(READ_REG(sc, SAFE_PK_RAM_START +
++ sc->sc_pk_resoff + (i << 2)));
++ bcopy(buf, res->crp_p, (res->crp_nbits + 7) / 8);
++ /*
++ * reduce the bits that need copying if possible
++ */
++ res->crp_nbits = min(res->crp_nbits,sc->sc_pk_reslen * 8);
++ res->crp_nbits = safe_ksigbits(sc, res);
++
++ for (i = SAFE_PK_RAM_START; i < SAFE_PK_RAM_END; i += 4)
++ WRITE_REG(sc, i, 0);
++
++ crypto_kdone(q->pkq_krp);
++ kfree(q);
++ sc->sc_pkq_cur = NULL;
++
++ safe_kfeed(sc);
++out:
++ spin_unlock_irqrestore(&sc->sc_pkmtx, flags);
++}
++
++static void
++safe_kload_reg(struct safe_softc *sc, u_int32_t off, u_int32_t len,
++ struct crparam *n)
++{
++ u_int32_t buf[64], i;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ bzero(buf, sizeof(buf));
++ bcopy(n->crp_p, buf, (n->crp_nbits + 7) / 8);
++
++ for (i = 0; i < len >> 2; i++)
++ WRITE_REG(sc, SAFE_PK_RAM_START + off + (i << 2),
++ cpu_to_le32(buf[i]));
++}
++
++#ifdef SAFE_DEBUG
++static void
++safe_dump_dmastatus(struct safe_softc *sc, const char *tag)
++{
++ printf("%s: ENDIAN 0x%x SRC 0x%x DST 0x%x STAT 0x%x\n"
++ , tag
++ , READ_REG(sc, SAFE_DMA_ENDIAN)
++ , READ_REG(sc, SAFE_DMA_SRCADDR)
++ , READ_REG(sc, SAFE_DMA_DSTADDR)
++ , READ_REG(sc, SAFE_DMA_STAT)
++ );
++}
++
++static void
++safe_dump_intrstate(struct safe_softc *sc, const char *tag)
++{
++ printf("%s: HI_CFG 0x%x HI_MASK 0x%x HI_DESC_CNT 0x%x HU_STAT 0x%x HM_STAT 0x%x\n"
++ , tag
++ , READ_REG(sc, SAFE_HI_CFG)
++ , READ_REG(sc, SAFE_HI_MASK)
++ , READ_REG(sc, SAFE_HI_DESC_CNT)
++ , READ_REG(sc, SAFE_HU_STAT)
++ , READ_REG(sc, SAFE_HM_STAT)
++ );
++}
++
++static void
++safe_dump_ringstate(struct safe_softc *sc, const char *tag)
++{
++ u_int32_t estat = READ_REG(sc, SAFE_PE_ERNGSTAT);
++
++ /* NB: assume caller has lock on ring */
++ printf("%s: ERNGSTAT %x (next %u) back %lu front %lu\n",
++ tag,
++ estat, (estat >> SAFE_PE_ERNGSTAT_NEXT_S),
++ (unsigned long)(sc->sc_back - sc->sc_ring),
++ (unsigned long)(sc->sc_front - sc->sc_ring));
++}
++
++static void
++safe_dump_request(struct safe_softc *sc, const char* tag, struct safe_ringentry *re)
++{
++ int ix, nsegs;
++
++ ix = re - sc->sc_ring;
++ printf("%s: %p (%u): csr %x src %x dst %x sa %x len %x\n"
++ , tag
++ , re, ix
++ , re->re_desc.d_csr
++ , re->re_desc.d_src
++ , re->re_desc.d_dst
++ , re->re_desc.d_sa
++ , re->re_desc.d_len
++ );
++ if (re->re_src.nsegs > 1) {
++ ix = (re->re_desc.d_src - sc->sc_spalloc.dma_paddr) /
++ sizeof(struct safe_pdesc);
++ for (nsegs = re->re_src.nsegs; nsegs; nsegs--) {
++ printf(" spd[%u] %p: %p size %u flags %x"
++ , ix, &sc->sc_spring[ix]
++ , (caddr_t)(uintptr_t) sc->sc_spring[ix].pd_addr
++ , sc->sc_spring[ix].pd_size
++ , sc->sc_spring[ix].pd_flags
++ );
++ if (sc->sc_spring[ix].pd_size == 0)
++ printf(" (zero!)");
++ printf("\n");
++ if (++ix == SAFE_TOTAL_SPART)
++ ix = 0;
++ }
++ }
++ if (re->re_dst.nsegs > 1) {
++ ix = (re->re_desc.d_dst - sc->sc_dpalloc.dma_paddr) /
++ sizeof(struct safe_pdesc);
++ for (nsegs = re->re_dst.nsegs; nsegs; nsegs--) {
++ printf(" dpd[%u] %p: %p flags %x\n"
++ , ix, &sc->sc_dpring[ix]
++ , (caddr_t)(uintptr_t) sc->sc_dpring[ix].pd_addr
++ , sc->sc_dpring[ix].pd_flags
++ );
++ if (++ix == SAFE_TOTAL_DPART)
++ ix = 0;
++ }
++ }
++ printf("sa: cmd0 %08x cmd1 %08x staterec %x\n",
++ re->re_sa.sa_cmd0, re->re_sa.sa_cmd1, re->re_sa.sa_staterec);
++ printf("sa: key %x %x %x %x %x %x %x %x\n"
++ , re->re_sa.sa_key[0]
++ , re->re_sa.sa_key[1]
++ , re->re_sa.sa_key[2]
++ , re->re_sa.sa_key[3]
++ , re->re_sa.sa_key[4]
++ , re->re_sa.sa_key[5]
++ , re->re_sa.sa_key[6]
++ , re->re_sa.sa_key[7]
++ );
++ printf("sa: indigest %x %x %x %x %x\n"
++ , re->re_sa.sa_indigest[0]
++ , re->re_sa.sa_indigest[1]
++ , re->re_sa.sa_indigest[2]
++ , re->re_sa.sa_indigest[3]
++ , re->re_sa.sa_indigest[4]
++ );
++ printf("sa: outdigest %x %x %x %x %x\n"
++ , re->re_sa.sa_outdigest[0]
++ , re->re_sa.sa_outdigest[1]
++ , re->re_sa.sa_outdigest[2]
++ , re->re_sa.sa_outdigest[3]
++ , re->re_sa.sa_outdigest[4]
++ );
++ printf("sr: iv %x %x %x %x\n"
++ , re->re_sastate.sa_saved_iv[0]
++ , re->re_sastate.sa_saved_iv[1]
++ , re->re_sastate.sa_saved_iv[2]
++ , re->re_sastate.sa_saved_iv[3]
++ );
++ printf("sr: hashbc %u indigest %x %x %x %x %x\n"
++ , re->re_sastate.sa_saved_hashbc
++ , re->re_sastate.sa_saved_indigest[0]
++ , re->re_sastate.sa_saved_indigest[1]
++ , re->re_sastate.sa_saved_indigest[2]
++ , re->re_sastate.sa_saved_indigest[3]
++ , re->re_sastate.sa_saved_indigest[4]
++ );
++}
++
++static void
++safe_dump_ring(struct safe_softc *sc, const char *tag)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&sc->sc_ringmtx, flags);
++ printf("\nSafeNet Ring State:\n");
++ safe_dump_intrstate(sc, tag);
++ safe_dump_dmastatus(sc, tag);
++ safe_dump_ringstate(sc, tag);
++ if (sc->sc_nqchip) {
++ struct safe_ringentry *re = sc->sc_back;
++ do {
++ safe_dump_request(sc, tag, re);
++ if (++re == sc->sc_ringtop)
++ re = sc->sc_ring;
++ } while (re != sc->sc_front);
++ }
++ spin_unlock_irqrestore(&sc->sc_ringmtx, flags);
++}
++#endif /* SAFE_DEBUG */
++
++
++static int safe_probe(struct pci_dev *dev, const struct pci_device_id *ent)
++{
++ struct safe_softc *sc = NULL;
++ u32 mem_start, mem_len, cmd;
++ int i, rc, devinfo;
++ dma_addr_t raddr;
++ static int num_chips = 0;
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ if (pci_enable_device(dev) < 0)
++ return(-ENODEV);
++
++ if (!dev->irq) {
++ printk("safe: found device with no IRQ assigned. check BIOS settings!");
++ pci_disable_device(dev);
++ return(-ENODEV);
++ }
++
++ if (pci_set_mwi(dev)) {
++ printk("safe: pci_set_mwi failed!");
++ return(-ENODEV);
++ }
++
++ sc = (struct safe_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return(-ENOMEM);
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, "safe", num_chips, safe_methods);
++
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++ sc->sc_pcidev = dev;
++ if (num_chips < SAFE_MAX_CHIPS) {
++ safe_chip_idx[device_get_unit(sc->sc_dev)] = sc;
++ num_chips++;
++ }
++
++ INIT_LIST_HEAD(&sc->sc_pkq);
++ spin_lock_init(&sc->sc_pkmtx);
++
++ pci_set_drvdata(sc->sc_pcidev, sc);
++
++ /* we read its hardware registers as memory */
++ mem_start = pci_resource_start(sc->sc_pcidev, 0);
++ mem_len = pci_resource_len(sc->sc_pcidev, 0);
++
++ sc->sc_base_addr = (ocf_iomem_t) ioremap(mem_start, mem_len);
++ if (!sc->sc_base_addr) {
++ device_printf(sc->sc_dev, "failed to ioremap 0x%x-0x%x\n",
++ mem_start, mem_start + mem_len - 1);
++ goto out;
++ }
++
++ /* fix up the bus size */
++ if (pci_set_dma_mask(sc->sc_pcidev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev, "No usable DMA configuration, aborting.\n");
++ goto out;
++ }
++ if (pci_set_consistent_dma_mask(sc->sc_pcidev, DMA_32BIT_MASK)) {
++ device_printf(sc->sc_dev, "No usable consistent DMA configuration, aborting.\n");
++ goto out;
++ }
++
++ pci_set_master(sc->sc_pcidev);
++
++ pci_read_config_dword(sc->sc_pcidev, PCI_COMMAND, &cmd);
++
++ if (!(cmd & PCI_COMMAND_MEMORY)) {
++ device_printf(sc->sc_dev, "failed to enable memory mapping\n");
++ goto out;
++ }
++
++ if (!(cmd & PCI_COMMAND_MASTER)) {
++ device_printf(sc->sc_dev, "failed to enable bus mastering\n");
++ goto out;
++ }
++
++ rc = request_irq(dev->irq, safe_intr, IRQF_SHARED, "safe", sc);
++ if (rc) {
++ device_printf(sc->sc_dev, "failed to hook irq %d\n", sc->sc_irq);
++ goto out;
++ }
++ sc->sc_irq = dev->irq;
++
++ sc->sc_chiprev = READ_REG(sc, SAFE_DEVINFO) &
++ (SAFE_DEVINFO_REV_MAJ | SAFE_DEVINFO_REV_MIN);
++
++ /*
++ * Allocate packet engine descriptors.
++ */
++ sc->sc_ringalloc.dma_vaddr = pci_alloc_consistent(sc->sc_pcidev,
++ SAFE_MAX_NQUEUE * sizeof (struct safe_ringentry),
++ &sc->sc_ringalloc.dma_paddr);
++ if (!sc->sc_ringalloc.dma_vaddr) {
++ device_printf(sc->sc_dev, "cannot allocate PE descriptor ring\n");
++ goto out;
++ }
++
++ /*
++ * Hookup the static portion of all our data structures.
++ */
++ sc->sc_ring = (struct safe_ringentry *) sc->sc_ringalloc.dma_vaddr;
++ sc->sc_ringtop = sc->sc_ring + SAFE_MAX_NQUEUE;
++ sc->sc_front = sc->sc_ring;
++ sc->sc_back = sc->sc_ring;
++ raddr = sc->sc_ringalloc.dma_paddr;
++ bzero(sc->sc_ring, SAFE_MAX_NQUEUE * sizeof(struct safe_ringentry));
++ for (i = 0; i < SAFE_MAX_NQUEUE; i++) {
++ struct safe_ringentry *re = &sc->sc_ring[i];
++
++ re->re_desc.d_sa = raddr +
++ offsetof(struct safe_ringentry, re_sa);
++ re->re_sa.sa_staterec = raddr +
++ offsetof(struct safe_ringentry, re_sastate);
++
++ raddr += sizeof (struct safe_ringentry);
++ }
++ spin_lock_init(&sc->sc_ringmtx);
++
++ /*
++ * Allocate scatter and gather particle descriptors.
++ */
++ sc->sc_spalloc.dma_vaddr = pci_alloc_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_SPART * sizeof (struct safe_pdesc),
++ &sc->sc_spalloc.dma_paddr);
++ if (!sc->sc_spalloc.dma_vaddr) {
++ device_printf(sc->sc_dev, "cannot allocate source particle descriptor ring\n");
++ goto out;
++ }
++ sc->sc_spring = (struct safe_pdesc *) sc->sc_spalloc.dma_vaddr;
++ sc->sc_springtop = sc->sc_spring + SAFE_TOTAL_SPART;
++ sc->sc_spfree = sc->sc_spring;
++ bzero(sc->sc_spring, SAFE_TOTAL_SPART * sizeof(struct safe_pdesc));
++
++ sc->sc_dpalloc.dma_vaddr = pci_alloc_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ &sc->sc_dpalloc.dma_paddr);
++ if (!sc->sc_dpalloc.dma_vaddr) {
++ device_printf(sc->sc_dev, "cannot allocate destination particle descriptor ring\n");
++ goto out;
++ }
++ sc->sc_dpring = (struct safe_pdesc *) sc->sc_dpalloc.dma_vaddr;
++ sc->sc_dpringtop = sc->sc_dpring + SAFE_TOTAL_DPART;
++ sc->sc_dpfree = sc->sc_dpring;
++ bzero(sc->sc_dpring, SAFE_TOTAL_DPART * sizeof(struct safe_pdesc));
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc), CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ device_printf(sc->sc_dev, "could not get crypto driver id\n");
++ goto out;
++ }
++
++ printf("%s:", device_get_nameunit(sc->sc_dev));
++
++ devinfo = READ_REG(sc, SAFE_DEVINFO);
++ if (devinfo & SAFE_DEVINFO_RNG) {
++ sc->sc_flags |= SAFE_FLAGS_RNG;
++ printf(" rng");
++ }
++ if (devinfo & SAFE_DEVINFO_PKEY) {
++ printf(" key");
++ sc->sc_flags |= SAFE_FLAGS_KEY;
++ crypto_kregister(sc->sc_cid, CRK_MOD_EXP, 0);
++#if 0
++ crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0);
++#endif
++ init_timer(&sc->sc_pkto);
++ sc->sc_pkto.function = safe_kpoll;
++ sc->sc_pkto.data = (unsigned long) device_get_unit(sc->sc_dev);
++ }
++ if (devinfo & SAFE_DEVINFO_DES) {
++ printf(" des/3des");
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ }
++ if (devinfo & SAFE_DEVINFO_AES) {
++ printf(" aes");
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ }
++ if (devinfo & SAFE_DEVINFO_MD5) {
++ printf(" md5");
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++ }
++ if (devinfo & SAFE_DEVINFO_SHA1) {
++ printf(" sha1");
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ }
++ printf(" null");
++ crypto_register(sc->sc_cid, CRYPTO_NULL_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_NULL_HMAC, 0, 0);
++ /* XXX other supported algorithms */
++ printf("\n");
++
++ safe_reset_board(sc); /* reset h/w */
++ safe_init_board(sc); /* init h/w */
++
++#if defined(CONFIG_OCF_RANDOMHARVEST) && !defined(SAFE_NO_RNG)
++ if (sc->sc_flags & SAFE_FLAGS_RNG) {
++ safe_rng_init(sc);
++ crypto_rregister(sc->sc_cid, safe_read_random, sc);
++ }
++#endif /* SAFE_NO_RNG */
++
++ return (0);
++
++out:
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_ringalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_MAX_NQUEUE * sizeof (struct safe_ringentry),
++ sc->sc_ringalloc.dma_vaddr, sc->sc_ringalloc.dma_paddr);
++ if (sc->sc_spalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_spalloc.dma_vaddr, sc->sc_spalloc.dma_paddr);
++ if (sc->sc_dpalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_dpalloc.dma_vaddr, sc->sc_dpalloc.dma_paddr);
++ kfree(sc);
++ return(-ENODEV);
++}
++
++static void safe_remove(struct pci_dev *dev)
++{
++ struct safe_softc *sc = pci_get_drvdata(dev);
++
++ DPRINTF(("%s()\n", __FUNCTION__));
++
++ /* XXX wait/abort active ops */
++
++ WRITE_REG(sc, SAFE_HI_MASK, 0); /* disable interrupts */
++
++ del_timer_sync(&sc->sc_pkto);
++
++ crypto_unregister_all(sc->sc_cid);
++
++ safe_cleanchip(sc);
++
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_ringalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_MAX_NQUEUE * sizeof (struct safe_ringentry),
++ sc->sc_ringalloc.dma_vaddr, sc->sc_ringalloc.dma_paddr);
++ if (sc->sc_spalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_spalloc.dma_vaddr, sc->sc_spalloc.dma_paddr);
++ if (sc->sc_dpalloc.dma_vaddr)
++ pci_free_consistent(sc->sc_pcidev,
++ SAFE_TOTAL_DPART * sizeof (struct safe_pdesc),
++ sc->sc_dpalloc.dma_vaddr, sc->sc_dpalloc.dma_paddr);
++ sc->sc_irq = -1;
++ sc->sc_ringalloc.dma_vaddr = NULL;
++ sc->sc_spalloc.dma_vaddr = NULL;
++ sc->sc_dpalloc.dma_vaddr = NULL;
++}
++
++static struct pci_device_id safe_pci_tbl[] = {
++ { PCI_VENDOR_SAFENET, PCI_PRODUCT_SAFEXCEL,
++ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
++ { },
++};
++MODULE_DEVICE_TABLE(pci, safe_pci_tbl);
++
++static struct pci_driver safe_driver = {
++ .name = "safe",
++ .id_table = safe_pci_tbl,
++ .probe = safe_probe,
++ .remove = safe_remove,
++ /* add PM stuff here one day */
++};
++
++static int __init safe_init (void)
++{
++ struct safe_softc *sc = NULL;
++ int rc;
++
++ DPRINTF(("%s(%p)\n", __FUNCTION__, safe_init));
++
++ rc = pci_register_driver(&safe_driver);
++ pci_register_driver_compat(&safe_driver, rc);
++
++ return rc;
++}
++
++static void __exit safe_exit (void)
++{
++ pci_unregister_driver(&safe_driver);
++}
++
++module_init(safe_init);
++module_exit(safe_exit);
++
++MODULE_LICENSE("BSD");
++MODULE_AUTHOR("David McCullough <david_mccullough@securecomputing.com>");
++MODULE_DESCRIPTION("OCF driver for safenet PCI crypto devices");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/safereg.h linux-2.6.29.1/crypto/ocf/safe/safereg.h
+--- linux-2.6.29.1.orig/crypto/ocf/safe/safereg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/safereg.h 2009-04-20 20:01:21.624562844 +0200
+@@ -0,0 +1,421 @@
++/*-
++ * Copyright (c) 2003 Sam Leffler, Errno Consulting
++ * Copyright (c) 2003 Global Technology Associates, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * $FreeBSD: src/sys/dev/safe/safereg.h,v 1.1 2003/07/21 21:46:07 sam Exp $
++ */
++#ifndef _SAFE_SAFEREG_H_
++#define _SAFE_SAFEREG_H_
++
++/*
++ * Register definitions for SafeNet SafeXcel-1141 crypto device.
++ * Definitions from revision 1.3 (Nov 6 2002) of the User's Manual.
++ */
++
++#define BS_BAR 0x10 /* DMA base address register */
++#define BS_TRDY_TIMEOUT 0x40 /* TRDY timeout */
++#define BS_RETRY_TIMEOUT 0x41 /* DMA retry timeout */
++
++#define PCI_VENDOR_SAFENET 0x16ae /* SafeNet, Inc. */
++
++/* SafeNet */
++#define PCI_PRODUCT_SAFEXCEL 0x1141 /* 1141 */
++
++#define SAFE_PE_CSR 0x0000 /* Packet Enginge Ctrl/Status */
++#define SAFE_PE_SRC 0x0004 /* Packet Engine Source */
++#define SAFE_PE_DST 0x0008 /* Packet Engine Destination */
++#define SAFE_PE_SA 0x000c /* Packet Engine SA */
++#define SAFE_PE_LEN 0x0010 /* Packet Engine Length */
++#define SAFE_PE_DMACFG 0x0040 /* Packet Engine DMA Configuration */
++#define SAFE_PE_DMASTAT 0x0044 /* Packet Engine DMA Status */
++#define SAFE_PE_PDRBASE 0x0048 /* Packet Engine Descriptor Ring Base */
++#define SAFE_PE_RDRBASE 0x004c /* Packet Engine Result Ring Base */
++#define SAFE_PE_RINGCFG 0x0050 /* Packet Engine Ring Configuration */
++#define SAFE_PE_RINGPOLL 0x0054 /* Packet Engine Ring Poll */
++#define SAFE_PE_IRNGSTAT 0x0058 /* Packet Engine Internal Ring Status */
++#define SAFE_PE_ERNGSTAT 0x005c /* Packet Engine External Ring Status */
++#define SAFE_PE_IOTHRESH 0x0060 /* Packet Engine I/O Threshold */
++#define SAFE_PE_GRNGBASE 0x0064 /* Packet Engine Gather Ring Base */
++#define SAFE_PE_SRNGBASE 0x0068 /* Packet Engine Scatter Ring Base */
++#define SAFE_PE_PARTSIZE 0x006c /* Packet Engine Particlar Ring Size */
++#define SAFE_PE_PARTCFG 0x0070 /* Packet Engine Particle Ring Config */
++#define SAFE_CRYPTO_CTRL 0x0080 /* Crypto Control */
++#define SAFE_DEVID 0x0084 /* Device ID */
++#define SAFE_DEVINFO 0x0088 /* Device Info */
++#define SAFE_HU_STAT 0x00a0 /* Host Unmasked Status */
++#define SAFE_HM_STAT 0x00a4 /* Host Masked Status (read-only) */
++#define SAFE_HI_CLR 0x00a4 /* Host Clear Interrupt (write-only) */
++#define SAFE_HI_MASK 0x00a8 /* Host Mask Control */
++#define SAFE_HI_CFG 0x00ac /* Interrupt Configuration */
++#define SAFE_HI_RD_DESCR 0x00b4 /* Force Descriptor Read */
++#define SAFE_HI_DESC_CNT 0x00b8 /* Host Descriptor Done Count */
++#define SAFE_DMA_ENDIAN 0x00c0 /* Master Endian Status */
++#define SAFE_DMA_SRCADDR 0x00c4 /* DMA Source Address Status */
++#define SAFE_DMA_DSTADDR 0x00c8 /* DMA Destination Address Status */
++#define SAFE_DMA_STAT 0x00cc /* DMA Current Status */
++#define SAFE_DMA_CFG 0x00d4 /* DMA Configuration/Status */
++#define SAFE_ENDIAN 0x00e0 /* Endian Configuration */
++#define SAFE_PK_A_ADDR 0x0800 /* Public Key A Address */
++#define SAFE_PK_B_ADDR 0x0804 /* Public Key B Address */
++#define SAFE_PK_C_ADDR 0x0808 /* Public Key C Address */
++#define SAFE_PK_D_ADDR 0x080c /* Public Key D Address */
++#define SAFE_PK_A_LEN 0x0810 /* Public Key A Length */
++#define SAFE_PK_B_LEN 0x0814 /* Public Key B Length */
++#define SAFE_PK_SHIFT 0x0818 /* Public Key Shift */
++#define SAFE_PK_FUNC 0x081c /* Public Key Function */
++#define SAFE_PK_RAM_START 0x1000 /* Public Key RAM start address */
++#define SAFE_PK_RAM_END 0x1fff /* Public Key RAM end address */
++
++#define SAFE_RNG_OUT 0x0100 /* RNG Output */
++#define SAFE_RNG_STAT 0x0104 /* RNG Status */
++#define SAFE_RNG_CTRL 0x0108 /* RNG Control */
++#define SAFE_RNG_A 0x010c /* RNG A */
++#define SAFE_RNG_B 0x0110 /* RNG B */
++#define SAFE_RNG_X_LO 0x0114 /* RNG X [31:0] */
++#define SAFE_RNG_X_MID 0x0118 /* RNG X [63:32] */
++#define SAFE_RNG_X_HI 0x011c /* RNG X [80:64] */
++#define SAFE_RNG_X_CNTR 0x0120 /* RNG Counter */
++#define SAFE_RNG_ALM_CNT 0x0124 /* RNG Alarm Count */
++#define SAFE_RNG_CNFG 0x0128 /* RNG Configuration */
++#define SAFE_RNG_LFSR1_LO 0x012c /* RNG LFSR1 [31:0] */
++#define SAFE_RNG_LFSR1_HI 0x0130 /* RNG LFSR1 [47:32] */
++#define SAFE_RNG_LFSR2_LO 0x0134 /* RNG LFSR1 [31:0] */
++#define SAFE_RNG_LFSR2_HI 0x0138 /* RNG LFSR1 [47:32] */
++
++#define SAFE_PE_CSR_READY 0x00000001 /* ready for processing */
++#define SAFE_PE_CSR_DONE 0x00000002 /* h/w completed processing */
++#define SAFE_PE_CSR_LOADSA 0x00000004 /* load SA digests */
++#define SAFE_PE_CSR_HASHFINAL 0x00000010 /* do hash pad & write result */
++#define SAFE_PE_CSR_SABUSID 0x000000c0 /* bus id for SA */
++#define SAFE_PE_CSR_SAPCI 0x00000040 /* PCI bus id for SA */
++#define SAFE_PE_CSR_NXTHDR 0x0000ff00 /* next hdr value for IPsec */
++#define SAFE_PE_CSR_FPAD 0x0000ff00 /* fixed pad for basic ops */
++#define SAFE_PE_CSR_STATUS 0x00ff0000 /* operation result status */
++#define SAFE_PE_CSR_AUTH_FAIL 0x00010000 /* ICV mismatch (inbound) */
++#define SAFE_PE_CSR_PAD_FAIL 0x00020000 /* pad verify fail (inbound) */
++#define SAFE_PE_CSR_SEQ_FAIL 0x00040000 /* sequence number (inbound) */
++#define SAFE_PE_CSR_XERROR 0x00080000 /* extended error follows */
++#define SAFE_PE_CSR_XECODE 0x00f00000 /* extended error code */
++#define SAFE_PE_CSR_XECODE_S 20
++#define SAFE_PE_CSR_XECODE_BADCMD 0 /* invalid command */
++#define SAFE_PE_CSR_XECODE_BADALG 1 /* invalid algorithm */
++#define SAFE_PE_CSR_XECODE_ALGDIS 2 /* algorithm disabled */
++#define SAFE_PE_CSR_XECODE_ZEROLEN 3 /* zero packet length */
++#define SAFE_PE_CSR_XECODE_DMAERR 4 /* bus DMA error */
++#define SAFE_PE_CSR_XECODE_PIPEABORT 5 /* secondary bus DMA error */
++#define SAFE_PE_CSR_XECODE_BADSPI 6 /* IPsec SPI mismatch */
++#define SAFE_PE_CSR_XECODE_TIMEOUT 10 /* failsafe timeout */
++#define SAFE_PE_CSR_PAD 0xff000000 /* ESP padding control/status */
++#define SAFE_PE_CSR_PAD_MIN 0x00000000 /* minimum IPsec padding */
++#define SAFE_PE_CSR_PAD_16 0x08000000 /* pad to 16-byte boundary */
++#define SAFE_PE_CSR_PAD_32 0x10000000 /* pad to 32-byte boundary */
++#define SAFE_PE_CSR_PAD_64 0x20000000 /* pad to 64-byte boundary */
++#define SAFE_PE_CSR_PAD_128 0x40000000 /* pad to 128-byte boundary */
++#define SAFE_PE_CSR_PAD_256 0x80000000 /* pad to 256-byte boundary */
++
++/*
++ * Check the CSR to see if the PE has returned ownership to
++ * the host. Note that before processing a descriptor this
++ * must be done followed by a check of the SAFE_PE_LEN register
++ * status bits to avoid premature processing of a descriptor
++ * on its way back to the host.
++ */
++#define SAFE_PE_CSR_IS_DONE(_csr) \
++ (((_csr) & (SAFE_PE_CSR_READY | SAFE_PE_CSR_DONE)) == SAFE_PE_CSR_DONE)
++
++#define SAFE_PE_LEN_LENGTH 0x000fffff /* total length (bytes) */
++#define SAFE_PE_LEN_READY 0x00400000 /* ready for processing */
++#define SAFE_PE_LEN_DONE 0x00800000 /* h/w completed processing */
++#define SAFE_PE_LEN_BYPASS 0xff000000 /* bypass offset (bytes) */
++#define SAFE_PE_LEN_BYPASS_S 24
++
++#define SAFE_PE_LEN_IS_DONE(_len) \
++ (((_len) & (SAFE_PE_LEN_READY | SAFE_PE_LEN_DONE)) == SAFE_PE_LEN_DONE)
++
++/* NB: these apply to HU_STAT, HM_STAT, HI_CLR, and HI_MASK */
++#define SAFE_INT_PE_CDONE 0x00000002 /* PE context done */
++#define SAFE_INT_PE_DDONE 0x00000008 /* PE descriptor done */
++#define SAFE_INT_PE_ERROR 0x00000010 /* PE error */
++#define SAFE_INT_PE_ODONE 0x00000020 /* PE operation done */
++
++#define SAFE_HI_CFG_PULSE 0x00000001 /* use pulse interrupt */
++#define SAFE_HI_CFG_LEVEL 0x00000000 /* use level interrupt */
++#define SAFE_HI_CFG_AUTOCLR 0x00000002 /* auto-clear pulse interrupt */
++
++#define SAFE_ENDIAN_PASS 0x000000e4 /* straight pass-thru */
++#define SAFE_ENDIAN_SWAB 0x0000001b /* swap bytes in 32-bit word */
++
++#define SAFE_PE_DMACFG_PERESET 0x00000001 /* reset packet engine */
++#define SAFE_PE_DMACFG_PDRRESET 0x00000002 /* reset PDR counters/ptrs */
++#define SAFE_PE_DMACFG_SGRESET 0x00000004 /* reset scatter/gather cache */
++#define SAFE_PE_DMACFG_FSENA 0x00000008 /* enable failsafe reset */
++#define SAFE_PE_DMACFG_PEMODE 0x00000100 /* packet engine mode */
++#define SAFE_PE_DMACFG_SAPREC 0x00000200 /* SA precedes packet */
++#define SAFE_PE_DMACFG_PKFOLL 0x00000400 /* packet follows descriptor */
++#define SAFE_PE_DMACFG_GPRBID 0x00003000 /* gather particle ring busid */
++#define SAFE_PE_DMACFG_GPRPCI 0x00001000 /* PCI gather particle ring */
++#define SAFE_PE_DMACFG_SPRBID 0x0000c000 /* scatter part. ring busid */
++#define SAFE_PE_DMACFG_SPRPCI 0x00004000 /* PCI scatter part. ring */
++#define SAFE_PE_DMACFG_ESDESC 0x00010000 /* endian swap descriptors */
++#define SAFE_PE_DMACFG_ESSA 0x00020000 /* endian swap SA data */
++#define SAFE_PE_DMACFG_ESPACKET 0x00040000 /* endian swap packet data */
++#define SAFE_PE_DMACFG_ESPDESC 0x00080000 /* endian swap particle desc. */
++#define SAFE_PE_DMACFG_NOPDRUP 0x00100000 /* supp. PDR ownership update */
++#define SAFE_PD_EDMACFG_PCIMODE 0x01000000 /* PCI target mode */
++
++#define SAFE_PE_DMASTAT_PEIDONE 0x00000001 /* PE core input done */
++#define SAFE_PE_DMASTAT_PEODONE 0x00000002 /* PE core output done */
++#define SAFE_PE_DMASTAT_ENCDONE 0x00000004 /* encryption done */
++#define SAFE_PE_DMASTAT_IHDONE 0x00000008 /* inner hash done */
++#define SAFE_PE_DMASTAT_OHDONE 0x00000010 /* outer hash (HMAC) done */
++#define SAFE_PE_DMASTAT_PADFLT 0x00000020 /* crypto pad fault */
++#define SAFE_PE_DMASTAT_ICVFLT 0x00000040 /* ICV fault */
++#define SAFE_PE_DMASTAT_SPIMIS 0x00000080 /* SPI mismatch */
++#define SAFE_PE_DMASTAT_CRYPTO 0x00000100 /* crypto engine timeout */
++#define SAFE_PE_DMASTAT_CQACT 0x00000200 /* command queue active */
++#define SAFE_PE_DMASTAT_IRACT 0x00000400 /* input request active */
++#define SAFE_PE_DMASTAT_ORACT 0x00000800 /* output request active */
++#define SAFE_PE_DMASTAT_PEISIZE 0x003ff000 /* PE input size:32-bit words */
++#define SAFE_PE_DMASTAT_PEOSIZE 0xffc00000 /* PE out. size:32-bit words */
++
++#define SAFE_PE_RINGCFG_SIZE 0x000003ff /* ring size (descriptors) */
++#define SAFE_PE_RINGCFG_OFFSET 0xffff0000 /* offset btw desc's (dwords) */
++#define SAFE_PE_RINGCFG_OFFSET_S 16
++
++#define SAFE_PE_RINGPOLL_POLL 0x00000fff /* polling frequency/divisor */
++#define SAFE_PE_RINGPOLL_RETRY 0x03ff0000 /* polling frequency/divisor */
++#define SAFE_PE_RINGPOLL_CONT 0x80000000 /* continuously poll */
++
++#define SAFE_PE_IRNGSTAT_CQAVAIL 0x00000001 /* command queue available */
++
++#define SAFE_PE_ERNGSTAT_NEXT 0x03ff0000 /* index of next packet desc. */
++#define SAFE_PE_ERNGSTAT_NEXT_S 16
++
++#define SAFE_PE_IOTHRESH_INPUT 0x000003ff /* input threshold (dwords) */
++#define SAFE_PE_IOTHRESH_OUTPUT 0x03ff0000 /* output threshold (dwords) */
++
++#define SAFE_PE_PARTCFG_SIZE 0x0000ffff /* scatter particle size */
++#define SAFE_PE_PARTCFG_GBURST 0x00030000 /* gather particle burst */
++#define SAFE_PE_PARTCFG_GBURST_2 0x00000000
++#define SAFE_PE_PARTCFG_GBURST_4 0x00010000
++#define SAFE_PE_PARTCFG_GBURST_8 0x00020000
++#define SAFE_PE_PARTCFG_GBURST_16 0x00030000
++#define SAFE_PE_PARTCFG_SBURST 0x000c0000 /* scatter particle burst */
++#define SAFE_PE_PARTCFG_SBURST_2 0x00000000
++#define SAFE_PE_PARTCFG_SBURST_4 0x00040000
++#define SAFE_PE_PARTCFG_SBURST_8 0x00080000
++#define SAFE_PE_PARTCFG_SBURST_16 0x000c0000
++
++#define SAFE_PE_PARTSIZE_SCAT 0xffff0000 /* scatter particle ring size */
++#define SAFE_PE_PARTSIZE_GATH 0x0000ffff /* gather particle ring size */
++
++#define SAFE_CRYPTO_CTRL_3DES 0x00000001 /* enable 3DES support */
++#define SAFE_CRYPTO_CTRL_PKEY 0x00010000 /* enable public key support */
++#define SAFE_CRYPTO_CTRL_RNG 0x00020000 /* enable RNG support */
++
++#define SAFE_DEVINFO_REV_MIN 0x0000000f /* minor rev for chip */
++#define SAFE_DEVINFO_REV_MAJ 0x000000f0 /* major rev for chip */
++#define SAFE_DEVINFO_REV_MAJ_S 4
++#define SAFE_DEVINFO_DES 0x00000100 /* DES/3DES support present */
++#define SAFE_DEVINFO_ARC4 0x00000200 /* ARC4 support present */
++#define SAFE_DEVINFO_AES 0x00000400 /* AES support present */
++#define SAFE_DEVINFO_MD5 0x00001000 /* MD5 support present */
++#define SAFE_DEVINFO_SHA1 0x00002000 /* SHA-1 support present */
++#define SAFE_DEVINFO_RIPEMD 0x00004000 /* RIPEMD support present */
++#define SAFE_DEVINFO_DEFLATE 0x00010000 /* Deflate support present */
++#define SAFE_DEVINFO_SARAM 0x00100000 /* on-chip SA RAM present */
++#define SAFE_DEVINFO_EMIBUS 0x00200000 /* EMI bus present */
++#define SAFE_DEVINFO_PKEY 0x00400000 /* public key support present */
++#define SAFE_DEVINFO_RNG 0x00800000 /* RNG present */
++
++#define SAFE_REV(_maj, _min) (((_maj) << SAFE_DEVINFO_REV_MAJ_S) | (_min))
++#define SAFE_REV_MAJ(_chiprev) \
++ (((_chiprev) & SAFE_DEVINFO_REV_MAJ) >> SAFE_DEVINFO_REV_MAJ_S)
++#define SAFE_REV_MIN(_chiprev) ((_chiprev) & SAFE_DEVINFO_REV_MIN)
++
++#define SAFE_PK_FUNC_MULT 0x00000001 /* Multiply function */
++#define SAFE_PK_FUNC_SQUARE 0x00000004 /* Square function */
++#define SAFE_PK_FUNC_ADD 0x00000010 /* Add function */
++#define SAFE_PK_FUNC_SUB 0x00000020 /* Subtract function */
++#define SAFE_PK_FUNC_LSHIFT 0x00000040 /* Left-shift function */
++#define SAFE_PK_FUNC_RSHIFT 0x00000080 /* Right-shift function */
++#define SAFE_PK_FUNC_DIV 0x00000100 /* Divide function */
++#define SAFE_PK_FUNC_CMP 0x00000400 /* Compare function */
++#define SAFE_PK_FUNC_COPY 0x00000800 /* Copy function */
++#define SAFE_PK_FUNC_EXP16 0x00002000 /* Exponentiate (4-bit ACT) */
++#define SAFE_PK_FUNC_EXP4 0x00004000 /* Exponentiate (2-bit ACT) */
++#define SAFE_PK_FUNC_RUN 0x00008000 /* start/status */
++
++#define SAFE_RNG_STAT_BUSY 0x00000001 /* busy, data not valid */
++
++#define SAFE_RNG_CTRL_PRE_LFSR 0x00000001 /* enable output pre-LFSR */
++#define SAFE_RNG_CTRL_TST_MODE 0x00000002 /* enable test mode */
++#define SAFE_RNG_CTRL_TST_RUN 0x00000004 /* start test state machine */
++#define SAFE_RNG_CTRL_ENA_RING1 0x00000008 /* test entropy oscillator #1 */
++#define SAFE_RNG_CTRL_ENA_RING2 0x00000010 /* test entropy oscillator #2 */
++#define SAFE_RNG_CTRL_DIS_ALARM 0x00000020 /* disable RNG alarm reports */
++#define SAFE_RNG_CTRL_TST_CLOCK 0x00000040 /* enable test clock */
++#define SAFE_RNG_CTRL_SHORTEN 0x00000080 /* shorten state timers */
++#define SAFE_RNG_CTRL_TST_ALARM 0x00000100 /* simulate alarm state */
++#define SAFE_RNG_CTRL_RST_LFSR 0x00000200 /* reset LFSR */
++
++/*
++ * Packet engine descriptor. Note that d_csr is a copy of the
++ * SAFE_PE_CSR register and all definitions apply, and d_len
++ * is a copy of the SAFE_PE_LEN register and all definitions apply.
++ * d_src and d_len may point directly to contiguous data or to a
++ * list of ``particle descriptors'' when using scatter/gather i/o.
++ */
++struct safe_desc {
++ u_int32_t d_csr; /* per-packet control/status */
++ u_int32_t d_src; /* source address */
++ u_int32_t d_dst; /* destination address */
++ u_int32_t d_sa; /* SA address */
++ u_int32_t d_len; /* length, bypass, status */
++};
++
++/*
++ * Scatter/Gather particle descriptor.
++ *
++ * NB: scatter descriptors do not specify a size; this is fixed
++ * by the setting of the SAFE_PE_PARTCFG register.
++ */
++struct safe_pdesc {
++ u_int32_t pd_addr; /* particle address */
++#ifdef __BIG_ENDIAN
++ u_int16_t pd_flags; /* control word */
++ u_int16_t pd_size; /* particle size (bytes) */
++#else
++ u_int16_t pd_flags; /* control word */
++ u_int16_t pd_size; /* particle size (bytes) */
++#endif
++};
++
++#define SAFE_PD_READY 0x0001 /* ready for processing */
++#define SAFE_PD_DONE 0x0002 /* h/w completed processing */
++
++/*
++ * Security Association (SA) Record (Rev 1). One of these is
++ * required for each operation processed by the packet engine.
++ */
++struct safe_sarec {
++ u_int32_t sa_cmd0;
++ u_int32_t sa_cmd1;
++ u_int32_t sa_resv0;
++ u_int32_t sa_resv1;
++ u_int32_t sa_key[8]; /* DES/3DES/AES key */
++ u_int32_t sa_indigest[5]; /* inner digest */
++ u_int32_t sa_outdigest[5]; /* outer digest */
++ u_int32_t sa_spi; /* SPI */
++ u_int32_t sa_seqnum; /* sequence number */
++ u_int32_t sa_seqmask[2]; /* sequence number mask */
++ u_int32_t sa_resv2;
++ u_int32_t sa_staterec; /* address of state record */
++ u_int32_t sa_resv3[2];
++ u_int32_t sa_samgmt0; /* SA management field 0 */
++ u_int32_t sa_samgmt1; /* SA management field 0 */
++};
++
++#define SAFE_SA_CMD0_OP 0x00000007 /* operation code */
++#define SAFE_SA_CMD0_OP_CRYPT 0x00000000 /* encrypt/decrypt (basic) */
++#define SAFE_SA_CMD0_OP_BOTH 0x00000001 /* encrypt-hash/hash-decrypto */
++#define SAFE_SA_CMD0_OP_HASH 0x00000003 /* hash (outbound-only) */
++#define SAFE_SA_CMD0_OP_ESP 0x00000000 /* ESP in/out (proto) */
++#define SAFE_SA_CMD0_OP_AH 0x00000001 /* AH in/out (proto) */
++#define SAFE_SA_CMD0_INBOUND 0x00000008 /* inbound operation */
++#define SAFE_SA_CMD0_OUTBOUND 0x00000000 /* outbound operation */
++#define SAFE_SA_CMD0_GROUP 0x00000030 /* operation group */
++#define SAFE_SA_CMD0_BASIC 0x00000000 /* basic operation */
++#define SAFE_SA_CMD0_PROTO 0x00000010 /* protocol/packet operation */
++#define SAFE_SA_CMD0_BUNDLE 0x00000020 /* bundled operation (resvd) */
++#define SAFE_SA_CMD0_PAD 0x000000c0 /* crypto pad method */
++#define SAFE_SA_CMD0_PAD_IPSEC 0x00000000 /* IPsec padding */
++#define SAFE_SA_CMD0_PAD_PKCS7 0x00000040 /* PKCS#7 padding */
++#define SAFE_SA_CMD0_PAD_CONS 0x00000080 /* constant padding */
++#define SAFE_SA_CMD0_PAD_ZERO 0x000000c0 /* zero padding */
++#define SAFE_SA_CMD0_CRYPT_ALG 0x00000f00 /* symmetric crypto algorithm */
++#define SAFE_SA_CMD0_DES 0x00000000 /* DES crypto algorithm */
++#define SAFE_SA_CMD0_3DES 0x00000100 /* 3DES crypto algorithm */
++#define SAFE_SA_CMD0_AES 0x00000300 /* AES crypto algorithm */
++#define SAFE_SA_CMD0_CRYPT_NULL 0x00000f00 /* null crypto algorithm */
++#define SAFE_SA_CMD0_HASH_ALG 0x0000f000 /* hash algorithm */
++#define SAFE_SA_CMD0_MD5 0x00000000 /* MD5 hash algorithm */
++#define SAFE_SA_CMD0_SHA1 0x00001000 /* SHA-1 hash algorithm */
++#define SAFE_SA_CMD0_HASH_NULL 0x0000f000 /* null hash algorithm */
++#define SAFE_SA_CMD0_HDR_PROC 0x00080000 /* header processing */
++#define SAFE_SA_CMD0_IBUSID 0x00300000 /* input bus id */
++#define SAFE_SA_CMD0_IPCI 0x00100000 /* PCI input bus id */
++#define SAFE_SA_CMD0_OBUSID 0x00c00000 /* output bus id */
++#define SAFE_SA_CMD0_OPCI 0x00400000 /* PCI output bus id */
++#define SAFE_SA_CMD0_IVLD 0x03000000 /* IV loading */
++#define SAFE_SA_CMD0_IVLD_NONE 0x00000000 /* IV no load (reuse) */
++#define SAFE_SA_CMD0_IVLD_IBUF 0x01000000 /* IV load from input buffer */
++#define SAFE_SA_CMD0_IVLD_STATE 0x02000000 /* IV load from state */
++#define SAFE_SA_CMD0_HSLD 0x0c000000 /* hash state loading */
++#define SAFE_SA_CMD0_HSLD_SA 0x00000000 /* hash state load from SA */
++#define SAFE_SA_CMD0_HSLD_STATE 0x08000000 /* hash state load from state */
++#define SAFE_SA_CMD0_HSLD_NONE 0x0c000000 /* hash state no load */
++#define SAFE_SA_CMD0_SAVEIV 0x10000000 /* save IV */
++#define SAFE_SA_CMD0_SAVEHASH 0x20000000 /* save hash state */
++#define SAFE_SA_CMD0_IGATHER 0x40000000 /* input gather */
++#define SAFE_SA_CMD0_OSCATTER 0x80000000 /* output scatter */
++
++#define SAFE_SA_CMD1_HDRCOPY 0x00000002 /* copy header to output */
++#define SAFE_SA_CMD1_PAYCOPY 0x00000004 /* copy payload to output */
++#define SAFE_SA_CMD1_PADCOPY 0x00000008 /* copy pad to output */
++#define SAFE_SA_CMD1_IPV4 0x00000000 /* IPv4 protocol */
++#define SAFE_SA_CMD1_IPV6 0x00000010 /* IPv6 protocol */
++#define SAFE_SA_CMD1_MUTABLE 0x00000020 /* mutable bit processing */
++#define SAFE_SA_CMD1_SRBUSID 0x000000c0 /* state record bus id */
++#define SAFE_SA_CMD1_SRPCI 0x00000040 /* state record from PCI */
++#define SAFE_SA_CMD1_CRMODE 0x00000300 /* crypto mode */
++#define SAFE_SA_CMD1_ECB 0x00000000 /* ECB crypto mode */
++#define SAFE_SA_CMD1_CBC 0x00000100 /* CBC crypto mode */
++#define SAFE_SA_CMD1_OFB 0x00000200 /* OFB crypto mode */
++#define SAFE_SA_CMD1_CFB 0x00000300 /* CFB crypto mode */
++#define SAFE_SA_CMD1_CRFEEDBACK 0x00000c00 /* crypto feedback mode */
++#define SAFE_SA_CMD1_64BIT 0x00000000 /* 64-bit crypto feedback */
++#define SAFE_SA_CMD1_8BIT 0x00000400 /* 8-bit crypto feedback */
++#define SAFE_SA_CMD1_1BIT 0x00000800 /* 1-bit crypto feedback */
++#define SAFE_SA_CMD1_128BIT 0x00000c00 /* 128-bit crypto feedback */
++#define SAFE_SA_CMD1_OPTIONS 0x00001000 /* HMAC/options mutable bit */
++#define SAFE_SA_CMD1_HMAC SAFE_SA_CMD1_OPTIONS
++#define SAFE_SA_CMD1_SAREV1 0x00008000 /* SA Revision 1 */
++#define SAFE_SA_CMD1_OFFSET 0x00ff0000 /* hash/crypto offset(dwords) */
++#define SAFE_SA_CMD1_OFFSET_S 16
++#define SAFE_SA_CMD1_AESKEYLEN 0x0f000000 /* AES key length */
++#define SAFE_SA_CMD1_AES128 0x02000000 /* 128-bit AES key */
++#define SAFE_SA_CMD1_AES192 0x03000000 /* 192-bit AES key */
++#define SAFE_SA_CMD1_AES256 0x04000000 /* 256-bit AES key */
++
++/*
++ * Security Associate State Record (Rev 1).
++ */
++struct safe_sastate {
++ u_int32_t sa_saved_iv[4]; /* saved IV (DES/3DES/AES) */
++ u_int32_t sa_saved_hashbc; /* saved hash byte count */
++ u_int32_t sa_saved_indigest[5]; /* saved inner digest */
++};
++#endif /* _SAFE_SAFEREG_H_ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/safevar.h linux-2.6.29.1/crypto/ocf/safe/safevar.h
+--- linux-2.6.29.1.orig/crypto/ocf/safe/safevar.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/safevar.h 2009-04-20 20:01:21.624562844 +0200
+@@ -0,0 +1,230 @@
++/*-
++ * The linux port of this code done by David McCullough
++ * Copyright (C) 2004-2007 David McCullough <david_mccullough@securecomputing.com>
++ * The license and original author are listed below.
++ *
++ * Copyright (c) 2003 Sam Leffler, Errno Consulting
++ * Copyright (c) 2003 Global Technology Associates, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * $FreeBSD: src/sys/dev/safe/safevar.h,v 1.2 2006/05/17 18:34:26 pjd Exp $
++ */
++#ifndef _SAFE_SAFEVAR_H_
++#define _SAFE_SAFEVAR_H_
++
++/* Maximum queue length */
++#ifndef SAFE_MAX_NQUEUE
++#define SAFE_MAX_NQUEUE 60
++#endif
++
++#define SAFE_MAX_PART 64 /* Maximum scatter/gather depth */
++#define SAFE_DMA_BOUNDARY 0 /* No boundary for source DMA ops */
++#define SAFE_MAX_DSIZE 2048 /* MCLBYTES Fixed scatter particle size */
++#define SAFE_MAX_SSIZE 0x0ffff /* Maximum gather particle size */
++#define SAFE_MAX_DMA 0xfffff /* Maximum PE operand size (20 bits) */
++/* total src+dst particle descriptors */
++#define SAFE_TOTAL_DPART (SAFE_MAX_NQUEUE * SAFE_MAX_PART)
++#define SAFE_TOTAL_SPART (SAFE_MAX_NQUEUE * SAFE_MAX_PART)
++
++#define SAFE_RNG_MAXBUFSIZ 128 /* 32-bit words */
++
++#define SAFE_CARD(sid) (((sid) & 0xf0000000) >> 28)
++#define SAFE_SESSION(sid) ( (sid) & 0x0fffffff)
++#define SAFE_SID(crd, sesn) (((crd) << 28) | ((sesn) & 0x0fffffff))
++
++#define SAFE_DEF_RTY 0xff /* PCI Retry Timeout */
++#define SAFE_DEF_TOUT 0xff /* PCI TRDY Timeout */
++#define SAFE_DEF_CACHELINE 0x01 /* Cache Line setting */
++
++#ifdef __KERNEL__
++/*
++ * State associated with the allocation of each chunk
++ * of memory setup for DMA.
++ */
++struct safe_dma_alloc {
++ dma_addr_t dma_paddr;
++ void *dma_vaddr;
++};
++
++/*
++ * Cryptographic operand state. One of these exists for each
++ * source and destination operand passed in from the crypto
++ * subsystem. When possible source and destination operands
++ * refer to the same memory. More often they are distinct.
++ * We track the virtual address of each operand as well as
++ * where each is mapped for DMA.
++ */
++struct safe_operand {
++ union {
++ struct sk_buff *skb;
++ struct uio *io;
++ } u;
++ void *map;
++ int mapsize; /* total number of bytes in segs */
++ struct {
++ dma_addr_t ds_addr;
++ int ds_len;
++ int ds_tlen;
++ } segs[SAFE_MAX_PART];
++ int nsegs;
++};
++
++/*
++ * Packet engine ring entry and cryptographic operation state.
++ * The packet engine requires a ring of descriptors that contain
++ * pointers to various cryptographic state. However the ring
++ * configuration register allows you to specify an arbitrary size
++ * for ring entries. We use this feature to collect most of the
++ * state for each cryptographic request into one spot. Other than
++ * ring entries only the ``particle descriptors'' (scatter/gather
++ * lists) and the actual operand data are kept separate. The
++ * particle descriptors must also be organized in rings. The
++ * operand data can be located aribtrarily (modulo alignment constraints).
++ *
++ * Note that the descriptor ring is mapped onto the PCI bus so
++ * the hardware can DMA data. This means the entire ring must be
++ * contiguous.
++ */
++struct safe_ringentry {
++ struct safe_desc re_desc; /* command descriptor */
++ struct safe_sarec re_sa; /* SA record */
++ struct safe_sastate re_sastate; /* SA state record */
++
++ struct cryptop *re_crp; /* crypto operation */
++
++ struct safe_operand re_src; /* source operand */
++ struct safe_operand re_dst; /* destination operand */
++
++ int re_sesn; /* crypto session ID */
++ int re_flags;
++#define SAFE_QFLAGS_COPYOUTIV 0x1 /* copy back on completion */
++#define SAFE_QFLAGS_COPYOUTICV 0x2 /* copy back on completion */
++};
++
++#define re_src_skb re_src.u.skb
++#define re_src_io re_src.u.io
++#define re_src_map re_src.map
++#define re_src_nsegs re_src.nsegs
++#define re_src_segs re_src.segs
++#define re_src_mapsize re_src.mapsize
++
++#define re_dst_skb re_dst.u.skb
++#define re_dst_io re_dst.u.io
++#define re_dst_map re_dst.map
++#define re_dst_nsegs re_dst.nsegs
++#define re_dst_segs re_dst.segs
++#define re_dst_mapsize re_dst.mapsize
++
++struct rndstate_test;
++
++struct safe_session {
++ u_int32_t ses_used;
++ u_int32_t ses_klen; /* key length in bits */
++ u_int32_t ses_key[8]; /* DES/3DES/AES key */
++ u_int32_t ses_mlen; /* hmac length in bytes */
++ u_int32_t ses_hminner[5]; /* hmac inner state */
++ u_int32_t ses_hmouter[5]; /* hmac outer state */
++ u_int32_t ses_iv[4]; /* DES/3DES/AES iv */
++};
++
++struct safe_pkq {
++ struct list_head pkq_list;
++ struct cryptkop *pkq_krp;
++};
++
++struct safe_softc {
++ softc_device_decl sc_dev;
++ u32 sc_irq;
++
++ struct pci_dev *sc_pcidev;
++ ocf_iomem_t sc_base_addr;
++
++ u_int sc_chiprev; /* major/minor chip revision */
++ int sc_flags; /* device specific flags */
++#define SAFE_FLAGS_KEY 0x01 /* has key accelerator */
++#define SAFE_FLAGS_RNG 0x02 /* hardware rng */
++ int sc_suspended;
++ int sc_needwakeup; /* notify crypto layer */
++ int32_t sc_cid; /* crypto tag */
++
++ struct safe_dma_alloc sc_ringalloc; /* PE ring allocation state */
++ struct safe_ringentry *sc_ring; /* PE ring */
++ struct safe_ringentry *sc_ringtop; /* PE ring top */
++ struct safe_ringentry *sc_front; /* next free entry */
++ struct safe_ringentry *sc_back; /* next pending entry */
++ int sc_nqchip; /* # passed to chip */
++ spinlock_t sc_ringmtx; /* PE ring lock */
++ struct safe_pdesc *sc_spring; /* src particle ring */
++ struct safe_pdesc *sc_springtop; /* src particle ring top */
++ struct safe_pdesc *sc_spfree; /* next free src particle */
++ struct safe_dma_alloc sc_spalloc; /* src particle ring state */
++ struct safe_pdesc *sc_dpring; /* dest particle ring */
++ struct safe_pdesc *sc_dpringtop; /* dest particle ring top */
++ struct safe_pdesc *sc_dpfree; /* next free dest particle */
++ struct safe_dma_alloc sc_dpalloc; /* dst particle ring state */
++ int sc_nsessions; /* # of sessions */
++ struct safe_session *sc_sessions; /* sessions */
++
++ struct timer_list sc_pkto; /* PK polling */
++ spinlock_t sc_pkmtx; /* PK lock */
++ struct list_head sc_pkq; /* queue of PK requests */
++ struct safe_pkq *sc_pkq_cur; /* current processing request */
++ u_int32_t sc_pk_reslen, sc_pk_resoff;
++
++ int sc_max_dsize; /* maximum safe DMA size */
++};
++#endif /* __KERNEL__ */
++
++struct safe_stats {
++ u_int64_t st_ibytes;
++ u_int64_t st_obytes;
++ u_int32_t st_ipackets;
++ u_int32_t st_opackets;
++ u_int32_t st_invalid; /* invalid argument */
++ u_int32_t st_badsession; /* invalid session id */
++ u_int32_t st_badflags; /* flags indicate !(mbuf | uio) */
++ u_int32_t st_nodesc; /* op submitted w/o descriptors */
++ u_int32_t st_badalg; /* unsupported algorithm */
++ u_int32_t st_ringfull; /* PE descriptor ring full */
++ u_int32_t st_peoperr; /* PE marked error */
++ u_int32_t st_dmaerr; /* PE DMA error */
++ u_int32_t st_bypasstoobig; /* bypass > 96 bytes */
++ u_int32_t st_skipmismatch; /* enc part begins before auth part */
++ u_int32_t st_lenmismatch; /* enc length different auth length */
++ u_int32_t st_coffmisaligned; /* crypto offset not 32-bit aligned */
++ u_int32_t st_cofftoobig; /* crypto offset > 255 words */
++ u_int32_t st_iovmisaligned; /* iov op not aligned */
++ u_int32_t st_iovnotuniform; /* iov op not suitable */
++ u_int32_t st_unaligned; /* unaligned src caused copy */
++ u_int32_t st_notuniform; /* non-uniform src caused copy */
++ u_int32_t st_nomap; /* bus_dmamap_create failed */
++ u_int32_t st_noload; /* bus_dmamap_load_* failed */
++ u_int32_t st_nombuf; /* MGET* failed */
++ u_int32_t st_nomcl; /* MCLGET* failed */
++ u_int32_t st_maxqchip; /* max mcr1 ops out for processing */
++ u_int32_t st_rng; /* RNG requests */
++ u_int32_t st_rngalarm; /* RNG alarm requests */
++ u_int32_t st_noicvcopy; /* ICV data copies suppressed */
++};
++#endif /* _SAFE_SAFEVAR_H_ */
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/sha1.c linux-2.6.29.1/crypto/ocf/safe/sha1.c
+--- linux-2.6.29.1.orig/crypto/ocf/safe/sha1.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/sha1.c 2009-04-20 20:01:21.628563633 +0200
+@@ -0,0 +1,279 @@
++/* $KAME: sha1.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++/*
++ * FIPS pub 180-1: Secure Hash Algorithm (SHA-1)
++ * based on: http://csrc.nist.gov/fips/fip180-1.txt
++ * implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
++ */
++
++#if 0
++#include <sys/cdefs.h>
++__FBSDID("$FreeBSD: src/sys/crypto/sha1.c,v 1.9 2003/06/10 21:36:57 obrien Exp $");
++
++#include <sys/types.h>
++#include <sys/cdefs.h>
++#include <sys/time.h>
++#include <sys/systm.h>
++
++#include <crypto/sha1.h>
++#endif
++
++/* sanity check */
++#if BYTE_ORDER != BIG_ENDIAN
++# if BYTE_ORDER != LITTLE_ENDIAN
++# define unsupported 1
++# endif
++#endif
++
++#ifndef unsupported
++
++/* constant table */
++static u_int32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 };
++#define K(t) _K[(t) / 20]
++
++#define F0(b, c, d) (((b) & (c)) | ((~(b)) & (d)))
++#define F1(b, c, d) (((b) ^ (c)) ^ (d))
++#define F2(b, c, d) (((b) & (c)) | ((b) & (d)) | ((c) & (d)))
++#define F3(b, c, d) (((b) ^ (c)) ^ (d))
++
++#define S(n, x) (((x) << (n)) | ((x) >> (32 - n)))
++
++#undef H
++#define H(n) (ctxt->h.b32[(n)])
++#define COUNT (ctxt->count)
++#define BCOUNT (ctxt->c.b64[0] / 8)
++#define W(n) (ctxt->m.b32[(n)])
++
++#define PUTBYTE(x) { \
++ ctxt->m.b8[(COUNT % 64)] = (x); \
++ COUNT++; \
++ COUNT %= 64; \
++ ctxt->c.b64[0] += 8; \
++ if (COUNT % 64 == 0) \
++ sha1_step(ctxt); \
++ }
++
++#define PUTPAD(x) { \
++ ctxt->m.b8[(COUNT % 64)] = (x); \
++ COUNT++; \
++ COUNT %= 64; \
++ if (COUNT % 64 == 0) \
++ sha1_step(ctxt); \
++ }
++
++static void sha1_step(struct sha1_ctxt *);
++
++static void
++sha1_step(ctxt)
++ struct sha1_ctxt *ctxt;
++{
++ u_int32_t a, b, c, d, e;
++ size_t t, s;
++ u_int32_t tmp;
++
++#if BYTE_ORDER == LITTLE_ENDIAN
++ struct sha1_ctxt tctxt;
++ bcopy(&ctxt->m.b8[0], &tctxt.m.b8[0], 64);
++ ctxt->m.b8[0] = tctxt.m.b8[3]; ctxt->m.b8[1] = tctxt.m.b8[2];
++ ctxt->m.b8[2] = tctxt.m.b8[1]; ctxt->m.b8[3] = tctxt.m.b8[0];
++ ctxt->m.b8[4] = tctxt.m.b8[7]; ctxt->m.b8[5] = tctxt.m.b8[6];
++ ctxt->m.b8[6] = tctxt.m.b8[5]; ctxt->m.b8[7] = tctxt.m.b8[4];
++ ctxt->m.b8[8] = tctxt.m.b8[11]; ctxt->m.b8[9] = tctxt.m.b8[10];
++ ctxt->m.b8[10] = tctxt.m.b8[9]; ctxt->m.b8[11] = tctxt.m.b8[8];
++ ctxt->m.b8[12] = tctxt.m.b8[15]; ctxt->m.b8[13] = tctxt.m.b8[14];
++ ctxt->m.b8[14] = tctxt.m.b8[13]; ctxt->m.b8[15] = tctxt.m.b8[12];
++ ctxt->m.b8[16] = tctxt.m.b8[19]; ctxt->m.b8[17] = tctxt.m.b8[18];
++ ctxt->m.b8[18] = tctxt.m.b8[17]; ctxt->m.b8[19] = tctxt.m.b8[16];
++ ctxt->m.b8[20] = tctxt.m.b8[23]; ctxt->m.b8[21] = tctxt.m.b8[22];
++ ctxt->m.b8[22] = tctxt.m.b8[21]; ctxt->m.b8[23] = tctxt.m.b8[20];
++ ctxt->m.b8[24] = tctxt.m.b8[27]; ctxt->m.b8[25] = tctxt.m.b8[26];
++ ctxt->m.b8[26] = tctxt.m.b8[25]; ctxt->m.b8[27] = tctxt.m.b8[24];
++ ctxt->m.b8[28] = tctxt.m.b8[31]; ctxt->m.b8[29] = tctxt.m.b8[30];
++ ctxt->m.b8[30] = tctxt.m.b8[29]; ctxt->m.b8[31] = tctxt.m.b8[28];
++ ctxt->m.b8[32] = tctxt.m.b8[35]; ctxt->m.b8[33] = tctxt.m.b8[34];
++ ctxt->m.b8[34] = tctxt.m.b8[33]; ctxt->m.b8[35] = tctxt.m.b8[32];
++ ctxt->m.b8[36] = tctxt.m.b8[39]; ctxt->m.b8[37] = tctxt.m.b8[38];
++ ctxt->m.b8[38] = tctxt.m.b8[37]; ctxt->m.b8[39] = tctxt.m.b8[36];
++ ctxt->m.b8[40] = tctxt.m.b8[43]; ctxt->m.b8[41] = tctxt.m.b8[42];
++ ctxt->m.b8[42] = tctxt.m.b8[41]; ctxt->m.b8[43] = tctxt.m.b8[40];
++ ctxt->m.b8[44] = tctxt.m.b8[47]; ctxt->m.b8[45] = tctxt.m.b8[46];
++ ctxt->m.b8[46] = tctxt.m.b8[45]; ctxt->m.b8[47] = tctxt.m.b8[44];
++ ctxt->m.b8[48] = tctxt.m.b8[51]; ctxt->m.b8[49] = tctxt.m.b8[50];
++ ctxt->m.b8[50] = tctxt.m.b8[49]; ctxt->m.b8[51] = tctxt.m.b8[48];
++ ctxt->m.b8[52] = tctxt.m.b8[55]; ctxt->m.b8[53] = tctxt.m.b8[54];
++ ctxt->m.b8[54] = tctxt.m.b8[53]; ctxt->m.b8[55] = tctxt.m.b8[52];
++ ctxt->m.b8[56] = tctxt.m.b8[59]; ctxt->m.b8[57] = tctxt.m.b8[58];
++ ctxt->m.b8[58] = tctxt.m.b8[57]; ctxt->m.b8[59] = tctxt.m.b8[56];
++ ctxt->m.b8[60] = tctxt.m.b8[63]; ctxt->m.b8[61] = tctxt.m.b8[62];
++ ctxt->m.b8[62] = tctxt.m.b8[61]; ctxt->m.b8[63] = tctxt.m.b8[60];
++#endif
++
++ a = H(0); b = H(1); c = H(2); d = H(3); e = H(4);
++
++ for (t = 0; t < 20; t++) {
++ s = t & 0x0f;
++ if (t >= 16) {
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ }
++ tmp = S(5, a) + F0(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++ for (t = 20; t < 40; t++) {
++ s = t & 0x0f;
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ tmp = S(5, a) + F1(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++ for (t = 40; t < 60; t++) {
++ s = t & 0x0f;
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ tmp = S(5, a) + F2(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++ for (t = 60; t < 80; t++) {
++ s = t & 0x0f;
++ W(s) = S(1, W((s+13) & 0x0f) ^ W((s+8) & 0x0f) ^ W((s+2) & 0x0f) ^ W(s));
++ tmp = S(5, a) + F3(b, c, d) + e + W(s) + K(t);
++ e = d; d = c; c = S(30, b); b = a; a = tmp;
++ }
++
++ H(0) = H(0) + a;
++ H(1) = H(1) + b;
++ H(2) = H(2) + c;
++ H(3) = H(3) + d;
++ H(4) = H(4) + e;
++
++ bzero(&ctxt->m.b8[0], 64);
++}
++
++/*------------------------------------------------------------*/
++
++void
++sha1_init(ctxt)
++ struct sha1_ctxt *ctxt;
++{
++ bzero(ctxt, sizeof(struct sha1_ctxt));
++ H(0) = 0x67452301;
++ H(1) = 0xefcdab89;
++ H(2) = 0x98badcfe;
++ H(3) = 0x10325476;
++ H(4) = 0xc3d2e1f0;
++}
++
++void
++sha1_pad(ctxt)
++ struct sha1_ctxt *ctxt;
++{
++ size_t padlen; /*pad length in bytes*/
++ size_t padstart;
++
++ PUTPAD(0x80);
++
++ padstart = COUNT % 64;
++ padlen = 64 - padstart;
++ if (padlen < 8) {
++ bzero(&ctxt->m.b8[padstart], padlen);
++ COUNT += padlen;
++ COUNT %= 64;
++ sha1_step(ctxt);
++ padstart = COUNT % 64; /* should be 0 */
++ padlen = 64 - padstart; /* should be 64 */
++ }
++ bzero(&ctxt->m.b8[padstart], padlen - 8);
++ COUNT += (padlen - 8);
++ COUNT %= 64;
++#if BYTE_ORDER == BIG_ENDIAN
++ PUTPAD(ctxt->c.b8[0]); PUTPAD(ctxt->c.b8[1]);
++ PUTPAD(ctxt->c.b8[2]); PUTPAD(ctxt->c.b8[3]);
++ PUTPAD(ctxt->c.b8[4]); PUTPAD(ctxt->c.b8[5]);
++ PUTPAD(ctxt->c.b8[6]); PUTPAD(ctxt->c.b8[7]);
++#else
++ PUTPAD(ctxt->c.b8[7]); PUTPAD(ctxt->c.b8[6]);
++ PUTPAD(ctxt->c.b8[5]); PUTPAD(ctxt->c.b8[4]);
++ PUTPAD(ctxt->c.b8[3]); PUTPAD(ctxt->c.b8[2]);
++ PUTPAD(ctxt->c.b8[1]); PUTPAD(ctxt->c.b8[0]);
++#endif
++}
++
++void
++sha1_loop(ctxt, input, len)
++ struct sha1_ctxt *ctxt;
++ const u_int8_t *input;
++ size_t len;
++{
++ size_t gaplen;
++ size_t gapstart;
++ size_t off;
++ size_t copysiz;
++
++ off = 0;
++
++ while (off < len) {
++ gapstart = COUNT % 64;
++ gaplen = 64 - gapstart;
++
++ copysiz = (gaplen < len - off) ? gaplen : len - off;
++ bcopy(&input[off], &ctxt->m.b8[gapstart], copysiz);
++ COUNT += copysiz;
++ COUNT %= 64;
++ ctxt->c.b64[0] += copysiz * 8;
++ if (COUNT % 64 == 0)
++ sha1_step(ctxt);
++ off += copysiz;
++ }
++}
++
++void
++sha1_result(ctxt, digest0)
++ struct sha1_ctxt *ctxt;
++ caddr_t digest0;
++{
++ u_int8_t *digest;
++
++ digest = (u_int8_t *)digest0;
++ sha1_pad(ctxt);
++#if BYTE_ORDER == BIG_ENDIAN
++ bcopy(&ctxt->h.b8[0], digest, 20);
++#else
++ digest[0] = ctxt->h.b8[3]; digest[1] = ctxt->h.b8[2];
++ digest[2] = ctxt->h.b8[1]; digest[3] = ctxt->h.b8[0];
++ digest[4] = ctxt->h.b8[7]; digest[5] = ctxt->h.b8[6];
++ digest[6] = ctxt->h.b8[5]; digest[7] = ctxt->h.b8[4];
++ digest[8] = ctxt->h.b8[11]; digest[9] = ctxt->h.b8[10];
++ digest[10] = ctxt->h.b8[9]; digest[11] = ctxt->h.b8[8];
++ digest[12] = ctxt->h.b8[15]; digest[13] = ctxt->h.b8[14];
++ digest[14] = ctxt->h.b8[13]; digest[15] = ctxt->h.b8[12];
++ digest[16] = ctxt->h.b8[19]; digest[17] = ctxt->h.b8[18];
++ digest[18] = ctxt->h.b8[17]; digest[19] = ctxt->h.b8[16];
++#endif
++}
++
++#endif /*unsupported*/
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/safe/sha1.h linux-2.6.29.1/crypto/ocf/safe/sha1.h
+--- linux-2.6.29.1.orig/crypto/ocf/safe/sha1.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/safe/sha1.h 2009-04-20 20:01:21.628563633 +0200
+@@ -0,0 +1,72 @@
++/* $FreeBSD: src/sys/crypto/sha1.h,v 1.8 2002/03/20 05:13:50 alfred Exp $ */
++/* $KAME: sha1.h,v 1.5 2000/03/27 04:36:23 sumikawa Exp $ */
++
++/*
++ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the project nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++/*
++ * FIPS pub 180-1: Secure Hash Algorithm (SHA-1)
++ * based on: http://csrc.nist.gov/fips/fip180-1.txt
++ * implemented by Jun-ichiro itojun Itoh <itojun@itojun.org>
++ */
++
++#ifndef _NETINET6_SHA1_H_
++#define _NETINET6_SHA1_H_
++
++struct sha1_ctxt {
++ union {
++ u_int8_t b8[20];
++ u_int32_t b32[5];
++ } h;
++ union {
++ u_int8_t b8[8];
++ u_int64_t b64[1];
++ } c;
++ union {
++ u_int8_t b8[64];
++ u_int32_t b32[16];
++ } m;
++ u_int8_t count;
++};
++
++#ifdef __KERNEL__
++extern void sha1_init(struct sha1_ctxt *);
++extern void sha1_pad(struct sha1_ctxt *);
++extern void sha1_loop(struct sha1_ctxt *, const u_int8_t *, size_t);
++extern void sha1_result(struct sha1_ctxt *, caddr_t);
++
++/* compatibilty with other SHA1 source codes */
++typedef struct sha1_ctxt SHA1_CTX;
++#define SHA1Init(x) sha1_init((x))
++#define SHA1Update(x, y, z) sha1_loop((x), (y), (z))
++#define SHA1Final(x, y) sha1_result((y), (x))
++#endif /* __KERNEL__ */
++
++#define SHA1_RESULTLEN (160/8)
++
++#endif /*_NETINET6_SHA1_H_*/
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/talitos/Makefile linux-2.6.29.1/crypto/ocf/talitos/Makefile
+--- linux-2.6.29.1.orig/crypto/ocf/talitos/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/talitos/Makefile 2009-04-20 20:01:21.632564980 +0200
+@@ -0,0 +1,12 @@
++# for SGlinux builds
++-include $(ROOTDIR)/modules/.config
++
++obj-$(CONFIG_OCF_TALITOS) += talitos.o
++
++obj ?= .
++EXTRA_CFLAGS += -I$(obj)/.. -I$(obj)/
++
++ifdef TOPDIR
++-include $(TOPDIR)/Rules.make
++endif
++
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/talitos/talitos.c linux-2.6.29.1/crypto/ocf/talitos/talitos.c
+--- linux-2.6.29.1.orig/crypto/ocf/talitos/talitos.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/talitos/talitos.c 2009-04-20 20:01:21.632564980 +0200
+@@ -0,0 +1,1359 @@
++/*
++ * crypto/ocf/talitos/talitos.c
++ *
++ * An OCF-Linux module that uses Freescale's SEC to do the crypto.
++ * Based on crypto/ocf/hifn and crypto/ocf/safe OCF drivers
++ *
++ * Copyright (c) 2006 Freescale Semiconductor, Inc.
++ *
++ * This code written by Kim A. B. Phillips <kim.phillips@freescale.com>
++ * some code copied from files with the following:
++ * Copyright (C) 2004-2007 David McCullough <david_mccullough@securecomputing.com
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * ---------------------------------------------------------------------------
++ *
++ * NOTES:
++ *
++ * The Freescale SEC (also known as 'talitos') resides on the
++ * internal bus, and runs asynchronous to the processor core. It has
++ * a wide gamut of cryptographic acceleration features, including single-
++ * pass IPsec (also known as algorithm chaining). To properly utilize
++ * all of the SEC's performance enhancing features, further reworking
++ * of higher level code (framework, applications) will be necessary.
++ *
++ * The following table shows which SEC version is present in which devices:
++ *
++ * Devices SEC version
++ *
++ * 8272, 8248 SEC 1.0
++ * 885, 875 SEC 1.2
++ * 8555E, 8541E SEC 2.0
++ * 8349E SEC 2.01
++ * 8548E SEC 2.1
++ *
++ * The following table shows the features offered by each SEC version:
++ *
++ * Max. chan-
++ * version Bus I/F Clock nels DEU AESU AFEU MDEU PKEU RNG KEU
++ *
++ * SEC 1.0 internal 64b 100MHz 4 1 1 1 1 1 1 0
++ * SEC 1.2 internal 32b 66MHz 1 1 1 0 1 0 0 0
++ * SEC 2.0 internal 64b 166MHz 4 1 1 1 1 1 1 0
++ * SEC 2.01 internal 64b 166MHz 4 1 1 1 1 1 1 0
++ * SEC 2.1 internal 64b 333MHz 4 1 1 1 1 1 1 1
++ *
++ * Each execution unit in the SEC has two modes of execution; channel and
++ * slave/debug. This driver employs the channel infrastructure in the
++ * device for convenience. Only the RNG is directly accessed due to the
++ * convenience of its random fifo pool. The relationship between the
++ * channels and execution units is depicted in the following diagram:
++ *
++ * ------- ------------
++ * ---| ch0 |---| |
++ * ------- | |
++ * | |------+-------+-------+-------+------------
++ * ------- | | | | | | |
++ * ---| ch1 |---| | | | | | |
++ * ------- | | ------ ------ ------ ------ ------
++ * |controller| |DEU | |AESU| |MDEU| |PKEU| ... |RNG |
++ * ------- | | ------ ------ ------ ------ ------
++ * ---| ch2 |---| | | | | | |
++ * ------- | | | | | | |
++ * | |------+-------+-------+-------+------------
++ * ------- | |
++ * ---| ch3 |---| |
++ * ------- ------------
++ *
++ * Channel ch0 may drive an aes operation to the aes unit (AESU),
++ * and, at the same time, ch1 may drive a message digest operation
++ * to the mdeu. Each channel has an input descriptor FIFO, and the
++ * FIFO can contain, e.g. on the 8541E, up to 24 entries, before a
++ * a buffer overrun error is triggered. The controller is responsible
++ * for fetching the data from descriptor pointers, and passing the
++ * data to the appropriate EUs. The controller also writes the
++ * cryptographic operation's result to memory. The SEC notifies
++ * completion by triggering an interrupt and/or setting the 1st byte
++ * of the hdr field to 0xff.
++ *
++ * TODO:
++ * o support more algorithms
++ * o support more versions of the SEC
++ * o add support for linux 2.4
++ * o scatter-gather (sg) support
++ * o add support for public key ops (PKEU)
++ * o add statistics
++ */
++
++#ifndef AUTOCONF_INCLUDED
++#include <linux/config.h>
++#endif
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/spinlock.h>
++#include <linux/random.h>
++#include <linux/skbuff.h>
++#include <asm/scatterlist.h>
++#include <linux/dma-mapping.h> /* dma_map_single() */
++#include <linux/moduleparam.h>
++
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
++#include <linux/platform_device.h>
++#endif
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++#include <linux/of_platform.h>
++#endif
++
++#include <cryptodev.h>
++#include <uio.h>
++
++#define DRV_NAME "talitos"
++
++#include "talitos_dev.h"
++#include "talitos_soft.h"
++
++#define read_random(p,l) get_random_bytes(p,l)
++
++const char talitos_driver_name[] = "Talitos OCF";
++const char talitos_driver_version[] = "0.2";
++
++static int talitos_newsession(device_t dev, u_int32_t *sidp,
++ struct cryptoini *cri);
++static int talitos_freesession(device_t dev, u_int64_t tid);
++static int talitos_process(device_t dev, struct cryptop *crp, int hint);
++static void dump_talitos_status(struct talitos_softc *sc);
++static int talitos_submit(struct talitos_softc *sc, struct talitos_desc *td,
++ int chsel);
++static void talitos_doneprocessing(struct talitos_softc *sc);
++static void talitos_init_device(struct talitos_softc *sc);
++static void talitos_reset_device_master(struct talitos_softc *sc);
++static void talitos_reset_device(struct talitos_softc *sc);
++static void talitos_errorprocessing(struct talitos_softc *sc);
++#ifdef CONFIG_PPC_MERGE
++static int talitos_probe(struct of_device *ofdev, const struct of_device_id *match);
++static int talitos_remove(struct of_device *ofdev);
++#else
++static int talitos_probe(struct platform_device *pdev);
++static int talitos_remove(struct platform_device *pdev);
++#endif
++#ifdef CONFIG_OCF_RANDOMHARVEST
++static int talitos_read_random(void *arg, u_int32_t *buf, int maxwords);
++static void talitos_rng_init(struct talitos_softc *sc);
++#endif
++
++static device_method_t talitos_methods = {
++ /* crypto device methods */
++ DEVMETHOD(cryptodev_newsession, talitos_newsession),
++ DEVMETHOD(cryptodev_freesession,talitos_freesession),
++ DEVMETHOD(cryptodev_process, talitos_process),
++};
++
++#define debug talitos_debug
++int talitos_debug = 0;
++module_param(talitos_debug, int, 0644);
++MODULE_PARM_DESC(talitos_debug, "Enable debug");
++
++static inline void talitos_write(volatile unsigned *addr, u32 val)
++{
++ out_be32(addr, val);
++}
++
++static inline u32 talitos_read(volatile unsigned *addr)
++{
++ u32 val;
++ val = in_be32(addr);
++ return val;
++}
++
++static void dump_talitos_status(struct talitos_softc *sc)
++{
++ unsigned int v, v_hi, i, *ptr;
++ v = talitos_read(sc->sc_base_addr + TALITOS_MCR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_MCR_HI);
++ printk(KERN_INFO "%s: MCR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ v = talitos_read(sc->sc_base_addr + TALITOS_IMR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_IMR_HI);
++ printk(KERN_INFO "%s: IMR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ v = talitos_read(sc->sc_base_addr + TALITOS_ISR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_ISR_HI);
++ printk(KERN_INFO "%s: ISR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CDPR);
++ v_hi = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CDPR_HI);
++ printk(KERN_INFO "%s: CDPR ch%d 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), i, v, v_hi);
++ }
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCPSR);
++ v_hi = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCPSR_HI);
++ printk(KERN_INFO "%s: CCPSR ch%d 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), i, v, v_hi);
++ }
++ ptr = sc->sc_base_addr + TALITOS_CH_DESCBUF;
++ for (i = 0; i < 16; i++) {
++ v = talitos_read(ptr++); v_hi = talitos_read(ptr++);
++ printk(KERN_INFO "%s: DESCBUF ch0 0x%08x_%08x (tdp%02d)\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi, i);
++ }
++ return;
++}
++
++
++#ifdef CONFIG_OCF_RANDOMHARVEST
++/*
++ * pull random numbers off the RNG FIFO, not exceeding amount available
++ */
++static int
++talitos_read_random(void *arg, u_int32_t *buf, int maxwords)
++{
++ struct talitos_softc *sc = (struct talitos_softc *) arg;
++ int rc;
++ u_int32_t v;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* check for things like FIFO underflow */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGISR_HI);
++ if (unlikely(v)) {
++ printk(KERN_ERR "%s: RNGISR_HI error %08x\n",
++ device_get_nameunit(sc->sc_cdev), v);
++ return 0;
++ }
++ /*
++ * OFL is number of available 64-bit words,
++ * shift and convert to a 32-bit word count
++ */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGSR_HI);
++ v = (v & TALITOS_RNGSR_HI_OFL) >> (16 - 1);
++ if (maxwords > v)
++ maxwords = v;
++ for (rc = 0; rc < maxwords; rc++) {
++ buf[rc] = talitos_read(sc->sc_base_addr +
++ TALITOS_RNG_FIFO + rc*sizeof(u_int32_t));
++ }
++ if (maxwords & 1) {
++ /*
++ * RNG will complain with an AE in the RNGISR
++ * if we don't complete the pairs of 32-bit reads
++ * to its 64-bit register based FIFO
++ */
++ v = talitos_read(sc->sc_base_addr +
++ TALITOS_RNG_FIFO + rc*sizeof(u_int32_t));
++ }
++
++ return rc;
++}
++
++static void
++talitos_rng_init(struct talitos_softc *sc)
++{
++ u_int32_t v;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ /* reset RNG EU */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGRCR_HI);
++ v |= TALITOS_RNGRCR_HI_SR;
++ talitos_write(sc->sc_base_addr + TALITOS_RNGRCR_HI, v);
++ while ((talitos_read(sc->sc_base_addr + TALITOS_RNGSR_HI)
++ & TALITOS_RNGSR_HI_RD) == 0)
++ cpu_relax();
++ /*
++ * we tell the RNG to start filling the RNG FIFO
++ * by writing the RNGDSR
++ */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGDSR_HI);
++ talitos_write(sc->sc_base_addr + TALITOS_RNGDSR_HI, v);
++ /*
++ * 64 bits of data will be pushed onto the FIFO every
++ * 256 SEC cycles until the FIFO is full. The RNG then
++ * attempts to keep the FIFO full.
++ */
++ v = talitos_read(sc->sc_base_addr + TALITOS_RNGISR_HI);
++ if (v) {
++ printk(KERN_ERR "%s: RNGISR_HI error %08x\n",
++ device_get_nameunit(sc->sc_cdev), v);
++ return;
++ }
++ /*
++ * n.b. we need to add a FIPS test here - if the RNG is going
++ * to fail, it's going to fail at reset time
++ */
++ return;
++}
++#endif /* CONFIG_OCF_RANDOMHARVEST */
++
++/*
++ * Generate a new software session.
++ */
++static int
++talitos_newsession(device_t dev, u_int32_t *sidp, struct cryptoini *cri)
++{
++ struct cryptoini *c, *encini = NULL, *macini = NULL;
++ struct talitos_softc *sc = device_get_softc(dev);
++ struct talitos_session *ses = NULL;
++ int sesn;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ if (sidp == NULL || cri == NULL || sc == NULL) {
++ DPRINTF("%s,%d - EINVAL\n", __FILE__, __LINE__);
++ return EINVAL;
++ }
++ for (c = cri; c != NULL; c = c->cri_next) {
++ if (c->cri_alg == CRYPTO_MD5 ||
++ c->cri_alg == CRYPTO_MD5_HMAC ||
++ c->cri_alg == CRYPTO_SHA1 ||
++ c->cri_alg == CRYPTO_SHA1_HMAC ||
++ c->cri_alg == CRYPTO_NULL_HMAC) {
++ if (macini)
++ return EINVAL;
++ macini = c;
++ } else if (c->cri_alg == CRYPTO_DES_CBC ||
++ c->cri_alg == CRYPTO_3DES_CBC ||
++ c->cri_alg == CRYPTO_AES_CBC ||
++ c->cri_alg == CRYPTO_NULL_CBC) {
++ if (encini)
++ return EINVAL;
++ encini = c;
++ } else {
++ DPRINTF("UNKNOWN c->cri_alg %d\n", encini->cri_alg);
++ return EINVAL;
++ }
++ }
++ if (encini == NULL && macini == NULL)
++ return EINVAL;
++ if (encini) {
++ /* validate key length */
++ switch (encini->cri_alg) {
++ case CRYPTO_DES_CBC:
++ if (encini->cri_klen != 64)
++ return EINVAL;
++ break;
++ case CRYPTO_3DES_CBC:
++ if (encini->cri_klen != 192) {
++ return EINVAL;
++ }
++ break;
++ case CRYPTO_AES_CBC:
++ if (encini->cri_klen != 128 &&
++ encini->cri_klen != 192 &&
++ encini->cri_klen != 256)
++ return EINVAL;
++ break;
++ default:
++ DPRINTF("UNKNOWN encini->cri_alg %d\n",
++ encini->cri_alg);
++ return EINVAL;
++ }
++ }
++
++ if (sc->sc_sessions == NULL) {
++ ses = sc->sc_sessions = (struct talitos_session *)
++ kmalloc(sizeof(struct talitos_session), SLAB_ATOMIC);
++ if (ses == NULL)
++ return ENOMEM;
++ memset(ses, 0, sizeof(struct talitos_session));
++ sesn = 0;
++ sc->sc_nsessions = 1;
++ } else {
++ for (sesn = 0; sesn < sc->sc_nsessions; sesn++) {
++ if (sc->sc_sessions[sesn].ses_used == 0) {
++ ses = &sc->sc_sessions[sesn];
++ break;
++ }
++ }
++
++ if (ses == NULL) {
++ /* allocating session */
++ sesn = sc->sc_nsessions;
++ ses = (struct talitos_session *) kmalloc(
++ (sesn + 1) * sizeof(struct talitos_session),
++ SLAB_ATOMIC);
++ if (ses == NULL)
++ return ENOMEM;
++ memset(ses, 0,
++ (sesn + 1) * sizeof(struct talitos_session));
++ memcpy(ses, sc->sc_sessions,
++ sesn * sizeof(struct talitos_session));
++ memset(sc->sc_sessions, 0,
++ sesn * sizeof(struct talitos_session));
++ kfree(sc->sc_sessions);
++ sc->sc_sessions = ses;
++ ses = &sc->sc_sessions[sesn];
++ sc->sc_nsessions++;
++ }
++ }
++
++ ses->ses_used = 1;
++
++ if (encini) {
++ /* get an IV */
++ /* XXX may read fewer than requested */
++ read_random(ses->ses_iv, sizeof(ses->ses_iv));
++
++ ses->ses_klen = (encini->cri_klen + 7) / 8;
++ memcpy(ses->ses_key, encini->cri_key, ses->ses_klen);
++ if (macini) {
++ /* doing hash on top of cipher */
++ ses->ses_hmac_len = (macini->cri_klen + 7) / 8;
++ memcpy(ses->ses_hmac, macini->cri_key,
++ ses->ses_hmac_len);
++ }
++ } else if (macini) {
++ /* doing hash */
++ ses->ses_klen = (macini->cri_klen + 7) / 8;
++ memcpy(ses->ses_key, macini->cri_key, ses->ses_klen);
++ }
++
++ /* back compat way of determining MSC result len */
++ if (macini) {
++ ses->ses_mlen = macini->cri_mlen;
++ if (ses->ses_mlen == 0) {
++ if (macini->cri_alg == CRYPTO_MD5_HMAC)
++ ses->ses_mlen = MD5_HASH_LEN;
++ else
++ ses->ses_mlen = SHA1_HASH_LEN;
++ }
++ }
++
++ /* really should make up a template td here,
++ * and only fill things like i/o and direction in process() */
++
++ /* assign session ID */
++ *sidp = TALITOS_SID(sc->sc_num, sesn);
++ return 0;
++}
++
++/*
++ * Deallocate a session.
++ */
++static int
++talitos_freesession(device_t dev, u_int64_t tid)
++{
++ struct talitos_softc *sc = device_get_softc(dev);
++ int session, ret;
++ u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
++
++ if (sc == NULL)
++ return EINVAL;
++ session = TALITOS_SESSION(sid);
++ if (session < sc->sc_nsessions) {
++ memset(&sc->sc_sessions[session], 0,
++ sizeof(sc->sc_sessions[session]));
++ ret = 0;
++ } else
++ ret = EINVAL;
++ return ret;
++}
++
++/*
++ * launch device processing - it will come back with done notification
++ * in the form of an interrupt and/or HDR_DONE_BITS in header
++ */
++static int
++talitos_submit(
++ struct talitos_softc *sc,
++ struct talitos_desc *td,
++ int chsel)
++{
++ u_int32_t v;
++
++ v = dma_map_single(NULL, td, sizeof(*td), DMA_TO_DEVICE);
++ talitos_write(sc->sc_base_addr +
++ chsel*TALITOS_CH_OFFSET + TALITOS_CH_FF, 0);
++ talitos_write(sc->sc_base_addr +
++ chsel*TALITOS_CH_OFFSET + TALITOS_CH_FF_HI, v);
++ return 0;
++}
++
++static int
++talitos_process(device_t dev, struct cryptop *crp, int hint)
++{
++ int i, err = 0, ivsize;
++ struct talitos_softc *sc = device_get_softc(dev);
++ struct cryptodesc *crd1, *crd2, *maccrd, *enccrd;
++ caddr_t iv;
++ struct talitos_session *ses;
++ struct talitos_desc *td;
++ unsigned long flags;
++ /* descriptor mappings */
++ int hmac_key, hmac_data, cipher_iv, cipher_key,
++ in_fifo, out_fifo, cipher_iv_out;
++ static int chsel = -1;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ if (crp == NULL || crp->crp_callback == NULL || sc == NULL) {
++ return EINVAL;
++ }
++ crp->crp_etype = 0;
++ if (TALITOS_SESSION(crp->crp_sid) >= sc->sc_nsessions) {
++ return EINVAL;
++ }
++
++ ses = &sc->sc_sessions[TALITOS_SESSION(crp->crp_sid)];
++
++ /* enter the channel scheduler */
++ spin_lock_irqsave(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ /* reuse channel that already had/has requests for the required EU */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ if (sc->sc_chnlastalg[i] == crp->crp_desc->crd_alg)
++ break;
++ }
++ if (i == sc->sc_num_channels) {
++ /*
++ * haven't seen this algo the last sc_num_channels or more
++ * use round robin in this case
++ * nb: sc->sc_num_channels must be power of 2
++ */
++ chsel = (chsel + 1) & (sc->sc_num_channels - 1);
++ } else {
++ /*
++ * matches channel with same target execution unit;
++ * use same channel in this case
++ */
++ chsel = i;
++ }
++ sc->sc_chnlastalg[chsel] = crp->crp_desc->crd_alg;
++
++ /* release the channel scheduler lock */
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ /* acquire the selected channel fifo lock */
++ spin_lock_irqsave(&sc->sc_chnfifolock[chsel], flags);
++
++ /* find and reserve next available descriptor-cryptop pair */
++ for (i = 0; i < sc->sc_chfifo_len; i++) {
++ if (sc->sc_chnfifo[chsel][i].cf_desc.hdr == 0) {
++ /*
++ * ensure correct descriptor formation by
++ * avoiding inadvertently setting "optional" entries
++ * e.g. not using "optional" dptr2 for MD/HMAC descs
++ */
++ memset(&sc->sc_chnfifo[chsel][i].cf_desc,
++ 0, sizeof(*td));
++ /* reserve it with done notification request bit */
++ sc->sc_chnfifo[chsel][i].cf_desc.hdr |=
++ TALITOS_DONE_NOTIFY;
++ break;
++ }
++ }
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[chsel], flags);
++
++ if (i == sc->sc_chfifo_len) {
++ /* fifo full */
++ err = ERESTART;
++ goto errout;
++ }
++
++ td = &sc->sc_chnfifo[chsel][i].cf_desc;
++ sc->sc_chnfifo[chsel][i].cf_crp = crp;
++
++ crd1 = crp->crp_desc;
++ if (crd1 == NULL) {
++ err = EINVAL;
++ goto errout;
++ }
++ crd2 = crd1->crd_next;
++ /* prevent compiler warning */
++ hmac_key = 0;
++ hmac_data = 0;
++ if (crd2 == NULL) {
++ td->hdr |= TD_TYPE_COMMON_NONSNOOP_NO_AFEU;
++ /* assign descriptor dword ptr mappings for this desc. type */
++ cipher_iv = 1;
++ cipher_key = 2;
++ in_fifo = 3;
++ cipher_iv_out = 5;
++ if (crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1 ||
++ crd1->crd_alg == CRYPTO_MD5) {
++ out_fifo = 5;
++ maccrd = crd1;
++ enccrd = NULL;
++ } else if (crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4) {
++ out_fifo = 4;
++ maccrd = NULL;
++ enccrd = crd1;
++ } else {
++ DPRINTF("UNKNOWN crd1->crd_alg %d\n", crd1->crd_alg);
++ err = EINVAL;
++ goto errout;
++ }
++ } else {
++ if (sc->sc_desc_types & TALITOS_HAS_DT_IPSEC_ESP) {
++ td->hdr |= TD_TYPE_IPSEC_ESP;
++ } else {
++ DPRINTF("unimplemented: multiple descriptor ipsec\n");
++ err = EINVAL;
++ goto errout;
++ }
++ /* assign descriptor dword ptr mappings for this desc. type */
++ hmac_key = 0;
++ hmac_data = 1;
++ cipher_iv = 2;
++ cipher_key = 3;
++ in_fifo = 4;
++ out_fifo = 5;
++ cipher_iv_out = 6;
++ if ((crd1->crd_alg == CRYPTO_MD5_HMAC ||
++ crd1->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd1->crd_alg == CRYPTO_MD5 ||
++ crd1->crd_alg == CRYPTO_SHA1) &&
++ (crd2->crd_alg == CRYPTO_DES_CBC ||
++ crd2->crd_alg == CRYPTO_3DES_CBC ||
++ crd2->crd_alg == CRYPTO_AES_CBC ||
++ crd2->crd_alg == CRYPTO_ARC4) &&
++ ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) {
++ maccrd = crd1;
++ enccrd = crd2;
++ } else if ((crd1->crd_alg == CRYPTO_DES_CBC ||
++ crd1->crd_alg == CRYPTO_ARC4 ||
++ crd1->crd_alg == CRYPTO_3DES_CBC ||
++ crd1->crd_alg == CRYPTO_AES_CBC) &&
++ (crd2->crd_alg == CRYPTO_MD5_HMAC ||
++ crd2->crd_alg == CRYPTO_SHA1_HMAC ||
++ crd2->crd_alg == CRYPTO_MD5 ||
++ crd2->crd_alg == CRYPTO_SHA1) &&
++ (crd1->crd_flags & CRD_F_ENCRYPT)) {
++ enccrd = crd1;
++ maccrd = crd2;
++ } else {
++ /* We cannot order the SEC as requested */
++ printk("%s: cannot do the order\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ }
++ /* assign in_fifo and out_fifo based on input/output struct type */
++ if (crp->crp_flags & CRYPTO_F_SKBUF) {
++ /* using SKB buffers */
++ struct sk_buff *skb = (struct sk_buff *)crp->crp_buf;
++ if (skb_shinfo(skb)->nr_frags) {
++ printk("%s: skb frags unimplemented\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ td->ptr[in_fifo].ptr = dma_map_single(NULL, skb->data,
++ skb->len, DMA_TO_DEVICE);
++ td->ptr[in_fifo].len = skb->len;
++ td->ptr[out_fifo].ptr = dma_map_single(NULL, skb->data,
++ skb->len, DMA_TO_DEVICE);
++ td->ptr[out_fifo].len = skb->len;
++ td->ptr[hmac_data].ptr = dma_map_single(NULL, skb->data,
++ skb->len, DMA_TO_DEVICE);
++ } else if (crp->crp_flags & CRYPTO_F_IOV) {
++ /* using IOV buffers */
++ struct uio *uiop = (struct uio *)crp->crp_buf;
++ if (uiop->uio_iovcnt > 1) {
++ printk("%s: iov frags unimplemented\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ td->ptr[in_fifo].ptr = dma_map_single(NULL,
++ uiop->uio_iov->iov_base, crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[in_fifo].len = crp->crp_ilen;
++ /* crp_olen is never set; always use crp_ilen */
++ td->ptr[out_fifo].ptr = dma_map_single(NULL,
++ uiop->uio_iov->iov_base,
++ crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[out_fifo].len = crp->crp_ilen;
++ } else {
++ /* using contig buffers */
++ td->ptr[in_fifo].ptr = dma_map_single(NULL,
++ crp->crp_buf, crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[in_fifo].len = crp->crp_ilen;
++ td->ptr[out_fifo].ptr = dma_map_single(NULL,
++ crp->crp_buf, crp->crp_ilen, DMA_TO_DEVICE);
++ td->ptr[out_fifo].len = crp->crp_ilen;
++ }
++ if (enccrd) {
++ switch (enccrd->crd_alg) {
++ case CRYPTO_3DES_CBC:
++ td->hdr |= TALITOS_MODE0_DEU_3DES;
++ /* FALLTHROUGH */
++ case CRYPTO_DES_CBC:
++ td->hdr |= TALITOS_SEL0_DEU
++ | TALITOS_MODE0_DEU_CBC;
++ if (enccrd->crd_flags & CRD_F_ENCRYPT)
++ td->hdr |= TALITOS_MODE0_DEU_ENC;
++ ivsize = 2*sizeof(u_int32_t);
++ DPRINTF("%cDES ses %d ch %d len %d\n",
++ (td->hdr & TALITOS_MODE0_DEU_3DES)?'3':'1',
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ case CRYPTO_AES_CBC:
++ td->hdr |= TALITOS_SEL0_AESU
++ | TALITOS_MODE0_AESU_CBC;
++ if (enccrd->crd_flags & CRD_F_ENCRYPT)
++ td->hdr |= TALITOS_MODE0_AESU_ENC;
++ ivsize = 4*sizeof(u_int32_t);
++ DPRINTF("AES ses %d ch %d len %d\n",
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ default:
++ printk("%s: unimplemented enccrd->crd_alg %d\n",
++ device_get_nameunit(sc->sc_cdev), enccrd->crd_alg);
++ err = EINVAL;
++ goto errout;
++ }
++ /*
++ * Setup encrypt/decrypt state. When using basic ops
++ * we can't use an inline IV because hash/crypt offset
++ * must be from the end of the IV to the start of the
++ * crypt data and this leaves out the preceding header
++ * from the hash calculation. Instead we place the IV
++ * in the state record and set the hash/crypt offset to
++ * copy both the header+IV.
++ */
++ if (enccrd->crd_flags & CRD_F_ENCRYPT) {
++ td->hdr |= TALITOS_DIR_OUTBOUND;
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT)
++ iv = enccrd->crd_iv;
++ else
++ iv = (caddr_t) ses->ses_iv;
++ if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0) {
++ crypto_copyback(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, iv);
++ }
++ } else {
++ td->hdr |= TALITOS_DIR_INBOUND;
++ if (enccrd->crd_flags & CRD_F_IV_EXPLICIT) {
++ iv = enccrd->crd_iv;
++ bcopy(enccrd->crd_iv, iv, ivsize);
++ } else {
++ iv = (caddr_t) ses->ses_iv;
++ crypto_copydata(crp->crp_flags, crp->crp_buf,
++ enccrd->crd_inject, ivsize, iv);
++ }
++ }
++ td->ptr[cipher_iv].ptr = dma_map_single(NULL, iv, ivsize,
++ DMA_TO_DEVICE);
++ td->ptr[cipher_iv].len = ivsize;
++ /*
++ * we don't need the cipher iv out length/pointer
++ * field to do ESP IPsec. Therefore we set the len field as 0,
++ * which tells the SEC not to do anything with this len/ptr
++ * field. Previously, when length/pointer as pointing to iv,
++ * it gave us corruption of packets.
++ */
++ td->ptr[cipher_iv_out].len = 0;
++ }
++ if (enccrd && maccrd) {
++ /* this is ipsec only for now */
++ td->hdr |= TALITOS_SEL1_MDEU
++ | TALITOS_MODE1_MDEU_INIT
++ | TALITOS_MODE1_MDEU_PAD;
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ td->hdr |= TALITOS_MODE1_MDEU_MD5;
++ break;
++ case CRYPTO_MD5_HMAC:
++ td->hdr |= TALITOS_MODE1_MDEU_MD5_HMAC;
++ break;
++ case CRYPTO_SHA1:
++ td->hdr |= TALITOS_MODE1_MDEU_SHA1;
++ break;
++ case CRYPTO_SHA1_HMAC:
++ td->hdr |= TALITOS_MODE1_MDEU_SHA1_HMAC;
++ break;
++ default:
++ /* We cannot order the SEC as requested */
++ printk("%s: cannot do the order\n",
++ device_get_nameunit(sc->sc_cdev));
++ err = EINVAL;
++ goto errout;
++ }
++ if ((maccrd->crd_alg == CRYPTO_MD5_HMAC) ||
++ (maccrd->crd_alg == CRYPTO_SHA1_HMAC)) {
++ /*
++ * The offset from hash data to the start of
++ * crypt data is the difference in the skips.
++ */
++ /* ipsec only for now */
++ td->ptr[hmac_key].ptr = dma_map_single(NULL,
++ ses->ses_hmac, ses->ses_hmac_len, DMA_TO_DEVICE);
++ td->ptr[hmac_key].len = ses->ses_hmac_len;
++ td->ptr[in_fifo].ptr += enccrd->crd_skip;
++ td->ptr[in_fifo].len = enccrd->crd_len;
++ td->ptr[out_fifo].ptr += enccrd->crd_skip;
++ td->ptr[out_fifo].len = enccrd->crd_len;
++ /* bytes of HMAC to postpend to ciphertext */
++ td->ptr[out_fifo].extent = ses->ses_mlen;
++ td->ptr[hmac_data].ptr += maccrd->crd_skip;
++ td->ptr[hmac_data].len = enccrd->crd_skip - maccrd->crd_skip;
++ }
++ if (enccrd->crd_flags & CRD_F_KEY_EXPLICIT) {
++ printk("%s: CRD_F_KEY_EXPLICIT unimplemented\n",
++ device_get_nameunit(sc->sc_cdev));
++ }
++ }
++ if (!enccrd && maccrd) {
++ /* single MD5 or SHA */
++ td->hdr |= TALITOS_SEL0_MDEU
++ | TALITOS_MODE0_MDEU_INIT
++ | TALITOS_MODE0_MDEU_PAD;
++ switch (maccrd->crd_alg) {
++ case CRYPTO_MD5:
++ td->hdr |= TALITOS_MODE0_MDEU_MD5;
++ DPRINTF("MD5 ses %d ch %d len %d\n",
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ case CRYPTO_MD5_HMAC:
++ td->hdr |= TALITOS_MODE0_MDEU_MD5_HMAC;
++ break;
++ case CRYPTO_SHA1:
++ td->hdr |= TALITOS_MODE0_MDEU_SHA1;
++ DPRINTF("SHA1 ses %d ch %d len %d\n",
++ (u32)TALITOS_SESSION(crp->crp_sid),
++ chsel, td->ptr[in_fifo].len);
++ break;
++ case CRYPTO_SHA1_HMAC:
++ td->hdr |= TALITOS_MODE0_MDEU_SHA1_HMAC;
++ break;
++ default:
++ /* We cannot order the SEC as requested */
++ DPRINTF("cannot do the order\n");
++ err = EINVAL;
++ goto errout;
++ }
++
++ if (crp->crp_flags & CRYPTO_F_IOV)
++ td->ptr[out_fifo].ptr += maccrd->crd_inject;
++
++ if ((maccrd->crd_alg == CRYPTO_MD5_HMAC) ||
++ (maccrd->crd_alg == CRYPTO_SHA1_HMAC)) {
++ td->ptr[hmac_key].ptr = dma_map_single(NULL,
++ ses->ses_hmac, ses->ses_hmac_len,
++ DMA_TO_DEVICE);
++ td->ptr[hmac_key].len = ses->ses_hmac_len;
++ }
++ }
++ else {
++ /* using process key (session data has duplicate) */
++ td->ptr[cipher_key].ptr = dma_map_single(NULL,
++ enccrd->crd_key, (enccrd->crd_klen + 7) / 8,
++ DMA_TO_DEVICE);
++ td->ptr[cipher_key].len = (enccrd->crd_klen + 7) / 8;
++ }
++ /* descriptor complete - GO! */
++ return talitos_submit(sc, td, chsel);
++
++errout:
++ if (err != ERESTART) {
++ crp->crp_etype = err;
++ crypto_done(crp);
++ }
++ return err;
++}
++
++/* go through all channels descriptors, notifying OCF what has
++ * _and_hasn't_ successfully completed and reset the device
++ * (otherwise it's up to decoding desc hdrs!)
++ */
++static void talitos_errorprocessing(struct talitos_softc *sc)
++{
++ unsigned long flags;
++ int i, j;
++
++ /* disable further scheduling until under control */
++ spin_lock_irqsave(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ if (debug) dump_talitos_status(sc);
++ /* go through descriptors, try and salvage those successfully done,
++ * and EIO those that weren't
++ */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ spin_lock_irqsave(&sc->sc_chnfifolock[i], flags);
++ for (j = 0; j < sc->sc_chfifo_len; j++) {
++ if (sc->sc_chnfifo[i][j].cf_desc.hdr) {
++ if ((sc->sc_chnfifo[i][j].cf_desc.hdr
++ & TALITOS_HDR_DONE_BITS)
++ != TALITOS_HDR_DONE_BITS) {
++ /* this one didn't finish */
++ /* signify in crp->etype */
++ sc->sc_chnfifo[i][j].cf_crp->crp_etype
++ = EIO;
++ }
++ } else
++ continue; /* free entry */
++ /* either way, notify ocf */
++ crypto_done(sc->sc_chnfifo[i][j].cf_crp);
++ /* and tag it available again
++ *
++ * memset to ensure correct descriptor formation by
++ * avoiding inadvertently setting "optional" entries
++ * e.g. not using "optional" dptr2 MD/HMAC processing
++ */
++ memset(&sc->sc_chnfifo[i][j].cf_desc,
++ 0, sizeof(struct talitos_desc));
++ }
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[i], flags);
++ }
++ /* reset and initialize the SEC h/w device */
++ talitos_reset_device(sc);
++ talitos_init_device(sc);
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ if (sc->sc_exec_units & TALITOS_HAS_EU_RNG)
++ talitos_rng_init(sc);
++#endif
++
++ /* Okay. Stand by. */
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[sc->sc_num_channels], flags);
++
++ return;
++}
++
++/* go through all channels descriptors, notifying OCF what's been done */
++static void talitos_doneprocessing(struct talitos_softc *sc)
++{
++ unsigned long flags;
++ int i, j;
++
++ /* go through descriptors looking for done bits */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ spin_lock_irqsave(&sc->sc_chnfifolock[i], flags);
++ for (j = 0; j < sc->sc_chfifo_len; j++) {
++ /* descriptor has done bits set? */
++ if ((sc->sc_chnfifo[i][j].cf_desc.hdr
++ & TALITOS_HDR_DONE_BITS)
++ == TALITOS_HDR_DONE_BITS) {
++ /* notify ocf */
++ crypto_done(sc->sc_chnfifo[i][j].cf_crp);
++ /* and tag it available again
++ *
++ * memset to ensure correct descriptor formation by
++ * avoiding inadvertently setting "optional" entries
++ * e.g. not using "optional" dptr2 MD/HMAC processing
++ */
++ memset(&sc->sc_chnfifo[i][j].cf_desc,
++ 0, sizeof(struct talitos_desc));
++ }
++ }
++ spin_unlock_irqrestore(&sc->sc_chnfifolock[i], flags);
++ }
++ return;
++}
++
++static irqreturn_t
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++talitos_intr(int irq, void *arg)
++#else
++talitos_intr(int irq, void *arg, struct pt_regs *regs)
++#endif
++{
++ struct talitos_softc *sc = arg;
++ u_int32_t v, v_hi;
++
++ /* ack */
++ v = talitos_read(sc->sc_base_addr + TALITOS_ISR);
++ v_hi = talitos_read(sc->sc_base_addr + TALITOS_ISR_HI);
++ talitos_write(sc->sc_base_addr + TALITOS_ICR, v);
++ talitos_write(sc->sc_base_addr + TALITOS_ICR_HI, v_hi);
++
++ if (unlikely(v & TALITOS_ISR_ERROR)) {
++ /* Okay, Houston, we've had a problem here. */
++ printk(KERN_DEBUG "%s: got error interrupt - ISR 0x%08x_%08x\n",
++ device_get_nameunit(sc->sc_cdev), v, v_hi);
++ talitos_errorprocessing(sc);
++ } else
++ if (likely(v & TALITOS_ISR_DONE)) {
++ talitos_doneprocessing(sc);
++ }
++ return IRQ_HANDLED;
++}
++
++/*
++ * Initialize registers we need to touch only once.
++ */
++static void
++talitos_init_device(struct talitos_softc *sc)
++{
++ u_int32_t v;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /* init all channels */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr +
++ i*TALITOS_CH_OFFSET + TALITOS_CH_CCCR_HI);
++ v |= TALITOS_CH_CCCR_HI_CDWE
++ | TALITOS_CH_CCCR_HI_CDIE; /* invoke interrupt if done */
++ talitos_write(sc->sc_base_addr +
++ i*TALITOS_CH_OFFSET + TALITOS_CH_CCCR_HI, v);
++ }
++ /* enable all interrupts */
++ v = talitos_read(sc->sc_base_addr + TALITOS_IMR);
++ v |= TALITOS_IMR_ALL;
++ talitos_write(sc->sc_base_addr + TALITOS_IMR, v);
++ v = talitos_read(sc->sc_base_addr + TALITOS_IMR_HI);
++ v |= TALITOS_IMR_HI_ERRONLY;
++ talitos_write(sc->sc_base_addr + TALITOS_IMR_HI, v);
++ return;
++}
++
++/*
++ * set the master reset bit on the device.
++ */
++static void
++talitos_reset_device_master(struct talitos_softc *sc)
++{
++ u_int32_t v;
++
++ /* Reset the device by writing 1 to MCR:SWR and waiting 'til cleared */
++ v = talitos_read(sc->sc_base_addr + TALITOS_MCR);
++ talitos_write(sc->sc_base_addr + TALITOS_MCR, v | TALITOS_MCR_SWR);
++
++ while (talitos_read(sc->sc_base_addr + TALITOS_MCR) & TALITOS_MCR_SWR)
++ cpu_relax();
++
++ return;
++}
++
++/*
++ * Resets the device. Values in the registers are left as is
++ * from the reset (i.e. initial values are assigned elsewhere).
++ */
++static void
++talitos_reset_device(struct talitos_softc *sc)
++{
++ u_int32_t v;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ /*
++ * Master reset
++ * errata documentation: warning: certain SEC interrupts
++ * are not fully cleared by writing the MCR:SWR bit,
++ * set bit twice to completely reset
++ */
++ talitos_reset_device_master(sc); /* once */
++ talitos_reset_device_master(sc); /* and once again */
++
++ /* reset all channels */
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ v = talitos_read(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCCR);
++ talitos_write(sc->sc_base_addr + i*TALITOS_CH_OFFSET +
++ TALITOS_CH_CCCR, v | TALITOS_CH_CCCR_RESET);
++ }
++}
++
++/* Set up the crypto device structure, private data,
++ * and anything else we need before we start */
++#ifdef CONFIG_PPC_MERGE
++static int talitos_probe(struct of_device *ofdev, const struct of_device_id *match)
++#else
++static int talitos_probe(struct platform_device *pdev)
++#endif
++{
++ struct talitos_softc *sc = NULL;
++ struct resource *r;
++#ifdef CONFIG_PPC_MERGE
++ struct device *device = &ofdev->dev;
++ struct device_node *np = ofdev->node;
++ const unsigned int *prop;
++ int err;
++ struct resource res;
++#endif
++ static int num_chips = 0;
++ int rc;
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++
++ sc = (struct talitos_softc *) kmalloc(sizeof(*sc), GFP_KERNEL);
++ if (!sc)
++ return -ENOMEM;
++ memset(sc, 0, sizeof(*sc));
++
++ softc_device_init(sc, DRV_NAME, num_chips, talitos_methods);
++
++ sc->sc_irq = -1;
++ sc->sc_cid = -1;
++#ifndef CONFIG_PPC_MERGE
++ sc->sc_dev = pdev;
++#endif
++ sc->sc_num = num_chips++;
++
++#ifdef CONFIG_PPC_MERGE
++ dev_set_drvdata(device, sc);
++#else
++ platform_set_drvdata(sc->sc_dev, sc);
++#endif
++
++ /* get the irq line */
++#ifdef CONFIG_PPC_MERGE
++ err = of_address_to_resource(np, 0, &res);
++ if (err)
++ return -EINVAL;
++ r = &res;
++
++ sc->sc_irq = irq_of_parse_and_map(np, 0);
++#else
++ /* get a pointer to the register memory */
++ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++
++ sc->sc_irq = platform_get_irq(pdev, 0);
++#endif
++ rc = request_irq(sc->sc_irq, talitos_intr, 0,
++ device_get_nameunit(sc->sc_cdev), sc);
++ if (rc) {
++ printk(KERN_ERR "%s: failed to hook irq %d\n",
++ device_get_nameunit(sc->sc_cdev), sc->sc_irq);
++ sc->sc_irq = -1;
++ goto out;
++ }
++
++ sc->sc_base_addr = (ocf_iomem_t) ioremap(r->start, (r->end - r->start));
++ if (!sc->sc_base_addr) {
++ printk(KERN_ERR "%s: failed to ioremap\n",
++ device_get_nameunit(sc->sc_cdev));
++ goto out;
++ }
++
++ /* figure out our SEC's properties and capabilities */
++ sc->sc_chiprev = (u64)talitos_read(sc->sc_base_addr + TALITOS_ID) << 32
++ | talitos_read(sc->sc_base_addr + TALITOS_ID_HI);
++ DPRINTF("sec id 0x%llx\n", sc->sc_chiprev);
++
++#ifdef CONFIG_PPC_MERGE
++ /* get SEC properties from device tree, defaulting to SEC 2.0 */
++
++ prop = of_get_property(np, "num-channels", NULL);
++ sc->sc_num_channels = prop ? *prop : TALITOS_NCHANNELS_SEC_2_0;
++
++ prop = of_get_property(np, "channel-fifo-len", NULL);
++ sc->sc_chfifo_len = prop ? *prop : TALITOS_CHFIFOLEN_SEC_2_0;
++
++ prop = of_get_property(np, "exec-units-mask", NULL);
++ sc->sc_exec_units = prop ? *prop : TALITOS_HAS_EUS_SEC_2_0;
++
++ prop = of_get_property(np, "descriptor-types-mask", NULL);
++ sc->sc_desc_types = prop ? *prop : TALITOS_HAS_DESCTYPES_SEC_2_0;
++#else
++ /* bulk should go away with openfirmware flat device tree support */
++ if (sc->sc_chiprev & TALITOS_ID_SEC_2_0) {
++ sc->sc_num_channels = TALITOS_NCHANNELS_SEC_2_0;
++ sc->sc_chfifo_len = TALITOS_CHFIFOLEN_SEC_2_0;
++ sc->sc_exec_units = TALITOS_HAS_EUS_SEC_2_0;
++ sc->sc_desc_types = TALITOS_HAS_DESCTYPES_SEC_2_0;
++ } else {
++ printk(KERN_ERR "%s: failed to id device\n",
++ device_get_nameunit(sc->sc_cdev));
++ goto out;
++ }
++#endif
++
++ /* + 1 is for the meta-channel lock used by the channel scheduler */
++ sc->sc_chnfifolock = (spinlock_t *) kmalloc(
++ (sc->sc_num_channels + 1) * sizeof(spinlock_t), GFP_KERNEL);
++ if (!sc->sc_chnfifolock)
++ goto out;
++ for (i = 0; i < sc->sc_num_channels + 1; i++) {
++ spin_lock_init(&sc->sc_chnfifolock[i]);
++ }
++
++ sc->sc_chnlastalg = (int *) kmalloc(
++ sc->sc_num_channels * sizeof(int), GFP_KERNEL);
++ if (!sc->sc_chnlastalg)
++ goto out;
++ memset(sc->sc_chnlastalg, 0, sc->sc_num_channels * sizeof(int));
++
++ sc->sc_chnfifo = (struct desc_cryptop_pair **) kmalloc(
++ sc->sc_num_channels * sizeof(struct desc_cryptop_pair *),
++ GFP_KERNEL);
++ if (!sc->sc_chnfifo)
++ goto out;
++ for (i = 0; i < sc->sc_num_channels; i++) {
++ sc->sc_chnfifo[i] = (struct desc_cryptop_pair *) kmalloc(
++ sc->sc_chfifo_len * sizeof(struct desc_cryptop_pair),
++ GFP_KERNEL);
++ if (!sc->sc_chnfifo[i])
++ goto out;
++ memset(sc->sc_chnfifo[i], 0,
++ sc->sc_chfifo_len * sizeof(struct desc_cryptop_pair));
++ }
++
++ /* reset and initialize the SEC h/w device */
++ talitos_reset_device(sc);
++ talitos_init_device(sc);
++
++ sc->sc_cid = crypto_get_driverid(softc_get_device(sc),CRYPTOCAP_F_HARDWARE);
++ if (sc->sc_cid < 0) {
++ printk(KERN_ERR "%s: could not get crypto driver id\n",
++ device_get_nameunit(sc->sc_cdev));
++ goto out;
++ }
++
++ /* register algorithms with the framework */
++ printk("%s:", device_get_nameunit(sc->sc_cdev));
++
++ if (sc->sc_exec_units & TALITOS_HAS_EU_RNG) {
++ printk(" rng");
++#ifdef CONFIG_OCF_RANDOMHARVEST
++ talitos_rng_init(sc);
++ crypto_rregister(sc->sc_cid, talitos_read_random, sc);
++#endif
++ }
++ if (sc->sc_exec_units & TALITOS_HAS_EU_DEU) {
++ printk(" des/3des");
++ crypto_register(sc->sc_cid, CRYPTO_3DES_CBC, 0, 0);
++ crypto_register(sc->sc_cid, CRYPTO_DES_CBC, 0, 0);
++ }
++ if (sc->sc_exec_units & TALITOS_HAS_EU_AESU) {
++ printk(" aes");
++ crypto_register(sc->sc_cid, CRYPTO_AES_CBC, 0, 0);
++ }
++ if (sc->sc_exec_units & TALITOS_HAS_EU_MDEU) {
++ printk(" md5");
++ crypto_register(sc->sc_cid, CRYPTO_MD5, 0, 0);
++ /* HMAC support only with IPsec for now */
++ crypto_register(sc->sc_cid, CRYPTO_MD5_HMAC, 0, 0);
++ printk(" sha1");
++ crypto_register(sc->sc_cid, CRYPTO_SHA1, 0, 0);
++ /* HMAC support only with IPsec for now */
++ crypto_register(sc->sc_cid, CRYPTO_SHA1_HMAC, 0, 0);
++ }
++ printk("\n");
++ return 0;
++
++out:
++#ifndef CONFIG_PPC_MERGE
++ talitos_remove(pdev);
++#endif
++ return -ENOMEM;
++}
++
++#ifdef CONFIG_PPC_MERGE
++static int talitos_remove(struct of_device *ofdev)
++#else
++static int talitos_remove(struct platform_device *pdev)
++#endif
++{
++#ifdef CONFIG_PPC_MERGE
++ struct talitos_softc *sc = dev_get_drvdata(&ofdev->dev);
++#else
++ struct talitos_softc *sc = platform_get_drvdata(pdev);
++#endif
++ int i;
++
++ DPRINTF("%s()\n", __FUNCTION__);
++ if (sc->sc_cid >= 0)
++ crypto_unregister_all(sc->sc_cid);
++ if (sc->sc_chnfifo) {
++ for (i = 0; i < sc->sc_num_channels; i++)
++ if (sc->sc_chnfifo[i])
++ kfree(sc->sc_chnfifo[i]);
++ kfree(sc->sc_chnfifo);
++ }
++ if (sc->sc_chnlastalg)
++ kfree(sc->sc_chnlastalg);
++ if (sc->sc_chnfifolock)
++ kfree(sc->sc_chnfifolock);
++ if (sc->sc_irq != -1)
++ free_irq(sc->sc_irq, sc);
++ if (sc->sc_base_addr)
++ iounmap((void *) sc->sc_base_addr);
++ kfree(sc);
++ return 0;
++}
++
++#ifdef CONFIG_PPC_MERGE
++static struct of_device_id talitos_match[] = {
++ {
++ .type = "crypto",
++ .compatible = "talitos",
++ },
++ {},
++};
++
++MODULE_DEVICE_TABLE(of, talitos_match);
++
++static struct of_platform_driver talitos_driver = {
++ .name = DRV_NAME,
++ .match_table = talitos_match,
++ .probe = talitos_probe,
++ .remove = talitos_remove,
++};
++
++static int __init talitos_init(void)
++{
++ return of_register_platform_driver(&talitos_driver);
++}
++
++static void __exit talitos_exit(void)
++{
++ of_unregister_platform_driver(&talitos_driver);
++}
++#else
++/* Structure for a platform device driver */
++static struct platform_driver talitos_driver = {
++ .probe = talitos_probe,
++ .remove = talitos_remove,
++ .driver = {
++ .name = "fsl-sec2",
++ }
++};
++
++static int __init talitos_init(void)
++{
++ return platform_driver_register(&talitos_driver);
++}
++
++static void __exit talitos_exit(void)
++{
++ platform_driver_unregister(&talitos_driver);
++}
++#endif
++
++module_init(talitos_init);
++module_exit(talitos_exit);
++
++MODULE_LICENSE("Dual BSD/GPL");
++MODULE_AUTHOR("kim.phillips@freescale.com");
++MODULE_DESCRIPTION("OCF driver for Freescale SEC (talitos)");
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/talitos/talitos_dev.h linux-2.6.29.1/crypto/ocf/talitos/talitos_dev.h
+--- linux-2.6.29.1.orig/crypto/ocf/talitos/talitos_dev.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/talitos/talitos_dev.h 2009-04-20 20:01:21.636564372 +0200
+@@ -0,0 +1,277 @@
++/*
++ * Freescale SEC (talitos) device dependent data structures
++ *
++ * Copyright (c) 2006 Freescale Semiconductor, Inc.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ */
++
++/* device ID register values */
++#define TALITOS_ID_SEC_2_0 0x40
++#define TALITOS_ID_SEC_2_1 0x40 /* cross ref with IP block revision reg */
++
++/*
++ * following num_channels, channel-fifo-depth, exec-unit-mask, and
++ * descriptor-types-mask are for forward-compatibility with openfirmware
++ * flat device trees
++ */
++
++/*
++ * num_channels : the number of channels available in each SEC version.
++ */
++
++/* n.b. this driver requires these values be a power of 2 */
++#define TALITOS_NCHANNELS_SEC_1_0 4
++#define TALITOS_NCHANNELS_SEC_1_2 1
++#define TALITOS_NCHANNELS_SEC_2_0 4
++#define TALITOS_NCHANNELS_SEC_2_01 4
++#define TALITOS_NCHANNELS_SEC_2_1 4
++#define TALITOS_NCHANNELS_SEC_2_4 4
++
++/*
++ * channel-fifo-depth : The number of descriptor
++ * pointers a channel fetch fifo can hold.
++ */
++#define TALITOS_CHFIFOLEN_SEC_1_0 1
++#define TALITOS_CHFIFOLEN_SEC_1_2 1
++#define TALITOS_CHFIFOLEN_SEC_2_0 24
++#define TALITOS_CHFIFOLEN_SEC_2_01 24
++#define TALITOS_CHFIFOLEN_SEC_2_1 24
++#define TALITOS_CHFIFOLEN_SEC_2_4 24
++
++/*
++ * exec-unit-mask : The bitmask representing what Execution Units (EUs)
++ * are available. EU information should be encoded following the SEC's
++ * EU_SEL0 bitfield documentation, i.e. as follows:
++ *
++ * bit 31 = set if SEC permits no-EU selection (should be always set)
++ * bit 30 = set if SEC has the ARC4 EU (AFEU)
++ * bit 29 = set if SEC has the des/3des EU (DEU)
++ * bit 28 = set if SEC has the message digest EU (MDEU)
++ * bit 27 = set if SEC has the random number generator EU (RNG)
++ * bit 26 = set if SEC has the public key EU (PKEU)
++ * bit 25 = set if SEC has the aes EU (AESU)
++ * bit 24 = set if SEC has the Kasumi EU (KEU)
++ *
++ */
++#define TALITOS_HAS_EU_NONE (1<<0)
++#define TALITOS_HAS_EU_AFEU (1<<1)
++#define TALITOS_HAS_EU_DEU (1<<2)
++#define TALITOS_HAS_EU_MDEU (1<<3)
++#define TALITOS_HAS_EU_RNG (1<<4)
++#define TALITOS_HAS_EU_PKEU (1<<5)
++#define TALITOS_HAS_EU_AESU (1<<6)
++#define TALITOS_HAS_EU_KEU (1<<7)
++
++/* the corresponding masks for each SEC version */
++#define TALITOS_HAS_EUS_SEC_1_0 0x7f
++#define TALITOS_HAS_EUS_SEC_1_2 0x4d
++#define TALITOS_HAS_EUS_SEC_2_0 0x7f
++#define TALITOS_HAS_EUS_SEC_2_01 0x7f
++#define TALITOS_HAS_EUS_SEC_2_1 0xff
++#define TALITOS_HAS_EUS_SEC_2_4 0x7f
++
++/*
++ * descriptor-types-mask : The bitmask representing what descriptors
++ * are available. Descriptor type information should be encoded
++ * following the SEC's Descriptor Header Dword DESC_TYPE field
++ * documentation, i.e. as follows:
++ *
++ * bit 0 = set if SEC supports the aesu_ctr_nonsnoop desc. type
++ * bit 1 = set if SEC supports the ipsec_esp descriptor type
++ * bit 2 = set if SEC supports the common_nonsnoop desc. type
++ * bit 3 = set if SEC supports the 802.11i AES ccmp desc. type
++ * bit 4 = set if SEC supports the hmac_snoop_no_afeu desc. type
++ * bit 5 = set if SEC supports the srtp descriptor type
++ * bit 6 = set if SEC supports the non_hmac_snoop_no_afeu desc.type
++ * bit 7 = set if SEC supports the pkeu_assemble descriptor type
++ * bit 8 = set if SEC supports the aesu_key_expand_output desc.type
++ * bit 9 = set if SEC supports the pkeu_ptmul descriptor type
++ * bit 10 = set if SEC supports the common_nonsnoop_afeu desc. type
++ * bit 11 = set if SEC supports the pkeu_ptadd_dbl descriptor type
++ *
++ * ..and so on and so forth.
++ */
++#define TALITOS_HAS_DT_AESU_CTR_NONSNOOP (1<<0)
++#define TALITOS_HAS_DT_IPSEC_ESP (1<<1)
++#define TALITOS_HAS_DT_COMMON_NONSNOOP (1<<2)
++
++/* the corresponding masks for each SEC version */
++#define TALITOS_HAS_DESCTYPES_SEC_2_0 0x01010ebf
++#define TALITOS_HAS_DESCTYPES_SEC_2_1 0x012b0ebf
++
++/*
++ * a TALITOS_xxx_HI address points to the low data bits (32-63) of the register
++ */
++
++/* global register offset addresses */
++#define TALITOS_ID 0x1020
++#define TALITOS_ID_HI 0x1024
++#define TALITOS_MCR 0x1030 /* master control register */
++#define TALITOS_MCR_HI 0x1038 /* master control register */
++#define TALITOS_MCR_SWR 0x1
++#define TALITOS_IMR 0x1008 /* interrupt mask register */
++#define TALITOS_IMR_ALL 0x00010fff /* enable all interrupts mask */
++#define TALITOS_IMR_ERRONLY 0x00010aaa /* enable error interrupts */
++#define TALITOS_IMR_HI 0x100C /* interrupt mask register */
++#define TALITOS_IMR_HI_ALL 0x00323333 /* enable all interrupts mask */
++#define TALITOS_IMR_HI_ERRONLY 0x00222222 /* enable error interrupts */
++#define TALITOS_ISR 0x1010 /* interrupt status register */
++#define TALITOS_ISR_ERROR 0x00010faa /* errors mask */
++#define TALITOS_ISR_DONE 0x00000055 /* channel(s) done mask */
++#define TALITOS_ISR_HI 0x1014 /* interrupt status register */
++#define TALITOS_ICR 0x1018 /* interrupt clear register */
++#define TALITOS_ICR_HI 0x101C /* interrupt clear register */
++
++/* channel register address stride */
++#define TALITOS_CH_OFFSET 0x100
++
++/* channel register offset addresses and bits */
++#define TALITOS_CH_CCCR 0x1108 /* Crypto-Channel Config Register */
++#define TALITOS_CH_CCCR_RESET 0x1 /* Channel Reset bit */
++#define TALITOS_CH_CCCR_HI 0x110c /* Crypto-Channel Config Register */
++#define TALITOS_CH_CCCR_HI_CDWE 0x10 /* Channel done writeback enable bit */
++#define TALITOS_CH_CCCR_HI_NT 0x4 /* Notification type bit */
++#define TALITOS_CH_CCCR_HI_CDIE 0x2 /* Channel Done Interrupt Enable bit */
++#define TALITOS_CH_CCPSR 0x1110 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_CCPSR_HI 0x1114 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_FF 0x1148 /* Fetch FIFO */
++#define TALITOS_CH_FF_HI 0x114c /* Fetch FIFO's FETCH_ADRS */
++#define TALITOS_CH_CDPR 0x1140 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_CDPR_HI 0x1144 /* Crypto-Channel Pointer Status Reg */
++#define TALITOS_CH_DESCBUF 0x1180 /* (thru 11bf) Crypto-Channel
++ * Descriptor Buffer (debug) */
++
++/* execution unit register offset addresses and bits */
++#define TALITOS_DEUSR 0x2028 /* DEU status register */
++#define TALITOS_DEUSR_HI 0x202c /* DEU status register */
++#define TALITOS_DEUISR 0x2030 /* DEU interrupt status register */
++#define TALITOS_DEUISR_HI 0x2034 /* DEU interrupt status register */
++#define TALITOS_DEUICR 0x2038 /* DEU interrupt control register */
++#define TALITOS_DEUICR_HI 0x203c /* DEU interrupt control register */
++#define TALITOS_AESUISR 0x4030 /* AESU interrupt status register */
++#define TALITOS_AESUISR_HI 0x4034 /* AESU interrupt status register */
++#define TALITOS_AESUICR 0x4038 /* AESU interrupt control register */
++#define TALITOS_AESUICR_HI 0x403c /* AESU interrupt control register */
++#define TALITOS_MDEUISR 0x6030 /* MDEU interrupt status register */
++#define TALITOS_MDEUISR_HI 0x6034 /* MDEU interrupt status register */
++#define TALITOS_RNGSR 0xa028 /* RNG status register */
++#define TALITOS_RNGSR_HI 0xa02c /* RNG status register */
++#define TALITOS_RNGSR_HI_RD 0x1 /* RNG Reset done */
++#define TALITOS_RNGSR_HI_OFL 0xff0000/* number of dwords in RNG output FIFO*/
++#define TALITOS_RNGDSR 0xa010 /* RNG data size register */
++#define TALITOS_RNGDSR_HI 0xa014 /* RNG data size register */
++#define TALITOS_RNG_FIFO 0xa800 /* RNG FIFO - pool of random numbers */
++#define TALITOS_RNGISR 0xa030 /* RNG Interrupt status register */
++#define TALITOS_RNGISR_HI 0xa034 /* RNG Interrupt status register */
++#define TALITOS_RNGRCR 0xa018 /* RNG Reset control register */
++#define TALITOS_RNGRCR_HI 0xa01c /* RNG Reset control register */
++#define TALITOS_RNGRCR_HI_SR 0x1 /* RNG RNGRCR:Software Reset */
++
++/* descriptor pointer entry */
++struct talitos_desc_ptr {
++ u16 len; /* length */
++ u8 extent; /* jump (to s/g link table) and extent */
++ u8 res; /* reserved */
++ u32 ptr; /* pointer */
++};
++
++/* descriptor */
++struct talitos_desc {
++ u32 hdr; /* header */
++ u32 res; /* reserved */
++ struct talitos_desc_ptr ptr[7]; /* ptr/len pair array */
++};
++
++/* talitos descriptor header (hdr) bits */
++
++/* primary execution unit select */
++#define TALITOS_SEL0_AFEU 0x10000000
++#define TALITOS_SEL0_DEU 0x20000000
++#define TALITOS_SEL0_MDEU 0x30000000
++#define TALITOS_SEL0_RNG 0x40000000
++#define TALITOS_SEL0_PKEU 0x50000000
++#define TALITOS_SEL0_AESU 0x60000000
++
++/* primary execution unit mode (MODE0) and derivatives */
++#define TALITOS_MODE0_AESU_CBC 0x00200000
++#define TALITOS_MODE0_AESU_ENC 0x00100000
++#define TALITOS_MODE0_DEU_CBC 0x00400000
++#define TALITOS_MODE0_DEU_3DES 0x00200000
++#define TALITOS_MODE0_DEU_ENC 0x00100000
++#define TALITOS_MODE0_MDEU_INIT 0x01000000 /* init starting regs */
++#define TALITOS_MODE0_MDEU_HMAC 0x00800000
++#define TALITOS_MODE0_MDEU_PAD 0x00400000 /* PD */
++#define TALITOS_MODE0_MDEU_MD5 0x00200000
++#define TALITOS_MODE0_MDEU_SHA256 0x00100000
++#define TALITOS_MODE0_MDEU_SHA1 0x00000000 /* SHA-160 */
++#define TALITOS_MODE0_MDEU_MD5_HMAC \
++ (TALITOS_MODE0_MDEU_MD5 | TALITOS_MODE0_MDEU_HMAC)
++#define TALITOS_MODE0_MDEU_SHA256_HMAC \
++ (TALITOS_MODE0_MDEU_SHA256 | TALITOS_MODE0_MDEU_HMAC)
++#define TALITOS_MODE0_MDEU_SHA1_HMAC \
++ (TALITOS_MODE0_MDEU_SHA1 | TALITOS_MODE0_MDEU_HMAC)
++
++/* secondary execution unit select (SEL1) */
++/* it's MDEU or nothing */
++#define TALITOS_SEL1_MDEU 0x00030000
++
++/* secondary execution unit mode (MODE1) and derivatives */
++#define TALITOS_MODE1_MDEU_INIT 0x00001000 /* init starting regs */
++#define TALITOS_MODE1_MDEU_HMAC 0x00000800
++#define TALITOS_MODE1_MDEU_PAD 0x00000400 /* PD */
++#define TALITOS_MODE1_MDEU_MD5 0x00000200
++#define TALITOS_MODE1_MDEU_SHA256 0x00000100
++#define TALITOS_MODE1_MDEU_SHA1 0x00000000 /* SHA-160 */
++#define TALITOS_MODE1_MDEU_MD5_HMAC \
++ (TALITOS_MODE1_MDEU_MD5 | TALITOS_MODE1_MDEU_HMAC)
++#define TALITOS_MODE1_MDEU_SHA256_HMAC \
++ (TALITOS_MODE1_MDEU_SHA256 | TALITOS_MODE1_MDEU_HMAC)
++#define TALITOS_MODE1_MDEU_SHA1_HMAC \
++ (TALITOS_MODE1_MDEU_SHA1 | TALITOS_MODE1_MDEU_HMAC)
++
++/* direction of overall data flow (DIR) */
++#define TALITOS_DIR_OUTBOUND 0x00000000
++#define TALITOS_DIR_INBOUND 0x00000002
++
++/* done notification (DN) */
++#define TALITOS_DONE_NOTIFY 0x00000001
++
++/* descriptor types */
++/* odd numbers here are valid on SEC2 and greater only (e.g. ipsec_esp) */
++#define TD_TYPE_AESU_CTR_NONSNOOP (0 << 3)
++#define TD_TYPE_IPSEC_ESP (1 << 3)
++#define TD_TYPE_COMMON_NONSNOOP_NO_AFEU (2 << 3)
++#define TD_TYPE_HMAC_SNOOP_NO_AFEU (4 << 3)
++
++#define TALITOS_HDR_DONE_BITS 0xff000000
++
++#define DPRINTF(a...) do { \
++ if (debug) { \
++ printk("%s: ", sc ? \
++ device_get_nameunit(sc->sc_cdev) : "talitos"); \
++ printk(a); \
++ } \
++ } while (0)
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/talitos/talitos_soft.h linux-2.6.29.1/crypto/ocf/talitos/talitos_soft.h
+--- linux-2.6.29.1.orig/crypto/ocf/talitos/talitos_soft.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/talitos/talitos_soft.h 2009-04-20 20:01:21.664565422 +0200
+@@ -0,0 +1,77 @@
++/*
++ * Freescale SEC data structures for integration with ocf-linux
++ *
++ * Copyright (c) 2006 Freescale Semiconductor, Inc.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/*
++ * paired descriptor and associated crypto operation
++ */
++struct desc_cryptop_pair {
++ struct talitos_desc cf_desc; /* descriptor ptr */
++ struct cryptop *cf_crp; /* cryptop ptr */
++};
++
++/*
++ * Holds data specific to a single talitos device.
++ */
++struct talitos_softc {
++ softc_device_decl sc_cdev;
++ struct platform_device *sc_dev; /* device backpointer */
++ ocf_iomem_t sc_base_addr;
++ int sc_irq;
++ int sc_num; /* if we have multiple chips */
++ int32_t sc_cid; /* crypto tag */
++ u64 sc_chiprev; /* major/minor chip revision */
++ int sc_nsessions;
++ struct talitos_session *sc_sessions;
++ int sc_num_channels;/* number of crypto channels */
++ int sc_chfifo_len; /* channel fetch fifo len */
++ int sc_exec_units; /* execution units mask */
++ int sc_desc_types; /* descriptor types mask */
++ /*
++ * mutual exclusion for intra-channel resources, e.g. fetch fifos
++ * the last entry is a meta-channel lock used by the channel scheduler
++ */
++ spinlock_t *sc_chnfifolock;
++ /* sc_chnlastalgo contains last algorithm for that channel */
++ int *sc_chnlastalg;
++ /* sc_chnfifo holds pending descriptor--crypto operation pairs */
++ struct desc_cryptop_pair **sc_chnfifo;
++};
++
++struct talitos_session {
++ u_int32_t ses_used;
++ u_int32_t ses_klen; /* key length in bits */
++ u_int32_t ses_key[8]; /* DES/3DES/AES key */
++ u_int32_t ses_hmac[5]; /* hmac inner state */
++ u_int32_t ses_hmac_len; /* hmac length */
++ u_int32_t ses_iv[4]; /* DES/3DES/AES iv */
++ u_int32_t ses_mlen; /* desired hash result len (12=ipsec or 16) */
++};
++
++#define TALITOS_SESSION(sid) ((sid) & 0x0fffffff)
++#define TALITOS_SID(crd, sesn) (((crd) << 28) | ((sesn) & 0x0fffffff))
+diff -Nur linux-2.6.29.1.orig/crypto/ocf/uio.h linux-2.6.29.1/crypto/ocf/uio.h
+--- linux-2.6.29.1.orig/crypto/ocf/uio.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/crypto/ocf/uio.h 2009-04-20 20:01:21.664565422 +0200
+@@ -0,0 +1,54 @@
++#ifndef _OCF_UIO_H_
++#define _OCF_UIO_H_
++
++#include <linux/uio.h>
++
++/*
++ * The linux uio.h doesn't have all we need. To be fully api compatible
++ * with the BSD cryptodev, we need to keep this around. Perhaps this can
++ * be moved back into the linux/uio.h
++ *
++ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
++ * Copyright (C) 2006-2007 David McCullough
++ * Copyright (C) 2004-2005 Intel Corporation.
++ *
++ * LICENSE TERMS
++ *
++ * The free distribution and use of this software in both source and binary
++ * form is allowed (with or without changes) provided that:
++ *
++ * 1. distributions of this source code include the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ *
++ * 2. distributions in binary form include the above copyright
++ * notice, this list of conditions and the following disclaimer
++ * in the documentation and/or other associated materials;
++ *
++ * 3. the copyright holder's name is not used to endorse products
++ * built using this software without specific written permission.
++ *
++ * ALTERNATIVELY, provided that this notice is retained in full, this product
++ * may be distributed under the terms of the GNU General Public License (GPL),
++ * in which case the provisions of the GPL apply INSTEAD OF those given above.
++ *
++ * DISCLAIMER
++ *
++ * This software is provided 'as is' with no explicit or implied warranties
++ * in respect of its properties, including, but not limited to, correctness
++ * and/or fitness for purpose.
++ * ---------------------------------------------------------------------------
++ */
++
++struct uio {
++ struct iovec *uio_iov;
++ int uio_iovcnt;
++ off_t uio_offset;
++ int uio_resid;
++#if 0
++ enum uio_seg uio_segflg;
++ enum uio_rw uio_rw;
++ struct thread *uio_td;
++#endif
++};
++
++#endif
+diff -Nur linux-2.6.29.1.orig/drivers/char/random.c linux-2.6.29.1/drivers/char/random.c
+--- linux-2.6.29.1.orig/drivers/char/random.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/char/random.c 2009-04-20 20:01:21.664565422 +0200
+@@ -129,6 +129,9 @@
+ * unsigned int value);
+ * void add_interrupt_randomness(int irq);
+ *
++ * void random_input_words(__u32 *buf, size_t wordcount, int ent_count)
++ * int random_input_wait(void);
++ *
+ * add_input_randomness() uses the input layer interrupt timing, as well as
+ * the event type information from the hardware.
+ *
+@@ -140,6 +143,13 @@
+ * a better measure, since the timing of the disk interrupts are more
+ * unpredictable.
+ *
++ * random_input_words() just provides a raw block of entropy to the input
++ * pool, such as from a hardware entropy generator.
++ *
++ * random_input_wait() suspends the caller until such time as the
++ * entropy pool falls below the write threshold, and returns a count of how
++ * much entropy (in bits) is needed to sustain the pool.
++ *
+ * All of these routines try to estimate how many bits of randomness a
+ * particular randomness source. They do this by keeping track of the
+ * first and second order deltas of the event timings.
+@@ -708,6 +718,61 @@
+ }
+ #endif
+
++/*
++ * random_input_words - add bulk entropy to pool
++ *
++ * @buf: buffer to add
++ * @wordcount: number of __u32 words to add
++ * @ent_count: total amount of entropy (in bits) to credit
++ *
++ * this provides bulk input of entropy to the input pool
++ *
++ */
++void random_input_words(__u32 *buf, size_t wordcount, int ent_count)
++{
++ mix_pool_bytes(&input_pool, buf, wordcount*4);
++
++ credit_entropy_bits(&input_pool, ent_count);
++
++ DEBUG_ENT("crediting %d bits => %d\n",
++ ent_count, input_pool.entropy_count);
++ /*
++ * Wake up waiting processes if we have enough
++ * entropy.
++ */
++ if (input_pool.entropy_count >= random_read_wakeup_thresh)
++ wake_up_interruptible(&random_read_wait);
++}
++EXPORT_SYMBOL(random_input_words);
++
++/*
++ * random_input_wait - wait until random needs entropy
++ *
++ * this function sleeps until the /dev/random subsystem actually
++ * needs more entropy, and then return the amount of entropy
++ * that it would be nice to have added to the system.
++ */
++int random_input_wait(void)
++{
++ int count;
++
++ wait_event_interruptible(random_write_wait,
++ input_pool.entropy_count < random_write_wakeup_thresh);
++
++ count = random_write_wakeup_thresh - input_pool.entropy_count;
++
++ /* likely we got woken up due to a signal */
++ if (count <= 0) count = random_read_wakeup_thresh;
++
++ DEBUG_ENT("requesting %d bits from input_wait()er %d<%d\n",
++ count,
++ input_pool.entropy_count, random_write_wakeup_thresh);
++
++ return count;
++}
++EXPORT_SYMBOL(random_input_wait);
++
++
+ #define EXTRACT_SIZE 10
+
+ /*********************************************************************
+diff -Nur linux-2.6.29.1.orig/fs/fcntl.c linux-2.6.29.1/fs/fcntl.c
+--- linux-2.6.29.1.orig/fs/fcntl.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/fs/fcntl.c 2009-04-20 20:01:21.668566770 +0200
+@@ -140,6 +140,7 @@
+ }
+ return ret;
+ }
++EXPORT_SYMBOL(sys_dup);
+
+ #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC | O_DIRECT | O_NOATIME)
+
+diff -Nur linux-2.6.29.1.orig/include/linux/miscdevice.h linux-2.6.29.1/include/linux/miscdevice.h
+--- linux-2.6.29.1.orig/include/linux/miscdevice.h 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/include/linux/miscdevice.h 2009-04-20 20:02:00.530996185 +0200
+@@ -12,6 +12,7 @@
+ #define APOLLO_MOUSE_MINOR 7
+ #define PC110PAD_MINOR 9
+ /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */
++#define CRYPTODEV_MINOR 70 /* /dev/crypto */
+ #define WATCHDOG_MINOR 130 /* Watchdog timer */
+ #define TEMP_MINOR 131 /* Temperature Sensor */
+ #define RTC_MINOR 135
+diff -Nur linux-2.6.29.1.orig/include/linux/random.h linux-2.6.29.1/include/linux/random.h
+--- linux-2.6.29.1.orig/include/linux/random.h 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/include/linux/random.h 2009-04-20 20:01:21.680566903 +0200
+@@ -34,6 +34,30 @@
+ /* Clear the entropy pool and associated counters. (Superuser only.) */
+ #define RNDCLEARPOOL _IO( 'R', 0x06 )
+
++#ifdef CONFIG_FIPS_RNG
++
++/* Size of seed value - equal to AES blocksize */
++#define AES_BLOCK_SIZE_BYTES 16
++#define SEED_SIZE_BYTES AES_BLOCK_SIZE_BYTES
++/* Size of AES key */
++#define KEY_SIZE_BYTES 16
++
++/* ioctl() structure used by FIPS 140-2 Tests */
++struct rand_fips_test {
++ unsigned char key[KEY_SIZE_BYTES]; /* Input */
++ unsigned char datetime[SEED_SIZE_BYTES]; /* Input */
++ unsigned char seed[SEED_SIZE_BYTES]; /* Input */
++ unsigned char result[SEED_SIZE_BYTES]; /* Output */
++};
++
++/* FIPS 140-2 RNG Variable Seed Test. (Superuser only.) */
++#define RNDFIPSVST _IOWR('R', 0x10, struct rand_fips_test)
++
++/* FIPS 140-2 RNG Monte Carlo Test. (Superuser only.) */
++#define RNDFIPSMCT _IOWR('R', 0x11, struct rand_fips_test)
++
++#endif /* #ifdef CONFIG_FIPS_RNG */
++
+ struct rand_pool_info {
+ int entropy_count;
+ int buf_size;
+@@ -50,6 +74,10 @@
+ unsigned int value);
+ extern void add_interrupt_randomness(int irq);
+
++extern void random_input_words(__u32 *buf, size_t wordcount, int ent_count);
++extern int random_input_wait(void);
++#define HAS_RANDOM_INPUT_WAIT 1
++
+ extern void get_random_bytes(void *buf, int nbytes);
+ void generate_random_uuid(unsigned char uuid_out[16]);
+
diff --git a/target/linux/patches/swconfig.patch b/target/linux/patches/swconfig.patch
new file mode 100644
index 000000000..4e34e5ff5
--- /dev/null
+++ b/target/linux/patches/swconfig.patch
@@ -0,0 +1,1075 @@
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/Kconfig linux-2.6.29.1/drivers/net/phy/Kconfig
+--- linux-2.6.29.1.orig/drivers/net/phy/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/phy/Kconfig 2009-04-16 18:23:27.308513617 +0200
+@@ -13,6 +13,12 @@
+
+ if PHYLIB
+
++config SWCONFIG
++ tristate "Switch configuration API"
++ ---help---
++ Switch configuration API using netlink. This allows
++ you to configure the VLAN features of certain switches.
++
+ comment "MII PHY device drivers"
+
+ config MARVELL_PHY
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/Makefile linux-2.6.29.1/drivers/net/phy/Makefile
+--- linux-2.6.29.1.orig/drivers/net/phy/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/phy/Makefile 2009-04-16 18:23:27.308513617 +0200
+@@ -3,6 +3,7 @@
+ libphy-objs := phy.o phy_device.o mdio_bus.o
+
+ obj-$(CONFIG_PHYLIB) += libphy.o
++obj-$(CONFIG_SWCONFIG) += swconfig.o
+ obj-$(CONFIG_MARVELL_PHY) += marvell.o
+ obj-$(CONFIG_DAVICOM_PHY) += davicom.o
+ obj-$(CONFIG_CICADA_PHY) += cicada.o
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/swconfig.c linux-2.6.29.1/drivers/net/phy/swconfig.c
+--- linux-2.6.29.1.orig/drivers/net/phy/swconfig.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/phy/swconfig.c 2009-04-16 18:21:39.053756855 +0200
+@@ -0,0 +1,872 @@
++/*
++ * swconfig.c: Switch configuration API
++ *
++ * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/types.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/if.h>
++#include <linux/if_ether.h>
++#include <linux/capability.h>
++#include <linux/skbuff.h>
++#include <linux/switch.h>
++
++//#define DEBUG 1
++#ifdef DEBUG
++#define DPRINTF(format, ...) printk("%s: " format, __func__, ##__VA_ARGS__)
++#else
++#define DPRINTF(...) do {} while(0)
++#endif
++
++MODULE_AUTHOR("Felix Fietkau <nbd@openwrt.org>");
++MODULE_LICENSE("GPL");
++
++static int swdev_id = 0;
++static struct list_head swdevs;
++static spinlock_t swdevs_lock = SPIN_LOCK_UNLOCKED;
++struct swconfig_callback;
++
++struct swconfig_callback
++{
++ struct sk_buff *msg;
++ struct genlmsghdr *hdr;
++ struct genl_info *info;
++ int cmd;
++
++ /* callback for filling in the message data */
++ int (*fill)(struct swconfig_callback *cb, void *arg);
++
++ /* callback for closing the message before sending it */
++ int (*close)(struct swconfig_callback *cb, void *arg);
++
++ struct nlattr *nest[4];
++ int args[4];
++};
++
++/* defaults */
++
++static int
++swconfig_get_vlan_ports(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ int ret;
++ if (val->port_vlan >= dev->vlans)
++ return -EINVAL;
++
++ if (!dev->get_vlan_ports)
++ return -EOPNOTSUPP;
++
++ ret = dev->get_vlan_ports(dev, val);
++ printk("SET PORTS %d\n", val->len);
++ return ret;
++}
++
++static int
++swconfig_set_vlan_ports(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ int i;
++
++ if (val->port_vlan >= dev->vlans)
++ return -EINVAL;
++
++ /* validate ports */
++ if (val->len > dev->ports)
++ return -EINVAL;
++
++ for (i = 0; i < val->len; i++) {
++ if (val->value.ports[i].id >= dev->ports)
++ return -EINVAL;
++ }
++
++ if (!dev->set_vlan_ports)
++ return -EOPNOTSUPP;
++
++ printk("SET PORTS %d\n", val->len);
++ return dev->set_vlan_ports(dev, val);
++}
++
++static int
++swconfig_apply_config(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ /* don't complain if not supported by the switch driver */
++ if (!dev->apply_config)
++ return 0;
++
++ return dev->apply_config(dev);
++}
++
++
++enum global_defaults {
++ GLOBAL_APPLY,
++};
++
++enum vlan_defaults {
++ VLAN_PORTS,
++};
++
++enum port_defaults {
++ PORT_LINK,
++};
++
++static struct switch_attr default_global[] = {
++ [GLOBAL_APPLY] = {
++ .type = SWITCH_TYPE_NOVAL,
++ .name = "apply",
++ .description = "Activate changes in the hardware",
++ .set = swconfig_apply_config,
++ }
++};
++
++static struct switch_attr default_port[] = {
++ [PORT_LINK] = {
++ .type = SWITCH_TYPE_INT,
++ .name = "link",
++ .description = "Current link speed",
++ }
++};
++
++static struct switch_attr default_vlan[] = {
++ [VLAN_PORTS] = {
++ .type = SWITCH_TYPE_PORTS,
++ .name = "ports",
++ .description = "VLAN port mapping",
++ .set = swconfig_set_vlan_ports,
++ .get = swconfig_get_vlan_ports,
++ },
++};
++
++
++static void swconfig_defaults_init(struct switch_dev *dev)
++{
++ dev->def_global = 0;
++ dev->def_vlan = 0;
++ dev->def_port = 0;
++
++ if (dev->get_vlan_ports || dev->set_vlan_ports)
++ set_bit(VLAN_PORTS, &dev->def_vlan);
++
++ /* always present, can be no-op */
++ set_bit(GLOBAL_APPLY, &dev->def_global);
++}
++
++
++static struct genl_family switch_fam = {
++ .id = GENL_ID_GENERATE,
++ .name = "switch",
++ .hdrsize = 0,
++ .version = 1,
++ .maxattr = SWITCH_ATTR_MAX,
++};
++
++static const struct nla_policy switch_policy[SWITCH_ATTR_MAX+1] = {
++ [SWITCH_ATTR_ID] = { .type = NLA_U32 },
++ [SWITCH_ATTR_OP_ID] = { .type = NLA_U32 },
++ [SWITCH_ATTR_OP_PORT] = { .type = NLA_U32 },
++ [SWITCH_ATTR_OP_VLAN] = { .type = NLA_U32 },
++ [SWITCH_ATTR_OP_VALUE_INT] = { .type = NLA_U32 },
++ [SWITCH_ATTR_OP_VALUE_STR] = { .type = NLA_NUL_STRING },
++ [SWITCH_ATTR_OP_VALUE_PORTS] = { .type = NLA_NESTED },
++ [SWITCH_ATTR_TYPE] = { .type = NLA_U32 },
++};
++
++static const struct nla_policy port_policy[SWITCH_PORT_ATTR_MAX+1] = {
++ [SWITCH_PORT_ID] = { .type = NLA_U32 },
++ [SWITCH_PORT_FLAG_TAGGED] = { .type = NLA_FLAG },
++};
++
++static inline void
++swconfig_lock(void)
++{
++ spin_lock(&swdevs_lock);
++}
++
++static inline void
++swconfig_unlock(void)
++{
++ spin_unlock(&swdevs_lock);
++}
++
++static struct switch_dev *
++swconfig_get_dev(struct genl_info *info)
++{
++ struct switch_dev *dev = NULL;
++ struct switch_dev *p;
++ int id;
++
++ if (!info->attrs[SWITCH_ATTR_ID])
++ goto done;
++
++ id = nla_get_u32(info->attrs[SWITCH_ATTR_ID]);
++ swconfig_lock();
++ list_for_each_entry(p, &swdevs, dev_list) {
++ if (id != p->id)
++ continue;
++
++ dev = p;
++ break;
++ }
++ if (dev)
++ spin_lock(&dev->lock);
++ else
++ DPRINTF("device %d not found\n", id);
++ swconfig_unlock();
++done:
++ return dev;
++}
++
++static inline void
++swconfig_put_dev(struct switch_dev *dev)
++{
++ spin_unlock(&dev->lock);
++}
++
++static int
++swconfig_dump_attr(struct swconfig_callback *cb, void *arg)
++{
++ struct switch_attr *op = arg;
++ struct genl_info *info = cb->info;
++ struct sk_buff *msg = cb->msg;
++ int id = cb->args[0];
++ void *hdr;
++
++ hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, &switch_fam,
++ NLM_F_MULTI, SWITCH_CMD_NEW_ATTR);
++ if (IS_ERR(hdr))
++ return -1;
++
++ NLA_PUT_U32(msg, SWITCH_ATTR_OP_ID, id);
++ NLA_PUT_U32(msg, SWITCH_ATTR_OP_TYPE, op->type);
++ NLA_PUT_STRING(msg, SWITCH_ATTR_OP_NAME, op->name);
++ if (op->description)
++ NLA_PUT_STRING(msg, SWITCH_ATTR_OP_DESCRIPTION,
++ op->description);
++
++ return genlmsg_end(msg, hdr);
++nla_put_failure:
++ genlmsg_cancel(msg, hdr);
++ return -EMSGSIZE;
++}
++
++/* spread multipart messages across multiple message buffers */
++static int
++swconfig_send_multipart(struct swconfig_callback *cb, void *arg)
++{
++ struct genl_info *info = cb->info;
++ int restart = 0;
++ int err;
++
++ do {
++ if (!cb->msg) {
++ cb->msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
++ if (cb->msg == NULL)
++ goto error;
++ }
++
++ if (!(cb->fill(cb, arg) < 0))
++ break;
++
++ /* fill failed, check if this was already the second attempt */
++ if (restart)
++ goto error;
++
++ /* try again in a new message, send the current one */
++ restart = 1;
++ if (cb->close) {
++ if (cb->close(cb, arg) < 0)
++ goto error;
++ }
++ err = genlmsg_unicast(cb->msg, info->snd_pid);
++ cb->msg = NULL;
++ if (err < 0)
++ goto error;
++
++ } while (restart);
++
++ return 0;
++
++error:
++ if (cb->msg)
++ nlmsg_free(cb->msg);
++ return -1;
++}
++
++static int
++swconfig_list_attrs(struct sk_buff *skb, struct genl_info *info)
++{
++ struct genlmsghdr *hdr = nlmsg_data(info->nlhdr);
++ const struct switch_attrlist *alist;
++ struct switch_dev *dev;
++ struct swconfig_callback cb;
++ int err = -EINVAL;
++ int i;
++
++ /* defaults */
++ struct switch_attr *def_list;
++ unsigned long *def_active;
++ int n_def;
++
++ dev = swconfig_get_dev(info);
++ if (!dev)
++ return -EINVAL;
++
++ switch(hdr->cmd) {
++ case SWITCH_CMD_LIST_GLOBAL:
++ alist = &dev->attr_global;
++ def_list = default_global;
++ def_active = &dev->def_global;
++ n_def = ARRAY_SIZE(default_global);
++ break;
++ case SWITCH_CMD_LIST_VLAN:
++ alist = &dev->attr_vlan;
++ def_list = default_vlan;
++ def_active = &dev->def_vlan;
++ n_def = ARRAY_SIZE(default_vlan);
++ break;
++ case SWITCH_CMD_LIST_PORT:
++ alist = &dev->attr_port;
++ def_list = default_port;
++ def_active = &dev->def_port;
++ n_def = ARRAY_SIZE(default_port);
++ break;
++ default:
++ WARN_ON(1);
++ goto out;
++ }
++
++ memset(&cb, 0, sizeof(cb));
++ cb.info = info;
++ cb.fill = swconfig_dump_attr;
++ for (i = 0; i < alist->n_attr; i++) {
++ if (alist->attr[i].disabled)
++ continue;
++ cb.args[0] = i;
++ err = swconfig_send_multipart(&cb, &alist->attr[i]);
++ if (err < 0)
++ goto error;
++ }
++
++ /* defaults */
++ for (i = 0; i < n_def; i++) {
++ if (!test_bit(i, def_active))
++ continue;
++ cb.args[0] = SWITCH_ATTR_DEFAULTS_OFFSET + i;
++ err = swconfig_send_multipart(&cb, &def_list[i]);
++ if (err < 0)
++ goto error;
++ }
++ swconfig_put_dev(dev);
++
++ if (!cb.msg)
++ return 0;
++
++ return genlmsg_unicast(cb.msg, info->snd_pid);
++
++error:
++ if (cb.msg)
++ nlmsg_free(cb.msg);
++out:
++ swconfig_put_dev(dev);
++ return err;
++}
++
++static struct switch_attr *
++swconfig_lookup_attr(struct switch_dev *dev, struct genl_info *info,
++ struct switch_val *val)
++{
++ struct genlmsghdr *hdr = nlmsg_data(info->nlhdr);
++ const struct switch_attrlist *alist;
++ struct switch_attr *attr = NULL;
++ int attr_id;
++
++ /* defaults */
++ struct switch_attr *def_list;
++ unsigned long *def_active;
++ int n_def;
++
++ if (!info->attrs[SWITCH_ATTR_OP_ID])
++ goto done;
++
++ switch(hdr->cmd) {
++ case SWITCH_CMD_SET_GLOBAL:
++ case SWITCH_CMD_GET_GLOBAL:
++ alist = &dev->attr_global;
++ def_list = default_global;
++ def_active = &dev->def_global;
++ n_def = ARRAY_SIZE(default_global);
++ break;
++ case SWITCH_CMD_SET_VLAN:
++ case SWITCH_CMD_GET_VLAN:
++ alist = &dev->attr_vlan;
++ def_list = default_vlan;
++ def_active = &dev->def_vlan;
++ n_def = ARRAY_SIZE(default_vlan);
++ if (!info->attrs[SWITCH_ATTR_OP_VLAN])
++ goto done;
++ val->port_vlan = nla_get_u32(info->attrs[SWITCH_ATTR_OP_VLAN]);
++ break;
++ case SWITCH_CMD_SET_PORT:
++ case SWITCH_CMD_GET_PORT:
++ alist = &dev->attr_port;
++ def_list = default_port;
++ def_active = &dev->def_port;
++ n_def = ARRAY_SIZE(default_port);
++ if (!info->attrs[SWITCH_ATTR_OP_PORT])
++ goto done;
++ val->port_vlan = nla_get_u32(info->attrs[SWITCH_ATTR_OP_PORT]);
++ break;
++ default:
++ WARN_ON(1);
++ goto done;
++ }
++
++ if (!alist)
++ goto done;
++
++ attr_id = nla_get_u32(info->attrs[SWITCH_ATTR_OP_ID]);
++ if (attr_id >= SWITCH_ATTR_DEFAULTS_OFFSET) {
++ attr_id -= SWITCH_ATTR_DEFAULTS_OFFSET;
++ if (attr_id >= n_def)
++ goto done;
++ if (!test_bit(attr_id, def_active))
++ goto done;
++ attr = &def_list[attr_id];
++ } else {
++ if (attr_id >= alist->n_attr)
++ goto done;
++ attr = &alist->attr[attr_id];
++ }
++
++ if (attr->disabled)
++ attr = NULL;
++
++done:
++ if (!attr)
++ DPRINTF("attribute lookup failed\n");
++ val->attr = attr;
++ return attr;
++}
++
++static int
++swconfig_parse_ports(struct sk_buff *msg, struct nlattr *head,
++ struct switch_val *val, int max)
++{
++ struct nlattr *nla;
++ int rem;
++
++ val->len = 0;
++ nla_for_each_nested(nla, head, rem) {
++ struct nlattr *tb[SWITCH_PORT_ATTR_MAX+1];
++ struct switch_port *port = &val->value.ports[val->len];
++
++ if (val->len >= max)
++ return -EINVAL;
++
++ if (nla_parse_nested(tb, SWITCH_PORT_ATTR_MAX, nla,
++ port_policy))
++ return -EINVAL;
++
++ if (!tb[SWITCH_PORT_ID])
++ return -EINVAL;
++
++ port->id = nla_get_u32(tb[SWITCH_PORT_ID]);
++ if (tb[SWITCH_PORT_FLAG_TAGGED])
++ port->flags |= (1 << SWITCH_PORT_FLAG_TAGGED);
++ val->len++;
++ }
++
++ return 0;
++}
++
++static int
++swconfig_set_attr(struct sk_buff *skb, struct genl_info *info)
++{
++ struct switch_attr *attr;
++ struct switch_dev *dev;
++ struct switch_val val;
++ int err = -EINVAL;
++
++ dev = swconfig_get_dev(info);
++ if (!dev)
++ return -EINVAL;
++
++ memset(&val, 0, sizeof(val));
++ attr = swconfig_lookup_attr(dev, info, &val);
++ if (!attr || !attr->set)
++ goto error;
++
++ val.attr = attr;
++ switch(attr->type) {
++ case SWITCH_TYPE_NOVAL:
++ break;
++ case SWITCH_TYPE_INT:
++ if (!info->attrs[SWITCH_ATTR_OP_VALUE_INT])
++ goto error;
++ val.value.i =
++ nla_get_u32(info->attrs[SWITCH_ATTR_OP_VALUE_INT]);
++ break;
++ case SWITCH_TYPE_STRING:
++ if (!info->attrs[SWITCH_ATTR_OP_VALUE_STR])
++ goto error;
++ val.value.s =
++ nla_data(info->attrs[SWITCH_ATTR_OP_VALUE_STR]);
++ break;
++ case SWITCH_TYPE_PORTS:
++ val.value.ports = dev->portbuf;
++ memset(dev->portbuf, 0,
++ sizeof(struct switch_port) * dev->ports);
++
++ /* TODO: implement multipart? */
++ if (info->attrs[SWITCH_ATTR_OP_VALUE_PORTS]) {
++ err = swconfig_parse_ports(skb,
++ info->attrs[SWITCH_ATTR_OP_VALUE_PORTS], &val, dev->ports);
++ if (err < 0)
++ goto error;
++ } else {
++ val.len = 0;
++ err = 0;
++ }
++ break;
++ default:
++ goto error;
++ }
++
++ err = attr->set(dev, attr, &val);
++error:
++ swconfig_put_dev(dev);
++ return err;
++}
++
++static int
++swconfig_close_portlist(struct swconfig_callback *cb, void *arg)
++{
++ if (cb->nest[0])
++ nla_nest_end(cb->msg, cb->nest[0]);
++ return 0;
++}
++
++static int
++swconfig_send_port(struct swconfig_callback *cb, void *arg)
++{
++ const struct switch_port *port = arg;
++ struct nlattr *p = NULL;
++
++ if (!cb->nest[0]) {
++ cb->nest[0] = nla_nest_start(cb->msg, cb->cmd);
++ if (!cb->nest[0])
++ return -1;
++ }
++
++ p = nla_nest_start(cb->msg, SWITCH_ATTR_PORT);
++ if (!p)
++ goto error;
++
++ NLA_PUT_U32(cb->msg, SWITCH_PORT_ID, port->id);
++ if (port->flags & (1 << SWITCH_PORT_FLAG_TAGGED))
++ NLA_PUT_FLAG(cb->msg, SWITCH_PORT_FLAG_TAGGED);
++
++ nla_nest_end(cb->msg, p);
++ return 0;
++
++nla_put_failure:
++ nla_nest_cancel(cb->msg, p);
++error:
++ nla_nest_cancel(cb->msg, cb->nest[0]);
++ return -1;
++}
++
++static int
++swconfig_send_ports(struct sk_buff **msg, struct genl_info *info, int attr,
++ const struct switch_val *val)
++{
++ struct swconfig_callback cb;
++ int err = 0;
++ int i;
++
++ if (!val->value.ports)
++ return -EINVAL;
++
++ memset(&cb, 0, sizeof(cb));
++ cb.cmd = attr;
++ cb.msg = *msg;
++ cb.info = info;
++ cb.fill = swconfig_send_port;
++ cb.close = swconfig_close_portlist;
++
++ cb.nest[0] = nla_nest_start(cb.msg, cb.cmd);
++ for (i = 0; i < val->len; i++) {
++ err = swconfig_send_multipart(&cb, &val->value.ports[i]);
++ if (err)
++ goto done;
++ }
++ err = val->len;
++ swconfig_close_portlist(&cb, NULL);
++ *msg = cb.msg;
++
++done:
++ return err;
++}
++
++static int
++swconfig_get_attr(struct sk_buff *skb, struct genl_info *info)
++{
++ struct genlmsghdr *hdr = nlmsg_data(info->nlhdr);
++ struct switch_attr *attr;
++ struct switch_dev *dev;
++ struct sk_buff *msg = NULL;
++ struct switch_val val;
++ int err = -EINVAL;
++ int cmd = hdr->cmd;
++
++ dev = swconfig_get_dev(info);
++ if (!dev)
++ return -EINVAL;
++
++ memset(&val, 0, sizeof(val));
++ attr = swconfig_lookup_attr(dev, info, &val);
++ if (!attr || !attr->get)
++ goto error_dev;
++
++ if (attr->type == SWITCH_TYPE_PORTS) {
++ val.value.ports = dev->portbuf;
++ memset(dev->portbuf, 0,
++ sizeof(struct switch_port) * dev->ports);
++ }
++
++ err = attr->get(dev, attr, &val);
++ if (err)
++ goto error;
++
++ msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
++ if (!msg)
++ goto error;
++
++ hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, &switch_fam,
++ 0, cmd);
++ if (IS_ERR(hdr))
++ goto nla_put_failure;
++
++ switch(attr->type) {
++ case SWITCH_TYPE_INT:
++ NLA_PUT_U32(msg, SWITCH_ATTR_OP_VALUE_INT, val.value.i);
++ break;
++ case SWITCH_TYPE_STRING:
++ NLA_PUT_STRING(msg, SWITCH_ATTR_OP_VALUE_STR, val.value.s);
++ break;
++ case SWITCH_TYPE_PORTS:
++ err = swconfig_send_ports(&msg, info,
++ SWITCH_ATTR_OP_VALUE_PORTS, &val);
++ if (err < 0)
++ goto nla_put_failure;
++ break;
++ default:
++ DPRINTF("invalid type in attribute\n");
++ err = -EINVAL;
++ goto error;
++ }
++ err = genlmsg_end(msg, hdr);
++ if (err < 0)
++ goto nla_put_failure;
++
++ swconfig_put_dev(dev);
++ return genlmsg_unicast(msg, info->snd_pid);
++
++nla_put_failure:
++ if (msg)
++ nlmsg_free(msg);
++error_dev:
++ swconfig_put_dev(dev);
++error:
++ if (!err)
++ err = -ENOMEM;
++ return err;
++}
++
++static int
++swconfig_send_switch(struct sk_buff *msg, u32 pid, u32 seq, int flags,
++ const struct switch_dev *dev)
++{
++ void *hdr;
++
++ hdr = genlmsg_put(msg, pid, seq, &switch_fam, flags,
++ SWITCH_CMD_NEW_ATTR);
++ if (IS_ERR(hdr))
++ return -1;
++
++ NLA_PUT_U32(msg, SWITCH_ATTR_ID, dev->id);
++ NLA_PUT_STRING(msg, SWITCH_ATTR_NAME, dev->name);
++ NLA_PUT_STRING(msg, SWITCH_ATTR_DEV_NAME, dev->devname);
++ NLA_PUT_U32(msg, SWITCH_ATTR_VLANS, dev->vlans);
++ NLA_PUT_U32(msg, SWITCH_ATTR_PORTS, dev->ports);
++
++ return genlmsg_end(msg, hdr);
++nla_put_failure:
++ genlmsg_cancel(msg, hdr);
++ return -EMSGSIZE;
++}
++
++static int swconfig_dump_switches(struct sk_buff *skb,
++ struct netlink_callback *cb)
++{
++ struct switch_dev *dev;
++ int start = cb->args[0];
++ int idx = 0;
++
++ swconfig_lock();
++ list_for_each_entry(dev, &swdevs, dev_list) {
++ if (++idx <= start)
++ continue;
++ if (swconfig_send_switch(skb, NETLINK_CB(cb->skb).pid,
++ cb->nlh->nlmsg_seq, NLM_F_MULTI,
++ dev) < 0)
++ break;
++ }
++ swconfig_unlock();
++ cb->args[0] = idx;
++
++ return skb->len;
++}
++
++static int
++swconfig_done(struct netlink_callback *cb)
++{
++ return 0;
++}
++
++static struct genl_ops swconfig_ops[] = {
++ {
++ .cmd = SWITCH_CMD_LIST_GLOBAL,
++ .doit = swconfig_list_attrs,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_LIST_VLAN,
++ .doit = swconfig_list_attrs,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_LIST_PORT,
++ .doit = swconfig_list_attrs,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_GET_GLOBAL,
++ .doit = swconfig_get_attr,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_GET_VLAN,
++ .doit = swconfig_get_attr,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_GET_PORT,
++ .doit = swconfig_get_attr,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_SET_GLOBAL,
++ .doit = swconfig_set_attr,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_SET_VLAN,
++ .doit = swconfig_set_attr,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_SET_PORT,
++ .doit = swconfig_set_attr,
++ .policy = switch_policy,
++ },
++ {
++ .cmd = SWITCH_CMD_GET_SWITCH,
++ .dumpit = swconfig_dump_switches,
++ .policy = switch_policy,
++ .done = swconfig_done,
++ }
++};
++
++int
++register_switch(struct switch_dev *dev, struct net_device *netdev)
++{
++ INIT_LIST_HEAD(&dev->dev_list);
++ if (netdev) {
++ dev->netdev = netdev;
++ if (!dev->devname)
++ dev->devname = netdev->name;
++ }
++ BUG_ON(!dev->devname);
++
++ if (dev->ports > 0) {
++ dev->portbuf = kzalloc(sizeof(struct switch_port) * dev->ports,
++ GFP_KERNEL);
++ if (!dev->portbuf)
++ return -ENOMEM;
++ }
++ dev->id = ++swdev_id;
++ swconfig_defaults_init(dev);
++ spin_lock_init(&dev->lock);
++ swconfig_lock();
++ list_add(&dev->dev_list, &swdevs);
++ swconfig_unlock();
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(register_switch);
++
++void
++unregister_switch(struct switch_dev *dev)
++{
++ kfree(dev->portbuf);
++ spin_lock(&dev->lock);
++ swconfig_lock();
++ list_del(&dev->dev_list);
++ swconfig_unlock();
++}
++EXPORT_SYMBOL_GPL(unregister_switch);
++
++
++static int __init
++swconfig_init(void)
++{
++ int i, err;
++
++ INIT_LIST_HEAD(&swdevs);
++ err = genl_register_family(&switch_fam);
++ if (err)
++ return err;
++
++ for (i = 0; i < ARRAY_SIZE(swconfig_ops); i++) {
++ err = genl_register_ops(&switch_fam, &swconfig_ops[i]);
++ if (err)
++ goto unregister;
++ }
++
++ return 0;
++
++unregister:
++ genl_unregister_family(&switch_fam);
++ return err;
++}
++
++static void __exit
++swconfig_exit(void)
++{
++ genl_unregister_family(&switch_fam);
++}
++
++module_init(swconfig_init);
++module_exit(swconfig_exit);
++
+diff -Nur linux-2.6.29.1.orig/include/linux/switch.h linux-2.6.29.1/include/linux/switch.h
+--- linux-2.6.29.1.orig/include/linux/switch.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/linux/switch.h 2009-04-16 18:21:57.228115363 +0200
+@@ -0,0 +1,168 @@
++/*
++ * switch.h: Switch configuration API
++ *
++ * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#ifndef __LINUX_SWITCH_H
++#define __LINUX_SWITCH_H
++
++#include <linux/types.h>
++#include <linux/netdevice.h>
++#include <linux/netlink.h>
++#include <linux/genetlink.h>
++#ifndef __KERNEL__
++#include <netlink/netlink.h>
++#include <netlink/genl/genl.h>
++#include <netlink/genl/ctrl.h>
++#else
++#include <net/genetlink.h>
++#endif
++
++/* main attributes */
++enum {
++ SWITCH_ATTR_UNSPEC,
++ /* global */
++ SWITCH_ATTR_TYPE,
++ /* device */
++ SWITCH_ATTR_ID,
++ SWITCH_ATTR_NAME,
++ SWITCH_ATTR_DEV_NAME,
++ SWITCH_ATTR_VLANS,
++ SWITCH_ATTR_PORTS,
++ /* attributes */
++ SWITCH_ATTR_OP_ID,
++ SWITCH_ATTR_OP_TYPE,
++ SWITCH_ATTR_OP_NAME,
++ SWITCH_ATTR_OP_PORT,
++ SWITCH_ATTR_OP_VLAN,
++ SWITCH_ATTR_OP_VALUE_INT,
++ SWITCH_ATTR_OP_VALUE_STR,
++ SWITCH_ATTR_OP_VALUE_PORTS,
++ SWITCH_ATTR_OP_DESCRIPTION,
++ /* port lists */
++ SWITCH_ATTR_PORT,
++ SWITCH_ATTR_MAX
++};
++
++/* commands */
++enum {
++ SWITCH_CMD_UNSPEC,
++ SWITCH_CMD_GET_SWITCH,
++ SWITCH_CMD_NEW_ATTR,
++ SWITCH_CMD_LIST_GLOBAL,
++ SWITCH_CMD_GET_GLOBAL,
++ SWITCH_CMD_SET_GLOBAL,
++ SWITCH_CMD_LIST_PORT,
++ SWITCH_CMD_GET_PORT,
++ SWITCH_CMD_SET_PORT,
++ SWITCH_CMD_LIST_VLAN,
++ SWITCH_CMD_GET_VLAN,
++ SWITCH_CMD_SET_VLAN
++};
++
++/* data types */
++enum switch_val_type {
++ SWITCH_TYPE_UNSPEC,
++ SWITCH_TYPE_INT,
++ SWITCH_TYPE_STRING,
++ SWITCH_TYPE_PORTS,
++ SWITCH_TYPE_NOVAL,
++};
++
++/* port nested attributes */
++enum {
++ SWITCH_PORT_UNSPEC,
++ SWITCH_PORT_ID,
++ SWITCH_PORT_FLAG_TAGGED,
++ SWITCH_PORT_ATTR_MAX
++};
++
++#define SWITCH_ATTR_DEFAULTS_OFFSET 0x1000
++
++#ifdef __KERNEL__
++
++struct switch_dev;
++struct switch_op;
++struct switch_val;
++struct switch_attr;
++struct switch_attrlist;
++
++int register_switch(struct switch_dev *dev, struct net_device *netdev);
++void unregister_switch(struct switch_dev *dev);
++
++struct switch_attrlist {
++ /* filled in by the driver */
++ int n_attr;
++ struct switch_attr *attr;
++};
++
++
++struct switch_dev {
++ int id;
++ void *priv;
++ const char *name;
++
++ /* NB: either devname or netdev must be set */
++ const char *devname;
++ struct net_device *netdev;
++
++ int ports;
++ int vlans;
++ int cpu_port;
++ struct switch_attrlist attr_global, attr_port, attr_vlan;
++
++ spinlock_t lock;
++ struct switch_port *portbuf;
++ struct list_head dev_list;
++ unsigned long def_global, def_port, def_vlan;
++
++ int (*get_vlan_ports)(struct switch_dev *dev, struct switch_val *val);
++ int (*set_vlan_ports)(struct switch_dev *dev, struct switch_val *val);
++ int (*apply_config)(struct switch_dev *dev);
++};
++
++struct switch_port {
++ u32 id;
++ u32 flags;
++};
++
++struct switch_val {
++ struct switch_attr *attr;
++ int port_vlan;
++ int len;
++ union {
++ const char *s;
++ u32 i;
++ struct switch_port *ports;
++ } value;
++};
++
++struct switch_attr {
++ int disabled;
++ int type;
++ const char *name;
++ const char *description;
++
++ int (*set)(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val);
++ int (*get)(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val);
++
++ /* for driver internal use */
++ int id;
++ int ofs;
++ int max;
++};
++
++#endif
++
++#endif
diff --git a/target/linux/patches/yaffs2.patch b/target/linux/patches/yaffs2.patch
new file mode 100644
index 000000000..6c384b74c
--- /dev/null
+++ b/target/linux/patches/yaffs2.patch
@@ -0,0 +1,15068 @@
+diff -Nur linux-2.6.29.1.orig/fs/Kconfig linux-2.6.29.1/fs/Kconfig
+--- linux-2.6.29.1.orig/fs/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/fs/Kconfig 2009-04-17 19:10:08.832961234 +0200
+@@ -209,6 +209,10 @@
+ source "fs/befs/Kconfig"
+ source "fs/bfs/Kconfig"
+ source "fs/efs/Kconfig"
++
++# Patched by YAFFS
++source "fs/yaffs2/Kconfig"
++
+ source "fs/jffs2/Kconfig"
+ # UBIFS File system configuration
+ source "fs/ubifs/Kconfig"
+diff -Nur linux-2.6.29.1.orig/fs/Makefile linux-2.6.29.1/fs/Makefile
+--- linux-2.6.29.1.orig/fs/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/fs/Makefile 2009-04-17 19:10:08.868964144 +0200
+@@ -124,3 +124,6 @@
+ obj-$(CONFIG_OCFS2_FS) += ocfs2/
+ obj-$(CONFIG_BTRFS_FS) += btrfs/
+ obj-$(CONFIG_GFS2_FS) += gfs2/
++
++# Patched by YAFFS
++obj-$(CONFIG_YAFFS_FS) += yaffs2/
+diff -Nur linux-2.6.29.1.orig/fs/Makefile.pre.yaffs linux-2.6.29.1/fs/Makefile.pre.yaffs
+--- linux-2.6.29.1.orig/fs/Makefile.pre.yaffs 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/Makefile.pre.yaffs 2009-04-17 19:10:08.864962796 +0200
+@@ -0,0 +1,126 @@
++#
++# Makefile for the Linux filesystems.
++#
++# 14 Sep 2000, Christoph Hellwig <hch@infradead.org>
++# Rewritten to use lists instead of if-statements.
++#
++
++obj-y := open.o read_write.o file_table.o super.o \
++ char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
++ ioctl.o readdir.o select.o fifo.o dcache.o inode.o \
++ attr.o bad_inode.o file.o filesystems.o namespace.o \
++ seq_file.o xattr.o libfs.o fs-writeback.o \
++ pnode.o drop_caches.o splice.o sync.o utimes.o \
++ stack.o
++
++ifeq ($(CONFIG_BLOCK),y)
++obj-y += buffer.o bio.o block_dev.o direct-io.o mpage.o ioprio.o
++else
++obj-y += no-block.o
++endif
++
++obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o
++obj-y += notify/
++obj-$(CONFIG_EPOLL) += eventpoll.o
++obj-$(CONFIG_ANON_INODES) += anon_inodes.o
++obj-$(CONFIG_SIGNALFD) += signalfd.o
++obj-$(CONFIG_TIMERFD) += timerfd.o
++obj-$(CONFIG_EVENTFD) += eventfd.o
++obj-$(CONFIG_AIO) += aio.o
++obj-$(CONFIG_FILE_LOCKING) += locks.o
++obj-$(CONFIG_COMPAT) += compat.o compat_ioctl.o
++
++nfsd-$(CONFIG_NFSD) := nfsctl.o
++obj-y += $(nfsd-y) $(nfsd-m)
++
++obj-$(CONFIG_BINFMT_AOUT) += binfmt_aout.o
++obj-$(CONFIG_BINFMT_EM86) += binfmt_em86.o
++obj-$(CONFIG_BINFMT_MISC) += binfmt_misc.o
++
++# binfmt_script is always there
++obj-y += binfmt_script.o
++
++obj-$(CONFIG_BINFMT_ELF) += binfmt_elf.o
++obj-$(CONFIG_COMPAT_BINFMT_ELF) += compat_binfmt_elf.o
++obj-$(CONFIG_BINFMT_ELF_FDPIC) += binfmt_elf_fdpic.o
++obj-$(CONFIG_BINFMT_SOM) += binfmt_som.o
++obj-$(CONFIG_BINFMT_FLAT) += binfmt_flat.o
++
++obj-$(CONFIG_FS_MBCACHE) += mbcache.o
++obj-$(CONFIG_FS_POSIX_ACL) += posix_acl.o xattr_acl.o
++obj-$(CONFIG_NFS_COMMON) += nfs_common/
++obj-$(CONFIG_GENERIC_ACL) += generic_acl.o
++
++obj-$(CONFIG_QUOTA) += dquot.o
++obj-$(CONFIG_QFMT_V1) += quota_v1.o
++obj-$(CONFIG_QFMT_V2) += quota_v2.o
++obj-$(CONFIG_QUOTA_TREE) += quota_tree.o
++obj-$(CONFIG_QUOTACTL) += quota.o
++
++obj-$(CONFIG_PROC_FS) += proc/
++obj-y += partitions/
++obj-$(CONFIG_SYSFS) += sysfs/
++obj-$(CONFIG_CONFIGFS_FS) += configfs/
++obj-y += devpts/
++
++obj-$(CONFIG_PROFILING) += dcookies.o
++obj-$(CONFIG_DLM) += dlm/
++
++# Do not add any filesystems before this line
++obj-$(CONFIG_REISERFS_FS) += reiserfs/
++obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3
++obj-$(CONFIG_EXT2_FS) += ext2/
++# We place ext4 after ext2 so plain ext2 root fs's are mounted using ext2
++# unless explicitly requested by rootfstype
++obj-$(CONFIG_EXT4_FS) += ext4/
++obj-$(CONFIG_JBD) += jbd/
++obj-$(CONFIG_JBD2) += jbd2/
++obj-$(CONFIG_CRAMFS) += cramfs/
++obj-$(CONFIG_SQUASHFS) += squashfs/
++obj-y += ramfs/
++obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
++obj-$(CONFIG_CODA_FS) += coda/
++obj-$(CONFIG_MINIX_FS) += minix/
++obj-$(CONFIG_FAT_FS) += fat/
++obj-$(CONFIG_BFS_FS) += bfs/
++obj-$(CONFIG_ISO9660_FS) += isofs/
++obj-$(CONFIG_HFSPLUS_FS) += hfsplus/ # Before hfs to find wrapped HFS+
++obj-$(CONFIG_HFS_FS) += hfs/
++obj-$(CONFIG_ECRYPT_FS) += ecryptfs/
++obj-$(CONFIG_VXFS_FS) += freevxfs/
++obj-$(CONFIG_NFS_FS) += nfs/
++obj-$(CONFIG_EXPORTFS) += exportfs/
++obj-$(CONFIG_NFSD) += nfsd/
++obj-$(CONFIG_LOCKD) += lockd/
++obj-$(CONFIG_NLS) += nls/
++obj-$(CONFIG_SYSV_FS) += sysv/
++obj-$(CONFIG_SMB_FS) += smbfs/
++obj-$(CONFIG_CIFS) += cifs/
++obj-$(CONFIG_NCP_FS) += ncpfs/
++obj-$(CONFIG_HPFS_FS) += hpfs/
++obj-$(CONFIG_NTFS_FS) += ntfs/
++obj-$(CONFIG_UFS_FS) += ufs/
++obj-$(CONFIG_EFS_FS) += efs/
++obj-$(CONFIG_JFFS2_FS) += jffs2/
++obj-$(CONFIG_UBIFS_FS) += ubifs/
++obj-$(CONFIG_AFFS_FS) += affs/
++obj-$(CONFIG_ROMFS_FS) += romfs/
++obj-$(CONFIG_QNX4FS_FS) += qnx4/
++obj-$(CONFIG_AUTOFS_FS) += autofs/
++obj-$(CONFIG_AUTOFS4_FS) += autofs4/
++obj-$(CONFIG_ADFS_FS) += adfs/
++obj-$(CONFIG_FUSE_FS) += fuse/
++obj-$(CONFIG_UDF_FS) += udf/
++obj-$(CONFIG_SUN_OPENPROMFS) += openpromfs/
++obj-$(CONFIG_OMFS_FS) += omfs/
++obj-$(CONFIG_JFS_FS) += jfs/
++obj-$(CONFIG_XFS_FS) += xfs/
++obj-$(CONFIG_9P_FS) += 9p/
++obj-$(CONFIG_AFS_FS) += afs/
++obj-$(CONFIG_BEFS_FS) += befs/
++obj-$(CONFIG_HOSTFS) += hostfs/
++obj-$(CONFIG_HPPFS) += hppfs/
++obj-$(CONFIG_DEBUG_FS) += debugfs/
++obj-$(CONFIG_OCFS2_FS) += ocfs2/
++obj-$(CONFIG_BTRFS_FS) += btrfs/
++obj-$(CONFIG_GFS2_FS) += gfs2/
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/Kconfig linux-2.6.29.1/fs/yaffs2/Kconfig
+--- linux-2.6.29.1.orig/fs/yaffs2/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/Kconfig 2009-04-17 19:10:08.880965952 +0200
+@@ -0,0 +1,156 @@
++#
++# YAFFS file system configurations
++#
++
++config YAFFS_FS
++ tristate "YAFFS2 file system support"
++ default n
++ depends on MTD_BLOCK
++ select YAFFS_YAFFS1
++ select YAFFS_YAFFS2
++ help
++ YAFFS2, or Yet Another Flash Filing System, is a filing system
++ optimised for NAND Flash chips.
++
++ To compile the YAFFS2 file system support as a module, choose M
++ here: the module will be called yaffs2.
++
++ If unsure, say N.
++
++ Further information on YAFFS2 is available at
++ <http://www.aleph1.co.uk/yaffs/>.
++
++config YAFFS_YAFFS1
++ bool "512 byte / page devices"
++ depends on YAFFS_FS
++ default y
++ help
++ Enable YAFFS1 support -- yaffs for 512 byte / page devices
++
++ Not needed for 2K-page devices.
++
++ If unsure, say Y.
++
++config YAFFS_9BYTE_TAGS
++ bool "Use older-style on-NAND data format with pageStatus byte"
++ depends on YAFFS_YAFFS1
++ default n
++ help
++
++ Older-style on-NAND data format has a "pageStatus" byte to record
++ chunk/page state. This byte is zero when the page is discarded.
++ Choose this option if you have existing on-NAND data using this
++ format that you need to continue to support. New data written
++ also uses the older-style format. Note: Use of this option
++ generally requires that MTD's oob layout be adjusted to use the
++ older-style format. See notes on tags formats and MTD versions
++ in yaffs_mtdif1.c.
++
++ If unsure, say N.
++
++config YAFFS_DOES_ECC
++ bool "Lets Yaffs do its own ECC"
++ depends on YAFFS_FS && YAFFS_YAFFS1 && !YAFFS_9BYTE_TAGS
++ default n
++ help
++ This enables Yaffs to use its own ECC functions instead of using
++ the ones from the generic MTD-NAND driver.
++
++ If unsure, say N.
++
++config YAFFS_ECC_WRONG_ORDER
++ bool "Use the same ecc byte order as Steven Hill's nand_ecc.c"
++ depends on YAFFS_FS && YAFFS_DOES_ECC && !YAFFS_9BYTE_TAGS
++ default n
++ help
++ This makes yaffs_ecc.c use the same ecc byte order as Steven
++ Hill's nand_ecc.c. If not set, then you get the same ecc byte
++ order as SmartMedia.
++
++ If unsure, say N.
++
++config YAFFS_YAFFS2
++ bool "2048 byte (or larger) / page devices"
++ depends on YAFFS_FS
++ default y
++ help
++ Enable YAFFS2 support -- yaffs for >= 2K bytes per page devices
++
++ If unsure, say Y.
++
++config YAFFS_AUTO_YAFFS2
++ bool "Autoselect yaffs2 format"
++ depends on YAFFS_YAFFS2
++ default y
++ help
++ Without this, you need to explicitely use yaffs2 as the file
++ system type. With this, you can say "yaffs" and yaffs or yaffs2
++ will be used depending on the device page size (yaffs on
++ 512-byte page devices, yaffs2 on 2K page devices).
++
++ If unsure, say Y.
++
++config YAFFS_DISABLE_LAZY_LOAD
++ bool "Disable lazy loading"
++ depends on YAFFS_YAFFS2
++ default n
++ help
++ "Lazy loading" defers loading file details until they are
++ required. This saves mount time, but makes the first look-up
++ a bit longer.
++
++ Lazy loading will only happen if enabled by this option being 'n'
++ and if the appropriate tags are available, else yaffs2 will
++ automatically fall back to immediate loading and do the right
++ thing.
++
++ Lazy laoding will be required by checkpointing.
++
++ Setting this to 'y' will disable lazy loading.
++
++ If unsure, say N.
++
++
++config YAFFS_DISABLE_WIDE_TNODES
++ bool "Turn off wide tnodes"
++ depends on YAFFS_FS
++ default n
++ help
++ Wide tnodes are only used for NAND arrays >=32MB for 512-byte
++ page devices and >=128MB for 2k page devices. They use slightly
++ more RAM but are faster since they eliminate chunk group
++ searching.
++
++ Setting this to 'y' will force tnode width to 16 bits and save
++ memory but make large arrays slower.
++
++ If unsure, say N.
++
++config YAFFS_ALWAYS_CHECK_CHUNK_ERASED
++ bool "Force chunk erase check"
++ depends on YAFFS_FS
++ default n
++ help
++ Normally YAFFS only checks chunks before writing until an erased
++ chunk is found. This helps to detect any partially written
++ chunks that might have happened due to power loss.
++
++ Enabling this forces on the test that chunks are erased in flash
++ before writing to them. This takes more time but is potentially
++ a bit more secure.
++
++ Suggest setting Y during development and ironing out driver
++ issues etc. Suggest setting to N if you want faster writing.
++
++ If unsure, say Y.
++
++config YAFFS_SHORT_NAMES_IN_RAM
++ bool "Cache short names in RAM"
++ depends on YAFFS_FS
++ default y
++ help
++ If this config is set, then short names are stored with the
++ yaffs_Object. This costs an extra 16 bytes of RAM per object,
++ but makes look-ups faster.
++
++ If unsure, say Y.
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/Makefile linux-2.6.29.1/fs/yaffs2/Makefile
+--- linux-2.6.29.1.orig/fs/yaffs2/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/Makefile 2009-04-17 19:10:08.872964654 +0200
+@@ -0,0 +1,10 @@
++#
++# Makefile for the linux YAFFS filesystem routines.
++#
++
++obj-$(CONFIG_YAFFS_FS) += yaffs.o
++
++yaffs-y := yaffs_ecc.o yaffs_fs.o yaffs_guts.o yaffs_checkptrw.o
++yaffs-y += yaffs_packedtags1.o yaffs_packedtags2.o yaffs_nand.o yaffs_qsort.o
++yaffs-y += yaffs_tagscompat.o yaffs_tagsvalidity.o
++yaffs-y += yaffs_mtdif.o yaffs_mtdif1.o yaffs_mtdif2.o
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/devextras.h linux-2.6.29.1/fs/yaffs2/devextras.h
+--- linux-2.6.29.1.orig/fs/yaffs2/devextras.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/devextras.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,196 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++/*
++ * This file is just holds extra declarations of macros that would normally
++ * be providesd in the Linux kernel. These macros have been written from
++ * scratch but are functionally equivalent to the Linux ones.
++ *
++ */
++
++#ifndef __EXTRAS_H__
++#define __EXTRAS_H__
++
++
++#if !(defined __KERNEL__)
++
++/* Definition of types */
++typedef unsigned char __u8;
++typedef unsigned short __u16;
++typedef unsigned __u32;
++
++#endif
++
++/*
++ * This is a simple doubly linked list implementation that matches the
++ * way the Linux kernel doubly linked list implementation works.
++ */
++
++struct ylist_head {
++ struct ylist_head *next; /* next in chain */
++ struct ylist_head *prev; /* previous in chain */
++};
++
++
++/* Initialise a static list */
++#define YLIST_HEAD(name) \
++struct ylist_head name = { &(name), &(name)}
++
++
++
++/* Initialise a list head to an empty list */
++#define YINIT_LIST_HEAD(p) \
++do { \
++ (p)->next = (p);\
++ (p)->prev = (p); \
++} while (0)
++
++
++/* Add an element to a list */
++static __inline__ void ylist_add(struct ylist_head *newEntry,
++ struct ylist_head *list)
++{
++ struct ylist_head *listNext = list->next;
++
++ list->next = newEntry;
++ newEntry->prev = list;
++ newEntry->next = listNext;
++ listNext->prev = newEntry;
++
++}
++
++static __inline__ void ylist_add_tail(struct ylist_head *newEntry,
++ struct ylist_head *list)
++{
++ struct ylist_head *listPrev = list->prev;
++
++ list->prev = newEntry;
++ newEntry->next = list;
++ newEntry->prev = listPrev;
++ listPrev->next = newEntry;
++
++}
++
++
++/* Take an element out of its current list, with or without
++ * reinitialising the links.of the entry*/
++static __inline__ void ylist_del(struct ylist_head *entry)
++{
++ struct ylist_head *listNext = entry->next;
++ struct ylist_head *listPrev = entry->prev;
++
++ listNext->prev = listPrev;
++ listPrev->next = listNext;
++
++}
++
++static __inline__ void ylist_del_init(struct ylist_head *entry)
++{
++ ylist_del(entry);
++ entry->next = entry->prev = entry;
++}
++
++
++/* Test if the list is empty */
++static __inline__ int ylist_empty(struct ylist_head *entry)
++{
++ return (entry->next == entry);
++}
++
++
++/* ylist_entry takes a pointer to a list entry and offsets it to that
++ * we can find a pointer to the object it is embedded in.
++ */
++
++
++#define ylist_entry(entry, type, member) \
++ ((type *)((char *)(entry)-(unsigned long)(&((type *)NULL)->member)))
++
++
++/* ylist_for_each and list_for_each_safe iterate over lists.
++ * ylist_for_each_safe uses temporary storage to make the list delete safe
++ */
++
++#define ylist_for_each(itervar, list) \
++ for (itervar = (list)->next; itervar != (list); itervar = itervar->next)
++
++#define ylist_for_each_safe(itervar, saveVar, list) \
++ for (itervar = (list)->next, saveVar = (list)->next->next; \
++ itervar != (list); itervar = saveVar, saveVar = saveVar->next)
++
++
++#if !(defined __KERNEL__)
++
++
++#ifndef WIN32
++#include <sys/stat.h>
++#endif
++
++
++#ifdef CONFIG_YAFFS_PROVIDE_DEFS
++/* File types */
++
++
++#define DT_UNKNOWN 0
++#define DT_FIFO 1
++#define DT_CHR 2
++#define DT_DIR 4
++#define DT_BLK 6
++#define DT_REG 8
++#define DT_LNK 10
++#define DT_SOCK 12
++#define DT_WHT 14
++
++
++#ifndef WIN32
++#include <sys/stat.h>
++#endif
++
++/*
++ * Attribute flags. These should be or-ed together to figure out what
++ * has been changed!
++ */
++#define ATTR_MODE 1
++#define ATTR_UID 2
++#define ATTR_GID 4
++#define ATTR_SIZE 8
++#define ATTR_ATIME 16
++#define ATTR_MTIME 32
++#define ATTR_CTIME 64
++
++struct iattr {
++ unsigned int ia_valid;
++ unsigned ia_mode;
++ unsigned ia_uid;
++ unsigned ia_gid;
++ unsigned ia_size;
++ unsigned ia_atime;
++ unsigned ia_mtime;
++ unsigned ia_ctime;
++ unsigned int ia_attr_flags;
++};
++
++#endif
++
++#else
++
++#include <linux/types.h>
++#include <linux/fs.h>
++#include <linux/stat.h>
++
++#endif
++
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/moduleconfig.h linux-2.6.29.1/fs/yaffs2/moduleconfig.h
+--- linux-2.6.29.1.orig/fs/yaffs2/moduleconfig.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/moduleconfig.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,65 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Martin Fouts <Martin.Fouts@palmsource.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_CONFIG_H__
++#define __YAFFS_CONFIG_H__
++
++#ifdef YAFFS_OUT_OF_TREE
++
++/* DO NOT UNSET THESE THREE. YAFFS2 will not compile if you do. */
++#define CONFIG_YAFFS_FS
++#define CONFIG_YAFFS_YAFFS1
++#define CONFIG_YAFFS_YAFFS2
++
++/* These options are independent of each other. Select those that matter. */
++
++/* Default: Not selected */
++/* Meaning: Yaffs does its own ECC, rather than using MTD ECC */
++/* #define CONFIG_YAFFS_DOES_ECC */
++
++/* Default: Not selected */
++/* Meaning: ECC byte order is 'wrong'. Only meaningful if */
++/* CONFIG_YAFFS_DOES_ECC is set */
++/* #define CONFIG_YAFFS_ECC_WRONG_ORDER */
++
++/* Default: Selected */
++/* Meaning: Disables testing whether chunks are erased before writing to them*/
++#define CONFIG_YAFFS_DISABLE_CHUNK_ERASED_CHECK
++
++/* Default: Selected */
++/* Meaning: Cache short names, taking more RAM, but faster look-ups */
++#define CONFIG_YAFFS_SHORT_NAMES_IN_RAM
++
++/* Default: 10 */
++/* Meaning: set the count of blocks to reserve for checkpointing */
++#define CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS 10
++
++/*
++Older-style on-NAND data format has a "pageStatus" byte to record
++chunk/page state. This byte is zeroed when the page is discarded.
++Choose this option if you have existing on-NAND data in this format
++that you need to continue to support. New data written also uses the
++older-style format.
++Note: Use of this option generally requires that MTD's oob layout be
++adjusted to use the older-style format. See notes on tags formats and
++MTD versions in yaffs_mtdif1.c.
++*/
++/* Default: Not selected */
++/* Meaning: Use older-style on-NAND data format with pageStatus byte */
++/* #define CONFIG_YAFFS_9BYTE_TAGS */
++
++#endif /* YAFFS_OUT_OF_TREE */
++
++#endif /* __YAFFS_CONFIG_H__ */
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_checkptrw.c linux-2.6.29.1/fs/yaffs2/yaffs_checkptrw.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_checkptrw.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_checkptrw.c 2009-04-17 19:10:08.880965952 +0200
+@@ -0,0 +1,394 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++const char *yaffs_checkptrw_c_version =
++ "$Id: yaffs_checkptrw.c,v 1.18 2009-03-06 17:20:49 wookey Exp $";
++
++
++#include "yaffs_checkptrw.h"
++#include "yaffs_getblockinfo.h"
++
++static int yaffs_CheckpointSpaceOk(yaffs_Device *dev)
++{
++ int blocksAvailable = dev->nErasedBlocks - dev->nReservedBlocks;
++
++ T(YAFFS_TRACE_CHECKPOINT,
++ (TSTR("checkpt blocks available = %d" TENDSTR),
++ blocksAvailable));
++
++ return (blocksAvailable <= 0) ? 0 : 1;
++}
++
++
++static int yaffs_CheckpointErase(yaffs_Device *dev)
++{
++ int i;
++
++ if (!dev->eraseBlockInNAND)
++ return 0;
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("checking blocks %d to %d"TENDSTR),
++ dev->internalStartBlock, dev->internalEndBlock));
++
++ for (i = dev->internalStartBlock; i <= dev->internalEndBlock; i++) {
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, i);
++ if (bi->blockState == YAFFS_BLOCK_STATE_CHECKPOINT) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("erasing checkpt block %d"TENDSTR), i));
++ if (dev->eraseBlockInNAND(dev, i - dev->blockOffset /* realign */)) {
++ bi->blockState = YAFFS_BLOCK_STATE_EMPTY;
++ dev->nErasedBlocks++;
++ dev->nFreeChunks += dev->nChunksPerBlock;
++ } else {
++ dev->markNANDBlockBad(dev, i);
++ bi->blockState = YAFFS_BLOCK_STATE_DEAD;
++ }
++ }
++ }
++
++ dev->blocksInCheckpoint = 0;
++
++ return 1;
++}
++
++
++static void yaffs_CheckpointFindNextErasedBlock(yaffs_Device *dev)
++{
++ int i;
++ int blocksAvailable = dev->nErasedBlocks - dev->nReservedBlocks;
++ T(YAFFS_TRACE_CHECKPOINT,
++ (TSTR("allocating checkpt block: erased %d reserved %d avail %d next %d "TENDSTR),
++ dev->nErasedBlocks, dev->nReservedBlocks, blocksAvailable, dev->checkpointNextBlock));
++
++ if (dev->checkpointNextBlock >= 0 &&
++ dev->checkpointNextBlock <= dev->internalEndBlock &&
++ blocksAvailable > 0) {
++
++ for (i = dev->checkpointNextBlock; i <= dev->internalEndBlock; i++) {
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, i);
++ if (bi->blockState == YAFFS_BLOCK_STATE_EMPTY) {
++ dev->checkpointNextBlock = i + 1;
++ dev->checkpointCurrentBlock = i;
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("allocating checkpt block %d"TENDSTR), i));
++ return;
++ }
++ }
++ }
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("out of checkpt blocks"TENDSTR)));
++
++ dev->checkpointNextBlock = -1;
++ dev->checkpointCurrentBlock = -1;
++}
++
++static void yaffs_CheckpointFindNextCheckpointBlock(yaffs_Device *dev)
++{
++ int i;
++ yaffs_ExtendedTags tags;
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("find next checkpt block: start: blocks %d next %d" TENDSTR),
++ dev->blocksInCheckpoint, dev->checkpointNextBlock));
++
++ if (dev->blocksInCheckpoint < dev->checkpointMaxBlocks)
++ for (i = dev->checkpointNextBlock; i <= dev->internalEndBlock; i++) {
++ int chunk = i * dev->nChunksPerBlock;
++ int realignedChunk = chunk - dev->chunkOffset;
++
++ dev->readChunkWithTagsFromNAND(dev, realignedChunk,
++ NULL, &tags);
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("find next checkpt block: search: block %d oid %d seq %d eccr %d" TENDSTR),
++ i, tags.objectId, tags.sequenceNumber, tags.eccResult));
++
++ if (tags.sequenceNumber == YAFFS_SEQUENCE_CHECKPOINT_DATA) {
++ /* Right kind of block */
++ dev->checkpointNextBlock = tags.objectId;
++ dev->checkpointCurrentBlock = i;
++ dev->checkpointBlockList[dev->blocksInCheckpoint] = i;
++ dev->blocksInCheckpoint++;
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("found checkpt block %d"TENDSTR), i));
++ return;
++ }
++ }
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("found no more checkpt blocks"TENDSTR)));
++
++ dev->checkpointNextBlock = -1;
++ dev->checkpointCurrentBlock = -1;
++}
++
++
++int yaffs_CheckpointOpen(yaffs_Device *dev, int forWriting)
++{
++
++ /* Got the functions we need? */
++ if (!dev->writeChunkWithTagsToNAND ||
++ !dev->readChunkWithTagsFromNAND ||
++ !dev->eraseBlockInNAND ||
++ !dev->markNANDBlockBad)
++ return 0;
++
++ if (forWriting && !yaffs_CheckpointSpaceOk(dev))
++ return 0;
++
++ if (!dev->checkpointBuffer)
++ dev->checkpointBuffer = YMALLOC_DMA(dev->totalBytesPerChunk);
++ if (!dev->checkpointBuffer)
++ return 0;
++
++
++ dev->checkpointPageSequence = 0;
++
++ dev->checkpointOpenForWrite = forWriting;
++
++ dev->checkpointByteCount = 0;
++ dev->checkpointSum = 0;
++ dev->checkpointXor = 0;
++ dev->checkpointCurrentBlock = -1;
++ dev->checkpointCurrentChunk = -1;
++ dev->checkpointNextBlock = dev->internalStartBlock;
++
++ /* Erase all the blocks in the checkpoint area */
++ if (forWriting) {
++ memset(dev->checkpointBuffer, 0, dev->nDataBytesPerChunk);
++ dev->checkpointByteOffset = 0;
++ return yaffs_CheckpointErase(dev);
++ } else {
++ int i;
++ /* Set to a value that will kick off a read */
++ dev->checkpointByteOffset = dev->nDataBytesPerChunk;
++ /* A checkpoint block list of 1 checkpoint block per 16 block is (hopefully)
++ * going to be way more than we need */
++ dev->blocksInCheckpoint = 0;
++ dev->checkpointMaxBlocks = (dev->internalEndBlock - dev->internalStartBlock)/16 + 2;
++ dev->checkpointBlockList = YMALLOC(sizeof(int) * dev->checkpointMaxBlocks);
++ for (i = 0; i < dev->checkpointMaxBlocks; i++)
++ dev->checkpointBlockList[i] = -1;
++ }
++
++ return 1;
++}
++
++int yaffs_GetCheckpointSum(yaffs_Device *dev, __u32 *sum)
++{
++ __u32 compositeSum;
++ compositeSum = (dev->checkpointSum << 8) | (dev->checkpointXor & 0xFF);
++ *sum = compositeSum;
++ return 1;
++}
++
++static int yaffs_CheckpointFlushBuffer(yaffs_Device *dev)
++{
++ int chunk;
++ int realignedChunk;
++
++ yaffs_ExtendedTags tags;
++
++ if (dev->checkpointCurrentBlock < 0) {
++ yaffs_CheckpointFindNextErasedBlock(dev);
++ dev->checkpointCurrentChunk = 0;
++ }
++
++ if (dev->checkpointCurrentBlock < 0)
++ return 0;
++
++ tags.chunkDeleted = 0;
++ tags.objectId = dev->checkpointNextBlock; /* Hint to next place to look */
++ tags.chunkId = dev->checkpointPageSequence + 1;
++ tags.sequenceNumber = YAFFS_SEQUENCE_CHECKPOINT_DATA;
++ tags.byteCount = dev->nDataBytesPerChunk;
++ if (dev->checkpointCurrentChunk == 0) {
++ /* First chunk we write for the block? Set block state to
++ checkpoint */
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, dev->checkpointCurrentBlock);
++ bi->blockState = YAFFS_BLOCK_STATE_CHECKPOINT;
++ dev->blocksInCheckpoint++;
++ }
++
++ chunk = dev->checkpointCurrentBlock * dev->nChunksPerBlock + dev->checkpointCurrentChunk;
++
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("checkpoint wite buffer nand %d(%d:%d) objid %d chId %d" TENDSTR),
++ chunk, dev->checkpointCurrentBlock, dev->checkpointCurrentChunk, tags.objectId, tags.chunkId));
++
++ realignedChunk = chunk - dev->chunkOffset;
++
++ dev->writeChunkWithTagsToNAND(dev, realignedChunk,
++ dev->checkpointBuffer, &tags);
++ dev->checkpointByteOffset = 0;
++ dev->checkpointPageSequence++;
++ dev->checkpointCurrentChunk++;
++ if (dev->checkpointCurrentChunk >= dev->nChunksPerBlock) {
++ dev->checkpointCurrentChunk = 0;
++ dev->checkpointCurrentBlock = -1;
++ }
++ memset(dev->checkpointBuffer, 0, dev->nDataBytesPerChunk);
++
++ return 1;
++}
++
++
++int yaffs_CheckpointWrite(yaffs_Device *dev, const void *data, int nBytes)
++{
++ int i = 0;
++ int ok = 1;
++
++
++ __u8 * dataBytes = (__u8 *)data;
++
++
++
++ if (!dev->checkpointBuffer)
++ return 0;
++
++ if (!dev->checkpointOpenForWrite)
++ return -1;
++
++ while (i < nBytes && ok) {
++ dev->checkpointBuffer[dev->checkpointByteOffset] = *dataBytes;
++ dev->checkpointSum += *dataBytes;
++ dev->checkpointXor ^= *dataBytes;
++
++ dev->checkpointByteOffset++;
++ i++;
++ dataBytes++;
++ dev->checkpointByteCount++;
++
++
++ if (dev->checkpointByteOffset < 0 ||
++ dev->checkpointByteOffset >= dev->nDataBytesPerChunk)
++ ok = yaffs_CheckpointFlushBuffer(dev);
++ }
++
++ return i;
++}
++
++int yaffs_CheckpointRead(yaffs_Device *dev, void *data, int nBytes)
++{
++ int i = 0;
++ int ok = 1;
++ yaffs_ExtendedTags tags;
++
++
++ int chunk;
++ int realignedChunk;
++
++ __u8 *dataBytes = (__u8 *)data;
++
++ if (!dev->checkpointBuffer)
++ return 0;
++
++ if (dev->checkpointOpenForWrite)
++ return -1;
++
++ while (i < nBytes && ok) {
++
++
++ if (dev->checkpointByteOffset < 0 ||
++ dev->checkpointByteOffset >= dev->nDataBytesPerChunk) {
++
++ if (dev->checkpointCurrentBlock < 0) {
++ yaffs_CheckpointFindNextCheckpointBlock(dev);
++ dev->checkpointCurrentChunk = 0;
++ }
++
++ if (dev->checkpointCurrentBlock < 0)
++ ok = 0;
++ else {
++ chunk = dev->checkpointCurrentBlock *
++ dev->nChunksPerBlock +
++ dev->checkpointCurrentChunk;
++
++ realignedChunk = chunk - dev->chunkOffset;
++
++ /* read in the next chunk */
++ /* printf("read checkpoint page %d\n",dev->checkpointPage); */
++ dev->readChunkWithTagsFromNAND(dev,
++ realignedChunk,
++ dev->checkpointBuffer,
++ &tags);
++
++ if (tags.chunkId != (dev->checkpointPageSequence + 1) ||
++ tags.eccResult > YAFFS_ECC_RESULT_FIXED ||
++ tags.sequenceNumber != YAFFS_SEQUENCE_CHECKPOINT_DATA)
++ ok = 0;
++
++ dev->checkpointByteOffset = 0;
++ dev->checkpointPageSequence++;
++ dev->checkpointCurrentChunk++;
++
++ if (dev->checkpointCurrentChunk >= dev->nChunksPerBlock)
++ dev->checkpointCurrentBlock = -1;
++ }
++ }
++
++ if (ok) {
++ *dataBytes = dev->checkpointBuffer[dev->checkpointByteOffset];
++ dev->checkpointSum += *dataBytes;
++ dev->checkpointXor ^= *dataBytes;
++ dev->checkpointByteOffset++;
++ i++;
++ dataBytes++;
++ dev->checkpointByteCount++;
++ }
++ }
++
++ return i;
++}
++
++int yaffs_CheckpointClose(yaffs_Device *dev)
++{
++
++ if (dev->checkpointOpenForWrite) {
++ if (dev->checkpointByteOffset != 0)
++ yaffs_CheckpointFlushBuffer(dev);
++ } else {
++ int i;
++ for (i = 0; i < dev->blocksInCheckpoint && dev->checkpointBlockList[i] >= 0; i++) {
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, dev->checkpointBlockList[i]);
++ if (bi->blockState == YAFFS_BLOCK_STATE_EMPTY)
++ bi->blockState = YAFFS_BLOCK_STATE_CHECKPOINT;
++ else {
++ /* Todo this looks odd... */
++ }
++ }
++ YFREE(dev->checkpointBlockList);
++ dev->checkpointBlockList = NULL;
++ }
++
++ dev->nFreeChunks -= dev->blocksInCheckpoint * dev->nChunksPerBlock;
++ dev->nErasedBlocks -= dev->blocksInCheckpoint;
++
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("checkpoint byte count %d" TENDSTR),
++ dev->checkpointByteCount));
++
++ if (dev->checkpointBuffer) {
++ /* free the buffer */
++ YFREE(dev->checkpointBuffer);
++ dev->checkpointBuffer = NULL;
++ return 1;
++ } else
++ return 0;
++}
++
++int yaffs_CheckpointInvalidateStream(yaffs_Device *dev)
++{
++ /* Erase the first checksum block */
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("checkpoint invalidate"TENDSTR)));
++
++ if (!yaffs_CheckpointSpaceOk(dev))
++ return 0;
++
++ return yaffs_CheckpointErase(dev);
++}
++
++
++
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_checkptrw.h linux-2.6.29.1/fs/yaffs2/yaffs_checkptrw.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_checkptrw.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_checkptrw.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,35 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_CHECKPTRW_H__
++#define __YAFFS_CHECKPTRW_H__
++
++#include "yaffs_guts.h"
++
++int yaffs_CheckpointOpen(yaffs_Device *dev, int forWriting);
++
++int yaffs_CheckpointWrite(yaffs_Device *dev, const void *data, int nBytes);
++
++int yaffs_CheckpointRead(yaffs_Device *dev, void *data, int nBytes);
++
++int yaffs_GetCheckpointSum(yaffs_Device *dev, __u32 *sum);
++
++int yaffs_CheckpointClose(yaffs_Device *dev);
++
++int yaffs_CheckpointInvalidateStream(yaffs_Device *dev);
++
++
++#endif
++
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_ecc.c linux-2.6.29.1/fs/yaffs2/yaffs_ecc.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_ecc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_ecc.c 2009-04-17 19:10:08.880965952 +0200
+@@ -0,0 +1,326 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++/*
++ * This code implements the ECC algorithm used in SmartMedia.
++ *
++ * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes.
++ * The two unused bit are set to 1.
++ * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC
++ * blocks are used on a 512-byte NAND page.
++ *
++ */
++
++/* Table generated by gen-ecc.c
++ * Using a table means we do not have to calculate p1..p4 and p1'..p4'
++ * for each byte of data. These are instead provided in a table in bits7..2.
++ * Bit 0 of each entry indicates whether the entry has an odd or even parity, and therefore
++ * this bytes influence on the line parity.
++ */
++
++const char *yaffs_ecc_c_version =
++ "$Id: yaffs_ecc.c,v 1.11 2009-03-06 17:20:50 wookey Exp $";
++
++#include "yportenv.h"
++
++#include "yaffs_ecc.h"
++
++static const unsigned char column_parity_table[] = {
++ 0x00, 0x55, 0x59, 0x0c, 0x65, 0x30, 0x3c, 0x69,
++ 0x69, 0x3c, 0x30, 0x65, 0x0c, 0x59, 0x55, 0x00,
++ 0x95, 0xc0, 0xcc, 0x99, 0xf0, 0xa5, 0xa9, 0xfc,
++ 0xfc, 0xa9, 0xa5, 0xf0, 0x99, 0xcc, 0xc0, 0x95,
++ 0x99, 0xcc, 0xc0, 0x95, 0xfc, 0xa9, 0xa5, 0xf0,
++ 0xf0, 0xa5, 0xa9, 0xfc, 0x95, 0xc0, 0xcc, 0x99,
++ 0x0c, 0x59, 0x55, 0x00, 0x69, 0x3c, 0x30, 0x65,
++ 0x65, 0x30, 0x3c, 0x69, 0x00, 0x55, 0x59, 0x0c,
++ 0xa5, 0xf0, 0xfc, 0xa9, 0xc0, 0x95, 0x99, 0xcc,
++ 0xcc, 0x99, 0x95, 0xc0, 0xa9, 0xfc, 0xf0, 0xa5,
++ 0x30, 0x65, 0x69, 0x3c, 0x55, 0x00, 0x0c, 0x59,
++ 0x59, 0x0c, 0x00, 0x55, 0x3c, 0x69, 0x65, 0x30,
++ 0x3c, 0x69, 0x65, 0x30, 0x59, 0x0c, 0x00, 0x55,
++ 0x55, 0x00, 0x0c, 0x59, 0x30, 0x65, 0x69, 0x3c,
++ 0xa9, 0xfc, 0xf0, 0xa5, 0xcc, 0x99, 0x95, 0xc0,
++ 0xc0, 0x95, 0x99, 0xcc, 0xa5, 0xf0, 0xfc, 0xa9,
++ 0xa9, 0xfc, 0xf0, 0xa5, 0xcc, 0x99, 0x95, 0xc0,
++ 0xc0, 0x95, 0x99, 0xcc, 0xa5, 0xf0, 0xfc, 0xa9,
++ 0x3c, 0x69, 0x65, 0x30, 0x59, 0x0c, 0x00, 0x55,
++ 0x55, 0x00, 0x0c, 0x59, 0x30, 0x65, 0x69, 0x3c,
++ 0x30, 0x65, 0x69, 0x3c, 0x55, 0x00, 0x0c, 0x59,
++ 0x59, 0x0c, 0x00, 0x55, 0x3c, 0x69, 0x65, 0x30,
++ 0xa5, 0xf0, 0xfc, 0xa9, 0xc0, 0x95, 0x99, 0xcc,
++ 0xcc, 0x99, 0x95, 0xc0, 0xa9, 0xfc, 0xf0, 0xa5,
++ 0x0c, 0x59, 0x55, 0x00, 0x69, 0x3c, 0x30, 0x65,
++ 0x65, 0x30, 0x3c, 0x69, 0x00, 0x55, 0x59, 0x0c,
++ 0x99, 0xcc, 0xc0, 0x95, 0xfc, 0xa9, 0xa5, 0xf0,
++ 0xf0, 0xa5, 0xa9, 0xfc, 0x95, 0xc0, 0xcc, 0x99,
++ 0x95, 0xc0, 0xcc, 0x99, 0xf0, 0xa5, 0xa9, 0xfc,
++ 0xfc, 0xa9, 0xa5, 0xf0, 0x99, 0xcc, 0xc0, 0x95,
++ 0x00, 0x55, 0x59, 0x0c, 0x65, 0x30, 0x3c, 0x69,
++ 0x69, 0x3c, 0x30, 0x65, 0x0c, 0x59, 0x55, 0x00,
++};
++
++/* Count the bits in an unsigned char or a U32 */
++
++static int yaffs_CountBits(unsigned char x)
++{
++ int r = 0;
++ while (x) {
++ if (x & 1)
++ r++;
++ x >>= 1;
++ }
++ return r;
++}
++
++static int yaffs_CountBits32(unsigned x)
++{
++ int r = 0;
++ while (x) {
++ if (x & 1)
++ r++;
++ x >>= 1;
++ }
++ return r;
++}
++
++/* Calculate the ECC for a 256-byte block of data */
++void yaffs_ECCCalculate(const unsigned char *data, unsigned char *ecc)
++{
++ unsigned int i;
++
++ unsigned char col_parity = 0;
++ unsigned char line_parity = 0;
++ unsigned char line_parity_prime = 0;
++ unsigned char t;
++ unsigned char b;
++
++ for (i = 0; i < 256; i++) {
++ b = column_parity_table[*data++];
++ col_parity ^= b;
++
++ if (b & 0x01) { /* odd number of bits in the byte */
++ line_parity ^= i;
++ line_parity_prime ^= ~i;
++ }
++ }
++
++ ecc[2] = (~col_parity) | 0x03;
++
++ t = 0;
++ if (line_parity & 0x80)
++ t |= 0x80;
++ if (line_parity_prime & 0x80)
++ t |= 0x40;
++ if (line_parity & 0x40)
++ t |= 0x20;
++ if (line_parity_prime & 0x40)
++ t |= 0x10;
++ if (line_parity & 0x20)
++ t |= 0x08;
++ if (line_parity_prime & 0x20)
++ t |= 0x04;
++ if (line_parity & 0x10)
++ t |= 0x02;
++ if (line_parity_prime & 0x10)
++ t |= 0x01;
++ ecc[1] = ~t;
++
++ t = 0;
++ if (line_parity & 0x08)
++ t |= 0x80;
++ if (line_parity_prime & 0x08)
++ t |= 0x40;
++ if (line_parity & 0x04)
++ t |= 0x20;
++ if (line_parity_prime & 0x04)
++ t |= 0x10;
++ if (line_parity & 0x02)
++ t |= 0x08;
++ if (line_parity_prime & 0x02)
++ t |= 0x04;
++ if (line_parity & 0x01)
++ t |= 0x02;
++ if (line_parity_prime & 0x01)
++ t |= 0x01;
++ ecc[0] = ~t;
++
++#ifdef CONFIG_YAFFS_ECC_WRONG_ORDER
++ /* Swap the bytes into the wrong order */
++ t = ecc[0];
++ ecc[0] = ecc[1];
++ ecc[1] = t;
++#endif
++}
++
++
++/* Correct the ECC on a 256 byte block of data */
++
++int yaffs_ECCCorrect(unsigned char *data, unsigned char *read_ecc,
++ const unsigned char *test_ecc)
++{
++ unsigned char d0, d1, d2; /* deltas */
++
++ d0 = read_ecc[0] ^ test_ecc[0];
++ d1 = read_ecc[1] ^ test_ecc[1];
++ d2 = read_ecc[2] ^ test_ecc[2];
++
++ if ((d0 | d1 | d2) == 0)
++ return 0; /* no error */
++
++ if (((d0 ^ (d0 >> 1)) & 0x55) == 0x55 &&
++ ((d1 ^ (d1 >> 1)) & 0x55) == 0x55 &&
++ ((d2 ^ (d2 >> 1)) & 0x54) == 0x54) {
++ /* Single bit (recoverable) error in data */
++
++ unsigned byte;
++ unsigned bit;
++
++#ifdef CONFIG_YAFFS_ECC_WRONG_ORDER
++ /* swap the bytes to correct for the wrong order */
++ unsigned char t;
++
++ t = d0;
++ d0 = d1;
++ d1 = t;
++#endif
++
++ bit = byte = 0;
++
++ if (d1 & 0x80)
++ byte |= 0x80;
++ if (d1 & 0x20)
++ byte |= 0x40;
++ if (d1 & 0x08)
++ byte |= 0x20;
++ if (d1 & 0x02)
++ byte |= 0x10;
++ if (d0 & 0x80)
++ byte |= 0x08;
++ if (d0 & 0x20)
++ byte |= 0x04;
++ if (d0 & 0x08)
++ byte |= 0x02;
++ if (d0 & 0x02)
++ byte |= 0x01;
++
++ if (d2 & 0x80)
++ bit |= 0x04;
++ if (d2 & 0x20)
++ bit |= 0x02;
++ if (d2 & 0x08)
++ bit |= 0x01;
++
++ data[byte] ^= (1 << bit);
++
++ return 1; /* Corrected the error */
++ }
++
++ if ((yaffs_CountBits(d0) +
++ yaffs_CountBits(d1) +
++ yaffs_CountBits(d2)) == 1) {
++ /* Reccoverable error in ecc */
++
++ read_ecc[0] = test_ecc[0];
++ read_ecc[1] = test_ecc[1];
++ read_ecc[2] = test_ecc[2];
++
++ return 1; /* Corrected the error */
++ }
++
++ /* Unrecoverable error */
++
++ return -1;
++
++}
++
++
++/*
++ * ECCxxxOther does ECC calcs on arbitrary n bytes of data
++ */
++void yaffs_ECCCalculateOther(const unsigned char *data, unsigned nBytes,
++ yaffs_ECCOther *eccOther)
++{
++ unsigned int i;
++
++ unsigned char col_parity = 0;
++ unsigned line_parity = 0;
++ unsigned line_parity_prime = 0;
++ unsigned char b;
++
++ for (i = 0; i < nBytes; i++) {
++ b = column_parity_table[*data++];
++ col_parity ^= b;
++
++ if (b & 0x01) {
++ /* odd number of bits in the byte */
++ line_parity ^= i;
++ line_parity_prime ^= ~i;
++ }
++
++ }
++
++ eccOther->colParity = (col_parity >> 2) & 0x3f;
++ eccOther->lineParity = line_parity;
++ eccOther->lineParityPrime = line_parity_prime;
++}
++
++int yaffs_ECCCorrectOther(unsigned char *data, unsigned nBytes,
++ yaffs_ECCOther *read_ecc,
++ const yaffs_ECCOther *test_ecc)
++{
++ unsigned char cDelta; /* column parity delta */
++ unsigned lDelta; /* line parity delta */
++ unsigned lDeltaPrime; /* line parity delta */
++ unsigned bit;
++
++ cDelta = read_ecc->colParity ^ test_ecc->colParity;
++ lDelta = read_ecc->lineParity ^ test_ecc->lineParity;
++ lDeltaPrime = read_ecc->lineParityPrime ^ test_ecc->lineParityPrime;
++
++ if ((cDelta | lDelta | lDeltaPrime) == 0)
++ return 0; /* no error */
++
++ if (lDelta == ~lDeltaPrime &&
++ (((cDelta ^ (cDelta >> 1)) & 0x15) == 0x15)) {
++ /* Single bit (recoverable) error in data */
++
++ bit = 0;
++
++ if (cDelta & 0x20)
++ bit |= 0x04;
++ if (cDelta & 0x08)
++ bit |= 0x02;
++ if (cDelta & 0x02)
++ bit |= 0x01;
++
++ if (lDelta >= nBytes)
++ return -1;
++
++ data[lDelta] ^= (1 << bit);
++
++ return 1; /* corrected */
++ }
++
++ if ((yaffs_CountBits32(lDelta) + yaffs_CountBits32(lDeltaPrime) +
++ yaffs_CountBits(cDelta)) == 1) {
++ /* Reccoverable error in ecc */
++
++ *read_ecc = *test_ecc;
++ return 1; /* corrected */
++ }
++
++ /* Unrecoverable error */
++
++ return -1;
++}
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_ecc.h linux-2.6.29.1/fs/yaffs2/yaffs_ecc.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_ecc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_ecc.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,44 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++/*
++ * This code implements the ECC algorithm used in SmartMedia.
++ *
++ * The ECC comprises 22 bits of parity information and is stuffed into 3 bytes.
++ * The two unused bit are set to 1.
++ * The ECC can correct single bit errors in a 256-byte page of data. Thus, two such ECC
++ * blocks are used on a 512-byte NAND page.
++ *
++ */
++
++#ifndef __YAFFS_ECC_H__
++#define __YAFFS_ECC_H__
++
++typedef struct {
++ unsigned char colParity;
++ unsigned lineParity;
++ unsigned lineParityPrime;
++} yaffs_ECCOther;
++
++void yaffs_ECCCalculate(const unsigned char *data, unsigned char *ecc);
++int yaffs_ECCCorrect(unsigned char *data, unsigned char *read_ecc,
++ const unsigned char *test_ecc);
++
++void yaffs_ECCCalculateOther(const unsigned char *data, unsigned nBytes,
++ yaffs_ECCOther *ecc);
++int yaffs_ECCCorrectOther(unsigned char *data, unsigned nBytes,
++ yaffs_ECCOther *read_ecc,
++ const yaffs_ECCOther *test_ecc);
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_fs.c linux-2.6.29.1/fs/yaffs2/yaffs_fs.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_fs.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_fs.c 2009-04-17 19:10:08.880965952 +0200
+@@ -0,0 +1,2529 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2009 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ * Acknowledgements:
++ * Luc van OostenRyck for numerous patches.
++ * Nick Bane for numerous patches.
++ * Nick Bane for 2.5/2.6 integration.
++ * Andras Toth for mknod rdev issue.
++ * Michael Fischer for finding the problem with inode inconsistency.
++ * Some code bodily lifted from JFFS
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++/*
++ *
++ * This is the file system front-end to YAFFS that hooks it up to
++ * the VFS.
++ *
++ * Special notes:
++ * >> 2.4: sb->u.generic_sbp points to the yaffs_Device associated with
++ * this superblock
++ * >> 2.6: sb->s_fs_info points to the yaffs_Device associated with this
++ * superblock
++ * >> inode->u.generic_ip points to the associated yaffs_Object.
++ */
++
++const char *yaffs_fs_c_version =
++ "$Id: yaffs_fs.c,v 1.79 2009-03-17 01:12:00 wookey Exp $";
++extern const char *yaffs_guts_c_version;
++
++#include <linux/version.h>
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
++#include <linux/config.h>
++#endif
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/init.h>
++#include <linux/fs.h>
++#include <linux/proc_fs.h>
++#include <linux/smp_lock.h>
++#include <linux/pagemap.h>
++#include <linux/mtd/mtd.h>
++#include <linux/interrupt.h>
++#include <linux/string.h>
++#include <linux/ctype.h>
++
++#include "asm/div64.h"
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++
++#include <linux/statfs.h> /* Added NCB 15-8-2003 */
++#include <linux/statfs.h>
++#define UnlockPage(p) unlock_page(p)
++#define Page_Uptodate(page) test_bit(PG_uptodate, &(page)->flags)
++
++/* FIXME: use sb->s_id instead ? */
++#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf)
++
++#else
++
++#include <linux/locks.h>
++#define BDEVNAME_SIZE 0
++#define yaffs_devname(sb, buf) kdevname(sb->s_dev)
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0))
++/* added NCB 26/5/2006 for 2.4.25-vrs2-tcl1 kernel */
++#define __user
++#endif
++
++#endif
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26))
++#define YPROC_ROOT (&proc_root)
++#else
++#define YPROC_ROOT NULL
++#endif
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++#define WRITE_SIZE_STR "writesize"
++#define WRITE_SIZE(mtd) ((mtd)->writesize)
++#else
++#define WRITE_SIZE_STR "oobblock"
++#define WRITE_SIZE(mtd) ((mtd)->oobblock)
++#endif
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 27))
++#define YAFFS_USE_WRITE_BEGIN_END 1
++#else
++#define YAFFS_USE_WRITE_BEGIN_END 0
++#endif
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 28))
++static uint32_t YCALCBLOCKS(uint64_t partition_size, uint32_t block_size)
++{
++ uint64_t result = partition_size;
++ do_div(result, block_size);
++ return (uint32_t)result;
++}
++#else
++#define YCALCBLOCKS(s, b) ((s)/(b))
++#endif
++
++#include <linux/uaccess.h>
++
++#include "yportenv.h"
++#include "yaffs_guts.h"
++
++#include <linux/mtd/mtd.h>
++#include "yaffs_mtdif.h"
++#include "yaffs_mtdif1.h"
++#include "yaffs_mtdif2.h"
++
++unsigned int yaffs_traceMask = YAFFS_TRACE_BAD_BLOCKS;
++unsigned int yaffs_wr_attempts = YAFFS_WR_ATTEMPTS;
++unsigned int yaffs_auto_checkpoint = 1;
++
++/* Module Parameters */
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++module_param(yaffs_traceMask, uint, 0644);
++module_param(yaffs_wr_attempts, uint, 0644);
++module_param(yaffs_auto_checkpoint, uint, 0644);
++#else
++MODULE_PARM(yaffs_traceMask, "i");
++MODULE_PARM(yaffs_wr_attempts, "i");
++MODULE_PARM(yaffs_auto_checkpoint, "i");
++#endif
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25))
++/* use iget and read_inode */
++#define Y_IGET(sb, inum) iget((sb), (inum))
++static void yaffs_read_inode(struct inode *inode);
++
++#else
++/* Call local equivalent */
++#define YAFFS_USE_OWN_IGET
++#define Y_IGET(sb, inum) yaffs_iget((sb), (inum))
++
++static struct inode *yaffs_iget(struct super_block *sb, unsigned long ino);
++#endif
++
++/*#define T(x) printk x */
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18))
++#define yaffs_InodeToObjectLV(iptr) ((iptr)->i_private)
++#else
++#define yaffs_InodeToObjectLV(iptr) ((iptr)->u.generic_ip)
++#endif
++
++#define yaffs_InodeToObject(iptr) ((yaffs_Object *)(yaffs_InodeToObjectLV(iptr)))
++#define yaffs_DentryToObject(dptr) yaffs_InodeToObject((dptr)->d_inode)
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++#define yaffs_SuperToDevice(sb) ((yaffs_Device *)sb->s_fs_info)
++#else
++#define yaffs_SuperToDevice(sb) ((yaffs_Device *)sb->u.generic_sbp)
++#endif
++
++static void yaffs_put_super(struct super_block *sb);
++
++static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n,
++ loff_t *pos);
++static ssize_t yaffs_hold_space(struct file *f);
++static void yaffs_release_space(struct file *f);
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs_file_flush(struct file *file, fl_owner_t id);
++#else
++static int yaffs_file_flush(struct file *file);
++#endif
++
++static int yaffs_sync_object(struct file *file, struct dentry *dentry,
++ int datasync);
++
++static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir);
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_create(struct inode *dir, struct dentry *dentry, int mode,
++ struct nameidata *n);
++static struct dentry *yaffs_lookup(struct inode *dir, struct dentry *dentry,
++ struct nameidata *n);
++#else
++static int yaffs_create(struct inode *dir, struct dentry *dentry, int mode);
++static struct dentry *yaffs_lookup(struct inode *dir, struct dentry *dentry);
++#endif
++static int yaffs_link(struct dentry *old_dentry, struct inode *dir,
++ struct dentry *dentry);
++static int yaffs_unlink(struct inode *dir, struct dentry *dentry);
++static int yaffs_symlink(struct inode *dir, struct dentry *dentry,
++ const char *symname);
++static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
++ dev_t dev);
++#else
++static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
++ int dev);
++#endif
++static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry,
++ struct inode *new_dir, struct dentry *new_dentry);
++static int yaffs_setattr(struct dentry *dentry, struct iattr *attr);
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs_sync_fs(struct super_block *sb, int wait);
++static void yaffs_write_super(struct super_block *sb);
++#else
++static int yaffs_sync_fs(struct super_block *sb);
++static int yaffs_write_super(struct super_block *sb);
++#endif
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs_statfs(struct dentry *dentry, struct kstatfs *buf);
++#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_statfs(struct super_block *sb, struct kstatfs *buf);
++#else
++static int yaffs_statfs(struct super_block *sb, struct statfs *buf);
++#endif
++
++#ifdef YAFFS_HAS_PUT_INODE
++static void yaffs_put_inode(struct inode *inode);
++#endif
++
++static void yaffs_delete_inode(struct inode *);
++static void yaffs_clear_inode(struct inode *);
++
++static int yaffs_readpage(struct file *file, struct page *page);
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_writepage(struct page *page, struct writeback_control *wbc);
++#else
++static int yaffs_writepage(struct page *page);
++#endif
++
++
++#if (YAFFS_USE_WRITE_BEGIN_END != 0)
++static int yaffs_write_begin(struct file *filp, struct address_space *mapping,
++ loff_t pos, unsigned len, unsigned flags,
++ struct page **pagep, void **fsdata);
++static int yaffs_write_end(struct file *filp, struct address_space *mapping,
++ loff_t pos, unsigned len, unsigned copied,
++ struct page *pg, void *fsdadata);
++#else
++static int yaffs_prepare_write(struct file *f, struct page *pg,
++ unsigned offset, unsigned to);
++static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset,
++ unsigned to);
++
++#endif
++
++static int yaffs_readlink(struct dentry *dentry, char __user *buffer,
++ int buflen);
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 13))
++static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd);
++#else
++static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd);
++#endif
++
++static struct address_space_operations yaffs_file_address_operations = {
++ .readpage = yaffs_readpage,
++ .writepage = yaffs_writepage,
++#if (YAFFS_USE_WRITE_BEGIN_END > 0)
++ .write_begin = yaffs_write_begin,
++ .write_end = yaffs_write_end,
++#else
++ .prepare_write = yaffs_prepare_write,
++ .commit_write = yaffs_commit_write,
++#endif
++};
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
++static const struct file_operations yaffs_file_operations = {
++ .read = do_sync_read,
++ .write = do_sync_write,
++ .aio_read = generic_file_aio_read,
++ .aio_write = generic_file_aio_write,
++ .mmap = generic_file_mmap,
++ .flush = yaffs_file_flush,
++ .fsync = yaffs_sync_object,
++ .splice_read = generic_file_splice_read,
++ .splice_write = generic_file_splice_write,
++ .llseek = generic_file_llseek,
++};
++
++#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18))
++
++static const struct file_operations yaffs_file_operations = {
++ .read = do_sync_read,
++ .write = do_sync_write,
++ .aio_read = generic_file_aio_read,
++ .aio_write = generic_file_aio_write,
++ .mmap = generic_file_mmap,
++ .flush = yaffs_file_flush,
++ .fsync = yaffs_sync_object,
++ .sendfile = generic_file_sendfile,
++};
++
++#else
++
++static const struct file_operations yaffs_file_operations = {
++ .read = generic_file_read,
++ .write = generic_file_write,
++ .mmap = generic_file_mmap,
++ .flush = yaffs_file_flush,
++ .fsync = yaffs_sync_object,
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++ .sendfile = generic_file_sendfile,
++#endif
++};
++#endif
++
++static const struct inode_operations yaffs_file_inode_operations = {
++ .setattr = yaffs_setattr,
++};
++
++static const struct inode_operations yaffs_symlink_inode_operations = {
++ .readlink = yaffs_readlink,
++ .follow_link = yaffs_follow_link,
++ .setattr = yaffs_setattr,
++};
++
++static const struct inode_operations yaffs_dir_inode_operations = {
++ .create = yaffs_create,
++ .lookup = yaffs_lookup,
++ .link = yaffs_link,
++ .unlink = yaffs_unlink,
++ .symlink = yaffs_symlink,
++ .mkdir = yaffs_mkdir,
++ .rmdir = yaffs_unlink,
++ .mknod = yaffs_mknod,
++ .rename = yaffs_rename,
++ .setattr = yaffs_setattr,
++};
++
++static const struct file_operations yaffs_dir_operations = {
++ .read = generic_read_dir,
++ .readdir = yaffs_readdir,
++ .fsync = yaffs_sync_object,
++};
++
++static const struct super_operations yaffs_super_ops = {
++ .statfs = yaffs_statfs,
++
++#ifndef YAFFS_USE_OWN_IGET
++ .read_inode = yaffs_read_inode,
++#endif
++#ifdef YAFFS_HAS_PUT_INODE
++ .put_inode = yaffs_put_inode,
++#endif
++ .put_super = yaffs_put_super,
++ .delete_inode = yaffs_delete_inode,
++ .clear_inode = yaffs_clear_inode,
++ .sync_fs = yaffs_sync_fs,
++ .write_super = yaffs_write_super,
++};
++
++static void yaffs_GrossLock(yaffs_Device *dev)
++{
++ T(YAFFS_TRACE_OS, ("yaffs locking %p\n", current));
++ down(&dev->grossLock);
++ T(YAFFS_TRACE_OS, ("yaffs locked %p\n", current));
++}
++
++static void yaffs_GrossUnlock(yaffs_Device *dev)
++{
++ T(YAFFS_TRACE_OS, ("yaffs unlocking %p\n", current));
++ up(&dev->grossLock);
++}
++
++static int yaffs_readlink(struct dentry *dentry, char __user *buffer,
++ int buflen)
++{
++ unsigned char *alias;
++ int ret;
++
++ yaffs_Device *dev = yaffs_DentryToObject(dentry)->myDev;
++
++ yaffs_GrossLock(dev);
++
++ alias = yaffs_GetSymlinkAlias(yaffs_DentryToObject(dentry));
++
++ yaffs_GrossUnlock(dev);
++
++ if (!alias)
++ return -ENOMEM;
++
++ ret = vfs_readlink(dentry, buffer, buflen, alias);
++ kfree(alias);
++ return ret;
++}
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 13))
++static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
++#else
++static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
++#endif
++{
++ unsigned char *alias;
++ int ret;
++ yaffs_Device *dev = yaffs_DentryToObject(dentry)->myDev;
++
++ yaffs_GrossLock(dev);
++
++ alias = yaffs_GetSymlinkAlias(yaffs_DentryToObject(dentry));
++
++ yaffs_GrossUnlock(dev);
++
++ if (!alias) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ ret = vfs_follow_link(nd, alias);
++ kfree(alias);
++out:
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 13))
++ return ERR_PTR(ret);
++#else
++ return ret;
++#endif
++}
++
++struct inode *yaffs_get_inode(struct super_block *sb, int mode, int dev,
++ yaffs_Object *obj);
++
++/*
++ * Lookup is used to find objects in the fs
++ */
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++
++static struct dentry *yaffs_lookup(struct inode *dir, struct dentry *dentry,
++ struct nameidata *n)
++#else
++static struct dentry *yaffs_lookup(struct inode *dir, struct dentry *dentry)
++#endif
++{
++ yaffs_Object *obj;
++ struct inode *inode = NULL; /* NCB 2.5/2.6 needs NULL here */
++
++ yaffs_Device *dev = yaffs_InodeToObject(dir)->myDev;
++
++ yaffs_GrossLock(dev);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_lookup for %d:%s\n",
++ yaffs_InodeToObject(dir)->objectId, dentry->d_name.name));
++
++ obj = yaffs_FindObjectByName(yaffs_InodeToObject(dir),
++ dentry->d_name.name);
++
++ obj = yaffs_GetEquivalentObject(obj); /* in case it was a hardlink */
++
++ /* Can't hold gross lock when calling yaffs_get_inode() */
++ yaffs_GrossUnlock(dev);
++
++ if (obj) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_lookup found %d\n", obj->objectId));
++
++ inode = yaffs_get_inode(dir->i_sb, obj->yst_mode, 0, obj);
++
++ if (inode) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_loookup dentry \n"));
++/* #if 0 asserted by NCB for 2.5/6 compatability - falls through to
++ * d_add even if NULL inode */
++#if 0
++ /*dget(dentry); // try to solve directory bug */
++ d_add(dentry, inode);
++
++ /* return dentry; */
++ return NULL;
++#endif
++ }
++
++ } else {
++ T(YAFFS_TRACE_OS, ("yaffs_lookup not found\n"));
++
++ }
++
++/* added NCB for 2.5/6 compatability - forces add even if inode is
++ * NULL which creates dentry hash */
++ d_add(dentry, inode);
++
++ return NULL;
++}
++
++
++#ifdef YAFFS_HAS_PUT_INODE
++
++/* For now put inode is just for debugging
++ * Put inode is called when the inode **structure** is put.
++ */
++static void yaffs_put_inode(struct inode *inode)
++{
++ T(YAFFS_TRACE_OS,
++ ("yaffs_put_inode: ino %d, count %d\n", (int)inode->i_ino,
++ atomic_read(&inode->i_count)));
++
++}
++#endif
++
++/* clear is called to tell the fs to release any per-inode data it holds */
++static void yaffs_clear_inode(struct inode *inode)
++{
++ yaffs_Object *obj;
++ yaffs_Device *dev;
++
++ obj = yaffs_InodeToObject(inode);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_clear_inode: ino %d, count %d %s\n", (int)inode->i_ino,
++ atomic_read(&inode->i_count),
++ obj ? "object exists" : "null object"));
++
++ if (obj) {
++ dev = obj->myDev;
++ yaffs_GrossLock(dev);
++
++ /* Clear the association between the inode and
++ * the yaffs_Object.
++ */
++ obj->myInode = NULL;
++ yaffs_InodeToObjectLV(inode) = NULL;
++
++ /* If the object freeing was deferred, then the real
++ * free happens now.
++ * This should fix the inode inconsistency problem.
++ */
++
++ yaffs_HandleDeferedFree(obj);
++
++ yaffs_GrossUnlock(dev);
++ }
++
++}
++
++/* delete is called when the link count is zero and the inode
++ * is put (ie. nobody wants to know about it anymore, time to
++ * delete the file).
++ * NB Must call clear_inode()
++ */
++static void yaffs_delete_inode(struct inode *inode)
++{
++ yaffs_Object *obj = yaffs_InodeToObject(inode);
++ yaffs_Device *dev;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_delete_inode: ino %d, count %d %s\n", (int)inode->i_ino,
++ atomic_read(&inode->i_count),
++ obj ? "object exists" : "null object"));
++
++ if (obj) {
++ dev = obj->myDev;
++ yaffs_GrossLock(dev);
++ yaffs_DeleteObject(obj);
++ yaffs_GrossUnlock(dev);
++ }
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 13))
++ truncate_inode_pages(&inode->i_data, 0);
++#endif
++ clear_inode(inode);
++}
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs_file_flush(struct file *file, fl_owner_t id)
++#else
++static int yaffs_file_flush(struct file *file)
++#endif
++{
++ yaffs_Object *obj = yaffs_DentryToObject(file->f_dentry);
++
++ yaffs_Device *dev = obj->myDev;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_file_flush object %d (%s)\n", obj->objectId,
++ obj->dirty ? "dirty" : "clean"));
++
++ yaffs_GrossLock(dev);
++
++ yaffs_FlushFile(obj, 1);
++
++ yaffs_GrossUnlock(dev);
++
++ return 0;
++}
++
++static int yaffs_readpage_nolock(struct file *f, struct page *pg)
++{
++ /* Lifted from jffs2 */
++
++ yaffs_Object *obj;
++ unsigned char *pg_buf;
++ int ret;
++
++ yaffs_Device *dev;
++
++ T(YAFFS_TRACE_OS, ("yaffs_readpage at %08x, size %08x\n",
++ (unsigned)(pg->index << PAGE_CACHE_SHIFT),
++ (unsigned)PAGE_CACHE_SIZE));
++
++ obj = yaffs_DentryToObject(f->f_dentry);
++
++ dev = obj->myDev;
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++ BUG_ON(!PageLocked(pg));
++#else
++ if (!PageLocked(pg))
++ PAGE_BUG(pg);
++#endif
++
++ pg_buf = kmap(pg);
++ /* FIXME: Can kmap fail? */
++
++ yaffs_GrossLock(dev);
++
++ ret = yaffs_ReadDataFromFile(obj, pg_buf,
++ pg->index << PAGE_CACHE_SHIFT,
++ PAGE_CACHE_SIZE);
++
++ yaffs_GrossUnlock(dev);
++
++ if (ret >= 0)
++ ret = 0;
++
++ if (ret) {
++ ClearPageUptodate(pg);
++ SetPageError(pg);
++ } else {
++ SetPageUptodate(pg);
++ ClearPageError(pg);
++ }
++
++ flush_dcache_page(pg);
++ kunmap(pg);
++
++ T(YAFFS_TRACE_OS, ("yaffs_readpage done\n"));
++ return ret;
++}
++
++static int yaffs_readpage_unlock(struct file *f, struct page *pg)
++{
++ int ret = yaffs_readpage_nolock(f, pg);
++ UnlockPage(pg);
++ return ret;
++}
++
++static int yaffs_readpage(struct file *f, struct page *pg)
++{
++ return yaffs_readpage_unlock(f, pg);
++}
++
++/* writepage inspired by/stolen from smbfs */
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_writepage(struct page *page, struct writeback_control *wbc)
++#else
++static int yaffs_writepage(struct page *page)
++#endif
++{
++ struct address_space *mapping = page->mapping;
++ loff_t offset = (loff_t) page->index << PAGE_CACHE_SHIFT;
++ struct inode *inode;
++ unsigned long end_index;
++ char *buffer;
++ yaffs_Object *obj;
++ int nWritten = 0;
++ unsigned nBytes;
++
++ if (!mapping)
++ BUG();
++ inode = mapping->host;
++ if (!inode)
++ BUG();
++
++ if (offset > inode->i_size) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_writepage at %08x, inode size = %08x!!!\n",
++ (unsigned)(page->index << PAGE_CACHE_SHIFT),
++ (unsigned)inode->i_size));
++ T(YAFFS_TRACE_OS,
++ (" -> don't care!!\n"));
++ unlock_page(page);
++ return 0;
++ }
++
++ end_index = inode->i_size >> PAGE_CACHE_SHIFT;
++
++ /* easy case */
++ if (page->index < end_index)
++ nBytes = PAGE_CACHE_SIZE;
++ else
++ nBytes = inode->i_size & (PAGE_CACHE_SIZE - 1);
++
++ get_page(page);
++
++ buffer = kmap(page);
++
++ obj = yaffs_InodeToObject(inode);
++ yaffs_GrossLock(obj->myDev);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_writepage at %08x, size %08x\n",
++ (unsigned)(page->index << PAGE_CACHE_SHIFT), nBytes));
++ T(YAFFS_TRACE_OS,
++ ("writepag0: obj = %05x, ino = %05x\n",
++ (int)obj->variant.fileVariant.fileSize, (int)inode->i_size));
++
++ nWritten = yaffs_WriteDataToFile(obj, buffer,
++ page->index << PAGE_CACHE_SHIFT, nBytes, 0);
++
++ T(YAFFS_TRACE_OS,
++ ("writepag1: obj = %05x, ino = %05x\n",
++ (int)obj->variant.fileVariant.fileSize, (int)inode->i_size));
++
++ yaffs_GrossUnlock(obj->myDev);
++
++ kunmap(page);
++ SetPageUptodate(page);
++ UnlockPage(page);
++ put_page(page);
++
++ return (nWritten == nBytes) ? 0 : -ENOSPC;
++}
++
++
++#if (YAFFS_USE_WRITE_BEGIN_END > 0)
++static int yaffs_write_begin(struct file *filp, struct address_space *mapping,
++ loff_t pos, unsigned len, unsigned flags,
++ struct page **pagep, void **fsdata)
++{
++ struct page *pg = NULL;
++ pgoff_t index = pos >> PAGE_CACHE_SHIFT;
++ uint32_t offset = pos & (PAGE_CACHE_SIZE - 1);
++ uint32_t to = offset + len;
++
++ int ret = 0;
++ int space_held = 0;
++
++ T(YAFFS_TRACE_OS, ("start yaffs_write_begin\n"));
++ /* Get a page */
++#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 28)
++ pg = grab_cache_page_write_begin(mapping, index, flags);
++#else
++ pg = __grab_cache_page(mapping, index);
++#endif
++
++ *pagep = pg;
++ if (!pg) {
++ ret = -ENOMEM;
++ goto out;
++ }
++ /* Get fs space */
++ space_held = yaffs_hold_space(filp);
++
++ if (!space_held) {
++ ret = -ENOSPC;
++ goto out;
++ }
++
++ /* Update page if required */
++
++ if (!Page_Uptodate(pg) && (offset || to < PAGE_CACHE_SIZE))
++ ret = yaffs_readpage_nolock(filp, pg);
++
++ if (ret)
++ goto out;
++
++ /* Happy path return */
++ T(YAFFS_TRACE_OS, ("end yaffs_write_begin - ok\n"));
++
++ return 0;
++
++out:
++ T(YAFFS_TRACE_OS, ("end yaffs_write_begin fail returning %d\n", ret));
++ if (space_held)
++ yaffs_release_space(filp);
++ if (pg) {
++ unlock_page(pg);
++ page_cache_release(pg);
++ }
++ return ret;
++}
++
++#else
++
++static int yaffs_prepare_write(struct file *f, struct page *pg,
++ unsigned offset, unsigned to)
++{
++ T(YAFFS_TRACE_OS, ("yaffs_prepair_write\n"));
++
++ if (!Page_Uptodate(pg) && (offset || to < PAGE_CACHE_SIZE))
++ return yaffs_readpage_nolock(f, pg);
++ return 0;
++}
++#endif
++
++#if (YAFFS_USE_WRITE_BEGIN_END > 0)
++static int yaffs_write_end(struct file *filp, struct address_space *mapping,
++ loff_t pos, unsigned len, unsigned copied,
++ struct page *pg, void *fsdadata)
++{
++ int ret = 0;
++ void *addr, *kva;
++ uint32_t offset_into_page = pos & (PAGE_CACHE_SIZE - 1);
++
++ kva = kmap(pg);
++ addr = kva + offset_into_page;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_write_end addr %x pos %x nBytes %d\n",
++ (unsigned) addr,
++ (int)pos, copied));
++
++ ret = yaffs_file_write(filp, addr, copied, &pos);
++
++ if (ret != copied) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_write_end not same size ret %d copied %d\n",
++ ret, copied));
++ SetPageError(pg);
++ ClearPageUptodate(pg);
++ } else {
++ SetPageUptodate(pg);
++ }
++
++ kunmap(pg);
++
++ yaffs_release_space(filp);
++ unlock_page(pg);
++ page_cache_release(pg);
++ return ret;
++}
++#else
++
++static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset,
++ unsigned to)
++{
++ void *addr, *kva;
++
++ loff_t pos = (((loff_t) pg->index) << PAGE_CACHE_SHIFT) + offset;
++ int nBytes = to - offset;
++ int nWritten;
++
++ unsigned spos = pos;
++ unsigned saddr;
++
++ kva = kmap(pg);
++ addr = kva + offset;
++
++ saddr = (unsigned) addr;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_commit_write addr %x pos %x nBytes %d\n",
++ saddr, spos, nBytes));
++
++ nWritten = yaffs_file_write(f, addr, nBytes, &pos);
++
++ if (nWritten != nBytes) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_commit_write not same size nWritten %d nBytes %d\n",
++ nWritten, nBytes));
++ SetPageError(pg);
++ ClearPageUptodate(pg);
++ } else {
++ SetPageUptodate(pg);
++ }
++
++ kunmap(pg);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_commit_write returning %d\n",
++ nWritten == nBytes ? 0 : nWritten));
++
++ return nWritten == nBytes ? 0 : nWritten;
++}
++#endif
++
++
++static void yaffs_FillInodeFromObject(struct inode *inode, yaffs_Object *obj)
++{
++ if (inode && obj) {
++
++
++ /* Check mode against the variant type and attempt to repair if broken. */
++ __u32 mode = obj->yst_mode;
++ switch (obj->variantType) {
++ case YAFFS_OBJECT_TYPE_FILE:
++ if (!S_ISREG(mode)) {
++ obj->yst_mode &= ~S_IFMT;
++ obj->yst_mode |= S_IFREG;
++ }
++
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ if (!S_ISLNK(mode)) {
++ obj->yst_mode &= ~S_IFMT;
++ obj->yst_mode |= S_IFLNK;
++ }
++
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ if (!S_ISDIR(mode)) {
++ obj->yst_mode &= ~S_IFMT;
++ obj->yst_mode |= S_IFDIR;
++ }
++
++ break;
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ default:
++ /* TODO? */
++ break;
++ }
++
++ inode->i_flags |= S_NOATIME;
++
++ inode->i_ino = obj->objectId;
++ inode->i_mode = obj->yst_mode;
++ inode->i_uid = obj->yst_uid;
++ inode->i_gid = obj->yst_gid;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
++ inode->i_blksize = inode->i_sb->s_blocksize;
++#endif
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++
++ inode->i_rdev = old_decode_dev(obj->yst_rdev);
++ inode->i_atime.tv_sec = (time_t) (obj->yst_atime);
++ inode->i_atime.tv_nsec = 0;
++ inode->i_mtime.tv_sec = (time_t) obj->yst_mtime;
++ inode->i_mtime.tv_nsec = 0;
++ inode->i_ctime.tv_sec = (time_t) obj->yst_ctime;
++ inode->i_ctime.tv_nsec = 0;
++#else
++ inode->i_rdev = obj->yst_rdev;
++ inode->i_atime = obj->yst_atime;
++ inode->i_mtime = obj->yst_mtime;
++ inode->i_ctime = obj->yst_ctime;
++#endif
++ inode->i_size = yaffs_GetObjectFileLength(obj);
++ inode->i_blocks = (inode->i_size + 511) >> 9;
++
++ inode->i_nlink = yaffs_GetObjectLinkCount(obj);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_FillInode mode %x uid %d gid %d size %d count %d\n",
++ inode->i_mode, inode->i_uid, inode->i_gid,
++ (int)inode->i_size, atomic_read(&inode->i_count)));
++
++ switch (obj->yst_mode & S_IFMT) {
++ default: /* fifo, device or socket */
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++ init_special_inode(inode, obj->yst_mode,
++ old_decode_dev(obj->yst_rdev));
++#else
++ init_special_inode(inode, obj->yst_mode,
++ (dev_t) (obj->yst_rdev));
++#endif
++ break;
++ case S_IFREG: /* file */
++ inode->i_op = &yaffs_file_inode_operations;
++ inode->i_fop = &yaffs_file_operations;
++ inode->i_mapping->a_ops =
++ &yaffs_file_address_operations;
++ break;
++ case S_IFDIR: /* directory */
++ inode->i_op = &yaffs_dir_inode_operations;
++ inode->i_fop = &yaffs_dir_operations;
++ break;
++ case S_IFLNK: /* symlink */
++ inode->i_op = &yaffs_symlink_inode_operations;
++ break;
++ }
++
++ yaffs_InodeToObjectLV(inode) = obj;
++
++ obj->myInode = inode;
++
++ } else {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_FileInode invalid parameters\n"));
++ }
++
++}
++
++struct inode *yaffs_get_inode(struct super_block *sb, int mode, int dev,
++ yaffs_Object *obj)
++{
++ struct inode *inode;
++
++ if (!sb) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_get_inode for NULL super_block!!\n"));
++ return NULL;
++
++ }
++
++ if (!obj) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_get_inode for NULL object!!\n"));
++ return NULL;
++
++ }
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_get_inode for object %d\n", obj->objectId));
++
++ inode = Y_IGET(sb, obj->objectId);
++ if (IS_ERR(inode))
++ return NULL;
++
++ /* NB Side effect: iget calls back to yaffs_read_inode(). */
++ /* iget also increments the inode's i_count */
++ /* NB You can't be holding grossLock or deadlock will happen! */
++
++ return inode;
++}
++
++static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n,
++ loff_t *pos)
++{
++ yaffs_Object *obj;
++ int nWritten, ipos;
++ struct inode *inode;
++ yaffs_Device *dev;
++
++ obj = yaffs_DentryToObject(f->f_dentry);
++
++ dev = obj->myDev;
++
++ yaffs_GrossLock(dev);
++
++ inode = f->f_dentry->d_inode;
++
++ if (!S_ISBLK(inode->i_mode) && f->f_flags & O_APPEND)
++ ipos = inode->i_size;
++ else
++ ipos = *pos;
++
++ if (!obj)
++ T(YAFFS_TRACE_OS,
++ ("yaffs_file_write: hey obj is null!\n"));
++ else
++ T(YAFFS_TRACE_OS,
++ ("yaffs_file_write about to write writing %zu bytes"
++ "to object %d at %d\n",
++ n, obj->objectId, ipos));
++
++ nWritten = yaffs_WriteDataToFile(obj, buf, ipos, n, 0);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_file_write writing %zu bytes, %d written at %d\n",
++ n, nWritten, ipos));
++
++ if (nWritten > 0) {
++ ipos += nWritten;
++ *pos = ipos;
++ if (ipos > inode->i_size) {
++ inode->i_size = ipos;
++ inode->i_blocks = (ipos + 511) >> 9;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_file_write size updated to %d bytes, "
++ "%d blocks\n",
++ ipos, (int)(inode->i_blocks)));
++ }
++
++ }
++ yaffs_GrossUnlock(dev);
++ return nWritten == 0 ? -ENOSPC : nWritten;
++}
++
++/* Space holding and freeing is done to ensure we have space available for write_begin/end */
++/* For now we just assume few parallel writes and check against a small number. */
++/* Todo: need to do this with a counter to handle parallel reads better */
++
++static ssize_t yaffs_hold_space(struct file *f)
++{
++ yaffs_Object *obj;
++ yaffs_Device *dev;
++
++ int nFreeChunks;
++
++
++ obj = yaffs_DentryToObject(f->f_dentry);
++
++ dev = obj->myDev;
++
++ yaffs_GrossLock(dev);
++
++ nFreeChunks = yaffs_GetNumberOfFreeChunks(dev);
++
++ yaffs_GrossUnlock(dev);
++
++ return (nFreeChunks > 20) ? 1 : 0;
++}
++
++static void yaffs_release_space(struct file *f)
++{
++ yaffs_Object *obj;
++ yaffs_Device *dev;
++
++
++ obj = yaffs_DentryToObject(f->f_dentry);
++
++ dev = obj->myDev;
++
++ yaffs_GrossLock(dev);
++
++
++ yaffs_GrossUnlock(dev);
++}
++
++static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir)
++{
++ yaffs_Object *obj;
++ yaffs_Device *dev;
++ struct inode *inode = f->f_dentry->d_inode;
++ unsigned long offset, curoffs;
++ struct ylist_head *i;
++ yaffs_Object *l;
++
++ char name[YAFFS_MAX_NAME_LENGTH + 1];
++
++ obj = yaffs_DentryToObject(f->f_dentry);
++ dev = obj->myDev;
++
++ yaffs_GrossLock(dev);
++
++ offset = f->f_pos;
++
++ T(YAFFS_TRACE_OS, ("yaffs_readdir: starting at %d\n", (int)offset));
++
++ if (offset == 0) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_readdir: entry . ino %d \n",
++ (int)inode->i_ino));
++ if (filldir(dirent, ".", 1, offset, inode->i_ino, DT_DIR) < 0)
++ goto out;
++ offset++;
++ f->f_pos++;
++ }
++ if (offset == 1) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_readdir: entry .. ino %d \n",
++ (int)f->f_dentry->d_parent->d_inode->i_ino));
++ if (filldir(dirent, "..", 2, offset,
++ f->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0)
++ goto out;
++ offset++;
++ f->f_pos++;
++ }
++
++ curoffs = 1;
++
++ /* If the directory has changed since the open or last call to
++ readdir, rewind to after the 2 canned entries. */
++
++ if (f->f_version != inode->i_version) {
++ offset = 2;
++ f->f_pos = offset;
++ f->f_version = inode->i_version;
++ }
++
++ ylist_for_each(i, &obj->variant.directoryVariant.children) {
++ curoffs++;
++ if (curoffs >= offset) {
++ l = ylist_entry(i, yaffs_Object, siblings);
++
++ yaffs_GetObjectName(l, name,
++ YAFFS_MAX_NAME_LENGTH + 1);
++ T(YAFFS_TRACE_OS,
++ ("yaffs_readdir: %s inode %d\n", name,
++ yaffs_GetObjectInode(l)));
++
++ if (filldir(dirent,
++ name,
++ strlen(name),
++ offset,
++ yaffs_GetObjectInode(l),
++ yaffs_GetObjectType(l)) < 0)
++ goto up_and_out;
++
++ offset++;
++ f->f_pos++;
++ }
++ }
++
++up_and_out:
++out:
++ yaffs_GrossUnlock(dev);
++
++ return 0;
++}
++
++/*
++ * File creation. Allocate an inode, and we're done..
++ */
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
++#define YCRED(x) x
++#else
++#define YCRED(x) (x->cred)
++#endif
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
++ dev_t rdev)
++#else
++static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
++ int rdev)
++#endif
++{
++ struct inode *inode;
++
++ yaffs_Object *obj = NULL;
++ yaffs_Device *dev;
++
++ yaffs_Object *parent = yaffs_InodeToObject(dir);
++
++ int error = -ENOSPC;
++ uid_t uid = YCRED(current)->fsuid;
++ gid_t gid = (dir->i_mode & S_ISGID) ? dir->i_gid : YCRED(current)->fsgid;
++
++ if ((dir->i_mode & S_ISGID) && S_ISDIR(mode))
++ mode |= S_ISGID;
++
++ if (parent) {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_mknod: parent object %d type %d\n",
++ parent->objectId, parent->variantType));
++ } else {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_mknod: could not get parent object\n"));
++ return -EPERM;
++ }
++
++ T(YAFFS_TRACE_OS, ("yaffs_mknod: making oject for %s, "
++ "mode %x dev %x\n",
++ dentry->d_name.name, mode, rdev));
++
++ dev = parent->myDev;
++
++ yaffs_GrossLock(dev);
++
++ switch (mode & S_IFMT) {
++ default:
++ /* Special (socket, fifo, device...) */
++ T(YAFFS_TRACE_OS, ("yaffs_mknod: making special\n"));
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++ obj = yaffs_MknodSpecial(parent, dentry->d_name.name, mode, uid,
++ gid, old_encode_dev(rdev));
++#else
++ obj = yaffs_MknodSpecial(parent, dentry->d_name.name, mode, uid,
++ gid, rdev);
++#endif
++ break;
++ case S_IFREG: /* file */
++ T(YAFFS_TRACE_OS, ("yaffs_mknod: making file\n"));
++ obj = yaffs_MknodFile(parent, dentry->d_name.name, mode, uid,
++ gid);
++ break;
++ case S_IFDIR: /* directory */
++ T(YAFFS_TRACE_OS,
++ ("yaffs_mknod: making directory\n"));
++ obj = yaffs_MknodDirectory(parent, dentry->d_name.name, mode,
++ uid, gid);
++ break;
++ case S_IFLNK: /* symlink */
++ T(YAFFS_TRACE_OS, ("yaffs_mknod: making symlink\n"));
++ obj = NULL; /* Do we ever get here? */
++ break;
++ }
++
++ /* Can not call yaffs_get_inode() with gross lock held */
++ yaffs_GrossUnlock(dev);
++
++ if (obj) {
++ inode = yaffs_get_inode(dir->i_sb, mode, rdev, obj);
++ d_instantiate(dentry, inode);
++ T(YAFFS_TRACE_OS,
++ ("yaffs_mknod created object %d count = %d\n",
++ obj->objectId, atomic_read(&inode->i_count)));
++ error = 0;
++ } else {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_mknod failed making object\n"));
++ error = -ENOMEM;
++ }
++
++ return error;
++}
++
++static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
++{
++ int retVal;
++ T(YAFFS_TRACE_OS, ("yaffs_mkdir\n"));
++ retVal = yaffs_mknod(dir, dentry, mode | S_IFDIR, 0);
++ return retVal;
++}
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_create(struct inode *dir, struct dentry *dentry, int mode,
++ struct nameidata *n)
++#else
++static int yaffs_create(struct inode *dir, struct dentry *dentry, int mode)
++#endif
++{
++ T(YAFFS_TRACE_OS, ("yaffs_create\n"));
++ return yaffs_mknod(dir, dentry, mode | S_IFREG, 0);
++}
++
++static int yaffs_unlink(struct inode *dir, struct dentry *dentry)
++{
++ int retVal;
++
++ yaffs_Device *dev;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_unlink %d:%s\n", (int)(dir->i_ino),
++ dentry->d_name.name));
++
++ dev = yaffs_InodeToObject(dir)->myDev;
++
++ yaffs_GrossLock(dev);
++
++ retVal = yaffs_Unlink(yaffs_InodeToObject(dir), dentry->d_name.name);
++
++ if (retVal == YAFFS_OK) {
++ dentry->d_inode->i_nlink--;
++ dir->i_version++;
++ yaffs_GrossUnlock(dev);
++ mark_inode_dirty(dentry->d_inode);
++ return 0;
++ }
++ yaffs_GrossUnlock(dev);
++ return -ENOTEMPTY;
++}
++
++/*
++ * Create a link...
++ */
++static int yaffs_link(struct dentry *old_dentry, struct inode *dir,
++ struct dentry *dentry)
++{
++ struct inode *inode = old_dentry->d_inode;
++ yaffs_Object *obj = NULL;
++ yaffs_Object *link = NULL;
++ yaffs_Device *dev;
++
++ T(YAFFS_TRACE_OS, ("yaffs_link\n"));
++
++ obj = yaffs_InodeToObject(inode);
++ dev = obj->myDev;
++
++ yaffs_GrossLock(dev);
++
++ if (!S_ISDIR(inode->i_mode)) /* Don't link directories */
++ link = yaffs_Link(yaffs_InodeToObject(dir), dentry->d_name.name,
++ obj);
++
++ if (link) {
++ old_dentry->d_inode->i_nlink = yaffs_GetObjectLinkCount(obj);
++ d_instantiate(dentry, old_dentry->d_inode);
++ atomic_inc(&old_dentry->d_inode->i_count);
++ T(YAFFS_TRACE_OS,
++ ("yaffs_link link count %d i_count %d\n",
++ old_dentry->d_inode->i_nlink,
++ atomic_read(&old_dentry->d_inode->i_count)));
++ }
++
++ yaffs_GrossUnlock(dev);
++
++ if (link)
++ return 0;
++
++ return -EPERM;
++}
++
++static int yaffs_symlink(struct inode *dir, struct dentry *dentry,
++ const char *symname)
++{
++ yaffs_Object *obj;
++ yaffs_Device *dev;
++ uid_t uid = YCRED(current)->fsuid;
++ gid_t gid = (dir->i_mode & S_ISGID) ? dir->i_gid : YCRED(current)->fsgid;
++
++ T(YAFFS_TRACE_OS, ("yaffs_symlink\n"));
++
++ dev = yaffs_InodeToObject(dir)->myDev;
++ yaffs_GrossLock(dev);
++ obj = yaffs_MknodSymLink(yaffs_InodeToObject(dir), dentry->d_name.name,
++ S_IFLNK | S_IRWXUGO, uid, gid, symname);
++ yaffs_GrossUnlock(dev);
++
++ if (obj) {
++ struct inode *inode;
++
++ inode = yaffs_get_inode(dir->i_sb, obj->yst_mode, 0, obj);
++ d_instantiate(dentry, inode);
++ T(YAFFS_TRACE_OS, ("symlink created OK\n"));
++ return 0;
++ } else {
++ T(YAFFS_TRACE_OS, ("symlink not created\n"));
++ }
++
++ return -ENOMEM;
++}
++
++static int yaffs_sync_object(struct file *file, struct dentry *dentry,
++ int datasync)
++{
++
++ yaffs_Object *obj;
++ yaffs_Device *dev;
++
++ obj = yaffs_DentryToObject(dentry);
++
++ dev = obj->myDev;
++
++ T(YAFFS_TRACE_OS, ("yaffs_sync_object\n"));
++ yaffs_GrossLock(dev);
++ yaffs_FlushFile(obj, 1);
++ yaffs_GrossUnlock(dev);
++ return 0;
++}
++
++/*
++ * The VFS layer already does all the dentry stuff for rename.
++ *
++ * NB: POSIX says you can rename an object over an old object of the same name
++ */
++static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry,
++ struct inode *new_dir, struct dentry *new_dentry)
++{
++ yaffs_Device *dev;
++ int retVal = YAFFS_FAIL;
++ yaffs_Object *target;
++
++ T(YAFFS_TRACE_OS, ("yaffs_rename\n"));
++ dev = yaffs_InodeToObject(old_dir)->myDev;
++
++ yaffs_GrossLock(dev);
++
++ /* Check if the target is an existing directory that is not empty. */
++ target = yaffs_FindObjectByName(yaffs_InodeToObject(new_dir),
++ new_dentry->d_name.name);
++
++
++
++ if (target && target->variantType == YAFFS_OBJECT_TYPE_DIRECTORY &&
++ !ylist_empty(&target->variant.directoryVariant.children)) {
++
++ T(YAFFS_TRACE_OS, ("target is non-empty dir\n"));
++
++ retVal = YAFFS_FAIL;
++ } else {
++ /* Now does unlinking internally using shadowing mechanism */
++ T(YAFFS_TRACE_OS, ("calling yaffs_RenameObject\n"));
++
++ retVal = yaffs_RenameObject(yaffs_InodeToObject(old_dir),
++ old_dentry->d_name.name,
++ yaffs_InodeToObject(new_dir),
++ new_dentry->d_name.name);
++ }
++ yaffs_GrossUnlock(dev);
++
++ if (retVal == YAFFS_OK) {
++ if (target) {
++ new_dentry->d_inode->i_nlink--;
++ mark_inode_dirty(new_dentry->d_inode);
++ }
++
++ return 0;
++ } else {
++ return -ENOTEMPTY;
++ }
++}
++
++static int yaffs_setattr(struct dentry *dentry, struct iattr *attr)
++{
++ struct inode *inode = dentry->d_inode;
++ int error;
++ yaffs_Device *dev;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_setattr of object %d\n",
++ yaffs_InodeToObject(inode)->objectId));
++
++ error = inode_change_ok(inode, attr);
++ if (error == 0) {
++ dev = yaffs_InodeToObject(inode)->myDev;
++ yaffs_GrossLock(dev);
++ if (yaffs_SetAttributes(yaffs_InodeToObject(inode), attr) ==
++ YAFFS_OK) {
++ error = 0;
++ } else {
++ error = -EPERM;
++ }
++ yaffs_GrossUnlock(dev);
++ if (!error)
++ error = inode_setattr(inode, attr);
++ }
++ return error;
++}
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs_statfs(struct dentry *dentry, struct kstatfs *buf)
++{
++ yaffs_Device *dev = yaffs_DentryToObject(dentry)->myDev;
++ struct super_block *sb = dentry->d_sb;
++#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_statfs(struct super_block *sb, struct kstatfs *buf)
++{
++ yaffs_Device *dev = yaffs_SuperToDevice(sb);
++#else
++static int yaffs_statfs(struct super_block *sb, struct statfs *buf)
++{
++ yaffs_Device *dev = yaffs_SuperToDevice(sb);
++#endif
++
++ T(YAFFS_TRACE_OS, ("yaffs_statfs\n"));
++
++ yaffs_GrossLock(dev);
++
++ buf->f_type = YAFFS_MAGIC;
++ buf->f_bsize = sb->s_blocksize;
++ buf->f_namelen = 255;
++
++ if (dev->nDataBytesPerChunk & (dev->nDataBytesPerChunk - 1)) {
++ /* Do this if chunk size is not a power of 2 */
++
++ uint64_t bytesInDev;
++ uint64_t bytesFree;
++
++ bytesInDev = ((uint64_t)((dev->endBlock - dev->startBlock + 1))) *
++ ((uint64_t)(dev->nChunksPerBlock * dev->nDataBytesPerChunk));
++
++ do_div(bytesInDev, sb->s_blocksize); /* bytesInDev becomes the number of blocks */
++ buf->f_blocks = bytesInDev;
++
++ bytesFree = ((uint64_t)(yaffs_GetNumberOfFreeChunks(dev))) *
++ ((uint64_t)(dev->nDataBytesPerChunk));
++
++ do_div(bytesFree, sb->s_blocksize);
++
++ buf->f_bfree = bytesFree;
++
++ } else if (sb->s_blocksize > dev->nDataBytesPerChunk) {
++
++ buf->f_blocks =
++ (dev->endBlock - dev->startBlock + 1) *
++ dev->nChunksPerBlock /
++ (sb->s_blocksize / dev->nDataBytesPerChunk);
++ buf->f_bfree =
++ yaffs_GetNumberOfFreeChunks(dev) /
++ (sb->s_blocksize / dev->nDataBytesPerChunk);
++ } else {
++ buf->f_blocks =
++ (dev->endBlock - dev->startBlock + 1) *
++ dev->nChunksPerBlock *
++ (dev->nDataBytesPerChunk / sb->s_blocksize);
++
++ buf->f_bfree =
++ yaffs_GetNumberOfFreeChunks(dev) *
++ (dev->nDataBytesPerChunk / sb->s_blocksize);
++ }
++
++ buf->f_files = 0;
++ buf->f_ffree = 0;
++ buf->f_bavail = buf->f_bfree;
++
++ yaffs_GrossUnlock(dev);
++ return 0;
++}
++
++
++static int yaffs_do_sync_fs(struct super_block *sb)
++{
++
++ yaffs_Device *dev = yaffs_SuperToDevice(sb);
++ T(YAFFS_TRACE_OS, ("yaffs_do_sync_fs\n"));
++
++ if (sb->s_dirt) {
++ yaffs_GrossLock(dev);
++
++ if (dev) {
++ yaffs_FlushEntireDeviceCache(dev);
++ yaffs_CheckpointSave(dev);
++ }
++
++ yaffs_GrossUnlock(dev);
++
++ sb->s_dirt = 0;
++ }
++ return 0;
++}
++
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static void yaffs_write_super(struct super_block *sb)
++#else
++static int yaffs_write_super(struct super_block *sb)
++#endif
++{
++
++ T(YAFFS_TRACE_OS, ("yaffs_write_super\n"));
++ if (yaffs_auto_checkpoint >= 2)
++ yaffs_do_sync_fs(sb);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
++ return 0;
++#endif
++}
++
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs_sync_fs(struct super_block *sb, int wait)
++#else
++static int yaffs_sync_fs(struct super_block *sb)
++#endif
++{
++ T(YAFFS_TRACE_OS, ("yaffs_sync_fs\n"));
++
++ if (yaffs_auto_checkpoint >= 1)
++ yaffs_do_sync_fs(sb);
++
++ return 0;
++}
++
++#ifdef YAFFS_USE_OWN_IGET
++
++static struct inode *yaffs_iget(struct super_block *sb, unsigned long ino)
++{
++ struct inode *inode;
++ yaffs_Object *obj;
++ yaffs_Device *dev = yaffs_SuperToDevice(sb);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_iget for %lu\n", ino));
++
++ inode = iget_locked(sb, ino);
++ if (!inode)
++ return ERR_PTR(-ENOMEM);
++ if (!(inode->i_state & I_NEW))
++ return inode;
++
++ /* NB This is called as a side effect of other functions, but
++ * we had to release the lock to prevent deadlocks, so
++ * need to lock again.
++ */
++
++ yaffs_GrossLock(dev);
++
++ obj = yaffs_FindObjectByNumber(dev, inode->i_ino);
++
++ yaffs_FillInodeFromObject(inode, obj);
++
++ yaffs_GrossUnlock(dev);
++
++ unlock_new_inode(inode);
++ return inode;
++}
++
++#else
++
++static void yaffs_read_inode(struct inode *inode)
++{
++ /* NB This is called as a side effect of other functions, but
++ * we had to release the lock to prevent deadlocks, so
++ * need to lock again.
++ */
++
++ yaffs_Object *obj;
++ yaffs_Device *dev = yaffs_SuperToDevice(inode->i_sb);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_read_inode for %d\n", (int)inode->i_ino));
++
++ yaffs_GrossLock(dev);
++
++ obj = yaffs_FindObjectByNumber(dev, inode->i_ino);
++
++ yaffs_FillInodeFromObject(inode, obj);
++
++ yaffs_GrossUnlock(dev);
++}
++
++#endif
++
++static YLIST_HEAD(yaffs_dev_list);
++
++#if 0 /* not used */
++static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
++{
++ yaffs_Device *dev = yaffs_SuperToDevice(sb);
++
++ if (*flags & MS_RDONLY) {
++ struct mtd_info *mtd = yaffs_SuperToDevice(sb)->genericDevice;
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_remount_fs: %s: RO\n", dev->name));
++
++ yaffs_GrossLock(dev);
++
++ yaffs_FlushEntireDeviceCache(dev);
++
++ yaffs_CheckpointSave(dev);
++
++ if (mtd->sync)
++ mtd->sync(mtd);
++
++ yaffs_GrossUnlock(dev);
++ } else {
++ T(YAFFS_TRACE_OS,
++ ("yaffs_remount_fs: %s: RW\n", dev->name));
++ }
++
++ return 0;
++}
++#endif
++
++static void yaffs_put_super(struct super_block *sb)
++{
++ yaffs_Device *dev = yaffs_SuperToDevice(sb);
++
++ T(YAFFS_TRACE_OS, ("yaffs_put_super\n"));
++
++ yaffs_GrossLock(dev);
++
++ yaffs_FlushEntireDeviceCache(dev);
++
++ yaffs_CheckpointSave(dev);
++
++ if (dev->putSuperFunc)
++ dev->putSuperFunc(sb);
++
++ yaffs_Deinitialise(dev);
++
++ yaffs_GrossUnlock(dev);
++
++ /* we assume this is protected by lock_kernel() in mount/umount */
++ ylist_del(&dev->devList);
++
++ if (dev->spareBuffer) {
++ YFREE(dev->spareBuffer);
++ dev->spareBuffer = NULL;
++ }
++
++ kfree(dev);
++}
++
++
++static void yaffs_MTDPutSuper(struct super_block *sb)
++{
++ struct mtd_info *mtd = yaffs_SuperToDevice(sb)->genericDevice;
++
++ if (mtd->sync)
++ mtd->sync(mtd);
++
++ put_mtd_device(mtd);
++}
++
++
++static void yaffs_MarkSuperBlockDirty(void *vsb)
++{
++ struct super_block *sb = (struct super_block *)vsb;
++
++ T(YAFFS_TRACE_OS, ("yaffs_MarkSuperBlockDirty() sb = %p\n", sb));
++ if (sb)
++ sb->s_dirt = 1;
++}
++
++typedef struct {
++ int inband_tags;
++ int skip_checkpoint_read;
++ int skip_checkpoint_write;
++ int no_cache;
++} yaffs_options;
++
++#define MAX_OPT_LEN 20
++static int yaffs_parse_options(yaffs_options *options, const char *options_str)
++{
++ char cur_opt[MAX_OPT_LEN + 1];
++ int p;
++ int error = 0;
++
++ /* Parse through the options which is a comma seperated list */
++
++ while (options_str && *options_str && !error) {
++ memset(cur_opt, 0, MAX_OPT_LEN + 1);
++ p = 0;
++
++ while (*options_str && *options_str != ',') {
++ if (p < MAX_OPT_LEN) {
++ cur_opt[p] = *options_str;
++ p++;
++ }
++ options_str++;
++ }
++
++ if (!strcmp(cur_opt, "inband-tags"))
++ options->inband_tags = 1;
++ else if (!strcmp(cur_opt, "no-cache"))
++ options->no_cache = 1;
++ else if (!strcmp(cur_opt, "no-checkpoint-read"))
++ options->skip_checkpoint_read = 1;
++ else if (!strcmp(cur_opt, "no-checkpoint-write"))
++ options->skip_checkpoint_write = 1;
++ else if (!strcmp(cur_opt, "no-checkpoint")) {
++ options->skip_checkpoint_read = 1;
++ options->skip_checkpoint_write = 1;
++ } else {
++ printk(KERN_INFO "yaffs: Bad mount option \"%s\"\n",
++ cur_opt);
++ error = 1;
++ }
++ }
++
++ return error;
++}
++
++static struct super_block *yaffs_internal_read_super(int yaffsVersion,
++ struct super_block *sb,
++ void *data, int silent)
++{
++ int nBlocks;
++ struct inode *inode = NULL;
++ struct dentry *root;
++ yaffs_Device *dev = 0;
++ char devname_buf[BDEVNAME_SIZE + 1];
++ struct mtd_info *mtd;
++ int err;
++ char *data_str = (char *)data;
++
++ yaffs_options options;
++
++ sb->s_magic = YAFFS_MAGIC;
++ sb->s_op = &yaffs_super_ops;
++ sb->s_flags |= MS_NOATIME;
++
++ if (!sb)
++ printk(KERN_INFO "yaffs: sb is NULL\n");
++ else if (!sb->s_dev)
++ printk(KERN_INFO "yaffs: sb->s_dev is NULL\n");
++ else if (!yaffs_devname(sb, devname_buf))
++ printk(KERN_INFO "yaffs: devname is NULL\n");
++ else
++ printk(KERN_INFO "yaffs: dev is %d name is \"%s\"\n",
++ sb->s_dev,
++ yaffs_devname(sb, devname_buf));
++
++ if (!data_str)
++ data_str = "";
++
++ printk(KERN_INFO "yaffs: passed flags \"%s\"\n", data_str);
++
++ memset(&options, 0, sizeof(options));
++
++ if (yaffs_parse_options(&options, data_str)) {
++ /* Option parsing failed */
++ return NULL;
++ }
++
++
++ sb->s_blocksize = PAGE_CACHE_SIZE;
++ sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
++ T(YAFFS_TRACE_OS, ("yaffs_read_super: Using yaffs%d\n", yaffsVersion));
++ T(YAFFS_TRACE_OS,
++ ("yaffs_read_super: block size %d\n", (int)(sb->s_blocksize)));
++
++#ifdef CONFIG_YAFFS_DISABLE_WRITE_VERIFY
++ T(YAFFS_TRACE_OS,
++ ("yaffs: Write verification disabled. All guarantees "
++ "null and void\n"));
++#endif
++
++ T(YAFFS_TRACE_ALWAYS, ("yaffs: Attempting MTD mount on %u.%u, "
++ "\"%s\"\n",
++ MAJOR(sb->s_dev), MINOR(sb->s_dev),
++ yaffs_devname(sb, devname_buf)));
++
++ /* Check it's an mtd device..... */
++ if (MAJOR(sb->s_dev) != MTD_BLOCK_MAJOR)
++ return NULL; /* This isn't an mtd device */
++
++ /* Get the device */
++ mtd = get_mtd_device(NULL, MINOR(sb->s_dev));
++ if (!mtd) {
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs: MTD device #%u doesn't appear to exist\n",
++ MINOR(sb->s_dev)));
++ return NULL;
++ }
++ /* Check it's NAND */
++ if (mtd->type != MTD_NANDFLASH) {
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs: MTD device is not NAND it's type %d\n", mtd->type));
++ return NULL;
++ }
++
++ T(YAFFS_TRACE_OS, (" erase %p\n", mtd->erase));
++ T(YAFFS_TRACE_OS, (" read %p\n", mtd->read));
++ T(YAFFS_TRACE_OS, (" write %p\n", mtd->write));
++ T(YAFFS_TRACE_OS, (" readoob %p\n", mtd->read_oob));
++ T(YAFFS_TRACE_OS, (" writeoob %p\n", mtd->write_oob));
++ T(YAFFS_TRACE_OS, (" block_isbad %p\n", mtd->block_isbad));
++ T(YAFFS_TRACE_OS, (" block_markbad %p\n", mtd->block_markbad));
++ T(YAFFS_TRACE_OS, (" %s %d\n", WRITE_SIZE_STR, WRITE_SIZE(mtd)));
++ T(YAFFS_TRACE_OS, (" oobsize %d\n", mtd->oobsize));
++ T(YAFFS_TRACE_OS, (" erasesize %d\n", mtd->erasesize));
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
++ T(YAFFS_TRACE_OS, (" size %u\n", mtd->size));
++#else
++ T(YAFFS_TRACE_OS, (" size %lld\n", mtd->size));
++#endif
++
++#ifdef CONFIG_YAFFS_AUTO_YAFFS2
++
++ if (yaffsVersion == 1 && WRITE_SIZE(mtd) >= 2048) {
++ T(YAFFS_TRACE_ALWAYS, ("yaffs: auto selecting yaffs2\n"));
++ yaffsVersion = 2;
++ }
++
++ /* Added NCB 26/5/2006 for completeness */
++ if (yaffsVersion == 2 && !options.inband_tags && WRITE_SIZE(mtd) == 512) {
++ T(YAFFS_TRACE_ALWAYS, ("yaffs: auto selecting yaffs1\n"));
++ yaffsVersion = 1;
++ }
++
++#endif
++
++ if (yaffsVersion == 2) {
++ /* Check for version 2 style functions */
++ if (!mtd->erase ||
++ !mtd->block_isbad ||
++ !mtd->block_markbad ||
++ !mtd->read ||
++ !mtd->write ||
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++ !mtd->read_oob || !mtd->write_oob) {
++#else
++ !mtd->write_ecc ||
++ !mtd->read_ecc || !mtd->read_oob || !mtd->write_oob) {
++#endif
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs: MTD device does not support required "
++ "functions\n"));;
++ return NULL;
++ }
++
++ if ((WRITE_SIZE(mtd) < YAFFS_MIN_YAFFS2_CHUNK_SIZE ||
++ mtd->oobsize < YAFFS_MIN_YAFFS2_SPARE_SIZE) &&
++ !options.inband_tags) {
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs: MTD device does not have the "
++ "right page sizes\n"));
++ return NULL;
++ }
++ } else {
++ /* Check for V1 style functions */
++ if (!mtd->erase ||
++ !mtd->read ||
++ !mtd->write ||
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++ !mtd->read_oob || !mtd->write_oob) {
++#else
++ !mtd->write_ecc ||
++ !mtd->read_ecc || !mtd->read_oob || !mtd->write_oob) {
++#endif
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs: MTD device does not support required "
++ "functions\n"));;
++ return NULL;
++ }
++
++ if (WRITE_SIZE(mtd) < YAFFS_BYTES_PER_CHUNK ||
++ mtd->oobsize != YAFFS_BYTES_PER_SPARE) {
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs: MTD device does not support have the "
++ "right page sizes\n"));
++ return NULL;
++ }
++ }
++
++ /* OK, so if we got here, we have an MTD that's NAND and looks
++ * like it has the right capabilities
++ * Set the yaffs_Device up for mtd
++ */
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++ sb->s_fs_info = dev = kmalloc(sizeof(yaffs_Device), GFP_KERNEL);
++#else
++ sb->u.generic_sbp = dev = kmalloc(sizeof(yaffs_Device), GFP_KERNEL);
++#endif
++ if (!dev) {
++ /* Deep shit could not allocate device structure */
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs_read_super: Failed trying to allocate "
++ "yaffs_Device. \n"));
++ return NULL;
++ }
++
++ memset(dev, 0, sizeof(yaffs_Device));
++ dev->genericDevice = mtd;
++ dev->name = mtd->name;
++
++ /* Set up the memory size parameters.... */
++
++ nBlocks = YCALCBLOCKS(mtd->size, (YAFFS_CHUNKS_PER_BLOCK * YAFFS_BYTES_PER_CHUNK));
++
++ dev->startBlock = 0;
++ dev->endBlock = nBlocks - 1;
++ dev->nChunksPerBlock = YAFFS_CHUNKS_PER_BLOCK;
++ dev->totalBytesPerChunk = YAFFS_BYTES_PER_CHUNK;
++ dev->nReservedBlocks = 5;
++ dev->nShortOpCaches = (options.no_cache) ? 0 : 10;
++ dev->inbandTags = options.inband_tags;
++
++ /* ... and the functions. */
++ if (yaffsVersion == 2) {
++ dev->writeChunkWithTagsToNAND =
++ nandmtd2_WriteChunkWithTagsToNAND;
++ dev->readChunkWithTagsFromNAND =
++ nandmtd2_ReadChunkWithTagsFromNAND;
++ dev->markNANDBlockBad = nandmtd2_MarkNANDBlockBad;
++ dev->queryNANDBlock = nandmtd2_QueryNANDBlock;
++ dev->spareBuffer = YMALLOC(mtd->oobsize);
++ dev->isYaffs2 = 1;
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++ dev->totalBytesPerChunk = mtd->writesize;
++ dev->nChunksPerBlock = mtd->erasesize / mtd->writesize;
++#else
++ dev->totalBytesPerChunk = mtd->oobblock;
++ dev->nChunksPerBlock = mtd->erasesize / mtd->oobblock;
++#endif
++ nBlocks = YCALCBLOCKS(mtd->size, mtd->erasesize);
++
++ dev->startBlock = 0;
++ dev->endBlock = nBlocks - 1;
++ } else {
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++ /* use the MTD interface in yaffs_mtdif1.c */
++ dev->writeChunkWithTagsToNAND =
++ nandmtd1_WriteChunkWithTagsToNAND;
++ dev->readChunkWithTagsFromNAND =
++ nandmtd1_ReadChunkWithTagsFromNAND;
++ dev->markNANDBlockBad = nandmtd1_MarkNANDBlockBad;
++ dev->queryNANDBlock = nandmtd1_QueryNANDBlock;
++#else
++ dev->writeChunkToNAND = nandmtd_WriteChunkToNAND;
++ dev->readChunkFromNAND = nandmtd_ReadChunkFromNAND;
++#endif
++ dev->isYaffs2 = 0;
++ }
++ /* ... and common functions */
++ dev->eraseBlockInNAND = nandmtd_EraseBlockInNAND;
++ dev->initialiseNAND = nandmtd_InitialiseNAND;
++
++ dev->putSuperFunc = yaffs_MTDPutSuper;
++
++ dev->superBlock = (void *)sb;
++ dev->markSuperBlockDirty = yaffs_MarkSuperBlockDirty;
++
++
++#ifndef CONFIG_YAFFS_DOES_ECC
++ dev->useNANDECC = 1;
++#endif
++
++#ifdef CONFIG_YAFFS_DISABLE_WIDE_TNODES
++ dev->wideTnodesDisabled = 1;
++#endif
++
++ dev->skipCheckpointRead = options.skip_checkpoint_read;
++ dev->skipCheckpointWrite = options.skip_checkpoint_write;
++
++ /* we assume this is protected by lock_kernel() in mount/umount */
++ ylist_add_tail(&dev->devList, &yaffs_dev_list);
++
++ init_MUTEX(&dev->grossLock);
++
++ yaffs_GrossLock(dev);
++
++ err = yaffs_GutsInitialise(dev);
++
++ T(YAFFS_TRACE_OS,
++ ("yaffs_read_super: guts initialised %s\n",
++ (err == YAFFS_OK) ? "OK" : "FAILED"));
++
++ /* Release lock before yaffs_get_inode() */
++ yaffs_GrossUnlock(dev);
++
++ /* Create root inode */
++ if (err == YAFFS_OK)
++ inode = yaffs_get_inode(sb, S_IFDIR | 0755, 0,
++ yaffs_Root(dev));
++
++ if (!inode)
++ return NULL;
++
++ inode->i_op = &yaffs_dir_inode_operations;
++ inode->i_fop = &yaffs_dir_operations;
++
++ T(YAFFS_TRACE_OS, ("yaffs_read_super: got root inode\n"));
++
++ root = d_alloc_root(inode);
++
++ T(YAFFS_TRACE_OS, ("yaffs_read_super: d_alloc_root done\n"));
++
++ if (!root) {
++ iput(inode);
++ return NULL;
++ }
++ sb->s_root = root;
++ sb->s_dirt = !dev->isCheckpointed;
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs_read_super: isCheckpointed %d\n", dev->isCheckpointed));
++
++ T(YAFFS_TRACE_OS, ("yaffs_read_super: done\n"));
++ return sb;
++}
++
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs_internal_read_super_mtd(struct super_block *sb, void *data,
++ int silent)
++{
++ return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL;
++}
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs_read_super(struct file_system_type *fs,
++ int flags, const char *dev_name,
++ void *data, struct vfsmount *mnt)
++{
++
++ return get_sb_bdev(fs, flags, dev_name, data,
++ yaffs_internal_read_super_mtd, mnt);
++}
++#else
++static struct super_block *yaffs_read_super(struct file_system_type *fs,
++ int flags, const char *dev_name,
++ void *data)
++{
++
++ return get_sb_bdev(fs, flags, dev_name, data,
++ yaffs_internal_read_super_mtd);
++}
++#endif
++
++static struct file_system_type yaffs_fs_type = {
++ .owner = THIS_MODULE,
++ .name = "yaffs",
++ .get_sb = yaffs_read_super,
++ .kill_sb = kill_block_super,
++ .fs_flags = FS_REQUIRES_DEV,
++};
++#else
++static struct super_block *yaffs_read_super(struct super_block *sb, void *data,
++ int silent)
++{
++ return yaffs_internal_read_super(1, sb, data, silent);
++}
++
++static DECLARE_FSTYPE(yaffs_fs_type, "yaffs", yaffs_read_super,
++ FS_REQUIRES_DEV);
++#endif
++
++
++#ifdef CONFIG_YAFFS_YAFFS2
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++static int yaffs2_internal_read_super_mtd(struct super_block *sb, void *data,
++ int silent)
++{
++ return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL;
++}
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++static int yaffs2_read_super(struct file_system_type *fs,
++ int flags, const char *dev_name, void *data,
++ struct vfsmount *mnt)
++{
++ return get_sb_bdev(fs, flags, dev_name, data,
++ yaffs2_internal_read_super_mtd, mnt);
++}
++#else
++static struct super_block *yaffs2_read_super(struct file_system_type *fs,
++ int flags, const char *dev_name,
++ void *data)
++{
++
++ return get_sb_bdev(fs, flags, dev_name, data,
++ yaffs2_internal_read_super_mtd);
++}
++#endif
++
++static struct file_system_type yaffs2_fs_type = {
++ .owner = THIS_MODULE,
++ .name = "yaffs2",
++ .get_sb = yaffs2_read_super,
++ .kill_sb = kill_block_super,
++ .fs_flags = FS_REQUIRES_DEV,
++};
++#else
++static struct super_block *yaffs2_read_super(struct super_block *sb,
++ void *data, int silent)
++{
++ return yaffs_internal_read_super(2, sb, data, silent);
++}
++
++static DECLARE_FSTYPE(yaffs2_fs_type, "yaffs2", yaffs2_read_super,
++ FS_REQUIRES_DEV);
++#endif
++
++#endif /* CONFIG_YAFFS_YAFFS2 */
++
++static struct proc_dir_entry *my_proc_entry;
++
++static char *yaffs_dump_dev(char *buf, yaffs_Device * dev)
++{
++ buf += sprintf(buf, "startBlock......... %d\n", dev->startBlock);
++ buf += sprintf(buf, "endBlock........... %d\n", dev->endBlock);
++ buf += sprintf(buf, "totalBytesPerChunk. %d\n", dev->totalBytesPerChunk);
++ buf += sprintf(buf, "nDataBytesPerChunk. %d\n", dev->nDataBytesPerChunk);
++ buf += sprintf(buf, "chunkGroupBits..... %d\n", dev->chunkGroupBits);
++ buf += sprintf(buf, "chunkGroupSize..... %d\n", dev->chunkGroupSize);
++ buf += sprintf(buf, "nErasedBlocks...... %d\n", dev->nErasedBlocks);
++ buf += sprintf(buf, "nReservedBlocks.... %d\n", dev->nReservedBlocks);
++ buf += sprintf(buf, "blocksInCheckpoint. %d\n", dev->blocksInCheckpoint);
++ buf += sprintf(buf, "nTnodesCreated..... %d\n", dev->nTnodesCreated);
++ buf += sprintf(buf, "nFreeTnodes........ %d\n", dev->nFreeTnodes);
++ buf += sprintf(buf, "nObjectsCreated.... %d\n", dev->nObjectsCreated);
++ buf += sprintf(buf, "nFreeObjects....... %d\n", dev->nFreeObjects);
++ buf += sprintf(buf, "nFreeChunks........ %d\n", dev->nFreeChunks);
++ buf += sprintf(buf, "nPageWrites........ %d\n", dev->nPageWrites);
++ buf += sprintf(buf, "nPageReads......... %d\n", dev->nPageReads);
++ buf += sprintf(buf, "nBlockErasures..... %d\n", dev->nBlockErasures);
++ buf += sprintf(buf, "nGCCopies.......... %d\n", dev->nGCCopies);
++ buf += sprintf(buf, "garbageCollections. %d\n", dev->garbageCollections);
++ buf += sprintf(buf, "passiveGCs......... %d\n",
++ dev->passiveGarbageCollections);
++ buf += sprintf(buf, "nRetriedWrites..... %d\n", dev->nRetriedWrites);
++ buf += sprintf(buf, "nShortOpCaches..... %d\n", dev->nShortOpCaches);
++ buf += sprintf(buf, "nRetireBlocks...... %d\n", dev->nRetiredBlocks);
++ buf += sprintf(buf, "eccFixed........... %d\n", dev->eccFixed);
++ buf += sprintf(buf, "eccUnfixed......... %d\n", dev->eccUnfixed);
++ buf += sprintf(buf, "tagsEccFixed....... %d\n", dev->tagsEccFixed);
++ buf += sprintf(buf, "tagsEccUnfixed..... %d\n", dev->tagsEccUnfixed);
++ buf += sprintf(buf, "cacheHits.......... %d\n", dev->cacheHits);
++ buf += sprintf(buf, "nDeletedFiles...... %d\n", dev->nDeletedFiles);
++ buf += sprintf(buf, "nUnlinkedFiles..... %d\n", dev->nUnlinkedFiles);
++ buf +=
++ sprintf(buf, "nBackgroudDeletions %d\n", dev->nBackgroundDeletions);
++ buf += sprintf(buf, "useNANDECC......... %d\n", dev->useNANDECC);
++ buf += sprintf(buf, "isYaffs2........... %d\n", dev->isYaffs2);
++ buf += sprintf(buf, "inbandTags......... %d\n", dev->inbandTags);
++
++ return buf;
++}
++
++static int yaffs_proc_read(char *page,
++ char **start,
++ off_t offset, int count, int *eof, void *data)
++{
++ struct ylist_head *item;
++ char *buf = page;
++ int step = offset;
++ int n = 0;
++
++ /* Get proc_file_read() to step 'offset' by one on each sucessive call.
++ * We use 'offset' (*ppos) to indicate where we are in devList.
++ * This also assumes the user has posted a read buffer large
++ * enough to hold the complete output; but that's life in /proc.
++ */
++
++ *(int *)start = 1;
++
++ /* Print header first */
++ if (step == 0) {
++ buf += sprintf(buf, "YAFFS built:" __DATE__ " " __TIME__
++ "\n%s\n%s\n", yaffs_fs_c_version,
++ yaffs_guts_c_version);
++ }
++
++ /* hold lock_kernel while traversing yaffs_dev_list */
++ lock_kernel();
++
++ /* Locate and print the Nth entry. Order N-squared but N is small. */
++ ylist_for_each(item, &yaffs_dev_list) {
++ yaffs_Device *dev = ylist_entry(item, yaffs_Device, devList);
++ if (n < step) {
++ n++;
++ continue;
++ }
++ buf += sprintf(buf, "\nDevice %d \"%s\"\n", n, dev->name);
++ buf = yaffs_dump_dev(buf, dev);
++ break;
++ }
++ unlock_kernel();
++
++ return buf - page < count ? buf - page : count;
++}
++
++/**
++ * Set the verbosity of the warnings and error messages.
++ *
++ * Note that the names can only be a..z or _ with the current code.
++ */
++
++static struct {
++ char *mask_name;
++ unsigned mask_bitfield;
++} mask_flags[] = {
++ {"allocate", YAFFS_TRACE_ALLOCATE},
++ {"always", YAFFS_TRACE_ALWAYS},
++ {"bad_blocks", YAFFS_TRACE_BAD_BLOCKS},
++ {"buffers", YAFFS_TRACE_BUFFERS},
++ {"bug", YAFFS_TRACE_BUG},
++ {"checkpt", YAFFS_TRACE_CHECKPOINT},
++ {"deletion", YAFFS_TRACE_DELETION},
++ {"erase", YAFFS_TRACE_ERASE},
++ {"error", YAFFS_TRACE_ERROR},
++ {"gc_detail", YAFFS_TRACE_GC_DETAIL},
++ {"gc", YAFFS_TRACE_GC},
++ {"mtd", YAFFS_TRACE_MTD},
++ {"nandaccess", YAFFS_TRACE_NANDACCESS},
++ {"os", YAFFS_TRACE_OS},
++ {"scan_debug", YAFFS_TRACE_SCAN_DEBUG},
++ {"scan", YAFFS_TRACE_SCAN},
++ {"tracing", YAFFS_TRACE_TRACING},
++
++ {"verify", YAFFS_TRACE_VERIFY},
++ {"verify_nand", YAFFS_TRACE_VERIFY_NAND},
++ {"verify_full", YAFFS_TRACE_VERIFY_FULL},
++ {"verify_all", YAFFS_TRACE_VERIFY_ALL},
++
++ {"write", YAFFS_TRACE_WRITE},
++ {"all", 0xffffffff},
++ {"none", 0},
++ {NULL, 0},
++};
++
++#define MAX_MASK_NAME_LENGTH 40
++static int yaffs_proc_write(struct file *file, const char *buf,
++ unsigned long count, void *data)
++{
++ unsigned rg = 0, mask_bitfield;
++ char *end;
++ char *mask_name;
++ const char *x;
++ char substring[MAX_MASK_NAME_LENGTH + 1];
++ int i;
++ int done = 0;
++ int add, len = 0;
++ int pos = 0;
++
++ rg = yaffs_traceMask;
++
++ while (!done && (pos < count)) {
++ done = 1;
++ while ((pos < count) && isspace(buf[pos]))
++ pos++;
++
++ switch (buf[pos]) {
++ case '+':
++ case '-':
++ case '=':
++ add = buf[pos];
++ pos++;
++ break;
++
++ default:
++ add = ' ';
++ break;
++ }
++ mask_name = NULL;
++
++ mask_bitfield = simple_strtoul(buf + pos, &end, 0);
++
++ if (end > buf + pos) {
++ mask_name = "numeral";
++ len = end - (buf + pos);
++ pos += len;
++ done = 0;
++ } else {
++ for (x = buf + pos, i = 0;
++ (*x == '_' || (*x >= 'a' && *x <= 'z')) &&
++ i < MAX_MASK_NAME_LENGTH; x++, i++, pos++)
++ substring[i] = *x;
++ substring[i] = '\0';
++
++ for (i = 0; mask_flags[i].mask_name != NULL; i++) {
++ if (strcmp(substring, mask_flags[i].mask_name) == 0) {
++ mask_name = mask_flags[i].mask_name;
++ mask_bitfield = mask_flags[i].mask_bitfield;
++ done = 0;
++ break;
++ }
++ }
++ }
++
++ if (mask_name != NULL) {
++ done = 0;
++ switch (add) {
++ case '-':
++ rg &= ~mask_bitfield;
++ break;
++ case '+':
++ rg |= mask_bitfield;
++ break;
++ case '=':
++ rg = mask_bitfield;
++ break;
++ default:
++ rg |= mask_bitfield;
++ break;
++ }
++ }
++ }
++
++ yaffs_traceMask = rg | YAFFS_TRACE_ALWAYS;
++
++ printk(KERN_DEBUG "new trace = 0x%08X\n", yaffs_traceMask);
++
++ if (rg & YAFFS_TRACE_ALWAYS) {
++ for (i = 0; mask_flags[i].mask_name != NULL; i++) {
++ char flag;
++ flag = ((rg & mask_flags[i].mask_bitfield) == mask_flags[i].mask_bitfield) ? '+' : '-';
++ printk(KERN_DEBUG "%c%s\n", flag, mask_flags[i].mask_name);
++ }
++ }
++
++ return count;
++}
++
++/* Stuff to handle installation of file systems */
++struct file_system_to_install {
++ struct file_system_type *fst;
++ int installed;
++};
++
++static struct file_system_to_install fs_to_install[] = {
++ {&yaffs_fs_type, 0},
++ {&yaffs2_fs_type, 0},
++ {NULL, 0}
++};
++
++static int __init init_yaffs_fs(void)
++{
++ int error = 0;
++ struct file_system_to_install *fsinst;
++
++ T(YAFFS_TRACE_ALWAYS,
++ ("yaffs " __DATE__ " " __TIME__ " Installing. \n"));
++
++ /* Install the proc_fs entry */
++ my_proc_entry = create_proc_entry("yaffs",
++ S_IRUGO | S_IFREG,
++ YPROC_ROOT);
++
++ if (my_proc_entry) {
++ my_proc_entry->write_proc = yaffs_proc_write;
++ my_proc_entry->read_proc = yaffs_proc_read;
++ my_proc_entry->data = NULL;
++ } else
++ return -ENOMEM;
++
++ /* Now add the file system entries */
++
++ fsinst = fs_to_install;
++
++ while (fsinst->fst && !error) {
++ error = register_filesystem(fsinst->fst);
++ if (!error)
++ fsinst->installed = 1;
++ fsinst++;
++ }
++
++ /* Any errors? uninstall */
++ if (error) {
++ fsinst = fs_to_install;
++
++ while (fsinst->fst) {
++ if (fsinst->installed) {
++ unregister_filesystem(fsinst->fst);
++ fsinst->installed = 0;
++ }
++ fsinst++;
++ }
++ }
++
++ return error;
++}
++
++static void __exit exit_yaffs_fs(void)
++{
++
++ struct file_system_to_install *fsinst;
++
++ T(YAFFS_TRACE_ALWAYS, ("yaffs " __DATE__ " " __TIME__
++ " removing. \n"));
++
++ remove_proc_entry("yaffs", YPROC_ROOT);
++
++ fsinst = fs_to_install;
++
++ while (fsinst->fst) {
++ if (fsinst->installed) {
++ unregister_filesystem(fsinst->fst);
++ fsinst->installed = 0;
++ }
++ fsinst++;
++ }
++}
++
++module_init(init_yaffs_fs)
++module_exit(exit_yaffs_fs)
++
++MODULE_DESCRIPTION("YAFFS2 - a NAND specific flash file system");
++MODULE_AUTHOR("Charles Manning, Aleph One Ltd., 2002-2006");
++MODULE_LICENSE("GPL");
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_getblockinfo.h linux-2.6.29.1/fs/yaffs2/yaffs_getblockinfo.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_getblockinfo.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_getblockinfo.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,34 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_GETBLOCKINFO_H__
++#define __YAFFS_GETBLOCKINFO_H__
++
++#include "yaffs_guts.h"
++
++/* Function to manipulate block info */
++static Y_INLINE yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device * dev, int blk)
++{
++ if (blk < dev->internalStartBlock || blk > dev->internalEndBlock) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>> yaffs: getBlockInfo block %d is not valid" TENDSTR),
++ blk));
++ YBUG();
++ }
++ return &dev->blockInfo[blk - dev->internalStartBlock];
++}
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_guts.c linux-2.6.29.1/fs/yaffs2/yaffs_guts.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_guts.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_guts.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,7552 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++const char *yaffs_guts_c_version =
++ "$Id: yaffs_guts.c,v 1.82 2009-03-09 04:24:17 charles Exp $";
++
++#include "yportenv.h"
++
++#include "yaffsinterface.h"
++#include "yaffs_guts.h"
++#include "yaffs_tagsvalidity.h"
++#include "yaffs_getblockinfo.h"
++
++#include "yaffs_tagscompat.h"
++#ifndef CONFIG_YAFFS_USE_OWN_SORT
++#include "yaffs_qsort.h"
++#endif
++#include "yaffs_nand.h"
++
++#include "yaffs_checkptrw.h"
++
++#include "yaffs_nand.h"
++#include "yaffs_packedtags2.h"
++
++
++#define YAFFS_PASSIVE_GC_CHUNKS 2
++
++#include "yaffs_ecc.h"
++
++
++/* Robustification (if it ever comes about...) */
++static void yaffs_RetireBlock(yaffs_Device *dev, int blockInNAND);
++static void yaffs_HandleWriteChunkError(yaffs_Device *dev, int chunkInNAND,
++ int erasedOk);
++static void yaffs_HandleWriteChunkOk(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data,
++ const yaffs_ExtendedTags *tags);
++static void yaffs_HandleUpdateChunk(yaffs_Device *dev, int chunkInNAND,
++ const yaffs_ExtendedTags *tags);
++
++/* Other local prototypes */
++static int yaffs_UnlinkObject(yaffs_Object *obj);
++static int yaffs_ObjectHasCachedWriteData(yaffs_Object *obj);
++
++static void yaffs_HardlinkFixup(yaffs_Device *dev, yaffs_Object *hardList);
++
++static int yaffs_WriteNewChunkWithTagsToNAND(yaffs_Device *dev,
++ const __u8 *buffer,
++ yaffs_ExtendedTags *tags,
++ int useReserve);
++static int yaffs_PutChunkIntoFile(yaffs_Object *in, int chunkInInode,
++ int chunkInNAND, int inScan);
++
++static yaffs_Object *yaffs_CreateNewObject(yaffs_Device *dev, int number,
++ yaffs_ObjectType type);
++static void yaffs_AddObjectToDirectory(yaffs_Object *directory,
++ yaffs_Object *obj);
++static int yaffs_UpdateObjectHeader(yaffs_Object *in, const YCHAR *name,
++ int force, int isShrink, int shadows);
++static void yaffs_RemoveObjectFromDirectory(yaffs_Object *obj);
++static int yaffs_CheckStructures(void);
++static int yaffs_DeleteWorker(yaffs_Object *in, yaffs_Tnode *tn, __u32 level,
++ int chunkOffset, int *limit);
++static int yaffs_DoGenericObjectDeletion(yaffs_Object *in);
++
++static yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device *dev, int blockNo);
++
++
++static int yaffs_CheckChunkErased(struct yaffs_DeviceStruct *dev,
++ int chunkInNAND);
++
++static int yaffs_UnlinkWorker(yaffs_Object *obj);
++
++static int yaffs_TagsMatch(const yaffs_ExtendedTags *tags, int objectId,
++ int chunkInObject);
++
++static int yaffs_AllocateChunk(yaffs_Device *dev, int useReserve,
++ yaffs_BlockInfo **blockUsedPtr);
++
++static void yaffs_VerifyFreeChunks(yaffs_Device *dev);
++
++static void yaffs_CheckObjectDetailsLoaded(yaffs_Object *in);
++
++static void yaffs_VerifyDirectory(yaffs_Object *directory);
++#ifdef YAFFS_PARANOID
++static int yaffs_CheckFileSanity(yaffs_Object *in);
++#else
++#define yaffs_CheckFileSanity(in)
++#endif
++
++static void yaffs_InvalidateWholeChunkCache(yaffs_Object *in);
++static void yaffs_InvalidateChunkCache(yaffs_Object *object, int chunkId);
++
++static void yaffs_InvalidateCheckpoint(yaffs_Device *dev);
++
++static int yaffs_FindChunkInFile(yaffs_Object *in, int chunkInInode,
++ yaffs_ExtendedTags *tags);
++
++static __u32 yaffs_GetChunkGroupBase(yaffs_Device *dev, yaffs_Tnode *tn,
++ unsigned pos);
++static yaffs_Tnode *yaffs_FindLevel0Tnode(yaffs_Device *dev,
++ yaffs_FileStructure *fStruct,
++ __u32 chunkId);
++
++
++/* Function to calculate chunk and offset */
++
++static void yaffs_AddrToChunk(yaffs_Device *dev, loff_t addr, int *chunkOut,
++ __u32 *offsetOut)
++{
++ int chunk;
++ __u32 offset;
++
++ chunk = (__u32)(addr >> dev->chunkShift);
++
++ if (dev->chunkDiv == 1) {
++ /* easy power of 2 case */
++ offset = (__u32)(addr & dev->chunkMask);
++ } else {
++ /* Non power-of-2 case */
++
++ loff_t chunkBase;
++
++ chunk /= dev->chunkDiv;
++
++ chunkBase = ((loff_t)chunk) * dev->nDataBytesPerChunk;
++ offset = (__u32)(addr - chunkBase);
++ }
++
++ *chunkOut = chunk;
++ *offsetOut = offset;
++}
++
++/* Function to return the number of shifts for a power of 2 greater than or
++ * equal to the given number
++ * Note we don't try to cater for all possible numbers and this does not have to
++ * be hellishly efficient.
++ */
++
++static __u32 ShiftsGE(__u32 x)
++{
++ int extraBits;
++ int nShifts;
++
++ nShifts = extraBits = 0;
++
++ while (x > 1) {
++ if (x & 1)
++ extraBits++;
++ x >>= 1;
++ nShifts++;
++ }
++
++ if (extraBits)
++ nShifts++;
++
++ return nShifts;
++}
++
++/* Function to return the number of shifts to get a 1 in bit 0
++ */
++
++static __u32 Shifts(__u32 x)
++{
++ int nShifts;
++
++ nShifts = 0;
++
++ if (!x)
++ return 0;
++
++ while (!(x&1)) {
++ x >>= 1;
++ nShifts++;
++ }
++
++ return nShifts;
++}
++
++
++
++/*
++ * Temporary buffer manipulations.
++ */
++
++static int yaffs_InitialiseTempBuffers(yaffs_Device *dev)
++{
++ int i;
++ __u8 *buf = (__u8 *)1;
++
++ memset(dev->tempBuffer, 0, sizeof(dev->tempBuffer));
++
++ for (i = 0; buf && i < YAFFS_N_TEMP_BUFFERS; i++) {
++ dev->tempBuffer[i].line = 0; /* not in use */
++ dev->tempBuffer[i].buffer = buf =
++ YMALLOC_DMA(dev->totalBytesPerChunk);
++ }
++
++ return buf ? YAFFS_OK : YAFFS_FAIL;
++}
++
++__u8 *yaffs_GetTempBuffer(yaffs_Device *dev, int lineNo)
++{
++ int i, j;
++
++ dev->tempInUse++;
++ if (dev->tempInUse > dev->maxTemp)
++ dev->maxTemp = dev->tempInUse;
++
++ for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++) {
++ if (dev->tempBuffer[i].line == 0) {
++ dev->tempBuffer[i].line = lineNo;
++ if ((i + 1) > dev->maxTemp) {
++ dev->maxTemp = i + 1;
++ for (j = 0; j <= i; j++)
++ dev->tempBuffer[j].maxLine =
++ dev->tempBuffer[j].line;
++ }
++
++ return dev->tempBuffer[i].buffer;
++ }
++ }
++
++ T(YAFFS_TRACE_BUFFERS,
++ (TSTR("Out of temp buffers at line %d, other held by lines:"),
++ lineNo));
++ for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++)
++ T(YAFFS_TRACE_BUFFERS, (TSTR(" %d "), dev->tempBuffer[i].line));
++
++ T(YAFFS_TRACE_BUFFERS, (TSTR(" " TENDSTR)));
++
++ /*
++ * If we got here then we have to allocate an unmanaged one
++ * This is not good.
++ */
++
++ dev->unmanagedTempAllocations++;
++ return YMALLOC(dev->nDataBytesPerChunk);
++
++}
++
++void yaffs_ReleaseTempBuffer(yaffs_Device *dev, __u8 *buffer,
++ int lineNo)
++{
++ int i;
++
++ dev->tempInUse--;
++
++ for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++) {
++ if (dev->tempBuffer[i].buffer == buffer) {
++ dev->tempBuffer[i].line = 0;
++ return;
++ }
++ }
++
++ if (buffer) {
++ /* assume it is an unmanaged one. */
++ T(YAFFS_TRACE_BUFFERS,
++ (TSTR("Releasing unmanaged temp buffer in line %d" TENDSTR),
++ lineNo));
++ YFREE(buffer);
++ dev->unmanagedTempDeallocations++;
++ }
++
++}
++
++/*
++ * Determine if we have a managed buffer.
++ */
++int yaffs_IsManagedTempBuffer(yaffs_Device *dev, const __u8 *buffer)
++{
++ int i;
++
++ for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++) {
++ if (dev->tempBuffer[i].buffer == buffer)
++ return 1;
++ }
++
++ for (i = 0; i < dev->nShortOpCaches; i++) {
++ if (dev->srCache[i].data == buffer)
++ return 1;
++ }
++
++ if (buffer == dev->checkpointBuffer)
++ return 1;
++
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs: unmaged buffer detected.\n" TENDSTR)));
++ return 0;
++}
++
++
++
++/*
++ * Chunk bitmap manipulations
++ */
++
++static Y_INLINE __u8 *yaffs_BlockBits(yaffs_Device *dev, int blk)
++{
++ if (blk < dev->internalStartBlock || blk > dev->internalEndBlock) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("**>> yaffs: BlockBits block %d is not valid" TENDSTR),
++ blk));
++ YBUG();
++ }
++ return dev->chunkBits +
++ (dev->chunkBitmapStride * (blk - dev->internalStartBlock));
++}
++
++static Y_INLINE void yaffs_VerifyChunkBitId(yaffs_Device *dev, int blk, int chunk)
++{
++ if (blk < dev->internalStartBlock || blk > dev->internalEndBlock ||
++ chunk < 0 || chunk >= dev->nChunksPerBlock) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("**>> yaffs: Chunk Id (%d:%d) invalid"TENDSTR),
++ blk, chunk));
++ YBUG();
++ }
++}
++
++static Y_INLINE void yaffs_ClearChunkBits(yaffs_Device *dev, int blk)
++{
++ __u8 *blkBits = yaffs_BlockBits(dev, blk);
++
++ memset(blkBits, 0, dev->chunkBitmapStride);
++}
++
++static Y_INLINE void yaffs_ClearChunkBit(yaffs_Device *dev, int blk, int chunk)
++{
++ __u8 *blkBits = yaffs_BlockBits(dev, blk);
++
++ yaffs_VerifyChunkBitId(dev, blk, chunk);
++
++ blkBits[chunk / 8] &= ~(1 << (chunk & 7));
++}
++
++static Y_INLINE void yaffs_SetChunkBit(yaffs_Device *dev, int blk, int chunk)
++{
++ __u8 *blkBits = yaffs_BlockBits(dev, blk);
++
++ yaffs_VerifyChunkBitId(dev, blk, chunk);
++
++ blkBits[chunk / 8] |= (1 << (chunk & 7));
++}
++
++static Y_INLINE int yaffs_CheckChunkBit(yaffs_Device *dev, int blk, int chunk)
++{
++ __u8 *blkBits = yaffs_BlockBits(dev, blk);
++ yaffs_VerifyChunkBitId(dev, blk, chunk);
++
++ return (blkBits[chunk / 8] & (1 << (chunk & 7))) ? 1 : 0;
++}
++
++static Y_INLINE int yaffs_StillSomeChunkBits(yaffs_Device *dev, int blk)
++{
++ __u8 *blkBits = yaffs_BlockBits(dev, blk);
++ int i;
++ for (i = 0; i < dev->chunkBitmapStride; i++) {
++ if (*blkBits)
++ return 1;
++ blkBits++;
++ }
++ return 0;
++}
++
++static int yaffs_CountChunkBits(yaffs_Device *dev, int blk)
++{
++ __u8 *blkBits = yaffs_BlockBits(dev, blk);
++ int i;
++ int n = 0;
++ for (i = 0; i < dev->chunkBitmapStride; i++) {
++ __u8 x = *blkBits;
++ while (x) {
++ if (x & 1)
++ n++;
++ x >>= 1;
++ }
++
++ blkBits++;
++ }
++ return n;
++}
++
++/*
++ * Verification code
++ */
++
++static int yaffs_SkipVerification(yaffs_Device *dev)
++{
++ return !(yaffs_traceMask & (YAFFS_TRACE_VERIFY | YAFFS_TRACE_VERIFY_FULL));
++}
++
++static int yaffs_SkipFullVerification(yaffs_Device *dev)
++{
++ return !(yaffs_traceMask & (YAFFS_TRACE_VERIFY_FULL));
++}
++
++static int yaffs_SkipNANDVerification(yaffs_Device *dev)
++{
++ return !(yaffs_traceMask & (YAFFS_TRACE_VERIFY_NAND));
++}
++
++static const char *blockStateName[] = {
++"Unknown",
++"Needs scanning",
++"Scanning",
++"Empty",
++"Allocating",
++"Full",
++"Dirty",
++"Checkpoint",
++"Collecting",
++"Dead"
++};
++
++static void yaffs_VerifyBlock(yaffs_Device *dev, yaffs_BlockInfo *bi, int n)
++{
++ int actuallyUsed;
++ int inUse;
++
++ if (yaffs_SkipVerification(dev))
++ return;
++
++ /* Report illegal runtime states */
++ if (bi->blockState >= YAFFS_NUMBER_OF_BLOCK_STATES)
++ T(YAFFS_TRACE_VERIFY, (TSTR("Block %d has undefined state %d"TENDSTR), n, bi->blockState));
++
++ switch (bi->blockState) {
++ case YAFFS_BLOCK_STATE_UNKNOWN:
++ case YAFFS_BLOCK_STATE_SCANNING:
++ case YAFFS_BLOCK_STATE_NEEDS_SCANNING:
++ T(YAFFS_TRACE_VERIFY, (TSTR("Block %d has bad run-state %s"TENDSTR),
++ n, blockStateName[bi->blockState]));
++ }
++
++ /* Check pages in use and soft deletions are legal */
++
++ actuallyUsed = bi->pagesInUse - bi->softDeletions;
++
++ if (bi->pagesInUse < 0 || bi->pagesInUse > dev->nChunksPerBlock ||
++ bi->softDeletions < 0 || bi->softDeletions > dev->nChunksPerBlock ||
++ actuallyUsed < 0 || actuallyUsed > dev->nChunksPerBlock)
++ T(YAFFS_TRACE_VERIFY, (TSTR("Block %d has illegal values pagesInUsed %d softDeletions %d"TENDSTR),
++ n, bi->pagesInUse, bi->softDeletions));
++
++
++ /* Check chunk bitmap legal */
++ inUse = yaffs_CountChunkBits(dev, n);
++ if (inUse != bi->pagesInUse)
++ T(YAFFS_TRACE_VERIFY, (TSTR("Block %d has inconsistent values pagesInUse %d counted chunk bits %d"TENDSTR),
++ n, bi->pagesInUse, inUse));
++
++ /* Check that the sequence number is valid.
++ * Ten million is legal, but is very unlikely
++ */
++ if (dev->isYaffs2 &&
++ (bi->blockState == YAFFS_BLOCK_STATE_ALLOCATING || bi->blockState == YAFFS_BLOCK_STATE_FULL) &&
++ (bi->sequenceNumber < YAFFS_LOWEST_SEQUENCE_NUMBER || bi->sequenceNumber > 10000000))
++ T(YAFFS_TRACE_VERIFY, (TSTR("Block %d has suspect sequence number of %d"TENDSTR),
++ n, bi->sequenceNumber));
++}
++
++static void yaffs_VerifyCollectedBlock(yaffs_Device *dev, yaffs_BlockInfo *bi,
++ int n)
++{
++ yaffs_VerifyBlock(dev, bi, n);
++
++ /* After collection the block should be in the erased state */
++ /* This will need to change if we do partial gc */
++
++ if (bi->blockState != YAFFS_BLOCK_STATE_COLLECTING &&
++ bi->blockState != YAFFS_BLOCK_STATE_EMPTY) {
++ T(YAFFS_TRACE_ERROR, (TSTR("Block %d is in state %d after gc, should be erased"TENDSTR),
++ n, bi->blockState));
++ }
++}
++
++static void yaffs_VerifyBlocks(yaffs_Device *dev)
++{
++ int i;
++ int nBlocksPerState[YAFFS_NUMBER_OF_BLOCK_STATES];
++ int nIllegalBlockStates = 0;
++
++ if (yaffs_SkipVerification(dev))
++ return;
++
++ memset(nBlocksPerState, 0, sizeof(nBlocksPerState));
++
++ for (i = dev->internalStartBlock; i <= dev->internalEndBlock; i++) {
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, i);
++ yaffs_VerifyBlock(dev, bi, i);
++
++ if (bi->blockState < YAFFS_NUMBER_OF_BLOCK_STATES)
++ nBlocksPerState[bi->blockState]++;
++ else
++ nIllegalBlockStates++;
++ }
++
++ T(YAFFS_TRACE_VERIFY, (TSTR(""TENDSTR)));
++ T(YAFFS_TRACE_VERIFY, (TSTR("Block summary"TENDSTR)));
++
++ T(YAFFS_TRACE_VERIFY, (TSTR("%d blocks have illegal states"TENDSTR), nIllegalBlockStates));
++ if (nBlocksPerState[YAFFS_BLOCK_STATE_ALLOCATING] > 1)
++ T(YAFFS_TRACE_VERIFY, (TSTR("Too many allocating blocks"TENDSTR)));
++
++ for (i = 0; i < YAFFS_NUMBER_OF_BLOCK_STATES; i++)
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("%s %d blocks"TENDSTR),
++ blockStateName[i], nBlocksPerState[i]));
++
++ if (dev->blocksInCheckpoint != nBlocksPerState[YAFFS_BLOCK_STATE_CHECKPOINT])
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Checkpoint block count wrong dev %d count %d"TENDSTR),
++ dev->blocksInCheckpoint, nBlocksPerState[YAFFS_BLOCK_STATE_CHECKPOINT]));
++
++ if (dev->nErasedBlocks != nBlocksPerState[YAFFS_BLOCK_STATE_EMPTY])
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Erased block count wrong dev %d count %d"TENDSTR),
++ dev->nErasedBlocks, nBlocksPerState[YAFFS_BLOCK_STATE_EMPTY]));
++
++ if (nBlocksPerState[YAFFS_BLOCK_STATE_COLLECTING] > 1)
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Too many collecting blocks %d (max is 1)"TENDSTR),
++ nBlocksPerState[YAFFS_BLOCK_STATE_COLLECTING]));
++
++ T(YAFFS_TRACE_VERIFY, (TSTR(""TENDSTR)));
++
++}
++
++/*
++ * Verify the object header. oh must be valid, but obj and tags may be NULL in which
++ * case those tests will not be performed.
++ */
++static void yaffs_VerifyObjectHeader(yaffs_Object *obj, yaffs_ObjectHeader *oh, yaffs_ExtendedTags *tags, int parentCheck)
++{
++ if (obj && yaffs_SkipVerification(obj->myDev))
++ return;
++
++ if (!(tags && obj && oh)) {
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Verifying object header tags %x obj %x oh %x"TENDSTR),
++ (__u32)tags, (__u32)obj, (__u32)oh));
++ return;
++ }
++
++ if (oh->type <= YAFFS_OBJECT_TYPE_UNKNOWN ||
++ oh->type > YAFFS_OBJECT_TYPE_MAX)
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d header type is illegal value 0x%x"TENDSTR),
++ tags->objectId, oh->type));
++
++ if (tags->objectId != obj->objectId)
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d header mismatch objectId %d"TENDSTR),
++ tags->objectId, obj->objectId));
++
++
++ /*
++ * Check that the object's parent ids match if parentCheck requested.
++ *
++ * Tests do not apply to the root object.
++ */
++
++ if (parentCheck && tags->objectId > 1 && !obj->parent)
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d header mismatch parentId %d obj->parent is NULL"TENDSTR),
++ tags->objectId, oh->parentObjectId));
++
++ if (parentCheck && obj->parent &&
++ oh->parentObjectId != obj->parent->objectId &&
++ (oh->parentObjectId != YAFFS_OBJECTID_UNLINKED ||
++ obj->parent->objectId != YAFFS_OBJECTID_DELETED))
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d header mismatch parentId %d parentObjectId %d"TENDSTR),
++ tags->objectId, oh->parentObjectId, obj->parent->objectId));
++
++ if (tags->objectId > 1 && oh->name[0] == 0) /* Null name */
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d header name is NULL"TENDSTR),
++ obj->objectId));
++
++ if (tags->objectId > 1 && ((__u8)(oh->name[0])) == 0xff) /* Trashed name */
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d header name is 0xFF"TENDSTR),
++ obj->objectId));
++}
++
++
++
++static int yaffs_VerifyTnodeWorker(yaffs_Object *obj, yaffs_Tnode *tn,
++ __u32 level, int chunkOffset)
++{
++ int i;
++ yaffs_Device *dev = obj->myDev;
++ int ok = 1;
++
++ if (tn) {
++ if (level > 0) {
++
++ for (i = 0; i < YAFFS_NTNODES_INTERNAL && ok; i++) {
++ if (tn->internal[i]) {
++ ok = yaffs_VerifyTnodeWorker(obj,
++ tn->internal[i],
++ level - 1,
++ (chunkOffset<<YAFFS_TNODES_INTERNAL_BITS) + i);
++ }
++ }
++ } else if (level == 0) {
++ yaffs_ExtendedTags tags;
++ __u32 objectId = obj->objectId;
++
++ chunkOffset <<= YAFFS_TNODES_LEVEL0_BITS;
++
++ for (i = 0; i < YAFFS_NTNODES_LEVEL0; i++) {
++ __u32 theChunk = yaffs_GetChunkGroupBase(dev, tn, i);
++
++ if (theChunk > 0) {
++ /* T(~0,(TSTR("verifying (%d:%d) %d"TENDSTR),tags.objectId,tags.chunkId,theChunk)); */
++ yaffs_ReadChunkWithTagsFromNAND(dev, theChunk, NULL, &tags);
++ if (tags.objectId != objectId || tags.chunkId != chunkOffset) {
++ T(~0, (TSTR("Object %d chunkId %d NAND mismatch chunk %d tags (%d:%d)"TENDSTR),
++ objectId, chunkOffset, theChunk,
++ tags.objectId, tags.chunkId));
++ }
++ }
++ chunkOffset++;
++ }
++ }
++ }
++
++ return ok;
++
++}
++
++
++static void yaffs_VerifyFile(yaffs_Object *obj)
++{
++ int requiredTallness;
++ int actualTallness;
++ __u32 lastChunk;
++ __u32 x;
++ __u32 i;
++ yaffs_Device *dev;
++ yaffs_ExtendedTags tags;
++ yaffs_Tnode *tn;
++ __u32 objectId;
++
++ if (!obj)
++ return;
++
++ if (yaffs_SkipVerification(obj->myDev))
++ return;
++
++ dev = obj->myDev;
++ objectId = obj->objectId;
++
++ /* Check file size is consistent with tnode depth */
++ lastChunk = obj->variant.fileVariant.fileSize / dev->nDataBytesPerChunk + 1;
++ x = lastChunk >> YAFFS_TNODES_LEVEL0_BITS;
++ requiredTallness = 0;
++ while (x > 0) {
++ x >>= YAFFS_TNODES_INTERNAL_BITS;
++ requiredTallness++;
++ }
++
++ actualTallness = obj->variant.fileVariant.topLevel;
++
++ if (requiredTallness > actualTallness)
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d had tnode tallness %d, needs to be %d"TENDSTR),
++ obj->objectId, actualTallness, requiredTallness));
++
++
++ /* Check that the chunks in the tnode tree are all correct.
++ * We do this by scanning through the tnode tree and
++ * checking the tags for every chunk match.
++ */
++
++ if (yaffs_SkipNANDVerification(dev))
++ return;
++
++ for (i = 1; i <= lastChunk; i++) {
++ tn = yaffs_FindLevel0Tnode(dev, &obj->variant.fileVariant, i);
++
++ if (tn) {
++ __u32 theChunk = yaffs_GetChunkGroupBase(dev, tn, i);
++ if (theChunk > 0) {
++ /* T(~0,(TSTR("verifying (%d:%d) %d"TENDSTR),objectId,i,theChunk)); */
++ yaffs_ReadChunkWithTagsFromNAND(dev, theChunk, NULL, &tags);
++ if (tags.objectId != objectId || tags.chunkId != i) {
++ T(~0, (TSTR("Object %d chunkId %d NAND mismatch chunk %d tags (%d:%d)"TENDSTR),
++ objectId, i, theChunk,
++ tags.objectId, tags.chunkId));
++ }
++ }
++ }
++ }
++}
++
++
++static void yaffs_VerifyHardLink(yaffs_Object *obj)
++{
++ if (obj && yaffs_SkipVerification(obj->myDev))
++ return;
++
++ /* Verify sane equivalent object */
++}
++
++static void yaffs_VerifySymlink(yaffs_Object *obj)
++{
++ if (obj && yaffs_SkipVerification(obj->myDev))
++ return;
++
++ /* Verify symlink string */
++}
++
++static void yaffs_VerifySpecial(yaffs_Object *obj)
++{
++ if (obj && yaffs_SkipVerification(obj->myDev))
++ return;
++}
++
++static void yaffs_VerifyObject(yaffs_Object *obj)
++{
++ yaffs_Device *dev;
++
++ __u32 chunkMin;
++ __u32 chunkMax;
++
++ __u32 chunkIdOk;
++ __u32 chunkInRange;
++ __u32 chunkShouldNotBeDeleted;
++ __u32 chunkValid;
++
++ if (!obj)
++ return;
++
++ if (obj->beingCreated)
++ return;
++
++ dev = obj->myDev;
++
++ if (yaffs_SkipVerification(dev))
++ return;
++
++ /* Check sane object header chunk */
++
++ chunkMin = dev->internalStartBlock * dev->nChunksPerBlock;
++ chunkMax = (dev->internalEndBlock+1) * dev->nChunksPerBlock - 1;
++
++ chunkInRange = (((unsigned)(obj->hdrChunk)) >= chunkMin && ((unsigned)(obj->hdrChunk)) <= chunkMax);
++ chunkIdOk = chunkInRange || obj->hdrChunk == 0;
++ chunkValid = chunkInRange &&
++ yaffs_CheckChunkBit(dev,
++ obj->hdrChunk / dev->nChunksPerBlock,
++ obj->hdrChunk % dev->nChunksPerBlock);
++ chunkShouldNotBeDeleted = chunkInRange && !chunkValid;
++
++ if (!obj->fake &&
++ (!chunkIdOk || chunkShouldNotBeDeleted)) {
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d has chunkId %d %s %s"TENDSTR),
++ obj->objectId, obj->hdrChunk,
++ chunkIdOk ? "" : ",out of range",
++ chunkShouldNotBeDeleted ? ",marked as deleted" : ""));
++ }
++
++ if (chunkValid && !yaffs_SkipNANDVerification(dev)) {
++ yaffs_ExtendedTags tags;
++ yaffs_ObjectHeader *oh;
++ __u8 *buffer = yaffs_GetTempBuffer(dev, __LINE__);
++
++ oh = (yaffs_ObjectHeader *)buffer;
++
++ yaffs_ReadChunkWithTagsFromNAND(dev, obj->hdrChunk, buffer,
++ &tags);
++
++ yaffs_VerifyObjectHeader(obj, oh, &tags, 1);
++
++ yaffs_ReleaseTempBuffer(dev, buffer, __LINE__);
++ }
++
++ /* Verify it has a parent */
++ if (obj && !obj->fake &&
++ (!obj->parent || obj->parent->myDev != dev)) {
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d has parent pointer %p which does not look like an object"TENDSTR),
++ obj->objectId, obj->parent));
++ }
++
++ /* Verify parent is a directory */
++ if (obj->parent && obj->parent->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d's parent is not a directory (type %d)"TENDSTR),
++ obj->objectId, obj->parent->variantType));
++ }
++
++ switch (obj->variantType) {
++ case YAFFS_OBJECT_TYPE_FILE:
++ yaffs_VerifyFile(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ yaffs_VerifySymlink(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ yaffs_VerifyDirectory(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ yaffs_VerifyHardLink(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ yaffs_VerifySpecial(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ default:
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Obj %d has illegaltype %d"TENDSTR),
++ obj->objectId, obj->variantType));
++ break;
++ }
++}
++
++static void yaffs_VerifyObjects(yaffs_Device *dev)
++{
++ yaffs_Object *obj;
++ int i;
++ struct ylist_head *lh;
++
++ if (yaffs_SkipVerification(dev))
++ return;
++
++ /* Iterate through the objects in each hash entry */
++
++ for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
++ ylist_for_each(lh, &dev->objectBucket[i].list) {
++ if (lh) {
++ obj = ylist_entry(lh, yaffs_Object, hashLink);
++ yaffs_VerifyObject(obj);
++ }
++ }
++ }
++}
++
++
++/*
++ * Simple hash function. Needs to have a reasonable spread
++ */
++
++static Y_INLINE int yaffs_HashFunction(int n)
++{
++ n = abs(n);
++ return n % YAFFS_NOBJECT_BUCKETS;
++}
++
++/*
++ * Access functions to useful fake objects.
++ * Note that root might have a presence in NAND if permissions are set.
++ */
++
++yaffs_Object *yaffs_Root(yaffs_Device *dev)
++{
++ return dev->rootDir;
++}
++
++yaffs_Object *yaffs_LostNFound(yaffs_Device *dev)
++{
++ return dev->lostNFoundDir;
++}
++
++
++/*
++ * Erased NAND checking functions
++ */
++
++int yaffs_CheckFF(__u8 *buffer, int nBytes)
++{
++ /* Horrible, slow implementation */
++ while (nBytes--) {
++ if (*buffer != 0xFF)
++ return 0;
++ buffer++;
++ }
++ return 1;
++}
++
++static int yaffs_CheckChunkErased(struct yaffs_DeviceStruct *dev,
++ int chunkInNAND)
++{
++ int retval = YAFFS_OK;
++ __u8 *data = yaffs_GetTempBuffer(dev, __LINE__);
++ yaffs_ExtendedTags tags;
++ int result;
++
++ result = yaffs_ReadChunkWithTagsFromNAND(dev, chunkInNAND, data, &tags);
++
++ if (tags.eccResult > YAFFS_ECC_RESULT_NO_ERROR)
++ retval = YAFFS_FAIL;
++
++ if (!yaffs_CheckFF(data, dev->nDataBytesPerChunk) || tags.chunkUsed) {
++ T(YAFFS_TRACE_NANDACCESS,
++ (TSTR("Chunk %d not erased" TENDSTR), chunkInNAND));
++ retval = YAFFS_FAIL;
++ }
++
++ yaffs_ReleaseTempBuffer(dev, data, __LINE__);
++
++ return retval;
++
++}
++
++static int yaffs_WriteNewChunkWithTagsToNAND(struct yaffs_DeviceStruct *dev,
++ const __u8 *data,
++ yaffs_ExtendedTags *tags,
++ int useReserve)
++{
++ int attempts = 0;
++ int writeOk = 0;
++ int chunk;
++
++ yaffs_InvalidateCheckpoint(dev);
++
++ do {
++ yaffs_BlockInfo *bi = 0;
++ int erasedOk = 0;
++
++ chunk = yaffs_AllocateChunk(dev, useReserve, &bi);
++ if (chunk < 0) {
++ /* no space */
++ break;
++ }
++
++ /* First check this chunk is erased, if it needs
++ * checking. The checking policy (unless forced
++ * always on) is as follows:
++ *
++ * Check the first page we try to write in a block.
++ * If the check passes then we don't need to check any
++ * more. If the check fails, we check again...
++ * If the block has been erased, we don't need to check.
++ *
++ * However, if the block has been prioritised for gc,
++ * then we think there might be something odd about
++ * this block and stop using it.
++ *
++ * Rationale: We should only ever see chunks that have
++ * not been erased if there was a partially written
++ * chunk due to power loss. This checking policy should
++ * catch that case with very few checks and thus save a
++ * lot of checks that are most likely not needed.
++ */
++ if (bi->gcPrioritise) {
++ yaffs_DeleteChunk(dev, chunk, 1, __LINE__);
++ /* try another chunk */
++ continue;
++ }
++
++ /* let's give it a try */
++ attempts++;
++
++#ifdef CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED
++ bi->skipErasedCheck = 0;
++#endif
++ if (!bi->skipErasedCheck) {
++ erasedOk = yaffs_CheckChunkErased(dev, chunk);
++ if (erasedOk != YAFFS_OK) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("**>> yaffs chunk %d was not erased"
++ TENDSTR), chunk));
++
++ /* try another chunk */
++ continue;
++ }
++ bi->skipErasedCheck = 1;
++ }
++
++ writeOk = yaffs_WriteChunkWithTagsToNAND(dev, chunk,
++ data, tags);
++ if (writeOk != YAFFS_OK) {
++ yaffs_HandleWriteChunkError(dev, chunk, erasedOk);
++ /* try another chunk */
++ continue;
++ }
++
++ /* Copy the data into the robustification buffer */
++ yaffs_HandleWriteChunkOk(dev, chunk, data, tags);
++
++ } while (writeOk != YAFFS_OK &&
++ (yaffs_wr_attempts <= 0 || attempts <= yaffs_wr_attempts));
++
++ if (!writeOk)
++ chunk = -1;
++
++ if (attempts > 1) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("**>> yaffs write required %d attempts" TENDSTR),
++ attempts));
++
++ dev->nRetriedWrites += (attempts - 1);
++ }
++
++ return chunk;
++}
++
++/*
++ * Block retiring for handling a broken block.
++ */
++
++static void yaffs_RetireBlock(yaffs_Device *dev, int blockInNAND)
++{
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, blockInNAND);
++
++ yaffs_InvalidateCheckpoint(dev);
++
++ if (yaffs_MarkBlockBad(dev, blockInNAND) != YAFFS_OK) {
++ if (yaffs_EraseBlockInNAND(dev, blockInNAND) != YAFFS_OK) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR(
++ "yaffs: Failed to mark bad and erase block %d"
++ TENDSTR), blockInNAND));
++ } else {
++ yaffs_ExtendedTags tags;
++ int chunkId = blockInNAND * dev->nChunksPerBlock;
++
++ __u8 *buffer = yaffs_GetTempBuffer(dev, __LINE__);
++
++ memset(buffer, 0xff, dev->nDataBytesPerChunk);
++ yaffs_InitialiseTags(&tags);
++ tags.sequenceNumber = YAFFS_SEQUENCE_BAD_BLOCK;
++ if (dev->writeChunkWithTagsToNAND(dev, chunkId -
++ dev->chunkOffset, buffer, &tags) != YAFFS_OK)
++ T(YAFFS_TRACE_ALWAYS, (TSTR("yaffs: Failed to "
++ TCONT("write bad block marker to block %d")
++ TENDSTR), blockInNAND));
++
++ yaffs_ReleaseTempBuffer(dev, buffer, __LINE__);
++ }
++ }
++
++ bi->blockState = YAFFS_BLOCK_STATE_DEAD;
++ bi->gcPrioritise = 0;
++ bi->needsRetiring = 0;
++
++ dev->nRetiredBlocks++;
++}
++
++/*
++ * Functions for robustisizing TODO
++ *
++ */
++
++static void yaffs_HandleWriteChunkOk(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data,
++ const yaffs_ExtendedTags *tags)
++{
++}
++
++static void yaffs_HandleUpdateChunk(yaffs_Device *dev, int chunkInNAND,
++ const yaffs_ExtendedTags *tags)
++{
++}
++
++void yaffs_HandleChunkError(yaffs_Device *dev, yaffs_BlockInfo *bi)
++{
++ if (!bi->gcPrioritise) {
++ bi->gcPrioritise = 1;
++ dev->hasPendingPrioritisedGCs = 1;
++ bi->chunkErrorStrikes++;
++
++ if (bi->chunkErrorStrikes > 3) {
++ bi->needsRetiring = 1; /* Too many stikes, so retire this */
++ T(YAFFS_TRACE_ALWAYS, (TSTR("yaffs: Block struck out" TENDSTR)));
++
++ }
++ }
++}
++
++static void yaffs_HandleWriteChunkError(yaffs_Device *dev, int chunkInNAND,
++ int erasedOk)
++{
++ int blockInNAND = chunkInNAND / dev->nChunksPerBlock;
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, blockInNAND);
++
++ yaffs_HandleChunkError(dev, bi);
++
++ if (erasedOk) {
++ /* Was an actual write failure, so mark the block for retirement */
++ bi->needsRetiring = 1;
++ T(YAFFS_TRACE_ERROR | YAFFS_TRACE_BAD_BLOCKS,
++ (TSTR("**>> Block %d needs retiring" TENDSTR), blockInNAND));
++ }
++
++ /* Delete the chunk */
++ yaffs_DeleteChunk(dev, chunkInNAND, 1, __LINE__);
++}
++
++
++/*---------------- Name handling functions ------------*/
++
++static __u16 yaffs_CalcNameSum(const YCHAR *name)
++{
++ __u16 sum = 0;
++ __u16 i = 1;
++
++ const YUCHAR *bname = (const YUCHAR *) name;
++ if (bname) {
++ while ((*bname) && (i < (YAFFS_MAX_NAME_LENGTH/2))) {
++
++#ifdef CONFIG_YAFFS_CASE_INSENSITIVE
++ sum += yaffs_toupper(*bname) * i;
++#else
++ sum += (*bname) * i;
++#endif
++ i++;
++ bname++;
++ }
++ }
++ return sum;
++}
++
++static void yaffs_SetObjectName(yaffs_Object *obj, const YCHAR *name)
++{
++#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM
++ memset(obj->shortName, 0, sizeof(YCHAR) * (YAFFS_SHORT_NAME_LENGTH+1));
++ if (name && yaffs_strlen(name) <= YAFFS_SHORT_NAME_LENGTH)
++ yaffs_strcpy(obj->shortName, name);
++ else
++ obj->shortName[0] = _Y('\0');
++#endif
++ obj->sum = yaffs_CalcNameSum(name);
++}
++
++/*-------------------- TNODES -------------------
++
++ * List of spare tnodes
++ * The list is hooked together using the first pointer
++ * in the tnode.
++ */
++
++/* yaffs_CreateTnodes creates a bunch more tnodes and
++ * adds them to the tnode free list.
++ * Don't use this function directly
++ */
++
++static int yaffs_CreateTnodes(yaffs_Device *dev, int nTnodes)
++{
++ int i;
++ int tnodeSize;
++ yaffs_Tnode *newTnodes;
++ __u8 *mem;
++ yaffs_Tnode *curr;
++ yaffs_Tnode *next;
++ yaffs_TnodeList *tnl;
++
++ if (nTnodes < 1)
++ return YAFFS_OK;
++
++ /* Calculate the tnode size in bytes for variable width tnode support.
++ * Must be a multiple of 32-bits */
++ tnodeSize = (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8;
++
++ if (tnodeSize < sizeof(yaffs_Tnode))
++ tnodeSize = sizeof(yaffs_Tnode);
++
++ /* make these things */
++
++ newTnodes = YMALLOC(nTnodes * tnodeSize);
++ mem = (__u8 *)newTnodes;
++
++ if (!newTnodes) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("yaffs: Could not allocate Tnodes" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ /* Hook them into the free list */
++#if 0
++ for (i = 0; i < nTnodes - 1; i++) {
++ newTnodes[i].internal[0] = &newTnodes[i + 1];
++#ifdef CONFIG_YAFFS_TNODE_LIST_DEBUG
++ newTnodes[i].internal[YAFFS_NTNODES_INTERNAL] = (void *)1;
++#endif
++ }
++
++ newTnodes[nTnodes - 1].internal[0] = dev->freeTnodes;
++#ifdef CONFIG_YAFFS_TNODE_LIST_DEBUG
++ newTnodes[nTnodes - 1].internal[YAFFS_NTNODES_INTERNAL] = (void *)1;
++#endif
++ dev->freeTnodes = newTnodes;
++#else
++ /* New hookup for wide tnodes */
++ for (i = 0; i < nTnodes - 1; i++) {
++ curr = (yaffs_Tnode *) &mem[i * tnodeSize];
++ next = (yaffs_Tnode *) &mem[(i+1) * tnodeSize];
++ curr->internal[0] = next;
++ }
++
++ curr = (yaffs_Tnode *) &mem[(nTnodes - 1) * tnodeSize];
++ curr->internal[0] = dev->freeTnodes;
++ dev->freeTnodes = (yaffs_Tnode *)mem;
++
++#endif
++
++
++ dev->nFreeTnodes += nTnodes;
++ dev->nTnodesCreated += nTnodes;
++
++ /* Now add this bunch of tnodes to a list for freeing up.
++ * NB If we can't add this to the management list it isn't fatal
++ * but it just means we can't free this bunch of tnodes later.
++ */
++
++ tnl = YMALLOC(sizeof(yaffs_TnodeList));
++ if (!tnl) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("yaffs: Could not add tnodes to management list" TENDSTR)));
++ return YAFFS_FAIL;
++ } else {
++ tnl->tnodes = newTnodes;
++ tnl->next = dev->allocatedTnodeList;
++ dev->allocatedTnodeList = tnl;
++ }
++
++ T(YAFFS_TRACE_ALLOCATE, (TSTR("yaffs: Tnodes added" TENDSTR)));
++
++ return YAFFS_OK;
++}
++
++/* GetTnode gets us a clean tnode. Tries to make allocate more if we run out */
++
++static yaffs_Tnode *yaffs_GetTnodeRaw(yaffs_Device *dev)
++{
++ yaffs_Tnode *tn = NULL;
++
++ /* If there are none left make more */
++ if (!dev->freeTnodes)
++ yaffs_CreateTnodes(dev, YAFFS_ALLOCATION_NTNODES);
++
++ if (dev->freeTnodes) {
++ tn = dev->freeTnodes;
++#ifdef CONFIG_YAFFS_TNODE_LIST_DEBUG
++ if (tn->internal[YAFFS_NTNODES_INTERNAL] != (void *)1) {
++ /* Hoosterman, this thing looks like it isn't in the list */
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs: Tnode list bug 1" TENDSTR)));
++ }
++#endif
++ dev->freeTnodes = dev->freeTnodes->internal[0];
++ dev->nFreeTnodes--;
++ }
++
++ dev->nCheckpointBlocksRequired = 0; /* force recalculation*/
++
++ return tn;
++}
++
++static yaffs_Tnode *yaffs_GetTnode(yaffs_Device *dev)
++{
++ yaffs_Tnode *tn = yaffs_GetTnodeRaw(dev);
++ int tnodeSize = (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8;
++
++ if (tnodeSize < sizeof(yaffs_Tnode))
++ tnodeSize = sizeof(yaffs_Tnode);
++
++ if (tn)
++ memset(tn, 0, tnodeSize);
++
++ return tn;
++}
++
++/* FreeTnode frees up a tnode and puts it back on the free list */
++static void yaffs_FreeTnode(yaffs_Device *dev, yaffs_Tnode *tn)
++{
++ if (tn) {
++#ifdef CONFIG_YAFFS_TNODE_LIST_DEBUG
++ if (tn->internal[YAFFS_NTNODES_INTERNAL] != 0) {
++ /* Hoosterman, this thing looks like it is already in the list */
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs: Tnode list bug 2" TENDSTR)));
++ }
++ tn->internal[YAFFS_NTNODES_INTERNAL] = (void *)1;
++#endif
++ tn->internal[0] = dev->freeTnodes;
++ dev->freeTnodes = tn;
++ dev->nFreeTnodes++;
++ }
++ dev->nCheckpointBlocksRequired = 0; /* force recalculation*/
++}
++
++static void yaffs_DeinitialiseTnodes(yaffs_Device *dev)
++{
++ /* Free the list of allocated tnodes */
++ yaffs_TnodeList *tmp;
++
++ while (dev->allocatedTnodeList) {
++ tmp = dev->allocatedTnodeList->next;
++
++ YFREE(dev->allocatedTnodeList->tnodes);
++ YFREE(dev->allocatedTnodeList);
++ dev->allocatedTnodeList = tmp;
++
++ }
++
++ dev->freeTnodes = NULL;
++ dev->nFreeTnodes = 0;
++}
++
++static void yaffs_InitialiseTnodes(yaffs_Device *dev)
++{
++ dev->allocatedTnodeList = NULL;
++ dev->freeTnodes = NULL;
++ dev->nFreeTnodes = 0;
++ dev->nTnodesCreated = 0;
++}
++
++
++void yaffs_PutLevel0Tnode(yaffs_Device *dev, yaffs_Tnode *tn, unsigned pos,
++ unsigned val)
++{
++ __u32 *map = (__u32 *)tn;
++ __u32 bitInMap;
++ __u32 bitInWord;
++ __u32 wordInMap;
++ __u32 mask;
++
++ pos &= YAFFS_TNODES_LEVEL0_MASK;
++ val >>= dev->chunkGroupBits;
++
++ bitInMap = pos * dev->tnodeWidth;
++ wordInMap = bitInMap / 32;
++ bitInWord = bitInMap & (32 - 1);
++
++ mask = dev->tnodeMask << bitInWord;
++
++ map[wordInMap] &= ~mask;
++ map[wordInMap] |= (mask & (val << bitInWord));
++
++ if (dev->tnodeWidth > (32 - bitInWord)) {
++ bitInWord = (32 - bitInWord);
++ wordInMap++;;
++ mask = dev->tnodeMask >> (/*dev->tnodeWidth -*/ bitInWord);
++ map[wordInMap] &= ~mask;
++ map[wordInMap] |= (mask & (val >> bitInWord));
++ }
++}
++
++static __u32 yaffs_GetChunkGroupBase(yaffs_Device *dev, yaffs_Tnode *tn,
++ unsigned pos)
++{
++ __u32 *map = (__u32 *)tn;
++ __u32 bitInMap;
++ __u32 bitInWord;
++ __u32 wordInMap;
++ __u32 val;
++
++ pos &= YAFFS_TNODES_LEVEL0_MASK;
++
++ bitInMap = pos * dev->tnodeWidth;
++ wordInMap = bitInMap / 32;
++ bitInWord = bitInMap & (32 - 1);
++
++ val = map[wordInMap] >> bitInWord;
++
++ if (dev->tnodeWidth > (32 - bitInWord)) {
++ bitInWord = (32 - bitInWord);
++ wordInMap++;;
++ val |= (map[wordInMap] << bitInWord);
++ }
++
++ val &= dev->tnodeMask;
++ val <<= dev->chunkGroupBits;
++
++ return val;
++}
++
++/* ------------------- End of individual tnode manipulation -----------------*/
++
++/* ---------Functions to manipulate the look-up tree (made up of tnodes) ------
++ * The look up tree is represented by the top tnode and the number of topLevel
++ * in the tree. 0 means only the level 0 tnode is in the tree.
++ */
++
++/* FindLevel0Tnode finds the level 0 tnode, if one exists. */
++static yaffs_Tnode *yaffs_FindLevel0Tnode(yaffs_Device *dev,
++ yaffs_FileStructure *fStruct,
++ __u32 chunkId)
++{
++ yaffs_Tnode *tn = fStruct->top;
++ __u32 i;
++ int requiredTallness;
++ int level = fStruct->topLevel;
++
++ /* Check sane level and chunk Id */
++ if (level < 0 || level > YAFFS_TNODES_MAX_LEVEL)
++ return NULL;
++
++ if (chunkId > YAFFS_MAX_CHUNK_ID)
++ return NULL;
++
++ /* First check we're tall enough (ie enough topLevel) */
++
++ i = chunkId >> YAFFS_TNODES_LEVEL0_BITS;
++ requiredTallness = 0;
++ while (i) {
++ i >>= YAFFS_TNODES_INTERNAL_BITS;
++ requiredTallness++;
++ }
++
++ if (requiredTallness > fStruct->topLevel)
++ return NULL; /* Not tall enough, so we can't find it */
++
++ /* Traverse down to level 0 */
++ while (level > 0 && tn) {
++ tn = tn->internal[(chunkId >>
++ (YAFFS_TNODES_LEVEL0_BITS +
++ (level - 1) *
++ YAFFS_TNODES_INTERNAL_BITS)) &
++ YAFFS_TNODES_INTERNAL_MASK];
++ level--;
++ }
++
++ return tn;
++}
++
++/* AddOrFindLevel0Tnode finds the level 0 tnode if it exists, otherwise first expands the tree.
++ * This happens in two steps:
++ * 1. If the tree isn't tall enough, then make it taller.
++ * 2. Scan down the tree towards the level 0 tnode adding tnodes if required.
++ *
++ * Used when modifying the tree.
++ *
++ * If the tn argument is NULL, then a fresh tnode will be added otherwise the specified tn will
++ * be plugged into the ttree.
++ */
++
++static yaffs_Tnode *yaffs_AddOrFindLevel0Tnode(yaffs_Device *dev,
++ yaffs_FileStructure *fStruct,
++ __u32 chunkId,
++ yaffs_Tnode *passedTn)
++{
++ int requiredTallness;
++ int i;
++ int l;
++ yaffs_Tnode *tn;
++
++ __u32 x;
++
++
++ /* Check sane level and page Id */
++ if (fStruct->topLevel < 0 || fStruct->topLevel > YAFFS_TNODES_MAX_LEVEL)
++ return NULL;
++
++ if (chunkId > YAFFS_MAX_CHUNK_ID)
++ return NULL;
++
++ /* First check we're tall enough (ie enough topLevel) */
++
++ x = chunkId >> YAFFS_TNODES_LEVEL0_BITS;
++ requiredTallness = 0;
++ while (x) {
++ x >>= YAFFS_TNODES_INTERNAL_BITS;
++ requiredTallness++;
++ }
++
++
++ if (requiredTallness > fStruct->topLevel) {
++ /* Not tall enough, gotta make the tree taller */
++ for (i = fStruct->topLevel; i < requiredTallness; i++) {
++
++ tn = yaffs_GetTnode(dev);
++
++ if (tn) {
++ tn->internal[0] = fStruct->top;
++ fStruct->top = tn;
++ } else {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("yaffs: no more tnodes" TENDSTR)));
++ }
++ }
++
++ fStruct->topLevel = requiredTallness;
++ }
++
++ /* Traverse down to level 0, adding anything we need */
++
++ l = fStruct->topLevel;
++ tn = fStruct->top;
++
++ if (l > 0) {
++ while (l > 0 && tn) {
++ x = (chunkId >>
++ (YAFFS_TNODES_LEVEL0_BITS +
++ (l - 1) * YAFFS_TNODES_INTERNAL_BITS)) &
++ YAFFS_TNODES_INTERNAL_MASK;
++
++
++ if ((l > 1) && !tn->internal[x]) {
++ /* Add missing non-level-zero tnode */
++ tn->internal[x] = yaffs_GetTnode(dev);
++
++ } else if (l == 1) {
++ /* Looking from level 1 at level 0 */
++ if (passedTn) {
++ /* If we already have one, then release it.*/
++ if (tn->internal[x])
++ yaffs_FreeTnode(dev, tn->internal[x]);
++ tn->internal[x] = passedTn;
++
++ } else if (!tn->internal[x]) {
++ /* Don't have one, none passed in */
++ tn->internal[x] = yaffs_GetTnode(dev);
++ }
++ }
++
++ tn = tn->internal[x];
++ l--;
++ }
++ } else {
++ /* top is level 0 */
++ if (passedTn) {
++ memcpy(tn, passedTn, (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8);
++ yaffs_FreeTnode(dev, passedTn);
++ }
++ }
++
++ return tn;
++}
++
++static int yaffs_FindChunkInGroup(yaffs_Device *dev, int theChunk,
++ yaffs_ExtendedTags *tags, int objectId,
++ int chunkInInode)
++{
++ int j;
++
++ for (j = 0; theChunk && j < dev->chunkGroupSize; j++) {
++ if (yaffs_CheckChunkBit(dev, theChunk / dev->nChunksPerBlock,
++ theChunk % dev->nChunksPerBlock)) {
++ yaffs_ReadChunkWithTagsFromNAND(dev, theChunk, NULL,
++ tags);
++ if (yaffs_TagsMatch(tags, objectId, chunkInInode)) {
++ /* found it; */
++ return theChunk;
++ }
++ }
++ theChunk++;
++ }
++ return -1;
++}
++
++
++/* DeleteWorker scans backwards through the tnode tree and deletes all the
++ * chunks and tnodes in the file
++ * Returns 1 if the tree was deleted.
++ * Returns 0 if it stopped early due to hitting the limit and the delete is incomplete.
++ */
++
++static int yaffs_DeleteWorker(yaffs_Object *in, yaffs_Tnode *tn, __u32 level,
++ int chunkOffset, int *limit)
++{
++ int i;
++ int chunkInInode;
++ int theChunk;
++ yaffs_ExtendedTags tags;
++ int foundChunk;
++ yaffs_Device *dev = in->myDev;
++
++ int allDone = 1;
++
++ if (tn) {
++ if (level > 0) {
++ for (i = YAFFS_NTNODES_INTERNAL - 1; allDone && i >= 0;
++ i--) {
++ if (tn->internal[i]) {
++ if (limit && (*limit) < 0) {
++ allDone = 0;
++ } else {
++ allDone =
++ yaffs_DeleteWorker(in,
++ tn->
++ internal
++ [i],
++ level -
++ 1,
++ (chunkOffset
++ <<
++ YAFFS_TNODES_INTERNAL_BITS)
++ + i,
++ limit);
++ }
++ if (allDone) {
++ yaffs_FreeTnode(dev,
++ tn->
++ internal[i]);
++ tn->internal[i] = NULL;
++ }
++ }
++ }
++ return (allDone) ? 1 : 0;
++ } else if (level == 0) {
++ int hitLimit = 0;
++
++ for (i = YAFFS_NTNODES_LEVEL0 - 1; i >= 0 && !hitLimit;
++ i--) {
++ theChunk = yaffs_GetChunkGroupBase(dev, tn, i);
++ if (theChunk) {
++
++ chunkInInode = (chunkOffset <<
++ YAFFS_TNODES_LEVEL0_BITS) + i;
++
++ foundChunk =
++ yaffs_FindChunkInGroup(dev,
++ theChunk,
++ &tags,
++ in->objectId,
++ chunkInInode);
++
++ if (foundChunk > 0) {
++ yaffs_DeleteChunk(dev,
++ foundChunk, 1,
++ __LINE__);
++ in->nDataChunks--;
++ if (limit) {
++ *limit = *limit - 1;
++ if (*limit <= 0)
++ hitLimit = 1;
++ }
++
++ }
++
++ yaffs_PutLevel0Tnode(dev, tn, i, 0);
++ }
++
++ }
++ return (i < 0) ? 1 : 0;
++
++ }
++
++ }
++
++ return 1;
++
++}
++
++static void yaffs_SoftDeleteChunk(yaffs_Device *dev, int chunk)
++{
++ yaffs_BlockInfo *theBlock;
++
++ T(YAFFS_TRACE_DELETION, (TSTR("soft delete chunk %d" TENDSTR), chunk));
++
++ theBlock = yaffs_GetBlockInfo(dev, chunk / dev->nChunksPerBlock);
++ if (theBlock) {
++ theBlock->softDeletions++;
++ dev->nFreeChunks++;
++ }
++}
++
++/* SoftDeleteWorker scans backwards through the tnode tree and soft deletes all the chunks in the file.
++ * All soft deleting does is increment the block's softdelete count and pulls the chunk out
++ * of the tnode.
++ * Thus, essentially this is the same as DeleteWorker except that the chunks are soft deleted.
++ */
++
++static int yaffs_SoftDeleteWorker(yaffs_Object *in, yaffs_Tnode *tn,
++ __u32 level, int chunkOffset)
++{
++ int i;
++ int theChunk;
++ int allDone = 1;
++ yaffs_Device *dev = in->myDev;
++
++ if (tn) {
++ if (level > 0) {
++
++ for (i = YAFFS_NTNODES_INTERNAL - 1; allDone && i >= 0;
++ i--) {
++ if (tn->internal[i]) {
++ allDone =
++ yaffs_SoftDeleteWorker(in,
++ tn->
++ internal[i],
++ level - 1,
++ (chunkOffset
++ <<
++ YAFFS_TNODES_INTERNAL_BITS)
++ + i);
++ if (allDone) {
++ yaffs_FreeTnode(dev,
++ tn->
++ internal[i]);
++ tn->internal[i] = NULL;
++ } else {
++ /* Hoosterman... how could this happen? */
++ }
++ }
++ }
++ return (allDone) ? 1 : 0;
++ } else if (level == 0) {
++
++ for (i = YAFFS_NTNODES_LEVEL0 - 1; i >= 0; i--) {
++ theChunk = yaffs_GetChunkGroupBase(dev, tn, i);
++ if (theChunk) {
++ /* Note this does not find the real chunk, only the chunk group.
++ * We make an assumption that a chunk group is not larger than
++ * a block.
++ */
++ yaffs_SoftDeleteChunk(dev, theChunk);
++ yaffs_PutLevel0Tnode(dev, tn, i, 0);
++ }
++
++ }
++ return 1;
++
++ }
++
++ }
++
++ return 1;
++
++}
++
++static void yaffs_SoftDeleteFile(yaffs_Object *obj)
++{
++ if (obj->deleted &&
++ obj->variantType == YAFFS_OBJECT_TYPE_FILE && !obj->softDeleted) {
++ if (obj->nDataChunks <= 0) {
++ /* Empty file with no duplicate object headers, just delete it immediately */
++ yaffs_FreeTnode(obj->myDev,
++ obj->variant.fileVariant.top);
++ obj->variant.fileVariant.top = NULL;
++ T(YAFFS_TRACE_TRACING,
++ (TSTR("yaffs: Deleting empty file %d" TENDSTR),
++ obj->objectId));
++ yaffs_DoGenericObjectDeletion(obj);
++ } else {
++ yaffs_SoftDeleteWorker(obj,
++ obj->variant.fileVariant.top,
++ obj->variant.fileVariant.
++ topLevel, 0);
++ obj->softDeleted = 1;
++ }
++ }
++}
++
++/* Pruning removes any part of the file structure tree that is beyond the
++ * bounds of the file (ie that does not point to chunks).
++ *
++ * A file should only get pruned when its size is reduced.
++ *
++ * Before pruning, the chunks must be pulled from the tree and the
++ * level 0 tnode entries must be zeroed out.
++ * Could also use this for file deletion, but that's probably better handled
++ * by a special case.
++ */
++
++static yaffs_Tnode *yaffs_PruneWorker(yaffs_Device *dev, yaffs_Tnode *tn,
++ __u32 level, int del0)
++{
++ int i;
++ int hasData;
++
++ if (tn) {
++ hasData = 0;
++
++ for (i = 0; i < YAFFS_NTNODES_INTERNAL; i++) {
++ if (tn->internal[i] && level > 0) {
++ tn->internal[i] =
++ yaffs_PruneWorker(dev, tn->internal[i],
++ level - 1,
++ (i == 0) ? del0 : 1);
++ }
++
++ if (tn->internal[i])
++ hasData++;
++ }
++
++ if (hasData == 0 && del0) {
++ /* Free and return NULL */
++
++ yaffs_FreeTnode(dev, tn);
++ tn = NULL;
++ }
++
++ }
++
++ return tn;
++
++}
++
++static int yaffs_PruneFileStructure(yaffs_Device *dev,
++ yaffs_FileStructure *fStruct)
++{
++ int i;
++ int hasData;
++ int done = 0;
++ yaffs_Tnode *tn;
++
++ if (fStruct->topLevel > 0) {
++ fStruct->top =
++ yaffs_PruneWorker(dev, fStruct->top, fStruct->topLevel, 0);
++
++ /* Now we have a tree with all the non-zero branches NULL but the height
++ * is the same as it was.
++ * Let's see if we can trim internal tnodes to shorten the tree.
++ * We can do this if only the 0th element in the tnode is in use
++ * (ie all the non-zero are NULL)
++ */
++
++ while (fStruct->topLevel && !done) {
++ tn = fStruct->top;
++
++ hasData = 0;
++ for (i = 1; i < YAFFS_NTNODES_INTERNAL; i++) {
++ if (tn->internal[i])
++ hasData++;
++ }
++
++ if (!hasData) {
++ fStruct->top = tn->internal[0];
++ fStruct->topLevel--;
++ yaffs_FreeTnode(dev, tn);
++ } else {
++ done = 1;
++ }
++ }
++ }
++
++ return YAFFS_OK;
++}
++
++/*-------------------- End of File Structure functions.-------------------*/
++
++/* yaffs_CreateFreeObjects creates a bunch more objects and
++ * adds them to the object free list.
++ */
++static int yaffs_CreateFreeObjects(yaffs_Device *dev, int nObjects)
++{
++ int i;
++ yaffs_Object *newObjects;
++ yaffs_ObjectList *list;
++
++ if (nObjects < 1)
++ return YAFFS_OK;
++
++ /* make these things */
++ newObjects = YMALLOC(nObjects * sizeof(yaffs_Object));
++ list = YMALLOC(sizeof(yaffs_ObjectList));
++
++ if (!newObjects || !list) {
++ if (newObjects)
++ YFREE(newObjects);
++ if (list)
++ YFREE(list);
++ T(YAFFS_TRACE_ALLOCATE,
++ (TSTR("yaffs: Could not allocate more objects" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ /* Hook them into the free list */
++ for (i = 0; i < nObjects - 1; i++) {
++ newObjects[i].siblings.next =
++ (struct ylist_head *)(&newObjects[i + 1]);
++ }
++
++ newObjects[nObjects - 1].siblings.next = (void *)dev->freeObjects;
++ dev->freeObjects = newObjects;
++ dev->nFreeObjects += nObjects;
++ dev->nObjectsCreated += nObjects;
++
++ /* Now add this bunch of Objects to a list for freeing up. */
++
++ list->objects = newObjects;
++ list->next = dev->allocatedObjectList;
++ dev->allocatedObjectList = list;
++
++ return YAFFS_OK;
++}
++
++
++/* AllocateEmptyObject gets us a clean Object. Tries to make allocate more if we run out */
++static yaffs_Object *yaffs_AllocateEmptyObject(yaffs_Device *dev)
++{
++ yaffs_Object *tn = NULL;
++
++#ifdef VALGRIND_TEST
++ tn = YMALLOC(sizeof(yaffs_Object));
++#else
++ /* If there are none left make more */
++ if (!dev->freeObjects)
++ yaffs_CreateFreeObjects(dev, YAFFS_ALLOCATION_NOBJECTS);
++
++ if (dev->freeObjects) {
++ tn = dev->freeObjects;
++ dev->freeObjects =
++ (yaffs_Object *) (dev->freeObjects->siblings.next);
++ dev->nFreeObjects--;
++ }
++#endif
++ if (tn) {
++ /* Now sweeten it up... */
++
++ memset(tn, 0, sizeof(yaffs_Object));
++ tn->beingCreated = 1;
++
++ tn->myDev = dev;
++ tn->hdrChunk = 0;
++ tn->variantType = YAFFS_OBJECT_TYPE_UNKNOWN;
++ YINIT_LIST_HEAD(&(tn->hardLinks));
++ YINIT_LIST_HEAD(&(tn->hashLink));
++ YINIT_LIST_HEAD(&tn->siblings);
++
++
++ /* Now make the directory sane */
++ if (dev->rootDir) {
++ tn->parent = dev->rootDir;
++ ylist_add(&(tn->siblings), &dev->rootDir->variant.directoryVariant.children);
++ }
++
++ /* Add it to the lost and found directory.
++ * NB Can't put root or lostNFound in lostNFound so
++ * check if lostNFound exists first
++ */
++ if (dev->lostNFoundDir)
++ yaffs_AddObjectToDirectory(dev->lostNFoundDir, tn);
++
++ tn->beingCreated = 0;
++ }
++
++ dev->nCheckpointBlocksRequired = 0; /* force recalculation*/
++
++ return tn;
++}
++
++static yaffs_Object *yaffs_CreateFakeDirectory(yaffs_Device *dev, int number,
++ __u32 mode)
++{
++
++ yaffs_Object *obj =
++ yaffs_CreateNewObject(dev, number, YAFFS_OBJECT_TYPE_DIRECTORY);
++ if (obj) {
++ obj->fake = 1; /* it is fake so it might have no NAND presence... */
++ obj->renameAllowed = 0; /* ... and we're not allowed to rename it... */
++ obj->unlinkAllowed = 0; /* ... or unlink it */
++ obj->deleted = 0;
++ obj->unlinked = 0;
++ obj->yst_mode = mode;
++ obj->myDev = dev;
++ obj->hdrChunk = 0; /* Not a valid chunk. */
++ }
++
++ return obj;
++
++}
++
++static void yaffs_UnhashObject(yaffs_Object *tn)
++{
++ int bucket;
++ yaffs_Device *dev = tn->myDev;
++
++ /* If it is still linked into the bucket list, free from the list */
++ if (!ylist_empty(&tn->hashLink)) {
++ ylist_del_init(&tn->hashLink);
++ bucket = yaffs_HashFunction(tn->objectId);
++ dev->objectBucket[bucket].count--;
++ }
++}
++
++/* FreeObject frees up a Object and puts it back on the free list */
++static void yaffs_FreeObject(yaffs_Object *tn)
++{
++ yaffs_Device *dev = tn->myDev;
++
++#ifdef __KERNEL__
++ T(YAFFS_TRACE_OS, (TSTR("FreeObject %p inode %p"TENDSTR), tn, tn->myInode));
++#endif
++
++ if (tn->parent)
++ YBUG();
++ if (!ylist_empty(&tn->siblings))
++ YBUG();
++
++
++#ifdef __KERNEL__
++ if (tn->myInode) {
++ /* We're still hooked up to a cached inode.
++ * Don't delete now, but mark for later deletion
++ */
++ tn->deferedFree = 1;
++ return;
++ }
++#endif
++
++ yaffs_UnhashObject(tn);
++
++#ifdef VALGRIND_TEST
++ YFREE(tn);
++#else
++ /* Link into the free list. */
++ tn->siblings.next = (struct ylist_head *)(dev->freeObjects);
++ dev->freeObjects = tn;
++ dev->nFreeObjects++;
++#endif
++ dev->nCheckpointBlocksRequired = 0; /* force recalculation*/
++}
++
++#ifdef __KERNEL__
++
++void yaffs_HandleDeferedFree(yaffs_Object *obj)
++{
++ if (obj->deferedFree)
++ yaffs_FreeObject(obj);
++}
++
++#endif
++
++static void yaffs_DeinitialiseObjects(yaffs_Device *dev)
++{
++ /* Free the list of allocated Objects */
++
++ yaffs_ObjectList *tmp;
++
++ while (dev->allocatedObjectList) {
++ tmp = dev->allocatedObjectList->next;
++ YFREE(dev->allocatedObjectList->objects);
++ YFREE(dev->allocatedObjectList);
++
++ dev->allocatedObjectList = tmp;
++ }
++
++ dev->freeObjects = NULL;
++ dev->nFreeObjects = 0;
++}
++
++static void yaffs_InitialiseObjects(yaffs_Device *dev)
++{
++ int i;
++
++ dev->allocatedObjectList = NULL;
++ dev->freeObjects = NULL;
++ dev->nFreeObjects = 0;
++
++ for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
++ YINIT_LIST_HEAD(&dev->objectBucket[i].list);
++ dev->objectBucket[i].count = 0;
++ }
++}
++
++static int yaffs_FindNiceObjectBucket(yaffs_Device *dev)
++{
++ static int x;
++ int i;
++ int l = 999;
++ int lowest = 999999;
++
++ /* First let's see if we can find one that's empty. */
++
++ for (i = 0; i < 10 && lowest > 0; i++) {
++ x++;
++ x %= YAFFS_NOBJECT_BUCKETS;
++ if (dev->objectBucket[x].count < lowest) {
++ lowest = dev->objectBucket[x].count;
++ l = x;
++ }
++
++ }
++
++ /* If we didn't find an empty list, then try
++ * looking a bit further for a short one
++ */
++
++ for (i = 0; i < 10 && lowest > 3; i++) {
++ x++;
++ x %= YAFFS_NOBJECT_BUCKETS;
++ if (dev->objectBucket[x].count < lowest) {
++ lowest = dev->objectBucket[x].count;
++ l = x;
++ }
++
++ }
++
++ return l;
++}
++
++static int yaffs_CreateNewObjectNumber(yaffs_Device *dev)
++{
++ int bucket = yaffs_FindNiceObjectBucket(dev);
++
++ /* Now find an object value that has not already been taken
++ * by scanning the list.
++ */
++
++ int found = 0;
++ struct ylist_head *i;
++
++ __u32 n = (__u32) bucket;
++
++ /* yaffs_CheckObjectHashSanity(); */
++
++ while (!found) {
++ found = 1;
++ n += YAFFS_NOBJECT_BUCKETS;
++ if (1 || dev->objectBucket[bucket].count > 0) {
++ ylist_for_each(i, &dev->objectBucket[bucket].list) {
++ /* If there is already one in the list */
++ if (i && ylist_entry(i, yaffs_Object,
++ hashLink)->objectId == n) {
++ found = 0;
++ }
++ }
++ }
++ }
++
++ return n;
++}
++
++static void yaffs_HashObject(yaffs_Object *in)
++{
++ int bucket = yaffs_HashFunction(in->objectId);
++ yaffs_Device *dev = in->myDev;
++
++ ylist_add(&in->hashLink, &dev->objectBucket[bucket].list);
++ dev->objectBucket[bucket].count++;
++}
++
++yaffs_Object *yaffs_FindObjectByNumber(yaffs_Device *dev, __u32 number)
++{
++ int bucket = yaffs_HashFunction(number);
++ struct ylist_head *i;
++ yaffs_Object *in;
++
++ ylist_for_each(i, &dev->objectBucket[bucket].list) {
++ /* Look if it is in the list */
++ if (i) {
++ in = ylist_entry(i, yaffs_Object, hashLink);
++ if (in->objectId == number) {
++#ifdef __KERNEL__
++ /* Don't tell the VFS about this one if it is defered free */
++ if (in->deferedFree)
++ return NULL;
++#endif
++
++ return in;
++ }
++ }
++ }
++
++ return NULL;
++}
++
++yaffs_Object *yaffs_CreateNewObject(yaffs_Device *dev, int number,
++ yaffs_ObjectType type)
++{
++ yaffs_Object *theObject;
++ yaffs_Tnode *tn = NULL;
++
++ if (number < 0)
++ number = yaffs_CreateNewObjectNumber(dev);
++
++ theObject = yaffs_AllocateEmptyObject(dev);
++ if (!theObject)
++ return NULL;
++
++ if (type == YAFFS_OBJECT_TYPE_FILE) {
++ tn = yaffs_GetTnode(dev);
++ if (!tn) {
++ yaffs_FreeObject(theObject);
++ return NULL;
++ }
++ }
++
++ if (theObject) {
++ theObject->fake = 0;
++ theObject->renameAllowed = 1;
++ theObject->unlinkAllowed = 1;
++ theObject->objectId = number;
++ yaffs_HashObject(theObject);
++ theObject->variantType = type;
++#ifdef CONFIG_YAFFS_WINCE
++ yfsd_WinFileTimeNow(theObject->win_atime);
++ theObject->win_ctime[0] = theObject->win_mtime[0] =
++ theObject->win_atime[0];
++ theObject->win_ctime[1] = theObject->win_mtime[1] =
++ theObject->win_atime[1];
++
++#else
++
++ theObject->yst_atime = theObject->yst_mtime =
++ theObject->yst_ctime = Y_CURRENT_TIME;
++#endif
++ switch (type) {
++ case YAFFS_OBJECT_TYPE_FILE:
++ theObject->variant.fileVariant.fileSize = 0;
++ theObject->variant.fileVariant.scannedFileSize = 0;
++ theObject->variant.fileVariant.shrinkSize = 0xFFFFFFFF; /* max __u32 */
++ theObject->variant.fileVariant.topLevel = 0;
++ theObject->variant.fileVariant.top = tn;
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ YINIT_LIST_HEAD(&theObject->variant.directoryVariant.
++ children);
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ /* No action required */
++ break;
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ /* todo this should not happen */
++ break;
++ }
++ }
++
++ return theObject;
++}
++
++static yaffs_Object *yaffs_FindOrCreateObjectByNumber(yaffs_Device *dev,
++ int number,
++ yaffs_ObjectType type)
++{
++ yaffs_Object *theObject = NULL;
++
++ if (number > 0)
++ theObject = yaffs_FindObjectByNumber(dev, number);
++
++ if (!theObject)
++ theObject = yaffs_CreateNewObject(dev, number, type);
++
++ return theObject;
++
++}
++
++
++static YCHAR *yaffs_CloneString(const YCHAR *str)
++{
++ YCHAR *newStr = NULL;
++
++ if (str && *str) {
++ newStr = YMALLOC((yaffs_strlen(str) + 1) * sizeof(YCHAR));
++ if (newStr)
++ yaffs_strcpy(newStr, str);
++ }
++
++ return newStr;
++
++}
++
++/*
++ * Mknod (create) a new object.
++ * equivalentObject only has meaning for a hard link;
++ * aliasString only has meaning for a sumlink.
++ * rdev only has meaning for devices (a subset of special objects)
++ */
++
++static yaffs_Object *yaffs_MknodObject(yaffs_ObjectType type,
++ yaffs_Object *parent,
++ const YCHAR *name,
++ __u32 mode,
++ __u32 uid,
++ __u32 gid,
++ yaffs_Object *equivalentObject,
++ const YCHAR *aliasString, __u32 rdev)
++{
++ yaffs_Object *in;
++ YCHAR *str = NULL;
++
++ yaffs_Device *dev = parent->myDev;
++
++ /* Check if the entry exists. If it does then fail the call since we don't want a dup.*/
++ if (yaffs_FindObjectByName(parent, name))
++ return NULL;
++
++ in = yaffs_CreateNewObject(dev, -1, type);
++
++ if (!in)
++ return YAFFS_FAIL;
++
++ if (type == YAFFS_OBJECT_TYPE_SYMLINK) {
++ str = yaffs_CloneString(aliasString);
++ if (!str) {
++ yaffs_FreeObject(in);
++ return NULL;
++ }
++ }
++
++
++
++ if (in) {
++ in->hdrChunk = 0;
++ in->valid = 1;
++ in->variantType = type;
++
++ in->yst_mode = mode;
++
++#ifdef CONFIG_YAFFS_WINCE
++ yfsd_WinFileTimeNow(in->win_atime);
++ in->win_ctime[0] = in->win_mtime[0] = in->win_atime[0];
++ in->win_ctime[1] = in->win_mtime[1] = in->win_atime[1];
++
++#else
++ in->yst_atime = in->yst_mtime = in->yst_ctime = Y_CURRENT_TIME;
++
++ in->yst_rdev = rdev;
++ in->yst_uid = uid;
++ in->yst_gid = gid;
++#endif
++ in->nDataChunks = 0;
++
++ yaffs_SetObjectName(in, name);
++ in->dirty = 1;
++
++ yaffs_AddObjectToDirectory(parent, in);
++
++ in->myDev = parent->myDev;
++
++ switch (type) {
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ in->variant.symLinkVariant.alias = str;
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ in->variant.hardLinkVariant.equivalentObject =
++ equivalentObject;
++ in->variant.hardLinkVariant.equivalentObjectId =
++ equivalentObject->objectId;
++ ylist_add(&in->hardLinks, &equivalentObject->hardLinks);
++ break;
++ case YAFFS_OBJECT_TYPE_FILE:
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ /* do nothing */
++ break;
++ }
++
++ if (yaffs_UpdateObjectHeader(in, name, 0, 0, 0) < 0) {
++ /* Could not create the object header, fail the creation */
++ yaffs_DeleteObject(in);
++ in = NULL;
++ }
++
++ }
++
++ return in;
++}
++
++yaffs_Object *yaffs_MknodFile(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid)
++{
++ return yaffs_MknodObject(YAFFS_OBJECT_TYPE_FILE, parent, name, mode,
++ uid, gid, NULL, NULL, 0);
++}
++
++yaffs_Object *yaffs_MknodDirectory(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid)
++{
++ return yaffs_MknodObject(YAFFS_OBJECT_TYPE_DIRECTORY, parent, name,
++ mode, uid, gid, NULL, NULL, 0);
++}
++
++yaffs_Object *yaffs_MknodSpecial(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid, __u32 rdev)
++{
++ return yaffs_MknodObject(YAFFS_OBJECT_TYPE_SPECIAL, parent, name, mode,
++ uid, gid, NULL, NULL, rdev);
++}
++
++yaffs_Object *yaffs_MknodSymLink(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid,
++ const YCHAR *alias)
++{
++ return yaffs_MknodObject(YAFFS_OBJECT_TYPE_SYMLINK, parent, name, mode,
++ uid, gid, NULL, alias, 0);
++}
++
++/* yaffs_Link returns the object id of the equivalent object.*/
++yaffs_Object *yaffs_Link(yaffs_Object *parent, const YCHAR *name,
++ yaffs_Object *equivalentObject)
++{
++ /* Get the real object in case we were fed a hard link as an equivalent object */
++ equivalentObject = yaffs_GetEquivalentObject(equivalentObject);
++
++ if (yaffs_MknodObject
++ (YAFFS_OBJECT_TYPE_HARDLINK, parent, name, 0, 0, 0,
++ equivalentObject, NULL, 0)) {
++ return equivalentObject;
++ } else {
++ return NULL;
++ }
++
++}
++
++static int yaffs_ChangeObjectName(yaffs_Object *obj, yaffs_Object *newDir,
++ const YCHAR *newName, int force, int shadows)
++{
++ int unlinkOp;
++ int deleteOp;
++
++ yaffs_Object *existingTarget;
++
++ if (newDir == NULL)
++ newDir = obj->parent; /* use the old directory */
++
++ if (newDir->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("tragedy: yaffs_ChangeObjectName: newDir is not a directory"
++ TENDSTR)));
++ YBUG();
++ }
++
++ /* TODO: Do we need this different handling for YAFFS2 and YAFFS1?? */
++ if (obj->myDev->isYaffs2)
++ unlinkOp = (newDir == obj->myDev->unlinkedDir);
++ else
++ unlinkOp = (newDir == obj->myDev->unlinkedDir
++ && obj->variantType == YAFFS_OBJECT_TYPE_FILE);
++
++ deleteOp = (newDir == obj->myDev->deletedDir);
++
++ existingTarget = yaffs_FindObjectByName(newDir, newName);
++
++ /* If the object is a file going into the unlinked directory,
++ * then it is OK to just stuff it in since duplicate names are allowed.
++ * else only proceed if the new name does not exist and if we're putting
++ * it into a directory.
++ */
++ if ((unlinkOp ||
++ deleteOp ||
++ force ||
++ (shadows > 0) ||
++ !existingTarget) &&
++ newDir->variantType == YAFFS_OBJECT_TYPE_DIRECTORY) {
++ yaffs_SetObjectName(obj, newName);
++ obj->dirty = 1;
++
++ yaffs_AddObjectToDirectory(newDir, obj);
++
++ if (unlinkOp)
++ obj->unlinked = 1;
++
++ /* If it is a deletion then we mark it as a shrink for gc purposes. */
++ if (yaffs_UpdateObjectHeader(obj, newName, 0, deleteOp, shadows) >= 0)
++ return YAFFS_OK;
++ }
++
++ return YAFFS_FAIL;
++}
++
++int yaffs_RenameObject(yaffs_Object *oldDir, const YCHAR *oldName,
++ yaffs_Object *newDir, const YCHAR *newName)
++{
++ yaffs_Object *obj = NULL;
++ yaffs_Object *existingTarget = NULL;
++ int force = 0;
++
++
++ if (!oldDir || oldDir->variantType != YAFFS_OBJECT_TYPE_DIRECTORY)
++ YBUG();
++ if (!newDir || newDir->variantType != YAFFS_OBJECT_TYPE_DIRECTORY)
++ YBUG();
++
++#ifdef CONFIG_YAFFS_CASE_INSENSITIVE
++ /* Special case for case insemsitive systems (eg. WinCE).
++ * While look-up is case insensitive, the name isn't.
++ * Therefore we might want to change x.txt to X.txt
++ */
++ if (oldDir == newDir && yaffs_strcmp(oldName, newName) == 0)
++ force = 1;
++#endif
++
++ else if (yaffs_strlen(newName) > YAFFS_MAX_NAME_LENGTH)
++ /* ENAMETOOLONG */
++ return YAFFS_FAIL;
++
++ obj = yaffs_FindObjectByName(oldDir, oldName);
++
++ if (obj && obj->renameAllowed) {
++
++ /* Now do the handling for an existing target, if there is one */
++
++ existingTarget = yaffs_FindObjectByName(newDir, newName);
++ if (existingTarget &&
++ existingTarget->variantType == YAFFS_OBJECT_TYPE_DIRECTORY &&
++ !ylist_empty(&existingTarget->variant.directoryVariant.children)) {
++ /* There is a target that is a non-empty directory, so we fail */
++ return YAFFS_FAIL; /* EEXIST or ENOTEMPTY */
++ } else if (existingTarget && existingTarget != obj) {
++ /* Nuke the target first, using shadowing,
++ * but only if it isn't the same object
++ */
++ yaffs_ChangeObjectName(obj, newDir, newName, force,
++ existingTarget->objectId);
++ yaffs_UnlinkObject(existingTarget);
++ }
++
++ return yaffs_ChangeObjectName(obj, newDir, newName, 1, 0);
++ }
++ return YAFFS_FAIL;
++}
++
++/*------------------------- Block Management and Page Allocation ----------------*/
++
++static int yaffs_InitialiseBlocks(yaffs_Device *dev)
++{
++ int nBlocks = dev->internalEndBlock - dev->internalStartBlock + 1;
++
++ dev->blockInfo = NULL;
++ dev->chunkBits = NULL;
++
++ dev->allocationBlock = -1; /* force it to get a new one */
++
++ /* If the first allocation strategy fails, thry the alternate one */
++ dev->blockInfo = YMALLOC(nBlocks * sizeof(yaffs_BlockInfo));
++ if (!dev->blockInfo) {
++ dev->blockInfo = YMALLOC_ALT(nBlocks * sizeof(yaffs_BlockInfo));
++ dev->blockInfoAlt = 1;
++ } else
++ dev->blockInfoAlt = 0;
++
++ if (dev->blockInfo) {
++ /* Set up dynamic blockinfo stuff. */
++ dev->chunkBitmapStride = (dev->nChunksPerBlock + 7) / 8; /* round up bytes */
++ dev->chunkBits = YMALLOC(dev->chunkBitmapStride * nBlocks);
++ if (!dev->chunkBits) {
++ dev->chunkBits = YMALLOC_ALT(dev->chunkBitmapStride * nBlocks);
++ dev->chunkBitsAlt = 1;
++ } else
++ dev->chunkBitsAlt = 0;
++ }
++
++ if (dev->blockInfo && dev->chunkBits) {
++ memset(dev->blockInfo, 0, nBlocks * sizeof(yaffs_BlockInfo));
++ memset(dev->chunkBits, 0, dev->chunkBitmapStride * nBlocks);
++ return YAFFS_OK;
++ }
++
++ return YAFFS_FAIL;
++}
++
++static void yaffs_DeinitialiseBlocks(yaffs_Device *dev)
++{
++ if (dev->blockInfoAlt && dev->blockInfo)
++ YFREE_ALT(dev->blockInfo);
++ else if (dev->blockInfo)
++ YFREE(dev->blockInfo);
++
++ dev->blockInfoAlt = 0;
++
++ dev->blockInfo = NULL;
++
++ if (dev->chunkBitsAlt && dev->chunkBits)
++ YFREE_ALT(dev->chunkBits);
++ else if (dev->chunkBits)
++ YFREE(dev->chunkBits);
++ dev->chunkBitsAlt = 0;
++ dev->chunkBits = NULL;
++}
++
++static int yaffs_BlockNotDisqualifiedFromGC(yaffs_Device *dev,
++ yaffs_BlockInfo *bi)
++{
++ int i;
++ __u32 seq;
++ yaffs_BlockInfo *b;
++
++ if (!dev->isYaffs2)
++ return 1; /* disqualification only applies to yaffs2. */
++
++ if (!bi->hasShrinkHeader)
++ return 1; /* can gc */
++
++ /* Find the oldest dirty sequence number if we don't know it and save it
++ * so we don't have to keep recomputing it.
++ */
++ if (!dev->oldestDirtySequence) {
++ seq = dev->sequenceNumber;
++
++ for (i = dev->internalStartBlock; i <= dev->internalEndBlock;
++ i++) {
++ b = yaffs_GetBlockInfo(dev, i);
++ if (b->blockState == YAFFS_BLOCK_STATE_FULL &&
++ (b->pagesInUse - b->softDeletions) <
++ dev->nChunksPerBlock && b->sequenceNumber < seq) {
++ seq = b->sequenceNumber;
++ }
++ }
++ dev->oldestDirtySequence = seq;
++ }
++
++ /* Can't do gc of this block if there are any blocks older than this one that have
++ * discarded pages.
++ */
++ return (bi->sequenceNumber <= dev->oldestDirtySequence);
++}
++
++/* FindDiretiestBlock is used to select the dirtiest block (or close enough)
++ * for garbage collection.
++ */
++
++static int yaffs_FindBlockForGarbageCollection(yaffs_Device *dev,
++ int aggressive)
++{
++ int b = dev->currentDirtyChecker;
++
++ int i;
++ int iterations;
++ int dirtiest = -1;
++ int pagesInUse = 0;
++ int prioritised = 0;
++ yaffs_BlockInfo *bi;
++ int pendingPrioritisedExist = 0;
++
++ /* First let's see if we need to grab a prioritised block */
++ if (dev->hasPendingPrioritisedGCs) {
++ for (i = dev->internalStartBlock; i < dev->internalEndBlock && !prioritised; i++) {
++
++ bi = yaffs_GetBlockInfo(dev, i);
++ /* yaffs_VerifyBlock(dev,bi,i); */
++
++ if (bi->gcPrioritise) {
++ pendingPrioritisedExist = 1;
++ if (bi->blockState == YAFFS_BLOCK_STATE_FULL &&
++ yaffs_BlockNotDisqualifiedFromGC(dev, bi)) {
++ pagesInUse = (bi->pagesInUse - bi->softDeletions);
++ dirtiest = i;
++ prioritised = 1;
++ aggressive = 1; /* Fool the non-aggressive skip logiv below */
++ }
++ }
++ }
++
++ if (!pendingPrioritisedExist) /* None found, so we can clear this */
++ dev->hasPendingPrioritisedGCs = 0;
++ }
++
++ /* If we're doing aggressive GC then we are happy to take a less-dirty block, and
++ * search harder.
++ * else (we're doing a leasurely gc), then we only bother to do this if the
++ * block has only a few pages in use.
++ */
++
++ dev->nonAggressiveSkip--;
++
++ if (!aggressive && (dev->nonAggressiveSkip > 0))
++ return -1;
++
++ if (!prioritised)
++ pagesInUse =
++ (aggressive) ? dev->nChunksPerBlock : YAFFS_PASSIVE_GC_CHUNKS + 1;
++
++ if (aggressive)
++ iterations =
++ dev->internalEndBlock - dev->internalStartBlock + 1;
++ else {
++ iterations =
++ dev->internalEndBlock - dev->internalStartBlock + 1;
++ iterations = iterations / 16;
++ if (iterations > 200)
++ iterations = 200;
++ }
++
++ for (i = 0; i <= iterations && pagesInUse > 0 && !prioritised; i++) {
++ b++;
++ if (b < dev->internalStartBlock || b > dev->internalEndBlock)
++ b = dev->internalStartBlock;
++
++ if (b < dev->internalStartBlock || b > dev->internalEndBlock) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("**>> Block %d is not valid" TENDSTR), b));
++ YBUG();
++ }
++
++ bi = yaffs_GetBlockInfo(dev, b);
++
++ if (bi->blockState == YAFFS_BLOCK_STATE_FULL &&
++ (bi->pagesInUse - bi->softDeletions) < pagesInUse &&
++ yaffs_BlockNotDisqualifiedFromGC(dev, bi)) {
++ dirtiest = b;
++ pagesInUse = (bi->pagesInUse - bi->softDeletions);
++ }
++ }
++
++ dev->currentDirtyChecker = b;
++
++ if (dirtiest > 0) {
++ T(YAFFS_TRACE_GC,
++ (TSTR("GC Selected block %d with %d free, prioritised:%d" TENDSTR), dirtiest,
++ dev->nChunksPerBlock - pagesInUse, prioritised));
++ }
++
++ dev->oldestDirtySequence = 0;
++
++ if (dirtiest > 0)
++ dev->nonAggressiveSkip = 4;
++
++ return dirtiest;
++}
++
++static void yaffs_BlockBecameDirty(yaffs_Device *dev, int blockNo)
++{
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, blockNo);
++
++ int erasedOk = 0;
++
++ /* If the block is still healthy erase it and mark as clean.
++ * If the block has had a data failure, then retire it.
++ */
++
++ T(YAFFS_TRACE_GC | YAFFS_TRACE_ERASE,
++ (TSTR("yaffs_BlockBecameDirty block %d state %d %s"TENDSTR),
++ blockNo, bi->blockState, (bi->needsRetiring) ? "needs retiring" : ""));
++
++ bi->blockState = YAFFS_BLOCK_STATE_DIRTY;
++
++ if (!bi->needsRetiring) {
++ yaffs_InvalidateCheckpoint(dev);
++ erasedOk = yaffs_EraseBlockInNAND(dev, blockNo);
++ if (!erasedOk) {
++ dev->nErasureFailures++;
++ T(YAFFS_TRACE_ERROR | YAFFS_TRACE_BAD_BLOCKS,
++ (TSTR("**>> Erasure failed %d" TENDSTR), blockNo));
++ }
++ }
++
++ if (erasedOk &&
++ ((yaffs_traceMask & YAFFS_TRACE_ERASE) || !yaffs_SkipVerification(dev))) {
++ int i;
++ for (i = 0; i < dev->nChunksPerBlock; i++) {
++ if (!yaffs_CheckChunkErased
++ (dev, blockNo * dev->nChunksPerBlock + i)) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ (">>Block %d erasure supposedly OK, but chunk %d not erased"
++ TENDSTR), blockNo, i));
++ }
++ }
++ }
++
++ if (erasedOk) {
++ /* Clean it up... */
++ bi->blockState = YAFFS_BLOCK_STATE_EMPTY;
++ dev->nErasedBlocks++;
++ bi->pagesInUse = 0;
++ bi->softDeletions = 0;
++ bi->hasShrinkHeader = 0;
++ bi->skipErasedCheck = 1; /* This is clean, so no need to check */
++ bi->gcPrioritise = 0;
++ yaffs_ClearChunkBits(dev, blockNo);
++
++ T(YAFFS_TRACE_ERASE,
++ (TSTR("Erased block %d" TENDSTR), blockNo));
++ } else {
++ dev->nFreeChunks -= dev->nChunksPerBlock; /* We lost a block of free space */
++
++ yaffs_RetireBlock(dev, blockNo);
++ T(YAFFS_TRACE_ERROR | YAFFS_TRACE_BAD_BLOCKS,
++ (TSTR("**>> Block %d retired" TENDSTR), blockNo));
++ }
++}
++
++static int yaffs_FindBlockForAllocation(yaffs_Device *dev)
++{
++ int i;
++
++ yaffs_BlockInfo *bi;
++
++ if (dev->nErasedBlocks < 1) {
++ /* Hoosterman we've got a problem.
++ * Can't get space to gc
++ */
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("yaffs tragedy: no more erased blocks" TENDSTR)));
++
++ return -1;
++ }
++
++ /* Find an empty block. */
++
++ for (i = dev->internalStartBlock; i <= dev->internalEndBlock; i++) {
++ dev->allocationBlockFinder++;
++ if (dev->allocationBlockFinder < dev->internalStartBlock
++ || dev->allocationBlockFinder > dev->internalEndBlock) {
++ dev->allocationBlockFinder = dev->internalStartBlock;
++ }
++
++ bi = yaffs_GetBlockInfo(dev, dev->allocationBlockFinder);
++
++ if (bi->blockState == YAFFS_BLOCK_STATE_EMPTY) {
++ bi->blockState = YAFFS_BLOCK_STATE_ALLOCATING;
++ dev->sequenceNumber++;
++ bi->sequenceNumber = dev->sequenceNumber;
++ dev->nErasedBlocks--;
++ T(YAFFS_TRACE_ALLOCATE,
++ (TSTR("Allocated block %d, seq %d, %d left" TENDSTR),
++ dev->allocationBlockFinder, dev->sequenceNumber,
++ dev->nErasedBlocks));
++ return dev->allocationBlockFinder;
++ }
++ }
++
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("yaffs tragedy: no more erased blocks, but there should have been %d"
++ TENDSTR), dev->nErasedBlocks));
++
++ return -1;
++}
++
++
++
++static int yaffs_CalcCheckpointBlocksRequired(yaffs_Device *dev)
++{
++ if (!dev->nCheckpointBlocksRequired &&
++ dev->isYaffs2) {
++ /* Not a valid value so recalculate */
++ int nBytes = 0;
++ int nBlocks;
++ int devBlocks = (dev->endBlock - dev->startBlock + 1);
++ int tnodeSize;
++
++ tnodeSize = (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8;
++
++ if (tnodeSize < sizeof(yaffs_Tnode))
++ tnodeSize = sizeof(yaffs_Tnode);
++
++ nBytes += sizeof(yaffs_CheckpointValidity);
++ nBytes += sizeof(yaffs_CheckpointDevice);
++ nBytes += devBlocks * sizeof(yaffs_BlockInfo);
++ nBytes += devBlocks * dev->chunkBitmapStride;
++ nBytes += (sizeof(yaffs_CheckpointObject) + sizeof(__u32)) * (dev->nObjectsCreated - dev->nFreeObjects);
++ nBytes += (tnodeSize + sizeof(__u32)) * (dev->nTnodesCreated - dev->nFreeTnodes);
++ nBytes += sizeof(yaffs_CheckpointValidity);
++ nBytes += sizeof(__u32); /* checksum*/
++
++ /* Round up and add 2 blocks to allow for some bad blocks, so add 3 */
++
++ nBlocks = (nBytes/(dev->nDataBytesPerChunk * dev->nChunksPerBlock)) + 3;
++
++ dev->nCheckpointBlocksRequired = nBlocks;
++ }
++
++ return dev->nCheckpointBlocksRequired;
++}
++
++/*
++ * Check if there's space to allocate...
++ * Thinks.... do we need top make this ths same as yaffs_GetFreeChunks()?
++ */
++static int yaffs_CheckSpaceForAllocation(yaffs_Device *dev)
++{
++ int reservedChunks;
++ int reservedBlocks = dev->nReservedBlocks;
++ int checkpointBlocks;
++
++ if (dev->isYaffs2) {
++ checkpointBlocks = yaffs_CalcCheckpointBlocksRequired(dev) -
++ dev->blocksInCheckpoint;
++ if (checkpointBlocks < 0)
++ checkpointBlocks = 0;
++ } else {
++ checkpointBlocks = 0;
++ }
++
++ reservedChunks = ((reservedBlocks + checkpointBlocks) * dev->nChunksPerBlock);
++
++ return (dev->nFreeChunks > reservedChunks);
++}
++
++static int yaffs_AllocateChunk(yaffs_Device *dev, int useReserve,
++ yaffs_BlockInfo **blockUsedPtr)
++{
++ int retVal;
++ yaffs_BlockInfo *bi;
++
++ if (dev->allocationBlock < 0) {
++ /* Get next block to allocate off */
++ dev->allocationBlock = yaffs_FindBlockForAllocation(dev);
++ dev->allocationPage = 0;
++ }
++
++ if (!useReserve && !yaffs_CheckSpaceForAllocation(dev)) {
++ /* Not enough space to allocate unless we're allowed to use the reserve. */
++ return -1;
++ }
++
++ if (dev->nErasedBlocks < dev->nReservedBlocks
++ && dev->allocationPage == 0) {
++ T(YAFFS_TRACE_ALLOCATE, (TSTR("Allocating reserve" TENDSTR)));
++ }
++
++ /* Next page please.... */
++ if (dev->allocationBlock >= 0) {
++ bi = yaffs_GetBlockInfo(dev, dev->allocationBlock);
++
++ retVal = (dev->allocationBlock * dev->nChunksPerBlock) +
++ dev->allocationPage;
++ bi->pagesInUse++;
++ yaffs_SetChunkBit(dev, dev->allocationBlock,
++ dev->allocationPage);
++
++ dev->allocationPage++;
++
++ dev->nFreeChunks--;
++
++ /* If the block is full set the state to full */
++ if (dev->allocationPage >= dev->nChunksPerBlock) {
++ bi->blockState = YAFFS_BLOCK_STATE_FULL;
++ dev->allocationBlock = -1;
++ }
++
++ if (blockUsedPtr)
++ *blockUsedPtr = bi;
++
++ return retVal;
++ }
++
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!" TENDSTR)));
++
++ return -1;
++}
++
++static int yaffs_GetErasedChunks(yaffs_Device *dev)
++{
++ int n;
++
++ n = dev->nErasedBlocks * dev->nChunksPerBlock;
++
++ if (dev->allocationBlock > 0)
++ n += (dev->nChunksPerBlock - dev->allocationPage);
++
++ return n;
++
++}
++
++static int yaffs_GarbageCollectBlock(yaffs_Device *dev, int block,
++ int wholeBlock)
++{
++ int oldChunk;
++ int newChunk;
++ int markNAND;
++ int retVal = YAFFS_OK;
++ int cleanups = 0;
++ int i;
++ int isCheckpointBlock;
++ int matchingChunk;
++ int maxCopies;
++
++ int chunksBefore = yaffs_GetErasedChunks(dev);
++ int chunksAfter;
++
++ yaffs_ExtendedTags tags;
++
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, block);
++
++ yaffs_Object *object;
++
++ isCheckpointBlock = (bi->blockState == YAFFS_BLOCK_STATE_CHECKPOINT);
++
++ bi->blockState = YAFFS_BLOCK_STATE_COLLECTING;
++
++ T(YAFFS_TRACE_TRACING,
++ (TSTR("Collecting block %d, in use %d, shrink %d, wholeBlock %d" TENDSTR),
++ block,
++ bi->pagesInUse,
++ bi->hasShrinkHeader,
++ wholeBlock));
++
++ /*yaffs_VerifyFreeChunks(dev); */
++
++ bi->hasShrinkHeader = 0; /* clear the flag so that the block can erase */
++
++ /* Take off the number of soft deleted entries because
++ * they're going to get really deleted during GC.
++ */
++ dev->nFreeChunks -= bi->softDeletions;
++
++ dev->isDoingGC = 1;
++
++ if (isCheckpointBlock ||
++ !yaffs_StillSomeChunkBits(dev, block)) {
++ T(YAFFS_TRACE_TRACING,
++ (TSTR
++ ("Collecting block %d that has no chunks in use" TENDSTR),
++ block));
++ yaffs_BlockBecameDirty(dev, block);
++ } else {
++
++ __u8 *buffer = yaffs_GetTempBuffer(dev, __LINE__);
++
++ yaffs_VerifyBlock(dev, bi, block);
++
++ maxCopies = (wholeBlock) ? dev->nChunksPerBlock : 10;
++ oldChunk = block * dev->nChunksPerBlock + dev->gcChunk;
++
++ for (/* init already done */;
++ retVal == YAFFS_OK &&
++ dev->gcChunk < dev->nChunksPerBlock &&
++ (bi->blockState == YAFFS_BLOCK_STATE_COLLECTING) &&
++ maxCopies > 0;
++ dev->gcChunk++, oldChunk++) {
++ if (yaffs_CheckChunkBit(dev, block, dev->gcChunk)) {
++
++ /* This page is in use and might need to be copied off */
++
++ maxCopies--;
++
++ markNAND = 1;
++
++ yaffs_InitialiseTags(&tags);
++
++ yaffs_ReadChunkWithTagsFromNAND(dev, oldChunk,
++ buffer, &tags);
++
++ object =
++ yaffs_FindObjectByNumber(dev,
++ tags.objectId);
++
++ T(YAFFS_TRACE_GC_DETAIL,
++ (TSTR
++ ("Collecting chunk in block %d, %d %d %d " TENDSTR),
++ dev->gcChunk, tags.objectId, tags.chunkId,
++ tags.byteCount));
++
++ if (object && !yaffs_SkipVerification(dev)) {
++ if (tags.chunkId == 0)
++ matchingChunk = object->hdrChunk;
++ else if (object->softDeleted)
++ matchingChunk = oldChunk; /* Defeat the test */
++ else
++ matchingChunk = yaffs_FindChunkInFile(object, tags.chunkId, NULL);
++
++ if (oldChunk != matchingChunk)
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("gc: page in gc mismatch: %d %d %d %d"TENDSTR),
++ oldChunk, matchingChunk, tags.objectId, tags.chunkId));
++
++ }
++
++ if (!object) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("page %d in gc has no object: %d %d %d "
++ TENDSTR), oldChunk,
++ tags.objectId, tags.chunkId, tags.byteCount));
++ }
++
++ if (object &&
++ object->deleted &&
++ object->softDeleted &&
++ tags.chunkId != 0) {
++ /* Data chunk in a soft deleted file, throw it away
++ * It's a soft deleted data chunk,
++ * No need to copy this, just forget about it and
++ * fix up the object.
++ */
++
++ object->nDataChunks--;
++
++ if (object->nDataChunks <= 0) {
++ /* remeber to clean up the object */
++ dev->gcCleanupList[cleanups] =
++ tags.objectId;
++ cleanups++;
++ }
++ markNAND = 0;
++ } else if (0) {
++ /* Todo object && object->deleted && object->nDataChunks == 0 */
++ /* Deleted object header with no data chunks.
++ * Can be discarded and the file deleted.
++ */
++ object->hdrChunk = 0;
++ yaffs_FreeTnode(object->myDev,
++ object->variant.
++ fileVariant.top);
++ object->variant.fileVariant.top = NULL;
++ yaffs_DoGenericObjectDeletion(object);
++
++ } else if (object) {
++ /* It's either a data chunk in a live file or
++ * an ObjectHeader, so we're interested in it.
++ * NB Need to keep the ObjectHeaders of deleted files
++ * until the whole file has been deleted off
++ */
++ tags.serialNumber++;
++
++ dev->nGCCopies++;
++
++ if (tags.chunkId == 0) {
++ /* It is an object Id,
++ * We need to nuke the shrinkheader flags first
++ * We no longer want the shrinkHeader flag since its work is done
++ * and if it is left in place it will mess up scanning.
++ */
++
++ yaffs_ObjectHeader *oh;
++ oh = (yaffs_ObjectHeader *)buffer;
++ oh->isShrink = 0;
++ tags.extraIsShrinkHeader = 0;
++
++ yaffs_VerifyObjectHeader(object, oh, &tags, 1);
++ }
++
++ newChunk =
++ yaffs_WriteNewChunkWithTagsToNAND(dev, buffer, &tags, 1);
++
++ if (newChunk < 0) {
++ retVal = YAFFS_FAIL;
++ } else {
++
++ /* Ok, now fix up the Tnodes etc. */
++
++ if (tags.chunkId == 0) {
++ /* It's a header */
++ object->hdrChunk = newChunk;
++ object->serial = tags.serialNumber;
++ } else {
++ /* It's a data chunk */
++ yaffs_PutChunkIntoFile
++ (object,
++ tags.chunkId,
++ newChunk, 0);
++ }
++ }
++ }
++
++ if (retVal == YAFFS_OK)
++ yaffs_DeleteChunk(dev, oldChunk, markNAND, __LINE__);
++
++ }
++ }
++
++ yaffs_ReleaseTempBuffer(dev, buffer, __LINE__);
++
++
++ /* Do any required cleanups */
++ for (i = 0; i < cleanups; i++) {
++ /* Time to delete the file too */
++ object =
++ yaffs_FindObjectByNumber(dev,
++ dev->gcCleanupList[i]);
++ if (object) {
++ yaffs_FreeTnode(dev,
++ object->variant.fileVariant.
++ top);
++ object->variant.fileVariant.top = NULL;
++ T(YAFFS_TRACE_GC,
++ (TSTR
++ ("yaffs: About to finally delete object %d"
++ TENDSTR), object->objectId));
++ yaffs_DoGenericObjectDeletion(object);
++ object->myDev->nDeletedFiles--;
++ }
++
++ }
++
++ }
++
++ yaffs_VerifyCollectedBlock(dev, bi, block);
++
++ chunksAfter = yaffs_GetErasedChunks(dev);
++ if (chunksBefore >= chunksAfter) {
++ T(YAFFS_TRACE_GC,
++ (TSTR
++ ("gc did not increase free chunks before %d after %d"
++ TENDSTR), chunksBefore, chunksAfter));
++ }
++
++ /* If the gc completed then clear the current gcBlock so that we find another. */
++ if (bi->blockState != YAFFS_BLOCK_STATE_COLLECTING) {
++ dev->gcBlock = -1;
++ dev->gcChunk = 0;
++ }
++
++ dev->isDoingGC = 0;
++
++ return retVal;
++}
++
++/* New garbage collector
++ * If we're very low on erased blocks then we do aggressive garbage collection
++ * otherwise we do "leasurely" garbage collection.
++ * Aggressive gc looks further (whole array) and will accept less dirty blocks.
++ * Passive gc only inspects smaller areas and will only accept more dirty blocks.
++ *
++ * The idea is to help clear out space in a more spread-out manner.
++ * Dunno if it really does anything useful.
++ */
++static int yaffs_CheckGarbageCollection(yaffs_Device *dev)
++{
++ int block;
++ int aggressive;
++ int gcOk = YAFFS_OK;
++ int maxTries = 0;
++
++ int checkpointBlockAdjust;
++
++ if (dev->isDoingGC) {
++ /* Bail out so we don't get recursive gc */
++ return YAFFS_OK;
++ }
++
++ /* This loop should pass the first time.
++ * We'll only see looping here if the erase of the collected block fails.
++ */
++
++ do {
++ maxTries++;
++
++ checkpointBlockAdjust = yaffs_CalcCheckpointBlocksRequired(dev) - dev->blocksInCheckpoint;
++ if (checkpointBlockAdjust < 0)
++ checkpointBlockAdjust = 0;
++
++ if (dev->nErasedBlocks < (dev->nReservedBlocks + checkpointBlockAdjust + 2)) {
++ /* We need a block soon...*/
++ aggressive = 1;
++ } else {
++ /* We're in no hurry */
++ aggressive = 0;
++ }
++
++ if (dev->gcBlock <= 0) {
++ dev->gcBlock = yaffs_FindBlockForGarbageCollection(dev, aggressive);
++ dev->gcChunk = 0;
++ }
++
++ block = dev->gcBlock;
++
++ if (block > 0) {
++ dev->garbageCollections++;
++ if (!aggressive)
++ dev->passiveGarbageCollections++;
++
++ T(YAFFS_TRACE_GC,
++ (TSTR
++ ("yaffs: GC erasedBlocks %d aggressive %d" TENDSTR),
++ dev->nErasedBlocks, aggressive));
++
++ gcOk = yaffs_GarbageCollectBlock(dev, block, aggressive);
++ }
++
++ if (dev->nErasedBlocks < (dev->nReservedBlocks) && block > 0) {
++ T(YAFFS_TRACE_GC,
++ (TSTR
++ ("yaffs: GC !!!no reclaim!!! erasedBlocks %d after try %d block %d"
++ TENDSTR), dev->nErasedBlocks, maxTries, block));
++ }
++ } while ((dev->nErasedBlocks < dev->nReservedBlocks) &&
++ (block > 0) &&
++ (maxTries < 2));
++
++ return aggressive ? gcOk : YAFFS_OK;
++}
++
++/*------------------------- TAGS --------------------------------*/
++
++static int yaffs_TagsMatch(const yaffs_ExtendedTags *tags, int objectId,
++ int chunkInObject)
++{
++ return (tags->chunkId == chunkInObject &&
++ tags->objectId == objectId && !tags->chunkDeleted) ? 1 : 0;
++
++}
++
++
++/*-------------------- Data file manipulation -----------------*/
++
++static int yaffs_FindChunkInFile(yaffs_Object *in, int chunkInInode,
++ yaffs_ExtendedTags *tags)
++{
++ /*Get the Tnode, then get the level 0 offset chunk offset */
++ yaffs_Tnode *tn;
++ int theChunk = -1;
++ yaffs_ExtendedTags localTags;
++ int retVal = -1;
++
++ yaffs_Device *dev = in->myDev;
++
++ if (!tags) {
++ /* Passed a NULL, so use our own tags space */
++ tags = &localTags;
++ }
++
++ tn = yaffs_FindLevel0Tnode(dev, &in->variant.fileVariant, chunkInInode);
++
++ if (tn) {
++ theChunk = yaffs_GetChunkGroupBase(dev, tn, chunkInInode);
++
++ retVal =
++ yaffs_FindChunkInGroup(dev, theChunk, tags, in->objectId,
++ chunkInInode);
++ }
++ return retVal;
++}
++
++static int yaffs_FindAndDeleteChunkInFile(yaffs_Object *in, int chunkInInode,
++ yaffs_ExtendedTags *tags)
++{
++ /* Get the Tnode, then get the level 0 offset chunk offset */
++ yaffs_Tnode *tn;
++ int theChunk = -1;
++ yaffs_ExtendedTags localTags;
++
++ yaffs_Device *dev = in->myDev;
++ int retVal = -1;
++
++ if (!tags) {
++ /* Passed a NULL, so use our own tags space */
++ tags = &localTags;
++ }
++
++ tn = yaffs_FindLevel0Tnode(dev, &in->variant.fileVariant, chunkInInode);
++
++ if (tn) {
++
++ theChunk = yaffs_GetChunkGroupBase(dev, tn, chunkInInode);
++
++ retVal =
++ yaffs_FindChunkInGroup(dev, theChunk, tags, in->objectId,
++ chunkInInode);
++
++ /* Delete the entry in the filestructure (if found) */
++ if (retVal != -1)
++ yaffs_PutLevel0Tnode(dev, tn, chunkInInode, 0);
++ }
++
++ return retVal;
++}
++
++#ifdef YAFFS_PARANOID
++
++static int yaffs_CheckFileSanity(yaffs_Object *in)
++{
++ int chunk;
++ int nChunks;
++ int fSize;
++ int failed = 0;
++ int objId;
++ yaffs_Tnode *tn;
++ yaffs_Tags localTags;
++ yaffs_Tags *tags = &localTags;
++ int theChunk;
++ int chunkDeleted;
++
++ if (in->variantType != YAFFS_OBJECT_TYPE_FILE)
++ return YAFFS_FAIL;
++
++ objId = in->objectId;
++ fSize = in->variant.fileVariant.fileSize;
++ nChunks =
++ (fSize + in->myDev->nDataBytesPerChunk - 1) / in->myDev->nDataBytesPerChunk;
++
++ for (chunk = 1; chunk <= nChunks; chunk++) {
++ tn = yaffs_FindLevel0Tnode(in->myDev, &in->variant.fileVariant,
++ chunk);
++
++ if (tn) {
++
++ theChunk = yaffs_GetChunkGroupBase(dev, tn, chunk);
++
++ if (yaffs_CheckChunkBits
++ (dev, theChunk / dev->nChunksPerBlock,
++ theChunk % dev->nChunksPerBlock)) {
++
++ yaffs_ReadChunkTagsFromNAND(in->myDev, theChunk,
++ tags,
++ &chunkDeleted);
++ if (yaffs_TagsMatch
++ (tags, in->objectId, chunk, chunkDeleted)) {
++ /* found it; */
++
++ }
++ } else {
++
++ failed = 1;
++ }
++
++ } else {
++ /* T(("No level 0 found for %d\n", chunk)); */
++ }
++ }
++
++ return failed ? YAFFS_FAIL : YAFFS_OK;
++}
++
++#endif
++
++static int yaffs_PutChunkIntoFile(yaffs_Object *in, int chunkInInode,
++ int chunkInNAND, int inScan)
++{
++ /* NB inScan is zero unless scanning.
++ * For forward scanning, inScan is > 0;
++ * for backward scanning inScan is < 0
++ */
++
++ yaffs_Tnode *tn;
++ yaffs_Device *dev = in->myDev;
++ int existingChunk;
++ yaffs_ExtendedTags existingTags;
++ yaffs_ExtendedTags newTags;
++ unsigned existingSerial, newSerial;
++
++ if (in->variantType != YAFFS_OBJECT_TYPE_FILE) {
++ /* Just ignore an attempt at putting a chunk into a non-file during scanning
++ * If it is not during Scanning then something went wrong!
++ */
++ if (!inScan) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("yaffs tragedy:attempt to put data chunk into a non-file"
++ TENDSTR)));
++ YBUG();
++ }
++
++ yaffs_DeleteChunk(dev, chunkInNAND, 1, __LINE__);
++ return YAFFS_OK;
++ }
++
++ tn = yaffs_AddOrFindLevel0Tnode(dev,
++ &in->variant.fileVariant,
++ chunkInInode,
++ NULL);
++ if (!tn)
++ return YAFFS_FAIL;
++
++ existingChunk = yaffs_GetChunkGroupBase(dev, tn, chunkInInode);
++
++ if (inScan != 0) {
++ /* If we're scanning then we need to test for duplicates
++ * NB This does not need to be efficient since it should only ever
++ * happen when the power fails during a write, then only one
++ * chunk should ever be affected.
++ *
++ * Correction for YAFFS2: This could happen quite a lot and we need to think about efficiency! TODO
++ * Update: For backward scanning we don't need to re-read tags so this is quite cheap.
++ */
++
++ if (existingChunk > 0) {
++ /* NB Right now existing chunk will not be real chunkId if the device >= 32MB
++ * thus we have to do a FindChunkInFile to get the real chunk id.
++ *
++ * We have a duplicate now we need to decide which one to use:
++ *
++ * Backwards scanning YAFFS2: The old one is what we use, dump the new one.
++ * Forward scanning YAFFS2: The new one is what we use, dump the old one.
++ * YAFFS1: Get both sets of tags and compare serial numbers.
++ */
++
++ if (inScan > 0) {
++ /* Only do this for forward scanning */
++ yaffs_ReadChunkWithTagsFromNAND(dev,
++ chunkInNAND,
++ NULL, &newTags);
++
++ /* Do a proper find */
++ existingChunk =
++ yaffs_FindChunkInFile(in, chunkInInode,
++ &existingTags);
++ }
++
++ if (existingChunk <= 0) {
++ /*Hoosterman - how did this happen? */
++
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("yaffs tragedy: existing chunk < 0 in scan"
++ TENDSTR)));
++
++ }
++
++ /* NB The deleted flags should be false, otherwise the chunks will
++ * not be loaded during a scan
++ */
++
++ if (inScan > 0) {
++ newSerial = newTags.serialNumber;
++ existingSerial = existingTags.serialNumber;
++ }
++
++ if ((inScan > 0) &&
++ (in->myDev->isYaffs2 ||
++ existingChunk <= 0 ||
++ ((existingSerial + 1) & 3) == newSerial)) {
++ /* Forward scanning.
++ * Use new
++ * Delete the old one and drop through to update the tnode
++ */
++ yaffs_DeleteChunk(dev, existingChunk, 1,
++ __LINE__);
++ } else {
++ /* Backward scanning or we want to use the existing one
++ * Use existing.
++ * Delete the new one and return early so that the tnode isn't changed
++ */
++ yaffs_DeleteChunk(dev, chunkInNAND, 1,
++ __LINE__);
++ return YAFFS_OK;
++ }
++ }
++
++ }
++
++ if (existingChunk == 0)
++ in->nDataChunks++;
++
++ yaffs_PutLevel0Tnode(dev, tn, chunkInInode, chunkInNAND);
++
++ return YAFFS_OK;
++}
++
++static int yaffs_ReadChunkDataFromObject(yaffs_Object *in, int chunkInInode,
++ __u8 *buffer)
++{
++ int chunkInNAND = yaffs_FindChunkInFile(in, chunkInInode, NULL);
++
++ if (chunkInNAND >= 0)
++ return yaffs_ReadChunkWithTagsFromNAND(in->myDev, chunkInNAND,
++ buffer, NULL);
++ else {
++ T(YAFFS_TRACE_NANDACCESS,
++ (TSTR("Chunk %d not found zero instead" TENDSTR),
++ chunkInNAND));
++ /* get sane (zero) data if you read a hole */
++ memset(buffer, 0, in->myDev->nDataBytesPerChunk);
++ return 0;
++ }
++
++}
++
++void yaffs_DeleteChunk(yaffs_Device *dev, int chunkId, int markNAND, int lyn)
++{
++ int block;
++ int page;
++ yaffs_ExtendedTags tags;
++ yaffs_BlockInfo *bi;
++
++ if (chunkId <= 0)
++ return;
++
++ dev->nDeletions++;
++ block = chunkId / dev->nChunksPerBlock;
++ page = chunkId % dev->nChunksPerBlock;
++
++
++ if (!yaffs_CheckChunkBit(dev, block, page))
++ T(YAFFS_TRACE_VERIFY,
++ (TSTR("Deleting invalid chunk %d"TENDSTR),
++ chunkId));
++
++ bi = yaffs_GetBlockInfo(dev, block);
++
++ T(YAFFS_TRACE_DELETION,
++ (TSTR("line %d delete of chunk %d" TENDSTR), lyn, chunkId));
++
++ if (markNAND &&
++ bi->blockState != YAFFS_BLOCK_STATE_COLLECTING && !dev->isYaffs2) {
++
++ yaffs_InitialiseTags(&tags);
++
++ tags.chunkDeleted = 1;
++
++ yaffs_WriteChunkWithTagsToNAND(dev, chunkId, NULL, &tags);
++ yaffs_HandleUpdateChunk(dev, chunkId, &tags);
++ } else {
++ dev->nUnmarkedDeletions++;
++ }
++
++ /* Pull out of the management area.
++ * If the whole block became dirty, this will kick off an erasure.
++ */
++ if (bi->blockState == YAFFS_BLOCK_STATE_ALLOCATING ||
++ bi->blockState == YAFFS_BLOCK_STATE_FULL ||
++ bi->blockState == YAFFS_BLOCK_STATE_NEEDS_SCANNING ||
++ bi->blockState == YAFFS_BLOCK_STATE_COLLECTING) {
++ dev->nFreeChunks++;
++
++ yaffs_ClearChunkBit(dev, block, page);
++
++ bi->pagesInUse--;
++
++ if (bi->pagesInUse == 0 &&
++ !bi->hasShrinkHeader &&
++ bi->blockState != YAFFS_BLOCK_STATE_ALLOCATING &&
++ bi->blockState != YAFFS_BLOCK_STATE_NEEDS_SCANNING) {
++ yaffs_BlockBecameDirty(dev, block);
++ }
++
++ }
++
++}
++
++static int yaffs_WriteChunkDataToObject(yaffs_Object *in, int chunkInInode,
++ const __u8 *buffer, int nBytes,
++ int useReserve)
++{
++ /* Find old chunk Need to do this to get serial number
++ * Write new one and patch into tree.
++ * Invalidate old tags.
++ */
++
++ int prevChunkId;
++ yaffs_ExtendedTags prevTags;
++
++ int newChunkId;
++ yaffs_ExtendedTags newTags;
++
++ yaffs_Device *dev = in->myDev;
++
++ yaffs_CheckGarbageCollection(dev);
++
++ /* Get the previous chunk at this location in the file if it exists */
++ prevChunkId = yaffs_FindChunkInFile(in, chunkInInode, &prevTags);
++
++ /* Set up new tags */
++ yaffs_InitialiseTags(&newTags);
++
++ newTags.chunkId = chunkInInode;
++ newTags.objectId = in->objectId;
++ newTags.serialNumber =
++ (prevChunkId >= 0) ? prevTags.serialNumber + 1 : 1;
++ newTags.byteCount = nBytes;
++
++ if (nBytes < 1 || nBytes > dev->totalBytesPerChunk) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("Writing %d bytes to chunk!!!!!!!!!" TENDSTR), nBytes));
++ YBUG();
++ }
++
++ newChunkId =
++ yaffs_WriteNewChunkWithTagsToNAND(dev, buffer, &newTags,
++ useReserve);
++
++ if (newChunkId >= 0) {
++ yaffs_PutChunkIntoFile(in, chunkInInode, newChunkId, 0);
++
++ if (prevChunkId >= 0)
++ yaffs_DeleteChunk(dev, prevChunkId, 1, __LINE__);
++
++ yaffs_CheckFileSanity(in);
++ }
++ return newChunkId;
++
++}
++
++/* UpdateObjectHeader updates the header on NAND for an object.
++ * If name is not NULL, then that new name is used.
++ */
++int yaffs_UpdateObjectHeader(yaffs_Object *in, const YCHAR *name, int force,
++ int isShrink, int shadows)
++{
++
++ yaffs_BlockInfo *bi;
++
++ yaffs_Device *dev = in->myDev;
++
++ int prevChunkId;
++ int retVal = 0;
++ int result = 0;
++
++ int newChunkId;
++ yaffs_ExtendedTags newTags;
++ yaffs_ExtendedTags oldTags;
++
++ __u8 *buffer = NULL;
++ YCHAR oldName[YAFFS_MAX_NAME_LENGTH + 1];
++
++ yaffs_ObjectHeader *oh = NULL;
++
++ yaffs_strcpy(oldName, _Y("silly old name"));
++
++
++ if (!in->fake ||
++ in == dev->rootDir || /* The rootDir should also be saved */
++ force) {
++
++ yaffs_CheckGarbageCollection(dev);
++ yaffs_CheckObjectDetailsLoaded(in);
++
++ buffer = yaffs_GetTempBuffer(in->myDev, __LINE__);
++ oh = (yaffs_ObjectHeader *) buffer;
++
++ prevChunkId = in->hdrChunk;
++
++ if (prevChunkId > 0) {
++ result = yaffs_ReadChunkWithTagsFromNAND(dev, prevChunkId,
++ buffer, &oldTags);
++
++ yaffs_VerifyObjectHeader(in, oh, &oldTags, 0);
++
++ memcpy(oldName, oh->name, sizeof(oh->name));
++ }
++
++ memset(buffer, 0xFF, dev->nDataBytesPerChunk);
++
++ oh->type = in->variantType;
++ oh->yst_mode = in->yst_mode;
++ oh->shadowsObject = oh->inbandShadowsObject = shadows;
++
++#ifdef CONFIG_YAFFS_WINCE
++ oh->win_atime[0] = in->win_atime[0];
++ oh->win_ctime[0] = in->win_ctime[0];
++ oh->win_mtime[0] = in->win_mtime[0];
++ oh->win_atime[1] = in->win_atime[1];
++ oh->win_ctime[1] = in->win_ctime[1];
++ oh->win_mtime[1] = in->win_mtime[1];
++#else
++ oh->yst_uid = in->yst_uid;
++ oh->yst_gid = in->yst_gid;
++ oh->yst_atime = in->yst_atime;
++ oh->yst_mtime = in->yst_mtime;
++ oh->yst_ctime = in->yst_ctime;
++ oh->yst_rdev = in->yst_rdev;
++#endif
++ if (in->parent)
++ oh->parentObjectId = in->parent->objectId;
++ else
++ oh->parentObjectId = 0;
++
++ if (name && *name) {
++ memset(oh->name, 0, sizeof(oh->name));
++ yaffs_strncpy(oh->name, name, YAFFS_MAX_NAME_LENGTH);
++ } else if (prevChunkId >= 0)
++ memcpy(oh->name, oldName, sizeof(oh->name));
++ else
++ memset(oh->name, 0, sizeof(oh->name));
++
++ oh->isShrink = isShrink;
++
++ switch (in->variantType) {
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ /* Should not happen */
++ break;
++ case YAFFS_OBJECT_TYPE_FILE:
++ oh->fileSize =
++ (oh->parentObjectId == YAFFS_OBJECTID_DELETED
++ || oh->parentObjectId ==
++ YAFFS_OBJECTID_UNLINKED) ? 0 : in->variant.
++ fileVariant.fileSize;
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ oh->equivalentObjectId =
++ in->variant.hardLinkVariant.equivalentObjectId;
++ break;
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ /* Do nothing */
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ /* Do nothing */
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ yaffs_strncpy(oh->alias,
++ in->variant.symLinkVariant.alias,
++ YAFFS_MAX_ALIAS_LENGTH);
++ oh->alias[YAFFS_MAX_ALIAS_LENGTH] = 0;
++ break;
++ }
++
++ /* Tags */
++ yaffs_InitialiseTags(&newTags);
++ in->serial++;
++ newTags.chunkId = 0;
++ newTags.objectId = in->objectId;
++ newTags.serialNumber = in->serial;
++
++ /* Add extra info for file header */
++
++ newTags.extraHeaderInfoAvailable = 1;
++ newTags.extraParentObjectId = oh->parentObjectId;
++ newTags.extraFileLength = oh->fileSize;
++ newTags.extraIsShrinkHeader = oh->isShrink;
++ newTags.extraEquivalentObjectId = oh->equivalentObjectId;
++ newTags.extraShadows = (oh->shadowsObject > 0) ? 1 : 0;
++ newTags.extraObjectType = in->variantType;
++
++ yaffs_VerifyObjectHeader(in, oh, &newTags, 1);
++
++ /* Create new chunk in NAND */
++ newChunkId =
++ yaffs_WriteNewChunkWithTagsToNAND(dev, buffer, &newTags,
++ (prevChunkId >= 0) ? 1 : 0);
++
++ if (newChunkId >= 0) {
++
++ in->hdrChunk = newChunkId;
++
++ if (prevChunkId >= 0) {
++ yaffs_DeleteChunk(dev, prevChunkId, 1,
++ __LINE__);
++ }
++
++ if (!yaffs_ObjectHasCachedWriteData(in))
++ in->dirty = 0;
++
++ /* If this was a shrink, then mark the block that the chunk lives on */
++ if (isShrink) {
++ bi = yaffs_GetBlockInfo(in->myDev,
++ newChunkId / in->myDev->nChunksPerBlock);
++ bi->hasShrinkHeader = 1;
++ }
++
++ }
++
++ retVal = newChunkId;
++
++ }
++
++ if (buffer)
++ yaffs_ReleaseTempBuffer(dev, buffer, __LINE__);
++
++ return retVal;
++}
++
++/*------------------------ Short Operations Cache ----------------------------------------
++ * In many situations where there is no high level buffering (eg WinCE) a lot of
++ * reads might be short sequential reads, and a lot of writes may be short
++ * sequential writes. eg. scanning/writing a jpeg file.
++ * In these cases, a short read/write cache can provide a huge perfomance benefit
++ * with dumb-as-a-rock code.
++ * In Linux, the page cache provides read buffering aand the short op cache provides write
++ * buffering.
++ *
++ * There are a limited number (~10) of cache chunks per device so that we don't
++ * need a very intelligent search.
++ */
++
++static int yaffs_ObjectHasCachedWriteData(yaffs_Object *obj)
++{
++ yaffs_Device *dev = obj->myDev;
++ int i;
++ yaffs_ChunkCache *cache;
++ int nCaches = obj->myDev->nShortOpCaches;
++
++ for (i = 0; i < nCaches; i++) {
++ cache = &dev->srCache[i];
++ if (cache->object == obj &&
++ cache->dirty)
++ return 1;
++ }
++
++ return 0;
++}
++
++
++static void yaffs_FlushFilesChunkCache(yaffs_Object *obj)
++{
++ yaffs_Device *dev = obj->myDev;
++ int lowest = -99; /* Stop compiler whining. */
++ int i;
++ yaffs_ChunkCache *cache;
++ int chunkWritten = 0;
++ int nCaches = obj->myDev->nShortOpCaches;
++
++ if (nCaches > 0) {
++ do {
++ cache = NULL;
++
++ /* Find the dirty cache for this object with the lowest chunk id. */
++ for (i = 0; i < nCaches; i++) {
++ if (dev->srCache[i].object == obj &&
++ dev->srCache[i].dirty) {
++ if (!cache
++ || dev->srCache[i].chunkId <
++ lowest) {
++ cache = &dev->srCache[i];
++ lowest = cache->chunkId;
++ }
++ }
++ }
++
++ if (cache && !cache->locked) {
++ /* Write it out and free it up */
++
++ chunkWritten =
++ yaffs_WriteChunkDataToObject(cache->object,
++ cache->chunkId,
++ cache->data,
++ cache->nBytes,
++ 1);
++ cache->dirty = 0;
++ cache->object = NULL;
++ }
++
++ } while (cache && chunkWritten > 0);
++
++ if (cache) {
++ /* Hoosterman, disk full while writing cache out. */
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("yaffs tragedy: no space during cache write" TENDSTR)));
++
++ }
++ }
++
++}
++
++/*yaffs_FlushEntireDeviceCache(dev)
++ *
++ *
++ */
++
++void yaffs_FlushEntireDeviceCache(yaffs_Device *dev)
++{
++ yaffs_Object *obj;
++ int nCaches = dev->nShortOpCaches;
++ int i;
++
++ /* Find a dirty object in the cache and flush it...
++ * until there are no further dirty objects.
++ */
++ do {
++ obj = NULL;
++ for (i = 0; i < nCaches && !obj; i++) {
++ if (dev->srCache[i].object &&
++ dev->srCache[i].dirty)
++ obj = dev->srCache[i].object;
++
++ }
++ if (obj)
++ yaffs_FlushFilesChunkCache(obj);
++
++ } while (obj);
++
++}
++
++
++/* Grab us a cache chunk for use.
++ * First look for an empty one.
++ * Then look for the least recently used non-dirty one.
++ * Then look for the least recently used dirty one...., flush and look again.
++ */
++static yaffs_ChunkCache *yaffs_GrabChunkCacheWorker(yaffs_Device *dev)
++{
++ int i;
++
++ if (dev->nShortOpCaches > 0) {
++ for (i = 0; i < dev->nShortOpCaches; i++) {
++ if (!dev->srCache[i].object)
++ return &dev->srCache[i];
++ }
++ }
++
++ return NULL;
++}
++
++static yaffs_ChunkCache *yaffs_GrabChunkCache(yaffs_Device *dev)
++{
++ yaffs_ChunkCache *cache;
++ yaffs_Object *theObj;
++ int usage;
++ int i;
++ int pushout;
++
++ if (dev->nShortOpCaches > 0) {
++ /* Try find a non-dirty one... */
++
++ cache = yaffs_GrabChunkCacheWorker(dev);
++
++ if (!cache) {
++ /* They were all dirty, find the last recently used object and flush
++ * its cache, then find again.
++ * NB what's here is not very accurate, we actually flush the object
++ * the last recently used page.
++ */
++
++ /* With locking we can't assume we can use entry zero */
++
++ theObj = NULL;
++ usage = -1;
++ cache = NULL;
++ pushout = -1;
++
++ for (i = 0; i < dev->nShortOpCaches; i++) {
++ if (dev->srCache[i].object &&
++ !dev->srCache[i].locked &&
++ (dev->srCache[i].lastUse < usage || !cache)) {
++ usage = dev->srCache[i].lastUse;
++ theObj = dev->srCache[i].object;
++ cache = &dev->srCache[i];
++ pushout = i;
++ }
++ }
++
++ if (!cache || cache->dirty) {
++ /* Flush and try again */
++ yaffs_FlushFilesChunkCache(theObj);
++ cache = yaffs_GrabChunkCacheWorker(dev);
++ }
++
++ }
++ return cache;
++ } else
++ return NULL;
++
++}
++
++/* Find a cached chunk */
++static yaffs_ChunkCache *yaffs_FindChunkCache(const yaffs_Object *obj,
++ int chunkId)
++{
++ yaffs_Device *dev = obj->myDev;
++ int i;
++ if (dev->nShortOpCaches > 0) {
++ for (i = 0; i < dev->nShortOpCaches; i++) {
++ if (dev->srCache[i].object == obj &&
++ dev->srCache[i].chunkId == chunkId) {
++ dev->cacheHits++;
++
++ return &dev->srCache[i];
++ }
++ }
++ }
++ return NULL;
++}
++
++/* Mark the chunk for the least recently used algorithym */
++static void yaffs_UseChunkCache(yaffs_Device *dev, yaffs_ChunkCache *cache,
++ int isAWrite)
++{
++
++ if (dev->nShortOpCaches > 0) {
++ if (dev->srLastUse < 0 || dev->srLastUse > 100000000) {
++ /* Reset the cache usages */
++ int i;
++ for (i = 1; i < dev->nShortOpCaches; i++)
++ dev->srCache[i].lastUse = 0;
++
++ dev->srLastUse = 0;
++ }
++
++ dev->srLastUse++;
++
++ cache->lastUse = dev->srLastUse;
++
++ if (isAWrite)
++ cache->dirty = 1;
++ }
++}
++
++/* Invalidate a single cache page.
++ * Do this when a whole page gets written,
++ * ie the short cache for this page is no longer valid.
++ */
++static void yaffs_InvalidateChunkCache(yaffs_Object *object, int chunkId)
++{
++ if (object->myDev->nShortOpCaches > 0) {
++ yaffs_ChunkCache *cache = yaffs_FindChunkCache(object, chunkId);
++
++ if (cache)
++ cache->object = NULL;
++ }
++}
++
++/* Invalidate all the cache pages associated with this object
++ * Do this whenever ther file is deleted or resized.
++ */
++static void yaffs_InvalidateWholeChunkCache(yaffs_Object *in)
++{
++ int i;
++ yaffs_Device *dev = in->myDev;
++
++ if (dev->nShortOpCaches > 0) {
++ /* Invalidate it. */
++ for (i = 0; i < dev->nShortOpCaches; i++) {
++ if (dev->srCache[i].object == in)
++ dev->srCache[i].object = NULL;
++ }
++ }
++}
++
++/*--------------------- Checkpointing --------------------*/
++
++
++static int yaffs_WriteCheckpointValidityMarker(yaffs_Device *dev, int head)
++{
++ yaffs_CheckpointValidity cp;
++
++ memset(&cp, 0, sizeof(cp));
++
++ cp.structType = sizeof(cp);
++ cp.magic = YAFFS_MAGIC;
++ cp.version = YAFFS_CHECKPOINT_VERSION;
++ cp.head = (head) ? 1 : 0;
++
++ return (yaffs_CheckpointWrite(dev, &cp, sizeof(cp)) == sizeof(cp)) ?
++ 1 : 0;
++}
++
++static int yaffs_ReadCheckpointValidityMarker(yaffs_Device *dev, int head)
++{
++ yaffs_CheckpointValidity cp;
++ int ok;
++
++ ok = (yaffs_CheckpointRead(dev, &cp, sizeof(cp)) == sizeof(cp));
++
++ if (ok)
++ ok = (cp.structType == sizeof(cp)) &&
++ (cp.magic == YAFFS_MAGIC) &&
++ (cp.version == YAFFS_CHECKPOINT_VERSION) &&
++ (cp.head == ((head) ? 1 : 0));
++ return ok ? 1 : 0;
++}
++
++static void yaffs_DeviceToCheckpointDevice(yaffs_CheckpointDevice *cp,
++ yaffs_Device *dev)
++{
++ cp->nErasedBlocks = dev->nErasedBlocks;
++ cp->allocationBlock = dev->allocationBlock;
++ cp->allocationPage = dev->allocationPage;
++ cp->nFreeChunks = dev->nFreeChunks;
++
++ cp->nDeletedFiles = dev->nDeletedFiles;
++ cp->nUnlinkedFiles = dev->nUnlinkedFiles;
++ cp->nBackgroundDeletions = dev->nBackgroundDeletions;
++ cp->sequenceNumber = dev->sequenceNumber;
++ cp->oldestDirtySequence = dev->oldestDirtySequence;
++
++}
++
++static void yaffs_CheckpointDeviceToDevice(yaffs_Device *dev,
++ yaffs_CheckpointDevice *cp)
++{
++ dev->nErasedBlocks = cp->nErasedBlocks;
++ dev->allocationBlock = cp->allocationBlock;
++ dev->allocationPage = cp->allocationPage;
++ dev->nFreeChunks = cp->nFreeChunks;
++
++ dev->nDeletedFiles = cp->nDeletedFiles;
++ dev->nUnlinkedFiles = cp->nUnlinkedFiles;
++ dev->nBackgroundDeletions = cp->nBackgroundDeletions;
++ dev->sequenceNumber = cp->sequenceNumber;
++ dev->oldestDirtySequence = cp->oldestDirtySequence;
++}
++
++
++static int yaffs_WriteCheckpointDevice(yaffs_Device *dev)
++{
++ yaffs_CheckpointDevice cp;
++ __u32 nBytes;
++ __u32 nBlocks = (dev->internalEndBlock - dev->internalStartBlock + 1);
++
++ int ok;
++
++ /* Write device runtime values*/
++ yaffs_DeviceToCheckpointDevice(&cp, dev);
++ cp.structType = sizeof(cp);
++
++ ok = (yaffs_CheckpointWrite(dev, &cp, sizeof(cp)) == sizeof(cp));
++
++ /* Write block info */
++ if (ok) {
++ nBytes = nBlocks * sizeof(yaffs_BlockInfo);
++ ok = (yaffs_CheckpointWrite(dev, dev->blockInfo, nBytes) == nBytes);
++ }
++
++ /* Write chunk bits */
++ if (ok) {
++ nBytes = nBlocks * dev->chunkBitmapStride;
++ ok = (yaffs_CheckpointWrite(dev, dev->chunkBits, nBytes) == nBytes);
++ }
++ return ok ? 1 : 0;
++
++}
++
++static int yaffs_ReadCheckpointDevice(yaffs_Device *dev)
++{
++ yaffs_CheckpointDevice cp;
++ __u32 nBytes;
++ __u32 nBlocks = (dev->internalEndBlock - dev->internalStartBlock + 1);
++
++ int ok;
++
++ ok = (yaffs_CheckpointRead(dev, &cp, sizeof(cp)) == sizeof(cp));
++ if (!ok)
++ return 0;
++
++ if (cp.structType != sizeof(cp))
++ return 0;
++
++
++ yaffs_CheckpointDeviceToDevice(dev, &cp);
++
++ nBytes = nBlocks * sizeof(yaffs_BlockInfo);
++
++ ok = (yaffs_CheckpointRead(dev, dev->blockInfo, nBytes) == nBytes);
++
++ if (!ok)
++ return 0;
++ nBytes = nBlocks * dev->chunkBitmapStride;
++
++ ok = (yaffs_CheckpointRead(dev, dev->chunkBits, nBytes) == nBytes);
++
++ return ok ? 1 : 0;
++}
++
++static void yaffs_ObjectToCheckpointObject(yaffs_CheckpointObject *cp,
++ yaffs_Object *obj)
++{
++
++ cp->objectId = obj->objectId;
++ cp->parentId = (obj->parent) ? obj->parent->objectId : 0;
++ cp->hdrChunk = obj->hdrChunk;
++ cp->variantType = obj->variantType;
++ cp->deleted = obj->deleted;
++ cp->softDeleted = obj->softDeleted;
++ cp->unlinked = obj->unlinked;
++ cp->fake = obj->fake;
++ cp->renameAllowed = obj->renameAllowed;
++ cp->unlinkAllowed = obj->unlinkAllowed;
++ cp->serial = obj->serial;
++ cp->nDataChunks = obj->nDataChunks;
++
++ if (obj->variantType == YAFFS_OBJECT_TYPE_FILE)
++ cp->fileSizeOrEquivalentObjectId = obj->variant.fileVariant.fileSize;
++ else if (obj->variantType == YAFFS_OBJECT_TYPE_HARDLINK)
++ cp->fileSizeOrEquivalentObjectId = obj->variant.hardLinkVariant.equivalentObjectId;
++}
++
++static int yaffs_CheckpointObjectToObject(yaffs_Object *obj, yaffs_CheckpointObject *cp)
++{
++
++ yaffs_Object *parent;
++
++ if (obj->variantType != cp->variantType) {
++ T(YAFFS_TRACE_ERROR, (TSTR("Checkpoint read object %d type %d "
++ TCONT("chunk %d does not match existing object type %d")
++ TENDSTR), cp->objectId, cp->variantType, cp->hdrChunk,
++ obj->variantType));
++ return 0;
++ }
++
++ obj->objectId = cp->objectId;
++
++ if (cp->parentId)
++ parent = yaffs_FindOrCreateObjectByNumber(
++ obj->myDev,
++ cp->parentId,
++ YAFFS_OBJECT_TYPE_DIRECTORY);
++ else
++ parent = NULL;
++
++ if (parent) {
++ if (parent->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("Checkpoint read object %d parent %d type %d"
++ TCONT(" chunk %d Parent type, %d, not directory")
++ TENDSTR),
++ cp->objectId, cp->parentId, cp->variantType,
++ cp->hdrChunk, parent->variantType));
++ return 0;
++ }
++ yaffs_AddObjectToDirectory(parent, obj);
++ }
++
++ obj->hdrChunk = cp->hdrChunk;
++ obj->variantType = cp->variantType;
++ obj->deleted = cp->deleted;
++ obj->softDeleted = cp->softDeleted;
++ obj->unlinked = cp->unlinked;
++ obj->fake = cp->fake;
++ obj->renameAllowed = cp->renameAllowed;
++ obj->unlinkAllowed = cp->unlinkAllowed;
++ obj->serial = cp->serial;
++ obj->nDataChunks = cp->nDataChunks;
++
++ if (obj->variantType == YAFFS_OBJECT_TYPE_FILE)
++ obj->variant.fileVariant.fileSize = cp->fileSizeOrEquivalentObjectId;
++ else if (obj->variantType == YAFFS_OBJECT_TYPE_HARDLINK)
++ obj->variant.hardLinkVariant.equivalentObjectId = cp->fileSizeOrEquivalentObjectId;
++
++ if (obj->hdrChunk > 0)
++ obj->lazyLoaded = 1;
++ return 1;
++}
++
++
++
++static int yaffs_CheckpointTnodeWorker(yaffs_Object *in, yaffs_Tnode *tn,
++ __u32 level, int chunkOffset)
++{
++ int i;
++ yaffs_Device *dev = in->myDev;
++ int ok = 1;
++ int tnodeSize = (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8;
++
++ if (tnodeSize < sizeof(yaffs_Tnode))
++ tnodeSize = sizeof(yaffs_Tnode);
++
++
++ if (tn) {
++ if (level > 0) {
++
++ for (i = 0; i < YAFFS_NTNODES_INTERNAL && ok; i++) {
++ if (tn->internal[i]) {
++ ok = yaffs_CheckpointTnodeWorker(in,
++ tn->internal[i],
++ level - 1,
++ (chunkOffset<<YAFFS_TNODES_INTERNAL_BITS) + i);
++ }
++ }
++ } else if (level == 0) {
++ __u32 baseOffset = chunkOffset << YAFFS_TNODES_LEVEL0_BITS;
++ ok = (yaffs_CheckpointWrite(dev, &baseOffset, sizeof(baseOffset)) == sizeof(baseOffset));
++ if (ok)
++ ok = (yaffs_CheckpointWrite(dev, tn, tnodeSize) == tnodeSize);
++ }
++ }
++
++ return ok;
++
++}
++
++static int yaffs_WriteCheckpointTnodes(yaffs_Object *obj)
++{
++ __u32 endMarker = ~0;
++ int ok = 1;
++
++ if (obj->variantType == YAFFS_OBJECT_TYPE_FILE) {
++ ok = yaffs_CheckpointTnodeWorker(obj,
++ obj->variant.fileVariant.top,
++ obj->variant.fileVariant.topLevel,
++ 0);
++ if (ok)
++ ok = (yaffs_CheckpointWrite(obj->myDev, &endMarker, sizeof(endMarker)) ==
++ sizeof(endMarker));
++ }
++
++ return ok ? 1 : 0;
++}
++
++static int yaffs_ReadCheckpointTnodes(yaffs_Object *obj)
++{
++ __u32 baseChunk;
++ int ok = 1;
++ yaffs_Device *dev = obj->myDev;
++ yaffs_FileStructure *fileStructPtr = &obj->variant.fileVariant;
++ yaffs_Tnode *tn;
++ int nread = 0;
++ int tnodeSize = (dev->tnodeWidth * YAFFS_NTNODES_LEVEL0)/8;
++
++ if (tnodeSize < sizeof(yaffs_Tnode))
++ tnodeSize = sizeof(yaffs_Tnode);
++
++ ok = (yaffs_CheckpointRead(dev, &baseChunk, sizeof(baseChunk)) == sizeof(baseChunk));
++
++ while (ok && (~baseChunk)) {
++ nread++;
++ /* Read level 0 tnode */
++
++
++ tn = yaffs_GetTnodeRaw(dev);
++ if (tn)
++ ok = (yaffs_CheckpointRead(dev, tn, tnodeSize) == tnodeSize);
++ else
++ ok = 0;
++
++ if (tn && ok)
++ ok = yaffs_AddOrFindLevel0Tnode(dev,
++ fileStructPtr,
++ baseChunk,
++ tn) ? 1 : 0;
++
++ if (ok)
++ ok = (yaffs_CheckpointRead(dev, &baseChunk, sizeof(baseChunk)) == sizeof(baseChunk));
++
++ }
++
++ T(YAFFS_TRACE_CHECKPOINT, (
++ TSTR("Checkpoint read tnodes %d records, last %d. ok %d" TENDSTR),
++ nread, baseChunk, ok));
++
++ return ok ? 1 : 0;
++}
++
++
++static int yaffs_WriteCheckpointObjects(yaffs_Device *dev)
++{
++ yaffs_Object *obj;
++ yaffs_CheckpointObject cp;
++ int i;
++ int ok = 1;
++ struct ylist_head *lh;
++
++
++ /* Iterate through the objects in each hash entry,
++ * dumping them to the checkpointing stream.
++ */
++
++ for (i = 0; ok && i < YAFFS_NOBJECT_BUCKETS; i++) {
++ ylist_for_each(lh, &dev->objectBucket[i].list) {
++ if (lh) {
++ obj = ylist_entry(lh, yaffs_Object, hashLink);
++ if (!obj->deferedFree) {
++ yaffs_ObjectToCheckpointObject(&cp, obj);
++ cp.structType = sizeof(cp);
++
++ T(YAFFS_TRACE_CHECKPOINT, (
++ TSTR("Checkpoint write object %d parent %d type %d chunk %d obj addr %x" TENDSTR),
++ cp.objectId, cp.parentId, cp.variantType, cp.hdrChunk, (unsigned) obj));
++
++ ok = (yaffs_CheckpointWrite(dev, &cp, sizeof(cp)) == sizeof(cp));
++
++ if (ok && obj->variantType == YAFFS_OBJECT_TYPE_FILE)
++ ok = yaffs_WriteCheckpointTnodes(obj);
++ }
++ }
++ }
++ }
++
++ /* Dump end of list */
++ memset(&cp, 0xFF, sizeof(yaffs_CheckpointObject));
++ cp.structType = sizeof(cp);
++
++ if (ok)
++ ok = (yaffs_CheckpointWrite(dev, &cp, sizeof(cp)) == sizeof(cp));
++
++ return ok ? 1 : 0;
++}
++
++static int yaffs_ReadCheckpointObjects(yaffs_Device *dev)
++{
++ yaffs_Object *obj;
++ yaffs_CheckpointObject cp;
++ int ok = 1;
++ int done = 0;
++ yaffs_Object *hardList = NULL;
++
++ while (ok && !done) {
++ ok = (yaffs_CheckpointRead(dev, &cp, sizeof(cp)) == sizeof(cp));
++ if (cp.structType != sizeof(cp)) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("struct size %d instead of %d ok %d"TENDSTR),
++ cp.structType, sizeof(cp), ok));
++ ok = 0;
++ }
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("Checkpoint read object %d parent %d type %d chunk %d " TENDSTR),
++ cp.objectId, cp.parentId, cp.variantType, cp.hdrChunk));
++
++ if (ok && cp.objectId == ~0)
++ done = 1;
++ else if (ok) {
++ obj = yaffs_FindOrCreateObjectByNumber(dev, cp.objectId, cp.variantType);
++ if (obj) {
++ ok = yaffs_CheckpointObjectToObject(obj, &cp);
++ if (!ok)
++ break;
++ if (obj->variantType == YAFFS_OBJECT_TYPE_FILE) {
++ ok = yaffs_ReadCheckpointTnodes(obj);
++ } else if (obj->variantType == YAFFS_OBJECT_TYPE_HARDLINK) {
++ obj->hardLinks.next =
++ (struct ylist_head *) hardList;
++ hardList = obj;
++ }
++ } else
++ ok = 0;
++ }
++ }
++
++ if (ok)
++ yaffs_HardlinkFixup(dev, hardList);
++
++ return ok ? 1 : 0;
++}
++
++static int yaffs_WriteCheckpointSum(yaffs_Device *dev)
++{
++ __u32 checkpointSum;
++ int ok;
++
++ yaffs_GetCheckpointSum(dev, &checkpointSum);
++
++ ok = (yaffs_CheckpointWrite(dev, &checkpointSum, sizeof(checkpointSum)) == sizeof(checkpointSum));
++
++ if (!ok)
++ return 0;
++
++ return 1;
++}
++
++static int yaffs_ReadCheckpointSum(yaffs_Device *dev)
++{
++ __u32 checkpointSum0;
++ __u32 checkpointSum1;
++ int ok;
++
++ yaffs_GetCheckpointSum(dev, &checkpointSum0);
++
++ ok = (yaffs_CheckpointRead(dev, &checkpointSum1, sizeof(checkpointSum1)) == sizeof(checkpointSum1));
++
++ if (!ok)
++ return 0;
++
++ if (checkpointSum0 != checkpointSum1)
++ return 0;
++
++ return 1;
++}
++
++
++static int yaffs_WriteCheckpointData(yaffs_Device *dev)
++{
++ int ok = 1;
++
++ if (dev->skipCheckpointWrite || !dev->isYaffs2) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("skipping checkpoint write" TENDSTR)));
++ ok = 0;
++ }
++
++ if (ok)
++ ok = yaffs_CheckpointOpen(dev, 1);
++
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("write checkpoint validity" TENDSTR)));
++ ok = yaffs_WriteCheckpointValidityMarker(dev, 1);
++ }
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("write checkpoint device" TENDSTR)));
++ ok = yaffs_WriteCheckpointDevice(dev);
++ }
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("write checkpoint objects" TENDSTR)));
++ ok = yaffs_WriteCheckpointObjects(dev);
++ }
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("write checkpoint validity" TENDSTR)));
++ ok = yaffs_WriteCheckpointValidityMarker(dev, 0);
++ }
++
++ if (ok)
++ ok = yaffs_WriteCheckpointSum(dev);
++
++ if (!yaffs_CheckpointClose(dev))
++ ok = 0;
++
++ if (ok)
++ dev->isCheckpointed = 1;
++ else
++ dev->isCheckpointed = 0;
++
++ return dev->isCheckpointed;
++}
++
++static int yaffs_ReadCheckpointData(yaffs_Device *dev)
++{
++ int ok = 1;
++
++ if (dev->skipCheckpointRead || !dev->isYaffs2) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("skipping checkpoint read" TENDSTR)));
++ ok = 0;
++ }
++
++ if (ok)
++ ok = yaffs_CheckpointOpen(dev, 0); /* open for read */
++
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("read checkpoint validity" TENDSTR)));
++ ok = yaffs_ReadCheckpointValidityMarker(dev, 1);
++ }
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("read checkpoint device" TENDSTR)));
++ ok = yaffs_ReadCheckpointDevice(dev);
++ }
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("read checkpoint objects" TENDSTR)));
++ ok = yaffs_ReadCheckpointObjects(dev);
++ }
++ if (ok) {
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("read checkpoint validity" TENDSTR)));
++ ok = yaffs_ReadCheckpointValidityMarker(dev, 0);
++ }
++
++ if (ok) {
++ ok = yaffs_ReadCheckpointSum(dev);
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("read checkpoint checksum %d" TENDSTR), ok));
++ }
++
++ if (!yaffs_CheckpointClose(dev))
++ ok = 0;
++
++ if (ok)
++ dev->isCheckpointed = 1;
++ else
++ dev->isCheckpointed = 0;
++
++ return ok ? 1 : 0;
++
++}
++
++static void yaffs_InvalidateCheckpoint(yaffs_Device *dev)
++{
++ if (dev->isCheckpointed ||
++ dev->blocksInCheckpoint > 0) {
++ dev->isCheckpointed = 0;
++ yaffs_CheckpointInvalidateStream(dev);
++ if (dev->superBlock && dev->markSuperBlockDirty)
++ dev->markSuperBlockDirty(dev->superBlock);
++ }
++}
++
++
++int yaffs_CheckpointSave(yaffs_Device *dev)
++{
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("save entry: isCheckpointed %d"TENDSTR), dev->isCheckpointed));
++
++ yaffs_VerifyObjects(dev);
++ yaffs_VerifyBlocks(dev);
++ yaffs_VerifyFreeChunks(dev);
++
++ if (!dev->isCheckpointed) {
++ yaffs_InvalidateCheckpoint(dev);
++ yaffs_WriteCheckpointData(dev);
++ }
++
++ T(YAFFS_TRACE_ALWAYS, (TSTR("save exit: isCheckpointed %d"TENDSTR), dev->isCheckpointed));
++
++ return dev->isCheckpointed;
++}
++
++int yaffs_CheckpointRestore(yaffs_Device *dev)
++{
++ int retval;
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("restore entry: isCheckpointed %d"TENDSTR), dev->isCheckpointed));
++
++ retval = yaffs_ReadCheckpointData(dev);
++
++ if (dev->isCheckpointed) {
++ yaffs_VerifyObjects(dev);
++ yaffs_VerifyBlocks(dev);
++ yaffs_VerifyFreeChunks(dev);
++ }
++
++ T(YAFFS_TRACE_CHECKPOINT, (TSTR("restore exit: isCheckpointed %d"TENDSTR), dev->isCheckpointed));
++
++ return retval;
++}
++
++/*--------------------- File read/write ------------------------
++ * Read and write have very similar structures.
++ * In general the read/write has three parts to it
++ * An incomplete chunk to start with (if the read/write is not chunk-aligned)
++ * Some complete chunks
++ * An incomplete chunk to end off with
++ *
++ * Curve-balls: the first chunk might also be the last chunk.
++ */
++
++int yaffs_ReadDataFromFile(yaffs_Object *in, __u8 *buffer, loff_t offset,
++ int nBytes)
++{
++
++ int chunk;
++ __u32 start;
++ int nToCopy;
++ int n = nBytes;
++ int nDone = 0;
++ yaffs_ChunkCache *cache;
++
++ yaffs_Device *dev;
++
++ dev = in->myDev;
++
++ while (n > 0) {
++ /* chunk = offset / dev->nDataBytesPerChunk + 1; */
++ /* start = offset % dev->nDataBytesPerChunk; */
++ yaffs_AddrToChunk(dev, offset, &chunk, &start);
++ chunk++;
++
++ /* OK now check for the curveball where the start and end are in
++ * the same chunk.
++ */
++ if ((start + n) < dev->nDataBytesPerChunk)
++ nToCopy = n;
++ else
++ nToCopy = dev->nDataBytesPerChunk - start;
++
++ cache = yaffs_FindChunkCache(in, chunk);
++
++ /* If the chunk is already in the cache or it is less than a whole chunk
++ * or we're using inband tags then use the cache (if there is caching)
++ * else bypass the cache.
++ */
++ if (cache || nToCopy != dev->nDataBytesPerChunk || dev->inbandTags) {
++ if (dev->nShortOpCaches > 0) {
++
++ /* If we can't find the data in the cache, then load it up. */
++
++ if (!cache) {
++ cache = yaffs_GrabChunkCache(in->myDev);
++ cache->object = in;
++ cache->chunkId = chunk;
++ cache->dirty = 0;
++ cache->locked = 0;
++ yaffs_ReadChunkDataFromObject(in, chunk,
++ cache->
++ data);
++ cache->nBytes = 0;
++ }
++
++ yaffs_UseChunkCache(dev, cache, 0);
++
++ cache->locked = 1;
++
++
++ memcpy(buffer, &cache->data[start], nToCopy);
++
++ cache->locked = 0;
++ } else {
++ /* Read into the local buffer then copy..*/
++
++ __u8 *localBuffer =
++ yaffs_GetTempBuffer(dev, __LINE__);
++ yaffs_ReadChunkDataFromObject(in, chunk,
++ localBuffer);
++
++ memcpy(buffer, &localBuffer[start], nToCopy);
++
++
++ yaffs_ReleaseTempBuffer(dev, localBuffer,
++ __LINE__);
++ }
++
++ } else {
++
++ /* A full chunk. Read directly into the supplied buffer. */
++ yaffs_ReadChunkDataFromObject(in, chunk, buffer);
++
++ }
++
++ n -= nToCopy;
++ offset += nToCopy;
++ buffer += nToCopy;
++ nDone += nToCopy;
++
++ }
++
++ return nDone;
++}
++
++int yaffs_WriteDataToFile(yaffs_Object *in, const __u8 *buffer, loff_t offset,
++ int nBytes, int writeThrough)
++{
++
++ int chunk;
++ __u32 start;
++ int nToCopy;
++ int n = nBytes;
++ int nDone = 0;
++ int nToWriteBack;
++ int startOfWrite = offset;
++ int chunkWritten = 0;
++ __u32 nBytesRead;
++ __u32 chunkStart;
++
++ yaffs_Device *dev;
++
++ dev = in->myDev;
++
++ while (n > 0 && chunkWritten >= 0) {
++ /* chunk = offset / dev->nDataBytesPerChunk + 1; */
++ /* start = offset % dev->nDataBytesPerChunk; */
++ yaffs_AddrToChunk(dev, offset, &chunk, &start);
++
++ if (chunk * dev->nDataBytesPerChunk + start != offset ||
++ start >= dev->nDataBytesPerChunk) {
++ T(YAFFS_TRACE_ERROR, (
++ TSTR("AddrToChunk of offset %d gives chunk %d start %d"
++ TENDSTR),
++ (int)offset, chunk, start));
++ }
++ chunk++;
++
++ /* OK now check for the curveball where the start and end are in
++ * the same chunk.
++ */
++
++ if ((start + n) < dev->nDataBytesPerChunk) {
++ nToCopy = n;
++
++ /* Now folks, to calculate how many bytes to write back....
++ * If we're overwriting and not writing to then end of file then
++ * we need to write back as much as was there before.
++ */
++
++ chunkStart = ((chunk - 1) * dev->nDataBytesPerChunk);
++
++ if (chunkStart > in->variant.fileVariant.fileSize)
++ nBytesRead = 0; /* Past end of file */
++ else
++ nBytesRead = in->variant.fileVariant.fileSize - chunkStart;
++
++ if (nBytesRead > dev->nDataBytesPerChunk)
++ nBytesRead = dev->nDataBytesPerChunk;
++
++ nToWriteBack =
++ (nBytesRead >
++ (start + n)) ? nBytesRead : (start + n);
++
++ if (nToWriteBack < 0 || nToWriteBack > dev->nDataBytesPerChunk)
++ YBUG();
++
++ } else {
++ nToCopy = dev->nDataBytesPerChunk - start;
++ nToWriteBack = dev->nDataBytesPerChunk;
++ }
++
++ if (nToCopy != dev->nDataBytesPerChunk || dev->inbandTags) {
++ /* An incomplete start or end chunk (or maybe both start and end chunk),
++ * or we're using inband tags, so we want to use the cache buffers.
++ */
++ if (dev->nShortOpCaches > 0) {
++ yaffs_ChunkCache *cache;
++ /* If we can't find the data in the cache, then load the cache */
++ cache = yaffs_FindChunkCache(in, chunk);
++
++ if (!cache
++ && yaffs_CheckSpaceForAllocation(in->
++ myDev)) {
++ cache = yaffs_GrabChunkCache(in->myDev);
++ cache->object = in;
++ cache->chunkId = chunk;
++ cache->dirty = 0;
++ cache->locked = 0;
++ yaffs_ReadChunkDataFromObject(in, chunk,
++ cache->
++ data);
++ } else if (cache &&
++ !cache->dirty &&
++ !yaffs_CheckSpaceForAllocation(in->myDev)) {
++ /* Drop the cache if it was a read cache item and
++ * no space check has been made for it.
++ */
++ cache = NULL;
++ }
++
++ if (cache) {
++ yaffs_UseChunkCache(dev, cache, 1);
++ cache->locked = 1;
++
++
++ memcpy(&cache->data[start], buffer,
++ nToCopy);
++
++
++ cache->locked = 0;
++ cache->nBytes = nToWriteBack;
++
++ if (writeThrough) {
++ chunkWritten =
++ yaffs_WriteChunkDataToObject
++ (cache->object,
++ cache->chunkId,
++ cache->data, cache->nBytes,
++ 1);
++ cache->dirty = 0;
++ }
++
++ } else {
++ chunkWritten = -1; /* fail the write */
++ }
++ } else {
++ /* An incomplete start or end chunk (or maybe both start and end chunk)
++ * Read into the local buffer then copy, then copy over and write back.
++ */
++
++ __u8 *localBuffer =
++ yaffs_GetTempBuffer(dev, __LINE__);
++
++ yaffs_ReadChunkDataFromObject(in, chunk,
++ localBuffer);
++
++
++
++ memcpy(&localBuffer[start], buffer, nToCopy);
++
++ chunkWritten =
++ yaffs_WriteChunkDataToObject(in, chunk,
++ localBuffer,
++ nToWriteBack,
++ 0);
++
++ yaffs_ReleaseTempBuffer(dev, localBuffer,
++ __LINE__);
++
++ }
++
++ } else {
++ /* A full chunk. Write directly from the supplied buffer. */
++
++
++
++ chunkWritten =
++ yaffs_WriteChunkDataToObject(in, chunk, buffer,
++ dev->nDataBytesPerChunk,
++ 0);
++
++ /* Since we've overwritten the cached data, we better invalidate it. */
++ yaffs_InvalidateChunkCache(in, chunk);
++ }
++
++ if (chunkWritten >= 0) {
++ n -= nToCopy;
++ offset += nToCopy;
++ buffer += nToCopy;
++ nDone += nToCopy;
++ }
++
++ }
++
++ /* Update file object */
++
++ if ((startOfWrite + nDone) > in->variant.fileVariant.fileSize)
++ in->variant.fileVariant.fileSize = (startOfWrite + nDone);
++
++ in->dirty = 1;
++
++ return nDone;
++}
++
++
++/* ---------------------- File resizing stuff ------------------ */
++
++static void yaffs_PruneResizedChunks(yaffs_Object *in, int newSize)
++{
++
++ yaffs_Device *dev = in->myDev;
++ int oldFileSize = in->variant.fileVariant.fileSize;
++
++ int lastDel = 1 + (oldFileSize - 1) / dev->nDataBytesPerChunk;
++
++ int startDel = 1 + (newSize + dev->nDataBytesPerChunk - 1) /
++ dev->nDataBytesPerChunk;
++ int i;
++ int chunkId;
++
++ /* Delete backwards so that we don't end up with holes if
++ * power is lost part-way through the operation.
++ */
++ for (i = lastDel; i >= startDel; i--) {
++ /* NB this could be optimised somewhat,
++ * eg. could retrieve the tags and write them without
++ * using yaffs_DeleteChunk
++ */
++
++ chunkId = yaffs_FindAndDeleteChunkInFile(in, i, NULL);
++ if (chunkId > 0) {
++ if (chunkId <
++ (dev->internalStartBlock * dev->nChunksPerBlock)
++ || chunkId >=
++ ((dev->internalEndBlock +
++ 1) * dev->nChunksPerBlock)) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("Found daft chunkId %d for %d" TENDSTR),
++ chunkId, i));
++ } else {
++ in->nDataChunks--;
++ yaffs_DeleteChunk(dev, chunkId, 1, __LINE__);
++ }
++ }
++ }
++
++}
++
++int yaffs_ResizeFile(yaffs_Object *in, loff_t newSize)
++{
++
++ int oldFileSize = in->variant.fileVariant.fileSize;
++ __u32 newSizeOfPartialChunk;
++ int newFullChunks;
++
++ yaffs_Device *dev = in->myDev;
++
++ yaffs_AddrToChunk(dev, newSize, &newFullChunks, &newSizeOfPartialChunk);
++
++ yaffs_FlushFilesChunkCache(in);
++ yaffs_InvalidateWholeChunkCache(in);
++
++ yaffs_CheckGarbageCollection(dev);
++
++ if (in->variantType != YAFFS_OBJECT_TYPE_FILE)
++ return YAFFS_FAIL;
++
++ if (newSize == oldFileSize)
++ return YAFFS_OK;
++
++ if (newSize < oldFileSize) {
++
++ yaffs_PruneResizedChunks(in, newSize);
++
++ if (newSizeOfPartialChunk != 0) {
++ int lastChunk = 1 + newFullChunks;
++
++ __u8 *localBuffer = yaffs_GetTempBuffer(dev, __LINE__);
++
++ /* Got to read and rewrite the last chunk with its new size and zero pad */
++ yaffs_ReadChunkDataFromObject(in, lastChunk,
++ localBuffer);
++
++ memset(localBuffer + newSizeOfPartialChunk, 0,
++ dev->nDataBytesPerChunk - newSizeOfPartialChunk);
++
++ yaffs_WriteChunkDataToObject(in, lastChunk, localBuffer,
++ newSizeOfPartialChunk, 1);
++
++ yaffs_ReleaseTempBuffer(dev, localBuffer, __LINE__);
++ }
++
++ in->variant.fileVariant.fileSize = newSize;
++
++ yaffs_PruneFileStructure(dev, &in->variant.fileVariant);
++ } else {
++ /* newsSize > oldFileSize */
++ in->variant.fileVariant.fileSize = newSize;
++ }
++
++
++ /* Write a new object header.
++ * show we've shrunk the file, if need be
++ * Do this only if the file is not in the deleted directories.
++ */
++ if (in->parent &&
++ in->parent->objectId != YAFFS_OBJECTID_UNLINKED &&
++ in->parent->objectId != YAFFS_OBJECTID_DELETED)
++ yaffs_UpdateObjectHeader(in, NULL, 0,
++ (newSize < oldFileSize) ? 1 : 0, 0);
++
++ return YAFFS_OK;
++}
++
++loff_t yaffs_GetFileSize(yaffs_Object *obj)
++{
++ obj = yaffs_GetEquivalentObject(obj);
++
++ switch (obj->variantType) {
++ case YAFFS_OBJECT_TYPE_FILE:
++ return obj->variant.fileVariant.fileSize;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ return yaffs_strlen(obj->variant.symLinkVariant.alias);
++ default:
++ return 0;
++ }
++}
++
++
++
++int yaffs_FlushFile(yaffs_Object *in, int updateTime)
++{
++ int retVal;
++ if (in->dirty) {
++ yaffs_FlushFilesChunkCache(in);
++ if (updateTime) {
++#ifdef CONFIG_YAFFS_WINCE
++ yfsd_WinFileTimeNow(in->win_mtime);
++#else
++
++ in->yst_mtime = Y_CURRENT_TIME;
++
++#endif
++ }
++
++ retVal = (yaffs_UpdateObjectHeader(in, NULL, 0, 0, 0) >=
++ 0) ? YAFFS_OK : YAFFS_FAIL;
++ } else {
++ retVal = YAFFS_OK;
++ }
++
++ return retVal;
++
++}
++
++static int yaffs_DoGenericObjectDeletion(yaffs_Object *in)
++{
++
++ /* First off, invalidate the file's data in the cache, without flushing. */
++ yaffs_InvalidateWholeChunkCache(in);
++
++ if (in->myDev->isYaffs2 && (in->parent != in->myDev->deletedDir)) {
++ /* Move to the unlinked directory so we have a record that it was deleted. */
++ yaffs_ChangeObjectName(in, in->myDev->deletedDir, _Y("deleted"), 0, 0);
++
++ }
++
++ yaffs_RemoveObjectFromDirectory(in);
++ yaffs_DeleteChunk(in->myDev, in->hdrChunk, 1, __LINE__);
++ in->hdrChunk = 0;
++
++ yaffs_FreeObject(in);
++ return YAFFS_OK;
++
++}
++
++/* yaffs_DeleteFile deletes the whole file data
++ * and the inode associated with the file.
++ * It does not delete the links associated with the file.
++ */
++static int yaffs_UnlinkFileIfNeeded(yaffs_Object *in)
++{
++
++ int retVal;
++ int immediateDeletion = 0;
++
++#ifdef __KERNEL__
++ if (!in->myInode)
++ immediateDeletion = 1;
++#else
++ if (in->inUse <= 0)
++ immediateDeletion = 1;
++#endif
++
++ if (immediateDeletion) {
++ retVal =
++ yaffs_ChangeObjectName(in, in->myDev->deletedDir,
++ _Y("deleted"), 0, 0);
++ T(YAFFS_TRACE_TRACING,
++ (TSTR("yaffs: immediate deletion of file %d" TENDSTR),
++ in->objectId));
++ in->deleted = 1;
++ in->myDev->nDeletedFiles++;
++ if (1 || in->myDev->isYaffs2)
++ yaffs_ResizeFile(in, 0);
++ yaffs_SoftDeleteFile(in);
++ } else {
++ retVal =
++ yaffs_ChangeObjectName(in, in->myDev->unlinkedDir,
++ _Y("unlinked"), 0, 0);
++ }
++
++
++ return retVal;
++}
++
++int yaffs_DeleteFile(yaffs_Object *in)
++{
++ int retVal = YAFFS_OK;
++ int deleted = in->deleted;
++
++ yaffs_ResizeFile(in, 0);
++
++ if (in->nDataChunks > 0) {
++ /* Use soft deletion if there is data in the file.
++ * That won't be the case if it has been resized to zero.
++ */
++ if (!in->unlinked)
++ retVal = yaffs_UnlinkFileIfNeeded(in);
++
++ if (retVal == YAFFS_OK && in->unlinked && !in->deleted) {
++ in->deleted = 1;
++ deleted = 1;
++ in->myDev->nDeletedFiles++;
++ yaffs_SoftDeleteFile(in);
++ }
++ return deleted ? YAFFS_OK : YAFFS_FAIL;
++ } else {
++ /* The file has no data chunks so we toss it immediately */
++ yaffs_FreeTnode(in->myDev, in->variant.fileVariant.top);
++ in->variant.fileVariant.top = NULL;
++ yaffs_DoGenericObjectDeletion(in);
++
++ return YAFFS_OK;
++ }
++}
++
++static int yaffs_DeleteDirectory(yaffs_Object *in)
++{
++ /* First check that the directory is empty. */
++ if (ylist_empty(&in->variant.directoryVariant.children))
++ return yaffs_DoGenericObjectDeletion(in);
++
++ return YAFFS_FAIL;
++
++}
++
++static int yaffs_DeleteSymLink(yaffs_Object *in)
++{
++ YFREE(in->variant.symLinkVariant.alias);
++
++ return yaffs_DoGenericObjectDeletion(in);
++}
++
++static int yaffs_DeleteHardLink(yaffs_Object *in)
++{
++ /* remove this hardlink from the list assocaited with the equivalent
++ * object
++ */
++ ylist_del_init(&in->hardLinks);
++ return yaffs_DoGenericObjectDeletion(in);
++}
++
++int yaffs_DeleteObject(yaffs_Object *obj)
++{
++int retVal = -1;
++ switch (obj->variantType) {
++ case YAFFS_OBJECT_TYPE_FILE:
++ retVal = yaffs_DeleteFile(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ return yaffs_DeleteDirectory(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ retVal = yaffs_DeleteSymLink(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ retVal = yaffs_DeleteHardLink(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ retVal = yaffs_DoGenericObjectDeletion(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ retVal = 0;
++ break; /* should not happen. */
++ }
++
++ return retVal;
++}
++
++static int yaffs_UnlinkWorker(yaffs_Object *obj)
++{
++
++ int immediateDeletion = 0;
++
++#ifdef __KERNEL__
++ if (!obj->myInode)
++ immediateDeletion = 1;
++#else
++ if (obj->inUse <= 0)
++ immediateDeletion = 1;
++#endif
++
++ if (obj->variantType == YAFFS_OBJECT_TYPE_HARDLINK) {
++ return yaffs_DeleteHardLink(obj);
++ } else if (!ylist_empty(&obj->hardLinks)) {
++ /* Curve ball: We're unlinking an object that has a hardlink.
++ *
++ * This problem arises because we are not strictly following
++ * The Linux link/inode model.
++ *
++ * We can't really delete the object.
++ * Instead, we do the following:
++ * - Select a hardlink.
++ * - Unhook it from the hard links
++ * - Unhook it from its parent directory (so that the rename can work)
++ * - Rename the object to the hardlink's name.
++ * - Delete the hardlink
++ */
++
++ yaffs_Object *hl;
++ int retVal;
++ YCHAR name[YAFFS_MAX_NAME_LENGTH + 1];
++
++ hl = ylist_entry(obj->hardLinks.next, yaffs_Object, hardLinks);
++
++ ylist_del_init(&hl->hardLinks);
++ ylist_del_init(&hl->siblings);
++
++ yaffs_GetObjectName(hl, name, YAFFS_MAX_NAME_LENGTH + 1);
++
++ retVal = yaffs_ChangeObjectName(obj, hl->parent, name, 0, 0);
++
++ if (retVal == YAFFS_OK)
++ retVal = yaffs_DoGenericObjectDeletion(hl);
++
++ return retVal;
++
++ } else if (immediateDeletion) {
++ switch (obj->variantType) {
++ case YAFFS_OBJECT_TYPE_FILE:
++ return yaffs_DeleteFile(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ return yaffs_DeleteDirectory(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ return yaffs_DeleteSymLink(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ return yaffs_DoGenericObjectDeletion(obj);
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ default:
++ return YAFFS_FAIL;
++ }
++ } else
++ return yaffs_ChangeObjectName(obj, obj->myDev->unlinkedDir,
++ _Y("unlinked"), 0, 0);
++}
++
++
++static int yaffs_UnlinkObject(yaffs_Object *obj)
++{
++
++ if (obj && obj->unlinkAllowed)
++ return yaffs_UnlinkWorker(obj);
++
++ return YAFFS_FAIL;
++
++}
++int yaffs_Unlink(yaffs_Object *dir, const YCHAR *name)
++{
++ yaffs_Object *obj;
++
++ obj = yaffs_FindObjectByName(dir, name);
++ return yaffs_UnlinkObject(obj);
++}
++
++/*----------------------- Initialisation Scanning ---------------------- */
++
++static void yaffs_HandleShadowedObject(yaffs_Device *dev, int objId,
++ int backwardScanning)
++{
++ yaffs_Object *obj;
++
++ if (!backwardScanning) {
++ /* Handle YAFFS1 forward scanning case
++ * For YAFFS1 we always do the deletion
++ */
++
++ } else {
++ /* Handle YAFFS2 case (backward scanning)
++ * If the shadowed object exists then ignore.
++ */
++ if (yaffs_FindObjectByNumber(dev, objId))
++ return;
++ }
++
++ /* Let's create it (if it does not exist) assuming it is a file so that it can do shrinking etc.
++ * We put it in unlinked dir to be cleaned up after the scanning
++ */
++ obj =
++ yaffs_FindOrCreateObjectByNumber(dev, objId,
++ YAFFS_OBJECT_TYPE_FILE);
++ if (!obj)
++ return;
++ yaffs_AddObjectToDirectory(dev->unlinkedDir, obj);
++ obj->variant.fileVariant.shrinkSize = 0;
++ obj->valid = 1; /* So that we don't read any other info for this file */
++
++}
++
++typedef struct {
++ int seq;
++ int block;
++} yaffs_BlockIndex;
++
++
++static void yaffs_HardlinkFixup(yaffs_Device *dev, yaffs_Object *hardList)
++{
++ yaffs_Object *hl;
++ yaffs_Object *in;
++
++ while (hardList) {
++ hl = hardList;
++ hardList = (yaffs_Object *) (hardList->hardLinks.next);
++
++ in = yaffs_FindObjectByNumber(dev,
++ hl->variant.hardLinkVariant.
++ equivalentObjectId);
++
++ if (in) {
++ /* Add the hardlink pointers */
++ hl->variant.hardLinkVariant.equivalentObject = in;
++ ylist_add(&hl->hardLinks, &in->hardLinks);
++ } else {
++ /* Todo Need to report/handle this better.
++ * Got a problem... hardlink to a non-existant object
++ */
++ hl->variant.hardLinkVariant.equivalentObject = NULL;
++ YINIT_LIST_HEAD(&hl->hardLinks);
++
++ }
++ }
++}
++
++
++
++
++
++static int ybicmp(const void *a, const void *b)
++{
++ register int aseq = ((yaffs_BlockIndex *)a)->seq;
++ register int bseq = ((yaffs_BlockIndex *)b)->seq;
++ register int ablock = ((yaffs_BlockIndex *)a)->block;
++ register int bblock = ((yaffs_BlockIndex *)b)->block;
++ if (aseq == bseq)
++ return ablock - bblock;
++ else
++ return aseq - bseq;
++}
++
++
++struct yaffs_ShadowFixerStruct {
++ int objectId;
++ int shadowedId;
++ struct yaffs_ShadowFixerStruct *next;
++};
++
++
++static void yaffs_StripDeletedObjects(yaffs_Device *dev)
++{
++ /*
++ * Sort out state of unlinked and deleted objects after scanning.
++ */
++ struct ylist_head *i;
++ struct ylist_head *n;
++ yaffs_Object *l;
++
++ /* Soft delete all the unlinked files */
++ ylist_for_each_safe(i, n,
++ &dev->unlinkedDir->variant.directoryVariant.children) {
++ if (i) {
++ l = ylist_entry(i, yaffs_Object, siblings);
++ yaffs_DeleteObject(l);
++ }
++ }
++
++ ylist_for_each_safe(i, n,
++ &dev->deletedDir->variant.directoryVariant.children) {
++ if (i) {
++ l = ylist_entry(i, yaffs_Object, siblings);
++ yaffs_DeleteObject(l);
++ }
++ }
++
++}
++
++static int yaffs_Scan(yaffs_Device *dev)
++{
++ yaffs_ExtendedTags tags;
++ int blk;
++ int blockIterator;
++ int startIterator;
++ int endIterator;
++ int result;
++
++ int chunk;
++ int c;
++ int deleted;
++ yaffs_BlockState state;
++ yaffs_Object *hardList = NULL;
++ yaffs_BlockInfo *bi;
++ __u32 sequenceNumber;
++ yaffs_ObjectHeader *oh;
++ yaffs_Object *in;
++ yaffs_Object *parent;
++
++ int alloc_failed = 0;
++
++ struct yaffs_ShadowFixerStruct *shadowFixerList = NULL;
++
++
++ __u8 *chunkData;
++
++
++
++ T(YAFFS_TRACE_SCAN,
++ (TSTR("yaffs_Scan starts intstartblk %d intendblk %d..." TENDSTR),
++ dev->internalStartBlock, dev->internalEndBlock));
++
++ chunkData = yaffs_GetTempBuffer(dev, __LINE__);
++
++ dev->sequenceNumber = YAFFS_LOWEST_SEQUENCE_NUMBER;
++
++ /* Scan all the blocks to determine their state */
++ for (blk = dev->internalStartBlock; blk <= dev->internalEndBlock; blk++) {
++ bi = yaffs_GetBlockInfo(dev, blk);
++ yaffs_ClearChunkBits(dev, blk);
++ bi->pagesInUse = 0;
++ bi->softDeletions = 0;
++
++ yaffs_QueryInitialBlockState(dev, blk, &state, &sequenceNumber);
++
++ bi->blockState = state;
++ bi->sequenceNumber = sequenceNumber;
++
++ if (bi->sequenceNumber == YAFFS_SEQUENCE_BAD_BLOCK)
++ bi->blockState = state = YAFFS_BLOCK_STATE_DEAD;
++
++ T(YAFFS_TRACE_SCAN_DEBUG,
++ (TSTR("Block scanning block %d state %d seq %d" TENDSTR), blk,
++ state, sequenceNumber));
++
++ if (state == YAFFS_BLOCK_STATE_DEAD) {
++ T(YAFFS_TRACE_BAD_BLOCKS,
++ (TSTR("block %d is bad" TENDSTR), blk));
++ } else if (state == YAFFS_BLOCK_STATE_EMPTY) {
++ T(YAFFS_TRACE_SCAN_DEBUG,
++ (TSTR("Block empty " TENDSTR)));
++ dev->nErasedBlocks++;
++ dev->nFreeChunks += dev->nChunksPerBlock;
++ }
++ }
++
++ startIterator = dev->internalStartBlock;
++ endIterator = dev->internalEndBlock;
++
++ /* For each block.... */
++ for (blockIterator = startIterator; !alloc_failed && blockIterator <= endIterator;
++ blockIterator++) {
++
++ YYIELD();
++
++ YYIELD();
++
++ blk = blockIterator;
++
++ bi = yaffs_GetBlockInfo(dev, blk);
++ state = bi->blockState;
++
++ deleted = 0;
++
++ /* For each chunk in each block that needs scanning....*/
++ for (c = 0; !alloc_failed && c < dev->nChunksPerBlock &&
++ state == YAFFS_BLOCK_STATE_NEEDS_SCANNING; c++) {
++ /* Read the tags and decide what to do */
++ chunk = blk * dev->nChunksPerBlock + c;
++
++ result = yaffs_ReadChunkWithTagsFromNAND(dev, chunk, NULL,
++ &tags);
++
++ /* Let's have a good look at this chunk... */
++
++ if (tags.eccResult == YAFFS_ECC_RESULT_UNFIXED || tags.chunkDeleted) {
++ /* YAFFS1 only...
++ * A deleted chunk
++ */
++ deleted++;
++ dev->nFreeChunks++;
++ /*T((" %d %d deleted\n",blk,c)); */
++ } else if (!tags.chunkUsed) {
++ /* An unassigned chunk in the block
++ * This means that either the block is empty or
++ * this is the one being allocated from
++ */
++
++ if (c == 0) {
++ /* We're looking at the first chunk in the block so the block is unused */
++ state = YAFFS_BLOCK_STATE_EMPTY;
++ dev->nErasedBlocks++;
++ } else {
++ /* this is the block being allocated from */
++ T(YAFFS_TRACE_SCAN,
++ (TSTR
++ (" Allocating from %d %d" TENDSTR),
++ blk, c));
++ state = YAFFS_BLOCK_STATE_ALLOCATING;
++ dev->allocationBlock = blk;
++ dev->allocationPage = c;
++ dev->allocationBlockFinder = blk;
++ /* Set it to here to encourage the allocator to go forth from here. */
++
++ }
++
++ dev->nFreeChunks += (dev->nChunksPerBlock - c);
++ } else if (tags.chunkId > 0) {
++ /* chunkId > 0 so it is a data chunk... */
++ unsigned int endpos;
++
++ yaffs_SetChunkBit(dev, blk, c);
++ bi->pagesInUse++;
++
++ in = yaffs_FindOrCreateObjectByNumber(dev,
++ tags.
++ objectId,
++ YAFFS_OBJECT_TYPE_FILE);
++ /* PutChunkIntoFile checks for a clash (two data chunks with
++ * the same chunkId).
++ */
++
++ if (!in)
++ alloc_failed = 1;
++
++ if (in) {
++ if (!yaffs_PutChunkIntoFile(in, tags.chunkId, chunk, 1))
++ alloc_failed = 1;
++ }
++
++ endpos =
++ (tags.chunkId - 1) * dev->nDataBytesPerChunk +
++ tags.byteCount;
++ if (in &&
++ in->variantType == YAFFS_OBJECT_TYPE_FILE
++ && in->variant.fileVariant.scannedFileSize <
++ endpos) {
++ in->variant.fileVariant.
++ scannedFileSize = endpos;
++ if (!dev->useHeaderFileSize) {
++ in->variant.fileVariant.
++ fileSize =
++ in->variant.fileVariant.
++ scannedFileSize;
++ }
++
++ }
++ /* T((" %d %d data %d %d\n",blk,c,tags.objectId,tags.chunkId)); */
++ } else {
++ /* chunkId == 0, so it is an ObjectHeader.
++ * Thus, we read in the object header and make the object
++ */
++ yaffs_SetChunkBit(dev, blk, c);
++ bi->pagesInUse++;
++
++ result = yaffs_ReadChunkWithTagsFromNAND(dev, chunk,
++ chunkData,
++ NULL);
++
++ oh = (yaffs_ObjectHeader *) chunkData;
++
++ in = yaffs_FindObjectByNumber(dev,
++ tags.objectId);
++ if (in && in->variantType != oh->type) {
++ /* This should not happen, but somehow
++ * Wev'e ended up with an objectId that has been reused but not yet
++ * deleted, and worse still it has changed type. Delete the old object.
++ */
++
++ yaffs_DeleteObject(in);
++
++ in = 0;
++ }
++
++ in = yaffs_FindOrCreateObjectByNumber(dev,
++ tags.
++ objectId,
++ oh->type);
++
++ if (!in)
++ alloc_failed = 1;
++
++ if (in && oh->shadowsObject > 0) {
++
++ struct yaffs_ShadowFixerStruct *fixer;
++ fixer = YMALLOC(sizeof(struct yaffs_ShadowFixerStruct));
++ if (fixer) {
++ fixer->next = shadowFixerList;
++ shadowFixerList = fixer;
++ fixer->objectId = tags.objectId;
++ fixer->shadowedId = oh->shadowsObject;
++ }
++
++ }
++
++ if (in && in->valid) {
++ /* We have already filled this one. We have a duplicate and need to resolve it. */
++
++ unsigned existingSerial = in->serial;
++ unsigned newSerial = tags.serialNumber;
++
++ if (((existingSerial + 1) & 3) == newSerial) {
++ /* Use new one - destroy the exisiting one */
++ yaffs_DeleteChunk(dev,
++ in->hdrChunk,
++ 1, __LINE__);
++ in->valid = 0;
++ } else {
++ /* Use existing - destroy this one. */
++ yaffs_DeleteChunk(dev, chunk, 1,
++ __LINE__);
++ }
++ }
++
++ if (in && !in->valid &&
++ (tags.objectId == YAFFS_OBJECTID_ROOT ||
++ tags.objectId == YAFFS_OBJECTID_LOSTNFOUND)) {
++ /* We only load some info, don't fiddle with directory structure */
++ in->valid = 1;
++ in->variantType = oh->type;
++
++ in->yst_mode = oh->yst_mode;
++#ifdef CONFIG_YAFFS_WINCE
++ in->win_atime[0] = oh->win_atime[0];
++ in->win_ctime[0] = oh->win_ctime[0];
++ in->win_mtime[0] = oh->win_mtime[0];
++ in->win_atime[1] = oh->win_atime[1];
++ in->win_ctime[1] = oh->win_ctime[1];
++ in->win_mtime[1] = oh->win_mtime[1];
++#else
++ in->yst_uid = oh->yst_uid;
++ in->yst_gid = oh->yst_gid;
++ in->yst_atime = oh->yst_atime;
++ in->yst_mtime = oh->yst_mtime;
++ in->yst_ctime = oh->yst_ctime;
++ in->yst_rdev = oh->yst_rdev;
++#endif
++ in->hdrChunk = chunk;
++ in->serial = tags.serialNumber;
++
++ } else if (in && !in->valid) {
++ /* we need to load this info */
++
++ in->valid = 1;
++ in->variantType = oh->type;
++
++ in->yst_mode = oh->yst_mode;
++#ifdef CONFIG_YAFFS_WINCE
++ in->win_atime[0] = oh->win_atime[0];
++ in->win_ctime[0] = oh->win_ctime[0];
++ in->win_mtime[0] = oh->win_mtime[0];
++ in->win_atime[1] = oh->win_atime[1];
++ in->win_ctime[1] = oh->win_ctime[1];
++ in->win_mtime[1] = oh->win_mtime[1];
++#else
++ in->yst_uid = oh->yst_uid;
++ in->yst_gid = oh->yst_gid;
++ in->yst_atime = oh->yst_atime;
++ in->yst_mtime = oh->yst_mtime;
++ in->yst_ctime = oh->yst_ctime;
++ in->yst_rdev = oh->yst_rdev;
++#endif
++ in->hdrChunk = chunk;
++ in->serial = tags.serialNumber;
++
++ yaffs_SetObjectName(in, oh->name);
++ in->dirty = 0;
++
++ /* directory stuff...
++ * hook up to parent
++ */
++
++ parent =
++ yaffs_FindOrCreateObjectByNumber
++ (dev, oh->parentObjectId,
++ YAFFS_OBJECT_TYPE_DIRECTORY);
++ if (!parent)
++ alloc_failed = 1;
++ if (parent && parent->variantType ==
++ YAFFS_OBJECT_TYPE_UNKNOWN) {
++ /* Set up as a directory */
++ parent->variantType =
++ YAFFS_OBJECT_TYPE_DIRECTORY;
++ YINIT_LIST_HEAD(&parent->variant.
++ directoryVariant.
++ children);
++ } else if (!parent || parent->variantType !=
++ YAFFS_OBJECT_TYPE_DIRECTORY) {
++ /* Hoosterman, another problem....
++ * We're trying to use a non-directory as a directory
++ */
++
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("yaffs tragedy: attempting to use non-directory as a directory in scan. Put in lost+found."
++ TENDSTR)));
++ parent = dev->lostNFoundDir;
++ }
++
++ yaffs_AddObjectToDirectory(parent, in);
++
++ if (0 && (parent == dev->deletedDir ||
++ parent == dev->unlinkedDir)) {
++ in->deleted = 1; /* If it is unlinked at start up then it wants deleting */
++ dev->nDeletedFiles++;
++ }
++ /* Note re hardlinks.
++ * Since we might scan a hardlink before its equivalent object is scanned
++ * we put them all in a list.
++ * After scanning is complete, we should have all the objects, so we run through this
++ * list and fix up all the chains.
++ */
++
++ switch (in->variantType) {
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ /* Todo got a problem */
++ break;
++ case YAFFS_OBJECT_TYPE_FILE:
++ if (dev->useHeaderFileSize)
++
++ in->variant.fileVariant.
++ fileSize =
++ oh->fileSize;
++
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ in->variant.hardLinkVariant.
++ equivalentObjectId =
++ oh->equivalentObjectId;
++ in->hardLinks.next =
++ (struct ylist_head *)
++ hardList;
++ hardList = in;
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ /* Do nothing */
++ break;
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ /* Do nothing */
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ in->variant.symLinkVariant.alias =
++ yaffs_CloneString(oh->alias);
++ if (!in->variant.symLinkVariant.alias)
++ alloc_failed = 1;
++ break;
++ }
++
++/*
++ if (parent == dev->deletedDir) {
++ yaffs_DestroyObject(in);
++ bi->hasShrinkHeader = 1;
++ }
++*/
++ }
++ }
++ }
++
++ if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING) {
++ /* If we got this far while scanning, then the block is fully allocated.*/
++ state = YAFFS_BLOCK_STATE_FULL;
++ }
++
++ bi->blockState = state;
++
++ /* Now let's see if it was dirty */
++ if (bi->pagesInUse == 0 &&
++ !bi->hasShrinkHeader &&
++ bi->blockState == YAFFS_BLOCK_STATE_FULL) {
++ yaffs_BlockBecameDirty(dev, blk);
++ }
++
++ }
++
++
++ /* Ok, we've done all the scanning.
++ * Fix up the hard link chains.
++ * We should now have scanned all the objects, now it's time to add these
++ * hardlinks.
++ */
++
++ yaffs_HardlinkFixup(dev, hardList);
++
++ /* Fix up any shadowed objects */
++ {
++ struct yaffs_ShadowFixerStruct *fixer;
++ yaffs_Object *obj;
++
++ while (shadowFixerList) {
++ fixer = shadowFixerList;
++ shadowFixerList = fixer->next;
++ /* Complete the rename transaction by deleting the shadowed object
++ * then setting the object header to unshadowed.
++ */
++ obj = yaffs_FindObjectByNumber(dev, fixer->shadowedId);
++ if (obj)
++ yaffs_DeleteObject(obj);
++
++ obj = yaffs_FindObjectByNumber(dev, fixer->objectId);
++
++ if (obj)
++ yaffs_UpdateObjectHeader(obj, NULL, 1, 0, 0);
++
++ YFREE(fixer);
++ }
++ }
++
++ yaffs_ReleaseTempBuffer(dev, chunkData, __LINE__);
++
++ if (alloc_failed)
++ return YAFFS_FAIL;
++
++ T(YAFFS_TRACE_SCAN, (TSTR("yaffs_Scan ends" TENDSTR)));
++
++
++ return YAFFS_OK;
++}
++
++static void yaffs_CheckObjectDetailsLoaded(yaffs_Object *in)
++{
++ __u8 *chunkData;
++ yaffs_ObjectHeader *oh;
++ yaffs_Device *dev;
++ yaffs_ExtendedTags tags;
++ int result;
++ int alloc_failed = 0;
++
++ if (!in)
++ return;
++
++ dev = in->myDev;
++
++#if 0
++ T(YAFFS_TRACE_SCAN, (TSTR("details for object %d %s loaded" TENDSTR),
++ in->objectId,
++ in->lazyLoaded ? "not yet" : "already"));
++#endif
++
++ if (in->lazyLoaded && in->hdrChunk > 0) {
++ in->lazyLoaded = 0;
++ chunkData = yaffs_GetTempBuffer(dev, __LINE__);
++
++ result = yaffs_ReadChunkWithTagsFromNAND(dev, in->hdrChunk, chunkData, &tags);
++ oh = (yaffs_ObjectHeader *) chunkData;
++
++ in->yst_mode = oh->yst_mode;
++#ifdef CONFIG_YAFFS_WINCE
++ in->win_atime[0] = oh->win_atime[0];
++ in->win_ctime[0] = oh->win_ctime[0];
++ in->win_mtime[0] = oh->win_mtime[0];
++ in->win_atime[1] = oh->win_atime[1];
++ in->win_ctime[1] = oh->win_ctime[1];
++ in->win_mtime[1] = oh->win_mtime[1];
++#else
++ in->yst_uid = oh->yst_uid;
++ in->yst_gid = oh->yst_gid;
++ in->yst_atime = oh->yst_atime;
++ in->yst_mtime = oh->yst_mtime;
++ in->yst_ctime = oh->yst_ctime;
++ in->yst_rdev = oh->yst_rdev;
++
++#endif
++ yaffs_SetObjectName(in, oh->name);
++
++ if (in->variantType == YAFFS_OBJECT_TYPE_SYMLINK) {
++ in->variant.symLinkVariant.alias =
++ yaffs_CloneString(oh->alias);
++ if (!in->variant.symLinkVariant.alias)
++ alloc_failed = 1; /* Not returned to caller */
++ }
++
++ yaffs_ReleaseTempBuffer(dev, chunkData, __LINE__);
++ }
++}
++
++static int yaffs_ScanBackwards(yaffs_Device *dev)
++{
++ yaffs_ExtendedTags tags;
++ int blk;
++ int blockIterator;
++ int startIterator;
++ int endIterator;
++ int nBlocksToScan = 0;
++
++ int chunk;
++ int result;
++ int c;
++ int deleted;
++ yaffs_BlockState state;
++ yaffs_Object *hardList = NULL;
++ yaffs_BlockInfo *bi;
++ __u32 sequenceNumber;
++ yaffs_ObjectHeader *oh;
++ yaffs_Object *in;
++ yaffs_Object *parent;
++ int nBlocks = dev->internalEndBlock - dev->internalStartBlock + 1;
++ int itsUnlinked;
++ __u8 *chunkData;
++
++ int fileSize;
++ int isShrink;
++ int foundChunksInBlock;
++ int equivalentObjectId;
++ int alloc_failed = 0;
++
++
++ yaffs_BlockIndex *blockIndex = NULL;
++ int altBlockIndex = 0;
++
++ if (!dev->isYaffs2) {
++ T(YAFFS_TRACE_SCAN,
++ (TSTR("yaffs_ScanBackwards is only for YAFFS2!" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ T(YAFFS_TRACE_SCAN,
++ (TSTR
++ ("yaffs_ScanBackwards starts intstartblk %d intendblk %d..."
++ TENDSTR), dev->internalStartBlock, dev->internalEndBlock));
++
++
++ dev->sequenceNumber = YAFFS_LOWEST_SEQUENCE_NUMBER;
++
++ blockIndex = YMALLOC(nBlocks * sizeof(yaffs_BlockIndex));
++
++ if (!blockIndex) {
++ blockIndex = YMALLOC_ALT(nBlocks * sizeof(yaffs_BlockIndex));
++ altBlockIndex = 1;
++ }
++
++ if (!blockIndex) {
++ T(YAFFS_TRACE_SCAN,
++ (TSTR("yaffs_Scan() could not allocate block index!" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ dev->blocksInCheckpoint = 0;
++
++ chunkData = yaffs_GetTempBuffer(dev, __LINE__);
++
++ /* Scan all the blocks to determine their state */
++ for (blk = dev->internalStartBlock; blk <= dev->internalEndBlock; blk++) {
++ bi = yaffs_GetBlockInfo(dev, blk);
++ yaffs_ClearChunkBits(dev, blk);
++ bi->pagesInUse = 0;
++ bi->softDeletions = 0;
++
++ yaffs_QueryInitialBlockState(dev, blk, &state, &sequenceNumber);
++
++ bi->blockState = state;
++ bi->sequenceNumber = sequenceNumber;
++
++ if (bi->sequenceNumber == YAFFS_SEQUENCE_CHECKPOINT_DATA)
++ bi->blockState = state = YAFFS_BLOCK_STATE_CHECKPOINT;
++ if (bi->sequenceNumber == YAFFS_SEQUENCE_BAD_BLOCK)
++ bi->blockState = state = YAFFS_BLOCK_STATE_DEAD;
++
++ T(YAFFS_TRACE_SCAN_DEBUG,
++ (TSTR("Block scanning block %d state %d seq %d" TENDSTR), blk,
++ state, sequenceNumber));
++
++
++ if (state == YAFFS_BLOCK_STATE_CHECKPOINT) {
++ dev->blocksInCheckpoint++;
++
++ } else if (state == YAFFS_BLOCK_STATE_DEAD) {
++ T(YAFFS_TRACE_BAD_BLOCKS,
++ (TSTR("block %d is bad" TENDSTR), blk));
++ } else if (state == YAFFS_BLOCK_STATE_EMPTY) {
++ T(YAFFS_TRACE_SCAN_DEBUG,
++ (TSTR("Block empty " TENDSTR)));
++ dev->nErasedBlocks++;
++ dev->nFreeChunks += dev->nChunksPerBlock;
++ } else if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING) {
++
++ /* Determine the highest sequence number */
++ if (sequenceNumber >= YAFFS_LOWEST_SEQUENCE_NUMBER &&
++ sequenceNumber < YAFFS_HIGHEST_SEQUENCE_NUMBER) {
++
++ blockIndex[nBlocksToScan].seq = sequenceNumber;
++ blockIndex[nBlocksToScan].block = blk;
++
++ nBlocksToScan++;
++
++ if (sequenceNumber >= dev->sequenceNumber)
++ dev->sequenceNumber = sequenceNumber;
++ } else {
++ /* TODO: Nasty sequence number! */
++ T(YAFFS_TRACE_SCAN,
++ (TSTR
++ ("Block scanning block %d has bad sequence number %d"
++ TENDSTR), blk, sequenceNumber));
++
++ }
++ }
++ }
++
++ T(YAFFS_TRACE_SCAN,
++ (TSTR("%d blocks to be sorted..." TENDSTR), nBlocksToScan));
++
++
++
++ YYIELD();
++
++ /* Sort the blocks */
++#ifndef CONFIG_YAFFS_USE_OWN_SORT
++ {
++ /* Use qsort now. */
++ yaffs_qsort(blockIndex, nBlocksToScan, sizeof(yaffs_BlockIndex), ybicmp);
++ }
++#else
++ {
++ /* Dungy old bubble sort... */
++
++ yaffs_BlockIndex temp;
++ int i;
++ int j;
++
++ for (i = 0; i < nBlocksToScan; i++)
++ for (j = i + 1; j < nBlocksToScan; j++)
++ if (blockIndex[i].seq > blockIndex[j].seq) {
++ temp = blockIndex[j];
++ blockIndex[j] = blockIndex[i];
++ blockIndex[i] = temp;
++ }
++ }
++#endif
++
++ YYIELD();
++
++ T(YAFFS_TRACE_SCAN, (TSTR("...done" TENDSTR)));
++
++ /* Now scan the blocks looking at the data. */
++ startIterator = 0;
++ endIterator = nBlocksToScan - 1;
++ T(YAFFS_TRACE_SCAN_DEBUG,
++ (TSTR("%d blocks to be scanned" TENDSTR), nBlocksToScan));
++
++ /* For each block.... backwards */
++ for (blockIterator = endIterator; !alloc_failed && blockIterator >= startIterator;
++ blockIterator--) {
++ /* Cooperative multitasking! This loop can run for so
++ long that watchdog timers expire. */
++ YYIELD();
++
++ /* get the block to scan in the correct order */
++ blk = blockIndex[blockIterator].block;
++
++ bi = yaffs_GetBlockInfo(dev, blk);
++
++
++ state = bi->blockState;
++
++ deleted = 0;
++
++ /* For each chunk in each block that needs scanning.... */
++ foundChunksInBlock = 0;
++ for (c = dev->nChunksPerBlock - 1;
++ !alloc_failed && c >= 0 &&
++ (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING ||
++ state == YAFFS_BLOCK_STATE_ALLOCATING); c--) {
++ /* Scan backwards...
++ * Read the tags and decide what to do
++ */
++
++ chunk = blk * dev->nChunksPerBlock + c;
++
++ result = yaffs_ReadChunkWithTagsFromNAND(dev, chunk, NULL,
++ &tags);
++
++ /* Let's have a good look at this chunk... */
++
++ if (!tags.chunkUsed) {
++ /* An unassigned chunk in the block.
++ * If there are used chunks after this one, then
++ * it is a chunk that was skipped due to failing the erased
++ * check. Just skip it so that it can be deleted.
++ * But, more typically, We get here when this is an unallocated
++ * chunk and his means that either the block is empty or
++ * this is the one being allocated from
++ */
++
++ if (foundChunksInBlock) {
++ /* This is a chunk that was skipped due to failing the erased check */
++ } else if (c == 0) {
++ /* We're looking at the first chunk in the block so the block is unused */
++ state = YAFFS_BLOCK_STATE_EMPTY;
++ dev->nErasedBlocks++;
++ } else {
++ if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING ||
++ state == YAFFS_BLOCK_STATE_ALLOCATING) {
++ if (dev->sequenceNumber == bi->sequenceNumber) {
++ /* this is the block being allocated from */
++
++ T(YAFFS_TRACE_SCAN,
++ (TSTR
++ (" Allocating from %d %d"
++ TENDSTR), blk, c));
++
++ state = YAFFS_BLOCK_STATE_ALLOCATING;
++ dev->allocationBlock = blk;
++ dev->allocationPage = c;
++ dev->allocationBlockFinder = blk;
++ } else {
++ /* This is a partially written block that is not
++ * the current allocation block. This block must have
++ * had a write failure, so set up for retirement.
++ */
++
++ /* bi->needsRetiring = 1; ??? TODO */
++ bi->gcPrioritise = 1;
++
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("Partially written block %d detected" TENDSTR),
++ blk));
++ }
++ }
++ }
++
++ dev->nFreeChunks++;
++
++ } else if (tags.eccResult == YAFFS_ECC_RESULT_UNFIXED) {
++ T(YAFFS_TRACE_SCAN,
++ (TSTR(" Unfixed ECC in chunk(%d:%d), chunk ignored"TENDSTR),
++ blk, c));
++
++ dev->nFreeChunks++;
++
++ } else if (tags.chunkId > 0) {
++ /* chunkId > 0 so it is a data chunk... */
++ unsigned int endpos;
++ __u32 chunkBase =
++ (tags.chunkId - 1) * dev->nDataBytesPerChunk;
++
++ foundChunksInBlock = 1;
++
++
++ yaffs_SetChunkBit(dev, blk, c);
++ bi->pagesInUse++;
++
++ in = yaffs_FindOrCreateObjectByNumber(dev,
++ tags.
++ objectId,
++ YAFFS_OBJECT_TYPE_FILE);
++ if (!in) {
++ /* Out of memory */
++ alloc_failed = 1;
++ }
++
++ if (in &&
++ in->variantType == YAFFS_OBJECT_TYPE_FILE
++ && chunkBase <
++ in->variant.fileVariant.shrinkSize) {
++ /* This has not been invalidated by a resize */
++ if (!yaffs_PutChunkIntoFile(in, tags.chunkId,
++ chunk, -1)) {
++ alloc_failed = 1;
++ }
++
++ /* File size is calculated by looking at the data chunks if we have not
++ * seen an object header yet. Stop this practice once we find an object header.
++ */
++ endpos =
++ (tags.chunkId -
++ 1) * dev->nDataBytesPerChunk +
++ tags.byteCount;
++
++ if (!in->valid && /* have not got an object header yet */
++ in->variant.fileVariant.
++ scannedFileSize < endpos) {
++ in->variant.fileVariant.
++ scannedFileSize = endpos;
++ in->variant.fileVariant.
++ fileSize =
++ in->variant.fileVariant.
++ scannedFileSize;
++ }
++
++ } else if (in) {
++ /* This chunk has been invalidated by a resize, so delete */
++ yaffs_DeleteChunk(dev, chunk, 1, __LINE__);
++
++ }
++ } else {
++ /* chunkId == 0, so it is an ObjectHeader.
++ * Thus, we read in the object header and make the object
++ */
++ foundChunksInBlock = 1;
++
++ yaffs_SetChunkBit(dev, blk, c);
++ bi->pagesInUse++;
++
++ oh = NULL;
++ in = NULL;
++
++ if (tags.extraHeaderInfoAvailable) {
++ in = yaffs_FindOrCreateObjectByNumber
++ (dev, tags.objectId,
++ tags.extraObjectType);
++ if (!in)
++ alloc_failed = 1;
++ }
++
++ if (!in ||
++#ifdef CONFIG_YAFFS_DISABLE_LAZY_LOAD
++ !in->valid ||
++#endif
++ tags.extraShadows ||
++ (!in->valid &&
++ (tags.objectId == YAFFS_OBJECTID_ROOT ||
++ tags.objectId == YAFFS_OBJECTID_LOSTNFOUND))) {
++
++ /* If we don't have valid info then we need to read the chunk
++ * TODO In future we can probably defer reading the chunk and
++ * living with invalid data until needed.
++ */
++
++ result = yaffs_ReadChunkWithTagsFromNAND(dev,
++ chunk,
++ chunkData,
++ NULL);
++
++ oh = (yaffs_ObjectHeader *) chunkData;
++
++ if (dev->inbandTags) {
++ /* Fix up the header if they got corrupted by inband tags */
++ oh->shadowsObject = oh->inbandShadowsObject;
++ oh->isShrink = oh->inbandIsShrink;
++ }
++
++ if (!in) {
++ in = yaffs_FindOrCreateObjectByNumber(dev, tags.objectId, oh->type);
++ if (!in)
++ alloc_failed = 1;
++ }
++
++ }
++
++ if (!in) {
++ /* TODO Hoosterman we have a problem! */
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("yaffs tragedy: Could not make object for object %d at chunk %d during scan"
++ TENDSTR), tags.objectId, chunk));
++ continue;
++ }
++
++ if (in->valid) {
++ /* We have already filled this one.
++ * We have a duplicate that will be discarded, but
++ * we first have to suck out resize info if it is a file.
++ */
++
++ if ((in->variantType == YAFFS_OBJECT_TYPE_FILE) &&
++ ((oh &&
++ oh->type == YAFFS_OBJECT_TYPE_FILE) ||
++ (tags.extraHeaderInfoAvailable &&
++ tags.extraObjectType == YAFFS_OBJECT_TYPE_FILE))) {
++ __u32 thisSize =
++ (oh) ? oh->fileSize : tags.
++ extraFileLength;
++ __u32 parentObjectId =
++ (oh) ? oh->
++ parentObjectId : tags.
++ extraParentObjectId;
++
++
++ isShrink =
++ (oh) ? oh->isShrink : tags.
++ extraIsShrinkHeader;
++
++ /* If it is deleted (unlinked at start also means deleted)
++ * we treat the file size as being zeroed at this point.
++ */
++ if (parentObjectId ==
++ YAFFS_OBJECTID_DELETED
++ || parentObjectId ==
++ YAFFS_OBJECTID_UNLINKED) {
++ thisSize = 0;
++ isShrink = 1;
++ }
++
++ if (isShrink &&
++ in->variant.fileVariant.
++ shrinkSize > thisSize) {
++ in->variant.fileVariant.
++ shrinkSize =
++ thisSize;
++ }
++
++ if (isShrink)
++ bi->hasShrinkHeader = 1;
++
++ }
++ /* Use existing - destroy this one. */
++ yaffs_DeleteChunk(dev, chunk, 1, __LINE__);
++
++ }
++
++ if (!in->valid && in->variantType !=
++ (oh ? oh->type : tags.extraObjectType))
++ T(YAFFS_TRACE_ERROR, (
++ TSTR("yaffs tragedy: Bad object type, "
++ TCONT("%d != %d, for object %d at chunk ")
++ TCONT("%d during scan")
++ TENDSTR), oh ?
++ oh->type : tags.extraObjectType,
++ in->variantType, tags.objectId,
++ chunk));
++
++ if (!in->valid &&
++ (tags.objectId == YAFFS_OBJECTID_ROOT ||
++ tags.objectId ==
++ YAFFS_OBJECTID_LOSTNFOUND)) {
++ /* We only load some info, don't fiddle with directory structure */
++ in->valid = 1;
++
++ if (oh) {
++ in->variantType = oh->type;
++
++ in->yst_mode = oh->yst_mode;
++#ifdef CONFIG_YAFFS_WINCE
++ in->win_atime[0] = oh->win_atime[0];
++ in->win_ctime[0] = oh->win_ctime[0];
++ in->win_mtime[0] = oh->win_mtime[0];
++ in->win_atime[1] = oh->win_atime[1];
++ in->win_ctime[1] = oh->win_ctime[1];
++ in->win_mtime[1] = oh->win_mtime[1];
++#else
++ in->yst_uid = oh->yst_uid;
++ in->yst_gid = oh->yst_gid;
++ in->yst_atime = oh->yst_atime;
++ in->yst_mtime = oh->yst_mtime;
++ in->yst_ctime = oh->yst_ctime;
++ in->yst_rdev = oh->yst_rdev;
++
++#endif
++ } else {
++ in->variantType = tags.extraObjectType;
++ in->lazyLoaded = 1;
++ }
++
++ in->hdrChunk = chunk;
++
++ } else if (!in->valid) {
++ /* we need to load this info */
++
++ in->valid = 1;
++ in->hdrChunk = chunk;
++
++ if (oh) {
++ in->variantType = oh->type;
++
++ in->yst_mode = oh->yst_mode;
++#ifdef CONFIG_YAFFS_WINCE
++ in->win_atime[0] = oh->win_atime[0];
++ in->win_ctime[0] = oh->win_ctime[0];
++ in->win_mtime[0] = oh->win_mtime[0];
++ in->win_atime[1] = oh->win_atime[1];
++ in->win_ctime[1] = oh->win_ctime[1];
++ in->win_mtime[1] = oh->win_mtime[1];
++#else
++ in->yst_uid = oh->yst_uid;
++ in->yst_gid = oh->yst_gid;
++ in->yst_atime = oh->yst_atime;
++ in->yst_mtime = oh->yst_mtime;
++ in->yst_ctime = oh->yst_ctime;
++ in->yst_rdev = oh->yst_rdev;
++#endif
++
++ if (oh->shadowsObject > 0)
++ yaffs_HandleShadowedObject(dev,
++ oh->
++ shadowsObject,
++ 1);
++
++
++ yaffs_SetObjectName(in, oh->name);
++ parent =
++ yaffs_FindOrCreateObjectByNumber
++ (dev, oh->parentObjectId,
++ YAFFS_OBJECT_TYPE_DIRECTORY);
++
++ fileSize = oh->fileSize;
++ isShrink = oh->isShrink;
++ equivalentObjectId = oh->equivalentObjectId;
++
++ } else {
++ in->variantType = tags.extraObjectType;
++ parent =
++ yaffs_FindOrCreateObjectByNumber
++ (dev, tags.extraParentObjectId,
++ YAFFS_OBJECT_TYPE_DIRECTORY);
++ fileSize = tags.extraFileLength;
++ isShrink = tags.extraIsShrinkHeader;
++ equivalentObjectId = tags.extraEquivalentObjectId;
++ in->lazyLoaded = 1;
++
++ }
++ in->dirty = 0;
++
++ if (!parent)
++ alloc_failed = 1;
++
++ /* directory stuff...
++ * hook up to parent
++ */
++
++ if (parent && parent->variantType ==
++ YAFFS_OBJECT_TYPE_UNKNOWN) {
++ /* Set up as a directory */
++ parent->variantType =
++ YAFFS_OBJECT_TYPE_DIRECTORY;
++ YINIT_LIST_HEAD(&parent->variant.
++ directoryVariant.
++ children);
++ } else if (!parent || parent->variantType !=
++ YAFFS_OBJECT_TYPE_DIRECTORY) {
++ /* Hoosterman, another problem....
++ * We're trying to use a non-directory as a directory
++ */
++
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("yaffs tragedy: attempting to use non-directory as a directory in scan. Put in lost+found."
++ TENDSTR)));
++ parent = dev->lostNFoundDir;
++ }
++
++ yaffs_AddObjectToDirectory(parent, in);
++
++ itsUnlinked = (parent == dev->deletedDir) ||
++ (parent == dev->unlinkedDir);
++
++ if (isShrink) {
++ /* Mark the block as having a shrinkHeader */
++ bi->hasShrinkHeader = 1;
++ }
++
++ /* Note re hardlinks.
++ * Since we might scan a hardlink before its equivalent object is scanned
++ * we put them all in a list.
++ * After scanning is complete, we should have all the objects, so we run
++ * through this list and fix up all the chains.
++ */
++
++ switch (in->variantType) {
++ case YAFFS_OBJECT_TYPE_UNKNOWN:
++ /* Todo got a problem */
++ break;
++ case YAFFS_OBJECT_TYPE_FILE:
++
++ if (in->variant.fileVariant.
++ scannedFileSize < fileSize) {
++ /* This covers the case where the file size is greater
++ * than where the data is
++ * This will happen if the file is resized to be larger
++ * than its current data extents.
++ */
++ in->variant.fileVariant.fileSize = fileSize;
++ in->variant.fileVariant.scannedFileSize =
++ in->variant.fileVariant.fileSize;
++ }
++
++ if (isShrink &&
++ in->variant.fileVariant.shrinkSize > fileSize) {
++ in->variant.fileVariant.shrinkSize = fileSize;
++ }
++
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ if (!itsUnlinked) {
++ in->variant.hardLinkVariant.equivalentObjectId =
++ equivalentObjectId;
++ in->hardLinks.next =
++ (struct ylist_head *) hardList;
++ hardList = in;
++ }
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ /* Do nothing */
++ break;
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ /* Do nothing */
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ if (oh) {
++ in->variant.symLinkVariant.alias =
++ yaffs_CloneString(oh->alias);
++ if (!in->variant.symLinkVariant.alias)
++ alloc_failed = 1;
++ }
++ break;
++ }
++
++ }
++
++ }
++
++ } /* End of scanning for each chunk */
++
++ if (state == YAFFS_BLOCK_STATE_NEEDS_SCANNING) {
++ /* If we got this far while scanning, then the block is fully allocated. */
++ state = YAFFS_BLOCK_STATE_FULL;
++ }
++
++ bi->blockState = state;
++
++ /* Now let's see if it was dirty */
++ if (bi->pagesInUse == 0 &&
++ !bi->hasShrinkHeader &&
++ bi->blockState == YAFFS_BLOCK_STATE_FULL) {
++ yaffs_BlockBecameDirty(dev, blk);
++ }
++
++ }
++
++ if (altBlockIndex)
++ YFREE_ALT(blockIndex);
++ else
++ YFREE(blockIndex);
++
++ /* Ok, we've done all the scanning.
++ * Fix up the hard link chains.
++ * We should now have scanned all the objects, now it's time to add these
++ * hardlinks.
++ */
++ yaffs_HardlinkFixup(dev, hardList);
++
++
++ yaffs_ReleaseTempBuffer(dev, chunkData, __LINE__);
++
++ if (alloc_failed)
++ return YAFFS_FAIL;
++
++ T(YAFFS_TRACE_SCAN, (TSTR("yaffs_ScanBackwards ends" TENDSTR)));
++
++ return YAFFS_OK;
++}
++
++/*------------------------------ Directory Functions ----------------------------- */
++
++static void yaffs_VerifyObjectInDirectory(yaffs_Object *obj)
++{
++ struct ylist_head *lh;
++ yaffs_Object *listObj;
++
++ int count = 0;
++
++ if (!obj) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("No object to verify" TENDSTR)));
++ YBUG();
++ return;
++ }
++
++ if (yaffs_SkipVerification(obj->myDev))
++ return;
++
++ if (!obj->parent) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("Object does not have parent" TENDSTR)));
++ YBUG();
++ return;
++ }
++
++ if (obj->parent->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("Parent is not directory" TENDSTR)));
++ YBUG();
++ }
++
++ /* Iterate through the objects in each hash entry */
++
++ ylist_for_each(lh, &obj->parent->variant.directoryVariant.children) {
++ if (lh) {
++ listObj = ylist_entry(lh, yaffs_Object, siblings);
++ yaffs_VerifyObject(listObj);
++ if (obj == listObj)
++ count++;
++ }
++ }
++
++ if (count != 1) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("Object in directory %d times" TENDSTR), count));
++ YBUG();
++ }
++}
++
++static void yaffs_VerifyDirectory(yaffs_Object *directory)
++{
++ struct ylist_head *lh;
++ yaffs_Object *listObj;
++
++ if (!directory) {
++ YBUG();
++ return;
++ }
++
++ if (yaffs_SkipFullVerification(directory->myDev))
++ return;
++
++ if (directory->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("Directory has wrong type: %d" TENDSTR), directory->variantType));
++ YBUG();
++ }
++
++ /* Iterate through the objects in each hash entry */
++
++ ylist_for_each(lh, &directory->variant.directoryVariant.children) {
++ if (lh) {
++ listObj = ylist_entry(lh, yaffs_Object, siblings);
++ if (listObj->parent != directory) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("Object in directory list has wrong parent %p" TENDSTR), listObj->parent));
++ YBUG();
++ }
++ yaffs_VerifyObjectInDirectory(listObj);
++ }
++ }
++}
++
++
++static void yaffs_RemoveObjectFromDirectory(yaffs_Object *obj)
++{
++ yaffs_Device *dev = obj->myDev;
++ yaffs_Object *parent;
++
++ yaffs_VerifyObjectInDirectory(obj);
++ parent = obj->parent;
++
++ yaffs_VerifyDirectory(parent);
++
++ if (dev && dev->removeObjectCallback)
++ dev->removeObjectCallback(obj);
++
++
++ ylist_del_init(&obj->siblings);
++ obj->parent = NULL;
++
++ yaffs_VerifyDirectory(parent);
++}
++
++
++static void yaffs_AddObjectToDirectory(yaffs_Object *directory,
++ yaffs_Object *obj)
++{
++ if (!directory) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("tragedy: Trying to add an object to a null pointer directory"
++ TENDSTR)));
++ YBUG();
++ return;
++ }
++ if (directory->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("tragedy: Trying to add an object to a non-directory"
++ TENDSTR)));
++ YBUG();
++ }
++
++ if (obj->siblings.prev == NULL) {
++ /* Not initialised */
++ YBUG();
++ }
++
++
++ yaffs_VerifyDirectory(directory);
++
++ yaffs_RemoveObjectFromDirectory(obj);
++
++
++ /* Now add it */
++ ylist_add(&obj->siblings, &directory->variant.directoryVariant.children);
++ obj->parent = directory;
++
++ if (directory == obj->myDev->unlinkedDir
++ || directory == obj->myDev->deletedDir) {
++ obj->unlinked = 1;
++ obj->myDev->nUnlinkedFiles++;
++ obj->renameAllowed = 0;
++ }
++
++ yaffs_VerifyDirectory(directory);
++ yaffs_VerifyObjectInDirectory(obj);
++}
++
++yaffs_Object *yaffs_FindObjectByName(yaffs_Object *directory,
++ const YCHAR *name)
++{
++ int sum;
++
++ struct ylist_head *i;
++ YCHAR buffer[YAFFS_MAX_NAME_LENGTH + 1];
++
++ yaffs_Object *l;
++
++ if (!name)
++ return NULL;
++
++ if (!directory) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("tragedy: yaffs_FindObjectByName: null pointer directory"
++ TENDSTR)));
++ YBUG();
++ return NULL;
++ }
++ if (directory->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("tragedy: yaffs_FindObjectByName: non-directory" TENDSTR)));
++ YBUG();
++ }
++
++ sum = yaffs_CalcNameSum(name);
++
++ ylist_for_each(i, &directory->variant.directoryVariant.children) {
++ if (i) {
++ l = ylist_entry(i, yaffs_Object, siblings);
++
++ if (l->parent != directory)
++ YBUG();
++
++ yaffs_CheckObjectDetailsLoaded(l);
++
++ /* Special case for lost-n-found */
++ if (l->objectId == YAFFS_OBJECTID_LOSTNFOUND) {
++ if (yaffs_strcmp(name, YAFFS_LOSTNFOUND_NAME) == 0)
++ return l;
++ } else if (yaffs_SumCompare(l->sum, sum) || l->hdrChunk <= 0) {
++ /* LostnFound chunk called Objxxx
++ * Do a real check
++ */
++ yaffs_GetObjectName(l, buffer,
++ YAFFS_MAX_NAME_LENGTH);
++ if (yaffs_strncmp(name, buffer, YAFFS_MAX_NAME_LENGTH) == 0)
++ return l;
++ }
++ }
++ }
++
++ return NULL;
++}
++
++
++#if 0
++int yaffs_ApplyToDirectoryChildren(yaffs_Object *theDir,
++ int (*fn) (yaffs_Object *))
++{
++ struct ylist_head *i;
++ yaffs_Object *l;
++
++ if (!theDir) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("tragedy: yaffs_FindObjectByName: null pointer directory"
++ TENDSTR)));
++ YBUG();
++ return YAFFS_FAIL;
++ }
++ if (theDir->variantType != YAFFS_OBJECT_TYPE_DIRECTORY) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("tragedy: yaffs_FindObjectByName: non-directory" TENDSTR)));
++ YBUG();
++ return YAFFS_FAIL;
++ }
++
++ ylist_for_each(i, &theDir->variant.directoryVariant.children) {
++ if (i) {
++ l = ylist_entry(i, yaffs_Object, siblings);
++ if (l && !fn(l))
++ return YAFFS_FAIL;
++ }
++ }
++
++ return YAFFS_OK;
++
++}
++#endif
++
++/* GetEquivalentObject dereferences any hard links to get to the
++ * actual object.
++ */
++
++yaffs_Object *yaffs_GetEquivalentObject(yaffs_Object *obj)
++{
++ if (obj && obj->variantType == YAFFS_OBJECT_TYPE_HARDLINK) {
++ /* We want the object id of the equivalent object, not this one */
++ obj = obj->variant.hardLinkVariant.equivalentObject;
++ yaffs_CheckObjectDetailsLoaded(obj);
++ }
++ return obj;
++}
++
++int yaffs_GetObjectName(yaffs_Object *obj, YCHAR *name, int buffSize)
++{
++ memset(name, 0, buffSize * sizeof(YCHAR));
++
++ yaffs_CheckObjectDetailsLoaded(obj);
++
++ if (obj->objectId == YAFFS_OBJECTID_LOSTNFOUND) {
++ yaffs_strncpy(name, YAFFS_LOSTNFOUND_NAME, buffSize - 1);
++ } else if (obj->hdrChunk <= 0) {
++ YCHAR locName[20];
++ YCHAR numString[20];
++ YCHAR *x = &numString[19];
++ unsigned v = obj->objectId;
++ numString[19] = 0;
++ while (v > 0) {
++ x--;
++ *x = '0' + (v % 10);
++ v /= 10;
++ }
++ /* make up a name */
++ yaffs_strcpy(locName, YAFFS_LOSTNFOUND_PREFIX);
++ yaffs_strcat(locName, x);
++ yaffs_strncpy(name, locName, buffSize - 1);
++
++ }
++#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM
++ else if (obj->shortName[0])
++ yaffs_strcpy(name, obj->shortName);
++#endif
++ else {
++ int result;
++ __u8 *buffer = yaffs_GetTempBuffer(obj->myDev, __LINE__);
++
++ yaffs_ObjectHeader *oh = (yaffs_ObjectHeader *) buffer;
++
++ memset(buffer, 0, obj->myDev->nDataBytesPerChunk);
++
++ if (obj->hdrChunk > 0) {
++ result = yaffs_ReadChunkWithTagsFromNAND(obj->myDev,
++ obj->hdrChunk, buffer,
++ NULL);
++ }
++ yaffs_strncpy(name, oh->name, buffSize - 1);
++
++ yaffs_ReleaseTempBuffer(obj->myDev, buffer, __LINE__);
++ }
++
++ return yaffs_strlen(name);
++}
++
++int yaffs_GetObjectFileLength(yaffs_Object *obj)
++{
++ /* Dereference any hard linking */
++ obj = yaffs_GetEquivalentObject(obj);
++
++ if (obj->variantType == YAFFS_OBJECT_TYPE_FILE)
++ return obj->variant.fileVariant.fileSize;
++ if (obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK)
++ return yaffs_strlen(obj->variant.symLinkVariant.alias);
++ else {
++ /* Only a directory should drop through to here */
++ return obj->myDev->nDataBytesPerChunk;
++ }
++}
++
++int yaffs_GetObjectLinkCount(yaffs_Object *obj)
++{
++ int count = 0;
++ struct ylist_head *i;
++
++ if (!obj->unlinked)
++ count++; /* the object itself */
++
++ ylist_for_each(i, &obj->hardLinks)
++ count++; /* add the hard links; */
++
++ return count;
++}
++
++int yaffs_GetObjectInode(yaffs_Object *obj)
++{
++ obj = yaffs_GetEquivalentObject(obj);
++
++ return obj->objectId;
++}
++
++unsigned yaffs_GetObjectType(yaffs_Object *obj)
++{
++ obj = yaffs_GetEquivalentObject(obj);
++
++ switch (obj->variantType) {
++ case YAFFS_OBJECT_TYPE_FILE:
++ return DT_REG;
++ break;
++ case YAFFS_OBJECT_TYPE_DIRECTORY:
++ return DT_DIR;
++ break;
++ case YAFFS_OBJECT_TYPE_SYMLINK:
++ return DT_LNK;
++ break;
++ case YAFFS_OBJECT_TYPE_HARDLINK:
++ return DT_REG;
++ break;
++ case YAFFS_OBJECT_TYPE_SPECIAL:
++ if (S_ISFIFO(obj->yst_mode))
++ return DT_FIFO;
++ if (S_ISCHR(obj->yst_mode))
++ return DT_CHR;
++ if (S_ISBLK(obj->yst_mode))
++ return DT_BLK;
++ if (S_ISSOCK(obj->yst_mode))
++ return DT_SOCK;
++ default:
++ return DT_REG;
++ break;
++ }
++}
++
++YCHAR *yaffs_GetSymlinkAlias(yaffs_Object *obj)
++{
++ obj = yaffs_GetEquivalentObject(obj);
++ if (obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK)
++ return yaffs_CloneString(obj->variant.symLinkVariant.alias);
++ else
++ return yaffs_CloneString(_Y(""));
++}
++
++#ifndef CONFIG_YAFFS_WINCE
++
++int yaffs_SetAttributes(yaffs_Object *obj, struct iattr *attr)
++{
++ unsigned int valid = attr->ia_valid;
++
++ if (valid & ATTR_MODE)
++ obj->yst_mode = attr->ia_mode;
++ if (valid & ATTR_UID)
++ obj->yst_uid = attr->ia_uid;
++ if (valid & ATTR_GID)
++ obj->yst_gid = attr->ia_gid;
++
++ if (valid & ATTR_ATIME)
++ obj->yst_atime = Y_TIME_CONVERT(attr->ia_atime);
++ if (valid & ATTR_CTIME)
++ obj->yst_ctime = Y_TIME_CONVERT(attr->ia_ctime);
++ if (valid & ATTR_MTIME)
++ obj->yst_mtime = Y_TIME_CONVERT(attr->ia_mtime);
++
++ if (valid & ATTR_SIZE)
++ yaffs_ResizeFile(obj, attr->ia_size);
++
++ yaffs_UpdateObjectHeader(obj, NULL, 1, 0, 0);
++
++ return YAFFS_OK;
++
++}
++int yaffs_GetAttributes(yaffs_Object *obj, struct iattr *attr)
++{
++ unsigned int valid = 0;
++
++ attr->ia_mode = obj->yst_mode;
++ valid |= ATTR_MODE;
++ attr->ia_uid = obj->yst_uid;
++ valid |= ATTR_UID;
++ attr->ia_gid = obj->yst_gid;
++ valid |= ATTR_GID;
++
++ Y_TIME_CONVERT(attr->ia_atime) = obj->yst_atime;
++ valid |= ATTR_ATIME;
++ Y_TIME_CONVERT(attr->ia_ctime) = obj->yst_ctime;
++ valid |= ATTR_CTIME;
++ Y_TIME_CONVERT(attr->ia_mtime) = obj->yst_mtime;
++ valid |= ATTR_MTIME;
++
++ attr->ia_size = yaffs_GetFileSize(obj);
++ valid |= ATTR_SIZE;
++
++ attr->ia_valid = valid;
++
++ return YAFFS_OK;
++}
++
++#endif
++
++#if 0
++int yaffs_DumpObject(yaffs_Object *obj)
++{
++ YCHAR name[257];
++
++ yaffs_GetObjectName(obj, name, 256);
++
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("Object %d, inode %d \"%s\"\n dirty %d valid %d serial %d sum %d"
++ " chunk %d type %d size %d\n"
++ TENDSTR), obj->objectId, yaffs_GetObjectInode(obj), name,
++ obj->dirty, obj->valid, obj->serial, obj->sum, obj->hdrChunk,
++ yaffs_GetObjectType(obj), yaffs_GetObjectFileLength(obj)));
++
++ return YAFFS_OK;
++}
++#endif
++
++/*---------------------------- Initialisation code -------------------------------------- */
++
++static int yaffs_CheckDevFunctions(const yaffs_Device *dev)
++{
++
++ /* Common functions, gotta have */
++ if (!dev->eraseBlockInNAND || !dev->initialiseNAND)
++ return 0;
++
++#ifdef CONFIG_YAFFS_YAFFS2
++
++ /* Can use the "with tags" style interface for yaffs1 or yaffs2 */
++ if (dev->writeChunkWithTagsToNAND &&
++ dev->readChunkWithTagsFromNAND &&
++ !dev->writeChunkToNAND &&
++ !dev->readChunkFromNAND &&
++ dev->markNANDBlockBad && dev->queryNANDBlock)
++ return 1;
++#endif
++
++ /* Can use the "spare" style interface for yaffs1 */
++ if (!dev->isYaffs2 &&
++ !dev->writeChunkWithTagsToNAND &&
++ !dev->readChunkWithTagsFromNAND &&
++ dev->writeChunkToNAND &&
++ dev->readChunkFromNAND &&
++ !dev->markNANDBlockBad && !dev->queryNANDBlock)
++ return 1;
++
++ return 0; /* bad */
++}
++
++
++static int yaffs_CreateInitialDirectories(yaffs_Device *dev)
++{
++ /* Initialise the unlinked, deleted, root and lost and found directories */
++
++ dev->lostNFoundDir = dev->rootDir = NULL;
++ dev->unlinkedDir = dev->deletedDir = NULL;
++
++ dev->unlinkedDir =
++ yaffs_CreateFakeDirectory(dev, YAFFS_OBJECTID_UNLINKED, S_IFDIR);
++
++ dev->deletedDir =
++ yaffs_CreateFakeDirectory(dev, YAFFS_OBJECTID_DELETED, S_IFDIR);
++
++ dev->rootDir =
++ yaffs_CreateFakeDirectory(dev, YAFFS_OBJECTID_ROOT,
++ YAFFS_ROOT_MODE | S_IFDIR);
++ dev->lostNFoundDir =
++ yaffs_CreateFakeDirectory(dev, YAFFS_OBJECTID_LOSTNFOUND,
++ YAFFS_LOSTNFOUND_MODE | S_IFDIR);
++
++ if (dev->lostNFoundDir && dev->rootDir && dev->unlinkedDir && dev->deletedDir) {
++ yaffs_AddObjectToDirectory(dev->rootDir, dev->lostNFoundDir);
++ return YAFFS_OK;
++ }
++
++ return YAFFS_FAIL;
++}
++
++int yaffs_GutsInitialise(yaffs_Device *dev)
++{
++ int init_failed = 0;
++ unsigned x;
++ int bits;
++
++ T(YAFFS_TRACE_TRACING, (TSTR("yaffs: yaffs_GutsInitialise()" TENDSTR)));
++
++ /* Check stuff that must be set */
++
++ if (!dev) {
++ T(YAFFS_TRACE_ALWAYS, (TSTR("yaffs: Need a device" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ dev->internalStartBlock = dev->startBlock;
++ dev->internalEndBlock = dev->endBlock;
++ dev->blockOffset = 0;
++ dev->chunkOffset = 0;
++ dev->nFreeChunks = 0;
++
++ dev->gcBlock = -1;
++
++ if (dev->startBlock == 0) {
++ dev->internalStartBlock = dev->startBlock + 1;
++ dev->internalEndBlock = dev->endBlock + 1;
++ dev->blockOffset = 1;
++ dev->chunkOffset = dev->nChunksPerBlock;
++ }
++
++ /* Check geometry parameters. */
++
++ if ((!dev->inbandTags && dev->isYaffs2 && dev->totalBytesPerChunk < 1024) ||
++ (!dev->isYaffs2 && dev->totalBytesPerChunk < 512) ||
++ (dev->inbandTags && !dev->isYaffs2) ||
++ dev->nChunksPerBlock < 2 ||
++ dev->nReservedBlocks < 2 ||
++ dev->internalStartBlock <= 0 ||
++ dev->internalEndBlock <= 0 ||
++ dev->internalEndBlock <= (dev->internalStartBlock + dev->nReservedBlocks + 2)) { /* otherwise it is too small */
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("yaffs: NAND geometry problems: chunk size %d, type is yaffs%s, inbandTags %d "
++ TENDSTR), dev->totalBytesPerChunk, dev->isYaffs2 ? "2" : "", dev->inbandTags));
++ return YAFFS_FAIL;
++ }
++
++ if (yaffs_InitialiseNAND(dev) != YAFFS_OK) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs: InitialiseNAND failed" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ /* Sort out space for inband tags, if required */
++ if (dev->inbandTags)
++ dev->nDataBytesPerChunk = dev->totalBytesPerChunk - sizeof(yaffs_PackedTags2TagsPart);
++ else
++ dev->nDataBytesPerChunk = dev->totalBytesPerChunk;
++
++ /* Got the right mix of functions? */
++ if (!yaffs_CheckDevFunctions(dev)) {
++ /* Function missing */
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR
++ ("yaffs: device function(s) missing or wrong\n" TENDSTR)));
++
++ return YAFFS_FAIL;
++ }
++
++ /* This is really a compilation check. */
++ if (!yaffs_CheckStructures()) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs_CheckStructures failed\n" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ if (dev->isMounted) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs: device already mounted\n" TENDSTR)));
++ return YAFFS_FAIL;
++ }
++
++ /* Finished with most checks. One or two more checks happen later on too. */
++
++ dev->isMounted = 1;
++
++ /* OK now calculate a few things for the device */
++
++ /*
++ * Calculate all the chunk size manipulation numbers:
++ */
++ x = dev->nDataBytesPerChunk;
++ /* We always use dev->chunkShift and dev->chunkDiv */
++ dev->chunkShift = Shifts(x);
++ x >>= dev->chunkShift;
++ dev->chunkDiv = x;
++ /* We only use chunk mask if chunkDiv is 1 */
++ dev->chunkMask = (1<<dev->chunkShift) - 1;
++
++ /*
++ * Calculate chunkGroupBits.
++ * We need to find the next power of 2 > than internalEndBlock
++ */
++
++ x = dev->nChunksPerBlock * (dev->internalEndBlock + 1);
++
++ bits = ShiftsGE(x);
++
++ /* Set up tnode width if wide tnodes are enabled. */
++ if (!dev->wideTnodesDisabled) {
++ /* bits must be even so that we end up with 32-bit words */
++ if (bits & 1)
++ bits++;
++ if (bits < 16)
++ dev->tnodeWidth = 16;
++ else
++ dev->tnodeWidth = bits;
++ } else
++ dev->tnodeWidth = 16;
++
++ dev->tnodeMask = (1<<dev->tnodeWidth)-1;
++
++ /* Level0 Tnodes are 16 bits or wider (if wide tnodes are enabled),
++ * so if the bitwidth of the
++ * chunk range we're using is greater than 16 we need
++ * to figure out chunk shift and chunkGroupSize
++ */
++
++ if (bits <= dev->tnodeWidth)
++ dev->chunkGroupBits = 0;
++ else
++ dev->chunkGroupBits = bits - dev->tnodeWidth;
++
++
++ dev->chunkGroupSize = 1 << dev->chunkGroupBits;
++
++ if (dev->nChunksPerBlock < dev->chunkGroupSize) {
++ /* We have a problem because the soft delete won't work if
++ * the chunk group size > chunks per block.
++ * This can be remedied by using larger "virtual blocks".
++ */
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs: chunk group too large\n" TENDSTR)));
++
++ return YAFFS_FAIL;
++ }
++
++ /* OK, we've finished verifying the device, lets continue with initialisation */
++
++ /* More device initialisation */
++ dev->garbageCollections = 0;
++ dev->passiveGarbageCollections = 0;
++ dev->currentDirtyChecker = 0;
++ dev->bufferedBlock = -1;
++ dev->doingBufferedBlockRewrite = 0;
++ dev->nDeletedFiles = 0;
++ dev->nBackgroundDeletions = 0;
++ dev->nUnlinkedFiles = 0;
++ dev->eccFixed = 0;
++ dev->eccUnfixed = 0;
++ dev->tagsEccFixed = 0;
++ dev->tagsEccUnfixed = 0;
++ dev->nErasureFailures = 0;
++ dev->nErasedBlocks = 0;
++ dev->isDoingGC = 0;
++ dev->hasPendingPrioritisedGCs = 1; /* Assume the worst for now, will get fixed on first GC */
++
++ /* Initialise temporary buffers and caches. */
++ if (!yaffs_InitialiseTempBuffers(dev))
++ init_failed = 1;
++
++ dev->srCache = NULL;
++ dev->gcCleanupList = NULL;
++
++
++ if (!init_failed &&
++ dev->nShortOpCaches > 0) {
++ int i;
++ void *buf;
++ int srCacheBytes = dev->nShortOpCaches * sizeof(yaffs_ChunkCache);
++
++ if (dev->nShortOpCaches > YAFFS_MAX_SHORT_OP_CACHES)
++ dev->nShortOpCaches = YAFFS_MAX_SHORT_OP_CACHES;
++
++ dev->srCache = YMALLOC(srCacheBytes);
++
++ buf = (__u8 *) dev->srCache;
++
++ if (dev->srCache)
++ memset(dev->srCache, 0, srCacheBytes);
++
++ for (i = 0; i < dev->nShortOpCaches && buf; i++) {
++ dev->srCache[i].object = NULL;
++ dev->srCache[i].lastUse = 0;
++ dev->srCache[i].dirty = 0;
++ dev->srCache[i].data = buf = YMALLOC_DMA(dev->totalBytesPerChunk);
++ }
++ if (!buf)
++ init_failed = 1;
++
++ dev->srLastUse = 0;
++ }
++
++ dev->cacheHits = 0;
++
++ if (!init_failed) {
++ dev->gcCleanupList = YMALLOC(dev->nChunksPerBlock * sizeof(__u32));
++ if (!dev->gcCleanupList)
++ init_failed = 1;
++ }
++
++ if (dev->isYaffs2)
++ dev->useHeaderFileSize = 1;
++
++ if (!init_failed && !yaffs_InitialiseBlocks(dev))
++ init_failed = 1;
++
++ yaffs_InitialiseTnodes(dev);
++ yaffs_InitialiseObjects(dev);
++
++ if (!init_failed && !yaffs_CreateInitialDirectories(dev))
++ init_failed = 1;
++
++
++ if (!init_failed) {
++ /* Now scan the flash. */
++ if (dev->isYaffs2) {
++ if (yaffs_CheckpointRestore(dev)) {
++ yaffs_CheckObjectDetailsLoaded(dev->rootDir);
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("yaffs: restored from checkpoint" TENDSTR)));
++ } else {
++
++ /* Clean up the mess caused by an aborted checkpoint load
++ * and scan backwards.
++ */
++ yaffs_DeinitialiseBlocks(dev);
++ yaffs_DeinitialiseTnodes(dev);
++ yaffs_DeinitialiseObjects(dev);
++
++
++ dev->nErasedBlocks = 0;
++ dev->nFreeChunks = 0;
++ dev->allocationBlock = -1;
++ dev->allocationPage = -1;
++ dev->nDeletedFiles = 0;
++ dev->nUnlinkedFiles = 0;
++ dev->nBackgroundDeletions = 0;
++ dev->oldestDirtySequence = 0;
++
++ if (!init_failed && !yaffs_InitialiseBlocks(dev))
++ init_failed = 1;
++
++ yaffs_InitialiseTnodes(dev);
++ yaffs_InitialiseObjects(dev);
++
++ if (!init_failed && !yaffs_CreateInitialDirectories(dev))
++ init_failed = 1;
++
++ if (!init_failed && !yaffs_ScanBackwards(dev))
++ init_failed = 1;
++ }
++ } else if (!yaffs_Scan(dev))
++ init_failed = 1;
++
++ yaffs_StripDeletedObjects(dev);
++ }
++
++ if (init_failed) {
++ /* Clean up the mess */
++ T(YAFFS_TRACE_TRACING,
++ (TSTR("yaffs: yaffs_GutsInitialise() aborted.\n" TENDSTR)));
++
++ yaffs_Deinitialise(dev);
++ return YAFFS_FAIL;
++ }
++
++ /* Zero out stats */
++ dev->nPageReads = 0;
++ dev->nPageWrites = 0;
++ dev->nBlockErasures = 0;
++ dev->nGCCopies = 0;
++ dev->nRetriedWrites = 0;
++
++ dev->nRetiredBlocks = 0;
++
++ yaffs_VerifyFreeChunks(dev);
++ yaffs_VerifyBlocks(dev);
++
++
++ T(YAFFS_TRACE_TRACING,
++ (TSTR("yaffs: yaffs_GutsInitialise() done.\n" TENDSTR)));
++ return YAFFS_OK;
++
++}
++
++void yaffs_Deinitialise(yaffs_Device *dev)
++{
++ if (dev->isMounted) {
++ int i;
++
++ yaffs_DeinitialiseBlocks(dev);
++ yaffs_DeinitialiseTnodes(dev);
++ yaffs_DeinitialiseObjects(dev);
++ if (dev->nShortOpCaches > 0 &&
++ dev->srCache) {
++
++ for (i = 0; i < dev->nShortOpCaches; i++) {
++ if (dev->srCache[i].data)
++ YFREE(dev->srCache[i].data);
++ dev->srCache[i].data = NULL;
++ }
++
++ YFREE(dev->srCache);
++ dev->srCache = NULL;
++ }
++
++ YFREE(dev->gcCleanupList);
++
++ for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++)
++ YFREE(dev->tempBuffer[i].buffer);
++
++ dev->isMounted = 0;
++
++ if (dev->deinitialiseNAND)
++ dev->deinitialiseNAND(dev);
++ }
++}
++
++static int yaffs_CountFreeChunks(yaffs_Device *dev)
++{
++ int nFree;
++ int b;
++
++ yaffs_BlockInfo *blk;
++
++ for (nFree = 0, b = dev->internalStartBlock; b <= dev->internalEndBlock;
++ b++) {
++ blk = yaffs_GetBlockInfo(dev, b);
++
++ switch (blk->blockState) {
++ case YAFFS_BLOCK_STATE_EMPTY:
++ case YAFFS_BLOCK_STATE_ALLOCATING:
++ case YAFFS_BLOCK_STATE_COLLECTING:
++ case YAFFS_BLOCK_STATE_FULL:
++ nFree +=
++ (dev->nChunksPerBlock - blk->pagesInUse +
++ blk->softDeletions);
++ break;
++ default:
++ break;
++ }
++ }
++
++ return nFree;
++}
++
++int yaffs_GetNumberOfFreeChunks(yaffs_Device *dev)
++{
++ /* This is what we report to the outside world */
++
++ int nFree;
++ int nDirtyCacheChunks;
++ int blocksForCheckpoint;
++ int i;
++
++#if 1
++ nFree = dev->nFreeChunks;
++#else
++ nFree = yaffs_CountFreeChunks(dev);
++#endif
++
++ nFree += dev->nDeletedFiles;
++
++ /* Now count the number of dirty chunks in the cache and subtract those */
++
++ for (nDirtyCacheChunks = 0, i = 0; i < dev->nShortOpCaches; i++) {
++ if (dev->srCache[i].dirty)
++ nDirtyCacheChunks++;
++ }
++
++ nFree -= nDirtyCacheChunks;
++
++ nFree -= ((dev->nReservedBlocks + 1) * dev->nChunksPerBlock);
++
++ /* Now we figure out how much to reserve for the checkpoint and report that... */
++ blocksForCheckpoint = yaffs_CalcCheckpointBlocksRequired(dev) - dev->blocksInCheckpoint;
++ if (blocksForCheckpoint < 0)
++ blocksForCheckpoint = 0;
++
++ nFree -= (blocksForCheckpoint * dev->nChunksPerBlock);
++
++ if (nFree < 0)
++ nFree = 0;
++
++ return nFree;
++
++}
++
++static int yaffs_freeVerificationFailures;
++
++static void yaffs_VerifyFreeChunks(yaffs_Device *dev)
++{
++ int counted;
++ int difference;
++
++ if (yaffs_SkipVerification(dev))
++ return;
++
++ counted = yaffs_CountFreeChunks(dev);
++
++ difference = dev->nFreeChunks - counted;
++
++ if (difference) {
++ T(YAFFS_TRACE_ALWAYS,
++ (TSTR("Freechunks verification failure %d %d %d" TENDSTR),
++ dev->nFreeChunks, counted, difference));
++ yaffs_freeVerificationFailures++;
++ }
++}
++
++/*---------------------------------------- YAFFS test code ----------------------*/
++
++#define yaffs_CheckStruct(structure, syze, name) \
++ do { \
++ if (sizeof(structure) != syze) { \
++ T(YAFFS_TRACE_ALWAYS, (TSTR("%s should be %d but is %d\n" TENDSTR),\
++ name, syze, sizeof(structure))); \
++ return YAFFS_FAIL; \
++ } \
++ } while (0)
++
++static int yaffs_CheckStructures(void)
++{
++/* yaffs_CheckStruct(yaffs_Tags,8,"yaffs_Tags"); */
++/* yaffs_CheckStruct(yaffs_TagsUnion,8,"yaffs_TagsUnion"); */
++/* yaffs_CheckStruct(yaffs_Spare,16,"yaffs_Spare"); */
++#ifndef CONFIG_YAFFS_TNODE_LIST_DEBUG
++ yaffs_CheckStruct(yaffs_Tnode, 2 * YAFFS_NTNODES_LEVEL0, "yaffs_Tnode");
++#endif
++#ifndef CONFIG_YAFFS_WINCE
++ yaffs_CheckStruct(yaffs_ObjectHeader, 512, "yaffs_ObjectHeader");
++#endif
++ return YAFFS_OK;
++}
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_guts.h linux-2.6.29.1/fs/yaffs2/yaffs_guts.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_guts.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_guts.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,904 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_GUTS_H__
++#define __YAFFS_GUTS_H__
++
++#include "devextras.h"
++#include "yportenv.h"
++
++#define YAFFS_OK 1
++#define YAFFS_FAIL 0
++
++/* Give us a Y=0x59,
++ * Give us an A=0x41,
++ * Give us an FF=0xFF
++ * Give us an S=0x53
++ * And what have we got...
++ */
++#define YAFFS_MAGIC 0x5941FF53
++
++#define YAFFS_NTNODES_LEVEL0 16
++#define YAFFS_TNODES_LEVEL0_BITS 4
++#define YAFFS_TNODES_LEVEL0_MASK 0xf
++
++#define YAFFS_NTNODES_INTERNAL (YAFFS_NTNODES_LEVEL0 / 2)
++#define YAFFS_TNODES_INTERNAL_BITS (YAFFS_TNODES_LEVEL0_BITS - 1)
++#define YAFFS_TNODES_INTERNAL_MASK 0x7
++#define YAFFS_TNODES_MAX_LEVEL 6
++
++#ifndef CONFIG_YAFFS_NO_YAFFS1
++#define YAFFS_BYTES_PER_SPARE 16
++#define YAFFS_BYTES_PER_CHUNK 512
++#define YAFFS_CHUNK_SIZE_SHIFT 9
++#define YAFFS_CHUNKS_PER_BLOCK 32
++#define YAFFS_BYTES_PER_BLOCK (YAFFS_CHUNKS_PER_BLOCK*YAFFS_BYTES_PER_CHUNK)
++#endif
++
++#define YAFFS_MIN_YAFFS2_CHUNK_SIZE 1024
++#define YAFFS_MIN_YAFFS2_SPARE_SIZE 32
++
++#define YAFFS_MAX_CHUNK_ID 0x000FFFFF
++
++#define YAFFS_UNUSED_OBJECT_ID 0x0003FFFF
++
++#define YAFFS_ALLOCATION_NOBJECTS 100
++#define YAFFS_ALLOCATION_NTNODES 100
++#define YAFFS_ALLOCATION_NLINKS 100
++
++#define YAFFS_NOBJECT_BUCKETS 256
++
++
++#define YAFFS_OBJECT_SPACE 0x40000
++
++#define YAFFS_CHECKPOINT_VERSION 3
++
++#ifdef CONFIG_YAFFS_UNICODE
++#define YAFFS_MAX_NAME_LENGTH 127
++#define YAFFS_MAX_ALIAS_LENGTH 79
++#else
++#define YAFFS_MAX_NAME_LENGTH 255
++#define YAFFS_MAX_ALIAS_LENGTH 159
++#endif
++
++#define YAFFS_SHORT_NAME_LENGTH 15
++
++/* Some special object ids for pseudo objects */
++#define YAFFS_OBJECTID_ROOT 1
++#define YAFFS_OBJECTID_LOSTNFOUND 2
++#define YAFFS_OBJECTID_UNLINKED 3
++#define YAFFS_OBJECTID_DELETED 4
++
++/* Sseudo object ids for checkpointing */
++#define YAFFS_OBJECTID_SB_HEADER 0x10
++#define YAFFS_OBJECTID_CHECKPOINT_DATA 0x20
++#define YAFFS_SEQUENCE_CHECKPOINT_DATA 0x21
++
++/* */
++
++#define YAFFS_MAX_SHORT_OP_CACHES 20
++
++#define YAFFS_N_TEMP_BUFFERS 6
++
++/* We limit the number attempts at sucessfully saving a chunk of data.
++ * Small-page devices have 32 pages per block; large-page devices have 64.
++ * Default to something in the order of 5 to 10 blocks worth of chunks.
++ */
++#define YAFFS_WR_ATTEMPTS (5*64)
++
++/* Sequence numbers are used in YAFFS2 to determine block allocation order.
++ * The range is limited slightly to help distinguish bad numbers from good.
++ * This also allows us to perhaps in the future use special numbers for
++ * special purposes.
++ * EFFFFF00 allows the allocation of 8 blocks per second (~1Mbytes) for 15 years,
++ * and is a larger number than the lifetime of a 2GB device.
++ */
++#define YAFFS_LOWEST_SEQUENCE_NUMBER 0x00001000
++#define YAFFS_HIGHEST_SEQUENCE_NUMBER 0xEFFFFF00
++
++/* Special sequence number for bad block that failed to be marked bad */
++#define YAFFS_SEQUENCE_BAD_BLOCK 0xFFFF0000
++
++/* ChunkCache is used for short read/write operations.*/
++typedef struct {
++ struct yaffs_ObjectStruct *object;
++ int chunkId;
++ int lastUse;
++ int dirty;
++ int nBytes; /* Only valid if the cache is dirty */
++ int locked; /* Can't push out or flush while locked. */
++#ifdef CONFIG_YAFFS_YAFFS2
++ __u8 *data;
++#else
++ __u8 data[YAFFS_BYTES_PER_CHUNK];
++#endif
++} yaffs_ChunkCache;
++
++
++
++/* Tags structures in RAM
++ * NB This uses bitfield. Bitfields should not straddle a u32 boundary otherwise
++ * the structure size will get blown out.
++ */
++
++#ifndef CONFIG_YAFFS_NO_YAFFS1
++typedef struct {
++ unsigned chunkId:20;
++ unsigned serialNumber:2;
++ unsigned byteCountLSB:10;
++ unsigned objectId:18;
++ unsigned ecc:12;
++ unsigned byteCountMSB:2;
++} yaffs_Tags;
++
++typedef union {
++ yaffs_Tags asTags;
++ __u8 asBytes[8];
++} yaffs_TagsUnion;
++
++#endif
++
++/* Stuff used for extended tags in YAFFS2 */
++
++typedef enum {
++ YAFFS_ECC_RESULT_UNKNOWN,
++ YAFFS_ECC_RESULT_NO_ERROR,
++ YAFFS_ECC_RESULT_FIXED,
++ YAFFS_ECC_RESULT_UNFIXED
++} yaffs_ECCResult;
++
++typedef enum {
++ YAFFS_OBJECT_TYPE_UNKNOWN,
++ YAFFS_OBJECT_TYPE_FILE,
++ YAFFS_OBJECT_TYPE_SYMLINK,
++ YAFFS_OBJECT_TYPE_DIRECTORY,
++ YAFFS_OBJECT_TYPE_HARDLINK,
++ YAFFS_OBJECT_TYPE_SPECIAL
++} yaffs_ObjectType;
++
++#define YAFFS_OBJECT_TYPE_MAX YAFFS_OBJECT_TYPE_SPECIAL
++
++typedef struct {
++
++ unsigned validMarker0;
++ unsigned chunkUsed; /* Status of the chunk: used or unused */
++ unsigned objectId; /* If 0 then this is not part of an object (unused) */
++ unsigned chunkId; /* If 0 then this is a header, else a data chunk */
++ unsigned byteCount; /* Only valid for data chunks */
++
++ /* The following stuff only has meaning when we read */
++ yaffs_ECCResult eccResult;
++ unsigned blockBad;
++
++ /* YAFFS 1 stuff */
++ unsigned chunkDeleted; /* The chunk is marked deleted */
++ unsigned serialNumber; /* Yaffs1 2-bit serial number */
++
++ /* YAFFS2 stuff */
++ unsigned sequenceNumber; /* The sequence number of this block */
++
++ /* Extra info if this is an object header (YAFFS2 only) */
++
++ unsigned extraHeaderInfoAvailable; /* There is extra info available if this is not zero */
++ unsigned extraParentObjectId; /* The parent object */
++ unsigned extraIsShrinkHeader; /* Is it a shrink header? */
++ unsigned extraShadows; /* Does this shadow another object? */
++
++ yaffs_ObjectType extraObjectType; /* What object type? */
++
++ unsigned extraFileLength; /* Length if it is a file */
++ unsigned extraEquivalentObjectId; /* Equivalent object Id if it is a hard link */
++
++ unsigned validMarker1;
++
++} yaffs_ExtendedTags;
++
++/* Spare structure for YAFFS1 */
++typedef struct {
++ __u8 tagByte0;
++ __u8 tagByte1;
++ __u8 tagByte2;
++ __u8 tagByte3;
++ __u8 pageStatus; /* set to 0 to delete the chunk */
++ __u8 blockStatus;
++ __u8 tagByte4;
++ __u8 tagByte5;
++ __u8 ecc1[3];
++ __u8 tagByte6;
++ __u8 tagByte7;
++ __u8 ecc2[3];
++} yaffs_Spare;
++
++/*Special structure for passing through to mtd */
++struct yaffs_NANDSpare {
++ yaffs_Spare spare;
++ int eccres1;
++ int eccres2;
++};
++
++/* Block data in RAM */
++
++typedef enum {
++ YAFFS_BLOCK_STATE_UNKNOWN = 0,
++
++ YAFFS_BLOCK_STATE_SCANNING,
++ YAFFS_BLOCK_STATE_NEEDS_SCANNING,
++ /* The block might have something on it (ie it is allocating or full, perhaps empty)
++ * but it needs to be scanned to determine its true state.
++ * This state is only valid during yaffs_Scan.
++ * NB We tolerate empty because the pre-scanner might be incapable of deciding
++ * However, if this state is returned on a YAFFS2 device, then we expect a sequence number
++ */
++
++ YAFFS_BLOCK_STATE_EMPTY,
++ /* This block is empty */
++
++ YAFFS_BLOCK_STATE_ALLOCATING,
++ /* This block is partially allocated.
++ * At least one page holds valid data.
++ * This is the one currently being used for page
++ * allocation. Should never be more than one of these
++ */
++
++ YAFFS_BLOCK_STATE_FULL,
++ /* All the pages in this block have been allocated.
++ */
++
++ YAFFS_BLOCK_STATE_DIRTY,
++ /* All pages have been allocated and deleted.
++ * Erase me, reuse me.
++ */
++
++ YAFFS_BLOCK_STATE_CHECKPOINT,
++ /* This block is assigned to holding checkpoint data.
++ */
++
++ YAFFS_BLOCK_STATE_COLLECTING,
++ /* This block is being garbage collected */
++
++ YAFFS_BLOCK_STATE_DEAD
++ /* This block has failed and is not in use */
++} yaffs_BlockState;
++
++#define YAFFS_NUMBER_OF_BLOCK_STATES (YAFFS_BLOCK_STATE_DEAD + 1)
++
++
++typedef struct {
++
++ int softDeletions:10; /* number of soft deleted pages */
++ int pagesInUse:10; /* number of pages in use */
++ unsigned blockState:4; /* One of the above block states. NB use unsigned because enum is sometimes an int */
++ __u32 needsRetiring:1; /* Data has failed on this block, need to get valid data off */
++ /* and retire the block. */
++ __u32 skipErasedCheck:1; /* If this is set we can skip the erased check on this block */
++ __u32 gcPrioritise:1; /* An ECC check or blank check has failed on this block.
++ It should be prioritised for GC */
++ __u32 chunkErrorStrikes:3; /* How many times we've had ecc etc failures on this block and tried to reuse it */
++
++#ifdef CONFIG_YAFFS_YAFFS2
++ __u32 hasShrinkHeader:1; /* This block has at least one shrink object header */
++ __u32 sequenceNumber; /* block sequence number for yaffs2 */
++#endif
++
++} yaffs_BlockInfo;
++
++/* -------------------------- Object structure -------------------------------*/
++/* This is the object structure as stored on NAND */
++
++typedef struct {
++ yaffs_ObjectType type;
++
++ /* Apply to everything */
++ int parentObjectId;
++ __u16 sum__NoLongerUsed; /* checksum of name. No longer used */
++ YCHAR name[YAFFS_MAX_NAME_LENGTH + 1];
++
++ /* The following apply to directories, files, symlinks - not hard links */
++ __u32 yst_mode; /* protection */
++
++#ifdef CONFIG_YAFFS_WINCE
++ __u32 notForWinCE[5];
++#else
++ __u32 yst_uid;
++ __u32 yst_gid;
++ __u32 yst_atime;
++ __u32 yst_mtime;
++ __u32 yst_ctime;
++#endif
++
++ /* File size applies to files only */
++ int fileSize;
++
++ /* Equivalent object id applies to hard links only. */
++ int equivalentObjectId;
++
++ /* Alias is for symlinks only. */
++ YCHAR alias[YAFFS_MAX_ALIAS_LENGTH + 1];
++
++ __u32 yst_rdev; /* device stuff for block and char devices (major/min) */
++
++#ifdef CONFIG_YAFFS_WINCE
++ __u32 win_ctime[2];
++ __u32 win_atime[2];
++ __u32 win_mtime[2];
++#else
++ __u32 roomToGrow[6];
++
++#endif
++ __u32 inbandShadowsObject;
++ __u32 inbandIsShrink;
++
++ __u32 reservedSpace[2];
++ int shadowsObject; /* This object header shadows the specified object if > 0 */
++
++ /* isShrink applies to object headers written when we shrink the file (ie resize) */
++ __u32 isShrink;
++
++} yaffs_ObjectHeader;
++
++/*--------------------------- Tnode -------------------------- */
++
++union yaffs_Tnode_union {
++#ifdef CONFIG_YAFFS_TNODE_LIST_DEBUG
++ union yaffs_Tnode_union *internal[YAFFS_NTNODES_INTERNAL + 1];
++#else
++ union yaffs_Tnode_union *internal[YAFFS_NTNODES_INTERNAL];
++#endif
++/* __u16 level0[YAFFS_NTNODES_LEVEL0]; */
++
++};
++
++typedef union yaffs_Tnode_union yaffs_Tnode;
++
++struct yaffs_TnodeList_struct {
++ struct yaffs_TnodeList_struct *next;
++ yaffs_Tnode *tnodes;
++};
++
++typedef struct yaffs_TnodeList_struct yaffs_TnodeList;
++
++/*------------------------ Object -----------------------------*/
++/* An object can be one of:
++ * - a directory (no data, has children links
++ * - a regular file (data.... not prunes :->).
++ * - a symlink [symbolic link] (the alias).
++ * - a hard link
++ */
++
++typedef struct {
++ __u32 fileSize;
++ __u32 scannedFileSize;
++ __u32 shrinkSize;
++ int topLevel;
++ yaffs_Tnode *top;
++} yaffs_FileStructure;
++
++typedef struct {
++ struct ylist_head children; /* list of child links */
++} yaffs_DirectoryStructure;
++
++typedef struct {
++ YCHAR *alias;
++} yaffs_SymLinkStructure;
++
++typedef struct {
++ struct yaffs_ObjectStruct *equivalentObject;
++ __u32 equivalentObjectId;
++} yaffs_HardLinkStructure;
++
++typedef union {
++ yaffs_FileStructure fileVariant;
++ yaffs_DirectoryStructure directoryVariant;
++ yaffs_SymLinkStructure symLinkVariant;
++ yaffs_HardLinkStructure hardLinkVariant;
++} yaffs_ObjectVariant;
++
++struct yaffs_ObjectStruct {
++ __u8 deleted:1; /* This should only apply to unlinked files. */
++ __u8 softDeleted:1; /* it has also been soft deleted */
++ __u8 unlinked:1; /* An unlinked file. The file should be in the unlinked directory.*/
++ __u8 fake:1; /* A fake object has no presence on NAND. */
++ __u8 renameAllowed:1; /* Some objects are not allowed to be renamed. */
++ __u8 unlinkAllowed:1;
++ __u8 dirty:1; /* the object needs to be written to flash */
++ __u8 valid:1; /* When the file system is being loaded up, this
++ * object might be created before the data
++ * is available (ie. file data records appear before the header).
++ */
++ __u8 lazyLoaded:1; /* This object has been lazy loaded and is missing some detail */
++
++ __u8 deferedFree:1; /* For Linux kernel. Object is removed from NAND, but is
++ * still in the inode cache. Free of object is defered.
++ * until the inode is released.
++ */
++ __u8 beingCreated:1; /* This object is still being created so skip some checks. */
++
++ __u8 serial; /* serial number of chunk in NAND. Cached here */
++ __u16 sum; /* sum of the name to speed searching */
++
++ struct yaffs_DeviceStruct *myDev; /* The device I'm on */
++
++ struct ylist_head hashLink; /* list of objects in this hash bucket */
++
++ struct ylist_head hardLinks; /* all the equivalent hard linked objects */
++
++ /* directory structure stuff */
++ /* also used for linking up the free list */
++ struct yaffs_ObjectStruct *parent;
++ struct ylist_head siblings;
++
++ /* Where's my object header in NAND? */
++ int hdrChunk;
++
++ int nDataChunks; /* Number of data chunks attached to the file. */
++
++ __u32 objectId; /* the object id value */
++
++ __u32 yst_mode;
++
++#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM
++ YCHAR shortName[YAFFS_SHORT_NAME_LENGTH + 1];
++#endif
++
++#ifndef __KERNEL__
++ __u32 inUse;
++#endif
++
++#ifdef CONFIG_YAFFS_WINCE
++ __u32 win_ctime[2];
++ __u32 win_mtime[2];
++ __u32 win_atime[2];
++#else
++ __u32 yst_uid;
++ __u32 yst_gid;
++ __u32 yst_atime;
++ __u32 yst_mtime;
++ __u32 yst_ctime;
++#endif
++
++ __u32 yst_rdev;
++
++#ifdef __KERNEL__
++ struct inode *myInode;
++
++#endif
++
++ yaffs_ObjectType variantType;
++
++ yaffs_ObjectVariant variant;
++
++};
++
++typedef struct yaffs_ObjectStruct yaffs_Object;
++
++struct yaffs_ObjectList_struct {
++ yaffs_Object *objects;
++ struct yaffs_ObjectList_struct *next;
++};
++
++typedef struct yaffs_ObjectList_struct yaffs_ObjectList;
++
++typedef struct {
++ struct ylist_head list;
++ int count;
++} yaffs_ObjectBucket;
++
++
++/* yaffs_CheckpointObject holds the definition of an object as dumped
++ * by checkpointing.
++ */
++
++typedef struct {
++ int structType;
++ __u32 objectId;
++ __u32 parentId;
++ int hdrChunk;
++ yaffs_ObjectType variantType:3;
++ __u8 deleted:1;
++ __u8 softDeleted:1;
++ __u8 unlinked:1;
++ __u8 fake:1;
++ __u8 renameAllowed:1;
++ __u8 unlinkAllowed:1;
++ __u8 serial;
++
++ int nDataChunks;
++ __u32 fileSizeOrEquivalentObjectId;
++} yaffs_CheckpointObject;
++
++/*--------------------- Temporary buffers ----------------
++ *
++ * These are chunk-sized working buffers. Each device has a few
++ */
++
++typedef struct {
++ __u8 *buffer;
++ int line; /* track from whence this buffer was allocated */
++ int maxLine;
++} yaffs_TempBuffer;
++
++/*----------------- Device ---------------------------------*/
++
++struct yaffs_DeviceStruct {
++ struct ylist_head devList;
++ const char *name;
++
++ /* Entry parameters set up way early. Yaffs sets up the rest.*/
++ int nDataBytesPerChunk; /* Should be a power of 2 >= 512 */
++ int nChunksPerBlock; /* does not need to be a power of 2 */
++ int spareBytesPerChunk; /* spare area size */
++ int startBlock; /* Start block we're allowed to use */
++ int endBlock; /* End block we're allowed to use */
++ int nReservedBlocks; /* We want this tuneable so that we can reduce */
++ /* reserved blocks on NOR and RAM. */
++
++
++ /* Stuff used by the shared space checkpointing mechanism */
++ /* If this value is zero, then this mechanism is disabled */
++
++/* int nCheckpointReservedBlocks; */ /* Blocks to reserve for checkpoint data */
++
++
++ int nShortOpCaches; /* If <= 0, then short op caching is disabled, else
++ * the number of short op caches (don't use too many)
++ */
++
++ int useHeaderFileSize; /* Flag to determine if we should use file sizes from the header */
++
++ int useNANDECC; /* Flag to decide whether or not to use NANDECC */
++
++ void *genericDevice; /* Pointer to device context
++ * On an mtd this holds the mtd pointer.
++ */
++ void *superBlock;
++
++ /* NAND access functions (Must be set before calling YAFFS)*/
++
++ int (*writeChunkToNAND) (struct yaffs_DeviceStruct *dev,
++ int chunkInNAND, const __u8 *data,
++ const yaffs_Spare *spare);
++ int (*readChunkFromNAND) (struct yaffs_DeviceStruct *dev,
++ int chunkInNAND, __u8 *data,
++ yaffs_Spare *spare);
++ int (*eraseBlockInNAND) (struct yaffs_DeviceStruct *dev,
++ int blockInNAND);
++ int (*initialiseNAND) (struct yaffs_DeviceStruct *dev);
++ int (*deinitialiseNAND) (struct yaffs_DeviceStruct *dev);
++
++#ifdef CONFIG_YAFFS_YAFFS2
++ int (*writeChunkWithTagsToNAND) (struct yaffs_DeviceStruct *dev,
++ int chunkInNAND, const __u8 *data,
++ const yaffs_ExtendedTags *tags);
++ int (*readChunkWithTagsFromNAND) (struct yaffs_DeviceStruct *dev,
++ int chunkInNAND, __u8 *data,
++ yaffs_ExtendedTags *tags);
++ int (*markNANDBlockBad) (struct yaffs_DeviceStruct *dev, int blockNo);
++ int (*queryNANDBlock) (struct yaffs_DeviceStruct *dev, int blockNo,
++ yaffs_BlockState *state, __u32 *sequenceNumber);
++#endif
++
++ int isYaffs2;
++
++ /* The removeObjectCallback function must be supplied by OS flavours that
++ * need it. The Linux kernel does not use this, but yaffs direct does use
++ * it to implement the faster readdir
++ */
++ void (*removeObjectCallback)(struct yaffs_ObjectStruct *obj);
++
++ /* Callback to mark the superblock dirsty */
++ void (*markSuperBlockDirty)(void *superblock);
++
++ int wideTnodesDisabled; /* Set to disable wide tnodes */
++
++ YCHAR *pathDividers; /* String of legal path dividers */
++
++
++ /* End of stuff that must be set before initialisation. */
++
++ /* Checkpoint control. Can be set before or after initialisation */
++ __u8 skipCheckpointRead;
++ __u8 skipCheckpointWrite;
++
++ /* Runtime parameters. Set up by YAFFS. */
++
++ __u16 chunkGroupBits; /* 0 for devices <= 32MB. else log2(nchunks) - 16 */
++ __u16 chunkGroupSize; /* == 2^^chunkGroupBits */
++
++ /* Stuff to support wide tnodes */
++ __u32 tnodeWidth;
++ __u32 tnodeMask;
++
++ /* Stuff for figuring out file offset to chunk conversions */
++ __u32 chunkShift; /* Shift value */
++ __u32 chunkDiv; /* Divisor after shifting: 1 for power-of-2 sizes */
++ __u32 chunkMask; /* Mask to use for power-of-2 case */
++
++ /* Stuff to handle inband tags */
++ int inbandTags;
++ __u32 totalBytesPerChunk;
++
++#ifdef __KERNEL__
++
++ struct semaphore sem; /* Semaphore for waiting on erasure.*/
++ struct semaphore grossLock; /* Gross locking semaphore */
++ __u8 *spareBuffer; /* For mtdif2 use. Don't know the size of the buffer
++ * at compile time so we have to allocate it.
++ */
++ void (*putSuperFunc) (struct super_block *sb);
++#endif
++
++ int isMounted;
++
++ int isCheckpointed;
++
++
++ /* Stuff to support block offsetting to support start block zero */
++ int internalStartBlock;
++ int internalEndBlock;
++ int blockOffset;
++ int chunkOffset;
++
++
++ /* Runtime checkpointing stuff */
++ int checkpointPageSequence; /* running sequence number of checkpoint pages */
++ int checkpointByteCount;
++ int checkpointByteOffset;
++ __u8 *checkpointBuffer;
++ int checkpointOpenForWrite;
++ int blocksInCheckpoint;
++ int checkpointCurrentChunk;
++ int checkpointCurrentBlock;
++ int checkpointNextBlock;
++ int *checkpointBlockList;
++ int checkpointMaxBlocks;
++ __u32 checkpointSum;
++ __u32 checkpointXor;
++
++ int nCheckpointBlocksRequired; /* Number of blocks needed to store current checkpoint set */
++
++ /* Block Info */
++ yaffs_BlockInfo *blockInfo;
++ __u8 *chunkBits; /* bitmap of chunks in use */
++ unsigned blockInfoAlt:1; /* was allocated using alternative strategy */
++ unsigned chunkBitsAlt:1; /* was allocated using alternative strategy */
++ int chunkBitmapStride; /* Number of bytes of chunkBits per block.
++ * Must be consistent with nChunksPerBlock.
++ */
++
++ int nErasedBlocks;
++ int allocationBlock; /* Current block being allocated off */
++ __u32 allocationPage;
++ int allocationBlockFinder; /* Used to search for next allocation block */
++
++ /* Runtime state */
++ int nTnodesCreated;
++ yaffs_Tnode *freeTnodes;
++ int nFreeTnodes;
++ yaffs_TnodeList *allocatedTnodeList;
++
++ int isDoingGC;
++ int gcBlock;
++ int gcChunk;
++
++ int nObjectsCreated;
++ yaffs_Object *freeObjects;
++ int nFreeObjects;
++
++ int nHardLinks;
++
++ yaffs_ObjectList *allocatedObjectList;
++
++ yaffs_ObjectBucket objectBucket[YAFFS_NOBJECT_BUCKETS];
++
++ int nFreeChunks;
++
++ int currentDirtyChecker; /* Used to find current dirtiest block */
++
++ __u32 *gcCleanupList; /* objects to delete at the end of a GC. */
++ int nonAggressiveSkip; /* GC state/mode */
++
++ /* Statistcs */
++ int nPageWrites;
++ int nPageReads;
++ int nBlockErasures;
++ int nErasureFailures;
++ int nGCCopies;
++ int garbageCollections;
++ int passiveGarbageCollections;
++ int nRetriedWrites;
++ int nRetiredBlocks;
++ int eccFixed;
++ int eccUnfixed;
++ int tagsEccFixed;
++ int tagsEccUnfixed;
++ int nDeletions;
++ int nUnmarkedDeletions;
++
++ int hasPendingPrioritisedGCs; /* We think this device might have pending prioritised gcs */
++
++ /* Special directories */
++ yaffs_Object *rootDir;
++ yaffs_Object *lostNFoundDir;
++
++ /* Buffer areas for storing data to recover from write failures TODO
++ * __u8 bufferedData[YAFFS_CHUNKS_PER_BLOCK][YAFFS_BYTES_PER_CHUNK];
++ * yaffs_Spare bufferedSpare[YAFFS_CHUNKS_PER_BLOCK];
++ */
++
++ int bufferedBlock; /* Which block is buffered here? */
++ int doingBufferedBlockRewrite;
++
++ yaffs_ChunkCache *srCache;
++ int srLastUse;
++
++ int cacheHits;
++
++ /* Stuff for background deletion and unlinked files.*/
++ yaffs_Object *unlinkedDir; /* Directory where unlinked and deleted files live. */
++ yaffs_Object *deletedDir; /* Directory where deleted objects are sent to disappear. */
++ yaffs_Object *unlinkedDeletion; /* Current file being background deleted.*/
++ int nDeletedFiles; /* Count of files awaiting deletion;*/
++ int nUnlinkedFiles; /* Count of unlinked files. */
++ int nBackgroundDeletions; /* Count of background deletions. */
++
++
++ /* Temporary buffer management */
++ yaffs_TempBuffer tempBuffer[YAFFS_N_TEMP_BUFFERS];
++ int maxTemp;
++ int tempInUse;
++ int unmanagedTempAllocations;
++ int unmanagedTempDeallocations;
++
++ /* yaffs2 runtime stuff */
++ unsigned sequenceNumber; /* Sequence number of currently allocating block */
++ unsigned oldestDirtySequence;
++
++};
++
++typedef struct yaffs_DeviceStruct yaffs_Device;
++
++/* The static layout of block usage etc is stored in the super block header */
++typedef struct {
++ int StructType;
++ int version;
++ int checkpointStartBlock;
++ int checkpointEndBlock;
++ int startBlock;
++ int endBlock;
++ int rfu[100];
++} yaffs_SuperBlockHeader;
++
++/* The CheckpointDevice structure holds the device information that changes at runtime and
++ * must be preserved over unmount/mount cycles.
++ */
++typedef struct {
++ int structType;
++ int nErasedBlocks;
++ int allocationBlock; /* Current block being allocated off */
++ __u32 allocationPage;
++ int nFreeChunks;
++
++ int nDeletedFiles; /* Count of files awaiting deletion;*/
++ int nUnlinkedFiles; /* Count of unlinked files. */
++ int nBackgroundDeletions; /* Count of background deletions. */
++
++ /* yaffs2 runtime stuff */
++ unsigned sequenceNumber; /* Sequence number of currently allocating block */
++ unsigned oldestDirtySequence;
++
++} yaffs_CheckpointDevice;
++
++
++typedef struct {
++ int structType;
++ __u32 magic;
++ __u32 version;
++ __u32 head;
++} yaffs_CheckpointValidity;
++
++
++/*----------------------- YAFFS Functions -----------------------*/
++
++int yaffs_GutsInitialise(yaffs_Device *dev);
++void yaffs_Deinitialise(yaffs_Device *dev);
++
++int yaffs_GetNumberOfFreeChunks(yaffs_Device *dev);
++
++int yaffs_RenameObject(yaffs_Object *oldDir, const YCHAR *oldName,
++ yaffs_Object *newDir, const YCHAR *newName);
++
++int yaffs_Unlink(yaffs_Object *dir, const YCHAR *name);
++int yaffs_DeleteObject(yaffs_Object *obj);
++
++int yaffs_GetObjectName(yaffs_Object *obj, YCHAR *name, int buffSize);
++int yaffs_GetObjectFileLength(yaffs_Object *obj);
++int yaffs_GetObjectInode(yaffs_Object *obj);
++unsigned yaffs_GetObjectType(yaffs_Object *obj);
++int yaffs_GetObjectLinkCount(yaffs_Object *obj);
++
++int yaffs_SetAttributes(yaffs_Object *obj, struct iattr *attr);
++int yaffs_GetAttributes(yaffs_Object *obj, struct iattr *attr);
++
++/* File operations */
++int yaffs_ReadDataFromFile(yaffs_Object *obj, __u8 *buffer, loff_t offset,
++ int nBytes);
++int yaffs_WriteDataToFile(yaffs_Object *obj, const __u8 *buffer, loff_t offset,
++ int nBytes, int writeThrough);
++int yaffs_ResizeFile(yaffs_Object *obj, loff_t newSize);
++
++yaffs_Object *yaffs_MknodFile(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid);
++int yaffs_FlushFile(yaffs_Object *obj, int updateTime);
++
++/* Flushing and checkpointing */
++void yaffs_FlushEntireDeviceCache(yaffs_Device *dev);
++
++int yaffs_CheckpointSave(yaffs_Device *dev);
++int yaffs_CheckpointRestore(yaffs_Device *dev);
++
++/* Directory operations */
++yaffs_Object *yaffs_MknodDirectory(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid);
++yaffs_Object *yaffs_FindObjectByName(yaffs_Object *theDir, const YCHAR *name);
++int yaffs_ApplyToDirectoryChildren(yaffs_Object *theDir,
++ int (*fn) (yaffs_Object *));
++
++yaffs_Object *yaffs_FindObjectByNumber(yaffs_Device *dev, __u32 number);
++
++/* Link operations */
++yaffs_Object *yaffs_Link(yaffs_Object *parent, const YCHAR *name,
++ yaffs_Object *equivalentObject);
++
++yaffs_Object *yaffs_GetEquivalentObject(yaffs_Object *obj);
++
++/* Symlink operations */
++yaffs_Object *yaffs_MknodSymLink(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid,
++ const YCHAR *alias);
++YCHAR *yaffs_GetSymlinkAlias(yaffs_Object *obj);
++
++/* Special inodes (fifos, sockets and devices) */
++yaffs_Object *yaffs_MknodSpecial(yaffs_Object *parent, const YCHAR *name,
++ __u32 mode, __u32 uid, __u32 gid, __u32 rdev);
++
++/* Special directories */
++yaffs_Object *yaffs_Root(yaffs_Device *dev);
++yaffs_Object *yaffs_LostNFound(yaffs_Device *dev);
++
++#ifdef CONFIG_YAFFS_WINCE
++/* CONFIG_YAFFS_WINCE special stuff */
++void yfsd_WinFileTimeNow(__u32 target[2]);
++#endif
++
++#ifdef __KERNEL__
++
++void yaffs_HandleDeferedFree(yaffs_Object *obj);
++#endif
++
++/* Debug dump */
++int yaffs_DumpObject(yaffs_Object *obj);
++
++void yaffs_GutsTest(yaffs_Device *dev);
++
++/* A few useful functions */
++void yaffs_InitialiseTags(yaffs_ExtendedTags *tags);
++void yaffs_DeleteChunk(yaffs_Device *dev, int chunkId, int markNAND, int lyn);
++int yaffs_CheckFF(__u8 *buffer, int nBytes);
++void yaffs_HandleChunkError(yaffs_Device *dev, yaffs_BlockInfo *bi);
++
++__u8 *yaffs_GetTempBuffer(yaffs_Device *dev, int lineNo);
++void yaffs_ReleaseTempBuffer(yaffs_Device *dev, __u8 *buffer, int lineNo);
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif.c linux-2.6.29.1/fs/yaffs2/yaffs_mtdif.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_mtdif.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,241 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++const char *yaffs_mtdif_c_version =
++ "$Id: yaffs_mtdif.c,v 1.22 2009-03-06 17:20:51 wookey Exp $";
++
++#include "yportenv.h"
++
++
++#include "yaffs_mtdif.h"
++
++#include "linux/mtd/mtd.h"
++#include "linux/types.h"
++#include "linux/time.h"
++#include "linux/mtd/nand.h"
++
++#if (MTD_VERSION_CODE < MTD_VERSION(2, 6, 18))
++static struct nand_oobinfo yaffs_oobinfo = {
++ .useecc = 1,
++ .eccbytes = 6,
++ .eccpos = {8, 9, 10, 13, 14, 15}
++};
++
++static struct nand_oobinfo yaffs_noeccinfo = {
++ .useecc = 0,
++};
++#endif
++
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++static inline void translate_spare2oob(const yaffs_Spare *spare, __u8 *oob)
++{
++ oob[0] = spare->tagByte0;
++ oob[1] = spare->tagByte1;
++ oob[2] = spare->tagByte2;
++ oob[3] = spare->tagByte3;
++ oob[4] = spare->tagByte4;
++ oob[5] = spare->tagByte5 & 0x3f;
++ oob[5] |= spare->blockStatus == 'Y' ? 0 : 0x80;
++ oob[5] |= spare->pageStatus == 0 ? 0 : 0x40;
++ oob[6] = spare->tagByte6;
++ oob[7] = spare->tagByte7;
++}
++
++static inline void translate_oob2spare(yaffs_Spare *spare, __u8 *oob)
++{
++ struct yaffs_NANDSpare *nspare = (struct yaffs_NANDSpare *)spare;
++ spare->tagByte0 = oob[0];
++ spare->tagByte1 = oob[1];
++ spare->tagByte2 = oob[2];
++ spare->tagByte3 = oob[3];
++ spare->tagByte4 = oob[4];
++ spare->tagByte5 = oob[5] == 0xff ? 0xff : oob[5] & 0x3f;
++ spare->blockStatus = oob[5] & 0x80 ? 0xff : 'Y';
++ spare->pageStatus = oob[5] & 0x40 ? 0xff : 0;
++ spare->ecc1[0] = spare->ecc1[1] = spare->ecc1[2] = 0xff;
++ spare->tagByte6 = oob[6];
++ spare->tagByte7 = oob[7];
++ spare->ecc2[0] = spare->ecc2[1] = spare->ecc2[2] = 0xff;
++
++ nspare->eccres1 = nspare->eccres2 = 0; /* FIXME */
++}
++#endif
++
++int nandmtd_WriteChunkToNAND(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data, const yaffs_Spare *spare)
++{
++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++ struct mtd_oob_ops ops;
++#endif
++ size_t dummy;
++ int retval = 0;
++
++ loff_t addr = ((loff_t) chunkInNAND) * dev->nDataBytesPerChunk;
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++ __u8 spareAsBytes[8]; /* OOB */
++
++ if (data && !spare)
++ retval = mtd->write(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data);
++ else if (spare) {
++ if (dev->useNANDECC) {
++ translate_spare2oob(spare, spareAsBytes);
++ ops.mode = MTD_OOB_AUTO;
++ ops.ooblen = 8; /* temp hack */
++ } else {
++ ops.mode = MTD_OOB_RAW;
++ ops.ooblen = YAFFS_BYTES_PER_SPARE;
++ }
++ ops.len = data ? dev->nDataBytesPerChunk : ops.ooblen;
++ ops.datbuf = (u8 *)data;
++ ops.ooboffs = 0;
++ ops.oobbuf = spareAsBytes;
++ retval = mtd->write_oob(mtd, addr, &ops);
++ }
++#else
++ __u8 *spareAsBytes = (__u8 *) spare;
++
++ if (data && spare) {
++ if (dev->useNANDECC)
++ retval =
++ mtd->write_ecc(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data, spareAsBytes,
++ &yaffs_oobinfo);
++ else
++ retval =
++ mtd->write_ecc(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data, spareAsBytes,
++ &yaffs_noeccinfo);
++ } else {
++ if (data)
++ retval =
++ mtd->write(mtd, addr, dev->nDataBytesPerChunk, &dummy,
++ data);
++ if (spare)
++ retval =
++ mtd->write_oob(mtd, addr, YAFFS_BYTES_PER_SPARE,
++ &dummy, spareAsBytes);
++ }
++#endif
++
++ if (retval == 0)
++ return YAFFS_OK;
++ else
++ return YAFFS_FAIL;
++}
++
++int nandmtd_ReadChunkFromNAND(yaffs_Device *dev, int chunkInNAND, __u8 *data,
++ yaffs_Spare *spare)
++{
++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++ struct mtd_oob_ops ops;
++#endif
++ size_t dummy;
++ int retval = 0;
++
++ loff_t addr = ((loff_t) chunkInNAND) * dev->nDataBytesPerChunk;
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++ __u8 spareAsBytes[8]; /* OOB */
++
++ if (data && !spare)
++ retval = mtd->read(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data);
++ else if (spare) {
++ if (dev->useNANDECC) {
++ ops.mode = MTD_OOB_AUTO;
++ ops.ooblen = 8; /* temp hack */
++ } else {
++ ops.mode = MTD_OOB_RAW;
++ ops.ooblen = YAFFS_BYTES_PER_SPARE;
++ }
++ ops.len = data ? dev->nDataBytesPerChunk : ops.ooblen;
++ ops.datbuf = data;
++ ops.ooboffs = 0;
++ ops.oobbuf = spareAsBytes;
++ retval = mtd->read_oob(mtd, addr, &ops);
++ if (dev->useNANDECC)
++ translate_oob2spare(spare, spareAsBytes);
++ }
++#else
++ __u8 *spareAsBytes = (__u8 *) spare;
++
++ if (data && spare) {
++ if (dev->useNANDECC) {
++ /* Careful, this call adds 2 ints */
++ /* to the end of the spare data. Calling function */
++ /* should allocate enough memory for spare, */
++ /* i.e. [YAFFS_BYTES_PER_SPARE+2*sizeof(int)]. */
++ retval =
++ mtd->read_ecc(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data, spareAsBytes,
++ &yaffs_oobinfo);
++ } else {
++ retval =
++ mtd->read_ecc(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data, spareAsBytes,
++ &yaffs_noeccinfo);
++ }
++ } else {
++ if (data)
++ retval =
++ mtd->read(mtd, addr, dev->nDataBytesPerChunk, &dummy,
++ data);
++ if (spare)
++ retval =
++ mtd->read_oob(mtd, addr, YAFFS_BYTES_PER_SPARE,
++ &dummy, spareAsBytes);
++ }
++#endif
++
++ if (retval == 0)
++ return YAFFS_OK;
++ else
++ return YAFFS_FAIL;
++}
++
++int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber)
++{
++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
++ __u32 addr =
++ ((loff_t) blockNumber) * dev->nDataBytesPerChunk
++ * dev->nChunksPerBlock;
++ struct erase_info ei;
++ int retval = 0;
++
++ ei.mtd = mtd;
++ ei.addr = addr;
++ ei.len = dev->nDataBytesPerChunk * dev->nChunksPerBlock;
++ ei.time = 1000;
++ ei.retries = 2;
++ ei.callback = NULL;
++ ei.priv = (u_long) dev;
++
++ /* Todo finish off the ei if required */
++
++ sema_init(&dev->sem, 0);
++
++ retval = mtd->erase(mtd, &ei);
++
++ if (retval == 0)
++ return YAFFS_OK;
++ else
++ return YAFFS_FAIL;
++}
++
++int nandmtd_InitialiseNAND(yaffs_Device *dev)
++{
++ return YAFFS_OK;
++}
++
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif.h linux-2.6.29.1/fs/yaffs2/yaffs_mtdif.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_mtdif.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,32 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_MTDIF_H__
++#define __YAFFS_MTDIF_H__
++
++#include "yaffs_guts.h"
++
++#if (MTD_VERSION_CODE < MTD_VERSION(2, 6, 18))
++extern struct nand_oobinfo yaffs_oobinfo;
++extern struct nand_oobinfo yaffs_noeccinfo;
++#endif
++
++int nandmtd_WriteChunkToNAND(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data, const yaffs_Spare *spare);
++int nandmtd_ReadChunkFromNAND(yaffs_Device *dev, int chunkInNAND, __u8 *data,
++ yaffs_Spare *spare);
++int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber);
++int nandmtd_InitialiseNAND(yaffs_Device *dev);
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif1.c linux-2.6.29.1/fs/yaffs2/yaffs_mtdif1.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif1.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_mtdif1.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,365 @@
++/*
++ * YAFFS: Yet another FFS. A NAND-flash specific file system.
++ * yaffs_mtdif1.c NAND mtd interface functions for small-page NAND.
++ *
++ * Copyright (C) 2002 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++/*
++ * This module provides the interface between yaffs_nand.c and the
++ * MTD API. This version is used when the MTD interface supports the
++ * 'mtd_oob_ops' style calls to read_oob and write_oob, circa 2.6.17,
++ * and we have small-page NAND device.
++ *
++ * These functions are invoked via function pointers in yaffs_nand.c.
++ * This replaces functionality provided by functions in yaffs_mtdif.c
++ * and the yaffs_TagsCompatability functions in yaffs_tagscompat.c that are
++ * called in yaffs_mtdif.c when the function pointers are NULL.
++ * We assume the MTD layer is performing ECC (useNANDECC is true).
++ */
++
++#include "yportenv.h"
++#include "yaffs_guts.h"
++#include "yaffs_packedtags1.h"
++#include "yaffs_tagscompat.h" /* for yaffs_CalcTagsECC */
++
++#include "linux/kernel.h"
++#include "linux/version.h"
++#include "linux/types.h"
++#include "linux/mtd/mtd.h"
++
++/* Don't compile this module if we don't have MTD's mtd_oob_ops interface */
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++
++const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.10 2009-03-09 07:41:10 charles Exp $";
++
++#ifndef CONFIG_YAFFS_9BYTE_TAGS
++# define YTAG1_SIZE 8
++#else
++# define YTAG1_SIZE 9
++#endif
++
++#if 0
++/* Use the following nand_ecclayout with MTD when using
++ * CONFIG_YAFFS_9BYTE_TAGS and the older on-NAND tags layout.
++ * If you have existing Yaffs images and the byte order differs from this,
++ * adjust 'oobfree' to match your existing Yaffs data.
++ *
++ * This nand_ecclayout scatters/gathers to/from the old-yaffs layout with the
++ * pageStatus byte (at NAND spare offset 4) scattered/gathered from/to
++ * the 9th byte.
++ *
++ * Old-style on-NAND format: T0,T1,T2,T3,P,B,T4,T5,E0,E1,E2,T6,T7,E3,E4,E5
++ * We have/need PackedTags1 plus pageStatus: T0,T1,T2,T3,T4,T5,T6,T7,P
++ * where Tn are the tag bytes, En are MTD's ECC bytes, P is the pageStatus
++ * byte and B is the small-page bad-block indicator byte.
++ */
++static struct nand_ecclayout nand_oob_16 = {
++ .eccbytes = 6,
++ .eccpos = { 8, 9, 10, 13, 14, 15 },
++ .oobavail = 9,
++ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
++};
++#endif
++
++/* Write a chunk (page) of data to NAND.
++ *
++ * Caller always provides ExtendedTags data which are converted to a more
++ * compact (packed) form for storage in NAND. A mini-ECC runs over the
++ * contents of the tags meta-data; used to valid the tags when read.
++ *
++ * - Pack ExtendedTags to PackedTags1 form
++ * - Compute mini-ECC for PackedTags1
++ * - Write data and packed tags to NAND.
++ *
++ * Note: Due to the use of the PackedTags1 meta-data which does not include
++ * a full sequence number (as found in the larger PackedTags2 form) it is
++ * necessary for Yaffs to re-write a chunk/page (just once) to mark it as
++ * discarded and dirty. This is not ideal: newer NAND parts are supposed
++ * to be written just once. When Yaffs performs this operation, this
++ * function is called with a NULL data pointer -- calling MTD write_oob
++ * without data is valid usage (2.6.17).
++ *
++ * Any underlying MTD error results in YAFFS_FAIL.
++ * Returns YAFFS_OK or YAFFS_FAIL.
++ */
++int nandmtd1_WriteChunkWithTagsToNAND(yaffs_Device *dev,
++ int chunkInNAND, const __u8 *data, const yaffs_ExtendedTags *etags)
++{
++ struct mtd_info *mtd = dev->genericDevice;
++ int chunkBytes = dev->nDataBytesPerChunk;
++ loff_t addr = ((loff_t)chunkInNAND) * chunkBytes;
++ struct mtd_oob_ops ops;
++ yaffs_PackedTags1 pt1;
++ int retval;
++
++ /* we assume that PackedTags1 and yaffs_Tags are compatible */
++ compile_time_assertion(sizeof(yaffs_PackedTags1) == 12);
++ compile_time_assertion(sizeof(yaffs_Tags) == 8);
++
++ dev->nPageWrites++;
++
++ yaffs_PackTags1(&pt1, etags);
++ yaffs_CalcTagsECC((yaffs_Tags *)&pt1);
++
++ /* When deleting a chunk, the upper layer provides only skeletal
++ * etags, one with chunkDeleted set. However, we need to update the
++ * tags, not erase them completely. So we use the NAND write property
++ * that only zeroed-bits stick and set tag bytes to all-ones and
++ * zero just the (not) deleted bit.
++ */
++#ifndef CONFIG_YAFFS_9BYTE_TAGS
++ if (etags->chunkDeleted) {
++ memset(&pt1, 0xff, 8);
++ /* clear delete status bit to indicate deleted */
++ pt1.deleted = 0;
++ }
++#else
++ ((__u8 *)&pt1)[8] = 0xff;
++ if (etags->chunkDeleted) {
++ memset(&pt1, 0xff, 8);
++ /* zero pageStatus byte to indicate deleted */
++ ((__u8 *)&pt1)[8] = 0;
++ }
++#endif
++
++ memset(&ops, 0, sizeof(ops));
++ ops.mode = MTD_OOB_AUTO;
++ ops.len = (data) ? chunkBytes : 0;
++ ops.ooblen = YTAG1_SIZE;
++ ops.datbuf = (__u8 *)data;
++ ops.oobbuf = (__u8 *)&pt1;
++
++ retval = mtd->write_oob(mtd, addr, &ops);
++ if (retval) {
++ yaffs_trace(YAFFS_TRACE_MTD,
++ "write_oob failed, chunk %d, mtd error %d\n",
++ chunkInNAND, retval);
++ }
++ return retval ? YAFFS_FAIL : YAFFS_OK;
++}
++
++/* Return with empty ExtendedTags but add eccResult.
++ */
++static int rettags(yaffs_ExtendedTags *etags, int eccResult, int retval)
++{
++ if (etags) {
++ memset(etags, 0, sizeof(*etags));
++ etags->eccResult = eccResult;
++ }
++ return retval;
++}
++
++/* Read a chunk (page) from NAND.
++ *
++ * Caller expects ExtendedTags data to be usable even on error; that is,
++ * all members except eccResult and blockBad are zeroed.
++ *
++ * - Check ECC results for data (if applicable)
++ * - Check for blank/erased block (return empty ExtendedTags if blank)
++ * - Check the PackedTags1 mini-ECC (correct if necessary/possible)
++ * - Convert PackedTags1 to ExtendedTags
++ * - Update eccResult and blockBad members to refect state.
++ *
++ * Returns YAFFS_OK or YAFFS_FAIL.
++ */
++int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device *dev,
++ int chunkInNAND, __u8 *data, yaffs_ExtendedTags *etags)
++{
++ struct mtd_info *mtd = dev->genericDevice;
++ int chunkBytes = dev->nDataBytesPerChunk;
++ loff_t addr = ((loff_t)chunkInNAND) * chunkBytes;
++ int eccres = YAFFS_ECC_RESULT_NO_ERROR;
++ struct mtd_oob_ops ops;
++ yaffs_PackedTags1 pt1;
++ int retval;
++ int deleted;
++
++ dev->nPageReads++;
++
++ memset(&ops, 0, sizeof(ops));
++ ops.mode = MTD_OOB_AUTO;
++ ops.len = (data) ? chunkBytes : 0;
++ ops.ooblen = YTAG1_SIZE;
++ ops.datbuf = data;
++ ops.oobbuf = (__u8 *)&pt1;
++
++#if (MTD_VERSION_CODE < MTD_VERSION(2, 6, 20))
++ /* In MTD 2.6.18 to 2.6.19 nand_base.c:nand_do_read_oob() has a bug;
++ * help it out with ops.len = ops.ooblen when ops.datbuf == NULL.
++ */
++ ops.len = (ops.datbuf) ? ops.len : ops.ooblen;
++#endif
++ /* Read page and oob using MTD.
++ * Check status and determine ECC result.
++ */
++ retval = mtd->read_oob(mtd, addr, &ops);
++ if (retval) {
++ yaffs_trace(YAFFS_TRACE_MTD,
++ "read_oob failed, chunk %d, mtd error %d\n",
++ chunkInNAND, retval);
++ }
++
++ switch (retval) {
++ case 0:
++ /* no error */
++ break;
++
++ case -EUCLEAN:
++ /* MTD's ECC fixed the data */
++ eccres = YAFFS_ECC_RESULT_FIXED;
++ dev->eccFixed++;
++ break;
++
++ case -EBADMSG:
++ /* MTD's ECC could not fix the data */
++ dev->eccUnfixed++;
++ /* fall into... */
++ default:
++ rettags(etags, YAFFS_ECC_RESULT_UNFIXED, 0);
++ etags->blockBad = (mtd->block_isbad)(mtd, addr);
++ return YAFFS_FAIL;
++ }
++
++ /* Check for a blank/erased chunk.
++ */
++ if (yaffs_CheckFF((__u8 *)&pt1, 8)) {
++ /* when blank, upper layers want eccResult to be <= NO_ERROR */
++ return rettags(etags, YAFFS_ECC_RESULT_NO_ERROR, YAFFS_OK);
++ }
++
++#ifndef CONFIG_YAFFS_9BYTE_TAGS
++ /* Read deleted status (bit) then return it to it's non-deleted
++ * state before performing tags mini-ECC check. pt1.deleted is
++ * inverted.
++ */
++ deleted = !pt1.deleted;
++ pt1.deleted = 1;
++#else
++ deleted = (yaffs_CountBits(((__u8 *)&pt1)[8]) < 7);
++#endif
++
++ /* Check the packed tags mini-ECC and correct if necessary/possible.
++ */
++ retval = yaffs_CheckECCOnTags((yaffs_Tags *)&pt1);
++ switch (retval) {
++ case 0:
++ /* no tags error, use MTD result */
++ break;
++ case 1:
++ /* recovered tags-ECC error */
++ dev->tagsEccFixed++;
++ if (eccres == YAFFS_ECC_RESULT_NO_ERROR)
++ eccres = YAFFS_ECC_RESULT_FIXED;
++ break;
++ default:
++ /* unrecovered tags-ECC error */
++ dev->tagsEccUnfixed++;
++ return rettags(etags, YAFFS_ECC_RESULT_UNFIXED, YAFFS_FAIL);
++ }
++
++ /* Unpack the tags to extended form and set ECC result.
++ * [set shouldBeFF just to keep yaffs_UnpackTags1 happy]
++ */
++ pt1.shouldBeFF = 0xFFFFFFFF;
++ yaffs_UnpackTags1(etags, &pt1);
++ etags->eccResult = eccres;
++
++ /* Set deleted state */
++ etags->chunkDeleted = deleted;
++ return YAFFS_OK;
++}
++
++/* Mark a block bad.
++ *
++ * This is a persistant state.
++ * Use of this function should be rare.
++ *
++ * Returns YAFFS_OK or YAFFS_FAIL.
++ */
++int nandmtd1_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo)
++{
++ struct mtd_info *mtd = dev->genericDevice;
++ int blocksize = dev->nChunksPerBlock * dev->nDataBytesPerChunk;
++ int retval;
++
++ yaffs_trace(YAFFS_TRACE_BAD_BLOCKS, "marking block %d bad\n", blockNo);
++
++ retval = mtd->block_markbad(mtd, (loff_t)blocksize * blockNo);
++ return (retval) ? YAFFS_FAIL : YAFFS_OK;
++}
++
++/* Check any MTD prerequists.
++ *
++ * Returns YAFFS_OK or YAFFS_FAIL.
++ */
++static int nandmtd1_TestPrerequists(struct mtd_info *mtd)
++{
++ /* 2.6.18 has mtd->ecclayout->oobavail */
++ /* 2.6.21 has mtd->ecclayout->oobavail and mtd->oobavail */
++ int oobavail = mtd->ecclayout->oobavail;
++
++ if (oobavail < YTAG1_SIZE) {
++ yaffs_trace(YAFFS_TRACE_ERROR,
++ "mtd device has only %d bytes for tags, need %d\n",
++ oobavail, YTAG1_SIZE);
++ return YAFFS_FAIL;
++ }
++ return YAFFS_OK;
++}
++
++/* Query for the current state of a specific block.
++ *
++ * Examine the tags of the first chunk of the block and return the state:
++ * - YAFFS_BLOCK_STATE_DEAD, the block is marked bad
++ * - YAFFS_BLOCK_STATE_NEEDS_SCANNING, the block is in use
++ * - YAFFS_BLOCK_STATE_EMPTY, the block is clean
++ *
++ * Always returns YAFFS_OK.
++ */
++int nandmtd1_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo,
++ yaffs_BlockState *pState, __u32 *pSequenceNumber)
++{
++ struct mtd_info *mtd = dev->genericDevice;
++ int chunkNo = blockNo * dev->nChunksPerBlock;
++ loff_t addr = (loff_t)chunkNo * dev->nDataBytesPerChunk;
++ yaffs_ExtendedTags etags;
++ int state = YAFFS_BLOCK_STATE_DEAD;
++ int seqnum = 0;
++ int retval;
++
++ /* We don't yet have a good place to test for MTD config prerequists.
++ * Do it here as we are called during the initial scan.
++ */
++ if (nandmtd1_TestPrerequists(mtd) != YAFFS_OK)
++ return YAFFS_FAIL;
++
++ retval = nandmtd1_ReadChunkWithTagsFromNAND(dev, chunkNo, NULL, &etags);
++ etags.blockBad = (mtd->block_isbad)(mtd, addr);
++ if (etags.blockBad) {
++ yaffs_trace(YAFFS_TRACE_BAD_BLOCKS,
++ "block %d is marked bad\n", blockNo);
++ state = YAFFS_BLOCK_STATE_DEAD;
++ } else if (etags.eccResult != YAFFS_ECC_RESULT_NO_ERROR) {
++ /* bad tags, need to look more closely */
++ state = YAFFS_BLOCK_STATE_NEEDS_SCANNING;
++ } else if (etags.chunkUsed) {
++ state = YAFFS_BLOCK_STATE_NEEDS_SCANNING;
++ seqnum = etags.sequenceNumber;
++ } else {
++ state = YAFFS_BLOCK_STATE_EMPTY;
++ }
++
++ *pState = state;
++ *pSequenceNumber = seqnum;
++
++ /* query always succeeds */
++ return YAFFS_OK;
++}
++
++#endif /*MTD_VERSION*/
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif1.h linux-2.6.29.1/fs/yaffs2/yaffs_mtdif1.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif1.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_mtdif1.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,28 @@
++/*
++ * YAFFS: Yet another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_MTDIF1_H__
++#define __YAFFS_MTDIF1_H__
++
++int nandmtd1_WriteChunkWithTagsToNAND(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data, const yaffs_ExtendedTags *tags);
++
++int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
++ __u8 *data, yaffs_ExtendedTags *tags);
++
++int nandmtd1_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo);
++
++int nandmtd1_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo,
++ yaffs_BlockState *state, __u32 *sequenceNumber);
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif2.c linux-2.6.29.1/fs/yaffs2/yaffs_mtdif2.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif2.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_mtdif2.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,246 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++/* mtd interface for YAFFS2 */
++
++const char *yaffs_mtdif2_c_version =
++ "$Id: yaffs_mtdif2.c,v 1.23 2009-03-06 17:20:53 wookey Exp $";
++
++#include "yportenv.h"
++
++
++#include "yaffs_mtdif2.h"
++
++#include "linux/mtd/mtd.h"
++#include "linux/types.h"
++#include "linux/time.h"
++
++#include "yaffs_packedtags2.h"
++
++/* NB For use with inband tags....
++ * We assume that the data buffer is of size totalBytersPerChunk so that we can also
++ * use it to load the tags.
++ */
++int nandmtd2_WriteChunkWithTagsToNAND(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data,
++ const yaffs_ExtendedTags *tags)
++{
++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++ struct mtd_oob_ops ops;
++#else
++ size_t dummy;
++#endif
++ int retval = 0;
++
++ loff_t addr;
++
++ yaffs_PackedTags2 pt;
++
++ T(YAFFS_TRACE_MTD,
++ (TSTR
++ ("nandmtd2_WriteChunkWithTagsToNAND chunk %d data %p tags %p"
++ TENDSTR), chunkInNAND, data, tags));
++
++
++ addr = ((loff_t) chunkInNAND) * dev->totalBytesPerChunk;
++
++ /* For yaffs2 writing there must be both data and tags.
++ * If we're using inband tags, then the tags are stuffed into
++ * the end of the data buffer.
++ */
++ if (!data || !tags)
++ BUG();
++ else if (dev->inbandTags) {
++ yaffs_PackedTags2TagsPart *pt2tp;
++ pt2tp = (yaffs_PackedTags2TagsPart *)(data + dev->nDataBytesPerChunk);
++ yaffs_PackTags2TagsPart(pt2tp, tags);
++ } else
++ yaffs_PackTags2(&pt, tags);
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++ ops.mode = MTD_OOB_AUTO;
++ ops.ooblen = (dev->inbandTags) ? 0 : sizeof(pt);
++ ops.len = dev->totalBytesPerChunk;
++ ops.ooboffs = 0;
++ ops.datbuf = (__u8 *)data;
++ ops.oobbuf = (dev->inbandTags) ? NULL : (void *)&pt;
++ retval = mtd->write_oob(mtd, addr, &ops);
++
++#else
++ if (!dev->inbandTags) {
++ retval =
++ mtd->write_ecc(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data, (__u8 *) &pt, NULL);
++ } else {
++ retval =
++ mtd->write(mtd, addr, dev->totalBytesPerChunk, &dummy,
++ data);
++ }
++#endif
++
++ if (retval == 0)
++ return YAFFS_OK;
++ else
++ return YAFFS_FAIL;
++}
++
++int nandmtd2_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
++ __u8 *data, yaffs_ExtendedTags *tags)
++{
++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
++#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
++ struct mtd_oob_ops ops;
++#endif
++ size_t dummy;
++ int retval = 0;
++ int localData = 0;
++
++ loff_t addr = ((loff_t) chunkInNAND) * dev->totalBytesPerChunk;
++
++ yaffs_PackedTags2 pt;
++
++ T(YAFFS_TRACE_MTD,
++ (TSTR
++ ("nandmtd2_ReadChunkWithTagsFromNAND chunk %d data %p tags %p"
++ TENDSTR), chunkInNAND, data, tags));
++
++ if (dev->inbandTags) {
++
++ if (!data) {
++ localData = 1;
++ data = yaffs_GetTempBuffer(dev, __LINE__);
++ }
++
++
++ }
++
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
++ if (dev->inbandTags || (data && !tags))
++ retval = mtd->read(mtd, addr, dev->totalBytesPerChunk,
++ &dummy, data);
++ else if (tags) {
++ ops.mode = MTD_OOB_AUTO;
++ ops.ooblen = sizeof(pt);
++ ops.len = data ? dev->nDataBytesPerChunk : sizeof(pt);
++ ops.ooboffs = 0;
++ ops.datbuf = data;
++ ops.oobbuf = dev->spareBuffer;
++ retval = mtd->read_oob(mtd, addr, &ops);
++ }
++#else
++ if (!dev->inbandTags && data && tags) {
++
++ retval = mtd->read_ecc(mtd, addr, dev->nDataBytesPerChunk,
++ &dummy, data, dev->spareBuffer,
++ NULL);
++ } else {
++ if (data)
++ retval =
++ mtd->read(mtd, addr, dev->nDataBytesPerChunk, &dummy,
++ data);
++ if (!dev->inbandTags && tags)
++ retval =
++ mtd->read_oob(mtd, addr, mtd->oobsize, &dummy,
++ dev->spareBuffer);
++ }
++#endif
++
++
++ if (dev->inbandTags) {
++ if (tags) {
++ yaffs_PackedTags2TagsPart *pt2tp;
++ pt2tp = (yaffs_PackedTags2TagsPart *)&data[dev->nDataBytesPerChunk];
++ yaffs_UnpackTags2TagsPart(tags, pt2tp);
++ }
++ } else {
++ if (tags) {
++ memcpy(&pt, dev->spareBuffer, sizeof(pt));
++ yaffs_UnpackTags2(tags, &pt);
++ }
++ }
++
++ if (localData)
++ yaffs_ReleaseTempBuffer(dev, data, __LINE__);
++
++ if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
++ tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
++ if (retval == 0)
++ return YAFFS_OK;
++ else
++ return YAFFS_FAIL;
++}
++
++int nandmtd2_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo)
++{
++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
++ int retval;
++ T(YAFFS_TRACE_MTD,
++ (TSTR("nandmtd2_MarkNANDBlockBad %d" TENDSTR), blockNo));
++
++ retval =
++ mtd->block_markbad(mtd,
++ blockNo * dev->nChunksPerBlock *
++ dev->totalBytesPerChunk);
++
++ if (retval == 0)
++ return YAFFS_OK;
++ else
++ return YAFFS_FAIL;
++
++}
++
++int nandmtd2_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo,
++ yaffs_BlockState *state, __u32 *sequenceNumber)
++{
++ struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
++ int retval;
++
++ T(YAFFS_TRACE_MTD,
++ (TSTR("nandmtd2_QueryNANDBlock %d" TENDSTR), blockNo));
++ retval =
++ mtd->block_isbad(mtd,
++ blockNo * dev->nChunksPerBlock *
++ dev->totalBytesPerChunk);
++
++ if (retval) {
++ T(YAFFS_TRACE_MTD, (TSTR("block is bad" TENDSTR)));
++
++ *state = YAFFS_BLOCK_STATE_DEAD;
++ *sequenceNumber = 0;
++ } else {
++ yaffs_ExtendedTags t;
++ nandmtd2_ReadChunkWithTagsFromNAND(dev,
++ blockNo *
++ dev->nChunksPerBlock, NULL,
++ &t);
++
++ if (t.chunkUsed) {
++ *sequenceNumber = t.sequenceNumber;
++ *state = YAFFS_BLOCK_STATE_NEEDS_SCANNING;
++ } else {
++ *sequenceNumber = 0;
++ *state = YAFFS_BLOCK_STATE_EMPTY;
++ }
++ }
++ T(YAFFS_TRACE_MTD,
++ (TSTR("block is bad seq %d state %d" TENDSTR), *sequenceNumber,
++ *state));
++
++ if (retval == 0)
++ return YAFFS_OK;
++ else
++ return YAFFS_FAIL;
++}
++
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif2.h linux-2.6.29.1/fs/yaffs2/yaffs_mtdif2.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_mtdif2.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_mtdif2.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,29 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_MTDIF2_H__
++#define __YAFFS_MTDIF2_H__
++
++#include "yaffs_guts.h"
++int nandmtd2_WriteChunkWithTagsToNAND(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data,
++ const yaffs_ExtendedTags *tags);
++int nandmtd2_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
++ __u8 *data, yaffs_ExtendedTags *tags);
++int nandmtd2_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo);
++int nandmtd2_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo,
++ yaffs_BlockState *state, __u32 *sequenceNumber);
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_nand.c linux-2.6.29.1/fs/yaffs2/yaffs_nand.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_nand.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_nand.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,135 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++const char *yaffs_nand_c_version =
++ "$Id: yaffs_nand.c,v 1.10 2009-03-06 17:20:54 wookey Exp $";
++
++#include "yaffs_nand.h"
++#include "yaffs_tagscompat.h"
++#include "yaffs_tagsvalidity.h"
++
++#include "yaffs_getblockinfo.h"
++
++int yaffs_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
++ __u8 *buffer,
++ yaffs_ExtendedTags *tags)
++{
++ int result;
++ yaffs_ExtendedTags localTags;
++
++ int realignedChunkInNAND = chunkInNAND - dev->chunkOffset;
++
++ /* If there are no tags provided, use local tags to get prioritised gc working */
++ if (!tags)
++ tags = &localTags;
++
++ if (dev->readChunkWithTagsFromNAND)
++ result = dev->readChunkWithTagsFromNAND(dev, realignedChunkInNAND, buffer,
++ tags);
++ else
++ result = yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(dev,
++ realignedChunkInNAND,
++ buffer,
++ tags);
++ if (tags &&
++ tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR) {
++
++ yaffs_BlockInfo *bi = yaffs_GetBlockInfo(dev, chunkInNAND/dev->nChunksPerBlock);
++ yaffs_HandleChunkError(dev, bi);
++ }
++
++ return result;
++}
++
++int yaffs_WriteChunkWithTagsToNAND(yaffs_Device *dev,
++ int chunkInNAND,
++ const __u8 *buffer,
++ yaffs_ExtendedTags *tags)
++{
++ chunkInNAND -= dev->chunkOffset;
++
++
++ if (tags) {
++ tags->sequenceNumber = dev->sequenceNumber;
++ tags->chunkUsed = 1;
++ if (!yaffs_ValidateTags(tags)) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("Writing uninitialised tags" TENDSTR)));
++ YBUG();
++ }
++ T(YAFFS_TRACE_WRITE,
++ (TSTR("Writing chunk %d tags %d %d" TENDSTR), chunkInNAND,
++ tags->objectId, tags->chunkId));
++ } else {
++ T(YAFFS_TRACE_ERROR, (TSTR("Writing with no tags" TENDSTR)));
++ YBUG();
++ }
++
++ if (dev->writeChunkWithTagsToNAND)
++ return dev->writeChunkWithTagsToNAND(dev, chunkInNAND, buffer,
++ tags);
++ else
++ return yaffs_TagsCompatabilityWriteChunkWithTagsToNAND(dev,
++ chunkInNAND,
++ buffer,
++ tags);
++}
++
++int yaffs_MarkBlockBad(yaffs_Device *dev, int blockNo)
++{
++ blockNo -= dev->blockOffset;
++
++;
++ if (dev->markNANDBlockBad)
++ return dev->markNANDBlockBad(dev, blockNo);
++ else
++ return yaffs_TagsCompatabilityMarkNANDBlockBad(dev, blockNo);
++}
++
++int yaffs_QueryInitialBlockState(yaffs_Device *dev,
++ int blockNo,
++ yaffs_BlockState *state,
++ __u32 *sequenceNumber)
++{
++ blockNo -= dev->blockOffset;
++
++ if (dev->queryNANDBlock)
++ return dev->queryNANDBlock(dev, blockNo, state, sequenceNumber);
++ else
++ return yaffs_TagsCompatabilityQueryNANDBlock(dev, blockNo,
++ state,
++ sequenceNumber);
++}
++
++
++int yaffs_EraseBlockInNAND(struct yaffs_DeviceStruct *dev,
++ int blockInNAND)
++{
++ int result;
++
++ blockInNAND -= dev->blockOffset;
++
++
++ dev->nBlockErasures++;
++ result = dev->eraseBlockInNAND(dev, blockInNAND);
++
++ return result;
++}
++
++int yaffs_InitialiseNAND(struct yaffs_DeviceStruct *dev)
++{
++ return dev->initialiseNAND(dev);
++}
++
++
++
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_nand.h linux-2.6.29.1/fs/yaffs2/yaffs_nand.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_nand.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_nand.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,44 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_NAND_H__
++#define __YAFFS_NAND_H__
++#include "yaffs_guts.h"
++
++
++
++int yaffs_ReadChunkWithTagsFromNAND(yaffs_Device *dev, int chunkInNAND,
++ __u8 *buffer,
++ yaffs_ExtendedTags *tags);
++
++int yaffs_WriteChunkWithTagsToNAND(yaffs_Device *dev,
++ int chunkInNAND,
++ const __u8 *buffer,
++ yaffs_ExtendedTags *tags);
++
++int yaffs_MarkBlockBad(yaffs_Device *dev, int blockNo);
++
++int yaffs_QueryInitialBlockState(yaffs_Device *dev,
++ int blockNo,
++ yaffs_BlockState *state,
++ unsigned *sequenceNumber);
++
++int yaffs_EraseBlockInNAND(struct yaffs_DeviceStruct *dev,
++ int blockInNAND);
++
++int yaffs_InitialiseNAND(struct yaffs_DeviceStruct *dev);
++
++#endif
++
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_nandemul2k.h linux-2.6.29.1/fs/yaffs2/yaffs_nandemul2k.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_nandemul2k.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_nandemul2k.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,39 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++/* Interface to emulated NAND functions (2k page size) */
++
++#ifndef __YAFFS_NANDEMUL2K_H__
++#define __YAFFS_NANDEMUL2K_H__
++
++#include "yaffs_guts.h"
++
++int nandemul2k_WriteChunkWithTagsToNAND(struct yaffs_DeviceStruct *dev,
++ int chunkInNAND, const __u8 *data,
++ const yaffs_ExtendedTags *tags);
++int nandemul2k_ReadChunkWithTagsFromNAND(struct yaffs_DeviceStruct *dev,
++ int chunkInNAND, __u8 *data,
++ yaffs_ExtendedTags *tags);
++int nandemul2k_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo);
++int nandemul2k_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo,
++ yaffs_BlockState *state, __u32 *sequenceNumber);
++int nandemul2k_EraseBlockInNAND(struct yaffs_DeviceStruct *dev,
++ int blockInNAND);
++int nandemul2k_InitialiseNAND(struct yaffs_DeviceStruct *dev);
++int nandemul2k_GetBytesPerChunk(void);
++int nandemul2k_GetChunksPerBlock(void);
++int nandemul2k_GetNumberOfBlocks(void);
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags1.c linux-2.6.29.1/fs/yaffs2/yaffs_packedtags1.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags1.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_packedtags1.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,50 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include "yaffs_packedtags1.h"
++#include "yportenv.h"
++
++void yaffs_PackTags1(yaffs_PackedTags1 *pt, const yaffs_ExtendedTags *t)
++{
++ pt->chunkId = t->chunkId;
++ pt->serialNumber = t->serialNumber;
++ pt->byteCount = t->byteCount;
++ pt->objectId = t->objectId;
++ pt->ecc = 0;
++ pt->deleted = (t->chunkDeleted) ? 0 : 1;
++ pt->unusedStuff = 0;
++ pt->shouldBeFF = 0xFFFFFFFF;
++
++}
++
++void yaffs_UnpackTags1(yaffs_ExtendedTags *t, const yaffs_PackedTags1 *pt)
++{
++ static const __u8 allFF[] =
++ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
++0xff };
++
++ if (memcmp(allFF, pt, sizeof(yaffs_PackedTags1))) {
++ t->blockBad = 0;
++ if (pt->shouldBeFF != 0xFFFFFFFF)
++ t->blockBad = 1;
++ t->chunkUsed = 1;
++ t->objectId = pt->objectId;
++ t->chunkId = pt->chunkId;
++ t->byteCount = pt->byteCount;
++ t->eccResult = YAFFS_ECC_RESULT_NO_ERROR;
++ t->chunkDeleted = (pt->deleted) ? 0 : 1;
++ t->serialNumber = pt->serialNumber;
++ } else {
++ memset(t, 0, sizeof(yaffs_ExtendedTags));
++ }
++}
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags1.h linux-2.6.29.1/fs/yaffs2/yaffs_packedtags1.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags1.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_packedtags1.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,37 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++/* This is used to pack YAFFS1 tags, not YAFFS2 tags. */
++
++#ifndef __YAFFS_PACKEDTAGS1_H__
++#define __YAFFS_PACKEDTAGS1_H__
++
++#include "yaffs_guts.h"
++
++typedef struct {
++ unsigned chunkId:20;
++ unsigned serialNumber:2;
++ unsigned byteCount:10;
++ unsigned objectId:18;
++ unsigned ecc:12;
++ unsigned deleted:1;
++ unsigned unusedStuff:1;
++ unsigned shouldBeFF;
++
++} yaffs_PackedTags1;
++
++void yaffs_PackTags1(yaffs_PackedTags1 *pt, const yaffs_ExtendedTags *t);
++void yaffs_UnpackTags1(yaffs_ExtendedTags *t, const yaffs_PackedTags1 *pt);
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags2.c linux-2.6.29.1/fs/yaffs2/yaffs_packedtags2.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags2.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_packedtags2.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,206 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include "yaffs_packedtags2.h"
++#include "yportenv.h"
++#include "yaffs_tagsvalidity.h"
++
++/* This code packs a set of extended tags into a binary structure for
++ * NAND storage
++ */
++
++/* Some of the information is "extra" struff which can be packed in to
++ * speed scanning
++ * This is defined by having the EXTRA_HEADER_INFO_FLAG set.
++ */
++
++/* Extra flags applied to chunkId */
++
++#define EXTRA_HEADER_INFO_FLAG 0x80000000
++#define EXTRA_SHRINK_FLAG 0x40000000
++#define EXTRA_SHADOWS_FLAG 0x20000000
++#define EXTRA_SPARE_FLAGS 0x10000000
++
++#define ALL_EXTRA_FLAGS 0xF0000000
++
++/* Also, the top 4 bits of the object Id are set to the object type. */
++#define EXTRA_OBJECT_TYPE_SHIFT (28)
++#define EXTRA_OBJECT_TYPE_MASK ((0x0F) << EXTRA_OBJECT_TYPE_SHIFT)
++
++
++static void yaffs_DumpPackedTags2TagsPart(const yaffs_PackedTags2TagsPart *ptt)
++{
++ T(YAFFS_TRACE_MTD,
++ (TSTR("packed tags obj %d chunk %d byte %d seq %d" TENDSTR),
++ ptt->objectId, ptt->chunkId, ptt->byteCount,
++ ptt->sequenceNumber));
++}
++static void yaffs_DumpPackedTags2(const yaffs_PackedTags2 *pt)
++{
++ yaffs_DumpPackedTags2TagsPart(&pt->t);
++}
++
++static void yaffs_DumpTags2(const yaffs_ExtendedTags *t)
++{
++ T(YAFFS_TRACE_MTD,
++ (TSTR
++ ("ext.tags eccres %d blkbad %d chused %d obj %d chunk%d byte %d del %d ser %d seq %d"
++ TENDSTR), t->eccResult, t->blockBad, t->chunkUsed, t->objectId,
++ t->chunkId, t->byteCount, t->chunkDeleted, t->serialNumber,
++ t->sequenceNumber));
++
++}
++
++void yaffs_PackTags2TagsPart(yaffs_PackedTags2TagsPart *ptt,
++ const yaffs_ExtendedTags *t)
++{
++ ptt->chunkId = t->chunkId;
++ ptt->sequenceNumber = t->sequenceNumber;
++ ptt->byteCount = t->byteCount;
++ ptt->objectId = t->objectId;
++
++ if (t->chunkId == 0 && t->extraHeaderInfoAvailable) {
++ /* Store the extra header info instead */
++ /* We save the parent object in the chunkId */
++ ptt->chunkId = EXTRA_HEADER_INFO_FLAG
++ | t->extraParentObjectId;
++ if (t->extraIsShrinkHeader)
++ ptt->chunkId |= EXTRA_SHRINK_FLAG;
++ if (t->extraShadows)
++ ptt->chunkId |= EXTRA_SHADOWS_FLAG;
++
++ ptt->objectId &= ~EXTRA_OBJECT_TYPE_MASK;
++ ptt->objectId |=
++ (t->extraObjectType << EXTRA_OBJECT_TYPE_SHIFT);
++
++ if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK)
++ ptt->byteCount = t->extraEquivalentObjectId;
++ else if (t->extraObjectType == YAFFS_OBJECT_TYPE_FILE)
++ ptt->byteCount = t->extraFileLength;
++ else
++ ptt->byteCount = 0;
++ }
++
++ yaffs_DumpPackedTags2TagsPart(ptt);
++ yaffs_DumpTags2(t);
++}
++
++
++void yaffs_PackTags2(yaffs_PackedTags2 *pt, const yaffs_ExtendedTags *t)
++{
++ yaffs_PackTags2TagsPart(&pt->t, t);
++
++#ifndef YAFFS_IGNORE_TAGS_ECC
++ {
++ yaffs_ECCCalculateOther((unsigned char *)&pt->t,
++ sizeof(yaffs_PackedTags2TagsPart),
++ &pt->ecc);
++ }
++#endif
++}
++
++
++void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags *t,
++ yaffs_PackedTags2TagsPart *ptt)
++{
++
++ memset(t, 0, sizeof(yaffs_ExtendedTags));
++
++ yaffs_InitialiseTags(t);
++
++ if (ptt->sequenceNumber != 0xFFFFFFFF) {
++ t->blockBad = 0;
++ t->chunkUsed = 1;
++ t->objectId = ptt->objectId;
++ t->chunkId = ptt->chunkId;
++ t->byteCount = ptt->byteCount;
++ t->chunkDeleted = 0;
++ t->serialNumber = 0;
++ t->sequenceNumber = ptt->sequenceNumber;
++
++ /* Do extra header info stuff */
++
++ if (ptt->chunkId & EXTRA_HEADER_INFO_FLAG) {
++ t->chunkId = 0;
++ t->byteCount = 0;
++
++ t->extraHeaderInfoAvailable = 1;
++ t->extraParentObjectId =
++ ptt->chunkId & (~(ALL_EXTRA_FLAGS));
++ t->extraIsShrinkHeader =
++ (ptt->chunkId & EXTRA_SHRINK_FLAG) ? 1 : 0;
++ t->extraShadows =
++ (ptt->chunkId & EXTRA_SHADOWS_FLAG) ? 1 : 0;
++ t->extraObjectType =
++ ptt->objectId >> EXTRA_OBJECT_TYPE_SHIFT;
++ t->objectId &= ~EXTRA_OBJECT_TYPE_MASK;
++
++ if (t->extraObjectType == YAFFS_OBJECT_TYPE_HARDLINK)
++ t->extraEquivalentObjectId = ptt->byteCount;
++ else
++ t->extraFileLength = ptt->byteCount;
++ }
++ }
++
++ yaffs_DumpPackedTags2TagsPart(ptt);
++ yaffs_DumpTags2(t);
++
++}
++
++
++void yaffs_UnpackTags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt)
++{
++
++ yaffs_ECCResult eccResult = YAFFS_ECC_RESULT_NO_ERROR;
++
++ if (pt->t.sequenceNumber != 0xFFFFFFFF) {
++ /* Page is in use */
++#ifndef YAFFS_IGNORE_TAGS_ECC
++ {
++ yaffs_ECCOther ecc;
++ int result;
++ yaffs_ECCCalculateOther((unsigned char *)&pt->t,
++ sizeof
++ (yaffs_PackedTags2TagsPart),
++ &ecc);
++ result =
++ yaffs_ECCCorrectOther((unsigned char *)&pt->t,
++ sizeof
++ (yaffs_PackedTags2TagsPart),
++ &pt->ecc, &ecc);
++ switch (result) {
++ case 0:
++ eccResult = YAFFS_ECC_RESULT_NO_ERROR;
++ break;
++ case 1:
++ eccResult = YAFFS_ECC_RESULT_FIXED;
++ break;
++ case -1:
++ eccResult = YAFFS_ECC_RESULT_UNFIXED;
++ break;
++ default:
++ eccResult = YAFFS_ECC_RESULT_UNKNOWN;
++ }
++ }
++#endif
++ }
++
++ yaffs_UnpackTags2TagsPart(t, &pt->t);
++
++ t->eccResult = eccResult;
++
++ yaffs_DumpPackedTags2(pt);
++ yaffs_DumpTags2(t);
++
++}
++
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags2.h linux-2.6.29.1/fs/yaffs2/yaffs_packedtags2.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_packedtags2.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_packedtags2.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,43 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++/* This is used to pack YAFFS2 tags, not YAFFS1tags. */
++
++#ifndef __YAFFS_PACKEDTAGS2_H__
++#define __YAFFS_PACKEDTAGS2_H__
++
++#include "yaffs_guts.h"
++#include "yaffs_ecc.h"
++
++typedef struct {
++ unsigned sequenceNumber;
++ unsigned objectId;
++ unsigned chunkId;
++ unsigned byteCount;
++} yaffs_PackedTags2TagsPart;
++
++typedef struct {
++ yaffs_PackedTags2TagsPart t;
++ yaffs_ECCOther ecc;
++} yaffs_PackedTags2;
++
++/* Full packed tags with ECC, used for oob tags */
++void yaffs_PackTags2(yaffs_PackedTags2 *pt, const yaffs_ExtendedTags *t);
++void yaffs_UnpackTags2(yaffs_ExtendedTags *t, yaffs_PackedTags2 *pt);
++
++/* Only the tags part (no ECC for use with inband tags */
++void yaffs_PackTags2TagsPart(yaffs_PackedTags2TagsPart *pt, const yaffs_ExtendedTags *t);
++void yaffs_UnpackTags2TagsPart(yaffs_ExtendedTags *t, yaffs_PackedTags2TagsPart *pt);
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_qsort.c linux-2.6.29.1/fs/yaffs2/yaffs_qsort.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_qsort.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_qsort.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,163 @@
++/*
++ * Copyright (c) 1992, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#include "yportenv.h"
++/* #include <linux/string.h> */
++
++/*
++ * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
++ */
++#define swapcode(TYPE, parmi, parmj, n) do { \
++ long i = (n) / sizeof (TYPE); \
++ register TYPE *pi = (TYPE *) (parmi); \
++ register TYPE *pj = (TYPE *) (parmj); \
++ do { \
++ register TYPE t = *pi; \
++ *pi++ = *pj; \
++ *pj++ = t; \
++ } while (--i > 0); \
++} while (0)
++
++#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
++ es % sizeof(long) ? 2 : es == sizeof(long) ? 0 : 1;
++
++static __inline void
++swapfunc(char *a, char *b, int n, int swaptype)
++{
++ if (swaptype <= 1)
++ swapcode(long, a, b, n);
++ else
++ swapcode(char, a, b, n);
++}
++
++#define yswap(a, b) do { \
++ if (swaptype == 0) { \
++ long t = *(long *)(a); \
++ *(long *)(a) = *(long *)(b); \
++ *(long *)(b) = t; \
++ } else \
++ swapfunc(a, b, es, swaptype); \
++} while (0)
++
++#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
++
++static __inline char *
++med3(char *a, char *b, char *c, int (*cmp)(const void *, const void *))
++{
++ return cmp(a, b) < 0 ?
++ (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a))
++ : (cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c));
++}
++
++#ifndef min
++#define min(a, b) (((a) < (b)) ? (a) : (b))
++#endif
++
++void
++yaffs_qsort(void *aa, size_t n, size_t es,
++ int (*cmp)(const void *, const void *))
++{
++ char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
++ int d, r, swaptype, swap_cnt;
++ register char *a = aa;
++
++loop: SWAPINIT(a, es);
++ swap_cnt = 0;
++ if (n < 7) {
++ for (pm = (char *)a + es; pm < (char *) a + n * es; pm += es)
++ for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
++ pl -= es)
++ yswap(pl, pl - es);
++ return;
++ }
++ pm = (char *)a + (n / 2) * es;
++ if (n > 7) {
++ pl = (char *)a;
++ pn = (char *)a + (n - 1) * es;
++ if (n > 40) {
++ d = (n / 8) * es;
++ pl = med3(pl, pl + d, pl + 2 * d, cmp);
++ pm = med3(pm - d, pm, pm + d, cmp);
++ pn = med3(pn - 2 * d, pn - d, pn, cmp);
++ }
++ pm = med3(pl, pm, pn, cmp);
++ }
++ yswap(a, pm);
++ pa = pb = (char *)a + es;
++
++ pc = pd = (char *)a + (n - 1) * es;
++ for (;;) {
++ while (pb <= pc && (r = cmp(pb, a)) <= 0) {
++ if (r == 0) {
++ swap_cnt = 1;
++ yswap(pa, pb);
++ pa += es;
++ }
++ pb += es;
++ }
++ while (pb <= pc && (r = cmp(pc, a)) >= 0) {
++ if (r == 0) {
++ swap_cnt = 1;
++ yswap(pc, pd);
++ pd -= es;
++ }
++ pc -= es;
++ }
++ if (pb > pc)
++ break;
++ yswap(pb, pc);
++ swap_cnt = 1;
++ pb += es;
++ pc -= es;
++ }
++ if (swap_cnt == 0) { /* Switch to insertion sort */
++ for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
++ for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
++ pl -= es)
++ yswap(pl, pl - es);
++ return;
++ }
++
++ pn = (char *)a + n * es;
++ r = min(pa - (char *)a, pb - pa);
++ vecswap(a, pb - r, r);
++ r = min((long)(pd - pc), (long)(pn - pd - es));
++ vecswap(pb, pn - r, r);
++ r = pb - pa;
++ if (r > es)
++ yaffs_qsort(a, r / es, es, cmp);
++ r = pd - pc;
++ if (r > es) {
++ /* Iterate rather than recurse to save stack space */
++ a = pn - r;
++ n = r / es;
++ goto loop;
++ }
++/* yaffs_qsort(pn - r, r / es, es, cmp);*/
++}
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_qsort.h linux-2.6.29.1/fs/yaffs2/yaffs_qsort.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_qsort.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_qsort.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,23 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++
++#ifndef __YAFFS_QSORT_H__
++#define __YAFFS_QSORT_H__
++
++extern void yaffs_qsort(void *const base, size_t total_elems, size_t size,
++ int (*cmp)(const void *, const void *));
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagscompat.c linux-2.6.29.1/fs/yaffs2/yaffs_tagscompat.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagscompat.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_tagscompat.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,541 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include "yaffs_guts.h"
++#include "yaffs_tagscompat.h"
++#include "yaffs_ecc.h"
++#include "yaffs_getblockinfo.h"
++
++static void yaffs_HandleReadDataError(yaffs_Device *dev, int chunkInNAND);
++#ifdef NOTYET
++static void yaffs_CheckWrittenBlock(yaffs_Device *dev, int chunkInNAND);
++static void yaffs_HandleWriteChunkOk(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data,
++ const yaffs_Spare *spare);
++static void yaffs_HandleUpdateChunk(yaffs_Device *dev, int chunkInNAND,
++ const yaffs_Spare *spare);
++static void yaffs_HandleWriteChunkError(yaffs_Device *dev, int chunkInNAND);
++#endif
++
++static const char yaffs_countBitsTable[256] = {
++ 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
++ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
++ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
++ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
++ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
++ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
++ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
++ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
++ 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
++ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
++ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
++ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
++ 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
++ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
++ 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
++ 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
++};
++
++int yaffs_CountBits(__u8 x)
++{
++ int retVal;
++ retVal = yaffs_countBitsTable[x];
++ return retVal;
++}
++
++/********** Tags ECC calculations *********/
++
++void yaffs_CalcECC(const __u8 *data, yaffs_Spare *spare)
++{
++ yaffs_ECCCalculate(data, spare->ecc1);
++ yaffs_ECCCalculate(&data[256], spare->ecc2);
++}
++
++void yaffs_CalcTagsECC(yaffs_Tags *tags)
++{
++ /* Calculate an ecc */
++
++ unsigned char *b = ((yaffs_TagsUnion *) tags)->asBytes;
++ unsigned i, j;
++ unsigned ecc = 0;
++ unsigned bit = 0;
++
++ tags->ecc = 0;
++
++ for (i = 0; i < 8; i++) {
++ for (j = 1; j & 0xff; j <<= 1) {
++ bit++;
++ if (b[i] & j)
++ ecc ^= bit;
++ }
++ }
++
++ tags->ecc = ecc;
++
++}
++
++int yaffs_CheckECCOnTags(yaffs_Tags *tags)
++{
++ unsigned ecc = tags->ecc;
++
++ yaffs_CalcTagsECC(tags);
++
++ ecc ^= tags->ecc;
++
++ if (ecc && ecc <= 64) {
++ /* TODO: Handle the failure better. Retire? */
++ unsigned char *b = ((yaffs_TagsUnion *) tags)->asBytes;
++
++ ecc--;
++
++ b[ecc / 8] ^= (1 << (ecc & 7));
++
++ /* Now recvalc the ecc */
++ yaffs_CalcTagsECC(tags);
++
++ return 1; /* recovered error */
++ } else if (ecc) {
++ /* Wierd ecc failure value */
++ /* TODO Need to do somethiong here */
++ return -1; /* unrecovered error */
++ }
++
++ return 0;
++}
++
++/********** Tags **********/
++
++static void yaffs_LoadTagsIntoSpare(yaffs_Spare *sparePtr,
++ yaffs_Tags *tagsPtr)
++{
++ yaffs_TagsUnion *tu = (yaffs_TagsUnion *) tagsPtr;
++
++ yaffs_CalcTagsECC(tagsPtr);
++
++ sparePtr->tagByte0 = tu->asBytes[0];
++ sparePtr->tagByte1 = tu->asBytes[1];
++ sparePtr->tagByte2 = tu->asBytes[2];
++ sparePtr->tagByte3 = tu->asBytes[3];
++ sparePtr->tagByte4 = tu->asBytes[4];
++ sparePtr->tagByte5 = tu->asBytes[5];
++ sparePtr->tagByte6 = tu->asBytes[6];
++ sparePtr->tagByte7 = tu->asBytes[7];
++}
++
++static void yaffs_GetTagsFromSpare(yaffs_Device *dev, yaffs_Spare *sparePtr,
++ yaffs_Tags *tagsPtr)
++{
++ yaffs_TagsUnion *tu = (yaffs_TagsUnion *) tagsPtr;
++ int result;
++
++ tu->asBytes[0] = sparePtr->tagByte0;
++ tu->asBytes[1] = sparePtr->tagByte1;
++ tu->asBytes[2] = sparePtr->tagByte2;
++ tu->asBytes[3] = sparePtr->tagByte3;
++ tu->asBytes[4] = sparePtr->tagByte4;
++ tu->asBytes[5] = sparePtr->tagByte5;
++ tu->asBytes[6] = sparePtr->tagByte6;
++ tu->asBytes[7] = sparePtr->tagByte7;
++
++ result = yaffs_CheckECCOnTags(tagsPtr);
++ if (result > 0)
++ dev->tagsEccFixed++;
++ else if (result < 0)
++ dev->tagsEccUnfixed++;
++}
++
++static void yaffs_SpareInitialise(yaffs_Spare *spare)
++{
++ memset(spare, 0xFF, sizeof(yaffs_Spare));
++}
++
++static int yaffs_WriteChunkToNAND(struct yaffs_DeviceStruct *dev,
++ int chunkInNAND, const __u8 *data,
++ yaffs_Spare *spare)
++{
++ if (chunkInNAND < dev->startBlock * dev->nChunksPerBlock) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR("**>> yaffs chunk %d is not valid" TENDSTR),
++ chunkInNAND));
++ return YAFFS_FAIL;
++ }
++
++ dev->nPageWrites++;
++ return dev->writeChunkToNAND(dev, chunkInNAND, data, spare);
++}
++
++static int yaffs_ReadChunkFromNAND(struct yaffs_DeviceStruct *dev,
++ int chunkInNAND,
++ __u8 *data,
++ yaffs_Spare *spare,
++ yaffs_ECCResult *eccResult,
++ int doErrorCorrection)
++{
++ int retVal;
++ yaffs_Spare localSpare;
++
++ dev->nPageReads++;
++
++ if (!spare && data) {
++ /* If we don't have a real spare, then we use a local one. */
++ /* Need this for the calculation of the ecc */
++ spare = &localSpare;
++ }
++
++ if (!dev->useNANDECC) {
++ retVal = dev->readChunkFromNAND(dev, chunkInNAND, data, spare);
++ if (data && doErrorCorrection) {
++ /* Do ECC correction */
++ /* Todo handle any errors */
++ int eccResult1, eccResult2;
++ __u8 calcEcc[3];
++
++ yaffs_ECCCalculate(data, calcEcc);
++ eccResult1 =
++ yaffs_ECCCorrect(data, spare->ecc1, calcEcc);
++ yaffs_ECCCalculate(&data[256], calcEcc);
++ eccResult2 =
++ yaffs_ECCCorrect(&data[256], spare->ecc2, calcEcc);
++
++ if (eccResult1 > 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>yaffs ecc error fix performed on chunk %d:0"
++ TENDSTR), chunkInNAND));
++ dev->eccFixed++;
++ } else if (eccResult1 < 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>yaffs ecc error unfixed on chunk %d:0"
++ TENDSTR), chunkInNAND));
++ dev->eccUnfixed++;
++ }
++
++ if (eccResult2 > 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>yaffs ecc error fix performed on chunk %d:1"
++ TENDSTR), chunkInNAND));
++ dev->eccFixed++;
++ } else if (eccResult2 < 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>yaffs ecc error unfixed on chunk %d:1"
++ TENDSTR), chunkInNAND));
++ dev->eccUnfixed++;
++ }
++
++ if (eccResult1 || eccResult2) {
++ /* We had a data problem on this page */
++ yaffs_HandleReadDataError(dev, chunkInNAND);
++ }
++
++ if (eccResult1 < 0 || eccResult2 < 0)
++ *eccResult = YAFFS_ECC_RESULT_UNFIXED;
++ else if (eccResult1 > 0 || eccResult2 > 0)
++ *eccResult = YAFFS_ECC_RESULT_FIXED;
++ else
++ *eccResult = YAFFS_ECC_RESULT_NO_ERROR;
++ }
++ } else {
++ /* Must allocate enough memory for spare+2*sizeof(int) */
++ /* for ecc results from device. */
++ struct yaffs_NANDSpare nspare;
++
++ memset(&nspare, 0, sizeof(nspare));
++
++ retVal = dev->readChunkFromNAND(dev, chunkInNAND, data,
++ (yaffs_Spare *) &nspare);
++ memcpy(spare, &nspare, sizeof(yaffs_Spare));
++ if (data && doErrorCorrection) {
++ if (nspare.eccres1 > 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>mtd ecc error fix performed on chunk %d:0"
++ TENDSTR), chunkInNAND));
++ } else if (nspare.eccres1 < 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>mtd ecc error unfixed on chunk %d:0"
++ TENDSTR), chunkInNAND));
++ }
++
++ if (nspare.eccres2 > 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>mtd ecc error fix performed on chunk %d:1"
++ TENDSTR), chunkInNAND));
++ } else if (nspare.eccres2 < 0) {
++ T(YAFFS_TRACE_ERROR,
++ (TSTR
++ ("**>>mtd ecc error unfixed on chunk %d:1"
++ TENDSTR), chunkInNAND));
++ }
++
++ if (nspare.eccres1 || nspare.eccres2) {
++ /* We had a data problem on this page */
++ yaffs_HandleReadDataError(dev, chunkInNAND);
++ }
++
++ if (nspare.eccres1 < 0 || nspare.eccres2 < 0)
++ *eccResult = YAFFS_ECC_RESULT_UNFIXED;
++ else if (nspare.eccres1 > 0 || nspare.eccres2 > 0)
++ *eccResult = YAFFS_ECC_RESULT_FIXED;
++ else
++ *eccResult = YAFFS_ECC_RESULT_NO_ERROR;
++
++ }
++ }
++ return retVal;
++}
++
++#ifdef NOTYET
++static int yaffs_CheckChunkErased(struct yaffs_DeviceStruct *dev,
++ int chunkInNAND)
++{
++ static int init;
++ static __u8 cmpbuf[YAFFS_BYTES_PER_CHUNK];
++ static __u8 data[YAFFS_BYTES_PER_CHUNK];
++ /* Might as well always allocate the larger size for */
++ /* dev->useNANDECC == true; */
++ static __u8 spare[sizeof(struct yaffs_NANDSpare)];
++
++ dev->readChunkFromNAND(dev, chunkInNAND, data, (yaffs_Spare *) spare);
++
++ if (!init) {
++ memset(cmpbuf, 0xff, YAFFS_BYTES_PER_CHUNK);
++ init = 1;
++ }
++
++ if (memcmp(cmpbuf, data, YAFFS_BYTES_PER_CHUNK))
++ return YAFFS_FAIL;
++ if (memcmp(cmpbuf, spare, 16))
++ return YAFFS_FAIL;
++
++ return YAFFS_OK;
++
++}
++#endif
++
++/*
++ * Functions for robustisizing
++ */
++
++static void yaffs_HandleReadDataError(yaffs_Device *dev, int chunkInNAND)
++{
++ int blockInNAND = chunkInNAND / dev->nChunksPerBlock;
++
++ /* Mark the block for retirement */
++ yaffs_GetBlockInfo(dev, blockInNAND + dev->blockOffset)->needsRetiring = 1;
++ T(YAFFS_TRACE_ERROR | YAFFS_TRACE_BAD_BLOCKS,
++ (TSTR("**>>Block %d marked for retirement" TENDSTR), blockInNAND));
++
++ /* TODO:
++ * Just do a garbage collection on the affected block
++ * then retire the block
++ * NB recursion
++ */
++}
++
++#ifdef NOTYET
++static void yaffs_CheckWrittenBlock(yaffs_Device *dev, int chunkInNAND)
++{
++}
++
++static void yaffs_HandleWriteChunkOk(yaffs_Device *dev, int chunkInNAND,
++ const __u8 *data,
++ const yaffs_Spare *spare)
++{
++}
++
++static void yaffs_HandleUpdateChunk(yaffs_Device *dev, int chunkInNAND,
++ const yaffs_Spare *spare)
++{
++}
++
++static void yaffs_HandleWriteChunkError(yaffs_Device *dev, int chunkInNAND)
++{
++ int blockInNAND = chunkInNAND / dev->nChunksPerBlock;
++
++ /* Mark the block for retirement */
++ yaffs_GetBlockInfo(dev, blockInNAND)->needsRetiring = 1;
++ /* Delete the chunk */
++ yaffs_DeleteChunk(dev, chunkInNAND, 1, __LINE__);
++}
++
++static int yaffs_VerifyCompare(const __u8 *d0, const __u8 *d1,
++ const yaffs_Spare *s0, const yaffs_Spare *s1)
++{
++
++ if (memcmp(d0, d1, YAFFS_BYTES_PER_CHUNK) != 0 ||
++ s0->tagByte0 != s1->tagByte0 ||
++ s0->tagByte1 != s1->tagByte1 ||
++ s0->tagByte2 != s1->tagByte2 ||
++ s0->tagByte3 != s1->tagByte3 ||
++ s0->tagByte4 != s1->tagByte4 ||
++ s0->tagByte5 != s1->tagByte5 ||
++ s0->tagByte6 != s1->tagByte6 ||
++ s0->tagByte7 != s1->tagByte7 ||
++ s0->ecc1[0] != s1->ecc1[0] ||
++ s0->ecc1[1] != s1->ecc1[1] ||
++ s0->ecc1[2] != s1->ecc1[2] ||
++ s0->ecc2[0] != s1->ecc2[0] ||
++ s0->ecc2[1] != s1->ecc2[1] || s0->ecc2[2] != s1->ecc2[2]) {
++ return 0;
++ }
++
++ return 1;
++}
++#endif /* NOTYET */
++
++int yaffs_TagsCompatabilityWriteChunkWithTagsToNAND(yaffs_Device *dev,
++ int chunkInNAND,
++ const __u8 *data,
++ const yaffs_ExtendedTags *eTags)
++{
++ yaffs_Spare spare;
++ yaffs_Tags tags;
++
++ yaffs_SpareInitialise(&spare);
++
++ if (eTags->chunkDeleted)
++ spare.pageStatus = 0;
++ else {
++ tags.objectId = eTags->objectId;
++ tags.chunkId = eTags->chunkId;
++
++ tags.byteCountLSB = eTags->byteCount & 0x3ff;
++
++ if (dev->nDataBytesPerChunk >= 1024)
++ tags.byteCountMSB = (eTags->byteCount >> 10) & 3;
++ else
++ tags.byteCountMSB = 3;
++
++
++ tags.serialNumber = eTags->serialNumber;
++
++ if (!dev->useNANDECC && data)
++ yaffs_CalcECC(data, &spare);
++
++ yaffs_LoadTagsIntoSpare(&spare, &tags);
++
++ }
++
++ return yaffs_WriteChunkToNAND(dev, chunkInNAND, data, &spare);
++}
++
++int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device *dev,
++ int chunkInNAND,
++ __u8 *data,
++ yaffs_ExtendedTags *eTags)
++{
++
++ yaffs_Spare spare;
++ yaffs_Tags tags;
++ yaffs_ECCResult eccResult = YAFFS_ECC_RESULT_UNKNOWN;
++
++ static yaffs_Spare spareFF;
++ static int init;
++
++ if (!init) {
++ memset(&spareFF, 0xFF, sizeof(spareFF));
++ init = 1;
++ }
++
++ if (yaffs_ReadChunkFromNAND
++ (dev, chunkInNAND, data, &spare, &eccResult, 1)) {
++ /* eTags may be NULL */
++ if (eTags) {
++
++ int deleted =
++ (yaffs_CountBits(spare.pageStatus) < 7) ? 1 : 0;
++
++ eTags->chunkDeleted = deleted;
++ eTags->eccResult = eccResult;
++ eTags->blockBad = 0; /* We're reading it */
++ /* therefore it is not a bad block */
++ eTags->chunkUsed =
++ (memcmp(&spareFF, &spare, sizeof(spareFF)) !=
++ 0) ? 1 : 0;
++
++ if (eTags->chunkUsed) {
++ yaffs_GetTagsFromSpare(dev, &spare, &tags);
++
++ eTags->objectId = tags.objectId;
++ eTags->chunkId = tags.chunkId;
++ eTags->byteCount = tags.byteCountLSB;
++
++ if (dev->nDataBytesPerChunk >= 1024)
++ eTags->byteCount |= (((unsigned) tags.byteCountMSB) << 10);
++
++ eTags->serialNumber = tags.serialNumber;
++ }
++ }
++
++ return YAFFS_OK;
++ } else {
++ return YAFFS_FAIL;
++ }
++}
++
++int yaffs_TagsCompatabilityMarkNANDBlockBad(struct yaffs_DeviceStruct *dev,
++ int blockInNAND)
++{
++
++ yaffs_Spare spare;
++
++ memset(&spare, 0xff, sizeof(yaffs_Spare));
++
++ spare.blockStatus = 'Y';
++
++ yaffs_WriteChunkToNAND(dev, blockInNAND * dev->nChunksPerBlock, NULL,
++ &spare);
++ yaffs_WriteChunkToNAND(dev, blockInNAND * dev->nChunksPerBlock + 1,
++ NULL, &spare);
++
++ return YAFFS_OK;
++
++}
++
++int yaffs_TagsCompatabilityQueryNANDBlock(struct yaffs_DeviceStruct *dev,
++ int blockNo,
++ yaffs_BlockState *state,
++ __u32 *sequenceNumber)
++{
++
++ yaffs_Spare spare0, spare1;
++ static yaffs_Spare spareFF;
++ static int init;
++ yaffs_ECCResult dummy;
++
++ if (!init) {
++ memset(&spareFF, 0xFF, sizeof(spareFF));
++ init = 1;
++ }
++
++ *sequenceNumber = 0;
++
++ yaffs_ReadChunkFromNAND(dev, blockNo * dev->nChunksPerBlock, NULL,
++ &spare0, &dummy, 1);
++ yaffs_ReadChunkFromNAND(dev, blockNo * dev->nChunksPerBlock + 1, NULL,
++ &spare1, &dummy, 1);
++
++ if (yaffs_CountBits(spare0.blockStatus & spare1.blockStatus) < 7)
++ *state = YAFFS_BLOCK_STATE_DEAD;
++ else if (memcmp(&spareFF, &spare0, sizeof(spareFF)) == 0)
++ *state = YAFFS_BLOCK_STATE_EMPTY;
++ else
++ *state = YAFFS_BLOCK_STATE_NEEDS_SCANNING;
++
++ return YAFFS_OK;
++}
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagscompat.h linux-2.6.29.1/fs/yaffs2/yaffs_tagscompat.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagscompat.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_tagscompat.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,39 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFS_TAGSCOMPAT_H__
++#define __YAFFS_TAGSCOMPAT_H__
++
++#include "yaffs_guts.h"
++int yaffs_TagsCompatabilityWriteChunkWithTagsToNAND(yaffs_Device *dev,
++ int chunkInNAND,
++ const __u8 *data,
++ const yaffs_ExtendedTags *tags);
++int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device *dev,
++ int chunkInNAND,
++ __u8 *data,
++ yaffs_ExtendedTags *tags);
++int yaffs_TagsCompatabilityMarkNANDBlockBad(struct yaffs_DeviceStruct *dev,
++ int blockNo);
++int yaffs_TagsCompatabilityQueryNANDBlock(struct yaffs_DeviceStruct *dev,
++ int blockNo,
++ yaffs_BlockState *state,
++ __u32 *sequenceNumber);
++
++void yaffs_CalcTagsECC(yaffs_Tags *tags);
++int yaffs_CheckECCOnTags(yaffs_Tags *tags);
++int yaffs_CountBits(__u8 byte);
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagsvalidity.c linux-2.6.29.1/fs/yaffs2/yaffs_tagsvalidity.c
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagsvalidity.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_tagsvalidity.c 2009-04-17 19:10:08.888966133 +0200
+@@ -0,0 +1,28 @@
++/*
++ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++#include "yaffs_tagsvalidity.h"
++
++void yaffs_InitialiseTags(yaffs_ExtendedTags *tags)
++{
++ memset(tags, 0, sizeof(yaffs_ExtendedTags));
++ tags->validMarker0 = 0xAAAAAAAA;
++ tags->validMarker1 = 0x55555555;
++}
++
++int yaffs_ValidateTags(yaffs_ExtendedTags *tags)
++{
++ return (tags->validMarker0 == 0xAAAAAAAA &&
++ tags->validMarker1 == 0x55555555);
++
++}
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagsvalidity.h linux-2.6.29.1/fs/yaffs2/yaffs_tagsvalidity.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffs_tagsvalidity.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffs_tagsvalidity.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,24 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++
++#ifndef __YAFFS_TAGS_VALIDITY_H__
++#define __YAFFS_TAGS_VALIDITY_H__
++
++#include "yaffs_guts.h"
++
++void yaffs_InitialiseTags(yaffs_ExtendedTags *tags);
++int yaffs_ValidateTags(yaffs_ExtendedTags *tags);
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yaffsinterface.h linux-2.6.29.1/fs/yaffs2/yaffsinterface.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yaffsinterface.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yaffsinterface.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,21 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++#ifndef __YAFFSINTERFACE_H__
++#define __YAFFSINTERFACE_H__
++
++int yaffs_Initialise(unsigned nBlocks);
++
++#endif
+diff -Nur linux-2.6.29.1.orig/fs/yaffs2/yportenv.h linux-2.6.29.1/fs/yaffs2/yportenv.h
+--- linux-2.6.29.1.orig/fs/yaffs2/yportenv.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/fs/yaffs2/yportenv.h 2009-04-17 19:10:08.892967760 +0200
+@@ -0,0 +1,203 @@
++/*
++ * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
++ *
++ * Copyright (C) 2002-2007 Aleph One Ltd.
++ * for Toby Churchill Ltd and Brightstar Engineering
++ *
++ * Created by Charles Manning <charles@aleph1.co.uk>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 2.1 as
++ * published by the Free Software Foundation.
++ *
++ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
++ */
++
++
++#ifndef __YPORTENV_H__
++#define __YPORTENV_H__
++
++/*
++ * Define the MTD version in terms of Linux Kernel versions
++ * This allows yaffs to be used independantly of the kernel
++ * as well as with it.
++ */
++
++#define MTD_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
++
++#if defined CONFIG_YAFFS_WINCE
++
++#include "ywinceenv.h"
++
++#elif defined __KERNEL__
++
++#include "moduleconfig.h"
++
++/* Linux kernel */
++
++#include <linux/version.h>
++#define MTD_VERSION_CODE LINUX_VERSION_CODE
++
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
++#include <linux/config.h>
++#endif
++#include <linux/kernel.h>
++#include <linux/mm.h>
++#include <linux/sched.h>
++#include <linux/string.h>
++#include <linux/slab.h>
++#include <linux/vmalloc.h>
++
++#define YCHAR char
++#define YUCHAR unsigned char
++#define _Y(x) x
++#define yaffs_strcat(a, b) strcat(a, b)
++#define yaffs_strcpy(a, b) strcpy(a, b)
++#define yaffs_strncpy(a, b, c) strncpy(a, b, c)
++#define yaffs_strncmp(a, b, c) strncmp(a, b, c)
++#define yaffs_strlen(s) strlen(s)
++#define yaffs_sprintf sprintf
++#define yaffs_toupper(a) toupper(a)
++
++#define Y_INLINE inline
++
++#define YAFFS_LOSTNFOUND_NAME "lost+found"
++#define YAFFS_LOSTNFOUND_PREFIX "obj"
++
++/* #define YPRINTF(x) printk x */
++#define YMALLOC(x) kmalloc(x, GFP_NOFS)
++#define YFREE(x) kfree(x)
++#define YMALLOC_ALT(x) vmalloc(x)
++#define YFREE_ALT(x) vfree(x)
++#define YMALLOC_DMA(x) YMALLOC(x)
++
++/* KR - added for use in scan so processes aren't blocked indefinitely. */
++#define YYIELD() schedule()
++
++#define YAFFS_ROOT_MODE 0666
++#define YAFFS_LOSTNFOUND_MODE 0666
++
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
++#define Y_CURRENT_TIME CURRENT_TIME.tv_sec
++#define Y_TIME_CONVERT(x) (x).tv_sec
++#else
++#define Y_CURRENT_TIME CURRENT_TIME
++#define Y_TIME_CONVERT(x) (x)
++#endif
++
++#define yaffs_SumCompare(x, y) ((x) == (y))
++#define yaffs_strcmp(a, b) strcmp(a, b)
++
++#define TENDSTR "\n"
++#define TSTR(x) KERN_WARNING x
++#define TCONT(x) x
++#define TOUT(p) printk p
++
++#define yaffs_trace(mask, fmt, args...) \
++ do { if ((mask) & (yaffs_traceMask|YAFFS_TRACE_ERROR)) \
++ printk(KERN_WARNING "yaffs: " fmt, ## args); \
++ } while (0)
++
++#define compile_time_assertion(assertion) \
++ ({ int x = __builtin_choose_expr(assertion, 0, (void)0); (void) x; })
++
++#elif defined CONFIG_YAFFS_DIRECT
++
++#define MTD_VERSION_CODE MTD_VERSION(2, 6, 22)
++
++/* Direct interface */
++#include "ydirectenv.h"
++
++#elif defined CONFIG_YAFFS_UTIL
++
++/* Stuff for YAFFS utilities */
++
++#include "stdlib.h"
++#include "stdio.h"
++#include "string.h"
++
++#include "devextras.h"
++
++#define YMALLOC(x) malloc(x)
++#define YFREE(x) free(x)
++#define YMALLOC_ALT(x) malloc(x)
++#define YFREE_ALT(x) free(x)
++
++#define YCHAR char
++#define YUCHAR unsigned char
++#define _Y(x) x
++#define yaffs_strcat(a, b) strcat(a, b)
++#define yaffs_strcpy(a, b) strcpy(a, b)
++#define yaffs_strncpy(a, b, c) strncpy(a, b, c)
++#define yaffs_strlen(s) strlen(s)
++#define yaffs_sprintf sprintf
++#define yaffs_toupper(a) toupper(a)
++
++#define Y_INLINE inline
++
++/* #define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s)) */
++/* #define YALERT(s) YINFO(s) */
++
++#define TENDSTR "\n"
++#define TSTR(x) x
++#define TOUT(p) printf p
++
++#define YAFFS_LOSTNFOUND_NAME "lost+found"
++#define YAFFS_LOSTNFOUND_PREFIX "obj"
++/* #define YPRINTF(x) printf x */
++
++#define YAFFS_ROOT_MODE 0666
++#define YAFFS_LOSTNFOUND_MODE 0666
++
++#define yaffs_SumCompare(x, y) ((x) == (y))
++#define yaffs_strcmp(a, b) strcmp(a, b)
++
++#else
++/* Should have specified a configuration type */
++#error Unknown configuration
++
++#endif
++
++/* see yaffs_fs.c */
++extern unsigned int yaffs_traceMask;
++extern unsigned int yaffs_wr_attempts;
++
++/*
++ * Tracing flags.
++ * The flags masked in YAFFS_TRACE_ALWAYS are always traced.
++ */
++
++#define YAFFS_TRACE_OS 0x00000002
++#define YAFFS_TRACE_ALLOCATE 0x00000004
++#define YAFFS_TRACE_SCAN 0x00000008
++#define YAFFS_TRACE_BAD_BLOCKS 0x00000010
++#define YAFFS_TRACE_ERASE 0x00000020
++#define YAFFS_TRACE_GC 0x00000040
++#define YAFFS_TRACE_WRITE 0x00000080
++#define YAFFS_TRACE_TRACING 0x00000100
++#define YAFFS_TRACE_DELETION 0x00000200
++#define YAFFS_TRACE_BUFFERS 0x00000400
++#define YAFFS_TRACE_NANDACCESS 0x00000800
++#define YAFFS_TRACE_GC_DETAIL 0x00001000
++#define YAFFS_TRACE_SCAN_DEBUG 0x00002000
++#define YAFFS_TRACE_MTD 0x00004000
++#define YAFFS_TRACE_CHECKPOINT 0x00008000
++
++#define YAFFS_TRACE_VERIFY 0x00010000
++#define YAFFS_TRACE_VERIFY_NAND 0x00020000
++#define YAFFS_TRACE_VERIFY_FULL 0x00040000
++#define YAFFS_TRACE_VERIFY_ALL 0x000F0000
++
++
++#define YAFFS_TRACE_ERROR 0x40000000
++#define YAFFS_TRACE_BUG 0x80000000
++#define YAFFS_TRACE_ALWAYS 0xF0000000
++
++
++#define T(mask, p) do { if ((mask) & (yaffs_traceMask | YAFFS_TRACE_ALWAYS)) TOUT(p); } while (0)
++
++#ifndef YBUG
++#define YBUG() do {T(YAFFS_TRACE_BUG, (TSTR("==>> yaffs bug: " __FILE__ " %d" TENDSTR), __LINE__)); } while (0)
++#endif
++
++#endif
diff --git a/target/qemu-cris/Makefile b/target/qemu-cris/Makefile
new file mode 100644
index 000000000..e8cdf1bb1
--- /dev/null
+++ b/target/qemu-cris/Makefile
@@ -0,0 +1,35 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+$(TOOLS_BUILD_DIR):
+ mkdir -p $(TOOLS_BUILD_DIR)
+
+tools-compile: $(TOOLS_BUILD_DIR)
+ $(MAKE) -C tools/mkfimage
+
+kernel-install: tools-compile
+ PATH='${TARGET_PATH}' \
+ mkfimage $(LINUX_DIR)/arch/cris/arch-v32/boot/zImage \
+ $(BIN_DIR)/${DEVICE}-${ARCH}-kernel $(MAKE_TRACE)
+
+ifeq ($(FS),ext2)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo
+ @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
+ @echo "Use following command to create a QEMU Image:"
+ @echo "sudo ./scripts/create-image.sh qemu.img $(BIN_DIR)/$(ROOTFSTARBALL)"
+endif
+
+ifeq ($(FS),initramfs)
+imageinstall: $(BIN_DIR)/$(INITRAMFS)
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
+endif
diff --git a/target/qemu-cris/device.mk b/target/qemu-cris/device.mk
new file mode 100644
index 000000000..21e3b3210
--- /dev/null
+++ b/target/qemu-cris/device.mk
@@ -0,0 +1,7 @@
+ARCH:= cris
+CPU_ARCH:= crisv32
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=v32
diff --git a/target/qemu-cris/files/etc/mdev.conf b/target/qemu-cris/files/etc/mdev.conf
new file mode 100644
index 000000000..2b58560be
--- /dev/null
+++ b/target/qemu-cris/files/etc/mdev.conf
@@ -0,0 +1,13 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:5 0600
+kmem 0:9 000
+mem 0:9 0640
+port 0:9 0640
+ptmx 0:5 666
+tty 0:5 0660
+ttyS* 0:20 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/qemu-cris/kernel.config b/target/qemu-cris/kernel.config
new file mode 100644
index 000000000..3bae4c94b
--- /dev/null
+++ b/target/qemu-cris/kernel.config
@@ -0,0 +1,751 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28
+# Fri Jan 2 17:26:57 2009
+#
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_IOMAP=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NO_IOPORT=y
+CONFIG_FORCE_MAX_ZONEORDER=6
+CONFIG_CRIS=y
+CONFIG_HZ=100
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_BASE_FULL is not set
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+# CONFIG_SIGNALFD is not set
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=1
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
+
+#
+# General setup
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_ETRAX_CMDLINE="console=ttyS0,115200 init=/init"
+# CONFIG_ETRAX_WATCHDOG is not set
+CONFIG_ETRAX_FAST_TIMER=y
+# CONFIG_ETRAX_KMALLOCED_MODULES is not set
+# CONFIG_OOM_REBOOT is not set
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_UNEVICTABLE_LRU is not set
+
+#
+# Hardware setup
+#
+# CONFIG_ETRAX100LX is not set
+# CONFIG_ETRAX100LX_V2 is not set
+# CONFIG_SVINTO_SIM is not set
+CONFIG_ETRAXFS=y
+# CONFIG_CRIS_MACH_ARTPEC3 is not set
+# CONFIG_ETRAX_VCS_SIM is not set
+# CONFIG_ETRAX_ARCH_V10 is not set
+CONFIG_ETRAX_ARCH_V32=y
+CONFIG_ETRAX_DRAM_SIZE=128
+CONFIG_ETRAX_FLASH_BUSWIDTH=2
+CONFIG_ETRAX_NANDFLASH_BUSWIDTH=1
+CONFIG_ETRAX_FLASH1_SIZE=32
+# CONFIG_ETRAX_DEBUG_PORT0 is not set
+# CONFIG_ETRAX_DEBUG_PORT1 is not set
+# CONFIG_ETRAX_DEBUG_PORT2 is not set
+# CONFIG_ETRAX_DEBUG_PORT3 is not set
+CONFIG_ETRAX_DEBUG_PORT_NULL=y
+CONFIG_ETRAX_DRAM_VIRTUAL_BASE=c0000000
+
+#
+# ETRAX FS options
+#
+CONFIG_ETRAX_SERIAL_PORTS=4
+CONFIG_ETRAX_MEM_GRP1_CONFIG=0x40688
+CONFIG_ETRAX_MEM_GRP2_CONFIG=0x0
+CONFIG_ETRAX_MEM_GRP3_CONFIG=0x06000002
+CONFIG_ETRAX_MEM_GRP4_CONFIG=0x0
+CONFIG_ETRAX_SDRAM_GRP0_CONFIG=0x114b
+CONFIG_ETRAX_SDRAM_GRP1_CONFIG=0x0
+CONFIG_ETRAX_SDRAM_TIMING=0x424a
+CONFIG_ETRAX_SDRAM_COMMAND=0x0
+CONFIG_ETRAX_DEF_GIO_PA_OE=0x7c
+CONFIG_ETRAX_DEF_GIO_PA_OUT=0x00
+CONFIG_ETRAX_DEF_GIO_PB_OE=0x3f111
+CONFIG_ETRAX_DEF_GIO_PB_OUT=0x03000
+CONFIG_ETRAX_DEF_GIO_PC_OE=0x03330
+CONFIG_ETRAX_DEF_GIO_PC_OUT=0x00000
+CONFIG_ETRAX_DEF_GIO_PD_OE=0x0015a
+CONFIG_ETRAX_DEF_GIO_PD_OUT=0x00100
+CONFIG_ETRAX_DEF_GIO_PE_OE=0x00000
+CONFIG_ETRAX_DEF_GIO_PE_OUT=0x00000
+# CONFIG_CPU_FREQ is not set
+# CONFIG_ETRAX_NBR_LED_GRP_ZERO is not set
+CONFIG_ETRAX_NBR_LED_GRP_ONE=y
+# CONFIG_ETRAX_NBR_LED_GRP_TWO is not set
+CONFIG_ETRAX_LED_G_NET0="PA2"
+CONFIG_ETRAX_LED_R_NET0="PA2"
+CONFIG_ETRAX_V32_LED2G="PA5"
+CONFIG_ETRAX_V32_LED2R="PA6"
+CONFIG_ETRAX_V32_LED3G="PA7"
+CONFIG_ETRAX_V32_LED3R="PA7"
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Drivers for built-in interfaces
+#
+CONFIG_ETRAX_ETHERNET=y
+CONFIG_ETRAX_SERIAL_PORT0=y
+# CONFIG_ETRAX_SERIAL_PORT1 is not set
+# CONFIG_ETRAX_SERIAL_PORT2 is not set
+# CONFIG_ETRAX_SERIAL_PORT3 is not set
+# CONFIG_ETRAX_RS485 is not set
+CONFIG_ETRAX_PTABLE_SECTOR=131072
+# CONFIG_ETRAX_I2C is not set
+CONFIG_ETRAX_GPIO=y
+CONFIG_ETRAX_PA_CHANGEABLE_DIR=0x00
+CONFIG_ETRAX_PA_CHANGEABLE_BITS=0x00
+CONFIG_ETRAX_PB_CHANGEABLE_DIR=0x00000
+CONFIG_ETRAX_PB_CHANGEABLE_BITS=0x3f000
+# CONFIG_ETRAX_NO_PHY is not set
+CONFIG_ETRAX_ETHERNET_IFACE0=y
+# CONFIG_ETRAX_ETHERNET_IFACE1 is not set
+CONFIG_ETRAX_ETH0_USE_LEDGRP0=y
+# CONFIG_ETRAX_ETH0_USE_LEDGRP1 is not set
+# CONFIG_ETRAX_ETH0_USE_LEDGRPNULL is not set
+CONFIG_ETRAXFS_SERIAL=y
+CONFIG_ETRAX_SERIAL_PORT0_TYPE_232=y
+# CONFIG_ETRAX_SERIAL_PORT0_TYPE_485HD is not set
+# CONFIG_ETRAX_SERIAL_PORT0_TYPE_485FD is not set
+CONFIG_ETRAX_SER0_DTR_BIT="pb0"
+CONFIG_ETRAX_SER0_RI_BIT="pb1"
+CONFIG_ETRAX_SER0_DSR_BIT="pb2"
+CONFIG_ETRAX_SER0_CD_BIT="pb3"
+# CONFIG_ETRAX_SYNCHRONOUS_SERIAL is not set
+CONFIG_ETRAX_AXISFLASHMAP=y
+CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE=y
+# CONFIG_ETRAX_NANDFLASH is not set
+# CONFIG_ETRAX_VIRTUAL_GPIO is not set
+CONFIG_ETRAX_PC_CHANGEABLE_DIR=0x00000
+CONFIG_ETRAX_PC_CHANGEABLE_BITS=0x00000
+CONFIG_ETRAX_PD_CHANGEABLE_DIR=0x00010
+CONFIG_ETRAX_PD_CHANGEABLE_BITS=0x0011a
+CONFIG_ETRAX_PE_CHANGEABLE_DIR=0x00000
+CONFIG_ETRAX_PE_CHANGEABLE_BITS=0x00000
+# CONFIG_ETRAX_CARDBUS is not set
+# CONFIG_ETRAX_IOP_FW_LOAD is not set
+# CONFIG_ETRAX_STREAMCOPROC is not set
+# CONFIG_MMC is not set
+# CONFIG_ETRAX_SPI_MMC is not set
+# CONFIG_ETRAX_SPI_MMC_BOARD is not set
+# CONFIG_ETRAX_NETWORK_LED_ON_WHEN_LINK is not set
+CONFIG_ETRAX_NETWORK_LED_ON_WHEN_ACTIVITY=y
+CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_OUT=y
+# CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT is not set
+# CONFIG_ETRAX_SERIAL_PORT0_DMA0_OUT is not set
+CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN=y
+# CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN is not set
+# CONFIG_ETRAX_SERIAL_PORT0_DMA1_IN is not set
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=y
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+CONFIG_MTD_MTDRAM=y
+CONFIG_MTDRAM_TOTAL_SIZE=0
+CONFIG_MTDRAM_ERASE_SIZE=128
+CONFIG_MTDRAM_ABS_POS=0
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+# CONFIG_NETDEVICES is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_I2C is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+# CONFIG_DLM is not set
+# CONFIG_USB_SUPPORT is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_SYSTEM_PROFILER is not set
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_MANAGER2 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_DMA=y
diff --git a/target/qemu-cris/patches/cris.patch b/target/qemu-cris/patches/cris.patch
new file mode 100644
index 000000000..768c1c19d
--- /dev/null
+++ b/target/qemu-cris/patches/cris.patch
@@ -0,0 +1,91 @@
+diff -Nur linux-2.6.28.orig/arch/cris/arch-v32/boot/compressed/Makefile linux-2.6.28/arch/cris/arch-v32/boot/compressed/Makefile
+--- linux-2.6.28.orig/arch/cris/arch-v32/boot/compressed/Makefile 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/arch-v32/boot/compressed/Makefile 2009-01-02 16:46:24.000000000 +0100
+@@ -6,7 +6,6 @@
+ ccflags-y += -O2 -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch
+ ldflags-y += -T $(srctree)/$(src)/decompress.lds
+ OBJECTS = $(obj)/head.o $(obj)/misc.o
+-OBJCOPYFLAGS = -O binary --remove-section=.bss
+
+ quiet_cmd_image = BUILD $@
+ cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
+diff -Nur linux-2.6.28.orig/arch/cris/arch-v32/boot/compressed/misc.c linux-2.6.28/arch/cris/arch-v32/boot/compressed/misc.c
+--- linux-2.6.28.orig/arch/cris/arch-v32/boot/compressed/misc.c 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/arch-v32/boot/compressed/misc.c 2009-01-02 16:47:08.000000000 +0100
+@@ -5,7 +5,7 @@
+ * adapted for Linux.
+ *
+ * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
+- * puts by Nick Holloway 1993, better puts by Martin Mares 1995
++ * putstr by Nick Holloway 1993, better putstr by Martin Mares 1995
+ * adaptation for Linux/CRIS Axis Communications AB, 1999
+ *
+ */
+@@ -98,7 +98,7 @@
+
+ static void error(char *m);
+
+-static void puts(const char *);
++static void putstr(const char *);
+
+ /* the "heap" is put directly after the BSS ends, at end */
+
+@@ -125,7 +125,7 @@
+ }
+
+ static void
+-puts(const char *s)
++putstr(const char *s)
+ {
+ #ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
+ while (*s) {
+@@ -197,9 +197,9 @@
+ static void
+ error(char *x)
+ {
+- puts("\r\n\n");
+- puts(x);
+- puts("\r\n\n -- System halted\n");
++ putstr("\r\n\n");
++ putstr(x);
++ putstr("\r\n\n -- System halted\n");
+
+ while(1); /* Halt */
+ }
+@@ -308,11 +308,11 @@
+ __asm__ volatile ("move $vr,%0" : "=rm" (revision));
+ if (revision < 32)
+ {
+- puts("You need an ETRAX FS to run Linux 2.6/crisv32.\r\n");
++ putstr("You need an ETRAX FS to run Linux 2.6/crisv32.\r\n");
+ while(1);
+ }
+
+- puts("Uncompressing Linux...\r\n");
++ putstr("Uncompressing Linux...\r\n");
+ gunzip();
+- puts("Done. Now booting the kernel.\r\n");
++ putstr("Done. Now booting the kernel.\r\n");
+ }
+diff -Nur linux-2.6.28.orig/arch/cris/arch-v32/boot/Makefile linux-2.6.28/arch/cris/arch-v32/boot/Makefile
+--- linux-2.6.28.orig/arch/cris/arch-v32/boot/Makefile 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/arch-v32/boot/Makefile 2009-01-02 16:46:10.000000000 +0100
+@@ -4,8 +4,8 @@
+
+ OBJCOPYFLAGS = -O binary -R .note -R .comment
+
+-subdir- := compressed rescue
+-targets := Image
++subdir- := compressed
++targets := Image zImage
+
+ $(obj)/Image: vmlinux FORCE
+ $(call if_changed,objcopy)
+@@ -13,7 +13,6 @@
+
+ $(obj)/compressed/vmlinux: $(obj)/Image FORCE
+ $(Q)$(MAKE) $(build)=$(obj)/compressed $@
+- $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
+
+ $(obj)/zImage: $(obj)/compressed/vmlinux
+ @cp $< $@
diff --git a/target/qemu-cris/tools/mkfimage/Makefile b/target/qemu-cris/tools/mkfimage/Makefile
new file mode 100644
index 000000000..dd7667972
--- /dev/null
+++ b/target/qemu-cris/tools/mkfimage/Makefile
@@ -0,0 +1,4 @@
+include $(TOPDIR)/rules.mk
+
+all: mkfimage
+ $(HOSTCC) -o ${STAGING_TOOLS}/bin/mkfimage mkfimage.c
diff --git a/target/qemu-cris/tools/mkfimage/mkfimage.c b/target/qemu-cris/tools/mkfimage/mkfimage.c
new file mode 100644
index 000000000..6904170cf
--- /dev/null
+++ b/target/qemu-cris/tools/mkfimage/mkfimage.c
@@ -0,0 +1,72 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv){
+ unsigned char *buffer = malloc(64 * 1024);
+ struct stat s;
+ unsigned int size_vmlinux = 0, real_size_vmlinux = 0;
+ const unsigned char *magic_str = "ACME_PART_MAGIC";
+ unsigned int loop;
+ unsigned char *magic;
+
+ if(argc != 3){
+ printf("%s in out\n", argv[0]);
+ return 1;
+ }
+
+ printf("Generating image\n");
+
+ FILE *vmlinux = fopen(argv[1], "r");
+ FILE *vmlinux_out = fopen(argv[2], "w");
+ if((!vmlinux) || (!vmlinux_out)){
+ printf("Error opening a file\n");
+ return 1;
+ }
+
+ stat(argv[1], &s);
+ size_vmlinux = s.st_size;
+ real_size_vmlinux = (size_vmlinux & 0xffff0000) + 0x10000;
+
+ printf("vmlinux = 0x%.08X / 0x%.08X\n", size_vmlinux, real_size_vmlinux);
+
+ unsigned int t = fread(buffer, 1, 64 * 1024, vmlinux);
+ for(loop = 0; loop < (64 * 1024) - sizeof(magic_str); loop++){
+ if(buffer[loop] == magic_str[0]){
+ if((magic = strstr(&buffer[loop], magic_str))){
+ printf("Magic at 0x%.08X %p %p\n", magic - buffer, magic, buffer);
+ printf("Found Magic %X%X%X%X\n",
+ buffer[loop + strlen(magic_str)],
+ buffer[loop + strlen(magic_str) + 2],
+ buffer[loop + strlen(magic_str) + 1],
+ buffer[loop + strlen(magic_str) + 3]);
+
+ buffer[loop + strlen(magic_str)] = real_size_vmlinux >> 24;
+ buffer[loop + strlen(magic_str) + 2] = (real_size_vmlinux >> 16) & 0xff;
+ buffer[loop + strlen(magic_str) + 1] = (real_size_vmlinux >> 8) & 0xff;
+ buffer[loop + strlen(magic_str) + 3] = (real_size_vmlinux) & 0xff;
+
+ printf("Replaced with %.02X%.02X%.02X%.02X\n",
+ buffer[loop + strlen(magic_str)],
+ buffer[loop + strlen(magic_str) + 2],
+ buffer[loop + strlen(magic_str) + 1],
+ buffer[loop + strlen(magic_str) + 3]);
+
+ }
+ }
+ }
+
+ fwrite(buffer, 1, 64 * 1024, vmlinux_out);
+ real_size_vmlinux -= 64 * 1024;
+ do {
+ real_size_vmlinux -= 64 * 1024;
+ memset(buffer, 0, 64 * 1024);
+ fread(buffer, 1, 64 * 1024, vmlinux);
+ fwrite(buffer, 1, 64 * 1024, vmlinux_out);
+ } while (real_size_vmlinux);
+
+ return 0;
+}
diff --git a/target/qemu-cris/tools/rules.mk b/target/qemu-cris/tools/rules.mk
new file mode 100644
index 000000000..8d03c031a
--- /dev/null
+++ b/target/qemu-cris/tools/rules.mk
@@ -0,0 +1,9 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+WRKDIR_BASE= ${TOOLS_BUILD_DIR}
+WRKDIR= ${WRKDIR_BASE}
+
+include ${TOPDIR}/mk/buildhlp.mk
diff --git a/target/qemu-cris/uclibc.config b/target/qemu-cris/uclibc.config
new file mode 100644
index 000000000..4678e3b43
--- /dev/null
+++ b/target/qemu-cris/uclibc.config
@@ -0,0 +1,241 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Thu Dec 25 10:29:25 2008
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+TARGET_cris=y
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="cris"
+FORCE_OPTIONS_FOR_ARCH=y
+CONFIG_CRIS=y
+# CONFIG_CRISV32 is not set
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+EXTRA_WARNINGS=y
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/qemu-mips/Makefile b/target/qemu-mips/Makefile
new file mode 100644
index 000000000..ac4a70d91
--- /dev/null
+++ b/target/qemu-mips/Makefile
@@ -0,0 +1,30 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+ cp $(LINUX_DIR)/vmlinux $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+
+ifeq ($(FS),ext2)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo
+ @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
+ @echo "Use following command to create a QEMU Image:"
+ @echo "sudo ./scripts/create-image.sh -n qemu-mips.img $(BIN_DIR)/$(ROOTFSTARBALL)"
+ @echo "Start qemu with following options:"
+ @echo 'qemu-system-mipsel -nographic -M malta -kernel $(BIN_DIR)/${DEVICE}-${ARCH}-kernel -hda qemu-mips.img -append="root=/dev/hda1 init=/init"'
+endif
+
+ifeq ($(FS),initramfs)
+imageinstall: $(BIN_DIR)/$(INITRAMFS)
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
+ @echo 'qemu-system-mipsel -nographic -M malta -kernel $(BIN_DIR)/${DEVICE}-${ARCH}-kernel -initrd ${BIN_DIR}/${INITRAMFS} -append "init=/init"'
+endif
diff --git a/target/qemu-mips/device.mk b/target/qemu-mips/device.mk
new file mode 100644
index 000000000..df956ae5e
--- /dev/null
+++ b/target/qemu-mips/device.mk
@@ -0,0 +1,7 @@
+ARCH:= mips
+CPU_ARCH:= mipsel
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=mips32
diff --git a/target/qemu-mips/files/etc/mdev.conf b/target/qemu-mips/files/etc/mdev.conf
new file mode 100644
index 000000000..a8b87c84c
--- /dev/null
+++ b/target/qemu-mips/files/etc/mdev.conf
@@ -0,0 +1,11 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+tun 0:0 660 >net/tun
+device-mapper 0:0 660 @mkdir /dev/mapper
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/qemu-mips/kernel.config b/target/qemu-mips/kernel.config
new file mode 100644
index 000000000..e2f59e81c
--- /dev/null
+++ b/target/qemu-mips/kernel.config
@@ -0,0 +1,902 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28
+# Fri Jan 9 22:42:20 2009
+#
+CONFIG_MIPS=y
+
+#
+# Machine selection
+#
+CONFIG_ZONE_DMA=y
+# CONFIG_MACH_ALCHEMY is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_LEMOTE_FULONG is not set
+CONFIG_MIPS_MALTA=y
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MACH_EMMA is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_PMC_MSP is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
+# CONFIG_WR_PPMC is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_BOOT_RAW=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+# CONFIG_HOTPLUG_CPU is not set
+CONFIG_I8259=y
+CONFIG_MIPS_BONITO64=y
+CONFIG_MIPS_MSC=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_ISA_DMA=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_GIC=y
+CONFIG_MIPS_BOARDS_GEN=y
+CONFIG_PCI_GT64XXX_PCI0=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_BOOT_ELF32=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_LOONGSON2 is not set
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_CPU_MIPS64_R1=y
+CONFIG_SYS_HAS_CPU_NEVADA=y
+CONFIG_SYS_HAS_CPU_RM7000=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_BOARD_SCACHE=y
+CONFIG_MIPS_CPU_SCACHE=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+CONFIG_SYS_SUPPORTS_MULTITHREADING=y
+# CONFIG_MIPS_VPE_LOADER is not set
+CONFIG_CPU_HAS_LLSC=y
+# CONFIG_CPU_HAS_SMARTMIPS is not set
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_SYS_SUPPORTS_SMARTMIPS=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_UNEVICTABLE_LRU is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_48 is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_128 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=100
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_KEXEC is not set
+# CONFIG_SECCOMP is not set
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PROBE_INITRD_HEADER is not set
+# CONFIG_FREEZER is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_LEGACY is not set
+CONFIG_MMU=y
+CONFIG_I8253=y
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Power management options
+#
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_PM is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_VERBOSE is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_FIB_RULES=y
+# CONFIG_WIRELESS is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+CONFIG_IDE=y
+
+#
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_PROC_FS is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+CONFIG_BLK_DEV_IDEDMA_SFF=y
+
+#
+# PCI IDE chipsets support
+#
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_PCIBUS_ORDER=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+CONFIG_BLK_DEV_PIIX=y
+# CONFIG_BLK_DEV_IT8213 is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_BLK_DEV_TC86C001 is not set
+CONFIG_BLK_DEV_IDEDMA=y
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_NETDEVICES is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_VIA is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=0
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_CMDLINE="init=/init console=ttyS0,115200 console=tty0"
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/qemu-mips/patches/io_map_base.patch b/target/qemu-mips/patches/io_map_base.patch
new file mode 100644
index 000000000..be39ffe09
--- /dev/null
+++ b/target/qemu-mips/patches/io_map_base.patch
@@ -0,0 +1,52 @@
+diff -Nur linux-2.6.28.orig/arch/mips/include/asm/mips-boards/generic.h linux-2.6.28/arch/mips/include/asm/mips-boards/generic.h
+--- linux-2.6.28.orig/arch/mips/include/asm/mips-boards/generic.h 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/mips/include/asm/mips-boards/generic.h 2009-01-09 23:03:02.000000000 +0100
+@@ -92,7 +92,7 @@
+ extern void mips_reboot_setup(void);
+
+ #ifdef CONFIG_PCI
+-extern void mips_pcibios_init(void);
++extern int mips_pcibios_init(void);
+ #else
+ #define mips_pcibios_init() do { } while (0)
+ #endif
+diff -Nur linux-2.6.28.orig/arch/mips/mti-malta/malta-pci.c linux-2.6.28/arch/mips/mti-malta/malta-pci.c
+--- linux-2.6.28.orig/arch/mips/mti-malta/malta-pci.c 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/mips/mti-malta/malta-pci.c 2009-01-09 23:02:02.000000000 +0100
+@@ -87,10 +87,11 @@
+ .mem_resource = &msc_mem_resource,
+ };
+
+-void __init mips_pcibios_init(void)
++int __init mips_pcibios_init(void)
+ {
+ struct pci_controller *controller;
+ resource_size_t start, end, map, start1, end1, map1, map2, map3, mask;
++ void __iomem *io_map_base;
+
+ switch (mips_revision_sconid) {
+ case MIPS_REVISION_SCON_GT64120:
+@@ -230,7 +231,7 @@
+ controller = &msc_controller;
+ break;
+ default:
+- return;
++ return 0;
+ }
+
+ if (controller->io_resource->start < 0x00001000UL) /* FIXME */
+@@ -239,5 +240,14 @@
+ iomem_resource.end &= 0xfffffffffULL; /* 64 GB */
+ ioport_resource.end = controller->io_resource->end;
+
++ io_map_base = ioremap(MIPS_MSC01_PCI_REG_BASE,
++ controller->io_resource->end - controller->io_resource->start + 1);
++ if (!io_map_base)
++ return -EBUSY;
++
++ controller->io_map_base = (unsigned long)io_map_base;
++
+ register_pci_controller(controller);
++
++ return 0;
+ }
diff --git a/target/qemu-mips/uclibc.config b/target/qemu-mips/uclibc.config
new file mode 100644
index 000000000..223c3ddd9
--- /dev/null
+++ b/target/qemu-mips/uclibc.config
@@ -0,0 +1,250 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Fri Jan 9 14:41:23 2009
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+TARGET_mips=y
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="mips"
+FORCE_OPTIONS_FOR_ARCH=y
+ARCH_CFLAGS="-mno-split-addresses"
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+CONFIG_MIPS_O32_ABI=y
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+# ARCH_WANTS_BIG_ENDIAN is not set
+ARCH_WANTS_LITTLE_ENDIAN=y
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+EXTRA_WARNINGS=y
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/qemu-x86/Makefile b/target/qemu-x86/Makefile
new file mode 100644
index 000000000..ee5627218
--- /dev/null
+++ b/target/qemu-x86/Makefile
@@ -0,0 +1,28 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+ cp $(LINUX_DIR)/arch/x86/boot/bzImage $(TARGET_DIR)/boot/kernel
+
+ifeq ($(FS),ext2)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo
+ @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
+ @echo "Use following command to create a QEMU Image:"
+ @echo "sudo ./scripts/create-image.sh qemu.img $(BIN_DIR)/$(ROOTFSTARBALL)"
+endif
+
+ifeq ($(FS),initramfs)
+imageinstall: $(BIN_DIR)/$(INITRAMFS)
+ cp $(LINUX_DIR)/arch/x86/boot/bzImage $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
+endif
diff --git a/target/qemu-x86/device.mk b/target/qemu-x86/device.mk
new file mode 100644
index 000000000..2c4156ee2
--- /dev/null
+++ b/target/qemu-x86/device.mk
@@ -0,0 +1,7 @@
+ARCH:= x86
+CPU_ARCH:= i586
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=i586
diff --git a/target/qemu-x86/files/etc/inittab b/target/qemu-x86/files/etc/inittab
new file mode 100644
index 000000000..6f21e703b
--- /dev/null
+++ b/target/qemu-x86/files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS
+::shutdown:/etc/init.d/rcK
+ttyS0::respawn:/sbin/getty -i -L ttyS0 115200 vt100
+tty1::respawn:/sbin/getty -i -L tty1 115200 vt100
diff --git a/target/qemu-x86/files/etc/mdev.conf b/target/qemu-x86/files/etc/mdev.conf
new file mode 100644
index 000000000..5d78ab110
--- /dev/null
+++ b/target/qemu-x86/files/etc/mdev.conf
@@ -0,0 +1,17 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+tun 0:0 660 >net/tun
+device-mapper 0:0 660 @mkdir /dev/mapper
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+audio root:audio 660 >snd/audio
+dsp root:audio 660 >snd/dsp
+timer root:audio 660 >snd/timer
+controlC0 root:audio 660 >snd/controlC0
+pcmC0D0c root:audio 660 >snd/pcmC0D0c
+pcmC0D0p root:audio 660 >snd/pcmC0D0p
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/qemu-x86/kernel.config b/target/qemu-x86/kernel.config
new file mode 100644
index 000000000..64b2592c3
--- /dev/null
+++ b/target/qemu-x86/kernel.config
@@ -0,0 +1,1091 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28
+# Mon Feb 2 16:05:07 2009
+#
+# CONFIG_64BIT is not set
+CONFIG_X86_32=y
+# CONFIG_X86_64 is not set
+CONFIG_X86=y
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_FAST_CMPXCHG_LOCAL=y
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+# CONFIG_GENERIC_TIME_VSYSCALL is not set
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_ZONE_DMA32 is not set
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+# CONFIG_AUDIT_ARCH is not set
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_KTIME_SCALAR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_FREEZER is not set
+
+#
+# Processor type and features
+#
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_SMP is not set
+CONFIG_X86_PC=y
+# CONFIG_X86_ELAN is not set
+# CONFIG_X86_VOYAGER is not set
+# CONFIG_X86_GENERICARCH is not set
+# CONFIG_X86_VSMP is not set
+# CONFIG_X86_RDC321X is not set
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+# CONFIG_PARAVIRT_GUEST is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+CONFIG_M586=y
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_GENERIC_CPU is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_CPU=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_X86_XADD=y
+# CONFIG_X86_PPRO_FENCE is not set
+CONFIG_X86_F00F_BUG=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_ALIGNMENT_16=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=4
+CONFIG_PROCESSOR_SELECT=y
+CONFIG_CPU_SUP_INTEL=y
+# CONFIG_CPU_SUP_CYRIX_32 is not set
+# CONFIG_CPU_SUP_AMD is not set
+# CONFIG_CPU_SUP_CENTAUR_32 is not set
+# CONFIG_CPU_SUP_TRANSMETA_32 is not set
+# CONFIG_CPU_SUP_UMC_32 is not set
+# CONFIG_HPET_TIMER is not set
+# CONFIG_DMI is not set
+# CONFIG_IOMMU_HELPER is not set
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_X86_UP_APIC is not set
+# CONFIG_X86_MCE is not set
+# CONFIG_VM86 is not set
+# CONFIG_TOSHIBA is not set
+# CONFIG_I8K is not set
+# CONFIG_X86_REBOOTFIXUPS is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+CONFIG_NOHIGHMEM=y
+# CONFIG_HIGHMEM4G is not set
+# CONFIG_HIGHMEM64G is not set
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_2G_OPT is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_X86_PAE is not set
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_STATIC=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_UNEVICTABLE_LRU is not set
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
+# CONFIG_X86_RESERVE_LOW_64K is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_MTRR is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_KEXEC is not set
+CONFIG_PHYSICAL_START=0x100000
+# CONFIG_RELOCATABLE is not set
+CONFIG_PHYSICAL_ALIGN=0x100000
+# CONFIG_COMPAT_VDSO is not set
+# CONFIG_CMDLINE_BOOL is not set
+
+#
+# Power management and ACPI options
+#
+# CONFIG_PM is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+# CONFIG_PCI_GODIRECT is not set
+# CONFIG_PCI_GOOLPC is not set
+CONFIG_PCI_GOANY=y
+CONFIG_PCI_BIOS=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_LEGACY is not set
+CONFIG_ISA_DMA_API=y
+# CONFIG_ISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+# CONFIG_OLPC is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_HAVE_ATOMIC_IOMAP=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_VERBOSE is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_PMP is not set
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+CONFIG_ATA_PIIX=y
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CS5535 is not set
+# CONFIG_PATA_CS5536 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_JME is not set
+CONFIG_NETDEV_10000=y
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_ENIC is not set
+# CONFIG_IXGBE is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
+# CONFIG_MLX4_EN is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_BNX2X is not set
+# CONFIG_QLGE is not set
+# CONFIG_SFC is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+# CONFIG_SERIAL_8250_PCI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+# CONFIG_MWAVE is not set
+# CONFIG_PC8736x_GPIO is not set
+# CONFIG_NSC_GPIO is not set
+# CONFIG_CS5535_GPIO is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+CONFIG_FB_BOOT_VESA_SUPPORT=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ARC is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_VGA16 is not set
+CONFIG_FB_VESA=y
+# CONFIG_FB_N411 is not set
+# CONFIG_FB_HGA is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_I810 is not set
+# CONFIG_FB_LE80578 is not set
+# CONFIG_FB_INTEL is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_S3 is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_VIA is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_VT8623 is not set
+# CONFIG_FB_CYBLA is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+# CONFIG_FB_GEODE is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+CONFIG_FIRMWARE_MEMMAP=y
+# CONFIG_DELL_RBU is not set
+# CONFIG_DCDBAS is not set
+# CONFIG_ISCSI_IBFT_FIND is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=0
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+
+#
+# Tracers
+#
+# CONFIG_SYSPROF_TRACER is not set
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_STRICT_DEVMEM is not set
+# CONFIG_X86_VERBOSE_BOOTUP is not set
+# CONFIG_EARLY_PRINTK is not set
+# CONFIG_4KSTACKS is not set
+# CONFIG_DOUBLEFAULT is not set
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+# CONFIG_OPTIMIZE_INLINING is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+CONFIG_HAVE_KVM=y
+# CONFIG_VIRTUALIZATION is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/qemu-x86/uclibc.config b/target/qemu-x86/uclibc.config
new file mode 100644
index 000000000..ea622b4dd
--- /dev/null
+++ b/target/qemu-x86/uclibc.config
@@ -0,0 +1,241 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Mon Dec 1 19:41:35 2008
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+TARGET_i386=y
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="i386"
+FORCE_OPTIONS_FOR_ARCH=y
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+CONFIG_586=y
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/rb411/Makefile b/target/rb411/Makefile
new file mode 100644
index 000000000..efb664bb5
--- /dev/null
+++ b/target/rb411/Makefile
@@ -0,0 +1,28 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+ cp $(LINUX_DIR)/vmlinux $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+
+ifeq ($(FS),nfsroot)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
+endif
+ifeq ($(FS),yaffs)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
+ @echo 'Format your NAND with Routerboot, boot via NFS and'
+ @echo 'then install kernel and filesystem:'
+ @echo 'mount -t yaffs2 /dev/mtdblock0 /mnt'
+ @echo 'cp ${DEVICE}-${ARCH}-kernel /mnt/kernel'
+endif
diff --git a/target/rb411/device.mk b/target/rb411/device.mk
new file mode 100644
index 000000000..a6038dc4f
--- /dev/null
+++ b/target/rb411/device.mk
@@ -0,0 +1,7 @@
+ARCH:= mips
+CPU_ARCH:= mips
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=mips32
diff --git a/target/rb411/files/etc/mdev.conf b/target/rb411/files/etc/mdev.conf
new file mode 100644
index 000000000..baa2eb140
--- /dev/null
+++ b/target/rb411/files/etc/mdev.conf
@@ -0,0 +1,10 @@
+device-mapper 0:0 660 @mkdir /dev/mapper
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/rb411/kernel.config b/target/rb411/kernel.config
new file mode 100644
index 000000000..e3da44dd8
--- /dev/null
+++ b/target/rb411/kernel.config
@@ -0,0 +1,1035 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29.1
+# Wed Apr 29 21:22:36 2009
+#
+CONFIG_MIPS=y
+
+#
+# Machine selection
+#
+# CONFIG_MACH_ALCHEMY is not set
+CONFIG_ATHEROS_AR71XX=y
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_LEMOTE_FULONG is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_NEC_MARKEINS is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_PMC_MSP is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
+# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
+CONFIG_AR71XX_EARLY_SERIAL=y
+
+#
+# Atheros AR71xx machine selection
+#
+# CONFIG_AR71XX_MACH_AP81 is not set
+# CONFIG_AR71XX_MACH_AP83 is not set
+# CONFIG_AR71XX_MACH_PB42 is not set
+# CONFIG_AR71XX_MACH_AW_NR580 is not set
+# CONFIG_AR71XX_MACH_GENERIC is not set
+# CONFIG_AR71XX_MACH_WP543 is not set
+CONFIG_AR71XX_MACH_RB_4XX=y
+# CONFIG_AR71XX_MACH_WNR2000 is not set
+# CONFIG_AR71XX_MACH_MZK_W04NU is not set
+# CONFIG_AR71XX_MACH_MZK_W300NH is not set
+# CONFIG_AR71XX_MACH_TL_WR941ND is not set
+# CONFIG_AR71XX_MACH_TEW_632BRP is not set
+# CONFIG_AR71XX_MACH_UBNT is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+# CONFIG_HOTPLUG_CPU is not set
+CONFIG_MIPS_MACHINE=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_GPIO=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_LOONGSON2 is not set
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_CAVIUM_OCTEON is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_UNEVICTABLE_LRU is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_48 is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_128 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=100
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_KEXEC is not set
+# CONFIG_SECCOMP is not set
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+# CONFIG_PROBE_INITRD_HEADER is not set
+# CONFIG_FREEZER is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_LEGACY is not set
+# CONFIG_PCI_STUB is not set
+CONFIG_MMU=y
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Power management options
+#
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_PM is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_MULTIPLE_TABLES is not set
+# CONFIG_IP_ROUTE_MULTIPATH is not set
+# CONFIG_IP_ROUTE_VERBOSE is not set
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_INTEL_VR_NOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_CAFE is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+CONFIG_MTD_NAND_RB4XX=y
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=y
+# CONFIG_SWCONFIG is not set
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_TC35815 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SMSC9420 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+CONFIG_AG71XX=y
+# CONFIG_AG71XX_DEBUG is not set
+# CONFIG_AG71XX_AR8216_SUPPORT is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
+# CONFIG_JME is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_DEVKMEM is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+
+#
+# PCI GPIO expanders:
+#
+# CONFIG_GPIO_BT8XX is not set
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
+# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=0
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_CMDLINE="init=/init console=ttyS0,115200"
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_MANAGER2 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/rb411/patches/ar71xx.patch b/target/rb411/patches/ar71xx.patch
new file mode 100644
index 000000000..3646174f4
--- /dev/null
+++ b/target/rb411/patches/ar71xx.patch
@@ -0,0 +1,9913 @@
+diff -Nur linux-2.6.29.1.orig/arch/mips/Kconfig linux-2.6.29.1/arch/mips/Kconfig
+--- linux-2.6.29.1.orig/arch/mips/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/Kconfig 2009-04-13 14:27:23.734393467 +0200
+@@ -22,6 +22,23 @@
+ config MACH_ALCHEMY
+ bool "Alchemy processor based machines"
+
++config ATHEROS_AR71XX
++ bool "Atheros AR71xx based boards"
++ select CEVT_R4K
++ select CSRC_R4K
++ select DMA_NONCOHERENT
++ select HW_HAS_PCI
++ select IRQ_CPU
++ select ARCH_REQUIRE_GPIOLIB
++ select SYS_HAS_CPU_MIPS32_R1
++ select SYS_HAS_CPU_MIPS32_R2
++ select SYS_SUPPORTS_32BIT_KERNEL
++ select SYS_SUPPORTS_BIG_ENDIAN
++ select SYS_HAS_EARLY_PRINTK
++ select MIPS_MACHINE
++ help
++ Support for Atheros AR71xx based boards.
++
+ config BASLER_EXCITE
+ bool "Basler eXcite smart camera"
+ select CEVT_R4K
+@@ -640,6 +657,7 @@
+ endchoice
+
+ source "arch/mips/alchemy/Kconfig"
++source "arch/mips/ar71xx/Kconfig"
+ source "arch/mips/basler/excite/Kconfig"
+ source "arch/mips/jazz/Kconfig"
+ source "arch/mips/lasat/Kconfig"
+@@ -810,6 +828,9 @@
+ config SYNC_R4K
+ bool
+
++config MIPS_MACHINE
++ def_bool n
++
+ config NO_IOPORT
+ def_bool n
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/Makefile linux-2.6.29.1/arch/mips/Makefile
+--- linux-2.6.29.1.orig/arch/mips/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/Makefile 2009-04-13 14:27:34.483063970 +0200
+@@ -602,6 +602,14 @@
+ load-$(CONFIG_CPU_CAVIUM_OCTEON) += 0xffffffff81100000
+ endif
+
++#
++# Atheros AR71xx
++#
++core-$(CONFIG_ATHEROS_AR71XX) += arch/mips/ar71xx/
++cflags-$(CONFIG_ATHEROS_AR71XX) += -I$(srctree)/arch/mips/include/asm/mach-ar71xx
++load-$(CONFIG_ATHEROS_AR71XX) += 0xffffffff80060000
++
++
+ cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
+ drivers-$(CONFIG_PCI) += arch/mips/pci/
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/Kconfig linux-2.6.29.1/arch/mips/ar71xx/Kconfig
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/Kconfig 2009-04-13 14:27:34.483063970 +0200
+@@ -0,0 +1,64 @@
++if ATHEROS_AR71XX
++
++config AR71XX_EARLY_SERIAL
++ bool "Use early serial console"
++ default n
++
++menu "Atheros AR71xx machine selection"
++
++config AR71XX_MACH_AP81
++ bool "Atheros AP81 board support"
++ default y
++
++config AR71XX_MACH_AP83
++ bool "Atheros AP83 board support"
++ default y
++
++config AR71XX_MACH_PB42
++ bool "Atheros PB42 board support"
++ default y
++
++config AR71XX_MACH_AW_NR580
++ bool "AzureWave AW-NR580 board support"
++ default y
++
++config AR71XX_MACH_GENERIC
++ bool "Generic AR71xx based machine support"
++ default y
++
++config AR71XX_MACH_WP543
++ bool "Compex WP543 board support"
++ select MYLOADER
++ default y
++
++config AR71XX_MACH_RB_4XX
++ bool "MikroTik RouterBOARD 4xx series support"
++ default y
++
++config AR71XX_MACH_WNR2000
++ bool "NETGEAR WNR2000 board support"
++ default y
++
++config AR71XX_MACH_MZK_W04NU
++ bool "Planex MZK-W04NU board support"
++ default y
++
++config AR71XX_MACH_MZK_W300NH
++ bool "Planex MZK-W300NH board support"
++ default y
++
++config AR71XX_MACH_TL_WR941ND
++ bool "TP-LINK TL-WR941ND support"
++ default y
++
++config AR71XX_MACH_TEW_632BRP
++ bool "TRENDnet TEW-632BRP support"
++ default y
++
++config AR71XX_MACH_UBNT
++ bool "Ubiquiti AR71xx based boards support"
++ default y
++
++endmenu
++
++endif
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/Makefile linux-2.6.29.1/arch/mips/ar71xx/Makefile
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/Makefile 2009-04-13 14:27:34.487064480 +0200
+@@ -0,0 +1,25 @@
++#
++# Makefile for the Atheros AR71xx SoC specific parts of the kernel
++#
++# Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++# Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License version 2 as published
++# by the Free Software Foundation.
++
++obj-y := prom.o irq.o setup.o devices.o gpio.o ar71xx.o
++
++obj-$(CONFIG_AR71XX_MACH_AP81) += mach-ap81.o
++obj-$(CONFIG_AR71XX_MACH_AP83) += mach-ap83.o
++obj-$(CONFIG_AR71XX_MACH_AW_NR580) += mach-aw-nr580.o
++obj-$(CONFIG_AR71XX_MACH_GENERIC) += mach-generic.o
++obj-$(CONFIG_AR71XX_MACH_MZK_W04NU) += mach-mzk-w04nu.o
++obj-$(CONFIG_AR71XX_MACH_MZK_W300NH) += mach-mzk-w300nh.o
++obj-$(CONFIG_AR71XX_MACH_PB42) += mach-pb42.o
++obj-$(CONFIG_AR71XX_MACH_RB_4XX) += mach-rb-4xx.o
++obj-$(CONFIG_AR71XX_MACH_TEW_632BRP) += mach-tew-632brp.o
++obj-$(CONFIG_AR71XX_MACH_TL_WR941ND) += mach-tl-wr941nd.o
++obj-$(CONFIG_AR71XX_MACH_UBNT) += mach-ubnt.o
++obj-$(CONFIG_AR71XX_MACH_WNR2000) += mach-wnr2000.o
++obj-$(CONFIG_AR71XX_MACH_WP543) += mach-wp543.o
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/ar71xx.c linux-2.6.29.1/arch/mips/ar71xx/ar71xx.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/ar71xx.c 2009-04-13 14:27:34.487064480 +0200
+@@ -0,0 +1,100 @@
++/*
++ * AR71xx SoC routines
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/types.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++void __iomem *ar71xx_ddr_base;
++EXPORT_SYMBOL_GPL(ar71xx_ddr_base);
++
++void __iomem *ar71xx_pll_base;
++EXPORT_SYMBOL_GPL(ar71xx_pll_base);
++
++void __iomem *ar71xx_reset_base;
++EXPORT_SYMBOL_GPL(ar71xx_reset_base);
++
++void __iomem *ar71xx_gpio_base;
++EXPORT_SYMBOL_GPL(ar71xx_gpio_base);
++
++void __iomem *ar71xx_usb_ctrl_base;
++EXPORT_SYMBOL_GPL(ar71xx_usb_ctrl_base);
++
++void ar71xx_device_stop(u32 mask)
++{
++ unsigned long flags;
++ u32 t;
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, t | mask);
++ local_irq_restore(flags);
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR91XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR91XX_RESET_REG_RESET_MODULE, t | mask);
++ local_irq_restore(flags);
++ break;
++
++ default:
++ BUG();
++ }
++}
++EXPORT_SYMBOL_GPL(ar71xx_device_stop);
++
++void ar71xx_device_start(u32 mask)
++{
++ unsigned long flags;
++ u32 t;
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, t & ~mask);
++ local_irq_restore(flags);
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR91XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR91XX_RESET_REG_RESET_MODULE, t & ~mask);
++ local_irq_restore(flags);
++ break;
++
++ default:
++ BUG();
++ }
++}
++EXPORT_SYMBOL_GPL(ar71xx_device_start);
++
++void ar71xx_ddr_flush(u32 reg)
++{
++ ar71xx_ddr_wr(reg, 1);
++ while ((ar71xx_ddr_rr(reg) & 0x1));
++
++ ar71xx_ddr_wr(reg, 1);
++ while ((ar71xx_ddr_rr(reg) & 0x1));
++}
++EXPORT_SYMBOL_GPL(ar71xx_ddr_flush);
++
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/devices.c linux-2.6.29.1/arch/mips/ar71xx/devices.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/devices.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/devices.c 2009-04-13 14:27:34.491064431 +0200
+@@ -0,0 +1,675 @@
++/*
++ * Atheros AR71xx SoC platform devices
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/delay.h>
++#include <linux/dma-mapping.h>
++#include <linux/etherdevice.h>
++#include <linux/platform_device.h>
++#include <linux/serial_8250.h>
++#include <linux/ath9k_platform.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++static u8 ar71xx_mac_base[ETH_ALEN] __initdata;
++
++/*
++ * OHCI (USB full speed host controller)
++ */
++static struct resource ar71xx_ohci_resources[] = {
++ [0] = {
++ .start = AR71XX_OHCI_BASE,
++ .end = AR71XX_OHCI_BASE + AR71XX_OHCI_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = AR71XX_MISC_IRQ_OHCI,
++ .end = AR71XX_MISC_IRQ_OHCI,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static u64 ar71xx_ohci_dmamask = DMA_BIT_MASK(32);
++static struct platform_device ar71xx_ohci_device = {
++ .name = "ar71xx-ohci",
++ .id = -1,
++ .resource = ar71xx_ohci_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_ohci_resources),
++ .dev = {
++ .dma_mask = &ar71xx_ohci_dmamask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ },
++};
++
++/*
++ * EHCI (USB full speed host controller)
++ */
++static struct resource ar71xx_ehci_resources[] = {
++ [0] = {
++ .start = AR71XX_EHCI_BASE,
++ .end = AR71XX_EHCI_BASE + AR71XX_EHCI_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = AR71XX_CPU_IRQ_USB,
++ .end = AR71XX_CPU_IRQ_USB,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++
++static u64 ar71xx_ehci_dmamask = DMA_BIT_MASK(32);
++static struct ar71xx_ehci_platform_data ar71xx_ehci_data;
++
++static struct platform_device ar71xx_ehci_device = {
++ .name = "ar71xx-ehci",
++ .id = -1,
++ .resource = ar71xx_ehci_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_ehci_resources),
++ .dev = {
++ .dma_mask = &ar71xx_ehci_dmamask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ .platform_data = &ar71xx_ehci_data,
++ },
++};
++
++#define AR71XX_USB_RESET_MASK \
++ (RESET_MODULE_USB_HOST | RESET_MODULE_USB_PHY \
++ | RESET_MODULE_USB_OHCI_DLL)
++
++static void ar71xx_usb_setup(void)
++{
++ ar71xx_device_stop(AR71XX_USB_RESET_MASK);
++ mdelay(1000);
++ ar71xx_device_start(AR71XX_USB_RESET_MASK);
++
++ /* Turning on the Buff and Desc swap bits */
++ ar71xx_usb_ctrl_wr(USB_CTRL_REG_CONFIG, 0xf0000);
++
++ /* WAR for HW bug. Here it adjusts the duration between two SOFS */
++ ar71xx_usb_ctrl_wr(USB_CTRL_REG_FLADJ, 0x20c00);
++
++ mdelay(900);
++}
++
++static void ar91xx_usb_setup(void)
++{
++ ar71xx_device_stop(RESET_MODULE_USBSUS_OVERRIDE);
++ mdelay(10);
++
++ ar71xx_device_start(RESET_MODULE_USB_HOST);
++ mdelay(10);
++
++ ar71xx_device_start(RESET_MODULE_USB_PHY);
++ mdelay(10);
++}
++
++void __init ar71xx_add_device_usb(void)
++{
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ ar71xx_usb_setup();
++ platform_device_register(&ar71xx_ohci_device);
++ platform_device_register(&ar71xx_ehci_device);
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar91xx_usb_setup();
++ ar71xx_ehci_data.is_ar91xx = 1;
++ platform_device_register(&ar71xx_ehci_device);
++ break;
++
++ default:
++ BUG();
++ }
++}
++
++#ifndef CONFIG_AR71XX_EARLY_SERIAL
++static struct resource ar71xx_uart_resources[] = {
++ {
++ .start = AR71XX_UART_BASE,
++ .end = AR71XX_UART_BASE + AR71XX_UART_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++#define AR71XX_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP)
++static struct plat_serial8250_port ar71xx_uart_data[] = {
++ {
++ .mapbase = AR71XX_UART_BASE,
++ .irq = AR71XX_MISC_IRQ_UART,
++ .flags = AR71XX_UART_FLAGS,
++ .iotype = UPIO_MEM32,
++ .regshift = 2,
++ }, {
++ /* terminating entry */
++ }
++};
++
++static struct platform_device ar71xx_uart_device = {
++ .name = "serial8250",
++ .id = PLAT8250_DEV_PLATFORM,
++ .resource = ar71xx_uart_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_uart_resources),
++ .dev = {
++ .platform_data = ar71xx_uart_data
++ },
++};
++
++void __init ar71xx_add_device_uart(void)
++{
++ ar71xx_uart_data[0].uartclk = ar71xx_ahb_freq;
++ platform_device_register(&ar71xx_uart_device);
++}
++#endif /* CONFIG_AR71XX_EARLY_SERIAL */
++
++static struct resource ar71xx_mdio_resources[] = {
++ {
++ .name = "mdio_base",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE0_BASE + 0x20,
++ .end = AR71XX_GE0_BASE + 0x38 - 1,
++ }
++};
++
++static struct ag71xx_mdio_platform_data ar71xx_mdio_data = {
++ .phy_mask = 0xffffffff,
++};
++
++static struct platform_device ar71xx_mdio_device = {
++ .name = "ag71xx-mdio",
++ .id = -1,
++ .resource = ar71xx_mdio_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_mdio_resources),
++ .dev = {
++ .platform_data = &ar71xx_mdio_data,
++ },
++};
++
++void __init ar71xx_add_device_mdio(u32 phy_mask)
++{
++ ar71xx_mdio_data.phy_mask = phy_mask;
++ platform_device_register(&ar71xx_mdio_device);
++}
++
++static void ar71xx_set_pll(u32 cfg_reg, u32 pll_reg, u32 pll_val, u32 shift)
++{
++ void __iomem *base;
++ u32 t;
++
++ base = ioremap_nocache(AR71XX_PLL_BASE, AR71XX_PLL_SIZE);
++
++ t = __raw_readl(base + cfg_reg);
++ t &= ~(3 << shift);
++ t |= (2 << shift);
++ __raw_writel(t, base + cfg_reg);
++ udelay(100);
++
++ __raw_writel(pll_val, base + pll_reg);
++
++ t |= (3 << shift);
++ __raw_writel(t, base + cfg_reg);
++ udelay(100);
++
++ t &= ~(3 << shift);
++ __raw_writel(t, base + cfg_reg);
++ udelay(100);
++
++ printk(KERN_DEBUG "ar71xx: pll_reg %#x: %#x\n",
++ (unsigned int)(base + pll_reg), __raw_readl(base + pll_reg));
++
++ iounmap(base);
++}
++
++static void ar71xx_set_pll_ge0(u32 val)
++{
++ ar71xx_set_pll(AR71XX_PLL_REG_SEC_CONFIG, AR71XX_PLL_REG_ETH0_INT_CLOCK,
++ val, AR71XX_ETH0_PLL_SHIFT);
++}
++
++static void ar71xx_set_pll_ge1(u32 val)
++{
++ ar71xx_set_pll(AR71XX_PLL_REG_SEC_CONFIG, AR71XX_PLL_REG_ETH1_INT_CLOCK,
++ val, AR71XX_ETH1_PLL_SHIFT);
++}
++
++static void ar91xx_set_pll_ge0(u32 val)
++{
++ ar71xx_set_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH0_INT_CLOCK,
++ val, AR91XX_ETH0_PLL_SHIFT);
++}
++
++static void ar91xx_set_pll_ge1(u32 val)
++{
++ ar71xx_set_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH1_INT_CLOCK,
++ val, AR91XX_ETH1_PLL_SHIFT);
++}
++
++static void ar71xx_ddr_flush_ge0(void)
++{
++ ar71xx_ddr_flush(AR71XX_DDR_REG_FLUSH_GE0);
++}
++
++static void ar71xx_ddr_flush_ge1(void)
++{
++ ar71xx_ddr_flush(AR71XX_DDR_REG_FLUSH_GE1);
++}
++
++static void ar91xx_ddr_flush_ge0(void)
++{
++ ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE0);
++}
++
++static void ar91xx_ddr_flush_ge1(void)
++{
++ ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE1);
++}
++
++static struct resource ar71xx_eth0_resources[] = {
++ {
++ .name = "mac_base",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE0_BASE,
++ .end = AR71XX_GE0_BASE + 0x20 - 1,
++ }, {
++ .name = "mac_base2",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE0_BASE + 0x38,
++ .end = AR71XX_GE0_BASE + 0x200 - 1,
++ }, {
++ .name = "mii_ctrl",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_MII_BASE + MII_REG_MII0_CTRL,
++ .end = AR71XX_MII_BASE + MII_REG_MII0_CTRL + 3,
++ }, {
++ .name = "mac_irq",
++ .flags = IORESOURCE_IRQ,
++ .start = AR71XX_CPU_IRQ_GE0,
++ .end = AR71XX_CPU_IRQ_GE0,
++ },
++};
++
++struct ag71xx_platform_data ar71xx_eth0_data = {
++ .reset_bit = RESET_MODULE_GE0_MAC,
++};
++
++static struct platform_device ar71xx_eth0_device = {
++ .name = "ag71xx",
++ .id = 0,
++ .resource = ar71xx_eth0_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_eth0_resources),
++ .dev = {
++ .platform_data = &ar71xx_eth0_data,
++ },
++};
++
++static struct resource ar71xx_eth1_resources[] = {
++ {
++ .name = "mac_base",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE1_BASE,
++ .end = AR71XX_GE1_BASE + 0x20 - 1,
++ }, {
++ .name = "mac_base2",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE1_BASE + 0x38,
++ .end = AR71XX_GE1_BASE + 0x200 - 1,
++ }, {
++ .name = "mii_ctrl",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_MII_BASE + MII_REG_MII1_CTRL,
++ .end = AR71XX_MII_BASE + MII_REG_MII1_CTRL + 3,
++ }, {
++ .name = "mac_irq",
++ .flags = IORESOURCE_IRQ,
++ .start = AR71XX_CPU_IRQ_GE1,
++ .end = AR71XX_CPU_IRQ_GE1,
++ },
++};
++
++struct ag71xx_platform_data ar71xx_eth1_data = {
++ .reset_bit = RESET_MODULE_GE1_MAC,
++};
++
++static struct platform_device ar71xx_eth1_device = {
++ .name = "ag71xx",
++ .id = 1,
++ .resource = ar71xx_eth1_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_eth1_resources),
++ .dev = {
++ .platform_data = &ar71xx_eth1_data,
++ },
++};
++
++static int ar71xx_eth_instance __initdata;
++void __init ar71xx_add_device_eth(unsigned int id)
++{
++ struct platform_device *pdev;
++ struct ag71xx_platform_data *pdata;
++
++ switch (id) {
++ case 0:
++ switch (ar71xx_eth0_data.phy_if_mode) {
++ case PHY_INTERFACE_MODE_MII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_MII;
++ break;
++ case PHY_INTERFACE_MODE_GMII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_GMII;
++ break;
++ case PHY_INTERFACE_MODE_RGMII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_RGMII;
++ break;
++ case PHY_INTERFACE_MODE_RMII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_RMII;
++ break;
++ default:
++ printk(KERN_ERR "ar71xx: invalid PHY interface mode "
++ "for eth0\n");
++ return;
++ }
++ pdev = &ar71xx_eth0_device;
++ break;
++ case 1:
++ switch (ar71xx_eth1_data.phy_if_mode) {
++ case PHY_INTERFACE_MODE_RMII:
++ ar71xx_eth1_data.mii_if = MII1_CTRL_IF_RMII;
++ break;
++ case PHY_INTERFACE_MODE_RGMII:
++ ar71xx_eth1_data.mii_if = MII1_CTRL_IF_RGMII;
++ break;
++ default:
++ printk(KERN_ERR "ar71xx: invalid PHY interface mode "
++ "for eth1\n");
++ return;
++ }
++ pdev = &ar71xx_eth1_device;
++ break;
++ default:
++ printk(KERN_ERR "ar71xx: invalid ethernet id %d\n", id);
++ return;
++ }
++
++ pdata = pdev->dev.platform_data;
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ pdata->ddr_flush = id ? ar71xx_ddr_flush_ge1
++ : ar71xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar71xx_set_pll_ge1
++ : ar71xx_set_pll_ge0;
++ break;
++
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ pdata->ddr_flush = id ? ar71xx_ddr_flush_ge1
++ : ar71xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar71xx_set_pll_ge1
++ : ar71xx_set_pll_ge0;
++ pdata->has_gbit = 1;
++ break;
++
++ case AR71XX_SOC_AR9130:
++ pdata->ddr_flush = id ? ar91xx_ddr_flush_ge1
++ : ar91xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar91xx_set_pll_ge1
++ : ar91xx_set_pll_ge0;
++ pdata->is_ar91xx = 1;
++ break;
++
++ case AR71XX_SOC_AR9132:
++ pdata->ddr_flush = id ? ar91xx_ddr_flush_ge1
++ : ar91xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar91xx_set_pll_ge1
++ : ar91xx_set_pll_ge0;
++ pdata->is_ar91xx = 1;
++ pdata->has_gbit = 1;
++ break;
++
++ default:
++ BUG();
++ }
++
++ switch (pdata->phy_if_mode) {
++ case PHY_INTERFACE_MODE_GMII:
++ case PHY_INTERFACE_MODE_RGMII:
++ if (!pdata->has_gbit) {
++ printk(KERN_ERR "ar71xx: no gbit available on eth%d\n",
++ id);
++ return;
++ }
++ /* fallthrough */
++ default:
++ break;
++ }
++
++ if (is_valid_ether_addr(ar71xx_mac_base)) {
++ memcpy(pdata->mac_addr, ar71xx_mac_base, ETH_ALEN);
++ pdata->mac_addr[5] += ar71xx_eth_instance;
++ } else {
++ random_ether_addr(pdata->mac_addr);
++ printk(KERN_DEBUG
++ "ar71xx: using random MAC address for eth%d\n",
++ ar71xx_eth_instance);
++ }
++
++ platform_device_register(pdev);
++ ar71xx_eth_instance++;
++}
++
++static struct resource ar71xx_spi_resources[] = {
++ [0] = {
++ .start = AR71XX_SPI_BASE,
++ .end = AR71XX_SPI_BASE + AR71XX_SPI_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++static struct platform_device ar71xx_spi_device = {
++ .name = "ar71xx-spi",
++ .id = -1,
++ .resource = ar71xx_spi_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_spi_resources),
++};
++
++void __init ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
++ struct spi_board_info const *info,
++ unsigned n)
++{
++ spi_register_board_info(info, n);
++ ar71xx_spi_device.dev.platform_data = pdata;
++ platform_device_register(&ar71xx_spi_device);
++}
++
++void __init ar71xx_add_device_leds_gpio(int id, unsigned num_leds,
++ struct gpio_led *leds)
++{
++ struct platform_device *pdev;
++ struct gpio_led_platform_data pdata;
++ struct gpio_led *p;
++ int err;
++
++ p = kmalloc(num_leds * sizeof(*p), GFP_KERNEL);
++ if (!p)
++ return;
++
++ memcpy(p, leds, num_leds * sizeof(*p));
++
++ pdev = platform_device_alloc("leds-gpio", id);
++ if (!pdev)
++ goto err_free_leds;
++
++ memset(&pdata, 0, sizeof(pdata));
++ pdata.num_leds = num_leds;
++ pdata.leds = p;
++
++ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
++ if (err)
++ goto err_put_pdev;
++
++ err = platform_device_add(pdev);
++ if (err)
++ goto err_put_pdev;
++
++ return;
++
++err_put_pdev:
++ platform_device_put(pdev);
++
++err_free_leds:
++ kfree(p);
++}
++
++void __init ar71xx_add_device_gpio_buttons(int id,
++ unsigned poll_interval,
++ unsigned nbuttons,
++ struct gpio_button *buttons)
++{
++ struct platform_device *pdev;
++ struct gpio_buttons_platform_data pdata;
++ struct gpio_button *p;
++ int err;
++
++ p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
++ if (!p)
++ return;
++
++ memcpy(p, buttons, nbuttons * sizeof(*p));
++
++ pdev = platform_device_alloc("gpio-buttons", id);
++ if (!pdev)
++ goto err_free_buttons;
++
++ memset(&pdata, 0, sizeof(pdata));
++ pdata.poll_interval = poll_interval;
++ pdata.nbuttons = nbuttons;
++ pdata.buttons = p;
++
++ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
++ if (err)
++ goto err_put_pdev;
++
++
++ err = platform_device_add(pdev);
++ if (err)
++ goto err_put_pdev;
++
++ return;
++
++err_put_pdev:
++ platform_device_put(pdev);
++
++err_free_buttons:
++ kfree(p);
++}
++
++void __init ar71xx_add_device_wdt(void)
++{
++ platform_device_register_simple("ar71xx-wdt", -1, NULL, 0);
++}
++
++void __init ar71xx_set_mac_base(unsigned char *mac)
++{
++ memcpy(ar71xx_mac_base, mac, ETH_ALEN);
++}
++
++void __init ar71xx_parse_mac_addr(char *mac_str)
++{
++ u8 tmp[ETH_ALEN];
++ int t;
++
++ t = sscanf(mac_str, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
++ &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]);
++
++ if (t != ETH_ALEN)
++ t = sscanf(mac_str, "%02hhx.%02hhx.%02hhx.%02hhx.%02hhx.%02hhx",
++ &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]);
++
++ if (t == ETH_ALEN)
++ ar71xx_set_mac_base(tmp);
++ else
++ printk(KERN_DEBUG "ar71xx: failed to parse mac address "
++ "\"%s\"\n", mac_str);
++}
++
++static struct resource ar91xx_wmac_resources[] = {
++ {
++ .start = AR91XX_WMAC_BASE,
++ .end = AR91XX_WMAC_BASE + AR91XX_WMAC_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ }, {
++ .start = AR71XX_CPU_IRQ_WMAC,
++ .end = AR71XX_CPU_IRQ_WMAC,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct ath9k_platform_data ar91xx_wmac_data;
++
++static struct platform_device ar91xx_wmac_device = {
++ .name = "ath9k",
++ .id = -1,
++ .resource = ar91xx_wmac_resources,
++ .num_resources = ARRAY_SIZE(ar91xx_wmac_resources),
++ .dev = {
++ .platform_data = &ar91xx_wmac_data,
++ },
++};
++
++void __init ar91xx_add_device_wmac(void)
++{
++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
++
++ memcpy(ar91xx_wmac_data.eeprom_data, ee,
++ sizeof(ar91xx_wmac_data.eeprom_data));
++
++ ar71xx_device_stop(RESET_MODULE_AMBA2WMAC);
++ mdelay(10);
++
++ ar71xx_device_start(RESET_MODULE_AMBA2WMAC);
++ mdelay(10);
++
++ platform_device_register(&ar91xx_wmac_device);
++}
++
++static struct platform_device ar71xx_dsa_switch_device = {
++ .name = "dsa",
++ .id = 0,
++};
++
++void __init ar71xx_add_device_dsa(unsigned int id,
++ struct dsa_platform_data *d)
++{
++ switch (id) {
++ case 0:
++ d->netdev = &ar71xx_eth0_device.dev;
++ break;
++ case 1:
++ d->netdev = &ar71xx_eth1_device.dev;
++ break;
++ default:
++ printk(KERN_ERR
++ "ar71xx: invalid ethernet id %d for DSA switch\n",
++ id);
++ return;
++ }
++ d->mii_bus = &ar71xx_mdio_device.dev;
++ ar71xx_dsa_switch_device.dev.platform_data = d;
++
++ platform_device_register(&ar71xx_dsa_switch_device);
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/devices.h linux-2.6.29.1/arch/mips/ar71xx/devices.h
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/devices.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/devices.h 2009-04-13 14:27:34.491064431 +0200
+@@ -0,0 +1,58 @@
++/*
++ * Atheros AR71xx SoC device definitions
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __AR71XX_DEVICES_H
++#define __AR71XX_DEVICES_H
++
++#include <asm/mach-ar71xx/platform.h>
++
++#include <linux/leds.h>
++#include <linux/gpio_buttons.h>
++#include <net/dsa.h>
++
++void ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
++ struct spi_board_info const *info,
++ unsigned n) __init;
++
++void ar71xx_set_mac_base(unsigned char *mac) __init;
++void ar71xx_parse_mac_addr(char *mac_str) __init;
++
++extern struct ag71xx_platform_data ar71xx_eth0_data;
++extern struct ag71xx_platform_data ar71xx_eth1_data;
++void ar71xx_add_device_eth(unsigned int id) __init;
++
++void ar71xx_add_device_mdio(u32 phy_mask) __init;
++
++void ar71xx_add_device_leds_gpio(int id,
++ unsigned num_leds,
++ struct gpio_led *leds) __init;
++
++void ar71xx_add_device_gpio_buttons(int id,
++ unsigned poll_interval,
++ unsigned nbuttons,
++ struct gpio_button *buttons) __init;
++
++void ar71xx_add_device_usb(void) __init;
++
++#ifdef CONFIG_AR71XX_EARLY_SERIAL
++static inline void ar71xx_add_device_uart(void) {}
++#else
++void ar71xx_add_device_uart(void) __init;
++#endif
++
++void ar71xx_add_device_wdt(void) __init;
++
++void ar91xx_add_device_wmac(void) __init;
++
++void ar71xx_add_device_dsa(unsigned int id,
++ struct dsa_platform_data *d) __init;
++
++#endif /* __AR71XX_DEVICES_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/gpio.c linux-2.6.29.1/arch/mips/ar71xx/gpio.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/gpio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/gpio.c 2009-04-13 14:27:34.495064103 +0200
+@@ -0,0 +1,154 @@
++/*
++ * Atheros AR71xx SoC GPIO API support
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/spinlock.h>
++#include <linux/io.h>
++#include <linux/ioport.h>
++#include <linux/gpio.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++static DEFINE_SPINLOCK(ar71xx_gpio_lock);
++
++unsigned long ar71xx_gpio_count;
++EXPORT_SYMBOL(ar71xx_gpio_count);
++
++void __ar71xx_gpio_set_value(unsigned gpio, int value)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ if (value)
++ ar71xx_gpio_wr(GPIO_REG_SET, (1 << gpio));
++ else
++ ar71xx_gpio_wr(GPIO_REG_CLEAR, (1 << gpio));
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++}
++EXPORT_SYMBOL(__ar71xx_gpio_set_value);
++
++int __ar71xx_gpio_get_value(unsigned gpio)
++{
++ return (ar71xx_gpio_rr(GPIO_REG_IN) & (1 << gpio)) ? 1 : 0;
++}
++EXPORT_SYMBOL(__ar71xx_gpio_get_value);
++
++static int ar71xx_gpio_get_value(struct gpio_chip *chip, unsigned offset)
++{
++ return __ar71xx_gpio_get_value(offset);
++}
++
++static void ar71xx_gpio_set_value(struct gpio_chip *chip,
++ unsigned offset, int value)
++{
++ __ar71xx_gpio_set_value(offset, value);
++}
++
++static int ar71xx_gpio_direction_input(struct gpio_chip *chip,
++ unsigned offset)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ ar71xx_gpio_wr(GPIO_REG_OE,
++ ar71xx_gpio_rr(GPIO_REG_OE) & ~(1 << offset));
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++
++ return 0;
++}
++
++static int ar71xx_gpio_direction_output(struct gpio_chip *chip,
++ unsigned offset, int value)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ if (value)
++ ar71xx_gpio_wr(GPIO_REG_SET, (1 << offset));
++ else
++ ar71xx_gpio_wr(GPIO_REG_CLEAR, (1 << offset));
++
++ ar71xx_gpio_wr(GPIO_REG_OE,
++ ar71xx_gpio_rr(GPIO_REG_OE) | (1 << offset));
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++
++ return 0;
++}
++
++static struct gpio_chip ar71xx_gpio_chip = {
++ .label = "ar71xx",
++ .get = ar71xx_gpio_get_value,
++ .set = ar71xx_gpio_set_value,
++ .direction_input = ar71xx_gpio_direction_input,
++ .direction_output = ar71xx_gpio_direction_output,
++ .base = 0,
++ .ngpio = AR71XX_GPIO_COUNT,
++};
++
++void ar71xx_gpio_function_enable(u32 mask)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ ar71xx_gpio_wr(GPIO_REG_FUNC, ar71xx_gpio_rr(GPIO_REG_FUNC) | mask);
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++}
++
++void ar71xx_gpio_function_disable(u32 mask)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ ar71xx_gpio_wr(GPIO_REG_FUNC, ar71xx_gpio_rr(GPIO_REG_FUNC) & ~mask);
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++}
++
++void __init ar71xx_gpio_init(void)
++{
++ int err;
++
++ if (!request_mem_region(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE,
++ "AR71xx GPIO controller"))
++ panic("cannot allocate AR71xx GPIO registers page");
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ ar71xx_gpio_chip.ngpio = AR71XX_GPIO_COUNT;
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar71xx_gpio_chip.ngpio = AR91XX_GPIO_COUNT;
++ break;
++
++ default:
++ BUG();
++ }
++
++ err = gpiochip_add(&ar71xx_gpio_chip);
++ if (err)
++ panic("cannot add AR71xx GPIO chip, error=%d", err);
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/irq.c linux-2.6.29.1/arch/mips/ar71xx/irq.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/irq.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/irq.c 2009-04-13 14:27:34.543070220 +0200
+@@ -0,0 +1,302 @@
++/*
++ * Atheros AR71xx SoC specific interrupt handling
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/irq.h>
++
++#include <asm/irq_cpu.h>
++#include <asm/mipsregs.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#ifdef CONFIG_PCI
++static void ar71xx_pci_irq_dispatch(void)
++{
++ u32 pending;
++
++ pending = ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_STATUS) &
++ ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE);
++
++ if (pending & PCI_INT_DEV0)
++ do_IRQ(AR71XX_PCI_IRQ_DEV0);
++
++ else if (pending & PCI_INT_DEV1)
++ do_IRQ(AR71XX_PCI_IRQ_DEV1);
++
++ else if (pending & PCI_INT_DEV2)
++ do_IRQ(AR71XX_PCI_IRQ_DEV2);
++
++ else
++ spurious_interrupt();
++}
++
++static void ar71xx_pci_irq_unmask(unsigned int irq)
++{
++ irq -= AR71XX_PCI_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) | (1 << irq));
++}
++
++static void ar71xx_pci_irq_mask(unsigned int irq)
++{
++ irq -= AR71XX_PCI_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) & ~(1 << irq));
++}
++
++static struct irq_chip ar71xx_pci_irq_chip = {
++ .name = "AR71XX PCI ",
++ .mask = ar71xx_pci_irq_mask,
++ .unmask = ar71xx_pci_irq_unmask,
++ .mask_ack = ar71xx_pci_irq_mask,
++};
++
++static struct irqaction ar71xx_pci_irqaction = {
++ .handler = no_action,
++ .name = "cascade [AR71XX PCI]",
++};
++
++static void __init ar71xx_pci_irq_init(void)
++{
++ int i;
++
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, 0);
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_STATUS, 0);
++
++ for (i = AR71XX_PCI_IRQ_BASE;
++ i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) {
++ irq_desc[i].status = IRQ_DISABLED;
++ set_irq_chip_and_handler(i, &ar71xx_pci_irq_chip,
++ handle_level_irq);
++ }
++
++ setup_irq(AR71XX_CPU_IRQ_PCI, &ar71xx_pci_irqaction);
++}
++#endif /* CONFIG_PCI */
++
++static void ar71xx_gpio_irq_dispatch(void)
++{
++ u32 pending;
++
++ pending = ar71xx_gpio_rr(GPIO_REG_INT_PENDING)
++ & ar71xx_gpio_rr(GPIO_REG_INT_ENABLE);
++
++ if (pending)
++ do_IRQ(AR71XX_GPIO_IRQ_BASE + fls(pending) - 1);
++ else
++ spurious_interrupt();
++}
++
++static void ar71xx_gpio_irq_unmask(unsigned int irq)
++{
++ irq -= AR71XX_GPIO_IRQ_BASE;
++ ar71xx_gpio_wr(GPIO_REG_INT_ENABLE,
++ ar71xx_gpio_rr(GPIO_REG_INT_ENABLE) | (1 << irq));
++}
++
++static void ar71xx_gpio_irq_mask(unsigned int irq)
++{
++ irq -= AR71XX_GPIO_IRQ_BASE;
++ ar71xx_gpio_wr(GPIO_REG_INT_ENABLE,
++ ar71xx_gpio_rr(GPIO_REG_INT_ENABLE) & ~(1 << irq));
++}
++
++#if 0
++static int ar71xx_gpio_irq_set_type(unsigned int irq, unsigned int flow_type)
++{
++ /* TODO: implement */
++ return 0;
++}
++#else
++#define ar71xx_gpio_irq_set_type NULL
++#endif
++
++struct irq_chip ar71xx_gpio_irq_chip = {
++ .name = "AR71XX GPIO",
++ .unmask = ar71xx_gpio_irq_unmask,
++ .mask = ar71xx_gpio_irq_mask,
++ .mask_ack = ar71xx_gpio_irq_mask,
++ .set_type = ar71xx_gpio_irq_set_type,
++};
++
++static struct irqaction ar71xx_gpio_irqaction = {
++ .handler = no_action,
++ .name = "cascade [AR71XX GPIO]",
++};
++
++#define GPIO_IRQ_INIT_STATUS (IRQ_LEVEL | IRQ_TYPE_LEVEL_HIGH | IRQ_DISABLED)
++#define GPIO_INT_ALL 0xffff
++
++static void __init ar71xx_gpio_irq_init(void)
++{
++ int i;
++
++ ar71xx_gpio_wr(GPIO_REG_INT_ENABLE, 0);
++ ar71xx_gpio_wr(GPIO_REG_INT_PENDING, 0);
++
++ /* setup type of all GPIO interrupts to level sensitive */
++ ar71xx_gpio_wr(GPIO_REG_INT_TYPE, GPIO_INT_ALL);
++
++ /* setup polarity of all GPIO interrupts to active high */
++ ar71xx_gpio_wr(GPIO_REG_INT_POLARITY, GPIO_INT_ALL);
++
++ for (i = AR71XX_GPIO_IRQ_BASE;
++ i < AR71XX_GPIO_IRQ_BASE + AR71XX_GPIO_IRQ_COUNT; i++) {
++ irq_desc[i].status = GPIO_IRQ_INIT_STATUS;
++ set_irq_chip_and_handler(i, &ar71xx_gpio_irq_chip,
++ handle_level_irq);
++ }
++
++ setup_irq(AR71XX_MISC_IRQ_GPIO, &ar71xx_gpio_irqaction);
++}
++
++static void ar71xx_misc_irq_dispatch(void)
++{
++ u32 pending;
++
++ pending = ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_STATUS)
++ & ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE);
++
++ if (pending & MISC_INT_UART)
++ do_IRQ(AR71XX_MISC_IRQ_UART);
++
++ else if (pending & MISC_INT_DMA)
++ do_IRQ(AR71XX_MISC_IRQ_DMA);
++
++ else if (pending & MISC_INT_PERFC)
++ do_IRQ(AR71XX_MISC_IRQ_PERFC);
++
++ else if (pending & MISC_INT_TIMER)
++ do_IRQ(AR71XX_MISC_IRQ_TIMER);
++
++ else if (pending & MISC_INT_OHCI)
++ do_IRQ(AR71XX_MISC_IRQ_OHCI);
++
++ else if (pending & MISC_INT_ERROR)
++ do_IRQ(AR71XX_MISC_IRQ_ERROR);
++
++ else if (pending & MISC_INT_GPIO)
++ ar71xx_gpio_irq_dispatch();
++
++ else if (pending & MISC_INT_WDOG)
++ do_IRQ(AR71XX_MISC_IRQ_WDOG);
++
++ else
++ spurious_interrupt();
++}
++
++static void ar71xx_misc_irq_unmask(unsigned int irq)
++{
++ irq -= AR71XX_MISC_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE) | (1 << irq));
++}
++
++static void ar71xx_misc_irq_mask(unsigned int irq)
++{
++ irq -= AR71XX_MISC_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE) & ~(1 << irq));
++}
++
++struct irq_chip ar71xx_misc_irq_chip = {
++ .name = "AR71XX MISC",
++ .unmask = ar71xx_misc_irq_unmask,
++ .mask = ar71xx_misc_irq_mask,
++ .mask_ack = ar71xx_misc_irq_mask,
++};
++
++static struct irqaction ar71xx_misc_irqaction = {
++ .handler = no_action,
++ .name = "cascade [AR71XX MISC]",
++};
++
++static void __init ar71xx_misc_irq_init(void)
++{
++ int i;
++
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, 0);
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_STATUS, 0);
++
++ for (i = AR71XX_MISC_IRQ_BASE;
++ i < AR71XX_MISC_IRQ_BASE + AR71XX_MISC_IRQ_COUNT; i++) {
++ irq_desc[i].status = IRQ_DISABLED;
++ set_irq_chip_and_handler(i, &ar71xx_misc_irq_chip,
++ handle_level_irq);
++ }
++
++ setup_irq(AR71XX_CPU_IRQ_MISC, &ar71xx_misc_irqaction);
++}
++
++static void ar913x_wmac_irq_dispatch(void)
++{
++ do_IRQ(AR71XX_CPU_IRQ_WMAC);
++}
++
++static void (* ar71xx_ip2_irq_handler)(void) = spurious_interrupt;
++
++asmlinkage void plat_irq_dispatch(void)
++{
++ unsigned long pending;
++
++ pending = read_c0_status() & read_c0_cause() & ST0_IM;
++
++ if (pending & STATUSF_IP7)
++ do_IRQ(AR71XX_CPU_IRQ_TIMER);
++
++ else if (pending & STATUSF_IP2)
++ ar71xx_ip2_irq_handler();
++
++ else if (pending & STATUSF_IP4)
++ do_IRQ(AR71XX_CPU_IRQ_GE0);
++
++ else if (pending & STATUSF_IP5)
++ do_IRQ(AR71XX_CPU_IRQ_GE1);
++
++ else if (pending & STATUSF_IP3)
++ do_IRQ(AR71XX_CPU_IRQ_USB);
++
++ else if (pending & STATUSF_IP6)
++ ar71xx_misc_irq_dispatch();
++
++ else
++ spurious_interrupt();
++}
++
++void __init arch_init_irq(void)
++{
++ mips_cpu_irq_init();
++
++ ar71xx_misc_irq_init();
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++#ifdef CONFIG_PCI
++ ar71xx_pci_irq_init();
++ ar71xx_ip2_irq_handler = ar71xx_pci_irq_dispatch;
++#endif
++ break;
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar71xx_ip2_irq_handler = ar913x_wmac_irq_dispatch;
++ break;
++ default:
++ BUG();
++ }
++
++ ar71xx_gpio_irq_init();
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap81.c linux-2.6.29.1/arch/mips/ar71xx/mach-ap81.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap81.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-ap81.c 2009-04-13 14:27:34.543070220 +0200
+@@ -0,0 +1,148 @@
++/*
++ * Atheros AP81 board support
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define AP81_GPIO_LED_STATUS 1
++#define AP81_GPIO_LED_AOSS 3
++#define AP81_GPIO_LED_WLAN 6
++#define AP81_GPIO_LED_POWER 14
++
++#define AP81_GPIO_BTN_SW4 12
++#define AP81_GPIO_BTN_SW1 21
++
++#define AP81_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition ap81_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x050000,
++ .size = 0x500000,
++ } , {
++ .name = "uImage",
++ .offset = 0x550000,
++ .size = 0x100000,
++ } , {
++ .name = "ART",
++ .offset = 0x650000,
++ .size = 0x1b0000,
++ .mask_flags = MTD_WRITEABLE,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data ap81_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = ap81_partitions,
++ .nr_parts = ARRAY_SIZE(ap81_partitions),
++#endif
++};
++
++static struct spi_board_info ap81_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &ap81_flash_data,
++ }
++};
++
++static struct gpio_led ap81_leds_gpio[] __initdata = {
++ {
++ .name = "ap81:green:status",
++ .gpio = AP81_GPIO_LED_STATUS,
++ .active_low = 1,
++ }, {
++ .name = "ap81:amber:aoss",
++ .gpio = AP81_GPIO_LED_AOSS,
++ .active_low = 1,
++ }, {
++ .name = "ap81:green:wlan",
++ .gpio = AP81_GPIO_LED_WLAN,
++ .active_low = 1,
++ }, {
++ .name = "ap81:green:power",
++ .gpio = AP81_GPIO_LED_POWER,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button ap81_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw1",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = AP81_GPIO_BTN_SW1,
++ .active_low = 1,
++ } , {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = AP81_GPIO_BTN_SW4,
++ .active_low = 1,
++ }
++};
++
++static void __init ap81_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++ ar71xx_eth0_data.has_ar8216 = 1;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_usb();
++
++ ar71xx_add_device_spi(NULL, ap81_spi_info,
++ ARRAY_SIZE(ap81_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio),
++ ap81_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, AP81_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(ap81_gpio_buttons),
++ ap81_gpio_buttons);
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_AP81, "Atheros AP81", ap81_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap83.c linux-2.6.29.1/arch/mips/ar71xx/mach-ap83.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap83.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-ap83.c 2009-04-13 14:27:34.547067937 +0200
+@@ -0,0 +1,87 @@
++/*
++ * Atheros AP83 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define AP83_GPIO_LED_WLAN 6
++#define AP83_GPIO_LED_POWER 14
++#define AP83_GPIO_LED_JUMPSTART 15
++#define AP83_GPIO_BTN_JUMPSTART 12
++#define AP83_GPIO_BTN_RESET 21
++
++static struct gpio_led ap83_leds_gpio[] __initdata = {
++ {
++ .name = "ap83:green:jumpstart",
++ .gpio = AP83_GPIO_LED_JUMPSTART,
++ .active_low = 0,
++ }, {
++ .name = "ap83:green:power",
++ .gpio = AP83_GPIO_LED_POWER,
++ .active_low = 0,
++ }, {
++ .name = "ap83:green:wlan",
++ .gpio = AP83_GPIO_LED_WLAN,
++ .active_low = 0,
++ },
++};
++
++static struct gpio_button ap83_gpio_buttons[] __initdata = {
++ {
++ .desc = "soft_reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = AP83_GPIO_BTN_RESET,
++ .active_low = 1,
++ } , {
++ .desc = "jumpstart",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = AP83_GPIO_BTN_JUMPSTART,
++ .active_low = 1,
++ }
++};
++
++static void __init ap83_setup(void)
++{
++ ar71xx_add_device_mdio(0xfffffffe);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++ ar71xx_eth0_data.phy_mask = 0x1;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++ ar71xx_eth1_data.phy_mask = 0x0;
++ ar71xx_eth1_data.speed = SPEED_1000;
++ ar71xx_eth1_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
++ ap83_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(ap83_gpio_buttons),
++ ap83_gpio_buttons);
++
++ ar71xx_add_device_usb();
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_AP83, "Atheros AP83", ap83_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-aw-nr580.c linux-2.6.29.1/arch/mips/ar71xx/mach-aw-nr580.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-aw-nr580.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-aw-nr580.c 2009-04-13 14:27:34.547067937 +0200
+@@ -0,0 +1,119 @@
++/*
++ * AzureWave AW-NR580 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define AW_NR580_GPIO_LED_READY_RED 0
++#define AW_NR580_GPIO_LED_WLAN 1
++#define AW_NR580_GPIO_LED_READY_GREEN 2
++#define AW_NR580_GPIO_LED_WPS_GREEN 4
++#define AW_NR580_GPIO_LED_WPS_AMBER 5
++
++#define AW_NR580_GPIO_BTN_WPS 3
++#define AW_NR580_GPIO_BTN_RESET 11
++
++#define AW_NR580_BUTTONS_POLL_INTERVAL 20
++
++static struct spi_board_info aw_nr580_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct gpio_led aw_nr580_leds_gpio[] __initdata = {
++ {
++ .name = "aw-nr580:red:ready",
++ .gpio = AW_NR580_GPIO_LED_READY_RED,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:green:ready",
++ .gpio = AW_NR580_GPIO_LED_READY_GREEN,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:green:wps",
++ .gpio = AW_NR580_GPIO_LED_WPS_GREEN,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:amber:wps",
++ .gpio = AW_NR580_GPIO_LED_WPS_AMBER,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:green:wlan",
++ .gpio = AW_NR580_GPIO_LED_WLAN,
++ .active_low = 0,
++ }
++};
++
++static struct gpio_button aw_nr580_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = AW_NR580_GPIO_BTN_RESET,
++ .active_low = 1,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = AW_NR580_GPIO_BTN_WPS,
++ .active_low = 1,
++ }
++};
++
++static struct ar71xx_pci_irq aw_nr580_pci_irqs[] __initdata = {
++ {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }
++};
++
++static void __init aw_nr580_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_pci_init(ARRAY_SIZE(aw_nr580_pci_irqs), aw_nr580_pci_irqs);
++
++ ar71xx_add_device_spi(NULL, aw_nr580_spi_info,
++ ARRAY_SIZE(aw_nr580_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(aw_nr580_leds_gpio),
++ aw_nr580_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, AW_NR580_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(aw_nr580_gpio_buttons),
++ aw_nr580_gpio_buttons);
++}
++
++MIPS_MACHINE(AR71XX_MACH_AW_NR580, "AzureWave AW-NR580", aw_nr580_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-generic.c linux-2.6.29.1/arch/mips/ar71xx/mach-generic.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-generic.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-generic.c 2009-04-13 14:27:34.547067937 +0200
+@@ -0,0 +1,22 @@
++/*
++ * Generic AR71xx machine support
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++
++static void __init ar71xx_generic_init(void)
++{
++ /* Nothing to do */
++}
++
++MIPS_MACHINE(AR71XX_MACH_GENERIC, "Generic AR71xx board", ar71xx_generic_init);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w04nu.c linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w04nu.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w04nu.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w04nu.c 2009-04-13 14:27:34.551067888 +0200
+@@ -0,0 +1,173 @@
++/*
++ * Planex MZK-W04NU board support
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define MZK_W04NU_GPIO_LED_USB 0
++#define MZK_W04NU_GPIO_LED_STATUS 1
++#define MZK_W04NU_GPIO_LED_WPS 3
++#define MZK_W04NU_GPIO_LED_WLAN 6
++#define MZK_W04NU_GPIO_LED_AP 15
++#define MZK_W04NU_GPIO_LED_ROUTER 16
++
++#define MZK_W04NU_GPIO_BTN_APROUTER 5
++#define MZK_W04NU_GPIO_BTN_WPS 12
++#define MZK_W04NU_GPIO_BTN_RESET 21
++
++#define MZK_W04NU_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition mzk_w04nu_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "kernel",
++ .offset = 0x050000,
++ .size = 0x160000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x1b0000,
++ .size = 0x630000,
++ } , {
++ .name = "art",
++ .offset = 0x7e0000,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "firmware",
++ .offset = 0x050000,
++ .size = 0x770000,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data mzk_w04nu_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = mzk_w04nu_partitions,
++ .nr_parts = ARRAY_SIZE(mzk_w04nu_partitions),
++#endif
++};
++
++static struct spi_board_info mzk_w04nu_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &mzk_w04nu_flash_data,
++ }
++};
++
++static struct gpio_led mzk_w04nu_leds_gpio[] __initdata = {
++ {
++ .name = "mzk-w04nu:green:status",
++ .gpio = MZK_W04NU_GPIO_LED_STATUS,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:blue:wps",
++ .gpio = MZK_W04NU_GPIO_LED_WPS,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:wlan",
++ .gpio = MZK_W04NU_GPIO_LED_WLAN,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:usb",
++ .gpio = MZK_W04NU_GPIO_LED_USB,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:ap",
++ .gpio = MZK_W04NU_GPIO_LED_AP,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:router",
++ .gpio = MZK_W04NU_GPIO_LED_ROUTER,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button mzk_w04nu_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = MZK_W04NU_GPIO_BTN_RESET,
++ .active_low = 1,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = MZK_W04NU_GPIO_BTN_WPS,
++ .active_low = 1,
++ }, {
++ .desc = "aprouter",
++ .type = EV_KEY,
++ .code = BTN_2,
++ .threshold = 5,
++ .gpio = MZK_W04NU_GPIO_BTN_APROUTER,
++ .active_low = 0,
++ }
++};
++
++static void __init mzk_w04nu_setup(void)
++{
++ u8 *mac = (u8 *) KSEG1ADDR(0x1fff1000);
++
++ ar71xx_set_mac_base(mac);
++
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++ ar71xx_eth0_data.has_ar8216 = 1;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_spi(NULL, mzk_w04nu_spi_info,
++ ARRAY_SIZE(mzk_w04nu_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(mzk_w04nu_leds_gpio),
++ mzk_w04nu_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, MZK_W04NU_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(mzk_w04nu_gpio_buttons),
++ mzk_w04nu_gpio_buttons);
++ ar71xx_add_device_usb();
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_MZK_W04NU, "Planex MZK-W04NU", mzk_w04nu_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w300nh.c linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w300nh.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w300nh.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w300nh.c 2009-04-13 14:27:34.551067888 +0200
+@@ -0,0 +1,81 @@
++/*
++ * Planex MZK-W300NH board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition mzk_w300nh_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "uImage",
++ .offset = 0x050000,
++ .size = 0x160000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x1b0000,
++ .size = 0x610000,
++ } , {
++ .name = "config",
++ .offset = 0x7c0000,
++ .size = 0x020000,
++ } , {
++ .name = "art",
++ .offset = 0x7e0000,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data mzk_w300nh_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = mzk_w300nh_partitions,
++ .nr_parts = ARRAY_SIZE(mzk_w300nh_partitions),
++#endif
++};
++
++static struct spi_board_info mzk_w300nh_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &mzk_w300nh_flash_data,
++ }
++};
++
++static void __init mzk_w300nh_setup(void)
++{
++ ar71xx_add_device_spi(NULL, mzk_w300nh_spi_info,
++ ARRAY_SIZE(mzk_w300nh_spi_info));
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_MZK_W300NH, "Planex MZK-W300NH", mzk_w300nh_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-pb42.c linux-2.6.29.1/arch/mips/ar71xx/mach-pb42.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-pb42.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-pb42.c 2009-04-13 14:27:34.555068677 +0200
+@@ -0,0 +1,102 @@
++/*
++ * Atheros PB42 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++#include <linux/bitops.h>
++#include <linux/input.h>
++#include <linux/platform_device.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define PB42_BUTTONS_POLL_INTERVAL 20
++
++#define PB42_GPIO_BTN_SW4 8
++#define PB42_GPIO_BTN_SW5 3
++
++static struct spi_board_info pb42_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct ar71xx_pci_irq pb42_pci_irqs[] __initdata = {
++ {
++ .slot = 0,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 2,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV2,
++ }
++};
++
++static struct gpio_button pb42_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = PB42_GPIO_BTN_SW4,
++ .active_low = 1,
++ } , {
++ .desc = "sw5",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = PB42_GPIO_BTN_SW5,
++ .active_low = 1,
++ }
++};
++
++#define PB42_WAN_PHYMASK BIT(20)
++#define PB42_LAN_PHYMASK (BIT(16) | BIT(17) | BIT(18) | BIT(19))
++#define PB42_MDIO_PHYMASK (PB42_LAN_PHYMASK | PB42_WAN_PHYMASK)
++
++static void __init pb42_init(void)
++{
++ ar71xx_add_device_spi(NULL, pb42_spi_info,
++ ARRAY_SIZE(pb42_spi_info));
++
++ ar71xx_add_device_mdio(~PB42_MDIO_PHYMASK);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = PB42_WAN_PHYMASK;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = PB42_LAN_PHYMASK;
++ ar71xx_eth1_data.speed = SPEED_100;
++ ar71xx_eth1_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_gpio_buttons(-1, PB42_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(pb42_gpio_buttons),
++ pb42_gpio_buttons);
++
++ ar71xx_pci_init(ARRAY_SIZE(pb42_pci_irqs), pb42_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_PB42, "Atheros PB42", pb42_init);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-rb-4xx.c linux-2.6.29.1/arch/mips/ar71xx/mach-rb-4xx.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-rb-4xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-rb-4xx.c 2009-04-13 14:27:34.555068677 +0200
+@@ -0,0 +1,251 @@
++/*
++ * MikroTik RouterBOARD 4xx series support
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/irq.h>
++#include <linux/mmc/host.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/spi/mmc_spi.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define RB4XX_GPIO_USER_LED 4
++#define RB4XX_GPIO_RESET_SWITCH 7
++
++#define RB4XX_BUTTONS_POLL_INTERVAL 20
++
++static struct gpio_led rb4xx_leds_gpio[] __initdata = {
++ {
++ .name = "rb4xx:yellow:user",
++ .gpio = RB4XX_GPIO_USER_LED,
++ .active_low = 0,
++ },
++};
++
++static struct gpio_button rb4xx_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset_switch",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = RB4XX_GPIO_RESET_SWITCH,
++ .active_low = 1,
++ }
++};
++
++static struct platform_device rb4xx_nand_device = {
++ .name = "rb4xx-nand",
++ .id = -1,
++};
++
++static struct ar71xx_pci_irq rb4xx_pci_irqs[] __initdata = {
++ {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 2,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 2,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 3,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV2,
++ }
++};
++
++#if 0
++/*
++ * SPI device support is experimental
++ */
++static struct flash_platform_data rb4xx_flash_data = {
++ .type = "pm25lv512",
++};
++
++static struct spi_board_info rb4xx_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &rb4xx_flash_data,
++ }
++};
++
++static struct mmc_spi_platform_data rb433_mmc_data = {
++ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
++};
++
++static struct spi_board_info rb433_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &rb433_flash_data,
++ }, {
++ .bus_num = 0,
++ .chip_select = 2,
++ .max_speed_hz = 25000000,
++ .modalias = "mmc_spi",
++ .platform_data = &rb433_mmc_data,
++ }
++};
++
++static u32 rb433_spi_get_ioc_base(u8 chip_select, int cs_high, int is_on)
++{
++ u32 ret;
++
++ if (is_on == AR71XX_SPI_CS_INACTIVE) {
++ ret = SPI_IOC_CS0 | SPI_IOC_CS1;
++ } else {
++ if (cs_high) {
++ ret = SPI_IOC_CS0 | SPI_IOC_CS1;
++ } else {
++ if ((chip_select ^ 2) == 0)
++ ret = SPI_IOC_CS1 ^ (SPI_IOC_CS0 | SPI_IOC_CS1);
++ else
++ ret = SPI_IOC_CS0 ^ (SPI_IOC_CS0 | SPI_IOC_CS1);
++ }
++ }
++
++ return ret;
++}
++
++struct ar71xx_spi_platform_data rb433_spi_data = {
++ .bus_num = 0,
++ .num_chipselect = 3,
++ .get_ioc_base = rb433_spi_get_ioc_base,
++};
++
++static void rb4xx_add_device_spi(void)
++{
++ ar71xx_add_device_spi(NULL, rb4xx_spi_info, ARRAY_SIZE(rb4xx_spi_info));
++}
++
++static void rb433_add_device_spi(void)
++{
++ ar71xx_add_device_spi(&rb433_spi_data, rb433_spi_info,
++ ARRAY_SIZE(rb433_spi_info));
++}
++#else
++static inline void rb4xx_add_device_spi(void) {}
++static inline void rb433_add_device_spi(void) {}
++#endif
++
++static void __init rb4xx_generic_setup(void)
++{
++ ar71xx_gpio_function_enable(GPIO_FUNC_SPI_CS1_EN |
++ GPIO_FUNC_SPI_CS2_EN);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
++ rb4xx_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(rb4xx_gpio_buttons),
++ rb4xx_gpio_buttons);
++
++ platform_device_register(&rb4xx_nand_device);
++}
++
++static void __init rb411_setup(void)
++{
++ rb4xx_generic_setup();
++ rb4xx_add_device_spi();
++
++ ar71xx_add_device_mdio(0xfffffffe);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x00000001;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);
++
++static void __init rb433_setup(void)
++{
++ rb4xx_generic_setup();
++ rb433_add_device_spi();
++
++ ar71xx_add_device_mdio(0xffffffe9);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x00000006;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x00000010;
++
++ ar71xx_add_device_eth(1);
++ ar71xx_add_device_eth(0);
++
++ ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_433, "MikroTik RouterBOARD 433/AH", rb433_setup);
++
++static void __init rb450_setup(void)
++{
++ rb4xx_generic_setup();
++ rb4xx_add_device_spi();
++
++ ar71xx_add_device_mdio(0xffffffe0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x0000000f;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x00000010;
++
++ ar71xx_add_device_eth(1);
++ ar71xx_add_device_eth(0);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_450, "MikroTik RouterBOARD 450", rb450_setup);
++
++static void __init rb493_setup(void)
++{
++ rb4xx_generic_setup();
++ rb4xx_add_device_spi();
++
++ ar71xx_add_device_mdio(0x3fffff00);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x00000001;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_493, "MikroTik RouterBOARD 493/AH", rb493_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tew-632brp.c linux-2.6.29.1/arch/mips/ar71xx/mach-tew-632brp.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tew-632brp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-tew-632brp.c 2009-04-13 14:27:34.559070024 +0200
+@@ -0,0 +1,142 @@
++/*
++ * TrendNET TEW-632BRP board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define TEW_632BRP_GPIO_LED_STATUS 1
++#define TEW_632BRP_GPIO_LED_WPS 3
++#define TEW_632BRP_GPIO_LED_WLAN 6
++#define TEW_632BRP_GPIO_BTN_WPS 12
++#define TEW_632BRP_GPIO_BTN_RESET 21
++
++#define TEW_632BRP_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition tew_632brp_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "config",
++ .offset = 0x020000,
++ .size = 0x010000,
++ } , {
++ .name = "kernel",
++ .offset = 0x030000,
++ .size = 0x0c0000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x0f0000,
++ .size = 0x300000,
++ } , {
++ .name = "art",
++ .offset = 0x3f0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "firmware",
++ .offset = 0x030000,
++ .size = 0x3c0000,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data tew_632brp_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = tew_632brp_partitions,
++ .nr_parts = ARRAY_SIZE(tew_632brp_partitions),
++#endif
++};
++
++static struct spi_board_info tew_632brp_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &tew_632brp_flash_data,
++ }
++};
++
++static struct gpio_led tew_632brp_leds_gpio[] __initdata = {
++ {
++ .name = "tew-632brp:green:status",
++ .gpio = TEW_632BRP_GPIO_LED_STATUS,
++ .active_low = 1,
++ }, {
++ .name = "tew-632brp:blue:wps",
++ .gpio = TEW_632BRP_GPIO_LED_WPS,
++ .active_low = 1,
++ }, {
++ .name = "tew-632brp:green:wlan",
++ .gpio = TEW_632BRP_GPIO_LED_WLAN,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button tew_632brp_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = TEW_632BRP_GPIO_BTN_RESET,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = TEW_632BRP_GPIO_BTN_WPS,
++ }
++};
++
++static void __init tew_632brp_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_spi(NULL, tew_632brp_spi_info,
++ ARRAY_SIZE(tew_632brp_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tew_632brp_leds_gpio),
++ tew_632brp_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, TEW_632BRP_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(tew_632brp_gpio_buttons),
++ tew_632brp_gpio_buttons);
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_TEW_632BRP, "TRENDnet TEW-632BRP", tew_632brp_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tl-wr941nd.c linux-2.6.29.1/arch/mips/ar71xx/mach-tl-wr941nd.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tl-wr941nd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-tl-wr941nd.c 2009-04-13 14:27:34.591071588 +0200
+@@ -0,0 +1,144 @@
++/*
++ * TP-LINK TL-WR941ND board support
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define TL_WR941ND_GPIO_LED_SYSTEM 2
++#define TL_WR941ND_GPIO_LED_QSS 5
++
++#define TL_WR941ND_GPIO_BTN_RESET 3
++#define TL_WR941ND_GPIO_BTN_QSS 7
++
++#define TL_WR941ND_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition tl_wr941nd_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "kernel",
++ .offset = 0x020000,
++ .size = 0x120000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x140000,
++ .size = 0x2b0000,
++ } , {
++ .name = "art",
++ .offset = 0x3f0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "firmware",
++ .offset = 0x020000,
++ .size = 0x3d0000,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data tl_wr941nd_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = tl_wr941nd_partitions,
++ .nr_parts = ARRAY_SIZE(tl_wr941nd_partitions),
++#endif
++};
++
++static struct spi_board_info tl_wr941nd_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &tl_wr941nd_flash_data,
++ }
++};
++
++static struct gpio_led tl_wr941nd_leds_gpio[] __initdata = {
++ {
++ .name = "tl-wr941nd:green:system",
++ .gpio = TL_WR941ND_GPIO_LED_SYSTEM,
++ .active_low = 1,
++ }, {
++ .name = "tl-wr941nd:red:qss",
++ .gpio = TL_WR941ND_GPIO_LED_QSS,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button tl_wr941nd_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = TL_WR941ND_GPIO_BTN_RESET,
++ .active_low = 1,
++ }, {
++ .desc = "qss",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = TL_WR941ND_GPIO_BTN_QSS,
++ .active_low = 1,
++ }
++};
++
++static struct dsa_platform_data tl_wr941nd_dsa_data = {
++ .port_names[0] = "wan",
++ .port_names[1] = "lan1",
++ .port_names[2] = "lan2",
++ .port_names[3] = "lan3",
++ .port_names[4] = "lan4",
++ .port_names[5] = "cpu",
++};
++
++static void __init tl_wr941nd_setup(void)
++{
++ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
++
++ ar71xx_set_mac_base(mac);
++
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0x0;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_dsa(0, &tl_wr941nd_dsa_data);
++
++ ar71xx_add_device_spi(NULL, tl_wr941nd_spi_info,
++ ARRAY_SIZE(tl_wr941nd_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_leds_gpio),
++ tl_wr941nd_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, TL_WR941ND_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(tl_wr941nd_gpio_buttons),
++ tl_wr941nd_gpio_buttons);
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_TL_WR941ND, "TP-LINK TL-WR941ND", tl_wr941nd_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ubnt.c linux-2.6.29.1/arch/mips/ar71xx/mach-ubnt.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ubnt.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-ubnt.c 2009-04-13 14:27:34.591071588 +0200
+@@ -0,0 +1,188 @@
++/*
++ * Ubiquiti RouterStation support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ * Copyright (C) 2008 Ubiquiti <support@ubnt.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define UBNT_RS_GPIO_LED_RF 2
++#define UBNT_RS_GPIO_SW4 8
++
++#define UBNT_LS_SR71_GPIO_LED_D25 0
++#define UBNT_LS_SR71_GPIO_LED_D26 1
++#define UBNT_LS_SR71_GPIO_LED_D24 2
++#define UBNT_LS_SR71_GPIO_LED_D23 4
++#define UBNT_LS_SR71_GPIO_LED_D22 5
++#define UBNT_LS_SR71_GPIO_LED_D27 6
++#define UBNT_LS_SR71_GPIO_LED_D28 7
++
++#define UBNT_BUTTONS_POLL_INTERVAL 20
++
++static struct spi_board_info ubnt_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct ar71xx_pci_irq ubnt_pci_irqs[] __initdata = {
++ {
++ .slot = 0,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 2,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV2,
++ }
++};
++
++static struct gpio_led ubnt_rs_leds_gpio[] __initdata = {
++ {
++ .name = "ubnt:green:rf",
++ .gpio = UBNT_RS_GPIO_LED_RF,
++ .active_low = 0,
++ }
++};
++
++static struct gpio_led ubnt_ls_sr71_leds_gpio[] __initdata = {
++ {
++ .name = "ubnt:green:d22",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D22,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d23",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D23,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d24",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D24,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:red:d25",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D25,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:red:d26",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D26,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d27",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D27,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d28",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D28,
++ .active_low = 0,
++ }
++};
++
++static struct gpio_button ubnt_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = UBNT_RS_GPIO_SW4,
++ .active_low = 1,
++ }
++};
++
++static void __init ubnt_generic_setup(void)
++{
++ ar71xx_add_device_spi(NULL, ubnt_spi_info,
++ ARRAY_SIZE(ubnt_spi_info));
++
++ ar71xx_add_device_gpio_buttons(-1, UBNT_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(ubnt_gpio_buttons),
++ ubnt_gpio_buttons);
++
++ ar71xx_pci_init(ARRAY_SIZE(ubnt_pci_irqs), ubnt_pci_irqs);
++}
++
++#define UBNT_RS_WAN_PHYMASK (1 << 20)
++#define UBNT_RS_LAN_PHYMASK ((1 << 16) | (1 << 17) | (1 << 18) | (1 << 19))
++
++static void __init ubnt_rs_setup(void)
++{
++ ubnt_generic_setup();
++
++ ar71xx_add_device_mdio(~(UBNT_RS_WAN_PHYMASK | UBNT_RS_LAN_PHYMASK));
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = UBNT_RS_WAN_PHYMASK;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = UBNT_RS_LAN_PHYMASK;
++
++ ar71xx_eth1_data.speed = SPEED_100;
++ ar71xx_eth1_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_usb();
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_rs_leds_gpio),
++ ubnt_rs_leds_gpio);
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_RS, "Ubiquiti RouterStation", ubnt_rs_setup);
++
++static void __init ubnt_rspro_setup(void)
++{
++ ubnt_generic_setup();
++
++ ar71xx_add_device_usb();
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_RSPRO, "Ubiquiti RouterStation Pro",
++ ubnt_rspro_setup);
++
++static void __init ubnt_lsx_setup(void)
++{
++ ubnt_generic_setup();
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_LSX, "Ubiquiti LSX", ubnt_lsx_setup);
++
++#define UBNT_LSSR71_PHY_MASK (1 << 1)
++
++static void __init ubnt_lssr71_setup(void)
++{
++ ubnt_generic_setup();
++
++ ar71xx_add_device_mdio(~UBNT_LSSR71_PHY_MASK);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = UBNT_LSSR71_PHY_MASK;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_ls_sr71_leds_gpio),
++ ubnt_ls_sr71_leds_gpio);
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_LSSR71, "Ubiquiti LS-SR71", ubnt_lssr71_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wnr2000.c linux-2.6.29.1/arch/mips/ar71xx/mach-wnr2000.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wnr2000.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-wnr2000.c 2009-04-13 14:27:34.595070701 +0200
+@@ -0,0 +1,158 @@
++/*
++ * NETGEAR WNR2000 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ * Copyright (C) 2008-2009 Andy Boyett <agb@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define WNR2000_GPIO_LED_PWR_GREEN 14
++#define WNR2000_GPIO_LED_PWR_AMBER 7
++#define WNR2000_GPIO_LED_WPS 4
++#define WNR2000_GPIO_LED_WLAN 6
++#define WNR2000_GPIO_BTN_RESET 21
++#define WNR2000_GPIO_BTN_WPS 8
++
++#define WNR2000_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition wnr2000_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x050000,
++ .size = 0x240000,
++ } , {
++ .name = "user-config",
++ .offset = 0x290000,
++ .size = 0x010000,
++ } , {
++ .name = "uImage",
++ .offset = 0x2a0000,
++ .size = 0x120000,
++ } , {
++ .name = "language_table",
++ .offset = 0x3c0000,
++ .size = 0x020000,
++ } , {
++ .name = "rootfs_checksum",
++ .offset = 0x3e0000,
++ .size = 0x010000,
++ } , {
++ .name = "art",
++ .offset = 0x3f0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data wnr2000_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = wnr2000_partitions,
++ .nr_parts = ARRAY_SIZE(wnr2000_partitions),
++#endif
++};
++
++static struct spi_board_info wnr2000_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &wnr2000_flash_data,
++ }
++};
++
++static struct gpio_led wnr2000_leds_gpio[] __initdata = {
++ {
++ .name = "wnr2000:green:power",
++ .gpio = WNR2000_GPIO_LED_PWR_GREEN,
++ .active_low = 1,
++ }, {
++ .name = "wnr2000:amber:power",
++ .gpio = WNR2000_GPIO_LED_PWR_AMBER,
++ .active_low = 1,
++ }, {
++ .name = "wnr2000:green:wps",
++ .gpio = WNR2000_GPIO_LED_WPS,
++ .active_low = 1,
++ }, {
++ .name = "wnr2000:blue:wlan",
++ .gpio = WNR2000_GPIO_LED_WLAN,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button wnr2000_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = WNR2000_GPIO_BTN_RESET,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = WNR2000_GPIO_BTN_WPS,
++ }
++};
++
++static void __init wnr2000_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++ ar71xx_eth0_data.has_ar8216 = 1;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_spi(NULL, wnr2000_spi_info,
++ ARRAY_SIZE(wnr2000_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wnr2000_leds_gpio),
++ wnr2000_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, WNR2000_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(wnr2000_gpio_buttons),
++ wnr2000_gpio_buttons);
++
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_WNR2000, "NETGEAR WNR2000", wnr2000_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wp543.c linux-2.6.29.1/arch/mips/ar71xx/mach-wp543.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wp543.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-wp543.c 2009-04-13 14:27:34.595070701 +0200
+@@ -0,0 +1,118 @@
++/*
++ * Compex WP543 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define WP543_GPIO_SW6 2
++#define WP543_GPIO_LED_1 3
++#define WP543_GPIO_LED_2 4
++#define WP543_GPIO_LED_WLAN 5
++#define WP543_GPIO_LED_CONN 6
++#define WP543_GPIO_LED_DIAG 7
++#define WP543_GPIO_SW4 8
++
++#define WP543_BUTTONS_POLL_INTERVAL 20
++
++static struct spi_board_info wp543_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct ar71xx_pci_irq wp543_pci_irqs[] __initdata = {
++ {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 2,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }
++};
++
++static struct gpio_led wp543_leds_gpio[] __initdata = {
++ {
++ .name = "wp543:green:led1",
++ .gpio = WP543_GPIO_LED_1,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:led2",
++ .gpio = WP543_GPIO_LED_2,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:wlan",
++ .gpio = WP543_GPIO_LED_WLAN,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:conn",
++ .gpio = WP543_GPIO_LED_CONN,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:diag",
++ .gpio = WP543_GPIO_LED_DIAG,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button wp543_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw6",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = WP543_GPIO_SW6,
++ }, {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = WP543_GPIO_SW4,
++ }
++};
++
++static void __init wp543_setup(void)
++{
++ ar71xx_add_device_spi(NULL, wp543_spi_info, ARRAY_SIZE(wp543_spi_info));
++
++ ar71xx_add_device_mdio(0xfffffff7);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x00000008;
++ ar71xx_add_device_eth(0);
++
++ ar71xx_add_device_usb();
++
++ ar71xx_pci_init(ARRAY_SIZE(wp543_pci_irqs), wp543_pci_irqs);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wp543_leds_gpio),
++ wp543_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, WP543_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(wp543_gpio_buttons),
++ wp543_gpio_buttons);
++}
++
++MIPS_MACHINE(AR71XX_MACH_WP543, "Compex WP543", wp543_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/prom.c linux-2.6.29.1/arch/mips/ar71xx/prom.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/prom.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/prom.c 2009-04-13 14:27:34.595070701 +0200
+@@ -0,0 +1,207 @@
++/*
++ * Atheros AR71xx SoC specific prom routines
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/serial_reg.h>
++
++#include <asm/bootinfo.h>
++#include <asm/addrspace.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++struct board_rec {
++ char *name;
++ unsigned long mach_type;
++};
++
++static int ar71xx_prom_argc __initdata;
++static char **ar71xx_prom_argv __initdata;
++static char **ar71xx_prom_envp __initdata;
++
++static struct board_rec boards[] __initdata = {
++ {
++ .name = "411",
++ .mach_type = AR71XX_MACH_RB_411,
++ }, {
++ .name = "433",
++ .mach_type = AR71XX_MACH_RB_433,
++ }, {
++ .name = "450",
++ .mach_type = AR71XX_MACH_RB_450,
++ }, {
++ .name = "493",
++ .mach_type = AR71XX_MACH_RB_493,
++ }, {
++ .name = "AP81",
++ .mach_type = AR71XX_MACH_AP81,
++ }, {
++ .name = "AP83",
++ .mach_type = AR71XX_MACH_AP83,
++ }, {
++ .name = "AW-NR580",
++ .mach_type = AR71XX_MACH_AW_NR580,
++ }, {
++ .name = "TEW-632BRP",
++ .mach_type = AR71XX_MACH_TEW_632BRP,
++ }, {
++ .name = "TL-WR941ND",
++ .mach_type = AR71XX_MACH_TL_WR941ND,
++ }, {
++ .name = "UBNT-RS",
++ .mach_type = AR71XX_MACH_UBNT_RS,
++ }, {
++ .name = "UBNT-RSPRO",
++ .mach_type = AR71XX_MACH_UBNT_RSPRO,
++ }, {
++ .name = "Ubiquiti AR71xx-based board",
++ .mach_type = AR71XX_MACH_UBNT_RS,
++ }, {
++ .name = "UBNT-LS-SR71",
++ .mach_type = AR71XX_MACH_UBNT_LSSR71,
++ }, {
++ .name = "UBNT-LSX",
++ .mach_type = AR71XX_MACH_UBNT_LSX,
++ }, {
++ .name = "WNR2000",
++ .mach_type = AR71XX_MACH_WNR2000,
++ }, {
++ .name = "PB42",
++ .mach_type = AR71XX_MACH_PB42,
++ }, {
++ .name = "MZK-W300NH",
++ .mach_type = AR71XX_MACH_MZK_W300NH,
++ }, {
++ .name = "MZK-W04NU",
++ .mach_type = AR71XX_MACH_MZK_W04NU,
++ }
++};
++
++static inline int is_valid_ram_addr(void *addr)
++{
++ if (((u32) addr > KSEG0) &&
++ ((u32) addr < (KSEG0 + AR71XX_MEM_SIZE_MAX)))
++ return 1;
++
++ if (((u32) addr > KSEG1) &&
++ ((u32) addr < (KSEG1 + AR71XX_MEM_SIZE_MAX)))
++ return 1;
++
++ return 0;
++}
++
++static __init char *ar71xx_prom_getargv(const char *name)
++{
++ int len = strlen(name);
++ int i;
++
++ if (!is_valid_ram_addr(ar71xx_prom_argv))
++ return NULL;
++
++ for (i = 0; i < ar71xx_prom_argc; i++) {
++ char *argv = ar71xx_prom_argv[i];
++
++ if (!is_valid_ram_addr(argv))
++ continue;
++
++ if (strncmp(name, argv, len) == 0 && (argv)[len] == '=')
++ return argv + len + 1;
++ }
++
++ return NULL;
++}
++
++static __init char *ar71xx_prom_getenv(const char *envname)
++{
++ int len = strlen(envname);
++ char **env;
++
++ if (!is_valid_ram_addr(ar71xx_prom_envp))
++ return NULL;
++
++ for (env = ar71xx_prom_envp; is_valid_ram_addr(*env); env++) {
++ if (strncmp(envname, *env, len) == 0 && (*env)[len] == '=')
++ return *env + len + 1;
++
++ /* RedBoot env comes in pointer pairs - key, value */
++ if (strncmp(envname, *env, len) == 0 && (*env)[len] == 0)
++ if (is_valid_ram_addr(*(++env)))
++ return *env;
++ }
++
++ return NULL;
++}
++
++static __init unsigned long find_board_byname(char *name)
++{
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(boards); i++)
++ if (strcmp(name, boards[i].name) == 0)
++ return boards[i].mach_type;
++
++ return AR71XX_MACH_GENERIC;
++}
++
++
++static void ar71xx_prom_init_generic(void)
++{
++ char *p;
++
++ ar71xx_prom_argc = fw_arg0;
++ ar71xx_prom_argv = (char **)fw_arg1;
++ ar71xx_prom_envp = (char **)fw_arg2;
++
++ p = ar71xx_prom_getargv("board");
++ if (!p)
++ p = ar71xx_prom_getenv("board");
++ if (p)
++ ar71xx_mach_type = find_board_byname(p);
++
++ p = ar71xx_prom_getenv("ethaddr");
++ if (!p)
++ p = ar71xx_prom_getargv("kmac");
++ if (p)
++ ar71xx_parse_mac_addr(p);
++}
++
++void __init prom_init(void)
++{
++ printk(KERN_DEBUG "prom: fw_arg0=%08x, fw_arg1=%08x, "
++ "fw_arg2=%08x, fw_arg3=%08x\n",
++ (unsigned int)fw_arg0, (unsigned int)fw_arg1,
++ (unsigned int)fw_arg2, (unsigned int)fw_arg3);
++
++ ar71xx_mach_type = AR71XX_MACH_GENERIC;
++
++ ar71xx_prom_init_generic();
++}
++
++void __init prom_free_prom_memory(void)
++{
++ /* We do not have to prom memory to free */
++}
++
++#define UART_READ(r) \
++ __raw_readl((void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE) + 4 * (r)))
++
++#define UART_WRITE(r, v) \
++ __raw_writel((v), (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE) + 4*(r)))
++
++void prom_putchar(unsigned char ch)
++{
++ while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
++ UART_WRITE(UART_TX, ch);
++ while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/setup.c linux-2.6.29.1/arch/mips/ar71xx/setup.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/setup.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/setup.c 2009-04-13 14:27:34.599071210 +0200
+@@ -0,0 +1,291 @@
++/*
++ * Atheros AR71xx SoC specific setup
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/types.h>
++#include <linux/pci.h>
++#include <linux/serial_8250.h>
++#include <linux/bootmem.h>
++
++#include <asm/bootinfo.h>
++#include <asm/traps.h>
++#include <asm/time.h> /* for mips_hpt_frequency */
++#include <asm/reboot.h> /* for _machine_{restart,halt} */
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define AR71XX_SYS_TYPE_LEN 64
++#define AR71XX_BASE_FREQ 40000000
++#define AR91XX_BASE_FREQ 5000000
++
++unsigned long ar71xx_mach_type;
++
++u32 ar71xx_cpu_freq;
++EXPORT_SYMBOL_GPL(ar71xx_cpu_freq);
++
++u32 ar71xx_ahb_freq;
++EXPORT_SYMBOL_GPL(ar71xx_ahb_freq);
++
++u32 ar71xx_ddr_freq;
++EXPORT_SYMBOL_GPL(ar71xx_ddr_freq);
++
++enum ar71xx_soc_type ar71xx_soc;
++EXPORT_SYMBOL_GPL(ar71xx_soc);
++
++int (*ar71xx_pci_bios_init)(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map) __initdata;
++
++int (*ar71xx_pci_be_handler)(int is_fixup);
++
++static char ar71xx_sys_type[AR71XX_SYS_TYPE_LEN];
++
++static void ar71xx_restart(char *command)
++{
++ ar71xx_device_stop(RESET_MODULE_FULL_CHIP);
++ for (;;)
++ if (cpu_wait)
++ cpu_wait();
++}
++
++static void ar71xx_halt(void)
++{
++ while (1)
++ cpu_wait();
++}
++
++static int ar71xx_be_handler(struct pt_regs *regs, int is_fixup)
++{
++ int err = 0;
++
++ if (ar71xx_pci_be_handler)
++ err = ar71xx_pci_be_handler(is_fixup);
++
++ return (is_fixup && !err) ? MIPS_BE_FIXUP : MIPS_BE_FATAL;
++}
++
++int __init ar71xx_pci_init(unsigned nr_irqs, struct ar71xx_pci_irq *map)
++{
++ if (!ar71xx_pci_bios_init)
++ return 0;
++
++ return ar71xx_pci_bios_init(nr_irqs, map);
++}
++
++static void __init ar71xx_detect_mem_size(void)
++{
++ unsigned long size;
++
++ for (size = AR71XX_MEM_SIZE_MIN; size < AR71XX_MEM_SIZE_MAX;
++ size <<= 1 ) {
++ if (!memcmp(ar71xx_detect_mem_size,
++ ar71xx_detect_mem_size + size, 1024))
++ break;
++ }
++
++ add_memory_region(0, size, BOOT_MEM_RAM);
++}
++
++static void __init ar71xx_detect_sys_type(void)
++{
++ char *chip;
++ u32 id;
++ u32 rev;
++
++ id = ar71xx_reset_rr(AR71XX_RESET_REG_REV_ID) & REV_ID_MASK;
++ rev = (id >> REV_ID_REVISION_SHIFT) & REV_ID_REVISION_MASK;
++
++ switch (id & REV_ID_CHIP_MASK) {
++ case REV_ID_CHIP_AR7130:
++ ar71xx_soc = AR71XX_SOC_AR7130;
++ chip = "7130";
++ break;
++
++ case REV_ID_CHIP_AR7141:
++ ar71xx_soc = AR71XX_SOC_AR7141;
++ chip = "7141";
++ break;
++
++ case REV_ID_CHIP_AR7161:
++ ar71xx_soc = AR71XX_SOC_AR7161;
++ chip = "7161";
++ break;
++
++ case REV_ID_CHIP_AR9130:
++ ar71xx_soc = AR71XX_SOC_AR9130;
++ chip = "9130";
++ break;
++
++ case REV_ID_CHIP_AR9132:
++ ar71xx_soc = AR71XX_SOC_AR9132;
++ chip = "9132";
++ break;
++
++ default:
++ panic("ar71xx: unknown chip id:0x%02x\n", id);
++ }
++
++ sprintf(ar71xx_sys_type, "Atheros AR%s rev %u (id:0x%02x)",
++ chip, rev, id);
++}
++
++static void __init ar91xx_detect_sys_frequency(void)
++{
++ u32 pll;
++ u32 freq;
++ u32 div;
++
++ pll = ar71xx_pll_rr(AR91XX_PLL_REG_CPU_CONFIG);
++
++ div = ((pll >> AR91XX_PLL_DIV_SHIFT) & AR91XX_PLL_DIV_MASK);
++ freq = div * AR91XX_BASE_FREQ;
++
++ ar71xx_cpu_freq = freq;
++
++ div = ((pll >> AR91XX_DDR_DIV_SHIFT) & AR91XX_DDR_DIV_MASK) + 1;
++ ar71xx_ddr_freq = freq / div;
++
++ div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2;
++ ar71xx_ahb_freq = ar71xx_cpu_freq / div;
++}
++
++static void __init ar71xx_detect_sys_frequency(void)
++{
++ u32 pll;
++ u32 freq;
++ u32 div;
++
++ pll = ar71xx_pll_rr(AR71XX_PLL_REG_CPU_CONFIG);
++
++ div = ((pll >> AR71XX_PLL_DIV_SHIFT) & AR71XX_PLL_DIV_MASK) + 1;
++ freq = div * AR71XX_BASE_FREQ;
++
++ div = ((pll >> AR71XX_CPU_DIV_SHIFT) & AR71XX_CPU_DIV_MASK) + 1;
++ ar71xx_cpu_freq = freq / div;
++
++ div = ((pll >> AR71XX_DDR_DIV_SHIFT) & AR71XX_DDR_DIV_MASK) + 1;
++ ar71xx_ddr_freq = freq / div;
++
++ div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2;
++ ar71xx_ahb_freq = ar71xx_cpu_freq / div;
++}
++
++static void __init detect_sys_frequency(void)
++{
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ ar71xx_detect_sys_frequency();
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar91xx_detect_sys_frequency();
++ break;
++
++ default:
++ BUG();
++ }
++}
++
++#ifdef CONFIG_AR71XX_EARLY_SERIAL
++static void __init ar71xx_early_serial_setup(void)
++{
++ struct uart_port p;
++
++ memset(&p, 0, sizeof(p));
++
++ p.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP;
++ p.iotype = UPIO_MEM32;
++ p.uartclk = ar71xx_ahb_freq;
++ p.irq = AR71XX_MISC_IRQ_UART;
++ p.regshift = 2;
++ p.mapbase = AR71XX_UART_BASE;
++
++ early_serial_setup(&p);
++}
++#else
++static inline void ar71xx_early_serial_setup(void) {};
++#endif /* CONFIG_AR71XX_EARLY_SERIAL */
++
++const char *get_system_type(void)
++{
++ return ar71xx_sys_type;
++}
++
++unsigned int __cpuinit get_c0_compare_irq(void)
++{
++ return CP0_LEGACY_COMPARE_IRQ;
++}
++
++void __init plat_mem_setup(void)
++{
++ set_io_port_base(KSEG1);
++
++ ar71xx_ddr_base = ioremap_nocache(AR71XX_DDR_CTRL_BASE,
++ AR71XX_DDR_CTRL_SIZE);
++
++ ar71xx_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
++ AR71XX_PLL_SIZE);
++
++ ar71xx_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
++ AR71XX_RESET_SIZE);
++
++ ar71xx_gpio_base = ioremap_nocache(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE);
++
++ ar71xx_usb_ctrl_base = ioremap_nocache(AR71XX_USB_CTRL_BASE,
++ AR71XX_USB_CTRL_SIZE);
++
++ ar71xx_detect_mem_size();
++ ar71xx_detect_sys_type();
++ detect_sys_frequency();
++
++ printk(KERN_INFO
++ "%s, CPU:%u.%03u MHz, AHB:%u.%03u MHz, DDR:%u.%03u MHz\n",
++ ar71xx_sys_type,
++ ar71xx_cpu_freq / 1000000, (ar71xx_cpu_freq / 1000) % 1000,
++ ar71xx_ahb_freq / 1000000, (ar71xx_ahb_freq / 1000) % 1000,
++ ar71xx_ddr_freq / 1000000, (ar71xx_ddr_freq / 1000) % 1000);
++
++ _machine_restart = ar71xx_restart;
++ _machine_halt = ar71xx_halt;
++ pm_power_off = ar71xx_halt;
++
++ board_be_handler = ar71xx_be_handler;
++
++ ar71xx_early_serial_setup();
++}
++
++void __init plat_time_init(void)
++{
++ mips_hpt_frequency = ar71xx_cpu_freq / 2;
++}
++
++static int __init ar71xx_machine_setup(void)
++{
++ ar71xx_gpio_init();
++
++ ar71xx_add_device_uart();
++ ar71xx_add_device_wdt();
++
++ mips_machine_setup(ar71xx_mach_type);
++ return 0;
++}
++
++arch_initcall(ar71xx_machine_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/fw/myloader/myloader.h linux-2.6.29.1/arch/mips/include/asm/fw/myloader/myloader.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/fw/myloader/myloader.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/fw/myloader/myloader.h 2009-04-13 14:27:34.599071210 +0200
+@@ -0,0 +1,34 @@
++/*
++ * Compex's MyLoader specific definitions
++ *
++ * Copyright (C) 2006-2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#ifndef _ASM_MIPS_FW_MYLOADER_H
++#define _ASM_MIPS_FW_MYLOADER_H
++
++#include <linux/myloader.h>
++
++struct myloader_info {
++ uint32_t vid;
++ uint32_t did;
++ uint32_t svid;
++ uint32_t sdid;
++ uint8_t macs[MYLO_ETHADDR_COUNT][6];
++};
++
++#ifdef CONFIG_MYLOADER
++extern struct myloader_info *myloader_get_info(void) __init;
++#else
++static inline struct myloader_info *myloader_get_info(void)
++{
++ return NULL;
++}
++#endif /* CONFIG_MYLOADER */
++
++#endif /* _ASM_MIPS_FW_MYLOADER_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/ar71xx.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/ar71xx.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/ar71xx.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/ar71xx.h 2009-04-13 14:27:34.623072313 +0200
+@@ -0,0 +1,438 @@
++/*
++ * Atheros AR71xx SoC specific definitions
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_H
++#define __ASM_MACH_AR71XX_H
++
++#include <linux/types.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/bitops.h>
++
++#ifndef __ASSEMBLER__
++
++#define AR71XX_PCI_MEM_BASE 0x10000000
++#define AR71XX_PCI_MEM_SIZE 0x08000000
++#define AR71XX_APB_BASE 0x18000000
++#define AR71XX_GE0_BASE 0x19000000
++#define AR71XX_GE0_SIZE 0x01000000
++#define AR71XX_GE1_BASE 0x1a000000
++#define AR71XX_GE1_SIZE 0x01000000
++#define AR71XX_EHCI_BASE 0x1b000000
++#define AR71XX_EHCI_SIZE 0x01000000
++#define AR71XX_OHCI_BASE 0x1c000000
++#define AR71XX_OHCI_SIZE 0x01000000
++#define AR71XX_SPI_BASE 0x1f000000
++#define AR71XX_SPI_SIZE 0x01000000
++
++#define AR71XX_DDR_CTRL_BASE (AR71XX_APB_BASE + 0x00000000)
++#define AR71XX_DDR_CTRL_SIZE 0x10000
++#define AR71XX_CPU_BASE (AR71XX_APB_BASE + 0x00010000)
++#define AR71XX_UART_BASE (AR71XX_APB_BASE + 0x00020000)
++#define AR71XX_UART_SIZE 0x10000
++#define AR71XX_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000)
++#define AR71XX_USB_CTRL_SIZE 0x10000
++#define AR71XX_GPIO_BASE (AR71XX_APB_BASE + 0x00040000)
++#define AR71XX_GPIO_SIZE 0x10000
++#define AR71XX_PLL_BASE (AR71XX_APB_BASE + 0x00050000)
++#define AR71XX_PLL_SIZE 0x10000
++#define AR71XX_RESET_BASE (AR71XX_APB_BASE + 0x00060000)
++#define AR71XX_RESET_SIZE 0x10000
++#define AR71XX_MII_BASE (AR71XX_APB_BASE + 0x00070000)
++#define AR71XX_MII_SIZE 0x10000
++#define AR71XX_SLIC_BASE (AR71XX_APB_BASE + 0x00090000)
++#define AR71XX_SLIC_SIZE 0x10000
++#define AR71XX_DMA_BASE (AR71XX_APB_BASE + 0x000A0000)
++#define AR71XX_DMA_SIZE 0x10000
++#define AR71XX_STEREO_BASE (AR71XX_APB_BASE + 0x000B0000)
++#define AR71XX_STEREO_SIZE 0x10000
++#define AR91XX_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000)
++#define AR91XX_WMAC_SIZE 0x30000
++
++#define AR71XX_MEM_SIZE_MIN 0x0200000
++#define AR71XX_MEM_SIZE_MAX 0x8000000
++
++#define AR71XX_CPU_IRQ_BASE 0
++#define AR71XX_MISC_IRQ_BASE 8
++#define AR71XX_MISC_IRQ_COUNT 8
++#define AR71XX_GPIO_IRQ_BASE 16
++#define AR71XX_GPIO_IRQ_COUNT 16
++#define AR71XX_PCI_IRQ_BASE 32
++#define AR71XX_PCI_IRQ_COUNT 4
++
++#define AR71XX_CPU_IRQ_PCI (AR71XX_CPU_IRQ_BASE + 2)
++#define AR71XX_CPU_IRQ_WMAC (AR71XX_CPU_IRQ_BASE + 2)
++#define AR71XX_CPU_IRQ_USB (AR71XX_CPU_IRQ_BASE + 3)
++#define AR71XX_CPU_IRQ_GE0 (AR71XX_CPU_IRQ_BASE + 4)
++#define AR71XX_CPU_IRQ_GE1 (AR71XX_CPU_IRQ_BASE + 5)
++#define AR71XX_CPU_IRQ_MISC (AR71XX_CPU_IRQ_BASE + 6)
++#define AR71XX_CPU_IRQ_TIMER (AR71XX_CPU_IRQ_BASE + 7)
++
++#define AR71XX_MISC_IRQ_TIMER (AR71XX_MISC_IRQ_BASE + 0)
++#define AR71XX_MISC_IRQ_ERROR (AR71XX_MISC_IRQ_BASE + 1)
++#define AR71XX_MISC_IRQ_GPIO (AR71XX_MISC_IRQ_BASE + 2)
++#define AR71XX_MISC_IRQ_UART (AR71XX_MISC_IRQ_BASE + 3)
++#define AR71XX_MISC_IRQ_WDOG (AR71XX_MISC_IRQ_BASE + 4)
++#define AR71XX_MISC_IRQ_PERFC (AR71XX_MISC_IRQ_BASE + 5)
++#define AR71XX_MISC_IRQ_OHCI (AR71XX_MISC_IRQ_BASE + 6)
++#define AR71XX_MISC_IRQ_DMA (AR71XX_MISC_IRQ_BASE + 7)
++
++#define AR71XX_GPIO_IRQ(_x) (AR71XX_GPIO_IRQ_BASE + (_x))
++
++#define AR71XX_PCI_IRQ_DEV0 (AR71XX_PCI_IRQ_BASE + 0)
++#define AR71XX_PCI_IRQ_DEV1 (AR71XX_PCI_IRQ_BASE + 1)
++#define AR71XX_PCI_IRQ_DEV2 (AR71XX_PCI_IRQ_BASE + 2)
++#define AR71XX_PCI_IRQ_CORE (AR71XX_PCI_IRQ_BASE + 3)
++
++extern u32 ar71xx_ahb_freq;
++extern u32 ar71xx_cpu_freq;
++extern u32 ar71xx_ddr_freq;
++
++enum ar71xx_soc_type {
++ AR71XX_SOC_UNKNOWN,
++ AR71XX_SOC_AR7130,
++ AR71XX_SOC_AR7141,
++ AR71XX_SOC_AR7161,
++ AR71XX_SOC_AR9130,
++ AR71XX_SOC_AR9132
++};
++
++extern enum ar71xx_soc_type ar71xx_soc;
++
++extern unsigned long ar71xx_mach_type;
++
++#define AR71XX_MACH_GENERIC 0
++#define AR71XX_MACH_WP543 1 /* Compex WP543 */
++#define AR71XX_MACH_RB_411 2 /* MikroTik RouterBOARD 411/411A/411AH */
++#define AR71XX_MACH_RB_433 3 /* MikroTik RouterBOARD 433/433AH */
++#define AR71XX_MACH_RB_450 4 /* MikroTik RouterBOARD 450 */
++#define AR71XX_MACH_RB_493 5 /* Mikrotik RouterBOARD 493/493AH */
++#define AR71XX_MACH_AW_NR580 6 /* AzureWave AW-NR580 */
++#define AR71XX_MACH_AP83 7 /* Atheros AP83 */
++#define AR71XX_MACH_TEW_632BRP 8 /* TRENDnet TEW-632BRP */
++#define AR71XX_MACH_UBNT_RS 9 /* Ubiquiti RouterStation */
++#define AR71XX_MACH_UBNT_LSX 10 /* Ubiquiti LSX */
++#define AR71XX_MACH_WNR2000 11 /* NETGEAR WNR2000 */
++#define AR71XX_MACH_PB42 12 /* Atheros PB42 */
++#define AR71XX_MACH_MZK_W300NH 13 /* Planex MZK-W300NH */
++#define AR71XX_MACH_MZK_W04NU 14 /* Planex MZK-W04NU */
++#define AR71XX_MACH_UBNT_LSSR71 15 /* Ubiquiti LS-SR71 */
++#define AR71XX_MACH_TL_WR941ND 16 /* TP-LINK TL-WR941ND */
++#define AR71XX_MACH_UBNT_RSPRO 17 /* Ubiquiti RouterStation Pro */
++#define AR71XX_MACH_AP81 18 /* Atheros AP81 */
++
++/*
++ * PLL block
++ */
++#define AR71XX_PLL_REG_CPU_CONFIG 0x00
++#define AR71XX_PLL_REG_SEC_CONFIG 0x04
++#define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10
++#define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14
++
++#define AR71XX_PLL_DIV_SHIFT 3
++#define AR71XX_PLL_DIV_MASK 0x1f
++#define AR71XX_CPU_DIV_SHIFT 16
++#define AR71XX_CPU_DIV_MASK 0x3
++#define AR71XX_DDR_DIV_SHIFT 18
++#define AR71XX_DDR_DIV_MASK 0x3
++#define AR71XX_AHB_DIV_SHIFT 20
++#define AR71XX_AHB_DIV_MASK 0x7
++
++#define AR71XX_ETH0_PLL_SHIFT 17
++#define AR71XX_ETH1_PLL_SHIFT 19
++
++#define AR91XX_PLL_REG_CPU_CONFIG 0x00
++#define AR91XX_PLL_REG_ETH_CONFIG 0x04
++#define AR91XX_PLL_REG_ETH0_INT_CLOCK 0x14
++#define AR91XX_PLL_REG_ETH1_INT_CLOCK 0x18
++
++#define AR91XX_PLL_DIV_SHIFT 0
++#define AR91XX_PLL_DIV_MASK 0x3ff
++#define AR91XX_DDR_DIV_SHIFT 22
++#define AR91XX_DDR_DIV_MASK 0x3
++#define AR91XX_AHB_DIV_SHIFT 19
++#define AR91XX_AHB_DIV_MASK 0x1
++
++#define AR91XX_ETH0_PLL_SHIFT 20
++#define AR91XX_ETH1_PLL_SHIFT 22
++
++extern void __iomem *ar71xx_pll_base;
++
++static inline void ar71xx_pll_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_pll_base + reg);
++}
++
++static inline u32 ar71xx_pll_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_pll_base + reg);
++}
++
++/*
++ * USB_CONFIG block
++ */
++#define USB_CTRL_REG_FLADJ 0x00
++#define USB_CTRL_REG_CONFIG 0x04
++
++extern void __iomem *ar71xx_usb_ctrl_base;
++
++static inline void ar71xx_usb_ctrl_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_usb_ctrl_base + reg);
++}
++
++static inline u32 ar71xx_usb_ctrl_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_usb_ctrl_base + reg);
++}
++
++/*
++ * GPIO block
++ */
++#define GPIO_REG_OE 0x00
++#define GPIO_REG_IN 0x04
++#define GPIO_REG_OUT 0x08
++#define GPIO_REG_SET 0x0c
++#define GPIO_REG_CLEAR 0x10
++#define GPIO_REG_INT_MODE 0x14
++#define GPIO_REG_INT_TYPE 0x18
++#define GPIO_REG_INT_POLARITY 0x1c
++#define GPIO_REG_INT_PENDING 0x20
++#define GPIO_REG_INT_ENABLE 0x24
++#define GPIO_REG_FUNC 0x28
++
++#define GPIO_FUNC_STEREO_EN BIT(17)
++#define GPIO_FUNC_SLIC_EN BIT(16)
++#define GPIO_FUNC_SPI_CS2_EN BIT(13)
++#define GPIO_FUNC_SPI_CS1_EN BIT(12)
++#define GPIO_FUNC_UART_EN BIT(8)
++#define GPIO_FUNC_USB_OC_EN BIT(4)
++#define GPIO_FUNC_USB_CLK_EN BIT(0)
++
++#define AR71XX_GPIO_COUNT 16
++#define AR91XX_GPIO_COUNT 22
++
++extern void __iomem *ar71xx_gpio_base;
++
++static inline void ar71xx_gpio_wr(unsigned reg, u32 value)
++{
++ __raw_writel(value, ar71xx_gpio_base + reg);
++}
++
++static inline u32 ar71xx_gpio_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_gpio_base + reg);
++}
++
++extern void ar71xx_gpio_init(void) __init;
++extern void ar71xx_gpio_function_enable(u32 mask);
++extern void ar71xx_gpio_function_disable(u32 mask);
++
++/*
++ * DDR_CTRL block
++ */
++#define AR71XX_DDR_REG_PCI_WIN0 0x7c
++#define AR71XX_DDR_REG_PCI_WIN1 0x80
++#define AR71XX_DDR_REG_PCI_WIN2 0x84
++#define AR71XX_DDR_REG_PCI_WIN3 0x88
++#define AR71XX_DDR_REG_PCI_WIN4 0x8c
++#define AR71XX_DDR_REG_PCI_WIN5 0x90
++#define AR71XX_DDR_REG_PCI_WIN6 0x94
++#define AR71XX_DDR_REG_PCI_WIN7 0x98
++#define AR71XX_DDR_REG_FLUSH_GE0 0x9c
++#define AR71XX_DDR_REG_FLUSH_GE1 0xa0
++#define AR71XX_DDR_REG_FLUSH_USB 0xa4
++#define AR71XX_DDR_REG_FLUSH_PCI 0xa8
++
++#define AR91XX_DDR_REG_FLUSH_GE0 0x7c
++#define AR91XX_DDR_REG_FLUSH_GE1 0x80
++#define AR91XX_DDR_REG_FLUSH_USB 0x84
++#define AR91XX_DDR_REG_FLUSH_WMAC 0x88
++
++#define PCI_WIN0_OFFS 0x10000000
++#define PCI_WIN1_OFFS 0x11000000
++#define PCI_WIN2_OFFS 0x12000000
++#define PCI_WIN3_OFFS 0x13000000
++#define PCI_WIN4_OFFS 0x14000000
++#define PCI_WIN5_OFFS 0x15000000
++#define PCI_WIN6_OFFS 0x16000000
++#define PCI_WIN7_OFFS 0x07000000
++
++extern void __iomem *ar71xx_ddr_base;
++
++static inline void ar71xx_ddr_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_ddr_base + reg);
++}
++
++static inline u32 ar71xx_ddr_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_ddr_base + reg);
++}
++
++extern void ar71xx_ddr_flush(u32 reg);
++
++/*
++ * PCI block
++ */
++#define AR71XX_PCI_CFG_BASE (AR71XX_PCI_MEM_BASE + PCI_WIN7_OFFS + 0x10000)
++#define AR71XX_PCI_CFG_SIZE 0x100
++
++#define PCI_REG_CRP_AD_CBE 0x00
++#define PCI_REG_CRP_WRDATA 0x04
++#define PCI_REG_CRP_RDDATA 0x08
++#define PCI_REG_CFG_AD 0x0c
++#define PCI_REG_CFG_CBE 0x10
++#define PCI_REG_CFG_WRDATA 0x14
++#define PCI_REG_CFG_RDDATA 0x18
++#define PCI_REG_PCI_ERR 0x1c
++#define PCI_REG_PCI_ERR_ADDR 0x20
++#define PCI_REG_AHB_ERR 0x24
++#define PCI_REG_AHB_ERR_ADDR 0x28
++
++#define PCI_CRP_CMD_WRITE 0x00010000
++#define PCI_CRP_CMD_READ 0x00000000
++#define PCI_CFG_CMD_READ 0x0000000a
++#define PCI_CFG_CMD_WRITE 0x0000000b
++
++#define PCI_IDSEL_ADL_START 17
++
++/*
++ * RESET block
++ */
++#define AR71XX_RESET_REG_TIMER 0x00
++#define AR71XX_RESET_REG_TIMER_RELOAD 0x04
++#define AR71XX_RESET_REG_WDOG_CTRL 0x08
++#define AR71XX_RESET_REG_WDOG 0x0c
++#define AR71XX_RESET_REG_MISC_INT_STATUS 0x10
++#define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14
++#define AR71XX_RESET_REG_PCI_INT_STATUS 0x18
++#define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c
++#define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20
++#define AR71XX_RESET_REG_RESET_MODULE 0x24
++#define AR71XX_RESET_REG_PERFC_CTRL 0x2c
++#define AR71XX_RESET_REG_PERFC0 0x30
++#define AR71XX_RESET_REG_PERFC1 0x34
++#define AR71XX_RESET_REG_REV_ID 0x90
++
++#define AR91XX_RESET_REG_GLOBAL_INT_STATUS 0x18
++#define AR91XX_RESET_REG_RESET_MODULE 0x1c
++#define AR91XX_RESET_REG_PERF_CTRL 0x20
++#define AR91XX_RESET_REG_PERFC0 0x24
++#define AR91XX_RESET_REG_PERFC1 0x28
++
++#define WDOG_CTRL_LAST_RESET BIT(31)
++#define WDOG_CTRL_ACTION_MASK 3
++#define WDOG_CTRL_ACTION_NONE 0 /* no action */
++#define WDOG_CTRL_ACTION_GPI 1 /* general purpose interrupt */
++#define WDOG_CTRL_ACTION_NMI 2 /* NMI */
++#define WDOG_CTRL_ACTION_FCR 3 /* full chip reset */
++
++#define MISC_INT_DMA BIT(7)
++#define MISC_INT_OHCI BIT(6)
++#define MISC_INT_PERFC BIT(5)
++#define MISC_INT_WDOG BIT(4)
++#define MISC_INT_UART BIT(3)
++#define MISC_INT_GPIO BIT(2)
++#define MISC_INT_ERROR BIT(1)
++#define MISC_INT_TIMER BIT(0)
++
++#define PCI_INT_CORE BIT(4)
++#define PCI_INT_DEV2 BIT(2)
++#define PCI_INT_DEV1 BIT(1)
++#define PCI_INT_DEV0 BIT(0)
++
++#define RESET_MODULE_EXTERNAL BIT(28)
++#define RESET_MODULE_FULL_CHIP BIT(24)
++#define RESET_MODULE_AMBA2WMAC BIT(22)
++#define RESET_MODULE_CPU_NMI BIT(21)
++#define RESET_MODULE_CPU_COLD BIT(20)
++#define RESET_MODULE_DMA BIT(19)
++#define RESET_MODULE_SLIC BIT(18)
++#define RESET_MODULE_STEREO BIT(17)
++#define RESET_MODULE_DDR BIT(16)
++#define RESET_MODULE_GE1_MAC BIT(13)
++#define RESET_MODULE_GE1_PHY BIT(12)
++#define RESET_MODULE_USBSUS_OVERRIDE BIT(10)
++#define RESET_MODULE_GE0_MAC BIT(9)
++#define RESET_MODULE_GE0_PHY BIT(8)
++#define RESET_MODULE_USB_OHCI_DLL BIT(6)
++#define RESET_MODULE_USB_HOST BIT(5)
++#define RESET_MODULE_USB_PHY BIT(4)
++#define RESET_MODULE_PCI_BUS BIT(1)
++#define RESET_MODULE_PCI_CORE BIT(0)
++
++#define REV_ID_MASK 0xff
++#define REV_ID_CHIP_MASK 0xf3
++#define REV_ID_CHIP_AR7130 0xa0
++#define REV_ID_CHIP_AR7141 0xa1
++#define REV_ID_CHIP_AR7161 0xa2
++#define REV_ID_CHIP_AR9130 0xb0
++#define REV_ID_CHIP_AR9132 0xb1
++
++#define REV_ID_REVISION_MASK 0x3
++#define REV_ID_REVISION_SHIFT 2
++
++extern void __iomem *ar71xx_reset_base;
++
++static inline void ar71xx_reset_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_reset_base + reg);
++}
++
++static inline u32 ar71xx_reset_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_reset_base + reg);
++}
++
++extern void ar71xx_device_stop(u32 mask);
++extern void ar71xx_device_start(u32 mask);
++
++/*
++ * SPI block
++ */
++#define SPI_REG_FS 0x00 /* Function Select */
++#define SPI_REG_CTRL 0x04 /* SPI Control */
++#define SPI_REG_IOC 0x08 /* SPI I/O Control */
++#define SPI_REG_RDS 0x0c /* Read Data Shift */
++
++#define SPI_FS_GPIO BIT(0) /* Enable GPIO mode */
++
++#define SPI_CTRL_RD BIT(6) /* Remap Disable */
++#define SPI_CTRL_DIV_MASK 0x3f
++
++#define SPI_IOC_DO BIT(0) /* Data Out pin */
++#define SPI_IOC_CLK BIT(8) /* CLK pin */
++#define SPI_IOC_CS(n) BIT(16 + (n))
++#define SPI_IOC_CS0 SPI_IOC_CS(0)
++#define SPI_IOC_CS1 SPI_IOC_CS(1)
++#define SPI_IOC_CS2 SPI_IOC_CS(2)
++#define SPI_IOC_CS_ALL (SPI_IOC_CS0 | SPI_IOC_CS1 | SPI_IOC_CS2)
++
++/*
++ * MII_CTRL block
++ */
++#define MII_REG_MII0_CTRL 0x00
++#define MII_REG_MII1_CTRL 0x04
++
++#define MII0_CTRL_IF_GMII 0
++#define MII0_CTRL_IF_MII 1
++#define MII0_CTRL_IF_RGMII 2
++#define MII0_CTRL_IF_RMII 3
++
++#define MII1_CTRL_IF_RGMII 0
++#define MII1_CTRL_IF_RMII 1
++
++#endif /* __ASSEMBLER__ */
++
++#endif /* __ASM_MACH_AR71XX_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h 2009-04-13 14:27:34.627073939 +0200
+@@ -0,0 +1,56 @@
++/*
++ * Atheros AR71xx specific CPU feature overrides
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This file was derived from: include/asm-mips/cpu-features.h
++ * Copyright (C) 2003, 2004 Ralf Baechle
++ * Copyright (C) 2004 Maciej W. Rozycki
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++#ifndef __ASM_MACH_AR71XX_CPU_FEATURE_OVERRIDES_H
++#define __ASM_MACH_AR71XX_CPU_FEATURE_OVERRIDES_H
++
++#define cpu_has_tlb 1
++#define cpu_has_4kex 1
++#define cpu_has_3k_cache 0
++#define cpu_has_4k_cache 1
++#define cpu_has_tx39_cache 0
++#define cpu_has_sb1_cache 0
++#define cpu_has_fpu 0
++#define cpu_has_32fpr 0
++#define cpu_has_counter 1
++#define cpu_has_watch 1
++#define cpu_has_divec 1
++
++#define cpu_has_prefetch 1
++#define cpu_has_ejtag 1
++#define cpu_has_llsc 1
++
++#define cpu_has_mips16 1
++#define cpu_has_mdmx 0
++#define cpu_has_mips3d 0
++#define cpu_has_smartmips 0
++
++#define cpu_has_mips32r1 1
++#define cpu_has_mips32r2 1
++#define cpu_has_mips64r1 0
++#define cpu_has_mips64r2 0
++
++#define cpu_has_dsp 0
++#define cpu_has_mipsmt 0
++
++#define cpu_has_64bits 0
++#define cpu_has_64bit_zero_reg 0
++#define cpu_has_64bit_gp_regs 0
++#define cpu_has_64bit_addresses 0
++
++#define cpu_dcache_line_size() 32
++#define cpu_icache_line_size() 32
++
++#endif /* __ASM_MACH_AR71XX_CPU_FEATURE_OVERRIDES_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/gpio.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/gpio.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/gpio.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/gpio.h 2009-04-13 14:27:34.627073939 +0200
+@@ -0,0 +1,53 @@
++/*
++ * Atheros AR71xx GPIO API definitions
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#ifndef __ASM_MACH_AR71XX_GPIO_H
++#define __ASM_MACH_AR71XX_GPIO_H
++
++#define ARCH_NR_GPIOS 64
++#include <asm-generic/gpio.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++extern unsigned long ar71xx_gpio_count;
++extern void __ar71xx_gpio_set_value(unsigned gpio, int value);
++extern int __ar71xx_gpio_get_value(unsigned gpio);
++
++static inline int gpio_to_irq(unsigned gpio)
++{
++ return AR71XX_GPIO_IRQ(gpio);
++}
++
++static inline int irq_to_gpio(unsigned irq)
++{
++ return irq - AR71XX_GPIO_IRQ_BASE;
++}
++
++static inline int gpio_get_value(unsigned gpio)
++{
++ if (gpio < ar71xx_gpio_count)
++ return __ar71xx_gpio_get_value(gpio);
++
++ return __gpio_get_value(gpio);
++}
++
++static inline void gpio_set_value(unsigned gpio, int value)
++{
++ if (gpio < ar71xx_gpio_count)
++ __ar71xx_gpio_set_value(gpio, value);
++ else
++ __gpio_set_value(gpio, value);
++}
++
++#define gpio_cansleep __gpio_cansleep
++
++#endif /* __ASM_MACH_AR71XX_GPIO_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/irq.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/irq.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/irq.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/irq.h 2009-04-13 14:27:34.643075140 +0200
+@@ -0,0 +1,17 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++#ifndef __ASM_MACH_AR71XX_IRQ_H
++#define __ASM_MACH_AR71XX_IRQ_H
++
++#define MIPS_CPU_IRQ_BASE 0
++#define NR_IRQS 36
++
++#include_next <irq.h>
++
++#endif /* __ASM_MACH_AR71XX_IRQ_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h 2009-04-13 14:27:34.643075140 +0200
+@@ -0,0 +1,32 @@
++/*
++ * Atheros AR71xx specific kernel entry setup
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++#ifndef __ASM_MACH_AR71XX_KERNEL_ENTRY_H
++#define __ASM_MACH_AR71XX_KERNEL_ENTRY_H
++
++ /*
++ * Some bootloaders set the 'Kseg0 coherency algorithm' to
++ * 'Cacheable, noncoherent, write-through, no write allocate'
++ * and this cause performance issues. Let's go and change it to
++ * 'Cacheable, noncoherent, write-back, write allocate'
++ */
++ .macro kernel_entry_setup
++ mfc0 t0, CP0_CONFIG
++ li t1, ~CONF_CM_CMASK
++ and t0, t1
++ ori t0, CONF_CM_CACHABLE_NONCOHERENT
++ mtc0 t0, CP0_CONFIG
++ nop
++ .endm
++
++ .macro smp_slave_setup
++ .endm
++
++#endif /* __ASM_MACH_AR71XX_KERNEL_ENTRY_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/mangle-port.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/mangle-port.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/mangle-port.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/mangle-port.h 2009-04-13 14:27:34.643075140 +0200
+@@ -0,0 +1,45 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This file was derived from: inlude/asm-mips/mach-generic/mangle-port.h
++ * Copyright (C) 2003, 2004 Ralf Baechle
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_MANGLE_PORT_H
++#define __ASM_MACH_AR71XX_MANGLE_PORT_H
++
++#define __swizzle_addr_b(port) ((port) ^ 3)
++#define __swizzle_addr_w(port) ((port) ^ 2)
++#define __swizzle_addr_l(port) (port)
++#define __swizzle_addr_q(port) (port)
++
++#if defined(CONFIG_SWAP_IO_SPACE)
++
++# define ioswabb(a, x) (x)
++# define __mem_ioswabb(a, x) (x)
++# define ioswabw(a, x) le16_to_cpu(x)
++# define __mem_ioswabw(a, x) (x)
++# define ioswabl(a, x) le32_to_cpu(x)
++# define __mem_ioswabl(a, x) (x)
++# define ioswabq(a, x) le64_to_cpu(x)
++# define __mem_ioswabq(a, x) (x)
++
++#else
++
++# define ioswabb(a, x) (x)
++# define __mem_ioswabb(a, x) (x)
++# define ioswabw(a, x) (x)
++# define __mem_ioswabw(a, x) cpu_to_le16(x)
++# define ioswabl(a, x) (x)
++# define __mem_ioswabl(a, x) cpu_to_le32(x)
++# define ioswabq(a, x) (x)
++# define __mem_ioswabq(a, x) cpu_to_le64(x)
++
++#endif
++
++#endif /* __ASM_MACH_AR71XX_MANGLE_PORT_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/pci.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/pci.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/pci.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/pci.h 2009-04-13 14:27:34.647074532 +0200
+@@ -0,0 +1,28 @@
++/*
++ * Atheros AR71xx SoC specific PCI definitions
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_PCI_H
++#define __ASM_MACH_AR71XX_PCI_H
++
++struct ar71xx_pci_irq {
++ int irq;
++ u8 slot;
++ u8 pin;
++};
++
++extern int (*ar71xx_pci_be_handler)(int is_fixup);
++extern int (*ar71xx_pci_bios_init)(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map) __initdata;
++
++extern int ar71xx_pci_init(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map) __init;
++
++#endif /* __ASM_MACH_AR71XX_PCI_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/platform.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/platform.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/platform.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/platform.h 2009-04-13 14:27:34.647074532 +0200
+@@ -0,0 +1,54 @@
++/*
++ * Atheros AR71xx SoC specific platform data definitions
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_PLATFORM_H
++#define __ASM_MACH_AR71XX_PLATFORM_H
++
++#include <linux/if_ether.h>
++#include <linux/skbuff.h>
++#include <linux/phy.h>
++#include <linux/spi/spi.h>
++
++struct ag71xx_platform_data {
++ phy_interface_t phy_if_mode;
++ u32 phy_mask;
++ int speed;
++ int duplex;
++ u32 reset_bit;
++ u32 mii_if;
++ u8 mac_addr[ETH_ALEN];
++
++ u8 has_gbit:1;
++ u8 is_ar91xx:1;
++ u8 has_ar8216:1;
++
++ void (* ddr_flush)(void);
++ void (* set_pll)(u32 pll);
++};
++
++struct ag71xx_mdio_platform_data {
++ u32 phy_mask;
++};
++
++struct ar71xx_ehci_platform_data {
++ u8 is_ar91xx;
++};
++
++struct ar71xx_spi_platform_data {
++ unsigned bus_num;
++ unsigned num_chipselect;
++ u32 (*get_ioc_base)(u8 chip_select, int cs_high, int is_on);
++};
++
++#define AR71XX_SPI_CS_INACTIVE 0
++#define AR71XX_SPI_CS_ACTIVE 1
++
++#endif /* __ASM_MACH_AR71XX_PLATFORM_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/war.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/war.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/war.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/war.h 2009-04-13 14:27:34.647074532 +0200
+@@ -0,0 +1,25 @@
++/*
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
++ */
++#ifndef __ASM_MACH_AR71XX_WAR_H
++#define __ASM_MACH_AR71XX_WAR_H
++
++#define R4600_V1_INDEX_ICACHEOP_WAR 0
++#define R4600_V1_HIT_CACHEOP_WAR 0
++#define R4600_V2_HIT_CACHEOP_WAR 0
++#define R5432_CP0_INTERRUPT_WAR 0
++#define BCM1250_M3_WAR 0
++#define SIBYTE_1956_WAR 0
++#define MIPS4K_ICACHE_REFILL_WAR 0
++#define MIPS_CACHE_SYNC_WAR 0
++#define TX49XX_ICACHE_INDEX_INV_WAR 0
++#define RM9000_CDEX_SMP_WAR 0
++#define ICACHE_REFILLS_WORKAROUND_WAR 0
++#define R10000_LLSC_WAR 0
++#define MIPS34K_MISSED_ITLB_WAR 0
++
++#endif /* __ASM_MACH_AR71XX_WAR_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/time.h linux-2.6.29.1/arch/mips/include/asm/time.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/time.h 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/include/asm/time.h 2009-04-13 14:30:23.269613602 +0200
+@@ -52,6 +52,7 @@
+ */
+ #ifdef CONFIG_CEVT_R4K_LIB
+ extern unsigned int __weak get_c0_compare_int(void);
++extern unsigned int __weak get_c0_compare_irq(void);
+ extern int r4k_clockevent_init(void);
+ #endif
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/Makefile linux-2.6.29.1/arch/mips/kernel/Makefile
+--- linux-2.6.29.1.orig/arch/mips/kernel/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/Makefile 2009-04-13 14:27:34.655074992 +0200
+@@ -85,6 +85,7 @@
+
+ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
+ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
++obj-$(CONFIG_MIPS_MACHINE) += mips_machine.o
+
+ CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/cevt-r4k.c linux-2.6.29.1/arch/mips/kernel/cevt-r4k.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/cevt-r4k.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/cevt-r4k.c 2009-04-13 14:27:34.655074992 +0200
+@@ -15,6 +15,22 @@
+ #include <asm/cevt-r4k.h>
+
+ /*
++ * Compare interrupt can be routed and latched outside the core,
++ * so a single execution hazard barrier may not be enough to give
++ * it time to clear as seen in the Cause register. 4 time the
++ * pipeline depth seems reasonably conservative, and empirically
++ * works better in configurations with high CPU/bus clock ratios.
++ */
++
++#define compare_change_hazard() \
++ do { \
++ irq_disable_hazard(); \
++ irq_disable_hazard(); \
++ irq_disable_hazard(); \
++ irq_disable_hazard(); \
++ } while (0)
++
++/*
+ * The SMTC Kernel for the 34K, 1004K, et. al. replaces several
+ * of these routines with SMTC-specific variants.
+ */
+@@ -30,6 +46,7 @@
+ cnt = read_c0_count();
+ cnt += delta;
+ write_c0_compare(cnt);
++ compare_change_hazard();
+ res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0;
+ return res;
+ }
+@@ -99,22 +116,6 @@
+ return (read_c0_cause() >> cp0_compare_irq) & 0x100;
+ }
+
+-/*
+- * Compare interrupt can be routed and latched outside the core,
+- * so a single execution hazard barrier may not be enough to give
+- * it time to clear as seen in the Cause register. 4 time the
+- * pipeline depth seems reasonably conservative, and empirically
+- * works better in configurations with high CPU/bus clock ratios.
+- */
+-
+-#define compare_change_hazard() \
+- do { \
+- irq_disable_hazard(); \
+- irq_disable_hazard(); \
+- irq_disable_hazard(); \
+- irq_disable_hazard(); \
+- } while (0)
+-
+ int c0_compare_int_usable(void)
+ {
+ unsigned int delta;
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/mips_machine.c linux-2.6.29.1/arch/mips/kernel/mips_machine.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/mips_machine.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/kernel/mips_machine.c 2009-04-13 14:27:34.683076044 +0200
+@@ -0,0 +1,58 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#include <asm/mips_machine.h>
++#include <asm/bootinfo.h>
++
++static struct list_head mips_machines __initdata =
++ LIST_HEAD_INIT(mips_machines);
++
++unsigned char mips_machine_name[MIPS_MACHINE_NAME_LEN] = "Unknown";
++
++static struct mips_machine * __init mips_machine_find(unsigned long machtype)
++{
++ struct list_head *this;
++
++ list_for_each(this, &mips_machines) {
++ struct mips_machine *mach;
++
++ mach = list_entry(this, struct mips_machine, list);
++ if (mach->mach_type == machtype)
++ return mach;
++ }
++
++ return NULL;
++}
++
++void __init mips_machine_register(struct mips_machine *mach)
++{
++ list_add_tail(&mach->list, &mips_machines);
++}
++
++void __init mips_machine_setup(unsigned long machtype)
++{
++ struct mips_machine *mach;
++
++ mach = mips_machine_find(machtype);
++ if (!mach) {
++ printk(KERN_ALERT "MIPS: no machine registered for "
++ "machtype %lu\n", machtype);
++ return;
++ }
++
++ if (mach->mach_name[0])
++ strncpy(mips_machine_name, mach->mach_name,
++ MIPS_MACHINE_NAME_LEN);
++
++ printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
++
++ if (mach->mach_setup)
++ mach->mach_setup();
++}
++
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/proc.c linux-2.6.29.1/arch/mips/kernel/proc.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/proc.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/proc.c 2009-04-13 14:27:34.683076044 +0200
+@@ -14,6 +14,7 @@
+ #include <asm/cpu-features.h>
+ #include <asm/mipsregs.h>
+ #include <asm/processor.h>
++#include <asm/mips_machine.h>
+
+ unsigned int vced_count, vcei_count;
+
+@@ -33,8 +34,12 @@
+ /*
+ * For the first processor also print the system type
+ */
+- if (n == 0)
++ if (n == 0) {
+ seq_printf(m, "system type\t\t: %s\n", get_system_type());
++#ifdef CONFIG_MIPS_MACHINE
++ seq_printf(m, "machine\t\t\t: %s\n", mips_machine_name);
++#endif
++ }
+
+ seq_printf(m, "processor\t\t: %ld\n", n);
+ sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/traps.c linux-2.6.29.1/arch/mips/kernel/traps.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/traps.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/traps.c 2009-04-13 14:29:45.479250639 +0200
+@@ -47,6 +47,7 @@
+ #include <asm/mmu_context.h>
+ #include <asm/types.h>
+ #include <asm/stacktrace.h>
++#include <asm/time.h>
+ #include <asm/irq.h>
+
+ extern void check_wait(void);
+@@ -1541,6 +1542,8 @@
+ */
+ if (cpu_has_mips_r2) {
+ cp0_compare_irq = (read_c0_intctl() >> 29) & 7;
++ if (get_c0_compare_irq)
++ cp0_compare_irq = get_c0_compare_irq();
+ cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7;
+ if (cp0_perfcount_irq == cp0_compare_irq)
+ cp0_perfcount_irq = -1;
+diff -Nur linux-2.6.29.1.orig/arch/mips/pci/Makefile linux-2.6.29.1/arch/mips/pci/Makefile
+--- linux-2.6.29.1.orig/arch/mips/pci/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/pci/Makefile 2009-04-13 14:27:34.691076784 +0200
+@@ -16,6 +16,7 @@
+ obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
+ obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o
+ obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o
++obj-$(CONFIG_ATHEROS_AR71XX) += pci-ar71xx.o
+
+ #
+ # These are still pretty much in the old state, watch, go blind.
+diff -Nur linux-2.6.29.1.orig/arch/mips/pci/pci-ar71xx.c linux-2.6.29.1/arch/mips/pci/pci-ar71xx.c
+--- linux-2.6.29.1.orig/arch/mips/pci/pci-ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/pci/pci-ar71xx.c 2009-04-13 14:27:34.695077573 +0200
+@@ -0,0 +1,347 @@
++/*
++ * Atheros AR71xx PCI host controller driver
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/resource.h>
++#include <linux/types.h>
++#include <linux/delay.h>
++#include <linux/bitops.h>
++#include <linux/pci.h>
++#include <linux/pci_regs.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#undef DEBUG
++#ifdef DEBUG
++#define DBG(fmt, args...) printk(KERN_DEBUG fmt, ## args)
++#else
++#define DBG(fmt, args...)
++#endif
++
++#define AR71XX_PCI_DELAY 100 /* msecs */
++
++#if 0
++#define PCI_IDSEL_BASE PCI_IDSEL_ADL_START
++#else
++#define PCI_IDSEL_BASE 0
++#endif
++
++static unsigned ar71xx_pci_nr_irqs;
++static struct ar71xx_pci_irq *ar71xx_pci_irq_map __initdata;
++static void __iomem *ar71xx_pcicfg_base;
++
++static DEFINE_SPINLOCK(ar71xx_pci_lock);
++
++static inline void ar71xx_pci_delay(void)
++{
++ mdelay(AR71XX_PCI_DELAY);
++}
++
++static inline u32 ar71xx_pcicfg_rr(unsigned int reg)
++{
++ return __raw_readl(ar71xx_pcicfg_base + reg);
++}
++
++static inline void ar71xx_pcicfg_wr(unsigned int reg, u32 val)
++{
++ __raw_writel(val, ar71xx_pcicfg_base + reg);
++}
++
++/* Byte lane enable bits */
++static u8 ble_table[4][4] = {
++ {0x0, 0xf, 0xf, 0xf},
++ {0xe, 0xd, 0xb, 0x7},
++ {0xc, 0xf, 0x3, 0xf},
++ {0xf, 0xf, 0xf, 0xf},
++};
++
++static inline u32 ar71xx_pci_get_ble(int where, int size, int local)
++{
++ u32 t;
++
++ t = ble_table[size & 3][where & 3];
++ BUG_ON(t == 0xf);
++ t <<= (local) ? 20 : 4;
++ return t;
++}
++
++static inline u32 ar71xx_pci_bus_addr(struct pci_bus *bus, unsigned int devfn,
++ int where)
++{
++ u32 ret;
++
++ if (!bus->number) {
++ /* type 0 */
++ ret = (1 << (PCI_IDSEL_BASE + PCI_SLOT(devfn)))
++ | (PCI_FUNC(devfn) << 8) | (where & ~3);
++ } else {
++ /* type 1 */
++ ret = (bus->number << 16) | (PCI_SLOT(devfn) << 11)
++ | (PCI_FUNC(devfn) << 8) | (where & ~3) | 1;
++ }
++
++ return ret;
++}
++
++static int __ar71xx_pci_be_handler(int is_fixup)
++{
++ u32 pci_err;
++ u32 ahb_err;
++
++ pci_err = ar71xx_pcicfg_rr(PCI_REG_PCI_ERR) & 3;
++ if (pci_err) {
++ if (!is_fixup)
++ printk(KERN_ALERT "PCI error %d at PCI addr 0x%x\n",
++ pci_err,
++ ar71xx_pcicfg_rr(PCI_REG_PCI_ERR_ADDR));
++
++ ar71xx_pcicfg_wr(PCI_REG_PCI_ERR, pci_err);
++ }
++
++ ahb_err = ar71xx_pcicfg_rr(PCI_REG_AHB_ERR) & 1;
++ if (ahb_err) {
++ if (!is_fixup)
++ printk(KERN_ALERT "AHB error at AHB address 0x%x\n",
++ ar71xx_pcicfg_rr(PCI_REG_AHB_ERR_ADDR));
++
++ ar71xx_pcicfg_wr(PCI_REG_AHB_ERR, ahb_err);
++ }
++
++ return ((ahb_err | pci_err) ? 1 : 0);
++}
++
++static inline int ar71xx_pci_set_cfgaddr(struct pci_bus *bus,
++ unsigned int devfn, int where, int size, u32 cmd)
++{
++ u32 addr;
++
++ addr = ar71xx_pci_bus_addr(bus, devfn, where);
++
++ DBG("PCI: set cfgaddr: %02x:%02x.%01x/%02x:%01d, addr=%08x\n",
++ bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn),
++ where, size, addr);
++
++ ar71xx_pcicfg_wr(PCI_REG_CFG_AD, addr);
++ ar71xx_pcicfg_wr(PCI_REG_CFG_CBE,
++ cmd | ar71xx_pci_get_ble(where, size, 0));
++
++ return __ar71xx_pci_be_handler(1);
++}
++
++static int ar71xx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
++ int where, int size, u32 *value)
++{
++ static u32 mask[8] = {0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0};
++ unsigned long flags;
++ u32 data;
++ int ret;
++
++ ret = PCIBIOS_SUCCESSFUL;
++
++ DBG("PCI: read config: %02x:%02x.%01x/%02x:%01d\n", bus->number,
++ PCI_SLOT(devfn), PCI_FUNC(devfn), where, size);
++
++ spin_lock_irqsave(&ar71xx_pci_lock, flags);
++
++ if (bus->number == 0 && devfn == 0) {
++ u32 t;
++
++ t = PCI_CRP_CMD_READ | (where & ~3);
++
++ ar71xx_pcicfg_wr(PCI_REG_CRP_AD_CBE, t);
++ data = ar71xx_pcicfg_rr(PCI_REG_CRP_RDDATA);
++
++ DBG("PCI: rd local cfg, ad_cbe:%08x, data:%08x\n", t, data);
++
++ } else {
++ int err;
++
++ err = ar71xx_pci_set_cfgaddr(bus, devfn, where, size,
++ PCI_CFG_CMD_READ);
++
++ if (err == 0) {
++ data = ar71xx_pcicfg_rr(PCI_REG_CFG_RDDATA);
++ } else {
++ ret = PCIBIOS_DEVICE_NOT_FOUND;
++ data = ~0;
++ }
++ }
++
++ spin_unlock_irqrestore(&ar71xx_pci_lock, flags);
++
++ DBG("PCI: read config: data=%08x raw=%08x\n",
++ (data >> (8 * (where & 3))) & mask[size & 7], data);
++
++ *value = (data >> (8 * (where & 3))) & mask[size & 7];
++
++ return ret;
++}
++
++static int ar71xx_pci_write_config(struct pci_bus *bus, unsigned int devfn,
++ int where, int size, u32 value)
++{
++ unsigned long flags;
++ int ret;
++
++ DBG("PCI: write config: %02x:%02x.%01x/%02x:%01d value=%08x\n",
++ bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn),
++ where, size, value);
++
++ value = value << (8 * (where & 3));
++ ret = PCIBIOS_SUCCESSFUL;
++
++ spin_lock_irqsave(&ar71xx_pci_lock, flags);
++ if (bus->number == 0 && devfn == 0) {
++ u32 t;
++
++ t = PCI_CRP_CMD_WRITE | (where & ~3);
++ t |= ar71xx_pci_get_ble(where, size, 1);
++
++ DBG("PCI: wr local cfg, ad_cbe:%08x, value:%08x\n", t, value);
++
++ ar71xx_pcicfg_wr(PCI_REG_CRP_AD_CBE, t);
++ ar71xx_pcicfg_wr(PCI_REG_CRP_WRDATA, value);
++ } else {
++ int err;
++
++ err = ar71xx_pci_set_cfgaddr(bus, devfn, where, size,
++ PCI_CFG_CMD_WRITE);
++
++ if (err == 0)
++ ar71xx_pcicfg_wr(PCI_REG_CFG_WRDATA, value);
++ else
++ ret = PCIBIOS_DEVICE_NOT_FOUND;
++ }
++ spin_unlock_irqrestore(&ar71xx_pci_lock, flags);
++
++ return ret;
++}
++
++static void ar71xx_pci_fixup(struct pci_dev *dev)
++{
++ u32 t;
++
++ if (dev->bus->number != 0 || dev->devfn != 0)
++ return;
++
++ DBG("PCI: fixup host controller %s (%04x:%04x)\n", pci_name(dev),
++ dev->vendor, dev->device);
++
++ /* setup COMMAND register */
++ t = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE
++ | PCI_COMMAND_PARITY | PCI_COMMAND_SERR | PCI_COMMAND_FAST_BACK;
++
++ pci_write_config_word(dev, PCI_COMMAND, t);
++}
++
++DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, ar71xx_pci_fixup);
++
++int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin)
++{
++ int irq = -1;
++ int i;
++
++ slot -= PCI_IDSEL_ADL_START - PCI_IDSEL_BASE;
++
++ for (i = 0; i < ar71xx_pci_nr_irqs; i++) {
++ struct ar71xx_pci_irq *entry;
++
++ entry = &ar71xx_pci_irq_map[i];
++ if (entry->slot == slot && entry->pin == pin) {
++ irq = entry->irq;
++ break;
++ }
++ }
++
++ if (irq < 0) {
++ printk(KERN_ALERT "PCI: no irq found for pin%u@%s\n",
++ pin, pci_name((struct pci_dev *)dev));
++ } else {
++ printk(KERN_INFO "PCI: mapping irq %d to pin%u@%s\n",
++ irq, pin, pci_name((struct pci_dev *)dev));
++ }
++
++ return irq;
++}
++
++int pcibios_plat_dev_init(struct pci_dev *dev)
++{
++ return 0;
++}
++
++static struct pci_ops ar71xx_pci_ops = {
++ .read = ar71xx_pci_read_config,
++ .write = ar71xx_pci_write_config,
++};
++
++static struct resource ar71xx_pci_io_resource = {
++ .name = "PCI IO space",
++ .start = 0,
++ .end = 0,
++ .flags = IORESOURCE_IO,
++};
++
++static struct resource ar71xx_pci_mem_resource = {
++ .name = "PCI memory space",
++ .start = AR71XX_PCI_MEM_BASE,
++ .end = AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1,
++ .flags = IORESOURCE_MEM
++};
++
++static struct pci_controller ar71xx_pci_controller = {
++ .pci_ops = &ar71xx_pci_ops,
++ .mem_resource = &ar71xx_pci_mem_resource,
++ .io_resource = &ar71xx_pci_io_resource,
++};
++
++static int __init __ar71xx_pci_bios_init(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map)
++{
++ ar71xx_device_stop(RESET_MODULE_PCI_BUS | RESET_MODULE_PCI_CORE);
++ ar71xx_pci_delay();
++
++ ar71xx_device_start(RESET_MODULE_PCI_BUS | RESET_MODULE_PCI_CORE);
++ ar71xx_pci_delay();
++
++ ar71xx_pcicfg_base = ioremap_nocache(AR71XX_PCI_CFG_BASE,
++ AR71XX_PCI_CFG_SIZE);
++
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN0, PCI_WIN0_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN1, PCI_WIN1_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN2, PCI_WIN2_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN3, PCI_WIN3_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN4, PCI_WIN4_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN5, PCI_WIN5_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN6, PCI_WIN6_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN7, PCI_WIN7_OFFS);
++
++ ar71xx_pci_delay();
++
++ /* clear bus errors */
++ (void)__ar71xx_pci_be_handler(1);
++
++ ar71xx_pci_nr_irqs = nr_irqs;
++ ar71xx_pci_irq_map = map;
++ ar71xx_pci_be_handler = __ar71xx_pci_be_handler;
++
++ register_pci_controller(&ar71xx_pci_controller);
++
++ return 0;
++}
++
++static int __init __ar71xx_pci_init(void)
++{
++ ar71xx_pci_bios_init = __ar71xx_pci_bios_init;
++ return 0;
++}
++pure_initcall(__ar71xx_pci_init);
+diff -Nur linux-2.6.29.1.orig/drivers/input/misc/Kconfig linux-2.6.29.1/drivers/input/misc/Kconfig
+--- linux-2.6.29.1.orig/drivers/input/misc/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/input/misc/Kconfig 2009-04-13 14:27:34.723078345 +0200
+@@ -227,4 +227,20 @@
+ Say Y to include support for delivering PMU events via input
+ layer on NXP PCF50633.
+
++config INPUT_GPIO_BUTTONS
++ tristate "Polled GPIO buttons interface"
++ depends on GENERIC_GPIO
++ select INPUT_POLLDEV
++ help
++ This driver implements support for buttons connected
++ to GPIO pins of various CPUs (and some other chips).
++
++ Say Y here if your device has buttons connected
++ directly to such GPIO pins. Your board-specific
++ setup logic must also provide a platform device,
++ with configuration data saying which GPIOs are used.
++
++ To compile this driver as a module, choose M here: the
++ module will be called gpio-buttons.
++
+ endif
+diff -Nur linux-2.6.29.1.orig/drivers/input/misc/Makefile linux-2.6.29.1/drivers/input/misc/Makefile
+--- linux-2.6.29.1.orig/drivers/input/misc/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/input/misc/Makefile 2009-04-13 14:29:03.564632184 +0200
+@@ -22,3 +22,4 @@
+ obj-$(CONFIG_INPUT_APANEL) += apanel.o
+ obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
+ obj-$(CONFIG_INPUT_PCF50633_PMU) += pcf50633-input.o
++obj-$(CONFIG_INPUT_GPIO_BUTTONS) += gpio_buttons.o
+diff -Nur linux-2.6.29.1.orig/drivers/input/misc/gpio_buttons.c linux-2.6.29.1/drivers/input/misc/gpio_buttons.c
+--- linux-2.6.29.1.orig/drivers/input/misc/gpio_buttons.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/input/misc/gpio_buttons.c 2009-04-13 14:27:34.727079413 +0200
+@@ -0,0 +1,209 @@
++/*
++ * Driver for buttons on GPIO lines not capable of generating interrupts
++ *
++ * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
++ *
++ * This file was based on: /drivers/input/misc/cobalt_btns.c
++ * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
++ *
++ * also was based on: /drivers/input/keyboard/gpio_keys.c
++ * Copyright 2005 Phil Blundell
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++
++#include <linux/input.h>
++#include <linux/input-polldev.h>
++#include <linux/ioport.h>
++#include <linux/platform_device.h>
++
++#include <linux/gpio_buttons.h>
++
++#include <asm/gpio.h>
++
++#define DRV_NAME "gpio-buttons"
++#define DRV_VERSION "0.1.1"
++#define PFX DRV_NAME ": "
++
++struct gpio_buttons_dev {
++ struct input_polled_dev *poll_dev;
++ struct gpio_buttons_platform_data *pdata;
++};
++
++static void gpio_buttons_poll(struct input_polled_dev *dev)
++{
++ struct gpio_buttons_dev *bdev = dev->private;
++ struct gpio_buttons_platform_data *pdata = bdev->pdata;
++ struct input_dev *input = dev->input;
++ int i;
++
++ for (i = 0; i < bdev->pdata->nbuttons; i++) {
++ struct gpio_button *button = &pdata->buttons[i];
++ unsigned int type = button->type ?: EV_KEY;
++ int state;
++
++ state = gpio_get_value(button->gpio) ? 1 : 0;
++ state ^= button->active_low;
++
++ if (state) {
++ button->count++;
++ } else {
++ if (button->count >= button->threshold) {
++ input_event(input, type, button->code, 1);
++ input_sync(input);
++ }
++ button->count = 0;
++ }
++
++ if (button->count == button->threshold) {
++ input_event(input, type, button->code, 0);
++ input_sync(input);
++ }
++ }
++}
++
++static int __devinit gpio_buttons_probe(struct platform_device *pdev)
++{
++ struct gpio_buttons_platform_data *pdata = pdev->dev.platform_data;
++ struct gpio_buttons_dev *bdev;
++ struct input_polled_dev *poll_dev;
++ struct input_dev *input;
++ int error, i;
++
++
++ if (!pdata)
++ return -ENXIO;
++
++ bdev = kzalloc(sizeof(*bdev), GFP_KERNEL);
++ if (!bdev) {
++ printk(KERN_ERR DRV_NAME "no memory for device\n");
++ return -ENOMEM;
++ }
++
++ poll_dev = input_allocate_polled_device();
++ if (!poll_dev) {
++ printk(KERN_ERR DRV_NAME "no memory for polled device\n");
++ error = -ENOMEM;
++ goto err_free_bdev;
++ }
++
++ poll_dev->private = bdev;
++ poll_dev->poll = gpio_buttons_poll;
++ poll_dev->poll_interval = pdata->poll_interval;
++
++ input = poll_dev->input;
++
++ input->evbit[0] = BIT(EV_KEY);
++ input->name = pdev->name;
++ input->phys = "gpio-buttons/input0";
++ input->dev.parent = &pdev->dev;
++
++ input->id.bustype = BUS_HOST;
++ input->id.vendor = 0x0001;
++ input->id.product = 0x0001;
++ input->id.version = 0x0100;
++
++ for (i = 0; i < pdata->nbuttons; i++) {
++ struct gpio_button *button = &pdata->buttons[i];
++ unsigned int gpio = button->gpio;
++ unsigned int type = button->type ?: EV_KEY;
++
++ error = gpio_request(gpio, button->desc ?
++ button->desc : DRV_NAME);
++ if (error) {
++ printk(KERN_ERR PFX "unable to claim gpio %u, "
++ "error %d\n", gpio, error);
++ goto err_free_gpio;
++ }
++
++ error = gpio_direction_input(gpio);
++ if (error) {
++ printk(KERN_ERR PFX "unable to set direction on "
++ "gpio %u, error %d\n", gpio, error);
++ goto err_free_gpio;
++ }
++
++ input_set_capability(input, type, button->code);
++ button->count = 0;
++ }
++
++ bdev->poll_dev = poll_dev;
++ bdev->pdata = pdata;
++ platform_set_drvdata(pdev, bdev);
++
++ error = input_register_polled_device(poll_dev);
++ if (error) {
++ printk(KERN_ERR PFX "unable to register polled device, "
++ "error %d\n", error);
++ goto err_free_gpio;
++ }
++
++ return 0;
++
++err_free_gpio:
++ for (i = i - 1; i >= 0; i--)
++ gpio_free(pdata->buttons[i].gpio);
++
++ input_free_polled_device(poll_dev);
++
++err_free_bdev:
++ kfree(bdev);
++
++ platform_set_drvdata(pdev, NULL);
++ return error;
++}
++
++static int __devexit gpio_buttons_remove(struct platform_device *pdev)
++{
++ struct gpio_buttons_dev *bdev = platform_get_drvdata(pdev);
++ struct gpio_buttons_platform_data *pdata = bdev->pdata;
++ int i;
++
++ input_unregister_polled_device(bdev->poll_dev);
++
++ for (i = 0; i < pdata->nbuttons; i++)
++ gpio_free(pdata->buttons[i].gpio);
++
++ input_free_polled_device(bdev->poll_dev);
++
++ kfree(bdev);
++ platform_set_drvdata(pdev, NULL);
++
++ return 0;
++}
++
++static struct platform_driver gpio_buttons_driver = {
++ .probe = gpio_buttons_probe,
++ .remove = __devexit_p(gpio_buttons_remove),
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init gpio_buttons_init(void)
++{
++ printk(KERN_INFO DRV_NAME " driver version " DRV_VERSION "\n");
++ return platform_driver_register(&gpio_buttons_driver);
++}
++
++static void __exit gpio_buttons_exit(void)
++{
++ platform_driver_unregister(&gpio_buttons_driver);
++}
++
++module_init(gpio_buttons_init);
++module_exit(gpio_buttons_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>");
++MODULE_VERSION(DRV_VERSION);
++MODULE_DESCRIPTION("Polled buttons driver for CPU GPIOs");
++
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/nand/Kconfig linux-2.6.29.1/drivers/mtd/nand/Kconfig
+--- linux-2.6.29.1.orig/drivers/mtd/nand/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/mtd/nand/Kconfig 2009-04-13 14:27:34.731079923 +0200
+@@ -427,4 +427,8 @@
+ Several Renesas SuperH CPU has FLCTL. This option enables support
+ for NAND Flash using FLCTL. This driver support SH7723.
+
++config MTD_NAND_RB4XX
++ tristate "NAND flash driver for RouterBoard 4xx series"
++ depends on MTD_NAND && ATHEROS_AR71XX
++
+ endif # MTD_NAND
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/nand/Makefile linux-2.6.29.1/drivers/mtd/nand/Makefile
+--- linux-2.6.29.1.orig/drivers/mtd/nand/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/mtd/nand/Makefile 2009-04-13 14:27:34.731079923 +0200
+@@ -29,6 +29,7 @@
+ obj-$(CONFIG_MTD_NAND_PXA3xx) += pxa3xx_nand.o
+ obj-$(CONFIG_MTD_NAND_TMIO) += tmio_nand.o
+ obj-$(CONFIG_MTD_NAND_PLATFORM) += plat_nand.o
++obj-$(CONFIG_MTD_NAND_RB4XX) += rb4xx_nand.o
+ obj-$(CONFIG_MTD_ALAUDA) += alauda.o
+ obj-$(CONFIG_MTD_NAND_PASEMI) += pasemi_nand.o
+ obj-$(CONFIG_MTD_NAND_ORION) += orion_nand.o
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/nand/rb4xx_nand.c linux-2.6.29.1/drivers/mtd/nand/rb4xx_nand.c
+--- linux-2.6.29.1.orig/drivers/mtd/nand/rb4xx_nand.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/mtd/nand/rb4xx_nand.c 2009-04-13 14:27:34.735080153 +0200
+@@ -0,0 +1,507 @@
++/*
++ * NAND flash driver for the MikroTik RouterBoard 4xx series
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This file was based on the driver for Linux 2.6.22 published by
++ * MikroTik for their RouterBoard 4xx series devices.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++#include <linux/io.h>
++#include <linux/gpio.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#define DRV_NAME "rb4xx-nand"
++#define DRV_VERSION "0.1.10"
++#define DRV_DESC "NAND flash driver for RouterBoard 4xx series"
++
++#define USE_FAST_READ 1
++#define USE_FAST_WRITE 1
++#undef RB4XX_NAND_DEBUG
++
++#ifdef RB4XX_NAND_DEBUG
++#define DBG(fmt, arg...) printk(KERN_DEBUG DRV_NAME ": " fmt, ## arg)
++#else
++#define DBG(fmt, arg...) do {} while (0)
++#endif
++
++#define RB4XX_NAND_GPIO_RDY 5
++#define RB4XX_FLASH_HZ 33333334
++#define RB4XX_NAND_HZ 33333334
++
++#define SPI_CTRL_FASTEST 0x40
++#define SPI_CTRL_SAFE 0x43 /* 25 MHz for AHB 200 MHz */
++#define SBIT_IOC_BASE SPI_IOC_CS1
++#define SBIT_IOC_DO_SHIFT 0
++#define SBIT_IOC_DO (1u << SBIT_IOC_DO_SHIFT)
++#define SBIT_IOC_DO2_SHIFT 18
++#define SBIT_IOC_DO2 (1u << SBIT_IOC_DO2_SHIFT)
++
++#define CPLD_CMD_WRITE_MULT 0x08 /* send cmd, n x send data, read data */
++#define CPLD_CMD_WRITE_CFG 0x09 /* send cmd, n x send cfg */
++#define CPLD_CMD_READ_MULT 0x0a /* send cmd, send idle, n x read data */
++#define CPLD_CMD_READ_FAST 0x0b /* send cmd, 4 x idle, n x read data */
++
++#define CFG_BIT_nCE 0x80
++#define CFG_BIT_CLE 0x40
++#define CFG_BIT_ALE 0x20
++#define CFG_BIT_FAN 0x10
++#define CFG_BIT_nLED4 0x08
++#define CFG_BIT_nLED3 0x04
++#define CFG_BIT_nLED2 0x02
++#define CFG_BIT_nLED1 0x01
++
++#define CFG_BIT_nLEDS \
++ (CFG_BIT_nLED1 | CFG_BIT_nLED2 | CFG_BIT_nLED3 | CFG_BIT_nLED4)
++
++struct rb4xx_nand_info {
++ struct nand_chip chip;
++ struct mtd_info mtd;
++};
++
++/*
++ * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
++ * will not be able to find the kernel that we load.
++ */
++static struct nand_ecclayout rb4xx_nand_ecclayout = {
++ .eccbytes = 6,
++ .eccpos = { 8, 9, 10, 13, 14, 15 },
++ .oobavail = 9,
++ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
++};
++
++static struct mtd_partition rb4xx_nand_partitions[] = {
++ {
++ .name = "booter",
++ .offset = 0,
++ .size = (256 * 1024),
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "kernel",
++ .offset = (256 * 1024),
++ .size = (4 * 1024 * 1024) - (256 * 1024),
++ },
++ {
++ .name = "rootfs",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = MTDPART_SIZ_FULL,
++ },
++};
++
++#if USE_FAST_READ
++#define SPI_NDATA_BASE 0x00800000
++static unsigned spi_ctrl_fread = SPI_CTRL_SAFE;
++static unsigned spi_ctrl_flash = SPI_CTRL_SAFE;
++extern unsigned mips_hpt_frequency;
++#endif
++
++static inline unsigned rb4xx_spi_rreg(unsigned r)
++{
++ return __raw_readl((void * __iomem)(KSEG1ADDR(AR71XX_SPI_BASE) + r));
++}
++
++static inline void rb4xx_spi_wreg(unsigned r, unsigned v)
++{
++ __raw_writel(v, (void * __iomem)(KSEG1ADDR(AR71XX_SPI_BASE) + r));
++}
++
++static inline void do_spi_clk(int bit)
++{
++ unsigned bval = SBIT_IOC_BASE | (bit & 1);
++
++ rb4xx_spi_wreg(SPI_REG_IOC, bval);
++ rb4xx_spi_wreg(SPI_REG_IOC, bval | SPI_IOC_CLK);
++}
++
++static void do_spi_byte(uint8_t byte)
++{
++ do_spi_clk(byte >> 7);
++ do_spi_clk(byte >> 6);
++ do_spi_clk(byte >> 5);
++ do_spi_clk(byte >> 4);
++ do_spi_clk(byte >> 3);
++ do_spi_clk(byte >> 2);
++ do_spi_clk(byte >> 1);
++ do_spi_clk(byte);
++
++ DBG("spi_byte sent 0x%02x got 0x%x\n",
++ byte, rb4xx_spi_rreg(SPI_REG_RDS));
++}
++
++#if USE_FAST_WRITE
++static inline void do_spi_clk_fast(int bit1, int bit2)
++{
++ unsigned bval = (SBIT_IOC_BASE |
++ ((bit1 << SBIT_IOC_DO_SHIFT) & SBIT_IOC_DO) |
++ ((bit2 << SBIT_IOC_DO2_SHIFT) & SBIT_IOC_DO2));
++
++ rb4xx_spi_wreg(SPI_REG_IOC, bval);
++ rb4xx_spi_wreg(SPI_REG_IOC, bval | SPI_IOC_CLK);
++}
++
++static inline void do_spi_byte_fast(uint8_t byte)
++{
++ do_spi_clk_fast(byte >> 7, byte >> 6);
++ do_spi_clk_fast(byte >> 5, byte >> 4);
++ do_spi_clk_fast(byte >> 3, byte >> 2);
++ do_spi_clk_fast(byte >> 1, byte >> 0);
++
++ DBG("spi_byte_fast sent 0x%02x got 0x%x\n",
++ byte, rb4xx_spi_rreg(SPI_REG_RDS));
++}
++#else
++static inline void do_spi_byte_fast(uint8_t byte)
++{
++ do_spi_byte(byte);
++}
++#endif /* USE_FAST_WRITE */
++
++static int do_spi_cmd(unsigned cmd, unsigned sendCnt, const uint8_t *sendData,
++ unsigned recvCnt, uint8_t *recvData,
++ const uint8_t *verifyData, int fastWrite)
++{
++ unsigned i;
++
++ DBG("SPI cmd 0x%x send %u recv %u\n", cmd, sendCnt, recvCnt);
++
++ rb4xx_spi_wreg(SPI_REG_FS, SPI_FS_GPIO);
++ rb4xx_spi_wreg(SPI_REG_CTRL, SPI_CTRL_FASTEST);
++
++ do_spi_byte(cmd);
++#if 0
++ if (cmd == CPLD_CMD_READ_FAST) {
++ do_spi_byte(0x80);
++ do_spi_byte(0);
++ do_spi_byte(0);
++ }
++#endif
++ for (i = 0; i < sendCnt; ++i) {
++ if (fastWrite)
++ do_spi_byte_fast(sendData[i]);
++ else
++ do_spi_byte(sendData[i]);
++ }
++
++ for (i = 0; i < recvCnt; ++i) {
++ if (fastWrite)
++ do_spi_byte_fast(0);
++ else
++ do_spi_byte(0);
++
++ if (recvData) {
++ recvData[i] = rb4xx_spi_rreg(SPI_REG_RDS) & 0xff;
++ } else if (verifyData) {
++ if (verifyData[i] != (rb4xx_spi_rreg(SPI_REG_RDS)
++ & 0xff))
++ break;
++ }
++ }
++
++ rb4xx_spi_wreg(SPI_REG_IOC, SBIT_IOC_BASE | SPI_IOC_CS0);
++ rb4xx_spi_wreg(SPI_REG_CTRL, spi_ctrl_flash);
++ rb4xx_spi_wreg(SPI_REG_FS, 0);
++
++ return i == recvCnt;
++}
++
++static int got_write = 1;
++
++static void rb4xx_nand_write_data(const uint8_t *byte, unsigned cnt)
++{
++ do_spi_cmd(CPLD_CMD_WRITE_MULT, cnt, byte, 1, NULL, NULL, 1);
++ got_write = 1;
++}
++
++static void rb4xx_nand_write_byte(uint8_t byte)
++{
++ rb4xx_nand_write_data(&byte, 1);
++}
++
++#if USE_FAST_READ
++static uint8_t *rb4xx_nand_read_getaddr(unsigned cnt)
++{
++ static unsigned nboffset = 0x100000;
++ unsigned addr;
++
++ if (got_write) {
++ nboffset = (nboffset + 31) & ~31;
++ if (nboffset >= 0x100000) /* 1MB */
++ nboffset = 0;
++
++ got_write = 0;
++ rb4xx_spi_wreg(SPI_REG_FS, SPI_FS_GPIO);
++ rb4xx_spi_wreg(SPI_REG_CTRL, spi_ctrl_fread);
++ rb4xx_spi_wreg(SPI_REG_FS, 0);
++ }
++
++ addr = KSEG1ADDR(AR71XX_SPI_BASE + SPI_NDATA_BASE) + nboffset;
++ DBG("rb4xx_nand_read_getaddr 0x%x cnt 0x%x\n", addr, cnt);
++
++ nboffset += cnt;
++ return (uint8_t *)addr;
++}
++
++static void rb4xx_nand_read_data(uint8_t *buf, unsigned cnt)
++{
++ unsigned size32 = cnt & ~31;
++ unsigned remain = cnt & 31;
++
++ if (size32) {
++ uint8_t *addr = rb4xx_nand_read_getaddr(size32);
++ memcpy(buf, (void *)addr, size32);
++ }
++
++ if (remain) {
++ do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, remain,
++ buf + size32, NULL, 0);
++ }
++}
++
++static int rb4xx_nand_verify_data(const uint8_t *buf, unsigned cnt)
++{
++ unsigned size32 = cnt & ~31;
++ unsigned remain = cnt & 31;
++
++ if (size32) {
++ uint8_t *addr = rb4xx_nand_read_getaddr(size32);
++ if (memcmp(buf, (void *)addr, size32) != 0)
++ return 0;
++ }
++
++ if (remain) {
++ return do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, remain,
++ NULL, buf + size32, 0);
++ }
++ return 1;
++}
++#else /* USE_FAST_READ */
++static void rb4xx_nand_read_data(uint8_t *buf, unsigned cnt)
++{
++ do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, cnt, buf, NULL, 0);
++}
++
++static int rb4xx_nand_verify_data(const uint8_t *buf, unsigned cnt)
++{
++ return do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, cnt, NULL, buf, 0);
++}
++#endif /* USE_FAST_READ */
++
++static void rb4xx_nand_write_cfg(uint8_t byte)
++{
++ do_spi_cmd(CPLD_CMD_WRITE_CFG, 1, &byte, 0, NULL, NULL, 0);
++ got_write = 1;
++}
++
++static int rb4xx_nand_dev_ready(struct mtd_info *mtd)
++{
++ return gpio_get_value(RB4XX_NAND_GPIO_RDY);
++}
++
++static void rb4xx_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
++ unsigned int ctrl)
++{
++ if (ctrl & NAND_CTRL_CHANGE) {
++ uint8_t cfg = CFG_BIT_nLEDS;
++
++ cfg |= (ctrl & NAND_CLE) ? CFG_BIT_CLE : 0;
++ cfg |= (ctrl & NAND_ALE) ? CFG_BIT_ALE : 0;
++ cfg |= (ctrl & NAND_NCE) ? 0 : CFG_BIT_nCE;
++
++ rb4xx_nand_write_cfg(cfg);
++ }
++
++ if (cmd != NAND_CMD_NONE)
++ rb4xx_nand_write_byte(cmd);
++}
++
++static uint8_t rb4xx_nand_read_byte(struct mtd_info *mtd)
++{
++ uint8_t byte = 0;
++
++ rb4xx_nand_read_data(&byte, 1);
++ return byte;
++}
++
++static void rb4xx_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf,
++ int len)
++{
++ rb4xx_nand_write_data(buf, len);
++}
++
++static void rb4xx_nand_read_buf(struct mtd_info *mtd, uint8_t *buf,
++ int len)
++{
++ rb4xx_nand_read_data(buf, len);
++}
++
++static int rb4xx_nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf,
++ int len)
++{
++ if (!rb4xx_nand_verify_data(buf, len))
++ return -EFAULT;
++
++ return 0;
++}
++
++static unsigned get_spi_ctrl(unsigned hz_max, const char *name)
++{
++ unsigned div;
++
++ div = (ar71xx_ahb_freq - 1) / (2 * hz_max);
++ /*
++ * CPU has a bug at (div == 0) - first bit read is random
++ */
++ if (div == 0)
++ ++div;
++
++ if (name) {
++ unsigned ahb_khz = (ar71xx_ahb_freq + 500) / 1000;
++ unsigned div_real = 2 * (div + 1);
++ printk(KERN_INFO "%s SPI clock %u kHz (AHB %u kHz / %u)\n",
++ name,
++ ahb_khz / div_real,
++ ahb_khz, div_real);
++ }
++
++ return SPI_CTRL_FASTEST + div;
++}
++
++static int __init rb4xx_nand_probe(struct platform_device *pdev)
++{
++ struct rb4xx_nand_info *info;
++ int ret;
++
++ printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
++
++ ret = gpio_request(RB4XX_NAND_GPIO_RDY, "NAND RDY");
++ if (ret) {
++ printk(KERN_ERR "rb4xx-nand: gpio request failed\n");
++ return ret;
++ }
++
++ ret = gpio_direction_input(RB4XX_NAND_GPIO_RDY);
++ if (ret) {
++ printk(KERN_ERR "rb4xx-nand: unable to set input mode "
++ "on gpio%d\n", RB4XX_NAND_GPIO_RDY);
++ goto err_free_gpio;
++ }
++
++ info = kzalloc(sizeof(*info), GFP_KERNEL);
++ if (!info) {
++ printk(KERN_ERR "rb4xx-nand: no memory for private data\n");
++ ret = -ENOMEM;
++ goto err_free_gpio;
++ }
++
++#if USE_FAST_READ
++ spi_ctrl_fread = get_spi_ctrl(RB4XX_NAND_HZ, "NAND");
++#endif
++ spi_ctrl_flash = get_spi_ctrl(RB4XX_FLASH_HZ, "FLASH");
++
++ rb4xx_nand_write_cfg(CFG_BIT_nLEDS | CFG_BIT_nCE);
++
++ info->chip.priv = &info;
++ info->mtd.priv = &info->chip;
++ info->mtd.owner = THIS_MODULE;
++
++ info->chip.cmd_ctrl = rb4xx_nand_cmd_ctrl;
++ info->chip.dev_ready = rb4xx_nand_dev_ready;
++ info->chip.read_byte = rb4xx_nand_read_byte;
++ info->chip.write_buf = rb4xx_nand_write_buf;
++ info->chip.read_buf = rb4xx_nand_read_buf;
++ info->chip.verify_buf = rb4xx_nand_verify_buf;
++
++ info->chip.chip_delay = 25;
++ info->chip.ecc.mode = NAND_ECC_SOFT;
++ info->chip.options |= NAND_NO_AUTOINCR;
++
++ platform_set_drvdata(pdev, info);
++
++ ret = nand_scan_ident(&info->mtd, 1);
++ if (ret) {
++ ret = -ENXIO;
++ goto err_free_info;
++ }
++
++ if (info->mtd.writesize == 512)
++ info->chip.ecc.layout = &rb4xx_nand_ecclayout;
++
++ ret = nand_scan_tail(&info->mtd);
++ if (ret) {
++ return -ENXIO;
++ goto err_set_drvdata;
++ }
++
++#ifdef CONFIG_MTD_PARTITIONS
++ ret = add_mtd_partitions(&info->mtd, rb4xx_nand_partitions,
++ ARRAY_SIZE(rb4xx_nand_partitions));
++#else
++ ret = add_mtd_device(&info->mtd);
++#endif
++ if (ret)
++ goto err_release_nand;
++
++ return 0;
++
++err_release_nand:
++ nand_release(&info->mtd);
++err_set_drvdata:
++ platform_set_drvdata(pdev, NULL);
++err_free_info:
++ kfree(info);
++err_free_gpio:
++ gpio_free(RB4XX_NAND_GPIO_RDY);
++ return ret;
++}
++
++static int __devexit rb4xx_nand_remove(struct platform_device *pdev)
++{
++ struct rb4xx_nand_info *info = platform_get_drvdata(pdev);
++
++ nand_release(&info->mtd);
++ platform_set_drvdata(pdev, NULL);
++ kfree(info);
++
++ return 0;
++}
++
++static struct platform_driver rb4xx_nand_driver = {
++ .probe = rb4xx_nand_probe,
++ .remove = __devexit_p(rb4xx_nand_remove),
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init rb4xx_nand_init(void)
++{
++ return platform_driver_register(&rb4xx_nand_driver);
++}
++
++static void __exit rb4xx_nand_exit(void)
++{
++ platform_driver_unregister(&rb4xx_nand_driver);
++}
++
++module_init(rb4xx_nand_init);
++module_exit(rb4xx_nand_exit);
++
++MODULE_DESCRIPTION(DRV_DESC);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-2.6.29.1.orig/drivers/net/Kconfig linux-2.6.29.1/drivers/net/Kconfig
+--- linux-2.6.29.1.orig/drivers/net/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/Kconfig 2009-04-13 14:27:34.763080366 +0200
+@@ -1945,6 +1945,8 @@
+
+ The safe and default value for this is N.
+
++source drivers/net/ag71xx/Kconfig
++
+ config DL2K
+ tristate "DL2000/TC902x-based Gigabit Ethernet support"
+ depends on PCI
+diff -Nur linux-2.6.29.1.orig/drivers/net/Makefile linux-2.6.29.1/drivers/net/Makefile
+--- linux-2.6.29.1.orig/drivers/net/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/Makefile 2009-04-13 14:27:34.767081713 +0200
+@@ -2,6 +2,7 @@
+ # Makefile for the Linux network (ethercard) device drivers.
+ #
+
++obj-$(CONFIG_AG71XX) += ag71xx/
+ obj-$(CONFIG_E1000) += e1000/
+ obj-$(CONFIG_E1000E) += e1000e/
+ obj-$(CONFIG_IBM_NEW_EMAC) += ibm_newemac/
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/Kconfig linux-2.6.29.1/drivers/net/ag71xx/Kconfig
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/Kconfig 2009-04-13 14:27:34.767081713 +0200
+@@ -0,0 +1,23 @@
++config AG71XX
++ tristate "Atheros AR71xx built-in ethernet mac support"
++ depends on ATHEROS_AR71XX
++ select PHYLIB
++ help
++ If you wish to compile a kernel for AR71xx/91xx and enable
++ ethernet support, then you should always answer Y to this.
++
++config AG71XX_DEBUG
++ bool "Atheros AR71xx built-in ethernet driver debugging"
++ depends on AG71XX
++ default n
++ help
++ Atheros AR71xx built-in ethernet driver debugging messages.
++
++config AG71XX_AR8216_SUPPORT
++ bool "special support for the Atheros AR8216 switch"
++ depends on AG71XX
++ default n
++ default y if AR71XX_MACH_WNR2000 || AR71XX_MACH_MZK_W04NU
++ help
++ Say 'y' here if you want to enable special support for the
++ Atheros AR8216 switch found on some boards.
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/Makefile linux-2.6.29.1/drivers/net/ag71xx/Makefile
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/Makefile 2009-04-13 14:27:34.771082502 +0200
+@@ -0,0 +1,13 @@
++#
++# Makefile for the Atheros AR71xx built-in ethernet macs
++#
++
++ag71xx-y += ag71xx_main.o
++ag71xx-y += ag71xx_ethtool.o
++ag71xx-y += ag71xx_phy.o
++ag71xx-y += ag71xx_mdio.o
++
++ag71xx-$(CONFIG_AG71XX_AR8216_SUPPORT) += ag71xx_ar8216.o
++
++obj-$(CONFIG_AG71XX) += ag71xx.o
++
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx.h linux-2.6.29.1/drivers/net/ag71xx/ag71xx.h
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx.h 2009-04-13 14:27:34.799084111 +0200
+@@ -0,0 +1,449 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __AG71XX_H
++#define __AG71XX_H
++
++#include <linux/kernel.h>
++#include <linux/version.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/types.h>
++#include <linux/random.h>
++#include <linux/spinlock.h>
++#include <linux/interrupt.h>
++#include <linux/platform_device.h>
++#include <linux/ethtool.h>
++#include <linux/etherdevice.h>
++#include <linux/phy.h>
++#include <linux/skbuff.h>
++#include <linux/dma-mapping.h>
++#include <linux/workqueue.h>
++
++#include <linux/bitops.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/platform.h>
++
++#define ETH_FCS_LEN 4
++
++#define AG71XX_DRV_NAME "ag71xx"
++#define AG71XX_DRV_VERSION "0.5.21"
++
++#define AG71XX_NAPI_WEIGHT 64
++#define AG71XX_OOM_REFILL (1 + HZ/10)
++
++#define AG71XX_INT_ERR (AG71XX_INT_RX_BE | AG71XX_INT_TX_BE)
++#define AG71XX_INT_TX (AG71XX_INT_TX_PS)
++#define AG71XX_INT_RX (AG71XX_INT_RX_PR | AG71XX_INT_RX_OF)
++
++#define AG71XX_INT_POLL (AG71XX_INT_RX | AG71XX_INT_TX)
++#define AG71XX_INT_INIT (AG71XX_INT_ERR | AG71XX_INT_POLL)
++
++#define AG71XX_TX_FIFO_LEN 2048
++#define AG71XX_TX_MTU_LEN 1536
++#define AG71XX_RX_PKT_RESERVE 64
++#define AG71XX_RX_PKT_SIZE \
++ (AG71XX_RX_PKT_RESERVE + ETH_HLEN + ETH_FRAME_LEN + ETH_FCS_LEN)
++
++#define AG71XX_TX_RING_SIZE 64
++#define AG71XX_TX_THRES_STOP (AG71XX_TX_RING_SIZE - 4)
++#define AG71XX_TX_THRES_WAKEUP \
++ (AG71XX_TX_RING_SIZE - (AG71XX_TX_RING_SIZE / 4))
++
++#define AG71XX_RX_RING_SIZE 128
++
++#ifdef CONFIG_AG71XX_DEBUG
++#define DBG(fmt, args...) printk(KERN_DEBUG fmt, ## args)
++#else
++#define DBG(fmt, args...) do {} while (0)
++#endif
++
++#define ag71xx_assert(_cond) \
++do { \
++ if (_cond) \
++ break; \
++ printk("%s,%d: assertion failed\n", __FILE__, __LINE__); \
++ BUG(); \
++} while (0)
++
++struct ag71xx_desc {
++ u32 data;
++ u32 ctrl;
++#define DESC_EMPTY BIT(31)
++#define DESC_MORE BIT(24)
++#define DESC_PKTLEN_M 0x1fff
++ u32 next;
++ u32 pad;
++};
++
++struct ag71xx_buf {
++ struct sk_buff *skb;
++};
++
++struct ag71xx_ring {
++ struct ag71xx_buf *buf;
++ struct ag71xx_desc *descs;
++ dma_addr_t descs_dma;
++ unsigned int curr;
++ unsigned int dirty;
++ unsigned int size;
++};
++
++struct ag71xx_mdio {
++ struct mii_bus *mii_bus;
++ int mii_irq[PHY_MAX_ADDR];
++ void __iomem *mdio_base;
++};
++
++struct ag71xx {
++ void __iomem *mac_base;
++ void __iomem *mac_base2;
++ void __iomem *mii_ctrl;
++
++ spinlock_t lock;
++ struct platform_device *pdev;
++ struct net_device *dev;
++ struct napi_struct napi;
++ u32 msg_enable;
++
++ struct ag71xx_ring rx_ring;
++ struct ag71xx_ring tx_ring;
++
++ struct mii_bus *mii_bus;
++ struct phy_device *phy_dev;
++
++ unsigned int link;
++ unsigned int speed;
++ int duplex;
++
++ struct work_struct restart_work;
++ struct timer_list oom_timer;
++};
++
++extern struct ethtool_ops ag71xx_ethtool_ops;
++
++extern struct ag71xx_mdio *ag71xx_mdio_bus;
++extern int ag71xx_mdio_driver_init(void) __init;
++extern void ag71xx_mdio_driver_exit(void);
++
++extern int ag71xx_phy_connect(struct ag71xx *ag);
++extern void ag71xx_phy_disconnect(struct ag71xx *ag);
++extern void ag71xx_phy_start(struct ag71xx *ag);
++extern void ag71xx_phy_stop(struct ag71xx *ag);
++
++static inline struct ag71xx_platform_data *ag71xx_get_pdata(struct ag71xx *ag)
++{
++ return ag->pdev->dev.platform_data;
++}
++
++static inline int ag71xx_desc_empty(struct ag71xx_desc *desc)
++{
++ return ((desc->ctrl & DESC_EMPTY) != 0);
++}
++
++static inline int ag71xx_desc_pktlen(struct ag71xx_desc *desc)
++{
++ return (desc->ctrl & DESC_PKTLEN_M);
++}
++
++/* Register offsets */
++#define AG71XX_REG_MAC_CFG1 0x0000
++#define AG71XX_REG_MAC_CFG2 0x0004
++#define AG71XX_REG_MAC_IPG 0x0008
++#define AG71XX_REG_MAC_HDX 0x000c
++#define AG71XX_REG_MAC_MFL 0x0010
++#define AG71XX_REG_MII_CFG 0x0020
++#define AG71XX_REG_MII_CMD 0x0024
++#define AG71XX_REG_MII_ADDR 0x0028
++#define AG71XX_REG_MII_CTRL 0x002c
++#define AG71XX_REG_MII_STATUS 0x0030
++#define AG71XX_REG_MII_IND 0x0034
++#define AG71XX_REG_MAC_IFCTL 0x0038
++#define AG71XX_REG_MAC_ADDR1 0x0040
++#define AG71XX_REG_MAC_ADDR2 0x0044
++#define AG71XX_REG_FIFO_CFG0 0x0048
++#define AG71XX_REG_FIFO_CFG1 0x004c
++#define AG71XX_REG_FIFO_CFG2 0x0050
++#define AG71XX_REG_FIFO_CFG3 0x0054
++#define AG71XX_REG_FIFO_CFG4 0x0058
++#define AG71XX_REG_FIFO_CFG5 0x005c
++#define AG71XX_REG_FIFO_RAM0 0x0060
++#define AG71XX_REG_FIFO_RAM1 0x0064
++#define AG71XX_REG_FIFO_RAM2 0x0068
++#define AG71XX_REG_FIFO_RAM3 0x006c
++#define AG71XX_REG_FIFO_RAM4 0x0070
++#define AG71XX_REG_FIFO_RAM5 0x0074
++#define AG71XX_REG_FIFO_RAM6 0x0078
++#define AG71XX_REG_FIFO_RAM7 0x007c
++
++#define AG71XX_REG_TX_CTRL 0x0180
++#define AG71XX_REG_TX_DESC 0x0184
++#define AG71XX_REG_TX_STATUS 0x0188
++#define AG71XX_REG_RX_CTRL 0x018c
++#define AG71XX_REG_RX_DESC 0x0190
++#define AG71XX_REG_RX_STATUS 0x0194
++#define AG71XX_REG_INT_ENABLE 0x0198
++#define AG71XX_REG_INT_STATUS 0x019c
++
++#define MAC_CFG1_TXE BIT(0) /* Tx Enable */
++#define MAC_CFG1_STX BIT(1) /* Synchronize Tx Enable */
++#define MAC_CFG1_RXE BIT(2) /* Rx Enable */
++#define MAC_CFG1_SRX BIT(3) /* Synchronize Rx Enable */
++#define MAC_CFG1_TFC BIT(4) /* Tx Flow Control Enable */
++#define MAC_CFG1_RFC BIT(5) /* Rx Flow Control Enable */
++#define MAC_CFG1_LB BIT(8) /* Loopback mode */
++#define MAC_CFG1_SR BIT(31) /* Soft Reset */
++
++#define MAC_CFG2_FDX BIT(0)
++#define MAC_CFG2_CRC_EN BIT(1)
++#define MAC_CFG2_PAD_CRC_EN BIT(2)
++#define MAC_CFG2_LEN_CHECK BIT(4)
++#define MAC_CFG2_HUGE_FRAME_EN BIT(5)
++#define MAC_CFG2_IF_1000 BIT(9)
++#define MAC_CFG2_IF_10_100 BIT(8)
++
++#define FIFO_CFG0_WTM BIT(0) /* Watermark Module */
++#define FIFO_CFG0_RXS BIT(1) /* Rx System Module */
++#define FIFO_CFG0_RXF BIT(2) /* Rx Fabric Module */
++#define FIFO_CFG0_TXS BIT(3) /* Tx System Module */
++#define FIFO_CFG0_TXF BIT(4) /* Tx Fabric Module */
++#define FIFO_CFG0_ALL (FIFO_CFG0_WTM | FIFO_CFG0_RXS | FIFO_CFG0_RXF \
++ | FIFO_CFG0_TXS | FIFO_CFG0_TXF)
++
++#define FIFO_CFG0_ENABLE_SHIFT 8
++
++#define FIFO_CFG4_DE BIT(0) /* Drop Event */
++#define FIFO_CFG4_DV BIT(1) /* RX_DV Event */
++#define FIFO_CFG4_FC BIT(2) /* False Carrier */
++#define FIFO_CFG4_CE BIT(3) /* Code Error */
++#define FIFO_CFG4_CR BIT(4) /* CRC error */
++#define FIFO_CFG4_LM BIT(5) /* Length Mismatch */
++#define FIFO_CFG4_LO BIT(6) /* Length out of range */
++#define FIFO_CFG4_OK BIT(7) /* Packet is OK */
++#define FIFO_CFG4_MC BIT(8) /* Multicast Packet */
++#define FIFO_CFG4_BC BIT(9) /* Broadcast Packet */
++#define FIFO_CFG4_DR BIT(10) /* Dribble */
++#define FIFO_CFG4_LE BIT(11) /* Long Event */
++#define FIFO_CFG4_CF BIT(12) /* Control Frame */
++#define FIFO_CFG4_PF BIT(13) /* Pause Frame */
++#define FIFO_CFG4_UO BIT(14) /* Unsupported Opcode */
++#define FIFO_CFG4_VT BIT(15) /* VLAN tag detected */
++#define FIFO_CFG4_FT BIT(16) /* Frame Truncated */
++#define FIFO_CFG4_UC BIT(17) /* Unicast Packet */
++
++#define FIFO_CFG5_DE BIT(0) /* Drop Event */
++#define FIFO_CFG5_DV BIT(1) /* RX_DV Event */
++#define FIFO_CFG5_FC BIT(2) /* False Carrier */
++#define FIFO_CFG5_CE BIT(3) /* Code Error */
++#define FIFO_CFG5_LM BIT(4) /* Length Mismatch */
++#define FIFO_CFG5_LO BIT(5) /* Length Out of Range */
++#define FIFO_CFG5_OK BIT(6) /* Packet is OK */
++#define FIFO_CFG5_MC BIT(7) /* Multicast Packet */
++#define FIFO_CFG5_BC BIT(8) /* Broadcast Packet */
++#define FIFO_CFG5_DR BIT(9) /* Dribble */
++#define FIFO_CFG5_CF BIT(10) /* Control Frame */
++#define FIFO_CFG5_PF BIT(11) /* Pause Frame */
++#define FIFO_CFG5_UO BIT(12) /* Unsupported Opcode */
++#define FIFO_CFG5_VT BIT(13) /* VLAN tag detected */
++#define FIFO_CFG5_LE BIT(14) /* Long Event */
++#define FIFO_CFG5_FT BIT(15) /* Frame Truncated */
++#define FIFO_CFG5_16 BIT(16) /* unknown */
++#define FIFO_CFG5_17 BIT(17) /* unknown */
++#define FIFO_CFG5_SF BIT(18) /* Short Frame */
++#define FIFO_CFG5_BM BIT(19) /* Byte Mode */
++
++#define AG71XX_INT_TX_PS BIT(0)
++#define AG71XX_INT_TX_UR BIT(1)
++#define AG71XX_INT_TX_BE BIT(3)
++#define AG71XX_INT_RX_PR BIT(4)
++#define AG71XX_INT_RX_OF BIT(6)
++#define AG71XX_INT_RX_BE BIT(7)
++
++#define MAC_IFCTL_SPEED BIT(16)
++
++#define MII_CFG_CLK_DIV_4 0
++#define MII_CFG_CLK_DIV_6 2
++#define MII_CFG_CLK_DIV_8 3
++#define MII_CFG_CLK_DIV_10 4
++#define MII_CFG_CLK_DIV_14 5
++#define MII_CFG_CLK_DIV_20 6
++#define MII_CFG_CLK_DIV_28 7
++#define MII_CFG_RESET BIT(31)
++
++#define MII_CMD_WRITE 0x0
++#define MII_CMD_READ 0x1
++#define MII_ADDR_SHIFT 8
++#define MII_IND_BUSY BIT(0)
++#define MII_IND_INVALID BIT(2)
++
++#define TX_CTRL_TXE BIT(0) /* Tx Enable */
++
++#define TX_STATUS_PS BIT(0) /* Packet Sent */
++#define TX_STATUS_UR BIT(1) /* Tx Underrun */
++#define TX_STATUS_BE BIT(3) /* Bus Error */
++
++#define RX_CTRL_RXE BIT(0) /* Rx Enable */
++
++#define RX_STATUS_PR BIT(0) /* Packet Received */
++#define RX_STATUS_OF BIT(2) /* Rx Overflow */
++#define RX_STATUS_BE BIT(3) /* Bus Error */
++
++#define MII_CTRL_IF_MASK 3
++#define MII_CTRL_SPEED_SHIFT 4
++#define MII_CTRL_SPEED_MASK 3
++#define MII_CTRL_SPEED_10 0
++#define MII_CTRL_SPEED_100 1
++#define MII_CTRL_SPEED_1000 2
++
++static inline void ag71xx_wr(struct ag71xx *ag, unsigned reg, u32 value)
++{
++ void __iomem *r;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ __raw_writel(value, r);
++ __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ __raw_writel(value, r);
++ __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++}
++
++static inline u32 ag71xx_rr(struct ag71xx *ag, unsigned reg)
++{
++ void __iomem *r;
++ u32 ret;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ ret = __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ ret = __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++
++ return ret;
++}
++
++static inline void ag71xx_sb(struct ag71xx *ag, unsigned reg, u32 mask)
++{
++ void __iomem *r;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ __raw_writel(__raw_readl(r) | mask, r);
++ __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ __raw_writel(__raw_readl(r) | mask, r);
++ __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++}
++
++static inline void ag71xx_cb(struct ag71xx *ag, unsigned reg, u32 mask)
++{
++ void __iomem *r;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ __raw_writel(__raw_readl(r) & ~mask, r);
++ __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ __raw_writel(__raw_readl(r) & ~mask, r);
++ __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++}
++
++static inline void ag71xx_int_enable(struct ag71xx *ag, u32 ints)
++{
++ ag71xx_sb(ag, AG71XX_REG_INT_ENABLE, ints);
++}
++
++static inline void ag71xx_int_disable(struct ag71xx *ag, u32 ints)
++{
++ ag71xx_cb(ag, AG71XX_REG_INT_ENABLE, ints);
++}
++
++static inline void ag71xx_mii_ctrl_wr(struct ag71xx *ag, u32 value)
++{
++ __raw_writel(value, ag->mii_ctrl);
++ __raw_readl(ag->mii_ctrl);
++}
++
++static inline u32 ag71xx_mii_ctrl_rr(struct ag71xx *ag)
++{
++ return __raw_readl(ag->mii_ctrl);
++}
++
++static void inline ag71xx_mii_ctrl_set_if(struct ag71xx *ag,
++ unsigned int mii_if)
++{
++ u32 t;
++
++ t = ag71xx_mii_ctrl_rr(ag);
++ t &= ~(MII_CTRL_IF_MASK);
++ t |= (mii_if & MII_CTRL_IF_MASK);
++ ag71xx_mii_ctrl_wr(ag, t);
++}
++
++static void inline ag71xx_mii_ctrl_set_speed(struct ag71xx *ag,
++ unsigned int speed)
++{
++ u32 t;
++
++ t = ag71xx_mii_ctrl_rr(ag);
++ t &= ~(MII_CTRL_SPEED_MASK << MII_CTRL_SPEED_SHIFT);
++ t |= (speed & MII_CTRL_SPEED_MASK) << MII_CTRL_SPEED_SHIFT;
++ ag71xx_mii_ctrl_wr(ag, t);
++}
++
++#ifdef CONFIG_AG71XX_AR8216_SUPPORT
++void ag71xx_add_ar8216_header(struct ag71xx *ag, struct sk_buff *skb);
++int ag71xx_remove_ar8216_header(struct ag71xx *ag, struct sk_buff *skb);
++#else
++static inline void ag71xx_add_ar8216_header(struct ag71xx *ag,
++ struct sk_buff *skb)
++{
++}
++
++static inline int ag71xx_remove_ar8216_header(struct ag71xx *ag,
++ struct sk_buff *skb)
++{
++ return 0;
++}
++#endif
++
++#endif /* _AG71XX_H */
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ar8216.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ar8216.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ar8216.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ar8216.c 2009-04-13 14:27:34.803084620 +0200
+@@ -0,0 +1,53 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ * Special support for the Atheros ar8216 switch chip
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++#define AR8216_PACKET_TYPE_MASK 0xf
++#define AR8216_PACKET_TYPE_NORMAL 0
++
++#define AR8216_HEADER_LEN 2
++
++void ag71xx_add_ar8216_header(struct ag71xx *ag, struct sk_buff *skb)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ if (!pdata->has_ar8216)
++ return;
++
++ skb_push(skb, AR8216_HEADER_LEN);
++ skb->data[0] = 0x10;
++ skb->data[1] = 0x80;
++}
++
++int ag71xx_remove_ar8216_header(struct ag71xx *ag,
++ struct sk_buff *skb)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ u8 type;
++
++ if (!pdata->has_ar8216)
++ return 0;
++
++ type = skb->data[1] & AR8216_PACKET_TYPE_MASK;
++
++ switch (type) {
++ case AR8216_PACKET_TYPE_NORMAL:
++ skb_pull(skb, AR8216_HEADER_LEN);
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ return 0;
++}
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ethtool.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ethtool.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ethtool.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ethtool.c 2009-04-13 14:27:34.803084620 +0200
+@@ -0,0 +1,71 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++static int ag71xx_ethtool_get_settings(struct net_device *dev,
++ struct ethtool_cmd *cmd)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct phy_device *phydev = ag->phy_dev;
++
++ if (!phydev)
++ return -ENODEV;
++
++ return phy_ethtool_gset(phydev, cmd);
++}
++
++static int ag71xx_ethtool_set_settings(struct net_device *dev,
++ struct ethtool_cmd *cmd)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct phy_device *phydev = ag->phy_dev;
++
++ if (!phydev)
++ return -ENODEV;
++
++ return phy_ethtool_sset(phydev, cmd);
++}
++
++static void ag71xx_ethtool_get_drvinfo(struct net_device *dev,
++ struct ethtool_drvinfo *info)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ strcpy(info->driver, ag->pdev->dev.driver->name);
++ strcpy(info->version, AG71XX_DRV_VERSION);
++ strcpy(info->bus_info, ag->pdev->dev.bus_id);
++}
++
++static u32 ag71xx_ethtool_get_msglevel(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ return ag->msg_enable;
++}
++
++static void ag71xx_ethtool_set_msglevel(struct net_device *dev, u32 msg_level)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ ag->msg_enable = msg_level;
++}
++
++struct ethtool_ops ag71xx_ethtool_ops = {
++ .set_settings = ag71xx_ethtool_set_settings,
++ .get_settings = ag71xx_ethtool_get_settings,
++ .get_drvinfo = ag71xx_ethtool_get_drvinfo,
++ .get_msglevel = ag71xx_ethtool_get_msglevel,
++ .set_msglevel = ag71xx_ethtool_set_msglevel,
++ .get_link = ethtool_op_get_link,
++};
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_main.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_main.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_main.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_main.c 2009-04-13 18:00:36.641934324 +0200
+@@ -0,0 +1,990 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++#define AG71XX_DEFAULT_MSG_ENABLE \
++ ( NETIF_MSG_DRV \
++ | NETIF_MSG_PROBE \
++ | NETIF_MSG_LINK \
++ | NETIF_MSG_TIMER \
++ | NETIF_MSG_IFDOWN \
++ | NETIF_MSG_IFUP \
++ | NETIF_MSG_RX_ERR \
++ | NETIF_MSG_TX_ERR )
++
++static int ag71xx_debug = -1;
++
++module_param(ag71xx_debug, int, 0);
++MODULE_PARM_DESC(ag71xx_debug, "Debug level (-1=defaults,0=none,...,16=all)");
++
++static void ag71xx_dump_dma_regs(struct ag71xx *ag)
++{
++ DBG("%s: dma_tx_ctrl=%08x, dma_tx_desc=%08x, dma_tx_status=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_TX_CTRL),
++ ag71xx_rr(ag, AG71XX_REG_TX_DESC),
++ ag71xx_rr(ag, AG71XX_REG_TX_STATUS));
++
++ DBG("%s: dma_rx_ctrl=%08x, dma_rx_desc=%08x, dma_rx_status=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_RX_CTRL),
++ ag71xx_rr(ag, AG71XX_REG_RX_DESC),
++ ag71xx_rr(ag, AG71XX_REG_RX_STATUS));
++}
++
++static void ag71xx_dump_regs(struct ag71xx *ag)
++{
++ DBG("%s: mac_cfg1=%08x, mac_cfg2=%08x, ipg=%08x, hdx=%08x, mfl=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_MAC_CFG1),
++ ag71xx_rr(ag, AG71XX_REG_MAC_CFG2),
++ ag71xx_rr(ag, AG71XX_REG_MAC_IPG),
++ ag71xx_rr(ag, AG71XX_REG_MAC_HDX),
++ ag71xx_rr(ag, AG71XX_REG_MAC_MFL));
++ DBG("%s: mac_ifctl=%08x, mac_addr1=%08x, mac_addr2=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL),
++ ag71xx_rr(ag, AG71XX_REG_MAC_ADDR1),
++ ag71xx_rr(ag, AG71XX_REG_MAC_ADDR2));
++ DBG("%s: fifo_cfg0=%08x, fifo_cfg1=%08x, fifo_cfg2=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG0),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG1),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG2));
++ DBG("%s: fifo_cfg3=%08x, fifo_cfg4=%08x, fifo_cfg5=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG3),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG4),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
++}
++
++static inline void ag71xx_dump_intr(struct ag71xx *ag, char *label, u32 intr)
++{
++ DBG("%s: %s intr=%08x %s%s%s%s%s%s\n",
++ ag->dev->name, label, intr,
++ (intr & AG71XX_INT_TX_PS) ? "TXPS " : "",
++ (intr & AG71XX_INT_TX_UR) ? "TXUR " : "",
++ (intr & AG71XX_INT_TX_BE) ? "TXBE " : "",
++ (intr & AG71XX_INT_RX_PR) ? "RXPR " : "",
++ (intr & AG71XX_INT_RX_OF) ? "RXOF " : "",
++ (intr & AG71XX_INT_RX_BE) ? "RXBE " : "");
++}
++
++static void ag71xx_ring_free(struct ag71xx_ring *ring)
++{
++ kfree(ring->buf);
++
++ if (ring->descs)
++ dma_free_coherent(NULL, ring->size * sizeof(*ring->descs),
++ ring->descs, ring->descs_dma);
++}
++
++static int ag71xx_ring_alloc(struct ag71xx_ring *ring, unsigned int size)
++{
++ int err;
++
++ ring->descs = dma_alloc_coherent(NULL, size * sizeof(*ring->descs),
++ &ring->descs_dma,
++ GFP_ATOMIC);
++ if (!ring->descs) {
++ err = -ENOMEM;
++ goto err;
++ }
++
++ ring->size = size;
++
++ ring->buf = kzalloc(size * sizeof(*ring->buf), GFP_KERNEL);
++ if (!ring->buf) {
++ err = -ENOMEM;
++ goto err;
++ }
++
++ return 0;
++
++ err:
++ return err;
++}
++
++static void ag71xx_ring_tx_clean(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ struct net_device *dev = ag->dev;
++
++ while (ring->curr != ring->dirty) {
++ u32 i = ring->dirty % AG71XX_TX_RING_SIZE;
++
++ if (!ag71xx_desc_empty(&ring->descs[i])) {
++ ring->descs[i].ctrl = 0;
++ dev->stats.tx_errors++;
++ }
++
++ if (ring->buf[i].skb)
++ dev_kfree_skb_any(ring->buf[i].skb);
++
++ ring->buf[i].skb = NULL;
++
++ ring->dirty++;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++}
++
++static void ag71xx_ring_tx_init(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ int i;
++
++ for (i = 0; i < AG71XX_TX_RING_SIZE; i++) {
++ ring->descs[i].next = (u32) (ring->descs_dma +
++ sizeof(*ring->descs) * ((i + 1) % AG71XX_TX_RING_SIZE));
++
++ ring->descs[i].ctrl = DESC_EMPTY;
++ ring->buf[i].skb = NULL;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++ ring->curr = 0;
++ ring->dirty = 0;
++}
++
++static void ag71xx_ring_rx_clean(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ int i;
++
++ if (!ring->buf)
++ return;
++
++ for (i = 0; i < AG71XX_RX_RING_SIZE; i++)
++ if (ring->buf[i].skb)
++ kfree_skb(ring->buf[i].skb);
++
++}
++
++static int ag71xx_ring_rx_init(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ unsigned int i;
++ int ret;
++
++ ret = 0;
++ for (i = 0; i < AG71XX_RX_RING_SIZE; i++)
++ ring->descs[i].next = (u32) (ring->descs_dma +
++ sizeof(*ring->descs) * ((i + 1) % AG71XX_RX_RING_SIZE));
++
++ for (i = 0; i < AG71XX_RX_RING_SIZE; i++) {
++ struct sk_buff *skb;
++
++ skb = dev_alloc_skb(AG71XX_RX_PKT_SIZE);
++ if (!skb) {
++ ret = -ENOMEM;
++ break;
++ }
++
++ dma_map_single(NULL, skb->data, AG71XX_RX_PKT_SIZE,
++ DMA_FROM_DEVICE);
++
++ skb->dev = ag->dev;
++ skb_reserve(skb, AG71XX_RX_PKT_RESERVE);
++
++ ring->buf[i].skb = skb;
++ ring->descs[i].data = virt_to_phys(skb->data);
++ ring->descs[i].ctrl = DESC_EMPTY;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++ ring->curr = 0;
++ ring->dirty = 0;
++
++ return ret;
++}
++
++static int ag71xx_ring_rx_refill(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ unsigned int count;
++
++ count = 0;
++ for (; ring->curr - ring->dirty > 0; ring->dirty++) {
++ unsigned int i;
++
++ i = ring->dirty % AG71XX_RX_RING_SIZE;
++
++ if (ring->buf[i].skb == NULL) {
++ struct sk_buff *skb;
++
++ skb = dev_alloc_skb(AG71XX_RX_PKT_SIZE);
++ if (skb == NULL)
++ break;
++
++ dma_map_single(NULL, skb->data, AG71XX_RX_PKT_SIZE,
++ DMA_FROM_DEVICE);
++
++ skb_reserve(skb, AG71XX_RX_PKT_RESERVE);
++ skb->dev = ag->dev;
++
++ ring->buf[i].skb = skb;
++ ring->descs[i].data = virt_to_phys(skb->data);
++ }
++
++ ring->descs[i].ctrl = DESC_EMPTY;
++ count++;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++ DBG("%s: %u rx descriptors refilled\n", ag->dev->name, count);
++
++ return count;
++}
++
++static int ag71xx_rings_init(struct ag71xx *ag)
++{
++ int ret;
++
++ ret = ag71xx_ring_alloc(&ag->tx_ring, AG71XX_TX_RING_SIZE);
++ if (ret)
++ return ret;
++
++ ag71xx_ring_tx_init(ag);
++
++ ret = ag71xx_ring_alloc(&ag->rx_ring, AG71XX_RX_RING_SIZE);
++ if (ret)
++ return ret;
++
++ ret = ag71xx_ring_rx_init(ag);
++ return ret;
++}
++
++static void ag71xx_rings_cleanup(struct ag71xx *ag)
++{
++ ag71xx_ring_rx_clean(ag);
++ ag71xx_ring_free(&ag->rx_ring);
++
++ ag71xx_ring_tx_clean(ag);
++ ag71xx_ring_free(&ag->tx_ring);
++}
++
++static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
++{
++ u32 t;
++
++ t = (((u32) mac[0]) << 24) | (((u32) mac[1]) << 16)
++ | (((u32) mac[2]) << 8) | ((u32) mac[3]);
++
++ ag71xx_wr(ag, AG71XX_REG_MAC_ADDR1, t);
++
++ t = (((u32) mac[4]) << 24) | (((u32) mac[5]) << 16);
++ ag71xx_wr(ag, AG71XX_REG_MAC_ADDR2, t);
++}
++
++static void ag71xx_dma_reset(struct ag71xx *ag)
++{
++ int i;
++
++ ag71xx_dump_dma_regs(ag);
++
++ /* stop RX and TX */
++ ag71xx_wr(ag, AG71XX_REG_RX_CTRL, 0);
++ ag71xx_wr(ag, AG71XX_REG_TX_CTRL, 0);
++
++ /* clear descriptor addresses */
++ ag71xx_wr(ag, AG71XX_REG_TX_DESC, 0);
++ ag71xx_wr(ag, AG71XX_REG_RX_DESC, 0);
++
++ /* clear pending RX/TX interrupts */
++ for (i = 0; i < 256; i++) {
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
++ }
++
++ /* clear pending errors */
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_BE | RX_STATUS_OF);
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_BE | TX_STATUS_UR);
++
++ if (ag71xx_rr(ag, AG71XX_REG_RX_STATUS))
++ printk(KERN_ALERT "%s: unable to clear DMA Rx status\n",
++ ag->dev->name);
++
++ if (ag71xx_rr(ag, AG71XX_REG_TX_STATUS))
++ printk(KERN_ALERT "%s: unable to clear DMA Tx status\n",
++ ag->dev->name);
++
++ ag71xx_dump_dma_regs(ag);
++}
++
++#define MAC_CFG1_INIT (MAC_CFG1_RXE | MAC_CFG1_TXE | \
++ MAC_CFG1_SRX | MAC_CFG1_STX)
++
++#define FIFO_CFG0_INIT (FIFO_CFG0_ALL << FIFO_CFG0_ENABLE_SHIFT)
++
++#define FIFO_CFG4_INIT (FIFO_CFG4_DE | FIFO_CFG4_DV | FIFO_CFG4_FC | \
++ FIFO_CFG4_CE | FIFO_CFG4_CR | FIFO_CFG4_LM | \
++ FIFO_CFG4_LO | FIFO_CFG4_OK | FIFO_CFG4_MC | \
++ FIFO_CFG4_BC | FIFO_CFG4_DR | FIFO_CFG4_LE | \
++ FIFO_CFG4_CF | FIFO_CFG4_PF | FIFO_CFG4_UO | \
++ FIFO_CFG4_VT)
++
++#define FIFO_CFG5_INIT (FIFO_CFG5_DE | FIFO_CFG5_DV | FIFO_CFG5_FC | \
++ FIFO_CFG5_CE | FIFO_CFG5_LO | FIFO_CFG5_OK | \
++ FIFO_CFG5_MC | FIFO_CFG5_BC | FIFO_CFG5_DR | \
++ FIFO_CFG5_CF | FIFO_CFG5_PF | FIFO_CFG5_VT | \
++ FIFO_CFG5_LE | FIFO_CFG5_FT | FIFO_CFG5_16 | \
++ FIFO_CFG5_17 | FIFO_CFG5_SF)
++
++static void ag71xx_hw_init(struct ag71xx *ag)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ ag71xx_sb(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_SR);
++ udelay(20);
++
++ ar71xx_device_stop(pdata->reset_bit);
++ mdelay(100);
++ ar71xx_device_start(pdata->reset_bit);
++ mdelay(100);
++
++ /* setup MAC configuration registers */
++ ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT);
++ ag71xx_sb(ag, AG71XX_REG_MAC_CFG2,
++ MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK);
++
++ /* setup max frame length */
++ ag71xx_wr(ag, AG71XX_REG_MAC_MFL, AG71XX_TX_MTU_LEN);
++
++ /* setup MII interface type */
++ ag71xx_mii_ctrl_set_if(ag, pdata->mii_if);
++
++ /* setup FIFO configuration registers */
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG0, FIFO_CFG0_INIT);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG1, 0x0fff0000);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG2, 0x00001fff);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG4, FIFO_CFG4_INIT);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, FIFO_CFG5_INIT);
++
++ ag71xx_dma_reset(ag);
++}
++
++static void ag71xx_hw_start(struct ag71xx *ag)
++{
++ /* start RX engine */
++ ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
++
++ /* enable interrupts */
++ ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, AG71XX_INT_INIT);
++}
++
++static void ag71xx_hw_stop(struct ag71xx *ag)
++{
++ /* disable all interrupts */
++ ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, 0);
++
++ ag71xx_dma_reset(ag);
++}
++
++static int ag71xx_open(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ int ret;
++
++ ret = ag71xx_rings_init(ag);
++ if (ret)
++ goto err;
++
++ napi_enable(&ag->napi);
++
++ netif_carrier_off(dev);
++ ag71xx_phy_start(ag);
++
++ ag71xx_wr(ag, AG71XX_REG_TX_DESC, ag->tx_ring.descs_dma);
++ ag71xx_wr(ag, AG71XX_REG_RX_DESC, ag->rx_ring.descs_dma);
++
++ ag71xx_hw_set_macaddr(ag, dev->dev_addr);
++
++ ag71xx_hw_start(ag);
++
++ netif_start_queue(dev);
++
++ return 0;
++
++ err:
++ ag71xx_rings_cleanup(ag);
++ return ret;
++}
++
++static int ag71xx_stop(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ unsigned long flags;
++
++ spin_lock_irqsave(&ag->lock, flags);
++
++ netif_stop_queue(dev);
++
++ ag71xx_hw_stop(ag);
++
++ netif_carrier_off(dev);
++ ag71xx_phy_stop(ag);
++
++ napi_disable(&ag->napi);
++ del_timer_sync(&ag->oom_timer);
++
++ spin_unlock_irqrestore(&ag->lock, flags);
++
++ ag71xx_rings_cleanup(ag);
++
++ return 0;
++}
++
++static int ag71xx_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ struct ag71xx_desc *desc;
++ unsigned long flags;
++ int i;
++
++ i = ring->curr % AG71XX_TX_RING_SIZE;
++ desc = &ring->descs[i];
++
++ spin_lock_irqsave(&ag->lock, flags);
++ pdata->ddr_flush();
++ spin_unlock_irqrestore(&ag->lock, flags);
++
++ if (!ag71xx_desc_empty(desc))
++ goto err_drop;
++
++ ag71xx_add_ar8216_header(ag, skb);
++
++ if (skb->len <= 0) {
++ DBG("%s: packet len is too small\n", ag->dev->name);
++ goto err_drop;
++ }
++
++ dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
++
++ ring->buf[i].skb = skb;
++
++ /* setup descriptor fields */
++ desc->data = virt_to_phys(skb->data);
++ desc->ctrl = (skb->len & DESC_PKTLEN_M);
++
++ /* flush descriptor */
++ wmb();
++
++ ring->curr++;
++ if (ring->curr == (ring->dirty + AG71XX_TX_THRES_STOP)) {
++ DBG("%s: tx queue full\n", ag->dev->name);
++ netif_stop_queue(dev);
++ }
++
++ DBG("%s: packet injected into TX queue\n", ag->dev->name);
++
++ /* enable TX engine */
++ ag71xx_wr(ag, AG71XX_REG_TX_CTRL, TX_CTRL_TXE);
++
++ dev->trans_start = jiffies;
++
++ return 0;
++
++ err_drop:
++ dev->stats.tx_dropped++;
++
++ dev_kfree_skb(skb);
++ return 0;
++}
++
++static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
++{
++ struct mii_ioctl_data *data = (struct mii_ioctl_data *) &ifr->ifr_data;
++ struct ag71xx *ag = netdev_priv(dev);
++ int ret;
++
++ switch (cmd) {
++ case SIOCETHTOOL:
++ if (ag->phy_dev == NULL)
++ break;
++
++ spin_lock_irq(&ag->lock);
++ ret = phy_ethtool_ioctl(ag->phy_dev, (void *) ifr->ifr_data);
++ spin_unlock_irq(&ag->lock);
++ return ret;
++
++ case SIOCSIFHWADDR:
++ if (copy_from_user
++ (dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr)))
++ return -EFAULT;
++ return 0;
++
++ case SIOCGIFHWADDR:
++ if (copy_to_user
++ (ifr->ifr_data, dev->dev_addr, sizeof(dev->dev_addr)))
++ return -EFAULT;
++ return 0;
++
++ case SIOCGMIIPHY:
++ case SIOCGMIIREG:
++ case SIOCSMIIREG:
++ if (ag->phy_dev == NULL)
++ break;
++
++ return phy_mii_ioctl(ag->phy_dev, data, cmd);
++
++ default:
++ break;
++ }
++
++ return -EOPNOTSUPP;
++}
++
++static void ag71xx_oom_timer_handler(unsigned long data)
++{
++ struct net_device *dev = (struct net_device *) data;
++ struct ag71xx *ag = netdev_priv(dev);
++
++ netif_rx_schedule(&ag->napi);
++}
++
++static void ag71xx_tx_timeout(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ if (netif_msg_tx_err(ag))
++ printk(KERN_DEBUG "%s: tx timeout\n", ag->dev->name);
++
++ schedule_work(&ag->restart_work);
++}
++
++static void ag71xx_restart_work_func(struct work_struct *work)
++{
++ struct ag71xx *ag = container_of(work, struct ag71xx, restart_work);
++
++ ag71xx_stop(ag->dev);
++ ag71xx_open(ag->dev);
++}
++
++static void ag71xx_tx_packets(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ unsigned int sent;
++
++ DBG("%s: processing TX ring\n", ag->dev->name);
++
++ sent = 0;
++ while (ring->dirty != ring->curr) {
++ unsigned int i = ring->dirty % AG71XX_TX_RING_SIZE;
++ struct ag71xx_desc *desc = &ring->descs[i];
++ struct sk_buff *skb = ring->buf[i].skb;
++
++ if (!ag71xx_desc_empty(desc))
++ break;
++
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
++
++ ag->dev->stats.tx_bytes += skb->len;
++ ag->dev->stats.tx_packets++;
++
++ dev_kfree_skb_any(skb);
++ ring->buf[i].skb = NULL;
++
++ ring->dirty++;
++ sent++;
++ }
++
++ DBG("%s: %d packets sent out\n", ag->dev->name, sent);
++
++ if ((ring->curr - ring->dirty) < AG71XX_TX_THRES_WAKEUP)
++ netif_wake_queue(ag->dev);
++
++}
++
++static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
++{
++ struct net_device *dev = ag->dev;
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ int done = 0;
++
++ DBG("%s: rx packets, limit=%d, curr=%u, dirty=%u\n",
++ dev->name, limit, ring->curr, ring->dirty);
++
++ while (done < limit) {
++ unsigned int i = ring->curr % AG71XX_RX_RING_SIZE;
++ struct ag71xx_desc *desc = &ring->descs[i];
++ struct sk_buff *skb;
++ int pktlen;
++
++ if (ag71xx_desc_empty(desc))
++ break;
++
++ if ((ring->dirty + AG71XX_RX_RING_SIZE) == ring->curr) {
++ ag71xx_assert(0);
++ break;
++ }
++
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
++
++ skb = ring->buf[i].skb;
++ pktlen = ag71xx_desc_pktlen(desc);
++ pktlen -= ETH_FCS_LEN;
++
++ skb_put(skb, pktlen);
++
++ skb->dev = dev;
++ skb->ip_summed = CHECKSUM_NONE;
++
++ dev->last_rx = jiffies;
++ dev->stats.rx_packets++;
++ dev->stats.rx_bytes += pktlen;
++
++ if (ag71xx_remove_ar8216_header(ag, skb) != 0) {
++ dev->stats.rx_dropped++;
++ kfree_skb(skb);
++ } else {
++ skb->protocol = eth_type_trans(skb, dev);
++ netif_receive_skb(skb);
++ }
++
++ ring->buf[i].skb = NULL;
++ done++;
++
++ ring->curr++;
++ }
++
++ ag71xx_ring_rx_refill(ag);
++
++ DBG("%s: rx finish, curr=%u, dirty=%u, done=%d\n",
++ dev->name, ring->curr, ring->dirty, done);
++
++ return done;
++}
++
++static int ag71xx_poll(struct napi_struct *napi, int limit)
++{
++ struct ag71xx *ag = container_of(napi, struct ag71xx, napi);
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ struct net_device *dev = ag->dev;
++ struct ag71xx_ring *rx_ring;
++ unsigned long flags;
++ u32 status;
++ int done;
++
++ pdata->ddr_flush();
++ ag71xx_tx_packets(ag);
++
++ DBG("%s: processing RX ring\n", dev->name);
++ done = ag71xx_rx_packets(ag, limit);
++
++ rx_ring = &ag->rx_ring;
++ if (rx_ring->buf[rx_ring->dirty % AG71XX_RX_RING_SIZE].skb == NULL)
++ goto oom;
++
++ status = ag71xx_rr(ag, AG71XX_REG_RX_STATUS);
++ if (unlikely(status & RX_STATUS_OF)) {
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_OF);
++ dev->stats.rx_fifo_errors++;
++
++ /* restart RX */
++ ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
++ }
++
++ if (done < limit) {
++ if (status & RX_STATUS_PR)
++ goto more;
++
++ status = ag71xx_rr(ag, AG71XX_REG_TX_STATUS);
++ if (status & TX_STATUS_PS)
++ goto more;
++
++ DBG("%s: disable polling mode, done=%d, limit=%d\n",
++ dev->name, done, limit);
++
++ netif_rx_complete(napi);
++
++ /* enable interrupts */
++ spin_lock_irqsave(&ag->lock, flags);
++ ag71xx_int_enable(ag, AG71XX_INT_POLL);
++ spin_unlock_irqrestore(&ag->lock, flags);
++ return done;
++ }
++
++ more:
++ DBG("%s: stay in polling mode, done=%d, limit=%d\n",
++ dev->name, done, limit);
++ return done;
++
++ oom:
++ if (netif_msg_rx_err(ag))
++ printk(KERN_DEBUG "%s: out of memory\n", dev->name);
++
++ mod_timer(&ag->oom_timer, jiffies + AG71XX_OOM_REFILL);
++ netif_rx_complete(napi);
++ return 0;
++}
++
++static irqreturn_t ag71xx_interrupt(int irq, void *dev_id)
++{
++ struct net_device *dev = dev_id;
++ struct ag71xx *ag = netdev_priv(dev);
++ u32 status;
++
++ status = ag71xx_rr(ag, AG71XX_REG_INT_STATUS);
++ ag71xx_dump_intr(ag, "raw", status);
++
++ if (unlikely(!status))
++ return IRQ_NONE;
++
++ if (unlikely(status & AG71XX_INT_ERR)) {
++ if (status & AG71XX_INT_TX_BE) {
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_BE);
++ dev_err(&dev->dev, "TX BUS error\n");
++ }
++ if (status & AG71XX_INT_RX_BE) {
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_BE);
++ dev_err(&dev->dev, "RX BUS error\n");
++ }
++ }
++
++ if (likely(status & AG71XX_INT_POLL)) {
++ ag71xx_int_disable(ag, AG71XX_INT_POLL);
++ DBG("%s: enable polling mode\n", dev->name);
++ netif_rx_schedule(&ag->napi);
++ }
++
++ return IRQ_HANDLED;
++}
++
++static void ag71xx_set_multicast_list(struct net_device *dev)
++{
++ /* TODO */
++}
++
++static int __init ag71xx_probe(struct platform_device *pdev)
++{
++ struct net_device *dev;
++ struct resource *res;
++ struct ag71xx *ag;
++ struct ag71xx_platform_data *pdata;
++ int err;
++
++ pdata = pdev->dev.platform_data;
++ if (!pdata) {
++ dev_err(&pdev->dev, "no platform data specified\n");
++ err = -ENXIO;
++ goto err_out;
++ }
++
++ dev = alloc_etherdev(sizeof(*ag));
++ if (!dev) {
++ dev_err(&pdev->dev, "alloc_etherdev failed\n");
++ err = -ENOMEM;
++ goto err_out;
++ }
++
++ SET_NETDEV_DEV(dev, &pdev->dev);
++
++ ag = netdev_priv(dev);
++ ag->pdev = pdev;
++ ag->dev = dev;
++ ag->mii_bus = ag71xx_mdio_bus->mii_bus;
++ ag->msg_enable = netif_msg_init(ag71xx_debug,
++ AG71XX_DEFAULT_MSG_ENABLE);
++ spin_lock_init(&ag->lock);
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac_base");
++ if (!res) {
++ dev_err(&pdev->dev, "no mac_base resource found\n");
++ err = -ENXIO;
++ goto err_out;
++ }
++
++ ag->mac_base = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!ag->mac_base) {
++ dev_err(&pdev->dev, "unable to ioremap mac_base\n");
++ err = -ENOMEM;
++ goto err_free_dev;
++ }
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac_base2");
++ if (!res) {
++ dev_err(&pdev->dev, "no mac_base2 resource found\n");
++ err = -ENXIO;
++ goto err_unmap_base1;
++ }
++
++ ag->mac_base2 = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!ag->mac_base) {
++ dev_err(&pdev->dev, "unable to ioremap mac_base2\n");
++ err = -ENOMEM;
++ goto err_unmap_base1;
++ }
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mii_ctrl");
++ if (!res) {
++ dev_err(&pdev->dev, "no mii_ctrl resource found\n");
++ err = -ENXIO;
++ goto err_unmap_base2;
++ }
++
++ ag->mii_ctrl = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!ag->mii_ctrl) {
++ dev_err(&pdev->dev, "unable to ioremap mii_ctrl\n");
++ err = -ENOMEM;
++ goto err_unmap_base2;
++ }
++
++ dev->irq = platform_get_irq(pdev, 0);
++ err = request_irq(dev->irq, ag71xx_interrupt,
++ IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
++ dev->name, dev);
++ if (err) {
++ dev_err(&pdev->dev, "unable to request IRQ %d\n", dev->irq);
++ goto err_unmap_mii_ctrl;
++ }
++
++ dev->base_addr = (unsigned long)ag->mac_base;
++ dev->open = ag71xx_open;
++ dev->stop = ag71xx_stop;
++ dev->hard_start_xmit = ag71xx_hard_start_xmit;
++ dev->set_multicast_list = ag71xx_set_multicast_list;
++ dev->do_ioctl = ag71xx_do_ioctl;
++ dev->ethtool_ops = &ag71xx_ethtool_ops;
++
++ dev->tx_timeout = ag71xx_tx_timeout;
++ INIT_WORK(&ag->restart_work, ag71xx_restart_work_func);
++
++ init_timer(&ag->oom_timer);
++ ag->oom_timer.data = (unsigned long) dev;
++ ag->oom_timer.function = ag71xx_oom_timer_handler;
++
++ memcpy(dev->dev_addr, pdata->mac_addr, ETH_ALEN);
++
++ netif_napi_add(dev, &ag->napi, ag71xx_poll, AG71XX_NAPI_WEIGHT);
++
++ err = register_netdev(dev);
++ if (err) {
++ dev_err(&pdev->dev, "unable to register net device\n");
++ goto err_free_irq;
++ }
++
++ printk(KERN_INFO "%s: Atheros AG71xx at 0x%08lx, irq %d\n",
++ dev->name, dev->base_addr, dev->irq);
++
++ ag71xx_dump_regs(ag);
++
++ ag71xx_hw_init(ag);
++
++ ag71xx_dump_regs(ag);
++
++ /* Reset the mdio bus explicitly */
++ if (ag->mii_bus) {
++ mutex_lock(&ag->mii_bus->mdio_lock);
++ ag->mii_bus->reset(ag->mii_bus);
++ mutex_unlock(&ag->mii_bus->mdio_lock);
++ }
++
++ err = ag71xx_phy_connect(ag);
++ if (err)
++ goto err_unregister_netdev;
++
++ platform_set_drvdata(pdev, dev);
++
++ return 0;
++
++ err_unregister_netdev:
++ unregister_netdev(dev);
++ err_free_irq:
++ free_irq(dev->irq, dev);
++ err_unmap_mii_ctrl:
++ iounmap(ag->mii_ctrl);
++ err_unmap_base2:
++ iounmap(ag->mac_base2);
++ err_unmap_base1:
++ iounmap(ag->mac_base);
++ err_free_dev:
++ kfree(dev);
++ err_out:
++ platform_set_drvdata(pdev, NULL);
++ return err;
++}
++
++static int __exit ag71xx_remove(struct platform_device *pdev)
++{
++ struct net_device *dev = platform_get_drvdata(pdev);
++
++ if (dev) {
++ struct ag71xx *ag = netdev_priv(dev);
++
++ ag71xx_phy_disconnect(ag);
++ unregister_netdev(dev);
++ free_irq(dev->irq, dev);
++ iounmap(ag->mii_ctrl);
++ iounmap(ag->mac_base2);
++ iounmap(ag->mac_base);
++ kfree(dev);
++ platform_set_drvdata(pdev, NULL);
++ }
++
++ return 0;
++}
++
++static struct platform_driver ag71xx_driver = {
++ .probe = ag71xx_probe,
++ .remove = __exit_p(ag71xx_remove),
++ .driver = {
++ .name = AG71XX_DRV_NAME,
++ }
++};
++
++static int __init ag71xx_module_init(void)
++{
++ int ret;
++
++ ret = ag71xx_mdio_driver_init();
++ if (ret)
++ goto err_out;
++
++ ret = platform_driver_register(&ag71xx_driver);
++ if (ret)
++ goto err_mdio_exit;
++
++ return 0;
++
++ err_mdio_exit:
++ ag71xx_mdio_driver_exit();
++ err_out:
++ return ret;
++}
++
++static void __exit ag71xx_module_exit(void)
++{
++ platform_driver_unregister(&ag71xx_driver);
++ ag71xx_mdio_driver_exit();
++}
++
++module_init(ag71xx_module_init);
++module_exit(ag71xx_module_exit);
++
++MODULE_VERSION(AG71XX_DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:" AG71XX_DRV_NAME);
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_mdio.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_mdio.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_mdio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_mdio.c 2009-04-13 14:27:34.827084882 +0200
+@@ -0,0 +1,233 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++#define AG71XX_MDIO_RETRY 1000
++#define AG71XX_MDIO_DELAY 5
++
++struct ag71xx_mdio *ag71xx_mdio_bus;
++
++static inline void ag71xx_mdio_wr(struct ag71xx_mdio *am, unsigned reg,
++ u32 value)
++{
++ __raw_writel(value, am->mdio_base + reg - AG71XX_REG_MII_CFG);
++}
++
++static inline u32 ag71xx_mdio_rr(struct ag71xx_mdio *am, unsigned reg)
++{
++ return __raw_readl(am->mdio_base + reg - AG71XX_REG_MII_CFG);
++}
++
++static void ag71xx_mdio_dump_regs(struct ag71xx_mdio *am)
++{
++ DBG("%s: mii_cfg=%08x, mii_cmd=%08x, mii_addr=%08x\n",
++ am->mii_bus->name,
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_CFG),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_CMD),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_ADDR));
++ DBG("%s: mii_ctrl=%08x, mii_status=%08x, mii_ind=%08x\n",
++ am->mii_bus->name,
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_CTRL),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_STATUS),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_IND));
++}
++
++static int ag71xx_mdio_mii_read(struct ag71xx_mdio *am, int addr, int reg)
++{
++ int ret;
++ int i;
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CMD, MII_CMD_WRITE);
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_ADDR,
++ ((addr & 0xff) << MII_ADDR_SHIFT) | (reg & 0xff));
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CMD, MII_CMD_READ);
++
++ i = AG71XX_MDIO_RETRY;
++ while (ag71xx_mdio_rr(am, AG71XX_REG_MII_IND) & MII_IND_BUSY) {
++ if (i-- == 0) {
++ printk(KERN_ERR "%s: mii_read timed out\n",
++ am->mii_bus->name);
++ ret = 0xffff;
++ goto out;
++ }
++ udelay(AG71XX_MDIO_DELAY);
++ }
++
++ ret = ag71xx_mdio_rr(am, AG71XX_REG_MII_STATUS) & 0xffff;
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CMD, MII_CMD_WRITE);
++
++ DBG("mii_read: addr=%04x, reg=%04x, value=%04x\n", addr, reg, ret);
++
++ out:
++ return ret;
++}
++
++static void ag71xx_mdio_mii_write(struct ag71xx_mdio *am,
++ int addr, int reg, u16 val)
++{
++ int i;
++
++ DBG("mii_write: addr=%04x, reg=%04x, value=%04x\n", addr, reg, val);
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_ADDR,
++ ((addr & 0xff) << MII_ADDR_SHIFT) | (reg & 0xff));
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CTRL, val);
++
++ i = AG71XX_MDIO_RETRY;
++ while (ag71xx_mdio_rr(am, AG71XX_REG_MII_IND) & MII_IND_BUSY) {
++ if (i-- == 0) {
++ printk(KERN_ERR "%s: mii_write timed out\n",
++ am->mii_bus->name);
++ break;
++ }
++ udelay(AG71XX_MDIO_DELAY);
++ }
++}
++
++static int ag71xx_mdio_reset(struct mii_bus *bus)
++{
++ struct ag71xx_mdio *am = bus->priv;
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, MII_CFG_RESET);
++ udelay(100);
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, MII_CFG_CLK_DIV_28);
++ udelay(100);
++
++ return 0;
++}
++
++static int ag71xx_mdio_read(struct mii_bus *bus, int addr, int reg)
++{
++ struct ag71xx_mdio *am = bus->priv;
++
++ return ag71xx_mdio_mii_read(am, addr, reg);
++}
++
++static int ag71xx_mdio_write(struct mii_bus *bus, int addr, int reg, u16 val)
++{
++ struct ag71xx_mdio *am = bus->priv;
++
++ ag71xx_mdio_mii_write(am, addr, reg, val);
++ return 0;
++}
++
++static int __init ag71xx_mdio_probe(struct platform_device *pdev)
++{
++ struct ag71xx_mdio_platform_data *pdata;
++ struct ag71xx_mdio *am;
++ struct resource *res;
++ int i;
++ int err;
++
++ if (ag71xx_mdio_bus)
++ return -EBUSY;
++
++ am = kzalloc(sizeof(*am), GFP_KERNEL);
++ if (!am) {
++ err = -ENOMEM;
++ goto err_out;
++ }
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_err(&pdev->dev, "no iomem resource found\n");
++ err = -ENXIO;
++ goto err_out;
++ }
++
++ am->mdio_base = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!am->mdio_base) {
++ dev_err(&pdev->dev, "unable to ioremap registers\n");
++ err = -ENOMEM;
++ goto err_free_mdio;
++ }
++
++ am->mii_bus = mdiobus_alloc();
++ if (am->mii_bus == NULL) {
++ err = -ENOMEM;
++ goto err_iounmap;
++ }
++
++ am->mii_bus->name = "ag71xx_mdio";
++ am->mii_bus->read = ag71xx_mdio_read;
++ am->mii_bus->write = ag71xx_mdio_write;
++ am->mii_bus->reset = ag71xx_mdio_reset;
++ am->mii_bus->irq = am->mii_irq;
++ am->mii_bus->priv = am;
++ am->mii_bus->parent = &pdev->dev;
++ snprintf(am->mii_bus->id, MII_BUS_ID_SIZE, "%x", 0);
++
++ pdata = pdev->dev.platform_data;
++ if (pdata)
++ am->mii_bus->phy_mask = pdata->phy_mask;
++
++ for (i = 0; i < PHY_MAX_ADDR; i++)
++ am->mii_irq[i] = PHY_POLL;
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MAC_CFG1, 0);
++
++ err = mdiobus_register(am->mii_bus);
++ if (err)
++ goto err_free_bus;
++
++ ag71xx_mdio_dump_regs(am);
++
++ platform_set_drvdata(pdev, am);
++ ag71xx_mdio_bus = am;
++ return 0;
++
++ err_free_bus:
++ mdiobus_free(am->mii_bus);
++ err_iounmap:
++ iounmap(am->mdio_base);
++ err_free_mdio:
++ kfree(am);
++ err_out:
++ return err;
++}
++
++static int __exit ag71xx_mdio_remove(struct platform_device *pdev)
++{
++ struct ag71xx_mdio *am = platform_get_drvdata(pdev);
++
++ if (am) {
++ ag71xx_mdio_bus = NULL;
++ mdiobus_unregister(am->mii_bus);
++ mdiobus_free(am->mii_bus);
++ iounmap(am->mdio_base);
++ kfree(am);
++ platform_set_drvdata(pdev, NULL);
++ }
++
++ return 0;
++}
++
++static struct platform_driver ag71xx_mdio_driver = {
++ .probe = ag71xx_mdio_probe,
++ .remove = __exit_p(ag71xx_mdio_remove),
++ .driver = {
++ .name = "ag71xx-mdio",
++ }
++};
++
++int ag71xx_mdio_driver_init(void)
++{
++ return platform_driver_register(&ag71xx_mdio_driver);
++}
++
++void ag71xx_mdio_driver_exit(void)
++{
++ platform_driver_unregister(&ag71xx_mdio_driver);
++}
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_phy.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_phy.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_phy.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_phy.c 2009-04-13 14:27:34.827084882 +0200
+@@ -0,0 +1,287 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++static unsigned char *ag71xx_speed_str(struct ag71xx *ag)
++{
++ switch (ag->speed) {
++ case SPEED_1000:
++ return "1000";
++ case SPEED_100:
++ return "100";
++ case SPEED_10:
++ return "10";
++ }
++
++ return "?";
++}
++
++#define AR71XX_PLL_VAL_1000 0x00110000
++#define AR71XX_PLL_VAL_100 0x00001099
++#define AR71XX_PLL_VAL_10 0x00991099
++
++#define AR91XX_PLL_VAL_1000 0x1a000000
++#define AR91XX_PLL_VAL_100 0x13000a44
++#define AR91XX_PLL_VAL_10 0x00441099
++
++static void ag71xx_phy_link_update(struct ag71xx *ag)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ u32 cfg2;
++ u32 ifctl;
++ u32 pll;
++ u32 fifo5;
++ u32 mii_speed;
++
++ if (!ag->link) {
++ netif_carrier_off(ag->dev);
++ if (netif_msg_link(ag))
++ printk(KERN_INFO "%s: link down\n", ag->dev->name);
++ return;
++ }
++
++ cfg2 = ag71xx_rr(ag, AG71XX_REG_MAC_CFG2);
++ cfg2 &= ~(MAC_CFG2_IF_1000 | MAC_CFG2_IF_10_100 | MAC_CFG2_FDX);
++ cfg2 |= (ag->duplex) ? MAC_CFG2_FDX : 0;
++
++ ifctl = ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL);
++ ifctl &= ~(MAC_IFCTL_SPEED);
++
++ fifo5 = ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5);
++ fifo5 &= ~FIFO_CFG5_BM;
++
++ switch (ag->speed) {
++ case SPEED_1000:
++ mii_speed = MII_CTRL_SPEED_1000;
++ cfg2 |= MAC_CFG2_IF_1000;
++ pll = pdata->is_ar91xx ? AR91XX_PLL_VAL_1000
++ : AR71XX_PLL_VAL_1000;
++ fifo5 |= FIFO_CFG5_BM;
++ break;
++ case SPEED_100:
++ mii_speed = MII_CTRL_SPEED_100;
++ cfg2 |= MAC_CFG2_IF_10_100;
++ ifctl |= MAC_IFCTL_SPEED;
++ pll = pdata->is_ar91xx ? AR91XX_PLL_VAL_100
++ : AR71XX_PLL_VAL_100;
++ break;
++ case SPEED_10:
++ mii_speed = MII_CTRL_SPEED_10;
++ cfg2 |= MAC_CFG2_IF_10_100;
++ pll = pdata->is_ar91xx ? AR91XX_PLL_VAL_10
++ : AR71XX_PLL_VAL_10;
++ break;
++ default:
++ BUG();
++ return;
++ }
++
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG3,
++ pdata->is_ar91xx ? 0x780fff : 0x008001ff);
++ pdata->set_pll(pll);
++ ag71xx_mii_ctrl_set_speed(ag, mii_speed);
++
++ ag71xx_wr(ag, AG71XX_REG_MAC_CFG2, cfg2);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, fifo5);
++ ag71xx_wr(ag, AG71XX_REG_MAC_IFCTL, ifctl);
++
++ netif_carrier_on(ag->dev);
++ if (netif_msg_link(ag))
++ printk(KERN_INFO "%s: link up (%sMbps/%s duplex)\n",
++ ag->dev->name,
++ ag71xx_speed_str(ag),
++ (DUPLEX_FULL == ag->duplex) ? "Full" : "Half");
++
++ DBG("%s: fifo_cfg0=%#x, fifo_cfg1=%#x, fifo_cfg2=%#x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG0),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG1),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG2));
++
++ DBG("%s: fifo_cfg3=%#x, fifo_cfg4=%#x, fifo_cfg5=%#x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG3),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG4),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
++
++ DBG("%s: mac_cfg2=%#x, mac_ifctl=%#x, mii_ctrl=%#x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_MAC_CFG2),
++ ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL),
++ ag71xx_mii_ctrl_rr(ag));
++}
++
++static void ag71xx_phy_link_adjust(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct phy_device *phydev = ag->phy_dev;
++ unsigned long flags;
++ int status_change = 0;
++
++ spin_lock_irqsave(&ag->lock, flags);
++
++ if (phydev->link) {
++ if (ag->duplex != phydev->duplex
++ || ag->speed != phydev->speed) {
++ status_change = 1;
++ }
++ }
++
++ if (phydev->link != ag->link)
++ status_change = 1;
++
++ ag->link = phydev->link;
++ ag->duplex = phydev->duplex;
++ ag->speed = phydev->speed;
++
++ if (status_change)
++ ag71xx_phy_link_update(ag);
++
++ spin_unlock_irqrestore(&ag->lock, flags);
++}
++
++void ag71xx_phy_start(struct ag71xx *ag)
++{
++ if (ag->phy_dev) {
++ phy_start(ag->phy_dev);
++ } else {
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ ag->duplex = pdata->duplex;
++ ag->speed = pdata->speed;
++ ag->link = 1;
++ ag71xx_phy_link_update(ag);
++ }
++}
++
++void ag71xx_phy_stop(struct ag71xx *ag)
++{
++ if (ag->phy_dev) {
++ phy_stop(ag->phy_dev);
++ } else {
++ ag->duplex = -1;
++ ag->link = 0;
++ ag->speed = 0;
++ ag71xx_phy_link_update(ag);
++ }
++}
++
++static int ag71xx_phy_connect_fixed(struct ag71xx *ag)
++{
++ struct net_device *dev = ag->dev;
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ int ret = 0;
++
++ /* use fixed settings */
++ switch (pdata->speed) {
++ case SPEED_10:
++ case SPEED_100:
++ case SPEED_1000:
++ break;
++ default:
++ printk(KERN_ERR "%s: invalid speed specified\n",
++ dev->name);
++ ret = -EINVAL;
++ break;
++ }
++
++ return ret;
++}
++
++static int ag71xx_phy_connect_multi(struct ag71xx *ag)
++{
++ struct net_device *dev = ag->dev;
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ struct phy_device *phydev = NULL;
++ int phy_count = 0;
++ int phy_addr;
++ int ret = 0;
++
++ for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
++ if (!(pdata->phy_mask & (1 << phy_addr)))
++ continue;
++
++ if (ag->mii_bus->phy_map[phy_addr] == NULL)
++ continue;
++
++ DBG("%s: PHY found at %s, uid=%08x\n",
++ dev->name,
++ ag->mii_bus->phy_map[phy_addr]->dev.bus_id,
++ ag->mii_bus->phy_map[phy_addr]->phy_id);
++
++ if (phydev == NULL)
++ phydev = ag->mii_bus->phy_map[phy_addr];
++
++ phy_count++;
++ }
++
++ switch (phy_count) {
++ case 0:
++ printk(KERN_ERR "%s: no PHY found with phy_mask=%08x\n",
++ dev->name, pdata->phy_mask);
++ ret = -ENODEV;
++ break;
++ case 1:
++ ag->phy_dev = phy_connect(dev, phydev->dev.bus_id,
++ &ag71xx_phy_link_adjust, 0, pdata->phy_if_mode);
++
++ if (IS_ERR(ag->phy_dev)) {
++ printk(KERN_ERR "%s: could not connect to PHY at %s\n",
++ dev->name, phydev->dev.bus_id);
++ return PTR_ERR(ag->phy_dev);
++ }
++
++ /* mask with MAC supported features */
++ if (pdata->has_gbit)
++ phydev->supported &= PHY_GBIT_FEATURES;
++ else
++ phydev->supported &= PHY_BASIC_FEATURES;
++
++ phydev->advertising = phydev->supported;
++
++ printk(KERN_DEBUG "%s: connected to PHY at %s "
++ "[uid=%08x, driver=%s]\n",
++ dev->name, phydev->dev.bus_id,
++ phydev->phy_id, phydev->drv->name);
++
++ ag->link = 0;
++ ag->speed = 0;
++ ag->duplex = -1;
++ break;
++
++ default:
++ printk(KERN_DEBUG "%s: connected to %d PHYs\n",
++ dev->name, phy_count);
++ ret = ag71xx_phy_connect_fixed(ag);
++ break;
++ }
++
++ return ret;
++}
++
++int ag71xx_phy_connect(struct ag71xx *ag)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ if (pdata->phy_mask)
++ return ag71xx_phy_connect_multi(ag);
++
++ return ag71xx_phy_connect_fixed(ag);
++}
++
++void ag71xx_phy_disconnect(struct ag71xx *ag)
++{
++ if (ag->phy_dev)
++ phy_disconnect(ag->phy_dev);
++}
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/micrel.c linux-2.6.29.1/drivers/net/phy/micrel.c
+--- linux-2.6.29.1.orig/drivers/net/phy/micrel.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/phy/micrel.c 2009-04-13 14:27:34.831085671 +0200
+@@ -0,0 +1,82 @@
++/*
++ * Driver for Micrel/Kendin PHYs
++ *
++ * Copyright (c) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++#include <linux/phy.h>
++
++#define KSZ_REG_INT_CTRL 0x1b
++
++#define KSZ_INT_LU_EN (1 << 8) /* enable Link Up interrupt */
++#define KSZ_INT_RF_EN (1 << 9) /* enable Remote Fault interrupt */
++#define KSZ_INT_LD_EN (1 << 10) /* enable Link Down interrupt */
++
++#define KSZ_INT_INIT (KSZ_INT_LU_EN | KSZ_INT_LD_EN)
++
++static int ksz8041_ack_interrupt(struct phy_device *phydev)
++{
++ int err;
++
++ err = phy_read(phydev, KSZ_REG_INT_CTRL);
++
++ return (err < 0) ? err : 0;
++}
++
++static int ksz8041_config_intr(struct phy_device *phydev)
++{
++ int err;
++
++ if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
++ err = phy_write(phydev, KSZ_REG_INT_CTRL,
++ KSZ_INT_INIT);
++ else
++ err = phy_write(phydev, KSZ_REG_INT_CTRL, 0);
++
++ return err;
++}
++
++static struct phy_driver ksz8041_phy_driver = {
++ .phy_id = 0x00221512,
++ .name = "Micrel KSZ8041",
++ .phy_id_mask = 0x001fffff,
++ .features = PHY_BASIC_FEATURES,
++ .flags = PHY_HAS_INTERRUPT,
++ .config_aneg = genphy_config_aneg,
++ .read_status = genphy_read_status,
++ .ack_interrupt = ksz8041_ack_interrupt,
++ .config_intr = ksz8041_config_intr,
++ .driver = {
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init micrel_phy_init(void)
++{
++ return phy_driver_register(&ksz8041_phy_driver);
++}
++
++static void __exit micrel_phy_exit(void)
++{
++ phy_driver_unregister(&ksz8041_phy_driver);
++}
++
++#ifdef MODULE
++module_init(micrel_phy_init);
++module_exit(micrel_phy_exit);
++#else
++subsys_initcall(micrel_phy_init);
++#endif
++
++MODULE_DESCRIPTION("Micrel/Kendin PHY driver");
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/phy.c linux-2.6.29.1/drivers/net/phy/phy.c
+--- linux-2.6.29.1.orig/drivers/net/phy/phy.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/phy/phy.c 2009-04-13 17:29:36.946673592 +0200
+@@ -299,6 +299,50 @@
+ }
+ EXPORT_SYMBOL(phy_ethtool_gset);
+
++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr)
++{
++ u32 cmd;
++ int tmp;
++ struct ethtool_cmd ecmd = { ETHTOOL_GSET };
++ struct ethtool_value edata = { ETHTOOL_GLINK };
++
++ if (get_user(cmd, (u32 *) useraddr))
++ return -EFAULT;
++
++ switch (cmd) {
++ case ETHTOOL_GSET:
++ phy_ethtool_gset(phydev, &ecmd);
++ if (copy_to_user(useraddr, &ecmd, sizeof(ecmd)))
++ return -EFAULT;
++ return 0;
++
++ case ETHTOOL_SSET:
++ if (copy_from_user(&ecmd, useraddr, sizeof(ecmd)))
++ return -EFAULT;
++ return phy_ethtool_sset(phydev, &ecmd);
++
++ case ETHTOOL_NWAY_RST:
++ /* if autoneg is off, it's an error */
++ tmp = phy_read(phydev, MII_BMCR);
++ if (tmp & BMCR_ANENABLE) {
++ tmp |= (BMCR_ANRESTART);
++ phy_write(phydev, MII_BMCR, tmp);
++ return 0;
++ }
++ return -EINVAL;
++
++ case ETHTOOL_GLINK:
++ edata.data = (phy_read(phydev,
++ MII_BMSR) & BMSR_LSTATUS) ? 1 : 0;
++ if (copy_to_user(useraddr, &edata, sizeof(edata)))
++ return -EFAULT;
++ return 0;
++ }
++
++ return -EOPNOTSUPP;
++}
++EXPORT_SYMBOL(phy_ethtool_ioctl);
++
+ /**
+ * phy_mii_ioctl - generic PHY MII ioctl interface
+ * @phydev: the phy_device struct
+@@ -355,8 +399,8 @@
+ }
+
+ phy_write(phydev, mii_data->reg_num, val);
+-
+- if (mii_data->reg_num == MII_BMCR
++
++ if (mii_data->reg_num == MII_BMCR
+ && val & BMCR_RESET
+ && phydev->drv->config_init) {
+ phy_scan_fixups(phydev);
+@@ -476,7 +520,7 @@
+ int idx;
+
+ idx = phy_find_setting(phydev->speed, phydev->duplex);
+-
++
+ idx++;
+
+ idx = phy_find_valid(idx, phydev->supported);
+diff -Nur linux-2.6.29.1.orig/drivers/spi/Kconfig linux-2.6.29.1/drivers/spi/Kconfig
+--- linux-2.6.29.1.orig/drivers/spi/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/spi/Kconfig 2009-04-13 14:27:34.831085671 +0200
+@@ -53,6 +53,13 @@
+
+ comment "SPI Master Controller Drivers"
+
++config SPI_AR71XX
++ tristate "Atheros AR71xx SPI Controller"
++ depends on SPI_MASTER && ATHEROS_AR71XX
++ select SPI_BITBANG
++ help
++ This is the SPI contoller driver for Atheros AR71xx.
++
+ config SPI_ATMEL
+ tristate "Atmel SPI Controller"
+ depends on (ARCH_AT91 || AVR32)
+diff -Nur linux-2.6.29.1.orig/drivers/spi/Makefile linux-2.6.29.1/drivers/spi/Makefile
+--- linux-2.6.29.1.orig/drivers/spi/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/spi/Makefile 2009-04-13 14:27:34.835086738 +0200
+@@ -11,6 +11,7 @@
+ obj-$(CONFIG_SPI_MASTER) += spi.o
+
+ # SPI master controller drivers (bus)
++obj-$(CONFIG_SPI_AR71XX) += ar71xx_spi.o
+ obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o
+ obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o
+ obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o
+diff -Nur linux-2.6.29.1.orig/drivers/spi/ar71xx_spi.c linux-2.6.29.1/drivers/spi/ar71xx_spi.c
+--- linux-2.6.29.1.orig/drivers/spi/ar71xx_spi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/spi/ar71xx_spi.c 2009-04-13 14:27:34.855087329 +0200
+@@ -0,0 +1,240 @@
++/*
++ * Atheros AR71xx SPI Controller driver
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/delay.h>
++#include <linux/spinlock.h>
++#include <linux/workqueue.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/spi_bitbang.h>
++#include <linux/bitops.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/platform.h>
++
++#define DRV_DESC "Atheros AR71xx SPI Controller driver"
++#define DRV_VERSION "0.2.2"
++#define DRV_NAME "ar71xx-spi"
++
++#undef PER_BIT_READ
++
++struct ar71xx_spi {
++ struct spi_bitbang bitbang;
++ u32 ioc_base;
++ u32 reg_ctrl;
++
++ void __iomem *base;
++
++ struct platform_device *pdev;
++ u32 (*get_ioc_base)(u8 chip_select, int cs_high,
++ int is_on);
++};
++
++static inline u32 ar71xx_spi_rr(struct ar71xx_spi *sp, unsigned reg)
++{
++ return __raw_readl(sp->base + reg);
++}
++
++static inline void ar71xx_spi_wr(struct ar71xx_spi *sp, unsigned reg, u32 val)
++{
++ __raw_writel(val, sp->base + reg);
++}
++
++static inline struct ar71xx_spi *spidev_to_sp(struct spi_device *spi)
++{
++ return spi_master_get_devdata(spi->master);
++}
++
++static u32 ar71xx_spi_get_ioc_base(u8 chip_select, int cs_high, int is_on)
++{
++ u32 ret;
++
++ if (is_on == AR71XX_SPI_CS_INACTIVE)
++ ret = SPI_IOC_CS_ALL;
++ else
++ ret = SPI_IOC_CS_ALL & ~SPI_IOC_CS(chip_select);
++
++ return ret;
++}
++
++static void ar71xx_spi_chipselect(struct spi_device *spi, int value)
++{
++ struct ar71xx_spi *sp = spidev_to_sp(spi);
++ void __iomem *base = sp->base;
++ u32 ioc_base;
++
++ switch (value) {
++ case BITBANG_CS_INACTIVE:
++ ioc_base = sp->get_ioc_base(spi->chip_select,
++ (spi->mode & SPI_CS_HIGH) != 0,
++ AR71XX_SPI_CS_INACTIVE);
++
++ __raw_writel(ioc_base, base + SPI_REG_IOC);
++ __raw_writel(sp->reg_ctrl, base + SPI_REG_CTRL);
++ __raw_writel(0, base + SPI_REG_FS);
++ break;
++
++ case BITBANG_CS_ACTIVE:
++ ioc_base = sp->get_ioc_base(spi->chip_select,
++ (spi->mode & SPI_CS_HIGH) != 0,
++ AR71XX_SPI_CS_ACTIVE);
++
++ __raw_writel(SPI_FS_GPIO, base + SPI_REG_FS);
++ /* TODO: setup speed */
++ __raw_writel(0x43, base + SPI_REG_CTRL);
++ __raw_writel(ioc_base, base + SPI_REG_IOC);
++ sp->ioc_base = ioc_base;
++ break;
++ }
++}
++
++static u32 ar71xx_spi_txrx_mode0(struct spi_device *spi, unsigned nsecs,
++ u32 word, u8 bits)
++{
++ struct ar71xx_spi *sp = spidev_to_sp(spi);
++ void __iomem *base = sp->base;
++ u32 ioc = sp->ioc_base;
++ u32 ret;
++
++ /* clock starts at inactive polarity */
++ for (word <<= (32 - bits); likely(bits); bits--) {
++ u32 out;
++
++ if (word & (1 << 31))
++ out = ioc | SPI_IOC_DO;
++ else
++ out = ioc & ~SPI_IOC_DO;
++
++ /* setup MSB (to slave) on trailing edge */
++ __raw_writel(out, base + SPI_REG_IOC);
++
++ __raw_writel(out | SPI_IOC_CLK, base + SPI_REG_IOC);
++
++ word <<= 1;
++
++#ifdef PER_BIT_READ
++ /* sample MSB (from slave) on leading edge */
++ ret = __raw_readl(base + SPI_REG_RDS);
++ __raw_writel(out, base + SPI_REG_IOC);
++#endif
++
++ }
++
++#ifndef PER_BIT_READ
++ ret = __raw_readl(base + SPI_REG_RDS);
++#endif
++ return ret;
++}
++
++static int ar71xx_spi_probe(struct platform_device *pdev)
++{
++ struct spi_master *master;
++ struct ar71xx_spi *sp;
++ struct ar71xx_spi_platform_data *pdata;
++ struct resource *r;
++ int ret;
++
++ master = spi_alloc_master(&pdev->dev, sizeof(*sp));
++ if (master == NULL) {
++ dev_err(&pdev->dev, "failed to allocate spi master\n");
++ return -ENOMEM;
++ }
++
++ sp = spi_master_get_devdata(master);
++ platform_set_drvdata(pdev, sp);
++
++ pdata = pdev->dev.platform_data;
++
++ sp->bitbang.master = spi_master_get(master);
++ sp->bitbang.chipselect = ar71xx_spi_chipselect;
++ sp->bitbang.txrx_word[SPI_MODE_0] = ar71xx_spi_txrx_mode0;
++
++ sp->get_ioc_base = ar71xx_spi_get_ioc_base;
++ if (pdata) {
++ sp->bitbang.master->bus_num = pdata->bus_num;
++ sp->bitbang.master->num_chipselect = pdata->num_chipselect;
++ if (pdata->get_ioc_base)
++ sp->get_ioc_base = pdata->get_ioc_base;
++ } else {
++ sp->bitbang.master->bus_num = 0;
++ sp->bitbang.master->num_chipselect = 3;
++ }
++
++ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (r == NULL) {
++ ret = -ENOENT;
++ goto err1;
++ }
++
++ sp->base = ioremap_nocache(r->start, r->end - r->start + 1);
++ if (!sp->base) {
++ ret = -ENXIO;
++ goto err1;
++ }
++
++ sp->reg_ctrl = ar71xx_spi_rr(sp, SPI_REG_IOC);
++
++ ret = spi_bitbang_start(&sp->bitbang);
++ if (!ret)
++ return 0;
++
++ iounmap(sp->base);
++err1:
++ platform_set_drvdata(pdev, NULL);
++ spi_master_put(sp->bitbang.master);
++
++ return ret;
++}
++
++static int ar71xx_spi_remove(struct platform_device *pdev)
++{
++ struct ar71xx_spi *sp = platform_get_drvdata(pdev);
++
++ spi_bitbang_stop(&sp->bitbang);
++ iounmap(sp->base);
++ platform_set_drvdata(pdev, NULL);
++ spi_master_put(sp->bitbang.master);
++
++ return 0;
++}
++
++static struct platform_driver ar71xx_spi_drv = {
++ .probe = ar71xx_spi_probe,
++ .remove = ar71xx_spi_remove,
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init ar71xx_spi_init(void)
++{
++ printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
++ return platform_driver_register(&ar71xx_spi_drv);
++}
++module_init(ar71xx_spi_init);
++
++static void __exit ar71xx_spi_exit(void)
++{
++ platform_driver_unregister(&ar71xx_spi_drv);
++}
++module_exit(ar71xx_spi_exit);
++
++MODULE_ALIAS("platform:" DRV_NAME);
++MODULE_DESCRIPTION(DRV_DESC);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/Kconfig linux-2.6.29.1/drivers/usb/host/Kconfig
+--- linux-2.6.29.1.orig/drivers/usb/host/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/host/Kconfig 2009-04-13 14:27:34.855087329 +0200
+@@ -81,6 +81,12 @@
+ depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX)
+ default y
+
++config USB_EHCI_AR71XX
++ bool "USB EHCI support for AR71xx"
++ depends on USB_EHCI_HCD && ATHEROS_AR71XX
++ help
++ Support for Atheros AR71xx built-in EHCI controller
++
+ config USB_EHCI_FSL
+ bool "Support for Freescale on-chip EHCI USB controller"
+ depends on USB_EHCI_HCD && FSL_SOC
+@@ -154,6 +160,12 @@
+ To compile this driver as a module, choose M here: the
+ module will be called ohci-hcd.
+
++config USB_OHCI_AR71XX
++ bool "USB OHCI support for Atheros AR71xx"
++ depends on USB_OHCI_HCD && ATHEROS_AR71XX
++ help
++ Support for Atheros AR71xx built-in OHCI controller
++
+ config USB_OHCI_HCD_PPC_SOC
+ bool "OHCI support for on-chip PPC USB controller"
+ depends on USB_OHCI_HCD && (STB03xxx || PPC_MPC52xx)
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ehci-ar71xx.c linux-2.6.29.1/drivers/usb/host/ehci-ar71xx.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ehci-ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/usb/host/ehci-ar71xx.c 2009-04-13 14:27:34.859087838 +0200
+@@ -0,0 +1,235 @@
++/*
++ * Bus Glue for Atheros AR71xx built-in EHCI controller.
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ * Copyright (C) 2007 Atheros Communications, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++
++#include <asm/mach-ar71xx/platform.h>
++
++extern int usb_disabled(void);
++
++static int ehci_ar71xx_init(struct usb_hcd *hcd)
++{
++ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
++ int ret;
++
++ ehci->caps = hcd->regs;
++ ehci->regs = hcd->regs +
++ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
++ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
++
++ ehci->sbrn = 0x20;
++
++ ehci_reset(ehci);
++
++ ret = ehci_init(hcd);
++ if (ret)
++ return ret;
++
++ ehci_port_power(ehci, 0);
++
++ return 0;
++}
++
++static int ehci_ar91xx_init(struct usb_hcd *hcd)
++{
++ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
++ int ret;
++
++ ehci->caps = hcd->regs + 0x100;
++ ehci->regs = hcd->regs + 0x100 +
++ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
++ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
++
++ hcd->has_tt = 1;
++ ehci->sbrn = 0x20;
++
++ ehci_reset(ehci);
++
++ ret = ehci_init(hcd);
++ if (ret)
++ return ret;
++
++ ehci_port_power(ehci, 0);
++
++ return 0;
++}
++
++static int ehci_ar71xx_probe(const struct hc_driver *driver,
++ struct usb_hcd **hcd_out,
++ struct platform_device *pdev)
++{
++ struct usb_hcd *hcd;
++ struct resource *res;
++ int irq;
++ int ret;
++
++ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no IRQ specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++ irq = res->start;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no base address specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++
++ hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
++ if (!hcd)
++ return -ENOMEM;
++
++ hcd->rsrc_start = res->start;
++ hcd->rsrc_len = res->end - res->start + 1;
++
++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
++ dev_dbg(&pdev->dev, "controller already in use\n");
++ ret = -EBUSY;
++ goto err_put_hcd;
++ }
++
++ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
++ if (!hcd->regs) {
++ dev_dbg(&pdev->dev, "error mapping memory\n");
++ ret = -EFAULT;
++ goto err_release_region;
++ }
++
++ ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
++ if (ret)
++ goto err_iounmap;
++
++ return 0;
++
++ err_iounmap:
++ iounmap(hcd->regs);
++
++ err_release_region:
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ err_put_hcd:
++ usb_put_hcd(hcd);
++ return ret;
++}
++
++static void ehci_ar71xx_remove(struct usb_hcd *hcd,
++ struct platform_device *pdev)
++{
++ usb_remove_hcd(hcd);
++ iounmap(hcd->regs);
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ usb_put_hcd(hcd);
++}
++
++static const struct hc_driver ehci_ar71xx_hc_driver = {
++ .description = hcd_name,
++ .product_desc = "Atheros AR71xx built-in EHCI controller",
++ .hcd_priv_size = sizeof(struct ehci_hcd),
++
++ .irq = ehci_irq,
++ .flags = HCD_MEMORY | HCD_USB2,
++
++ .reset = ehci_ar71xx_init,
++ .start = ehci_run,
++ .stop = ehci_stop,
++ .shutdown = ehci_shutdown,
++
++ .urb_enqueue = ehci_urb_enqueue,
++ .urb_dequeue = ehci_urb_dequeue,
++ .endpoint_disable = ehci_endpoint_disable,
++
++ .get_frame_number = ehci_get_frame,
++
++ .hub_status_data = ehci_hub_status_data,
++ .hub_control = ehci_hub_control,
++#ifdef CONFIG_PM
++ .hub_suspend = ehci_hub_suspend,
++ .hub_resume = ehci_hub_resume,
++#endif
++ .relinquish_port = ehci_relinquish_port,
++ .port_handed_over = ehci_port_handed_over,
++};
++
++static const struct hc_driver ehci_ar91xx_hc_driver = {
++ .description = hcd_name,
++ .product_desc = "Atheros AR91xx built-in EHCI controller",
++ .hcd_priv_size = sizeof(struct ehci_hcd),
++ .irq = ehci_irq,
++ .flags = HCD_MEMORY | HCD_USB2,
++
++ .reset = ehci_ar91xx_init,
++ .start = ehci_run,
++ .stop = ehci_stop,
++ .shutdown = ehci_shutdown,
++
++ .urb_enqueue = ehci_urb_enqueue,
++ .urb_dequeue = ehci_urb_dequeue,
++ .endpoint_disable = ehci_endpoint_disable,
++
++ .get_frame_number = ehci_get_frame,
++
++ .hub_status_data = ehci_hub_status_data,
++ .hub_control = ehci_hub_control,
++#ifdef CONFIG_PM
++ .hub_suspend = ehci_hub_suspend,
++ .hub_resume = ehci_hub_resume,
++#endif
++ .relinquish_port = ehci_relinquish_port,
++ .port_handed_over = ehci_port_handed_over,
++};
++
++static int ehci_ar71xx_driver_probe(struct platform_device *pdev)
++{
++ struct ar71xx_ehci_platform_data *pdata;
++ struct usb_hcd *hcd = NULL;
++ int ret;
++
++ if (usb_disabled())
++ return -ENODEV;
++
++ pdata = pdev->dev.platform_data;
++ if (!pdata) {
++ dev_err(&pdev->dev, "no platform data specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++
++ if (pdata->is_ar91xx)
++ ret = ehci_ar71xx_probe(&ehci_ar91xx_hc_driver, &hcd, pdev);
++ else
++ ret = ehci_ar71xx_probe(&ehci_ar71xx_hc_driver, &hcd, pdev);
++
++ return ret;
++}
++
++static int ehci_ar71xx_driver_remove(struct platform_device *pdev)
++{
++ struct usb_hcd *hcd = platform_get_drvdata(pdev);
++
++ ehci_ar71xx_remove(hcd, pdev);
++ return 0;
++}
++
++MODULE_ALIAS("platform:ar71xx-ehci");
++
++static struct platform_driver ehci_ar71xx_driver = {
++ .probe = ehci_ar71xx_driver_probe,
++ .remove = ehci_ar71xx_driver_remove,
++ .driver = {
++ .name = "ar71xx-ehci",
++ }
++};
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ehci-hcd.c linux-2.6.29.1/drivers/usb/host/ehci-hcd.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ehci-hcd.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/host/ehci-hcd.c 2009-04-13 14:27:34.859087838 +0200
+@@ -1036,6 +1036,11 @@
+ #define PLATFORM_DRIVER ixp4xx_ehci_driver
+ #endif
+
++#ifdef CONFIG_USB_EHCI_AR71XX
++#include "ehci-ar71xx.c"
++#define PLATFORM_DRIVER ehci_ar71xx_driver
++#endif
++
+ #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
+ !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
+ #error "missing bus glue for ehci-hcd"
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ohci-ar71xx.c linux-2.6.29.1/drivers/usb/host/ohci-ar71xx.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ohci-ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/usb/host/ohci-ar71xx.c 2009-04-13 14:27:34.887088611 +0200
+@@ -0,0 +1,165 @@
++/*
++ * OHCI HCD (Host Controller Driver) for USB.
++ *
++ * Bus Glue for Atheros AR71xx built-in OHCI controller.
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ * Copyright (C) 2007 Atheros Communications, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++
++extern int usb_disabled(void);
++
++static int usb_hcd_ar71xx_probe(const struct hc_driver *driver,
++ struct platform_device *pdev)
++{
++ struct usb_hcd *hcd;
++ struct resource *res;
++ int irq;
++ int ret;
++
++ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no IRQ specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++ irq = res->start;
++
++ hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
++ if (!hcd)
++ return -ENOMEM;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no base address specified for %s\n",
++ pdev->dev.bus_id);
++ ret = -ENODEV;
++ goto err_put_hcd;
++ }
++ hcd->rsrc_start = res->start;
++ hcd->rsrc_len = res->end - res->start + 1;
++
++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
++ dev_dbg(&pdev->dev, "controller already in use\n");
++ ret = -EBUSY;
++ goto err_put_hcd;
++ }
++
++ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
++ if (!hcd->regs) {
++ dev_dbg(&pdev->dev, "error mapping memory\n");
++ ret = -EFAULT;
++ goto err_release_region;
++ }
++
++ ohci_hcd_init(hcd_to_ohci(hcd));
++
++ ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
++ if (ret)
++ goto err_stop_hcd;
++
++ return 0;
++
++ err_stop_hcd:
++ iounmap(hcd->regs);
++ err_release_region:
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ err_put_hcd:
++ usb_put_hcd(hcd);
++ return ret;
++}
++
++void usb_hcd_ar71xx_remove(struct usb_hcd *hcd, struct platform_device *pdev)
++{
++ usb_remove_hcd(hcd);
++ iounmap(hcd->regs);
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ usb_put_hcd(hcd);
++}
++
++static int __devinit ohci_ar71xx_start(struct usb_hcd *hcd)
++{
++ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
++ int ret;
++
++ ret = ohci_init(ohci);
++ if (ret < 0)
++ return ret;
++
++ ret = ohci_run(ohci);
++ if (ret < 0)
++ goto err;
++
++ return 0;
++
++ err:
++ ohci_stop(hcd);
++ return ret;
++}
++
++static const struct hc_driver ohci_ar71xx_hc_driver = {
++ .description = hcd_name,
++ .product_desc = "Atheros AR71xx built-in OHCI controller",
++ .hcd_priv_size = sizeof(struct ohci_hcd),
++
++ .irq = ohci_irq,
++ .flags = HCD_USB11 | HCD_MEMORY,
++
++ .start = ohci_ar71xx_start,
++ .stop = ohci_stop,
++ .shutdown = ohci_shutdown,
++
++ .urb_enqueue = ohci_urb_enqueue,
++ .urb_dequeue = ohci_urb_dequeue,
++ .endpoint_disable = ohci_endpoint_disable,
++
++ /*
++ * scheduling support
++ */
++ .get_frame_number = ohci_get_frame,
++
++ /*
++ * root hub support
++ */
++ .hub_status_data = ohci_hub_status_data,
++ .hub_control = ohci_hub_control,
++ .start_port_reset = ohci_start_port_reset,
++};
++
++static int ohci_hcd_ar71xx_drv_probe(struct platform_device *pdev)
++{
++ if (usb_disabled())
++ return -ENODEV;
++
++ return usb_hcd_ar71xx_probe(&ohci_ar71xx_hc_driver, pdev);
++}
++
++static int ohci_hcd_ar71xx_drv_remove(struct platform_device *pdev)
++{
++ struct usb_hcd *hcd = platform_get_drvdata(pdev);
++
++ usb_hcd_ar71xx_remove(hcd, pdev);
++ return 0;
++}
++
++MODULE_ALIAS("platform:ar71xx-ohci");
++
++static struct platform_driver ohci_hcd_ar71xx_driver = {
++ .probe = ohci_hcd_ar71xx_drv_probe,
++ .remove = ohci_hcd_ar71xx_drv_remove,
++ .shutdown = usb_hcd_platform_shutdown,
++ .driver = {
++ .name = "ar71xx-ohci",
++ .owner = THIS_MODULE,
++ },
++};
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ohci-hcd.c linux-2.6.29.1/drivers/usb/host/ohci-hcd.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ohci-hcd.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/host/ohci-hcd.c 2009-04-13 14:27:34.887088611 +0200
+@@ -1080,6 +1080,11 @@
+ #define TMIO_OHCI_DRIVER ohci_hcd_tmio_driver
+ #endif
+
++#ifdef CONFIG_USB_OHCI_AR71XX
++#include "ohci-ar71xx.c"
++#define PLATFORM_DRIVER ohci_hcd_ar71xx_driver
++#endif
++
+ #if !defined(PCI_DRIVER) && \
+ !defined(PLATFORM_DRIVER) && \
+ !defined(OF_PLATFORM_DRIVER) && \
+diff -Nur linux-2.6.29.1.orig/drivers/watchdog/Kconfig linux-2.6.29.1/drivers/watchdog/Kconfig
+--- linux-2.6.29.1.orig/drivers/watchdog/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/watchdog/Kconfig 2009-04-13 14:27:34.891089680 +0200
+@@ -766,6 +766,13 @@
+ help
+ Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs.
+
++config AR71XX_WDT
++ tristate "Atheros AR71xx Watchdog Timer"
++ depends on ATHEROS_AR71XX
++ help
++ Hardware driver for the built-in watchdog timer on the Atheros
++ AR71xx SoCs.
++
+ # PARISC Architecture
+
+ # POWERPC Architecture
+diff -Nur linux-2.6.29.1.orig/drivers/watchdog/Makefile linux-2.6.29.1/drivers/watchdog/Makefile
+--- linux-2.6.29.1.orig/drivers/watchdog/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/watchdog/Makefile 2009-04-13 14:27:34.891089680 +0200
+@@ -107,6 +107,7 @@
+ obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
+ obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
+ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
++obj-$(CONFIG_AR71XX_WDT) += ar71xx_wdt.o
+
+ # PARISC Architecture
+
+diff -Nur linux-2.6.29.1.orig/drivers/watchdog/ar71xx_wdt.c linux-2.6.29.1/drivers/watchdog/ar71xx_wdt.c
+--- linux-2.6.29.1.orig/drivers/watchdog/ar71xx_wdt.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/watchdog/ar71xx_wdt.c 2009-04-13 14:27:34.915091622 +0200
+@@ -0,0 +1,270 @@
++/*
++ * Driver for the Atheros AR71xx SoC's built-in hardware watchdog timer.
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This driver was based on: drivers/watchdog/ixp4xx_wdt.c
++ * Author: Deepak Saxena <dsaxena@plexity.net>
++ * Copyright 2004 (c) MontaVista, Software, Inc.
++ *
++ * which again was based on sa1100 driver,
++ * Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#include <linux/bitops.h>
++#include <linux/errno.h>
++#include <linux/fs.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/miscdevice.h>
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++#include <linux/platform_device.h>
++#include <linux/types.h>
++#include <linux/watchdog.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#define DRV_NAME "ar71xx-wdt"
++#define DRV_DESC "Atheros AR71xx hardware watchdog driver"
++#define DRV_VERSION "0.1.0"
++
++#define WDT_TIMEOUT 15 /* seconds */
++
++static int nowayout = WATCHDOG_NOWAYOUT;
++
++#ifdef CONFIG_WATCHDOG_NOWAYOUT
++module_param(nowayout, int, 0);
++MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
++ "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
++#endif
++
++static unsigned long wdt_flags;
++
++#define WDT_FLAGS_BUSY 0
++#define WDT_FLAGS_EXPECT_CLOSE 1
++
++static int wdt_timeout = WDT_TIMEOUT;
++static int boot_status;
++static int max_timeout;
++
++static void inline ar71xx_wdt_keepalive(void)
++{
++ ar71xx_reset_wr(AR71XX_RESET_REG_WDOG, ar71xx_ahb_freq * wdt_timeout);
++}
++
++static void inline ar71xx_wdt_enable(void)
++{
++ printk(KERN_DEBUG DRV_NAME ": enabling watchdog timer\n");
++ ar71xx_wdt_keepalive();
++ ar71xx_reset_wr(AR71XX_RESET_REG_WDOG_CTRL, WDOG_CTRL_ACTION_FCR);
++}
++
++static void inline ar71xx_wdt_disable(void)
++{
++ printk(KERN_DEBUG DRV_NAME ": disabling watchdog timer\n");
++ ar71xx_reset_wr(AR71XX_RESET_REG_WDOG_CTRL, WDOG_CTRL_ACTION_NONE);
++}
++
++static int ar71xx_wdt_set_timeout(int val)
++{
++ if (val < 1 || val > max_timeout)
++ return -EINVAL;
++
++ wdt_timeout = val;
++ ar71xx_wdt_keepalive();
++
++ printk(KERN_DEBUG DRV_NAME ": timeout=%d secs\n", wdt_timeout);
++
++ return 0;
++}
++
++static int ar71xx_wdt_open(struct inode *inode, struct file *file)
++{
++ if (test_and_set_bit(WDT_FLAGS_BUSY, &wdt_flags))
++ return -EBUSY;
++
++ clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
++
++ ar71xx_wdt_enable();
++
++ return nonseekable_open(inode, file);
++}
++
++static int ar71xx_wdt_release(struct inode *inode, struct file *file)
++{
++ if (test_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags)) {
++ ar71xx_wdt_disable();
++ } else {
++ printk(KERN_CRIT DRV_NAME ": device closed unexpectedly, "
++ "watchdog timer will not stop!\n");
++ }
++
++ clear_bit(WDT_FLAGS_BUSY, &wdt_flags);
++ clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
++
++ return 0;
++}
++
++static ssize_t ar71xx_wdt_write(struct file *file, const char *data,
++ size_t len, loff_t *ppos)
++{
++ if (len) {
++ if (!nowayout) {
++ size_t i;
++
++ clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
++
++ for (i = 0; i != len; i++) {
++ char c;
++
++ if (get_user(c, data + i))
++ return -EFAULT;
++
++ if (c == 'V')
++ set_bit(WDT_FLAGS_EXPECT_CLOSE,
++ &wdt_flags);
++ }
++ }
++
++ ar71xx_wdt_keepalive();
++ }
++
++ return len;
++}
++
++static struct watchdog_info ar71xx_wdt_info = {
++ .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
++ WDIOF_MAGICCLOSE | WDIOF_CARDRESET,
++ .firmware_version = 0,
++ .identity = "AR71XX watchdog",
++};
++
++static int ar71xx_wdt_ioctl(struct inode *inode, struct file *file,
++ unsigned int cmd, unsigned long arg)
++{
++ int t;
++ int ret;
++
++ switch (cmd) {
++ case WDIOC_GETSUPPORT:
++ ret = copy_to_user((struct watchdog_info *)arg,
++ &ar71xx_wdt_info,
++ sizeof(&ar71xx_wdt_info)) ? -EFAULT : 0;
++ break;
++
++ case WDIOC_GETSTATUS:
++ ret = put_user(0, (int *)arg) ? -EFAULT : 0;
++ break;
++
++ case WDIOC_GETBOOTSTATUS:
++ ret = put_user(boot_status, (int *)arg) ? -EFAULT : 0;
++ break;
++
++ case WDIOC_KEEPALIVE:
++ ar71xx_wdt_keepalive();
++ ret = 0;
++ break;
++
++ case WDIOC_SETTIMEOUT:
++ ret = get_user(t, (int *)arg) ? -EFAULT : 0;
++ if (ret)
++ break;
++
++ ret = ar71xx_wdt_set_timeout(t);
++ if (ret)
++ break;
++
++ /* fallthrough */
++ case WDIOC_GETTIMEOUT:
++ ret = put_user(wdt_timeout, (int *)arg) ? -EFAULT : 0;
++ break;
++
++ default:
++ ret = -ENOTTY;
++ break;
++ }
++
++ return ret;
++}
++
++static const struct file_operations ar71xx_wdt_fops = {
++ .owner = THIS_MODULE,
++ .write = ar71xx_wdt_write,
++ .ioctl = ar71xx_wdt_ioctl,
++ .open = ar71xx_wdt_open,
++ .release = ar71xx_wdt_release,
++};
++
++static struct miscdevice ar71xx_wdt_miscdev = {
++ .minor = WATCHDOG_MINOR,
++ .name = "watchdog",
++ .fops = &ar71xx_wdt_fops,
++};
++
++static int __devinit ar71xx_wdt_probe(struct platform_device *pdev)
++{
++ int ret;
++
++ max_timeout = (0xfffffffful / ar71xx_ahb_freq);
++ wdt_timeout = (max_timeout < WDT_TIMEOUT) ? max_timeout : WDT_TIMEOUT;
++
++ boot_status =
++ (ar71xx_reset_rr(AR71XX_RESET_REG_WDOG_CTRL) & WDOG_CTRL_LAST_RESET) ?
++ WDIOF_CARDRESET : 0;
++
++ ret = misc_register(&ar71xx_wdt_miscdev);
++ if (ret)
++ goto err_out;
++
++ printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
++
++ printk(KERN_DEBUG DRV_NAME ": timeout=%d secs (max=%d)\n",
++ wdt_timeout, max_timeout);
++
++ return 0;
++
++err_out:
++ return ret;
++}
++
++static int __devexit ar71xx_wdt_remove(struct platform_device *pdev)
++{
++ misc_deregister(&ar71xx_wdt_miscdev);
++ return 0;
++}
++
++static struct platform_driver ar71xx_wdt_driver = {
++ .probe = ar71xx_wdt_probe,
++ .remove = __devexit_p(ar71xx_wdt_remove),
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init ar71xx_wdt_init(void)
++{
++ return platform_driver_register(&ar71xx_wdt_driver);
++}
++module_init(ar71xx_wdt_init);
++
++static void __exit ar71xx_wdt_exit(void)
++{
++ platform_driver_unregister(&ar71xx_wdt_driver);
++}
++module_exit(ar71xx_wdt_exit);
++
++MODULE_DESCRIPTION(DRV_DESC);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:" DRV_NAME);
++MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+diff -Nur linux-2.6.29.1.orig/include/asm-mips/mips_machine.h linux-2.6.29.1/include/asm-mips/mips_machine.h
+--- linux-2.6.29.1.orig/include/asm-mips/mips_machine.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/asm-mips/mips_machine.h 2009-04-13 14:27:34.915091622 +0200
+@@ -0,0 +1,47 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#ifndef __ASM_MIPS_MACHINE_H
++#define __ASM_MIPS_MACHINE_H
++
++#include <linux/init.h>
++#include <linux/list.h>
++
++#define MIPS_MACHINE_NAME_LEN 64
++
++struct mips_machine {
++ unsigned long mach_type;
++ void (*mach_setup)(void);
++ unsigned char mach_name[MIPS_MACHINE_NAME_LEN];
++ struct list_head list;
++};
++
++void mips_machine_register(struct mips_machine *) __init;
++void mips_machine_setup(unsigned long machtype) __init;
++
++extern unsigned char mips_machine_name[MIPS_MACHINE_NAME_LEN];
++
++#define MIPS_MACHINE(_type, _name, _setup) \
++static struct mips_machine machine_##_type __initdata = \
++{ \
++ .mach_type = _type, \
++ .mach_name = _name, \
++ .mach_setup = _setup, \
++}; \
++ \
++static int __init register_machine_##_type(void) \
++{ \
++ mips_machine_register(&machine_##_type); \
++ return 0; \
++} \
++ \
++pure_initcall(register_machine_##_type)
++
++#endif /* __ASM_MIPS_MACHINE_H */
++
+diff -Nur linux-2.6.29.1.orig/include/linux/ath9k_platform.h linux-2.6.29.1/include/linux/ath9k_platform.h
+--- linux-2.6.29.1.orig/include/linux/ath9k_platform.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/linux/ath9k_platform.h 2009-04-13 14:27:34.915091622 +0200
+@@ -0,0 +1,20 @@
++/*
++ * ath9k platform data defines
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef _LINUX_ATH9K_PLATFORM_H
++#define _LINUX_ATH9L_PLATFORM_H
++
++#define ATH9K_PLAT_EEP_MAX_WORDS 2048
++
++struct ath9k_platform_data {
++ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
++};
++
++#endif /* _LINUX_ATH9K_PLATFORM_H */
+diff -Nur linux-2.6.29.1.orig/include/linux/gpio_buttons.h linux-2.6.29.1/include/linux/gpio_buttons.h
+--- linux-2.6.29.1.orig/include/linux/gpio_buttons.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/linux/gpio_buttons.h 2009-04-13 14:27:34.919091574 +0200
+@@ -0,0 +1,35 @@
++/*
++ * Definitions for the GPIO buttons interface driver
++ *
++ * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
++ *
++ * This file was based on: /include/linux/gpio_keys.h
++ * The original gpio_keys.h seems not to have a license.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#ifndef _GPIO_BUTTONS_H_
++#define _GPIO_BUTTONS_H_
++
++struct gpio_button {
++ int gpio; /* GPIO line number */
++ int active_low;
++ char *desc; /* button description */
++ int type; /* input event type (EV_KEY, EV_SW) */
++ int code; /* input event code (KEY_*, SW_*) */
++ int count;
++ int threshold; /* count threshold */
++};
++
++struct gpio_buttons_platform_data {
++ struct gpio_button *buttons;
++ int nbuttons; /* number of buttons */
++ int poll_interval; /* polling interval */
++};
++
++#endif /* _GPIO_BUTTONS_H_ */
++
+diff -Nur linux-2.6.29.1.orig/include/linux/phy.h linux-2.6.29.1/include/linux/phy.h
+--- linux-2.6.29.1.orig/include/linux/phy.h 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/include/linux/phy.h 2009-04-13 17:29:37.057990291 +0200
+@@ -478,6 +478,7 @@
+ void phy_stop_machine(struct phy_device *phydev);
+ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
+ int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr);
+ int phy_mii_ioctl(struct phy_device *phydev,
+ struct mii_ioctl_data *mii_data, int cmd);
+ int phy_start_interrupts(struct phy_device *phydev);
+diff -Nur linux-2.6.29.1.orig/include/linux/phy.h.orig linux-2.6.29.1/include/linux/phy.h.orig
+--- linux-2.6.29.1.orig/include/linux/phy.h.orig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/linux/phy.h.orig 2009-04-02 22:55:27.000000000 +0200
+@@ -0,0 +1,500 @@
++/*
++ * include/linux/phy.h
++ *
++ * Framework and drivers for configuring and reading different PHYs
++ * Based on code in sungem_phy.c and gianfar_phy.c
++ *
++ * Author: Andy Fleming
++ *
++ * Copyright (c) 2004 Freescale Semiconductor, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#ifndef __PHY_H
++#define __PHY_H
++
++#include <linux/spinlock.h>
++#include <linux/device.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/timer.h>
++#include <linux/workqueue.h>
++
++#include <asm/atomic.h>
++
++#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
++ SUPPORTED_10baseT_Full | \
++ SUPPORTED_100baseT_Half | \
++ SUPPORTED_100baseT_Full | \
++ SUPPORTED_Autoneg | \
++ SUPPORTED_TP | \
++ SUPPORTED_MII)
++
++#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \
++ SUPPORTED_1000baseT_Half | \
++ SUPPORTED_1000baseT_Full)
++
++/*
++ * Set phydev->irq to PHY_POLL if interrupts are not supported,
++ * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
++ * the attached driver handles the interrupt
++ */
++#define PHY_POLL -1
++#define PHY_IGNORE_INTERRUPT -2
++
++#define PHY_HAS_INTERRUPT 0x00000001
++#define PHY_HAS_MAGICANEG 0x00000002
++
++/* Interface Mode definitions */
++typedef enum {
++ PHY_INTERFACE_MODE_MII,
++ PHY_INTERFACE_MODE_GMII,
++ PHY_INTERFACE_MODE_SGMII,
++ PHY_INTERFACE_MODE_TBI,
++ PHY_INTERFACE_MODE_RMII,
++ PHY_INTERFACE_MODE_RGMII,
++ PHY_INTERFACE_MODE_RGMII_ID,
++ PHY_INTERFACE_MODE_RGMII_RXID,
++ PHY_INTERFACE_MODE_RGMII_TXID,
++ PHY_INTERFACE_MODE_RTBI
++} phy_interface_t;
++
++
++#define PHY_INIT_TIMEOUT 100000
++#define PHY_STATE_TIME 1
++#define PHY_FORCE_TIMEOUT 10
++#define PHY_AN_TIMEOUT 10
++
++#define PHY_MAX_ADDR 32
++
++/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
++#define PHY_ID_FMT "%s:%02x"
++
++/*
++ * Need to be a little smaller than phydev->dev.bus_id to leave room
++ * for the ":%02x"
++ */
++#define MII_BUS_ID_SIZE (BUS_ID_SIZE - 3)
++
++/*
++ * The Bus class for PHYs. Devices which provide access to
++ * PHYs should register using this structure
++ */
++struct mii_bus {
++ const char *name;
++ char id[MII_BUS_ID_SIZE];
++ void *priv;
++ int (*read)(struct mii_bus *bus, int phy_id, int regnum);
++ int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
++ int (*reset)(struct mii_bus *bus);
++
++ /*
++ * A lock to ensure that only one thing can read/write
++ * the MDIO bus at a time
++ */
++ struct mutex mdio_lock;
++
++ struct device *parent;
++ enum {
++ MDIOBUS_ALLOCATED = 1,
++ MDIOBUS_REGISTERED,
++ MDIOBUS_UNREGISTERED,
++ MDIOBUS_RELEASED,
++ } state;
++ struct device dev;
++
++ /* list of all PHYs on bus */
++ struct phy_device *phy_map[PHY_MAX_ADDR];
++
++ /* Phy addresses to be ignored when probing */
++ u32 phy_mask;
++
++ /*
++ * Pointer to an array of interrupts, each PHY's
++ * interrupt at the index matching its address
++ */
++ int *irq;
++};
++#define to_mii_bus(d) container_of(d, struct mii_bus, dev)
++
++struct mii_bus *mdiobus_alloc(void);
++int mdiobus_register(struct mii_bus *bus);
++void mdiobus_unregister(struct mii_bus *bus);
++void mdiobus_free(struct mii_bus *bus);
++struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
++int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum);
++int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val);
++
++
++#define PHY_INTERRUPT_DISABLED 0x0
++#define PHY_INTERRUPT_ENABLED 0x80000000
++
++/* PHY state machine states:
++ *
++ * DOWN: PHY device and driver are not ready for anything. probe
++ * should be called if and only if the PHY is in this state,
++ * given that the PHY device exists.
++ * - PHY driver probe function will, depending on the PHY, set
++ * the state to STARTING or READY
++ *
++ * STARTING: PHY device is coming up, and the ethernet driver is
++ * not ready. PHY drivers may set this in the probe function.
++ * If they do, they are responsible for making sure the state is
++ * eventually set to indicate whether the PHY is UP or READY,
++ * depending on the state when the PHY is done starting up.
++ * - PHY driver will set the state to READY
++ * - start will set the state to PENDING
++ *
++ * READY: PHY is ready to send and receive packets, but the
++ * controller is not. By default, PHYs which do not implement
++ * probe will be set to this state by phy_probe(). If the PHY
++ * driver knows the PHY is ready, and the PHY state is STARTING,
++ * then it sets this STATE.
++ * - start will set the state to UP
++ *
++ * PENDING: PHY device is coming up, but the ethernet driver is
++ * ready. phy_start will set this state if the PHY state is
++ * STARTING.
++ * - PHY driver will set the state to UP when the PHY is ready
++ *
++ * UP: The PHY and attached device are ready to do work.
++ * Interrupts should be started here.
++ * - timer moves to AN
++ *
++ * AN: The PHY is currently negotiating the link state. Link is
++ * therefore down for now. phy_timer will set this state when it
++ * detects the state is UP. config_aneg will set this state
++ * whenever called with phydev->autoneg set to AUTONEG_ENABLE.
++ * - If autonegotiation finishes, but there's no link, it sets
++ * the state to NOLINK.
++ * - If aneg finishes with link, it sets the state to RUNNING,
++ * and calls adjust_link
++ * - If autonegotiation did not finish after an arbitrary amount
++ * of time, autonegotiation should be tried again if the PHY
++ * supports "magic" autonegotiation (back to AN)
++ * - If it didn't finish, and no magic_aneg, move to FORCING.
++ *
++ * NOLINK: PHY is up, but not currently plugged in.
++ * - If the timer notes that the link comes back, we move to RUNNING
++ * - config_aneg moves to AN
++ * - phy_stop moves to HALTED
++ *
++ * FORCING: PHY is being configured with forced settings
++ * - if link is up, move to RUNNING
++ * - If link is down, we drop to the next highest setting, and
++ * retry (FORCING) after a timeout
++ * - phy_stop moves to HALTED
++ *
++ * RUNNING: PHY is currently up, running, and possibly sending
++ * and/or receiving packets
++ * - timer will set CHANGELINK if we're polling (this ensures the
++ * link state is polled every other cycle of this state machine,
++ * which makes it every other second)
++ * - irq will set CHANGELINK
++ * - config_aneg will set AN
++ * - phy_stop moves to HALTED
++ *
++ * CHANGELINK: PHY experienced a change in link state
++ * - timer moves to RUNNING if link
++ * - timer moves to NOLINK if the link is down
++ * - phy_stop moves to HALTED
++ *
++ * HALTED: PHY is up, but no polling or interrupts are done. Or
++ * PHY is in an error state.
++ *
++ * - phy_start moves to RESUMING
++ *
++ * RESUMING: PHY was halted, but now wants to run again.
++ * - If we are forcing, or aneg is done, timer moves to RUNNING
++ * - If aneg is not done, timer moves to AN
++ * - phy_stop moves to HALTED
++ */
++enum phy_state {
++ PHY_DOWN=0,
++ PHY_STARTING,
++ PHY_READY,
++ PHY_PENDING,
++ PHY_UP,
++ PHY_AN,
++ PHY_RUNNING,
++ PHY_NOLINK,
++ PHY_FORCING,
++ PHY_CHANGELINK,
++ PHY_HALTED,
++ PHY_RESUMING
++};
++
++/* phy_device: An instance of a PHY
++ *
++ * drv: Pointer to the driver for this PHY instance
++ * bus: Pointer to the bus this PHY is on
++ * dev: driver model device structure for this PHY
++ * phy_id: UID for this device found during discovery
++ * state: state of the PHY for management purposes
++ * dev_flags: Device-specific flags used by the PHY driver.
++ * addr: Bus address of PHY
++ * link_timeout: The number of timer firings to wait before the
++ * giving up on the current attempt at acquiring a link
++ * irq: IRQ number of the PHY's interrupt (-1 if none)
++ * phy_timer: The timer for handling the state machine
++ * phy_queue: A work_queue for the interrupt
++ * attached_dev: The attached enet driver's device instance ptr
++ * adjust_link: Callback for the enet controller to respond to
++ * changes in the link state.
++ * adjust_state: Callback for the enet driver to respond to
++ * changes in the state machine.
++ *
++ * speed, duplex, pause, supported, advertising, and
++ * autoneg are used like in mii_if_info
++ *
++ * interrupts currently only supports enabled or disabled,
++ * but could be changed in the future to support enabling
++ * and disabling specific interrupts
++ *
++ * Contains some infrastructure for polling and interrupt
++ * handling, as well as handling shifts in PHY hardware state
++ */
++struct phy_device {
++ /* Information about the PHY type */
++ /* And management functions */
++ struct phy_driver *drv;
++
++ struct mii_bus *bus;
++
++ struct device dev;
++
++ u32 phy_id;
++
++ enum phy_state state;
++
++ u32 dev_flags;
++
++ phy_interface_t interface;
++
++ /* Bus address of the PHY (0-32) */
++ int addr;
++
++ /*
++ * forced speed & duplex (no autoneg)
++ * partner speed & duplex & pause (autoneg)
++ */
++ int speed;
++ int duplex;
++ int pause;
++ int asym_pause;
++
++ /* The most recently read link state */
++ int link;
++
++ /* Enabled Interrupts */
++ u32 interrupts;
++
++ /* Union of PHY and Attached devices' supported modes */
++ /* See mii.h for more info */
++ u32 supported;
++ u32 advertising;
++
++ int autoneg;
++
++ int link_timeout;
++
++ /*
++ * Interrupt number for this PHY
++ * -1 means no interrupt
++ */
++ int irq;
++
++ /* private data pointer */
++ /* For use by PHYs to maintain extra state */
++ void *priv;
++
++ /* Interrupt and Polling infrastructure */
++ struct work_struct phy_queue;
++ struct work_struct state_queue;
++ struct timer_list phy_timer;
++ atomic_t irq_disable;
++
++ struct mutex lock;
++
++ struct net_device *attached_dev;
++
++ void (*adjust_link)(struct net_device *dev);
++
++ void (*adjust_state)(struct net_device *dev);
++};
++#define to_phy_device(d) container_of(d, struct phy_device, dev)
++
++/* struct phy_driver: Driver structure for a particular PHY type
++ *
++ * phy_id: The result of reading the UID registers of this PHY
++ * type, and ANDing them with the phy_id_mask. This driver
++ * only works for PHYs with IDs which match this field
++ * name: The friendly name of this PHY type
++ * phy_id_mask: Defines the important bits of the phy_id
++ * features: A list of features (speed, duplex, etc) supported
++ * by this PHY
++ * flags: A bitfield defining certain other features this PHY
++ * supports (like interrupts)
++ *
++ * The drivers must implement config_aneg and read_status. All
++ * other functions are optional. Note that none of these
++ * functions should be called from interrupt time. The goal is
++ * for the bus read/write functions to be able to block when the
++ * bus transaction is happening, and be freed up by an interrupt
++ * (The MPC85xx has this ability, though it is not currently
++ * supported in the driver).
++ */
++struct phy_driver {
++ u32 phy_id;
++ char *name;
++ unsigned int phy_id_mask;
++ u32 features;
++ u32 flags;
++
++ /*
++ * Called to initialize the PHY,
++ * including after a reset
++ */
++ int (*config_init)(struct phy_device *phydev);
++
++ /*
++ * Called during discovery. Used to set
++ * up device-specific structures, if any
++ */
++ int (*probe)(struct phy_device *phydev);
++
++ /* PHY Power Management */
++ int (*suspend)(struct phy_device *phydev);
++ int (*resume)(struct phy_device *phydev);
++
++ /*
++ * Configures the advertisement and resets
++ * autonegotiation if phydev->autoneg is on,
++ * forces the speed to the current settings in phydev
++ * if phydev->autoneg is off
++ */
++ int (*config_aneg)(struct phy_device *phydev);
++
++ /* Determines the negotiated speed and duplex */
++ int (*read_status)(struct phy_device *phydev);
++
++ /* Clears any pending interrupts */
++ int (*ack_interrupt)(struct phy_device *phydev);
++
++ /* Enables or disables interrupts */
++ int (*config_intr)(struct phy_device *phydev);
++
++ /* Clears up any memory if needed */
++ void (*remove)(struct phy_device *phydev);
++
++ struct device_driver driver;
++};
++#define to_phy_driver(d) container_of(d, struct phy_driver, driver)
++
++#define PHY_ANY_ID "MATCH ANY PHY"
++#define PHY_ANY_UID 0xffffffff
++
++/* A Structure for boards to register fixups with the PHY Lib */
++struct phy_fixup {
++ struct list_head list;
++ char bus_id[BUS_ID_SIZE];
++ u32 phy_uid;
++ u32 phy_uid_mask;
++ int (*run)(struct phy_device *phydev);
++};
++
++/**
++ * phy_read - Convenience function for reading a given PHY register
++ * @phydev: the phy_device struct
++ * @regnum: register number to read
++ *
++ * NOTE: MUST NOT be called from interrupt context,
++ * because the bus read/write functions may wait for an interrupt
++ * to conclude the operation.
++ */
++static inline int phy_read(struct phy_device *phydev, u16 regnum)
++{
++ return mdiobus_read(phydev->bus, phydev->addr, regnum);
++}
++
++/**
++ * phy_write - Convenience function for writing a given PHY register
++ * @phydev: the phy_device struct
++ * @regnum: register number to write
++ * @val: value to write to @regnum
++ *
++ * NOTE: MUST NOT be called from interrupt context,
++ * because the bus read/write functions may wait for an interrupt
++ * to conclude the operation.
++ */
++static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
++{
++ return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
++}
++
++int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
++struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
++int phy_clear_interrupt(struct phy_device *phydev);
++int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
++struct phy_device * phy_attach(struct net_device *dev,
++ const char *bus_id, u32 flags, phy_interface_t interface);
++struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
++ void (*handler)(struct net_device *), u32 flags,
++ phy_interface_t interface);
++void phy_disconnect(struct phy_device *phydev);
++void phy_detach(struct phy_device *phydev);
++void phy_start(struct phy_device *phydev);
++void phy_stop(struct phy_device *phydev);
++int phy_start_aneg(struct phy_device *phydev);
++
++void phy_sanitize_settings(struct phy_device *phydev);
++int phy_stop_interrupts(struct phy_device *phydev);
++int phy_enable_interrupts(struct phy_device *phydev);
++int phy_disable_interrupts(struct phy_device *phydev);
++
++static inline int phy_read_status(struct phy_device *phydev) {
++ return phydev->drv->read_status(phydev);
++}
++
++int genphy_config_advert(struct phy_device *phydev);
++int genphy_setup_forced(struct phy_device *phydev);
++int genphy_restart_aneg(struct phy_device *phydev);
++int genphy_config_aneg(struct phy_device *phydev);
++int genphy_update_link(struct phy_device *phydev);
++int genphy_read_status(struct phy_device *phydev);
++int genphy_suspend(struct phy_device *phydev);
++int genphy_resume(struct phy_device *phydev);
++void phy_driver_unregister(struct phy_driver *drv);
++int phy_driver_register(struct phy_driver *new_driver);
++void phy_prepare_link(struct phy_device *phydev,
++ void (*adjust_link)(struct net_device *));
++void phy_start_machine(struct phy_device *phydev,
++ void (*handler)(struct net_device *));
++void phy_stop_machine(struct phy_device *phydev);
++int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
++int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
++int phy_mii_ioctl(struct phy_device *phydev,
++ struct mii_ioctl_data *mii_data, int cmd);
++int phy_start_interrupts(struct phy_device *phydev);
++void phy_print_status(struct phy_device *phydev);
++struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
++void phy_device_free(struct phy_device *phydev);
++
++int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
++ int (*run)(struct phy_device *));
++int phy_register_fixup_for_id(const char *bus_id,
++ int (*run)(struct phy_device *));
++int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
++ int (*run)(struct phy_device *));
++int phy_scan_fixups(struct phy_device *phydev);
++
++int __init mdio_bus_init(void);
++void mdio_bus_exit(void);
++
++extern struct bus_type mdio_bus_type;
++#endif /* __PHY_H */
diff --git a/target/rb411/uclibc.config b/target/rb411/uclibc.config
new file mode 100644
index 000000000..4f35e8d4c
--- /dev/null
+++ b/target/rb411/uclibc.config
@@ -0,0 +1,233 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30.1
+# Sun Apr 12 14:05:42 2009
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+TARGET_mips=y
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="mips"
+FORCE_OPTIONS_FOR_ARCH=y
+ARCH_CFLAGS="-mno-split-addresses"
+CONFIG_MIPS_O32_ABI=y
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_WANTS_BIG_ENDIAN=y
+# ARCH_WANTS_LITTLE_ENDIAN is not set
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+EXTRA_WARNINGS=y
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/rb433/Makefile b/target/rb433/Makefile
new file mode 100644
index 000000000..efb664bb5
--- /dev/null
+++ b/target/rb433/Makefile
@@ -0,0 +1,28 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+ cp $(LINUX_DIR)/vmlinux $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+
+ifeq ($(FS),nfsroot)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
+endif
+ifeq ($(FS),yaffs)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
+ @echo 'Format your NAND with Routerboot, boot via NFS and'
+ @echo 'then install kernel and filesystem:'
+ @echo 'mount -t yaffs2 /dev/mtdblock0 /mnt'
+ @echo 'cp ${DEVICE}-${ARCH}-kernel /mnt/kernel'
+endif
diff --git a/target/rb433/device.mk b/target/rb433/device.mk
new file mode 100644
index 000000000..a6038dc4f
--- /dev/null
+++ b/target/rb433/device.mk
@@ -0,0 +1,7 @@
+ARCH:= mips
+CPU_ARCH:= mips
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=mips32
diff --git a/target/rb433/files/etc/mdev.conf b/target/rb433/files/etc/mdev.conf
new file mode 100644
index 000000000..baa2eb140
--- /dev/null
+++ b/target/rb433/files/etc/mdev.conf
@@ -0,0 +1,10 @@
+device-mapper 0:0 660 @mkdir /dev/mapper
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/rb433/kernel.config b/target/rb433/kernel.config
new file mode 100644
index 000000000..faebe6b39
--- /dev/null
+++ b/target/rb433/kernel.config
@@ -0,0 +1,1031 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29.1
+# Sat Apr 18 15:10:41 2009
+#
+CONFIG_MIPS=y
+
+#
+# Machine selection
+#
+# CONFIG_MACH_ALCHEMY is not set
+CONFIG_ATHEROS_AR71XX=y
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_LEMOTE_FULONG is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_NEC_MARKEINS is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_PMC_MSP is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+# CONFIG_MIKROTIK_RB532 is not set
+# CONFIG_WR_PPMC is not set
+# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
+# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
+CONFIG_AR71XX_EARLY_SERIAL=y
+
+#
+# Atheros AR71xx machine selection
+#
+# CONFIG_AR71XX_MACH_AP81 is not set
+# CONFIG_AR71XX_MACH_AP83 is not set
+# CONFIG_AR71XX_MACH_PB42 is not set
+# CONFIG_AR71XX_MACH_AW_NR580 is not set
+# CONFIG_AR71XX_MACH_GENERIC is not set
+# CONFIG_AR71XX_MACH_WP543 is not set
+CONFIG_AR71XX_MACH_RB_4XX=y
+# CONFIG_AR71XX_MACH_WNR2000 is not set
+# CONFIG_AR71XX_MACH_MZK_W04NU is not set
+# CONFIG_AR71XX_MACH_MZK_W300NH is not set
+# CONFIG_AR71XX_MACH_TL_WR941ND is not set
+# CONFIG_AR71XX_MACH_TEW_632BRP is not set
+# CONFIG_AR71XX_MACH_UBNT is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+# CONFIG_HOTPLUG_CPU is not set
+CONFIG_MIPS_MACHINE=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_GPIO=y
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+
+#
+# CPU selection
+#
+# CONFIG_CPU_LOONGSON2 is not set
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_CAVIUM_OCTEON is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_UNEVICTABLE_LRU is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_48 is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_128 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=100
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_KEXEC is not set
+# CONFIG_SECCOMP is not set
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+# CONFIG_PROBE_INITRD_HEADER is not set
+# CONFIG_FREEZER is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_LEGACY is not set
+# CONFIG_PCI_STUB is not set
+CONFIG_MMU=y
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Power management options
+#
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_PM is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_MULTIPLE_TABLES is not set
+# CONFIG_IP_ROUTE_MULTIPATH is not set
+# CONFIG_IP_ROUTE_VERBOSE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=y
+# CONFIG_VLAN_8021Q_GVRP is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_PARTITIONS is not set
+# CONFIG_MTD_TESTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_INTEL_VR_NOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_VERIFY_WRITE is not set
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_CAFE is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+CONFIG_MTD_NAND_RB4XX=y
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=y
+CONFIG_SWCONFIG=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+CONFIG_ICPLUS_PHY=y
+CONFIG_IP175_PHY=y
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_TC35815 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SMSC9420 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+CONFIG_AG71XX=y
+# CONFIG_AG71XX_DEBUG is not set
+# CONFIG_AG71XX_AR8216_SUPPORT is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
+# CONFIG_JME is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_DEVKMEM is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+
+#
+# PCI GPIO expanders:
+#
+# CONFIG_GPIO_BT8XX is not set
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
+# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=0
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_CMDLINE="init=/init console=ttyS0,115200"
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_MANAGER2 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/rb433/patches/ar71xx.patch b/target/rb433/patches/ar71xx.patch
new file mode 100644
index 000000000..3646174f4
--- /dev/null
+++ b/target/rb433/patches/ar71xx.patch
@@ -0,0 +1,9913 @@
+diff -Nur linux-2.6.29.1.orig/arch/mips/Kconfig linux-2.6.29.1/arch/mips/Kconfig
+--- linux-2.6.29.1.orig/arch/mips/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/Kconfig 2009-04-13 14:27:23.734393467 +0200
+@@ -22,6 +22,23 @@
+ config MACH_ALCHEMY
+ bool "Alchemy processor based machines"
+
++config ATHEROS_AR71XX
++ bool "Atheros AR71xx based boards"
++ select CEVT_R4K
++ select CSRC_R4K
++ select DMA_NONCOHERENT
++ select HW_HAS_PCI
++ select IRQ_CPU
++ select ARCH_REQUIRE_GPIOLIB
++ select SYS_HAS_CPU_MIPS32_R1
++ select SYS_HAS_CPU_MIPS32_R2
++ select SYS_SUPPORTS_32BIT_KERNEL
++ select SYS_SUPPORTS_BIG_ENDIAN
++ select SYS_HAS_EARLY_PRINTK
++ select MIPS_MACHINE
++ help
++ Support for Atheros AR71xx based boards.
++
+ config BASLER_EXCITE
+ bool "Basler eXcite smart camera"
+ select CEVT_R4K
+@@ -640,6 +657,7 @@
+ endchoice
+
+ source "arch/mips/alchemy/Kconfig"
++source "arch/mips/ar71xx/Kconfig"
+ source "arch/mips/basler/excite/Kconfig"
+ source "arch/mips/jazz/Kconfig"
+ source "arch/mips/lasat/Kconfig"
+@@ -810,6 +828,9 @@
+ config SYNC_R4K
+ bool
+
++config MIPS_MACHINE
++ def_bool n
++
+ config NO_IOPORT
+ def_bool n
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/Makefile linux-2.6.29.1/arch/mips/Makefile
+--- linux-2.6.29.1.orig/arch/mips/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/Makefile 2009-04-13 14:27:34.483063970 +0200
+@@ -602,6 +602,14 @@
+ load-$(CONFIG_CPU_CAVIUM_OCTEON) += 0xffffffff81100000
+ endif
+
++#
++# Atheros AR71xx
++#
++core-$(CONFIG_ATHEROS_AR71XX) += arch/mips/ar71xx/
++cflags-$(CONFIG_ATHEROS_AR71XX) += -I$(srctree)/arch/mips/include/asm/mach-ar71xx
++load-$(CONFIG_ATHEROS_AR71XX) += 0xffffffff80060000
++
++
+ cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
+ drivers-$(CONFIG_PCI) += arch/mips/pci/
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/Kconfig linux-2.6.29.1/arch/mips/ar71xx/Kconfig
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/Kconfig 2009-04-13 14:27:34.483063970 +0200
+@@ -0,0 +1,64 @@
++if ATHEROS_AR71XX
++
++config AR71XX_EARLY_SERIAL
++ bool "Use early serial console"
++ default n
++
++menu "Atheros AR71xx machine selection"
++
++config AR71XX_MACH_AP81
++ bool "Atheros AP81 board support"
++ default y
++
++config AR71XX_MACH_AP83
++ bool "Atheros AP83 board support"
++ default y
++
++config AR71XX_MACH_PB42
++ bool "Atheros PB42 board support"
++ default y
++
++config AR71XX_MACH_AW_NR580
++ bool "AzureWave AW-NR580 board support"
++ default y
++
++config AR71XX_MACH_GENERIC
++ bool "Generic AR71xx based machine support"
++ default y
++
++config AR71XX_MACH_WP543
++ bool "Compex WP543 board support"
++ select MYLOADER
++ default y
++
++config AR71XX_MACH_RB_4XX
++ bool "MikroTik RouterBOARD 4xx series support"
++ default y
++
++config AR71XX_MACH_WNR2000
++ bool "NETGEAR WNR2000 board support"
++ default y
++
++config AR71XX_MACH_MZK_W04NU
++ bool "Planex MZK-W04NU board support"
++ default y
++
++config AR71XX_MACH_MZK_W300NH
++ bool "Planex MZK-W300NH board support"
++ default y
++
++config AR71XX_MACH_TL_WR941ND
++ bool "TP-LINK TL-WR941ND support"
++ default y
++
++config AR71XX_MACH_TEW_632BRP
++ bool "TRENDnet TEW-632BRP support"
++ default y
++
++config AR71XX_MACH_UBNT
++ bool "Ubiquiti AR71xx based boards support"
++ default y
++
++endmenu
++
++endif
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/Makefile linux-2.6.29.1/arch/mips/ar71xx/Makefile
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/Makefile 2009-04-13 14:27:34.487064480 +0200
+@@ -0,0 +1,25 @@
++#
++# Makefile for the Atheros AR71xx SoC specific parts of the kernel
++#
++# Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++# Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License version 2 as published
++# by the Free Software Foundation.
++
++obj-y := prom.o irq.o setup.o devices.o gpio.o ar71xx.o
++
++obj-$(CONFIG_AR71XX_MACH_AP81) += mach-ap81.o
++obj-$(CONFIG_AR71XX_MACH_AP83) += mach-ap83.o
++obj-$(CONFIG_AR71XX_MACH_AW_NR580) += mach-aw-nr580.o
++obj-$(CONFIG_AR71XX_MACH_GENERIC) += mach-generic.o
++obj-$(CONFIG_AR71XX_MACH_MZK_W04NU) += mach-mzk-w04nu.o
++obj-$(CONFIG_AR71XX_MACH_MZK_W300NH) += mach-mzk-w300nh.o
++obj-$(CONFIG_AR71XX_MACH_PB42) += mach-pb42.o
++obj-$(CONFIG_AR71XX_MACH_RB_4XX) += mach-rb-4xx.o
++obj-$(CONFIG_AR71XX_MACH_TEW_632BRP) += mach-tew-632brp.o
++obj-$(CONFIG_AR71XX_MACH_TL_WR941ND) += mach-tl-wr941nd.o
++obj-$(CONFIG_AR71XX_MACH_UBNT) += mach-ubnt.o
++obj-$(CONFIG_AR71XX_MACH_WNR2000) += mach-wnr2000.o
++obj-$(CONFIG_AR71XX_MACH_WP543) += mach-wp543.o
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/ar71xx.c linux-2.6.29.1/arch/mips/ar71xx/ar71xx.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/ar71xx.c 2009-04-13 14:27:34.487064480 +0200
+@@ -0,0 +1,100 @@
++/*
++ * AR71xx SoC routines
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/types.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++void __iomem *ar71xx_ddr_base;
++EXPORT_SYMBOL_GPL(ar71xx_ddr_base);
++
++void __iomem *ar71xx_pll_base;
++EXPORT_SYMBOL_GPL(ar71xx_pll_base);
++
++void __iomem *ar71xx_reset_base;
++EXPORT_SYMBOL_GPL(ar71xx_reset_base);
++
++void __iomem *ar71xx_gpio_base;
++EXPORT_SYMBOL_GPL(ar71xx_gpio_base);
++
++void __iomem *ar71xx_usb_ctrl_base;
++EXPORT_SYMBOL_GPL(ar71xx_usb_ctrl_base);
++
++void ar71xx_device_stop(u32 mask)
++{
++ unsigned long flags;
++ u32 t;
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, t | mask);
++ local_irq_restore(flags);
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR91XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR91XX_RESET_REG_RESET_MODULE, t | mask);
++ local_irq_restore(flags);
++ break;
++
++ default:
++ BUG();
++ }
++}
++EXPORT_SYMBOL_GPL(ar71xx_device_stop);
++
++void ar71xx_device_start(u32 mask)
++{
++ unsigned long flags;
++ u32 t;
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR71XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR71XX_RESET_REG_RESET_MODULE, t & ~mask);
++ local_irq_restore(flags);
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ local_irq_save(flags);
++ t = ar71xx_reset_rr(AR91XX_RESET_REG_RESET_MODULE);
++ ar71xx_reset_wr(AR91XX_RESET_REG_RESET_MODULE, t & ~mask);
++ local_irq_restore(flags);
++ break;
++
++ default:
++ BUG();
++ }
++}
++EXPORT_SYMBOL_GPL(ar71xx_device_start);
++
++void ar71xx_ddr_flush(u32 reg)
++{
++ ar71xx_ddr_wr(reg, 1);
++ while ((ar71xx_ddr_rr(reg) & 0x1));
++
++ ar71xx_ddr_wr(reg, 1);
++ while ((ar71xx_ddr_rr(reg) & 0x1));
++}
++EXPORT_SYMBOL_GPL(ar71xx_ddr_flush);
++
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/devices.c linux-2.6.29.1/arch/mips/ar71xx/devices.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/devices.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/devices.c 2009-04-13 14:27:34.491064431 +0200
+@@ -0,0 +1,675 @@
++/*
++ * Atheros AR71xx SoC platform devices
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/delay.h>
++#include <linux/dma-mapping.h>
++#include <linux/etherdevice.h>
++#include <linux/platform_device.h>
++#include <linux/serial_8250.h>
++#include <linux/ath9k_platform.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++static u8 ar71xx_mac_base[ETH_ALEN] __initdata;
++
++/*
++ * OHCI (USB full speed host controller)
++ */
++static struct resource ar71xx_ohci_resources[] = {
++ [0] = {
++ .start = AR71XX_OHCI_BASE,
++ .end = AR71XX_OHCI_BASE + AR71XX_OHCI_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = AR71XX_MISC_IRQ_OHCI,
++ .end = AR71XX_MISC_IRQ_OHCI,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static u64 ar71xx_ohci_dmamask = DMA_BIT_MASK(32);
++static struct platform_device ar71xx_ohci_device = {
++ .name = "ar71xx-ohci",
++ .id = -1,
++ .resource = ar71xx_ohci_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_ohci_resources),
++ .dev = {
++ .dma_mask = &ar71xx_ohci_dmamask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ },
++};
++
++/*
++ * EHCI (USB full speed host controller)
++ */
++static struct resource ar71xx_ehci_resources[] = {
++ [0] = {
++ .start = AR71XX_EHCI_BASE,
++ .end = AR71XX_EHCI_BASE + AR71XX_EHCI_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = AR71XX_CPU_IRQ_USB,
++ .end = AR71XX_CPU_IRQ_USB,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++
++static u64 ar71xx_ehci_dmamask = DMA_BIT_MASK(32);
++static struct ar71xx_ehci_platform_data ar71xx_ehci_data;
++
++static struct platform_device ar71xx_ehci_device = {
++ .name = "ar71xx-ehci",
++ .id = -1,
++ .resource = ar71xx_ehci_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_ehci_resources),
++ .dev = {
++ .dma_mask = &ar71xx_ehci_dmamask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ .platform_data = &ar71xx_ehci_data,
++ },
++};
++
++#define AR71XX_USB_RESET_MASK \
++ (RESET_MODULE_USB_HOST | RESET_MODULE_USB_PHY \
++ | RESET_MODULE_USB_OHCI_DLL)
++
++static void ar71xx_usb_setup(void)
++{
++ ar71xx_device_stop(AR71XX_USB_RESET_MASK);
++ mdelay(1000);
++ ar71xx_device_start(AR71XX_USB_RESET_MASK);
++
++ /* Turning on the Buff and Desc swap bits */
++ ar71xx_usb_ctrl_wr(USB_CTRL_REG_CONFIG, 0xf0000);
++
++ /* WAR for HW bug. Here it adjusts the duration between two SOFS */
++ ar71xx_usb_ctrl_wr(USB_CTRL_REG_FLADJ, 0x20c00);
++
++ mdelay(900);
++}
++
++static void ar91xx_usb_setup(void)
++{
++ ar71xx_device_stop(RESET_MODULE_USBSUS_OVERRIDE);
++ mdelay(10);
++
++ ar71xx_device_start(RESET_MODULE_USB_HOST);
++ mdelay(10);
++
++ ar71xx_device_start(RESET_MODULE_USB_PHY);
++ mdelay(10);
++}
++
++void __init ar71xx_add_device_usb(void)
++{
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ ar71xx_usb_setup();
++ platform_device_register(&ar71xx_ohci_device);
++ platform_device_register(&ar71xx_ehci_device);
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar91xx_usb_setup();
++ ar71xx_ehci_data.is_ar91xx = 1;
++ platform_device_register(&ar71xx_ehci_device);
++ break;
++
++ default:
++ BUG();
++ }
++}
++
++#ifndef CONFIG_AR71XX_EARLY_SERIAL
++static struct resource ar71xx_uart_resources[] = {
++ {
++ .start = AR71XX_UART_BASE,
++ .end = AR71XX_UART_BASE + AR71XX_UART_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++#define AR71XX_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP)
++static struct plat_serial8250_port ar71xx_uart_data[] = {
++ {
++ .mapbase = AR71XX_UART_BASE,
++ .irq = AR71XX_MISC_IRQ_UART,
++ .flags = AR71XX_UART_FLAGS,
++ .iotype = UPIO_MEM32,
++ .regshift = 2,
++ }, {
++ /* terminating entry */
++ }
++};
++
++static struct platform_device ar71xx_uart_device = {
++ .name = "serial8250",
++ .id = PLAT8250_DEV_PLATFORM,
++ .resource = ar71xx_uart_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_uart_resources),
++ .dev = {
++ .platform_data = ar71xx_uart_data
++ },
++};
++
++void __init ar71xx_add_device_uart(void)
++{
++ ar71xx_uart_data[0].uartclk = ar71xx_ahb_freq;
++ platform_device_register(&ar71xx_uart_device);
++}
++#endif /* CONFIG_AR71XX_EARLY_SERIAL */
++
++static struct resource ar71xx_mdio_resources[] = {
++ {
++ .name = "mdio_base",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE0_BASE + 0x20,
++ .end = AR71XX_GE0_BASE + 0x38 - 1,
++ }
++};
++
++static struct ag71xx_mdio_platform_data ar71xx_mdio_data = {
++ .phy_mask = 0xffffffff,
++};
++
++static struct platform_device ar71xx_mdio_device = {
++ .name = "ag71xx-mdio",
++ .id = -1,
++ .resource = ar71xx_mdio_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_mdio_resources),
++ .dev = {
++ .platform_data = &ar71xx_mdio_data,
++ },
++};
++
++void __init ar71xx_add_device_mdio(u32 phy_mask)
++{
++ ar71xx_mdio_data.phy_mask = phy_mask;
++ platform_device_register(&ar71xx_mdio_device);
++}
++
++static void ar71xx_set_pll(u32 cfg_reg, u32 pll_reg, u32 pll_val, u32 shift)
++{
++ void __iomem *base;
++ u32 t;
++
++ base = ioremap_nocache(AR71XX_PLL_BASE, AR71XX_PLL_SIZE);
++
++ t = __raw_readl(base + cfg_reg);
++ t &= ~(3 << shift);
++ t |= (2 << shift);
++ __raw_writel(t, base + cfg_reg);
++ udelay(100);
++
++ __raw_writel(pll_val, base + pll_reg);
++
++ t |= (3 << shift);
++ __raw_writel(t, base + cfg_reg);
++ udelay(100);
++
++ t &= ~(3 << shift);
++ __raw_writel(t, base + cfg_reg);
++ udelay(100);
++
++ printk(KERN_DEBUG "ar71xx: pll_reg %#x: %#x\n",
++ (unsigned int)(base + pll_reg), __raw_readl(base + pll_reg));
++
++ iounmap(base);
++}
++
++static void ar71xx_set_pll_ge0(u32 val)
++{
++ ar71xx_set_pll(AR71XX_PLL_REG_SEC_CONFIG, AR71XX_PLL_REG_ETH0_INT_CLOCK,
++ val, AR71XX_ETH0_PLL_SHIFT);
++}
++
++static void ar71xx_set_pll_ge1(u32 val)
++{
++ ar71xx_set_pll(AR71XX_PLL_REG_SEC_CONFIG, AR71XX_PLL_REG_ETH1_INT_CLOCK,
++ val, AR71XX_ETH1_PLL_SHIFT);
++}
++
++static void ar91xx_set_pll_ge0(u32 val)
++{
++ ar71xx_set_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH0_INT_CLOCK,
++ val, AR91XX_ETH0_PLL_SHIFT);
++}
++
++static void ar91xx_set_pll_ge1(u32 val)
++{
++ ar71xx_set_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH1_INT_CLOCK,
++ val, AR91XX_ETH1_PLL_SHIFT);
++}
++
++static void ar71xx_ddr_flush_ge0(void)
++{
++ ar71xx_ddr_flush(AR71XX_DDR_REG_FLUSH_GE0);
++}
++
++static void ar71xx_ddr_flush_ge1(void)
++{
++ ar71xx_ddr_flush(AR71XX_DDR_REG_FLUSH_GE1);
++}
++
++static void ar91xx_ddr_flush_ge0(void)
++{
++ ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE0);
++}
++
++static void ar91xx_ddr_flush_ge1(void)
++{
++ ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE1);
++}
++
++static struct resource ar71xx_eth0_resources[] = {
++ {
++ .name = "mac_base",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE0_BASE,
++ .end = AR71XX_GE0_BASE + 0x20 - 1,
++ }, {
++ .name = "mac_base2",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE0_BASE + 0x38,
++ .end = AR71XX_GE0_BASE + 0x200 - 1,
++ }, {
++ .name = "mii_ctrl",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_MII_BASE + MII_REG_MII0_CTRL,
++ .end = AR71XX_MII_BASE + MII_REG_MII0_CTRL + 3,
++ }, {
++ .name = "mac_irq",
++ .flags = IORESOURCE_IRQ,
++ .start = AR71XX_CPU_IRQ_GE0,
++ .end = AR71XX_CPU_IRQ_GE0,
++ },
++};
++
++struct ag71xx_platform_data ar71xx_eth0_data = {
++ .reset_bit = RESET_MODULE_GE0_MAC,
++};
++
++static struct platform_device ar71xx_eth0_device = {
++ .name = "ag71xx",
++ .id = 0,
++ .resource = ar71xx_eth0_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_eth0_resources),
++ .dev = {
++ .platform_data = &ar71xx_eth0_data,
++ },
++};
++
++static struct resource ar71xx_eth1_resources[] = {
++ {
++ .name = "mac_base",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE1_BASE,
++ .end = AR71XX_GE1_BASE + 0x20 - 1,
++ }, {
++ .name = "mac_base2",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_GE1_BASE + 0x38,
++ .end = AR71XX_GE1_BASE + 0x200 - 1,
++ }, {
++ .name = "mii_ctrl",
++ .flags = IORESOURCE_MEM,
++ .start = AR71XX_MII_BASE + MII_REG_MII1_CTRL,
++ .end = AR71XX_MII_BASE + MII_REG_MII1_CTRL + 3,
++ }, {
++ .name = "mac_irq",
++ .flags = IORESOURCE_IRQ,
++ .start = AR71XX_CPU_IRQ_GE1,
++ .end = AR71XX_CPU_IRQ_GE1,
++ },
++};
++
++struct ag71xx_platform_data ar71xx_eth1_data = {
++ .reset_bit = RESET_MODULE_GE1_MAC,
++};
++
++static struct platform_device ar71xx_eth1_device = {
++ .name = "ag71xx",
++ .id = 1,
++ .resource = ar71xx_eth1_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_eth1_resources),
++ .dev = {
++ .platform_data = &ar71xx_eth1_data,
++ },
++};
++
++static int ar71xx_eth_instance __initdata;
++void __init ar71xx_add_device_eth(unsigned int id)
++{
++ struct platform_device *pdev;
++ struct ag71xx_platform_data *pdata;
++
++ switch (id) {
++ case 0:
++ switch (ar71xx_eth0_data.phy_if_mode) {
++ case PHY_INTERFACE_MODE_MII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_MII;
++ break;
++ case PHY_INTERFACE_MODE_GMII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_GMII;
++ break;
++ case PHY_INTERFACE_MODE_RGMII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_RGMII;
++ break;
++ case PHY_INTERFACE_MODE_RMII:
++ ar71xx_eth0_data.mii_if = MII0_CTRL_IF_RMII;
++ break;
++ default:
++ printk(KERN_ERR "ar71xx: invalid PHY interface mode "
++ "for eth0\n");
++ return;
++ }
++ pdev = &ar71xx_eth0_device;
++ break;
++ case 1:
++ switch (ar71xx_eth1_data.phy_if_mode) {
++ case PHY_INTERFACE_MODE_RMII:
++ ar71xx_eth1_data.mii_if = MII1_CTRL_IF_RMII;
++ break;
++ case PHY_INTERFACE_MODE_RGMII:
++ ar71xx_eth1_data.mii_if = MII1_CTRL_IF_RGMII;
++ break;
++ default:
++ printk(KERN_ERR "ar71xx: invalid PHY interface mode "
++ "for eth1\n");
++ return;
++ }
++ pdev = &ar71xx_eth1_device;
++ break;
++ default:
++ printk(KERN_ERR "ar71xx: invalid ethernet id %d\n", id);
++ return;
++ }
++
++ pdata = pdev->dev.platform_data;
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ pdata->ddr_flush = id ? ar71xx_ddr_flush_ge1
++ : ar71xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar71xx_set_pll_ge1
++ : ar71xx_set_pll_ge0;
++ break;
++
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ pdata->ddr_flush = id ? ar71xx_ddr_flush_ge1
++ : ar71xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar71xx_set_pll_ge1
++ : ar71xx_set_pll_ge0;
++ pdata->has_gbit = 1;
++ break;
++
++ case AR71XX_SOC_AR9130:
++ pdata->ddr_flush = id ? ar91xx_ddr_flush_ge1
++ : ar91xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar91xx_set_pll_ge1
++ : ar91xx_set_pll_ge0;
++ pdata->is_ar91xx = 1;
++ break;
++
++ case AR71XX_SOC_AR9132:
++ pdata->ddr_flush = id ? ar91xx_ddr_flush_ge1
++ : ar91xx_ddr_flush_ge0;
++ pdata->set_pll = id ? ar91xx_set_pll_ge1
++ : ar91xx_set_pll_ge0;
++ pdata->is_ar91xx = 1;
++ pdata->has_gbit = 1;
++ break;
++
++ default:
++ BUG();
++ }
++
++ switch (pdata->phy_if_mode) {
++ case PHY_INTERFACE_MODE_GMII:
++ case PHY_INTERFACE_MODE_RGMII:
++ if (!pdata->has_gbit) {
++ printk(KERN_ERR "ar71xx: no gbit available on eth%d\n",
++ id);
++ return;
++ }
++ /* fallthrough */
++ default:
++ break;
++ }
++
++ if (is_valid_ether_addr(ar71xx_mac_base)) {
++ memcpy(pdata->mac_addr, ar71xx_mac_base, ETH_ALEN);
++ pdata->mac_addr[5] += ar71xx_eth_instance;
++ } else {
++ random_ether_addr(pdata->mac_addr);
++ printk(KERN_DEBUG
++ "ar71xx: using random MAC address for eth%d\n",
++ ar71xx_eth_instance);
++ }
++
++ platform_device_register(pdev);
++ ar71xx_eth_instance++;
++}
++
++static struct resource ar71xx_spi_resources[] = {
++ [0] = {
++ .start = AR71XX_SPI_BASE,
++ .end = AR71XX_SPI_BASE + AR71XX_SPI_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++static struct platform_device ar71xx_spi_device = {
++ .name = "ar71xx-spi",
++ .id = -1,
++ .resource = ar71xx_spi_resources,
++ .num_resources = ARRAY_SIZE(ar71xx_spi_resources),
++};
++
++void __init ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
++ struct spi_board_info const *info,
++ unsigned n)
++{
++ spi_register_board_info(info, n);
++ ar71xx_spi_device.dev.platform_data = pdata;
++ platform_device_register(&ar71xx_spi_device);
++}
++
++void __init ar71xx_add_device_leds_gpio(int id, unsigned num_leds,
++ struct gpio_led *leds)
++{
++ struct platform_device *pdev;
++ struct gpio_led_platform_data pdata;
++ struct gpio_led *p;
++ int err;
++
++ p = kmalloc(num_leds * sizeof(*p), GFP_KERNEL);
++ if (!p)
++ return;
++
++ memcpy(p, leds, num_leds * sizeof(*p));
++
++ pdev = platform_device_alloc("leds-gpio", id);
++ if (!pdev)
++ goto err_free_leds;
++
++ memset(&pdata, 0, sizeof(pdata));
++ pdata.num_leds = num_leds;
++ pdata.leds = p;
++
++ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
++ if (err)
++ goto err_put_pdev;
++
++ err = platform_device_add(pdev);
++ if (err)
++ goto err_put_pdev;
++
++ return;
++
++err_put_pdev:
++ platform_device_put(pdev);
++
++err_free_leds:
++ kfree(p);
++}
++
++void __init ar71xx_add_device_gpio_buttons(int id,
++ unsigned poll_interval,
++ unsigned nbuttons,
++ struct gpio_button *buttons)
++{
++ struct platform_device *pdev;
++ struct gpio_buttons_platform_data pdata;
++ struct gpio_button *p;
++ int err;
++
++ p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
++ if (!p)
++ return;
++
++ memcpy(p, buttons, nbuttons * sizeof(*p));
++
++ pdev = platform_device_alloc("gpio-buttons", id);
++ if (!pdev)
++ goto err_free_buttons;
++
++ memset(&pdata, 0, sizeof(pdata));
++ pdata.poll_interval = poll_interval;
++ pdata.nbuttons = nbuttons;
++ pdata.buttons = p;
++
++ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
++ if (err)
++ goto err_put_pdev;
++
++
++ err = platform_device_add(pdev);
++ if (err)
++ goto err_put_pdev;
++
++ return;
++
++err_put_pdev:
++ platform_device_put(pdev);
++
++err_free_buttons:
++ kfree(p);
++}
++
++void __init ar71xx_add_device_wdt(void)
++{
++ platform_device_register_simple("ar71xx-wdt", -1, NULL, 0);
++}
++
++void __init ar71xx_set_mac_base(unsigned char *mac)
++{
++ memcpy(ar71xx_mac_base, mac, ETH_ALEN);
++}
++
++void __init ar71xx_parse_mac_addr(char *mac_str)
++{
++ u8 tmp[ETH_ALEN];
++ int t;
++
++ t = sscanf(mac_str, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
++ &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]);
++
++ if (t != ETH_ALEN)
++ t = sscanf(mac_str, "%02hhx.%02hhx.%02hhx.%02hhx.%02hhx.%02hhx",
++ &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]);
++
++ if (t == ETH_ALEN)
++ ar71xx_set_mac_base(tmp);
++ else
++ printk(KERN_DEBUG "ar71xx: failed to parse mac address "
++ "\"%s\"\n", mac_str);
++}
++
++static struct resource ar91xx_wmac_resources[] = {
++ {
++ .start = AR91XX_WMAC_BASE,
++ .end = AR91XX_WMAC_BASE + AR91XX_WMAC_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ }, {
++ .start = AR71XX_CPU_IRQ_WMAC,
++ .end = AR71XX_CPU_IRQ_WMAC,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct ath9k_platform_data ar91xx_wmac_data;
++
++static struct platform_device ar91xx_wmac_device = {
++ .name = "ath9k",
++ .id = -1,
++ .resource = ar91xx_wmac_resources,
++ .num_resources = ARRAY_SIZE(ar91xx_wmac_resources),
++ .dev = {
++ .platform_data = &ar91xx_wmac_data,
++ },
++};
++
++void __init ar91xx_add_device_wmac(void)
++{
++ u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
++
++ memcpy(ar91xx_wmac_data.eeprom_data, ee,
++ sizeof(ar91xx_wmac_data.eeprom_data));
++
++ ar71xx_device_stop(RESET_MODULE_AMBA2WMAC);
++ mdelay(10);
++
++ ar71xx_device_start(RESET_MODULE_AMBA2WMAC);
++ mdelay(10);
++
++ platform_device_register(&ar91xx_wmac_device);
++}
++
++static struct platform_device ar71xx_dsa_switch_device = {
++ .name = "dsa",
++ .id = 0,
++};
++
++void __init ar71xx_add_device_dsa(unsigned int id,
++ struct dsa_platform_data *d)
++{
++ switch (id) {
++ case 0:
++ d->netdev = &ar71xx_eth0_device.dev;
++ break;
++ case 1:
++ d->netdev = &ar71xx_eth1_device.dev;
++ break;
++ default:
++ printk(KERN_ERR
++ "ar71xx: invalid ethernet id %d for DSA switch\n",
++ id);
++ return;
++ }
++ d->mii_bus = &ar71xx_mdio_device.dev;
++ ar71xx_dsa_switch_device.dev.platform_data = d;
++
++ platform_device_register(&ar71xx_dsa_switch_device);
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/devices.h linux-2.6.29.1/arch/mips/ar71xx/devices.h
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/devices.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/devices.h 2009-04-13 14:27:34.491064431 +0200
+@@ -0,0 +1,58 @@
++/*
++ * Atheros AR71xx SoC device definitions
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __AR71XX_DEVICES_H
++#define __AR71XX_DEVICES_H
++
++#include <asm/mach-ar71xx/platform.h>
++
++#include <linux/leds.h>
++#include <linux/gpio_buttons.h>
++#include <net/dsa.h>
++
++void ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
++ struct spi_board_info const *info,
++ unsigned n) __init;
++
++void ar71xx_set_mac_base(unsigned char *mac) __init;
++void ar71xx_parse_mac_addr(char *mac_str) __init;
++
++extern struct ag71xx_platform_data ar71xx_eth0_data;
++extern struct ag71xx_platform_data ar71xx_eth1_data;
++void ar71xx_add_device_eth(unsigned int id) __init;
++
++void ar71xx_add_device_mdio(u32 phy_mask) __init;
++
++void ar71xx_add_device_leds_gpio(int id,
++ unsigned num_leds,
++ struct gpio_led *leds) __init;
++
++void ar71xx_add_device_gpio_buttons(int id,
++ unsigned poll_interval,
++ unsigned nbuttons,
++ struct gpio_button *buttons) __init;
++
++void ar71xx_add_device_usb(void) __init;
++
++#ifdef CONFIG_AR71XX_EARLY_SERIAL
++static inline void ar71xx_add_device_uart(void) {}
++#else
++void ar71xx_add_device_uart(void) __init;
++#endif
++
++void ar71xx_add_device_wdt(void) __init;
++
++void ar91xx_add_device_wmac(void) __init;
++
++void ar71xx_add_device_dsa(unsigned int id,
++ struct dsa_platform_data *d) __init;
++
++#endif /* __AR71XX_DEVICES_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/gpio.c linux-2.6.29.1/arch/mips/ar71xx/gpio.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/gpio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/gpio.c 2009-04-13 14:27:34.495064103 +0200
+@@ -0,0 +1,154 @@
++/*
++ * Atheros AR71xx SoC GPIO API support
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/spinlock.h>
++#include <linux/io.h>
++#include <linux/ioport.h>
++#include <linux/gpio.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++static DEFINE_SPINLOCK(ar71xx_gpio_lock);
++
++unsigned long ar71xx_gpio_count;
++EXPORT_SYMBOL(ar71xx_gpio_count);
++
++void __ar71xx_gpio_set_value(unsigned gpio, int value)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ if (value)
++ ar71xx_gpio_wr(GPIO_REG_SET, (1 << gpio));
++ else
++ ar71xx_gpio_wr(GPIO_REG_CLEAR, (1 << gpio));
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++}
++EXPORT_SYMBOL(__ar71xx_gpio_set_value);
++
++int __ar71xx_gpio_get_value(unsigned gpio)
++{
++ return (ar71xx_gpio_rr(GPIO_REG_IN) & (1 << gpio)) ? 1 : 0;
++}
++EXPORT_SYMBOL(__ar71xx_gpio_get_value);
++
++static int ar71xx_gpio_get_value(struct gpio_chip *chip, unsigned offset)
++{
++ return __ar71xx_gpio_get_value(offset);
++}
++
++static void ar71xx_gpio_set_value(struct gpio_chip *chip,
++ unsigned offset, int value)
++{
++ __ar71xx_gpio_set_value(offset, value);
++}
++
++static int ar71xx_gpio_direction_input(struct gpio_chip *chip,
++ unsigned offset)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ ar71xx_gpio_wr(GPIO_REG_OE,
++ ar71xx_gpio_rr(GPIO_REG_OE) & ~(1 << offset));
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++
++ return 0;
++}
++
++static int ar71xx_gpio_direction_output(struct gpio_chip *chip,
++ unsigned offset, int value)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ if (value)
++ ar71xx_gpio_wr(GPIO_REG_SET, (1 << offset));
++ else
++ ar71xx_gpio_wr(GPIO_REG_CLEAR, (1 << offset));
++
++ ar71xx_gpio_wr(GPIO_REG_OE,
++ ar71xx_gpio_rr(GPIO_REG_OE) | (1 << offset));
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++
++ return 0;
++}
++
++static struct gpio_chip ar71xx_gpio_chip = {
++ .label = "ar71xx",
++ .get = ar71xx_gpio_get_value,
++ .set = ar71xx_gpio_set_value,
++ .direction_input = ar71xx_gpio_direction_input,
++ .direction_output = ar71xx_gpio_direction_output,
++ .base = 0,
++ .ngpio = AR71XX_GPIO_COUNT,
++};
++
++void ar71xx_gpio_function_enable(u32 mask)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ ar71xx_gpio_wr(GPIO_REG_FUNC, ar71xx_gpio_rr(GPIO_REG_FUNC) | mask);
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++}
++
++void ar71xx_gpio_function_disable(u32 mask)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&ar71xx_gpio_lock, flags);
++
++ ar71xx_gpio_wr(GPIO_REG_FUNC, ar71xx_gpio_rr(GPIO_REG_FUNC) & ~mask);
++
++ spin_unlock_irqrestore(&ar71xx_gpio_lock, flags);
++}
++
++void __init ar71xx_gpio_init(void)
++{
++ int err;
++
++ if (!request_mem_region(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE,
++ "AR71xx GPIO controller"))
++ panic("cannot allocate AR71xx GPIO registers page");
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ ar71xx_gpio_chip.ngpio = AR71XX_GPIO_COUNT;
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar71xx_gpio_chip.ngpio = AR91XX_GPIO_COUNT;
++ break;
++
++ default:
++ BUG();
++ }
++
++ err = gpiochip_add(&ar71xx_gpio_chip);
++ if (err)
++ panic("cannot add AR71xx GPIO chip, error=%d", err);
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/irq.c linux-2.6.29.1/arch/mips/ar71xx/irq.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/irq.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/irq.c 2009-04-13 14:27:34.543070220 +0200
+@@ -0,0 +1,302 @@
++/*
++ * Atheros AR71xx SoC specific interrupt handling
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/irq.h>
++
++#include <asm/irq_cpu.h>
++#include <asm/mipsregs.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#ifdef CONFIG_PCI
++static void ar71xx_pci_irq_dispatch(void)
++{
++ u32 pending;
++
++ pending = ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_STATUS) &
++ ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE);
++
++ if (pending & PCI_INT_DEV0)
++ do_IRQ(AR71XX_PCI_IRQ_DEV0);
++
++ else if (pending & PCI_INT_DEV1)
++ do_IRQ(AR71XX_PCI_IRQ_DEV1);
++
++ else if (pending & PCI_INT_DEV2)
++ do_IRQ(AR71XX_PCI_IRQ_DEV2);
++
++ else
++ spurious_interrupt();
++}
++
++static void ar71xx_pci_irq_unmask(unsigned int irq)
++{
++ irq -= AR71XX_PCI_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) | (1 << irq));
++}
++
++static void ar71xx_pci_irq_mask(unsigned int irq)
++{
++ irq -= AR71XX_PCI_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_PCI_INT_ENABLE) & ~(1 << irq));
++}
++
++static struct irq_chip ar71xx_pci_irq_chip = {
++ .name = "AR71XX PCI ",
++ .mask = ar71xx_pci_irq_mask,
++ .unmask = ar71xx_pci_irq_unmask,
++ .mask_ack = ar71xx_pci_irq_mask,
++};
++
++static struct irqaction ar71xx_pci_irqaction = {
++ .handler = no_action,
++ .name = "cascade [AR71XX PCI]",
++};
++
++static void __init ar71xx_pci_irq_init(void)
++{
++ int i;
++
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_ENABLE, 0);
++ ar71xx_reset_wr(AR71XX_RESET_REG_PCI_INT_STATUS, 0);
++
++ for (i = AR71XX_PCI_IRQ_BASE;
++ i < AR71XX_PCI_IRQ_BASE + AR71XX_PCI_IRQ_COUNT; i++) {
++ irq_desc[i].status = IRQ_DISABLED;
++ set_irq_chip_and_handler(i, &ar71xx_pci_irq_chip,
++ handle_level_irq);
++ }
++
++ setup_irq(AR71XX_CPU_IRQ_PCI, &ar71xx_pci_irqaction);
++}
++#endif /* CONFIG_PCI */
++
++static void ar71xx_gpio_irq_dispatch(void)
++{
++ u32 pending;
++
++ pending = ar71xx_gpio_rr(GPIO_REG_INT_PENDING)
++ & ar71xx_gpio_rr(GPIO_REG_INT_ENABLE);
++
++ if (pending)
++ do_IRQ(AR71XX_GPIO_IRQ_BASE + fls(pending) - 1);
++ else
++ spurious_interrupt();
++}
++
++static void ar71xx_gpio_irq_unmask(unsigned int irq)
++{
++ irq -= AR71XX_GPIO_IRQ_BASE;
++ ar71xx_gpio_wr(GPIO_REG_INT_ENABLE,
++ ar71xx_gpio_rr(GPIO_REG_INT_ENABLE) | (1 << irq));
++}
++
++static void ar71xx_gpio_irq_mask(unsigned int irq)
++{
++ irq -= AR71XX_GPIO_IRQ_BASE;
++ ar71xx_gpio_wr(GPIO_REG_INT_ENABLE,
++ ar71xx_gpio_rr(GPIO_REG_INT_ENABLE) & ~(1 << irq));
++}
++
++#if 0
++static int ar71xx_gpio_irq_set_type(unsigned int irq, unsigned int flow_type)
++{
++ /* TODO: implement */
++ return 0;
++}
++#else
++#define ar71xx_gpio_irq_set_type NULL
++#endif
++
++struct irq_chip ar71xx_gpio_irq_chip = {
++ .name = "AR71XX GPIO",
++ .unmask = ar71xx_gpio_irq_unmask,
++ .mask = ar71xx_gpio_irq_mask,
++ .mask_ack = ar71xx_gpio_irq_mask,
++ .set_type = ar71xx_gpio_irq_set_type,
++};
++
++static struct irqaction ar71xx_gpio_irqaction = {
++ .handler = no_action,
++ .name = "cascade [AR71XX GPIO]",
++};
++
++#define GPIO_IRQ_INIT_STATUS (IRQ_LEVEL | IRQ_TYPE_LEVEL_HIGH | IRQ_DISABLED)
++#define GPIO_INT_ALL 0xffff
++
++static void __init ar71xx_gpio_irq_init(void)
++{
++ int i;
++
++ ar71xx_gpio_wr(GPIO_REG_INT_ENABLE, 0);
++ ar71xx_gpio_wr(GPIO_REG_INT_PENDING, 0);
++
++ /* setup type of all GPIO interrupts to level sensitive */
++ ar71xx_gpio_wr(GPIO_REG_INT_TYPE, GPIO_INT_ALL);
++
++ /* setup polarity of all GPIO interrupts to active high */
++ ar71xx_gpio_wr(GPIO_REG_INT_POLARITY, GPIO_INT_ALL);
++
++ for (i = AR71XX_GPIO_IRQ_BASE;
++ i < AR71XX_GPIO_IRQ_BASE + AR71XX_GPIO_IRQ_COUNT; i++) {
++ irq_desc[i].status = GPIO_IRQ_INIT_STATUS;
++ set_irq_chip_and_handler(i, &ar71xx_gpio_irq_chip,
++ handle_level_irq);
++ }
++
++ setup_irq(AR71XX_MISC_IRQ_GPIO, &ar71xx_gpio_irqaction);
++}
++
++static void ar71xx_misc_irq_dispatch(void)
++{
++ u32 pending;
++
++ pending = ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_STATUS)
++ & ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE);
++
++ if (pending & MISC_INT_UART)
++ do_IRQ(AR71XX_MISC_IRQ_UART);
++
++ else if (pending & MISC_INT_DMA)
++ do_IRQ(AR71XX_MISC_IRQ_DMA);
++
++ else if (pending & MISC_INT_PERFC)
++ do_IRQ(AR71XX_MISC_IRQ_PERFC);
++
++ else if (pending & MISC_INT_TIMER)
++ do_IRQ(AR71XX_MISC_IRQ_TIMER);
++
++ else if (pending & MISC_INT_OHCI)
++ do_IRQ(AR71XX_MISC_IRQ_OHCI);
++
++ else if (pending & MISC_INT_ERROR)
++ do_IRQ(AR71XX_MISC_IRQ_ERROR);
++
++ else if (pending & MISC_INT_GPIO)
++ ar71xx_gpio_irq_dispatch();
++
++ else if (pending & MISC_INT_WDOG)
++ do_IRQ(AR71XX_MISC_IRQ_WDOG);
++
++ else
++ spurious_interrupt();
++}
++
++static void ar71xx_misc_irq_unmask(unsigned int irq)
++{
++ irq -= AR71XX_MISC_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE) | (1 << irq));
++}
++
++static void ar71xx_misc_irq_mask(unsigned int irq)
++{
++ irq -= AR71XX_MISC_IRQ_BASE;
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE,
++ ar71xx_reset_rr(AR71XX_RESET_REG_MISC_INT_ENABLE) & ~(1 << irq));
++}
++
++struct irq_chip ar71xx_misc_irq_chip = {
++ .name = "AR71XX MISC",
++ .unmask = ar71xx_misc_irq_unmask,
++ .mask = ar71xx_misc_irq_mask,
++ .mask_ack = ar71xx_misc_irq_mask,
++};
++
++static struct irqaction ar71xx_misc_irqaction = {
++ .handler = no_action,
++ .name = "cascade [AR71XX MISC]",
++};
++
++static void __init ar71xx_misc_irq_init(void)
++{
++ int i;
++
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_ENABLE, 0);
++ ar71xx_reset_wr(AR71XX_RESET_REG_MISC_INT_STATUS, 0);
++
++ for (i = AR71XX_MISC_IRQ_BASE;
++ i < AR71XX_MISC_IRQ_BASE + AR71XX_MISC_IRQ_COUNT; i++) {
++ irq_desc[i].status = IRQ_DISABLED;
++ set_irq_chip_and_handler(i, &ar71xx_misc_irq_chip,
++ handle_level_irq);
++ }
++
++ setup_irq(AR71XX_CPU_IRQ_MISC, &ar71xx_misc_irqaction);
++}
++
++static void ar913x_wmac_irq_dispatch(void)
++{
++ do_IRQ(AR71XX_CPU_IRQ_WMAC);
++}
++
++static void (* ar71xx_ip2_irq_handler)(void) = spurious_interrupt;
++
++asmlinkage void plat_irq_dispatch(void)
++{
++ unsigned long pending;
++
++ pending = read_c0_status() & read_c0_cause() & ST0_IM;
++
++ if (pending & STATUSF_IP7)
++ do_IRQ(AR71XX_CPU_IRQ_TIMER);
++
++ else if (pending & STATUSF_IP2)
++ ar71xx_ip2_irq_handler();
++
++ else if (pending & STATUSF_IP4)
++ do_IRQ(AR71XX_CPU_IRQ_GE0);
++
++ else if (pending & STATUSF_IP5)
++ do_IRQ(AR71XX_CPU_IRQ_GE1);
++
++ else if (pending & STATUSF_IP3)
++ do_IRQ(AR71XX_CPU_IRQ_USB);
++
++ else if (pending & STATUSF_IP6)
++ ar71xx_misc_irq_dispatch();
++
++ else
++ spurious_interrupt();
++}
++
++void __init arch_init_irq(void)
++{
++ mips_cpu_irq_init();
++
++ ar71xx_misc_irq_init();
++
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++#ifdef CONFIG_PCI
++ ar71xx_pci_irq_init();
++ ar71xx_ip2_irq_handler = ar71xx_pci_irq_dispatch;
++#endif
++ break;
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar71xx_ip2_irq_handler = ar913x_wmac_irq_dispatch;
++ break;
++ default:
++ BUG();
++ }
++
++ ar71xx_gpio_irq_init();
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap81.c linux-2.6.29.1/arch/mips/ar71xx/mach-ap81.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap81.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-ap81.c 2009-04-13 14:27:34.543070220 +0200
+@@ -0,0 +1,148 @@
++/*
++ * Atheros AP81 board support
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define AP81_GPIO_LED_STATUS 1
++#define AP81_GPIO_LED_AOSS 3
++#define AP81_GPIO_LED_WLAN 6
++#define AP81_GPIO_LED_POWER 14
++
++#define AP81_GPIO_BTN_SW4 12
++#define AP81_GPIO_BTN_SW1 21
++
++#define AP81_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition ap81_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x050000,
++ .size = 0x500000,
++ } , {
++ .name = "uImage",
++ .offset = 0x550000,
++ .size = 0x100000,
++ } , {
++ .name = "ART",
++ .offset = 0x650000,
++ .size = 0x1b0000,
++ .mask_flags = MTD_WRITEABLE,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data ap81_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = ap81_partitions,
++ .nr_parts = ARRAY_SIZE(ap81_partitions),
++#endif
++};
++
++static struct spi_board_info ap81_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &ap81_flash_data,
++ }
++};
++
++static struct gpio_led ap81_leds_gpio[] __initdata = {
++ {
++ .name = "ap81:green:status",
++ .gpio = AP81_GPIO_LED_STATUS,
++ .active_low = 1,
++ }, {
++ .name = "ap81:amber:aoss",
++ .gpio = AP81_GPIO_LED_AOSS,
++ .active_low = 1,
++ }, {
++ .name = "ap81:green:wlan",
++ .gpio = AP81_GPIO_LED_WLAN,
++ .active_low = 1,
++ }, {
++ .name = "ap81:green:power",
++ .gpio = AP81_GPIO_LED_POWER,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button ap81_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw1",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = AP81_GPIO_BTN_SW1,
++ .active_low = 1,
++ } , {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = AP81_GPIO_BTN_SW4,
++ .active_low = 1,
++ }
++};
++
++static void __init ap81_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++ ar71xx_eth0_data.has_ar8216 = 1;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_usb();
++
++ ar71xx_add_device_spi(NULL, ap81_spi_info,
++ ARRAY_SIZE(ap81_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio),
++ ap81_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, AP81_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(ap81_gpio_buttons),
++ ap81_gpio_buttons);
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_AP81, "Atheros AP81", ap81_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap83.c linux-2.6.29.1/arch/mips/ar71xx/mach-ap83.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ap83.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-ap83.c 2009-04-13 14:27:34.547067937 +0200
+@@ -0,0 +1,87 @@
++/*
++ * Atheros AP83 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define AP83_GPIO_LED_WLAN 6
++#define AP83_GPIO_LED_POWER 14
++#define AP83_GPIO_LED_JUMPSTART 15
++#define AP83_GPIO_BTN_JUMPSTART 12
++#define AP83_GPIO_BTN_RESET 21
++
++static struct gpio_led ap83_leds_gpio[] __initdata = {
++ {
++ .name = "ap83:green:jumpstart",
++ .gpio = AP83_GPIO_LED_JUMPSTART,
++ .active_low = 0,
++ }, {
++ .name = "ap83:green:power",
++ .gpio = AP83_GPIO_LED_POWER,
++ .active_low = 0,
++ }, {
++ .name = "ap83:green:wlan",
++ .gpio = AP83_GPIO_LED_WLAN,
++ .active_low = 0,
++ },
++};
++
++static struct gpio_button ap83_gpio_buttons[] __initdata = {
++ {
++ .desc = "soft_reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = AP83_GPIO_BTN_RESET,
++ .active_low = 1,
++ } , {
++ .desc = "jumpstart",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = AP83_GPIO_BTN_JUMPSTART,
++ .active_low = 1,
++ }
++};
++
++static void __init ap83_setup(void)
++{
++ ar71xx_add_device_mdio(0xfffffffe);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++ ar71xx_eth0_data.phy_mask = 0x1;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
++ ar71xx_eth1_data.phy_mask = 0x0;
++ ar71xx_eth1_data.speed = SPEED_1000;
++ ar71xx_eth1_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
++ ap83_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(ap83_gpio_buttons),
++ ap83_gpio_buttons);
++
++ ar71xx_add_device_usb();
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_AP83, "Atheros AP83", ap83_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-aw-nr580.c linux-2.6.29.1/arch/mips/ar71xx/mach-aw-nr580.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-aw-nr580.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-aw-nr580.c 2009-04-13 14:27:34.547067937 +0200
+@@ -0,0 +1,119 @@
++/*
++ * AzureWave AW-NR580 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define AW_NR580_GPIO_LED_READY_RED 0
++#define AW_NR580_GPIO_LED_WLAN 1
++#define AW_NR580_GPIO_LED_READY_GREEN 2
++#define AW_NR580_GPIO_LED_WPS_GREEN 4
++#define AW_NR580_GPIO_LED_WPS_AMBER 5
++
++#define AW_NR580_GPIO_BTN_WPS 3
++#define AW_NR580_GPIO_BTN_RESET 11
++
++#define AW_NR580_BUTTONS_POLL_INTERVAL 20
++
++static struct spi_board_info aw_nr580_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct gpio_led aw_nr580_leds_gpio[] __initdata = {
++ {
++ .name = "aw-nr580:red:ready",
++ .gpio = AW_NR580_GPIO_LED_READY_RED,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:green:ready",
++ .gpio = AW_NR580_GPIO_LED_READY_GREEN,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:green:wps",
++ .gpio = AW_NR580_GPIO_LED_WPS_GREEN,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:amber:wps",
++ .gpio = AW_NR580_GPIO_LED_WPS_AMBER,
++ .active_low = 0,
++ }, {
++ .name = "aw-nr580:green:wlan",
++ .gpio = AW_NR580_GPIO_LED_WLAN,
++ .active_low = 0,
++ }
++};
++
++static struct gpio_button aw_nr580_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = AW_NR580_GPIO_BTN_RESET,
++ .active_low = 1,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = AW_NR580_GPIO_BTN_WPS,
++ .active_low = 1,
++ }
++};
++
++static struct ar71xx_pci_irq aw_nr580_pci_irqs[] __initdata = {
++ {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }
++};
++
++static void __init aw_nr580_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_pci_init(ARRAY_SIZE(aw_nr580_pci_irqs), aw_nr580_pci_irqs);
++
++ ar71xx_add_device_spi(NULL, aw_nr580_spi_info,
++ ARRAY_SIZE(aw_nr580_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(aw_nr580_leds_gpio),
++ aw_nr580_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, AW_NR580_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(aw_nr580_gpio_buttons),
++ aw_nr580_gpio_buttons);
++}
++
++MIPS_MACHINE(AR71XX_MACH_AW_NR580, "AzureWave AW-NR580", aw_nr580_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-generic.c linux-2.6.29.1/arch/mips/ar71xx/mach-generic.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-generic.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-generic.c 2009-04-13 14:27:34.547067937 +0200
+@@ -0,0 +1,22 @@
++/*
++ * Generic AR71xx machine support
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++
++static void __init ar71xx_generic_init(void)
++{
++ /* Nothing to do */
++}
++
++MIPS_MACHINE(AR71XX_MACH_GENERIC, "Generic AR71xx board", ar71xx_generic_init);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w04nu.c linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w04nu.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w04nu.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w04nu.c 2009-04-13 14:27:34.551067888 +0200
+@@ -0,0 +1,173 @@
++/*
++ * Planex MZK-W04NU board support
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define MZK_W04NU_GPIO_LED_USB 0
++#define MZK_W04NU_GPIO_LED_STATUS 1
++#define MZK_W04NU_GPIO_LED_WPS 3
++#define MZK_W04NU_GPIO_LED_WLAN 6
++#define MZK_W04NU_GPIO_LED_AP 15
++#define MZK_W04NU_GPIO_LED_ROUTER 16
++
++#define MZK_W04NU_GPIO_BTN_APROUTER 5
++#define MZK_W04NU_GPIO_BTN_WPS 12
++#define MZK_W04NU_GPIO_BTN_RESET 21
++
++#define MZK_W04NU_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition mzk_w04nu_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "kernel",
++ .offset = 0x050000,
++ .size = 0x160000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x1b0000,
++ .size = 0x630000,
++ } , {
++ .name = "art",
++ .offset = 0x7e0000,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "firmware",
++ .offset = 0x050000,
++ .size = 0x770000,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data mzk_w04nu_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = mzk_w04nu_partitions,
++ .nr_parts = ARRAY_SIZE(mzk_w04nu_partitions),
++#endif
++};
++
++static struct spi_board_info mzk_w04nu_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &mzk_w04nu_flash_data,
++ }
++};
++
++static struct gpio_led mzk_w04nu_leds_gpio[] __initdata = {
++ {
++ .name = "mzk-w04nu:green:status",
++ .gpio = MZK_W04NU_GPIO_LED_STATUS,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:blue:wps",
++ .gpio = MZK_W04NU_GPIO_LED_WPS,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:wlan",
++ .gpio = MZK_W04NU_GPIO_LED_WLAN,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:usb",
++ .gpio = MZK_W04NU_GPIO_LED_USB,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:ap",
++ .gpio = MZK_W04NU_GPIO_LED_AP,
++ .active_low = 1,
++ }, {
++ .name = "mzk-w04nu:green:router",
++ .gpio = MZK_W04NU_GPIO_LED_ROUTER,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button mzk_w04nu_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = MZK_W04NU_GPIO_BTN_RESET,
++ .active_low = 1,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = MZK_W04NU_GPIO_BTN_WPS,
++ .active_low = 1,
++ }, {
++ .desc = "aprouter",
++ .type = EV_KEY,
++ .code = BTN_2,
++ .threshold = 5,
++ .gpio = MZK_W04NU_GPIO_BTN_APROUTER,
++ .active_low = 0,
++ }
++};
++
++static void __init mzk_w04nu_setup(void)
++{
++ u8 *mac = (u8 *) KSEG1ADDR(0x1fff1000);
++
++ ar71xx_set_mac_base(mac);
++
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++ ar71xx_eth0_data.has_ar8216 = 1;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_spi(NULL, mzk_w04nu_spi_info,
++ ARRAY_SIZE(mzk_w04nu_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(mzk_w04nu_leds_gpio),
++ mzk_w04nu_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, MZK_W04NU_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(mzk_w04nu_gpio_buttons),
++ mzk_w04nu_gpio_buttons);
++ ar71xx_add_device_usb();
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_MZK_W04NU, "Planex MZK-W04NU", mzk_w04nu_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w300nh.c linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w300nh.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-mzk-w300nh.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-mzk-w300nh.c 2009-04-13 14:27:34.551067888 +0200
+@@ -0,0 +1,81 @@
++/*
++ * Planex MZK-W300NH board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition mzk_w300nh_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "uImage",
++ .offset = 0x050000,
++ .size = 0x160000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x1b0000,
++ .size = 0x610000,
++ } , {
++ .name = "config",
++ .offset = 0x7c0000,
++ .size = 0x020000,
++ } , {
++ .name = "art",
++ .offset = 0x7e0000,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data mzk_w300nh_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = mzk_w300nh_partitions,
++ .nr_parts = ARRAY_SIZE(mzk_w300nh_partitions),
++#endif
++};
++
++static struct spi_board_info mzk_w300nh_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &mzk_w300nh_flash_data,
++ }
++};
++
++static void __init mzk_w300nh_setup(void)
++{
++ ar71xx_add_device_spi(NULL, mzk_w300nh_spi_info,
++ ARRAY_SIZE(mzk_w300nh_spi_info));
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_MZK_W300NH, "Planex MZK-W300NH", mzk_w300nh_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-pb42.c linux-2.6.29.1/arch/mips/ar71xx/mach-pb42.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-pb42.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-pb42.c 2009-04-13 14:27:34.555068677 +0200
+@@ -0,0 +1,102 @@
++/*
++ * Atheros PB42 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++#include <linux/bitops.h>
++#include <linux/input.h>
++#include <linux/platform_device.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define PB42_BUTTONS_POLL_INTERVAL 20
++
++#define PB42_GPIO_BTN_SW4 8
++#define PB42_GPIO_BTN_SW5 3
++
++static struct spi_board_info pb42_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct ar71xx_pci_irq pb42_pci_irqs[] __initdata = {
++ {
++ .slot = 0,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 2,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV2,
++ }
++};
++
++static struct gpio_button pb42_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = PB42_GPIO_BTN_SW4,
++ .active_low = 1,
++ } , {
++ .desc = "sw5",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = PB42_GPIO_BTN_SW5,
++ .active_low = 1,
++ }
++};
++
++#define PB42_WAN_PHYMASK BIT(20)
++#define PB42_LAN_PHYMASK (BIT(16) | BIT(17) | BIT(18) | BIT(19))
++#define PB42_MDIO_PHYMASK (PB42_LAN_PHYMASK | PB42_WAN_PHYMASK)
++
++static void __init pb42_init(void)
++{
++ ar71xx_add_device_spi(NULL, pb42_spi_info,
++ ARRAY_SIZE(pb42_spi_info));
++
++ ar71xx_add_device_mdio(~PB42_MDIO_PHYMASK);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = PB42_WAN_PHYMASK;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = PB42_LAN_PHYMASK;
++ ar71xx_eth1_data.speed = SPEED_100;
++ ar71xx_eth1_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_gpio_buttons(-1, PB42_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(pb42_gpio_buttons),
++ pb42_gpio_buttons);
++
++ ar71xx_pci_init(ARRAY_SIZE(pb42_pci_irqs), pb42_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_PB42, "Atheros PB42", pb42_init);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-rb-4xx.c linux-2.6.29.1/arch/mips/ar71xx/mach-rb-4xx.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-rb-4xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-rb-4xx.c 2009-04-13 14:27:34.555068677 +0200
+@@ -0,0 +1,251 @@
++/*
++ * MikroTik RouterBOARD 4xx series support
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/irq.h>
++#include <linux/mmc/host.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/spi/mmc_spi.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define RB4XX_GPIO_USER_LED 4
++#define RB4XX_GPIO_RESET_SWITCH 7
++
++#define RB4XX_BUTTONS_POLL_INTERVAL 20
++
++static struct gpio_led rb4xx_leds_gpio[] __initdata = {
++ {
++ .name = "rb4xx:yellow:user",
++ .gpio = RB4XX_GPIO_USER_LED,
++ .active_low = 0,
++ },
++};
++
++static struct gpio_button rb4xx_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset_switch",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = RB4XX_GPIO_RESET_SWITCH,
++ .active_low = 1,
++ }
++};
++
++static struct platform_device rb4xx_nand_device = {
++ .name = "rb4xx-nand",
++ .id = -1,
++};
++
++static struct ar71xx_pci_irq rb4xx_pci_irqs[] __initdata = {
++ {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 2,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 2,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 3,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV2,
++ }
++};
++
++#if 0
++/*
++ * SPI device support is experimental
++ */
++static struct flash_platform_data rb4xx_flash_data = {
++ .type = "pm25lv512",
++};
++
++static struct spi_board_info rb4xx_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &rb4xx_flash_data,
++ }
++};
++
++static struct mmc_spi_platform_data rb433_mmc_data = {
++ .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
++};
++
++static struct spi_board_info rb433_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &rb433_flash_data,
++ }, {
++ .bus_num = 0,
++ .chip_select = 2,
++ .max_speed_hz = 25000000,
++ .modalias = "mmc_spi",
++ .platform_data = &rb433_mmc_data,
++ }
++};
++
++static u32 rb433_spi_get_ioc_base(u8 chip_select, int cs_high, int is_on)
++{
++ u32 ret;
++
++ if (is_on == AR71XX_SPI_CS_INACTIVE) {
++ ret = SPI_IOC_CS0 | SPI_IOC_CS1;
++ } else {
++ if (cs_high) {
++ ret = SPI_IOC_CS0 | SPI_IOC_CS1;
++ } else {
++ if ((chip_select ^ 2) == 0)
++ ret = SPI_IOC_CS1 ^ (SPI_IOC_CS0 | SPI_IOC_CS1);
++ else
++ ret = SPI_IOC_CS0 ^ (SPI_IOC_CS0 | SPI_IOC_CS1);
++ }
++ }
++
++ return ret;
++}
++
++struct ar71xx_spi_platform_data rb433_spi_data = {
++ .bus_num = 0,
++ .num_chipselect = 3,
++ .get_ioc_base = rb433_spi_get_ioc_base,
++};
++
++static void rb4xx_add_device_spi(void)
++{
++ ar71xx_add_device_spi(NULL, rb4xx_spi_info, ARRAY_SIZE(rb4xx_spi_info));
++}
++
++static void rb433_add_device_spi(void)
++{
++ ar71xx_add_device_spi(&rb433_spi_data, rb433_spi_info,
++ ARRAY_SIZE(rb433_spi_info));
++}
++#else
++static inline void rb4xx_add_device_spi(void) {}
++static inline void rb433_add_device_spi(void) {}
++#endif
++
++static void __init rb4xx_generic_setup(void)
++{
++ ar71xx_gpio_function_enable(GPIO_FUNC_SPI_CS1_EN |
++ GPIO_FUNC_SPI_CS2_EN);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
++ rb4xx_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(rb4xx_gpio_buttons),
++ rb4xx_gpio_buttons);
++
++ platform_device_register(&rb4xx_nand_device);
++}
++
++static void __init rb411_setup(void)
++{
++ rb4xx_generic_setup();
++ rb4xx_add_device_spi();
++
++ ar71xx_add_device_mdio(0xfffffffe);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x00000001;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);
++
++static void __init rb433_setup(void)
++{
++ rb4xx_generic_setup();
++ rb433_add_device_spi();
++
++ ar71xx_add_device_mdio(0xffffffe9);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x00000006;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x00000010;
++
++ ar71xx_add_device_eth(1);
++ ar71xx_add_device_eth(0);
++
++ ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_433, "MikroTik RouterBOARD 433/AH", rb433_setup);
++
++static void __init rb450_setup(void)
++{
++ rb4xx_generic_setup();
++ rb4xx_add_device_spi();
++
++ ar71xx_add_device_mdio(0xffffffe0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x0000000f;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x00000010;
++
++ ar71xx_add_device_eth(1);
++ ar71xx_add_device_eth(0);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_450, "MikroTik RouterBOARD 450", rb450_setup);
++
++static void __init rb493_setup(void)
++{
++ rb4xx_generic_setup();
++ rb4xx_add_device_spi();
++
++ ar71xx_add_device_mdio(0x3fffff00);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x00000001;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
++}
++
++MIPS_MACHINE(AR71XX_MACH_RB_493, "MikroTik RouterBOARD 493/AH", rb493_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tew-632brp.c linux-2.6.29.1/arch/mips/ar71xx/mach-tew-632brp.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tew-632brp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-tew-632brp.c 2009-04-13 14:27:34.559070024 +0200
+@@ -0,0 +1,142 @@
++/*
++ * TrendNET TEW-632BRP board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define TEW_632BRP_GPIO_LED_STATUS 1
++#define TEW_632BRP_GPIO_LED_WPS 3
++#define TEW_632BRP_GPIO_LED_WLAN 6
++#define TEW_632BRP_GPIO_BTN_WPS 12
++#define TEW_632BRP_GPIO_BTN_RESET 21
++
++#define TEW_632BRP_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition tew_632brp_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "config",
++ .offset = 0x020000,
++ .size = 0x010000,
++ } , {
++ .name = "kernel",
++ .offset = 0x030000,
++ .size = 0x0c0000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x0f0000,
++ .size = 0x300000,
++ } , {
++ .name = "art",
++ .offset = 0x3f0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "firmware",
++ .offset = 0x030000,
++ .size = 0x3c0000,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data tew_632brp_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = tew_632brp_partitions,
++ .nr_parts = ARRAY_SIZE(tew_632brp_partitions),
++#endif
++};
++
++static struct spi_board_info tew_632brp_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &tew_632brp_flash_data,
++ }
++};
++
++static struct gpio_led tew_632brp_leds_gpio[] __initdata = {
++ {
++ .name = "tew-632brp:green:status",
++ .gpio = TEW_632BRP_GPIO_LED_STATUS,
++ .active_low = 1,
++ }, {
++ .name = "tew-632brp:blue:wps",
++ .gpio = TEW_632BRP_GPIO_LED_WPS,
++ .active_low = 1,
++ }, {
++ .name = "tew-632brp:green:wlan",
++ .gpio = TEW_632BRP_GPIO_LED_WLAN,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button tew_632brp_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = TEW_632BRP_GPIO_BTN_RESET,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = TEW_632BRP_GPIO_BTN_WPS,
++ }
++};
++
++static void __init tew_632brp_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_spi(NULL, tew_632brp_spi_info,
++ ARRAY_SIZE(tew_632brp_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tew_632brp_leds_gpio),
++ tew_632brp_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, TEW_632BRP_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(tew_632brp_gpio_buttons),
++ tew_632brp_gpio_buttons);
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_TEW_632BRP, "TRENDnet TEW-632BRP", tew_632brp_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tl-wr941nd.c linux-2.6.29.1/arch/mips/ar71xx/mach-tl-wr941nd.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-tl-wr941nd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-tl-wr941nd.c 2009-04-13 14:27:34.591071588 +0200
+@@ -0,0 +1,144 @@
++/*
++ * TP-LINK TL-WR941ND board support
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define TL_WR941ND_GPIO_LED_SYSTEM 2
++#define TL_WR941ND_GPIO_LED_QSS 5
++
++#define TL_WR941ND_GPIO_BTN_RESET 3
++#define TL_WR941ND_GPIO_BTN_QSS 7
++
++#define TL_WR941ND_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition tl_wr941nd_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "kernel",
++ .offset = 0x020000,
++ .size = 0x120000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x140000,
++ .size = 0x2b0000,
++ } , {
++ .name = "art",
++ .offset = 0x3f0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "firmware",
++ .offset = 0x020000,
++ .size = 0x3d0000,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data tl_wr941nd_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = tl_wr941nd_partitions,
++ .nr_parts = ARRAY_SIZE(tl_wr941nd_partitions),
++#endif
++};
++
++static struct spi_board_info tl_wr941nd_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &tl_wr941nd_flash_data,
++ }
++};
++
++static struct gpio_led tl_wr941nd_leds_gpio[] __initdata = {
++ {
++ .name = "tl-wr941nd:green:system",
++ .gpio = TL_WR941ND_GPIO_LED_SYSTEM,
++ .active_low = 1,
++ }, {
++ .name = "tl-wr941nd:red:qss",
++ .gpio = TL_WR941ND_GPIO_LED_QSS,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button tl_wr941nd_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = TL_WR941ND_GPIO_BTN_RESET,
++ .active_low = 1,
++ }, {
++ .desc = "qss",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = TL_WR941ND_GPIO_BTN_QSS,
++ .active_low = 1,
++ }
++};
++
++static struct dsa_platform_data tl_wr941nd_dsa_data = {
++ .port_names[0] = "wan",
++ .port_names[1] = "lan1",
++ .port_names[2] = "lan2",
++ .port_names[3] = "lan3",
++ .port_names[4] = "lan4",
++ .port_names[5] = "cpu",
++};
++
++static void __init tl_wr941nd_setup(void)
++{
++ u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
++
++ ar71xx_set_mac_base(mac);
++
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0x0;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_dsa(0, &tl_wr941nd_dsa_data);
++
++ ar71xx_add_device_spi(NULL, tl_wr941nd_spi_info,
++ ARRAY_SIZE(tl_wr941nd_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_leds_gpio),
++ tl_wr941nd_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, TL_WR941ND_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(tl_wr941nd_gpio_buttons),
++ tl_wr941nd_gpio_buttons);
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_TL_WR941ND, "TP-LINK TL-WR941ND", tl_wr941nd_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ubnt.c linux-2.6.29.1/arch/mips/ar71xx/mach-ubnt.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-ubnt.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-ubnt.c 2009-04-13 14:27:34.591071588 +0200
+@@ -0,0 +1,188 @@
++/*
++ * Ubiquiti RouterStation support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ * Copyright (C) 2008 Ubiquiti <support@ubnt.com>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define UBNT_RS_GPIO_LED_RF 2
++#define UBNT_RS_GPIO_SW4 8
++
++#define UBNT_LS_SR71_GPIO_LED_D25 0
++#define UBNT_LS_SR71_GPIO_LED_D26 1
++#define UBNT_LS_SR71_GPIO_LED_D24 2
++#define UBNT_LS_SR71_GPIO_LED_D23 4
++#define UBNT_LS_SR71_GPIO_LED_D22 5
++#define UBNT_LS_SR71_GPIO_LED_D27 6
++#define UBNT_LS_SR71_GPIO_LED_D28 7
++
++#define UBNT_BUTTONS_POLL_INTERVAL 20
++
++static struct spi_board_info ubnt_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct ar71xx_pci_irq ubnt_pci_irqs[] __initdata = {
++ {
++ .slot = 0,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }, {
++ .slot = 2,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV2,
++ }
++};
++
++static struct gpio_led ubnt_rs_leds_gpio[] __initdata = {
++ {
++ .name = "ubnt:green:rf",
++ .gpio = UBNT_RS_GPIO_LED_RF,
++ .active_low = 0,
++ }
++};
++
++static struct gpio_led ubnt_ls_sr71_leds_gpio[] __initdata = {
++ {
++ .name = "ubnt:green:d22",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D22,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d23",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D23,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d24",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D24,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:red:d25",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D25,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:red:d26",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D26,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d27",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D27,
++ .active_low = 0,
++ }, {
++ .name = "ubnt:green:d28",
++ .gpio = UBNT_LS_SR71_GPIO_LED_D28,
++ .active_low = 0,
++ }
++};
++
++static struct gpio_button ubnt_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = UBNT_RS_GPIO_SW4,
++ .active_low = 1,
++ }
++};
++
++static void __init ubnt_generic_setup(void)
++{
++ ar71xx_add_device_spi(NULL, ubnt_spi_info,
++ ARRAY_SIZE(ubnt_spi_info));
++
++ ar71xx_add_device_gpio_buttons(-1, UBNT_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(ubnt_gpio_buttons),
++ ubnt_gpio_buttons);
++
++ ar71xx_pci_init(ARRAY_SIZE(ubnt_pci_irqs), ubnt_pci_irqs);
++}
++
++#define UBNT_RS_WAN_PHYMASK (1 << 20)
++#define UBNT_RS_LAN_PHYMASK ((1 << 16) | (1 << 17) | (1 << 18) | (1 << 19))
++
++static void __init ubnt_rs_setup(void)
++{
++ ubnt_generic_setup();
++
++ ar71xx_add_device_mdio(~(UBNT_RS_WAN_PHYMASK | UBNT_RS_LAN_PHYMASK));
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = UBNT_RS_WAN_PHYMASK;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = UBNT_RS_LAN_PHYMASK;
++
++ ar71xx_eth1_data.speed = SPEED_100;
++ ar71xx_eth1_data.duplex = DUPLEX_FULL;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_usb();
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_rs_leds_gpio),
++ ubnt_rs_leds_gpio);
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_RS, "Ubiquiti RouterStation", ubnt_rs_setup);
++
++static void __init ubnt_rspro_setup(void)
++{
++ ubnt_generic_setup();
++
++ ar71xx_add_device_usb();
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_RSPRO, "Ubiquiti RouterStation Pro",
++ ubnt_rspro_setup);
++
++static void __init ubnt_lsx_setup(void)
++{
++ ubnt_generic_setup();
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_LSX, "Ubiquiti LSX", ubnt_lsx_setup);
++
++#define UBNT_LSSR71_PHY_MASK (1 << 1)
++
++static void __init ubnt_lssr71_setup(void)
++{
++ ubnt_generic_setup();
++
++ ar71xx_add_device_mdio(~UBNT_LSSR71_PHY_MASK);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = UBNT_LSSR71_PHY_MASK;
++
++ ar71xx_add_device_eth(0);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ubnt_ls_sr71_leds_gpio),
++ ubnt_ls_sr71_leds_gpio);
++}
++
++MIPS_MACHINE(AR71XX_MACH_UBNT_LSSR71, "Ubiquiti LS-SR71", ubnt_lssr71_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wnr2000.c linux-2.6.29.1/arch/mips/ar71xx/mach-wnr2000.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wnr2000.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-wnr2000.c 2009-04-13 14:27:34.595070701 +0200
+@@ -0,0 +1,158 @@
++/*
++ * NETGEAR WNR2000 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ * Copyright (C) 2008-2009 Andy Boyett <agb@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++#define WNR2000_GPIO_LED_PWR_GREEN 14
++#define WNR2000_GPIO_LED_PWR_AMBER 7
++#define WNR2000_GPIO_LED_WPS 4
++#define WNR2000_GPIO_LED_WLAN 6
++#define WNR2000_GPIO_BTN_RESET 21
++#define WNR2000_GPIO_BTN_WPS 8
++
++#define WNR2000_BUTTONS_POLL_INTERVAL 20
++
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition wnr2000_partitions[] = {
++ {
++ .name = "u-boot",
++ .offset = 0,
++ .size = 0x040000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "u-boot-env",
++ .offset = 0x040000,
++ .size = 0x010000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x050000,
++ .size = 0x240000,
++ } , {
++ .name = "user-config",
++ .offset = 0x290000,
++ .size = 0x010000,
++ } , {
++ .name = "uImage",
++ .offset = 0x2a0000,
++ .size = 0x120000,
++ } , {
++ .name = "language_table",
++ .offset = 0x3c0000,
++ .size = 0x020000,
++ } , {
++ .name = "rootfs_checksum",
++ .offset = 0x3e0000,
++ .size = 0x010000,
++ } , {
++ .name = "art",
++ .offset = 0x3f0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ }
++};
++#endif /* CONFIG_MTD_PARTITIONS */
++
++static struct flash_platform_data wnr2000_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++ .parts = wnr2000_partitions,
++ .nr_parts = ARRAY_SIZE(wnr2000_partitions),
++#endif
++};
++
++static struct spi_board_info wnr2000_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ .platform_data = &wnr2000_flash_data,
++ }
++};
++
++static struct gpio_led wnr2000_leds_gpio[] __initdata = {
++ {
++ .name = "wnr2000:green:power",
++ .gpio = WNR2000_GPIO_LED_PWR_GREEN,
++ .active_low = 1,
++ }, {
++ .name = "wnr2000:amber:power",
++ .gpio = WNR2000_GPIO_LED_PWR_AMBER,
++ .active_low = 1,
++ }, {
++ .name = "wnr2000:green:wps",
++ .gpio = WNR2000_GPIO_LED_WPS,
++ .active_low = 1,
++ }, {
++ .name = "wnr2000:blue:wlan",
++ .gpio = WNR2000_GPIO_LED_WLAN,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button wnr2000_gpio_buttons[] __initdata = {
++ {
++ .desc = "reset",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = WNR2000_GPIO_BTN_RESET,
++ }, {
++ .desc = "wps",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = WNR2000_GPIO_BTN_WPS,
++ }
++};
++
++static void __init wnr2000_setup(void)
++{
++ ar71xx_add_device_mdio(0x0);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth0_data.phy_mask = 0xf;
++ ar71xx_eth0_data.speed = SPEED_100;
++ ar71xx_eth0_data.duplex = DUPLEX_FULL;
++ ar71xx_eth0_data.has_ar8216 = 1;
++
++ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
++ ar71xx_eth1_data.phy_mask = 0x10;
++
++ ar71xx_add_device_eth(0);
++ ar71xx_add_device_eth(1);
++
++ ar71xx_add_device_spi(NULL, wnr2000_spi_info,
++ ARRAY_SIZE(wnr2000_spi_info));
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wnr2000_leds_gpio),
++ wnr2000_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, WNR2000_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(wnr2000_gpio_buttons),
++ wnr2000_gpio_buttons);
++
++
++ ar91xx_add_device_wmac();
++}
++
++MIPS_MACHINE(AR71XX_MACH_WNR2000, "NETGEAR WNR2000", wnr2000_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wp543.c linux-2.6.29.1/arch/mips/ar71xx/mach-wp543.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/mach-wp543.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/mach-wp543.c 2009-04-13 14:27:34.595070701 +0200
+@@ -0,0 +1,118 @@
++/*
++ * Compex WP543 board support
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/flash.h>
++#include <linux/input.h>
++
++#include <asm/mips_machine.h>
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define WP543_GPIO_SW6 2
++#define WP543_GPIO_LED_1 3
++#define WP543_GPIO_LED_2 4
++#define WP543_GPIO_LED_WLAN 5
++#define WP543_GPIO_LED_CONN 6
++#define WP543_GPIO_LED_DIAG 7
++#define WP543_GPIO_SW4 8
++
++#define WP543_BUTTONS_POLL_INTERVAL 20
++
++static struct spi_board_info wp543_spi_info[] = {
++ {
++ .bus_num = 0,
++ .chip_select = 0,
++ .max_speed_hz = 25000000,
++ .modalias = "m25p80",
++ }
++};
++
++static struct ar71xx_pci_irq wp543_pci_irqs[] __initdata = {
++ {
++ .slot = 1,
++ .pin = 1,
++ .irq = AR71XX_PCI_IRQ_DEV0,
++ }, {
++ .slot = 1,
++ .pin = 2,
++ .irq = AR71XX_PCI_IRQ_DEV1,
++ }
++};
++
++static struct gpio_led wp543_leds_gpio[] __initdata = {
++ {
++ .name = "wp543:green:led1",
++ .gpio = WP543_GPIO_LED_1,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:led2",
++ .gpio = WP543_GPIO_LED_2,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:wlan",
++ .gpio = WP543_GPIO_LED_WLAN,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:conn",
++ .gpio = WP543_GPIO_LED_CONN,
++ .active_low = 1,
++ }, {
++ .name = "wp543:green:diag",
++ .gpio = WP543_GPIO_LED_DIAG,
++ .active_low = 1,
++ }
++};
++
++static struct gpio_button wp543_gpio_buttons[] __initdata = {
++ {
++ .desc = "sw6",
++ .type = EV_KEY,
++ .code = BTN_0,
++ .threshold = 5,
++ .gpio = WP543_GPIO_SW6,
++ }, {
++ .desc = "sw4",
++ .type = EV_KEY,
++ .code = BTN_1,
++ .threshold = 5,
++ .gpio = WP543_GPIO_SW4,
++ }
++};
++
++static void __init wp543_setup(void)
++{
++ ar71xx_add_device_spi(NULL, wp543_spi_info, ARRAY_SIZE(wp543_spi_info));
++
++ ar71xx_add_device_mdio(0xfffffff7);
++
++ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
++ ar71xx_eth0_data.phy_mask = 0x00000008;
++ ar71xx_add_device_eth(0);
++
++ ar71xx_add_device_usb();
++
++ ar71xx_pci_init(ARRAY_SIZE(wp543_pci_irqs), wp543_pci_irqs);
++
++ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wp543_leds_gpio),
++ wp543_leds_gpio);
++
++ ar71xx_add_device_gpio_buttons(-1, WP543_BUTTONS_POLL_INTERVAL,
++ ARRAY_SIZE(wp543_gpio_buttons),
++ wp543_gpio_buttons);
++}
++
++MIPS_MACHINE(AR71XX_MACH_WP543, "Compex WP543", wp543_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/prom.c linux-2.6.29.1/arch/mips/ar71xx/prom.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/prom.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/prom.c 2009-04-13 14:27:34.595070701 +0200
+@@ -0,0 +1,207 @@
++/*
++ * Atheros AR71xx SoC specific prom routines
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/serial_reg.h>
++
++#include <asm/bootinfo.h>
++#include <asm/addrspace.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#include "devices.h"
++
++struct board_rec {
++ char *name;
++ unsigned long mach_type;
++};
++
++static int ar71xx_prom_argc __initdata;
++static char **ar71xx_prom_argv __initdata;
++static char **ar71xx_prom_envp __initdata;
++
++static struct board_rec boards[] __initdata = {
++ {
++ .name = "411",
++ .mach_type = AR71XX_MACH_RB_411,
++ }, {
++ .name = "433",
++ .mach_type = AR71XX_MACH_RB_433,
++ }, {
++ .name = "450",
++ .mach_type = AR71XX_MACH_RB_450,
++ }, {
++ .name = "493",
++ .mach_type = AR71XX_MACH_RB_493,
++ }, {
++ .name = "AP81",
++ .mach_type = AR71XX_MACH_AP81,
++ }, {
++ .name = "AP83",
++ .mach_type = AR71XX_MACH_AP83,
++ }, {
++ .name = "AW-NR580",
++ .mach_type = AR71XX_MACH_AW_NR580,
++ }, {
++ .name = "TEW-632BRP",
++ .mach_type = AR71XX_MACH_TEW_632BRP,
++ }, {
++ .name = "TL-WR941ND",
++ .mach_type = AR71XX_MACH_TL_WR941ND,
++ }, {
++ .name = "UBNT-RS",
++ .mach_type = AR71XX_MACH_UBNT_RS,
++ }, {
++ .name = "UBNT-RSPRO",
++ .mach_type = AR71XX_MACH_UBNT_RSPRO,
++ }, {
++ .name = "Ubiquiti AR71xx-based board",
++ .mach_type = AR71XX_MACH_UBNT_RS,
++ }, {
++ .name = "UBNT-LS-SR71",
++ .mach_type = AR71XX_MACH_UBNT_LSSR71,
++ }, {
++ .name = "UBNT-LSX",
++ .mach_type = AR71XX_MACH_UBNT_LSX,
++ }, {
++ .name = "WNR2000",
++ .mach_type = AR71XX_MACH_WNR2000,
++ }, {
++ .name = "PB42",
++ .mach_type = AR71XX_MACH_PB42,
++ }, {
++ .name = "MZK-W300NH",
++ .mach_type = AR71XX_MACH_MZK_W300NH,
++ }, {
++ .name = "MZK-W04NU",
++ .mach_type = AR71XX_MACH_MZK_W04NU,
++ }
++};
++
++static inline int is_valid_ram_addr(void *addr)
++{
++ if (((u32) addr > KSEG0) &&
++ ((u32) addr < (KSEG0 + AR71XX_MEM_SIZE_MAX)))
++ return 1;
++
++ if (((u32) addr > KSEG1) &&
++ ((u32) addr < (KSEG1 + AR71XX_MEM_SIZE_MAX)))
++ return 1;
++
++ return 0;
++}
++
++static __init char *ar71xx_prom_getargv(const char *name)
++{
++ int len = strlen(name);
++ int i;
++
++ if (!is_valid_ram_addr(ar71xx_prom_argv))
++ return NULL;
++
++ for (i = 0; i < ar71xx_prom_argc; i++) {
++ char *argv = ar71xx_prom_argv[i];
++
++ if (!is_valid_ram_addr(argv))
++ continue;
++
++ if (strncmp(name, argv, len) == 0 && (argv)[len] == '=')
++ return argv + len + 1;
++ }
++
++ return NULL;
++}
++
++static __init char *ar71xx_prom_getenv(const char *envname)
++{
++ int len = strlen(envname);
++ char **env;
++
++ if (!is_valid_ram_addr(ar71xx_prom_envp))
++ return NULL;
++
++ for (env = ar71xx_prom_envp; is_valid_ram_addr(*env); env++) {
++ if (strncmp(envname, *env, len) == 0 && (*env)[len] == '=')
++ return *env + len + 1;
++
++ /* RedBoot env comes in pointer pairs - key, value */
++ if (strncmp(envname, *env, len) == 0 && (*env)[len] == 0)
++ if (is_valid_ram_addr(*(++env)))
++ return *env;
++ }
++
++ return NULL;
++}
++
++static __init unsigned long find_board_byname(char *name)
++{
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(boards); i++)
++ if (strcmp(name, boards[i].name) == 0)
++ return boards[i].mach_type;
++
++ return AR71XX_MACH_GENERIC;
++}
++
++
++static void ar71xx_prom_init_generic(void)
++{
++ char *p;
++
++ ar71xx_prom_argc = fw_arg0;
++ ar71xx_prom_argv = (char **)fw_arg1;
++ ar71xx_prom_envp = (char **)fw_arg2;
++
++ p = ar71xx_prom_getargv("board");
++ if (!p)
++ p = ar71xx_prom_getenv("board");
++ if (p)
++ ar71xx_mach_type = find_board_byname(p);
++
++ p = ar71xx_prom_getenv("ethaddr");
++ if (!p)
++ p = ar71xx_prom_getargv("kmac");
++ if (p)
++ ar71xx_parse_mac_addr(p);
++}
++
++void __init prom_init(void)
++{
++ printk(KERN_DEBUG "prom: fw_arg0=%08x, fw_arg1=%08x, "
++ "fw_arg2=%08x, fw_arg3=%08x\n",
++ (unsigned int)fw_arg0, (unsigned int)fw_arg1,
++ (unsigned int)fw_arg2, (unsigned int)fw_arg3);
++
++ ar71xx_mach_type = AR71XX_MACH_GENERIC;
++
++ ar71xx_prom_init_generic();
++}
++
++void __init prom_free_prom_memory(void)
++{
++ /* We do not have to prom memory to free */
++}
++
++#define UART_READ(r) \
++ __raw_readl((void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE) + 4 * (r)))
++
++#define UART_WRITE(r, v) \
++ __raw_writel((v), (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE) + 4*(r)))
++
++void prom_putchar(unsigned char ch)
++{
++ while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
++ UART_WRITE(UART_TX, ch);
++ while (((UART_READ(UART_LSR)) & UART_LSR_THRE) == 0);
++}
+diff -Nur linux-2.6.29.1.orig/arch/mips/ar71xx/setup.c linux-2.6.29.1/arch/mips/ar71xx/setup.c
+--- linux-2.6.29.1.orig/arch/mips/ar71xx/setup.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/ar71xx/setup.c 2009-04-13 14:27:34.599071210 +0200
+@@ -0,0 +1,291 @@
++/*
++ * Atheros AR71xx SoC specific setup
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/types.h>
++#include <linux/pci.h>
++#include <linux/serial_8250.h>
++#include <linux/bootmem.h>
++
++#include <asm/bootinfo.h>
++#include <asm/traps.h>
++#include <asm/time.h> /* for mips_hpt_frequency */
++#include <asm/reboot.h> /* for _machine_{restart,halt} */
++#include <asm/mips_machine.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#include "devices.h"
++
++#define AR71XX_SYS_TYPE_LEN 64
++#define AR71XX_BASE_FREQ 40000000
++#define AR91XX_BASE_FREQ 5000000
++
++unsigned long ar71xx_mach_type;
++
++u32 ar71xx_cpu_freq;
++EXPORT_SYMBOL_GPL(ar71xx_cpu_freq);
++
++u32 ar71xx_ahb_freq;
++EXPORT_SYMBOL_GPL(ar71xx_ahb_freq);
++
++u32 ar71xx_ddr_freq;
++EXPORT_SYMBOL_GPL(ar71xx_ddr_freq);
++
++enum ar71xx_soc_type ar71xx_soc;
++EXPORT_SYMBOL_GPL(ar71xx_soc);
++
++int (*ar71xx_pci_bios_init)(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map) __initdata;
++
++int (*ar71xx_pci_be_handler)(int is_fixup);
++
++static char ar71xx_sys_type[AR71XX_SYS_TYPE_LEN];
++
++static void ar71xx_restart(char *command)
++{
++ ar71xx_device_stop(RESET_MODULE_FULL_CHIP);
++ for (;;)
++ if (cpu_wait)
++ cpu_wait();
++}
++
++static void ar71xx_halt(void)
++{
++ while (1)
++ cpu_wait();
++}
++
++static int ar71xx_be_handler(struct pt_regs *regs, int is_fixup)
++{
++ int err = 0;
++
++ if (ar71xx_pci_be_handler)
++ err = ar71xx_pci_be_handler(is_fixup);
++
++ return (is_fixup && !err) ? MIPS_BE_FIXUP : MIPS_BE_FATAL;
++}
++
++int __init ar71xx_pci_init(unsigned nr_irqs, struct ar71xx_pci_irq *map)
++{
++ if (!ar71xx_pci_bios_init)
++ return 0;
++
++ return ar71xx_pci_bios_init(nr_irqs, map);
++}
++
++static void __init ar71xx_detect_mem_size(void)
++{
++ unsigned long size;
++
++ for (size = AR71XX_MEM_SIZE_MIN; size < AR71XX_MEM_SIZE_MAX;
++ size <<= 1 ) {
++ if (!memcmp(ar71xx_detect_mem_size,
++ ar71xx_detect_mem_size + size, 1024))
++ break;
++ }
++
++ add_memory_region(0, size, BOOT_MEM_RAM);
++}
++
++static void __init ar71xx_detect_sys_type(void)
++{
++ char *chip;
++ u32 id;
++ u32 rev;
++
++ id = ar71xx_reset_rr(AR71XX_RESET_REG_REV_ID) & REV_ID_MASK;
++ rev = (id >> REV_ID_REVISION_SHIFT) & REV_ID_REVISION_MASK;
++
++ switch (id & REV_ID_CHIP_MASK) {
++ case REV_ID_CHIP_AR7130:
++ ar71xx_soc = AR71XX_SOC_AR7130;
++ chip = "7130";
++ break;
++
++ case REV_ID_CHIP_AR7141:
++ ar71xx_soc = AR71XX_SOC_AR7141;
++ chip = "7141";
++ break;
++
++ case REV_ID_CHIP_AR7161:
++ ar71xx_soc = AR71XX_SOC_AR7161;
++ chip = "7161";
++ break;
++
++ case REV_ID_CHIP_AR9130:
++ ar71xx_soc = AR71XX_SOC_AR9130;
++ chip = "9130";
++ break;
++
++ case REV_ID_CHIP_AR9132:
++ ar71xx_soc = AR71XX_SOC_AR9132;
++ chip = "9132";
++ break;
++
++ default:
++ panic("ar71xx: unknown chip id:0x%02x\n", id);
++ }
++
++ sprintf(ar71xx_sys_type, "Atheros AR%s rev %u (id:0x%02x)",
++ chip, rev, id);
++}
++
++static void __init ar91xx_detect_sys_frequency(void)
++{
++ u32 pll;
++ u32 freq;
++ u32 div;
++
++ pll = ar71xx_pll_rr(AR91XX_PLL_REG_CPU_CONFIG);
++
++ div = ((pll >> AR91XX_PLL_DIV_SHIFT) & AR91XX_PLL_DIV_MASK);
++ freq = div * AR91XX_BASE_FREQ;
++
++ ar71xx_cpu_freq = freq;
++
++ div = ((pll >> AR91XX_DDR_DIV_SHIFT) & AR91XX_DDR_DIV_MASK) + 1;
++ ar71xx_ddr_freq = freq / div;
++
++ div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2;
++ ar71xx_ahb_freq = ar71xx_cpu_freq / div;
++}
++
++static void __init ar71xx_detect_sys_frequency(void)
++{
++ u32 pll;
++ u32 freq;
++ u32 div;
++
++ pll = ar71xx_pll_rr(AR71XX_PLL_REG_CPU_CONFIG);
++
++ div = ((pll >> AR71XX_PLL_DIV_SHIFT) & AR71XX_PLL_DIV_MASK) + 1;
++ freq = div * AR71XX_BASE_FREQ;
++
++ div = ((pll >> AR71XX_CPU_DIV_SHIFT) & AR71XX_CPU_DIV_MASK) + 1;
++ ar71xx_cpu_freq = freq / div;
++
++ div = ((pll >> AR71XX_DDR_DIV_SHIFT) & AR71XX_DDR_DIV_MASK) + 1;
++ ar71xx_ddr_freq = freq / div;
++
++ div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2;
++ ar71xx_ahb_freq = ar71xx_cpu_freq / div;
++}
++
++static void __init detect_sys_frequency(void)
++{
++ switch (ar71xx_soc) {
++ case AR71XX_SOC_AR7130:
++ case AR71XX_SOC_AR7141:
++ case AR71XX_SOC_AR7161:
++ ar71xx_detect_sys_frequency();
++ break;
++
++ case AR71XX_SOC_AR9130:
++ case AR71XX_SOC_AR9132:
++ ar91xx_detect_sys_frequency();
++ break;
++
++ default:
++ BUG();
++ }
++}
++
++#ifdef CONFIG_AR71XX_EARLY_SERIAL
++static void __init ar71xx_early_serial_setup(void)
++{
++ struct uart_port p;
++
++ memset(&p, 0, sizeof(p));
++
++ p.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP;
++ p.iotype = UPIO_MEM32;
++ p.uartclk = ar71xx_ahb_freq;
++ p.irq = AR71XX_MISC_IRQ_UART;
++ p.regshift = 2;
++ p.mapbase = AR71XX_UART_BASE;
++
++ early_serial_setup(&p);
++}
++#else
++static inline void ar71xx_early_serial_setup(void) {};
++#endif /* CONFIG_AR71XX_EARLY_SERIAL */
++
++const char *get_system_type(void)
++{
++ return ar71xx_sys_type;
++}
++
++unsigned int __cpuinit get_c0_compare_irq(void)
++{
++ return CP0_LEGACY_COMPARE_IRQ;
++}
++
++void __init plat_mem_setup(void)
++{
++ set_io_port_base(KSEG1);
++
++ ar71xx_ddr_base = ioremap_nocache(AR71XX_DDR_CTRL_BASE,
++ AR71XX_DDR_CTRL_SIZE);
++
++ ar71xx_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
++ AR71XX_PLL_SIZE);
++
++ ar71xx_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
++ AR71XX_RESET_SIZE);
++
++ ar71xx_gpio_base = ioremap_nocache(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE);
++
++ ar71xx_usb_ctrl_base = ioremap_nocache(AR71XX_USB_CTRL_BASE,
++ AR71XX_USB_CTRL_SIZE);
++
++ ar71xx_detect_mem_size();
++ ar71xx_detect_sys_type();
++ detect_sys_frequency();
++
++ printk(KERN_INFO
++ "%s, CPU:%u.%03u MHz, AHB:%u.%03u MHz, DDR:%u.%03u MHz\n",
++ ar71xx_sys_type,
++ ar71xx_cpu_freq / 1000000, (ar71xx_cpu_freq / 1000) % 1000,
++ ar71xx_ahb_freq / 1000000, (ar71xx_ahb_freq / 1000) % 1000,
++ ar71xx_ddr_freq / 1000000, (ar71xx_ddr_freq / 1000) % 1000);
++
++ _machine_restart = ar71xx_restart;
++ _machine_halt = ar71xx_halt;
++ pm_power_off = ar71xx_halt;
++
++ board_be_handler = ar71xx_be_handler;
++
++ ar71xx_early_serial_setup();
++}
++
++void __init plat_time_init(void)
++{
++ mips_hpt_frequency = ar71xx_cpu_freq / 2;
++}
++
++static int __init ar71xx_machine_setup(void)
++{
++ ar71xx_gpio_init();
++
++ ar71xx_add_device_uart();
++ ar71xx_add_device_wdt();
++
++ mips_machine_setup(ar71xx_mach_type);
++ return 0;
++}
++
++arch_initcall(ar71xx_machine_setup);
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/fw/myloader/myloader.h linux-2.6.29.1/arch/mips/include/asm/fw/myloader/myloader.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/fw/myloader/myloader.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/fw/myloader/myloader.h 2009-04-13 14:27:34.599071210 +0200
+@@ -0,0 +1,34 @@
++/*
++ * Compex's MyLoader specific definitions
++ *
++ * Copyright (C) 2006-2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#ifndef _ASM_MIPS_FW_MYLOADER_H
++#define _ASM_MIPS_FW_MYLOADER_H
++
++#include <linux/myloader.h>
++
++struct myloader_info {
++ uint32_t vid;
++ uint32_t did;
++ uint32_t svid;
++ uint32_t sdid;
++ uint8_t macs[MYLO_ETHADDR_COUNT][6];
++};
++
++#ifdef CONFIG_MYLOADER
++extern struct myloader_info *myloader_get_info(void) __init;
++#else
++static inline struct myloader_info *myloader_get_info(void)
++{
++ return NULL;
++}
++#endif /* CONFIG_MYLOADER */
++
++#endif /* _ASM_MIPS_FW_MYLOADER_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/ar71xx.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/ar71xx.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/ar71xx.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/ar71xx.h 2009-04-13 14:27:34.623072313 +0200
+@@ -0,0 +1,438 @@
++/*
++ * Atheros AR71xx SoC specific definitions
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_H
++#define __ASM_MACH_AR71XX_H
++
++#include <linux/types.h>
++#include <linux/init.h>
++#include <linux/io.h>
++#include <linux/bitops.h>
++
++#ifndef __ASSEMBLER__
++
++#define AR71XX_PCI_MEM_BASE 0x10000000
++#define AR71XX_PCI_MEM_SIZE 0x08000000
++#define AR71XX_APB_BASE 0x18000000
++#define AR71XX_GE0_BASE 0x19000000
++#define AR71XX_GE0_SIZE 0x01000000
++#define AR71XX_GE1_BASE 0x1a000000
++#define AR71XX_GE1_SIZE 0x01000000
++#define AR71XX_EHCI_BASE 0x1b000000
++#define AR71XX_EHCI_SIZE 0x01000000
++#define AR71XX_OHCI_BASE 0x1c000000
++#define AR71XX_OHCI_SIZE 0x01000000
++#define AR71XX_SPI_BASE 0x1f000000
++#define AR71XX_SPI_SIZE 0x01000000
++
++#define AR71XX_DDR_CTRL_BASE (AR71XX_APB_BASE + 0x00000000)
++#define AR71XX_DDR_CTRL_SIZE 0x10000
++#define AR71XX_CPU_BASE (AR71XX_APB_BASE + 0x00010000)
++#define AR71XX_UART_BASE (AR71XX_APB_BASE + 0x00020000)
++#define AR71XX_UART_SIZE 0x10000
++#define AR71XX_USB_CTRL_BASE (AR71XX_APB_BASE + 0x00030000)
++#define AR71XX_USB_CTRL_SIZE 0x10000
++#define AR71XX_GPIO_BASE (AR71XX_APB_BASE + 0x00040000)
++#define AR71XX_GPIO_SIZE 0x10000
++#define AR71XX_PLL_BASE (AR71XX_APB_BASE + 0x00050000)
++#define AR71XX_PLL_SIZE 0x10000
++#define AR71XX_RESET_BASE (AR71XX_APB_BASE + 0x00060000)
++#define AR71XX_RESET_SIZE 0x10000
++#define AR71XX_MII_BASE (AR71XX_APB_BASE + 0x00070000)
++#define AR71XX_MII_SIZE 0x10000
++#define AR71XX_SLIC_BASE (AR71XX_APB_BASE + 0x00090000)
++#define AR71XX_SLIC_SIZE 0x10000
++#define AR71XX_DMA_BASE (AR71XX_APB_BASE + 0x000A0000)
++#define AR71XX_DMA_SIZE 0x10000
++#define AR71XX_STEREO_BASE (AR71XX_APB_BASE + 0x000B0000)
++#define AR71XX_STEREO_SIZE 0x10000
++#define AR91XX_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000)
++#define AR91XX_WMAC_SIZE 0x30000
++
++#define AR71XX_MEM_SIZE_MIN 0x0200000
++#define AR71XX_MEM_SIZE_MAX 0x8000000
++
++#define AR71XX_CPU_IRQ_BASE 0
++#define AR71XX_MISC_IRQ_BASE 8
++#define AR71XX_MISC_IRQ_COUNT 8
++#define AR71XX_GPIO_IRQ_BASE 16
++#define AR71XX_GPIO_IRQ_COUNT 16
++#define AR71XX_PCI_IRQ_BASE 32
++#define AR71XX_PCI_IRQ_COUNT 4
++
++#define AR71XX_CPU_IRQ_PCI (AR71XX_CPU_IRQ_BASE + 2)
++#define AR71XX_CPU_IRQ_WMAC (AR71XX_CPU_IRQ_BASE + 2)
++#define AR71XX_CPU_IRQ_USB (AR71XX_CPU_IRQ_BASE + 3)
++#define AR71XX_CPU_IRQ_GE0 (AR71XX_CPU_IRQ_BASE + 4)
++#define AR71XX_CPU_IRQ_GE1 (AR71XX_CPU_IRQ_BASE + 5)
++#define AR71XX_CPU_IRQ_MISC (AR71XX_CPU_IRQ_BASE + 6)
++#define AR71XX_CPU_IRQ_TIMER (AR71XX_CPU_IRQ_BASE + 7)
++
++#define AR71XX_MISC_IRQ_TIMER (AR71XX_MISC_IRQ_BASE + 0)
++#define AR71XX_MISC_IRQ_ERROR (AR71XX_MISC_IRQ_BASE + 1)
++#define AR71XX_MISC_IRQ_GPIO (AR71XX_MISC_IRQ_BASE + 2)
++#define AR71XX_MISC_IRQ_UART (AR71XX_MISC_IRQ_BASE + 3)
++#define AR71XX_MISC_IRQ_WDOG (AR71XX_MISC_IRQ_BASE + 4)
++#define AR71XX_MISC_IRQ_PERFC (AR71XX_MISC_IRQ_BASE + 5)
++#define AR71XX_MISC_IRQ_OHCI (AR71XX_MISC_IRQ_BASE + 6)
++#define AR71XX_MISC_IRQ_DMA (AR71XX_MISC_IRQ_BASE + 7)
++
++#define AR71XX_GPIO_IRQ(_x) (AR71XX_GPIO_IRQ_BASE + (_x))
++
++#define AR71XX_PCI_IRQ_DEV0 (AR71XX_PCI_IRQ_BASE + 0)
++#define AR71XX_PCI_IRQ_DEV1 (AR71XX_PCI_IRQ_BASE + 1)
++#define AR71XX_PCI_IRQ_DEV2 (AR71XX_PCI_IRQ_BASE + 2)
++#define AR71XX_PCI_IRQ_CORE (AR71XX_PCI_IRQ_BASE + 3)
++
++extern u32 ar71xx_ahb_freq;
++extern u32 ar71xx_cpu_freq;
++extern u32 ar71xx_ddr_freq;
++
++enum ar71xx_soc_type {
++ AR71XX_SOC_UNKNOWN,
++ AR71XX_SOC_AR7130,
++ AR71XX_SOC_AR7141,
++ AR71XX_SOC_AR7161,
++ AR71XX_SOC_AR9130,
++ AR71XX_SOC_AR9132
++};
++
++extern enum ar71xx_soc_type ar71xx_soc;
++
++extern unsigned long ar71xx_mach_type;
++
++#define AR71XX_MACH_GENERIC 0
++#define AR71XX_MACH_WP543 1 /* Compex WP543 */
++#define AR71XX_MACH_RB_411 2 /* MikroTik RouterBOARD 411/411A/411AH */
++#define AR71XX_MACH_RB_433 3 /* MikroTik RouterBOARD 433/433AH */
++#define AR71XX_MACH_RB_450 4 /* MikroTik RouterBOARD 450 */
++#define AR71XX_MACH_RB_493 5 /* Mikrotik RouterBOARD 493/493AH */
++#define AR71XX_MACH_AW_NR580 6 /* AzureWave AW-NR580 */
++#define AR71XX_MACH_AP83 7 /* Atheros AP83 */
++#define AR71XX_MACH_TEW_632BRP 8 /* TRENDnet TEW-632BRP */
++#define AR71XX_MACH_UBNT_RS 9 /* Ubiquiti RouterStation */
++#define AR71XX_MACH_UBNT_LSX 10 /* Ubiquiti LSX */
++#define AR71XX_MACH_WNR2000 11 /* NETGEAR WNR2000 */
++#define AR71XX_MACH_PB42 12 /* Atheros PB42 */
++#define AR71XX_MACH_MZK_W300NH 13 /* Planex MZK-W300NH */
++#define AR71XX_MACH_MZK_W04NU 14 /* Planex MZK-W04NU */
++#define AR71XX_MACH_UBNT_LSSR71 15 /* Ubiquiti LS-SR71 */
++#define AR71XX_MACH_TL_WR941ND 16 /* TP-LINK TL-WR941ND */
++#define AR71XX_MACH_UBNT_RSPRO 17 /* Ubiquiti RouterStation Pro */
++#define AR71XX_MACH_AP81 18 /* Atheros AP81 */
++
++/*
++ * PLL block
++ */
++#define AR71XX_PLL_REG_CPU_CONFIG 0x00
++#define AR71XX_PLL_REG_SEC_CONFIG 0x04
++#define AR71XX_PLL_REG_ETH0_INT_CLOCK 0x10
++#define AR71XX_PLL_REG_ETH1_INT_CLOCK 0x14
++
++#define AR71XX_PLL_DIV_SHIFT 3
++#define AR71XX_PLL_DIV_MASK 0x1f
++#define AR71XX_CPU_DIV_SHIFT 16
++#define AR71XX_CPU_DIV_MASK 0x3
++#define AR71XX_DDR_DIV_SHIFT 18
++#define AR71XX_DDR_DIV_MASK 0x3
++#define AR71XX_AHB_DIV_SHIFT 20
++#define AR71XX_AHB_DIV_MASK 0x7
++
++#define AR71XX_ETH0_PLL_SHIFT 17
++#define AR71XX_ETH1_PLL_SHIFT 19
++
++#define AR91XX_PLL_REG_CPU_CONFIG 0x00
++#define AR91XX_PLL_REG_ETH_CONFIG 0x04
++#define AR91XX_PLL_REG_ETH0_INT_CLOCK 0x14
++#define AR91XX_PLL_REG_ETH1_INT_CLOCK 0x18
++
++#define AR91XX_PLL_DIV_SHIFT 0
++#define AR91XX_PLL_DIV_MASK 0x3ff
++#define AR91XX_DDR_DIV_SHIFT 22
++#define AR91XX_DDR_DIV_MASK 0x3
++#define AR91XX_AHB_DIV_SHIFT 19
++#define AR91XX_AHB_DIV_MASK 0x1
++
++#define AR91XX_ETH0_PLL_SHIFT 20
++#define AR91XX_ETH1_PLL_SHIFT 22
++
++extern void __iomem *ar71xx_pll_base;
++
++static inline void ar71xx_pll_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_pll_base + reg);
++}
++
++static inline u32 ar71xx_pll_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_pll_base + reg);
++}
++
++/*
++ * USB_CONFIG block
++ */
++#define USB_CTRL_REG_FLADJ 0x00
++#define USB_CTRL_REG_CONFIG 0x04
++
++extern void __iomem *ar71xx_usb_ctrl_base;
++
++static inline void ar71xx_usb_ctrl_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_usb_ctrl_base + reg);
++}
++
++static inline u32 ar71xx_usb_ctrl_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_usb_ctrl_base + reg);
++}
++
++/*
++ * GPIO block
++ */
++#define GPIO_REG_OE 0x00
++#define GPIO_REG_IN 0x04
++#define GPIO_REG_OUT 0x08
++#define GPIO_REG_SET 0x0c
++#define GPIO_REG_CLEAR 0x10
++#define GPIO_REG_INT_MODE 0x14
++#define GPIO_REG_INT_TYPE 0x18
++#define GPIO_REG_INT_POLARITY 0x1c
++#define GPIO_REG_INT_PENDING 0x20
++#define GPIO_REG_INT_ENABLE 0x24
++#define GPIO_REG_FUNC 0x28
++
++#define GPIO_FUNC_STEREO_EN BIT(17)
++#define GPIO_FUNC_SLIC_EN BIT(16)
++#define GPIO_FUNC_SPI_CS2_EN BIT(13)
++#define GPIO_FUNC_SPI_CS1_EN BIT(12)
++#define GPIO_FUNC_UART_EN BIT(8)
++#define GPIO_FUNC_USB_OC_EN BIT(4)
++#define GPIO_FUNC_USB_CLK_EN BIT(0)
++
++#define AR71XX_GPIO_COUNT 16
++#define AR91XX_GPIO_COUNT 22
++
++extern void __iomem *ar71xx_gpio_base;
++
++static inline void ar71xx_gpio_wr(unsigned reg, u32 value)
++{
++ __raw_writel(value, ar71xx_gpio_base + reg);
++}
++
++static inline u32 ar71xx_gpio_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_gpio_base + reg);
++}
++
++extern void ar71xx_gpio_init(void) __init;
++extern void ar71xx_gpio_function_enable(u32 mask);
++extern void ar71xx_gpio_function_disable(u32 mask);
++
++/*
++ * DDR_CTRL block
++ */
++#define AR71XX_DDR_REG_PCI_WIN0 0x7c
++#define AR71XX_DDR_REG_PCI_WIN1 0x80
++#define AR71XX_DDR_REG_PCI_WIN2 0x84
++#define AR71XX_DDR_REG_PCI_WIN3 0x88
++#define AR71XX_DDR_REG_PCI_WIN4 0x8c
++#define AR71XX_DDR_REG_PCI_WIN5 0x90
++#define AR71XX_DDR_REG_PCI_WIN6 0x94
++#define AR71XX_DDR_REG_PCI_WIN7 0x98
++#define AR71XX_DDR_REG_FLUSH_GE0 0x9c
++#define AR71XX_DDR_REG_FLUSH_GE1 0xa0
++#define AR71XX_DDR_REG_FLUSH_USB 0xa4
++#define AR71XX_DDR_REG_FLUSH_PCI 0xa8
++
++#define AR91XX_DDR_REG_FLUSH_GE0 0x7c
++#define AR91XX_DDR_REG_FLUSH_GE1 0x80
++#define AR91XX_DDR_REG_FLUSH_USB 0x84
++#define AR91XX_DDR_REG_FLUSH_WMAC 0x88
++
++#define PCI_WIN0_OFFS 0x10000000
++#define PCI_WIN1_OFFS 0x11000000
++#define PCI_WIN2_OFFS 0x12000000
++#define PCI_WIN3_OFFS 0x13000000
++#define PCI_WIN4_OFFS 0x14000000
++#define PCI_WIN5_OFFS 0x15000000
++#define PCI_WIN6_OFFS 0x16000000
++#define PCI_WIN7_OFFS 0x07000000
++
++extern void __iomem *ar71xx_ddr_base;
++
++static inline void ar71xx_ddr_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_ddr_base + reg);
++}
++
++static inline u32 ar71xx_ddr_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_ddr_base + reg);
++}
++
++extern void ar71xx_ddr_flush(u32 reg);
++
++/*
++ * PCI block
++ */
++#define AR71XX_PCI_CFG_BASE (AR71XX_PCI_MEM_BASE + PCI_WIN7_OFFS + 0x10000)
++#define AR71XX_PCI_CFG_SIZE 0x100
++
++#define PCI_REG_CRP_AD_CBE 0x00
++#define PCI_REG_CRP_WRDATA 0x04
++#define PCI_REG_CRP_RDDATA 0x08
++#define PCI_REG_CFG_AD 0x0c
++#define PCI_REG_CFG_CBE 0x10
++#define PCI_REG_CFG_WRDATA 0x14
++#define PCI_REG_CFG_RDDATA 0x18
++#define PCI_REG_PCI_ERR 0x1c
++#define PCI_REG_PCI_ERR_ADDR 0x20
++#define PCI_REG_AHB_ERR 0x24
++#define PCI_REG_AHB_ERR_ADDR 0x28
++
++#define PCI_CRP_CMD_WRITE 0x00010000
++#define PCI_CRP_CMD_READ 0x00000000
++#define PCI_CFG_CMD_READ 0x0000000a
++#define PCI_CFG_CMD_WRITE 0x0000000b
++
++#define PCI_IDSEL_ADL_START 17
++
++/*
++ * RESET block
++ */
++#define AR71XX_RESET_REG_TIMER 0x00
++#define AR71XX_RESET_REG_TIMER_RELOAD 0x04
++#define AR71XX_RESET_REG_WDOG_CTRL 0x08
++#define AR71XX_RESET_REG_WDOG 0x0c
++#define AR71XX_RESET_REG_MISC_INT_STATUS 0x10
++#define AR71XX_RESET_REG_MISC_INT_ENABLE 0x14
++#define AR71XX_RESET_REG_PCI_INT_STATUS 0x18
++#define AR71XX_RESET_REG_PCI_INT_ENABLE 0x1c
++#define AR71XX_RESET_REG_GLOBAL_INT_STATUS 0x20
++#define AR71XX_RESET_REG_RESET_MODULE 0x24
++#define AR71XX_RESET_REG_PERFC_CTRL 0x2c
++#define AR71XX_RESET_REG_PERFC0 0x30
++#define AR71XX_RESET_REG_PERFC1 0x34
++#define AR71XX_RESET_REG_REV_ID 0x90
++
++#define AR91XX_RESET_REG_GLOBAL_INT_STATUS 0x18
++#define AR91XX_RESET_REG_RESET_MODULE 0x1c
++#define AR91XX_RESET_REG_PERF_CTRL 0x20
++#define AR91XX_RESET_REG_PERFC0 0x24
++#define AR91XX_RESET_REG_PERFC1 0x28
++
++#define WDOG_CTRL_LAST_RESET BIT(31)
++#define WDOG_CTRL_ACTION_MASK 3
++#define WDOG_CTRL_ACTION_NONE 0 /* no action */
++#define WDOG_CTRL_ACTION_GPI 1 /* general purpose interrupt */
++#define WDOG_CTRL_ACTION_NMI 2 /* NMI */
++#define WDOG_CTRL_ACTION_FCR 3 /* full chip reset */
++
++#define MISC_INT_DMA BIT(7)
++#define MISC_INT_OHCI BIT(6)
++#define MISC_INT_PERFC BIT(5)
++#define MISC_INT_WDOG BIT(4)
++#define MISC_INT_UART BIT(3)
++#define MISC_INT_GPIO BIT(2)
++#define MISC_INT_ERROR BIT(1)
++#define MISC_INT_TIMER BIT(0)
++
++#define PCI_INT_CORE BIT(4)
++#define PCI_INT_DEV2 BIT(2)
++#define PCI_INT_DEV1 BIT(1)
++#define PCI_INT_DEV0 BIT(0)
++
++#define RESET_MODULE_EXTERNAL BIT(28)
++#define RESET_MODULE_FULL_CHIP BIT(24)
++#define RESET_MODULE_AMBA2WMAC BIT(22)
++#define RESET_MODULE_CPU_NMI BIT(21)
++#define RESET_MODULE_CPU_COLD BIT(20)
++#define RESET_MODULE_DMA BIT(19)
++#define RESET_MODULE_SLIC BIT(18)
++#define RESET_MODULE_STEREO BIT(17)
++#define RESET_MODULE_DDR BIT(16)
++#define RESET_MODULE_GE1_MAC BIT(13)
++#define RESET_MODULE_GE1_PHY BIT(12)
++#define RESET_MODULE_USBSUS_OVERRIDE BIT(10)
++#define RESET_MODULE_GE0_MAC BIT(9)
++#define RESET_MODULE_GE0_PHY BIT(8)
++#define RESET_MODULE_USB_OHCI_DLL BIT(6)
++#define RESET_MODULE_USB_HOST BIT(5)
++#define RESET_MODULE_USB_PHY BIT(4)
++#define RESET_MODULE_PCI_BUS BIT(1)
++#define RESET_MODULE_PCI_CORE BIT(0)
++
++#define REV_ID_MASK 0xff
++#define REV_ID_CHIP_MASK 0xf3
++#define REV_ID_CHIP_AR7130 0xa0
++#define REV_ID_CHIP_AR7141 0xa1
++#define REV_ID_CHIP_AR7161 0xa2
++#define REV_ID_CHIP_AR9130 0xb0
++#define REV_ID_CHIP_AR9132 0xb1
++
++#define REV_ID_REVISION_MASK 0x3
++#define REV_ID_REVISION_SHIFT 2
++
++extern void __iomem *ar71xx_reset_base;
++
++static inline void ar71xx_reset_wr(unsigned reg, u32 val)
++{
++ __raw_writel(val, ar71xx_reset_base + reg);
++}
++
++static inline u32 ar71xx_reset_rr(unsigned reg)
++{
++ return __raw_readl(ar71xx_reset_base + reg);
++}
++
++extern void ar71xx_device_stop(u32 mask);
++extern void ar71xx_device_start(u32 mask);
++
++/*
++ * SPI block
++ */
++#define SPI_REG_FS 0x00 /* Function Select */
++#define SPI_REG_CTRL 0x04 /* SPI Control */
++#define SPI_REG_IOC 0x08 /* SPI I/O Control */
++#define SPI_REG_RDS 0x0c /* Read Data Shift */
++
++#define SPI_FS_GPIO BIT(0) /* Enable GPIO mode */
++
++#define SPI_CTRL_RD BIT(6) /* Remap Disable */
++#define SPI_CTRL_DIV_MASK 0x3f
++
++#define SPI_IOC_DO BIT(0) /* Data Out pin */
++#define SPI_IOC_CLK BIT(8) /* CLK pin */
++#define SPI_IOC_CS(n) BIT(16 + (n))
++#define SPI_IOC_CS0 SPI_IOC_CS(0)
++#define SPI_IOC_CS1 SPI_IOC_CS(1)
++#define SPI_IOC_CS2 SPI_IOC_CS(2)
++#define SPI_IOC_CS_ALL (SPI_IOC_CS0 | SPI_IOC_CS1 | SPI_IOC_CS2)
++
++/*
++ * MII_CTRL block
++ */
++#define MII_REG_MII0_CTRL 0x00
++#define MII_REG_MII1_CTRL 0x04
++
++#define MII0_CTRL_IF_GMII 0
++#define MII0_CTRL_IF_MII 1
++#define MII0_CTRL_IF_RGMII 2
++#define MII0_CTRL_IF_RMII 3
++
++#define MII1_CTRL_IF_RGMII 0
++#define MII1_CTRL_IF_RMII 1
++
++#endif /* __ASSEMBLER__ */
++
++#endif /* __ASM_MACH_AR71XX_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/cpu-feature-overrides.h 2009-04-13 14:27:34.627073939 +0200
+@@ -0,0 +1,56 @@
++/*
++ * Atheros AR71xx specific CPU feature overrides
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This file was derived from: include/asm-mips/cpu-features.h
++ * Copyright (C) 2003, 2004 Ralf Baechle
++ * Copyright (C) 2004 Maciej W. Rozycki
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++#ifndef __ASM_MACH_AR71XX_CPU_FEATURE_OVERRIDES_H
++#define __ASM_MACH_AR71XX_CPU_FEATURE_OVERRIDES_H
++
++#define cpu_has_tlb 1
++#define cpu_has_4kex 1
++#define cpu_has_3k_cache 0
++#define cpu_has_4k_cache 1
++#define cpu_has_tx39_cache 0
++#define cpu_has_sb1_cache 0
++#define cpu_has_fpu 0
++#define cpu_has_32fpr 0
++#define cpu_has_counter 1
++#define cpu_has_watch 1
++#define cpu_has_divec 1
++
++#define cpu_has_prefetch 1
++#define cpu_has_ejtag 1
++#define cpu_has_llsc 1
++
++#define cpu_has_mips16 1
++#define cpu_has_mdmx 0
++#define cpu_has_mips3d 0
++#define cpu_has_smartmips 0
++
++#define cpu_has_mips32r1 1
++#define cpu_has_mips32r2 1
++#define cpu_has_mips64r1 0
++#define cpu_has_mips64r2 0
++
++#define cpu_has_dsp 0
++#define cpu_has_mipsmt 0
++
++#define cpu_has_64bits 0
++#define cpu_has_64bit_zero_reg 0
++#define cpu_has_64bit_gp_regs 0
++#define cpu_has_64bit_addresses 0
++
++#define cpu_dcache_line_size() 32
++#define cpu_icache_line_size() 32
++
++#endif /* __ASM_MACH_AR71XX_CPU_FEATURE_OVERRIDES_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/gpio.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/gpio.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/gpio.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/gpio.h 2009-04-13 14:27:34.627073939 +0200
+@@ -0,0 +1,53 @@
++/*
++ * Atheros AR71xx GPIO API definitions
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#ifndef __ASM_MACH_AR71XX_GPIO_H
++#define __ASM_MACH_AR71XX_GPIO_H
++
++#define ARCH_NR_GPIOS 64
++#include <asm-generic/gpio.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++extern unsigned long ar71xx_gpio_count;
++extern void __ar71xx_gpio_set_value(unsigned gpio, int value);
++extern int __ar71xx_gpio_get_value(unsigned gpio);
++
++static inline int gpio_to_irq(unsigned gpio)
++{
++ return AR71XX_GPIO_IRQ(gpio);
++}
++
++static inline int irq_to_gpio(unsigned irq)
++{
++ return irq - AR71XX_GPIO_IRQ_BASE;
++}
++
++static inline int gpio_get_value(unsigned gpio)
++{
++ if (gpio < ar71xx_gpio_count)
++ return __ar71xx_gpio_get_value(gpio);
++
++ return __gpio_get_value(gpio);
++}
++
++static inline void gpio_set_value(unsigned gpio, int value)
++{
++ if (gpio < ar71xx_gpio_count)
++ __ar71xx_gpio_set_value(gpio, value);
++ else
++ __gpio_set_value(gpio, value);
++}
++
++#define gpio_cansleep __gpio_cansleep
++
++#endif /* __ASM_MACH_AR71XX_GPIO_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/irq.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/irq.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/irq.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/irq.h 2009-04-13 14:27:34.643075140 +0200
+@@ -0,0 +1,17 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++#ifndef __ASM_MACH_AR71XX_IRQ_H
++#define __ASM_MACH_AR71XX_IRQ_H
++
++#define MIPS_CPU_IRQ_BASE 0
++#define NR_IRQS 36
++
++#include_next <irq.h>
++
++#endif /* __ASM_MACH_AR71XX_IRQ_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/kernel-entry-init.h 2009-04-13 14:27:34.643075140 +0200
+@@ -0,0 +1,32 @@
++/*
++ * Atheros AR71xx specific kernel entry setup
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++#ifndef __ASM_MACH_AR71XX_KERNEL_ENTRY_H
++#define __ASM_MACH_AR71XX_KERNEL_ENTRY_H
++
++ /*
++ * Some bootloaders set the 'Kseg0 coherency algorithm' to
++ * 'Cacheable, noncoherent, write-through, no write allocate'
++ * and this cause performance issues. Let's go and change it to
++ * 'Cacheable, noncoherent, write-back, write allocate'
++ */
++ .macro kernel_entry_setup
++ mfc0 t0, CP0_CONFIG
++ li t1, ~CONF_CM_CMASK
++ and t0, t1
++ ori t0, CONF_CM_CACHABLE_NONCOHERENT
++ mtc0 t0, CP0_CONFIG
++ nop
++ .endm
++
++ .macro smp_slave_setup
++ .endm
++
++#endif /* __ASM_MACH_AR71XX_KERNEL_ENTRY_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/mangle-port.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/mangle-port.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/mangle-port.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/mangle-port.h 2009-04-13 14:27:34.643075140 +0200
+@@ -0,0 +1,45 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This file was derived from: inlude/asm-mips/mach-generic/mangle-port.h
++ * Copyright (C) 2003, 2004 Ralf Baechle
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_MANGLE_PORT_H
++#define __ASM_MACH_AR71XX_MANGLE_PORT_H
++
++#define __swizzle_addr_b(port) ((port) ^ 3)
++#define __swizzle_addr_w(port) ((port) ^ 2)
++#define __swizzle_addr_l(port) (port)
++#define __swizzle_addr_q(port) (port)
++
++#if defined(CONFIG_SWAP_IO_SPACE)
++
++# define ioswabb(a, x) (x)
++# define __mem_ioswabb(a, x) (x)
++# define ioswabw(a, x) le16_to_cpu(x)
++# define __mem_ioswabw(a, x) (x)
++# define ioswabl(a, x) le32_to_cpu(x)
++# define __mem_ioswabl(a, x) (x)
++# define ioswabq(a, x) le64_to_cpu(x)
++# define __mem_ioswabq(a, x) (x)
++
++#else
++
++# define ioswabb(a, x) (x)
++# define __mem_ioswabb(a, x) (x)
++# define ioswabw(a, x) (x)
++# define __mem_ioswabw(a, x) cpu_to_le16(x)
++# define ioswabl(a, x) (x)
++# define __mem_ioswabl(a, x) cpu_to_le32(x)
++# define ioswabq(a, x) (x)
++# define __mem_ioswabq(a, x) cpu_to_le64(x)
++
++#endif
++
++#endif /* __ASM_MACH_AR71XX_MANGLE_PORT_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/pci.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/pci.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/pci.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/pci.h 2009-04-13 14:27:34.647074532 +0200
+@@ -0,0 +1,28 @@
++/*
++ * Atheros AR71xx SoC specific PCI definitions
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_PCI_H
++#define __ASM_MACH_AR71XX_PCI_H
++
++struct ar71xx_pci_irq {
++ int irq;
++ u8 slot;
++ u8 pin;
++};
++
++extern int (*ar71xx_pci_be_handler)(int is_fixup);
++extern int (*ar71xx_pci_bios_init)(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map) __initdata;
++
++extern int ar71xx_pci_init(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map) __init;
++
++#endif /* __ASM_MACH_AR71XX_PCI_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/platform.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/platform.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/platform.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/platform.h 2009-04-13 14:27:34.647074532 +0200
+@@ -0,0 +1,54 @@
++/*
++ * Atheros AR71xx SoC specific platform data definitions
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __ASM_MACH_AR71XX_PLATFORM_H
++#define __ASM_MACH_AR71XX_PLATFORM_H
++
++#include <linux/if_ether.h>
++#include <linux/skbuff.h>
++#include <linux/phy.h>
++#include <linux/spi/spi.h>
++
++struct ag71xx_platform_data {
++ phy_interface_t phy_if_mode;
++ u32 phy_mask;
++ int speed;
++ int duplex;
++ u32 reset_bit;
++ u32 mii_if;
++ u8 mac_addr[ETH_ALEN];
++
++ u8 has_gbit:1;
++ u8 is_ar91xx:1;
++ u8 has_ar8216:1;
++
++ void (* ddr_flush)(void);
++ void (* set_pll)(u32 pll);
++};
++
++struct ag71xx_mdio_platform_data {
++ u32 phy_mask;
++};
++
++struct ar71xx_ehci_platform_data {
++ u8 is_ar91xx;
++};
++
++struct ar71xx_spi_platform_data {
++ unsigned bus_num;
++ unsigned num_chipselect;
++ u32 (*get_ioc_base)(u8 chip_select, int cs_high, int is_on);
++};
++
++#define AR71XX_SPI_CS_INACTIVE 0
++#define AR71XX_SPI_CS_ACTIVE 1
++
++#endif /* __ASM_MACH_AR71XX_PLATFORM_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/war.h linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/war.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/mach-ar71xx/war.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/include/asm/mach-ar71xx/war.h 2009-04-13 14:27:34.647074532 +0200
+@@ -0,0 +1,25 @@
++/*
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
++ */
++#ifndef __ASM_MACH_AR71XX_WAR_H
++#define __ASM_MACH_AR71XX_WAR_H
++
++#define R4600_V1_INDEX_ICACHEOP_WAR 0
++#define R4600_V1_HIT_CACHEOP_WAR 0
++#define R4600_V2_HIT_CACHEOP_WAR 0
++#define R5432_CP0_INTERRUPT_WAR 0
++#define BCM1250_M3_WAR 0
++#define SIBYTE_1956_WAR 0
++#define MIPS4K_ICACHE_REFILL_WAR 0
++#define MIPS_CACHE_SYNC_WAR 0
++#define TX49XX_ICACHE_INDEX_INV_WAR 0
++#define RM9000_CDEX_SMP_WAR 0
++#define ICACHE_REFILLS_WORKAROUND_WAR 0
++#define R10000_LLSC_WAR 0
++#define MIPS34K_MISSED_ITLB_WAR 0
++
++#endif /* __ASM_MACH_AR71XX_WAR_H */
+diff -Nur linux-2.6.29.1.orig/arch/mips/include/asm/time.h linux-2.6.29.1/arch/mips/include/asm/time.h
+--- linux-2.6.29.1.orig/arch/mips/include/asm/time.h 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/include/asm/time.h 2009-04-13 14:30:23.269613602 +0200
+@@ -52,6 +52,7 @@
+ */
+ #ifdef CONFIG_CEVT_R4K_LIB
+ extern unsigned int __weak get_c0_compare_int(void);
++extern unsigned int __weak get_c0_compare_irq(void);
+ extern int r4k_clockevent_init(void);
+ #endif
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/Makefile linux-2.6.29.1/arch/mips/kernel/Makefile
+--- linux-2.6.29.1.orig/arch/mips/kernel/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/Makefile 2009-04-13 14:27:34.655074992 +0200
+@@ -85,6 +85,7 @@
+
+ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
+ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
++obj-$(CONFIG_MIPS_MACHINE) += mips_machine.o
+
+ CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
+
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/cevt-r4k.c linux-2.6.29.1/arch/mips/kernel/cevt-r4k.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/cevt-r4k.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/cevt-r4k.c 2009-04-13 14:27:34.655074992 +0200
+@@ -15,6 +15,22 @@
+ #include <asm/cevt-r4k.h>
+
+ /*
++ * Compare interrupt can be routed and latched outside the core,
++ * so a single execution hazard barrier may not be enough to give
++ * it time to clear as seen in the Cause register. 4 time the
++ * pipeline depth seems reasonably conservative, and empirically
++ * works better in configurations with high CPU/bus clock ratios.
++ */
++
++#define compare_change_hazard() \
++ do { \
++ irq_disable_hazard(); \
++ irq_disable_hazard(); \
++ irq_disable_hazard(); \
++ irq_disable_hazard(); \
++ } while (0)
++
++/*
+ * The SMTC Kernel for the 34K, 1004K, et. al. replaces several
+ * of these routines with SMTC-specific variants.
+ */
+@@ -30,6 +46,7 @@
+ cnt = read_c0_count();
+ cnt += delta;
+ write_c0_compare(cnt);
++ compare_change_hazard();
+ res = ((int)(read_c0_count() - cnt) > 0) ? -ETIME : 0;
+ return res;
+ }
+@@ -99,22 +116,6 @@
+ return (read_c0_cause() >> cp0_compare_irq) & 0x100;
+ }
+
+-/*
+- * Compare interrupt can be routed and latched outside the core,
+- * so a single execution hazard barrier may not be enough to give
+- * it time to clear as seen in the Cause register. 4 time the
+- * pipeline depth seems reasonably conservative, and empirically
+- * works better in configurations with high CPU/bus clock ratios.
+- */
+-
+-#define compare_change_hazard() \
+- do { \
+- irq_disable_hazard(); \
+- irq_disable_hazard(); \
+- irq_disable_hazard(); \
+- irq_disable_hazard(); \
+- } while (0)
+-
+ int c0_compare_int_usable(void)
+ {
+ unsigned int delta;
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/mips_machine.c linux-2.6.29.1/arch/mips/kernel/mips_machine.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/mips_machine.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/kernel/mips_machine.c 2009-04-13 14:27:34.683076044 +0200
+@@ -0,0 +1,58 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#include <asm/mips_machine.h>
++#include <asm/bootinfo.h>
++
++static struct list_head mips_machines __initdata =
++ LIST_HEAD_INIT(mips_machines);
++
++unsigned char mips_machine_name[MIPS_MACHINE_NAME_LEN] = "Unknown";
++
++static struct mips_machine * __init mips_machine_find(unsigned long machtype)
++{
++ struct list_head *this;
++
++ list_for_each(this, &mips_machines) {
++ struct mips_machine *mach;
++
++ mach = list_entry(this, struct mips_machine, list);
++ if (mach->mach_type == machtype)
++ return mach;
++ }
++
++ return NULL;
++}
++
++void __init mips_machine_register(struct mips_machine *mach)
++{
++ list_add_tail(&mach->list, &mips_machines);
++}
++
++void __init mips_machine_setup(unsigned long machtype)
++{
++ struct mips_machine *mach;
++
++ mach = mips_machine_find(machtype);
++ if (!mach) {
++ printk(KERN_ALERT "MIPS: no machine registered for "
++ "machtype %lu\n", machtype);
++ return;
++ }
++
++ if (mach->mach_name[0])
++ strncpy(mips_machine_name, mach->mach_name,
++ MIPS_MACHINE_NAME_LEN);
++
++ printk(KERN_INFO "MIPS: machine is %s\n", mips_machine_name);
++
++ if (mach->mach_setup)
++ mach->mach_setup();
++}
++
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/proc.c linux-2.6.29.1/arch/mips/kernel/proc.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/proc.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/proc.c 2009-04-13 14:27:34.683076044 +0200
+@@ -14,6 +14,7 @@
+ #include <asm/cpu-features.h>
+ #include <asm/mipsregs.h>
+ #include <asm/processor.h>
++#include <asm/mips_machine.h>
+
+ unsigned int vced_count, vcei_count;
+
+@@ -33,8 +34,12 @@
+ /*
+ * For the first processor also print the system type
+ */
+- if (n == 0)
++ if (n == 0) {
+ seq_printf(m, "system type\t\t: %s\n", get_system_type());
++#ifdef CONFIG_MIPS_MACHINE
++ seq_printf(m, "machine\t\t\t: %s\n", mips_machine_name);
++#endif
++ }
+
+ seq_printf(m, "processor\t\t: %ld\n", n);
+ sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
+diff -Nur linux-2.6.29.1.orig/arch/mips/kernel/traps.c linux-2.6.29.1/arch/mips/kernel/traps.c
+--- linux-2.6.29.1.orig/arch/mips/kernel/traps.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/kernel/traps.c 2009-04-13 14:29:45.479250639 +0200
+@@ -47,6 +47,7 @@
+ #include <asm/mmu_context.h>
+ #include <asm/types.h>
+ #include <asm/stacktrace.h>
++#include <asm/time.h>
+ #include <asm/irq.h>
+
+ extern void check_wait(void);
+@@ -1541,6 +1542,8 @@
+ */
+ if (cpu_has_mips_r2) {
+ cp0_compare_irq = (read_c0_intctl() >> 29) & 7;
++ if (get_c0_compare_irq)
++ cp0_compare_irq = get_c0_compare_irq();
+ cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7;
+ if (cp0_perfcount_irq == cp0_compare_irq)
+ cp0_perfcount_irq = -1;
+diff -Nur linux-2.6.29.1.orig/arch/mips/pci/Makefile linux-2.6.29.1/arch/mips/pci/Makefile
+--- linux-2.6.29.1.orig/arch/mips/pci/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/arch/mips/pci/Makefile 2009-04-13 14:27:34.691076784 +0200
+@@ -16,6 +16,7 @@
+ obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
+ obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o
+ obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o
++obj-$(CONFIG_ATHEROS_AR71XX) += pci-ar71xx.o
+
+ #
+ # These are still pretty much in the old state, watch, go blind.
+diff -Nur linux-2.6.29.1.orig/arch/mips/pci/pci-ar71xx.c linux-2.6.29.1/arch/mips/pci/pci-ar71xx.c
+--- linux-2.6.29.1.orig/arch/mips/pci/pci-ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/arch/mips/pci/pci-ar71xx.c 2009-04-13 14:27:34.695077573 +0200
+@@ -0,0 +1,347 @@
++/*
++ * Atheros AR71xx PCI host controller driver
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/resource.h>
++#include <linux/types.h>
++#include <linux/delay.h>
++#include <linux/bitops.h>
++#include <linux/pci.h>
++#include <linux/pci_regs.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/pci.h>
++
++#undef DEBUG
++#ifdef DEBUG
++#define DBG(fmt, args...) printk(KERN_DEBUG fmt, ## args)
++#else
++#define DBG(fmt, args...)
++#endif
++
++#define AR71XX_PCI_DELAY 100 /* msecs */
++
++#if 0
++#define PCI_IDSEL_BASE PCI_IDSEL_ADL_START
++#else
++#define PCI_IDSEL_BASE 0
++#endif
++
++static unsigned ar71xx_pci_nr_irqs;
++static struct ar71xx_pci_irq *ar71xx_pci_irq_map __initdata;
++static void __iomem *ar71xx_pcicfg_base;
++
++static DEFINE_SPINLOCK(ar71xx_pci_lock);
++
++static inline void ar71xx_pci_delay(void)
++{
++ mdelay(AR71XX_PCI_DELAY);
++}
++
++static inline u32 ar71xx_pcicfg_rr(unsigned int reg)
++{
++ return __raw_readl(ar71xx_pcicfg_base + reg);
++}
++
++static inline void ar71xx_pcicfg_wr(unsigned int reg, u32 val)
++{
++ __raw_writel(val, ar71xx_pcicfg_base + reg);
++}
++
++/* Byte lane enable bits */
++static u8 ble_table[4][4] = {
++ {0x0, 0xf, 0xf, 0xf},
++ {0xe, 0xd, 0xb, 0x7},
++ {0xc, 0xf, 0x3, 0xf},
++ {0xf, 0xf, 0xf, 0xf},
++};
++
++static inline u32 ar71xx_pci_get_ble(int where, int size, int local)
++{
++ u32 t;
++
++ t = ble_table[size & 3][where & 3];
++ BUG_ON(t == 0xf);
++ t <<= (local) ? 20 : 4;
++ return t;
++}
++
++static inline u32 ar71xx_pci_bus_addr(struct pci_bus *bus, unsigned int devfn,
++ int where)
++{
++ u32 ret;
++
++ if (!bus->number) {
++ /* type 0 */
++ ret = (1 << (PCI_IDSEL_BASE + PCI_SLOT(devfn)))
++ | (PCI_FUNC(devfn) << 8) | (where & ~3);
++ } else {
++ /* type 1 */
++ ret = (bus->number << 16) | (PCI_SLOT(devfn) << 11)
++ | (PCI_FUNC(devfn) << 8) | (where & ~3) | 1;
++ }
++
++ return ret;
++}
++
++static int __ar71xx_pci_be_handler(int is_fixup)
++{
++ u32 pci_err;
++ u32 ahb_err;
++
++ pci_err = ar71xx_pcicfg_rr(PCI_REG_PCI_ERR) & 3;
++ if (pci_err) {
++ if (!is_fixup)
++ printk(KERN_ALERT "PCI error %d at PCI addr 0x%x\n",
++ pci_err,
++ ar71xx_pcicfg_rr(PCI_REG_PCI_ERR_ADDR));
++
++ ar71xx_pcicfg_wr(PCI_REG_PCI_ERR, pci_err);
++ }
++
++ ahb_err = ar71xx_pcicfg_rr(PCI_REG_AHB_ERR) & 1;
++ if (ahb_err) {
++ if (!is_fixup)
++ printk(KERN_ALERT "AHB error at AHB address 0x%x\n",
++ ar71xx_pcicfg_rr(PCI_REG_AHB_ERR_ADDR));
++
++ ar71xx_pcicfg_wr(PCI_REG_AHB_ERR, ahb_err);
++ }
++
++ return ((ahb_err | pci_err) ? 1 : 0);
++}
++
++static inline int ar71xx_pci_set_cfgaddr(struct pci_bus *bus,
++ unsigned int devfn, int where, int size, u32 cmd)
++{
++ u32 addr;
++
++ addr = ar71xx_pci_bus_addr(bus, devfn, where);
++
++ DBG("PCI: set cfgaddr: %02x:%02x.%01x/%02x:%01d, addr=%08x\n",
++ bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn),
++ where, size, addr);
++
++ ar71xx_pcicfg_wr(PCI_REG_CFG_AD, addr);
++ ar71xx_pcicfg_wr(PCI_REG_CFG_CBE,
++ cmd | ar71xx_pci_get_ble(where, size, 0));
++
++ return __ar71xx_pci_be_handler(1);
++}
++
++static int ar71xx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
++ int where, int size, u32 *value)
++{
++ static u32 mask[8] = {0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0};
++ unsigned long flags;
++ u32 data;
++ int ret;
++
++ ret = PCIBIOS_SUCCESSFUL;
++
++ DBG("PCI: read config: %02x:%02x.%01x/%02x:%01d\n", bus->number,
++ PCI_SLOT(devfn), PCI_FUNC(devfn), where, size);
++
++ spin_lock_irqsave(&ar71xx_pci_lock, flags);
++
++ if (bus->number == 0 && devfn == 0) {
++ u32 t;
++
++ t = PCI_CRP_CMD_READ | (where & ~3);
++
++ ar71xx_pcicfg_wr(PCI_REG_CRP_AD_CBE, t);
++ data = ar71xx_pcicfg_rr(PCI_REG_CRP_RDDATA);
++
++ DBG("PCI: rd local cfg, ad_cbe:%08x, data:%08x\n", t, data);
++
++ } else {
++ int err;
++
++ err = ar71xx_pci_set_cfgaddr(bus, devfn, where, size,
++ PCI_CFG_CMD_READ);
++
++ if (err == 0) {
++ data = ar71xx_pcicfg_rr(PCI_REG_CFG_RDDATA);
++ } else {
++ ret = PCIBIOS_DEVICE_NOT_FOUND;
++ data = ~0;
++ }
++ }
++
++ spin_unlock_irqrestore(&ar71xx_pci_lock, flags);
++
++ DBG("PCI: read config: data=%08x raw=%08x\n",
++ (data >> (8 * (where & 3))) & mask[size & 7], data);
++
++ *value = (data >> (8 * (where & 3))) & mask[size & 7];
++
++ return ret;
++}
++
++static int ar71xx_pci_write_config(struct pci_bus *bus, unsigned int devfn,
++ int where, int size, u32 value)
++{
++ unsigned long flags;
++ int ret;
++
++ DBG("PCI: write config: %02x:%02x.%01x/%02x:%01d value=%08x\n",
++ bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn),
++ where, size, value);
++
++ value = value << (8 * (where & 3));
++ ret = PCIBIOS_SUCCESSFUL;
++
++ spin_lock_irqsave(&ar71xx_pci_lock, flags);
++ if (bus->number == 0 && devfn == 0) {
++ u32 t;
++
++ t = PCI_CRP_CMD_WRITE | (where & ~3);
++ t |= ar71xx_pci_get_ble(where, size, 1);
++
++ DBG("PCI: wr local cfg, ad_cbe:%08x, value:%08x\n", t, value);
++
++ ar71xx_pcicfg_wr(PCI_REG_CRP_AD_CBE, t);
++ ar71xx_pcicfg_wr(PCI_REG_CRP_WRDATA, value);
++ } else {
++ int err;
++
++ err = ar71xx_pci_set_cfgaddr(bus, devfn, where, size,
++ PCI_CFG_CMD_WRITE);
++
++ if (err == 0)
++ ar71xx_pcicfg_wr(PCI_REG_CFG_WRDATA, value);
++ else
++ ret = PCIBIOS_DEVICE_NOT_FOUND;
++ }
++ spin_unlock_irqrestore(&ar71xx_pci_lock, flags);
++
++ return ret;
++}
++
++static void ar71xx_pci_fixup(struct pci_dev *dev)
++{
++ u32 t;
++
++ if (dev->bus->number != 0 || dev->devfn != 0)
++ return;
++
++ DBG("PCI: fixup host controller %s (%04x:%04x)\n", pci_name(dev),
++ dev->vendor, dev->device);
++
++ /* setup COMMAND register */
++ t = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE
++ | PCI_COMMAND_PARITY | PCI_COMMAND_SERR | PCI_COMMAND_FAST_BACK;
++
++ pci_write_config_word(dev, PCI_COMMAND, t);
++}
++
++DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, ar71xx_pci_fixup);
++
++int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin)
++{
++ int irq = -1;
++ int i;
++
++ slot -= PCI_IDSEL_ADL_START - PCI_IDSEL_BASE;
++
++ for (i = 0; i < ar71xx_pci_nr_irqs; i++) {
++ struct ar71xx_pci_irq *entry;
++
++ entry = &ar71xx_pci_irq_map[i];
++ if (entry->slot == slot && entry->pin == pin) {
++ irq = entry->irq;
++ break;
++ }
++ }
++
++ if (irq < 0) {
++ printk(KERN_ALERT "PCI: no irq found for pin%u@%s\n",
++ pin, pci_name((struct pci_dev *)dev));
++ } else {
++ printk(KERN_INFO "PCI: mapping irq %d to pin%u@%s\n",
++ irq, pin, pci_name((struct pci_dev *)dev));
++ }
++
++ return irq;
++}
++
++int pcibios_plat_dev_init(struct pci_dev *dev)
++{
++ return 0;
++}
++
++static struct pci_ops ar71xx_pci_ops = {
++ .read = ar71xx_pci_read_config,
++ .write = ar71xx_pci_write_config,
++};
++
++static struct resource ar71xx_pci_io_resource = {
++ .name = "PCI IO space",
++ .start = 0,
++ .end = 0,
++ .flags = IORESOURCE_IO,
++};
++
++static struct resource ar71xx_pci_mem_resource = {
++ .name = "PCI memory space",
++ .start = AR71XX_PCI_MEM_BASE,
++ .end = AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1,
++ .flags = IORESOURCE_MEM
++};
++
++static struct pci_controller ar71xx_pci_controller = {
++ .pci_ops = &ar71xx_pci_ops,
++ .mem_resource = &ar71xx_pci_mem_resource,
++ .io_resource = &ar71xx_pci_io_resource,
++};
++
++static int __init __ar71xx_pci_bios_init(unsigned nr_irqs,
++ struct ar71xx_pci_irq *map)
++{
++ ar71xx_device_stop(RESET_MODULE_PCI_BUS | RESET_MODULE_PCI_CORE);
++ ar71xx_pci_delay();
++
++ ar71xx_device_start(RESET_MODULE_PCI_BUS | RESET_MODULE_PCI_CORE);
++ ar71xx_pci_delay();
++
++ ar71xx_pcicfg_base = ioremap_nocache(AR71XX_PCI_CFG_BASE,
++ AR71XX_PCI_CFG_SIZE);
++
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN0, PCI_WIN0_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN1, PCI_WIN1_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN2, PCI_WIN2_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN3, PCI_WIN3_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN4, PCI_WIN4_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN5, PCI_WIN5_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN6, PCI_WIN6_OFFS);
++ ar71xx_ddr_wr(AR71XX_DDR_REG_PCI_WIN7, PCI_WIN7_OFFS);
++
++ ar71xx_pci_delay();
++
++ /* clear bus errors */
++ (void)__ar71xx_pci_be_handler(1);
++
++ ar71xx_pci_nr_irqs = nr_irqs;
++ ar71xx_pci_irq_map = map;
++ ar71xx_pci_be_handler = __ar71xx_pci_be_handler;
++
++ register_pci_controller(&ar71xx_pci_controller);
++
++ return 0;
++}
++
++static int __init __ar71xx_pci_init(void)
++{
++ ar71xx_pci_bios_init = __ar71xx_pci_bios_init;
++ return 0;
++}
++pure_initcall(__ar71xx_pci_init);
+diff -Nur linux-2.6.29.1.orig/drivers/input/misc/Kconfig linux-2.6.29.1/drivers/input/misc/Kconfig
+--- linux-2.6.29.1.orig/drivers/input/misc/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/input/misc/Kconfig 2009-04-13 14:27:34.723078345 +0200
+@@ -227,4 +227,20 @@
+ Say Y to include support for delivering PMU events via input
+ layer on NXP PCF50633.
+
++config INPUT_GPIO_BUTTONS
++ tristate "Polled GPIO buttons interface"
++ depends on GENERIC_GPIO
++ select INPUT_POLLDEV
++ help
++ This driver implements support for buttons connected
++ to GPIO pins of various CPUs (and some other chips).
++
++ Say Y here if your device has buttons connected
++ directly to such GPIO pins. Your board-specific
++ setup logic must also provide a platform device,
++ with configuration data saying which GPIOs are used.
++
++ To compile this driver as a module, choose M here: the
++ module will be called gpio-buttons.
++
+ endif
+diff -Nur linux-2.6.29.1.orig/drivers/input/misc/Makefile linux-2.6.29.1/drivers/input/misc/Makefile
+--- linux-2.6.29.1.orig/drivers/input/misc/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/input/misc/Makefile 2009-04-13 14:29:03.564632184 +0200
+@@ -22,3 +22,4 @@
+ obj-$(CONFIG_INPUT_APANEL) += apanel.o
+ obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
+ obj-$(CONFIG_INPUT_PCF50633_PMU) += pcf50633-input.o
++obj-$(CONFIG_INPUT_GPIO_BUTTONS) += gpio_buttons.o
+diff -Nur linux-2.6.29.1.orig/drivers/input/misc/gpio_buttons.c linux-2.6.29.1/drivers/input/misc/gpio_buttons.c
+--- linux-2.6.29.1.orig/drivers/input/misc/gpio_buttons.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/input/misc/gpio_buttons.c 2009-04-13 14:27:34.727079413 +0200
+@@ -0,0 +1,209 @@
++/*
++ * Driver for buttons on GPIO lines not capable of generating interrupts
++ *
++ * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
++ *
++ * This file was based on: /drivers/input/misc/cobalt_btns.c
++ * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
++ *
++ * also was based on: /drivers/input/keyboard/gpio_keys.c
++ * Copyright 2005 Phil Blundell
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++
++#include <linux/input.h>
++#include <linux/input-polldev.h>
++#include <linux/ioport.h>
++#include <linux/platform_device.h>
++
++#include <linux/gpio_buttons.h>
++
++#include <asm/gpio.h>
++
++#define DRV_NAME "gpio-buttons"
++#define DRV_VERSION "0.1.1"
++#define PFX DRV_NAME ": "
++
++struct gpio_buttons_dev {
++ struct input_polled_dev *poll_dev;
++ struct gpio_buttons_platform_data *pdata;
++};
++
++static void gpio_buttons_poll(struct input_polled_dev *dev)
++{
++ struct gpio_buttons_dev *bdev = dev->private;
++ struct gpio_buttons_platform_data *pdata = bdev->pdata;
++ struct input_dev *input = dev->input;
++ int i;
++
++ for (i = 0; i < bdev->pdata->nbuttons; i++) {
++ struct gpio_button *button = &pdata->buttons[i];
++ unsigned int type = button->type ?: EV_KEY;
++ int state;
++
++ state = gpio_get_value(button->gpio) ? 1 : 0;
++ state ^= button->active_low;
++
++ if (state) {
++ button->count++;
++ } else {
++ if (button->count >= button->threshold) {
++ input_event(input, type, button->code, 1);
++ input_sync(input);
++ }
++ button->count = 0;
++ }
++
++ if (button->count == button->threshold) {
++ input_event(input, type, button->code, 0);
++ input_sync(input);
++ }
++ }
++}
++
++static int __devinit gpio_buttons_probe(struct platform_device *pdev)
++{
++ struct gpio_buttons_platform_data *pdata = pdev->dev.platform_data;
++ struct gpio_buttons_dev *bdev;
++ struct input_polled_dev *poll_dev;
++ struct input_dev *input;
++ int error, i;
++
++
++ if (!pdata)
++ return -ENXIO;
++
++ bdev = kzalloc(sizeof(*bdev), GFP_KERNEL);
++ if (!bdev) {
++ printk(KERN_ERR DRV_NAME "no memory for device\n");
++ return -ENOMEM;
++ }
++
++ poll_dev = input_allocate_polled_device();
++ if (!poll_dev) {
++ printk(KERN_ERR DRV_NAME "no memory for polled device\n");
++ error = -ENOMEM;
++ goto err_free_bdev;
++ }
++
++ poll_dev->private = bdev;
++ poll_dev->poll = gpio_buttons_poll;
++ poll_dev->poll_interval = pdata->poll_interval;
++
++ input = poll_dev->input;
++
++ input->evbit[0] = BIT(EV_KEY);
++ input->name = pdev->name;
++ input->phys = "gpio-buttons/input0";
++ input->dev.parent = &pdev->dev;
++
++ input->id.bustype = BUS_HOST;
++ input->id.vendor = 0x0001;
++ input->id.product = 0x0001;
++ input->id.version = 0x0100;
++
++ for (i = 0; i < pdata->nbuttons; i++) {
++ struct gpio_button *button = &pdata->buttons[i];
++ unsigned int gpio = button->gpio;
++ unsigned int type = button->type ?: EV_KEY;
++
++ error = gpio_request(gpio, button->desc ?
++ button->desc : DRV_NAME);
++ if (error) {
++ printk(KERN_ERR PFX "unable to claim gpio %u, "
++ "error %d\n", gpio, error);
++ goto err_free_gpio;
++ }
++
++ error = gpio_direction_input(gpio);
++ if (error) {
++ printk(KERN_ERR PFX "unable to set direction on "
++ "gpio %u, error %d\n", gpio, error);
++ goto err_free_gpio;
++ }
++
++ input_set_capability(input, type, button->code);
++ button->count = 0;
++ }
++
++ bdev->poll_dev = poll_dev;
++ bdev->pdata = pdata;
++ platform_set_drvdata(pdev, bdev);
++
++ error = input_register_polled_device(poll_dev);
++ if (error) {
++ printk(KERN_ERR PFX "unable to register polled device, "
++ "error %d\n", error);
++ goto err_free_gpio;
++ }
++
++ return 0;
++
++err_free_gpio:
++ for (i = i - 1; i >= 0; i--)
++ gpio_free(pdata->buttons[i].gpio);
++
++ input_free_polled_device(poll_dev);
++
++err_free_bdev:
++ kfree(bdev);
++
++ platform_set_drvdata(pdev, NULL);
++ return error;
++}
++
++static int __devexit gpio_buttons_remove(struct platform_device *pdev)
++{
++ struct gpio_buttons_dev *bdev = platform_get_drvdata(pdev);
++ struct gpio_buttons_platform_data *pdata = bdev->pdata;
++ int i;
++
++ input_unregister_polled_device(bdev->poll_dev);
++
++ for (i = 0; i < pdata->nbuttons; i++)
++ gpio_free(pdata->buttons[i].gpio);
++
++ input_free_polled_device(bdev->poll_dev);
++
++ kfree(bdev);
++ platform_set_drvdata(pdev, NULL);
++
++ return 0;
++}
++
++static struct platform_driver gpio_buttons_driver = {
++ .probe = gpio_buttons_probe,
++ .remove = __devexit_p(gpio_buttons_remove),
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init gpio_buttons_init(void)
++{
++ printk(KERN_INFO DRV_NAME " driver version " DRV_VERSION "\n");
++ return platform_driver_register(&gpio_buttons_driver);
++}
++
++static void __exit gpio_buttons_exit(void)
++{
++ platform_driver_unregister(&gpio_buttons_driver);
++}
++
++module_init(gpio_buttons_init);
++module_exit(gpio_buttons_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>");
++MODULE_VERSION(DRV_VERSION);
++MODULE_DESCRIPTION("Polled buttons driver for CPU GPIOs");
++
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/nand/Kconfig linux-2.6.29.1/drivers/mtd/nand/Kconfig
+--- linux-2.6.29.1.orig/drivers/mtd/nand/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/mtd/nand/Kconfig 2009-04-13 14:27:34.731079923 +0200
+@@ -427,4 +427,8 @@
+ Several Renesas SuperH CPU has FLCTL. This option enables support
+ for NAND Flash using FLCTL. This driver support SH7723.
+
++config MTD_NAND_RB4XX
++ tristate "NAND flash driver for RouterBoard 4xx series"
++ depends on MTD_NAND && ATHEROS_AR71XX
++
+ endif # MTD_NAND
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/nand/Makefile linux-2.6.29.1/drivers/mtd/nand/Makefile
+--- linux-2.6.29.1.orig/drivers/mtd/nand/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/mtd/nand/Makefile 2009-04-13 14:27:34.731079923 +0200
+@@ -29,6 +29,7 @@
+ obj-$(CONFIG_MTD_NAND_PXA3xx) += pxa3xx_nand.o
+ obj-$(CONFIG_MTD_NAND_TMIO) += tmio_nand.o
+ obj-$(CONFIG_MTD_NAND_PLATFORM) += plat_nand.o
++obj-$(CONFIG_MTD_NAND_RB4XX) += rb4xx_nand.o
+ obj-$(CONFIG_MTD_ALAUDA) += alauda.o
+ obj-$(CONFIG_MTD_NAND_PASEMI) += pasemi_nand.o
+ obj-$(CONFIG_MTD_NAND_ORION) += orion_nand.o
+diff -Nur linux-2.6.29.1.orig/drivers/mtd/nand/rb4xx_nand.c linux-2.6.29.1/drivers/mtd/nand/rb4xx_nand.c
+--- linux-2.6.29.1.orig/drivers/mtd/nand/rb4xx_nand.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/mtd/nand/rb4xx_nand.c 2009-04-13 14:27:34.735080153 +0200
+@@ -0,0 +1,507 @@
++/*
++ * NAND flash driver for the MikroTik RouterBoard 4xx series
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This file was based on the driver for Linux 2.6.22 published by
++ * MikroTik for their RouterBoard 4xx series devices.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/init.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++#include <linux/io.h>
++#include <linux/gpio.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#define DRV_NAME "rb4xx-nand"
++#define DRV_VERSION "0.1.10"
++#define DRV_DESC "NAND flash driver for RouterBoard 4xx series"
++
++#define USE_FAST_READ 1
++#define USE_FAST_WRITE 1
++#undef RB4XX_NAND_DEBUG
++
++#ifdef RB4XX_NAND_DEBUG
++#define DBG(fmt, arg...) printk(KERN_DEBUG DRV_NAME ": " fmt, ## arg)
++#else
++#define DBG(fmt, arg...) do {} while (0)
++#endif
++
++#define RB4XX_NAND_GPIO_RDY 5
++#define RB4XX_FLASH_HZ 33333334
++#define RB4XX_NAND_HZ 33333334
++
++#define SPI_CTRL_FASTEST 0x40
++#define SPI_CTRL_SAFE 0x43 /* 25 MHz for AHB 200 MHz */
++#define SBIT_IOC_BASE SPI_IOC_CS1
++#define SBIT_IOC_DO_SHIFT 0
++#define SBIT_IOC_DO (1u << SBIT_IOC_DO_SHIFT)
++#define SBIT_IOC_DO2_SHIFT 18
++#define SBIT_IOC_DO2 (1u << SBIT_IOC_DO2_SHIFT)
++
++#define CPLD_CMD_WRITE_MULT 0x08 /* send cmd, n x send data, read data */
++#define CPLD_CMD_WRITE_CFG 0x09 /* send cmd, n x send cfg */
++#define CPLD_CMD_READ_MULT 0x0a /* send cmd, send idle, n x read data */
++#define CPLD_CMD_READ_FAST 0x0b /* send cmd, 4 x idle, n x read data */
++
++#define CFG_BIT_nCE 0x80
++#define CFG_BIT_CLE 0x40
++#define CFG_BIT_ALE 0x20
++#define CFG_BIT_FAN 0x10
++#define CFG_BIT_nLED4 0x08
++#define CFG_BIT_nLED3 0x04
++#define CFG_BIT_nLED2 0x02
++#define CFG_BIT_nLED1 0x01
++
++#define CFG_BIT_nLEDS \
++ (CFG_BIT_nLED1 | CFG_BIT_nLED2 | CFG_BIT_nLED3 | CFG_BIT_nLED4)
++
++struct rb4xx_nand_info {
++ struct nand_chip chip;
++ struct mtd_info mtd;
++};
++
++/*
++ * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
++ * will not be able to find the kernel that we load.
++ */
++static struct nand_ecclayout rb4xx_nand_ecclayout = {
++ .eccbytes = 6,
++ .eccpos = { 8, 9, 10, 13, 14, 15 },
++ .oobavail = 9,
++ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } }
++};
++
++static struct mtd_partition rb4xx_nand_partitions[] = {
++ {
++ .name = "booter",
++ .offset = 0,
++ .size = (256 * 1024),
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "kernel",
++ .offset = (256 * 1024),
++ .size = (4 * 1024 * 1024) - (256 * 1024),
++ },
++ {
++ .name = "rootfs",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = MTDPART_SIZ_FULL,
++ },
++};
++
++#if USE_FAST_READ
++#define SPI_NDATA_BASE 0x00800000
++static unsigned spi_ctrl_fread = SPI_CTRL_SAFE;
++static unsigned spi_ctrl_flash = SPI_CTRL_SAFE;
++extern unsigned mips_hpt_frequency;
++#endif
++
++static inline unsigned rb4xx_spi_rreg(unsigned r)
++{
++ return __raw_readl((void * __iomem)(KSEG1ADDR(AR71XX_SPI_BASE) + r));
++}
++
++static inline void rb4xx_spi_wreg(unsigned r, unsigned v)
++{
++ __raw_writel(v, (void * __iomem)(KSEG1ADDR(AR71XX_SPI_BASE) + r));
++}
++
++static inline void do_spi_clk(int bit)
++{
++ unsigned bval = SBIT_IOC_BASE | (bit & 1);
++
++ rb4xx_spi_wreg(SPI_REG_IOC, bval);
++ rb4xx_spi_wreg(SPI_REG_IOC, bval | SPI_IOC_CLK);
++}
++
++static void do_spi_byte(uint8_t byte)
++{
++ do_spi_clk(byte >> 7);
++ do_spi_clk(byte >> 6);
++ do_spi_clk(byte >> 5);
++ do_spi_clk(byte >> 4);
++ do_spi_clk(byte >> 3);
++ do_spi_clk(byte >> 2);
++ do_spi_clk(byte >> 1);
++ do_spi_clk(byte);
++
++ DBG("spi_byte sent 0x%02x got 0x%x\n",
++ byte, rb4xx_spi_rreg(SPI_REG_RDS));
++}
++
++#if USE_FAST_WRITE
++static inline void do_spi_clk_fast(int bit1, int bit2)
++{
++ unsigned bval = (SBIT_IOC_BASE |
++ ((bit1 << SBIT_IOC_DO_SHIFT) & SBIT_IOC_DO) |
++ ((bit2 << SBIT_IOC_DO2_SHIFT) & SBIT_IOC_DO2));
++
++ rb4xx_spi_wreg(SPI_REG_IOC, bval);
++ rb4xx_spi_wreg(SPI_REG_IOC, bval | SPI_IOC_CLK);
++}
++
++static inline void do_spi_byte_fast(uint8_t byte)
++{
++ do_spi_clk_fast(byte >> 7, byte >> 6);
++ do_spi_clk_fast(byte >> 5, byte >> 4);
++ do_spi_clk_fast(byte >> 3, byte >> 2);
++ do_spi_clk_fast(byte >> 1, byte >> 0);
++
++ DBG("spi_byte_fast sent 0x%02x got 0x%x\n",
++ byte, rb4xx_spi_rreg(SPI_REG_RDS));
++}
++#else
++static inline void do_spi_byte_fast(uint8_t byte)
++{
++ do_spi_byte(byte);
++}
++#endif /* USE_FAST_WRITE */
++
++static int do_spi_cmd(unsigned cmd, unsigned sendCnt, const uint8_t *sendData,
++ unsigned recvCnt, uint8_t *recvData,
++ const uint8_t *verifyData, int fastWrite)
++{
++ unsigned i;
++
++ DBG("SPI cmd 0x%x send %u recv %u\n", cmd, sendCnt, recvCnt);
++
++ rb4xx_spi_wreg(SPI_REG_FS, SPI_FS_GPIO);
++ rb4xx_spi_wreg(SPI_REG_CTRL, SPI_CTRL_FASTEST);
++
++ do_spi_byte(cmd);
++#if 0
++ if (cmd == CPLD_CMD_READ_FAST) {
++ do_spi_byte(0x80);
++ do_spi_byte(0);
++ do_spi_byte(0);
++ }
++#endif
++ for (i = 0; i < sendCnt; ++i) {
++ if (fastWrite)
++ do_spi_byte_fast(sendData[i]);
++ else
++ do_spi_byte(sendData[i]);
++ }
++
++ for (i = 0; i < recvCnt; ++i) {
++ if (fastWrite)
++ do_spi_byte_fast(0);
++ else
++ do_spi_byte(0);
++
++ if (recvData) {
++ recvData[i] = rb4xx_spi_rreg(SPI_REG_RDS) & 0xff;
++ } else if (verifyData) {
++ if (verifyData[i] != (rb4xx_spi_rreg(SPI_REG_RDS)
++ & 0xff))
++ break;
++ }
++ }
++
++ rb4xx_spi_wreg(SPI_REG_IOC, SBIT_IOC_BASE | SPI_IOC_CS0);
++ rb4xx_spi_wreg(SPI_REG_CTRL, spi_ctrl_flash);
++ rb4xx_spi_wreg(SPI_REG_FS, 0);
++
++ return i == recvCnt;
++}
++
++static int got_write = 1;
++
++static void rb4xx_nand_write_data(const uint8_t *byte, unsigned cnt)
++{
++ do_spi_cmd(CPLD_CMD_WRITE_MULT, cnt, byte, 1, NULL, NULL, 1);
++ got_write = 1;
++}
++
++static void rb4xx_nand_write_byte(uint8_t byte)
++{
++ rb4xx_nand_write_data(&byte, 1);
++}
++
++#if USE_FAST_READ
++static uint8_t *rb4xx_nand_read_getaddr(unsigned cnt)
++{
++ static unsigned nboffset = 0x100000;
++ unsigned addr;
++
++ if (got_write) {
++ nboffset = (nboffset + 31) & ~31;
++ if (nboffset >= 0x100000) /* 1MB */
++ nboffset = 0;
++
++ got_write = 0;
++ rb4xx_spi_wreg(SPI_REG_FS, SPI_FS_GPIO);
++ rb4xx_spi_wreg(SPI_REG_CTRL, spi_ctrl_fread);
++ rb4xx_spi_wreg(SPI_REG_FS, 0);
++ }
++
++ addr = KSEG1ADDR(AR71XX_SPI_BASE + SPI_NDATA_BASE) + nboffset;
++ DBG("rb4xx_nand_read_getaddr 0x%x cnt 0x%x\n", addr, cnt);
++
++ nboffset += cnt;
++ return (uint8_t *)addr;
++}
++
++static void rb4xx_nand_read_data(uint8_t *buf, unsigned cnt)
++{
++ unsigned size32 = cnt & ~31;
++ unsigned remain = cnt & 31;
++
++ if (size32) {
++ uint8_t *addr = rb4xx_nand_read_getaddr(size32);
++ memcpy(buf, (void *)addr, size32);
++ }
++
++ if (remain) {
++ do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, remain,
++ buf + size32, NULL, 0);
++ }
++}
++
++static int rb4xx_nand_verify_data(const uint8_t *buf, unsigned cnt)
++{
++ unsigned size32 = cnt & ~31;
++ unsigned remain = cnt & 31;
++
++ if (size32) {
++ uint8_t *addr = rb4xx_nand_read_getaddr(size32);
++ if (memcmp(buf, (void *)addr, size32) != 0)
++ return 0;
++ }
++
++ if (remain) {
++ return do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, remain,
++ NULL, buf + size32, 0);
++ }
++ return 1;
++}
++#else /* USE_FAST_READ */
++static void rb4xx_nand_read_data(uint8_t *buf, unsigned cnt)
++{
++ do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, cnt, buf, NULL, 0);
++}
++
++static int rb4xx_nand_verify_data(const uint8_t *buf, unsigned cnt)
++{
++ return do_spi_cmd(CPLD_CMD_READ_MULT, 1, buf, cnt, NULL, buf, 0);
++}
++#endif /* USE_FAST_READ */
++
++static void rb4xx_nand_write_cfg(uint8_t byte)
++{
++ do_spi_cmd(CPLD_CMD_WRITE_CFG, 1, &byte, 0, NULL, NULL, 0);
++ got_write = 1;
++}
++
++static int rb4xx_nand_dev_ready(struct mtd_info *mtd)
++{
++ return gpio_get_value(RB4XX_NAND_GPIO_RDY);
++}
++
++static void rb4xx_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
++ unsigned int ctrl)
++{
++ if (ctrl & NAND_CTRL_CHANGE) {
++ uint8_t cfg = CFG_BIT_nLEDS;
++
++ cfg |= (ctrl & NAND_CLE) ? CFG_BIT_CLE : 0;
++ cfg |= (ctrl & NAND_ALE) ? CFG_BIT_ALE : 0;
++ cfg |= (ctrl & NAND_NCE) ? 0 : CFG_BIT_nCE;
++
++ rb4xx_nand_write_cfg(cfg);
++ }
++
++ if (cmd != NAND_CMD_NONE)
++ rb4xx_nand_write_byte(cmd);
++}
++
++static uint8_t rb4xx_nand_read_byte(struct mtd_info *mtd)
++{
++ uint8_t byte = 0;
++
++ rb4xx_nand_read_data(&byte, 1);
++ return byte;
++}
++
++static void rb4xx_nand_write_buf(struct mtd_info *mtd, const uint8_t *buf,
++ int len)
++{
++ rb4xx_nand_write_data(buf, len);
++}
++
++static void rb4xx_nand_read_buf(struct mtd_info *mtd, uint8_t *buf,
++ int len)
++{
++ rb4xx_nand_read_data(buf, len);
++}
++
++static int rb4xx_nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf,
++ int len)
++{
++ if (!rb4xx_nand_verify_data(buf, len))
++ return -EFAULT;
++
++ return 0;
++}
++
++static unsigned get_spi_ctrl(unsigned hz_max, const char *name)
++{
++ unsigned div;
++
++ div = (ar71xx_ahb_freq - 1) / (2 * hz_max);
++ /*
++ * CPU has a bug at (div == 0) - first bit read is random
++ */
++ if (div == 0)
++ ++div;
++
++ if (name) {
++ unsigned ahb_khz = (ar71xx_ahb_freq + 500) / 1000;
++ unsigned div_real = 2 * (div + 1);
++ printk(KERN_INFO "%s SPI clock %u kHz (AHB %u kHz / %u)\n",
++ name,
++ ahb_khz / div_real,
++ ahb_khz, div_real);
++ }
++
++ return SPI_CTRL_FASTEST + div;
++}
++
++static int __init rb4xx_nand_probe(struct platform_device *pdev)
++{
++ struct rb4xx_nand_info *info;
++ int ret;
++
++ printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
++
++ ret = gpio_request(RB4XX_NAND_GPIO_RDY, "NAND RDY");
++ if (ret) {
++ printk(KERN_ERR "rb4xx-nand: gpio request failed\n");
++ return ret;
++ }
++
++ ret = gpio_direction_input(RB4XX_NAND_GPIO_RDY);
++ if (ret) {
++ printk(KERN_ERR "rb4xx-nand: unable to set input mode "
++ "on gpio%d\n", RB4XX_NAND_GPIO_RDY);
++ goto err_free_gpio;
++ }
++
++ info = kzalloc(sizeof(*info), GFP_KERNEL);
++ if (!info) {
++ printk(KERN_ERR "rb4xx-nand: no memory for private data\n");
++ ret = -ENOMEM;
++ goto err_free_gpio;
++ }
++
++#if USE_FAST_READ
++ spi_ctrl_fread = get_spi_ctrl(RB4XX_NAND_HZ, "NAND");
++#endif
++ spi_ctrl_flash = get_spi_ctrl(RB4XX_FLASH_HZ, "FLASH");
++
++ rb4xx_nand_write_cfg(CFG_BIT_nLEDS | CFG_BIT_nCE);
++
++ info->chip.priv = &info;
++ info->mtd.priv = &info->chip;
++ info->mtd.owner = THIS_MODULE;
++
++ info->chip.cmd_ctrl = rb4xx_nand_cmd_ctrl;
++ info->chip.dev_ready = rb4xx_nand_dev_ready;
++ info->chip.read_byte = rb4xx_nand_read_byte;
++ info->chip.write_buf = rb4xx_nand_write_buf;
++ info->chip.read_buf = rb4xx_nand_read_buf;
++ info->chip.verify_buf = rb4xx_nand_verify_buf;
++
++ info->chip.chip_delay = 25;
++ info->chip.ecc.mode = NAND_ECC_SOFT;
++ info->chip.options |= NAND_NO_AUTOINCR;
++
++ platform_set_drvdata(pdev, info);
++
++ ret = nand_scan_ident(&info->mtd, 1);
++ if (ret) {
++ ret = -ENXIO;
++ goto err_free_info;
++ }
++
++ if (info->mtd.writesize == 512)
++ info->chip.ecc.layout = &rb4xx_nand_ecclayout;
++
++ ret = nand_scan_tail(&info->mtd);
++ if (ret) {
++ return -ENXIO;
++ goto err_set_drvdata;
++ }
++
++#ifdef CONFIG_MTD_PARTITIONS
++ ret = add_mtd_partitions(&info->mtd, rb4xx_nand_partitions,
++ ARRAY_SIZE(rb4xx_nand_partitions));
++#else
++ ret = add_mtd_device(&info->mtd);
++#endif
++ if (ret)
++ goto err_release_nand;
++
++ return 0;
++
++err_release_nand:
++ nand_release(&info->mtd);
++err_set_drvdata:
++ platform_set_drvdata(pdev, NULL);
++err_free_info:
++ kfree(info);
++err_free_gpio:
++ gpio_free(RB4XX_NAND_GPIO_RDY);
++ return ret;
++}
++
++static int __devexit rb4xx_nand_remove(struct platform_device *pdev)
++{
++ struct rb4xx_nand_info *info = platform_get_drvdata(pdev);
++
++ nand_release(&info->mtd);
++ platform_set_drvdata(pdev, NULL);
++ kfree(info);
++
++ return 0;
++}
++
++static struct platform_driver rb4xx_nand_driver = {
++ .probe = rb4xx_nand_probe,
++ .remove = __devexit_p(rb4xx_nand_remove),
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init rb4xx_nand_init(void)
++{
++ return platform_driver_register(&rb4xx_nand_driver);
++}
++
++static void __exit rb4xx_nand_exit(void)
++{
++ platform_driver_unregister(&rb4xx_nand_driver);
++}
++
++module_init(rb4xx_nand_init);
++module_exit(rb4xx_nand_exit);
++
++MODULE_DESCRIPTION(DRV_DESC);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-2.6.29.1.orig/drivers/net/Kconfig linux-2.6.29.1/drivers/net/Kconfig
+--- linux-2.6.29.1.orig/drivers/net/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/Kconfig 2009-04-13 14:27:34.763080366 +0200
+@@ -1945,6 +1945,8 @@
+
+ The safe and default value for this is N.
+
++source drivers/net/ag71xx/Kconfig
++
+ config DL2K
+ tristate "DL2000/TC902x-based Gigabit Ethernet support"
+ depends on PCI
+diff -Nur linux-2.6.29.1.orig/drivers/net/Makefile linux-2.6.29.1/drivers/net/Makefile
+--- linux-2.6.29.1.orig/drivers/net/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/Makefile 2009-04-13 14:27:34.767081713 +0200
+@@ -2,6 +2,7 @@
+ # Makefile for the Linux network (ethercard) device drivers.
+ #
+
++obj-$(CONFIG_AG71XX) += ag71xx/
+ obj-$(CONFIG_E1000) += e1000/
+ obj-$(CONFIG_E1000E) += e1000e/
+ obj-$(CONFIG_IBM_NEW_EMAC) += ibm_newemac/
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/Kconfig linux-2.6.29.1/drivers/net/ag71xx/Kconfig
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/Kconfig 2009-04-13 14:27:34.767081713 +0200
+@@ -0,0 +1,23 @@
++config AG71XX
++ tristate "Atheros AR71xx built-in ethernet mac support"
++ depends on ATHEROS_AR71XX
++ select PHYLIB
++ help
++ If you wish to compile a kernel for AR71xx/91xx and enable
++ ethernet support, then you should always answer Y to this.
++
++config AG71XX_DEBUG
++ bool "Atheros AR71xx built-in ethernet driver debugging"
++ depends on AG71XX
++ default n
++ help
++ Atheros AR71xx built-in ethernet driver debugging messages.
++
++config AG71XX_AR8216_SUPPORT
++ bool "special support for the Atheros AR8216 switch"
++ depends on AG71XX
++ default n
++ default y if AR71XX_MACH_WNR2000 || AR71XX_MACH_MZK_W04NU
++ help
++ Say 'y' here if you want to enable special support for the
++ Atheros AR8216 switch found on some boards.
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/Makefile linux-2.6.29.1/drivers/net/ag71xx/Makefile
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/Makefile 2009-04-13 14:27:34.771082502 +0200
+@@ -0,0 +1,13 @@
++#
++# Makefile for the Atheros AR71xx built-in ethernet macs
++#
++
++ag71xx-y += ag71xx_main.o
++ag71xx-y += ag71xx_ethtool.o
++ag71xx-y += ag71xx_phy.o
++ag71xx-y += ag71xx_mdio.o
++
++ag71xx-$(CONFIG_AG71XX_AR8216_SUPPORT) += ag71xx_ar8216.o
++
++obj-$(CONFIG_AG71XX) += ag71xx.o
++
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx.h linux-2.6.29.1/drivers/net/ag71xx/ag71xx.h
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx.h 2009-04-13 14:27:34.799084111 +0200
+@@ -0,0 +1,449 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef __AG71XX_H
++#define __AG71XX_H
++
++#include <linux/kernel.h>
++#include <linux/version.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/types.h>
++#include <linux/random.h>
++#include <linux/spinlock.h>
++#include <linux/interrupt.h>
++#include <linux/platform_device.h>
++#include <linux/ethtool.h>
++#include <linux/etherdevice.h>
++#include <linux/phy.h>
++#include <linux/skbuff.h>
++#include <linux/dma-mapping.h>
++#include <linux/workqueue.h>
++
++#include <linux/bitops.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/platform.h>
++
++#define ETH_FCS_LEN 4
++
++#define AG71XX_DRV_NAME "ag71xx"
++#define AG71XX_DRV_VERSION "0.5.21"
++
++#define AG71XX_NAPI_WEIGHT 64
++#define AG71XX_OOM_REFILL (1 + HZ/10)
++
++#define AG71XX_INT_ERR (AG71XX_INT_RX_BE | AG71XX_INT_TX_BE)
++#define AG71XX_INT_TX (AG71XX_INT_TX_PS)
++#define AG71XX_INT_RX (AG71XX_INT_RX_PR | AG71XX_INT_RX_OF)
++
++#define AG71XX_INT_POLL (AG71XX_INT_RX | AG71XX_INT_TX)
++#define AG71XX_INT_INIT (AG71XX_INT_ERR | AG71XX_INT_POLL)
++
++#define AG71XX_TX_FIFO_LEN 2048
++#define AG71XX_TX_MTU_LEN 1536
++#define AG71XX_RX_PKT_RESERVE 64
++#define AG71XX_RX_PKT_SIZE \
++ (AG71XX_RX_PKT_RESERVE + ETH_HLEN + ETH_FRAME_LEN + ETH_FCS_LEN)
++
++#define AG71XX_TX_RING_SIZE 64
++#define AG71XX_TX_THRES_STOP (AG71XX_TX_RING_SIZE - 4)
++#define AG71XX_TX_THRES_WAKEUP \
++ (AG71XX_TX_RING_SIZE - (AG71XX_TX_RING_SIZE / 4))
++
++#define AG71XX_RX_RING_SIZE 128
++
++#ifdef CONFIG_AG71XX_DEBUG
++#define DBG(fmt, args...) printk(KERN_DEBUG fmt, ## args)
++#else
++#define DBG(fmt, args...) do {} while (0)
++#endif
++
++#define ag71xx_assert(_cond) \
++do { \
++ if (_cond) \
++ break; \
++ printk("%s,%d: assertion failed\n", __FILE__, __LINE__); \
++ BUG(); \
++} while (0)
++
++struct ag71xx_desc {
++ u32 data;
++ u32 ctrl;
++#define DESC_EMPTY BIT(31)
++#define DESC_MORE BIT(24)
++#define DESC_PKTLEN_M 0x1fff
++ u32 next;
++ u32 pad;
++};
++
++struct ag71xx_buf {
++ struct sk_buff *skb;
++};
++
++struct ag71xx_ring {
++ struct ag71xx_buf *buf;
++ struct ag71xx_desc *descs;
++ dma_addr_t descs_dma;
++ unsigned int curr;
++ unsigned int dirty;
++ unsigned int size;
++};
++
++struct ag71xx_mdio {
++ struct mii_bus *mii_bus;
++ int mii_irq[PHY_MAX_ADDR];
++ void __iomem *mdio_base;
++};
++
++struct ag71xx {
++ void __iomem *mac_base;
++ void __iomem *mac_base2;
++ void __iomem *mii_ctrl;
++
++ spinlock_t lock;
++ struct platform_device *pdev;
++ struct net_device *dev;
++ struct napi_struct napi;
++ u32 msg_enable;
++
++ struct ag71xx_ring rx_ring;
++ struct ag71xx_ring tx_ring;
++
++ struct mii_bus *mii_bus;
++ struct phy_device *phy_dev;
++
++ unsigned int link;
++ unsigned int speed;
++ int duplex;
++
++ struct work_struct restart_work;
++ struct timer_list oom_timer;
++};
++
++extern struct ethtool_ops ag71xx_ethtool_ops;
++
++extern struct ag71xx_mdio *ag71xx_mdio_bus;
++extern int ag71xx_mdio_driver_init(void) __init;
++extern void ag71xx_mdio_driver_exit(void);
++
++extern int ag71xx_phy_connect(struct ag71xx *ag);
++extern void ag71xx_phy_disconnect(struct ag71xx *ag);
++extern void ag71xx_phy_start(struct ag71xx *ag);
++extern void ag71xx_phy_stop(struct ag71xx *ag);
++
++static inline struct ag71xx_platform_data *ag71xx_get_pdata(struct ag71xx *ag)
++{
++ return ag->pdev->dev.platform_data;
++}
++
++static inline int ag71xx_desc_empty(struct ag71xx_desc *desc)
++{
++ return ((desc->ctrl & DESC_EMPTY) != 0);
++}
++
++static inline int ag71xx_desc_pktlen(struct ag71xx_desc *desc)
++{
++ return (desc->ctrl & DESC_PKTLEN_M);
++}
++
++/* Register offsets */
++#define AG71XX_REG_MAC_CFG1 0x0000
++#define AG71XX_REG_MAC_CFG2 0x0004
++#define AG71XX_REG_MAC_IPG 0x0008
++#define AG71XX_REG_MAC_HDX 0x000c
++#define AG71XX_REG_MAC_MFL 0x0010
++#define AG71XX_REG_MII_CFG 0x0020
++#define AG71XX_REG_MII_CMD 0x0024
++#define AG71XX_REG_MII_ADDR 0x0028
++#define AG71XX_REG_MII_CTRL 0x002c
++#define AG71XX_REG_MII_STATUS 0x0030
++#define AG71XX_REG_MII_IND 0x0034
++#define AG71XX_REG_MAC_IFCTL 0x0038
++#define AG71XX_REG_MAC_ADDR1 0x0040
++#define AG71XX_REG_MAC_ADDR2 0x0044
++#define AG71XX_REG_FIFO_CFG0 0x0048
++#define AG71XX_REG_FIFO_CFG1 0x004c
++#define AG71XX_REG_FIFO_CFG2 0x0050
++#define AG71XX_REG_FIFO_CFG3 0x0054
++#define AG71XX_REG_FIFO_CFG4 0x0058
++#define AG71XX_REG_FIFO_CFG5 0x005c
++#define AG71XX_REG_FIFO_RAM0 0x0060
++#define AG71XX_REG_FIFO_RAM1 0x0064
++#define AG71XX_REG_FIFO_RAM2 0x0068
++#define AG71XX_REG_FIFO_RAM3 0x006c
++#define AG71XX_REG_FIFO_RAM4 0x0070
++#define AG71XX_REG_FIFO_RAM5 0x0074
++#define AG71XX_REG_FIFO_RAM6 0x0078
++#define AG71XX_REG_FIFO_RAM7 0x007c
++
++#define AG71XX_REG_TX_CTRL 0x0180
++#define AG71XX_REG_TX_DESC 0x0184
++#define AG71XX_REG_TX_STATUS 0x0188
++#define AG71XX_REG_RX_CTRL 0x018c
++#define AG71XX_REG_RX_DESC 0x0190
++#define AG71XX_REG_RX_STATUS 0x0194
++#define AG71XX_REG_INT_ENABLE 0x0198
++#define AG71XX_REG_INT_STATUS 0x019c
++
++#define MAC_CFG1_TXE BIT(0) /* Tx Enable */
++#define MAC_CFG1_STX BIT(1) /* Synchronize Tx Enable */
++#define MAC_CFG1_RXE BIT(2) /* Rx Enable */
++#define MAC_CFG1_SRX BIT(3) /* Synchronize Rx Enable */
++#define MAC_CFG1_TFC BIT(4) /* Tx Flow Control Enable */
++#define MAC_CFG1_RFC BIT(5) /* Rx Flow Control Enable */
++#define MAC_CFG1_LB BIT(8) /* Loopback mode */
++#define MAC_CFG1_SR BIT(31) /* Soft Reset */
++
++#define MAC_CFG2_FDX BIT(0)
++#define MAC_CFG2_CRC_EN BIT(1)
++#define MAC_CFG2_PAD_CRC_EN BIT(2)
++#define MAC_CFG2_LEN_CHECK BIT(4)
++#define MAC_CFG2_HUGE_FRAME_EN BIT(5)
++#define MAC_CFG2_IF_1000 BIT(9)
++#define MAC_CFG2_IF_10_100 BIT(8)
++
++#define FIFO_CFG0_WTM BIT(0) /* Watermark Module */
++#define FIFO_CFG0_RXS BIT(1) /* Rx System Module */
++#define FIFO_CFG0_RXF BIT(2) /* Rx Fabric Module */
++#define FIFO_CFG0_TXS BIT(3) /* Tx System Module */
++#define FIFO_CFG0_TXF BIT(4) /* Tx Fabric Module */
++#define FIFO_CFG0_ALL (FIFO_CFG0_WTM | FIFO_CFG0_RXS | FIFO_CFG0_RXF \
++ | FIFO_CFG0_TXS | FIFO_CFG0_TXF)
++
++#define FIFO_CFG0_ENABLE_SHIFT 8
++
++#define FIFO_CFG4_DE BIT(0) /* Drop Event */
++#define FIFO_CFG4_DV BIT(1) /* RX_DV Event */
++#define FIFO_CFG4_FC BIT(2) /* False Carrier */
++#define FIFO_CFG4_CE BIT(3) /* Code Error */
++#define FIFO_CFG4_CR BIT(4) /* CRC error */
++#define FIFO_CFG4_LM BIT(5) /* Length Mismatch */
++#define FIFO_CFG4_LO BIT(6) /* Length out of range */
++#define FIFO_CFG4_OK BIT(7) /* Packet is OK */
++#define FIFO_CFG4_MC BIT(8) /* Multicast Packet */
++#define FIFO_CFG4_BC BIT(9) /* Broadcast Packet */
++#define FIFO_CFG4_DR BIT(10) /* Dribble */
++#define FIFO_CFG4_LE BIT(11) /* Long Event */
++#define FIFO_CFG4_CF BIT(12) /* Control Frame */
++#define FIFO_CFG4_PF BIT(13) /* Pause Frame */
++#define FIFO_CFG4_UO BIT(14) /* Unsupported Opcode */
++#define FIFO_CFG4_VT BIT(15) /* VLAN tag detected */
++#define FIFO_CFG4_FT BIT(16) /* Frame Truncated */
++#define FIFO_CFG4_UC BIT(17) /* Unicast Packet */
++
++#define FIFO_CFG5_DE BIT(0) /* Drop Event */
++#define FIFO_CFG5_DV BIT(1) /* RX_DV Event */
++#define FIFO_CFG5_FC BIT(2) /* False Carrier */
++#define FIFO_CFG5_CE BIT(3) /* Code Error */
++#define FIFO_CFG5_LM BIT(4) /* Length Mismatch */
++#define FIFO_CFG5_LO BIT(5) /* Length Out of Range */
++#define FIFO_CFG5_OK BIT(6) /* Packet is OK */
++#define FIFO_CFG5_MC BIT(7) /* Multicast Packet */
++#define FIFO_CFG5_BC BIT(8) /* Broadcast Packet */
++#define FIFO_CFG5_DR BIT(9) /* Dribble */
++#define FIFO_CFG5_CF BIT(10) /* Control Frame */
++#define FIFO_CFG5_PF BIT(11) /* Pause Frame */
++#define FIFO_CFG5_UO BIT(12) /* Unsupported Opcode */
++#define FIFO_CFG5_VT BIT(13) /* VLAN tag detected */
++#define FIFO_CFG5_LE BIT(14) /* Long Event */
++#define FIFO_CFG5_FT BIT(15) /* Frame Truncated */
++#define FIFO_CFG5_16 BIT(16) /* unknown */
++#define FIFO_CFG5_17 BIT(17) /* unknown */
++#define FIFO_CFG5_SF BIT(18) /* Short Frame */
++#define FIFO_CFG5_BM BIT(19) /* Byte Mode */
++
++#define AG71XX_INT_TX_PS BIT(0)
++#define AG71XX_INT_TX_UR BIT(1)
++#define AG71XX_INT_TX_BE BIT(3)
++#define AG71XX_INT_RX_PR BIT(4)
++#define AG71XX_INT_RX_OF BIT(6)
++#define AG71XX_INT_RX_BE BIT(7)
++
++#define MAC_IFCTL_SPEED BIT(16)
++
++#define MII_CFG_CLK_DIV_4 0
++#define MII_CFG_CLK_DIV_6 2
++#define MII_CFG_CLK_DIV_8 3
++#define MII_CFG_CLK_DIV_10 4
++#define MII_CFG_CLK_DIV_14 5
++#define MII_CFG_CLK_DIV_20 6
++#define MII_CFG_CLK_DIV_28 7
++#define MII_CFG_RESET BIT(31)
++
++#define MII_CMD_WRITE 0x0
++#define MII_CMD_READ 0x1
++#define MII_ADDR_SHIFT 8
++#define MII_IND_BUSY BIT(0)
++#define MII_IND_INVALID BIT(2)
++
++#define TX_CTRL_TXE BIT(0) /* Tx Enable */
++
++#define TX_STATUS_PS BIT(0) /* Packet Sent */
++#define TX_STATUS_UR BIT(1) /* Tx Underrun */
++#define TX_STATUS_BE BIT(3) /* Bus Error */
++
++#define RX_CTRL_RXE BIT(0) /* Rx Enable */
++
++#define RX_STATUS_PR BIT(0) /* Packet Received */
++#define RX_STATUS_OF BIT(2) /* Rx Overflow */
++#define RX_STATUS_BE BIT(3) /* Bus Error */
++
++#define MII_CTRL_IF_MASK 3
++#define MII_CTRL_SPEED_SHIFT 4
++#define MII_CTRL_SPEED_MASK 3
++#define MII_CTRL_SPEED_10 0
++#define MII_CTRL_SPEED_100 1
++#define MII_CTRL_SPEED_1000 2
++
++static inline void ag71xx_wr(struct ag71xx *ag, unsigned reg, u32 value)
++{
++ void __iomem *r;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ __raw_writel(value, r);
++ __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ __raw_writel(value, r);
++ __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++}
++
++static inline u32 ag71xx_rr(struct ag71xx *ag, unsigned reg)
++{
++ void __iomem *r;
++ u32 ret;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ ret = __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ ret = __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++
++ return ret;
++}
++
++static inline void ag71xx_sb(struct ag71xx *ag, unsigned reg, u32 mask)
++{
++ void __iomem *r;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ __raw_writel(__raw_readl(r) | mask, r);
++ __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ __raw_writel(__raw_readl(r) | mask, r);
++ __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++}
++
++static inline void ag71xx_cb(struct ag71xx *ag, unsigned reg, u32 mask)
++{
++ void __iomem *r;
++
++ switch (reg) {
++ case AG71XX_REG_MAC_CFG1 ... AG71XX_REG_MAC_MFL:
++ r = ag->mac_base + reg;
++ __raw_writel(__raw_readl(r) & ~mask, r);
++ __raw_readl(r);
++ break;
++ case AG71XX_REG_MAC_IFCTL ... AG71XX_REG_INT_STATUS:
++ r = ag->mac_base2 + reg - AG71XX_REG_MAC_IFCTL;
++ __raw_writel(__raw_readl(r) & ~mask, r);
++ __raw_readl(r);
++ break;
++ default:
++ BUG();
++ }
++}
++
++static inline void ag71xx_int_enable(struct ag71xx *ag, u32 ints)
++{
++ ag71xx_sb(ag, AG71XX_REG_INT_ENABLE, ints);
++}
++
++static inline void ag71xx_int_disable(struct ag71xx *ag, u32 ints)
++{
++ ag71xx_cb(ag, AG71XX_REG_INT_ENABLE, ints);
++}
++
++static inline void ag71xx_mii_ctrl_wr(struct ag71xx *ag, u32 value)
++{
++ __raw_writel(value, ag->mii_ctrl);
++ __raw_readl(ag->mii_ctrl);
++}
++
++static inline u32 ag71xx_mii_ctrl_rr(struct ag71xx *ag)
++{
++ return __raw_readl(ag->mii_ctrl);
++}
++
++static void inline ag71xx_mii_ctrl_set_if(struct ag71xx *ag,
++ unsigned int mii_if)
++{
++ u32 t;
++
++ t = ag71xx_mii_ctrl_rr(ag);
++ t &= ~(MII_CTRL_IF_MASK);
++ t |= (mii_if & MII_CTRL_IF_MASK);
++ ag71xx_mii_ctrl_wr(ag, t);
++}
++
++static void inline ag71xx_mii_ctrl_set_speed(struct ag71xx *ag,
++ unsigned int speed)
++{
++ u32 t;
++
++ t = ag71xx_mii_ctrl_rr(ag);
++ t &= ~(MII_CTRL_SPEED_MASK << MII_CTRL_SPEED_SHIFT);
++ t |= (speed & MII_CTRL_SPEED_MASK) << MII_CTRL_SPEED_SHIFT;
++ ag71xx_mii_ctrl_wr(ag, t);
++}
++
++#ifdef CONFIG_AG71XX_AR8216_SUPPORT
++void ag71xx_add_ar8216_header(struct ag71xx *ag, struct sk_buff *skb);
++int ag71xx_remove_ar8216_header(struct ag71xx *ag, struct sk_buff *skb);
++#else
++static inline void ag71xx_add_ar8216_header(struct ag71xx *ag,
++ struct sk_buff *skb)
++{
++}
++
++static inline int ag71xx_remove_ar8216_header(struct ag71xx *ag,
++ struct sk_buff *skb)
++{
++ return 0;
++}
++#endif
++
++#endif /* _AG71XX_H */
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ar8216.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ar8216.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ar8216.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ar8216.c 2009-04-13 14:27:34.803084620 +0200
+@@ -0,0 +1,53 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ * Special support for the Atheros ar8216 switch chip
++ *
++ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++#define AR8216_PACKET_TYPE_MASK 0xf
++#define AR8216_PACKET_TYPE_NORMAL 0
++
++#define AR8216_HEADER_LEN 2
++
++void ag71xx_add_ar8216_header(struct ag71xx *ag, struct sk_buff *skb)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ if (!pdata->has_ar8216)
++ return;
++
++ skb_push(skb, AR8216_HEADER_LEN);
++ skb->data[0] = 0x10;
++ skb->data[1] = 0x80;
++}
++
++int ag71xx_remove_ar8216_header(struct ag71xx *ag,
++ struct sk_buff *skb)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ u8 type;
++
++ if (!pdata->has_ar8216)
++ return 0;
++
++ type = skb->data[1] & AR8216_PACKET_TYPE_MASK;
++
++ switch (type) {
++ case AR8216_PACKET_TYPE_NORMAL:
++ skb_pull(skb, AR8216_HEADER_LEN);
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ return 0;
++}
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ethtool.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ethtool.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_ethtool.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_ethtool.c 2009-04-13 14:27:34.803084620 +0200
+@@ -0,0 +1,71 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++static int ag71xx_ethtool_get_settings(struct net_device *dev,
++ struct ethtool_cmd *cmd)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct phy_device *phydev = ag->phy_dev;
++
++ if (!phydev)
++ return -ENODEV;
++
++ return phy_ethtool_gset(phydev, cmd);
++}
++
++static int ag71xx_ethtool_set_settings(struct net_device *dev,
++ struct ethtool_cmd *cmd)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct phy_device *phydev = ag->phy_dev;
++
++ if (!phydev)
++ return -ENODEV;
++
++ return phy_ethtool_sset(phydev, cmd);
++}
++
++static void ag71xx_ethtool_get_drvinfo(struct net_device *dev,
++ struct ethtool_drvinfo *info)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ strcpy(info->driver, ag->pdev->dev.driver->name);
++ strcpy(info->version, AG71XX_DRV_VERSION);
++ strcpy(info->bus_info, ag->pdev->dev.bus_id);
++}
++
++static u32 ag71xx_ethtool_get_msglevel(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ return ag->msg_enable;
++}
++
++static void ag71xx_ethtool_set_msglevel(struct net_device *dev, u32 msg_level)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ ag->msg_enable = msg_level;
++}
++
++struct ethtool_ops ag71xx_ethtool_ops = {
++ .set_settings = ag71xx_ethtool_set_settings,
++ .get_settings = ag71xx_ethtool_get_settings,
++ .get_drvinfo = ag71xx_ethtool_get_drvinfo,
++ .get_msglevel = ag71xx_ethtool_get_msglevel,
++ .set_msglevel = ag71xx_ethtool_set_msglevel,
++ .get_link = ethtool_op_get_link,
++};
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_main.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_main.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_main.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_main.c 2009-04-13 18:00:36.641934324 +0200
+@@ -0,0 +1,990 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++#define AG71XX_DEFAULT_MSG_ENABLE \
++ ( NETIF_MSG_DRV \
++ | NETIF_MSG_PROBE \
++ | NETIF_MSG_LINK \
++ | NETIF_MSG_TIMER \
++ | NETIF_MSG_IFDOWN \
++ | NETIF_MSG_IFUP \
++ | NETIF_MSG_RX_ERR \
++ | NETIF_MSG_TX_ERR )
++
++static int ag71xx_debug = -1;
++
++module_param(ag71xx_debug, int, 0);
++MODULE_PARM_DESC(ag71xx_debug, "Debug level (-1=defaults,0=none,...,16=all)");
++
++static void ag71xx_dump_dma_regs(struct ag71xx *ag)
++{
++ DBG("%s: dma_tx_ctrl=%08x, dma_tx_desc=%08x, dma_tx_status=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_TX_CTRL),
++ ag71xx_rr(ag, AG71XX_REG_TX_DESC),
++ ag71xx_rr(ag, AG71XX_REG_TX_STATUS));
++
++ DBG("%s: dma_rx_ctrl=%08x, dma_rx_desc=%08x, dma_rx_status=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_RX_CTRL),
++ ag71xx_rr(ag, AG71XX_REG_RX_DESC),
++ ag71xx_rr(ag, AG71XX_REG_RX_STATUS));
++}
++
++static void ag71xx_dump_regs(struct ag71xx *ag)
++{
++ DBG("%s: mac_cfg1=%08x, mac_cfg2=%08x, ipg=%08x, hdx=%08x, mfl=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_MAC_CFG1),
++ ag71xx_rr(ag, AG71XX_REG_MAC_CFG2),
++ ag71xx_rr(ag, AG71XX_REG_MAC_IPG),
++ ag71xx_rr(ag, AG71XX_REG_MAC_HDX),
++ ag71xx_rr(ag, AG71XX_REG_MAC_MFL));
++ DBG("%s: mac_ifctl=%08x, mac_addr1=%08x, mac_addr2=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL),
++ ag71xx_rr(ag, AG71XX_REG_MAC_ADDR1),
++ ag71xx_rr(ag, AG71XX_REG_MAC_ADDR2));
++ DBG("%s: fifo_cfg0=%08x, fifo_cfg1=%08x, fifo_cfg2=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG0),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG1),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG2));
++ DBG("%s: fifo_cfg3=%08x, fifo_cfg4=%08x, fifo_cfg5=%08x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG3),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG4),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
++}
++
++static inline void ag71xx_dump_intr(struct ag71xx *ag, char *label, u32 intr)
++{
++ DBG("%s: %s intr=%08x %s%s%s%s%s%s\n",
++ ag->dev->name, label, intr,
++ (intr & AG71XX_INT_TX_PS) ? "TXPS " : "",
++ (intr & AG71XX_INT_TX_UR) ? "TXUR " : "",
++ (intr & AG71XX_INT_TX_BE) ? "TXBE " : "",
++ (intr & AG71XX_INT_RX_PR) ? "RXPR " : "",
++ (intr & AG71XX_INT_RX_OF) ? "RXOF " : "",
++ (intr & AG71XX_INT_RX_BE) ? "RXBE " : "");
++}
++
++static void ag71xx_ring_free(struct ag71xx_ring *ring)
++{
++ kfree(ring->buf);
++
++ if (ring->descs)
++ dma_free_coherent(NULL, ring->size * sizeof(*ring->descs),
++ ring->descs, ring->descs_dma);
++}
++
++static int ag71xx_ring_alloc(struct ag71xx_ring *ring, unsigned int size)
++{
++ int err;
++
++ ring->descs = dma_alloc_coherent(NULL, size * sizeof(*ring->descs),
++ &ring->descs_dma,
++ GFP_ATOMIC);
++ if (!ring->descs) {
++ err = -ENOMEM;
++ goto err;
++ }
++
++ ring->size = size;
++
++ ring->buf = kzalloc(size * sizeof(*ring->buf), GFP_KERNEL);
++ if (!ring->buf) {
++ err = -ENOMEM;
++ goto err;
++ }
++
++ return 0;
++
++ err:
++ return err;
++}
++
++static void ag71xx_ring_tx_clean(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ struct net_device *dev = ag->dev;
++
++ while (ring->curr != ring->dirty) {
++ u32 i = ring->dirty % AG71XX_TX_RING_SIZE;
++
++ if (!ag71xx_desc_empty(&ring->descs[i])) {
++ ring->descs[i].ctrl = 0;
++ dev->stats.tx_errors++;
++ }
++
++ if (ring->buf[i].skb)
++ dev_kfree_skb_any(ring->buf[i].skb);
++
++ ring->buf[i].skb = NULL;
++
++ ring->dirty++;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++}
++
++static void ag71xx_ring_tx_init(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ int i;
++
++ for (i = 0; i < AG71XX_TX_RING_SIZE; i++) {
++ ring->descs[i].next = (u32) (ring->descs_dma +
++ sizeof(*ring->descs) * ((i + 1) % AG71XX_TX_RING_SIZE));
++
++ ring->descs[i].ctrl = DESC_EMPTY;
++ ring->buf[i].skb = NULL;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++ ring->curr = 0;
++ ring->dirty = 0;
++}
++
++static void ag71xx_ring_rx_clean(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ int i;
++
++ if (!ring->buf)
++ return;
++
++ for (i = 0; i < AG71XX_RX_RING_SIZE; i++)
++ if (ring->buf[i].skb)
++ kfree_skb(ring->buf[i].skb);
++
++}
++
++static int ag71xx_ring_rx_init(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ unsigned int i;
++ int ret;
++
++ ret = 0;
++ for (i = 0; i < AG71XX_RX_RING_SIZE; i++)
++ ring->descs[i].next = (u32) (ring->descs_dma +
++ sizeof(*ring->descs) * ((i + 1) % AG71XX_RX_RING_SIZE));
++
++ for (i = 0; i < AG71XX_RX_RING_SIZE; i++) {
++ struct sk_buff *skb;
++
++ skb = dev_alloc_skb(AG71XX_RX_PKT_SIZE);
++ if (!skb) {
++ ret = -ENOMEM;
++ break;
++ }
++
++ dma_map_single(NULL, skb->data, AG71XX_RX_PKT_SIZE,
++ DMA_FROM_DEVICE);
++
++ skb->dev = ag->dev;
++ skb_reserve(skb, AG71XX_RX_PKT_RESERVE);
++
++ ring->buf[i].skb = skb;
++ ring->descs[i].data = virt_to_phys(skb->data);
++ ring->descs[i].ctrl = DESC_EMPTY;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++ ring->curr = 0;
++ ring->dirty = 0;
++
++ return ret;
++}
++
++static int ag71xx_ring_rx_refill(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ unsigned int count;
++
++ count = 0;
++ for (; ring->curr - ring->dirty > 0; ring->dirty++) {
++ unsigned int i;
++
++ i = ring->dirty % AG71XX_RX_RING_SIZE;
++
++ if (ring->buf[i].skb == NULL) {
++ struct sk_buff *skb;
++
++ skb = dev_alloc_skb(AG71XX_RX_PKT_SIZE);
++ if (skb == NULL)
++ break;
++
++ dma_map_single(NULL, skb->data, AG71XX_RX_PKT_SIZE,
++ DMA_FROM_DEVICE);
++
++ skb_reserve(skb, AG71XX_RX_PKT_RESERVE);
++ skb->dev = ag->dev;
++
++ ring->buf[i].skb = skb;
++ ring->descs[i].data = virt_to_phys(skb->data);
++ }
++
++ ring->descs[i].ctrl = DESC_EMPTY;
++ count++;
++ }
++
++ /* flush descriptors */
++ wmb();
++
++ DBG("%s: %u rx descriptors refilled\n", ag->dev->name, count);
++
++ return count;
++}
++
++static int ag71xx_rings_init(struct ag71xx *ag)
++{
++ int ret;
++
++ ret = ag71xx_ring_alloc(&ag->tx_ring, AG71XX_TX_RING_SIZE);
++ if (ret)
++ return ret;
++
++ ag71xx_ring_tx_init(ag);
++
++ ret = ag71xx_ring_alloc(&ag->rx_ring, AG71XX_RX_RING_SIZE);
++ if (ret)
++ return ret;
++
++ ret = ag71xx_ring_rx_init(ag);
++ return ret;
++}
++
++static void ag71xx_rings_cleanup(struct ag71xx *ag)
++{
++ ag71xx_ring_rx_clean(ag);
++ ag71xx_ring_free(&ag->rx_ring);
++
++ ag71xx_ring_tx_clean(ag);
++ ag71xx_ring_free(&ag->tx_ring);
++}
++
++static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
++{
++ u32 t;
++
++ t = (((u32) mac[0]) << 24) | (((u32) mac[1]) << 16)
++ | (((u32) mac[2]) << 8) | ((u32) mac[3]);
++
++ ag71xx_wr(ag, AG71XX_REG_MAC_ADDR1, t);
++
++ t = (((u32) mac[4]) << 24) | (((u32) mac[5]) << 16);
++ ag71xx_wr(ag, AG71XX_REG_MAC_ADDR2, t);
++}
++
++static void ag71xx_dma_reset(struct ag71xx *ag)
++{
++ int i;
++
++ ag71xx_dump_dma_regs(ag);
++
++ /* stop RX and TX */
++ ag71xx_wr(ag, AG71XX_REG_RX_CTRL, 0);
++ ag71xx_wr(ag, AG71XX_REG_TX_CTRL, 0);
++
++ /* clear descriptor addresses */
++ ag71xx_wr(ag, AG71XX_REG_TX_DESC, 0);
++ ag71xx_wr(ag, AG71XX_REG_RX_DESC, 0);
++
++ /* clear pending RX/TX interrupts */
++ for (i = 0; i < 256; i++) {
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
++ }
++
++ /* clear pending errors */
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_BE | RX_STATUS_OF);
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_BE | TX_STATUS_UR);
++
++ if (ag71xx_rr(ag, AG71XX_REG_RX_STATUS))
++ printk(KERN_ALERT "%s: unable to clear DMA Rx status\n",
++ ag->dev->name);
++
++ if (ag71xx_rr(ag, AG71XX_REG_TX_STATUS))
++ printk(KERN_ALERT "%s: unable to clear DMA Tx status\n",
++ ag->dev->name);
++
++ ag71xx_dump_dma_regs(ag);
++}
++
++#define MAC_CFG1_INIT (MAC_CFG1_RXE | MAC_CFG1_TXE | \
++ MAC_CFG1_SRX | MAC_CFG1_STX)
++
++#define FIFO_CFG0_INIT (FIFO_CFG0_ALL << FIFO_CFG0_ENABLE_SHIFT)
++
++#define FIFO_CFG4_INIT (FIFO_CFG4_DE | FIFO_CFG4_DV | FIFO_CFG4_FC | \
++ FIFO_CFG4_CE | FIFO_CFG4_CR | FIFO_CFG4_LM | \
++ FIFO_CFG4_LO | FIFO_CFG4_OK | FIFO_CFG4_MC | \
++ FIFO_CFG4_BC | FIFO_CFG4_DR | FIFO_CFG4_LE | \
++ FIFO_CFG4_CF | FIFO_CFG4_PF | FIFO_CFG4_UO | \
++ FIFO_CFG4_VT)
++
++#define FIFO_CFG5_INIT (FIFO_CFG5_DE | FIFO_CFG5_DV | FIFO_CFG5_FC | \
++ FIFO_CFG5_CE | FIFO_CFG5_LO | FIFO_CFG5_OK | \
++ FIFO_CFG5_MC | FIFO_CFG5_BC | FIFO_CFG5_DR | \
++ FIFO_CFG5_CF | FIFO_CFG5_PF | FIFO_CFG5_VT | \
++ FIFO_CFG5_LE | FIFO_CFG5_FT | FIFO_CFG5_16 | \
++ FIFO_CFG5_17 | FIFO_CFG5_SF)
++
++static void ag71xx_hw_init(struct ag71xx *ag)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ ag71xx_sb(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_SR);
++ udelay(20);
++
++ ar71xx_device_stop(pdata->reset_bit);
++ mdelay(100);
++ ar71xx_device_start(pdata->reset_bit);
++ mdelay(100);
++
++ /* setup MAC configuration registers */
++ ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, MAC_CFG1_INIT);
++ ag71xx_sb(ag, AG71XX_REG_MAC_CFG2,
++ MAC_CFG2_PAD_CRC_EN | MAC_CFG2_LEN_CHECK);
++
++ /* setup max frame length */
++ ag71xx_wr(ag, AG71XX_REG_MAC_MFL, AG71XX_TX_MTU_LEN);
++
++ /* setup MII interface type */
++ ag71xx_mii_ctrl_set_if(ag, pdata->mii_if);
++
++ /* setup FIFO configuration registers */
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG0, FIFO_CFG0_INIT);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG1, 0x0fff0000);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG2, 0x00001fff);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG4, FIFO_CFG4_INIT);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, FIFO_CFG5_INIT);
++
++ ag71xx_dma_reset(ag);
++}
++
++static void ag71xx_hw_start(struct ag71xx *ag)
++{
++ /* start RX engine */
++ ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
++
++ /* enable interrupts */
++ ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, AG71XX_INT_INIT);
++}
++
++static void ag71xx_hw_stop(struct ag71xx *ag)
++{
++ /* disable all interrupts */
++ ag71xx_wr(ag, AG71XX_REG_INT_ENABLE, 0);
++
++ ag71xx_dma_reset(ag);
++}
++
++static int ag71xx_open(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ int ret;
++
++ ret = ag71xx_rings_init(ag);
++ if (ret)
++ goto err;
++
++ napi_enable(&ag->napi);
++
++ netif_carrier_off(dev);
++ ag71xx_phy_start(ag);
++
++ ag71xx_wr(ag, AG71XX_REG_TX_DESC, ag->tx_ring.descs_dma);
++ ag71xx_wr(ag, AG71XX_REG_RX_DESC, ag->rx_ring.descs_dma);
++
++ ag71xx_hw_set_macaddr(ag, dev->dev_addr);
++
++ ag71xx_hw_start(ag);
++
++ netif_start_queue(dev);
++
++ return 0;
++
++ err:
++ ag71xx_rings_cleanup(ag);
++ return ret;
++}
++
++static int ag71xx_stop(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ unsigned long flags;
++
++ spin_lock_irqsave(&ag->lock, flags);
++
++ netif_stop_queue(dev);
++
++ ag71xx_hw_stop(ag);
++
++ netif_carrier_off(dev);
++ ag71xx_phy_stop(ag);
++
++ napi_disable(&ag->napi);
++ del_timer_sync(&ag->oom_timer);
++
++ spin_unlock_irqrestore(&ag->lock, flags);
++
++ ag71xx_rings_cleanup(ag);
++
++ return 0;
++}
++
++static int ag71xx_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ struct ag71xx_desc *desc;
++ unsigned long flags;
++ int i;
++
++ i = ring->curr % AG71XX_TX_RING_SIZE;
++ desc = &ring->descs[i];
++
++ spin_lock_irqsave(&ag->lock, flags);
++ pdata->ddr_flush();
++ spin_unlock_irqrestore(&ag->lock, flags);
++
++ if (!ag71xx_desc_empty(desc))
++ goto err_drop;
++
++ ag71xx_add_ar8216_header(ag, skb);
++
++ if (skb->len <= 0) {
++ DBG("%s: packet len is too small\n", ag->dev->name);
++ goto err_drop;
++ }
++
++ dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE);
++
++ ring->buf[i].skb = skb;
++
++ /* setup descriptor fields */
++ desc->data = virt_to_phys(skb->data);
++ desc->ctrl = (skb->len & DESC_PKTLEN_M);
++
++ /* flush descriptor */
++ wmb();
++
++ ring->curr++;
++ if (ring->curr == (ring->dirty + AG71XX_TX_THRES_STOP)) {
++ DBG("%s: tx queue full\n", ag->dev->name);
++ netif_stop_queue(dev);
++ }
++
++ DBG("%s: packet injected into TX queue\n", ag->dev->name);
++
++ /* enable TX engine */
++ ag71xx_wr(ag, AG71XX_REG_TX_CTRL, TX_CTRL_TXE);
++
++ dev->trans_start = jiffies;
++
++ return 0;
++
++ err_drop:
++ dev->stats.tx_dropped++;
++
++ dev_kfree_skb(skb);
++ return 0;
++}
++
++static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
++{
++ struct mii_ioctl_data *data = (struct mii_ioctl_data *) &ifr->ifr_data;
++ struct ag71xx *ag = netdev_priv(dev);
++ int ret;
++
++ switch (cmd) {
++ case SIOCETHTOOL:
++ if (ag->phy_dev == NULL)
++ break;
++
++ spin_lock_irq(&ag->lock);
++ ret = phy_ethtool_ioctl(ag->phy_dev, (void *) ifr->ifr_data);
++ spin_unlock_irq(&ag->lock);
++ return ret;
++
++ case SIOCSIFHWADDR:
++ if (copy_from_user
++ (dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr)))
++ return -EFAULT;
++ return 0;
++
++ case SIOCGIFHWADDR:
++ if (copy_to_user
++ (ifr->ifr_data, dev->dev_addr, sizeof(dev->dev_addr)))
++ return -EFAULT;
++ return 0;
++
++ case SIOCGMIIPHY:
++ case SIOCGMIIREG:
++ case SIOCSMIIREG:
++ if (ag->phy_dev == NULL)
++ break;
++
++ return phy_mii_ioctl(ag->phy_dev, data, cmd);
++
++ default:
++ break;
++ }
++
++ return -EOPNOTSUPP;
++}
++
++static void ag71xx_oom_timer_handler(unsigned long data)
++{
++ struct net_device *dev = (struct net_device *) data;
++ struct ag71xx *ag = netdev_priv(dev);
++
++ netif_rx_schedule(&ag->napi);
++}
++
++static void ag71xx_tx_timeout(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++
++ if (netif_msg_tx_err(ag))
++ printk(KERN_DEBUG "%s: tx timeout\n", ag->dev->name);
++
++ schedule_work(&ag->restart_work);
++}
++
++static void ag71xx_restart_work_func(struct work_struct *work)
++{
++ struct ag71xx *ag = container_of(work, struct ag71xx, restart_work);
++
++ ag71xx_stop(ag->dev);
++ ag71xx_open(ag->dev);
++}
++
++static void ag71xx_tx_packets(struct ag71xx *ag)
++{
++ struct ag71xx_ring *ring = &ag->tx_ring;
++ unsigned int sent;
++
++ DBG("%s: processing TX ring\n", ag->dev->name);
++
++ sent = 0;
++ while (ring->dirty != ring->curr) {
++ unsigned int i = ring->dirty % AG71XX_TX_RING_SIZE;
++ struct ag71xx_desc *desc = &ring->descs[i];
++ struct sk_buff *skb = ring->buf[i].skb;
++
++ if (!ag71xx_desc_empty(desc))
++ break;
++
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_PS);
++
++ ag->dev->stats.tx_bytes += skb->len;
++ ag->dev->stats.tx_packets++;
++
++ dev_kfree_skb_any(skb);
++ ring->buf[i].skb = NULL;
++
++ ring->dirty++;
++ sent++;
++ }
++
++ DBG("%s: %d packets sent out\n", ag->dev->name, sent);
++
++ if ((ring->curr - ring->dirty) < AG71XX_TX_THRES_WAKEUP)
++ netif_wake_queue(ag->dev);
++
++}
++
++static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
++{
++ struct net_device *dev = ag->dev;
++ struct ag71xx_ring *ring = &ag->rx_ring;
++ int done = 0;
++
++ DBG("%s: rx packets, limit=%d, curr=%u, dirty=%u\n",
++ dev->name, limit, ring->curr, ring->dirty);
++
++ while (done < limit) {
++ unsigned int i = ring->curr % AG71XX_RX_RING_SIZE;
++ struct ag71xx_desc *desc = &ring->descs[i];
++ struct sk_buff *skb;
++ int pktlen;
++
++ if (ag71xx_desc_empty(desc))
++ break;
++
++ if ((ring->dirty + AG71XX_RX_RING_SIZE) == ring->curr) {
++ ag71xx_assert(0);
++ break;
++ }
++
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
++
++ skb = ring->buf[i].skb;
++ pktlen = ag71xx_desc_pktlen(desc);
++ pktlen -= ETH_FCS_LEN;
++
++ skb_put(skb, pktlen);
++
++ skb->dev = dev;
++ skb->ip_summed = CHECKSUM_NONE;
++
++ dev->last_rx = jiffies;
++ dev->stats.rx_packets++;
++ dev->stats.rx_bytes += pktlen;
++
++ if (ag71xx_remove_ar8216_header(ag, skb) != 0) {
++ dev->stats.rx_dropped++;
++ kfree_skb(skb);
++ } else {
++ skb->protocol = eth_type_trans(skb, dev);
++ netif_receive_skb(skb);
++ }
++
++ ring->buf[i].skb = NULL;
++ done++;
++
++ ring->curr++;
++ }
++
++ ag71xx_ring_rx_refill(ag);
++
++ DBG("%s: rx finish, curr=%u, dirty=%u, done=%d\n",
++ dev->name, ring->curr, ring->dirty, done);
++
++ return done;
++}
++
++static int ag71xx_poll(struct napi_struct *napi, int limit)
++{
++ struct ag71xx *ag = container_of(napi, struct ag71xx, napi);
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ struct net_device *dev = ag->dev;
++ struct ag71xx_ring *rx_ring;
++ unsigned long flags;
++ u32 status;
++ int done;
++
++ pdata->ddr_flush();
++ ag71xx_tx_packets(ag);
++
++ DBG("%s: processing RX ring\n", dev->name);
++ done = ag71xx_rx_packets(ag, limit);
++
++ rx_ring = &ag->rx_ring;
++ if (rx_ring->buf[rx_ring->dirty % AG71XX_RX_RING_SIZE].skb == NULL)
++ goto oom;
++
++ status = ag71xx_rr(ag, AG71XX_REG_RX_STATUS);
++ if (unlikely(status & RX_STATUS_OF)) {
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_OF);
++ dev->stats.rx_fifo_errors++;
++
++ /* restart RX */
++ ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
++ }
++
++ if (done < limit) {
++ if (status & RX_STATUS_PR)
++ goto more;
++
++ status = ag71xx_rr(ag, AG71XX_REG_TX_STATUS);
++ if (status & TX_STATUS_PS)
++ goto more;
++
++ DBG("%s: disable polling mode, done=%d, limit=%d\n",
++ dev->name, done, limit);
++
++ netif_rx_complete(napi);
++
++ /* enable interrupts */
++ spin_lock_irqsave(&ag->lock, flags);
++ ag71xx_int_enable(ag, AG71XX_INT_POLL);
++ spin_unlock_irqrestore(&ag->lock, flags);
++ return done;
++ }
++
++ more:
++ DBG("%s: stay in polling mode, done=%d, limit=%d\n",
++ dev->name, done, limit);
++ return done;
++
++ oom:
++ if (netif_msg_rx_err(ag))
++ printk(KERN_DEBUG "%s: out of memory\n", dev->name);
++
++ mod_timer(&ag->oom_timer, jiffies + AG71XX_OOM_REFILL);
++ netif_rx_complete(napi);
++ return 0;
++}
++
++static irqreturn_t ag71xx_interrupt(int irq, void *dev_id)
++{
++ struct net_device *dev = dev_id;
++ struct ag71xx *ag = netdev_priv(dev);
++ u32 status;
++
++ status = ag71xx_rr(ag, AG71XX_REG_INT_STATUS);
++ ag71xx_dump_intr(ag, "raw", status);
++
++ if (unlikely(!status))
++ return IRQ_NONE;
++
++ if (unlikely(status & AG71XX_INT_ERR)) {
++ if (status & AG71XX_INT_TX_BE) {
++ ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_BE);
++ dev_err(&dev->dev, "TX BUS error\n");
++ }
++ if (status & AG71XX_INT_RX_BE) {
++ ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_BE);
++ dev_err(&dev->dev, "RX BUS error\n");
++ }
++ }
++
++ if (likely(status & AG71XX_INT_POLL)) {
++ ag71xx_int_disable(ag, AG71XX_INT_POLL);
++ DBG("%s: enable polling mode\n", dev->name);
++ netif_rx_schedule(&ag->napi);
++ }
++
++ return IRQ_HANDLED;
++}
++
++static void ag71xx_set_multicast_list(struct net_device *dev)
++{
++ /* TODO */
++}
++
++static int __init ag71xx_probe(struct platform_device *pdev)
++{
++ struct net_device *dev;
++ struct resource *res;
++ struct ag71xx *ag;
++ struct ag71xx_platform_data *pdata;
++ int err;
++
++ pdata = pdev->dev.platform_data;
++ if (!pdata) {
++ dev_err(&pdev->dev, "no platform data specified\n");
++ err = -ENXIO;
++ goto err_out;
++ }
++
++ dev = alloc_etherdev(sizeof(*ag));
++ if (!dev) {
++ dev_err(&pdev->dev, "alloc_etherdev failed\n");
++ err = -ENOMEM;
++ goto err_out;
++ }
++
++ SET_NETDEV_DEV(dev, &pdev->dev);
++
++ ag = netdev_priv(dev);
++ ag->pdev = pdev;
++ ag->dev = dev;
++ ag->mii_bus = ag71xx_mdio_bus->mii_bus;
++ ag->msg_enable = netif_msg_init(ag71xx_debug,
++ AG71XX_DEFAULT_MSG_ENABLE);
++ spin_lock_init(&ag->lock);
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac_base");
++ if (!res) {
++ dev_err(&pdev->dev, "no mac_base resource found\n");
++ err = -ENXIO;
++ goto err_out;
++ }
++
++ ag->mac_base = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!ag->mac_base) {
++ dev_err(&pdev->dev, "unable to ioremap mac_base\n");
++ err = -ENOMEM;
++ goto err_free_dev;
++ }
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mac_base2");
++ if (!res) {
++ dev_err(&pdev->dev, "no mac_base2 resource found\n");
++ err = -ENXIO;
++ goto err_unmap_base1;
++ }
++
++ ag->mac_base2 = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!ag->mac_base) {
++ dev_err(&pdev->dev, "unable to ioremap mac_base2\n");
++ err = -ENOMEM;
++ goto err_unmap_base1;
++ }
++
++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mii_ctrl");
++ if (!res) {
++ dev_err(&pdev->dev, "no mii_ctrl resource found\n");
++ err = -ENXIO;
++ goto err_unmap_base2;
++ }
++
++ ag->mii_ctrl = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!ag->mii_ctrl) {
++ dev_err(&pdev->dev, "unable to ioremap mii_ctrl\n");
++ err = -ENOMEM;
++ goto err_unmap_base2;
++ }
++
++ dev->irq = platform_get_irq(pdev, 0);
++ err = request_irq(dev->irq, ag71xx_interrupt,
++ IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
++ dev->name, dev);
++ if (err) {
++ dev_err(&pdev->dev, "unable to request IRQ %d\n", dev->irq);
++ goto err_unmap_mii_ctrl;
++ }
++
++ dev->base_addr = (unsigned long)ag->mac_base;
++ dev->open = ag71xx_open;
++ dev->stop = ag71xx_stop;
++ dev->hard_start_xmit = ag71xx_hard_start_xmit;
++ dev->set_multicast_list = ag71xx_set_multicast_list;
++ dev->do_ioctl = ag71xx_do_ioctl;
++ dev->ethtool_ops = &ag71xx_ethtool_ops;
++
++ dev->tx_timeout = ag71xx_tx_timeout;
++ INIT_WORK(&ag->restart_work, ag71xx_restart_work_func);
++
++ init_timer(&ag->oom_timer);
++ ag->oom_timer.data = (unsigned long) dev;
++ ag->oom_timer.function = ag71xx_oom_timer_handler;
++
++ memcpy(dev->dev_addr, pdata->mac_addr, ETH_ALEN);
++
++ netif_napi_add(dev, &ag->napi, ag71xx_poll, AG71XX_NAPI_WEIGHT);
++
++ err = register_netdev(dev);
++ if (err) {
++ dev_err(&pdev->dev, "unable to register net device\n");
++ goto err_free_irq;
++ }
++
++ printk(KERN_INFO "%s: Atheros AG71xx at 0x%08lx, irq %d\n",
++ dev->name, dev->base_addr, dev->irq);
++
++ ag71xx_dump_regs(ag);
++
++ ag71xx_hw_init(ag);
++
++ ag71xx_dump_regs(ag);
++
++ /* Reset the mdio bus explicitly */
++ if (ag->mii_bus) {
++ mutex_lock(&ag->mii_bus->mdio_lock);
++ ag->mii_bus->reset(ag->mii_bus);
++ mutex_unlock(&ag->mii_bus->mdio_lock);
++ }
++
++ err = ag71xx_phy_connect(ag);
++ if (err)
++ goto err_unregister_netdev;
++
++ platform_set_drvdata(pdev, dev);
++
++ return 0;
++
++ err_unregister_netdev:
++ unregister_netdev(dev);
++ err_free_irq:
++ free_irq(dev->irq, dev);
++ err_unmap_mii_ctrl:
++ iounmap(ag->mii_ctrl);
++ err_unmap_base2:
++ iounmap(ag->mac_base2);
++ err_unmap_base1:
++ iounmap(ag->mac_base);
++ err_free_dev:
++ kfree(dev);
++ err_out:
++ platform_set_drvdata(pdev, NULL);
++ return err;
++}
++
++static int __exit ag71xx_remove(struct platform_device *pdev)
++{
++ struct net_device *dev = platform_get_drvdata(pdev);
++
++ if (dev) {
++ struct ag71xx *ag = netdev_priv(dev);
++
++ ag71xx_phy_disconnect(ag);
++ unregister_netdev(dev);
++ free_irq(dev->irq, dev);
++ iounmap(ag->mii_ctrl);
++ iounmap(ag->mac_base2);
++ iounmap(ag->mac_base);
++ kfree(dev);
++ platform_set_drvdata(pdev, NULL);
++ }
++
++ return 0;
++}
++
++static struct platform_driver ag71xx_driver = {
++ .probe = ag71xx_probe,
++ .remove = __exit_p(ag71xx_remove),
++ .driver = {
++ .name = AG71XX_DRV_NAME,
++ }
++};
++
++static int __init ag71xx_module_init(void)
++{
++ int ret;
++
++ ret = ag71xx_mdio_driver_init();
++ if (ret)
++ goto err_out;
++
++ ret = platform_driver_register(&ag71xx_driver);
++ if (ret)
++ goto err_mdio_exit;
++
++ return 0;
++
++ err_mdio_exit:
++ ag71xx_mdio_driver_exit();
++ err_out:
++ return ret;
++}
++
++static void __exit ag71xx_module_exit(void)
++{
++ platform_driver_unregister(&ag71xx_driver);
++ ag71xx_mdio_driver_exit();
++}
++
++module_init(ag71xx_module_init);
++module_exit(ag71xx_module_exit);
++
++MODULE_VERSION(AG71XX_DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:" AG71XX_DRV_NAME);
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_mdio.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_mdio.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_mdio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_mdio.c 2009-04-13 14:27:34.827084882 +0200
+@@ -0,0 +1,233 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++#define AG71XX_MDIO_RETRY 1000
++#define AG71XX_MDIO_DELAY 5
++
++struct ag71xx_mdio *ag71xx_mdio_bus;
++
++static inline void ag71xx_mdio_wr(struct ag71xx_mdio *am, unsigned reg,
++ u32 value)
++{
++ __raw_writel(value, am->mdio_base + reg - AG71XX_REG_MII_CFG);
++}
++
++static inline u32 ag71xx_mdio_rr(struct ag71xx_mdio *am, unsigned reg)
++{
++ return __raw_readl(am->mdio_base + reg - AG71XX_REG_MII_CFG);
++}
++
++static void ag71xx_mdio_dump_regs(struct ag71xx_mdio *am)
++{
++ DBG("%s: mii_cfg=%08x, mii_cmd=%08x, mii_addr=%08x\n",
++ am->mii_bus->name,
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_CFG),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_CMD),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_ADDR));
++ DBG("%s: mii_ctrl=%08x, mii_status=%08x, mii_ind=%08x\n",
++ am->mii_bus->name,
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_CTRL),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_STATUS),
++ ag71xx_mdio_rr(am, AG71XX_REG_MII_IND));
++}
++
++static int ag71xx_mdio_mii_read(struct ag71xx_mdio *am, int addr, int reg)
++{
++ int ret;
++ int i;
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CMD, MII_CMD_WRITE);
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_ADDR,
++ ((addr & 0xff) << MII_ADDR_SHIFT) | (reg & 0xff));
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CMD, MII_CMD_READ);
++
++ i = AG71XX_MDIO_RETRY;
++ while (ag71xx_mdio_rr(am, AG71XX_REG_MII_IND) & MII_IND_BUSY) {
++ if (i-- == 0) {
++ printk(KERN_ERR "%s: mii_read timed out\n",
++ am->mii_bus->name);
++ ret = 0xffff;
++ goto out;
++ }
++ udelay(AG71XX_MDIO_DELAY);
++ }
++
++ ret = ag71xx_mdio_rr(am, AG71XX_REG_MII_STATUS) & 0xffff;
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CMD, MII_CMD_WRITE);
++
++ DBG("mii_read: addr=%04x, reg=%04x, value=%04x\n", addr, reg, ret);
++
++ out:
++ return ret;
++}
++
++static void ag71xx_mdio_mii_write(struct ag71xx_mdio *am,
++ int addr, int reg, u16 val)
++{
++ int i;
++
++ DBG("mii_write: addr=%04x, reg=%04x, value=%04x\n", addr, reg, val);
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_ADDR,
++ ((addr & 0xff) << MII_ADDR_SHIFT) | (reg & 0xff));
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CTRL, val);
++
++ i = AG71XX_MDIO_RETRY;
++ while (ag71xx_mdio_rr(am, AG71XX_REG_MII_IND) & MII_IND_BUSY) {
++ if (i-- == 0) {
++ printk(KERN_ERR "%s: mii_write timed out\n",
++ am->mii_bus->name);
++ break;
++ }
++ udelay(AG71XX_MDIO_DELAY);
++ }
++}
++
++static int ag71xx_mdio_reset(struct mii_bus *bus)
++{
++ struct ag71xx_mdio *am = bus->priv;
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, MII_CFG_RESET);
++ udelay(100);
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, MII_CFG_CLK_DIV_28);
++ udelay(100);
++
++ return 0;
++}
++
++static int ag71xx_mdio_read(struct mii_bus *bus, int addr, int reg)
++{
++ struct ag71xx_mdio *am = bus->priv;
++
++ return ag71xx_mdio_mii_read(am, addr, reg);
++}
++
++static int ag71xx_mdio_write(struct mii_bus *bus, int addr, int reg, u16 val)
++{
++ struct ag71xx_mdio *am = bus->priv;
++
++ ag71xx_mdio_mii_write(am, addr, reg, val);
++ return 0;
++}
++
++static int __init ag71xx_mdio_probe(struct platform_device *pdev)
++{
++ struct ag71xx_mdio_platform_data *pdata;
++ struct ag71xx_mdio *am;
++ struct resource *res;
++ int i;
++ int err;
++
++ if (ag71xx_mdio_bus)
++ return -EBUSY;
++
++ am = kzalloc(sizeof(*am), GFP_KERNEL);
++ if (!am) {
++ err = -ENOMEM;
++ goto err_out;
++ }
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_err(&pdev->dev, "no iomem resource found\n");
++ err = -ENXIO;
++ goto err_out;
++ }
++
++ am->mdio_base = ioremap_nocache(res->start, res->end - res->start + 1);
++ if (!am->mdio_base) {
++ dev_err(&pdev->dev, "unable to ioremap registers\n");
++ err = -ENOMEM;
++ goto err_free_mdio;
++ }
++
++ am->mii_bus = mdiobus_alloc();
++ if (am->mii_bus == NULL) {
++ err = -ENOMEM;
++ goto err_iounmap;
++ }
++
++ am->mii_bus->name = "ag71xx_mdio";
++ am->mii_bus->read = ag71xx_mdio_read;
++ am->mii_bus->write = ag71xx_mdio_write;
++ am->mii_bus->reset = ag71xx_mdio_reset;
++ am->mii_bus->irq = am->mii_irq;
++ am->mii_bus->priv = am;
++ am->mii_bus->parent = &pdev->dev;
++ snprintf(am->mii_bus->id, MII_BUS_ID_SIZE, "%x", 0);
++
++ pdata = pdev->dev.platform_data;
++ if (pdata)
++ am->mii_bus->phy_mask = pdata->phy_mask;
++
++ for (i = 0; i < PHY_MAX_ADDR; i++)
++ am->mii_irq[i] = PHY_POLL;
++
++ ag71xx_mdio_wr(am, AG71XX_REG_MAC_CFG1, 0);
++
++ err = mdiobus_register(am->mii_bus);
++ if (err)
++ goto err_free_bus;
++
++ ag71xx_mdio_dump_regs(am);
++
++ platform_set_drvdata(pdev, am);
++ ag71xx_mdio_bus = am;
++ return 0;
++
++ err_free_bus:
++ mdiobus_free(am->mii_bus);
++ err_iounmap:
++ iounmap(am->mdio_base);
++ err_free_mdio:
++ kfree(am);
++ err_out:
++ return err;
++}
++
++static int __exit ag71xx_mdio_remove(struct platform_device *pdev)
++{
++ struct ag71xx_mdio *am = platform_get_drvdata(pdev);
++
++ if (am) {
++ ag71xx_mdio_bus = NULL;
++ mdiobus_unregister(am->mii_bus);
++ mdiobus_free(am->mii_bus);
++ iounmap(am->mdio_base);
++ kfree(am);
++ platform_set_drvdata(pdev, NULL);
++ }
++
++ return 0;
++}
++
++static struct platform_driver ag71xx_mdio_driver = {
++ .probe = ag71xx_mdio_probe,
++ .remove = __exit_p(ag71xx_mdio_remove),
++ .driver = {
++ .name = "ag71xx-mdio",
++ }
++};
++
++int ag71xx_mdio_driver_init(void)
++{
++ return platform_driver_register(&ag71xx_mdio_driver);
++}
++
++void ag71xx_mdio_driver_exit(void)
++{
++ platform_driver_unregister(&ag71xx_mdio_driver);
++}
+diff -Nur linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_phy.c linux-2.6.29.1/drivers/net/ag71xx/ag71xx_phy.c
+--- linux-2.6.29.1.orig/drivers/net/ag71xx/ag71xx_phy.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/ag71xx/ag71xx_phy.c 2009-04-13 14:27:34.827084882 +0200
+@@ -0,0 +1,287 @@
++/*
++ * Atheros AR71xx built-in ethernet mac driver
++ *
++ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Based on Atheros' AG7100 driver
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include "ag71xx.h"
++
++static unsigned char *ag71xx_speed_str(struct ag71xx *ag)
++{
++ switch (ag->speed) {
++ case SPEED_1000:
++ return "1000";
++ case SPEED_100:
++ return "100";
++ case SPEED_10:
++ return "10";
++ }
++
++ return "?";
++}
++
++#define AR71XX_PLL_VAL_1000 0x00110000
++#define AR71XX_PLL_VAL_100 0x00001099
++#define AR71XX_PLL_VAL_10 0x00991099
++
++#define AR91XX_PLL_VAL_1000 0x1a000000
++#define AR91XX_PLL_VAL_100 0x13000a44
++#define AR91XX_PLL_VAL_10 0x00441099
++
++static void ag71xx_phy_link_update(struct ag71xx *ag)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ u32 cfg2;
++ u32 ifctl;
++ u32 pll;
++ u32 fifo5;
++ u32 mii_speed;
++
++ if (!ag->link) {
++ netif_carrier_off(ag->dev);
++ if (netif_msg_link(ag))
++ printk(KERN_INFO "%s: link down\n", ag->dev->name);
++ return;
++ }
++
++ cfg2 = ag71xx_rr(ag, AG71XX_REG_MAC_CFG2);
++ cfg2 &= ~(MAC_CFG2_IF_1000 | MAC_CFG2_IF_10_100 | MAC_CFG2_FDX);
++ cfg2 |= (ag->duplex) ? MAC_CFG2_FDX : 0;
++
++ ifctl = ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL);
++ ifctl &= ~(MAC_IFCTL_SPEED);
++
++ fifo5 = ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5);
++ fifo5 &= ~FIFO_CFG5_BM;
++
++ switch (ag->speed) {
++ case SPEED_1000:
++ mii_speed = MII_CTRL_SPEED_1000;
++ cfg2 |= MAC_CFG2_IF_1000;
++ pll = pdata->is_ar91xx ? AR91XX_PLL_VAL_1000
++ : AR71XX_PLL_VAL_1000;
++ fifo5 |= FIFO_CFG5_BM;
++ break;
++ case SPEED_100:
++ mii_speed = MII_CTRL_SPEED_100;
++ cfg2 |= MAC_CFG2_IF_10_100;
++ ifctl |= MAC_IFCTL_SPEED;
++ pll = pdata->is_ar91xx ? AR91XX_PLL_VAL_100
++ : AR71XX_PLL_VAL_100;
++ break;
++ case SPEED_10:
++ mii_speed = MII_CTRL_SPEED_10;
++ cfg2 |= MAC_CFG2_IF_10_100;
++ pll = pdata->is_ar91xx ? AR91XX_PLL_VAL_10
++ : AR71XX_PLL_VAL_10;
++ break;
++ default:
++ BUG();
++ return;
++ }
++
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG3,
++ pdata->is_ar91xx ? 0x780fff : 0x008001ff);
++ pdata->set_pll(pll);
++ ag71xx_mii_ctrl_set_speed(ag, mii_speed);
++
++ ag71xx_wr(ag, AG71XX_REG_MAC_CFG2, cfg2);
++ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, fifo5);
++ ag71xx_wr(ag, AG71XX_REG_MAC_IFCTL, ifctl);
++
++ netif_carrier_on(ag->dev);
++ if (netif_msg_link(ag))
++ printk(KERN_INFO "%s: link up (%sMbps/%s duplex)\n",
++ ag->dev->name,
++ ag71xx_speed_str(ag),
++ (DUPLEX_FULL == ag->duplex) ? "Full" : "Half");
++
++ DBG("%s: fifo_cfg0=%#x, fifo_cfg1=%#x, fifo_cfg2=%#x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG0),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG1),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG2));
++
++ DBG("%s: fifo_cfg3=%#x, fifo_cfg4=%#x, fifo_cfg5=%#x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG3),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG4),
++ ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
++
++ DBG("%s: mac_cfg2=%#x, mac_ifctl=%#x, mii_ctrl=%#x\n",
++ ag->dev->name,
++ ag71xx_rr(ag, AG71XX_REG_MAC_CFG2),
++ ag71xx_rr(ag, AG71XX_REG_MAC_IFCTL),
++ ag71xx_mii_ctrl_rr(ag));
++}
++
++static void ag71xx_phy_link_adjust(struct net_device *dev)
++{
++ struct ag71xx *ag = netdev_priv(dev);
++ struct phy_device *phydev = ag->phy_dev;
++ unsigned long flags;
++ int status_change = 0;
++
++ spin_lock_irqsave(&ag->lock, flags);
++
++ if (phydev->link) {
++ if (ag->duplex != phydev->duplex
++ || ag->speed != phydev->speed) {
++ status_change = 1;
++ }
++ }
++
++ if (phydev->link != ag->link)
++ status_change = 1;
++
++ ag->link = phydev->link;
++ ag->duplex = phydev->duplex;
++ ag->speed = phydev->speed;
++
++ if (status_change)
++ ag71xx_phy_link_update(ag);
++
++ spin_unlock_irqrestore(&ag->lock, flags);
++}
++
++void ag71xx_phy_start(struct ag71xx *ag)
++{
++ if (ag->phy_dev) {
++ phy_start(ag->phy_dev);
++ } else {
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ ag->duplex = pdata->duplex;
++ ag->speed = pdata->speed;
++ ag->link = 1;
++ ag71xx_phy_link_update(ag);
++ }
++}
++
++void ag71xx_phy_stop(struct ag71xx *ag)
++{
++ if (ag->phy_dev) {
++ phy_stop(ag->phy_dev);
++ } else {
++ ag->duplex = -1;
++ ag->link = 0;
++ ag->speed = 0;
++ ag71xx_phy_link_update(ag);
++ }
++}
++
++static int ag71xx_phy_connect_fixed(struct ag71xx *ag)
++{
++ struct net_device *dev = ag->dev;
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ int ret = 0;
++
++ /* use fixed settings */
++ switch (pdata->speed) {
++ case SPEED_10:
++ case SPEED_100:
++ case SPEED_1000:
++ break;
++ default:
++ printk(KERN_ERR "%s: invalid speed specified\n",
++ dev->name);
++ ret = -EINVAL;
++ break;
++ }
++
++ return ret;
++}
++
++static int ag71xx_phy_connect_multi(struct ag71xx *ag)
++{
++ struct net_device *dev = ag->dev;
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++ struct phy_device *phydev = NULL;
++ int phy_count = 0;
++ int phy_addr;
++ int ret = 0;
++
++ for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
++ if (!(pdata->phy_mask & (1 << phy_addr)))
++ continue;
++
++ if (ag->mii_bus->phy_map[phy_addr] == NULL)
++ continue;
++
++ DBG("%s: PHY found at %s, uid=%08x\n",
++ dev->name,
++ ag->mii_bus->phy_map[phy_addr]->dev.bus_id,
++ ag->mii_bus->phy_map[phy_addr]->phy_id);
++
++ if (phydev == NULL)
++ phydev = ag->mii_bus->phy_map[phy_addr];
++
++ phy_count++;
++ }
++
++ switch (phy_count) {
++ case 0:
++ printk(KERN_ERR "%s: no PHY found with phy_mask=%08x\n",
++ dev->name, pdata->phy_mask);
++ ret = -ENODEV;
++ break;
++ case 1:
++ ag->phy_dev = phy_connect(dev, phydev->dev.bus_id,
++ &ag71xx_phy_link_adjust, 0, pdata->phy_if_mode);
++
++ if (IS_ERR(ag->phy_dev)) {
++ printk(KERN_ERR "%s: could not connect to PHY at %s\n",
++ dev->name, phydev->dev.bus_id);
++ return PTR_ERR(ag->phy_dev);
++ }
++
++ /* mask with MAC supported features */
++ if (pdata->has_gbit)
++ phydev->supported &= PHY_GBIT_FEATURES;
++ else
++ phydev->supported &= PHY_BASIC_FEATURES;
++
++ phydev->advertising = phydev->supported;
++
++ printk(KERN_DEBUG "%s: connected to PHY at %s "
++ "[uid=%08x, driver=%s]\n",
++ dev->name, phydev->dev.bus_id,
++ phydev->phy_id, phydev->drv->name);
++
++ ag->link = 0;
++ ag->speed = 0;
++ ag->duplex = -1;
++ break;
++
++ default:
++ printk(KERN_DEBUG "%s: connected to %d PHYs\n",
++ dev->name, phy_count);
++ ret = ag71xx_phy_connect_fixed(ag);
++ break;
++ }
++
++ return ret;
++}
++
++int ag71xx_phy_connect(struct ag71xx *ag)
++{
++ struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
++
++ if (pdata->phy_mask)
++ return ag71xx_phy_connect_multi(ag);
++
++ return ag71xx_phy_connect_fixed(ag);
++}
++
++void ag71xx_phy_disconnect(struct ag71xx *ag)
++{
++ if (ag->phy_dev)
++ phy_disconnect(ag->phy_dev);
++}
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/micrel.c linux-2.6.29.1/drivers/net/phy/micrel.c
+--- linux-2.6.29.1.orig/drivers/net/phy/micrel.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/phy/micrel.c 2009-04-13 14:27:34.831085671 +0200
+@@ -0,0 +1,82 @@
++/*
++ * Driver for Micrel/Kendin PHYs
++ *
++ * Copyright (c) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#include <linux/delay.h>
++#include <linux/skbuff.h>
++#include <linux/phy.h>
++
++#define KSZ_REG_INT_CTRL 0x1b
++
++#define KSZ_INT_LU_EN (1 << 8) /* enable Link Up interrupt */
++#define KSZ_INT_RF_EN (1 << 9) /* enable Remote Fault interrupt */
++#define KSZ_INT_LD_EN (1 << 10) /* enable Link Down interrupt */
++
++#define KSZ_INT_INIT (KSZ_INT_LU_EN | KSZ_INT_LD_EN)
++
++static int ksz8041_ack_interrupt(struct phy_device *phydev)
++{
++ int err;
++
++ err = phy_read(phydev, KSZ_REG_INT_CTRL);
++
++ return (err < 0) ? err : 0;
++}
++
++static int ksz8041_config_intr(struct phy_device *phydev)
++{
++ int err;
++
++ if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
++ err = phy_write(phydev, KSZ_REG_INT_CTRL,
++ KSZ_INT_INIT);
++ else
++ err = phy_write(phydev, KSZ_REG_INT_CTRL, 0);
++
++ return err;
++}
++
++static struct phy_driver ksz8041_phy_driver = {
++ .phy_id = 0x00221512,
++ .name = "Micrel KSZ8041",
++ .phy_id_mask = 0x001fffff,
++ .features = PHY_BASIC_FEATURES,
++ .flags = PHY_HAS_INTERRUPT,
++ .config_aneg = genphy_config_aneg,
++ .read_status = genphy_read_status,
++ .ack_interrupt = ksz8041_ack_interrupt,
++ .config_intr = ksz8041_config_intr,
++ .driver = {
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init micrel_phy_init(void)
++{
++ return phy_driver_register(&ksz8041_phy_driver);
++}
++
++static void __exit micrel_phy_exit(void)
++{
++ phy_driver_unregister(&ksz8041_phy_driver);
++}
++
++#ifdef MODULE
++module_init(micrel_phy_init);
++module_exit(micrel_phy_exit);
++#else
++subsys_initcall(micrel_phy_init);
++#endif
++
++MODULE_DESCRIPTION("Micrel/Kendin PHY driver");
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/phy.c linux-2.6.29.1/drivers/net/phy/phy.c
+--- linux-2.6.29.1.orig/drivers/net/phy/phy.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/phy/phy.c 2009-04-13 17:29:36.946673592 +0200
+@@ -299,6 +299,50 @@
+ }
+ EXPORT_SYMBOL(phy_ethtool_gset);
+
++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr)
++{
++ u32 cmd;
++ int tmp;
++ struct ethtool_cmd ecmd = { ETHTOOL_GSET };
++ struct ethtool_value edata = { ETHTOOL_GLINK };
++
++ if (get_user(cmd, (u32 *) useraddr))
++ return -EFAULT;
++
++ switch (cmd) {
++ case ETHTOOL_GSET:
++ phy_ethtool_gset(phydev, &ecmd);
++ if (copy_to_user(useraddr, &ecmd, sizeof(ecmd)))
++ return -EFAULT;
++ return 0;
++
++ case ETHTOOL_SSET:
++ if (copy_from_user(&ecmd, useraddr, sizeof(ecmd)))
++ return -EFAULT;
++ return phy_ethtool_sset(phydev, &ecmd);
++
++ case ETHTOOL_NWAY_RST:
++ /* if autoneg is off, it's an error */
++ tmp = phy_read(phydev, MII_BMCR);
++ if (tmp & BMCR_ANENABLE) {
++ tmp |= (BMCR_ANRESTART);
++ phy_write(phydev, MII_BMCR, tmp);
++ return 0;
++ }
++ return -EINVAL;
++
++ case ETHTOOL_GLINK:
++ edata.data = (phy_read(phydev,
++ MII_BMSR) & BMSR_LSTATUS) ? 1 : 0;
++ if (copy_to_user(useraddr, &edata, sizeof(edata)))
++ return -EFAULT;
++ return 0;
++ }
++
++ return -EOPNOTSUPP;
++}
++EXPORT_SYMBOL(phy_ethtool_ioctl);
++
+ /**
+ * phy_mii_ioctl - generic PHY MII ioctl interface
+ * @phydev: the phy_device struct
+@@ -355,8 +399,8 @@
+ }
+
+ phy_write(phydev, mii_data->reg_num, val);
+-
+- if (mii_data->reg_num == MII_BMCR
++
++ if (mii_data->reg_num == MII_BMCR
+ && val & BMCR_RESET
+ && phydev->drv->config_init) {
+ phy_scan_fixups(phydev);
+@@ -476,7 +520,7 @@
+ int idx;
+
+ idx = phy_find_setting(phydev->speed, phydev->duplex);
+-
++
+ idx++;
+
+ idx = phy_find_valid(idx, phydev->supported);
+diff -Nur linux-2.6.29.1.orig/drivers/spi/Kconfig linux-2.6.29.1/drivers/spi/Kconfig
+--- linux-2.6.29.1.orig/drivers/spi/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/spi/Kconfig 2009-04-13 14:27:34.831085671 +0200
+@@ -53,6 +53,13 @@
+
+ comment "SPI Master Controller Drivers"
+
++config SPI_AR71XX
++ tristate "Atheros AR71xx SPI Controller"
++ depends on SPI_MASTER && ATHEROS_AR71XX
++ select SPI_BITBANG
++ help
++ This is the SPI contoller driver for Atheros AR71xx.
++
+ config SPI_ATMEL
+ tristate "Atmel SPI Controller"
+ depends on (ARCH_AT91 || AVR32)
+diff -Nur linux-2.6.29.1.orig/drivers/spi/Makefile linux-2.6.29.1/drivers/spi/Makefile
+--- linux-2.6.29.1.orig/drivers/spi/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/spi/Makefile 2009-04-13 14:27:34.835086738 +0200
+@@ -11,6 +11,7 @@
+ obj-$(CONFIG_SPI_MASTER) += spi.o
+
+ # SPI master controller drivers (bus)
++obj-$(CONFIG_SPI_AR71XX) += ar71xx_spi.o
+ obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o
+ obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o
+ obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o
+diff -Nur linux-2.6.29.1.orig/drivers/spi/ar71xx_spi.c linux-2.6.29.1/drivers/spi/ar71xx_spi.c
+--- linux-2.6.29.1.orig/drivers/spi/ar71xx_spi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/spi/ar71xx_spi.c 2009-04-13 14:27:34.855087329 +0200
+@@ -0,0 +1,240 @@
++/*
++ * Atheros AR71xx SPI Controller driver
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/delay.h>
++#include <linux/spinlock.h>
++#include <linux/workqueue.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <linux/spi/spi.h>
++#include <linux/spi/spi_bitbang.h>
++#include <linux/bitops.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++#include <asm/mach-ar71xx/platform.h>
++
++#define DRV_DESC "Atheros AR71xx SPI Controller driver"
++#define DRV_VERSION "0.2.2"
++#define DRV_NAME "ar71xx-spi"
++
++#undef PER_BIT_READ
++
++struct ar71xx_spi {
++ struct spi_bitbang bitbang;
++ u32 ioc_base;
++ u32 reg_ctrl;
++
++ void __iomem *base;
++
++ struct platform_device *pdev;
++ u32 (*get_ioc_base)(u8 chip_select, int cs_high,
++ int is_on);
++};
++
++static inline u32 ar71xx_spi_rr(struct ar71xx_spi *sp, unsigned reg)
++{
++ return __raw_readl(sp->base + reg);
++}
++
++static inline void ar71xx_spi_wr(struct ar71xx_spi *sp, unsigned reg, u32 val)
++{
++ __raw_writel(val, sp->base + reg);
++}
++
++static inline struct ar71xx_spi *spidev_to_sp(struct spi_device *spi)
++{
++ return spi_master_get_devdata(spi->master);
++}
++
++static u32 ar71xx_spi_get_ioc_base(u8 chip_select, int cs_high, int is_on)
++{
++ u32 ret;
++
++ if (is_on == AR71XX_SPI_CS_INACTIVE)
++ ret = SPI_IOC_CS_ALL;
++ else
++ ret = SPI_IOC_CS_ALL & ~SPI_IOC_CS(chip_select);
++
++ return ret;
++}
++
++static void ar71xx_spi_chipselect(struct spi_device *spi, int value)
++{
++ struct ar71xx_spi *sp = spidev_to_sp(spi);
++ void __iomem *base = sp->base;
++ u32 ioc_base;
++
++ switch (value) {
++ case BITBANG_CS_INACTIVE:
++ ioc_base = sp->get_ioc_base(spi->chip_select,
++ (spi->mode & SPI_CS_HIGH) != 0,
++ AR71XX_SPI_CS_INACTIVE);
++
++ __raw_writel(ioc_base, base + SPI_REG_IOC);
++ __raw_writel(sp->reg_ctrl, base + SPI_REG_CTRL);
++ __raw_writel(0, base + SPI_REG_FS);
++ break;
++
++ case BITBANG_CS_ACTIVE:
++ ioc_base = sp->get_ioc_base(spi->chip_select,
++ (spi->mode & SPI_CS_HIGH) != 0,
++ AR71XX_SPI_CS_ACTIVE);
++
++ __raw_writel(SPI_FS_GPIO, base + SPI_REG_FS);
++ /* TODO: setup speed */
++ __raw_writel(0x43, base + SPI_REG_CTRL);
++ __raw_writel(ioc_base, base + SPI_REG_IOC);
++ sp->ioc_base = ioc_base;
++ break;
++ }
++}
++
++static u32 ar71xx_spi_txrx_mode0(struct spi_device *spi, unsigned nsecs,
++ u32 word, u8 bits)
++{
++ struct ar71xx_spi *sp = spidev_to_sp(spi);
++ void __iomem *base = sp->base;
++ u32 ioc = sp->ioc_base;
++ u32 ret;
++
++ /* clock starts at inactive polarity */
++ for (word <<= (32 - bits); likely(bits); bits--) {
++ u32 out;
++
++ if (word & (1 << 31))
++ out = ioc | SPI_IOC_DO;
++ else
++ out = ioc & ~SPI_IOC_DO;
++
++ /* setup MSB (to slave) on trailing edge */
++ __raw_writel(out, base + SPI_REG_IOC);
++
++ __raw_writel(out | SPI_IOC_CLK, base + SPI_REG_IOC);
++
++ word <<= 1;
++
++#ifdef PER_BIT_READ
++ /* sample MSB (from slave) on leading edge */
++ ret = __raw_readl(base + SPI_REG_RDS);
++ __raw_writel(out, base + SPI_REG_IOC);
++#endif
++
++ }
++
++#ifndef PER_BIT_READ
++ ret = __raw_readl(base + SPI_REG_RDS);
++#endif
++ return ret;
++}
++
++static int ar71xx_spi_probe(struct platform_device *pdev)
++{
++ struct spi_master *master;
++ struct ar71xx_spi *sp;
++ struct ar71xx_spi_platform_data *pdata;
++ struct resource *r;
++ int ret;
++
++ master = spi_alloc_master(&pdev->dev, sizeof(*sp));
++ if (master == NULL) {
++ dev_err(&pdev->dev, "failed to allocate spi master\n");
++ return -ENOMEM;
++ }
++
++ sp = spi_master_get_devdata(master);
++ platform_set_drvdata(pdev, sp);
++
++ pdata = pdev->dev.platform_data;
++
++ sp->bitbang.master = spi_master_get(master);
++ sp->bitbang.chipselect = ar71xx_spi_chipselect;
++ sp->bitbang.txrx_word[SPI_MODE_0] = ar71xx_spi_txrx_mode0;
++
++ sp->get_ioc_base = ar71xx_spi_get_ioc_base;
++ if (pdata) {
++ sp->bitbang.master->bus_num = pdata->bus_num;
++ sp->bitbang.master->num_chipselect = pdata->num_chipselect;
++ if (pdata->get_ioc_base)
++ sp->get_ioc_base = pdata->get_ioc_base;
++ } else {
++ sp->bitbang.master->bus_num = 0;
++ sp->bitbang.master->num_chipselect = 3;
++ }
++
++ r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (r == NULL) {
++ ret = -ENOENT;
++ goto err1;
++ }
++
++ sp->base = ioremap_nocache(r->start, r->end - r->start + 1);
++ if (!sp->base) {
++ ret = -ENXIO;
++ goto err1;
++ }
++
++ sp->reg_ctrl = ar71xx_spi_rr(sp, SPI_REG_IOC);
++
++ ret = spi_bitbang_start(&sp->bitbang);
++ if (!ret)
++ return 0;
++
++ iounmap(sp->base);
++err1:
++ platform_set_drvdata(pdev, NULL);
++ spi_master_put(sp->bitbang.master);
++
++ return ret;
++}
++
++static int ar71xx_spi_remove(struct platform_device *pdev)
++{
++ struct ar71xx_spi *sp = platform_get_drvdata(pdev);
++
++ spi_bitbang_stop(&sp->bitbang);
++ iounmap(sp->base);
++ platform_set_drvdata(pdev, NULL);
++ spi_master_put(sp->bitbang.master);
++
++ return 0;
++}
++
++static struct platform_driver ar71xx_spi_drv = {
++ .probe = ar71xx_spi_probe,
++ .remove = ar71xx_spi_remove,
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init ar71xx_spi_init(void)
++{
++ printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
++ return platform_driver_register(&ar71xx_spi_drv);
++}
++module_init(ar71xx_spi_init);
++
++static void __exit ar71xx_spi_exit(void)
++{
++ platform_driver_unregister(&ar71xx_spi_drv);
++}
++module_exit(ar71xx_spi_exit);
++
++MODULE_ALIAS("platform:" DRV_NAME);
++MODULE_DESCRIPTION(DRV_DESC);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org>");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/Kconfig linux-2.6.29.1/drivers/usb/host/Kconfig
+--- linux-2.6.29.1.orig/drivers/usb/host/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/host/Kconfig 2009-04-13 14:27:34.855087329 +0200
+@@ -81,6 +81,12 @@
+ depends on USB_EHCI_HCD && (440EPX || ARCH_IXP4XX)
+ default y
+
++config USB_EHCI_AR71XX
++ bool "USB EHCI support for AR71xx"
++ depends on USB_EHCI_HCD && ATHEROS_AR71XX
++ help
++ Support for Atheros AR71xx built-in EHCI controller
++
+ config USB_EHCI_FSL
+ bool "Support for Freescale on-chip EHCI USB controller"
+ depends on USB_EHCI_HCD && FSL_SOC
+@@ -154,6 +160,12 @@
+ To compile this driver as a module, choose M here: the
+ module will be called ohci-hcd.
+
++config USB_OHCI_AR71XX
++ bool "USB OHCI support for Atheros AR71xx"
++ depends on USB_OHCI_HCD && ATHEROS_AR71XX
++ help
++ Support for Atheros AR71xx built-in OHCI controller
++
+ config USB_OHCI_HCD_PPC_SOC
+ bool "OHCI support for on-chip PPC USB controller"
+ depends on USB_OHCI_HCD && (STB03xxx || PPC_MPC52xx)
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ehci-ar71xx.c linux-2.6.29.1/drivers/usb/host/ehci-ar71xx.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ehci-ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/usb/host/ehci-ar71xx.c 2009-04-13 14:27:34.859087838 +0200
+@@ -0,0 +1,235 @@
++/*
++ * Bus Glue for Atheros AR71xx built-in EHCI controller.
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ * Copyright (C) 2007 Atheros Communications, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++
++#include <asm/mach-ar71xx/platform.h>
++
++extern int usb_disabled(void);
++
++static int ehci_ar71xx_init(struct usb_hcd *hcd)
++{
++ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
++ int ret;
++
++ ehci->caps = hcd->regs;
++ ehci->regs = hcd->regs +
++ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
++ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
++
++ ehci->sbrn = 0x20;
++
++ ehci_reset(ehci);
++
++ ret = ehci_init(hcd);
++ if (ret)
++ return ret;
++
++ ehci_port_power(ehci, 0);
++
++ return 0;
++}
++
++static int ehci_ar91xx_init(struct usb_hcd *hcd)
++{
++ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
++ int ret;
++
++ ehci->caps = hcd->regs + 0x100;
++ ehci->regs = hcd->regs + 0x100 +
++ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
++ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
++
++ hcd->has_tt = 1;
++ ehci->sbrn = 0x20;
++
++ ehci_reset(ehci);
++
++ ret = ehci_init(hcd);
++ if (ret)
++ return ret;
++
++ ehci_port_power(ehci, 0);
++
++ return 0;
++}
++
++static int ehci_ar71xx_probe(const struct hc_driver *driver,
++ struct usb_hcd **hcd_out,
++ struct platform_device *pdev)
++{
++ struct usb_hcd *hcd;
++ struct resource *res;
++ int irq;
++ int ret;
++
++ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no IRQ specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++ irq = res->start;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no base address specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++
++ hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
++ if (!hcd)
++ return -ENOMEM;
++
++ hcd->rsrc_start = res->start;
++ hcd->rsrc_len = res->end - res->start + 1;
++
++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
++ dev_dbg(&pdev->dev, "controller already in use\n");
++ ret = -EBUSY;
++ goto err_put_hcd;
++ }
++
++ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
++ if (!hcd->regs) {
++ dev_dbg(&pdev->dev, "error mapping memory\n");
++ ret = -EFAULT;
++ goto err_release_region;
++ }
++
++ ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
++ if (ret)
++ goto err_iounmap;
++
++ return 0;
++
++ err_iounmap:
++ iounmap(hcd->regs);
++
++ err_release_region:
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ err_put_hcd:
++ usb_put_hcd(hcd);
++ return ret;
++}
++
++static void ehci_ar71xx_remove(struct usb_hcd *hcd,
++ struct platform_device *pdev)
++{
++ usb_remove_hcd(hcd);
++ iounmap(hcd->regs);
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ usb_put_hcd(hcd);
++}
++
++static const struct hc_driver ehci_ar71xx_hc_driver = {
++ .description = hcd_name,
++ .product_desc = "Atheros AR71xx built-in EHCI controller",
++ .hcd_priv_size = sizeof(struct ehci_hcd),
++
++ .irq = ehci_irq,
++ .flags = HCD_MEMORY | HCD_USB2,
++
++ .reset = ehci_ar71xx_init,
++ .start = ehci_run,
++ .stop = ehci_stop,
++ .shutdown = ehci_shutdown,
++
++ .urb_enqueue = ehci_urb_enqueue,
++ .urb_dequeue = ehci_urb_dequeue,
++ .endpoint_disable = ehci_endpoint_disable,
++
++ .get_frame_number = ehci_get_frame,
++
++ .hub_status_data = ehci_hub_status_data,
++ .hub_control = ehci_hub_control,
++#ifdef CONFIG_PM
++ .hub_suspend = ehci_hub_suspend,
++ .hub_resume = ehci_hub_resume,
++#endif
++ .relinquish_port = ehci_relinquish_port,
++ .port_handed_over = ehci_port_handed_over,
++};
++
++static const struct hc_driver ehci_ar91xx_hc_driver = {
++ .description = hcd_name,
++ .product_desc = "Atheros AR91xx built-in EHCI controller",
++ .hcd_priv_size = sizeof(struct ehci_hcd),
++ .irq = ehci_irq,
++ .flags = HCD_MEMORY | HCD_USB2,
++
++ .reset = ehci_ar91xx_init,
++ .start = ehci_run,
++ .stop = ehci_stop,
++ .shutdown = ehci_shutdown,
++
++ .urb_enqueue = ehci_urb_enqueue,
++ .urb_dequeue = ehci_urb_dequeue,
++ .endpoint_disable = ehci_endpoint_disable,
++
++ .get_frame_number = ehci_get_frame,
++
++ .hub_status_data = ehci_hub_status_data,
++ .hub_control = ehci_hub_control,
++#ifdef CONFIG_PM
++ .hub_suspend = ehci_hub_suspend,
++ .hub_resume = ehci_hub_resume,
++#endif
++ .relinquish_port = ehci_relinquish_port,
++ .port_handed_over = ehci_port_handed_over,
++};
++
++static int ehci_ar71xx_driver_probe(struct platform_device *pdev)
++{
++ struct ar71xx_ehci_platform_data *pdata;
++ struct usb_hcd *hcd = NULL;
++ int ret;
++
++ if (usb_disabled())
++ return -ENODEV;
++
++ pdata = pdev->dev.platform_data;
++ if (!pdata) {
++ dev_err(&pdev->dev, "no platform data specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++
++ if (pdata->is_ar91xx)
++ ret = ehci_ar71xx_probe(&ehci_ar91xx_hc_driver, &hcd, pdev);
++ else
++ ret = ehci_ar71xx_probe(&ehci_ar71xx_hc_driver, &hcd, pdev);
++
++ return ret;
++}
++
++static int ehci_ar71xx_driver_remove(struct platform_device *pdev)
++{
++ struct usb_hcd *hcd = platform_get_drvdata(pdev);
++
++ ehci_ar71xx_remove(hcd, pdev);
++ return 0;
++}
++
++MODULE_ALIAS("platform:ar71xx-ehci");
++
++static struct platform_driver ehci_ar71xx_driver = {
++ .probe = ehci_ar71xx_driver_probe,
++ .remove = ehci_ar71xx_driver_remove,
++ .driver = {
++ .name = "ar71xx-ehci",
++ }
++};
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ehci-hcd.c linux-2.6.29.1/drivers/usb/host/ehci-hcd.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ehci-hcd.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/host/ehci-hcd.c 2009-04-13 14:27:34.859087838 +0200
+@@ -1036,6 +1036,11 @@
+ #define PLATFORM_DRIVER ixp4xx_ehci_driver
+ #endif
+
++#ifdef CONFIG_USB_EHCI_AR71XX
++#include "ehci-ar71xx.c"
++#define PLATFORM_DRIVER ehci_ar71xx_driver
++#endif
++
+ #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
+ !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER)
+ #error "missing bus glue for ehci-hcd"
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ohci-ar71xx.c linux-2.6.29.1/drivers/usb/host/ohci-ar71xx.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ohci-ar71xx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/usb/host/ohci-ar71xx.c 2009-04-13 14:27:34.887088611 +0200
+@@ -0,0 +1,165 @@
++/*
++ * OHCI HCD (Host Controller Driver) for USB.
++ *
++ * Bus Glue for Atheros AR71xx built-in OHCI controller.
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * Parts of this file are based on Atheros' 2.6.15 BSP
++ * Copyright (C) 2007 Atheros Communications, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++
++extern int usb_disabled(void);
++
++static int usb_hcd_ar71xx_probe(const struct hc_driver *driver,
++ struct platform_device *pdev)
++{
++ struct usb_hcd *hcd;
++ struct resource *res;
++ int irq;
++ int ret;
++
++ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no IRQ specified for %s\n",
++ pdev->dev.bus_id);
++ return -ENODEV;
++ }
++ irq = res->start;
++
++ hcd = usb_create_hcd(driver, &pdev->dev, pdev->dev.bus_id);
++ if (!hcd)
++ return -ENOMEM;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!res) {
++ dev_dbg(&pdev->dev, "no base address specified for %s\n",
++ pdev->dev.bus_id);
++ ret = -ENODEV;
++ goto err_put_hcd;
++ }
++ hcd->rsrc_start = res->start;
++ hcd->rsrc_len = res->end - res->start + 1;
++
++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
++ dev_dbg(&pdev->dev, "controller already in use\n");
++ ret = -EBUSY;
++ goto err_put_hcd;
++ }
++
++ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
++ if (!hcd->regs) {
++ dev_dbg(&pdev->dev, "error mapping memory\n");
++ ret = -EFAULT;
++ goto err_release_region;
++ }
++
++ ohci_hcd_init(hcd_to_ohci(hcd));
++
++ ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
++ if (ret)
++ goto err_stop_hcd;
++
++ return 0;
++
++ err_stop_hcd:
++ iounmap(hcd->regs);
++ err_release_region:
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ err_put_hcd:
++ usb_put_hcd(hcd);
++ return ret;
++}
++
++void usb_hcd_ar71xx_remove(struct usb_hcd *hcd, struct platform_device *pdev)
++{
++ usb_remove_hcd(hcd);
++ iounmap(hcd->regs);
++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
++ usb_put_hcd(hcd);
++}
++
++static int __devinit ohci_ar71xx_start(struct usb_hcd *hcd)
++{
++ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
++ int ret;
++
++ ret = ohci_init(ohci);
++ if (ret < 0)
++ return ret;
++
++ ret = ohci_run(ohci);
++ if (ret < 0)
++ goto err;
++
++ return 0;
++
++ err:
++ ohci_stop(hcd);
++ return ret;
++}
++
++static const struct hc_driver ohci_ar71xx_hc_driver = {
++ .description = hcd_name,
++ .product_desc = "Atheros AR71xx built-in OHCI controller",
++ .hcd_priv_size = sizeof(struct ohci_hcd),
++
++ .irq = ohci_irq,
++ .flags = HCD_USB11 | HCD_MEMORY,
++
++ .start = ohci_ar71xx_start,
++ .stop = ohci_stop,
++ .shutdown = ohci_shutdown,
++
++ .urb_enqueue = ohci_urb_enqueue,
++ .urb_dequeue = ohci_urb_dequeue,
++ .endpoint_disable = ohci_endpoint_disable,
++
++ /*
++ * scheduling support
++ */
++ .get_frame_number = ohci_get_frame,
++
++ /*
++ * root hub support
++ */
++ .hub_status_data = ohci_hub_status_data,
++ .hub_control = ohci_hub_control,
++ .start_port_reset = ohci_start_port_reset,
++};
++
++static int ohci_hcd_ar71xx_drv_probe(struct platform_device *pdev)
++{
++ if (usb_disabled())
++ return -ENODEV;
++
++ return usb_hcd_ar71xx_probe(&ohci_ar71xx_hc_driver, pdev);
++}
++
++static int ohci_hcd_ar71xx_drv_remove(struct platform_device *pdev)
++{
++ struct usb_hcd *hcd = platform_get_drvdata(pdev);
++
++ usb_hcd_ar71xx_remove(hcd, pdev);
++ return 0;
++}
++
++MODULE_ALIAS("platform:ar71xx-ohci");
++
++static struct platform_driver ohci_hcd_ar71xx_driver = {
++ .probe = ohci_hcd_ar71xx_drv_probe,
++ .remove = ohci_hcd_ar71xx_drv_remove,
++ .shutdown = usb_hcd_platform_shutdown,
++ .driver = {
++ .name = "ar71xx-ohci",
++ .owner = THIS_MODULE,
++ },
++};
+diff -Nur linux-2.6.29.1.orig/drivers/usb/host/ohci-hcd.c linux-2.6.29.1/drivers/usb/host/ohci-hcd.c
+--- linux-2.6.29.1.orig/drivers/usb/host/ohci-hcd.c 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/usb/host/ohci-hcd.c 2009-04-13 14:27:34.887088611 +0200
+@@ -1080,6 +1080,11 @@
+ #define TMIO_OHCI_DRIVER ohci_hcd_tmio_driver
+ #endif
+
++#ifdef CONFIG_USB_OHCI_AR71XX
++#include "ohci-ar71xx.c"
++#define PLATFORM_DRIVER ohci_hcd_ar71xx_driver
++#endif
++
+ #if !defined(PCI_DRIVER) && \
+ !defined(PLATFORM_DRIVER) && \
+ !defined(OF_PLATFORM_DRIVER) && \
+diff -Nur linux-2.6.29.1.orig/drivers/watchdog/Kconfig linux-2.6.29.1/drivers/watchdog/Kconfig
+--- linux-2.6.29.1.orig/drivers/watchdog/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/watchdog/Kconfig 2009-04-13 14:27:34.891089680 +0200
+@@ -766,6 +766,13 @@
+ help
+ Hardware driver for the built-in watchdog timer on TXx9 MIPS SoCs.
+
++config AR71XX_WDT
++ tristate "Atheros AR71xx Watchdog Timer"
++ depends on ATHEROS_AR71XX
++ help
++ Hardware driver for the built-in watchdog timer on the Atheros
++ AR71xx SoCs.
++
+ # PARISC Architecture
+
+ # POWERPC Architecture
+diff -Nur linux-2.6.29.1.orig/drivers/watchdog/Makefile linux-2.6.29.1/drivers/watchdog/Makefile
+--- linux-2.6.29.1.orig/drivers/watchdog/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/watchdog/Makefile 2009-04-13 14:27:34.891089680 +0200
+@@ -107,6 +107,7 @@
+ obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
+ obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
+ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
++obj-$(CONFIG_AR71XX_WDT) += ar71xx_wdt.o
+
+ # PARISC Architecture
+
+diff -Nur linux-2.6.29.1.orig/drivers/watchdog/ar71xx_wdt.c linux-2.6.29.1/drivers/watchdog/ar71xx_wdt.c
+--- linux-2.6.29.1.orig/drivers/watchdog/ar71xx_wdt.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/watchdog/ar71xx_wdt.c 2009-04-13 14:27:34.915091622 +0200
+@@ -0,0 +1,270 @@
++/*
++ * Driver for the Atheros AR71xx SoC's built-in hardware watchdog timer.
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
++ *
++ * This driver was based on: drivers/watchdog/ixp4xx_wdt.c
++ * Author: Deepak Saxena <dsaxena@plexity.net>
++ * Copyright 2004 (c) MontaVista, Software, Inc.
++ *
++ * which again was based on sa1100 driver,
++ * Copyright (C) 2000 Oleg Drokin <green@crimea.edu>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#include <linux/bitops.h>
++#include <linux/errno.h>
++#include <linux/fs.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/miscdevice.h>
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++#include <linux/platform_device.h>
++#include <linux/types.h>
++#include <linux/watchdog.h>
++
++#include <asm/mach-ar71xx/ar71xx.h>
++
++#define DRV_NAME "ar71xx-wdt"
++#define DRV_DESC "Atheros AR71xx hardware watchdog driver"
++#define DRV_VERSION "0.1.0"
++
++#define WDT_TIMEOUT 15 /* seconds */
++
++static int nowayout = WATCHDOG_NOWAYOUT;
++
++#ifdef CONFIG_WATCHDOG_NOWAYOUT
++module_param(nowayout, int, 0);
++MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
++ "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
++#endif
++
++static unsigned long wdt_flags;
++
++#define WDT_FLAGS_BUSY 0
++#define WDT_FLAGS_EXPECT_CLOSE 1
++
++static int wdt_timeout = WDT_TIMEOUT;
++static int boot_status;
++static int max_timeout;
++
++static void inline ar71xx_wdt_keepalive(void)
++{
++ ar71xx_reset_wr(AR71XX_RESET_REG_WDOG, ar71xx_ahb_freq * wdt_timeout);
++}
++
++static void inline ar71xx_wdt_enable(void)
++{
++ printk(KERN_DEBUG DRV_NAME ": enabling watchdog timer\n");
++ ar71xx_wdt_keepalive();
++ ar71xx_reset_wr(AR71XX_RESET_REG_WDOG_CTRL, WDOG_CTRL_ACTION_FCR);
++}
++
++static void inline ar71xx_wdt_disable(void)
++{
++ printk(KERN_DEBUG DRV_NAME ": disabling watchdog timer\n");
++ ar71xx_reset_wr(AR71XX_RESET_REG_WDOG_CTRL, WDOG_CTRL_ACTION_NONE);
++}
++
++static int ar71xx_wdt_set_timeout(int val)
++{
++ if (val < 1 || val > max_timeout)
++ return -EINVAL;
++
++ wdt_timeout = val;
++ ar71xx_wdt_keepalive();
++
++ printk(KERN_DEBUG DRV_NAME ": timeout=%d secs\n", wdt_timeout);
++
++ return 0;
++}
++
++static int ar71xx_wdt_open(struct inode *inode, struct file *file)
++{
++ if (test_and_set_bit(WDT_FLAGS_BUSY, &wdt_flags))
++ return -EBUSY;
++
++ clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
++
++ ar71xx_wdt_enable();
++
++ return nonseekable_open(inode, file);
++}
++
++static int ar71xx_wdt_release(struct inode *inode, struct file *file)
++{
++ if (test_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags)) {
++ ar71xx_wdt_disable();
++ } else {
++ printk(KERN_CRIT DRV_NAME ": device closed unexpectedly, "
++ "watchdog timer will not stop!\n");
++ }
++
++ clear_bit(WDT_FLAGS_BUSY, &wdt_flags);
++ clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
++
++ return 0;
++}
++
++static ssize_t ar71xx_wdt_write(struct file *file, const char *data,
++ size_t len, loff_t *ppos)
++{
++ if (len) {
++ if (!nowayout) {
++ size_t i;
++
++ clear_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags);
++
++ for (i = 0; i != len; i++) {
++ char c;
++
++ if (get_user(c, data + i))
++ return -EFAULT;
++
++ if (c == 'V')
++ set_bit(WDT_FLAGS_EXPECT_CLOSE,
++ &wdt_flags);
++ }
++ }
++
++ ar71xx_wdt_keepalive();
++ }
++
++ return len;
++}
++
++static struct watchdog_info ar71xx_wdt_info = {
++ .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING |
++ WDIOF_MAGICCLOSE | WDIOF_CARDRESET,
++ .firmware_version = 0,
++ .identity = "AR71XX watchdog",
++};
++
++static int ar71xx_wdt_ioctl(struct inode *inode, struct file *file,
++ unsigned int cmd, unsigned long arg)
++{
++ int t;
++ int ret;
++
++ switch (cmd) {
++ case WDIOC_GETSUPPORT:
++ ret = copy_to_user((struct watchdog_info *)arg,
++ &ar71xx_wdt_info,
++ sizeof(&ar71xx_wdt_info)) ? -EFAULT : 0;
++ break;
++
++ case WDIOC_GETSTATUS:
++ ret = put_user(0, (int *)arg) ? -EFAULT : 0;
++ break;
++
++ case WDIOC_GETBOOTSTATUS:
++ ret = put_user(boot_status, (int *)arg) ? -EFAULT : 0;
++ break;
++
++ case WDIOC_KEEPALIVE:
++ ar71xx_wdt_keepalive();
++ ret = 0;
++ break;
++
++ case WDIOC_SETTIMEOUT:
++ ret = get_user(t, (int *)arg) ? -EFAULT : 0;
++ if (ret)
++ break;
++
++ ret = ar71xx_wdt_set_timeout(t);
++ if (ret)
++ break;
++
++ /* fallthrough */
++ case WDIOC_GETTIMEOUT:
++ ret = put_user(wdt_timeout, (int *)arg) ? -EFAULT : 0;
++ break;
++
++ default:
++ ret = -ENOTTY;
++ break;
++ }
++
++ return ret;
++}
++
++static const struct file_operations ar71xx_wdt_fops = {
++ .owner = THIS_MODULE,
++ .write = ar71xx_wdt_write,
++ .ioctl = ar71xx_wdt_ioctl,
++ .open = ar71xx_wdt_open,
++ .release = ar71xx_wdt_release,
++};
++
++static struct miscdevice ar71xx_wdt_miscdev = {
++ .minor = WATCHDOG_MINOR,
++ .name = "watchdog",
++ .fops = &ar71xx_wdt_fops,
++};
++
++static int __devinit ar71xx_wdt_probe(struct platform_device *pdev)
++{
++ int ret;
++
++ max_timeout = (0xfffffffful / ar71xx_ahb_freq);
++ wdt_timeout = (max_timeout < WDT_TIMEOUT) ? max_timeout : WDT_TIMEOUT;
++
++ boot_status =
++ (ar71xx_reset_rr(AR71XX_RESET_REG_WDOG_CTRL) & WDOG_CTRL_LAST_RESET) ?
++ WDIOF_CARDRESET : 0;
++
++ ret = misc_register(&ar71xx_wdt_miscdev);
++ if (ret)
++ goto err_out;
++
++ printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
++
++ printk(KERN_DEBUG DRV_NAME ": timeout=%d secs (max=%d)\n",
++ wdt_timeout, max_timeout);
++
++ return 0;
++
++err_out:
++ return ret;
++}
++
++static int __devexit ar71xx_wdt_remove(struct platform_device *pdev)
++{
++ misc_deregister(&ar71xx_wdt_miscdev);
++ return 0;
++}
++
++static struct platform_driver ar71xx_wdt_driver = {
++ .probe = ar71xx_wdt_probe,
++ .remove = __devexit_p(ar71xx_wdt_remove),
++ .driver = {
++ .name = DRV_NAME,
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init ar71xx_wdt_init(void)
++{
++ return platform_driver_register(&ar71xx_wdt_driver);
++}
++module_init(ar71xx_wdt_init);
++
++static void __exit ar71xx_wdt_exit(void)
++{
++ platform_driver_unregister(&ar71xx_wdt_driver);
++}
++module_exit(ar71xx_wdt_exit);
++
++MODULE_DESCRIPTION(DRV_DESC);
++MODULE_VERSION(DRV_VERSION);
++MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org");
++MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:" DRV_NAME);
++MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+diff -Nur linux-2.6.29.1.orig/include/asm-mips/mips_machine.h linux-2.6.29.1/include/asm-mips/mips_machine.h
+--- linux-2.6.29.1.orig/include/asm-mips/mips_machine.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/asm-mips/mips_machine.h 2009-04-13 14:27:34.915091622 +0200
+@@ -0,0 +1,47 @@
++/*
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ *
++ */
++
++#ifndef __ASM_MIPS_MACHINE_H
++#define __ASM_MIPS_MACHINE_H
++
++#include <linux/init.h>
++#include <linux/list.h>
++
++#define MIPS_MACHINE_NAME_LEN 64
++
++struct mips_machine {
++ unsigned long mach_type;
++ void (*mach_setup)(void);
++ unsigned char mach_name[MIPS_MACHINE_NAME_LEN];
++ struct list_head list;
++};
++
++void mips_machine_register(struct mips_machine *) __init;
++void mips_machine_setup(unsigned long machtype) __init;
++
++extern unsigned char mips_machine_name[MIPS_MACHINE_NAME_LEN];
++
++#define MIPS_MACHINE(_type, _name, _setup) \
++static struct mips_machine machine_##_type __initdata = \
++{ \
++ .mach_type = _type, \
++ .mach_name = _name, \
++ .mach_setup = _setup, \
++}; \
++ \
++static int __init register_machine_##_type(void) \
++{ \
++ mips_machine_register(&machine_##_type); \
++ return 0; \
++} \
++ \
++pure_initcall(register_machine_##_type)
++
++#endif /* __ASM_MIPS_MACHINE_H */
++
+diff -Nur linux-2.6.29.1.orig/include/linux/ath9k_platform.h linux-2.6.29.1/include/linux/ath9k_platform.h
+--- linux-2.6.29.1.orig/include/linux/ath9k_platform.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/linux/ath9k_platform.h 2009-04-13 14:27:34.915091622 +0200
+@@ -0,0 +1,20 @@
++/*
++ * ath9k platform data defines
++ *
++ * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#ifndef _LINUX_ATH9K_PLATFORM_H
++#define _LINUX_ATH9L_PLATFORM_H
++
++#define ATH9K_PLAT_EEP_MAX_WORDS 2048
++
++struct ath9k_platform_data {
++ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
++};
++
++#endif /* _LINUX_ATH9K_PLATFORM_H */
+diff -Nur linux-2.6.29.1.orig/include/linux/gpio_buttons.h linux-2.6.29.1/include/linux/gpio_buttons.h
+--- linux-2.6.29.1.orig/include/linux/gpio_buttons.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/linux/gpio_buttons.h 2009-04-13 14:27:34.919091574 +0200
+@@ -0,0 +1,35 @@
++/*
++ * Definitions for the GPIO buttons interface driver
++ *
++ * Copyright (C) 2007,2008 Gabor Juhos <juhosg at openwrt.org>
++ *
++ * This file was based on: /include/linux/gpio_keys.h
++ * The original gpio_keys.h seems not to have a license.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#ifndef _GPIO_BUTTONS_H_
++#define _GPIO_BUTTONS_H_
++
++struct gpio_button {
++ int gpio; /* GPIO line number */
++ int active_low;
++ char *desc; /* button description */
++ int type; /* input event type (EV_KEY, EV_SW) */
++ int code; /* input event code (KEY_*, SW_*) */
++ int count;
++ int threshold; /* count threshold */
++};
++
++struct gpio_buttons_platform_data {
++ struct gpio_button *buttons;
++ int nbuttons; /* number of buttons */
++ int poll_interval; /* polling interval */
++};
++
++#endif /* _GPIO_BUTTONS_H_ */
++
+diff -Nur linux-2.6.29.1.orig/include/linux/phy.h linux-2.6.29.1/include/linux/phy.h
+--- linux-2.6.29.1.orig/include/linux/phy.h 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/include/linux/phy.h 2009-04-13 17:29:37.057990291 +0200
+@@ -478,6 +478,7 @@
+ void phy_stop_machine(struct phy_device *phydev);
+ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
+ int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr);
+ int phy_mii_ioctl(struct phy_device *phydev,
+ struct mii_ioctl_data *mii_data, int cmd);
+ int phy_start_interrupts(struct phy_device *phydev);
+diff -Nur linux-2.6.29.1.orig/include/linux/phy.h.orig linux-2.6.29.1/include/linux/phy.h.orig
+--- linux-2.6.29.1.orig/include/linux/phy.h.orig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/include/linux/phy.h.orig 2009-04-02 22:55:27.000000000 +0200
+@@ -0,0 +1,500 @@
++/*
++ * include/linux/phy.h
++ *
++ * Framework and drivers for configuring and reading different PHYs
++ * Based on code in sungem_phy.c and gianfar_phy.c
++ *
++ * Author: Andy Fleming
++ *
++ * Copyright (c) 2004 Freescale Semiconductor, Inc.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#ifndef __PHY_H
++#define __PHY_H
++
++#include <linux/spinlock.h>
++#include <linux/device.h>
++#include <linux/ethtool.h>
++#include <linux/mii.h>
++#include <linux/timer.h>
++#include <linux/workqueue.h>
++
++#include <asm/atomic.h>
++
++#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
++ SUPPORTED_10baseT_Full | \
++ SUPPORTED_100baseT_Half | \
++ SUPPORTED_100baseT_Full | \
++ SUPPORTED_Autoneg | \
++ SUPPORTED_TP | \
++ SUPPORTED_MII)
++
++#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \
++ SUPPORTED_1000baseT_Half | \
++ SUPPORTED_1000baseT_Full)
++
++/*
++ * Set phydev->irq to PHY_POLL if interrupts are not supported,
++ * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
++ * the attached driver handles the interrupt
++ */
++#define PHY_POLL -1
++#define PHY_IGNORE_INTERRUPT -2
++
++#define PHY_HAS_INTERRUPT 0x00000001
++#define PHY_HAS_MAGICANEG 0x00000002
++
++/* Interface Mode definitions */
++typedef enum {
++ PHY_INTERFACE_MODE_MII,
++ PHY_INTERFACE_MODE_GMII,
++ PHY_INTERFACE_MODE_SGMII,
++ PHY_INTERFACE_MODE_TBI,
++ PHY_INTERFACE_MODE_RMII,
++ PHY_INTERFACE_MODE_RGMII,
++ PHY_INTERFACE_MODE_RGMII_ID,
++ PHY_INTERFACE_MODE_RGMII_RXID,
++ PHY_INTERFACE_MODE_RGMII_TXID,
++ PHY_INTERFACE_MODE_RTBI
++} phy_interface_t;
++
++
++#define PHY_INIT_TIMEOUT 100000
++#define PHY_STATE_TIME 1
++#define PHY_FORCE_TIMEOUT 10
++#define PHY_AN_TIMEOUT 10
++
++#define PHY_MAX_ADDR 32
++
++/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
++#define PHY_ID_FMT "%s:%02x"
++
++/*
++ * Need to be a little smaller than phydev->dev.bus_id to leave room
++ * for the ":%02x"
++ */
++#define MII_BUS_ID_SIZE (BUS_ID_SIZE - 3)
++
++/*
++ * The Bus class for PHYs. Devices which provide access to
++ * PHYs should register using this structure
++ */
++struct mii_bus {
++ const char *name;
++ char id[MII_BUS_ID_SIZE];
++ void *priv;
++ int (*read)(struct mii_bus *bus, int phy_id, int regnum);
++ int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
++ int (*reset)(struct mii_bus *bus);
++
++ /*
++ * A lock to ensure that only one thing can read/write
++ * the MDIO bus at a time
++ */
++ struct mutex mdio_lock;
++
++ struct device *parent;
++ enum {
++ MDIOBUS_ALLOCATED = 1,
++ MDIOBUS_REGISTERED,
++ MDIOBUS_UNREGISTERED,
++ MDIOBUS_RELEASED,
++ } state;
++ struct device dev;
++
++ /* list of all PHYs on bus */
++ struct phy_device *phy_map[PHY_MAX_ADDR];
++
++ /* Phy addresses to be ignored when probing */
++ u32 phy_mask;
++
++ /*
++ * Pointer to an array of interrupts, each PHY's
++ * interrupt at the index matching its address
++ */
++ int *irq;
++};
++#define to_mii_bus(d) container_of(d, struct mii_bus, dev)
++
++struct mii_bus *mdiobus_alloc(void);
++int mdiobus_register(struct mii_bus *bus);
++void mdiobus_unregister(struct mii_bus *bus);
++void mdiobus_free(struct mii_bus *bus);
++struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
++int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum);
++int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val);
++
++
++#define PHY_INTERRUPT_DISABLED 0x0
++#define PHY_INTERRUPT_ENABLED 0x80000000
++
++/* PHY state machine states:
++ *
++ * DOWN: PHY device and driver are not ready for anything. probe
++ * should be called if and only if the PHY is in this state,
++ * given that the PHY device exists.
++ * - PHY driver probe function will, depending on the PHY, set
++ * the state to STARTING or READY
++ *
++ * STARTING: PHY device is coming up, and the ethernet driver is
++ * not ready. PHY drivers may set this in the probe function.
++ * If they do, they are responsible for making sure the state is
++ * eventually set to indicate whether the PHY is UP or READY,
++ * depending on the state when the PHY is done starting up.
++ * - PHY driver will set the state to READY
++ * - start will set the state to PENDING
++ *
++ * READY: PHY is ready to send and receive packets, but the
++ * controller is not. By default, PHYs which do not implement
++ * probe will be set to this state by phy_probe(). If the PHY
++ * driver knows the PHY is ready, and the PHY state is STARTING,
++ * then it sets this STATE.
++ * - start will set the state to UP
++ *
++ * PENDING: PHY device is coming up, but the ethernet driver is
++ * ready. phy_start will set this state if the PHY state is
++ * STARTING.
++ * - PHY driver will set the state to UP when the PHY is ready
++ *
++ * UP: The PHY and attached device are ready to do work.
++ * Interrupts should be started here.
++ * - timer moves to AN
++ *
++ * AN: The PHY is currently negotiating the link state. Link is
++ * therefore down for now. phy_timer will set this state when it
++ * detects the state is UP. config_aneg will set this state
++ * whenever called with phydev->autoneg set to AUTONEG_ENABLE.
++ * - If autonegotiation finishes, but there's no link, it sets
++ * the state to NOLINK.
++ * - If aneg finishes with link, it sets the state to RUNNING,
++ * and calls adjust_link
++ * - If autonegotiation did not finish after an arbitrary amount
++ * of time, autonegotiation should be tried again if the PHY
++ * supports "magic" autonegotiation (back to AN)
++ * - If it didn't finish, and no magic_aneg, move to FORCING.
++ *
++ * NOLINK: PHY is up, but not currently plugged in.
++ * - If the timer notes that the link comes back, we move to RUNNING
++ * - config_aneg moves to AN
++ * - phy_stop moves to HALTED
++ *
++ * FORCING: PHY is being configured with forced settings
++ * - if link is up, move to RUNNING
++ * - If link is down, we drop to the next highest setting, and
++ * retry (FORCING) after a timeout
++ * - phy_stop moves to HALTED
++ *
++ * RUNNING: PHY is currently up, running, and possibly sending
++ * and/or receiving packets
++ * - timer will set CHANGELINK if we're polling (this ensures the
++ * link state is polled every other cycle of this state machine,
++ * which makes it every other second)
++ * - irq will set CHANGELINK
++ * - config_aneg will set AN
++ * - phy_stop moves to HALTED
++ *
++ * CHANGELINK: PHY experienced a change in link state
++ * - timer moves to RUNNING if link
++ * - timer moves to NOLINK if the link is down
++ * - phy_stop moves to HALTED
++ *
++ * HALTED: PHY is up, but no polling or interrupts are done. Or
++ * PHY is in an error state.
++ *
++ * - phy_start moves to RESUMING
++ *
++ * RESUMING: PHY was halted, but now wants to run again.
++ * - If we are forcing, or aneg is done, timer moves to RUNNING
++ * - If aneg is not done, timer moves to AN
++ * - phy_stop moves to HALTED
++ */
++enum phy_state {
++ PHY_DOWN=0,
++ PHY_STARTING,
++ PHY_READY,
++ PHY_PENDING,
++ PHY_UP,
++ PHY_AN,
++ PHY_RUNNING,
++ PHY_NOLINK,
++ PHY_FORCING,
++ PHY_CHANGELINK,
++ PHY_HALTED,
++ PHY_RESUMING
++};
++
++/* phy_device: An instance of a PHY
++ *
++ * drv: Pointer to the driver for this PHY instance
++ * bus: Pointer to the bus this PHY is on
++ * dev: driver model device structure for this PHY
++ * phy_id: UID for this device found during discovery
++ * state: state of the PHY for management purposes
++ * dev_flags: Device-specific flags used by the PHY driver.
++ * addr: Bus address of PHY
++ * link_timeout: The number of timer firings to wait before the
++ * giving up on the current attempt at acquiring a link
++ * irq: IRQ number of the PHY's interrupt (-1 if none)
++ * phy_timer: The timer for handling the state machine
++ * phy_queue: A work_queue for the interrupt
++ * attached_dev: The attached enet driver's device instance ptr
++ * adjust_link: Callback for the enet controller to respond to
++ * changes in the link state.
++ * adjust_state: Callback for the enet driver to respond to
++ * changes in the state machine.
++ *
++ * speed, duplex, pause, supported, advertising, and
++ * autoneg are used like in mii_if_info
++ *
++ * interrupts currently only supports enabled or disabled,
++ * but could be changed in the future to support enabling
++ * and disabling specific interrupts
++ *
++ * Contains some infrastructure for polling and interrupt
++ * handling, as well as handling shifts in PHY hardware state
++ */
++struct phy_device {
++ /* Information about the PHY type */
++ /* And management functions */
++ struct phy_driver *drv;
++
++ struct mii_bus *bus;
++
++ struct device dev;
++
++ u32 phy_id;
++
++ enum phy_state state;
++
++ u32 dev_flags;
++
++ phy_interface_t interface;
++
++ /* Bus address of the PHY (0-32) */
++ int addr;
++
++ /*
++ * forced speed & duplex (no autoneg)
++ * partner speed & duplex & pause (autoneg)
++ */
++ int speed;
++ int duplex;
++ int pause;
++ int asym_pause;
++
++ /* The most recently read link state */
++ int link;
++
++ /* Enabled Interrupts */
++ u32 interrupts;
++
++ /* Union of PHY and Attached devices' supported modes */
++ /* See mii.h for more info */
++ u32 supported;
++ u32 advertising;
++
++ int autoneg;
++
++ int link_timeout;
++
++ /*
++ * Interrupt number for this PHY
++ * -1 means no interrupt
++ */
++ int irq;
++
++ /* private data pointer */
++ /* For use by PHYs to maintain extra state */
++ void *priv;
++
++ /* Interrupt and Polling infrastructure */
++ struct work_struct phy_queue;
++ struct work_struct state_queue;
++ struct timer_list phy_timer;
++ atomic_t irq_disable;
++
++ struct mutex lock;
++
++ struct net_device *attached_dev;
++
++ void (*adjust_link)(struct net_device *dev);
++
++ void (*adjust_state)(struct net_device *dev);
++};
++#define to_phy_device(d) container_of(d, struct phy_device, dev)
++
++/* struct phy_driver: Driver structure for a particular PHY type
++ *
++ * phy_id: The result of reading the UID registers of this PHY
++ * type, and ANDing them with the phy_id_mask. This driver
++ * only works for PHYs with IDs which match this field
++ * name: The friendly name of this PHY type
++ * phy_id_mask: Defines the important bits of the phy_id
++ * features: A list of features (speed, duplex, etc) supported
++ * by this PHY
++ * flags: A bitfield defining certain other features this PHY
++ * supports (like interrupts)
++ *
++ * The drivers must implement config_aneg and read_status. All
++ * other functions are optional. Note that none of these
++ * functions should be called from interrupt time. The goal is
++ * for the bus read/write functions to be able to block when the
++ * bus transaction is happening, and be freed up by an interrupt
++ * (The MPC85xx has this ability, though it is not currently
++ * supported in the driver).
++ */
++struct phy_driver {
++ u32 phy_id;
++ char *name;
++ unsigned int phy_id_mask;
++ u32 features;
++ u32 flags;
++
++ /*
++ * Called to initialize the PHY,
++ * including after a reset
++ */
++ int (*config_init)(struct phy_device *phydev);
++
++ /*
++ * Called during discovery. Used to set
++ * up device-specific structures, if any
++ */
++ int (*probe)(struct phy_device *phydev);
++
++ /* PHY Power Management */
++ int (*suspend)(struct phy_device *phydev);
++ int (*resume)(struct phy_device *phydev);
++
++ /*
++ * Configures the advertisement and resets
++ * autonegotiation if phydev->autoneg is on,
++ * forces the speed to the current settings in phydev
++ * if phydev->autoneg is off
++ */
++ int (*config_aneg)(struct phy_device *phydev);
++
++ /* Determines the negotiated speed and duplex */
++ int (*read_status)(struct phy_device *phydev);
++
++ /* Clears any pending interrupts */
++ int (*ack_interrupt)(struct phy_device *phydev);
++
++ /* Enables or disables interrupts */
++ int (*config_intr)(struct phy_device *phydev);
++
++ /* Clears up any memory if needed */
++ void (*remove)(struct phy_device *phydev);
++
++ struct device_driver driver;
++};
++#define to_phy_driver(d) container_of(d, struct phy_driver, driver)
++
++#define PHY_ANY_ID "MATCH ANY PHY"
++#define PHY_ANY_UID 0xffffffff
++
++/* A Structure for boards to register fixups with the PHY Lib */
++struct phy_fixup {
++ struct list_head list;
++ char bus_id[BUS_ID_SIZE];
++ u32 phy_uid;
++ u32 phy_uid_mask;
++ int (*run)(struct phy_device *phydev);
++};
++
++/**
++ * phy_read - Convenience function for reading a given PHY register
++ * @phydev: the phy_device struct
++ * @regnum: register number to read
++ *
++ * NOTE: MUST NOT be called from interrupt context,
++ * because the bus read/write functions may wait for an interrupt
++ * to conclude the operation.
++ */
++static inline int phy_read(struct phy_device *phydev, u16 regnum)
++{
++ return mdiobus_read(phydev->bus, phydev->addr, regnum);
++}
++
++/**
++ * phy_write - Convenience function for writing a given PHY register
++ * @phydev: the phy_device struct
++ * @regnum: register number to write
++ * @val: value to write to @regnum
++ *
++ * NOTE: MUST NOT be called from interrupt context,
++ * because the bus read/write functions may wait for an interrupt
++ * to conclude the operation.
++ */
++static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
++{
++ return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
++}
++
++int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
++struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
++int phy_clear_interrupt(struct phy_device *phydev);
++int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
++struct phy_device * phy_attach(struct net_device *dev,
++ const char *bus_id, u32 flags, phy_interface_t interface);
++struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
++ void (*handler)(struct net_device *), u32 flags,
++ phy_interface_t interface);
++void phy_disconnect(struct phy_device *phydev);
++void phy_detach(struct phy_device *phydev);
++void phy_start(struct phy_device *phydev);
++void phy_stop(struct phy_device *phydev);
++int phy_start_aneg(struct phy_device *phydev);
++
++void phy_sanitize_settings(struct phy_device *phydev);
++int phy_stop_interrupts(struct phy_device *phydev);
++int phy_enable_interrupts(struct phy_device *phydev);
++int phy_disable_interrupts(struct phy_device *phydev);
++
++static inline int phy_read_status(struct phy_device *phydev) {
++ return phydev->drv->read_status(phydev);
++}
++
++int genphy_config_advert(struct phy_device *phydev);
++int genphy_setup_forced(struct phy_device *phydev);
++int genphy_restart_aneg(struct phy_device *phydev);
++int genphy_config_aneg(struct phy_device *phydev);
++int genphy_update_link(struct phy_device *phydev);
++int genphy_read_status(struct phy_device *phydev);
++int genphy_suspend(struct phy_device *phydev);
++int genphy_resume(struct phy_device *phydev);
++void phy_driver_unregister(struct phy_driver *drv);
++int phy_driver_register(struct phy_driver *new_driver);
++void phy_prepare_link(struct phy_device *phydev,
++ void (*adjust_link)(struct net_device *));
++void phy_start_machine(struct phy_device *phydev,
++ void (*handler)(struct net_device *));
++void phy_stop_machine(struct phy_device *phydev);
++int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
++int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
++int phy_mii_ioctl(struct phy_device *phydev,
++ struct mii_ioctl_data *mii_data, int cmd);
++int phy_start_interrupts(struct phy_device *phydev);
++void phy_print_status(struct phy_device *phydev);
++struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
++void phy_device_free(struct phy_device *phydev);
++
++int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
++ int (*run)(struct phy_device *));
++int phy_register_fixup_for_id(const char *bus_id,
++ int (*run)(struct phy_device *));
++int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
++ int (*run)(struct phy_device *));
++int phy_scan_fixups(struct phy_device *phydev);
++
++int __init mdio_bus_init(void);
++void mdio_bus_exit(void);
++
++extern struct bus_type mdio_bus_type;
++#endif /* __PHY_H */
diff --git a/target/rb433/patches/ip175-switch.patch b/target/rb433/patches/ip175-switch.patch
new file mode 100644
index 000000000..b5fdb2709
--- /dev/null
+++ b/target/rb433/patches/ip175-switch.patch
@@ -0,0 +1,1364 @@
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/Kconfig linux-2.6.29.1/drivers/net/phy/Kconfig
+--- linux-2.6.29.1.orig/drivers/net/phy/Kconfig 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/phy/Kconfig 2009-04-17 12:23:55.049703765 +0200
+@@ -61,6 +61,11 @@
+ ---help---
+ Currently supports the IP175C PHY.
+
++config IP175_PHY
++ tristate "Drivers for ICPlus PHYs (swconfig compatible)"
++ ---help---
++ Currently supports the IP175C PHY.
++
+ config REALTEK_PHY
+ tristate "Drivers for Realtek PHYs"
+ ---help---
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/Makefile linux-2.6.29.1/drivers/net/phy/Makefile
+--- linux-2.6.29.1.orig/drivers/net/phy/Makefile 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/drivers/net/phy/Makefile 2009-04-17 12:24:22.879180918 +0200
+@@ -12,6 +12,7 @@
+ obj-$(CONFIG_VITESSE_PHY) += vitesse.o
+ obj-$(CONFIG_BROADCOM_PHY) += broadcom.o
+ obj-$(CONFIG_ICPLUS_PHY) += icplus.o
++obj-$(CONFIG_IP175_PHY) += swconfig-ip175c.o
+ obj-$(CONFIG_REALTEK_PHY) += realtek.o
+ obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o
+ obj-$(CONFIG_FIXED_PHY) += fixed.o
+diff -Nur linux-2.6.29.1.orig/drivers/net/phy/swconfig-ip175c.c linux-2.6.29.1/drivers/net/phy/swconfig-ip175c.c
+--- linux-2.6.29.1.orig/drivers/net/phy/swconfig-ip175c.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.29.1/drivers/net/phy/swconfig-ip175c.c 2009-04-17 13:59:08.478770561 +0200
+@@ -0,0 +1,1334 @@
++/*
++ * swconfig-ip175c.c: Swconfig configuration for IC+ IP175C switch
++ * Version 0.3
++ *
++ * Copyright (C) 2008 Patrick Horn <patrick.horn@gmail.com>
++ * Copyright (C) 2008 Martin Mares <mj@ucw.cz>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/list.h>
++#include <linux/skbuff.h>
++#include <linux/mii.h>
++#include <linux/phy.h>
++#include <linux/delay.h>
++
++#include <linux/switch.h>
++
++#define MAX_VLANS 16
++#define MAX_PORTS 9
++
++#define MODULE_NAME "swconfig-ip175c"
++#define DRIVER_NAME "ip175c"
++#define DRIVER_VERSION "0.3"
++
++typedef struct ip175c_reg {
++ u16 p; // phy
++ u16 m; // mii
++} reg;
++typedef char bitnum;
++
++#define NOTSUPPORTED {-1,-1}
++
++#define REG_SUPP(x) (((x).m != ((u16)-1)) && ((x).p != (u16)-1))
++
++/*********** CONSTANTS ***********/
++struct register_mappings {
++ char *NAME;
++ u16 MODEL_NO; // compare to bits 4-9 of MII register 0,3.
++ bitnum NUM_PORTS;
++ bitnum CPU_PORT;
++
++/* The default VLAN for each port.
++ Default: 0x0001 for Ports 0,1,2,3
++ 0x0002 for Ports 4,5 */
++ reg VLAN_DEFAULT_TAG_REG[MAX_PORTS];
++
++/* These ports are tagged.
++ Default: 0x00 */
++ reg ADD_TAG_REG;
++ reg REMOVE_TAG_REG;
++ bitnum ADD_TAG_BIT[MAX_PORTS];
++/* These ports are untagged.
++ Default: 0x00 (i.e. do not alter any VLAN tags...)
++ Maybe set to 0 if user disables VLANs. */
++ bitnum REMOVE_TAG_BIT[MAX_PORTS];
++
++/* Port M and Port N are on the same VLAN.
++ Default: All ports on all VLANs. */
++// Use register {29, 19+N/2}
++ reg VLAN_LOOKUP_REG;
++// Port 5 uses register {30, 18} but same as odd bits.
++ reg VLAN_LOOKUP_REG_5; // in a different register on IP175C.
++ bitnum VLAN_LOOKUP_EVEN_BIT[MAX_PORTS];
++ bitnum VLAN_LOOKUP_ODD_BIT[MAX_PORTS];
++
++/* This VLAN corresponds to which ports.
++ Default: 0x2f,0x30,0x3f,0x3f... */
++ reg TAG_VLAN_MASK_REG;
++ bitnum TAG_VLAN_MASK_EVEN_BIT[MAX_PORTS];
++ bitnum TAG_VLAN_MASK_ODD_BIT[MAX_PORTS];
++
++ int RESET_VAL;
++ reg RESET_REG;
++
++/* General flags */
++ reg ROUTER_CONTROL_REG;
++ reg VLAN_CONTROL_REG;
++ bitnum TAG_VLAN_BIT;
++ bitnum ROUTER_EN_BIT;
++ bitnum NUMLAN_GROUPS_MAX;
++ bitnum NUMLAN_GROUPS_BIT;
++
++ reg MII_REGISTER_EN;
++ bitnum MII_REGISTER_EN_BIT;
++
++ // set to 1 for 178C, 0 for 175C.
++ bitnum SIMPLE_VLAN_REGISTERS; // 175C has two vlans per register but 178C has only one.
++};
++
++static const struct register_mappings IP178C = {
++ .NAME = "IP178C",
++ .MODEL_NO = 0x18,
++ .VLAN_DEFAULT_TAG_REG = {
++ {30,3},{30,4},{30,5},{30,6},{30,7},{30,8},
++ {30,9},{30,10},{30,11},
++ },
++
++ .ADD_TAG_REG = {30,12},
++ .ADD_TAG_BIT = {0,1,2,3,4,5,6,7,8},
++ .REMOVE_TAG_REG = {30,13},
++ .REMOVE_TAG_BIT = {4,5,6,7,8,9,10,11,12},
++
++ .SIMPLE_VLAN_REGISTERS = 1,
++
++ .VLAN_LOOKUP_REG = {31,0},// +N
++ .VLAN_LOOKUP_REG_5 = NOTSUPPORTED, // not used with SIMPLE_VLAN_REGISTERS
++ .VLAN_LOOKUP_EVEN_BIT = {0,1,2,3,4,5,6,7,8},
++ .VLAN_LOOKUP_ODD_BIT = {0,1,2,3,4,5,6,7,8},
++
++ .TAG_VLAN_MASK_REG = {30,14}, // +N
++ .TAG_VLAN_MASK_EVEN_BIT = {0,1,2,3,4,5,6,7,8},
++ .TAG_VLAN_MASK_ODD_BIT = {0,1,2,3,4,5,6,7,8},
++
++ .RESET_VAL = 0x55AA,
++ .RESET_REG = {30,0},
++
++ .ROUTER_CONTROL_REG = {30,30},
++ .ROUTER_EN_BIT = 11,
++ .NUMLAN_GROUPS_MAX = 8,
++ .NUMLAN_GROUPS_BIT = 8, // {0-2}
++
++ .VLAN_CONTROL_REG = {30,13},
++ .TAG_VLAN_BIT = 3,
++
++ .CPU_PORT = 8,
++ .NUM_PORTS = 9,
++
++ .MII_REGISTER_EN = NOTSUPPORTED,
++
++};
++
++static const struct register_mappings IP175C = {
++ .NAME = "IP175C",
++ .MODEL_NO = 0x18,
++ .VLAN_DEFAULT_TAG_REG = {
++ {29,24},{29,25},{29,26},{29,27},{29,28},{29,30},
++ NOTSUPPORTED,NOTSUPPORTED,NOTSUPPORTED
++ },
++
++ .ADD_TAG_REG = {29,23},
++ .REMOVE_TAG_REG = {29,23},
++ .ADD_TAG_BIT = {11,12,13,14,15,1,-1,-1,-1},
++ .REMOVE_TAG_BIT = {6,7,8,9,10,0,-1,-1,-1},
++
++ .SIMPLE_VLAN_REGISTERS = 0,
++
++ .VLAN_LOOKUP_REG = {29,19},// +N/2
++ .VLAN_LOOKUP_REG_5 = {30,18},
++ .VLAN_LOOKUP_EVEN_BIT = {8,9,10,11,12,15,-1,-1,-1},
++ .VLAN_LOOKUP_ODD_BIT = {0,1,2,3,4,7,-1,-1,-1},
++
++ .TAG_VLAN_MASK_REG = {30,1}, // +N/2
++ .TAG_VLAN_MASK_EVEN_BIT = {0,1,2,3,4,5,-1,-1,-1},
++ .TAG_VLAN_MASK_ODD_BIT = {8,9,10,11,12,13,-1,-1,-1},
++
++ .RESET_VAL = 0x175C,
++ .RESET_REG = {30,0},
++
++ .ROUTER_CONTROL_REG = {30,9},
++ .ROUTER_EN_BIT = 3,
++ .NUMLAN_GROUPS_MAX = 8,
++ .NUMLAN_GROUPS_BIT = 0, // {0-2}
++
++ .VLAN_CONTROL_REG = {30,9},
++ .TAG_VLAN_BIT = 7,
++
++ .NUM_PORTS = 6,
++ .CPU_PORT = 5,
++
++ .MII_REGISTER_EN = NOTSUPPORTED,
++
++};
++
++static const struct register_mappings IP175A = {
++ .NAME = "IP175A",
++ .MODEL_NO = 0x05,
++ .VLAN_DEFAULT_TAG_REG = {
++ {0,24},{0,25},{0,26},{0,27},{0,28},NOTSUPPORTED,
++ NOTSUPPORTED,NOTSUPPORTED,NOTSUPPORTED
++ },
++
++ .ADD_TAG_REG = {0,23},
++ .REMOVE_TAG_REG = {0,23},
++ .ADD_TAG_BIT = {11,12,13,14,15,1,-1,-1,-1},
++ .REMOVE_TAG_BIT = {6,7,8,9,10,0,-1,-1,-1},
++
++ .SIMPLE_VLAN_REGISTERS = 1,
++
++ // Only programmable via. EEPROM
++ .VLAN_LOOKUP_REG = NOTSUPPORTED,// +N/2
++ .VLAN_LOOKUP_REG_5 = NOTSUPPORTED,
++ .VLAN_LOOKUP_EVEN_BIT = {8,9,10,11,12,15,-1,-1,-1},
++ .VLAN_LOOKUP_ODD_BIT = {0,1,2,3,4,7,-1,-1,-1},
++
++ .TAG_VLAN_MASK_REG = NOTSUPPORTED, // +N/2
++ .TAG_VLAN_MASK_EVEN_BIT = {0,1,2,3,4,5,-1,-1,-1},
++ .TAG_VLAN_MASK_ODD_BIT = {8,9,10,11,12,13,-1,-1,-1},
++
++ .RESET_VAL = -1,
++ .RESET_REG = NOTSUPPORTED,
++
++ .ROUTER_CONTROL_REG = NOTSUPPORTED,
++ .VLAN_CONTROL_REG = NOTSUPPORTED,
++ .TAG_VLAN_BIT = -1,
++ .ROUTER_EN_BIT = -1,
++ .NUMLAN_GROUPS_MAX = -1,
++ .NUMLAN_GROUPS_BIT = -1, // {0-2}
++
++ .NUM_PORTS = 6,
++ .CPU_PORT = 5,
++
++ .MII_REGISTER_EN = {0, 12},
++ .MII_REGISTER_EN_BIT = 7,
++};
++
++struct ip175c_state {
++ struct list_head list;
++ struct mii_bus *mii_bus;
++ struct switch_dev *dev;
++
++ int router_mode; // ROUTER_EN
++ int vlan_enabled; // TAG_VLAN_EN
++ struct port_state {
++ struct phy_device *phy;
++ unsigned int shareports;
++ u16 vlan_tag;
++ } ports[MAX_PORTS];
++ unsigned int add_tag;
++ unsigned int remove_tag;
++ int num_vlans;
++ unsigned int vlan_ports[MAX_VLANS];
++ const struct register_mappings *regs;
++ reg proc_mii; /*!< phy/reg for the low level register access via /proc */
++ int proc_errno; /*!< error code of the last read/write to "val" */
++
++ char buf[80];
++};
++
++static struct list_head state_list;
++
++static int getPhy (struct ip175c_state *state, reg mii)
++{
++ struct mii_bus *bus = state->mii_bus;
++ int err;
++
++ if (!REG_SUPP(mii))
++ return -EFAULT;
++ mutex_lock(&bus->mdio_lock);
++ err = bus->read(bus, mii.p, mii.m);
++ mutex_unlock(&bus->mdio_lock);
++ if (err < 0) {
++ state->proc_errno = err;
++ pr_warning("IP175C: Unable to get MII register %d,%d: error %d\n", mii.p,mii.m,-err);
++ return err;
++ }
++
++ pr_debug("IP175C: Read MII register %d,%d -> %04x\n", mii.p, mii.m, err);
++ return err;
++}
++
++static int setPhy (struct ip175c_state *state, reg mii, u16 value)
++{
++ struct mii_bus *bus = state->mii_bus;
++ int err;
++
++ if (!REG_SUPP(mii))
++ return -EFAULT;
++ mutex_lock(&bus->mdio_lock);
++ err = bus->write(bus, mii.p, mii.m, value);
++ mutex_unlock(&bus->mdio_lock);
++ if (err < 0) {
++ state->proc_errno = err;
++ pr_warning("IP175C: Unable to set MII register %d,%d to %d: error %d\n", mii.p,mii.m,value,-err);
++ return err;
++ }
++ mdelay(2);
++ getPhy(state, mii);
++ pr_debug("IP175C: Set MII register %d,%d to %04x\n", mii.p, mii.m, value);
++ return 0;
++}
++
++/**
++ * These two macros are to simplify the mapping of logical bits to the bits in hardware.
++ * NOTE: these macros will return if there is an error!
++ */
++
++#define GET_PORT_BITS(state, bits, addr, bit_lookup) \
++ do { \
++ int i, val = getPhy((state), (addr)); \
++ if (val < 0) \
++ return val; \
++ (bits) = 0; \
++ for (i = 0; i < MAX_PORTS; i++) { \
++ if ((bit_lookup)[i] == -1) continue; \
++ if (val & (1<<(bit_lookup)[i])) \
++ (bits) |= (1<<i); \
++ } \
++ } while (0)
++
++#define SET_PORT_BITS(state, bits, addr, bit_lookup) \
++ do { \
++ int i, val = getPhy((state), (addr)); \
++ if (val < 0) \
++ return val; \
++ for (i = 0; i < MAX_PORTS; i++) { \
++ unsigned int newmask = ((bits)&(1<<i)); \
++ if ((bit_lookup)[i] == -1) continue; \
++ val &= ~(1<<(bit_lookup)[i]); \
++ val |= ((newmask>>i)<<(bit_lookup)[i]); \
++ } \
++ val = setPhy((state), (addr), val); \
++ if (val < 0) \
++ return val; \
++ } while (0)
++
++static int get_model(struct ip175c_state *state)
++{
++ reg oui_id_reg = {0, 2};
++ int oui_id;
++ reg model_no_reg = {0, 3};
++ int model_no, model_no_orig;
++
++ // 175 and 178 have the same oui ID.
++ reg oui_id_reg_178c = {5, 2}; // returns error on IP175C.
++ int is_178c = 0;
++
++ oui_id = getPhy(state, oui_id_reg);
++ if (oui_id != 0x0243) {
++ // non
++ return -ENODEV; // Not a IC+ chip.
++ }
++ oui_id = getPhy(state, oui_id_reg_178c);
++ if (oui_id == 0x0243) {
++ is_178c = 1;
++ }
++
++ model_no_orig = getPhy(state, model_no_reg);
++ if (model_no_orig < 0) {
++ return -ENODEV;
++ }
++ model_no = model_no_orig >> 4; // shift out revision number.
++ model_no &= 0x3f; // only take the model number (low 6 bits).
++ if (model_no == IP175A.MODEL_NO) {
++ state->regs = &IP175A;
++ } else if (model_no == IP175C.MODEL_NO) {
++ if (is_178c) {
++ state->regs = &IP178C;
++ } else {
++ state->regs = &IP175C;
++ }
++ } else {
++ printk(KERN_WARNING "ip175c: Found an unknown IC+ switch with model number %02Xh.\n", model_no_orig);
++ return -EPERM;
++ }
++ return 0;
++}
++
++/** Get only the vlan and router flags on the router **/
++static int get_flags(struct ip175c_state *state)
++{
++ int val;
++
++ state->router_mode = 0;
++ state->vlan_enabled = -1; // hack
++ state->num_vlans = 0;
++
++ if (!REG_SUPP(state->regs->ROUTER_CONTROL_REG)) {
++ return 0; // not an error if it doesn't support enable vlan.
++ }
++
++ val = getPhy(state, state->regs->ROUTER_CONTROL_REG);
++ if (val < 0) {
++ return val;
++ }
++ if (state->regs->ROUTER_EN_BIT >= 0)
++ state->router_mode = ((val>>state->regs->ROUTER_EN_BIT) & 1);
++
++ if (state->regs->NUMLAN_GROUPS_BIT >= 0) {
++ state->num_vlans = (val >> state->regs->NUMLAN_GROUPS_BIT);
++ state->num_vlans &= (state->regs->NUMLAN_GROUPS_MAX-1);
++ state->num_vlans+=1; // does not include WAN.
++ }
++
++
++ val = getPhy(state, state->regs->VLAN_CONTROL_REG);
++ if (val < 0) {
++ return 0;
++ }
++ if (state->regs->TAG_VLAN_BIT >= 0)
++ state->vlan_enabled = ((val>>state->regs->TAG_VLAN_BIT) & 1);
++
++ return 0;
++}
++/** Get all state variables for VLAN mappings and port-based tagging. **/
++static int get_state(struct ip175c_state *state)
++{
++ int i, j;
++ int ret;
++ ret = get_flags(state);
++ if (ret < 0) {
++ return ret;
++ }
++ GET_PORT_BITS(state, state->remove_tag,
++ state->regs->REMOVE_TAG_REG, state->regs->REMOVE_TAG_BIT);
++ GET_PORT_BITS(state, state->add_tag,
++ state->regs->ADD_TAG_REG, state->regs->ADD_TAG_BIT);
++
++ if (state->vlan_enabled == -1) {
++ // not sure how to get this...
++ state->vlan_enabled = (!state->remove_tag && !state->add_tag);
++ }
++
++ if (REG_SUPP(state->regs->VLAN_LOOKUP_REG)) {
++ for (j=0; j<MAX_PORTS; j++) {
++ state->ports[j].shareports = 0; // initialize them in case.
++ }
++ for (j=0; j<state->regs->NUM_PORTS; j++) {
++ reg addr;
++ const bitnum *bit_lookup = (j%2==0)?
++ state->regs->VLAN_LOOKUP_EVEN_BIT:
++ state->regs->VLAN_LOOKUP_ODD_BIT;
++ addr = state->regs->VLAN_LOOKUP_REG;
++ if (state->regs->SIMPLE_VLAN_REGISTERS) {
++ addr.m += j;
++ } else {
++ switch (j) {
++ case 0:
++ case 1:
++ break;
++ case 2:
++ case 3:
++ addr.m+=1;
++ break;
++ case 4:
++ addr.m+=2;
++ break;
++ case 5:
++ addr = state->regs->VLAN_LOOKUP_REG_5;
++ break;
++ }
++ }
++
++ if (REG_SUPP(addr)) {
++ GET_PORT_BITS(state, state->ports[j].shareports, addr, bit_lookup);
++ }
++ }
++ } else {
++ for (j=0; j<MAX_PORTS; j++) {
++ state->ports[j].shareports = 0xff;
++ }
++ }
++
++ for (i=0; i<MAX_PORTS; i++) {
++ if (REG_SUPP(state->regs->VLAN_DEFAULT_TAG_REG[i])) {
++ int val = getPhy(state, state->regs->VLAN_DEFAULT_TAG_REG[i]);
++ if (val < 0) {
++ return val;
++ }
++ state->ports[i].vlan_tag = val;
++ } else {
++ state->ports[i].vlan_tag = 0;
++ }
++ }
++
++ if (REG_SUPP(state->regs->TAG_VLAN_MASK_REG)) {
++ for (j=0; j<MAX_VLANS; j++) {
++ reg addr = state->regs->TAG_VLAN_MASK_REG;
++ const bitnum *bit_lookup = (j%2==0)?
++ state->regs->TAG_VLAN_MASK_EVEN_BIT:
++ state->regs->TAG_VLAN_MASK_ODD_BIT;
++ if (state->regs->SIMPLE_VLAN_REGISTERS) {
++ addr.m += j;
++ } else {
++ addr.m += j/2;
++ }
++ GET_PORT_BITS(state, state->vlan_ports[j], addr, bit_lookup);
++ }
++ } else {
++ for (j=0; j<MAX_VLANS; j++) {
++ state->vlan_ports[j] = 0;
++ for (i=0; i<state->regs->NUM_PORTS; i++) {
++ if ((state->ports[i].vlan_tag == j) ||
++ (state->ports[i].vlan_tag == 0)) {
++ state->vlan_ports[j] |= (1<<i);
++ }
++ }
++ }
++ }
++
++ return 0;
++}
++
++
++/** Only update vlan and router flags in the switch **/
++static int update_flags(struct ip175c_state *state)
++{
++ int val;
++
++ if (!REG_SUPP(state->regs->ROUTER_CONTROL_REG)) {
++ return 0;
++ }
++
++ val = getPhy(state, state->regs->ROUTER_CONTROL_REG);
++ if (val < 0) {
++ return val;
++ }
++ if (state->regs->ROUTER_EN_BIT >= 0) {
++ if (state->router_mode) {
++ val |= (1<<state->regs->ROUTER_EN_BIT);
++ } else {
++ val &= (~(1<<state->regs->ROUTER_EN_BIT));
++ }
++ }
++ if (state->regs->TAG_VLAN_BIT >= 0) {
++ if (state->vlan_enabled) {
++ val |= (1<<state->regs->TAG_VLAN_BIT);
++ } else {
++ val &= (~(1<<state->regs->TAG_VLAN_BIT));
++ }
++ }
++ if (state->regs->NUMLAN_GROUPS_BIT >= 0) {
++ val &= (~((state->regs->NUMLAN_GROUPS_MAX-1)<<state->regs->NUMLAN_GROUPS_BIT));
++ if (state->num_vlans > state->regs->NUMLAN_GROUPS_MAX) {
++ val |= state->regs->NUMLAN_GROUPS_MAX << state->regs->NUMLAN_GROUPS_BIT;
++ } else if (state->num_vlans >= 1) {
++ val |= (state->num_vlans-1) << state->regs->NUMLAN_GROUPS_BIT;
++ }
++ }
++ return setPhy(state, state->regs->ROUTER_CONTROL_REG, val);
++}
++
++/** Update all VLAN and port state. Usually you should call "correct_vlan_state" first. **/
++static int update_state(struct ip175c_state *state)
++{
++ int j;
++ int i;
++ SET_PORT_BITS(state, state->add_tag,
++ state->regs->ADD_TAG_REG, state->regs->ADD_TAG_BIT);
++ SET_PORT_BITS(state, state->remove_tag,
++ state->regs->REMOVE_TAG_REG, state->regs->REMOVE_TAG_BIT);
++
++ if (REG_SUPP(state->regs->VLAN_LOOKUP_REG)) {
++ for (j=0; j<state->regs->NUM_PORTS; j++) {
++ reg addr;
++ const bitnum *bit_lookup = (j%2==0)?
++ state->regs->VLAN_LOOKUP_EVEN_BIT:
++ state->regs->VLAN_LOOKUP_ODD_BIT;
++
++ // duplicate code -- sorry
++ addr = state->regs->VLAN_LOOKUP_REG;
++ if (state->regs->SIMPLE_VLAN_REGISTERS) {
++ addr.m += j;
++ } else {
++ switch (j) {
++ case 0:
++ case 1:
++ break;
++ case 2:
++ case 3:
++ addr.m+=1;
++ break;
++ case 4:
++ addr.m+=2;
++ break;
++ case 5:
++ addr = state->regs->VLAN_LOOKUP_REG_5;
++ break;
++ default:
++ addr.m = -1; // shouldn't get here, but...
++ break;
++ }
++ }
++ //printf("shareports for %d is %02X\n",j,state->ports[j].shareports);
++ if (REG_SUPP(addr)) {
++ SET_PORT_BITS(state, state->ports[j].shareports, addr, bit_lookup);
++ }
++ }
++ }
++ if (REG_SUPP(state->regs->TAG_VLAN_MASK_REG)) {
++ for (j=0; j<MAX_VLANS; j++) {
++ reg addr = state->regs->TAG_VLAN_MASK_REG;
++ const bitnum *bit_lookup = (j%2==0)?
++ state->regs->TAG_VLAN_MASK_EVEN_BIT:
++ state->regs->TAG_VLAN_MASK_ODD_BIT;
++ unsigned int vlan_mask;
++ if (state->regs->SIMPLE_VLAN_REGISTERS) {
++ addr.m += j;
++ } else {
++ addr.m += j/2;
++ }
++ vlan_mask = state->vlan_ports[j];
++ SET_PORT_BITS(state, vlan_mask, addr, bit_lookup);
++ }
++ }
++
++ for (i=0; i<MAX_PORTS; i++) {
++ if (REG_SUPP(state->regs->VLAN_DEFAULT_TAG_REG[i])) {
++ int err = setPhy(state, state->regs->VLAN_DEFAULT_TAG_REG[i],
++ state->ports[i].vlan_tag);
++ if (err < 0) {
++ return err;
++ }
++ }
++ }
++
++ return update_flags(state);
++
++ // software reset: 30.0 = 0x175C
++ // wait 2ms
++ // reset ports 0,1,2,3,4
++}
++
++/*
++ Uses only the VLAN port mask and the add tag mask to generate the other fields:
++ which ports are part of the same VLAN, removing vlan tags, and VLAN tag ids.
++ */
++static void correct_vlan_state(struct ip175c_state *state)
++{
++ int i, j;
++ state->num_vlans = 0;
++ for (i=0; i<MAX_VLANS; i++) {
++ if (state->vlan_ports[i] != 0) {
++ state->num_vlans = i+1; //hack -- we need to store the "set" vlans somewhere...
++ }
++ }
++
++ for (i=0; i<state->regs->NUM_PORTS; i++) {
++ int oldtag = state->ports[i].vlan_tag;
++ if (oldtag >= 0 && oldtag < MAX_VLANS) {
++ if (state->vlan_ports[oldtag] & (1<<i)) {
++ continue; // primary vlan is valid.
++ }
++ }
++ state->ports[i].vlan_tag = 0;
++ }
++
++ for (i=0; i<state->regs->NUM_PORTS; i++) {
++ unsigned int portmask = (1<<i);
++ state->ports[i].shareports = portmask;
++ for (j=0; j<MAX_VLANS; j++) {
++ if (state->vlan_ports[j] & portmask) {
++ state->ports[i].shareports |= state->vlan_ports[j];
++ if (state->ports[i].vlan_tag == 0) {
++ state->ports[i].vlan_tag = j;
++ }
++ }
++ }
++ if (!state->vlan_enabled) {
++ // share with everybody!
++ state->ports[i].shareports = (1<<state->regs->NUM_PORTS)-1;
++ }
++ }
++ state->remove_tag = ((~state->add_tag) & ((1<<state->regs->NUM_PORTS)-1));
++}
++
++static int ip175c_get_enable_vlan(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int err;
++
++ err = get_state(state); // may be set in get_state.
++ if (err < 0)
++ return err;
++ val->value.i = state->vlan_enabled;
++ return 0;
++}
++
++static int ip175c_set_enable_vlan(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int err;
++ int enable;
++ int i;
++
++ err = get_state(state);
++ if (err < 0)
++ return err;
++ enable = val->value.i;
++ //printk(KERN_WARNING "set enable vlan to %d\n",enable);
++
++ if (state->vlan_enabled == enable) {
++ // do not change any state.
++ return 0;
++ }
++ state->vlan_enabled = enable;
++
++ // Otherwise, if we are switching state, set fields to a known default.
++ state->remove_tag = 0x0000;
++ state->add_tag = 0x0000;
++ for (i = 0; i < MAX_PORTS; i++) {
++ state->ports[i].vlan_tag = 0;
++ state->ports[i].shareports = 0xffff;
++ }
++ for (i = 0; i < MAX_VLANS; i++) {
++ state->vlan_ports[i] = 0x0;
++ }
++
++ if (state->vlan_enabled) {
++ // updates other fields only based off vlan_ports and add_tag fields.
++ // Note that by default, no ports are in any vlans.
++ correct_vlan_state(state);
++ }
++ // ensure sane defaults?
++ return update_state(state);
++}
++
++static int ip175c_get_ports(struct switch_dev *dev, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int err;
++ int b;
++ int ind;
++ unsigned int ports;
++
++ if (val->port_vlan >= dev->vlans || val->port_vlan < 0)
++ return -EINVAL;
++
++ err = get_state(state);
++ if (err<0)
++ return err;
++
++ ports = state->vlan_ports[val->port_vlan];
++ b = 0;
++ ind = 0;
++ while (b < MAX_PORTS) {
++ if (ports&1) {
++ int istagged = ((state->add_tag >> b) & 1);
++ val->value.ports[ind].id = b;
++ val->value.ports[ind].flags = (istagged << SWITCH_PORT_FLAG_TAGGED);
++ ind++;
++ }
++ b++;
++ ports >>= 1;
++ }
++ val->len = ind;
++
++ return 0;
++}
++
++static int ip175c_set_ports(struct switch_dev *dev, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int i;
++ int err;
++
++ if (val->port_vlan >= dev->vlans || val->port_vlan < 0)
++ return -EINVAL;
++
++ err = get_state(state);
++ if (err < 0)
++ return err;
++
++ state->vlan_ports[val->port_vlan] = 0;
++ for (i = 0; i < val->len; i++) {
++ int bitmask = (1<<val->value.ports[i].id);
++ state->vlan_ports[val->port_vlan] |= bitmask;
++ if (val->value.ports[i].flags & (1<<SWITCH_PORT_FLAG_TAGGED)) {
++ state->add_tag |= bitmask;
++ } else {
++ state->add_tag &= (~bitmask);
++ }
++ }
++ /*
++ // no primary vlan id support in swconfig?
++ // primary vlan will be set to the first non-zero vlan a port is a member of.
++ for (i = 0; i< state->regs->NUM_PORTS; i++) {
++ if (vlan_config->pvid & (1<<i)) {
++ state->ports[i].vlan_tag = nr;
++ }
++ }
++ */
++
++ correct_vlan_state(state);
++ err = update_state(state);
++
++ return err;
++}
++
++static int ip175c_apply(struct switch_dev *dev)
++{
++ struct ip175c_state *state = dev->priv;
++ int err;
++
++ err = get_flags(state);
++ if (err < 0)
++ return err;
++
++ if (REG_SUPP(state->regs->MII_REGISTER_EN)){
++ int val = getPhy(state, state->regs->MII_REGISTER_EN);
++ if (val < 0) {
++ return val;
++ }
++ val |= (1<<state->regs->MII_REGISTER_EN_BIT);
++ return setPhy(state, state->regs->MII_REGISTER_EN, val);
++ }
++ return 0;
++}
++
++static int ip175c_reset(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int err;
++
++ err = get_flags(state);
++ if (err < 0)
++ return err;
++
++ if (REG_SUPP(state->regs->RESET_REG)) {
++ err = setPhy(state, state->regs->RESET_REG, state->regs->RESET_VAL);
++ if (err < 0)
++ return err;
++ err = getPhy(state, state->regs->RESET_REG);
++
++ /* data sheet specifies reset period is 2 msec
++ (don't see any mention of the 2ms delay in the IP178C spec, only
++ in IP175C, but it can't hurt.) */
++ mdelay(2);
++ }
++ return 0;
++}
++
++/*! get the current register number */
++static int ip175c_get_tagged(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int err;
++
++ err = get_state(state);
++ if (err < 0)
++ return err;
++
++ if (state->add_tag & (1<<val->port_vlan)) {
++ if (state->remove_tag & (1<<val->port_vlan))
++ val->value.i = 3; // shouldn't ever happen.
++ else
++ val->value.i = 1;
++ } else {
++ if (state->remove_tag & (1<<val->port_vlan))
++ val->value.i = 0;
++ else
++ val->value.i = 2;
++ }
++ return 0;
++}
++
++/*! set a new register address for low level access to registers */
++static int ip175c_set_tagged(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int err;
++
++ err = get_state(state);
++ if (err < 0)
++ return err;
++
++ state->add_tag &= ~(1<<val->port_vlan);
++ state->remove_tag &= ~(1<<val->port_vlan);
++
++ if (val->value.i == 0)
++ state->remove_tag |= (1<<val->port_vlan);
++ if (val->value.i == 1)
++ state->add_tag |= (1<<val->port_vlan);
++
++ SET_PORT_BITS(state, state->add_tag,
++ state->regs->ADD_TAG_REG, state->regs->ADD_TAG_BIT);
++ SET_PORT_BITS(state, state->remove_tag,
++ state->regs->REMOVE_TAG_REG, state->regs->REMOVE_TAG_BIT);
++
++ return err;
++}
++
++
++/* low level /proc procedures */
++
++/*! get the current phy address */
++static int ip175c_get_phy(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++
++ val->value.i = state->proc_mii.p;
++ return 0;
++}
++
++/*! set a new phy address for low level access to registers */
++static int ip175c_set_phy(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int new_reg = val->value.i;
++
++ if (new_reg < 0 || new_reg > 31)
++ state->proc_mii.p = (u16)-1;
++ else
++ state->proc_mii.p = (u16)new_reg;
++ return 0;
++}
++
++/*! get the current register number */
++static int ip175c_get_reg(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++
++ val->value.i = state->proc_mii.m;
++ return 0;
++}
++
++/*! set a new register address for low level access to registers */
++static int ip175c_set_reg(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int new_reg = val->value.i;
++
++ if (new_reg < 0 || new_reg > 31)
++ state->proc_mii.m = (u16)-1;
++ else
++ state->proc_mii.m = (u16)new_reg;
++ return 0;
++}
++
++/*! get the register content of state->proc_mii */
++static int ip175c_get_val(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int retval = -EINVAL;
++ if (REG_SUPP(state->proc_mii))
++ retval = getPhy(state, state->proc_mii);
++
++ if (retval < 0) {
++ state->proc_errno = retval;
++ return retval;
++ } else {
++ state->proc_errno = 0;
++ val->value.i = retval;
++ return 0;
++ }
++}
++
++/*! write a value to the register defined by phy/reg above */
++static int ip175c_set_val(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ int myval;
++
++ myval = val->value.i;
++ if (myval <= 0xffff && myval >= 0 && REG_SUPP(state->proc_mii)) {
++ state->proc_errno = setPhy(state, state->proc_mii, (u16)myval);
++ } else {
++ state->proc_errno = -EINVAL;
++ }
++ return state->proc_errno;
++}
++
++/*! get the errno of the last read/write of "val" */
++static int ip175c_get_errno(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ val->value.i = state->proc_errno;
++ return 0;
++}
++
++static int ip175c_read_name(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ struct ip175c_state *state = dev->priv;
++ val->value.s = state->regs->NAME; // just a const pointer, won't be freed by swconfig.
++ return 0;
++}
++
++
++static int ip175c_set_port_speed(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ int nr = val->port_vlan;
++ struct ip175c_state *state = dev->priv;
++ struct phy_device *phy;
++ int ctrl;
++ int autoneg;
++ int speed;
++ if (val->value.i == 100) {
++ speed = 1;
++ autoneg = 0;
++ } else if (val->value.i == 10) {
++ speed = 0;
++ autoneg = 0;
++ } else {
++ autoneg = 1;
++ speed = 1;
++ }
++
++ if (nr == state->regs->CPU_PORT) {
++ return -EINVAL; // can't set speed for cpu port!
++ }
++
++ if (nr >= dev->ports || nr < 0)
++ return -EINVAL;
++ phy = state->ports[nr].phy;
++ if (!phy)
++ return -EINVAL;
++
++ ctrl = phy_read(phy, 0);
++ if (ctrl < 0)
++ return -EIO;
++
++ ctrl &= (~(1<<12));
++ ctrl &= (~(1<<13));
++ ctrl |= (autoneg<<12);
++ ctrl |= (speed<<13);
++
++ return phy_write(phy, 0, ctrl);
++}
++
++static int ip175c_get_port_speed(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ int nr = val->port_vlan;
++ struct ip175c_state *state = dev->priv;
++ struct phy_device *phy;
++ int speed, status;
++
++ if (nr == state->regs->CPU_PORT) {
++ val->value.i = 100;
++ return 0;
++ }
++
++ if (nr >= dev->ports || nr < 0)
++ return -EINVAL;
++ phy = state->ports[nr].phy;
++ if (!phy)
++ return -EINVAL;
++
++ status = phy_read(phy, 1);
++ speed = phy_read(phy, 18);
++ if (status < 0 || speed < 0)
++ return -EIO;
++
++ if (status & 4)
++ val->value.i = ((speed & (1<<11)) ? 100 : 10);
++ else
++ val->value.i = 0;
++
++ return 0;
++}
++
++
++static int ip175c_get_port_status(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val)
++{
++ int nr = val->port_vlan;
++ struct ip175c_state *state = dev->priv;
++ struct phy_device *phy;
++ int ctrl, speed, status;
++ int len;
++ char *buf = state->buf; // fixed-length at 80.
++
++ if (nr == state->regs->CPU_PORT) {
++ sprintf(buf, "up, 100 Mbps, cpu port");
++ val->value.s = buf;
++ return 0;
++ }
++
++ if (nr >= dev->ports || nr < 0)
++ return -EINVAL;
++ phy = state->ports[nr].phy;
++ if (!phy)
++ return -EINVAL;
++
++ ctrl = phy_read(phy, 0);
++ status = phy_read(phy, 1);
++ speed = phy_read(phy, 18);
++ if (ctrl < 0 || status < 0 || speed < 0)
++ return -EIO;
++
++ if (status & 4)
++ len = sprintf(buf, "up, %d Mbps, %s duplex",
++ ((speed & (1<<11)) ? 100 : 10),
++ ((speed & (1<<10)) ? "full" : "half"));
++ else
++ len = sprintf(buf, "down");
++
++ if (ctrl & (1<<12)) {
++ len += sprintf(buf+len, ", auto-negotiate");
++ if (!(status & (1<<5)))
++ len += sprintf(buf+len, " (in progress)");
++ } else {
++ len += sprintf(buf+len, ", fixed speed (%d)",
++ ((ctrl & (1<<13)) ? 100 : 10));
++ }
++
++ buf[len] = '\0';
++ val->value.s = buf;
++ return 0;
++}
++
++enum Ports {
++ IP175C_PORT_STATUS,
++ IP175C_PORT_LINK,
++ IP175C_PORT_TAGGED,
++};
++
++enum Globals {
++ IP175C_RESET,
++ IP175C_ENABLE_VLAN,
++ IP175C_GET_NAME,
++ IP175C_REGISTER_PHY,
++ IP175C_REGISTER_MII,
++ IP175C_REGISTER_VALUE,
++ IP175C_REGISTER_ERRNO,
++};
++
++static const struct switch_attr ip175c_global[] = {
++ [IP175C_RESET] = {
++ .id = IP175C_RESET,
++ .type = SWITCH_TYPE_NOVAL,
++ .name = "reset",
++ .get = NULL,
++ .description = "Resets the switch but does not clear vlan configuration",
++ .set = ip175c_reset,
++ },
++ [IP175C_ENABLE_VLAN] = {
++ .id = IP175C_ENABLE_VLAN,
++ .type = SWITCH_TYPE_INT,
++ .name = "enable_vlan",
++ .description = "Flag to enable or disable VLANs and tagging",
++ .get = ip175c_get_enable_vlan,
++ .set = ip175c_set_enable_vlan,
++ },
++ [IP175C_GET_NAME] = {
++ .id = IP175C_GET_NAME,
++ .type = SWITCH_TYPE_STRING,
++ .description = "Returns the type of IC+ chip.",
++ .name = "name",
++ .get = ip175c_read_name,
++ .set = NULL,
++ },
++ /* jal: added for low level debugging etc. */
++ [IP175C_REGISTER_PHY] = {
++ .id = IP175C_REGISTER_PHY,
++ .type = SWITCH_TYPE_INT,
++ .description = "Direct register access: set phy (0-4, or 29,30,31)",
++ .name = "phy",
++ .get = ip175c_get_phy,
++ .set = ip175c_set_phy,
++ },
++ [IP175C_REGISTER_MII] = {
++ .id = IP175C_REGISTER_MII,
++ .type = SWITCH_TYPE_INT,
++ .description = "Direct register access: set mii number (0-31)",
++ .name = "reg",
++ .get = ip175c_get_reg,
++ .set = ip175c_set_reg,
++ },
++ [IP175C_REGISTER_VALUE] = {
++ .id = IP175C_REGISTER_VALUE,
++ .type = SWITCH_TYPE_INT,
++ .description = "Direct register access: read/write to register (0-65535)",
++ .name = "val",
++ .get = ip175c_get_val,
++ .set = ip175c_set_val,
++ },
++ [IP175C_REGISTER_ERRNO] = {
++ .id = IP175C_REGISTER_ERRNO,
++ .type = SWITCH_TYPE_INT,
++ .description = "Direct register access: returns last read or write error",
++ .name = "errno",
++ .get = ip175c_get_errno,
++ .set = NULL,
++ },
++
++};
++
++static const struct switch_attr ip175c_vlan[] = {
++};
++
++static const struct switch_attr ip175c_port[] = {
++ [IP175C_PORT_STATUS] = {
++ .id = IP175C_PORT_STATUS,
++ .type = SWITCH_TYPE_STRING,
++ .description = "Returns Detailed port status",
++ .name = "status",
++ .get = ip175c_get_port_status,
++ .set = NULL,
++ },
++ [IP175C_PORT_LINK] = {
++ .id = IP175C_PORT_LINK,
++ .type = SWITCH_TYPE_INT,
++ .description = "Link speed. Can write 0 for auto-negotiate, or 10 or 100",
++ .name = "link",
++ .get = ip175c_get_port_speed,
++ .set = ip175c_set_port_speed,
++ },
++ [IP175C_PORT_TAGGED] = {
++ .id = IP175C_PORT_LINK,
++ .type = SWITCH_TYPE_INT,
++ .description = "0 = untag, 1 = add tags, 2 = do not alter (This value is reset if vlans are altered)",
++ .name = "tagged",
++ .get = ip175c_get_tagged,
++ .set = ip175c_set_tagged,
++ },
++};
++
++static void ip175c_cleanup(struct ip175c_state *state)
++{
++ int i;
++
++ for (i=0; i<MAX_PORTS; i++)
++ if (state->ports[i].phy)
++ put_device(&state->ports[i].phy->dev);
++ list_del(&state->list);
++ kfree(state);
++}
++
++static struct ip175c_state *lookup_state(struct mii_bus *bus)
++{
++ struct list_head *pos;
++ struct ip175c_state *state;
++ struct switch_dev *dev;
++ int err;
++
++ list_for_each(pos, &state_list) {
++ state = list_entry(pos, struct ip175c_state, list);
++ if (state->mii_bus == bus)
++ return state;
++ }
++
++ dev = kcalloc(1, sizeof(*dev), GFP_KERNEL);
++ if (!dev)
++ return NULL;
++ dev->name = DRIVER_NAME;
++
++ // FIXME: passing const pointers gives warning with swconfig
++ dev->attr_global.attr = &ip175c_global;
++ dev->attr_global.n_attr = ARRAY_SIZE(ip175c_global);
++ dev->attr_port.attr = &ip175c_port;
++ dev->attr_port.n_attr = ARRAY_SIZE(ip175c_port);
++ dev->attr_vlan.attr = &ip175c_vlan;
++ dev->attr_vlan.n_attr = ARRAY_SIZE(ip175c_vlan);
++
++ dev->get_vlan_ports = ip175c_get_ports;
++ dev->set_vlan_ports = ip175c_set_ports;
++ dev->apply_config = ip175c_apply;
++
++ state = kcalloc(1, sizeof(*state), GFP_KERNEL);
++ if (!state)
++ goto bad2;
++ list_add_tail(&state->list, &state_list);
++ state->mii_bus = bus;
++ state->dev = dev;
++ dev->priv = state;
++ dev->devname = bus->id;
++
++ if ((err = get_model(state)))
++ goto bad;
++
++ dev->vlans = MAX_VLANS;
++ dev->cpu_port = state->regs->CPU_PORT;
++ dev->ports = state->regs->NUM_PORTS;
++
++ printk(KERN_INFO MODULE_NAME ": Found a %s chip at %s, id %s\n", state->regs->NAME, bus->name, bus->id);
++
++ if (register_switch(dev, NULL) < 0)
++ goto bad;
++
++ return state;
++
++bad:
++ ip175c_cleanup(state);
++bad2:
++ kfree(dev);
++ return NULL;
++}
++
++#define PRINT_FOR_EACH_PHY // slightly increases loading times but could be useful.
++static int __init ip175c_init_dev(struct device *kdev, void *data)
++{
++ struct ip175c_state *state;
++ struct phy_device *phy;
++
++ pr_debug("IP175C: Found PHY: bus_id=%s\n", kdev->bus_id);
++ phy = to_phy_device(kdev);
++ if (phy == NULL)
++ return 0; // bad ip175c device.
++ state = lookup_state(phy->bus);
++ if (state) {
++#ifdef PRINT_FOR_EACH_PHY
++ printk(KERN_DEBUG MODULE_NAME ": Found %s switch at bus id %s (PHY %d)\n", state->regs->NAME, kdev->bus_id, phy->addr);
++#endif
++ if (phy->addr < state->regs->NUM_PORTS) {
++ state->ports[phy->addr].phy = phy;
++ get_device(kdev);
++ }
++ }
++ return 0;
++}
++
++int __init ip175c_init(void)
++{
++ struct device_driver *drv = driver_find("ICPlus IP175C", &mdio_bus_type);
++ if (!drv) {
++ pr_info("IP175C: No ICPlus driver found.\n");
++ return -ENOENT;
++ }
++ INIT_LIST_HEAD(&state_list);
++ driver_for_each_device(drv, NULL, NULL, ip175c_init_dev);
++ put_driver(drv);
++ return 0;
++}
++
++void __exit ip175c_exit(void)
++{
++ struct list_head *pos;
++ struct list_head *temp;
++ struct ip175c_state *state;
++
++ list_for_each_safe(pos, temp, &state_list) {
++ state = list_entry(pos, struct ip175c_state, list);
++ unregister_switch(state->dev);
++ state->dev = NULL;
++ ip175c_cleanup(state); // removes from list and frees.
++ }
++}
++
++MODULE_AUTHOR("Patrick Horn <patrick.horn@gmail.com>");
++MODULE_LICENSE("GPL");
++
++module_init(ip175c_init);
++module_exit(ip175c_exit);
++
diff --git a/target/rb433/uclibc.config b/target/rb433/uclibc.config
new file mode 100644
index 000000000..4f35e8d4c
--- /dev/null
+++ b/target/rb433/uclibc.config
@@ -0,0 +1,233 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30.1
+# Sun Apr 12 14:05:42 2009
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+TARGET_mips=y
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="mips"
+FORCE_OPTIONS_FOR_ARCH=y
+ARCH_CFLAGS="-mno-split-addresses"
+CONFIG_MIPS_O32_ABI=y
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_ANY_ENDIAN=y
+ARCH_BIG_ENDIAN=y
+ARCH_WANTS_BIG_ENDIAN=y
+# ARCH_WANTS_LITTLE_ENDIAN is not set
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+EXTRA_WARNINGS=y
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/rb532/Makefile b/target/rb532/Makefile
new file mode 100644
index 000000000..4c980392a
--- /dev/null
+++ b/target/rb532/Makefile
@@ -0,0 +1,29 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+ cp $(LINUX_DIR)/vmlinux $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+
+ifeq ($(FS),ext2)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo
+ @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
+ @echo "Use following command to create a QEMU Image:"
+ @echo "sudo ./scripts/create-image.sh -n qemu-mips.img $(BIN_DIR)/$(ROOTFSTARBALL)"
+ @echo "Start qemu with following options:"
+ @echo "qemu-system-mipsel -nographic -M malta -kernel $(BIN_DIR)/${DEVICE}-${ARCH}-kernel -hda qemu-mips.img"
+endif
+
+ifeq ($(FS),nfsroot)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The nfs root tarball is: ${BIN_DIR}/${ROOTFSTARBALL}'
+endif
diff --git a/target/rb532/device.mk b/target/rb532/device.mk
new file mode 100644
index 000000000..df956ae5e
--- /dev/null
+++ b/target/rb532/device.mk
@@ -0,0 +1,7 @@
+ARCH:= mips
+CPU_ARCH:= mipsel
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=mips32
diff --git a/target/rb532/files/etc/mdev.conf b/target/rb532/files/etc/mdev.conf
new file mode 100644
index 000000000..a8b87c84c
--- /dev/null
+++ b/target/rb532/files/etc/mdev.conf
@@ -0,0 +1,11 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+tun 0:0 660 >net/tun
+device-mapper 0:0 660 @mkdir /dev/mapper
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/rb532/kernel.config b/target/rb532/kernel.config
new file mode 100644
index 000000000..7da65ac33
--- /dev/null
+++ b/target/rb532/kernel.config
@@ -0,0 +1,1025 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29-rc3
+# Sat Jan 31 19:13:41 2009
+#
+CONFIG_MIPS=y
+
+#
+# Machine selection
+#
+# CONFIG_MACH_ALCHEMY is not set
+# CONFIG_BASLER_EXCITE is not set
+# CONFIG_BCM47XX is not set
+# CONFIG_MIPS_COBALT is not set
+# CONFIG_MACH_DECSTATION is not set
+# CONFIG_MACH_JAZZ is not set
+# CONFIG_LASAT is not set
+# CONFIG_LEMOTE_FULONG is not set
+# CONFIG_MIPS_MALTA is not set
+# CONFIG_MIPS_SIM is not set
+# CONFIG_MACH_EMMA is not set
+# CONFIG_MACH_VR41XX is not set
+# CONFIG_NXP_STB220 is not set
+# CONFIG_NXP_STB225 is not set
+# CONFIG_PNX8550_JBS is not set
+# CONFIG_PNX8550_STB810 is not set
+# CONFIG_PMC_MSP is not set
+# CONFIG_PMC_YOSEMITE is not set
+# CONFIG_SGI_IP22 is not set
+# CONFIG_SGI_IP27 is not set
+# CONFIG_SGI_IP28 is not set
+# CONFIG_SGI_IP32 is not set
+# CONFIG_SIBYTE_CRHINE is not set
+# CONFIG_SIBYTE_CARMEL is not set
+# CONFIG_SIBYTE_CRHONE is not set
+# CONFIG_SIBYTE_RHONE is not set
+# CONFIG_SIBYTE_SWARM is not set
+# CONFIG_SIBYTE_LITTLESUR is not set
+# CONFIG_SIBYTE_SENTOSA is not set
+# CONFIG_SIBYTE_BIGSUR is not set
+# CONFIG_SNI_RM is not set
+# CONFIG_MACH_TX39XX is not set
+# CONFIG_MACH_TX49XX is not set
+CONFIG_MIKROTIK_RB532=y
+# CONFIG_WR_PPMC is not set
+# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
+# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_ARCH_SUPPORTS_OPROFILE=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_BOOT_RAW=y
+CONFIG_CEVT_R4K_LIB=y
+CONFIG_CEVT_R4K=y
+CONFIG_CSRC_R4K_LIB=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NEED_PCI_MAP_STATE=y
+# CONFIG_HOTPLUG_CPU is not set
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_GPIO=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_IRQ_CPU=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_MIPS_L1_CACHE_SHIFT=4
+
+#
+# CPU selection
+#
+# CONFIG_CPU_LOONGSON2 is not set
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
+# CONFIG_CPU_R3000 is not set
+# CONFIG_CPU_TX39XX is not set
+# CONFIG_CPU_VR41XX is not set
+# CONFIG_CPU_R4300 is not set
+# CONFIG_CPU_R4X00 is not set
+# CONFIG_CPU_TX49XX is not set
+# CONFIG_CPU_R5000 is not set
+# CONFIG_CPU_R5432 is not set
+# CONFIG_CPU_R5500 is not set
+# CONFIG_CPU_R6000 is not set
+# CONFIG_CPU_NEVADA is not set
+# CONFIG_CPU_R8000 is not set
+# CONFIG_CPU_R10000 is not set
+# CONFIG_CPU_RM7000 is not set
+# CONFIG_CPU_RM9000 is not set
+# CONFIG_CPU_SB1 is not set
+# CONFIG_CPU_CAVIUM_OCTEON is not set
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+
+#
+# Kernel type
+#
+CONFIG_32BIT=y
+# CONFIG_64BIT is not set
+CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
+# CONFIG_PAGE_SIZE_16KB is not set
+# CONFIG_PAGE_SIZE_64KB is not set
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_MIPS_MT_DISABLED=y
+# CONFIG_MIPS_MT_SMP is not set
+# CONFIG_MIPS_MT_SMTC is not set
+CONFIG_CPU_HAS_LLSC=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_UNEVICTABLE_LRU is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_48 is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_128 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_256 is not set
+# CONFIG_HZ_1000 is not set
+# CONFIG_HZ_1024 is not set
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_HZ=100
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+# CONFIG_KEXEC is not set
+# CONFIG_SECCOMP is not set
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+# CONFIG_PROBE_INITRD_HEADER is not set
+# CONFIG_FREEZER is not set
+
+#
+# Bus options (PCI, PCMCIA, EISA, ISA, TC)
+#
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_LEGACY is not set
+# CONFIG_PCI_STUB is not set
+CONFIG_MMU=y
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_TRAD_SIGNALS=y
+
+#
+# Power management options
+#
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_PM is not set
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_VERBOSE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_FIB_RULES=y
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_LIBFC is not set
+# CONFIG_FCOE is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_PMP is not set
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+CONFIG_PATA_RB532=y
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+CONFIG_KORINA=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_TC35815 is not set
+# CONFIG_E100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_R6040 is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SMSC9420 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+CONFIG_VIA_RHINE=y
+CONFIG_VIA_RHINE_MMIO=y
+# CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+
+#
+# PCI GPIO expanders:
+#
+# CONFIG_GPIO_BT8XX is not set
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=0
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+
+#
+# Tracers
+#
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_CMDLINE="init=/init console=ttyS0,115200"
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_MANAGER2 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/rb532/uclibc.config b/target/rb532/uclibc.config
new file mode 100644
index 000000000..223c3ddd9
--- /dev/null
+++ b/target/rb532/uclibc.config
@@ -0,0 +1,250 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Fri Jan 9 14:41:23 2009
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+TARGET_mips=y
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="mips"
+FORCE_OPTIONS_FOR_ARCH=y
+ARCH_CFLAGS="-mno-split-addresses"
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+CONFIG_MIPS_O32_ABI=y
+# CONFIG_MIPS_N32_ABI is not set
+# CONFIG_MIPS_N64_ABI is not set
+# CONFIG_MIPS_ISA_1 is not set
+# CONFIG_MIPS_ISA_2 is not set
+# CONFIG_MIPS_ISA_3 is not set
+# CONFIG_MIPS_ISA_4 is not set
+CONFIG_MIPS_ISA_MIPS32=y
+# CONFIG_MIPS_ISA_MIPS32R2 is not set
+# CONFIG_MIPS_ISA_MIPS64 is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+# ARCH_WANTS_BIG_ENDIAN is not set
+ARCH_WANTS_LITTLE_ENDIAN=y
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+EXTRA_WARNINGS=y
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/rescue-x86/Makefile b/target/rescue-x86/Makefile
new file mode 100644
index 000000000..9e5ccb25b
--- /dev/null
+++ b/target/rescue-x86/Makefile
@@ -0,0 +1,19 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+
+ifeq ($(FS),initramfs)
+imageinstall: $(BIN_DIR)/$(INITRAMFS)
+ cp $(LINUX_DIR)/arch/x86/boot/bzImage $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
+endif
diff --git a/target/rescue-x86/device.mk b/target/rescue-x86/device.mk
new file mode 100644
index 000000000..4c8b72b4e
--- /dev/null
+++ b/target/rescue-x86/device.mk
@@ -0,0 +1,7 @@
+ARCH:= x86
+CPU_ARCH:= i686
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -O2 -pipe
+TARGET_CFLAGS_ARCH:= -march=i686
diff --git a/target/rescue-x86/files/etc/inittab b/target/rescue-x86/files/etc/inittab
new file mode 100644
index 000000000..4ab5cbe41
--- /dev/null
+++ b/target/rescue-x86/files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS
+::shutdown:/etc/init.d/rcK
+tty1::respawn:/sbin/getty -i -L tty1 115200 vt100
+
diff --git a/target/rescue-x86/files/etc/mdev.conf b/target/rescue-x86/files/etc/mdev.conf
new file mode 100644
index 000000000..82171d8ed
--- /dev/null
+++ b/target/rescue-x86/files/etc/mdev.conf
@@ -0,0 +1,14 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+device-mapper 0:0 660 @mkdir /dev/mapper
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+kmem 0:0 000
+mem 0:0 0640
+port 0:0 0640
+ptmx 0:0 666
+tty 0:0 0660
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/rescue-x86/kernel.config b/target/rescue-x86/kernel.config
new file mode 100644
index 000000000..1252dd05a
--- /dev/null
+++ b/target/rescue-x86/kernel.config
@@ -0,0 +1,1006 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29.1
+# Sat May 16 23:19:43 2009
+#
+CONFIG_64BIT=y
+# CONFIG_X86_32 is not set
+CONFIG_X86_64=y
+CONFIG_X86=y
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_FAST_CMPXCHG_LOCAL=y
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
+# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ZONE_DMA32=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_AUDIT_ARCH=y
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_X86_BIOS_REBOOT=y
+# CONFIG_KTIME_SCALAR is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_PCSPKR_PLATFORM is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_PCI_QUIRKS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+# CONFIG_MODULE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLOCK_COMPAT=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+# CONFIG_FREEZER is not set
+
+#
+# Processor type and features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_SMP is not set
+# CONFIG_SPARSE_IRQ is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+CONFIG_X86_PC=y
+# CONFIG_X86_ELAN is not set
+# CONFIG_X86_VOYAGER is not set
+# CONFIG_X86_GENERICARCH is not set
+# CONFIG_X86_VSMP is not set
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+# CONFIG_PARAVIRT_GUEST is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+CONFIG_MCORE2=y
+# CONFIG_GENERIC_CPU is not set
+CONFIG_X86_CPU=y
+CONFIG_X86_L1_CACHE_BYTES=64
+CONFIG_X86_INTERNODE_CACHE_BYTES=64
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_P6_NOP=y
+CONFIG_X86_TSC=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=64
+CONFIG_X86_DEBUGCTLMSR=y
+# CONFIG_PROCESSOR_SELECT is not set
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR_64=y
+# CONFIG_X86_DS is not set
+# CONFIG_X86_PTRACE_BTS is not set
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_DMI=y
+CONFIG_GART_IOMMU=y
+# CONFIG_CALGARY_IOMMU is not set
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_IOMMU_API is not set
+CONFIG_NR_CPUS=1
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_INTEL=y
+CONFIG_X86_MCE_AMD=y
+# CONFIG_I8K is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+# CONFIG_NOHIGHMEM is not set
+# CONFIG_HIGHMEM4G is not set
+# CONFIG_HIGHMEM64G is not set
+# CONFIG_VMSPLIT_3G is not set
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_2G_OPT is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+CONFIG_DIRECT_GBPAGES=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_SPARSEMEM_VMEMMAP=y
+# CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
+CONFIG_X86_RESERVE_LOW_64K=y
+CONFIG_MTRR=y
+# CONFIG_MTRR_SANITIZER is not set
+# CONFIG_X86_PAT is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_PHYSICAL_START=0x100000
+# CONFIG_RELOCATABLE is not set
+CONFIG_PHYSICAL_ALIGN=0x200000
+# CONFIG_COMPAT_VDSO is not set
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+
+#
+# Power management and ACPI options
+#
+# CONFIG_PM is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Memory power savings
+#
+# CONFIG_I7300_IDLE is not set
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+# CONFIG_PCI_GODIRECT is not set
+# CONFIG_PCI_GOOLPC is not set
+# CONFIG_PCI_GOANY is not set
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_LEGACY is not set
+# CONFIG_PCI_STUB is not set
+# CONFIG_HT_IRQ is not set
+CONFIG_ISA_DMA_API=y
+CONFIG_K8_NB=y
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_COMPAT_BINFMT_ELF=y
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_IA32_EMULATION=y
+# CONFIG_IA32_AOUT is not set
+CONFIG_COMPAT=y
+CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_LIB80211 is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+CONFIG_PATA_JMICRON=y
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+# CONFIG_NET_ETHERNET is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_CONSOLE_TRANSLATIONS is not set
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_MWAVE is not set
+# CONFIG_PC8736x_GPIO is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+CONFIG_AGP=y
+CONFIG_AGP_AMD64=y
+# CONFIG_AGP_INTEL is not set
+# CONFIG_AGP_SIS is not set
+# CONFIG_AGP_VIA is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=512
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_X86_PLATFORM_DEVICES=y
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_DELL_RBU is not set
+# CONFIG_DCDBAS is not set
+CONFIG_DMIID=y
+# CONFIG_ISCSI_IBFT_FIND is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=y
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+CONFIG_ARCH_WANT_FRAME_POINTERS=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_USER_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+
+#
+# Tracers
+#
+# CONFIG_SYSPROF_TRACER is not set
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_STRICT_DEVMEM is not set
+# CONFIG_X86_VERBOSE_BOOTUP is not set
+# CONFIG_EARLY_PRINTK is not set
+CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+# CONFIG_OPTIMIZE_INLINING is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+CONFIG_HAVE_KVM=y
+# CONFIG_VIRTUALIZATION is not set
+
+#
+# Library routines
+#
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+# CONFIG_CRC32 is not set
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/rescue-x86/uclibc.config b/target/rescue-x86/uclibc.config
new file mode 100644
index 000000000..ed46e1519
--- /dev/null
+++ b/target/rescue-x86/uclibc.config
@@ -0,0 +1,241 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Mon Dec 1 19:41:35 2008
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+TARGET_i386=y
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="i386"
+FORCE_OPTIONS_FOR_ARCH=y
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+CONFIG_686=y
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/rescue-x86_64/Makefile b/target/rescue-x86_64/Makefile
new file mode 100644
index 000000000..9e5ccb25b
--- /dev/null
+++ b/target/rescue-x86_64/Makefile
@@ -0,0 +1,19 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+
+ifeq ($(FS),initramfs)
+imageinstall: $(BIN_DIR)/$(INITRAMFS)
+ cp $(LINUX_DIR)/arch/x86/boot/bzImage $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+ @echo 'The kernel file is: ${BIN_DIR}/${DEVICE}-${ARCH}-kernel'
+ @echo 'The initramfs image is: ${BIN_DIR}/${INITRAMFS}'
+endif
diff --git a/target/rescue-x86_64/device.mk b/target/rescue-x86_64/device.mk
new file mode 100644
index 000000000..3f78956dc
--- /dev/null
+++ b/target/rescue-x86_64/device.mk
@@ -0,0 +1,7 @@
+ARCH:= x86
+CPU_ARCH:= x86_64
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -O2 -pipe
+TARGET_CFLAGS_ARCH:=
diff --git a/target/rescue-x86_64/files/etc/inittab b/target/rescue-x86_64/files/etc/inittab
new file mode 100644
index 000000000..4ab5cbe41
--- /dev/null
+++ b/target/rescue-x86_64/files/etc/inittab
@@ -0,0 +1,4 @@
+::sysinit:/etc/init.d/rcS
+::shutdown:/etc/init.d/rcK
+tty1::respawn:/sbin/getty -i -L tty1 115200 vt100
+
diff --git a/target/rescue-x86_64/files/etc/mdev.conf b/target/rescue-x86_64/files/etc/mdev.conf
new file mode 100644
index 000000000..82171d8ed
--- /dev/null
+++ b/target/rescue-x86_64/files/etc/mdev.conf
@@ -0,0 +1,14 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+device-mapper 0:0 660 @mkdir /dev/mapper
+tun 0:0 660 >net/tun
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+kmem 0:0 000
+mem 0:0 0640
+port 0:0 0640
+ptmx 0:0 666
+tty 0:0 0660
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/rescue-x86_64/kernel.config b/target/rescue-x86_64/kernel.config
new file mode 100644
index 000000000..efe3c4fc7
--- /dev/null
+++ b/target/rescue-x86_64/kernel.config
@@ -0,0 +1,1121 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.29.1
+# Sun May 17 00:59:59 2009
+#
+CONFIG_64BIT=y
+# CONFIG_X86_32 is not set
+CONFIG_X86_64=y
+CONFIG_X86=y
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_FAST_CMPXCHG_LOCAL=y
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ZONE_DMA32=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_AUDIT_ARCH=y
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_X86_SMP=y
+CONFIG_USE_GENERIC_SMP_HELPERS=y
+CONFIG_X86_64_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_TRAMPOLINE=y
+# CONFIG_KTIME_SCALAR is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_CLASSIC_RCU=y
+# CONFIG_TREE_RCU is not set
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_PREEMPT_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+# CONFIG_GROUP_SCHED is not set
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_PCSPKR_PLATFORM is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+CONFIG_PCI_QUIRKS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+# CONFIG_MODULE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLOCK_COMPAT=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+# CONFIG_FREEZER is not set
+
+#
+# Processor type and features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_SMP=y
+# CONFIG_SPARSE_IRQ is not set
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+CONFIG_X86_PC=y
+# CONFIG_X86_ELAN is not set
+# CONFIG_X86_VOYAGER is not set
+# CONFIG_X86_GENERICARCH is not set
+# CONFIG_X86_VSMP is not set
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+# CONFIG_PARAVIRT_GUEST is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+CONFIG_MCORE2=y
+# CONFIG_GENERIC_CPU is not set
+CONFIG_X86_CPU=y
+CONFIG_X86_L1_CACHE_BYTES=64
+CONFIG_X86_INTERNODE_CACHE_BYTES=64
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_P6_NOP=y
+CONFIG_X86_TSC=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=64
+CONFIG_X86_DEBUGCTLMSR=y
+# CONFIG_PROCESSOR_SELECT is not set
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR_64=y
+# CONFIG_X86_DS is not set
+# CONFIG_X86_PTRACE_BTS is not set
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_DMI=y
+CONFIG_GART_IOMMU=y
+# CONFIG_CALGARY_IOMMU is not set
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_IOMMU_API is not set
+CONFIG_NR_CPUS=8
+# CONFIG_SCHED_SMT is not set
+CONFIG_SCHED_MC=y
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_INTEL=y
+CONFIG_X86_MCE_AMD=y
+# CONFIG_I8K is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+CONFIG_DIRECT_GBPAGES=y
+# CONFIG_NUMA is not set
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_SPARSEMEM_VMEMMAP=y
+# CONFIG_MEMORY_HOTPLUG is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
+CONFIG_X86_RESERVE_LOW_64K=y
+CONFIG_MTRR=y
+# CONFIG_MTRR_SANITIZER is not set
+# CONFIG_X86_PAT is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_PHYSICAL_START=0x200000
+# CONFIG_RELOCATABLE is not set
+CONFIG_PHYSICAL_ALIGN=0x200000
+# CONFIG_HOTPLUG_CPU is not set
+# CONFIG_COMPAT_VDSO is not set
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+
+#
+# Power management and ACPI options
+#
+# CONFIG_PM is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Memory power savings
+#
+# CONFIG_I7300_IDLE is not set
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_LEGACY is not set
+# CONFIG_PCI_STUB is not set
+# CONFIG_HT_IRQ is not set
+CONFIG_ISA_DMA_API=y
+CONFIG_K8_NB=y
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_COMPAT_BINFMT_ELF=y
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_IA32_EMULATION=y
+# CONFIG_IA32_AOUT is not set
+CONFIG_COMPAT=y
+CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_COMPAT_NET_DEV_OPS=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_SATA_PMP=y
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+CONFIG_PATA_JMICRON=y
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_PLATFORM is not set
+# CONFIG_PATA_SCH is not set
+CONFIG_MD=y
+# CONFIG_BLK_DEV_MD is not set
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+# CONFIG_DM_SNAPSHOT is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_ZERO is not set
+# CONFIG_DM_MULTIPATH is not set
+# CONFIG_DM_DELAY is not set
+# CONFIG_DM_UEVENT is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+# CONFIG_NET_ETHERNET is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_CONSOLE_TRANSLATIONS is not set
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_MWAVE is not set
+# CONFIG_PC8736x_GPIO is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_DEVPORT=y
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+CONFIG_AGP=y
+CONFIG_AGP_AMD64=y
+# CONFIG_AGP_INTEL is not set
+# CONFIG_AGP_SIS is not set
+# CONFIG_AGP_VIA is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=512
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_X86_PLATFORM_DEVICES=y
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_DELL_RBU is not set
+# CONFIG_DCDBAS is not set
+CONFIG_DMIID=y
+# CONFIG_ISCSI_IBFT_FIND is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+# CONFIG_PROC_KCORE is not set
+CONFIG_PROC_SYSCTL=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=y
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+# CONFIG_NFS_FS is not set
+# CONFIG_NFSD is not set
+CONFIG_EXPORTFS=m
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+CONFIG_ARCH_WANT_FRAME_POINTERS=y
+# CONFIG_FRAME_POINTER is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_USER_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+
+#
+# Tracers
+#
+# CONFIG_SYSPROF_TRACER is not set
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_STRICT_DEVMEM is not set
+# CONFIG_X86_VERBOSE_BOOTUP is not set
+# CONFIG_EARLY_PRINTK is not set
+CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+# CONFIG_OPTIMIZE_INLINING is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_ALGAPI2=m
+CONFIG_CRYPTO_AEAD2=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER2=m
+CONFIG_CRYPTO_HASH=m
+CONFIG_CRYPTO_HASH2=m
+CONFIG_CRYPTO_RNG2=m
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=m
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=m
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CRC32C_INTEL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+CONFIG_CRYPTO_SHA256=m
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=m
+# CONFIG_CRYPTO_AES_X86_64 is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SALSA20_X86_64 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_TWOFISH_X86_64 is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+CONFIG_HAVE_KVM=y
+# CONFIG_VIRTUALIZATION is not set
+
+#
+# Library routines
+#
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+# CONFIG_CRC32 is not set
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/rescue-x86_64/uclibc.config b/target/rescue-x86_64/uclibc.config
new file mode 100644
index 000000000..c2b5c62df
--- /dev/null
+++ b/target/rescue-x86_64/uclibc.config
@@ -0,0 +1,240 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30.1
+# Sat May 16 23:57:03 2009
+#
+# TARGET_alpha is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+TARGET_x86_64=y
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="x86_64"
+FORCE_OPTIONS_FOR_ARCH=y
+# CONFIG_GENERIC_386 is not set
+# CONFIG_386 is not set
+# CONFIG_486 is not set
+# CONFIG_586 is not set
+# CONFIG_586MMX is not set
+# CONFIG_686 is not set
+# CONFIG_PENTIUMII is not set
+# CONFIG_PENTIUMIII is not set
+# CONFIG_PENTIUM4 is not set
+# CONFIG_K6 is not set
+# CONFIG_K7 is not set
+# CONFIG_ELAN is not set
+# CONFIG_CRUSOE is not set
+# CONFIG_WINCHIPC6 is not set
+# CONFIG_WINCHIP2 is not set
+# CONFIG_CYRIXIII is not set
+# CONFIG_NEHEMIAH is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_LITTLE_ENDIAN=y
+
+#
+# Using Little Endian
+#
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_FPU=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/target/zaurus/Makefile b/target/zaurus/Makefile
new file mode 100644
index 000000000..89172ce8a
--- /dev/null
+++ b/target/zaurus/Makefile
@@ -0,0 +1,19 @@
+# $Id: Makefile 30 2008-09-04 13:31:09Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include $(TOPDIR)/mk/kernel.mk
+include $(TOPDIR)/mk/modules.mk
+include $(TOPDIR)/mk/kernel-build.mk
+include $(TOPDIR)/mk/image.mk
+
+kernel-install:
+ cp $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/${DEVICE}-${ARCH}-kernel
+
+ifeq ($(FS),ext2)
+imageinstall: $(BIN_DIR)/$(ROOTFSTARBALL)
+ @echo
+ @echo "The RootFS tarball is: $(BIN_DIR)/$(ROOTFSTARBALL),"
+endif
diff --git a/target/zaurus/device.mk b/target/zaurus/device.mk
new file mode 100644
index 000000000..a4d88a611
--- /dev/null
+++ b/target/zaurus/device.mk
@@ -0,0 +1,8 @@
+ARCH:= arm
+CPU_ARCH:= arm
+KERNEL_VERSION:= 2.6.29.1
+KERNEL_RELEASE:= 1
+KERNEL_MD5SUM:= 4ada43caecb08fe2af71b416b6f586d8
+TARGET_OPTIMIZATION:= -Os -pipe
+TARGET_CFLAGS_ARCH:= -march=armv5te -msoft-float
+GCC_EXTRA_CONFOPTS:= --with-float=soft
diff --git a/target/zaurus/files/etc/mdev.conf b/target/zaurus/files/etc/mdev.conf
new file mode 100644
index 000000000..a8b87c84c
--- /dev/null
+++ b/target/zaurus/files/etc/mdev.conf
@@ -0,0 +1,11 @@
+rtc0 root:root 660 @ln -sf /dev/rtc0 /dev/rtc
+tun 0:0 660 >net/tun
+device-mapper 0:0 660 @mkdir /dev/mapper
+null 0:0 777
+zero 0:0 666
+u?random 0:0 644
+console 0:0 0600
+ptmx 0:0 666
+tty 0:0 666
+ttyS* 0:0 640
+.* 0:0 644 @/lib/mdev/init
diff --git a/target/zaurus/kernel.config b/target/zaurus/kernel.config
new file mode 100644
index 000000000..8d8a31063
--- /dev/null
+++ b/target/zaurus/kernel.config
@@ -0,0 +1,1971 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28
+# Sat Feb 14 16:11:29 2009
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_MMU=y
+# CONFIG_NO_IOPORT is not set
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_ARCH_HAS_ILOG2_U32 is not set
+# CONFIG_ARCH_HAS_ILOG2_U64 is not set
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ARCH_MTD_XIP=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_BLK_DEV_INITRD is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_CFQ=m
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IMX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_PNX4008 is not set
+CONFIG_ARCH_PXA=y
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_MSM is not set
+
+#
+# Intel PXA2xx/PXA3xx Implementations
+#
+# CONFIG_ARCH_GUMSTIX is not set
+# CONFIG_ARCH_LUBBOCK is not set
+# CONFIG_MACH_LOGICPD_PXA270 is not set
+# CONFIG_MACH_MAINSTONE is not set
+# CONFIG_MACH_MP900C is not set
+# CONFIG_ARCH_PXA_IDP is not set
+CONFIG_PXA_SHARPSL=y
+CONFIG_CORGI_SSP_DEPRECATED=y
+# CONFIG_MACH_POODLE is not set
+# CONFIG_MACH_CORGI is not set
+# CONFIG_MACH_SHEPHERD is not set
+# CONFIG_MACH_HUSKY is not set
+# CONFIG_MACH_AKITA is not set
+CONFIG_MACH_SPITZ=y
+CONFIG_MACH_BORZOI=y
+# CONFIG_MACH_TOSA is not set
+# CONFIG_ARCH_VIPER is not set
+# CONFIG_ARCH_PXA_ESERIES is not set
+# CONFIG_TRIZEPS_PXA is not set
+# CONFIG_MACH_EM_X270 is not set
+# CONFIG_MACH_COLIBRI is not set
+# CONFIG_MACH_ZYLONITE is not set
+# CONFIG_MACH_LITTLETON is not set
+# CONFIG_MACH_TAVOREVB is not set
+# CONFIG_MACH_SAAR is not set
+# CONFIG_MACH_ARMCORE is not set
+# CONFIG_MACH_CM_X300 is not set
+# CONFIG_MACH_MAGICIAN is not set
+# CONFIG_MACH_MIOA701 is not set
+# CONFIG_MACH_PCM027 is not set
+# CONFIG_ARCH_PXA_PALM is not set
+# CONFIG_PXA_EZX is not set
+CONFIG_PXA27x=y
+CONFIG_PXA_SHARP_Cxx00=y
+CONFIG_PXA_SSP=y
+# CONFIG_PXA_PWM is not set
+
+#
+# Boot options
+#
+
+#
+# Power management
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_XSCALE=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_PABRT_NOIFAR=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_OUTER_CACHE is not set
+CONFIG_IWMMXT=y
+CONFIG_XSCALE_PMU=y
+CONFIG_SHARP_PARAM=y
+CONFIG_SHARPSL_PM=y
+CONFIG_SHARP_SCOOP=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=y
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_PCMCIA_IOCTL=y
+
+#
+# PC-card bridges
+#
+CONFIG_PCMCIA_PXA2XX=y
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_FLATMEM_HAS_HOLES=y
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4096
+# CONFIG_RESOURCES_64BIT is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/hda1 rootfstype=ext3 rootdelay=1 rw fbcon=rotate:1 dyntick=enable debug"
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_APM_EMULATION=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=m
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+# CONFIG_IP_PNP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
+
+#
+# Core Netfilter Configuration
+#
+# CONFIG_NETFILTER_NETLINK_QUEUE is not set
+# CONFIG_NETFILTER_NETLINK_LOG is not set
+# CONFIG_NF_CONNTRACK is not set
+CONFIG_NETFILTER_XTABLES=m
+# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
+# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
+# CONFIG_NETFILTER_XT_TARGET_MARK is not set
+# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
+# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
+# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
+# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
+# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
+# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
+# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
+# CONFIG_NETFILTER_XT_MATCH_ESP is not set
+# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
+# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
+# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
+# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
+# CONFIG_NETFILTER_XT_MATCH_MAC is not set
+# CONFIG_NETFILTER_XT_MATCH_MARK is not set
+# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
+# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
+# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
+# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
+# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
+# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
+# CONFIG_NETFILTER_XT_MATCH_REALM is not set
+# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
+# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
+# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
+# CONFIG_NETFILTER_XT_MATCH_STRING is not set
+# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
+# CONFIG_NETFILTER_XT_MATCH_TIME is not set
+# CONFIG_NETFILTER_XT_MATCH_U32 is not set
+# CONFIG_IP_VS is not set
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_NF_DEFRAG_IPV4 is not set
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration
+#
+# CONFIG_IP6_NF_QUEUE is not set
+# CONFIG_IP6_NF_IPTABLES is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+# CONFIG_IRDA_ULTRA is not set
+
+#
+# IrDA options
+#
+# CONFIG_IRDA_CACHE_LAST_LSAP is not set
+# CONFIG_IRDA_FAST_RR is not set
+# CONFIG_IRDA_DEBUG is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+# CONFIG_IRTTY_SIR is not set
+
+#
+# Dongle support
+#
+# CONFIG_KINGSUN_DONGLE is not set
+# CONFIG_KSDAZZLE_DONGLE is not set
+# CONFIG_KS959_DONGLE is not set
+
+#
+# FIR device drivers
+#
+# CONFIG_USB_IRDA is not set
+# CONFIG_SIGMATEL_FIR is not set
+CONFIG_PXA_FICP=m
+# CONFIG_MCS_FIR is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+# CONFIG_BT_HCIUSB_SCO is not set
+# CONFIG_BT_HCIBTUSB is not set
+# CONFIG_BT_HCIBTSDIO is not set
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+# CONFIG_BT_HCIUART_LL is not set
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+# CONFIG_MAC80211 is not set
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+CONFIG_MTD_ROM=y
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_SHARP_SL=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+# CONFIG_MTD_NAND_H1900 is not set
+# CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+CONFIG_MTD_NAND_SHARPSL=y
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_C2PORT is not set
+CONFIG_HAVE_IDE=y
+CONFIG_IDE=y
+
+#
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
+CONFIG_BLK_DEV_IDECS=y
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_BLK_DEV_PLATFORM is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=m
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=m
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=m
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+# CONFIG_BLK_DEV_MD is not set
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_DELAY is not set
+# CONFIG_DM_UEVENT is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=m
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_SMC911X is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+CONFIG_WLAN_80211=y
+# CONFIG_PCMCIA_RAYCS is not set
+# CONFIG_LIBERTAS is not set
+CONFIG_HERMES=m
+CONFIG_PCMCIA_HERMES=m
+CONFIG_PCMCIA_SPECTRUM=m
+# CONFIG_ATMEL is not set
+CONFIG_AIRO_CS=m
+# CONFIG_PCMCIA_WL3501 is not set
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_USB_NET_RNDIS_WLAN is not set
+# CONFIG_IWLWIFI_LEDS is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_CS=m
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_SMSC95XX is not set
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=m
+# CONFIG_USB_NET_PLUSB is not set
+# CONFIG_USB_NET_MCS7830 is not set
+# CONFIG_USB_NET_RNDIS_HOST is not set
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_NET_PCMCIA=y
+# CONFIG_PCMCIA_3C589 is not set
+# CONFIG_PCMCIA_3C574 is not set
+# CONFIG_PCMCIA_FMVJ18X is not set
+CONFIG_PCMCIA_PCNET=m
+# CONFIG_PCMCIA_NMCLAN is not set
+# CONFIG_PCMCIA_SMC91C92 is not set
+# CONFIG_PCMCIA_XIRC2PS is not set
+# CONFIG_PCMCIA_AXNET is not set
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_PPPOL2TP is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+CONFIG_INPUT_APMPOWER=y
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_CORGI is not set
+CONFIG_KEYBOARD_SPITZ=y
+# CONFIG_KEYBOARD_PXA27x is not set
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_CORGI=y
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_WM97XX is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_UINPUT=m
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=m
+# CONFIG_NVRAM is not set
+# CONFIG_R3964 is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
+# CONFIG_IPWIRELESS is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+# CONFIG_I2C_CHARDEV is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_PXA=y
+# CONFIG_I2C_PXA_SLAVE is not set
+# CONFIG_I2C_SIMTEC is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_STUB is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_AT24 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+# CONFIG_SPI is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_UCB1400_CORE is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_ALLOW_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_MEDIA_TUNER=m
+# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEO_V4L1=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+# CONFIG_USB_VIDEO_CLASS is not set
+CONFIG_USB_GSPCA=m
+# CONFIG_USB_M5602 is not set
+# CONFIG_USB_GSPCA_CONEX is not set
+# CONFIG_USB_GSPCA_ETOMS is not set
+# CONFIG_USB_GSPCA_FINEPIX is not set
+# CONFIG_USB_GSPCA_MARS is not set
+# CONFIG_USB_GSPCA_OV519 is not set
+# CONFIG_USB_GSPCA_PAC207 is not set
+# CONFIG_USB_GSPCA_PAC7311 is not set
+# CONFIG_USB_GSPCA_SONIXB is not set
+# CONFIG_USB_GSPCA_SONIXJ is not set
+# CONFIG_USB_GSPCA_SPCA500 is not set
+# CONFIG_USB_GSPCA_SPCA501 is not set
+# CONFIG_USB_GSPCA_SPCA505 is not set
+# CONFIG_USB_GSPCA_SPCA506 is not set
+# CONFIG_USB_GSPCA_SPCA508 is not set
+# CONFIG_USB_GSPCA_SPCA561 is not set
+# CONFIG_USB_GSPCA_STK014 is not set
+# CONFIG_USB_GSPCA_SUNPLUS is not set
+# CONFIG_USB_GSPCA_T613 is not set
+# CONFIG_USB_GSPCA_TV8532 is not set
+# CONFIG_USB_GSPCA_VC032X is not set
+# CONFIG_USB_GSPCA_ZC3XX is not set
+# CONFIG_VIDEO_PVRUSB2 is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_USBVISION is not set
+CONFIG_VIDEO_USBVIDEO=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_KONICAWC=m
+# CONFIG_USB_QUICKCAM_MESSENGER is not set
+# CONFIG_USB_ET61X251 is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+CONFIG_USB_OV511=m
+CONFIG_USB_SE401=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_STV680=m
+# CONFIG_USB_ZC0301 is not set
+# CONFIG_USB_PWC is not set
+# CONFIG_USB_ZR364XX is not set
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+CONFIG_RADIO_ADAPTERS=y
+CONFIG_USB_DSBR=m
+# CONFIG_USB_SI470X is not set
+# CONFIG_USB_MR800 is not set
+CONFIG_DAB=y
+CONFIG_USB_DABUSB=m
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_PXA=y
+# CONFIG_FB_PXA_SMARTPANEL is not set
+# CONFIG_FB_PXA_PARAMETERS is not set
+# CONFIG_FB_MBX is not set
+# CONFIG_FB_W100 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CORGI=y
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+# CONFIG_FONT_8x8 is not set
+CONFIG_FONT_8x16=y
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+# CONFIG_FONT_ACORN_8x8 is not set
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+# CONFIG_LOGO is not set
+CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_SEQUENCER_OSS is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_VMASTER=y
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_ARM=y
+CONFIG_SND_PXA2XX_PCM=m
+CONFIG_SND_PXA2XX_LIB=m
+CONFIG_SND_PXA2XX_LIB_AC97=y
+CONFIG_SND_PXA2XX_AC97=m
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=m
+# CONFIG_SND_USB_CAIAQ is not set
+CONFIG_SND_PCMCIA=y
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_PDAUDIOCF is not set
+CONFIG_SND_SOC=m
+CONFIG_SND_PXA2XX_SOC=m
+CONFIG_SND_PXA2XX_SOC_I2S=m
+CONFIG_SND_PXA2XX_SOC_SPITZ=m
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_WM8750=m
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=m
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=m
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=m
+CONFIG_HID_APPLE=m
+CONFIG_HID_BELKIN=m
+CONFIG_HID_BRIGHT=m
+CONFIG_HID_CHERRY=m
+CONFIG_HID_CHICONY=m
+CONFIG_HID_CYPRESS=m
+CONFIG_HID_DELL=m
+CONFIG_HID_EZKEY=m
+CONFIG_HID_GYRATION=m
+CONFIG_HID_LOGITECH=m
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=m
+CONFIG_HID_MONTEREY=m
+CONFIG_HID_PANTHERLORD=m
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=m
+CONFIG_HID_SAMSUNG=m
+CONFIG_HID_SONY=m
+CONFIG_HID_SUNPLUS=m
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_GADGET_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+
+#
+# see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
+CONFIG_USB_SERIAL_BELKIN=m
+# CONFIG_USB_SERIAL_CH341 is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP2101=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+# CONFIG_USB_SERIAL_FUNSOFT is not set
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+# CONFIG_USB_SERIAL_IUU is not set
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+# CONFIG_USB_SERIAL_MOS7720 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_MOTOROLA is not set
+# CONFIG_USB_SERIAL_NAVMAN is not set
+CONFIG_USB_SERIAL_PL2303=m
+# CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
+# CONFIG_USB_SERIAL_HP4X is not set
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+# CONFIG_USB_SERIAL_OPTION is not set
+CONFIG_USB_SERIAL_OMNINET=m
+# CONFIG_USB_SERIAL_DEBUG is not set
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+# CONFIG_USB_BERRY_CHARGE is not set
+CONFIG_USB_LED=m
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+CONFIG_USB_CYTHERM=m
+# CONFIG_USB_PHIDGET is not set
+CONFIG_USB_IDMOUSE=m
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+CONFIG_USB_GADGET_PXA27X=y
+CONFIG_USB_PXA27X=m
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+CONFIG_MMC_PXA=y
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_PCA9532 is not set
+# CONFIG_LEDS_GPIO is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_IDE_DISK=y
+# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_SA1100=y
+# CONFIG_DMADEVICES is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_FS_XATTR is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+CONFIG_CRAMFS=m
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
+CONFIG_NFSD_V4=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=m
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_DETECT_SOFTLOCKUP is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHEDSTATS is not set
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_PREEMPT_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_DEBUG_USER is not set
+CONFIG_DEBUG_ERRORS=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_ALGAPI2=m
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=m
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER2=m
+CONFIG_CRYPTO_HASH=m
+CONFIG_CRYPTO_HASH2=m
+CONFIG_CRYPTO_RNG2=m
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=m
+# CONFIG_CRYPTO_GF128MUL is not set
+CONFIG_CRYPTO_NULL=m
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=m
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+# CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=m
+# CONFIG_CRYPTO_FCRYPT is not set
+CONFIG_CRYPTO_KHAZAD=m
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+
+#
+# OCF Configuration
+#
+# CONFIG_OCF_OCF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/target/zaurus/uclibc.config b/target/zaurus/uclibc.config
new file mode 100644
index 000000000..21c2be25a
--- /dev/null
+++ b/target/zaurus/uclibc.config
@@ -0,0 +1,244 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.30
+# Sat Feb 14 15:16:35 2009
+#
+# TARGET_alpha is not set
+TARGET_arm=y
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
+# TARGET_cris is not set
+# TARGET_e1 is not set
+# TARGET_frv is not set
+# TARGET_h8300 is not set
+# TARGET_hppa is not set
+# TARGET_i386 is not set
+# TARGET_i960 is not set
+# TARGET_ia64 is not set
+# TARGET_m68k is not set
+# TARGET_microblaze is not set
+# TARGET_mips is not set
+# TARGET_nios is not set
+# TARGET_nios2 is not set
+# TARGET_powerpc is not set
+# TARGET_sh is not set
+# TARGET_sh64 is not set
+# TARGET_sparc is not set
+# TARGET_v850 is not set
+# TARGET_vax is not set
+# TARGET_x86_64 is not set
+# TARGET_xtensa is not set
+
+#
+# Target Architecture Features and Options
+#
+TARGET_ARCH="arm"
+FORCE_OPTIONS_FOR_ARCH=y
+# CONFIG_ARM_OABI is not set
+CONFIG_ARM_EABI=y
+# USE_BX is not set
+# CONFIG_GENERIC_ARM is not set
+# CONFIG_ARM610 is not set
+# CONFIG_ARM710 is not set
+# CONFIG_ARM7TDMI is not set
+# CONFIG_ARM720T is not set
+# CONFIG_ARM920T is not set
+# CONFIG_ARM922T is not set
+# CONFIG_ARM926T is not set
+# CONFIG_ARM10T is not set
+# CONFIG_ARM1136JF_S is not set
+# CONFIG_ARM1176JZ_S is not set
+# CONFIG_ARM1176JZF_S is not set
+# CONFIG_ARM_CORTEX_M3 is not set
+# CONFIG_ARM_CORTEX_M1 is not set
+# CONFIG_ARM_SA110 is not set
+# CONFIG_ARM_SA1100 is not set
+CONFIG_ARM_XSCALE=y
+# CONFIG_ARM_IWMMXT is not set
+TARGET_SUBARCH=""
+
+#
+# Using ELF file format
+#
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+# ARCH_WANTS_BIG_ENDIAN is not set
+ARCH_WANTS_LITTLE_ENDIAN=y
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+UCLIBC_HAS_FLOATS=y
+# UCLIBC_HAS_FPU is not set
+UCLIBC_HAS_SOFT_FLOAT=y
+DO_C99_MATH=y
+UCLIBC_HAS_FENV=y
+KERNEL_HEADERS=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+DOPIC=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+# LDSO_GNU_HASH_SUPPORT is not set
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+PTHREADS_DEBUG_SUPPORT=y
+LINUXTHREADS_OLD=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+# UCLIBC_SUSV3_LEGACY is not set
+# UCLIBC_SUSV3_LEGACY_MACROS is not set
+# UCLIBC_HAS_STUBS is not set
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UCLIBC_HAS_PTY=y
+ASSUME_DEVPTS=y
+UNIX98PTY_ONLY=y
+# UCLIBC_HAS_GETPT is not set
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Support various families of functions
+#
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_BSD_ERR=y
+# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
+# UCLIBC_NTP_LEGACY is not set
+# UCLIBC_SV4_DEPRECATED is not set
+UCLIBC_HAS_REALTIME=y
+# UCLIBC_HAS_ADVANCED_REALTIME is not set
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_XATTR=y
+# UCLIBC_HAS_PROFILING is not set
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_IPV4=y
+# UCLIBC_HAS_IPV6 is not set
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_BSD_RES_CLOSE=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+UCLIBC_HAS_STDIO_BUFSIZ_4096=y
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+UCLIBC_HAS_REGEX_OLD=y
+UCLIBC_HAS_FNMATCH=y
+UCLIBC_HAS_FNMATCH_OLD=y
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+UCLIBC_HAS_ARC4RANDOM=y
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+DOSTRIP=y
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+WARNINGS="-Wall"
+EXTRA_WARNINGS=y
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
diff --git a/toolchain/Makefile b/toolchain/Makefile
new file mode 100644
index 000000000..de1c19024
--- /dev/null
+++ b/toolchain/Makefile
@@ -0,0 +1,92 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+TARGETS:=binutils gmp mpfr gcc
+ifeq ($(ADK_TARGET_LIB_GLIBC),y)
+TARGETS+=glibc
+LIBC:=glibc
+else
+TARGETS+=uClibc
+LIBC:=uClibc
+endif
+TARGETS+=gdb
+
+DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS))
+TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
+TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
+
+all: install
+install: $(TARGETS_INSTALL)
+clean: $(TARGETS_CLEAN)
+download: $(DOWNLOAD)
+
+$(LIBC)-prepare: kernel-headers-prepare
+binutils-prepare: $(LIBC)-prepare
+gcc-configure: binutils-install gmp-install mpfr-install
+$(LIBC)-compile: gcc-configure
+gcc-compile: $(LIBC)-install
+
+$(STAGING_TOOLS):
+ @mkdir -p $(STAGING_TOOLS)/lib
+ @mkdir -p $(STAGING_TOOLS)/include
+ @mkdir -p $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)
+ @ln -sf ../lib $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/lib
+
+$(TOOLCHAIN_BUILD_DIR):
+ @mkdir -p $(TOOLCHAIN_BUILD_DIR)
+
+%-download:
+ $(TRACE) toolchain/$(patsubst %-download,%,$@)/download
+ $(MAKE) -C $(patsubst %-download,%,$@) fetch
+
+%-prepare: $(STAGING_TOOLS) $(TOOLCHAIN_BUILD_DIR)
+ $(TRACE) toolchain/$(patsubst %-prepare,%,$@)/prepare
+ @if test x"$(patsubst %-prepare,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-prepare,%,$@) prepare \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-configure: %-prepare
+ $(TRACE) toolchain/$(patsubst %-configure,%,$@)/configure
+ @if test x"$(patsubst %-configure,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-configure,%,$@) configure \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-configure,%,$@) configure \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-compile: %-configure
+ $(TRACE) toolchain/$(patsubst %-compile,%,$@)/compile
+ @if test x"$(patsubst %-compile,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-compile,%,$@) compile \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-compile,%,$@) compile \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-install: %-compile
+ $(TRACE) toolchain/$(patsubst %-install,%,$@)/install
+ @if test x"$(patsubst %-install,%,$@)" = x"$(LIBC)"; then \
+ $(MAKE) -C $(patsubst %-install,%,$@) install \
+ $(MAKE_TRACE); \
+ else \
+ $(MAKE) -C $(patsubst %-install,%,$@) install \
+ CC='$(HOSTCC)' CFLAGS='$(HOSTCFLAGS)' \
+ $(MAKE_TRACE); \
+ fi
+
+%-clean:
+ $(TRACE) toolchain/$(patsubst %-clean,%,$@)/clean
+ @$(MAKE) -C $(patsubst %-clean,%,$@) clean $(MAKE_TRACE)
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
new file mode 100644
index 000000000..217b8e77b
--- /dev/null
+++ b/toolchain/binutils/Makefile
@@ -0,0 +1,43 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+ifeq ($(ADK_SSP),y)
+CONFOPTS+= --enable-libssp
+else
+CONFOPTS+= --disable-libssp
+endif
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ $(WRKBUILD)/configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ --with-sysroot=$(STAGING_DIR) \
+ ${CONFOPTS} \
+ --disable-dependency-tracking \
+ --disable-libtool-lock \
+ --disable-werror \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configure_done
+ $(MAKE) -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/binutils/Makefile.inc b/toolchain/binutils/Makefile.inc
new file mode 100644
index 000000000..bf6a71bdf
--- /dev/null
+++ b/toolchain/binutils/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= binutils
+PKG_VERSION:= 2.19.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 09a8c5821a2dfdbb20665bc0bd680791
+MASTER_SITES:= ${MASTER_SITE_GNU:=binutils/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
new file mode 100644
index 000000000..a85e4fa74
--- /dev/null
+++ b/toolchain/gcc/Makefile
@@ -0,0 +1,100 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+
+ifeq ($(ADK_CXX),y)
+TARGET_LANGUAGES:= c,c++
+else
+TARGET_LANGUAGES:= c
+endif
+
+GCC_CONFOPTS= --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --with-gmp=$(STAGING_TOOLS) \
+ --with-mpfr=$(STAGING_TOOLS) \
+ --disable-__cxa_atexit \
+ --enable-target-optspace \
+ --with-gnu-ld \
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-multilib \
+ --disable-nls
+
+ifeq ($(ADK_SSP),y)
+GCC_CONFOPTS+= --enable-libssp
+else
+GCC_CONFOPTS+= --disable-libssp
+endif
+
+ifeq ($(ADK_NO_FPU),y)
+GCC_CONFOPTS+= --with-float=soft
+endif
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+GCC_BUILD_DIR1:= $(WRKBUILD)-initial
+GCC_BUILD_DIR2:= $(WRKBUILD)-final
+
+$(WRKBUILD)/.headers:
+$(GCC_BUILD_DIR1)/.configured:
+ rm -rf $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/sys-include
+ ln -sf ${STAGING_DIR}/include $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/sys-include
+ rm -rf ${STAGING_TOOLS}/$(REAL_GNU_TARGET_NAME)/lib
+ ln -sf ${STAGING_DIR}/lib $(STAGING_TOOLS)/$(REAL_GNU_TARGET_NAME)/lib
+ mkdir -p $(GCC_BUILD_DIR1)
+ (cd $(GCC_BUILD_DIR1); rm -f config.cache; PATH=$(TARGET_PATH) \
+ $(WRKBUILD)/configure \
+ ${GCC_CONFOPTS} \
+ --enable-languages=c \
+ --disable-shared \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ );
+ touch $@
+
+$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc all-target-libgcc
+ touch $@
+
+$(WRKBUILD)/.configure_done: $(GCC_BUILD_DIR1)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc install-target-libgcc
+ touch $@
+
+$(GCC_BUILD_DIR2)/.configured:
+ mkdir -p $(GCC_BUILD_DIR2)
+ (cd $(GCC_BUILD_DIR2); rm -f config.cache; PATH=$(TARGET_PATH) \
+ $(WRKBUILD)/configure \
+ ${GCC_CONFOPTS} \
+ --enable-languages=$(TARGET_LANGUAGES) \
+ --with-sysroot=$(STAGING_DIR) \
+ --enable-shared \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(GCC_BUILD_DIR2)/.configured
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) install
+ echo $(GCC_VERSION) > $(STAGING_TOOLS)/gcc_version
+ # Set up the symlinks to enable lying about target name.
+ set -e; \
+ (cd $(STAGING_TOOLS); \
+ ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
+ cd bin; \
+ for app in $(REAL_GNU_TARGET_NAME)-* ; do \
+ ln -sf $${app} \
+ $(GNU_TARGET_NAME)$${app##$(REAL_GNU_TARGET_NAME)}; \
+ done; \
+ )
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/gcc/Makefile.inc b/toolchain/gcc/Makefile.inc
new file mode 100644
index 000000000..6d8be0f9d
--- /dev/null
+++ b/toolchain/gcc/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= gcc
+PKG_VERSION:= 4.3.3
+PKG_RELEASE:= 1
+PKG_MD5SUM:= cc3c5565fdb9ab87a05ddb106ba0bd1f
+MASTER_SITES:= ${MASTER_SITE_GNU:=gcc/gcc-${PKG_VERSION}/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/gcc/patches/arm-softfloat-libgcc.patch b/toolchain/gcc/patches/arm-softfloat-libgcc.patch
new file mode 100644
index 000000000..1639c39a8
--- /dev/null
+++ b/toolchain/gcc/patches/arm-softfloat-libgcc.patch
@@ -0,0 +1,29 @@
+Index: gcc-4.3.0/gcc/config/arm/t-linux
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/t-linux (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/t-linux (working copy)
+@@ -3,7 +3,10 @@
+ TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
+
+ LIB1ASMSRC = arm/lib1funcs.asm
+-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
++ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
+
+ # MULTILIB_OPTIONS = mhard-float/msoft-float
+ # MULTILIB_DIRNAMES = hard-float soft-float
+Index: gcc-4.3.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.3.0/gcc/config/arm/linux-elf.h (revision 129896)
++++ gcc-4.3.0/gcc/config/arm/linux-elf.h (working copy)
+@@ -48,7 +62,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
diff --git a/toolchain/gdb/Config.in b/toolchain/gdb/Config.in
new file mode 100644
index 000000000..03ceced0e
--- /dev/null
+++ b/toolchain/gdb/Config.in
@@ -0,0 +1,8 @@
+comment "Gdb Options"
+
+config ADK_PACKAGE_GDB_CLIENT
+ bool "Build gdb client for the Host"
+ default n
+ help
+ Build gdb to run on the host to debug programs running on the target.
+
diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
new file mode 100644
index 000000000..32e059334
--- /dev/null
+++ b/toolchain/gdb/Makefile
@@ -0,0 +1,47 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ gdb_cv_func_sigsetjmp=yes \
+ ./configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-dependency-tracking \
+ --without-uiout \
+ --enable-gdbmi \
+ --disable-gdbtk \
+ --without-included-gettext \
+ --disable-libtool-lock \
+ --disable-nls \
+ --with-curses \
+ --enable-threads \
+ --disable-sim \
+ --disable-tui \
+ --disable-werror \
+ --without-x \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ $(MAKE) -C $(WRKBUILD) CFLAGS="-fPIC ${HOSTCFLAGS}"
+ touch $@
+
+$(WRKBUILD)/.installed:
+ install -c $(WRKBUILD)/gdb/gdb $(TARGET_CROSS)gdb
+ cd $(STAGING_TOOLS)/bin && \
+ ln -fs $(TARGET_CROSS)gdb $(GNU_TARGET_NAME)-gdb
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/gdb/Makefile.inc b/toolchain/gdb/Makefile.inc
new file mode 100644
index 000000000..106ca30b8
--- /dev/null
+++ b/toolchain/gdb/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= gdb
+PKG_VERSION:= 6.8
+PKG_MD5SUM:= c9da266b884fb8fa54df786dfaadbc7a
+PKG_RELEASE:= 1
+MASTER_SITES:= ${MASTER_SITE_GNU:=gdb/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
new file mode 100644
index 000000000..a819c65d9
--- /dev/null
+++ b/toolchain/glibc/Makefile
@@ -0,0 +1,99 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+_IN_CVTC= 1
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+
+include ${TOPDIR}/mk/buildhlp.mk
+
+ifeq ($(ADK_NO_FPU),y)
+GLIBC_CONFOPTS:= --without-fp
+endif
+
+GLIBC_BUILD_DIR:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
+GLIBC_BUILD_DIR2:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
+
+$(WRKBUILD)/.headers_configure:
+ mkdir -p $(GLIBC_BUILD_DIR)
+ (cd $(GLIBC_BUILD_DIR); \
+ $(WRKBUILD)/configure \
+ --prefix=/usr \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --without-cvs \
+ --disable-sanity-checks \
+ ${GLIBC_CONFOPTS} \
+ --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ --with-sysroot=$(TOOLCHAIN_SYSROOT) \
+ );
+ touch $@
+
+$(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
+ $(MAKE) -C $(GLIBC_BUILD_DIR) \
+ cross-compiling=yes \
+ install_root=$(TOOLCHAIN_SYSROOT) \
+ CFLAGS="-DBOOTSTRAP_GCC" install-headers
+ touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
+ $(CP) $(GLIBC_BUILD_DIR)/bits/stdio_lim.h \
+ $(TOOLCHAIN_SYSROOT)/usr/include/bits
+ touch $@
+
+$(WRKBUILD)/.configure_done:
+ mkdir -p $(GLIBC_BUILD_DIR2)
+ (cd $(GLIBC_BUILD_DIR2); \
+ PATH='${TARGET_PATH}' \
+ BUILD_CC=gcc \
+ CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
+ CC=${REAL_GNU_TARGET_NAME}-gcc \
+ AR=${REAL_GNU_TARGET_NAME}-ar \
+ RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
+ LD=${REAL_GNU_TARGET_NAME}-ld \
+ libc_cv_forced_unwind=yes \
+ libc_cv_c_cleanup=yes \
+ $(WRKBUILD)/configure \
+ --prefix=/usr \
+ --build=$(GNU_TARGET_NAME) \
+ --host=$(REAL_GNU_TARGET_NAME) \
+ --disable-nls \
+ --without-cvs \
+ --disable-profile \
+ --disable-debug \
+ --without-gd \
+ --enable-shared \
+ --enable-stackguard-randomization \
+ --enable-add-ons=nptl --with-__thread \
+ --with-tls \
+ --enable-tls \
+ ${GLIBC_CONFOPTS} \
+ --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ PATH='${TARGET_PATH}' \
+ CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
+ CC=${REAL_GNU_TARGET_NAME}-gcc \
+ LD=${REAL_GNU_TARGET_NAME}-ld \
+ RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
+ $(MAKE) -C $(GLIBC_BUILD_DIR2) lib \
+ cross-compiling=yes
+ touch $@
+
+$(WRKBUILD)/.installed:
+ PATH='${TARGET_PATH}' \
+ #CFLAGS="$(TARGET_CFLAGS_ARCH) $(TARGET_CFLAGS)" \
+ $(MAKE) -C $(GLIBC_BUILD_DIR2) \
+ install_root=$(STAGING_DIR) \
+ install-lib-all install-headers \
+ install-others cross-compiling=yes
+ touch $(STAGING_DIR)/usr/include/gnu/stubs.h
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/glibc/Makefile.inc b/toolchain/glibc/Makefile.inc
new file mode 100644
index 000000000..b2784a195
--- /dev/null
+++ b/toolchain/glibc/Makefile.inc
@@ -0,0 +1,10 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= glibc
+PKG_VERSION:= 2.7
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 0b4bc75fb7413bbd7e43c0a0e7c672b6
+MASTER_SITES:= ${MASTER_SITE_GNU:=glibc/}
diff --git a/toolchain/glibc/patches/binutils.patch b/toolchain/glibc/patches/binutils.patch
new file mode 100644
index 000000000..5b1bd763e
--- /dev/null
+++ b/toolchain/glibc/patches/binutils.patch
@@ -0,0 +1,12 @@
+diff -Nur glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c glibc-2.7/sysdeps/i386/fpu/ftestexcept.c
+--- glibc-2.7.orig/sysdeps/i386/fpu/ftestexcept.c 2004-03-05 11:14:48.000000000 +0100
++++ glibc-2.7/sysdeps/i386/fpu/ftestexcept.c 2008-12-22 01:03:19.000000000 +0100
+@@ -26,7 +26,7 @@
+ int
+ fetestexcept (int excepts)
+ {
+- int temp;
++ short temp;
+ int xtemp = 0;
+
+ /* Get current exceptions. */
diff --git a/toolchain/glibc/patches/gcc43.patch b/toolchain/glibc/patches/gcc43.patch
new file mode 100644
index 000000000..8bd45ee8c
--- /dev/null
+++ b/toolchain/glibc/patches/gcc43.patch
@@ -0,0 +1,18 @@
+diff -Nur glibc-2.7.orig/configure glibc-2.7/configure
+--- glibc-2.7.orig/configure 2007-10-18 13:22:23.000000000 +0200
++++ glibc-2.7/configure 2008-11-29 23:48:57.461566623 +0100
+@@ -5062,8 +5062,12 @@
+ # header directory and add that to the list. NOTE: Only does the right
+ # thing on a system that doesn't need fixincludes. (Not presently a problem.)
+ if test -n "$sysheaders"; then
+- ccheaders=`$CC -print-file-name=include`
+- SYSINCLUDES="-nostdinc -isystem $ccheaders \
++ SYSINCLUDES=-nostdinc
++ for d in include include-fixed; do
++ i=`$CC -print-file-name="$d"` && test "x$i" != "x$d" &&
++ SYSINCLUDES="$SYSINCLUDES -isystem $i"
++ done
++ SYSINCLUDES="$SYSINCLUDES \
+ -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
+ if test -n "$CXX"; then
+ cxxversion=`$CXX -dumpversion 2>&5` &&
diff --git a/toolchain/glibc/patches/i586-chk.patch b/toolchain/glibc/patches/i586-chk.patch
new file mode 100644
index 000000000..8ebc182e0
--- /dev/null
+++ b/toolchain/glibc/patches/i586-chk.patch
@@ -0,0 +1,15 @@
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/memcpy_chk.S glibc-2.7/sysdeps/i386/i586/memcpy_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/memcpy_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/memcpy_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/memcpy_chk.S>
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/mempcpy_chk.S glibc-2.7/sysdeps/i386/i586/mempcpy_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/mempcpy_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/mempcpy_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/mempcpy_chk.S>
+diff -Nur glibc-2.7.orig/sysdeps/i386/i586/memset_chk.S glibc-2.7/sysdeps/i386/i586/memset_chk.S
+--- glibc-2.7.orig/sysdeps/i386/i586/memset_chk.S 1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.7/sysdeps/i386/i586/memset_chk.S 2008-09-17 12:22:02.000000000 +0200
+@@ -0,0 +1 @@
++#include <sysdeps/i386/i686/memset_chk.S>
diff --git a/toolchain/glibc/patches/install-extra.patch b/toolchain/glibc/patches/install-extra.patch
new file mode 100644
index 000000000..790bafc17
--- /dev/null
+++ b/toolchain/glibc/patches/install-extra.patch
@@ -0,0 +1,84 @@
+diff -Nur glibc-2.7.orig/elf/Makefile glibc-2.7/elf/Makefile
+--- glibc-2.7.orig/elf/Makefile 2007-08-16 23:20:11.000000000 +0200
++++ glibc-2.7/elf/Makefile 2008-09-17 08:57:12.000000000 +0200
+@@ -116,7 +116,7 @@
+ ifeq (yes,$(build-shared))
+ extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
+ generated += librtld.os dl-allobjs.os ld.so ldd
+-install-others = $(inst_slibdir)/$(rtld-installed-name)
++install-extra = $(inst_slibdir)/$(rtld-installed-name)
+ install-bin-script = ldd
+ endif
+
+diff -Nur glibc-2.7.orig/iconvdata/Makefile glibc-2.7/iconvdata/Makefile
+--- glibc-2.7.orig/iconvdata/Makefile 2007-09-30 06:00:02.000000000 +0200
++++ glibc-2.7/iconvdata/Makefile 2008-09-17 08:56:57.000000000 +0200
+@@ -211,7 +211,7 @@
+
+
+ extra-objs += $(modules.so)
+-install-others = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
++install-extra = $(addprefix $(inst_gconvdir)/, $(modules.so)) \
+ $(inst_gconvdir)/gconv-modules
+
+ # We can build the conversion tables for numerous charsets automatically.
+diff -Nur glibc-2.7.orig/intl/Makefile glibc-2.7/intl/Makefile
+--- glibc-2.7.orig/intl/Makefile 2005-05-04 19:53:42.000000000 +0200
++++ glibc-2.7/intl/Makefile 2008-09-17 08:55:58.000000000 +0200
+@@ -45,7 +45,7 @@
+
+ before-compile = $(objpfx)msgs.h
+
+-install-others = $(inst_msgcatdir)/locale.alias
++install-extra = $(inst_msgcatdir)/locale.alias
+
+ generated = msgs.h mtrace-tst-gettext tst-gettext.mtrace
+ generated-dirs := domaindir localedir
+diff -Nur glibc-2.7.orig/localedata/Makefile glibc-2.7/localedata/Makefile
+--- glibc-2.7.orig/localedata/Makefile 2007-10-02 19:19:40.000000000 +0200
++++ glibc-2.7/localedata/Makefile 2008-09-17 08:55:35.000000000 +0200
+@@ -102,7 +102,7 @@
+ endif
+
+ # Files to install.
+-install-others := $(addprefix $(inst_i18ndir)/, \
++install-extra := $(addprefix $(inst_i18ndir)/, \
+ $(addsuffix .gz, $(charmaps)) \
+ $(locales))
+
+diff -Nur glibc-2.7.orig/po/Makefile glibc-2.7/po/Makefile
+--- glibc-2.7.orig/po/Makefile 2007-05-29 20:08:41.000000000 +0200
++++ glibc-2.7/po/Makefile 2008-09-17 08:55:15.000000000 +0200
+@@ -46,7 +46,7 @@
+ mo-installed = $(inst_msgcatdir)/%/LC_MESSAGES/$(domainname).mo
+
+ # Files to install: a $(domainname).mo file for each language.
+-install-others = $(LINGUAS:%=$(mo-installed))
++install-extra = $(LINGUAS:%=$(mo-installed))
+
+ # Files to distribute: all the source and compiled binary translation files.
+ distribute = $(ALL_LINGUAS:=.po) $(BROKEN_LINGUAS:=.po) $(ALL_LINGUAS:=.mo) \
+diff -Nur glibc-2.7.orig/sunrpc/Makefile glibc-2.7/sunrpc/Makefile
+--- glibc-2.7.orig/sunrpc/Makefile 2006-10-18 21:25:38.000000000 +0200
++++ glibc-2.7/sunrpc/Makefile 2008-09-17 08:54:26.000000000 +0200
+@@ -52,7 +52,7 @@
+ svc_auth.h types.h xdr.h auth_des.h \
+ des_crypt.h key_prot.h rpc_des.h) \
+ $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
+-install-others = $(inst_sysconfdir)/rpc
++install-extra = $(inst_sysconfdir)/rpc
+ generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
+ $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
+ generated-dirs := rpcsvc
+diff -Nur glibc-2.7.orig/timezone/Makefile glibc-2.7/timezone/Makefile
+--- glibc-2.7.orig/timezone/Makefile 2007-07-28 22:33:11.000000000 +0200
++++ glibc-2.7/timezone/Makefile 2008-09-17 08:54:43.000000000 +0200
+@@ -71,7 +71,7 @@
+
+ ifeq ($(cross-compiling),no)
+ # Don't try to install the zoneinfo files since we can't run zic.
+-install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
++install-extra = $(addprefix $(inst_zonedir)/,$(zonenames) \
+ $(zonenames:%=posix/%) \
+ $(zonenames:%=right/%)) \
+ $(installed-localtime-file) $(installed-posixrules-file)
diff --git a/toolchain/glibc/patches/make-install-lib.patch b/toolchain/glibc/patches/make-install-lib.patch
new file mode 100644
index 000000000..b5fb9295a
--- /dev/null
+++ b/toolchain/glibc/patches/make-install-lib.patch
@@ -0,0 +1,17 @@
+diff -Nur glibc-2.7.orig/Makerules glibc-2.7/Makerules
+--- glibc-2.7.orig/Makerules 2007-08-26 04:18:03.000000000 +0200
++++ glibc-2.7/Makerules 2008-09-12 11:35:40.000000000 +0200
+@@ -867,6 +867,13 @@
+ installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
+ $(inst_libdir)/$(patsubst %,$(libtype$o),\
+ $(libprefix)$(libc-name)))
++
++install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
++ $(inst_slibdir)/libc-$(version).so \
++ $(inst_libdir)/libc.so \
++ $(inst_libdir)/libc.a \
++ install-lib
++
+ install: $(installed-libcs)
+ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
+ $(make-target-directory)
diff --git a/toolchain/gmp/Makefile b/toolchain/gmp/Makefile
new file mode 100644
index 000000000..937f1b411
--- /dev/null
+++ b/toolchain/gmp/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ $(WRKBUILD)/configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --disable-shared \
+ --enable-static \
+ --disable-nls \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configure_done
+ $(MAKE) -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/gmp/Makefile.inc b/toolchain/gmp/Makefile.inc
new file mode 100644
index 000000000..f0db3fb5b
--- /dev/null
+++ b/toolchain/gmp/Makefile.inc
@@ -0,0 +1,12 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= gmp
+PKG_VERSION:= 4.2.2
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 7ce52531644e6d12f16911b7e3151f3f
+MASTER_SITES:= ${MASTER_SITE_GNU:=gmp/}
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
+GMP_BUILD_DIR:= $(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
new file mode 100644
index 000000000..add626b94
--- /dev/null
+++ b/toolchain/kernel-headers/Makefile
@@ -0,0 +1,32 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include $(TOPDIR)/mk/linux.mk
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+ $(MAKE) -C $(WRKBUILD) ARCH=$(ARCH) V=1 \
+ INSTALL_HDR_PATH=$(STAGING_DIR)/usr \
+ headers_install
+ $(MAKE) -C $(WRKBUILD) ARCH=$(ARCH) V=1 \
+ INSTALL_HDR_PATH=$(TOOLCHAIN_SYSROOT)/usr \
+ headers_install
+ # cryptodev.h from ocf-linux-20080917
+ mkdir -p ${STAGING_DIR}/include/crypto
+ cp files/cryptodev.h ${STAGING_DIR}/include/crypto/
+ifeq ($(ARCH),cris)
+ifeq ($(CPU_ARCH),crisv32)
+ cd $(STAGING_DIR)/usr/include && ln -sf arch-v32/arch arch
+ cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v32/arch arch
+else
+ cd $(STAGING_DIR)/usr/include && ln -sf arch-v10/arch arch
+ cd $(TOOLCHAIN_SYSROOT)/usr/include && ln -sf arch-v10/arch arch
+endif
+endif
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/kernel-headers/files/cryptodev.h b/toolchain/kernel-headers/files/cryptodev.h
new file mode 100644
index 000000000..fa1a57b4f
--- /dev/null
+++ b/toolchain/kernel-headers/files/cryptodev.h
@@ -0,0 +1,478 @@
+/* $FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.25 2007/05/09 19:37:02 gnn Exp $ */
+/* $OpenBSD: cryptodev.h,v 1.31 2002/06/11 11:14:29 beck Exp $ */
+
+/*-
+ * Linux port done by David McCullough <david_mccullough@securecomputing.com>
+ * Copyright (C) 2006-2007 David McCullough
+ * Copyright (C) 2004-2005 Intel Corporation.
+ * The license and original author are listed below.
+ *
+ * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
+ * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
+ *
+ * This code was written by Angelos D. Keromytis in Athens, Greece, in
+ * February 2000. Network Security Technologies Inc. (NSTI) kindly
+ * supported the development of this code.
+ *
+ * Copyright (c) 2000 Angelos D. Keromytis
+ *
+ * Permission to use, copy, and modify this software with or without fee
+ * is hereby granted, provided that this entire notice is included in
+ * all source code copies of any software which is or includes a copy or
+ * modification of this software.
+ *
+ * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
+ * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
+ * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
+ * PURPOSE.
+ *
+ * Copyright (c) 2001 Theo de Raadt
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Effort sponsored in part by the Defense Advanced Research Projects
+ * Agency (DARPA) and Air Force Research Laboratory, Air Force
+ * Materiel Command, USAF, under agreement number F30602-01-2-0537.
+ *
+ */
+
+#ifndef _CRYPTO_CRYPTO_H_
+#define _CRYPTO_CRYPTO_H_
+
+/* Some initial values */
+#define CRYPTO_DRIVERS_INITIAL 4
+#define CRYPTO_SW_SESSIONS 32
+
+/* Hash values */
+#define NULL_HASH_LEN 0
+#define MD5_HASH_LEN 16
+#define SHA1_HASH_LEN 20
+#define RIPEMD160_HASH_LEN 20
+#define SHA2_256_HASH_LEN 32
+#define SHA2_384_HASH_LEN 48
+#define SHA2_512_HASH_LEN 64
+#define MD5_KPDK_HASH_LEN 16
+#define SHA1_KPDK_HASH_LEN 20
+/* Maximum hash algorithm result length */
+#define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */
+
+/* HMAC values */
+#define NULL_HMAC_BLOCK_LEN 1
+#define MD5_HMAC_BLOCK_LEN 64
+#define SHA1_HMAC_BLOCK_LEN 64
+#define RIPEMD160_HMAC_BLOCK_LEN 64
+#define SHA2_256_HMAC_BLOCK_LEN 64
+#define SHA2_384_HMAC_BLOCK_LEN 128
+#define SHA2_512_HMAC_BLOCK_LEN 128
+/* Maximum HMAC block length */
+#define HMAC_MAX_BLOCK_LEN SHA2_512_HMAC_BLOCK_LEN /* Keep this updated */
+#define HMAC_IPAD_VAL 0x36
+#define HMAC_OPAD_VAL 0x5C
+
+/* Encryption algorithm block sizes */
+#define NULL_BLOCK_LEN 1
+#define DES_BLOCK_LEN 8
+#define DES3_BLOCK_LEN 8
+#define BLOWFISH_BLOCK_LEN 8
+#define SKIPJACK_BLOCK_LEN 8
+#define CAST128_BLOCK_LEN 8
+#define RIJNDAEL128_BLOCK_LEN 16
+#define AES_BLOCK_LEN RIJNDAEL128_BLOCK_LEN
+#define CAMELLIA_BLOCK_LEN 16
+#define ARC4_BLOCK_LEN 1
+#define EALG_MAX_BLOCK_LEN AES_BLOCK_LEN /* Keep this updated */
+
+/* Encryption algorithm min and max key sizes */
+#define NULL_MIN_KEY_LEN 0
+#define NULL_MAX_KEY_LEN 0
+#define DES_MIN_KEY_LEN 8
+#define DES_MAX_KEY_LEN 8
+#define DES3_MIN_KEY_LEN 24
+#define DES3_MAX_KEY_LEN 24
+#define BLOWFISH_MIN_KEY_LEN 4
+#define BLOWFISH_MAX_KEY_LEN 56
+#define SKIPJACK_MIN_KEY_LEN 10
+#define SKIPJACK_MAX_KEY_LEN 10
+#define CAST128_MIN_KEY_LEN 5
+#define CAST128_MAX_KEY_LEN 16
+#define RIJNDAEL128_MIN_KEY_LEN 16
+#define RIJNDAEL128_MAX_KEY_LEN 32
+#define AES_MIN_KEY_LEN RIJNDAEL128_MIN_KEY_LEN
+#define AES_MAX_KEY_LEN RIJNDAEL128_MAX_KEY_LEN
+#define CAMELLIA_MIN_KEY_LEN 16
+#define CAMELLIA_MAX_KEY_LEN 32
+#define ARC4_MIN_KEY_LEN 1
+#define ARC4_MAX_KEY_LEN 256
+
+/* Max size of data that can be processed */
+#define CRYPTO_MAX_DATA_LEN 64*1024 - 1
+
+#define CRYPTO_ALGORITHM_MIN 1
+#define CRYPTO_DES_CBC 1
+#define CRYPTO_3DES_CBC 2
+#define CRYPTO_BLF_CBC 3
+#define CRYPTO_CAST_CBC 4
+#define CRYPTO_SKIPJACK_CBC 5
+#define CRYPTO_MD5_HMAC 6
+#define CRYPTO_SHA1_HMAC 7
+#define CRYPTO_RIPEMD160_HMAC 8
+#define CRYPTO_MD5_KPDK 9
+#define CRYPTO_SHA1_KPDK 10
+#define CRYPTO_RIJNDAEL128_CBC 11 /* 128 bit blocksize */
+#define CRYPTO_AES_CBC 11 /* 128 bit blocksize -- the same as above */
+#define CRYPTO_ARC4 12
+#define CRYPTO_MD5 13
+#define CRYPTO_SHA1 14
+#define CRYPTO_NULL_HMAC 15
+#define CRYPTO_NULL_CBC 16
+#define CRYPTO_DEFLATE_COMP 17 /* Deflate compression algorithm */
+#define CRYPTO_SHA2_256_HMAC 18
+#define CRYPTO_SHA2_384_HMAC 19
+#define CRYPTO_SHA2_512_HMAC 20
+#define CRYPTO_CAMELLIA_CBC 21
+#define CRYPTO_SHA2_256 22
+#define CRYPTO_SHA2_384 23
+#define CRYPTO_SHA2_512 24
+#define CRYPTO_RIPEMD160 25
+#define CRYPTO_ALGORITHM_MAX 25 /* Keep updated - see below */
+
+/* Algorithm flags */
+#define CRYPTO_ALG_FLAG_SUPPORTED 0x01 /* Algorithm is supported */
+#define CRYPTO_ALG_FLAG_RNG_ENABLE 0x02 /* Has HW RNG for DH/DSA */
+#define CRYPTO_ALG_FLAG_DSA_SHA 0x04 /* Can do SHA on msg */
+
+/*
+ * Crypto driver/device flags. They can set in the crid
+ * parameter when creating a session or submitting a key
+ * op to affect the device/driver assigned. If neither
+ * of these are specified then the crid is assumed to hold
+ * the driver id of an existing (and suitable) device that
+ * must be used to satisfy the request.
+ */
+#define CRYPTO_FLAG_HARDWARE 0x01000000 /* hardware accelerated */
+#define CRYPTO_FLAG_SOFTWARE 0x02000000 /* software implementation */
+
+/* NB: deprecated */
+struct session_op {
+ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
+ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
+
+ u_int32_t keylen; /* cipher key */
+ caddr_t key;
+ int mackeylen; /* mac key */
+ caddr_t mackey;
+
+ u_int32_t ses; /* returns: session # */
+};
+
+struct session2_op {
+ u_int32_t cipher; /* ie. CRYPTO_DES_CBC */
+ u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */
+
+ u_int32_t keylen; /* cipher key */
+ caddr_t key;
+ int mackeylen; /* mac key */
+ caddr_t mackey;
+
+ u_int32_t ses; /* returns: session # */
+ int crid; /* driver id + flags (rw) */
+ int pad[4]; /* for future expansion */
+};
+
+struct crypt_op {
+ u_int32_t ses;
+ u_int16_t op; /* i.e. COP_ENCRYPT */
+#define COP_NONE 0
+#define COP_ENCRYPT 1
+#define COP_DECRYPT 2
+ u_int16_t flags;
+#define COP_F_BATCH 0x0008 /* Batch op if possible */
+ u_int len;
+ caddr_t src, dst; /* become iov[] inside kernel */
+ caddr_t mac; /* must be big enough for chosen MAC */
+ caddr_t iv;
+};
+
+/*
+ * Parameters for looking up a crypto driver/device by
+ * device name or by id. The latter are returned for
+ * created sessions (crid) and completed key operations.
+ */
+struct crypt_find_op {
+ int crid; /* driver id + flags */
+ char name[32]; /* device/driver name */
+};
+
+/* bignum parameter, in packed bytes, ... */
+struct crparam {
+ caddr_t crp_p;
+ u_int crp_nbits;
+};
+
+#define CRK_MAXPARAM 8
+
+struct crypt_kop {
+ u_int crk_op; /* ie. CRK_MOD_EXP or other */
+ u_int crk_status; /* return status */
+ u_short crk_iparams; /* # of input parameters */
+ u_short crk_oparams; /* # of output parameters */
+ u_int crk_crid; /* NB: only used by CIOCKEY2 (rw) */
+ struct crparam crk_param[CRK_MAXPARAM];
+};
+#define CRK_ALGORITM_MIN 0
+#define CRK_MOD_EXP 0
+#define CRK_MOD_EXP_CRT 1
+#define CRK_DSA_SIGN 2
+#define CRK_DSA_VERIFY 3
+#define CRK_DH_COMPUTE_KEY 4
+#define CRK_ALGORITHM_MAX 4 /* Keep updated - see below */
+
+#define CRF_MOD_EXP (1 << CRK_MOD_EXP)
+#define CRF_MOD_EXP_CRT (1 << CRK_MOD_EXP_CRT)
+#define CRF_DSA_SIGN (1 << CRK_DSA_SIGN)
+#define CRF_DSA_VERIFY (1 << CRK_DSA_VERIFY)
+#define CRF_DH_COMPUTE_KEY (1 << CRK_DH_COMPUTE_KEY)
+
+/*
+ * done against open of /dev/crypto, to get a cloned descriptor.
+ * Please use F_SETFD against the cloned descriptor.
+ */
+#define CRIOGET _IOWR('c', 100, u_int32_t)
+#define CRIOASYMFEAT CIOCASYMFEAT
+#define CRIOFINDDEV CIOCFINDDEV
+
+/* the following are done against the cloned descriptor */
+#define CIOCGSESSION _IOWR('c', 101, struct session_op)
+#define CIOCFSESSION _IOW('c', 102, u_int32_t)
+#define CIOCCRYPT _IOWR('c', 103, struct crypt_op)
+#define CIOCKEY _IOWR('c', 104, struct crypt_kop)
+#define CIOCASYMFEAT _IOR('c', 105, u_int32_t)
+#define CIOCGSESSION2 _IOWR('c', 106, struct session2_op)
+#define CIOCKEY2 _IOWR('c', 107, struct crypt_kop)
+#define CIOCFINDDEV _IOWR('c', 108, struct crypt_find_op)
+
+struct cryptotstat {
+ struct timespec acc; /* total accumulated time */
+ struct timespec min; /* min time */
+ struct timespec max; /* max time */
+ u_int32_t count; /* number of observations */
+};
+
+struct cryptostats {
+ u_int32_t cs_ops; /* symmetric crypto ops submitted */
+ u_int32_t cs_errs; /* symmetric crypto ops that failed */
+ u_int32_t cs_kops; /* asymetric/key ops submitted */
+ u_int32_t cs_kerrs; /* asymetric/key ops that failed */
+ u_int32_t cs_intrs; /* crypto swi thread activations */
+ u_int32_t cs_rets; /* crypto return thread activations */
+ u_int32_t cs_blocks; /* symmetric op driver block */
+ u_int32_t cs_kblocks; /* symmetric op driver block */
+ /*
+ * When CRYPTO_TIMING is defined at compile time and the
+ * sysctl debug.crypto is set to 1, the crypto system will
+ * accumulate statistics about how long it takes to process
+ * crypto requests at various points during processing.
+ */
+ struct cryptotstat cs_invoke; /* crypto_dipsatch -> crypto_invoke */
+ struct cryptotstat cs_done; /* crypto_invoke -> crypto_done */
+ struct cryptotstat cs_cb; /* crypto_done -> callback */
+ struct cryptotstat cs_finis; /* callback -> callback return */
+
+ u_int32_t cs_drops; /* crypto ops dropped due to congestion */
+};
+
+#ifdef __KERNEL__
+
+/* Standard initialization structure beginning */
+struct cryptoini {
+ int cri_alg; /* Algorithm to use */
+ int cri_klen; /* Key length, in bits */
+ int cri_mlen; /* Number of bytes we want from the
+ entire hash. 0 means all. */
+ caddr_t cri_key; /* key to use */
+ u_int8_t cri_iv[EALG_MAX_BLOCK_LEN]; /* IV to use */
+ struct cryptoini *cri_next;
+};
+
+/* Describe boundaries of a single crypto operation */
+struct cryptodesc {
+ int crd_skip; /* How many bytes to ignore from start */
+ int crd_len; /* How many bytes to process */
+ int crd_inject; /* Where to inject results, if applicable */
+ int crd_flags;
+
+#define CRD_F_ENCRYPT 0x01 /* Set when doing encryption */
+#define CRD_F_IV_PRESENT 0x02 /* When encrypting, IV is already in
+ place, so don't copy. */
+#define CRD_F_IV_EXPLICIT 0x04 /* IV explicitly provided */
+#define CRD_F_DSA_SHA_NEEDED 0x08 /* Compute SHA-1 of buffer for DSA */
+#define CRD_F_KEY_EXPLICIT 0x10 /* Key explicitly provided */
+#define CRD_F_COMP 0x0f /* Set when doing compression */
+
+ struct cryptoini CRD_INI; /* Initialization/context data */
+#define crd_iv CRD_INI.cri_iv
+#define crd_key CRD_INI.cri_key
+#define crd_alg CRD_INI.cri_alg
+#define crd_klen CRD_INI.cri_klen
+
+ struct cryptodesc *crd_next;
+};
+
+/* Structure describing complete operation */
+struct cryptop {
+ struct list_head crp_next;
+ wait_queue_head_t crp_waitq;
+
+ u_int64_t crp_sid; /* Session ID */
+ int crp_ilen; /* Input data total length */
+ int crp_olen; /* Result total length */
+
+ int crp_etype; /*
+ * Error type (zero means no error).
+ * All error codes except EAGAIN
+ * indicate possible data corruption (as in,
+ * the data have been touched). On all
+ * errors, the crp_sid may have changed
+ * (reset to a new one), so the caller
+ * should always check and use the new
+ * value on future requests.
+ */
+ int crp_flags;
+
+#define CRYPTO_F_SKBUF 0x0001 /* Input/output are skbuf chains */
+#define CRYPTO_F_IOV 0x0002 /* Input/output are uio */
+#define CRYPTO_F_REL 0x0004 /* Must return data in same place */
+#define CRYPTO_F_BATCH 0x0008 /* Batch op if possible */
+#define CRYPTO_F_CBIMM 0x0010 /* Do callback immediately */
+#define CRYPTO_F_DONE 0x0020 /* Operation completed */
+#define CRYPTO_F_CBIFSYNC 0x0040 /* Do CBIMM if op is synchronous */
+
+ caddr_t crp_buf; /* Data to be processed */
+ caddr_t crp_opaque; /* Opaque pointer, passed along */
+ struct cryptodesc *crp_desc; /* Linked list of processing descriptors */
+
+ int (*crp_callback)(struct cryptop *); /* Callback function */
+};
+
+#define CRYPTO_BUF_CONTIG 0x0
+#define CRYPTO_BUF_IOV 0x1
+#define CRYPTO_BUF_SKBUF 0x2
+
+#define CRYPTO_OP_DECRYPT 0x0
+#define CRYPTO_OP_ENCRYPT 0x1
+
+/*
+ * Hints passed to process methods.
+ */
+#define CRYPTO_HINT_MORE 0x1 /* more ops coming shortly */
+
+struct cryptkop {
+ struct list_head krp_next;
+ wait_queue_head_t krp_waitq;
+
+ int krp_flags;
+#define CRYPTO_KF_DONE 0x0001 /* Operation completed */
+#define CRYPTO_KF_CBIMM 0x0002 /* Do callback immediately */
+
+ u_int krp_op; /* ie. CRK_MOD_EXP or other */
+ u_int krp_status; /* return status */
+ u_short krp_iparams; /* # of input parameters */
+ u_short krp_oparams; /* # of output parameters */
+ u_int krp_crid; /* desired device, etc. */
+ u_int32_t krp_hid;
+ struct crparam krp_param[CRK_MAXPARAM]; /* kvm */
+ int (*krp_callback)(struct cryptkop *);
+};
+
+#include <ocf-compat.h>
+
+/*
+ * Session ids are 64 bits. The lower 32 bits contain a "local id" which
+ * is a driver-private session identifier. The upper 32 bits contain a
+ * "hardware id" used by the core crypto code to identify the driver and
+ * a copy of the driver's capabilities that can be used by client code to
+ * optimize operation.
+ */
+#define CRYPTO_SESID2HID(_sid) (((_sid) >> 32) & 0x00ffffff)
+#define CRYPTO_SESID2CAPS(_sid) (((_sid) >> 32) & 0xff000000)
+#define CRYPTO_SESID2LID(_sid) (((u_int32_t) (_sid)) & 0xffffffff)
+
+extern int crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard);
+extern int crypto_freesession(u_int64_t sid);
+#define CRYPTOCAP_F_HARDWARE CRYPTO_FLAG_HARDWARE
+#define CRYPTOCAP_F_SOFTWARE CRYPTO_FLAG_SOFTWARE
+#define CRYPTOCAP_F_SYNC 0x04000000 /* operates synchronously */
+extern int32_t crypto_get_driverid(device_t dev, int flags);
+extern int crypto_find_driver(const char *);
+extern device_t crypto_find_device_byhid(int hid);
+extern int crypto_getcaps(int hid);
+extern int crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen,
+ u_int32_t flags);
+extern int crypto_kregister(u_int32_t, int, u_int32_t);
+extern int crypto_unregister(u_int32_t driverid, int alg);
+extern int crypto_unregister_all(u_int32_t driverid);
+extern int crypto_dispatch(struct cryptop *crp);
+extern int crypto_kdispatch(struct cryptkop *);
+#define CRYPTO_SYMQ 0x1
+#define CRYPTO_ASYMQ 0x2
+extern int crypto_unblock(u_int32_t, int);
+extern void crypto_done(struct cryptop *crp);
+extern void crypto_kdone(struct cryptkop *);
+extern int crypto_getfeat(int *);
+
+extern void crypto_freereq(struct cryptop *crp);
+extern struct cryptop *crypto_getreq(int num);
+
+extern int crypto_usercrypto; /* userland may do crypto requests */
+extern int crypto_userasymcrypto; /* userland may do asym crypto reqs */
+extern int crypto_devallowsoft; /* only use hardware crypto */
+
+/*
+ * random number support, crypto_unregister_all will unregister
+ */
+extern int crypto_rregister(u_int32_t driverid,
+ int (*read_random)(void *arg, u_int32_t *buf, int len), void *arg);
+extern int crypto_runregister_all(u_int32_t driverid);
+
+/*
+ * Crypto-related utility routines used mainly by drivers.
+ *
+ * XXX these don't really belong here; but for now they're
+ * kept apart from the rest of the system.
+ */
+struct uio;
+extern void cuio_copydata(struct uio* uio, int off, int len, caddr_t cp);
+extern void cuio_copyback(struct uio* uio, int off, int len, caddr_t cp);
+extern struct iovec *cuio_getptr(struct uio *uio, int loc, int *off);
+
+extern void crypto_copyback(int flags, caddr_t buf, int off, int size,
+ caddr_t in);
+extern void crypto_copydata(int flags, caddr_t buf, int off, int size,
+ caddr_t out);
+extern int crypto_apply(int flags, caddr_t buf, int off, int len,
+ int (*f)(void *, void *, u_int), void *arg);
+
+#endif /* __KERNEL__ */
+#endif /* _CRYPTO_CRYPTO_H_ */
diff --git a/toolchain/kernel-headers/patches/cleankernel.patch b/toolchain/kernel-headers/patches/cleankernel.patch
new file mode 100644
index 000000000..f8d5448ee
--- /dev/null
+++ b/toolchain/kernel-headers/patches/cleankernel.patch
@@ -0,0 +1,11 @@
+diff -Nur linux-2.6.29.1.orig/scripts/Makefile.headersinst linux-2.6.29.1/scripts/Makefile.headersinst
+--- linux-2.6.29.1.orig/scripts/Makefile.headersinst 2009-04-02 22:55:27.000000000 +0200
++++ linux-2.6.29.1/scripts/Makefile.headersinst 2009-04-17 20:56:09.143476927 +0200
+@@ -65,7 +65,6 @@
+
+ targets += $(install-file)
+ $(install-file): scripts/headers_install.pl $(input-files) FORCE
+- $(if $(unwanted),$(call cmd,remove),)
+ $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
+ $(call if_changed,install)
+
diff --git a/toolchain/kernel-headers/patches/etrax-header.patch b/toolchain/kernel-headers/patches/etrax-header.patch
new file mode 100644
index 000000000..fadcf5d53
--- /dev/null
+++ b/toolchain/kernel-headers/patches/etrax-header.patch
@@ -0,0 +1,68 @@
+diff -Nur linux-2.6.28.orig/arch/cris/include/arch-v10/arch/Kbuild linux-2.6.28/arch/cris/include/arch-v10/arch/Kbuild
+--- linux-2.6.28.orig/arch/cris/include/arch-v10/arch/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/include/arch-v10/arch/Kbuild 2008-12-29 20:49:24.000000000 +0100
+@@ -1,4 +1,9 @@
++header-y += dma.h
++header-y += io_interface_mux.h
+ header-y += user.h
+ header-y += svinto.h
+ header-y += sv_addr_ag.h
+ header-y += sv_addr.agh
++header-y += elf.h
++header-y += page.h
++header-y += ptrace.h
+diff -Nur linux-2.6.28.orig/arch/cris/include/arch-v32/arch/Kbuild linux-2.6.28/arch/cris/include/arch-v32/arch/Kbuild
+--- linux-2.6.28.orig/arch/cris/include/arch-v32/arch/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/include/arch-v32/arch/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -1,2 +1,6 @@
+ header-y += user.h
+ header-y += cryptocop.h
++header-y += elf.h
++header-y += page.h
++header-y += ptrace.h
++
+diff -Nur linux-2.6.28.orig/arch/cris/include/asm/Kbuild linux-2.6.28/arch/cris/include/asm/Kbuild
+--- linux-2.6.28.orig/arch/cris/include/asm/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/arch/cris/include/asm/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -1,11 +1,14 @@
+ include include/asm-generic/Kbuild.asm
+
+-header-y += arch-v10/
+-header-y += arch-v32/
++header-y += ../arch-v10/arch/
++header-y += ../arch-v32/arch/
+
++header-y += elf.h
+ header-y += ethernet.h
+ header-y += rtc.h
+ header-y += sync_serial.h
++header-y += page.h
++header-y += user.h
+
+ unifdef-y += etraxgpio.h
+ unifdef-y += rs485.h
+diff -Nur linux-2.6.28.orig/include/asm-generic/Kbuild linux-2.6.28/include/asm-generic/Kbuild
+--- linux-2.6.28.orig/include/asm-generic/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/include/asm-generic/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -2,8 +2,10 @@
+ header-y += errno.h
+ header-y += fcntl.h
+ header-y += ioctl.h
++header-y += memory_model.h
+ header-y += mman.h
+ header-y += poll.h
++header-y += page.h
+ header-y += signal.h
+ header-y += statfs.h
+
+diff -Nur linux-2.6.28.orig/include/linux/Kbuild linux-2.6.28/include/linux/Kbuild
+--- linux-2.6.28.orig/include/linux/Kbuild 2008-12-25 00:26:37.000000000 +0100
++++ linux-2.6.28/include/linux/Kbuild 2008-12-29 20:48:51.000000000 +0100
+@@ -158,6 +158,7 @@
+ header-y += udf_fs_i.h
+ header-y += ultrasound.h
+ header-y += un.h
++header-y += user.h
+ header-y += utime.h
+ header-y += veth.h
+ header-y += video_decoder.h
diff --git a/toolchain/mpfr/Makefile b/toolchain/mpfr/Makefile
new file mode 100644
index 000000000..8009c3acf
--- /dev/null
+++ b/toolchain/mpfr/Makefile
@@ -0,0 +1,33 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include $(TOPDIR)/toolchain/gmp/Makefile.inc
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+$(WRKBUILD)/.configure_done:
+ (cd $(WRKBUILD); \
+ $(WRKBUILD)/configure \
+ --prefix=$(STAGING_TOOLS) \
+ --build=$(GNU_HOST_NAME) \
+ --host=$(GNU_HOST_NAME) \
+ --with-gmp-build=$(GMP_BUILD_DIR) \
+ --disable-shared \
+ --enable-static \
+ );
+ touch $@
+
+$(WRKBUILD)/.compiled: $(WRKBUILD)/.configure_done
+ $(MAKE) -C $(WRKBUILD) all
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) install
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/mpfr/Makefile.inc b/toolchain/mpfr/Makefile.inc
new file mode 100644
index 000000000..a30ff5c5b
--- /dev/null
+++ b/toolchain/mpfr/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= mpfr
+PKG_VERSION:= 2.4.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= c5ee0a8ce82ad55fe29ac57edd35d09e
+MASTER_SITES:= http://www.mpfr.org/mpfr-current/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/toolchain/rules.mk b/toolchain/rules.mk
new file mode 100644
index 000000000..bfe168d17
--- /dev/null
+++ b/toolchain/rules.mk
@@ -0,0 +1,7 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+WRKDIR_BASE= ${TOOLCHAIN_BUILD_DIR}
+WRKDIR= ${WRKDIR_BASE}
diff --git a/toolchain/uClibc/Makefile b/toolchain/uClibc/Makefile
new file mode 100644
index 000000000..8bf81f309
--- /dev/null
+++ b/toolchain/uClibc/Makefile
@@ -0,0 +1,72 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+_IN_CVTC= 1
+
+include $(TOPDIR)/rules.mk
+include ../rules.mk
+include Makefile.inc
+include ${TOPDIR}/mk/buildhlp.mk
+
+$(WRKBUILD)/.headers:
+ $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(WRKBUILD)/Rules.mak
+ sed -e 's^KERNEL_HEADERS.*$$KERNEL_HEADERS=\"${TOOLCHAIN_SYSROOT}/usr/include\"' \
+ $(TOPDIR)/target/$(DEVICE)/uclibc.config >${WRKBUILD}/.config
+ifeq ($(ADK_IPV6),y)
+ $(SED) 's,# UCLIBC_HAS_IPV6.*,UCLIBC_HAS_IPV6=y,' \
+ ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_SSP),y)
+ $(SED) 's,# UCLIBC_HAS_SSP.*,UCLIBC_HAS_SSP=y,' \
+ ${WRKBUILD}/.config
+ echo 'UCLIBC_BUILD_SSP=y' >> ${WRKBUILD}/.config
+ echo '# UCLIBC_HAS_SSP_COMPAT is not set' >> ${WRKBUILD}/.config
+ echo '# SSP_QUICK_CANARY is not set' >> ${WRKBUILD}/.config
+ echo 'PROPOLICE_BLOCK_ABRT=y' >> ${WRKBUILD}/.config
+ echo '# PROPOLICE_BLOCK_SEGV is not set' >> ${WRKBUILD}/.config
+endif
+ifeq ($(DEBUG),1)
+ $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
+endif
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(TOOLCHAIN_SYSROOT)/ \
+ DEVEL_PREFIX=/usr/ \
+ RUNTIME_PREFIX=$(TOOLCHAIN_SYSROOT)/ \
+ HOSTCC="$(HOSTCC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ install_headers
+ touch $(WRKBUILD)/.configure_done
+ touch $@
+
+$(WRKBUILD)/.compiled:
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX= \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ HOSTCC="$(HOSTCC)" \
+ CPU_CFLAGS="$(TARGET_CFLAGS)" \
+ all
+ touch $@
+
+$(WRKBUILD)/.install_headers: $(WRKBUILD)/.compiled
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_DIR) \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ install_dev
+ touch $@
+
+$(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
+ $(MAKE) -C $(WRKBUILD) \
+ PREFIX=$(STAGING_DIR) \
+ DEVEL_PREFIX=/ \
+ RUNTIME_PREFIX=/ \
+ install_runtime
+ echo $(PKG_VERSION) >$(STAGING_DIR)/uclibc_version
+ rm -rf $(STAGING_DIR)/lib/libc.so
+ ln -s libc.so.0 $(STAGING_DIR)/lib/libc.so
+ touch $@
+
+include ${TOPDIR}/mk/toolchain.mk
diff --git a/toolchain/uClibc/Makefile.inc b/toolchain/uClibc/Makefile.inc
new file mode 100644
index 000000000..b047ea910
--- /dev/null
+++ b/toolchain/uClibc/Makefile.inc
@@ -0,0 +1,11 @@
+# $Id$
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+PKG_NAME:= uClibc
+PKG_VERSION:= 0.9.30.1
+PKG_RELEASE:= 1
+PKG_MD5SUM:= 1a4b84e5536ad8170563ffa88c34679c
+MASTER_SITES:= http://uclibc.org/downloads/
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2